diff options
author | David Gay <david@davidgay.org> | 2021-05-31 17:24:28 -0400 |
---|---|---|
committer | David Gay <david@davidgay.org> | 2021-05-31 17:24:28 -0400 |
commit | 1176500e444109d35e360022a847228d07a08a47 (patch) | |
tree | 51df36ccc9100a876ec03bd879203ea9cefa46a4 /app | |
parent | 7113d69455d9600baa6d26796fb5b0d0ced1c939 (diff) |
Change block so at least one point of damage will always get through
Diffstat (limited to 'app')
-rw-r--r-- | app/controllers/game_controller.rb | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/app/controllers/game_controller.rb b/app/controllers/game_controller.rb index f6bb7b8..d1d8bd6 100644 --- a/app/controllers/game_controller.rb +++ b/app/controllers/game_controller.rb @@ -219,6 +219,7 @@ class GameController < ApplicationController dealt_damage = dealt_damage * 2 end blocked_damage = (accuracy_roll >= (roll(20) + target.block(with_combat_style: true))) ? 0 : target.block_value + blocked_damage = [blocked_damage, (dealt_damage - 1)].min resolved_damage = dealt_damage - blocked_damage actor == char ? mon_hp -= resolved_damage : char_hp -= resolved_damage damage_text = "#{resolved_damage} damage." |