Skip to content

Commit

Permalink
actually fix defibs
Browse files Browse the repository at this point in the history
  • Loading branch information
Erikafox committed Oct 2, 2024
1 parent e78e007 commit 6004245
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 6004245

Please sign in to comment.