2019-09-19 22:42:45 +00:00
|
|
|
//-------------------------------------------------------------------------
|
|
|
|
/*
|
|
|
|
Copyright (C) 2010-2019 EDuke32 developers and contributors
|
|
|
|
Copyright (C) 2019 Nuke.YKT
|
|
|
|
|
|
|
|
This file is part of NBlood.
|
|
|
|
|
|
|
|
NBlood 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
|
|
|
|
|
2019-09-22 06:39:22 +00:00
|
|
|
BEGIN_BLD_NS
|
|
|
|
|
2020-11-06 21:48:22 +00:00
|
|
|
class DBloodActor;
|
|
|
|
|
2019-09-19 22:42:45 +00:00
|
|
|
enum DAMAGE_TYPE {
|
2021-06-16 19:13:04 +00:00
|
|
|
kDamageFall = 0,
|
|
|
|
kDamageBurn,
|
|
|
|
kDamageBullet,
|
|
|
|
kDamageExplode,
|
|
|
|
kDamageDrown,
|
|
|
|
kDamageSpirit,
|
|
|
|
kDamageTesla,
|
2019-10-21 19:46:41 +00:00
|
|
|
kDamageMax = 7,
|
2019-09-19 22:42:45 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
enum VECTOR_TYPE {
|
2021-06-16 19:13:04 +00:00
|
|
|
kVectorTine = 0,
|
|
|
|
kVectorShell,
|
|
|
|
kVectorBullet,
|
|
|
|
kVectorTommyAP,
|
|
|
|
kVectorShellAP,
|
|
|
|
kVectorTommyRegular,
|
|
|
|
kVectorBatBite,
|
|
|
|
kVectorBoneelBite,
|
|
|
|
kVectorGillBite,
|
|
|
|
kVectorBeastSlash,
|
|
|
|
kVectorAxe,
|
|
|
|
kVectorCleaver,
|
|
|
|
kVectorGhost,
|
|
|
|
kVectorGargSlash,
|
|
|
|
kVectorCerberusHack,
|
|
|
|
kVectorHoundBite,
|
|
|
|
kVectorRatBite,
|
|
|
|
kVectorSpiderBite,
|
2019-09-19 22:42:45 +00:00
|
|
|
VECTOR_TYPE_18,
|
|
|
|
VECTOR_TYPE_19,
|
2021-06-16 19:13:04 +00:00
|
|
|
kVectorTchernobogBurn,
|
|
|
|
kVectorVoodoo10,
|
2020-01-26 11:19:01 +00:00
|
|
|
#ifdef NOONE_EXTENSIONS
|
|
|
|
kVectorGenDudePunch,
|
|
|
|
#endif
|
2019-09-19 22:42:45 +00:00
|
|
|
kVectorMax,
|
|
|
|
};
|
|
|
|
|
|
|
|
struct THINGINFO
|
|
|
|
{
|
2019-10-21 19:46:41 +00:00
|
|
|
short startHealth;
|
|
|
|
short mass;
|
2021-04-17 08:14:03 +00:00
|
|
|
uint8_t clipdist;
|
2019-10-21 19:46:41 +00:00
|
|
|
short flags;
|
|
|
|
int elastic; // elasticity
|
|
|
|
int dmgResist; // damage resistance
|
|
|
|
short cstat;
|
|
|
|
short picnum;
|
2021-04-17 08:22:00 +00:00
|
|
|
int8_t shade;
|
2021-04-17 08:14:03 +00:00
|
|
|
uint8_t pal;
|
|
|
|
uint8_t xrepeat; // xrepeat
|
|
|
|
uint8_t yrepeat; // yrepeat
|
2019-10-21 19:46:41 +00:00
|
|
|
int dmgControl[kDamageMax]; // damage
|
2019-09-19 22:42:45 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct AMMOITEMDATA
|
|
|
|
{
|
2019-10-21 19:46:41 +00:00
|
|
|
short cstat;
|
|
|
|
short picnum;
|
2021-04-17 08:22:00 +00:00
|
|
|
int8_t shade;
|
|
|
|
uint8_t pal;
|
2021-04-17 08:14:03 +00:00
|
|
|
uint8_t xrepeat;
|
|
|
|
uint8_t yrepeat;
|
2019-10-21 19:46:41 +00:00
|
|
|
short count;
|
2021-04-17 08:14:03 +00:00
|
|
|
uint8_t type;
|
|
|
|
uint8_t weaponType;
|
2019-09-19 22:42:45 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct WEAPONITEMDATA
|
|
|
|
{
|
2019-10-21 19:46:41 +00:00
|
|
|
short cstat;
|
|
|
|
short picnum;
|
2021-04-17 08:22:00 +00:00
|
|
|
int8_t shade;
|
|
|
|
uint8_t pal;
|
2021-04-17 08:14:03 +00:00
|
|
|
uint8_t xrepeat;
|
|
|
|
uint8_t yrepeat;
|
2019-10-21 19:46:41 +00:00
|
|
|
short type;
|
|
|
|
short ammoType;
|
|
|
|
short count;
|
2019-09-19 22:42:45 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct ITEMDATA
|
|
|
|
{
|
2019-10-21 19:46:41 +00:00
|
|
|
short cstat;
|
|
|
|
short picnum;
|
2021-04-17 08:22:00 +00:00
|
|
|
int8_t shade;
|
|
|
|
uint8_t pal;
|
2021-04-17 08:14:03 +00:00
|
|
|
uint8_t xrepeat;
|
|
|
|
uint8_t yrepeat;
|
2019-10-21 19:46:41 +00:00
|
|
|
short packSlot;
|
2019-09-19 22:42:45 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct MissileType
|
|
|
|
{
|
|
|
|
short picnum;
|
2019-10-21 19:46:41 +00:00
|
|
|
int velocity;
|
|
|
|
int angleOfs;
|
2021-04-17 08:14:03 +00:00
|
|
|
uint8_t xrepeat;
|
|
|
|
uint8_t yrepeat;
|
2021-04-17 08:22:00 +00:00
|
|
|
int8_t shade;
|
2021-04-17 08:14:03 +00:00
|
|
|
uint8_t clipDist;
|
2019-09-19 22:42:45 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct EXPLOSION
|
|
|
|
{
|
2021-04-17 08:14:03 +00:00
|
|
|
uint8_t repeat;
|
2019-10-21 19:46:41 +00:00
|
|
|
char dmg;
|
|
|
|
char dmgRng;
|
2020-01-26 11:19:01 +00:00
|
|
|
int radius;
|
2019-09-21 11:02:17 +00:00
|
|
|
int dmgType;
|
2019-10-21 19:46:41 +00:00
|
|
|
int burnTime;
|
|
|
|
int ticks;
|
|
|
|
int quakeEffect;
|
|
|
|
int flashEffect;
|
2019-09-19 22:42:45 +00:00
|
|
|
};
|
|
|
|
|
2019-10-21 19:46:41 +00:00
|
|
|
struct SURFHIT {
|
|
|
|
FX_ID fx1;
|
|
|
|
FX_ID fx2;
|
|
|
|
FX_ID fx3;
|
|
|
|
int fxSnd;
|
2019-09-19 22:42:45 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct VECTORDATA {
|
2019-10-21 19:46:41 +00:00
|
|
|
DAMAGE_TYPE dmgType;
|
|
|
|
int dmg; // damage
|
|
|
|
int impulse;
|
|
|
|
int maxDist;
|
|
|
|
int fxChance;
|
|
|
|
int burnTime; // burn
|
|
|
|
int bloodSplats; // blood splats
|
|
|
|
int splatChance; // blood splat chance
|
|
|
|
SURFHIT surfHit[15];
|
2019-09-19 22:42:45 +00:00
|
|
|
};
|
|
|
|
|
2020-02-11 22:15:25 +00:00
|
|
|
extern const AMMOITEMDATA gAmmoItemData[];
|
|
|
|
extern const WEAPONITEMDATA gWeaponItemData[];
|
|
|
|
extern const ITEMDATA gItemData[];
|
|
|
|
extern const MissileType missileInfo[];
|
|
|
|
extern const EXPLOSION explodeInfo[];
|
2019-12-06 23:07:02 +00:00
|
|
|
extern const THINGINFO thingInfo[];
|
2019-09-19 22:42:45 +00:00
|
|
|
extern VECTORDATA gVectorData[];
|
|
|
|
|
2020-02-11 22:15:25 +00:00
|
|
|
const int gDudeDrag = 0x2a00;
|
2019-09-19 22:42:45 +00:00
|
|
|
|
2020-02-06 08:48:45 +00:00
|
|
|
template<typename T> bool IsPlayerSprite(T const * const pSprite)
|
2019-09-19 22:42:45 +00:00
|
|
|
{
|
2020-02-06 08:48:45 +00:00
|
|
|
return pSprite->type >= kDudePlayer1 && pSprite->type <= kDudePlayer8;
|
2019-09-19 22:42:45 +00:00
|
|
|
}
|
|
|
|
|
2020-01-03 04:51:06 +00:00
|
|
|
template<typename T> bool IsDudeSprite(T const * const pSprite)
|
2019-09-19 22:42:45 +00:00
|
|
|
{
|
2020-02-06 08:48:45 +00:00
|
|
|
return pSprite->type >= kDudeBase && pSprite->type < kDudeMax;
|
|
|
|
}
|
|
|
|
|
|
|
|
template<typename T> bool IsItemSprite(T const * const pSprite)
|
|
|
|
{
|
|
|
|
return pSprite->type >= kItemBase && pSprite->type < kItemMax;
|
|
|
|
}
|
|
|
|
|
|
|
|
template<typename T> bool IsWeaponSprite(T const * const pSprite)
|
|
|
|
{
|
|
|
|
return pSprite->type >= kItemWeaponBase && pSprite->type < kItemWeaponMax;
|
|
|
|
}
|
|
|
|
|
|
|
|
template<typename T> bool IsAmmoSprite(T const * const pSprite)
|
|
|
|
{
|
|
|
|
return pSprite->type >= kItemAmmoBase && pSprite->type < kItemAmmoMax;
|
2019-09-19 22:42:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
inline void actBurnSprite(int nSource, XSPRITE *pXSprite, int nTime)
|
|
|
|
{
|
2019-10-07 19:29:52 +00:00
|
|
|
pXSprite->burnTime = ClipHigh(pXSprite->burnTime + nTime, sprite[pXSprite->reference].statnum == kStatDude ? 2400 : 1200);
|
2019-09-19 22:42:45 +00:00
|
|
|
pXSprite->burnSource = nSource;
|
|
|
|
}
|
|
|
|
|
2020-01-02 13:37:15 +00:00
|
|
|
#ifdef POLYMER
|
|
|
|
void actAddGameLight(int lightRadius, int spriteNum, int zOffset, int lightRange, int lightColor, int lightPrio);
|
|
|
|
void actDoLight(int spriteNum);
|
|
|
|
#endif
|
|
|
|
|
2021-07-19 21:15:26 +00:00
|
|
|
void FireballSeqCallback(int, int);
|
|
|
|
void sub_38938(int, int);
|
|
|
|
void NapalmSeqCallback(int, int);
|
|
|
|
void sub_3888C(int, int);
|
|
|
|
void TreeToGibCallback(int, int);
|
|
|
|
|
2019-09-19 22:42:45 +00:00
|
|
|
bool IsUnderwaterSector(int nSector);
|
2019-09-21 11:02:17 +00:00
|
|
|
void actInit(bool bSaveLoad);
|
2019-09-19 22:42:45 +00:00
|
|
|
int actWallBounceVector(int *x, int *y, int nWall, int a4);
|
|
|
|
int actFloorBounceVector(int *x, int *y, int *z, int nSector, int a5);
|
2020-12-02 20:39:37 +00:00
|
|
|
void actRadiusDamage(DBloodActor* source, int x, int y, int z, int nSector, int nDist, int a7, int a8, DAMAGE_TYPE a9, int a10, int a11);
|
2019-09-19 22:42:45 +00:00
|
|
|
spritetype *actDropObject(spritetype *pSprite, int nType);
|
2020-12-02 23:00:03 +00:00
|
|
|
bool actHealDude(DBloodActor* pXDude, int a2, int a3);
|
2019-09-19 22:42:45 +00:00
|
|
|
bool actHealDude(XSPRITE *pXDude, int a2, int a3);
|
2020-12-02 23:20:14 +00:00
|
|
|
void actKillDude(DBloodActor* a1, DBloodActor* pSprite, DAMAGE_TYPE a3, int a4);
|
2019-09-19 22:42:45 +00:00
|
|
|
void actKillDude(int a1, spritetype *pSprite, DAMAGE_TYPE a3, int a4);
|
|
|
|
int actDamageSprite(int nSource, spritetype *pSprite, DAMAGE_TYPE a3, int a4);
|
2020-12-02 19:55:08 +00:00
|
|
|
int actDamageSprite(DBloodActor* pSource, DBloodActor* pTarget, DAMAGE_TYPE damageType, int damage);
|
2020-12-03 17:00:07 +00:00
|
|
|
void actHitcodeToData(int a1, HITINFO *pHitInfo, DBloodActor **actor, walltype **a7 = nullptr);
|
2019-09-19 22:42:45 +00:00
|
|
|
void actAirDrag(spritetype *pSprite, int a2);
|
|
|
|
int MoveThing(spritetype *pSprite);
|
|
|
|
void MoveDude(spritetype *pSprite);
|
|
|
|
int MoveMissile(spritetype *pSprite);
|
|
|
|
void actExplodeSprite(spritetype *pSprite);
|
2020-11-06 21:48:22 +00:00
|
|
|
void actActivateGibObject(DBloodActor *actor);
|
2019-09-19 22:42:45 +00:00
|
|
|
bool IsUnderWater(spritetype *pSprite);
|
|
|
|
void actProcessSprites(void);
|
2020-12-02 22:39:38 +00:00
|
|
|
spritetype * actSpawnSprite_(int nSector, int x, int y, int z, int nStat, char a6);
|
|
|
|
DBloodActor* actSpawnSprite(int nSector, int x, int y, int z, int nStat, bool a6);
|
2019-09-19 22:42:45 +00:00
|
|
|
spritetype *actSpawnDude(spritetype *pSource, short nType, int a3, int a4);
|
|
|
|
spritetype * actSpawnSprite(spritetype *pSource, int nStat);
|
|
|
|
spritetype * actSpawnThing(int nSector, int x, int y, int z, int nThingType);
|
2020-12-02 21:33:14 +00:00
|
|
|
spritetype * actFireThing_(spritetype *pSprite, int a2, int a3, int a4, int thingType, int a6);
|
|
|
|
DBloodActor* actFireThing(DBloodActor* pSprite, int a2, int a3, int a4, int thingType, int a6);
|
|
|
|
|
2019-09-19 22:42:45 +00:00
|
|
|
spritetype* actFireMissile(spritetype *pSprite, int a2, int a3, int a4, int a5, int a6, int nType);
|
|
|
|
int actGetRespawnTime(spritetype *pSprite);
|
|
|
|
bool actCheckRespawn(spritetype *pSprite);
|
|
|
|
bool actCanSplatWall(int nWall);
|
|
|
|
void actFireVector(spritetype *pShooter, int a2, int a3, int a4, int a5, int a6, VECTOR_TYPE vectorType);
|
|
|
|
void actPostSprite(int nSprite, int nStatus);
|
2020-12-02 21:33:14 +00:00
|
|
|
void actPostSprite(DBloodActor* actor, int status);
|
2019-09-19 22:42:45 +00:00
|
|
|
void actPostProcess(void);
|
2020-11-06 21:48:22 +00:00
|
|
|
void MakeSplash(DBloodActor *actor);
|
2020-01-26 11:19:01 +00:00
|
|
|
void actBuildMissile(spritetype* pMissile, int nXSprite, int nSprite);
|
|
|
|
|
2020-02-11 22:15:25 +00:00
|
|
|
extern const int DudeDifficulty[];
|
2019-10-26 11:16:32 +00:00
|
|
|
|
|
|
|
END_BLD_NS
|