From 8b9191b20faf7473e42b08f5cbf73783f4353b4a Mon Sep 17 00:00:00 2001 From: David Gay Date: Wed, 16 Jun 2021 19:45:34 -0400 Subject: Stinging Rays spell as the first DoT --- app/lib/activity_processor.rb | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'app/lib') diff --git a/app/lib/activity_processor.rb b/app/lib/activity_processor.rb index 18fdece..6509b44 100644 --- a/app/lib/activity_processor.rb +++ b/app/lib/activity_processor.rb @@ -305,6 +305,17 @@ class ActivityProcessor combat_message.call("#{target.name} evaded #{actor.name}'s attack.") end + # HACK: DoT is char-only, and one-damage-type-only for now. + if actor == char + actor.dots.each do |data| + damage_roll = rand(data[:min]..data[:max]) + effective_resistance = [target.resistance(data[:gid]), damage_roll].min + resolved_damage = damage_roll - (effective_resistance * rand(0.5..1)).round + mon_hp -= resolved_damage + combat_message.call("#{data[:message]} (#{resolved_damage} #{data[:gid]})") + end + end + if char_hp < 1 || mon_hp < 1 @character.do_equipment_break_checks.each do |broken_item| @results.push({ type: "warning", message: "Your #{broken_item.name} was damaged beyond repair!" }) -- cgit v1.2.3