raze/source/games/exhumed/src/aistuff.h

857 lines
23 KiB
C
Raw Normal View History

//-------------------------------------------------------------------------
/*
Copyright (C) 2010-2019 EDuke32 developers and contributors
Copyright (C) 2019 sirlemonhead, Nuke.YKT
This file is part of PCExhumed.
PCExhumed is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License version 2
as published by the Free Software Foundation.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
//-------------------------------------------------------------------------
#pragma once
#include "compat.h"
#include "freelistarray.h"
2021-10-18 21:53:37 +00:00
BEGIN_PS_NS
2021-10-18 21:53:37 +00:00
// anims
void InitAnims();
2021-10-24 18:21:27 +00:00
void DestroyAnim(DExhumedActor* nAnim);
DExhumedActor* BuildAnim(DExhumedActor* actor, int val, int val2, int x, int y, int z, int nSector, int nRepeat, int nFlag);
void FuncAnim(int, int, int, int);
2021-10-24 17:18:11 +00:00
void BuildExplosion(DExhumedActor* actor);
void BuildSplash(DExhumedActor* actor, int nSector);
// anubis
void BuildAnubis(DExhumedActor* nSprite, int x, int y, int z, int nSector, int nAngle, uint8_t bIsDrummer);
void FuncAnubis(int, int a, int b, int c);
// bubbles
2021-10-18 21:53:37 +00:00
void BuildBubbleMachine(DExhumedActor* nSprite);
void DoBubbleMachines();
void DoBubbles(int nPlayer);
void FuncBubble(int, int, int, int);
// bullet
// 32 bytes
struct bulletInfo
{
short nDamage; // 0
short field_2; // 2
int field_4; // 4
short field_8; // 8
short nSeq; // 10
short field_C; // 12
short nFlags;
short nRadius; // damage radius
short xyRepeat;
};
extern bulletInfo BulletInfo[];
extern short nRadialBullet;
extern short lasthitsect;
extern int lasthitz;
extern int lasthitx;
extern int lasthity;
2021-10-21 13:02:18 +00:00
extern TArray<DExhumedActor*> EnergyBlocks;
void InitBullets();
2020-11-30 00:10:52 +00:00
int GrabBullet();
void DestroyBullet(short nRun);
int MoveBullet(short nBullet);
2021-10-16 20:04:21 +00:00
void SetBulletEnemy(short nBullet, DExhumedActor* nEnemy);
2021-10-19 22:26:26 +00:00
DExhumedActor* BuildBullet(DExhumedActor* pActor, int nType, int val1, int nAngle, DExhumedActor* pTarget, int val3);
2021-10-16 22:01:06 +00:00
void IgniteSprite(DExhumedActor* nSprite);
void FuncBullet(int, int, int, int);
void BackUpBullet(int *x, int *y, short nAngle);
// fish
2021-10-23 11:02:43 +00:00
void BuildFish(DExhumedActor* nSprite, int x, int y, int z, int nSector, int nAngle);
void FuncFish(int, int, int, int);
void FuncFishLimb(int a, int b, int c);
// grenade
enum { kMaxGrenades = 50 };
void BuildGrenade(int nPlayer);
void DestroyGrenade(short nGrenade);
2021-10-20 21:55:00 +00:00
void ThrowGrenade(short nPlayer, int edx, int ebx, int ecx, int push1);
void FuncGrenade(int, int, int, int);
// gun
enum { kMaxWeapons = 7 };
enum
{
kWeaponSword = 0,
kWeaponPistol,
kWeaponM60,
kWeaponFlamer,
kWeaponGrenade,
kWeaponStaff,
kWeaponRing,
kWeaponMummified
};
struct Weapon
{
short nSeq;
short b[12]; // seq offsets?
short nAmmoType;
short c;
short d; // default or min ammo? or ammo used per 'shot' ?
short bFireUnderwater;
// short pad[15];
};
extern Weapon WeaponInfo[];
extern short nTemperature[];
void RestoreMinAmmo(short nPlayer);
void FillWeapons(short nPlayer);
void ResetPlayerWeapons(short nPlayer);
void InitWeapons();
void SetNewWeapon(short nPlayer, short nWeapon);
void SetNewWeaponImmediate(short nPlayer, short nWeapon);
void SetNewWeaponIfBetter(short nPlayer, short nWeapon);
void SelectNewWeapon(short nPlayer);
void StopFiringWeapon(short nPlayer);
void FireWeapon(short nPlayer);
void CheckClip(short nPlayer);
void MoveWeapons(short nPlayer);
void DrawWeapons(double smooth);
// items
enum
{
kItemHeart = 0,
kItemInvincibility,
kItemTorch,
kItemDoubleDamage,
kItemInvisibility,
kItemMask,
};
extern short nItemMagic[];
2021-10-21 07:50:00 +00:00
void BuildItemAnim(DExhumedActor* nSprite);
void ItemFlash();
void FillItems(short nPlayer);
void UseItem(short nPlayer, short nItem);
void UseCurItem(short nPlayer);
int GrabItem(short nPlayer, short nItem);
void DropMagic(DExhumedActor* actor);
void InitItems();
void StartRegenerate(DExhumedActor* nSprite);
void DoRegenerates();
// lavadude
void BuildLava(DExhumedActor* nSprite, int x, int y, int z, short nSector, short nAngle, int nChannel);
DExhumedActor* BuildLavaLimb(DExhumedActor* nSprite, int edx, int ebx);
void FuncLavaLimb(int, int, int, int);
void FuncLava(int, int, int, int);
// lighting
extern short nFlashDepth;
void InitLights();
void AddFlash(short nSector, int x, int y, int z, int val);
void SetTorch(int nPlayer, int bTorchOnOff);
void UndoFlashes();
void DoLights();
2021-10-21 09:26:47 +00:00
void AddFlow(int nSprite, int nSpeed, int b, int ang = -1);
void BuildFlash(short nPlayer, short nSector, int nVal);
void AddGlow(short nSector, int nVal);
void AddFlicker(short nSector, int nVal);
extern short bTorch;
// lion
2021-10-17 20:03:08 +00:00
void BuildLion(DExhumedActor* nSprite, int x, int y, int z, short nSector, short nAngle);
void FuncLion(int, int, int, int);
// move
// 16 bytes
struct BlockInfo
{
int x;
int y;
int field_8;
short nSprite;
};
extern BlockInfo sBlockInfo[];
extern int hihit;
extern DExhumedActor* nChunkSprite[];
extern DExhumedActor* nBodySprite[];
signed int lsqrt(int a1);
void MoveThings();
void ResetMoveFifo();
void InitChunks();
void InitPushBlocks();
2021-10-20 22:00:26 +00:00
void Gravity(DExhumedActor* actor);
short UpdateEnemy(short *nEnemy);
2021-10-17 23:05:38 +00:00
DExhumedActor* UpdateEnemy(DExhumedActor** ppEnemy)
{
short ndx = (short)(*ppEnemy? (*ppEnemy)->GetSpriteIndex() : -1);
int v = UpdateEnemy(&ndx);
return v == -1 ? nullptr : &exhumedActors[v];
}
int MoveCreature(short nSprite);
Collision MoveCreature(DExhumedActor* nSprite)
{
return Collision(MoveCreature(nSprite->GetSpriteIndex()));
}
int MoveCreatureWithCaution(int nSprite);
inline Collision MoveCreatureWithCaution(DExhumedActor* actor)
{
return Collision(MoveCreatureWithCaution(actor->GetSpriteIndex()));
}
void WheresMyMouth(int nPlayer, int *x, int *y, int *z, short *sectnum);
int GetSpriteHeight(int nSprite);
2021-10-15 22:31:28 +00:00
int GetActorHeight(DExhumedActor* nSprite);
DExhumedActor* insertActor(int, int);
DExhumedActor* GrabBody();
2021-09-17 13:33:07 +00:00
DExhumedActor* GrabBodyGunSprite();
void CreatePushBlock(int nSector);
void FuncCreatureChunk(int a, int, int nRun);
2021-10-26 18:13:03 +00:00
int FindPlayer(int nSprite, int nDistance, bool dontengage = false);
inline DExhumedActor* FindPlayer(DExhumedActor* nSprite, int nDistance, bool dontengage = false)
{
2021-10-26 18:13:03 +00:00
int targ = FindPlayer(nSprite->GetSpriteIndex(), nDistance, dontengage);
return targ > -1 ? &exhumedActors[targ] : nullptr;
}
int BuildCreatureChunk(int nVal, int nPic);
2021-10-26 19:15:07 +00:00
DExhumedActor* BuildCreatureChunk(DExhumedActor* pSrc, int nPic, bool bSpecial = false)
{
int s = pSrc->GetSpriteIndex();
if (bSpecial) s |= 0x4000;
int c = BuildCreatureChunk(s, nPic);
return c < 0 ? nullptr : &exhumedActors[c];
}
void BuildNear(int x, int y, int walldist, int nSector);
int PlotCourseToSprite(int nSprite1, int nSprite2);
inline int PlotCourseToSprite(DExhumedActor* nSprite1, DExhumedActor* nSprite2)
{
if (nSprite1 == nullptr || nSprite2 == nullptr)
return -1;
return PlotCourseToSprite(nSprite1->GetSpriteIndex(), nSprite2->GetSpriteIndex());
}
void CheckSectorFloor(short nSector, int z, int *x, int *y);
int GetAngleToSprite(DExhumedActor* nSprite1, DExhumedActor* nSprite2);
int GetWallNormal(short nWall);
int GetUpAngle(short nSprite1, int nVal, short nSprite2, int ecx);
int GetUpAngle(DExhumedActor* nSprite1, int nVal, DExhumedActor* nSprite2, int ecx)
{
return GetUpAngle(nSprite1->GetSpriteIndex(), nVal, nSprite2->GetSpriteIndex(), ecx);
}
void MoveSector(short nSector, int nAngle, int *nXVel, int *nYVel);
2021-10-21 17:57:46 +00:00
Collision AngleChase(DExhumedActor* nSprite, DExhumedActor* nSprite2, int ebx, int ecx, int push1);
void SetQuake(short nSprite, int nVal);
2021-10-17 23:05:38 +00:00
void SetQuake(DExhumedActor* nSprite, int nVal)
{
SetQuake(nSprite->GetSpriteIndex(), nVal);
}
// mummy
enum { kMaxMummies = 150 };
2021-10-17 23:05:38 +00:00
void BuildMummy(DExhumedActor* val, int x, int y, int z, int nSector, int nAngle);
void FuncMummy(int nSector, int edx, int nRun);
// object
enum kStatus
{
kStatDestructibleSprite = 97,
kStatAnubisDrum,
kStatExplodeTrigger = 141,
2021-10-18 21:53:37 +00:00
kStatExplodeTarget = 152,
kStatBubbleMachine = 1022,
};
extern short nSmokeSparks;
extern short nDronePitch;
extern int lFinaleStart;
2021-10-21 11:20:00 +00:00
extern DExhumedActor* pFinaleSpr;
void InitObjects();
void InitElev();
void InitPoint();
void InitSlide();
void InitWallFace();
void DoDrips();
void DoMovingSects();
void DoFinale();
void PostProcess();
void FuncElev(int, int, int, int);
void FuncWallFace(int, int, int, int);
void FuncSlide(int, int, int, int);
void FuncObject(int, int, int, int);
void FuncTrap(int, int, int, int);
void FuncEnergyBlock(int, int, int, int);
void FuncSpark(int, int, int, int);
void SnapBobs(short nSectorA, short nSectorB);
short FindWallSprites(short nSector);
void AddMovingSector(int nSector, int edx, int ebx, int ecx);
2021-10-21 16:28:06 +00:00
void ProcessTrailSprite(DExhumedActor* nSprite, int nLotag, int nHitag);
void AddSectorBob(int nSector, int nHitag, int bx);
2021-10-21 15:24:52 +00:00
DExhumedActor* BuildObject(DExhumedActor* nSprite, int nOjectType, int nHitag);
2021-10-21 11:09:29 +00:00
int BuildArrow(DExhumedActor* nSprite, int nVal);
int BuildFireBall(DExhumedActor*, int a, int b);
2021-10-21 16:28:06 +00:00
void BuildDrip(DExhumedActor* nSprite);
2021-10-21 13:02:18 +00:00
DExhumedActor* BuildEnergyBlock(short nSector);
int BuildElevC(int arg1, int nChannel, int nSector, int nWallSprite, int arg5, int arg6, int nCount, ...);
int BuildElevF(int nChannel, int nSector, int nWallSprite, int arg_4, int arg_5, int nCount, ...);
int BuildWallFace(short nChannel, short nWall, int nCount, ...);
int BuildSlide(int nChannel, int edx, int ebx, int ecx, int arg1, int arg2, int arg3);
// queen
void InitQueens();
2021-10-26 19:10:51 +00:00
void BuildQueen(DExhumedActor* nSprite, int x, int y, int z, int nSector, int nAngle, int nVal);
void FuncQueenEgg(int, int, int, int);
void FuncQueenHead(int, int, int, int);
void FuncQueen(int, int, int, int);
// ra
struct RA
{
2021-10-19 13:06:46 +00:00
DExhumedActor* pActor;
DExhumedActor* pTarget;
short nAction;
short nFrame;
short nRun;
short field_A;
short field_C;
short nPlayer;
};
// ra
extern RA Ra[];
void FreeRa(short nPlayer);
void BuildRa(short nPlayer);
void InitRa();
void MoveRaToEnemy(short nPlayer);
void FuncRa(int, int, int, int);
// rat
void InitRats();
void SetRatVel(short nSprite);
2021-10-17 21:06:15 +00:00
void BuildRat(DExhumedActor* nSprite, int x, int y, int z, short nSector, int nAngle);
int FindFood(short nSprite);
void FuncRat(int a, int, int b, int nRun);
// rex
2021-10-17 22:28:59 +00:00
void BuildRex(DExhumedActor* nSprite, int x, int y, int z, short nSector, short nAngle, int nChannel);
void FuncRex(int, int, int, int);
// roach
2021-10-18 16:54:35 +00:00
void BuildRoach(int nType, DExhumedActor* nSprite, int x, int y, int z, short nSector, int angle);
void FuncRoach(int a, int, int nDamage, int nRun);
// runlist
enum
{
kMaxRuns = 25600,
kMaxChannels = 4096
};
struct RunStruct
{
int nAIType; // todo later: replace this with an AI pointer
int nObjIndex; // If object is a non-actor / not refactored yet.
DExhumedActor* pObjActor; // If object is an actor
short next;
short prev;
};
struct RunChannel
{
short a;
short b;
short c;
short d;
};
enum class EMessageType
{
ProcessChannel = 1,
Tick,
Process,
Use,
TouchFloor,
LeaveSector,
EnterSector,
Damage,
Draw,
RadialDamage
};
struct RunListEvent
{
EMessageType nMessage;
int nParam; // mostly the player, sometimes the channel list
int nObjIndex;
DExhumedActor* pObjActor;
tspritetype* pTSprite; // for the draw event
DExhumedActor* pOtherActor; // for the damage event, radialSpr for radial damage - owner will not be passed as it can be retrieved from this.
int nDamage, nRun;
int nRadialDamage; // Radial damage needs a bit more info.
int nDamageRadius;
DExhumedActor* pRadialActor;
};
struct ExhumedAI
{
2021-10-15 19:06:53 +00:00
//virtual ~ExhumedAI() = default;
virtual void ProcessChannel(RunListEvent* ev) {}
virtual void Tick(RunListEvent* ev) {}
virtual void Process(RunListEvent* ev) {}
virtual void Use(RunListEvent* ev) {}
virtual void TouchFloor(RunListEvent* ev) {}
virtual void LeaveSector(RunListEvent* ev) {}
virtual void EnterSector(RunListEvent* ev) {}
virtual void Damage(RunListEvent* ev) {}
virtual void Draw(RunListEvent* ev) {}
virtual void RadialDamage(RunListEvent* ev) {}
};
2021-10-15 19:06:53 +00:00
struct AIAnim : public ExhumedAI
{
void Tick(RunListEvent* ev) override;
void Draw(RunListEvent* ev) override;
};
2021-10-15 19:07:33 +00:00
struct AIAnubis : public ExhumedAI
{
void Tick(RunListEvent* ev) override;
void Draw(RunListEvent* ev) override;
void RadialDamage(RunListEvent* ev) override;
void Damage(RunListEvent* ev) override;
};
2021-10-15 19:06:53 +00:00
2021-10-15 19:07:58 +00:00
struct AIBubble : ExhumedAI
{
void Tick(RunListEvent* ev) override;
void Draw(RunListEvent* ev) override;
};
2021-10-15 19:10:16 +00:00
class AIBullet : public ExhumedAI
{
void Tick(RunListEvent* ev) override;
void Draw(RunListEvent* ev) override;
};
2021-10-15 19:17:25 +00:00
struct AIFish : public ExhumedAI
{
void Tick(RunListEvent* ev) override;
void Damage(RunListEvent* ev) override;
void Draw(RunListEvent* ev) override;
void RadialDamage(RunListEvent* ev) override;
};
class AIFishLimb : public ExhumedAI
{
void Tick(RunListEvent* ev) override;
void Draw(RunListEvent* ev) override;
};
2021-10-15 19:20:28 +00:00
struct AIGrenade : public ExhumedAI
{
void Tick(RunListEvent* ev) override;
void Draw(RunListEvent* ev) override;
void RadialDamage(RunListEvent* ev) override;
};
struct AILavaDude : public ExhumedAI
{
void Tick(RunListEvent* ev) override;
void Damage(RunListEvent* ev) override;
void Draw(RunListEvent* ev) override;
};
struct AILavaDudeLimb : public ExhumedAI
{
void Tick(RunListEvent* ev) override;
void Draw(RunListEvent* ev) override;
};
2021-10-15 19:29:24 +00:00
struct AILion : public ExhumedAI
{
void Tick(RunListEvent* ev) override;
void Damage(RunListEvent* ev) override;
void Draw(RunListEvent* ev) override;
void RadialDamage(RunListEvent* ev) override;
};
struct AICreatureChunk : public ExhumedAI
{
virtual void Tick(RunListEvent* ev) override;
};
2021-10-15 20:02:06 +00:00
struct AIMummy : public ExhumedAI
{
void Tick(RunListEvent* ev) override;
void Damage(RunListEvent* ev) override;
void Draw(RunListEvent* ev) override;
void RadialDamage(RunListEvent* ev) override;
};
struct AIElev : public ExhumedAI
{
void ProcessChannel(RunListEvent* ev) override;
void Tick(RunListEvent* ev) override;
};
struct AIWallFace : public ExhumedAI
{
void ProcessChannel(RunListEvent* ev) override;
};
struct AISlide : public ExhumedAI
{
void ProcessChannel(RunListEvent* ev) override;
void Tick(RunListEvent* ev) override;
};
struct AITrap : public ExhumedAI
{
void ProcessChannel(RunListEvent* ev) override;
void Tick(RunListEvent* ev) override;
};
struct AISpark : public ExhumedAI
{
void Tick(RunListEvent* ev) override;
};
struct AIEnergyBlock : public ExhumedAI
{
virtual void Damage(RunListEvent* ev) override;
virtual void RadialDamage(RunListEvent* ev) override;
};
struct AIObject : public ExhumedAI
{
void Tick(RunListEvent* ev) override;
void Damage(RunListEvent* ev) override;
void Draw(RunListEvent* ev) override;
void RadialDamage(RunListEvent* ev) override;
};
2021-10-15 19:06:53 +00:00
2021-10-15 20:19:07 +00:00
struct AIPlayer : public ExhumedAI
{
void Tick(RunListEvent* ev) override;
void Damage(RunListEvent* ev) override;
void Draw(RunListEvent* ev) override;
void RadialDamage(RunListEvent* ev) override;
};
2021-10-15 20:55:03 +00:00
struct AIQueenEgg : public ExhumedAI
{
void Tick(RunListEvent* ev) override;
void Damage(RunListEvent* ev) override;
void Draw(RunListEvent* ev) override;
void RadialDamage(RunListEvent* ev) override;
};
struct AIQueenHead : public ExhumedAI
{
void Tick(RunListEvent* ev) override;
void Damage(RunListEvent* ev) override;
void Draw(RunListEvent* ev) override;
void RadialDamage(RunListEvent* ev) override;
};
struct AIQueen : public ExhumedAI
{
void Tick(RunListEvent* ev) override;
void Damage(RunListEvent* ev) override;
void Draw(RunListEvent* ev) override;
void RadialDamage(RunListEvent* ev) override;
};
2021-10-15 20:55:44 +00:00
struct AIRa : public ExhumedAI
{
void Tick(RunListEvent* ev) override;
void Draw(RunListEvent* ev) override;
};
struct AIRat : public ExhumedAI
{
void Tick(RunListEvent* ev) override;
void Damage(RunListEvent* ev) override;
void Draw(RunListEvent* ev) override;
void RadialDamage(RunListEvent* ev) override;
};
2021-10-15 21:03:09 +00:00
struct AIRex : public ExhumedAI
{
void Tick(RunListEvent* ev) override;
void Damage(RunListEvent* ev) override;
void Draw(RunListEvent* ev) override;
void RadialDamage(RunListEvent* ev) override;
};
2021-10-15 21:07:38 +00:00
struct AIRoach : public ExhumedAI
{
void Tick(RunListEvent* ev) override;
void Damage(RunListEvent* ev) override;
void Draw(RunListEvent* ev) override;
void RadialDamage(RunListEvent* ev) override;
};
2021-10-15 21:13:28 +00:00
struct AIScorp : public ExhumedAI
{
2021-10-18 16:57:16 +00:00
void Effect(RunListEvent* ev, DExhumedActor* nTarget, int mode);
2021-10-15 21:13:28 +00:00
void Tick(RunListEvent* ev) override;
void Damage(RunListEvent* ev) override;
void Draw(RunListEvent* ev) override;
void RadialDamage(RunListEvent* ev) override;
};
struct AISet : public ExhumedAI
{
void Tick(RunListEvent* ev) override;
void Damage(RunListEvent* ev) override;
void Draw(RunListEvent* ev) override;
void RadialDamage(RunListEvent* ev) override;
};
struct AISoul : public ExhumedAI
{
void Tick(RunListEvent* ev) override;
};
2021-10-15 21:31:00 +00:00
struct AISnake : public ExhumedAI
{
void Tick(RunListEvent* ev) override;
void Draw(RunListEvent* ev) override;
};
2021-10-15 21:25:20 +00:00
struct AISpider : public ExhumedAI
{
void Tick(RunListEvent* ev) override;
void Damage(RunListEvent* ev) override;
void Draw(RunListEvent* ev) override;
void RadialDamage(RunListEvent* ev) override;
};
2021-10-15 21:29:25 +00:00
struct AIWasp : public ExhumedAI
{
void Tick(RunListEvent* ev) override;
void Damage(RunListEvent* ev) override;
void Draw(RunListEvent* ev) override;
void RadialDamage(RunListEvent* ev) override;
};
2021-10-15 21:40:02 +00:00
struct AISWReady : public ExhumedAI
{
void Process(RunListEvent* ev) override;
};
struct AISWPause : public ExhumedAI
{
void ProcessChannel(RunListEvent* ev) override;
void Tick(RunListEvent* ev) override;
void Process(RunListEvent* ev) override;
};
struct AISWStepOn : public ExhumedAI
{
void ProcessChannel(RunListEvent* ev) override;
void TouchFloor(RunListEvent* ev) override;
};
struct AISWNotOnPause : public ExhumedAI
{
void ProcessChannel(RunListEvent* ev) override;
void Tick(RunListEvent* ev) override;
void Process(RunListEvent* ev) override;
void TouchFloor(RunListEvent* ev) override;
};
struct AISWPressSector : public ExhumedAI
{
void ProcessChannel(RunListEvent* ev) override;
void Use(RunListEvent* ev) override;
};
struct AISWPressWall : public ExhumedAI
{
void Process(RunListEvent* ev) override;
void Use(RunListEvent* ev) override;
};
void runlist_DispatchEvent(ExhumedAI* ai, int nObject, int nMessage, int nDamage, int nRun);
typedef void(*AiFunc)(int, int, int, int nRun);
2020-11-29 23:23:57 +00:00
extern FreeListArray<RunStruct, kMaxRuns> RunData;
2021-10-15 19:06:53 +00:00
extern RunChannel sRunChannels[kMaxChannels];
extern short NewRun;
void runlist_InitRun();
int runlist_GrabRun();
int runlist_FreeRun(int nRun);
int runlist_AddRunRec(int index, int object, int aitype);
int runlist_AddRunRec(int index, DExhumedActor* object, int aitype);
int runlist_AddRunRec(int index, RunStruct* other);
int runlist_HeadRun();
void runlist_InitChan();
void runlist_ChangeChannel(int eax, short dx);
void runlist_ReadyChannel(short eax);
void runlist_ProcessSectorTag(int nSector, int nLotag, int nHitag);
int runlist_AllocChannel(int a);
void runlist_DoSubRunRec(int RunPtr);
void runlist_SubRunRec(int RunPtr);
void runlist_ProcessWallTag(int nWall, short nLotag, short nHitag);
int runlist_CheckRadialDamage(short nSprite);
inline int runlist_CheckRadialDamage(DExhumedActor* actor)
{
return runlist_CheckRadialDamage(actor->GetSpriteIndex());
}
void runlist_RadialDamageEnemy(short nSprite, short nDamage, short nRadius);
inline void runlist_RadialDamageEnemy(DExhumedActor* nSprite, short nSprite2, short nDamage)
{
return runlist_RadialDamageEnemy(nSprite->GetSpriteIndex(), nSprite2, nDamage);
}
void runlist_DamageEnemy(int nSprite, int nSprite2, short nDamage);
inline void runlist_DamageEnemy(DExhumedActor* nSprite, DExhumedActor* nSprite2, short nDamage)
{
return runlist_DamageEnemy(nSprite? nSprite->GetSpriteIndex() : -1, nSprite2? nSprite2->GetSpriteIndex() : -1, nDamage);
}
void runlist_SignalRun(int NxtPtr, int edx);
void runlist_CleanRunRecs();
void runlist_ExecObjects();
// scorp
2021-10-18 16:57:16 +00:00
void BuildScorp(DExhumedActor* nSprite, int x, int y, int z, short nSector, short nAngle, int nChannel);
void FuncScorp(int, int, int, int);
// set
2021-10-19 17:53:42 +00:00
void BuildSet(DExhumedActor* nSprite, int x, int y, int z, short nSector, short nAngle, int nChannel);
void FuncSoul(int, int, int, int);
void FuncSet(int, int, int, int);
// snake
enum { kSnakeSprites = 8 }; // or rename to kSnakeParts?
// 32bytes
struct Snake
{
2021-10-19 09:19:50 +00:00
DExhumedActor* pEnemy; // nRun
DExhumedActor* pSprites[kSnakeSprites];
2021-10-19 09:19:50 +00:00
short nCountdown;
short sC;
short nRun;
char c[8];
short sE;
short nSnakePlayer;
};
enum { kMaxSnakes = 50 };
extern FreeListArray<Snake, kMaxSnakes> SnakeList;
void InitSnakes();
short GrabSnake();
void BuildSnake(short nPlayer, short zVal);
void FuncSnake(int, int, int, int);
// spider
2021-10-18 16:57:16 +00:00
DExhumedActor* BuildSpider(DExhumedActor* nSprite, int x, int y, int z, short nSector, int nAngle);
void FuncSpider(int a, int, int b, int nRun);
// switch
void InitLink();
void InitSwitch();
void FuncSwReady(int, int, int, int);
void FuncSwPause(int, int, int, int);
void FuncSwStepOn(int, int, int, int);
void FuncSwNotOnPause(int, int, int, int);
void FuncSwPressSector(int, int, int, int);
void FuncSwPressWall(int, int, int, int);
std::pair<int, int> BuildSwPause(int nChannel, int nLink, int ebx);
std::pair<int, int> BuildSwNotOnPause(int nChannel, int nLink, int nSector, int ecx);
int BuildLink(int nCount, ...);
std::pair<int, int> BuildSwPressSector(int nChannel, int nLink, int nSector, int ecx);
std::pair<int, int> BuildSwStepOn(int nChannel, int nLink, int nSector);
std::pair<int, int> BuildSwReady(int nChannel, short nLink);
std::pair<int, int> BuildSwPressWall(short nChannel, short nLink, short nWall);
// wasp
2021-10-24 11:20:50 +00:00
DExhumedActor* BuildWasp(DExhumedActor* nSprite, int x, int y, int z, short nSector, short nAngle, bool bEggWasp);
void FuncWasp(int eax, int, int edx, int nRun);
enum { kMessageMask = 0x7F0000 };
inline int GrabTimeSlot(int nVal) { return -1; }
inline int dmgAdjust(int dmg, int fact = 2) { return dmg; }
inline bool easy() { return false; }
END_PS_NS