Creates a fireball and then sets its size
| 841 | } |
| 842 | // Creates a fireball and then sets its size |
| 843 | int 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 |
| 866 | int CreateCustomFireballObject(vector *pos, int fireball_num, int tex_handle, int roomnum) { |
no test coverage detected