![]() |
naev 0.10.4
|
Handles damage types. More...
#include "damagetype.h"#include "array.h"#include "log.h"#include "ndata.h"#include "nxml.h"#include "pause.h"#include "pilot.h"#include "rng.h"#include "shipstats.h"Go to the source code of this file.
Data Structures | |
| struct | DTYPE |
| A damage type. More... | |
Macros | |
| #define | DTYPE_XML_ID "dtype" |
| #define | MELEMENT(o, s) if (o) WARN(_("DTYPE '%s' invalid '"s"' element"), temp->name) |
Functions | |
| static int | DTYPE_parse (DTYPE *temp, const char *file) |
| Parses an XML file containing a DTYPE. More... | |
| static void | DTYPE_free (DTYPE *damtype) |
| Frees a DTYPE. More... | |
| static DTYPE * | dtype_validType (int type) |
| Gets the damage type. More... | |
| int | dtype_get (const char *name) |
| Gets the id of a dtype based on name. More... | |
| const char * | dtype_damageTypeToStr (int type) |
| Gets the human readable string from damage type. More... | |
| int | dtype_load (void) |
| Loads the dtype stack. More... | |
| void | dtype_free (void) |
| Frees the dtype stack. More... | |
| int | dtype_raw (int type, double *shield, double *armour, double *knockback) |
| Gets the raw modulation stats of a damage type. More... | |
| void | dtype_calcDamage (double *dshield, double *darmour, double absorb, double *knockback, const Damage *dmg, const ShipStats *s) |
| Gives the real shield damage, armour damage and knockback modifier. More... | |
Variables | |
| static DTYPE * | dtype_types = NULL |
Handles damage types.
Definition in file damagetype.c.
| #define DTYPE_XML_ID "dtype" |
XML Document tag.
Definition at line 27 of file damagetype.c.
| void dtype_calcDamage | ( | double * | dshield, |
| double * | darmour, | ||
| double | absorb, | ||
| double * | knockback, | ||
| const Damage * | dmg, | ||
| const ShipStats * | s | ||
| ) |
Gives the real shield damage, armour damage and knockback modifier.
| [out] | dshield | Real shield damage. |
| [out] | darmour | Real armour damage. |
| [out] | knockback | Knockback modifier. |
| [in] | absorb | Absorption value. |
| [in] | dmg | Damage information. |
| [in] | s | Ship stats to use. |
Definition at line 257 of file damagetype.c.
| const char * dtype_damageTypeToStr | ( | int | type | ) |
Gets the human readable string from damage type.
Definition at line 168 of file damagetype.c.
|
static |
| void dtype_free | ( | void | ) |
Frees the dtype stack.
Definition at line 215 of file damagetype.c.
| int dtype_get | ( | const char * | name | ) |
Gets the id of a dtype based on name.
| name | Name to match. |
Definition at line 144 of file damagetype.c.
| int dtype_load | ( | void | ) |
|
static |
Parses an XML file containing a DTYPE.
| temp | Address to load DTYPE into. |
| file | File to parse. |
< Define to help check for data errors.
Definition at line 59 of file damagetype.c.
| int dtype_raw | ( | int | type, |
| double * | shield, | ||
| double * | armour, | ||
| double * | knockback | ||
| ) |
Gets the raw modulation stats of a damage type.
| type | Type to get stats of. | |
| [out] | shield | Shield damage modulator. |
| [out] | armour | Armour damage modulator. |
| [out] | knockback | Knockback modulator. |
Definition at line 233 of file damagetype.c.
|
static |
Gets the damage type.
Definition at line 156 of file damagetype.c.
|
static |
Total damage types.
Definition at line 43 of file damagetype.c.