diff --git a/code/__DEFINES/dye_keys.dm b/code/__DEFINES/dye_keys.dm index f785ccee09f9a..aba886e487b0a 100644 --- a/code/__DEFINES/dye_keys.dm +++ b/code/__DEFINES/dye_keys.dm @@ -13,6 +13,7 @@ #define DYE_REGISTRY_SYNDICATE_HELMET "syndicate_helmet" #define DYE_REGISTRY_VOID_SUIT "void_suit" #define DYE_REGISTRY_VOID_HELMET "void_helmet" +#define DYE_REGISTRY_HEADSCARF "headscarf" #define DYE_RED "red" #define DYE_ORANGE "orange" diff --git a/code/_globalvars/lists/dye_registry.dm b/code/_globalvars/lists/dye_registry.dm index 6112ae20e86ab..3b16237d0c8fe 100644 --- a/code/_globalvars/lists/dye_registry.dm +++ b/code/_globalvars/lists/dye_registry.dm @@ -99,8 +99,21 @@ GLOBAL_LIST_INIT(dye_registry, list( DYE_ORANGE = /obj/item/clothing/head/beanie/orange, DYE_CMO = /obj/item/clothing/head/beanie/cyan, DYE_BLUE = /obj/item/clothing/head/beanie/cyan, - - + ), + DYE_REGISTRY_HEADSCARF = list( + DYE_BLACK = /obj/item/clothing/head/headscarf/black, + DYE_WHITE = /obj/item/clothing/head/headscarf, + DYE_RED = /obj/item/clothing/head/headscarf/red, + DYE_GREEN = /obj/item/clothing/head/headscarf/green, + DYE_CAPTAIN = /obj/item/clothing/head/headscarf/darkblue, + DYE_NTREP = /obj/item/clothing/head/headscarf/darkblue, + DYE_PURPLE = /obj/item/clothing/head/headscarf/purple, + DYE_RD = /obj/item/clothing/head/headscarf/purple, + DYE_YELLOW = /obj/item/clothing/head/headscarf/yellow, + DYE_CE = /obj/item/clothing/head/headscarf/orange, + DYE_ORANGE = /obj/item/clothing/head/headscarf/orange, + DYE_CMO = /obj/item/clothing/head/headscarf/cyan, + DYE_BLUE = /obj/item/clothing/head/headscarf/cyan, ), DYE_REGISTRY_SHOES = list( DYE_RED = /obj/item/clothing/shoes/red, diff --git a/code/game/machinery/vendors/generic_vendors.dm b/code/game/machinery/vendors/generic_vendors.dm index 6fab8e16d1d58..61f6014df1931 100644 --- a/code/game/machinery/vendors/generic_vendors.dm +++ b/code/game/machinery/vendors/generic_vendors.dm @@ -194,6 +194,7 @@ /obj/item/clothing/head/soft/solgov = 10, /obj/item/clothing/head/beret = 10, /obj/item/clothing/head/beret/black = 10, + /obj/item/clothing/head/headscarf = 10, /obj/item/clothing/head/hairflower = 10, /obj/item/clothing/head/mailman = 1, /obj/item/clothing/head/soft/rainbow = 1) @@ -211,6 +212,7 @@ /obj/item/clothing/head/soft/solgov = 20, /obj/item/clothing/head/beret = 20, /obj/item/clothing/head/beret/black = 20, + /obj/item/clothing/head/headscarf = 20, /obj/item/clothing/head/hairflower = 20, /obj/item/clothing/head/mailman = 60, /obj/item/clothing/head/soft/rainbow = 40, diff --git a/code/game/objects/items/cigs.dm b/code/game/objects/items/cigs.dm index b10f68288c3c6..53198f7121dfe 100644 --- a/code/game/objects/items/cigs.dm +++ b/code/game/objects/items/cigs.dm @@ -27,7 +27,6 @@ LIGHTERS ARE IN LIGHTERS.DM body_parts_covered = null attack_verb = null container_type = INJECTABLE - new_attack_chain = TRUE /// Is the cigarette lit? var/lit = FALSE /// Do we require special items to be lit? @@ -642,7 +641,6 @@ LIGHTERS ARE IN LIGHTERS.DM icon_state = "holo_cigar" lefthand_file = 'icons/mob/inhands/smoking_lefthand.dmi' righthand_file = 'icons/mob/inhands/smoking_righthand.dmi' - new_attack_chain = TRUE sprite_sheets = list( "Vox" = 'icons/mob/clothing/species/vox/mask.dmi', "Unathi" = 'icons/mob/clothing/species/unathi/mask.dmi', diff --git a/code/game/objects/items/devices/whistle.dm b/code/game/objects/items/devices/whistle.dm index 8a11cf3aaf093..c88f79c44ca9c 100644 --- a/code/game/objects/items/devices/whistle.dm +++ b/code/game/objects/items/devices/whistle.dm @@ -50,9 +50,13 @@ "Grey" = 'icons/mob/clothing/species/grey/mask.dmi' ) -/obj/item/clothing/mask/whistle/attack_self__legacy__attackchain(mob/user) +/obj/item/clothing/mask/whistle/activate_self(mob/user) + if(..()) + return ITEM_INTERACT_COMPLETE + if(!COOLDOWN_FINISHED(src, whistle_cooldown)) - return + return ITEM_INTERACT_COMPLETE playsound(src, pick('sound/items/whistle1.ogg', 'sound/items/whistle2.ogg', 'sound/items/whistle3.ogg'), 25) COOLDOWN_START(src, whistle_cooldown, 4 SECONDS) + return ITEM_INTERACT_COMPLETE diff --git a/code/game/objects/items/dyeing.dm b/code/game/objects/items/dyeing.dm index ee3c840bedb66..101e4d0f8e2d6 100644 --- a/code/game/objects/items/dyeing.dm +++ b/code/game/objects/items/dyeing.dm @@ -58,3 +58,10 @@ if(.) var/obj/item/target_type = . color = initial(target_type.color) + +/obj/item/clothing/head/headscarf/dye_item(dye_color, dye_key_override) + . = ..() + if(.) + var/obj/item/target_type = . + color = initial(target_type.color) + worn_icon_state = worn_as + "_dyeable" diff --git a/code/game/objects/items/weapons/twohanded.dm b/code/game/objects/items/weapons/twohanded.dm index 260ce384222ed..1a6cfcc845137 100644 --- a/code/game/objects/items/weapons/twohanded.dm +++ b/code/game/objects/items/weapons/twohanded.dm @@ -733,20 +733,26 @@ do_sparks(rand(1,6), 1, loc) next_spark_time = world.time + 0.8 SECONDS -/obj/item/clothing/gloves/color/black/pyro_claws/attackby__legacy__attackchain(obj/item/I, mob/user, params) - if(istype(I, /obj/item/assembly/signaler/anomaly/pyro)) - if(core) - to_chat(user, SPAN_NOTICE("[src] already has a [I]!")) - return - if(!user.drop_item()) - to_chat(user, SPAN_WARNING("[I] is stuck to your hand!")) - return - to_chat(user, SPAN_NOTICE("You insert [I] into [src], and [src] starts to warm up.")) - I.forceMove(src) - core = I - else +/obj/item/clothing/gloves/color/black/pyro_claws/wirecutter_act(mob/living/user, obj/item/I) + return + +/obj/item/clothing/gloves/color/black/pyro_claws/item_interaction(mob/living/user, obj/item/used, list/modifiers) + if(!istype(used, /obj/item/assembly/signaler/anomaly/pyro)) return ..() + if(core) + to_chat(user, SPAN_NOTICE("[src] already has a [used]!")) + return ITEM_INTERACT_COMPLETE + + if(!user.drop_item()) + to_chat(user, SPAN_WARNING("[used] is stuck to your hand!")) + return ITEM_INTERACT_COMPLETE + + to_chat(user, SPAN_NOTICE("You insert [used] into [src], and [src] starts to warm up.")) + used.forceMove(src) + core = used + return ITEM_INTERACT_COMPLETE + /obj/item/clothing/gloves/color/black/pyro_claws/proc/reboot() on_cooldown = FALSE set_nodrop(FALSE, loc) diff --git a/code/modules/assembly/shock_kit.dm b/code/modules/assembly/shock_kit.dm index 835baa56bff41..5e1567b8f9577 100644 --- a/code/modules/assembly/shock_kit.dm +++ b/code/modules/assembly/shock_kit.dm @@ -35,7 +35,7 @@ return TRUE /obj/item/assembly/shock_kit/attack_self__legacy__attackchain(mob/user as mob) - part1.attack_self__legacy__attackchain(user, status) + part1.activate_self(user) part2.attack_self__legacy__attackchain(user, status) add_fingerprint(user) return diff --git a/code/modules/clothing/clothing.dm b/code/modules/clothing/clothing.dm index a6c481ae218c2..0ce7a9c566fa7 100644 --- a/code/modules/clothing/clothing.dm +++ b/code/modules/clothing/clothing.dm @@ -6,6 +6,7 @@ integrity_failure = 80 resistance_flags = FLAMMABLE permeability_coefficient = 0.8 + new_attack_chain = TRUE /// Only these species can wear this kit. var/list/species_restricted /// If set to a sprite path, replaces the sprite for monitor heads @@ -199,7 +200,6 @@ var/over_mask = FALSE //Whether or not the eyewear is rendered above the mask. Purely cosmetic. /// If TRUE, will hide the wearer's examines from other players. var/hide_examine = FALSE - new_attack_chain = TRUE /* * SEE_SELF // can see self, no matter what @@ -262,20 +262,20 @@ /obj/item/clothing/gloves/proc/Touch(atom/A, proximity) return // return TRUE to cancel attack_hand() -/obj/item/clothing/gloves/attackby__legacy__attackchain(obj/item/W, mob/user, params) - if(istype(W, /obj/item/wirecutters)) - if(!clipped) - playsound(src.loc, W.usesound, 100, 1) - user.visible_message(SPAN_WARNING("[user] snips the fingertips off [src]."),SPAN_WARNING("You snip the fingertips off [src].")) - clipped = TRUE - name = "mangled [name]" - desc = "[desc] They have had the fingertips cut off of them." - update_icon() - else - to_chat(user, SPAN_NOTICE("[src] have already been clipped!")) - return - else - return ..() +/obj/item/clothing/gloves/wirecutter_act(mob/living/user, obj/item/I) + if(clipped) + to_chat(user, SPAN_NOTICE("[src] have already been clipped!")) + return TRUE + + playsound(src.loc, I.usesound, 100, 1) + user.visible_message( + SPAN_WARNING("[user] snips the fingertips off [src]."), + SPAN_WARNING("You snip the fingertips off [src].") + ) + clipped = TRUE + name = "mangled [name]" + desc = "[desc] They have had the fingertips cut off of them." + update_icon() ////////////////////////////// // MARK: SUIT SENSORS @@ -534,13 +534,16 @@ return FALSE -/obj/item/clothing/head/attackby__legacy__attackchain(obj/item/I, mob/user, params) - if(istype(I, /obj/item/clothing/head) && can_have_hats) - attach_hat(I, user, TRUE) - else if(istype(I, /obj/item/clothing/mask) && can_have_mask) - var/obj/item/clothing/mask/M = I +/obj/item/clothing/head/item_interaction(mob/living/user, obj/item/used, list/modifiers) + if(istype(used, /obj/item/clothing/head) && can_have_hats) + attach_hat(used, user, TRUE) + return ITEM_INTERACT_COMPLETE + + if(istype(used, /obj/item/clothing/mask) && can_have_mask) + var/obj/item/clothing/mask/M = used if(M.can_attach_to_hat) attach_mask(M, user, TRUE) + return ITEM_INTERACT_COMPLETE return ..() @@ -731,52 +734,73 @@ if(H.get_item_by_slot(ITEM_SLOT_SHOES) == src) REMOVE_TRAIT(H, TRAIT_NOSLIP, UID()) -/obj/item/clothing/shoes/attackby__legacy__attackchain(obj/item/I, mob/living/user, params) - if(istype(I, /obj/item/match) && src.loc == user) - var/obj/item/match/M = I +/obj/item/clothing/shoes/wirecutter_act(mob/living/user, obj/item/I) + if(cut_open) + to_chat(user, SPAN_WARNING("[src] have already had [p_their()] toes cut open!")) + return TRUE + + if(can_cut_open) + playsound(src.loc, I.usesound, 100, 1) + user.visible_message( + SPAN_WARNING("[user] cuts open the toes of [src]."), + SPAN_WARNING("You cut open the toes of [src].") + ) + cut_open = TRUE + update_appearance(UPDATE_NAME|UPDATE_DESC|UPDATE_ICON_STATE) + return TRUE + +/obj/item/clothing/shoes/item_interaction(mob/living/user, obj/item/used, list/modifiers) + if(istype(used, /obj/item/match) && src.loc == user) + var/obj/item/match/M = used if(!M.lit && !M.burnt) // Match isn't lit, but isn't burnt. - user.visible_message(SPAN_WARNING("[user] strikes a [M] on the bottom of [src], lighting it."),SPAN_WARNING("You strike [M] on the bottom of [src] to light it.")) + user.visible_message( + SPAN_NOTICE("[user] strikes a [M] on the bottom of [src], lighting it."), + SPAN_NOTICE("You strike [M] on the bottom of [src] to light it."), + SPAN_NOTICE("You hear a match being lit.") + ) M.matchignite() playsound(user.loc, 'sound/goonstation/misc/matchstick_light.ogg', 50, 1) - return + return ITEM_INTERACT_COMPLETE + if(M.lit && !M.burnt && M.w_class <= WEIGHT_CLASS_SMALL) - user.visible_message(SPAN_WARNING("[user] crushes [M] into the bottom of [src], extinguishing it."),SPAN_WARNING("You crush [M] into the bottom of [src], extinguishing it.")) + user.visible_message( + SPAN_NOTICE("[user] crushes [M] into the bottom of [src], extinguishing it."), + SPAN_NOTICE("You crush [M] into the bottom of [src], extinguishing it."), + SPAN_WARNING("You hear a thin wooden snap!") + ) M.dropped() - return + return ITEM_INTERACT_COMPLETE - if(istype(I, /obj/item/wirecutters)) - if(can_cut_open) - if(!cut_open) - playsound(src.loc, I.usesound, 100, 1) - user.visible_message(SPAN_WARNING("[user] cuts open the toes of [src]."),SPAN_WARNING("You cut open the toes of [src].")) - cut_open = TRUE - update_appearance(UPDATE_NAME|UPDATE_DESC|UPDATE_ICON_STATE) - else - to_chat(user, SPAN_NOTICE("[src] have already had [p_their()] toes cut open!")) - return - - if(istype(I, /obj/item/kitchen/knife/combat)) + if(istype(used, /obj/item/kitchen/knife/combat)) if(!knife_slot) - to_chat(user, SPAN_NOTICE("There is no place to put [I] in [src]!")) - return + to_chat(user, SPAN_NOTICE("There is no place to put [used] in [src]!")) + return ITEM_INTERACT_COMPLETE + if(hidden_blade) to_chat(user, SPAN_NOTICE("There is already something in [src]!")) - return - if(!user.drop_item_to_ground(I)) - return + return ITEM_INTERACT_COMPLETE + + if(!user.drop_item_to_ground(used)) + return ITEM_INTERACT_COMPLETE + if(HAS_TRAIT(user, TRAIT_CLUMSY) && prob(45) && user.get_item_by_slot(ITEM_SLOT_SHOES) == src) var/stabbed_foot = pick("l_foot", "r_foot") - user.visible_message(SPAN_NOTICE("[user] tries to place [I] into [src] but stabs their own foot!"), \ - SPAN_WARNING("You go to put [I] into [src], but miss the boot and stab your own foot!")) - user.apply_damage(I.force, BRUTE, stabbed_foot) - user.drop_item(I) - return - user.visible_message(SPAN_NOTICE("[user] places [I] into their [name]!"), \ - SPAN_NOTICE("You place [I] into the side of your [name]!")) - I.forceMove(src) - hidden_blade = I - return + user.visible_message( + SPAN_NOTICE("[user] tries to place [used] into [src] but stabs their own foot!"), + SPAN_WARNING("You go to put [used] into [src], but miss the boot and stab your own foot!") + ) + user.apply_damage(used.force, BRUTE, stabbed_foot) + user.drop_item(used) + return ITEM_INTERACT_COMPLETE + + user.visible_message( + SPAN_NOTICE("[user] places [used] into their [name]!"), + SPAN_NOTICE("You place [used] into the side of your [name]!") + ) + used.forceMove(src) + hidden_blade = used + return ITEM_INTERACT_COMPLETE return ..() @@ -956,10 +980,12 @@ else ..() //This is required in order to ensure that the UI buttons for items that have alternate functions tied to UI buttons still work. -/obj/item/clothing/suit/attackby__legacy__attackchain(obj/item/I, mob/living/user, params) - ..() - if(istype(I, /obj/item/smithed_item/insert)) - SEND_SIGNAL(src, COMSIG_INSERT_ATTACH, I, user) +/obj/item/clothing/suit/item_interaction(mob/living/user, obj/item/used, list/modifiers) + if(istype(used, /obj/item/smithed_item/insert)) + SEND_SIGNAL(src, COMSIG_INSERT_ATTACH, used, user) + return ITEM_INTERACT_COMPLETE + + return ..() /obj/item/clothing/suit/proc/detach_insert(atom/source, mob/user) SIGNAL_HANDLER // COMSIG_CLICK_ALT @@ -1153,16 +1179,16 @@ return FALSE return TRUE -/obj/item/clothing/under/attackby__legacy__attackchain(obj/item/I, mob/user, params) - if(istype(I, /obj/item/clothing/accessory)) - attach_accessory(I, user, TRUE) +/obj/item/clothing/under/item_interaction(mob/living/user, obj/item/used, list/modifiers) + if(istype(used, /obj/item/clothing/accessory)) + attach_accessory(used, user, TRUE) if(length(accessories)) for(var/obj/item/clothing/accessory/A in accessories) - A.attackby__legacy__attackchain(I, user, params) - return TRUE + A.item_interaction(user, used, modifiers) + return ITEM_INTERACT_COMPLETE - . = ..() + return ..() /obj/item/clothing/under/serialize() var/data = ..() diff --git a/code/modules/clothing/gloves/colored_gloves.dm b/code/modules/clothing/gloves/colored_gloves.dm index a8c9b8ea2c9f9..7209bd533782c 100644 --- a/code/modules/clothing/gloves/colored_gloves.dm +++ b/code/modules/clothing/gloves/colored_gloves.dm @@ -56,22 +56,22 @@ /obj/item/clothing/gloves/color/black/thief pickpocket = 1 -/obj/item/clothing/gloves/color/black/attackby__legacy__attackchain(obj/item/W as obj, mob/user as mob, params) - if(istype(W, /obj/item/wirecutters)) - if(can_be_cut && icon_state == initial(icon_state))//only if not dyed - var/confirm = tgui_alert(user, "Do you want to cut off the gloves fingertips? Warning: It might destroy their functionality.", "Cut tips?", list("Yes","No")) - if(get_dist(user, src) > 1) - to_chat(user, "You have moved too far away.") - return - if(confirm == "Yes") - to_chat(user, SPAN_NOTICE("You snip the fingertips off of [src].")) - playsound(user.loc, W.usesound, rand(10,50), 1) - var/obj/item/clothing/gloves/fingerless/F = new/obj/item/clothing/gloves/fingerless(user.loc) - if(pickpocket) - F.pickpocket = FALSE - qdel(src) - return - ..() +/obj/item/clothing/gloves/color/black/wirecutter_act(mob/living/user, obj/item/I) + if(can_be_cut && icon_state == initial(icon_state))//only if not dyed + var/confirm = tgui_alert(user, "Do you want to cut off the gloves fingertips? Warning: It might destroy their functionality.", "Cut tips?", list("Yes","No")) + if(get_dist(user, src) > 1) + to_chat(user, "You have moved too far away.") + return TRUE + if(confirm == "Yes") + to_chat(user, SPAN_NOTICE("You snip the fingertips off of [src].")) + playsound(user.loc, I.usesound, rand(10,50), 1) + var/obj/item/clothing/gloves/fingerless/F = new/obj/item/clothing/gloves/fingerless(user.loc) + if(pickpocket) + F.pickpocket = FALSE + qdel(src) + return TRUE + + return ..() /obj/item/clothing/gloves/color/black/poisoner desc = "A pair of thick black gloves. They're coated with a hydrophobic material that repels liquids." diff --git a/code/modules/clothing/gloves/misc_gloves.dm b/code/modules/clothing/gloves/misc_gloves.dm index 9cf48b0609792..94ef2610d8d5c 100644 --- a/code/modules/clothing/gloves/misc_gloves.dm +++ b/code/modules/clothing/gloves/misc_gloves.dm @@ -171,21 +171,24 @@ if(cell) . += "gloves_cell" -/obj/item/clothing/gloves/color/yellow/stun/attackby__legacy__attackchain(obj/item/W, mob/living/user, params) - if(istype(W, /obj/item/stock_parts/cell)) - if(!cell) - if(!user.drop_item()) - to_chat(user, SPAN_WARNING("[W] is stuck to you!")) - return - W.forceMove(src) - cell = W - to_chat(user, SPAN_NOTICE("You attach [W] to [src].")) - update_icon(UPDATE_OVERLAYS) - else - to_chat(user, SPAN_NOTICE("[src] already has a cell.")) - else +/obj/item/clothing/gloves/color/yellow/stun/item_interaction(mob/living/user, obj/item/used, list/modifiers) + if(!istype(used, /obj/item/stock_parts/cell)) return ..() + if(cell) + to_chat(user, SPAN_WARNING("[src] already has a cell!")) + return ITEM_INTERACT_COMPLETE + + if(!user.drop_item()) + to_chat(user, SPAN_WARNING("[used] is stuck to you!")) + return ITEM_INTERACT_COMPLETE + + used.forceMove(src) + cell = used + to_chat(user, SPAN_NOTICE("You attach [used] to [src].")) + update_icon(UPDATE_OVERLAYS) + return ITEM_INTERACT_COMPLETE + /obj/item/clothing/gloves/color/yellow/stun/wirecutter_act(mob/user, obj/item/I) . = TRUE if(!I.use_tool(src, user, 0, volume = I.tool_volume)) diff --git a/code/modules/clothing/gloves/rings.dm b/code/modules/clothing/gloves/rings.dm index 2b9d9a9d98ba8..9590fe2e00f3e 100644 --- a/code/modules/clothing/gloves/rings.dm +++ b/code/modules/clothing/gloves/rings.dm @@ -24,17 +24,18 @@ if(stud) . += "It is adorned with a single gem." -/obj/item/clothing/gloves/ring/attackby__legacy__attackchain(obj/item/I as obj, mob/user as mob, params) - if(istype(I, /obj/item/stack/sheet/mineral/diamond)) - var/obj/item/stack/sheet/mineral/diamond/D = I - if(stud) - to_chat(usr, SPAN_NOTICE("[src] already has a gem.")) - else - if(D.amount >= 1) - D.use(1) - stud = TRUE - update_icon(UPDATE_ICON_STATE) - to_chat(usr, SPAN_NOTICE("You socket the diamond into [src].")) +/obj/item/clothing/gloves/ring/item_interaction(mob/living/user, obj/item/used, list/modifiers) + if(!istype(used, /obj/item/stack/sheet/mineral/diamond)) + return ..() + + var/obj/item/stack/sheet/mineral/diamond/D = used + if(stud) + to_chat(usr, SPAN_NOTICE("[src] already has a gem.")) + else if(D.use(1)) + stud = TRUE + update_icon(UPDATE_ICON_STATE) + to_chat(usr, SPAN_NOTICE("You socket the diamond into [src].")) + return ITEM_INTERACT_COMPLETE // s'pensive /obj/item/clothing/gloves/ring/silver diff --git a/code/modules/clothing/head/hardhat.dm b/code/modules/clothing/head/hardhat.dm index e736e393e59c9..a814c3bab7d77 100644 --- a/code/modules/clothing/head/hardhat.dm +++ b/code/modules/clothing/head/hardhat.dm @@ -18,8 +18,12 @@ /// Determines used sprites: hardhat[on]_[hat_color] var/hat_color = "yellow" -/obj/item/clothing/head/hardhat/attack_self__legacy__attackchain(mob/living/user) +/obj/item/clothing/head/hardhat/activate_self(mob/user) + if(..()) + return ITEM_INTERACT_COMPLETE + toggle_helmet_light(user) + return ITEM_INTERACT_COMPLETE /obj/item/clothing/head/hardhat/proc/toggle_helmet_light(mob/living/user) on = !on diff --git a/code/modules/clothing/head/headscarf.dm b/code/modules/clothing/head/headscarf.dm new file mode 100644 index 0000000000000..e4d9fa529082e --- /dev/null +++ b/code/modules/clothing/head/headscarf.dm @@ -0,0 +1,85 @@ +/obj/item/clothing/head/headscarf + name = "white headscarf" + desc = "A stylish headscarf that can be worn several ways. You can rewrap it inhand." + icon_state = "headscarf_dyeable" + worn_icon_state = "hijab_dyeable" + var/worn_as = "hijab" + flags = BLOCKHAIR + icon_monitor = 'icons/mob/clothing/species/machine/monitor/hood.dmi' + sprite_sheets = list( + "Drask" = 'icons/mob/clothing/species/drask/head.dmi', + "Grey" = 'icons/mob/clothing/species/grey/head.dmi', + "Kidan" = 'icons/mob/clothing/species/kidan/head.dmi', + "Nian" = 'icons/mob/clothing/species/nian/head.dmi', + "Skrell" = 'icons/mob/clothing/species/skrell/head.dmi', + "Tajaran" = 'icons/mob/clothing/species/tajaran/head.dmi', + "Vox" = 'icons/mob/clothing/species/vox/head.dmi', + "Vulpkanin" = 'icons/mob/clothing/species/vulpkanin/head.dmi' + ) + dyeable = TRUE + dyeing_key = DYE_REGISTRY_HEADSCARF + +/obj/item/clothing/head/headscarf/activate_self(mob/user) + if(..()) + return ITEM_INTERACT_COMPLETE + if(!ishuman(user)) + return + var/list/variant_names = list("hijab", "dastar", "twisted") + var/list/image/variant_icons = list() + for(var/each_name in variant_names) + var/icon_name = each_name == "hijab" ? "[each_name]_dyeable" : "turban_[each_name]_dyeable" + var/image/each_image = image(icon = 'icons/obj/clothing/hats.dmi', icon_state = icon_name) + each_image.color = color + variant_icons[each_name] = each_image + var/mob/living/carbon/human/H = user + var/choice = show_radial_menu(H, src, variant_icons, null, 40, CALLBACK(src, PROC_REF(radial_check), H), TRUE) + if(!choice || !radial_check(H)) + return + + var/picked_type = choice + worn_icon_state = picked_type == "hijab" ? "[picked_type]_dyeable" : "turban_[picked_type]_dyeable" + worn_as = picked_type == "hijab" ? picked_type : "turban_[picked_type]" + if(picked_type == "hijab") + icon_monitor = 'icons/mob/clothing/species/machine/monitor/hood.dmi' + else + icon_monitor = 'icons/mob/clothing/species/machine/monitor/hat.dmi' + update_icon() + + return ITEM_INTERACT_COMPLETE + +/obj/item/clothing/head/headscarf/proc/radial_check(mob/living/carbon/human/user) + if(!src || !user.is_in_hands(src) || user.incapacitated()) + return FALSE + return TRUE + +/obj/item/clothing/head/headscarf/black + name = "black headscarf" + color = "#4A4A4B" //Grey but it looks black + +/obj/item/clothing/head/headscarf/red + name = "red headscarf" + color = "#D91414" //Red + +/obj/item/clothing/head/headscarf/green + name = "green headscarf" + color = "#5C9E54" //Green + +/obj/item/clothing/head/headscarf/darkblue + name = "dark blue headscarf" + color = "#1E85BC" //Blue + +/obj/item/clothing/head/headscarf/purple + name = "purple headscarf" + color = "#9557C5" //purple + +/obj/item/clothing/head/headscarf/yellow + name = "yellow headscarf" + color = "#ffd814" //Yellow + +/obj/item/clothing/head/headscarf/orange + name = "orange headscarf" + color = "#e97901" //orange + +/obj/item/clothing/head/headscarf/cyan + name = "cyan headscarf" + color = "#70dbff" //Cyan (Or close to it) diff --git a/code/modules/clothing/head/helmet.dm b/code/modules/clothing/head/helmet.dm index cd5f3cdb6d9ab..a033cde2da144 100644 --- a/code/modules/clothing/head/helmet.dm +++ b/code/modules/clothing/head/helmet.dm @@ -21,7 +21,10 @@ ) permeability_coefficient = 0.4 -/obj/item/clothing/head/helmet/attack_self__legacy__attackchain(mob/user) +/obj/item/clothing/head/helmet/activate_self(mob/user) + if(..()) + return ITEM_INTERACT_COMPLETE + if(can_toggle && !user.incapacitated()) if(world.time > cooldown + toggle_cooldown) cooldown = world.time @@ -38,6 +41,7 @@ sleep(15) if(toggle_sound) playsound(src.loc, "[toggle_sound]", 100, FALSE, 4) + return ITEM_INTERACT_COMPLETE /obj/item/clothing/head/helmet/visor name = "visor helmet" diff --git a/code/modules/clothing/head/misc_hats.dm b/code/modules/clothing/head/misc_hats.dm index a591d8f1d0fbd..fa71f62713d80 100644 --- a/code/modules/clothing/head/misc_hats.dm +++ b/code/modules/clothing/head/misc_hats.dm @@ -255,8 +255,12 @@ . = ..() AddElement(/datum/element/clothing_adjustment/monitor_headgear, 0, 1) -/obj/item/clothing/head/fedora/attack_self__legacy__attackchain(mob/user) +/obj/item/clothing/head/fedora/activate_self(mob/user) + if(..()) + return ITEM_INTERACT_COMPLETE + tip_fedora(user) + return ITEM_INTERACT_COMPLETE /obj/item/clothing/head/fedora/item_action_slot_check(slot) if(slot == ITEM_SLOT_HEAD) @@ -472,8 +476,12 @@ sprite_sheets = list("Grey" = 'icons/mob/clothing/species/grey/head.dmi') actions_types = list(/datum/action/item_action/caw) -/obj/item/clothing/head/griffin/attack_self__legacy__attackchain() +/obj/item/clothing/head/griffin/activate_self(mob/user) + if(..()) + return ITEM_INTERACT_COMPLETE + caw() + return ITEM_INTERACT_COMPLETE /obj/item/clothing/head/griffin/proc/caw() if(cooldown < world.time - 20) // A cooldown, to stop people being jerks diff --git a/code/modules/clothing/head/misc_special.dm b/code/modules/clothing/head/misc_special.dm index 7fc515345e6a0..1a5ab5f3532cf 100644 --- a/code/modules/clothing/head/misc_special.dm +++ b/code/modules/clothing/head/misc_special.dm @@ -34,8 +34,12 @@ "Grey" = 'icons/mob/clothing/species/grey/helmet.dmi' ) -/obj/item/clothing/head/welding/attack_self__legacy__attackchain(mob/user) +/obj/item/clothing/head/welding/activate_self(mob/user) + if(..()) + return ITEM_INTERACT_COMPLETE + weldingvisortoggle(user) + return ITEM_INTERACT_COMPLETE /obj/item/clothing/head/welding/flamedecal name = "flame decal welding helmet" @@ -82,9 +86,13 @@ if(isturf(location)) location.hotspot_expose(700, 1) -/obj/item/clothing/head/cakehat/attack_self__legacy__attackchain(mob/user) +/obj/item/clothing/head/cakehat/activate_self(mob/user) + if(..()) + return ITEM_INTERACT_COMPLETE + if(status > 1) - return + return ITEM_INTERACT_COMPLETE + onfire = !onfire if(onfire) force = 3 @@ -95,7 +103,7 @@ force = null damtype = BRUTE icon_state = "cake0" - + return ITEM_INTERACT_COMPLETE /* * Soviet Hats @@ -113,13 +121,17 @@ "Vox" = 'icons/mob/clothing/species/vox/head.dmi' ) -/obj/item/clothing/head/ushanka/attack_self__legacy__attackchain(mob/user as mob) +/obj/item/clothing/head/ushanka/activate_self(mob/user) + if(..()) + return ITEM_INTERACT_COMPLETE + if(icon_state == "ushankadown") icon_state = "ushankaup" to_chat(user, "You raise the ear flaps on the ushanka.") else icon_state = "ushankadown" to_chat(user, "You lower the ear flaps on the ushanka.") + return ITEM_INTERACT_COMPLETE /obj/item/clothing/head/sovietsidecap name = "\improper Soviet side cap" diff --git a/code/modules/clothing/head/soft_caps.dm b/code/modules/clothing/head/soft_caps.dm index 79a312fae5b82..7e6925948e59c 100644 --- a/code/modules/clothing/head/soft_caps.dm +++ b/code/modules/clothing/head/soft_caps.dm @@ -27,8 +27,12 @@ /obj/item/clothing/head/soft/update_icon_state() icon_state = "[initial(icon_state)][flipped ? "_flipped" : ""]" -/obj/item/clothing/head/soft/attack_self__legacy__attackchain(mob/user) +/obj/item/clothing/head/soft/activate_self(mob/user) + if(..()) + return ITEM_INTERACT_COMPLETE + flip(user) + return ITEM_INTERACT_COMPLETE /obj/item/clothing/head/soft/proc/flip(mob/user) flipped = !flipped diff --git a/code/modules/clothing/masks/boxing.dm b/code/modules/clothing/masks/boxing.dm index 4a4ecb6b66406..a6ce8602507e1 100644 --- a/code/modules/clothing/masks/boxing.dm +++ b/code/modules/clothing/masks/boxing.dm @@ -16,8 +16,12 @@ "Drask" = 'icons/mob/clothing/species/drask/mask.dmi' ) -/obj/item/clothing/mask/balaclava/attack_self__legacy__attackchain(mob/user) +/obj/item/clothing/mask/balaclava/activate_self(mob/user) + if(..()) + return ITEM_INTERACT_COMPLETE + adjustmask(user) + return ITEM_INTERACT_COMPLETE /obj/item/clothing/mask/luchador name = "luchador mask" diff --git a/code/modules/clothing/masks/breath.dm b/code/modules/clothing/masks/breath.dm index 1f9168c8dcd5d..b19934ab2ba50 100644 --- a/code/modules/clothing/masks/breath.dm +++ b/code/modules/clothing/masks/breath.dm @@ -19,8 +19,12 @@ "Plasmaman" = 'icons/mob/clothing/species/plasmaman/mask.dmi' ) -/obj/item/clothing/mask/breath/attack_self__legacy__attackchain(mob/user) +/obj/item/clothing/mask/breath/activate_self(mob/user) + if(..()) + return ITEM_INTERACT_COMPLETE + adjustmask(user) + return ITEM_INTERACT_COMPLETE /obj/item/clothing/mask/breath/AltClick(mob/user) ..() @@ -48,8 +52,9 @@ desc = "A weirdly-shaped breath mask, this one seems to designed for a vox beak." icon_state = "voxmask2" -/obj/item/clothing/mask/breath/vox/attack_self__legacy__attackchain(mob/user) - return +/obj/item/clothing/mask/breath/vox/activate_self(mob/user) + . = ..() + return ITEM_INTERACT_COMPLETE /obj/item/clothing/mask/breath/vox/AltClick(mob/user) return diff --git a/code/modules/clothing/masks/gasmask.dm b/code/modules/clothing/masks/gasmask.dm index 607d3a6ddef09..cbfe0ee1cc361 100644 --- a/code/modules/clothing/masks/gasmask.dm +++ b/code/modules/clothing/masks/gasmask.dm @@ -46,8 +46,12 @@ "Vulpkanin" = 'icons/mob/clothing/species/vulpkanin/mask.dmi' ) -/obj/item/clothing/mask/gas/welding/attack_self__legacy__attackchain(mob/user) +/obj/item/clothing/mask/gas/welding/activate_self(mob/user) + if(..()) + return ITEM_INTERACT_COMPLETE + weldingvisortoggle(user) + return ITEM_INTERACT_COMPLETE /obj/item/clothing/mask/gas/explorer name = "explorer gas mask" @@ -70,8 +74,12 @@ /obj/item/clothing/mask/gas/explorer/marines name = "military gas mask" -/obj/item/clothing/mask/gas/explorer/attack_self__legacy__attackchain(mob/user) +/obj/item/clothing/mask/gas/explorer/activate_self(mob/user) + if(..()) + return ITEM_INTERACT_COMPLETE + adjustmask(user) + return ITEM_INTERACT_COMPLETE /obj/item/clothing/mask/gas/explorer/adjustmask(user) ..() @@ -125,7 +133,10 @@ resistance_flags = FLAMMABLE dog_fashion = /datum/dog_fashion/head/clown -/obj/item/clothing/mask/gas/clown_hat/attack_self__legacy__attackchain(mob/living/user) +/obj/item/clothing/mask/gas/clown_hat/activate_self(mob/user) + if(..()) + return ITEM_INTERACT_COMPLETE + var/list/mask_type = list("True Form" = /obj/item/clothing/mask/gas/clown_hat, "The Feminist" = /obj/item/clothing/mask/gas/clown_hat/sexy, "The Madman" = /obj/item/clothing/mask/gas/clown_hat/joker, @@ -138,14 +149,16 @@ var/picked_mask = mask_type[mask_choice] if(QDELETED(src) || !picked_mask) - return + return ITEM_INTERACT_COMPLETE + if(user.stat || !in_range(user, src)) - return + return ITEM_INTERACT_COMPLETE + var/obj/item/clothing/mask/gas/clown_hat/new_mask = new picked_mask(get_turf(user)) qdel(src) user.put_in_active_hand(new_mask) to_chat(user, SPAN_NOTICE("Your Clown Mask has now morphed into its new form, all praise the Honk Mother!")) - return TRUE + return ITEM_INTERACT_COMPLETE /obj/item/clothing/mask/gas/clown_hat/sexy name = "sexy-clown wig and mask" @@ -225,8 +238,12 @@ /obj/item/clothing/mask/gas/owl_mask/super_hero flags = BLOCK_GAS_SMOKE_EFFECT | AIRTIGHT | NODROP -/obj/item/clothing/mask/gas/owl_mask/attack_self__legacy__attackchain() +/obj/item/clothing/mask/gas/owl_mask/activate_self(mob/user) + if(..()) + return ITEM_INTERACT_COMPLETE + hoot() + return ITEM_INTERACT_COMPLETE /obj/item/clothing/mask/gas/owl_mask/proc/hoot() if(cooldown < world.time - 35) // A cooldown, to stop people being jerks @@ -346,13 +363,11 @@ else to_chat(user, SPAN_NOTICE("It's broken.")) -/obj/item/clothing/mask/gas/sechailer/attackby__legacy__attackchain(obj/item/W as obj, mob/user as mob, params) - if(istype(W, /obj/item/wirecutters)) - if(aggressiveness != 5) - to_chat(user, SPAN_WARNING("You broke it!")) - aggressiveness = 5 - return - . = ..() +/obj/item/clothing/mask/gas/sechailer/wirecutter_act(mob/living/user, obj/item/I) + if(aggressiveness != 5) + to_chat(user, SPAN_WARNING("You broke it!")) + aggressiveness = 5 + return TRUE /obj/item/clothing/mask/gas/sechailer/screwdriver_act(mob/living/user, obj/item/I) switch(aggressiveness) @@ -376,8 +391,12 @@ to_chat(user, SPAN_WARNING("You adjust the restrictor but nothing happens, probably because its broken.")) return TRUE -/obj/item/clothing/mask/gas/sechailer/attack_self__legacy__attackchain() +/obj/item/clothing/mask/gas/sechailer/activate_self(mob/user) + if(..()) + return ITEM_INTERACT_COMPLETE + halt() + return ITEM_INTERACT_COMPLETE /obj/item/clothing/mask/gas/sechailer/emag_act(mob/user as mob) if(safety) diff --git a/code/modules/clothing/masks/misc_masks.dm b/code/modules/clothing/masks/misc_masks.dm index 0a9edf8764294..26356ac456cf8 100644 --- a/code/modules/clothing/masks/misc_masks.dm +++ b/code/modules/clothing/masks/misc_masks.dm @@ -108,23 +108,26 @@ origin_tech = "materials=1;engineering=1" materials = list(MAT_METAL=500, MAT_GLASS=50) -/obj/item/clothing/mask/muzzle/safety/shock/attackby__legacy__attackchain(obj/item/W, mob/user, params) - if(istype(W, /obj/item/assembly/signaler) || istype(W, /obj/item/assembly/voice)) +/obj/item/clothing/mask/muzzle/safety/shock/item_interaction(mob/living/user, obj/item/used, list/modifiers) + if(istype(used, /obj/item/assembly/signaler) || istype(used, /obj/item/assembly/voice)) if(istype(trigger, /obj/item/assembly/signaler) || istype(trigger, /obj/item/assembly/voice)) to_chat(user, SPAN_NOTICE("Something is already attached to [src].")) - return FALSE + return ITEM_INTERACT_COMPLETE + if(!user.drop_item()) - to_chat(user, SPAN_WARNING("You are unable to insert [W] into [src].")) - return FALSE - trigger = W + to_chat(user, SPAN_WARNING("You are unable to insert [used] into [src].")) + return ITEM_INTERACT_COMPLETE + + trigger = used trigger.forceMove(src) trigger.master = src trigger.holder = src - to_chat(user, SPAN_NOTICE("You attach [W] to [src].")) - return TRUE - else if(istype(W, /obj/item/assembly)) + to_chat(user, SPAN_NOTICE("You attach [used] to [src].")) + return ITEM_INTERACT_COMPLETE + + if(istype(used, /obj/item/assembly)) to_chat(user, SPAN_NOTICE("That won't fit in [src]. Perhaps a signaler or voice analyzer would?")) - return FALSE + return ITEM_INTERACT_COMPLETE return ..() @@ -194,8 +197,12 @@ . = ..() ADD_TRAIT(src, TRAIT_ANTI_VIRAL, "inherent") -/obj/item/clothing/mask/surgical/attack_self__legacy__attackchain(mob/user) +/obj/item/clothing/mask/surgical/activate_self(mob/user) + if(..()) + return ITEM_INTERACT_COMPLETE + adjustmask(user) + return ITEM_INTERACT_COMPLETE /obj/item/clothing/mask/fakemoustache name = "completely real moustache" @@ -214,8 +221,12 @@ "Drask" = 'icons/mob/clothing/species/drask/mask.dmi' ) -/obj/item/clothing/mask/fakemoustache/attack_self__legacy__attackchain(mob/user) +/obj/item/clothing/mask/fakemoustache/activate_self(mob/user) + if(..()) + return ITEM_INTERACT_COMPLETE + pontificate(user) + return ITEM_INTERACT_COMPLETE /obj/item/clothing/mask/fakemoustache/item_action_slot_check(slot) if(slot == ITEM_SLOT_MASK) @@ -356,9 +367,13 @@ ) actions_types = list(/datum/action/item_action/adjust) -/obj/item/clothing/mask/bandana/attack_self__legacy__attackchain(mob/user) +/obj/item/clothing/mask/bandana/activate_self(mob/user) + if(..()) + return ITEM_INTERACT_COMPLETE + if(slot_flags & ITEM_SLOT_MASK || slot_flags & ITEM_SLOT_HEAD) adjustmask(user) + return ITEM_INTERACT_COMPLETE /obj/item/clothing/mask/bandana/examine(mob/user) . = ..() diff --git a/code/modules/clothing/neck/neck.dm b/code/modules/clothing/neck/neck.dm index 0d9dfc66bd171..8aa0f762642e2 100644 --- a/code/modules/clothing/neck/neck.dm +++ b/code/modules/clothing/neck/neck.dm @@ -38,30 +38,37 @@ desc = "An outdated medical apparatus, used to get a rough idea of the condition of the heart and lungs. It also makes you look like you know what you're doing." icon_state = "stethoscope" -/obj/item/clothing/neck/stethoscope/attack__legacy__attackchain(mob/living/carbon/human/M, mob/living/user) - if(!ishuman(M) || !isliving(user)) - return ..(M, user) - - if(user == M) - user.visible_message("[user] places [src] against [user.p_their()] chest and listens attentively.", "You place [src] against your chest...") +/obj/item/clothing/neck/stethoscope/interact_with_atom(atom/target, mob/living/user, list/modifiers) + if(!ishuman(target) || !isliving(user)) + return ..() + + if(user == target) + user.visible_message( + SPAN_NOTICE("[user] places [src] against [user.p_their()] chest and listens attentively."), + SPAN_NOTICE("You place [src] against your chest...") + ) else - user.visible_message("[user] places [src] against [M]'s chest and listens attentively.", "You place [src] against [M]'s chest...") - var/datum/organ/heart/heart_datum = M.get_int_organ_datum(ORGAN_DATUM_HEART) - var/datum/organ/lungs/lung_datum = M.get_int_organ_datum(ORGAN_DATUM_LUNGS) + user.visible_message( + SPAN_NOTICE("[user] places [src] against [target]'s chest and listens attentively."), + SPAN_NOTICE("You place [src] against [target]'s chest...") + ) + var/mob/living/carbon/human/H = target + var/datum/organ/heart/heart_datum = H.get_int_organ_datum(ORGAN_DATUM_HEART) + var/datum/organ/lungs/lung_datum = H.get_int_organ_datum(ORGAN_DATUM_LUNGS) if(!lung_datum || !heart_datum) to_chat(user, SPAN_WARNING("You don't hear anything.")) - return + return ITEM_INTERACT_COMPLETE - var/obj/item/organ/internal/H = heart_datum.linked_organ - var/obj/item/organ/internal/L = lung_datum.linked_organ - if(!M.pulse || (!H || !(L && !HAS_TRAIT(M, TRAIT_NOBREATH)))) + var/obj/item/organ/internal/heart = heart_datum.linked_organ + var/obj/item/organ/internal/lungs = lung_datum.linked_organ + if(!H.pulse || (!heart || !(lungs && !HAS_TRAIT(H, TRAIT_NOBREATH)))) to_chat(user, SPAN_WARNING("You don't hear anything.")) - return + return ITEM_INTERACT_COMPLETE var/color = "notice" - if(H) + if(heart) var/heart_sound - switch(H.damage) + switch(heart.damage) if(0 to 1) heart_sound = "healthy" if(1 to 25) @@ -74,9 +81,9 @@ color = "warning" to_chat(user, "You hear \an [heart_sound] pulse.") - if(L) + if(lungs) var/lung_sound - switch(L.damage) + switch(lungs.damage) if(0 to 1) lung_sound = "healthy respiration" if(1 to 25) @@ -88,6 +95,7 @@ lung_sound = "gurgling" color = "warning" to_chat(user, "You hear [lung_sound].") + return ITEM_INTERACT_COMPLETE /obj/item/clothing/neck/neckerchief name = "white neckerchief" diff --git a/code/modules/clothing/neck/necklace.dm b/code/modules/clothing/neck/necklace.dm index de86c15eb8494..52a071d71b8ed 100644 --- a/code/modules/clothing/neck/necklace.dm +++ b/code/modules/clothing/neck/necklace.dm @@ -26,16 +26,44 @@ return ..() -/obj/item/clothing/neck/necklace/locket/attack_self__legacy__attackchain(mob/user) +/obj/item/clothing/neck/necklace/locket/activate_self(mob/user) + if(..()) + return ITEM_INTERACT_COMPLETE + + operate_locket(user) + return ITEM_INTERACT_COMPLETE + +/obj/item/clothing/neck/necklace/locket/item_interaction(mob/living/user, obj/item/used, list/modifiers) + if(!istype(used, /obj/item/paper) && !istype(used, /obj/item/photo)) + to_chat(user, SPAN_WARNING("Only photographs and papers will fit inside [src]!")) + return ..() + + if(!open) + to_chat(user, SPAN_WARNING("You have to open [src] first.")) + return ITEM_INTERACT_COMPLETE + + if(held) + to_chat(user, SPAN_WARNING("[src] already has something inside it.")) + return ITEM_INTERACT_COMPLETE + + to_chat(user, SPAN_NOTICE("You slip [used] into [src].")) + user.drop_item() + var/obj/item/thing = used + thing.forceMove(src) + held = used + operate_locket(user) + return ITEM_INTERACT_COMPLETE + +/obj/item/clothing/neck/necklace/locket/proc/operate_locket(mob/living/user) if(!base_icon) base_icon = icon_state if(!("[base_icon]_open" in icon_states(icon))) - to_chat(user, "[src] doesn't seem to open.") - return + to_chat(user, SPAN_WARNING("[src] doesn't seem to open.")) + return ITEM_INTERACT_COMPLETE open = !open - to_chat(user, "You flip [src] [open ? "open" : "closed"].") + to_chat(user, SPAN_NOTICE("You flip [src] [open ? "open" : "closed"].")) if(open) icon_state = "[base_icon]_open" if(held) @@ -45,22 +73,6 @@ else icon_state = "[base_icon]" -/obj/item/clothing/neck/necklace/locket/attackby__legacy__attackchain(obj/item/O, mob/user) - if(!open) - to_chat(user, "You have to open it first.") - return - - if(istype(O, /obj/item/paper) || istype(O, /obj/item/photo)) - if(held) - to_chat(usr, "[src] already has something inside it.") - else - to_chat(usr, "You slip [O] into [src].") - user.drop_item() - O.forceMove(src) - held = O - else - return ..() - /obj/item/clothing/neck/necklace/locket/silver name = "silver locket" desc = "A silver locket that seems to have space for a photo within." diff --git a/code/modules/clothing/shoes/colour.dm b/code/modules/clothing/shoes/colour.dm index 1c74acd9dd2ac..30a4ac55be7b6 100644 --- a/code/modules/clothing/shoes/colour.dm +++ b/code/modules/clothing/shoes/colour.dm @@ -77,19 +77,25 @@ QDEL_NULL(shackles) return ..() -/obj/item/clothing/shoes/orange/attack_self__legacy__attackchain(mob/user) +/obj/item/clothing/shoes/orange/activate_self(mob/user) + if(..()) + return ITEM_INTERACT_COMPLETE + if(shackles) user.put_in_hands(shackles) shackles = null slowdown = SHOES_SLOWDOWN icon_state = "orange" - -/obj/item/clothing/shoes/orange/attackby__legacy__attackchain(obj/item/I, mob/user, params) - if(istype(I, /obj/item/restraints/handcuffs) && !shackles) - if(user.drop_item()) - I.forceMove(src) - shackles = I - slowdown = 15 - icon_state = "orange1" - return + return ITEM_INTERACT_COMPLETE + +/obj/item/clothing/shoes/orange/item_interaction(mob/living/user, obj/item/used, list/modifiers) + if(!istype(used, /obj/item/restraints/handcuffs) || shackles) + return ITEM_INTERACT_COMPLETE + + if(user.drop_item()) + used.forceMove(src) + shackles = used + slowdown = 15 + icon_state = "orange1" + return ITEM_INTERACT_COMPLETE return ..() diff --git a/code/modules/clothing/shoes/magboots.dm b/code/modules/clothing/shoes/magboots.dm index 4bc40a8311a89..5b6a1326b5f1c 100644 --- a/code/modules/clothing/shoes/magboots.dm +++ b/code/modules/clothing/shoes/magboots.dm @@ -34,8 +34,12 @@ return check_mag_pulse(user, removing = TRUE) -/obj/item/clothing/shoes/magboots/attack_self__legacy__attackchain(mob/user) +/obj/item/clothing/shoes/magboots/activate_self(mob/user) + if(..()) + return ITEM_INTERACT_COMPLETE + toggle_magpulse(user) + return ITEM_INTERACT_COMPLETE /obj/item/clothing/shoes/magboots/proc/toggle_magpulse(mob/user, no_message) if(magpulse) //magpulse and no_slip will always be the same value unless VV happens @@ -269,31 +273,36 @@ cell = null update_icon() -/obj/item/clothing/shoes/magboots/gravity/attackby__legacy__attackchain(obj/item/I, mob/user, params) - if(istype(I, /obj/item/stock_parts/cell)) +/obj/item/clothing/shoes/magboots/gravity/item_interaction(mob/living/user, obj/item/used, list/modifiers) + if(istype(used, /obj/item/stock_parts/cell)) if(cell) to_chat(user, SPAN_WARNING("[src] already has a cell!")) - return - if(!user.drop_item_to_ground(I)) - return - I.forceMove(src) - cell = I - to_chat(user, SPAN_NOTICE("You install [I] into [src].")) + return ITEM_INTERACT_COMPLETE + + if(!user.drop_item_to_ground(used)) + return ITEM_INTERACT_COMPLETE + + used.forceMove(src) + cell = used + to_chat(user, SPAN_NOTICE("You install [used] into [src].")) update_icon() - return + return ITEM_INTERACT_COMPLETE - if(istype(I, /obj/item/assembly/signaler/anomaly/grav)) + if(istype(used, /obj/item/assembly/signaler/anomaly/grav)) if(core) - to_chat(user, SPAN_NOTICE("[src] already has a [I]!")) - return + to_chat(user, SPAN_NOTICE("[src] already has a [used]!")) + return ITEM_INTERACT_COMPLETE + if(!user.drop_item()) - to_chat(user, SPAN_WARNING("[I] is stuck to your hand!")) - return - to_chat(user, SPAN_NOTICE("You insert [I] into [src], and [src] starts to warm up.")) - I.forceMove(src) - core = I - else - return ..() + to_chat(user, SPAN_WARNING("[used] is stuck to your hand!")) + return ITEM_INTERACT_COMPLETE + + to_chat(user, SPAN_NOTICE("You insert [used] into [src], and [src] starts to warm up.")) + used.forceMove(src) + core = used + return ITEM_INTERACT_COMPLETE + + return ..() /obj/item/clothing/shoes/magboots/gravity/equipped(mob/user, slot) ..() diff --git a/code/modules/clothing/spacesuits/alien_suits.dm b/code/modules/clothing/spacesuits/alien_suits.dm index b97f7d37b56b8..c92dc38fac8ac 100644 --- a/code/modules/clothing/spacesuits/alien_suits.dm +++ b/code/modules/clothing/spacesuits/alien_suits.dm @@ -179,21 +179,23 @@ sprite_sheets = list("Vox" = 'icons/mob/clothing/species/vox/feet.dmi') multiple_icons = FALSE -/obj/item/clothing/shoes/magboots/vox/attack_self__legacy__attackchain(mob/user) +/obj/item/clothing/shoes/magboots/vox/activate_self(mob/user) + if(!ishuman(user)) + return ITEM_INTERACT_COMPLETE + if(magpulse) set_nodrop(FALSE, loc) - to_chat(user, "You relax your deathgrip on the flooring.") + to_chat(user, SPAN_NOTICE("You relax your deathgrip on the flooring.")) else - //make sure these can only be used when equipped. - if(!ishuman(user)) - return + //make sure these can only be turned on when equipped. var/mob/living/carbon/human/H = user if(H.shoes != src) to_chat(user, SPAN_WARNING("You will have to put on [src] before you can do that.")) - return + return ITEM_INTERACT_COMPLETE + set_nodrop(TRUE, loc) //kinda hard to take off magclaws when you are gripping them tightly. - to_chat(user, "You dig your claws deeply into the flooring, bracing yourself.") - to_chat(user, "It would be hard to take off [src] without relaxing your grip first.") + to_chat(user, SPAN_NOTICE("You dig your claws deeply into the flooring, bracing yourself.")) + to_chat(user, SPAN_NOTICE("It would be hard to take off [src] without relaxing your grip first.")) return ..() //In case they somehow come off while enabled. diff --git a/code/modules/clothing/spacesuits/ert_hardsuits.dm b/code/modules/clothing/spacesuits/ert_hardsuits.dm index edafe13e01c27..0f4d2ba820387 100644 --- a/code/modules/clothing/spacesuits/ert_hardsuits.dm +++ b/code/modules/clothing/spacesuits/ert_hardsuits.dm @@ -26,11 +26,15 @@ register_camera(wearer) return ..() -/obj/item/clothing/head/helmet/space/hardsuit/ert/attack_self__legacy__attackchain(mob/user) +/obj/item/clothing/head/helmet/space/hardsuit/ert/activate_self(mob/user) + if(..()) + return ITEM_INTERACT_COMPLETE + if(camera || !has_camera) ..(user) else register_camera(user) + return ITEM_INTERACT_COMPLETE /obj/item/clothing/head/helmet/space/hardsuit/ert/proc/register_camera(mob/wearer) if(camera || !has_camera) diff --git a/code/modules/clothing/spacesuits/hardsuit.dm b/code/modules/clothing/spacesuits/hardsuit.dm index 1935ff5f18219..f183e3e60f76b 100644 --- a/code/modules/clothing/spacesuits/hardsuit.dm +++ b/code/modules/clothing/spacesuits/hardsuit.dm @@ -41,8 +41,12 @@ suit = null return ..() -/obj/item/clothing/head/helmet/space/hardsuit/attack_self__legacy__attackchain(mob/user) +/obj/item/clothing/head/helmet/space/hardsuit/activate_self(mob/user) + if(..()) + return ITEM_INTERACT_COMPLETE + toggle_light(user) + return ITEM_INTERACT_COMPLETE /obj/item/clothing/head/helmet/space/hardsuit/proc/toggle_light(mob/user) on = !on @@ -171,23 +175,27 @@ W.suit = src helmet = W -/obj/item/clothing/suit/space/hardsuit/attack_self__legacy__attackchain(mob/user) +/obj/item/clothing/suit/space/hardsuit/activate_self(mob/user) + if(..()) + return ITEM_INTERACT_COMPLETE + user.changeNext_move(CLICK_CD_MELEE) - ..() + return ITEM_INTERACT_COMPLETE -/obj/item/clothing/suit/space/hardsuit/attackby__legacy__attackchain(obj/item/I, mob/user, params) - if(istype(I, /obj/item/tank/jetpack/suit)) - if(jetpack) - to_chat(user, SPAN_WARNING("[src] already has a jetpack installed.")) - return - if(src == user.get_item_by_slot(ITEM_SLOT_OUTER_SUIT)) //Make sure the player is not wearing the suit before applying the upgrade. - to_chat(user, SPAN_WARNING("You cannot install the upgrade to [src] while wearing it.")) - return - if(user.transfer_item_to(I, src)) - jetpack = I - to_chat(user, SPAN_NOTICE("You successfully install the jetpack into [src].")) - return - return ..() +/obj/item/clothing/suit/space/hardsuit/item_interaction(mob/living/user, obj/item/used, list/modifiers) + if(!istype(used, /obj/item/tank/jetpack/suit)) + return ..() + + if(jetpack) + to_chat(user, SPAN_WARNING("[src] already has a jetpack installed.")) + return ITEM_INTERACT_COMPLETE + if(src == user.get_item_by_slot(ITEM_SLOT_OUTER_SUIT)) //Make sure the player is not wearing the suit before applying the upgrade. + to_chat(user, SPAN_WARNING("You cannot install the upgrade to [src] while wearing it.")) + return ITEM_INTERACT_COMPLETE + if(user.transfer_item_to(used, src)) + jetpack = used + to_chat(user, SPAN_NOTICE("You successfully install the jetpack into [src].")) + return ITEM_INTERACT_COMPLETE /obj/item/clothing/suit/space/hardsuit/screwdriver_act(mob/user, obj/item/I) . = TRUE @@ -256,10 +264,14 @@ linkedsuit = null return ..() -/obj/item/clothing/head/helmet/space/hardsuit/syndi/attack_self__legacy__attackchain(mob/user) //Toggle Helmet +/obj/item/clothing/head/helmet/space/hardsuit/syndi/activate_self(mob/user) + if(..()) + return ITEM_INTERACT_COMPLETE + if(!isturf(user.loc)) to_chat(user, SPAN_WARNING("You cannot toggle your helmet while in this [user.loc]!") ) - return + return ITEM_INTERACT_COMPLETE + on = !on if(on) to_chat(user, SPAN_NOTICE("You switch your hardsuit to EVA mode, sacrificing speed for space protection.")) @@ -287,6 +299,7 @@ var/mob/living/carbon/C = user C.head_update(src, forced = 1) update_action_buttons() + return ITEM_INTERACT_COMPLETE /obj/item/clothing/head/helmet/space/hardsuit/syndi/proc/toggle_hardsuit_mode(mob/user) //Helmet Toggles Suit Mode if(linkedsuit) diff --git a/code/modules/clothing/spacesuits/misc_spacesuits.dm b/code/modules/clothing/spacesuits/misc_spacesuits.dm index c2058eb7bcc2e..ae838a152ab93 100644 --- a/code/modules/clothing/spacesuits/misc_spacesuits.dm +++ b/code/modules/clothing/spacesuits/misc_spacesuits.dm @@ -123,13 +123,17 @@ . = ..() . += SPAN_NOTICE("Use in hand to toggle the hat's beard.") -/obj/item/clothing/head/helmet/space/santahat/attack_self__legacy__attackchain(mob/user) +/obj/item/clothing/head/helmet/space/santahat/activate_self(mob/user) + if(..()) + return ITEM_INTERACT_COMPLETE + if(icon_state == "santahat") icon_state = "santahat_beard" to_chat(user, "Santa's beard expands out from the hat!") else icon_state = "santahat" to_chat(user, "The beard slinks back into the hat...") + return ITEM_INTERACT_COMPLETE /obj/item/clothing/suit/space/santa name = "Santa's suit" diff --git a/code/modules/clothing/spacesuits/plasmamen.dm b/code/modules/clothing/spacesuits/plasmamen.dm index 8e2345be4de7c..d37192a25c7f0 100644 --- a/code/modules/clothing/spacesuits/plasmamen.dm +++ b/code/modules/clothing/spacesuits/plasmamen.dm @@ -64,8 +64,12 @@ else if(on) . += light_icon -/obj/item/clothing/head/helmet/space/plasmaman/attack_self__legacy__attackchain(mob/user) +/obj/item/clothing/head/helmet/space/plasmaman/activate_self(mob/user) + if(..()) + return ITEM_INTERACT_COMPLETE + toggle_light(user) + return ITEM_INTERACT_COMPLETE /obj/item/clothing/head/helmet/space/plasmaman/proc/toggle_light(mob/user, update_light) if(!update_light) diff --git a/code/modules/clothing/suits/armor_suits.dm b/code/modules/clothing/suits/armor_suits.dm index e1aaf0b74ce7d..942c5da7ed232 100644 --- a/code/modules/clothing/suits/armor_suits.dm +++ b/code/modules/clothing/suits/armor_suits.dm @@ -46,21 +46,25 @@ desc = "A Level II soft armor vest used by Nanotrasen corporate security. Offers light protection against kinetic impacts and lasers, and has a clip for a holobadge." var/obj/item/clothing/accessory/holobadge/attached_badge -/obj/item/clothing/suit/armor/vest/security/attackby__legacy__attackchain(obj/item/I, mob/user, params) - if(istype(I, /obj/item/clothing/accessory/holobadge)) - if(user.transfer_item_to(I, src)) - add_fingerprint(user) - attached_badge = I - var/datum/action/A = new /datum/action/item_action/remove_badge(src) - A.Grant(user) - icon_state = "armorsec" - user.update_inv_wear_suit() - desc = "A Level II soft armor vest used by Nanotrasen corporate security, offering light protection against kinetic impacts and lasers. This one has [attached_badge] attached to it." - to_chat(user, SPAN_NOTICE("You attach [attached_badge] to [src].")) - return - ..() +/obj/item/clothing/suit/armor/vest/security/item_interaction(mob/living/user, obj/item/used, list/modifiers) + if(!istype(used, /obj/item/clothing/accessory/holobadge)) + return ..() + + if(user.transfer_item_to(used, src)) + add_fingerprint(user) + attached_badge = used + var/datum/action/A = new /datum/action/item_action/remove_badge(src) + A.Grant(user) + icon_state = "armorsec" + user.update_inv_wear_suit() + desc = "A Level II soft armor vest used by Nanotrasen corporate security, offering light protection against kinetic impacts and lasers. This one has [attached_badge] attached to it." + to_chat(user, SPAN_NOTICE("You attach [attached_badge] to [src].")) + return ITEM_INTERACT_COMPLETE + +/obj/item/clothing/suit/armor/vest/security/activate_self(mob/user) + if(..()) + return ITEM_INTERACT_COMPLETE -/obj/item/clothing/suit/armor/vest/security/attack_self__legacy__attackchain(mob/user) if(attached_badge) add_fingerprint(user) user.put_in_hands(attached_badge) @@ -72,9 +76,7 @@ desc = "A Level II soft armor vest used by Nanotrasen corporate security. Offers light protection against kinetic impacts and lasers, and has a clip for a holobadge." to_chat(user, SPAN_NOTICE("You remove [attached_badge] from [src].")) attached_badge = null - - return - ..() + return ITEM_INTERACT_COMPLETE /obj/item/clothing/suit/armor/vest/street_judge name = "judge's security armor" @@ -414,11 +416,15 @@ . += "Outside of the strange effects caused by the anomaly core, the armor provides no protection against conventional attacks. \ Nanotrasen cannot be held liable for injury and/or death due to misuse or proper operation of the reactive armor." -/obj/item/clothing/suit/armor/reactive/attack_self__legacy__attackchain(mob/user) +/obj/item/clothing/suit/armor/reactive/activate_self(mob/user) + if(..()) + return ITEM_INTERACT_COMPLETE + active = !(active) if(disabled) to_chat(user, SPAN_WARNING("[src] is disabled and rebooting!")) - return + return ITEM_INTERACT_COMPLETE + if(active) to_chat(user, SPAN_NOTICE("[src] is now active.")) icon_state = "reactive" @@ -428,6 +434,7 @@ add_fingerprint(user) user.update_inv_wear_suit() update_action_buttons() + return ITEM_INTERACT_COMPLETE /obj/item/clothing/suit/armor/reactive/emp_act(severity) var/emp_power = 5 + (severity-1 ? 0 : 5) diff --git a/code/modules/clothing/suits/misc_suits.dm b/code/modules/clothing/suits/misc_suits.dm index 0ba7ef49899e9..e9fc13c41a700 100644 --- a/code/modules/clothing/suits/misc_suits.dm +++ b/code/modules/clothing/suits/misc_suits.dm @@ -1287,13 +1287,17 @@ icon_state = "griffin_wings" inhand_icon_state = null -/obj/item/clothing/suit/toggle/attack_self__legacy__attackchain() +/obj/item/clothing/suit/toggle/activate_self(mob/user) + if(..()) + return ITEM_INTERACT_COMPLETE + if(icon_state == initial(icon_state)) icon_state = icon_state + "_t" else icon_state = initial(icon_state) usr.update_inv_wear_suit() update_action_buttons() + return ITEM_INTERACT_COMPLETE /obj/item/clothing/suit/lordadmiral name = "lord admiral's coat" @@ -1485,9 +1489,13 @@ to_chat(L, SPAN_NOTICE("You are now wearing \a [choice]. Allahu Akbar!")) qdel(src) -/obj/item/clothing/suit/hooded/abaya/attack_self__legacy__attackchain(mob/user) +/obj/item/clothing/suit/hooded/abaya/activate_self(mob/user) + if(..()) + return ITEM_INTERACT_COMPLETE + . = ..() reskin_abaya(user) + return ITEM_INTERACT_COMPLETE /obj/item/clothing/suit/hooded/abaya/red name = "red abaya" diff --git a/code/modules/clothing/suits/suit_storage.dm b/code/modules/clothing/suits/suit_storage.dm index d758f9cd13bcb..c547c356a74f5 100644 --- a/code/modules/clothing/suits/suit_storage.dm +++ b/code/modules/clothing/suits/suit_storage.dm @@ -45,12 +45,12 @@ pockets.show_to(user) return ..() -/obj/item/clothing/suit/storage/attackby__legacy__attackchain(obj/item/W as obj, mob/user as mob, params) +/obj/item/clothing/suit/storage/item_interaction(mob/living/user, obj/item/used, list/modifiers) // Inserts shouldn't be added into the inventory of the pockets if they're attaching. - if(istype(W, /obj/item/smithed_item/insert) && length(inserts) != insert_max) - return ..() - ..() - return pockets?.attackby__legacy__attackchain(W, user, params) + if(istype(used, /obj/item/smithed_item/insert) && length(inserts) != insert_max) + return NONE + + return pockets?.attackby__legacy__attackchain(used, user, modifiers) /obj/item/clothing/suit/storage/emp_act(severity) ..() diff --git a/code/modules/clothing/suits/toggles.dm b/code/modules/clothing/suits/toggles.dm index 96dbc2d102ada..df3cb9bee8a69 100644 --- a/code/modules/clothing/suits/toggles.dm +++ b/code/modules/clothing/suits/toggles.dm @@ -12,7 +12,7 @@ if(ishuman(helmet.loc)) var/mob/living/carbon/H = helmet.loc if(helmet.on) - helmet.attack_self__legacy__attackchain(H) + helmet.activate_self(H) H.transfer_item_to(helmet, src, force = TRUE) H.update_inv_wear_suit() to_chat(H, SPAN_NOTICE("The helmet on the hardsuit disengages.")) diff --git a/code/modules/clothing/suits/wiz_robe.dm b/code/modules/clothing/suits/wiz_robe.dm index 3cd8f8628f435..68910a31a33d1 100644 --- a/code/modules/clothing/suits/wiz_robe.dm +++ b/code/modules/clothing/suits/wiz_robe.dm @@ -226,8 +226,5 @@ resistance_flags = FIRE_PROOF | ACID_PROOF magical = TRUE -/obj/item/clothing/head/helmet/space/hardsuit/wizard/attack_self__legacy__attackchain(mob/user) - return - /obj/item/clothing/head/helmet/space/hardsuit/wizard/arch desc = "A truly protective helmet." diff --git a/code/modules/clothing/under/accessories/accessory.dm b/code/modules/clothing/under/accessories/accessory.dm index abb6569b72a98..971f675ef6c34 100644 --- a/code/modules/clothing/under/accessories/accessory.dm +++ b/code/modules/clothing/under/accessories/accessory.dm @@ -74,38 +74,45 @@ user.put_in_hands(src) add_fingerprint(user) -/obj/item/clothing/accessory/attack__legacy__attackchain(mob/living/carbon/human/H, mob/living/user) - // This code lets you put accessories on other people by attacking their sprite with the accessory - if(istype(H) && !ismonkeybasic(H)) //Monkeys are a snowflake because you can't remove accessories once added - if(H.wear_suit && H.wear_suit.flags_inv & HIDEJUMPSUIT) - to_chat(user, "[H]'s body is covered, and you cannot attach \the [src].") - return TRUE - var/obj/item/clothing/under/U = H.w_uniform - if(istype(U)) - if(user == H) - U.attach_accessory(src, user, TRUE) - return - user.visible_message(SPAN_NOTICE("[user] is putting a [src.name] on [H]'s [U.name]!"), SPAN_NOTICE("You begin to put a [src.name] on [H]'s [U.name]...")) - if(do_after(user, 4 SECONDS, target = H) && H.w_uniform == U) - if(U.attach_accessory(src, user, TRUE)) - user.visible_message(SPAN_NOTICE("[user] puts a [src.name] on [H]'s [U.name]!"), SPAN_NOTICE("You finish putting a [src.name] on [H]'s [U.name].")) - after_successful_nonself_attach(H, user) - else - to_chat(user, "[H] is not wearing anything to attach \the [src] to.") - return TRUE - return ..() +/obj/item/clothing/accessory/interact_with_atom(atom/target, mob/living/user, list/modifiers) + // This code lets you put accessories on other people by attacking their sprite with the accessory. + // Monkeys are a snowflake because you can't remove accessories once added. + if(!ishuman(target) || ismonkeybasic(target)) + return ..() + + var/mob/living/carbon/human/H = target + if(H.wear_suit && H.wear_suit.flags_inv & HIDEJUMPSUIT) + to_chat(user, "[H]'s body is covered, and you cannot attach [src].") + return ITEM_INTERACT_COMPLETE + + var/obj/item/clothing/under/U = H.w_uniform + if(!istype(U)) + to_chat(user, "[H] is not wearing anything to attach [src] to.") + return ITEM_INTERACT_COMPLETE + + if(user == H) + U.attach_accessory(src, user, TRUE) + return ITEM_INTERACT_COMPLETE + + user.visible_message( + SPAN_NOTICE("[user] is putting \a [src.name] on [H]'s [U.name]!"), + SPAN_NOTICE("You begin to put \a [src.name] on [H]'s [U.name]...") + ) + if(do_after(user, 4 SECONDS, target = H) && H.w_uniform == U) + if(U.attach_accessory(src, user, TRUE)) + user.visible_message( + SPAN_NOTICE("[user] puts a [src.name] on [H]'s [U.name]!"), + SPAN_NOTICE("You finish putting a [src.name] on [H]'s [U.name].") + ) + after_successful_nonself_attach(H, user) + return ITEM_INTERACT_COMPLETE /obj/item/clothing/accessory/proc/after_successful_nonself_attach(mob/living/carbon/human/H, mob/living/user) return -//default attackby behaviour -/obj/item/clothing/accessory/attackby__legacy__attackchain(obj/item/I, mob/user, params) - ..() - -//default attack_hand behaviour /obj/item/clothing/accessory/attack_hand(mob/user as mob) if(has_suit) - return //we aren't an object on the ground so don't call parent + return // We aren't an object on the ground so don't call parent ..() /obj/item/clothing/accessory/proc/attached_unequip(mob/user) // If we need to do something special when clothing is removed from the user @@ -141,11 +148,14 @@ if(channel) . += SPAN_NOTICE("The tiny radio inside seems to be [try_announce ? "active" : "inactive"].") -/obj/item/clothing/accessory/medal/attack_self__legacy__attackchain(mob/user) - . = ..() +/obj/item/clothing/accessory/medal/activate_self(mob/user) + if(..()) + return ITEM_INTERACT_COMPLETE + if(channel) try_announce = !try_announce to_chat(user, SPAN_NOTICE("You silently [try_announce ? "enable" : "disable"] the radio in [src].")) + return ITEM_INTERACT_COMPLETE /obj/item/clothing/accessory/medal/after_successful_nonself_attach(mob/living/carbon/human/H, mob/living/user) if(!channel || !try_announce) @@ -343,34 +353,39 @@ "Kidan" = 'icons/mob/clothing/species/kidan/neck.dmi', ) -/obj/item/clothing/accessory/holobadge/attack_self__legacy__attackchain(mob/user) +/obj/item/clothing/accessory/holobadge/activate_self(mob/user) + if(..()) + return ITEM_INTERACT_COMPLETE + if(!stored_name) to_chat(user, "Waving around a badge before swiping an ID would be pretty pointless.") - return - if(isliving(user)) - user.visible_message(SPAN_WARNING("[user] displays [user.p_their()] Nanotrasen Internal Security Legal Authorization Badge.\nIt reads: [stored_name], NT Security."), - SPAN_WARNING("You display your Nanotrasen Internal Security Legal Authorization Badge.\nIt reads: [stored_name], NT Security.")) - -/obj/item/clothing/accessory/holobadge/attackby__legacy__attackchain(obj/item/I, mob/user, params) - if(istype(I, /obj/item/card/id) || istype(I, /obj/item/pda)) - - var/obj/item/card/id/id_card = null - - if(istype(I, /obj/item/card/id)) - id_card = I - else - var/obj/item/pda/pda = I - id_card = pda.id - - if((ACCESS_SEC_DOORS in id_card.access) || emagged) - to_chat(user, SPAN_NOTICE("You imprint your ID details onto the badge.")) - stored_name = id_card.registered_name - name = "holobadge ([stored_name])" - desc = "This glowing blue badge marks [stored_name] as THE LAW." - else - to_chat(user, SPAN_WARNING("[src] rejects your insufficient access rights.")) - return - ..() + return ITEM_INTERACT_COMPLETE + + user.visible_message( + SPAN_WARNING("[user] displays [user.p_their()] Nanotrasen Internal Security Legal Authorization Badge.\nIt reads: [stored_name], Nanotrasen Security."), + SPAN_WARNING("You display your Nanotrasen Internal Security Legal Authorization Badge.\nIt reads: [stored_name], Nanotrasen Security.") + ) + return ITEM_INTERACT_COMPLETE + +/obj/item/clothing/accessory/holobadge/item_interaction(mob/living/user, obj/item/used, list/modifiers) + if(!istype(used, /obj/item/card/id) && !istype(used, /obj/item/pda)) + return ..() + + var/obj/item/card/id/id_card + if(istype(used, /obj/item/card/id)) + id_card = used + else + var/obj/item/pda/pda = used + id_card = pda.id + + if((ACCESS_SEC_DOORS in id_card.access) || emagged) + to_chat(user, SPAN_NOTICE("You imprint your ID details onto the badge.")) + stored_name = id_card.registered_name + name = "holobadge ([stored_name])" + desc = "This glowing blue badge marks [stored_name] as THE LAW." + else + to_chat(user, SPAN_WARNING("[src] rejects your insufficient access rights.")) + return ITEM_INTERACT_COMPLETE /obj/item/clothing/accessory/holobadge/emag_act(mob/user) if(emagged) @@ -380,12 +395,14 @@ to_chat(user, SPAN_WARNING("You swipe the card and crack the holobadge security checks.")) return TRUE -/obj/item/clothing/accessory/holobadge/attack__legacy__attackchain(mob/living/carbon/human/H, mob/living/user) - if(H != user) - user.visible_message(SPAN_WARNING("[user] invades [H]'s personal space, thrusting [src] into [H.p_their()] face insistently."), - SPAN_WARNING("You invade [H]'s personal space, thrusting [src] into [H.p_their()] face insistently. You are THE LAW!")) - return - ..() +/obj/item/clothing/accessory/holobadge/interact_with_atom(atom/target, mob/living/user, list/modifiers) + if(target == user || !ismob(target)) + return ..() + + user.visible_message( + SPAN_WARNING("[user] invades [target]'s personal space, thrusting [src] into [target.p_their()] face insistently."), + SPAN_WARNING("You invade [target]'s personal space, thrusting [src] into [target.p_their()] face insistently. You are THE LAW!")) + return CONTINUE_ATTACK // Physically press it into their face! ////////////// //OBJECTION!// @@ -398,17 +415,27 @@ var/cached_bubble_icon = null var/what_you_are = "THE LAW" -/obj/item/clothing/accessory/legal_badge/attack_self__legacy__attackchain(mob/user) +/obj/item/clothing/accessory/legal_badge/activate_self(mob/user) + if(..()) + return ITEM_INTERACT_COMPLETE + if(prob(1)) user.say("The testimony contradicts the evidence!") - user.visible_message(SPAN_NOTICE("[user] shows [user.p_their()] [name]."), SPAN_NOTICE("You show your [name].")) + user.visible_message( + SPAN_NOTICE("[user] shows [user.p_their()] [name]."), + SPAN_NOTICE("You show your [name].") + ) + return ITEM_INTERACT_COMPLETE -/obj/item/clothing/accessory/legal_badge/attack__legacy__attackchain(mob/living/carbon/human/H, mob/living/user) - if(H != user) - user.visible_message(SPAN_WARNING("[user] invades [H]'s personal space, thrusting [src] into [H.p_their()] face insistently."), - SPAN_WARNING("You invade [H]'s personal space, thrusting [src] into [H.p_their()] face insistently. You are [what_you_are]!")) - return - ..() +/obj/item/clothing/accessory/legal_badge/interact_with_atom(atom/target, mob/living/user, list/modifiers) + if(target == user || !ismob(target)) + return ..() + + user.visible_message( + SPAN_WARNING("[user] invades [target]'s personal space, thrusting [src] into [target.p_their()] face insistently."), + SPAN_WARNING("You invade [target]'s personal space, thrusting [src] into [target.p_their()] face insistently. You are [what_you_are]!") + ) + return CONTINUE_ATTACK /obj/item/clothing/accessory/legal_badge/on_attached(obj/item/clothing/under/S, mob/user) ..() @@ -583,17 +610,21 @@ var/image/pin_icon = image(icon, icon_state = flag_types[current_pin]) flag_icons[current_pin] = pin_icon -/obj/item/clothing/accessory/pin/pride/attack_self__legacy__attackchain(mob/user) - . = ..() +/obj/item/clothing/accessory/pin/pride/activate_self(mob/user) + if(..()) + return ITEM_INTERACT_COMPLETE + var/chosen_pin = show_radial_menu(user, src, flag_icons, require_near = TRUE) if(!chosen_pin) to_chat(user, SPAN_NOTICE("You decide not to change [src].")) - return + return ITEM_INTERACT_COMPLETE + var/pin_icon_state = flag_types[chosen_pin] to_chat(user, SPAN_NOTICE("You change [src] to show [chosen_pin].")) icon_state = pin_icon_state inv_overlay = mutable_appearance('icons/obj/clothing/accessories_overlay.dmi', icon_state) + return ITEM_INTERACT_COMPLETE /proc/english_accessory_list(obj/item/clothing/under/U) if(!istype(U) || !length(U.accessories)) diff --git a/code/modules/clothing/under/accessories/holster.dm b/code/modules/clothing/under/accessories/holster.dm index daa51b2ed4c94..9a06fbab5a10c 100644 --- a/code/modules/clothing/under/accessories/holster.dm +++ b/code/modules/clothing/under/accessories/holster.dm @@ -23,12 +23,16 @@ else return TRUE -/obj/item/clothing/accessory/holster/attack_self__legacy__attackchain() +/obj/item/clothing/accessory/holster/activate_self(mob/user) + if(..()) + return ITEM_INTERACT_COMPLETE + var/holsteritem = usr.get_active_hand() if(!holstered) holster(holsteritem, usr) else unholster(usr) + return ITEM_INTERACT_COMPLETE /obj/item/clothing/accessory/holster/proc/holster(obj/item/I, mob/user as mob) if(holstered) @@ -79,8 +83,8 @@ ..(user) -/obj/item/clothing/accessory/holster/attackby__legacy__attackchain(obj/item/W as obj, mob/user as mob, params) - holster(W, user) +/obj/item/clothing/accessory/holster/item_interaction(mob/living/user, obj/item/used, list/modifiers) + holster(used, user) /obj/item/clothing/accessory/holster/emp_act(severity) if(holstered) diff --git a/code/modules/clothing/under/accessories/storage_accessories.dm b/code/modules/clothing/under/accessories/storage_accessories.dm index 4ab0fa7119e74..c01b590e39087 100644 --- a/code/modules/clothing/under/accessories/storage_accessories.dm +++ b/code/modules/clothing/under/accessories/storage_accessories.dm @@ -32,8 +32,11 @@ if(hold.handle_mousedrop(usr, over_object)) ..(over_object) -/obj/item/clothing/accessory/storage/attackby__legacy__attackchain(obj/item/W as obj, mob/user as mob, params) - return hold.attackby__legacy__attackchain(W, user, params) +/obj/item/clothing/accessory/storage/item_interaction(mob/living/user, obj/item/used, list/modifiers) + if(!hold.item_interaction(user, used, modifiers)) + return hold.attackby__legacy__attackchain(used, user, modifiers) + + return ITEM_INTERACT_COMPLETE /obj/item/clothing/accessory/storage/emp_act(severity) ..() @@ -61,7 +64,10 @@ L += G.gift:return_inv() return L -/obj/item/clothing/accessory/storage/attack_self__legacy__attackchain(mob/user as mob) +/obj/item/clothing/accessory/storage/activate_self(mob/user) + if(..()) + return ITEM_INTERACT_COMPLETE + if(has_suit) //if we are part of a suit hold.open(user) else @@ -71,6 +77,7 @@ for(var/obj/item/I in hold.contents) hold.remove_from_storage(I, T) src.add_fingerprint(user) + return ITEM_INTERACT_COMPLETE /obj/item/clothing/accessory/storage/webbing name = "webbing" diff --git a/code/modules/clothing/under/jobs/plasmamen/_plasmamen.dm b/code/modules/clothing/under/jobs/plasmamen/_plasmamen.dm index 92874687a0689..eefed67b58060 100644 --- a/code/modules/clothing/under/jobs/plasmamen/_plasmamen.dm +++ b/code/modules/clothing/under/jobs/plasmamen/_plasmamen.dm @@ -39,18 +39,19 @@ new /obj/effect/particle_effect/water(get_turf(H)) return FALSE -/obj/item/clothing/under/plasmaman/attackby__legacy__attackchain(obj/item/E, mob/user, params) - if(istype(E, /obj/item/extinguisher_refill)) - if(extinguishes_left == 5) - to_chat(user, SPAN_NOTICE("The inbuilt extinguisher is full.")) - return - else - extinguishes_left = 5 - to_chat(user, SPAN_NOTICE("You refill the suit's built-in extinguisher, using up the cartridge.")) - qdel(E) - else +/obj/item/clothing/under/plasmaman/item_interaction(mob/living/user, obj/item/used, list/modifiers) + if(!istype(used, /obj/item/extinguisher_refill)) return ..() + if(extinguishes_left == 5) + to_chat(user, SPAN_NOTICE("The inbuilt extinguisher is full.")) + return ITEM_INTERACT_COMPLETE + + extinguishes_left = 5 + to_chat(user, SPAN_NOTICE("You refill the suit's built-in extinguisher, using up the cartridge.")) + qdel(used) + return ITEM_INTERACT_COMPLETE + /obj/item/extinguisher_refill name = "envirosuit extinguisher cartridge" desc = "A cartridge loaded with a compressed extinguisher mix, used to refill the automatic extinguisher on plasma envirosuits." diff --git a/code/modules/customitems/item_defines.dm b/code/modules/customitems/item_defines.dm index f193b4344a683..b29af48617083 100644 --- a/code/modules/customitems/item_defines.dm +++ b/code/modules/customitems/item_defines.dm @@ -708,7 +708,7 @@ var/state = "Soldier Up" icon_monitor = null -/obj/item/clothing/head/helmet/fluff/merchant_sallet/attack_self__legacy__attackchain(mob/user) +/obj/item/clothing/head/helmet/fluff/merchant_sallet/activate_self(mob/user) if(!user.incapacitated() && (world.time > cooldown + toggle_cooldown) && Adjacent(user)) var/list/options = list() options["Soldier Up"] = list( @@ -741,7 +741,9 @@ to_chat(user, "You adjust the helmet.") playsound(src.loc, "[toggle_sound]", 100, FALSE, 4) user.update_inv_head() - return 1 + return ITEM_INTERACT_COMPLETE + + return ..() /// V-Force_Bomber: E.L.O. /obj/item/clothing/head/fluff/elo @@ -778,7 +780,10 @@ actions_types = list(/datum/action/item_action/openclose) adjust_flavour = "unbutton" -/obj/item/clothing/suit/jacket/miljacket/patch/attack_self__legacy__attackchain(mob/user) +/obj/item/clothing/suit/jacket/miljacket/patch/activate_self(mob/user) + if(..()) + return ITEM_INTERACT_COMPLETE + var/list/options = list() options["purple"] = "shazjacket_purple" options["purple light"] = "shazjacket_purple_light" @@ -811,9 +816,7 @@ to_chat(user, "You turn your coat inside out and now it's [choice]!") name = "custom [choice] military jacket" user.update_inv_wear_suit() - return 1 - - . = ..() + return ITEM_INTERACT_COMPLETE /// ComputerlessCitizen: Screech /obj/item/clothing/suit/fluff/dusty_jacket @@ -1428,7 +1431,10 @@ icon_monitor = null icon_state = "classic_witch" -/obj/item/clothing/head/wizard/fake/fluff/dreamy/attack_self__legacy__attackchain(mob/user) +/obj/item/clothing/head/wizard/fake/fluff/dreamy/activate_self(mob/user) + if(..()) + return ITEM_INTERACT_COMPLETE + var/list/options = list() options["Classic"] = "classic_witch" options["Good"] = "good_witch" @@ -1448,8 +1454,7 @@ if(choice && !user.stat && in_range(user, src)) icon_state = options[choice] to_chat(user, "Your strange witch hat has now shapeshifted into it's [choice] form!") - return 1 - ..() + return ITEM_INTERACT_COMPLETE /// phantasmicdream : Zeke Varloss /obj/item/fluff/zekemirror @@ -1668,8 +1673,8 @@ /obj/item/clothing/gloves/ring/fluff/update_icon_state() return -/obj/item/clothing/gloves/ring/fluff/attackby__legacy__attackchain(obj/item/I as obj, mob/user as mob, params) - return +/obj/item/clothing/gloves/ring/fluff/item_interaction(mob/living/user, obj/item/used, list/modifiers) + return NONE /// Benjaminfallout: Pretzel Brassheart /obj/item/clothing/gloves/ring/fluff/benjaminfallout diff --git a/code/modules/mob/living/carbon/alien/special/facehugger.dm b/code/modules/mob/living/carbon/alien/special/facehugger.dm index 528cf822a7730..4e123c7a65878 100644 --- a/code/modules/mob/living/carbon/alien/special/facehugger.dm +++ b/code/modules/mob/living/carbon/alien/special/facehugger.dm @@ -36,8 +36,11 @@ if(obj_integrity < 90) Die() -/obj/item/clothing/mask/facehugger/attackby__legacy__attackchain(obj/item/O, mob/user, params) - return O.attack_obj__legacy__attackchain(src, user, params) +/obj/item/clothing/mask/facehugger/item_interaction(mob/living/user, obj/item/used, list/modifiers) + if(!src.attack_obj(src, user, modifiers)) + return used.attack_obj__legacy__attackchain(src, user, modifiers) + + return ITEM_INTERACT_COMPLETE /obj/item/clothing/mask/facehugger/attack_hand(mob/user) if((stat != DEAD && !sterile) && !isalien(user)) @@ -45,10 +48,12 @@ return ..() -/obj/item/clothing/mask/facehugger/attack__legacy__attackchain(mob/living/M, mob/user) - ..() +/obj/item/clothing/mask/facehugger/interact_with_atom(atom/target, mob/living/user, list/modifiers) + if(!ishuman(target)) + return ..() + user.drop_item_to_ground(src) - Attach(M) + Attach(target) /obj/item/clothing/mask/facehugger/examine(mob/user) . = ..() diff --git a/code/modules/mob/living/carbon/human/human_inventory.dm b/code/modules/mob/living/carbon/human/human_inventory.dm index 8d1d98eb38eb6..84c12b7d1ae49 100644 --- a/code/modules/mob/living/carbon/human/human_inventory.dm +++ b/code/modules/mob/living/carbon/human/human_inventory.dm @@ -347,7 +347,7 @@ I.in_storage = TRUE if(ITEM_SLOT_ACCESSORY) var/obj/item/clothing/under/uniform = src.w_uniform - uniform.attackby__legacy__attackchain(I, src) + uniform.item_interaction(src, I) else to_chat(src, SPAN_WARNING("You are trying to equip this item to an unsupported inventory slot. Report this to a coder!")) diff --git a/code/modules/mob/living/simple_animal/bot/bot_construction.dm b/code/modules/mob/living/simple_animal/bot/bot_construction.dm index cdc2eeb181ce4..309553c1aabfa 100644 --- a/code/modules/mob/living/simple_animal/bot/bot_construction.dm +++ b/code/modules/mob/living/simple_animal/bot/bot_construction.dm @@ -432,22 +432,21 @@ var/build_step = 0 var/robot_arm = /obj/item/robot_parts/l_arm -/obj/item/clothing/head/helmet/attackby__legacy__attackchain(obj/item/assembly/signaler/S, mob/user, params) - ..() - if(!issignaler(S)) - ..() - return - +/obj/item/clothing/head/helmet/item_interaction(mob/living/user, obj/item/used, list/modifiers) + if(!issignaler(used)) + return ..() + var/obj/item/assembly/signaler/S if(S.secured) - to_chat(user, SPAN_NOTICE("[S] is secured.")) - return - qdel(S) + to_chat(user, SPAN_WARNING("[S] is secured!")) + return ITEM_INTERACT_COMPLETE + + qdel(used) var/obj/item/secbot_assembly/A = new /obj/item/secbot_assembly user.put_in_hands(A) - to_chat(user, SPAN_NOTICE("You add the signaler to the helmet.")) + to_chat(user, SPAN_NOTICE("You add [used] to the helmet.")) user.unequip(src, force = TRUE) qdel(src) - + return ITEM_INTERACT_COMPLETE /obj/item/secbot_assembly/attackby__legacy__attackchain(obj/item/I, mob/user, params) ..() diff --git a/code/modules/mod/mod_link.dm b/code/modules/mod/mod_link.dm index ff53d446a3362..93bed1d220e35 100644 --- a/code/modules/mod/mod_link.dm +++ b/code/modules/mod/mod_link.dm @@ -184,17 +184,22 @@ . = ..() mod_link?.end_call() -/obj/item/clothing/neck/link_scryer/attack_self__legacy__attackchain(mob/user) +/obj/item/clothing/neck/link_scryer/activate_self(mob/user) + if(..()) + return ITEM_INTERACT_COMPLETE + var/new_label = reject_bad_text(tgui_input_text(user, "Change the visible name", "Set Name", label, MAX_NAME_LEN)) if(!user.is_holding(src)) - return + return ITEM_INTERACT_COMPLETE + if(!new_label) to_chat(user, SPAN_WARNING("That name is invalid!")) - return + return ITEM_INTERACT_COMPLETE + label = new_label to_chat(user, SPAN_NOTICE("You set the name as [label].")) update_appearance(UPDATE_NAME) - + return ITEM_INTERACT_COMPLETE /obj/item/clothing/neck/link_scryer/multitool_act(mob/user, obj/item/I) . = TRUE @@ -246,16 +251,22 @@ return cell.use(50) -/obj/item/clothing/neck/link_scryer/attackby__legacy__attackchain(obj/item/O, mob/user, params) - . = ..() - if(cell || !istype(O, /obj/item/stock_parts/cell)) - return +/obj/item/clothing/neck/link_scryer/item_interaction(mob/living/user, obj/item/used, list/modifiers) + if(!istype(used, /obj/item/stock_parts/cell)) + return ..() + + if(cell) + to_chat(user, SPAN_WARNING("[src] already has a cell!")) + return ITEM_INTERACT_COMPLETE + if(!user.drop_item()) - to_chat(user, SPAN_WARNING("[O] is stuck to your hand!")) - return - O.forceMove(src) - cell = O - to_chat(user, SPAN_NOTICE("You load [O] into [src].")) + to_chat(user, SPAN_WARNING("[used] is stuck to your hand!")) + return ITEM_INTERACT_COMPLETE + + used.forceMove(src) + cell = used + to_chat(user, SPAN_NOTICE("You load [used] into [src].")) + return ITEM_INTERACT_COMPLETE /obj/item/clothing/neck/link_scryer/update_name(updates) . = ..() diff --git a/icons/mob/clothing/head.dmi b/icons/mob/clothing/head.dmi index 1425d7b768f1a..6c84355d8e7de 100644 Binary files a/icons/mob/clothing/head.dmi and b/icons/mob/clothing/head.dmi differ diff --git a/icons/mob/clothing/species/drask/head.dmi b/icons/mob/clothing/species/drask/head.dmi index 74ffd7e3f49a6..6daf512bf1a27 100644 Binary files a/icons/mob/clothing/species/drask/head.dmi and b/icons/mob/clothing/species/drask/head.dmi differ diff --git a/icons/mob/clothing/species/grey/head.dmi b/icons/mob/clothing/species/grey/head.dmi index 0d42fb7b3a19b..b0acbc3249d60 100644 Binary files a/icons/mob/clothing/species/grey/head.dmi and b/icons/mob/clothing/species/grey/head.dmi differ diff --git a/icons/mob/clothing/species/kidan/head.dmi b/icons/mob/clothing/species/kidan/head.dmi index 2bc6cdda4383c..eb2f74289bb30 100644 Binary files a/icons/mob/clothing/species/kidan/head.dmi and b/icons/mob/clothing/species/kidan/head.dmi differ diff --git a/icons/mob/clothing/species/machine/monitor/hat.dmi b/icons/mob/clothing/species/machine/monitor/hat.dmi index f51ce0c03a83c..7f295bbc0cd41 100644 Binary files a/icons/mob/clothing/species/machine/monitor/hat.dmi and b/icons/mob/clothing/species/machine/monitor/hat.dmi differ diff --git a/icons/mob/clothing/species/machine/monitor/hood.dmi b/icons/mob/clothing/species/machine/monitor/hood.dmi index 5eca46266eec1..e96062f9507d6 100644 Binary files a/icons/mob/clothing/species/machine/monitor/hood.dmi and b/icons/mob/clothing/species/machine/monitor/hood.dmi differ diff --git a/icons/mob/clothing/species/nian/head.dmi b/icons/mob/clothing/species/nian/head.dmi index 8ebe9f59bd4a6..6d183b6ffac10 100644 Binary files a/icons/mob/clothing/species/nian/head.dmi and b/icons/mob/clothing/species/nian/head.dmi differ diff --git a/icons/mob/clothing/species/skrell/head.dmi b/icons/mob/clothing/species/skrell/head.dmi index 7b1a7047d0ada..9a97aa6605f71 100644 Binary files a/icons/mob/clothing/species/skrell/head.dmi and b/icons/mob/clothing/species/skrell/head.dmi differ diff --git a/icons/mob/clothing/species/tajaran/head.dmi b/icons/mob/clothing/species/tajaran/head.dmi index b871419d1f2fa..871779d85d232 100644 Binary files a/icons/mob/clothing/species/tajaran/head.dmi and b/icons/mob/clothing/species/tajaran/head.dmi differ diff --git a/icons/mob/clothing/species/vox/head.dmi b/icons/mob/clothing/species/vox/head.dmi index 156793ccc3cb1..29bbf1258336f 100644 Binary files a/icons/mob/clothing/species/vox/head.dmi and b/icons/mob/clothing/species/vox/head.dmi differ diff --git a/icons/mob/clothing/species/vulpkanin/head.dmi b/icons/mob/clothing/species/vulpkanin/head.dmi index b5596740e27fd..20e2430ae261a 100644 Binary files a/icons/mob/clothing/species/vulpkanin/head.dmi and b/icons/mob/clothing/species/vulpkanin/head.dmi differ diff --git a/icons/obj/clothing/hats.dmi b/icons/obj/clothing/hats.dmi index 113939a4bebea..18caab37eb093 100644 Binary files a/icons/obj/clothing/hats.dmi and b/icons/obj/clothing/hats.dmi differ diff --git a/paradise.dme b/paradise.dme index b0cacd7be0362..9ab392bab8dbf 100644 --- a/paradise.dme +++ b/paradise.dme @@ -1988,6 +1988,7 @@ #include "code\modules\clothing\head\beret.dm" #include "code\modules\clothing\head\collectable.dm" #include "code\modules\clothing\head\hardhat.dm" +#include "code\modules\clothing\head\headscarf.dm" #include "code\modules\clothing\head\helmet.dm" #include "code\modules\clothing\head\job_hats.dm" #include "code\modules\clothing\head\misc_hats.dm"