diff options
Diffstat (limited to 'app/lib')
-rw-r--r-- | app/lib/activity_processor.rb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/app/lib/activity_processor.rb b/app/lib/activity_processor.rb index d8004f6..6d2cd90 100644 --- a/app/lib/activity_processor.rb +++ b/app/lib/activity_processor.rb @@ -62,7 +62,7 @@ class ActivityProcessor end end when "item" - handle_item_result(result) + handle_item_result(result, with_xp: true) when "hearth_amenity" bhi = @character.hearth.built_hearth_amenities .find_or_initialize_by(hearth_amenity: HearthAmenity.find_by_gid(result[:gid])) @@ -161,7 +161,7 @@ class ActivityProcessor @results.push({ type: "xp", skill: skill, xp: amount }) end - def handle_item_result(data) + def handle_item_result(data, with_xp: false) return if rand > (data[:chance] || 1) if data[:table] @@ -175,7 +175,7 @@ class ActivityProcessor score = table_entry[:score] if table_roll >= score - give_item(table_entry, quantity) + give_item(table_entry, quantity, with_xp: with_xp) table_entry[:titles]&.each do |title_data| handle_title_result(title_data) @@ -187,7 +187,7 @@ class ActivityProcessor min_quantity = data[:min_quantity] || data[:quantity] || 1 max_quantity = data[:max_quantity] || data[:quantity] || 1 quantity = rand(min_quantity..max_quantity) - give_item(data, quantity) + give_item(data, quantity, with_xp: with_xp) end end |