Atrinik Server  4.0
Macros | Typedefs | Enumerations | Functions | Variables
attack.h File Reference

Go to the source code of this file.

Macros

#define LAST_PROTECTION   (ATNR_CONFUSION + 1)
 

Typedefs

typedef enum atnr atnr_t
 

Enumerations

enum  atnr {
  ATNR_IMPACT, ATNR_SLASH, ATNR_CLEAVE, ATNR_PIERCE,
  ATNR_WEAPON_MAGIC, ATNR_FIRE, ATNR_COLD, ATNR_ELECTRICITY,
  ATNR_POISON, ATNR_ACID, ATNR_MAGIC, ATNR_LIFESTEAL,
  ATNR_BLIND, ATNR_PARALYZE, ATNR_FORCE, ATNR_GODPOWER,
  ATNR_CHAOS, ATNR_DRAIN, ATNR_SLOW, ATNR_CONFUSION,
  ATNR_INTERNAL, NROFATTACKS
}
 

Functions

int attack_object (object *op, object *hitter)
 
int attack_hit (object *op, object *hitter, int dam)
 
void attack_hit_map (object *op, int dir, bool multi_reduce)
 
bool attack_kill (object *op, object *hitter)
 
void attack_perform_poison (object *op, object *hitter, double dam)
 
void attack_perform_slow (object *op)
 
void attack_perform_confusion (object *op)
 
void attack_perform_blind (object *op, object *hitter, double dam)
 
void attack_peform_paralyze (object *op, double dam)
 
void attack_perform_fall (object *op, int fall_floors)
 
bool attack_is_melee_range (object *hitter, object *enemy)
 

Variables

const char *const attack_save [NROFATTACKS]
 
const char *const attack_name [NROFATTACKS]
 

Detailed Description

Attack and defense system macros, defines, etc.

Definition in file attack.h.

Macro Definition Documentation

#define LAST_PROTECTION   (ATNR_CONFUSION + 1)

Last valid protection, used for treasure generation.

Definition at line 94 of file attack.h.

Typedef Documentation

typedef enum atnr atnr_t

The attack IDs.

Enumeration Type Documentation

enum atnr

The attack IDs.

Enumerator
ATNR_IMPACT 

Impact.

ATNR_SLASH 

Slash.

ATNR_CLEAVE 

Cleave.

ATNR_PIERCE 

Pierce.

ATNR_WEAPON_MAGIC 

Weapon magic. Common for spells like magic bullet.

ATNR_FIRE 

Fire.

ATNR_COLD 

Cold.

ATNR_ELECTRICITY 

Electricity.

ATNR_POISON 

Poison,

ATNR_ACID 

Acid.

ATNR_MAGIC 

Magic.

ATNR_LIFESTEAL 

Mind.

ATNR_BLIND 

Blind.

ATNR_PARALYZE 

Paralyze. Affected object will be rooted to the spot.

ATNR_FORCE 

Force.

ATNR_GODPOWER 

Godpower.

ATNR_CHAOS 

Chaos.

ATNR_DRAIN 

Drain.

ATNR_SLOW 

Slow.

ATNR_CONFUSION 

Confusion. Affected object will move in random directions until the effect wears off.

ATNR_INTERNAL 

Used for internal calculations.

NROFATTACKS 

Number of the attacks.

Definition at line 36 of file attack.h.

Function Documentation

int attack_hit ( object op,
object hitter,
int  dam 
)

Hit the specified object for the given amount of damage.

Parameters
opObject to be hit.
hitterWhat is hitting the object.
damBase damage. Protections, slaying, blocking, etc, will be taken into account.
Returns
Dealt damage.

Definition at line 669 of file attack.c.

void attack_hit_map ( object op,
int  dir,
bool  multi_reduce 
)

Attack a spot on the map.

Parameters
opObject hitting the map.
dirDirection op is hitting/going.
multi_reduceWhether to reduce the damage for multi-arch monsters. This will make it so that part of 4-tiles monster only gets hit for 1/4 of the damage, making cone spells more fair against multi-arch monsters.

Definition at line 830 of file attack.c.

bool attack_is_melee_range ( object hitter,
object enemy 
)

Test if objects are in range for melee attack.

Parameters
hitterAttacker.
enemyEnemy – the target.
Returns
True if the target is in melee range, false otherwise.

Definition at line 1476 of file attack.c.

bool attack_kill ( object op,
object hitter 
)

An object was killed, handle various things (logging, messages, etc).

Parameters
opWhat is being killed.
hitterWho killed 'op'.
Return values
trueObject was killed.
falseObject was not killed.

Definition at line 981 of file attack.c.

int attack_object ( object op,
object hitter 
)

Make one object hit another for some amount of damage, primarily determined by the attacker's damage attribute.

The attacker's WC and the victim's AC will be considered, and a roll will be done to see if the attacker is successful in hitting the victim.

Parameters
opVictim.
hitterAttacker.
Returns
Dealt damage.

Definition at line 260 of file attack.c.

void attack_peform_paralyze ( object op,
double  dam 
)

Paralyze a living thing.

Parameters
opVictim.
damDamage to deal.

Definition at line 1399 of file attack.c.

void attack_perform_blind ( object op,
object hitter,
double  dam 
)

Blind a living object.

Parameters
opVictim.
hitterWho is attacking.
damDamage to deal.

Definition at line 1342 of file attack.c.

void attack_perform_confusion ( object op)

Confuse a living object.

Parameters
opVictim.

Definition at line 1294 of file attack.c.

void attack_perform_fall ( object op,
int  fall_floors 
)

Cause damage due to falling.

Parameters
opObject.
fall_floorsNumber of floors the object fell down.

Definition at line 1435 of file attack.c.

void attack_perform_poison ( object op,
object hitter,
double  dam 
)

Poison a living object.

Parameters
opVictim.
hitterWho is attacking.
damDamage to deal.

Definition at line 1169 of file attack.c.

void attack_perform_slow ( object op)

Slow a living object.

Parameters
opVictim.

Definition at line 1256 of file attack.c.