Replaces a bunch of obj vars (and emagged on machinery/items) with obj_flags (#34078)

* It works, but is it worth it?

* bitfield helpers take 1

* Would this work?

* remove dangling debug code

* rebase & fixes

* vv bitfield stuff, reading

* DNM oceans of shitcode DNM

* honk

* honk2

* plonk

* rebase & fix
This commit is contained in:
vuonojenmustaturska
2018-01-22 20:19:46 +01:00
committed by AnturK
parent 70bec96f9c
commit 6406896df1
110 changed files with 624 additions and 447 deletions
@@ -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,
@@ -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)
+2 -2
View File
@@ -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,
+1 -1
View File
@@ -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)
+2 -2
View File
@@ -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,
+6 -6
View File
@@ -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";
+6 -6
View File
@@ -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,
+12
View File
@@ -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
+1 -1
View File
@@ -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"
+3 -1
View File
@@ -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
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)))
+6 -6
View File
@@ -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
+2 -2
View File
@@ -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, "<span class='warning'>You don't want to harm other living beings!</span>")
return
if(!force)
playsound(loc, 'sound/weapons/tap.ogg', get_clamped_volume(), 1, -1)
else if(hitsound)
+127 -44
View File
@@ -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 += {"</div>"}
..(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 = {"<form><input type="hidden" name="src" value="[REF(src)]"><ul class="sparse">"}
for (var/i in values)
output += {"<li>
<label class="switch">
<input type="[Radio ? "radio" : "checkbox"]" value="1" name="[i["name"]]"[i["checked"] ? " checked" : ""]>
<div class="slider"></div>
<span>[i["name"]]</span>
</label>
</li>"}
output += {"</ul><div style="text-align:center">
<button type="submit" name="button" value="1" style="font-size:large;float:[( Button2 ? "left" : "right" )]">[Button1]</button>"}
if (Button2)
output += {"<button type="submit" name="button" value="2" style="font-size:large;[( Button3 ? "" : "float:right" )]">[Button2]</button>"}
if (Button3)
output += {"<button type="submit" name="button" value="3" style="font-size:large;float:right">[Button3]</button>"}
output += {"</form></div>"}
..(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...
+6 -1
View File
@@ -433,6 +433,12 @@
else
item = "<a href='?_src_=vars;[HrefToken()];Vars=[REF(value)]'>[VV_HTML_ENCODE(name)] = /list ([L.len])</a>"
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)] = <span class='value'>[VV_HTML_ENCODE(value)]</span>"
@@ -1215,4 +1221,3 @@
message_admins(msg)
admin_ticket_log(L, msg)
href_list["datumrefresh"] = href_list["mobToDamage"]
+2 -2
View File
@@ -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)
@@ -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()
. = ..()
@@ -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, "<span class='notice'>All thermal sensors on the station have been disabled. Fire alerts will no longer be recognized.</span>")
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, "<span class='notice'>All air alarm safeties on the station have been overriden. Air alarms may now use the Flood environmental mode.</span>")
owner.playsound_local(owner, 'sound/machines/terminal_off.ogg', 50, 0)
+1 -2
View File
@@ -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)
AM.pixel_y = -8 + (round( . / 3)*8)
+2 -2
View File
@@ -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()
+2 -2
View File
@@ -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)
+7 -7
View File
@@ -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 ? "<font color='#FF0000'>APC does not respond to interface query.</font>" : "<font color='#00FF00'>APC responds to interface query.</font>"]<br><br>"
dat += "<a href='?src=[REF(src)];check_logs=1'>Check Logs</a><br>"
dat += "<a href='?src=[REF(src)];log_out=1'>Log Out</a><br>"
if(emagged)
if(obj_flags & EMAGGED)
dat += "<font color='#FF0000'>WARNING: Logging functionality partially disabled from outside source.</font><br>"
dat += "<a href='?src=[REF(src)];restore_logging=1'>Restore logging functionality?</a><br>"
else
@@ -80,7 +80,7 @@
dat += "[entry]<br>"
else
dat += "<i>No activity has been recorded at this time.</i><br>"
if(emagged)
if(obj_flags & EMAGGED)
dat += "<a href='?src=[REF(src)];clear_logs=1'><font color='#FF0000'>@#%! CLEAR LOGS</a>"
dat += "<a href='?src=[REF(src)];check_apcs=1'>Return</a>"
operator = user
@@ -117,7 +117,7 @@
auth_id = "\[NULL\]"
if(href_list["restore_logging"])
to_chat(usr, "<span class='robot notice'>[icon2html(src, usr)] Logging functionality restored from backup data.</span>")
emagged = FALSE
obj_flags &= ~EMAGGED
LAZYADD(logs, "<b>-=- Logging restored to full functionality at this point -=-</b>")
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("<span class='warning'>You emag [src], disabling precise logging and allowing you to clear logs.</span>")
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, "<b>([worldtime2text()])</b> [op_string] [log_text]")
/mob/proc/using_power_flow_console()
+26 -26
View File
@@ -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 += "<br>You ran out of food and starved."
if(emagged)
if(obj_flags & EMAGGED)
user.nutrition = 0 //yeah you pretty hongry
to_chat(user, "<span class='userdanger'>Your body instantly contracts to that of one who has not eaten in months. Agonizing cramps seize you as you fall to the floor.</span>")
if(fuel <= 0)
dat += "<br>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, "<span class='userdanger'>You feel an immense wave of heat emanate from the arcade machine. Your skin bursts into flames.</span>")
if(emagged)
if(obj_flags & EMAGGED)
to_chat(user, "<span class='userdanger'>You're never going to make it to Orion...</span>")
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, "<span class='notice'>You override the cheat code menu and skip to Cheat #[rand(1, 50)]: Realism Mode.</span>")
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"
@@ -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, "<span class='warning'>[src] lets out a quiet alarm as its login is overriden.</span>")
@@ -297,7 +297,7 @@
// OMG SYNDICATE ...LETTERHEAD
if("MessageSyndicate")
if((authenticated==2) && (emagged))
if((authenticated==2) && (obj_flags & EMAGGED))
if(!checkCCcooldown())
to_chat(usr, "<span class='warning'>Arrays recycling. Please stand by.</span>")
playsound(src, 'sound/machines/terminal_prompt_deny.ogg', 50, 0)
@@ -315,7 +315,7 @@
if("RestoreBackup")
to_chat(usr, "<span class='notice'>Backup routing data restored!</span>")
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, "<span class='danger'>You scramble the communication routing circuits!</span>")
@@ -485,7 +485,7 @@
dat += "<BR>\[ <A HREF='?src=[REF(src)];operation=changeseclevel'>Change Alert Level</A> \]"
dat += "<BR>\[ <A HREF='?src=[REF(src)];operation=emergencyaccess'>Emergency Maintenance Access</A> \]"
dat += "<BR>\[ <A HREF='?src=[REF(src)];operation=nukerequest'>Request Nuclear Authentication Codes</A> \]"
if(!emagged)
if(!(obj_flags & EMAGGED))
dat += "<BR>\[ <A HREF='?src=[REF(src)];operation=MessageCentCom'>Send Message to CentCom</A> \]"
else
dat += "<BR>\[ <A HREF='?src=[REF(src)];operation=MessageSyndicate'>Send Message to \[UNKNOWN\]</A> \]"
@@ -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 += "<div class='statusDisplay'>No launchpad located.</div><BR>"
else
for(var/i in 1 to LAZYLEN(launchpads))
+10 -10
View File
@@ -569,7 +569,7 @@
/obj/machinery/door/airlock/examine(mob/user)
..()
if(emagged)
if(obj_flags & EMAGGED)
to_chat(user, "<span class='warning'>Its access panel is smoking slightly.</span>")
if(charge && !panel_open && in_range(user, src))
to_chat(user, "<span class='warning'>The maintenance panel seems haphazardly fastened.</span>")
@@ -611,7 +611,7 @@
return
else
to_chat(user, "<span class='warning'>Airlock AI control has been blocked with a firewall. Unable to hack.</span>")
if(emagged)
if(obj_flags & EMAGGED)
to_chat(user, "<span class='warning'>Unable to interface: Airlock is unresponsive.</span>")
return
if(detonated)
@@ -899,7 +899,7 @@
if(!panel_open || security_level)
to_chat(user, "<span class='warning'>The maintenance panel must be open to apply [C]!</span>")
return
if(emagged)
if(obj_flags & EMAGGED)
return
if(charge && !detonated)
to_chat(user, "<span class='warning'>There's already a charge hooked up to this door!</span>")
@@ -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.", \
"<span class='notice'>You start to remove electronics from the airlock assembly...</span>")
@@ -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, "<span class='warning'>You discard the damaged electronics.</span>")
else
+3 -3
View File
@@ -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
+5 -5
View File
@@ -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, "<span class='warning'>You discard the damaged electronics.</span>")
qdel(src)
return
@@ -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
#undef CYCLE_INTERIOR
+4 -4
View File
@@ -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("<span class='warning'>Sparks fly out of [src]!</span>",
"<span class='notice'>You emag [src], disabling its thermal sensors.</span>")
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()
+3 -3
View File
@@ -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
stored_items -= user
+3 -3
View File
@@ -165,7 +165,7 @@
dat += "<table style='width:100%' align='center'><tr>"
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 += "<td><A href='?src=[REF(src)];category=[C];menu=[LIMBGROWER_CATEGORY_MENU]'>[C]</A></td>"
@@ -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, "<span class='warning'>A warning flashes onto the screen, stating that safety overrides have been deactivated!</span>")
emagged = TRUE
obj_flags |= EMAGGED
@@ -280,11 +280,11 @@
return ..()
/obj/machinery/porta_turret/emag_act(mob/user)
if(emagged)
if(obj_flags & EMAGGED)
return
to_chat(user, "<span class='warning'>You short out [src]'s threat assessment circuits.</span>")
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, "<span class='notice'>The turret control is unresponsive.</span>")
return
@@ -742,10 +737,10 @@
to_chat(user, "<span class='warning'>Access denied.</span>")
/obj/machinery/turretid/emag_act(mob/user)
if(emagged)
if(obj_flags & EMAGGED)
return
to_chat(user, "<span class='danger'>You short out the turret controls' access analysis module.</span>")
emagged = TRUE
obj_flags |= EMAGGED
locked = FALSE
if(user && user.machine == src)
attack_hand(user)
@@ -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, "<span class='notice'>You short out [parent_turret]'s threat assessment circuits.</span>")
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
+4 -4
View File
@@ -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 ..()
+7 -7
View File
@@ -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
+8 -8
View File
@@ -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, "<span class='notice'>You [locked ? "lock" : "unlock"] the controls.</span>")
else if(emagged)
else if(obj_flags & EMAGGED)
to_chat(user, "<span class='danger'>Error, access controller damaged!</span>")
else
to_chat(user, "<span class='danger'>Access denied.</span>")
@@ -192,10 +192,10 @@
return ..()
/obj/machinery/shieldgen/emag_act(mob/user)
if(emagged)
if(obj_flags & EMAGGED)
to_chat(user, "<span class='warning'>The access controller is damaged!</span>")
return
emagged = TRUE
obj_flags |= EMAGGED
locked = FALSE
playsound(src, "sparks", 100, 1)
to_chat(user, "<span class='warning'>You short out the access controller.</span>")
@@ -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, "<span class='notice'>You [src.locked ? "lock" : "unlock"] the controls.</span>")
else if(emagged)
else if(obj_flags & EMAGGED)
to_chat(user, "<span class='danger'>Error, access controller damaged!</span>")
else
to_chat(user, "<span class='danger'>Access denied.</span>")
@@ -381,10 +381,10 @@
add_fingerprint(user)
/obj/machinery/shieldwallgen/emag_act(mob/user)
if(emagged)
if(obj_flags & EMAGGED)
to_chat(user, "<span class='warning'>The access controller is damaged!</span>")
return
emagged = TRUE
obj_flags |= EMAGGED
locked = FALSE
playsound(src, "sparks", 100, 1)
to_chat(user, "<span class='warning'>You short out the access controller.</span>")
+5 -5
View File
@@ -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
@@ -187,7 +187,7 @@
if(href_list["delete"])
if(!src.allowed(usr) && !emagged)
if(!src.allowed(usr) && !(obj_flags & EMAGGED))
to_chat(usr, "<span class='danger'>ACCESS DENIED.</span>")
return
@@ -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, "<span class='warning'>It is too hot to mess with!</span>")
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 = "<center><font color='blue'[message]</font>/</center>"
@@ -82,7 +82,7 @@
dat += "<h4><dd><A href='?src=[REF(src)];auth=1'>&#09;<font color='red'>\[Unauthenticated\]</font></a>&#09;/"
dat += " Server Power: <u>[src.linkedServer && src.linkedServer.toggled ? "<font color='green'>\[On\]</font>":"<font color='red'>\[Off\]</font>"]</u></h4>"
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"
+5 -5
View File
@@ -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, "<span class='warning'>[src]'s chef compartment blinks red: Access denied.</span>")
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, "<span class='notice'>You short out the product lock on [src].</span>")
/obj/machinery/vending/attack_ai(mob/user)
@@ -455,7 +455,7 @@
to_chat(usr, "<span class='notice'>The vending machine cannot dispense products while its service panel is open!</span>")
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, "<span class='warning'>Access denied.</span>" )
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
#undef COIN_CHARGE
+2 -2
View File
@@ -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)
+1 -1
View File
@@ -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
+2 -2
View File
@@ -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
+3 -3
View File
@@ -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, "<span class='warning'>You short out [src]'s reagent safety checker!</span>")
else
to_chat(user, "<span class='warning'>You reset [src]'s reagent safety checker!</span>")
@@ -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)
+5 -5
View File
@@ -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, "<span class='notice'>You decrease the voltage of [src].</span>")
add_overlay("vapeopen_low")
if(screw && emagged)
if(screw && (obj_flags & EMAGGED))
to_chat(user, "<span class='notice'>[src] can't be modified!</span>")
/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, "<span class='warning'>You maximize the voltage of [src].</span>")
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()
@@ -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, "<span class='notice'>Receiver spectrum set to [contraband ? "Broad" : "Standard"].</span>")
else
to_chat(user, "<span class='notice'>The spectrum chip is unresponsive.</span>")
/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, "<span class='notice'>You adjust [src]'s routing and receiver spectrum, unlocking special supplies and contraband.</span>")
/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, "<span class='notice'>Routing protocols are already set to: \"factory defaults\".</span>")
else
else
to_chat(user, "<span class='notice'>You reset the routing protocols to: \"factory defaults\".</span>")
emagged = FALSE
obj_flags &= ~EMAGGED
/obj/item/circuitboard/computer/cargo/express/emag_act(mob/living/user)
to_chat(user, "<span class='notice'>You change the routing protocols, allowing the Drop Pod to land anywhere on the station.</span>")
emagged = TRUE
obj_flags |= EMAGGED
/obj/item/circuitboard/computer/cargo/request
name = "Supply Request Console (Computer Board)"
@@ -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, "<span class='info'>Alt-click it to clear stored radiation levels.</span>")
if(emagged)
if(obj_flags & EMAGGED)
to_chat(user, "<span class='warning'>The display seems to be incomprehensible.</span>")
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("<span class='notice'>[user] scans [M] with [src].</span>", "<span class='notice'>You scan [M]'s radiation levels with [src]...</span>")
addtimer(CALLBACK(src, .proc/scan, M, user), 20, TIMER_UNIQUE) // Let's not have spamming GetAllContents
else
@@ -164,7 +164,7 @@
to_chat(user, "<span class='notice'>[icon2html(src, user)] Subject is free of radioactive contamination.</span>")
/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, "<span class='warning'>Turn off [src] before you perform this action!</span>")
return 0
@@ -174,7 +174,7 @@
return 0
user.visible_message("<span class='notice'>[user] refastens [src]'s maintenance panel!</span>", "<span class='notice'>You reset [src] to its factory settings!</span>")
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, "<span class='warning'>Turn off [src] before you perform this action!</span>")
return 0
to_chat(user, "<span class='warning'>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.</span>")
emagged = TRUE
obj_flags |= EMAGGED
#undef RAD_LEVEL_NORMAL
#undef RAD_LEVEL_MODERATE
+1 -1
View File
@@ -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
@@ -149,7 +149,7 @@
to_chat(user, "<span class='notice'>You fill \the [src] with lights from \the [S]. " + status_string() + "</span>")
/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)
+2 -2
View File
@@ -19,10 +19,10 @@
return voicespan
/obj/item/device/megaphone/emag_act(mob/user)
if(emagged)
if(obj_flags & EMAGGED)
return
to_chat(user, "<span class='warning'>You overload \the [src]'s voice synthesizer.</span>")
emagged = TRUE
obj_flags |= EMAGGED
voicespan = list(SPAN_REALLYBIG, "userdanger")
/obj/item/device/megaphone/sec
+1 -1
View File
@@ -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)
+1 -1
View File
@@ -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
+3 -3
View File
@@ -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, "<font color='red'>You short out the safeties on [src]!</font>")
else
to_chat(user, "<font color='red'>You reset the safeties on [src]!</font>")
/obj/item/device/harmalarm/attack_self(mob/user)
var/safety = !emagged
var/safety = !(obj_flags & EMAGGED)
if(cooldown > world.time)
to_chat(user, "<font color='red'>The device is still recharging!</font>")
return
+2 -2
View File
@@ -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)
+28 -23
View File
@@ -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, "<span class='notice'>Use a pen on it to rename it or change its description.</span>")
if(unique_reskin && !current_skin)
to_chat(user, "<span class='notice'>Alt-click it to reskin it.</span>")
+3 -3
View File
@@ -83,7 +83,7 @@
to_chat(user, "<span class='notice'>You close the maintenance panel.</span>")
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, "<span class='warning'>Sign has been damaged beyond repair!</span>")
return
else if(!broken)
@@ -118,7 +118,7 @@
if(broken || emagged)
to_chat(user, "<span class='warning'>Nothing interesting happens!</span>")
return
emagged = TRUE
obj_flags |= EMAGGED
to_chat(user, "<span class='notice'>You emag the barsign. Takeover in progress...</span>")
sleep(10 SECONDS)
set_sign(new /datum/barsign/hiddensigns/syndibarsign)
+1 -2
View File
@@ -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
+14 -6
View File
@@ -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 <b>[uppertext(default)]</b>.")
@@ -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)
+1 -1
View File
@@ -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
@@ -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("<span class='warning'>Sparks fly out of [src]!</span>", "<span class='notice'>You emag [src], disabling its safeties.</span>")
playsound(src, "sparks", 50, 1)
@@ -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
@@ -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)
+13 -7
View File
@@ -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("<span class='warning'>[user] swipes a suspicious card through [src]!</span>",
"<span class='notice'>You adjust [src]'s routing and receiver spectrum, unlocking special supplies and contraband.</span>")
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*"
+1 -1
View File
@@ -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, "<span class='notice'>Scanned [O], value: <b>[price]</b> credits[O.contents.len ? " (contents included)" : ""].</span>")
+10 -10
View File
@@ -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, "<span class='notice'>You [locked ? "lock" : "unlock"] the interface.</span>")
/obj/machinery/computer/cargo/express/emag_act(mob/living/user)
if(emagged)
if(obj_flags & EMAGGED)
return
user.visible_message("<span class='warning'>[user] swipes a suspicious card through [src]!</span>",
"<span class='notice'>You change the routing protocols, allowing the Drop Pod to land anywhere on the station.</span>")
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)
+4 -4
View File
@@ -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, "<span class='warning'>PZZTTPFFFT</span>")
desc = "[desc] The display is flickering slightly."
@@ -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
@@ -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()
@@ -15,7 +15,6 @@
bitesize = 4
w_class = WEIGHT_CLASS_SMALL
volume = 80
unique_rename = 1
var/ingMax = 12
var/list/ingredients = list()
+1 -1
View File
@@ -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
+10 -10
View File
@@ -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, "<span class='warning'>You vastly increase projector power and override the safety and security protocols.</span>")
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
+1 -1
View File
@@ -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
+1 -1
View File
@@ -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()
. = ..()
+1 -1
View File
@@ -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
+4 -4
View File
@@ -214,7 +214,7 @@ GLOBAL_LIST(cachedbooks) // List of our cached book datums
dat += "<A href='?src=[REF(src)];switchscreen=5'>5. Upload New Title to Archive</A><BR>"
dat += "<A href='?src=[REF(src)];switchscreen=6'>6. Upload Scanned Title to Newscaster</A><BR>"
dat += "<A href='?src=[REF(src)];switchscreen=7'>7. Print Corporate Materials</A><BR>"
if(src.emagged)
if(obj_flags & EMAGGED)
dat += "<A href='?src=[REF(src)];switchscreen=8'>8. Access the Forbidden Lore Vault</A><BR>"
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"])
@@ -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, "<span class='notice'>No permission to dock could be granted.</span>")
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, "<span class='notice'>Shuttle received message and will be sent shortly.</span>")
/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, "<span class='warning'>PZZTTPFFFT</span>")
+6 -6
View File
@@ -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"
@@ -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)
@@ -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, "<span class='warning'>\The [src] was already emagged.</span>")
return 0
else
emagged = TRUE
obj_flags |= EMAGGED
to_chat(user, "<span class='notice'>You emag \the [src]. It's screen briefly shows a \"OVERRIDE ACCEPTED: New software downloads available.\" message.</span>")
return 1
@@ -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))
@@ -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("<font face=\"[computer.emagged ? CRAYON_FONT : PRINTER_FONT]\">" + prepare_printjob(F.stored_data) + "</font>", open_file))
if(!printer.print_text("<font face=\"[(computer.obj_flags & EMAGGED) ? CRAYON_FONT : PRINTER_FONT]\">" + prepare_printjob(F.stored_data) + "</font>", open_file))
error = "Hardware error: Printer was unable to print the file. It may be out of paper."
return 1
if("PRG_copytousb")
@@ -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
+2 -2
View File
@@ -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()
+1 -1
View File
@@ -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))
+8 -8
View File
@@ -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 @@
"<span class='italics'>You hear a crack.</span>")
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]!",\
"<span class='notice'>You discarded shorten board.</span>")
@@ -479,7 +479,7 @@
to_chat(user, "<span class='warning'>There is nothing to secure!</span>")
return
update_icon()
else if(emagged)
else if(obj_flags & EMAGGED)
to_chat(user, "<span class='warning'>The interface is broken!</span>")
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, "<span class='warning'>The interface is broken!</span>")
else if(opened)
to_chat(user, "<span class='warning'>You must close the cover to swipe an ID card!</span>")
@@ -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, "<span class='warning'>You must close the cover to swipe an ID card!</span>")
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, "<span class='notice'>You emag the APC interface.</span>")
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
+1 -1
View File
@@ -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
+3 -3
View File
@@ -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")
+1 -1
View File
@@ -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
+3 -3
View File
@@ -273,7 +273,7 @@
return
if(W.GetID())
if(emagged)
if(obj_flags & EMAGGED)
to_chat(user, "<span class='warning'>The lock seems to be broken!</span>")
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].","<span class='notice'>You short out the lock.</span>")
@@ -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.
+1 -1
View File
@@ -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
+5 -5
View File
@@ -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
+1 -2
View File
@@ -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)
@@ -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
@@ -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
@@ -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
+2 -2
View File
@@ -37,9 +37,9 @@
to_chat(user, "<span class ='notice'>This firearm already has a firing pin installed.</span>")
/obj/item/device/firing_pin/emag_act(mob/user)
if(emagged)
if(obj_flags & EMAGGED)
return
emagged = TRUE
obj_flags |= EMAGGED
to_chat(user, "<span class='notice'>You override the authentication mechanism.</span>")
/obj/item/device/firing_pin/proc/gun_insert(mob/living/user, obj/item/gun/G)
@@ -82,12 +82,12 @@
use_power(2500)
/obj/machinery/chem_dispenser/emag_act(mob/user)
if(emagged)
if(obj_flags & EMAGGED)
to_chat(user, "<span class='warning'>[src] has no functional safeties to emag.</span>")
return
to_chat(user, "<span class='notice'>You short out [src]'s safeties.</span>")
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)
-1
View File
@@ -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
+1 -1
View File
@@ -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

Some files were not shown because too many files have changed in this diff Show More