{
(set: $haveMap to 0)
(set: $quantityA to 0)
(set: $quantityB to 0)
(set: $quantityC to 0)
(set: $quantityD to 0)
(set: $HP to 10)
(set: $medPack to 0)
(set: $combatStatus to 0)
}(display: "introduction")(set: $currentLocation to "main")
**The entrance.**
The hatch above is closed and it needs a keycard to be unlocked. (if: $quantityD > 0)[Try to [[unlock|escape]] the hatch with a swipe of the keycard.]
(display: "menu")
You can go [[south|n]].(set: $currentLocation to "n")
**The northern junction.**
(display: "encounter")
(display: "menu")
(display: "search")
You can go [[north|main]], [[west|nw]] and [[east|ne]].(set: $currentLocation to "nw")
**The northwestern corner.**
(display: "encounter")
(display: "menu")
(display: "search")
You can go [[east|n]] and [[south|w]].(set: $currentLocation to "ne")
**The northeastern corner.**
(display: "encounter")
(display: "menu")
(display: "search")
You can go [[west|n]] and [[south|e]].(set: $currentLocation to "sw")
**The southwestern corner.**
(display: "encounter")
(display: "menu")
(display: "search")
You can go [[north|w]] and [[east|s]].(set: $currentLocation to "s")
**The southern straight.**
(display: "encounter")
(display: "menu")
(display: "search")
You can go [[west|sw]] and [[east|se]].(set: $currentLocation to "se")
**The southeastern corner.**
(display: "encounter")
(display: "menu")
(display: "search")
You can go [[north|e]] and [[west|s]].(set: $currentLocation to "w")
**The western straight.**
A [[med-pack dispenser|dispenser]] is here.
(display: "encounter")
(display: "menu")
(display: "search")
You can go [[north|nw]] and [[south|sw]].(set: $currentLocation to "e")
**The eastern junction.**
(display: "encounter")
(display: "menu")
(display: "search")
You can go [[north|ne]], [[west|c]] and [[south|se]].(set: $currentLocation to "c")
**The workshop.**
A machine is here with which you can [[fabricate a keycard|fabricator]].
(display: "encounter")
(display: "menu")
(display: "search")
You can go [[east|e]].{
You have
(if: $HP >= 7)[(color: green)[$HP hit-point(if: $HP > 1)[s]]]
(else-if: $HP >= 5)[(color: yellow)[$HP hit-point(if: $HP > 1)[s]]]
(else-if: $HP >= 3)[(color: orange)[$HP hit-point(if: $HP > 1)[s]]]
(else-if: $HP >= 1)[(color: red)[$HP hit-point(if: $HP > 1)[s]]]
(if: $medPack > 0)[ and $medPack med-pack(if: $medPack > 1)[s]].
}
{
(if: $HP < 10 and $medPack > 0)[[[Use a med-pack|useMedpack]].]
}
{
(if: $haveMap is 1)[You have a [[$searchMedium|map]]. You can try to search for [[materials]] here.]
(if: $quantityA > 0)[You have $quantityA unit(if: $quantityA > 1)[s] of polyethylene terephthalate.]
(if: $quantityB > 0)[You have $quantityB unit(if: $quantityB > 1)[s] of magnetized alloy.]
(if: $quantityC > 0)[You have $quantityC unit(if: $quantityC > 1)[s] of conducting laminate.]
(if: $quantityD > 0)[You have $quantityD keycard(if: $quantityD > 1)[s].]
}{(set: $searchRoll to (random: 1,10))
(if: $searchRoll is 10 and $haveMap is 0)[(set: $searchMedium to (either: "handwritten note", "scrap of paper", "post-it note", "scrawled-upon magazine", "notepad"))(color: green)[You find a [[$searchMedium|map]] with useful information.] (set: $haveMap to 1, $mapRoom to (either: "main", "n", "ne", "e", "c", "se", "s", "sw", "w", "nw"))]
(else-if: $haveMap is 1)[]
(else:)[You (either: "look around your immediate vicinity", "examine your surroundings", "search around the area") but find nothing.]
<!-- (else:)[searchroll is $searchRoll, havemap is $haveMap] -->
}{<!-- "main", "n", "ne", "e", "c", "se", "s", "sw", "w", "nw" -->
(if: $mapRoom is "main")[(set: $mapDescription to "The room it describes only has an exit to the south.")]
(else-if: $mapRoom is "n")[(set: $mapDescription to "The room it describes has exits to the north, west and east.")]
(else-if: $mapRoom is "ne")[(set: $mapDescription to "The room it describes has exits to the west and south.")]
(else-if: $mapRoom is "e")[(set: $mapDescription to "The room it describes has exits to the north, west and south.")]
(else-if: $mapRoom is "c")[(set: $mapDescription to "The room it describes only has an exit to the east.")]
(else-if: $mapRoom is "se")[(set: $mapDescription to "The room it describes has exits to the north and west.")]
(else-if: $mapRoom is "s")[(set: $mapDescription to "The room it describes has exits to the west and east.")]
(else-if: $mapRoom is "sw")[(set: $mapDescription to "The room it describes has exits to the north and east.")]
(else-if: $mapRoom is "w")[(set: $mapDescription to "The room it describes has exits to the north and south.")]
(else-if: $mapRoom is "nw")[(set: $mapDescription to "The room it describes has exits to the east and south.")]}
You study the $searchMedium. $mapDescription
(display: $currentLocation)(if: $currentLocation is $mapRoom and $haveMap is 1)[{(set: $treasureResult to (random: 1,3))
(if: $treasureResult is 1)[(color: green)[You look around to uncover a unit of polyethylene terephthalate! (set: $quantityA to it + 1)]]
(else-if: $treasureResult is 2)[(color: green)[You look around to uncover a unit of magnetic alloys! (set: $quantityB to it + 1)]]
(else-if: $treasureResult is 3)[(color: green)[You look around to uncover a unit of conducting laminates! (set: $quantityC to it + 1)]]
(else:)[Something went wrong. Variable treasureResult is $treasureResult]
(set: $haveMap to 0)}
(display: $currentLocation)]
(else:)[(color: orange)[You look around for a while but find nothing.]
(display: $currentLocation)]{
(if: $quantityA is >= 2 and $quantityB >= 2 and $quantityC >= 2)[
(color: green)[You use 2 units of each material and create a keycard.] Time to get out of here!(set: $quantityA to it - 2, $quantityD to it - 2, $quantityC to it - 2, $quantityD to it + 1)
]
(else:)[
You require at least 2 units of polyethylene terephthalate, magnetic alloys and conducting laminates each to fabricate a keycard.
]
}
(display: $currentLocation)You open the hatch and see a [[ladder]] leading up.You climb the ladder, thinking about the weird scavenger hunt you just experienced. The [[ladder|ladder2]] continues going up.You don't yet see what the ladder might lead up to. It's dark. You've been [[climbing|ladder3]] for a while now.Wait, were you going up? Or down? You feel [[confused]].You stop momentarily and take a deep breath to clear your head, then continue on your way [[down]].Something doesn't seem right. Didn't you have some kind of important item with you before? Weird. You continue climbing [[down|down2]].The ladder leads down into a room at last. A hatch closes above you as you [[jump down|reset]].
(color: green)[You... //think// you feel relieved. Congratulations?]{
(set: $encounterCheck to (random: 1,15))
(if: $encounterCheck is 15)[(go-to: "combat")]
}(if: $combatStatus is 1)[Error: already in combat.]
(else-if: $combatStatus is 0)[(set: $initiative to (random: 1,2))(if: $initiative is 1)[(color: red)[A drone releases from its perch, but you get the drop on it!](set: $combatStatus to 1, $droneHP to 3)
(display: "playerAttack")]
(else-if: $initiative is 2)[(color: red)[A drone releases from its perch and attacks you!](set: $combatStatus to 1, $droneHP to 3)
(display: "droneAttack")]]You have $HP hit-points.
{
The med-pack dispenser can take 1 unit of
polyethylene terephthalate,
(if: $quantityA > 0)[(click: "polyethylene terephthalate")[(set: $quantityA to it -1)(go-to: "dispenseMedpack")]]
magnetized alloy, or
(if: $quantityB > 0)[(click: "magnetized alloy")[(set: $quantityB to it -1)(go-to: "dispenseMedpack")]]
conducting laminate
(if: $quantityC > 0)[(click: "conducting laminate")[(set: $quantityC to it -1)(go-to: "dispenseMedpack")]]
to produce a med-pack.
}
(if: $quantityA is 0 and $quantityB is 0 and $quantityC is 0)[You do not have the required materials to produce a med-pack.]
[[Turn away|$currentLocation]] from the med-pack dispenser.{
(set: $playerAttack to (random: 1,2))
You (either: "swing for", "punch at", "attack") the drone
(if: $playerAttack is 1)[
but miss.
]
(else-if: $playerAttack is 2)[
(set: $damage to (random: 1,2))
(set: $droneHP to it - $damage)
(if: $droneHP >= 1)[and (color: green)[hit it for $damage damage.]]
(else:)[and (color: green)[hit it for $damage damage, destroying it!]]
]
}
{
(if: $droneHP >= 1)[
(display: "droneAttack")
]
(else:)[
[[Examine|endCombat]] the wrecked drone.
]
}{
(set: $droneAttack to (random: 1,2))
The drone charges for an attack
(if: $droneAttack is 1)[
but (either: "shoots wide", "you dodge its shot", "its shot misses").
(if: $HP >= 7)[(color: green)[You have $HP hit-point(if: $HP > 1)[s].]]
(else-if: $HP >= 5)[(color: yellow)[You have $HP hit-point(if: $HP > 1)[s].]]
(else-if: $HP >= 3)[(color: orange)[You have $HP hit-point(if: $HP > 1)[s].]]
(else-if: $HP >= 1)[(color: red)[You have $HP hit-point(if: $HP > 1)[s].]]
]
(else-if: $droneAttack is 2)[
(set: $damage to (random: 1,2))
(set: $HP to it - $damage)
(if: $HP >= 1)[and (color: red)[zaps you for $damage damage.]
(if: $HP >= 7)[(color: green)[You have $HP hit-point(if: $HP > 1)[s].]]
(else-if: $HP >= 5)[(color: yellow)[You have $HP hit-point(if: $HP > 1)[s].]]
(else-if: $HP >= 3)[(color: orange)[You have $HP hit-point(if: $HP > 1)[s].]]
(else-if: $HP >= 1)[(color: red)[You have $HP hit-point(if: $HP > 1)[s].]]
(else:)[You lose consciousness.]
]]
}
(if: $HP >= 1)[
Attempt to [[attack the drone|playerAttack]].
Try to [[flee from combat|fleeCombat]].
(if: $HP < 10 and $medPack > 0)[Use a med-pack.(click-replace: "Use a med-pack.")[(set: $HP to 10, $medPack to it - 1) (color: green)[Using the med-pack you heal yourself back to $HP hit-points.]]]
]
(else:)[
(display: "knockedOut")
]
{
(set: $combatStatus to 0)
(set: $loot to (random: 1,4))
(if: $loot is 1)[(color: green)[You (either: "rummage through", "examine", "investigate") the remains of the drone and (either: "uncover", "find", "salvage") a unit of polyethylene terephthalate! (set: $quantityA to it + 1)]]
(else-if: $loot is 2)[(color: green)[You (either: "rummage through", "examine", "investigate") the remains of the drone and (either: "uncover", "find", "salvage") a unit of magnetic alloys! (set: $quantityB to it + 1)]]
(else-if: $loot is 3)[(color: green)[You (either: "rummage through", "examine", "investigate") the remains of the drone and (either: "uncover", "find", "salvage") a unit of conducting laminates! (set: $quantityC to it + 1)]]
(else-if: $loot is 4)[(color: orange)[You (either: "rummage through", "examine", "investigate") the remains of the drone but (either: "uncover", "find", "salvage") nothing of use.]]
(else:)[Something went wrong. Variable loot is $loot]
}
(display: $currentLocation)The darkness begins to lift. You are lying on the ground and are not quite sure what happened. You try to [[stand up|init]].(set: $medPack to it + 1)
You produce a med-pack.
(display: $currentLocation)
(set: $HP to 10, $medPack to it - 1)
Using the med-pack you heal yourself.
(display: $currentLocation){
(set: $fleeCombat to (random: 1,2))
(if: $fleeCombat is 1)[(set: $combatStatus to 0)You stand perfectly still and [[confuse the drone's motion sensors|$currentLocation]], which returns to its perch and powers down.]
(else-if: $fleeCombat is 2)[You stumble around and fail to flee, [[leaving yourself vulnerable|droneAttack]]!]
}**WELCOME TO GRID GAME**
^^//An ongoing effort to warm up for Ludum Dare by <a href="https://ldjam.com/users/flaterectomy">Flaterectomy</a>//^^
There's a hatch blocking your way to escape. Surely you'll be able to find clues that hint at where can find the resources required to create the keycard that opens the damn thing.
You may get into trouble with the automated defenses. You can use resources to produce med-packs that heal you back up to 10 hit-points, though. Convenient!
[[Let's do this!|main]](set: $haveMap to 0)
(set: $quantityA to 0)
(set: $quantityB to 0)
(set: $quantityC to 0)
(set: $quantityD to 0)
(set: $HP to 10)
(set: $medPack to 0)
(set: $combatStatus to 0)
(display: "main")