diff --git a/_maps/RandomRuins/LavaRuins/lavaland_biodome_beach.dmm b/_maps/RandomRuins/LavaRuins/lavaland_biodome_beach.dmm index 790e628cba4..af06c158d99 100644 --- a/_maps/RandomRuins/LavaRuins/lavaland_biodome_beach.dmm +++ b/_maps/RandomRuins/LavaRuins/lavaland_biodome_beach.dmm @@ -1,4 +1,4 @@ -//MAP CONVERTED BY dmm2tgm.py THIS HEADER COMMENT PREVENTS RECONVERSION, DO NOT REMOVE +//MAP CONVERTED BY dmm2tgm.py THIS HEADER COMMENT PREVENTS RECONVERSION, DO NOT REMOVE "aa" = ( /turf/template_noop, /area/template_noop) @@ -146,7 +146,7 @@ /area/ruin/powered/beach) "aF" = ( /obj/machinery/vending/boozeomat{ - emagged = 1; + set_obj_flags = "EMAGGED"; req_access_txt = "0" }, /turf/open/floor/wood, diff --git a/_maps/RandomRuins/LavaRuins/lavaland_surface_greed.dmm b/_maps/RandomRuins/LavaRuins/lavaland_surface_greed.dmm index 28657c7e6de..7847aa3b813 100644 --- a/_maps/RandomRuins/LavaRuins/lavaland_surface_greed.dmm +++ b/_maps/RandomRuins/LavaRuins/lavaland_surface_greed.dmm @@ -1,4 +1,4 @@ -//MAP CONVERTED BY dmm2tgm.py THIS HEADER COMMENT PREVENTS RECONVERSION, DO NOT REMOVE +//MAP CONVERTED BY dmm2tgm.py THIS HEADER COMMENT PREVENTS RECONVERSION, DO NOT REMOVE "a" = ( /turf/open/floor/plating/asteroid/basalt/lava_land_surface, /area/lavaland/surface/outdoors) @@ -55,7 +55,7 @@ /area/ruin/powered/greed) "k" = ( /obj/machinery/computer/arcade/battle{ - emagged = 1 + set_obj_flags = "EMAGGED" }, /turf/open/floor/engine/cult, /area/ruin/powered/greed) diff --git a/_maps/RandomRuins/SpaceRuins/crashedship.dmm b/_maps/RandomRuins/SpaceRuins/crashedship.dmm index 8ff4d4b1ae7..01c4e6a098d 100644 --- a/_maps/RandomRuins/SpaceRuins/crashedship.dmm +++ b/_maps/RandomRuins/SpaceRuins/crashedship.dmm @@ -16,7 +16,7 @@ "ag" = ( /obj/machinery/porta_turret{ dir = 8; - emagged = 1; + set_obj_flags = "EMAGGED"; installation = /obj/item/gun/energy/lasercannon }, /turf/open/floor/engine, @@ -1860,7 +1860,7 @@ "gl" = ( /obj/machinery/porta_turret{ dir = 8; - emagged = 1; + set_obj_flags = "EMAGGED"; installation = /obj/item/gun/energy/lasercannon }, /turf/open/floor/engine, diff --git a/_maps/RandomZLevels/beach.dmm b/_maps/RandomZLevels/beach.dmm index 10fa8be8612..5e910afcbf9 100644 --- a/_maps/RandomZLevels/beach.dmm +++ b/_maps/RandomZLevels/beach.dmm @@ -144,7 +144,7 @@ /area/awaymission/beach) "aA" = ( /obj/machinery/vending/boozeomat{ - emagged = 1 + set_obj_flags = "EMAGGED" }, /turf/open/floor/wood, /area/awaymission/beach) diff --git a/_maps/RandomZLevels/challenge.dmm b/_maps/RandomZLevels/challenge.dmm index b5734cfcd46..c5d253c6bb5 100644 --- a/_maps/RandomZLevels/challenge.dmm +++ b/_maps/RandomZLevels/challenge.dmm @@ -242,7 +242,7 @@ "aX" = ( /obj/machinery/porta_turret{ dir = 8; - emagged = 1; + set_obj_flags = "EMAGGED"; installation = /obj/item/gun/energy/lasercannon }, /turf/open/floor/plating/airless, @@ -384,7 +384,7 @@ "bq" = ( /obj/machinery/porta_turret{ dir = 8; - emagged = 1; + set_obj_flags = "EMAGGED"; installation = /obj/item/gun/energy/lasercannon }, /turf/open/floor/plating, diff --git a/_maps/RandomZLevels/moonoutpost19.dmm b/_maps/RandomZLevels/moonoutpost19.dmm index 589befc3511..4bae843b31c 100644 --- a/_maps/RandomZLevels/moonoutpost19.dmm +++ b/_maps/RandomZLevels/moonoutpost19.dmm @@ -1127,7 +1127,7 @@ "cr" = ( /obj/machinery/door/airlock/public/glass{ density = 0; - emagged = 1; + set_obj_flags = "EMAGGED"; icon_state = "open"; locked = 1; name = "Dormitories" @@ -1438,7 +1438,7 @@ "cT" = ( /obj/machinery/door/airlock{ density = 0; - emagged = 1; + set_obj_flags = "EMAGGED"; icon_state = "open"; id_tag = "awaydorm4"; locked = 1; @@ -1750,7 +1750,7 @@ "du" = ( /obj/machinery/door/airlock/external{ density = 0; - emagged = 1; + set_obj_flags = "EMAGGED"; icon_state = "open"; locked = 1; opacity = 0; @@ -1910,7 +1910,7 @@ "dI" = ( /obj/machinery/door/airlock/external{ density = 0; - emagged = 1; + set_obj_flags = "EMAGGED"; icon_state = "open"; locked = 1; opacity = 0; @@ -2784,7 +2784,7 @@ /obj/machinery/door/firedoor, /obj/machinery/door/airlock/research{ density = 0; - emagged = 1; + set_obj_flags = "EMAGGED"; icon_state = "open"; locked = 1; name = "Xenobiology Lab"; @@ -3948,7 +3948,7 @@ /obj/machinery/door/firedoor, /obj/machinery/door/airlock/command{ density = 0; - emagged = 1; + set_obj_flags = "EMAGGED"; icon_state = "open"; locked = 1; name = "Research Director's Office"; diff --git a/_maps/RandomZLevels/spacebattle.dmm b/_maps/RandomZLevels/spacebattle.dmm index d1b199e8a3c..4dff027d92e 100644 --- a/_maps/RandomZLevels/spacebattle.dmm +++ b/_maps/RandomZLevels/spacebattle.dmm @@ -226,7 +226,7 @@ "bc" = ( /obj/machinery/porta_turret{ dir = 8; - emagged = 1; + set_obj_flags = "EMAGGED"; installation = /obj/item/gun/energy/lasercannon }, /turf/open/floor/plating, @@ -322,7 +322,7 @@ "by" = ( /obj/machinery/porta_turret{ dir = 8; - emagged = 1; + set_obj_flags = "EMAGGED"; installation = /obj/item/gun/energy/lasercannon }, /turf/open/floor/plating, @@ -344,7 +344,7 @@ "bG" = ( /obj/machinery/porta_turret{ dir = 8; - emagged = 1; + set_obj_flags = "EMAGGED"; installation = /obj/item/gun/energy/lasercannon }, /turf/open/floor/plating, @@ -917,7 +917,7 @@ "dZ" = ( /obj/machinery/porta_turret{ dir = 8; - emagged = 1; + set_obj_flags = "EMAGGED"; installation = /obj/item/gun/energy/lasercannon }, /turf/open/floor/engine, @@ -1718,7 +1718,7 @@ "gP" = ( /obj/machinery/porta_turret{ dir = 8; - emagged = 1; + set_obj_flags = "EMAGGED"; installation = /obj/item/gun/energy/lasercannon }, /turf/open/floor/plating/airless, @@ -2613,7 +2613,7 @@ "kq" = ( /obj/machinery/porta_turret{ dir = 8; - emagged = 1; + set_obj_flags = "EMAGGED"; installation = /obj/item/gun/energy/lasercannon }, /turf/open/floor/engine/vacuum, diff --git a/code/__DEFINES/obj_flags.dm b/code/__DEFINES/obj_flags.dm new file mode 100644 index 00000000000..2dffa6b5bb3 --- /dev/null +++ b/code/__DEFINES/obj_flags.dm @@ -0,0 +1,12 @@ +// Flags for the obj_flags var on /obj + + +#define EMAGGED 1 +#define IN_USE 2 // If we have a user using us, this will be set on. We will check if the user has stopped using us, and thus stop updating and LAGGING EVERYTHING! +#define CAN_BE_HIT 4 //can this be bludgeoned by items? +#define BEING_SHOCKED 8 // Whether this thing is currently (already) being shocked by a tesla +#define DANGEROUS_POSSESSION 16 //Admin possession yes/no +#define ON_BLUEPRINTS 32 //Are we visible on the station blueprints at roundstart? +#define UNIQUE_RENAME 64 // can you customize the description/name of the thing? + +// If you add new ones, be sure to add them to /obj/Initialize as well for complete mapping support diff --git a/code/__DEFINES/vv.dm b/code/__DEFINES/vv.dm index 807e5187b08..0617c5d3457 100644 --- a/code/__DEFINES/vv.dm +++ b/code/__DEFINES/vv.dm @@ -18,4 +18,4 @@ #define VV_NULL "NULL" #define VV_RESTORE_DEFAULT "Restore to Default" #define VV_MARKED_DATUM "Marked Datum" - +#define VV_BITFIELD "Bitfield" diff --git a/code/_globalvars/misc.dm b/code/_globalvars/misc.dm index 8b8b8175863..2cc7b38bbe2 100644 --- a/code/_globalvars/misc.dm +++ b/code/_globalvars/misc.dm @@ -17,4 +17,6 @@ GLOBAL_LIST_EMPTY(powernets) GLOBAL_VAR_INIT(bsa_unlock, FALSE) //BSA unlocked by head ID swipes -GLOBAL_LIST_EMPTY(player_details) // ckey -> /datum/player_details \ No newline at end of file +GLOBAL_LIST_EMPTY(player_details) // ckey -> /datum/player_details + +GLOBAL_LIST_INIT(bitfields, list("obj_flags" = list("EMAGGED" = EMAGGED, "IN_USE" = IN_USE, "CAN_BE_HIT" = CAN_BE_HIT, "BEING_SHOCKED" = BEING_SHOCKED, "DANGEROUS_POSSESSION" = DANGEROUS_POSSESSION, "ON_BLUEPRINTS" = ON_BLUEPRINTS, "UNIQUE_RENAME" = UNIQUE_RENAME))) diff --git a/code/_onclick/ai.dm b/code/_onclick/ai.dm index e97f4d5426c..ac034657733 100644 --- a/code/_onclick/ai.dm +++ b/code/_onclick/ai.dm @@ -130,16 +130,16 @@ /* Airlocks */ /obj/machinery/door/airlock/AICtrlClick() // Bolts doors - if(emagged) + if(obj_flags & EMAGGED) return - + if(locked) bolt_raise(usr) else bolt_drop(usr) /obj/machinery/door/airlock/AIAltClick() // Eletrifies doors. - if(emagged) + if(obj_flags & EMAGGED) return if(!secondsElectrified) @@ -148,15 +148,15 @@ shock_restore(usr) /obj/machinery/door/airlock/AIShiftClick() // Opens and closes doors! - if(emagged) + if(obj_flags & EMAGGED) return user_toggle_open(usr) /obj/machinery/door/airlock/AICtrlShiftClick() // Sets/Unsets Emergency Access Override - if(emagged) + if(obj_flags & EMAGGED) return - + if(!emergency) emergency_on(usr) else diff --git a/code/_onclick/item_attack.dm b/code/_onclick/item_attack.dm index 8a5b9ba519b..8f5ed37457d 100644 --- a/code/_onclick/item_attack.dm +++ b/code/_onclick/item_attack.dm @@ -39,7 +39,7 @@ return FALSE /obj/attackby(obj/item/I, mob/living/user, params) - return ..() || (can_be_hit && I.attack_obj(src, user)) + return ..() || ((obj_flags & CAN_BE_HIT) && I.attack_obj(src, user)) /mob/living/attackby(obj/item/I, mob/living/user, params) user.changeNext_move(CLICK_CD_MELEE) @@ -62,7 +62,7 @@ if(force && user.has_disability(DISABILITY_PACIFISM)) to_chat(user, "You don't want to harm other living beings!") return - + if(!force) playsound(loc, 'sound/weapons/tap.ogg', get_clamped_volume(), 1, -1) else if(hitsound) diff --git a/code/datums/browser.dm b/code/datums/browser.dm index f863a5007d3..679285a2720 100644 --- a/code/datums/browser.dm +++ b/code/datums/browser.dm @@ -120,13 +120,7 @@ else WARNING("Browser [title] tried to close with a null ID") -/datum/browser/alert - var/selectedbutton = 0 - var/opentime = 0 - var/timeout - var/stealfocus - -/datum/browser/alert/New(User,Message,Title,Button1="Ok",Button2,Button3,StealFocus = 1,Timeout=6000) +/datum/browser/modal/alert/New(User,Message,Title,Button1="Ok",Button2,Button3,StealFocus = 1,Timeout=6000) if (!User) return @@ -142,44 +136,10 @@ output += {""} - ..(User, ckey("[User]-[Message]-[Title]-[world.time]-[rand(1,10000)]"), Title, 350, 150, src) + ..(User, ckey("[User]-[Message]-[Title]-[world.time]-[rand(1,10000)]"), Title, 350, 150, src, StealFocus, Timeout) set_content(output) - stealfocus = StealFocus - if (!StealFocus) - window_options += "focus=false;" - timeout = Timeout -/datum/browser/alert/open() - set waitfor = 0 - opentime = world.time - - if (stealfocus) - . = ..(use_onclose = 1) - else - var/focusedwindow = winget(user, null, "focus") - . = ..(use_onclose = 1) - - //waits for the window to show up client side before attempting to un-focus it - //winexists sleeps until it gets a reply from the client, so we don't need to bother sleeping - for (var/i in 1 to 10) - if (user && winexists(user, window_id)) - if (focusedwindow) - winset(user, focusedwindow, "focus=true") - else - winset(user, "mapwindow", "focus=true") - break - if (timeout) - addtimer(CALLBACK(src, .proc/close), timeout) - -/datum/browser/alert/close() - .=..() - opentime = 0 - -/datum/browser/alert/proc/wait() - while (opentime && selectedbutton <= 0 && (!timeout || opentime+timeout > world.time)) - stoplag(1) - -/datum/browser/alert/Topic(href,href_list) +/datum/browser/modal/alert/Topic(href,href_list) if (href_list["close"] || !user || !user.client) opentime = 0 return @@ -210,12 +170,135 @@ User = C.mob else return - var/datum/browser/alert/A = new(User, Message, Title, Button1, Button2, Button3, StealFocus, Timeout) + var/datum/browser/modal/alert/A = new(User, Message, Title, Button1, Button2, Button3, StealFocus, Timeout) A.open() A.wait() if (A.selectedbutton) return A.selectedbutton +/datum/browser/modal + var/opentime = 0 + var/timeout + var/selectedbutton = 0 + var/stealfocus + +/datum/browser/modal/New(nuser, nwindow_id, ntitle = 0, nwidth = 0, nheight = 0, var/atom/nref = null, StealFocus = 1, Timeout = 6000) + ..() + stealfocus = StealFocus + if (!StealFocus) + window_options += "focus=false;" + timeout = Timeout + + +/datum/browser/modal/close() + .=..() + opentime = 0 + +/datum/browser/modal/open() + set waitfor = 0 + opentime = world.time + + if (stealfocus) + . = ..(use_onclose = 1) + else + var/focusedwindow = winget(user, null, "focus") + . = ..(use_onclose = 1) + + //waits for the window to show up client side before attempting to un-focus it + //winexists sleeps until it gets a reply from the client, so we don't need to bother sleeping + for (var/i in 1 to 10) + if (user && winexists(user, window_id)) + if (focusedwindow) + winset(user, focusedwindow, "focus=true") + else + winset(user, "mapwindow", "focus=true") + break + if (timeout) + addtimer(CALLBACK(src, .proc/close), timeout) + +/datum/browser/modal/proc/wait() + while (opentime && selectedbutton <= 0 && (!timeout || opentime+timeout > world.time)) + stoplag(1) + +/datum/browser/modal/listpicker + var/valueslist = list() + +/datum/browser/modal/listpicker/New(User,Message,Title,Button1="Ok",Button2,Button3,StealFocus = 1, Timeout = FALSE,list/values,Radio=FALSE) + if (!User) + return + + var/output = {"
+ "} + + if (Button2) + output += {""} + + if (Button3) + output += {""} + + output += {"
"} + ..(User, ckey("[User]-[Message]-[Title]-[world.time]-[rand(1,10000)]"), Title, 350, 350, src, StealFocus, Timeout) + set_content(output) + +/datum/browser/modal/listpicker/Topic(href,href_list) + if (href_list["close"] || !user || !user.client) + opentime = 0 + return + if (href_list["button"]) + var/button = text2num(href_list["button"]) + if (button <= 3 && button >= 1) + selectedbutton = button + for (var/item in href_list) + switch(item) + if ("close", "button", "src") + continue + else + valueslist[item] = href_list[item] + opentime = 0 + close() + +/proc/presentpicker(var/mob/User,Message, Title, Button1="Ok", Button2, Button3, StealFocus = 1,Timeout = 6000,list/values,Radio=FALSE) + if (!istype(User)) + if (istype(User, /client/)) + var/client/C = User + User = C.mob + else + return + var/datum/browser/modal/listpicker/A = new(User, Message, Title, Button1, Button2, Button3, StealFocus,Timeout, values,Radio) + A.open() + A.wait() + if (A.selectedbutton) + return list("button" = A.selectedbutton, "values" = A.valueslist) + +/proc/input_bitfield(var/mob/User, title, bitfield, current_value) + if (!User || !(bitfield in GLOB.bitfields)) + return + var/list/pickerlist = list() + for (var/i in GLOB.bitfields[bitfield]) + if (current_value & GLOB.bitfields[bitfield][i]) + pickerlist += list(list("checked" = 1, "value" = GLOB.bitfields[bitfield][i], "name" = i)) + else + pickerlist += list(list("checked" = 0, "value" = GLOB.bitfields[bitfield][i], "name" = i)) + var/list/result = presentpicker(User, "", title, Button1="Save", Button2 = "Cancel", Timeout=FALSE, values = pickerlist) + + if (islist(result)) + if (result["button"] == 2) // If the user pressed the cancel button + return + . = 0 + for (var/flag in result["values"]) + . |= GLOB.bitfields[bitfield][flag] + else + return + // This will allow you to show an icon in the browse window // This is added to mob so that it can be used without a reference to the browser object // There is probably a better place for this... diff --git a/code/datums/datumvars.dm b/code/datums/datumvars.dm index 672ec3a58bd..c8050adb24c 100644 --- a/code/datums/datumvars.dm +++ b/code/datums/datumvars.dm @@ -433,6 +433,12 @@ else item = "[VV_HTML_ENCODE(name)] = /list ([L.len])" + else if (name in GLOB.bitfields) + var/list/flags = list() + for (var/i in GLOB.bitfields[name]) + if (value & GLOB.bitfields[name][i]) + flags += i + item = "[VV_HTML_ENCODE(name)] = [VV_HTML_ENCODE(jointext(flags, ", "))]" else item = "[VV_HTML_ENCODE(name)] = [VV_HTML_ENCODE(value)]" @@ -1215,4 +1221,3 @@ message_admins(msg) admin_ticket_log(L, msg) href_list["datumrefresh"] = href_list["mobToDamage"] - diff --git a/code/datums/wires/airlock.dm b/code/datums/wires/airlock.dm index 2690ae51505..5a01227b033 100644 --- a/code/datums/wires/airlock.dm +++ b/code/datums/wires/airlock.dm @@ -28,7 +28,7 @@ var/list/status = list() status += "The door bolts [A.locked ? "have fallen!" : "look up."]" status += "The test light is [A.hasPower() ? "on" : "off"]." - status += "The AI connection light is [A.aiControlDisabled || A.emagged ? "off" : "on"]." + status += "The AI connection light is [A.aiControlDisabled || (A.obj_flags & EMAGGED) ? "off" : "on"]." status += "The check wiring light is [A.safe ? "off" : "on"]." status += "The timer is powered [A.autoclose ? "on" : "off"]." status += "The speed light is [A.normalspeed ? "on" : "off"]." @@ -44,7 +44,7 @@ if(WIRE_BACKUP1, WIRE_BACKUP2) // Pulse to loose backup power. A.loseBackupPower() if(WIRE_OPEN) // Pulse to open door (only works not emagged and ID wire is cut or no access is required). - if(A.emagged) + if(A.obj_flags & EMAGGED) return if(!A.requiresID() || A.check_access(null)) if(A.density) diff --git a/code/game/gamemodes/clock_cult/clock_structures/ratvar_the_clockwork_justicar.dm b/code/game/gamemodes/clock_cult/clock_structures/ratvar_the_clockwork_justicar.dm index 2a549d9c3cd..06513e80f99 100644 --- a/code/game/gamemodes/clock_cult/clock_structures/ratvar_the_clockwork_justicar.dm +++ b/code/game/gamemodes/clock_cult/clock_structures/ratvar_the_clockwork_justicar.dm @@ -15,7 +15,7 @@ var/atom/prey //Whatever Ratvar is chasing var/clashing = FALSE //If Ratvar is fighting with Nar-Sie var/convert_range = 10 - dangerous_possession = TRUE + obj_flags = CAN_BE_HIT | DANGEROUS_POSSESSION /obj/structure/destructible/clockwork/massive/ratvar/Initialize() . = ..() diff --git a/code/game/gamemodes/malfunction/Malf_Modules.dm b/code/game/gamemodes/malfunction/Malf_Modules.dm index 89624764914..46891b420d5 100644 --- a/code/game/gamemodes/malfunction/Malf_Modules.dm +++ b/code/game/gamemodes/malfunction/Malf_Modules.dm @@ -505,7 +505,7 @@ GLOBAL_LIST_INIT(blacklisted_malf_machines, typecacheof(list( for(var/obj/machinery/firealarm/F in GLOB.machines) if(!is_station_level(F.z)) continue - F.emagged = TRUE + F.obj_flags |= EMAGGED to_chat(owner, "All thermal sensors on the station have been disabled. Fire alerts will no longer be recognized.") owner.playsound_local(owner, 'sound/machines/terminal_off.ogg', 50, 0) @@ -532,7 +532,7 @@ GLOBAL_LIST_INIT(blacklisted_malf_machines, typecacheof(list( for(var/obj/machinery/airalarm/AA in GLOB.machines) if(!is_station_level(AA.z)) continue - AA.emagged = TRUE + AA.obj_flags |= EMAGGED to_chat(owner, "All air alarm safeties on the station have been overriden. Air alarms may now use the Flood environmental mode.") owner.playsound_local(owner, 'sound/machines/terminal_off.ogg', 50, 0) diff --git a/code/game/machinery/_machinery.dm b/code/game/machinery/_machinery.dm index 97a41098f22..20a88382fab 100644 --- a/code/game/machinery/_machinery.dm +++ b/code/game/machinery/_machinery.dm @@ -93,7 +93,6 @@ Class Procs: max_integrity = 200 var/stat = 0 - var/emagged = FALSE var/use_power = IDLE_POWER_USE //0 = dont run the auto //1 = run auto, use idle @@ -505,4 +504,4 @@ Class Procs: #endif . = . % 9 AM.pixel_x = -8 + ((.%3)*8) - AM.pixel_y = -8 + (round( . / 3)*8) \ No newline at end of file + AM.pixel_y = -8 + (round( . / 3)*8) diff --git a/code/game/machinery/announcement_system.dm b/code/game/machinery/announcement_system.dm index 84a18e33524..5226084b96b 100644 --- a/code/game/machinery/announcement_system.dm +++ b/code/game/machinery/announcement_system.dm @@ -167,7 +167,7 @@ GLOBAL_LIST_EMPTY(announcement_systems) ..(severity) /obj/machinery/announcement_system/emag_act() - if(emagged) + if(obj_flags & EMAGGED) return - emagged = TRUE + obj_flags |= EMAGGED act_up() diff --git a/code/game/machinery/buttons.dm b/code/game/machinery/buttons.dm index 8a118b8d08c..997d16836d9 100644 --- a/code/game/machinery/buttons.dm +++ b/code/game/machinery/buttons.dm @@ -103,12 +103,12 @@ return ..() /obj/machinery/button/emag_act(mob/user) - if(emagged) + if(obj_flags & EMAGGED) return req_access = list() req_one_access = list() playsound(src, "sparks", 100, 1) - emagged = TRUE + obj_flags |= EMAGGED /obj/machinery/button/attack_ai(mob/user) if(!panel_open) diff --git a/code/game/machinery/computer/apc_control.dm b/code/game/machinery/computer/apc_control.dm index 7bd6cf46e02..fe3acc9f101 100644 --- a/code/game/machinery/computer/apc_control.dm +++ b/code/game/machinery/computer/apc_control.dm @@ -44,7 +44,7 @@ ..(user) /obj/machinery/computer/apc_control/proc/check_apc(obj/machinery/power/apc/APC) - return APC.z == z && !APC.malfhack && !APC.aidisabled && !APC.emagged && !APC.stat && !istype(APC.area, /area/ai_monitored) && !APC.area.outdoors + return APC.z == z && !APC.malfhack && !APC.aidisabled && !(APC.obj_flags & EMAGGED) && !APC.stat && !istype(APC.area, /area/ai_monitored) && !APC.area.outdoors /obj/machinery/computer/apc_control/interact(mob/living/user) var/dat @@ -71,7 +71,7 @@ [APC.aidisabled || APC.panel_open ? "APC does not respond to interface query." : "APC responds to interface query."]

