From 1176500e444109d35e360022a847228d07a08a47 Mon Sep 17 00:00:00 2001 From: David Gay Date: Mon, 31 May 2021 17:24:28 -0400 Subject: Change block so at least one point of damage will always get through --- CHANGELOG.md | 2 ++ app/controllers/game_controller.rb | 1 + 2 files changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index b7dc048..a77b61b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -28,10 +28,12 @@ All notable changes to this project will be documented in this file. ### Changed - Beastslay activity names now start with "Slay in" instead of "Hunt". +- A successful block can no longer reduce resolved damage to 0. A successful hit will always do at least 1 damage. ### Fixed - Distill manadross tincture recipe awarded mending salve instead of manadross tincture. - Equip requirements were ignored. +- Characters could heal by blocking with a high enough block value ## [0.1.3.1] - 2021-05-31 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." -- cgit v1.2.3