 |
Crossfire Server, Trunk
1.75.0
|
Go to the documentation of this file.
51 "Eck!...that was poisonous!");
55 "You begin to feel better.");
58 "Eck!...that was poisonous!");
65 "You are drained of mana!");
72 "You feel a rush of magical energy!");
75 "You are drained of mana!");
86 if (capacity_remaining < food->
stats.food)
87 applier->
stats.
hp += capacity_remaining / 50;
94 const int wasted_food = food->
stats.
food - capacity_remaining;
95 if (wasted_food > 0) {
98 if (wasted_food > thresh) {
105 snprintf(
buf,
sizeof(
buf),
106 "%s the %s makes you %s full. You feel yourself moving %s "
109 wasted_food > thresh ?
"very" :
"rather",
110 wasted_food > thresh ?
"much" :
"somewhat");
153 snprintf(
buf,
sizeof(
buf),
"You have been dead for too long to taste %s, ", food->
name);
157 "and seem to have obtained a taste for living flesh.");
162 snprintf(
buf,
sizeof(
buf),
"You can no longer taste %s, and do not feel less hungry after %s it.", food->
name, food->
type ==
DRINK ?
"drinking" :
"eating");
171 snprintf(
buf,
sizeof(
buf),
"Ahhh...that %s tasted good.", food->
name);
173 snprintf(
buf,
sizeof(
buf),
"The %s tasted %s", food->
name, food->
type ==
FLESH ?
"terrible!" :
"good.");
176 snprintf(
buf,
sizeof(
buf),
"The %s tasted terrible!", food->
name);
225 if (food->
resist[i] > 0) {
368 double totalchance = 1;
388 if (skin == NULL || abil == NULL)
424 atnr_winner[winners] = i;
429 totalchance *= 1-
chance/100;
436 totalchance = 100-totalchance*100;
438 if (totalchance > 50.)
439 snprintf(
buf,
sizeof(
buf),
"Hmm! The %s tasted delicious!", meal->
name);
440 else if (totalchance > 10.)
441 snprintf(
buf,
sizeof(
buf),
"The %s tasted very good.", meal->
name);
442 else if (totalchance > 1.)
443 snprintf(
buf,
sizeof(
buf),
"The %s tasted good.", meal->
name);
444 else if (totalchance > 0.1)
445 snprintf(
buf,
sizeof(
buf),
"The %s tasted bland.", meal->
name);
446 else if (totalchance >= 0.01)
447 snprintf(
buf,
sizeof(
buf),
"The %s had a boring taste.", meal->
name);
449 snprintf(
buf,
sizeof(
buf),
"The %s tasted strange.", meal->
name);
451 snprintf(
buf,
sizeof(
buf),
"The %s had no taste.", meal->
name);
458 i = atnr_winner[
RANDOM()%winners];
460 if (i >= 0 && i < NROFATTACKS && skin->resist[i] < 95) {
466 "Your skin is now more resistant to %s!",
480 "Your metabolism prepares to focus on %s!",
483 "The change will happen at level %d",
487 "Your metabolism will continue to focus on %s.",
struct Settings settings
Server settings.
int16_t maxhp
Max hit points.
int16_t max_level
This is read out of exp_table.
void init_type_food(void)
Initializer for the food object type.
@ llevError
Error, serious thing.
uint32_t path_attuned
Paths the object is attuned to.
void LOG(LogLevel logLevel, const char *format,...)
Logs a message to stderr, or to file.
#define FLAG_UNDEAD
Monster is undead.
@ FLESH
animal 'body parts' -b.t.
#define QUERY_FLAG(xyz, p)
bool is_wraith
Whether this player is a wraith or not, initialized at load time.
#define FLAG_REFL_MISSILE
Arrows will reflect from object.
#define FLAG_SEE_IN_DARK
if set ob not effected by darkness
static int dragon_eat_flesh(object *op, object *meal)
A dragon is eating some flesh.
void register_apply(int ob_type, apply_func method)
Registers the apply method for the given type.
float speed
Frequency of object 'moves' relative to server tick rate.
struct mapstruct * map
Pointer to the map in which this object is present.
object * give_skill_by_name(object *op, const char *skill_name)
Given the skill name skill_name, we find the skill archetype/object, set appropriate values,...
#define MSG_TYPE_APPLY_CURSED
Applied a cursed object (BAD)
#define MSG_TYPE_ATTRIBUTE
Changes to attributes (stats, resistances, etc)
void draw_ext_info_format(int flags, int pri, const object *pl, uint8_t type, uint8_t subtype, const char *format,...) PRINTF_ARGS(6
void play_sound_map(int8_t sound_type, object *emitter, int dir, const char *action)
Plays a sound on a map.
void fix_object(object *op)
Updates all abilities given by applied objects in the inventory of the given object.
sstring title
Of foo, etc.
#define FLAG_APPLIED
Object is ready for use by living.
int16_t level
Level of creature or object.
#define FLAG_STEALTH
Will wake monsters with less range.
object * object_insert_in_ob(object *op, object *where)
This function inserts the object op in the linked list inside the object environment.
static void eat_special_food(object *who, object *food)
Handles player eating food that temporarily changes status (resistances, stats).
int16_t resist[NROFATTACKS]
Resistance adjustments for attacks.
#define FLAG_NO_PICK
Object can't be picked up.
uint32_t path_denied
Paths the object is denied access to.
int16_t y
Position in the map for this object.
uint32_t path_repelled
Paths the object is repelled from.
static method_ret food_type_apply(object *food, object *applier, int aflags)
Handles applying food.
void object_free_drop_inventory(object *ob)
Frees everything allocated by an object, removes it from the list of used objects,...
struct player * contr
Pointer to the player which control this object.
int slow_living_by(object *op, const int speed_penalty)
#define object_decrease_nrof_by_one(xyz)
char killer[BIG_NAME]
Who killed this player.
#define MSG_TYPE_ATTRIBUTE_RACE
Race-related changes.
#define MSG_TYPE_ATTRIBUTE_BAD_EFFECT_START
Start of a bad effect to the player.
#define MSG_TYPE_APPLY_SUCCESS
Was able to apply object.
#define MSG_TYPE_ATTRIBUTE_PROTECTION_GAIN
Protections in this.
MoveType move_type
Type of movement this object uses.
void set_attr_value(living *stats, int attr, int8_t value)
Sets Str/Dex/con/Wis/Cha/Int/Pow in stats to value, depending on what attr is (STR to POW).
#define FLAG_BLIND
If set, object cannot see (visually)
#define FLAG_MAKE_INVIS
(Item) gives invisibility when applied
const char *const change_resist_msg[NROFATTACKS]
These are the descriptions of the resistances displayed when a player puts on/takes off an item.
int32_t last_eat
How long since we last ate.
void object_update_speed(object *op)
Updates the speed of an object.
uint8_t type
PLAYER, BULLET, etc.
int32_t food
How much food in stomach.
static void eat_common(object *applier, object *food)
#define FLAG_CAN_USE_SKILL
The monster can use skills.
object * object_insert_in_map_at(object *op, mapstruct *m, object *originator, int flag, int x, int y)
Same as object_insert_in_map() except it handle separate coordinates and do a clean job preparing mul...
struct archetype * other_arch
Pointer used for various things - mostly used for what this objects turns into or what this object cr...
#define MAX_BUF
Used for all kinds of things.
#define INS_ON_TOP
Always put object on top.
int is_wraith_pl(object *op)
Tests if a player is a wraith.
object * create_archetype(const char *name)
Finds which archetype matches the given name, and returns a new object containing a copy of the arche...
int8_t wc
Weapon Class, lower WC increases probability of hitting.
int16_t maxgrace
Maximum grace.
int change_abil(object *op, object *tmp)
Permanently alters an object's stats/flags based on another object.
char method_ret
Define some standard return values for callbacks which don't need to return any other results.
#define FLAG_REFL_SPELL
Spells (some) will reflect from object.
#define NDI_UNIQUE
Print immediately, don't buffer.
void apply_handle_yield(object *tmp)
This checks whether the object has a "on_use_yield" field, and if so generated and drops matching ite...
sstring name
The name of the object, obviously...
int is_dragon_pl(const object *op)
Checks if player is a dragon.
int16_t maxsp
Max spell points.
int hit_player(object *op, int dam, object *hitter, uint32_t type, int full_hit)
Object is attacked by something.
int8_t ac
Armor Class, lower AC increases probability of not getting hit.
int16_t duration
Number of moves (see 'speed') spell lasts.
int atnr_is_dragon_enabled(int attacknr)
Determine if the attacktype represented by the specified attack-number is enabled for dragon players.
object * object_find_by_type_and_arch_name(const object *who, int type, const char *name)
Find object in inventory by type and archetype name.
object * arch_to_object(archetype *at)
Creates and returns a new object which is a copy of the given archetype.
Player Stats effect how well a character can survie and interact inside the crossfire world This section discusses the various stats
#define MSG_TYPE_APPLY_FAILURE
Apply OK, but no/bad result.
#define FLAG_IS_USED_UP
When (–food<0) the object will exit.
static void check_heal_and_mana(object *who, object *food)
#define FLAG_XRAYS
X-ray vision.
int is_old_wraith_pl(object *op)
Checks if player is a wraith without the 'wraith feed' skill.
bool chance(int a, int b)
Return true with a probability of a/b.
living stats
Str, Con, Dex, etc.
int8_t get_attr_value(const living *stats, int attr)
Gets the value of a stat.
Player Stats effect how well a character can survie and interact inside the crossfire world This section discusses the various what they and how they effect the player s actions Also in this section are the stat modifiers that specific classes professions bring Player and sps the current and maximum the Current and Maximum The Current Sp can go somewhat negative When Sp is negative not all spells can be and a more negative Sp makes spell casting less likey to succeed can affect Damage and how the characters as well as how often the character can attack this affects the prices when buying and selling items if this drops the player will start losing hit points wd Cleric or Dwarf sm Elf wd Fireborn ft Human ra Mage C Monk se Ninja hi Priest C Quetzalcoatl mw Swashbuckler si Thief st Viking ba Warrior or Wizard C Wraith C Class Prof Str Dex Con Wis Cha Int Pow Net Skills Enclosed are codes used for the skills above The ones in and fighting should all be pretty self explanatory For the other a brief description is for a more detailed look at the skills doc file Skill remove use magic items phys no fire cold Fireborns are supposed to be fire spirits They re closely in tune with magic and are powerful and learn magic easily Being fire they are immune to fire and and vulnerable to cold They are vulnerable to ghosthit and drain because being mostly non anything which strikes directly at the spirit hits them harder race attacktype restrictions immunities prot vuln Quetzalcoatl physical no armour fire cold Quetzalcoatl s are now born knowing the spell of burning but because of their negative wisdom bonus
void link_player_skills(object *op)
This function goes through the player inventory and sets up the last_skills[] array in the player obj...
#define MSG_TYPE_APPLY
Applying objects.
uint32_t attacktype
Bitmask of attacks this object does.
#define FLAG_CURSED
The object is cursed.
static const float MOVE_PER_SECOND
Speed of an object that gives it one move per second, real time.
@ NUM_STATS
Number of statistics.
static const int32_t MAX_FOOD
int8_t luck
Affects thaco and ac from time to time.
#define FLAG_LIFESAVE
Saves a players' life once, then destr.