diff --git a/code/_helpers/gender.dm b/code/_helpers/gender.dm index 17dbbd3eba..9ad5ac2526 100644 --- a/code/_helpers/gender.dm +++ b/code/_helpers/gender.dm @@ -49,7 +49,7 @@ return p_they(temp_gender) + "'" + copytext_char(p_are(temp_gender), 2) /datum/proc/p_Theyre(temp_gender) - return p_they(temp_gender) + "'" + copytext_char(p_are(temp_gender), 2) + return p_They(temp_gender) + "'" + copytext_char(p_are(temp_gender), 2) /datum/proc/p_s(temp_gender) return "s" diff --git a/code/_onclick/item_attack.dm b/code/_onclick/item_attack.dm index 9a71f57614..1e52a044c3 100644 --- a/code/_onclick/item_attack.dm +++ b/code/_onclick/item_attack.dm @@ -19,10 +19,19 @@ item/apply_hit_effect() can be overriden to do whatever you want. However "stand avoid code duplication. This includes items that may sometimes act as a standard weapon in addition to having other effects (e.g. stunbatons on harm intent). */ -// Called when the item is in the active hand, and clicked; alternately, there is an 'activate held object' verb or you can hit pagedown. +/** + * ## IF YOU ARE MAKING SOMETHING USE ATTACK SELF, ENSURE IT CALLS THE PARENT AND CHECKS FOR A TRUE RETURN VALUE, CANCELLING THE REST OF THE CHAIN IF SO. + * Called when the item is in the active hand and clicked + * alternately, there is an 'activate held object' verb or you can hit pagedown or Z in hotkey mode. + * returns TRUE if the attack was handled by a signal handler and no further processing should occur. + * returns FALSE if a signal handler did NOT handle it, resulting in the normal chain. +*/ /obj/item/proc/attack_self(mob/user) + SHOULD_CALL_PARENT(TRUE) + if(!user) + CRASH("attack_self was called without a user!") if(SEND_SIGNAL(src, COMSIG_ITEM_ATTACK_SELF, user) & COMPONENT_CANCEL_ATTACK_CHAIN) - return + return TRUE return /// Called when the item is in the active hand, and right-clicked. Intended for alternate or opposite functions, such as lowering reagent transfer amount. At the moment, there is no verb or hotkey. diff --git a/code/_onclick/telekinesis.dm b/code/_onclick/telekinesis.dm index 0402e65d9f..93af7cef66 100644 --- a/code/_onclick/telekinesis.dm +++ b/code/_onclick/telekinesis.dm @@ -81,7 +81,10 @@ qdel(src) return -/obj/item/tk_grab/attack_self(mob/user as mob) +/obj/item/tk_grab/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE if(focus) focus.attack_self_tk(user) diff --git a/code/datums/components/antags/changeling/changeling.dm b/code/datums/components/antags/changeling/changeling.dm index d749cdd666..89c9fb27c3 100644 --- a/code/datums/components/antags/changeling/changeling.dm +++ b/code/datums/components/antags/changeling/changeling.dm @@ -440,6 +440,9 @@ var/list/datum/power/changeling/powerinstances = list() attack_verb = list("attacked", "slashed", "stabbed", "sliced") /obj/item/changeling_debug/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE user.make_changeling() ///Changeling Panel diff --git a/code/datums/components/antags/changeling/powers/armor.dm b/code/datums/components/antags/changeling/powers/armor.dm index 55150f8196..0173d4540a 100644 --- a/code/datums/components/antags/changeling/powers/armor.dm +++ b/code/datums/components/antags/changeling/powers/armor.dm @@ -74,6 +74,9 @@ slowdown += 1 //It's already tied to a slowdown suit, 6 slowdown is huge. /obj/item/clothing/shoes/magboots/changeling/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE if(magpulse) item_flags &= ~NOSLIP magpulse = 0 diff --git a/code/defines/obj/weapon.dm b/code/defines/obj/weapon.dm index e51a03fde4..251a505f65 100644 --- a/code/defines/obj/weapon.dm +++ b/code/defines/obj/weapon.dm @@ -39,7 +39,30 @@ throw_speed = 3 throw_range = 15 attack_verb = list("HONKED") - var/spam_flag = 0 + var/honk_sound = 'sound/items/bikehorn.ogg' + var/cooldown = 0 + var/honk_text = FALSE + ///Var for attack_self chain + var/special_handling = FALSE + +/obj/item/bikehorn/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE + if(special_handling) + return FALSE + if(cooldown <= world.time) + cooldown = (world.time + 2 SECONDS) + playsound(src, honk_sound, 50, 1) + add_fingerprint(user) + if(honk_text) + audible_message(span_maroon("[honk_text]")) + +/obj/item/bikehorn/Crossed(atom/movable/AM as mob|obj) + if(AM.is_incorporeal()) + return + if(isliving(AM)) + playsound(src, honk_sound, 50, 1) /obj/item/c_tube name = "cardboard tube" @@ -215,7 +238,10 @@ throw_speed = 4 throw_range = 20 -/obj/item/camera_bug/attack_self(mob/user as mob) +/obj/item/camera_bug/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE if(in_use) return diff --git a/code/game/antagonist/outsider/wizard.dm b/code/game/antagonist/outsider/wizard.dm index 88668f403a..d452fb27ae 100644 --- a/code/game/antagonist/outsider/wizard.dm +++ b/code/game/antagonist/outsider/wizard.dm @@ -113,6 +113,10 @@ var/datum/antagonist/wizard/wizards /obj/item/clothing var/wizard_garb = 0 + ///Var for attack_self chain + var/special_handling = FALSE + ///Var for attack_self chain as well + var/helmet_handling = FALSE // Does this clothing slot count as wizard garb? (Combines a few checks) /proc/is_wiz_garb(var/obj/item/clothing/C) diff --git a/code/game/gamemodes/cult/ritual.dm b/code/game/gamemodes/cult/ritual.dm index 10a1e2d075..1c15cdd504 100644 --- a/code/game/gamemodes/cult/ritual.dm +++ b/code/game/gamemodes/cult/ritual.dm @@ -191,6 +191,7 @@ GLOBAL_LIST_INIT(rnwords, list("ire","ego","nahlizet","certum","veri","jatkaa"," unique = 1 var/tomedat = "" var/list/words = list("ire" = "ire", "ego" = "ego", "nahlizet" = "nahlizet", "certum" = "certum", "veri" = "veri", "jatkaa" = "jatkaa", "balaq" = "balaq", "mgar" = "mgar", "karazet" = "karazet", "geeri" = "geeri") + occult_tier = 1 tomedat = {" @@ -314,9 +315,14 @@ GLOBAL_LIST_INIT(rnwords, list("ire","ego","nahlizet","certum","veri","jatkaa"," to_chat(M, span_danger("You feel searing heat inside!")) -/obj/item/book/tome/attack_self(mob/living/user as mob) +/obj/item/book/tome/attack_self(mob/living/user) + . = ..(user) + if(.) + return TRUE if(!user.canmove || user.stat || user.restrained()) return + if(occult_tier > 1) //This is a low tier book. If it's a higher tier, use ITS parent call instead of continuing. + return if(!GLOB.cultwords["travel"]) runerandom() @@ -435,8 +441,12 @@ GLOBAL_LIST_INIT(rnwords, list("ire","ego","nahlizet","certum","veri","jatkaa"," /obj/item/book/tome/imbued //admin tome, spawns working runes without waiting w_class = ITEMSIZE_SMALL + occult_tier = 2 var/cultistsonly = 1 -/obj/item/book/tome/imbued/attack_self(mob/user as mob) +/obj/item/book/tome/imbued/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE if(src.cultistsonly && !iscultist(user)) return if(!GLOB.cultwords["travel"]) diff --git a/code/game/gamemodes/cult/soulstone.dm b/code/game/gamemodes/cult/soulstone.dm index fa45054e82..71202d8c76 100644 --- a/code/game/gamemodes/cult/soulstone.dm +++ b/code/game/gamemodes/cult/soulstone.dm @@ -40,6 +40,9 @@ ///////////////////Options for using captured souls/////////////////////////////////////// /obj/item/soulstone/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE if (!in_range(src, user)) return user.set_machine(src) diff --git a/code/game/gamemodes/cult/talisman.dm b/code/game/gamemodes/cult/talisman.dm index 3f226d0c9c..d4b54558bd 100644 --- a/code/game/gamemodes/cult/talisman.dm +++ b/code/game/gamemodes/cult/talisman.dm @@ -4,7 +4,10 @@ var/uses = 0 info = "


" -/obj/item/paper/talisman/attack_self(mob/living/user as mob) +/obj/item/paper/talisman/attack_self(mob/living/user) + . = ..(user) + if(.) + return TRUE if(iscultist(user)) var/delete = 1 // who the hell thought this was a good idea :( diff --git a/code/game/gamemodes/nuclear/pinpointer.dm b/code/game/gamemodes/nuclear/pinpointer.dm index 7d27515efa..fa9f9a1d95 100644 --- a/code/game/gamemodes/nuclear/pinpointer.dm +++ b/code/game/gamemodes/nuclear/pinpointer.dm @@ -12,6 +12,10 @@ var/obj/item/disk/nuclear/the_disk = null var/active = 0 + ///TODO: Clear up click code entirely. This is used exclusively for attack_self + var/nuclear = FALSE + var/shuttle = FALSE + pickup_sound = 'sound/items/pickup/device.ogg' drop_sound = 'sound/items/drop/device.ogg' @@ -20,13 +24,18 @@ STOP_PROCESSING(SSobj, src) return ..() -/obj/item/pinpointer/attack_self() +/obj/item/pinpointer/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE + if(nuclear || shuttle) + return if(!active) - active = 1 + active = TRUE START_PROCESSING(SSobj, src) to_chat(usr, span_notice("You activate the pinpointer")) else - active = 0 + active = FALSE STOP_PROCESSING(SSobj, src) icon_state = "pinoff" to_chat(usr, span_notice("You deactivate the pinpointer")) @@ -185,7 +194,10 @@ var/mode = 0 //Mode 0 locates disk, mode 1 locates the shuttle var/obj/machinery/computer/shuttle_control/multi/syndicate/home = null -/obj/item/pinpointer/nukeop/attack_self(mob/user as mob) +/obj/item/pinpointer/nukeop/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE if(!active) active = 1 START_PROCESSING(SSobj, src) @@ -271,7 +283,10 @@ var/shuttle_comp_id = null var/obj/machinery/computer/shuttle_control/our_shuttle = null -/obj/item/pinpointer/shuttle/attack_self(mob/user as mob) +/obj/item/pinpointer/shuttle/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE if(!active) active = TRUE START_PROCESSING(SSobj, src) diff --git a/code/game/gamemodes/technomancer/catalog.dm b/code/game/gamemodes/technomancer/catalog.dm index 392b0057ae..2692b1c885 100644 --- a/code/game/gamemodes/technomancer/catalog.dm +++ b/code/game/gamemodes/technomancer/catalog.dm @@ -110,11 +110,14 @@ var/list/all_technomancer_assistance = subtypesof(/datum/technomancer/assistance // Parameters: 1 (user - the mob clicking on the catalog) // Description: Shows an HTML window, to buy equipment and spells, if the user is the legitimate owner. Otherwise it cannot be used. /obj/item/technomancer_catalog/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE if(!user) - return 0 + return if(owner && user != owner) to_chat(user, span_danger("\The [src] knows that you're not the original owner, and has locked you out of it!")) - return 0 + return else if(!owner) bind_to_owner(user) diff --git a/code/game/gamemodes/technomancer/devices/disposable_teleporter.dm b/code/game/gamemodes/technomancer/devices/disposable_teleporter.dm index a73c45b27b..4e2fa7017d 100644 --- a/code/game/gamemodes/technomancer/devices/disposable_teleporter.dm +++ b/code/game/gamemodes/technomancer/devices/disposable_teleporter.dm @@ -26,7 +26,10 @@ . = ..() . += "[uses] uses remaining." -/obj/item/disposable_teleporter/attack_self(mob/user as mob) +/obj/item/disposable_teleporter/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE if(!uses) to_chat(user, span_danger("\The [src] has ran out of uses, and is now useless to you!")) return diff --git a/code/game/gamemodes/technomancer/devices/shield_armor.dm b/code/game/gamemodes/technomancer/devices/shield_armor.dm index b5330cac8c..ab61fdd960 100644 --- a/code/game/gamemodes/technomancer/devices/shield_armor.dm +++ b/code/game/gamemodes/technomancer/devices/shield_armor.dm @@ -74,6 +74,9 @@ return 0 // This shield does not block all damage, so returning 0 is needed to tell the game to apply the new damage. /obj/item/clothing/suit/armor/shield/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE active = !active to_chat(user, span_notice("You [active ? "" : "de"]activate \the [src].")) update_icon() diff --git a/code/game/gamemodes/technomancer/devices/tesla_armor.dm b/code/game/gamemodes/technomancer/devices/tesla_armor.dm index c6e1ae3cc4..f6888495a7 100644 --- a/code/game/gamemodes/technomancer/devices/tesla_armor.dm +++ b/code/game/gamemodes/technomancer/devices/tesla_armor.dm @@ -53,6 +53,9 @@ return 0 /obj/item/clothing/suit/armor/tesla/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE active = !active to_chat(user, span_notice("You [active ? "" : "de"]activate \the [src].")) update_icon() diff --git a/code/game/gamemodes/technomancer/equipment.dm b/code/game/gamemodes/technomancer/equipment.dm index 47d48a8289..251a628a52 100644 --- a/code/game/gamemodes/technomancer/equipment.dm +++ b/code/game/gamemodes/technomancer/equipment.dm @@ -191,6 +191,9 @@ attack_verb = list("beaten", "smashed", "struck", "whacked") /obj/item/scepter/attack_self(mob/living/carbon/human/user) + . = ..(user) + if(.) + return TRUE var/obj/item/item_to_test = user.get_other_hand(src) if(istype(item_to_test, /obj/item/spell)) var/obj/item/spell/S = item_to_test diff --git a/code/game/gamemodes/technomancer/spell_objs.dm b/code/game/gamemodes/technomancer/spell_objs.dm index 01ee1b55f3..28e92066eb 100644 --- a/code/game/gamemodes/technomancer/spell_objs.dm +++ b/code/game/gamemodes/technomancer/spell_objs.dm @@ -196,9 +196,11 @@ // Parameters: 1 (user - the Technomancer that invoked this proc) // Description: Tries to call on_use_cast() if it is allowed to do so. Don't override this, override on_use_cast() instead. /obj/item/spell/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE if(run_checks() && (cast_methods & CAST_USE)) on_use_cast(user) - ..() // Proc: attackby() // Parameters: 2 (W - the item this spell object is hitting, user - the technomancer who clicked the other object) diff --git a/code/game/machinery/computer/arcade.dm b/code/game/machinery/computer/arcade.dm index 4dd4ad02df..7008d01790 100644 --- a/code/game/machinery/computer/arcade.dm +++ b/code/game/machinery/computer/arcade.dm @@ -1047,6 +1047,9 @@ . += span_notice("There's a little switch on the bottom. It's flipped up.") /obj/item/orion_ship/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE if(active) return diff --git a/code/game/machinery/computer/guestpass.dm b/code/game/machinery/computer/guestpass.dm index 50f3789014..4149b75823 100644 --- a/code/game/machinery/computer/guestpass.dm +++ b/code/game/machinery/computer/guestpass.dm @@ -12,6 +12,7 @@ var/expiration_time = 0 var/expired = 0 var/reason = "NOT SPECIFIED" + special_handling = TRUE /obj/item/card/id/guest/update_icon() return @@ -44,6 +45,9 @@ return /obj/item/card/id/guest/attack_self(mob/living/user as mob) + . = ..(user) + if(.) + return TRUE if(user.a_intent == I_HURT) if(icon_state == "guest-invalid") to_chat(user, span_warning("This guest pass is already deactivated!")) @@ -57,7 +61,11 @@ update_icon() expiration_time = world.time expired = 1 - return ..() + else + user.visible_message("\The [user] shows you: [icon2html(src,viewers(src))] [src.name]. The assignment on the card: [src.assignment]",\ + "You flash your ID card: [icon2html(src, user.client)] [src.name]. The assignment on the card: [src.assignment]") + + src.add_fingerprint(user) /obj/item/card/id/guest/Initialize(mapload) . = ..() diff --git a/code/game/machinery/computer/timeclock_vr.dm b/code/game/machinery/computer/timeclock_vr.dm index bfb874dd36..fbe3b33e33 100644 --- a/code/game/machinery/computer/timeclock_vr.dm +++ b/code/game/machinery/computer/timeclock_vr.dm @@ -245,6 +245,13 @@ /obj/item/card/id var/last_job_switch + ///Var for attack_self chain + var/special_handling = FALSE + + ///Var for event IDs + var/can_configure = FALSE + var/configured = FALSE + /obj/item/card/id/Initialize(mapload) . = ..() last_job_switch = world.time diff --git a/code/game/machinery/doors/airlock_electronics.dm b/code/game/machinery/doors/airlock_electronics.dm index cc097b51ac..0b714c1203 100644 --- a/code/game/machinery/doors/airlock_electronics.dm +++ b/code/game/machinery/doors/airlock_electronics.dm @@ -22,9 +22,12 @@ to_chat(user, span_notice("You remove the access restrictions on [src]!")) return 1 -/obj/item/airlock_electronics/attack_self(mob/user as mob) +/obj/item/airlock_electronics/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE if (!ishuman(user) && !istype(user,/mob/living/silicon/robot)) - return ..(user) + return FALSE var/t1 = span_bold("Access control") + "
\n" diff --git a/code/game/machinery/floor_light.dm b/code/game/machinery/floor_light.dm index fb8ef26151..f0bf965c31 100644 --- a/code/game/machinery/floor_light.dm +++ b/code/game/machinery/floor_light.dm @@ -8,6 +8,9 @@ var/list/floor_light_cache = list() matter = list(MAT_STEEL = 2500, MAT_GLASS = 2750) /obj/item/floor_light/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE var/turf/T = get_turf(user) if(!T) to_chat(user, span_warning("You need to be on a floor to install this.")) diff --git a/code/game/machinery/pipe/construction.dm b/code/game/machinery/pipe/construction.dm index 4203134944..df00dc5431 100644 --- a/code/game/machinery/pipe/construction.dm +++ b/code/game/machinery/pipe/construction.dm @@ -149,6 +149,9 @@ Buildable meters set_dir(turn(dir, 45)) /obj/item/pipe/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE set_dir(turn(dir,-90)) fixdir() diff --git a/code/game/machinery/supplybeacon.dm b/code/game/machinery/supplybeacon.dm index 7f75bc5e93..78fb4e3bef 100644 --- a/code/game/machinery/supplybeacon.dm +++ b/code/game/machinery/supplybeacon.dm @@ -11,7 +11,10 @@ name = "inactive supermatter supply beacon" deploy_path = /obj/machinery/power/supply_beacon/supermatter -/obj/item/supply_beacon/attack_self(var/mob/user) +/obj/item/supply_beacon/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE user.visible_message(span_infoplain(span_bold("\The [user]") + " begins setting up \the [src].")) if(!do_after(user, deploy_time, target = src)) return diff --git a/code/game/machinery/wall_frames.dm b/code/game/machinery/wall_frames.dm index 1c17b2d05a..7d5c6e9bda 100644 --- a/code/game/machinery/wall_frames.dm +++ b/code/game/machinery/wall_frames.dm @@ -24,8 +24,10 @@ return ..() -/obj/item/frame/attack_self(mob/user as mob) - ..() +/obj/item/frame/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE update_type_list() var/datum/frame/frame_types/frame_type if(!build_machine_type && !build_wall_only) diff --git a/code/game/objects/effects/decals/contraband.dm b/code/game/objects/effects/decals/contraband.dm index 828ea2e26c..3f4a6b2eeb 100644 --- a/code/game/objects/effects/decals/contraband.dm +++ b/code/game/objects/effects/decals/contraband.dm @@ -250,6 +250,9 @@ w_class = ITEMSIZE_HUGE /obj/item/contraband/package/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE var/contraband = pick( /obj/item/reagent_containers/glass/beaker/vial/macrocillin, /obj/item/reagent_containers/glass/beaker/vial/microcillin, diff --git a/code/game/objects/effects/mines.dm b/code/game/objects/effects/mines.dm index a1fd979f0e..b23f3f4733 100644 --- a/code/game/objects/effects/mines.dm +++ b/code/game/objects/effects/mines.dm @@ -319,7 +319,10 @@ var/list/allowed_gadgets = null -/obj/item/mine/attack_self(mob/user as mob) // You do not want to move or throw a land mine while priming it... Explosives + Sudden Movement = Bad Times +/obj/item/mine/attack_self(mob/user) // You do not want to move or throw a land mine while priming it... Explosives + Sudden Movement = Bad Times + . = ..(user) + if(.) + return TRUE add_fingerprint(user) msg_admin_attack("[key_name_admin(user)] primed \a [src]") user.visible_message("[user] starts priming \the [src.name].", "You start priming \the [src.name]. Hold still!") diff --git a/code/game/objects/items/antag_spawners.dm b/code/game/objects/items/antag_spawners.dm index 2125bb98f3..a3e2d13906 100644 --- a/code/game/objects/items/antag_spawners.dm +++ b/code/game/objects/items/antag_spawners.dm @@ -56,6 +56,9 @@ ghost_query_type = /datum/ghost_query/apprentice /obj/item/antag_spawner/technomancer_apprentice/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE to_chat(user, span_notice("Teleporter attempting to lock on to your apprentice.")) request_player() @@ -102,6 +105,9 @@ var/drone_type = null /obj/item/antag_spawner/syndicate_drone/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE to_chat(user, span_notice("Teleporter attempting to lock on to an available unit.")) request_player() diff --git a/code/game/objects/items/blueprints.dm b/code/game/objects/items/blueprints.dm index b48eff602e..6aa6a6513c 100644 --- a/code/game/objects/items/blueprints.dm +++ b/code/game/objects/items/blueprints.dm @@ -42,9 +42,12 @@ var/can_expand_areas_into = AREA_SPACE // Can expand station areas only into space. var/can_rename_areas_in = AREA_STATION // Only station areas can be reanamed -/obj/item/blueprints/attack_self(mob/M as mob) - if (!ishuman(M)) - to_chat(M, "This stack of blue paper means nothing to you.") //monkeys cannot into projecting +/obj/item/blueprints/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE + if(!ishuman(user)) + to_chat(user, "This stack of blue paper means nothing to you.") //monkeys cannot into projecting return interact() return diff --git a/code/game/objects/items/blueprints_vr.dm b/code/game/objects/items/blueprints_vr.dm index 63ad118065..85e9b4e21d 100644 --- a/code/game/objects/items/blueprints_vr.dm +++ b/code/game/objects/items/blueprints_vr.dm @@ -116,6 +116,9 @@ ..() /obj/item/areaeditor/attack_self(mob/user) //Convert this to TGUI some time. + . = ..(user) + if(.) + return TRUE add_fingerprint(user) . = "[src] \

[station_name()] [src.name]

" @@ -177,6 +180,9 @@ var/legend = 1 /obj/item/wire_reader/attack_self(mob/user) //Convert this to TGUI some time. + . = ..(user) + if(.) + return TRUE add_fingerprint(user) . = "[src] \

[station_name()] [src.name]

" @@ -247,7 +253,9 @@ /obj/item/areaeditor/blueprints/attack_self(mob/user) - . = ..() + . = ..(user) + if(. == 1) //I hate this so much. + return TRUE var/area/A = get_area(user) if(!legend) if(get_area_type() == AREA_STATION) diff --git a/code/game/objects/items/bodybag.dm b/code/game/objects/items/bodybag.dm index 6c1de0999c..7c4a8648f1 100644 --- a/code/game/objects/items/bodybag.dm +++ b/code/game/objects/items/bodybag.dm @@ -7,10 +7,36 @@ icon_state = "bodybag_folded" w_class = ITEMSIZE_SMALL + //Used for cryogenic bodybags + var/obj/item/reagent_containers/syringe/syringe + var/cryogenic = FALSE + var/robotic = FALSE + /obj/item/bodybag/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE + + if(cryogenic) + var/obj/structure/closet/body_bag/cryobag/R = new /obj/structure/closet/body_bag/cryobag(user.loc) + R.add_fingerprint(user) + if(syringe) + R.syringe = syringe + syringe = null + qdel(src) + return + if(robotic) + var/obj/structure/closet/body_bag/cryobag/robobag/R = new /obj/structure/closet/body_bag/cryobag/robobag(user.loc) + R.add_fingerprint(user) + if(syringe) + R.syringe = syringe + syringe = null + qdel(src) + return var/obj/structure/closet/body_bag/R = new /obj/structure/closet/body_bag(user.loc) R.add_fingerprint(user) qdel(src) + return /obj/item/storage/box/bodybags @@ -114,15 +140,7 @@ icon_state = "bodybag_folded" item_state = "bodybag_cryo_folded" origin_tech = list(TECH_BIO = 4) - var/obj/item/reagent_containers/syringe/syringe - -/obj/item/bodybag/cryobag/attack_self(mob/user) - var/obj/structure/closet/body_bag/cryobag/R = new /obj/structure/closet/body_bag/cryobag(user.loc) - R.add_fingerprint(user) - if(syringe) - R.syringe = syringe - syringe = null - qdel(src) + cryogenic = TRUE /obj/structure/closet/body_bag/cryobag name = "stasis bag" diff --git a/code/game/objects/items/contraband_vr.dm b/code/game/objects/items/contraband_vr.dm index 85faa40ce9..f047fc48d8 100644 --- a/code/game/objects/items/contraband_vr.dm +++ b/code/game/objects/items/contraband_vr.dm @@ -6,7 +6,10 @@ item_state = "table_parts" w_class = ITEMSIZE_HUGE -/obj/item/stolenpackage/attack_self(mob/user as mob) +/obj/item/stolenpackage/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE // Another way of doing this. Commented out because the other method is better for this application. /*var/spawn_chance = rand(1,100) switch(spawn_chance) @@ -106,5 +109,8 @@ icon = 'icons/obj/contraband_vr.dmi' w_class = ITEMSIZE_NORMAL -/obj/item/miscdisc/attack_self(mob/living/user as mob) +/obj/item/miscdisc/attack_self(mob/living/user) + . = ..(user) + if(.) + return TRUE to_chat(user, "As you hold the large disc in your open palm, fingers cusped around the edge, the crystal embedded in the item begins to vibrate. It lifts itself from the disc a few cenimetres, before beginning to glow with a bright red light. The glow lasts for a few seconds, before the crystal embeds itself back into the disc with a quick snap.") diff --git a/code/game/objects/items/crayons.dm b/code/game/objects/items/crayons.dm index 1fe3fa99b9..b12340e2d8 100644 --- a/code/game/objects/items/crayons.dm +++ b/code/game/objects/items/crayons.dm @@ -42,7 +42,10 @@ colourName = "mime" uses = 0 -/obj/item/pen/crayon/mime/attack_self(mob/living/user as mob) //inversion +/obj/item/pen/crayon/mime/attack_self(mob/living/user) //inversion + . = ..(user) + if(.) + return TRUE if(colour != "#FFFFFF" && shadeColour != "#000000") colour = "#FFFFFF" shadeColour = "#000000" @@ -61,6 +64,9 @@ uses = 0 /obj/item/pen/crayon/rainbow/attack_self(mob/living/user) + . = ..(user) + if(.) + return TRUE var/new_colour = tgui_color_picker(user, "Please select the main colour.", "Crayon colour", colour) if(new_colour) colour = new_colour @@ -192,6 +198,9 @@ uses = 0 /obj/item/pen/crayon/marker/mime/attack_self(mob/living/user) //inversion + . = ..(user) + if(.) + return TRUE if(colour != "#FFFFFF" && shadeColour != "#000000") colour = "#FFFFFF" shadeColour = "#000000" @@ -210,6 +219,9 @@ uses = 0 /obj/item/pen/crayon/marker/rainbow/attack_self(mob/living/user) + . = ..(user) + if(.) + return TRUE var/new_colour = tgui_color_picker(user, "Please select the main colour.", "Marker colour", colour) if(new_colour) colour = new_colour @@ -234,6 +246,3 @@ qdel(src) else ..() - -/obj/item/pen/crayon/attack_self(var/mob/user) - return diff --git a/code/game/objects/items/devices/aicard.dm b/code/game/objects/items/devices/aicard.dm index 749c551eaf..7f00e0970a 100644 --- a/code/game/objects/items/devices/aicard.dm +++ b/code/game/objects/items/devices/aicard.dm @@ -22,6 +22,9 @@ to_chat(user, span_infoplain(span_bold("ERROR ERROR ERROR"))) /obj/item/aicard/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE tgui_interact(user) /obj/item/aicard/tgui_interact(mob/user, datum/tgui/ui = null, datum/tgui_state/custom_state) diff --git a/code/game/objects/items/devices/binoculars.dm b/code/game/objects/items/devices/binoculars.dm index 347083aaac..66d31ae46b 100644 --- a/code/game/objects/items/devices/binoculars.dm +++ b/code/game/objects/items/devices/binoculars.dm @@ -14,6 +14,9 @@ //matter = list(MAT_STEEL = 50, MAT_GLASS = 50) /obj/item/binoculars/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE zoom() /obj/item/binoculars/spyglass diff --git a/code/game/objects/items/devices/body_snatcher_vr.dm b/code/game/objects/items/devices/body_snatcher_vr.dm index 568a518957..7b8f781f3d 100644 --- a/code/game/objects/items/devices/body_snatcher_vr.dm +++ b/code/game/objects/items/devices/body_snatcher_vr.dm @@ -104,6 +104,9 @@ else to_chat(user,span_warning(" A warning pops up on the LED display on the side of the device, informing you that the target is not able to have their mind swapped with!")) -/obj/item/bodysnatcher/attack_self(mob/living/user) - to_chat(user,span_warning(" A message pops up on the LED display, informing you that you that the mind transfer to yourself was successful... Wait, did that even do anything?")) - return +/obj/item/bodysnatcher/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE + to_chat(user,span_warning(" A message pops up on the LED display, informing you that you that the mind transfer to yourself was successful... Wait, did that even do anything?")) + return diff --git a/code/game/objects/items/devices/chameleonproj.dm b/code/game/objects/items/devices/chameleonproj.dm index 9fc31b3830..d2d0f93105 100644 --- a/code/game/objects/items/devices/chameleonproj.dm +++ b/code/game/objects/items/devices/chameleonproj.dm @@ -29,6 +29,9 @@ ..() /obj/item/chameleon/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE toggle(user) /obj/item/chameleon/afterattack(atom/target, mob/user, proximity) diff --git a/code/game/objects/items/devices/communicator/communicator.dm b/code/game/objects/items/devices/communicator/communicator.dm index bb851b890d..54a356f766 100644 --- a/code/game/objects/items/devices/communicator/communicator.dm +++ b/code/game/objects/items/devices/communicator/communicator.dm @@ -224,6 +224,9 @@ // Description: Makes an exonet datum if one does not exist, allocates an address for it, maintains the lists of all devies, clears the alert icon, and // finally makes NanoUI appear. /obj/item/communicator/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE initialize_exonet(user) alert_called = 0 update_icon() diff --git a/code/game/objects/items/devices/e_beacon.dm b/code/game/objects/items/devices/e_beacon.dm index ca8e200ddb..e19486bd08 100644 --- a/code/game/objects/items/devices/e_beacon.dm +++ b/code/game/objects/items/devices/e_beacon.dm @@ -24,6 +24,9 @@ gps_tag = "EMERGENCY BEACON" /obj/item/emergency_beacon/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE var/T = user.loc if(!beacon_active) if(!isturf(T)) diff --git a/code/game/objects/items/devices/extrapolator.dm b/code/game/objects/items/devices/extrapolator.dm index 969bce8c55..fddffbce9e 100644 --- a/code/game/objects/items/devices/extrapolator.dm +++ b/code/game/objects/items/devices/extrapolator.dm @@ -62,7 +62,7 @@ return TRUE /obj/item/extrapolator/attack_self(mob/user) - . = ..() + . = ..(user) playsound(src, 'sound/machines/click.ogg', 50, TRUE) if(scan) icon_state = "extrapolator_sample" diff --git a/code/game/objects/items/devices/flash.dm b/code/game/objects/items/devices/flash.dm index f975280e35..231c33d483 100644 --- a/code/game/objects/items/devices/flash.dm +++ b/code/game/objects/items/devices/flash.dm @@ -28,6 +28,9 @@ /// If the flash can be repaired or not. var/can_repair = TRUE + /// If the flash can only be used once before breaking + var/one_use = FALSE + var/safe_flashes = 2 // How many flashes are kept in 1% breakchance? var/charge_only = FALSE // Does the flash run purely on charge? @@ -120,7 +123,7 @@ update_icon() // Returns true if the device can flash. -/obj/item/flash/proc/check_capacitor(var/mob/user) +/obj/item/flash/proc/check_capacitor(mob/user) //spamming the flash before it's fully charged (60 seconds) increases the chance of it breaking //It will never break on the first use. var/obj/item/cell/battery = power_supply @@ -130,6 +133,12 @@ if(times_used <= max_flashes && battery && battery.charge >= charge_cost) last_used = world.time + if(one_use) + broken = TRUE + if(user) + to_chat(user, span_warning("The bulb has burnt out!")) + update_icon() + return TRUE if(prob( max(0, times_used - safe_flashes) * 2 + (times_used >= safe_flashes)) && can_break) //if you use it 10 times in a minute it has a 30% chance to break. broken = TRUE if(user) @@ -243,7 +252,10 @@ return TRUE -/obj/item/flash/attack_self(mob/living/carbon/user as mob, flag = 0, emp = 0) +/obj/item/flash/attack_self(mob/living/carbon/user, flag = 0, emp = 0) + . = ..(user) + if(.) + return TRUE if(!user || !clown_check(user)) return user.setClickCooldown(user.get_attack_speed(src)) @@ -298,21 +310,7 @@ origin_tech = list(TECH_MAGNET = 2, TECH_COMBAT = 1) base_icon = "sflash" can_repair = FALSE - -//attack_as_weapon -/obj/item/flash/synthetic/attack(mob/living/M, mob/living/user, var/target_zone) - ..() - if(!broken) - broken = 1 - to_chat(user, span_warning("The bulb has burnt out!")) - update_icon() - -/obj/item/flash/synthetic/attack_self(mob/living/carbon/user as mob, flag = 0, emp = 0) - ..() - if(!broken) - broken = 1 - to_chat(user, span_warning("The bulb has burnt out!")) - update_icon() + one_use = TRUE /obj/item/flash/robot name = "mounted flash" diff --git a/code/game/objects/items/devices/flashlight.dm b/code/game/objects/items/devices/flashlight.dm index d69845e93a..5b038d8de0 100644 --- a/code/game/objects/items/devices/flashlight.dm +++ b/code/game/objects/items/devices/flashlight.dm @@ -1,3 +1,4 @@ +#define CAN_USE "can_use" /* * Contains: * Flashlights @@ -37,6 +38,9 @@ pickup_sound = 'sound/items/pickup/device.ogg' drop_sound = 'sound/items/drop/device.ogg' + ///Var for attack_self chain + var/special_handling = FALSE + /obj/item/flashlight/Initialize(mapload) . = ..() @@ -89,25 +93,30 @@ . += "It appears to have a high amount of power remaining." /obj/item/flashlight/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE + if(special_handling) + return FALSE if(flickering) to_chat(user, "The light is currently malfunctioning and you're unable to adjust it!") //To prevent some lighting anomalities. - return + return FALSE if(power_use) if(!isturf(user.loc)) to_chat(user, "You cannot turn the light on while in this [user.loc].") //To prevent some lighting anomalities. - return 0 + return FALSE if(!cell || cell.charge == 0) to_chat(user, "You flick the switch on [src], but nothing happens.") - return 0 + return FALSE on = !on if(on && power_use) START_PROCESSING(SSobj, src) else if(power_use) STOP_PROCESSING(SSobj, src) - playsound(src, 'sound/weapons/empty.ogg', 15, 1, -3) // VOREStation Edit + playsound(src, 'sound/weapons/empty.ogg', 15, 1, -3) update_brightness() user.update_mob_action_buttons() - return 1 + return CAN_USE /obj/item/flashlight/attack(mob/living/M as mob, mob/living/user as mob) add_fingerprint(user) @@ -430,20 +439,20 @@ update_brightness() /obj/item/flashlight/flare/attack_self(mob/user) - + . = ..(user) + if(.) + return TRUE // Usual checks if(!fuel) to_chat(user, span_notice("It's out of fuel.")) return if(on) return - - . = ..() // All good, turn it on. - if(.) + if(. == CAN_USE) user.visible_message(span_notice("[user] activates the flare."), span_notice("You pull the cord on the flare, activating it!")) - src.force = on_damage - src.damtype = BURN + force = on_damage + damtype = BURN START_PROCESSING(SSobj, src) /obj/item/flashlight/flare/proc/ignite() //Used for flare launchers. @@ -488,15 +497,16 @@ update_brightness() /obj/item/flashlight/glowstick/attack_self(mob/user) - + . = ..(user) + if(.) + return TRUE if(!fuel) to_chat(user, span_notice("The glowstick has already been turned on.")) return if(on) return - . = ..() - if(.) + if(. == CAN_USE) user.visible_message(span_notice("[user] cracks and shakes \the [name]."), span_notice("You crack and shake \the [src], turning it on!")) START_PROCESSING(SSobj, src) @@ -537,3 +547,5 @@ light_range = 8 light_power = 0.1 light_color = "#49F37C" + +#undef CAN_USE diff --git a/code/game/objects/items/devices/floor_painter.dm b/code/game/objects/items/devices/floor_painter.dm index 644523f8cf..5604ce210e 100644 --- a/code/game/objects/items/devices/floor_painter.dm +++ b/code/game/objects/items/devices/floor_painter.dm @@ -106,7 +106,10 @@ new painting_decal(F, painting_dir, painting_colour) -/obj/item/floor_painter/attack_self(var/mob/user) +/obj/item/floor_painter/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE var/choice = tgui_alert(user, "Do you wish to change the decal type, paint direction, or paint colour?", "Modify What?", list("Decal","Direction","Colour","Cancel")) if(choice == "Cancel") return diff --git a/code/game/objects/items/devices/geiger.dm b/code/game/objects/items/devices/geiger.dm index 94f1aac862..21ae4bcbbe 100644 --- a/code/game/objects/items/devices/geiger.dm +++ b/code/game/objects/items/devices/geiger.dm @@ -12,6 +12,7 @@ var/scanning = 0 var/radiation_count = 0 var/datum/looping_sound/geiger/soundloop + var/mounted = FALSE pickup_sound = 'sound/items/pickup/device.ogg' drop_sound = 'sound/items/drop/device.ogg' @@ -61,7 +62,12 @@ loop.last_radiation = radiation_count loop.start() -/obj/item/geiger/attack_self(var/mob/user) +/obj/item/geiger/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE + if(mounted) + return scanning = !scanning if(scanning) START_PROCESSING(SSobj, src) @@ -109,6 +115,7 @@ var/number = 0 var/last_tick //used to delay the powercheck var/wiresexposed = 0 + mounted = TRUE /obj/item/geiger/wall/Initialize(mapload) START_PROCESSING(SSobj, src) @@ -120,7 +127,10 @@ QDEL_NULL(soundloop) return ..() -/obj/item/geiger/wall/attack_self(var/mob/user) +/obj/item/geiger/wall/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE scanning = !scanning update_icon() update_sound() diff --git a/code/game/objects/items/devices/gold_star_printer.dm b/code/game/objects/items/devices/gold_star_printer.dm index fbf9ec67fb..30f6d44852 100644 --- a/code/game/objects/items/devices/gold_star_printer.dm +++ b/code/game/objects/items/devices/gold_star_printer.dm @@ -12,7 +12,9 @@ drop_sound = 'sound/items/drop/device.ogg' /obj/item/gold_star_printer/attack_self(mob/user) - . = ..() + . = ..(user) + if(.) + return TRUE if(last_print + print_cooldown <= world.time) make_star(user) else diff --git a/code/game/objects/items/devices/gps.dm b/code/game/objects/items/devices/gps.dm index 38fb41a3f8..7dce82f98d 100644 --- a/code/game/objects/items/devices/gps.dm +++ b/code/game/objects/items/devices/gps.dm @@ -26,6 +26,9 @@ GLOBAL_LIST_EMPTY(GPS_list) pickup_sound = 'sound/items/pickup/device.ogg' drop_sound = 'sound/items/drop/device.ogg' + ///Var for attack_self chain + var/special_handling = FALSE + /obj/item/gps/Initialize(mapload) . = ..() compass = new(src) @@ -182,6 +185,11 @@ GLOBAL_LIST_EMPTY(GPS_list) add_overlay("working") /obj/item/gps/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE + if(special_handling) + return FALSE display(user) // Compiles all the data not available directly from the GPS diff --git a/code/game/objects/items/devices/holowarrant.dm b/code/game/objects/items/devices/holowarrant.dm index 5e4eaa4a1b..d466dcc222 100644 --- a/code/game/objects/items/devices/holowarrant.dm +++ b/code/game/objects/items/devices/holowarrant.dm @@ -23,7 +23,10 @@ . += span_notice("You have to go closer if you want to read it.") //hit yourself with it -/obj/item/holowarrant/attack_self(mob/living/user as mob) +/obj/item/holowarrant/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE active = null var/list/warrants = list() if(!isnull(GLOB.data_core.general)) diff --git a/code/game/objects/items/devices/lightreplacer.dm b/code/game/objects/items/devices/lightreplacer.dm index 01f0219010..cb8c909abf 100644 --- a/code/game/objects/items/devices/lightreplacer.dm +++ b/code/game/objects/items/devices/lightreplacer.dm @@ -56,6 +56,9 @@ pickup_sound = 'sound/items/pickup/device.ogg' drop_sound = 'sound/items/drop/device.ogg' + ///For attack_self chain + var/special_handling = FALSE + /obj/item/lightreplacer/Initialize(mapload) . = ..() failmsg = "The [name]'s refill light blinks red." @@ -129,6 +132,11 @@ to_chat(user, span_notice("You fill \the [src] with lights from \the [S].")) /obj/item/lightreplacer/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE + if(special_handling) + return FALSE /* // This would probably be a bit OP. If you want it though, uncomment the code. if(isrobot(user)) var/mob/living/silicon/robot/R = user @@ -250,6 +258,9 @@ . += "It is currently coloring lights." /obj/item/lightpainter/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE if(!resetmode) resetmode = 1 diff --git a/code/game/objects/items/devices/locker_painter.dm b/code/game/objects/items/devices/locker_painter.dm index 141f9a6e25..a69eba55dd 100644 --- a/code/game/objects/items/devices/locker_painter.dm +++ b/code/game/objects/items/devices/locker_painter.dm @@ -119,7 +119,10 @@ to_chat(user, span_warning("\The [src] flashes an error light. You might need to reconfigure it.")) return -/obj/item/closet_painter/attack_self(var/mob/user) +/obj/item/closet_painter/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE var/choice = tgui_alert(user, "Do you wish to change the regular closet color or the secure closet color?", "Color Selection", list("Regular Closet Colour","Cancel","Secure Closet Colour")) if(choice == "Regular Closet Colour") choose_colour() diff --git a/code/game/objects/items/devices/megaphone.dm b/code/game/objects/items/devices/megaphone.dm index f9433e18f0..e40e8b6f86 100644 --- a/code/game/objects/items/devices/megaphone.dm +++ b/code/game/objects/items/devices/megaphone.dm @@ -42,7 +42,10 @@ else user.audible_message(span_infoplain(span_bold("[user.GetVoice()]") + "[user.GetAltName()] broadcasts, " + span_large("\"[message]\"")), runemessage = message) -/obj/item/megaphone/attack_self(var/mob/living/user) +/obj/item/megaphone/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE var/message = tgui_input_text(user, "Shout a message?", "Megaphone", null, MAX_MESSAGE_LEN) if(!message) return diff --git a/code/game/objects/items/devices/multitool.dm b/code/game/objects/items/devices/multitool.dm index b26bb1e4b0..d88b6ef31e 100644 --- a/code/game/objects/items/devices/multitool.dm +++ b/code/game/objects/items/devices/multitool.dm @@ -32,7 +32,22 @@ toolspeed = 1 tool_qualities = list(TOOL_MULTITOOL) + var/uplink = FALSE + /obj/item/multitool/attack_self(mob/living/user) + . = ..(user) + if(.) + return TRUE + if(uplink) + return + + if(selected_io) + selected_io = null + to_chat(user, span_notice("You clear the wired connection from the multitool.")) + update_icon() + return + + update_icon() var/choice = tgui_alert(user, "What do you want to do with \the [src]?", "Multitool Menu", list("Switch Mode", "Clear Buffers", "Cancel")) switch(choice) if("Clear Buffers") @@ -52,8 +67,6 @@ update_icon() - return ..() - /obj/item/multitool/proc/mode_switch(mob/living/user) if(mode_index + 1 > modes.len) mode_index = 1 diff --git a/code/game/objects/items/devices/paicard.dm b/code/game/objects/items/devices/paicard.dm index 909fb1c27a..e0603d8978 100644 --- a/code/game/objects/items/devices/paicard.dm +++ b/code/game/objects/items/devices/paicard.dm @@ -19,6 +19,9 @@ pickup_sound = 'sound/items/pickup/device.ogg' drop_sound = 'sound/items/drop/device.ogg' + ///Var for attack_self chain + var/special_handling = FALSE + /obj/item/paicard/relaymove(var/mob/user, var/direction) if(user.stat || user.stunned) return diff --git a/code/game/objects/items/devices/paicard_vr.dm b/code/game/objects/items/devices/paicard_vr.dm index 731784e35f..e9db9a1806 100644 --- a/code/game/objects/items/devices/paicard_vr.dm +++ b/code/game/objects/items/devices/paicard_vr.dm @@ -216,7 +216,12 @@ GLOBAL_LIST_EMPTY(paikeys) else to_chat(user, span_warning("You would need to remove the installed [I] first!")) -/obj/item/paicard/attack_self(mob/user) +/obj/item/paicard/attack_self(mob/user, callback) + . = ..(user) + if(.) + return TRUE + if(special_handling && !callback) + return FALSE if(!panel_open) access_screen(user) return diff --git a/code/game/objects/items/devices/pipe_painter.dm b/code/game/objects/items/devices/pipe_painter.dm index 65cffc51b2..67dbf33731 100644 --- a/code/game/objects/items/devices/pipe_painter.dm +++ b/code/game/objects/items/devices/pipe_painter.dm @@ -25,7 +25,10 @@ P.change_color(GLOB.pipe_colors[mode]) -/obj/item/pipe_painter/attack_self(mob/user as mob) +/obj/item/pipe_painter/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE var/new_mode = tgui_input_list(user, "Which colour do you want to use?", "Pipe painter", modes) if(!new_mode) return diff --git a/code/game/objects/items/devices/radio/beacon.dm b/code/game/objects/items/devices/radio/beacon.dm index 87c067ae80..3dd8f11a9e 100644 --- a/code/game/objects/items/devices/radio/beacon.dm +++ b/code/game/objects/items/devices/radio/beacon.dm @@ -34,8 +34,12 @@ GLOBAL_LIST_BOILERPLATE(all_beacons, /obj/item/radio/beacon) name = "suspicious beacon" desc = "A label on it reads: Activate to have a singularity beacon teleported to your location." origin_tech = list(TECH_BLUESPACE = 1, TECH_ILLEGAL = 7) + beacon = TRUE -/obj/item/radio/beacon/syndicate/attack_self(mob/user as mob) +/obj/item/radio/beacon/syndicate/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE if(user) to_chat(user, span_notice("Locked In")) new /obj/machinery/power/singularity_beacon/syndicate( user.loc ) diff --git a/code/game/objects/items/devices/radio/electropack.dm b/code/game/objects/items/devices/radio/electropack.dm index e07a5ef794..eec4a83b9f 100644 --- a/code/game/objects/items/devices/radio/electropack.dm +++ b/code/game/objects/items/devices/radio/electropack.dm @@ -14,6 +14,7 @@ matter = list(MAT_STEEL = 10000,MAT_GLASS = 2500) var/code = 2 + electric_pack = TRUE /obj/item/radio/electropack/attack_hand(mob/living/user as mob) if(src == user.back) @@ -104,8 +105,10 @@ master.receive_signal() return -/obj/item/radio/electropack/attack_self(mob/user as mob, flag1) - +/obj/item/radio/electropack/attack_self(mob/user, flag1) + . = ..(user) + if(.) + return TRUE if(!ishuman(user)) return user.set_machine(src) diff --git a/code/game/objects/items/devices/radio/jammer.dm b/code/game/objects/items/devices/radio/jammer.dm index da01a16e6b..ae064e9273 100644 --- a/code/game/objects/items/devices/radio/jammer.dm +++ b/code/game/objects/items/devices/radio/jammer.dm @@ -85,6 +85,9 @@ GLOBAL_LIST_EMPTY(active_radio_jammers) return ..() /obj/item/radio_jammer/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE if(on) turn_off(user) else diff --git a/code/game/objects/items/devices/radio/radio.dm b/code/game/objects/items/devices/radio/radio.dm index 1765e7a650..789331a1ca 100644 --- a/code/game/objects/items/devices/radio/radio.dm +++ b/code/game/objects/items/devices/radio/radio.dm @@ -44,6 +44,11 @@ var/datum/radio_frequency/radio_connection var/list/datum/radio_frequency/secure_radio_connections + ///If we're a syndicate beacon or not. + var/beacon = FALSE + var/electric_pack = FALSE + var/uplink = FALSE + /obj/item/radio/proc/set_frequency(new_frequency) SSradio.remove_object(src, frequency) frequency = new_frequency @@ -115,7 +120,12 @@ /obj/item/radio/proc/recalculateChannels() return -/obj/item/radio/attack_self(mob/user as mob) +/obj/item/radio/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE + if(beacon || electric_pack || uplink) + return interact(user) /obj/item/radio/interact(mob/user) diff --git a/code/game/objects/items/devices/scanners/gas.dm b/code/game/objects/items/devices/scanners/gas.dm index 29e07259a1..d1ce316a34 100644 --- a/code/game/objects/items/devices/scanners/gas.dm +++ b/code/game/objects/items/devices/scanners/gas.dm @@ -17,6 +17,9 @@ pickup_sound = 'sound/items/pickup/device.ogg' drop_sound = 'sound/items/drop/device.ogg' + ///Var for attack_self chain + var/special_handling = FALSE + /obj/item/analyzer/atmosanalyze(var/mob/user) var/air = user.return_air() if (!air) @@ -24,7 +27,12 @@ return atmosanalyzer_scan(src, air, user) -/obj/item/analyzer/attack_self(mob/user as mob) +/obj/item/analyzer/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE + if(special_handling) + return FALSE if (user.stat) return if (!user.IsAdvancedToolUser()) diff --git a/code/game/objects/items/devices/scanners/mass_spectrometer.dm b/code/game/objects/items/devices/scanners/mass_spectrometer.dm index d578560943..69e43daa8f 100644 --- a/code/game/objects/items/devices/scanners/mass_spectrometer.dm +++ b/code/game/objects/items/devices/scanners/mass_spectrometer.dm @@ -31,7 +31,10 @@ else icon_state = initial(icon_state) -/obj/item/mass_spectrometer/attack_self(mob/user as mob) +/obj/item/mass_spectrometer/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE if (user.stat) return if (!user.IsAdvancedToolUser()) diff --git a/code/game/objects/items/devices/scanners/sleevemate.dm b/code/game/objects/items/devices/scanners/sleevemate.dm index 27a3326ecc..76f6f6b50b 100644 --- a/code/game/objects/items/devices/scanners/sleevemate.dm +++ b/code/game/objects/items/devices/scanners/sleevemate.dm @@ -97,6 +97,9 @@ var/global/mob/living/carbon/human/dummy/mannequin/sleevemate_mob to_chat(user,span_warning("Not a compatible subject to work with!")) /obj/item/sleevemate/attack_self(mob/living/user) + . = ..(user) + if(.) + return TRUE if(!stored_mind) to_chat(user,span_warning("No stored mind in \the [src].")) return diff --git a/code/game/objects/items/devices/spy_bug.dm b/code/game/objects/items/devices/spy_bug.dm index 04977ded8f..6b95136bfc 100644 --- a/code/game/objects/items/devices/spy_bug.dm +++ b/code/game/objects/items/devices/spy_bug.dm @@ -26,11 +26,13 @@ camera = new camtype(src) /obj/item/camerabug/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE if(user.a_intent == I_HURT) to_chat(user, span_notice("You crush the [src] under your foot, breaking it.")) visible_message(span_notice("[user.name] crushes the [src] under their foot, breaking it!")) new brokentype(get_turf(src)) - spawn(0) qdel(src) /* else radio.interact(user) @@ -170,7 +172,9 @@ radio = new(src) */ /obj/item/bug_monitor/attack_self(mob/user) -// radio.attack_self(user) + . = ..(user) + if(.) + return TRUE view_cameras(user) /obj/item/bug_monitor/attackby(obj/item/W as obj, mob/living/user as mob) diff --git a/code/game/objects/items/devices/suit_cooling.dm b/code/game/objects/items/devices/suit_cooling.dm index ca77fa3bbb..99b009d17b 100644 --- a/code/game/objects/items/devices/suit_cooling.dm +++ b/code/game/objects/items/devices/suit_cooling.dm @@ -123,7 +123,10 @@ STOP_PROCESSING(SSobj, src) update_icon() -/obj/item/suit_cooling_unit/attack_self(var/mob/user) +/obj/item/suit_cooling_unit/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE if(cover_open && cell) if(ishuman(user)) user.put_in_hands(cell) diff --git a/code/game/objects/items/devices/t_scanner.dm b/code/game/objects/items/devices/t_scanner.dm index 6e5ec60570..dc9045d02c 100644 --- a/code/game/objects/items/devices/t_scanner.dm +++ b/code/game/objects/items/devices/t_scanner.dm @@ -25,6 +25,9 @@ icon_state = "t-ray[on]" /obj/item/t_scanner/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE set_active(!on) /obj/item/t_scanner/proc/set_active(var/active) diff --git a/code/game/objects/items/devices/taperecorder.dm b/code/game/objects/items/devices/taperecorder.dm index f00cb2ed40..ad07d98e8d 100644 --- a/code/game/objects/items/devices/taperecorder.dm +++ b/code/game/objects/items/devices/taperecorder.dm @@ -342,6 +342,9 @@ /obj/item/taperecorder/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE if(recording || playing) stop() else @@ -387,6 +390,9 @@ ruin() /obj/item/rectape/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE if(!ruined) to_chat(user, span_notice("You pull out all the tape!")) ruin() diff --git a/code/game/objects/items/devices/text_to_speech.dm b/code/game/objects/items/devices/text_to_speech.dm index 00f112f3d8..e2bd453949 100644 --- a/code/game/objects/items/devices/text_to_speech.dm +++ b/code/game/objects/items/devices/text_to_speech.dm @@ -6,7 +6,10 @@ w_class = ITEMSIZE_SMALL var/named -/obj/item/text_to_speech/attack_self(mob/user as mob) +/obj/item/text_to_speech/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE if(user.incapacitated(INCAPACITATION_KNOCKDOWN|INCAPACITATION_DISABLED)) // EDIT: We can use the device only if we are not in certain types of incapacitation. We don't want chairs stopping us from texting!! to_chat(user, "You cannot activate the device in your state.") return diff --git a/code/game/objects/items/devices/ticket_printer.dm b/code/game/objects/items/devices/ticket_printer.dm index 1a51c3cd33..e0dd720c0a 100644 --- a/code/game/objects/items/devices/ticket_printer.dm +++ b/code/game/objects/items/devices/ticket_printer.dm @@ -10,7 +10,7 @@ drop_sound = 'sound/items/drop/device.ogg' /obj/item/ticket_printer/attack_self(mob/user) - . = ..() + . = ..(user) if(last_print + print_cooldown <= world.time) print_a_ticket(user) else diff --git a/code/game/objects/items/devices/traitordevices.dm b/code/game/objects/items/devices/traitordevices.dm index 9c75a312d5..646c91246a 100644 --- a/code/game/objects/items/devices/traitordevices.dm +++ b/code/game/objects/items/devices/traitordevices.dm @@ -32,7 +32,10 @@ effective or pretty fucking useless. pickup_sound = 'sound/items/pickup/device.ogg' drop_sound = 'sound/items/drop/device.ogg' -/obj/item/batterer/attack_self(mob/living/carbon/user as mob, flag = 0, emp = 0) +/obj/item/batterer/attack_self(mob/user, flag = 0, emp = 0) + . = ..(user) + if(.) + return TRUE if(!user) return if(times_used >= max_uses) to_chat(user, span_warning("The mind batterer has been burnt out!")) diff --git a/code/game/objects/items/devices/transfer_valve.dm b/code/game/objects/items/devices/transfer_valve.dm index e6b09f37ea..6eb0c71c1c 100644 --- a/code/game/objects/items/devices/transfer_valve.dm +++ b/code/game/objects/items/devices/transfer_valve.dm @@ -72,6 +72,9 @@ sense_proximity(callback = TYPE_PROC_REF(/atom,HasProximity)) /obj/item/transfer_valve/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE tgui_interact(user) /obj/item/transfer_valve/tgui_state(mob/user) diff --git a/code/game/objects/items/devices/translator.dm b/code/game/objects/items/devices/translator.dm index ff6e9c2460..5066700d48 100644 --- a/code/game/objects/items/devices/translator.dm +++ b/code/game/objects/items/devices/translator.dm @@ -15,6 +15,9 @@ drop_sound = 'sound/items/drop/device.ogg' /obj/item/universal_translator/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE if(!listening) //Turning ON langset = tgui_input_list(user,"Translate to which of your languages?","Language Selection", user.languages) if(langset) diff --git a/code/game/objects/items/devices/translocator_vr.dm b/code/game/objects/items/devices/translocator_vr.dm index f32f789886..c670ebfc52 100644 --- a/code/game/objects/items/devices/translocator_vr.dm +++ b/code/game/objects/items/devices/translocator_vr.dm @@ -34,6 +34,9 @@ pickup_sound = 'sound/items/pickup/device.ogg' drop_sound = 'sound/items/drop/device.ogg' + ///Var for attack_self chain + var/special_handling = FALSE + /obj/item/perfect_tele/Initialize(mapload) . = ..() @@ -115,6 +118,11 @@ return TRUE /obj/item/perfect_tele/attack_self(mob/user, var/radial_menu_anchor = src) + . = ..(user) + if(.) + return TRUE + if(special_handling) + return FALSE if(loc_network) for(var/obj/item/perfect_tele_beacon/stationary/nb in GLOB.premade_tele_beacons) if(nb.tele_network == loc_network) @@ -404,6 +412,9 @@ not carry this around."}, "OOC Warning", list("Take It","Leave It")) GLOBAL_LIST_BOILERPLATE(premade_tele_beacons, /obj/item/perfect_tele_beacon/stationary) /obj/item/perfect_tele_beacon/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE if(!isliving(user)) return var/mob/living/L = user diff --git a/code/game/objects/items/devices/tvcamera.dm b/code/game/objects/items/devices/tvcamera.dm index 4e50da983c..fac5d6e678 100644 --- a/code/game/objects/items/devices/tvcamera.dm +++ b/code/game/objects/items/devices/tvcamera.dm @@ -48,6 +48,9 @@ . = ..() /obj/item/tvcamera/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE add_fingerprint(user) user.set_machine(src) show_ui(user) diff --git a/code/game/objects/items/devices/uplink.dm b/code/game/objects/items/devices/uplink.dm index c6ae8ee2bc..819713775c 100644 --- a/code/game/objects/items/devices/uplink.dm +++ b/code/game/objects/items/devices/uplink.dm @@ -217,20 +217,33 @@ // // Includes normal radio uplink, multitool uplink, // implant uplink (not the implant tool) and a preset headset uplink. + +/obj/item/radio/uplink + uplink = TRUE + /obj/item/radio/uplink/Initialize(mapload) . = ..() hidden_uplink = new(src) icon_state = "radio" -/obj/item/radio/uplink/attack_self(mob/user as mob) +/obj/item/radio/uplink/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE if(hidden_uplink) hidden_uplink.trigger(user) +/obj/item/multitool/uplink + uplink = TRUE + /obj/item/multitool/uplink/Initialize(mapload) . = ..() hidden_uplink = new(src) -/obj/item/multitool/uplink/attack_self(mob/user as mob) +/obj/item/multitool/uplink/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE if(hidden_uplink) hidden_uplink.trigger(user) diff --git a/code/game/objects/items/devices/vacpack.dm b/code/game/objects/items/devices/vacpack.dm index f7c20bfff9..00128f9e0f 100644 --- a/code/game/objects/items/devices/vacpack.dm +++ b/code/game/objects/items/devices/vacpack.dm @@ -23,7 +23,10 @@ var/vac_owner = null flags = NOBLUDGEON -/obj/item/vac_attachment/attack_self(mob/living/user) +/obj/item/vac_attachment/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE var/set_input = null if(!output_dest) set_input = "output destination" diff --git a/code/game/objects/items/devices/whistle.dm b/code/game/objects/items/devices/whistle.dm index 9581e9ad29..02f17762e4 100644 --- a/code/game/objects/items/devices/whistle.dm +++ b/code/game/objects/items/devices/whistle.dm @@ -31,7 +31,10 @@ to_chat(usr, "You configure the hailer to shout \"[use_message]\".") -/obj/item/hailer/attack_self(mob/living/carbon/user as mob) +/obj/item/hailer/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE if (spamcheck) return diff --git a/code/game/objects/items/glassjar.dm b/code/game/objects/items/glassjar.dm index a82448f401..18b0dc1ace 100644 --- a/code/game/objects/items/glassjar.dm +++ b/code/game/objects/items/glassjar.dm @@ -17,6 +17,11 @@ drop_sound = 'sound/items/drop/glass.ogg' pickup_sound = 'sound/items/pickup/glass.ogg' + ///If we can fill it with water + var/can_fill = FALSE + ///If we are filled with water. + var/filled = FALSE + /obj/item/glass_jar/Initialize(mapload) . = ..() update_icon() @@ -24,6 +29,16 @@ /obj/item/glass_jar/afterattack(var/atom/A, var/mob/user, var/proximity) if(!proximity || contains) return + if(can_fill && !filled) + if(istype(A, /obj/structure/sink) || istype(A, /turf/simulated/floor/water)) + if(contains && user.a_intent == I_HELP) + to_chat(user, span_warning("That probably isn't the best idea.")) + return + + to_chat(user, span_notice("You fill \the [src] with water!")) + filled = TRUE + update_icon() + return if(istype(A, /mob)) var/accept = 0 for(var/D in accept_mobs) @@ -47,7 +62,30 @@ update_icon() return -/obj/item/glass_jar/attack_self(var/mob/user) +/obj/item/glass_jar/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE + + //For the fish jars + if(can_fill && filled) + if(contains == JAR_ANIMAL) + if(user.a_intent == I_HELP) + to_chat(user, span_notice("Maybe you shouldn't empty the water...")) + return + + else + filled = FALSE + user.visible_message(span_warning("[user] dumps out \the [src]'s water!")) + update_icon() + return + + else + user.visible_message(span_notice("[user] dumps \the [src]'s water.")) + filled = FALSE + update_icon() + return + switch(contains) if(JAR_MONEY) for(var/obj/O in src) @@ -87,13 +125,20 @@ /obj/item/glass_jar/update_icon() // Also updates name and desc underlays.Cut() cut_overlays() + + if(filled) + underlays += image(icon, "[icon_state]_water") + switch(contains) if(JAR_NOTHING) name = initial(name) desc = initial(desc) if(JAR_MONEY) - name = "tip jar" - desc = "A small jar with money inside." + if(can_fill) + name = "tip tank" + else + name = "tip jar" + desc = "A [name] with money inside." for(var/obj/item/spacecash/S in src) var/image/money = image(S.icon, S.icon_state) money.pixel_x = rand(-2, 3) @@ -101,31 +146,52 @@ money.transform *= 0.6 underlays += money if(JAR_ANIMAL) - for(var/mob/M in src) - var/image/victim = image(M.icon, M.icon_state) - victim.pixel_y = 6 - victim.color = M.color - if(M.plane == PLANE_LIGHTING_ABOVE) // This will only show up on the ground sprite, due to the HuD being over it, so we need both images. - var/image/victim_glow = image(M.icon, M.icon_state) - victim_glow.pixel_y = 6 - victim_glow.color = M.color - underlays += victim_glow - underlays += victim - name = "glass jar with [M]" - desc = "A small jar with [M] inside." + //tank + if(can_fill) + for(var/mob/M in src) + var/image/victim = image(M.icon, M.icon_state) + var/initial_x_scale = M.icon_scale_x + var/initial_y_scale = M.icon_scale_y + M.adjust_scale(0.7) + victim.appearance = M.appearance + M.adjust_scale(initial_x_scale, initial_y_scale) + victim.pixel_y = 4 + underlays += victim + name = "[name] with [M]" + desc = "A large [name] with [M] inside." + else + for(var/mob/M in src) + var/image/victim = image(M.icon, M.icon_state) + victim.pixel_y = 6 + victim.color = M.color + if(M.plane == PLANE_LIGHTING_ABOVE) // This will only show up on the ground sprite, due to the HuD being over it, so we need both images. + var/image/victim_glow = image(M.icon, M.icon_state) + victim_glow.pixel_y = 6 + victim_glow.color = M.color + underlays += victim_glow + underlays += victim + name = "glass jar with [M]" + desc = "A small jar with [M] inside." if(JAR_SPIDER) for(var/obj/effect/spider/spiderling/S in src) var/image/victim = image(S.icon, S.icon_state) underlays += victim - name = "glass jar with [S]" - desc = "A small jar with [S] inside." - return + if(can_fill) + name = "[name] with [S]" + desc = "A large tank with [S] inside." + else + name = "glass jar with [S]" + desc = "A small jar with [S] inside." + underlays += victim + + if(filled) + desc = "[desc] It contains water." /obj/item/glass_jar/fish name = "glass tank" desc = "A large glass tank." - var/filled = FALSE + can_fill = TRUE w_class = ITEMSIZE_NORMAL @@ -136,85 +202,6 @@ desc = "A large plastic tank." matter = list(MAT_PLASTIC = 4000) -/obj/item/glass_jar/fish/update_icon() // Also updates name and desc - underlays.Cut() - cut_overlays() - - if(filled) - underlays += image(icon, "[icon_state]_water") - - switch(contains) - if(JAR_NOTHING) - name = initial(name) - desc = initial(desc) - if(JAR_MONEY) - name = "tip tank" - desc = "A large [name] with money inside." - for(var/obj/item/spacecash/S in src) - var/image/money = image(S.icon, S.icon_state) - money.pixel_x = rand(-2, 3) - money.pixel_y = rand(-6, 6) - money.transform *= 0.6 - underlays += money - if(JAR_ANIMAL) - for(var/mob/M in src) - var/image/victim = image(M.icon, M.icon_state) - var/initial_x_scale = M.icon_scale_x - var/initial_y_scale = M.icon_scale_y - M.adjust_scale(0.7) - victim.appearance = M.appearance - M.adjust_scale(initial_x_scale, initial_y_scale) - victim.pixel_y = 4 - underlays += victim - name = "[name] with [M]" - desc = "A large [name] with [M] inside." - if(JAR_SPIDER) - for(var/obj/effect/spider/spiderling/S in src) - var/image/victim = image(S.icon, S.icon_state) - underlays += victim - name = "[name] with [S]" - desc = "A large tank with [S] inside." - - if(filled) - desc = "[desc] It contains water." - - return - -/obj/item/glass_jar/fish/afterattack(var/atom/A, var/mob/user, var/proximity) - if(!filled) - if(istype(A, /obj/structure/sink) || istype(A, /turf/simulated/floor/water)) - if(contains && user.a_intent == I_HELP) - to_chat(user, span_warning("That probably isn't the best idea.")) - return - - to_chat(user, span_notice("You fill \the [src] with water!")) - filled = TRUE - update_icon() - return - - return ..() - -/obj/item/glass_jar/fish/attack_self(var/mob/user) - if(filled) - if(contains == JAR_ANIMAL) - if(user.a_intent == I_HELP) - to_chat(user, span_notice("Maybe you shouldn't empty the water...")) - return - - else - filled = FALSE - user.visible_message(span_warning("[user] dumps out \the [src]'s water!")) - update_icon() - return - - else - user.visible_message(span_notice("[user] dumps \the [src]'s water.")) - filled = FALSE - update_icon() - return - - return ..() - #undef JAR_NOTHING #undef JAR_MONEY #undef JAR_ANIMAL diff --git a/code/game/objects/items/gunbox.dm b/code/game/objects/items/gunbox.dm index 96b049de49..dcf55cb99d 100644 --- a/code/game/objects/items/gunbox.dm +++ b/code/game/objects/items/gunbox.dm @@ -7,7 +7,14 @@ icon = 'icons/obj/storage.dmi' icon_state = "gunbox" w_class = ITEMSIZE_HUGE + ///If the gunbox has custom attack_self code + var/variant_gunbox = FALSE /obj/item/gunbox/attack_self(mob/living/user) + . = ..(user) + if(.) + return TRUE + if(variant_gunbox) + return var/list/options = list() options["M1911 (.45)"] = list(/obj/item/gun/projectile/colt/detective, /obj/item/ammo_magazine/m45/rubber, /obj/item/ammo_magazine/m45/rubber) options["MT Mk58 (.45)"] = list(/obj/item/gun/projectile/sec, /obj/item/ammo_magazine/m45/rubber, /obj/item/ammo_magazine/m45/rubber) @@ -30,7 +37,11 @@ /obj/item/gunbox/stun name = "non-lethal sidearm box" desc = "A secure box containing a non-lethal sidearm." + variant_gunbox = TRUE /obj/item/gunbox/stun/attack_self(mob/living/user) + . = ..(user) + if(.) + return TRUE var/list/options = list() options["Stun Revolver"] = list(/obj/item/gun/energy/stunrevolver/detective, /obj/item/cell/device/weapon, /obj/item/cell/device/weapon) options["Taser"] = list(/obj/item/gun/energy/taser, /obj/item/cell/device/weapon, /obj/item/cell/device/weapon) @@ -52,7 +63,11 @@ name = "centcom sidearm box" desc = "A secure box containing a lethal sidearm used by Central Command." w_class = ITEMSIZE_HUGE + variant_gunbox = TRUE /obj/item/gunbox/centcom/attack_self(mob/living/user) + . = ..(user) + if(.) + return TRUE var/list/options = list() options["Écureuil (10mm)"] = list(/obj/item/gun/projectile/ecureuil, /obj/item/ammo_magazine/m10mm/pistol, /obj/item/ammo_magazine/m10mm/pistol) options["Écureuil Olive (10mm)"] = list(/obj/item/gun/projectile/ecureuil/tac, /obj/item/ammo_magazine/m10mm/pistol, /obj/item/ammo_magazine/m10mm/pistol) diff --git a/code/game/objects/items/gunbox_vr.dm b/code/game/objects/items/gunbox_vr.dm index 3a9a2c4f25..bccdc379e5 100644 --- a/code/game/objects/items/gunbox_vr.dm +++ b/code/game/objects/items/gunbox_vr.dm @@ -6,8 +6,12 @@ desc = "A secure guncase containing the warden's beloved shotgun." icon = 'icons/obj/storage_vr.dmi' icon_state = "gunboxw" + variant_gunbox = TRUE /obj/item/gunbox/warden/attack_self(mob/living/user) + . = ..(user) + if(.) + return TRUE var/list/options = list() options["Warden's combat shotgun"] = list(/obj/item/gun/projectile/shotgun/pump/combat/warden, /obj/item/ammo_magazine/ammo_box/b12g/beanbag) options["Warden's compact shotgun"] = list(/obj/item/gun/projectile/shotgun/compact/warden, /obj/item/ammo_magazine/ammo_box/b12g/beanbag) @@ -30,7 +34,11 @@ desc = "A secure box containing a sidearm befitting of the site manager. Includes both lethal and non-lethal munitions, beware what's loaded!" icon = 'icons/obj/storage.dmi' icon_state = "gunbox" + variant_gunbox = TRUE /obj/item/gunbox/captain/attack_self(mob/living/user) + . = ..(user) + if(.) + return TRUE var/list/options = list() options["M1911 (.45)"] = list(/obj/item/gun/projectile/colt/detective, /obj/item/ammo_magazine/m45/rubber, /obj/item/ammo_magazine/m45) options["MT Mk58 (.45)"] = list(/obj/item/gun/projectile/sec, /obj/item/ammo_magazine/m45/rubber, /obj/item/ammo_magazine/m45) diff --git a/code/game/objects/items/holosign_creator.dm b/code/game/objects/items/holosign_creator.dm index 15663bc005..a03595558a 100644 --- a/code/game/objects/items/holosign_creator.dm +++ b/code/game/objects/items/holosign_creator.dm @@ -46,7 +46,7 @@ to_chat(user, span_notice("[src] is projecting at max capacity!")) /obj/item/holosign_creator/attack_self(mob/user) - . = ..() + . = ..(user) if(.) return if(signs.len) diff --git a/code/game/objects/items/leash.dm b/code/game/objects/items/leash.dm index fceabd4088..4930a436f0 100644 --- a/code/game/objects/items/leash.dm +++ b/code/game/objects/items/leash.dm @@ -98,6 +98,9 @@ //Called when the leash is used in hand //Tugs the pet closer /obj/item/leash/attack_self(mob/living/user) + . = ..(user) + if(.) + return TRUE if(!leash_pet) //No pet, no tug. return //Yank the pet. Yank em in close. diff --git a/code/game/objects/items/magazine.dm b/code/game/objects/items/magazine.dm index bf8ba8264f..dcc51425df 100644 --- a/code/game/objects/items/magazine.dm +++ b/code/game/objects/items/magazine.dm @@ -85,6 +85,9 @@ to_chat(user, "The headline screams, \"[headline]\"") /obj/item/tabloid/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE user.visible_message(span_notice("\The [user] leafs idly through \the [src].")) if(headline) to_chat(user, "Most of it is the usual tabloid garbage, but the headline story, \"[headline]\", holds your attention for awhile.") diff --git a/code/game/objects/items/petrifier.dm b/code/game/objects/items/petrifier.dm index 0e976bef48..231302f5aa 100644 --- a/code/game/objects/items/petrifier.dm +++ b/code/game/objects/items/petrifier.dm @@ -17,8 +17,10 @@ . = ..() linked = to_link -/obj/item/petrifier/attack_self(var/mob/user) - . = ..() +/obj/item/petrifier/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE if (!isturf(user.loc) && user.get_ultimate_mob() != target) to_chat(user, span_warning("The device beeps but does nothing.")) return diff --git a/code/game/objects/items/pizza_voucher_vr.dm b/code/game/objects/items/pizza_voucher_vr.dm index ccff331418..4471a91d6d 100644 --- a/code/game/objects/items/pizza_voucher_vr.dm +++ b/code/game/objects/items/pizza_voucher_vr.dm @@ -21,6 +21,9 @@ desc = "A pocket-sized plastic slip with a button in the middle. \"[pick(descstrings)]\" is written on the back." /obj/item/pizzavoucher/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE add_fingerprint(user) if(!spent) user.visible_message(span_notice("[user] presses a button on [src]!")) diff --git a/code/game/objects/items/poi_items.dm b/code/game/objects/items/poi_items.dm index a9cf44225c..7e1a2841ce 100644 --- a/code/game/objects/items/poi_items.dm +++ b/code/game/objects/items/poi_items.dm @@ -212,8 +212,10 @@ return ..() -/obj/item/poi/broken_drone_circuit/attack_self(mob/living/user as mob) - +/obj/item/poi/broken_drone_circuit/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE user.visible_message(message = "[user] is studiously examining [src]", self_message = "You take your time to analyze the circuit...") var/message = "" @@ -242,7 +244,3 @@ if(do_after(user, delay = 5 SECONDS, target = src)) to_chat(user, message) - - - - ..() diff --git a/code/game/objects/items/robobag.dm b/code/game/objects/items/robobag.dm index 3a466f8cb2..340bb33e4f 100644 --- a/code/game/objects/items/robobag.dm +++ b/code/game/objects/items/robobag.dm @@ -7,14 +7,8 @@ icon_state = "bodybag_folded" item_state = "bodybag_cryo_folded" origin_tech = list(TECH_ENGINEERING = 3) - -/obj/item/bodybag/cryobag/robobag/attack_self(mob/user) - var/obj/structure/closet/body_bag/cryobag/robobag/R = new /obj/structure/closet/body_bag/cryobag/robobag(user.loc) - R.add_fingerprint(user) - if(syringe) - R.syringe = syringe - syringe = null - qdel(src) + robotic = TRUE + cryogenic = FALSE /obj/structure/closet/body_bag/cryobag/robobag name = "synthmorph bag" diff --git a/code/game/objects/items/robot/robot_upgrades.dm b/code/game/objects/items/robot/robot_upgrades.dm index ac3633fcad..b32708f45d 100644 --- a/code/game/objects/items/robot/robot_upgrades.dm +++ b/code/game/objects/items/robot/robot_upgrades.dm @@ -55,7 +55,10 @@ item_state = "cyborg_upgrade" var/heldname = "default name" -/obj/item/borg/upgrade/utility/rename/attack_self(mob/user as mob) +/obj/item/borg/upgrade/utility/rename/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE var/new_name = tgui_input_text(user, "Enter new robot name", "Robot Reclassification", heldname, MAX_NAME_LEN) if(new_name) heldname = new_name diff --git a/code/game/objects/items/selectable_item_vr.dm b/code/game/objects/items/selectable_item_vr.dm index 31da60f391..b39fbaffc1 100644 --- a/code/game/objects/items/selectable_item_vr.dm +++ b/code/game/objects/items/selectable_item_vr.dm @@ -10,7 +10,10 @@ var/list/item_options = list("Gift" = /obj/item/a_gift, "Health Analyzer" = /obj/item/healthanalyzer) -/obj/item/selectable_item/attack_self(mob/user as mob) +/obj/item/selectable_item/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE tgui_alert(user, {"[preface_string]"}, preface_title) var/chosen_item = tgui_input_list(user, selection_string, selection_title, item_options) chosen_item = item_options[chosen_item] diff --git a/code/game/objects/items/stacks/marker_beacons.dm b/code/game/objects/items/stacks/marker_beacons.dm index 2265ebbfc9..e97f48ccd5 100644 --- a/code/game/objects/items/stacks/marker_beacons.dm +++ b/code/game/objects/items/stacks/marker_beacons.dm @@ -27,6 +27,7 @@ var/list/marker_beacon_colors = list( w_class = ITEMSIZE_SMALL var/icon_base = "marker" var/picked_color = "random" + custom_handling = TRUE /obj/item/stack/marker_beacon/ten amount = 10 @@ -50,6 +51,9 @@ var/list/marker_beacon_colors = list( icon_state = "[icon_base][lowertext(picked_color)]" /obj/item/stack/marker_beacon/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE if(!isturf(user.loc)) to_chat(user, span_warning("You need more space to place a [singular_name] here.")) return diff --git a/code/game/objects/items/stacks/sandbags.dm b/code/game/objects/items/stacks/sandbags.dm index f8f62ea090..28028c8670 100644 --- a/code/game/objects/items/stacks/sandbags.dm +++ b/code/game/objects/items/stacks/sandbags.dm @@ -128,6 +128,7 @@ pass_color = TRUE var/bag_material = MAT_CLOTH + custom_handling = TRUE /obj/item/stack/emptysandbag/Initialize(mapload, var/amt, var/bag_mat) . = ..(mapload, amt) @@ -138,7 +139,10 @@ return INITIALIZE_HINT_QDEL color = M.icon_colour -/obj/item/stack/emptysandbag/attack_self(var/mob/user) +/obj/item/stack/emptysandbag/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE while(do_after(user, 1 SECOND, target = src) && can_use(1) && istype(get_turf(src), /turf/simulated/floor/outdoors)) use(1) var/obj/item/stack/sandbags/SB = new (get_turf(src), 1, bag_material) diff --git a/code/game/objects/items/stacks/stack.dm b/code/game/objects/items/stacks/stack.dm index 75560e11f5..4f28da6244 100644 --- a/code/game/objects/items/stacks/stack.dm +++ b/code/game/objects/items/stacks/stack.dm @@ -31,6 +31,10 @@ var/strict_color_stacking = FALSE // Will the stack merge with other stacks that are different colors? (Dyed cloth, wood, etc) var/is_building = FALSE + var/custom_handling = FALSE + var/beacons = FALSE + var/sandbags = FALSE + /obj/item/stack/Initialize(mapload, var/starting_amount) . = ..() if(!stacktype) @@ -84,6 +88,11 @@ . += get_examine_string() /obj/item/stack/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE + if(custom_handling) + return FALSE tgui_interact(user) /obj/item/stack/tgui_interact(mob/user, datum/tgui/ui, datum/tgui/parent_ui) diff --git a/code/game/objects/items/stacks/telecrystal.dm b/code/game/objects/items/stacks/telecrystal.dm index a7e73890dd..b8d4b6559d 100644 --- a/code/game/objects/items/stacks/telecrystal.dm +++ b/code/game/objects/items/stacks/telecrystal.dm @@ -9,6 +9,7 @@ max_amount = 240 origin_tech = list(TECH_MATERIAL = 6, TECH_BLUESPACE = 4) force = 1 //Needs a token force to ensure you can attack because for some reason you can't attack with 0 force things + custom_handling = TRUE /obj/item/stack/telecrystal/apply_hit_effect(mob/living/target, mob/living/user, var/hit_zone) if(amount >= 5) @@ -18,7 +19,10 @@ else to_chat(user, span_warning("There are not enough telecrystals to do that.")) -/obj/item/stack/telecrystal/attack_self(mob/user as mob) +/obj/item/stack/telecrystal/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE if(user.mind.accept_tcrystals) //Checks to see if antag type allows for tcrystals to_chat(user, span_notice("You use \the [src], adding [src.amount] to your balance.")) user.mind.tcrystals += amount diff --git a/code/game/objects/items/toys/fake_coin.dm b/code/game/objects/items/toys/fake_coin.dm index 63ff1dc387..87eb82f57b 100644 --- a/code/game/objects/items/toys/fake_coin.dm +++ b/code/game/objects/items/toys/fake_coin.dm @@ -106,7 +106,10 @@ desc = "Shiny green " + MAT_VERDANTIUM + ", pressed into a coin. It almost seems to glimmer under starlight." icon_state = "coin_verdantium" -/obj/item/fake_coin/attack_self(mob/user as mob) +/obj/item/fake_coin/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE var/result = rand(1, sides) var/comment = "" if(result == 1) diff --git a/code/game/objects/items/toys/mech_toys.dm b/code/game/objects/items/toys/mech_toys.dm index 3169b9ec1c..98b3b9557d 100644 --- a/code/game/objects/items/toys/mech_toys.dm +++ b/code/game/objects/items/toys/mech_toys.dm @@ -115,12 +115,13 @@ //all credit to skasi for toy mech fun ideas /obj/item/toy/mecha/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE if(timer < world.time) to_chat(user, span_notice("You play with [src].")) timer = world.time + cooldown playsound(user, 'sound/mecha/mechstep.ogg', 20, TRUE) - else - . = ..() /obj/item/toy/mecha/attack_hand(mob/user) . = ..() diff --git a/code/game/objects/items/toys/toys.dm b/code/game/objects/items/toys/toys.dm index 328975f497..8a7b1c2322 100644 --- a/code/game/objects/items/toys/toys.dm +++ b/code/game/objects/items/toys/toys.dm @@ -163,20 +163,23 @@ w_class = ITEMSIZE_SMALL attack_verb = list("attacked", "struck", "hit") -/obj/item/toy/sword/attack_self(mob/user as mob) - src.active = !( src.active ) - if (src.active) +/obj/item/toy/sword/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE + active = !active + if(active) to_chat(user, span_notice("You extend the plastic blade with a quick flick of your wrist.")) playsound(src, 'sound/weapons/saberon.ogg', 50, 1) - src.item_state = "[icon_state]_blade" - src.w_class = ITEMSIZE_LARGE + item_state = "[icon_state]_blade" + w_class = ITEMSIZE_LARGE else to_chat(user, span_notice("You push the plastic blade back down into the handle.")) playsound(src, 'sound/weapons/saberoff.ogg', 50, 1) - src.item_state = "[icon_state]" - src.w_class = ITEMSIZE_SMALL + item_state = "[icon_state]" + w_class = ITEMSIZE_SMALL update_icon() - src.add_fingerprint(user) + add_fingerprint(user) return /obj/item/toy/sword/update_icon() @@ -282,7 +285,10 @@ w_class = ITEMSIZE_TINY slot_flags = SLOT_EARS | SLOT_HOLSTER -/obj/item/toy/bosunwhistle/attack_self(mob/user as mob) +/obj/item/toy/bosunwhistle/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE if(cooldown < world.time - 35) to_chat(user, span_notice("You blow on [src], creating an ear-splitting noise!")) playsound(src, 'sound/misc/boatswain.ogg', 20, 1) @@ -305,9 +311,12 @@ . = ..() desc = "A \"Space Life\" brand [name]" -/obj/item/toy/figure/attack_self(mob/user as mob) +/obj/item/toy/figure/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE if(cooldown < world.time) - cooldown = (world.time + 30) //3 second cooldown + cooldown = (world.time + 3 SECONDS) user.visible_message(span_notice("The [src] says \"[toysay]\".")) playsound(src, 'sound/machines/click.ogg', 20, 1) @@ -629,16 +638,12 @@ icon = 'icons/obj/toy.dmi' icon_state = "basecarp" attack_verb = list("bitten", "eaten", "fin slapped") - var/bitesound = 'sound/weapons/bite.ogg' + squeeze_sound = 'sound/weapons/bite.ogg' + cooldown_length = 1 SECOND // Attack mob /obj/item/toy/plushie/carp/attack(mob/M as mob, mob/user as mob) - playsound(src, bitesound, 20, 1) // Play bite sound in local area - return ..() - -// Attack self -/obj/item/toy/plushie/carp/attack_self(mob/user as mob) - playsound(src, bitesound, 20, 1) + playsound(src, squeeze_sound, 20, 1) // Play bite sound in local area return ..() @@ -810,6 +815,16 @@ //This should be used if a plushie can be made to say custom messages. Not currently required at the moment, but here just in case it'd added in the future. var/prevent_impersonation = FALSE + var/special_handling = TRUE + + ///The sound we make when squeezed + var/squeeze_sound = 'sound/items/drop/plushie.ogg' + + ///Timer to track how long until we can play a sound again + var/cooldown_timer + ///How long our cooldown timer is. Default 15 seconds + var/cooldown_length = 15 SECONDS + /obj/item/toy/plushie/Initialize(mapload) . = ..() adjusted_name = name @@ -821,7 +836,12 @@ if(in_range(user, src) && stored_item) . += span_italics("You can see something in there...") -/obj/item/toy/plushie/attack_self(mob/user as mob) +/obj/item/toy/plushie/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE + if(special_handling) + return if(stored_item && opened && !searching) searching = TRUE if(do_after(user, 1 SECOND, target = src)) @@ -843,7 +863,9 @@ user.visible_message(span_warning(span_bold("\The [user]") + " attempts to strangle [src]!"),span_warning("You attempt to strangle [src]!")) else user.visible_message(span_notice(span_bold("\The [user]") + " pokes [src]."),span_notice("You poke [src].")) - playsound(src, 'sound/items/drop/plushie.ogg', 25, 0) + if(cooldown_timer < world.time) + playsound(src, squeeze_sound, 25, 0) + cooldown_timer = world.time + cooldown_length if(pokephrase) //There was no indiciation you had to use disarm intent to make it speak...So now it speaks if you touch it at all! say_phrase() last_message = world.time @@ -1186,14 +1208,7 @@ icon = 'icons/obj/toy.dmi' icon_state = "plushie_tin" pokephrase = "Peep peep!" - var/cooldown = 0 - -/obj/item/toy/plushie/tinytin/attack_self(mob/user as mob) - if(!cooldown) - playsound(user, 'sound/voice/peep.ogg', 20, 0) - cooldown = TRUE - addtimer(VARSET_CALLBACK(src, cooldown, FALSE), 15 SECONDS, TIMER_DELETE_ME) - return ..() + squeeze_sound = 'sound/voice/peep.ogg' /obj/item/toy/plushie/tinytin_sec name = "officer tiny tin plushie" @@ -1202,14 +1217,7 @@ icon_state = "plushie_tinsec" bubble_icon = "security" pokephrase = "That means you fucked up!" - var/cooldown = 0 - -/obj/item/toy/plushie/tinytin_sec/attack_self(mob/user as mob) - if(!cooldown) - playsound(user, 'sound/voice/tinytin_fuckedup.ogg', 25, 0) - cooldown = TRUE - addtimer(VARSET_CALLBACK(src, cooldown, FALSE), 15 SECONDS, TIMER_DELETE_ME) - return ..() + squeeze_sound = 'sound/voice/tinytin_fuckedup.ogg' //Toy cult sword /obj/item/toy/cultsword @@ -1257,13 +1265,15 @@ var/cooldown = 0 var/list/possible_answers = list("Definitely.", "All signs point to yes.", "Most likely.", "Yes.", "Ask again later.", "Better not tell you now.", "Future unclear.", "Maybe.", "Doubtful.", "No.", "Don't count on it.", "Never.") -/obj/item/toy/eight_ball/attack_self(mob/user as mob) +/obj/item/toy/eight_ball/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE if(!cooldown) var/answer = pick(possible_answers) user.visible_message(span_notice("[user] focuses on their question and [use_action]...")) user.visible_message(span_notice("The [src] says \"[answer]\"")) - spawn(30) - cooldown = 0 + VARSET_IN(src, cooldown, FALSE, 3 SECONDS) return /obj/item/toy/eight_ball/conch @@ -1320,26 +1330,7 @@ /obj/item/toy/character/voidone, /obj/item/toy/character/lich ) -/* VOREStation edit. Moved to toys_vr.dm -/obj/item/toy/AI - name = "toy AI" - desc = "A little toy model AI core!"// with real law announcing action!" //Alas, requires a rewrite of how ion laws work. - icon = 'icons/obj/toy.dmi' - icon_state = "AI" - w_class = ITEMSIZE_SMALL - var/cooldown = 0 -/obj/item/toy/AI/attack_self(mob/user) - if(!cooldown) //for the sanity of everyone - var/message = generate_ion_law() - to_chat(user, span_notice("You press the button on [src].")) - playsound(src, 'sound/machines/click.ogg', 20, 1) - visible_message(span_danger("[message]")) - cooldown = 1 - spawn(30) cooldown = 0 - return - ..() -*/ /obj/item/toy/owl name = "owl action figure" desc = "An action figure modeled after 'The Owl', defender of justice." @@ -1349,15 +1340,16 @@ var/cooldown = 0 /obj/item/toy/owl/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE if(!cooldown) //for the sanity of everyone var/message = pick("You won't get away this time, Griffin!", "Stop right there, criminal!", "Hoot! Hoot!", "I am the night!") to_chat(user, span_notice("You pull the string on the [src].")) //playsound(src, 'sound/misc/hoot.ogg', 25, 1) visible_message(span_danger("[message]")) cooldown = 1 - spawn(30) cooldown = 0 - return - ..() + VARSET_IN(src, cooldown, FALSE, 3 SECONDS) /obj/item/toy/griffin name = "griffin action figure" @@ -1368,15 +1360,16 @@ var/cooldown = 0 /obj/item/toy/griffin/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE if(!cooldown) //for the sanity of everyone var/message = pick("You can't stop me, Owl!", "My plan is flawless! The vault is mine!", "Caaaawwww!", "You will never catch me!") to_chat(user, span_notice("You pull the string on the [src].")) //playsound(src, 'sound/misc/caw.ogg', 25, 1) visible_message(span_danger("[message]")) cooldown = 1 - spawn(30) cooldown = 0 - return - ..() + VARSET_IN(src, cooldown, FALSE, 3 SECONDS) /* NYET. /obj/item/toddler diff --git a/code/game/objects/items/toys/toys_vr.dm b/code/game/objects/items/toys/toys_vr.dm index c5ea05ce1d..35368ce36e 100644 --- a/code/game/objects/items/toys/toys_vr.dm +++ b/code/game/objects/items/toys/toys_vr.dm @@ -180,17 +180,8 @@ icon = 'icons/obj/toy.dmi' icon_state = "plushie_vox" pokephrase = "Skreee!" - var/cooldown = FALSE + squeeze_sound = 'sound/voice/shriek1.ogg' -/obj/item/toy/plushie/vox/attack_self(mob/user as mob) - if(!cooldown) - playsound(user, 'sound/voice/shriek1.ogg', 10, 0) - cooldown = TRUE - addtimer(VARSET_CALLBACK(src, cooldown, FALSE), 15 SECONDS, TIMER_DELETE_ME) - return ..() - -/obj/item/toy/plushie/vox/proc/cooldownreset() - cooldown = 0 /obj/item/toy/plushie/ipc name = "IPC plushie" @@ -199,7 +190,7 @@ icon_state = "plushie_ipc" bubble_icon = "synthetic" pokephrase = "Ping!" - var/cooldown = 0 + squeeze_sound = 'sound/machines/ping.ogg' /obj/item/reagent_containers/food/snacks/slice/bread var/toasted = FALSE @@ -233,13 +224,6 @@ else return ..() -/obj/item/toy/plushie/ipc/attack_self(mob/user as mob) - if(!cooldown) - playsound(user, 'sound/machines/ping.ogg', 10, 0) - cooldown = TRUE - addtimer(VARSET_CALLBACK(src, cooldown, FALSE), 15 SECONDS, TIMER_DELETE_ME) - return ..() - /obj/item/toy/plushie/ipc/toaster name = "toaster plushie" desc = "A stuffed toy of a pleasant art-deco toaster. It has a small tag on it reading 'Bricker Home Appliances! All rights reserved, copyright 2298.' It's a tad heavy on account of containing a heating coil. Want to make toast?" @@ -247,13 +231,7 @@ attack_verb = list("toasted", "burnt") pokephrase = "Ding!" bubble_icon = "machine" - -/obj/item/toy/plushie/ipc/toaster/attack_self(mob/user as mob) - if(!cooldown) - playsound(user, 'sound/machines/ding.ogg', 10, 0) - cooldown = TRUE - addtimer(VARSET_CALLBACK(src, cooldown, FALSE), 15 SECONDS, TIMER_DELETE_ME) - return ..() + squeeze_sound = 'sound/machines/ding.ogg' /obj/item/toy/plushie/snakeplushie name = "snake plushie" @@ -275,44 +253,26 @@ desc = "An adorable plushie of NanoTrasen's Best Girl(TM) mascot. It smells faintly of paperwork." icon = 'icons/obj/toy.dmi' icon_state = "marketable_pip" - var/cooldown = FALSE + squeeze_sound = 'sound/effects/whistle.ogg' /obj/item/toy/plushie/marketable_pip/attackby(obj/item/I, mob/user) var/obj/item/card/id/id = I.GetID() - if(istype(id) && !cooldown) + if(istype(id) && cooldown_timer < world.time) var/responses = list("I'm not giving you all-access.", "Do you want an ID modification?", "Where are you swiping that!?", "Congratulations! You've been promoted to unemployed!") pokephrase = pick(responses) user.visible_message(span_notice("[user] swipes \the [I] against \the [src].")) playsound(user, 'sound/effects/whistle.ogg', 10, 0) say_phrase() - cooldown = TRUE - addtimer(VARSET_CALLBACK(src, cooldown, FALSE), 15 SECONDS, TIMER_DELETE_ME) + cooldown_timer = world.time + cooldown_length return ..() -/obj/item/toy/plushie/marketable_pip/attack_self(mob/user as mob) - if(!cooldown) - playsound(user, 'sound/effects/whistle.ogg', 10, 0) - cooldown = TRUE - addtimer(VARSET_CALLBACK(src, cooldown, FALSE), 15 SECONDS, TIMER_DELETE_ME) - return ..() - /obj/item/toy/plushie/moth name = "moth plushie" desc = "A cute plushie of cartoony moth. It's ultra fluffy but leaves dust everywhere." icon = 'icons/obj/toy.dmi' icon_state = "moth" pokephrase = "Aaaaaaa." - var/cooldown = FALSE - -/obj/item/toy/plushie/moth/attack_self(mob/user as mob) - if(!cooldown) - playsound(user, 'sound/voice/moth/scream_moth.ogg', 10, 0) - cooldown = TRUE - addtimer(VARSET_CALLBACK(src, cooldown, FALSE), 15 SECONDS, TIMER_DELETE_ME) - return ..() - -/obj/item/toy/plushie/moth/proc/cooldownreset() - cooldown = 0 + squeeze_sound = 'sound/voice/moth/scream_moth.ogg' /obj/item/toy/plushie/crab name = "crab plushie" @@ -349,14 +309,7 @@ pokephrase = "Stab!" bubble_icon = "security" attack_verb = list("stabbed", "slashed") - var/cooldown = FALSE - -/obj/item/toy/plushie/sus/attack_self(mob/user as mob) - if(!cooldown) - playsound(user, 'sound/weapons/slice.ogg', 10, 0) - cooldown = TRUE - addtimer(VARSET_CALLBACK(src, cooldown, FALSE), 15 SECONDS, TIMER_DELETE_ME) - return ..() + squeeze_sound = 'sound/weapons/slice.ogg' /obj/item/toy/plushie/sus/blue name = "blue spaceman plushie" @@ -443,6 +396,9 @@ icon_state = "chewtoy_poly" /obj/item/toy/chewtoy/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE playsound(loc, 'sound/items/drop/plushie.ogg', 50, 1) user.visible_message(span_notice(span_bold("\The [user]") + " gnaws on [src]!"),span_notice("You gnaw on [src]!")) @@ -508,6 +464,9 @@ var/cooldown = 0 /obj/item/toy/redbutton/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE if(cooldown < world.time) cooldown = (world.time + 300) // Sets cooldown at 30 seconds user.visible_message(span_warning("[user] presses the big red button."), span_notice("You press the button, it plays a loud noise!"), span_notice("The button clicks loudly.")) @@ -539,7 +498,12 @@ var/cooldown = 0 var/list/possible_answers = null -/obj/item/toy/AI/attack_self(mob/user as mob) +/obj/item/toy/AI/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE + if(cooldown > world.time) //No, I'm not allowing you to spamclick this to do a search over GLOB.player_list + return var/list/players = list() for(var/mob/living/carbon/human/player in GLOB.player_list) @@ -557,12 +521,6 @@ var/answer = pick(possible_answers) user.visible_message(span_notice("[user] asks the AI core to state laws.")) user.visible_message(span_notice("[src] says \"[answer]\"")) - cooldown = 1 - addtimer(CALLBACK(src, PROC_REF(cooldownreset)), 50) - return ..() - -/obj/item/toy/AI/proc/cooldownreset() - cooldown = 0 /* * Toy cuffs @@ -602,6 +560,9 @@ var/cooldown = 0 /obj/item/toy/nuke/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE if(cooldown < world.time) cooldown = world.time + 1800 //3 minutes user.visible_message(span_warning("[user] presses a button on [src]"), span_notice("You activate [src], it plays a loud noise!"), span_notice("You hear the click of a button.")) @@ -630,8 +591,14 @@ var/cooldown = 0 var/obj/stored_minature = null -/obj/item/toy/minigibber/attack_self(mob/user) +/obj/item/toy/minigibber/Destroy() + QDEL_NULL(stored_minature) + . = ..() +/obj/item/toy/minigibber/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE if(stored_minature) to_chat(user, span_danger("\The [src] makes a violent grinding noise as it tears apart the miniature figure inside!")) playsound(src, 'sound/effects/splat.ogg', 50, 1) @@ -670,6 +637,9 @@ var/cooldown = 0 /obj/item/toy/toy_xeno/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE if(cooldown <= world.time) cooldown = (world.time + 50) //5 second cooldown user.visible_message(span_notice("[user] pulls back the string on [src].")) @@ -712,6 +682,9 @@ spin_cylinder() /obj/item/toy/russian_revolver/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE if(!bullets_left) user.visible_message(span_warning("[user] loads a bullet into [src]'s cylinder before spinning it.")) spin_cylinder() @@ -802,12 +775,14 @@ attack_verb = list("sawed", "cut", "hacked", "carved", "cleaved", "butchered", "felled", "timbered") var/cooldown = 0 -/obj/item/toy/chainsaw/attack_self(mob/user as mob) +/obj/item/toy/chainsaw/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE if(!cooldown) playsound(user, 'sound/weapons/chainsaw_startup.ogg', 10, 0) cooldown = 1 addtimer(CALLBACK(src, PROC_REF(cooldownreset)), 50) - return ..() /obj/item/toy/chainsaw/proc/cooldownreset() cooldown = 0 @@ -841,7 +816,10 @@ if(prob(0.1)) real = 1 -/obj/item/toy/snake_popper/attack_self(mob/user as mob) +/obj/item/toy/snake_popper/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE if(!popped) to_chat(user, span_warning("A snake popped out of [src]!")) if(real == 0) @@ -1022,6 +1000,9 @@ return 1 /obj/item/toy/desk/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE activate(user) /obj/item/toy/desk/click_alt(mob/user) @@ -1090,7 +1071,10 @@ drop_sound = 'sound/items/drop/cardboardbox.ogg' pickup_sound = 'sound/items/pickup/cardboardbox.ogg' -/obj/item/toy/partypopper/attack_self(mob/user as mob) +/obj/item/toy/partypopper/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE if(icon_state == "partypopper") user.visible_message(span_notice("[user] pulls on the string, releasing a burst of confetti!"), span_notice("You pull on the string, releasing a burst of confetti!")) playsound(src, 'sound/effects/snap.ogg', 50, TRUE) @@ -1165,6 +1149,9 @@ var/registered_mob //On request, only one person is able to use it at a time. /obj/item/toy/acorn_branch/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE if(user.stat || !ishuman(user)) return if(world.time < next_use) @@ -1192,6 +1179,7 @@ icon = 'icons/obj/toy.dmi' icon_state = "reddragon" var/cooldown = FALSE + special_handling = TRUE /obj/item/toy/plushie/dragon/Initialize(mapload) . = ..() @@ -1199,6 +1187,9 @@ pokephrase = pick("ROAR!", "RAWR!", "GAWR!", "GRR!", "GROAR!", "GRAH!", "Weh!", "Merp!") /obj/item/toy/plushie/dragon/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE if(!cooldown) switch(pokephrase) if("Weh!") diff --git a/code/game/objects/items/weapons/AI_modules.dm b/code/game/objects/items/weapons/AI_modules.dm index f59f6fb602..b3d2013bde 100644 --- a/code/game/objects/items/weapons/AI_modules.dm +++ b/code/game/objects/items/weapons/AI_modules.dm @@ -144,8 +144,10 @@ AI MODULES desc = "A 'safeguard' AI module: 'Safeguard . Anyone threatening or attempting to harm is no longer to be considered a crew member, and is a threat which must be neutralized.'" origin_tech = list(TECH_DATA = 3, TECH_MATERIAL = 4) -/obj/item/aiModule/safeguard/attack_self(var/mob/user as mob) - ..() +/obj/item/aiModule/safeguard/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE var/targName = tgui_input_text(user, "Please enter the name of the person to safeguard.", "Safeguard who?", user.name, MAX_MESSAGE_LEN) targetName = targName desc = text("A 'safeguard' AI module: 'Safeguard []. Anyone threatening or attempting to harm [] is no longer to be considered a crew member, and is a threat which must be neutralized.'", targetName, targetName) @@ -170,8 +172,10 @@ AI MODULES desc = "A 'one crew member' AI module: 'Only is a crew member.'" origin_tech = list(TECH_DATA = 3, TECH_MATERIAL = 6) //made with diamonds! -/obj/item/aiModule/oneHuman/attack_self(var/mob/user as mob) - ..() +/obj/item/aiModule/oneHuman/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE var/targName = tgui_input_text(user, "Please enter the name of the person who is the only crew member.", "Who?", user.real_name, MAX_MESSAGE_LEN) targetName = targName desc = text("A 'one crew member' AI module: 'Only [] is a crew member.'", targetName) @@ -251,8 +255,10 @@ AI MODULES desc = "A 'freeform' AI module: ''" origin_tech = list(TECH_DATA = 4, TECH_MATERIAL = 4) -/obj/item/aiModule/freeform/attack_self(var/mob/user as mob) - ..() +/obj/item/aiModule/freeform/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE var/new_lawpos = tgui_input_number(user, "Please enter the priority for your new law. Can only write to law sectors 15 and above.", "Law Priority (15+)", lawpos) if(new_lawpos < MIN_SUPPLIED_LAW_NUMBER) return lawpos = min(new_lawpos, MAX_SUPPLIED_LAW_NUMBER) @@ -372,8 +378,10 @@ AI MODULES desc = "A 'freeform' Core AI module: ''" origin_tech = list(TECH_DATA = 3, TECH_MATERIAL = 6) -/obj/item/aiModule/freeformcore/attack_self(var/mob/user as mob) - ..() +/obj/item/aiModule/freeformcore/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE var/newlaw = "" var/targName = tgui_input_text(user, "Please enter a new core law for the AI.", "Freeform Law Entry", newlaw, MAX_MESSAGE_LEN) newFreeFormLaw = targName @@ -396,8 +404,10 @@ AI MODULES desc = "A hacked AI law module: ''" origin_tech = list(TECH_DATA = 3, TECH_MATERIAL = 6, TECH_ILLEGAL = 7) -/obj/item/aiModule/syndicate/attack_self(var/mob/user as mob) - ..() +/obj/item/aiModule/syndicate/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE var/newlaw = "" var/targName = tgui_input_text(user, "Please enter a new law for the AI.", "Freeform Law Entry", newlaw, MAX_MESSAGE_LEN) newFreeFormLaw = targName diff --git a/code/game/objects/items/weapons/RCD.dm b/code/game/objects/items/weapons/RCD.dm index f8aeaaf3de..bc867bf235 100644 --- a/code/game/objects/items/weapons/RCD.dm +++ b/code/game/objects/items/weapons/RCD.dm @@ -67,8 +67,11 @@ return ..() */ // Changes which mode it is on. -/obj/item/rcd/attack_self(mob/living/user) -/* VOREStation Removal - Moved to VR +/*/obj/item/rcd/attack_self(mob/living/user) + . = ..(user) + if(.) + return TRUE + //VOREStation Removal - Moved to VR if(mode_index >= modes.len) // Shouldn't overflow unless someone messes with it in VV poorly but better safe than sorry. mode_index = 1 else diff --git a/code/game/objects/items/weapons/RCD_vr.dm b/code/game/objects/items/weapons/RCD_vr.dm index ada0fac20c..b0c56d5293 100644 --- a/code/game/objects/items/weapons/RCD_vr.dm +++ b/code/game/objects/items/weapons/RCD_vr.dm @@ -107,7 +107,9 @@ return TRUE /obj/item/rcd/attack_self(mob/living/user) - ..() + . = ..(user) + if(.) + return TRUE var/list/choices = list( "Airlock" = radial_image_airlock, "Deconstruct" = radial_image_decon, diff --git a/code/game/objects/items/weapons/RMS.dm b/code/game/objects/items/weapons/RMS.dm index 0edefe20fd..ebc146c078 100644 --- a/code/game/objects/items/weapons/RMS.dm +++ b/code/game/objects/items/weapons/RMS.dm @@ -241,6 +241,9 @@ var/list/RMS_random_malfunction = list(/obj/item/fbp_backup_cell, return /obj/item/rms/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE var/list/choices = list( "Steel" = radial_image_steel, "Glass" = radial_image_glass, @@ -277,7 +280,6 @@ var/list/RMS_random_malfunction = list(/obj/item/fbp_backup_cell, to_chat(user, span_notice("Changed mode to '[choice]'.")) playsound(src.loc, 'sound/effects/pop.ogg', 50, 0) - return ..() /obj/item/rms/attackby(obj/item/W, mob/user) if(W.has_tool_quality(TOOL_MULTITOOL)) diff --git a/code/game/objects/items/weapons/RPD_vr.dm b/code/game/objects/items/weapons/RPD_vr.dm index 28f7eafdd3..531781ad9a 100644 --- a/code/game/objects/items/weapons/RPD_vr.dm +++ b/code/game/objects/items/weapons/RPD_vr.dm @@ -65,6 +65,9 @@ return ..() /obj/item/pipe_dispenser/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE tgui_interact(user) /obj/item/pipe_dispenser/ui_assets(mob/user) diff --git a/code/game/objects/items/weapons/RSF.dm b/code/game/objects/items/weapons/RSF.dm index a9d6fb91cd..783554f73a 100644 --- a/code/game/objects/items/weapons/RSF.dm +++ b/code/game/objects/items/weapons/RSF.dm @@ -65,7 +65,10 @@ GLOBAL_LIST_INIT(robot_glass_options, list( balloon_alert(user, "container chosen: [glass_choice]") glasstype_name = glass_choice -/obj/item/rsf/attack_self(mob/user as mob) +/obj/item/rsf/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE var/options = list( "card deck" = image(icon = 'icons/obj/playing_cards.dmi', icon_state = "deck"), "card deck (big)" = image(icon = 'icons/obj/playing_cards.dmi', icon_state = "deck"), diff --git a/code/game/objects/items/weapons/candle.dm b/code/game/objects/items/weapons/candle.dm index 4baf068986..2aa2647073 100644 --- a/code/game/objects/items/weapons/candle.dm +++ b/code/game/objects/items/weapons/candle.dm @@ -65,9 +65,12 @@ var/turf/T = loc T.hotspot_expose(700, 5) -/obj/item/flame/candle/attack_self(mob/user as mob) +/obj/item/flame/candle/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE if(lit) - lit = 0 + lit = FALSE update_icon() set_light(0) diff --git a/code/game/objects/items/weapons/canes.dm b/code/game/objects/items/weapons/canes.dm index c6a25f2d53..659a150cb9 100644 --- a/code/game/objects/items/weapons/canes.dm +++ b/code/game/objects/items/weapons/canes.dm @@ -28,7 +28,10 @@ concealed_blade = temp_blade temp_blade.attack_self() -/obj/item/cane/concealed/attack_self(var/mob/user) +/obj/item/cane/concealed/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE if(concealed_blade) user.visible_message(span_warning("[user] has unsheathed \a [concealed_blade] from [user.p_their()] [src]!"), "You unsheathe \the [concealed_blade] from \the [src].") // Calling drop/put in hands to properly call item drop/pickup procs @@ -40,8 +43,6 @@ user.update_inv_r_hand() concealed_blade = null update_icon() - else - ..() /obj/item/cane/concealed/attackby(var/obj/item/material/sword/katana/caneblade/W, var/mob/user) if(!src.concealed_blade && istype(W)) @@ -92,7 +93,10 @@ force = 3 var/on = 0 -/obj/item/cane/white/collapsible/attack_self(mob/user as mob) +/obj/item/cane/white/collapsible/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE on = !on if(on) user.visible_message(span_infoplain(span_bold("\The [user]") + " extends the white cane."),\ diff --git a/code/game/objects/items/weapons/capture_crystal.dm b/code/game/objects/items/weapons/capture_crystal.dm index 51d09432db..c03bb417f4 100644 --- a/code/game/objects/items/weapons/capture_crystal.dm +++ b/code/game/objects/items/weapons/capture_crystal.dm @@ -20,6 +20,7 @@ var/full_icon = "full" var/spawn_mob_name = "A mob" var/capture_chance_modifier = 1 //So we can have special subtypes with different capture rates! + var/loadout = FALSE /obj/item/capture_crystal/Initialize(mapload) . = ..() @@ -228,6 +229,13 @@ //Tries to unleash or recall your stored mob /obj/item/capture_crystal/attack_self(mob/living/user) + . = ..(user) + if(.) + return TRUE + if(loadout && !bound_mob) + to_chat(user, span_notice("\The [src] emits an unpleasant tone... It is not ready yet.")) + playsound(src, 'sound/effects/capture-crystal-problem.ogg', 75, 1, -1) + return if(bound_mob && !owner) if(bound_mob == user) to_chat(user, span_notice("\The [src] emits an unpleasant tone... It does not activate for you.")) @@ -869,6 +877,7 @@ /obj/item/capture_crystal/loadout active = TRUE + loadout = TRUE /obj/item/capture_crystal/loadout/attack(mob/living/M, mob/living/user) if(!bound_mob && M != user) @@ -877,12 +886,6 @@ return . = ..() -/obj/item/capture_crystal/loadout/attack_self(mob/living/user) - if(!bound_mob) - to_chat(user, span_notice("\The [src] emits an unpleasant tone... It is not ready yet.")) - playsound(src, 'sound/effects/capture-crystal-problem.ogg', 75, 1, -1) - return - . = ..() /obj/item/capture_crystal/loadout/capture_chance() return 0 diff --git a/code/game/objects/items/weapons/chewables.dm b/code/game/objects/items/weapons/chewables.dm index 9a5ba54793..06f87f77cb 100644 --- a/code/game/objects/items/weapons/chewables.dm +++ b/code/game/objects/items/weapons/chewables.dm @@ -13,6 +13,9 @@ var/wrapped = FALSE /obj/item/clothing/mask/chewable/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE if(wrapped) wrapped = FALSE to_chat(user, span_notice("You unwrap \the [name].")) diff --git a/code/game/objects/items/weapons/cigs_lighters.dm b/code/game/objects/items/weapons/cigs_lighters.dm index b3e65c4062..49440bfae5 100644 --- a/code/game/objects/items/weapons/cigs_lighters.dm +++ b/code/game/objects/items/weapons/cigs_lighters.dm @@ -288,6 +288,7 @@ CIGARETTE PACKETS ARE IN FANCY.DM zippomes = span_rose("With a flick of their wrist, USER lights their NAME with their FLAME.") weldermes = span_notice("USER casually lights the NAME with FLAME.") ignitermes = span_notice("USER fiddles with FLAME, and manages to light their NAME.") + special_handling = TRUE /obj/item/clothing/mask/smokable/cigarette/Initialize(mapload) . = ..() @@ -318,7 +319,10 @@ CIGARETTE PACKETS ARE IN FANCY.DM else to_chat(user, span_notice("[src] is full.")) -/obj/item/clothing/mask/smokable/cigarette/attack_self(mob/user as mob) +/obj/item/clothing/mask/smokable/cigarette/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE if(lit == 1) if(user.a_intent == I_HURT) user.visible_message(span_notice("[user] drops and treads on the lit [src], putting it out instantly.")) @@ -327,7 +331,6 @@ CIGARETTE PACKETS ARE IN FANCY.DM else user.visible_message(span_notice("[user] puts out \the [src].")) quench() - return ..() //////////// // CIGARS // @@ -428,7 +431,10 @@ CIGARETTE PACKETS ARE IN FANCY.DM . = ..() name = "empty [initial(name)]" -/obj/item/clothing/mask/smokable/pipe/attack_self(mob/user as mob) +/obj/item/clothing/mask/smokable/pipe/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE if(lit == 1) if(user.a_intent == I_HURT) user.visible_message(span_notice("[user] empties the lit [src] on the floor!.")) @@ -555,14 +561,17 @@ CIGARETTE PACKETS ARE IN FANCY.DM qdel(G) /obj/item/reagent_containers/rollingpaper/attack_self(mob/living/user) - if(!src.reagents) //don't roll an empty joint + . = ..(user) + if(.) + return TRUE + if(!reagents) //don't roll an empty joint to_chat(user, span_warning("There is nothing in [src]. Add something to it first.")) return var/obj/item/clothing/mask/smokable/cigarette/J = new crafted_type() to_chat(user,span_notice("You roll the [src] into a blunt!")) J.add_fingerprint(user) - if(src.reagents) - src.reagents.trans_to_obj(J, src.reagents.total_volume) + if(reagents) + reagents.trans_to_obj(J, reagents.total_volume) user.drop_from_inventory(src) user.put_in_hands(J) qdel(src) @@ -607,6 +616,10 @@ CIGARETTE PACKETS ARE IN FANCY.DM COLOR_ASSEMBLY_BLUE, COLOR_ASSEMBLY_PURPLE, COLOR_ASSEMBLY_HOT_PINK) + /// If we are a special variant (see: override attack_self) + var/special_variant = FALSE + /// Var used for detonator zippos + var/detonator_mode = 0 // TODO: Remove this path from POIs and loose maps (it's no longer needed) /obj/item/flame/lighter/random @@ -619,8 +632,15 @@ CIGARETTE PACKETS ARE IN FANCY.DM add_overlay(I) /obj/item/flame/lighter/attack_self(mob/living/user) + . = ..(user) + if(.) + return TRUE + if(special_variant) + return FALSE + if(detonator_mode) + return FALSE if(!lit) - lit = 1 + lit = TRUE icon_state = "lighteron" playsound(src, activation_sound, 75, 1) user.visible_message(span_notice("After a few attempts, [user] manages to light the [src].")) @@ -629,7 +649,7 @@ CIGARETTE PACKETS ARE IN FANCY.DM START_PROCESSING(SSobj, src) update_icon() else - lit = 0 + lit = FALSE icon_state = "lighter" playsound(src, deactivation_sound, 75, 1) user.visible_message(span_notice("[user] quietly shuts off the [src].")) @@ -676,16 +696,22 @@ CIGARETTE PACKETS ARE IN FANCY.DM item_state = "zippo" activation_sound = 'sound/items/zippo_on.ogg' deactivation_sound = 'sound/items/zippo_off.ogg' + special_variant = TRUE /obj/item/flame/lighter/zippo/Initialize(mapload) . = ..() cut_overlays() //Prevents the Cheap Lighter overlay from appearing on this /obj/item/flame/lighter/zippo/attack_self(mob/living/user) + . = ..(user) + if(.) + return TRUE + if(detonator_mode) + return FALSE if(!base_state) base_state = icon_state if(!lit) - lit = 1 + lit = TRUE icon_state = "[base_state]on" item_state = "[base_state]on" playsound(src, activation_sound, 75, 1) @@ -694,7 +720,7 @@ CIGARETTE PACKETS ARE IN FANCY.DM set_light(2, 0.5, "#FF9933") START_PROCESSING(SSobj, src) else - lit = 0 + lit = FALSE icon_state = "[base_state]" item_state = "[base_state]" playsound(src, deactivation_sound, 75, 1) @@ -775,6 +801,9 @@ CIGARETTE PACKETS ARE IN FANCY.DM item_state = "SMzippo" activation_sound = 'sound/items/zippo_on_alt.ogg' deactivation_sound = 'sound/items/zippo_off.ogg' + special_variant = TRUE + ///Special supermatter var used for attack_self chain logic. + var/special_supermatter = FALSE /obj/item/flame/lighter/supermatter/syndismzippo name = "Phoron Supermatter Zippo" // Syndicate SM Lighter @@ -784,6 +813,7 @@ CIGARETTE PACKETS ARE IN FANCY.DM item_state = "SyndiSMzippo" activation_sound = 'sound/items/zippo_on_alt.ogg' deactivation_sound = 'sound/items/zippo_off.ogg' + special_supermatter = TRUE /obj/item/flame/lighter/supermatter/expsmzippo name = "Experimental SM Lighter" // Dangerous WIP (admin/event only ATM) @@ -793,9 +823,15 @@ CIGARETTE PACKETS ARE IN FANCY.DM item_state = "ExpSMzippo" activation_sound = 'sound/items/button-open.ogg' deactivation_sound = 'sound/items/button-close.ogg' + special_supermatter = TRUE // safe smzippo /obj/item/flame/lighter/supermatter/attack_self(mob/living/user) + . = ..(user) + if(.) + return TRUE + if(special_supermatter) + return FALSE if(!base_state) base_state = icon_state if(!lit) @@ -867,6 +903,9 @@ CIGARETTE PACKETS ARE IN FANCY.DM // syndicate smzippo /obj/item/flame/lighter/supermatter/syndismzippo/attack_self(mob/living/user) + . = ..(user) + if(.) + return TRUE if(!base_state) base_state = icon_state if(!lit) @@ -938,6 +977,9 @@ CIGARETTE PACKETS ARE IN FANCY.DM // Experimental smzippo /obj/item/flame/lighter/supermatter/expsmzippo/attack_self(mob/living/user) + . = ..(user) + if(.) + return TRUE if (!base_state) base_state = icon_state if (!lit) diff --git a/code/game/objects/items/weapons/clown_items.dm b/code/game/objects/items/weapons/clown_items.dm index 512ea2f17d..7de50e538a 100644 --- a/code/game/objects/items/weapons/clown_items.dm +++ b/code/game/objects/items/weapons/clown_items.dm @@ -14,24 +14,3 @@ if(isliving(AM)) var/mob/living/M = AM M.slip("the [src.name]",4) - -/* - * Bike Horns - */ -/obj/item/bikehorn - var/honk_sound = 'sound/items/bikehorn.ogg' - -/obj/item/bikehorn/attack_self(mob/user as mob) - if(spam_flag == 0) - spam_flag = 1 - playsound(src, honk_sound, 50, 1) - src.add_fingerprint(user) - spawn(20) - spam_flag = 0 - return - -/obj/item/bikehorn/Crossed(atom/movable/AM as mob|obj) - if(AM.is_incorporeal()) - return - if(isliving(AM)) - playsound(src, honk_sound, 50, 1) diff --git a/code/game/objects/items/weapons/cosmetics.dm b/code/game/objects/items/weapons/cosmetics.dm index 8e8f702668..6115f7deb1 100644 --- a/code/game/objects/items/weapons/cosmetics.dm +++ b/code/game/objects/items/weapons/cosmetics.dm @@ -31,7 +31,10 @@ colour = pick("red","purple","jade","black") name = "[colour] lipstick" -/obj/item/lipstick/attack_self(mob/user as mob) +/obj/item/lipstick/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE to_chat(user, span_notice("You twist \the [src] [open ? "closed" : "open"].")) open = !open if(open) @@ -76,6 +79,9 @@ icon_state = "purplecomb" /obj/item/haircomb/attack_self(mob/living/user) + . = ..(user) + if(.) + return TRUE var/text = "person" if(ishuman(user)) var/mob/living/carbon/human/U = user @@ -104,7 +110,10 @@ . = ..() M = new(src, null) -/obj/item/makeover/attack_self(mob/living/carbon/user as mob) +/obj/item/makeover/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE if(ishuman(user)) to_chat(user, span_notice("You flip open \the [src] and begin to adjust your appearance.")) M.tgui_interact(user) diff --git a/code/game/objects/items/weapons/ecigs.dm b/code/game/objects/items/weapons/ecigs.dm index 3fff2e6ef5..da6a66ffbd 100644 --- a/code/game/objects/items/weapons/ecigs.dm +++ b/code/game/objects/items/weapons/ecigs.dm @@ -118,17 +118,20 @@ update_icon() to_chat(user, span_notice("You insert [I] into [src].")) -/obj/item/clothing/mask/smokable/ecig/attack_self(mob/user as mob) - if (active) - active=0 +/obj/item/clothing/mask/smokable/ecig/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE + if(active) + active = FALSE STOP_PROCESSING(SSobj, src) to_chat(user, span_notice("You turn off \the [src]. ")) update_icon() else - if (!ec_cartridge) + if(!ec_cartridge) to_chat(user, span_notice("You can't use it with no cartridge installed!.")) return - active=1 + active = TRUE START_PROCESSING(SSobj, src) to_chat(user, span_notice("You turn on \the [src]. ")) update_icon() diff --git a/code/game/objects/items/weapons/explosives.dm b/code/game/objects/items/weapons/explosives.dm index a99e639722..2d55205f8f 100644 --- a/code/game/objects/items/weapons/explosives.dm +++ b/code/game/objects/items/weapons/explosives.dm @@ -38,7 +38,10 @@ else ..() -/obj/item/plastique/attack_self(mob/user as mob) +/obj/item/plastique/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE var/newtime = tgui_input_number(user, "Please set the timer.", "Timer", 10, 60000, 10) if(user.get_active_hand() == src) newtime = CLAMP(newtime, 10, 60000) diff --git a/code/game/objects/items/weapons/extinguisher.dm b/code/game/objects/items/weapons/extinguisher.dm index 397b73f6b1..9d0689b8bf 100644 --- a/code/game/objects/items/weapons/extinguisher.dm +++ b/code/game/objects/items/weapons/extinguisher.dm @@ -63,7 +63,10 @@ if(get_dist(user, src) == 0) . += "[src] has [src.reagents.total_volume] units of foam left!" -/obj/item/extinguisher/attack_self(mob/user as mob) +/obj/item/extinguisher/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE safety = !safety icon_state = "[sprite_name][!safety]" desc = "The safety is [safety ? "on" : "off"]." diff --git a/code/game/objects/items/weapons/flamethrower.dm b/code/game/objects/items/weapons/flamethrower.dm index 0f53b08d26..8e2a5ba5a5 100644 --- a/code/game/objects/items/weapons/flamethrower.dm +++ b/code/game/objects/items/weapons/flamethrower.dm @@ -155,7 +155,10 @@ ..() -/obj/item/flamethrower/attack_self(mob/user as mob) +/obj/item/flamethrower/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE if(user.stat || user.restrained() || user.lying) return tgui_interact(user) diff --git a/code/game/objects/items/weapons/gift_wrappaper.dm b/code/game/objects/items/weapons/gift_wrappaper.dm index 2b70081406..be516b1971 100644 --- a/code/game/objects/items/weapons/gift_wrappaper.dm +++ b/code/game/objects/items/weapons/gift_wrappaper.dm @@ -15,6 +15,8 @@ item_state = "gift1" drop_sound = 'sound/items/drop/cardboardbox.ogg' pickup_sound = 'sound/items/pickup/cardboardbox.ogg' + ///Var used for attack_hand chain. + var/special_handling = FALSE /obj/item/a_gift/Initialize(mapload) . = ..() @@ -25,7 +27,10 @@ else icon_state = "gift[pick(1, 2, 3)]" + "_[pick("g","r","b","y","p")]" -/obj/item/gift/attack_self(mob/user as mob) +/obj/item/gift/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE user.drop_item() playsound(src, 'sound/items/package_unwrap.ogg', 50,1) if(gift) @@ -59,7 +64,12 @@ qdel(src) -/obj/item/a_gift/attack_self(mob/M as mob) +/obj/item/a_gift/attack_self(mob/M) + . = ..(M) + if(.) + return TRUE + if(special_handling) + return FALSE var/gift_type = pick( /obj/item/storage/wallet, /obj/item/storage/photo_album, @@ -193,6 +203,7 @@ item_state = "chomp_present" plane = ABOVE_MOB_PLANE var/chaos + special_handling = TRUE /obj/item/a_gift/advanced/Initialize(mapload) . = ..() @@ -203,6 +214,9 @@ desc = "The casino dev messed up and gave you the wrong present! This one pulses with potential for good or evil!" /obj/item/a_gift/advanced/attack_self(mob/M) //WIP - ALWAYS add more items to list! - Jack + . = ..(M) + if(.) + return TRUE var/gift_type_advanced = pick( /obj/item/binoculars/spyglass, /obj/item/bodysnatcher, diff --git a/code/game/objects/items/weapons/grenades/chem_grenade.dm b/code/game/objects/items/weapons/grenades/chem_grenade.dm index 1568604f52..5e3efc8aff 100644 --- a/code/game/objects/items/weapons/grenades/chem_grenade.dm +++ b/code/game/objects/items/weapons/grenades/chem_grenade.dm @@ -17,6 +17,7 @@ var/list/beakers = new/list() var/list/allowed_containers = list(/obj/item/reagent_containers/glass/beaker, /obj/item/reagent_containers/glass/bottle) var/affected_area = 3 + special_handling = TRUE /obj/item/grenade/chem_grenade/Initialize(mapload) . = ..() @@ -27,7 +28,10 @@ QDEL_LIST_NULL(beakers) return ..() -/obj/item/grenade/chem_grenade/attack_self(mob/user as mob) +/obj/item/grenade/chem_grenade/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE if(!stage || stage==1) if(detonator) // detonator.loc=src.loc diff --git a/code/game/objects/items/weapons/grenades/grenade.dm b/code/game/objects/items/weapons/grenades/grenade.dm index 818933389e..439df2fdd9 100644 --- a/code/game/objects/items/weapons/grenades/grenade.dm +++ b/code/game/objects/items/weapons/grenades/grenade.dm @@ -16,6 +16,9 @@ var/hud_state = "grenade_he" // TGMC Ammo HUD Port var/hud_state_empty = "grenade_empty" // TGMC Ammo HUD Port + ///Var for special attack_self handling + var/special_handling = FALSE + pickup_sound = 'sound/items/pickup/device.ogg' drop_sound = 'sound/items/drop/device.ogg' @@ -55,7 +58,12 @@ . += "\The [src] is set for instant detonation." -/obj/item/grenade/attack_self(mob/user as mob) +/obj/item/grenade/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE + if(special_handling) + return FALSE if(!active) if(clown_check(user)) to_chat(user, span_warning("You prime \the [name]! [det_time/10] seconds!")) diff --git a/code/game/objects/items/weapons/hydroponics.dm b/code/game/objects/items/weapons/hydroponics.dm index b2463cb19e..2bd8fa0fc2 100644 --- a/code/game/objects/items/weapons/hydroponics.dm +++ b/code/game/objects/items/weapons/hydroponics.dm @@ -15,6 +15,9 @@ var/list/item_quants = list() /obj/item/seedbag/attack_self(mob/user) + . = ..(user) //Not that this file is ticked, but who knows. + if(.) + return TRUE user.machine = src interact(user) diff --git a/code/game/objects/items/weapons/id cards/cards.dm b/code/game/objects/items/weapons/id cards/cards.dm index c40c9d56cb..8544313afb 100644 --- a/code/game/objects/items/weapons/id cards/cards.dm +++ b/code/game/objects/items/weapons/id cards/cards.dm @@ -202,7 +202,9 @@ icon = I /obj/item/card_fluff/attack_self(mob/user) - + . = ..(user) + if(.) + return TRUE var/choice = tgui_input_list(user, "What element would you like to customize?", "Customize Card", list("Band","Stamp","Reset")) if(!choice) return diff --git a/code/game/objects/items/weapons/id cards/id_stacks.dm b/code/game/objects/items/weapons/id cards/id_stacks.dm index b37342aae5..12cb2008a7 100644 --- a/code/game/objects/items/weapons/id cards/id_stacks.dm +++ b/code/game/objects/items/weapons/id cards/id_stacks.dm @@ -370,6 +370,7 @@ name = "Syndicate ID" initial_sprite_stack = list("base-stamp-dark", "top-syndicate", "stamp-s") rank = JOB_SYNDICATE + special_handling = TRUE /obj/item/card/id/syndicate/officer name = "Syndicate Officer ID" diff --git a/code/game/objects/items/weapons/id cards/station_ids.dm b/code/game/objects/items/weapons/id cards/station_ids.dm index 3debc4fca6..fa7bb4e9bd 100644 --- a/code/game/objects/items/weapons/id cards/station_ids.dm +++ b/code/game/objects/items/weapons/id cards/station_ids.dm @@ -104,12 +104,18 @@ return data -/obj/item/card/id/attack_self(mob/user as mob) +/obj/item/card/id/attack_self(mob/user, show_id = FALSE) + . = ..(user) + if(.) + return TRUE + if(special_handling && !show_id) + return FALSE + if(can_configure && !configured) + return FALSE user.visible_message("\The [user] shows you: [icon2html(src,viewers(src))] [src.name]. The assignment on the card: [src.assignment]",\ "You flash your ID card: [icon2html(src, user.client)] [src.name]. The assignment on the card: [src.assignment]") src.add_fingerprint(user) - return /obj/item/card/id/GetAccess() return access @@ -338,15 +344,75 @@ //Event IDs /obj/item/card/id/event - var/configured = 0 + can_configure = TRUE var/accessset = 0 initial_sprite_stack = list() var/list/title_strings = list() var/preset_rank = FALSE + ///What type of polymorphic card we have. 0 = none. 1 = take our job state 2 = allow us to select an icon. + var/polymorphic_type = 0 + var/base_icon_state -/obj/item/card/id/event/attack_self(var/mob/user) - if(configured == 1) - return ..() +/obj/item/card/id/event/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE + if(configured) + return FALSE + if(polymorphic_type == 1) + icon_state = user.job + base_icon_state = user.job + else if(polymorphic_type == 2) + var/list/jobs_to_icon = list( //ITG only has a few kinds of icons so we have to group them up! + JOB_PILOT = "itg", + JOB_ALT_VISITOR = "itg", + JOB_QUARTERMASTER = "itg", + JOB_CARGO_TECHNICIAN = "itg", + JOB_SHAFT_MINER = "itg", + JOB_INTERN = "itg", + JOB_TALON_PILOT = "itg", + JOB_TALON_MINER = "itg", + JOB_BARTENDER = "itg_green", + JOB_BOTANIST = "itg_green", + JOB_CHEF = "itg_green", + JOB_JANITOR = "itg_green", + JOB_CHAPLAIN = "itg_green", + JOB_ENTERTAINER = "itg_green", + JOB_LIBRARIAN = "itg_green", + JOB_WARDEN = "itg_red", + JOB_DETECTIVE = "itg_red", + JOB_SECURITY_OFFICER = "itg_red", + JOB_TALON_GUARD = "itg_red", + JOB_ROBOTICIST = "itg_purple", + JOB_SCIENTIST = "itg_purple", + JOB_XENOBIOLOGIST = "itg_purple", + JOB_XENOBOTANIST = "itg_purple", + JOB_PATHFINDER = "itg_purple", + JOB_EXPLORER = "itg_purple", + JOB_CHEMIST = "itg_white", + JOB_MEDICAL_DOCTOR = "itg_white", + JOB_PARAMEDIC = "itg_white", + JOB_PSYCHIATRIST = "itg_white", + JOB_FIELD_MEDIC = "itg_white", + JOB_TALON_DOCTOR = "itg_white", + JOB_ATMOSPHERIC_TECHNICIAN = "itg_orange", + JOB_ENGINEER = "itg_orange", + JOB_OFFDUTY_OFFICER = "itg_red", + JOB_OFFDUTY_ENGINEER = "itg_orange", + JOB_OFFDUTY_MEDIC = "itg_white", + JOB_OFFDUTY_SCIENTIST = "itg_purple", + JOB_OFFDUTY_CARGO = "itg", + JOB_OFFDUTY_EXPLORER = "itg_purple", + JOB_OFFDUTY_WORKER = "itg_green" + ) + var/guess = jobs_to_icon[user.job] + + if(!guess) + to_chat(user, span_notice("ITG Cards do not seem to be able to accept the access codes for your ID.")) + return + else + icon_state = guess + base_icon_state = guess if(!preset_rank) var/title @@ -361,10 +427,12 @@ if(title_strings.len) var/tempname = pick(title_strings) name = tempname + " ([assignment])" + else if(polymorphic_type == 2) + name = user.name + "'s ITG ID card" + " ([assignment])" else name = user.name + "'s ID card" + " ([assignment])" - configured = 1 + configured = TRUE to_chat(user, span_notice("Card settings set.")) /obj/item/card/id/event/attackby(obj/item/I, var/mob/user) @@ -511,7 +579,7 @@ icon_state = "pinkGold" /obj/item/card/id/event/polymorphic - var/base_icon_state + polymorphic_type = 1 /obj/item/card/id/event/polymorphic/digest_act(atom/movable/item_storage = null) var/gimmeicon = icon @@ -519,76 +587,13 @@ icon = gimmeicon icon_state = base_icon_state + "_digested" -/obj/item/card/id/event/polymorphic/altcard/attack_self(var/mob/user) - if(configured == 1) - return ..() - else - icon_state = user.job - base_icon_state = user.job - return ..() - /obj/item/card/id/event/polymorphic/altcard icon = 'icons/obj/card_alt.dmi' base_icon = 'icons/obj/card_alt.dmi' icon_state = "blank" name = "contractor identification card" desc = "An ID card typically used by contractors." - -/obj/item/card/id/event/polymorphic/itg/attack_self(var/mob/user) - if(!configured) - var/list/jobs_to_icon = list( //ITG only has a few kinds of icons so we have to group them up! - JOB_PILOT = "itg", - JOB_ALT_VISITOR = "itg", - JOB_QUARTERMASTER = "itg", - JOB_CARGO_TECHNICIAN = "itg", - JOB_SHAFT_MINER = "itg", - JOB_INTERN = "itg", - JOB_TALON_PILOT = "itg", - JOB_TALON_MINER = "itg", - JOB_BARTENDER = "itg_green", - JOB_BOTANIST = "itg_green", - JOB_CHEF = "itg_green", - JOB_JANITOR = "itg_green", - JOB_CHAPLAIN = "itg_green", - JOB_ENTERTAINER = "itg_green", - JOB_LIBRARIAN = "itg_green", - JOB_WARDEN = "itg_red", - JOB_DETECTIVE = "itg_red", - JOB_SECURITY_OFFICER = "itg_red", - JOB_TALON_GUARD = "itg_red", - JOB_ROBOTICIST = "itg_purple", - JOB_SCIENTIST = "itg_purple", - JOB_XENOBIOLOGIST = "itg_purple", - JOB_XENOBOTANIST = "itg_purple", - JOB_PATHFINDER = "itg_purple", - JOB_EXPLORER = "itg_purple", - JOB_CHEMIST = "itg_white", - JOB_MEDICAL_DOCTOR = "itg_white", - JOB_PARAMEDIC = "itg_white", - JOB_PSYCHIATRIST = "itg_white", - JOB_FIELD_MEDIC = "itg_white", - JOB_TALON_DOCTOR = "itg_white", - JOB_ATMOSPHERIC_TECHNICIAN = "itg_orange", - JOB_ENGINEER = "itg_orange", - JOB_OFFDUTY_OFFICER = "itg_red", - JOB_OFFDUTY_ENGINEER = "itg_orange", - JOB_OFFDUTY_MEDIC = "itg_white", - JOB_OFFDUTY_SCIENTIST = "itg_purple", - JOB_OFFDUTY_CARGO = "itg", - JOB_OFFDUTY_EXPLORER = "itg_purple", - JOB_OFFDUTY_WORKER = "itg_green" - ) - var/guess = jobs_to_icon[user.job] - - if(!guess) - to_chat(user, span_notice("ITG Cards do not seem to be able to accept the access codes for your ID.")) - return - else - icon_state = guess - base_icon_state = guess - . = ..() - name = user.name + "'s ITG ID card" + " ([assignment])" - + polymorphic_type = 1 /obj/item/card/id/event/polymorphic/itg/attackby(obj/item/I as obj, var/mob/user) if(istype(I, /obj/item/card/id) && !accessset) @@ -607,3 +612,4 @@ icon_state = "itg" name = "\improper ITG identification card" desc = "A small card designating affiliation with the Ironcrest Transport Group. It has a NanoTrasen insignia and a lot of very small print on the back to do with practices and regulations for contractors to use." + polymorphic_type = 2 diff --git a/code/game/objects/items/weapons/id cards/syndicate_ids.dm b/code/game/objects/items/weapons/id cards/syndicate_ids.dm index 2a86420566..82aa7bd849 100644 --- a/code/game/objects/items/weapons/id cards/syndicate_ids.dm +++ b/code/game/objects/items/weapons/id cards/syndicate_ids.dm @@ -33,7 +33,10 @@ if(player_is_antag(user.mind) || registered_user == user) to_chat(user, span_notice("The microscanner activates as you pass it over the ID, copying its access.")) -/obj/item/card/id/syndicate/attack_self(mob/user as mob) +/obj/item/card/id/syndicate/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE // We use the fact that registered_name is not unset should the owner be vaporized, to ensure the id doesn't magically become unlocked. if(!registered_user && register_user(user)) to_chat(user, span_notice("The microscanner marks you as its owner, preventing others from accessing its internals.")) @@ -44,9 +47,7 @@ if("Edit") agentcard_module.tgui_interact(user) if("Show") - ..() - else - ..() + ..(user, TRUE) /obj/item/card/id/syndicate/proc/register_user(var/mob/user) diff --git a/code/game/objects/items/weapons/implants/implant_vr.dm b/code/game/objects/items/weapons/implants/implant_vr.dm index 874a9042ed..6f2b06b66d 100644 --- a/code/game/objects/items/weapons/implants/implant_vr.dm +++ b/code/game/objects/items/weapons/implants/implant_vr.dm @@ -151,6 +151,7 @@ Due to the small chemical capacity of the implant, the life of the implant is re entities to perform espionage and in some parts of space are used off the books for interrogation. Most of the makers of these modified implants have put in \ safeties to prevent lethal or actively harmful commands from being input to lessen the severity of the crime if they are caught. This one has a golden stamp \ with the shape of a star on it, the letters 'KE' in black text on it." + special_handling = TRUE /obj/item/implanter/compliance/Initialize(mapload) . = ..() @@ -158,6 +159,9 @@ Due to the small chemical capacity of the implant, the life of the implant is re update() /obj/item/implanter/compliance/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE if(istype(imp,/obj/item/implant/compliance)) var/obj/item/implant/compliance/implant = imp var/newlaws = tgui_input_text(user, "Please Input Laws", "Compliance Laws", "", multiline = TRUE, prevent_enter = TRUE) diff --git a/code/game/objects/items/weapons/implants/implantcircuits.dm b/code/game/objects/items/weapons/implants/implantcircuits.dm index 4cdf8b497d..4c0d1be144 100644 --- a/code/game/objects/items/weapons/implants/implantcircuits.dm +++ b/code/game/objects/items/weapons/implants/implantcircuits.dm @@ -46,4 +46,7 @@ ..() /obj/item/implant/integrated_circuit/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE IC.attack_self(user) diff --git a/code/game/objects/items/weapons/implants/implanter.dm b/code/game/objects/items/weapons/implants/implanter.dm index 509b0dfb39..065e3d40a7 100644 --- a/code/game/objects/items/weapons/implants/implanter.dm +++ b/code/game/objects/items/weapons/implants/implanter.dm @@ -9,8 +9,15 @@ matter = list(MAT_STEEL = 1000, MAT_GLASS = 1000) var/obj/item/implant/imp = null var/active = 1 + ///Var for attack_self chain + var/special_handling = FALSE -/obj/item/implanter/attack_self(var/mob/user) +/obj/item/implanter/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE + if(special_handling) + return FALSE active = !active to_chat(user, span_notice("You [active ? "" : "de"]activate \the [src].")) update() diff --git a/code/game/objects/items/weapons/implants/implantpad.dm b/code/game/objects/items/weapons/implants/implantpad.dm index d07bfe2db6..85be596144 100644 --- a/code/game/objects/items/weapons/implants/implantpad.dm +++ b/code/game/objects/items/weapons/implants/implantpad.dm @@ -47,7 +47,10 @@ return -/obj/item/implantpad/attack_self(mob/user as mob) +/obj/item/implantpad/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE user.set_machine(src) var/dat = span_bold("Implant Mini-Computer:") + "
" if (src.case) diff --git a/code/game/objects/items/weapons/inducer_vr.dm b/code/game/objects/items/weapons/inducer_vr.dm index 73f58a6706..3bcfa5c4db 100644 --- a/code/game/objects/items/weapons/inducer_vr.dm +++ b/code/game/objects/items/weapons/inducer_vr.dm @@ -184,6 +184,9 @@ recharging = FALSE /obj/item/inducer/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE if(opened && cell) user.visible_message(span_notice("[user] removes [cell] from [src]!"), span_notice("You remove [cell].")) cell.update_icon() diff --git a/code/game/objects/items/weapons/material/chainsaw.dm b/code/game/objects/items/weapons/material/chainsaw.dm index e3373d863c..3d2f0b9cd4 100644 --- a/code/game/objects/items/weapons/material/chainsaw.dm +++ b/code/game/objects/items/weapons/material/chainsaw.dm @@ -58,7 +58,10 @@ on = 0 update_icon() -/obj/item/chainsaw/attack_self(mob/user as mob) +/obj/item/chainsaw/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE if(!on) turnOn(user) else diff --git a/code/game/objects/items/weapons/material/gravemarker.dm b/code/game/objects/items/weapons/material/gravemarker.dm index e12a53204e..57a8144931 100644 --- a/code/game/objects/items/weapons/material/gravemarker.dm +++ b/code/game/objects/items/weapons/material/gravemarker.dm @@ -56,6 +56,9 @@ ..() /obj/item/material/gravemarker/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE src.add_fingerprint(user) if(!isturf(user.loc)) diff --git a/code/game/objects/items/weapons/material/knives.dm b/code/game/objects/items/weapons/material/knives.dm index 15e3a634ae..86715b6424 100644 --- a/code/game/objects/items/weapons/material/knives.dm +++ b/code/game/objects/items/weapons/material/knives.dm @@ -45,6 +45,9 @@ thrown_force_divisor = 0.2 // 4 when thrown with weight 20 (steel) /obj/item/material/butterfly/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE active = !active update_force() diff --git a/code/game/objects/items/weapons/material/misc.dm b/code/game/objects/items/weapons/material/misc.dm index 1bbf1c1370..ef3fe4706b 100644 --- a/code/game/objects/items/weapons/material/misc.dm +++ b/code/game/objects/items/weapons/material/misc.dm @@ -85,7 +85,10 @@ w_class = ITEMSIZE_SMALL attack_verb = list("mushed", "splatted", "splooshed", "splushed") // Words that totally exist. -/obj/item/material/snow/snowball/attack_self(mob/user as mob) +/obj/item/material/snow/snowball/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE if(user.a_intent == I_HURT) to_chat(user, span_notice("You smash the snowball in your hand.")) var/atom/S = new /obj/item/stack/material/snow(user.loc) @@ -212,6 +215,9 @@ return /obj/item/material/whip/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE user.visible_message(span_warning("\The [user] cracks \the [src]!")) playsound(src, 'sound/effects/snap.ogg', 50, 1) diff --git a/code/game/objects/items/weapons/medigun/linked_medigun.dm b/code/game/objects/items/weapons/medigun/linked_medigun.dm index 40c5fc8409..ef4862dd4a 100644 --- a/code/game/objects/items/weapons/medigun/linked_medigun.dm +++ b/code/game/objects/items/weapons/medigun/linked_medigun.dm @@ -29,6 +29,9 @@ return (medigun_base_unit.bcell && medigun_base_unit.bcell.checked_use(charge_amt)) /obj/item/bork_medigun/linked/attack_self(mob/living/user) + . = ..(user) + if(.) + return TRUE if(medigun_base_unit.is_twohanded()) update_twohanding() if(busy) diff --git a/code/game/objects/items/weapons/melee/energy.dm b/code/game/objects/items/weapons/melee/energy.dm index 6bd03c4f35..e732c39819 100644 --- a/code/game/objects/items/weapons/melee/energy.dm +++ b/code/game/objects/items/weapons/melee/energy.dm @@ -23,6 +23,8 @@ slot_l_hand_str = 'icons/mob/items/lefthand_melee.dmi', slot_r_hand_str = 'icons/mob/items/righthand_melee.dmi', ) + ///Var for attack_self handling + var/special_handling = FALSE /obj/item/melee/energy/sword/green colorable = FALSE @@ -96,7 +98,12 @@ else . += span_warning("The blade does not have a power source installed.") -/obj/item/melee/energy/attack_self(mob/living/user as mob) +/obj/item/melee/energy/attack_self(mob/living/user) + . = ..(user) + if(.) + return TRUE + if(special_handling) + return FALSE if(use_cell) if((!bcell || bcell.charge < hitcost) && !active) to_chat(user, span_notice("\The [src] does not seem to have power.")) @@ -438,6 +445,7 @@ var/datum/effect/effect/system/spark_spread/spark_system projectile_parry_chance = 60 lcolor = "#00FF00" + special_handling = TRUE /obj/item/melee/energy/blade/Initialize(mapload) . = ..() @@ -452,7 +460,10 @@ STOP_PROCESSING(SSobj, src) . = ..() -/obj/item/melee/energy/blade/attack_self(mob/user as mob) +/obj/item/melee/energy/blade/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE user.drop_from_inventory(src) QDEL_IN(src, 1) diff --git a/code/game/objects/items/weapons/melee/misc.dm b/code/game/objects/items/weapons/melee/misc.dm index 950b6a61ca..0ecbcfe0ef 100644 --- a/code/game/objects/items/weapons/melee/misc.dm +++ b/code/game/objects/items/weapons/melee/misc.dm @@ -41,8 +41,11 @@ . = ..() update_icon() -/obj/item/melee/umbrella/attack_self() - src.toggle_umbrella() +/obj/item/melee/umbrella/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE + toggle_umbrella() /obj/item/melee/umbrella/proc/toggle_umbrella() open = !open diff --git a/code/game/objects/items/weapons/melee/shock_maul.dm b/code/game/objects/items/weapons/melee/shock_maul.dm index 88ceca36c4..397237847b 100644 --- a/code/game/objects/items/weapons/melee/shock_maul.dm +++ b/code/game/objects/items/weapons/melee/shock_maul.dm @@ -195,6 +195,9 @@ return ..() /obj/item/melee/shock_maul/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE if(!user.IsAdvancedToolUser()) return if(!status && bcell && bcell.charge >= hitcost) diff --git a/code/game/objects/items/weapons/mop_deploy.dm b/code/game/objects/items/weapons/mop_deploy.dm index 2b8c602f00..48b33a21af 100644 --- a/code/game/objects/items/weapons/mop_deploy.dm +++ b/code/game/objects/items/weapons/mop_deploy.dm @@ -54,7 +54,10 @@ STOP_PROCESSING(SSobj, src) . = ..() -/obj/item/mop_deploy/attack_self(mob/user as mob) +/obj/item/mop_deploy/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE user.drop_from_inventory(src) spawn(1) if(!QDELETED(src)) qdel(src) diff --git a/code/game/objects/items/weapons/policetape.dm b/code/game/objects/items/weapons/policetape.dm index a2d318fcf0..507bb38dee 100644 --- a/code/game/objects/items/weapons/policetape.dm +++ b/code/game/objects/items/weapons/policetape.dm @@ -138,7 +138,10 @@ var/list/tape_roll_applications = list() update_icon() return ..() -/obj/item/taperoll/attack_self(mob/user as mob) +/obj/item/taperoll/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE if(!start) start = get_turf(src) to_chat(user, span_notice("You place the first end of \the [src].")) diff --git a/code/game/objects/items/weapons/scrolls.dm b/code/game/objects/items/weapons/scrolls.dm index 7d5c5f07cb..d89aa621e5 100644 --- a/code/game/objects/items/weapons/scrolls.dm +++ b/code/game/objects/items/weapons/scrolls.dm @@ -14,7 +14,10 @@ throw_range = 20 origin_tech = list(TECH_BLUESPACE = 4) -/obj/item/teleportation_scroll/attack_self(mob/user as mob) +/obj/item/teleportation_scroll/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE if((user.mind && !wizards.is_antagonist(user.mind))) to_chat(user, span_warning("You stare at the scroll but cannot make sense of the markings!")) return diff --git a/code/game/objects/items/weapons/shields.dm b/code/game/objects/items/weapons/shields.dm index cfb7323dd2..9d98bd8560 100644 --- a/code/game/objects/items/weapons/shields.dm +++ b/code/game/objects/items/weapons/shields.dm @@ -153,7 +153,10 @@ return (base_block_chance - round(damage / 3)) //block bullets and beams using the old block chance return base_block_chance -/obj/item/shield/energy/attack_self(mob/living/user as mob) +/obj/item/shield/energy/attack_self(mob/living/user) + . = ..(user) + if(.) + return TRUE if ((CLUMSY in user.mutations) && prob(50)) to_chat(user, span_warning("You beat yourself in the head with [src].")) user.take_organ_damage(5) @@ -238,6 +241,9 @@ return 0 */ /obj/item/shield/riot/tele/attack_self(mob/living/user) + . = ..(user) + if(.) + return TRUE active = !active icon_state = "teleriot[active]" playsound(src, 'sound/weapons/empty.ogg', 50, 1) diff --git a/code/game/objects/items/weapons/shields_vr.dm b/code/game/objects/items/weapons/shields_vr.dm index b02800c267..944db47cf8 100644 --- a/code/game/objects/items/weapons/shields_vr.dm +++ b/code/game/objects/items/weapons/shields_vr.dm @@ -41,6 +41,9 @@ //POURPEL WHY U NO COVER /obj/item/shield/riot/explorer/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE if(brightness_on) if(!isturf(user.loc)) to_chat(user, "You cannot turn the light on while in this [user.loc]") @@ -53,8 +56,6 @@ var/mob/living/carbon/human/H = user H.update_inv_l_hand() H.update_inv_r_hand() - else - return ..(user) /obj/item/shield/riot/explorer/proc/update_flashlight(var/mob/user = null) if(on && !light_applied) diff --git a/code/game/objects/items/weapons/storage/bible.dm b/code/game/objects/items/weapons/storage/bible.dm index ea777e9a5e..51c6d9f2bd 100644 --- a/code/game/objects/items/weapons/storage/bible.dm +++ b/code/game/objects/items/weapons/storage/bible.dm @@ -35,8 +35,12 @@ GLOBAL_LIST_INIT(bibleitemstates, list( var/deity_name = "Christ" use_sound = 'sound/bureaucracy/bookopen.ogg' drop_sound = 'sound/bureaucracy/bookclose.ogg' + special_handling = TRUE /obj/item/storage/bible/attack_self(mob/living/carbon/human/user) + . = ..(user) + if(.) + return TRUE if(user?.mind?.assigned_role != JOB_CHAPLAIN) return FALSE diff --git a/code/game/objects/items/weapons/storage/boxes.dm b/code/game/objects/items/weapons/storage/boxes.dm index 71b74feec4..25793869b2 100644 --- a/code/game/objects/items/weapons/storage/boxes.dm +++ b/code/game/objects/items/weapons/storage/boxes.dm @@ -36,8 +36,10 @@ pickup_sound = 'sound/items/pickup/cardboardbox.ogg' // BubbleWrap - A box can be folded up to make card -/obj/item/storage/box/attack_self(mob/user as mob) - if(..()) return +/obj/item/storage/box/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE //try to fold it if(ispath(foldable)) diff --git a/code/game/objects/items/weapons/storage/laundry_basket.dm b/code/game/objects/items/weapons/storage/laundry_basket.dm index 916964c1e9..340fb24684 100644 --- a/code/game/objects/items/weapons/storage/laundry_basket.dm +++ b/code/game/objects/items/weapons/storage/laundry_basket.dm @@ -36,11 +36,6 @@ return return ..() -/obj/item/storage/laundry_basket/attack_self(mob/user as mob) - var/turf/T = get_turf(user) - to_chat(user, span_notice("You dump the [src]'s contents onto \the [T].")) - return ..() - /obj/item/storage/laundry_basket/pickup(mob/user) var/obj/item/storage/laundry_basket/offhand/O = new(user) O.name = "[name] - second hand" diff --git a/code/game/objects/items/weapons/storage/mre.dm b/code/game/objects/items/weapons/storage/mre.dm index d581644246..3633fe49ea 100644 --- a/code/game/objects/items/weapons/storage/mre.dm +++ b/code/game/objects/items/weapons/storage/mre.dm @@ -21,6 +21,7 @@ MRE Stuff /obj/random/mre/sauce, /obj/item/material/kitchen/utensil/spoon/plastic ) + special_handling = TRUE /obj/item/storage/mre/examine(mob/user) . = ..() @@ -32,6 +33,9 @@ MRE Stuff . = ..() /obj/item/storage/mre/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE open(user) /obj/item/storage/mre/open(mob/user) @@ -222,6 +226,7 @@ MRE Stuff max_w_class = ITEMSIZE_SMALL var/opened = FALSE starts_with = list(/obj/item/reagent_containers/food/snacks/slice/meatpizza/filled) + special_handling = TRUE /obj/item/storage/mrebag/Initialize(mapload) . = ..() @@ -232,6 +237,9 @@ MRE Stuff . = ..() /obj/item/storage/mrebag/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE open(user) /obj/item/storage/mrebag/open(mob/user) diff --git a/code/game/objects/items/weapons/storage/secure.dm b/code/game/objects/items/weapons/storage/secure.dm index 814c8e0c82..d2fa5bebc3 100644 --- a/code/game/objects/items/weapons/storage/secure.dm +++ b/code/game/objects/items/weapons/storage/secure.dm @@ -27,6 +27,7 @@ max_w_class = ITEMSIZE_SMALL max_storage_space = ITEMSIZE_SMALL * 7 use_sound = 'sound/items/storage/briefcase.ogg' + special_handling = TRUE /obj/item/storage/secure/examine(mob/user) . = ..() @@ -92,7 +93,10 @@ src.add_fingerprint(user) return -/obj/item/storage/secure/attack_self(mob/user as mob) +/obj/item/storage/secure/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE tgui_interact(user) /obj/item/storage/secure/tgui_interact(mob/user, datum/tgui/ui = null) diff --git a/code/game/objects/items/weapons/storage/storage.dm b/code/game/objects/items/weapons/storage/storage.dm index 565d89d174..99a0f521cf 100644 --- a/code/game/objects/items/weapons/storage/storage.dm +++ b/code/game/objects/items/weapons/storage/storage.dm @@ -51,6 +51,8 @@ var/empty //Mapper override to spawn an empty version of a container that usually has stuff /// If you can use this storage while in a pocket var/pocketable = FALSE + /// Used for attack_self chain + var/special_handling = FALSE /obj/item/storage/Initialize(mapload) . = ..() @@ -697,11 +699,16 @@ total_storage_space += I.get_storage_cost() max_storage_space = max(total_storage_space,max_storage_space) //Prevents spawned containers from being too small for their contents. -/obj/item/storage/attack_self(mob/user as mob) +/obj/item/storage/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE + if(special_handling) + return FALSE if((user.get_active_hand() == src) || (isrobot(user)) && allow_quick_empty) if(src.verbs.Find(/obj/item/storage/verb/quick_empty)) src.quick_empty() - return 1 + return TRUE //Returns the storage depth of an atom. This is the number of storage items the atom is contained in before reaching toplevel (the area). //Returns -1 if the atom was not found on container. @@ -787,6 +794,7 @@ ) var/open_state var/closed_state + special_handling = TRUE /obj/item/storage/trinketbox/update_icon() cut_overlays() @@ -813,10 +821,12 @@ closed_state = "[initial(icon_state)]" . = ..() -/obj/item/storage/trinketbox/attack_self() +/obj/item/storage/trinketbox/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE open = !open update_icon() - ..() /obj/item/storage/trinketbox/examine(mob/user) . = ..() diff --git a/code/game/objects/items/weapons/stunbaton.dm b/code/game/objects/items/weapons/stunbaton.dm index a1f78a668f..785749a35b 100644 --- a/code/game/objects/items/weapons/stunbaton.dm +++ b/code/game/objects/items/weapons/stunbaton.dm @@ -24,6 +24,9 @@ var/grip_safety = TRUE var/taped_safety = FALSE + ///Var for attack_self chain + var/special_handling = FALSE + /obj/item/melee/baton/Initialize(mapload) . = ..() update_icon() @@ -153,6 +156,11 @@ return ..() /obj/item/melee/baton/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE + if(special_handling) + return FALSE if(bcell && bcell.charge >= hitcost) status = !status to_chat(user, span_notice("[src] is now [status ? "on" : "off"].")) diff --git a/code/game/objects/items/weapons/swords_axes_etc.dm b/code/game/objects/items/weapons/swords_axes_etc.dm index 3457c08209..78324b394c 100644 --- a/code/game/objects/items/weapons/swords_axes_etc.dm +++ b/code/game/objects/items/weapons/swords_axes_etc.dm @@ -55,7 +55,10 @@ pickup_sound = 'sound/items/pickup/crowbar.ogg' var/on = 0 -/obj/item/melee/telebaton/attack_self(mob/user as mob) +/obj/item/melee/telebaton/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE on = !on if(on) user.visible_message(span_warning("With a flick of their wrist, [user] extends their telescopic baton."),\ diff --git a/code/game/objects/items/weapons/syndie.dm b/code/game/objects/items/weapons/syndie.dm index 0221ac5e18..69a31b59e9 100644 --- a/code/game/objects/items/weapons/syndie.dm +++ b/code/game/objects/items/weapons/syndie.dm @@ -78,16 +78,18 @@ /*Click it when closed to open, when open to bring up a prompt asking you if you want to close it or press the button.*/ /obj/item/flame/lighter/zippo/c4detonator - var/detonator_mode = 0 var/obj/item/syndie/c4explosive/bomb -/obj/item/flame/lighter/zippo/c4detonator/attack_self(mob/user as mob) +/obj/item/flame/lighter/zippo/c4detonator/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE if(!detonator_mode) - ..() + return FALSE - else if(!lit) + if(!lit) base_state = icon_state - lit = 1 + lit = TRUE icon_state = "[base_state]1" //item_state = "[base_state]on" user.visible_message(span_rose("Without even breaking stride, \the [user] flips open \the [src] in one smooth movement.")) @@ -97,13 +99,15 @@ if("Press the button.") to_chat(user, span_warning("You press the button.")) icon_state = "[base_state]click" - if(src.bomb) - src.bomb.detonate() - log_admin("[key_name(user)] has triggered [src.bomb] with [src].") - message_admins(span_danger("[key_name_admin(user)] has triggered [src.bomb] with [src].")) + if(bomb) + var/obj/item/syndie/c4explosive/bomb_to_explode = bomb + bomb = null //clear up our ref + bomb_to_explode.detonate() + log_admin("[key_name(user)] has triggered [bomb_to_explode] with [src].") + message_admins(span_danger("[key_name_admin(user)] has triggered [bomb_to_explode] with [src].")) if("Close the lighter.") - lit = 0 + lit = FALSE icon_state = "[base_state]" //item_state = "[base_state]" user.visible_message(span_rose("You hear a quiet click, as \the [user] shuts off \the [src] without even looking at what they're doing.")) diff --git a/code/game/objects/items/weapons/tanks/tanks.dm b/code/game/objects/items/weapons/tanks/tanks.dm index 99fc3c4408..7f8bf9db69 100644 --- a/code/game/objects/items/weapons/tanks/tanks.dm +++ b/code/game/objects/items/weapons/tanks/tanks.dm @@ -209,7 +209,10 @@ var/list/global/tank_gauge_cache = list() -/obj/item/tank/attack_self(mob/user as mob) +/obj/item/tank/attack_self(mob/user) + . = ..(user) + if(.) + return add_fingerprint(user) if (!(src.air_contents)) return diff --git a/code/game/objects/items/weapons/tape.dm b/code/game/objects/items/weapons/tape.dm index 3010dac351..ed7b177424 100644 --- a/code/game/objects/items/weapons/tape.dm +++ b/code/game/objects/items/weapons/tape.dm @@ -135,6 +135,9 @@ overlays = W.overlays /obj/item/ducttape/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE if(!stuck) return diff --git a/code/game/objects/items/weapons/teleportation.dm b/code/game/objects/items/weapons/teleportation.dm index 4f9a3154fa..a3c012df37 100644 --- a/code/game/objects/items/weapons/teleportation.dm +++ b/code/game/objects/items/weapons/teleportation.dm @@ -25,7 +25,10 @@ pickup_sound = 'sound/items/pickup/device.ogg' drop_sound = 'sound/items/drop/device.ogg' -/obj/item/locator/attack_self(mob/user as mob) +/obj/item/locator/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE user.set_machine(src) var/dat if (src.temp) @@ -132,7 +135,10 @@ Frequency: matter = list(MAT_STEEL = 10000) preserve_item = 1 -/obj/item/hand_tele/attack_self(mob/user as mob) +/obj/item/hand_tele/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE var/turf/current_location = get_turf(user)//What turf is the user on? if(!current_location || (current_location.z in using_map.admin_levels) || current_location.block_tele)//If turf was not found or they're on z level 2 or >7 which does not currently exist. to_chat(user, span_notice("\The [src] is malfunctioning.")) diff --git a/code/game/objects/items/weapons/tools/combitool.dm b/code/game/objects/items/weapons/tools/combitool.dm index 45d4a93d96..8093e9b020 100644 --- a/code/game/objects/items/weapons/tools/combitool.dm +++ b/code/game/objects/items/weapons/tools/combitool.dm @@ -36,14 +36,16 @@ for(var/type in spawn_tools) tools |= new type(src) -/obj/item/combitool/attack_self(mob/user as mob) +/obj/item/combitool/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE if(++current_tool > tools.len) current_tool = 1 var/obj/item/tool = tools[current_tool] if(!tool) to_chat(user, "You can't seem to find any fittings in \the [src].") else to_chat(user, "You switch \the [src] to the [tool.name] fitting.") - return 1 /obj/item/combitool/attack(mob/living/carbon/M as mob, mob/living/carbon/user as mob) if(!M.Adjacent(user)) diff --git a/code/game/objects/items/weapons/tools/transforming.dm b/code/game/objects/items/weapons/tools/transforming.dm index b4d8c2a429..7e231d13a2 100644 --- a/code/game/objects/items/weapons/tools/transforming.dm +++ b/code/game/objects/items/weapons/tools/transforming.dm @@ -21,6 +21,9 @@ return welder /obj/item/tool/transforming/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE if(!possible_tooltypes.len || possible_tooltypes.len < 2) return if(current_tooltype == possible_tooltypes.len) diff --git a/code/game/objects/items/weapons/tools/weldingtool.dm b/code/game/objects/items/weapons/tools/weldingtool.dm index c12b958491..17cc039ee3 100644 --- a/code/game/objects/items/weapons/tools/weldingtool.dm +++ b/code/game/objects/items/weapons/tools/weldingtool.dm @@ -170,6 +170,9 @@ if (istype(location, /turf)) location.hotspot_expose(700, 50, 1) /obj/item/weldingtool/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE setWelding(!welding, user) //Returns the amount of fuel in the welder diff --git a/code/game/objects/items/weapons/towels.dm b/code/game/objects/items/weapons/towels.dm index a30f8d7d8d..7212e074f1 100644 --- a/code/game/objects/items/weapons/towels.dm +++ b/code/game/objects/items/weapons/towels.dm @@ -21,7 +21,10 @@ if(slot_belt) sprite_sheets = list(SPECIES_TESHARI = 'icons/inventory/belt/mob_teshari.dmi') -/obj/item/towel/attack_self(mob/living/user as mob) +/obj/item/towel/attack_self(mob/living/user) + . = ..(user) + if(.) + return TRUE user.visible_message(span_notice("[user] uses [src] to towel themselves off.")) playsound(src, 'sound/weapons/towelwipe.ogg', 25, 1) if(user.fire_stacks > 0) diff --git a/code/game/objects/items/weapons/traps.dm b/code/game/objects/items/weapons/traps.dm index a63d04b96e..8ca9e93d1e 100644 --- a/code/game/objects/items/weapons/traps.dm +++ b/code/game/objects/items/weapons/traps.dm @@ -34,8 +34,10 @@ /obj/item/beartrap/proc/can_use(mob/user) return (user.IsAdvancedToolUser() && !issilicon(user) && !user.stat && !user.restrained()) -/obj/item/beartrap/attack_self(mob/user as mob) - ..() +/obj/item/beartrap/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE if(!deployed && can_use(user)) user.visible_message( span_danger("[user] starts to deploy \the [src]."), @@ -218,8 +220,10 @@ else ..() -/obj/item/material/barbedwire/attack_self(mob/user as mob) - ..() +/obj/item/material/barbedwire/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE if(!anchored && can_use(user)) user.visible_message( span_danger("[user] starts to deploy \the [src]."), diff --git a/code/game/objects/mail.dm b/code/game/objects/mail.dm index c5eb395765..239f3a3567 100644 --- a/code/game/objects/mail.dm +++ b/code/game/objects/mail.dm @@ -8,14 +8,14 @@ drop_sound = 'sound/items/drop/paper.ogg' pickup_sound = 'sound/items/pickup/paper.ogg' mouse_drag_pointer = MOUSE_ACTIVE_POINTER - // Destination tagging for the mail sorter. + /// Destination tagging for the mail sorter. var/sortTag = 0 - // Who this mail is for and who can open it. + /// Who this mail is for and who can open it. var/datum/weakref/recipient_ref - // How many goodies this mail contains. + /// How many goodies this mail contains. var/goodie_count = 1 // Goodies which can be given to anyone. - // Weight sum will be 1000 + /// Weight sum will be 1000 var/list/generic_goodies = list( /obj/item/spacecash/c50 = 75, /obj/item/reagent_containers/food/drinks/cans/cola = 75, @@ -30,25 +30,28 @@ /obj/item/reagent_containers/food/drinks/bluespace_coffee = 5 ) // Overlays (pure fluff) - // Does the letter have the postmark overlay? + /// Does the letter have the postmark overlay? var/postmarked = TRUE - // Does the letter have a stamp overlay? + /// Does the letter have a stamp overlay? var/stamped = TRUE - // List of all stamp overlays on the letter. + /// List of all stamp overlays on the letter. var/list/stamps = list() - // Maximum number of stamps on the letter. + /// Maximum number of stamps on the letter. var/stamp_max = 1 - // Physical offset of stamps on the object. X direction. + /// Physical offset of stamps on the object. X direction. var/stamp_offset_x = 0 - // Physical offset of stamps on the object. Y direction. + /// Physical offset of stamps on the object. Y direction. var/stamp_offset_y = 2 - // If the mail is actively being opened right now + /// If the mail is actively being opened right now var/opening = FALSE - // If the mail has been scanned with a mail scanner + /// If the mail has been scanned with a mail scanner var/scanned - // Does it have a colored envelope? + /// Does it have a colored envelope? var/colored_envelope + ///Var for attack_self chainn + var/special_handling = FALSE + /obj/item/mail/container_resist(mob/living/M) if(istype(M, /mob/living/voice)) return if(isdisposalpacket(loc)) @@ -84,6 +87,7 @@ var/set_content = FALSE var/sealed = FALSE var/list/mail_recipients + special_handling = TRUE /obj/item/mail/blank/attackby(obj/item/W, mob/user) ..() @@ -137,13 +141,18 @@ desc = "A signed envelope, from [sender]." /obj/item/mail/blank/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE if(!sealed) if(!do_after(user, 1.5 SECONDS, target = user)) sealed = FALSE sealed = TRUE description_info = "Shift Click to add the sender's name to the envelope, or attack with a pen to set a receiver." return - . = ..() + if(!unwrap(user)) + return FALSE + return after_unwrap(user) /obj/item/mail/update_icon() . = ..() @@ -191,8 +200,13 @@ return /obj/item/mail/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE if(!unwrap(user)) return FALSE + if(special_handling) + return FALSE return after_unwrap(user) /obj/item/mail/proc/unwrap(mob/user) diff --git a/code/game/objects/structures/artstuff.dm b/code/game/objects/structures/artstuff.dm index 81e5726843..a8d813030e 100644 --- a/code/game/objects/structures/artstuff.dm +++ b/code/game/objects/structures/artstuff.dm @@ -84,7 +84,9 @@ grid[x][y] = canvas_color /obj/item/canvas/attack_self(mob/user) - . = ..() + . = ..(user) + if(.) + return TRUE tgui_interact(user) /obj/item/canvas/dropped(mob/user) diff --git a/code/game/objects/structures/bedsheet_bin.dm b/code/game/objects/structures/bedsheet_bin.dm index eb1012b82d..acd13bbd6c 100644 --- a/code/game/objects/structures/bedsheet_bin.dm +++ b/code/game/objects/structures/bedsheet_bin.dm @@ -18,12 +18,19 @@ LINEN BINS w_class = ITEMSIZE_SMALL drop_sound = 'sound/items/drop/clothing.ogg' pickup_sound = 'sound/items/pickup/clothing.ogg' + ///var used for attack_self chain + var/special_handling = FALSE /obj/item/bedsheet/Initialize(mapload) . = ..() AddElement(/datum/element/rotatable/onlyflip) -/obj/item/bedsheet/attack_self(mob/user as mob) +/obj/item/bedsheet/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE + if(special_handling) + return FALSE user.drop_item() if(layer == initial(layer)) layer = ABOVE_MOB_LAYER diff --git a/code/game/objects/structures/inflatable.dm b/code/game/objects/structures/inflatable.dm index 4f00eea6e1..cc634dfcd6 100644 --- a/code/game/objects/structures/inflatable.dm +++ b/code/game/objects/structures/inflatable.dm @@ -6,8 +6,15 @@ drop_sound = 'sound/items/drop/rubber.ogg' w_class = ITEMSIZE_NORMAL var/deploy_path = /obj/structure/inflatable + ///Var used for attack_self chain + var/special_handling = FALSE /obj/item/inflatable/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE + if(special_handling) + return FALSE inflate(user,user.loc) /obj/item/inflatable/afterattack(var/atom/A, var/mob/user) @@ -246,8 +253,12 @@ desc = "A folded membrane which rapidly expands into a large cubical shape on activation. It is too torn to be usable." icon = 'icons/obj/inflatable.dmi' icon_state = "folded_wall_torn" + special_handling = TRUE /obj/item/inflatable/torn/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE to_chat(user, span_notice("The inflatable wall is too torn to be inflated!")) add_fingerprint(user) @@ -256,8 +267,12 @@ desc = "A folded membrane which rapidly expands into a simple door on activation. It is too torn to be usable." icon = 'icons/obj/inflatable.dmi' icon_state = "folded_door_torn" + special_handling = TRUE /obj/item/inflatable/door/torn/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE to_chat(user, span_notice("The inflatable door is too torn to be inflated!")) add_fingerprint(user) diff --git a/code/game/objects/structures/pillows.dm b/code/game/objects/structures/pillows.dm index 77cb0e7ecd..3f70987e95 100644 --- a/code/game/objects/structures/pillows.dm +++ b/code/game/objects/structures/pillows.dm @@ -8,8 +8,12 @@ slot_flags = 0 var/pile_type = "/obj/structure/bed/pillowpile" throw_range = 7 + special_handling = TRUE -/obj/item/bedsheet/pillow/attack_self(mob/user as mob) +/obj/item/bedsheet/pillow/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE user.drop_item() if(icon_state == initial(icon_state)) icon_state = "[icon_state]_placed" diff --git a/code/game/objects/structures/stool_bed_chair_nest/bed.dm b/code/game/objects/structures/stool_bed_chair_nest/bed.dm index 3d802b8d94..38238a5355 100644 --- a/code/game/objects/structures/stool_bed_chair_nest/bed.dm +++ b/code/game/objects/structures/stool_bed_chair_nest/bed.dm @@ -264,6 +264,9 @@ pickup_sound = 'sound/items/pickup/axe.ogg' /obj/item/roller/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE var/obj/structure/bed/roller/R = new bedtype(user.loc) R.add_fingerprint(user) qdel(src) @@ -299,8 +302,10 @@ . = ..() held = new /obj/item/roller(src) -/obj/item/roller_holder/attack_self(mob/user as mob) - +/obj/item/roller_holder/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE if(!held) to_chat(user, span_notice("The rack is empty.")) return diff --git a/code/game/objects/structures/stool_bed_chair_nest/wheelchair_item.dm b/code/game/objects/structures/stool_bed_chair_nest/wheelchair_item.dm index d18a9a88f1..ffc3e40eb3 100644 --- a/code/game/objects/structures/stool_bed_chair_nest/wheelchair_item.dm +++ b/code/game/objects/structures/stool_bed_chair_nest/wheelchair_item.dm @@ -8,6 +8,9 @@ var/unfolded_type = /obj/structure/bed/chair/wheelchair /obj/item/wheelchair/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE var/obj/structure/bed/chair/wheelchair/R = new unfolded_type(user.loc) R.add_fingerprint(user) R.name = src.name diff --git a/code/game/objects/structures/watercloset.dm b/code/game/objects/structures/watercloset.dm index ef64395de3..4dbcdca46e 100644 --- a/code/game/objects/structures/watercloset.dm +++ b/code/game/objects/structures/watercloset.dm @@ -312,18 +312,7 @@ slot_l_hand_str = 'icons/mob/items/lefthand.dmi', slot_r_hand_str = 'icons/mob/items/righthand.dmi', ) - honk_sound = 'sound/voice/quack.ogg' //VOREStation edit - var/honk_text = 0 - -/obj/item/bikehorn/rubberducky/attack_self(mob/user) - if(spam_flag == 0) - spam_flag = 1 - playsound(src, honk_sound, 50, 1) - if(honk_text) - audible_message(span_maroon("[honk_text]")) - src.add_fingerprint(user) - addtimer(VARSET_CALLBACK(src, spam_flag, 0), 20, TIMER_DELETE_ME) - return + honk_sound = 'sound/voice/quack.ogg' //Admin spawn duckies @@ -335,21 +324,24 @@ item_state = "rubberducky_red" honk_sound = 'sound/effects/adminhelp.ogg' var/honk_count = 0 + special_handling = TRUE /obj/item/bikehorn/rubberducky/red/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE if(honk_count >= 3) var/turf/epicenter = get_turf(src) explosion(epicenter, 0, 0, 1, 3) qdel(src) return - else if(spam_flag == 0) - spam_flag = 1 + else if(cooldown <= world.time) + cooldown = (world.time + 2 SECONDS) playsound(src, honk_sound, 50, 1) - src.add_fingerprint(user) + add_fingerprint(user) if(honk_text) audible_message(span_maroon("[honk_text]")) - honk_count ++ - addtimer(VARSET_CALLBACK(src, spam_flag, 0), 20, TIMER_DELETE_ME) + honk_count++ return /obj/item/bikehorn/rubberducky/blue @@ -359,18 +351,20 @@ icon_state = "rubberducky_blue" item_state = "rubberducky_blue" honk_sound = 'sound/effects/bubbles.ogg' - var/honk_count = 0 + special_handling = TRUE /obj/item/bikehorn/rubberducky/blue/attack_self(mob/user) - if(spam_flag == 0) - var/turf/simulated/whereweare = get_turf(src) - whereweare.wet_floor(2) - spam_flag = 1 + . = ..(user) + if(.) + return TRUE + if(cooldown <= world.time) + cooldown = (world.time + 2 SECONDS) playsound(src, honk_sound, 50, 1) + add_fingerprint(user) if(honk_text) audible_message(span_maroon("[honk_text]")) - src.add_fingerprint(user) - addtimer(VARSET_CALLBACK(src, spam_flag, 0), 20, TIMER_DELETE_ME) + var/turf/simulated/whereweare = get_turf(src) + whereweare.wet_floor(2) return /obj/item/bikehorn/rubberducky/pink @@ -380,23 +374,24 @@ icon_state = "rubberducky_pink" item_state = "rubberducky_pink" honk_sound = 'sound/vore/sunesound/pred/insertion_01.ogg' - var/honk_count = 0 + special_handling = TRUE /obj/item/bikehorn/rubberducky/pink/attack_self(mob/user) - if(spam_flag == 0) + . = ..(user) + if(.) + return TRUE + if(cooldown <= world.time) if(!user.devourable) to_chat(user, span_vnotice("You can't bring yourself to squeeze it...")) return - spam_flag = 1 + cooldown = (world.time + 2 SECONDS) playsound(src, honk_sound, 50, 1) + add_fingerprint(user) if(honk_text) audible_message(span_maroon("[honk_text]")) - src.add_fingerprint(user) user.drop_item() user.forceMove(src) to_chat(user, span_vnotice("You have been swallowed alive by the rubber ducky. Your entire body compacted up and squeezed into the tiny space that makes up the oddly realistic and not at all rubbery stomach. The walls themselves are kneading over you, grinding some sort of fluids into your trapped body. You can even hear the sound of bodily functions echoing around you...")) - addtimer(VARSET_CALLBACK(src, spam_flag, 0), 20, TIMER_DELETE_ME) - return /obj/item/bikehorn/rubberducky/pink/container_resist(var/mob/living/escapee) if(isdisposalpacket(loc)) @@ -412,23 +407,26 @@ icon_state = "rubberducky_grey" item_state = "rubberducky_grey" honk_sound = 'sound/effects/ghost.ogg' - var/honk_count = 0 + special_handling = TRUE /obj/item/bikehorn/rubberducky/grey/attack_self(mob/user) - if(spam_flag == 0) + . = ..(user) + if(.) + return TRUE + if(cooldown <= world.time) + cooldown = (world.time + 2 SECONDS) + playsound(src, honk_sound, 50, 1) + add_fingerprint(user) + if(honk_text) + audible_message(span_maroon("[honk_text]")) for(var/obj/machinery/light/L in GLOB.machines) if(L.z != user.z || get_dist(user,L) > 10) continue else L.flicker(10) - spam_flag = 1 - playsound(src, honk_sound, 50, 1) - if(honk_text) - audible_message(span_maroon("[honk_text]")) - src.add_fingerprint(user) user.drop_item() var/turf/T = locate(rand(1, 140), rand(1, 140), user.z) - src.forceMove(T) + forceMove(T) return /obj/item/bikehorn/rubberducky/green @@ -438,7 +436,6 @@ icon_state = "rubberducky_green" item_state = "rubberducky_green" honk_sound = 'sound/arcade/mana.ogg' - var/honk_count = 0 var/list/flora = list(/obj/structure/flora/ausbushes, /obj/structure/flora/ausbushes/reedbush, /obj/structure/flora/ausbushes/leafybush, @@ -455,18 +452,21 @@ /obj/structure/flora/ausbushes/ppflowers, /obj/structure/flora/ausbushes/sparsegrass, /obj/structure/flora/ausbushes/fullgrass) + special_handling = TRUE /obj/item/bikehorn/rubberducky/green/attack_self(mob/user) - if(spam_flag == 0) + . = ..(user) + if(.) + return TRUE + if(cooldown <= world.time) + cooldown = (world.time + 2 SECONDS) + playsound(src, honk_sound, 50, 1) + add_fingerprint(user) + if(honk_text) + audible_message(span_maroon("[honk_text]")) var/turf/simulated/whereweare = get_turf(src) var/obj/P = pick(flora) new P(whereweare) - spam_flag = 1 - playsound(src, honk_sound, 50, 1) - if(honk_text) - audible_message(span_maroon("[honk_text]")) - src.add_fingerprint(user) - addtimer(VARSET_CALLBACK(src, spam_flag, 0), 20, TIMER_DELETE_ME) return /obj/item/bikehorn/rubberducky/white @@ -476,16 +476,19 @@ icon_state = "rubberducky_white" item_state = "rubberducky_white" honk_sound = 'sound/effects/lightningshock.ogg' - var/honk_count = 0 + special_handling = TRUE /obj/item/bikehorn/rubberducky/white/attack_self(mob/user) - if(spam_flag == 0) - lightning_strike(get_turf(src), 1) - spam_flag = 1 + . = ..(user) + if(.) + return TRUE + if(cooldown <= world.time) + cooldown = (world.time + 2 SECONDS) playsound(src, honk_sound, 50, 1) + add_fingerprint(user) if(honk_text) audible_message(span_maroon("[honk_text]")) - src.add_fingerprint(user) + lightning_strike(get_turf(src), 1) qdel(src) return @@ -505,11 +508,16 @@ icon_state = "rubberducky_gold" item_state = "rubberducky_gold" honk_sound = 'sound/voice/quack_reverb.ogg' + special_handling = TRUE /obj/item/bikehorn/rubberducky/gold/attack_self(mob/user) - if(spam_flag == 0) - spam_flag = 1 + . = ..(user) + if(.) + return TRUE + if(cooldown <= world.time) + cooldown = (world.time + 2 SECONDS) playsound(src, honk_sound, 50, 1) + add_fingerprint(user) if(honk_text) audible_message(span_maroon("[honk_text]")) if(isliving(user)) @@ -527,16 +535,20 @@ item_state = "rubberducky_viking" honk_sound = 'sound/voice/scream_jelly_m1.ogg' honk_text = "DUK ROH DAH!" + special_handling = TRUE /obj/item/bikehorn/rubberducky/viking/attack_self(mob/user) - if(spam_flag == 0) - spam_flag = 1 + . = ..(user) + if(.) + return TRUE + if(cooldown <= world.time) + cooldown = (world.time + 2 SECONDS) playsound(src, honk_sound, 50, 1) + add_fingerprint(user) if(honk_text) audible_message(span_maroon("[honk_text]")) user.drop_item() user.throw_at_random(FALSE,9,2) - addtimer(VARSET_CALLBACK(src, spam_flag, 0), 20, TIMER_DELETE_ME) return /obj/item/bikehorn/rubberducky/galaxy @@ -546,11 +558,16 @@ icon_state = "rubberducky_galaxy" item_state = "rubberducky_galaxy" honk_sound = 'sound/effects/teleport.ogg' + special_handling = TRUE /obj/item/bikehorn/rubberducky/galaxy/attack_self(mob/user) - if(spam_flag == 0) - spam_flag = 1 + . = ..(user) + if(.) + return TRUE + if(cooldown <= world.time) + cooldown = (world.time + 2 SECONDS) playsound(src, honk_sound, 50, 1) + add_fingerprint(user) if(honk_text) audible_message(span_maroon("[honk_text]")) var/list/possible_orbiters = list() @@ -560,7 +577,6 @@ possible_orbiters += M var/atom/movable/selected_orbiter = pick(possible_orbiters) selected_orbiter.orbit(user,32,TRUE,20,36) - addtimer(VARSET_CALLBACK(src, spam_flag, 0), 20, TIMER_DELETE_ME) return //////////////////////////////SINKS////////////////////////////// diff --git a/code/modules/artifice/deadringer.dm b/code/modules/artifice/deadringer.dm index 4b2c0dda7e..ff534ab18c 100644 --- a/code/modules/artifice/deadringer.dm +++ b/code/modules/artifice/deadringer.dm @@ -30,7 +30,10 @@ watchowner = null return -/obj/item/deadringer/attack_self(var/mob/living/user as mob) +/obj/item/deadringer/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE var/mob/living/H = src.loc if (!ishuman(H)) to_chat(H, span_blue("You have no clue what to do with this thing.")) diff --git a/code/modules/assembly/assembly.dm b/code/modules/assembly/assembly.dm index 7de494a072..598e2119a3 100644 --- a/code/modules/assembly/assembly.dm +++ b/code/modules/assembly/assembly.dm @@ -24,6 +24,9 @@ var/const/WIRE_RADIO_RECEIVE = 8 //Allows Pulsed(1) to call Activate() var/const/WIRE_RADIO_PULSE = 16 //Allows Pulse(1) to send a radio message + ///var used for attack_self chain + var/special_handling = FALSE + /obj/item/assembly/proc/holder_movement() return @@ -89,11 +92,15 @@ else . += "\The [src] can be attached!" -/obj/item/assembly/attack_self(mob/user as mob) +/obj/item/assembly/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE + if(special_handling) + return FALSE if(!user) - return 0 + return FALSE tgui_interact(user) - return 1 /obj/item/assembly/tgui_state(mob/user) return GLOB.tgui_deep_inventory_state diff --git a/code/modules/assembly/holder.dm b/code/modules/assembly/holder.dm index 8e40773b2c..4a4910ac18 100644 --- a/code/modules/assembly/holder.dm +++ b/code/modules/assembly/holder.dm @@ -125,8 +125,11 @@ else ..() -/obj/item/assembly_holder/attack_self(var/mob/user) - src.add_fingerprint(user) +/obj/item/assembly_holder/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE + add_fingerprint(user) if(src.secured) if(!a_left || !a_right) to_chat(user, span_warning(" BUG:Assembly part missing, please report this!")) diff --git a/code/modules/assembly/igniter.dm b/code/modules/assembly/igniter.dm index 4e7dd81459..24de14dd3d 100644 --- a/code/modules/assembly/igniter.dm +++ b/code/modules/assembly/igniter.dm @@ -7,6 +7,7 @@ secured = 1 wires = WIRE_RECEIVE + special_handling = TRUE /obj/item/assembly/igniter/activate() if(!..()) @@ -32,7 +33,10 @@ return TRUE -/obj/item/assembly/igniter/attack_self(var/mob/user) +/obj/item/assembly/igniter/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE activate() add_fingerprint(user) diff --git a/code/modules/assembly/mousetrap.dm b/code/modules/assembly/mousetrap.dm index b479ac8279..12358b20b3 100644 --- a/code/modules/assembly/mousetrap.dm +++ b/code/modules/assembly/mousetrap.dm @@ -5,6 +5,7 @@ origin_tech = list(TECH_COMBAT = 1) matter = list(MAT_STEEL = 100) var/armed = 0 + special_handling = TRUE /obj/item/assembly/mousetrap/examine(var/mob/user) @@ -49,7 +50,10 @@ update_icon() pulse(0) -/obj/item/assembly/mousetrap/attack_self(var/mob/living/user) +/obj/item/assembly/mousetrap/attack_self(mob/living/user) + . = ..(user) + if(.) + return TRUE if(!armed) to_chat(user, span_notice("You arm [src].")) else diff --git a/code/modules/assembly/shock_kit.dm b/code/modules/assembly/shock_kit.dm index a7a60d26b1..49d64674a1 100644 --- a/code/modules/assembly/shock_kit.dm +++ b/code/modules/assembly/shock_kit.dm @@ -6,6 +6,7 @@ var/obj/item/radio/electropack/part2 = null var/status = 0 w_class = ITEMSIZE_HUGE + special_handling = TRUE /obj/item/assembly/shock_kit/Destroy() qdel(part1) @@ -33,7 +34,10 @@ add_fingerprint(user) return -/obj/item/assembly/shock_kit/attack_self(mob/user as mob) +/obj/item/assembly/shock_kit/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE part1.attack_self(user, status) part2.attack_self(user, status) add_fingerprint(user) diff --git a/code/modules/assembly/voice.dm b/code/modules/assembly/voice.dm index 745525ea92..0f5666958a 100644 --- a/code/modules/assembly/voice.dm +++ b/code/modules/assembly/voice.dm @@ -6,6 +6,7 @@ matter = list(MAT_STEEL = 500, MAT_GLASS = 50) var/listening = 0 var/recorded //the activation message + special_handling = TRUE /obj/item/assembly/voice/hear_talk(mob/M, list/message_pieces, verb) var/msg = multilingual_to_message(message_pieces) @@ -27,6 +28,9 @@ /obj/item/assembly/voice/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE if(!user) return FALSE activate() diff --git a/code/modules/blob2/core_chunk.dm b/code/modules/blob2/core_chunk.dm index 1c977255e0..5f2923b9f7 100644 --- a/code/modules/blob2/core_chunk.dm +++ b/code/modules/blob2/core_chunk.dm @@ -84,14 +84,16 @@ return -/obj/item/blobcore_chunk/attack_self(var/mob/user) +/obj/item/blobcore_chunk/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE if(blob_type && world.time > active_ability_cooldown + last_active_use) last_active_use = world.time to_chat(user, span_alien("[icon2html(src, user.client)] \The [src] gesticulates.")) blob_type.on_chunk_use(src, user) else to_chat(user, span_notice("\The [src] doesn't seem to respond.")) - ..() /obj/item/blobcore_chunk/process() if(blob_type && should_tick && world.time > passive_ability_cooldown + last_passive_use) diff --git a/code/modules/casino/casino.dm b/code/modules/casino/casino.dm index 00fdaeb10e..416c2c90bb 100644 --- a/code/modules/casino/casino.dm +++ b/code/modules/casino/casino.dm @@ -253,6 +253,9 @@ icon_state = "roulette_ball_glass" /obj/item/roulette_ball/hollow/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE if(!trapped) to_chat(user, span_notice("\The [src] is empty!")) return diff --git a/code/modules/catalogue/cataloguer.dm b/code/modules/catalogue/cataloguer.dm index 8f7aa662e9..7dc6af2b47 100644 --- a/code/modules/catalogue/cataloguer.dm +++ b/code/modules/catalogue/cataloguer.dm @@ -239,6 +239,9 @@ GLOBAL_LIST_EMPTY(all_cataloguers) points_stored = max(0, points_stored += amount) /obj/item/cataloguer/attack_self(mob/living/user) + . = ..(user) + if(.) + return TRUE interact(user) /obj/item/cataloguer/interact(mob/user) diff --git a/code/modules/clothing/accessories/accessory.dm b/code/modules/clothing/accessories/accessory.dm index a928a39702..30207a40ae 100644 --- a/code/modules/clothing/accessories/accessory.dm +++ b/code/modules/clothing/accessories/accessory.dm @@ -476,6 +476,7 @@ var/breath_masked = FALSE var/obj/item/clothing/mask/breath/breathmask actions_types = list(/datum/action/item_action/pull_on_gaiter) + special_handling = TRUE /obj/item/clothing/accessory/gaiter/update_clothing_icon() . = ..() @@ -504,6 +505,9 @@ item_flags |= FLEXIBLEMATERIAL /obj/item/clothing/accessory/gaiter/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE var/gaiterstring = "You pull [src] " if(src.icon_state == initial(icon_state)) src.icon_state = "[icon_state]_up" diff --git a/code/modules/clothing/accessories/accessory_vr.dm b/code/modules/clothing/accessories/accessory_vr.dm index 7f1c996ff9..a0031ad8c7 100644 --- a/code/modules/clothing/accessories/accessory_vr.dm +++ b/code/modules/clothing/accessories/accessory_vr.dm @@ -45,6 +45,9 @@ icon_state = "collar_blk" var/writtenon = 0 var/icon_previous_override + special_handling = TRUE + ///Var for attack_self chain + var/special_collar = FALSE //Forces different sprite sheet on equip /obj/item/clothing/accessory/collar/Initialize(mapload) @@ -111,7 +114,7 @@ return /obj/item/clothing/accessory/collar/bell/proc/jingledreset() - jingled = 0 + jingled = 0 /obj/item/clothing/accessory/collar/shock name = "Shock collar" @@ -123,6 +126,7 @@ var/frequency = AMAG_ELE_FREQ var/code = 2 var/datum/radio_frequency/radio_connection + special_collar = TRUE /obj/item/clothing/accessory/collar/shock/Initialize(mapload) . = ..() @@ -138,7 +142,10 @@ frequency = new_frequency radio_connection = SSradio.add_object(src, frequency, RADIO_CHAT) -/obj/item/clothing/accessory/collar/shock/attack_self(mob/user as mob, flag1) +/obj/item/clothing/accessory/collar/shock/attack_self(mob/user, flag1) + . = ..(user) + if(.) + return TRUE if(!ishuman(user)) return tgui_interact(user) @@ -259,7 +266,12 @@ /obj/item/clothing/accessory/collar/holo/indigestible/digest_act(var/atom/movable/item_storage = null) return FALSE -/obj/item/clothing/accessory/collar/attack_self(mob/user as mob) +/obj/item/clothing/accessory/collar/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE + if(special_collar) + return FALSE if(istype(src,/obj/item/clothing/accessory/collar/holo)) to_chat(user,span_notice("[name]'s interface is projected onto your hand.")) else @@ -629,8 +641,14 @@ var/sentientprizeflavor = null //Description to show on the SPASM var/sentientprizeooc = null //OOC text to show on the SPASM var/sentientprizeitemtf = FALSE //Whether the person opted in to allowing themselves to be item TF'd as a prize + special_handling = TRUE + special_collar = TRUE -/obj/item/clothing/accessory/collar/casinosentientprize/attack_self(mob/user as mob) +/obj/item/clothing/accessory/collar/casinosentientprize/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE + return TRUE //keeping it blank so people don't tag and reset collar status /obj/item/clothing/accessory/collar/casinosentientprize_fake @@ -693,6 +711,7 @@ icon_state = "roughcloak" item_state = "roughcloak" actions_types = list(/datum/action/item_action/adjust_cloak) + special_handling = TRUE /obj/item/clothing/accessory/poncho/roles/cloak/half/update_clothing_icon() . = ..() @@ -700,7 +719,10 @@ var/mob/M = src.loc M.update_inv_wear_suit() -/obj/item/clothing/accessory/poncho/roles/cloak/half/attack_self(mob/user as mob) +/obj/item/clothing/accessory/poncho/roles/cloak/half/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE if(src.icon_state == initial(icon_state)) src.icon_state = "[icon_state]_open" src.item_state = "[item_state]_open" @@ -964,6 +986,7 @@ icon_state = "neo_ranger" item_state = "neo_ranger" actions_types = list(/datum/action/item_action/adjust_poncho) + special_handling = TRUE /obj/item/clothing/accessory/poncho/roles/neo_ranger/update_clothing_icon() . = ..() @@ -971,7 +994,10 @@ var/mob/M = src.loc M.update_inv_wear_suit() -/obj/item/clothing/accessory/poncho/roles/neo_ranger/attack_self(mob/user as mob) +/obj/item/clothing/accessory/poncho/roles/neo_ranger/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE if(src.icon_state == initial(icon_state)) src.icon_state = "[icon_state]_open" src.item_state = "[item_state]_open" diff --git a/code/modules/clothing/accessories/badges.dm b/code/modules/clothing/accessories/badges.dm index a6bb3886d9..bb8a867b55 100644 --- a/code/modules/clothing/accessories/badges.dm +++ b/code/modules/clothing/accessories/badges.dm @@ -13,6 +13,12 @@ var/stored_name var/badge_string = "Corporate Security" + special_handling = TRUE + ///var for attack_self chain + var/sheriff_badge = FALSE + ///Another var for attack_self chain + var/fluff_badge = FALSE + var/holo = FALSE /obj/item/clothing/accessory/badge/proc/set_name(var/new_name) stored_name = new_name @@ -20,9 +26,20 @@ /obj/item/clothing/accessory/badge/proc/set_desc(var/mob/living/carbon/human/H) -/obj/item/clothing/accessory/badge/attack_self(mob/user as mob) +/obj/item/clothing/accessory/badge/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE + if(sheriff_badge) + return FALSE + if(fluff_badge) + return FALSE if(!stored_name) - to_chat(user, "You polish your old badge fondly, shining up the surface.") + if(holo) + to_chat(user, "Waving around a holobadge before swiping an ID would be pretty pointless.") + return + else + to_chat(user, "You polish your old badge fondly, shining up the surface.") set_name(user.real_name) return @@ -81,17 +98,12 @@ icon_state = "holobadge" var/emagged //Emagging removes Sec check. var/valid_access = list(ACCESS_SECURITY) //Default access is security, to be overriden or expanded as desired + holo = TRUE /obj/item/clothing/accessory/badge/holo/cord icon_state = "holobadge-cord" slot_flags = SLOT_MASK | SLOT_TIE | SLOT_BELT -/obj/item/clothing/accessory/badge/holo/attack_self(mob/user as mob) - if(!stored_name) - to_chat(user, "Waving around a holobadge before swiping an ID would be pretty pointless.") - return - return ..() - /obj/item/clothing/accessory/badge/holo/emag_act(var/remaining_charges, var/mob/user) if (emagged) to_chat(user, span_danger("\The [src] is already cracked.")) @@ -188,8 +200,13 @@ desc = "This town ain't big enough for the two of us, pardner." icon_state = "sheriff_toy" item_state = "sheriff_toy" + special_handling = TRUE + sheriff_badge = TRUE -/obj/item/clothing/accessory/badge/sheriff/attack_self(mob/user as mob) +/obj/item/clothing/accessory/badge/sheriff/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE user.visible_message("[user] shows their sheriff badge. There's a new sheriff in town!",\ "You flash the sheriff badge to everyone around you!") diff --git a/code/modules/clothing/accessories/lockets.dm b/code/modules/clothing/accessories/lockets.dm index 3465f4f030..28344f3195 100644 --- a/code/modules/clothing/accessories/lockets.dm +++ b/code/modules/clothing/accessories/lockets.dm @@ -10,8 +10,12 @@ var/base_icon var/open var/obj/item/held //Item inside locket. + special_handling = TRUE /obj/item/clothing/accessory/locket/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE if(!base_icon) base_icon = icon_state diff --git a/code/modules/clothing/accessories/permits.dm b/code/modules/clothing/accessories/permits.dm index fcd7570a58..59f33fef4d 100644 --- a/code/modules/clothing/accessories/permits.dm +++ b/code/modules/clothing/accessories/permits.dm @@ -8,8 +8,12 @@ w_class = ITEMSIZE_TINY slot = ACCESSORY_SLOT_MEDAL var/owner = 0 //To prevent people from just renaming the thing if they steal it + special_handling = TRUE -/obj/item/clothing/accessory/permit/attack_self(mob/user as mob) +/obj/item/clothing/accessory/permit/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE if(isliving(user)) if(!owner) set_name(user.name) diff --git a/code/modules/clothing/accessories/rings.dm b/code/modules/clothing/accessories/rings.dm index 6f1183332c..6fb1a1b928 100644 --- a/code/modules/clothing/accessories/rings.dm +++ b/code/modules/clothing/accessories/rings.dm @@ -27,8 +27,12 @@ name = "engagement ring" desc = "An engagement ring. It certainly looks expensive." icon_state = "diamond" + special_handling = TRUE /obj/item/clothing/accessory/ring/engagement/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE user.visible_message(span_warning("\The [user] gets down on one knee, presenting \the [src]."),span_warning("You get down on one knee, presenting \the [src].")) /obj/item/clothing/accessory/ring/cti @@ -97,8 +101,12 @@ desc = "A signet ring, for when you're too sophisticated to sign letters." icon_state = "seal-signet" var/nameset = FALSE + special_handling = TRUE /obj/item/clothing/accessory/ring/seal/signet/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE if(nameset) to_chat(user, span_notice("The [src] has already been claimed!")) return @@ -118,8 +126,12 @@ icon_state = "wedring_g" item_state = "wedring_g" var/partnername = "" + special_handling = TRUE /obj/item/clothing/accessory/ring/wedding/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE var/input = tgui_input_text(user, "Would you like to change the holoengraving on the ring?", "Name your spouse", "Bae", MAX_NAME_LEN) if(!input) return diff --git a/code/modules/clothing/accessories/storage.dm b/code/modules/clothing/accessories/storage.dm index be26aee936..5e954e3d97 100644 --- a/code/modules/clothing/accessories/storage.dm +++ b/code/modules/clothing/accessories/storage.dm @@ -10,6 +10,7 @@ w_class = ITEMSIZE_NORMAL on_rolled = list("down" = "none") var/hide_on_roll = FALSE + special_handling = TRUE /obj/item/clothing/accessory/storage/Initialize(mapload) . = ..() @@ -38,6 +39,9 @@ return hold.attackby(W, user) /obj/item/clothing/accessory/storage/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE to_chat(user, span_notice("You empty [src].")) var/turf/T = get_turf(src) hold.hide_from(user) diff --git a/code/modules/clothing/clothing.dm b/code/modules/clothing/clothing.dm index 23f74aabf4..04bc8b0c46 100644 --- a/code/modules/clothing/clothing.dm +++ b/code/modules/clothing/clothing.dm @@ -478,16 +478,20 @@ ) drop_sound = 'sound/items/drop/hat.ogg' pickup_sound = 'sound/items/pickup/hat.ogg' + helmet_handling = TRUE -/obj/item/clothing/head/attack_self(mob/user) +/obj/item/clothing/head/attack_self(mob/user, callback) + . = ..(user) + if(.) + return TRUE + if(special_handling && !callback) + return FALSE if(light_range) if(!isturf(user.loc)) to_chat(user, "You cannot toggle the light while in this [user.loc]") return update_flashlight(user) to_chat(user, "You [light_on ? "enable" : "disable"] the helmet light.") - else - return ..(user) /obj/item/clothing/head/proc/update_flashlight(var/mob/user = null) set_light_on(!light_on) @@ -855,7 +859,10 @@ var/mob/M = src.loc M.update_inv_shoes() -/obj/item/clothing/shoes/attack_self(var/mob/user) +/obj/item/clothing/shoes/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE for(var/mob/M in src) if(isvoice(M)) //Don't knock voices out! continue @@ -863,8 +870,6 @@ to_chat(M, span_warning("[user] shakes you out of \the [src]!")) to_chat(user, span_notice("You shake [M] out of \the [src]!")) - ..() - /obj/item/clothing/shoes/container_resist(mob/living/micro) var/mob/living/carbon/human/macro = loc if(isvoice(micro)) //Voices shouldn't be able to resist but we have this here just in case. diff --git a/code/modules/clothing/glasses/glasses.dm b/code/modules/clothing/glasses/glasses.dm index 36da7ba864..93ca31250a 100644 --- a/code/modules/clothing/glasses/glasses.dm +++ b/code/modules/clothing/glasses/glasses.dm @@ -45,6 +45,8 @@ BLIND // can't see anything SPECIES_XENOCHIMERA = 'icons/inventory/eyes/mob_tajaran.dmi' ) var/glasses_layer_above = FALSE + ///Var for attack_self chain + var/specialty_goggles = FALSE /obj/item/clothing/glasses/update_clothing_icon() if (ismob(src.loc)) @@ -85,6 +87,11 @@ BLIND // can't see anything user.recalculate_vis() /obj/item/clothing/glasses/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE + if(specialty_goggles) + return FALSE if(toggleable) if(!can_toggle(user)) to_chat(user, span_warning("You don't seem to be able to toggle \the [src] here.")) @@ -94,7 +101,6 @@ BLIND // can't see anything to_chat(user, span_notice("You activate the optical matrix on the [src].")) else to_chat(user, span_notice("You deactivate the optical matrix on the [src].")) - ..() /obj/item/clothing/glasses/meson name = "optical meson scanner" @@ -389,8 +395,12 @@ BLIND // can't see anything var/up = 0 flash_protection = FLASH_PROTECTION_MAJOR tint = TINT_HEAVY + specialty_goggles = TRUE -/obj/item/clothing/glasses/welding/attack_self() +/obj/item/clothing/glasses/welding/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE toggle() /obj/item/clothing/glasses/welding/verb/toggle() @@ -496,8 +506,12 @@ BLIND // can't see anything var/on = 1 toggleable = 1 activation_sound = 'sound/effects/pop.ogg' + specialty_goggles = TRUE /obj/item/clothing/glasses/sunglasses/sechud/aviator/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE if(toggleable && !user.incapacitated()) on = !on if(on) @@ -611,8 +625,12 @@ BLIND // can't see anything item_flags = AIRTIGHT body_parts_covered = EYES species_restricted = list(SPECIES_TESHARI) + specialty_goggles = TRUE -/obj/item/clothing/glasses/aerogelgoggles/attack_self() +/obj/item/clothing/glasses/aerogelgoggles/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE toggle() /obj/item/clothing/glasses/aerogelgoggles/verb/toggle() diff --git a/code/modules/clothing/glasses/glasses_vr.dm b/code/modules/clothing/glasses/glasses_vr.dm index cf7425bb6e..1cda576d1c 100644 --- a/code/modules/clothing/glasses/glasses_vr.dm +++ b/code/modules/clothing/glasses/glasses_vr.dm @@ -91,7 +91,9 @@ ) /obj/item/clothing/glasses/sunglasses/sechud/tactical_sec_vis/attack_self(mob/user) - . = ..() + . = ..(user) + if(.) + return TRUE if(!istype(user) || user.incapacitated()) return @@ -104,7 +106,6 @@ user.update_inv_glasses() user.update_mob_action_buttons() to_chat(user, span_notice("Your [src] now displays [choice] .")) - return 1 /*---Tajaran-specific Eyewear---*/ diff --git a/code/modules/clothing/glasses/hud.dm b/code/modules/clothing/glasses/hud.dm index bd894f701f..690ae2a1b5 100644 --- a/code/modules/clothing/glasses/hud.dm +++ b/code/modules/clothing/glasses/hud.dm @@ -75,6 +75,8 @@ plane_slots = list(slot_glasses) var/ar_toggled = TRUE //Used for toggle_ar_planes() verb var/can_shade = TRUE + specialty_goggles = TRUE + var/hud_goggles = FALSE /obj/item/clothing/glasses/omnihud/Initialize(mapload) . = ..() @@ -130,8 +132,13 @@ icon_state = "[initial(icon_state)]" /obj/item/clothing/glasses/omnihud/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE if(!ishuman(user)) - return + return FALSE + if(hud_goggles) + return FALSE var/mob/living/carbon/human/H = user if(!H.glasses || !(H.glasses == src)) @@ -283,11 +290,15 @@ vision_flags = SEE_TURFS //but they can spot breaches. Due to the way HUDs work, they don't provide darkvision up-close the way mesons do. flash_protection = 0 //it's an open, single-eye retinal projector. there's no way it protects your eyes from flashes or welders. can_shade = FALSE + specialty_goggles = TRUE + hud_goggles = TRUE /obj/item/clothing/glasses/omnihud/eng/meson/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE if(!active) toggleprojector() - ..() /obj/item/clothing/glasses/omnihud/eng/meson/verb/toggleprojector() set name = "Toggle projector" diff --git a/code/modules/clothing/head/helmet.dm b/code/modules/clothing/head/helmet.dm index dab0fecde4..69feb2c9dc 100644 --- a/code/modules/clothing/head/helmet.dm +++ b/code/modules/clothing/head/helmet.dm @@ -65,8 +65,12 @@ siemens_coefficient = 0.7 valid_accessory_slots = null actions_types = list(/datum/action/item_action/toggle_visor) + special_handling = TRUE -/obj/item/clothing/head/helmet/riot/attack_self(mob/user as mob) +/obj/item/clothing/head/helmet/riot/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE if(src.icon_state == initial(icon_state)) src.icon_state = "[icon_state]up" to_chat(user, "You raise the visor on the riot helmet.") diff --git a/code/modules/clothing/head/helmet_vr.dm b/code/modules/clothing/head/helmet_vr.dm index afc6765288..b7a600b246 100644 --- a/code/modules/clothing/head/helmet_vr.dm +++ b/code/modules/clothing/head/helmet_vr.dm @@ -40,8 +40,12 @@ var/base_state var/up = FALSE + special_handling = TRUE -/obj/item/clothing/head/helmet/combat/bedevere/attack_self() +/obj/item/clothing/head/helmet/combat/bedevere/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE toggle() /obj/item/clothing/head/helmet/combat/bedevere/verb/toggle() @@ -93,8 +97,12 @@ var/base_state var/up = FALSE + special_handling = TRUE -/obj/item/clothing/head/helmet/combat/bedevere_costume/attack_self() +/obj/item/clothing/head/helmet/combat/bedevere_costume/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE toggle() /obj/item/clothing/head/helmet/combat/bedevere_costume/verb/toggle() diff --git a/code/modules/clothing/head/misc_special.dm b/code/modules/clothing/head/misc_special.dm index 6bb2fe8d36..0b4477038b 100644 --- a/code/modules/clothing/head/misc_special.dm +++ b/code/modules/clothing/head/misc_special.dm @@ -31,8 +31,12 @@ tint = TINT_HEAVY drop_sound = 'sound/items/drop/helm.ogg' pickup_sound = 'sound/items/pickup/helm.ogg' + special_handling = TRUE -/obj/item/clothing/head/welding/attack_self() +/obj/item/clothing/head/welding/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE toggle() @@ -126,6 +130,7 @@ icon_state = "cake0" var/onfire = 0 body_parts_covered = HEAD + special_handling = TRUE /obj/item/clothing/head/cakehat/process() if(!onfire) @@ -141,7 +146,10 @@ if (istype(location, /turf)) location.hotspot_expose(700, 1) -/obj/item/clothing/head/cakehat/attack_self(mob/user as mob) +/obj/item/clothing/head/cakehat/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE onfire = !(onfire) if (onfire) force = 3 @@ -163,8 +171,12 @@ desc = "Perfect for those cold winter nights." icon_state = "ushankadown" flags_inv = HIDEEARS + special_handling = TRUE -/obj/item/clothing/head/ushanka/attack_self(mob/user as mob) +/obj/item/clothing/head/ushanka/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE if(src.icon_state == initial(icon_state)) src.icon_state = "[icon_state]up" to_chat(user, "You raise the ear flaps on the ushanka.") diff --git a/code/modules/clothing/head/pilot_helmet.dm b/code/modules/clothing/head/pilot_helmet.dm index 9c3d092911..e658c80ad5 100644 --- a/code/modules/clothing/head/pilot_helmet.dm +++ b/code/modules/clothing/head/pilot_helmet.dm @@ -187,8 +187,12 @@ desc = "Standard pilot gear. Protects the head from impacts. This one has a retractable visor" icon_state = "pilot_helmet2" actions_types = list(/datum/action/item_action/toggle_visor) + special_handling = TRUE -/obj/item/clothing/head/pilot/alt/attack_self(mob/user as mob) +/obj/item/clothing/head/pilot/alt/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE if(src.icon_state == initial(icon_state)) src.icon_state = "[icon_state]up" to_chat(user, "You raise the visor on the pilot helmet.") diff --git a/code/modules/clothing/head/pilot_helmet_vr.dm b/code/modules/clothing/head/pilot_helmet_vr.dm index d57c30916a..0e5e5597b3 100644 --- a/code/modules/clothing/head/pilot_helmet_vr.dm +++ b/code/modules/clothing/head/pilot_helmet_vr.dm @@ -9,8 +9,12 @@ max_heat_protection_temperature = HELMET_MAX_HEAT_PROTECTION_TEMPERATURE w_class = ITEMSIZE_NORMAL actions_types = list(/datum/action/item_action/toggle_visor) + special_handling = TRUE -/obj/item/clothing/head/pilot_vr/attack_self(mob/user as mob) +/obj/item/clothing/head/pilot_vr/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE if(src.icon_state == initial(icon_state)) src.icon_state = "[icon_state]up" to_chat(user, "You raise the visor on the pilot helmet.") @@ -25,15 +29,6 @@ icon_state = "pilot2" actions_types = list(/datum/action/item_action/toggle_visor) -/obj/item/clothing/head/pilot_vr/alt/attack_self(mob/user as mob) - if(src.icon_state == initial(icon_state)) - src.icon_state = "[icon_state]up" - to_chat(user, "You raise the visor on the pilot helmet.") - else - src.icon_state = initial(icon_state) - to_chat(user, "You lower the visor on the pilot helmet.") - update_clothing_icon() //so our mob-overlays update - //////////Talon Pilot Headgear////////// /obj/item/clothing/head/pilot_vr/talon @@ -42,15 +37,6 @@ icon_state = "pilot3" actions_types = list(/datum/action/item_action/toggle_visor) -/obj/item/clothing/head/pilot_vr/talon/attack_self(mob/user as mob) - if(src.icon_state == initial(icon_state)) - src.icon_state = "[icon_state]up" - to_chat(user, "You raise the visor on the pilot helmet.") - else - src.icon_state = initial(icon_state) - to_chat(user, "You lower the visor on the pilot helmet.") - update_clothing_icon() //so our mob-overlays update - //////////Major Bill's Pilot Headgear////////// /obj/item/clothing/head/pilot_vr/mbill @@ -59,12 +45,3 @@ icon_state = "pilot3" catalogue_data = list(/datum/category_item/catalogue/information/organization/major_bills) actions_types = list(/datum/action/item_action/toggle_visor) - -/obj/item/clothing/head/pilot_vr/mbill/attack_self(mob/user as mob) - if(src.icon_state == initial(icon_state)) - src.icon_state = "[icon_state]up" - to_chat(user, "You raise the visor on the pilot helmet.") - else - src.icon_state = initial(icon_state) - to_chat(user, "You lower the visor on the pilot helmet.") - update_clothing_icon() //so our mob-overlays update diff --git a/code/modules/clothing/head/soft_caps.dm b/code/modules/clothing/head/soft_caps.dm index 71ed3f64ca..73b39ca0ce 100644 --- a/code/modules/clothing/head/soft_caps.dm +++ b/code/modules/clothing/head/soft_caps.dm @@ -6,13 +6,17 @@ var/flipped = 0 siemens_coefficient = 0.9 body_parts_covered = 0 + special_handling = TRUE /obj/item/clothing/head/soft/dropped(mob/user) icon_state = initial(icon_state) - flipped=0 + flipped = FALSE ..() /obj/item/clothing/head/soft/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE flipped = !flipped if(flipped) icon_state = "[icon_state]_flipped" diff --git a/code/modules/clothing/masks/breath.dm b/code/modules/clothing/masks/breath.dm index 4c4781b8a8..5d06eb3c49 100644 --- a/code/modules/clothing/masks/breath.dm +++ b/code/modules/clothing/masks/breath.dm @@ -12,6 +12,7 @@ actions_types = list(/datum/action/item_action/adjust_breath_mask) pickup_sound = 'sound/items/pickup/component.ogg' drop_sound = 'sound/items/drop/component.ogg' + special_handling = TRUE /obj/item/clothing/mask/breath/proc/adjust_mask(mob/user) @@ -32,6 +33,9 @@ update_clothing_icon() /obj/item/clothing/mask/breath/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE adjust_mask(user) /obj/item/clothing/mask/breath/verb/toggle() diff --git a/code/modules/clothing/masks/gasmask.dm b/code/modules/clothing/masks/gasmask.dm index 60df8a8234..121b1485c9 100644 --- a/code/modules/clothing/masks/gasmask.dm +++ b/code/modules/clothing/masks/gasmask.dm @@ -92,6 +92,8 @@ filtered_gases = list(GAS_O2, GAS_N2O) var/mask_open = FALSE // Controls if the Vox can eat through this mask actions_types = list(/datum/action/item_action/toggle_feeding_port) + helmet_handling = TRUE + special_handling = TRUE /obj/item/clothing/mask/gas/swat/vox/proc/feeding_port(mob/user) if(user.canmove && !user.stat) @@ -105,8 +107,10 @@ return /obj/item/clothing/mask/gas/swat/vox/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE feeding_port(user) - ..() /obj/item/clothing/mask/gas/zaddat name = "Zaddat Veil" diff --git a/code/modules/clothing/masks/miscellaneous.dm b/code/modules/clothing/masks/miscellaneous.dm index 51c76b783a..e17860b0ca 100644 --- a/code/modules/clothing/masks/miscellaneous.dm +++ b/code/modules/clothing/masks/miscellaneous.dm @@ -324,6 +324,7 @@ icon_state = "papermask" actions_types = list(/datum/action/item_action/hands_free/redraw_design) var/list/papermask_designs = list() + special_handling = TRUE /obj/item/clothing/mask/paper/Initialize(mapload) . = ..() @@ -356,7 +357,9 @@ ) /obj/item/clothing/mask/paper/attack_self(mob/user) - . = ..() + . = ..(user) + if(.) + return TRUE if(!istype(user) || user.incapacitated()) return @@ -377,7 +380,6 @@ user.update_inv_wear_mask() user.update_mob_action_buttons() to_chat(user, span_notice("Your paper mask now is now [choice].")) - return 1 /obj/item/clothing/mask/emotions name = "emotional mask" @@ -387,6 +389,7 @@ icon_state = "joy" actions_types = list(/datum/action/item_action/hands_free/redraw_design) var/static/list/joymask_designs = list() + special_handling = TRUE /obj/item/clothing/mask/emotions/Initialize(mapload) @@ -399,7 +402,9 @@ ) /obj/item/clothing/mask/emotions/attack_self(mob/user) - . = ..() + . = ..(user) + if(.) + return TRUE if(!istype(user) || user.incapacitated()) return @@ -412,7 +417,6 @@ user.update_inv_wear_mask() user.update_mob_action_buttons() to_chat(user, span_notice("Your [src] now displays a [choice] emotion.")) - return 1 /obj/item/clothing/mask/mouthwheat name = "mouth wheat" diff --git a/code/modules/clothing/shoes/colour.dm b/code/modules/clothing/shoes/colour.dm index 0f15ddc0e1..6f5b1f3c6b 100644 --- a/code/modules/clothing/shoes/colour.dm +++ b/code/modules/clothing/shoes/colour.dm @@ -111,8 +111,10 @@ icon_state = "orange" chained = null -/obj/item/clothing/shoes/orange/attack_self(mob/user as mob) - ..() +/obj/item/clothing/shoes/orange/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE remove_cuffs(user) /obj/item/clothing/shoes/orange/attackby(H as obj, mob/user as mob) diff --git a/code/modules/clothing/shoes/magboots.dm b/code/modules/clothing/shoes/magboots.dm index 04847de5e8..2309601d2e 100644 --- a/code/modules/clothing/shoes/magboots.dm +++ b/code/modules/clothing/shoes/magboots.dm @@ -13,6 +13,12 @@ preserve_item = 1 var/magpulse = 0 var/icon_base = "magboots" + ///The message that gets shown when we enable the magboots. + var/mag_enable = "You enable the mag-pulse traction system." + ///The message that gets shown when we disable the magboots. + var/mag_disable = "You disable the mag-pulse traction system." + ///If the magboots can be removed when enabled or not. + var/unremovable_when_enabled = FALSE actions_types = list(/datum/action/item_action/toggle_magboots) step_volume_mod = 1.3 drop_sound = 'sound/items/drop/metalboots.ogg' @@ -24,21 +30,36 @@ slowdown += 3 /obj/item/clothing/shoes/magboots/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE if(magpulse) item_flags &= ~NOSLIP - magpulse = 0 + magpulse = FALSE set_slowdown() force = 3 if(icon_base) icon_state = "[icon_base]0" - to_chat(user, "You disable the mag-pulse traction system.") + to_chat(user, mag_disable) + if(unremovable_when_enabled) + canremove = TRUE else + //Checks to ensure if they're unremovable we're actually wearing them when we turn them on. + if(unremovable_when_enabled) + if(!ishuman(user)) + return + var/mob/living/carbon/human/H = user + if(H.shoes != src) + to_chat(user, "You will have to put on the [src] before you can do that.") + return + canremove = FALSE + item_flags |= NOSLIP - magpulse = 1 + magpulse = TRUE set_slowdown() force = 5 if(icon_base) icon_state = "[icon_base]1" playsound(src, 'sound/effects/magnetclamp.ogg', 20) - to_chat(user, "You enable the mag-pulse traction system.") + to_chat(user, mag_enable) user.update_inv_shoes() //so our mob-overlays update user.update_mob_action_buttons() @@ -91,31 +112,14 @@ name = "vox magclaws" item_state = "boots-vox" icon_state = "boots-vox" + icon_base = null + mag_enable = "You dig your claws deeply into the flooring, bracing yourself." + mag_disable = "You relax your deathgrip on the flooring." + unremovable_when_enabled = TRUE flags = PHORONGUARD species_restricted = list(SPECIES_VOX) actions_types = list(/datum/action/item_action/toggle_magclaws) -/obj/item/clothing/shoes/magboots/vox/attack_self(mob/user) - if(src.magpulse) - item_flags &= ~NOSLIP - magpulse = 0 - canremove = TRUE - to_chat(user, "You relax your deathgrip on the flooring.") - else - //make sure these can only be used when equipped. - if(!ishuman(user)) - return - var/mob/living/carbon/human/H = user - if (H.shoes != src) - to_chat(user, "You will have to put on the [src] before you can do that.") - return - - item_flags |= NOSLIP - magpulse = 1 - canremove = FALSE //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.") - user.update_mob_action_buttons() - //In case they somehow come off while enabled. /obj/item/clothing/shoes/magboots/vox/dropped(mob/user) ..(user) diff --git a/code/modules/clothing/suits/armor.dm b/code/modules/clothing/suits/armor.dm index e6808df9e5..d561eaa1f7 100644 --- a/code/modules/clothing/suits/armor.dm +++ b/code/modules/clothing/suits/armor.dm @@ -173,6 +173,7 @@ blood_overlay_type = "armor" slowdown = 1 armor = list(melee = 0, bullet = 0, laser = 0, energy = 0, bomb = 0, bio = 0, rad = 0) + special_handling = TRUE /obj/item/clothing/suit/armor/reactive/handle_shield(mob/user, var/damage, atom/damage_source = null, mob/attacker = null, var/def_zone = null, var/attack_text = "the attack") if(prob(50)) @@ -197,8 +198,11 @@ return PROJECTILE_FORCE_MISS return 0 -/obj/item/clothing/suit/armor/reactive/attack_self(mob/user as mob) - active = !( active ) +/obj/item/clothing/suit/armor/reactive/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE + active = !active if (active) to_chat(user, span_blue("The reactive armor is now active.")) icon_state = "reactive" diff --git a/code/modules/clothing/suits/miscellaneous.dm b/code/modules/clothing/suits/miscellaneous.dm index c7c5a29ba0..37ea24745d 100644 --- a/code/modules/clothing/suits/miscellaneous.dm +++ b/code/modules/clothing/suits/miscellaneous.dm @@ -1059,24 +1059,29 @@ body_parts_covered = CHEST attack_verb = list("warned", "cautioned", "smashed") armor = list("melee" = 5, "bullet" = 0, "laser" = 0,"energy" = 0, "bomb" = 0, "bio" = 0, "rad" = 0, "fire" = 0, "acid" = 0) + special_handling = TRUE -/obj/item/clothing/suit/caution/attack_self() - toggle() +/obj/item/clothing/suit/caution/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE + toggle(user) -/obj/item/clothing/suit/caution/click_alt() - toggle() +/obj/item/clothing/suit/caution/click_alt(mob/user) + toggle(user) -/obj/item/clothing/suit/caution/proc/toggle() - if(!usr || usr.stat || usr.lying || usr.restrained() || !Adjacent(usr)) return - else if(src.icon_state == "caution") - src.icon_state = "caution_blinking" - src.item_state = "caution_blinking" - usr.show_message("You turn the wet floor sign on.") +/obj/item/clothing/suit/caution/proc/toggle(mob/user) + if(!user || user.stat || user.lying || user.restrained() || !Adjacent(user)) + return + else if(icon_state == "caution") + icon_state = "caution_blinking" + item_state = "caution_blinking" + user.show_message("You turn the wet floor sign on.") playsound(src.loc, 'sound/machines/button.ogg', 30, 1) else - src.icon_state = "caution" - src.item_state = "caution" - usr.show_message("You turn the wet floor sign off.") + icon_state = "caution" + item_state = "caution" + user.show_message("You turn the wet floor sign off.") update_clothing_icon() //Ruin Marine (Doom Marine) diff --git a/code/modules/clothing/suits/reactive_armour.dm b/code/modules/clothing/suits/reactive_armour.dm index c0f99555bf..ec65fbea6a 100644 --- a/code/modules/clothing/suits/reactive_armour.dm +++ b/code/modules/clothing/suits/reactive_armour.dm @@ -47,11 +47,16 @@ ///The cooldown itself of the reactive armor for when it can activate again. var/reactivearmor_cooldown = 0 + special_handling = TRUE + /obj/item/clothing/suit/armor/reactive/update_icon() . = ..() icon_state = "reactive[active ? null : "off"]" /obj/item/clothing/suit/armor/reactive/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE active = !active to_chat(user, span_notice("[src] is now [active ? "active" : "inactive"].")) update_icon() diff --git a/code/modules/clothing/suits/shibari.dm b/code/modules/clothing/suits/shibari.dm index 08786a5e2b..1074943b7e 100644 --- a/code/modules/clothing/suits/shibari.dm +++ b/code/modules/clothing/suits/shibari.dm @@ -13,6 +13,8 @@ var/rope_mode = SHIBARI_NONE + special_handling = TRUE + /obj/item/clothing/suit/shibari/attack_hand(mob/living/user as mob) if(ishuman(user)) @@ -23,6 +25,9 @@ ..() /obj/item/clothing/suit/shibari/attack_self(mob/living/user) + . = ..(user) + if(.) + return TRUE rope_mode = tgui_input_list(user, "Which limbs would you like to restrain with the bindings?", "Shibari", list(SHIBARI_NONE, SHIBARI_ARMS, SHIBARI_LEGS, SHIBARI_BOTH)) if(!rope_mode) rope_mode = SHIBARI_NONE diff --git a/code/modules/detectivework/tools/evidencebag.dm b/code/modules/detectivework/tools/evidencebag.dm index 10c8f83409..d906c5b122 100644 --- a/code/modules/detectivework/tools/evidencebag.dm +++ b/code/modules/detectivework/tools/evidencebag.dm @@ -9,6 +9,7 @@ w_class = ITEMSIZE_SMALL var/obj/item/stored_item = null + /obj/item/evidencebag/MouseDrop(var/obj/item/I) if (!ishuman(usr)) return @@ -72,8 +73,11 @@ return -/obj/item/evidencebag/attack_self(mob/user as mob) - if(contents.len) +/obj/item/evidencebag/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE + if(LAZYLEN(contents)) var/obj/item/I = contents[1] user.visible_message("[user] takes [I] out of [src]", "You take [I] out of [src].",\ "You hear someone rustle around in a plastic bag, and remove something.") diff --git a/code/modules/detectivework/tools/rag.dm b/code/modules/detectivework/tools/rag.dm index 13b3541640..f5a4f5e23b 100644 --- a/code/modules/detectivework/tools/rag.dm +++ b/code/modules/detectivework/tools/rag.dm @@ -28,6 +28,7 @@ var/on_fire = 0 var/burn_time = 20 //if the rag burns for too long it turns to ashes + special_handling = TRUE /obj/item/reagent_containers/glass/rag/Initialize(mapload) . = ..() @@ -37,7 +38,10 @@ STOP_PROCESSING(SSobj, src) //so we don't continue turning to ash while gc'd return ..() -/obj/item/reagent_containers/glass/rag/attack_self(mob/user as mob) +/obj/item/reagent_containers/glass/rag/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE if(on_fire) user.visible_message(span_warning("\The [user] stamps out [src]."), span_warning("You stamp out [src].")) user.unEquip(src) diff --git a/code/modules/detectivework/tools/sample_kits.dm b/code/modules/detectivework/tools/sample_kits.dm index 8284c28cd8..35eb5966cf 100644 --- a/code/modules/detectivework/tools/sample_kits.dm +++ b/code/modules/detectivework/tools/sample_kits.dm @@ -61,7 +61,10 @@ icon_state = "fingerprint0" item_state = "paper" -/obj/item/sample/print/attack_self(var/mob/user) +/obj/item/sample/print/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE if(evidence && evidence.len) return if(!ishuman(user)) diff --git a/code/modules/detectivework/tools/uvlight.dm b/code/modules/detectivework/tools/uvlight.dm index fec338a5d1..34a124b9e8 100644 --- a/code/modules/detectivework/tools/uvlight.dm +++ b/code/modules/detectivework/tools/uvlight.dm @@ -20,7 +20,10 @@ pickup_sound = 'sound/items/pickup/device.ogg' drop_sound = 'sound/items/drop/device.ogg' -/obj/item/uv_light/attack_self(var/mob/user) +/obj/item/uv_light/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE on = !on if(on) set_light(range, 2, "#007fff") diff --git a/code/modules/economy/EFTPOS.dm b/code/modules/economy/EFTPOS.dm index 50feeb5c85..5cb147633a 100644 --- a/code/modules/economy/EFTPOS.dm +++ b/code/modules/economy/EFTPOS.dm @@ -73,7 +73,10 @@ D.wrapped = R D.name = "small parcel - 'EFTPOS access code'" -/obj/item/eftpos/attack_self(mob/user as mob) +/obj/item/eftpos/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE if(get_dist(src,user) <= 1) var/dat = span_bold("[eftpos_name]") + "
" dat += "This terminal is [machine_id]. Report this code when contacting IT Support
" diff --git a/code/modules/economy/cash.dm b/code/modules/economy/cash.dm index 4b49c7e963..15e13f86dc 100644 --- a/code/modules/economy/cash.dm +++ b/code/modules/economy/cash.dm @@ -18,6 +18,8 @@ var/worth = 0 drop_sound = 'sound/items/drop/paper.ogg' pickup_sound = 'sound/items/pickup/paper.ogg' + ///Var for attack_self chain + var/special_handling = FALSE /obj/item/spacecash/Initialize(mapload) . = ..() @@ -84,6 +86,9 @@ return worth /obj/item/spacecash/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE var/amount = tgui_input_number(user, "How many [initial_name]s do you want to take? (0 to [src.worth])", "Take Money", 20, src.worth) if(!src || QDELETED(src)) return @@ -167,8 +172,12 @@ drop_sound = 'sound/items/drop/card.ogg' pickup_sound = 'sound/items/pickup/card.ogg' var/owner_name = "" //So the ATM can set it so the EFTPOS can put a valid name on transactions. + special_handling = TRUE -/obj/item/spacecash/ewallet/attack_self() return //Don't act +/obj/item/spacecash/ewallet/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE /obj/item/spacecash/ewallet/attackby() return //like actual /obj/item/spacecash/ewallet/update_icon() return //space cash diff --git a/code/modules/economy/casinocash.dm b/code/modules/economy/casinocash.dm index 91e058c0e4..30b56175eb 100644 --- a/code/modules/economy/casinocash.dm +++ b/code/modules/economy/casinocash.dm @@ -112,6 +112,9 @@ return worth /obj/item/spacecasinocash/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE var/amount = tgui_input_number(user, "How much credits worth of chips do you want to take? (0 to [src.worth])", "Take chips", 20, src.worth) if(!src || QDELETED(src)) return @@ -196,7 +199,10 @@ throw_range = 2 w_class = ITEMSIZE_SMALL -/obj/item/casino_platinum_chip/attack_self(mob/user as mob) +/obj/item/casino_platinum_chip/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE var/result = rand(1, sides) var/comment = "" if(result == 1) @@ -287,6 +293,9 @@ return worth /obj/item/spacecasinocash_fake/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE var/amount = tgui_input_number(user, "How much credits worth of chips do you want to take? (0 to [src.worth])", "Take chips", 20, src.worth) if(!src || QDELETED(src)) return diff --git a/code/modules/economy/coins.dm b/code/modules/economy/coins.dm index 027709ef1d..7deecd55b6 100644 --- a/code/modules/economy/coins.dm +++ b/code/modules/economy/coins.dm @@ -146,7 +146,10 @@ balloon_alert(user, "string detached") else ..() -/obj/item/coin/attack_self(mob/user as mob) +/obj/item/coin/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE var/result = rand(1, sides) var/comment = "" if(result == 1) diff --git a/code/modules/economy/coins_vr.dm b/code/modules/economy/coins_vr.dm index 33171cb69a..f4326d18a0 100644 --- a/code/modules/economy/coins_vr.dm +++ b/code/modules/economy/coins_vr.dm @@ -40,7 +40,10 @@ value = 20 -/obj/item/aliencoin/attack_self(mob/user as mob) +/obj/item/aliencoin/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE var/result = rand(1, sides) var/comment = "" if(result == 1) diff --git a/code/modules/economy/price_list.dm b/code/modules/economy/price_list.dm index 374bad10d3..081a2de8bd 100644 --- a/code/modules/economy/price_list.dm +++ b/code/modules/economy/price_list.dm @@ -768,9 +768,6 @@ /obj/item/reagent_containers/food/snacks/slice/vegetablepizza price_tag = 1 -/obj/item/reagent_containers/food/snacks/ - - // Baked Goods // /obj/item/reagent_containers/food/snacks/poppypretzel diff --git a/code/modules/economy/retail_scanner.dm b/code/modules/economy/retail_scanner.dm index ed906b7509..8c6df35d83 100644 --- a/code/modules/economy/retail_scanner.dm +++ b/code/modules/economy/retail_scanner.dm @@ -51,7 +51,10 @@ src.pixel_y = 0 -/obj/item/retail_scanner/attack_self(mob/user as mob) +/obj/item/retail_scanner/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE user.set_machine(src) interact(user) diff --git a/code/modules/entrepreneur/entrepreneur_items.dm b/code/modules/entrepreneur/entrepreneur_items.dm index 8b0e49067e..1d55a6646c 100644 --- a/code/modules/entrepreneur/entrepreneur_items.dm +++ b/code/modules/entrepreneur/entrepreneur_items.dm @@ -185,7 +185,10 @@ advice = pick(advice_list) pisces = "[stars] [prediction] [advice]" -/obj/item/entrepreneur/horoscope/attack_self(var/mob/user) +/obj/item/entrepreneur/horoscope/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE var/zodiac = tgui_input_list(user, "Which of todays zodiacs do you want to read?", "Zodiac", zodiacs) if(zodiac) switch(zodiac) @@ -289,7 +292,10 @@ icon = 'icons/obj/entrepreneur.dmi' icon_state = "dumbbell" -/obj/item/entrepreneur/dumbbell/attack_self(var/mob/user) +/obj/item/entrepreneur/dumbbell/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE var/mob/living/M = user if(M.nutrition <= 100) to_chat(user, span_notice("You are too hungry to exercise right now.")) @@ -312,7 +318,10 @@ var/turf/last_used = 0 var/emf_change = 0 -/obj/item/entrepreneur/emf/attack_self(var/mob/user) +/obj/item/entrepreneur/emf/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE if(!last_used) emf = rand(1,100) last_used = get_turf(user) diff --git a/code/modules/eventkit/generic_objects/generic_item.dm b/code/modules/eventkit/generic_objects/generic_item.dm index d60c7132da..b4a48f0a4f 100644 --- a/code/modules/eventkit/generic_objects/generic_item.dm +++ b/code/modules/eventkit/generic_objects/generic_item.dm @@ -18,6 +18,9 @@ var/icon_on = 0 /obj/item/generic_item/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE if(activatable_hand) if(!on) if(delay_time) @@ -87,7 +90,6 @@ if(user) user.visible_message(span_notice("[text_deactivated]")) update_icon() - return ..() /client/proc/generic_item() set category = "Fun.Event Kit" diff --git a/code/modules/fireworks/firework_stars.dm b/code/modules/fireworks/firework_stars.dm index 16072b591f..aa1257fddd 100644 --- a/code/modules/fireworks/firework_stars.dm +++ b/code/modules/fireworks/firework_stars.dm @@ -116,7 +116,10 @@ "a bottle", "a boat", "a spaceship", "Nanotrasen logo", "a geometric-looking letter S", "a dodecahedron") -/obj/item/firework_star/aesthetic/configurable/attack_self(var/mob/user) +/obj/item/firework_star/aesthetic/configurable/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE var/choice = tgui_alert(user, "What setting do you want to adjust?", "Firework Star", list("Color", "Shape", "Nothing")) if(src.loc != user) return diff --git a/code/modules/fishing/fishing_net.dm b/code/modules/fishing/fishing_net.dm index b34dfc352f..4773bae0f3 100644 --- a/code/modules/fishing/fishing_net.dm +++ b/code/modules/fishing/fishing_net.dm @@ -22,6 +22,9 @@ var/list/accepted_mobs = list(/mob/living/simple_mob/animal/passive/fish) + ///Var for attack_self chain + var/special_handling = FALSE + /obj/item/material/fishing_net/Initialize(mapload) . = ..() update_icon() @@ -58,7 +61,12 @@ return return ..() -/obj/item/material/fishing_net/attack_self(var/mob/user) +/obj/item/material/fishing_net/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE + if(special_handling) + return FALSE for(var/mob/M in src) M.forceMove(get_turf(src)) user.visible_message(span_notice("[user] releases [M] from \the [src]."), span_notice("You release [M] from \the [src].")) @@ -129,6 +137,8 @@ accepted_mobs = list(/mob/living/simple_mob/animal/sif/glitterfly, /mob/living/carbon/human) + special_handling = TRUE + /obj/item/material/fishing_net/butterfly_net/afterattack(var/atom/A, var/mob/user, var/proximity) if(get_dist(get_turf(src), A) > reach) return @@ -168,7 +178,10 @@ return return ..() -/obj/item/material/fishing_net/butterfly_net/attack_self(var/mob/user) +/obj/item/material/fishing_net/butterfly_net/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE for(var/mob/living/M in src) if(!user.get_inactive_hand()) //Check if the inactive hand is empty M.forceMove(get_turf(src)) diff --git a/code/modules/food/food/cans.dm b/code/modules/food/food/cans.dm index 92061db830..7046415e01 100644 --- a/code/modules/food/food/cans.dm +++ b/code/modules/food/food/cans.dm @@ -6,8 +6,12 @@ pickup_sound = 'sound/items/pickup/soda.ogg' cant_chance = 1 //arbitrarily high for april fools; if it's not reverted in its entirety I suggest rolling it down to 2% or something var/shaken = 0 // How many times this can has been shaken. + is_can = TRUE /obj/item/reagent_containers/food/drinks/cans/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE if(user.a_intent == I_HURT && !is_open_container()) to_chat(user, span_warning("You shake [src].")) if(!shaken) @@ -16,7 +20,6 @@ return if(HAS_TRAIT(user, TRAIT_UNLUCKY) && prob(10)) // Because it's always funny shaken += 10 - . = ..() /obj/item/reagent_containers/food/drinks/cans/open(mob/user) . = ..() diff --git a/code/modules/food/food/condiment.dm b/code/modules/food/food/condiment.dm index fca908e44f..0977f1a4b5 100644 --- a/code/modules/food/food/condiment.dm +++ b/code/modules/food/food/condiment.dm @@ -19,9 +19,6 @@ /obj/item/reagent_containers/food/condiment/attackby(var/obj/item/W as obj, var/mob/user as mob) return -/obj/item/reagent_containers/food/condiment/attack_self(var/mob/user as mob) - return - /obj/item/reagent_containers/food/condiment/attack(var/mob/M as mob, var/mob/user as mob, var/def_zone) if(standard_feed_mob(user, M)) return diff --git a/code/modules/food/food/drinks.dm b/code/modules/food/food/drinks.dm index 324f517cea..f950b5e26b 100644 --- a/code/modules/food/food/drinks.dm +++ b/code/modules/food/food/drinks.dm @@ -16,9 +16,14 @@ var/cant_open = 0 var/cant_chance = 0 + var/is_can = FALSE + /// Yims food_can_insert_micro = TRUE + ///Var for attack_self chain + var/special_handling = FALSE + /obj/item/reagent_containers/food/drinks/Initialize(mapload) . = ..() if (prob(cant_chance)) @@ -127,8 +132,13 @@ /obj/item/reagent_containers/food/drinks/on_rag_wipe(var/obj/item/reagent_containers/glass/rag/R) wash(CLEAN_SCRUB) -/obj/item/reagent_containers/food/drinks/attack_self(mob/user as mob) - if(!is_open_container()) +/obj/item/reagent_containers/food/drinks/attack_self(mob/user, special_pass) + . = ..(user) + if(.) + return TRUE + if(special_handling && !special_pass) + return FALSE + if(!is_open_container() && !(is_can && user.a_intent == I_HURT)) open(user) /obj/item/reagent_containers/food/drinks/proc/open(mob/user) diff --git a/code/modules/food/food/drinks/bottle.dm b/code/modules/food/food/drinks/bottle.dm index 3658fbc291..b86ef2fd81 100644 --- a/code/modules/food/food/drinks/bottle.dm +++ b/code/modules/food/food/drinks/bottle.dm @@ -13,6 +13,7 @@ var/obj/item/reagent_containers/glass/rag/rag = null var/rag_underlay = "rag" var/violent_throw = FALSE + special_handling = TRUE /obj/item/reagent_containers/food/drinks/bottle/on_reagent_change() return // To suppress price updating. Bottles have their own price tags. @@ -120,11 +121,14 @@ return ..() -/obj/item/reagent_containers/food/drinks/bottle/attack_self(mob/user) +/obj/item/reagent_containers/food/drinks/bottle/attack_self(mob/user, special_pass) + . = ..(user) + if(.) + return TRUE if(rag) remove_rag(user) else - ..() + ..(user, TRUE) /obj/item/reagent_containers/food/drinks/bottle/proc/insert_rag(obj/item/reagent_containers/glass/rag/R, mob/user) if(!isGlass || rag) return diff --git a/code/modules/food/food/snacks.dm b/code/modules/food/food/snacks.dm index ecf20d310d..c29de04b34 100644 --- a/code/modules/food/food/snacks.dm +++ b/code/modules/food/food/snacks.dm @@ -51,6 +51,9 @@ /// Yems. food_can_insert_micro = TRUE + ///Var for attack_self chain + var/special_handling = FALSE + /obj/item/reagent_containers/food/snacks/Initialize(mapload) . = ..() if(nutriment_amt) @@ -87,7 +90,12 @@ eater.put_in_hands(TrashItem) qdel(src) -/obj/item/reagent_containers/food/snacks/attack_self(mob/user as mob) +/obj/item/reagent_containers/food/snacks/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE + if(special_handling) + return FALSE if(package && !user.incapacitated()) unpackage(user) @@ -1264,13 +1272,17 @@ desc = "The food of choice for the veteran. Do NOT overconsume." filling_color = "#6D6D00" heated_reagents = list(REAGENT_ID_DOCTORSDELIGHT = 5, REAGENT_ID_HYPERZINE = 0.75, REAGENT_ID_SYNAPTIZINE = 0.25) - var/has_been_heated = 0 + var/has_been_heated = FALSE + special_handling = TRUE /obj/item/reagent_containers/food/snacks/donkpocket/sinpocket/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE if(has_been_heated) to_chat(user, span_notice("The heating chemicals have already been spent.")) return - has_been_heated = 1 + has_been_heated = TRUE user.visible_message(span_notice("[user] crushes \the [src] package."), "You crush \the [src] package and feel a comfortable heat build up. Now just to wait for it to be ready.") spawn(200) if(!QDELETED(src)) @@ -1953,12 +1965,16 @@ var/wrapped = 0 var/monkey_type = "Monkey" + special_handling = TRUE /obj/item/reagent_containers/food/snacks/monkeycube/Initialize(mapload) . = ..() reagents.add_reagent(REAGENT_ID_PROTEIN, 10) -/obj/item/reagent_containers/food/snacks/monkeycube/attack_self(mob/user as mob) +/obj/item/reagent_containers/food/snacks/monkeycube/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE if(wrapped) Unwrap(user) @@ -4189,8 +4205,10 @@ return ..() -/obj/item/pizzabox/attack_self( mob/user as mob ) - +/obj/item/pizzabox/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE if( boxes.len > 0 ) return @@ -4201,7 +4219,7 @@ update_icon() -/obj/item/pizzabox/attackby( obj/item/I as obj, mob/user as mob ) +/obj/item/pizzabox/attackby(obj/item/I, mob/user) if( istype(I, /obj/item/pizzabox/) ) var/obj/item/pizzabox/box = I diff --git a/code/modules/games/cards.dm b/code/modules/games/cards.dm index a583203bf7..61fd804306 100644 --- a/code/modules/games/cards.dm +++ b/code/modules/games/cards.dm @@ -305,6 +305,9 @@ ..() /obj/item/deck/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE shuffle(user) @@ -388,7 +391,10 @@ pickup_sound = 'sound/items/pickup/paper.ogg' -/obj/item/pack/attack_self(var/mob/user as mob) +/obj/item/pack/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE user.visible_message(span_danger("[user] rips open \the [src]!")) var/obj/item/hand/H = new() @@ -451,7 +457,10 @@ if(!cards.len) qdel(src) -/obj/item/hand/attack_self(var/mob/user as mob) +/obj/item/hand/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE concealed = !concealed update_icon() user.visible_message(span_notice("\The [user] [concealed ? "conceals" : "reveals"] their hand.")) diff --git a/code/modules/games/dice.dm b/code/modules/games/dice.dm index dadf9f2fbc..12d7946407 100644 --- a/code/modules/games/dice.dm +++ b/code/modules/games/dice.dm @@ -92,6 +92,9 @@ result = 10 /obj/item/dice/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE rollDice(user, 0) /obj/item/dice/proc/rollDice(mob/user, silent = FALSE) @@ -194,8 +197,12 @@ can_hold = list( /obj/item/dice, ) + special_handling = TRUE /obj/item/storage/dicecup/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE user.visible_message(span_notice("[user] shakes [src]."), \ span_notice("You shake [src]."), \ span_notice("You hear dice rolling.")) diff --git a/code/modules/holodeck/HolodeckObjects.dm b/code/modules/holodeck/HolodeckObjects.dm index 548be2f94c..1b0134cd62 100644 --- a/code/modules/holodeck/HolodeckObjects.dm +++ b/code/modules/holodeck/HolodeckObjects.dm @@ -327,7 +327,10 @@ return TRUE return FALSE -/obj/item/holo/esword/attack_self(mob/living/user as mob) +/obj/item/holo/esword/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE active = !active if (active) force = 30 diff --git a/code/modules/holomap/mapper.dm b/code/modules/holomap/mapper.dm index 0b439d5baa..6668d11ca3 100644 --- a/code/modules/holomap/mapper.dm +++ b/code/modules/holomap/mapper.dm @@ -126,6 +126,9 @@ hide_device() /obj/item/mapping_unit/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE if(user.stat != CONSCIOUS) return @@ -414,6 +417,9 @@ icon_state = initial(icon_state) + in_list ? "_on" : "" /obj/item/holomap_beacon/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE if(!in_list) in_list = TRUE GLOB.mapping_beacons += src diff --git a/code/modules/hydroponics/beekeeping/beehive.dm b/code/modules/hydroponics/beekeeping/beehive.dm index ddcccf865f..ccdf3ac123 100644 --- a/code/modules/hydroponics/beekeeping/beehive.dm +++ b/code/modules/hydroponics/beekeeping/beehive.dm @@ -290,7 +290,10 @@ icon = 'icons/obj/apiary_bees_etc.dmi' icon_state = "apiary" -/obj/item/beehive_assembly/attack_self(var/mob/user) +/obj/item/beehive_assembly/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE to_chat(user, span_notice("You start assembling \the [src]...")) if(do_after(user, 3 SECONDS, target = src)) user.visible_message(span_notice("[user] constructs a beehive."), span_notice("You construct a beehive.")) diff --git a/code/modules/hydroponics/grown.dm b/code/modules/hydroponics/grown.dm index e2706b5dc3..b76fa3f602 100644 --- a/code/modules/hydroponics/grown.dm +++ b/code/modules/hydroponics/grown.dm @@ -13,6 +13,7 @@ var/plantname var/datum/seed/seed var/potency = -1 + special_handling = TRUE /obj/item/reagent_containers/food/snacks/grown/Initialize(mapload, var/planttype) @@ -273,8 +274,10 @@ user.drop_from_inventory(src) qdel(src) -/obj/item/reagent_containers/food/snacks/grown/attack_self(mob/user as mob) - +/obj/item/reagent_containers/food/snacks/grown/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE if(!seed) return diff --git a/code/modules/hydroponics/seed_machines.dm b/code/modules/hydroponics/seed_machines.dm index 46b628eeed..56fbf5fcb9 100644 --- a/code/modules/hydroponics/seed_machines.dm +++ b/code/modules/hydroponics/seed_machines.dm @@ -13,8 +13,11 @@ pixel_x = rand(-5,5) pixel_y = rand(-5,5) -/obj/item/disk/botany/attack_self(var/mob/user as mob) - if(genes.len) +/obj/item/disk/botany/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE + if(LAZYLEN(genes)) var/choice = tgui_alert(user, "Are you sure you want to wipe the disk?", "Xenobotany Data", list("No", "Yes")) if(src && user && genes && choice && choice == "Yes" && user.Adjacent(get_turf(src))) to_chat(user, span_filter_notice("You wipe the disk data.")) diff --git a/code/modules/hydroponics/trays/tray_tools.dm b/code/modules/hydroponics/trays/tray_tools.dm index 9c35bca89a..91e71c9e12 100644 --- a/code/modules/hydroponics/trays/tray_tools.dm +++ b/code/modules/hydroponics/trays/tray_tools.dm @@ -30,12 +30,16 @@ var/list/last_reagents pickup_sound = 'sound/items/pickup/device.ogg' drop_sound = 'sound/items/drop/device.ogg' + special_handling = TRUE /obj/item/analyzer/plant_analyzer/Destroy() . = ..() QDEL_NULL(last_seed) /obj/item/analyzer/plant_analyzer/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE tgui_interact(user) /obj/item/analyzer/plant_analyzer/tgui_interact(mob/user, datum/tgui/ui) diff --git a/code/modules/instruments/items.dm b/code/modules/instruments/items.dm index 36687db2af..7caa2ff468 100644 --- a/code/modules/instruments/items.dm +++ b/code/modules/instruments/items.dm @@ -36,11 +36,14 @@ return FALSE return TRUE -/obj/item/instrument/attack_self(mob/M) - if(!M.IsAdvancedToolUser()) +/obj/item/instrument/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE + if(!user.IsAdvancedToolUser()) return - tgui_interact(M) + tgui_interact(user) /obj/item/instrument/tgui_interact(mob/user, datum/tgui/ui) return song.tgui_interact(user) diff --git a/code/modules/integrated_electronics/core/assemblies.dm b/code/modules/integrated_electronics/core/assemblies.dm index fe870e906b..bd4493f217 100644 --- a/code/modules/integrated_electronics/core/assemblies.dm +++ b/code/modules/integrated_electronics/core/assemblies.dm @@ -408,6 +408,9 @@ return ..() /obj/item/electronic_assembly/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE if(!check_interactivity(user)) return if(opened) diff --git a/code/modules/integrated_electronics/core/assemblies/clothing.dm b/code/modules/integrated_electronics/core/assemblies/clothing.dm index 4106c2ac52..3fedc1e768 100644 --- a/code/modules/integrated_electronics/core/assemblies/clothing.dm +++ b/code/modules/integrated_electronics/core/assemblies/clothing.dm @@ -60,13 +60,18 @@ return IC.attackby(I, user) /obj/item/clothing/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE + if(special_handling) + return FALSE + if(helmet_handling) + return FALSE if(IC) if(IC.opened) IC.attack_self(user) else action_circuit.do_work() - else - ..() // Does most of the repeatative setup. /obj/item/clothing/proc/setup_integrated_circuit(new_type) diff --git a/code/modules/integrated_electronics/core/assemblies/device.dm b/code/modules/integrated_electronics/core/assemblies/device.dm index 6a2117ba4b..ca7ca3fe2b 100644 --- a/code/modules/integrated_electronics/core/assemblies/device.dm +++ b/code/modules/integrated_electronics/core/assemblies/device.dm @@ -6,6 +6,8 @@ var/obj/item/electronic_assembly/device/EA + special_handling = TRUE + /obj/item/assembly/electronic_assembly/Initialize(mapload) . = ..() EA = new(src) @@ -35,7 +37,10 @@ if(opened) icon_state = icon_state + "-open" -/obj/item/assembly/electronic_assembly/attack_self(mob/user as mob) +/obj/item/assembly/electronic_assembly/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE if(EA) EA.attack_self(user) diff --git a/code/modules/integrated_electronics/core/detailer.dm b/code/modules/integrated_electronics/core/detailer.dm index f4b06bdba6..9a44aac54a 100644 --- a/code/modules/integrated_electronics/core/detailer.dm +++ b/code/modules/integrated_electronics/core/detailer.dm @@ -63,6 +63,9 @@ return TRUE /obj/item/integrated_electronics/detailer/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE tgui_interact(user) // Leaving this commented out in case someone decides that this would be better as an "any color" selection system diff --git a/code/modules/integrated_electronics/core/printer.dm b/code/modules/integrated_electronics/core/printer.dm index 0642d79da2..f2752ee342 100644 --- a/code/modules/integrated_electronics/core/printer.dm +++ b/code/modules/integrated_electronics/core/printer.dm @@ -124,7 +124,10 @@ dirty_items = TRUE return ..() -/obj/item/integrated_circuit_printer/attack_self(var/mob/user) +/obj/item/integrated_circuit_printer/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE tgui_interact(user) /obj/item/integrated_circuit_printer/tgui_state(mob/user) diff --git a/code/modules/integrated_electronics/core/tools.dm b/code/modules/integrated_electronics/core/tools.dm index 81200cdbe4..13fafe87b9 100644 --- a/code/modules/integrated_electronics/core/tools.dm +++ b/code/modules/integrated_electronics/core/tools.dm @@ -80,6 +80,9 @@ return /obj/item/integrated_electronics/wirer/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE switch(mode) if(WIRE) mode = UNWIRE @@ -114,6 +117,9 @@ var/accepting_refs = 0 /obj/item/integrated_electronics/debugger/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE var/type_to_use = tgui_input_list(user, "Please choose a type to use.","[src] type setting", list("string","number","ref", "null")) if(!CanInteract(user, GLOB.tgui_physical_state)) return @@ -172,14 +178,6 @@ var/datum/integrated_io/selected_io = null var/mode = 0 -/obj/item/multitool/attack_self(mob/user) - if(selected_io) - selected_io = null - to_chat(user, span_notice("You clear the wired connection from the multitool.")) - else - ..() - update_icon() - /obj/item/multitool/update_icon() if(selected_io) if(buffer || connecting || connectable) diff --git a/code/modules/integrated_electronics/subtypes/manipulation.dm b/code/modules/integrated_electronics/subtypes/manipulation.dm index 6441d4b67f..0caf93b0fe 100644 --- a/code/modules/integrated_electronics/subtypes/manipulation.dm +++ b/code/modules/integrated_electronics/subtypes/manipulation.dm @@ -46,7 +46,10 @@ else ..() -/obj/item/integrated_circuit/manipulation/weapon_firing/attack_self(var/mob/user) +/obj/item/integrated_circuit/manipulation/weapon_firing/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE if(installed_gun) installed_gun.forceMove(get_turf(src)) to_chat(user, span_notice("You slide \the [installed_gun] out of the firing mechanism.")) @@ -191,7 +194,10 @@ else ..() -/obj/item/integrated_circuit/manipulation/grenade/attack_self(var/mob/user) +/obj/item/integrated_circuit/manipulation/grenade/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE if(attached_grenade) user.visible_message(span_warning("\The [user] removes \an [attached_grenade] from \the [src]!"), span_notice("You remove \the [attached_grenade] from \the [src].")) user.put_in_any_hand_if_possible(attached_grenade) || attached_grenade.dropInto(loc) diff --git a/code/modules/integrated_electronics/subtypes/memory.dm b/code/modules/integrated_electronics/subtypes/memory.dm index 14286442d2..201f5e7d97 100644 --- a/code/modules/integrated_electronics/subtypes/memory.dm +++ b/code/modules/integrated_electronics/subtypes/memory.dm @@ -91,6 +91,9 @@ return /obj/item/integrated_circuit/memory/constant/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE var/datum/integrated_io/O = outputs[1] var/type_to_use = tgui_input_list(user, "Please choose a type to use.","[src] type setting", list("string","number","ref", "null")) if(!CanInteract(user, GLOB.tgui_physical_state)) diff --git a/code/modules/library/lib_items.dm b/code/modules/library/lib_items.dm index fc5d2246fa..9008a7521d 100644 --- a/code/modules/library/lib_items.dm +++ b/code/modules/library/lib_items.dm @@ -182,20 +182,30 @@ Book Cart End var/title // The real name of the book. var/carved = 0 // Has the book been hollowed out for use as a secret storage item? var/obj/item/store //What's in the book? + var/occult_tier = 0 //If the book is an occult book or not and how strong it is. Used for attack_self + ///Var for attack_self chain + var/special_handling = FALSE drop_sound = 'sound/items/drop/book.ogg' pickup_sound = 'sound/items/pickup/book.ogg' -/obj/item/book/attack_self(var/mob/user) +/obj/item/book/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE + if(occult_tier) + return FALSE + if(special_handling) + return FALSE if(carved) if(store) to_chat(user, span_notice("[store] falls out of [title]!")) - store.loc = get_turf(src.loc) + store.forceMove(get_turf(src.loc)) store = null return else to_chat(user, span_notice("The pages of [title] have been cut out!")) return - if(src.dat) + if(dat) display_content(user) user.visible_message("[user] opens a book titled \"[src.title]\" and begins reading intently.") playsound(src, 'sound/bureaucracy/bookopen.ogg', 50, 1) @@ -309,6 +319,7 @@ Book Cart End /obj/item/book/bundle var/page = 1 //current page var/list/pages = list() //the contents of each page + special_handling = TRUE /obj/item/book/bundle/proc/show_content(mob/user) if(!pages.len) @@ -350,6 +361,9 @@ Book Cart End user << browse(dat, "window=[name]") /obj/item/book/bundle/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE src.show_content(user) add_fingerprint(user) update_icon() @@ -388,6 +402,9 @@ Book Cart End var/mode = 0 // 0 - Scan only, 1 - Scan and Set Buffer, 2 - Scan and Attempt to Check In, 3 - Scan and Attempt to Add to Inventory /obj/item/barcodescanner/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE mode += 1 if(mode > 3) mode = 0 diff --git a/code/modules/lore_codex/codex.dm b/code/modules/lore_codex/codex.dm index 12dc7e1523..2467e2af9e 100644 --- a/code/modules/lore_codex/codex.dm +++ b/code/modules/lore_codex/codex.dm @@ -11,6 +11,8 @@ var/static/list/codex_tree_keys = list() // static list linking codexes to the correct codex_tree. + special_handling = TRUE + /obj/item/book/codex/Initialize(mapload) tree = codex_tree_keys["[root_type]"] if(!tree) @@ -19,6 +21,9 @@ . = ..() /obj/item/book/codex/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE if(!tree) tree = codex_tree_keys["[root_type]"] if(!tree) diff --git a/code/modules/maintenance_panels/maintpanel_stack.dm b/code/modules/maintenance_panels/maintpanel_stack.dm index 7b93ce1d61..c24c5ccd61 100644 --- a/code/modules/maintenance_panels/maintpanel_stack.dm +++ b/code/modules/maintenance_panels/maintpanel_stack.dm @@ -11,8 +11,12 @@ throw_range = 20 can_weld = TRUE no_variants = FALSE + custom_handling = TRUE -/obj/item/stack/tile/maintenance_panel/attack_self(var/mob/user) +/obj/item/stack/tile/maintenance_panel/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE var/turf/T = user.loc if(!user || (loc != user && !isrobot(user)) || user.stat || user.loc != T) return FALSE diff --git a/code/modules/makeup/nailpolish.dm b/code/modules/makeup/nailpolish.dm index 80322329fc..f5d61913a2 100644 --- a/code/modules/makeup/nailpolish.dm +++ b/code/modules/makeup/nailpolish.dm @@ -25,7 +25,10 @@ desc = "Nail polish, " + initial(desc) update_icon() -/obj/item/nailpolish/attack_self(var/mob/user) +/obj/item/nailpolish/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE open = !open to_chat(user, span_notice("You [open ? "open" : "close"] \the [src].")) update_icon() @@ -100,7 +103,10 @@ icon_state = "nailpolishremover" var/open = FALSE -/obj/item/nailpolish_remover/attack_self(var/mob/user) +/obj/item/nailpolish_remover/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE open = !open to_chat(user, span_notice("You [open ? "open" : "close"] \the [src].")) update_icon() diff --git a/code/modules/materials/sheets/_sheets.dm b/code/modules/materials/sheets/_sheets.dm index 1d21169f7e..28637c5ea9 100644 --- a/code/modules/materials/sheets/_sheets.dm +++ b/code/modules/materials/sheets/_sheets.dm @@ -21,6 +21,7 @@ var/apply_colour //temp pending icon rewrite drop_sound = 'sound/items/drop/axe.ogg' pickup_sound = 'sound/items/pickup/axe.ogg' + custom_handling = TRUE /obj/item/stack/material/Initialize(mapload) . = ..() @@ -90,9 +91,12 @@ M.update_strings() return transfer -/obj/item/stack/material/attack_self(var/mob/user) +/obj/item/stack/material/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE if(!material.build_windows(user, src)) - ..() + tgui_interact(user) /obj/item/stack/material/attackby(var/obj/item/W, var/mob/user) if(istype(W,/obj/item/stack/cable_coil)) diff --git a/code/modules/materials/sheets/organic/animal_products.dm b/code/modules/materials/sheets/organic/animal_products.dm index dcb588954a..28369e6ad1 100644 --- a/code/modules/materials/sheets/organic/animal_products.dm +++ b/code/modules/materials/sheets/organic/animal_products.dm @@ -158,9 +158,13 @@ desc = "A collar made out of pliable material." icon_state = "collar_handmade" var/given_name + special_handling = TRUE /obj/item/clothing/glasses/sunglasses/blindfold/whiteblindfold/craftable name = "handmade blindfold" desc = "A handmade blindfold that covers the eyes, preventing sight." -/obj/item/clothing/accessory/collar/craftable/attack_self(mob/living/user) +/obj/item/clothing/accessory/collar/craftable/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE given_name = sanitizeSafe(tgui_input_text(user, "What would you like to label the collar?", "Collar Labelling", null, MAX_NAME_LEN, encode = FALSE), MAX_NAME_LEN) diff --git a/code/modules/media/walkpod.dm b/code/modules/media/walkpod.dm index c9070d796f..769119ea2e 100644 --- a/code/modules/media/walkpod.dm +++ b/code/modules/media/walkpod.dm @@ -75,12 +75,15 @@ else if(loc == L) // at least they're holding it to_chat(L, span_warning("Turn on the [src] first.")) -/obj/item/walkpod/attack_self(mob/living/L) - if(!istype(L) || loc != L) +/obj/item/walkpod/attack_self(mob/living/user) + . = ..(user) + if(.) + return TRUE + if(!istype(user) || loc != user) return if(!listener) - set_listener(L) - tgui_interact(L) + set_listener(user) + tgui_interact(user) // Process ticks to ensure our listener remains valid and we do music-ing /obj/item/walkpod/process() diff --git a/code/modules/mining/drilling/scanner.dm b/code/modules/mining/drilling/scanner.dm index bbc1eb0f43..274d9ae180 100644 --- a/code/modules/mining/drilling/scanner.dm +++ b/code/modules/mining/drilling/scanner.dm @@ -10,7 +10,10 @@ var/range = 2 var/exact = FALSE -/obj/item/mining_scanner/attack_self(mob/user as mob) +/obj/item/mining_scanner/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE to_chat(user, span_notice("You begin sweeping \the [src] about, scanning for metal deposits.")) playsound(src, 'sound/items/goggles_charge.ogg', 50, 1, -6) diff --git a/code/modules/mining/fulton.dm b/code/modules/mining/fulton.dm index 4ca3aefa8e..671f629b63 100644 --- a/code/modules/mining/fulton.dm +++ b/code/modules/mining/fulton.dm @@ -15,6 +15,9 @@ . += "It has [uses_left] use\s remaining." /obj/item/extraction_pack/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE var/list/possible_beacons = list() for(var/obj/structure/extraction_point/EP as anything in GLOB.total_extraction_beacons) if(EP.beacon_network in beacon_networks) @@ -142,6 +145,11 @@ icon_state = "subspace_amplifier" /obj/item/fulton_core/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE + var/turf/T = get_turf(user) + var/outdoors = T.is_outdoors() if(do_after(user, 1.5 SECONDS, target = user) && !QDELETED(src)) new /obj/structure/extraction_point(get_turf(user)) qdel(src) diff --git a/code/modules/mining/kinetic_crusher.dm b/code/modules/mining/kinetic_crusher.dm index e315ea0f89..08e428f5b6 100644 --- a/code/modules/mining/kinetic_crusher.dm +++ b/code/modules/mining/kinetic_crusher.dm @@ -246,6 +246,9 @@ STOP_PROCESSING(SSprocessing, src) /obj/item/kinetic_crusher/machete/gauntlets/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE ready_toggle() /obj/item/kinetic_crusher/machete/gauntlets/process() diff --git a/code/modules/mining/mine_items.dm b/code/modules/mining/mine_items.dm index 5ed8880c2c..d598ff429d 100644 --- a/code/modules/mining/mine_items.dm +++ b/code/modules/mining/mine_items.dm @@ -210,6 +210,7 @@ icon = 'icons/obj/mining.dmi' var/upright = 0 var/base_state + custom_handling = TRUE /obj/item/stack/flag/Initialize(mapload) . = ..() @@ -251,7 +252,10 @@ else ..() -/obj/item/stack/flag/attack_self(mob/user as mob) +/obj/item/stack/flag/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE var/obj/item/stack/flag/F = locate() in get_turf(src) diff --git a/code/modules/mining/resonator.dm b/code/modules/mining/resonator.dm index 5c683ee953..d38491721e 100644 --- a/code/modules/mining/resonator.dm +++ b/code/modules/mining/resonator.dm @@ -85,6 +85,9 @@ fieldsactive-- /obj/item/resonator/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE switch(tgui_alert(user, "Change Detonation Time or toggle Cascading?","Setting", list("Toggle Cascade", "Resonance Time"))) if("Resonance Time") if(burst_time == 50) diff --git a/code/modules/mining/shelter_atoms_vr.dm b/code/modules/mining/shelter_atoms_vr.dm index d00c27e707..9f9ac9126d 100644 --- a/code/modules/mining/shelter_atoms_vr.dm +++ b/code/modules/mining/shelter_atoms_vr.dm @@ -179,6 +179,9 @@ GLOBAL_LIST_EMPTY(unique_deployable) . += temp_info /obj/item/survivalcapsule/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE //Can't grab when capsule is New() because templates aren't loaded then get_template() if(!used) diff --git a/code/modules/mob/living/carbon/brain/MMI.dm b/code/modules/mob/living/carbon/brain/MMI.dm index 020e2d2a36..3db9285061 100644 --- a/code/modules/mob/living/carbon/brain/MMI.dm +++ b/code/modules/mob/living/carbon/brain/MMI.dm @@ -20,6 +20,9 @@ var/obj/item/radio/headset/mmi_radio/radio = null//Let's give it a radio. var/mob/living/body_backup = null //add reforming + ///Var for attack_self chain + var/special_handling = FALSE + /obj/item/mmi/Initialize(mapload) . = ..() radio = new(src)//Spawns a radio inside the MMI. @@ -98,7 +101,12 @@ ..() //TODO: ORGAN REMOVAL UPDATE. Make the brain remain in the MMI so it doesn't lose organ data. -/obj/item/mmi/attack_self(mob/user as mob) +/obj/item/mmi/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE + if(special_handling) + return FALSE if(!brainmob) to_chat(user, span_warning("You upend the MMI, but there's nothing in it.")) else if(locked) @@ -187,6 +195,9 @@ mecha = null//This does not appear to be used outside of reference in mecha.dm. var/ghost_query_type = null var/datum/ghost_query/Q //This is used so we can unregister ourself. + special_handling = TRUE + ///Var for attack_self chain + var/is_digital_robot = FALSE /obj/item/mmi/digital/Initialize(mapload) . = ..() @@ -226,7 +237,12 @@ H.mind.transfer_to(brainmob) return -/obj/item/mmi/digital/attack_self(mob/user as mob) +/obj/item/mmi/digital/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE + if(is_digital_robot) + return FALSE if(brainmob && !brainmob.key && searching == 0) //Start the process of searching for a new user. to_chat(user, span_blue("You carefully locate the manual activation switch and start the [src]'s boot process.")) @@ -288,6 +304,7 @@ w_class = ITEMSIZE_NORMAL origin_tech = list(TECH_ENGINEERING = 4, TECH_MATERIAL = 3, TECH_DATA = 4) ghost_query_type = /datum/ghost_query/drone_brain + is_digital_robot = TRUE /obj/item/mmi/digital/robot/Initialize(mapload) . = ..() diff --git a/code/modules/mob/living/carbon/brain/posibrain.dm b/code/modules/mob/living/carbon/brain/posibrain.dm index ac5337dcf1..a9c898f035 100644 --- a/code/modules/mob/living/carbon/brain/posibrain.dm +++ b/code/modules/mob/living/carbon/brain/posibrain.dm @@ -11,9 +11,13 @@ req_access = list(ACCESS_ROBOTICS) locked = 0 mecha = null//This does not appear to be used outside of reference in mecha.dm. + is_digital_robot = TRUE /obj/item/mmi/digital/posibrain/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE if(brainmob && !brainmob.key && searching == 0) //Start the process of searching for a new user. to_chat(user, span_blue("You carefully locate the manual activation switch and start the positronic brain's boot process.")) diff --git a/code/modules/mob/living/carbon/brain/robot.dm b/code/modules/mob/living/carbon/brain/robot.dm index 897138b2c0..ca37f689a3 100644 --- a/code/modules/mob/living/carbon/brain/robot.dm +++ b/code/modules/mob/living/carbon/brain/robot.dm @@ -5,6 +5,7 @@ icon_state = "mainboard" w_class = ITEMSIZE_NORMAL origin_tech = list(TECH_ENGINEERING = 4, TECH_MATERIAL = 3, TECH_DATA = 4) + is_digital_robot = TRUE /obj/item/mmi/digital/robot/Initialize(mapload) . = ..() @@ -18,6 +19,3 @@ brainmob.mind.assigned_role = JOB_ROBOTIC_INTELLIGENCE to_chat(brainmob, span_notify("You feel slightly disoriented. That's normal when you're little more than a complex circuit.")) return - -/obj/item/mmi/digital/robot/attack_self(mob/user) - return //This object is technically a brain, and should not be dumping brains out of itself like its parent object does. diff --git a/code/modules/mob/living/carbon/human/examine.dm b/code/modules/mob/living/carbon/human/examine.dm index 230a6ffdb3..8295ea7e01 100644 --- a/code/modules/mob/living/carbon/human/examine.dm +++ b/code/modules/mob/living/carbon/human/examine.dm @@ -285,7 +285,7 @@ msg += "[p_Theyre()] very short!" if (src.stat || (status_flags & FAKEDEATH)) - msg += span_warning("[p_Theyre()] not responding to anything around [p_they()] and seems to be asleep.") + msg += span_warning("[p_Theyre()] not responding to anything around [p_them()] and seems to be asleep.") var/obj/item/organ/internal/lungs/L = internal_organs_by_name[O_LUNGS] if(((stat == DEAD || losebreath || !L || (status_flags & FAKEDEATH)) && get_dist(user, src) <= 3)) msg += span_warning("[p_They()] [user.p_do()] not appear to be breathing.") diff --git a/code/modules/mob/living/carbon/human/species/lleill/lleill_items.dm b/code/modules/mob/living/carbon/human/species/lleill/lleill_items.dm index 70061a86a5..fd0111be9f 100644 --- a/code/modules/mob/living/carbon/human/species/lleill/lleill_items.dm +++ b/code/modules/mob/living/carbon/human/species/lleill/lleill_items.dm @@ -130,7 +130,10 @@ icon_state = "face" var/mob/living/homunculus = 0 -/obj/item/glamour_face/attack_self(var/mob/user) +/obj/item/glamour_face/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE if(!homunculus) var/list/targets = list() for(var/mob/living/carbon/human/M in GLOB.mob_list) @@ -357,6 +360,9 @@ ) /obj/item/glamour_unstable/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE var/mob/living/M = user if(!istype(M)) return diff --git a/code/modules/mob/living/silicon/robot/cloak.dm b/code/modules/mob/living/silicon/robot/cloak.dm index 75278638a6..89cac9d658 100644 --- a/code/modules/mob/living/silicon/robot/cloak.dm +++ b/code/modules/mob/living/silicon/robot/cloak.dm @@ -17,6 +17,9 @@ . = ..() /obj/item/borg/cloak/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE set_cloak_level(user) /obj/item/borg/cloak/item_ctrl_click(mob/user) diff --git a/code/modules/mob/living/silicon/robot/dogborg/dog_defense_modules.dm b/code/modules/mob/living/silicon/robot/dogborg/dog_defense_modules.dm index 09cd91b059..11bcd771b9 100644 --- a/code/modules/mob/living/silicon/robot/dogborg/dog_defense_modules.dm +++ b/code/modules/mob/living/silicon/robot/dogborg/dog_defense_modules.dm @@ -25,6 +25,9 @@ flags = NOBLUDGEON /obj/item/self_repair_system/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE if(repairing) return var/mob/living/silicon/robot/R = user diff --git a/code/modules/mob/living/silicon/robot/dogborg/dog_modules.dm b/code/modules/mob/living/silicon/robot/dogborg/dog_modules.dm index 41b577274f..268fbdde19 100644 --- a/code/modules/mob/living/silicon/robot/dogborg/dog_modules.dm +++ b/code/modules/mob/living/silicon/robot/dogborg/dog_modules.dm @@ -11,6 +11,9 @@ flags = NOBLUDGEON //No more attack messages /obj/item/boop_module/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE if (!( istype(user.loc, /turf) )) return @@ -130,6 +133,9 @@ flags = NOBLUDGEON //No more attack messages /obj/item/robot_tongue/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE var/mob/living/silicon/robot/R = user if(R.emagged || R.emag_items) emagged = !emagged @@ -210,6 +216,9 @@ flags = NOBLUDGEON /obj/item/pupscrubber/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE var/mob/living/silicon/robot/R = user if(!enabled) R.scrubbing = TRUE @@ -227,9 +236,12 @@ uses = 10 var/cooldown = 0 var/datum/matter_synth/glass = null + special_handling = TRUE /obj/item/lightreplacer/dogborg/attack_self(mob/user)//Recharger refill is so last season. Now we recycle without magic! - + . = ..(user) + if(.) + return TRUE var/choice = tgui_alert(user, "Do you wish to check the reserves or change the color?", "Selection List", list("Reserves", "Color")) if(!choice) return @@ -314,6 +326,9 @@ flags = NOBLUDGEON /obj/item/dogborg/pounce/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE var/mob/living/silicon/robot/R = user R.leap(bluespace) diff --git a/code/modules/mob/living/silicon/robot/dogborg/dog_sleeper.dm b/code/modules/mob/living/silicon/robot/dogborg/dog_sleeper.dm index ed542f47fb..3f091e7d85 100644 --- a/code/modules/mob/living/silicon/robot/dogborg/dog_sleeper.dm +++ b/code/modules/mob/living/silicon/robot/dogborg/dog_sleeper.dm @@ -223,8 +223,9 @@ hound.cell.charge = hound.cell.charge - amt /obj/item/dogborg/sleeper/attack_self(mob/user) - if(..()) - return + . = ..(user) + if(.) + return TRUE tgui_interact(user) /obj/item/dogborg/sleeper/tgui_state(mob/user) diff --git a/code/modules/mob/living/silicon/robot/robot_items.dm b/code/modules/mob/living/silicon/robot/robot_items.dm index b22e1b4023..9031f56885 100644 --- a/code/modules/mob/living/silicon/robot/robot_items.dm +++ b/code/modules/mob/living/silicon/robot/robot_items.dm @@ -148,9 +148,13 @@ desc = "A black ink printing attachment with a paper naming mode." name = "Printing Pen" var/mode = 1 + special_handling = TRUE + /obj/item/pen/robopen/attack_self(mob/user) - + . = ..(user) + if(.) + return TRUE var/choice = tgui_alert(user, "Would you like to change colour or mode?", "Change What?", list("Colour","Mode","Cancel")) if(!choice || choice == "Cancel") return @@ -213,6 +217,9 @@ deploy_paper(user) /obj/item/form_printer/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE deploy_paper(user) /obj/item/form_printer/proc/deploy_paper(mob/user) @@ -490,6 +497,9 @@ . = ..() /obj/item/borg/combat/shield/attack_self(var/mob/living/user) + . = ..(user) + if(.) + return TRUE set_shield_level() /obj/item/borg/combat/shield/process() @@ -562,6 +572,9 @@ . += "It is set to deploy [mode ? "doors" : "walls"]" /obj/item/inflatable_dispenser/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE mode = !mode to_chat(user, span_filter_notice("You set \the [src] to deploy [mode ? "doors" : "walls"].")) @@ -643,7 +656,7 @@ icon_state = "setup_device_box" /obj/item/robo_dice/attack_self(mob/user) - . = ..() + . = ..(user) var/DI = 'icons/obj/dice.dmi' var/dice_options = list( "roll a custom die" = image(icon = 'icons/obj/integrated_electronics/electronic_setups.dmi', icon_state = "setup_device_box"), diff --git a/code/modules/mob/living/silicon/robot/robot_simple_items.dm b/code/modules/mob/living/silicon/robot/robot_simple_items.dm index c7e9224eec..10384e2f36 100644 --- a/code/modules/mob/living/silicon/robot/robot_simple_items.dm +++ b/code/modules/mob/living/silicon/robot/robot_simple_items.dm @@ -87,6 +87,9 @@ /obj/item/robotic_multibelt/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE if(!cyborg_integrated_tools || !LAZYLEN(cyborg_integrated_tools)) to_chat(user, "Your multibelt is empty!") return @@ -107,8 +110,6 @@ cut_overlays() assume_selected_item(integrated_tools_by_name[choice]) - ..() - /obj/item/robotic_multibelt/proc/assume_selected_item(obj/item/chosen_item) if(!chosen_item) return @@ -219,8 +220,12 @@ matter = null uses_charge = 1 charge_costs = list(1) + custom_handling = TRUE /obj/item/stack/cable_coil/cyborg/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE set_colour(user) /obj/item/stack/cable_coil/cyborg/proc/set_colour(mob/user) @@ -560,6 +565,9 @@ pickup_sound = 'sound/items/pickup/device.ogg' drop_sound = 'sound/items/drop/device.ogg' + ///Var for attack_self chain + var/special_handling = FALSE + /obj/item/storage/internal/gripper max_w_class = ITEMSIZE_HUGE max_storage_space = ITEMSIZE_COST_HUGE @@ -662,6 +670,11 @@ photo_images["[pocket_to_check.name]" + "[pocket_content.name]"] = pocket_image /obj/item/gripper/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE + if(special_handling) + return FALSE var/busy = is_in_use() if(busy) to_chat(user, span_danger("[busy]")) @@ -1097,9 +1110,14 @@ can_hold = list(EXOSUIT_GRIPPER) + special_handling = TRUE + /obj/item/gripper/no_use //Used when you want to hold and put items in other things, but not able to 'use' the item -/obj/item/gripper/no_use/attack_self(mob/user as mob) +/obj/item/gripper/no_use/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE return /obj/item/gripper/no_use/loader //This is used to disallow building with metal. diff --git a/code/modules/mob/living/simple_mob/subtypes/animal/giant_spider/broodmother.dm b/code/modules/mob/living/simple_mob/subtypes/animal/giant_spider/broodmother.dm index c36fdb85e5..0d50e2f6b0 100644 --- a/code/modules/mob/living/simple_mob/subtypes/animal/giant_spider/broodmother.dm +++ b/code/modules/mob/living/simple_mob/subtypes/animal/giant_spider/broodmother.dm @@ -172,7 +172,10 @@ origin_tech = list(TECH_BIO = 10) -/obj/item/royal_spider_egg/attack_self(mob/user as mob) +/obj/item/royal_spider_egg/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE var/response = tgui_alert(user, "Are you sure you want to release the royal spiderling right now? It appears ready to imprint the moment its born.", "Royal Spider Egg", list("Yes", "No")) if(response == "Yes") diff --git a/code/modules/mob/living/simple_mob/subtypes/animal/passive/mouse_vr.dm b/code/modules/mob/living/simple_mob/subtypes/animal/passive/mouse_vr.dm index 9cfe40f2e0..015be45c36 100644 --- a/code/modules/mob/living/simple_mob/subtypes/animal/passive/mouse_vr.dm +++ b/code/modules/mob/living/simple_mob/subtypes/animal/passive/mouse_vr.dm @@ -12,11 +12,14 @@ movement_cooldown = 5 universal_understand = 1 -/obj/item/holder/mouse/attack_self(var/mob/U) +/obj/item/holder/mouse/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE for(var/mob/living/simple_mob/M in contents) - if((I_HELP) && U.checkClickCooldown()) //a little snowflakey, but makes it use the same cooldown as interacting with non-inventory objects - U.setClickCooldown(U.get_attack_speed()) //if there's a cleaner way in baycode, I'll change this - U.visible_message(span_notice("[U] [M.response_help] \the [M].")) + if((I_HELP) && user.checkClickCooldown()) //a little snowflakey, but makes it use the same cooldown as interacting with non-inventory objects + user.setClickCooldown(user.get_attack_speed()) //if there's a cleaner way in baycode, I'll change this + user.visible_message(span_notice("[user] [M.response_help] \the [M].")) //Jank grabber that uses the 'attack_hand' insead of 'MouseDrop' /mob/living/simple_mob/animal/passive/mouse/attack_hand(mob/user) @@ -60,6 +63,9 @@ . = ..(mapload, TRUE) /obj/item/holder/mouse/attack_self(mob/living/carbon/user) + . = ..(user) + if(.) + return TRUE user.setClickCooldown(user.get_attack_speed()) for(var/L in contents) if(isanimal(L)) diff --git a/code/modules/mob/living/simple_mob/subtypes/animal/pets/cat.dm b/code/modules/mob/living/simple_mob/subtypes/animal/pets/cat.dm index 2a985edf7e..d42f1e147a 100644 --- a/code/modules/mob/living/simple_mob/subtypes/animal/pets/cat.dm +++ b/code/modules/mob/living/simple_mob/subtypes/animal/pets/cat.dm @@ -277,7 +277,10 @@ var/list/_cat_default_emotes = list( icon_state = "box" var/cattype = /mob/living/simple_mob/animal/passive/cat -/obj/item/cat_box/attack_self(var/mob/user) +/obj/item/cat_box/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE var/turf/catturf = get_turf(src) to_chat(user, span_notice("You peek into \the [name]-- and a cat jumps out!")) new cattype(catturf) diff --git a/code/modules/mob/living/simple_mob/subtypes/vore/plants/pitcher.dm b/code/modules/mob/living/simple_mob/subtypes/vore/plants/pitcher.dm index 056b4c6b0f..367fdbd4c5 100644 --- a/code/modules/mob/living/simple_mob/subtypes/vore/plants/pitcher.dm +++ b/code/modules/mob/living/simple_mob/subtypes/vore/plants/pitcher.dm @@ -300,6 +300,7 @@ GLOBAL_LIST_INIT(pitcher_plant_lure_messages, list( w_class = ITEMSIZE_SMALL var/datum/seed/seed = null var/obj/item/seeds/pit = null + special_handling = TRUE /obj/item/reagent_containers/food/snacks/pitcher_fruit/Initialize(mapload) . = ..() @@ -324,6 +325,9 @@ GLOBAL_LIST_INIT(pitcher_plant_lure_messages, list( qdel(src) /obj/item/reagent_containers/food/snacks/pitcher_fruit/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE to_chat(user, span_notice("You plant the fruit.")) new /obj/machinery/portable_atmospherics/hydroponics/soil/invisible(get_turf(user),src.seed) GLOB.seed_planted_shift_roundstat++ diff --git a/code/modules/mob/mob_grab.dm b/code/modules/mob/mob_grab.dm index e207b005d8..371a7a0f30 100644 --- a/code/modules/mob/mob_grab.dm +++ b/code/modules/mob/mob_grab.dm @@ -179,7 +179,10 @@ assailant.visible_message(span_warning("[assailant] sits on [target]'s face!")) //VOREStation Edit End -/obj/item/grab/attack_self() +/obj/item/grab/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE return s_click(hud) diff --git a/code/modules/modular_computers/computers/modular_computer/interaction.dm b/code/modules/modular_computers/computers/modular_computer/interaction.dm index 7e85152e95..0533bca66d 100644 --- a/code/modules/modular_computers/computers/modular_computer/interaction.dm +++ b/code/modules/modular_computers/computers/modular_computer/interaction.dm @@ -114,7 +114,10 @@ return ..() // On-click handling. Turns on the computer if it's off and opens the GUI. -/obj/item/modular_computer/attack_self(var/mob/user) +/obj/item/modular_computer/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE if(enabled && screen_on) if(isliving(user) && HAS_TRAIT(user, TRAIT_UNLUCKY) && prob(5)) var/mob/living/unlucky_soul = user diff --git a/code/modules/multiz/hoist.dm b/code/modules/multiz/hoist.dm index 2151b9e9a7..eca5f3820f 100644 --- a/code/modules/multiz/hoist.dm +++ b/code/modules/multiz/hoist.dm @@ -11,6 +11,9 @@ icon_state = "hoist_case" /obj/item/hoist_kit/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE new /obj/structure/hoist (get_turf(user), user.dir) user.visible_message(span_warning("[user] deploys the hoist kit!"), span_notice("You deploy the hoist kit!"), span_notice("You hear the sound of parts snapping into place.")) qdel(src) diff --git a/code/modules/news/new_newspaper.dm b/code/modules/news/new_newspaper.dm index 6cda84a3c8..83f5ecbb87 100644 --- a/code/modules/news/new_newspaper.dm +++ b/code/modules/news/new_newspaper.dm @@ -19,7 +19,10 @@ drop_sound = 'sound/items/drop/wrapper.ogg' pickup_sound = 'sound/items/pickup/wrapper.ogg' -obj/item/newspaper/attack_self(mob/user) +/obj/item/newspaper/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE if(ishuman(user)) var/mob/living/carbon/human/human_user = user var/dat diff --git a/code/modules/news/newspaper.dm b/code/modules/news/newspaper.dm index 65afe4952c..13b1130e15 100644 --- a/code/modules/news/newspaper.dm +++ b/code/modules/news/newspaper.dm @@ -19,7 +19,10 @@ drop_sound = 'sound/items/drop/wrapper.ogg' pickup_sound = 'sound/items/pickup/wrapper.ogg' -/obj/item/newspaper/attack_self(mob/user as mob) +/obj/item/newspaper/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE if(ishuman(user)) var/mob/living/carbon/human/human_user = user var/dat diff --git a/code/modules/nifsoft/nifsoft.dm b/code/modules/nifsoft/nifsoft.dm index e7280e2154..38d06497c2 100644 --- a/code/modules/nifsoft/nifsoft.dm +++ b/code/modules/nifsoft/nifsoft.dm @@ -267,6 +267,9 @@ ..(A,user,flag,params) /obj/item/disk/nifsoft/compliance/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE var/newlaws = tgui_input_text(user, "Please Input Laws", "Compliance Laws", laws, 2048, TRUE, prevent_enter = TRUE) if(newlaws) to_chat(user,span_filter_notice("You set the laws to:
" + span_notice("[newlaws]"))) diff --git a/code/modules/organs/organ.dm b/code/modules/organs/organ.dm index 78c15ca5cc..cdbb6cdda0 100644 --- a/code/modules/organs/organ.dm +++ b/code/modules/organs/organ.dm @@ -47,6 +47,9 @@ var/list/organ_cache = list() var/meat_type // What does butchering, if possible, make? var/list/medical_issues = list() + ///Var for attack_self chain + var/special_handling = FALSE + /obj/item/organ/Destroy() handle_organ_mod_special(TRUE) @@ -482,7 +485,13 @@ var/list/organ_cache = list() user.put_in_active_hand(O) qdel(src) -/obj/item/organ/attack_self(mob/user as mob) +/obj/item/organ/attack_self(mob/user, callback) + . = ..(user) + if(.) + return TRUE + + if(special_handling && !callback) + return FALSE // Convert it to an edible form, yum yum. if(!(robotic >= ORGAN_ROBOT) && user.a_intent == I_HELP && user.zone_sel.selecting == O_MOUTH) diff --git a/code/modules/organs/organ_external.dm b/code/modules/organs/organ_external.dm index b270005687..3c4b548210 100644 --- a/code/modules/organs/organ_external.dm +++ b/code/modules/organs/organ_external.dm @@ -86,6 +86,8 @@ // HUD element variable, see organ_icon.dm get_damage_hud_image() var/image/hud_damage_image + special_handling = TRUE + /obj/item/organ/external/Destroy() if(parent && parent.children) @@ -147,9 +149,12 @@ if(burn_damage) take_damage(0, burn_damage) -/obj/item/organ/external/attack_self(var/mob/living/user) +/obj/item/organ/external/attack_self(mob/living/user) + . = ..(user) + if(.) + return TRUE if(!contents.len) - return ..() + return ..(user, TRUE) var/list/removable_objects = list() for(var/obj/item/organ/external/E in (contents + src)) if(!istype(E)) @@ -165,7 +170,7 @@ user.put_in_hands(I) user.visible_message(span_danger("\The [user] rips \the [I] out of \the [src]!")) return //no eating the limb until everything's been removed - return ..() + return ..(user, TRUE) /obj/item/organ/external/examine(mob/user) . = ..() diff --git a/code/modules/paperwork/clipboard.dm b/code/modules/paperwork/clipboard.dm index 9c45771b1b..ac83f1a9c9 100644 --- a/code/modules/paperwork/clipboard.dm +++ b/code/modules/paperwork/clipboard.dm @@ -68,6 +68,9 @@ to_chat(user, span_notice("You clip the [P] onto \the [src].")) /obj/item/clipboard/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE var/dat = "Clipboard" if(haspen) dat += "Remove Pen

" diff --git a/code/modules/paperwork/folders.dm b/code/modules/paperwork/folders.dm index 4a2dc7a00b..bb1a21eed9 100644 --- a/code/modules/paperwork/folders.dm +++ b/code/modules/paperwork/folders.dm @@ -82,7 +82,10 @@ update_icon() to_chat(user, span_notice("You tuck the [P] into \the [src].")) -/obj/item/folder/attack_self(mob/user as mob) +/obj/item/folder/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE var/dat = "[name]" for(var/obj/item/paper/P in src) diff --git a/code/modules/paperwork/handlabeler.dm b/code/modules/paperwork/handlabeler.dm index 8b1fabe8a6..223e44802a 100644 --- a/code/modules/paperwork/handlabeler.dm +++ b/code/modules/paperwork/handlabeler.dm @@ -67,7 +67,10 @@ span_notice("You label [A] as [label].")) A.name = "[A.name] ([label])" -/obj/item/hand_labeler/attack_self(mob/user as mob) +/obj/item/hand_labeler/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE mode = !mode icon_state = "labeler[mode]" if(mode) diff --git a/code/modules/paperwork/paper.dm b/code/modules/paperwork/paper.dm index 48ec709409..ed53156bfb 100644 --- a/code/modules/paperwork/paper.dm +++ b/code/modules/paperwork/paper.dm @@ -36,6 +36,9 @@ var/age = 0 var/last_modified_ckey + ///Occult check. Used for do_after + var/occult = FALSE + var/was_maploaded = FALSE // This tracks if the paper was created on mapload. var/const/deffont = "Verdana" @@ -175,7 +178,12 @@ add_fingerprint(usr) return -/obj/item/paper/attack_self(mob/living/user as mob) +/obj/item/paper/attack_self(mob/living/user) + . = ..(user) + if(.) + return TRUE + if(occult) + return if(user.a_intent == I_HURT) if(icon_state == "scrap") user.show_message(span_warning("\The [src] is already crumpled.")) diff --git a/code/modules/paperwork/paper_bundle.dm b/code/modules/paperwork/paper_bundle.dm index fb03276828..0492fdeb57 100644 --- a/code/modules/paperwork/paper_bundle.dm +++ b/code/modules/paperwork/paper_bundle.dm @@ -139,6 +139,9 @@ + "", "window=[name]") /obj/item/paper_bundle/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE src.show_content(user) add_fingerprint(user) update_icon() diff --git a/code/modules/paperwork/paperplane.dm b/code/modules/paperwork/paperplane.dm index e7acf13213..7b0e6cd866 100644 --- a/code/modules/paperwork/paperplane.dm +++ b/code/modules/paperwork/paperplane.dm @@ -45,6 +45,9 @@ add_overlay(stampoverlay) /obj/item/paperplane/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE to_chat(user, span_notice("You unfold [src].")) var/atom/movable/internal_paper_tmp = internalPaper internal_paper_tmp.forceMove(loc) diff --git a/code/modules/paperwork/pen.dm b/code/modules/paperwork/pen.dm index a7cb852569..ce64d5973b 100644 --- a/code/modules/paperwork/pen.dm +++ b/code/modules/paperwork/pen.dm @@ -31,10 +31,21 @@ pressure_resistance = 2 drop_sound = 'sound/items/drop/accessory.ogg' pickup_sound = 'sound/items/pickup/accessory.ogg' + var/can_click = TRUE -/obj/item/pen/attack_self(var/mob/user) + ///Var for attack_self chain + var/special_handling = FALSE + +/obj/item/pen/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE + if(special_handling) + return FALSE if(!user.checkClickCooldown()) return + if(!can_click) + return user.setClickCooldown(1 SECOND) to_chat(user, span_notice("Click.")) playsound(src, 'sound/items/penclick.ogg', 50, 1) @@ -99,6 +110,7 @@ desc = "It's a pen with multiple colors of ink!" var/selectedColor = 1 var/colors = list("black","blue","red") + special_handling = TRUE /obj/item/pen/click_alt(mob/user) if(!Adjacent(user)) @@ -107,6 +119,9 @@ playsound(src, 'sound/items/penclick.ogg', 50, 1) /obj/item/pen/multi/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE if(++selectedColor > 3) selectedColor = 1 @@ -270,8 +285,12 @@ */ /obj/item/pen/chameleon var/signature = "" + special_handling = TRUE /obj/item/pen/chameleon/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE /* // Limit signatures to official crew members var/personnel_list[] = list() @@ -338,6 +357,8 @@ var/colourName = "red" //for updateIcon purposes drop_sound = 'sound/items/drop/gloves.ogg' pickup_sound = 'sound/items/pickup/gloves.ogg' + can_click = FALSE + special_handling = TRUE /obj/item/pen/crayon/Initialize(mapload) . = ..() diff --git a/code/modules/paperwork/photography.dm b/code/modules/paperwork/photography.dm index 6aea67c920..e72dab954d 100644 --- a/code/modules/paperwork/photography.dm +++ b/code/modules/paperwork/photography.dm @@ -41,7 +41,10 @@ GLOBAL_VAR_INIT(photo_count, 0) . = ..() id = GLOB.photo_count++ -/obj/item/photo/attack_self(mob/user as mob) +/obj/item/photo/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE user.examinate(src) /obj/item/photo/attackby(obj/item/P as obj, mob/user as mob) @@ -148,7 +151,10 @@ GLOBAL_VAR_INIT(photo_count, 0) /obj/item/camera/attack(mob/living/carbon/human/M as mob, mob/user as mob) return -/obj/item/camera/attack_self(mob/user as mob) +/obj/item/camera/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE on = !on if(on) src.icon_state = icon_on diff --git a/code/modules/paperwork/stamps.dm b/code/modules/paperwork/stamps.dm index 41553529ab..0dc479d65c 100644 --- a/code/modules/paperwork/stamps.dm +++ b/code/modules/paperwork/stamps.dm @@ -102,7 +102,10 @@ icon_state = "stamp-zenghu" // Syndicate stamp to forge documents. -/obj/item/stamp/chameleon/attack_self(mob/user as mob) +/obj/item/stamp/chameleon/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE var/list/stamp_types = typesof(/obj/item/stamp) - src.type // Get all stamp types except our own var/list/stamps = list() diff --git a/code/modules/pda/ai.dm b/code/modules/pda/ai.dm index 87addbd517..f1e703ffde 100644 --- a/code/modules/pda/ai.dm +++ b/code/modules/pda/ai.dm @@ -3,13 +3,14 @@ /obj/item/pda/ai icon_state = "NONE" ttone = "data" - detonate = 0 + detonate = FALSE touch_silent = TRUE programs = list( new/datum/data/pda/app/main_menu, new/datum/data/pda/app/notekeeper, new/datum/data/pda/app/news, new/datum/data/pda/app/messenger) + special_handling = TRUE /obj/item/pda/ai/proc/set_name_and_job(newname as text, newjob as text, newrank as null|text) owner = newname @@ -33,7 +34,10 @@ /obj/item/pda/ai/can_use() return 1 -/obj/item/pda/ai/attack_self(mob/user as mob) +/obj/item/pda/ai/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE if ((honkamt > 0) && (prob(60)))//For clown virus. honkamt-- playsound(src, 'sound/items/bikehorn.ogg', 30, 1) diff --git a/code/modules/pda/cart_vr.dm b/code/modules/pda/cart_vr.dm index fd42bde4a1..6c39989d20 100644 --- a/code/modules/pda/cart_vr.dm +++ b/code/modules/pda/cart_vr.dm @@ -45,6 +45,9 @@ ..(over_object) /obj/item/cartridge/storage/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE to_chat(user, span_notice("You empty [src].")) var/turf/T = get_turf(src) hold.hide_from(user) diff --git a/code/modules/pda/pda.dm b/code/modules/pda/pda.dm index b894856200..1aae978d2f 100644 --- a/code/modules/pda/pda.dm +++ b/code/modules/pda/pda.dm @@ -54,6 +54,9 @@ var/list/notifying_programs = list() var/retro_mode = 0 + ///Var for attack_self chain + var/special_handling = FALSE + /obj/item/pda/examine(mob/user) . = ..() if(Adjacent(user)) @@ -183,7 +186,12 @@ /obj/item/pda/proc/close(mob/user) SStgui.close_uis(src) -/obj/item/pda/attack_self(mob/user as mob) +/obj/item/pda/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE + if(special_handling) + return FALSE if(active_uplink_check(user)) return diff --git a/code/modules/power/cells/device_cells.dm b/code/modules/power/cells/device_cells.dm index aa4683a4e5..07d8f2bb71 100644 --- a/code/modules/power/cells/device_cells.dm +++ b/code/modules/power/cells/device_cells.dm @@ -149,7 +149,10 @@ /obj/item/cell/device/weapon/recharge/alien/update_icon() return // No overlays please. -/obj/item/cell/device/weapon/recharge/alien/attack_self(var/mob/user) +/obj/item/cell/device/weapon/recharge/alien/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE if(!swaps_to) return user.remove_from_mob(src) diff --git a/code/modules/power/cells/power_cells.dm b/code/modules/power/cells/power_cells.dm index a33bbf62a9..18c704d9c9 100644 --- a/code/modules/power/cells/power_cells.dm +++ b/code/modules/power/cells/power_cells.dm @@ -268,7 +268,10 @@ var/swaps_to = /obj/item/cell/device/weapon/recharge/alien robot_durability = 100 -/obj/item/cell/void/attack_self(var/mob/user) +/obj/item/cell/void/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE user.remove_from_mob(src) to_chat(user, span_notice("You swap [src] to 'device cell' mode.")) var/obj/item/cell/newcell = new swaps_to(null) diff --git a/code/modules/projectiles/ammunition.dm b/code/modules/projectiles/ammunition.dm index 3439342c74..ef1548ebb4 100644 --- a/code/modules/projectiles/ammunition.dm +++ b/code/modules/projectiles/ammunition.dm @@ -173,6 +173,9 @@ // This dumps all the bullets right on the floor /obj/item/ammo_magazine/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE if(can_remove_ammo) if(!stored_ammo.len) to_chat(user, span_notice("[src] is already empty!")) diff --git a/code/modules/projectiles/gun.dm b/code/modules/projectiles/gun.dm index ef37ec9f4a..f31fe0f281 100644 --- a/code/modules/projectiles/gun.dm +++ b/code/modules/projectiles/gun.dm @@ -97,7 +97,6 @@ var/recoil_mode = 0 //If the gun will hurt micros if shot or not. Disabled on Virgo, used downstream. var/mounted_gun = 0 //If the gun is mounted within a rigsuit or elsewhere. This makes it so the gun can be shot even if it's loc != a mob -//VOREStation Add - /tg/ icon system var/charge_sections = 4 var/shaded_charge = FALSE var/ammo_x_offset = 2 @@ -109,6 +108,9 @@ var/flight_x_offset = 0 var/flight_y_offset = 0 + ///Var for attack_self chain + var/special_handling = FALSE + /obj/item/gun/item_ctrl_click(mob/user) if(can_flashlight && ishuman(user) && loc == user && !user.incapacitated(INCAPACITATION_ALL)) toggle_flashlight() @@ -785,6 +787,11 @@ return new_mode /obj/item/gun/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE + if(special_handling) + return FALSE switch_firemodes(user) /* TGMC Ammo HUD Port Begin */ diff --git a/code/modules/projectiles/guns/energy/bsharpoon_vr.dm b/code/modules/projectiles/guns/energy/bsharpoon_vr.dm index db2f4c1a52..7cad1fd3b3 100644 --- a/code/modules/projectiles/guns/energy/bsharpoon_vr.dm +++ b/code/modules/projectiles/guns/energy/bsharpoon_vr.dm @@ -200,10 +200,13 @@ to_chat(M, span_vnotice("You materialize around [living_user] as they end up in your [belly_dest]!")) -/obj/item/bluespace_harpoon/attack_self(mob/living/user as mob) - return chande_fire_mode(user) +/obj/item/bluespace_harpoon/attack_self(mob/living/user) + . = ..(user) + if(.) + return TRUE + return change_fire_mode(user) -/obj/item/bluespace_harpoon/verb/chande_fire_mode(mob/user as mob) +/obj/item/bluespace_harpoon/verb/change_fire_mode(mob/user) set name = "Change Fire Mode" set category = "Object" set src in range(0) diff --git a/code/modules/projectiles/guns/energy/cell_loaded_vr/cell_loaded.dm b/code/modules/projectiles/guns/energy/cell_loaded_vr/cell_loaded.dm index 8a8235da27..62b3ae8de0 100644 --- a/code/modules/projectiles/guns/energy/cell_loaded_vr/cell_loaded.dm +++ b/code/modules/projectiles/guns/energy/cell_loaded_vr/cell_loaded.dm @@ -26,6 +26,9 @@ var/max_charge = 0 charge_sections = 5 + special_handling = TRUE + special_weapon_handling = TRUE + /obj/item/gun/projectile/cell_loaded/consume_next_projectile() if(chambered && ammo_magazine) var/obj/item/ammo_casing/microbattery/batt = chambered @@ -69,6 +72,9 @@ M?.hud_used.update_ammo_hud(M, src) /obj/item/gun/projectile/cell_loaded/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE if(!chambered) return diff --git a/code/modules/projectiles/guns/energy/cyborg.dm b/code/modules/projectiles/guns/energy/cyborg.dm index 8307fa1362..66a1784253 100644 --- a/code/modules/projectiles/guns/energy/cyborg.dm +++ b/code/modules/projectiles/guns/energy/cyborg.dm @@ -174,6 +174,9 @@ attack_verb = list("nibbled", "bit", "gnawed", "chomped", "nommed") var/emagged = 0 /obj/item/melee/robotic/jaws/small/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE var/mob/living/silicon/robot/R = user if(R.emagged || R.emag_items) emagged = !emagged @@ -301,6 +304,9 @@ var/lcolor = "#38e541" /obj/item/melee/robotic/blade/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE if(active) //turning off playsound(src, 'sound/weapons/saberoff.ogg', 50, 1) force = 0 @@ -440,6 +446,9 @@ return /obj/item/melee/robotic/baton/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE status = !status to_chat(user, span_notice("[src] is now [status ? "on" : "off"].")) playsound(src, "sparks", 75, 1, -1) diff --git a/code/modules/projectiles/guns/energy/gunsword_vr.dm b/code/modules/projectiles/guns/energy/gunsword_vr.dm index c4f8cfca97..371c46fd5a 100644 --- a/code/modules/projectiles/guns/energy/gunsword_vr.dm +++ b/code/modules/projectiles/guns/energy/gunsword_vr.dm @@ -95,7 +95,10 @@ attack_verb = null -/obj/item/cell/device/weapon/gunsword/attack_self(mob/living/user as mob) +/obj/item/cell/device/weapon/gunsword/attack_self(mob/living/user) + . = ..(user) + if(.) + return TRUE if (active) if ((CLUMSY in user.mutations) && prob(50)) user.visible_message(span_danger("\The [user] accidentally cuts [user.p_themselves()] with \the [src]."),\ diff --git a/code/modules/projectiles/guns/energy/kinetic_accelerator_vr.dm b/code/modules/projectiles/guns/energy/kinetic_accelerator_vr.dm index 22f51906cd..9d13de1813 100644 --- a/code/modules/projectiles/guns/energy/kinetic_accelerator_vr.dm +++ b/code/modules/projectiles/guns/energy/kinetic_accelerator_vr.dm @@ -733,6 +733,9 @@ desc = "Causes kinetic accelerator bolts to have an adjustable-colored tracer trail and explosion. Use in-hand to change color." /obj/item/borg/upgrade/modkit/tracer/adjustable/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE bolt_color = tgui_color_picker(user,"","Choose Color",bolt_color) #undef KA_ENVIRO_TYPE_COLD diff --git a/code/modules/projectiles/guns/energy/pulse.dm b/code/modules/projectiles/guns/energy/pulse.dm index b9239da43f..42bd6a3fab 100644 --- a/code/modules/projectiles/guns/energy/pulse.dm +++ b/code/modules/projectiles/guns/energy/pulse.dm @@ -34,8 +34,12 @@ projectile_type=/obj/item/projectile/beam/pulse charge_cost = 120 fire_delay = 12 + special_handling = TRUE -/obj/item/gun/energy/pulse_rifle/destroyer/attack_self(mob/living/user as mob) +/obj/item/gun/energy/pulse_rifle/destroyer/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE to_chat(user, span_warning("[src.name] has three settings, and they are all DESTROY.")) /* diff --git a/code/modules/projectiles/guns/launcher/bows.dm b/code/modules/projectiles/guns/launcher/bows.dm index 4450354796..a4e1515962 100644 --- a/code/modules/projectiles/guns/launcher/bows.dm +++ b/code/modules/projectiles/guns/launcher/bows.dm @@ -46,6 +46,10 @@ release_force = 20 release_speed = 15 var/drawn = FALSE + is_bow = TRUE + + ///Var for attack_self chain + var/hardlight = FALSE /obj/item/gun/launcher/crossbow/bow/update_release_force(obj/item/projectile) return 0 @@ -78,6 +82,11 @@ return ..() /obj/item/gun/launcher/crossbow/bow/attack_self(mob/living/user) + . = ..(user) + if(.) + return TRUE + if(hardlight) + return FALSE if(drawn) user.visible_message(span_infoplain(span_bold("[user]") + " relaxes the tension on [src]'s string."),span_infoplain("You relax the tension on [src]'s string.")) drawn = FALSE @@ -127,7 +136,10 @@ QDEL_NULL(bolt) update_icon() -/obj/item/gun/launcher/crossbow/bow/hardlight/attack_self(mob/living/user) +/obj/item/gun/launcher/crossbow/bow/hardlight/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE if(drawn) user.visible_message(span_infoplain(span_bold("[user]") + " relaxes the tension on [src]'s string."),span_infoplain("You relax the tension on [src]'s string.")) drawn = FALSE diff --git a/code/modules/projectiles/guns/launcher/confetti.dm b/code/modules/projectiles/guns/launcher/confetti.dm index 55cffa4c3e..25d7c20ec2 100644 --- a/code/modules/projectiles/guns/launcher/confetti.dm +++ b/code/modules/projectiles/guns/launcher/confetti.dm @@ -13,6 +13,7 @@ var/confetti_charge = 0 var/max_confetti = 20 + special_handling = TRUE /obj/item/gun/launcher/confetti_cannon/examine(mob/user) . = ..() @@ -42,6 +43,9 @@ to_chat(user, span_red("The [src] is already loaded!")) /obj/item/gun/launcher/confetti_cannon/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE pump(user) /obj/item/gun/launcher/confetti_cannon/consume_next_projectile() diff --git a/code/modules/projectiles/guns/launcher/crossbow.dm b/code/modules/projectiles/guns/launcher/crossbow.dm index 72a20789c1..45e74ffe40 100644 --- a/code/modules/projectiles/guns/launcher/crossbow.dm +++ b/code/modules/projectiles/guns/launcher/crossbow.dm @@ -67,6 +67,10 @@ var/obj/item/cell/cell = null // Used for firing superheated rods. var/current_user // Used to check if the crossbow has changed hands since being drawn. + ///Var for attack_self chain + var/is_bow = FALSE + special_handling = TRUE + /obj/item/gun/launcher/crossbow/update_release_force() release_force = tension*release_speed @@ -82,7 +86,12 @@ update_icon() ..() -/obj/item/gun/launcher/crossbow/attack_self(mob/living/user as mob) +/obj/item/gun/launcher/crossbow/attack_self(mob/living/user) + . = ..(user) + if(.) + return TRUE + if(is_bow) + return TRUE if(tension) if(bolt) user.visible_message("[user] relaxes the tension on [src]'s string and removes [bolt].","You relax the tension on [src]'s string and remove [bolt].") diff --git a/code/modules/projectiles/guns/launcher/grenade_launcher.dm b/code/modules/projectiles/guns/launcher/grenade_launcher.dm index 29440101fe..34fa42cd2f 100644 --- a/code/modules/projectiles/guns/launcher/grenade_launcher.dm +++ b/code/modules/projectiles/guns/launcher/grenade_launcher.dm @@ -16,6 +16,8 @@ var/list/grenades = new/list() var/max_grenades = 5 //holds this + one in the chamber matter = list(MAT_STEEL = 2000) + special_handling = TRUE + var/underslung = FALSE //revolves the magazine, allowing players to choose between multiple grenade types /obj/item/gun/launcher/grenade/proc/pump(mob/user) @@ -66,6 +68,11 @@ to_chat(user, span_warning("[src] is empty.")) /obj/item/gun/launcher/grenade/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE + if(underslung) + return FALSE pump(user) /obj/item/gun/launcher/grenade/attackby(obj/item/I, mob/user) @@ -98,9 +105,7 @@ w_class = ITEMSIZE_NORMAL force = 5 max_grenades = 0 - -/obj/item/gun/launcher/grenade/underslung/attack_self() - return + underslung = TRUE //load and unload directly into chambered /obj/item/gun/launcher/grenade/underslung/load(obj/item/grenade/G, mob/user) diff --git a/code/modules/projectiles/guns/launcher/pneumatic.dm b/code/modules/projectiles/guns/launcher/pneumatic.dm index 722d673783..d216782b66 100644 --- a/code/modules/projectiles/guns/launcher/pneumatic.dm +++ b/code/modules/projectiles/guns/launcher/pneumatic.dm @@ -20,6 +20,8 @@ var/force_divisor = 400 // Force equates to speed. Speed/5 equates to a damage multiplier for whoever you hit. // For reference, a fully pressurized oxy tank at 50% gas release firing a health // analyzer with a force_divisor of 10 hit with a damage multiplier of 3000+. + special_handling = TRUE + /obj/item/gun/launcher/pneumatic/Initialize(mapload) . = ..() item_storage = new(src) @@ -72,7 +74,10 @@ else if(istype(W) && item_storage.can_be_inserted(W)) item_storage.handle_item_insertion(W) -/obj/item/gun/launcher/pneumatic/attack_self(mob/user as mob) +/obj/item/gun/launcher/pneumatic/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE eject_tank(user) /obj/item/gun/launcher/pneumatic/consume_next_projectile(mob/user=null) diff --git a/code/modules/projectiles/guns/launcher/syringe_gun.dm b/code/modules/projectiles/guns/launcher/syringe_gun.dm index 3b11c41e3d..a4acc83582 100644 --- a/code/modules/projectiles/guns/launcher/syringe_gun.dm +++ b/code/modules/projectiles/guns/launcher/syringe_gun.dm @@ -28,6 +28,9 @@ update_icon() /obj/item/syringe_cartridge/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE if(syringe) to_chat(user, span_notice("You remove [syringe] from [src].")) playsound(src, 'sound/weapons/empty.ogg', 50, 1) @@ -81,6 +84,8 @@ var/max_darts = 1 var/obj/item/syringe_cartridge/next + special_handling = TRUE + /obj/item/gun/launcher/syringe/consume_next_projectile() if(next) next.prime() @@ -92,7 +97,10 @@ darts -= next next = null -/obj/item/gun/launcher/syringe/attack_self(mob/living/user as mob) +/obj/item/gun/launcher/syringe/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE if(next) user.visible_message("[user] unlatches and carefully relaxes the bolt on [src].", span_warning("You unlatch and carefully relax the bolt on [src], unloading the spring.")) next = null diff --git a/code/modules/projectiles/guns/projectile.dm b/code/modules/projectiles/guns/projectile.dm index fbed5c0315..02b8b1080d 100644 --- a/code/modules/projectiles/guns/projectile.dm +++ b/code/modules/projectiles/guns/projectile.dm @@ -33,6 +33,11 @@ var/random_start_ammo = FALSE //randomize amount of starting ammo + special_handling = TRUE + + ///Var for attack_self chain + var/special_weapon_handling = FALSE + /obj/item/gun/projectile/Initialize(mapload, var/starts_loaded = 1) . = ..() if(starts_loaded) @@ -227,7 +232,12 @@ ..() load_ammo(A, user) -/obj/item/gun/projectile/attack_self(mob/user as mob) +/obj/item/gun/projectile/attack_self(mob/user, callback) + . = ..(user) + if(.) + return TRUE + if(special_weapon_handling && !callback) + return FALSE if(firemodes.len > 1) switch_firemodes(user) else diff --git a/code/modules/projectiles/guns/projectile/automatic.dm b/code/modules/projectiles/guns/projectile/automatic.dm index 1cb96abfb6..f857845b57 100644 --- a/code/modules/projectiles/guns/projectile/automatic.dm +++ b/code/modules/projectiles/guns/projectile/automatic.dm @@ -289,6 +289,8 @@ list(mode_name="short bursts", burst=5, move_delay=6, burst_accuracy = list(0,-15,-15,-30,-30), dispersion = list(0.6, 1.0, 1.0, 1.0, 1.2)) ) + special_weapon_handling = TRUE + /obj/item/gun/projectile/automatic/l6_saw/special_check(mob/user) if(cover_open) to_chat(user, span_warning("[src]'s cover is open! Close it before firing!")) @@ -301,11 +303,14 @@ update_icon() update_held_icon() -/obj/item/gun/projectile/automatic/l6_saw/attack_self(mob/user as mob) +/obj/item/gun/projectile/automatic/l6_saw/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE if(cover_open) toggle_cover(user) //close the cover else - return ..() //once closed, behave like normal + return ..(user, TRUE) //once closed, behave like normal /obj/item/gun/projectile/automatic/l6_saw/attack_hand(mob/user as mob) if(!cover_open && user.get_inactive_hand() == src) diff --git a/code/modules/projectiles/guns/projectile/contender.dm b/code/modules/projectiles/guns/projectile/contender.dm index 541330d87c..946d3b67e8 100644 --- a/code/modules/projectiles/guns/projectile/contender.dm +++ b/code/modules/projectiles/guns/projectile/contender.dm @@ -21,8 +21,12 @@ projectile_type = /obj/item/projectile/bullet/pistol/strong var/retracted_bolt = 0 load_method = SINGLE_CASING + special_handling = TRUE -/obj/item/gun/projectile/contender/attack_self(mob/user as mob) +/obj/item/gun/projectile/contender/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE if(chambered) chambered.loc = get_turf(src) chambered = null diff --git a/code/modules/projectiles/guns/projectile/dartgun.dm b/code/modules/projectiles/guns/projectile/dartgun.dm index e9833d4fe7..bdad9ef996 100644 --- a/code/modules/projectiles/guns/projectile/dartgun.dm +++ b/code/modules/projectiles/guns/projectile/dartgun.dm @@ -69,6 +69,7 @@ var/dart_reagent_amount = 15 var/container_type = /obj/item/reagent_containers/glass/beaker var/list/starting_chems = null + special_weapon_handling = TRUE /obj/item/gun/projectile/dartgun/Initialize(mapload) . = ..() @@ -134,6 +135,9 @@ B.reagents.trans_to_obj(dart, mix_amount) /obj/item/gun/projectile/dartgun/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE user.set_machine(src) var/dat = span_bold("[src] mixing control:") + "

" diff --git a/code/modules/projectiles/guns/projectile/shotgun.dm b/code/modules/projectiles/guns/projectile/shotgun.dm index 9820f340c5..85a5972854 100644 --- a/code/modules/projectiles/guns/projectile/shotgun.dm +++ b/code/modules/projectiles/guns/projectile/shotgun.dm @@ -24,13 +24,18 @@ var/empty_sprite = 0 //This is just a dirty var so it doesn't fudge up. var/pump_animation = "shotgun-pump" //You put the reference to the animation in question here. Frees up namming. Ex: "shotgun_old_pump" or "sniper_cycle" + special_weapon_handling = TRUE + /obj/item/gun/projectile/shotgun/pump/consume_next_projectile() if(chambered) return chambered.BB return null -/obj/item/gun/projectile/shotgun/pump/attack_self(mob/living/user as mob) - if(world.time >= recentpump + 10) +/obj/item/gun/projectile/shotgun/pump/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE + if(world.time >= recentpump + 1 SECOND) pump(user) recentpump = world.time diff --git a/code/modules/projectiles/guns/projectile/sniper.dm b/code/modules/projectiles/guns/projectile/sniper.dm index 44d01c0fbd..eac6cfb3dc 100644 --- a/code/modules/projectiles/guns/projectile/sniper.dm +++ b/code/modules/projectiles/guns/projectile/sniper.dm @@ -22,6 +22,7 @@ scoped_accuracy = 75 one_handed_penalty = 90 var/bolt_open = 0 + special_weapon_handling = TRUE /obj/item/gun/projectile/heavysniper/update_icon() if(bolt_open) @@ -29,7 +30,10 @@ else icon_state = "heavysniper" -/obj/item/gun/projectile/heavysniper/attack_self(mob/user as mob) +/obj/item/gun/projectile/heavysniper/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE playsound(src, 'sound/weapons/flipblade.ogg', 50, 1) bolt_open = !bolt_open if(bolt_open) diff --git a/code/modules/projectiles/guns/projectile/sniper/collapsible_sniper.dm b/code/modules/projectiles/guns/projectile/sniper/collapsible_sniper.dm index 698fb1e1b0..3165b127f0 100644 --- a/code/modules/projectiles/guns/projectile/sniper/collapsible_sniper.dm +++ b/code/modules/projectiles/guns/projectile/sniper/collapsible_sniper.dm @@ -70,6 +70,9 @@ trigger_group = src /obj/item/sniper_rifle_part/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE if(part_count == 1) to_chat(user, span_warning("You can't disassemble this further!")) return diff --git a/code/modules/projectiles/guns/toy.dm b/code/modules/projectiles/guns/toy.dm index e5259ea491..c481d18c9d 100644 --- a/code/modules/projectiles/guns/toy.dm +++ b/code/modules/projectiles/guns/toy.dm @@ -228,8 +228,12 @@ projectile_type = /obj/item/projectile/bullet/foam_dart recoil = null handle_casings = null + special_weapon_handling = TRUE -/obj/item/gun/projectile/cyborgtoy/attack_self(var/mob/user) +/obj/item/gun/projectile/cyborgtoy/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE cleanup = !cleanup to_chat(user, "The [src] is now on [cleanup ? "cleanup" : "battle"] mode.") diff --git a/code/modules/reagents/machinery/dispenser/cartridge.dm b/code/modules/reagents/machinery/dispenser/cartridge.dm index d9e30df8e4..cd5d587c92 100644 --- a/code/modules/reagents/machinery/dispenser/cartridge.dm +++ b/code/modules/reagents/machinery/dispenser/cartridge.dm @@ -53,8 +53,10 @@ name = initial(name) /obj/item/reagent_containers/chem_disp_cartridge/attack_self(mob/user) - ..() - if (is_open_container()) + . = ..(user) + if(.) + return TRUE + if(is_open_container()) to_chat(user, span_notice("You put the cap on \the [src].")) flags ^= OPENCONTAINER else diff --git a/code/modules/reagents/reagent_containers/_reagent_containers.dm b/code/modules/reagents/reagent_containers/_reagent_containers.dm index df217d4d59..688470624d 100644 --- a/code/modules/reagents/reagent_containers/_reagent_containers.dm +++ b/code/modules/reagents/reagent_containers/_reagent_containers.dm @@ -34,9 +34,6 @@ WARNING("[src]([src.type]) starts with more reagents than it has total volume") starts_with = null // it should gc, since it's just strings and numbers -/obj/item/reagent_containers/attack_self(mob/user as mob) - return - /obj/item/reagent_containers/afterattack(obj/target, mob/user, flag) return diff --git a/code/modules/reagents/reagent_containers/blood_pack_vr.dm b/code/modules/reagents/reagent_containers/blood_pack_vr.dm index b2c73a41b2..661ef06f09 100644 --- a/code/modules/reagents/reagent_containers/blood_pack_vr.dm +++ b/code/modules/reagents/reagent_containers/blood_pack_vr.dm @@ -1,4 +1,7 @@ -/obj/item/reagent_containers/blood/attack_self(mob/living/user as mob) +/obj/item/reagent_containers/blood/attack_self(mob/living/user) + . = ..(user) + if(.) + return TRUE if(user.a_intent == I_HURT) if(reagents.total_volume && volume) var/remove_volume = volume* 0.1 //10% of what the bloodpack can hold. diff --git a/code/modules/reagents/reagent_containers/borghypo.dm b/code/modules/reagents/reagent_containers/borghypo.dm index f87070cc9e..d6358448d0 100644 --- a/code/modules/reagents/reagent_containers/borghypo.dm +++ b/code/modules/reagents/reagent_containers/borghypo.dm @@ -181,7 +181,10 @@ balloon_alert(M, "you feel a tiny prick!") return -/obj/item/reagent_containers/borghypo/attack_self(mob/user as mob) //Change the mode +/obj/item/reagent_containers/borghypo/attack_self(mob/user) //Change the mode + . = ..(user) + if(.) + return TRUE tgui_interact(user) return diff --git a/code/modules/reagents/reagent_containers/glass.dm b/code/modules/reagents/reagent_containers/glass.dm index 99931f4298..66ca9494cd 100644 --- a/code/modules/reagents/reagent_containers/glass.dm +++ b/code/modules/reagents/reagent_containers/glass.dm @@ -52,6 +52,9 @@ /obj/machinery/computer/pandemic ) + ///Var for attack_self chain + var/special_handling = FALSE + /obj/item/reagent_containers/glass/Initialize(mapload) . = ..() if(LAZYLEN(prefill)) @@ -73,7 +76,11 @@ . += span_notice("Airtight lid seals it completely.") /obj/item/reagent_containers/glass/attack_self(mob/user) - ..() + . = ..(user) + if(.) + return TRUE + if(special_handling) + return FALSE if(is_open_container()) balloon_alert(user, "lid put on \the [src]") flags ^= OPENCONTAINER diff --git a/code/modules/reagents/reagent_containers/spray.dm b/code/modules/reagents/reagent_containers/spray.dm index ab81542091..214b114029 100644 --- a/code/modules/reagents/reagent_containers/spray.dm +++ b/code/modules/reagents/reagent_containers/spray.dm @@ -69,7 +69,7 @@ return /* -/obj/item/reagent_containers/spray/attack_self(var/mob/user) //Now done via alt-click instead +/obj/item/reagent_containers/spray/attack_self(mob/user) //Now done via alt-click instead if(!max_transfer_amount) return amount_per_transfer_from_this = next_in_list(amount_per_transfer_from_this, possible_transfer_amounts) @@ -137,7 +137,10 @@ if(Adjacent(user)) . += "The safety is [safety ? "on" : "off"]." -/obj/item/reagent_containers/spray/pepper/attack_self(var/mob/user) +/obj/item/reagent_containers/spray/pepper/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE safety = !safety balloon_alert(user, "safety [safety ? "on" : "off"].") diff --git a/code/modules/reagents/reagent_containers/syringes.dm b/code/modules/reagents/reagent_containers/syringes.dm index c7bd9c12a5..d96e88d718 100644 --- a/code/modules/reagents/reagent_containers/syringes.dm +++ b/code/modules/reagents/reagent_containers/syringes.dm @@ -63,7 +63,10 @@ ..() update_icon() -/obj/item/reagent_containers/syringe/attack_self(mob/user as mob) +/obj/item/reagent_containers/syringe/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE switch(mode) if(SYRINGE_CAPPED) mode = SYRINGE_DRAW diff --git a/code/modules/recycling/destination_tagger.dm b/code/modules/recycling/destination_tagger.dm index f0738ae174..3ccf1dd97b 100644 --- a/code/modules/recycling/destination_tagger.dm +++ b/code/modules/recycling/destination_tagger.dm @@ -40,7 +40,10 @@ return data -/obj/item/destTagger/attack_self(mob/user as mob) +/obj/item/destTagger/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE tgui_interact(user) /obj/item/destTagger/tgui_act(action, params, datum/tgui/ui) diff --git a/code/modules/recycling/disposal_mail.dm b/code/modules/recycling/disposal_mail.dm index 419477e17c..92d212e6aa 100644 --- a/code/modules/recycling/disposal_mail.dm +++ b/code/modules/recycling/disposal_mail.dm @@ -134,9 +134,12 @@ var/nameset = 0 var/tag_x -/obj/item/smallDelivery/attack_self(mob/user as mob) - if (src.wrapped) //sometimes items can disappear. For example, bombs. --rastaf0 - wrapped.loc = user.loc +/obj/item/smallDelivery/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE + if (wrapped) //sometimes items can disappear. For example, bombs. --rastaf0 + wrapped.forceMove(user.loc) if(ishuman(user)) user.put_in_hands(wrapped) else diff --git a/code/modules/research/anomaly/anomaly_core.dm b/code/modules/research/anomaly/anomaly_core.dm index 14214aa23b..85474342de 100644 --- a/code/modules/research/anomaly/anomaly_core.dm +++ b/code/modules/research/anomaly/anomaly_core.dm @@ -5,6 +5,7 @@ var/anomaly_type = /obj/effect/anomaly var/worth = 250 // Pricey... Should be hard-ish to obtain. + special_handling = TRUE /obj/item/assembly/signaler/anomaly/Initialize(mapload) . = ..() @@ -21,6 +22,9 @@ return TRUE /obj/item/assembly/signaler/anomaly/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE return /obj/item/assembly/signaler/anomaly/attackby(obj/item/W, mob/user, params) diff --git a/code/modules/resleeving/computers.dm b/code/modules/resleeving/computers.dm index 5c16d397b2..2aae982344 100644 --- a/code/modules/resleeving/computers.dm +++ b/code/modules/resleeving/computers.dm @@ -504,12 +504,15 @@ icon_state = "cmoemergency" item_state = "card-id" -/obj/item/cmo_disk_holder/attack_self(var/mob/attacker) +/obj/item/cmo_disk_holder/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE playsound(src, 'sound/items/poster_ripped.ogg', 50) - to_chat(attacker, span_warning("You tear open \the [name].")) - attacker.unEquip(src) + to_chat(user, span_warning("You tear open \the [name].")) + user.unEquip(src) var/obj/item/disk/transcore/newdisk = new(get_turf(src)) - attacker.put_in_any_hand_if_possible(newdisk) + user.put_in_any_hand_if_possible(newdisk) qdel(src) /obj/item/disk/transcore diff --git a/code/modules/resleeving/implant.dm b/code/modules/resleeving/implant.dm index 330d1cc732..b4cc11bd4a 100644 --- a/code/modules/resleeving/implant.dm +++ b/code/modules/resleeving/implant.dm @@ -78,7 +78,10 @@ icon_state = "[initial(icon_state)][imps.len]" germ_level = 0 -/obj/item/backup_implanter/attack_self(mob/user as mob) +/obj/item/backup_implanter/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE if(!istype(user)) return diff --git a/code/modules/resleeving/sleevecard.dm b/code/modules/resleeving/sleevecard.dm index 32ee751c93..3fa313ad6c 100644 --- a/code/modules/resleeving/sleevecard.dm +++ b/code/modules/resleeving/sleevecard.dm @@ -6,6 +6,7 @@ show_messages = 0 var/emagged = FALSE matter = list(MAT_STEEL = 4000, MAT_GLASS = 4000) + special_handling = TRUE /obj/item/paicard/sleevecard/attack_ghost(mob/user as mob) return @@ -66,6 +67,9 @@ return 0 /obj/item/paicard/sleevecard/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE add_fingerprint(user) if(!pai) @@ -73,7 +77,7 @@ else if(!emagged) to_chat(user,span_notice("\The [src] displays the name '[pai]'.")) - else ..() + else ..(user, TRUE) /mob/living/silicon/pai/infomorph name = "sleevecard" //Has the same name as the card for consistency, but this is the MOB in the card. diff --git a/code/modules/samples/samples.dm b/code/modules/samples/samples.dm index 7ceba17f5e..ee73722405 100644 --- a/code/modules/samples/samples.dm +++ b/code/modules/samples/samples.dm @@ -130,6 +130,9 @@ M.apply_damage(rand(min_damage,max_damage), BURN, null, used_weapon=src) /obj/item/research_sample/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE var/mob/living/M = user if(!istype(M)) return diff --git a/code/modules/shieldgen/directional_shield.dm b/code/modules/shieldgen/directional_shield.dm index da73c5aaa1..3b7350b956 100644 --- a/code/modules/shieldgen/directional_shield.dm +++ b/code/modules/shieldgen/directional_shield.dm @@ -98,6 +98,9 @@ var/high_color = "#0099FF" // Color the shield will be when at max health. A light blue. var/low_color = "#FF0000" // Color the shield will drift towards as health is lowered. Deep red. + ///Var for attack_self chain + var/special_handling = FALSE + /obj/item/shield_projector/Initialize(mapload) START_PROCESSING(SSobj, src) AddComponent(/datum/component/recursive_move) @@ -186,7 +189,12 @@ for(var/obj/effect/directional_shield/S in active_shields) S.update_color(new_color) -/obj/item/shield_projector/attack_self(var/mob/living/user) +/obj/item/shield_projector/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE + if(special_handling) + return FALSE if(active) if(always_on) to_chat(user, span_warning("You can't seem to deactivate \the [src].")) @@ -362,6 +370,7 @@ var/obj/mecha/my_mecha = null var/obj/item/mecha_parts/mecha_equipment/combat_shield/my_tool = null + special_handling = TRUE /obj/item/shield_projector/line/exosuit/process() ..() @@ -378,7 +387,10 @@ else my_tool.set_ready_state(TRUE) -/obj/item/shield_projector/line/exosuit/attack_self(var/mob/living/user) +/obj/item/shield_projector/line/exosuit/attack_self(mob/living/user) + . = ..(user) + if(.) + return TRUE if(active) if(always_on) to_chat(user, span_warning("You can't seem to deactivate \the [src].")) diff --git a/code/modules/shieldgen/handheld_defuser.dm b/code/modules/shieldgen/handheld_defuser.dm index d2e47e0823..3ad925f197 100644 --- a/code/modules/shieldgen/handheld_defuser.dm +++ b/code/modules/shieldgen/handheld_defuser.dm @@ -44,6 +44,9 @@ icon_state = "hdiffuser_off" /obj/item/shield_diffuser/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE enabled = !enabled update_icon() if(enabled) diff --git a/code/modules/shuttles/landmarks.dm b/code/modules/shuttles/landmarks.dm index 85c3d6aedf..ba2fcb5d3e 100644 --- a/code/modules/shuttles/landmarks.dm +++ b/code/modules/shuttles/landmarks.dm @@ -170,7 +170,10 @@ light_color = "#3728ff" var/active -/obj/item/spaceflare/attack_self(var/mob/user) +/obj/item/spaceflare/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE if(!active) visible_message(span_notice("[user] pulls the cord, activating the [src].")) activate() diff --git a/code/modules/spells/artifacts.dm b/code/modules/spells/artifacts.dm index 2cee6f6fbc..3631b2552e 100644 --- a/code/modules/spells/artifacts.dm +++ b/code/modules/spells/artifacts.dm @@ -12,7 +12,10 @@ force = 10 hitsound = 'sound/items/welder2.ogg' -/obj/item/scrying/attack_self(mob/user as mob) +/obj/item/scrying/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE if((user.mind && !wizards.is_antagonist(user.mind))) to_chat(user, span_warning("You stare into the orb and see nothing but your own reflection.")) return diff --git a/code/modules/spells/spellbook.dm b/code/modules/spells/spellbook.dm index 6401b1a00a..0405617733 100644 --- a/code/modules/spells/spellbook.dm +++ b/code/modules/spells/spellbook.dm @@ -11,7 +11,15 @@ var/max_uses = 5 var/op = 1 + ///Var for attack_self chain + var/special_handling = FALSE + /obj/item/spellbook/attack_self(mob/user = usr) + . = ..(user) + if(.) + return TRUE + if(special_handling) + return FALSE if(!user) return if((user.mind && !wizards.is_antagonist(user.mind))) @@ -250,12 +258,16 @@ uses = 1 max_uses = 1 desc = "This template spellbook was never meant for the eyes of man..." + special_handling = TRUE /obj/item/spellbook/oneuse/Initialize(mapload) . = ..() name += spellname -/obj/item/spellbook/oneuse/attack_self(mob/user as mob) +/obj/item/spellbook/oneuse/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE var/spell/S = new spell(user) for(var/spell/knownspell in user.spell_list) if(knownspell.type == S.type) diff --git a/code/modules/telesci/bscyrstal.dm b/code/modules/telesci/bscyrstal.dm index 3ffc9cc5fc..ffb2d1bb56 100644 --- a/code/modules/telesci/bscyrstal.dm +++ b/code/modules/telesci/bscyrstal.dm @@ -15,6 +15,9 @@ pixel_y = rand(-5, 5) /obj/item/bluespace_crystal/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE user.visible_message(span_warning("[user] crushes [src]!"), span_danger("You crush [src]!")) var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread() s.set_up(5, 1, get_turf(src)) diff --git a/code/modules/telesci/gps_advanced.dm b/code/modules/telesci/gps_advanced.dm index 9686f7a12d..4375102d5d 100644 --- a/code/modules/telesci/gps_advanced.dm +++ b/code/modules/telesci/gps_advanced.dm @@ -14,6 +14,8 @@ gps_tag = "COM0" emped = 0 + special_handling = TRUE + /obj/item/gps/advanced/Initialize(mapload) . = ..() add_overlay("working") @@ -27,7 +29,10 @@ cut_overlay("emp") add_overlay("working") -/obj/item/gps/advanced/attack_self(mob/user as mob) +/obj/item/gps/advanced/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE var/obj/item/gps/advanced/t = "" if(emped) diff --git a/code/modules/vore/eating/leave_remains_vr.dm b/code/modules/vore/eating/leave_remains_vr.dm index 89675a77ae..360db936c2 100644 --- a/code/modules/vore/eating/leave_remains_vr.dm +++ b/code/modules/vore/eating/leave_remains_vr.dm @@ -149,7 +149,10 @@ icon_scale_y = prey.size_multiplier update_transform() -/obj/item/digestion_remains/attack_self(var/mob/user) +/obj/item/digestion_remains/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE if(user.a_intent == I_HURT) to_chat(user,span_warning("As you squeeze the [name], it crumbles into dust and falls apart into nothing!")) qdel(src) diff --git a/code/modules/vore/fluffstuff/custom_clothes_vr.dm b/code/modules/vore/fluffstuff/custom_clothes_vr.dm index 6759573d48..ebcb365331 100644 --- a/code/modules/vore/fluffstuff/custom_clothes_vr.dm +++ b/code/modules/vore/fluffstuff/custom_clothes_vr.dm @@ -669,6 +669,7 @@ light_system = MOVABLE_LIGHT actions_types = list(/datum/action/item_action/toggle_pom_pom) + special_handling = TRUE /obj/item/clothing/head/fluff/pompom/digest_act(var/atom/movable/item_storage = null) return FALSE @@ -677,6 +678,9 @@ return FALSE /obj/item/clothing/head/fluff/pompom/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE //if(!isturf(user.loc)) -- doesn't seem to cause problems to allow this and it's silly not to // to_chat(user, "You cannot turn the light on while in this [user.loc]") // return @@ -1254,12 +1258,10 @@ Departamental Swimsuits, for general use if(unbuttoned) icon_state = "[initial(icon_state)]" - item_state = "[initial(item_state)]" unbuttoned = FALSE to_chat(usr, "You button up the coat.") else icon_state = "[initial(icon_state)]_open" - item_state = "[initial(item_state)]_open" unbuttoned = TRUE to_chat(usr, "You unbutton the coat.") usr.update_inv_wear_suit() @@ -1933,7 +1935,10 @@ Departamental Swimsuits, for general use translocator_unequip(translocator, user) /obj/item/clothing/head/fluff/nikki/attack_self(mob/user) - ..() + . = ..(user) + if(.) + return TRUE + ..(user, TRUE) if (translocator) translocator.attack_self(user, user) return diff --git a/code/modules/vore/fluffstuff/custom_items_vr.dm b/code/modules/vore/fluffstuff/custom_items_vr.dm index 7b09636e05..daecc85536 100644 --- a/code/modules/vore/fluffstuff/custom_items_vr.dm +++ b/code/modules/vore/fluffstuff/custom_items_vr.dm @@ -220,9 +220,13 @@ icon_state = "joanbadge" registered_name = "Joan Risu" assignment = "Centcom Officer" + special_handling = TRUE -/obj/item/card/id/centcom/station/fluff/joanbadge/attack_self(mob/user as mob) +/obj/item/card/id/centcom/station/fluff/joanbadge/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE if(isliving(user)) user.visible_message(span_warning("[user] flashes their golden security badge.\nIt reads:NT Security."),span_warning("You display the faded badge.\nIt reads: NT Security.")) @@ -290,7 +294,10 @@ icon_override = 'icons/vore/custom_items_vr.dmi' item_state = "Flag_Nanotrasen_mob" -/obj/item/flag/attack_self(mob/user as mob) +/obj/item/flag/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE if(isliving(user)) user.visible_message(span_warning("[user] waves their Banner around!"),span_warning("You wave your Banner around.")) @@ -411,16 +418,19 @@ /obj/item/card/id/centcom/station/fluff/aronai registered_name = "CONFIGURE ME" assignment = "CC Medical" - var/configured = 0 + can_configure = TRUE -/obj/item/card/id/centcom/station/fluff/aronai/attack_self(mob/user as mob) +/obj/item/card/id/centcom/station/fluff/aronai/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE if(configured) - return ..() + return user.set_id_info(src) if(user.mind && user.mind.initial_account) associated_account_number = user.mind.initial_account.account_number - configured = 1 + configured = TRUE to_chat(user, span_notice("Card settings set.")) //Swat43:Fortune Bloise @@ -543,6 +553,7 @@ var/mob/owner = null var/client/owner_c = null //They'll be dead when we message them probably. var/state = 0 //0 - New, 1 - Paired, 2 - Breaking, 3 - Broken (same as iconstates) + special_collar = TRUE /obj/item/clothing/accessory/collar/khcrystal/Initialize(mapload) . = ..() @@ -558,7 +569,10 @@ if((state > 1) || !owner) STOP_PROCESSING(SSobj, src) -/obj/item/clothing/accessory/collar/khcrystal/attack_self(mob/user as mob) +/obj/item/clothing/accessory/collar/khcrystal/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE if(state > 0) //Can't re-pair, one time only, for security reasons. to_chat(user, span_notice("The [name] doesn't do anything.")) return 0 @@ -771,7 +785,10 @@ icon_state = "dragor_dot" w_class = ITEMSIZE_SMALL -/obj/item/fluff/dragor_dot/attack_self(mob/user as mob) +/obj/item/fluff/dragor_dot/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE if(user.ckey == "pontifexminimus") add_verb(user, /mob/living/carbon/human/proc/shapeshifter_select_gender) else @@ -851,6 +868,7 @@ icon = 'icons/vore/custom_items_vr.dmi' icon_state = "hisstective_badge" //slot_flags = SLOT_TIE | SLOT_BELT + fluff_badge = TRUE /obj/item/clothing/accessory/badge/holo/detective/ruda/attack(mob/living/carbon/human/M, mob/living/user) if(isliving(user)) @@ -858,8 +876,10 @@ user.do_attack_animation(M) user.setClickCooldown(DEFAULT_QUICK_COOLDOWN) //to prevent spam -/obj/item/clothing/accessory/badge/holo/detective/ruda/attack_self(mob/user as mob) - +/obj/item/clothing/accessory/badge/holo/detective/ruda/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE if(!stored_name) to_chat(user, "You huff along the front of your badge, then rub your sleeve on it to polish it up.") set_name(user.real_name) @@ -949,6 +969,7 @@ //Two Handed var/wielded = 0 var/base_name = "stunstaff" + special_handling = TRUE /obj/item/melee/baton/fluff/stunstaff/Initialize(mapload) . = ..() @@ -992,6 +1013,9 @@ update_held_icon() /obj/item/melee/baton/fluff/stunstaff/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE if(bcell && bcell.charge > hitcost) status = !status to_chat(user, span_notice("[src] is now [status ? "on" : "off"].")) @@ -1060,7 +1084,10 @@ edge = initial(edge) w_class = initial(w_class) -/obj/item/melee/fluffstuff/attack_self(mob/living/user as mob) +/obj/item/melee/fluffstuff/attack_self(mob/living/user) + . = ..(user) + if(.) + return TRUE if (active) if ((CLUMSY in user.mutations) && prob(50)) user.visible_message(span_danger("\The [user] accidentally cuts \himself with \the [src]."),\ @@ -1311,6 +1338,9 @@ var/owner = "vitoras" /obj/item/fluff/verie/attack_self(mob/living/carbon/human/user) + . = ..(user) + if(.) + return TRUE if (istype(user)) // It's only made for Verie's chassis silly! if (user.ckey != owner) @@ -1531,8 +1561,12 @@ icon_state = "pandorba" pokephrase = "Gecker!" attack_verb = list("fluffed", "fwomped", "fuwa'd", "squirmshed") + special_handling = TRUE -/obj/item/toy/plushie/fluff/seona_mofuorb/attack_self(mob/user as mob) +/obj/item/toy/plushie/fluff/seona_mofuorb/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE if(stored_item && opened && !searching) searching = TRUE if(do_after(user, 1 SECOND, target = src)) diff --git a/code/modules/vore/mouseray.dm b/code/modules/vore/mouseray.dm index 882fb22d60..6bd4e83791 100644 --- a/code/modules/vore/mouseray.dm +++ b/code/modules/vore/mouseray.dm @@ -23,7 +23,9 @@ ) /obj/item/gun/energy/mouseray/attack_self(mob/user) - . = ..() + . = ..(user) + if(.) + return TRUE if(tf_allow_select) pick_type(user) diff --git a/code/modules/vore/resizing/holder_micro_vr.dm b/code/modules/vore/resizing/holder_micro_vr.dm index 47107ce945..4cb425f8a0 100644 --- a/code/modules/vore/resizing/holder_micro_vr.dm +++ b/code/modules/vore/resizing/holder_micro_vr.dm @@ -57,6 +57,9 @@ O.show_inventory_panel(usr, state = GLOB.tgui_deep_inventory_state) /obj/item/holder/micro/attack_self(mob/living/carbon/user) //reworked so it works w/ nonhumans + . = ..(user) + if(.) + return TRUE user.setClickCooldown(user.get_attack_speed()) for(var/L in contents) if(ishuman(L)) diff --git a/code/modules/vore/resizing/sizegun_slow_vr.dm b/code/modules/vore/resizing/sizegun_slow_vr.dm index b3bcff2ba2..08f0f7750b 100644 --- a/code/modules/vore/resizing/sizegun_slow_vr.dm +++ b/code/modules/vore/resizing/sizegun_slow_vr.dm @@ -170,6 +170,9 @@ delete_box(box_segments, user.client) /obj/item/slow_sizegun/attack_self(mob/living/user) + . = ..(user) + if(.) + return TRUE if(busy) busy = !busy else diff --git a/code/modules/vore/resizing/sizegun_vr.dm b/code/modules/vore/resizing/sizegun_vr.dm index f79db7a82c..30e8b5f594 100644 --- a/code/modules/vore/resizing/sizegun_vr.dm +++ b/code/modules/vore/resizing/sizegun_vr.dm @@ -29,7 +29,9 @@ verbs += /obj/item/gun/energy/sizegun/proc/spin_dial /obj/item/gun/energy/sizegun/attack_self(mob/user) - . = ..() + . = ..(user) + if(.) + return TRUE select_size(user) /obj/item/gun/energy/sizegun/proc/spin_dial() diff --git a/code/modules/vore/smoleworld/smoleworld_vr.dm b/code/modules/vore/smoleworld/smoleworld_vr.dm index 67cd47ba24..284fb1acf0 100644 --- a/code/modules/vore/smoleworld/smoleworld_vr.dm +++ b/code/modules/vore/smoleworld/smoleworld_vr.dm @@ -397,15 +397,7 @@ icon_state = "tether_trash" name = "tether" desc = "Its a tiny bit of plastic in the shape of the tether. There seems to be a small button on top." - -/obj/item/bikehorn/tinytether/attack_self(mob/user as mob) - if(spam_flag == 0) - spam_flag = 1 - playsound(src, 'sound/items/tinytether.ogg', 30, 1, volume_channel = VOLUME_CHANNEL_MASTER) - src.add_fingerprint(user) - spawn(20) - spam_flag = 0 - return + honk_sound = 'sound/items/tinytether.ogg' /obj/item/reagent_containers/food/snacks/snackplanet/moon name = "moon" diff --git a/code/modules/xenoarcheaology/finds/Weapons/archeo_melee.dm b/code/modules/xenoarcheaology/finds/Weapons/archeo_melee.dm index 7b80197867..d0c4710191 100644 --- a/code/modules/xenoarcheaology/finds/Weapons/archeo_melee.dm +++ b/code/modules/xenoarcheaology/finds/Weapons/archeo_melee.dm @@ -160,8 +160,11 @@ last_touched = user START_PROCESSING(SSobj, src) -/obj/item/melee/artifact_blade/attack_self(mob/user as mob) - if(last_special > world.time - 120) +/obj/item/melee/artifact_blade/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE + if(last_special > world.time - 12 SECONDS) to_chat(user, span_cult("The blade does not respond to your attempts, having recently performed an action!")) return last_special = world.time diff --git a/code/modules/xenoarcheaology/sampling.dm b/code/modules/xenoarcheaology/sampling.dm index 6d995fe23c..9d0083bfe5 100644 --- a/code/modules/xenoarcheaology/sampling.dm +++ b/code/modules/xenoarcheaology/sampling.dm @@ -154,7 +154,10 @@ else to_chat(user, span_warning("You are unable to take a sample of [item_to_sample].")) -/obj/item/core_sampler/attack_self(var/mob/living/user) +/obj/item/core_sampler/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE if(filled_bag) to_chat(user, span_notice("You eject the full sample bag.")) var/success = 0 diff --git a/code/modules/xenoarcheaology/tools/ano_device_battery.dm b/code/modules/xenoarcheaology/tools/ano_device_battery.dm index 8f9c6a0122..6ac7a95e4b 100644 --- a/code/modules/xenoarcheaology/tools/ano_device_battery.dm +++ b/code/modules/xenoarcheaology/tools/ano_device_battery.dm @@ -88,7 +88,10 @@ else return ..() -/obj/item/anodevice/attack_self(var/mob/user as mob) +/obj/item/anodevice/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE return tgui_interact(user) /obj/item/anodevice/tgui_state(mob/user) diff --git a/code/modules/xenoarcheaology/tools/tools.dm b/code/modules/xenoarcheaology/tools/tools.dm index c61fe29f54..6890b9d7e1 100644 --- a/code/modules/xenoarcheaology/tools/tools.dm +++ b/code/modules/xenoarcheaology/tools/tools.dm @@ -46,10 +46,13 @@ var/last_repopulation_time = 0 var/repopulation_delay = 600 //Anti spam. -/obj/item/ano_scanner/attack_self(var/mob/living/user) +/obj/item/ano_scanner/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE interact(user) -/obj/item/ano_scanner/interact(var/mob/living/user) +/obj/item/ano_scanner/interact(mob/user) if(world.time - last_scan_time >= scan_delay) last_scan_time = world.time @@ -154,7 +157,10 @@ to_chat(user, span_notice("[icon2html(src, user.client)] [src] pings [pick("madly","wildly","excitedly","crazily")]!")) -/obj/item/depth_scanner/attack_self(var/mob/living/user) +/obj/item/depth_scanner/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE tgui_interact(user) /obj/item/depth_scanner/tgui_state(mob/user) @@ -277,6 +283,9 @@ icon_state = "pinoff" /obj/item/beacon_locator/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE return tgui_interact(user) /obj/item/beacon_locator/tgui_state(mob/user) @@ -336,7 +345,10 @@ anomaly_scanner = new/obj/item/ano_scanner(src) depth_scanner = new/obj/item/depth_scanner(src) -/obj/item/xenoarch_multi_tool/attack_self(var/mob/living/user) +/obj/item/xenoarch_multi_tool/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE depth_scanner.tgui_interact(user) /obj/item/xenoarch_multi_tool/verb/swap_settings() diff --git a/code/modules/xenoarcheaology/tools/tools_pickaxe.dm b/code/modules/xenoarcheaology/tools/tools_pickaxe.dm index fdcff894e8..c5c585f736 100644 --- a/code/modules/xenoarcheaology/tools/tools_pickaxe.dm +++ b/code/modules/xenoarcheaology/tools/tools_pickaxe.dm @@ -173,7 +173,10 @@ w_class = 2 attack_verb = list("drilled") -/obj/item/pickaxe/excavationdrill/attack_self(mob/user as mob) +/obj/item/pickaxe/excavationdrill/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE var/depth = tgui_input_number(user, "Put the desired depth (1-60 centimeters).", "Set Depth", excavation_amount, 60, 1) if(depth>60 || depth<1) to_chat(user, span_notice("Invalid depth.")) diff --git a/code/modules/xenobio/items/slime_objects.dm b/code/modules/xenobio/items/slime_objects.dm index 0c57414627..0c95a46925 100644 --- a/code/modules/xenobio/items/slime_objects.dm +++ b/code/modules/xenobio/items/slime_objects.dm @@ -7,7 +7,10 @@ description_info = "Use in your hand to attempt to create a Promethean. It functions similarly to a positronic brain, in that a ghost is needed to become the Promethean." var/searching = 0 -/obj/item/slime_cube/attack_self(mob/user as mob) +/obj/item/slime_cube/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE if(!searching) to_chat(user, span_warning("You stare at the slimy cube, watching as some activity occurs.")) icon_state = "slime cube active" @@ -85,6 +88,9 @@ qdel(src) /obj/item/slime_crystal/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE user.visible_message(span_warning("\The [user] teleports themselves with \the [src]!")) safe_blink(user, 14) qdel(src) @@ -142,6 +148,7 @@ light_range = 6 on = 1 //Bio-luminesence has one setting, on. power_use = 0 + special_handling = TRUE /obj/item/flashlight/slime/Initialize(mapload) . = ..() @@ -150,10 +157,6 @@ /obj/item/flashlight/slime/update_brightness() return -/obj/item/flashlight/slime/attack_self(mob/user) - return //Bio-luminescence does not toggle. - - //Radiation Emitter /obj/item/slime_irradiator diff --git a/code/modules/xenobio/items/weapons_vr.dm b/code/modules/xenobio/items/weapons_vr.dm index 64b76cc82f..ce3f973518 100644 --- a/code/modules/xenobio/items/weapons_vr.dm +++ b/code/modules/xenobio/items/weapons_vr.dm @@ -36,7 +36,10 @@ return 1 ..() -/obj/item/xenobio/attack_self(mob/living/user as mob) +/obj/item/xenobio/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE if(loaded_item) user.put_in_hands(loaded_item) user.visible_message(span_notice("[user] removes [loaded_item] from [src]."), span_notice("You remove [loaded_item] from [src].")) diff --git a/code/modules/xenobio2/machinery/gene_manipulators.dm b/code/modules/xenobio2/machinery/gene_manipulators.dm index e63c762007..70dce3cdd8 100644 --- a/code/modules/xenobio2/machinery/gene_manipulators.dm +++ b/code/modules/xenobio2/machinery/gene_manipulators.dm @@ -21,6 +21,9 @@ var/genesource = "unknown" /obj/item/disk/xenobio/attack_self(var/mob/user as mob) + . = ..(user) + if(.) + return TRUE if(genes.len) var/choice = tgui_alert(user, "Are you sure you want to wipe the disk?", "Xenobiological Data", list("No", "Yes")) if(src && user && genes && choice && choice == "Yes" && user.Adjacent(get_turf(src))) diff --git a/code/modules/xenobio2/mob/slime/slime_monkey.dm b/code/modules/xenobio2/mob/slime/slime_monkey.dm index 228b4fa171..43929d7db0 100644 --- a/code/modules/xenobio2/mob/slime/slime_monkey.dm +++ b/code/modules/xenobio2/mob/slime/slime_monkey.dm @@ -8,7 +8,10 @@ Slime cube lives here. icon_state = "slime cube" var/searching = 0 -/obj/item/slime_cube/attack_self(mob/user as mob) +/obj/item/slime_cube/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE if(!searching) to_chat(user, span_warning("You stare at the slimy cube, watching as some activity occurs.")) request_player() diff --git a/code/modules/xenobio2/tools/xeno_trait_scanner.dm b/code/modules/xenobio2/tools/xeno_trait_scanner.dm index 2a11693b7e..f7311b85e9 100644 --- a/code/modules/xenobio2/tools/xeno_trait_scanner.dm +++ b/code/modules/xenobio2/tools/xeno_trait_scanner.dm @@ -31,7 +31,10 @@ user.visible_message("\The [src] spits out a piece of paper.") return -/obj/item/analyzer/xeno_analyzer/attack_self(mob/user as mob) +/obj/item/analyzer/xeno_analyzer/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE print_report(user) return 0 diff --git a/maps/redgate/facility_items.dm b/maps/redgate/facility_items.dm index 21215269cc..759fda6773 100644 --- a/maps/redgate/facility_items.dm +++ b/maps/redgate/facility_items.dm @@ -5,6 +5,7 @@ initial_sprite_stack = list() light_color = "#0099ff" access = list(801) + special_handling = TRUE /obj/item/card/id/keycard/update_icon() return @@ -12,9 +13,6 @@ /obj/item/card/id/keycard/read() to_chat(usr, span_notice("It is a red keycard, it must unlock something.")) -/obj/item/card/id/keycard/attack_self(mob/living/user as mob) - return - /obj/item/card/id/keycard/blue icon_state = "keycard-blue" access = list(802) diff --git a/maps/redgate/fantasy_items.dm b/maps/redgate/fantasy_items.dm index 5e581f6ed9..6ab38d0bdf 100644 --- a/maps/redgate/fantasy_items.dm +++ b/maps/redgate/fantasy_items.dm @@ -472,6 +472,7 @@ beacons_left = 3 cell_type = /obj/item/cell/device origin_tech = list(TECH_MAGNET = 5, TECH_BLUESPACE = 5) + special_handling = TRUE /obj/item/perfect_tele_beacon/magic name = "teleportation page" @@ -480,6 +481,9 @@ icon_state = "page" /obj/item/perfect_tele/magic/attack_self(mob/user, var/radial_menu_anchor = src) + . = ..(user, radial_menu_anchor) + if(.) + return TRUE if(loc_network) for(var/obj/item/perfect_tele_beacon/stationary/nb in GLOB.premade_tele_beacons) if(nb.tele_network == loc_network) diff --git a/maps/submaps/pois_vr/debris_field/debrisfield_things.dm b/maps/submaps/pois_vr/debris_field/debrisfield_things.dm index eabd3dfb4a..dd14f41643 100644 --- a/maps/submaps/pois_vr/debris_field/debrisfield_things.dm +++ b/maps/submaps/pois_vr/debris_field/debrisfield_things.dm @@ -149,7 +149,10 @@ icon_state = "egg_slimeglob" origin_tech = list(TECH_BIO = 10) -/obj/item/space_spider_egg/attack_self(mob/user as mob) +/obj/item/space_spider_egg/attack_self(mob/user) + . = ..(user) + if(.) + return TRUE var/turf/drop_loc = user.loc to_chat(user, span_warning("The egg cracks open, splattering disgusting goop at your feet...\n \ Whatever life laid within shall never awaken, if it was even alive."))