| Name | Author | Game Mode | Rating | |||||
|---|---|---|---|---|---|---|---|---|
| Plumber Slumber | Dragusela | Battle | N/A | |||||
const bool MLLESetupSuccessful = MLLE::Setup(array<MLLEWeaponApply@> = {null, null, BubbleGun::Weapon(), null, ArcaneWeapons::MortarLauncher::Weapon(), null, null, null, null}); ///@MLLE-Generated
#include "MLLE-Include-1.8w.asc" ///@MLLE-Generated
#pragma require "xlmplumber-MLLE-Data-2.j2l" ///@MLLE-Generated
#pragma require "xlmplumber-MLLE-Data-1.j2l" ///@MLLE-Generated
#pragma require "JungUlt-Day.j2t" ///@MLLE-Generated
#pragma require "DiamUlt-Day.j2t" ///@MLLE-Generated
#pragma require "Noka - Labrat.j2t" ///@MLLE-Generated
#pragma require "central005.j2t" ///@MLLE-Generated
#pragma require "xlmplumber.j2l" ///@MLLE-Generated
#include "ArcaneWeapon4.asc" ///@MLLE-Generated
#pragma require "ArcaneWeapon4.asc" ///@MLLE-Generated
#include "BubbleGun.asc" ///@MLLE-Generated
#pragma require "BubbleGun.asc" ///@MLLE-Generated
///@SaveAndRunArgs -server -battle ///@MLLE-Generated
int waterHeight = 46.75*32;
void onLevelReload() {
MLLE::SpawnOffgridsLocal();
MLLE::ReapplyPalette();
}
void onLevelLoad() {
jjUseLayer8Speeds = true;
jjObjectPresets[OBJECT::GUNCRATE].behavior = CustomCrate();
jjWeapons[WEAPON::GUN8].comesFromGunCrates = true;
jjWeapons[WEAPON::GUN9].comesFromGunCrates = true;
jjWeapons[WEAPON::GUN8].spread = SPREAD::NORMAL;
jjObjectPresets[OBJECT::FIREBALLBULLETPU].var[6] = 8 + 16;
jjObjectPresets[OBJECT::FIREBALLBULLETPU].lightType = LIGHT::POINT2;
jjObjectPresets[OBJECT::TOASTERBULLETPU].behavior = SuperToaster();
jjObjectPresets[OBJECT::TOASTERBULLETPU].lightType = LIGHT::FLICKER;
jjObjectPresets[OBJECT::TOASTERBULLETPU].light = 12;
jjSetWaterLevel(46.75*32,true);
jjWaterLayer = 1;
jjWaterLighting = WATERLIGHT::GLOBAL;
generateCustomSpringSprites(jjAnimSets[ANIM::CUSTOM[0]], array<uint> = {40});
turnIntoCustomSpring(jjObjectPresets[OBJECT::FROZENSPRING], 0, 19.f, false);
jjPIXELMAP rain(32,32);
for (uint x = 0; x < rain.width; ++x) {
for (uint y = 0; y < rain.height; ++y) {
if (x == 16) { //draw in the middle of the tile, xPixel 16
if (y <= 24) rain[x,y] = 75; //if at yPixel 24 or less, use color 75
else rain[x,y] = 74; //use color 74 for yPixels 25-32
} else {
rain[x,y] = 0;
}
}
}
jjANIMATION@ anim = jjAnimations[jjAnimSets[ANIM::COMMON].firstAnim + 2];
for (uint frameID = 0; frameID < anim.frameCount; ++frameID) {
jjANIMFRAME@ frame = jjAnimFrames[anim.firstFrame + frameID];
rain.save(frame);
frame.hotSpotX = -frame.width/2;
frame.hotSpotY = -frame.height;
}
}
class CustomCrate : jjBEHAVIORINTERFACE {
void onBehave(jjOBJ@ obj) {
obj.behave(BEHAVIOR::CRATE, false);
}
void onDraw(jjOBJ@ obj) {
jjDrawSpriteFromCurFrame(obj.xPos, obj.yPos, obj.curFrame, obj.direction, SPRITE::SINGLEHUE, 216);
}
}
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 onLevelBegin() {
MLLE::SpawnOffgrids();
for (int i = 1; i < 255; i++) {
jjOBJ@ preset = jjObjectPresets[i];
if (preset.playerHandling == HANDLING::PICKUP) {
preset.behavior = CannotBeShotDown(preset.behavior);
}
}
}
void onPlayer(jjPLAYER@ player) {
player.lightType = LIGHT::NONE;
jjWeapons[WEAPON::GUN8].gradualAim = player.powerup[WEAPON::GUN8];
for (int i = 0; i < 1024; i++) {
jjPARTICLE@ particle = jjParticles[i];
if (particle.type == PARTICLE::RAIN) {
particle.xSpeed = 0;
particle.ySpeed = player.ySpeed < 0? 10 : int(10 + player.ySpeed);
}
}
}
bool onDrawAmmo(jjPLAYER@ player, jjCANVAS@ canvas) {
return MLLE::WeaponHook.drawAmmo(player, canvas);
}
class SuperToaster : jjBEHAVIORINTERFACE {
void onBehave(jjOBJ@ obj) {
obj.behave(BEHAVIOR::TOASTERBULLET);
if (obj.counter == 1) obj.xSpeed = 5 * obj.direction;
if (obj.xSpeed != 0) obj.ySpeed += 0.085;
jjPARTICLE@ cinders = jjAddParticle(PARTICLE::FIRE);
if (cinders !is null && obj.counter > 10) {
cinders.xPos = int(obj.xPos - 8) + jjRandom()%17;
cinders.yPos = int(obj.yPos - 8) + jjRandom()%17;
cinders.fire.color = 32;
cinders.fire.colorStop = 40;
cinders.fire.colorDelta = 2;
}
}
}
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();
}
Jazz2Online © 1999-INFINITY (Site Credits). We have a Privacy Policy. Jazz Jackrabbit, Jazz Jackrabbit 2, Jazz Jackrabbit Advance and all related trademarks and media are ™ and © Epic Games. Lori Jackrabbit is © Dean Dodrill. J2O development powered by Loops of Fury and Chemical Beats.
Eat your lima beans, Johnny.