" dat += "Check Logs
" dat += "Log Out
" - if(emagged) + if(obj_flags & EMAGGED) dat += "WARNING: Logging functionality partially disabled from outside source.
" dat += "Restore logging functionality?
" else @@ -80,7 +80,7 @@ dat += "[entry]
" else dat += "No activity has been recorded at this time.
" - if(emagged) + if(obj_flags & EMAGGED) dat += "@#%! CLEAR LOGS" dat += "Return" operator = user @@ -117,7 +117,7 @@ auth_id = "\[NULL\]" if(href_list["restore_logging"]) to_chat(usr, "[icon2html(src, usr)] Logging functionality restored from backup data.") - emagged = FALSE + obj_flags &= ~EMAGGED LAZYADD(logs, "-=- Logging restored to full functionality at this point -=-") if(href_list["access_apc"]) playsound(src, "terminal_type", 50, 0) @@ -193,15 +193,15 @@ interact(usr) //Refresh the UI after a filter changes /obj/machinery/computer/apc_control/emag_act(mob/user) - if(emagged) + if(obj_flags & EMAGGED) return user.visible_message("You emag [src], disabling precise logging and allowing you to clear logs.") log_game("[key_name(user)] emagged [src] at [get_area(src)], disabling operator tracking.") playsound(src, "sparks", 50, 1) - emagged = TRUE + obj_flags |= EMAGGED /obj/machinery/computer/apc_control/proc/log_activity(log_text) - var/op_string = operator && !emagged ? operator : "\[NULL OPERATOR\]" + var/op_string = operator && !(obj_flags & EMAGGED) ? operator : "\[NULL OPERATOR\]" LAZYADD(logs, "([worldtime2text()]) [op_string] [log_text]") /mob/proc/using_power_flow_console() diff --git a/code/game/machinery/computer/arcade.dm b/code/game/machinery/computer/arcade.dm index 9c28be28b76..27a5a8ebd5b 100644 --- a/code/game/machinery/computer/arcade.dm +++ b/code/game/machinery/computer/arcade.dm @@ -212,9 +212,9 @@ gameover = FALSE turtle = 0 - if(emagged) + if(obj_flags & EMAGGED) Reset() - emagged = FALSE + obj_flags &= ~EMAGGED add_fingerprint(usr) updateUsrDialog() @@ -227,19 +227,19 @@ temp = "[enemy_name] has fallen! Rejoice!" playsound(loc, 'sound/arcade/win.ogg', 50, 1, extrarange = -3, falloff = 10) - if(emagged) + if(obj_flags & EMAGGED) new /obj/effect/spawner/newbomb/timer/syndicate(loc) new /obj/item/clothing/head/collectable/petehat(loc) message_admins("[key_name_admin(usr)] has outbombed Cuban Pete and been awarded a bomb.") log_game("[key_name(usr)] has outbombed Cuban Pete and been awarded a bomb.") Reset() - emagged = FALSE + obj_flags &= ~EMAGGED else prizevend() - SSblackbox.record_feedback("nested tally", "arcade_results", 1, list("win", (emagged ? "emagged":"normal"))) + SSblackbox.record_feedback("nested tally", "arcade_results", 1, list("win", (obj_flags & EMAGGED ? "emagged":"normal"))) - else if (emagged && (turtle >= 4)) + else if ((obj_flags & EMAGGED) && (turtle >= 4)) var/boomamt = rand(5,10) temp = "[enemy_name] throws a bomb, exploding you for [boomamt] damage!" playsound(loc, 'sound/arcade/boom.ogg', 50, 1, extrarange = -3, falloff = 10) @@ -257,9 +257,9 @@ sleep(10) temp = "You have been drained! GAME OVER" playsound(loc, 'sound/arcade/lose.ogg', 50, 1, extrarange = -3, falloff = 10) - if(emagged) + if(obj_flags & EMAGGED) usr.gib() - SSblackbox.record_feedback("nested tally", "arcade_results", 1, list("loss", "mana", (emagged ? "emagged":"normal"))) + SSblackbox.record_feedback("nested tally", "arcade_results", 1, list("loss", "mana", (obj_flags & EMAGGED ? "emagged":"normal"))) else if ((enemy_hp <= 10) && (enemy_mp > 4)) temp = "[enemy_name] heals for 4 health!" @@ -277,16 +277,16 @@ gameover = TRUE temp = "You have been crushed! GAME OVER" playsound(loc, 'sound/arcade/lose.ogg', 50, 1, extrarange = -3, falloff = 10) - if(emagged) + if(obj_flags & EMAGGED) usr.gib() - SSblackbox.record_feedback("nested tally", "arcade_results", 1, list("loss", "hp", (emagged ? "emagged":"normal"))) + SSblackbox.record_feedback("nested tally", "arcade_results", 1, list("loss", "hp", (obj_flags & EMAGGED ? "emagged":"normal"))) blocked = FALSE return /obj/machinery/computer/arcade/battle/emag_act(mob/user) - if(emagged) + if(obj_flags & EMAGGED) return temp = "If you die in the game, you die for real!" player_hp = 30 @@ -296,7 +296,7 @@ gameover = FALSE blocked = FALSE - emagged = TRUE + obj_flags |= EMAGGED enemy_name = "Cuban Pete" name = "Outbomb Cuban Pete" @@ -415,21 +415,21 @@ else if(food <= 0) dat += "
You ran out of food and starved." - if(emagged) + if(obj_flags & EMAGGED) user.nutrition = 0 //yeah you pretty hongry to_chat(user, "Your body instantly contracts to that of one who has not eaten in months. Agonizing cramps seize you as you fall to the floor.") if(fuel <= 0) dat += "
You ran out of fuel, and drift, slowly, into a star." - if(emagged) + if(obj_flags & EMAGGED) var/mob/living/M = user M.adjust_fire_stacks(5) M.IgniteMob() //flew into a star, so you're on fire to_chat(user, "You feel an immense wave of heat emanate from the arcade machine. Your skin bursts into flames.") - if(emagged) + if(obj_flags & EMAGGED) to_chat(user, "You're never going to make it to Orion...") user.death() - emagged = FALSE //removes the emagged status after you lose + obj_flags &= ~EMAGGED //removes the emagged status after you lose gameStatus = ORION_STATUS_START name = "The Orion Trail" desc = "Learn how our ancestors got to Orion, and have fun in the process!" @@ -491,7 +491,7 @@ event = ORION_TRAIL_LING_ATTACK event() turns += 1 - if(emagged) + if(obj_flags & EMAGGED) var/mob/living/carbon/M = usr //for some vars switch(event) if(ORION_TRAIL_RAIDERS) @@ -605,7 +605,7 @@ if(prob(75)) event = ORION_TRAIL_BLACKHOLE event() - if(emagged) + if(obj_flags & EMAGGED) playsound(loc, 'sound/effects/supermatter.ogg', 100, 1) say("A miniature black hole suddenly appears in front of [src], devouring [usr] alive!") if(isliving(usr)) @@ -632,12 +632,12 @@ if(settlers.len == 0 || alive == 0) say("The last crewmember [sheriff], shot themselves, GAME OVER!") - if(emagged) + if(obj_flags & EMAGGED) usr.death(0) - emagged = FALSE + obj_flags &= EMAGGED gameStatus = ORION_STATUS_GAMEOVER event = null - else if(emagged) + else if(obj_flags & EMAGGED) if(usr.name == sheriff) say("The crew of the ship chose to kill [usr.name]!") usr.death(0) @@ -696,7 +696,7 @@ if(prob(success*5)) var/lost_crew = remove_crewmember() last_spaceport_action = "You failed to raid the spaceport! You lost [FU*-1] Fuel and [FO*-1] Food, AND [lost_crew] in your scramble to escape! ([FU]FI,[FO]FO,-Crew)" - if(emagged) + if(obj_flags & EMAGGED) say("WEEWOO! WEEWOO! Spaceport security en route!") playsound(src, 'sound/items/weeoo1.ogg', 100, FALSE) for(var/i, i<=3, i++) @@ -1024,24 +1024,24 @@ /obj/machinery/computer/arcade/orion_trail/proc/win() gameStatus = ORION_STATUS_START say("Congratulations, you made it to Orion!") - if(emagged) + if(obj_flags & EMAGGED) new /obj/item/orion_ship(loc) message_admins("[key_name_admin(usr)] made it to Orion on an emagged machine and got an explosive toy ship.") log_game("[key_name(usr)] made it to Orion on an emagged machine and got an explosive toy ship.") else prizevend() - emagged = FALSE + obj_flags &= ~EMAGGED name = "The Orion Trail" desc = "Learn how our ancestors got to Orion, and have fun in the process!" /obj/machinery/computer/arcade/orion_trail/emag_act(mob/user) - if(emagged) + if(obj_flags & EMAGGED) return to_chat(user, "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() - emagged = TRUE + obj_flags |= EMAGGED /mob/living/simple_animal/hostile/syndicate/ranged/orion name = "spaceport security" diff --git a/code/game/machinery/computer/communications.dm b/code/game/machinery/computer/communications.dm index 83910526621..c3f464783fa 100755 --- a/code/game/machinery/computer/communications.dm +++ b/code/game/machinery/computer/communications.dm @@ -82,7 +82,7 @@ if((20 in I.access)) authenticated = 2 playsound(src, 'sound/machines/terminal_on.ogg', 50, 0) - if(emagged) + if(obj_flags & EMAGGED) authenticated = 2 auth_id = "Unknown" to_chat(M, "[src] lets out a quiet alarm as its login is overriden.") @@ -297,7 +297,7 @@ // OMG SYNDICATE ...LETTERHEAD if("MessageSyndicate") - if((authenticated==2) && (emagged)) + if((authenticated==2) && (obj_flags & EMAGGED)) if(!checkCCcooldown()) to_chat(usr, "Arrays recycling. Please stand by.") playsound(src, 'sound/machines/terminal_prompt_deny.ogg', 50, 0) @@ -315,7 +315,7 @@ if("RestoreBackup") to_chat(usr, "Backup routing data restored!") playsound(src, 'sound/machines/terminal_prompt_confirm.ogg', 50, 0) - emagged = FALSE + obj_flags &= ~EMAGGED updateDialog() if("nukerequest") //When there's no other way @@ -421,9 +421,9 @@ return ..() /obj/machinery/computer/communications/emag_act(mob/user) - if(emagged) + if(obj_flags & EMAGGED) return - emagged = TRUE + obj_flags |= EMAGGED if(authenticated == 1) authenticated = 2 to_chat(user, "You scramble the communication routing circuits!") @@ -485,7 +485,7 @@ dat += "
\[ Change Alert Level \]" dat += "
\[ Emergency Maintenance Access \]" dat += "
\[ Request Nuclear Authentication Codes \]" - if(!emagged) + if(!(obj_flags & EMAGGED)) dat += "
\[ Send Message to CentCom \]" else dat += "
\[ Send Message to \[UNKNOWN\] \]" diff --git a/code/game/machinery/computer/launchpad_control.dm b/code/game/machinery/computer/launchpad_control.dm index 35fcb20bcca..7408373220c 100644 --- a/code/game/machinery/computer/launchpad_control.dm +++ b/code/game/machinery/computer/launchpad_control.dm @@ -51,7 +51,7 @@ /obj/machinery/computer/launchpad/interact(mob/user) var/list/t = list() if(!LAZYLEN(launchpads)) - in_use = FALSE //Yeah so if you deconstruct teleporter while its in the process of shooting it wont disable the console + obj_flags &= ~IN_USE //Yeah so if you deconstruct teleporter while its in the process of shooting it wont disable the console t += "
No launchpad located.

