Downloads containing JC2lvl71.j2as

Downloads
Name Author Game Mode Rating
TSF with JJ2+ Only: RabbitCity 2 P4rr0t Single player 7.7 Download file

File preview

/*************************************************
Created by Parrot86 - RabbitCity 2: The Secret Room
*************************************************/
void onLevelLoad() {
	jjAlert("||Level Name: |Welcome To Airship 8 / 15");
	jjAlert("||RabbitCity 2: The Secret Room - Level: |71");
	jjAlert("");
	jjAlert("");

	jjTexturedBGFadePositionY = -0;
	
	// Blaster is limited ammo - Thank for zepect!
	jjWeapons[WEAPON::BLASTER].infinite = false;
	jjWeapons[WEAPON::BLASTER].maximum = maxBlaster;
}
//Blaster Reloading - Thank for zepect!
bool pressedR = false;

const int maxBlaster = 15;

void doReload() {
	for(int i = 0; i < jjLocalPlayerCount; i++)
	if(jjLocalPlayers[i].ammo[WEAPON::BLASTER] == 0)
	jjLocalPlayers[i].ammo[WEAPON::BLASTER] = maxBlaster;
}
bool onDrawAmmo(jjPLAYER@ player, jjCANVAS@ canvas) {
 if(player.ammo[WEAPON::BLASTER] == 0)
  canvas.drawString(80, jjResolutionHeight - 30, "Press [R] to reload your Blaster!", STRING::MEDIUM, STRING::BOUNCE, 1);
 return false;
}
// Doors - Thank for zepect!
array<bool> keyPressed(256, false); //arrays holds the state of the keys
int myArea = 0;

bool inArea(jjPLAYER@ p, int x1, int y1, int x2, int y2) {
	return ((p.xPos > (x1*32)) && (p.xPos < x2*32 + 32) && (p.yPos > (y1*32)) && (p.yPos < y2*32 + 32));
}
void onKeyDown(jjPLAYER@ p, int key) {
	if(key == 0x26) { //0x26 is up arrow key (all keys at http://msdn.microsoft.com/en-us/library/dd375731(VS.85).aspx)
		if(myArea == 1) p.warpToID(2, true);
		else if(myArea == 2) p.warpToID(1, true);
		else if(myArea == 3) p.warpToID(4, true);
		else if(myArea == 4) p.warpToID(3, true);
		else if(myArea == 15) p.warpToID(16, true);
		else if(myArea == 16) p.warpToID(15, true);
		else if(myArea == 17) p.warpToID(18, true);
		else if(myArea == 18) p.warpToID(17, true);
		else if(myArea == 19) p.warpToID(20, true);
		else if(myArea == 20) p.warpToID(19, true);
	}
}

void onPlayer(jjPLAYER@ p) {
	for(int i = 0; i < 256; i++) { //loop through all the keys
		if(jjKey[i] && !keyPressed[i]) {
			onKeyDown(p, i);
			keyPressed[i] = true;
		} else if(!jjKey[i] && keyPressed[i]) keyPressed[i] = false;
	}
	if(inArea(p, 601, 61, 601, 61)) myArea = 1;
	else if(inArea(p, 610, 101, 610, 101)) myArea = 2;
	else if(inArea(p, 644, 112, 644, 112)) myArea = 3;
	else if(inArea(p, 567, 72, 567, 72)) myArea = 4;
	else if(inArea(p, 370, 38, 370, 38)) myArea = 15;
	else if(inArea(p, 587, 144, 587, 144)) myArea = 16;
	else if(inArea(p, 150, 89, 150, 89)) myArea = 17;
	else if(inArea(p, 139, 142, 139, 142)) myArea = 18;
	else if(inArea(p, 150, 136, 150, 136)) myArea = 19;
	else if(inArea(p, 140, 83, 140, 83)) myArea = 20;
	else myArea = 0;
}

bool onDrawHealth(jjPLAYER@ player, jjCANVAS@ canvas) {
	if(myArea == 1 || myArea == 2 || myArea == 3 || myArea == 4 || myArea == 15 || myArea == 16 || myArea == 17 || myArea == 18 || myArea == 19 || myArea == 20) {
		canvas.drawString(135, 300, "Press UP to walk through!", STRING::MEDIUM, STRING::BOUNCE, 1);
	}
	return false;
}
void onMain() {
	if(jjKey[0x52] && !pressedR) {  
	doReload();
	pressedR = true;
	} else if(!jjKey[0x52]) pressedR = false;
  updateGems();
}

