Downloads containing mo4a_3-4.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, DefaultWeapons::Blaster(), DefaultWeapons::Blaster(), WeaponVMega::Backfire::Weapon(), null, ArcaneWeapons::FusionCannon::Weapon(), null, ArcaneWeapons::MortarLauncher::Weapon()}); ///@MLLE-Generated
#include "MLLE-Include-1.5w.asc" ///@MLLE-Generated
#pragma require "mo4a_3-4.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 "MLLE-DefaultWeapons.asc" ///@MLLE-Generated
#pragma require "MLLE-DefaultWeapons.asc" ///@MLLE-Generated
#include "Jazz1Enemies v05.asc"
#include "Resize v11.asc"
#include "TrueColor v13.asc"

bool boss = false; 
int Lever19 = 0, Lever21 = 0, Lever22 = 0, killThea = 0;
int CountlessDoubleJumps = 0;
bool poisoned= false, ElevatorUp = false;
uint limitedOxygen = 0;
int slope = 0, exit = 0;
bool Leveractivated22 = false, 	Leveractivated21 = false, Leveractivated19 = false, control = true;

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


bool onDrawAmmo(jjPLAYER@ p, jjCANVAS@ canvas)   {
	return MLLE::WeaponHook.drawAmmo(p, canvas);
if(p.xPos < 223*32){
return false;}
else return true;
}
 
bool onDrawHealth(jjPLAYER@ play, jjCANVAS@ canvas) {
if(p.xPos < 223*32){
    canvas.drawSprite(20, 585, ANIM::PICKUPS, 11, jjGameTicks>>2, -1, SPRITE::NORMAL);
    canvas.drawString(30, 585, formatInt(exit%4, "1") + "/3", STRING::SMALL, STRING::NORMAL);

  if (limitedOxygen > 0 && limitedOxygen < 420) {
  canvas.drawSprite(jjSubscreenWidth-12, jjSubscreenHeight-574, ANIM::COMMON, 1, 3, 0, SPRITE::NORMAL, 0); canvas.drawSprite(jjSubscreenWidth-28, jjSubscreenHeight-574, ANIM::COMMON, 1, 3, 0, SPRITE::NORMAL, 0); canvas.drawSprite(jjSubscreenWidth-44, jjSubscreenHeight-574, ANIM::COMMON, 1, 3, 0, SPRITE::NORMAL, 0); canvas.drawSprite(jjSubscreenWidth-60, jjSubscreenHeight-574, ANIM::COMMON, 1, 3, 0, SPRITE::NORMAL, 0);
  canvas.drawSprite(jjSubscreenWidth-76, jjSubscreenHeight-574, ANIM::COMMON, 1, 3, 0, SPRITE::NORMAL, 0);
  }
 
  if (limitedOxygen > 420 && limitedOxygen < 840) {
  canvas.drawSprite(jjSubscreenWidth-12, jjSubscreenHeight-574, ANIM::COMMON, 1, 3, 0, SPRITE::NORMAL, 0); canvas.drawSprite(jjSubscreenWidth-28, jjSubscreenHeight-574, ANIM::COMMON, 1, 3, 0, SPRITE::NORMAL, 0); canvas.drawSprite(jjSubscreenWidth-44, jjSubscreenHeight-574, ANIM::COMMON, 1, 3, 0, SPRITE::NORMAL, 0); canvas.drawSprite(jjSubscreenWidth-60, jjSubscreenHeight-574, ANIM::COMMON, 1, 3, 0, SPRITE::NORMAL, 0);
  }
 
  if (limitedOxygen > 840 && limitedOxygen < 1260) {
  canvas.drawSprite(jjSubscreenWidth-12, jjSubscreenHeight-574, ANIM::COMMON, 1, 3, 0, SPRITE::NORMAL, 0); canvas.drawSprite(jjSubscreenWidth-28, jjSubscreenHeight-574, ANIM::COMMON, 1, 3, 0, SPRITE::NORMAL, 0); canvas.drawSprite(jjSubscreenWidth-44, jjSubscreenHeight-574, ANIM::COMMON, 1, 3, 0, SPRITE::NORMAL, 0);
  }
 
  if (limitedOxygen > 1260 && limitedOxygen < 1680) {
  canvas.drawSprite(jjSubscreenWidth-12, jjSubscreenHeight-574, ANIM::COMMON, 1, 3, 0, SPRITE::NORMAL, 0); canvas.drawSprite(jjSubscreenWidth-28, jjSubscreenHeight-574, ANIM::COMMON, 1, 3, 0, SPRITE::NORMAL, 0);
  }
 
  if (limitedOxygen > 1680 && limitedOxygen < 2100) {
  canvas.drawSprite(jjSubscreenWidth-12, jjSubscreenHeight-574, ANIM::COMMON, 1, 3, 0, SPRITE::NORMAL, 0);
  }
 
  return false;
}
else return true;
}
	
bool doorunblocked = false;

