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

Function CreateFireball

Descent3/fireball.cpp:843–863  ·  view source on GitHub ↗

Creates a fireball and then sets its size

Source from the content-addressed store, hash-verified

841}
842// Creates a fireball and then sets its size
843int CreateFireball(vector *pos, int fireball_num, int roomnum, int realtype) {
844 int objnum;
845
846 ASSERT(roomnum != -1);
847 if (realtype == VISUAL_FIREBALL) // If this is a visual effect then create it instead!
848 return (VisEffectCreate(VIS_FIREBALL, fireball_num, roomnum, pos));
849 else {
850 objnum = ObjCreate(OBJ_FIREBALL, fireball_num, roomnum, pos, NULL);
851 if (objnum < 0) {
852 mprintf(0, "Couldn't create fireball object!\n");
853 return -1;
854 }
855 Objects[objnum].size = Fireballs[fireball_num].size;
856 Objects[objnum].flags |= OF_USES_LIFELEFT;
857
858 Objects[objnum].lifeleft = Fireballs[fireball_num].total_life;
859 Objects[objnum].lifetime = Objects[objnum].lifeleft;
860 }
861
862 return objnum;
863}
864// TODO: MTS: used only in this file.
865// Creates a fireball object with a custom texture/vclip
866int CreateCustomFireballObject(vector *pos, int fireball_num, int tex_handle, int roomnum) {

Callers 13

collide_weapon_and_wallFunction · 0.85
DoSplinterFrameFunction · 0.85
CreateGravityFieldFunction · 0.85
CreateObjectFireballFunction · 0.85
DoDebrisFrameFunction · 0.85
DoDyingFrameFunction · 0.85
DoExplosionFrameFunction · 0.85
DoExplosionEventFunction · 0.85
WeaponDoFrameFunction · 0.85
DoNewPlayerDeathFrameFunction · 0.85
PlayerShipExplodeFunction · 0.85
PlayerShipSpewPartSubFunction · 0.85

Calls 2

VisEffectCreateFunction · 0.85
ObjCreateFunction · 0.85

Tested by

no test coverage detected