[Add] New damage types: Ion and Radiation.
This commit is contained in:
parent
a04152315e
commit
1d2b530fdc
12
src/outfit.c
12
src/outfit.c
@ -78,7 +78,11 @@ void outfit_calcDamage(double* dshield, double* darmour,
|
|||||||
(*dshield) = dmg*0.8;
|
(*dshield) = dmg*0.8;
|
||||||
(*darmour) = dmg*1.2;
|
(*darmour) = dmg*1.2;
|
||||||
break;
|
break;
|
||||||
defualt:
|
case DAMAGE_TYPE_ION:
|
||||||
|
(*dshield) = 0.;
|
||||||
|
(*darmour) = dmg;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
(*dshield) = (*darmour) = 0.;
|
(*dshield) = (*darmour) = 0.;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -216,8 +220,10 @@ const char* outfit_getTypeBroad(const Outfit* o) {
|
|||||||
|
|
||||||
/* Return the damage type from a str. */
|
/* Return the damage type from a str. */
|
||||||
static DamageType outfit_strToDamageType(char* buf) {
|
static DamageType outfit_strToDamageType(char* buf) {
|
||||||
if(strcmp(buf, "energy")==0) return DAMAGE_TYPE_ENERGY;
|
if(strcmp(buf, "energy")==0) return DAMAGE_TYPE_ENERGY;
|
||||||
else if(strcmp(buf, "kinetic")==0) return DAMAGE_TYPE_KINETIC;
|
else if(strcmp(buf, "kinetic")==0) return DAMAGE_TYPE_KINETIC;
|
||||||
|
else if(strcmp(buf, "ion")==0) return DAMAGE_TYPE_ION;
|
||||||
|
else if(strcmp(buf, "radiation")==0) return DAMAGE_TYPE_RADIATION;
|
||||||
|
|
||||||
WARN("Invalid damage type: '%s'", buf);
|
WARN("Invalid damage type: '%s'", buf);
|
||||||
return DAMAGE_TYPE_NULL;
|
return DAMAGE_TYPE_NULL;
|
||||||
|
@ -28,9 +28,11 @@ typedef enum OutfitType_ {
|
|||||||
} OutfitType;
|
} OutfitType;
|
||||||
|
|
||||||
typedef enum DamageType_ {
|
typedef enum DamageType_ {
|
||||||
DAMAGE_TYPE_NULL = 0,
|
DAMAGE_TYPE_NULL = 0,
|
||||||
DAMAGE_TYPE_ENERGY = 1,
|
DAMAGE_TYPE_ENERGY = 1,
|
||||||
DAMAGE_TYPE_KINETIC = 2
|
DAMAGE_TYPE_KINETIC = 2,
|
||||||
|
DAMAGE_TYPE_ION = 3,
|
||||||
|
DAMAGE_TYPE_RADIATION = 4
|
||||||
} DamageType;
|
} DamageType;
|
||||||
|
|
||||||
/* An outfit depends a lot on the type. */
|
/* An outfit depends a lot on the type. */
|
||||||
|
Loading…
Reference in New Issue
Block a user