aboutsummaryrefslogtreecommitdiff
path: root/src/scalevalapokalypsi/Model/Action.scala
diff options
context:
space:
mode:
Diffstat (limited to 'src/scalevalapokalypsi/Model/Action.scala')
-rw-r--r--src/scalevalapokalypsi/Model/Action.scala7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/scalevalapokalypsi/Model/Action.scala b/src/scalevalapokalypsi/Model/Action.scala
index cee0ee5..30fbf46 100644
--- a/src/scalevalapokalypsi/Model/Action.scala
+++ b/src/scalevalapokalypsi/Model/Action.scala
@@ -63,7 +63,8 @@ class Action(input: String):
if end == "suohon" then
val targetEntity = actor.location.getEntity(start)
targetEntity
- .foreach(e => actor.setSingEffect(defaultSingAttack(e)))
+ .foreach(e => actor.setSingEffect(DefaultSingAttack(e)))
+ targetEntity.foreach(_.observeString(s"${actor.name} laulaa sinua suohon!"))
targetEntity.map(e => (
"Aloitat suohonlaulun.",
s"${actor.name} aloittaa suohonlaulun."
@@ -78,9 +79,9 @@ class Action(input: String):
resOption.map(_(1)).filter(_.length > 0)
.foreach(s =>
- actor.location.getEntities.filter(_ != actor).foreach(_.observe(s))
+ actor.location.getEntities.filter(_ != actor).foreach(_.observeString(s))
if oldLocation != actor.location then
- oldLocation.getEntities.foreach(_.observe(s))
+ oldLocation.getEntities.foreach(_.observeString(s))
)
resOption.map(_(0))