Downloads containing xlmhalle.j2as

Downloads
Name Author Game Mode Rating
TSF with JJ2+ Only: Halle der Orgelpfeifen Loon Capture the flag N/A Download file

File preview

  1. const bool MLLESetupSuccessful = MLLE::Setup(array<MLLEWeaponApply@> = {null, null, BubbleGun::Weapon(), null, null, SuperToaster::Weapon(), null, null, null}); ///@MLLE-Generated
  2. #include "MLLE-Include-1.6w.asc" ///@MLLE-Generated
  3. #pragma require "xlmhalle-MLLE-Data-2.j2l" ///@MLLE-Generated
  4. #pragma require "xlmhalle-MLLE-Data-1.j2l" ///@MLLE-Generated
  5. #pragma require "DiambKarstV2.j2t" ///@MLLE-Generated
  6. #pragma require "medwoods.j2t" ///@MLLE-Generated
  7. #pragma require "salem2.j2t" ///@MLLE-Generated
  8. #pragma require "LOONJUNGLEFINALIZED.j2t" ///@MLLE-Generated
  9. #pragma require "medivowoods.j2t" ///@MLLE-Generated
  10. #pragma require "HauntedH1.j2t" ///@MLLE-Generated
  11. #pragma require "xlmhalle.j2l" ///@MLLE-Generated
  12. #include "SuperToaster.asc" ///@MLLE-Generated
  13. #pragma require "SuperToaster.asc" ///@MLLE-Generated
  14. #include "BubbleGun.asc" ///@MLLE-Generated
  15. #pragma require "BubbleGun.asc" ///@MLLE-Generated
  16.  
  17. void onLevelBegin() {
  18.         if(!jjSampleIsLoaded(SOUND::ZDOG_WAF3)) {
  19.                 jjSampleLoad(SOUND::ZDOG_WAF3,"Bell.wav");
  20.         }
  21.         MLLE::SpawnOffgrids();
  22.        
  23.         for (int i = 1; i < 255; i++) {
  24.                 jjOBJ@ preset = jjObjectPresets[i];
  25.                 if (preset.playerHandling == HANDLING::PICKUP) {
  26.                         preset.behavior = CannotBeShotDown(preset.behavior);
  27.                 }
  28.         }
  29.        
  30. }
  31.  
  32. class CannotBeShotDown : jjBEHAVIORINTERFACE {
  33.         CannotBeShotDown(const jjBEHAVIOR &in behavior) {
  34.                 originalBehavior = behavior;
  35.         }
  36.         void onBehave(jjOBJ@ obj) {
  37.                 obj.behave(originalBehavior);
  38.                 if (obj.state == STATE::FLOATFALL)
  39.                         obj.state = STATE::FLOAT;
  40.         }
  41.         bool onObjectHit(jjOBJ@ obj, jjOBJ@ bullet, jjPLAYER@ player, int force) {
  42.                 if (bullet is null) {
  43.                         obj.behavior = originalBehavior;
  44.                         if (player.objectHit(obj, force, obj.playerHandling))
  45.                                 return true;
  46.                         obj.behavior = this;
  47.                 }
  48.                 return false;
  49.         }
  50.         private jjBEHAVIOR originalBehavior;
  51. }
  52.  
  53. void onLevelLoad() {
  54.         jjUseLayer8Speeds = true;
  55.        
  56.         generateCustomSpringSprites(jjAnimSets[ANIM::CUSTOM[9]], array<uint> = {40, 48, 16, 64});
  57.     turnIntoCustomSpring(jjObjectPresets[OBJECT::FROZENSPRING], 0, 19.75f, false);
  58.     turnIntoCustomSpring(jjObjectPresets[OBJECT::HORREDSPRING], 1, 17.75f, false);
  59.     turnIntoCustomSpring(jjObjectPresets[OBJECT::HORGREENSPRING], 2, 26.55f, false);
  60.     turnIntoCustomSpring(jjObjectPresets[OBJECT::HORBLUESPRING], 3, 34.3f, false);
  61.        
  62.         jjObjectPresets[OBJECT::HORREDSPRING].causesRicochet = jjObjectPresets[OBJECT::HORBLUESPRING].causesRicochet = jjObjectPresets[OBJECT::HORGREENSPRING].causesRicochet = false;
  63.        
  64.         jjDelayGeneratedCrateOrigins = true;
  65.        
  66.         jjWeapons[WEAPON::GUN8].spread = SPREAD::NORMAL;
  67.         jjObjectPresets[OBJECT::FIREBALLBULLETPU].var[6] = 8 + 16;
  68.        
  69.         jjObjectPresets[OBJECT::ICEPOWERUP].direction = 0;
  70.         jjObjectPresets[OBJECT::BOUNCERPOWERUP].direction = 0;
  71.         jjObjectPresets[OBJECT::TOASTERPOWERUP].direction = -1;
  72. }
  73.  
  74. void onMain() {
  75. /*      if (!jjLowDetail) {
  76.        
  77.                 if (lightning && lightningDelay > 0) lightningDelay--;
  78.        
  79.                 if (jjGameTicks % 600 >= 575 && jjGameTicks % 600 <= 579) jjSetFadeColors(255,255,255);
  80.                 else if (jjGameTicks % 600 >= 580) {
  81.                         int timer = 600 - jjGameTicks % 600;
  82.                         jjSetFadeColors(15 + timer * 195 / 20, 30 + timer * 180 / 20, 45 + timer * 165 / 20);
  83.                         lightning = true;
  84.                         lightningDelay = 250;
  85.                 }
  86.        
  87.                 if (lightning && lightningDelay == 0) {
  88.                         jjSample(jjLocalPlayers[0].xPos, jjLocalPlayers[0].yPos < jjWaterLevel? jjLocalPlayers[0].yPos : jjWaterLevel, SOUND::BILSBOSS_THUNDER, jjTriggers[30] && jjLocalPlayerCount == 1? 12:42, 0);
  89.                         lightning = false;
  90.                 }
  91.         }
  92. */
  93.  
  94.         array<jjLAYER@> layers = jjLayerOrderGet();
  95.         layers[16].xOffset += .25f;
  96.         layers[14].xOffset += .4f;
  97.                
  98.         jjWeapons[WEAPON::GUN8].comesFromGunCrates = true;
  99.     jjWeapons[WEAPON::GUN9].comesFromGunCrates = true;
  100.        
  101.         for (int i = 1; i < jjObjectCount; i++) {
  102.         jjOBJ@ obj = jjObjects[i];
  103.         if (obj.eventID == OBJECT::ICEBULLETPU && obj.xSpeed > -0.5 && obj.xSpeed < 0.5) {
  104.             obj.xSpeed = 0;
  105.         }
  106.     }
  107. }
  108.        
  109. jjANIMSET@ customSpringSprite;
  110. array<int> fastCustomSpringSpeeds(jjLocalPlayerCount);
  111. bool generateCustomSpringSprites(jjANIMSET@ anim, const array<uint> &in colors) {
  112.     int length = colors.length();
  113.     bool success = (@customSpringSprite = anim).allocate(array<uint>(length * 3, 5)) !is null;
  114.     if (success) {
  115.         uint srcSet = jjAnimSets[ANIM::SPRING];
  116.         for (int i = 0; i < length; i++) {
  117.             uint color = colors[i];
  118.             uint destAnimOffset = anim + i * 3;
  119.             for (int j = 0; j < 3; j++) {
  120.                 uint srcAnim = jjAnimations[srcSet + j];
  121.                 uint destAnim = jjAnimations[destAnimOffset + j];
  122.                 for (int k = 0; k < 5; k++) {
  123.                     jjPIXELMAP image(jjAnimFrames[destAnim + k] = jjAnimFrames[srcAnim + k]);
  124.                     int width = image.width;
  125.                     int height = image.height;
  126.                     for (int l = 0; l < height; l++) {
  127.                         for (int m = 0; m < width; m++) {
  128.                             int pixel = image[m, l];
  129.                             if (pixel >= 32 && pixel < 40)
  130.                                 image[m, l] = color + (pixel & 7);
  131.                         }
  132.                     }
  133.                     if (!image.save(jjAnimFrames[destAnim + k]))
  134.                         return false;
  135.                 }
  136.             }
  137.         }
  138.     }
  139.     return success;
  140. }
  141. void initializeCustomSpring(jjOBJ@ obj) {
  142.     int anim = obj.curAnim;
  143.     obj.behave(obj.behavior = BEHAVIOR::SPRING, false);
  144.     if (obj.curAnim != anim) {
  145.         obj.curAnim = anim + 2;
  146.         obj.determineCurFrame();
  147.     }
  148.     obj.draw();
  149. }
  150.  
  151. void turnIntoCustomSpring(jjOBJ@ obj, uint color, float power, bool horizontal) {
  152.     if (horizontal) {
  153.         obj.xSpeed = power;
  154.         obj.ySpeed = 0.f;
  155.     } else {
  156.         obj.xSpeed = 0.f;
  157.         obj.ySpeed = -power;
  158.         if (obj.state == STATE::START && obj.creatorType == CREATOR::LEVEL) {
  159.             int x = int(obj.xPos) >> 5;
  160.             int y = int(obj.yPos) >> 5;
  161.             if (jjParameterGet(x, y, 0, 1) != 0) {
  162.                 jjParameterSet(x, y, 0, 1, 0);
  163.                 obj.yPos -= 4.f;
  164.                 obj.ySpeed = power;
  165.             }
  166.         }
  167.     }
  168.     obj.behavior = initializeCustomSpring;
  169.     obj.curAnim = customSpringSprite + color * 3 + (horizontal ? 1 : 0);
  170.     obj.energy = obj.frameID = obj.freeze = obj.justHit = obj.light = obj.points = 0;
  171.     obj.isBlastable = obj.isTarget = obj.scriptedCollisions = obj.triggersTNT = false;
  172.     obj.deactivates = obj.isFreezable = true;
  173.     obj.bulletHandling = HANDLING::IGNOREBULLET;
  174.     obj.playerHandling = HANDLING::SPECIAL;
  175.     obj.lightType = LIGHT::NORMAL;
  176.     obj.determineCurFrame();
  177. }
  178.  
  179. void handleFastCustomSpringSpeeds(jjPLAYER@ play) {
  180.         if (play.ySpeed < -32.f) {
  181.                 fastCustomSpringSpeeds[play.localPlayerID] = int(ceil((play.ySpeed + 32.f) / -0.125f));
  182.         } else if (fastCustomSpringSpeeds[play.localPlayerID] != 0) {
  183.                 if (play.ySpeed < -31.f) {
  184.                         fastCustomSpringSpeeds[play.localPlayerID]--;
  185.                         play.ySpeed = -32.f;
  186.                 } else {
  187.                         fastCustomSpringSpeeds[play.localPlayerID] = 0;
  188.                 }
  189.         }
  190. }
  191.  
  192. void onPlayer(jjPLAYER@ play) {
  193.         play.lightType = LIGHT::NONE;
  194.        
  195.         if (!jjLowDetail && jjGameTicks % 1400 == 0) {
  196.                 jjSample(play.xPos, play.yPos, SOUND::ZDOG_WAF3, 25, 0);
  197.         }
  198.        
  199.         handleFastCustomSpringSpeeds(play);
  200.        
  201.         if (jjEventGet(int(play.xPos/32), int(play.yPos/32)) == AREA::PATH) {
  202.                 int direction = jjParameterGet(int(play.xPos/32), int(play.yPos/32), 6, 3);
  203.                 play.buttstomp = 100;
  204.                 if (direction > 1) {
  205.                         if (play.xSpeed > 1) play.xSpeed = -2;
  206.                 } else if (direction == 0) {
  207.                         if (play.xSpeed < 1) play.xSpeed = 2;
  208.                 }
  209.         }
  210. }
  211.  
  212. void onLevelReload() {
  213.         MLLE::SpawnOffgridsLocal();
  214. }
  215.  
  216.  
  217. bool onDrawAmmo(jjPLAYER@ player, jjCANVAS@ canvas) {
  218.         return MLLE::WeaponHook.drawAmmo(player, canvas);
  219. }
  220.