enabled custom dude stuff in nnextsif.cpp

This commit is contained in:
Christoph Oelckers 2023-10-15 09:34:17 +02:00
parent 33aa9188d7
commit 463eb7cc9e
4 changed files with 17 additions and 32 deletions

View file

@ -685,6 +685,7 @@ set( NOT_COMPILED_SOURCE_FILES
games/blood/src/nnexts.cpp
games/blood/src/nnsprinsect.cpp
games/blood/src/nnextstr.cpp
games/blood/src/nnextsif.cpp
games/blood/src/osdcmd.cpp
games/blood/src/player.cpp

View file

@ -1168,6 +1168,14 @@ class CUSTOMDUDE_DROPITEM
}
};
/* class DCustomDude : public DObject
{
DECLARE_CLASS(DCustomDude, DObject)
HAS_OBJECT_POINTERS
// Note: we will likely have to write out the entire shit here to make this savegame robust...
}
*/
class CUSTOMDUDE
{
public:
@ -1178,7 +1186,7 @@ class CUSTOMDUDE
DUDEEXTRA* pExtra;
DUDEINFO* pInfo;
DBloodActor* pSpr;
DBloodActor *pLeech;
TObjPtr<DBloodActor *> pLeech;
CUSTOMDUDE_WEAPON weapons[kCdudeMaxWeapons]; // the weapons it may have
CUSTOMDUDE_WEAPON* pWeapon; // pointer to current weapon
CUSTOMDUDE_DAMAGE damage; // damage control
@ -1190,7 +1198,7 @@ class CUSTOMDUDE
CUSTOMDUDE_DROPITEM dropItem; // drop item control
CUSTOMDUDE_EFFECT effects[kCdudeMaxEffectGroups]; // fx, gib effect stuff
AISTATE states[kCdudeStateMax][kCdudePostureMax]; // includes states for weapons
//IDLIST* pSlaves; // summoned dudes under control of this dude
TArray<TObjPtr<DBloodActor*>> pSlaves; // summoned dudes under control of this dude
uint8_t medium ; // medium in which it can live
uint8_t posture ; // current posture
unsigned int mass ; // mass in KG

View file

@ -816,8 +816,7 @@ bool nnExtIsImmune(DBloodActor* actor, int dmgType, int minScale)
else if (actor->IsDudeActor())
{
if (actor->IsPlayerActor()) return (getPlayer(actor)->damageControl[dmgType]);
#pragma message("Fix " __FUNCTION__ " for custom dudes")
//else if (actor->GetType() == kDudeModernCustom) return (cdudeGet(pSprite->index)->GetDamage(-1, dmgType) <= minScale);
else if (actor->GetType() == kDudeModernCustom) return (cdudeGet(actor)->GetDamage(-1, dmgType) <= minScale);
return (actor->dmgControl[dmgType] <= minScale);
}
}
@ -2106,7 +2105,6 @@ void aiSetGenIdleState(DBloodActor* actor)
switch (actor->GetType())
{
case kDudeModernCustom:
#pragma message("Fix " __FUNCTION__ " for custom dudes")
aiGenDudeNewState(actor, &genIdle);
break;
default:

View file

@ -1200,41 +1200,25 @@ struct EvalContext final
********************************************************************************/
bool cdudChkLeechThrown(void)
{
#pragma message("fix for custom dudes")
#if 0
CUSTOMDUDE* pDude = cdudeGet(pSpr);
if (!pDude->IsLeechBroken() && pDude->pXLeech)
return helperChkSprite(pDude->pXLeech->reference);
#endif
if (!pDude->IsLeechBroken() && pDude->pLeech)
return helperChkSprite(pDude->pLeech);
return false;
};
bool cdudChkLeechDead(void)
{
#pragma message("fix" __FUNCTION__ "for custom dudes")
#if 0
CUSTOMDUDE* pDude = cdudeGet(pSpr);
if (pDude->IsLeechBroken()) return true;
else if (PUSH && pDude->pXLeech) Push(EventObject::Actor, pDude->pXLeech->reference);
#endif
else if (PUSH && pDude->pLeech) Push(pDude->pLeech);
return false;
};
bool cdudCmpSummoned(void)
{
#pragma message("fix" __FUNCTION__ "for custom dudes")
#if 0
IDLIST* pSlaves = cdudeGet(pSpr)->pSlaves;
if (!pSlaves)
return Cmp(0);
return Cmp(pSlaves->Length());
#else
return false;
#endif
auto& pSlaves = cdudeGet(pSpr)->pSlaves;
return Cmp(pSlaves.Size());
};
bool cdudChkIfAble(void)
{
#pragma message("fix" __FUNCTION__ "for custom dudes")
#if 0
switch (arg3)
{
case 1: return false;
@ -1249,21 +1233,15 @@ struct EvalContext final
Error(gErrors[kErrInvalidArgsPass]);
break;
}
#endif
return false;
};
bool cdudCmpDispersion(void)
{
#pragma message("fix" __FUNCTION__ "for custom dudes")
#if 0
CUSTOMDUDE_WEAPON* pWeapon = cdudeGet(pSpr)->pWeapon;
if (!pWeapon)
return Cmp(0);
return Cmp(pWeapon->dispersion[0]);
#else
return false;
#endif
};