Skip to content

Commit

Permalink
Merge pull request #1598 from FedericoMilesi/MON_Stunned
Browse files Browse the repository at this point in the history
[MONSTER]: Implement MON_Stunned
  • Loading branch information
FedericoMilesi authored Apr 11, 2024
2 parents 33358c9 + 6a63917 commit 20118b3
Showing 1 changed file with 39 additions and 17 deletions.
56 changes: 39 additions & 17 deletions KAIN2/Game/MONSTER/MONSTER.C
Original file line number Diff line number Diff line change
Expand Up @@ -775,24 +775,46 @@ void MON_StunnedEntry(struct _Instance *instance)
}


// autogenerated function stub:
// void /*$ra*/ MON_Stunned(struct _Instance *instance /*$s0*/)
void MON_Stunned(struct _Instance *instance)
{ // line 1332, offset 0x80089464
/* begin block 1 */
// Start line: 1333
// Start offset: 0x80089464
// Variables:
struct _MonsterVars *mv; // $s1
/* end block 1 */
// End offset: 0x80089560
// End Line: 1363
void MON_Stunned(struct _Instance* instance) // Matching - 100%
{
struct _MonsterVars* mv;

/* begin block 2 */
// Start line: 2862
/* end block 2 */
// End Line: 2863
UNIMPLEMENTED();
mv = (struct _MonsterVars*)instance->extraData;

if ((instance->flags2 & 0x10))
{
if (!(mv->mvFlags & 0x100))
{
MON_SwitchState(instance, MONSTER_STATE_COMBAT);
}
else
{
MON_PlayAnim(instance, MONSTER_ANIM_STUNNED, 1);
}
}

if (mv->generalTimer < MON_GetTime(instance))
{
instance->xVel = 0;
instance->yVel = 0;
instance->zVel = 0;
}

if ((!(mv->mvFlags & 0x100)) && (MON_AnimPlaying(instance, MONSTER_ANIM_STUNNED_RECOVERY) == 0))
{
MON_PlayAnim(instance, MONSTER_ANIM_STUNNED_RECOVERY, 1);
}

MON_DefaultQueueHandler(instance);

PHYSICS_StopIfCloseToTarget(instance, 0, 0, 0);

PhysicsMove(instance, &instance->position, gameTrackerX.timeMult);

if (instance->currentMainState != 9)
{
instance->checkMask &= ~0x20;
}
}


Expand Down

0 comments on commit 20118b3

Please sign in to comment.