From 28426519e11e72576b1a3339f47c420f9c184e49 Mon Sep 17 00:00:00 2001 From: David Gay Date: Mon, 5 Jul 2021 20:30:15 -0400 Subject: Give characters a location, and replace the Locations view+controller with a Look view+controller --- app/views/look/look.html.erb | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 app/views/look/look.html.erb (limited to 'app/views/look/look.html.erb') diff --git a/app/views/look/look.html.erb b/app/views/look/look.html.erb new file mode 100644 index 0000000..2f1074a --- /dev/null +++ b/app/views/look/look.html.erb @@ -0,0 +1,25 @@ +
+

<%= @location.name %>

+

<%= @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") %> + <%= 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) %>

+

<%= activity.description %>

+ <%= form_with url: start_activity_path(activity) do |f| %> + <%= f.hidden_field :id, value: activity.id %> + <%= f.submit "Start" %> + <% end %> +
+<% end %> -- cgit v1.2.3