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:
Lucas GAUTHERON
2012-08-24 16:01:10 +00:00
parent bebae41a0c
commit ef76f7f88d
5 changed files with 23 additions and 0 deletions
+1
View File
@@ -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
---------------------
+12
View File
@@ -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)
+5
View File
@@ -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,
+1
View File
@@ -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();
+4
View File
@@ -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;