Downloads containing JC2lvl54.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: |Second Police Station 3 / 7");
	jjAlert("||RabbitCity 2: The Secret Room - Level: |54");
	jjAlert("");
	jjAlert("");

	jjTexturedBGFadePositionY = 1;
	jjUseLayer8Speeds = true;
	
	// 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 == 4) p.warpToID(5, true);
		else if(myArea == 5) p.warpToID(4, true);
		else if(myArea == 6) p.warpToID(7, true);
		else if(myArea == 7) p.warpToID(6, true);
		else if(myArea == 8) p.warpToID(9, true);
		else if(myArea == 9) p.warpToID(8, true);
		else if(myArea == 10) p.warpToID(11, true);
		else if(myArea == 11) p.warpToID(10, true);
		else if(myArea == 12) p.warpToID(13, true);
		else if(myArea == 13) p.warpToID(12, true);
		else if(myArea == 14) p.warpToID(15, true);
		else if(myArea == 15) p.warpToID(14, true);
		else if(myArea == 16) p.warpToID(17, true);
		else if(myArea == 17) p.warpToID(16, true);
		else if(myArea == 18) p.warpToID(19, true);
		else if(myArea == 19) p.warpToID(18, 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, 86, 179, 86, 179)) myArea = 4;
	else myArea = 0;
}
bool onDrawHealth(jjPLAYER@ player, jjCANVAS@ canvas) {
	if(myArea == 4 || myArea == 5 || myArea == 6 || myArea == 7 || myArea == 8 || myArea == 9 || myArea == 10 || myArea == 11 || myArea == 12 || myArea == 13 || myArea == 14 || myArea == 15 || myArea == 16 || myArea == 17 || myArea == 18 || myArea == 19) {
		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 onFunction0() { if (p.timerState != TIMER::STARTED) p.timerStart(2*70, false); }
void onFunction1() { p.timerStop(); }
void onPlayerTimerEnd() {
	p.kill();
	jjAlert("");
	jjAlert("");
	jjAlert("");
	jjAlert("");
	jjAlert("");
	jjAlert("");
	jjAlert("");
	jjAlert("Player:||||| AAAARRGGHHH!");
}
void onFunction2() {
	p.kill();
	jjAlert("");
	jjAlert("");
	jjAlert("");
	jjAlert("");
	jjAlert("");
	jjAlert("");
	jjAlert("");
	jjAlert("Player:||||| AAAARRGGHHH!");
}
void onFunction3() {
	jjAlert("");
	jjAlert("");
	jjAlert("");
	jjAlert("");
	jjAlert("|*** NOTICE:  RESTRICTED AREA ***");
	jjAlert("This area is under 24hour video surveillance");
	jjAlert("|*** WARNING:  NO GUNS ALLOWED ***");
	jjAlert("");
}
void onFunction4() {
	jjAlert("");
	jjAlert("");
	jjAlert("");
	jjAlert("");
	jjAlert("");
	jjAlert("");
	jjAlert("");
	jjAlert("Player:||||| WHAT??? My gun was detected? What's now?");
}
void onFunction5() {
	jjAlert("");
	jjAlert("");
	jjAlert("");
	jjAlert("");
	jjAlert("");
	jjAlert("");
	jjAlert("");
	jjAlert("Player:||||| Aaaaaaaahhhhhhh!");
}
void onFunction6() {
	jjAlert("");
	jjAlert("");
	jjAlert("");
	jjAlert("");
	jjAlert("");
	jjAlert("");
	jjAlert("");
	jjAlert("Player:||||| Ow, I lost my gun! Argh!");
}
void onFunction7() {
	jjAlert("");
	jjAlert("");
	jjAlert("");
	jjAlert("");
	jjAlert("");
	jjAlert("");
	jjAlert("");
	jjAlert("Player:||||| Uh, I am wanted ! ?");
}
void onFunction8() {
	jjAlert("");
	jjAlert("");
	jjAlert("");
	jjAlert("");
	jjAlert("");
	jjAlert("");
	jjAlert("");
	jjAlert("Player:||||| What is this?");
}
void onFunction9() {
	jjAlert("");
	jjAlert("");
	jjAlert("");
	jjAlert("");
	jjAlert("");
	jjAlert("");
	jjAlert("");
	jjAlert("Player:||||| Hmm, I don't remember this new room");
}
void onFunction10() {
	jjAlert("");
	jjAlert("");
	jjAlert("");
	jjAlert("");
	jjAlert("");
	jjAlert("|*** IT'S LOCKED ***");
	jjAlert("|*** Alert Security:  UNSAFE ***");
	jjAlert("");
	jjAlert("Player:||||| Hmm, this door will not open.");
}
void onFunction11() {
	jjAlert("");
	jjAlert("");
	jjAlert("");
	jjAlert("");
	jjAlert("");
	jjAlert("");
	jjAlert("");
	jjAlert("");
	jjAlert("Player:||||| It's broken!");
}
void onFunction12() {
	jjAlert("");
	jjAlert("");
	jjAlert("");
	jjAlert("");
	jjAlert("");
	jjAlert("");
	jjAlert("|*** NO ENTRY ***");
	jjAlert("");
	jjAlert("Player:||||| Hmm");
}
void onFunction13() {
	jjAlert("");
	jjAlert("");
	jjAlert("");
	jjAlert("");
	jjAlert("");
	jjAlert("");
	jjAlert("|||*** NOTICE:  ELEVATOR IS OUT OF ORDER ***");
	jjAlert("");
	jjAlert("Player:||||| Hmm... this elevator is out of order?");
}
void onFunction14() {
	jjAlert("");
	jjAlert("");
	jjAlert("");
	jjAlert("");
	jjAlert("");
	jjAlert("");
	jjAlert("");
	jjAlert("");
	jjAlert("Player:||||| Nothing here...");
}
void onFunction15() {
	jjAlert("");
	jjAlert("");
	jjAlert("");
	jjAlert("");
	jjAlert("");
	jjAlert("");
	jjAlert("|*** IT'S LOCKED - UNKNOWN ***");
	jjAlert("");
	jjAlert("Player:||||| What does UNKNOWN mean? Error?");
}
void onFunction16() {
	p.showText("@@@@@@@@#YOU FOUND A SECRET!", STRING::MEDIUM);
}
void onFunction17() {
	jjAlert("");
	jjAlert("");
	jjAlert("");
	jjAlert("");
	jjAlert("");
	jjAlert("");
	jjAlert("");
	jjAlert("Player:||||| What does H mean? Hmmm");
}
void onFunction18() {
	jjAlert("");
	jjAlert("");
	jjAlert("");
	jjAlert("");
	jjAlert("");
	jjAlert("");
	jjAlert("");
	jjAlert("Player:||||| OH SWAT is here!!");
}
void onFunction19() {
	jjAlert("");
	jjAlert("");
	jjAlert("");
	jjAlert("");
	jjAlert("");
	jjAlert("");
	jjAlert("*** IT'S UNLOCKED - RED ACCESS CARD ***");
	jjAlert("");
	jjAlert("Player:||||| Yey!");
}
void onFunction20() {
	jjAlert("");
	jjAlert("");
	jjAlert("");
	jjAlert("");
	jjAlert("");
	jjAlert("");
	jjAlert("");
	jjAlert("");
	jjAlert("Charlotte:||||| Follow me!");
}
void onDrawLayer4(jjPLAYER@ p, jjCANVAS@ canvas) {
	canvas.drawString(75*32, 26*32-18, "|Control Security",STRING::MEDIUM);
}
void onDrawLayer5(jjPLAYER@ p, jjCANVAS@ canvas) {
	canvas.drawString(75*32+8, 28*32-18, "|SCANNING...",STRING::MEDIUM);
	canvas.drawString(75*32-3, 29*32-18, "||FIREARM DETECTED",STRING::SMALL);
	canvas.drawString(34*32+8, 56*32-18, "|Player Wanted",STRING::MEDIUM);
	canvas.drawString(33*32-9, 59*32-18, "|Jazz",STRING::SMALL);
	canvas.drawString(37*32-9, 59*32-18, "||Spaz",STRING::SMALL);
	canvas.drawString(41*32-9, 59*32-18, "||||Lori",STRING::SMALL);
	canvas.drawString(128*32-9, 9*32-18, "||||Second Police Station",STRING::MEDIUM);
	canvas.drawString(139*32+10, 9*32-15, "|Exit",STRING::SMALL);
}