" else for(var/i in 1 to LAZYLEN(launchpads)) diff --git a/code/game/machinery/doors/airlock.dm b/code/game/machinery/doors/airlock.dm index a2995c25440..31bc0638b45 100644 --- a/code/game/machinery/doors/airlock.dm +++ b/code/game/machinery/doors/airlock.dm @@ -569,7 +569,7 @@ /obj/machinery/door/airlock/examine(mob/user) ..() - if(emagged) + if(obj_flags & EMAGGED) to_chat(user, "Its access panel is smoking slightly.") if(charge && !panel_open && in_range(user, src)) to_chat(user, "The maintenance panel seems haphazardly fastened.") @@ -611,7 +611,7 @@ return else to_chat(user, "Airlock AI control has been blocked with a firewall. Unable to hack.") - if(emagged) + if(obj_flags & EMAGGED) to_chat(user, "Unable to interface: Airlock is unresponsive.") return if(detonated) @@ -899,7 +899,7 @@ if(!panel_open || security_level) to_chat(user, "The maintenance panel must be open to apply [C]!") return - if(emagged) + if(obj_flags & EMAGGED) return if(charge && !detonated) to_chat(user, "There's already a charge hooked up to this door!") @@ -979,7 +979,7 @@ charge.forceMove(get_turf(user)) charge = null return - if(beingcrowbarred && panel_open && (emagged || (density && welded && !operating && !hasPower() && !locked))) + if(beingcrowbarred && panel_open && ((obj_flags & EMAGGED) || (density && welded && !operating && !hasPower() && !locked))) playsound(src.loc, I.usesound, 100, 1) user.visible_message("[user] removes the electronics from the airlock assembly.", \ "You start to remove electronics from the airlock assembly...") @@ -1050,7 +1050,7 @@ H.apply_damage(40, BRUTE, "chest") return if(forced < 2) - if(emagged) + if(obj_flags & EMAGGED) return FALSE use_power(50) playsound(src.loc, doorOpen, 30, 1) @@ -1097,7 +1097,7 @@ return if(forced < 2) - if(emagged) + if(obj_flags & EMAGGED) return use_power(50) playsound(src.loc, doorClose, 30, 1) @@ -1135,7 +1135,7 @@ return TRUE /obj/machinery/door/airlock/proc/prison_open() - if(emagged) + if(obj_flags & EMAGGED) return locked = FALSE src.open() @@ -1224,7 +1224,7 @@ return !density || (check_access(ID) && !locked && hasPower()) /obj/machinery/door/airlock/emag_act(mob/user) - if(!operating && density && hasPower() && !emagged) + if(!operating && density && hasPower() && !(obj_flags & EMAGGED)) operating = TRUE update_icon(AIRLOCK_EMAG, 1) sleep(6) @@ -1233,7 +1233,7 @@ operating = FALSE if(!open()) update_icon(AIRLOCK_CLOSED, 1) - emagged = TRUE + obj_flags |= EMAGGED lights = FALSE locked = TRUE loseMainPower() @@ -1323,7 +1323,7 @@ if(!disassembled) if(A) A.obj_integrity = A.max_integrity * 0.5 - else if(emagged) + else if(obj_flags & EMAGGED) if(user) to_chat(user, "You discard the damaged electronics.") else diff --git a/code/game/machinery/doors/door.dm b/code/game/machinery/doors/door.dm index 85ec73cdc6e..26d58f01ccb 100644 --- a/code/game/machinery/doors/door.dm +++ b/code/game/machinery/doors/door.dm @@ -80,7 +80,7 @@ return ..() /obj/machinery/door/CollidedWith(atom/movable/AM) - if(operating || emagged) + if(operating || (obj_flags & EMAGGED)) return if(ismob(AM)) var/mob/B = AM @@ -127,7 +127,7 @@ if(!src.requiresID()) user = null - if(density && !emagged) + if(density && !(obj_flags & EMAGGED)) if(allowed(user)) open() else @@ -149,7 +149,7 @@ /obj/machinery/door/proc/try_to_activate_door(mob/user) add_fingerprint(user) - if(operating || emagged) + if(operating || (obj_flags & EMAGGED)) return if(!requiresID()) user = null //so allowed(user) always succeeds diff --git a/code/game/machinery/doors/windowdoor.dm b/code/game/machinery/doors/windowdoor.dm index bd1a553863d..29f05acc2bc 100644 --- a/code/game/machinery/doors/windowdoor.dm +++ b/code/game/machinery/doors/windowdoor.dm @@ -132,7 +132,7 @@ if(!hasPower()) return 0 if(forced < 2) - if(emagged) + if(obj_flags & EMAGGED) return 0 if(!src.operating) //in case of emag operating = TRUE @@ -157,7 +157,7 @@ if(!hasPower()) return 0 if(forced < 2) - if(emagged) + if(obj_flags & EMAGGED) return 0 operating = TRUE do_animate("closing") @@ -206,8 +206,8 @@ return src.attack_hand(user) /obj/machinery/door/window/emag_act(mob/user) - if(!operating && density && !emagged) - emagged = TRUE + if(!operating && density && !(obj_flags & EMAGGED)) + obj_flags |= EMAGGED operating = TRUE flick("[src.base_state]spark", src) playsound(src, "sparks", 75, 1) @@ -258,7 +258,7 @@ WA.update_icon() WA.created_name = src.name - if(emagged) + if(obj_flags & EMAGGED) to_chat(user, "You discard the damaged electronics.") qdel(src) return diff --git a/code/game/machinery/embedded_controller/access_controller.dm b/code/game/machinery/embedded_controller/access_controller.dm index e243494f2b8..d881d9e2235 100644 --- a/code/game/machinery/embedded_controller/access_controller.dm +++ b/code/game/machinery/embedded_controller/access_controller.dm @@ -27,9 +27,9 @@ findObjsByTag() /obj/machinery/doorButtons/emag_act(mob/user) - if(emagged) + if(obj_flags & EMAGGED) return - emagged = TRUE + obj_flags |= EMAGGED req_access = list() req_one_access = list() playsound(src, "sparks", 100, 1) @@ -315,4 +315,4 @@ #undef OPENING #undef CYCLE #undef CYCLE_EXTERIOR -#undef CYCLE_INTERIOR \ No newline at end of file +#undef CYCLE_INTERIOR diff --git a/code/game/machinery/firealarm.dm b/code/game/machinery/firealarm.dm index 5a306cac509..0af43df223a 100644 --- a/code/game/machinery/firealarm.dm +++ b/code/game/machinery/firealarm.dm @@ -86,16 +86,16 @@ ..() /obj/machinery/firealarm/emag_act(mob/user) - if(emagged) + if(obj_flags & EMAGGED) return - emagged = TRUE + obj_flags |= EMAGGED if(user) user.visible_message("Sparks fly out of [src]!", "You emag [src], disabling its thermal sensors.") playsound(src, "sparks", 50, 1) /obj/machinery/firealarm/temperature_expose(datum/gas_mixture/air, temperature, volume) - if((temperature > T0C + 200 || temperature < BODYTEMP_COLD_DAMAGE_LIMIT) && (last_alarm+FIREALARM_COOLDOWN < world.time) && !emagged && detecting && !stat) + if((temperature > T0C + 200 || temperature < BODYTEMP_COLD_DAMAGE_LIMIT) && (last_alarm+FIREALARM_COOLDOWN < world.time) && !(obj_flags & EMAGGED) && detecting && !stat) alarm() ..() @@ -122,7 +122,7 @@ /obj/machinery/firealarm/ui_data(mob/user) var/list/data = list() - data["emagged"] = emagged + data["emagged"] = obj_flags & EMAGGED ? 1 : 0 if(is_station_level(z)) data["seclevel"] = get_security_level() diff --git a/code/game/machinery/gulag_item_reclaimer.dm b/code/game/machinery/gulag_item_reclaimer.dm index 7de077c016e..628071bd219 100644 --- a/code/game/machinery/gulag_item_reclaimer.dm +++ b/code/game/machinery/gulag_item_reclaimer.dm @@ -25,10 +25,10 @@ return ..() /obj/machinery/gulag_item_reclaimer/emag_act(mob/user) - if(emagged) // emagging lets anyone reclaim all the items + if(obj_flags & EMAGGED) // emagging lets anyone reclaim all the items return req_access = list() - emagged = TRUE + obj_flags |= EMAGGED /obj/machinery/gulag_item_reclaimer/attackby(obj/item/I, mob/user) if(istype(I, /obj/item/card/id/prisoner)) @@ -103,4 +103,4 @@ var/obj/item/W = i stored_items[user] -= W W.forceMove(get_turf(src)) - stored_items -= user \ No newline at end of file + stored_items -= user diff --git a/code/game/machinery/limbgrower.dm b/code/game/machinery/limbgrower.dm index e661bc24c58..19c666b9e85 100644 --- a/code/game/machinery/limbgrower.dm +++ b/code/game/machinery/limbgrower.dm @@ -165,7 +165,7 @@ dat += "" for(var/C in categories) - if(C=="special" && !emagged) //Only want to show special when console is emagged + if(C=="special" && !(obj_flags & EMAGGED)) //Only want to show special when console is emagged continue dat += "" @@ -220,10 +220,10 @@ return dat /obj/machinery/limbgrower/emag_act(mob/user) - if(emagged) + if(obj_flags & EMAGGED) return for(var/datum/design/D in SSresearch.techweb_designs) if((D.build_type & LIMBGROWER) && ("special" in D.category)) stored_research.add_design(D) to_chat(user, "A warning flashes onto the screen, stating that safety overrides have been deactivated!") - emagged = TRUE + obj_flags |= EMAGGED diff --git a/code/game/machinery/porta_turret/portable_turret.dm b/code/game/machinery/porta_turret/portable_turret.dm index 958567c2963..008aa71365c 100644 --- a/code/game/machinery/porta_turret/portable_turret.dm +++ b/code/game/machinery/porta_turret/portable_turret.dm @@ -280,11 +280,11 @@ return ..() /obj/machinery/porta_turret/emag_act(mob/user) - if(emagged) + if(obj_flags & EMAGGED) return to_chat(user, "You short out [src]'s threat assessment circuits.") visible_message("[src] hums oddly...") - emagged = TRUE + obj_flags |= EMAGGED controllock = 1 on = FALSE //turns off the turret temporarily update_icon() @@ -313,7 +313,7 @@ if(.) //damage received if(prob(30)) spark_system.start() - if(on && !attacked && !emagged) + if(on && !attacked && !(obj_flags & EMAGGED)) attacked = TRUE addtimer(CALLBACK(src, .proc/reset_attacked), 60) @@ -447,7 +447,7 @@ /obj/machinery/porta_turret/proc/assess_perp(mob/living/carbon/human/perp) var/threatcount = 0 //the integer returned - if(emagged) + if(obj_flags & EMAGGED) return 10 //if emagged, always return 10. if((stun_all || attacked) && !allowed(perp)) @@ -493,7 +493,7 @@ if(!raised) //the turret has to be raised in order to fire - makes sense, right? return - if(!emagged) //if it hasn't been emagged, cooldown before shooting again + if(!(obj_flags & EMAGGED)) //if it hasn't been emagged, cooldown before shooting again if(last_fired + shot_delay > world.time) return last_fired = world.time @@ -546,11 +546,6 @@ src.mode = mode power_change() -/obj/machinery/porta_turret/stationary //is this even used anywhere - mode = TURRET_LETHAL - emagged = TRUE - installation = /obj/item/gun/energy/laser - /obj/machinery/porta_turret/syndicate installation = null always_up = 1 @@ -725,7 +720,7 @@ if ( get_dist(src, user) == 0 ) // trying to unlock the interface if (allowed(usr)) - if(emagged) + if(obj_flags & EMAGGED) to_chat(user, "The turret control is unresponsive.") return @@ -742,10 +737,10 @@ to_chat(user, "Access denied.") /obj/machinery/turretid/emag_act(mob/user) - if(emagged) + if(obj_flags & EMAGGED) return to_chat(user, "You short out the turret controls' access analysis module.") - emagged = TRUE + obj_flags |= EMAGGED locked = FALSE if(user && user.machine == src) attack_hand(user) diff --git a/code/game/machinery/porta_turret/portable_turret_cover.dm b/code/game/machinery/porta_turret/portable_turret_cover.dm index 7bc381c466c..d455bec1739 100644 --- a/code/game/machinery/porta_turret/portable_turret_cover.dm +++ b/code/game/machinery/porta_turret/portable_turret_cover.dm @@ -87,10 +87,10 @@ . = 0 /obj/machinery/porta_turret_cover/emag_act(mob/user) - if(!parent_turret.emagged) + if(!(parent_turret.obj_flags & EMAGGED)) to_chat(user, "You short out [parent_turret]'s threat assessment circuits.") visible_message("[parent_turret] hums oddly...") - parent_turret.emagged = TRUE + parent_turret.obj_flags |= EMAGGED parent_turret.on = 0 spawn(40) parent_turret.on = 1 diff --git a/code/game/machinery/quantum_pad.dm b/code/game/machinery/quantum_pad.dm index 6a04ca0886a..1dd683af842 100644 --- a/code/game/machinery/quantum_pad.dm +++ b/code/game/machinery/quantum_pad.dm @@ -7,7 +7,7 @@ use_power = IDLE_POWER_USE idle_power_usage = 200 active_power_usage = 5000 - unique_rename = 1 + obj_flags = CAN_BE_HIT | UNIQUE_RENAME circuit = /obj/item/circuitboard/machine/quantumpad var/teleport_cooldown = 400 //30 seconds base due to base parts var/teleport_speed = 50 @@ -15,17 +15,17 @@ var/teleporting = 0 //if it's in the process of teleporting var/power_efficiency = 1 var/obj/machinery/quantumpad/linked_pad - + //mapping var/static/list/mapped_quantum_pads = list() var/map_pad_id = "" as text //what's my name var/map_pad_link_id = "" as text //who's my friend - + /obj/machinery/quantumpad/Initialize() . = ..() if(map_pad_id) mapped_quantum_pads[map_pad_id] = src - + /obj/machinery/quantumpad/Destroy() mapped_quantum_pads -= map_pad_id return ..() diff --git a/code/game/machinery/recycler.dm b/code/game/machinery/recycler.dm index 0d11c6a741c..b98aa50ec1c 100644 --- a/code/game/machinery/recycler.dm +++ b/code/game/machinery/recycler.dm @@ -39,7 +39,7 @@ ..() to_chat(user, "The power light is [(stat & NOPOWER) ? "off" : "on"].") to_chat(user, "The safety-mode light is [safety_mode ? "on" : "off"].") - to_chat(user, "The safety-sensors status light is [emagged ? "off" : "on"].") + to_chat(user, "The safety-sensors status light is [obj_flags & EMAGGED ? "off" : "on"].") /obj/machinery/recycler/power_change() ..() @@ -64,9 +64,9 @@ return ..() /obj/machinery/recycler/emag_act(mob/user) - if(emagged) + if(obj_flags & EMAGGED) return - emagged = TRUE + obj_flags |= EMAGGED if(safety_mode) safety_mode = FALSE update_icon() @@ -110,7 +110,7 @@ if(brain_holder) emergency_stop(AM) else if(isliving(AM)) - if(emagged) + if(obj_flags & EMAGGED) crush_living(AM) else emergency_stop(AM) @@ -180,14 +180,14 @@ L.Unconscious(100) // For admin fun, var edit emagged to 2. - if(gib || emagged == 2) + if(gib) L.gib() - else if(emagged == 1) + else if(obj_flags & EMAGGED) L.adjustBruteLoss(crush_damage) /obj/machinery/recycler/deathtrap name = "dangerous old crusher" - emagged = TRUE + obj_flags = CAN_BE_HIT | EMAGGED crush_damage = 120 flags_1 = NODECONSTRUCT_1 diff --git a/code/game/machinery/shieldgen.dm b/code/game/machinery/shieldgen.dm index b681845a109..b98500a4950 100644 --- a/code/game/machinery/shieldgen.dm +++ b/code/game/machinery/shieldgen.dm @@ -180,10 +180,10 @@ anchored = FALSE else if(W.GetID()) - if(allowed(user) && !emagged) + if(allowed(user) && !(obj_flags & EMAGGED)) locked = !locked to_chat(user, "You [locked ? "lock" : "unlock"] the controls.") - else if(emagged) + else if(obj_flags & EMAGGED) to_chat(user, "Error, access controller damaged!") else to_chat(user, "Access denied.") @@ -192,10 +192,10 @@ return ..() /obj/machinery/shieldgen/emag_act(mob/user) - if(emagged) + if(obj_flags & EMAGGED) to_chat(user, "The access controller is damaged!") return - emagged = TRUE + obj_flags |= EMAGGED locked = FALSE playsound(src, "sparks", 100, 1) to_chat(user, "You short out the access controller.") @@ -343,10 +343,10 @@ default_unfasten_wrench(user, W, 0) else if(W.GetID()) - if(allowed(user) && !emagged) + if(allowed(user) && !(obj_flags & EMAGGED)) locked = !locked to_chat(user, "You [src.locked ? "lock" : "unlock"] the controls.") - else if(emagged) + else if(obj_flags & EMAGGED) to_chat(user, "Error, access controller damaged!") else to_chat(user, "Access denied.") @@ -381,10 +381,10 @@ add_fingerprint(user) /obj/machinery/shieldwallgen/emag_act(mob/user) - if(emagged) + if(obj_flags & EMAGGED) to_chat(user, "The access controller is damaged!") return - emagged = TRUE + obj_flags |= EMAGGED locked = FALSE playsound(src, "sparks", 100, 1) to_chat(user, "You short out the access controller.") diff --git a/code/game/machinery/slotmachine.dm b/code/game/machinery/slotmachine.dm index a538e4ec0c5..766bd49bf46 100644 --- a/code/game/machinery/slotmachine.dm +++ b/code/game/machinery/slotmachine.dm @@ -100,9 +100,9 @@ return ..() /obj/machinery/computer/slot_machine/emag_act() - if(emagged) + if(obj_flags & EMAGGED) return - emagged = TRUE + 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() @@ -163,7 +163,7 @@ if(prob(15 * severity)) return if(prob(1)) // :^) - emagged = TRUE + obj_flags |= EMAGGED var/severity_ascending = 4 - severity money = max(rand(money - (200 * severity_ascending), money + (200 * severity_ascending)), 0) balance = max(rand(balance - (50 * severity_ascending), balance + (50 * severity_ascending)), 0) @@ -286,9 +286,9 @@ balance += surplus /obj/machinery/computer/slot_machine/proc/give_coins(amount) - var/cointype = emagged ? /obj/item/coin/iron : /obj/item/coin/silver + var/cointype = obj_flags & EMAGGED ? /obj/item/coin/iron : /obj/item/coin/silver - if(!emagged) + if(!(obj_flags & EMAGGED)) amount = dispense(amount, cointype, null, 0) else diff --git a/code/game/machinery/telecomms/computers/logbrowser.dm b/code/game/machinery/telecomms/computers/logbrowser.dm index 93f9d2b03a4..12b01614c4c 100644 --- a/code/game/machinery/telecomms/computers/logbrowser.dm +++ b/code/game/machinery/telecomms/computers/logbrowser.dm @@ -187,7 +187,7 @@ if(href_list["delete"]) - if(!src.allowed(usr) && !emagged) + if(!src.allowed(usr) && !(obj_flags & EMAGGED)) to_chat(usr, "ACCESS DENIED.") return diff --git a/code/game/machinery/telecomms/computers/message.dm b/code/game/machinery/telecomms/computers/message.dm index 4b44f020964..63362224934 100644 --- a/code/game/machinery/telecomms/computers/message.dm +++ b/code/game/machinery/telecomms/computers/message.dm @@ -33,17 +33,17 @@ light_color = LIGHT_COLOR_GREEN /obj/machinery/computer/message_monitor/attackby(obj/item/O, mob/living/user, params) - if(istype(O, /obj/item/screwdriver) && emagged) + if(istype(O, /obj/item/screwdriver) && (obj_flags & EMAGGED)) //Stops people from just unscrewing the monitor and putting it back to get the console working again. to_chat(user, "It is too hot to mess with!") else return ..() /obj/machinery/computer/message_monitor/emag_act(mob/user) - if(emagged) + if(obj_flags & EMAGGED) return if(!isnull(linkedServer)) - emagged = TRUE + obj_flags |= EMAGGED screen = 2 spark_system.set_up(5, 0, src) src.spark_system.start() @@ -71,7 +71,7 @@ if(..()) return //If the computer is being hacked or is emagged, display the reboot message. - if(hacking || emagged) + if(hacking || (obj_flags & EMAGGED)) message = rebootmsg var/dat = "
/
" @@ -82,7 +82,7 @@ dat += "

