From 456cfb0df874ac8cfb217c19c723a3cf738e524f Mon Sep 17 00:00:00 2001 From: David Gay Date: Wed, 14 Jul 2021 17:47:02 -0400 Subject: New spell: Floret Passage (also code that allows location results) --- CHANGELOG.md | 4 ++-- app/lib/activity_processor.rb | 4 ++++ app/views/application/_results.html.erb | 2 ++ data/activities/worldcall.yml | 33 ++++++++++++++++++++++++++++++++- 4 files changed, 40 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d803fd8..782d0d2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,7 @@ All notable changes to this project will be documented in this file. ### Skills - Worldcall has been implemented. - - New spells: Hearth Passage, Project Thought + - New spells: Hearth Passage, Floret Passage, Project Thought ### Leviathans - A location can now only have one living leviathan at a time. @@ -18,7 +18,7 @@ All notable changes to this project will be documented in this file. - Hearths now have locations, like characters do. All existing hearths are now located at Floret. ### Web -- Favicon added (contributed by Matt Garrett) +- Favicon added (contributed by mattagarr) ### Engine - Some improvements/tweaks. diff --git a/app/lib/activity_processor.rb b/app/lib/activity_processor.rb index d14282e..8e5df1b 100644 --- a/app/lib/activity_processor.rb +++ b/app/lib/activity_processor.rb @@ -114,6 +114,10 @@ class ActivityProcessor end end end + when "location" + location = Location.find_by_gid(result[:gid]) + @character.update(location: location) + @results.push({ type: type, location: location }) when "hearth_location" location = @character.hearth&.location || Location.find_by_gid("floret") @character.update(location: location) diff --git a/app/views/application/_results.html.erb b/app/views/application/_results.html.erb index 71d6992..237dc12 100644 --- a/app/views/application/_results.html.erb +++ b/app/views/application/_results.html.erb @@ -12,6 +12,8 @@ <% when "hearth_planting" %>

You planted <%= link_to result[:hearth_planting].item.name, item_path(result[:hearth_planting].item) %> in the loam.

+ <% when "location" %> +

You appear in <%= result[:location].name %>.

<% when "hearth_location" %> <% if current_char.hearth&.location %>

You appear in <%= result[:location].name %>.

diff --git a/data/activities/worldcall.yml b/data/activities/worldcall.yml index bec622f..752ad1f 100644 --- a/data/activities/worldcall.yml +++ b/data/activities/worldcall.yml @@ -31,6 +31,37 @@ worldcall_hearth_passage: - type: "xp" gid: "worldcall" base: 4 +worldcall_floret_passage: + name: "Cast Floret Passage" + description: "Teleport to Floret." + whatnot: + tags: + - "spell" + - "worldcall" + requirements: + - type: "skill" + gid: "worldcall" + level: 3 + cost: + - type: "item" + gid: "wisp_of_the_current" + quantity: 1 + duration: + base: 62 + minimum: 35 + scaling: + - type: "skill" + gid: "worldcall" + scale_value: 0.5 + - type: "stat" + gid: "worldcall_speed" + scale_value: 1 + results: + - type: "location" + gid: "floret" + - type: "xp" + gid: "worldcall" + base: 10 worldcall_project_thought: name: "Cast Project Thought" description: "Open brief, faint rifts to random places at your current location, possibly attracting a balgoloth." @@ -47,7 +78,7 @@ worldcall_project_thought: gid: "gem_dust" quantity: 1 duration: - base: 62 + base: 64 minimum: 35 scaling: - type: "skill" -- cgit v1.2.3