void onPlayer(jjPLAYER@ p) {

		if(control==false)
		{p.keyLeft = false;
		p.keyRight = false;
		p.keyDown = false;}

		if(p.idle > 100 && p.xPos < 223*32)
		{p.cameraUnfreeze(true);
		control=true;}
		else if (p.idle > 5 && (p.keyLeft || p.keyRight || p.keyJump || p.keyFire))
		{p.cameraUnfreeze(true);
		control=true;}

	exit = 0;
	if(jjTriggers[4] == true)
		{exit += 1;}
	if(jjTriggers[7] == true)
		{exit += 1;}
	if(jjTriggers[15] == true)
		{exit += 1;}

	gem::trackPlayerGems(p);
	gem::upgradeHealth(p);

 		if (doorunblocked == false && jjTriggers[4]==true && jjTriggers[7]==true && jjTriggers[15]==true) {
		p.showText("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@Keys collected.");
		doorunblocked = true;}
	if(p.xPos > 223*32 && p.xPos <244*32)
		{p.cameraFreeze(240*32, 56*32,true, true);
		p.lighting = 0;
		p.idle = 100;
		p.invisibility = true;}
	
	if(p.xPos < 223*32 && p.yPos < 6*32)
		p.cameraUnfreeze();

	for (int i = 1; i < jjObjectCount; i++) {
		jjOBJ@ o = jjObjects[i];
		if (o.isActive && o.eventID == OBJECT::SEEKERAMMO3 && p.ammo[WEAPON::SEEKER] < 1) {
			o.state = STATE::KILL;}
	}
	for (int i = 1; i < jjObjectCount; i++) {
		jjOBJ@ o = jjObjects[i];
		if (o.isActive && o.eventID == OBJECT::RFAMMO3 && p.ammo[WEAPON::RF] < 1) {
			o.state = STATE::KILL;}
	}
	for (int i = 1; i < jjObjectCount; i++) {
		jjOBJ@ o = jjObjects[i];
		if (o.isActive && o.eventID == OBJECT::TNTAMMO3 && p.ammo[WEAPON::TNT] < 1) {
			o.state = STATE::KILL;}
	}
	for (int i = 1; i < jjObjectCount; i++) {
		jjOBJ@ o = jjObjects[i];
		if (o.isActive && o.eventID == OBJECT::GUN9AMMO3 && p.ammo[WEAPON::GUN9] < 1) {
			o.state = STATE::KILL;}
	}
	for (int i = 1; i < jjObjectCount; i++) {
		jjOBJ@ o = jjObjects[i];
		if (o.isActive && o.eventID == OBJECT::SEEKERPOWERUP && p.ammo[WEAPON::SEEKER] < 1) {
			o.state = STATE::KILL;}
	}
	for (int i = 1; i < jjObjectCount; i++) {
		jjOBJ@ o = jjObjects[i];
		if (o.isActive && o.eventID == OBJECT::RFPOWERUP && p.ammo[WEAPON::RF] < 1) {
			o.state = STATE::KILL;}
	}
	for (int i = 1; i < jjObjectCount; i++) {
		jjOBJ@ o = jjObjects[i];
		if (o.isActive && o.eventID == OBJECT::TNTPOWERUP && p.ammo[WEAPON::TNT] < 1) {
			o.state = STATE::KILL;}
	}
	for (int i = 1; i < jjObjectCount; i++) {
		jjOBJ@ o = jjObjects[i];
		if (o.isActive && o.eventID == OBJECT::GUN9POWERUP && p.ammo[WEAPON::GUN9] < 1) {
			o.state = STATE::KILL;}
	}

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((p.xPos > 223*32 && (p.keyJump || p.keyFire)) || p.xPos>244*32)
{p.xPos =87*32;
p.yPos = 3*32;
p.resetLight();
p.showText("@@Extreme depth here.@I won't be holding my breath that long.");
jjSetWaterLevel(-32, true);}	

if(p.coins == 0){
p.coins += 3;
}
if (CountlessDoubleJumps > jjGameTicks && p.keyJump) {
	p.doubleJumpCount = 0;}

if (p.health == 0){
	CountlessDoubleJumps  = 0;
}
  if (p.yPos < jjWaterLevel) {
	jjMusicLoad("mo4a_Umber's Sacrifice.ogg");}
  if (p.yPos > jjWaterLevel && p.bossActivated == false) {
	jjMusicLoad("mo4a_Carnaval2m07.ogg");}
		
  if (p.yPos > jjWaterLevel) {
    switch(p.shieldType) {
      case 0: limitedOxygen++; p.shieldTime = 0; p.shieldType = 0; break;
      case 1: limitedOxygen++; p.shieldTime = 0; p.shieldType = 0; break;
      case 2: limitedOxygen = 0; break;
      case 3: limitedOxygen++; p.shieldTime = 0; p.shieldType = 0; break;
      case 4: limitedOxygen++; p.shieldTime = 0; p.shieldType = 0; break;
    }
  }
  else { limitedOxygen = 0;
  }
 
  if (limitedOxygen == 2100) {
    p.kill();
  }
 
  if (p.health == 0) limitedOxygen = 0;

	p.lightType = LIGHT::NONE;

	if(p.keyUp && p.xPos >45*32 && p.xPos <48*32 && p.yPos <47*32 && p.yPos >44*32)
		{if(jjTriggers[3]==false)
		{jjSample(p.xPos, p.yPos, SOUND::INTRO_MONSTER2, 1000);}
		jjTriggers[3] = true;
		p.cameraFreeze(40*32, 61*32, true, false);}
	if(p.keyUp && p.xPos >189*32 && p.xPos <192*32 && p.yPos <23*32 && p.yPos >20*32)
		{if(jjTriggers[8]==false)
		{jjSample(p.xPos, p.yPos, SOUND::INTRO_MONSTER2, 1000);}
		jjTriggers[8] = true;
		p.cameraFreeze(161*32, 34*32, true, false);}

	if(p.keyUp && p.xPos >4*32 && p.xPos <7*32 && p.yPos <68*32 && p.yPos >65*32)
	{jjTriggers[1] = true;
	jjTriggers[5] = false;
	jjTriggers[14] = false;
	}
	if(p.keyUp && p.xPos >66*32 && p.xPos <69*32 && p.yPos <7*32 && p.yPos >5*32)
	{jjTriggers[5] = true;
	jjTriggers[1] = false;
	jjTriggers[14] = false;
	}
	if(p.keyUp && p.xPos >10*32 && p.xPos <12*32 && p.yPos <26*32 && p.yPos >23*32)
	{jjTriggers[14] = true;
	jjTriggers[5] = false;
	jjTriggers[1] = false;
	}

	if(Lever19 < jjGameTicks && Lever21 < jjGameTicks && Lever22 < jjGameTicks)
	{Leveractivated19 = false; Leveractivated21 = false; Leveractivated22 = false;}

	if(p.keyUp && Lever19 > jjGameTicks && Leveractivated19 == false)
	{jjTriggers[19] = true;
	Leveractivated19 = true;
		if(jjTriggers[22] == false && jjTriggers[21] == false)
		{p.timerStart(1200);}
	}
	if(p.keyUp && Lever21 > jjGameTicks && Leveractivated21 == false)
	{jjTriggers[21] = true;
	Leveractivated21 = true;
		if(jjTriggers[22] == false && jjTriggers[19] == false)
		{p.timerStart(1200);}
	}
	if(p.keyUp && Lever22 > jjGameTicks && Leveractivated22 == false)
	{jjTriggers[22] = true;
	Leveractivated22 = true;
		if(jjTriggers[19] == false && jjTriggers[21] == false)
		{p.timerStart(1200);}
	}
	if(jjTriggers[19] == true && jjTriggers[21] == true && jjTriggers[22] == true)
		{jjTriggers[18] = true;}
	if (jjTriggers[11] == true && jjTriggers[12] == true && jjTriggers[13] == true)
	{jjTriggers[10]= true;}

	if(poisoned == true && p.xPos > 120*32 && p.yPos > 37*32) {
		p.shieldType = SHIELD::LASER;
			p.invisibility = false;
			p.resetLight();
			p.lightType = LIGHT::NONE;
		if(p.keyFire == true) {
			p.shieldType = SHIELD::LASER;
			p.shieldTime = 10;
			p.lightType = LIGHT::FLICKER;
			p.invisibility = true;
			p.lighting = 140;
			jjDrawSprite(p.xPos, p.yPos, p.setID, RABBIT::HURT, p.curFrame, p.direction, SPRITE::PLAYER);
			jjOBJ@ obj = jjObjects[p.fireBullet(OBJECT::BULLET)];
				obj.behavior = BEHAVIOR::BULLET;
				obj.determineCurAnim(ANIM::AMMO, 70);
				obj.playerHandling = HANDLING::PLAYERBULLET;
				obj.bulletHandling = HANDLING::IGNOREBULLET;
				obj.lightType = LIGHT::POINT;
				obj.xSpeed = 1.2*p.direction;
				int xs = (jjRandom() & 39);
				obj.xSpeed = xs - 1*p.direction;
				obj.ySpeed = 0;
		}
		
	}
}

