- Blood: Tidy up some missed kWeap constants.

This commit is contained in:
Mitchell Richters 2022-01-12 22:22:48 +11:00
parent 26e9d33bfa
commit f8ffaa4be9
7 changed files with 14 additions and 13 deletions

View file

@ -483,6 +483,7 @@ enum
kWeapProximity = 11,
kWeapRemote = 12,
kWeapBeast = 13,
kWeapMax = 14,
};
// -------------------------------

View file

@ -106,7 +106,7 @@ void SetWeapons(bool stat)
if (!VanillaMode())
{
// Keep the pitchfork to avoid freeze
gMe->hasWeapon[1] = 1;
gMe->hasWeapon[kWeapPitchFork] = 1;
gMe->curWeapon = kWeapNone;
gMe->nextWeapon = kWeapPitchFork;
}
@ -416,7 +416,7 @@ const char* GameInterface::GenericCheat(int player, int cheat)
SetWooMode(true);
powerupActivate(gMe, kPwUpDeliriumShroom);
gMe->actor->xspr.health = 16;
gMe->hasWeapon[1] = 1;
gMe->hasWeapon[kWeapPitchFork] = 1;
gMe->curWeapon = kWeapNone;
gMe->nextWeapon = kWeapPitchFork;
break;

View file

@ -2228,7 +2228,7 @@ void trPlayerCtrlEraseStuff(int value, PLAYER* pPlayer)
if (i < 12) pPlayer->ammoCount[i] = 0;
}
pPlayer->hasWeapon[1] = true;
pPlayer->hasWeapon[kWeapPitchFork] = true;
pPlayer->curWeapon = kWeapNone;
pPlayer->nextWeapon = kWeapPitchFork;

View file

@ -921,7 +921,7 @@ void playerReset(PLAYER* pPlayer)
pPlayer->hasWeapon[i] = gInfiniteAmmo;
pPlayer->weaponMode[i] = 0;
}
pPlayer->hasWeapon[1] = 1;
pPlayer->hasWeapon[kWeapPitchFork] = 1;
pPlayer->curWeapon = kWeapNone;
pPlayer->qavCallback = -1;
pPlayer->newWeapon = kWeapPitchFork;
@ -2516,7 +2516,7 @@ FSerializer& Serialize(FSerializer& arc, const char* keyname, PLAYER& w, PLAYER*
("weaponammo", w.weaponAmmo)
.Array("hasweapon", w.hasWeapon, countof(w.hasWeapon))
.Array("weaponmode", w.weaponMode, countof(w.weaponMode))
.Array("weaponorder", &w.weaponOrder[0][0], 14 * 2)
.Array("weaponorder", &w.weaponOrder[0][kWeapNone], +kWeapMax * 2)
.Array("ammocount", w.ammoCount, countof(w.ammoCount))
("qavloop", w.qavLoop)
("qavlastTick", w.qavLastTick)

View file

@ -118,9 +118,9 @@ struct PLAYER
int weaponTimer;
int weaponState;
int weaponAmmo; //rename
bool hasWeapon[14];
int weaponMode[14];
int weaponOrder[2][14];
bool hasWeapon[kWeapMax];
int weaponMode[kWeapMax];
int weaponOrder[2][kWeapMax];
//int at149[14];
int ammoCount[12];
bool qavLoop;

View file

@ -239,13 +239,13 @@ void LifeLeechOperate(DBloodActor* actor, EVENT event)
{
evKillActor(actor);
pPlayer->ammoCount[8] = ClipHigh(pPlayer->ammoCount[8] + actor->xspr.data3, gAmmoInfo[8].max);
pPlayer->hasWeapon[9] = 1;
pPlayer->hasWeapon[kWeapLifeLeech] = 1;
if (pPlayer->curWeapon != kWeapLifeLeech)
{
if (!VanillaMode() && checkFired6or7(pPlayer)) // if tnt/spray is actively used, do not switch weapon
break;
pPlayer->weaponState = 0;
pPlayer->nextWeapon = 9;
pPlayer->nextWeapon = kWeapLifeLeech;
}
}
}

View file

@ -1795,7 +1795,7 @@ void AltFireVoodoo(int nTrigger, PLAYER* pPlayer)
}
}
UseAmmo(pPlayer, 9, pPlayer->ammoCount[9]);
pPlayer->hasWeapon[10] = 0;
pPlayer->hasWeapon[kWeapVoodooDoll] = 0;
pPlayer->weaponState = -1;
}
}
@ -1816,7 +1816,7 @@ void DropVoodoo(int, PLAYER* pPlayer)
evPostActor(spawned, 90, kCallbackDropVoodoo);
UseAmmo(pPlayer, 6, gAmmoItemData[0].count);
UseAmmo(pPlayer, 9, pPlayer->ammoCount[9]);
pPlayer->hasWeapon[10] = 0;
pPlayer->hasWeapon[kWeapVoodooDoll] = 0;
}
}
@ -2014,7 +2014,7 @@ void AltFireLifeLeech(int, PLAYER* pPlayer)
missile->xspr.data3 = pPlayer->ammoCount[8];
pPlayer->ammoCount[8] = 0;
}
pPlayer->hasWeapon[9] = 0;
pPlayer->hasWeapon[kWeapLifeLeech] = 0;
}
}