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

Function DefeatedCB

src/SB/Game/zEntPlayer.cpp:1945–1970  ·  view source on GitHub ↗

Equivalent: sda relocation meme

Source from the content-addressed store, hash-verified

1943
1944// Equivalent: sda relocation meme
1945static U32 DefeatedCB(xAnimTransition* tran, xAnimSingle* anim, void* param_3)
1946{
1947 player_dead_anim++;
1948
1949 if (gCurrentPlayer == eCurrentPlayerSpongeBob)
1950 {
1951 S32 cheats = zGameExtras_CheatFlags();
1952 if ((cheats & 0x2000000) || xurand() < 0.175f)
1953 {
1954 zShrapnelAsset* deathShrap =
1955 (zShrapnelAsset*)xSTFindAsset(xStrHash("spongebob_shrapnel"), NULL);
1956 if (deathShrap && deathShrap->initCB)
1957 {
1958 xEntHide(&globals.player.ent);
1959 deathShrap->initCB(deathShrap, globals.player.ent.model, NULL, NULL);
1960 globals.player.ent.frame->vel.x = 0.0f;
1961 globals.player.ent.frame->vel.y = 0.0f;
1962 globals.player.ent.frame->vel.z = 0.0f;
1963 globals.player.KnockBackTimer = 0.0f;
1964 globals.player.KnockIntoAirTimer = 0.0f;
1965 }
1966 }
1967 }
1968
1969 return 0;
1970}
1971
1972static U32 SpatulaGrabCheck(xAnimTransition*, xAnimSingle*, void*)
1973{

Callers

nothing calls this directly

Calls 5

zGameExtras_CheatFlagsFunction · 0.85
xurandFunction · 0.85
xEntHideFunction · 0.85
xSTFindAssetFunction · 0.50
xStrHashFunction · 0.50

Tested by

no test coverage detected