*** empty log message ***
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@241 e016b1c5-ed68-44aa-a2f7-31cac88cffde
This commit is contained in:
+2
-2
@@ -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,
|
||||
@@ -173,7 +173,7 @@ struct dynent // players & monsters
|
||||
int gravity;
|
||||
bool isphysent; // hack
|
||||
int thrownademillis;
|
||||
bool akimbo;
|
||||
int akimbo;
|
||||
};
|
||||
|
||||
// EDIT: AH
|
||||
|
||||
+30
-11
@@ -54,7 +54,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)
|
||||
@@ -86,7 +86,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; };
|
||||
@@ -123,8 +123,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;
|
||||
|
||||
@@ -133,8 +139,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;
|
||||
};
|
||||
@@ -176,8 +184,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;
|
||||
|
||||
@@ -185,8 +197,9 @@ void pickup(int n, dynent *d)
|
||||
additem(n, d->armour, 20, 8);
|
||||
break;
|
||||
|
||||
case I_QUAD:
|
||||
//additem(n, d->quadmillis, 60, 9);
|
||||
case I_AKIMBO:
|
||||
//additem(n, d->ammo[1], 60, 9);
|
||||
additem(n, d->akimbo, 60, 9);
|
||||
break;
|
||||
|
||||
case CARROT:
|
||||
@@ -254,7 +267,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;
|
||||
@@ -324,3 +337,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);
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -99,6 +100,9 @@ void reload()
|
||||
//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];
|
||||
@@ -543,6 +547,8 @@ 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 +574,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
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user