Downloads containing mo4a_4-2.j2as

Downloads
Name Author Game Mode Rating
TSF with JJ2+ Only: Mystery of the Four... chandie Single player 6.6 Download file

File preview

const bool MLLESetupSuccessful = MLLE::Setup(array<MLLEWeaponApply@> = {null, null, WeaponVMega::IceCloud::Weapon(), WeaponVMega::Voranj::Weapon(), WeaponVMega::Backfire::Weapon(), null, ArcaneWeapons::FusionCannon::Weapon(), null, ArcaneWeapons::MortarLauncher::Weapon()}); ///@MLLE-Generated
#include "MLLE-Include-1.5w.asc" ///@MLLE-Generated
#pragma require "mo4a_4-2-MLLE-Data-1.j2l" ///@MLLE-Generated
#pragma require "mo4a_4-2.j2l" ///@MLLE-Generated
#include "ArcaneWeapon4.asc" ///@MLLE-Generated
#pragma require "ArcaneWeapon4.asc" ///@MLLE-Generated
#include "ArcaneWeapon9.asc" ///@MLLE-Generated
#pragma require "ArcaneWeapon9.asc" ///@MLLE-Generated
#include "WeaponVMega5.asc" ///@MLLE-Generated
#pragma require "WeaponVMega5.asc" ///@MLLE-Generated
#include "WeaponVMega8.asc" ///@MLLE-Generated
#pragma require "WeaponVMega8.asc" ///@MLLE-Generated
#include "WeaponVMega3.asc" ///@MLLE-Generated
#pragma require "WeaponVMega3.asc" ///@MLLE-Generated
int slope = 0;
bool Lever13 = false, Lever14 = false, Lever15 = false, Lever16 = false;
bool onDrawAmmo(jjPLAYER@ player, jjCANVAS@ canvas) {
	return MLLE::WeaponHook.drawAmmo(player, canvas);
}

#include "Jazz1Enemies v05.asc"
#include "Resize v11.asc"
#include "TrueColor v13.asc"
#include "HH18savegems.asc"

void onLevelLoad() {
	gem::restorePlayerGems();
	jjLevelName = ("@@@@@@@@@Path to Mt. Everest");

	jjObjectPresets[OBJECT::SILVERCOIN].behavior = PlatinCoin();
	jjObjectPresets[OBJECT::SILVERCOIN].scriptedCollisions = true;

	Jazz1::MakeEnemy(OBJECT::SUCKER, Jazz1::Enemies::Holidaius_HandVertical).SetDirection(Jazz1::Directions::Right);
	Jazz1::MakeEnemy(OBJECT::RAVEN, Jazz1::Enemies::Holidaius_Devil).SetUsesJJ2StyleDeathAnimation(true).SetDeathSound(SOUND::BILSBOSS_THUNDER);
	Jazz1::MakeEnemy(OBJECT::FLOATSUCKER, Jazz1::Enemies::Holidaius_HandVertical).SetDirection(Jazz1::Directions::Left);
	Jazz1::MakeEnemy(OBJECT::HATTER, Jazz1::Enemies::Megairbase_Doofusguard).SetUsesJJ2StyleDeathAnimation(true).SetBulletFireSound(SOUND::INTRO_SHOTGRN).SetBulletExplosionSound(SOUND::COMMON_GUNSM1);

	jjObjectPresets[OBJECT::SAVEPOST].behavior = CheckpointWrapper;
	jjObjectPresets[OBJECT::SAVEPOST].deactivates = false;
	jjObjectPresets[OBJECT::GRASSPLATFORM].scriptedCollisions = true;
	jjObjectPresets[OBJECT::GRASSPLATFORM].behavior = PlatformH;
	jjObjectPresets[OBJECT::BOLLPLATFORM].scriptedCollisions = true;
	jjObjectPresets[OBJECT::BOLLPLATFORM].behavior = PlatformH2;

	jjObjectPresets[OBJECT::FRUITPLATFORM].scriptedCollisions = true;
	jjObjectPresets[OBJECT::FRUITPLATFORM].behavior = Air();
	jjObjectPresets[OBJECT::FRUITPLATFORM].deactivates = false;	
	jjObjectPresets[OBJECT::FRUITPLATFORM].state = STATE::FLOAT;	

	jjObjectPresets[OBJECT::SONICPLATFORM].scriptedCollisions = true;
	jjObjectPresets[OBJECT::SONICPLATFORM].behavior = FlyingSpring();	
	jjObjectPresets[OBJECT::SONICPLATFORM].determineCurAnim(ANIM::SPRING,6);
}

bool copterfloat = false;

class Air : jjBEHAVIORINTERFACE {

