diff options
Diffstat (limited to 'src/fpsgame')
| -rw-r--r-- | src/fpsgame/client.cpp | 4 | ||||
| -rw-r--r-- | src/fpsgame/entities.cpp | 6 | ||||
| -rw-r--r-- | src/fpsgame/game.h | 31 | ||||
| -rw-r--r-- | src/fpsgame/game.h.gch | bin | 76106492 -> 76110237 bytes | |||
| -rw-r--r-- | src/fpsgame/server.cpp | 2 |
5 files changed, 32 insertions, 11 deletions
diff --git a/src/fpsgame/client.cpp b/src/fpsgame/client.cpp index 55da8d0..35aabd4 100644 --- a/src/fpsgame/client.cpp +++ b/src/fpsgame/client.cpp @@ -1879,7 +1879,7 @@ namespace game string oldname; copystring(oldname, getclientmap()); defformatstring(mname, "getmap_%d", lastmillis); - defformatstring(fname, "packages/base/%s.ogz", mname); + defformatstring(fname, "packages/maps/%s.ogz", mname); stream *map = openrawfile(path(fname), "wb"); if(!map) return; conoutf("received map"); @@ -1978,7 +1978,7 @@ namespace game conoutf("sending map..."); defformatstring(mname, "sendmap_%d", lastmillis); save_world(mname, true); - defformatstring(fname, "packages/base/%s.ogz", mname); + defformatstring(fname, "packages/maps/%s.ogz", mname); stream *map = openrawfile(path(fname), "rb"); if(map) { diff --git a/src/fpsgame/entities.cpp b/src/fpsgame/entities.cpp index f199c11..1410679 100644 --- a/src/fpsgame/entities.cpp +++ b/src/fpsgame/entities.cpp @@ -48,7 +48,7 @@ namespace entities { NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, "ammo/shells", "ammo/bullets", "ammo/rockets", "ammo/rrounds", "ammo/grenades", "ammo/cartridges", - "health", "boost", "armor/green", "armor/yellow", "quad", "teleporter", + "health", "boost", "tinyhealth", "tinyarmour", "armor/green", "armor/yellow", "quad", "teleporter", NULL, NULL, "carrot", NULL, NULL, @@ -79,7 +79,7 @@ namespace entities case I_SHELLS: case I_BULLETS: case I_ROCKETS: case I_ROUNDS: case I_GRENADES: case I_CARTRIDGES: if(m_noammo) continue; break; - case I_HEALTH: case I_BOOST: case I_GREENARMOUR: case I_YELLOWARMOUR: case I_QUAD: + case I_HEALTH: case I_BOOST: case I_TINYHEALTH: case I_TINYARMOUR: case I_GREENARMOUR: case I_YELLOWARMOUR: case I_QUAD: if(m_noitems) continue; break; } @@ -399,7 +399,7 @@ namespace entities { "none?", "light", "mapmodel", "playerstart", "envmap", "particles", "sound", "spotlight", "shells", "bullets", "rockets", "riflerounds", "grenades", "cartridges", - "health", "healthboost", "greenarmour", "yellowarmour", "quaddamage", + "health", "healthboost", "tinyhealth", "tinyarmour", "greenarmour", "yellowarmour", "quaddamage", "teleport", "teledest", "jumppad", "", "", "", "", 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 diff --git a/src/fpsgame/game.h.gch b/src/fpsgame/game.h.gch Binary files differindex b1bc4a9..2b92d8d 100644 --- a/src/fpsgame/game.h.gch +++ b/src/fpsgame/game.h.gch diff --git a/src/fpsgame/server.cpp b/src/fpsgame/server.cpp index 158772f..7ea00a1 100644 --- a/src/fpsgame/server.cpp +++ b/src/fpsgame/server.cpp @@ -860,6 +860,8 @@ namespace server case I_GRENADES: case I_CARTRIDGES: sec = np*4; break; case I_HEALTH: sec = np*5; break; + case I_TINYHEALTH: sec = np*5; break; + case I_TINYARMOUR: sec = np*5; break; case I_GREENARMOUR: sec = 20; break; case I_YELLOWARMOUR: sec = 30; break; case I_BOOST: sec = 60; break; |
