- zilla.cpp

This commit is contained in:
Christoph Oelckers 2021-11-03 17:29:20 +01:00
parent e98e1a6fea
commit 95c92153ad
2 changed files with 15 additions and 32 deletions

View file

@ -59,7 +59,7 @@ int SetupGoro(DSWActor*);
int SetupCoolg(DSWActor*); int SetupCoolg(DSWActor*);
int SetupEel(DSWActor*); int SetupEel(DSWActor*);
int SetupSumo(DSWActor*); int SetupSumo(DSWActor*);
int SetupZilla(short); int SetupZilla(DSWActor*);
int SetupToiletGirl(DSWActor*); int SetupToiletGirl(DSWActor*);
int SetupWashGirl(DSWActor*); int SetupWashGirl(DSWActor*);
int SetupCarGirl(DSWActor*); int SetupCarGirl(DSWActor*);
@ -1282,7 +1282,7 @@ ActorSpawn(SPRITEp sp)
} }
PicAnimOff(sp->picnum); PicAnimOff(sp->picnum);
SetupZilla(SpriteNum); SetupZilla(actor);
break; break;
} }

View file

@ -638,22 +638,20 @@ ACTOR_ACTION_SET ZillaActionSet =
nullptr nullptr
}; };
int int SetupZilla(DSWActor* actor)
SetupZilla(short SpriteNum)
{ {
auto actor = &swActors[SpriteNum]; SPRITEp sp = &actor->s();
SPRITEp sp = &sprite[SpriteNum];
USERp u; USERp u;
ANIMATOR DoActorDecide; ANIMATOR DoActorDecide;
if (TEST(sp->cstat, CSTAT_SPRITE_RESTORE)) if (TEST(sp->cstat, CSTAT_SPRITE_RESTORE))
{ {
u = User[SpriteNum].Data(); u = actor->u();
ASSERT(u); ASSERT(u);
} }
else else
{ {
u = SpawnUser(SpriteNum,ZILLA_RUN_R0,s_ZillaRun[0]); u = SpawnUser(actor, ZILLA_RUN_R0, s_ZillaRun[0]);
u->Health = 6000; u->Health = 6000;
} }
@ -672,19 +670,13 @@ SetupZilla(short SpriteNum)
sp->xrepeat = 97; sp->xrepeat = 97;
sp->yrepeat = 79; sp->yrepeat = 79;
//SET(u->Flags, SPR_XFLIP_TOGGLE);
return 0; return 0;
} }
int NullZilla(DSWActor* actor) int NullZilla(DSWActor* actor)
{ {
USER* u = actor->u(); USER* u = actor->u();
int SpriteNum = u->SpriteNum; SPRITEp sp = &actor->s();
SPRITEp sp = User[SpriteNum]->SpriteP;
//if (TEST(u->Flags,SPR_SLIDING))
//DoActorSlide(actor);
#if 0 #if 0
if (u->State == s_ZillaDie) if (u->State == s_ZillaDie)
@ -713,25 +705,21 @@ int NullZilla(DSWActor* actor)
int DoZillaMove(DSWActor* actor) int DoZillaMove(DSWActor* actor)
{ {
USER* u = actor->u(); USER* u = actor->u();
int SpriteNum = u->SpriteNum; SPRITEp sp = &actor->s();
SPRITEp sp = &sprite[SpriteNum];
short choose; short choose;
//if (TEST(u->Flags,SPR_SLIDING))
//DoActorSlide(actor);
// Random Zilla taunts // Random Zilla taunts
if (!SoundValidAndActive(sp, CHAN_AnimeMad)) if (!SoundValidAndActive(sp, CHAN_AnimeMad))
{ {
choose = STD_RANDOM_RANGE(1000); choose = STD_RANDOM_RANGE(1000);
if (choose > 990) if (choose > 990)
PlaySound(DIGI_Z16004, sp, v3df_none, CHAN_AnimeMad); PlaySound(DIGI_Z16004, actor, v3df_none, CHAN_AnimeMad);
else if (choose > 985) else if (choose > 985)
PlaySound(DIGI_Z16004, sp, v3df_none, CHAN_AnimeMad); PlaySound(DIGI_Z16004, actor, v3df_none, CHAN_AnimeMad);
else if (choose > 980) else if (choose > 980)
PlaySound(DIGI_Z16004, sp, v3df_none, CHAN_AnimeMad); PlaySound(DIGI_Z16004, actor, v3df_none, CHAN_AnimeMad);
else if (choose > 975) else if (choose > 975)
PlaySound(DIGI_Z16004, sp, v3df_none, CHAN_AnimeMad); PlaySound(DIGI_Z16004, actor, v3df_none, CHAN_AnimeMad);
} }
@ -752,11 +740,7 @@ int DoZillaMove(DSWActor* actor)
int DoZillaStomp(DSWActor* actor) int DoZillaStomp(DSWActor* actor)
{ {
USER* u = actor->u(); PlaySound(DIGI_ZILLASTOMP, actor, v3df_follow);
int SpriteNum = u->SpriteNum;
SPRITEp sp = &sprite[SpriteNum];
PlaySound(DIGI_ZILLASTOMP, sp, v3df_follow);
return 0; return 0;
} }
@ -766,11 +750,10 @@ extern int SpawnGrenadeExp(int16_t Weapon);
int DoZillaDeathMelt(DSWActor* actor) int DoZillaDeathMelt(DSWActor* actor)
{ {
USER* u = actor->u(); USER* u = actor->u();
int SpriteNum = u->SpriteNum; SPRITEp sp = &actor->s();
SPRITEp sp = &sprite[SpriteNum];
if (RandomRange(1000) > 800) if (RandomRange(1000) > 800)
SpawnGrenadeExp(SpriteNum); SpawnGrenadeExp(actor->GetSpriteIndex());
u->ID = ZILLA_RUN_R0; u->ID = ZILLA_RUN_R0;
RESET(u->Flags, SPR_JUMPING|SPR_FALLING|SPR_MOVED); RESET(u->Flags, SPR_JUMPING|SPR_FALLING|SPR_MOVED);