summaryrefslogtreecommitdiff
path: root/app/controllers/game_controller.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/controllers/game_controller.rb')
-rw-r--r--app/controllers/game_controller.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/app/controllers/game_controller.rb b/app/controllers/game_controller.rb
index 8b92222..bf45973 100644
--- a/app/controllers/game_controller.rb
+++ b/app/controllers/game_controller.rb
@@ -24,6 +24,11 @@ class GameController < ApplicationController
activity.whatnot[:results].each do |result|
type = result[:type]
case type
+ when "xp"
+ skill = Skill.find_by_gid(result[:gid])
+ amount = result[:base]
+ current_char.add_skill_xp(skill, amount)
+ @results.push({ type: "xp", skill: skill, xp: amount })
when "monster"
raise TooManyWoundsError unless current_char.can_fight?
next if rand > (result[:chance] || 1)