void onFunction19(jjPLAYER@ p) {
Lever19 = jjGameTicks + 5*61;
}

void onFunction8(jjPLAYER@ p) {
slope = jjGameTicks + 2*61;
}

void onFunction10(jjPLAYER@ p) {
slope = 0;
}

void onFunction4(jjPLAYER@ p) {
jjWaterLighting = WATERLIGHT::GLOBAL;
poisoned = false;
jjSetWaterLevel(-32, true);
}

void onFunction21(jjPLAYER@ p) {
Lever21 = jjGameTicks + 5*61;
}

void onFunction22(jjPLAYER@ p) {
Lever22 = jjGameTicks + 5*61;
}



void onPlayerTimerEnd(jjPLAYER@ p) {
		jjTriggers[18] = false;
		jjTriggers[19] = false;	
		jjTriggers[21] = false;
		jjTriggers[22] = false;}

void onMain() {
	gem::deleteCollectedGems();
	if(p.ammo[WEAPON::TOASTER] > 0)
	{jjEnabledASFunctions[7] = true; }

	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); 
	}

}
 
void onLevelLoad() {
	jjWaterLighting = WATERLIGHT::GLOBAL;
	gem::restorePlayerGems();
	jjLevelName = ("");
	jjObjectPresets[OBJECT::SAVEPOST].behavior = CheckpointWrapper;
	jjObjectPresets[OBJECT::SAVEPOST].deactivates = false;

	Jazz1::MakeEnemy(OBJECT::SKELETON, Jazz1::Enemies::Scraparap_LaunchCart, true).SetUsesJJ2StyleDeathAnimation(true).SetBulletFireSound(SOUND::DEVILDEVAN_WINGSOUT).SetBulletExplosionSound(SOUND::COMMON_GUNSM1);
	Jazz1::MakeEnemy(OBJECT::SPARK, Jazz1::Enemies::Scraparap_GunnerDrone).SetUsesJJ2StyleDeathAnimation(true).SetBulletFireSound(SOUND::ROBOT_SHOOT).SetBulletExplosionSound(SOUND::COMMON_GUNSM1);
	Jazz1::MakeEnemy(OBJECT::NORMTURTLE, Jazz1::Enemies::Dreempipes_TerrapinSwimmer).SetUsesJJ2StyleDeathAnimation(true);
	Jazz1::MakeEnemy(OBJECT::SUCKER, Jazz1::Enemies::Battleships_Generator).SetBulletFireSound(SOUND::COMMON_ITEMTRE).SetBulletExplosionSound(SOUND::COMMON_GUNSM1);

	jjObjectPresets[OBJECT::AIRBOARD].behavior = KeyRed();
	jjObjectPresets[OBJECT::AIRBOARD].scriptedCollisions = true;

	jjObjectPresets[OBJECT::SONICPLATFORM].scriptedCollisions = true;
	jjObjectPresets[OBJECT::SONICPLATFORM].behavior = Elevator;
	jjObjectPresets[OBJECT::SONICPLATFORM].deactivates = false;

	jjObjectPresets[OBJECT::BANANA].behavior = KeyBlue();
	jjObjectPresets[OBJECT::BANANA].scriptedCollisions = true;

	jjObjectPresets[OBJECT::CHICKENLEG].behavior = Potion();
	jjObjectPresets[OBJECT::CHICKENLEG].scriptedCollisions = true;

	jjObjectPresets[OBJECT::FREEZEENEMIES].behavior = TimeFreezer();
	jjObjectPresets[OBJECT::FREEZEENEMIES].scriptedCollisions = true;

	jjObjectPresets[OBJECT::CHIPS].behavior = Air();
	jjObjectPresets[OBJECT::CHIPS].scriptedCollisions = true;

	jjObjectPresets[OBJECT::FASTFEET].behavior = CountlessJumps();
	jjObjectPresets[OBJECT::FASTFEET].scriptedCollisions = true;

	jjObjectPresets[OBJECT::BURGER].behavior = KeyYellow();
	jjObjectPresets[OBJECT::BURGER].scriptedCollisions = true;

	jjObjectPresets[OBJECT::TURTLESHELL].xSpeed = 5;
	jjObjectPresets[OBJECT::TURTLESHELL].scriptedCollisions = true;
	jjObjectPresets[OBJECT::TURTLESHELL].behavior = MovingSpring();
	jjObjectPresets[OBJECT::TURTLESHELL].determineCurAnim(ANIM::SPRING,7);
	jjObjectPresets[OBJECT::TURTLESHELL].deactivates = false;

	jjObjectPresets[OBJECT::WEENIE].energy = 2;
	jjObjectPresets[OBJECT::WEENIE].behavior = SeaHorseGuard;
	jjObjectPresets[OBJECT::WEENIE].playerHandling = HANDLING::ENEMY;
	jjObjectPresets[OBJECT::WEENIE].bulletHandling = HANDLING::HURTBYBULLET;
	jjObjectPresets[OBJECT::WEENIE].isBlastable = true;
	jjObjectPresets[OBJECT::WEENIE].determineCurFrame();	
	jjObjectPresets[OBJECT::WEENIE].deactivates = false;
	jjObjectPresets[OBJECT::PIZZA].energy = 100;
	jjObjectPresets[OBJECT::PIZZA].behavior = Thea;
	jjObjectPresets[OBJECT::PIZZA].playerHandling = HANDLING::ENEMY;
	jjObjectPresets[OBJECT::PIZZA].bulletHandling = HANDLING::HURTBYBULLET;	
	jjObjectPresets[OBJECT::PIZZA].deactivates = false;
	jjObjectPresets[OBJECT::PIZZA].scriptedCollisions = true;



jjANIMATION@ anim = jjAnimations[jjObjectPresets[OBJECT::PRETZEL].curAnim];
	anim.frameCount = 1;
	jjANIMFRAME@ frame = jjAnimFrames[anim.firstFrame];
	jjPIXELMAP pump(0, 57*32, 2*32, 2*32, 5);
	pump.save(frame);
	frame.hotSpotX = -32;


	jjObjectPresets[OBJECT::TACO].behavior = Powder1();
	jjObjectPresets[OBJECT::TACO].scriptedCollisions = true;
	jjObjectPresets[OBJECT::SANDWICH].behavior = Powder2();
	jjObjectPresets[OBJECT::SANDWICH].scriptedCollisions = true;
	jjObjectPresets[OBJECT::FRIES].behavior = Powder3();
	jjObjectPresets[OBJECT::FRIES].scriptedCollisions = true;
}


