Skip to content

Commit

Permalink
Code formatting improvements
Browse files Browse the repository at this point in the history
Co-authored-by: Bloop <[email protected]>
  • Loading branch information
2 people authored and Iajret committed Dec 28, 2023
1 parent 5131b12 commit e4e792b
Showing 1 changed file with 20 additions and 14 deletions.
34 changes: 20 additions & 14 deletions modular_nova/modules/clothing_improvements/code/holsters.dm
Original file line number Diff line number Diff line change
@@ -1,22 +1,28 @@
/obj/item/storage/belt/holster/pre_attack_secondary(atom/target, mob/living/user, params)
. = ..()
if(. == SECONDARY_ATTACK_CANCEL_ATTACK_CHAIN)
return
. = SECONDARY_ATTACK_CANCEL_ATTACK_CHAIN

// Right clicking your holster on a suit-slot piece of clothing will try to fit it for that individual item.
// This will let you wear it in its suit slot. Foley workaround for mass Initialize() issues. Also, it's kinda cool.
if (istype(target, /obj/item/clothing/suit))
var/obj/item/clothing/suit/clothing_to_mod = target
if (!(/obj/item/storage/belt/holster in clothing_to_mod.allowed))
user.visible_message(span_notice("[user] begins adjusting [src] to fit properly upon [clothing_to_mod]..."), span_notice("You begin adjusting [src] to fit properly upon [clothing_to_mod]..."))
if (do_after(user, 1.5 SECONDS))
clothing_to_mod.allowed += list(/obj/item/storage/belt/holster)
playsound(user.loc, 'sound/items/equip/toolbelt_equip.ogg', 50)
balloon_alert(user, "adjusted to fit!")
else
balloon_alert(user, "interrupted!")
else
balloon_alert(user, "already adjusted to fit!")
else
if (!istype(target, /obj/item/clothing/suit))
balloon_alert(user, "can't be adjusted to fit this!")
return

return SECONDARY_ATTACK_CANCEL_ATTACK_CHAIN
var/obj/item/clothing/suit/clothing_to_mod = target
if (/obj/item/storage/belt/holster in clothing_to_mod.allowed)
balloon_alert(user, "already adjusted to fit!")
return

user.visible_message(span_notice("[user] begins adjusting [src] to fit properly upon [clothing_to_mod]..."), span_notice("You begin adjusting [src] to fit properly upon [clothing_to_mod]..."))

if (do_after(user, 1.5 SECONDS))
clothing_to_mod.allowed += list(/obj/item/storage/belt/holster)
playsound(user.loc, 'sound/items/equip/toolbelt_equip.ogg', 50)
balloon_alert(user, "adjusted to fit!")
else
balloon_alert(user, "interrupted!")

/obj/item/storage/belt/holster/examine(mob/user)
. = ..()
Expand Down

0 comments on commit e4e792b

Please sign in to comment.