diff --git a/KAIN2/Game/MONSTER/MONSTER.C b/KAIN2/Game/MONSTER/MONSTER.C index 39406bd9..e73d98c1 100644 --- a/KAIN2/Game/MONSTER/MONSTER.C +++ b/KAIN2/Game/MONSTER/MONSTER.C @@ -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; + } }