class Powder1 : jjBEHAVIORINTERFACE {
	void onBehave(jjOBJ@ obj) {
	jjANIMATION@ anim = jjAnimations[jjObjectPresets[OBJECT::TACO].curAnim];
	anim.frameCount = 1;
	jjANIMFRAME@ frame = jjAnimFrames[anim.firstFrame];
	jjPIXELMAP pump(0, 1*32, 1*32, 1*32, 5);
	pump.save(frame);
	frame.hotSpotX = -14;
	frame.hotSpotY = -14;
	obj.draw();
	obj.playerHandling = HANDLING::SPECIAL;

		jjPARTICLE@ particle = jjAddParticle(PARTICLE::FIRE);

		particle.xPos = obj.xPos;
		particle.yPos = obj.yPos+14;
	}

	bool onObjectHit(jjOBJ@ obj, jjOBJ@ bullet, jjPLAYER@ play, int force) {
		if(play !is null && bullet !is null && bullet.var[3] == WEAPON::TOASTER)
		{jjTriggers[11]=true;
		jjSample(obj.xPos, obj.yPos, SOUND::COMMON_BURN, 6000);	
		obj.behave(BEHAVIOR::BURNING, false);
		jjAddObject(OBJECT::SPIKEBOLL, obj.xPos, obj.yPos);}
		return true;
	}

}

class Powder2 : jjBEHAVIORINTERFACE {
	void onBehave(jjOBJ@ obj) {
	jjANIMATION@ anim = jjAnimations[jjObjectPresets[OBJECT::SANDWICH].curAnim];
	anim.frameCount = 1;
	jjANIMFRAME@ frame = jjAnimFrames[anim.firstFrame];
	jjPIXELMAP pump(0, 1*32, 1*32, 1*32, 5);
	pump.save(frame);
	obj.draw();
	obj.playerHandling = HANDLING::SPECIAL;

		jjPARTICLE@ particle = jjAddParticle(PARTICLE::FIRE);

		particle.xPos = obj.xPos;
		particle.yPos = obj.yPos+14;


	}

	bool onObjectHit(jjOBJ@ obj, jjOBJ@ bullet, jjPLAYER@ play, int force) {
		if(play !is null && bullet !is null && bullet.var[3] == WEAPON::TOASTER)
		{jjTriggers[12]=true;
		jjSample(obj.xPos, obj.yPos, SOUND::COMMON_BURN, 6000);	
		obj.behave(BEHAVIOR::BURNING, false);
		jjAddObject(OBJECT::SPIKEBOLL, obj.xPos, obj.yPos);}
		return true;
	}

}

class Powder3 : jjBEHAVIORINTERFACE {
	void onBehave(jjOBJ@ obj) {
	jjANIMATION@ anim = jjAnimations[jjObjectPresets[OBJECT::FRIES].curAnim];
	anim.frameCount = 1;
	jjANIMFRAME@ frame = jjAnimFrames[anim.firstFrame];
	jjPIXELMAP pump(0, 1*32, 1*32, 1*32, 5);
	pump.save(frame);
	obj.draw();
	obj.playerHandling = HANDLING::SPECIAL;

		jjPARTICLE@ particle = jjAddParticle(PARTICLE::FIRE);

		particle.xPos = obj.xPos;
		particle.yPos = obj.yPos+14;


	}

	bool onObjectHit(jjOBJ@ obj, jjOBJ@ bullet, jjPLAYER@ play, int force) {
		if(play !is null && bullet !is null && bullet.var[3] == WEAPON::TOASTER)
		{jjTriggers[13]=true;
		jjSample(obj.xPos, obj.yPos, SOUND::COMMON_BURN, 6000);	
		obj.behave(BEHAVIOR::BURNING, false);
		jjAddObject(OBJECT::SPIKEBOLL, obj.xPos, obj.yPos);}
		return true;	
	}

}


