Downloads containing mlcloister.j2as

Downloads
Name Author Game Mode Rating
TSF with JJ2+ Only: Cloistered Existence cooba Battle N/A Download file

File preview

const bool MLLESetupSuccessful = MLLE::Setup(array<MLLEWeaponApply@> = {null, null, BubbleGun::Weapon(), null, null, null, null, null, se::EnergyBlastMLLEWrapper()}); ///@MLLE-Generated
#include "MLLE-Include-1.8w.asc" ///@MLLE-Generated
#pragma require "mlcloister-MLLE-Data-1.j2l" ///@MLLE-Generated
#pragma require "mlcloister.j2l" ///@MLLE-Generated
#include "SEenergyblast-mlle.asc" ///@MLLE-Generated
#pragma require "SEenergyblast-mlle.asc" ///@MLLE-Generated
#include "BubbleGun.asc" ///@MLLE-Generated
#pragma require "BubbleGun.asc" ///@MLLE-Generated
///@SaveAndRunArgs -server -battle ///@MLLE-Generated

/*******************************
A 2026 Mystic Legends Release!
http://www.mysticlegends.org
/******************************/

array<jjLAYER@> LayersBeforeInsertion = {};
array<jjLAYER@> ClonedLayerSeven = {};

const array<float> LayerAdjustments = {0.8f, 0.65f, 0.5f, 0.35f};

const int LAYER7WIDTH = 1408;

void onLevelLoad() {
	jjLAYER@ chroma = MLLE::GetLayer("Colon Chroma");
	chroma.hasTiles = true;
	
	jjPAL regularPalette;
	regularPalette.load("Diam1.j2t");
	
	jjPalette.copyFrom(64, 8,  64, regularPalette);
	jjPalette.apply();
	
	//fireball sidegrade
	jjWeapons[WEAPON::GUN8].spread = SPREAD::NORMAL;
	jjObjectPresets[OBJECT::FIREBALLBULLETPU].var[6] = 8 + 16;
	jjObjectPresets[OBJECT::FIREBALLBULLETPU].lightType = LIGHT::POINT2;
	
	jjObjectPresets[OBJECT::ICEPOWERUP].direction = SPRITE::FLIPNONE;
	jjObjectPresets[OBJECT::GUN8POWERUP].direction = SPRITE::FLIPH;
	
	jjObjectPresets[OBJECT::GEMRING].behavior = CustomGemRing;
	jjObjectPresets[OBJECT::GEMRING].triggersTNT = false;
	
	//thanks Violet
    array<uint8> recolor(256);
    for (uint i = 15; i < 88; ++i) //don't change most sprite colors
        recolor[i] = i;
    for (uint i = 88; i < 96; ++i) //purple to green
        recolor[i] = i - 8;
    for (uint i = 32; i < 40; ++i) //blue to green
        recolor[i] = i + 48;
    for (uint i = 24; i < 30; ++i) //red to orange
        recolor[i] = i + 16;
    recolorAnimation(recolor, jjAnimations[jjAnimSets[ANIM::AMMO] + 63]); //bullet
    recolorAnimation(recolor, jjAnimations[jjAnimSets[ANIM::AMMO] + 61]); //pickup
    recolorAnimation(recolor, jjAnimations[jjAnimSets[ANIM::PICKUPS] + 66]); //monitor
    
	for (uint i = 0; i < 4; i++) {
		array<jjLAYER@> temp = jjLayersFromLevel(jjLevelFileName, array<uint> = {7,7,7,7}, 310*(i*1));
		ClonedLayerSeven.insertLast(temp[0]);
	}
	if (ClonedLayerSeven.length() > 0) {
		for (uint i = 0; i < ClonedLayerSeven.length(); i++) {
			ClonedLayerSeven[i].xOffset += LAYER7WIDTH * (i+1);
			ClonedLayerSeven[i].yOffset += 69 * int(i+1.2f);
					
			ClonedLayerSeven[i].xSpeed = jjLayers[7].xSpeed * LayerAdjustments[i];
			ClonedLayerSeven[i].ySpeed = jjLayers[7].ySpeed * LayerAdjustments[i];
		}
	}
	
	LayersBeforeInsertion = jjLayerOrderGet();
	
	LayersBeforeInsertion.insertAt(12, ClonedLayerSeven[0]);
	LayersBeforeInsertion.insertAt(13, ClonedLayerSeven[1]);
	LayersBeforeInsertion.insertAt(14, ClonedLayerSeven[2]);
	LayersBeforeInsertion.insertAt(15, ClonedLayerSeven[3]);

	jjLayerOrderSet(LayersBeforeInsertion);
}

void recolorAnimation(const array<uint8>& recolor, jjANIMATION@ anim) {
    for (uint i = 0; i < anim.frameCount; ++i) {
        jjANIMFRAME@ frame = jjAnimFrames[anim + i];
        jjPIXELMAP(frame).recolor(recolor).save(frame);
    }
}

///@Event 1=One Way Floor                     |+|Modifier  |One    |Way+    |Event:8|Delay Secs:8
void CustomGemRing(jjOBJ@ obj) {
	if (obj.state == STATE::START) {
		
		obj.animSpeed = 5;
		
		obj.counterEnd = uint8(jjParameterGet(int(obj.xOrg/32), int(obj.yOrg/32) + 1, 0, 8));
		obj.points = uint8(jjParameterGet(int(obj.xOrg/32), int(obj.yOrg/32) + 1, 8, 8));
		if (obj.points == 0) obj.points = 7;
		
		obj.curAnim = jjObjectPresets[obj.counterEnd].curAnim;
		
		obj.state = STATE::SLEEP;
	}
	obj.behave(BEHAVIOR::GEMRING);
}

void onFunction0(jjPLAYER@ play, uint8 makePole) {
	jjEventSet(25, 27, makePole);
}

void onFunction1(jjPLAYER@ play, uint8 makePole) {
	jjEventSet(26, 18, makePole);
}

void onFunction2(jjPLAYER@ play, uint8 makePole) {
	jjEventSet(11, 41, makePole);
}

void onFunction3(jjPLAYER@ play, uint8 makePole) {
	jjEventSet(64, 31, makePole);
}

void onFunction4(jjPLAYER@ play, uint8 makePole) {
	jjEventSet(49, 9, makePole);
}

void onFunction32(jjPLAYER@ play, uint8 makePole) {
	play.showText("@@@This warp doesn't always work...");
	play.warpToID(32);
}

void onPlayer(jjPLAYER@ play) {    
    jjWeapons[WEAPON::GUN8].gradualAim = play.powerup[WEAPON::GUN8];
}

void onLevelReload() {
	MLLE::SpawnOffgridsLocal();
	MLLE::ReapplyPalette();
}

void onLevelBegin() {
	MLLE::SpawnOffgrids();
}

bool onDrawAmmo(jjPLAYER@ player, jjCANVAS@ canvas) {
	return MLLE::WeaponHook.drawAmmo(player, canvas);
}

void onPlayerInput(jjPLAYER@ player) {
	MLLE::WeaponHook.processPlayerInput(player);
}