From a2ae664fcb0f23a95ab1b1aaafe014587c963f82 Mon Sep 17 00:00:00 2001 From: He4eT Date: Tue, 10 Dec 2024 12:17:12 +0100 Subject: [PATCH] Add potion --- characters/dude.t | 12 ++++++++++++ index.t | 2 ++ items/potion.t | 9 +++++++++ topics/magic.t | 1 + 4 files changed, 24 insertions(+) create mode 100644 items/potion.t create mode 100644 topics/magic.t diff --git a/characters/dude.t b/characters/dude.t index b46e464..cf5d218 100644 --- a/characters/dude.t +++ b/characters/dude.t @@ -55,3 +55,15 @@ dude: Person + AskTopic [tGames] "I will later show you one of my games, dude!" ; + ++ AskTopic [tPotion] + topicResponse() { + if (potion.location == dude) { + potion.moveInto(me); + "Sure, dude! Take it.\n + Now you have a potion in your inventory."; + } else { + "I only had one potion. There's no more, man."; + } + } +; diff --git a/index.t b/index.t index f7de37a..dc94f0a 100644 --- a/index.t +++ b/index.t @@ -34,8 +34,10 @@ gameMain: GameMainDef #include "items/table.t" #include "items/oldDoor.t" #include "items/brokenDoor.t" +#include "items/potion.t" #include "characters/pc.t" #include "characters/dude.t" #include "topics/gamedev.t" +#include "topics/magic.t" diff --git a/items/potion.t b/items/potion.t new file mode 100644 index 0000000..3fde87e --- /dev/null +++ b/items/potion.t @@ -0,0 +1,9 @@ +potion: Thing + 'potion' + 'potion' + "A small glass bottle filled with a glowing green potion.\n + The liquid shimmers with an emerald hue and emits a faint, herbal scent. + It's sealed with a cork and looks both intriguing and powerful, + hinting at magical properties within. " + location = dude +; diff --git a/topics/magic.t b/topics/magic.t new file mode 100644 index 0000000..21d73e6 --- /dev/null +++ b/topics/magic.t @@ -0,0 +1 @@ +tPotion: Topic 'potion/heal/cure';