hardcoded burst fire settings (menus still TODO)
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@6862 e016b1c5-ed68-44aa-a2f7-31cac88cffde
This commit is contained in:
@@ -20,6 +20,7 @@ Weapons
|
||||
[*] Grenades accuracy, real shotgun accuracy.
|
||||
[*] Sniper trail bug fixed. // TODO: Is this for the "stop the sniper trail upon hit thing"? If so I'm not 100% certain it's completely fixed. // Bukz
|
||||
[*] Hudgun can be displayed when spectating (and in demos - e.g. /specthudgun 1).
|
||||
[*] Burst fire settings
|
||||
|
||||
Gameplay
|
||||
---------------------
|
||||
|
||||
@@ -881,6 +881,18 @@ void writekillmsgcfg()
|
||||
f->printf("\n");
|
||||
}
|
||||
|
||||
void burstshots(int gun, int shots = -1)
|
||||
{
|
||||
if(gun >= 0 && gun < NUMGUNS && guns[gun].isauto)
|
||||
{
|
||||
if(shots >= 0) burstshotssettings[gun] = shots;
|
||||
else intret(burstshotssettings[gun]);
|
||||
}
|
||||
else conoutf(_("invalid gun specified"));
|
||||
}
|
||||
|
||||
COMMAND(burstshots, ARG_2INT);
|
||||
|
||||
// damage arriving from the network, monsters, yourself, all ends up here.
|
||||
|
||||
void dodamage(int damage, playerent *pl, playerent *actor, int gun, bool gib, bool local)
|
||||
|
||||
@@ -1395,6 +1395,11 @@ void writecfg()
|
||||
}
|
||||
);
|
||||
f->printf("\n");
|
||||
loopi(NUMGUNS) if(guns[i].isauto)
|
||||
{
|
||||
f->printf("burstshots %d %d\n", i, burstshotssettings[i]);
|
||||
}
|
||||
f->printf("\n");
|
||||
writebinds(f);
|
||||
f->printf("\n");
|
||||
enumerate(*idents, ident, id,
|
||||
|
||||
@@ -702,6 +702,7 @@ extern void damageeffect(int damage, playerent *d);
|
||||
extern void tryreload(playerent *p);
|
||||
extern void checkweaponstate();
|
||||
extern struct projectile *newprojectile(vec &from, vec &to, float speed, bool local, playerent *owner, int gun, int id = lastmillis);
|
||||
extern int burstshotssettings[NUMGUNS];
|
||||
|
||||
// entities
|
||||
extern void spawnallitems();
|
||||
|
||||
@@ -13,6 +13,8 @@ struct sgray {
|
||||
};
|
||||
sgray sgr[SGRAYS*3];
|
||||
|
||||
int burstshotssettings[NUMGUNS] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, };
|
||||
|
||||
void updatelastaction(playerent *d, int millis = lastmillis)
|
||||
{
|
||||
loopi(NUMGUNS) d->weapons[i]->updatetimers(millis);
|
||||
@@ -1184,6 +1186,8 @@ bool gun::attack(vec &targ)
|
||||
|
||||
if(!info.isauto) owner->attacking = false;
|
||||
|
||||
if(burstshotssettings[this->type] > 0 && shots >= burstshotssettings[this->type]) owner->attacking = false;
|
||||
|
||||
vec from = owner->o;
|
||||
vec to = targ;
|
||||
from.z -= weaponbeloweye;
|
||||
|
||||
Reference in New Issue
Block a user