akimbo pistols added
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@236 e016b1c5-ed68-44aa-a2f7-31cac88cffde
This commit is contained in:
@@ -155,7 +155,7 @@ void localservertoclient(uchar *buf, int len) // processes any updates from th
|
||||
else // new client
|
||||
{
|
||||
c2sinit = false; // send new players my info again
|
||||
conoutf("connected: %s", (int)&text);
|
||||
conoutf("connected: %s", (int)&text);
|
||||
gun_changed = true;
|
||||
};
|
||||
strcpy_s(d->name, text);
|
||||
@@ -183,7 +183,7 @@ void localservertoclient(uchar *buf, int len) // processes any updates from th
|
||||
e.y = getint(p)/DMF;
|
||||
e.z = getint(p)/DMF;
|
||||
if(gun==GUN_SHOTGUN) createrays(s, e);
|
||||
int nademillis = 2000/100*getint(p);
|
||||
int nademillis = 2000/100*getint(p);
|
||||
if(nademillis<0 || nademillis>100) nademillis = 100;
|
||||
printf("nadesec: %i\n", nademillis);
|
||||
shootv(gun, s, e, d, nademillis);
|
||||
@@ -257,7 +257,6 @@ void localservertoclient(uchar *buf, int len) // processes any updates from th
|
||||
setspawn(i, true);
|
||||
if(i>=ents.length()) break;
|
||||
vec v = { ents[i].x, ents[i].y, ents[i].z };
|
||||
playsound(S_ITEMSPAWN, &v);
|
||||
break;
|
||||
};
|
||||
|
||||
@@ -335,12 +334,12 @@ void localservertoclient(uchar *buf, int len) // processes any updates from th
|
||||
p += mapsize;
|
||||
changemapserv(text, gamemode);
|
||||
break;
|
||||
};
|
||||
|
||||
case SV_WEAPCHANGE:
|
||||
{
|
||||
players[cn]->gunselect = getint(p);
|
||||
break;
|
||||
};
|
||||
|
||||
case SV_WEAPCHANGE:
|
||||
{
|
||||
players[cn]->gunselect = getint(p);
|
||||
break;
|
||||
};
|
||||
|
||||
case SV_SERVMSG:
|
||||
|
||||
+4
-4
@@ -41,7 +41,7 @@ enum // static entity types
|
||||
LIGHT, // lightsource, attr1 = radius, attr2 = intensity
|
||||
PLAYERSTART, // attr1 = angle
|
||||
I_CLIPS, I_AMMO,I_GRENADE,
|
||||
I_HEALTH, I_ARMOUR, I_QUAD,
|
||||
I_HEALTH, I_ARMOUR, I_AKIMBO,
|
||||
MAPMODEL, // attr1 = angle, attr2 = idx
|
||||
CARROT, // attr1 = tag, attr2 = type
|
||||
LADDER,
|
||||
@@ -171,7 +171,7 @@ struct dynent // players & monsters
|
||||
int gravity;
|
||||
bool isphysent; // hack
|
||||
int thrownademillis;
|
||||
bool akimbo;
|
||||
int akimbo; //treated as a boolean
|
||||
};
|
||||
|
||||
enum { PHYSENT_NONE = 0, NADE_ACTIVATED, NADE_THROWED };
|
||||
@@ -221,11 +221,11 @@ enum
|
||||
S_ASSULT, S_RASSULT,
|
||||
S_GRENADE,
|
||||
S_ITEMAMMO, S_ITEMHEALTH,
|
||||
S_ITEMARMOUR, S_ITEMPUP, S_ITEMSPAWN,
|
||||
S_ITEMARMOUR, S_ITEMPUP,
|
||||
S_NOAMMO, S_PUPOUT,
|
||||
S_PAIN1, S_PAIN2, S_PAIN3, S_PAIN4, S_PAIN5, S_PAIN6,
|
||||
S_DIE1, S_DIE2, S_SUICIDE,
|
||||
S_FALL1, S_FALL2,
|
||||
S_FALL1,
|
||||
S_FLAUNCH, S_FEXPLODE,
|
||||
S_SPLASH1, S_SPLASH2,
|
||||
S_GRUNT1, S_GRUNT2, S_RUMBLE,
|
||||
|
||||
+31
-12
@@ -35,7 +35,7 @@ void renderentities()
|
||||
if(e.type!=CARROT)
|
||||
{
|
||||
if(!e.spawned) continue;
|
||||
if(e.type<I_CLIPS || e.type>I_QUAD) continue;
|
||||
if(e.type<I_CLIPS || e.type>I_AKIMBO) continue;
|
||||
renderent(e, entmdlnames[e.type-I_CLIPS], (float)(1+sin(lastmillis/100.0+e.x+e.y)/20), lastmillis/10.0f);
|
||||
}
|
||||
else switch(e.attr2)
|
||||
@@ -67,7 +67,7 @@ struct itemstat { int add, start, max, sound; } itemstats[] =
|
||||
2, 0, 2, S_ITEMAMMO, //grenade
|
||||
33, 100, 100, S_ITEMHEALTH, //health
|
||||
50, 100, 100, S_ITEMARMOUR, //armour
|
||||
20000, 0, 30000, S_ITEMPUP, //powerup
|
||||
16, 0, 72, S_ITEMPUP, //powerup
|
||||
};
|
||||
|
||||
void baseammo(int gun) { player1->ammo[gun] = itemstats[gun-1].add*2; };
|
||||
@@ -104,8 +104,14 @@ void realpickup(int n, dynent *d)
|
||||
//case I_SUBGUN: radditem(n, d->ammo[3]); break;
|
||||
//case I_SNIPER: radditem(n, d->ammo[4]); break;
|
||||
//case I_ASSULT: radditem(n, d->ammo[5]); break;
|
||||
case I_CLIPS: radditem(n, d->ammo[1], 1); break;
|
||||
case I_AMMO: radditem(n, d->ammo[d->primary], d->primary); break;
|
||||
case I_CLIPS:
|
||||
|
||||
radditem(n, d->ammo[1], 1);
|
||||
break;
|
||||
|
||||
case I_AMMO:
|
||||
radditem(n, d->ammo[d->primary], d->primary);
|
||||
break;
|
||||
case I_GRENADE: radditem(n, d->mag[6], 6); break;
|
||||
case I_HEALTH: radditem(n, d->health, 7); break;
|
||||
|
||||
@@ -114,8 +120,10 @@ void realpickup(int n, dynent *d)
|
||||
//d->hasarmour = true;
|
||||
break;
|
||||
|
||||
case I_QUAD:
|
||||
//radditem(n, d->quadmillis, 9);
|
||||
case I_AKIMBO:
|
||||
d->akimbo = true;
|
||||
d->mag[GUN_PISTOL] = 16;
|
||||
radditem(n, d->ammo[1], 9);
|
||||
conoutf("a lesser man would use a single pistol");
|
||||
break;
|
||||
};
|
||||
@@ -157,8 +165,12 @@ void pickup(int n, dynent *d)
|
||||
//case I_SUBGUN: additem(n, d->ammo[3], ammo); break;
|
||||
//case I_SNIPER: additem(n, d->ammo[4], ammo); break;
|
||||
//case I_ASSULT: additem(n, d->ammo[5], ammo); break;
|
||||
case I_CLIPS: additem(n, d->ammo[1], ammo, 1); break;
|
||||
case I_AMMO: additem(n, d->ammo[d->primary], ammo, d->primary); break;
|
||||
case I_CLIPS:
|
||||
additem(n, d->ammo[1], ammo, 1);
|
||||
break;
|
||||
case I_AMMO:
|
||||
additem(n, d->ammo[d->primary], ammo, d->primary);
|
||||
break;
|
||||
case I_GRENADE: additem(n, d->mag[6], ammo, 6); break;
|
||||
case I_HEALTH: additem(n, d->health, np*5, 7); break;
|
||||
|
||||
@@ -166,9 +178,10 @@ void pickup(int n, dynent *d)
|
||||
additem(n, d->armour, 20, 8);
|
||||
break;
|
||||
|
||||
case I_QUAD:
|
||||
//additem(n, d->quadmillis, 60, 9);
|
||||
break;
|
||||
case I_AKIMBO:
|
||||
//additem(n, d->ammo[1], 60, 9);
|
||||
additem(n, d->akimbo, 60, 9);
|
||||
break;
|
||||
|
||||
case CARROT:
|
||||
ents[n].spawned = false;
|
||||
@@ -212,7 +225,7 @@ void checkitems()
|
||||
|
||||
void putitems(uchar *&p) // puts items in network stream and also spawns them locally
|
||||
{
|
||||
loopv(ents) if((ents[i].type>=I_CLIPS && ents[i].type<=I_QUAD) || ents[i].type==CARROT)
|
||||
loopv(ents) if((ents[i].type>=I_CLIPS && ents[i].type<=I_AKIMBO) || ents[i].type==CARROT)
|
||||
{
|
||||
putint(p, i);
|
||||
ents[i].spawned = true;
|
||||
@@ -282,3 +295,9 @@ void weapon(int num)
|
||||
|
||||
COMMAND(weapon, ARG_1INT);
|
||||
COMMAND(item,ARG_1INT);
|
||||
|
||||
void akimbo(void)
|
||||
{
|
||||
conoutf("akimbo=%d",player1->akimbo);
|
||||
};
|
||||
COMMAND(akimbo, ARG_NONE);
|
||||
+10
-4
@@ -87,7 +87,8 @@ COMMAND(wdw,ARG_NONE);
|
||||
void reload()
|
||||
{
|
||||
if(player1->gunselect==GUN_KNIFE || player1->gunselect==GUN_GRENADE) return;
|
||||
if(player1->mag[player1->gunselect]>=guns[player1->gunselect].magsize) return;
|
||||
if(player1->gunselect==GUN_PISTOL && player1->akimbo!=0 && player1->mag[player1->gunselect]>=(guns[player1->gunselect].magsize * 2)) return;
|
||||
else if(player1->mag[player1->gunselect]>=guns[player1->gunselect].magsize && player1->akimbo==0) return;
|
||||
if(player1->ammo[player1->gunselect]<=0) return;
|
||||
if(player1->reloading) return;
|
||||
|
||||
@@ -97,8 +98,10 @@ void reload()
|
||||
player1->gunwait = guns[player1->gunselect].reloadtime;
|
||||
|
||||
//temp hack in drawhudgun() so no guns drawn while reloading, needs fixed
|
||||
|
||||
int a = guns[player1->gunselect].magsize - player1->mag[player1->gunselect];
|
||||
if(player1->gunselect==GUN_PISTOL && player1->akimbo!=0)
|
||||
a = guns[player1->gunselect].magsize * 2 - player1->mag[player1->gunselect];
|
||||
|
||||
if (a >= player1->ammo[player1->gunselect])
|
||||
{
|
||||
player1->mag[player1->gunselect] += player1->ammo[player1->gunselect];
|
||||
@@ -542,7 +545,9 @@ void shoot(dynent *d, vec &targ)
|
||||
|
||||
if(d->gunselect!=GUN_SUBGUN && d->gunselect!=GUN_ASSULT && d->gunselect!=GUN_GRENADE) d->attacking = false; //makes sub/assult autos
|
||||
else d->shots++;
|
||||
|
||||
|
||||
if (d->gunselect==GUN_PISTOL && d->akimbo!=0) d->attacking = true; //make akimbo auto
|
||||
|
||||
d->lastaction = lastmillis;
|
||||
d->lastattackgun = d->gunselect;
|
||||
if(!d->mag[d->gunselect]) { playsoundc(S_NOAMMO); d->gunwait = 250; d->lastattackgun = -1; return; };
|
||||
@@ -568,7 +573,8 @@ void shoot(dynent *d, vec &targ)
|
||||
|
||||
//if(d->quadmillis && attacktime>200) playsoundc(S_ITEMPUP);
|
||||
|
||||
d->gunwait = guns[d->gunselect].attackdelay;
|
||||
if(d->gunselect==GUN_PISTOL && d->akimbo) d->gunwait = guns[d->gunselect].attackdelay / 2; //make akimbo pistols shoot twice as fast as normal pistol
|
||||
else d->gunwait = guns[d->gunselect].attackdelay;
|
||||
|
||||
if(d->gunselect==GUN_GRENADE) // activate
|
||||
{
|
||||
|
||||
@@ -270,7 +270,7 @@ void load_world(char *mname) // still supports all map formats that have
|
||||
e.type=I_ARMOUR;
|
||||
break;
|
||||
case 11: //quad
|
||||
e.type=I_QUAD;
|
||||
e.type=I_AKIMBO;
|
||||
break;
|
||||
case 14: //old map model
|
||||
e.type=MAPMODEL;
|
||||
|
||||
Reference in New Issue
Block a user