Downloads containing CandionWars.j2as

Downloads
Name Author Game Mode Rating
JJ2+ Only: The Candion Wars Slaz Battle 7 Download file

File preview

  1. /*** Written or lazily copypasted by Slaz with all important stuff done by Violet CLM ***/
  2. /*** Feel free to use/edit this script like I did :P ***/
  3.  
  4. /*** Eyecandy functions ***/
  5. const array<uint8> gunProfilePics = {0, 83+20+33, 25, 29, 34, 49, 57, 59, 62, 68};
  6. const array<uint8> gunPoweredProfilePics = {0, 18, 24, 28, 33, 48, 56, 59, 61, 67};
  7.  
  8. void onFunction1(jjPLAYER@ play) {
  9.     play.showText("@@@@Your blaster is frozen!@Find explosive icing near candy stashes!");
  10. }
  11.  
  12. void onLevelLoad() {
  13.     jjTexturedBGTexture = TEXTURE::CORRUPTEDSANCTUARY;
  14.     jjTexturedBGFadePositionY = -0.20;
  15.     jjPalette.gradient(0,0,180, 0,0,20, 176, 32);
  16.     jjUseLayer8Speeds = true;
  17.     jjObjectPresets[OBJECT::ICEBULLET].behavior = jjObjectPresets[OBJECT::ICEBULLETPU].behavior = IceUntilDeath;
  18.     jjWeapons[WEAPON::BLASTER].infinite = false;
  19.     jjWeapons[WEAPON::BLASTER].maximum = 0;
  20.     jjWeapons[WEAPON::ICE].maximum = 30;
  21. }
  22.  
  23. bool onDrawAmmo(jjPLAYER@ play, jjCANVAS@ screen) {
  24.     uint8 an;
  25.     if (play.powerup[WEAPON::CURRENT]) an = gunPoweredProfilePics[play.currWeapon];
  26.     else an = gunProfilePics[play.currWeapon];
  27.     if (play.currWeapon == WEAPON::BLASTER && play.charCurr == CHAR::SPAZ) ++an;
  28.     for (int8 i = 0; i < play.ammo[WEAPON::CURRENT]; ++i )
  29.     screen.drawSprite(jjSubscreenWidth - 20 - i*(jjSubscreenWidth/128), jjSubscreenHeight - 20, 0, an, (jjRenderFrame+i)/5, 0, (i+1 == play.ammo[WEAPON::CURRENT]) ? SPRITE::NORMAL : SPRITE::TRANSLUCENT);
  30.     return true;
  31. }
  32.  
  33. /*** Gameplay functions ***/
  34. void onPlayer(jjPLAYER@ play) {
  35.     if (play.ammo[WEAPON::ICE] > 0) play.currWeapon = WEAPON::ICE;
  36. }
  37.  
  38. void IceUntilDeath(jjOBJ@ obj) {
  39.     if (obj.state == STATE::EXPLODE) {
  40.         obj.eventID += 2;
  41.         obj.behavior = BEHAVIOR::RFBULLET;
  42.     }
  43.     else obj.behave(BEHAVIOR::BULLET);
  44. }
  45.  
  46. void onPlayerInput(jjPLAYER@ play) {
  47.     if (play.frozen > 0)
  48.     play.keyFire = false;
  49. }