Atrinik Server 2.5
Functions
types/disease.c File Reference
#include <global.h>

Go to the source code of this file.

Functions

static int is_susceptible_to_disease (object *victim, object *disease)
static void remove_symptoms (object *disease)
static objectfind_symptom (object *disease)
static void check_infection (object *disease)
static void do_symptoms (object *disease)
static void grant_immunity (object *disease)
int move_disease (object *disease)
int infect_object (object *victim, object *disease, int force)
void move_symptom (object *symptom)
void check_physically_infect (object *victim, object *hitter)
int cure_disease (object *sufferer, object *caster)
int reduce_symptoms (object *sufferer, int reduction)

Detailed Description

This file contains all the code implementing diseases, except for odds and ends in attack.c and in living.c.

Diseases may be contagious. They are objects which exist in a player's inventory. They themselves do nothing, except modify symptoms, or spread to other live objects. symptoms are what actually damage the player.

Definition in file disease.c.


Function Documentation

static void check_infection ( object disease) [static]

Searches around for more victims to infect.

Parameters:
diseaseDisease infecting.

Definition at line 170 of file disease.c.

void check_physically_infect ( object victim,
object hitter 
)

Possibly infect due to direct physical contact.

Called from doing physical attack in hit_player_attacktype().

Parameters:
victimThe victim.
hitterThe hitter.

Definition at line 624 of file disease.c.

int cure_disease ( object sufferer,
object caster 
)

Do the cure disease stuff, from the spell "cure disease".

Parameters:
suffererWho is getting cured.
casterSpell object used for curing. If NULL all diseases are removed, otherwise only those of lower level than caster or randomly chosen.
Returns:
1 if at least one disease was cured, 0 otherwise.

Definition at line 645 of file disease.c.

static void do_symptoms ( object disease) [static]

This function monitors the symptoms caused by the disease (if any), causes symptoms, and modifies existing symptoms in the case of existing diseases.

Parameters:
diseaseThe disease.

Definition at line 366 of file disease.c.

static object * find_symptom ( object disease) [static]

Find a symptom for a disease in disease's env.

Parameters:
diseaseThe disease.
Returns:
Matching symptom object, NULL if not found.

Definition at line 151 of file disease.c.

static void grant_immunity ( object disease) [static]

Grants immunity to a disease.

Parameters:
diseasedisease to grant immunity to.

Definition at line 518 of file disease.c.

int infect_object ( object victim,
object disease,
int  force 
)

Try to infect something with a disease. Rules are:

  • Objects with immunity aren't infectable.
  • Objects already infected aren't infectable.
  • Dead objects aren't infectable.
  • Undead objects are infectible only if specifically named.
    Parameters:
    victimVictim to try infect.
    diseaseThe disease.
    forceDon't do a random check for infection. Other checks (susceptible to disease, not immune, and so on) are still done.
    Returns:
    1 if the victim was infected, 0 otherwise.

Definition at line 243 of file disease.c.

static int is_susceptible_to_disease ( object victim,
object disease 
) [static]

Check if victim is susceptible to disease.

Parameters:
victimVictim.
diseaseDisease to check.
Returns:
1 if the victim can be infected, 0 otherwise.

Definition at line 50 of file disease.c.

int move_disease ( object disease)

Ticks the clock for disease: infect, do symptoms, etc.

Parameters:
diseaseThe disease.
Returns:
1 if the disease was removed, 0 otherwise.

Definition at line 79 of file disease.c.

void move_symptom ( object symptom)

Make the symptom do the nasty things it does.

Parameters:
symptomSymptom to move.

Definition at line 549 of file disease.c.

int reduce_symptoms ( object sufferer,
int  reduction 
)

Reduces disease progression.

Parameters:
suffererThe sufferer.
reductionHow much to reduce the disease progression.
Returns:
1 if we actually reduce a disease, 0 otherwise.

Definition at line 736 of file disease.c.

static void remove_symptoms ( object disease) [static]

Remove any symptoms of disease.

Parameters:
diseaseThe disease.

Definition at line 131 of file disease.c.