- aiunicult.cpp is done.

This commit is contained in:
Christoph Oelckers 2021-05-06 10:55:56 +02:00
parent 013eadfd9f
commit b240d2b5bd
4 changed files with 29 additions and 11 deletions

View file

@ -3504,12 +3504,12 @@ void actKillDude(DBloodActor* killerActor, DBloodActor* actor, DAMAGE_TYPE damag
#ifdef NOONE_EXTENSIONS
case kDudeModernCustom:
modernCustomDudeDeath(actor, nSeq, damageType);
genDudePostDeath(pSprite, damageType, damage);
genDudePostDeath(actor, damageType, damage);
return;
case kDudeModernCustomBurning:
modernCustomDudeBurningDeath(actor, nSeq);
genDudePostDeath(pSprite, kDamageExplode, damage);
genDudePostDeath(actor, kDamageExplode, damage);
return;
#endif

View file

@ -1900,7 +1900,7 @@ void aiInitSprite(DBloodActor* actor)
case kDudeModernCustom:
case kDudeModernCustomBurning:
if (!gModernMap) break;
aiGenDudeInitSprite(pSprite, pXSprite);
aiGenDudeInitSprite(actor);
genDudePrepare(actor, kGenDudePropertyAll);
break;
#endif

View file

@ -2591,8 +2591,17 @@ bool genDudePrepare(DBloodActor* actor, int propId)
return true;
}
void genDudePostDeath(spritetype* pSprite, DAMAGE_TYPE damageType, int damage) {
if (damageType == kDamageExplode) {
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void genDudePostDeath(DBloodActor* actor, DAMAGE_TYPE damageType, int damage)
{
auto const pSprite = &actor->s();
if (damageType == kDamageExplode)
{
DUDEINFO* pDudeInfo = getDudeInfo(pSprite->type);
for (int i = 0; i < 3; i++)
if (pDudeInfo->nGibType[i] > -1)
@ -2608,11 +2617,20 @@ void genDudePostDeath(spritetype* pSprite, DAMAGE_TYPE damageType, int damage) {
actPostSprite(pSprite->index, kStatThing);
}
void aiGenDudeInitSprite(spritetype* pSprite, XSPRITE* pXSprite)
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void aiGenDudeInitSprite(DBloodActor* actor)
{
auto actor = &bloodActors[pSprite->index];
switch (pSprite->type) {
case kDudeModernCustom: {
auto const pSprite = &actor->s();
auto const pXSprite = &actor->x();
switch (pSprite->type)
{
case kDudeModernCustom:
{
DUDEEXTRA_STATS* pDudeExtraE = &actor->dudeExtra.stats;
pDudeExtraE->active = 0;
aiGenDudeNewState(actor, &genDudeIdleL);

View file

@ -228,7 +228,7 @@ short inDuck(AISTATE* aiState);
int genDudeSeqStartId(DBloodActor* pXSprite);
bool genDudePrepare(DBloodActor* pSprite, int propId);
void genDudeUpdate(DBloodActor* pSprite);
void genDudePostDeath(spritetype* pSprite, DAMAGE_TYPE damageType, int damage);
void aiGenDudeInitSprite(spritetype* pSprite, XSPRITE* pXSprite);
void genDudePostDeath(DBloodActor* actor, DAMAGE_TYPE damageType, int damage);
void aiGenDudeInitSprite(DBloodActor* actor);
#endif
END_BLD_NS