diff options
Diffstat (limited to 'src/scalevalapokalypsi/Model/Action.scala')
-rw-r--r-- | src/scalevalapokalypsi/Model/Action.scala | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/src/scalevalapokalypsi/Model/Action.scala b/src/scalevalapokalypsi/Model/Action.scala index 21e1286..75ce68c 100644 --- a/src/scalevalapokalypsi/Model/Action.scala +++ b/src/scalevalapokalypsi/Model/Action.scala @@ -28,16 +28,16 @@ class Action(input: String): def execute(actor: Player): Boolean = val oldLocation = actor.location val resOption: Option[(Boolean, Event)] = this.verb match - case "go" => + case "mene" => val result = actor.go(this.modifiers) result.foreach(r => if actor.location != oldLocation then oldLocation.observeEvent(r) ) result.map((true, _)) - case "rest" => Some((true, actor.rest())) - case "get" => Some((false, actor.pickUp(this.modifiers))) - case "inventory" => Some((false, actor.inventory)) + case "lepää" => Some((true, actor.rest())) + case "poimi" | "ota" => Some((false, actor.pickUp(this.modifiers))) + case "tavaraluettelo" => Some((false, actor.inventory)) case "sano" => val entityNames = actor.location.getEntityNames.map(_.toLowerCase) val recipientNamePair = entityNames.flatMap(name => @@ -91,7 +91,9 @@ class Action(input: String): )).toMap, fromThirdPerson.getOrElse("")) ) ) - case "drop" => Some((false, actor.drop(this.modifiers))) + case "tiputa" | "pudota" => Some((false, actor.drop(this.modifiers))) + case "käytä" => + Some(true -> actor.useItem(this.modifiers)) case "laula" => val end = modifiers.takeRight("suohon".length) val start = @@ -109,8 +111,8 @@ class Action(input: String): else None case "xyzzy" => Some((false, Event( - Map.from(Vector((actor, "The grue tastes yummy."))), - s"${actor.name} tastes some grue.") + Map.from(Vector((actor, "Grue maistuu."))), + s"${actor.name} maistaa.") )) case other => None |