MCPcopy Create free account
hub / github.com/bfbbdecomp/bfbb / stompCB

Function stompCB

src/SB/Game/zNPCTypeBossSB1.cpp:563–586  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

561}
562
563static S32 stompCB(xGoal* rawgoal, void*, en_trantype* trantype, F32 dt, void*)
564{
565 zNPCGoalBossSB1Stomp* stomp = (zNPCGoalBossSB1Stomp*)rawgoal;
566 zNPCB_SB1* sb1 = (zNPCB_SB1*)rawgoal->GetOwner();
567 S32 nextgoal = 0;
568
569 if (stomp->timeInGoal > 1.5f)
570 {
571 xVec3* player_pos = (xVec3*)&globals.player.ent.model->Mat->pos;
572 xVec3* boss_pos = (xVec3*)&sb1->model->Mat->pos;
573 F32 dist = xVec3Dist2(boss_pos, player_pos);
574
575 if (dist > 90.25f)
576 {
577 if (sb1->AnimTimeRemain(NULL) < 1.1f * dt)
578 {
579 nextgoal = NPC_GOAL_BOSSSB1IDLE;
580 *trantype = GOAL_TRAN_SET;
581 }
582 }
583 }
584
585 return nextgoal;
586}
587
588// 91% match, just has a register scheduling issue
589static S32 smashCB(xGoal* rawgoal, void*, en_trantype* trantype, F32 dt, void*)

Callers

nothing calls this directly

Calls 3

xVec3Dist2Function · 0.85
GetOwnerMethod · 0.80
AnimTimeRemainMethod · 0.80

Tested by

no test coverage detected