class CountlessJumps : jjBEHAVIORINTERFACE {
	void onBehave(jjOBJ@ obj) {

obj.behave(BEHAVIOR::PICKUP, false);
obj.determineCurAnim(ANIM::PICKUPS, 33);
++obj.counter; 
		obj.yPos = jjSin(obj.counter*15 + 5)*4 + obj.yOrg;

		jjDrawSpriteFromCurFrame(obj.xPos, obj.yPos, obj.curFrame, obj.direction, SPRITE::PALSHIFT, 16);

}

	bool onObjectHit(jjOBJ@ obj, jjOBJ@, jjPLAYER@ play, int force) {
		play.timerStart(600);
		p.morphTo(CHAR::SPAZ);
		CountlessDoubleJumps = jjGameTicks + 10 * 61;
		obj.behavior = BEHAVIOR::EXPLOSION2;
		obj.frameID = 0;
		jjSample(obj.xPos, obj.yPos, SOUND::COMMON_PICKUP1, 6000);

		return true;
	}

}
void onFunction7(jjPLAYER@ p){
		if(p.ammo[WEAPON::TOASTER] == 0)
		{jjAddObject(OBJECT::TOASTERAMMO15, 122*32, 41*32);}
}


void onFunction17(jjPLAYER@ p){
	ElevatorUp = true;
	if(jjTriggers[9]==false) {
	jjTriggers[9] = true;
	jjSample(p.xPos, p.yPos, SOUND::COMMON_ICECRUSH, 1000);}
}

void Elevator (jjOBJ@ obj) {

	switch (obj.state) {
		case STATE::START:

			obj.determineCurAnim(ANIM::SONICPLAT, 0);   
			obj.determineCurFrame();
			obj.playerHandling = HANDLING::SPECIAL;
			obj.state = STATE::FLY;
			obj.beSolid();
		case STATE::FLY:
			obj.beSolid();

			if(obj.yPos < 2 && p.keyUp) {
				obj.ySpeed = 0;}

			if(obj.yPos < 2 && p.keyDown) {
			obj.direction = obj.ySpeed = 2; }
			if(p.keyUp && ElevatorUp == true && p.xPos>obj.xPos-32 && p.xPos<obj.xPos+32) {
			obj.yPos = obj.yPos + obj.ySpeed;
			obj.direction = obj.ySpeed = -2; 
			 }
			if(p.keyDown && ElevatorUp == true && p.xPos>obj.xPos-32 && p.xPos<obj.xPos+32) {
			jjTriggers[16] = true;
			obj.yPos = obj.yPos + obj.ySpeed;
			p.ySpeed=3;
			obj.direction = obj.ySpeed = 2; 
			if (jjMaskedVLine(obj.xSpeed > 0 ? obj.xPos + 16 : obj.xPos - 16, obj.yPos, -1)) {
				obj.ySpeed = 0;
			} 
			}

			obj.draw();
			break;

	}
}

void Thea (jjOBJ@ boss) {

	jjANIMATION@ anim = jjAnimations[jjObjectPresets[OBJECT::PIZZA].curAnim];
	anim.frameCount = 1;
	jjANIMFRAME@ frame = jjAnimFrames[anim.firstFrame];
	jjPIXELMAP thea(0, 59*32, 1*32, 2*32, 5);
	thea.save(frame);
	frame.hotSpotX = -8;
	frame.hotSpotY = 24;
	if (boss.state == STATE::KILL || boss.state == STATE::DEACTIVATE) {
		boss.counter<=0;
		boss.counter += 1;
		jjSample(boss.xPos, boss.yPos, SOUND::COMMON_EXPL_TNT, 6000);
		if (boss.energy==0&&++boss.counter>210) {
			for (int i = 0;  i < jjObjectCount; i++)
			jjObjects[i].state=STATE::KILL;
			boss.delete();
			boss.lightType = LIGHT::NONE;
			p.showText("@@Thrasymakhos: NOOO!!!!");
			++boss.counter;
			jjAddObject(OBJECT::FREEZEENEMIES, 94*32,62*32, boss.yPos);}
	} 
	else  switch (boss.state) {
		case STATE::START:
		boss.frameID = boss.counter/8;
		boss.determineCurFrame();
		if (p.xPos < boss.xPos) boss.direction = 1;
		else boss.direction = -1;		
		++boss.counter;
		boss.yPos = jjSin(boss.counter*52 + 156)*7 + boss.yOrg;
	}
	if (boss.justHit == 0)

		jjDrawSpriteFromCurFrame(boss.xPos, boss.yPos, boss.curFrame, boss.direction, SPRITE::NORMAL);
	else
		boss.draw();

}

void SeaHorseGuard (jjOBJ@ enemy) {

jjANIMATION@ anim = jjAnimations[jjObjectPresets[OBJECT::WEENIE].curAnim];
	anim.frameCount = 1;
	jjANIMFRAME@ frame = jjAnimFrames[anim.firstFrame];
	jjPIXELMAP pump(0, 57*32, 2*32, 2*32, 5);
	pump.save(frame);
	frame.hotSpotX = -32;
	if (enemy.state == STATE::KILL || enemy.state == STATE::DEACTIVATE) {
		enemy.delete();
	} else  	
	switch (enemy.state) {
		case STATE::START:
		enemy.frameID = enemy.counter/8;
		enemy.determineCurFrame();
		if (p.xPos < enemy.xPos) enemy.direction = 1;
		else enemy.direction = -1;		
		++enemy.counter;
		enemy.xPos = jjSin(enemy.counter*5)*70 + enemy.xOrg;
		enemy.yPos = jjSin(enemy.counter*15 + 256)*11 + enemy.yOrg;

		if (jjRandom() & 63 == 0) {
			jjOBJ@ obj = jjObjects[enemy.fireBullet(OBJECT::BULLET)];
			obj.behavior = BEHAVIOR::BULLET;
			obj.determineCurAnim(ANIM::COMMON, 1);
			jjSample(enemy.xPos, enemy.yPos, SOUND::COMMON_PLOP2);
			obj.bulletHandling = HANDLING::IGNOREBULLET;
			obj.points = 5;
			obj.xSpeed = -10;
				if (p.xPos < obj.xPos) obj.direction = -1;
				else obj.direction = 1;
				if (p.yPos < obj.yPos) obj.ySpeed = -1;
				else obj.ySpeed = 6;
			obj.counterEnd = 100;

		}
	}
	if (enemy.justHit == 0)

		jjDrawSpriteFromCurFrame(enemy.xPos, enemy.yPos, enemy.curFrame, enemy.direction, SPRITE::NORMAL);
	else
		enemy.draw();

}	