	void onBehave(jjOBJ@ obj) {
		obj.behave(BEHAVIOR::BURNING, false);
		obj.determineCurAnim(ANIM::AMMO,3);
		obj.deactivates = false;
		obj.determineCurFrame();
		++obj.counter; 
		obj.yPos = jjSin(obj.counter*3 + 5)*2 + obj.yOrg;
		jjDrawSpriteFromCurFrame(obj.xPos, obj.yPos, obj.curFrame, obj.direction, SPRITE::TRANSLUCENTSINGLEHUE, 64);
	}
	bool onObjectHit(jjOBJ@ obj, jjOBJ@ bullet, jjPLAYER@ player, int force) { 
		if(bullet is null)
			{copterfloat = true;}
		return true;
	}
}

class PlatinCoin : jjBEHAVIORINTERFACE {

	void onBehave(jjOBJ@ obj) {
		if(p.coins >= 2)
		{obj.delete();}
		obj.behave(BEHAVIOR::PICKUP, false);
		++obj.counter; 
		obj.yPos = jjSin(obj.counter*15 + 5)*4 + obj.yOrg;
		jjDrawSpriteFromCurFrame(obj.xPos, obj.yPos, obj.curFrame, obj.direction, SPRITE::PALSHIFT, -8);
}
	bool onObjectHit(jjOBJ@ obj, jjOBJ@ bullet, jjPLAYER@ player, int force) {
		p.coins += 1; 
		obj.behavior = BEHAVIOR::EXPLOSION2;		
		jjSample(obj.xPos, obj.yPos, SOUND::COMMON_COIN, 1000);

		return true;
	}
}

class FlyingSpring : jjBEHAVIORINTERFACE {

	void onBehave(jjOBJ@ obj) {
		float YSpeed = 22;
		obj.behave(BEHAVIOR::BUTTERFLY,false);
		jjDrawSpriteFromCurFrame(obj.xPos, obj.yPos, obj.curFrame, obj.direction, SPRITE::SINGLEHUE, 72);

		jjPARTICLE@ particle = jjAddParticle(PARTICLE::STAR);
		particle.snow.frame = jjRandom() & 987;
		particle.xPos = obj.xPos;
		particle.yPos = obj.yPos+14;
	}
	bool onObjectHit(jjOBJ@ obj, jjOBJ@ bullet, jjPLAYER@ player, int) {
		if(bullet !is null) {
		obj.causesRicochet = true;
		}
		else
		player.direction = player.ySpeed = -42;
		obj.scriptedCollisions = true;
		jjSample(obj.xPos, obj.yPos, SOUND::COMMON_SPRING1);
		return true;
		}
}

void PlatformH (jjOBJ@ obj) {

	switch (obj.state) {
		case STATE::START:
			obj.deactivates = true;
			obj.direction = obj.xSpeed = -2;		
			obj.determineCurAnim(ANIM::GRASSPLAT, 0);   
			obj.determineCurFrame();
			obj.playerHandling = HANDLING::SPECIAL;
			obj.state = STATE::FLY;
			obj.beSolid();
		case STATE::FLY:
			if(p.yPos < 29*32) {obj.delete();}

			if(p.yPos > 42*32 && moveplatform == true)
				{moveplatform = false;
				obj.delete();}
			if(moveplatform == true)
				{obj.xPos = obj.xPos + obj.xSpeed;
				if (jjMaskedVLine(obj.xSpeed > 0 ? obj.xPos + 16 : obj.xPos - 16, obj.yPos, 1)) 
					{obj.direction = obj.xSpeed = -obj.xSpeed;}
			}
			obj.beSolid();
			obj.deactivates = false;
			obj.draw();

			break;

	}
}

void PlatformH2 (jjOBJ@ obj) {

	switch (obj.state) {
		case STATE::START:
			obj.deactivates = true;
			obj.direction = obj.xSpeed = -2;		
			obj.determineCurAnim(ANIM::GRASSPLAT, 0);   
			obj.determineCurFrame();
			obj.playerHandling = HANDLING::SPECIAL;
			obj.state = STATE::FLY;
			obj.beSolid();
		case STATE::FLY:

			if(p.yPos > 22*32 && moveplatform2 == true)
				{obj.delete();
				moveplatform2 = false;}
			if(moveplatform2 == true)
				{obj.xPos = obj.xPos + obj.xSpeed;
				if (jjMaskedVLine(obj.xSpeed > 0 ? obj.xPos + 16 : obj.xPos - 16, obj.yPos, 1)) 
					{obj.direction = obj.xSpeed = -obj.xSpeed;}
			}
			obj.beSolid();
			obj.deactivates = false;

			obj.draw();

			break;

	}
}

bool moveplatform = false, moveplatform2 = false;

void onFunction0(jjPLAYER@ p)
{moveplatform = true;}

void onFunction1(jjPLAYER@ p)
{moveplatform = false;}

void onFunction2(jjPLAYER@ p)
{moveplatform = true;}

void onFunction3(jjPLAYER@ p)
{copterfloat = false;}

void onFunction4(jjPLAYER@ p)
{copterfloat = true;}

