- tabified the rest of Blood's code.

This commit is contained in:
Christoph Oelckers 2021-12-29 22:56:21 +01:00
parent b7d095b943
commit 5061d5b37c
32 changed files with 18547 additions and 17165 deletions

View file

@ -45,6 +45,12 @@ bool bINIOverride = false;
IniFile* BloodINI;
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void levelInitINI(const char* pzIni)
{
if (!fileSystem.FileExists(pzIni))
@ -67,7 +73,11 @@ void CheckKeyAbend(const char *pzSection, const char *pzKey)
I_Error("Key %s expected in section [%s] of BLOOD.INI", pzKey, pzSection);
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void levelLoadMapInfo(IniFile* pIni, MapRecord* pLevelInfo, const char* pzSection, int epinum, int mapnum, int* nextmap, int* nextsecret)
{
@ -88,6 +98,12 @@ void levelLoadMapInfo(IniFile* pIni, MapRecord* pLevelInfo, const char* pzSectio
}
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
static const char* DefFile(void)
{
int found = -1;
@ -129,6 +145,12 @@ static const char* DefFile(void)
return userConfig.DefaultCon.IsNotEmpty() ? userConfig.DefaultCon.GetChars() : "blood.ini";
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
static FString cleanPath(const char* pth)
{
FString path = pth;
@ -149,6 +171,12 @@ static FString cleanPath(const char* pth)
return path;
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void levelLoadDefaults(void)
{
char buffer[64];
@ -230,6 +258,12 @@ void levelLoadDefaults(void)
}
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void levelEndLevel(int secret)
{
gGameOptions.uGameFlags |= GF_AdvanceLevel;
@ -237,6 +271,12 @@ void levelEndLevel(int secret)
else gNextLevel = FindNextSecretMap(currentLevel);
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void levelTryPlayMusic()
{
FString buffer;

View file

@ -39,7 +39,7 @@ BEGIN_BLD_NS
void validateLinks();
// All AI states for assigning an index.
static AISTATE* allAIStates[] =
static AISTATE* const allAIStates[] =
{
nullptr,
&genIdle,
@ -391,6 +391,12 @@ static AISTATE* allAIStates[] =
&zombieFTeslaRecoil,
};
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
FSerializer& Serialize(FSerializer& arc, const char* keyname, AISTATE*& w, AISTATE** def)
{
unsigned i = 0;
@ -456,6 +462,12 @@ FSerializer& Serialize(FSerializer& arc, const char* keyname, DUDEEXTRA& w, DUDE
return arc;
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void DBloodActor::Serialize(FSerializer& arc)
{
Super::Serialize(arc);
@ -493,6 +505,12 @@ void DBloodActor::Serialize(FSerializer& arc)
}
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
FSerializer& Serialize(FSerializer& arc, const char* keyname, XWALL& w, XWALL* def)
{
static XWALL nul;
@ -520,6 +538,12 @@ FSerializer& Serialize(FSerializer& arc, const char* keyname, XWALL& w, XWALL* d
return arc;
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
FSerializer& Serialize(FSerializer& arc, const char* keyname, XSECTOR& w, XSECTOR* def)
{
static XSECTOR nul;
@ -573,6 +597,12 @@ FSerializer& Serialize(FSerializer& arc, const char* keyname, XSECTOR& w, XSECTO
return arc;
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
FSerializer& Serialize(FSerializer& arc, const char* keyname, XSPRITE& w, XSPRITE* def)
{
static XSPRITE nul;
@ -623,6 +653,12 @@ FSerializer& Serialize(FSerializer& arc, const char* keyname, XSPRITE& w, XSPRIT
return arc;
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
FSerializer& Serialize(FSerializer& arc, const char* keyname, GAMEOPTIONS& w, GAMEOPTIONS* def)
{
if (arc.BeginObject(keyname))
@ -647,6 +683,12 @@ FSerializer& Serialize(FSerializer& arc, const char* keyname, GAMEOPTIONS& w, GA
return arc;
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void SerializeState(FSerializer& arc)
{
if (arc.isReading())
@ -690,6 +732,12 @@ void SerializeView(FSerializer& arc);
void SerializeNNExts(FSerializer& arc);
void SerializeMirrors(FSerializer& arc);
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void GameInterface::SerializeGameState(FSerializer& arc)
{
if (arc.isWriting())

View file

@ -56,8 +56,6 @@ struct walltypedisk
BEGIN_BLD_NS
TArray<walltype> dbLoadMapWalls(const char* pPath);
class DBloodActor;
struct AISTATE;

View file

@ -34,6 +34,12 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
BEGIN_BLD_NS
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void sub_5A928(void)
{
for (int i = 0; i < buttonMap.NumButtons(); i++)
@ -261,6 +267,12 @@ void ToggleDelirium(void)
bool bPlayerCheated = false;
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
static int parseArgs(char* pzArgs, int* nArg1, int* nArg2)
{
if (!nArg1 || !nArg2 || strlen(pzArgs) < 3)
@ -271,6 +283,12 @@ static int parseArgs(char *pzArgs, int *nArg1, int *nArg2)
return 2;
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
const char* GameInterface::GenericCheat(int player, int cheat)
{
// message processing is not perfect because many cheats output multiple messages.
@ -409,6 +427,12 @@ const char* GameInterface::GenericCheat(int player, int cheat)
return nullptr;
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
static bool cheatGoonies(cheatseq_t*)
{
SetMap(!gFullMap);
@ -433,6 +457,12 @@ static bool cheatCalgon(cheatseq_t*)
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
static cheatseq_t s_CheatInfo[] = {
{"MPKFA", nullptr, SendGenericCheat, 0, CHT_GOD },
{"CAPINMYASS", nullptr, SendGenericCheat, 0, CHT_GODOFF },
@ -472,6 +502,12 @@ static cheatseq_t s_CheatInfo[] = {
//{"SPIELBERG", nullptr, doCheat<kCheatSpielberg, 1 }, // SPIELBERG (Disables all cheats. If number values corresponding to a level and episode number are entered after the cheat word (i.e. "spielberg 1 3" for Phantom Express), you will be spawned to said level and the game will begin recording a demo from your actions.)
};
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void cheatReset(void)
{
bPlayerCheated = 0;
@ -483,6 +519,12 @@ void cheatReset(void)
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
static void cmd_Give(int player, uint8_t** stream, bool skip)
{
int type = ReadByte(stream);

View file

@ -35,6 +35,12 @@ int mirrorcnt, mirrorsector, mirrorwall[4];
MIRROR mirror[16]; // only needed by Polymost.
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void InitMirrors(void)
{
r_rortexture = 4080;
@ -172,6 +178,12 @@ FSerializer& Serialize(FSerializer& arc, const char* keyname, MIRROR& w, MIRROR*
return arc;
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void SerializeMirrors(FSerializer& arc)
{
if (arc.BeginObject("mirror"))

View file

@ -2274,7 +2274,8 @@ void trPlayerCtrlGiveStuff(int data2, int weapon, int data4, PLAYER* pPlayer, TR
{
Printf(PRINT_HIGH, "Weapon #%d is out of a weapons range!", weapon);
break;
} else if (data2 == 2 && data4 == 0)
}
else if (data2 == 2 && data4 == 0)
{
Printf(PRINT_HIGH, "Zero ammo for weapon #%d is specified!", weapon);
break;
@ -8464,7 +8465,8 @@ void aiPatrolThink(DBloodActor* actor)
// move next marker
aiPatrolSetMarker(actor);
} else if (aiPatrolTurning(actor->xspr.aiState))
}
else if (aiPatrolTurning(actor->xspr.aiState))
{
//viewSetSystemMessage("TURN");
if ((int)actor->spr.ang == (int)actor->xspr.goalAng)

View file

@ -225,6 +225,12 @@ DAMAGEINFO damageInfo[7] = {
{ 0, 0, 0, 0, 0, 0, 0 }
};
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
inline bool IsTargetTeammate(PLAYER* pSourcePlayer, DBloodActor* target)
{
if (pSourcePlayer == nullptr)
@ -247,6 +253,12 @@ inline bool IsTargetTeammate(PLAYER* pSourcePlayer, DBloodActor* target)
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
int powerupCheck(PLAYER* pPlayer, int nPowerUp)
{
assert(pPlayer != NULL);
@ -258,6 +270,12 @@ int powerupCheck(PLAYER *pPlayer, int nPowerUp)
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
bool powerupActivate(PLAYER* pPlayer, int nPowerUp)
{
if (powerupCheck(pPlayer, nPowerUp) > 0 && gPowerUpInfo[nPowerUp].pickupOnce)
@ -325,6 +343,12 @@ bool powerupActivate(PLAYER *pPlayer, int nPowerUp)
return 1;
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void powerupDeactivate(PLAYER* pPlayer, int nPowerUp)
{
int nPack = powerupToPackItem(nPowerUp);
@ -374,6 +398,12 @@ void powerupDeactivate(PLAYER *pPlayer, int nPowerUp)
}
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void powerupSetState(PLAYER* pPlayer, int nPowerUp, bool bState)
{
if (!bState)
@ -382,6 +412,12 @@ void powerupSetState(PLAYER *pPlayer, int nPowerUp, bool bState)
powerupDeactivate(pPlayer, nPowerUp);
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void powerupProcess(PLAYER* pPlayer)
{
pPlayer->packItemTime = ClipLow(pPlayer->packItemTime - 4, 0);
@ -412,6 +448,12 @@ void powerupProcess(PLAYER *pPlayer)
}
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void powerupClear(PLAYER* pPlayer)
{
for (int i = kMaxPowerUps - 1; i >= 0; i--)
@ -420,6 +462,12 @@ void powerupClear(PLAYER *pPlayer)
}
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
int packItemToPowerup(int nPack)
{
int nPowerUp = -1;
@ -445,6 +493,12 @@ int packItemToPowerup(int nPack)
return nPowerUp;
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
int powerupToPackItem(int nPowerUp)
{
switch (nPowerUp) {
@ -460,6 +514,12 @@ int powerupToPackItem(int nPowerUp)
return -1;
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
bool packAddItem(PLAYER* pPlayer, unsigned int nPack)
{
if (nPack <= 4)
@ -480,6 +540,12 @@ bool packAddItem(PLAYER *pPlayer, unsigned int nPack)
return 1;
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
int packCheckItem(PLAYER* pPlayer, int nPack)
{
return pPlayer->packSlots[nPack].curAmount;
@ -490,6 +556,12 @@ bool packItemActive(PLAYER *pPlayer, int nPack)
return pPlayer->packSlots[nPack].isActive;
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void packUseItem(PLAYER* pPlayer, int nPack)
{
bool v4 = 0;
@ -537,6 +609,12 @@ void packUseItem(PLAYER *pPlayer, int nPack)
powerupSetState(pPlayer, nPowerUp, pPlayer->packSlots[nPack].isActive);
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void packPrevItem(PLAYER* pPlayer)
{
if (pPlayer->packItemTime > 0)
@ -560,6 +638,12 @@ void packPrevItem(PLAYER *pPlayer)
pPlayer->packItemTime = 600;
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void packNextItem(PLAYER* pPlayer)
{
if (pPlayer->packItemTime > 0)
@ -582,6 +666,12 @@ void packNextItem(PLAYER* pPlayer)
pPlayer->packItemTime = 600;
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
bool playerSeqPlaying(PLAYER* pPlayer, int nSeq)
{
int nCurSeq = seqGetID(pPlayer->actor);
@ -590,6 +680,12 @@ bool playerSeqPlaying(PLAYER * pPlayer, int nSeq)
return 0;
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void playerSetRace(PLAYER* pPlayer, int nLifeMode)
{
assert(nLifeMode >= kModeHuman && nLifeMode <= kModeHumanGrown);
@ -604,6 +700,12 @@ void playerSetRace(PLAYER *pPlayer, int nLifeMode)
pDudeInfo->damageVal[i] = MulScale(Handicap[gSkill], pDudeInfo->startDamage[i], 8);
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void playerSetGodMode(PLAYER* pPlayer, bool bGodMode)
{
pPlayer->godMode = bGodMode;
@ -637,6 +739,12 @@ void playerResetPosture(PLAYER* pPlayer) {
memcpy(pPlayer->pPosture, gPostureDefaults, sizeof(gPostureDefaults));
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void playerStart(int nPlayer, int bNewLevel)
{
PLAYER* pPlayer = &gPlayer[nPlayer];
@ -793,6 +901,12 @@ void playerStart(int nPlayer, int bNewLevel)
}
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void playerReset(PLAYER* pPlayer)
{
static int dword_136400[] = {
@ -848,6 +962,12 @@ void playerReset(PLAYER *pPlayer)
int team_score[8];
int team_ticker[8];
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void playerInit(int nPlayer, unsigned int a2)
{
if (!(a2 & 1))
@ -867,6 +987,12 @@ void playerInit(int nPlayer, unsigned int a2)
playerReset(pPlayer);
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
bool findDroppedLeech(PLAYER* a1, DBloodActor* a2)
{
BloodStatIterator it(kStatThing);
@ -880,6 +1006,12 @@ bool findDroppedLeech(PLAYER *a1, DBloodActor *a2)
return 0;
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
bool PickupItem(PLAYER* pPlayer, DBloodActor* itemactor)
{
char buffer[80];
@ -1107,6 +1239,12 @@ bool PickupItem(PLAYER *pPlayer, DBloodActor* itemactor)
return 1;
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
bool PickupAmmo(PLAYER* pPlayer, DBloodActor* ammoactor)
{
const AMMOITEMDATA* pAmmoItemData = &gAmmoItemData[ammoactor->spr.type - kItemAmmoBase];
@ -1125,6 +1263,12 @@ bool PickupAmmo(PLAYER* pPlayer, DBloodActor* ammoactor)
return 1;
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
bool PickupWeapon(PLAYER* pPlayer, DBloodActor* weaponactor)
{
const WEAPONITEMDATA* pWeaponItemData = &gWeaponItemData[weaponactor->spr.type - kItemWeaponBase];
@ -1164,6 +1308,12 @@ bool PickupWeapon(PLAYER *pPlayer, DBloodActor* weaponactor)
return 1;
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void PickUp(PLAYER* pPlayer, DBloodActor* actor)
{
const char* msg = nullptr;
@ -1181,11 +1331,13 @@ void PickUp(PLAYER *pPlayer, DBloodActor* actor)
pickedUp = PickupItem(pPlayer, actor);
if (pickedUp && customMsg == -1) msg = GStrings(FStringf("TXTB_ITEM%02d", int(nType - kItemBase + 1)));
} else if (nType >= kItemAmmoBase && nType < kItemAmmoMax) {
}
else if (nType >= kItemAmmoBase && nType < kItemAmmoMax) {
pickedUp = PickupAmmo(pPlayer, actor);
if (pickedUp && customMsg == -1) msg = GStrings(FStringf("TXTB_AMMO%02d", int(nType - kItemAmmoBase + 1)));
} else if (nType >= kItemWeaponBase && nType < kItemWeaponMax) {
}
else if (nType >= kItemWeaponBase && nType < kItemWeaponMax) {
pickedUp = PickupWeapon(pPlayer, actor);
if (pickedUp && customMsg == -1) msg = GStrings(FStringf("TXTB_WPN%02d", int(nType - kItemWeaponBase + 1)));
}
@ -1207,6 +1359,12 @@ void PickUp(PLAYER *pPlayer, DBloodActor* actor)
}
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void CheckPickUp(PLAYER* pPlayer)
{
auto plActor = pPlayer->actor;
@ -1244,6 +1402,12 @@ void CheckPickUp(PLAYER *pPlayer)
}
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
int ActionScan(PLAYER* pPlayer, HitInfo* out)
{
auto plActor = pPlayer->actor;
@ -1348,6 +1512,12 @@ void doslopetilting(PLAYER* pPlayer, double const scaleAdjust = 1)
pPlayer->horizon.calcviewpitch(plActor->spr.pos.vec2, buildang(plActor->spr.ang), va, plActor->spr.sector()->floorstat & CSTAT_SECTOR_SLOPE, plActor->spr.sector(), scaleAdjust);
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void ProcessInput(PLAYER* pPlayer)
{
enum
@ -1783,6 +1953,12 @@ void playerProcess(PLAYER *pPlayer)
}
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
DBloodActor* playerFireMissile(PLAYER* pPlayer, int a2, int a3, int a4, int a5, int a6)
{
return actFireMissile(pPlayer->actor, a2, pPlayer->zWeapon - pPlayer->actor->spr.pos.Z, a3, a4, a5, a6);
@ -1794,6 +1970,12 @@ DBloodActor* playerFireThing(PLAYER *pPlayer, int a2, int a3, int thingType, int
return actFireThing(pPlayer->actor, a2, pPlayer->zWeapon - pPlayer->actor->spr.pos.Z, pPlayer->slope + a3, thingType, a5);
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void playerFrag(PLAYER* pKiller, PLAYER* pVictim)
{
assert(pKiller != NULL);
@ -1854,6 +2036,12 @@ void playerFrag(PLAYER *pKiller, PLAYER *pVictim)
viewSetMessage(buffer);
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void FragPlayer(PLAYER* pPlayer, DBloodActor* killer)
{
if (killer && killer->IsPlayerActor())
@ -1879,6 +2067,12 @@ void FragPlayer(PLAYER *pPlayer, DBloodActor* killer)
}
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
int playerDamageArmor(PLAYER* pPlayer, DAMAGE_TYPE nType, int nDamage)
{
DAMAGEINFO* pDamageInfo = &damageInfo[nType];
@ -1900,6 +2094,12 @@ int playerDamageArmor(PLAYER *pPlayer, DAMAGE_TYPE nType, int nDamage)
return nDamage;
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void flagDropped(PLAYER* pPlayer, int a2)
{
DBloodActor* playeractor = pPlayer->actor;
@ -1928,6 +2128,12 @@ void flagDropped(PLAYER *pPlayer, int a2)
}
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
int playerDamageSprite(DBloodActor* source, PLAYER* pPlayer, DAMAGE_TYPE nDamageType, int nDamage)
{
assert(pPlayer != NULL);
@ -2090,6 +2296,12 @@ int playerDamageSprite(DBloodActor* source, PLAYER *pPlayer, DAMAGE_TYPE nDamage
return nDamage;
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
int UseAmmo(PLAYER* pPlayer, int nAmmoType, int nDec)
{
if (gInfiniteAmmo)
@ -2100,6 +2312,12 @@ int UseAmmo(PLAYER *pPlayer, int nAmmoType, int nDec)
return pPlayer->ammoCount[nAmmoType];
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void voodooTarget(PLAYER* pPlayer)
{
DBloodActor* actor = pPlayer->actor;
@ -2120,6 +2338,12 @@ void voodooTarget(PLAYER *pPlayer)
pPlayer->voodooTargets = ClipLow(pPlayer->voodooTargets - 1, 0);
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void playerLandingSound(PLAYER* pPlayer)
{
static int surfaceSound[] = {
@ -2150,6 +2374,12 @@ void playerLandingSound(PLAYER *pPlayer)
}
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void PlayerSurvive(int, DBloodActor* actor)
{
char buffer[80];
@ -2172,6 +2402,12 @@ void PlayerSurvive(int, DBloodActor* actor)
}
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void PlayerKneelsOver(int, DBloodActor* actor)
{
for (int p = connecthead; p >= 0; p = connectpoint2[p])
@ -2336,6 +2572,12 @@ FSerializer& Serialize(FSerializer& arc, const char* keyname, PLAYER& w, PLAYER*
return arc;
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
#ifdef NOONE_EXTENSIONS
FSerializer& Serialize(FSerializer& arc, const char* keyname, TRPLAYERCTRL& w, TRPLAYERCTRL* def)
{
@ -2351,6 +2593,12 @@ FSerializer& Serialize(FSerializer& arc, const char* keyname, TRPLAYERCTRL& w, T
#endif
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void SerializePlayers(FSerializer& arc)
{
if (arc.BeginObject("players"))

View file

@ -36,6 +36,12 @@ void fxPrecache();
void gibPrecache();
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void tilePrecacheTile(int nTile, int nType, int palette)
{
int n = 1;
@ -80,6 +86,12 @@ void tilePrecacheTile(int nTile, int nType, int palette)
// To do: This needs to handle the sprite palettes as well to properly precache the needed content.
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void viewPrecacheTiles()
{
tilePrecacheTile(2173, 0, 0);
@ -123,7 +135,11 @@ void viewPrecacheTiles()
}
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void PrecacheDude(DBloodActor* actor)
{
@ -211,6 +227,12 @@ void PrecacheDude(DBloodActor *actor)
}
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void PrecacheThing(DBloodActor* actor)
{
int palette = actor->spr.pal;
@ -241,6 +263,12 @@ void PrecacheThing(DBloodActor* actor)
tilePrecacheTile(actor->spr.picnum, -1, palette);
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void PreloadCache()
{
if (!r_precache) return;

View file

@ -89,6 +89,12 @@ static void qavInitTileFinderMap()
});
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
static QAVPrevTileFinder qavGetInterpType(const FString& type)
{
if (!qavPrevTileFinders.CountUsed()) qavInitTileFinderMap();
@ -111,6 +117,12 @@ void GameInterface::RemoveQAVInterpProps(const int res_id)
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void DrawFrame(double x, double y, double z, double a, double alpha, int picnum, int stat, int shade, int palnum, bool to3dview)
{
if (!to3dview)
@ -146,6 +158,12 @@ void DrawFrame(double x, double y, double z, double a, double alpha, int picnum,
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void QAV::Draw(double x, double y, int ticks, int stat, int shade, int palnum, bool to3dview, double const smoothratio)
{
assert(ticksPerFrame > 0);
@ -202,6 +220,12 @@ void QAV::Draw(double x, double y, int ticks, int stat, int shade, int palnum, b
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void QAV::Play(int start, int end, int nCallback, PLAYER* pData)
{
auto pActor = pData ? pData->actor : nullptr;
@ -231,7 +255,8 @@ void QAV::Play(int start, int end, int nCallback, PLAYER *pData)
// We need stop all sounds in a range
for (int a = 0; a <= pSound2->sndRange; a++)
sfxKill3DSound(pActor, -1, pSound2->sound + a);
} else {
}
else {
sndKillAllSounds();
}
}
@ -256,6 +281,12 @@ void QAV::Play(int start, int end, int nCallback, PLAYER *pData)
}
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void QAV::Precache(int palette)
{
for (int i = 0; i < nFrames; i++)
@ -268,6 +299,12 @@ void QAV::Precache(int palette)
}
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void qavProcessTicker(QAV* const pQAV, int* duration, int* lastTick)
{
if (*duration > 0)
@ -283,6 +320,12 @@ void qavProcessTicker(QAV* const pQAV, int* duration, int* lastTick)
*duration = ClipLow(*duration, 0);
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void qavProcessTimer(PLAYER* const pPlayer, QAV* const pQAV, int* duration, double* smoothratio, bool const fixedduration, bool const ignoreWeaponTimer)
{
// Process if not paused.
@ -317,9 +360,14 @@ void qavProcessTimer(PLAYER* const pPlayer, QAV* const pQAV, int* duration, doub
}
//---------------------------------------------------------------------------
//
// This is to eliminate a huge design issue in NBlood that was apparently copied verbatim from the DOS-Version.
// Sequences were cached in the resource and directly returned from there in writable form, with byte swapping directly performed in the cache on Big Endian systems.
// To avoid such unsafe operations this caches the read data separately.
//
//---------------------------------------------------------------------------
extern FMemArena seqcache; // Use the same storage as the SEQs.
static TMap<int, QAV*> qavcache;
QAV* getQAV(int res_id)

View file

@ -43,6 +43,12 @@ CVAR(Bool, hud_ctf_vanilla, false, CVAR_ARCHIVE)
BEGIN_BLD_NS
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
static void UpdateFrame(void)
{
auto tex = tileGetTexture(kBackTile);
@ -60,6 +66,12 @@ static void UpdateFrame(void)
twod->AddFlatFill(windowxy1.X - 3, windowxy2.Y + 1, windowxy2.X + 1, windowxy2.Y + 4, tex, 0, 1, 0xff2a2a2a);
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void UpdateStatusBar()
{
if (automapMode == am_off && hud_size <= Hud_Stbar)

View file

@ -68,6 +68,12 @@ static const uint8_t strobe[] = {
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
};
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
int GetWaveValue(int a, int b, int c)
{
b &= 2047;
@ -103,11 +109,22 @@ int GetWaveValue(int a, int b, int c)
return 0;
}
//---------------------------------------------------------------------------
//
// These can be fully regenerated after loading a savegame.
//
//---------------------------------------------------------------------------
TArray<sectortype*> shadeList;
TArray<sectortype*> panList;
TArray<walltype*> wallPanList;
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void DoSectorLighting(void)
{
for (auto& pSector : shadeList)
@ -194,6 +211,12 @@ void DoSectorLighting(void)
}
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void UndoSectorLighting(void)
{
for (auto& sect : sector)
@ -241,6 +264,11 @@ void UndoSectorLighting(void)
}
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void DoSectorPanning(void)
{
@ -302,6 +330,12 @@ void DoSectorPanning(void)
}
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void InitSectorFX(void)
{
shadeList.Clear();

View file

@ -106,6 +106,11 @@ void BloodSoundEngine::CalcPosVel(int type, const void* source, const float pt[3
}
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void GameInterface::UpdateSounds()
{
@ -134,6 +139,12 @@ void GameInterface::UpdateSounds()
soundEngine->UpdateSounds(I_GetTime());
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
FSoundID getSfx(FSoundID soundId, float& attenuation, int& pitch, int& relvol)
{
auto udata = soundEngine->GetUserData(soundId);
@ -147,6 +158,12 @@ FSoundID getSfx(FSoundID soundId, float &attenuation, int &pitch, int &relvol)
return soundId;
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void sfxPlay3DSound(int x, int y, int z, int soundId, sectortype* pSector)
{
if (!SoundEnabled() || soundId < 0) return;
@ -168,6 +185,12 @@ void sfxPlay3DSound(int x, int y, int z, int soundId, sectortype* pSector)
if (chan) chan->UserData = sectnum(pSector);
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void sfxPlay3DSoundCP(DBloodActor* pActor, int soundId, int playchannel, int playflags, int pitch, int volume)
{
if (!SoundEnabled() || soundId < 0 || !pActor) return;
@ -217,6 +240,12 @@ void sfxPlay3DSound(DBloodActor* pActor, int soundId, int a3, int a4)
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void sfxKill3DSound(DBloodActor* pActor, int a2, int a3)
{
if (!pActor)
@ -244,6 +273,12 @@ void sfxKillAllSounds(void)
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void sfxSetReverb(bool toggle)
{
if (toggle)

View file

@ -103,6 +103,12 @@ static void S_AddBloodSFX(int lumpnum)
}
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void sndInit(void)
{
soundEngine = new BloodSoundEngine;
@ -124,8 +130,11 @@ void sndInit(void)
soundEngine->HashSounds();
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
int sndGetRate(int format)
{
@ -134,8 +143,6 @@ int sndGetRate(int format)
return 11025;
}
bool sndCheckPlaying(unsigned int nSound)
{
auto snd = soundEngine->FindSoundByResID(nSound);
@ -152,6 +159,12 @@ void sndStopSample(unsigned int nSound)
}
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void sndStartSample(const char* pzSound, int nVolume, int nChannel)
{
if (!SoundEnabled())
@ -185,6 +198,12 @@ void sndStartSample(unsigned int nSound, int nVolume, int nChannel, bool bLoop,
}
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void sndStartWavID(unsigned int nSound, int nVolume, int nChannel)
{
return sndStartSample(nSound | 0x40000000, nVolume, nChannel);

View file

@ -42,6 +42,12 @@ uint8_t surfType[kMaxTiles];
int8_t tileShade[kMaxTiles];
short voxelIndex[kMaxTiles];
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void GameInterface::LoadGameTextures()
{
auto hFile = fileSystem.OpenFileReader("SURFACE.DAT");
@ -70,6 +76,12 @@ void GameInterface::LoadGameTextures()
}
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
int tileGetSurfType(int hit)
{
return surfType[hit];
@ -90,6 +102,12 @@ int tileGetSurfType(CollisionBase& hit)
}
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void GameInterface::SetTileProps(int tile, int surf, int vox, int shade)
{
if (surf != INT_MAX) surfType[tile] = surf;

View file

@ -32,6 +32,12 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
BEGIN_BLD_NS
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
unsigned int GetWaveValue(unsigned int nPhase, int nType)
{
switch (nType)
@ -48,6 +54,12 @@ unsigned int GetWaveValue(unsigned int nPhase, int nType)
return nPhase;
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
bool SetSpriteState(DBloodActor* actor, int nState)
{
if ((actor->xspr.busy & 0xffff) == 0 && actor->xspr.state == nState)
@ -73,6 +85,12 @@ bool SetSpriteState(DBloodActor* actor, int nState)
return 1;
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
bool SetWallState(walltype* pWall, int nState)
{
auto pXWall = &pWall->xw();
@ -93,6 +111,12 @@ bool SetWallState(walltype* pWall, int nState)
return 1;
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
bool SetSectorState(sectortype* pSector, int nState)
{
assert(pSector->hasX());
@ -129,6 +153,12 @@ bool SetSectorState(sectortype *pSector, int nState)
return 1;
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
TArray<BUSY> gBusy;
void AddBusy(sectortype* pSector, BUSYID a2, int nDelta)
@ -146,6 +176,12 @@ void AddBusy(sectortype* pSector, BUSYID a2, int nDelta)
gBusy.Push(b);
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void ReverseBusy(sectortype* pSector, BUSYID a2)
{
for (auto& b : gBusy)
@ -158,6 +194,12 @@ void ReverseBusy(sectortype* pSector, BUSYID a2)
}
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
unsigned int GetSourceBusy(EVENT& a1)
{
if (a1.isSector())
@ -178,6 +220,12 @@ unsigned int GetSourceBusy(EVENT& a1)
return 0;
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void LifeLeechOperate(DBloodActor* actor, EVENT event)
{
switch (event.cmd) {
@ -259,6 +307,12 @@ void LifeLeechOperate(DBloodActor* actor, EVENT event)
actPostSprite(actor, kStatFree);
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void ActivateGenerator(DBloodActor*);
void OperateSprite(DBloodActor* actor, EVENT event)
@ -597,6 +651,12 @@ void OperateSprite(DBloodActor* actor, EVENT event)
}
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void SetupGibWallState(walltype* pWall, XWALL* pXWall)
{
walltype* pWall2 = NULL;
@ -627,6 +687,12 @@ void SetupGibWallState(walltype *pWall, XWALL *pXWall)
}
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void OperateWall(walltype* pWall, EVENT event) {
auto pXWall = &pWall->xw();
@ -691,6 +757,12 @@ void OperateWall(walltype* pWall, EVENT event) {
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void SectorStartSound(sectortype* pSector, int nState)
{
BloodSectIterator it(pSector);
@ -712,6 +784,12 @@ void SectorStartSound(sectortype* pSector, int nState)
}
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void SectorEndSound(sectortype* pSector, int nState)
{
BloodSectIterator it(pSector);
@ -733,6 +811,12 @@ void SectorEndSound(sectortype* pSector, int nState)
}
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void PathSound(sectortype* pSector, int nSound)
{
BloodSectIterator it(pSector);
@ -743,6 +827,12 @@ void PathSound(sectortype* pSector, int nSound)
}
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void DragPoint(walltype* pWall, int x, int y)
{
vertexscan(pWall, [&](walltype* wal)
@ -752,6 +842,12 @@ void DragPoint(walltype* pWall, int x, int y)
});
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void TranslateSector(sectortype* pSector, int a2, int a3, int a4, int a5, int a6, int a7, int a8, int a9, int a10, int a11, char a12)
{
int x, y;
@ -868,6 +964,12 @@ void TranslateSector(sectortype* pSector, int a2, int a3, int a4, int a5, int a6
}
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void ZTranslateSector(sectortype* pSector, XSECTOR* pXSector, int a3, int a4)
{
viewInterpolateSector(pSector);
@ -920,6 +1022,12 @@ void ZTranslateSector(sectortype* pSector, XSECTOR *pXSector, int a3, int a4)
}
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
DBloodActor* GetHighestSprite(sectortype* pSector, int nStatus, int* z)
{
*z = pSector->floorz;
@ -942,6 +1050,12 @@ DBloodActor* GetHighestSprite(sectortype* pSector, int nStatus, int *z)
return found;
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
DBloodActor* GetCrushedSpriteExtents(sectortype* pSector, int* pzTop, int* pzBot)
{
assert(pzTop != NULL && pzBot != NULL);
@ -968,6 +1082,12 @@ DBloodActor* GetCrushedSpriteExtents(sectortype* pSector, int *pzTop, int *pzBot
return found;
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
int VCrushBusy(sectortype* pSector, unsigned int a2)
{
assert(pSector && pSector->hasX());
@ -1005,6 +1125,12 @@ int VCrushBusy(sectortype *pSector, unsigned int a2)
return 0;
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
int VSpriteBusy(sectortype* pSector, unsigned int a2)
{
assert(pSector && pSector->hasX());
@ -1052,6 +1178,12 @@ int VSpriteBusy(sectortype* pSector, unsigned int a2)
return 0;
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
int VDoorBusy(sectortype* pSector, unsigned int a2)
{
assert(pSector && pSector->hasX());
@ -1145,6 +1277,12 @@ int VDoorBusy(sectortype* pSector, unsigned int a2)
return 0;
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
int HDoorBusy(sectortype* pSector, unsigned int a2)
{
assert(pSector && pSector->hasX());
@ -1171,6 +1309,12 @@ int HDoorBusy(sectortype* pSector, unsigned int a2)
return 0;
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
int RDoorBusy(sectortype* pSector, unsigned int a2)
{
assert(pSector && pSector->hasX());
@ -1196,6 +1340,12 @@ int RDoorBusy(sectortype* pSector, unsigned int a2)
return 0;
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
int StepRotateBusy(sectortype* pSector, unsigned int a2)
{
assert(pSector && pSector->hasX());
@ -1228,6 +1378,12 @@ int StepRotateBusy(sectortype* pSector, unsigned int a2)
return 0;
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
int GenSectorBusy(sectortype* pSector, unsigned int a2)
{
assert(pSector && pSector->hasX());
@ -1244,6 +1400,12 @@ int GenSectorBusy(sectortype* pSector, unsigned int a2)
return 0;
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
int PathBusy(sectortype* pSector, unsigned int a2)
{
assert(pSector && pSector->hasX());
@ -1272,6 +1434,12 @@ int PathBusy(sectortype* pSector, unsigned int a2)
return 0;
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void OperateDoor(sectortype* pSector, EVENT event, BUSYID busyWave)
{
auto pXSector = &pSector->xs();
@ -1292,7 +1460,8 @@ void OperateDoor(sectortype* pSector, EVENT event, BUSYID busyWave)
ReverseBusy(pSector, busyWave);
pXSector->state = !pXSector->state;
}
} else {
}
else {
char t = !pXSector->state; int nDelta;
if (t) nDelta = 65536 / ClipLow((pXSector->busyTimeA * 120) / 10, 1);
@ -1305,6 +1474,12 @@ void OperateDoor(sectortype* pSector, EVENT event, BUSYID busyWave)
}
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
bool SectorContainsDudes(sectortype* pSector)
{
BloodSectIterator it(pSector);
@ -1316,6 +1491,12 @@ bool SectorContainsDudes(sectortype * pSector)
return 0;
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void TeleFrag(DBloodActor* killer, sectortype* pSector)
{
BloodSectIterator it(pSector);
@ -1328,6 +1509,12 @@ void TeleFrag(DBloodActor* killer, sectortype* pSector)
}
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void OperateTeleport(sectortype* pSector)
{
assert(pSector);
@ -1374,6 +1561,12 @@ void OperateTeleport(sectortype* pSector)
}
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void OperatePath(sectortype* pSector, EVENT event)
{
DBloodActor* actor;
@ -1420,6 +1613,12 @@ void OperatePath(sectortype* pSector, EVENT event)
}
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void OperateSector(sectortype* pSector, EVENT event)
{
if (!pSector->hasX()) return;
@ -1507,7 +1706,8 @@ void OperateSector(sectortype* pSector, EVENT event)
break;
}
} else {
}
else {
OperateDoor(pSector, event, BUSYID_6);
@ -1519,6 +1719,12 @@ void OperateSector(sectortype* pSector, EVENT event)
}
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void InitPath(sectortype* pSector, XSECTOR* pXSector)
{
DBloodActor* actor = nullptr;
@ -1546,6 +1752,12 @@ void InitPath(sectortype* pSector, XSECTOR *pXSector)
evPostSector(pSector, 0, kCmdOn);
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void LinkSector(sectortype* pSector, EVENT event)
{
auto pXSector = &pSector->xs();
@ -1575,6 +1787,12 @@ void LinkSector(sectortype* pSector, EVENT event)
}
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void LinkSprite(DBloodActor* actor, EVENT event)
{
int nBusy = GetSourceBusy(event);
@ -1604,6 +1822,12 @@ void LinkSprite(DBloodActor* actor, EVENT event)
}
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void LinkWall(walltype* pWall, EVENT& event)
{
int nBusy = GetSourceBusy(event);
@ -1612,6 +1836,12 @@ void LinkWall(walltype* pWall, EVENT& event)
SetWallState(pWall, FixedToInt(nBusy));
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void trTriggerSector(sectortype* pSector, int command)
{
auto pXSector = &pSector->xs();
@ -1632,6 +1862,12 @@ void trTriggerSector(sectortype* pSector, int command)
}
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void trTriggerWall(walltype* pWall, int command)
{
if (!pWall->hasX()) return;
@ -1653,6 +1889,12 @@ void trTriggerWall(walltype* pWall, int command)
}
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void trTriggerSprite(DBloodActor* actor, int command)
{
if (!actor->xspr.locked && !actor->xspr.isTriggered) {
@ -1672,6 +1914,12 @@ void trTriggerSprite(DBloodActor* actor, int command)
}
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void trMessageSector(sectortype* pSector, EVENT event)
{
if (!pSector->hasX()) return;
@ -1695,6 +1943,12 @@ void trMessageSector(sectortype* pSector, EVENT event)
}
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void trMessageWall(walltype* pWall, EVENT& event)
{
assert(pWall->hasX());
@ -1718,6 +1972,12 @@ void trMessageWall(walltype* pWall, EVENT& event)
}
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void trMessageSprite(DBloodActor* actor, EVENT event)
{
if (actor->spr.statnum != kStatFree) {
@ -1742,7 +2002,11 @@ void trMessageSprite(DBloodActor* actor, EVENT event)
}
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void ProcessMotion(void)
{
@ -1816,6 +2080,12 @@ void ProcessMotion(void)
}
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void AlignSlopes(void)
{
for (auto& sect : sector)
@ -1838,6 +2108,12 @@ void AlignSlopes(void)
}
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
int(*gBusyProc[])(sectortype*, unsigned int) =
{
VCrushBusy,
@ -1885,6 +2161,12 @@ void trProcessBusy(void)
AlignSlopes();
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void InitGenerator(DBloodActor*);
void trInit(TArray<DBloodActor*>& actors)
@ -2053,6 +2335,12 @@ void trInit(TArray<DBloodActor*>& actors)
}
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void trTextOver(int nId)
{
const char* pzMessage = currentLevel->GetMessage(nId);
@ -2060,6 +2348,12 @@ void trTextOver(int nId)
viewSetMessage(pzMessage, VanillaMode() ? 0 : 8, MESSAGE_PRIORITY_INI); // 8: gold
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void InitGenerator(DBloodActor* actor)
{
assert(actor->hasX());
@ -2073,6 +2367,12 @@ void InitGenerator(DBloodActor* actor)
evPostActor(actor, (120 * (actor->xspr.busyTime + Random2(actor->xspr.data1))) / 10, kCmdRepeat);
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void ActivateGenerator(DBloodActor* actor)
{
assert(actor->hasX());
@ -2112,6 +2412,12 @@ void ActivateGenerator(DBloodActor* actor)
}
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void FireballTrapSeqCallback(int, DBloodActor* actor)
{
if (actor->spr.cstat & CSTAT_SPRITE_ALIGNMENT_FLOOR)
@ -2121,6 +2427,12 @@ void FireballTrapSeqCallback(int, DBloodActor* actor)
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void MGunFireSeqCallback(int, DBloodActor* actor)
{
if (actor->xspr.data2 > 0 || actor->xspr.data1 == 0)

View file

@ -56,6 +56,12 @@ double gInterpolate;
int gScreenTilt;
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void viewBackupView(int nPlayer)
{
PLAYER* pPlayer = &gPlayer[nPlayer];
@ -78,6 +84,12 @@ void viewBackupView(int nPlayer)
pPlayer->horizon.backup();
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void viewCorrectViewOffsets(int nPlayer, vec3_t const* oldpos)
{
PLAYER* pPlayer = &gPlayer[nPlayer];
@ -87,6 +99,12 @@ void viewCorrectViewOffsets(int nPlayer, vec3_t const *oldpos)
pView->viewz += pPlayer->actor->spr.pos.Z - oldpos->Z;
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void viewDrawText(FFont* pFont, const char* pString, int x, int y, int nShade, int nPalette, int position, bool shadow)
{
if (!pString) return;
@ -106,11 +124,23 @@ void viewDrawText(FFont* pFont, const char *pString, int x, int y, int nShade, i
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
GameStats GameInterface::getStats()
{
return { gKillMgr.Kills, gKillMgr.TotalKills, gSecretMgr.Founds, gSecretMgr.Total, gFrameCount / kTicsPerSec, gPlayer[myconnectindex].fragCount };
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void viewDrawAimedPlayerName(void)
{
if (!cl_idplayers || (gView->aim.dx == 0 && gView->aim.dy == 0))
@ -135,6 +165,12 @@ int *lensTable;
extern int dword_172CE0[16][3];
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void viewInit(void)
{
Printf("Initializing status bar\n");
@ -163,6 +199,12 @@ void viewInit(void)
int othercameradist = 1280;
int othercameraclock;
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
#if 0
void CalcOtherPosition(DBloodActor* actor, int* pX, int* pY, int* pZ, sectortype** vsectnum, int nAng, fixed_t zm, int smoothratio) // currently unused
{
@ -210,7 +252,12 @@ void CalcOtherPosition(DBloodActor *actor, int *pX, int *pY, int *pZ, sectortype
}
#endif
//---------------------------------------------------------------------------
//
// by NoOne: show warning msgs in game instead of throwing errors (in some cases)
//
//---------------------------------------------------------------------------
void viewSetSystemMessage(const char* pMessage, ...) {
char buffer[1024]; va_list args; va_start(args, pMessage);
vsprintf(buffer, pMessage, args);
@ -229,6 +276,12 @@ void viewSetErrorMessage(const char *pMessage)
Printf(PRINT_BOLD | PRINT_NOTIFY, "%s\n", pMessage);
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void DoLensEffect(void)
{
// To investigate whether this can be implemented as a shader effect.
@ -242,6 +295,12 @@ void DoLensEffect(void)
TileFiles.InvalidateTile(4077);
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void UpdateDacs(int nPalette, bool bNoTint)
{
gLastPal = 0;
@ -279,6 +338,12 @@ void UpdateDacs(int nPalette, bool bNoTint)
videoSetPalette(nPalette);
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void UpdateBlend()
{
int nRed = 0;
@ -315,6 +380,12 @@ int gScreenTiltO, deliriumTurnO, deliriumPitchO;
int gShowFrameRate = 1;
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void viewUpdateDelirium(void)
{
gScreenTiltO = gScreenTilt;
@ -356,6 +427,12 @@ void viewUpdateDelirium(void)
}
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void viewUpdateShake(int& cX, int& cY, int& cZ, binangle& cA, fixedhoriz& cH, double& pshakeX, double& pshakeY)
{
auto doEffect = [&](const int& effectType)
@ -381,6 +458,12 @@ int gLastPal = 0;
int32_t g_frameRate;
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
static void DrawMap(DBloodActor* view)
{
int tm = 0;
@ -398,6 +481,12 @@ static void DrawMap(DBloodActor* view)
setViewport(hud_size);
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void SetupView(int& cX, int& cY, int& cZ, binangle& cA, fixedhoriz& cH, sectortype*& pSector, double& zDelta, double& shakeX, double& shakeY, binangle& rotscrnang)
{
int bobWidth, bobHeight;
@ -480,6 +569,12 @@ void SetupView(int &cX, int& cY, int& cZ, binangle& cA, fixedhoriz& cH, sectorty
CheckLink((int*)&cX, (int*)&cY, (int*)&cZ, &pSector);
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void renderCrystalBall()
{
#if 0
@ -542,6 +637,12 @@ void renderCrystalBall()
void render3DViewPolymost(int nSectnum, int cX, int cY, int cZ, binangle cA, fixedhoriz cH);
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void viewDrawScreen(bool sceneonly)
{
if (testgotpic(2342, true))
@ -737,6 +838,12 @@ void viewDrawScreen(bool sceneonly)
}
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
bool GameInterface::GenerateSavePic()
{
viewDrawScreen(true);
@ -754,6 +861,12 @@ FString GameInterface::GetCoordString()
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
bool GameInterface::DrawAutomapPlayer(int mx, int my, int x, int y, int z, int a, double const smoothratio)
{
for (int i = connecthead; i >= 0; i = connectpoint2[i])
@ -791,6 +904,12 @@ bool GameInterface::DrawAutomapPlayer(int mx, int my, int x, int y, int z, int a
return true;
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void SerializeView(FSerializer& arc)
{
if (arc.BeginObject("view"))

View file

@ -35,6 +35,12 @@ ZONE gStartZone[8];
bool gTeamsSpawnUsed = false;
#endif
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void validateLinks()
{
int snum = 0;
@ -57,6 +63,12 @@ void validateLinks()
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void warpInit(TArray<DBloodActor*>& actors)
{
#ifdef NOONE_EXTENSIONS
@ -102,7 +114,8 @@ void warpInit(TArray<DBloodActor*>& actors)
pZone->ang = actor->spr.ang;
team1++;
} else if (actor->xspr.data2 == 2) {
}
else if (actor->xspr.data2 == 2) {
pZone = &gStartZoneTeam2[team2];
pZone->x = actor->spr.pos.X;
pZone->y = actor->spr.pos.Y;
@ -182,6 +195,12 @@ void warpInit(TArray<DBloodActor*>& actors)
validateLinks();
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
int CheckLink(DBloodActor* actor)
{
auto pSector = actor->spr.sector();
@ -240,6 +259,12 @@ int CheckLink(DBloodActor *actor)
return 0;
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
int CheckLink(int* x, int* y, int* z, sectortype** pSector)
{
auto aUpper = barrier_cast<DBloodActor*>((*pSector)->upperLink);

View file

@ -139,6 +139,12 @@ enum
nClientAltFireNapalm,
};
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
bool checkFired6or7(PLAYER* pPlayer)
{
switch (pPlayer->curWeapon)
@ -168,11 +174,23 @@ bool checkFired6or7(PLAYER *pPlayer)
return 0;
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
static bool BannedUnderwater(int nWeapon)
{
return nWeapon == kWeapSpraycan || nWeapon == kWeapDynamite;
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
static bool CheckWeaponAmmo(PLAYER* pPlayer, int weapon, int ammotype, int count)
{
if (gInfiniteAmmo)
@ -186,6 +204,12 @@ static bool CheckWeaponAmmo(PLAYER *pPlayer, int weapon, int ammotype, int count
return pPlayer->ammoCount[ammotype] >= count;
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
static bool CheckAmmo(PLAYER* pPlayer, int ammotype, int count)
{
if (gInfiniteAmmo)
@ -199,6 +223,12 @@ static bool CheckAmmo(PLAYER *pPlayer, int ammotype, int count)
return pPlayer->ammoCount[ammotype] >= count;
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
static bool checkAmmo2(const PLAYER* pPlayer, int ammotype, int amount)
{
if (gInfiniteAmmo)
@ -208,6 +238,12 @@ static bool checkAmmo2(const PLAYER *pPlayer, int ammotype, int amount)
return pPlayer->ammoCount[ammotype] >= amount;
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void SpawnBulletEject(PLAYER* pPlayer, int a2, int a3)
{
POSTURE* pPosture = &pPlayer->pPosture[pPlayer->lifeMode][pPlayer->posture];
@ -225,6 +261,12 @@ void SpawnShellEject(PLAYER *pPlayer, int a2, int a3)
fxSpawnEjectingShell(pPlayer->actor, dz, a2, a3);
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void WeaponInit(void)
{
auto doInit = [](const int base)
@ -241,6 +283,12 @@ void WeaponInit(void)
doInit(10000);
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void WeaponPrecache()
{
auto doPrecache = [](const int base)
@ -257,6 +305,12 @@ void WeaponPrecache()
doPrecache(10000);
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void WeaponDraw(PLAYER* pPlayer, int shade, double xpos, double ypos, int palnum)
{
assert(pPlayer != NULL);
@ -280,6 +334,12 @@ void WeaponDraw(PLAYER *pPlayer, int shade, double xpos, double ypos, int palnum
pQAV->Draw(xpos, ypos, duration, flags, shade, palnum, true, smoothratio);
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void WeaponPlay(PLAYER* pPlayer)
{
assert(pPlayer != NULL);
@ -290,6 +350,12 @@ void WeaponPlay(PLAYER *pPlayer)
pQAV->Play(nTicks - 4, nTicks, pPlayer->qavCallback, pPlayer);
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
static void StartQAV(PLAYER* pPlayer, int nWeaponQAV, int callback = -1, bool looped = false)
{
assert(nWeaponQAV < kQAVEnd);
@ -314,6 +380,12 @@ static void SetQAV(PLAYER *pPlayer, int nWeaponQAV)
pPlayer->qavLastTick = 0;
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
struct WEAPONTRACK
{
int aimSpeedHorz;
@ -341,6 +413,12 @@ WEAPONTRACK gWeaponTrack[] = {
{ 0x6000, 0x6000, 0x71, 0x55, 0, false },
};
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void UpdateAimVector(PLAYER* pPlayer)
{
assert(pPlayer != NULL);
@ -477,6 +555,12 @@ void UpdateAimVector(PLAYER * pPlayer)
pPlayer->aimTarget = targetactor;
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
struct t_WeaponModes
{
int update;
@ -650,6 +734,12 @@ void WeaponRaise(PLAYER *pPlayer)
}
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void WeaponLower(PLAYER* pPlayer)
{
assert(pPlayer != NULL);
@ -836,6 +926,12 @@ void WeaponLower(PLAYER *pPlayer)
pPlayer->qavLoop = 0;
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void WeaponUpdateState(PLAYER* pPlayer)
{
static int lastWeapon = 0;
@ -1053,6 +1149,12 @@ void WeaponUpdateState(PLAYER *pPlayer)
}
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void FirePitchfork(int, PLAYER* pPlayer)
{
DBloodActor* actor = pPlayer->actor;
@ -1064,6 +1166,12 @@ void FirePitchfork(int, PLAYER *pPlayer)
actFireVector(actor, (2 * i - 3) * 40, pPlayer->zWeapon - pPlayer->actor->spr.pos.Z, aim->dx + r1, aim->dy + r2, aim->dz + r3, kVectorTine);
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void FireSpray(int, PLAYER* pPlayer)
{
playerFireMissile(pPlayer, 0, pPlayer->aim.dx, pPlayer->aim.dy, pPlayer->aim.dz, kMissileFlameSpray);
@ -1074,6 +1182,12 @@ void FireSpray(int, PLAYER *pPlayer)
sfxKill3DSound(pPlayer->actor, -1, 441);
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void ThrowCan(int, PLAYER* pPlayer)
{
sfxKill3DSound(pPlayer->actor, -1, 441);
@ -1090,6 +1204,12 @@ void ThrowCan(int, PLAYER *pPlayer)
}
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void DropCan(int, PLAYER* pPlayer)
{
sfxKill3DSound(pPlayer->actor, -1, 441);
@ -1101,6 +1221,12 @@ void DropCan(int, PLAYER *pPlayer)
}
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void ExplodeCan(int, PLAYER* pPlayer)
{
sfxKill3DSound(pPlayer->actor, -1, 441);
@ -1115,6 +1241,12 @@ void ExplodeCan(int, PLAYER *pPlayer)
}
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void ThrowBundle(int, PLAYER* pPlayer)
{
sfxKill3DSound(pPlayer->actor, 16, -1);
@ -1132,6 +1264,12 @@ void ThrowBundle(int, PLAYER *pPlayer)
}
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void DropBundle(int, PLAYER* pPlayer)
{
sfxKill3DSound(pPlayer->actor, 16, -1);
@ -1143,6 +1281,12 @@ void DropBundle(int, PLAYER *pPlayer)
}
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void ExplodeBundle(int, PLAYER* pPlayer)
{
sfxKill3DSound(pPlayer->actor, 16, -1);
@ -1157,6 +1301,12 @@ void ExplodeBundle(int, PLAYER *pPlayer)
}
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void ThrowProx(int, PLAYER* pPlayer)
{
int nSpeed = MulScale(pPlayer->throwPower, 0x177777, 16) + 0x66666;
@ -1170,6 +1320,12 @@ void ThrowProx(int, PLAYER *pPlayer)
}
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void DropProx(int, PLAYER* pPlayer)
{
auto spawned = playerFireThing(pPlayer, 0, 0, kThingArmedProxBomb, 0);
@ -1180,6 +1336,12 @@ void DropProx(int, PLAYER *pPlayer)
}
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void ThrowRemote(int, PLAYER* pPlayer)
{
int nSpeed = MulScale(pPlayer->throwPower, 0x177777, 16) + 0x66666;
@ -1193,6 +1355,12 @@ void ThrowRemote(int, PLAYER *pPlayer)
}
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void DropRemote(int, PLAYER* pPlayer)
{
auto spawned = playerFireThing(pPlayer, 0, 0, kThingArmedRemoteBomb, 0);
@ -1208,6 +1376,12 @@ void FireRemote(int, PLAYER *pPlayer)
evSendGame(90 + (pPlayer->actor->spr.type - kDudePlayer1), kCmdOn);
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
enum { kMaxShotgunBarrels = 4 };
void FireShotgun(int nTrigger, PLAYER* pPlayer)
@ -1251,6 +1425,12 @@ void FireShotgun(int nTrigger, PLAYER *pPlayer)
pPlayer->flashEffect = 1;
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void EjectShell(int, PLAYER* pPlayer)
{
SpawnShellEject(pPlayer, 25, 35);
@ -1294,6 +1474,12 @@ void FireTommy(int nTrigger, PLAYER *pPlayer)
pPlayer->flashEffect = 1;
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
enum { kMaxSpread = 14 };
void FireSpread(int nTrigger, PLAYER* pPlayer)
@ -1318,6 +1504,12 @@ void FireSpread(int nTrigger, PLAYER *pPlayer)
pPlayer->flashEffect = 1;
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void AltFireSpread(int nTrigger, PLAYER* pPlayer)
{
DBloodActor* actor = pPlayer->actor;
@ -1348,6 +1540,12 @@ void AltFireSpread(int nTrigger, PLAYER *pPlayer)
pPlayer->flashEffect = 1;
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void AltFireSpread2(int nTrigger, PLAYER* pPlayer)
{
DBloodActor* actor = pPlayer->actor;
@ -1400,6 +1598,12 @@ void AltFireSpread2(int nTrigger, PLAYER *pPlayer)
}
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void FireFlare(int nTrigger, PLAYER* pPlayer)
{
auto plActor = pPlayer->actor;
@ -1420,6 +1624,12 @@ void FireFlare(int nTrigger, PLAYER *pPlayer)
pPlayer->flashEffect = 1;
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void AltFireFlare(int nTrigger, PLAYER* pPlayer)
{
auto plActor = pPlayer->actor;
@ -1440,6 +1650,12 @@ void AltFireFlare(int nTrigger, PLAYER *pPlayer)
pPlayer->flashEffect = 1;
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void FireVoodoo(int nTrigger, PLAYER* pPlayer)
{
nTrigger--;
@ -1498,6 +1714,12 @@ void FireVoodoo(int nTrigger, PLAYER *pPlayer)
}
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void AltFireVoodoo(int nTrigger, PLAYER* pPlayer)
{
DBloodActor* actor = pPlayer->actor;
@ -1578,6 +1800,12 @@ void AltFireVoodoo(int nTrigger, PLAYER *pPlayer)
}
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void DropVoodoo(int, PLAYER* pPlayer)
{
sfxPlay3DSound(pPlayer->actor, 455, 2, 0);
@ -1592,6 +1820,12 @@ void DropVoodoo(int , PLAYER *pPlayer)
}
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
struct TeslaMissile
{
int offset; // offset
@ -1602,6 +1836,12 @@ struct TeslaMissile
int flash; // weapon flash
};
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void FireTesla(int nTrigger, PLAYER* pPlayer)
{
TeslaMissile teslaMissile[6] =
@ -1637,6 +1877,12 @@ void FireTesla(int nTrigger, PLAYER *pPlayer)
}
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void AltFireTesla(int, PLAYER* pPlayer)
{
auto plActor = pPlayer->actor;
@ -1647,6 +1893,12 @@ void AltFireTesla(int , PLAYER *pPlayer)
pPlayer->flashEffect = 1;
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void FireNapalm(int nTrigger, PLAYER* pPlayer)
{
auto plActor = pPlayer->actor;
@ -1676,6 +1928,12 @@ void FireNapalm2(int , PLAYER *pPlayer)
pPlayer->flashEffect = 1;
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void AltFireNapalm(int, PLAYER* pPlayer)
{
int nSpeed = MulScale(0x8000, 0x177777, 16) + 0x66666;
@ -1693,6 +1951,12 @@ void AltFireNapalm(int , PLAYER *pPlayer)
}
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void FireLifeLeech(int nTrigger, PLAYER* pPlayer)
{
if (!CheckAmmo(pPlayer, 8, 1))
@ -1714,6 +1978,12 @@ void FireLifeLeech(int nTrigger, PLAYER *pPlayer)
pPlayer->visibility = ClipHigh(pPlayer->visibility + 5, 50);
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void AltFireLifeLeech(int, PLAYER* pPlayer)
{
DBloodActor* actor = pPlayer->actor;
@ -1748,6 +2018,12 @@ void AltFireLifeLeech(int , PLAYER *pPlayer)
}
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void FireBeast(int, PLAYER* pPlayer)
{
DBloodActor* actor = pPlayer->actor;
@ -1757,7 +2033,13 @@ void FireBeast(int , PLAYER * pPlayer)
actFireVector(actor, 0, pPlayer->zWeapon - pPlayer->actor->spr.pos.Z, pPlayer->aim.dx + r1, pPlayer->aim.dy + r2, pPlayer->aim.dz + r3, kVectorBeastSlash);
}
uint8_t gWeaponUpgrade[][13] = {
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
static const uint8_t gWeaponUpgrade[][13] = {
{ 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 },
{ 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 },
{ 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0 },
@ -1781,8 +2063,14 @@ int WeaponUpgrade(PLAYER *pPlayer, int newWeapon)
return weapon;
}
int OrderNext[] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 1, 1 };
int OrderPrev[] = { 12, 12, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 1 };
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
static const int OrderNext[] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 1, 1 };
static const int OrderPrev[] = { 12, 12, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 1 };
static int WeaponFindNext(PLAYER* pPlayer, int* a2, int bDir)
{
@ -1817,6 +2105,12 @@ static int WeaponFindNext(PLAYER *pPlayer, int *a2, int bDir)
return weapon;
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
static int WeaponFindLoaded(PLAYER* pPlayer, int* a2)
{
int v4 = 1;
@ -1858,6 +2152,12 @@ static int WeaponFindLoaded(PLAYER *pPlayer, int *a2)
return v4;
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
int processSprayCan(PLAYER* pPlayer)
{
switch (pPlayer->weaponState)
@ -1896,6 +2196,12 @@ int processSprayCan(PLAYER *pPlayer)
return 0;
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
static bool processTNT(PLAYER* pPlayer)
{
switch (pPlayer->weaponState)
@ -1934,6 +2240,12 @@ static bool processTNT(PLAYER *pPlayer)
return 0;
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
static bool processProxy(PLAYER* pPlayer)
{
switch (pPlayer->weaponState)
@ -1952,6 +2264,12 @@ static bool processProxy(PLAYER *pPlayer)
return 0;
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
static bool processRemote(PLAYER* pPlayer)
{
switch (pPlayer->weaponState)
@ -1968,6 +2286,12 @@ static bool processRemote(PLAYER *pPlayer)
return 0;
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
static bool processLeech(PLAYER* pPlayer)
{
switch (pPlayer->weaponState)
@ -1992,6 +2316,12 @@ static bool processLeech(PLAYER *pPlayer)
return 0;
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
static bool processTesla(PLAYER* pPlayer)
{
switch (pPlayer->weaponState)
@ -2025,6 +2355,12 @@ static bool processTesla(PLAYER *pPlayer)
return 0;
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void WeaponProcess(PLAYER* pPlayer) {
pPlayer->flashEffect = ClipLow(pPlayer->flashEffect - 1, 0);
@ -2648,6 +2984,12 @@ void WeaponProcess(PLAYER *pPlayer) {
WeaponUpdateState(pPlayer);
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void teslaHit(DBloodActor* missileactor, int a2)
{
int x = missileactor->spr.pos.X;