class MovingSpring : jjBEHAVIORINTERFACE {

	void onBehave(jjOBJ@ obj) {
		obj.behave(BEHAVIOR::WALKINGENEMY, false);
		obj.putOnGround();
		jjDrawSpriteFromCurFrame(obj.xPos, obj.yPos, obj.curFrame, obj.direction, SPRITE::PALSHIFT, 16);
	}
	bool onObjectHit(jjOBJ@ obj, jjOBJ@ bullet, jjPLAYER@ player, int) {
		if(bullet is null) {
		player.direction = player.ySpeed = -62;
		obj.scriptedCollisions = true;
		jjSample(obj.xPos, obj.yPos, SOUND::COMMON_SPRING1);}
		if(player !is null && bullet !is null)
		{obj.bulletHandling = HANDLING::DETECTBULLET;
		obj.causesRicochet = true;}
		return true;
		}
}


void onFunction0(jjPLAYER@ p) {
		p.cameraUnfreeze();
}

void onFunction11(jjPLAYER@ p) {
	p.showText("@@@@@@@@@@@@@@@@@@@@@@@@@Underwater City", STRING::MEDIUM);
	jjEnabledASFunctions[11] = false;}


void onFunction3(jjPLAYER@ p) {
		jjTriggers[13] = true;
		p.light = 1000;
		p.health = 1;
}

void onFunction6(jjPLAYER@ p) {
		if(jjTriggers[4] == true && jjTriggers[7] == true && jjTriggers[15] == true)
		{jjTriggers[20] = true;}
		if(jjTriggers[4] == false || jjTriggers[7] == false || jjTriggers[15] == false)
		{p.showText("@@Collect all three keys@to open the gates towards Poseidon!");}
		jjSample(p.xPos, p.yPos, SOUND::INTRO_MONSTER2);
}
void onFunction5(jjPLAYER@ p) {
		jjSetWaterLevel(-32, true);
		boss=true;
		jjMusicLoad("mo4a_Doc's Cave.ogg");
		p.activateBoss(true);
		{p.boss=jjAddObject(OBJECT::PIZZA, 95*32, 65*32);}
		jjOBJ@ boss = jjObjects[p.boss];
		p.showText("@@Thrasymakhos: Guards! Cover me!");
}


class KeyRed : jjBEHAVIORINTERFACE {

	void onBehave(jjOBJ@ obj) {
		if(jjTriggers[7] == true)
			{obj.delete();}
		obj.behave(BEHAVIOR::PICKUP, false);
	jjANIMATION@ anim = jjAnimations[jjObjectPresets[OBJECT::AIRBOARD].curAnim];
	anim.frameCount = 1; 
	jjANIMFRAME@ frame = jjAnimFrames[anim.firstFrame];
	jjPIXELMAP pump(0, 16*32, 1*32, 1*32, 5);
	pump.save(frame);
		++obj.counter; 
		obj.yPos = jjSin(obj.counter*15 + 5)*4 + obj.yOrg;
		jjDrawSpriteFromCurFrame(obj.xPos, obj.yPos, obj.curFrame, obj.direction, SPRITE::NORMAL);
}
	bool onObjectHit(jjOBJ@ obj, jjOBJ@ bullet, jjPLAYER@ player, int force) { 
		jjTriggers[7] = true;
		jjTriggerRock(0);
		obj.behavior = BEHAVIOR::EXPLOSION2;
		jjSample(obj.xPos, obj.yPos, SOUND::MENUSOUNDS_TYPEENTER, 1000);

		return true; 
	}
}

class Air : jjBEHAVIORINTERFACE {

	void onBehave(jjOBJ@ obj) {
		obj.behave(BEHAVIOR::PICKUP, false);
		obj.determineCurAnim(ANIM::COMMON, 1);
		++obj.counter; 
		obj.yPos = jjSin(obj.counter*15 + 5)*4 + obj.yOrg;
		jjDrawSpriteFromCurFrame(obj.xPos, obj.yPos, obj.curFrame, obj.direction, SPRITE::NORMAL);
}
	bool onObjectHit(jjOBJ@ obj, jjOBJ@ bullet, jjPLAYER@ player, int force) { 
		limitedOxygen = 0;
		obj.behavior = BEHAVIOR::EXPLOSION2;
		jjSample(obj.xPos, obj.yPos, SOUND::AMMO_BLUB2, 1000);

		return true; 
	}
}

class Potion: jjBEHAVIORINTERFACE {

	void onBehave(jjOBJ@ obj) {
		obj.behave(BEHAVIOR::PICKUP, false);
			obj.determineCurAnim(ANIM::PICKUPS, 78);
		++obj.counter; 
		obj.yPos = jjSin(obj.counter*15 + 5)*4 + obj.yOrg;
		jjDrawSpriteFromCurFrame(obj.xPos, obj.yPos, obj.curFrame, obj.direction, SPRITE::NORMAL);
}
	bool onObjectHit(jjOBJ@ obj, jjOBJ@ bullet, jjPLAYER@ player, int force) { 
		p.currWeapon = WEAPON::BLASTER;
		p.light = 100;
		poisoned = true;
		jjSample(p.xPos, p.yPos, SOUND::DEVILDEVAN_VANISH1, 6000);
		obj.behavior = BEHAVIOR::EXPLOSION2;
		jjSample(obj.xPos, obj.yPos, SOUND::AMMO_BLUB2, 1000);

		return true; 
	}
}

class KeyBlue : jjBEHAVIORINTERFACE {

