summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app/controllers/game_controller.rb10
-rw-r--r--app/views/characters/show.html.erb10
2 files changed, 18 insertions, 2 deletions
diff --git a/app/controllers/game_controller.rb b/app/controllers/game_controller.rb
index 4e55924..d69645f 100644
--- a/app/controllers/game_controller.rb
+++ b/app/controllers/game_controller.rb
@@ -13,7 +13,15 @@ class GameController < ApplicationController
result[:table].sort_by { |_, v| -v[:score] }.each do |item_gid, item_data|
quantity = item_data[:quantity] || 1
- if table_roll >= item_data[:score]
+
+ score = item_data[:score]
+ if result[:table_scaling]
+ result[:table_scaling][:skills]&.each do |skill_gid, scale_value|
+ score = score**(1 + (scale_value * current_char.skill_level(skill_gid)))
+ end
+ end
+
+ if table_roll >= score
item = Item.find_by_gid(item_gid)
xp_awards = {}
if item.whatnot && item.whatnot.key?(:xp_value)
diff --git a/app/views/characters/show.html.erb b/app/views/characters/show.html.erb
index 8a3b08b..3ee7088 100644
--- a/app/views/characters/show.html.erb
+++ b/app/views/characters/show.html.erb
@@ -1,4 +1,12 @@
-<h1 class="text-xl">
+<h1 class="text-3xl">
<%= @character.name %>
</h1>
<p>First entered the planes <%= pluralize((Date.current - @character.created_at.to_date).to_i, "day") %> ago.</p>
+
+<h2 class="text-2xl">Skills</h2>
+
+<ul>
+ <% @character.character_skills.ordered_by_skill_name.each do |cs| %>
+ <li><%= cs.skill.name %> Level <%= cs.level %> (<%= cs.xp %> XP)</li>
+ <% end %>
+</ul>