Powered-up Fireball on steroids

Version:

2.0

Added on:

14 Feb 2013 19:11

Tags:

Description:
Basing on Violet's code...
  1. jjOBJ@ trail;
  2.  
  3. /* Purple fireball works just like orange fireball 1.0, by Violet CLM
  4.    http://www.jazz2online.com/snippets/49/purple-fireball-works-just-like-orange-fireball/ */
  5.  
  6. void fireballVioletStats() {
  7.   jjObjectPresets[OBJECT::FIREBALLBULLETPU].xSpeed = jjObjectPresets[OBJECT::FIREBALLBULLET].xSpeed;
  8.   jjObjectPresets[OBJECT::FIREBALLBULLETPU].xAcc = jjObjectPresets[OBJECT::FIREBALLBULLET].xAcc;
  9.   jjObjectPresets[OBJECT::FIREBALLBULLETPU].counterEnd = jjObjectPresets[OBJECT::FIREBALLBULLET].counterEnd;
  10. }
  11.  
  12. void fireballSpecialEffects () {
  13.   //look like a big fireball
  14.   jjObjectPresets[OBJECT::FIREBALLBULLETPU].determineCurAnim(ANIM::BILSBOSS, 3);
  15.   //same, but for shooting upwards
  16.   jjObjectPresets[OBJECT::FIREBALLBULLETPU].special = jjObjectPresets[OBJECT::FIREBALLBULLETPU].determineCurAnim(ANIM::BILSBOSS, 3, false);
  17.   //explode into a red cloud like RFs do
  18.   jjObjectPresets[OBJECT::FIREBALLBULLETPU].killAnim = jjObjectPresets[OBJECT::FIREBALLBULLETPU].determineCurAnim(ANIM::AMMO, 3, false);
  19.   //shine brightly
  20.   jjObjectPresets[OBJECT::FIREBALLBULLETPU].lightType = LIGHT::BRIGHT;
  21.   jjObjectPresets[OBJECT::FIREBALLBULLETPU].light = 8;
  22. }
  23.  
  24. void onLevelLoad() {
  25.   fireballVioletStats();
  26.   fireballSpecialEffects();
  27. }
  28.  
  29. void spawnFireTrail(jjOBJ@ obj) {
  30.   @trail = jjObjects[jjAddObject(OBJECT::EXPLOSION, obj.xPos, obj.yPos)];
  31.   trail.determineCurAnim(ANIM::AMMO, 3);
  32.   trail.lightType = LIGHT::POINT;
  33. }
  34.  
  35. void onMain() {
  36.   for (int i = 1; i < jjObjectCount; i++) {      //for
  37.     if (jjObjects[i].eventID == OBJECT::FIREBALLBULLETPU  //every fireball fired
  38.         && jjObjects[i].objType == 1      //that's still a bullet, and not just the explosion it makes
  39.         && jjObjects[i].counter%3 == 0)
  40.         {
  41.       spawnFireTrail(jjObjects[i]);
  42.         }
  43.   }
  44. }