Downloads containing ab25btl43.j2as

Downloads
Name Author Game Mode Rating
JJ2+ Only: Anniversary Bash 25 Battle Jazz2Online Battle N/A Download file

File preview

const bool MLLESetupSuccessful = MLLE::Setup(array<MLLEWeaponApply@> = {null, null, se::FireworkMLLEWrapper(), null, null, null, null, null, null}); ///@MLLE-Generated
#include "MLLE-Include-1.6w.asc" ///@MLLE-Generated
#pragma require "ab25btl43-MLLE-Data-4.j2l" ///@MLLE-Generated
#pragma require "ab25btl43-MLLE-Data-3.j2l" ///@MLLE-Generated
#pragma require "ab25btl43-MLLE-Data-2.j2l" ///@MLLE-Generated
#pragma require "ab25btl43-MLLE-Data-1.j2l" ///@MLLE-Generated
#pragma require "ab25btl43.j2l" ///@MLLE-Generated
#include "SEfirework-mlle.asc" ///@MLLE-Generated
#pragma require "SEfirework-mlle.asc" ///@MLLE-Generated
#pragma require "plausiblepsychpal02.pal"
#pragma require "meme_1.ogg"
#pragma require "meme_2.ogg"
#pragma require "meme_3.ogg"
#pragma require "meme_4.ogg"
#pragma require "meme_5.ogg"
#pragma require "meme_6.ogg"
#pragma require "meme_7.ogg"
#pragma require "meme_8.ogg"
#pragma require "meme_9.ogg"
#pragma require "bruh_2.ogg"

/*
array<float> xLayerOmega0 = {100, 200, 500, 100, 100, 0, 100, -7};
array<float> xLayerOmega = {100, 300, 400, 100, 200.9, -100, -200, -200};
array<float> xLayerAmplitude = {100, 700, 200, 3200, 2500, 200, 400, 300};
*/
array<float> yLayerOmega0 = {1, 7, 2, 1, 3.213, 2, 4, 3};
array<float> yLayerOmega = {100, 500, 2400, 1200, 500.7, -1, -1, -1};
array<float> yLayerAmplitude = {300, 580, 200, 640, 700, -69, -69, -36};

array<float> yLayerAmplitude_1 = {200, 480, 180, 580, 640, -69, -69, -28};

array<float> yLayerAmplitude_2 = {300, 580, 200, 640, 700, -69, -69, -24};

array<float> yLayerAmplitude_3 = {300, 580, 200, 640, 700, -69, -69, -20};

array<float> yLayerAmplitude_4 = {300, 580, 200, 640, 700, -69, -69, -17};

array<float> yLayerAmplitude_5 = {300, 580, 200, 640, 700, -69, -69, -14};

array<float> yLayerAmplitude_6 = {300, 580, 200, 640, 700, -69, -69, -10};

array<float> yLayerAmplitude_7 = {300, 580, 200, 640, 700, -69, -69, -7};

array<float> yLayerAmplitude_8 = {300, 580, 200, 640, 700, -69, -69, -5};


/*Timer variable, do not touch*/
int tLayer = 0;


jjPAL PsychPal;

bool palCycle = true;
const string filename = "badlsdtrip.asdat";

class CannotBeShotDown : jjBEHAVIORINTERFACE {
	CannotBeShotDown(const jjBEHAVIOR &in behavior) {
		originalBehavior = behavior;
	}
	void onBehave(jjOBJ@ obj) {
		obj.behave(originalBehavior);
		if (obj.state == STATE::FLOATFALL)
			obj.state = STATE::FLOAT;
	}
	bool onObjectHit(jjOBJ@ obj, jjOBJ@ bullet, jjPLAYER@ player, int force) {
		if (bullet is null) {
			obj.behavior = originalBehavior;
			if (player.objectHit(obj, force, obj.playerHandling))
				return true;
			obj.behavior = this;
		}
		return false;
	}
	private jjBEHAVIOR originalBehavior;
}

