Skip to content

Commit

Permalink
polish
Browse files Browse the repository at this point in the history
  • Loading branch information
TalkingCactus committed Oct 27, 2023
1 parent 716c031 commit 3634666
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 14 deletions.
24 changes: 18 additions & 6 deletions code/game/objects/items.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down Expand Up @@ -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("<span class='notice'><u><b>MELEE STATISTICS</u></b>")
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 += "</span>"

Expand Down
10 changes: 2 additions & 8 deletions modular_coyote/eris/code/wielding.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 3634666

Please sign in to comment.