Skip to content
This repository was archived by the owner on May 22, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
2194511
literal misinformation
Runian Jul 23, 2023
aef4702
objs, comsigs, bitfields & proc
Runian Jul 23, 2023
da16a69
consistent
Runian Jul 23, 2023
3318d3e
add cmag item
Runian Jul 23, 2023
b1d190e
ai no interact w/ cmag
Runian Jul 24, 2023
5e5e6ec
consistent
Runian Jul 24, 2023
1b3a655
functionality
Runian Jul 24, 2023
71f5f95
all done. after = fixes/more features
Runian Jul 24, 2023
bba2d92
5 to SOOTH the balance council
Runian Jul 24, 2023
cd0fd5d
use sprite
Runian Jul 24, 2023
b8c14f1
lol nvm decrease to 4
Runian Jul 24, 2023
fd5c82c
-ful
Runian Jul 24, 2023
4e84e34
why was this flipped
Runian Jul 24, 2023
8cfd2d1
forgot a laugh here
Runian Jul 24, 2023
59792fa
Merge branch 'yogstation13:master' into HONK-cmeg
Runian Jul 25, 2023
6138186
conversion pt.1
Runian Jul 27, 2023
e26108c
conversion, uh next
Runian Jul 27, 2023
d453e0e
Merge branch 'yogstation13:master' into HONK-cmeg
Runian Jul 27, 2023
c0169e1
how do i even delete this??
Runian Jul 27, 2023
c5f1744
true false everywhere
Runian Jul 27, 2023
5bbfad1
EVERYWHERE
Runian Jul 27, 2023
40c1b96
epic fail
Runian Jul 27, 2023
83f1857
move it up
Runian Jul 27, 2023
0784967
dont need to return here
Runian Jul 27, 2023
77ba783
probably dont need these nulls
Runian Jul 27, 2023
6900580
dont need this here either
Runian Jul 27, 2023
be3dcb3
last pass
Runian Jul 27, 2023
54a9164
yep
Runian Jul 27, 2023
307601e
charges
Runian Jul 27, 2023
d8b9acc
max_charges
Runian Jul 27, 2023
b883f0a
Merge branch 'master' into HONK-cmeg
Runian Jul 29, 2023
c122734
space
Runian Jul 29, 2023
eef5ca1
Merge branch 'yogstation13:master' into HONK-cmeg
Runian Jul 30, 2023
8c870a4
Merge branch 'master' into HONK-cmeg
Runian Aug 3, 2023
bffa10b
removed unused var
Runian Aug 3, 2023
d58e9d1
Merge branch 'yogstation13:master' into HONK-cmeg
Runian Aug 14, 2023
1d57bac
as requested
Runian Aug 14, 2023
e4ddef5
unneeded check
Runian Aug 14, 2023
8d439f6
Update code/game/machinery/porta_turret/portable_turret_cover.dm
Runian Aug 14, 2023
eec77ac
Update code/game/machinery/porta_turret/portable_turret_cover.dm
Runian Aug 14, 2023
0eaa5c4
Update yogstation/code/game/objects/structures/fireaxe.dm
Runian Aug 14, 2023
022ffe8
Update yogstation/code/game/objects/structures/fireaxe.dm
Runian Aug 14, 2023
6a0f4f9
Update code/game/objects/items/clown_items.dm
Runian Aug 14, 2023
bfea242
update_desc for fireaxe
Runian Aug 14, 2023
ad41074
update_name for lightreplacer
Runian Aug 14, 2023
4d7a581
replaces active cmag tell with a bikehorn
Runian Aug 14, 2023
33f0937
/emag/cmag -> /cmag
Runian Aug 14, 2023
bc79acd
SHOULD_CALL_PARENT(FALSE)
Runian Aug 18, 2023
63957fc
Merge branch 'master' into HONK-cmeg
JohnFulpWillard Aug 21, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#define COMPONENT_CANCEL_BLOB_ACT (1<<0)
///from base of atom/acid_act(): (acidpwr, acid_volume)
#define COMSIG_ATOM_ACID_ACT "atom_acid_act"
///from base of atom/emag_act(): (/mob/user)
///from base of atom/emag_act(): (/mob/user, /obj/item/card/emag)
#define COMSIG_ATOM_EMAG_ACT "atom_emag_act"
///! from base of atom/rad_act(intensity, collectable_radiation)
#define COMSIG_ATOM_RAD_ACT "atom_rad_act"
Expand Down
1 change: 1 addition & 0 deletions code/__DEFINES/obj_flags.dm
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#define USES_TGUI (1<<7) //put on things that use tgui on ui_interact instead of custom/old UI.
#define FROZEN (1<<8)
#define UNIQUE_REDESC (1<<9) // can you customize the description of the thing?
#define CMAGGED (1<<10)

