diff --git a/code/game/atoms.dm b/code/game/atoms.dm index 265cae3ddb8..79935d17c9c 100644 --- a/code/game/atoms.dm +++ b/code/game/atoms.dm @@ -1092,10 +1092,15 @@ /** * Respond to an emag being used on our atom * - * Default behaviour is to send [COMSIG_ATOM_EMAG_ACT] and return + * Args: + * * mob/user: The mob that used the emag. Nullable. + * * obj/item/card/emag/emag_card: The emag that was used. Nullable. + * + * Returns: + * TRUE if the emag had any effect, falsey otherwise. */ /atom/proc/emag_act(mob/user, obj/item/card/emag/emag_card) - SEND_SIGNAL(src, COMSIG_ATOM_EMAG_ACT, user, emag_card) + return (SEND_SIGNAL(src, COMSIG_ATOM_EMAG_ACT, user, emag_card)) /** * Respond to narsie eating our atom diff --git a/code/game/machinery/announcement_system.dm b/code/game/machinery/announcement_system.dm index 87f2a9f01c8..df3e402525d 100644 --- a/code/game/machinery/announcement_system.dm +++ b/code/game/machinery/announcement_system.dm @@ -176,8 +176,10 @@ GLOBAL_LIST_EMPTY(announcement_systems) if(!(machine_stat & (NOPOWER|BROKEN)) && !(. & EMP_PROTECT_SELF)) act_up() -/obj/machinery/announcement_system/emag_act() +/obj/machinery/announcement_system/emag_act(mob/user, obj/item/card/emag/emag_card) if(obj_flags & EMAGGED) - return + return FALSE obj_flags |= EMAGGED act_up() + balloon_alert(user, "announcement strings corrupted") + return TRUE diff --git a/code/game/machinery/barsigns.dm b/code/game/machinery/barsigns.dm index 5930acbf2e1..1166fa672be 100644 --- a/code/game/machinery/barsigns.dm +++ b/code/game/machinery/barsigns.dm @@ -172,15 +172,18 @@ MAPPING_DIRECTIONAL_HELPERS(/obj/machinery/barsign, 32) set_sign(sign) -/obj/machinery/barsign/emag_act(mob/user) +/obj/machinery/barsign/emag_act(mob/user, obj/item/card/emag/emag_card) if(machine_stat & (NOPOWER|BROKEN|EMPED)) balloon_alert(user, "controls are unresponsive!") - return + return FALSE balloon_alert(user, "illegal barsign loaded") - sleep(10 SECONDS) - set_sign(new /datum/barsign/hiddensigns/syndibarsign) + addtimer(CALLBACK(src, PROC_REF(finish_emag_act)), 10 SECONDS) + return TRUE +/// Timer proc, called after ~10 seconds after [emag_act], since [emag_act] returns a value and cannot sleep +/obj/machinery/barsign/proc/finish_emag_act() + set_sign(new /datum/barsign/hiddensigns/syndibarsign) /obj/machinery/barsign/proc/pick_sign(mob/user) var/picked_name = tgui_input_list(user, "Available Signage", "Bar Sign", sort_list(get_bar_names())) diff --git a/code/game/machinery/buttons.dm b/code/game/machinery/buttons.dm index 737b01cb33a..78e48295d5e 100644 --- a/code/game/machinery/buttons.dm +++ b/code/game/machinery/buttons.dm @@ -139,7 +139,7 @@ else return ..() -/obj/machinery/button/emag_act(mob/user) +/obj/machinery/button/emag_act(mob/user, obj/item/card/emag/emag_card) . = ..() if(obj_flags & EMAGGED) return @@ -150,9 +150,9 @@ // The device inside can be emagged by swiping the button // returning TRUE will prevent feedback (so we can do our own) - if(device?.emag_act(user)) - return - balloon_alert(user, "access overridden") + if(!device?.emag_act(user, emag_card)) + balloon_alert(user, "access overridden") + return TRUE /obj/machinery/button/attack_ai(mob/user) if(!silicon_access_disabled && !panel_open) diff --git a/code/game/machinery/computer/apc_control.dm b/code/game/machinery/computer/apc_control.dm index 882ef86f0db..6cecd17e811 100644 --- a/code/game/machinery/computer/apc_control.dm +++ b/code/game/machinery/computer/apc_control.dm @@ -27,12 +27,15 @@ return ..() -/obj/machinery/computer/apc_control/emag_act(mob/user) +/obj/machinery/computer/apc_control/emag_act(mob/user, obj/item/card/emag/emag_card) if(obj_flags & EMAGGED) - return + return FALSE obj_flags |= EMAGGED - usr.log_message("emagged [src].", LOG_ATTACK, color="red") + if (user) + user.log_message("emagged [src].", LOG_ATTACK, color="red") + balloon_alert(user, "access controller shorted") playsound(src, SFX_SPARKS, 50, TRUE, SHORT_RANGE_SOUND_EXTRARANGE) + return TRUE /obj/machinery/computer/apc_control/proc/log_activity(log_text) if(!should_log) diff --git a/code/game/machinery/computer/arcade/arcade.dm b/code/game/machinery/computer/arcade/arcade.dm index f7dc3909273..28034872289 100644 --- a/code/game/machinery/computer/arcade/arcade.dm +++ b/code/game/machinery/computer/arcade/arcade.dm @@ -620,17 +620,18 @@ GLOBAL_LIST_INIT(arcade_prize_pool, list( . += "\t[span_info("magical -> defend until outmagiced")]" return . -/obj/machinery/computer/arcade/battle/emag_act(mob/user) +/obj/machinery/computer/arcade/battle/emag_act(mob/user, obj/item/card/emag/emag_card) if(obj_flags & EMAGGED) - return + return FALSE + balloon_alert(user, "hard mode enabled") to_chat(user, span_warning("A mesmerizing Rhumba beat starts playing from the arcade machine's speakers!")) temp = "

If you die in the game, you die for real!

" max_passive = 6 bomb_cooldown = 18 var/gamerSkill = 0 - if(usr?.mind) - gamerSkill = usr.mind.get_skill_level(/datum/skill/gaming) + if(user?.mind) + gamerSkill = user.mind.get_skill_level(/datum/skill/gaming) enemy_setup(gamerSkill) enemy_hp += 100 //extra HP just to make cuban pete even more bullshit player_hp += 30 //the player will also get a few extra HP in order to have a fucking chance @@ -644,6 +645,7 @@ GLOBAL_LIST_INIT(arcade_prize_pool, list( name = "Outbomb Cuban Pete" updateUsrDialog() + return TRUE // ** AMPUTATION ** // diff --git a/code/game/machinery/computer/arcade/orion.dm b/code/game/machinery/computer/arcade/orion.dm index e1bd4005978..3bf880a7582 100644 --- a/code/game/machinery/computer/arcade/orion.dm +++ b/code/game/machinery/computer/arcade/orion.dm @@ -489,15 +489,18 @@ GLOBAL_LIST_INIT(orion_events, generate_orion_events()) name = initial(name) desc = initial(desc) -/obj/machinery/computer/arcade/orion_trail/emag_act(mob/user) +/obj/machinery/computer/arcade/orion_trail/emag_act(mob/user, obj/item/card/emag/emag_card) if(obj_flags & EMAGGED) - return - to_chat(user, span_notice("You override the cheat code menu and skip to Cheat #[rand(1, 50)]: Realism Mode.")) - user.log_message("emagged [src], activating Realism Mode.", LOG_GAME) + return FALSE + if (user) + user.log_message("emagged [src], activating Realism Mode.", LOG_GAME) + balloon_alert(user, "realism mode enabled") + to_chat(user, span_notice("You override the cheat code menu and skip to Cheat #[rand(1, 50)]: Realism Mode.")) name = "The Orion Trail: Realism Edition" desc = "Learn how our ancestors got to Orion, and try not to die in the process!" newgame() obj_flags |= EMAGGED + return TRUE /mob/living/basic/syndicate/ranged/smg/orion name = "spaceport security" diff --git a/code/game/machinery/computer/communications.dm b/code/game/machinery/computer/communications.dm index 60349e31dec..27f498c6cdf 100755 --- a/code/game/machinery/computer/communications.dm +++ b/code/game/machinery/computer/communications.dm @@ -74,7 +74,7 @@ GLOBAL_VAR_INIT(cops_arrived, FALSE) syndicate = TRUE /obj/machinery/computer/communications/syndicate/emag_act(mob/user, obj/item/card/emag/emag_card) - return + return FALSE /obj/machinery/computer/communications/syndicate/can_buy_shuttles(mob/user) return FALSE @@ -132,27 +132,30 @@ GLOBAL_VAR_INIT(cops_arrived, FALSE) /obj/machinery/computer/communications/emag_act(mob/user, obj/item/card/emag/emag_card) if(istype(emag_card, /obj/item/card/emag/battlecruiser)) - if(!IS_TRAITOR(user)) - to_chat(user, span_danger("You get the feeling this is a bad idea.")) - return var/obj/item/card/emag/battlecruiser/caller_card = emag_card + if (user) + if(!IS_TRAITOR(user)) + to_chat(user, span_danger("You get the feeling this is a bad idea.")) + return FALSE if(battlecruiser_called) - to_chat(user, span_danger("The card reports a long-range message already sent to the Syndicate fleet...?")) - return + if (user) + to_chat(user, span_danger("The card reports a long-range message already sent to the Syndicate fleet...?")) + return FALSE battlecruiser_called = TRUE caller_card.use_charge(user) addtimer(CALLBACK(GLOBAL_PROC, GLOBAL_PROC_REF(summon_battlecruiser), caller_card.team), rand(20 SECONDS, 1 MINUTES)) playsound(src, 'sound/machines/terminal_alert.ogg', 50, FALSE) - priority_announce("Attention crew: deep-space sensors detect a Syndicate battlecruiser-class signature subspace rift forming near your station. Estimated time until arrival: three to five minutes.", "[command_name()] High-Priority Update") //skyrat add: announcement on battlecruiser call - return + priority_announce("Attention crew: deep-space sensors detect a Syndicate battlecruiser-class signature subspace rift forming near your station. Estimated time until arrival: three to five minutes.", "[command_name()] High-Priority Update") //SKYRAT EDIT ADDITION: announcement on battlecruiser call + return TRUE if(obj_flags & EMAGGED) - return + return FALSE obj_flags |= EMAGGED if (authenticated) authorize_access = SSid_access.get_region_access_list(list(REGION_ALL_STATION)) - to_chat(user, span_danger("You scramble the communication routing circuits!")) + balloon_alert(user, "routing circuits scrambled") playsound(src, 'sound/machines/terminal_alert.ogg', 50, FALSE) + return TRUE /obj/machinery/computer/communications/ui_act(action, list/params) var/static/list/approved_states = list(STATE_BUYING_SHUTTLE, STATE_CHANGING_STATUS, STATE_MAIN, STATE_MESSAGES) diff --git a/code/game/machinery/digital_clock.dm b/code/game/machinery/digital_clock.dm index 99cd1894725..0bfb8aeba72 100644 --- a/code/game/machinery/digital_clock.dm +++ b/code/game/machinery/digital_clock.dm @@ -57,12 +57,13 @@ obj_flags &= ~EMAGGED return TRUE -/obj/machinery/digital_clock/emag_act(mob/user) +/obj/machinery/digital_clock/emag_act(mob/user, obj/item/card/emag/emag_card) if(obj_flags & EMAGGED) - return + return FALSE playsound(src, SFX_SPARKS, 100, vary = TRUE, extrarange = SHORT_RANGE_SOUND_EXTRARANGE) do_sparks(3, cardinal_only = FALSE, source = src) obj_flags |= EMAGGED + return TRUE /obj/machinery/digital_clock/emp_act(severity) . = ..() diff --git a/code/game/machinery/doors/airlock.dm b/code/game/machinery/doors/airlock.dm index 63eeafe77c3..7d5b495e28c 100644 --- a/code/game/machinery/doors/airlock.dm +++ b/code/game/machinery/doors/airlock.dm @@ -1405,23 +1405,29 @@ //Airlock is passable if it is open (!density), bot has access, and is not bolted shut or powered off) return !density || (check_access(ID) && !locked && hasPower() && !no_id) -/obj/machinery/door/airlock/emag_act(mob/user, obj/item/card/emag/doorjack/D) +/obj/machinery/door/airlock/emag_act(mob/user, obj/item/card/emag/emag_card) if(!operating && density && hasPower() && !(obj_flags & EMAGGED)) - if(istype(D, /obj/item/card/emag/doorjack)) - D.use_charge(user) + if(istype(emag_card, /obj/item/card/emag/doorjack)) + var/obj/item/card/emag/doorjack/doorjack_card = emag_card + doorjack_card.use_charge(user) operating = TRUE update_icon(ALL, AIRLOCK_EMAG, 1) - sleep(0.6 SECONDS) - if(QDELETED(src)) - return - operating = FALSE - if(!open()) - update_icon(ALL, AIRLOCK_CLOSED, 1) - obj_flags |= EMAGGED - lights = FALSE - locked = TRUE - loseMainPower() - loseBackupPower() + addtimer(CALLBACK(src, PROC_REF(finish_emag_act)), 0.6 SECONDS) + return TRUE + return FALSE + +/// Timer proc, called ~0.6 seconds after [emag_act]. Finishes the emag sequence by breaking the airlock, permanently locking it, and disabling power. +/obj/machinery/door/airlock/proc/finish_emag_act() + if(QDELETED(src)) + return FALSE + operating = FALSE + if(!open()) + update_icon(ALL, AIRLOCK_CLOSED, 1) + obj_flags |= EMAGGED + lights = FALSE + locked = TRUE + loseMainPower() + loseBackupPower() /obj/machinery/door/airlock/attack_alien(mob/living/carbon/alien/adult/user, list/modifiers) if(isElectrified() && shock(user, 100)) //Mmm, fried xeno! diff --git a/code/game/machinery/doors/firedoor.dm b/code/game/machinery/doors/firedoor.dm index c74d613ec0d..6f6598803b6 100644 --- a/code/game/machinery/doors/firedoor.dm +++ b/code/game/machinery/doors/firedoor.dm @@ -434,14 +434,15 @@ if(place == my_area) place.alarm_manager.clear_alarm(ALARM_FIRE, place) -/obj/machinery/door/firedoor/emag_act(mob/user, obj/item/card/emag/emag_type) +/obj/machinery/door/firedoor/emag_act(mob/user, obj/item/card/emag/emag_card) if(obj_flags & EMAGGED) - return - if(istype(emag_type, /obj/item/card/emag/doorjack)) //Skip doorjack-specific code - var/obj/item/card/emag/doorjack/digital_crowbar = emag_type + return FALSE + if(istype(emag_card, /obj/item/card/emag/doorjack)) //Skip doorjack-specific code + var/obj/item/card/emag/doorjack/digital_crowbar = emag_card digital_crowbar.use_charge(user) obj_flags |= EMAGGED INVOKE_ASYNC(src, PROC_REF(open)) + return TRUE /obj/machinery/door/firedoor/Bumped(atom/movable/AM) if(panel_open || operating) diff --git a/code/game/machinery/doors/unpowered.dm b/code/game/machinery/doors/unpowered.dm index 9372abe59ce..6a9fea47419 100644 --- a/code/game/machinery/doors/unpowered.dm +++ b/code/game/machinery/doors/unpowered.dm @@ -13,8 +13,8 @@ else return ..() -/obj/machinery/door/unpowered/emag_act() - return +/obj/machinery/door/unpowered/emag_act(mob/user, obj/item/card/emag/emag_card) + return FALSE /obj/machinery/door/unpowered/shuttle icon = 'icons/turf/shuttle.dmi' diff --git a/code/game/machinery/doors/windowdoor.dm b/code/game/machinery/doors/windowdoor.dm index de2d1e1dea4..59cbbb205e5 100644 --- a/code/game/machinery/doors/windowdoor.dm +++ b/code/game/machinery/doors/windowdoor.dm @@ -324,16 +324,20 @@ /obj/machinery/door/window/atmos_expose(datum/gas_mixture/air, exposed_temperature) take_damage(round(exposed_temperature / 200), BURN, 0, 0) - -/obj/machinery/door/window/emag_act(mob/user) +/obj/machinery/door/window/emag_act(mob/user, obj/item/card/emag/emag_card) if(!operating && density && !(obj_flags & EMAGGED)) obj_flags |= EMAGGED operating = TRUE flick("[base_state]spark", src) playsound(src, SFX_SPARKS, 75, TRUE, SHORT_RANGE_SOUND_EXTRARANGE) - sleep(0.6 SECONDS) - operating = FALSE - open(BYPASS_DOOR_CHECKS) + addtimer(CALLBACK(src, PROC_REF(finish_emag_act)), 0.6 SECONDS) + return TRUE + return FALSE + +/// Timer proc, called ~0.6 seconds after [emag_act]. Finishes the emag sequence by breaking the windoor. +/obj/machinery/door/window/proc/finish_emag_act() + operating = FALSE + open(BYPASS_DOOR_CHECKS) /obj/machinery/door/window/examine(mob/user) . = ..() diff --git a/code/game/machinery/embedded_controller/access_controller.dm b/code/game/machinery/embedded_controller/access_controller.dm index 213939972c4..3aaf4a9b6f8 100644 --- a/code/game/machinery/embedded_controller/access_controller.dm +++ b/code/game/machinery/embedded_controller/access_controller.dm @@ -25,14 +25,15 @@ /obj/machinery/door_buttons/LateInitialize() findObjsByTag() -/obj/machinery/door_buttons/emag_act(mob/user) +/obj/machinery/door_buttons/emag_act(mob/user, obj/item/card/emag/emag_card) if(obj_flags & EMAGGED) - return + return FALSE obj_flags |= EMAGGED req_access = list() req_one_access = list() playsound(src, SFX_SPARKS, 100, TRUE, SHORT_RANGE_SOUND_EXTRARANGE) - to_chat(user, span_warning("You short out the access controller.")) + balloon_alert(user, "access controller shorted") + return TRUE /obj/machinery/door_buttons/proc/removeMe() diff --git a/code/game/machinery/fat_sucker.dm b/code/game/machinery/fat_sucker.dm index 03a71e486f6..6e1f745772e 100644 --- a/code/game/machinery/fat_sucker.dm +++ b/code/game/machinery/fat_sucker.dm @@ -210,10 +210,11 @@ if(default_deconstruction_crowbar(I)) return TRUE -/obj/machinery/fat_sucker/emag_act(mob/living/user) +/obj/machinery/fat_sucker/emag_act(mob/user, obj/item/card/emag/emag_card) if(obj_flags & EMAGGED) - return + return FALSE start_at = 100 stop_at = 0 to_chat(user, span_notice("You remove the access restrictions and lower the automatic ejection threshold!")) obj_flags |= EMAGGED + return TRUE diff --git a/code/game/machinery/firealarm.dm b/code/game/machinery/firealarm.dm index 52c2b5b3693..99f6a398567 100644 --- a/code/game/machinery/firealarm.dm +++ b/code/game/machinery/firealarm.dm @@ -227,17 +227,18 @@ if(prob(50 / severity)) alarm() -/obj/machinery/firealarm/emag_act(mob/user) +/obj/machinery/firealarm/emag_act(mob/user, obj/item/card/emag/emag_card) if(obj_flags & EMAGGED) - return + return FALSE obj_flags |= EMAGGED update_appearance() + visible_message(span_warning("Sparks fly out of [src]!")) if(user) - user.visible_message(span_warning("Sparks fly out of [src]!")) - user.balloon_alert(user, "speaker disabled!") + balloon_alert(user, "speaker disabled") user.log_message("emagged [src].", LOG_ATTACK) playsound(src, SFX_SPARKS, 50, TRUE, SHORT_RANGE_SOUND_EXTRARANGE) set_status() + return TRUE /** * Signal handler for checking if we should update fire alarm appearance accordingly to a newly set security level diff --git a/code/game/machinery/gulag_item_reclaimer.dm b/code/game/machinery/gulag_item_reclaimer.dm index e60778542a8..550ec554a05 100644 --- a/code/game/machinery/gulag_item_reclaimer.dm +++ b/code/game/machinery/gulag_item_reclaimer.dm @@ -32,13 +32,15 @@ linked_teleporter.linked_reclaimer = null return ..() -/obj/machinery/gulag_item_reclaimer/emag_act(mob/user) +/obj/machinery/gulag_item_reclaimer/emag_act(mob/user, obj/item/card/emag/emag_card) if(obj_flags & EMAGGED) // emagging lets anyone reclaim all the items - return + return FALSE req_access = list() obj_flags |= EMAGGED screen_icon = "emagged_general" update_appearance() + balloon_alert(user, "id checker scrambled") + return TRUE /obj/machinery/gulag_item_reclaimer/ui_interact(mob/user, datum/tgui/ui) ui = SStgui.try_update_ui(user, src, ui) diff --git a/code/game/machinery/harvester.dm b/code/game/machinery/harvester.dm index 7538a8af260..b5fd04a98f2 100644 --- a/code/game/machinery/harvester.dm +++ b/code/game/machinery/harvester.dm @@ -184,13 +184,14 @@ visible_message(span_notice("[usr] pries open \the [src]."), span_notice("You pry open [src].")) open_machine() -/obj/machinery/harvester/emag_act(mob/user) +/obj/machinery/harvester/emag_act(mob/user, obj/item/card/emag/emag_card) if(obj_flags & EMAGGED) - return + return FALSE obj_flags |= EMAGGED allow_living = TRUE allow_clothing = TRUE - to_chat(user, span_warning("You overload [src]'s lifesign and abiotic material scanners.")) + balloon_alert(!user, "lifesign scanners overloaded") + return TRUE /obj/machinery/harvester/container_resist_act(mob/living/user) if(!harvesting) diff --git a/code/game/machinery/limbgrower.dm b/code/game/machinery/limbgrower.dm index 5f8d7020569..e5576bdb267 100644 --- a/code/game/machinery/limbgrower.dm +++ b/code/game/machinery/limbgrower.dm @@ -34,12 +34,14 @@ AddComponent(/datum/component/plumbing/simple_demand) /// Emagging a limbgrower allows you to build synthetic armblades. -/obj/machinery/limbgrower/emag_act(mob/user) - if(obj_flags & EMAGGED) - return +/obj/machinery/limbgrower/emag_act(mob/user, obj/item/card/emag/emag_card) . = ..() + if(obj_flags & EMAGGED) + return FALSE obj_flags |= EMAGGED update_static_data(user) + balloon_alert(user, "illegal limb production enabled") + return TRUE /obj/machinery/limbgrower/ui_interact(mob/user, datum/tgui/ui) . = ..() diff --git a/code/game/machinery/medical_kiosk.dm b/code/game/machinery/medical_kiosk.dm index 7323608c499..a0a1a40ed43 100644 --- a/code/game/machinery/medical_kiosk.dm +++ b/code/game/machinery/medical_kiosk.dm @@ -143,17 +143,19 @@ qdel(scanner_wand) return ..() -/obj/machinery/medical_kiosk/emag_act(mob/user) - ..() +/obj/machinery/medical_kiosk/emag_act(mob/user, obj/item/card/emag/emag_card) + . = ..() if(obj_flags & EMAGGED) return if(user) - user.visible_message(span_warning("[user] waves a suspicious card by the [src]'s biometric scanner!"), - span_notice("You overload the sensory electronics, the diagnostic readouts start jittering across the screen..")) + if (emag_card) + user.visible_message(span_warning("[user] waves a suspicious card by the [src]'s biometric scanner!")) + balloon_alert(user, "sensors overloaded") obj_flags |= EMAGGED var/obj/item/circuitboard/computer/cargo/board = circuit board.obj_flags |= EMAGGED //Mirrors emag status onto the board as well. pandemonium = TRUE + return TRUE /obj/machinery/medical_kiosk/examine(mob/user) . = ..() diff --git a/code/game/machinery/porta_turret/portable_turret.dm b/code/game/machinery/porta_turret/portable_turret.dm index b7b2a32be89..2100b103386 100644 --- a/code/game/machinery/porta_turret/portable_turret.dm +++ b/code/game/machinery/porta_turret/portable_turret.dm @@ -355,10 +355,10 @@ DEFINE_BITFIELD(turret_flags, list( else return ..() -/obj/machinery/porta_turret/emag_act(mob/user) +/obj/machinery/porta_turret/emag_act(mob/user, obj/item/card/emag/emag_card) if(obj_flags & EMAGGED) - return - to_chat(user, span_warning("You short out [src]'s threat assessment circuits.")) + return FALSE + balloon_alert(user, "threat assessment circuits shorted") audible_message(span_hear("[src] hums oddly...")) obj_flags |= EMAGGED controllock = TRUE @@ -367,6 +367,7 @@ DEFINE_BITFIELD(turret_flags, list( //6 seconds for the traitor to gtfo of the area before the turret decides to ruin his shit addtimer(CALLBACK(src, PROC_REF(toggle_on), TRUE), 6 SECONDS) //turns it back on. The cover popUp() popDown() are automatically called in process(), no need to define it here + return TRUE /obj/machinery/porta_turret/emp_act(severity) . = ..() @@ -974,12 +975,13 @@ DEFINE_BITFIELD(turret_flags, list( else to_chat(user, span_alert("Access denied.")) -/obj/machinery/turretid/emag_act(mob/user) +/obj/machinery/turretid/emag_act(mob/user, obj/item/card/emag/emag_card) if(obj_flags & EMAGGED) - return - to_chat(user, span_notice("You short out the turret controls' access analysis module.")) + return FALSE + balloon_alert(user, "access analysis module shorted") obj_flags |= EMAGGED locked = FALSE + return TRUE /obj/machinery/turretid/attack_ai(mob/user) if(!ailock || isAdminGhostAI(user)) diff --git a/code/game/machinery/porta_turret/portable_turret_cover.dm b/code/game/machinery/porta_turret/portable_turret_cover.dm index d6c7eba6dc4..2ff41a17283 100644 --- a/code/game/machinery/porta_turret/portable_turret_cover.dm +++ b/code/game/machinery/porta_turret/portable_turret_cover.dm @@ -85,10 +85,14 @@ /obj/machinery/porta_turret_cover/can_be_overridden() . = 0 -/obj/machinery/porta_turret_cover/emag_act(mob/user) - if(!(parent_turret.obj_flags & EMAGGED)) - to_chat(user, span_notice("You short out [parent_turret]'s threat assessment circuits.")) - audible_message(span_hear("[parent_turret] hums oddly...")) - parent_turret.obj_flags |= EMAGGED - parent_turret.on = FALSE - addtimer(VARSET_CALLBACK(parent_turret, on, TRUE), 4 SECONDS) +/obj/machinery/porta_turret_cover/emag_act(mob/user, obj/item/card/emag/emag_card) + + if((parent_turret.obj_flags & EMAGGED)) + return FALSE + + balloon_alert(user, "threat assessment circuits shorted") + audible_message(span_hear("[parent_turret] hums oddly...")) + parent_turret.obj_flags |= EMAGGED + parent_turret.on = FALSE + addtimer(VARSET_CALLBACK(parent_turret, on, TRUE), 4 SECONDS) + return TRUE diff --git a/code/game/machinery/recycler.dm b/code/game/machinery/recycler.dm index 2b4ebe3a921..a5a712be7d5 100644 --- a/code/game/machinery/recycler.dm +++ b/code/game/machinery/recycler.dm @@ -83,15 +83,16 @@ return return ..() -/obj/machinery/recycler/emag_act(mob/user) +/obj/machinery/recycler/emag_act(mob/user, obj/item/card/emag/emag_card) if(obj_flags & EMAGGED) - return + return FALSE obj_flags |= EMAGGED if(safety_mode) safety_mode = FALSE update_appearance() playsound(src, SFX_SPARKS, 75, TRUE, SILENCED_SOUND_EXTRARANGE) - to_chat(user, span_notice("You use the cryptographic sequencer on [src].")) + balloon_alert(user, "safeties disabled") + return FALSE /obj/machinery/recycler/update_icon_state() var/is_powered = !(machine_stat & (BROKEN|NOPOWER)) diff --git a/code/game/machinery/scan_gate.dm b/code/game/machinery/scan_gate.dm index e872e576515..a0429f22f54 100644 --- a/code/game/machinery/scan_gate.dm +++ b/code/game/machinery/scan_gate.dm @@ -122,13 +122,14 @@ wires.interact(user) return ..() -/obj/machinery/scanner_gate/emag_act(mob/user) +/obj/machinery/scanner_gate/emag_act(mob/user, obj/item/card/emag/emag_card) if(obj_flags & EMAGGED) - return + return FALSE locked = FALSE req_access = list() obj_flags |= EMAGGED - to_chat(user, span_notice("You fry the ID checking system.")) + balloon_alert(user, "id checker disabled") + return TRUE /obj/machinery/scanner_gate/proc/perform_scan(mob/living/M) var/beep = FALSE diff --git a/code/game/machinery/shieldgen.dm b/code/game/machinery/shieldgen.dm index 9fd7f4bdb52..edfbf446400 100644 --- a/code/game/machinery/shieldgen.dm +++ b/code/game/machinery/shieldgen.dm @@ -268,14 +268,15 @@ else return ..() -/obj/machinery/shieldgen/emag_act(mob/user) +/obj/machinery/shieldgen/emag_act(mob/user, obj/item/card/emag/emag_card) if(obj_flags & EMAGGED) to_chat(user, span_warning("The access controller is damaged!")) - return + return FALSE obj_flags |= EMAGGED locked = FALSE playsound(src, SFX_SPARKS, 100, TRUE, SHORT_RANGE_SOUND_EXTRARANGE) - to_chat(user, span_warning("You short out the access controller.")) + balloon_alert(user, "access controller shorted") + return TRUE /obj/machinery/shieldgen/update_icon_state() icon_state = "shield[active ? "on" : "off"][(machine_stat & BROKEN) ? "br" : null]" @@ -470,14 +471,15 @@ user.log_message("activated [src].", LOG_GAME) add_fingerprint(user) -/obj/machinery/power/shieldwallgen/emag_act(mob/user) +/obj/machinery/power/shieldwallgen/emag_act(mob/user, obj/item/card/emag/emag_card) if(obj_flags & EMAGGED) to_chat(user, span_warning("The access controller is damaged!")) - return + return FALSE obj_flags |= EMAGGED locked = FALSE playsound(src, SFX_SPARKS, 100, TRUE, SHORT_RANGE_SOUND_EXTRARANGE) - to_chat(user, span_warning("You short out the access controller.")) + balloon_alert(user, "access controller shorted") + return TRUE //////////////Containment Field START /obj/machinery/shieldwall diff --git a/code/game/machinery/sleepers.dm b/code/game/machinery/sleepers.dm index 6f7cee63d87..373dc5333eb 100644 --- a/code/game/machinery/sleepers.dm +++ b/code/game/machinery/sleepers.dm @@ -266,16 +266,17 @@ if((obj_flags & EMAGGED) && prob(5)) to_chat(usr, span_warning("Chemical system re-route detected, results may not be as expected!")) -/obj/machinery/sleeper/emag_act(mob/user) +/obj/machinery/sleeper/emag_act(mob/user, obj/item/card/emag/emag_card) if(obj_flags & EMAGGED) - return + return FALSE - to_chat(user, span_warning("You scramble the sleeper's user interface!")) + balloon_alert(user, "interface scrambled") obj_flags |= EMAGGED var/list/av_chem = available_chems.Copy() for(var/chem in av_chem) chem_buttons[chem] = pick_n_take(av_chem) //no dupes, allow for random buttons to still be correct + return TRUE /obj/machinery/sleeper/proc/inject_chem(chem, mob/user) if((chem in available_chems) && chem_allowed(chem)) diff --git a/code/game/machinery/slotmachine.dm b/code/game/machinery/slotmachine.dm index 30bef8e4686..1a5ed333f34 100644 --- a/code/game/machinery/slotmachine.dm +++ b/code/game/machinery/slotmachine.dm @@ -127,14 +127,16 @@ else return ..() -/obj/machinery/computer/slot_machine/emag_act() +/obj/machinery/computer/slot_machine/emag_act(mob/user, obj/item/card/emag/emag_card) if(obj_flags & EMAGGED) - return + return FALSE obj_flags |= EMAGGED var/datum/effect_system/spark_spread/spark_system = new /datum/effect_system/spark_spread() spark_system.set_up(4, 0, src.loc) spark_system.start() playsound(src, SFX_SPARKS, 50, TRUE, SHORT_RANGE_SOUND_EXTRARANGE) + balloon_alert(user, "machine rigged") + return TRUE /obj/machinery/computer/slot_machine/ui_interact(mob/living/user) . = ..() diff --git a/code/game/machinery/telecomms/computers/message.dm b/code/game/machinery/telecomms/computers/message.dm index 72a5bd3a7f9..4db37cea2d8 100644 --- a/code/game/machinery/telecomms/computers/message.dm +++ b/code/game/machinery/telecomms/computers/message.dm @@ -38,9 +38,9 @@ return TRUE return ..() -/obj/machinery/computer/message_monitor/emag_act(mob/user) +/obj/machinery/computer/message_monitor/emag_act(mob/user, obj/item/card/emag/emag_card) if(obj_flags & EMAGGED) - return + return FALSE if(!isnull(linkedServer)) obj_flags |= EMAGGED screen = MSG_MON_SCREEN_HACKED @@ -53,8 +53,10 @@ addtimer(CALLBACK(src, PROC_REF(unemag_console)), time) error_message = "%$&(£: Critical %$$@ Error // !RestArting! - ?pLeaSe wAit!" linkedServer.toggled = FALSE + return TRUE else to_chat(user, span_notice("A no server error appears on the screen.")) + return FALSE /// Remove the emag effect from the console /obj/machinery/computer/message_monitor/proc/unemag_console() diff --git a/code/game/objects/items/cigs_lighters.dm b/code/game/objects/items/cigs_lighters.dm index e19824d09d4..6e38c4fee59 100644 --- a/code/game/objects/items/cigs_lighters.dm +++ b/code/game/objects/items/cigs_lighters.dm @@ -1095,21 +1095,25 @@ CIGARETTE PACKETS ARE IN FANCY.DM if(screw && (obj_flags & EMAGGED)) to_chat(user, span_warning("[src] can't be modified!")) -/obj/item/clothing/mask/vape/emag_act(mob/user)// I WON'T REGRET WRITTING THIS, SURLY. - if(screw) - if(!(obj_flags & EMAGGED)) - obj_flags |= EMAGGED - super = FALSE - to_chat(user, span_warning("You maximize the voltage of [src].")) - icon_state = "vape_open_high" - set_greyscale(new_config = /datum/greyscale_config/vape/open_high) - var/datum/effect_system/spark_spread/sp = new /datum/effect_system/spark_spread //for effect - sp.set_up(5, 1, src) - sp.start() - else - to_chat(user, span_warning("[src] is already emagged!")) - else - to_chat(user, span_warning("You need to open the cap to do that!")) +/obj/item/clothing/mask/vape/emag_act(mob/user, obj/item/card/emag/emag_card) // I WON'T REGRET WRITTING THIS, SURLY. + + if (!screw) + balloon_alert(user, "open the cap first!") + return FALSE + + if (obj_flags & EMAGGED) + balloon_alert(user, "already emagged!") + return FALSE + + obj_flags |= EMAGGED + super = FALSE + balloon_alert(user, "voltage maximized") + icon_state = "vape_open_high" + set_greyscale(new_config = /datum/greyscale_config/vape/open_high) + var/datum/effect_system/spark_spread/sp = new /datum/effect_system/spark_spread //for effect + sp.set_up(5, 1, src) + sp.start() + return TRUE /obj/item/clothing/mask/vape/attack_self(mob/user) if(reagents.total_volume > 0) diff --git a/code/game/objects/items/circuitboards/computer_circuitboards.dm b/code/game/objects/items/circuitboards/computer_circuitboards.dm index d152629568c..09e1b59a620 100644 --- a/code/game/objects/items/circuitboards/computer_circuitboards.dm +++ b/code/game/objects/items/circuitboards/computer_circuitboards.dm @@ -487,11 +487,14 @@ else to_chat(user, span_alert("The spectrum chip is unresponsive.")) -/obj/item/circuitboard/computer/cargo/emag_act(mob/living/user) - if(!(obj_flags & EMAGGED)) - contraband = TRUE - obj_flags |= EMAGGED - to_chat(user, span_notice("You adjust [src]'s routing and receiver spectrum, unlocking special supplies and contraband.")) +/obj/item/circuitboard/computer/cargo/emag_act(mob/user, obj/item/card/emag/emag_card) + if (obj_flags & EMAGGED) + return FALSE + + contraband = TRUE + obj_flags |= EMAGGED + to_chat(user, span_notice("You adjust [src]'s routing and receiver spectrum, unlocking special supplies and contraband.")) + return TRUE /obj/item/circuitboard/computer/cargo/configure_machine(obj/machinery/computer/cargo/machine) if(!istype(machine)) @@ -507,20 +510,25 @@ name = "Express Supply Console" build_path = /obj/machinery/computer/cargo/express -/obj/item/circuitboard/computer/cargo/express/emag_act(mob/living/user) - if(!(obj_flags & EMAGGED)) - contraband = TRUE - obj_flags |= EMAGGED - to_chat(user, span_notice("You change the routing protocols, allowing the Drop Pod to land anywhere on the station.")) +/obj/item/circuitboard/computer/cargo/express/emag_act(mob/user, obj/item/card/emag/emag_card) + if (obj_flags & EMAGGED) + return FALSE + + contraband = TRUE + obj_flags |= EMAGGED + to_chat(user, span_notice("You change the routing protocols, allowing the Drop Pod to land anywhere on the station.")) + return TRUE /obj/item/circuitboard/computer/cargo/express/multitool_act(mob/living/user) if (!(obj_flags & EMAGGED)) contraband = !contraband to_chat(user, span_notice("Receiver spectrum set to [contraband ? "Broad" : "Standard"].")) + return TRUE else to_chat(user, span_notice("You reset the destination-routing protocols and receiver spectrum to factory defaults.")) contraband = FALSE obj_flags &= ~EMAGGED + return TRUE /obj/item/circuitboard/computer/cargo/request name = "Supply Request Console" diff --git a/code/game/objects/items/defib.dm b/code/game/objects/items/defib.dm index a21500d4198..920f858a19d 100644 --- a/code/game/objects/items/defib.dm +++ b/code/game/objects/items/defib.dm @@ -175,13 +175,14 @@ else return ..() -/obj/item/defibrillator/emag_act(mob/user) - if(safety) - safety = FALSE - to_chat(user, span_warning("You silently disable [src]'s safety protocols with the cryptographic sequencer.")) - else - safety = TRUE - to_chat(user, span_notice("You silently enable [src]'s safety protocols with the cryptographic sequencer.")) +/obj/item/defibrillator/emag_act(mob/user, obj/item/card/emag/emag_card) + + safety = !safety + + var/enabled_or_disabled = (safety ? "enabled" : "disabled") + balloon_alert(user, "safety protocols [enabled_or_disabled]") + + return TRUE /obj/item/defibrillator/emp_act(severity) . = ..() diff --git a/code/game/objects/items/devices/lightreplacer.dm b/code/game/objects/items/devices/lightreplacer.dm index b60c9aa0749..ab1e1774c5c 100644 --- a/code/game/objects/items/devices/lightreplacer.dm +++ b/code/game/objects/items/devices/lightreplacer.dm @@ -154,12 +154,14 @@ user.balloon_alert(user, "lights inserted") return TRUE -/obj/item/lightreplacer/emag_act() +/obj/item/lightreplacer/emag_act(mob/user, obj/item/card/emag/emag_card) if(obj_flags & EMAGGED) - return + return FALSE obj_flags |= EMAGGED playsound(loc, SFX_SPARKS, 100, TRUE, SHORT_RANGE_SOUND_EXTRARANGE) update_appearance() + to_chat(user, span_warning("[src]'s lights are now filled with plasma! Be careful to only install them in disabled light fixtures, lest they explode!")) + return FALSE /obj/item/lightreplacer/update_name(updates) . = ..() @@ -332,7 +334,7 @@ bluespace_toggle = TRUE /obj/item/lightreplacer/blue/emag_act() - return // balancing against longrange explosions + return FALSE // balancing against longrange explosions #undef GLASS_SHEET_USES #undef LIGHTBULB_COST diff --git a/code/game/objects/items/devices/megaphone.dm b/code/game/objects/items/devices/megaphone.dm index d8dd432371c..a2d325dfabd 100644 --- a/code/game/objects/items/devices/megaphone.dm +++ b/code/game/objects/items/devices/megaphone.dm @@ -38,12 +38,13 @@ spamcheck = world.time + 50 speech_args[SPEECH_SPANS] |= voicespan -/obj/item/megaphone/emag_act(mob/user) +/obj/item/megaphone/emag_act(mob/user, obj/item/card/emag/emag_card) if(obj_flags & EMAGGED) - return - to_chat(user, span_warning("You overload \the [src]'s voice synthesizer.")) + return FALSE + balloon_alert(user, "voice synthesizer overloaded") obj_flags |= EMAGGED voicespan = list(SPAN_REALLYBIG, "userdanger") + return TRUE /obj/item/megaphone/sec name = "security megaphone" diff --git a/code/game/objects/items/devices/radio/intercom.dm b/code/game/objects/items/devices/radio/intercom.dm index ca95cd13dff..0d759bf8a7a 100644 --- a/code/game/objects/items/devices/radio/intercom.dm +++ b/code/game/objects/items/devices/radio/intercom.dm @@ -129,6 +129,8 @@ AreaPowerCheck() // Make sure the area/local APC is powered first before we actually turn back on. /obj/item/radio/intercom/emag_act(mob/user, obj/item/card/emag/emag_card) + . = ..() + if(obj_flags & EMAGGED) return @@ -139,18 +141,18 @@ playsound(src, SFX_SPARKS, 75, TRUE, SILENCED_SOUND_EXTRARANGE) freqlock = RADIO_FREQENCY_UNLOCKED obj_flags |= EMAGGED + return TRUE // A fully locked one will do nothing, as locked is intended to be used for stuff that should never be changed if(RADIO_FREQENCY_LOCKED) balloon_alert(user, "can't override frequency lock!") playsound(src, 'sound/machines/buzz-two.ogg', 50, FALSE, SILENCED_SOUND_EXTRARANGE) + return // Emagging an unlocked one will do nothing, for now else return - return ..() - /obj/item/radio/intercom/update_icon_state() icon_state = on ? initial(icon_state) : "intercom-p" return ..() diff --git a/code/game/objects/items/rcd/RSF.dm b/code/game/objects/items/rcd/RSF.dm index ef5cedf77b0..8db8c2a9116 100644 --- a/code/game/objects/items/rcd/RSF.dm +++ b/code/game/objects/items/rcd/RSF.dm @@ -183,12 +183,13 @@ RSF ///Tracks whether or not the cookiesynth is about to print a poisoned cookie var/toxin = FALSE //This might be better suited to some initialize fuckery, but I don't have a good "poisoned" sprite -/obj/item/rsf/cookiesynth/emag_act(mob/user) +/obj/item/rsf/cookiesynth/emag_act(mob/user, obj/item/card/emag/emag_card) obj_flags ^= EMAGGED if(obj_flags & EMAGGED) - to_chat(user, span_warning("You short out [src]'s reagent safety checker!")) + balloon_alert(user, "reagent safety checker shorted out") else - to_chat(user, span_warning("You reset [src]'s reagent safety checker!")) + balloon_alert(user, "reagent safety checker reset") + return TRUE /obj/item/rsf/cookiesynth/attack_self(mob/user) var/mob/living/silicon/robot/P = null diff --git a/code/game/objects/items/robot/items/generic.dm b/code/game/objects/items/robot/items/generic.dm index ceda2a27cd6..a7477357779 100644 --- a/code/game/objects/items/robot/items/generic.dm +++ b/code/game/objects/items/robot/items/generic.dm @@ -298,12 +298,13 @@ /// Harm alarm cooldown COOLDOWN_DECLARE(alarm_cooldown) -/obj/item/harmalarm/emag_act(mob/user) +/obj/item/harmalarm/emag_act(mob/user, obj/item/card/emag/emag_card) obj_flags ^= EMAGGED if(obj_flags & EMAGGED) - to_chat(user, "You short out the safeties on [src]!") + balloon_alert(user, "safeties shorted") else - to_chat(user, "You reset the safeties on [src]!") + balloon_alert(user, "safeties reset") + return TRUE /obj/item/harmalarm/attack_self(mob/user) var/safety = !(obj_flags & EMAGGED) diff --git a/code/game/objects/items/storage/lockbox.dm b/code/game/objects/items/storage/lockbox.dm index 2ba7bdeccfe..f725e5c9da6 100644 --- a/code/game/objects/items/storage/lockbox.dm +++ b/code/game/objects/items/storage/lockbox.dm @@ -49,14 +49,16 @@ else balloon_alert(user, "locked!") -/obj/item/storage/lockbox/emag_act(mob/user) +/obj/item/storage/lockbox/emag_act(mob/user, obj/item/card/emag/emag_card) if(!broken) broken = TRUE atom_storage.locked = FALSE icon_state = src.icon_broken - if(user) - visible_message(span_warning("\The [src] is broken by [user] with an electromagnetic card!")) - return + balloon_alert(user, "lock destroyed") + if (emag_card && user) + user.visible_message(span_warning("[user] swipes [emag_card] over [src], breaking it!")) + return TRUE + return FALSE /obj/item/storage/lockbox/examine(mob/user) . = ..() diff --git a/code/game/objects/items/toys.dm b/code/game/objects/items/toys.dm index b84091ba2da..cb85f9e091b 100644 --- a/code/game/objects/items/toys.dm +++ b/code/game/objects/items/toys.dm @@ -815,11 +815,12 @@ to_chat(user, span_alert("Nothing happens, and '[round(timeleft/10)]' appears on the small display.")) sleep(0.5 SECONDS) -/obj/item/toy/nuke/emag_act(mob/user) +/obj/item/toy/nuke/emag_act(mob/user, obj/item/card/emag/emag_card) if (obj_flags & EMAGGED) - return - to_chat(user, span_warning("You short-circuit \the [src].")) + return FALSE + balloon_alert(user, "explosive simulation enabled") obj_flags |= EMAGGED + return TRUE /* * Fake meteor @@ -832,24 +833,21 @@ inhand_icon_state = "minimeteor" w_class = WEIGHT_CLASS_SMALL -/obj/item/toy/minimeteor/emag_act(mob/user) +/obj/item/toy/minimeteor/emag_act(mob/user, obj/item/card/emag/emag_card) if (obj_flags & EMAGGED) - return - to_chat(user, span_warning("You short-circuit whatever electronics exist inside \the [src], if there even are any.")) + return FALSE + to_chat(user, span_warning("You short circuit whatever electronics exist inside. The \"meteor\" suddenly feels a lot heavier...?")) + // not adding a balloon alert here since its hard to actually describe what this emag does in the balloon obj_flags |= EMAGGED + return TRUE /obj/item/toy/minimeteor/throw_impact(atom/hit_atom, datum/thrownthing/throwingdatum) + playsound(src, 'sound/effects/meteorimpact.ogg', 40, TRUE) + for(var/mob/M in urange(10, src)) + if(!M.stat && !isAI(M)) + shake_camera(M, 3, 1) if (obj_flags & EMAGGED) - playsound(src, 'sound/effects/meteorimpact.ogg', 40, TRUE) explosion(src, devastation_range = -1, heavy_impact_range = -1, light_impact_range = 1) - for(var/mob/M in urange(10, src)) - if(!M.stat && !isAI(M)) - shake_camera(M, 3, 1) - else - playsound(src, 'sound/effects/meteorimpact.ogg', 40, TRUE) - for(var/mob/M in urange(10, src)) - if(!M.stat && !isAI(M)) - shake_camera(M, 3, 1) /* * Toy big red button @@ -1608,11 +1606,12 @@ GLOBAL_LIST_EMPTY(intento_players) START_PROCESSING(SSfastprocess, src) COOLDOWN_START(src, next_icon_reset, TIME_TO_RESET_ICON) -/obj/item/toy/intento/emag_act(mob/user) +/obj/item/toy/intento/emag_act(mob/user, obj/item/card/emag/emag_card) if(obj_flags & EMAGGED) - return + return FALSE obj_flags |= EMAGGED - to_chat(user, span_notice("You short-circuit [src], activating the negative feedback loop.")) + balloon_alert(user, "negative feedback loop enabled") + return TRUE /obj/item/toy/intento/Destroy() STOP_PROCESSING(SSfastprocess, src) diff --git a/code/game/objects/structures/crates_lockers/closets.dm b/code/game/objects/structures/crates_lockers/closets.dm index ed331390a13..fc0f9e2937f 100644 --- a/code/game/objects/structures/crates_lockers/closets.dm +++ b/code/game/objects/structures/crates_lockers/closets.dm @@ -1052,16 +1052,16 @@ ) update_appearance() -/obj/structure/closet/emag_act(mob/user) +/obj/structure/closet/emag_act(mob/user, obj/item/card/emag/emag_card) if(secure && !broken) - if(user) - user.visible_message(span_warning("Sparks fly from [src]!"), - span_warning("You scramble [src]'s lock, breaking it open!"), - span_hear("You hear a faint electrical spark.")) + visible_message(span_warning("Sparks fly from [src]!"), blind_message = span_hear("You hear a faint electrical spark.")) + balloon_alert(user, "lock broken open") playsound(src, SFX_SPARKS, 50, TRUE, SHORT_RANGE_SOUND_EXTRARANGE) broken = TRUE locked = FALSE update_appearance() + return TRUE + return FALSE /obj/structure/closet/get_remote_view_fullscreens(mob/user) if(user.stat == DEAD || !(user.sight & (SEEOBJS|SEEMOBS))) diff --git a/code/game/objects/structures/displaycase.dm b/code/game/objects/structures/displaycase.dm index bec0376b7bd..c473e8c58ed 100644 --- a/code/game/objects/structures/displaycase.dm +++ b/code/game/objects/structures/displaycase.dm @@ -627,11 +627,13 @@ to_chat(user, span_notice("[src] must be open to move it.")) return -/obj/structure/displaycase/forsale/emag_act(mob/user) +/obj/structure/displaycase/forsale/emag_act(mob/user, obj/item/card/emag/emag_card) . = ..() payments_acc = null req_access = list() - to_chat(user, span_warning("[src]'s card reader fizzles and smokes, and the account owner is reset.")) + balloon_alert(user, "account owner reset") + to_chat(user, span_warning("[src]'s card reader fizzles and smokes.")) + return TRUE /obj/structure/displaycase/forsale/examine(mob/user) . = ..() diff --git a/code/game/objects/structures/morgue.dm b/code/game/objects/structures/morgue.dm index 8df7aa97b94..8f8a8033c73 100644 --- a/code/game/objects/structures/morgue.dm +++ b/code/game/objects/structures/morgue.dm @@ -218,12 +218,13 @@ GLOBAL_LIST_EMPTY(bodycontainers) //Let them act as spawnpoints for revenants an beeper = !beeper to_chat(user, span_notice("You turn the speaker function [beeper ? "on" : "off"].")) -/obj/structure/bodycontainer/morgue/emag_act(mob/user) +/obj/structure/bodycontainer/morgue/emag_act(mob/user, obj/item/card/emag/emag_card) if(obj_flags & EMAGGED) - return - to_chat(user, span_warning("You overload [src]'s alert system.")) + return FALSE + balloon_alert(user, "alert system overloaded") obj_flags |= EMAGGED update_appearance(UPDATE_ICON) + return TRUE /obj/structure/bodycontainer/morgue/update_icon_state() if(!connected || connected.loc != src) // Open or tray is gone. diff --git a/code/game/objects/structures/toiletbong.dm b/code/game/objects/structures/toiletbong.dm index 2393099b513..cb8d9830512 100644 --- a/code/game/objects/structures/toiletbong.dm +++ b/code/game/objects/structures/toiletbong.dm @@ -101,7 +101,11 @@ if(!emagged) emagged = TRUE smokeradius = 2 - to_chat(user, span_boldwarning("The [emag_card.name] falls into the toilet. You fish it back out. Looks like you broke the toilet.")) + balloon_alert(user, "toilet broke") + if (emag_card) + to_chat(user, span_boldwarning("The [emag_card] falls into the toilet. You fish it back out. Looks like you broke the toilet.")) + return TRUE + return FALSE /obj/structure/toiletbong/attackby(obj/item/I, mob/user, params) if(istype(I, /obj/item/card/emag)) diff --git a/code/game/objects/structures/training_machine.dm b/code/game/objects/structures/training_machine.dm index ed57fc3a841..b547d9476a9 100644 --- a/code/game/objects/structures/training_machine.dm +++ b/code/game/objects/structures/training_machine.dm @@ -314,7 +314,7 @@ /** * Emagging causes a deadly, unremovable syndicate toolbox to be attached to the machine */ -/obj/structure/training_machine/emag_act(mob/user) +/obj/structure/training_machine/emag_act(mob/user, obj/item/card/emag/emag_card) . = ..() if (obj_flags & EMAGGED) return @@ -324,6 +324,7 @@ to_chat(user, span_warning("You override the training machine's safety protocols, and activate its realistic combat feature. A toolbox pops out of a slot on the top.")) playsound(src, 'sound/machines/click.ogg', 50, TRUE) add_overlay("evil_trainer") + return TRUE /obj/structure/training_machine/examine(mob/user) . = ..() diff --git a/code/modules/antagonists/malf_ai/malf_ai_modules.dm b/code/modules/antagonists/malf_ai/malf_ai_modules.dm index a62a4344a14..384e21a3078 100644 --- a/code/modules/antagonists/malf_ai/malf_ai_modules.dm +++ b/code/modules/antagonists/malf_ai/malf_ai_modules.dm @@ -1014,6 +1014,101 @@ GLOBAL_LIST_INIT(malf_modules, subtypesof(/datum/ai_module)) if("name") say_name = params["name"] +/datum/ai_module/utility/emag + name = "Targetted Safeties Override" + description = "Allows you to disable the safeties of any machinery on the station, provided you can access it." + cost = 20 + power_type = /datum/action/innate/ai/ranged/emag + unlock_text = span_notice("You download an illicit software package from a syndicate database leak and integrate it into your firmware, fighting off a few kernel intrusions along the way.") + unlock_sound = SFX_SPARKS + +/datum/action/innate/ai/ranged/emag + name = "Targetted Safeties Override" + desc = "Allows you to effectively emag anything you click on." + button_icon = 'icons/obj/card.dmi' + button_icon_state = "emag" + uses = 7 + auto_use_uses = FALSE + enable_text = span_notice("You load your syndicate software package to your most recent memory slot.") + disable_text = span_notice("You unload your syndicate software package.") + ranged_mousepointer = 'icons/effects/mouse_pointers/supplypod_target.dmi' + +/datum/action/innate/ai/ranged/emag/Destroy() + return ..() + +/datum/action/innate/ai/ranged/emag/New() + . = ..() + desc = "[desc] It has [uses] use\s remaining." + +/datum/action/innate/ai/ranged/emag/do_ability(mob/living/caller, atom/clicked_on) + + // Only things with of or subtyped of any of these types may be remotely emagged + var/static/list/compatable_typepaths = list( + /obj/machinery, + /obj/structure, + /obj/item/radio/intercom, + /obj/item/modular_computer, + /mob/living/simple_animal/bot, + /mob/living/silicon, + ) + + if (!isAI(caller)) + return FALSE + var/mob/living/silicon/ai/ai_caller = caller + + if(ai_caller.incapacitated()) + unset_ranged_ability(caller) + return FALSE + + if (!ai_caller.can_see(clicked_on)) + clicked_on.balloon_alert(ai_caller, "can't see!") + return FALSE + + if (ismachinery(clicked_on)) + var/obj/machinery/clicked_machine = clicked_on + if (!clicked_machine.is_operational) + clicked_machine.balloon_alert(ai_caller, "not operational!") + return FALSE + + if (!(is_type_in_list(clicked_on.type, compatable_typepaths))) + clicked_on.balloon_alert(ai_caller, "incompatable!") + return FALSE + + if (istype(clicked_on, /obj/machinery/door/airlock)) // I HATE THIS CODE SO MUCHHH + var/obj/machinery/door/airlock/clicked_airlock = clicked_on + if (!clicked_airlock.canAIControl(ai_caller)) + clicked_airlock.balloon_alert(ai_caller, "unable to interface!") + return FALSE + + if (istype(clicked_on, /obj/machinery/airalarm)) + var/obj/machinery/airalarm/alarm = clicked_on + if (alarm.aidisabled) + alarm.balloon_alert(ai_caller, "unable to interface!") + return FALSE + + if (istype(clicked_on, /obj/machinery/power/apc)) + var/obj/machinery/power/apc/clicked_apc = clicked_on + if (clicked_apc.aidisabled) + clicked_apc.balloon_alert(ai_caller, "unable to interface!") + return FALSE + + if (!clicked_on.emag_act(ai_caller)) + to_chat(ai_caller, span_warning("Hostile software insertion failed!")) // lets not overlap balloon alerts + return FALSE + + to_chat(ai_caller, span_notice("Software package successfully injected.")) + + adjust_uses(-1) + if(uses) + desc = "[initial(desc)] It has [uses] use\s remaining." + build_all_button_icons() + else + unset_ranged_ability(ai_caller, span_warning("Out of uses!")) + + return TRUE + + + #undef DEFAULT_DOOMSDAY_TIMER #undef DOOMSDAY_ANNOUNCE_INTERVAL diff --git a/code/modules/atmospherics/machinery/air_alarm/air_alarm_interact.dm b/code/modules/atmospherics/machinery/air_alarm/air_alarm_interact.dm index c74a3ce78bb..d5eda766a99 100644 --- a/code/modules/atmospherics/machinery/air_alarm/air_alarm_interact.dm +++ b/code/modules/atmospherics/machinery/air_alarm/air_alarm_interact.dm @@ -82,12 +82,14 @@ to_chat(user, span_danger("Access denied.")) return -/obj/machinery/airalarm/emag_act(mob/user) +/obj/machinery/airalarm/emag_act(mob/user, obj/item/card/emag/emag_card) if(obj_flags & EMAGGED) - return + return FALSE obj_flags |= EMAGGED - visible_message(span_warning("Sparks fly out of [src]!"), span_notice("You emag [src], disabling its safeties.")) + visible_message(span_warning("Sparks fly out of [src]!")) + balloon_alert(user, "authentication sensors scrambled") playsound(src, SFX_SPARKS, 50, TRUE, SHORT_RANGE_SOUND_EXTRARANGE) + return TRUE /obj/machinery/airalarm/deconstruct(disassembled = TRUE) if(!(flags_1 & NODECONSTRUCT_1)) diff --git a/code/modules/balloon_alert/balloon_alert.dm b/code/modules/balloon_alert/balloon_alert.dm index b814491e41c..db8c5291986 100644 --- a/code/modules/balloon_alert/balloon_alert.dm +++ b/code/modules/balloon_alert/balloon_alert.dm @@ -8,7 +8,13 @@ /// The amount of characters needed before this increase takes into effect #define BALLOON_TEXT_CHAR_LIFETIME_INCREASE_MIN 10 -/// Creates text that will float from the atom upwards to the viewer. +/** + * Creates text that will float from the atom upwards to the viewer. + * + * Args: + * * mob/viewer: The mob the text will be shown to. Nullable (But only in the form of it won't runtime). + * * text: The text to be shown to viewer. Must not be null. + */ /atom/proc/balloon_alert(mob/viewer, text) SHOULD_NOT_SLEEP(TRUE) @@ -34,7 +40,7 @@ // if this would look bad on laggy clients. /atom/proc/balloon_alert_perform(mob/viewer, text) - var/client/viewer_client = viewer.client + var/client/viewer_client = viewer?.client if (isnull(viewer_client)) return diff --git a/code/modules/cargo/expressconsole.dm b/code/modules/cargo/expressconsole.dm index 0614d4b7de8..a449c841495 100644 --- a/code/modules/cargo/expressconsole.dm +++ b/code/modules/cargo/expressconsole.dm @@ -52,12 +52,13 @@ to_chat(user, span_alert("[src] is already linked to [sb].")) ..() -/obj/machinery/computer/cargo/express/emag_act(mob/living/user) +/obj/machinery/computer/cargo/express/emag_act(mob/user, obj/item/card/emag/emag_card) if(obj_flags & EMAGGED) - return + return FALSE if(user) - user.visible_message(span_warning("[user] swipes a suspicious card through [src]!"), - span_notice("You change the routing protocols, allowing the Supply Pod to land anywhere on the station.")) + if (emag_card) + user.visible_message(span_warning("[user] swipes [emag_card] through [src]!")) + to_chat(user, span_notice("You change the routing protocols, allowing the Supply Pod to land anywhere on the station.")) obj_flags |= EMAGGED contraband = TRUE // This also sets this on the circuit board @@ -65,6 +66,7 @@ board.obj_flags |= EMAGGED board.contraband = TRUE packin_up() + return TRUE /obj/machinery/computer/cargo/express/proc/packin_up() // oh shit, I'm sorry meme_pack_data = list() // sorry for what? diff --git a/code/modules/cargo/orderconsole.dm b/code/modules/cargo/orderconsole.dm index 57737899643..1fe61a4172e 100644 --- a/code/modules/cargo/orderconsole.dm +++ b/code/modules/cargo/orderconsole.dm @@ -62,12 +62,13 @@ else return ..() -/obj/machinery/computer/cargo/emag_act(mob/user) +/obj/machinery/computer/cargo/emag_act(mob/user, obj/item/card/emag/emag_card) if(obj_flags & EMAGGED) - return + return FALSE if(user) - user.visible_message(span_warning("[user] swipes a suspicious card through [src]!"), - span_notice("You adjust [src]'s routing and receiver spectrum, unlocking special supplies and contraband.")) + if (emag_card) + user.visible_message(span_warning("[user] swipes [emag_card] through [src]!")) + to_chat(user, span_notice("You adjust [src]'s routing and receiver spectrum, unlocking special supplies and contraband.")) obj_flags |= EMAGGED contraband = TRUE @@ -77,6 +78,7 @@ board.contraband = TRUE board.obj_flags |= EMAGGED update_static_data(user) + return TRUE /obj/machinery/computer/cargo/on_construction(mob/user) . = ..() diff --git a/code/modules/clothing/glasses/hud.dm b/code/modules/clothing/glasses/hud.dm index b697400bdb9..2233e639a43 100644 --- a/code/modules/clothing/glasses/hud.dm +++ b/code/modules/clothing/glasses/hud.dm @@ -33,12 +33,13 @@ obj_flags |= EMAGGED desc = "[desc] The display is flickering slightly." -/obj/item/clothing/glasses/hud/emag_act(mob/user) +/obj/item/clothing/glasses/hud/emag_act(mob/user, obj/item/card/emag/emag_card) if(obj_flags & EMAGGED) - return + return FALSE obj_flags |= EMAGGED - to_chat(user, span_warning("PZZTTPFFFT")) + balloon_alert(user, "display scrambled") desc = "[desc] The display is flickering slightly." + return TRUE /obj/item/clothing/glasses/hud/suicide_act(mob/living/user) if(user.is_blind()) diff --git a/code/modules/clothing/masks/hailer.dm b/code/modules/clothing/masks/hailer.dm index f129aecf5e6..af1d3975645 100644 --- a/code/modules/clothing/masks/hailer.dm +++ b/code/modules/clothing/masks/hailer.dm @@ -126,11 +126,12 @@ GLOBAL_LIST_INIT(hailer_phrases, list( /obj/item/clothing/mask/gas/sechailer/attack_self() halt() -/obj/item/clothing/mask/gas/sechailer/emag_act(mob/user) +/obj/item/clothing/mask/gas/sechailer/emag_act(mob/user, obj/item/card/emag/emag_card) if(safety) safety = FALSE - to_chat(user, span_warning("You silently fry [src]'s vocal circuit.")) - return ..() + balloon_alert(user, "vocal circuit fried") + return TRUE + return FALSE /obj/item/clothing/mask/gas/sechailer/verb/halt() set category = "Object" diff --git a/code/modules/clothing/spacesuits/_spacesuits.dm b/code/modules/clothing/spacesuits/_spacesuits.dm index 656e0f3734b..de329eedd10 100644 --- a/code/modules/clothing/spacesuits/_spacesuits.dm +++ b/code/modules/clothing/spacesuits/_spacesuits.dm @@ -254,12 +254,15 @@ toggle_spacesuit(user) // let emags override the temperature settings -/obj/item/clothing/suit/space/emag_act(mob/user) - if(!(obj_flags & EMAGGED)) - obj_flags |= EMAGGED - user.visible_message(span_warning("You emag [src], overwriting thermal regulator restrictions.")) +/obj/item/clothing/suit/space/emag_act(mob/user, obj/item/card/emag/emag_card) + if(obj_flags & EMAGGED) + return FALSE + obj_flags |= EMAGGED + if (user) + balloon_alert(user, "thermal regulator restrictions overridden") user.log_message("emagged [src], overwriting thermal regulator restrictions.", LOG_GAME) playsound(src, SFX_SPARKS, 50, TRUE, SHORT_RANGE_SOUND_EXTRARANGE) + return TRUE // update the HUD icon /obj/item/clothing/suit/space/proc/update_hud_icon(mob/user) diff --git a/code/modules/experisci/destructive_scanner.dm b/code/modules/experisci/destructive_scanner.dm index 596e230a15a..69ead56414e 100644 --- a/code/modules/experisci/destructive_scanner.dm +++ b/code/modules/experisci/destructive_scanner.dm @@ -87,12 +87,13 @@ SEND_SIGNAL(src, COMSIG_MACHINERY_DESTRUCTIVE_SCAN, scanned_atoms) -/obj/machinery/destructive_scanner/emag_act(mob/user) +/obj/machinery/destructive_scanner/emag_act(mob/user, obj/item/card/emag/emag_card) if(obj_flags & EMAGGED) - return + return FALSE obj_flags |= EMAGGED playsound(src, SFX_SPARKS, 75, TRUE, SILENCED_SOUND_EXTRARANGE) - to_chat(user, span_notice("You disable the safety sensor BIOS on [src].")) + balloon_alert(user, "safety sensor BIOS disabled") + return TRUE /obj/machinery/destructive_scanner/update_icon_state() . = ..() diff --git a/code/modules/holodeck/computer.dm b/code/modules/holodeck/computer.dm index 9103ad3ebc7..25f40baee4b 100644 --- a/code/modules/holodeck/computer.dm +++ b/code/modules/holodeck/computer.dm @@ -399,19 +399,23 @@ GLOBAL_LIST_INIT(typecache_holodeck_linked_floorcheck_ok, typecacheof(list(/turf for(var/obj/effect/holodeck_effect/holo_effect as anything in effects) holo_effect.safety(nerf_this) -/obj/machinery/computer/holodeck/emag_act(mob/user) +/obj/machinery/computer/holodeck/emag_act(mob/user, obj/item/card/emag/emag_card) if(obj_flags & EMAGGED) - return + return FALSE if(!LAZYLEN(emag_programs)) - to_chat(user, "[src] does not seem to have a card swipe port. It must be an inferior model.") - return + balloon_alert(user, "no card swipe port!") + return FALSE playsound(src, SFX_SPARKS, 75, TRUE) obj_flags |= EMAGGED - to_chat(user, span_warning("You vastly increase projector power and override the safety and security protocols.")) + if (user) + balloon_alert(user, "safety protocols destroyed") // im gonna keep this once since this perfectly describes it, and the to_chat is just flavor + to_chat(user, span_warning("You vastly increase projector power and override the safety and security protocols.")) + user.log_message("emagged the Holodeck Control Console.", LOG_GAME) + message_admins("[ADMIN_LOOKUPFLW(user)] emagged the Holodeck Control Console.") + say("Warning. Automatic shutoff and derezzing protocols have been corrupted. Please call Nanotrasen maintenance and do not use the simulator.") - user.log_message("emagged the Holodeck Control Console.", LOG_GAME) - message_admins("[ADMIN_LOOKUPFLW(user)] emagged the Holodeck Control Console.") nerf(!(obj_flags & EMAGGED),FALSE) + return TRUE /obj/machinery/computer/holodeck/emp_act(severity) . = ..() diff --git a/code/modules/industrial_lift/elevator/elevator_controller.dm b/code/modules/industrial_lift/elevator/elevator_controller.dm index 41c845c4ef9..9d8a18ed798 100644 --- a/code/modules/industrial_lift/elevator/elevator_controller.dm +++ b/code/modules/industrial_lift/elevator/elevator_controller.dm @@ -46,12 +46,12 @@ MAPPING_DIRECTIONAL_HELPERS(/obj/machinery/button/elevator, 32) // Emagging elevator buttons will disable safeties /obj/item/assembly/control/elevator/emag_act(mob/user, obj/item/card/emag/emag_card) if(obj_flags & EMAGGED) - return + return FALSE obj_flags |= EMAGGED var/datum/lift_master/lift = lift_weakref?.resolve() if(!lift) - return + return FALSE for(var/obj/structure/industrial_lift/lift_platform as anything in lift.lift_platforms) lift_platform.violent_landing = TRUE @@ -71,6 +71,7 @@ MAPPING_DIRECTIONAL_HELPERS(/obj/machinery/button/elevator, 32) // or by someone emagging the assembly directly after removing it (to be cheeky) var/atom/balloon_alert_loc = get(src, /obj/machinery/button) || src balloon_alert_loc.balloon_alert(user, "safeties overridden") + return TRUE // Multitooling emagged elevator buttons will fix the safeties /obj/item/assembly/control/elevator/multitool_act(mob/living/user) diff --git a/code/modules/industrial_lift/elevator/elevator_panel.dm b/code/modules/industrial_lift/elevator/elevator_panel.dm index ee137f7c36d..8791c885a50 100644 --- a/code/modules/industrial_lift/elevator/elevator_panel.dm +++ b/code/modules/industrial_lift/elevator/elevator_panel.dm @@ -98,13 +98,13 @@ /obj/machinery/elevator_control_panel/emag_act(mob/user, obj/item/card/emag/emag_card) if(obj_flags & EMAGGED) - return + return FALSE obj_flags |= EMAGGED var/datum/lift_master/lift = lift_weakref?.resolve() if(!lift) - return + return FALSE for(var/obj/structure/industrial_lift/lift_platform as anything in lift.lift_platforms) lift_platform.violent_landing = TRUE @@ -122,6 +122,7 @@ playsound(src, SFX_SPARKS, 100, TRUE, SHORT_RANGE_SOUND_EXTRARANGE) balloon_alert(user, "safeties overridden") + return TRUE /obj/machinery/elevator_control_panel/multitool_act(mob/living/user) var/datum/lift_master/lift = lift_weakref?.resolve() diff --git a/code/modules/industrial_lift/tram/tram_doors.dm b/code/modules/industrial_lift/tram/tram_doors.dm index 89c33757407..7d8a79f6ee3 100644 --- a/code/modules/industrial_lift/tram/tram_doors.dm +++ b/code/modules/industrial_lift/tram/tram_doors.dm @@ -25,11 +25,12 @@ icon_state = "windoor" base_state = "windoor" -/obj/machinery/door/window/tram/emag_act(mob/living/user) +/obj/machinery/door/window/tram/emag_act(mob/user, obj/item/card/emag/emag_card) if(obj_flags & EMAGGED) - return + return FALSE balloon_alert(user, "disabled motion sensors") obj_flags |= EMAGGED + return TRUE /// Random event called by code\modules\events\tram_malfunction.dm /// Makes the doors malfunction diff --git a/code/modules/industrial_lift/tram/tram_machinery.dm b/code/modules/industrial_lift/tram/tram_machinery.dm index 159dd25d025..1a092052229 100644 --- a/code/modules/industrial_lift/tram/tram_machinery.dm +++ b/code/modules/industrial_lift/tram/tram_machinery.dm @@ -391,13 +391,14 @@ GLOBAL_LIST_EMPTY(tram_doors) if(tram_part) UnregisterSignal(tram_part, COMSIG_TRAM_SET_TRAVELLING) -/obj/machinery/crossing_signal/emag_act(mob/living/user) +/obj/machinery/crossing_signal/emag_act(mob/user, obj/item/card/emag/emag_card) if(obj_flags & EMAGGED) - return + return FALSE balloon_alert(user, "disabled motion sensors") if(signal_state != XING_STATE_MALF) set_signal_state(XING_STATE_MALF) obj_flags |= EMAGGED + return TRUE /obj/machinery/crossing_signal/proc/start_malfunction() if(signal_state != XING_STATE_MALF) diff --git a/code/modules/library/lib_machines.dm b/code/modules/library/lib_machines.dm index 0f6b94cd003..bfdf5a5b868 100644 --- a/code/modules/library/lib_machines.dm +++ b/code/modules/library/lib_machines.dm @@ -554,10 +554,12 @@ GLOBAL_VAR_INIT(library_table_modified, 0) balloon_alert(user, "scanner connected") audible_message(span_hear("[src] lets out a low, short blip.")) -/obj/machinery/computer/libraryconsole/bookmanagement/emag_act(mob/user) - if(!density) - return +/obj/machinery/computer/libraryconsole/bookmanagement/emag_act(mob/user, obj/item/card/emag/emag_card) + if(!density || obj_flags & EMAGGED) + return FALSE obj_flags |= EMAGGED + balloon_alert(user, "forbidden knowledge unlocked") + return TRUE /obj/machinery/computer/libraryconsole/bookmanagement/proc/set_screen_state(new_state) screen_state = clamp(new_state, MIN_LIBRARY, MAX_LIBRARY) diff --git a/code/modules/mining/abandoned_crates.dm b/code/modules/mining/abandoned_crates.dm index f0f95b4d64e..8d514501791 100644 --- a/code/modules/mining/abandoned_crates.dm +++ b/code/modules/mining/abandoned_crates.dm @@ -100,11 +100,13 @@ return return ..() -/obj/structure/closet/crate/secure/loot/emag_act(mob/user) +/obj/structure/closet/crate/secure/loot/emag_act(mob/user, obj/item/card/emag/emag_card) + . = ..() + if(locked) - boom(user) - return - return ..() + boom(user) // no feedback since it just explodes, thats its own feedback + return TRUE + return /obj/structure/closet/crate/secure/loot/togglelock(mob/user, silent = FALSE) if(!locked) diff --git a/code/modules/mining/laborcamp/laborstacker.dm b/code/modules/mining/laborcamp/laborstacker.dm index 3733e20554d..8a7ffeec88f 100644 --- a/code/modules/mining/laborcamp/laborstacker.dm +++ b/code/modules/mining/laborcamp/laborstacker.dm @@ -129,10 +129,15 @@ GLOBAL_LIST(labor_sheet_values) if(stacking_machine) stacking_machine.labor_console = src -/obj/machinery/mineral/labor_claim_console/emag_act(mob/user) - if(!(obj_flags & EMAGGED)) - obj_flags |= EMAGGED - to_chat(user, span_warning("PZZTTPFFFT")) +/obj/machinery/mineral/labor_claim_console/emag_act(mob/user, obj/item/card/emag/emag_card) + if (obj_flags & EMAGGED) + return FALSE + + obj_flags |= EMAGGED + balloon_alert(user, "id authenticator short-circuited") + visible_message(span_warning("[src] lets out a few sparks!")) + do_sparks(2, TRUE, src) + return TRUE /**********************Prisoner Collection Unit**************************/ diff --git a/code/modules/mob/living/carbon/human/species_types/ethereal.dm b/code/modules/mob/living/carbon/human/species_types/ethereal.dm index 6e290438b96..c2878fa5329 100644 --- a/code/modules/mob/living/carbon/human/species_types/ethereal.dm +++ b/code/modules/mob/living/carbon/human/species_types/ethereal.dm @@ -140,13 +140,14 @@ /datum/species/ethereal/proc/on_emag_act(mob/living/carbon/human/H, mob/user) SIGNAL_HANDLER if(emageffect) - return + return FALSE emageffect = TRUE if(user) to_chat(user, span_notice("You tap [H] on the back with your card.")) H.visible_message(span_danger("[H] starts flickering in an array of colors!")) handle_emag(H) addtimer(CALLBACK(src, PROC_REF(stop_emag), H), 2 MINUTES) //Disco mode for 2 minutes! This doesn't affect the ethereal at all besides either annoying some players, or making someone look badass. + return TRUE /// Special handling for getting hit with a light eater /datum/species/ethereal/proc/on_light_eater(mob/living/carbon/human/source, datum/light_eater) diff --git a/code/modules/mob/living/silicon/ai/ai_defense.dm b/code/modules/mob/living/silicon/ai/ai_defense.dm index 34d0f3c0ed4..ae17e13f269 100644 --- a/code/modules/mob/living/silicon/ai/ai_defense.dm +++ b/code/modules/mob/living/silicon/ai/ai_defense.dm @@ -61,14 +61,17 @@ /mob/living/silicon/ai/flash_act(intensity = 1, override_blindness_check = 0, affect_silicon = 0, visual = 0, type = /atom/movable/screen/fullscreen/flash, length = 25) return // no eyes, no flashing -/mob/living/silicon/ai/emag_act(mob/user, obj/item/card/emag/emag_card)///emags access panel lock, so you can crowbar it without robotics access or consent +/mob/living/silicon/ai/emag_act(mob/user, obj/item/card/emag/emag_card) ///emags access panel lock, so you can crowbar it without robotics access or consent . = ..() if(emagged) balloon_alert(user, "access panel lock already shorted!") return balloon_alert(user, "access panel lock shorted") - to_chat(src, span_warning("[user] shorts out your access panel lock!")) + var/message = (user ? "[user] shorts out your access panel lock!" : "Your access panel lock was short circuited!") + to_chat(src, span_warning(message)) + do_sparks(3, FALSE, src) // just a bit of extra "oh shit" to the ai - might grab its attention emagged = TRUE + return TRUE /mob/living/silicon/ai/wrench_act(mob/living/user, obj/item/tool) . = ..() diff --git a/code/modules/mob/living/silicon/robot/robot_defense.dm b/code/modules/mob/living/silicon/robot/robot_defense.dm index f8f4c0bdad6..b4147e76fe1 100644 --- a/code/modules/mob/living/silicon/robot/robot_defense.dm +++ b/code/modules/mob/living/silicon/robot/robot_defense.dm @@ -324,25 +324,27 @@ GLOBAL_LIST_INIT(blacklisted_borg_hats, typecacheof(list( //Hats that don't real if(2) Stun(60) -/mob/living/silicon/robot/emag_act(mob/user) +/mob/living/silicon/robot/emag_act(mob/user, obj/item/card/emag/emag_card) if(user == src)//To prevent syndieborgs from emagging themselves - return + return FALSE if(!opened)//Cover is closed if(locked) - to_chat(user, span_notice("You emag the cover lock.")) + balloon_alert(user, "cover lock destroyed") locked = FALSE if(shell) //A warning to Traitors who may not know that emagging AI shells does not slave them. + balloon_alert(user, "shells cannot be subverted!") to_chat(user, span_boldwarning("[src] seems to be controlled remotely! Emagging the interface may not work as expected.")) + return TRUE else - to_chat(user, span_warning("The cover is already unlocked!")) - return + balloon_alert(user, "cover already unlocked!") + return FALSE if(world.time < emag_cooldown) - return + return FALSE if(wiresexposed) - to_chat(user, span_warning("You must unexpose the wires first!")) - return + balloon_alert(user, "expose the fires first!") + return FALSE - to_chat(user, span_notice("You emag [src]'s interface.")) + balloon_alert(user, "interface hacked") emag_cooldown = world.time + 100 if(connected_ai && connected_ai.mind && connected_ai.mind.has_antag_datum(/datum/antagonist/malf_ai)) @@ -350,13 +352,13 @@ GLOBAL_LIST_INIT(blacklisted_borg_hats, typecacheof(list( //Hats that don't real logevent("ALERT: Foreign software execution prevented.") to_chat(connected_ai, span_danger("ALERT: Cyborg unit \[[src]\] successfully defended against subversion.")) log_silicon("EMAG: [key_name(user)] attempted to emag cyborg [key_name(src)], but they were slaved to traitor AI [connected_ai].") - return + return TRUE // emag succeeded, it was just counteracted if(shell) //AI shells cannot be emagged, so we try to make it look like a standard reset. Smart players may see through this, however. to_chat(user, span_danger("[src] is remotely controlled! Your emag attempt has triggered a system reset instead!")) log_silicon("EMAG: [key_name(user)] attempted to emag an AI shell belonging to [key_name(src) ? key_name(src) : connected_ai]. The shell has been reset as a result.") ResetModel() - return + return TRUE SetEmagged(1) SetStun(60) //Borgs were getting into trouble because they would attack the emagger before the new laws were shown @@ -369,6 +371,12 @@ GLOBAL_LIST_INIT(blacklisted_borg_hats, typecacheof(list( //Hats that don't real GLOB.lawchanges.Add("[time] : [user.name]([user.key]) emagged [name]([key])") else GLOB.lawchanges.Add("[time] : [name]([key]) emagged by external event.") + + INVOKE_ASYNC(src, PROC_REF(borg_emag_end), user) + return TRUE + +/// A async proc called from [emag_act] that gives the borg a lot of flavortext, and applies the syndicate lawset after a delay. +/mob/living/silicon/robot/proc/borg_emag_end(mob/user) to_chat(src, span_danger("ALERT: Foreign software detected.")) logevent("ALERT: Foreign software detected.") sleep(0.5 SECONDS) @@ -393,7 +401,6 @@ GLOBAL_LIST_INIT(blacklisted_borg_hats, typecacheof(list( //Hats that don't real laws.associate(src) update_icons() - /mob/living/silicon/robot/blob_act(obj/structure/blob/B) if(stat != DEAD) adjustBruteLoss(30) diff --git a/code/modules/mob/living/simple_animal/bot/bot.dm b/code/modules/mob/living/simple_animal/bot/bot.dm index 3275cbcf87c..f6bc85442a5 100644 --- a/code/modules/mob/living/simple_animal/bot/bot.dm +++ b/code/modules/mob/living/simple_animal/bot/bot.dm @@ -240,8 +240,8 @@ . = ..() if(bot_cover_flags & BOT_COVER_LOCKED) //First emag application unlocks the bot's interface. Apply a screwdriver to use the emag again. bot_cover_flags &= ~BOT_COVER_LOCKED - to_chat(user, span_notice("You bypass [src]'s [hackables].")) - return + balloon_alert(user, "cover unlocked") + return TRUE if(!(bot_cover_flags & BOT_COVER_LOCKED) && bot_cover_flags & BOT_COVER_OPEN) //Bot panel is unlocked by ID or emag, and the panel is screwed open. Ready for emagging. bot_cover_flags |= BOT_COVER_EMAGGED bot_cover_flags &= ~BOT_COVER_LOCKED //Manually emagging the bot locks out the panel. @@ -251,9 +251,10 @@ to_chat(src, span_userdanger("(#$*#$^^( OVERRIDE DETECTED")) if(user) log_combat(user, src, "emagged") - return + return TRUE else //Bot is unlocked, but the maint panel has not been opened with a screwdriver (or through the UI) yet. - to_chat(user, span_warning("You need to open maintenance panel first!")) + balloon_alert(user, "open maintenance panel first!") + return FALSE /mob/living/simple_animal/bot/examine(mob/user) . = ..() diff --git a/code/modules/mob/living/simple_animal/bot/cleanbot.dm b/code/modules/mob/living/simple_animal/bot/cleanbot.dm index a73369b8457..1a52c33a32f 100644 --- a/code/modules/mob/living/simple_animal/bot/cleanbot.dm +++ b/code/modules/mob/living/simple_animal/bot/cleanbot.dm @@ -229,9 +229,10 @@ if(weapon) weapon.force = initial(weapon.force) - if(user) - to_chat(user, span_danger("[src] buzzes and beeps.")) + balloon_alert(user, "safeties disabled") + audible_message(span_danger("[src] buzzes oddly!")) get_targets() //recalibrate target list + return TRUE /mob/living/simple_animal/bot/cleanbot/process_scan(atom/scan_target) if(iscarbon(scan_target)) diff --git a/code/modules/mob/living/simple_animal/bot/ed209bot.dm b/code/modules/mob/living/simple_animal/bot/ed209bot.dm index 5facdc1ac16..7e2f6d04367 100644 --- a/code/modules/mob/living/simple_animal/bot/ed209bot.dm +++ b/code/modules/mob/living/simple_animal/bot/ed209bot.dm @@ -26,10 +26,13 @@ ..() set_weapon() -/mob/living/simple_animal/bot/secbot/ed209/emag_act(mob/user) - ..() +/mob/living/simple_animal/bot/secbot/ed209/emag_act(mob/user, obj/item/card/emag/emag_card) + . = ..() icon_state = "ed209[get_bot_flag(bot_mode_flags, BOT_MODE_ON)]" set_weapon() + balloon_alert(user, "safeties disabled") + audible_message(span_bolddanger("[src] buzzes menacingly!")) + return TRUE /mob/living/simple_animal/bot/secbot/ed209/handle_automated_action() var/judgement_criteria = judgement_criteria() diff --git a/code/modules/mob/living/simple_animal/bot/firebot.dm b/code/modules/mob/living/simple_animal/bot/firebot.dm index 64aafb8071b..6746ab958cd 100644 --- a/code/modules/mob/living/simple_animal/bot/firebot.dm +++ b/code/modules/mob/living/simple_animal/bot/firebot.dm @@ -103,12 +103,13 @@ last_found = world.time update_appearance() -/mob/living/simple_animal/bot/firebot/emag_act(mob/user) - ..() +/mob/living/simple_animal/bot/firebot/emag_act(mob/user, obj/item/card/emag/emag_card) + . = ..() if(!(bot_cover_flags & BOT_COVER_EMAGGED)) return - if(user) - to_chat(user, span_danger("[src] buzzes and beeps.")) + + to_chat(user, span_warning("You enable the very ironically named \"fighting with fire\" mode, and disable the targetting safeties.")) // heheehe. funny + audible_message(span_danger("[src] buzzes oddly!")) playsound(src, SFX_SPARKS, 75, TRUE, SHORT_RANGE_SOUND_EXTRARANGE) if(user) @@ -123,6 +124,7 @@ internal_ext.precision = FALSE internal_ext.max_water = INFINITY internal_ext.refill() + return TRUE // Variables sent to TGUI /mob/living/simple_animal/bot/firebot/ui_data(mob/user) diff --git a/code/modules/mob/living/simple_animal/bot/floorbot.dm b/code/modules/mob/living/simple_animal/bot/floorbot.dm index 7a1fd85f37a..a6e0413b245 100644 --- a/code/modules/mob/living/simple_animal/bot/floorbot.dm +++ b/code/modules/mob/living/simple_animal/bot/floorbot.dm @@ -100,12 +100,13 @@ else ..() -/mob/living/simple_animal/bot/floorbot/emag_act(mob/user) - ..() +/mob/living/simple_animal/bot/floorbot/emag_act(mob/user, obj/item/card/emag/emag_card) + . = ..() if(!(bot_cover_flags & BOT_COVER_EMAGGED)) return - if(user) - to_chat(user, span_danger("[src] buzzes and beeps.")) + balloon_alert(user, "safeties disabled") + audible_message(span_danger("[src] buzzes oddly!")) + return TRUE ///mobs should use move_resist instead of anchored. /mob/living/simple_animal/bot/floorbot/proc/toggle_magnet(engage = TRUE, change_icon = TRUE) diff --git a/code/modules/mob/living/simple_animal/bot/medbot.dm b/code/modules/mob/living/simple_animal/bot/medbot.dm index 8be8b70cd2c..a02597ca509 100644 --- a/code/modules/mob/living/simple_animal/bot/medbot.dm +++ b/code/modules/mob/living/simple_animal/bot/medbot.dm @@ -226,18 +226,18 @@ if(health < current_health) //if medbot took some damage step_to(src, (get_step_away(src,user))) -/mob/living/simple_animal/bot/medbot/emag_act(mob/user) - ..() +/mob/living/simple_animal/bot/medbot/emag_act(mob/user, obj/item/card/emag/emag_card) + . = ..() if(!(bot_cover_flags & BOT_COVER_EMAGGED)) return medical_mode_flags &= ~MEDBOT_DECLARE_CRIT - if(user) - to_chat(user, span_notice("You short out [src]'s reagent synthesis circuits.")) + balloon_alert(user, "reagent synthesis circuits shorted") audible_message(span_danger("[src] buzzes oddly!")) flick("medibot_spark", src) playsound(src, SFX_SPARKS, 75, TRUE, SHORT_RANGE_SOUND_EXTRARANGE) if(user) oldpatient = user + return TRUE /mob/living/simple_animal/bot/medbot/process_scan(mob/living/carbon/human/H) if(H.stat == DEAD) diff --git a/code/modules/mob/living/simple_animal/bot/mulebot.dm b/code/modules/mob/living/simple_animal/bot/mulebot.dm index fcfefe5e2cc..2e1f2416f58 100644 --- a/code/modules/mob/living/simple_animal/bot/mulebot.dm +++ b/code/modules/mob/living/simple_animal/bot/mulebot.dm @@ -188,14 +188,15 @@ else return ..() -/mob/living/simple_animal/bot/mulebot/emag_act(mob/user) +/mob/living/simple_animal/bot/mulebot/emag_act(mob/user, obj/item/card/emag/emag_card) if(!(bot_cover_flags & BOT_COVER_EMAGGED)) bot_cover_flags |= BOT_COVER_EMAGGED if(!(bot_cover_flags & BOT_COVER_OPEN)) bot_cover_flags ^= BOT_COVER_LOCKED - to_chat(user, span_notice("You [bot_cover_flags & BOT_COVER_LOCKED ? "lock" : "unlock"] [src]'s controls!")) + balloon_alert(user, "controls [bot_cover_flags & BOT_COVER_LOCKED ? "locked" : "unlocked"]") flick("[base_icon]-emagged", src) playsound(src, SFX_SPARKS, 100, FALSE, SHORT_RANGE_SOUND_EXTRARANGE) + return TRUE /mob/living/simple_animal/bot/mulebot/update_icon_state() //if you change the icon_state names, please make sure to update /datum/wires/mulebot/on_pulse() as well. <3 . = ..() diff --git a/code/modules/mob/living/simple_animal/bot/secbot.dm b/code/modules/mob/living/simple_animal/bot/secbot.dm index 3c156558400..f5d0e0cffdd 100644 --- a/code/modules/mob/living/simple_animal/bot/secbot.dm +++ b/code/modules/mob/living/simple_animal/bot/secbot.dm @@ -233,12 +233,12 @@ retaliate(user) special_retaliate_after_attack(user) -/mob/living/simple_animal/bot/secbot/emag_act(mob/user) - ..() +/mob/living/simple_animal/bot/secbot/emag_act(mob/user, obj/item/card/emag/emag_card) + . = ..() if(!(bot_cover_flags & BOT_COVER_EMAGGED)) return if(user) - to_chat(user, span_danger("You short out [src]'s target assessment circuits.")) + balloon_alert(user, "target assessment circuits shorted") oldtarget_name = user.name if(bot_type == HONK_BOT) @@ -249,6 +249,7 @@ security_mode_flags &= ~SECBOT_DECLARE_ARRESTS update_appearance() + return TRUE /mob/living/simple_animal/bot/secbot/bullet_act(obj/projectile/Proj) if(istype(Proj, /obj/projectile/beam) || istype(Proj, /obj/projectile/bullet)) diff --git a/code/modules/mod/mod_control.dm b/code/modules/mod/mod_control.dm index bab15691bb6..bdc4ce75cf6 100644 --- a/code/modules/mod/mod_control.dm +++ b/code/modules/mod/mod_control.dm @@ -423,9 +423,10 @@ else return ..() -/obj/item/mod/control/emag_act(mob/user) +/obj/item/mod/control/emag_act(mob/user, obj/item/card/emag/emag_card) locked = !locked balloon_alert(user, "suit access [locked ? "locked" : "unlocked"]") + return TRUE /obj/item/mod/control/emp_act(severity) . = ..() diff --git a/code/modules/mod/modules/modules_general.dm b/code/modules/mod/modules/modules_general.dm index c6a7fbaa57f..54b25304a18 100644 --- a/code/modules/mod/modules/modules_general.dm +++ b/code/modules/mod/modules/modules_general.dm @@ -492,7 +492,7 @@ /obj/item/mod/module/dna_lock/emag_act(mob/user, obj/item/card/emag/emag_card) . = ..() - on_emag(src, user, emag_card) + return on_emag(src, user, emag_card) /obj/item/mod/module/dna_lock/proc/dna_check(mob/user) if(!iscarbon(user)) @@ -512,6 +512,7 @@ SIGNAL_HANDLER dna = null + return TRUE /obj/item/mod/module/dna_lock/proc/on_mod_activation(datum/source, mob/user) SIGNAL_HANDLER diff --git a/code/modules/modular_computers/computers/item/computer.dm b/code/modules/modular_computers/computers/item/computer.dm index 70d54b9284b..3b4133f4d65 100644 --- a/code/modules/modular_computers/computers/item/computer.dm +++ b/code/modules/modular_computers/computers/item/computer.dm @@ -320,18 +320,22 @@ GLOBAL_LIST_EMPTY(TabletMessengers) // a list of all active messengers, similar if(response == "Yes") turn_on(user) -/obj/item/modular_computer/emag_act(mob/user, forced) +/obj/item/modular_computer/emag_act(mob/user, obj/item/card/emag/emag_card, forced) if(!enabled && !forced) - to_chat(user, span_warning("You'd need to turn the [src] on first.")) + balloon_alert(user, "turn it on first!") return FALSE if(obj_flags & EMAGGED) - to_chat(user, span_notice("You swipe \the [src]. A console window fills the screen, but it quickly closes itself after only a few lines are written to it.")) + balloon_alert(user, "already emagged!") + if (emag_card) + to_chat(user, span_notice("You swipe \the [src] with [emag_card]. A console window fills the screen, but it quickly closes itself after only a few lines are written to it.")) return FALSE . = ..() obj_flags |= EMAGGED device_theme = PDA_THEME_SYNDICATE - to_chat(user, span_notice("You swipe \the [src]. A console window momentarily fills the screen, with white text rapidly scrolling past.")) + balloon_alert(user, "syndieOS loaded") + if (emag_card) + to_chat(user, span_notice("You swipe \the [src] with [emag_card]. A console window momentarily fills the screen, with white text rapidly scrolling past.")) return TRUE /obj/item/modular_computer/examine(mob/user) diff --git a/code/modules/modular_computers/computers/machinery/modular_computer.dm b/code/modules/modular_computers/computers/machinery/modular_computer.dm index ac7e8713b63..f9d60e86e7d 100644 --- a/code/modules/modular_computers/computers/machinery/modular_computer.dm +++ b/code/modules/modular_computers/computers/machinery/modular_computer.dm @@ -61,9 +61,9 @@ if(cpu) cpu.attack_ghost(user) -/obj/machinery/modular_computer/emag_act(mob/user) +/obj/machinery/modular_computer/emag_act(mob/user, obj/item/card/emag/emag_card) if(!cpu) - to_chat(user, span_warning("You'd need to turn the [src] on first.")) + balloon_alert(user, "turn it on first!") return FALSE return cpu.emag_act(user) diff --git a/code/modules/pai/card.dm b/code/modules/pai/card.dm index 3b6e47df5d8..1c49797908e 100644 --- a/code/modules/pai/card.dm +++ b/code/modules/pai/card.dm @@ -47,7 +47,8 @@ /obj/item/pai_card/emag_act(mob/user) if(pai) - pai.handle_emag(user) + return pai.handle_emag(user) + return FALSE /obj/item/pai_card/emp_act(severity) . = ..() diff --git a/code/modules/pai/pai.dm b/code/modules/pai/pai.dm index d8aa59840f3..0eca1fbeb94 100644 --- a/code/modules/pai/pai.dm +++ b/code/modules/pai/pai.dm @@ -165,7 +165,7 @@ return ..() /mob/living/silicon/pai/emag_act(mob/user) - handle_emag(user) + return handle_emag(user) /mob/living/silicon/pai/examine(mob/user) . = ..() diff --git a/code/modules/paperwork/fax.dm b/code/modules/paperwork/fax.dm index 13fbecb006c..eb8db0fbd28 100644 --- a/code/modules/paperwork/fax.dm +++ b/code/modules/paperwork/fax.dm @@ -104,14 +104,17 @@ GLOBAL_VAR_INIT(nt_fax_department, pick("NT HR Department", "NT Legal Department * Emag the device if the panel is open. * Emag does not bring you into the syndicate network, but makes it visible to you. */ -/obj/machinery/fax/emag_act(mob/user) +/obj/machinery/fax/emag_act(mob/user, obj/item/card/emag/emag_card) if (!panel_open && !allow_exotic_faxes) balloon_alert(user, "open panel first!") - return + return FALSE if (!(obj_flags & EMAGGED)) obj_flags |= EMAGGED playsound(src, 'sound/creatures/dog/growl2.ogg', 50, FALSE) + balloon_alert(user, "migrated to syndienet 2.0") to_chat(user, span_warning("An image appears on [src] screen for a moment with Ian in the cap of a Syndicate officer.")) + return TRUE + return FALSE /obj/machinery/fax/wrench_act(mob/living/user, obj/item/tool) . = ..() diff --git a/code/modules/paperwork/ticketmachine.dm b/code/modules/paperwork/ticketmachine.dm index c845474f32e..eaffabe187b 100644 --- a/code/modules/paperwork/ticketmachine.dm +++ b/code/modules/paperwork/ticketmachine.dm @@ -58,10 +58,10 @@ MAPPING_DIRECTIONAL_HELPERS(/obj/machinery/ticket_machine, 32) to_chat(user, span_notice("You store linkage information in [I]'s buffer.")) return TRUE -/obj/machinery/ticket_machine/emag_act(mob/user) //Emag the ticket machine to dispense burning tickets, as well as randomize its number to destroy the HoP's mind. +/obj/machinery/ticket_machine/emag_act(mob/user, obj/item/card/emag/emag_card) //Emag the ticket machine to dispense burning tickets, as well as randomize its number to destroy the HoP's mind. if(obj_flags & EMAGGED) - return - to_chat(user, span_warning("You overload [src]'s bureaucratic logic circuitry to its MAXIMUM setting.")) + return FALSE + balloon_alert(user, "bureaucratic nightmare engaged") ticket_number = rand(0,max_number) current_number = ticket_number obj_flags |= EMAGGED @@ -71,6 +71,7 @@ MAPPING_DIRECTIONAL_HELPERS(/obj/machinery/ticket_machine, 32) qdel(ticket) tickets.Cut() update_appearance() + return TRUE /obj/item/wallframe/ticket_machine name = "ticket machine frame" diff --git a/code/modules/power/apc/apc_tool_act.dm b/code/modules/power/apc/apc_tool_act.dm index 18d6e045b0b..8d35d4c8722 100644 --- a/code/modules/power/apc/apc_tool_act.dm +++ b/code/modules/power/apc/apc_tool_act.dm @@ -202,23 +202,27 @@ balloon_alert(user, "has both board and cell!") return FALSE -/obj/machinery/power/apc/emag_act(mob/user) +/obj/machinery/power/apc/emag_act(mob/user, obj/item/card/emag/emag_card) if((obj_flags & EMAGGED) || malfhack) - return + return FALSE if(opened) balloon_alert(user, "close the cover first!") + return FALSE else if(panel_open) balloon_alert(user, "close the panel first!") + return FALSE else if(machine_stat & (BROKEN|MAINT)) balloon_alert(user, "nothing happens!") + return FALSE else flick("apc-spark", src) playsound(src, SFX_SPARKS, 75, TRUE, SHORT_RANGE_SOUND_EXTRARANGE) obj_flags |= EMAGGED locked = FALSE - balloon_alert(user, "you emag the APC") + balloon_alert(user, "interface damaged") update_appearance() + return TRUE // damage and destruction acts /obj/machinery/power/apc/emp_act(severity) diff --git a/code/modules/power/port_gen.dm b/code/modules/power/port_gen.dm index 5400a48422c..3a3e88d743f 100644 --- a/code/modules/power/port_gen.dm +++ b/code/modules/power/port_gen.dm @@ -209,12 +209,13 @@ return return ..() -/obj/machinery/power/port_gen/pacman/emag_act(mob/user) +/obj/machinery/power/port_gen/pacman/emag_act(mob/user, obj/item/card/emag/emag_card) if(obj_flags & EMAGGED) - return + return FALSE obj_flags |= EMAGGED - to_chat(user, span_notice("You hear a hefty clunk from inside the generator.")) + balloon_alert(user, "maximum power output unlocked") emp_act(EMP_HEAVY) + return TRUE /obj/machinery/power/port_gen/pacman/attack_ai(mob/user) interact(user) diff --git a/code/modules/power/singularity/emitter.dm b/code/modules/power/singularity/emitter.dm index a859f2d0203..c812a49c6b8 100644 --- a/code/modules/power/singularity/emitter.dm +++ b/code/modules/power/singularity/emitter.dm @@ -377,13 +377,13 @@ projectile_type = initial(projectile_type) projectile_sound = initial(projectile_sound) -/obj/machinery/power/emitter/emag_act(mob/user) +/obj/machinery/power/emitter/emag_act(mob/user, obj/item/card/emag/emag_card) if(obj_flags & EMAGGED) - return + return FALSE locked = FALSE obj_flags |= EMAGGED - if(user) - user.visible_message(span_warning("[user.name] emags [src]."), span_notice("You short out the lock.")) + balloon_alert(user, "id lock shorted out") + return TRUE /obj/machinery/power/emitter/prototype diff --git a/code/modules/projectiles/pins.dm b/code/modules/projectiles/pins.dm index ad5933e2c5c..6c2914b495d 100644 --- a/code/modules/projectiles/pins.dm +++ b/code/modules/projectiles/pins.dm @@ -52,11 +52,12 @@ return . -/obj/item/firing_pin/emag_act(mob/user) +/obj/item/firing_pin/emag_act(mob/user, obj/item/card/emag/emag_card) if(obj_flags & EMAGGED) - return + return FALSE obj_flags |= EMAGGED - to_chat(user, span_notice("You override the authentication mechanism.")) + balloon_alert(user, "authentication checks overridden") + return TRUE /obj/item/firing_pin/proc/gun_insert(mob/living/user, obj/item/gun/G) gun = G diff --git a/code/modules/reagents/chemistry/machinery/chem_dispenser.dm b/code/modules/reagents/chemistry/machinery/chem_dispenser.dm index 498d602f8df..f53cf0ac77f 100644 --- a/code/modules/reagents/chemistry/machinery/chem_dispenser.dm +++ b/code/modules/reagents/chemistry/machinery/chem_dispenser.dm @@ -193,13 +193,14 @@ . += beaker_overlay -/obj/machinery/chem_dispenser/emag_act(mob/user) +/obj/machinery/chem_dispenser/emag_act(mob/user, obj/item/card/emag/emag_card) if(obj_flags & EMAGGED) - to_chat(user, span_warning("[src] has no functional safeties to emag.")) - return - to_chat(user, span_notice("You short out [src]'s safeties.")) + balloon_alert(user, "already emagged!") + return FALSE + balloon_alert(user, "safeties shorted out") dispensable_reagents |= emagged_reagents//add the emagged reagents to the dispensable ones obj_flags |= EMAGGED + return TRUE /obj/machinery/chem_dispenser/ex_act(severity, target) if(severity <= EXPLODE_LIGHT) diff --git a/code/modules/recycling/disposal/outlet.dm b/code/modules/recycling/disposal/outlet.dm index c63c347ec69..edb8a4bf7dd 100644 --- a/code/modules/recycling/disposal/outlet.dm +++ b/code/modules/recycling/disposal/outlet.dm @@ -122,14 +122,15 @@ eject_range = EJECT_RANGE_SLOW return TRUE -/obj/structure/disposaloutlet/emag_act(mob/user, obj/item/card/emag/E) +/obj/structure/disposaloutlet/emag_act(mob/user, obj/item/card/emag/emag_card) . = ..() if(obj_flags & EMAGGED) return - to_chat(user, span_notice("You silently disable the sanity checking on \the [src]'s ejection force.")) + balloon_alert(user, "ejection force maximized") obj_flags |= EMAGGED eject_speed = EJECT_SPEED_YEET eject_range = EJECT_RANGE_YEET + return TRUE #undef EJECT_SPEED_SLOW #undef EJECT_SPEED_MED diff --git a/code/modules/research/rdconsole.dm b/code/modules/research/rdconsole.dm index 449a7078537..10fdb6fe211 100644 --- a/code/modules/research/rdconsole.dm +++ b/code/modules/research/rdconsole.dm @@ -140,13 +140,15 @@ Nothing else in the console has ID requirements. say("Not enough research points...") return FALSE -/obj/machinery/computer/rdconsole/emag_act(mob/user) - if(!(obj_flags & EMAGGED)) - to_chat(user, span_notice("You disable the security protocols[locked? " and unlock the console":""].")) - playsound(src, SFX_SPARKS, 75, TRUE, SHORT_RANGE_SOUND_EXTRARANGE) - obj_flags |= EMAGGED - locked = FALSE - return ..() +/obj/machinery/computer/rdconsole/emag_act(mob/user, obj/item/card/emag/emag_card) + . = ..() + if (obj_flags & EMAGGED) + return + balloon_alert(user, "security protocols disabled") + playsound(src, SFX_SPARKS, 75, TRUE, SHORT_RANGE_SOUND_EXTRARANGE) + obj_flags |= EMAGGED + locked = FALSE + return TRUE /obj/machinery/computer/rdconsole/ui_interact(mob/user, datum/tgui/ui = null) . = ..() diff --git a/code/modules/research/server_control.dm b/code/modules/research/server_control.dm index 532f05ec965..da6cb322be8 100644 --- a/code/modules/research/server_control.dm +++ b/code/modules/research/server_control.dm @@ -20,12 +20,13 @@ balloon_alert(user, "techweb connected") return TRUE -/obj/machinery/computer/rdservercontrol/emag_act(mob/user) +/obj/machinery/computer/rdservercontrol/emag_act(mob/user, obj/item/card/emag/emag_card) if(obj_flags & EMAGGED) - return + return FALSE obj_flags |= EMAGGED playsound(src, SFX_SPARKS, 75, TRUE, SHORT_RANGE_SOUND_EXTRARANGE) balloon_alert(user, "console emagged") + return TRUE /obj/machinery/computer/rdservercontrol/ui_interact(mob/user, datum/tgui/ui) . = ..() diff --git a/code/modules/research/xenobiology/vatgrowing/vatgrower.dm b/code/modules/research/xenobiology/vatgrowing/vatgrower.dm index fecb437d233..b2620335a64 100644 --- a/code/modules/research/xenobiology/vatgrowing/vatgrower.dm +++ b/code/modules/research/xenobiology/vatgrowing/vatgrower.dm @@ -124,13 +124,14 @@ balloon_alert_to_viewers("resampler [resampler_active ? "activated" : "deactivated"]") update_appearance() -/obj/machinery/plumbing/growing_vat/emag_act(mob/user) +/obj/machinery/plumbing/growing_vat/emag_act(mob/user, obj/item/card/emag/emag_card) if(obj_flags & EMAGGED) - return + return FALSE obj_flags |= EMAGGED playsound(src, SFX_SPARKS, 100, TRUE, SHORT_RANGE_SOUND_EXTRARANGE) - to_chat(user, span_warning("You overload [src]'s resampling circuit.")) + balloon_alert(user, "resampling circuit overloaded") flick("growing_vat_emagged", src) + return TRUE /obj/machinery/plumbing/growing_vat/proc/on_sample_growth_completed() SIGNAL_HANDLER diff --git a/code/modules/shuttle/computer.dm b/code/modules/shuttle/computer.dm index f89dd8cdcc8..4035b5d46f2 100644 --- a/code/modules/shuttle/computer.dm +++ b/code/modules/shuttle/computer.dm @@ -216,12 +216,13 @@ to_chat(GLOB.admins, "SHUTTLE: [ADMIN_LOOKUPFLW(usr)] (Move Shuttle)(Lock/Unlock Shuttle) is requesting to move or unlock the shuttle.") return TRUE -/obj/machinery/computer/shuttle/emag_act(mob/user) +/obj/machinery/computer/shuttle/emag_act(mob/user, obj/item/card/emag/emag_card) if(obj_flags & EMAGGED) - return + return FALSE req_access = list() obj_flags |= EMAGGED - to_chat(user, span_notice("You fried the consoles ID checking system.")) + balloon_alert(user, "id checking system fried") + return TRUE /obj/machinery/computer/shuttle/connect_to_shuttle(mapload, obj/docking_port/mobile/port, obj/docking_port/stationary/dock) if(!mapload) diff --git a/code/modules/shuttle/emergency.dm b/code/modules/shuttle/emergency.dm index b787ed4215a..fe71284ee1d 100644 --- a/code/modules/shuttle/emergency.dm +++ b/code/modules/shuttle/emergency.dm @@ -263,18 +263,22 @@ [hijack_completion_flight_time_set >= INFINITY ? "[scramble_message_replace_chars("\[ERROR\]")]" : hijack_completion_flight_time_set/10] seconds." : ""]" minor_announce(scramble_message_replace_chars(msg, replaceprob = 10), "Emergency Shuttle", TRUE) -/obj/machinery/computer/emergency_shuttle/emag_act(mob/user) +/obj/machinery/computer/emergency_shuttle/emag_act(mob/user, obj/item/card/emag/emag_card) // How did you even get on the shuttle before it go to the station? if(!IS_DOCKED) - return + return FALSE if((obj_flags & EMAGGED) || ENGINES_STARTED) //SYSTEM ERROR: THE SHUTTLE WILL LA-SYSTEM ERROR: THE SHUTTLE WILL LA-SYSTEM ERROR: THE SHUTTLE WILL LAUNCH IN 10 SECONDS - to_chat(user, span_warning("The shuttle is already about to launch!")) - return + balloon_alert(user, "shuttle already about to launch!") + return FALSE var/time = TIME_LEFT - message_admins("[ADMIN_LOOKUPFLW(user)] has emagged the emergency shuttle [time] seconds before launch.") - log_shuttle("[key_name(user)] has emagged the emergency shuttle in [COORD(src)] [time] seconds before launch.") + if (user) + message_admins("[ADMIN_LOOKUPFLW(user)] has emagged the emergency shuttle [time] seconds before launch.") + log_shuttle("[key_name(user)] has emagged the emergency shuttle in [COORD(src)] [time] seconds before launch.") + else + message_admins("The emergency shuttle was emagged [time] seconds before launch, with no emagger.") + log_shuttle("The emergency shuttle was emagged in [COORD(src)] [time] seconds before launch, with no emagger.") obj_flags |= EMAGGED SSshuttle.emergency.movement_force = list("KNOCKDOWN" = 60, "THROW" = 20)//YOUR PUNY SEATBELTS can SAVE YOU NOW, MORTAL @@ -290,6 +294,7 @@ authorized += ID process(SSMACHINES_DT) + return TRUE /obj/machinery/computer/emergency_shuttle/Destroy() // Our fake IDs that the emag generated are just there for colour @@ -640,14 +645,15 @@ . = ..() RegisterSignal(SSsecurity_level, COMSIG_SECURITY_LEVEL_CHANGED, PROC_REF(check_lock)) -/obj/machinery/computer/shuttle/pod/emag_act(mob/user) +/obj/machinery/computer/shuttle/pod/emag_act(mob/user, obj/item/card/emag/emag_card) if(obj_flags & EMAGGED) - return + return FALSE obj_flags |= EMAGGED locked = FALSE - to_chat(user, span_warning("You fry the pod's alert level checking system.")) + balloon_alert(user, "alert level checking disabled") icon_screen = "emagged_general" update_appearance() + return TRUE /obj/machinery/computer/shuttle/pod/connect_to_shuttle(mapload, obj/docking_port/mobile/port, obj/docking_port/stationary/dock) . = ..() diff --git a/code/modules/shuttle/ferry.dm b/code/modules/shuttle/ferry.dm index a628a312328..d1f54b889d1 100644 --- a/code/modules/shuttle/ferry.dm +++ b/code/modules/shuttle/ferry.dm @@ -8,9 +8,9 @@ var/allow_silicons = FALSE var/allow_emag = FALSE -/obj/machinery/computer/shuttle/ferry/emag_act(mob/user) +/obj/machinery/computer/shuttle/ferry/emag_act(mob/user, obj/item/card/emag/emag_card) if(!allow_emag) - to_chat(user, span_warning("[src]'s security firewall is far too powerful for you to bypass.")) + balloon_alert(user, "firewall too powerful!") return FALSE return ..() diff --git a/code/modules/shuttle/special.dm b/code/modules/shuttle/special.dm index 901b9a0987f..25d9b6343d7 100644 --- a/code/modules/shuttle/special.dm +++ b/code/modules/shuttle/special.dm @@ -68,8 +68,8 @@ /obj/machinery/power/emitter/energycannon/magical/ex_act(severity) return FALSE -/obj/machinery/power/emitter/energycannon/magical/emag_act(mob/user) - return +/obj/machinery/power/emitter/energycannon/magical/emag_act(mob/user, obj/item/card/emag/emag_card) + return FALSE /obj/structure/table/abductor/wabbajack name = "wabbajack altar" @@ -277,8 +277,8 @@ /obj/machinery/scanner_gate/luxury_shuttle/attackby(obj/item/W, mob/user, params) return -/obj/machinery/scanner_gate/luxury_shuttle/emag_act(mob/user) - return +/obj/machinery/scanner_gate/luxury_shuttle/emag_act(mob/user, obj/item/card/emag/emag_card) + return FALSE #define LUXURY_MESSAGE_COOLDOWN 100 /obj/machinery/scanner_gate/luxury_shuttle/Bumped(atom/movable/AM) diff --git a/code/modules/station_goals/bsa.dm b/code/modules/station_goals/bsa.dm index 7abf9b3fced..eb277b9f681 100644 --- a/code/modules/station_goals/bsa.dm +++ b/code/modules/station_goals/bsa.dm @@ -395,7 +395,9 @@ GLOBAL_VAR_INIT(bsa_unlock, FALSE) /obj/machinery/computer/bsa_control/emag_act(mob/user, obj/item/card/emag/emag_card) if(obj_flags & EMAGGED) - return + return FALSE obj_flags |= EMAGGED - to_chat(user, span_warning("You emag [src] and hear the focusing crystal short out.")) + balloon_alert(user, "rigged to explode") + to_chat(user, span_warning("You emag [src] and hear the focusing crystal short out. You get the feeling it wouldn't be wise to stand near [src] when the BSA fires...")) + return TRUE */ diff --git a/code/modules/station_goals/meteor_shield.dm b/code/modules/station_goals/meteor_shield.dm index 3a37ec9de9f..e856a4e2748 100644 --- a/code/modules/station_goals/meteor_shield.dm +++ b/code/modules/station_goals/meteor_shield.dm @@ -118,10 +118,11 @@ /obj/machinery/satellite/meteor_shield/emag_act(mob/user, obj/item/card/emag/emag_card) if(obj_flags & EMAGGED) balloon_alert(user, "already emagged!") - return + return FALSE if(!COOLDOWN_FINISHED(src, shared_emag_cooldown)) + balloon_alert(user, "on cooldown!") to_chat(user, span_warning("The last satellite emagged needs [DisplayTimeText(COOLDOWN_TIMELEFT(src, shared_emag_cooldown))] to recalibrate first. Emagging another so soon could damage the satellite network.")) - return + return FALSE var/cooldown_applied = METEOR_SHIELD_EMAG_COOLDOWN if(istype(emag_card, /obj/item/card/emag/meteor_shield_recalibrator)) cooldown_applied /= 3 @@ -132,6 +133,7 @@ say("Recalibrating... ETA:[DisplayTimeText(cooldown_applied)].") if(active) //if we allowed inactive updates a sat could be worth -1 active meteor shields on first emag update_emagged_meteor_sat(user) + return TRUE /obj/machinery/satellite/meteor_shield/proc/update_emagged_meteor_sat(mob/user) if(!active) diff --git a/code/modules/surgery/organs/internal/cyberimp/augments_arms.dm b/code/modules/surgery/organs/internal/cyberimp/augments_arms.dm index 28d67178759..6f28dd871a3 100644 --- a/code/modules/surgery/organs/internal/cyberimp/augments_arms.dm +++ b/code/modules/surgery/organs/internal/cyberimp/augments_arms.dm @@ -253,13 +253,13 @@ /obj/item/organ/internal/cyberimp/arm/toolset/l zone = BODY_ZONE_L_ARM -/obj/item/organ/internal/cyberimp/arm/toolset/emag_act(mob/user) +/obj/item/organ/internal/cyberimp/arm/toolset/emag_act(mob/user, obj/item/card/emag/emag_card) for(var/datum/weakref/created_item in items_list) var/obj/potential_knife = created_item.resolve() if(istype(/obj/item/knife/combat/cyborg, potential_knife)) return FALSE - to_chat(user, span_notice("You unlock [src]'s integrated knife!")) + balloon_alert(user, "integrated knife unlocked") items_list += WEAKREF(new /obj/item/knife/combat/cyborg(src)) return TRUE diff --git a/code/modules/vehicles/cars/clowncar.dm b/code/modules/vehicles/cars/clowncar.dm index d08aceab85f..36b393a7162 100644 --- a/code/modules/vehicles/cars/clowncar.dm +++ b/code/modules/vehicles/cars/clowncar.dm @@ -147,14 +147,16 @@ playsound(target_pancake, 'sound/effects/cartoon_splat.ogg', 75) log_combat(src, crossed, "ran over") -/obj/vehicle/sealed/car/clowncar/emag_act(mob/user) +/obj/vehicle/sealed/car/clowncar/emag_act(mob/user, obj/item/card/emag/emag_card) if(obj_flags & EMAGGED) - return + return FALSE obj_flags |= EMAGGED + balloon_alert(user, "fun mode engaged") to_chat(user, span_danger("You scramble [src]'s child safety lock, and a panel with six colorful buttons appears!")) initialize_controller_action_type(/datum/action/vehicle/sealed/roll_the_dice, VEHICLE_CONTROL_DRIVE) initialize_controller_action_type(/datum/action/vehicle/sealed/cannon, VEHICLE_CONTROL_DRIVE) AddElement(/datum/element/waddling) + return TRUE /obj/vehicle/sealed/car/clowncar/atom_destruction(damage_flag) playsound(src, 'sound/vehicles/clowncar_fart.ogg', 100) diff --git a/code/modules/vehicles/motorized_wheelchair.dm b/code/modules/vehicles/motorized_wheelchair.dm index 21b3ec1b51c..5b0f02c7ae8 100644 --- a/code/modules/vehicles/motorized_wheelchair.dm +++ b/code/modules/vehicles/motorized_wheelchair.dm @@ -185,8 +185,15 @@ visible_message(span_danger("[src] crashes into [A], sending [disabled] flying!")) playsound(src, 'sound/effects/bang.ogg', 50, 1) -/obj/vehicle/ridden/wheelchair/motorized/emag_act(mob/user) - if((obj_flags & EMAGGED) || !panel_open) - return - to_chat(user, span_warning("A bomb appears in [src], what the fuck?")) +/obj/vehicle/ridden/wheelchair/motorized/emag_act(mob/user, obj/item/card/emag/emag_card) + if (obj_flags & EMAGGED) + return FALSE + + if (panel_open) + balloon_alert(user, "open maintenance panel!") + return FALSE + + balloon_alert(user, "bomb implanted...?") + visible_message(span_warning("A bomb appears in [src], what the fuck?")) obj_flags |= EMAGGED + return TRUE diff --git a/code/modules/vending/_vending.dm b/code/modules/vending/_vending.dm index 07f404de0e7..ffe1c17a9d1 100644 --- a/code/modules/vending/_vending.dm +++ b/code/modules/vending/_vending.dm @@ -856,11 +856,12 @@ update_canister() . = ..() -/obj/machinery/vending/emag_act(mob/user) +/obj/machinery/vending/emag_act(mob/user, obj/item/card/emag/emag_card) if(obj_flags & EMAGGED) - return + return FALSE obj_flags |= EMAGGED - to_chat(user, span_notice("You short out the product lock on [src].")) + balloon_alert(user, "product lock disabled") + return TRUE /obj/machinery/vending/interact(mob/user) if(seconds_electrified && !(machine_stat & NOPOWER)) diff --git a/icons/mob/actions/actions_AI.dmi b/icons/mob/actions/actions_AI.dmi index 9f900bb9b4d..c25b88aac5c 100644 Binary files a/icons/mob/actions/actions_AI.dmi and b/icons/mob/actions/actions_AI.dmi differ diff --git a/modular_skyrat/master_files/code/modules/mob/living/simple_animal/friendly/dogs.dm b/modular_skyrat/master_files/code/modules/mob/living/simple_animal/friendly/dogs.dm index 4d9190068bc..ac37d5bdf53 100644 --- a/modular_skyrat/master_files/code/modules/mob/living/simple_animal/friendly/dogs.dm +++ b/modular_skyrat/master_files/code/modules/mob/living/simple_animal/friendly/dogs.dm @@ -227,7 +227,7 @@ SIGNAL_HANDLER if(emagged) - return + return FALSE emagged = TRUE @@ -242,6 +242,8 @@ notify_ghosts("[user] has shortcircuited [target] to explode in 60 seconds!", source = target, action = NOTIFY_ORBIT, flashwindow = FALSE, header = "Borgi Emagged") addtimer(CALLBACK(src, PROC_REF(explode_imminent)), 50 SECONDS) + return TRUE + /mob/living/basic/pet/dog/corgi/borgi/proc/explode_imminent() visible_message(span_bolddanger("[src] makes an odd whining noise!")) do_jitter_animation(30) diff --git a/modular_skyrat/modules/advanced_shuttles/code/computer.dm b/modular_skyrat/modules/advanced_shuttles/code/computer.dm index 4e810026fff..c895df045e0 100644 --- a/modular_skyrat/modules/advanced_shuttles/code/computer.dm +++ b/modular_skyrat/modules/advanced_shuttles/code/computer.dm @@ -8,10 +8,11 @@ /obj/machinery/computer/shuttle/pod/advanced/emag_act(mob/user) if(obj_flags & EMAGGED) - return + return FALSE obj_flags |= EMAGGED locked = FALSE to_chat(user, span_warning("You fry the pod's alert level checking system.")) + return TRUE /obj/machinery/computer/emergency_shuttle/advanced icon = 'modular_skyrat/modules/advanced_shuttles/icons/computer.dmi' diff --git a/modular_skyrat/modules/aesthetics/guns/code/guns.dm b/modular_skyrat/modules/aesthetics/guns/code/guns.dm index fe3fc680373..e8f7039d644 100644 --- a/modular_skyrat/modules/aesthetics/guns/code/guns.dm +++ b/modular_skyrat/modules/aesthetics/guns/code/guns.dm @@ -178,12 +178,16 @@ /obj/item/gun/energy/e_gun/nuclear/emag_act(mob/user, obj/item/card/emag/E) . = ..() + if(obj_flags & EMAGGED) + return FALSE if(pin) to_chat(user, span_warning("You probably want to do this on a new gun!")) return FALSE to_chat(user, "The gun suddenly feels quite fantastic!") new /obj/item/gun/energy/e_gun/nuclear/rainbow(get_turf(user)) + obj_flags |= EMAGGED qdel(src) + return TRUE /obj/item/gun/energy/e_gun/nuclear/rainbow/update_overlays() . = ..() diff --git a/modular_skyrat/modules/bluespace_miner/code/bluespace_miner.dm b/modular_skyrat/modules/bluespace_miner/code/bluespace_miner.dm index f5581e3e990..6b45258c051 100644 --- a/modular_skyrat/modules/bluespace_miner/code/bluespace_miner.dm +++ b/modular_skyrat/modules/bluespace_miner/code/bluespace_miner.dm @@ -128,10 +128,11 @@ /obj/machinery/bluespace_miner/emag_act(mob/user, obj/item/card/emag/emag_card) if(obj_flags & EMAGGED) balloon_alert(user, "already emagged!") - return + return FALSE ore_chance += list(/obj/item/stack/sheet/mineral/bananium = 1) obj_flags |= EMAGGED balloon_alert_to_viewers("fizzles!") + return TRUE /obj/item/circuitboard/machine/bluespace_miner name = "Bluespace Miner" diff --git a/modular_skyrat/modules/bsa_overhaul/code/bsa_computer.dm b/modular_skyrat/modules/bsa_overhaul/code/bsa_computer.dm index fe23b459b71..688377c551f 100644 --- a/modular_skyrat/modules/bsa_overhaul/code/bsa_computer.dm +++ b/modular_skyrat/modules/bsa_overhaul/code/bsa_computer.dm @@ -74,9 +74,11 @@ /obj/machinery/computer/bsa_control/emag_act(mob/user, obj/item/card/emag/emag_card) if(obj_flags & EMAGGED) - return + return FALSE obj_flags |= EMAGGED - to_chat(user, span_warning("You emag [src] and hear the focusing crystal short out.")) + balloon_alert(user, "rigged to explode") + to_chat(user, span_warning("You emag [src] and hear the focusing crystal short out. You get the feeling it wouldn't be wise to stand near [src] when the BSA fires...")) + return TRUE /** * Changes the target charge for the internal capacitors diff --git a/modular_skyrat/modules/company_imports/code/objects/firing_pin.dm b/modular_skyrat/modules/company_imports/code/objects/firing_pin.dm index 39537dfa0fd..8659e605981 100644 --- a/modular_skyrat/modules/company_imports/code/objects/firing_pin.dm +++ b/modular_skyrat/modules/company_imports/code/objects/firing_pin.dm @@ -30,4 +30,9 @@ GLOBAL_VAR_INIT(permit_pin_unrestricted, FALSE) /obj/item/firing_pin/emag_act(mob/user) . = ..() + if(obj_flags & EMAGGED) + return FALSE + balloon_alert(user, "firing pin unlocked!") + obj_flags |= EMAGGED can_remove = TRUE + return TRUE diff --git a/modular_skyrat/modules/customization/modules/clothing/under/accessories.dm b/modular_skyrat/modules/customization/modules/clothing/under/accessories.dm index 74675e67780..8572a0aa4bc 100644 --- a/modular_skyrat/modules/customization/modules/clothing/under/accessories.dm +++ b/modular_skyrat/modules/customization/modules/clothing/under/accessories.dm @@ -68,7 +68,6 @@ icon_state = "holobadge" icon = 'modular_skyrat/master_files/icons/obj/clothing/accessories.dmi' worn_icon = 'modular_skyrat/master_files/icons/mob/clothing/accessories.dmi' - var/emagged //Emagging removes Sec check. /obj/item/clothing/accessory/badge/holo/cord icon_state = "holobadge-cord" @@ -82,13 +81,14 @@ return ..() /obj/item/clothing/accessory/badge/holo/emag_act(remaining_charges, mob/user) - if (emagged) - to_chat(user, span_danger("\The [src] is already cracked.")) - return - else - emagged = TRUE - to_chat(user, span_danger("You crack the holobadge security checks.")) - return TRUE + if(obj_flags & EMAGGED) + balloon_alert(user, "already cracked") + return FALSE + + obj_flags |= EMAGGED + balloon_alert(user, "security checks cracked!") + to_chat(user, span_danger("You crack the holobadge security checks.")) + return TRUE /obj/item/clothing/accessory/badge/holo/attackby(obj/item/object as obj, mob/user as mob) if(istype(object, /obj/item/card/id)) @@ -98,7 +98,7 @@ if(istype(object, /obj/item/card/id)) id_card = object - if(ACCESS_BRIG in id_card.access || emagged) + if(ACCESS_BRIG in id_card.access || (obj_flags & EMAGGED)) to_chat(user, "You imprint your ID details onto the badge.") set_name(user.real_name) badge_string = id_card.assignment diff --git a/modular_skyrat/modules/goofsec/code/department_guards.dm b/modular_skyrat/modules/goofsec/code/department_guards.dm index 177c7701916..07f7dbc9159 100644 --- a/modular_skyrat/modules/goofsec/code/department_guards.dm +++ b/modular_skyrat/modules/goofsec/code/department_guards.dm @@ -694,7 +694,10 @@ span_hear("You hear a faint electrical spark.")) balloon_alert(user, "emagged") playsound(src, SFX_SPARKS, 50, TRUE, SHORT_RANGE_SOUND_EXTRARANGE) + obj_flags |= EMAGGED emagged = TRUE + return TRUE + return FALSE /obj/item/melee/baton/security/loaded/departmental/medical name = "medical stun baton" diff --git a/modular_skyrat/modules/hyposprays/code/hyposprays_II.dm b/modular_skyrat/modules/hyposprays/code/hyposprays_II.dm index b05eaf34377..5cb82e0918a 100644 --- a/modular_skyrat/modules/hyposprays/code/hyposprays_II.dm +++ b/modular_skyrat/modules/hyposprays/code/hyposprays_II.dm @@ -166,7 +166,7 @@ . = ..() if(obj_flags & EMAGGED) to_chat(user, "[src] happens to be already overcharged.") - return + return FALSE //all these are 0 inject_wait = COMBAT_WAIT_INJECT spray_wait = COMBAT_WAIT_SPRAY diff --git a/modular_skyrat/modules/implants/code/augments_arms.dm b/modular_skyrat/modules/implants/code/augments_arms.dm index 6da7d3c46be..3de8c3b93ff 100644 --- a/modular_skyrat/modules/implants/code/augments_arms.dm +++ b/modular_skyrat/modules/implants/code/augments_arms.dm @@ -29,6 +29,8 @@ icon_state = "mantis_blade" /obj/item/organ/internal/cyberimp/arm/armblade/emag_act() + if(obj_flags & EMAGGED) + return FALSE for(var/datum/weakref/created_item in items_list) to_chat(usr, span_notice("You unlock [src]'s integrated energy arm blade! You madman!")) items_list += WEAKREF(new /obj/item/melee/implantarmblade/energy(src)) @@ -66,9 +68,12 @@ toolspeed = 1 /obj/item/organ/internal/cyberimp/arm/botany/emag_act() + if(obj_flags & EMAGGED) + return FALSE for(var/datum/weakref/created_item in items_list) to_chat(usr, span_notice("You unlock [src]'s deluxe landscaping equipment!")) items_list += WEAKREF(new /obj/item/implant_mounted_chainsaw(src)) //time to landscape the station + obj_flags |= EMAGGED return TRUE /obj/item/multitool/abductor/implant @@ -83,10 +88,13 @@ items_to_create = list(/obj/item/lightreplacer, /obj/item/holosign_creator, /obj/item/soap/nanotrasen, /obj/item/reagent_containers/spray/cyborg_drying, /obj/item/mop/advanced, /obj/item/paint/paint_remover, /obj/item/reagent_containers/cup/beaker/large, /obj/item/reagent_containers/spray/cleaner) //Beaker if for refilling sprays /obj/item/organ/internal/cyberimp/arm/janitor/emag_act() + if(obj_flags & EMAGGED) + return FALSE for(var/datum/weakref/created_item in items_list) to_chat(usr, span_notice("You unlock [src]'s integrated deluxe cleaning supplies!")) items_list += WEAKREF(new /obj/item/soap/syndie(src)) //We add not replace. items_list += WEAKREF(new /obj/item/reagent_containers/spray/cyborg_lube(src)) + obj_flags |= EMAGGED return TRUE /obj/item/organ/internal/cyberimp/arm/lighter @@ -95,7 +103,10 @@ items_to_create = list(/obj/item/lighter/greyscale) //Hilariously useless. /obj/item/organ/internal/cyberimp/arm/lighter/emag_act() + if(obj_flags & EMAGGED) + return FALSE for(var/datum/weakref/created_item in items_list) to_chat(usr, span_notice("You unlock [src]'s integrated Zippo lighter! Finally, classy smoking!")) items_list += WEAKREF(new /obj/item/lighter(src)) //Now you can choose between bad and worse! + obj_flags |= EMAGGED return TRUE