void onFunction5(jjPLAYER@ p) {
slope = jjGameTicks + 2*61;
}
void onFunction6(jjPLAYER@ p) {
slope = 0;
}
void onFunction7(jjPLAYER@ p)
{moveplatform2 = true;}

void onLevelReload() {
	MLLE::Palette.apply();
	gem::restorePlayerGems();
	jjLocalPlayers[0].lives++;
  	for (uint i = 0; i < 32; ++i)
	  	jjTriggers[i] = SavedTriggers[i];
}

void onPlayer(jjPLAYER@ p) {

	if(p.coins<1 && p.xPos > 78*32 && p.yPos < 2*32)
	{p.testForCoins(1);}
	if(p.coins>=1 && p.xPos >78*32 && p.yPos < 2*32)
	{jjNxt("mo4a_4-3_save", false, true);
	gem::saveGemData();}

	if(p.keyUp && Lever15 == false && p.xPos > 25*32 && p.xPos < 28*32 && p.yPos < 38*32 && p.yPos > 27*32)
	{jjTriggers[15] = false;
	Lever15 = true;}

	if(p.keyUp && Lever16 == false && p.xPos > 14*32 && p.xPos < 17*32 && p.yPos < 38*32 && p.yPos > 27*32)
	{jjTriggers[16] = false;
	Lever16 = true;}

	if(jjTriggers[16] == true)
	{Lever16 = false;}

	if(jjTriggers[15] == true)
	{Lever15 = false;}

	if(p.keyUp && Lever14 == false && p.xPos > 11*32 && p.xPos < 14*32 && p.yPos < 18*32 && p.yPos > 8*32)
	{jjTriggers[14] = false;
	Lever14 = true;}

	if(p.keyUp && Lever13 == false && p.xPos > 22*32 && p.xPos < 25*32 && p.yPos < 18*32 && p.yPos > 8*32)
	{jjTriggers[13] = false;
	Lever13 = true;}

	if(jjTriggers[13] == true)
	{Lever13 = false;}

	if(jjTriggers[14] == true)
	{Lever14 = false;}

	gem::trackPlayerGems(p);
	gem::upgradeHealth(p);
	p.lightType = LIGHT::NONE;

if(p.keyUp && slope > jjGameTicks){
	p.yPos = p.yPos - 4;
	p.invisibility = true;
	jjDrawSprite(p.xPos, p.yPos, p.setID, RABBIT::HPOLE, p.curFrame, p.direction, SPRITE::PLAYER);
	}
if(p.keyUp == false && slope > jjGameTicks){
	p.invisibility = false;
}
if(slope < jjGameTicks){
	p.invisibility = false;
}

if(copterfloat == true)
{jjCharacters[CHAR::JAZZ].helicopterYSpeed= -2;
jjCharacters[CHAR::LORI].helicopterYSpeed= -2;}
if(copterfloat == false)
{jjCharacters[CHAR::JAZZ].helicopterYSpeed= 1;
jjCharacters[CHAR::LORI].helicopterYSpeed= 1;}
}

void onMain() {
gem::deleteCollectedGems();
if(jjKey[9] && jjKey[0x51]) {
p.morphTo(CHAR::JAZZ, false); 
}
if(jjKey[9] && jjKey[0x57]) {
p.morphTo(CHAR::SPAZ, false); 
}
if(jjKey[9] && jjKey[0x45]) {
p.morphTo(CHAR::LORI, false); 
}

}

bool onDrawHealth(jjPLAYER@ player, jjCANVAS@ canvas) {

    return false;
}

bool onDrawLives(jjPLAYER@ player, jjCANVAS@ canvas) {return true;}

array<bool> SavedTriggers(32, false);
//Extendable Checkpoints by VioletCLM
void CheckpointWrapper(jjOBJ@ obj) {
  if (obj.state == STATE::STOP) { //don't do anything anymore
    jjDrawSpriteFromCurFrame(obj.xPos, obj.yPos, obj.curFrame, obj.direction, SPRITE::PALSHIFT, 8);
  } else if (obj.state == STATE::DEACTIVATE) { //due to death
    obj.deactivate();
  } else {
    obj.behave(BEHAVIOR::CHECKPOINT);
	jjDrawSpriteFromCurFrame(obj.xPos, obj.yPos, obj.curFrame, obj.direction, SPRITE::PALSHIFT, 8);
    if (obj.state == STATE::DONE) { //triggered by the player hitting it
      obj.state = STATE::STOP;
      //save the current state of some properties
      for (uint i = 0; i < 32; ++i)
        SavedTriggers[i] = jjTriggers[i];

      //OPTIONAL: this loop makes checkpoints reusable, so only the most recent checkpoint you touched is ever active
      for (int i = jjObjectCount; --i > 0;) {
        jjOBJ@ obj2 = jjObjects[i];
        if (obj2.eventID == OBJECT::CHECKPOINT && i != obj.objectID && obj2.isActive) {
          obj2.state = STATE::SLEEP;
          obj2.var[0] = 0;
        }
      }
    }
  }
}