 |
Crossfire Server, Trunk
1.75.0
|
Go to the documentation of this file.
164 if ((victim->
race && strstr(disease->
race, victim->
race))
165 || strstr(disease->
race, victim->
name))
189 if (disease->
env == NULL) {
192 if (disease->
value == 0) {
233 object *symptom, *victim = NULL;
235 assert(disease != NULL);
239 victim = symptom->
env;
256 assert(disease->
env != NULL);
269 int x, y, range, mflags;
271 int16_t i, j, i2, j2;
273 range = abs(disease->
magic);
286 for (i = x-range; i <= x+range; i++) {
287 for (j = y-range; j <= y+range; j++) {
322 victim =
HEAD(victim);
355 if (tmp != NULL && tmp->
level >= disease->
level)
377 if (new_disease->
skill)
405 if (new_disease->
title)
408 snprintf(
buf,
sizeof(
buf),
"You infect %s with your disease, %s!", victim->
name, new_disease->
name);
419 "You suddenly feel ill.");
436 victim = disease->
env;
443 if (victim == NULL || victim == disease)
451 if (symptom == NULL) {
454 int reduce_level = 0;
467 reduce_level = tmp->
level;
492 new_symptom->
level = disease->
level - reduce_level;
494 new_symptom->
value = 0;
514 if (new_symptom->
skill)
534 scale = 1.0+symptom->
value/100.0;
538 cur_stat = (int)(scale * cur_stat);
571 assert(disease->
env != NULL);
575 if (immunity != NULL) {
593 object *victim = symptom->
env;
598 if (victim == NULL || victim->
map == NULL) {
634 for (tmp =
HEAD(victim); tmp != NULL; tmp = tmp->
more) {
648 LOG(
llevError,
"BUG: move_symptom(): symptom %d (%s) without message!\n", symptom->
count, symptom->
name);
690 casting_level = caster->
level;
692 casting_level = 1000;
702 if ((casting_level >= disease->level)
717 "You cure a disease!");
720 "You no longer feel diseased.");
#define object_was_destroyed(op, old_tag)
Checks if an object still exists.
sstring name_pl
The plural name of the object.
object * object_get_owner(object *op)
Returns the object which this object marks as being the owner.
int infect_object(object *victim, object *disease, int force)
Try to infect something with a disease.
struct Settings settings
Global settings.
#define FOR_MAP_FINISH()
Finishes FOR_MAP_PREPARE().
int16_t maxhp
Max hit points.
@ llevError
Error, serious thing.
#define FABS(x)
Decstations have trouble with fabs()...
void LOG(LogLevel logLevel, const char *format,...)
Logs a message to stderr, or to file.
#define FLAG_UNDEAD
Monster is undead.
#define FLAG_STARTEQUIP
Object was given to player at start.
#define QUERY_FLAG(xyz, p)
int op_on_battleground(object *op, int *x, int *y, archetype **trophy)
Check if the given object (usually a player) is standing on a battleground tile.
#define MSG_TYPE_ATTACK_DID_HIT
Player hit something else.
float speed
Frequency of object 'moves' relative to server tick rate.
struct mapstruct * map
Pointer to the map in which this object is present.
void object_set_owner(object *op, object *owner)
Sets the owner and sets the skill and exp pointers to owner's current skill and experience objects.
#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
tag_t count
Unique object number for this object.
int16_t last_grace
As last_sp, except for grace.
static int is_susceptible_to_disease(object *victim, object *disease)
Check if victim is susceptible to disease.
void object_copy(const object *src_ob, object *dest_ob)
Copy object first frees everything allocated by the second object, and then copies the contents of th...
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 P_IS_ALIVE
Something alive is on this space.
#define FLAG_APPLIED
Object is ready for use by living.
int16_t level
Level of creature or object.
object * object_insert_in_ob(object *op, object *where)
This function inserts the object op in the linked list inside the object environment.
#define MSG_TYPE_SPELL_HEAL
Healing related spells.
Plugin animator file specs[Config] name
#define FLAG_ALIVE
Object can fight (or be fought)
int16_t y
Position in the map for this object.
void object_free_drop_inventory(object *ob)
Frees everything allocated by an object, removes it from the list of used objects,...
int32_t last_heal
Last healed.
sstring add_refcount(sstring str)
This will increase the refcount of the string str.
#define MSG_TYPE_ATTRIBUTE_BAD_EFFECT_START
Start of a bad effect to the player.
sstring add_string(const char *str)
This will add 'str' to the hash table.
#define HEAD(op)
Returns the head part of an object.
object * object_find_by_type_and_name(const object *who, int type, const char *name)
Find object in inventory by type and name.
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_FREED
Object is in the list of free objects.
#define MSG_TYPE_ATTACK
Attack related messages.
int32_t last_eat
How long since we last ate.
int32_t value
How much money it is worth (or contains)
void move_symptom(object *symptom)
Make the symptom do the nasty things it does.
#define FREE_AND_COPY(sv, nv)
Release the shared string if not NULL, and make it a reference to nv.
uint8_t type
PLAYER, BULLET, etc.
static void grant_immunity(object *disease)
Grants immunity to a disease.
int16_t dam
How much damage this object does when hitting.
int8_t magic
Any magical bonuses to this item.
int move_disease(object *disease)
Ticks the clock for disease: infect, aggravate symptoms, ...
#define FOR_INV_FINISH()
Finishes FOR_INV_PREPARE().
int32_t food
How much food in stomach.
void change_exp(object *op, int64_t exp, const char *skill_name, int flag)
Changes experience to a player/monster.
uint32_t tag_t
Object tag, unique during the whole game.
#define MSG_TYPE_SPELL
Spell related info.
int random_roll(int min, int max, const object *op, int goodbad)
Roll a random number between min and max.
sstring race
Human, goblin, dragon, etc.
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 FLAG_MONSTER
Will attack players.
#define P_OUT_OF_MAP
This space is outside the map.
#define MAX_BUF
Used for all kinds of things.
static object * find_symptom(object *disease)
Find a symptom for a disease in disease's env.
object * object_new(void)
Grabs an object from the list of unused objects, makes sure it is initialised, and returns it.
object * create_archetype(const char *name)
Finds which archetype matches the given name, and returns a new object containing a copy of the arche...
void free_string(sstring str)
This will reduce the refcount, and if it has reached 0, str will be freed.
int8_t wc
Weapon Class, lower WC increases probability of hitting.
void check_physically_infect(object *victim, object *hitter)
Possibly infect due to direct physical contact i.e., AT_PHYSICAL.
int16_t maxgrace
Maximum grace.
#define FOR_MAP_PREPARE(map_, mx_, my_, it_)
Constructs a loop iterating over all objects of a map tile.
#define FLAG_WIZ
Object has special privilegies.
#define NDI_UNIQUE
Print immediately, don't buffer.
sstring name
The name of the object, obviously...
int get_map_flags(mapstruct *oldmap, mapstruct **newmap, int16_t x, int16_t y, int16_t *nx, int16_t *ny)
This rolls up wall, blocks_magic, blocks_view, etc, all into one function that just returns a P_.
int16_t maxsp
Max spell points.
object * env
Pointer to the object which is the environment.
int32_t last_sp
As last_heal, but for spell points.
const typedef char * sstring
sstring skill
Name of the skill this object uses/grants.
void object_set_msg(object *op, const char *msg)
Set the message field of an object.
uint8_t max_stat
Maximum stat value - 255 should be sufficient.
sstring msg
If this is a book/sign/magic mouth/etc.
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.
static void do_symptoms(object *disease)
This function monitors the symptoms caused by the disease (if any), causes symptoms,...
object * arch_to_object(archetype *at)
Creates and returns a new object which is a copy of the given archetype.
static void check_infection(object *disease)
Searches around for more victims to infect.
static void remove_symptoms(object *disease)
Remove any symptoms of disease.
#define MSG_TYPE_ATTRIBUTE_BAD_EFFECT_END
End of a bad effect.
void object_remove(object *op)
This function removes the object op from the linked list of objects which it is currently tied to.
int cure_disease(object *sufferer, object *caster, sstring skill)
Do the cure disease stuff, from the spell "cure disease".
living stats
Str, Con, Dex, etc.
object * more
Pointer to the rest of a large body of objects.
int8_t get_attr_value(const living *stats, int attr)
Gets the value of a stat.
uint32_t attacktype
Bitmask of attacks this object does.
void check_stat_bounds(living *stats, int8_t min_stat, int8_t max_stat)
Ensures that all stats (str/dex/con/wis/cha/int) are within the passed in range of min_stat and max_s...
@ NUM_STATS
Number of statistics.
MoveType move_block
What movement types this blocks.
#define FOR_INV_PREPARE(op_, it_)
Constructs a loop iterating over the inventory of an object.
#define ARCH_SYMPTOM
Archetype for disease symptom.