Downloads containing ab22ctf15.j2as

Downloads
Name Author Game Mode Rating
TSF with JJ2+ Only: Anniversary Bash 22 levels Jazz2Online Multiple N/A Download file

File preview

  1. /*******************************
  2. A 2017 Mystic Legends Release!
  3. http://www.mysticlegends.org
  4. /******************************/
  5.  
  6. #pragma require "Jungle1_1.00gx.j2t"
  7. #pragma require "spelunky_ignite.wav"
  8. #pragma require "ab22ctf15-extra.j2l"
  9. #pragma offer "ab22ctf15-extra.j2as"
  10.  
  11. void onLevelLoad() {
  12.         /********************************************************************* COLOR MODIFICATIONS *************************************************************************/
  13.         jjPalette.gradient(99,143,68, 4,10,1, 104, 8);
  14.         jjPalette.gradient(24,48,32, 0,1,0, 224, 12);
  15.  
  16.         jjPalette.fill(0,0,1, 176, 32);
  17.         jjPalette.copyFrom(192, 8, 104, jjPalette, 0.35);      
  18.        
  19.         jjSetWaterGradient(99,143,68, 24,48,32);
  20.         jjWaterLighting = WATERLIGHT::GLOBAL;
  21.         jjSetWaterLevel(54.5f*32, true);
  22.        
  23.         jjSetDarknessColor(jjPALCOLOR(0,0,0));          //This unfucks 8-bit
  24.                                                
  25.        
  26.         /********************************************************************* EXTRA TILES AND LAYERS **********************************************************************/
  27.         importTilesIntoLayers();
  28.        
  29.         jjLayers[2].spriteMode = SPRITE::BLEND_NORMAL;
  30.         jjLayers[2].spriteParam = 255;
  31.        
  32.         jjLayers[5].generateSettableTileArea();
  33.         for (int x = 0; x < jjLayerWidth[5]; x++)
  34.                 for (int y = 0; y < jjLayerHeight[5]; y++)
  35.                         jjTileSet(5, x, y, jjTileGet(5, x, y) ^ TILE::VFLIPPED);
  36.                        
  37.         jjLayers[6].spriteMode = SPRITE::BRIGHTNESS;
  38.         jjLayers[6].spriteParam = 64;   //50% light
  39.         jjLayers[6].yOffset = 16;
  40.  
  41.         jjTilesFromTileset("Carrot1.j2t", 264, 1);
  42.         jjPIXELMAP carrotsign(1170);
  43.         carrotsign.save(823);
  44.        
  45.         jjTilesFromTileset("Lomat.j2t", 0, 0);
  46.        
  47.                
  48.         /*********************************************************** MODIFIED OBJECT PROPERTIES AND BEHAVIORS **************************************************************/
  49.         jjSampleLoad(SOUND::P2_POEP, "spelunky_ignite.wav");   
  50.  
  51.         jjObjectPresets[OBJECT::ICEAMMO15].direction = SPRITE::FLIPV;
  52.         jjObjectPresets[OBJECT::MORPH].direction = SPRITE::FLIPV;
  53.        
  54.         jjObjectPresets[OBJECT::FULLENERGY].behavior = BlockedCarrot;  
  55.         jjObjectPresets[OBJECT::SILVERCOIN].behavior = OffsetCoin;
  56. }
  57.  
  58. void BlockedCarrot(jjOBJ@ obj) {
  59.         if (obj.state == STATE::START) {
  60.                 obj.lightType = LIGHT::BRIGHT;
  61.                 obj.light = 14;
  62.         }
  63.         if (jjEventGet(uint16(obj.xPos/32), uint16(obj.yPos/32)) == AREA::HURT) {
  64.                 if (obj.xSpeed > 0) {
  65.                         obj.xSpeed = 0;
  66.                        
  67.                         array<jjLAYER@> layers = jjLayerOrderGet();
  68.                         if (layers[6].spriteParam != 180) layers[6].spriteParam = 180;                         
  69.                 }
  70.                 else if (obj.xSpeed < 0) {
  71.                         obj.xSpeed = 0;
  72.                        
  73.                         array<jjLAYER@> layers = jjLayerOrderGet();
  74.                         if (layers[5].spriteParam != 180) layers[5].spriteParam = 180;
  75.                 }
  76.         }
  77.         obj.behave(BEHAVIOR::PICKUP);
  78. }
  79.  
  80. void OffsetCoin(jjOBJ@ obj) {
  81.         if (obj.state == STATE::START) {
  82.                 //obj.xPos = obj.xOrg + 16;
  83.                 obj.lightType = LIGHT::POINT2;
  84.                 obj.direction = SPRITE::FLIPV;
  85.         }
  86.         obj.behave(BEHAVIOR::PICKUP);
  87. }
  88.  
  89. void importTilesIntoLayers() {
  90.         const int oldTileCount = jjTileCount;
  91.        
  92.         //comment 1
  93.        
  94.         jjTilesFromTileset("Jungle1_1.00gx.j2t", 840, 60);
  95.         jjTilesFromTileset("Jungle1_1.00gx.j2t", 840, 60);
  96.         array<uint8> fullblack(256, 176);
  97.         fullblack[0] = 0;
  98.         jjTilesFromTileset("Jungle1_1.00gx.j2t", 900, 59, fullblack);
  99.        
  100.         //comment about recoloring
  101.        
  102.         for (int i = 1000; i <= 1059; i++) {
  103.                 jjPIXELMAP recoloredTree(i);
  104.                 for (uint x = 0; x < recoloredTree.width; ++x)
  105.                         for (uint y = 0; y < recoloredTree.height; ++y)                
  106.                                 if (recoloredTree[x,y] >= 136 && recoloredTree[x,y] <= 143) {
  107.                                         recoloredTree[x,y] += 56;
  108.                                 }
  109.                                 else if (recoloredTree[x,y] >= 149 && recoloredTree[x,y] <= 156) {
  110.                                         recoloredTree[x,y] += 43;
  111.                                 }
  112.                 recoloredTree.save(i);
  113.         }
  114.        
  115.         array<jjLAYER@> extraForeLayer = jjLayersFromLevel("mlprice-extra.j2l", array<uint> = {1,2,2}, 0);
  116.         array<jjLAYER@> jungLayerFront = jjLayersFromLevel("mlprice-extra.j2l", array<uint> = {6}, oldTileCount - 840);
  117.         array<jjLAYER@> jungLayersBack = jjLayersFromLevel("mlprice-extra.j2l", array<uint> = {5,6,7}, oldTileCount - 780);
  118.        
  119.         jjPIXELMAP blackness(0);
  120.         for (uint x = 0; x < blackness.width; ++x)
  121.                 for (uint y = 0; y < blackness.height; ++y)
  122.                         blackness[x,y] = 176;
  123.         blackness.save(909);
  124.        
  125.         jjPIXELMAP greenness(0);
  126.         for (uint x = 0; x < greenness.width; ++x)
  127.                 for (uint y = 0; y < greenness.height; ++y)
  128.                         greenness[x,y] = 108;
  129.         greenness.save(929);
  130.                
  131.         jjLayerOrderSet(array<jjLAYER@> = {
  132.                 jjLayers[1],
  133.                 extraForeLayer[0],
  134.                 jjLayers[2],
  135.                 jjLayers[3],
  136.                 jjLayers[4],
  137.                 extraForeLayer[1],
  138.                 extraForeLayer[2],
  139.                 jjLayers[5],
  140.                 jjLayers[6],
  141.                 jungLayerFront[0],
  142.                 jungLayersBack[0],
  143.                 jungLayersBack[1],
  144.                 jungLayersBack[2],
  145.                 jjLayers[8]
  146.                 }
  147.         );
  148.        
  149.         jjTileSet(8, 0, 0, 909);
  150.        
  151.         jungLayerFront[0].xSpeed = 0.35f;
  152.         jungLayersBack[1].ySpeed = 0.025f;
  153.        
  154.         extraForeLayer[1].spriteMode = extraForeLayer[2].spriteMode = SPRITE::BLEND_NORMAL;
  155.         extraForeLayer[1].spriteParam = extraForeLayer[2].spriteParam = 0;
  156.        
  157.         extraForeLayer[1].xOffset = -66*32;
  158.         extraForeLayer[1].yOffset = -48*32;
  159.        
  160.         extraForeLayer[2].xOffset = -70*32;
  161.         extraForeLayer[2].yOffset = -48*32;    
  162. }
  163.  
  164. void onDrawLayer4(jjPLAYER@ play, jjCANVAS@ layer) {
  165.         layer.drawTile(30*32  + (jjRandom()&6) - 3, 13*32 + (jjRandom()&6) - 3, 908);
  166.         layer.drawTile(102*32 + (jjRandom()&6) - 3, 13*32 + (jjRandom()&6) - 3, 908);
  167. }
  168.  
  169. void onDrawLayer6(jjPLAYER@ play, jjCANVAS@ layer) {
  170.         layer.drawTile(48*32,      31*32, 8  + TILE::ANIMATED);
  171.         layer.drawTile(50*32 + 16, 32*32, 9  + TILE::ANIMATED);
  172.         layer.drawTile(55*32,      31*32, 10 + TILE::ANIMATED);
  173. }
  174.  
  175. void onPlayer(jjPLAYER@ play) {
  176.         if (play.yPos >= 0) {
  177.                 int skill = jjParameterGet(uint16(play.xPos/32), uint16(play.yPos/32), -4, 2); 
  178.                 if (skill == 3) {
  179.                         if (jjLayers[2].spriteParam > 96) {
  180.                                 if (jjLayers[2].spriteParam == 255) jjSamplePriority(SOUND::P2_POEP);
  181.                                 jjLayers[2].spriteParam = jjLayers[2].spriteParam - 10;
  182.                         }
  183.                 }
  184.                 else if (jjLayers[2].spriteParam != 255) {
  185.                         jjLayers[2].spriteParam = jjLayers[2].spriteParam + 10;
  186.                 }
  187.         }
  188.         if (play.warpID == 999 && play.coins < 5) play.coins = 5;
  189. }
  190.  
  191. void onMain() {
  192.         jjPLAYER @play = jjLocalPlayers[0];
  193.         array<jjLAYER@> layers = jjLayerOrderGet();    
  194.         if (jjLowDetail) {
  195.                 layers[layers.length - 2].xSpeed = layers[layers.length - 2].ySpeed = 1;
  196.                 layers[layers.length - 2].xOffset = play.cameraX * (0.1f - 1);
  197.                 layers[layers.length - 2].yOffset = -play.cameraY + 0.5f;
  198.         }
  199.         else {
  200.                 layers[layers.length - 2].xSpeed = 0.1f;
  201.                 layers[layers.length - 2].ySpeed = 0;
  202.                 layers[layers.length - 2].xOffset = layers[layers.length - 2].yOffset = 0;
  203.         }
  204.         layers[0].hasTiles = !jjLowDetail;
  205.         layers[1].yOffset = jjWaterLevel * -1;
  206.        
  207.         if (layers[5].spriteParam > 0) {
  208.                 layers[5].spriteParam = layers[5].spriteParam - 10;
  209.         }
  210.         if (layers[6].spriteParam > 0) {
  211.                 layers[6].spriteParam = layers[6].spriteParam - 10;
  212.         }
  213.                
  214.         if (jjLowDetail || jjColorDepth == 8 || (jjLowDetail && jjColorDepth == 8)) {
  215.                 jjWaterLayer = 9;
  216.         }
  217.         else jjWaterLayer = 1;
  218.        
  219.         if (jjGameTicks == 1) jjTriggers[31] = true;
  220.  
  221.         jjTriggers[1] = (jjGameCustom == GAME::FR) ? true : false;
  222. }