mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-29 16:18:01 +01:00
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:
committed by
AnturK
parent
70bec96f9c
commit
6406896df1
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user