a3qz / hag

An ncurses procedurally generated roguelike dungeon crawler
Other
19 stars 18 forks source link

Player miss on zero damage #151

Closed dnabre closed 3 years ago

dnabre commented 3 years ago

Changed the attack miss check to look at the base damage the player will do, damage_dealt(), in addition to the luck check. Actual damage a player would deal normally or on critical is a multiple of this base damage, so this grabs both normal and critical zero damage hits.

So now only hits that do damage hit per #123

There's one commit that adds this, and a second commit that moves the player attack hit/miss and damage calculation out to a separate function. Bit cleaner and attack logic is will only get more complicated as time goes on.

Note this doesn't effect hits by enemies that do zero damage. The attack/damage/miss logic for them is separate (logic/enemy_rulebook/enemy_take_turn). So "The foo hurts you for 0 life." still happen, though they can't crit.

Both player and enemy should be using the same code as much as possible, so figure let this stuff come from that.

If we want enemies to start missing sooner, can add the miss check to them.

JohnathonNow commented 3 years ago

Thanks!