MCPcopy Create free account
hub / github.com/DescentDevelopers/Descent3 / DoSplinterFrame

Function DoSplinterFrame

Descent3/splinter.cpp:74–89  ·  view source on GitHub ↗

do whatever needs to be done for this piece of splinter for this frame

Source from the content-addressed store, hash-verified

72
73// do whatever needs to be done for this piece of splinter for this frame
74void DoSplinterFrame(object *obj) {
75 ASSERT(obj->control_type == CT_SPLINTER);
76
77 if ((obj->lifeleft <= 0.0) && ((ps_rand() % 2) == 0)) {
78 // Mark the object to die
79 SetObjectDeadFlag(obj);
80 } else {
81 // Create smoke for some splinters
82 if (((obj - Objects) % 8) == 0) {
83 if (ps_rand() % 4) {
84 int type = ((obj - Objects) % 2) ? GetRandomSmallExplosion() : BLACK_SMOKE_INDEX;
85 CreateFireball(&obj->pos, type, obj->roomnum, VISUAL_FIREBALL);
86 }
87 }
88 }
89}

Callers 1

ObjDoFrameFunction · 0.85

Calls 4

ps_randFunction · 0.85
SetObjectDeadFlagFunction · 0.85
GetRandomSmallExplosionFunction · 0.85
CreateFireballFunction · 0.85

Tested by

no test coverage detected