diff --git a/code/game/atoms.dm b/code/game/atoms.dm index a1e3ed547ef..51a5de292eb 100644 --- a/code/game/atoms.dm +++ b/code/game/atoms.dm @@ -1062,10 +1062,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 20e5559d95f..16686b23c77 100644 --- a/code/game/machinery/barsigns.dm +++ b/code/game/machinery/barsigns.dm @@ -169,15 +169,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 6d2db1482e3..21a718d8705 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 5559ab440e7..2ffed11f354 100644 --- a/code/game/machinery/computer/communications.dm +++ b/code/game/machinery/computer/communications.dm @@ -67,7 +67,7 @@ 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 @@ -119,26 +119,29 @@ /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) - return + 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 f1194384d69..f421a0416b5 100644 --- a/code/game/machinery/doors/airlock.dm +++ b/code/game/machinery/doors/airlock.dm @@ -1372,23 +1372,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 68e4627bbe0..34ddda2798f 100644 --- a/code/game/machinery/doors/firedoor.dm +++ b/code/game/machinery/doors/firedoor.dm @@ -436,14 +436,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 c935db5fb45..5c3c34d3fad 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 e5a8fc6b59e..be2471a6375 100644 --- a/code/game/machinery/firealarm.dm +++ b/code/game/machinery/firealarm.dm @@ -217,17 +217,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 82a1ee1267e..1a05ed756aa 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 1909371386f..acd22e704a5 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 5e8dd4daa0f..fa75e70506c 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 d2278d680ad..8fd41bcc9d9 100644 --- a/code/game/machinery/scan_gate.dm +++ b/code/game/machinery/scan_gate.dm @@ -105,13 +105,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 b4ccd2f7626..9112773c1e9 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 9eb4650c3f3..cc7c270b904 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 2cc20da25e4..889f47a9f58 100644 --- a/code/game/objects/items/cigs_lighters.dm +++ b/code/game/objects/items/cigs_lighters.dm @@ -1075,21 +1075,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 fa9fc3eec33..441052fb48a 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 d8f27d0a6f3..1d07e2a9558 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 45b991710d8..3e261b9eabb 100644 --- a/code/game/objects/items/devices/radio/intercom.dm +++ b/code/game/objects/items/devices/radio/intercom.dm @@ -130,6 +130,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 @@ -140,18 +142,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 ca98ac360f1..b353ad15952 100644 --- a/code/game/objects/items/storage/lockbox.dm +++ b/code/game/objects/items/storage/lockbox.dm @@ -52,14 +52,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 = STORAGE_NOT_LOCKED 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 4b547679c43..36bd6744d33 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 568ad92ac31..901691d3e60 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 88946e06526..089be164a31 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 90797117322..08ff42e2d76 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 b7bbf2da2b2..466857240b9 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 87569ea3b91..f814bf3b09e 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 0ca3418f8f1..7767b83bcb4 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 66cf85f19c3..221156d0471 100644 --- a/code/modules/clothing/glasses/hud.dm +++ b/code/modules/clothing/glasses/hud.dm @@ -34,12 +34,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 2cede2562c2..d26a8f08400 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 c7e20e50ab0..3591a31cd7b 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 39a7bf17be8..cf7778bcdf7 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 36c6ff6d7cc..3515adad900 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 8e58706b40a..6a0c4c03005 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 dab5d7153d7..7c225942a10 100644 --- a/code/modules/mob/living/carbon/human/species_types/ethereal.dm +++ b/code/modules/mob/living/carbon/human/species_types/ethereal.dm @@ -139,13 +139,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 c3d36b58f01..2e6823f7679 100644 --- a/code/modules/mob/living/simple_animal/bot/bot.dm +++ b/code/modules/mob/living/simple_animal/bot/bot.dm @@ -311,8 +311,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. @@ -322,9 +322,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 bd8b5f0268e..603e6fbfb4b 100644 --- a/code/modules/mob/living/simple_animal/bot/cleanbot.dm +++ b/code/modules/mob/living/simple_animal/bot/cleanbot.dm @@ -230,9 +230,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 e6c7ff0c921..99473de51f9 100644 --- a/code/modules/mob/living/simple_animal/bot/firebot.dm +++ b/code/modules/mob/living/simple_animal/bot/firebot.dm @@ -104,12 +104,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) @@ -124,6 +125,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 a06a0398996..b2f7f418589 100644 --- a/code/modules/mob/living/simple_animal/bot/floorbot.dm +++ b/code/modules/mob/living/simple_animal/bot/floorbot.dm @@ -101,12 +101,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 0dfa631fffa..f57cf3b3772 100644 --- a/code/modules/mob/living/simple_animal/bot/medbot.dm +++ b/code/modules/mob/living/simple_animal/bot/medbot.dm @@ -227,18 +227,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 ea535a45992..d0081f62ab8 100644 --- a/code/modules/mob/living/simple_animal/bot/mulebot.dm +++ b/code/modules/mob/living/simple_animal/bot/mulebot.dm @@ -187,14 +187,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 b45789391a4..afcadf66d66 100644 --- a/code/modules/mob/living/simple_animal/bot/secbot.dm +++ b/code/modules/mob/living/simple_animal/bot/secbot.dm @@ -234,12 +234,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) @@ -250,6 +250,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 eaa3cf685bc..b0669f34c3e 100644 --- a/code/modules/mod/mod_control.dm +++ b/code/modules/mod/mod_control.dm @@ -401,9 +401,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 5fb4142cb7b..dba251698bd 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 fcd3f16f13d..31e7724e6ad 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 c3245caec41..33f4bc29a16 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 4fddc8bdc44..a930cde766f 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 a6bc3bb11b0..141c51ac03f 100644 --- a/code/modules/pai/pai.dm +++ b/code/modules/pai/pai.dm @@ -178,7 +178,7 @@ return "[src] bleeps electronically." /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 e31999577e6..081f9aca473 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 c1daff518b6..b17d25ece2a 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 cbcc42b0d28..b0f80127515 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 be4053378b7..c23c5782af1 100644 --- a/code/modules/power/singularity/emitter.dm +++ b/code/modules/power/singularity/emitter.dm @@ -375,13 +375,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 32e3b4c8e2c..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 @@ -223,12 +224,12 @@ color = "#FFD700" fail_message = "" ///list of account IDs which have accepted the license prompt. If this is the multi-payment pin, then this means they accepted the waiver that each shot will cost them money - var/list/gun_owners = list() + var/list/gun_owners = list() ///how much gets paid out to license yourself to the gun - var/payment_amount + var/payment_amount var/datum/bank_account/pin_owner ///if true, user has to pay everytime they fire the gun - var/multi_payment = FALSE + var/multi_payment = FALSE var/owned = FALSE ///purchase prompt to prevent spamming it, set to the user who opens to prompt to prevent locking the gun up for other users. var/active_prompt_user @@ -321,10 +322,10 @@ pin_owner.adjust_money(payment_amount, "Firing Pin: Gun License Bought") gun_owners += credit_card_details to_chat(user, span_notice("Gun license purchased, have a secure day!")) - - else + + else to_chat(user, span_warning("ERROR: User balance insufficent for successful transaction!")) - + if("No", null) to_chat(user, span_warning("ERROR: User has declined to purchase gun license!")) active_prompt_user = null diff --git a/code/modules/reagents/chemistry/machinery/chem_dispenser.dm b/code/modules/reagents/chemistry/machinery/chem_dispenser.dm index 2b8fe02c4ef..331327c7983 100644 --- a/code/modules/reagents/chemistry/machinery/chem_dispenser.dm +++ b/code/modules/reagents/chemistry/machinery/chem_dispenser.dm @@ -152,13 +152,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 407f96dfa35..4327567fb17 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 ef80897dc05..1573b39c8fe 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 @@ -634,14 +639,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 595ac0787b2..14423abd580 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 cb2de16df60..bcb6984777e 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 5d2c91d1b48..7ca8f270005 100644 --- a/code/modules/station_goals/bsa.dm +++ b/code/modules/station_goals/bsa.dm @@ -392,6 +392,8 @@ GLOBAL_VAR_INIT(bsa_unlock, FALSE) return cannon /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 f1c7cce7b03..8df969c3bec 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 bdc02d0ca94..29b3c2978e1 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 601009a8018..fe3b9a7e280 100644 --- a/code/modules/vending/_vending.dm +++ b/code/modules/vending/_vending.dm @@ -852,11 +852,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