Merge remote-tracking branch 'upstream/master' into bombing-logging-and-co

This commit is contained in:
joep van der velden
2020-09-16 15:26:19 +02:00
1825 changed files with 98847 additions and 393967 deletions
-50
View File
@@ -21,11 +21,8 @@
var/state = 0
var/locked = 0
var/frequency = 0
var/id_tag = null
var/projectile_type = /obj/item/projectile/beam/emitter
var/projectile_sound = 'sound/weapons/emitter.ogg'
var/datum/radio_frequency/radio_connection
var/datum/effect_system/spark_spread/sparks
/obj/machinery/power/emitter/Initialize(mapload)
@@ -40,8 +37,6 @@
sparks = new
sparks.attach(src)
sparks.set_up(5, 1, src)
if(frequency)
set_frequency(frequency)
/obj/machinery/power/emitter/RefreshParts()
var/max_firedelay = 120
@@ -59,14 +54,6 @@
power_usage -= 50 * M.rating
active_power_usage = power_usage
//Radio remote control
/obj/machinery/power/emitter/proc/set_frequency(new_frequency)
SSradio.remove_object(src, frequency)
frequency = new_frequency
if(frequency)
radio_connection = SSradio.add_object(src, frequency, RADIO_ATMOSIA)
/obj/machinery/power/emitter/verb/rotate()
set name = "Rotate"
set category = "Object"
@@ -86,44 +73,7 @@
return
rotate()
/obj/machinery/power/emitter/multitool_menu(var/mob/user,var/obj/item/multitool/P)
return {"
<ul>
<li><b>Frequency:</b> <a href="?src=[UID()];set_freq=-1">[format_frequency(frequency)] GHz</a> (<a href="?src=[UID()];set_freq=[ENGINE_FREQ]">Reset</a>)</li>
<li>[format_tag("ID Tag","id_tag","set_id")]</a></li>
</ul>
"}
/obj/machinery/power/emitter/receive_signal(datum/signal/signal)
if(!signal.data["tag"] || (signal.data["tag"] != id_tag))
return 0
var/on=0
switch(signal.data["command"])
if("on")
on=1
if("off")
on=0
if("set")
on = signal.data["state"] > 0
if("toggle")
on = !active
if(anchored && state == 2 && on != active)
active=on
var/statestr=on?"on":"off"
// Spammy message_admins("Emitter turned [statestr] by radio signal ([signal.data["command"]] @ [frequency]) in [formatJumpTo(src)]",0,1)
log_game("Emitter turned [statestr] by radio signal ([signal.data["command"]] @ [frequency]) in ([x], [y], [z]) AAC prints: [jointext(signal.data["hiddenprints"], "")]")
investigate_log("turned <font color='orange'>[statestr]</font> by radio signal ([signal.data["command"]] @ [frequency]) AAC prints: [jointext(signal.data["hiddenprints"], "")]","singulo")
update_icon()
/obj/machinery/power/emitter/Destroy()
if(SSradio)
SSradio.remove_object(src, frequency)
radio_connection = null
msg_admin_attack("Emitter deleted at ([x],[y],[z] - [ADMIN_JMP(src)])", ATKLOG_FEW)
log_game("Emitter deleted at ([x],[y],[z])")
investigate_log("<font color='red'>deleted</font> at ([x],[y],[z])","singulo")
@@ -113,15 +113,15 @@ field_generator power level display
if(!I.tool_use_check(user, 0))
return
if(state == FG_SECURED)
WELDER_ATTEMPT_FLOOR_SLICE_MESSAGE
else if(state == FG_WELDED)
WELDER_ATTEMPT_FLOOR_WELD_MESSAGE
else if(state == FG_WELDED)
WELDER_ATTEMPT_FLOOR_SLICE_MESSAGE
if(I.use_tool(src, user, 20, volume = I.tool_volume))
if(state == FG_SECURED)
WELDER_FLOOR_SLICE_SUCCESS_MESSAGE
WELDER_FLOOR_WELD_SUCCESS_MESSAGE
state = FG_WELDED
else if(state == FG_WELDED)
WELDER_FLOOR_WELD_SUCCESS_MESSAGE
WELDER_FLOOR_SLICE_SUCCESS_MESSAGE
state = FG_SECURED
/obj/machinery/field/generator/emp_act()
@@ -310,15 +310,25 @@ field_generator power level display
//This is here to help fight the "hurr durr, release singulo cos nobody will notice before the
//singulo eats the evidence". It's not fool-proof but better than nothing.
//I want to avoid using global variables.
spawn(1)
var/temp = 1 //stops spam
for(var/obj/singularity/O in GLOB.singularities)
if(O.last_warning && temp)
if((world.time - O.last_warning) > 50) //to stop message-spam
temp = 0
message_admins("A singulo exists and a containment field has failed. Location: [get_area(src)] (<A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[x];Y=[y];Z=[z]'>JMP</A>)",1)
investigate_log("has <font color='red'>failed</font> whilst a singulo exists.","singulo")
O.last_warning = world.time
INVOKE_ASYNC(src, .proc/admin_alert)
/obj/machinery/field/generator/proc/admin_alert()
var/temp = TRUE //stops spam
for(var/thing in GLOB.singularities)
var/obj/singularity/O = thing
if(O.last_warning && temp && atoms_share_level(O, src))
if((world.time - O.last_warning) > 50) //to stop message-spam
temp = FALSE
// To the person who asks "Hey affected, why are you using this massive operator when you can use AREACOORD?" Well, ill tell you
// get_area_name is fucking broken and uses a for(x in world) search
// It doesnt even work, is expensive, and returns 0
// Im not refactoring one thing which could risk breaking all admin location logs
// Fight me
// [src ? "[get_location_name(src, TRUE)] [COORD(src)]" : "nonexistent location"] [ADMIN_JMP(src)] works much better and actually works at all
// Oh and yes, this exact comment was pasted from the exact same thing I did to tcomms code. Dont at me.
message_admins("A singularity exists and a containment field has failed on the same Z-Level. Singulo location: [O ? "[get_location_name(O, TRUE)] [COORD(O)]" : "nonexistent location"] [ADMIN_JMP(O)] | Field generator location: [src ? "[get_location_name(src, TRUE)] [COORD(src)]" : "nonexistent location"] [ADMIN_JMP(src)]")
investigate_log("has <font color='red'>failed</font> whilst a singulo exists.","singulo")
O.last_warning = world.time
/obj/machinery/field/generator/shock_field(mob/living/user)
if(fields.len)
@@ -1,4 +1,4 @@
/area/engine/engineering/power_alert(var/alarming)
if(alarming)
investigate_log("has a power alarm!","singulo")
/area/engine/engineering/poweralert(state, source)
if(state != poweralm)
investigate_log("has a power alarm!", "singulo")
..()
+2 -1
View File
@@ -127,6 +127,8 @@
/obj/singularity/narsie/proc/acquire(var/mob/food)
if(food == target)
return
if(!target)
return
to_chat(target, "<span class='cultlarge'>[uppertext(SSticker.cultdat.entity_name)] HAS LOST INTEREST IN YOU</span>")
target = food
if(ishuman(target))
@@ -139,7 +141,6 @@
grav_pull = 0
/obj/singularity/narsie/wizard/eat()
set background = BACKGROUND_ENABLED
for(var/atom/X in orange(consume_range,src))
if(isturf(X) || istype(X, /atom/movable))
consume(X)
@@ -24,8 +24,10 @@
wires = new(src)
connected_parts = list()
update_icon()
use_log = list()
/obj/machinery/particle_accelerator/control_box/Destroy()
SStgui.close_uis(wires)
if(active)
toggle_power()
QDEL_NULL(wires)
@@ -40,6 +42,11 @@
else if(construction_state == 2) // Wires exposed
wires.Interact(user)
/obj/machinery/particle_accelerator/control_box/multitool_act(mob/living/user, obj/item/I)
if(construction_state == 2) // Wires exposed
wires.Interact(user)
return TRUE
/obj/machinery/particle_accelerator/control_box/update_state()
if(construction_state < 3)
use_power = NO_POWER_USE
@@ -92,18 +99,18 @@
usr.unset_machine()
return
if(href_list["togglep"])
if(!wires.IsIndexCut(PARTICLE_TOGGLE_WIRE))
if(!wires.is_cut(WIRE_PARTICLE_POWER))
toggle_power()
else if(href_list["scan"])
part_scan()
else if(href_list["strengthup"])
if(!wires.IsIndexCut(PARTICLE_STRENGTH_WIRE))
if(!wires.is_cut(WIRE_PARTICLE_STRENGTH))
add_strength()
else if(href_list["strengthdown"])
if(!wires.IsIndexCut(PARTICLE_STRENGTH_WIRE))
if(!wires.is_cut(WIRE_PARTICLE_STRENGTH))
remove_strength()
updateDialog()
@@ -253,7 +253,6 @@
/obj/singularity/proc/eat()
set background = BACKGROUND_ENABLED
for(var/tile in spiral_range_turfs(grav_pull, src))
var/turf/T = tile
if(!T || !isturf(loc))