Downloads containing mlKnight3.j2as

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

File preview

const bool MLLESetupSuccessful = MLLE::Setup(); ///@MLLE-Generated
#include "MLLE-Include-1.6.asc" ///@MLLE-Generated
#pragma require "mlKnight3-MLLE-Data-1.j2l" ///@MLLE-Generated
#pragma require "stonar1.j2t" ///@MLLE-Generated
#pragma require "mlKnight3.j2l" ///@MLLE-Generated
///@SaveAndRunArgs -server -battle ///@MLLE-Generated

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

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

void ChippedAway(jjOBJ@ obj) {
	jjDrawTile(obj.xPos - 24, obj.yPos - 24, obj.yPos > 70*32 ? 969 : 131);
	obj.light = 0;
	obj.behave(BEHAVIOR::STEADYLIGHT, false);
}

void ChippedAway2(jjOBJ@ obj) {
	jjDrawTile(obj.xPos - 24, obj.yPos - 24, 132);
	obj.light = 0;
	obj.behave(BEHAVIOR::STEADYLIGHT, false);
}

jjPAL sewer;
void onLevelLoad() {
	jjSetWaterGradient(0, 30, 30, 0, 250, 250);
	
	jjObjectPresets[OBJECT::CHESHIRE1].behavior = ChippedAway;
	jjObjectPresets[OBJECT::CHESHIRE2].behavior = ChippedAway2;
	
	jjWeapons[WEAPON::GUN8].spread = SPREAD::NORMAL;
	jjObjectPresets[OBJECT::FIREBALLBULLETPU].var[6] = 8 + 16;
	jjObjectPresets[OBJECT::FIREBALLBULLETPU].lightType = LIGHT::POINT2;
	
	jjObjectPresets[OBJECT::BOUNCERPOWERUP].direction = SPRITE::FLIPH;
	jjObjectPresets[OBJECT::BLASTERPOWERUP].direction = SPRITE::FLIPH;

	jjObjectPresets[OBJECT::BOUNCERAMMO3].ySpeed = 1.25f;
	jjObjectPresets[OBJECT::SILVERCOIN].ySpeed = 1.f;
	
	//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;
    for (uint i = 40; i < 48; ++i) //orange to "pink"
        recolor[i] = i + 48;
    recolorAnimation(recolor, jjAnimations[jjAnimSets[ANIM::AMMO] + 63]); //bullet
    recolorAnimation(recolor, jjAnimations[jjAnimSets[ANIM::AMMO] + 61]); //pickup
    recolorAnimation(recolor, jjAnimations[jjAnimSets[ANIM::BRIDGE] + 3]); //bridge
    recolorAnimation(recolor, jjAnimations[jjAnimSets[ANIM::PICKUPS] + 66]); //monitor
}

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);
    }
}

void onLevelBegin() {
	MLLE::SpawnOffgrids();
	for (int x = 0; x < jjLayerWidth[4]; x++) {
		for (int y = 0; y < jjLayerHeight[4]; y++) {
			if (jjEventGet(x, y) == OBJECT::GENERATOR && jjParameterGet(x, y, 0, 8) == 188) {
				jjEventSet(x, y, AREA::ONEWAY);
			}
		}
	}
}

void onPlayer(jjPLAYER@ play) {
	if (play.yPos < 2400) {
		jjLayers[8].warpHorizon.fadePositionY = 0.5f;
		if (play.warpID == 78) {
			play.cameraUnfreeze(true);
		}
	}
	else {
		jjLayers[8].warpHorizon.fadePositionY = 0.f;
	}
	
	jjWeapons[WEAPON::GUN8].gradualAim = play.powerup[WEAPON::GUN8];
}

void onFunction0(jjPLAYER@ play) {
	play.warpToID(100, true);
	play.xPos = play.xPos - 16;
	play.cameraFreeze(0, 2624, false, true);
	
	jjAddParticleTileExplosion(11, 80, 595, false);
	jjAddParticleTileExplosion(12, 80, 596, false);
}

void onFunction1(jjPLAYER@ play) {
	play.warpToID(101, true);
	play.xPos = play.xPos - 16;
	play.cameraUnfreeze(true);
}