Downloads containing mo4a_4-2.j2as

Downloads
Name Author Game Mode Rating
TSF with JJ2+ Only: Mystery of the Four... chandie Single player 6.6 Download file

File preview

  1. const bool MLLESetupSuccessful = MLLE::Setup(array<MLLEWeaponApply@> = {null, null, WeaponVMega::IceCloud::Weapon(), WeaponVMega::Voranj::Weapon(), WeaponVMega::Backfire::Weapon(), null, ArcaneWeapons::FusionCannon::Weapon(), null, ArcaneWeapons::MortarLauncher::Weapon()}); ///@MLLE-Generated
  2. #include "MLLE-Include-1.5w.asc" ///@MLLE-Generated
  3. #pragma require "mo4a_4-2-MLLE-Data-1.j2l" ///@MLLE-Generated
  4. #pragma require "mo4a_4-2.j2l" ///@MLLE-Generated
  5. #include "ArcaneWeapon4.asc" ///@MLLE-Generated
  6. #pragma require "ArcaneWeapon4.asc" ///@MLLE-Generated
  7. #include "ArcaneWeapon9.asc" ///@MLLE-Generated
  8. #pragma require "ArcaneWeapon9.asc" ///@MLLE-Generated
  9. #include "WeaponVMega5.asc" ///@MLLE-Generated
  10. #pragma require "WeaponVMega5.asc" ///@MLLE-Generated
  11. #include "WeaponVMega8.asc" ///@MLLE-Generated
  12. #pragma require "WeaponVMega8.asc" ///@MLLE-Generated
  13. #include "WeaponVMega3.asc" ///@MLLE-Generated
  14. #pragma require "WeaponVMega3.asc" ///@MLLE-Generated
  15. int slope = 0;
  16. bool Lever13 = false, Lever14 = false, Lever15 = false, Lever16 = false;
  17. bool onDrawAmmo(jjPLAYER@ player, jjCANVAS@ canvas) {
  18.         return MLLE::WeaponHook.drawAmmo(player, canvas);
  19. }
  20.  
  21. #include "Jazz1Enemies v05.asc"
  22. #include "Resize v11.asc"
  23. #include "TrueColor v13.asc"
  24. #include "HH18savegems.asc"
  25.  
  26. void onLevelLoad() {
  27.         gem::restorePlayerGems();
  28.         jjLevelName = ("@@@@@@@@@Path to Mt. Everest");
  29.  
  30.         jjObjectPresets[OBJECT::SILVERCOIN].behavior = PlatinCoin();
  31.         jjObjectPresets[OBJECT::SILVERCOIN].scriptedCollisions = true;
  32.  
  33.         Jazz1::MakeEnemy(OBJECT::SUCKER, Jazz1::Enemies::Holidaius_HandVertical).SetDirection(Jazz1::Directions::Right);
  34.         Jazz1::MakeEnemy(OBJECT::RAVEN, Jazz1::Enemies::Holidaius_Devil).SetUsesJJ2StyleDeathAnimation(true).SetDeathSound(SOUND::BILSBOSS_THUNDER);
  35.         Jazz1::MakeEnemy(OBJECT::FLOATSUCKER, Jazz1::Enemies::Holidaius_HandVertical).SetDirection(Jazz1::Directions::Left);
  36.         Jazz1::MakeEnemy(OBJECT::HATTER, Jazz1::Enemies::Megairbase_Doofusguard).SetUsesJJ2StyleDeathAnimation(true).SetBulletFireSound(SOUND::INTRO_SHOTGRN).SetBulletExplosionSound(SOUND::COMMON_GUNSM1);
  37.  
  38.         jjObjectPresets[OBJECT::SAVEPOST].behavior = CheckpointWrapper;
  39.         jjObjectPresets[OBJECT::SAVEPOST].deactivates = false;
  40.         jjObjectPresets[OBJECT::GRASSPLATFORM].scriptedCollisions = true;
  41.         jjObjectPresets[OBJECT::GRASSPLATFORM].behavior = PlatformH;
  42.         jjObjectPresets[OBJECT::BOLLPLATFORM].scriptedCollisions = true;
  43.         jjObjectPresets[OBJECT::BOLLPLATFORM].behavior = PlatformH2;
  44.  
  45.         jjObjectPresets[OBJECT::FRUITPLATFORM].scriptedCollisions = true;
  46.         jjObjectPresets[OBJECT::FRUITPLATFORM].behavior = Air();
  47.         jjObjectPresets[OBJECT::FRUITPLATFORM].deactivates = false;    
  48.         jjObjectPresets[OBJECT::FRUITPLATFORM].state = STATE::FLOAT;   
  49.  
  50.         jjObjectPresets[OBJECT::SONICPLATFORM].scriptedCollisions = true;
  51.         jjObjectPresets[OBJECT::SONICPLATFORM].behavior = FlyingSpring();      
  52.         jjObjectPresets[OBJECT::SONICPLATFORM].determineCurAnim(ANIM::SPRING,6);
  53. }
  54.  
  55. bool copterfloat = false;
  56.  
  57. class Air : jjBEHAVIORINTERFACE {
  58.  
  59.         void onBehave(jjOBJ@ obj) {
  60.                 obj.behave(BEHAVIOR::BURNING, false);
  61.                 obj.determineCurAnim(ANIM::AMMO,3);
  62.                 obj.deactivates = false;
  63.                 obj.determineCurFrame();
  64.                 ++obj.counter;
  65.                 obj.yPos = jjSin(obj.counter*3 + 5)*2 + obj.yOrg;
  66.                 jjDrawSpriteFromCurFrame(obj.xPos, obj.yPos, obj.curFrame, obj.direction, SPRITE::TRANSLUCENTSINGLEHUE, 64);
  67.         }
  68.         bool onObjectHit(jjOBJ@ obj, jjOBJ@ bullet, jjPLAYER@ player, int force) {
  69.                 if(bullet is null)
  70.                         {copterfloat = true;}
  71.                 return true;
  72.         }
  73. }
  74.  
  75. class PlatinCoin : jjBEHAVIORINTERFACE {
  76.  
  77.         void onBehave(jjOBJ@ obj) {
  78.                 if(p.coins >= 2)
  79.                 {obj.delete();}
  80.                 obj.behave(BEHAVIOR::PICKUP, false);
  81.                 ++obj.counter;
  82.                 obj.yPos = jjSin(obj.counter*15 + 5)*4 + obj.yOrg;
  83.                 jjDrawSpriteFromCurFrame(obj.xPos, obj.yPos, obj.curFrame, obj.direction, SPRITE::PALSHIFT, -8);
  84. }
  85.         bool onObjectHit(jjOBJ@ obj, jjOBJ@ bullet, jjPLAYER@ player, int force) {
  86.                 p.coins += 1;
  87.                 obj.behavior = BEHAVIOR::EXPLOSION2;           
  88.                 jjSample(obj.xPos, obj.yPos, SOUND::COMMON_COIN, 1000);
  89.  
  90.                 return true;
  91.         }
  92. }
  93.  
  94. class FlyingSpring : jjBEHAVIORINTERFACE {
  95.  
  96.         void onBehave(jjOBJ@ obj) {
  97.                 float YSpeed = 22;
  98.                 obj.behave(BEHAVIOR::BUTTERFLY,false);
  99.                 jjDrawSpriteFromCurFrame(obj.xPos, obj.yPos, obj.curFrame, obj.direction, SPRITE::SINGLEHUE, 72);
  100.  
  101.                 jjPARTICLE@ particle = jjAddParticle(PARTICLE::STAR);
  102.                 particle.snow.frame = jjRandom() & 987;
  103.                 particle.xPos = obj.xPos;
  104.                 particle.yPos = obj.yPos+14;
  105.         }
  106.         bool onObjectHit(jjOBJ@ obj, jjOBJ@ bullet, jjPLAYER@ player, int) {
  107.                 if(bullet !is null) {
  108.                 obj.causesRicochet = true;
  109.                 }
  110.                 else
  111.                 player.direction = player.ySpeed = -42;
  112.                 obj.scriptedCollisions = true;
  113.                 jjSample(obj.xPos, obj.yPos, SOUND::COMMON_SPRING1);
  114.                 return true;
  115.                 }
  116. }
  117.  
  118. void PlatformH (jjOBJ@ obj) {
  119.  
  120.         switch (obj.state) {
  121.                 case STATE::START:
  122.                         obj.deactivates = true;
  123.                         obj.direction = obj.xSpeed = -2;               
  124.                         obj.determineCurAnim(ANIM::GRASSPLAT, 0);  
  125.                         obj.determineCurFrame();
  126.                         obj.playerHandling = HANDLING::SPECIAL;
  127.                         obj.state = STATE::FLY;
  128.                         obj.beSolid();
  129.                 case STATE::FLY:
  130.                         if(p.yPos < 29*32) {obj.delete();}
  131.  
  132.                         if(p.yPos > 42*32 && moveplatform == true)
  133.                                 {moveplatform = false;
  134.                                 obj.delete();}
  135.                         if(moveplatform == true)
  136.                                 {obj.xPos = obj.xPos + obj.xSpeed;
  137.                                 if (jjMaskedVLine(obj.xSpeed > 0 ? obj.xPos + 16 : obj.xPos - 16, obj.yPos, 1))
  138.                                         {obj.direction = obj.xSpeed = -obj.xSpeed;}
  139.                         }
  140.                         obj.beSolid();
  141.                         obj.deactivates = false;
  142.                         obj.draw();
  143.  
  144.                         break;
  145.  
  146.         }
  147. }
  148.  
  149. void PlatformH2 (jjOBJ@ obj) {
  150.  
  151.         switch (obj.state) {
  152.                 case STATE::START:
  153.                         obj.deactivates = true;
  154.                         obj.direction = obj.xSpeed = -2;               
  155.                         obj.determineCurAnim(ANIM::GRASSPLAT, 0);  
  156.                         obj.determineCurFrame();
  157.                         obj.playerHandling = HANDLING::SPECIAL;
  158.                         obj.state = STATE::FLY;
  159.                         obj.beSolid();
  160.                 case STATE::FLY:
  161.  
  162.                         if(p.yPos > 22*32 && moveplatform2 == true)
  163.                                 {obj.delete();
  164.                                 moveplatform2 = false;}
  165.                         if(moveplatform2 == true)
  166.                                 {obj.xPos = obj.xPos + obj.xSpeed;
  167.                                 if (jjMaskedVLine(obj.xSpeed > 0 ? obj.xPos + 16 : obj.xPos - 16, obj.yPos, 1))
  168.                                         {obj.direction = obj.xSpeed = -obj.xSpeed;}
  169.                         }
  170.                         obj.beSolid();
  171.                         obj.deactivates = false;
  172.  
  173.                         obj.draw();
  174.  
  175.                         break;
  176.  
  177.         }
  178. }
  179.  
  180. bool moveplatform = false, moveplatform2 = false;
  181.  
  182. void onFunction0(jjPLAYER@ p)
  183. {moveplatform = true;}
  184.  
  185. void onFunction1(jjPLAYER@ p)
  186. {moveplatform = false;}
  187.  
  188. void onFunction2(jjPLAYER@ p)
  189. {moveplatform = true;}
  190.  
  191. void onFunction3(jjPLAYER@ p)
  192. {copterfloat = false;}
  193.  
  194. void onFunction4(jjPLAYER@ p)
  195. {copterfloat = true;}
  196.  
  197. void onFunction5(jjPLAYER@ p) {
  198. slope = jjGameTicks + 2*61;
  199. }
  200. void onFunction6(jjPLAYER@ p) {
  201. slope = 0;
  202. }
  203. void onFunction7(jjPLAYER@ p)
  204. {moveplatform2 = true;}
  205.  
  206. void onLevelReload() {
  207.         MLLE::Palette.apply();
  208.         gem::restorePlayerGems();
  209.         jjLocalPlayers[0].lives++;
  210.         for (uint i = 0; i < 32; ++i)
  211.                 jjTriggers[i] = SavedTriggers[i];
  212. }
  213.  
  214. void onPlayer(jjPLAYER@ p) {
  215.  
  216.         if(p.coins<1 && p.xPos > 78*32 && p.yPos < 2*32)
  217.         {p.testForCoins(1);}
  218.         if(p.coins>=1 && p.xPos >78*32 && p.yPos < 2*32)
  219.         {jjNxt("mo4a_4-3_save", false, true);
  220.         gem::saveGemData();}
  221.  
  222.         if(p.keyUp && Lever15 == false && p.xPos > 25*32 && p.xPos < 28*32 && p.yPos < 38*32 && p.yPos > 27*32)
  223.         {jjTriggers[15] = false;
  224.         Lever15 = true;}
  225.  
  226.         if(p.keyUp && Lever16 == false && p.xPos > 14*32 && p.xPos < 17*32 && p.yPos < 38*32 && p.yPos > 27*32)
  227.         {jjTriggers[16] = false;
  228.         Lever16 = true;}
  229.  
  230.         if(jjTriggers[16] == true)
  231.         {Lever16 = false;}
  232.  
  233.         if(jjTriggers[15] == true)
  234.         {Lever15 = false;}
  235.  
  236.         if(p.keyUp && Lever14 == false && p.xPos > 11*32 && p.xPos < 14*32 && p.yPos < 18*32 && p.yPos > 8*32)
  237.         {jjTriggers[14] = false;
  238.         Lever14 = true;}
  239.  
  240.         if(p.keyUp && Lever13 == false && p.xPos > 22*32 && p.xPos < 25*32 && p.yPos < 18*32 && p.yPos > 8*32)
  241.         {jjTriggers[13] = false;
  242.         Lever13 = true;}
  243.  
  244.         if(jjTriggers[13] == true)
  245.         {Lever13 = false;}
  246.  
  247.         if(jjTriggers[14] == true)
  248.         {Lever14 = false;}
  249.  
  250.         gem::trackPlayerGems(p);
  251.         gem::upgradeHealth(p);
  252.         p.lightType = LIGHT::NONE;
  253.  
  254. if(p.keyUp && slope > jjGameTicks){
  255.         p.yPos = p.yPos - 4;
  256.         p.invisibility = true;
  257.         jjDrawSprite(p.xPos, p.yPos, p.setID, RABBIT::HPOLE, p.curFrame, p.direction, SPRITE::PLAYER);
  258.         }
  259. if(p.keyUp == false && slope > jjGameTicks){
  260.         p.invisibility = false;
  261. }
  262. if(slope < jjGameTicks){
  263.         p.invisibility = false;
  264. }
  265.  
  266. if(copterfloat == true)
  267. {jjCharacters[CHAR::JAZZ].helicopterYSpeed= -2;
  268. jjCharacters[CHAR::LORI].helicopterYSpeed= -2;}
  269. if(copterfloat == false)
  270. {jjCharacters[CHAR::JAZZ].helicopterYSpeed= 1;
  271. jjCharacters[CHAR::LORI].helicopterYSpeed= 1;}
  272. }
  273.  
  274. void onMain() {
  275. gem::deleteCollectedGems();
  276. if(jjKey[9] && jjKey[0x51]) {
  277. p.morphTo(CHAR::JAZZ, false);
  278. }
  279. if(jjKey[9] && jjKey[0x57]) {
  280. p.morphTo(CHAR::SPAZ, false);
  281. }
  282. if(jjKey[9] && jjKey[0x45]) {
  283. p.morphTo(CHAR::LORI, false);
  284. }
  285.  
  286. }
  287.  
  288. bool onDrawHealth(jjPLAYER@ player, jjCANVAS@ canvas) {
  289.  
  290.     return false;
  291. }
  292.  
  293. bool onDrawLives(jjPLAYER@ player, jjCANVAS@ canvas) {return true;}
  294.  
  295. array<bool> SavedTriggers(32, false);
  296. //Extendable Checkpoints by VioletCLM
  297. void CheckpointWrapper(jjOBJ@ obj) {
  298.   if (obj.state == STATE::STOP) { //don't do anything anymore
  299.     jjDrawSpriteFromCurFrame(obj.xPos, obj.yPos, obj.curFrame, obj.direction, SPRITE::PALSHIFT, 8);
  300.   } else if (obj.state == STATE::DEACTIVATE) { //due to death
  301.     obj.deactivate();
  302.   } else {
  303.     obj.behave(BEHAVIOR::CHECKPOINT);
  304.         jjDrawSpriteFromCurFrame(obj.xPos, obj.yPos, obj.curFrame, obj.direction, SPRITE::PALSHIFT, 8);
  305.     if (obj.state == STATE::DONE) { //triggered by the player hitting it
  306.       obj.state = STATE::STOP;
  307.       //save the current state of some properties
  308.       for (uint i = 0; i < 32; ++i)
  309.         SavedTriggers[i] = jjTriggers[i];
  310.  
  311.       //OPTIONAL: this loop makes checkpoints reusable, so only the most recent checkpoint you touched is ever active
  312.       for (int i = jjObjectCount; --i > 0;) {
  313.         jjOBJ@ obj2 = jjObjects[i];
  314.         if (obj2.eventID == OBJECT::CHECKPOINT && i != obj.objectID && obj2.isActive) {
  315.           obj2.state = STATE::SLEEP;
  316.           obj2.var[0] = 0;
  317.         }
  318.       }
  319.     }
  320.   }
  321. }
  322.