	void onBehave(jjOBJ@ obj) {
		if(jjTriggers[4] == true)
			{obj.delete();}
		obj.behave(BEHAVIOR::PICKUP, false);
jjANIMATION@ anim = jjAnimations[jjObjectPresets[OBJECT::BANANA].curAnim];
	anim.frameCount = 1; 
	jjANIMFRAME@ frame = jjAnimFrames[anim.firstFrame];
	jjPIXELMAP pump(0, 17*32, 1*32, 1*32, 5);
	pump.save(frame);
		++obj.counter; 
		obj.yPos = jjSin(obj.counter*15 + 5)*4 + obj.yOrg;
		jjDrawSpriteFromCurFrame(obj.xPos, obj.yPos, obj.curFrame, obj.direction, SPRITE::NORMAL);
}
	bool onObjectHit(jjOBJ@ obj, jjOBJ@ bullet, jjPLAYER@ player, int force) { 
		jjTriggers[4] = true;
		obj.behavior = BEHAVIOR::EXPLOSION2;
		jjSample(obj.xPos, obj.yPos, SOUND::MENUSOUNDS_TYPEENTER, 1000);

		return true; 
	}
}
class TimeFreezer : jjBEHAVIORINTERFACE {

	void onBehave(jjOBJ@ obj) {
		obj.behave(BEHAVIOR::PICKUP);
		obj.lightType = LIGHT::LASER;
		obj.light = 100;
	}
	bool onObjectHit(jjOBJ@ obj, jjOBJ@ bullet, jjPLAYER@ player, int force) {
		obj.behavior = BEHAVIOR::EXPLOSION2;
		limitedOxygen = 0;
		jjSample(obj.xPos, obj.yPos, SOUND::MENUSOUNDS_TYPEENTER, 1000);
		jjNxt();
		gem::saveGemData();
		return true;
	}
}

class KeyYellow : jjBEHAVIORINTERFACE {

	void onBehave(jjOBJ@ obj) {
		if(jjTriggers[15] == true)
			{obj.delete();}
		obj.behave(BEHAVIOR::PICKUP, false);
		jjANIMATION@ anim = jjAnimations[jjObjectPresets[OBJECT::BURGER].curAnim];
		anim.frameCount = 1; 
		jjANIMFRAME@ frame = jjAnimFrames[anim.firstFrame];
		jjPIXELMAP pump(0, 18*32, 1*32, 1*32, 5);
		pump.save(frame);
		++obj.counter; 
		obj.yPos = jjSin(obj.counter*15 + 5)*4 + obj.yOrg;
		jjDrawSpriteFromCurFrame(obj.xPos, obj.yPos, obj.curFrame, obj.direction, SPRITE::NORMAL);
}
	bool onObjectHit(jjOBJ@ obj, jjOBJ@ bullet, jjPLAYER@ player, int force) { 
		jjTriggers[15] = true;
		obj.behavior = BEHAVIOR::EXPLOSION2;
		jjSample(obj.xPos, obj.yPos, SOUND::MENUSOUNDS_TYPEENTER, 1000);
		return true; 
	}
}

array<bool> SavedTriggers(32, false); //you will need some way to keep track of whatever information you want saved... a global variable is the simplest choice

 
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;
        }
      }
    }
  }
}

void onLevelReload() { //restore the state of the saved properties to how they were last time you visited a checkpoint
  for (uint i = 0; i < 32; ++i)
    jjTriggers[i] = SavedTriggers[i]; //although this example uses jjTriggers, other things should work as well
	jjWaterLighting = WATERLIGHT::GLOBAL;
	gem::restorePlayerGems();
	jjLocalPlayers[0].lives++;
}


jjTEXTAPPEARANCE SignTextAppearance = STRING::NORMAL;
class Sign {
	private int xPos, yPos; //These pixel-based positions will be generated from tile-based positions in the constructor by multiplying by 32
	private string text;
	private uint widthOfText;
	Sign(){} //AngelScript requires any class that appears in any array to have an explicit default constructor, even if it's never called
	Sign(int xTile, int yTile, const string &in t) {
		xPos = xTile * 32; //Since this is a constant operation, it could strictly be performed in the draw method instead of the constructor, but this way involves fewer multiplication instructions
		yPos = yTile * 32; //
		text = t;
		SignTextAppearance.newline = STRING::SPECIALSIGN; //Causes the drawString method to interpret instances of the \n character as signals to drop down to a new line, similar to the special effect of the @ character in the STRING::SPIN appearance.
		SignTextAppearance.spacing = -2; //int jjTEXTAPPEARANCE::spacing is new in 5.2, and this particular value is equivalent to prefixing the string with "ยง2". Make sure to check out bool jjTEXTAPPEARANCE::monospace too, though it didn't end up getting used in this level.
		widthOfText = jjGetStringWidth(text, STRING::SMALL, SignTextAppearance); //Used for determining how large of a dark rectangle should be drawn behind the text. A matching heightOfText value could of course be generated by counting the number of newline characters--for example, "heightOfText = text.split("\n").length * 20;"--but here the rectangles are constant height instead to limit the temptation to ramble on and on.
	}
	void draw(jjCANVAS@ layer, uint8 textIntensity) const { //Because this method will be called from an onDraw method, it's important to have a jjCANVAS@ passed among the arguments.
		layer.drawRectangle(xPos, yPos - 16, widthOfText + 8, 55, 0, SPRITE::TRANSLUCENT);
		layer.drawString(xPos, yPos, text, STRING::SMALL, SignTextAppearance, 0, SPRITE::BLEND_HARDLIGHT, textIntensity);
	}
}
const array<Sign> Signs = { 
	Sign(232, 61, "GUARDIAN: There's an intruder, sir.\nTHRASYMAKHOS: Make sure he does not cause any trouble!\nWe are so close to awaken the beast.\nSoon that filthy city will be destroyed!\n\nHit |||||FIRE |or |||||JUMP |to skip."),
};

void onDrawLayer3(jjPLAYER@, jjCANVAS@ layer) { 
	if(jjKey[0x54] || p.xPos >222*32){
	const uint8 textIntensity = 200 + int(jjSin(jjGameTicks * 16) * 50); 
	for (uint signID = 0; signID < Signs.length; ++signID) 
		Signs[signID].draw(layer, textIntensity);
}
}











//HH18.savegems.asc 
// Had to copy the contents in here so that I could return DrawScore true during the cutscene.

namespace gem {
	int gemsCollected, nextHealth, currAmount;
	
