Powered-up Fireball on steroids

Version:

2.0

Added on:

14 Feb 2013 18:11

Tags:

Description:
Basing on Violet's code...
jjOBJ@ trail;

/* Purple fireball works just like orange fireball 1.0, by Violet CLM 
   http://www.jazz2online.com/snippets/49/purple-fireball-works-just-like-orange-fireball/ */

void fireballVioletStats() {
  jjObjectPresets[OBJECT::FIREBALLBULLETPU].xSpeed = jjObjectPresets[OBJECT::FIREBALLBULLET].xSpeed;
  jjObjectPresets[OBJECT::FIREBALLBULLETPU].xAcc = jjObjectPresets[OBJECT::FIREBALLBULLET].xAcc;
  jjObjectPresets[OBJECT::FIREBALLBULLETPU].counterEnd = jjObjectPresets[OBJECT::FIREBALLBULLET].counterEnd;
}

void fireballSpecialEffects () {
  //look like a big fireball
  jjObjectPresets[OBJECT::FIREBALLBULLETPU].determineCurAnim(ANIM::BILSBOSS, 3);
  //same, but for shooting upwards
  jjObjectPresets[OBJECT::FIREBALLBULLETPU].special = jjObjectPresets[OBJECT::FIREBALLBULLETPU].determineCurAnim(ANIM::BILSBOSS, 3, false);
  //explode into a red cloud like RFs do
  jjObjectPresets[OBJECT::FIREBALLBULLETPU].killAnim = jjObjectPresets[OBJECT::FIREBALLBULLETPU].determineCurAnim(ANIM::AMMO, 3, false);
  //shine brightly
  jjObjectPresets[OBJECT::FIREBALLBULLETPU].lightType = LIGHT::BRIGHT;
  jjObjectPresets[OBJECT::FIREBALLBULLETPU].light = 8;
}

void onLevelLoad() {
  fireballVioletStats();
  fireballSpecialEffects();
}

void spawnFireTrail(jjOBJ@ obj) {
  @trail = jjObjects[jjAddObject(OBJECT::EXPLOSION, obj.xPos, obj.yPos)];
  trail.determineCurAnim(ANIM::AMMO, 3);
  trail.lightType = LIGHT::POINT;
}

void onMain() {
  for (int i = 1; i < jjObjectCount; i++) {      //for
    if (jjObjects[i].eventID == OBJECT::FIREBALLBULLETPU  //every fireball fired
        && jjObjects[i].objType == 1      //that's still a bullet, and not just the explosion it makes
        && jjObjects[i].counter%3 == 0)
        {
      spawnFireTrail(jjObjects[i]);
        }
  }
}