void onMain() {	
	jjWeapons[WEAPON::GUN8].comesFromGunCrates = true;
    jjWeapons[WEAPON::GUN9].comesFromGunCrates = true;
	
	if (jjGameTicks % 4 == 0 && palCycle) {
        for (int i = 96; i <= 111; i++) {
            jjPalette.color[i].setHSL(PsychPal.color[i].getHue() + jjGameTicks / 12, PsychPal.color[i].getSat(), PsychPal.color[i].getLight());
        }
        jjPalette.apply();
    }
	if (jjGameTicks % 1 == 0 && palCycle) {
		for (int i = 176; i <= 207; i++) {
            jjPalette.color[i].setHSL(PsychPal.color[i].getHue() + jjGameTicks / 12, PsychPal.color[i].getSat(), PsychPal.color[i].getLight());
        }
        jjPalette.apply();
	}
	for (int i = 1; i < jjObjectCount; i++) {
        jjOBJ@ obj = jjObjects[i];

		if (obj.eventID == OBJECT::SEEKERAMMO3 && obj.state == STATE::FLOAT){
			if (obj.xOrg > 12*32 && obj.xOrg < 69*32 && obj.yOrg > 22*32 && obj.yOrg < 47*32) {
			    obj.yPos = obj.yOrg + 16;
				obj.xPos = obj.xOrg + 16;
			}
		}
		if (obj.eventID == OBJECT::RFPOWERUP){
			obj.xPos = obj.xOrg + 16;
		}
	}
	
	if (jjGameTicks == 210)
		jjConsole("|You can use the following command to pause the color changing foliage:||!palette");

	jjLayerYOffset[8] =
	jjSin(jjGameTicks)*64;
	if(jjGameTicks%10 == 1)
	{
		jjSetFadeColors(int(128+jjSin(jjGameTicks/8)*126), int(128+jjSin(jjGameTicks/8+341)*126),int(128+ jjSin(jjGameTicks/8+683)*126));
	}
	
    tLayer++;
	
	array<jjLAYER@> layers = jjLayerOrderGet();
	
	layers[32].xOffset += .25f;
	layers[32].yOffset = (yLayerAmplitude[7] * cos(yLayerOmega0[7] + yLayerOmega[7] * (float(tLayer)/70)));
	layers[31].xOffset += .35f;
	layers[31].yOffset = (yLayerAmplitude_1[7] * cos(yLayerOmega0[7] + yLayerOmega[7] * (float(tLayer)/70)));
	layers[30].xOffset += .45f;
	layers[30].yOffset = (yLayerAmplitude_2[7] * cos(yLayerOmega0[7] + yLayerOmega[7] * (float(tLayer)/70)));
	layers[29].xOffset += .55f;
	layers[29].yOffset = (yLayerAmplitude_3[7] * cos(yLayerOmega0[7] + yLayerOmega[7] * (float(tLayer)/70)));
	layers[28].xOffset += .65f;
	layers[28].yOffset = (yLayerAmplitude_4[7] * cos(yLayerOmega0[7] + yLayerOmega[7] * (float(tLayer)/70)));
	layers[27].xOffset += .75f;
	layers[27].yOffset = (yLayerAmplitude_5[7] * cos(yLayerOmega0[7] + yLayerOmega[7] * (float(tLayer)/70)));
	layers[26].xOffset += .85f;
	layers[26].yOffset = (yLayerAmplitude_6[7] * cos(yLayerOmega0[7] + yLayerOmega[7] * (float(tLayer)/70)));
	layers[25].xOffset += .95f;
	layers[25].yOffset = (yLayerAmplitude_7[7] * cos(yLayerOmega0[7] + yLayerOmega[7] * (float(tLayer)/70)));
	layers[24].xOffset += 1.05f;
	layers[24].yOffset = (yLayerAmplitude_8[7] * cos(yLayerOmega0[7] + yLayerOmega[7] * (float(tLayer)/70)));

/*
    for(uint iLayer = 7; iLayer < 16; iLayer++) {
		layers[iLayer].xOffset += .4f;
        layers[iLayer].yOffset = (yLayerAmplitude[7] * cos(yLayerOmega0[7] + yLayerOmega[7] * (float(tLayer)/70)));
    }
	*/
}

void onLevelLoad() {
	jjUseLayer8Speeds = true;
	
	PsychPal.load("plausiblepsychpal02.pal");
	PsychPal.color[255].red = PsychPal.color[255].green = PsychPal.color[255].blue = 0;
	PsychPal.apply();
	
	generateCustomSpringSprites(jjAnimSets[ANIM::CUSTOM[9]], array<uint> = {40, 48, 16, 88});
    turnIntoCustomSpring(jjObjectPresets[OBJECT::FROZENSPRING], 0, 19.75f, false);
    turnIntoCustomSpring(jjObjectPresets[OBJECT::HORREDSPRING], 1, 17.75f, false);
    turnIntoCustomSpring(jjObjectPresets[OBJECT::HORGREENSPRING], 2, 27.45f, false);
    turnIntoCustomSpring(jjObjectPresets[OBJECT::HORBLUESPRING], 3, 32.5f, false);
	
	jjObjectPresets[OBJECT::HORREDSPRING].causesRicochet = jjObjectPresets[OBJECT::HORBLUESPRING].causesRicochet = jjObjectPresets[OBJECT::HORGREENSPRING].causesRicochet = false;
	
	jjDelayGeneratedCrateOrigins = true;
	
	jjObjectPresets[OBJECT::RFPOWERUP].direction = -1;
	jjObjectPresets[OBJECT::TOASTERPOWERUP].direction = 0;
	
	jjWeapons[WEAPON::GUN8].spread = SPREAD::NORMAL;
	jjObjectPresets[OBJECT::FIREBALLBULLETPU].var[6] = 8 + 16;
}

