mirror of
https://github.com/ZDoom/Raze.git
synced 2025-04-22 07:50:54 +00:00
continued witg nnextcdud.cpp
This commit is contained in:
parent
0e6b536d01
commit
00112c472d
9 changed files with 399 additions and 521 deletions
|
@ -2315,7 +2315,7 @@ bool IsBurningDude(DBloodActor* actor)
|
|||
return true;
|
||||
#ifdef NOONE_EXTENSIONS
|
||||
case kDudeModernCustom:
|
||||
CUSTOMDUDE* pDude = cdudeGet(actor);
|
||||
DCustomDude* pDude = cdudeGet(actor);
|
||||
return (pDude->StatusTest(kCdudeStatusBurning));
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -25,6 +25,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|||
|
||||
|
||||
#include "savegamehelp.h"
|
||||
#include "nnextcdud.h"
|
||||
|
||||
#include "blood.h"
|
||||
|
||||
|
@ -1442,11 +1443,13 @@ void aiProcessDudes(void)
|
|||
while (auto actor = it.Next())
|
||||
{
|
||||
if (actor->spr.flags & kHitagFree || actor->IsPlayerActor()) continue;
|
||||
#ifdef NOONE_EXTENSIONS
|
||||
if (IsCustomDude(actor))
|
||||
{
|
||||
cdudeGet(actor)->Process();
|
||||
continue;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (actor->xspr.health == 0) continue;
|
||||
|
||||
|
|
|
@ -57,15 +57,15 @@ DAngle getTargetAng(DBloodActor* pSpr);
|
|||
|
||||
|
||||
// This set of functions needs to be exported for scripting later to allow extension of this list.
|
||||
static DBloodActor* weaponShotDummy(CUSTOMDUDE*, CUSTOMDUDE_WEAPON*, DVector3& offs, DVector3& vel) { return nullptr; }
|
||||
static DBloodActor* weaponShotHitscan(CUSTOMDUDE* pDude, CUSTOMDUDE_WEAPON* pWeap, DVector3& offs, DVector3& vel);
|
||||
static DBloodActor* weaponShotMissile(CUSTOMDUDE* pDude, CUSTOMDUDE_WEAPON* pWeap, DVector3& offs, DVector3& vel);
|
||||
static DBloodActor* weaponShotThing(CUSTOMDUDE* pDude, CUSTOMDUDE_WEAPON* pWeap, DVector3& offs, DVector3& vel);
|
||||
static DBloodActor* weaponShotSummon(CUSTOMDUDE* pDude, CUSTOMDUDE_WEAPON* pWeap, DVector3& offs, DVector3& vel);
|
||||
static DBloodActor* weaponShotKamikaze(CUSTOMDUDE* pDude, CUSTOMDUDE_WEAPON* pWeap, DVector3& offs, DVector3& vel);
|
||||
static DBloodActor* weaponShotSpecialBeastStomp(CUSTOMDUDE* pDude, CUSTOMDUDE_WEAPON*, DVector3& offs, DVector3& vel);
|
||||
static DBloodActor* weaponShotDummy(DCustomDude*, CUSTOMDUDE_WEAPON*, DVector3& offs, DVector3& vel) { return nullptr; }
|
||||
static DBloodActor* weaponShotHitscan(DCustomDude* pDude, CUSTOMDUDE_WEAPON* pWeap, DVector3& offs, DVector3& vel);
|
||||
static DBloodActor* weaponShotMissile(DCustomDude* pDude, CUSTOMDUDE_WEAPON* pWeap, DVector3& offs, DVector3& vel);
|
||||
static DBloodActor* weaponShotThing(DCustomDude* pDude, CUSTOMDUDE_WEAPON* pWeap, DVector3& offs, DVector3& vel);
|
||||
static DBloodActor* weaponShotSummon(DCustomDude* pDude, CUSTOMDUDE_WEAPON* pWeap, DVector3& offs, DVector3& vel);
|
||||
static DBloodActor* weaponShotKamikaze(DCustomDude* pDude, CUSTOMDUDE_WEAPON* pWeap, DVector3& offs, DVector3& vel);
|
||||
static DBloodActor* weaponShotSpecialBeastStomp(DCustomDude* pDude, CUSTOMDUDE_WEAPON*, DVector3& offs, DVector3& vel);
|
||||
|
||||
DBloodActor* (*gWeaponShotFunc[])(CUSTOMDUDE* pDude, CUSTOMDUDE_WEAPON* pWeap, DVector3& offs, DVector3& vel) =
|
||||
DBloodActor* (*gWeaponShotFunc[])(DCustomDude* pDude, CUSTOMDUDE_WEAPON* pWeap, DVector3& offs, DVector3& vel) =
|
||||
{
|
||||
weaponShotDummy, // none
|
||||
weaponShotHitscan,
|
||||
|
@ -212,7 +212,7 @@ static const short gCdudeDebrisPics[6] =
|
|||
2406, 2280, 2185, 2155, 2620, 3135
|
||||
};
|
||||
|
||||
static DBloodActor* weaponShotHitscan(CUSTOMDUDE* pDude, CUSTOMDUDE_WEAPON* pWeap, DVector3& pOffs, DVector3& vel)
|
||||
static DBloodActor* weaponShotHitscan(DCustomDude* pDude, CUSTOMDUDE_WEAPON* pWeap, DVector3& pOffs, DVector3& vel)
|
||||
{
|
||||
const VECTORDATA* pVect = &gVectorData[pWeap->id];
|
||||
auto pSpr = pDude->pSpr;
|
||||
|
@ -223,7 +223,7 @@ static DBloodActor* weaponShotHitscan(CUSTOMDUDE* pDude, CUSTOMDUDE_WEAPON* pWea
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
static DBloodActor* weaponShotMissile(CUSTOMDUDE* pDude, CUSTOMDUDE_WEAPON* pWeap, DVector3& pOffs, DVector3& vel)
|
||||
static DBloodActor* weaponShotMissile(DCustomDude* pDude, CUSTOMDUDE_WEAPON* pWeap, DVector3& pOffs, DVector3& vel)
|
||||
{
|
||||
DBloodActor* pSpr = pDude->pSpr, *pShot;
|
||||
|
||||
|
@ -258,7 +258,7 @@ static DBloodActor* weaponShotMissile(CUSTOMDUDE* pDude, CUSTOMDUDE_WEAPON* pWea
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
static DBloodActor* weaponShotThing(CUSTOMDUDE* pDude, CUSTOMDUDE_WEAPON* pWeap, DVector3& pOffs, DVector3& vel)
|
||||
static DBloodActor* weaponShotThing(DCustomDude* pDude, CUSTOMDUDE_WEAPON* pWeap, DVector3& pOffs, DVector3& vel)
|
||||
{
|
||||
DBloodActor* pSpr = pDude->pSpr;
|
||||
DBloodActor* pLeech = pDude->pLeech, *pShot, *pTarget = pSpr->xspr.target;
|
||||
|
@ -441,7 +441,7 @@ static bool posObstructed(DVector3& pos, double nRadius)
|
|||
|
||||
|
||||
|
||||
static DBloodActor* weaponShotSummon(CUSTOMDUDE* pDude, CUSTOMDUDE_WEAPON* pWeap, DVector3& offs, DVector3& vel)
|
||||
static DBloodActor* weaponShotSummon(DCustomDude* pDude, CUSTOMDUDE_WEAPON* pWeap, DVector3& offs, DVector3& vel)
|
||||
{
|
||||
DBloodActor* pShot, *pSpr = pDude->pSpr;
|
||||
|
||||
|
@ -500,7 +500,7 @@ static DBloodActor* weaponShotSummon(CUSTOMDUDE* pDude, CUSTOMDUDE_WEAPON* pWeap
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
static DBloodActor* weaponShotKamikaze(CUSTOMDUDE* pDude, CUSTOMDUDE_WEAPON* pWeap, DVector3& pOffs, DVector3& vel)
|
||||
static DBloodActor* weaponShotKamikaze(DCustomDude* pDude, CUSTOMDUDE_WEAPON* pWeap, DVector3& pOffs, DVector3& vel)
|
||||
{
|
||||
DBloodActor* pSpr = pDude->pSpr;
|
||||
DBloodActor* pShot = actSpawnSprite(pSpr->sector(), pSpr->spr.pos, kStatExplosion, true);
|
||||
|
@ -521,7 +521,7 @@ static DBloodActor* weaponShotKamikaze(CUSTOMDUDE* pDude, CUSTOMDUDE_WEAPON* pWe
|
|||
pShot->xspr.data1 = pExpl->ticks;
|
||||
pShot->xspr.data2 = pExpl->quakeEffect;
|
||||
pShot->xspr.data3 = pExpl->flashEffect;
|
||||
pShot->xspr.data4 = ClipLow((int)pWeap->GetDistance() >> 4, pExpl->radius);
|
||||
pShot->xspr.data4 = ClipLow((int)pWeap->GetDistance(), pExpl->radius); // stores actual distance as integer.
|
||||
|
||||
seqSpawn(pExtra->seq, pShot);
|
||||
|
||||
|
@ -543,7 +543,7 @@ static DBloodActor* weaponShotKamikaze(CUSTOMDUDE* pDude, CUSTOMDUDE_WEAPON* pWe
|
|||
return pShot;
|
||||
}
|
||||
|
||||
static DBloodActor* weaponShotSpecialBeastStomp(CUSTOMDUDE* pDude, CUSTOMDUDE_WEAPON* pWeapon, DVector3& pOffs, DVector3& vel)
|
||||
static DBloodActor* weaponShotSpecialBeastStomp(DCustomDude* pDude, CUSTOMDUDE_WEAPON* pWeapon, DVector3& pOffs, DVector3& vel)
|
||||
{
|
||||
DBloodActor* pSpr = pDude->pSpr;
|
||||
|
||||
|
@ -593,7 +593,7 @@ void weaponShot(DBloodActor* pSpr)
|
|||
if (!pSpr->hasX())
|
||||
return;
|
||||
|
||||
CUSTOMDUDE* pDude = cdudeGet(pSpr);
|
||||
DCustomDude* pDude = cdudeGet(pSpr);
|
||||
CUSTOMDUDE_WEAPON *pCurWeap = pDude->pWeapon, *pWeap;
|
||||
DBloodActor *pShot;
|
||||
POINT3D *pStyleOffs;
|
||||
|
@ -736,7 +736,7 @@ void weaponShot(DBloodActor* pSpr)
|
|||
}
|
||||
}
|
||||
|
||||
static int checkTarget(CUSTOMDUDE* pDude, DBloodActor* pTarget, TARGET_INFO* pOut)
|
||||
static int checkTarget(DCustomDude* pDude, DBloodActor* pTarget, TARGET_INFO* pOut)
|
||||
{
|
||||
if (!pTarget)
|
||||
return -1;
|
||||
|
@ -797,7 +797,7 @@ void thinkTarget(DBloodActor* pSpr)
|
|||
int i;
|
||||
DBloodActor* pTarget;
|
||||
TARGET_INFO targets[kMaxPlayers], *pInfo = targets;
|
||||
CUSTOMDUDE* pDude = cdudeGet(pSpr);
|
||||
DCustomDude* pDude = cdudeGet(pSpr);
|
||||
int numTargets = 0;
|
||||
|
||||
if (Chance(pDude->pInfo->alertChance))
|
||||
|
@ -858,7 +858,7 @@ void maybeThinkSearch(DBloodActor* pSpr)
|
|||
|
||||
void thinkChase(DBloodActor* pSpr)
|
||||
{
|
||||
CUSTOMDUDE* pDude = cdudeGet(pSpr);
|
||||
DCustomDude* pDude = cdudeGet(pSpr);
|
||||
auto pHit = &gHitInfo;
|
||||
DUDEINFO* pInfo = pDude->pInfo;
|
||||
double nSlope = 0;
|
||||
|
@ -1102,7 +1102,7 @@ void turnToTarget(DBloodActor* pSpr)
|
|||
|
||||
void moveTurn(DBloodActor* pSpr)
|
||||
{
|
||||
CUSTOMDUDE* pDude = cdudeGet(pSpr);
|
||||
DCustomDude* pDude = cdudeGet(pSpr);
|
||||
DAngle nVelTurn = DAngle::fromBuild(pDude->GetVelocity(kParVelocityTurn));
|
||||
DAngle nAng = absangle(pSpr->xspr.goalAng, pSpr->spr.Angles.Yaw);
|
||||
pSpr->spr.Angles.Yaw = (pSpr->spr.Angles.Yaw + clamp(nAng, -nVelTurn, nVelTurn)).Normalized360();
|
||||
|
@ -1110,7 +1110,7 @@ void moveTurn(DBloodActor* pSpr)
|
|||
|
||||
void moveDodge(DBloodActor* pSpr)
|
||||
{
|
||||
CUSTOMDUDE* pDude = cdudeGet(pSpr);
|
||||
DCustomDude* pDude = cdudeGet(pSpr);
|
||||
moveTurn(pSpr);
|
||||
|
||||
if (pSpr->xspr.dodgeDir && pDude->CanMove())
|
||||
|
@ -1139,7 +1139,7 @@ void moveKnockout(DBloodActor* pSpr)
|
|||
|
||||
void moveForward(DBloodActor* pSpr)
|
||||
{
|
||||
CUSTOMDUDE* pDude = cdudeGet(pSpr);
|
||||
DCustomDude* pDude = cdudeGet(pSpr);
|
||||
DAngle nVelTurn = DAngle::fromBuild(pDude->GetVelocity(kParVelocityTurn));
|
||||
double nVelForward = pDude->GetVelocityF(kParVelocityForward);
|
||||
DAngle nAng = absangle(pSpr->xspr.goalAng, pSpr->spr.Angles.Yaw);
|
||||
|
@ -1177,7 +1177,7 @@ void moveForward(DBloodActor* pSpr)
|
|||
|
||||
void enterSleep(DBloodActor* pSpr)
|
||||
{
|
||||
CUSTOMDUDE* pDude = cdudeGet(pSpr);
|
||||
DCustomDude* pDude = cdudeGet(pSpr);
|
||||
pDude->StatusSet(kCdudeStatusSleep);
|
||||
resetTarget(pSpr);
|
||||
moveStop(pSpr);
|
||||
|
@ -1190,7 +1190,7 @@ void enterSleep(DBloodActor* pSpr)
|
|||
|
||||
void enterWake(DBloodActor* pSpr)
|
||||
{
|
||||
CUSTOMDUDE* pDude = cdudeGet(pSpr);
|
||||
DCustomDude* pDude = cdudeGet(pSpr);
|
||||
if (pDude->StatusTest(kCdudeStatusSleep))
|
||||
{
|
||||
pDude->StatusRem(kCdudeStatusSleep);
|
||||
|
@ -1207,7 +1207,7 @@ void enterWake(DBloodActor* pSpr)
|
|||
|
||||
void enterDying(DBloodActor* pSpr)
|
||||
{
|
||||
CUSTOMDUDE* pDude = cdudeGet(pSpr);
|
||||
DCustomDude* pDude = cdudeGet(pSpr);
|
||||
if (pDude->mass > 48)
|
||||
pDude->mass = ClipLow(pDude->mass >> 2, 48);
|
||||
}
|
||||
|
@ -1231,7 +1231,7 @@ void enterDeath(DBloodActor* pSpr)
|
|||
|
||||
void enterMorph(DBloodActor* pSpr)
|
||||
{
|
||||
CUSTOMDUDE* pDude = cdudeGet(pSpr);
|
||||
DCustomDude* pDude = cdudeGet(pSpr);
|
||||
if (!pDude->IsMorphing())
|
||||
{
|
||||
pDude->PlaySound(kCdudeSndTransforming);
|
||||
|
@ -1249,7 +1249,7 @@ void thinkMorph(DBloodActor* pSpr)
|
|||
{
|
||||
int nTarget;
|
||||
bool triggerOn, triggerOff;
|
||||
CUSTOMDUDE* pDude = cdudeGet(pSpr);
|
||||
DCustomDude* pDude = cdudeGet(pSpr);
|
||||
|
||||
if (pDude->SeqPlaying())
|
||||
{
|
||||
|
@ -1425,7 +1425,7 @@ void enterBurnSearchWater(DBloodActor* pSpr)
|
|||
}
|
||||
}
|
||||
|
||||
void cdudeDoExplosion(CUSTOMDUDE* pDude)
|
||||
void cdudeDoExplosion(DCustomDude* pDude)
|
||||
{
|
||||
static DVector3 nulvec;
|
||||
CUSTOMDUDE_WEAPON* pWeap = pDude->pWeapon;
|
||||
|
|
|
@ -33,6 +33,6 @@ BEGIN_BLD_NS
|
|||
extern AISTATE gCdudeStateTemplate[kCdudeStateNormalMax][kCdudePostureMax];
|
||||
extern AISTATE gCdudeStateAttackTemplate[kCdudePostureMax];
|
||||
extern AISTATE gCdudeStateDyingTemplate[kCdudePostureMax];
|
||||
void cdudeDoExplosion(CUSTOMDUDE* pDude);
|
||||
void cdudeDoExplosion(DCustomDude* pDude);
|
||||
END_BLD_NS
|
||||
#endif
|
|
@ -34,6 +34,7 @@ public:
|
|||
SPRITEMASS spriteMass;
|
||||
EventObject condition[4];
|
||||
TObjPtr<DBloodActor*> prevmarker; // needed by the nnext marker code. This originally hijacked targetX in XSPRITE
|
||||
DCustomDude* customDude; // strictly owned so no TObjPtr needed
|
||||
#endif
|
||||
DVector3 basePoint;
|
||||
int16_t dmgControl[kDamageMax]; // combination of the ones in DUDEINFO, THINGINFO, needs to be modifiable
|
||||
|
@ -48,6 +49,8 @@ public:
|
|||
|
||||
bool hasX() { return hasx; }
|
||||
void addX() { hasx = true; }
|
||||
|
||||
void OnDestroy() override;
|
||||
|
||||
void SetOwner(DBloodActor* own)
|
||||
{
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -68,7 +68,7 @@ kCdudeBurningHealth = (25 << 4),
|
|||
constexpr double kCdudeMinSeeDist = 3000 * inttoworld;
|
||||
constexpr double kCdudeMinHearDist = (kCdudeMinSeeDist * 0.5);
|
||||
|
||||
class CUSTOMDUDE;
|
||||
class DCustomDude;
|
||||
extern VMNativeFunction** const gCdudeCustomCallback[];
|
||||
|
||||
enum enum_VALUE_TYPE {
|
||||
|
@ -662,7 +662,7 @@ class CUSTOMDUDE_WEAPON
|
|||
unsigned int clipMask;
|
||||
unsigned int group;
|
||||
unsigned int dispersion[2];
|
||||
double _distRange[2];
|
||||
double distRange[2];
|
||||
uint8_t targHpRange[2];
|
||||
uint8_t dudeHpRange[2];
|
||||
CUSTOMDUDE_SOUND sound;
|
||||
|
@ -739,7 +739,7 @@ class CUSTOMDUDE_WEAPON
|
|||
stateID = kCdudeStateAttackBase;
|
||||
turnToTarget = true;
|
||||
|
||||
_distRange[1] = 20000;
|
||||
distRange[1] = 20000 * inttoworld;
|
||||
dudeHpRange[1] = 255;
|
||||
targHpRange[1] = 255;
|
||||
|
||||
|
@ -748,7 +748,7 @@ class CUSTOMDUDE_WEAPON
|
|||
shot.slope = INT32_MAX;
|
||||
}
|
||||
bool HaveAmmmo(void) { return (!ammo.total || ammo.cur); }
|
||||
double GetDistance(void) { return max(_distRange[1] - _distRange[0], 0.); }
|
||||
double GetDistance(void) { return max(distRange[1] - distRange[0], 0.); }
|
||||
int GetNumshots(void) { return (ammo.total) ? ClipHigh(ammo.cur, numshots) : numshots; }
|
||||
bool IsTimeout(void) { return ((unsigned int)PlayClock < cooldown.clock); }
|
||||
bool HaveSlope(void) { return (shot.slope != INT32_MAX); }
|
||||
|
@ -1188,16 +1188,14 @@ class CUSTOMDUDE_DROPITEM
|
|||
}
|
||||
};
|
||||
|
||||
/* class DCustomDude : public DObject
|
||||
class DCustomDude : public DObject
|
||||
{
|
||||
DECLARE_CLASS(DCustomDude, DObject)
|
||||
HAS_OBJECT_POINTERS
|
||||
|
||||
size_t PropagateMark() override;
|
||||
|
||||
// Note: we will likely have to write out the entire shit here to make this savegame robust...
|
||||
}
|
||||
*/
|
||||
class CUSTOMDUDE
|
||||
{
|
||||
public:
|
||||
uint8_t version;
|
||||
uint8_t initialized;
|
||||
|
@ -1306,12 +1304,13 @@ class CUSTOMDUDE_SETUP
|
|||
friend CUSTOMDUDEV2_SETUP;
|
||||
private:
|
||||
const char* pValue;
|
||||
CUSTOMDUDE* pDude;
|
||||
DCustomDude* pDude;
|
||||
const PARAM* pGroup;
|
||||
char key[256];
|
||||
int nWarnings;
|
||||
int hIni;
|
||||
IniFile* pIni;
|
||||
FString strIni;
|
||||
std::unique_ptr<IniFile> pIni;
|
||||
const PARAM* pParam;
|
||||
char val[256];
|
||||
bool showWarnings;
|
||||
|
@ -1353,17 +1352,20 @@ class CUSTOMDUDE_SETUP
|
|||
void SetupSlaves(void);
|
||||
void SetupLeech(void);
|
||||
/*------------------------------------------------------------*/
|
||||
CUSTOMDUDE* SameDudeExist(CUSTOMDUDE* pCmp);
|
||||
CUSTOMDUDE* GetFirstDude(int nID);
|
||||
bool IsFirst(CUSTOMDUDE* pCmp);
|
||||
DCustomDude* SameDudeExist(DCustomDude* pCmp);
|
||||
DCustomDude* GetFirstDude(int nID);
|
||||
bool IsFirst(DCustomDude* pCmp);
|
||||
void DoSetup(DBloodActor* actor);
|
||||
void DoSetup(DCustomDude* pOver = nullptr);
|
||||
|
||||
public:
|
||||
bool FindAiState(AISTATE stateArr[][kCdudePostureMax], int arrLen, AISTATE* pNeedle, int* nType, int* nPosture);
|
||||
static void Setup(DBloodActor* actor);
|
||||
static void Setup(CUSTOMDUDE* pOver = nullptr);
|
||||
static void Setup(DCustomDude* pOver = nullptr);
|
||||
|
||||
};
|
||||
|
||||
class CUSTOMDUDEV1_SETUP : CUSTOMDUDE_SETUP
|
||||
class CUSTOMDUDEV1_SETUP : public CUSTOMDUDE_SETUP
|
||||
{
|
||||
private:
|
||||
void DamageScaleToSurface(int nSurface);
|
||||
|
@ -1377,7 +1379,7 @@ class CUSTOMDUDEV1_SETUP : CUSTOMDUDE_SETUP
|
|||
void Setup(void);
|
||||
};
|
||||
|
||||
class CUSTOMDUDEV2_SETUP : CUSTOMDUDE_SETUP
|
||||
class CUSTOMDUDEV2_SETUP : public CUSTOMDUDE_SETUP
|
||||
{
|
||||
private:
|
||||
bool ParseVelocity(const char* str, CUSTOMDUDE_VELOCITY* pVelocity);
|
||||
|
@ -1393,7 +1395,7 @@ class CUSTOMDUDEV2_SETUP : CUSTOMDUDE_SETUP
|
|||
bool ParseWeaponBasicInfo(const char* str, CUSTOMDUDE_WEAPON* pWeap);
|
||||
bool ParsePosture(const char* str);
|
||||
bool ParseOnEventDmg(const char* str, int* pOut, int nLen);
|
||||
bool ParseDropItem(const char* str, unsigned bool out[2]);
|
||||
bool ParseDropItem(const char* str, uint8_t out[2]);
|
||||
bool ParseSkill(const char* str);
|
||||
int ParseKeywords(const char* str, PARAM* pDb);
|
||||
int ParseIDs(const char* str, int nValType, TArray<PClass*>& pOut, int nMax = 0);
|
||||
|
@ -1423,15 +1425,13 @@ class CUSTOMDUDEV2_SETUP : CUSTOMDUDE_SETUP
|
|||
void SetupWeapons(void);
|
||||
void SetupEffect(void);
|
||||
void SetupDropItem(void);
|
||||
public:
|
||||
public:
|
||||
void Setup(void);
|
||||
};
|
||||
|
||||
void cdudeFree();
|
||||
CUSTOMDUDE* cdudeAlloc();
|
||||
bool IsCustomDude(DBloodActor* pSpr) { return (pSpr->GetType() == kDudeModernCustom); }
|
||||
CUSTOMDUDE* cdudeGet(DBloodActor* pSpr);
|
||||
spritetype* cdudeSpawn(DBloodActor* pSource, DBloodActor* pSprite, int nDist);
|
||||
DCustomDude* cdudeGet(DBloodActor* pSpr);
|
||||
DBloodActor* cdudeSpawn(DBloodActor* pSource, DBloodActor* pSprite, double nDist);
|
||||
void cdudeLeechOperate(DBloodActor* pSprite);
|
||||
|
||||
END_BLD_NS
|
||||
|
|
|
@ -817,7 +817,7 @@ bool nnExtIsImmune(DBloodActor* actor, int dmgType, int minScale)
|
|||
else if (actor->IsDudeActor())
|
||||
{
|
||||
if (actor->IsPlayerActor()) return (getPlayer(actor)->damageControl[dmgType]);
|
||||
else if (actor->GetType() == kDudeModernCustom) return (cdudeGet(actor)->GetDamage(nullptr, dmgType) <= minScale);
|
||||
else if (IsCustomDude(actor)) return (cdudeGet(actor)->GetDamage(nullptr, dmgType) <= minScale);
|
||||
return (actor->dmgControl[dmgType] <= minScale);
|
||||
}
|
||||
}
|
||||
|
@ -1449,9 +1449,6 @@ void nnExtInitModernStuff(TArray<DBloodActor*>& actors)
|
|||
// prepare event causer sequence table
|
||||
nnExtInitCauserTable();
|
||||
conditionsInit();
|
||||
|
||||
// prepare custom dudes array
|
||||
cdudeAlloc();
|
||||
}
|
||||
|
||||
|
||||
|
@ -6120,13 +6117,13 @@ void useTargetChanger(DBloodActor* sourceactor, DBloodActor* actor)
|
|||
{
|
||||
aiSetTarget(actor, actor->spr.pos);
|
||||
aiSetGenIdleState(actor);
|
||||
if (actor->GetType() == kDudeModernCustom)
|
||||
if (IsCustomDude(actor))
|
||||
cdudeGet(actor)->LeechPickup();
|
||||
}
|
||||
else if (sourceactor->xspr.data4 == 4)
|
||||
{
|
||||
aiSetTarget(actor, playeractor->spr.pos);
|
||||
if (actor->GetType() == kDudeModernCustom)
|
||||
if (IsCustomDude(actor))
|
||||
cdudeGet(actor)->LeechPickup();
|
||||
}
|
||||
}
|
||||
|
@ -6900,7 +6897,7 @@ bool setDataValueOfObject(int objType, sectortype* sect, walltype* wal, DBloodAc
|
|||
{
|
||||
case OBJ_SPRITE:
|
||||
{
|
||||
CUSTOMDUDE* pDude = NULL;
|
||||
DCustomDude* pDude = NULL;
|
||||
if (objActor->IsDudeActor())
|
||||
{
|
||||
if (objActor->xspr.health <= 0)
|
||||
|
@ -7122,12 +7119,12 @@ void aiPatrolState(DBloodActor* actor, int state)
|
|||
if (seq != newState->seqId)
|
||||
continue;
|
||||
|
||||
if (actor->GetType() == kDudeModernCustom)
|
||||
if (IsCustomDude(actor))
|
||||
{
|
||||
if (!rngok(seq, 0, kCdudeStateMax))
|
||||
continue;
|
||||
|
||||
CUSTOMDUDE* pDude = cdudeGet(actor);
|
||||
DCustomDude* pDude = cdudeGet(actor);
|
||||
AISTATE* pState = (AISTATE*)pDude->states;
|
||||
seq = pState[seq].seqId;
|
||||
if (seq <= 0)
|
||||
|
@ -7477,7 +7474,7 @@ void aiPatrolMove(DBloodActor* actor)
|
|||
case kDudeModernCustom:
|
||||
{
|
||||
int nPosture;
|
||||
CUSTOMDUDE* pDude = cdudeGet(actor);
|
||||
DCustomDude* pDude = cdudeGet(actor);
|
||||
if (spriteIsUnderwater(actor))nPosture = kCdudePostureW;
|
||||
else if (actor->xspr.modernFlags & kDudeFlagCrouch) nPosture = kCdudePostureC;
|
||||
else nPosture = kCdudePostureL;
|
||||
|
@ -8122,9 +8119,9 @@ void aiPatrolThink(DBloodActor* actor)
|
|||
return;
|
||||
}
|
||||
|
||||
if (actor->GetType() == kDudeModernCustom)
|
||||
if (IsCustomDude(actor))
|
||||
{
|
||||
CUSTOMDUDE* pDude = cdudeGet(actor);
|
||||
DCustomDude* pDude = cdudeGet(actor);
|
||||
if ((uwater && !pDude->CanSwim()) || !pDude->CanMove())
|
||||
{
|
||||
aiPatrolStop(actor, nullptr);
|
||||
|
|
|
@ -1200,14 +1200,14 @@ struct EvalContext final
|
|||
********************************************************************************/
|
||||
bool cdudChkLeechThrown(void)
|
||||
{
|
||||
CUSTOMDUDE* pDude = cdudeGet(pSpr);
|
||||
DCustomDude* pDude = cdudeGet(pSpr);
|
||||
if (!pDude->IsLeechBroken() && pDude->pLeech)
|
||||
return helperChkSprite(pDude->pLeech);
|
||||
return false;
|
||||
};
|
||||
bool cdudChkLeechDead(void)
|
||||
{
|
||||
CUSTOMDUDE* pDude = cdudeGet(pSpr);
|
||||
DCustomDude* pDude = cdudeGet(pSpr);
|
||||
if (pDude->IsLeechBroken()) return true;
|
||||
else if (PUSH && pDude->pLeech) Push(pDude->pLeech);
|
||||
return false;
|
||||
|
|
Loading…
Reference in a new issue