Downloads containing ezhydro.j2as

Downloads
Name Author Game Mode Rating
TSF with JJ2+ Only: Hydroponic ThunDerDraGon Capture the flag N/A Download file

File preview

  1. const bool MLLESetupSuccessful = MLLE::Setup(); ///@MLLE-Generated
  2. #include "MLLE-Include-1.5.asc" ///@MLLE-Generated
  3. #pragma require "ezhydro-MLLE-Data-1.j2l" ///@MLLE-Generated
  4. #pragma require "ezhydro.j2as" ///@MLLE-Generated
  5.  
  6. array<uint8> ids = {
  7.        
  8.           11, 12, 13, 14, 15, 40, 41, 42, 43, 44, 45, 46, 57,163, 176, 177, 178, 179,
  9.           180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196,
  10.                   197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 213, 214, 218, 219, 220, 221, 222, 224, 225, 226, 227, 228, 229, 233, 234, 235, 236, 237, 238, 240, 242
  11. };
  12.  
  13.  
  14. void PaletteSetting(uint hue, uint sat, uint lum) {
  15.         for (uint i = 0; i < ids.length; i++)
  16.                        jjPalette.color[ids[i]].setHSL(
  17.                    jjPalette.color[ids[i]].getHue() - hue,
  18.                    jjPalette.color[ids[i]].getSat() - sat,
  19.                    jjPalette.color[ids[i]].getLight() - lum
  20.                    );
  21.     jjPalette.apply();
  22.        
  23. }
  24.  
  25. void coloredSpring(jjOBJ@ obj) {
  26.         obj.behave(BEHAVIOR::SPRING, false);
  27.         jjDrawSpriteFromCurFrame(obj.xPos, obj.yPos, obj.curFrame, obj.direction, SPRITE::PALSHIFT, 216);
  28. }
  29.  
  30. class ColoredCrate : jjBEHAVIORINTERFACE {
  31.    
  32.     void onBehave(jjOBJ@ obj) {
  33.         obj.behave(obj.eventID == OBJECT::GUNCRATE? BEHAVIOR::CRATE : BEHAVIOR::SHARD);
  34.        
  35.         if (obj.state == STATE::KILL) {
  36.             obj.delete();
  37.         }
  38.     }
  39.     void onDraw(jjOBJ@ obj) {
  40.        
  41.         jjDrawSpriteFromCurFrame(obj.xPos, obj.yPos, obj.curFrame, obj.direction, SPRITE::SINGLEHUE, 40);
  42.     }
  43. }
  44.  
  45. void onLevelLoad() {
  46.        
  47.         jjObjectPresets[OBJECT::ELECTROBULLETPU].eventID = OBJECT::ELECTROBULLET;
  48.        
  49.         jjObjectPresets[OBJECT::GUNCRATE].behavior = ColoredCrate();
  50.         jjObjectPresets[OBJECT::SHARD].behavior = ColoredCrate();
  51.        
  52.         jjUseLayer8Speeds = true;
  53.        
  54.         jjOBJ@ preset = jjObjectPresets[OBJECT::FROZENSPRING];
  55.         preset.behavior = coloredSpring;
  56.         preset.bulletHandling = HANDLING::IGNOREBULLET;
  57.         preset.freeze = 0;
  58.         preset.ySpeed = -18.f;
  59.         preset.xPos = preset.xOrg + 8;
  60.        
  61.         /* jjTexturedBGFadePositionY = 0.3; */
  62.         PaletteSetting(9, 9, 14);
  63.        
  64.         jjWaterLayer = 7;
  65.         jjSetWaterGradient(0,2,4, 0,4,2);
  66.         jjWaterLighting = (WATERLIGHT::GLOBAL);
  67. }
  68.  
  69. void onMain() {
  70.         for (int i = 1; i < jjObjectCount; i++) {
  71.            jjOBJ@ o = jjObjects[i];
  72.            if (o.isActive) {
  73.                if (o.behavior == BEHAVIOR::PICKUP && o.state == STATE::FLOATFALL && o.eventID != OBJECT::FULLENERGY) {
  74.                      o.state = STATE::FLOAT;
  75.                 }
  76.        
  77.                    if (o.eventID == OBJECT::GUN9POWERUP) o.direction = -1;
  78.                    if (o.eventID == OBJECT::RFPOWERUP) o.direction = 0;
  79.            }
  80.         }
  81. }
  82.  
  83. void onDrawLayer7(jjPLAYER@ play, jjCANVAS@ screen) {
  84.         jjSetWaterLevel((play.cameraY - jjLayers[7].getYPosition(play)) + 416, true);
  85. }
  86. void onDrawLayer4(jjPLAYER@ play, jjCANVAS@ screen) {
  87.   jjSetWaterLevel(16000, true);
  88. }
  89.  
  90. /*bool onLocalChat(string &in stringReceived, CHAT::Type chatType) {
  91.        
  92.     array<string> results;
  93.         if (jjRegexMatch(stringReceived,"!palette\\s(\\d+)\\s(\\d+)\\s(\\d+)",results,true)) {
  94.                 int hue = int(abs(parseInt(results[1])));
  95.                 int sat = int(abs(parseInt(results[2])));
  96.                 int lum = int(abs(parseInt(results[3])));
  97.                 if (hue <= 255 && sat <= 255 && lum <= 255) {
  98.                     PaletteSetting(hue, sat, lum);
  99.                 } else jjAlert("|>> Both parameters must not exceed 255");
  100.                 return true;
  101.         }
  102.        
  103.         return false;
  104. }