Downloads containing mo4a_4-1_revisited1.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_revisited1-MLLE-Data-1.j2l" ///@MLLE-Generated
  4. #pragma require "mo4a_4-1_revisited1.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 SpeedUpUntil = 0;
  16. #include "Jazz1Enemies v05.asc"
  17. #include "Resize v11.asc"
  18. #include "TrueColor v13.asc"
  19. #include "HH18savegems.asc"
  20. bool Lever8 = false;
  21.  
  22. void onLevelLoad() {
  23.         gem::restorePlayerGems();
  24.         jjLevelName = ("@@@@@@@@@Central Area");
  25.  
  26.         jjObjectPresets[OBJECT::SEEKERAMMO15].behavior = Gwell();
  27.         jjObjectPresets[OBJECT::SEEKERAMMO15].scriptedCollisions = true;
  28.         jjObjectPresets[OBJECT::SEEKERAMMO15].playerHandling = HANDLING::SPECIAL;
  29.  
  30.         jjObjectPresets[OBJECT::SEEKERAMMO3].deactivates = false;
  31.  
  32.         Jazz1::MakeEnemy(OBJECT::SUCKER, Jazz1::Enemies::Holidaius_HandVertical).SetDirection(Jazz1::Directions::Right);
  33.         Jazz1::MakeEnemy(OBJECT::RAVEN, Jazz1::Enemies::Holidaius_Devil).SetUsesJJ2StyleDeathAnimation(true).SetDeathSound(SOUND::BILSBOSS_THUNDER);
  34.         Jazz1::MakeEnemy(OBJECT::FLOATSUCKER, Jazz1::Enemies::Holidaius_HandVertical).SetDirection(Jazz1::Directions::Left);
  35.  
  36.         jjObjectPresets[OBJECT::SAVEPOST].behavior = CheckpointWrapper;
  37.         jjObjectPresets[OBJECT::SAVEPOST].deactivates = false;
  38.         jjObjectPresets[OBJECT::GRASSPLATFORM].scriptedCollisions = true;
  39.         jjObjectPresets[OBJECT::GRASSPLATFORM].behavior = PlatformH;
  40.  
  41.         jjObjectPresets[OBJECT::FRUITPLATFORM].scriptedCollisions = true;
  42.         jjObjectPresets[OBJECT::FRUITPLATFORM].behavior = PlatformV;
  43.  
  44.         jjObjectPresets[OBJECT::SONICPLATFORM].scriptedCollisions = true;
  45.         jjObjectPresets[OBJECT::SONICPLATFORM].behavior = FlyingSpring();      
  46.         jjObjectPresets[OBJECT::SONICPLATFORM].determineCurAnim(ANIM::SPRING,6);
  47.  
  48.         jjObjectPresets[OBJECT::PINKPLATFORM].scriptedCollisions = true;
  49.         jjObjectPresets[OBJECT::PINKPLATFORM].behavior = Gong();
  50.  
  51.         jjObjectPresets[OBJECT::CHICKENLEG].behavior = SuperCopter();
  52.         jjObjectPresets[OBJECT::CHICKENLEG].scriptedCollisions = true;
  53.  
  54.         jjObjectPresets[OBJECT::STOPWATCH].behavior = Fastrun();
  55.         jjObjectPresets[OBJECT::STOPWATCH].scriptedCollisions = true;
  56.  
  57.         jjObjectPresets[OBJECT::SILVERCOIN].behavior = PlatinCoin();
  58.         jjObjectPresets[OBJECT::SILVERCOIN].scriptedCollisions = true;
  59.  
  60.         jjObjectPresets[OBJECT::EVA].behavior = TimeMachine;
  61.         jjObjectPresets[OBJECT::EVA].determineCurAnim(ANIM::FLAG, 1);
  62.         jjObjectPresets[OBJECT::EVA].putOnGround(false);
  63.         jjObjectPresets[OBJECT::EVA].scriptedCollisions = true;
  64.         jjANIMATION@ tmAnim = jjAnimations[jjObjectPresets[OBJECT::EVA].curAnim];
  65.         for (uint i = 0; i < tmAnim.frameCount; ++i)
  66.                 jjAnimFrames[tmAnim.firstFrame + i].coldSpotY = -44;
  67.         for (uint i = 0; i < tmAnim.frameCount; ++i)
  68.                 jjAnimFrames[tmAnim.firstFrame + i].hotSpotY = -64;
  69.         for (uint i = 0; i < tmAnim.frameCount; ++i)
  70.                 jjAnimFrames[tmAnim.firstFrame + i].hotSpotX = -54;
  71.  
  72.         jjObjectPresets[OBJECT::FLYCARROT].determineCurAnim(ANIM::PLUS_WARP, 0);
  73.         jjObjectPresets[OBJECT::FLYCARROT].behavior = Bonus;
  74.         jjObjectPresets[OBJECT::FLYCARROT].scriptedCollisions = true;
  75.         jjANIMATION@ BAnim = jjAnimations[jjObjectPresets[OBJECT::FLYCARROT].curAnim];
  76.         for (uint i = 0; i < BAnim.frameCount; ++i)
  77.                 jjAnimFrames[BAnim.firstFrame + i].hotSpotX = 20;
  78.  
  79.         jjObjectPresets[OBJECT::INVINCIBILITY].determineCurAnim(ANIM::PLUS_WARP, 1);
  80.         jjObjectPresets[OBJECT::INVINCIBILITY].behavior = Bonuseye;
  81.         jjObjectPresets[OBJECT::INVINCIBILITY].scriptedCollisions = true;
  82.         jjObjectPresets[OBJECT::INVINCIBILITY].bulletHandling = HANDLING::IGNOREBULLET;
  83.         jjObjectPresets[OBJECT::INVINCIBILITY].playerHandling = HANDLING::PLAYERBULLET;
  84.         jjANIMATION@ BeAnim = jjAnimations[jjObjectPresets[OBJECT::INVINCIBILITY].curAnim];
  85.  
  86.         for (uint i = 0; i < BeAnim.frameCount; ++i)
  87.                 jjAnimFrames[BeAnim.firstFrame + i].hotSpotY = 27;
  88.         for (uint i = 0; i < BeAnim.frameCount; ++i)
  89.                 jjAnimFrames[BeAnim.firstFrame + i].hotSpotX = 26;
  90.  
  91. }
  92.  
  93. void Bonuseye(jjOBJ@ obj){
  94.         obj.direction = -1;
  95.         obj.behave(BEHAVIOR::PICKUP, false);
  96.         obj.draw();
  97. }
  98. void Bonus(jjOBJ@ obj){
  99.         obj.putOnGround();
  100.         obj.direction = -1;
  101.         obj.behave(BEHAVIOR::PICKUP, false);
  102.         obj.draw();
  103. }
  104.  
  105.  
  106. void TimeMachine(jjOBJ@ obj){
  107.         obj.behave(BEHAVIOR::EVA, false);
  108.                         jjDrawResizedSpriteFromCurFrame(obj.xPos, obj.yPos, obj.curFrame, 1, 1, SPRITE::PALSHIFT, 8);
  109.  
  110. }
  111.  
  112. bool leveldone = false;
  113.  
  114. class Gong : jjBEHAVIORINTERFACE {
  115.         void onBehave(jjOBJ@ obj){
  116.  
  117.         obj.playerHandling = HANDLING::SPECIAL;
  118.                 obj.energy = 2;
  119.                 if(obj.energy == 0)
  120.                 {obj.energy += 1;}
  121.                 jjANIMATION@ anim = jjAnimations[jjObjectPresets[OBJECT::PINKPLATFORM].curAnim];
  122.                 anim.frameCount = 1;
  123.                 jjANIMFRAME@ frame = jjAnimFrames[anim.firstFrame];
  124.                 jjPIXELMAP lamp(0, 25*32, 4*32, 4*32, 5);
  125.                 lamp.save(frame);
  126.                 frame.hotSpotX = -42;
  127.                 obj.behave(BEHAVIOR::BUMP, false);
  128.         if(obj.justHit == 0)
  129.         {jjDrawSpriteFromCurFrame(obj.xPos, obj.yPos, obj.curFrame, obj.direction, SPRITE::BRIGHTNESS, 180);}
  130.         else    obj.draw();
  131.         }
  132.         bool onObjectHit(jjOBJ@ obj, jjOBJ@ bullet, jjPLAYER@ play, int force) {
  133.                 if(bullet.xPos > obj.xPos)
  134.                         {bullet.delete();}
  135.                 obj.bulletHandling = HANDLING::HURTBYBULLET;
  136.                 if(play !is null && bullet !is null && leveldone == false)
  137.                         {jjMusicStop();
  138.                         leveldone = true;
  139.                         jjSample(p.xPos, p.yPos, SOUND::STONED_STONED);
  140.                         jjTriggers[1] = true;
  141.                         p.showText("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@Temple Gate unlocked.");
  142.                 }
  143.                 return true;
  144.         }
  145. }
  146.  
  147. class Gwell : jjBEHAVIORINTERFACE {
  148.  
  149.         void onBehave(jjOBJ@ obj) {
  150.                 if(p.ammo[WEAPON::SEEKER] > 1)
  151.                 {obj.delete();}
  152.                 obj.behave(BEHAVIOR::MONITOR); 
  153.         }
  154.         bool onObjectHit(jjOBJ@ obj, jjOBJ@ bullet, jjPLAYER@ play, int force) {
  155.                 if(bullet !is null && play !is null)
  156.                         {obj.behave(BEHAVIOR::EXPLOSION2);
  157.                         jjAddObject(OBJECT::SEEKERAMMO3, 81*32, 38*32);
  158.                         jjAddObject(OBJECT::SEEKERAMMO3, 82*32, 38*32);
  159.                         jjAddObject(OBJECT::SEEKERAMMO3, 83*32, 38*32);
  160.                         jjAddObject(OBJECT::SEEKERAMMO3, 81*32, 39*32);                
  161.                         jjAddObject(OBJECT::SEEKERAMMO3, 82*32, 39*32);
  162.                         jjAddObject(OBJECT::SEEKERAMMO3, 83*32, 39*32);
  163.                         jjSample(p.xPos, p.yPos, SOUND::COMMON_HARP1, 1000);}
  164.                 return true;
  165.         }
  166.        
  167. }
  168.  
  169. class PlatinCoin : jjBEHAVIORINTERFACE {
  170.  
  171.         void onBehave(jjOBJ@ obj) {
  172.                 obj.behave(BEHAVIOR::PICKUP, false);
  173.                 ++obj.counter;
  174.                 obj.yPos = jjSin(obj.counter*15 + 5)*4 + obj.yOrg;
  175.                 if(jjTriggers[1] && jjTriggers[8]==true && jjTriggers[9]==true && jjTriggers[10]==true &&jjTriggers[11]==true && jjTriggers[12]==true)
  176.                 {jjDrawSpriteFromCurFrame(obj.xPos, obj.yPos, obj.curFrame, obj.direction, SPRITE::PALSHIFT, -8);}
  177.                 else jjDrawSpriteFromCurFrame(obj.xPos, obj.yPos, obj.curFrame, obj.direction, SPRITE::TRANSLUCENTPALSHIFT, -8);
  178. }
  179.         bool onObjectHit(jjOBJ@ obj, jjOBJ@ bullet, jjPLAYER@ player, int force) {
  180.                 if(jjTriggers[1] && jjTriggers[8]==true && jjTriggers[9]==true && jjTriggers[10]==true &&jjTriggers[11]==true && jjTriggers[12]==true)
  181.                 {p.coins += 1;
  182.                 obj.behavior = BEHAVIOR::EXPLOSION2;
  183.                 jjSample(obj.xPos, obj.yPos, SOUND::COMMON_COIN, 1000);}
  184.                 else
  185.                 {p.showText("@@Collect all artifacts first.");}
  186.  
  187.                 return true;
  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.  
  263.  
  264.  
  265. void PlatformH (jjOBJ@ obj) {
  266.  
  267.         switch (obj.state) {
  268.                 case STATE::START:
  269.                         obj.direction = obj.xSpeed = -2;
  270.                         obj.determineCurAnim(ANIM::GRASSPLAT, 0);  
  271.                         obj.determineCurFrame();
  272.                         obj.playerHandling = HANDLING::SPECIAL;
  273.                         obj.state = STATE::FLY;
  274.                         obj.beSolid();
  275.                 case STATE::FLY:
  276.                         obj.xPos = obj.xPos + obj.xSpeed;
  277.                         obj.beSolid();
  278.                         obj.deactivates = false;
  279.                         if (jjMaskedVLine(obj.xSpeed > 0 ? obj.xPos + 16 : obj.xPos - 16, obj.yPos, 1)) {
  280.                                 obj.direction = obj.xSpeed = -obj.xSpeed;
  281.                         }
  282.                         obj.draw();
  283.  
  284.                         break;
  285.  
  286.         }
  287. }
  288.  
  289.  
  290.  
  291. void PlatformV (jjOBJ@ obj) {
  292.  
  293.         switch (obj.state) {
  294.                 case STATE::START:
  295.                         obj.direction = obj.ySpeed = -2;
  296.                         obj.determineCurAnim(ANIM::GRASSPLAT, 0);  
  297.                         obj.determineCurFrame();
  298.                         obj.playerHandling = HANDLING::SPECIAL;
  299.                         obj.state = STATE::FLY;
  300.                         obj.beSolid();
  301.                 case STATE::FLY:
  302.                         obj.yPos = obj.yPos + obj.ySpeed;
  303.                         obj.beSolid();
  304.                         obj.deactivates = false;
  305.                         if (jjMaskedVLine(obj.xSpeed > 0 ? obj.xPos + 62 : obj.xPos - 32, obj.yPos, 1)) {
  306.                                 obj.direction = obj.ySpeed = -obj.ySpeed;
  307.                         }
  308.                         obj.draw();
  309.  
  310.                         break;
  311.  
  312.         }
  313. }
  314.  
  315. void onLevelReload() {
  316.         gem::restorePlayerGems();
  317.         jjLocalPlayers[0].lives++;
  318.         buyammo = false;
  319.         for (uint i = 0; i < 32; ++i)
  320.                 jjTriggers[i] = SavedTriggers[i];
  321. }
  322.  
  323.  
  324. void onMain() {
  325. gem::deleteCollectedGems();
  326. if(jjKey[9] && jjKey[0x51]) {
  327. p.morphTo(CHAR::JAZZ, false);
  328. }
  329. if(jjKey[9] && jjKey[0x57]) {
  330. p.morphTo(CHAR::SPAZ, false);
  331. }
  332. if(jjKey[9] && jjKey[0x45]) {
  333. p.morphTo(CHAR::LORI, false);
  334. }
  335.  
  336. }
  337.  
  338. int slope = 0;
  339.  
  340. void onFunction0(jjPLAYER@ p) {
  341.         p.showText("@@@@@@@@@@@@@@@@@@@@@@@@@TEMPLE OF BUDDHA", STRING::MEDIUM);
  342.         jjEnabledASFunctions[0] = false;}
  343.  
  344. void onFunction1(jjPLAYER@ p) {
  345.         p.showText("@@@@@@@@@@@@@@@@@@@@@@@@@MT. EVEREST", STRING::MEDIUM);
  346.         jjEnabledASFunctions[0] = false;}
  347.  
  348.  
  349. void onFunction5(jjPLAYER@ p) {
  350. slope = jjGameTicks + 2*61;
  351. }
  352. void onFunction6(jjPLAYER@ p) {
  353. slope = 0;
  354. }
  355.  
  356. void onfunction11(jjPLAYER@ p) {
  357. SuperCopterOn = 0;
  358. jjTriggers[31] = true;
  359. }
  360.  
  361. void onFunction10(jjPLAYER@ p) {
  362. p.cameraUnfreeze();
  363. }
  364.  
  365. bool doorunblocked = false;
  366. bool buyammo = false;
  367. bool startrush = false;
  368. bool readytorush = false;
  369.  
  370. void onPlayer(jjPLAYER@ p) {
  371.         gem::trackPlayerGems(p);
  372.         gem::upgradeHealth(p);
  373.         p.lightType = LIGHT::NONE;
  374.         if(p.coins == 0)
  375.                 {p.coins += 3;}
  376.  
  377.         if(p.food == 100 && jjKey[0x52] == false && startrush == false)
  378.                 {p.showText("@@@@@@@@@@@@@@@@Press 'R' when you need to use Sugar Rush!", STRING::MEDIUM);
  379.                 p.startSugarRush(0);
  380.                 startrush = true;
  381.                 readytorush = true;}
  382.  
  383.         if(readytorush == true)
  384.                 {p.food = 100;}
  385.  
  386.         if(p.food == 100 && jjKey[0x52])
  387.                 {p.startSugarRush(1400);
  388.                 p.food = 0;
  389.                 readytorush = false;
  390.                 startrush = false;
  391.         }
  392.  
  393.         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)
  394.                 {p.testForGems(50, GEM::RED);}
  395.         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)
  396.         {p.testForGems(50, GEM::RED);
  397.         jjTriggers[3]=true;
  398.         buyammo = true;}
  399.         if(p.ammo[WEAPON::SEEKER] >= 1 && p.xPos>66*32 && p.xPos<70*32 && p.yPos<44*32 && p.yPos>40*32 && jjKey[0x50] && buyammo == false)
  400.                 {p.showText("@@You already have the weapon.");}
  401.  
  402.                 if (doorunblocked == false && jjTriggers[1]==true && jjTriggers[8]==true && jjTriggers[9]==true && jjTriggers[10]==true&& jjTriggers[11]==true && jjTriggers[12]==true) {
  403.                 p.showText("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@Gold Token unlocked.");
  404.                 doorunblocked = true;}
  405.  
  406. if(p.keyUp && slope > jjGameTicks){
  407.         p.yPos = p.yPos - 4;
  408.         p.invisibility = true;
  409.         jjDrawSprite(p.xPos, p.yPos, p.setID, RABBIT::HPOLE, p.curFrame, p.direction, SPRITE::PLAYER);
  410.         }
  411. if(p.keyUp == false && slope > jjGameTicks){
  412.         p.invisibility = false;
  413. }
  414. if(slope < jjGameTicks){
  415.         p.invisibility = false;
  416. }
  417.  
  418.         if(p.keyUp && Lever8 == false && p.xPos > 221*32 && p.xPos < 224*32 && p.yPos < 38*32 && p.yPos > 35*32)
  419.         {jjTriggers[8] = true;
  420.         Lever8 = true;}
  421.  
  422.         if(p.coins<1 && p.xPos < 111*32 && p.xPos > 108*32 && p.yPos < 3*32)
  423.         {p.testForCoins(1);}
  424.         if(p.coins>=1 && p.xPos < 111*32 && p.xPos > 108*32 && p.yPos < 3*32)
  425.         {jjNxt("mo4a_4-2_save", false, true);
  426.         gem::saveGemData();}
  427.  
  428.         if(p.coins<3 && p.xPos < 116*32 && p.xPos > 113*32 && p.yPos < 52*32 && p.yPos > 47*32)
  429.         {p.testForCoins(3);}
  430.         if(p.coins>=3 && p.xPos < 116*32 && p.xPos > 113*32 && p.yPos < 52*32 && p.yPos > 47*32 && leveldone == true)
  431.         {jjNxt("mo4a_4-4_save", false, true);
  432.         gem::saveGemData();}
  433.         if(p.coins>=3 && p.xPos < 116*32 && p.xPos > 113*32 && p.yPos < 52*32 && p.yPos > 47*32 && leveldone == false)
  434.         {p.showText("@@I should hit the gong@to open the gate!");}
  435.  
  436.         if(SuperCopterOn > jjGameTicks)
  437.         {jjCharacters[CHAR::JAZZ].helicopterYSpeed= 0;}
  438.         if(SuperCopterOn < jjGameTicks)
  439.         {jjCharacters[CHAR::JAZZ].helicopterYSpeed= 1;}
  440.  
  441. if (SpeedUpUntil > jjGameTicks) {
  442. p.keyRun = true;
  443. if(p.keyRight)
  444. p.xSpeed = 30;
  445. if(p.keyLeft)
  446. p.xSpeed = -30;
  447.   }
  448.  
  449.  
  450. }
  451.  
  452.  
  453. void onFunction12(jjPLAYER@ p) {
  454. p.cameraFreeze(115*32, 43*32, true, false);
  455. }
  456.  
  457.  
  458. bool onDrawHealth(jjPLAYER@ player, jjCANVAS@ canvas) {
  459.     canvas.drawSprite(20, 585, ANIM::PICKUPS, 84, jjGameTicks>>2, -1, SPRITE::PALSHIFT, -8);
  460.     canvas.drawString(30, 585, formatInt(player.coins%4, "1") + "/3", STRING::SMALL, STRING::NORMAL);
  461.     return false;
  462. }
  463.  
  464. bool onDrawLives(jjPLAYER@ player, jjCANVAS@ canvas) {return true;}
  465.  
  466. array<bool> SavedTriggers(32, false);
  467. //Extendable Checkpoints by VioletCLM
  468. void CheckpointWrapper(jjOBJ@ obj) {
  469.   if (obj.state == STATE::STOP) { //don't do anything anymore
  470.     jjDrawSpriteFromCurFrame(obj.xPos, obj.yPos, obj.curFrame, obj.direction, SPRITE::PALSHIFT, 8);
  471.   } else if (obj.state == STATE::DEACTIVATE) { //due to death
  472.     obj.deactivate();
  473.   } else {
  474.     obj.behave(BEHAVIOR::CHECKPOINT);
  475.         jjDrawSpriteFromCurFrame(obj.xPos, obj.yPos, obj.curFrame, obj.direction, SPRITE::PALSHIFT, 8);
  476.     if (obj.state == STATE::DONE) { //triggered by the player hitting it
  477.       obj.state = STATE::STOP;
  478.       //save the current state of some properties
  479.       for (uint i = 0; i < 32; ++i)
  480.         SavedTriggers[i] = jjTriggers[i];
  481.  
  482.       //OPTIONAL: this loop makes checkpoints reusable, so only the most recent checkpoint you touched is ever active
  483.       for (int i = jjObjectCount; --i > 0;) {
  484.         jjOBJ@ obj2 = jjObjects[i];
  485.         if (obj2.eventID == OBJECT::CHECKPOINT && i != obj.objectID && obj2.isActive) {
  486.           obj2.state = STATE::SLEEP;
  487.           obj2.var[0] = 0;
  488.         }
  489.       }
  490.     }
  491.   }
  492. }
  493.  
  494.  
  495. jjTEXTAPPEARANCE SignTextAppearance = STRING::NORMAL;
  496. class Sign {
  497.         private int xPos, yPos; //These pixel-based positions will be generated from tile-based positions in the constructor by multiplying by 32
  498.         private string text;
  499.         private uint widthOfText;
  500.         Sign(){} //AngelScript requires any class that appears in any array to have an explicit default constructor, even if it's never called
  501.         Sign(int xTile, int yTile, const string &in t) {
  502.                 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
  503.                 yPos = yTile * 32; //
  504.                 text = t;
  505.                 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.
  506.                 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.
  507.                 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.
  508.         }
  509.         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.
  510.                 layer.drawRectangle(xPos, yPos - 16, widthOfText + 8, 55, 0, SPRITE::TRANSLUCENT);
  511.                 layer.drawString(xPos, yPos, text, STRING::SMALL, SignTextAppearance, 0, SPRITE::BLEND_HARDLIGHT, textIntensity);
  512.         }
  513. }
  514. const array<Sign> Signs = {
  515.         Sign(5, 64, "You're almost there for the\nlast Time Freezer. Good luck!"),
  516.         Sign(53, 41, "You have cleaned Mt Everest out of evil!\nBut they are still in Buddha's Temple."),
  517.         Sign(168, 7, "There will always be obstacles\nin your path..."),
  518.         Sign(77, 32, "Always climb up\nto proceed."),
  519.         Sign(49, 61, "You have cleaned Mt Everest out of evil!\nBut they are still Buddha's Temple."),
  520.         Sign(68, 40, "Press P if you'd like to\nbuy Voranj for 50 Gems."),
  521. };
  522.  
  523. void onDrawLayer3(jjPLAYER@, jjCANVAS@ layer) {
  524.         if(jjKey[0x54]){
  525.         const uint8 textIntensity = 200 + int(jjSin(jjGameTicks * 16) * 50);
  526.         for (uint signID = 0; signID < Signs.length; ++signID)
  527.                 Signs[signID].draw(layer, textIntensity);
  528. }
  529. }
  530. bool onDrawAmmo(jjPLAYER@ player, jjCANVAS@ canvas) {
  531.         return MLLE::WeaponHook.drawAmmo(player, canvas);
  532. }
  533.