Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
119 changes: 106 additions & 13 deletions cursed.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,31 +82,122 @@ function updateStats() {
// Scene Data
const sceneData = {
start: {
text: "You are in a dark forest. You see a path ahead.",
text: "In the scorching desert heat, you see the majestic silhouette of the ancient temple. Your heart beats with excitement as you approach the mysterious entrance. The imposing gate invites you to step inside. With trembling hands, you take the step into the dark vestibule of the temple. Somewhere in these chambers lies one of the most precious treasures of the ancient civilization. A cursed treasure.",
choices: [
{
text: "Take the path",
next: "path",
text: "Enter the temple.",
next: "entrance_hall",
addItem: "map"
},
{
text: "Stay here",
next: "stay"
next: "retry"
}
]
},
path: {
text: "You walk down the path and find a map.",
entrance_hall: {
text: "You find yourself in a huge entrance chamber. Faded symbols are engraved on the old stonewalls. Several paths lead from here deeper into the temple. Which one do you wanne choose.",
choices: [
{ text: "Look at the map", next: "map", addItem: "health potion", addStatus: "poisoned" },
{ text: "Keep walking", next: "deep_forest", addHealth: 1 }
{ text: "To your right you see a small passage between two statues of black cats with golden eyes.", next: "cat_passage" },
{ text: "An enormous door decorated with golden hyroglyphes is right infront of you.", next: "pit_room" },
{ text: "As you take a closer look you found another way. A hidden door behind a painting of a scarab.", next: "painting_room" },
]
},
map: {
text: "The map shows a hidden treasure.",
cat_passage: {
text: "Entering the mysterious room through the narrow passage between the majestic cat statues, you are greeted by the scent of old books filling the air. As you look around, you discover a variety of ancient scrolls and books.",
choices: [
{ text: "Search for treasure", next: "treasure" },
{ text: "Ignore the map", next: "deep_forest", removeHealth: 1 }
{ text: "You can examine one of the papyrus scrolls more closely.", next: "scroll_of_truth", addItem: "Scroll of Truth" },
{ text: "You can search the shelves for a hidden compartment.", next: "healing_potion_1", addItem: "Healing Potion" },
{ text: "You can inspect one of the parchment scrolls more closely.", next: "scroll_of_truth", addItem: "Scroll of Truth" },
]
},
scroll_of_truth: {
text: "You find a mysterious scroll. For the last months you studied hyroglyphes and know the effort pays off. The Scroll of Truth explains a short ritual to break the curse. Now you just need to find the treasure, but the door on the other side of the room is locked.",
choices: [
{ text: "Go back.", next: "entrance_hall" },
{ text: "Try to lockpick the door.", next: "mummy", requiredDEX: 12 },
{ text: "Try to breakt the door.", next: "mummy", requiredSTR: 12 },
]
},
healing_potion_1: {
text: "You find a small jar with a red shimmering liquid in it. A healing potion. Just in case you get in a fight and get hurt. Now you just need to find the treasure, but the door on the other side of the room is locked.",
choices: [
{ text: "Go back.", next: "entrance_hall" },
{ text: "Try to lockpick the door.", next: "mummy", requiredDEX: 12 },
{ text: "Try to breakt the door.", next: "mummy", requiredSTR: 12 },
]
},
mummy: {
text: "You enter a room full of sand in which there are three sarcophagi. As you take a closer look you find that one of the sarcophagi is broken. A hand grabs your ankle. As you look down you see a mummy burried in the sand. It seems like it want to tell you something.",
choices: [
{ text: "Fight the mummy.", next: "treasure_way_hurt", removeHealth: 1, addStatus: "poisoned" },
{ text: "Kill the mummy.", next: "treasure_way", requiredSTR: 12 },
{ text: "Talk to the mummy.", next: "treasure_way_hurt", removeHealth: 1, addStatus: "poisoned" },
{ text: "Convince the mummy to help you.", next: "healing_potion_2", requiredWIS: 12, addItem: "Healing Potion" },
]
},
healing_potion_2: {
text: "You find a small jar with a golden shimmering liquid in it. This must be a healing potion.",
choices: [
{ text: "Go further.", next: "treasure_room" },
]
},
treasure_way_hurt: {
text: "The mummy digs it sharp fingernails into your leg. You kick the mummy in the head and try to free yourself. Its grib loosened and you start running. A burning feeling fills your body. You have been poisoned and lose 1 HP.",
choices: [
{ text: "Take a healing potion.", next: "treasure_room", requiredItem: "Healing Potion", removeItem: "Healing Potion", addHealth: 1 },
{ text: "Keep running.", next: "treasure_room" },
]
},
treasure_room: {
text: "You follow the dark hallway. It leads you deeper into the ancient temple. You make your way to the treasure room but find it guarded by a huge monster.",
choices: [
{ text: "Try to sneak past the monster.", next: "treasure", requiredDEX: 12 },
{ text: "Try to talk to the monster.", next: "treasure_hurt_2", removeHealth: 2 },
{ text: "Fight the monster.", next: "treasure_hurt_1", removeHealth: 1 },
]
},
treasure_hurt_2: {
text: "The moment you open your mouth the monster lashes out at you with its golden claws. A sharp pain rushes through your shoulder.",
choices: [
{ text: "Try to sneak past the monster.", next: "cursed_treasure", requiredDEX: 12 },
{ text: "Take a healing potion.", next: "treasure_room", requiredItem: "Healing Potion", removeItem: "Healing Potion", addHealth: 1 },
{ text: "Fight the monster.", next: "treasure_hurt_1", removeHealth: 1 },
]
},
treasure_hurt_1: {
text: "The monster lashes out at you with its golden claws. You duck away and only one of the claws scratches over your arm.",
choices: [
{ text: "Try to sneak past the monster.", next: "cursed_treasure", requiredDEX: 12 },
{ text: "Take a healing potion.", next: "cursed_treasure", requiredItem: "Healing Potion", removeItem: "Healing Potion", addHealth: 1 },
{ text: "Continue to fight the monster.", next: "cursed_treasure" },
]
},
cursed_treasure: {
text: "You look around and see a sharp looking stone laying on the ground. That is the weapon you needed. You let yourself drop to the ground, roll to the side and grab the stone. You aim at the monsters head and throw the stone with all of your strength. The beast collapses with a scream. You enter the last chamber and nearly stumble over a pile of old papyrus scrolls. The floor is covered in gold tokens and on the wall across the room you see a khopesh sword.",
choices: [
{ text: "Take the treasure.", next: "cursed_end" },
{ text: "Use the Scroll of Truth to reveal the curse and break it.", requiredItem: "Scroll of Truth", removeItem: "Scroll of Truth", next: "happy_end" },
]
},
cursed_end: {
text: " You don't want to wait any longer. It took you long enough to find this place and you defeated the guardian. The treasure is now yours.",
choices: [
{ text: "Take the gold.", requiredDEX: 12, next: "new_guard" },
{ text: "Take the papyrus scrolls.", requiredWIS: 12, next: "new_guard" },
{ text: "Take the khopesh sword.", requiredSTR: 12, next: "new_guard" },
]
},
new_guard: {
text: "Your fingertips touch the treasure you've been looking for so long. A smile sreads across your face as suddenly a strange feeling shakes your body. For a brief moment you loose your orientation. You close you eyes, take a deep breath and open them again. The ground seems further away than usual and you're pretty sure that you didn't have claws before. But you know those golden claws. Now you are the guardian of the treasure.",
choices: [
{ text: "Try again.", next: "retry" },
]
},
happy_end: {
text: "You take the Scroll of Truth and start to read the hyroglyphes out loud. Your heart beats faster as a golden glow begins to fill the room. Shimmering symbols appear in the air around you and vanishing in little blue flashes as you continue reading. The moment you reach the end of the text, all the symbols have disappeared and the glow ends. Carefully you pick up the treasure you've been looking for so long. It's easy to find your way out with your good sense of direction. This treasure will change your life for the better.",
choices: [
{ text: "Go further.", next: "treasure_room" },
]
},
retry: {
Expand All @@ -122,7 +213,9 @@ const sceneData = {
{ text: "Restart", next: "start", reload: true }
]
}
};
},
// Inventory
interface, Item, { name: string };
class Inventory {
constructor() {
this.items = [];
Expand Down
41 changes: 31 additions & 10 deletions cursed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -207,25 +207,46 @@ const sceneData: { [key: string]: Scene; } = {
]
},
treasure_hurt_2: {
text: "The moment you open your mouth the monster lashes out at you with its claws. A sharp pain rushes through your shoulder.",
text: "The moment you open your mouth the monster lashes out at you with its golden claws. A sharp pain rushes through your shoulder.",
choices: [
{ text: "Try to sneak past the monster.", next: "treasure", requiredDEX: 12 },
{ text: "Try to sneak past the monster.", next: "cursed_treasure", requiredDEX: 12 },
{ text: "Take a healing potion.", next: "treasure_room", requiredItem: "Healing Potion", removeItem: "Healing Potion", addHealth: 1 },
{ text: "Fight the monster.", next: "treasure_hurt_1", removeHealth: 1},
]
},
treasure_hurt_1: {
text: "The monster lashes out at you with its claws. You duck away and only one of the claws scratches over your arm.",
text: "The monster lashes out at you with its golden claws. You duck away and only one of the claws scratches over your arm.",
choices: [
{ text: "Try to sneak past the monster.", next: "treasure", requiredDEX: 12 },
{ text: "Take a healing potion.", next: "treasure", requiredItem: "Healing Potion", removeItem: "Healing Potion", addHealth: 1 },
{ text: "Continue to fight the monster.", next: "treasure"},
{ text: "Try to sneak past the monster.", next: "cursed_treasure", requiredDEX: 12 },
{ text: "Take a healing potion.", next: "cursed_treasure", requiredItem: "Healing Potion", removeItem: "Healing Potion", addHealth: 1 },
{ text: "Continue to fight the monster.", next: "cursed_treasure"},
]
},
cursed_treasure: {
text: "You look around and see a sharp looking stone laying on the ground. That is the weapon you needed. You let yourself drop to the ground, roll to the side and grab the stone. You aim at the monsters head and throw the stone with all of your strength. The beast collapses with a scream. You enter the last chamber and nearly stumble over a pile of old papyrus scrolls. The floor is covered in gold tokens and on the wall across the room you see a khopesh sword.",
choices: [
{ text: "Take the treasure.", next: "cursed_end" },
{ text: "Use the Scroll of Truth to reveal the curse and break it.", requiredItem: "Scroll of Truth", removeItem: "Scroll of Truth", next: "happy_end"},
]
},
treasure: {
text: "You look around and see a sharp looking stone laying on the ground. That is the weapon you needed. You let yourself drop to the ground, roll to the side and grab the stone. You aim at the monsters head and throw the stone with all of your strength. The beast collapses with a scream. You enter the last chamber and nearly stumble over a pile of old papyrus scrolls. The floor is covered",
cursed_end: {
text: " You don't want to wait any longer. It took you long enough to find this place and you defeated the guardian. The treasure is now yours.",
choices: [
{ text: "Try to sneak past the monster.", next: "end_1" },
{ text: "Take the gold.", requiredDEX: 12, next: "new_guard" },
{ text: "Take the papyrus scrolls.", requiredWIS: 12, next: "new_guard" },
{ text: "Take the khopesh sword.", requiredSTR: 12, next: "new_guard" },
]
},
new_guard: {
text: "Your fingertips touch the treasure you've been looking for so long. A smile sreads across your face as suddenly a strange feeling shakes your body. For a brief moment you loose your orientation. You close you eyes, take a deep breath and open them again. The ground seems further away than usual and you're pretty sure that you didn't have claws before. But you know those golden claws. Now you are the guardian of the treasure.",
choices: [
{ text: "Try again.", next: "retry"},
]
},
happy_end: {
text: "You take the Scroll of Truth and start to read the hyroglyphes out loud. Your heart beats faster as a golden glow begins to fill the room. Shimmering symbols appear in the air around you and vanishing in little blue flashes as you continue reading. The moment you reach the end of the text, all the symbols have disappeared and the glow ends. Carefully you pick up the treasure you've been looking for so long. It's easy to find your way out with your good sense of direction. This treasure will change your life for the better.",
choices: [
{ text: "Go further.", next: "treasure_room" },
]
},
retry: {
Expand All @@ -241,7 +262,7 @@ const sceneData: { [key: string]: Scene; } = {
{ text: "Restart", next: "start", reload: true }
]
}
};
},

// Inventory
interface Item {
Expand Down