From 1d2b530fdcf801f1ead4d530d7475468270864bf Mon Sep 17 00:00:00 2001 From: Allanis Date: Sun, 23 Jun 2013 15:02:05 +0100 Subject: [PATCH] [Add] New damage types: Ion and Radiation. --- src/outfit.c | 12 +++++++++--- src/outfit.h | 8 +++++--- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/src/outfit.c b/src/outfit.c index fe4bf46..2e316c9 100644 --- a/src/outfit.c +++ b/src/outfit.c @@ -78,7 +78,11 @@ void outfit_calcDamage(double* dshield, double* darmour, (*dshield) = dmg*0.8; (*darmour) = dmg*1.2; break; -defualt: + case DAMAGE_TYPE_ION: + (*dshield) = 0.; + (*darmour) = dmg; + break; + default: (*dshield) = (*darmour) = 0.; break; } @@ -216,8 +220,10 @@ const char* outfit_getTypeBroad(const Outfit* o) { /* Return the damage type from a str. */ static DamageType outfit_strToDamageType(char* buf) { - if(strcmp(buf, "energy")==0) return DAMAGE_TYPE_ENERGY; - else if(strcmp(buf, "kinetic")==0) return DAMAGE_TYPE_KINETIC; + if(strcmp(buf, "energy")==0) return DAMAGE_TYPE_ENERGY; + 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); return DAMAGE_TYPE_NULL; diff --git a/src/outfit.h b/src/outfit.h index 8d39f8a..fdb564e 100644 --- a/src/outfit.h +++ b/src/outfit.h @@ -28,9 +28,11 @@ typedef enum OutfitType_ { } OutfitType; typedef enum DamageType_ { - DAMAGE_TYPE_NULL = 0, - DAMAGE_TYPE_ENERGY = 1, - DAMAGE_TYPE_KINETIC = 2 + DAMAGE_TYPE_NULL = 0, + DAMAGE_TYPE_ENERGY = 1, + DAMAGE_TYPE_KINETIC = 2, + DAMAGE_TYPE_ION = 3, + DAMAGE_TYPE_RADIATION = 4 } DamageType; /* An outfit depends a lot on the type. */