From b1c09f6e73f5562bb8f40a35c9c9771cdbae816c Mon Sep 17 00:00:00 2001 From: Adam Higerd Date: Sat, 7 Feb 2026 18:51:52 -0600 Subject: [PATCH] make gouge more like an attack roll --- src/act.offensive.cpp | 30 ++++++++++++++++++++++++++---- src/fight.hpp | 5 ++++- 2 files changed, 30 insertions(+), 5 deletions(-) diff --git a/src/act.offensive.cpp b/src/act.offensive.cpp index 5285a418..8b336355 100644 --- a/src/act.offensive.cpp +++ b/src/act.offensive.cpp @@ -1410,14 +1410,36 @@ ACMD(do_eye_gouge) { if (CONFUSED(ch)) vict = random_attack_target(ch, vict, true); - percent = random_number(1, 101); - prob = GET_SKILL(ch, SKILL_EYE_GOUGE); + int thac0_01 = 25; + int thac0_00 = classes[(int)GET_CLASS(ch)].thac0; + int thac0 = (calc_thac0(GET_LEVEL(ch), thac0_01, thac0_00) * 10); + thac0 -= stat_bonus[GET_DEX(ch)].tohit * 10; + thac0 -= GET_HITROLL(ch); + thac0 -= GET_SKILL(ch, SKILL_EYE_GOUGE) / 2; + thac0 -= stat_bonus[GET_DEX(ch)].rogue_skills; + + int diceroll = random_number(1, 200); + + int victim_ac = GET_AC(vict) + stat_bonus[GET_DEX(vict)].defense * 10; + victim_ac = std::min(100, victim_ac); + + bool success; + if (diceroll > 190 || !AWAKE(vict)) + success = true; + else if (diceroll < 11) + success = false; + else + success = thac0 - diceroll <= victim_ac; + + success = success && !parry(ch, vict); + success = success && !dodge(ch, vict); + WAIT_STATE(ch, (PULSE_VIOLENCE * 3) / 2); if (displaced(ch, vict)) return; - if (percent > prob && AWAKE(vict)) + if (!success) { damage(ch, vict, 0, SKILL_EYE_GOUGE); /* Miss message */ - else if (damage_evasion(vict, ch, 0, DAM_PIERCE)) { + } else if (damage_evasion(vict, ch, 0, DAM_PIERCE)) { act(EVASIONCLR "Your thumbs poke harmlessly at $N" EVASIONCLR ". If $E even has eyes.&0", false, ch, 0, vict, TO_CHAR); act(EVASIONCLR "$n" EVASIONCLR " tries poking at $N's eyes, but nothing seems to happen.&0", false, ch, 0, vict, diff --git a/src/fight.hpp b/src/fight.hpp index 54375a1f..1289b7d4 100644 --- a/src/fight.hpp +++ b/src/fight.hpp @@ -49,6 +49,9 @@ void die(CharData *ch, CharData *killer); bool skill_message(int dam, CharData *ch, CharData *vict, int attacktype, bool death); int damage(CharData *ch, CharData *victim, int dam, int attacktype); void hit(CharData *ch, CharData *victim, int type); +bool dodge(CharData *ch, CharData *victim); +bool parry(CharData *ch, CharData *victim); +bool riposte(CharData *ch, CharData *victim); void perform_violence(void); void pickup_dropped_weapon(CharData *ch); int blessed_blow(CharData *ch, ObjData *weapon); @@ -61,4 +64,4 @@ bool displaced(CharData *ch, CharData *victim); /* Structures */ extern CharData *combat_list; -extern CharData *next_combat_list; \ No newline at end of file +extern CharData *next_combat_list;