Crossfire Server, Branches 1.12
R18729
|
#include <global.h>
#include <object.h>
#include <living.h>
#include <sproto.h>
#include <spells.h>
#include <sounds.h>
#include <skills.h>
#include <assert.h>
Go to the source code of this file.
Functions | |
static void | check_infection (object *disease) |
void | check_physically_infect (object *victim, object *hitter) |
int | cure_disease (object *sufferer, object *caster) |
static void | do_symptoms (object *disease) |
static object * | find_symptom (object *disease) |
static void | grant_immunity (object *disease) |
int | infect_object (object *victim, object *disease, int force) |
static int | is_susceptible_to_disease (object *victim, object *disease) |
int | move_disease (object *disease) |
void | move_symptom (object *symptom) |
static void | remove_symptoms (object *disease) |
This file contains all the code implementing diseases, except for odds and ends in attack.c and in living.c
Definition in file disease.c.
|
static |
Searches around for more victims to infect.
disease | disease infecting. Can be either on a map or inside another object. |
Definition at line 285 of file disease.c.
References obj::above, obj::env, get_map_flags(), GET_MAP_OB, infect_object(), obj::magic, obj::map, P_IS_ALIVE, P_OUT_OF_MAP, obj::x, and obj::y.
Referenced by move_disease().
Possibly infect due to direct physical contact i.e., AT_PHYSICAL.
victim | potential victim. |
hitter | who is hitting. |
Definition at line 694 of file disease.c.
References obj::below, DISEASE, infect_object(), obj::inv, and obj::type.
Referenced by hit_with_one_attacktype().
Do the cure disease stuff, from the spell "cure disease".
sufferer | who is getting cured. |
caster | spell object used for curing. If NULL all diseases are removed, else only those of lower level than caster or randomly chosen. |
0 | no disease was cured. |
1 | at least one disease was cured. |
Definition at line 715 of file disease.c.
References obj::below, change_exp(), obj::chosen_skill, DISEASE, draw_ext_info(), draw_ext_info_format(), liv::exp, FLAG_STARTEQUIP, free_object(), obj::inv, obj::level, MSG_TYPE_ATTRIBUTE, MSG_TYPE_ATTRIBUTE_BAD_EFFECT_END, MSG_TYPE_SPELL, MSG_TYPE_SPELL_HEAL, NDI_UNIQUE, PREFER_LOW, QUERY_FLAG, random_roll(), remove_ob(), remove_symptoms(), obj::skill, obj::stats, and obj::type.
Referenced by cast_heal(), and kill_player().
|
static |
This function monitors the symptoms caused by the disease (if any), causes symptoms, and modifies existing symptoms in the case of existing diseases.
disease | disease acting. Should be in a living object. |
Definition at line 452 of file disease.c.
References liv::ac, add_refcount(), add_string(), ARCH_SYMPTOM, obj::attacktype, obj::below, liv::Cha, liv::Con, create_archetype(), liv::dam, liv::Dex, obj::env, liv::exp, FABS, find_symptom(), fix_object(), FLAG_APPLIED, FLAG_WIZ, liv::food, FREE_AND_COPY, free_string(), obj::head, liv::hp, insert_ob_in_ob(), liv::Int, obj::inv, is_susceptible_to_disease(), obj::last_eat, obj::last_sp, obj::level, liv::maxgrace, liv::maxsp, obj::move_block, obj::msg, obj::name, obj::name_pl, obj::other_arch, obj::owner, liv::Pow, PREFER_LOW, QUERY_FLAG, random_roll(), SET_FLAG, set_owner(), SIGN, obj::skill, liv::sp, obj::speed, obj::stats, liv::Str, obj::type, obj::value, and liv::Wis.
Referenced by move_disease().
Find a symptom for a disease in disease's env.
disease | disease to search symptom of. Must be in another object. |
Definition at line 267 of file disease.c.
References obj::below, obj::env, obj::inv, obj::name, SYMPTOM, and obj::type.
Referenced by do_symptoms(), and remove_symptoms().
|
static |
Grants immunity to a disease.
disease | disease to grant immunity to. Must be in another object. |
Definition at line 584 of file disease.c.
References add_string(), obj::below, create_archetype(), obj::env, insert_ob_in_ob(), obj::inv, obj::last_heal, obj::level, obj::move_block, obj::name, SIGN, and obj::type.
Referenced by move_disease().
Try to infect something with a disease. Rules:
victim | potential victim to infect. |
disease | what could infect. |
force | don't do a random check for infection. Other checks (susceptible to disease, not immune, and so on) are still done. |
0 | victim wasn't infected. |
1 | victim was infected. |
Definition at line 336 of file disease.c.
References add_refcount(), obj::below, copy_object(), DISEASE, draw_ext_info(), obj::env, FLAG_MONSTER, liv::food, free_string(), get_object(), get_owner(), obj::head, insert_ob_in_ob(), obj::inv, is_susceptible_to_disease(), obj::last_grace, obj::level, obj::map, liv::maxgrace, liv::maxhp, obj::move_block, MSG_TYPE_ATTACK, MSG_TYPE_ATTACK_DID_HIT, MSG_TYPE_ATTRIBUTE, MSG_TYPE_ATTRIBUTE_BAD_EFFECT_START, obj::name, NDI_RED, NDI_UNIQUE, op_on_battleground(), obj::owner, PLAYER, PREFER_HIGH, QUERY_FLAG, random_roll(), set_owner(), SIGN, obj::skill, snprintf(), obj::stats, obj::title, obj::type, obj::value, and liv::wc.
Referenced by cast_cause_disease(), check_infection(), check_physically_infect(), and rune_attack().
Check if victim is susceptible to disease. Does not check for immunity.
victim | potential victim. |
disease | disease to check. |
1 | victim can be infected |
0 | victim doesn't care for the disease. |
Definition at line 165 of file disease.c.
References FLAG_ALIVE, FLAG_UNDEAD, FLAG_WIZ, obj::name, QUERY_FLAG, obj::race, and undead_name.
Referenced by do_symptoms(), infect_object(), and move_disease().
int move_disease | ( | object * | disease | ) |
Ticks the clock for disease: infect, aggravate symptoms, ...
disease | disease to move. Can be removed during processing. |
1 | if disease was removed. |
0 | disease just moved. |
Definition at line 192 of file disease.c.
References check_infection(), do_symptoms(), obj::env, FLAG_WIZ, liv::food, free_object(), grant_immunity(), is_susceptible_to_disease(), liv::maxhp, QUERY_FLAG, remove_ob(), remove_symptoms(), obj::stats, and obj::value.
Referenced by legacy_ob_process().
void move_symptom | ( | object * | symptom | ) |
Make the symptom do the nasty things it does.
symptom | symptom to move. |
Definition at line 615 of file disease.c.
References arch_to_object(), obj::attacktype, obj::count, liv::dam, draw_ext_info(), obj::env, FLAG_FREED, FREE_AND_COPY, free_object(), obj::head, hit_player(), insert_ob_in_map(), llevError, LOG(), obj::map, MAX, MAX_BUF, liv::maxhp, liv::maxsp, obj::more, obj::msg, MSG_TYPE_ATTRIBUTE, MSG_TYPE_ATTRIBUTE_BAD_EFFECT_START, obj::name, obj::name_pl, NDI_RED, NDI_UNIQUE, obj::other_arch, QUERY_FLAG, remove_ob(), snprintf(), liv::sp, obj::stats, was_destroyed, obj::x, and obj::y.
Referenced by legacy_ob_process().
|
static |
Remove any symptoms of disease.
Modified by MSW 2003-03-28 do try to find all the symptom the player may have - I think through some odd interactoins with disease level and player level and whatnot, a player could get more than one symtpom to a disease.
disease | disease to remove. Must be in a living object. |
Definition at line 244 of file disease.c.
References obj::env, find_symptom(), fix_object(), free_object(), and remove_ob().
Referenced by cure_disease(), and move_disease().