xxxxxxxxxx
213
// if ((i.value() == "" && j == ) || (i.value() == "" && j == )) {
// createP("");
// j = 13;
// }
let i;
let j;
let disa;
function setup() {
i = createInput();
j = 0;
let disa = 0;
createP("You are Callum, the father of Todd. You start with a health of twenty.");
createP("You wake up and yawn, when you notice a sticky note on your bedside table. You pick it up and start reading. It says 'Your son, Todd, has been kidnapped. Come to 16 Grate street with $10,000 in cash by the end of today, and your son lives. Tell no one, or he dies.' You sit up, not knowing what to do. Should you call the police?");
}
function draw() {
//call police
if (i.value() == "yes" && j == 0) {
createP("You know you shouldn't go into this on your own. You pick up your phone and dial 911.");
createP("911, what's you emergency?");
createP("I just found a ransom note on my table. Can you help?");
createP("Of course. We'll be right there.");
createP('After a minute or two, the police show up. They ask if they can see the note, and you hand it to them. They read it, then tell you to get into the car. Then they drive you there and open the door to a huge mansion. They go in, and after a few minutes, gunshots are heard. The guy in the car with you is about to call for backup, when he gets shot in the shoulder, and cries out in pain. Unsure of what to do, you ask yourself, should I KEEP GOING? Should I DRIVE BACK, or just GIVE THEM THE MONEY.');
j = 1;
}
//give them the money
if (i.value() == "give them the money" && j == 1) {
createP("You walk up to the masion with your hands up, and someone invites you in. You hand them the money, and they give you your son. You stroll right out the door and walk happily to your car, when you get pulled back by one of the guys. The man starts talking.");
createP("I can't have you two talking about what happened tonight. Do you promise you won't tell anyone?");
createP("Yes, we won't tell anyone.");
createP("I'm afraid that won't be enough. I'm going to have to kill you both now. At least you'll die togethor.");
createP("Your screams for help, ironically, don't help. Your last words are: AAAAAAAUGH! DON'T KILL ME! PLEASE! AAAAAHHHH!");
j = 1000;
h = 0;
}
//try to go back, then die
if (i.value() == "drive back" && j == 1) {
createP("You start backing out, not knowing what will happen next. Then, suddenly, you die. One of the snipers must've seen you trying to back out without giving them the money.");
j = 1000;
h = 0;
}
//go in
if (i.value() == "keep going" && j == 1) {
createP("You know you should bring something useful before you go in, so you pick either a bobby pin, a pistol, or a flashlight. Once you've made your choice, write it down somewhere. Once you're done with that, you bravely open the car door, and run to the mansion. You open the front door, and have the choice to check the GROUND LEVEL, or UPSTAIRS. Which do you choose?");
j = 4;
}
//ground level
if ((i.value() == "ground level" && j == 4) || (i.value() == "ground level" && j == 2)) {
createP("You tiptoe though the hallway. You can go into the BATHROOM or the BEDROOM.");
j = 7;
}
//bathroom
if ((i.value() == "bathroom" && j == 7) || (i.value() == "bathroom" && j == 9)) {
createP("You go into the bathroom, hoping for something good. You see something behind the shower curtain. You can PULL BACK THE CURTAIN, or go to the BEDROOM instead.");
j = 8;
}
//pull back the curtain
if (i.value() == "pull back the curtain" && j == 8) {
createP("You bravely pull back the curtain, revealing a cabinet. If you have a bobby bin or a swiss army knife, you can TRY TO PICK THE LOCK on the drawer. If not, you walk into the BEDROOM.");
j = 17;
}
//try to pick the lock
if (i.value() == "try to pick the lock" && j == 17) {
if (int(random(10)) < 1) {
createP("You are able to open the drawer. Inside, you see a jar of oil you choose to pick it up.");
} else {
createP("You are unable to open the drawer. Frustrated, you stomp into the BEDROOM.");
}
j = 18;
}
//bedroom
if ((i.value() == "bedroom" && j == 7) || (i.value() == "bedroom" && j == 9) || (i.value() == "bedroom" && j == 8)) {
createP("You walk into the bedroom, but the lights are off. If you have a flashlight, TURN ON the light. If not, you can FEEL YOUR WAY AROUND, or go to the MAIN ENTRANCE.");
j = 3;
}
if (i.value() == "turn on" && j == 3) {
createP("You flick on the puny thing and look around. You try to remain standing as you observe the horrific place. The walls are smeared with blood, the floor littered with bodies, and the ceiling covered in strange writing. You look over to the bed and gag. There lies a small boy, barely alive, covered in bruises and cuts.");
createP("Oh my god... What have they done to you? Can you hear me?");
createP("*Cough* ...Huh?");
createP("Are you tied down? You look terrible. Who did this? How long have you been here? Do you want some water? I have some food.");
createP("Get out of here. I've seen too much. Just leave. If you're trying to save someone, the damage is already done. There's no coming back from here. There's no way out. They'll let you rot in h-");
createP("Stop. Just stop. I'll get you out of here.");
createP("No. Just leave me to die. Just leave me.");
createP("You wonder if you should even bother helping this poor boy. Will you?");
j = 19;
}
if (i.value() == "yes" && j == 19) {
createP("Just let me untie-");
createP("No! stop! Just leave now! Go away!");
createP("You know there's no fixing this boy. His body is still here, but his mind is dead. You do as your told and walk away to the MAIN ENTRANCE, hoping your son hasn't turned yet.");
j = 20;
}
if (i.value() == "no" && j == 19) {
createP("You figure he's better off just dying than being traumatised for the rest of his life and walk to the MAIN ENTRANCE.");
j = 20;
}
//go upstairs
if ((i.value() == "upstairs" && j == 4) || (i.value() == "upstairs" && j == 2)) {
createP("If you've already been here, go to the HALL. You creep up the stairs, being careful not to make too much sound. When you reach the top, you are greeted by a man with an axe. If you have a pistol, you can try to SHOOT HIM or for a swiss army knife, STAB HIM. Or, you can RUN DOWN THE STAIRS or try to RUN AROUND HIM.");
j = 5;
}
//run around him
if (i.value() == "run around him" && j == 5) {
if (int(random(10)) == 1 || int(random(10)) == 2) {
//roll a 1 or 2 trying to run around first guy
createP("Yikes! You trip and fall over his foot. In return, he cuts off your left foot, and walks away. You die of blood loss unless you have a med kit. If you do have a med kit, you are able to bandage it up. But, with no left foot, you have terrible balance. Because of this, all your the results are slightly worse. Note that you have used the bandage from your med kit. Tou walk to the HALL");
} else if (int(random(10)) - disa == 3 || int(random(10)) - disa == 4) {
//roll a 3 or 4 trying to run around the 1st guy
createP("You stumble, but quickly recover, then run past him. Although you made it around him, he is very quick. He turns around, and punches you in the gut. You almost fall over from the pain, but then you kick him down the stairs. At least you won't be seeing him again. You walk down the stairs to loot the body. You check his pockets. You add either a lighter or a ring into your backpack. Suddenly, he wakes up, takes his ring and rubs it. It sends out a blinding light. You look away quickly, but you still can't see. You notice he's dead again. The light is somehow stinging your skin. You take shelter behind a bin. If you have a med kit, use the lotion to stop the terrible feeling on your skin. If you don't have a med kit, your health goes down by two. You walk back up the stairs and go into the HALL.");
h -= 2;
} else {
//roll a 5 or higher trying to around the 1st guy
createP("You got lucky this time. You run past him, kick him down the stairs, and just in case that isn't enough, you use his own axe against him by chopping his head straight off. Then, you take a ring and a lighter from his pocket. You walk to the HALL.");
}
j = 11;
}
//run down the stairs, away from the 1st guy
if (i.value() == "run down the stairs" && j == 5) {
if (int(random(10)) - disa < 1) {
createP("You are able to run down the stairs without the man with the axe catching up and you go to the main entrance.");
} else {
createP("You gracefully fall down the whole flight of stairs, only breaking six bones! Then the man comes back and cuts off your right leg, leaving you to slowly bleed to death. Hooray!");
j = 1000;
h = 0;
}
j = 9;
}
//shoot the 1st guy
if (i.value() == "shoot him" && j == 5) {
if (int(random(10)) - disa < 1) {
createP("You shoot him straight in the chest. You can LOOT HIM, or just WALK PAST.");
} else {
createP("You miss him completely and he chops off your head. Too bad for you.");
j = 1000;
h = 0;
}
j = 6;
}
//loot the 1st guy
if (i.value() == "loot him" && j == 6) {
createP("You loot the body and find a ring and a lighter, but only have room for one. Once you've made your choice, you stroll to the HALL.");
j = 11;
}
//
if (i.value() == "walk past" && j == 6) {
createP("You walk into the HALL");
j = 11;
}
//try to stab the 1st guy, then die
if (i.value() == "stab him" && j == 5) {
createP("You stab him in the leg, but he seems to barely feel it. What were you thinking charging at him with just a lousy pocket knife? Just before your death, you picture Todd's face when he realises there's no one to rescue him.");
j = 1000;
h = 0;
}
//head there on your own
if (i.value() == "no" && j == 0) {
createP("Looking back to the note, it says that you should tell no one, so you're in this alone. You get into your car and start driving, then realise that you should bring something. You have the choice between a swiss army knife, a pistol, and a med kit. Once you've made your choice, write it down somewhere. Once you get there, you have the choice between going UPSTAIRS, or checking GROUND LEVEL. Which do you choose?");
j = 2;
}
//main entrance
if ((i.value() == "main entrance" && j == 9) || (i.value() == "main entrance" && j == 3) || (i.value() == "main entrance" && j == 20)) {
createP("Here you are, the place where you first came in, expecting maybe two people. You've lost track of time, but you know you've spent too long in this wretched place and you become even more determined to get Todd and yourself out of here. Go UPSTAIRS or check GROUND LEVEL, before it's too late.");
j = 4;
}
//hall
if ((i.value() == "walk past" && j == 6) || (i.value() == "hall" && j == 11) || (i.value() == "hall" && j == 5)) {
createP("Here you are in the hall, with the choice between two doors. Do go LEFT or RIGHT?");
j = 12;
}
//left
if (i.value() == "left" && j == 12) {
createP("It looks like you are in a kitchen, but there's something a little fishy about that stove. Should you check it out?");
j = 14;
}
if (i.value() == "right" && j == 12) {
createP("");
j = 15;
}
}