//
// AnimatedShopKeeper::animationFinished from 0x4e1fd4 to 0x4e2254 (640 bytes)
//
// 0 xrefs:
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
void AnimatedShopKeeper::animationFinished(AnimatedShopKeeper *a1, const char *a2)
{
int v4; // r7
_BOOL4 v5; // r7
int v6; // r2
int v7; // r2
int v8; // r2
int v9; // r2
int v10; // r2
_BYTE v11[4]; // [sp+Ch] [bp-10h] BYREF
_BYTE v12[4]; // [sp+10h] [bp-Ch] BYREF
--a1->m_idleInt1;
--a1->m_idleInt2;
sub_776584((int)v11, (char *)a2);
sub_776584((int)v12, "react01");
v4 = sub_774DBC(v11, v12);
sub_774008(v12);
sub_774008(v11);
if ( !v4 )
a1->m_reacting = 0;
sub_776584((int)v11, (char *)a2);
sub_776584((int)v12, "idle03");
if ( sub_774DBC(v11, v12) )
v5 = a1->m_idleInt2 <= 0 && a1->m_type != Diamond;
else
v5 = 0;
sub_774008(v12);
sub_774008(v11);
if ( v5 )
{
a1->m_looking = 0;
a1->m_idleInt2 = (int)(float)((float)(vcvts_n_f32_s32(rand(), 0x1Fu) * 5.0) + 10.0);
sub_776584((int)v12, "idle03");
CCAnimatedSprite::runAnimationForced((int)a1, (int)v12, v6);
LABEL_22:
sub_774008(v12);
return;
}
sub_776584((int)v11, (char *)a2);
sub_776584((int)v12, "idle00");
if ( !sub_774DBC(v11, v12) )
v5 = a1->m_idleInt1 <= 0;
sub_774008(v12);
sub_774008(v11);
if ( !v5 )
{
sub_776584((int)v11, (char *)a2);
sub_776584((int)v12, "idle03");
if ( !sub_774DBC(v11, v12) && !a1->m_looking )
v5 = vcvts_n_f32_s32(rand(), 0x1Fu) > 0.6;
sub_774008(v12);
sub_774008(v11);
if ( v5 )
{
sub_776584((int)v12, "idle03");
CCAnimatedSprite::runAnimationForced((int)a1, (int)v12, v7);
sub_774008(v12);
a1->m_looking = 1;
return;
}
sub_776584((int)v12, "idle00");
CCAnimatedSprite::runAnimationForced((int)a1, (int)v12, v8);
goto LABEL_22;
}
if ( (float)((float)rand() * 4.6566e-10) <= 0.9 || a1->m_type == Diamond )
{
sub_776584((int)v12, "idle02");
CCAnimatedSprite::runAnimationForced((int)a1, (int)v12, v10);
}
else
{
sub_776584((int)v12, "idle01");
CCAnimatedSprite::runAnimationForced((int)a1, (int)v12, v9);
}
sub_774008(v12);
a1->m_idleInt1 = (int)(float)((float)((float)((float)rand() * 4.6566e-10) * 3.0) + 2.0);
}