\[Unauthenticated\] /" dat += " Server Power: [src.linkedServer && src.linkedServer.toggled ? "\[On\]":"\[Off\]"]

" - if(hacking || emagged) + if(hacking || (obj_flags & EMAGGED)) screen = 2 else if(!auth || !linkedServer || (linkedServer.stat & (NOPOWER|BROKEN))) if(!linkedServer || (linkedServer.stat & (NOPOWER|BROKEN))) @@ -237,7 +237,7 @@ src.screen = 0 // Return the screen back to normal /obj/machinery/computer/message_monitor/proc/UnmagConsole() - emagged = FALSE + obj_flags &= ~EMAGGED /obj/machinery/computer/message_monitor/proc/ResetMessage() customsender = "System Administrator" diff --git a/code/game/machinery/vending.dm b/code/game/machinery/vending.dm index 1d0228d7377..446a99dd313 100644 --- a/code/game/machinery/vending.dm +++ b/code/game/machinery/vending.dm @@ -224,7 +224,7 @@ /obj/machinery/vending/snack/proc/compartment_access_check(user) req_access_txt = chef_compartment_access - if(!allowed(user) && !emagged && scan_id) + if(!allowed(user) && !(obj_flags & EMAGGED) && scan_id) to_chat(user, "[src]'s chef compartment blinks red: Access denied.") req_access_txt = "0" return 0 @@ -342,9 +342,9 @@ ..() /obj/machinery/vending/emag_act(mob/user) - if(emagged) + if(obj_flags & EMAGGED) return - emagged = TRUE + obj_flags |= EMAGGED to_chat(user, "You short out the product lock on [src].") /obj/machinery/vending/attack_ai(mob/user) @@ -455,7 +455,7 @@ to_chat(usr, "The vending machine cannot dispense products while its service panel is open!") return - if((!allowed(usr)) && !emagged && scan_id) //For SECURE VENDING MACHINES YEAH + if((!allowed(usr)) && !(obj_flags & EMAGGED) && scan_id) //For SECURE VENDING MACHINES YEAH to_chat(usr, "Access denied." ) flick(icon_deny,src) return @@ -1195,4 +1195,4 @@ IF YOU MODIFY THE PRODUCTS LIST OF A MACHINE, MAKE SURE TO UPDATE ITS RESUPPLY C #undef STANDARD_CHARGE #undef CONTRABAND_CHARGE -#undef COIN_CHARGE \ No newline at end of file +#undef COIN_CHARGE diff --git a/code/game/mecha/mech_fabricator.dm b/code/game/mecha/mech_fabricator.dm index 8654f9854ec..021b05cb58b 100644 --- a/code/game/mecha/mech_fabricator.dm +++ b/code/game/mecha/mech_fabricator.dm @@ -76,9 +76,9 @@ return TRUE /obj/machinery/mecha_part_fabricator/emag_act() - if(emagged) + if(obj_flags & EMAGGED) return - emagged = TRUE + obj_flags |= EMAGGED req_access = list() say("DB error \[Code 0x00F1\]") sleep(10) diff --git a/code/game/objects/effects/effects.dm b/code/game/objects/effects/effects.dm index 2b456b2ed7e..1ac6f8d007e 100644 --- a/code/game/objects/effects/effects.dm +++ b/code/game/objects/effects/effects.dm @@ -4,7 +4,7 @@ /obj/effect icon = 'icons/effects/effects.dmi' resistance_flags = INDESTRUCTIBLE | LAVA_PROOF | FIRE_PROOF | UNACIDABLE | ACID_PROOF | FREEZE_PROOF - can_be_hit = FALSE + obj_flags = 0 /obj/effect/take_damage(damage_amount, damage_type = BRUTE, damage_flag = 0, sound_effect = 1, attack_dir) return diff --git a/code/game/objects/items.dm b/code/game/objects/items.dm index c0ce95be16e..26e198c5f4a 100644 --- a/code/game/objects/items.dm +++ b/code/game/objects/items.dm @@ -26,7 +26,7 @@ GLOBAL_VAR_INIT(rpg_loot_items, FALSE) max_integrity = 200 - can_be_hit = FALSE + obj_flags = 0 var/hitsound = null var/usesound = null @@ -63,8 +63,8 @@ GLOBAL_VAR_INIT(rpg_loot_items, FALSE) var/breakouttime = 0 var/being_removed = FALSE var/list/materials + var/item_flags = 0 var/needs_permit = 0 //Used by security bots to determine if this item is safe for public use. - var/emagged = FALSE var/list/attack_verb //Used in attackby() to say how something was attacked "[x] has been [z.attack_verb] by [y] with [z]" var/list/species_exception = null // list() of species types, if a species cannot put items in a certain slot, but species type is in list, it will be able to wear that item diff --git a/code/game/objects/items/RSF.dm b/code/game/objects/items/RSF.dm index eec97044bcc..a01c0e74872 100644 --- a/code/game/objects/items/RSF.dm +++ b/code/game/objects/items/RSF.dm @@ -133,8 +133,8 @@ RSF return /obj/item/cookiesynth/emag_act(mob/user) - emagged = !emagged - if(emagged) + obj_flags ^= EMAGGED + if(obj_flags & EMAGGED) to_chat(user, "You short out [src]'s reagent safety checker!") else to_chat(user, "You reset [src]'s reagent safety checker!") @@ -144,7 +144,7 @@ RSF var/mob/living/silicon/robot/P = null if(iscyborg(user)) P = user - if(emagged&&!toxin) + if((obj_flags & EMAGGED)&&!toxin) toxin = 1 to_chat(user, "Cookie Synthesizer Hacked") else if(P.emagged&&!toxin) diff --git a/code/game/objects/items/cigs_lighters.dm b/code/game/objects/items/cigs_lighters.dm index 372eb56bfe8..0dca695d2d4 100644 --- a/code/game/objects/items/cigs_lighters.dm +++ b/code/game/objects/items/cigs_lighters.dm @@ -684,7 +684,7 @@ CIGARETTE PACKETS ARE IN FANCY.DM cut_overlays() if(istype(O, /obj/item/device/multitool)) - if(screw && !emagged)//also kinky + if(screw && !(obj_flags & EMAGGED))//also kinky if(!super) cut_overlays() super = 1 @@ -696,15 +696,15 @@ CIGARETTE PACKETS ARE IN FANCY.DM to_chat(user, "You decrease the voltage of [src].") add_overlay("vapeopen_low") - if(screw && emagged) + if(screw && (obj_flags & EMAGGED)) to_chat(user, "[src] can't be modified!") /obj/item/clothing/mask/vape/emag_act(mob/user)// I WON'T REGRET WRITTING THIS, SURLY. if(screw) - if(!emagged) + if(!(obj_flags & EMAGGED)) cut_overlays() - emagged = TRUE + obj_flags |= EMAGGED super = 0 to_chat(user, "You maximize the voltage of [src].") add_overlay("vapeopen_high") @@ -781,7 +781,7 @@ CIGARETTE PACKETS ARE IN FANCY.DM s.start() vapetime = 0 - if(emagged && vapetime > 3) + if((obj_flags & EMAGGED) && vapetime > 3) var/datum/effect_system/smoke_spread/chem/s = new s.set_up(reagents, 4, loc, silent=TRUE) s.start() diff --git a/code/game/objects/items/circuitboards/computer_circuitboards.dm b/code/game/objects/items/circuitboards/computer_circuitboards.dm index afd0eeef956..24038d9c69a 100644 --- a/code/game/objects/items/circuitboards/computer_circuitboards.dm +++ b/code/game/objects/items/circuitboards/computer_circuitboards.dm @@ -189,16 +189,16 @@ var/contraband = FALSE /obj/item/circuitboard/computer/cargo/multitool_act(mob/living/user) - if(!emagged) + if(!(obj_flags & EMAGGED)) contraband = !contraband to_chat(user, "Receiver spectrum set to [contraband ? "Broad" : "Standard"].") else to_chat(user, "The spectrum chip is unresponsive.") /obj/item/circuitboard/computer/cargo/emag_act(mob/living/user) - if(!emagged) + if(!(obj_flags & EMAGGED)) contraband = TRUE - emagged = TRUE + obj_flags |= EMAGGED to_chat(user, "You adjust [src]'s routing and receiver spectrum, unlocking special supplies and contraband.") /obj/item/circuitboard/computer/cargo/express @@ -206,15 +206,15 @@ build_path = /obj/machinery/computer/cargo/express /obj/item/circuitboard/computer/cargo/express/multitool_act(mob/living/user) - if (!emagged) + if (!(obj_flags & EMAGGED)) to_chat(user, "Routing protocols are already set to: \"factory defaults\".") - else + else to_chat(user, "You reset the routing protocols to: \"factory defaults\".") - emagged = FALSE + obj_flags &= ~EMAGGED /obj/item/circuitboard/computer/cargo/express/emag_act(mob/living/user) to_chat(user, "You change the routing protocols, allowing the Drop Pod to land anywhere on the station.") - emagged = TRUE + obj_flags |= EMAGGED /obj/item/circuitboard/computer/cargo/request name = "Supply Request Console (Computer Board)" diff --git a/code/game/objects/items/devices/geiger_counter.dm b/code/game/objects/items/devices/geiger_counter.dm index 03e4ff123a1..64d710be253 100644 --- a/code/game/objects/items/devices/geiger_counter.dm +++ b/code/game/objects/items/devices/geiger_counter.dm @@ -46,15 +46,15 @@ if(!scanning) current_tick_amount = 0 return - + radiation_count -= radiation_count/RAD_MEASURE_SMOOTHING radiation_count += current_tick_amount/RAD_MEASURE_SMOOTHING - + if(current_tick_amount) grace = RAD_GRACE_PERIOD last_tick_amount = current_tick_amount - else if(!emagged) + else if(!(obj_flags & EMAGGED)) grace-- if(grace <= 0) radiation_count = 0 @@ -66,7 +66,7 @@ if(!scanning) return 1 to_chat(user, "Alt-click it to clear stored radiation levels.") - if(emagged) + if(obj_flags & EMAGGED) to_chat(user, "The display seems to be incomprehensible.") return 1 switch(radiation_count) @@ -89,7 +89,7 @@ if(!scanning) icon_state = "geiger_off" return 1 - if(emagged) + if(obj_flags & EMAGGED) icon_state = "geiger_on_emag" return 1 switch(radiation_count) @@ -131,7 +131,7 @@ /obj/item/device/geiger_counter/attack(mob/living/M, mob/user) if(user.a_intent == INTENT_HELP) - if(!emagged) + if(!(obj_flags & EMAGGED)) user.visible_message("[user] scans [M] with [src].", "You scan [M]'s radiation levels with [src]...") addtimer(CALLBACK(src, .proc/scan, M, user), 20, TIMER_UNIQUE) // Let's not have spamming GetAllContents else @@ -164,7 +164,7 @@ to_chat(user, "[icon2html(src, user)] Subject is free of radioactive contamination.") /obj/item/device/geiger_counter/attackby(obj/item/I, mob/user, params) - if(istype(I, /obj/item/screwdriver) && emagged) + if(istype(I, /obj/item/screwdriver) && (obj_flags & EMAGGED)) if(scanning) to_chat(user, "Turn off [src] before you perform this action!") return 0 @@ -174,7 +174,7 @@ return 0 user.visible_message("[user] refastens [src]'s maintenance panel!", "You reset [src] to its factory settings!") playsound(user, 'sound/items/screwdriver2.ogg', 50, 1) - emagged = FALSE + obj_flags &= ~EMAGGED radiation_count = 0 update_icon() return 1 @@ -192,13 +192,13 @@ update_icon() /obj/item/device/geiger_counter/emag_act(mob/user) - if(emagged) + if(obj_flags & EMAGGED) return if(scanning) to_chat(user, "Turn off [src] before you perform this action!") return 0 to_chat(user, "You override [src]'s radiation storing protocols. It will now generate small doses of radiation, and stored rads are now projected into creatures you scan.") - emagged = TRUE + obj_flags |= EMAGGED #undef RAD_LEVEL_NORMAL #undef RAD_LEVEL_MODERATE diff --git a/code/game/objects/items/devices/gps.dm b/code/game/objects/items/devices/gps.dm index 9d01e2a7aae..2c75166789d 100644 --- a/code/game/objects/items/devices/gps.dm +++ b/code/game/objects/items/devices/gps.dm @@ -6,7 +6,7 @@ GLOBAL_LIST_EMPTY(GPS_list) icon_state = "gps-c" w_class = WEIGHT_CLASS_SMALL slot_flags = SLOT_BELT - unique_rename = TRUE + obj_flags = UNIQUE_RENAME var/gpstag = "COM0" var/emped = FALSE var/turf/locked_location diff --git a/code/game/objects/items/devices/lightreplacer.dm b/code/game/objects/items/devices/lightreplacer.dm index 4ea91ccccfb..a1cdfe4a9be 100644 --- a/code/game/objects/items/devices/lightreplacer.dm +++ b/code/game/objects/items/devices/lightreplacer.dm @@ -149,7 +149,7 @@ to_chat(user, "You fill \the [src] with lights from \the [S]. " + status_string() + "") /obj/item/device/lightreplacer/emag_act() - if(emagged) + if(obj_flags & EMAGGED) return Emag() @@ -157,7 +157,7 @@ to_chat(user, status_string()) /obj/item/device/lightreplacer/update_icon() - icon_state = "lightreplacer[emagged]" + icon_state = "lightreplacer[(obj_flags & EMAGGED ? 1 : 0)]" /obj/item/device/lightreplacer/proc/status_string() return "It has [uses] light\s remaining (plus [bulb_shards] fragment\s)." @@ -205,7 +205,7 @@ target.status = L2.status target.switchcount = L2.switchcount - target.rigged = emagged + target.rigged = (obj_flags & EMAGGED ? 1 : 0) target.brightness = L2.brightness target.on = target.has_power() target.update() @@ -223,9 +223,9 @@ return /obj/item/device/lightreplacer/proc/Emag() - emagged = !emagged + obj_flags ^= EMAGGED playsound(src.loc, "sparks", 100, 1) - if(emagged) + if(obj_flags & EMAGGED) name = "shortcircuited [initial(name)]" else name = initial(name) diff --git a/code/game/objects/items/devices/megaphone.dm b/code/game/objects/items/devices/megaphone.dm index 30cec4c5a13..63f7cfaa45d 100644 --- a/code/game/objects/items/devices/megaphone.dm +++ b/code/game/objects/items/devices/megaphone.dm @@ -19,10 +19,10 @@ return voicespan /obj/item/device/megaphone/emag_act(mob/user) - if(emagged) + if(obj_flags & EMAGGED) return to_chat(user, "You overload \the [src]'s voice synthesizer.") - emagged = TRUE + obj_flags |= EMAGGED voicespan = list(SPAN_REALLYBIG, "userdanger") /obj/item/device/megaphone/sec diff --git a/code/game/objects/items/holy_weapons.dm b/code/game/objects/items/holy_weapons.dm index ea570374b28..aaa19b6ab13 100644 --- a/code/game/objects/items/holy_weapons.dm +++ b/code/game/objects/items/holy_weapons.dm @@ -10,7 +10,7 @@ throw_range = 4 throwforce = 10 w_class = WEIGHT_CLASS_TINY - unique_rename = TRUE + obj_flags = UNIQUE_RENAME var/reskinned = FALSE /obj/item/nullrod/suicide_act(mob/user) diff --git a/code/game/objects/items/melee/misc.dm b/code/game/objects/items/melee/misc.dm index 3f1b5cd54ec..532c5bb0fec 100644 --- a/code/game/objects/items/melee/misc.dm +++ b/code/game/objects/items/melee/misc.dm @@ -52,7 +52,7 @@ lefthand_file = 'icons/mob/inhands/weapons/swords_lefthand.dmi' righthand_file = 'icons/mob/inhands/weapons/swords_righthand.dmi' flags_1 = CONDUCT_1 - unique_rename = 1 + obj_flags = UNIQUE_RENAME force = 15 throwforce = 10 w_class = WEIGHT_CLASS_BULKY diff --git a/code/game/objects/items/robot/robot_items.dm b/code/game/objects/items/robot/robot_items.dm index 0764e437ca1..4851e111a81 100644 --- a/code/game/objects/items/robot/robot_items.dm +++ b/code/game/objects/items/robot/robot_items.dm @@ -280,14 +280,14 @@ var/cooldown = 0 /obj/item/device/harmalarm/emag_act(mob/user) - emagged = !emagged - if(emagged) + obj_flags ^= EMAGGED + if(obj_flags & EMAGGED) to_chat(user, "You short out the safeties on [src]!") else to_chat(user, "You reset the safeties on [src]!") /obj/item/device/harmalarm/attack_self(mob/user) - var/safety = !emagged + var/safety = !(obj_flags & EMAGGED) if(cooldown > world.time) to_chat(user, "The device is still recharging!") return diff --git a/code/game/objects/obj_defense.dm b/code/game/objects/obj_defense.dm index c20c01cc42e..853eab7a777 100644 --- a/code/game/objects/obj_defense.dm +++ b/code/game/objects/obj_defense.dm @@ -222,13 +222,13 @@ GLOBAL_DATUM_INIT(acid_overlay, /mutable_appearance, mutable_appearance('icons/e /obj/proc/tesla_act(var/power) - being_shocked = TRUE + obj_flags |= BEING_SHOCKED var/power_bounced = power / 2 tesla_zap(src, 3, power_bounced) addtimer(CALLBACK(src, .proc/reset_shocked), 10) /obj/proc/reset_shocked() - being_shocked = FALSE + obj_flags &= ~BEING_SHOCKED //the obj is deconstructed into pieces, whether through careful disassembly or when destroyed. /obj/proc/deconstruct(disassembled = TRUE) diff --git a/code/game/objects/objs.dm b/code/game/objects/objs.dm index ce4b4d8d795..0b2d54d18b0 100644 --- a/code/game/objects/objs.dm +++ b/code/game/objects/objs.dm @@ -1,8 +1,10 @@ + /obj var/crit_fail = FALSE animate_movement = 2 var/throwforce = 0 - var/in_use = 0 // If we have a user using us, this will be set on. We will check if the user has stopped using us, and thus stop updating and LAGGING EVERYTHING! + var/obj_flags = CAN_BE_HIT + var/set_obj_flags // ONLY FOR MAPPING: Sets flags from a string list, handled in Initialize. Usage: set_obj_flags = "EMAGGED;!CAN_BE_HIT" to set EMAGGED and clear CAN_BE_HIT. var/damtype = BRUTE var/force = 0 @@ -13,30 +15,23 @@ var/integrity_failure = 0 //0 if we have no special broken behavior var/resistance_flags = NONE // INDESTRUCTIBLE | LAVA_PROOF | FIRE_PROOF | ON_FIRE | UNACIDABLE | ACID_PROOF - var/can_be_hit = TRUE //can this be bludgeoned by items? var/acid_level = 0 //how much acid is on that obj - var/being_shocked = FALSE - - var/on_blueprints = FALSE //Are we visible on the station blueprints at roundstart? - var/force_blueprints = FALSE //forces the obj to be on the blueprints, regardless of when it was created. - var/persistence_replacement //have something WAY too amazing to live to the next round? Set a new path here. Overuse of this var will make me upset. - var/unique_rename = FALSE // can you customize the description/name of the thing? var/current_skin //Has the item been reskinned? var/list/unique_reskin //List of options to reskin. - var/dangerous_possession = FALSE //Admin possession yes/no /obj/vv_edit_var(vname, vval) switch(vname) - if("dangerous_possession") - return FALSE + if("obj_flags") + if ((obj_flags & DANGEROUS_POSSESSION) && !(vval & DANGEROUS_POSSESSION)) + return FALSE if("control_object") var/obj/O = vval - if(istype(O) && O.dangerous_possession) + if(istype(O) && (O.obj_flags & DANGEROUS_POSSESSION)) return FALSE ..() @@ -46,12 +41,19 @@ armor = list(melee = 0, bullet = 0, laser = 0, energy = 0, bomb = 0, bio = 0, rad = 0, fire = 0, acid = 0) if(obj_integrity == null) obj_integrity = max_integrity - if(on_blueprints && isturf(loc)) + if (set_obj_flags) + var/flagslist = splittext(set_obj_flags,";") + var/list/string_to_objflag = GLOB.bitfields["obj_flags"] + for (var/flag in flagslist) + if (findtext(flag,"!",1,2)) + flag = copytext(flag,1-(length(flag))) // Get all but the initial ! + obj_flags &= ~string_to_objflag[flag] + else + obj_flags |= string_to_objflag[flag] + if((obj_flags & ON_BLUEPRINTS) && isturf(loc)) var/turf/T = loc - if(force_blueprints) - T.add_blueprints(src) - else - T.add_blueprints_preround(src) + T.add_blueprints_preround(src) + /obj/Destroy(force=FALSE) if(!ismachinery(src)) @@ -98,7 +100,7 @@ return null /obj/proc/updateUsrDialog() - if(in_use) + if(obj_flags & IN_USE) var/is_in_use = 0 var/list/nearby = viewers(1, src) for(var/mob/M in nearby) @@ -120,11 +122,14 @@ if(H.dna.check_mutation(TK)) is_in_use = 1 src.attack_hand(usr) - in_use = is_in_use + if (is_in_use) + obj_flags |= IN_USE + else + obj_flags &= ~IN_USE /obj/proc/updateDialog() // Check that people are actually using the machine. If not, don't update anymore. - if(in_use) + if(obj_flags & IN_USE) var/list/nearby = viewers(1, src) var/is_in_use = 0 for(var/mob/M in nearby) @@ -134,7 +139,7 @@ var/ai_in_use = AutoUpdateAI(src) if(!ai_in_use && !is_in_use) - in_use = 0 + obj_flags &= ~IN_USE /obj/attack_ghost(mob/user) @@ -162,7 +167,7 @@ unset_machine() src.machine = O if(istype(O)) - O.in_use = 1 + O.obj_flags |= IN_USE /obj/item/proc/updateSelfDialog() var/mob/M = src.loc @@ -208,7 +213,7 @@ /obj/examine(mob/user) ..() - if(unique_rename) + if(obj_flags & UNIQUE_RENAME) to_chat(user, "Use a pen on it to rename it or change its description.") if(unique_reskin && !current_skin) to_chat(user, "Alt-click it to reskin it.") diff --git a/code/game/objects/structures/barsigns.dm b/code/game/objects/structures/barsigns.dm index b3746b73082..c9c9e8c9310 100644 --- a/code/game/objects/structures/barsigns.dm +++ b/code/game/objects/structures/barsigns.dm @@ -83,7 +83,7 @@ to_chat(user, "You close the maintenance panel.") if(!broken && !emagged) set_sign(pick(barsigns)) - else if(emagged) + else if(obj_flags & EMAGGED) set_sign(new /datum/barsign/hiddensigns/syndibarsign) else set_sign(new /datum/barsign/hiddensigns/empbarsign) @@ -91,7 +91,7 @@ else if(istype(I, /obj/item/stack/cable_coil) && panel_open) var/obj/item/stack/cable_coil/C = I - if(emagged) //Emagged, not broken by EMP + if(obj_flags & EMAGGED) //Emagged, not broken by EMP to_chat(user, "Sign has been damaged beyond repair!") return else if(!broken) @@ -118,7 +118,7 @@ if(broken || emagged) to_chat(user, "Nothing interesting happens!") return - emagged = TRUE + obj_flags |= EMAGGED to_chat(user, "You emag the barsign. Takeover in progress...") sleep(10 SECONDS) set_sign(new /datum/barsign/hiddensigns/syndibarsign) diff --git a/code/modules/admin/verbs/massmodvar.dm b/code/modules/admin/verbs/massmodvar.dm index db1150fb721..75050b5e621 100644 --- a/code/modules/admin/verbs/massmodvar.dm +++ b/code/modules/admin/verbs/massmodvar.dm @@ -53,7 +53,7 @@ if (prompt != "Continue") return - default = vv_get_class(var_value) + default = vv_get_class(variable, var_value) if(isnull(default)) to_chat(src, "Unable to determine variable type.") @@ -263,4 +263,3 @@ if (typecache[thing.type]) . += thing CHECK_TICK - diff --git a/code/modules/admin/verbs/modifyvariables.dm b/code/modules/admin/verbs/modifyvariables.dm index da448b8ecae..424b13c2a30 100644 --- a/code/modules/admin/verbs/modifyvariables.dm +++ b/code/modules/admin/verbs/modifyvariables.dm @@ -8,12 +8,15 @@ GLOBAL_LIST_INIT(VVpixelmovement, list("step_x", "step_y", "bound_height", "boun GLOBAL_PROTECT(VVpixelmovement) -/client/proc/vv_get_class(var/var_value) +/client/proc/vv_get_class(var/var_name, var/var_value) if(isnull(var_value)) . = VV_NULL else if (isnum(var_value)) - . = VV_NUM + if (var_name in GLOB.bitfields) + . = VV_BITFIELD + else + . = VV_NUM else if (istext(var_value)) if (findtext(var_value, "\n")) @@ -52,7 +55,7 @@ GLOBAL_PROTECT(VVpixelmovement) else . = VV_NULL -/client/proc/vv_get_value(class, default_class, current_value, list/restricted_classes, list/extra_classes, list/classes) +/client/proc/vv_get_value(class, default_class, current_value, list/restricted_classes, list/extra_classes, list/classes, var_name) . = list("class" = class, "value" = null) if (!class) if (!classes) @@ -109,6 +112,11 @@ GLOBAL_PROTECT(VVpixelmovement) .["class"] = null return + if (VV_BITFIELD) + .["value"] = input_bitfield(usr, "Editing bitfield: [var_name]", var_name, current_value) + if (.["value"] == null) + .["class"] = null + return if (VV_ATOM_TYPE) .["value"] = pick_closest_path(FALSE) @@ -436,7 +444,7 @@ GLOBAL_PROTECT(VVpixelmovement) else variable = L[index] - default = vv_get_class(variable) + default = vv_get_class(objectvar, variable) to_chat(src, "Variable appears to be [uppertext(default)].") @@ -556,7 +564,7 @@ GLOBAL_PROTECT(VVpixelmovement) return - var/default = vv_get_class(var_value) + var/default = vv_get_class(variable, var_value) if(isnull(default)) to_chat(src, "Unable to determine variable type.") @@ -585,7 +593,7 @@ GLOBAL_PROTECT(VVpixelmovement) default = VV_MESSAGE class = default - var/list/value = vv_get_value(class, default, var_value, extra_classes = list(VV_LIST)) + var/list/value = vv_get_value(class, default, var_value, extra_classes = list(VV_LIST), var_name = variable) class = value["class"] if (!class) diff --git a/code/modules/admin/verbs/possess.dm b/code/modules/admin/verbs/possess.dm index a9b5093e994..b92e9901e05 100644 --- a/code/modules/admin/verbs/possess.dm +++ b/code/modules/admin/verbs/possess.dm @@ -2,7 +2,7 @@ set name = "Possess Obj" set category = "Object" - if(O.dangerous_possession && CONFIG_GET(flag/forbid_singulo_possession)) + if((O.obj_flags & DANGEROUS_POSSESSION) && CONFIG_GET(flag/forbid_singulo_possession)) to_chat(usr, "[O] is too powerful for you to possess.") return diff --git a/code/modules/atmospherics/machinery/airalarm.dm b/code/modules/atmospherics/machinery/airalarm.dm index 6fd846ad66e..f83164a409e 100644 --- a/code/modules/atmospherics/machinery/airalarm.dm +++ b/code/modules/atmospherics/machinery/airalarm.dm @@ -202,7 +202,7 @@ var/data = list( "locked" = locked, "siliconUser" = user.has_unlimited_silicon_privilege, - "emagged" = emagged, + "emagged" = (obj_flags & EMAGGED ? 1 : 0), "danger_level" = danger_level, ) @@ -288,7 +288,7 @@ data["modes"] += list(list("name" = "Siphon - Siphons air out of the room", "mode" = AALARM_MODE_SIPHON, "selected" = mode == AALARM_MODE_SIPHON, "danger" = 1)) data["modes"] += list(list("name" = "Panic Siphon - Siphons air out of the room quickly","mode" = AALARM_MODE_PANIC, "selected" = mode == AALARM_MODE_PANIC, "danger" = 1)) data["modes"] += list(list("name" = "Off - Shuts off vents and scrubbers", "mode" = AALARM_MODE_OFF, "selected" = mode == AALARM_MODE_OFF, "danger" = 0)) - if(emagged) + if(obj_flags & EMAGGED) data["modes"] += list(list("name" = "Flood - Shuts off scrubbers and opens vents", "mode" = AALARM_MODE_FLOOD, "selected" = mode == AALARM_MODE_FLOOD, "danger" = 1)) var/datum/tlv/selected @@ -756,9 +756,9 @@ update_icon() /obj/machinery/airalarm/emag_act(mob/user) - if(emagged) + if(obj_flags & EMAGGED) return - emagged = TRUE + obj_flags |= EMAGGED visible_message("Sparks fly out of [src]!", "You emag [src], disabling its safeties.") playsound(src, "sparks", 50, 1) diff --git a/code/modules/atmospherics/machinery/atmosmachinery.dm b/code/modules/atmospherics/machinery/atmosmachinery.dm index d569b0cb368..024c246747f 100644 --- a/code/modules/atmospherics/machinery/atmosmachinery.dm +++ b/code/modules/atmospherics/machinery/atmosmachinery.dm @@ -17,10 +17,10 @@ Pipelines + Other Objects -> Pipe network idle_power_usage = 0 active_power_usage = 0 power_channel = ENVIRON - on_blueprints = TRUE layer = GAS_PIPE_HIDDEN_LAYER //under wires resistance_flags = FIRE_PROOF max_integrity = 200 + obj_flags = CAN_BE_HIT | ON_BLUEPRINTS var/nodealert = 0 var/can_unwrench = 0 var/initialize_directions = 0 diff --git a/code/modules/awaymissions/mission_code/Cabin.dm b/code/modules/awaymissions/mission_code/Cabin.dm index c43330d0e69..7b0a3121b64 100644 --- a/code/modules/awaymissions/mission_code/Cabin.dm +++ b/code/modules/awaymissions/mission_code/Cabin.dm @@ -72,7 +72,7 @@ /obj/machinery/recycler/lumbermill name = "lumbermill saw" desc = "Faster then the cartoons!" - emagged = 2 //Always gibs people + obj_flags = CAN_BE_HIT | EMAGGED item_recycle_sound = 'sound/weapons/chainsawhit.ogg' /obj/machinery/recycler/lumbermill/recycle_item(obj/item/grown/log/L) diff --git a/code/modules/cargo/console.dm b/code/modules/cargo/console.dm index a41106a49d6..a382af0bd84 100644 --- a/code/modules/cargo/console.dm +++ b/code/modules/cargo/console.dm @@ -23,21 +23,24 @@ . = ..() var/obj/item/circuitboard/computer/cargo/board = circuit contraband = board.contraband - emagged = board.emagged + if (board.obj_flags & EMAGGED) + obj_flags |= EMAGGED + else + obj_flags &= ~EMAGGED /obj/machinery/computer/cargo/emag_act(mob/user) - if(emagged) + if(obj_flags & EMAGGED) return user.visible_message("[user] swipes a suspicious card through [src]!", "You adjust [src]'s routing and receiver spectrum, unlocking special supplies and contraband.") - emagged = TRUE + obj_flags |= EMAGGED contraband = TRUE // This also permamently sets this on the circuit board var/obj/item/circuitboard/computer/cargo/board = circuit board.contraband = TRUE - board.emagged = TRUE + board.obj_flags |= EMAGGED /obj/machinery/computer/cargo/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, \ datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state) @@ -69,7 +72,7 @@ "name" = P.group, "packs" = list() ) - if((P.hidden && !emagged) || (P.contraband && !contraband) || (P.special && !P.special_enabled) || P.DropPodOnly) + if((P.hidden && !(obj_flags & EMAGGED)) || (P.contraband && !contraband) || (P.special && !P.special_enabled) || P.DropPodOnly) continue data["supplies"][P.group]["packs"] += list(list( "name" = P.name, @@ -111,7 +114,10 @@ say(blockade_warning) return if(SSshuttle.supply.getDockedId() == "supply_home") - SSshuttle.supply.emagged = emagged + if (obj_flags & EMAGGED) + SSshuttle.supply.obj_flags |= EMAGGED + else + SSshuttle.supply.obj_flags = (SSshuttle.supply.obj_flags & ~EMAGGED) SSshuttle.supply.contraband = contraband SSshuttle.moveShuttle("supply", "supply_away", TRUE) say("The supply shuttle has departed.") @@ -140,7 +146,7 @@ var/datum/supply_pack/pack = SSshuttle.supply_packs[id] if(!istype(pack)) return - if((pack.hidden && !emagged) || (pack.contraband && !contraband) || pack.DropPodOnly) + if((pack.hidden && !(obj_flags & EMAGGED)) || (pack.contraband && !contraband) || pack.DropPodOnly) return var/name = "*None Provided*" diff --git a/code/modules/cargo/export_scanner.dm b/code/modules/cargo/export_scanner.dm index 79f6b9dfaff..874efd88d52 100644 --- a/code/modules/cargo/export_scanner.dm +++ b/code/modules/cargo/export_scanner.dm @@ -29,7 +29,7 @@ else // Before you fix it: // yes, checking manifests is a part of intended functionality. - var/price = export_item_and_contents(O, cargo_console.contraband, cargo_console.emagged, dry_run=TRUE) + var/price = export_item_and_contents(O, cargo_console.contraband, (cargo_console.obj_flags & EMAGGED), dry_run=TRUE) if(price) to_chat(user, "Scanned [O], value: [price] credits[O.contents.len ? " (contents included)" : ""].") diff --git a/code/modules/cargo/expressconsole.dm b/code/modules/cargo/expressconsole.dm index 1e2ed1d0bf9..8c68e75af5f 100644 --- a/code/modules/cargo/expressconsole.dm +++ b/code/modules/cargo/expressconsole.dm @@ -12,7 +12,7 @@ var/message var/locked = TRUE var/list/meme_pack_data - + /obj/machinery/computer/cargo/express/Initialize() . = ..() packin_up() @@ -25,16 +25,16 @@ to_chat(user, "You [locked ? "lock" : "unlock"] the interface.") /obj/machinery/computer/cargo/express/emag_act(mob/living/user) - if(emagged) + if(obj_flags & EMAGGED) return user.visible_message("[user] swipes a suspicious card through [src]!", "You change the routing protocols, allowing the Drop Pod to land anywhere on the station.") - emagged = TRUE + obj_flags |= EMAGGED // This also sets this on the circuit board var/obj/item/circuitboard/computer/cargo/board = circuit - board.emagged = TRUE + board.obj_flags |= EMAGGED packin_up() - + /obj/machinery/computer/cargo/express/proc/packin_up() // oh shit, I'm sorry meme_pack_data = list() // sorry for what? for(var/pack in SSshuttle.supply_packs) // our quartermaster taught us not to be ashamed of our supply packs @@ -46,7 +46,7 @@ ) // see, my quartermaster taught me a few things too if((P.hidden) || (P.special)) // like, how not to rip the manifest continue// by using someone else's crate - if(!emagged && P.contraband) // will you show me? + if(!(obj_flags & EMAGGED) && P.contraband) // will you show me? continue // i'd be right happy to meme_pack_data[P.group]["packs"] += list(list( "name" = P.name, @@ -71,15 +71,15 @@ Sales are near-instantaneous - please choose carefully." if(SSshuttle.supplyBlocked) message = blockade_warning - if(emagged) + if(obj_flags & EMAGGED) message = "(&!#@ERROR: ROUTING_#PROTOCOL MALF(*CT#ON. $UG%ESTE@ ACT#0N: !^/PULS3-%E)ET CIR*)ITB%ARD." - + data["message"] = message if(!meme_pack_data) packin_up() stack_trace("You didn't give the cargo tech good advice, and he ripped the manifest. As a result, there was no pack data for [src]") data["supplies"] = meme_pack_data - + return data /obj/machinery/computer/cargo/express/ui_act(action, params, datum/tgui/ui) @@ -103,7 +103,7 @@ var/list/empty_turfs var/area/landingzone var/datum/supply_order/SO = new(pack, name, rank, ckey, reason) - if(!emagged) + if(!(obj_flags & EMAGGED)) if(SO.pack.cost * 2 <= SSshuttle.points) landingzone = locate(/area/quartermaster/storage) in GLOB.sortedAreas for(var/turf/open/floor/T in landingzone.contents) diff --git a/code/modules/clothing/glasses/hud.dm b/code/modules/clothing/glasses/hud.dm index 4d59a893eac..626bf4f542c 100644 --- a/code/modules/clothing/glasses/hud.dm +++ b/code/modules/clothing/glasses/hud.dm @@ -17,15 +17,15 @@ H.remove_hud_from(user) /obj/item/clothing/glasses/hud/emp_act(severity) - if(emagged) + if(obj_flags & EMAGGED) return - emagged = TRUE + obj_flags |= EMAGGED desc = "[desc] The display is flickering slightly." /obj/item/clothing/glasses/hud/emag_act(mob/user) - if(emagged) + if(obj_flags & EMAGGED) return - emagged = TRUE + obj_flags |= EMAGGED to_chat(user, "PZZTTPFFFT") desc = "[desc] The display is flickering slightly." diff --git a/code/modules/clothing/spacesuits/flightsuit.dm b/code/modules/clothing/spacesuits/flightsuit.dm index 681ba3e7894..f515dacc74c 100644 --- a/code/modules/clothing/spacesuits/flightsuit.dm +++ b/code/modules/clothing/spacesuits/flightsuit.dm @@ -435,7 +435,7 @@ var/nopass = FALSE if(!A.density) return TRUE - nopass = (A.locked || A.stat || A.emagged || A.welded) + nopass = (A.locked || A.stat || (A.obj_flags & EMAGGED) || A.welded) if(A.requiresID()) if((!A.allowed(wearer)) && !A.emergency) nopass = TRUE diff --git a/code/modules/food_and_drinks/drinks/drinks/drinkingglass.dm b/code/modules/food_and_drinks/drinks/drinks/drinkingglass.dm index 263d592303c..a91d5a6a7b6 100644 --- a/code/modules/food_and_drinks/drinks/drinks/drinkingglass.dm +++ b/code/modules/food_and_drinks/drinks/drinks/drinkingglass.dm @@ -10,7 +10,7 @@ max_integrity = 20 spillable = TRUE resistance_flags = ACID_PROOF - unique_rename = 1 + obj_flags = UNIQUE_RENAME /obj/item/reagent_containers/food/drinks/drinkingglass/on_reagent_change(changetype) cut_overlays() diff --git a/code/modules/food_and_drinks/food/customizables.dm b/code/modules/food_and_drinks/food/customizables.dm index 7d83788f9d3..353bfc6538c 100644 --- a/code/modules/food_and_drinks/food/customizables.dm +++ b/code/modules/food_and_drinks/food/customizables.dm @@ -15,7 +15,6 @@ bitesize = 4 w_class = WEIGHT_CLASS_SMALL volume = 80 - unique_rename = 1 var/ingMax = 12 var/list/ingredients = list() diff --git a/code/modules/food_and_drinks/food/snacks.dm b/code/modules/food_and_drinks/food/snacks.dm index b0e2067be0a..cb5e3c6248b 100644 --- a/code/modules/food_and_drinks/food/snacks.dm +++ b/code/modules/food_and_drinks/food/snacks.dm @@ -5,7 +5,7 @@ icon_state = null lefthand_file = 'icons/mob/inhands/misc/food_lefthand.dmi' righthand_file = 'icons/mob/inhands/misc/food_righthand.dmi' - unique_rename = 1 + obj_flags = UNIQUE_RENAME grind_results = list() //To let them be ground up to transfer their reagents var/bitesize = 2 var/bitecount = 0 diff --git a/code/modules/holodeck/computer.dm b/code/modules/holodeck/computer.dm index 97b610a5d23..a55a5e16571 100644 --- a/code/modules/holodeck/computer.dm +++ b/code/modules/holodeck/computer.dm @@ -90,7 +90,7 @@ var/list/data = list() data["default_programs"] = program_cache - if(emagged) + if(obj_flags & EMAGGED) data["emagged"] = TRUE data["emag_programs"] = emag_programs data["program"] = program @@ -111,10 +111,10 @@ if(A) load_program(A) if("safety") - emagged = !emagged - if(emagged && program && emag_programs[program.name]) + obj_flags ^= EMAGGED + if((obj_flags & EMAGGED) && program && emag_programs[program.name]) emergency_shutdown() - nerf(emagged) + nerf(obj_flags & EMAGGED) /obj/machinery/computer/holodeck/process() if(damaged && prob(10)) @@ -138,7 +138,7 @@ T.ex_act(EXPLODE_LIGHT) T.hotspot_expose(1000,500,1) - if(!emagged) + if(!(obj_flags & EMAGGED)) for(var/item in spawned) if(!(get_turf(item) in linked)) derez(item, 0) @@ -149,17 +149,17 @@ active_power_usage = 50 + spawned.len * 3 + effects.len * 5 /obj/machinery/computer/holodeck/emag_act(mob/user) - if(emagged) + if(obj_flags & EMAGGED) return if(!LAZYLEN(emag_programs)) to_chat(user, "[src] does not seem to have a card swipe port. It must be an inferior model.") return playsound(src, "sparks", 75, 1) - emagged = TRUE + obj_flags |= EMAGGED to_chat(user, "You vastly increase projector power and override the safety and security protocols.") to_chat(user, "Warning. Automatic shutoff and derezing protocols have been corrupted. Please call Nanotrasen maintenance and do not use the simulator.") log_game("[key_name(user)] emagged the Holodeck Control Console") - nerf(!emagged) + nerf(!(obj_flags & EMAGGED)) /obj/machinery/computer/holodeck/emp_act(severity) emergency_shutdown() @@ -245,7 +245,7 @@ // note nerfing does not yet work on guns, should // should also remove/limit/filter reagents? // this is an exercise left to others I'm afraid. -Sayu - spawned = A.copy_contents_to(linked, 1, nerf_weapons = !emagged) + spawned = A.copy_contents_to(linked, 1, nerf_weapons = !(obj_flags & EMAGGED)) for(var/obj/machinery/M in spawned) M.flags_1 |= NODECONSTRUCT_1 for(var/obj/structure/S in spawned) @@ -270,7 +270,7 @@ /obj/machinery/computer/holodeck/proc/derez(obj/O, silent = TRUE, forced = FALSE) // Emagging a machine creates an anomaly in the derez systems. - if(O && emagged && !stat && !forced) + if(O && (obj_flags & EMAGGED) && !stat && !forced) if((ismob(O) || ismob(O.loc)) && prob(50)) addtimer(CALLBACK(src, .proc/derez, O, silent), 50) // may last a disturbingly long time return diff --git a/code/modules/holodeck/holo_effect.dm b/code/modules/holodeck/holo_effect.dm index e3f0017d516..15c183923a2 100644 --- a/code/modules/holodeck/holo_effect.dm +++ b/code/modules/holodeck/holo_effect.dm @@ -32,7 +32,7 @@ /obj/effect/holodeck_effect/cards/activate(var/obj/machinery/computer/holodeck/HC) D = new(loc) - safety(!HC.emagged) + safety(!(HC.obj_flags & EMAGGED)) D.holo = HC return D diff --git a/code/modules/hydroponics/gene_modder.dm b/code/modules/hydroponics/gene_modder.dm index fa1e25a6d4d..6541cfb8bdb 100644 --- a/code/modules/hydroponics/gene_modder.dm +++ b/code/modules/hydroponics/gene_modder.dm @@ -420,7 +420,7 @@ materials = list(MAT_METAL=30, MAT_GLASS=10) var/datum/plant_gene/gene var/read_only = 0 //Well, it's still a floppy disk - unique_rename = 1 + obj_flags = UNIQUE_RENAME /obj/item/disk/plantgene/Initialize() . = ..() diff --git a/code/modules/hydroponics/hydroponics.dm b/code/modules/hydroponics/hydroponics.dm index c46fb92febc..8fc5c43bcc0 100644 --- a/code/modules/hydroponics/hydroponics.dm +++ b/code/modules/hydroponics/hydroponics.dm @@ -5,7 +5,7 @@ density = TRUE anchored = TRUE pixel_y = 8 - unique_rename = 1 + obj_flags = CAN_BE_HIT | UNIQUE_RENAME circuit = /obj/item/circuitboard/machine/hydroponics var/waterlevel = 100 //The amount of water in the tray (max 100) var/maxwater = 100 //The maximum amount of water in the tray diff --git a/code/modules/library/lib_machines.dm b/code/modules/library/lib_machines.dm index 1acf90e260e..f0b881c9e22 100644 --- a/code/modules/library/lib_machines.dm +++ b/code/modules/library/lib_machines.dm @@ -214,7 +214,7 @@ GLOBAL_LIST(cachedbooks) // List of our cached book datums dat += "5. Upload New Title to Archive
" dat += "6. Upload Scanned Title to Newscaster
" dat += "7. Print Corporate Materials
" - if(src.emagged) + if(obj_flags & EMAGGED) dat += "8. Access the Forbidden Lore Vault
" if(src.arcanecheckout) print_forbidden_lore(user) @@ -339,8 +339,8 @@ GLOBAL_LIST(cachedbooks) // List of our cached book datums return ..() /obj/machinery/computer/libraryconsole/bookmanagement/emag_act(mob/user) - if(density && !emagged) - emagged = TRUE + if(density && !(obj_flags & EMAGGED)) + obj_flags |= EMAGGED /obj/machinery/computer/libraryconsole/bookmanagement/Topic(href, href_list) if(..()) @@ -370,7 +370,7 @@ GLOBAL_LIST(cachedbooks) // List of our cached book datums if("8") screenstate = 8 if(href_list["arccheckout"]) - if(src.emagged) + if(obj_flags & EMAGGED) src.arcanecheckout = 1 src.screenstate = 0 if(href_list["increasetime"]) diff --git a/code/modules/mining/laborcamp/laborstacker.dm b/code/modules/mining/laborcamp/laborstacker.dm index 7b38bc4cb57..78417a56d1f 100644 --- a/code/modules/mining/laborcamp/laborstacker.dm +++ b/code/modules/mining/laborcamp/laborstacker.dm @@ -44,7 +44,7 @@ var/list/data = list() var/can_go_home = FALSE - data["emagged"] = emagged + data["emagged"] = (obj_flags & EMAGGED) ? 1 : 0 if(inserted_id) data["id"] = inserted_id data["id_name"] = inserted_id.registered_name @@ -101,13 +101,13 @@ if(3) to_chat(usr, "No permission to dock could be granted.") else - if(!emagged) + if(!(obj_flags & EMAGGED)) Radio.set_frequency(FREQ_SECURITY) Radio.talk_into(src, "[inserted_id.registered_name] has returned to the station. Minerals and Prisoner ID card ready for retrieval.", FREQ_SECURITY, get_spans(), get_default_language()) to_chat(usr, "Shuttle received message and will be sent shortly.") /obj/machinery/mineral/labor_claim_console/proc/check_auth() - if(emagged) + if(obj_flags & EMAGGED) return 1 //Shuttle is emagged, let any ol' person through return (istype(inserted_id) && inserted_id.points >= inserted_id.goal) //Otherwise, only let them out if the prisoner's reached his quota. @@ -119,8 +119,8 @@ qdel(src) /obj/machinery/mineral/labor_claim_console/emag_act(mob/user) - if(!emagged) - emagged = TRUE + if(!(obj_flags & EMAGGED)) + obj_flags |= EMAGGED to_chat(user, "PZZTTPFFFT") diff --git a/code/modules/mining/lavaland/ruins/gym.dm b/code/modules/mining/lavaland/ruins/gym.dm index efda0f9c8f5..b148495f443 100644 --- a/code/modules/mining/lavaland/ruins/gym.dm +++ b/code/modules/mining/lavaland/ruins/gym.dm @@ -21,11 +21,11 @@ anchored = TRUE /obj/structure/stacklifter/attack_hand(mob/living/user) - if(in_use) + if(obj_flags & IN_USE) to_chat(user, "It's already in use - wait a bit.") return else - in_use = 1 + obj_flags |= IN_USE icon_state = "fitnesslifter2" user.setDir(SOUTH) user.Stun(80) @@ -44,7 +44,7 @@ playsound(user, 'goon/sound/effects/spring.ogg', 60, 1) playsound(user, 'sound/machines/click.ogg', 60, 1) - in_use = 0 + obj_flags &= ~IN_USE user.pixel_y = 0 var/finishmessage = pick("You feel stronger!","You feel like you can take on the world!","You feel robust!","You feel indestructible!") icon_state = "fitnesslifter" @@ -59,11 +59,11 @@ anchored = TRUE /obj/structure/weightlifter/attack_hand(mob/living/user) - if(in_use) + if(obj_flags & IN_USE) to_chat(user, "It's already in use - wait a bit.") return else - in_use = 1 + obj_flags |= IN_USE icon_state = "fitnessweight-c" user.setDir(SOUTH) user.Stun(80) @@ -88,7 +88,7 @@ animate(user, pixel_y = 2, time = 3) sleep(3) playsound(user, 'sound/machines/click.ogg', 60, 1) - in_use = 0 + obj_flags &= ~IN_USE animate(user, pixel_y = 0, time = 3) var/finishmessage = pick("You feel stronger!","You feel like you can take on the world!","You feel robust!","You feel indestructible!") icon_state = "fitnessweight" diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index f2a3ba75e81..8d453332841 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -357,7 +357,7 @@ // Checks the user has security clearence before allowing them to change arrest status via hud, comment out to enable all access var/allowed_access = null var/obj/item/clothing/glasses/G = H.glasses - if (!G.emagged) + if (!(G.obj_flags |= EMAGGED)) if(H.wear_id) var/list/access = H.wear_id.GetAccess() if(ACCESS_SEC_DOORS in access) diff --git a/code/modules/modular_computers/computers/item/computer.dm b/code/modules/modular_computers/computers/item/computer.dm index 0b149c20da7..03e57c5ec6a 100644 --- a/code/modules/modular_computers/computers/item/computer.dm +++ b/code/modules/modular_computers/computers/item/computer.dm @@ -175,11 +175,11 @@ turn_on(user) /obj/item/device/modular_computer/emag_act(mob/user) - if(emagged) + if(obj_flags & EMAGGED) to_chat(user, "\The [src] was already emagged.") return 0 else - emagged = TRUE + obj_flags |= EMAGGED to_chat(user, "You emag \the [src]. It's screen briefly shows a \"OVERRIDE ACCEPTED: New software downloads available.\" message.") return 1 diff --git a/code/modules/modular_computers/file_system/program.dm b/code/modules/modular_computers/file_system/program.dm index 57ec83798da..75fdc3ea374 100644 --- a/code/modules/modular_computers/file_system/program.dm +++ b/code/modules/modular_computers/file_system/program.dm @@ -81,7 +81,7 @@ if(!access_to_check) // No required_access, allow it. return 1 - if(!transfer && computer && computer.emagged) //emags can bypass the execution locks but not the download ones. + if(!transfer && computer && (computer.obj_flags & EMAGGED)) //emags can bypass the execution locks but not the download ones. return 1 if(IsAdminGhost(user)) diff --git a/code/modules/modular_computers/file_system/programs/file_browser.dm b/code/modules/modular_computers/file_system/programs/file_browser.dm index f42174320e2..11a4b8e1259 100644 --- a/code/modules/modular_computers/file_system/programs/file_browser.dm +++ b/code/modules/modular_computers/file_system/programs/file_browser.dm @@ -112,7 +112,7 @@ if(!printer) error = "Missing Hardware: Your computer does not have required hardware to complete this operation." return 1 - if(!printer.print_text("" + prepare_printjob(F.stored_data) + "", open_file)) + if(!printer.print_text("" + prepare_printjob(F.stored_data) + "", open_file)) error = "Hardware error: Printer was unable to print the file. It may be out of paper." return 1 if("PRG_copytousb") diff --git a/code/modules/modular_computers/file_system/programs/ntdownloader.dm b/code/modules/modular_computers/file_system/programs/ntdownloader.dm index be38f8a7b6a..b2fe7a0f64c 100644 --- a/code/modules/modular_computers/file_system/programs/ntdownloader.dm +++ b/code/modules/modular_computers/file_system/programs/ntdownloader.dm @@ -29,7 +29,7 @@ return 0 // Attempting to download antag only program, but without having emagged computer. No. - if(PRG.available_on_syndinet && !computer.emagged) + if(PRG.available_on_syndinet && !(computer.obj_flags & EMAGGED)) return 0 var/obj/item/computer_hardware/hard_drive/hard_drive = computer.all_components[MC_HDD] @@ -140,7 +140,7 @@ "size" = P.size ))) data["hackedavailable"] = 0 - if(computer.emagged) // If we are running on emagged computer we have access to some "bonus" software + if(computer.obj_flags & EMAGGED) // If we are running on emagged computer we have access to some "bonus" software var/list/hacked_programs[0] for(var/S in SSnetworks.station_network.available_antag_software) var/datum/computer_file/program/P = S diff --git a/code/modules/ninja/suit/ninjaDrainAct.dm b/code/modules/ninja/suit/ninjaDrainAct.dm index cdae56571fe..8b9abbee7ae 100644 --- a/code/modules/ninja/suit/ninjaDrainAct.dm +++ b/code/modules/ninja/suit/ninjaDrainAct.dm @@ -50,10 +50,10 @@ They *could* go in their appropriate files, but this is supposed to be modular else break - if(!emagged) + if(!(obj_flags & EMAGGED)) flick("apc-spark", G) playsound(loc, "sparks", 50, 1) - emagged = TRUE + obj_flags |= EMAGGED locked = FALSE update_icon() diff --git a/code/modules/paperwork/pen.dm b/code/modules/paperwork/pen.dm index 1d85753de02..060d524a495 100644 --- a/code/modules/paperwork/pen.dm +++ b/code/modules/paperwork/pen.dm @@ -126,7 +126,7 @@ /obj/item/pen/afterattack(obj/O, mob/living/user, proximity) //Changing Name/Description of items. Only works if they have the 'unique_rename' var set if(isobj(O) && proximity) - if(O.unique_rename) + if(O.obj_flags & UNIQUE_RENAME) var/penchoice = input(user, "What would you like to edit?", "Rename or change description?") as null|anything in list("Rename","Change description") if(!QDELETED(O) && user.canUseTopic(O, be_close = TRUE)) diff --git a/code/modules/power/apc.dm b/code/modules/power/apc.dm index 422e62c10fa..695b01e0b78 100644 --- a/code/modules/power/apc.dm +++ b/code/modules/power/apc.dm @@ -315,7 +315,7 @@ update_state |= UPSTATE_OPENED1 if(opened==2) update_state |= UPSTATE_OPENED2 - else if(emagged || malfai) + else if((obj_flags & EMAGGED) || malfai) update_state |= UPSTATE_BLUESCREEN else if(panel_open) update_state |= UPSTATE_WIREEXP @@ -395,8 +395,8 @@ "You hear a crack.") return //SSticker.mode:apcs-- //XSI said no and I agreed. -rastaf0 - else if (emagged) // We emag board, not APC's frame - emagged = FALSE + else if (obj_flags & EMAGGED) // We emag board, not APC's frame + obj_flags &= ~EMAGGED user.visible_message(\ "[user.name] has discarded emaged power control board from [src.name]!",\ "You discarded shorten board.") @@ -479,7 +479,7 @@ to_chat(user, "There is nothing to secure!") return update_icon() - else if(emagged) + else if(obj_flags & EMAGGED) to_chat(user, "The interface is broken!") else if((stat & MAINT) && !opened) ..() //its an empty closed frame... theres no wires to expose! @@ -669,7 +669,7 @@ togglelock(user) /obj/machinery/power/apc/proc/togglelock(mob/living/user) - if(emagged) + if(obj_flags & EMAGGED) to_chat(user, "The interface is broken!") else if(opened) to_chat(user, "You must close the cover to swipe an ID card!") @@ -705,7 +705,7 @@ update_icon() /obj/machinery/power/apc/emag_act(mob/user) - if(!emagged && !malfhack) + if(!(obj_flags & EMAGGED) && !malfhack) if(opened) to_chat(user, "You must close the cover to swipe an ID card!") else if(panel_open) @@ -715,7 +715,7 @@ else flick("apc-spark", src) playsound(src, "sparks", 75, 1) - emagged = TRUE + obj_flags |= EMAGGED locked = FALSE to_chat(user, "You emag the APC interface.") update_icon() @@ -852,7 +852,7 @@ switch(action) if("lock") if(usr.has_unlimited_silicon_privilege) - if(emagged || (stat & (BROKEN|MAINT))) + if((obj_flags & EMAGGED) || (stat & (BROKEN|MAINT))) to_chat(usr, "The APC does not respond to the command.") else locked = !locked diff --git a/code/modules/power/cable.dm b/code/modules/power/cable.dm index 3646a80d458..21fe79a0274 100644 --- a/code/modules/power/cable.dm +++ b/code/modules/power/cable.dm @@ -41,7 +41,7 @@ By design, d1 is the smallest direction and d2 is the highest level = 1 //is underfloor layer = WIRE_LAYER //Above hidden pipes, GAS_PIPE_HIDDEN_LAYER anchored = TRUE - on_blueprints = TRUE + obj_flags = CAN_BE_HIT | ON_BLUEPRINTS var/d1 = 0 // cable direction 1 (see above) var/d2 = 1 // cable direction 2 (see above) var/datum/powernet/powernet diff --git a/code/modules/power/port_gen.dm b/code/modules/power/port_gen.dm index 73f48a2b288..ba3379df45e 100644 --- a/code/modules/power/port_gen.dm +++ b/code/modules/power/port_gen.dm @@ -206,9 +206,9 @@ return ..() /obj/machinery/power/port_gen/pacman/emag_act(mob/user) - if(emagged) + if(obj_flags & EMAGGED) return - emagged = TRUE + obj_flags |= EMAGGED emp_act(EMP_HEAVY) /obj/machinery/power/port_gen/pacman/attack_hand(mob/user) @@ -273,7 +273,7 @@ power_output-- src.updateUsrDialog() if (href_list["action"] == "higher_power") - if (power_output < 4 || emagged) + if (power_output < 4 || (obj_flags & EMAGGED)) power_output++ src.updateUsrDialog() if (href_list["action"] == "close") diff --git a/code/modules/power/power.dm b/code/modules/power/power.dm index 933cfc70e0d..0bd230a1666 100644 --- a/code/modules/power/power.dm +++ b/code/modules/power/power.dm @@ -10,7 +10,7 @@ name = null icon = 'icons/obj/power.dmi' anchored = TRUE - on_blueprints = TRUE + obj_flags = CAN_BE_HIT | ON_BLUEPRINTS var/datum/powernet/powernet = null use_power = NO_POWER_USE idle_power_usage = 0 diff --git a/code/modules/power/singularity/emitter.dm b/code/modules/power/singularity/emitter.dm index 1c5f0a3375f..feb00be1f91 100644 --- a/code/modules/power/singularity/emitter.dm +++ b/code/modules/power/singularity/emitter.dm @@ -273,7 +273,7 @@ return if(W.GetID()) - if(emagged) + if(obj_flags & EMAGGED) to_chat(user, "The lock seems to be broken!") return if(allowed(user)) @@ -305,10 +305,10 @@ return ..() /obj/machinery/power/emitter/emag_act(mob/user) - if(emagged) + if(obj_flags & EMAGGED) return locked = FALSE - emagged = TRUE + obj_flags |= EMAGGED if(user) user.visible_message("[user.name] emags [src].","You short out the lock.") diff --git a/code/modules/power/singularity/singularity.dm b/code/modules/power/singularity/singularity.dm index 17aafc94923..3c7d00b3fdd 100644 --- a/code/modules/power/singularity/singularity.dm +++ b/code/modules/power/singularity/singularity.dm @@ -27,7 +27,7 @@ var/last_warning var/consumedSupermatter = 0 //If the singularity has eaten a supermatter shard and can go to stage six resistance_flags = INDESTRUCTIBLE | LAVA_PROOF | FIRE_PROOF | UNACIDABLE | ACID_PROOF | FREEZE_PROOF - dangerous_possession = TRUE + obj_flags = CAN_BE_HIT | DANGEROUS_POSSESSION /obj/singularity/Initialize(mapload, starting_energy = 50) //CARN: admin-alert for chuckle-fuckery. diff --git a/code/modules/power/tesla/coil.dm b/code/modules/power/tesla/coil.dm index a0977d93e3e..e42715af22e 100644 --- a/code/modules/power/tesla/coil.dm +++ b/code/modules/power/tesla/coil.dm @@ -68,7 +68,7 @@ /obj/machinery/power/tesla_coil/tesla_act(var/power) if(anchored && !panel_open) - being_shocked = TRUE + obj_flags |= BEING_SHOCKED //don't lose arc power when it's not connected to anything //please place tesla coils all around the station to maximize effectiveness var/power_produced = powernet ? power / power_loss : power diff --git a/code/modules/power/tesla/energy_ball.dm b/code/modules/power/tesla/energy_ball.dm index d0ba416f20b..18783f7695a 100644 --- a/code/modules/power/tesla/energy_ball.dm +++ b/code/modules/power/tesla/energy_ball.dm @@ -80,7 +80,7 @@ //we face the last thing we zapped, so this lets us favor that direction a bit var/move_bias = pick(GLOB.alldirs) for(var/i in 0 to move_amount) - var/move_dir = pick(GLOB.alldirs + move_bias) //ensures large-ball teslas don't just sit around + var/move_dir = pick(GLOB.alldirs + move_bias) //ensures large-ball teslas don't just sit around if(target && prob(10)) move_dir = get_dir(src,target) var/turf/T = get_step(src, move_dir) @@ -196,7 +196,7 @@ if(istype(A, /obj/machinery/power/tesla_coil)) var/dist = get_dist(source, A) var/obj/machinery/power/tesla_coil/C = A - if(dist <= zap_range && (dist < closest_dist || !closest_tesla_coil) && !C.being_shocked) + if(dist <= zap_range && (dist < closest_dist || !closest_tesla_coil) && !(C.obj_flags & BEING_SHOCKED)) closest_dist = dist //we use both of these to save on istype and typecasting overhead later on @@ -232,7 +232,7 @@ else if(ismachinery(A)) var/obj/machinery/M = A var/dist = get_dist(source, A) - if(dist <= zap_range && (dist < closest_dist || !closest_machine) && !M.being_shocked) + if(dist <= zap_range && (dist < closest_dist || !closest_machine) && !(M.obj_flags & BEING_SHOCKED)) closest_machine = M closest_atom = A closest_dist = dist @@ -243,7 +243,7 @@ else if(istype(A, /obj/structure/blob)) var/obj/structure/blob/B = A var/dist = get_dist(source, A) - if(dist <= zap_range && (dist < closest_dist || !closest_tesla_coil) && !B.being_shocked) + if(dist <= zap_range && (dist < closest_dist || !closest_tesla_coil) && !(B.obj_flags & BEING_SHOCKED)) closest_blob = B closest_atom = A closest_dist = dist @@ -254,7 +254,7 @@ else if(isstructure(A)) var/obj/structure/S = A var/dist = get_dist(source, A) - if(dist <= zap_range && (dist < closest_dist || !closest_tesla_coil) && !S.being_shocked) + if(dist <= zap_range && (dist < closest_dist || !closest_tesla_coil) && !(S.obj_flags & BEING_SHOCKED)) closest_structure = S closest_atom = A closest_dist = dist diff --git a/code/modules/projectiles/gun.dm b/code/modules/projectiles/gun.dm index 8efb7ce9e1b..043964ed2ae 100644 --- a/code/modules/projectiles/gun.dm +++ b/code/modules/projectiles/gun.dm @@ -16,7 +16,6 @@ throw_range = 5 force = 5 needs_permit = TRUE - unique_rename = FALSE attack_verb = list("struck", "hit", "bashed") var/fire_sound = "gunshot" @@ -191,7 +190,7 @@ /obj/item/gun/proc/handle_pins(mob/living/user) if(pin) - if(pin.pin_auth(user) || pin.emagged) + if(pin.pin_auth(user) || (pin.obj_flags & EMAGGED)) return TRUE else pin.auth_fail(user) diff --git a/code/modules/projectiles/guns/ballistic/revolver.dm b/code/modules/projectiles/guns/ballistic/revolver.dm index aefa7826a0f..ad17df9e2a4 100644 --- a/code/modules/projectiles/guns/ballistic/revolver.dm +++ b/code/modules/projectiles/guns/ballistic/revolver.dm @@ -89,7 +89,7 @@ desc = "A cheap Martian knock-off of a classic law enforcement firearm. Uses .38-special rounds." icon_state = "detective" mag_type = /obj/item/ammo_box/magazine/internal/cylinder/rev38 - unique_rename = TRUE + obj_flags = UNIQUE_RENAME unique_reskin = list("Default" = "detective", "Leopard Spots" = "detective_leopard", "Black Panther" = "detective_panther", @@ -261,7 +261,7 @@ slot_flags = SLOT_BACK mag_type = /obj/item/ammo_box/magazine/internal/shot/dual sawn_desc = "Omar's coming!" - unique_rename = TRUE + obj_flags = UNIQUE_RENAME unique_reskin = list("Default" = "dshotgun", "Dark Red Finish" = "dshotgun-d", "Ash" = "dshotgun-f", @@ -307,7 +307,6 @@ slot_flags = null mag_type = /obj/item/ammo_box/magazine/internal/shot/improvised sawn_desc = "I'm just here for the gasoline." - unique_rename = FALSE unique_reskin = null var/slung = FALSE diff --git a/code/modules/projectiles/guns/energy/kinetic_accelerator.dm b/code/modules/projectiles/guns/energy/kinetic_accelerator.dm index 3eec556c95a..a85020432bd 100644 --- a/code/modules/projectiles/guns/energy/kinetic_accelerator.dm +++ b/code/modules/projectiles/guns/energy/kinetic_accelerator.dm @@ -6,7 +6,7 @@ ammo_type = list(/obj/item/ammo_casing/energy/kinetic) cell_type = /obj/item/stock_parts/cell/emproof needs_permit = 0 - unique_rename = 1 + obj_flags = UNIQUE_RENAME weapon_weight = WEAPON_LIGHT can_flashlight = 1 flight_x_offset = 15 diff --git a/code/modules/projectiles/guns/energy/special.dm b/code/modules/projectiles/guns/energy/special.dm index a4ae8cae13b..abb5e07cbdc 100644 --- a/code/modules/projectiles/guns/energy/special.dm +++ b/code/modules/projectiles/guns/energy/special.dm @@ -89,7 +89,7 @@ suppressed = TRUE ammo_type = list(/obj/item/ammo_casing/energy/bolt) weapon_weight = WEAPON_LIGHT - unique_rename = 0 + obj_flags = 0 overheat_time = 20 holds_charge = TRUE unique_frequency = TRUE diff --git a/code/modules/projectiles/pins.dm b/code/modules/projectiles/pins.dm index 92b2f8c0d4f..a21956fc10d 100644 --- a/code/modules/projectiles/pins.dm +++ b/code/modules/projectiles/pins.dm @@ -37,9 +37,9 @@ to_chat(user, "This firearm already has a firing pin installed.") /obj/item/device/firing_pin/emag_act(mob/user) - if(emagged) + if(obj_flags & EMAGGED) return - emagged = TRUE + obj_flags |= EMAGGED to_chat(user, "You override the authentication mechanism.") /obj/item/device/firing_pin/proc/gun_insert(mob/living/user, obj/item/gun/G) diff --git a/code/modules/reagents/chemistry/machinery/chem_dispenser.dm b/code/modules/reagents/chemistry/machinery/chem_dispenser.dm index ebf2c8913bf..5bc052429f2 100644 --- a/code/modules/reagents/chemistry/machinery/chem_dispenser.dm +++ b/code/modules/reagents/chemistry/machinery/chem_dispenser.dm @@ -82,12 +82,12 @@ use_power(2500) /obj/machinery/chem_dispenser/emag_act(mob/user) - if(emagged) + if(obj_flags & EMAGGED) to_chat(user, "[src] has no functional safeties to emag.") return to_chat(user, "You short out [src]'s safeties.") dispensable_reagents |= emagged_reagents//add the emagged reagents to the dispensable ones - emagged = TRUE + obj_flags |= EMAGGED /obj/machinery/chem_dispenser/ex_act(severity, target) if(severity < 3) diff --git a/code/modules/recycling/disposal/bin.dm b/code/modules/recycling/disposal/bin.dm index 62965f7ca18..da2ff6d0bd2 100644 --- a/code/modules/recycling/disposal/bin.dm +++ b/code/modules/recycling/disposal/bin.dm @@ -6,7 +6,6 @@ icon = 'icons/obj/atmospherics/pipes/disposal.dmi' anchored = TRUE density = TRUE - on_blueprints = TRUE armor = list(melee = 25, bullet = 10, laser = 10, energy = 100, bomb = 0, bio = 100, rad = 100, fire = 90, acid = 30) max_integrity = 200 resistance_flags = FIRE_PROOF diff --git a/code/modules/recycling/disposal/pipe.dm b/code/modules/recycling/disposal/pipe.dm index 355d5d6b964..194432c4060 100644 --- a/code/modules/recycling/disposal/pipe.dm +++ b/code/modules/recycling/disposal/pipe.dm @@ -6,7 +6,7 @@ icon = 'icons/obj/atmospherics/pipes/disposal.dmi' anchored = TRUE density = FALSE - on_blueprints = TRUE + obj_flags = CAN_BE_HIT | ON_BLUEPRINTS level = 1 // underfloor only dir = NONE // dir will contain dominant direction for junction pipes max_integrity = 200 diff --git a/code/modules/research/departmental_circuit_imprinter.dm b/code/modules/research/departmental_circuit_imprinter.dm index 06e7c531b89..01c4a6a22c0 100644 --- a/code/modules/research/departmental_circuit_imprinter.dm +++ b/code/modules/research/departmental_circuit_imprinter.dm @@ -144,7 +144,7 @@ /obj/machinery/rnd/circuit_imprinter/department/proc/ui_header() var/list/l = list() l += "
[host_research.organization] [department_tag] Department Circuit Imprinter" - l += "Security protocols: [emagged? "Disabled" : "Enabled"]" + l += "Security protocols: [(obj_flags & EMAGGED) ? "Disabled" : "Enabled"]" l += "Material Amount: [materials.total_amount] / [materials.max_amount]" l += "Chemical volume: [reagents.total_volume] / [reagents.maximum_volume]" l += "Synchronize Research" diff --git a/code/modules/research/departmental_lathe.dm b/code/modules/research/departmental_lathe.dm index dc3c8ad66ff..ab893e7853b 100644 --- a/code/modules/research/departmental_lathe.dm +++ b/code/modules/research/departmental_lathe.dm @@ -187,7 +187,7 @@ /obj/machinery/rnd/protolathe/department/proc/ui_header() var/list/l = list() l += "
[host_research.organization] [department_tag] Department Lathe" - l += "Security protocols: [emagged? "Disabled" : "Enabled"]" + l += "Security protocols: [(obj_flags & EMAGGED) ? "Disabled" : "Enabled"]" l += "Material Amount: [materials.total_amount] / [materials.max_amount]" l += "Chemical volume: [reagents.total_volume] / [reagents.maximum_volume]" l += "Synchronize Research" diff --git a/code/modules/research/rdconsole.dm b/code/modules/research/rdconsole.dm index 51797821772..51e2b4bb587 100644 --- a/code/modules/research/rdconsole.dm +++ b/code/modules/research/rdconsole.dm @@ -191,10 +191,10 @@ doesn't have toxins access. ..() /obj/machinery/computer/rdconsole/emag_act(mob/user) - if(!emagged) + if(!(obj_flags & EMAGGED)) to_chat(user, "You disable the security protocols") playsound(src, "sparks", 75, 1) - emagged = TRUE + obj_flags |= EMAGGED return ..() /obj/machinery/computer/rdconsole/proc/list_categories(list/categories, menu_num as num) @@ -219,7 +219,7 @@ doesn't have toxins access. var/list/l = list() l += "
[stored_research.organization] Research and Development Network" l += "Available points: [round(stored_research.research_points)] (+[round(stored_research.last_bitcoins * 60)] / minute)" - l += "Security protocols: [emagged? "Disabled" : "Enabled"]" + l += "Security protocols: [obj_flags & EMAGGED ? "Disabled" : "Enabled"]" l += "Main Menu | Back
[RDSCREEN_NOBREAK]" l += "[ui_mode == 1? "Normal View" : "Normal View"] | [ui_mode == 2? "Expert View" : "Expert View"] | [ui_mode == 3? "List View" : "List View"]" return l diff --git a/code/modules/research/server.dm b/code/modules/research/server.dm index 8a244bcea10..d712db9a471 100644 --- a/code/modules/research/server.dm +++ b/code/modules/research/server.dm @@ -128,7 +128,7 @@ add_fingerprint(usr) usr.set_machine(src) - if(!src.allowed(usr) && !emagged) + if(!src.allowed(usr) && !(obj_flags & EMAGGED)) to_chat(usr, "You do not have the required access level.") return @@ -163,9 +163,8 @@ src.updateUsrDialog() /obj/machinery/computer/rdservercontrol/emag_act(mob/user) - if(emagged) + if(obj_flags & EMAGGED) return playsound(src, "sparks", 75, 1) - emagged = TRUE + obj_flags |= EMAGGED to_chat(user, "You you disable the security protocols.") - diff --git a/code/modules/ruins/objects_and_mobs/sin_ruins.dm b/code/modules/ruins/objects_and_mobs/sin_ruins.dm index 3924d29e916..33bfdb8b675 100644 --- a/code/modules/ruins/objects_and_mobs/sin_ruins.dm +++ b/code/modules/ruins/objects_and_mobs/sin_ruins.dm @@ -12,9 +12,9 @@ /obj/structure/cursed_slot_machine/attack_hand(mob/living/carbon/human/user) if(!istype(user)) return - if(in_use) + if(obj_flags & IN_USE) return - in_use = TRUE + obj_flags |= IN_USE user.adjustCloneLoss(20) if(user.stat) to_chat(user, "No... just one more try...") @@ -28,7 +28,7 @@ /obj/structure/cursed_slot_machine/proc/determine_victor(mob/living/user) icon_state = "slots1" - in_use = FALSE + obj_flags &= ~IN_USE if(prob(win_prob)) playsound(src, 'sound/lavaland/cursed_slot_machine_jackpot.ogg', 50, 0) new/obj/structure/cursed_money(get_turf(src)) diff --git a/code/modules/shuttle/computer.dm b/code/modules/shuttle/computer.dm index 226de327552..4f2d932b1fc 100644 --- a/code/modules/shuttle/computer.dm +++ b/code/modules/shuttle/computer.dm @@ -66,9 +66,9 @@ to_chat(usr, "Unable to comply.") /obj/machinery/computer/shuttle/emag_act(mob/user) - if(emagged) + if(obj_flags & EMAGGED) return req_access = list() - emagged = TRUE + obj_flags |= EMAGGED to_chat(user, "You fried the consoles ID checking system.") diff --git a/code/modules/shuttle/emergency.dm b/code/modules/shuttle/emergency.dm index e11a120ba19..669e7e2185d 100644 --- a/code/modules/shuttle/emergency.dm +++ b/code/modules/shuttle/emergency.dm @@ -36,14 +36,14 @@ var/name = ID.registered_name var/job = ID.assignment - if(emagged) + if(obj_flags & EMAGGED) name = Gibberish(name, 0) job = Gibberish(job, 0) A += list(list("name" = name, "job" = job)) data["authorizations"] = A data["enabled"] = (IS_DOCKED && !ENGINES_STARTED) - data["emagged"] = emagged + data["emagged"] = obj_flags & EMAGGED ? 1 : 0 return data /obj/machinery/computer/emergency_shuttle/ui_act(action, params, datum/tgui/ui) @@ -119,16 +119,16 @@ if(SSshuttle.emergency.mode == SHUTTLE_STRANDED) authorized.Cut() - emagged = FALSE + obj_flags &= ~EMAGGED if(ENGINES_STARTED || (!IS_DOCKED)) return . // Check to see if we've reached criteria for early launch - if((authorized.len >= auth_need) || emagged) + if((authorized.len >= auth_need) || (obj_flags & EMAGGED)) // shuttle timers use 1/10th seconds internally SSshuttle.emergency.setTimer(ENGINES_START_TIME) - var/system_error = emagged ? "SYSTEM ERROR:" : null + var/system_error = obj_flags & EMAGGED ? "SYSTEM ERROR:" : null minor_announce("The emergency shuttle will launch in \ [TIME_LEFT] seconds", system_error, alert=TRUE) . = TRUE @@ -138,7 +138,7 @@ if(!IS_DOCKED) return - if(emagged || ENGINES_STARTED) //SYSTEM ERROR: THE SHUTTLE WILL LA-SYSTEM ERROR: THE SHUTTLE WILL LA-SYSTEM ERROR: THE SHUTTLE WILL LAUNCH IN 10 SECONDS + 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, "The shuttle is already about to launch!") return @@ -149,7 +149,7 @@ has emagged the emergency shuttle [time] seconds before launch.", 0, 1) log_game("[key_name(user)] has emagged the emergency shuttle in \ [COORD(src)] [time] seconds before launch.") - emagged = TRUE + obj_flags |= EMAGGED var/datum/species/S = new for(var/i in 1 to 10) // the shuttle system doesn't know who these people are, but they @@ -415,7 +415,7 @@ /obj/docking_port/mobile/pod/request() var/obj/machinery/computer/shuttle/S = getControlConsole() - if(GLOB.security_level == SEC_LEVEL_RED || GLOB.security_level == SEC_LEVEL_DELTA || (S && S.emagged)) + if(GLOB.security_level == SEC_LEVEL_RED || GLOB.security_level == SEC_LEVEL_DELTA || (S && (S.obj_flags & EMAGGED))) if(launch_status == UNLAUNCHED) launch_status = EARLY_LAUNCHED return ..() @@ -446,9 +446,9 @@ return /obj/machinery/computer/shuttle/pod/emag_act(mob/user) - if(emagged) + if(obj_flags & EMAGGED) return - emagged = TRUE + obj_flags |= EMAGGED to_chat(user, "You fry the pod's alert level checking system.") /obj/docking_port/stationary/random diff --git a/code/modules/station_goals/shield.dm b/code/modules/station_goals/shield.dm index 13216826a4f..c9acfebb9c3 100644 --- a/code/modules/station_goals/shield.dm +++ b/code/modules/station_goals/shield.dm @@ -122,7 +122,7 @@ /obj/machinery/satellite/attackby(obj/item/I, mob/user, params) if(istype(I, /obj/item/device/multitool)) - to_chat(user, "// NTSAT-[id] // Mode : [active ? "PRIMARY" : "STANDBY"] //[emagged ? "DEBUG_MODE //" : ""]") + to_chat(user, "// NTSAT-[id] // Mode : [active ? "PRIMARY" : "STANDBY"] //[(obj_flags & EMAGGED) ? "DEBUG_MODE //" : ""]") else return ..() @@ -147,14 +147,14 @@ continue if(get_dist(M,src) > kill_range) continue - if(!emagged && space_los(M)) + if(!(obj_flags & EMAGGED) && space_los(M)) Beam(get_turf(M),icon_state="sat_beam",time=5,maxdistance=kill_range) qdel(M) /obj/machinery/satellite/meteor_shield/toggle(user) if(!..(user)) return FALSE - if(emagged) + if(obj_flags & EMAGGED) if(active) change_meteor_chance(2) else @@ -167,12 +167,12 @@ /obj/machinery/satellite/meteor_shield/Destroy() . = ..() - if(active && emagged) + if(active && (obj_flags & EMAGGED)) change_meteor_chance(0.5) /obj/machinery/satellite/meteor_shield/emag_act() - if(emagged) + if(obj_flags & EMAGGED) return - emagged = TRUE + obj_flags |= EMAGGED if(active) change_meteor_chance(2) diff --git a/html/browser/common.css b/html/browser/common.css index 4b2d05a3dd4..c58877bb69d 100644 --- a/html/browser/common.css +++ b/html/browser/common.css @@ -1,5 +1,5 @@ -body -{ +body +{ padding: 0; margin: 0; background-color: #272727; @@ -14,9 +14,9 @@ hr height: 1px; } -a, a:link, a:visited, a:active, .linkOn, .linkOff -{ - color: #ffffff; +a, button, a:link, a:visited, a:active, .linkOn, .linkOff +{ + color: #ffffff; text-decoration: none; background: #40628a; border: 1px solid #161616; @@ -25,15 +25,15 @@ a, a:link, a:visited, a:active, .linkOn, .linkOff cursor:default; } -a:hover -{ +a:hover +{ color: #40628a; background: #ffffff; } a.white, a.white:link, a.white:visited, a.white:active -{ - color: #40628a; +{ + color: #40628a; text-decoration: none; background: #ffffff; border: 1px solid #161616; @@ -42,22 +42,22 @@ a.white, a.white:link, a.white:visited, a.white:active cursor:default; } -a.white:hover -{ +a.white:hover +{ color: #ffffff; background: #40628a; } .linkOn, a.linkOn:link, a.linkOn:visited, a.linkOn:active, a.linkOn:hover -{ - color: #ffffff; +{ + color: #ffffff; background: #2f943c; border-color: #24722e; } .linkOff, a.linkOff:link, a.linkOff:visited, a.linkOff:active, a.linkOff:hover -{ - color: #ffffff; +{ + color: #ffffff; background: #999999; border-color: #666666; } @@ -89,15 +89,15 @@ li padding: 0 0 2px 0; } -img, a img -{ - border-style:none; +img, a img +{ + border-style:none; } h1, h2, h3, h4, h5, h6 { margin: 0; - padding: 16px 0 8px 0; + padding: 16px 0 8px 0; color: #517087; } @@ -146,7 +146,7 @@ h4 } .uiContent -{ +{ clear: both; padding: 8px; font-family: Verdana, Geneva, sans-serif; @@ -189,7 +189,7 @@ h4 } .notice.icon -{ +{ padding: 2px 4px 0 20px; } @@ -303,4 +303,71 @@ div.notice { width: 100%; clear: both; -} \ No newline at end of file +} + + +.switch { + position: relative; + display: inline-block; + width: 50px; + height: 26px; +} + +.switch input {display:none;} + +.slider { + position: absolute; + cursor: pointer; + top: 0; + left: 0; + right: 0; + bottom: 0; + background-color: #383838; + transition: .4s; +} + +.slider:before { + position: absolute; + content: ""; + height: 18px; + width: 18px; + left: 4px; + bottom: 4px; + background-color: #98B0C3; + transition: .4s; +} + +input:checked + .slider { + background-color: #40628a; +} + +input:focus + .slider { + box-shadow: 0 0 1px #2196F3; +} + +input:checked + .slider:before { + transform: translateX(24px); +} + +.switch span { + display: inline-block; + position: relative; + width: 60px; + margin-left: 60px; +} + +ul.sparse { + padding-bottom:20px; +} + +.sparse li { + margin-top: 2px; +} + +.slider.round { + border-radius: 34px; +} + +.slider.round:before { + border-radius: 50%; +} diff --git a/tgstation.dme b/tgstation.dme index e5b88557de1..7463504c81d 100755 --- a/tgstation.dme +++ b/tgstation.dme @@ -57,6 +57,7 @@ #include "code\__DEFINES\mobs.dm" #include "code\__DEFINES\monkeys.dm" #include "code\__DEFINES\networks.dm" +#include "code\__DEFINES\obj_flags.dm" #include "code\__DEFINES\pinpointers.dm" #include "code\__DEFINES\pipe_construction.dm" #include "code\__DEFINES\preferences.dm"
[C]