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: |City Island - BlackOut");
jjAlert("||RabbitCity 2: The Secret Room - Level: |43");
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 == 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 == 5) p.warpToID(6, true);
else if(myArea == 6) p.warpToID(5, true);
else if(myArea == 7) p.warpToID(8, true);
else if(myArea == 8) p.warpToID(7, true);
else if(myArea == 9) p.warpToID(10, true);
else if(myArea == 10) p.warpToID(9, true);
else if(myArea == 11) p.warpToID(12, true);
else if(myArea == 12) p.warpToID(11, true);
else if(myArea == 13) p.warpToID(14, true);
else if(myArea == 14) p.warpToID(13, 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, 330, 223, 330, 223)) myArea = 1;
else if(inArea(p, 28, 287, 28, 287)) myArea = 2;
else if(inArea(p, 40, 275, 40, 275)) myArea = 3;
else if(inArea(p, 311, 213, 311, 213)) myArea = 4;
else if(inArea(p, 83, 227, 83, 227)) myArea = 5;
else if(inArea(p, 98, 293, 98, 293)) myArea = 6;
else if(inArea(p, 514, 227, 514, 227)) myArea = 7;
else if(inArea(p, 932, 227, 932, 227)) myArea = 8;
else if(inArea(p, 914, 101, 914, 101)) myArea = 9;
else if(inArea(p, 532, 101, 532, 101)) myArea = 10;
else if(inArea(p, 605, 243, 605, 243)) myArea = 11;
else if(inArea(p, 960, 265, 960, 265)) myArea = 12;
else if(inArea(p, 976, 271, 976, 271)) myArea = 13;
else if(inArea(p, 589, 249, 589, 249)) myArea = 14;
else myArea = 0;
}
bool onDrawHealth(jjPLAYER@ player, jjCANVAS@ canvas) {
if(myArea == 1 || myArea == 2 || myArea == 3 || myArea == 4 || myArea == 5 || myArea == 6 || myArea == 7 || myArea == 8 || myArea == 9 || myArea == 10 || myArea == 11 || myArea == 12 || myArea == 13 || myArea == 14) {
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() {
p.showText("@@@@@@@@#YOU FOUND A SECRET!", STRING::MEDIUM);
}
void onFunction4() {
jjAlert("");
jjAlert("");
jjAlert("");
jjAlert("");
jjAlert("");
jjAlert("|*** IT'S LOCKED ***");
jjAlert("|*** WARNING! Power Off ***");
jjAlert("Player:||||| This door will not open!");
}
void onFunction5() {
jjAlert("|*** IT'S LOCKED ***");
jjAlert("???:||||| Help!");
jjAlert("Player:||||| I will help you, who are you?");
jjAlert("Hershey:||||| I am Hershey, can you open the door? Please!");
jjAlert("Player:||||| Sorry, I can't open the door, it's power off!");
jjAlert("Player:||||| But where is generator power?");
jjAlert("Hershey:||||| Go to Power Station.");
jjAlert("Player:||||| Hmm, OK");
}
void onFunction6() {
jjAlert("");
jjAlert("");
jjAlert("");
jjAlert("");
jjAlert("");
jjAlert("|*** IT'S LOCKED - THE DOOR IS LOCKED FROM THE OFTHER SIDE ***");
jjAlert("");
jjAlert("Player:||||| Damn, it's broken");
}
void onFunction7() {
jjAlert("");
jjAlert("");
jjAlert("");
jjAlert("");
jjAlert("");
jjAlert("|*** IT'S LOCKED ***");
jjAlert("|*** WARNING! Power Off ***");
jjAlert("");
}
void onFunction8() {
jjAlert("");
jjAlert("");
jjAlert("");
jjAlert("");
jjAlert("");
jjAlert("|*** IT'S LOCKED - BOAT KEY REQUIRED ***");
jjAlert("");
jjAlert("Player:||||| I can't open the door of boat");
}
void onFunction9() {
jjAlert("");
jjAlert("");
jjAlert("");
jjAlert("");
jjAlert("");
jjAlert("|*** IT'S LOCKED ***");
jjAlert("");
jjAlert("");
}
void onFunction10() {
jjAlert("");
jjAlert("");
jjAlert("");
jjAlert("");
jjAlert("Oliver:||||| Hi, I'm Oliver. What's up?");
jjAlert("Player:||||| Hi, what are you doing here?");
jjAlert("Oliver:||||| I'm here, but I hate enemies!");
jjAlert("Player:||||| OK");
}
void onFunction11() {
jjAlert("");
jjAlert("");
jjAlert("");
jjAlert("");
jjAlert("Fluffy:||||| Hi, I'm Fluffy. How are you?");
jjAlert("Player:||||| Fine!");
jjAlert("Fluffy:||||| Look through a telescope!");
jjAlert("Player:||||| Meh, Okay");
}
void onFunction12() {
p.cameraFreeze(973*32, 20*32, true, true);
jjAlert("");
jjAlert("");
jjAlert("");
jjAlert("");
jjAlert("");
jjAlert("Player:||||| OMG, DEVAN IS BACK?! It's Police Station!");
jjAlert("Fluffy:||||| Yeah, look at a flying helicopter?");
jjAlert("Player:||||| I see. I'm angry!");
}
void onFunction13() {
p.cameraUnfreeze();
}
void onFunction14() {
jjAlert("");
jjAlert("");
jjAlert("");
jjAlert("Gizmo:||||| Hi, I'm Gizmo, Can you help me, do you have the boat key?");
jjAlert("Player:||||| No, I don't have it. But where is the boat key?");
jjAlert("Gizmo:||||| Ugh, I got lost my boat key in the Power Station.");
jjAlert("Player:||||| OK, I need go to power station.");
jjAlert("Gizmo:||||| Thanks! I'm waiting for you!");
}
void onDrawLayer4(jjPLAYER@ p, jjCANVAS@ canvas) {
canvas.drawString(248*32-20, 271*32-16, "||||METRO",STRING::MEDIUM);
canvas.drawString(299*32-10, 214*32-16, "|C|A|S|I|N|O",STRING::MEDIUM);
canvas.drawString(259*32+13, 214*32-18, "||||POWER",STRING::MEDIUM);
canvas.drawString(174*32+0, 214*32-18, "|B|A|R",STRING::MEDIUM);
canvas.drawString(83*32-10, 224*32-15, "|||LIBRARY",STRING::SMALL);
canvas.drawString(95*32+3, 225*32-18, "||||Subway >",STRING::SMALL);
canvas.drawString(93*32+3, 226*32-18, "||||< Power Station",STRING::SMALL);
canvas.drawString(17*32+8, 226*32-18, "||||Welcome To Power Station",STRING::MEDIUM);
canvas.drawString(361*32, 224*32-18, "||||Port >",STRING::SMALL);
canvas.drawString(358*32+3, 225*32-18, "||||< Subway",STRING::SMALL);
canvas.drawString(358*32+3, 226*32-18, "||||< Power Station",STRING::SMALL);
canvas.drawString(395*32+15, 220*32-18, "||||Welcome To",STRING::MEDIUM);
canvas.drawString(396*32-15, 221*32-18, "||||City Island",STRING::MEDIUM);
canvas.drawString(472*32+0, 225*32-18, "|B|A|R",STRING::MEDIUM);
canvas.drawString(555*32+13, 225*32-18, "||||POWER",STRING::MEDIUM);
canvas.drawString(889*32-5, 225*32-18, "||||EXIT",STRING::MEDIUM);
}
void onDrawLayer3(jjPLAYER@ p, jjCANVAS@ canvas) {
canvas.drawString(135*32+5, 226*32-18, "||Coca-Cola",STRING::MEDIUM);
canvas.drawString(395*32+5, 226*32-18, "|||Free ICE",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.