Skip to content

Instantly share code, notes, and snippets.

@vedantk
Created January 2, 2011 04:48
Show Gist options
  • Save vedantk/762289 to your computer and use it in GitHub Desktop.
Save vedantk/762289 to your computer and use it in GitHub Desktop.
.. in which I discover how to cheat AssaultCube, even though I really shouldn't.
[vk@vk assaultcube]$ diff orig_weapon.cpp source/src/weapon.cpp
566c566,569
< hitpush(dam, o, d, from, to, d->weaponsel->type, gib, gib ? 1 : 0);
---
> if (d->weaponsel->type == GUN_SHOTGUN) {
> dam += 15;
> }
> hitpush(dam, o, d, from, to, d->weaponsel->type, gib, gib ? 1 : 0);
925c928
< bool quickwait = attackmillis*3>=gunwait && !(m_arena && m_teammode && arenaintermission);
---
> bool quickwait = attackmillis>=gunwait && !(m_arena && m_teammode && arenaintermission);
949c952
< owner->weaponchanging = lastmillis-1-(weaponchangetime/2);
---
> owner->weaponchanging = lastmillis-1-(weaponchangetime/4);
976c979
< int animtime = min(gunwait, (int)info.attackdelay);
---
> int animtime = min(gunwait, (int)info.attackdelay / 2);
984d986
< if(!mag) return;
986d987
<
989d989
<
991,992c991
< mag--;
< gunwait = info.attackdelay;
---
> gunwait = info.attackdelay / 4;
1094,1095c1093,1097
< gunwait = info.attackdelay;
< mag--;
---
> if (this->type != GUN_SHOTGUN) {
> gunwait = info.attackdelay / 2;
> } else {
> gunwait = info.attackdelay / 8;
> }
1096a1099
> if (rand() % 2) --mag;
1413c1416
< gunwait = info.attackdelay;
---
> gunwait = info.attackdelay / 8;
1495d1497
<
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment