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

Function LassoStartCB

src/SB/Game/zEntPlayer.cpp:3232–3261  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3230}
3231
3232static U32 LassoStartCB(xAnimTransition*, xAnimSingle*, void* object)
3233{
3234 zEntPlayer_SNDPlay(ePlayerSnd_Heli, 0.0f);
3235 sLassoInfo->swingTarget = NULL;
3236
3237 xEnt* ent = (xEnt*)object;
3238 zNPCCommon* npc = (zNPCCommon*)sLassoInfo->target;
3239 if (sLassoInfo->target->baseType == eBaseTypeNPC && (npc->SelfType() & 0xffffff00) != 'NTT\0')
3240 {
3241 sLassoInfo->targetGuide = 1;
3242 sCurrentNPCInfo = npc->GimmeLassInfo();
3243 npc->LassoNotify(LASS_EVNT_BEGIN);
3244 zLasso_SetGuide(npc, sCurrentNPCInfo->grabGuideAnim);
3245 }
3246 else
3247 {
3248 sLassoInfo->targetGuide = NULL;
3249 }
3250
3251 zLasso_InitTimer(sLasso, 0.125f);
3252 sLasso->flags = 0x12c3;
3253 sLasso->tgRadius = 1.25f;
3254
3255 xVec3AddScaled(&sLasso->crCenter, (xVec3*)&ent->model->Mat->up, 0.5f);
3256 sLassoInfo->lassoRot =
3257 xatan2(sLassoInfo->target->model->Mat->pos.x - globals.player.ent.frame->mat.pos.x,
3258 sLassoInfo->target->model->Mat->pos.z - globals.player.ent.frame->mat.pos.z);
3259
3260 return 0;
3261}
3262
3263// Equivalent
3264static U32 LassoThrowCB(xAnimTransition*, xAnimSingle*, void* object)

Callers

nothing calls this directly

Calls 8

zEntPlayer_SNDPlayFunction · 0.85
zLasso_InitTimerFunction · 0.85
xVec3AddScaledFunction · 0.85
xatan2Function · 0.85
SelfTypeMethod · 0.80
GimmeLassInfoMethod · 0.80
zLasso_SetGuideFunction · 0.70
LassoNotifyMethod · 0.45

Tested by

no test coverage detected