Downloads containing xlmnewbtl06.j2as

Downloads
Name Author Game Mode Rating
TSF with JJ2+ Only: Anniversary Bash 22 levels Jazz2Online Multiple N/A Download file
TSF with JJ2+ Only: Anniversary Bash 16 Levels Jazz2Online Multiple N/A Download file
JJ2+ Only: Renewed InspirationsFeatured Download Xtreme Level Makers Multiple 9.2 Download file

File preview

  1. int id;
  2. uint limitedOxygen = 0;
  3. uint elapsed = 0;
  4. uint8 istsfint = 0;
  5.  
  6. jjOBJ@ Vendor;
  7.  
  8. array<bool> playerDrowning(4, false);
  9.  
  10. bool onDrawHealth(jjPLAYER@ play, jjCANVAS@ canvas) {
  11.         if (limitedOxygen > 0 && limitedOxygen < 420) {
  12.         canvas.drawSprite(jjSubscreenWidth-12, jjSubscreenHeight-444, ANIM::AMMO, 8, 3, 0, SPRITE::NORMAL, 0); canvas.drawSprite(jjSubscreenWidth-28, jjSubscreenHeight-444, ANIM::AMMO, 8, 3, 0, SPRITE::NORMAL, 0); canvas.drawSprite(jjSubscreenWidth-44, jjSubscreenHeight-444, ANIM::AMMO, 8, 3, 0, SPRITE::NORMAL, 0); canvas.drawSprite(jjSubscreenWidth-60, jjSubscreenHeight-444, ANIM::AMMO, 8, 3, 0, SPRITE::NORMAL, 0);
  13.  canvas.drawSprite(jjSubscreenWidth-76, jjSubscreenHeight-444, ANIM::AMMO, 8, 3, 0, SPRITE::NORMAL, 0);
  14.         }
  15.  
  16.         if (limitedOxygen > 420 && limitedOxygen < 840) {
  17.         canvas.drawSprite(jjSubscreenWidth-12, jjSubscreenHeight-444, ANIM::AMMO, 8, 3, 0, SPRITE::NORMAL, 0); canvas.drawSprite(jjSubscreenWidth-28, jjSubscreenHeight-444, ANIM::AMMO, 8, 3, 0, SPRITE::NORMAL, 0); canvas.drawSprite(jjSubscreenWidth-44, jjSubscreenHeight-444, ANIM::AMMO, 8, 3, 0, SPRITE::NORMAL, 0); canvas.drawSprite(jjSubscreenWidth-60, jjSubscreenHeight-444, ANIM::AMMO, 8, 3, 0, SPRITE::NORMAL, 0);
  18.         }
  19.  
  20.         if (limitedOxygen > 840 && limitedOxygen < 1260) {
  21.         canvas.drawSprite(jjSubscreenWidth-12, jjSubscreenHeight-444, ANIM::AMMO, 8, 3, 0, SPRITE::NORMAL, 0); canvas.drawSprite(jjSubscreenWidth-28, jjSubscreenHeight-444, ANIM::AMMO, 8, 3, 0, SPRITE::NORMAL, 0); canvas.drawSprite(jjSubscreenWidth-44, jjSubscreenHeight-444, ANIM::AMMO, 8, 3, 0, SPRITE::NORMAL, 0);
  22.         }
  23.  
  24.         if (limitedOxygen > 1260 && limitedOxygen < 1680) {
  25.         canvas.drawSprite(jjSubscreenWidth-12, jjSubscreenHeight-444, ANIM::AMMO, 8, 3, 0, SPRITE::NORMAL, 0); canvas.drawSprite(jjSubscreenWidth-28, jjSubscreenHeight-444, ANIM::AMMO, 8, 3, 0, SPRITE::NORMAL, 0);
  26.         }
  27.  
  28.         if (limitedOxygen > 1680 && limitedOxygen < 2100) {
  29.         canvas.drawSprite(jjSubscreenWidth-12, jjSubscreenHeight-444, ANIM::AMMO, 8, 3, 0, SPRITE::NORMAL, 0);
  30.         }
  31.  
  32.         return false;
  33. }
  34.  
  35. void onLevelLoad() {
  36.         jjSetWaterGradient(0, 0, 255, 0, 0, 255);
  37.         jjWaterChangeSpeed = 0;
  38.         jjSetWaterLevel(32*58, true);
  39.         jjWaterLighting = (WATERLIGHT::GLOBAL);
  40.  
  41.         jjWeapons[WEAPON::SEEKER].maximum = 25;
  42.         jjWeapons[WEAPON::GUN8].maximum = 99;
  43.  
  44.         jjObjectPresets[OBJECT::FIREBALLBULLET].special = jjObjectPresets[OBJECT::FIREBALLBULLET].determineCurAnim(ANIM::AMMO, 8);
  45.         jjObjectPresets[OBJECT::FIREBALLBULLET].behavior = BubbleGun;
  46.         jjObjectPresets[OBJECT::FIREBALLBULLET].xSpeed = 2;
  47.         jjObjectPresets[OBJECT::FIREBALLBULLET].ySpeed = 0;
  48.         jjObjectPresets[OBJECT::FIREBALLBULLET].counterEnd = 105;
  49.  
  50.         jjObjectPresets[OBJECT::FIREBALLBULLETPU].special = jjObjectPresets[OBJECT::FIREBALLBULLETPU].determineCurAnim(ANIM::AMMO, 8);
  51.         jjObjectPresets[OBJECT::FIREBALLBULLETPU].behavior = BubbleGunPU;
  52.         jjObjectPresets[OBJECT::FIREBALLBULLETPU].xSpeed = 2;
  53.         jjObjectPresets[OBJECT::FIREBALLBULLETPU].ySpeed = -0.5;
  54.         jjObjectPresets[OBJECT::FIREBALLBULLETPU].counterEnd = 105;
  55.                 jjObjectPresets[OBJECT::EVA].behavior = resized;
  56.         if(jjIsTSF)
  57.         {
  58.     istsfint=1;
  59.         }
  60. }
  61.  
  62. void onLevelBegin() {
  63.         if (jjIsServer) jjChat("/fireball on");
  64.  
  65.         for (int x = 0; x < jjLayerWidth[4]; x++) {
  66.         for (int y = 0; y < jjLayerHeight[4]; y++) {
  67.                  uint16 tile = jjTileGet(4, x, y);
  68.         if (jjEventGet(x, y) == 119) jjTileSet(4, x, y, tile ^ TILE::VFLIPPED);
  69.     }
  70.   }
  71.         int light = jjAddObject(OBJECT::STEADYLIGHT,32*180,32*71);
  72.         int light2 = jjAddObject(OBJECT::STEADYLIGHT,32*42,32*72);
  73.         jjObjects[light].lightType = LIGHT::LASER;
  74.         jjObjects[light].light = 64;
  75.         jjObjects[light2].lightType = LIGHT::LASER;
  76.         jjObjects[light2].light = 64;
  77.                 id=jjAddObject(OBJECT::EVA,32*4,32*15,5);
  78.                 @Vendor=jjObjects[id];
  79.                 Vendor.determineCurAnim(ANIM::JAZZ,36-istsfint*3);
  80.                 Vendor.frameID=0;
  81.                 Vendor.behavior=resized;
  82. }
  83.  
  84.  
  85. void onPlayer(jjPLAYER@ play) {
  86.         p.lighting = 60;
  87.  
  88.         if (play.yPos > jjWaterLevel) {
  89.                 switch(play.shieldType) {
  90.                         case 0: limitedOxygen++; play.shieldTime = 0; play.shieldType = 0; break;
  91.                         case 1: limitedOxygen++; play.shieldTime = 0; play.shieldType = 0; break;
  92.                         case 2: limitedOxygen = 0; break;
  93.                         case 3: limitedOxygen++; play.shieldTime = 0; play.shieldType = 0; break;
  94.                         case 4: limitedOxygen++; play.shieldTime = 0; play.shieldType = 0; break;
  95.                 }
  96.         }
  97.         else if (play.yPos < jjWaterLevel) {
  98.                 limitedOxygen = 0;
  99.                 playerDrowning[play.localPlayerID] = false;
  100.                 elapsed = 0;
  101.         }
  102.  
  103.         jjPARTICLE@ particle = jjAddParticle(PARTICLE::STRING);
  104.         if (particle !is null) {
  105.                 switch(limitedOxygen) {
  106.                         case 1750: particle.xPos = play.xPos; particle.yPos = play.yPos; particle.string.text = "|||5"; particle.ySpeed = -0.05; jjSample(play.xPos, play.yPos, SOUND::AMMO_BLUB1); break;
  107.                         case 1820: particle.xPos = play.xPos; particle.yPos = play.yPos; particle.string.text = "|||4"; particle.ySpeed = -0.05; jjSample(play.xPos, play.yPos, SOUND::AMMO_BLUB1); break;
  108.                         case 1890: particle.xPos = play.xPos; particle.yPos = play.yPos; particle.string.text = "|||3"; particle.ySpeed = -0.05; jjSample(play.xPos, play.yPos, SOUND::AMMO_BLUB1); break;
  109.                         case 1960: particle.xPos = play.xPos; particle.yPos = play.yPos; particle.string.text = "|||2"; particle.ySpeed = -0.05; jjSample(play.xPos, play.yPos, SOUND::AMMO_BLUB1); break;
  110.                         case 2030: particle.xPos = play.xPos; particle.yPos = play.yPos; particle.string.text = "|||1"; particle.ySpeed = -0.05; jjSample(play.xPos, play.yPos, SOUND::AMMO_BLUB1); break;
  111.                         case 2100: particle.xPos = play.xPos; particle.yPos = play.yPos; particle.string.text = "|||0"; particle.ySpeed = -0.05; jjSample(play.xPos, play.yPos, SOUND::AMMO_BLUB1); break;
  112.                         }
  113.                 }
  114.  
  115.         if (limitedOxygen >= 2100) playerDrowning[play.localPlayerID] = true;
  116.         else playerDrowning[play.localPlayerID] = false;
  117.        
  118.         if (playerDrowning[play.localPlayerID] == true) elapsed++;
  119.         else elapsed = 0;
  120.  
  121.         if (elapsed % 70 == 0 && playerDrowning[play.localPlayerID] == true) {
  122.                 play.hurt(1, true);
  123.         }
  124.         else //do nothing
  125.  
  126.         if (limitedOxygen > 0 && jjEventGet(play.xPos/32, play.yPos/32) == OBJECT::BUBBLER || jjEventGet(play.xPos/32, (play.yPos + 32)/32) == OBJECT::BUBBLER || jjEventGet(play.xPos/32, (play.yPos + 64)/32) == OBJECT::BUBBLER || jjEventGet(play.xPos/32, (play.yPos + 96)/32) == OBJECT::BUBBLER) {
  127.                 limitedOxygen = 1;
  128.         }
  129.  
  130.         if (play.health == 0) {
  131.                 limitedOxygen = 0;
  132.                 elapsed = 0;
  133.         }
  134. }
  135.  
  136. void resized(jjOBJ@ obj) {
  137.   obj.determineCurFrame();
  138.   jjDrawSpriteFromCurFrame(obj.xPos, obj.yPos, obj.curFrame, 0, SPRITE::RESIZED, 48);
  139. }
  140.  
  141. void BubbleGun(jjOBJ@ bubble) {
  142.         if (bubble.state == STATE::START) {
  143.                 bubble.state = STATE::FLY;
  144.                 jjSample(bubble.xPos, bubble.yPos, SOUND::COMMON_PLOP2, 0, 0);
  145.         }
  146.  
  147.         bubble.behave(BEHAVIOR::WATERSHIELDBULLET);
  148.  
  149.         if (jjMaskedPixel(bubble.xPos + bubble.xSpeed, bubble.yPos) || jjMaskedPixel(bubble.xPos - bubble.xSpeed, bubble.yPos) || jjMaskedPixel(bubble.xPos, bubble.yPos + bubble.ySpeed) || jjMaskedPixel(bubble.xPos, bubble.yPos - bubble.ySpeed)) {
  150.                 jjSample(bubble.xPos, bubble.yPos, SOUND::P2_SPLOUT, 0, 0);
  151.         }
  152.  
  153.         bubble.killAnim = jjObjectPresets[OBJECT::WATERSHIELDBULLET].killAnim;
  154.  
  155.         bubble.determineCurFrame();
  156.  
  157.         bubble.animSpeed = 1;
  158.         bubble.var[6] = 0;
  159. }
  160.  
  161. void BubbleGunPU(jjOBJ@ bubble) {
  162.         if (bubble.state == STATE::START) {
  163.                 bubble.state = STATE::FLY;
  164.                 jjSample(bubble.xPos, bubble.yPos, SOUND::COMMON_PLOP2, 0, 0);
  165.         }
  166.  
  167.         bubble.behave(BEHAVIOR::WATERSHIELDBULLET);
  168.  
  169.         if (jjMaskedPixel(bubble.xPos + bubble.xSpeed, bubble.yPos) || jjMaskedPixel(bubble.xPos - bubble.xSpeed, bubble.yPos) || jjMaskedPixel(bubble.xPos, bubble.yPos + bubble.ySpeed) || jjMaskedPixel(bubble.xPos, bubble.yPos - bubble.ySpeed)) {
  170.                 jjSample(bubble.xPos, bubble.yPos, SOUND::P2_SPLOUT, 0, 0);
  171.         }
  172.  
  173.         bubble.killAnim = jjObjectPresets[OBJECT::WATERSHIELDBULLET].killAnim;
  174.  
  175.         jjDrawSpriteFromCurFrame(bubble.xPos, bubble.yPos, bubble.curFrame, bubble.direction, SPRITE::NEONGLOW, 2);
  176.         bubble.determineCurFrame();
  177.  
  178.         bubble.animSpeed = 2;
  179.         bubble.var[6] = 8;
  180. }
  181.  
  182. void healPlayer() {
  183.         if (p.health < jjMaxHealth) {
  184.                 switch(p.charCurr)
  185.                 {
  186.                         case CHAR::JAZZ: jjSamplePriority(SOUND::JAZZSOUNDS_JUMMY); break;
  187.                         case CHAR::SPAZ: jjSamplePriority(SOUND::SPAZSOUNDS_HAPPY); break;
  188.                         default: jjSamplePriority(SOUND::COMMON_EAT2); break;
  189.                 }
  190.         p.health = jjMaxHealth;
  191.         p.invincibility = 5*70;
  192.         }
  193. }
  194.  
  195. void bonusBooth40() {
  196.         if (p.testForCoins(40)) {
  197.                 jjSamplePriority(SOUND::COMMON_GLASS2);
  198.                 p.shieldType = 2;
  199.                 p.shieldTime = 30*70;
  200.                 p.showText("@@@@@@####There you go!@Have fun!");
  201.                 healPlayer();
  202.         }
  203. }
  204.  
  205. void bonusBoothText() {
  206.         p.showText("@@@@@####Hey lad!@@I can let you play around with@my super soaker shield gun for@a moment if you pay me just 40 coins!@@I'll heal your wounds too!");
  207.         if (p.testForCoins(40)) {};
  208. }
  209.  
  210. void onFunction0(jjPLAYER@ p, bool offset) {
  211.         p.antiGrav = offset;
  212.  
  213.         if (offset == true) {
  214.                 jjSamplePriority(SOUND::STEAM_STEAM);
  215.                 jjTriggers[1] = true;
  216.         }
  217.         else {
  218.         jjTriggers[1] = false;
  219.         }
  220. }
  221.  
  222. void onFunction1() {
  223.         jjRandom()%2;
  224.         if (jjRandom() % 2 == 0) {
  225.                 p.offsetPosition(64,0);
  226.                 }
  227.         else {
  228.                 p.offsetPosition(32,32);
  229.         }
  230. }
  231.  
  232. void onFunction2() {
  233.         p.warpToTile(188, 9);
  234. }
  235.  
  236. void onFunction3() {
  237.              if (p.coins >= 40) bonusBooth40();
  238.                            else bonusBoothText();
  239. }