From 716c0314d8f4cd27f0d5ab10b51baf46ab83c863 Mon Sep 17 00:00:00 2001 From: TalkingCactus Date: Thu, 26 Oct 2023 17:53:48 -0400 Subject: [PATCH 1/2] math is probably wrong but i'm committing this to save it --- code/__DEFINES/misc.dm | 10 ++++++++++ code/game/objects/items.dm | 10 +++++----- modular_coyote/eris/code/dual_wielding.dm | 9 --------- 3 files changed, 15 insertions(+), 14 deletions(-) diff --git a/code/__DEFINES/misc.dm b/code/__DEFINES/misc.dm index c2dbe0c28bf..ac89b635284 100644 --- a/code/__DEFINES/misc.dm +++ b/code/__DEFINES/misc.dm @@ -549,3 +549,13 @@ GLOBAL_LIST_INIT(pda_reskins, list(PDA_SKIN_CLASSIC = 'icons/obj/pda.dmi')) #define SHOES_KNOTTED 2 #define WANTED_FILE "wanted_message.json" + + + +//Maximum weight allowed for dual wielding. +#define DUAL_WIELDING_MAX_WEIGHT_ALLOWED WEIGHT_CLASS_NORMAL + +#define DUAL_WIELDING_FALLBACK_FORCE 0.66 +#define DUAL_WIELDING_AGILE_FORCE 0.75 +#define DUAL_WIELDING_ENCUMBERED_FORCE 0.50 +#define DUAL_WIELDING_SPEED_DIVIDER 3 diff --git a/code/game/objects/items.dm b/code/game/objects/items.dm index 72527ea536c..fdfebd2b833 100644 --- a/code/game/objects/items.dm +++ b/code/game/objects/items.dm @@ -349,12 +349,12 @@ GLOBAL_VAR_INIT(embedpocalypse, FALSE) // if true, all items will be able to emb if(href_list["list_melee"]) var/list/readout = list("MELEE STATISTICS") if(force_unwielded > 0) - readout += "\nONE HANDED [force_unwielded]" - readout += "\nTWO HANDED [force_wielded]" - readout += "\nDUAL WIELD [force_unwielded*dual_wielded_mult]" + readout += "\nONE HANDED [force_unwielded] | (DPS [round(force_unwielded * (10/attack_speed),0.1)])" + readout += "\nTWO HANDED [force_wielded] | (DPS [round(force_wielded * (10/attack_speed),0.1)])" + readout += "\nDUAL WIELD [force_unwielded*dual_wielded_mult] | (DPS [round((force_unwielded*(10/(attack_speed/DUAL_WIELDING_SPEED_DIVIDER)),0.1))])" else - readout += "\nDAMAGE [force]" - readout += "\nDUAL WIELD [force*dual_wielded_mult]" + readout += "\nDAMAGE [force] | (DPS [round(force * (10/attack_speed),0.1)])" + readout += "\nDUAL WIELD [force*dual_wielded_mult] | (DPS [round(force*(10/(attack_speed/DUAL_WIELDING_SPEED_DIVIDER)),0.1)])" readout += "\nTHROW DAMAGE [throwforce]" readout += "\nATTACKS / SECOND [10 / attack_speed]" readout += "\nBLOCK CHANCE [block_chance]" diff --git a/modular_coyote/eris/code/dual_wielding.dm b/modular_coyote/eris/code/dual_wielding.dm index d53341281d6..bdf9cf53385 100644 --- a/modular_coyote/eris/code/dual_wielding.dm +++ b/modular_coyote/eris/code/dual_wielding.dm @@ -2,15 +2,6 @@ //leonzrygin, yell at me //<-- -//Maximum weight allowed for dual wielding. -#define DUAL_WIELDING_MAX_WEIGHT_ALLOWED WEIGHT_CLASS_NORMAL - -#define DUAL_WIELDING_FALLBACK_FORCE 0.66 -#define DUAL_WIELDING_AGILE_FORCE 0.75 -#define DUAL_WIELDING_ENCUMBERED_FORCE 0.50 -#define DUAL_WIELDING_SPEED_DIVIDER 3 - - /obj/item var/is_dual_wielded = FALSE var/sound_dualwield_start = 'sound/weapons/blade_unsheathing.ogg' From 3634666ed4bae731b47061bf532a926f8758a692 Mon Sep 17 00:00:00 2001 From: TalkingCactus Date: Fri, 27 Oct 2023 15:04:25 -0400 Subject: [PATCH 2/2] polish --- code/game/objects/items.dm | 24 ++++++++++++++++++------ modular_coyote/eris/code/wielding.dm | 10 ++-------- 2 files changed, 20 insertions(+), 14 deletions(-) diff --git a/code/game/objects/items.dm b/code/game/objects/items.dm index fdfebd2b833..a96c7bb4a80 100644 --- a/code/game/objects/items.dm +++ b/code/game/objects/items.dm @@ -222,6 +222,13 @@ GLOBAL_VAR_INIT(embedpocalypse, FALSE) // if true, all items will be able to emb if(!special_transform && transform != initial(transform)) special_transform = transform + /// CB Dual Wielding + if(force != 0) + if(w_class < DUAL_WIELDING_MAX_WEIGHT_ALLOWED) + dual_wielded_mult = DUAL_WIELDING_AGILE_FORCE + else if(w_class >= DUAL_WIELDING_MAX_WEIGHT_ALLOWED) + dual_wielded_mult = DUAL_WIELDING_ENCUMBERED_FORCE + /obj/item/Destroy() item_flags &= ~DROPDEL //prevent reqdels if(ismob(loc)) @@ -347,16 +354,21 @@ GLOBAL_VAR_INIT(embedpocalypse, FALSE) // if true, all items will be able to emb . = ..() if(href_list["list_melee"]) + var/InitialF = initial(force) + var/InitialFW = initial(force_wielded) + var/InitialFUW = initial(force_unwielded) + var/InitialAS = initial(attack_speed) + //dual_wield_mult is funky, don't instantiate it var/list/readout = list("MELEE STATISTICS") if(force_unwielded > 0) - readout += "\nONE HANDED [force_unwielded] | (DPS [round(force_unwielded * (10/attack_speed),0.1)])" - readout += "\nTWO HANDED [force_wielded] | (DPS [round(force_wielded * (10/attack_speed),0.1)])" - readout += "\nDUAL WIELD [force_unwielded*dual_wielded_mult] | (DPS [round((force_unwielded*(10/(attack_speed/DUAL_WIELDING_SPEED_DIVIDER)),0.1))])" + readout += "\nONE HANDED [InitialFUW] | (DPS [round(InitialFUW * (10/InitialAS), 0.1)])" + readout += "\nTWO HANDED [InitialFW] | (DPS [round(InitialFW * (10/InitialAS), 0.1)])" + readout += "\nDUAL WIELD [InitialFUW * dual_wielded_mult] | (DPS [round((InitialFUW * dual_wielded_mult) * (10/(InitialAS / DUAL_WIELDING_SPEED_DIVIDER)), 0.1)])" else - readout += "\nDAMAGE [force] | (DPS [round(force * (10/attack_speed),0.1)])" - readout += "\nDUAL WIELD [force*dual_wielded_mult] | (DPS [round(force*(10/(attack_speed/DUAL_WIELDING_SPEED_DIVIDER)),0.1)])" + readout += "\nDAMAGE [InitialF] | (DPS [round(InitialF * (10/InitialAS), 0.1)])" + readout += "\nDUAL WIELD [InitialF * dual_wielded_mult] | (DPS [round((InitialF * dual_wielded_mult) * (10/(InitialAS / DUAL_WIELDING_SPEED_DIVIDER)), 0.1)])" readout += "\nTHROW DAMAGE [throwforce]" - readout += "\nATTACKS / SECOND [10 / attack_speed]" + readout += "\nATTACKS / SECOND [round(10 / InitialAS, 0.1)] | DUAL WIELD [round(10/(InitialAS / DUAL_WIELDING_SPEED_DIVIDER), 0.1)]" readout += "\nBLOCK CHANCE [block_chance]" readout += "" diff --git a/modular_coyote/eris/code/wielding.dm b/modular_coyote/eris/code/wielding.dm index eeeedf231d1..682eefd17d7 100644 --- a/modular_coyote/eris/code/wielding.dm +++ b/modular_coyote/eris/code/wielding.dm @@ -16,14 +16,8 @@ return else if(I && J) //Dual wielding starts here, see {dual_wielding.dm} if(I.force != 0 || J.force != 0) //at least one of these two item needs to be dangerous - if( (I.w_class <= DUAL_WIELDING_MAX_WEIGHT_ALLOWED && J.w_class < DUAL_WIELDING_MAX_WEIGHT_ALLOWED) || \ - (I.w_class < DUAL_WIELDING_MAX_WEIGHT_ALLOWED && J.w_class <= DUAL_WIELDING_MAX_WEIGHT_ALLOWED)) - attempt_dual_wield(usr, I, J, DUAL_WIELDING_AGILE_FORCE) //actually initiate dual wielding! - return - if(I.w_class <= DUAL_WIELDING_MAX_WEIGHT_ALLOWED && J.w_class <= DUAL_WIELDING_MAX_WEIGHT_ALLOWED) - attempt_dual_wield(usr, I, J, DUAL_WIELDING_ENCUMBERED_FORCE) //actually initiate dual wielding! but for wielding 2 swords we are doing less damage - return - + attempt_dual_wield(usr, I, J, min(I.dual_wielded_mult, J.dual_wielded_mult)) //actually initiate dual wielding! uses the worst damage multiplier between your two weapons + return I.attempt_wield(src) /obj/item/proc/unwield(mob/living/user)