Downloads containing mlKnight3ctf.j2as

Downloads
Name Author Game Mode Rating
TSF with JJ2+ Only: Starling (CTF) cooba Capture the flag N/A Download file

File preview

const bool MLLESetupSuccessful = MLLE::Setup(); ///@MLLE-Generated
#include "MLLE-Include-1.6.asc" ///@MLLE-Generated
#pragma require "mlKnight3ctf-MLLE-Data-1.j2l" ///@MLLE-Generated
#pragma require "marbels.j2t" ///@MLLE-Generated
#pragma require "stonar1.j2t" ///@MLLE-Generated
#pragma require "mlKnight3ctf.j2l" ///@MLLE-Generated
///@SaveAndRunArgs -server -capture ///@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);
			//}
		//}
	//}
}

array<int> fastCustomSpringSpeeds(jjLocalPlayerCount, 0);
void onPlayer(jjPLAYER@ player) {
	jjWeapons[WEAPON::GUN8].gradualAim = player.powerup[WEAPON::GUN8];
	
	if (player.ySpeed < -32.f) {
		fastCustomSpringSpeeds[player.localPlayerID] = int(ceil((player.ySpeed + 32.f) / -0.125f));
	} else if (fastCustomSpringSpeeds[player.localPlayerID] != 0) {
		if (player.ySpeed < -31.f) {
				fastCustomSpringSpeeds[player.localPlayerID]--;
				player.ySpeed = -32.f;
		} else {
				fastCustomSpringSpeeds[player.localPlayerID] = 0;
		}
	}
}

void onFunction10(jjPLAYER@ play) {
	//play.suckerTube(0, -40, false);
	play.ySpeed = -42;
	//play.ballTime = 17;
	jjSample(play.xPos, play.yPos, SOUND::COMMON_BURN, 0, 20000);
	jjAddParticlePixelExplosion(play.xPos, play.yPos + 16, play.curFrame, play.direction, 1);
}