Skip to content

Commit 0d22982

Browse files
committed
Bit more
1 parent e8933b3 commit 0d22982

File tree

2 files changed

+112
-5
lines changed

2 files changed

+112
-5
lines changed

src/SB/Game/zNPCGoalRobo.cpp

Lines changed: 111 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1229,7 +1229,7 @@ void zNPCGoalAlertFodBzzt::DeathRayRender()
12291229

12301230
S32 zNPCGoalAlertChomper::Enter(F32 dt, void* updCtxt)
12311231
{
1232-
zNPCCommon* npc = ((zNPCCommon*)(psyche->clt_owner));
1232+
zNPCCommon* npc = (zNPCCommon*)(psyche->clt_owner);
12331233
alertchomp = CHOMPER_ALERT_NOTICE;
12341234
npc->VelStop();
12351235
pos_evade = g_O3;
@@ -1538,7 +1538,7 @@ S32 zNPCGoalAlertHammer::Process(en_trantype* trantype, F32 dt, void* updCtxt, x
15381538
{
15391539
return nextgoal;
15401540
}
1541-
return nextgoal = xGoal::Process(trantype, dt, updCtxt, NULL);
1541+
return xGoal::Process(trantype, dt, updCtxt, NULL);
15421542
}
15431543

15441544
S32 zNPCGoalAlertHammer::Enter(F32 dt, void* updCtxt)
@@ -1674,7 +1674,7 @@ S32 zNPCGoalAlertTarTar::Resume(F32 dt, void* updCtxt)
16741674
S32 zNPCGoalAlertTarTar::Process(en_trantype* trantype, F32 dt, void* updCtxt, xScene* xscn)
16751675
{
16761676
S32 nextgoal;
1677-
zNPCRobot* npc;
1677+
zNPCTarTar* npc;
16781678
en_alerttart old_alerttart;
16791679
F32 tym_reload;
16801680
xVec3 dir_HtoP;
@@ -1683,7 +1683,7 @@ S32 zNPCGoalAlertTarTar::Process(en_trantype* trantype, F32 dt, void* updCtxt, x
16831683
zNPCGoalTaunt* taunt;
16841684
F32 rad;
16851685

1686-
npc = (zNPCSlick*)(psyche->clt_owner);
1686+
npc = (zNPCTarTar*)(psyche->clt_owner);
16871687
subenter = flg_info & 2;
16881688
old_alerttart = alerttart;
16891689
flg_info &= ~6;
@@ -3095,6 +3095,51 @@ S32 zNPCGoalAttackArf::Exit(F32 dt, void* updCtxt)
30953095
return zNPCGoalPushAnim::Exit(dt, updCtxt);
30963096
}
30973097

3098+
S32 zNPCGoalAttackArf::Process(en_trantype* trantype, F32 dt, void* updCtxt, xScene* xscn)
3099+
{
3100+
zNPCRobot* npc = (zNPCRobot*)(psyche->clt_owner);
3101+
S32 nextgoal = 0;
3102+
npc->VelStop();
3103+
npc->FacePlayer(dt, 3 * PI);
3104+
if (globals.player.Health < 1)
3105+
{
3106+
zNPCGoalTaunt* taunt = (zNPCGoalTaunt*)(psyche->FindGoal(NPC_GOAL_TAUNT));
3107+
taunt->LoopCountSet(1000);
3108+
*trantype = GOAL_TRAN_SWAP;
3109+
nextgoal = NPC_GOAL_TAUNT;
3110+
}
3111+
else if (globals.player.DamageTimer > 0.5f)
3112+
{
3113+
*trantype = GOAL_TRAN_SWAP;
3114+
nextgoal = NPC_GOAL_TAUNT;
3115+
}
3116+
else if (npc->SomethingWonderful() != 0)
3117+
{
3118+
*trantype = GOAL_TRAN_SET;
3119+
nextgoal = NPC_GOAL_IDLE;
3120+
}
3121+
if (*trantype != 0)
3122+
{
3123+
return nextgoal;
3124+
}
3125+
if (npc->DBG_IsNormLog(eNPCDCAT_Thirteen, -1))
3126+
{
3127+
NPCC_DrawPlayerPredict(5, 1.0f, 4.0f);
3128+
}
3129+
if (flg_attack & 1)
3130+
{
3131+
if (npc->IsAttackFrame(-1.0f, 1) && (LaunchBone(dt, 1) != 0))
3132+
{
3133+
flg_attack &= 0xFFFFFFFC;
3134+
}
3135+
}
3136+
else if ((flg_attack & 2) && npc->IsAttackFrame(-1.0f, 2) && (LaunchDoggie(dt) != 0))
3137+
{
3138+
flg_attack &= 0xFFFFFFFC;
3139+
}
3140+
return zNPCGoalPushAnim::Process(trantype, dt, updCtxt, xscn);
3141+
}
3142+
30983143
void zNPCGoalAttackArf::SetAttackMode(S32 a, S32 b)
30993144
{
31003145
flg_attack &= 0xfffffff8;
@@ -3135,6 +3180,36 @@ S32 zNPCGoalAttackChuck::Exit(F32 dt, void* updCtxt)
31353180
return zNPCGoalPushAnim::Exit(dt, updCtxt);
31363181
}
31373182

3183+
S32 zNPCGoalAttackChuck::Process(en_trantype* trantype, F32 dt, void* updCtxt, xScene* xscn)
3184+
{
3185+
zNPCRobot* npc = (zNPCRobot*)(psyche->clt_owner);
3186+
S32 nextgoal = 0;
3187+
HAZ_AvailablePool();
3188+
if (*trantype != 0)
3189+
{
3190+
return nextgoal;
3191+
}
3192+
npc->VelStop();
3193+
npc->FacePlayer(dt, 3 * PI);
3194+
if (npc->DBG_IsNormLog(eNPCDCAT_Thirteen, -1))
3195+
{
3196+
NPCC_DrawPlayerPredict(5, 1.0f, 4.0f);
3197+
}
3198+
if ((npc->AnimTimeCurrent() > 0.2f) && (idx_launch == 1))
3199+
{
3200+
npc->ModelAtomicShow(1, 0);
3201+
}
3202+
if (idx_launch == npc->IsAttackFrame(-1.0f, 0))
3203+
{
3204+
if (BombzAway(dt))
3205+
{
3206+
idx_launch++;
3207+
npc->ModelAtomicHide(1, NULL);
3208+
}
3209+
}
3210+
return zNPCGoalPushAnim::Process(trantype, dt, updCtxt, xscn);
3211+
}
3212+
31383213
S32 zNPCGoalAttackChuck::BombzAway(F32 param_1)
31393214
{
31403215
zNPCRobot* npc = ((zNPCRobot*)(psyche->clt_owner));
@@ -3151,6 +3226,38 @@ S32 zNPCGoalAttackSlick::Enter(F32 dt, void* updCtxt)
31513226
return zNPCGoalLoopAnim::Enter(dt, updCtxt);
31523227
}
31533228

3229+
S32 zNPCGoalAttackSlick::Process(en_trantype* trantype, F32 dt, void* updCtxt, xScene* xscn)
3230+
{
3231+
zNPCSlick* npc = (zNPCSlick*)(psyche->clt_owner);
3232+
S32 zapidx;
3233+
3234+
npc->FacePlayer(dt, 3 * PI);
3235+
npc->ThrottleAdjust(dt, 0.0f, -1.0f);
3236+
npc->ThrottleApply(dt, NPCC_faceDir(npc), 0);
3237+
if (npc->DBG_IsNormLog(eNPCDCAT_Thirteen, -1) != 0)
3238+
{
3239+
NPCC_DrawPlayerPredict(5, 1.0, 4.0);
3240+
}
3241+
zapidx = 0;
3242+
if (anid_played == anid_stage[1])
3243+
{
3244+
zapidx = npc->IsAttackFrame(-1.0f, 0);
3245+
}
3246+
if (cnt_loop < idx_launch)
3247+
{
3248+
idx_launch = cnt_loop;
3249+
}
3250+
if ((zapidx != 0) && (idx_launch != 0) && (cnt_loop == idx_launch))
3251+
{
3252+
HAZ_AvailablePool();
3253+
if (FireOne(idx_launch) != 0)
3254+
{
3255+
idx_launch--;
3256+
}
3257+
}
3258+
return zNPCGoalLoopAnim::Process(trantype, dt, updCtxt, xscn);
3259+
}
3260+
31543261
S32 zNPCGoalAttackSlick::FireOne(S32)
31553262
{
31563263
zNPCRobot* npc = ((zNPCRobot*)(psyche->clt_owner));

src/SB/Game/zNPCGoalStd.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,7 @@ class zNPCGoalAttackArf : public zNPCGoalPushAnim
379379
S32 Process(en_trantype* trantype, F32 dt, void* updCtxt, xScene* xscn);
380380
void SetAttackMode(S32 a, S32 b);
381381
S32 LaunchBone(F32 dt, S32 param_2);
382-
S32 LaunchDoggie();
382+
S32 LaunchDoggie(F32 dt);
383383
S32 flg_attack; // offset 0x54, size 0x4
384384
};
385385

0 commit comments

Comments
 (0)