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

Function xBoulderGenerator_EventCB

src/SB/Core/x/xEntBoulder.cpp:1234–1389  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1232void xBoulderGenerator_GenBoulder(xBoulderGenerator*);
1233
1234S32 xBoulderGenerator_EventCB(xBase* from, xBase* to, U32 toEvent, const F32* toParam,
1235 xBase* toParamWidget)
1236{
1237 xVec3 pnt;
1238
1239 switch (toEvent)
1240 {
1241 case eEventGenerateBoulder:
1242 xBoulderGenerator_GenBoulder((xBoulderGenerator*)to);
1243 break;
1244 case eEventLaunchBoulderAtWidget:
1245 switch (toParamWidget->baseType)
1246 {
1247 case eBaseTypeVillain:
1248 case eBaseTypePlayer:
1249 case eBaseTypePickup:
1250 case eBaseTypePlatform:
1251 case eBaseTypeDoor:
1252 case eBaseTypeStatic:
1253 case eBaseTypeDynamic:
1254 case eBaseTypePendulum:
1255 case eBaseTypeHangable:
1256 case eBaseTypeButton:
1257 case eBaseTypeDestructObj:
1258 case eBaseTypeNPC:
1259 case eBaseTypeBoulder:
1260 {
1261 xVec3Copy(&pnt, (xVec3*)xEntGetPos((xEnt*)toParamWidget));
1262
1263 F32 f0 = 0.0f;
1264 F32 f1 = toParam[1];
1265 F32 f2;
1266 F32 f3;
1267
1268 if (f1 != f0)
1269 {
1270 f1 = xurand();
1271 f0 = 0.5f;
1272 f2 = 2.0f;
1273 f3 = f1 - f0;
1274 f1 = toParam[1];
1275 f0 = pnt.x;
1276 f2 *= f3;
1277 pnt.x = (f1 * f2) + f0;
1278
1279 f1 = xurand();
1280 f0 = 0.5f;
1281 f2 = 2.0f;
1282 f3 = f1 - f0;
1283 f1 = toParam[1];
1284 f2 *= f3;
1285 pnt.y = (f1 * f2) + pnt.y;
1286
1287 f1 = xurand();
1288 f0 = 0.5f;
1289 f2 = 2.0f;
1290 f3 = f1 - f0;
1291 f1 = toParam[1];

Callers

nothing calls this directly

Calls 8

xVec3CopyFunction · 0.85
xEntGetPosFunction · 0.85
xurandFunction · 0.85
zMovePointGetPosFunction · 0.85
xVec3AddScaledFunction · 0.85
xBoulderGenerator_ResetFunction · 0.85
xBoulderGenerator_LaunchFunction · 0.70

Tested by

no test coverage detected