April sync (#360)
* Maps and things no code/icons * helpers defines globalvars * Onclick world.dm orphaned_procs * subsystems Round vote and shuttle autocall done here too * datums * Game folder * Admin - chatter modules * clothing - mining * modular computers - zambies * client * mob level 1 * mob stage 2 + simple_animal * silicons n brains * mob stage 3 + Alien/Monkey * human mobs * icons updated * some sounds * emitter y u no commit * update tgstation.dme * compile fixes * travis fixes Also removes Fast digest mode, because reasons. * tweaks for travis Mentors are broke again Also fixes Sizeray guns * oxygen loss fix for vore code. * removes unused code * some code updates * bulk fixes * further fixes * outside things * whoops. * Maint bar ported * GLOBs.
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
//like orange but only checks north/south/east/west for one step
|
||||
/proc/cardinalrange(var/center)
|
||||
var/list/things = list()
|
||||
for(var/direction in cardinal)
|
||||
for(var/direction in GLOB.cardinal)
|
||||
var/turf/T = get_step(center, direction)
|
||||
if(!T) continue
|
||||
things += T.contents
|
||||
@@ -52,7 +52,7 @@
|
||||
break
|
||||
|
||||
if(!control_unit)//No other guys nearby look for a control unit
|
||||
for(var/direction in cardinal)
|
||||
for(var/direction in GLOB.cardinal)
|
||||
for(var/obj/machinery/power/am_control_unit/AMC in cardinalrange(src))
|
||||
if(AMC.add_shielding(src))
|
||||
break
|
||||
@@ -110,7 +110,7 @@
|
||||
dirs = 0
|
||||
coredirs = 0
|
||||
cut_overlays()
|
||||
for(var/direction in alldirs)
|
||||
for(var/direction in GLOB.alldirs)
|
||||
var/turf/T = get_step(loc, direction)
|
||||
for(var/obj/machinery/machine in T)
|
||||
if(istype(machine, /obj/machinery/am_shielding))
|
||||
@@ -118,11 +118,11 @@
|
||||
if(shield.control_unit == control_unit)
|
||||
if(shield.processing)
|
||||
coredirs |= direction
|
||||
if(direction in cardinal)
|
||||
if(direction in GLOB.cardinal)
|
||||
dirs |= direction
|
||||
|
||||
else
|
||||
if(istype(machine, /obj/machinery/power/am_control_unit) && (direction in cardinal))
|
||||
if(istype(machine, /obj/machinery/power/am_control_unit) && (direction in GLOB.cardinal))
|
||||
var/obj/machinery/power/am_control_unit/control = machine
|
||||
if(control == control_unit)
|
||||
dirs |= direction
|
||||
@@ -175,7 +175,7 @@
|
||||
|
||||
//Scans cards for shields or the control unit and if all there it
|
||||
/obj/machinery/am_shielding/proc/core_check()
|
||||
for(var/direction in alldirs)
|
||||
for(var/direction in GLOB.alldirs)
|
||||
var/found_am_device=0
|
||||
for(var/obj/machinery/machine in get_step(loc, direction))
|
||||
//var/machine = locate(/obj/machinery, get_step(loc, direction))
|
||||
@@ -191,8 +191,8 @@
|
||||
|
||||
/obj/machinery/am_shielding/proc/setup_core()
|
||||
processing = 1
|
||||
machines |= src
|
||||
START_PROCESSING(SSmachine, src)
|
||||
GLOB.machines |= src
|
||||
START_PROCESSING(SSmachines, src)
|
||||
if(!control_unit)
|
||||
return
|
||||
control_unit.linked_cores.Add(src)
|
||||
|
||||
+41
-28
@@ -52,6 +52,8 @@
|
||||
max_integrity = 200
|
||||
integrity_failure = 50
|
||||
resistance_flags = FIRE_PROOF
|
||||
|
||||
var/lon_range = 1.5
|
||||
var/area/area
|
||||
var/areastring = null
|
||||
var/obj/item/weapon/stock_parts/cell/cell
|
||||
@@ -109,11 +111,11 @@
|
||||
|
||||
/obj/machinery/power/apc/New(turf/loc, var/ndir, var/building=0)
|
||||
if (!req_access)
|
||||
req_access = list(access_engine_equip)
|
||||
req_access = list(GLOB.access_engine_equip)
|
||||
if (!armor)
|
||||
armor = list(melee = 20, bullet = 20, laser = 10, energy = 100, bomb = 30, bio = 100, rad = 100, fire = 90, acid = 50)
|
||||
..()
|
||||
apcs_list += src
|
||||
GLOB.apcs_list += src
|
||||
|
||||
wires = new /datum/wires/apc(src)
|
||||
// offset 24 pixels in direction of dir
|
||||
@@ -138,7 +140,7 @@
|
||||
addtimer(CALLBACK(src, .proc/update), 5)
|
||||
|
||||
/obj/machinery/power/apc/Destroy()
|
||||
apcs_list -= src
|
||||
GLOB.apcs_list -= src
|
||||
|
||||
if(malfai && operating)
|
||||
malfai.malf_picker.processing_time = Clamp(malfai.malf_picker.processing_time - 10,0,1000)
|
||||
@@ -160,7 +162,6 @@
|
||||
if(A == cell)
|
||||
cell = null
|
||||
update_icon()
|
||||
update_icon()
|
||||
updateUsrDialog()
|
||||
|
||||
/obj/machinery/power/apc/proc/make_terminal()
|
||||
@@ -290,6 +291,21 @@
|
||||
O += status_overlays_environ[environ+1]
|
||||
add_overlay(O)
|
||||
|
||||
// And now, seperately for cleanness, the lighting changing
|
||||
if(update_state & UPSTATE_ALLGOOD)
|
||||
switch(charging)
|
||||
if(0)
|
||||
light_color = LIGHT_COLOR_RED
|
||||
if(1)
|
||||
light_color = LIGHT_COLOR_BLUE
|
||||
if(2)
|
||||
light_color = LIGHT_COLOR_GREEN
|
||||
set_light(lon_range)
|
||||
else if(update_state & UPSTATE_BLUESCREEN)
|
||||
light_color = LIGHT_COLOR_BLUE
|
||||
set_light(lon_range)
|
||||
else
|
||||
set_light(0)
|
||||
|
||||
/obj/machinery/power/apc/proc/check_updates()
|
||||
|
||||
@@ -388,7 +404,7 @@
|
||||
"<span class='notice'>You break the charred power control board and remove the remains.</span>",
|
||||
"<span class='italics'>You hear a crack.</span>")
|
||||
return
|
||||
//ticker.mode:apcs-- //XSI said no and I agreed. -rastaf0
|
||||
//SSticker.mode:apcs-- //XSI said no and I agreed. -rastaf0
|
||||
else if (emagged) // We emag board, not APC's frame
|
||||
emagged = 0
|
||||
user.visible_message(\
|
||||
@@ -661,7 +677,7 @@
|
||||
..()
|
||||
|
||||
/obj/machinery/power/apc/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = 0, \
|
||||
datum/tgui/master_ui = null, datum/ui_state/state = default_state)
|
||||
datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state)
|
||||
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
|
||||
|
||||
if(!ui)
|
||||
@@ -742,15 +758,10 @@
|
||||
area.power_light = (lighting > 1)
|
||||
area.power_equip = (equipment > 1)
|
||||
area.power_environ = (environ > 1)
|
||||
// if (area.name == "AI Chamber")
|
||||
// spawn(10)
|
||||
// to_chat(world, " [area.name] [area.power_equip]")
|
||||
else
|
||||
area.power_light = 0
|
||||
area.power_equip = 0
|
||||
area.power_environ = 0
|
||||
// if (area.name == "AI Chamber")
|
||||
// to_chat(world, "[area.power_equip]")
|
||||
area.power_change()
|
||||
|
||||
/obj/machinery/power/apc/proc/can_use(mob/user, loud = 0) //used by attack_hand() and Topic()
|
||||
@@ -893,7 +904,7 @@
|
||||
occupier.loc = src.loc
|
||||
occupier.death()
|
||||
occupier.gib()
|
||||
for(var/obj/item/weapon/pinpointer/P in pinpointer_list)
|
||||
for(var/obj/item/weapon/pinpointer/P in GLOB.pinpointer_list)
|
||||
P.switch_mode_to(TRACK_NUKE_DISK) //Pinpointers go back to tracking the nuke disk
|
||||
P.nuke_warning = FALSE
|
||||
|
||||
@@ -1019,18 +1030,18 @@
|
||||
|
||||
if(cell && !shorted)
|
||||
// draw power from cell as before to power the area
|
||||
var/cellused = min(cell.charge, CELLRATE * lastused_total) // clamp deduction to a max, amount left in cell
|
||||
var/cellused = min(cell.charge, GLOB.CELLRATE * lastused_total) // clamp deduction to a max, amount left in cell
|
||||
cell.use(cellused)
|
||||
|
||||
if(excess > lastused_total) // if power excess recharge the cell
|
||||
// by the same amount just used
|
||||
cell.give(cellused)
|
||||
add_load(cellused/CELLRATE) // add the load used to recharge the cell
|
||||
add_load(cellused/GLOB.CELLRATE) // add the load used to recharge the cell
|
||||
|
||||
|
||||
else // no excess, and not enough per-apc
|
||||
if((cell.charge/CELLRATE + excess) >= lastused_total) // can we draw enough from cell+grid to cover last usage?
|
||||
cell.charge = min(cell.maxcharge, cell.charge + CELLRATE * excess) //recharge with what we can
|
||||
if((cell.charge/GLOB.CELLRATE + excess) >= lastused_total) // can we draw enough from cell+grid to cover last usage?
|
||||
cell.charge = min(cell.maxcharge, cell.charge + GLOB.CELLRATE * excess) //recharge with what we can
|
||||
add_load(excess) // so draw what we can from the grid
|
||||
charging = 0
|
||||
|
||||
@@ -1078,8 +1089,8 @@
|
||||
if(chargemode && charging == 1 && operating)
|
||||
if(excess > 0) // check to make sure we have enough to charge
|
||||
// Max charge is capped to % per second constant
|
||||
var/ch = min(excess*CELLRATE, cell.maxcharge*CHARGELEVEL)
|
||||
add_load(ch/CELLRATE) // Removes the power we're taking from the grid
|
||||
var/ch = min(excess*GLOB.CELLRATE, cell.maxcharge*GLOB.CHARGELEVEL)
|
||||
add_load(ch/GLOB.CELLRATE) // Removes the power we're taking from the grid
|
||||
cell.give(ch) // actually recharge the cell
|
||||
|
||||
else
|
||||
@@ -1093,7 +1104,7 @@
|
||||
|
||||
if(chargemode)
|
||||
if(!charging)
|
||||
if(excess > cell.maxcharge*CHARGELEVEL)
|
||||
if(excess > cell.maxcharge*GLOB.CHARGELEVEL)
|
||||
chargecount++
|
||||
else
|
||||
chargecount = 0
|
||||
@@ -1196,14 +1207,16 @@
|
||||
if(/* !get_connection() || */ !operating || shorted)
|
||||
return
|
||||
if( cell && cell.charge>=20)
|
||||
cell.use(20);
|
||||
spawn(0)
|
||||
for(var/area/A in area.related)
|
||||
for(var/obj/machinery/light/L in A)
|
||||
L.on = TRUE
|
||||
L.break_light_tube()
|
||||
L.on = FALSE
|
||||
stoplag()
|
||||
cell.use(20)
|
||||
INVOKE_ASYNC(src, .proc/break_lights)
|
||||
|
||||
/obj/machinery/power/apc/proc/break_lights()
|
||||
for(var/area/A in area.related)
|
||||
for(var/obj/machinery/light/L in A)
|
||||
L.on = TRUE
|
||||
L.break_light_tube()
|
||||
L.on = FALSE
|
||||
stoplag()
|
||||
|
||||
/obj/machinery/power/apc/proc/shock(mob/user, prb)
|
||||
if(!prob(prb))
|
||||
@@ -1231,7 +1244,7 @@
|
||||
for(var/obj/machinery/M in area.contents)
|
||||
if(M.critical_machine)
|
||||
return
|
||||
for(var/A in ai_list)
|
||||
for(var/A in GLOB.ai_list)
|
||||
var/mob/living/silicon/ai/I = A
|
||||
if(get_area(I) == area)
|
||||
return
|
||||
|
||||
@@ -80,7 +80,7 @@ By design, d1 is the smallest direction and d2 is the highest
|
||||
var/turf/T = src.loc // hide if turf is not intact
|
||||
|
||||
if(level==1) hide(T.intact)
|
||||
cable_list += src //add it to the global cable list
|
||||
GLOB.cable_list += src //add it to the global cable list
|
||||
|
||||
if(d1)
|
||||
stored = new/obj/item/stack/cable_coil(null,2,cable_color)
|
||||
@@ -90,7 +90,7 @@ By design, d1 is the smallest direction and d2 is the highest
|
||||
/obj/structure/cable/Destroy() // called when a cable is deleted
|
||||
if(powernet)
|
||||
cut_cable_from_powernet() // update the powernets
|
||||
cable_list -= src //remove it from global cable list
|
||||
GLOB.cable_list -= src //remove it from global cable list
|
||||
return ..() // then go ahead and delete the cable
|
||||
|
||||
/obj/structure/cable/deconstruct(disassembled = TRUE)
|
||||
@@ -437,9 +437,7 @@ By design, d1 is the smallest direction and d2 is the highest
|
||||
// Definitions
|
||||
////////////////////////////////
|
||||
|
||||
var/global/list/datum/stack_recipe/cable_coil_recipes = list ( \
|
||||
new/datum/stack_recipe("cable restraints", /obj/item/weapon/restraints/handcuffs/cable, 15), \
|
||||
)
|
||||
GLOBAL_LIST_INIT(cable_coil_recipes, list (new/datum/stack_recipe("cable restraints", /obj/item/weapon/restraints/handcuffs/cable, 15)))
|
||||
|
||||
/obj/item/stack/cable_coil
|
||||
name = "cable coil"
|
||||
@@ -479,15 +477,16 @@ var/global/list/datum/stack_recipe/cable_coil_recipes = list ( \
|
||||
user.visible_message("<span class='suicide'>[user] is strangling [user.p_them()]self with [src]! It looks like [user.p_theyre()] trying to commit suicide!</span>")
|
||||
return(OXYLOSS)
|
||||
|
||||
/obj/item/stack/cable_coil/New(loc, amount = MAXCOIL, var/param_color = null)
|
||||
/obj/item/stack/cable_coil/New(loc, new_amount = null, var/param_color = null)
|
||||
..()
|
||||
src.amount = amount
|
||||
if(new_amount) // MAXCOIL by default
|
||||
amount = new_amount
|
||||
if(param_color)
|
||||
item_color = param_color
|
||||
pixel_x = rand(-2,2)
|
||||
pixel_y = rand(-2,2)
|
||||
update_icon()
|
||||
recipes = cable_coil_recipes
|
||||
recipes = GLOB.cable_coil_recipes
|
||||
|
||||
///////////////////////////////////
|
||||
// General procedures
|
||||
|
||||
@@ -0,0 +1,107 @@
|
||||
|
||||
/obj/structure/floodlight_frame
|
||||
name = "floodlight frame"
|
||||
desc = "A bare metal frame looking vaguely like a floodlight. Requires wrenching down."
|
||||
max_integrity = 100
|
||||
obj_integrity = 100
|
||||
icon = 'icons/obj/lighting.dmi'
|
||||
icon_state = "floodlight_c1"
|
||||
density = TRUE
|
||||
var/state = FLOODLIGHT_NEEDS_WRENCHING
|
||||
|
||||
/obj/structure/floodlight_frame/attackby(obj/item/O, mob/user, params)
|
||||
if(istype(O, /obj/item/weapon/wrench) && (state == FLOODLIGHT_NEEDS_WRENCHING))
|
||||
to_chat(user, "<span class='notice'>You secure the [src].</span>")
|
||||
anchored = TRUE
|
||||
state = FLOODLIGHT_NEEDS_WIRES
|
||||
desc = "A bare metal frame looking vaguely like a floodlight. Requires wiring."
|
||||
else if(istype(O, /obj/item/stack/cable_coil) && (state == FLOODLIGHT_NEEDS_WIRES))
|
||||
var/obj/item/stack/S = O
|
||||
if(S.use(5))
|
||||
to_chat(user, "<span class='notice'>You wire the [src].</span>")
|
||||
name = "wired [name]"
|
||||
desc = "A bare metal frame looking vaguely like a floodlight. Requires securing with a screwdriver."
|
||||
icon_state = "floodlight_c2"
|
||||
state = FLOODLIGHT_NEEDS_SECURING
|
||||
else if(istype(O, /obj/item/weapon/light/tube) && (state == FLOODLIGHT_NEEDS_LIGHTS))
|
||||
if(user.transferItemToLoc(O))
|
||||
to_chat(user, "<span class='notice'>You put lights in the [src].</span>")
|
||||
new /obj/machinery/power/floodlight(src.loc)
|
||||
qdel(src)
|
||||
else if(istype(O, /obj/item/weapon/screwdriver) && (state == FLOODLIGHT_NEEDS_SECURING))
|
||||
to_chat(user, "<span class='notice'>You fasten the wiring and electronics in [src].</span>")
|
||||
name = "secured [name]"
|
||||
desc = "A bare metal frame that looks like a floodlight. Requires light tubes."
|
||||
icon_state = "floodlight_c3"
|
||||
state = FLOODLIGHT_NEEDS_LIGHTS
|
||||
else
|
||||
..()
|
||||
|
||||
/obj/machinery/power/floodlight
|
||||
name = "floodlight"
|
||||
desc = "A pole with powerful mounted lights on it. Due to its high power draw, it must be powered by a direct connection to a wire node."
|
||||
icon = 'icons/obj/lighting.dmi'
|
||||
icon_state = "floodlight"
|
||||
anchored = TRUE
|
||||
density = TRUE
|
||||
idle_power_usage = 100
|
||||
active_power_usage = 1000
|
||||
var/list/light_setting_list = list(0, 5, 10, 15)
|
||||
var/light_power_coefficient = 300
|
||||
var/setting = 1
|
||||
light_power = 1.75
|
||||
|
||||
/obj/machinery/power/floodlight/process()
|
||||
if(avail(active_power_usage))
|
||||
add_load(active_power_usage)
|
||||
else
|
||||
change_setting(1)
|
||||
|
||||
/obj/machinery/power/floodlight/proc/change_setting(val, mob/user)
|
||||
if((val < 1) || (val > light_setting_list.len))
|
||||
return
|
||||
active_power_usage = light_setting_list[val]
|
||||
if(!avail(active_power_usage))
|
||||
return change_setting(val - 1)
|
||||
setting = val
|
||||
set_light(light_setting_list[val])
|
||||
var/setting_text = ""
|
||||
if(val > 1)
|
||||
icon_state = "[initial(icon_state)]_on"
|
||||
else
|
||||
icon_state = initial(icon_state)
|
||||
switch(val)
|
||||
if(1)
|
||||
setting_text = "OFF"
|
||||
if(2)
|
||||
setting_text = "low power"
|
||||
if(3)
|
||||
setting_text = "standard lighting"
|
||||
if(4)
|
||||
setting_text = "high power"
|
||||
if(user)
|
||||
to_chat(user, "You set the [src] to [setting_text].")
|
||||
|
||||
/obj/machinery/power/floodlight/attackby(obj/item/O, mob/user, params)
|
||||
if(istype(O, /obj/item/weapon/wrench))
|
||||
default_unfasten_wrench(user, O, time = 20)
|
||||
change_setting(1)
|
||||
if(anchored)
|
||||
connect_to_network()
|
||||
else
|
||||
disconnect_from_network()
|
||||
else
|
||||
. = ..()
|
||||
|
||||
/obj/machinery/power/floodlight/attack_hand(mob/user)
|
||||
var/current = setting
|
||||
if(current == 1)
|
||||
current = light_setting_list.len
|
||||
else
|
||||
current--
|
||||
change_setting(current, user)
|
||||
..()
|
||||
|
||||
/obj/machinery/power/floodlight/attack_ai(mob/user)
|
||||
attack_hand(user)
|
||||
..()
|
||||
@@ -3,16 +3,16 @@
|
||||
// Gravity Generator
|
||||
//
|
||||
|
||||
var/list/gravity_generators = list() // We will keep track of this by adding new gravity generators to the list, and keying it with the z level.
|
||||
GLOBAL_LIST_EMPTY(gravity_generators) // We will keep track of this by adding new gravity generators to the list, and keying it with the z level.
|
||||
|
||||
var/const/POWER_IDLE = 0
|
||||
var/const/POWER_UP = 1
|
||||
var/const/POWER_DOWN = 2
|
||||
#define POWER_IDLE 0
|
||||
#define POWER_UP 1
|
||||
#define POWER_DOWN 2
|
||||
|
||||
var/const/GRAV_NEEDS_SCREWDRIVER = 0
|
||||
var/const/GRAV_NEEDS_WELDING = 1
|
||||
var/const/GRAV_NEEDS_PLASTEEL = 2
|
||||
var/const/GRAV_NEEDS_WRENCH = 3
|
||||
#define GRAV_NEEDS_SCREWDRIVER 0
|
||||
#define GRAV_NEEDS_WELDING 1
|
||||
#define GRAV_NEEDS_PLASTEEL 2
|
||||
#define GRAV_NEEDS_WRENCH 3
|
||||
|
||||
//
|
||||
// Abstract Generator
|
||||
@@ -304,7 +304,7 @@ var/const/GRAV_NEEDS_WRENCH = 3
|
||||
// Sound the alert if gravity was just enabled or disabled.
|
||||
var/alert = 0
|
||||
var/area/area = get_area(src)
|
||||
if(on && ticker && ticker.current_state == GAME_STATE_PLAYING) // If we turned on and the game is live.
|
||||
if(on && SSticker && SSticker.current_state == GAME_STATE_PLAYING) // If we turned on and the game is live.
|
||||
if(gravity_in_level() == 0)
|
||||
alert = 1
|
||||
investigate_log("was brought online and is now producing gravity for this level.", "gravity")
|
||||
@@ -371,7 +371,7 @@ var/const/GRAV_NEEDS_WRENCH = 3
|
||||
// Shake everyone on the z level to let them know that gravity was enagaged/disenagaged.
|
||||
/obj/machinery/gravity_generator/main/proc/shake_everyone()
|
||||
var/turf/T = get_turf(src)
|
||||
for(var/mob/M in mob_list)
|
||||
for(var/mob/M in GLOB.mob_list)
|
||||
if(M.z != z)
|
||||
continue
|
||||
M.update_gravity(M.mob_has_gravity())
|
||||
@@ -383,19 +383,19 @@ var/const/GRAV_NEEDS_WRENCH = 3
|
||||
var/turf/T = get_turf(src)
|
||||
if(!T)
|
||||
return 0
|
||||
if(gravity_generators["[T.z]"])
|
||||
return length(gravity_generators["[T.z]"])
|
||||
if(GLOB.gravity_generators["[T.z]"])
|
||||
return length(GLOB.gravity_generators["[T.z]"])
|
||||
return 0
|
||||
|
||||
/obj/machinery/gravity_generator/main/proc/update_list()
|
||||
var/turf/T = get_turf(src.loc)
|
||||
if(T)
|
||||
if(!gravity_generators["[T.z]"])
|
||||
gravity_generators["[T.z]"] = list()
|
||||
if(!GLOB.gravity_generators["[T.z]"])
|
||||
GLOB.gravity_generators["[T.z]"] = list()
|
||||
if(on)
|
||||
gravity_generators["[T.z]"] |= src
|
||||
GLOB.gravity_generators["[T.z]"] |= src
|
||||
else
|
||||
gravity_generators["[T.z]"] -= src
|
||||
GLOB.gravity_generators["[T.z]"] -= src
|
||||
|
||||
// Misc
|
||||
|
||||
|
||||
@@ -500,6 +500,7 @@
|
||||
|
||||
status = LIGHT_EMPTY
|
||||
update()
|
||||
return L
|
||||
|
||||
/obj/machinery/light/attack_tk(mob/user)
|
||||
if(status == LIGHT_EMPTY)
|
||||
@@ -508,7 +509,8 @@
|
||||
|
||||
to_chat(user, "<span class='notice'>You telekinetically remove the light [fitting].</span>")
|
||||
// create a light tube/bulb item and put it in the user's hand
|
||||
drop_light_tube()
|
||||
var/obj/item/weapon/light/L = drop_light_tube()
|
||||
L.attack_tk(user)
|
||||
|
||||
|
||||
// break the light and make sparks if was on
|
||||
|
||||
@@ -51,7 +51,7 @@
|
||||
demand.Cut(1, 2)
|
||||
|
||||
/obj/machinery/computer/monitor/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = 0, \
|
||||
datum/tgui/master_ui = null, datum/ui_state/state = default_state)
|
||||
datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state)
|
||||
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
|
||||
if(!ui)
|
||||
ui = new(user, src, ui_key, "power_monitor", name, 1200, 1000, master_ui, state)
|
||||
|
||||
@@ -139,7 +139,7 @@
|
||||
var/cdir
|
||||
var/turf/T
|
||||
|
||||
for(var/card in cardinal)
|
||||
for(var/card in GLOB.cardinal)
|
||||
T = get_step(loc,card)
|
||||
cdir = get_dir(T,loc)
|
||||
|
||||
@@ -159,7 +159,7 @@
|
||||
var/cdir
|
||||
var/turf/T
|
||||
|
||||
for(var/card in cardinal)
|
||||
for(var/card in GLOB.cardinal)
|
||||
T = get_step(loc,card)
|
||||
cdir = get_dir(T,loc)
|
||||
|
||||
@@ -337,9 +337,9 @@
|
||||
var/drained_energy = drained_hp*20
|
||||
|
||||
if (source_area)
|
||||
source_area.use_power(drained_energy/CELLRATE)
|
||||
source_area.use_power(drained_energy/GLOB.CELLRATE)
|
||||
else if (istype(power_source,/datum/powernet))
|
||||
var/drained_power = drained_energy/CELLRATE //convert from "joules" to "watts"
|
||||
var/drained_power = drained_energy/GLOB.CELLRATE //convert from "joules" to "watts"
|
||||
PN.load+=drained_power
|
||||
else if (istype(power_source, /obj/item/weapon/stock_parts/cell))
|
||||
cell.use(drained_energy)
|
||||
@@ -361,6 +361,6 @@
|
||||
return null
|
||||
|
||||
/area/proc/get_apc()
|
||||
for(var/obj/machinery/power/apc/APC in apcs_list)
|
||||
for(var/obj/machinery/power/apc/APC in GLOB.apcs_list)
|
||||
if(APC.area == src)
|
||||
return APC
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
var/netexcess = 0 // excess power on the powernet (typically avail-load)///////
|
||||
|
||||
/datum/powernet/New()
|
||||
SSmachine.powernets += src
|
||||
SSmachines.powernets += src
|
||||
|
||||
/datum/powernet/Destroy()
|
||||
//Go away references, you suck!
|
||||
@@ -26,7 +26,7 @@
|
||||
nodes -= M
|
||||
M.powernet = null
|
||||
|
||||
SSmachine.powernets -= src
|
||||
SSmachines.powernets -= src
|
||||
return ..()
|
||||
|
||||
/datum/powernet/proc/is_empty()
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
|
||||
var/global/list/rad_collectors = list()
|
||||
GLOBAL_LIST_EMPTY(rad_collectors)
|
||||
|
||||
/obj/machinery/power/rad_collector
|
||||
name = "Radiation Collector Array"
|
||||
@@ -8,7 +8,7 @@ var/global/list/rad_collectors = list()
|
||||
icon_state = "ca"
|
||||
anchored = 0
|
||||
density = 1
|
||||
req_access = list(access_engine_equip)
|
||||
req_access = list(GLOB.access_engine_equip)
|
||||
// use_power = 0
|
||||
obj_integrity = 350
|
||||
max_integrity = 350
|
||||
@@ -21,10 +21,10 @@ var/global/list/rad_collectors = list()
|
||||
|
||||
/obj/machinery/power/rad_collector/New()
|
||||
..()
|
||||
rad_collectors += src
|
||||
GLOB.rad_collectors += src
|
||||
|
||||
/obj/machinery/power/rad_collector/Destroy()
|
||||
rad_collectors -= src
|
||||
GLOB.rad_collectors -= src
|
||||
return ..()
|
||||
|
||||
/obj/machinery/power/rad_collector/process()
|
||||
@@ -46,7 +46,9 @@ var/global/list/rad_collectors = list()
|
||||
toggle_power()
|
||||
user.visible_message("[user.name] turns the [src.name] [active? "on":"off"].", \
|
||||
"<span class='notice'>You turn the [src.name] [active? "on":"off"].</span>")
|
||||
investigate_log("turned [active?"<font color='green'>on</font>":"<font color='red'>off</font>"] by [user.key]. [loaded_tank?"Fuel: [round(loaded_tank.air_contents.gases["plasma"][MOLES]/0.29)]%":"<font color='red'>It is empty</font>"].","singulo")
|
||||
var/fuel = loaded_tank.air_contents.gases["plasma"]
|
||||
fuel = fuel ? fuel[MOLES] : 0
|
||||
investigate_log("turned [active?"<font color='green'>on</font>":"<font color='red'>off</font>"] by [user.key]. [loaded_tank?"Fuel: [round(fuel/0.29)]%":"<font color='red'>It is empty</font>"].","singulo")
|
||||
return
|
||||
else
|
||||
to_chat(user, "<span class='warning'>The controls are locked!</span>")
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
var/icon_state_on = "emitter_+a"
|
||||
anchored = 0
|
||||
density = 1
|
||||
req_access = list(access_engine_equip)
|
||||
req_access = list(GLOB.access_engine_equip)
|
||||
|
||||
use_power = 0
|
||||
idle_power_usage = 10
|
||||
@@ -88,7 +88,7 @@
|
||||
connect_to_network()
|
||||
|
||||
/obj/machinery/power/emitter/Destroy()
|
||||
if(ticker && ticker.current_state == GAME_STATE_PLAYING)
|
||||
if(SSticker && SSticker.current_state == GAME_STATE_PLAYING)
|
||||
message_admins("Emitter deleted at ([x],[y],[z] - <A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[x];Y=[y];Z=[z]'>JMP</a>)",0,1)
|
||||
log_game("Emitter deleted at ([x],[y],[z])")
|
||||
investigate_log("<font color='red'>deleted</font> at ([x],[y],[z]) at [get_area(src)]","singulo")
|
||||
|
||||
@@ -319,7 +319,7 @@ field_generator power level display
|
||||
//I want to avoid using global variables.
|
||||
spawn(1)
|
||||
var/temp = 1 //stops spam
|
||||
for(var/obj/singularity/O in singularities)
|
||||
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
|
||||
|
||||
@@ -91,13 +91,13 @@
|
||||
/obj/singularity/narsie/proc/pickcultist() //Narsie rewards her cultists with being devoured first, then picks a ghost to follow.
|
||||
var/list/cultists = list()
|
||||
var/list/noncultists = list()
|
||||
for(var/obj/structure/destructible/clockwork/massive/ratvar/enemy in poi_list) //Prioritize killing Ratvar
|
||||
for(var/obj/structure/destructible/clockwork/massive/ratvar/enemy in GLOB.poi_list) //Prioritize killing Ratvar
|
||||
if(enemy.z != z)
|
||||
continue
|
||||
acquire(enemy)
|
||||
return
|
||||
|
||||
for(var/mob/living/carbon/food in living_mob_list) //we don't care about constructs or cult-Ians or whatever. cult-monkeys are fair game i guess
|
||||
for(var/mob/living/carbon/food in GLOB.living_mob_list) //we don't care about constructs or cult-Ians or whatever. cult-monkeys are fair game i guess
|
||||
var/turf/pos = get_turf(food)
|
||||
if(pos.z != src.z)
|
||||
continue
|
||||
@@ -116,7 +116,7 @@
|
||||
return
|
||||
|
||||
//no living humans, follow a ghost instead.
|
||||
for(var/mob/dead/observer/ghost in player_list)
|
||||
for(var/mob/dead/observer/ghost in GLOB.player_list)
|
||||
if(!ghost.client)
|
||||
continue
|
||||
var/turf/pos = get_turf(ghost)
|
||||
|
||||
@@ -27,6 +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
|
||||
dangerous_possession = TRUE
|
||||
|
||||
/obj/singularity/New(loc, var/starting_energy = 50, var/temp = 0)
|
||||
//CARN: admin-alert for chuckle-fuckery.
|
||||
@@ -35,9 +36,9 @@
|
||||
src.energy = starting_energy
|
||||
..()
|
||||
START_PROCESSING(SSobj, src)
|
||||
poi_list |= src
|
||||
singularities |= src
|
||||
for(var/obj/machinery/power/singularity_beacon/singubeacon in machines)
|
||||
GLOB.poi_list |= src
|
||||
GLOB.singularities |= src
|
||||
for(var/obj/machinery/power/singularity_beacon/singubeacon in GLOB.machines)
|
||||
if(singubeacon.active)
|
||||
target = singubeacon
|
||||
break
|
||||
@@ -45,8 +46,8 @@
|
||||
|
||||
/obj/singularity/Destroy()
|
||||
STOP_PROCESSING(SSobj, src)
|
||||
poi_list.Remove(src)
|
||||
singularities.Remove(src)
|
||||
GLOB.poi_list.Remove(src)
|
||||
GLOB.singularities.Remove(src)
|
||||
return ..()
|
||||
|
||||
/obj/singularity/Move(atom/newloc, direct)
|
||||
@@ -286,7 +287,7 @@
|
||||
if(!move_self)
|
||||
return 0
|
||||
|
||||
var/movement_dir = pick(alldirs - last_failed_movement)
|
||||
var/movement_dir = pick(GLOB.alldirs - last_failed_movement)
|
||||
|
||||
if(force_move)
|
||||
movement_dir = force_move
|
||||
@@ -430,7 +431,7 @@
|
||||
|
||||
|
||||
/obj/singularity/proc/pulse()
|
||||
for(var/obj/machinery/power/rad_collector/R in rad_collectors)
|
||||
for(var/obj/machinery/power/rad_collector/R in GLOB.rad_collectors)
|
||||
if(R.z == z && get_dist(R, src) <= 15) // Better than using orange() every process
|
||||
R.receive_pulse(energy)
|
||||
|
||||
|
||||
@@ -53,7 +53,7 @@
|
||||
|
||||
spawn(5)
|
||||
dir_loop:
|
||||
for(var/d in cardinal)
|
||||
for(var/d in GLOB.cardinal)
|
||||
var/turf/T = get_step(src, d)
|
||||
for(var/obj/machinery/power/terminal/term in T)
|
||||
if(term && term.dir == turn(d, 180))
|
||||
@@ -196,7 +196,7 @@
|
||||
cell.charge = (charge / capacity) * cell.maxcharge
|
||||
|
||||
/obj/machinery/power/smes/Destroy()
|
||||
if(ticker && ticker.current_state == GAME_STATE_PLAYING)
|
||||
if(SSticker && SSticker.current_state == GAME_STATE_PLAYING)
|
||||
var/area/area = get_area(src)
|
||||
message_admins("SMES deleted at (<A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[x];Y=[y];Z=[z]'>[area.name]</a>)")
|
||||
log_game("SMES deleted at ([area.name])")
|
||||
@@ -261,7 +261,7 @@
|
||||
|
||||
|
||||
/obj/machinery/power/smes/proc/chargedisplay()
|
||||
return round(5.5*charge/capacity)
|
||||
return Clamp(round(5.5*charge/capacity),0,5)
|
||||
|
||||
/obj/machinery/power/smes/process()
|
||||
if(stat & BROKEN)
|
||||
@@ -354,7 +354,7 @@
|
||||
terminal.powernet.load += amount
|
||||
|
||||
/obj/machinery/power/smes/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = 0, \
|
||||
datum/tgui/master_ui = null, datum/ui_state/state = default_state)
|
||||
datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state)
|
||||
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
|
||||
if(!ui)
|
||||
ui = new(user, src, ui_key, "smes", name, 340, 440, master_ui, state)
|
||||
|
||||
@@ -348,7 +348,7 @@
|
||||
add_overlay(image('icons/obj/computer.dmi', "solcon-o", FLY_LAYER, angle2dir(currentdir)))
|
||||
|
||||
/obj/machinery/power/solar_control/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = 0, \
|
||||
datum/tgui/master_ui = null, datum/ui_state/state = default_state)
|
||||
datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state)
|
||||
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
|
||||
if(!ui)
|
||||
ui = new(user, src, ui_key, "solar_control", name, 500, 400, master_ui, state)
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
#define N2O_HEAT_RESISTANCE 6 //Higher == Gas makes the crystal more resistant against heat damage.
|
||||
|
||||
#define POWERLOSS_INHIBITION_GAS_THRESHOLD 0.20 //Higher == Higher percentage of inhibitor gas needed before the charge inertia chain reaction effect starts.
|
||||
#define POWERLOSS_INHIBITION_MOLE_THRESHOLD 100 //Higher == More moles of the gas are needed before the charge inertia chain reaction effect starts. //Scales powerloss inhibition down until this amount of moles is reached
|
||||
#define POWERLOSS_INHIBITION_MOLE_THRESHOLD 20 //Higher == More moles of the gas are needed before the charge inertia chain reaction effect starts. //Scales powerloss inhibition down until this amount of moles is reached
|
||||
#define POWERLOSS_INHIBITION_MOLE_BOOST_THRESHOLD 500 //bonus powerloss inhibition boost if this amount of moles is reached
|
||||
|
||||
#define MOLE_PENALTY_THRESHOLD 1800 //Higher == Shard can absorb more moles before triggering the high mole penalties.
|
||||
@@ -39,10 +39,18 @@
|
||||
#define DETONATION_HALLUCINATION 600
|
||||
|
||||
|
||||
#define WARNING_DELAY 30
|
||||
#define WARNING_DELAY 60
|
||||
|
||||
#define HALLUCINATION_RANGE(P) (min(7, round(P ** 0.25)))
|
||||
|
||||
|
||||
#define GRAVITATIONAL_ANOMALY "gravitational_anomaly"
|
||||
#define FLUX_ANOMALY "flux_anomaly"
|
||||
#define PYRO_ANOMALY "pyro_anomaly"
|
||||
|
||||
#define SPEAK(message) radio.talk_into(src, message, null, get_spans(), get_default_language())
|
||||
|
||||
|
||||
/obj/machinery/power/supermatter_shard
|
||||
name = "supermatter shard"
|
||||
desc = "A strangely translucent and iridescent crystal that looks like it used to be part of a larger structure."
|
||||
@@ -64,7 +72,8 @@
|
||||
var/safe_alert = "Crystalline hyperstructure returning to safe operating levels."
|
||||
var/warning_point = 50
|
||||
var/warning_alert = "Danger! Crystal hyperstructure instability!"
|
||||
var/emergency_point = 500
|
||||
var/damage_penalty_point = 550
|
||||
var/emergency_point = 700
|
||||
var/emergency_alert = "CRYSTAL DELAMINATION IMMINENT."
|
||||
var/explosion_point = 900
|
||||
|
||||
@@ -122,7 +131,7 @@
|
||||
. = ..()
|
||||
countdown = new(src)
|
||||
countdown.start()
|
||||
poi_list |= src
|
||||
GLOB.poi_list |= src
|
||||
radio = new(src)
|
||||
radio.listening = 0
|
||||
investigate_log("has been created.", "supermatter")
|
||||
@@ -130,13 +139,9 @@
|
||||
|
||||
/obj/machinery/power/supermatter_shard/Destroy()
|
||||
investigate_log("has been destroyed.", "supermatter")
|
||||
if(radio)
|
||||
qdel(radio)
|
||||
radio = null
|
||||
poi_list -= src
|
||||
if(countdown)
|
||||
qdel(countdown)
|
||||
countdown = null
|
||||
QDEL_NULL(radio)
|
||||
GLOB.poi_list -= src
|
||||
QDEL_NULL(countdown)
|
||||
. = ..()
|
||||
|
||||
/obj/machinery/power/supermatter_shard/examine(mob/user)
|
||||
@@ -157,7 +162,7 @@
|
||||
|
||||
/obj/machinery/power/supermatter_shard/proc/explode()
|
||||
var/turf/T = get_turf(src)
|
||||
for(var/mob/M in mob_list)
|
||||
for(var/mob/M in GLOB.mob_list)
|
||||
if(M.z == z)
|
||||
M << 'sound/magic/Charge.ogg'
|
||||
to_chat(M, "<span class='boldannounce'>You feel reality distort for a moment...</span>")
|
||||
@@ -230,7 +235,7 @@
|
||||
n2comp = max(removed.gases["n2"][MOLES]/combined_gas, 0)
|
||||
freoncomp = max(removed.gases["freon"][MOLES]/combined_gas, 0)
|
||||
|
||||
gasmix_power_ratio = min(max(plasmacomp + o2comp + co2comp - n2ocomp - n2comp - freoncomp, 0), 1)
|
||||
gasmix_power_ratio = min(max(plasmacomp + o2comp + co2comp - n2comp - freoncomp, 0), 1)
|
||||
|
||||
dynamic_heat_modifier = max((plasmacomp * PLASMA_HEAT_PENALTY)+(o2comp * OXYGEN_HEAT_PENALTY)+(co2comp * CO2_HEAT_PENALTY)+(n2comp * NITROGEN_HEAT_MODIFIER), 0.5)
|
||||
dynamic_heat_resistance = max(n2ocomp * N2O_HEAT_RESISTANCE, 1)
|
||||
@@ -245,7 +250,7 @@
|
||||
if (combined_gas > POWERLOSS_INHIBITION_MOLE_THRESHOLD && co2comp > POWERLOSS_INHIBITION_GAS_THRESHOLD)
|
||||
powerloss_dynamic_scaling = Clamp(powerloss_dynamic_scaling + Clamp(co2comp - powerloss_dynamic_scaling, -0.02, 0.02), 0, 1)
|
||||
else
|
||||
powerloss_dynamic_scaling = Clamp(powerloss_dynamic_scaling - 0.10,0, 1)
|
||||
powerloss_dynamic_scaling = Clamp(powerloss_dynamic_scaling - 0.05,0, 1)
|
||||
powerloss_inhibitor = Clamp(1-(powerloss_dynamic_scaling * Clamp(combined_gas/POWERLOSS_INHIBITION_MOLE_BOOST_THRESHOLD,1 ,1.5)),0 ,1)
|
||||
|
||||
if(matter_power)
|
||||
@@ -302,23 +307,28 @@
|
||||
var/rads = (power / 10) * sqrt( 1 / max(get_dist(l, src),1) )
|
||||
l.rad_act(rads)
|
||||
|
||||
if(power > POWER_PENALTY_THRESHOLD)
|
||||
playsound(src.loc, 'sound/weapons/emitter2.ogg', 100, 1, extrarange = 10)
|
||||
supermatter_zap(src, 5, min(power*2, 20000))
|
||||
supermatter_zap(src, 5, min(power*2, 20000))
|
||||
if(power > SEVERE_POWER_PENALTY_THRESHOLD)
|
||||
supermatter_zap(src, 5, min(power*2, 20000))
|
||||
if(power > CRITICAL_POWER_PENALTY_THRESHOLD)
|
||||
supermatter_zap(src, 5, min(power*2, 20000))
|
||||
if(power > POWER_PENALTY_THRESHOLD || damage > damage_penalty_point)
|
||||
|
||||
if(prob(15))
|
||||
if(power > POWER_PENALTY_THRESHOLD)
|
||||
playsound(src.loc, 'sound/weapons/emitter2.ogg', 100, 1, extrarange = 10)
|
||||
supermatter_zap(src, 5, min(power*2, 20000))
|
||||
supermatter_zap(src, 5, min(power*2, 20000))
|
||||
if(power > SEVERE_POWER_PENALTY_THRESHOLD)
|
||||
supermatter_zap(src, 5, min(power*2, 20000))
|
||||
if(power > CRITICAL_POWER_PENALTY_THRESHOLD)
|
||||
supermatter_zap(src, 5, min(power*2, 20000))
|
||||
else if (damage > damage_penalty_point && prob(20))
|
||||
playsound(src.loc, 'sound/weapons/emitter2.ogg', 100, 1, extrarange = 10)
|
||||
supermatter_zap(src, 5, Clamp(power*2, 4000, 20000))
|
||||
|
||||
if(prob(15) && power > POWER_PENALTY_THRESHOLD)
|
||||
supermatter_pull(src, power/750)
|
||||
if(prob(5))
|
||||
supermatter_anomaly_gen(src, 1, rand(5, 10))
|
||||
if(power > SEVERE_POWER_PENALTY_THRESHOLD && prob(5) || prob(2))
|
||||
supermatter_anomaly_gen(src, 2, rand(5, 10))
|
||||
if(power > SEVERE_POWER_PENALTY_THRESHOLD && prob(2) || prob(0.3))
|
||||
supermatter_anomaly_gen(src, 3, rand(5, 10))
|
||||
supermatter_anomaly_gen(src, FLUX_ANOMALY, rand(5, 10))
|
||||
if(power > SEVERE_POWER_PENALTY_THRESHOLD && prob(5) || prob(1))
|
||||
supermatter_anomaly_gen(src, GRAVITATIONAL_ANOMALY, rand(5, 10))
|
||||
if(power > SEVERE_POWER_PENALTY_THRESHOLD && prob(2) || prob(0.3) && power > POWER_PENALTY_THRESHOLD)
|
||||
supermatter_anomaly_gen(src, PYRO_ANOMALY, rand(5, 10))
|
||||
|
||||
|
||||
|
||||
@@ -327,31 +337,30 @@
|
||||
var/stability = num2text(round((damage / explosion_point) * 100))
|
||||
|
||||
if(damage > emergency_point)
|
||||
|
||||
radio.talk_into(src, "[emergency_alert] Instability: [stability]%")
|
||||
SPEAK("[emergency_alert] Instability: [stability]%")
|
||||
lastwarning = REALTIMEOFDAY
|
||||
if(!has_reached_emergency)
|
||||
investigate_log("has reached the emergency point for the first time.", "supermatter")
|
||||
message_admins("[src] has reached the emergency point <A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[x];Y=[y];Z=[z]'>(JMP)</a>.")
|
||||
has_reached_emergency = 1
|
||||
else if(damage >= damage_archived) // The damage is still going up
|
||||
radio.talk_into(src, "[warning_alert] Instability: [stability]%")
|
||||
SPEAK("[warning_alert] Instability: [stability]%")
|
||||
lastwarning = REALTIMEOFDAY - (WARNING_DELAY * 5)
|
||||
|
||||
else // Phew, we're safe
|
||||
radio.talk_into(src, "[safe_alert] Instability: [stability]%")
|
||||
SPEAK("[safe_alert] Instability: [stability]%")
|
||||
lastwarning = REALTIMEOFDAY
|
||||
|
||||
if(power > POWER_PENALTY_THRESHOLD)
|
||||
radio.talk_into(src, "Warning: Hyperstructure has reached dangerous power level.")
|
||||
SPEAK("Warning: Hyperstructure has reached dangerous power level.")
|
||||
if(powerloss_inhibitor < 0.5)
|
||||
radio.talk_into(src, "DANGER: CHARGE INERTIA CHAIN REACTION IN PROGRESS.")
|
||||
SPEAK("DANGER: CHARGE INERTIA CHAIN REACTION IN PROGRESS.")
|
||||
|
||||
if(combined_gas > MOLE_PENALTY_THRESHOLD)
|
||||
radio.talk_into(src, "Warning: Critical coolant mass reached.")
|
||||
SPEAK("Warning: Critical coolant mass reached.")
|
||||
|
||||
if(damage > explosion_point)
|
||||
for(var/mob in living_mob_list)
|
||||
for(var/mob in GLOB.living_mob_list)
|
||||
var/mob/living/L = mob
|
||||
if(istype(L) && L.z == z)
|
||||
if(ishuman(mob))
|
||||
@@ -390,7 +399,7 @@
|
||||
investigate_log("Supermatter shard consumed by singularity.","singulo")
|
||||
message_admins("Singularity has consumed a supermatter shard and can now become stage six.")
|
||||
visible_message("<span class='userdanger'>[src] is consumed by the singularity!</span>")
|
||||
for(var/mob/M in mob_list)
|
||||
for(var/mob/M in GLOB.mob_list)
|
||||
if(M.z == z)
|
||||
M << 'sound/effects/supermatter.ogg' //everyone goan know bout this
|
||||
to_chat(M, "<span class='boldannounce'>A horrible screeching fills your ears, and a wave of dread washes over you...</span>")
|
||||
@@ -410,6 +419,13 @@
|
||||
"<span class='italics'>You hear a loud crack as you are washed with a wave of heat.</span>")
|
||||
Consume(B)
|
||||
|
||||
/obj/machinery/power/supermatter_shard/attack_tk(mob/user)
|
||||
if(iscarbon(user))
|
||||
var/mob/living/carbon/C = user
|
||||
to_chat(C, "<span class='userdanger'>That was a really dumb idea.</span>")
|
||||
var/obj/item/bodypart/head/rip_u = C.get_bodypart("head")
|
||||
rip_u.dismember(BURN) //nice try jedi
|
||||
|
||||
/obj/machinery/power/supermatter_shard/attack_paw(mob/user)
|
||||
return attack_hand(user)
|
||||
|
||||
@@ -435,7 +451,7 @@
|
||||
Consume(user)
|
||||
|
||||
/obj/machinery/power/supermatter_shard/proc/transfer_energy()
|
||||
for(var/obj/machinery/power/rad_collector/R in rad_collectors)
|
||||
for(var/obj/machinery/power/rad_collector/R in GLOB.rad_collectors)
|
||||
if(R.z == z && get_dist(R, src) <= 15) //Better than using orange() every process
|
||||
R.receive_pulse(power * (1 + power_transmission_bonus)/10 * freon_transmit_modifier)
|
||||
|
||||
@@ -475,6 +491,8 @@
|
||||
investigate_log("has consumed [key_name(user)].", "supermatter")
|
||||
user.dust()
|
||||
matter_power += 200
|
||||
else if(istype(AM, /obj/singularity))
|
||||
return
|
||||
else if(isobj(AM) && !istype(AM, /obj/effect))
|
||||
investigate_log("has consumed [AM].", "supermatter")
|
||||
qdel(AM)
|
||||
@@ -520,23 +538,17 @@
|
||||
step_towards(pulled_object,center)
|
||||
step_towards(pulled_object,center)
|
||||
|
||||
return
|
||||
|
||||
/obj/machinery/power/supermatter_shard/proc/supermatter_anomaly_gen(turf/anomalycenter, type = 1, anomalyrange = 5)
|
||||
/obj/machinery/power/supermatter_shard/proc/supermatter_anomaly_gen(turf/anomalycenter, type = FLUX_ANOMALY, anomalyrange = 5)
|
||||
var/turf/L = pick(orange(anomalyrange, anomalycenter))
|
||||
if(L)
|
||||
if(type == 1)
|
||||
var/obj/effect/anomaly/flux/A = new(L)
|
||||
A.explosive = 0
|
||||
A.lifespan = 300
|
||||
else if(type == 2)
|
||||
var/obj/effect/anomaly/grav/A = new(L)
|
||||
A.lifespan = 250
|
||||
else if(type == 3)
|
||||
var/obj/effect/anomaly/pyro/A = new(L)
|
||||
A.lifespan = 200
|
||||
|
||||
return
|
||||
switch(type)
|
||||
if(FLUX_ANOMALY)
|
||||
var/obj/effect/anomaly/flux/A = new(L, 300)
|
||||
A.explosive = FALSE
|
||||
if(GRAVITATIONAL_ANOMALY)
|
||||
new /obj/effect/anomaly/grav(L, 250)
|
||||
if(PYRO_ANOMALY)
|
||||
new /obj/effect/anomaly/pyro(L, 200)
|
||||
|
||||
/obj/machinery/power/supermatter_shard/proc/supermatter_zap(atom/zapstart, range = 3, power)
|
||||
. = zapstart.dir
|
||||
@@ -607,3 +619,6 @@
|
||||
supermatter_zap(target_structure, 5, power / 1.5)
|
||||
|
||||
#undef HALLUCINATION_RANGE
|
||||
#undef GRAVITATIONAL_ANOMALY
|
||||
#undef FLUX_ANOMALY
|
||||
#undef PYRO_ANOMALY
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#define TESLA_DEFAULT_POWER 1738260
|
||||
#define TESLA_MINI_POWER 869130
|
||||
|
||||
var/list/blacklisted_tesla_types = typecacheof(list(/obj/machinery/atmospherics,
|
||||
GLOBAL_LIST_INIT(blacklisted_tesla_types, typecacheof(list(/obj/machinery/atmospherics,
|
||||
/obj/machinery/power/emitter,
|
||||
/obj/machinery/field/generator,
|
||||
/mob/living/simple_animal,
|
||||
@@ -18,7 +18,7 @@ var/list/blacklisted_tesla_types = typecacheof(list(/obj/machinery/atmospherics,
|
||||
/obj/machinery/gateway,
|
||||
/obj/structure/lattice,
|
||||
/obj/structure/grille,
|
||||
/obj/machinery/the_singularitygen/tesla))
|
||||
/obj/machinery/the_singularitygen/tesla)))
|
||||
/obj/singularity/energy_ball
|
||||
name = "energy ball"
|
||||
desc = "An energy ball."
|
||||
@@ -85,7 +85,7 @@ var/list/blacklisted_tesla_types = typecacheof(list(/obj/machinery/atmospherics,
|
||||
//we face the last thing we zapped, so this lets us favor that direction a bit
|
||||
var/first_move = dir
|
||||
for(var/i in 0 to move_amount)
|
||||
var/move_dir = pick(alldirs + first_move) //give the first move direction a bit of favoring.
|
||||
var/move_dir = pick(GLOB.alldirs + first_move) //give the first move direction a bit of favoring.
|
||||
if(target && prob(60))
|
||||
move_dir = get_dir(src,target)
|
||||
var/turf/T = get_step(src, move_dir)
|
||||
@@ -137,7 +137,7 @@ var/list/blacklisted_tesla_types = typecacheof(list(/obj/machinery/atmospherics,
|
||||
/obj/singularity/energy_ball/orbit(obj/singularity/energy_ball/target)
|
||||
if (istype(target))
|
||||
target.orbiting_balls += src
|
||||
poi_list -= src
|
||||
GLOB.poi_list -= src
|
||||
target.dissipate_strength = target.orbiting_balls.len
|
||||
|
||||
. = ..()
|
||||
@@ -197,7 +197,7 @@ var/list/blacklisted_tesla_types = typecacheof(list(/obj/machinery/atmospherics,
|
||||
closest_atom = A
|
||||
closest_dist = dist
|
||||
|
||||
else if(closest_grounding_rod || is_type_in_typecache(A, blacklisted_tesla_types))
|
||||
else if(closest_grounding_rod || is_type_in_typecache(A, GLOB.blacklisted_tesla_types))
|
||||
continue
|
||||
|
||||
else if(isliving(A))
|
||||
@@ -244,7 +244,7 @@ var/list/blacklisted_tesla_types = typecacheof(list(/obj/machinery/atmospherics,
|
||||
//Alright, we've done our loop, now lets see if was anything interesting in range
|
||||
if(closest_atom)
|
||||
//common stuff
|
||||
source.Beam(closest_atom, icon_state="lightning[rand(1,12)]", time=5)
|
||||
source.Beam(closest_atom, icon_state="lightning[rand(1,12)]", time=5, maxdistance = INFINITY)
|
||||
var/zapdir = get_dir(source, closest_atom)
|
||||
if(zapdir)
|
||||
. = zapdir
|
||||
|
||||
Reference in New Issue
Block a user