jjANIMSET@ customSpringSprite;
array<int> fastCustomSpringSpeeds(jjLocalPlayerCount);
bool generateCustomSpringSprites(jjANIMSET@ anim, const array<uint> &in colors) {
    int length = colors.length();
    bool success = (@customSpringSprite = anim).allocate(array<uint>(length * 3, 5)) !is null;
    if (success) {
        uint srcSet = jjAnimSets[ANIM::SPRING];
        for (int i = 0; i < length; i++) {
            uint color = colors[i];
            uint destAnimOffset = anim + i * 3;
            for (int j = 0; j < 3; j++) {
                uint srcAnim = jjAnimations[srcSet + j];
                uint destAnim = jjAnimations[destAnimOffset + j];
                for (int k = 0; k < 5; k++) {
                    jjPIXELMAP image(jjAnimFrames[destAnim + k] = jjAnimFrames[srcAnim + k]);
                    int width = image.width;
                    int height = image.height;
                    for (int l = 0; l < height; l++) {
                        for (int m = 0; m < width; m++) {
                            int pixel = image[m, l];
                            if (pixel >= 32 && pixel < 40)
                                image[m, l] = color + (pixel & 7);
                        }
                    }
                    if (!image.save(jjAnimFrames[destAnim + k]))
                        return false;
                }
            }
        }
    }
    return success;
}
void initializeCustomSpring(jjOBJ@ obj) {
    int anim = obj.curAnim;
    obj.behave(obj.behavior = BEHAVIOR::SPRING, false);
    if (obj.curAnim != anim) {
        obj.curAnim = anim + 2;
        obj.determineCurFrame();
    }
    obj.draw();
}
 
void turnIntoCustomSpring(jjOBJ@ obj, uint color, float power, bool horizontal) {
    if (horizontal) {
        obj.xSpeed = power;
        obj.ySpeed = 0.f;
    } else {
        obj.xSpeed = 0.f;
        obj.ySpeed = -power;
        if (obj.state == STATE::START && obj.creatorType == CREATOR::LEVEL) {
            int x = int(obj.xPos) >> 5;
            int y = int(obj.yPos) >> 5;
            if (jjParameterGet(x, y, 0, 1) != 0) {
                jjParameterSet(x, y, 0, 1, 0);
                obj.yPos -= 4.f;
                obj.ySpeed = power;
            }
        }
    }
    obj.behavior = initializeCustomSpring;
    obj.curAnim = customSpringSprite + color * 3 + (horizontal ? 1 : 0);
    obj.energy = obj.frameID = obj.freeze = obj.justHit = obj.light = obj.points = 0;
    obj.isBlastable = obj.isTarget = obj.scriptedCollisions = obj.triggersTNT = false;
    obj.deactivates = obj.isFreezable = true;
    obj.bulletHandling = HANDLING::IGNOREBULLET;
    obj.playerHandling = HANDLING::SPECIAL;
    obj.lightType = LIGHT::NORMAL;
    obj.determineCurFrame();
}
 
void handleFastCustomSpringSpeeds(jjPLAYER@ play) {
        if (play.ySpeed < -32.f) {
                fastCustomSpringSpeeds[play.localPlayerID] = int(ceil((play.ySpeed + 32.f) / -0.125f));
        } else if (fastCustomSpringSpeeds[play.localPlayerID] != 0) {
                if (play.ySpeed < -31.f) {
                        fastCustomSpringSpeeds[play.localPlayerID]--;
                        play.ySpeed = -32.f;
                } else {
                        fastCustomSpringSpeeds[play.localPlayerID] = 0;
                }
        }
}

void onPlayer(jjPLAYER@ play) {
	play.lightType = LIGHT::NONE;
	
	handleFastCustomSpringSpeeds(play);
}