void updateGems()
{
  for(int i=1;i<jjObjectCount;i++)
  {
    if(jjObjects[i].isActive)
    {
      if(jjObjects[i].eventID==OBJECT::SUPERGEM)
      {
        jjObjects[i].var[0]=jjParameterGet(jjObjects[i].xOrg/32,jjObjects[i].yOrg/32,0,2)+1;
      }
      if(jjObjects[i].eventID==OBJECT::FLICKERGEM)
      {
        if(jjEventGet(jjObjects[i].xOrg/32,jjObjects[i].yOrg/32)==OBJECT::SUPERGEM)
        {
          jjObjects[i].var[0]=jjParameterGet(jjObjects[i].xOrg/32,jjObjects[i].yOrg/32,0,2)+1;
        }
        else if(jjEventGet(jjObjects[i].xOrg/32,jjObjects[i].yOrg/32+1)==OBJECT::GEMSTOMP)
        {
          jjObjects[i].var[0]=jjParameterGet(jjObjects[i].xOrg/32,jjObjects[i].yOrg/32+1,0,2)+1;
        }
        if(jjObjects[i].var[0]==2||jjObjects[i].var[0]==3)
        {
          jjObjects[i].points=500*(jjObjects[i].var[0]-1);
        }
      }
    }
  }
}
void onFunction1() {
	p.cameraFreeze(18*32, 9*32, true, true);
	jjAlert("GreenSpaz:||||| OH! PLAYER!");
	jjAlert("|RedRazz:|||| PLAYER ARE YOU ALIVE!");
	jjAlert("Player:||||| Whoa.. why did you jail here?");
	jjAlert("GreenSpaz:||||| Because it is Devan");
	jjAlert("GreenSpaz:||||| Uh? Who is black rabbit...? aha Charlotte!");
	jjAlert("Charlotte:||||| Yes, GreenSpaz, i have no longest time!");
	jjAlert("GreenSpaz:||||| Yeah, so Player is a jail free? Who?");
	jjAlert("Player:||||| It's RedRazz saved me...");
}
void onFunction2() {
	p.cameraFreeze(18*32, 9*32, true, true);
	jjAlert("");
	jjAlert("");
	jjAlert("");
	jjAlert("");
	jjAlert("GreenSpaz:||||| Eh Damn RedRazz...");
	jjAlert("|RedRazz:|||| Yeah, sorry!");
	jjAlert("GreenSpaz:||||| Don't worry about it!");
	jjAlert("|RedRazz:|||| OK...");
}
void onFunction3() {
	p.cameraFreeze(52*32, 9*32, true, true);
	jjAlert("");
	jjAlert("GreenSpaz:||||| Take at explosives crate is here");
	jjAlert("Player:||||| OK");
	jjAlert("GreenSpaz:||||| the before, put bomb timer in engine room, OK?");
	jjAlert("Player:||||| Why? Destroy airship?");
	jjAlert("GreenSpaz:||||| That's why i hate airship will be destroy RabbitVille");
	jjAlert("Charlotte:||||| Yes!");
	jjAlert("Player:||||| Hmm... Okay");
}
void onFunction4() {
	p.cameraFreeze(77*32, 9*32, true, true);
	jjAlert("");
	jjAlert("");
	jjAlert("");
	jjAlert("");
	jjAlert("");
	jjAlert("");
	jjAlert("");
	jjAlert("TUF TURT:||||| WTF? Unlock door?");
}
void onFunction5() {
	p.cameraFreeze(101*32, 9*32, true, true);
	jjAlert("");
	jjAlert("");
	jjAlert("");
	jjAlert("");
	jjAlert("");
	jjAlert("");
	jjAlert("");
	jjAlert("TUF TURT:||||| DEVAN!! COME HERE! DEVAN!!");
}
void onFunction6() {
	p.cameraFreeze(125*32, 9*32, true, true);
	jjAlert("");
	jjAlert("");
	jjAlert("");
	jjAlert("");
	jjAlert("");
	jjAlert("");
	jjAlert("Devan:||||| Damn, Who is this? Rabbit?");
	jjAlert("TUF TURT:||||| It's rabbit is a jail free?");
}
void onFunction7() {
	p.cameraFreeze(149*32, 9*32, true, true);
	jjAlert("");
	jjAlert("");
	jjAlert("");
	jjAlert("");
	jjAlert("");
	jjAlert("");
	jjAlert("Devan:||||| Try find rabbit in all rooms, GO!");
	jjAlert("TUF TURT:||||| OK!");
}
void onFunction8() {
	p.cameraFreeze(178*32, 9*32, true, true);
	jjAlert("");
	jjAlert("");
	jjAlert("");
	jjAlert("Player:||||| I got Bomb Timer!");
	jjAlert("GreenSpaz:||||| OK, go to engine room!");
	jjAlert("Player:||||| i don't have a silver key!");
	jjAlert("Player:||||| Because it is locked with a silver key");
	jjAlert("GreenSpaz:||||| oh s***");
}
void onFunction9() {
	p.cameraFreeze(206*32, 9*32, true, true);
	jjAlert("");
	jjAlert("");
	jjAlert("");
	jjAlert("");
	jjAlert("");
	jjAlert("");
	jjAlert("");
	jjAlert("TUF TURT:||||| HEY! FOUND A PLAYER! CALL IN MORE TUF TURTS");
}
void onFunction10() {
	p.cameraFreeze(178*32, 9*32, true, true);
	jjAlert("");
	jjAlert("");
	jjAlert("");
	jjAlert("");
	jjAlert("GreenSpaz:||||| OH MY GOD, ENEMIES!");
	jjAlert("Player:||||| Eh");
	jjAlert("GreenSpaz:||||| LOOK AT TUF BOSS! KILL HIM!");
	jjAlert("Player:||||| OK!");
}
void onDrawLayer4(jjPLAYER@ p, jjCANVAS@ canvas) {
	canvas.drawString(205*32+20, 11*32-16, "||!",STRING::LARGE);
	canvas.drawString(210*32+10, 11*32-16, "||||?!",STRING::MEDIUM);
	canvas.drawString(212*32+10, 11*32-16, "||||?!",STRING::MEDIUM);
}