From 01ec6e3f93fd2333d646a8928965ee31292b5c0b Mon Sep 17 00:00:00 2001 From: zzzmike <85382350+zzzmike@users.noreply.github.com> Date: Wed, 6 Dec 2023 03:35:23 -0800 Subject: [PATCH] Fixes disarm chance calculation (#5111) # About the pull request I was testing stuff out for a different PR and thought the disarm chance (for human vs human) seemed weird at times, so I forced it to output attacker_skill_level and defender_skill_level to chat every time a disarm was done. And then found out it's not calculating it properly. This seems to fix it in limited testing but might need more testing. I'm kinda surprised it wasn't noticed earlier cause there's two signs it's wrong in certain situations even with skill_level variables being invisible: the "tackled" message should only appear when the attacker's CQC level is two or higher (otherwise it should say pushed/shoved), and also, anyone that has a CQC advantage is still disarm-stunning everyone for the same amount of time as anyone else on average ('on average' because there was apparently some variance with a tick offset bug before the TG status effect testmerge) - the code implies it should be longer. # Explain why it's good for the game Bugs should be fixed. From a balance perspective I don't know if it 'should' be fixed from what it is currently in it's bugged state... but regardless, it's a bug. # Testing Photographs and Procedure
Screenshots & Videos Put screenshots and videos here with an empty line between the screenshots and the `
` tags.
# Changelog :cl: fix: disarm chance wasn't calculating properly /:cl: --------- Co-authored-by: Drathek <76988376+Drulikar@users.noreply.github.com> --- code/modules/mob/living/carbon/human/human_attackhand.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/modules/mob/living/carbon/human/human_attackhand.dm b/code/modules/mob/living/carbon/human/human_attackhand.dm index 2bb113d67739..354d9c759f23 100644 --- a/code/modules/mob/living/carbon/human/human_attackhand.dm +++ b/code/modules/mob/living/carbon/human/human_attackhand.dm @@ -155,7 +155,7 @@ return held_weapon.afterattack(target,src) var/disarm_chance = rand(1, 100) - var/attacker_skill_level = skills && attacking_mob.skills ? skills.get_skill_level(SKILL_CQC) : SKILL_CQC_MAX // No skills, so assume max + var/attacker_skill_level = attacking_mob.skills ? attacking_mob.skills.get_skill_level(SKILL_CQC) : SKILL_CQC_MAX // No skills, so assume max var/defender_skill_level = skills ? skills.get_skill_level(SKILL_CQC) : SKILL_CQC_MAX // No skills, so assume max disarm_chance -= 5 * attacker_skill_level disarm_chance += 5 * defender_skill_level