Skip to content

Fixes hammer upgrade #8155

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions code/__DEFINES/items.dm
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#define UPGRADE_FORCE_MOD "force_mod"
#define UPGRADE_FUELCOST_MULT "fuelcost_mult"
#define UPGRADE_POWERCOST_MULT "powercost_mult"
#define UPGRADE_QUALITY "add_quality"

#define UPGRADE_BULK "bulk_mod"

Expand Down
7 changes: 7 additions & 0 deletions code/game/objects/items/weapons/tools/mods/_upgrades.dm
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,13 @@
T.use_fuel_cost *= tool_upgrades[UPGRADE_FUELCOST_MULT]
if(tool_upgrades[UPGRADE_POWERCOST_MULT])
T.use_power_cost *= tool_upgrades[UPGRADE_POWERCOST_MULT]
if(tool_upgrades[UPGRADE_QUALITY])
if(T.toggleable)
T.switched_on_qualities |= UPGRADE_QUALITY
if(T.switched_on)
T.tool_qualities |= UPGRADE_QUALITY
else
T.tool_qualities |= UPGRADE_QUALITY
Comment on lines +289 to +295
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we also need to reset switched_on_qualities and tool_qualities to their initial values in /obj/item/tool/refresh_upgrades(). Otherwise it will never be removed even if the mod goes away.

if(tool_upgrades[UPGRADE_BULK])
T.extra_bulk += tool_upgrades[UPGRADE_BULK]
if(tool_upgrades[UPGRADE_HEALTH_THRESHOLD])
Expand Down
4 changes: 3 additions & 1 deletion code/game/objects/items/weapons/tools/mods/mod_types.dm
Original file line number Diff line number Diff line change
Expand Up @@ -590,8 +590,10 @@
I.tool_upgrades = list(
UPGRADE_WORKSPEED = -0.1,
UPGRADE_HEALTH_THRESHOLD = 5,
tool_qualities = list(QUALITY_HAMMERING = 10)
UPGRADE_QUALITY = list(QUALITY_HAMMERING = 10)
)
I.required_qualities = list(QUALITY_SAWING, QUALITY_SHOVELING, QUALITY_WIRE_CUTTING, QUALITY_BOLT_TURNING)
I.negative_qualities = list(QUALITY_WELDING, QUALITY_HAMMERING)
I.prefix = "flattened"

//Vastly reduces tool sounds, for stealthy hacking
Expand Down