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
|
|
|
|
|
2019-09-19 22:42:45 +00:00
|
|
|
enum DAMAGE_TYPE {
|
2021-12-29 18:41:41 +00:00
|
|
|
kDamageFall = 0,
|
|
|
|
kDamageBurn,
|
|
|
|
kDamageBullet,
|
|
|
|
kDamageExplode,
|
|
|
|
kDamageDrown,
|
|
|
|
kDamageSpirit,
|
|
|
|
kDamageTesla,
|
|
|
|
kDamageMax = 7,
|
2019-09-19 22:42:45 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
enum VECTOR_TYPE {
|
2021-12-29 18:41:41 +00:00
|
|
|
kVectorTine = 0,
|
|
|
|
kVectorShell,
|
|
|
|
kVectorBullet,
|
|
|
|
kVectorTommyAP,
|
|
|
|
kVectorShellAP,
|
|
|
|
kVectorTommyRegular,
|
|
|
|
kVectorBatBite,
|
|
|
|
kVectorBoneelBite,
|
|
|
|
kVectorGillBite,
|
|
|
|
kVectorBeastSlash,
|
|
|
|
kVectorAxe,
|
|
|
|
kVectorCleaver,
|
|
|
|
kVectorGhost,
|
|
|
|
kVectorGargSlash,
|
|
|
|
kVectorCerberusHack,
|
|
|
|
kVectorHoundBite,
|
|
|
|
kVectorRatBite,
|
|
|
|
kVectorSpiderBite,
|
|
|
|
VECTOR_TYPE_18,
|
|
|
|
VECTOR_TYPE_19,
|
|
|
|
kVectorTchernobogBurn,
|
|
|
|
kVectorVoodoo10,
|
|
|
|
#ifdef NOONE_EXTENSIONS
|
|
|
|
kVectorGenDudePunch,
|
|
|
|
#endif
|
|
|
|
kVectorMax,
|
2019-09-19 22:42:45 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct THINGINFO
|
|
|
|
{
|
2021-12-29 18:41:41 +00:00
|
|
|
int16_t startHealth;
|
|
|
|
int16_t mass;
|
|
|
|
uint8_t clipdist;
|
|
|
|
int16_t flags;
|
|
|
|
int32_t elastic; // elasticity
|
|
|
|
int32_t dmgResist; // damage resistance
|
|
|
|
ESpriteFlags cstat;
|
|
|
|
int16_t picnum;
|
|
|
|
int8_t shade;
|
|
|
|
uint8_t pal;
|
|
|
|
uint8_t xrepeat; // xrepeat
|
|
|
|
uint8_t yrepeat; // yrepeat
|
|
|
|
int dmgControl[kDamageMax]; // damage
|
2019-09-19 22:42:45 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct AMMOITEMDATA
|
|
|
|
{
|
2021-12-29 18:41:41 +00:00
|
|
|
int16_t cstat;
|
|
|
|
int16_t picnum;
|
|
|
|
int8_t shade;
|
|
|
|
uint8_t pal;
|
|
|
|
uint8_t xrepeat;
|
|
|
|
uint8_t yrepeat;
|
|
|
|
int16_t count;
|
|
|
|
uint8_t type;
|
|
|
|
uint8_t weaponType;
|
2019-09-19 22:42:45 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct WEAPONITEMDATA
|
|
|
|
{
|
2021-12-29 18:41:41 +00:00
|
|
|
int16_t cstat;
|
|
|
|
int16_t picnum;
|
|
|
|
int8_t shade;
|
|
|
|
uint8_t pal;
|
|
|
|
uint8_t xrepeat;
|
|
|
|
uint8_t yrepeat;
|
|
|
|
int16_t type;
|
|
|
|
int16_t ammoType;
|
|
|
|
int16_t count;
|
2019-09-19 22:42:45 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct ITEMDATA
|
|
|
|
{
|
2021-12-29 18:41:41 +00:00
|
|
|
int16_t cstat;
|
|
|
|
int16_t picnum;
|
|
|
|
int8_t shade;
|
|
|
|
uint8_t pal;
|
|
|
|
uint8_t xrepeat;
|
|
|
|
uint8_t yrepeat;
|
|
|
|
int16_t packSlot;
|
2019-09-19 22:42:45 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct MissileType
|
|
|
|
{
|
2021-12-29 18:41:41 +00:00
|
|
|
int16_t picnum;
|
|
|
|
int velocity;
|
|
|
|
int angleOfs;
|
|
|
|
uint8_t xrepeat;
|
|
|
|
uint8_t yrepeat;
|
|
|
|
int8_t shade;
|
|
|
|
uint8_t clipDist;
|
2022-09-26 19:20:20 +00:00
|
|
|
|
|
|
|
double fClipDist() const
|
|
|
|
{
|
|
|
|
return clipDist * 0.25;
|
|
|
|
}
|
|
|
|
double fVelocity() const
|
|
|
|
{
|
|
|
|
return FixedToFloat(velocity);
|
|
|
|
}
|
2019-09-19 22:42:45 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct EXPLOSION
|
|
|
|
{
|
2021-12-29 18:41:41 +00:00
|
|
|
uint8_t repeat;
|
|
|
|
uint8_t dmg;
|
|
|
|
uint8_t dmgRng;
|
|
|
|
int radius;
|
|
|
|
int dmgType;
|
|
|
|
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 {
|
2021-12-29 18:41:41 +00:00
|
|
|
FX_ID fx1;
|
|
|
|
FX_ID fx2;
|
|
|
|
FX_ID fx3;
|
|
|
|
int fxSnd;
|
2019-09-19 22:42:45 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct VECTORDATA {
|
2021-12-29 18:41: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[];
|
|
|
|
|
2022-10-10 17:32:01 +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
|
|
|
{
|
2021-12-29 18:41:41 +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
|
|
|
{
|
2021-12-29 18:41:41 +00:00
|
|
|
return pSprite->type >= kDudeBase && pSprite->type < kDudeMax;
|
2020-02-06 08:48:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
template<typename T> bool IsItemSprite(T const * const pSprite)
|
|
|
|
{
|
2021-12-29 18:41:41 +00:00
|
|
|
return pSprite->type >= kItemBase && pSprite->type < kItemMax;
|
2020-02-06 08:48:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
template<typename T> bool IsWeaponSprite(T const * const pSprite)
|
|
|
|
{
|
2021-12-29 18:41:41 +00:00
|
|
|
return pSprite->type >= kItemWeaponBase && pSprite->type < kItemWeaponMax;
|
2020-02-06 08:48:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
template<typename T> bool IsAmmoSprite(T const * const pSprite)
|
|
|
|
{
|
2021-12-29 18:41:41 +00:00
|
|
|
return pSprite->type >= kItemAmmoBase && pSprite->type < kItemAmmoMax;
|
2019-09-19 22:42:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
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);
|
|
|
|
|
2021-11-19 17:08:05 +00:00
|
|
|
bool IsUnderwaterSector(sectortype* pSector);
|
2021-12-03 20:36:32 +00:00
|
|
|
void actInit(TArray<DBloodActor*>& actors);
|
2022-09-03 07:37:52 +00:00
|
|
|
void actWallBounceVector(DBloodActor* actor, walltype* pWall, double factor);
|
2022-09-02 21:56:03 +00:00
|
|
|
DVector4 actFloorBounceVector(DBloodActor* actor, double oldz, sectortype* pSector, double factor);
|
2022-08-22 16:18:54 +00:00
|
|
|
void actRadiusDamage(DBloodActor* source, const DVector3& pos, sectortype* pSector, int nDist, int a7, int a8, DAMAGE_TYPE a9, int a10, int a11);
|
2020-12-05 22:49:51 +00:00
|
|
|
DBloodActor *actDropObject(DBloodActor *pSprite, int nType);
|
2020-12-02 23:00:03 +00:00
|
|
|
bool actHealDude(DBloodActor* pXDude, int a2, int a3);
|
2020-12-02 23:20:14 +00:00
|
|
|
void actKillDude(DBloodActor* a1, DBloodActor* 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);
|
2021-11-25 22:28:28 +00:00
|
|
|
void actHitcodeToData(int a1, HitInfo *pHitInfo, DBloodActor **actor, walltype **a7 = nullptr);
|
2022-09-19 09:04:09 +00:00
|
|
|
void actAirDrag(DBloodActor *pSprite, fixed_t drag);
|
2020-12-05 11:17:28 +00:00
|
|
|
void actExplodeSprite(DBloodActor *pSprite);
|
2020-11-06 21:48:22 +00:00
|
|
|
void actActivateGibObject(DBloodActor *actor);
|
2019-09-19 22:42:45 +00:00
|
|
|
void actProcessSprites(void);
|
2022-08-22 16:24:09 +00:00
|
|
|
DBloodActor* actSpawnSprite(sectortype* pSector, const DVector3& pos, int nStat, bool a6);
|
2022-09-25 20:33:40 +00:00
|
|
|
DBloodActor* actSpawnDude(DBloodActor* pSource, int nType, double dist);
|
2020-12-05 17:32:49 +00:00
|
|
|
DBloodActor * actSpawnSprite(DBloodActor *pSource, int nStat);
|
2022-09-26 20:32:54 +00:00
|
|
|
DBloodActor* actSpawnThing(sectortype* pSector, const DVector3& pos, int nThingType);
|
|
|
|
|
2022-09-26 18:35:50 +00:00
|
|
|
inline DBloodActor* actFireThing(DBloodActor* actor, double xyoff, double zoff, double zvel, int thingType, double nSpeed);
|
|
|
|
inline DBloodActor* actFireThing(DBloodActor* actor, int xyoff_, int zoff_, int zvel_, int thingType, int nSpeed_)
|
|
|
|
{
|
|
|
|
double xyoff = xyoff_ * inttoworld;
|
|
|
|
double zoff = zoff_ * zinttoworld;
|
|
|
|
double zvel = FixedToFloat(zvel_);
|
|
|
|
double nSpeed = FixedToFloat(nSpeed_);
|
|
|
|
return actFireThing(actor, xyoff, zoff, zvel, thingType, nSpeed);
|
|
|
|
}
|
|
|
|
|
2022-09-29 06:42:11 +00:00
|
|
|
DBloodActor* actFireMissile(DBloodActor* actor, double xyoff, double zoff, DVector3 dc, int nType);
|
2022-09-26 19:20:20 +00:00
|
|
|
|
|
|
|
inline DBloodActor* actFireMissile(DBloodActor* actor, int xyoff_, int zoff_, int dx, int dy, int dz, int nType)
|
|
|
|
{
|
|
|
|
double xyoff = xyoff_ * inttoworld;
|
|
|
|
double zoff = zoff_ * zinttoworld;
|
|
|
|
DVector3 dv(FixedToFloat<14>(dx), FixedToFloat<14>(dy), FixedToFloat<14>(dz));
|
|
|
|
return actFireMissile(actor, xyoff, zoff, dv, nType);
|
|
|
|
}
|
2020-12-02 21:33:14 +00:00
|
|
|
|
2021-08-29 17:22:51 +00:00
|
|
|
void actBurnSprite(DBloodActor* pSource, DBloodActor* pTarget, int nTime);
|
|
|
|
|
2021-08-30 18:21:49 +00:00
|
|
|
int actGetRespawnTime(DBloodActor *pSprite);
|
|
|
|
bool actCheckRespawn(DBloodActor *pSprite);
|
2022-09-25 18:40:53 +00:00
|
|
|
|
|
|
|
void actFireVector(DBloodActor* shooter, double offset, double zoffset, DVector3 dv, VECTOR_TYPE vectorType);
|
|
|
|
inline void actFireVector(DBloodActor* pShooter, int a2, int a3, int a4, int a5, int a6, VECTOR_TYPE vectorType)
|
|
|
|
{
|
|
|
|
// Yay, yet another fixed point format... :(
|
|
|
|
actFireVector(pShooter, a2 * inttoworld, a3 * zinttoworld, DVector3(FixedToFloat<14>(a4), FixedToFloat<14>(a5), FixedToFloat<14>(a6)), vectorType);
|
|
|
|
}
|
2022-09-11 13:19:19 +00:00
|
|
|
inline void actFireVectorf(DBloodActor *pShooter, int a2, double a3, int a4, int a5, int a6, VECTOR_TYPE vectorType)
|
|
|
|
{
|
|
|
|
actFireVector(pShooter, a2, a3 * zworldtoint, a4, a5, a6, vectorType);
|
|
|
|
}
|
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-12-05 20:23:53 +00:00
|
|
|
void actBuildMissile(DBloodActor* spawned, DBloodActor* actor);
|
2020-01-26 11:19:01 +00:00
|
|
|
|
2021-11-19 19:50:02 +00:00
|
|
|
extern const int16_t DudeDifficulty[];
|
2019-10-26 11:16:32 +00:00
|
|
|
|
2022-09-03 09:54:01 +00:00
|
|
|
|
2019-10-26 11:16:32 +00:00
|
|
|
END_BLD_NS
|