Downloads containing ab23btl20.j2as

Downloads
Name Author Game Mode Rating
TSF with JJ2+ Only: Anniversary Bash 23 levels Jazz2Online Multiple N/A Download file

File preview

  1. const bool MLLESetupSuccessful = MLLE::Setup(array<MLLEWeaponApply@> = {null, SzmolWeaponPack::PetrolBomb::Weapon(), null, null, null, null, null, null, null}); ///@MLLE-Generated
  2. #include "MLLE-Include-1.5w.asc" ///@MLLE-Generated
  3. #pragma require "ab23btl20.j2l" ///@MLLE-Generated
  4. #include "petrolBomb.asc" ///@MLLE-Generated
  5. #pragma require "petrolBomb.asc" ///@MLLE-Generated
  6.  
  7. #pragma require "MegaM123P.j2t"
  8.  
  9. /*******************************
  10. A 2020 Mystic Legends Release!
  11. http://www.mysticlegends.org
  12. /******************************/
  13.  
  14. void onLevelLoad() {
  15.         jjPAL pink;
  16.         pink.load("MegaM123P.j2t");
  17.         jjPalette.copyFrom(10, 86, 10, pink, 0.65f);
  18.         jjPalette.apply();
  19.        
  20.         jjLayers[4].generateSettableTileArea();
  21.        
  22.         jjObjectPresets[OBJECT::TNTAMMO3].determineCurAnim(ANIM::AMMO, 1);
  23.         jjObjectPresets[OBJECT::TNTAMMO3].determineCurFrame();
  24.         jjObjectPresets[OBJECT::TNTAMMO3].direction = SPRITE::FLIPH;
  25.        
  26.         jjObjectPresets[OBJECT::TNTAMMO3].behavior = FallingItem;
  27.        
  28.         jjUseLayer8Speeds = true;
  29. }
  30.  
  31. void onLevelBegin() {
  32.         jjPAL standard;
  33.         standard.load("Diam2.j2t");
  34.         jjPalette.copyFrom(16, 40, 16, standard, 1);
  35.         jjPalette.copyFrom(59, 37, 59, standard, 1);
  36.         jjPalette.apply();
  37. }
  38.  
  39. void onPlayer(jjPLAYER@ play) {
  40.         play.cameraFreeze(0, 0, false, true);  
  41.         play.noFire = (play.currWeapon == WEAPON::BLASTER);
  42.        
  43.         jjWeapons[WEAPON::BOUNCER].maximum =
  44.         jjWeapons[WEAPON::TNT].maximum = 1;
  45. }
  46.  
  47. void FallingItem(jjOBJ@ obj) {
  48.         if (obj.state == STATE::FLOAT) obj.state = STATE::FLOATFALL;
  49.         obj.behave(BEHAVIOR::PICKUP);
  50. }
  51.  
  52. //Lots of very old, obsoleted code follows from here on. Tread carefully!
  53. //Consult an actual coder if you want to implement some of these features
  54.  
  55. void destroyTileAt(float X, float Y, int angle) {
  56.         int16 xTile = int16(X / 32);
  57.         int16 yTile = int16(Y / 32);
  58.  
  59.         uint16 tileToDestroy = jjTileGet(4, xTile, yTile);
  60.         if (tileToDestroy > 0) {
  61.                 jjAddParticleTileExplosion(xTile, yTile, 34, false);
  62.                 jjSample((xTile/32), (yTile/32), SOUND::COMMON_DAMPED1);
  63.         }
  64.         jjTileSet(3, xTile, yTile, 0);
  65.         jjTileSet(4, xTile, yTile, 0);
  66.         jjTileSet(5, xTile, yTile, 0);
  67. }
  68.  
  69. //Foly's bomb
  70.  
  71. /***Constants***/
  72. const float cBombSpeed = 8; //xSpeed of the bomb
  73. const float cBombPlayerSpeed = 6; //xSpeed the bomb can gain by player speed (if a player is running full speed it will add 6 xSpeed)
  74. const int cBombLifeTime = 70*2; //Time till the bomb explodes (run away! run away!!!1)
  75.  
  76. /***Other functions***/
  77. void CreateBomb(int objectID) {
  78.   int playerID = jjObjects[objectID].creator - 32768;
  79.   int bombID = jjAddObject(OBJECT::APPLE, jjPlayers[playerID].xPos, jjPlayers[playerID].yPos, jjPlayers[playerID].playerID, CREATOR::PLAYER);
  80.   jjObjects[bombID].objType = 3;
  81.   jjObjects[bombID].determineCurAnim(ANIM::AMMO, 1, true);
  82.   jjObjects[bombID].special = 11;
  83.   jjObjects[bombID].xSpeed = cBombSpeed*jjPlayers[playerID].direction + cBombPlayerSpeed*jjPlayers[playerID].xSpeed/16;
  84.   jjObjects[bombID].ySpeed = -3;
  85. }
  86.  
  87. const array<string> WildScreamsOfJoyAtExplosions = {
  88.         "FUCKYEAH",
  89.         "BOEM",
  90.         "WHOOOOO",
  91.         "BANG",
  92.         "FUCK OFF",
  93.         "YEEAAHHH",
  94.         "HAHAHA"
  95.         "WEUW"
  96. };
  97.  
  98. void DestroyBomb(int bombID) {
  99.         int explosionID = jjAddObject(OBJECT::TNT, jjObjects[bombID].xPos, jjObjects[bombID].yPos, jjObjects[bombID].creator, CREATOR::PLAYER);
  100.         //jjDeleteObject(bombID);
  101.         jjObjects[explosionID].determineCurAnim(ANIM::AMMO, 1, true);
  102.         jjObjects[explosionID].killAnim = ANIM::AMMO;
  103.         jjObjects[explosionID].state = STATE::EXPLODE;
  104.  
  105.         destroyTileAt(jjObjects[bombID].xPos, jjObjects[bombID].yPos, 256);
  106.         for (int angle = 0; angle < 1024; angle += 32) {
  107.                 destroyTileAt(jjObjects[bombID].xPos + 10 + jjSin(angle) * 32, jjObjects[bombID].yPos + 10 + jjCos(angle) * 32, angle);
  108.                 destroyTileAt(jjObjects[bombID].xPos + 10 + jjSin(angle) * 64, jjObjects[bombID].yPos + 10 + jjCos(angle) * 64, angle);
  109.         }
  110.        
  111.         jjPARTICLE@ particle = jjAddParticle(PARTICLE::STRING);
  112.         if (particle !is null) {
  113.                 particle.xPos = jjObjects[bombID].xPos - 16;
  114.                 particle.yPos = jjObjects[bombID].yPos;
  115.                 particle.string.text = WildScreamsOfJoyAtExplosions[jjRandom()%8];
  116.                 particle.ySpeed = -3;          
  117.         }
  118.        
  119.         jjDeleteObject(bombID);
  120. }
  121.  
  122. /***Gameplay functions***/
  123. void onMain() {
  124.   for (int i = 0;  i < jjObjectCount; i++)
  125.     if (jjObjects[i].isActive && jjObjects[i].creatorType == CREATOR::PLAYER) {
  126.       //Create bomb
  127.       if (jjObjects[i].eventID == OBJECT::TNT && jjObjects[i].state != STATE::EXPLODE) {
  128.         jjDeleteObject(i);
  129.         CreateBomb(i);
  130.         continue;
  131.       }
  132.    
  133.       //Destroy bomb
  134.       if (jjObjects[i].eventID == OBJECT::APPLE && jjObjects[i].special == 11) {
  135.         jjObjects[i].age++;
  136.         if (jjObjects[i].age > cBombLifeTime)
  137.           DestroyBomb(i);
  138.         continue;
  139.       }
  140.     }
  141. }
  142. bool onDrawAmmo(jjPLAYER@ player, jjCANVAS@ canvas) {
  143.         return MLLE::WeaponHook.drawAmmo(player, canvas);
  144. }
  145.  
  146. void onReceive(jjSTREAM&in packet, int fromClientID) {
  147.         MLLE::WeaponHook.processPacket(packet, fromClientID);
  148. }
  149.