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

Function CreateObjectFireball

Descent3/fireball.cpp:1214–1221  ·  view source on GitHub ↗

Creates a fireball vis effect for the specified object The explosion size is based on the object size times the size_scale The fireball type will be randomly selected based on the explosion size Returns the visnum of the fireball

Source from the content-addressed store, hash-verified

1212// The fireball type will be randomly selected based on the explosion size
1213// Returns the visnum of the fireball
1214int CreateObjectFireball(object *objp, float size_scale) {
1215 int expl_type = GetRandomExplosion(objp->size * size_scale);
1216 float expl_size = objp->size * size_scale * 2.0;
1217 int fireball_visnum = CreateFireball(&objp->pos, expl_type, objp->roomnum, VISUAL_FIREBALL);
1218 if (fireball_visnum >= 0)
1219 VisEffects[fireball_visnum].size = expl_size;
1220 return fireball_visnum;
1221}
1222// -------------------------------------------------------------------------------------------------------
1223// do whatever needs to be done for this piece of debris for this frame
1224void DoDebrisFrame(object *obj) {

Callers 3

DoDebrisFrameFunction · 0.85
DestroyObjectFunction · 0.85
KillObjectFunction · 0.85

Calls 2

GetRandomExplosionFunction · 0.85
CreateFireballFunction · 0.85

Tested by

no test coverage detected