Skip to content

Commit

Permalink
actually fix defibs (#3471)
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

<!-- Describe The Pull Request. Please be sure every change is
documented or this can delay review and even discourage maintainers from
merging your PR! -->
as title

resolves #3469 
## Why It's Good For The Game
functional!!
<!-- Please add a short description of why you think these changes would
benefit the game. If you can't justify it in words, it might not be
worth adding. -->

## Changelog

:cl:
fix: defibs now work again. 
/: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. -->
  • Loading branch information
Erikafox authored Oct 2, 2024
1 parent e78e007 commit 814fca5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
7 changes: 3 additions & 4 deletions code/game/objects/items/defib.dm
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,6 @@
var/obj/item/defibrillator/defib
var/req_defib = TRUE
var/combat = FALSE //If it penetrates armor and gives additional functionality
var/wielded = FALSE // track wielded status on item

/obj/item/shockpaddles/ComponentInitialize()
. = ..()
Expand Down Expand Up @@ -367,10 +366,10 @@
update_appearance()

/obj/item/shockpaddles/update_icon_state()
icon_state = "[base_icon_state][wielded]"
icon_state = "[base_icon_state][HAS_TRAIT(src, TRAIT_WIELDED)]"
item_state = icon_state
if(cooldown)
icon_state = "[base_icon_state][wielded]_cooldown"
icon_state = "[base_icon_state][HAS_TRAIT(src, TRAIT_WIELDED)]_cooldown"
return ..()

/obj/item/shockpaddles/dropped(mob/user)
Expand All @@ -397,7 +396,7 @@
user.visible_message("<span class='notice'>[defib] beeps: Unit is unpowered.</span>")
playsound(src, 'sound/machines/defib_failed.ogg', 50, FALSE)
return
if(!wielded)
if(!HAS_TRAIT(src, TRAIT_WIELDED))
if(iscyborg(user))
to_chat(user, "<span class='warning'>You must activate the paddles in your active module before you can use them on someone!</span>")
else
Expand Down
2 changes: 1 addition & 1 deletion code/modules/surgery/revival.dm
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
. = TRUE
if(istype(tool, /obj/item/shockpaddles))
var/obj/item/shockpaddles/S = tool
if((S.req_defib && !S.defib.powered) || !S.wielded || S.cooldown || S.busy)
if((S.req_defib && !S.defib.powered) || !HAS_TRAIT(S, TRAIT_WIELDED) || S.cooldown || S.busy)
to_chat(user, "<span class='warning'>You need to wield both paddles, and [S.defib] must be powered!</span>")
return FALSE
if(istype(tool, /obj/item/melee/baton))
Expand Down

0 comments on commit 814fca5

Please sign in to comment.