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

Method ReconChuck

src/SB/Game/zNPCHazard.cpp:1073–1115  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1071}
1072
1073void NPCHazard::ReconChuck()
1074{
1075 HAZBall* ball = &this->custdata.ball;
1076
1077 xVec3 dir_norm = this->custdata.collide.dir_normal;
1078 xVec3 vel_flight = this->custdata.tartar.vel;
1079
1080 Reconfigure(NPC_HAZ_CHUCKBLAST);
1081
1082 if (xVec3Length2(&dir_norm) > 0.0f)
1083 {
1084 xVec3Copy((xVec3*)&this->mdl_hazard->Mat->up, &dir_norm);
1085 NPCC_MakePerp((xVec3*)&this->mdl_hazard->Mat->at, &dir_norm);
1086 xVec3Cross((xVec3*)&this->mdl_hazard->Mat->right, (xVec3*)&this->mdl_hazard->Mat->up,
1087 (xVec3*)&this->mdl_hazard->Mat->at);
1088
1089 xMat3x3 mat;
1090 xMat3x3Rot(&mat, &dir_norm, 2 * PI * xurand());
1091 xMat3x3Mul(xModelGetFrame(this->mdl_hazard), xModelGetFrame(this->mdl_hazard), &mat);
1092
1093 F32 dot = xVec3Dot(&dir_norm, &g_Y3);
1094
1095 if (FABS(dot) < 0.86f)
1096 {
1097 ball->rad_max *= 0.5f;
1098 ball->rad_min *= 0.5f;
1099 ball->rad_cur *= 0.5f;
1100 }
1101 }
1102
1103 Start(NULL, -1.0f);
1104
1105 if (this->flg_hazard & 0x8 && HAZ_AvailablePool() > 5)
1106 {
1107 for (S32 i = 0; i < 7; i++)
1108 {
1109 if (KickBlooshBlob(&vel_flight))
1110 {
1111 this->flg_hazard |= 0x40;
1112 }
1113 }
1114 }
1115}
1116
1117void NPCHazard::Upd_ChuckBlast(F32 dt)
1118{

Callers

nothing calls this directly

Calls 11

ReconfigureFunction · 0.85
xVec3Length2Function · 0.85
xVec3CopyFunction · 0.85
NPCC_MakePerpFunction · 0.85
xVec3CrossFunction · 0.85
xMat3x3RotFunction · 0.85
xurandFunction · 0.85
xModelGetFrameFunction · 0.85
HAZ_AvailablePoolFunction · 0.85
KickBlooshBlobFunction · 0.85
xMat3x3MulFunction · 0.50

Tested by

no test coverage detected