// If you add new ones, be sure to add them to /obj/Initialize as well for complete mapping support

Expand Down
1 change: 1 addition & 0 deletions code/_globalvars/bitfields.dm
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ GLOBAL_LIST_INIT(bitfields, list(
"USES_TGUI" = USES_TGUI,
"FROZEN" = FROZEN,
"UNIQUE_REDESC" = UNIQUE_REDESC,
"CMAGGED" = CMAGGED,
),
"datum_flags" = list(
"DF_USE_TAG" = DF_USE_TAG,
Expand Down
8 changes: 4 additions & 4 deletions code/_onclick/ai.dm
Original file line number Diff line number Diff line change
Expand Up @@ -131,14 +131,14 @@

/* Airlocks */
/obj/machinery/door/airlock/AICtrlClick() // Bolts doors
if(obj_flags & EMAGGED)
if((obj_flags & EMAGGED) || (obj_flags & CMAGGED))
return

toggle_bolt(usr)
add_hiddenprint(usr)

/obj/machinery/door/airlock/AIAltClick() // Eletrifies doors.
if(obj_flags & EMAGGED)
if((obj_flags & EMAGGED) || (obj_flags & CMAGGED))
return

if(!secondsElectrified)
Expand All @@ -147,14 +147,14 @@
shock_restore(usr)

/obj/machinery/door/airlock/AIShiftClick() // Opens and closes doors!
if(obj_flags & EMAGGED)
if((obj_flags & EMAGGED) || (obj_flags & CMAGGED))
return

user_toggle_open(usr)
add_hiddenprint(usr)

/obj/machinery/door/airlock/AICtrlShiftClick() // Sets/Unsets Emergency Access Override
if(obj_flags & EMAGGED)
if((obj_flags & EMAGGED) || (obj_flags & CMAGGED))
return

toggle_emergency(usr)
Expand Down
13 changes: 9 additions & 4 deletions code/game/atoms.dm
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@
var/base_pixel_y = 0
///the base icon state used for anything that changes their icon state.
var/base_icon_state

///Mobs that are currently do_after'ing this atom, to be cleared from on Destroy()
var/list/targeted_by

Expand Down Expand Up @@ -798,10 +797,16 @@
/**
* 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()
SEND_SIGNAL(src, COMSIG_ATOM_EMAG_ACT)
/atom/proc/emag_act(mob/user, obj/item/card/emag/emag_card)
SHOULD_CALL_PARENT(FALSE) // Emag act should either be: overridden (no signal) or default (signal).
Copy link
Contributor

@JohnFulpWillard JohnFulpWillard Aug 20, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NO IT SHOULD BE TRUEE

though I guess it would require a lot more work with emags. Perhaps best to leave for a future PR, don't want to get this one more creeped than it is now

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't it just be adding ..() to every emag_act?

return (SEND_SIGNAL(src, COMSIG_ATOM_EMAG_ACT, user, emag_card))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SHOULD_CALL_PARENT?

Copy link
Contributor Author

@Runian Runian Aug 18, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not many other acts (i.e, rad_act or rcd_act) ever use ..() whenever overridden or have any SHOULD_CALL_PARENT, so I don't see why emag_act should be different. Will set to false though.


/**
* Respond to a radioactive wave hitting this atom
Expand Down
5 changes: 3 additions & 2 deletions code/game/machinery/Sleeper.dm
Original file line number Diff line number Diff line change
Expand Up @@ -118,11 +118,12 @@
if(is_operational() && occupant)
open_machine()

/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_danger("You disable the chemical injection inhibitors on the sleeper..."))
obj_flags |= EMAGGED
return TRUE

/obj/machinery/sleeper/MouseDrop_T(mob/target, mob/user)
if(user.stat || !Adjacent(user) || !user.Adjacent(target) || !iscarbon(target) || !user.IsAdvancedToolUser())
Expand Down
5 changes: 3 additions & 2 deletions code/game/machinery/airlock_cycle_control.dm
Original file line number Diff line number Diff line change
Expand Up @@ -786,12 +786,13 @@
. = ..()
update_cycle_icon()

/obj/machinery/advanced_airlock_controller/emag_act(mob/user)
/obj/machinery/advanced_airlock_controller/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."))
playsound(src, "sparks", 50, 1)
return TRUE

/obj/machinery/advanced_airlock_controller/obj_break(damage_flag)
..()
Expand Down
10 changes: 6 additions & 4 deletions code/game/machinery/announcement_system.dm
Original file line number Diff line number Diff line change
Expand Up @@ -160,18 +160,20 @@ GLOBAL_LIST_EMPTY(announcement_systems)

/obj/machinery/announcement_system/proc/act_up() //does funny breakage stuff
if(!obj_break()) // if badmins flag this unbreakable or its already broken
return
return FALSE

arrival = pick("#!@%ERR-34%2 CANNOT LOCAT@# JO# F*LE!", "CRITICAL ERROR 99.", "ERR)#: DA#AB@#E NOT F(*ND!")
newhead = pick("OV#RL()D: \[UNKNOWN??\] DET*#CT)D!", "ER)#R - B*@ TEXT F*O(ND!", "AAS.exe is not responding. NanoOS is searching for a solution to the problem.")
return TRUE

/obj/machinery/announcement_system/emp_act(severity)
. = ..()
if(!(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()
return act_up()
5 changes: 3 additions & 2 deletions code/game/machinery/autolathe.dm
Original file line number Diff line number Diff line change
Expand Up @@ -311,14 +311,15 @@
. = ..()
adjust_hacked(TRUE)

/obj/machinery/autolathe/emag_act(mob/user)
/obj/machinery/autolathe/emag_act(mob/user, obj/item/card/emag/emag_card)
if(obj_flags & EMAGGED)
return
return FALSE
obj_flags |= EMAGGED
if(!hacked)
adjust_hacked(TRUE)
playsound(src, "sparks", 75, TRUE, -1)
to_chat(user, span_notice("You use the cryptographic sequencer on [src]."))
return TRUE

//Called when the object is constructed by an autolathe
//Has a reference to the autolathe so you can do !!FUN!! things with hacked lathes
Expand Down
7 changes: 4 additions & 3 deletions code/game/machinery/buttons.dm
Original file line number Diff line number Diff line change
Expand Up @@ -133,14 +133,15 @@
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
return FALSE
req_access = list()
req_one_access = list()
playsound(src, "sparks", 100, 1)
obj_flags |= EMAGGED

return TRUE

/obj/machinery/button/attack_ai(mob/user)
if(!panel_open)
return attack_hand(user)
Expand Down
5 changes: 3 additions & 2 deletions code/game/machinery/cloning.dm
Original file line number Diff line number Diff line change
Expand Up @@ -435,14 +435,15 @@ GLOBAL_VAR_INIT(clones, 0)
else
return ..()

/obj/machinery/clonepod/emag_act(mob/user)
/obj/machinery/clonepod/emag_act(mob/user, obj/item/card/emag/emag_card)
if(!occupant)
return
return FALSE
to_chat(user, span_warning("You corrupt the genetic compiler."))
malfunction()
add_fingerprint(user)
log_cloning("[key_name(user)] emagged [src] at [AREACOORD(src)], causing it to malfunction.")
log_combat(user, src, "emagged", null, occupant ? "[occupant] inside, killing them via malfunction." : null)
return TRUE

//Put messages in the connected computer's temp var for display.
/obj/machinery/clonepod/proc/connected_message(message)
Expand Down
5 changes: 3 additions & 2 deletions code/game/machinery/computer/apc_control.dm
Original file line number Diff line number Diff line change
Expand Up @@ -181,12 +181,13 @@
var/setTo = target.operating ? "On" : "Off"
log_activity("Turned APC [target.area.name]'s breaker [setTo]")

/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
log_game("[key_name(user)] emagged [src] at [AREACOORD(src)]")
playsound(src, "sparks", 50, TRUE)
return TRUE

/obj/machinery/computer/apc_control/proc/log_activity(log_text)
if(!should_log)
Expand Down
16 changes: 6 additions & 10 deletions code/game/machinery/computer/arcade.dm
Original file line number Diff line number Diff line change
Expand Up @@ -330,9 +330,9 @@ GLOBAL_LIST_INIT(arcade_prize_pool, list(
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
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!"
player_hp = 30
Expand All @@ -341,16 +341,11 @@ GLOBAL_LIST_INIT(arcade_prize_pool, list(
enemy_mp = 20
gameover = FALSE
blocked = FALSE

obj_flags |= EMAGGED

enemy_name = "Cuban Pete"
name = "Outbomb Cuban Pete"


updateUsrDialog()


return TRUE

// *** THE ORION TRAIL ** //

Expand Down Expand Up @@ -1084,14 +1079,15 @@ GLOBAL_LIST_INIT(arcade_prize_pool, list(
name = "The Orion Trail"
desc = "Learn how our ancestors planned to colonize Orion, and have fun in the process!"

/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
return FALSE
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 planned to colonize Orion, and try not to die in the process!"
newgame()
obj_flags |= EMAGGED
return TRUE

/mob/living/simple_animal/hostile/syndicate/ranged/smg/orion
name = "spaceport security"
Expand Down
7 changes: 4 additions & 3 deletions code/game/machinery/computer/communications.dm
Original file line number Diff line number Diff line change
Expand Up @@ -81,14 +81,15 @@
else
return ..()

/obj/machinery/computer/communications/emag_act(mob/user)
if (obj_flags & EMAGGED)
return
/obj/machinery/computer/communications/emag_act(mob/user, obj/item/card/emag/emag_card)
if(obj_flags & EMAGGED)
return FALSE
obj_flags |= EMAGGED
if (authenticated)
authorize_access = get_all_accesses()
to_chat(user, span_danger("You scramble the communication routing circuits!"))
playsound(src, 'sound/machines/terminal_alert.ogg', 50, 0)
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
22 changes: 11 additions & 11 deletions code/game/machinery/computer/security.dm
Original file line number Diff line number Diff line change
Expand Up @@ -846,7 +846,9 @@
//Cancel silicon alert after 1 minute
addtimer(CALLBACK(SILICON, TYPE_PROC_REF(/mob/living/silicon, cancelAlarm),"Burglar",src,alarmed), 600)

/obj/machinery/computer/secure_data/emag_act(mob/user)
/obj/machinery/computer/secure_data/emag_act(mob/user, obj/item/card/emag/emag_card)
if(logged_in) // What was the point then?
return FALSE
var/name
if(ishuman(user))
var/mob/living/carbon/human/human_user = user
Expand All @@ -855,18 +857,16 @@
name = "[ID.registered_name]"
else
name = "Unknown"

if(issilicon(user))
name = "[user.name]"

if(!logged_in)
logged_in = TRUE
to_chat(user, span_warning("You override [src]'s ID lock."))
trigger_alarm()
playsound(src, 'sound/effects/alert.ogg', 50, TRUE)
var/area/A = get_area(loc)
radio.talk_into(src, "Alert: security breach alarm triggered in [A.map_name]!! Unauthorized access by [name] of [src]!!", sec_freq)
radio.talk_into(src, "Alert: security breach alarm triggered in [A.map_name]!! Unauthorized access by [name] of [src]!!", command_freq)
logged_in = TRUE
to_chat(user, span_warning("You override [src]'s ID lock."))
trigger_alarm()
playsound(src, 'sound/effects/alert.ogg', 50, TRUE)
var/area/A = get_area(loc)
radio.talk_into(src, "Alert: security breach alarm triggered in [A.map_name]!! Unauthorized access by [name] of [src]!!", sec_freq)
radio.talk_into(src, "Alert: security breach alarm triggered in [A.map_name]!! Unauthorized access by [name] of [src]!!", command_freq)
return TRUE

/obj/machinery/computer/secure_data/emp_act(severity)
. = ..()
Expand Down
11 changes: 6 additions & 5 deletions code/game/machinery/decontamination.dm
Original file line number Diff line number Diff line change
Expand Up @@ -169,19 +169,20 @@
s.start()
electrocute_mob(user, src, src, 1, TRUE)

/obj/machinery/decontamination_unit/emag_act(mob/user)
/obj/machinery/decontamination_unit/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
return FALSE
if(!state_open)
if(!panel_open)
to_chat(user, span_warning("Open the panel first."))
return
return FALSE
else
return
return FALSE
to_chat(user, span_warning("You short out [src]'s safeties."))
uv_emagged = TRUE
obj_flags |= EMAGGED
return TRUE

/obj/machinery/decontamination_unit/relaymove(mob/user)
if(locked)
Expand Down Expand Up @@ -249,7 +250,7 @@
/obj/machinery/decontamination_unit/examine(mob/user)
. = ..()
if(obj_flags & EMAGGED)
. += span_warning("Its maintenance panel is smoking slightly.")
. += span_warning("The maintenance panel is smoking slightly.")
if(in_range(user, src) || isobserver(user))
if (contents.len >= max_n_of_items)
. += span_notice("The status display reads: <b>Inventory full!</b> Please remove items or upgrade the parts of this storage unit.")
Expand Down
Loading