Atrinik Server  4.0
Functions
disease.c File Reference
#include <global.h>
#include <arch.h>
#include <exp.h>
#include <object.h>
#include <object_methods.h>
#include <disease.h>

Go to the source code of this file.

Functions

static bool disease_is_susceptible (object *op, object *victim)
 
static objectdisease_find_symptom (object *op)
 
static void disease_remove_symptoms (object *op)
 
static void disease_check_infection (object *op)
 
static void disease_do_symptoms (object *op)
 
static void disease_grant_immunity (object *op)
 
static void process_func (object *op)
 
 OBJECT_TYPE_INIT_DEFINE (disease)
 
bool disease_infect (object *op, object *victim, bool force)
 
void disease_physically_infect (object *op, object *hitter)
 
bool disease_cure (object *op, object *caster)
 
bool disease_reduce_symptoms (object *op, 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 disease_check_infection ( object op)
static

Searches around for more victims to infect.

Parameters
opDisease infecting.

Definition at line 125 of file disease.c.

bool disease_cure ( object op,
object caster 
)

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

Parameters
opWho 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
True if at least one disease was cured, false otherwise.

Definition at line 507 of file disease.c.

static void disease_do_symptoms ( object op)
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
opThe disease.

Definition at line 185 of file disease.c.

static object* disease_find_symptom ( object op)
static

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

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

Definition at line 88 of file disease.c.

static void disease_grant_immunity ( object op)
static

Grants immunity to a disease.

Parameters
opDisease to grant immunity to.

Definition at line 303 of file disease.c.

bool disease_infect ( object op,
object victim,
bool  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 infectable 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
True if the victim was infected, false otherwise.

Definition at line 396 of file disease.c.

static bool disease_is_susceptible ( object op,
object victim 
)
static

Check if victim is susceptible to disease.

Parameters
opDisease to check.
victimVictim.
Returns
True if the victim can be infected, false otherwise.

Definition at line 54 of file disease.c.

void disease_physically_infect ( object op,
object hitter 
)

Possibly infect due to direct physical contact.

Parameters
opThe victim.
hitterThe hitter.

Definition at line 483 of file disease.c.

bool disease_reduce_symptoms ( object op,
int  reduction 
)

Reduces disease progression.

Parameters
opThe sufferer.
reductionHow much to reduce the disease progression.
Returns
True if we actually reduce a disease, false otherwise.

Definition at line 585 of file disease.c.

static void disease_remove_symptoms ( object op)
static

Remove any symptoms of disease.

Parameters
opThe disease.

Definition at line 108 of file disease.c.

OBJECT_TYPE_INIT_DEFINE ( disease  )

Initialize the disease type object methods.

Definition at line 373 of file disease.c.

static void process_func ( object op)
static

Processes an object, giving it the opportunity to move or react.

Parameters
opThe object to process.

Definition at line 330 of file disease.c.