diff options
author | David Gay <david@davidgay.org> | 2021-06-16 19:45:34 -0400 |
---|---|---|
committer | David Gay <david@davidgay.org> | 2021-06-16 19:45:34 -0400 |
commit | 8b9191b20faf7473e42b08f5cbf73783f4353b4a (patch) | |
tree | 61f36978f917ac30f322b05fe82999d27ed467ba /app/lib | |
parent | 361acfad2162e08a962c63c4443641fbbd812089 (diff) |
Stinging Rays spell as the first DoT
Diffstat (limited to 'app/lib')
-rw-r--r-- | app/lib/activity_processor.rb | 11 |
1 files changed, 11 insertions, 0 deletions
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!" }) |