Name | Author | Game Mode | Rating | |||||
---|---|---|---|---|---|---|---|---|
The World Spear | ThunDerDraGon | Capture the flag | N/A |
const bool MLLESetupSuccessful = MLLE::Setup(); ///@MLLE-Generated
#include "MLLE-Include-1.5.asc" ///@MLLE-Generated
#pragma require "ezspear-MLLE-Data-1.j2l" ///@MLLE-Generated
#pragma require "aftermathw.j2t" ///@MLLE-Generated
#pragma require "ezspear.j2l" ///@MLLE-Generated
#pragma require "doom_spring.wav"
#pragma offer "Blood Swamps - Ambience.mp3"
#pragma offer "The World Spear - Remixed.mp3"
double counter = 135*2;
const int Delay = 100;
string A = "Approaching...";
string B = "By Warren of EZ";
array<jjPLAYER@> inGamePlayers() {
array<jjPLAYER@> players;
for (int i = 0; i < 32; i++) {
jjPLAYER@ play = jjPlayers[i];
if (play.isInGame) players.insertLast(play);
}
return players;
}
class TechSpring : jjBEHAVIORINTERFACE {
void onBehave(jjOBJ@ obj) {
if (int(obj.xOrg/32) == 131 || int(obj.xOrg/32) == 4) {
obj.xPos = obj.xOrg;
obj.yPos = obj.yOrg;
}
obj.behave(BEHAVIOR::SPRING, false);
if (obj.state == STATE::SPRING) {
jjAddParticlePixelExplosion(obj.xPos, obj.yPos, obj.curFrame, obj.direction, 1);
}
}
}
class GreyCrate : 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, 72);
}
}
class BossCTFBase : jjBEHAVIORINTERFACE {
void onBehave(jjOBJ@ obj) {
obj.behave(BEHAVIOR::FLAG, false);
}
void onDraw(jjOBJ@ obj) {
jjDrawSprite(obj.xOrg, obj.yOrg+17, ANIM::FLAG, 1, (obj.var[1] == 0) ? 0 : 1, (obj.xOrg < (jjLayerWidth[4]/2)*32) ? -1 : 1); //Base
jjDrawSprite((obj.xOrg < (jjLayerWidth[4]/2)*32) ? obj.xOrg + 70 : obj.xOrg - 70, //Character
(obj.var[1] == 0) ? obj.yOrg-5 : obj.yOrg-15,
(obj.var[1] == 0) ? ANIM::TWEEDLE : ANIM::DEVILDEVAN,
(obj.var[1] == 0) ? 6 : 21,
(obj.var[1] == 0) ? int((jjGameTicks%(11*6))/6) : int((jjGameTicks%(4*9))/9),
(obj.xOrg < (jjLayerWidth[4]/2)*32) ? 1 : -1);
if (obj.var[0] == 0)
jjDrawSprite(obj.xOrg, obj.yOrg+17, 44, (obj.var[1] == 0) ? 3 : 7, int((jjGameTicks%(8*7))/7), (obj.xOrg < (jjLayerWidth[4]/2)*32) ? -1 : 1); //Flag
}
}
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 StillPickup(jjOBJ@ obj) {
obj.behave(BEHAVIOR::PICKUP);
obj.xPos = obj.xOrg;
}
void onLevelBegin() {
for (int i = 1; i < 255; i++) {
jjOBJ@ preset = jjObjectPresets[i];
if (preset.playerHandling == HANDLING::PICKUP && (preset.eventID != OBJECT::FULLENERGY && preset.eventID != OBJECT::CARROT)) {
preset.behavior = CannotBeShotDown(preset.behavior);
}
}
}
void onLevelLoad () {
jjSampleLoad(SOUND::COMMON_SPRING1, "doom_spring.wav");
jjObjectPresets[OBJECT::GREENSPRING].behavior = TechSpring();
jjObjectPresets[OBJECT::FULLENERGY].behavior = StillPickup;
jjObjectPresets[OBJECT::CTFBASE].behavior = BossCTFBase();
jjObjectPresets[OBJECT::GUNCRATE].behavior = GreyCrate();
jjAnimSets[ANIM::TWEEDLE].load();
jjAnimSets[ANIM::DEVILDEVAN].load();
jjEnforceLighting = LIGHT::COMPLETE;
jjLayers[8].textureStyle = TEXTURE::WARPHORIZON;
jjLayers[7].spriteMode = SPRITE::BRIGHTNESS;
jjLayers[7].spriteParam = 100;
jjPlayersStickToSlopes = false;
}
void onMain() {
array<string> results;
if ((jjGameState == GAME::STARTED || jjGameState == GAME::OVERTIME) && inGamePlayers().length >= 2 && jjRegexMatch(jjMusicFileName, "blood swamps - ambience.mp3", results,true)) {
jjMusicLoad("the world spear - remixed.mp3");
} else if (jjRegexMatch(jjMusicFileName, "the world spear - remixed.mp3", results,true) && (jjGameState == GAME::STOPPED || jjGameState == GAME::PAUSED))
jjMusicLoad("blood swamps - ambience.mp3");
}
bool onDrawGameModeHUD(jjPLAYER@ player, jjCANVAS@ canvas) {
if (jjGameTicks < Delay + 550) {
jjTEXTAPPEARANCE title;
title = STRING::NORMAL;
title.align = STRING::CENTER;
canvas.drawString(jjSubscreenWidth/2 - 150, 37, "|" + A.substr(0, (jjGameTicks > Delay) ? (jjGameTicks-Delay)/8 : 0) , STRING::SMALL);
canvas.drawString(jjSubscreenWidth/2, 55, "|||" + jjLevelName, STRING::MEDIUM, title, 0, SPRITE::BLEND_NORMAL, int(115*(sin((counter/2)*2*3.1415926f/180)+1)+20));
canvas.drawString(jjSubscreenWidth/2 + 10, 85, "||||" + B.substr(0, (jjGameTicks > 280+Delay) ? (jjGameTicks-280-Delay)/8 : 0) , STRING::SMALL);
if (jjGameTicks > 150+Delay && jjGameTicks < 250+Delay)
counter++;
}
return false;
}
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.