bool onLocalChat(string &in text, CHAT::Type type) {
	if (jjRegexMatch(text, "!palette", true)) {
		if (palCycle) {
			jjConsole("Palette cycling disabled!");
			palCycle = false;
			jjSTREAM stream;
			stream.push(palCycle);
			stream.save(filename);
		}
		else {
			jjConsole("Palette cycling enabled!");
			palCycle = true;
			jjSTREAM stream;
			stream.push(palCycle);
			stream.save(filename);
		}
	return true;
	}
	else return false;
}
void onLevelReload() {
	MLLE::SpawnOffgridsLocal();
	MLLE::ReapplyPalette();
}

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

void onLevelBegin() {
	MLLE::SpawnOffgrids();
	for (int i = 1; i < 255; i++) {
		jjOBJ@ preset = jjObjectPresets[i];
		if (preset.playerHandling == HANDLING::PICKUP) {
			preset.behavior = CannotBeShotDown(preset.behavior);
		}
	}
	if(!jjSampleIsLoaded(SOUND::ZDOG_WAF3)) {
		jjSampleLoad(SOUND::ZDOG_WAF3,"bruh_2.ogg");
	}
	if(!jjSampleIsLoaded(SOUND::ZDOG_WAF2)) {
		jjSampleLoad(SOUND::ZDOG_WAF2,"meme_1.ogg");
	}
	if(!jjSampleIsLoaded(SOUND::ZDOG_WAF1)) {
		jjSampleLoad(SOUND::ZDOG_WAF1,"meme_2.ogg");
	}
	if(!jjSampleIsLoaded(SOUND::ZDOG_SNIF1)) {
		jjSampleLoad(SOUND::ZDOG_SNIF1,"meme_3.ogg");
	}
	if(!jjSampleIsLoaded(SOUND::SKELETON_BONE7)) {
		jjSampleLoad(SOUND::SKELETON_BONE7,"meme_4.ogg");
	}
	if(!jjSampleIsLoaded(SOUND::SKELETON_BONE1)) {
		jjSampleLoad(SOUND::SKELETON_BONE1,"meme_5.ogg");
	}
	if(!jjSampleIsLoaded(SOUND::SKELETON_BONE2)) {
		jjSampleLoad(SOUND::SKELETON_BONE2,"meme_6.ogg");
	}
	if(!jjSampleIsLoaded(SOUND::SKELETON_BONE3)) {
		jjSampleLoad(SOUND::SKELETON_BONE3,"meme_7.ogg");
	}
	if(!jjSampleIsLoaded(SOUND::SKELETON_BONE5)) {
		jjSampleLoad(SOUND::SKELETON_BONE5,"meme_8.ogg");
	}
	if(!jjSampleIsLoaded(SOUND::SKELETON_BONE6)) {
		jjSampleLoad(SOUND::SKELETON_BONE6,"meme_9.ogg");
	}
}

void onFunction1(jjPLAYER@ play) {
	jjSample(play.xPos, play.yPos, SOUND::ZDOG_WAF3, 100, 0);
}

void onFunction2(jjPLAYER@ play) {
	jjSample(play.xPos, play.yPos, SOUND::ZDOG_WAF2, 100, 0);
}

void onFunction3(jjPLAYER@ play) {
	jjSample(play.xPos, play.yPos, SOUND::ZDOG_WAF1, 100, 0);
}

void onFunction4(jjPLAYER@ play) {
	jjSample(play.xPos, play.yPos, SOUND::ZDOG_SNIF1, 100, 0);
}

void onFunction5(jjPLAYER@ play) {
	jjSample(play.xPos, play.yPos, SOUND::SKELETON_BONE7, 100, 0);
}

void onFunction6(jjPLAYER@ play) {
	jjSample(play.xPos, play.yPos, SOUND::SKELETON_BONE1, 100, 0);
}

void onFunction7(jjPLAYER@ play) {
	jjSample(play.xPos, play.yPos, SOUND::SKELETON_BONE2, 100, 0);
}

void onFunction8(jjPLAYER@ play) {
	jjSample(play.xPos, play.yPos, SOUND::SKELETON_BONE3, 100, 0);
}

void onFunction9(jjPLAYER@ play) {
	jjSample(play.xPos, play.yPos, SOUND::SKELETON_BONE5, 100, 0);
}

void onFunction10(jjPLAYER@ play) {
	jjSample(play.xPos, play.yPos, SOUND::SKELETON_BONE6, 100, 0);
}