Skip to content

Commit

Permalink
#76669 mirror
Browse files Browse the repository at this point in the history
  • Loading branch information
KittyNoodle committed Nov 18, 2023
1 parent c336a7f commit 1e6b60e
Show file tree
Hide file tree
Showing 98 changed files with 655 additions and 364 deletions.
9 changes: 7 additions & 2 deletions code/game/atoms.dm
Original file line number Diff line number Diff line change
Expand Up @@ -1040,10 +1040,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
Expand Down
6 changes: 4 additions & 2 deletions code/game/machinery/announcement_system.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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
11 changes: 7 additions & 4 deletions code/game/machinery/barsigns.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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()))
Expand Down
8 changes: 4 additions & 4 deletions code/game/machinery/buttons.dm
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,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
Expand All @@ -139,9 +139,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)
Expand Down
9 changes: 6 additions & 3 deletions code/game/machinery/computer/apc_control.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
10 changes: 6 additions & 4 deletions code/game/machinery/computer/arcade/arcade.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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 = "<br><center><h2>If you die in the game, you die for real!<center><h2>"
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
Expand All @@ -644,6 +645,7 @@ GLOBAL_LIST_INIT(arcade_prize_pool, list(
name = "Outbomb Cuban Pete"

updateUsrDialog()
return TRUE

// ** AMPUTATION ** //

Expand Down
11 changes: 7 additions & 4 deletions code/game/machinery/computer/arcade/orion.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
21 changes: 12 additions & 9 deletions code/game/machinery/computer/communications.dm
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -116,26 +116,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)
Expand Down
34 changes: 20 additions & 14 deletions code/game/machinery/doors/airlock.dm
Original file line number Diff line number Diff line change
Expand Up @@ -1327,23 +1327,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!
Expand Down
9 changes: 5 additions & 4 deletions code/game/machinery/doors/firedoor.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions code/game/machinery/doors/unpowered.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
14 changes: 9 additions & 5 deletions code/game/machinery/doors/windowdoor.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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)
. = ..()
Expand Down
7 changes: 4 additions & 3 deletions code/game/machinery/embedded_controller/access_controller.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down
5 changes: 3 additions & 2 deletions code/game/machinery/fat_sucker.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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
9 changes: 5 additions & 4 deletions code/game/machinery/firealarm.dm
Original file line number Diff line number Diff line change
Expand Up @@ -214,17 +214,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
Expand Down
6 changes: 4 additions & 2 deletions code/game/machinery/gulag_item_reclaimer.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
8 changes: 5 additions & 3 deletions code/game/machinery/harvester.dm
Original file line number Diff line number Diff line change
Expand Up @@ -174,12 +174,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
to_chat(user, span_warning("You overload [src]'s lifesign scanners."))
allow_clothing = TRUE
balloon_alert(!user, "lifesign scanners overloaded")
return TRUE

/obj/machinery/harvester/container_resist_act(mob/living/user)
if(!harvesting)
Expand Down
Loading

0 comments on commit 1e6b60e

Please sign in to comment.