Name | Author | Game Mode | Rating | |||||
---|---|---|---|---|---|---|---|---|
RabbitCity 2 | P4rr0t | Single player | 7.7 |
/*************************************************
Created by Parrot86 - RabbitCity 2: The Secret Room
*************************************************/
void onLevelLoad() {
jjAlert("||Level Name: |Welcome To Airship 12 / 15");
jjAlert("||RabbitCity 2: The Secret Room - Level: |75");
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("");
jjAlert("");
jjAlert("");
jjAlert("");
jjAlert("GreenSpaz:||||| Thank for unlock door!");
jjAlert("|RedRazz:|||| Thanks Bro!");
jjAlert("People:||||| Thank you for save me!");
jjAlert("Player:||||| No problem!");
}
void onFunction2() {
p.cameraFreeze(50*32, 9*32, true, true);
jjAlert("");
jjAlert("");
jjAlert("");
jjAlert("");
jjAlert("");
jjAlert("");
jjAlert("Player:||||| I have ID Card for you!");
jjAlert("GreenSpaz:||||| Whoa! I lost my ID Card in the second police station");
}
void onFunction3() {
p.cameraFreeze(18*32, 9*32, true, true);
jjAlert("");
jjAlert("");
jjAlert("");
jjAlert("");
jjAlert("GreenSpaz:||||| Thank you!");
jjAlert("Player:||||| No problem!");
jjAlert("Charlotte:||||| Hey people, follow me to go back to helicopter, OK?");
jjAlert("People:||||| OK!");
}
void onFunction4() {
p.cameraFreeze(18*32, 9*32, true, true);
jjAlert("");
jjAlert("");
jjAlert("");
jjAlert("GreenSpaz:||||| Player, do you have bomb timer?");
jjAlert("Player:||||| Yes and silver key too");
jjAlert("GreenSpaz:||||| OK, go to engine room. Go fast!");
jjAlert("Player:||||| OK!");
jjAlert("GreenSpaz:||||| I must go with Charlotte!");
}
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);
}
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.