Downloads containing mo4a_4-1_revisited2.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-1_revisited2-MLLE-Data-1.j2l" ///@MLLE-Generated
  4. #pragma require "mo4a_4-1_revisited2.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.  
  16. int SpeedUpUntil = 0;
  17. #include "Jazz1Enemies v05.asc"
  18. #include "Resize v11.asc"
  19. #include "TrueColor v13.asc"
  20. #include "HH18savegems.asc"
  21. bool Lever8 = false;
  22.  
  23. void onLevelLoad() {
  24.         gem::restorePlayerGems();
  25.         jjLevelName = ("@@@@@@@@@Central Area");
  26.  
  27.         jjObjectPresets[OBJECT::SEEKERAMMO15].behavior = Gwell();
  28.         jjObjectPresets[OBJECT::SEEKERAMMO15].scriptedCollisions = true;
  29.         jjObjectPresets[OBJECT::SEEKERAMMO15].playerHandling = HANDLING::SPECIAL;
  30.  
  31.         jjObjectPresets[OBJECT::SEEKERAMMO3].deactivates = false;
  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.  
  37.         jjObjectPresets[OBJECT::SAVEPOST].behavior = CheckpointWrapper;
  38.         jjObjectPresets[OBJECT::SAVEPOST].deactivates = false;
  39.         jjObjectPresets[OBJECT::GRASSPLATFORM].scriptedCollisions = true;
  40.         jjObjectPresets[OBJECT::GRASSPLATFORM].behavior = PlatformH;
  41.  
  42.         jjObjectPresets[OBJECT::FRUITPLATFORM].scriptedCollisions = true;
  43.         jjObjectPresets[OBJECT::FRUITPLATFORM].behavior = PlatformV;
  44.  
  45.         jjObjectPresets[OBJECT::SONICPLATFORM].scriptedCollisions = true;
  46.         jjObjectPresets[OBJECT::SONICPLATFORM].behavior = FlyingSpring();      
  47.         jjObjectPresets[OBJECT::SONICPLATFORM].determineCurAnim(ANIM::SPRING,6);
  48.  
  49.         jjObjectPresets[OBJECT::PINKPLATFORM].scriptedCollisions = true;
  50.         jjObjectPresets[OBJECT::PINKPLATFORM].behavior = Gong();
  51.  
  52.         jjObjectPresets[OBJECT::CHICKENLEG].behavior = SuperCopter();
  53.         jjObjectPresets[OBJECT::CHICKENLEG].scriptedCollisions = true;
  54.  
  55.         jjObjectPresets[OBJECT::FRIES].behavior = Key();
  56.         jjObjectPresets[OBJECT::FRIES].scriptedCollisions = true;
  57.  
  58.         jjObjectPresets[OBJECT::AIRBOARD].behavior = Chakra();
  59.         jjObjectPresets[OBJECT::AIRBOARD].scriptedCollisions = true;
  60.  
  61.         jjObjectPresets[OBJECT::CHIPS].behavior = Chakra2();
  62.         jjObjectPresets[OBJECT::CHIPS].scriptedCollisions = true;
  63.  
  64.         jjObjectPresets[OBJECT::PRETZEL].behavior = Chakra3();
  65.         jjObjectPresets[OBJECT::PRETZEL].scriptedCollisions = true;
  66.  
  67.         jjObjectPresets[OBJECT::FASTFEET].behavior = Chakra4();
  68.         jjObjectPresets[OBJECT::FASTFEET].scriptedCollisions = true;
  69.  
  70.         jjObjectPresets[OBJECT::WEENIE].behavior = Chakra5();
  71.         jjObjectPresets[OBJECT::WEENIE].scriptedCollisions = true;
  72.  
  73.         jjObjectPresets[OBJECT::FREEZEENEMIES].behavior = Chakra6();
  74.         jjObjectPresets[OBJECT::FREEZEENEMIES].scriptedCollisions = true;
  75.  
  76.         jjObjectPresets[OBJECT::HAM].behavior = Chakra7();
  77.         jjObjectPresets[OBJECT::HAM].scriptedCollisions = true;
  78.  
  79.         jjObjectPresets[OBJECT::STOPWATCH].behavior = Fastrun();
  80.         jjObjectPresets[OBJECT::STOPWATCH].scriptedCollisions = true;
  81.  
  82.         jjObjectPresets[OBJECT::EVA].behavior = TimeMachine;
  83.         jjObjectPresets[OBJECT::EVA].determineCurAnim(ANIM::FLAG, 1);
  84.         jjObjectPresets[OBJECT::EVA].putOnGround(false);
  85.         jjObjectPresets[OBJECT::EVA].scriptedCollisions = true;
  86.         jjANIMATION@ tmAnim = jjAnimations[jjObjectPresets[OBJECT::EVA].curAnim];
  87.         for (uint i = 0; i < tmAnim.frameCount; ++i)
  88.                 jjAnimFrames[tmAnim.firstFrame + i].coldSpotY = -44;
  89.         for (uint i = 0; i < tmAnim.frameCount; ++i)
  90.                 jjAnimFrames[tmAnim.firstFrame + i].hotSpotY = -64;
  91.         for (uint i = 0; i < tmAnim.frameCount; ++i)
  92.                 jjAnimFrames[tmAnim.firstFrame + i].hotSpotX = -54;
  93.  
  94.         jjObjectPresets[OBJECT::FLYCARROT].determineCurAnim(ANIM::PLUS_WARP, 0);
  95.         jjObjectPresets[OBJECT::FLYCARROT].behavior = Bonus;
  96.         jjObjectPresets[OBJECT::FLYCARROT].scriptedCollisions = true;
  97.         jjANIMATION@ BAnim = jjAnimations[jjObjectPresets[OBJECT::FLYCARROT].curAnim];
  98.         for (uint i = 0; i < BAnim.frameCount; ++i)
  99.                 jjAnimFrames[BAnim.firstFrame + i].hotSpotX = 20;
  100.  
  101.         jjObjectPresets[OBJECT::INVINCIBILITY].determineCurAnim(ANIM::PLUS_WARP, 1);
  102.         jjObjectPresets[OBJECT::INVINCIBILITY].behavior = Bonuseye;
  103.         jjObjectPresets[OBJECT::INVINCIBILITY].scriptedCollisions = true;
  104.         jjObjectPresets[OBJECT::INVINCIBILITY].bulletHandling = HANDLING::IGNOREBULLET;
  105.         jjObjectPresets[OBJECT::INVINCIBILITY].playerHandling = HANDLING::PLAYERBULLET;
  106.         jjANIMATION@ BeAnim = jjAnimations[jjObjectPresets[OBJECT::INVINCIBILITY].curAnim];
  107.  
  108.         for (uint i = 0; i < BeAnim.frameCount; ++i)
  109.                 jjAnimFrames[BeAnim.firstFrame + i].hotSpotY = 27;
  110.         for (uint i = 0; i < BeAnim.frameCount; ++i)
  111.                 jjAnimFrames[BeAnim.firstFrame + i].hotSpotX = 26;
  112.  
  113. }
  114.  
  115. void Bonuseye(jjOBJ@ obj){
  116.         obj.direction = -1;
  117.         obj.behave(BEHAVIOR::PICKUP, false);
  118.         obj.draw();
  119. }
  120. void Bonus(jjOBJ@ obj){
  121.         obj.putOnGround();
  122.         obj.direction = -1;
  123.         obj.behave(BEHAVIOR::PICKUP, false);
  124.         obj.draw();
  125. }
  126.  
  127.  
  128. void TimeMachine(jjOBJ@ obj){
  129.         obj.behave(BEHAVIOR::EVA, false);
  130.                         jjDrawResizedSpriteFromCurFrame(obj.xPos, obj.yPos, obj.curFrame, 1, 1, SPRITE::PALSHIFT, 8);
  131.  
  132. }
  133.  
  134. bool gateopen = false, leveldone = false;
  135.  
  136. class Gong : jjBEHAVIORINTERFACE {
  137.         void onBehave(jjOBJ@ obj){
  138.  
  139.         obj.playerHandling = HANDLING::SPECIAL;
  140.                 obj.energy = 2;
  141.                 if(obj.energy == 0)
  142.                 {obj.energy += 1;}
  143.                 jjANIMATION@ anim = jjAnimations[jjObjectPresets[OBJECT::PINKPLATFORM].curAnim];
  144.                 anim.frameCount = 1;
  145.                 jjANIMFRAME@ frame = jjAnimFrames[anim.firstFrame];
  146.                 jjPIXELMAP lamp(0, 25*32, 4*32, 4*32, 5);
  147.                 lamp.save(frame);
  148.                 frame.hotSpotX = -42;
  149.                 obj.behave(BEHAVIOR::BUMP, false);
  150.         if(obj.justHit == 0)
  151.         {jjDrawSpriteFromCurFrame(obj.xPos, obj.yPos, obj.curFrame, obj.direction, SPRITE::BRIGHTNESS, 180);}
  152.         else    obj.draw();
  153.         }
  154.         bool onObjectHit(jjOBJ@ obj, jjOBJ@ bullet, jjPLAYER@ play, int force) {
  155.                 if(bullet.xPos > obj.xPos)
  156.                 {bullet.delete();}
  157.         obj.bulletHandling = HANDLING::HURTBYBULLET;
  158.                 if(play !is null && bullet !is null && gateopen==true && leveldone == false)
  159.                 {jjMusicStop();
  160.                 leveldone = true;
  161.                 jjSample(p.xPos, p.yPos, SOUND::STONED_STONED);
  162.                 jjTriggers[1] = true;
  163.                 p.showText("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@Temple Gate unlocked.");}
  164.  
  165.                 return true;
  166.         }
  167. }
  168.  
  169. class Gwell : jjBEHAVIORINTERFACE {
  170.  
  171.         void onBehave(jjOBJ@ obj) {
  172.                 if(p.ammo[WEAPON::SEEKER] > 1)
  173.                 {obj.delete();}
  174.                 obj.behave(BEHAVIOR::MONITOR); 
  175.         }
  176.         bool onObjectHit(jjOBJ@ obj, jjOBJ@ bullet, jjPLAYER@ play, int force) {
  177.                 if(bullet !is null && play !is null)
  178.                         {obj.behave(BEHAVIOR::EXPLOSION2);
  179.                         jjAddObject(OBJECT::SEEKERAMMO3, 81*32, 38*32);
  180.                         jjAddObject(OBJECT::SEEKERAMMO3, 82*32, 38*32);
  181.                         jjAddObject(OBJECT::SEEKERAMMO3, 83*32, 38*32);
  182.                         jjAddObject(OBJECT::SEEKERAMMO3, 81*32, 39*32);                
  183.                         jjAddObject(OBJECT::SEEKERAMMO3, 82*32, 39*32);
  184.                         jjAddObject(OBJECT::SEEKERAMMO3, 83*32, 39*32);
  185.                         jjSample(p.xPos, p.yPos, SOUND::COMMON_HARP1, 1000);}
  186.                 return true;
  187.         }
  188.        
  189. }
  190.  
  191. int SuperCopterOn = 0;
  192. class SuperCopter : jjBEHAVIORINTERFACE {
  193.         void onBehave(jjOBJ@ obj) {
  194.  
  195. obj.behave(BEHAVIOR::PICKUP, false);
  196. obj.determineCurAnim(ANIM::PICKUPS, 33);
  197. ++obj.counter;
  198.                 obj.yPos = jjSin(obj.counter*15 + 5)*4 + obj.yOrg;
  199.  
  200.                 jjDrawSpriteFromCurFrame(obj.xPos, obj.yPos, obj.curFrame, obj.direction, SPRITE::PALSHIFT, -8);
  201.  
  202. }
  203.  
  204.         bool onObjectHit(jjOBJ@ obj, jjOBJ@, jjPLAYER@ play, int force) {
  205.                 play.timerStart(240);
  206.                 p.morphTo(CHAR::JAZZ);
  207.                 SuperCopterOn= jjGameTicks + 4 * 61;
  208.                 obj.behavior = BEHAVIOR::EXPLOSION2;
  209.                 obj.frameID = 0;
  210.                 jjSample(obj.xPos, obj.yPos, SOUND::COMMON_PICKUP1, 6000);
  211.  
  212.                 return true;
  213.         }
  214.  
  215. }
  216.  
  217. class FlyingSpring : jjBEHAVIORINTERFACE {
  218.  
  219.         void onBehave(jjOBJ@ obj) {
  220.                 float YSpeed = 22;
  221.                 obj.behave(BEHAVIOR::BUTTERFLY,false);
  222.                 jjDrawSpriteFromCurFrame(obj.xPos, obj.yPos, obj.curFrame, obj.direction, SPRITE::SINGLEHUE, 72);
  223.  
  224.                 jjPARTICLE@ particle = jjAddParticle(PARTICLE::STAR);
  225.                 particle.snow.frame = jjRandom() & 987;
  226.                 particle.xPos = obj.xPos;
  227.                 particle.yPos = obj.yPos+14;
  228.         }
  229.         bool onObjectHit(jjOBJ@ obj, jjOBJ@, jjPLAYER@ player, int) {
  230.                 player.direction = player.ySpeed = -42;
  231.                 obj.scriptedCollisions = true;
  232.                 jjSample(obj.xPos, obj.yPos, SOUND::COMMON_SPRING1);
  233.                 return true;
  234.                 }
  235. }
  236.  
  237.  
  238. class Fastrun : jjBEHAVIORINTERFACE {
  239.         void onBehave(jjOBJ@ obj) {
  240.  
  241. obj.behave(BEHAVIOR::PICKUP, false);
  242. obj.determineCurAnim(ANIM::PICKUPS, 33);
  243. ++obj.counter;
  244.                 obj.yPos = jjSin(obj.counter*15 + 5)*4 + obj.yOrg;
  245.  
  246.                 jjDrawSpriteFromCurFrame(obj.xPos, obj.yPos, obj.curFrame, obj.direction, SPRITE::PALSHIFT, -32);
  247.  
  248. }
  249.  
  250.         bool onObjectHit(jjOBJ@ obj, jjOBJ@, jjPLAYER@ play, int force) {
  251.         play.timerStart(2100);
  252.                 SpeedUpUntil = jjGameTicks + 31 * 61;
  253.                 obj.behavior = BEHAVIOR::EXPLOSION2;
  254.                 obj.frameID = 0;
  255.                 jjSample(obj.xPos, obj.yPos, SOUND::COMMON_PICKUP1, 6000);
  256.  
  257.                 return true;
  258.         }
  259.  
  260. }
  261.  
  262. class Key : jjBEHAVIORINTERFACE {
  263.  
  264.         void onBehave(jjOBJ@ obj) {
  265.                 obj.behave(BEHAVIOR::PICKUP, false);
  266.         jjANIMATION@ anim = jjAnimations[jjObjectPresets[OBJECT::FRIES].curAnim];
  267.         anim.frameCount = 1;
  268.         jjANIMFRAME@ frame = jjAnimFrames[anim.firstFrame];
  269.         jjPIXELMAP pump(0, 18*32, 1*32, 1*32, 5);
  270.         pump.save(frame);
  271.                 ++obj.counter;
  272.                 obj.yPos = jjSin(obj.counter*15 + 5)*4 + obj.yOrg;
  273.                 jjDrawSpriteFromCurFrame(obj.xPos, obj.yPos, obj.curFrame, obj.direction, SPRITE::NORMAL);
  274. }
  275.         bool onObjectHit(jjOBJ@ obj, jjOBJ@ bullet, jjPLAYER@ player, int force) {
  276.                 jjSwitchTrigger(2);
  277.                 obj.behavior = BEHAVIOR::EXPLOSION2;
  278.                 jjSample(obj.xPos, obj.yPos, SOUND::MENUSOUNDS_TYPEENTER, 1000);
  279.  
  280.                 return true;
  281.         }
  282. }
  283.  
  284.  
  285. class Chakra : jjBEHAVIORINTERFACE {
  286.  
  287.         void onBehave(jjOBJ@ obj) {
  288.                 obj.behave(BEHAVIOR::PICKUP, false);
  289.         jjANIMATION@ anim = jjAnimations[jjObjectPresets[OBJECT::AIRBOARD].curAnim];
  290.         anim.frameCount = 1;
  291.         jjANIMFRAME@ frame = jjAnimFrames[anim.firstFrame];
  292.         jjPIXELMAP pump(0, 11*32, 1*32, 1*32, 5);
  293.         pump.save(frame);
  294.                 ++obj.counter;
  295.                 obj.yPos = jjSin(obj.counter*15 + 5)*4 + obj.yOrg;
  296.                 jjDrawSpriteFromCurFrame(obj.xPos, obj.yPos, obj.curFrame, obj.direction, SPRITE::NORMAL);
  297. }
  298.         bool onObjectHit(jjOBJ@ obj, jjOBJ@ bullet, jjPLAYER@ player, int force) {
  299.                 jjSwitchTrigger(11);
  300.                 obj.behavior = BEHAVIOR::EXPLOSION2;
  301.                 jjSample(obj.xPos, obj.yPos, SOUND::MENUSOUNDS_TYPEENTER, 1000);
  302.  
  303.                 return true;
  304.         }
  305. }
  306.  
  307. class Chakra2 : jjBEHAVIORINTERFACE {
  308.  
  309.         void onBehave(jjOBJ@ obj) {
  310.                 obj.behave(BEHAVIOR::PICKUP, false);
  311.         jjANIMATION@ anim = jjAnimations[jjObjectPresets[OBJECT::CHIPS].curAnim];
  312.         anim.frameCount = 1;
  313.         jjANIMFRAME@ frame = jjAnimFrames[anim.firstFrame];
  314.         jjPIXELMAP pump(0, 12*32, 1*32, 1*32, 5);
  315.         pump.save(frame);
  316.                 ++obj.counter;
  317.                 obj.yPos = jjSin(obj.counter*15 + 5)*4 + obj.yOrg;
  318.                 jjDrawSpriteFromCurFrame(obj.xPos, obj.yPos, obj.curFrame, obj.direction, SPRITE::NORMAL);
  319. }
  320.         bool onObjectHit(jjOBJ@ obj, jjOBJ@ bullet, jjPLAYER@ player, int force) {
  321.                 jjSwitchTrigger(1);
  322.                 obj.behavior = BEHAVIOR::EXPLOSION2;
  323.                 jjSample(obj.xPos, obj.yPos, SOUND::MENUSOUNDS_TYPEENTER, 1000);
  324.  
  325.                 return true;
  326.         }
  327. }
  328.  
  329. class Chakra3 : jjBEHAVIORINTERFACE {
  330.  
  331.         void onBehave(jjOBJ@ obj) {
  332.                 obj.behave(BEHAVIOR::PICKUP, false);
  333.         jjANIMATION@ anim = jjAnimations[jjObjectPresets[OBJECT::PRETZEL].curAnim];
  334.         anim.frameCount = 1;
  335.         jjANIMFRAME@ frame = jjAnimFrames[anim.firstFrame];
  336.         jjPIXELMAP pump(0, 13*32, 1*32, 1*32, 5);
  337.         pump.save(frame);
  338.                 ++obj.counter;
  339.                 obj.yPos = jjSin(obj.counter*15 + 5)*4 + obj.yOrg;
  340.                 jjDrawSpriteFromCurFrame(obj.xPos, obj.yPos, obj.curFrame, obj.direction, SPRITE::NORMAL);
  341. }
  342.         bool onObjectHit(jjOBJ@ obj, jjOBJ@ bullet, jjPLAYER@ player, int force) {
  343.                 jjSwitchTrigger(10);
  344.                 obj.behavior = BEHAVIOR::EXPLOSION2;
  345.                 jjSample(obj.xPos, obj.yPos, SOUND::MENUSOUNDS_TYPEENTER, 1000);
  346.  
  347.                 return true;
  348.         }
  349. }
  350.  
  351. class Chakra4 : jjBEHAVIORINTERFACE {
  352.  
  353.         void onBehave(jjOBJ@ obj) {
  354.                 obj.behave(BEHAVIOR::PICKUP, false);
  355.         jjANIMATION@ anim = jjAnimations[jjObjectPresets[OBJECT::FASTFEET].curAnim];
  356.         anim.frameCount = 1;
  357.         jjANIMFRAME@ frame = jjAnimFrames[anim.firstFrame];
  358.         jjPIXELMAP pump(0, 14*32, 1*32, 1*32, 5);
  359.         pump.save(frame);
  360.                 ++obj.counter;
  361.                 obj.yPos = jjSin(obj.counter*15 + 5)*4 + obj.yOrg;
  362.                 jjDrawSpriteFromCurFrame(obj.xPos, obj.yPos, obj.curFrame, obj.direction, SPRITE::NORMAL);
  363. }
  364.         bool onObjectHit(jjOBJ@ obj, jjOBJ@ bullet, jjPLAYER@ player, int force) {
  365.                 jjSwitchTrigger(8);
  366.                 obj.behavior = BEHAVIOR::EXPLOSION2;
  367.                 jjSample(obj.xPos, obj.yPos, SOUND::MENUSOUNDS_TYPEENTER, 1000);
  368.  
  369.                 return true;
  370.         }
  371. }
  372.  
  373. class Chakra5 : jjBEHAVIORINTERFACE {
  374.  
  375.         void onBehave(jjOBJ@ obj) {
  376.                 obj.behave(BEHAVIOR::PICKUP, false);
  377.         jjANIMATION@ anim = jjAnimations[jjObjectPresets[OBJECT::WEENIE].curAnim];
  378.         anim.frameCount = 1;
  379.         jjANIMFRAME@ frame = jjAnimFrames[anim.firstFrame];
  380.         jjPIXELMAP pump(0, 15*32, 1*32, 1*32, 5);
  381.         pump.save(frame);
  382.                 ++obj.counter;
  383.                 obj.yPos = jjSin(obj.counter*15 + 5)*4 + obj.yOrg;
  384.                 jjDrawSpriteFromCurFrame(obj.xPos, obj.yPos, obj.curFrame, obj.direction, SPRITE::NORMAL);
  385. }
  386.         bool onObjectHit(jjOBJ@ obj, jjOBJ@ bullet, jjPLAYER@ player, int force) {
  387.                 jjSwitchTrigger(9);
  388.                 obj.behavior = BEHAVIOR::EXPLOSION2;
  389.                 jjSample(obj.xPos, obj.yPos, SOUND::MENUSOUNDS_TYPEENTER, 1000);
  390.  
  391.                 return true;
  392.         }
  393. }
  394.  
  395. class Chakra6 : jjBEHAVIORINTERFACE {
  396.  
  397.         void onBehave(jjOBJ@ obj) {
  398.                 obj.behave(BEHAVIOR::PICKUP, false);
  399.         jjANIMATION@ anim = jjAnimations[jjObjectPresets[OBJECT::FREEZEENEMIES].curAnim];
  400.         anim.frameCount = 1;
  401.         jjANIMFRAME@ frame = jjAnimFrames[anim.firstFrame];
  402.         jjPIXELMAP pump(0, 16*32, 1*32, 1*32, 5);
  403.         pump.save(frame);
  404.                 ++obj.counter;
  405.                 obj.yPos = jjSin(obj.counter*15 + 5)*4 + obj.yOrg;
  406.                 jjDrawSpriteFromCurFrame(obj.xPos, obj.yPos, obj.curFrame, obj.direction, SPRITE::NORMAL);
  407. }
  408.         bool onObjectHit(jjOBJ@ obj, jjOBJ@ bullet, jjPLAYER@ player, int force) {
  409.                 jjSwitchTrigger(12);
  410.                 obj.behavior = BEHAVIOR::EXPLOSION2;
  411.                 jjSample(obj.xPos, obj.yPos, SOUND::MENUSOUNDS_TYPEENTER, 1000);
  412.  
  413.                 return true;
  414.         }
  415. }
  416.  
  417. class Chakra7 : jjBEHAVIORINTERFACE {
  418.  
  419.         void onBehave(jjOBJ@ obj) {
  420.                 obj.behave(BEHAVIOR::PICKUP, false);
  421.         jjANIMATION@ anim = jjAnimations[jjObjectPresets[OBJECT::HAM].curAnim];
  422.         anim.frameCount = 1;
  423.         jjANIMFRAME@ frame = jjAnimFrames[anim.firstFrame];
  424.         jjPIXELMAP pump(0, 13*32, 1*32, 1*32, 5);
  425.         pump.save(frame);
  426.                 ++obj.counter;
  427.                 obj.yPos = jjSin(obj.counter*15 + 5)*4 + obj.yOrg;
  428.                 jjDrawSpriteFromCurFrame(obj.xPos, obj.yPos, obj.curFrame, obj.direction, SPRITE::NORMAL);
  429. }
  430.         bool onObjectHit(jjOBJ@ obj, jjOBJ@ bullet, jjPLAYER@ player, int force) {
  431.                 gateopen = true;
  432.                 obj.behavior = BEHAVIOR::EXPLOSION2;
  433.                 jjSample(obj.xPos, obj.yPos, SOUND::MENUSOUNDS_TYPEENTER, 1000);
  434.                 p.showText("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@All artifacts collected.");
  435.                 return true;
  436.         }
  437. }
  438.  
  439. void PlatformH (jjOBJ@ obj) {
  440.  
  441.         switch (obj.state) {
  442.                 case STATE::START:
  443.                         obj.direction = obj.xSpeed = -2;
  444.                         obj.determineCurAnim(ANIM::GRASSPLAT, 0);  
  445.                         obj.determineCurFrame();
  446.                         obj.playerHandling = HANDLING::SPECIAL;
  447.                         obj.state = STATE::FLY;
  448.                         obj.beSolid();
  449.                 case STATE::FLY:
  450.                         obj.xPos = obj.xPos + obj.xSpeed;
  451.                         obj.beSolid();
  452.                         obj.deactivates = false;
  453.                         if (jjMaskedVLine(obj.xSpeed > 0 ? obj.xPos + 16 : obj.xPos - 16, obj.yPos, 1)) {
  454.                                 obj.direction = obj.xSpeed = -obj.xSpeed;
  455.                         }
  456.                         obj.draw();
  457.  
  458.                         break;
  459.  
  460.         }
  461. }
  462.  
  463.  
  464.  
  465. void PlatformV (jjOBJ@ obj) {
  466.  
  467.         switch (obj.state) {
  468.                 case STATE::START:
  469.                         obj.direction = obj.ySpeed = -2;
  470.                         obj.determineCurAnim(ANIM::GRASSPLAT, 0);  
  471.                         obj.determineCurFrame();
  472.                         obj.playerHandling = HANDLING::SPECIAL;
  473.                         obj.state = STATE::FLY;
  474.                         obj.beSolid();
  475.                 case STATE::FLY:
  476.                         obj.yPos = obj.yPos + obj.ySpeed;
  477.                         obj.beSolid();
  478.                         obj.deactivates = false;
  479.                         if (jjMaskedVLine(obj.xSpeed > 0 ? obj.xPos + 62 : obj.xPos - 32, obj.yPos, 1)) {
  480.                                 obj.direction = obj.ySpeed = -obj.ySpeed;
  481.                         }
  482.                         obj.draw();
  483.  
  484.                         break;
  485.  
  486.         }
  487. }
  488.  
  489. void onLevelReload() {
  490.         gem::restorePlayerGems();
  491.         jjLocalPlayers[0].lives++;
  492.         buyammo = false;
  493.         for (uint i = 0; i < 32; ++i)
  494.                 jjTriggers[i] = SavedTriggers[i];
  495. }
  496.  
  497.  
  498. void onMain() {
  499. gem::deleteCollectedGems();
  500. if(jjKey[9] && jjKey[0x51]) {
  501. p.morphTo(CHAR::JAZZ, false);
  502. }
  503. if(jjKey[9] && jjKey[0x57]) {
  504. p.morphTo(CHAR::SPAZ, false);
  505. }
  506. if(jjKey[9] && jjKey[0x45]) {
  507. p.morphTo(CHAR::LORI, false);
  508. }
  509.  
  510. }
  511.  
  512. int slope = 0;
  513.  
  514.  
  515. void onFunction1(jjPLAYER@ p) {
  516.         p.showText("@@@@@@@@@@@@@@@@@@@@@@@@@MT. EVEREST", STRING::MEDIUM);
  517.         jjEnabledASFunctions[0] = false;}
  518.  
  519.  
  520. void onFunction5(jjPLAYER@ p) {
  521. slope = jjGameTicks + 2*61;
  522. }
  523. void onFunction6(jjPLAYER@ p) {
  524. slope = 0;
  525. }
  526.  
  527. void onFunction11(jjPLAYER@ p) {
  528. if(jjIsTSF == true)
  529.         jjNxt("mo4a_save5", false, true);
  530.  
  531. if(jjIsTSF == false)
  532.         jjNxt("mo4a_save5_123", false, true);
  533.         gem::saveGemData();
  534. }
  535.  
  536. void onFunction10(jjPLAYER@ p) {
  537. p.cameraUnfreeze();
  538. }
  539.  
  540. bool doorunblocked = false;
  541. bool buyammo = false;
  542.  
  543. void onPlayer(jjPLAYER@ p) {
  544.         gem::trackPlayerGems(p);
  545.         gem::upgradeHealth(p);
  546. p.lightType = LIGHT::NONE;
  547. if(p.coins == 0)
  548. {p.coins += 3;}
  549.  
  550.         if(p.ammo[WEAPON::SEEKER] < 1 && p.xPos>66*32 && p.xPos<70*32 && p.yPos<44*32 && p.yPos>40*32 && jjKey[0x50] && p.gems[GEM::RED]<50 && buyammo == false)
  551.                 {p.testForGems(50, GEM::RED);}
  552.         if(p.ammo[WEAPON::SEEKER] < 1 && p.xPos>66*32 && p.xPos<70*32 && p.yPos<44*32 && p.yPos>40*32 && jjKey[0x50] && p.gems[GEM::RED]>=50 && buyammo == false)
  553.         {p.testForGems(50, GEM::RED);
  554.         jjTriggers[3]=true;
  555.         buyammo = true;}
  556.  
  557.                 if (doorunblocked == false && jjTriggers[1]==true && jjTriggers[8]==true && jjTriggers[9]==true && jjTriggers[10]==true&& jjTriggers[11]==true && jjTriggers[12]==true) {
  558.                 p.showText("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@Gold Token unlocked.");
  559.                 doorunblocked = true;}
  560.  
  561. if(p.keyUp && slope > jjGameTicks){
  562.         p.yPos = p.yPos - 4;
  563.         p.invisibility = true;
  564.         jjDrawSprite(p.xPos, p.yPos, p.setID, RABBIT::HPOLE, p.curFrame, p.direction, SPRITE::PLAYER);
  565.         }
  566. if(p.keyUp == false && slope > jjGameTicks){
  567.         p.invisibility = false;
  568. }
  569. if(slope < jjGameTicks){
  570.         p.invisibility = false;
  571. }
  572.  
  573.         if(p.keyUp && Lever8 == false && p.xPos > 221*32 && p.xPos < 224*32 && p.yPos < 38*32 && p.yPos > 35*32)
  574.         {jjTriggers[8] = true;
  575.         Lever8 = true;}
  576.  
  577.         if(SuperCopterOn > jjGameTicks)
  578.         {jjCharacters[CHAR::JAZZ].helicopterYSpeed= 0;}
  579.         if(SuperCopterOn < jjGameTicks)
  580.         {jjCharacters[CHAR::JAZZ].helicopterYSpeed= 1;}
  581.  
  582. if (SpeedUpUntil > jjGameTicks) {
  583. p.keyRun = true;
  584. if(p.keyRight)
  585. p.xSpeed = 30;
  586. if(p.keyLeft)
  587. p.xSpeed = -30;
  588.   }
  589.  
  590.  
  591. }
  592. bool budhaannounced = false;
  593.  
  594. void onFunction12(jjPLAYER@ p) {
  595.         if(budhaannounced == false)
  596.         {p.showText("@@@@@@@@@@@@@@@@@@@@@@@@@TEMPLE OF BUDDHA", STRING::MEDIUM);}
  597. p.cameraFreeze(115*32, 43*32, true, false);
  598. budhaannounced = true;
  599. }
  600.  
  601.  
  602. bool onDrawHealth(jjPLAYER@ player, jjCANVAS@ canvas) {
  603.  
  604.     return false;
  605. }
  606.  
  607. bool onDrawLives(jjPLAYER@ player, jjCANVAS@ canvas) {return true;}
  608.  
  609. array<bool> SavedTriggers(32, false);
  610. //Extendable Checkpoints by VioletCLM
  611. void CheckpointWrapper(jjOBJ@ obj) {
  612.   if (obj.state == STATE::STOP) { //don't do anything anymore
  613.     jjDrawSpriteFromCurFrame(obj.xPos, obj.yPos, obj.curFrame, obj.direction, SPRITE::PALSHIFT, 8);
  614.   } else if (obj.state == STATE::DEACTIVATE) { //due to death
  615.     obj.deactivate();
  616.   } else {
  617.     obj.behave(BEHAVIOR::CHECKPOINT);
  618.         jjDrawSpriteFromCurFrame(obj.xPos, obj.yPos, obj.curFrame, obj.direction, SPRITE::PALSHIFT, 8);
  619.     if (obj.state == STATE::DONE) { //triggered by the player hitting it
  620.       obj.state = STATE::STOP;
  621.       //save the current state of some properties
  622.       for (uint i = 0; i < 32; ++i)
  623.         SavedTriggers[i] = jjTriggers[i];
  624.  
  625.       //OPTIONAL: this loop makes checkpoints reusable, so only the most recent checkpoint you touched is ever active
  626.       for (int i = jjObjectCount; --i > 0;) {
  627.         jjOBJ@ obj2 = jjObjects[i];
  628.         if (obj2.eventID == OBJECT::CHECKPOINT && i != obj.objectID && obj2.isActive) {
  629.           obj2.state = STATE::SLEEP;
  630.           obj2.var[0] = 0;
  631.         }
  632.       }
  633.     }
  634.   }
  635. }
  636.  
  637.  
  638. jjTEXTAPPEARANCE SignTextAppearance = STRING::NORMAL;
  639. class Sign {
  640.         private int xPos, yPos; //These pixel-based positions will be generated from tile-based positions in the constructor by multiplying by 32
  641.         private string text;
  642.         private uint widthOfText;
  643.         Sign(){} //AngelScript requires any class that appears in any array to have an explicit default constructor, even if it's never called
  644.         Sign(int xTile, int yTile, const string &in t) {
  645.                 xPos = xTile * 32; //Since this is a constant operation, it could strictly be performed in the draw method instead of the constructor, but this way involves fewer multiplication instructions
  646.                 yPos = yTile * 32; //
  647.                 text = t;
  648.                 SignTextAppearance.newline = STRING::SPECIALSIGN; //Causes the drawString method to interpret instances of the \n character as signals to drop down to a new line, similar to the special effect of the @ character in the STRING::SPIN appearance.
  649.                 SignTextAppearance.spacing = -2; //int jjTEXTAPPEARANCE::spacing is new in 5.2, and this particular value is equivalent to prefixing the string with "ยง2". Make sure to check out bool jjTEXTAPPEARANCE::monospace too, though it didn't end up getting used in this level.
  650.                 widthOfText = jjGetStringWidth(text, STRING::SMALL, SignTextAppearance); //Used for determining how large of a dark rectangle should be drawn behind the text. A matching heightOfText value could of course be generated by counting the number of newline characters--for example, "heightOfText = text.split("\n").length * 20;"--but here the rectangles are constant height instead to limit the temptation to ramble on and on.
  651.         }
  652.         void draw(jjCANVAS@ layer, uint8 textIntensity) const { //Because this method will be called from an onDraw method, it's important to have a jjCANVAS@ passed among the arguments.
  653.                 layer.drawRectangle(xPos, yPos - 16, widthOfText + 8, 55, 0, SPRITE::TRANSLUCENT);
  654.                 layer.drawString(xPos, yPos, text, STRING::SMALL, SignTextAppearance, 0, SPRITE::BLEND_HARDLIGHT, textIntensity);
  655.         }
  656. }
  657. const array<Sign> Signs = {
  658.         Sign(53, 41, "Demons are\ngone for good."),
  659.         Sign(168, 7, "There will always be obstacles\nin your path..."),
  660.         Sign(7, 66, "It's been a tough ride.\nNow let's go back."),
  661.         Sign(49, 61, "Demons are\ngone for good."),
  662.         Sign(68, 40, "Press P if you'd like to\nbuy Gravity Well for 50 Gems."),
  663.         Sign(118, 50, "You have a kind heart, stranger.\nThank you for saving our lands."),
  664. };
  665.  
  666. void onDrawLayer3(jjPLAYER@, jjCANVAS@ layer) {
  667.         if(jjKey[0x54]){
  668.         const uint8 textIntensity = 200 + int(jjSin(jjGameTicks * 16) * 50);
  669.         for (uint signID = 0; signID < Signs.length; ++signID)
  670.                 Signs[signID].draw(layer, textIntensity);
  671. }
  672. }
  673. bool onDrawAmmo(jjPLAYER@ player, jjCANVAS@ canvas) {
  674.         return MLLE::WeaponHook.drawAmmo(player, canvas);
  675. }
  676.