From df9fc63584bf8d20084bcfcb4b5d9c66a2dbdb33 Mon Sep 17 00:00:00 2001 From: arghvark Date: Wed, 24 Aug 2005 18:36:29 +0000 Subject: [PATCH] new weapon starting amounts, pistols mode, no items in arena modes git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@36 e016b1c5-ed68-44aa-a2f7-31cac88cffde --- source/src/cube.h | 6 ++++-- source/src/entities.cpp | 39 +++++++++++++++++++++++---------------- source/src/serverutil.cpp | 2 +- 3 files changed, 28 insertions(+), 19 deletions(-) diff --git a/source/src/cube.h b/source/src/cube.h index 1bdfe6cc..6f0bcbfc 100644 --- a/source/src/cube.h +++ b/source/src/cube.h @@ -236,14 +236,16 @@ extern bool demoplayback; 3 - survivor 4 - team survior 5 - ctf +6 - pistols */ -#define m_noitems (false) +#define m_noitems (m_arena) #define m_noitemsrail (false) #define m_arena (gamemode==3 || gamemode==4) #define m_tarena (gamemode==4) -#define m_teammode (gamemode==0 || gamemode>=4) +#define m_teammode (gamemode==0 || gamemode==4 || gamemode==5) #define m_ctf (gamemode==5) +#define m_pistol (gamemode==6) //#define m_sp (gamemode<0) //#define m_dmsp (gamemode==-1) //#define m_classicsp (gamemode==-2) diff --git a/source/src/entities.cpp b/source/src/entities.cpp index 14ea0704..a9ee111c 100644 --- a/source/src/entities.cpp +++ b/source/src/entities.cpp @@ -57,17 +57,17 @@ void renderentities() }; }; -struct itemstat { int add, max, sound; } itemstats[] = +struct itemstat { int add, start, max, sound; } itemstats[] = { - 16, 48, S_ITEMAMMO, //pistol - 7, 14, S_ITEMAMMO, //shotgun - 30, 90, S_ITEMAMMO, //subgun - 5, 15, S_ITEMAMMO, //sniper - 20, 40, S_ITEMAMMO, //assult - 1, 2, S_ITEMAMMO, //grenade - 33, 100, S_ITEMHEALTH, //health - 50, 100, S_ITEMARMOUR, //armour - 20000, 30000, S_ITEMPUP, //powerup + 16, 24, 36, S_ITEMAMMO, //pistol + 7, 7, 14, S_ITEMAMMO, //shotgun + 30, 60, 90, S_ITEMAMMO, //subgun + 5, 10, 15, S_ITEMAMMO, //sniper + 20, 20, 40, S_ITEMAMMO, //assult + 1, 0, 2, S_ITEMAMMO, //grenade + 33, 100, 100, S_ITEMHEALTH, //health + 50, 100, 100, S_ITEMARMOUR, //armour + 20000, 0, 30000, S_ITEMPUP, //powerup }; void baseammo(int gun) { player1->ammo[gun] = itemstats[gun-1].add*2; }; @@ -210,24 +210,31 @@ void radd(dynent *d) { loopi(NUMGUNS) if(d->nextprimary!=i) d->ammo[i] = 0; d->mag[GUN_KNIFE] = 1; - + d->mag[GUN_PISTOL] = 8; d->ammo[GUN_PISTOL] = 24; - if (d->primary==GUN_PISTOL) // || pistol only mode! + if (m_pistol || d->primary==GUN_PISTOL) // || pistol only mode! { - d->ammo[d->primary] = 48; + d->primary = GUN_PISTOL; + d->ammo[d->primary] = 72; } else if (d->primary>GUN_PISTOL && d->primaryammo[d->primary] = itemstats[d->primary-1].max; + if (m_arena) + d->ammo[d->primary] = itemstats[d->primary-1].max; + else + d->ammo[d->primary] = itemstats[d->primary-1].start; + d->mag[d->primary] = itemstats[d->primary-1].add; } - else if (d->primary==GUN_GRENADE) + +/* + if (d->primary==GUN_GRENADE) { //conoutf("you don't have to worry about blowing your hand off just yet..."); } - +*/ if (d->hasarmour) { if(gamemode==m_arena) diff --git a/source/src/serverutil.cpp b/source/src/serverutil.cpp index 1f9e25c6..34adb170 100644 --- a/source/src/serverutil.cpp +++ b/source/src/serverutil.cpp @@ -29,7 +29,7 @@ void sendstring(char *t, uchar *&p) const char *modenames[] = { "team deathmatch", "coopedit", "deathmatch", "survior", - "team survior", "ctf", + "team survior", "ctf", "pistols only!", }; //const char *modestr(int n) { return (n>=-2 && n<12) ? modenames[n+2] : "unknown"; };