	int maxHealth() {
		return ((jjMaxHealth+1) - (jjDifficulty < 3? 5:3));
	}
	
	array<int> gemTotals(4);
	bool restoreGems;
	bool draw = true;

	void upgradeHealth(jjPLAYER@ play) { //onPlayer
		switch (maxHealth()) {
			case 1: currAmount = 100; break;
			case 2: currAmount = 275; break;
			case 3: currAmount = 450; break;
			case 4: currAmount = 625; break;
			case 5: currAmount = 800; break;
		}
	
		if (gemsCollected >= currAmount && nextHealth != maxHealth() && maxHealth() < 6) {
			jjChat("/smhealth " + (jjMaxHealth + 1));
			for (int i = 0; i < 8; ++i) {
				jjAlert("");
			}
			nextHealth = jjMaxHealth;
			if (jjGameTicks > 7) {
				jjSample(play.xPos, play.yPos, SOUND::COMMON_HARP1, 0, 0);
				jjAlert("||||By the power of gems, your maximum health is increased!", false, STRING::MEDIUM);
				if (maxHealth() == 6) jjAlert("|||Congratulations, your health is maximised!", false, STRING::MEDIUM);
			}
		}
	}
	
	void trackPlayerGems(jjPLAYER@ play) { //onPlayer
		if (!restoreGems) {
			gemTotals[0] = play.gems[GEM::RED];
			gemTotals[1] = play.gems[GEM::GREEN] * 5;
			gemTotals[2] = play.gems[GEM::BLUE] * 10;
			gemTotals[3] = play.gems[GEM::PURPLE] * 20;
			gemsCollected = gemTotals[0] + gemTotals[1] + gemTotals[2] + gemTotals[3];
		} else {
			play.gems[GEM::RED] = jjGameTicks > 1? gemTotals[0] : play.lives;
			play.gems[GEM::GREEN] = gemTotals[1] / 5;
			play.gems[GEM::BLUE] = gemTotals[2] / 10;
			play.gems[GEM::PURPLE] = gemTotals[3] / 20;
			restoreGems = false;
		}
	}
	
	void restorePlayerGems() { //onLevelLoad and onLevelReload
		restoreGems = true;
	}
	
	void saveGemData() { //this needs to go in an AS function that also acts as the level exit
		jjLocalPlayers[0].lives = gemsCollected;
	}
	
	void deleteCollectedGems() {
		for (int i = 1; i < jjObjectCount; i++) {
			jjOBJ@ obj = jjObjects[i];
			int playerID = obj.findNearestPlayer(200000);
			jjPLAYER@ play = jjPlayers[playerID];
			
			if (playerID > -1 && 
			(obj.eventID == OBJECT::REDGEM ||
			obj.eventID == OBJECT::GREENGEM ||
			obj.eventID == OBJECT::BLUEGEM ||
			obj.eventID == OBJECT::PURPLEGEM ||
			obj.eventID == OBJECT::RECTREDGEM ||
			obj.eventID == OBJECT::RECTGREENGEM ||
			obj.eventID == OBJECT::RECTBLUEGEM)) {
				if (obj.creatorType == CREATOR::LEVEL) {
					if (play.doesCollide(obj, true)) {
						jjEventSet(uint(obj.xOrg) >> 5, uint(obj.yOrg) >> 5, 0);
					}
				} else {
					if (obj.creatorID == 0 && obj.state != STATE::FLOATFALL) {
						obj.playerHandling = HANDLING::PARTICLE;
						obj.delete();
					}
					
				}
			}
			
			if (obj.eventID == OBJECT::GEMBARREL || obj.eventID == OBJECT::GEMCRATE) {
				if (obj.state == STATE::EXPLODE) jjEventSet(uint(obj.xOrg) >> 5, uint(obj.yOrg) >> 5, 0);
			}
			
			if (obj.eventID == OBJECT::GEMRING) {
				if (obj.state == STATE::HIT) jjEventSet(uint(obj.xOrg) >> 5, uint(obj.yOrg) >> 5, 0);
			}
			
			if (obj.eventID == OBJECT::SUPERGEM) {
				if (obj.state == STATE::ACTION) jjEventSet(uint(obj.xOrg) >> 5, uint(obj.yOrg) >> 5, 0);
			}
			
			if (obj.eventID == OBJECT::BOMBCRATE || obj.eventID == OBJECT::ONEUPCRATE) {
				if (obj.state == STATE::FALL && (obj.var[0] == OBJECT::REDGEM ||
				obj.var[0] == OBJECT::GREENGEM ||
				obj.var[0] == OBJECT::BLUEGEM ||
				obj.var[0] == OBJECT::PURPLEGEM ||
				obj.var[0] == OBJECT::RECTREDGEM ||
				obj.var[0] == OBJECT::RECTGREENGEM ||
				obj.var[0] == OBJECT::RECTBLUEGEM)) {
					jjEventSet(uint(obj.xOrg) >> 5, uint(obj.yOrg) >> 5, 0);
				}
			}
		}
	}
}

bool onCheat(string &in cheat) {
	if (cheat == "jjnxt" || cheat == "jjnext") {
		gem::saveGemData();
		jjNxt(true, true);
	} else if (cheat == "jjgems") {
		jjLocalPlayers[0].gems[GEM::RED] = jjLocalPlayers[0].gems[GEM::RED] + 100;
	} else
		return false;
	jjAlert(cheat, false, STRING::MEDIUM);
	return true;
}



bool onDrawScore(jjPLAYER@ play, jjCANVAS@ canvas) {

	if (gem::draw && p.xPos < 223*32) {
		canvas.drawSprite(20, 42, ANIM::PICKUPS, 22, jjGameTicks>>2, 0, SPRITE::GEM, 0);
		canvas.drawString(36, 42, "x " + gem::gemsCollected, STRING::MEDIUM, STRING::NORMAL);
		if (gem::maxHealth() < 6) {
			canvas.drawString(8, 70, "|" + gem::currAmount + " |||||for upgrade", STRING::SMALL, STRING::NORMAL);
		} else {
			canvas.drawString(8, 70, "||||Max!", STRING::SMALL, STRING::NORMAL);
		}
	
	return false;}
	else return true;
}