Downloads containing tsrf.j2as

Downloads
Name Author Game Mode Rating
TSF with JJ2+ Only: Twin StalactitesFeatured Download FireSworD Battle 9 Download file

File preview

const bool MLLESetupSuccessful = MLLE::Setup(); ///@MLLE-Generated
#include "MLLE-Include-1.5.asc" ///@MLLE-Generated
#pragma require "tsrf.j2l" ///@MLLE-Generated
const array<uint16> tilesToDarken = {
	410, 428, 429, 446, 447, 448, 449, 456, 457, 458, 459, 466, 467, 468, 469, 488, 489, 498, 499, 508, 509, 518, 519, 528, 529, 538, 539
};

void onLevelLoad() {
	jjUseLayer8Speeds = true;
	
	jjSetWaterGradient(5, 0, 15, 50, 0, 100);
	jjWaterLighting = WATERLIGHT::GLOBAL;
	jjSetWaterLevel(32*74.7, true);

	for (int i = 1; i < 255; i++) {
		if (jjObjectPresets[i].playerHandling == HANDLING::PICKUP) {
			jjObjectPresets[i].behavior = CannotBeShotDown;
		}
	}
	
	for (int x = 0; x < jjLayerWidth[4]; x++) {
		for (int y = 0; y < jjLayerHeight[4]; y++) {
			uint16 tile = jjTileGet(4, x, y);			
			if (jjEventGet(x, y) == 119) jjTileSet(4, x, y, tile ^ TILE::VFLIPPED);
		}
	}
	
	jjPalette.gradient(10,22,102, 0,0,10, 208, 16);
	
	for (uint16 i = 0; i < tilesToDarken.length(); i++) {
		jjPIXELMAP darkCaves(tilesToDarken[i]);
			for (uint x = 0; x < darkCaves.width; ++x)
				for (uint y = 0; y < darkCaves.height; ++y)
					if (darkCaves[x,y] >= 112 && darkCaves[x,y] <= 127)
						darkCaves[x,y] += 96;
			darkCaves.save(tilesToDarken[i], true);
	}
	
	jjPIXELMAP blackTile(96);
		for (uint x = 0; x < blackTile.width; ++x) {
			for (uint y = 0; y < blackTile.height; ++y) {
				blackTile[x,y] = 39;
			}
		}
	blackTile.save(96, true);
}

void onPlayer(jjPLAYER@ play) {        
    const int bounds = 48;
    
    if (play.xPos > ((jjLayerWidth[4]*32) - bounds) || play.xPos < bounds) {
        play.xPos = play.xPos < (bounds+1)? bounds : (jjLayerWidth[4]*32) - bounds;
        play.xSpeed = 0;
        play.specialMove = 0;
    }
}

void CannotBeShotDown(jjOBJ@ obj) {
	obj.behave(BEHAVIOR::PICKUP);
	if (obj.state == STATE::FLOATFALL) obj.state = STATE::FLOAT;
}

void onMain() {
		
	for (int i = 1; i < jjObjectCount; i++) {
		jjOBJ@ obj = jjObjects[i];
		if (obj.isActive && obj.eventID == OBJECT::COPTER && obj.state == STATE::FLY) {
			obj.counter = 0;
			if (obj.var[4] == 0)
				obj.state = STATE::DONE;
		}
	}
}