summaryrefslogtreecommitdiff
path: root/src/fpsgame/game.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/fpsgame/game.h')
-rw-r--r--src/fpsgame/game.h44
1 files changed, 31 insertions, 13 deletions
diff --git a/src/fpsgame/game.h b/src/fpsgame/game.h
index 185fd60..df0eeb5 100644
--- a/src/fpsgame/game.h
+++ b/src/fpsgame/game.h
@@ -246,8 +246,8 @@ static struct itemstat {
{100, 200, S_ITEMHEALTH, "MH", HICON_HEALTH, 50},
{5, 100, S_ITEMHEALTH, "TH", HICON_HEALTH, -1},
{5, 50, S_ITEMARMOUR, "TA", HICON_BLUE_ARMOUR, A_BLUE},
- {100, 100, S_ITEMARMOUR, "GA", HICON_GREEN_ARMOUR, A_GREEN},
- {200, 200, S_ITEMARMOUR, "YA", HICON_YELLOW_ARMOUR, A_YELLOW},
+ {50, 100, S_ITEMARMOUR, "GA", HICON_GREEN_ARMOUR, A_GREEN},
+ {100, 200, S_ITEMARMOUR, "YA", HICON_YELLOW_ARMOUR, A_YELLOW},
{20000, 30000, S_ITEMPUP, "Q", HICON_QUAD, -1},
};
@@ -277,13 +277,13 @@ static const struct guninfo {
struct fpsstate
{
int health, maxhealth;
- int armour, armourtype;
+ int armour, maxarmour, armourtype;
int quadmillis;
int gunselect, gunwait;
int ammo[NUMGUNS];
int aitype, skill;
- fpsstate() : maxhealth(100), aitype(AI_NONE), skill(0) {}
+ fpsstate() : maxhealth(100), maxarmour(50), aitype(AI_NONE), skill(0) {}
void baseammo(int gun, int k = 2, int scale = 1)
{
@@ -311,12 +311,19 @@ struct fpsstate
case I_BOOST: return maxhealth<is.max || health<maxhealth;
case I_TINYHEALTH: return health<maxhealth;
case I_HEALTH: return health<maxhealth;
+
case I_TINYARMOUR:
- if(armourtype==A_GREEN || armourtype==A_YELLOW || armour>=50)return false;
+
case I_GREENARMOUR:
- // (100h/100g only absorbs 200 damage)
- if(armourtype==A_YELLOW && armour>=100)return false;
- case I_YELLOWARMOUR: return !armourtype || armour<is.max;
+
+ case I_YELLOWARMOUR: return maxarmour<is.max || armour<maxarmour;
+
+ //~case I_TINYARMOUR:
+ //~if(armourtype==A_GREEN || armourtype==A_YELLOW || armour>=50)return false;
+ //~case I_GREENARMOUR:
+ //~// (100h/100g only absorbs 200 damage)
+ //~if(armourtype==A_YELLOW && armour>=100)return false;
+ //~case I_YELLOWARMOUR: return !armourtype || armour<is.max;
case I_QUAD: return quadmillis<is.max;
default: return ammo[is.info]<is.max;
}
@@ -331,20 +338,30 @@ struct fpsstate
case I_TINYHEALTH:
health = min(health+is.add, maxhealth);
break;
- case I_TINYARMOUR:
- armour = min(armour+is.add, is.max);
- armourtype = A_BLUE;
- break;
+ //~case I_TINYARMOUR:
+ //~armour = min(armour+is.add, is.max);
+ //~armourtype = A_BLUE;
+ //~break;
case I_BOOST:
maxhealth = min(maxhealth+is.info, is.max);
+
case I_HEALTH: // boost also adds to health
health = min(health+is.add, maxhealth);
break;
+ case I_TINYARMOUR:
+
case I_GREENARMOUR:
+
case I_YELLOWARMOUR:
- armour = min(armour+is.add, is.max);
+ maxarmour = max(maxarmour, is.max);
+ armour = min(armour+is.add, maxarmour);
armourtype = is.info;
break;
+ //~case I_GREENARMOUR:
+ //~case I_YELLOWARMOUR:
+ //~armour = min(armour+is.add, is.max);
+ //~armourtype = is.info;
+ //~break;
case I_QUAD:
quadmillis = min(quadmillis+is.add, is.max);
break;
@@ -358,6 +375,7 @@ struct fpsstate
{
maxhealth = 100;
health = maxhealth;
+ maxarmour = 50;
armour = 0;
armourtype = A_BLUE;
quadmillis = 0;