From e37402ff309311a14d7dd666d0d8b29517504017 Mon Sep 17 00:00:00 2001 From: David Gay Date: Sun, 6 Jun 2021 19:06:46 -0400 Subject: Leviathans --- app/views/application/_results.html.erb | 3 +++ app/views/locations/show.html.erb | 10 ++++++++++ 2 files changed, 13 insertions(+) (limited to 'app/views') diff --git a/app/views/application/_results.html.erb b/app/views/application/_results.html.erb index 31fb93e..ec62991 100644 --- a/app/views/application/_results.html.erb +++ b/app/views/application/_results.html.erb @@ -17,6 +17,9 @@ <% when "monster" %>

You encountered a <%= result[:monster].name %>.

<%= result[:monster].description %>

+ <% when "monster_spawn" %> +

You found the <%= result[:monster_spawn].monster.name %>!

+

<%= result[:monster_spawn].monster.description %>

<% when "xp" %>

You gained <%= result[:xp] %> <%= result[:skill].name %> XP.

<% when "title" %> diff --git a/app/views/locations/show.html.erb b/app/views/locations/show.html.erb index ff7b2a8..fcc668a 100644 --- a/app/views/locations/show.html.erb +++ b/app/views/locations/show.html.erb @@ -3,6 +3,16 @@

<%= @location.description %>

+<% @location.monster_spawns.select(&:alive?).each do |ms| %> +

A <%= ms.monster.name %> is ravaging this location! (<%= ms.remaining_hp %> HP)

+ <%# TODO: HACK %> + <% activity = Activity.find_by_gid("beastslay_leviathan_floret_region") %> + <%= form_with url: start_activity_path(activity) do |f| %> + <%= f.hidden_field :id, value: activity.id %> + <%= f.submit "Hunt" %> + <% end %> +<% end %> + <% @location.activities.order(:name).each do |activity| %>

<%= link_to activity.name, activity_path(activity) %>

-- cgit v1.2.3