Name | Author | Game Mode | Rating | |||||
---|---|---|---|---|---|---|---|---|
The Price of Admission | cooba | Capture the flag | 8.7 |
/*******************************
A 2017 Mystic Legends Release!
http://www.mysticlegends.org
/******************************/
#pragma require "Jungle1_1.00gx.j2t"
#pragma require "spelunky_ignite.wav"
#pragma require "mlprice-extra.j2l"
#pragma offer "mlprice-extra.j2as"
void onLevelLoad() {
/********************************************************************* COLOR MODIFICATIONS *************************************************************************/
jjPalette.gradient(99,143,68, 4,10,1, 104, 8);
jjPalette.gradient(24,48,32, 0,1,0, 224, 12);
jjPalette.fill(0,0,1, 176, 32);
jjPalette.copyFrom(192, 8, 104, jjPalette, 0.35);
jjSetWaterGradient(99,143,68, 24,48,32);
jjWaterLighting = WATERLIGHT::GLOBAL;
jjSetWaterLevel(54.5f*32, true);
jjSetDarknessColor(jjPALCOLOR(0,0,0)); //This unfucks 8-bit
/********************************************************************* EXTRA TILES AND LAYERS **********************************************************************/
importTilesIntoLayers();
jjLayers[2].spriteMode = SPRITE::BLEND_NORMAL;
jjLayers[2].spriteParam = 255;
jjLayers[5].generateSettableTileArea();
for (int x = 0; x < jjLayerWidth[5]; x++)
for (int y = 0; y < jjLayerHeight[5]; y++)
jjTileSet(5, x, y, jjTileGet(5, x, y) ^ TILE::VFLIPPED);
jjLayers[6].spriteMode = SPRITE::BRIGHTNESS;
jjLayers[6].spriteParam = 64; //50% light
jjLayers[6].yOffset = 16;
jjTilesFromTileset("Carrot1.j2t", 264, 1);
jjPIXELMAP carrotsign(1170);
carrotsign.save(823);
jjTilesFromTileset("Lomat.j2t", 0, 0);
/*********************************************************** MODIFIED OBJECT PROPERTIES AND BEHAVIORS **************************************************************/
jjSampleLoad(SOUND::P2_POEP, "spelunky_ignite.wav");
jjObjectPresets[OBJECT::ICEAMMO15].direction = SPRITE::FLIPV;
jjObjectPresets[OBJECT::MORPH].direction = SPRITE::FLIPV;
jjObjectPresets[OBJECT::FULLENERGY].behavior = BlockedCarrot;
jjObjectPresets[OBJECT::SILVERCOIN].behavior = OffsetCoin;
}
void BlockedCarrot(jjOBJ@ obj) {
if (obj.state == STATE::START) {
obj.lightType = LIGHT::BRIGHT;
obj.light = 14;
}
if (jjEventGet(uint16(obj.xPos/32), uint16(obj.yPos/32)) == AREA::HURT) {
if (obj.xSpeed > 0) {
obj.xSpeed = 0;
array<jjLAYER@> layers = jjLayerOrderGet();
if (layers[6].spriteParam != 180) layers[6].spriteParam = 180;
}
else if (obj.xSpeed < 0) {
obj.xSpeed = 0;
array<jjLAYER@> layers = jjLayerOrderGet();
if (layers[5].spriteParam != 180) layers[5].spriteParam = 180;
}
}
obj.behave(BEHAVIOR::PICKUP);
}
void OffsetCoin(jjOBJ@ obj) {
if (obj.state == STATE::START) {
//obj.xPos = obj.xOrg + 16;
obj.lightType = LIGHT::POINT2;
obj.direction = SPRITE::FLIPV;
}
obj.behave(BEHAVIOR::PICKUP);
}
void importTilesIntoLayers() {
const int oldTileCount = jjTileCount;
//comment 1
jjTilesFromTileset("Jungle1_1.00gx.j2t", 840, 60);
jjTilesFromTileset("Jungle1_1.00gx.j2t", 840, 60);
array<uint8> fullblack(256, 176);
fullblack[0] = 0;
jjTilesFromTileset("Jungle1_1.00gx.j2t", 900, 59, fullblack);
//comment about recoloring
for (int i = 1000; i <= 1059; i++) {
jjPIXELMAP recoloredTree(i);
for (uint x = 0; x < recoloredTree.width; ++x)
for (uint y = 0; y < recoloredTree.height; ++y)
if (recoloredTree[x,y] >= 136 && recoloredTree[x,y] <= 143) {
recoloredTree[x,y] += 56;
}
else if (recoloredTree[x,y] >= 149 && recoloredTree[x,y] <= 156) {
recoloredTree[x,y] += 43;
}
recoloredTree.save(i);
}
array<jjLAYER@> extraForeLayer = jjLayersFromLevel("mlprice-extra.j2l", array<uint> = {1,2,2}, 0);
array<jjLAYER@> jungLayerFront = jjLayersFromLevel("mlprice-extra.j2l", array<uint> = {6}, oldTileCount - 840);
array<jjLAYER@> jungLayersBack = jjLayersFromLevel("mlprice-extra.j2l", array<uint> = {5,6,7}, oldTileCount - 780);
jjPIXELMAP blackness(0);
for (uint x = 0; x < blackness.width; ++x)
for (uint y = 0; y < blackness.height; ++y)
blackness[x,y] = 176;
blackness.save(909);
jjPIXELMAP greenness(0);
for (uint x = 0; x < greenness.width; ++x)
for (uint y = 0; y < greenness.height; ++y)
greenness[x,y] = 108;
greenness.save(929);
jjLayerOrderSet(array<jjLAYER@> = {
jjLayers[1],
extraForeLayer[0],
jjLayers[2],
jjLayers[3],
jjLayers[4],
extraForeLayer[1],
extraForeLayer[2],
jjLayers[5],
jjLayers[6],
jungLayerFront[0],
jungLayersBack[0],
jungLayersBack[1],
jungLayersBack[2],
jjLayers[8]
}
);
jjTileSet(8, 0, 0, 909);
jungLayerFront[0].xSpeed = 0.35f;
jungLayersBack[1].ySpeed = 0.025f;
extraForeLayer[1].spriteMode = extraForeLayer[2].spriteMode = SPRITE::BLEND_NORMAL;
extraForeLayer[1].spriteParam = extraForeLayer[2].spriteParam = 0;
extraForeLayer[1].xOffset = -66*32;
extraForeLayer[1].yOffset = -48*32;
extraForeLayer[2].xOffset = -70*32;
extraForeLayer[2].yOffset = -48*32;
}
void onDrawLayer4(jjPLAYER@ play, jjCANVAS@ layer) {
layer.drawTile(30*32 + (jjRandom()&6) - 3, 13*32 + (jjRandom()&6) - 3, 908);
layer.drawTile(102*32 + (jjRandom()&6) - 3, 13*32 + (jjRandom()&6) - 3, 908);
}
void onDrawLayer6(jjPLAYER@ play, jjCANVAS@ layer) {
layer.drawTile(48*32, 31*32, 8 + TILE::ANIMATED);
layer.drawTile(50*32 + 16, 32*32, 9 + TILE::ANIMATED);
layer.drawTile(55*32, 31*32, 10 + TILE::ANIMATED);
}
void onPlayer(jjPLAYER@ play) {
if (play.yPos >= 0) {
//Wherein "skill 3" means "MP Only"
int skill = jjParameterGet(uint16(play.xPos/32), uint16(play.yPos/32), -4, 2);
if (skill == 3) {
if (jjLayers[2].spriteParam > 96) {
if (jjLayers[2].spriteParam == 255) jjSamplePriority(SOUND::P2_POEP);
jjLayers[2].spriteParam = jjLayers[2].spriteParam - 10;
}
}
else if (jjLayers[2].spriteParam != 255) {
jjLayers[2].spriteParam = jjLayers[2].spriteParam + 10;
}
}
//Warp ID 999 is reserved for the /ready command.
if (play.warpID == 999 && play.coins < 5) play.coins = 5;
}
void onMain() {
jjPLAYER @play = jjLocalPlayers[0];
array<jjLAYER@> layers = jjLayerOrderGet();
if (jjLowDetail) {
layers[layers.length - 2].xSpeed = layers[layers.length - 2].ySpeed = 1;
layers[layers.length - 2].xOffset = play.cameraX * (0.1f - 1);
layers[layers.length - 2].yOffset = -play.cameraY + 0.5f;
}
else {
layers[layers.length - 2].xSpeed = 0.1f;
layers[layers.length - 2].ySpeed = 0;
layers[layers.length - 2].xOffset = layers[layers.length - 2].yOffset = 0;
}
layers[0].hasTiles = !jjLowDetail;
layers[1].yOffset = jjWaterLevel * -1;
if (layers[5].spriteParam > 0) {
layers[5].spriteParam = layers[5].spriteParam - 10;
}
if (layers[6].spriteParam > 0) {
layers[6].spriteParam = layers[6].spriteParam - 10;
}
if (jjLowDetail || jjColorDepth == 8 || (jjLowDetail && jjColorDepth == 8)) {
jjWaterLayer = 9;
}
else jjWaterLayer = 1;
if (jjGameTicks == 1) jjTriggers[31] = true;
jjTriggers[1] = (jjGameCustom == GAME::FR) ? true : false;
}
Jazz2Online © 1999-INFINITY (Site Credits). We have a Privacy Policy. Jazz Jackrabbit, Jazz Jackrabbit 2, Jazz Jackrabbit Advance and all related trademarks and media are ™ and © Epic Games. Lori Jackrabbit is © Dean Dodrill. J2O development powered by Loops of Fury and Chemical Beats.
Eat your lima beans, Johnny.