diff options
| author | xolatile | 2025-07-19 16:01:38 +0200 |
|---|---|---|
| committer | xolatile | 2025-07-19 16:01:38 +0200 |
| commit | e9ad09c58820b31743251f793f30e5d4d49a0dca (patch) | |
| tree | f3e3afdf61301d6489f6777f03628e0ffe6c9b0f /src/fpsgame/game.h | |
| parent | c79dda69d6e603500a5681430172b5152041af0a (diff) | |
| download | xolatile-badassbug-e9ad09c58820b31743251f793f30e5d4d49a0dca.tar.xz xolatile-badassbug-e9ad09c58820b31743251f793f30e5d4d49a0dca.tar.zst | |
Rough changes...
Diffstat (limited to 'src/fpsgame/game.h')
| -rw-r--r-- | src/fpsgame/game.h | 31 |
1 files changed, 25 insertions, 6 deletions
diff --git a/src/fpsgame/game.h b/src/fpsgame/game.h index db1d394..185fd60 100644 --- a/src/fpsgame/game.h +++ b/src/fpsgame/game.h @@ -32,6 +32,7 @@ enum // static entity types SPOTLIGHT = ET_SPOTLIGHT, I_SHELLS, I_BULLETS, I_ROCKETS, I_ROUNDS, I_GRENADES, I_CARTRIDGES, I_HEALTH, I_BOOST, + /**/I_TINYHEALTH, I_TINYARMOUR, I_GREENARMOUR, I_YELLOWARMOUR, I_QUAD, TELEPORT, // attr1 = idx, attr2 = model, attr3 = tag @@ -230,8 +231,11 @@ enum HICON_SPACE = 40 }; -static struct itemstat { int add, max, sound; const char *name; int icon, info; } itemstats[] = -{ +static struct itemstat { + int add, max, sound; + const char *name; + int icon, info; +} itemstats[] = { {10, 30, S_ITEMAMMO, "SG", HICON_SG, GUN_SG}, {20, 60, S_ITEMAMMO, "CG", HICON_CG, GUN_CG}, {5, 15, S_ITEMAMMO, "RL", HICON_RL, GUN_RL}, @@ -240,6 +244,8 @@ static struct itemstat { int add, max, sound; const char *name; int icon, info; {30, 120, S_ITEMAMMO, "PI", HICON_PISTOL, GUN_PISTOL}, {25, 100, S_ITEMHEALTH, "H", HICON_HEALTH, -1}, {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}, {20000, 30000, S_ITEMPUP, "Q", HICON_QUAD, -1}, @@ -250,9 +256,12 @@ static struct itemstat { int add, max, sound; const char *name; int icon, info; #define EXP_SELFPUSH 2.5f #define EXP_DISTSCALE 1.5f -static const struct guninfo { int sound, attackdelay, damage, spread, projspeed, kickamount, range, rays, hitpush, exprad, ttl; const char *name, *file; short part; } guns[NUMGUNS] = -{ - // delay| dmg| spr| spd| kck| rng| ray| pus| exp| +static const struct guninfo { + int sound, attackdelay, damage, spread, projspeed, kickamount, range, rays, hitpush, exprad, ttl; + const char *name, *file; + short part; +} guns[NUMGUNS] = { + // delay| dmg| spr| spd| kck| rng| ray| pus| exp| { S_PUNCH1, 100, 30, 0, 0, 0, 30, 1, 80, 0, 0, "fist", "fist", 0 }, { S_SG, 1000, 20, 280, 0, 20, 1024, MAXRAYS, 80, 0, 0, "shotgun", "shotg", 0 }, { S_CG, 100, 20, 70, 0, 10, 1024, 1, 80, 0, 0, "chaingun", "chaing", 0 }, @@ -300,10 +309,13 @@ struct fpsstate switch(type) { 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; + 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; @@ -316,6 +328,13 @@ struct fpsstate itemstat &is = itemstats[type-I_SHELLS]; switch(type) { + 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_BOOST: maxhealth = min(maxhealth+is.info, is.max); case I_HEALTH: // boost also adds to health |
