Downloads containing mlperc.j2as

Downloads
Name Author Game Mode Rating
TSF with JJ2+ Only: Percolator cooba 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 "Top3.j2t" ///@MLLE-Generated
  4. #pragma require "mlperc.j2l" ///@MLLE-Generated
  5.  
  6. #pragma offer "SExmas.j2a"
  7.  
  8. /*******************************
  9. A 2019 Mystic Legends Release!
  10. http://www.mysticlegends.org
  11. /******************************/
  12.  
  13. const int WATER_HIGH = 1228;
  14. const int WATER_LOW  = 1582;
  15.  
  16. const uint16 COFFEE_TINT_COLOR = 183;
  17.  
  18. class Imitation : jjBEHAVIORINTERFACE {
  19.         private uint8 eventID;
  20.         private jjBEHAVIOR behavior;
  21.         Imitation(uint8 realEventID, uint8 fakeEventID) {
  22.                 jjOBJ@ obj = jjObjectPresets[realEventID];
  23.                 eventID = obj.eventID;
  24.                 behavior = obj.behavior;
  25.                 obj.eventID = fakeEventID;
  26.                 obj.behavior = this;
  27.         }
  28.         void onBehave(jjOBJ@ obj) override {
  29.                 if (obj.state == STATE::DEACTIVATE)
  30.                         obj.eventID = eventID;
  31.                 obj.behave(behavior, false);
  32.                
  33.                 int frame = obj.objectID * 8 + jjGameTicks;
  34.                 frame = (frame + int(obj.xPos) + int(obj.yPos) * 256)*16;              
  35.                 if (obj.ySpeed == 0) {
  36.                         jjDrawSpriteFromCurFrame(obj.xPos, obj.yPos + jjSin(frame)*4, obj.curFrame, obj.direction, obj.yPos > jjWaterLevel? SPRITE::TINTED : SPRITE::NORMAL, COFFEE_TINT_COLOR);
  37.                 }
  38.                 else jjDrawSpriteFromCurFrame(obj.xPos, obj.yPos + jjSin(frame)*4, obj.curFrame, obj.direction, obj.yPos > jjWaterLevel? SPRITE::TINTED : SPRITE::NORMAL, COFFEE_TINT_COLOR);
  39.         }
  40. }
  41.  
  42. void DrownedPickup(jjOBJ@ obj) {
  43.         obj.behave(BEHAVIOR::PICKUP, false);
  44.        
  45.         int frame = obj.objectID * 8 + jjGameTicks;
  46.         frame = (frame + int(obj.xPos) + int(obj.yPos) * 256)*16;              
  47.         if (obj.ySpeed == 0) {
  48.                 jjDrawSpriteFromCurFrame(obj.xPos, obj.yPos + jjSin(frame)*4, obj.curFrame, obj.direction, obj.yPos > jjWaterLevel? SPRITE::TINTED : SPRITE::NORMAL, COFFEE_TINT_COLOR);
  49.         }
  50.         else jjDrawSpriteFromCurFrame(obj.xPos, obj.yPos + jjSin(frame)*4, obj.curFrame, obj.direction, obj.yPos > jjWaterLevel? SPRITE::TINTED : SPRITE::NORMAL, COFFEE_TINT_COLOR);
  51. }
  52.  
  53. void onLevelLoad() {
  54.         //jjSetWaterLevel(WATERLEVEL, true);
  55.         jjSetWaterGradient(138,106,70, 79,61,40);
  56.        
  57.         Imitation(OBJECT::TACO, OBJECT::MILK);
  58.         uint src = jjAnimSets[ANIM::CUSTOM[255]].load(0, "SExmas.j2a");
  59.         uint dest = jjAnimSets[ANIM::PICKUPS];
  60.         for (int i = 0; i < 95; i++) {
  61.                 const jjANIMATION@ anim = jjAnimations[src + i];
  62.                 if (anim.frameCount != 0)
  63.                         jjAnimations[dest + i] = anim;
  64.         }
  65.        
  66.         jjObjectPresets[OBJECT::BOUNCERAMMO3].behavior =
  67.         jjObjectPresets[OBJECT::ICEAMMO3].behavior =
  68.         jjObjectPresets[OBJECT::SEEKERAMMO3].behavior =
  69.         jjObjectPresets[OBJECT::TOASTERAMMO3].behavior =
  70.         jjObjectPresets[OBJECT::GUN8AMMO3].behavior =
  71.         jjObjectPresets[OBJECT::GUN9AMMO3].behavior =
  72.         jjObjectPresets[OBJECT::CARROT].behavior =
  73.         jjObjectPresets[OBJECT::FULLENERGY].behavior = DrownedPickup;
  74.        
  75.         jjWeapons[WEAPON::GUN8].comesFromGunCrates = true;
  76.         jjWeapons[WEAPON::GUN8].spread = SPREAD::NORMAL;
  77.         jjObjectPresets[OBJECT::FIREBALLBULLETPU].var[6] = 8 + 16;
  78. }
  79.  
  80. void onPlayer(jjPLAYER@ play) {
  81.         if (play.food > 0) play.food = 0;
  82.        
  83.         if (!play.isSpectating ) {
  84.                 if (play.xPos > 45*32 && play.xPos < 117*32) {
  85.                         jjSetWaterLevel(WATER_LOW, true);
  86.                 }
  87.                 else {
  88.                         jjSetWaterLevel(WATER_HIGH, true);
  89.                 }
  90.         } else {
  91.                 if (play.cameraX > 40*32 && play.cameraX < 107*32) {
  92.                         jjSetWaterLevel(WATER_LOW, true);
  93.                 }
  94.                 else {
  95.                         jjSetWaterLevel(WATER_HIGH, true);
  96.                 }
  97.         }
  98. }
  99.  
  100. void onMain() {
  101.         jjLayers[1].yOffset = jjWaterLevel * -1;
  102.         jjWaterLayer = 8;
  103. }