Home
Start a new game
Explore games
Help
Log in or sign up
Log in
Username
Password (
Forgot it?
)
×
New to Playfic?
Full Name
Email
Username
Password
Password (confirm)
Are you sure about this?
The Cave
by
Aiden Shrenik
Played 73 times
View game source
(spoilers!)
Download the
.z8 file
Source Code
[introduction] When play begins: say "You are a young adventurous wizard, willing to explore every corner of any puzzle. You tread carefully through the cave’s shadows, but a hidden crevice catches your boot. Before you can react, you’re plunging into darkness. You awaken in a dimly lit cavern, echoing with the sound of water dripping onto the floor. You reach for your spellbook and notice it's missing. You must have lost it on the way down. [roman type][paragraph break]"; [The Twilight Zone] The Twilight Zone is a room. "You find yourself in a dimly lit chamber of the cave, surrounded by tiny bioluminescent plants. It feels significantly colder than before. You hear the faint rhythm of water dripping into a pool in the ground." Instead of going up in The Twilight Zone: say "It's too far to climb back up." [Vase] The Vase is an object. The Vase is in The Twilight Zone. The Vase can be broken. The description is "You see a vase covered in ancient drawings and cracks. It seems to be fragile." The Shiny Key is a thing. The description is "A small silver key gleaming faintly in the cave light." Instead of attacking the vase: if the vase is broken: say "The vase is already in shards."; else: now the vase is broken; now the Shiny Key is in The Twilight Zone; say "You smash the vase into tiny pieces! Shards scatter everywhere. Beneath the fragmented pieces, a tiny metal object reflects the gleaming light from the sunset above" ; Understand "tiny metal object", "metal object", "metal" as key. The East Door is a door. It is east of The Twilight Zone. The East Door is locked. The East Door is lockable. The Shiny Key unlocks the East Door. Instead of going east from The Twilight Zone when the East Door is locked: say "The heavy east door blocks your way. It seems to need a key." The South Door is a door. It is south of The Twilight Zone. The South Door is locked. The South Door is lockable. The Shiny Key unlocks the South Door. Instead of going south from The Twilight Zone when the South Door is locked: say "The heavy south door blocks your way. It seems to need a key." The West Door is a door. It is west of The Twilight Zone. The West Door is locked. The West Door is lockable. The Shiny Key unlocks the West Door. Instead of going west from The Twilight Zone when the West Door is locked: say "The heavy west door blocks your way. It seems to need a key." [---------------------------------------------------------------------------------] [------------------------------ Puzzle Room ------------------------------] The Passage is a room. It is west of The West Door.. "The damp room covered in moss glows faintly. An old mage sits on the cold ground, contemplating how he got here." The Mage is a man in The Passage. The description of the Mage is "A weary old mage, eager to test your wit." Understand "man" as the Mage. The wooden door is a door. It is west of The Passage and east of The Cavern. The wooden door is closed, lockable, and locked. The Cavern is a room. It is west of the wooden door. "A huge cavern stretches into darkness. Water drips from Stalactites on the ceiling. You can see a faint light in the distance." The Mage-riddle-solved is a truth state that varies. The Mage-riddle-solved is false. [------------------------------ Riddle Interaction ------------------------------] Talking to is an action applying to one visible thing. Understand "talk to [someone]" as talking to. Instead of talking to the Mage: say "'Ah, traveler,' the Mage whispers. 'Answer me this riddle, and I shall open your way west...'"; say "[line break]'I follow you by day and flee from you by night. What am I?'"; say "[line break](Perhaps you should try saying the answer aloud...)". Instead of going west from The Passage when the wooden door is locked: say "The Mage raises his staff. 'You may not pass until you speak the answer, traveler.'"; stop the action. Instead of answering the Mage that some text: if the topic understood matches "shadow": if Mage-riddle-solved is false: now Mage-riddle-solved is true; now the wooden door is unlocked; say "The Mage nods solemnly. 'Indeed... your shadow.' With a wave of his hand, the wooden door clicks open."; else: say "The Mage smiles. 'You already know the truth, traveler. The way west remains open.'"; otherwise: say "The Mage frowns. 'That is not the answer I seek. Think again, traveler.'" [------------------------------The Grotto--------------------------------------] The Grotto is a room. The Grotto is south of The South Door. "As you walk closer to The Grotto, you can hear water gushing down into a large pool of water. As you enter, you quickly get drenched from the mist of the waterfall. You see a large opening in the ceiling with water pouring down, illuminated by the white glow of the night’s moon." [------------------------------The cavern -------------------------------------] [------------------------------ Casting System ------------------------------] [------------------------------ Spellbook & Tutorial ------------------------------] The Spellbook is in the Cavern. The Spellbook is a thing. The Spellbook can be read. The description of the Spellbook is "A thick tome bound in faded blue leather. Runes shimmer faintly on its cover. You flip open the ancient pages. Four spells reveal themselves in flowing script: • firebolt — a crackling projectile of flame that deals damage. • frostbind — freezes your target in place. • heal — restores a bit of your strength. • shockwave — a burst of electricity that stuns and damages enemies. Try 'cast firebolt on dummy' or 'cast heal on self'." The player has a number called health. The health of the player is 10. The Training Dummy is in the Cavern. The description is "A sturdy straw dummy used for practicing magic. Its surface is scorched and frozen in places." The Dummy-health is a number that varies. The Dummy-health is 10. Casting it on is an action applying to one topic and one visible thing. Understand "cast [text] on [something]" as casting it on. Carry out casting it on: let spell be the topic understood; let target be the second noun; if spell matches "heal" or spell matches "mend": if target is the player: if the health of the player < 10: increase the health of the player by 3; if the health of the player > 10: now the health of the player is 10; say "Warm energy flows through your body. Your wounds mend slightly. [health status]"; otherwise: say "You already feel perfectly healthy."; otherwise: say "You can't heal that!"; otherwise if target is not the Training Dummy: say "That spell won't work on [the target]."; otherwise if spell matches "firebolt": decrease Dummy-health by 4; say "You hurl a blazing firebolt at the dummy! It bursts into flame for a moment."; if Dummy-health <= 0: say "The dummy collapses into ashes. You have destroyed it!"; otherwise if spell matches "frostbind": say "Frost spreads across the dummy, freezing it solid for a moment."; otherwise if spell matches "shockwave": decrease Dummy-health by 3; say "You unleash a crackling wave of electricity that jolts the dummy violently!"; if Dummy-health <= 0: say "The dummy falls apart, smoke curling from its remains."; otherwise: say "That spell doesn't seem to exist in your spellbook."; To say health status: say "(Health: [health of the player]/10)" [---------------------------The Dark Zone-------------------------------------] The Dark Zone is a room. The Dark Zone is east of The East Door. "You walk into a pitch black room, you can't see anything but the exit. It's almost like some magical force is consuming the light in the room." [-----------------------Underground Lake------------------------------------] Underground Lake is a room. The Underground Lake is east of The Grotto. The Underground Lake is south of the Dark Zone. "There is a stream that leads to a huge ever expanding lake, still as glass and clear as crystal. The air smells musty." [-------------------------- Forgotten Chamber --------------------------] The Forgotten Chamber is a room. "You enter a dusty room, torches lighting up the sides of the chamber. Sitting there is a fluffy white rabbit, with bright blue eyes locked onto you with a hint of curiosity." The Forgotten Chamber is east of the Underground Lake. [---------- Forgotten Chamber Rabbit Hint --------------------------] Instead of examining the rabbit in the Forgotten Chamber: say "The rabbit looks at you and hops toward a faintly glowing mural. Perhaps this little creature holds the secret to transformation."; [-------------------------- Vault Door Area --------------------------] The Vault Door Room is a room. The Vault Door Room is north of the Cavern. "You enter a dimly lit chamber. You see an old stone keypad, it's smoothed by time." [--- Add a note in the Vault Door Room ---] The Note is thing in the Vault Door Room. The description is "A small piece of parchment pinned to the wall reads: 'Journal entry, August 14th, 1669: I discovered a new way to conceal text. It only needs a bit of heat to be revealed.'"; [--- The actual Vault Door object ---] The Vault Barrier is a door. It is east of the Vault Door Room and west of the Potion Lab. The description of the vault barrier is "You see a large, daunting barrier. You notice a vault door panel on it. It seems to have a writing, almost invisible. Enter a code by typing 'enter *code* into vault barrier'" The Vault Barrier is lockable and locked. The Vault Door Panel is part of the Vault Barrier. The description of the Vault Door Panel is "A heavy, reinforced stone door with a keypad." [-------------------------- Vault Code Logic --------------------------] The Vault Code is a number that varies. [--- Firebolt interaction with the vault door ---] Instead of casting "firebolt" on the Vault Barrier: say "You shoot a flaming fireball into the Vault Barrier. All of the sudden, the numbers 2612 suddenly appear on the wall beside it."; now the Vault Code is 2612; Inputting a code into is an action applying to one number and one thing. Understand "enter [number] into [something]" or "type [number] into [something]" as inputting a code into. Carry out inputting a code into: let attempted be the number understood; let target be the second noun; if target is not the Vault Door Panel and target is not the Vault Barrier: say "That doesn't have anywhere to enter a code."; stop the action; if attempted is the Vault Code: if the Vault Barrier is locked: now the Vault Barrier is unlocked; now the Vault Barrier is open; say "The keypad beeps and flashes green. The heavy vault door slides open with a mechanical roar."; else: say "The vault door is already open."; otherwise: say "The keypad buzzes angrily. Wrong code."; [-------------------------- Potion Lab (The Tomb) --------------------------] "Rabbit Habit" The Potion Lab is a room. "You step into a cluttered mess of vials and potions scattered around the floor. You smell a weird scent that makes you feel nauseous for a second before snapping out of it. You see a mural that seems to depict a human transforming into a bunny-like creature. You see a cauldron, ready to brew." The Potion Lab is east of the Vault Barrier. The Rabbit Mural is scenery in the Potion Lab. The description of the Rabbit Mural is "A painting of a rabbit followed by three plants: Moonflower, Silverleaf, and Crystal Dew. It looks like a recipe of some kind." Moonflower is a thing in the Potion Lab. The description is "A pale moonlit blossom, soft and faintly glowing." Silverleaf is a thing in the Potion Lab. The description is "A silver leaf with a cool metallic texture." Crystal Dew is a thing in the Potion Lab. The description is "Tiny droplets of shimmering dew, perfectly clear." [--- Rabbit Potion setup ---] The Rabbit Potion is a thing. The Rabbit Potion is portable. The Rabbit Potion can be unused or used. The Rabbit Potion is unused. Understand "rabbit potion", "potion", "r potion", "rpotion", "glowing potion" as Rabbit Potion. Brewing is an action applying to nothing. Understand "brew potion" or "brew" or "mix potion" as brewing. Carry out brewing: if the player carries Moonflower and the player carries Silverleaf and the player carries Crystal Dew: if Rabbit Potion is nowhere: now the player carries Rabbit Potion ; remove Moonflower from play; remove Silverleaf from play; remove Crystal Dew from play; say "You grind Moonflower, Silverleaf, and Crystal Dew together in a brass bowl, whispering a few ancient words. A glowing potion shaped like a rabbit materializes in your hands — the Rabbit Potion."; else: say "You've already brewed the potion."; otherwise: say "You don't have all the ingredients. The mural shows Moonflower, Silverleaf, and Crystal Dew — find them first."; [--- Rabbit transformation logic ---] Rabbit form is a truth state that varies. Rabbit form is false. The Rabbit Potion can be unused or used. The Rabbit Potion is unused. Understand "rabbit potion", "potion", "r potion", "rpotion", "glowing potion" as Rabbit Potion . Instead of drinking the Rabbit Potion when the Rabbit Potion is used: say "The bottle is empty — you already drank its strange glowing contents."; Instead of drinking the Rabbit Potion : if rabbit form is false: now rabbit form is true; now the Rabbit Potion is used; say "You uncork the Rabbit Potion and drink. A strange tingling rushes through you, fur sprouts, ears stretch, and your body shrinks! You’ve become a rabbit!"; otherwise: say "You’re already a rabbit. More potion won’t change that."; Instead of examining the player when rabbit form is true: say "You are small and covered in soft fur. Your twitching nose and long ears are... surprisingly cute."; [----------------------- Rabbit Passage (New Room) -----------------------] The Burrow Entrance is a room. The Burrow Entrance is south of the Cavern. "The tunnel shrinks significantly after you enter this passage. It is getting smaller and smaller." Instead of going south from the Cavern: if rabbit form is false: say "The passage ahead is far too small for a human. You'd have to be much smaller — perhaps a rabbit — to fit through."; stop the action; otherwise: continue the action. [--- Reverting from Rabbit Form ---] Reverting is an action applying to nothing. Understand "revert" or "return to human" or "transform back" or "turn back" as reverting. Carry out reverting: if rabbit form is false: say "You’re already in your human form."; else: now rabbit form is false; say "You take a deep breath and poof! You reappear as yourself in human form. Who knew it would be so easy?"; [------------------------------ The Boss Fight ------------------------------] The Arena is a room. The Arena is south of the Burrow Entrance. "You emerge from the narrow burrow into a vast chamber — the Arena. Torches flicker on stone pillars, casting long shadows. At the far end stands the Mage from before, his eyes blazing with fury. He raises his staff, and the ground trembles." The Boss Mage is a man in the Arena. The description of the Boss Mage is "The same old man from before, now radiating power. His robes whip in an unseen wind. So much for being 'weary'. His staff hums with arcane energy."; Understand "mage", "boss", "old man", "wizard" as the Boss Mage. The boss-health is a number that varies. The boss-health is 12. The boss-fight-started is a truth state that varies. The boss-fight-started is false. The boss-defeated is a truth state that varies. The boss-defeated is false. After going to the Arena for the first time: say "'You!’ the Mage shouts. ‘You thought you could just solve my riddle and leave? I am the Guardian of this place — and you have meddled too much!' He slams his staff, sending sparks flying. [line break] Choose your move wisely... [line break] Firebolt, Shockwave, heal, dodge, and run --- Use the verb 'choose'"; now boss-fight-started is true; [------------------ Player Choice System ------------------] Choosing is an action applying to one topic. Understand "choose [text]" or "use [text]" or "try [text]" as choosing. Carry out choosing: if boss-defeated is true: say "The Boss Mage has already fallen. There's nothing more to do here."; stop the action; if boss-fight-started is false: say "There's nothing requiring a choice right now."; stop the action; let option be the topic understood; if option matches "firebolt": decrease boss-health by 4; say "You hurl a firebolt straight at the Boss Mage! It strikes him in the chest — he staggers, his beard singed!"; otherwise if option matches "shockwave": decrease boss-health by 3; say "You slam your hands down — a wave of electricity crackles across the floor, catching him off guard!"; otherwise if option matches "heal": increase the health of the player by 3; if the health of the player > 10: now the health of the player is 10; say "You take a deep breath and channel healing energy through yourself. Your wounds begin to close. [health status]"; otherwise if option matches "dodge": say "You roll to the side as the Mage unleashes a bolt of pure light — it narrowly misses you!"; otherwise if option matches "throw potion": say "You hurl a random potion at him. It explodes into pink smoke! He coughs violently, blinded for a second."; otherwise if option matches "run" or option matches "escape": say "You spin around and sprint for the door — but it seals shut with a deafening clang. 'There is no escape!' the Mage bellows."; otherwise: say "That doesn't seem like a valid choice. Try something like 'choose firebolt' or 'choose dodge'."; [------------------ Boss Turn / Attacks ------------------] Every turn when boss-fight-started is true and boss-defeated is false: let attack-roll be a random number between 1 and 3; if attack-roll is 1: decrease health of the player by 2; say "The Boss Mage unleashes a bolt of arcane energy at you! You feel the impact — (-2 Health) [health status]"; otherwise if attack-roll is 2: decrease health of the player by 1; say "A wave of chilling frost spreads from the Mage's staff, brushing you lightly. (-1 Health) [health status]"; otherwise: say "The Boss Mage glares at you, charging his next attack."; if health of the player <= 0: end the story saying "You collapse under the relentless assault of the Boss Mage. Darkness surrounds you..."; [------------------ Boss Defeat Logic ------------------] Every turn: if boss-health <= 0 and boss-defeated is false: now boss-defeated is true; say "The Boss Mage drops to his knees, his staff cracking in half. 'You... have bested me,' he croaks. The arena torches dim, and the door behind him collapses into rubble. A small crack opens in the eastern wall, far too narrow for a person, but perhaps a rabbit could squeeze through."; remove the Boss Mage from play; [------------------ Escape Tunnel ------------------] The Collapsed Tunnel is a room. The Collapsed Tunnel is east of the Arena. "The passage here has mostly caved in, leaving only a narrow hole barely large enough for a rabbit to squeeze through." Instead of going east from the Arena: if boss-defeated is false: say "The Mage blocks your way with a wall of light."; stop the action; if rabbit form is false: say "The opening is far too small for a human, but if you were smaller, you might be able to escape."; stop the action; otherwise: continue the action. The Alcove is east of the Collapsed Tunnel. "A breeze of fresh air hits you as you walk out of that colosseum. In front of you, there is a beautiful sunrise painting the sky with red and orange. The peace after the storm." After going to The Alcove: end the story finally.