const bool MLLESetupSuccessful = MLLE::Setup(array = {null, null, se::FireworkMLLEWrapper(), null, SmokeWopens::PhoenixGun::Wopen(), null, null, null, null}); ///@MLLE-Generated #include "MLLE-Include-1.8w.asc" ///@MLLE-Generated #pragma require "ab28btl13-MLLE-Data-2.j2l" ///@MLLE-Generated #pragma require "ab28btl13-MLLE-Data-1.j2l" ///@MLLE-Generated #pragma require "SilencedCathedral.j2t" ///@MLLE-Generated #pragma require "Lowaa.j2t" ///@MLLE-Generated #pragma require "Castle2E.j2t" ///@MLLE-Generated #pragma require "ab28btl13.j2l" ///@MLLE-Generated #include "PhoenixGun.asc" ///@MLLE-Generated #pragma require "PhoenixGun.asc" ///@MLLE-Generated #include "SEfirework-mlle.asc" ///@MLLE-Generated #pragma require "SEfirework-mlle.asc" ///@MLLE-Generated ///@SaveAndRunArgs -server -battle ///@MLLE-Generated /******************************* A 2025 Mystic Legends Release! http://www.mysticlegends.org /******************************/ void onLevelLoad() { jjPAL antiEclipse; antiEclipse.load("Diam1.j2t"); jjPalette.copyFrom(24, 16, 24, antiEclipse, 0.35f); jjPalette.copyFrom(40, 1, 40, antiEclipse, 0.65f); jjPalette.copyFrom(41, 15, 41, antiEclipse, 0.35f); jjPalette.copyFrom(64, 8, 64, antiEclipse, 0.35f); //jjPalette.copyFrom(72, 8, 72, antiEclipse, 1.f); jjPalette.copyFrom(80, 8, 80, antiEclipse, 0.65f); jjPalette.copyFrom(88, 8, 88, antiEclipse, 0.35f); jjPalette.apply(); jjObjectPresets[OBJECT::STEADYLIGHT].behavior = light; jjObjectPresets[OBJECT::TNTAMMO3].behavior = invis; jjObjectPresets[OBJECT::CHICKENLEG].behavior = WallChicken; jjObjectPresets[OBJECT::CHICKENLEG].isBlastable = false; jjObjectPresets[OBJECT::BOUNCERPOWERUP].direction = SPRITE::FLIPH; jjObjectPresets[OBJECT::GUN8POWERUP].direction = SPRITE::FLIPNONE; jjWeapons[WEAPON::GUN8].spread = SPREAD::NORMAL; jjObjectPresets[OBJECT::FIREBALLBULLETPU].var[6] = 8 + 16; jjObjectPresets[OBJECT::FIREBALLBULLETPU].lightType = LIGHT::POINT2; jjObjectPresets[OBJECT::RFAMMO3].behavior = CannotBeShotDown(jjObjectPresets[OBJECT::RFAMMO3].behavior); jjANIMSET@ animSet = jjAnimSets[ANIM::CUSTOM[0]]; animSet.allocate(array(light_count, 8)); for (int i = 192; i != 320; i += 64) { uint firstFrame = jjAnimations[animSet + (i == 256 ? light_intense : light_bright)]; for (uint j = 0; j < 8; j++) { uint radius = 2 << j; float multiplier = float(i) / float(radius); jjPIXELMAP light(radius * 2, radius * 2); for (uint k = 0; k < radius; k++) { uint top = radius - k - 1, bottom = radius + k; for (uint l = 0; l < radius; l++) { uint left = radius - l - 1, right = radius + l; int value = i - 1 - int(multiplier * sqrt(float(k * k + l * l))); if (value < 10) value = 0; light[left, top] = light[right, top] = light[left, bottom] = light[right, bottom] = value; } } jjANIMFRAME@ frame = jjAnimFrames[firstFrame + j]; light.save(frame); frame.hotSpotX = frame.hotSpotY = -radius; } } uint highestIntensityAnim = jjAnimations[animSet + 3]; for (int i = 2; i != 0; i--) { uint firstFrame = jjAnimations[animSet + (i == 1 ? light_subtle : light_dim)]; for (uint j = 0; j < 8; j++) { uint radius = 2 << j; jjPIXELMAP light(jjAnimFrames[highestIntensityAnim + j]); for (uint k = 0; k < radius; k++) { uint top = radius - k - 1, bottom = radius + k; for (uint l = 0; l < radius; l++) { uint left = radius - l - 1, right = radius + l; int value = light[left, top] >> i; if (value < 10) value = 0; light[left, top] = light[right, top] = light[left, bottom] = light[right, bottom] = value; } } jjANIMFRAME@ frame = jjAnimFrames[firstFrame + j]; light.save(frame); frame.hotSpotX = frame.hotSpotY = -radius; } } { uint firstFrame = jjAnimations[animSet + light_halo]; for (uint i = 0; i < 8; i++) { uint radius = 2 << i; float multiplierOut = 2048.f / float(radius); float multiplierIn = multiplierOut * 0.25f; float rim = radius * 7 / 8; jjPIXELMAP light(radius * 2, radius * 2); for (uint j = 0; j < radius; j++) { uint top = radius - j - 1, bottom = radius + j; for (uint k = 0; k < radius; k++) { uint left = radius - k - 1, right = radius + k; float dist = rim - sqrt(float(j * j + k * k)); int value = 255 - int((dist >= 0.f ? multiplierIn : multiplierOut) * abs(dist)); if (value < 5) value = 0; light[left, top] = light[right, top] = light[left, bottom] = light[right, bottom] = value; } } jjANIMFRAME@ frame = jjAnimFrames[firstFrame + i]; light.save(frame); frame.hotSpotX = frame.hotSpotY = -radius; } } } class CannotBeShotDown : jjBEHAVIORINTERFACE { jjBEHAVIOR originalBehavior; CannotBeShotDown(jjBEHAVIOR behavior) { originalBehavior = behavior; } void onBehave(jjOBJ@ obj) override { obj.behave(originalBehavior); if (obj.state == STATE::FLOATFALL) obj.state = STATE::FLOAT; if (obj.eventID == OBJECT::FULLENERGY) obj.xPos = obj.xOrg - 16; } bool onObjectHit(jjOBJ@ obj, jjOBJ@ bullet, jjPLAYER@ player, int force) { obj.behavior = originalBehavior; if (bullet is null) player.objectHit(obj, force, obj.playerHandling); else bullet.objectHit(obj, obj.playerHandling); obj.behavior = CannotBeShotDown(obj.behavior); return true; } } void onLevelReload() { MLLE::SpawnOffgridsLocal(); MLLE::ReapplyPalette(); } void onMain() { jjLAYER@ moon = MLLE::GetLayer("Moon"); if (jjColorDepth == 8) { moon.xOffset = -34; moon.yOffset = 120; } else { moon.xOffset = -32; moon.yOffset = 128; } } //Seren's light coronas. enum light_type { light_dim, light_subtle, light_bright, light_intense, light_halo, light_count, }; interface drawable { void draw(jjPLAYER@, jjCANVAS@) const; //??? } class drawableQueue : drawable { private array queue; void draw(jjPLAYER@ player, jjCANVAS@ canvas) const override { for (uint i = 0; i < queue.length(); i++) { queue[i].draw(player, canvas); } } void clear() { queue.resize(0); } void push(const drawable@ sprite) { queue.insertLast(sprite); } } array queues(9); void clearSprites() { for (int i = 0; i <= 8; i++) { queues[i].clear(); } } void drawLayer(jjPLAYER@ player, jjCANVAS@ canvas, uint layer) { queues[layer].draw(player, canvas); } void pushSprite(uint layer, const drawable@ sprite) { queues[layer].push(sprite); } class lightSprite : drawable { private float x, y, radius, scale; private int color, frame, anim; lightSprite(float X, float Y, float R, uint8 C, light_type A, float Q) { x = X; y = Y; radius = R; color = C; anim = A; float quality = 1.f / Q; frame = -1; scale = radius; do { frame++; scale /= 2.f; } while (frame < 7 && scale > quality); } void draw(jjPLAYER@ player, jjCANVAS@ canvas) const override { //if (radius > 0.f //&& player.cameraX < x + radius //&& player.cameraY < y + radius //&& player.cameraX + jjSubscreenWidth > x - radius //&& player.cameraY + jjSubscreenHeight > y - radius) canvas.drawResizedSprite(int(x), int(y), ANIM::CUSTOM[0], anim, frame, scale, scale, SPRITE::ALPHAMAP, color); } } void light(jjOBJ@ obj) { if (obj.state == STATE::START) { obj.state = STATE::IDLE; //obj.special = 16 + 8 * jjParameterGet(int(obj.xOrg) >> 5, int(obj.yOrg) >> 5, 0, 2); if (jjParameterGet(int(obj.xOrg) >> 5, int(obj.yOrg) >> 5, 2, 1) == 1) { obj.xPos = obj.xPos + 16.f; obj.yPos = obj.yPos + 8.f; } obj.counterEnd = jjParameterGet(int(obj.xOrg) >> 5, int(obj.yOrg) >> 5, 3, 7); obj.animSpeed = 0x2000 / obj.counterEnd; } if ((obj.counter += obj.animSpeed) >= 0x8000) obj.counter = 0; pushSprite(7, lightSprite(int(jjResolutionWidth / 5) + 1, int(jjResolutionHeight / 5) - 112, obj.counterEnd * 1.75f, 40, light_bright, jjLowDetail ? 0.5f : 1.2f)); } void onDrawLayer7(jjPLAYER@ player, jjCANVAS@ canvas) { drawLayer(player, canvas, 7); } void invis(jjOBJ@ obj) { obj.behave(BEHAVIOR::PICKUP, false); } void WallChicken(jjOBJ@ obj) { obj.behave(BEHAVIOR::PICKUP, false); int frame = obj.objectID * 8 + jjGameTicks; frame = (frame + int(obj.xPos) + int(obj.yPos) * 256)*16; jjDrawSprite(obj.xPos, obj.yPos + jjSin(frame)*4, ANIM::PICKUPS, 17, 0, 0, SPRITE::NORMAL, 0, 5); } void onPlayer(jjPLAYER@ player) { if (player.localPlayerID == 0) clearSprites(); //Copter timer fix for (int i = 1; i < jjObjectCount; i++) { if (jjObjects[i].isActive && jjObjects[i].eventID == OBJECT::COPTER && jjObjects[i].state == STATE::FLY) { //Only set the counter if it's available to take jjObjects[i].counter = 0; if (jjObjects[i].var[4] == 0) jjObjects[i].state = STATE::DONE; } } player.powerup[5] = true; jjLAYER@ secr = MLLE::GetLayer("secret passage"); if (jjTriggers[1]) { secr.hasTiles = true; player.noFire = true; player.invisibility = true; } else { secr.hasTiles = false; player.noFire = false; player.invisibility = false; } } bool onDrawAmmo(jjPLAYER@ player, jjCANVAS@ canvas) { return MLLE::WeaponHook.drawAmmo(player, canvas); } void onLevelBegin() { MLLE::SpawnOffgrids(); } void onFunction15(jjPLAYER@ player) { player.showText("@@@§1Birdo unleashes:@@ASSAULTER!", STRING::MEDIUM); }