const bool MLLESetupSuccessful = MLLE::Setup(array<MLLEWeaponApply@> = {null, null, se::RollerMLLEWrapper(), null, null, SzmolWeaponPack::PetrolBomb::Weapon(), null, se::EnergyBlastMLLEWrapper(), ArcaneWeapons::FusionCannon::Weapon()}); ///@MLLE-Generated
#include "MLLE-Include-1.5w.asc" ///@MLLE-Generated
#pragma require "ab24btl19-MLLE-Data-1.j2l" ///@MLLE-Generated
#pragma require "ab24btl19.j2l" ///@MLLE-Generated
#include "ArcaneWeapon9.asc" ///@MLLE-Generated
#pragma require "ArcaneWeapon9.asc" ///@MLLE-Generated
#include "SEenergyblast-mlle.asc" ///@MLLE-Generated
#pragma require "SEenergyblast-mlle.asc" ///@MLLE-Generated
#include "petrolBomb.asc" ///@MLLE-Generated
#pragma require "petrolBomb.asc" ///@MLLE-Generated
#include "SEroller-mlle.asc" ///@MLLE-Generated
#pragma require "SEroller-mlle.asc" ///@MLLE-Generated
/*******************************
A 2021 Mystic Legends Release!
http://www.mysticlegends.org
/******************************/
///@SaveAndRunArgs -server -battle
#include "TrueColor v13.asc"
#pragma require "mlreign-cable-green.png"
void onLevelLoad() {
TrueColor::ProcessPalette();
TrueColor::Bitmap("mlreign-cable-green.png").saveToAnimFrames(jjAnimations[jjAnimSets[ANIM::SPIKEBOLL].allocate(array<uint>={TrueColor::NumberOfFramesPerImage})]);
//begin rain
jjANIMATION@ anim = jjAnimations[jjAnimSets[ANIM::COMMON].firstAnim + 2];
for (uint frameID = 0; frameID < anim.frameCount; ++frameID) {
jjANIMFRAME@ frame = jjAnimFrames[anim.firstFrame + frameID];
jjPIXELMAP rain(2,48);
for (uint y = 0; y < rain.height; ++y) {
if (y < 32) {
rain[0,y] = 159;
}
else {
rain[0,y] = 192;
}
}
rain.save(frame);
frame.hotSpotX = -frame.width/2;
frame.hotSpotY = -frame.height;
}
for (uint animID = 2; animID <= 3; ++animID) { //ANIM::COMMON, which houses the rain animations, actually has four different animations, but only the last two are of interest here
jjANIMATION@ animX = jjAnimations[jjAnimSets[ANIM::COMMON].firstAnim + animID];
for (uint frameID = 0; frameID < animX.frameCount; ++frameID) {
jjANIMFRAME@ frame = jjAnimFrames[animX.firstFrame + frameID];
jjPIXELMAP image(frame); //Pass a jjANIMFRAME@ to a jjPIXELMAP constructor, and the resulting pixel map will use the width, height, and image of that jjANIMFRAME.
for (uint x = 0; x < image.width; ++x) //Boilerplate looping code for accessing every pixel in the map.
for (uint y = 0; y < image.height; ++y)
if (image[x,y] != 0) //For pixel maps, color 0 is transparent.
image[x,y] = 16 + (image[x,y] & 7); //162 is one of the brightest colors in the Medivo palette's wall tile gradient. Most sprites use the sprite color section of the palette, which organizes colors in groups of 8, so you can use &7 on a color to get basically its brightness without its particular gradient.
image.save(frame); //An essential last step, or the changes will only have been made to the jjPIXELMAP, not the jjANIMFRAME, and the player won't end up seeing anything change.
}
}
}
int everyOtherFlame = 0;
namespace SzmolWeaponPack {
namespace PetrolBomb {
class MyPetrol : Weapon {
void addFlames(float x, float y, uint16 crID, CREATOR::Type crType, bool send) const override {
Weapon::addFlames(x,y,crID,crType,send);
for (uint objectID = jjObjectCount; --objectID != 0;) {
jjOBJ@ bullet = jjObjects[objectID];
if (bullet.behavior == bombFlame) {
//use a different behavior (which interacts with tornado guns) but also spawn fewer/faster flames to reduce lag a bit with so much petrol ammo
if ((everyOtherFlame ^= 1) == 1) {
bullet.behavior = myFlame;
bullet.age += 456;
} else
bullet.delete();
}
}
}
}
void myFlame(jjOBJ@ obj) {
bombFlame(obj);
//jjAlert("wew");
if (obj.xSpeed == 0 && obj.ySpeed == 0) {
if (jjGameTicks & 3 == 0)
for (uint objectID = jjObjectCount; --objectID != 0;) {
jjOBJ@ bullet = jjObjects[objectID];
/*if (bullet.behavior == ArcaneWeapons::TornadoGun::Behavior && obj.doesCollide(bullet)) {
obj.xSpeed = bullet.xSpeed;
obj.ySpeed = bullet.ySpeed * 3;
obj.age /= 2;
obj.var[0] = 1;
break;
}*/
}
} else if (obj.var[0] == 1 && jjGameTicks & 7 == 0) {
jjOBJ@ fire = jjObjects[jjAddObject(OBJECT::TOASTERBULLET, obj.xPos, obj.yPos, obj.creatorID, obj.creatorType)];
fire.xSpeed = obj.xAcc = 0;
fire.ySpeed = abs(obj.xSpeed);
}
}
}
}
void onDrawLayer4(jjPLAYER@ player, jjCANVAS@ layer) {
if (!jjLowDetail && jjColorDepth == 16) {
TrueColor::DrawCanvasSprite(layer, 21*32, 27*32, ANIM::SPIKEBOLL, 0, 0);
TrueColor::DrawCanvasSprite(layer, 54*32, 58*32, ANIM::SPIKEBOLL, 0, 0);
}
}
void onMain() {
jjIsSnowing = !jjLowDetail;
jjLayerYOffset[1] = -16 + jjCos(jjGameTicks*8)*7;
jjLayerYOffset[2] = -16 + jjSin(jjGameTicks*7)*7;
for (int i = 0; i < 1024; i++) {
jjPARTICLE@ particle = jjParticles[i];
if (particle.type == PARTICLE::RAIN) {
particle.xSpeed = 0;
particle.ySpeed = jjLocalPlayers[0].ySpeed < 0? 12 : int(12 + jjLocalPlayers[0].ySpeed);
}
}
}
int loopsDone = 0;
void onFunction0(jjPLAYER@ play) {
if (play.warpID == 0) {
jjChat("/me has fallen into slime...");
play.warpToTile(48, 32);
loopsDone = 0;
}
}
void onFunction1(jjPLAYER@ play) {
if (loopsDone < 5) {
if (jjRandom()%5 > 0) {
jjSample(play.xPos, play.yPos, SOUND::BILSBOSS_ZIP, 45, 4000+(loopsDone*1500));
play.showText("§1#@@@@@@|B|||||||a|||||||d |||||||l|||||||u|||||||c|||||||k|||||||.|||||||.|||||||.");
}
else {
play.showText("§1#@@@@@@|L|||||||u|||||||c|||||||k|||||||y|||||||.|||||||.|||||||.");
loopsDone = 0;
play.warpToID(jjRandom()%4 + 10);
}
}
else {
play.showText("§1#@@@@@@|E|||||||n|||||||o|||||||u|||||||g|||||||h |||||||t|||||||o|||||||r|||||||t|||||||u|||||||r|||||||e|||||||.|||||||.|||||||.");
loopsDone = 0;
play.warpToID(jjRandom()%4 + 10);
}
loopsDone++; //wrong, but who cares
}
void onPlayer(jjPLAYER@ play) {
if (play.yPos >= 0) {
//Wherein "skill 3" means "MP Only"
int skill = jjParameterGet(uint16(play.xPos/32), uint16(play.yPos/32), -4, 2);
if (skill == 3) {
play.noFire = true;
}
else {
play.noFire = false;
}
}
}
void onPlayerInput(jjPLAYER@ player) {
MLLE::WeaponHook.processPlayerInput(player);
}
bool onDrawAmmo(jjPLAYER@ player, jjCANVAS@ canvas) {
return MLLE::WeaponHook.drawAmmo(player, canvas);
}
void onReceive(jjSTREAM&in packet, int fromClientID) {
MLLE::WeaponHook.processPacket(packet, fromClientID);
}