Skip to content

Commit

Permalink
Twohanded weapons now support having 0 force (#3698)
Browse files Browse the repository at this point in the history
<!-- Write **BELOW** The Headers and **ABOVE** The comments else it may
not be viewable. -->
<!-- You can view Contributing.MD for a detailed description of the pull
request process. -->

## About The Pull Request

setting force wielded or unwielded to 0 would cause it to permanently
keep the other value since it skipped setting that value when
wielded/unwielded

## Why It's Good For The Game

why??

## Changelog

:cl:
code: weapons which can be wielded may now have a force of 0 when
wielded or unwielded
/:cl:

<!-- Both :cl:'s are required for the changelog to work! You can put
your name to the right of the first :cl: if you want to overwrite your
GitHub username as author ingame. -->
<!-- You can use multiple of the same prefix (they're only used for the
icon ingame) and delete the unneeded ones. Despite some of the tags,
changelogs should generally represent how a player might be affected by
the changes rather than a summary of the PR's contents. -->

---------

Signed-off-by: Theos <[email protected]>
  • Loading branch information
SomeguyManperson authored Nov 9, 2024
1 parent e26264c commit f9f3ec5
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions code/datums/components/melee/twohanded.dm
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
dupe_mode = COMPONENT_DUPE_UNIQUE_PASSARGS // Only one of the component can exist on an item
var/wielded = FALSE /// Are we holding the two handed item properly
var/force_multiplier = 0 /// The multiplier applied to force when wielded, does not work with force_wielded, and force_unwielded
var/force_wielded = 0 /// The force of the item when wielded
var/force_unwielded = 0 /// The force of the item when unwielded
var/force_wielded = null /// The force of the item when wielded
var/force_unwielded = null /// The force of the item when unwielded
var/wieldsound = FALSE /// Play sound when wielded
var/unwieldsound = FALSE /// Play sound when unwielded
var/attacksound = FALSE /// Play sound on attack when wielded
Expand All @@ -33,7 +33,7 @@
* * icon_wielded (optional) The icon to be used when wielded
*/
/datum/component/two_handed/Initialize(require_twohands=FALSE, wieldsound=FALSE, unwieldsound=FALSE, attacksound=FALSE, \
force_multiplier=0, force_wielded=0, force_unwielded=0, icon_wielded=FALSE)
force_multiplier=0, force_wielded=null, force_unwielded=null, icon_wielded=FALSE)
if(!isitem(parent))
return COMPONENT_INCOMPATIBLE

Expand Down Expand Up @@ -153,7 +153,7 @@
var/obj/item/parent_item = parent
if(force_multiplier)
parent_item.force *= force_multiplier
else if(force_wielded)
else if(!isnull(force_wielded))
parent_item.force = force_wielded
if(sharpened_increase)
parent_item.force += sharpened_increase
Expand Down Expand Up @@ -200,7 +200,7 @@
parent_item.force -= sharpened_increase
if(force_multiplier)
parent_item.force /= force_multiplier
else if(force_unwielded)
else if(!isnull(force_unwielded))
parent_item.force = force_unwielded

// update the items name to remove the wielded status
Expand Down

0 comments on commit f9f3ec5

Please sign in to comment.