Downloads containing JJDR.asc

Downloads
Name Author Game Mode Rating
JJ2+ Only: Jazz Jackrabbit 2,5 - The...Featured Download Sly Single player 8.4 Download file

File preview

  1. void notAvailableWhenDroppedFromEnemies(jjOBJ@ obj) {
  2.         if (obj.creatorType == CREATOR::PLAYER) obj.delete(); else obj.behavior = BEHAVIOR::PICKUP;
  3. }
  4.  
  5. void onLevelLoad() {
  6.         jjObjectPresets[OBJECT::SAVEPOST].deactivates = false;
  7.         jjObjectPresets[OBJECT::FASTFIRE].behavior = notAvailableWhenDroppedFromEnemies;
  8.         for (int i = 0; i < jjLocalPlayerCount; ++i)
  9.                 jjLocalPlayers[i].charOrig = CHAR::JAZZ;
  10.         jjUseLayer8Speeds = true;
  11.         jjObjectPresets[OBJECT::CRAB].energy = 2;
  12.         jjObjectPresets[OBJECT::RAPIER].energy = -1;
  13.         jjObjectPresets[OBJECT::SPIKEBOLL].energy = 0;
  14.         jjObjectPresets[OBJECT::BOUNCERBULLET].behavior = BouncerNoWallWrapper;
  15.         jjObjectPresets[OBJECT::BOUNCERBULLETPU].behavior = BouncerPUNoWallWrapper;
  16.         if (jjDifficulty > 1) {
  17.                 jjObjectPresets[OBJECT::DRAGONFLY].energy = 3;
  18.                 jjObjectPresets[OBJECT::MONKEY].energy = 5;
  19.                 jjObjectPresets[OBJECT::SKELETON].energy = 4;
  20.                 jjObjectPresets[OBJECT::BUTTERFLY].energy = 2;
  21.                 jjObjectPresets[OBJECT::LIZARD].energy = 2;
  22.                 jjObjectPresets[OBJECT::STANDMONKEY].energy = 5;
  23.                 jjObjectPresets[OBJECT::FENCER].energy = 5;
  24.         }
  25. }
  26.  
  27. void onPlayer(jjPLAYER@ player) { player.food = 0; }
  28.  
  29. class HelpString {
  30.   int HelpID = -1;
  31.   int Timer = -200;
  32. }
  33. array<HelpString> HelpStrings(jjLocalPlayerCount);
  34. jjTEXTAPPEARANCE spin(STRING::SPIN);
  35.  
  36. bool onDrawHealth(jjPLAYER@ player, jjCANVAS@ canvas) {
  37.   HelpString@ helpString = HelpStrings[player.localPlayerID];
  38.   const uint xTile = uint(player.xPos) / 32, yTile = uint(player.yPos) / 32;
  39.   if (jjEventGet(xTile,yTile) == AREA::TEXT && jjParameterGet(xTile,yTile, 8,10) == 0) {
  40.         const int helpID = jjParameterGet(xTile,yTile, 0,8);
  41.         if (helpID >= 100 && helpID <= 115) {
  42.           if (helpID - 100 != helpString.HelpID) {
  43.                 helpString.Timer = jjGameTicks + 70;
  44.                 helpString.HelpID = helpID - 100;
  45.           } else if (helpString.Timer < jjGameTicks) {
  46.                 helpString.Timer = jjGameTicks;
  47.           }
  48.         }
  49.   }
  50.  
  51.   const int time = helpString.Timer - jjGameTicks;
  52.   if (time > -70) {
  53.   spin.xAmp = spin.yAmp = (time == 0) ? 0 : 1;
  54.   spin.spacing = (time == 0) ? 2 : 1;
  55.         canvas.drawString(
  56.           0x8000 + time * int(abs(time)) / 10,
  57.           10,
  58.           jjHelpStrings[helpString.HelpID],
  59.           STRING::SMALL,
  60.          spin,
  61.           uint(abs(time)) * 3
  62.         );
  63.   } else
  64.         helpString.HelpID = -1;
  65.    
  66.   return false;
  67. }
  68.  
  69. void BouncerNoWallWrapper(jjOBJ@ obj) {
  70.         const bool right = obj.xSpeed >= 0;
  71.         obj.behave(BEHAVIOR::BOUNCERBULLET);
  72.         if (right != (obj.xSpeed >= 0))
  73.                 obj.var[7] = -obj.var[7];
  74. }
  75. void BouncerPUNoWallWrapper(jjOBJ@ obj) {
  76.         const bool right = obj.xSpeed >= 0;
  77.         obj.behave(BEHAVIOR::BOUNCERBULLETPU);
  78.         if (right != (obj.xSpeed >= 0))
  79.                 obj.var[7] = -obj.var[7];
  80. }