diff options
author | Joel Kronqvist <joel.kronqvist@iki.fi> | 2024-11-27 12:29:43 +0200 |
---|---|---|
committer | Joel Kronqvist <joel.kronqvist@iki.fi> | 2024-11-27 12:29:43 +0200 |
commit | 98407b35ff477f372baa92bf582b90a961d4ad16 (patch) | |
tree | bb58925090075d1e9e30dd1593547db2cbe03bb6 /src/scalevalapokalypsi/Model/Entities/NPCs/Bartender.scala | |
parent | 38900e0b291d5e0f59afaaa239cd237f733b6588 (diff) | |
download | scalevalapokalypsi-98407b35ff477f372baa92bf582b90a961d4ad16.tar.gz scalevalapokalypsi-98407b35ff477f372baa92bf582b90a961d4ad16.zip |
Added part of story & improved singing with multiple verses & hemingway distance
Diffstat (limited to 'src/scalevalapokalypsi/Model/Entities/NPCs/Bartender.scala')
-rw-r--r-- | src/scalevalapokalypsi/Model/Entities/NPCs/Bartender.scala | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/src/scalevalapokalypsi/Model/Entities/NPCs/Bartender.scala b/src/scalevalapokalypsi/Model/Entities/NPCs/Bartender.scala new file mode 100644 index 0000000..1743380 --- /dev/null +++ b/src/scalevalapokalypsi/Model/Entities/NPCs/Bartender.scala @@ -0,0 +1,52 @@ +/* +package scalevalapokalypsi.Model.Entities.NPCs + +import scalevalapokalypsi.Model.{Area,Event,Item,Adventure} +import scala.math.min + +class Bartender( + adventure: Adventure, + initialLocation: Area +) extends NPC( + adventure, + "baarimikko", + initialLocation, + 100, + 100 +): + + + private var dialogIndex = 0 + + private val dialogs = Vector( + "Onnea matkaan. Tarjoan sinulle tuopin olutta rohkaisuksi.", + "Onnea matkaan." + ) + + def getDialog: String = + + if dialogIndex == 0 then + this.location.addItem(Item( + "oluttuoppi", + "Tuopillinen kuohuvaa ja raikasta olutta. Se tuoksuu aika vahvalta.", + 1 + )) + this.location.observeEvent( + Event( + Map.empty, + "Baarimikko kaataa tuoppiin olutta ja asettaa oluttuopin pöydälle." + ) + ) + + dialogIndex = min(dialogIndex + 1, this.dialogs.length) + + dialogs(dialogIndex - 1) + + end getDialog + + + def act(): Unit = () + + +end Bartender +*/ |