mirror of
https://github.com/CHOMPstation/CHOMPstation.git
synced 2026-07-20 11:32:51 +01:00
Merge branch 'dev' of https://github.com/Baystation12/Baystation12 into newmalf-merge
This commit is contained in:
@@ -20,13 +20,13 @@
|
||||
if(1.0)
|
||||
explosion(get_turf(src), 1, 2, 3, 5)//Should likely be larger but this works fine for now I guess
|
||||
if(src)
|
||||
del(src)
|
||||
qdel(src)
|
||||
return
|
||||
if(2.0)
|
||||
if(prob((fuel/10)-stability))
|
||||
explosion(get_turf(src), 1, 2, 3, 5)
|
||||
if(src)
|
||||
del(src)
|
||||
qdel(src)
|
||||
return
|
||||
stability -= 40
|
||||
if(3.0)
|
||||
|
||||
@@ -35,16 +35,16 @@
|
||||
linked_cores = list()
|
||||
|
||||
|
||||
/obj/machinery/power/am_control_unit/Del()//Perhaps damage and run stability checks rather than just del on the others
|
||||
/obj/machinery/power/am_control_unit/Destroy()//Perhaps damage and run stability checks rather than just qdel on the others
|
||||
for(var/obj/machinery/am_shielding/AMS in linked_shielding)
|
||||
del(AMS)
|
||||
qdel(AMS)
|
||||
..()
|
||||
|
||||
|
||||
/obj/machinery/power/am_control_unit/process()
|
||||
if(exploding)
|
||||
explosion(get_turf(src),8,12,18,12)
|
||||
if(src) del(src)
|
||||
if(src) qdel(src)
|
||||
|
||||
if(update_shield_icons && !shield_icon_delay)
|
||||
check_shield_icons()
|
||||
@@ -108,7 +108,7 @@
|
||||
AMS.blob_act()
|
||||
spawn(0)
|
||||
//Likely explode
|
||||
del(src)
|
||||
qdel(src)
|
||||
return
|
||||
check_stability()
|
||||
return
|
||||
@@ -211,7 +211,7 @@
|
||||
|
||||
/obj/machinery/power/am_control_unit/proc/check_stability()//TODO: make it break when low also might want to add a way to fix it like a part or such that can be replaced
|
||||
if(stability <= 0)
|
||||
del(src)
|
||||
qdel(src)
|
||||
return
|
||||
|
||||
|
||||
|
||||
@@ -47,7 +47,7 @@
|
||||
user << "You insert the rod into the injector"
|
||||
injecting = 1
|
||||
var/fuel = F.fuel
|
||||
del(F)
|
||||
qdel(F)
|
||||
spawn( 300 )
|
||||
injecting = 0
|
||||
new/obj/item/weapon/fuel(src.loc)
|
||||
@@ -60,7 +60,7 @@
|
||||
user << "You insert the rod into the injector"
|
||||
injecting = 1
|
||||
var/fuel = F.fuel
|
||||
del(F)
|
||||
qdel(F)
|
||||
spawn( 300 )
|
||||
injecting = 0
|
||||
new /obj/item/weapon/fuel(src.loc)
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
user << "You have added the anti-Hydrogen to the storage ring, it now contains [src.fuel]kg"
|
||||
if(istype(F, /obj/item/weapon/fuel/H))
|
||||
src.fuel += F.fuel
|
||||
del(F)
|
||||
qdel(F)
|
||||
src:annihilation(src.fuel)
|
||||
if(istype(src, /obj/item/weapon/fuel/H))
|
||||
if(istype(F, /obj/item/weapon/fuel/H))
|
||||
@@ -38,7 +38,7 @@
|
||||
user << "You have added the Hydrogen to the storage ring, it now contains [src.fuel]kg"
|
||||
if(istype(F, /obj/item/weapon/fuel/antiH))
|
||||
src.fuel += F.fuel
|
||||
del(src)
|
||||
qdel(src)
|
||||
F:annihilation(F.fuel)
|
||||
|
||||
/obj/item/weapon/fuel/antiH/proc/annihilation(var/mass)
|
||||
@@ -54,7 +54,7 @@
|
||||
if (strength > (300+T0C))
|
||||
explosion(T, 0, 0, 2, 3)
|
||||
|
||||
del(src)
|
||||
qdel(src)
|
||||
return
|
||||
|
||||
var/turf/ground_zero = get_turf(loc)
|
||||
@@ -63,7 +63,7 @@
|
||||
explosion(ground_zero, ground_zero_range, ground_zero_range*2, ground_zero_range*3, ground_zero_range*4)
|
||||
|
||||
//SN src = null
|
||||
del(src)
|
||||
qdel(src)
|
||||
return
|
||||
|
||||
|
||||
@@ -77,7 +77,7 @@
|
||||
M.gib()
|
||||
if("Hydrogen")
|
||||
M << "\blue You feel very light, as if you might just float away..."
|
||||
del(src)
|
||||
qdel(src)
|
||||
return
|
||||
|
||||
/obj/item/weapon/fuel/attack(mob/M as mob, mob/user as mob)
|
||||
|
||||
@@ -36,12 +36,12 @@ proc/cardinalrange(var/center)
|
||||
/obj/machinery/am_shielding/proc/controllerscan(var/priorscan = 0)
|
||||
//Make sure we are the only one here
|
||||
if(!istype(src.loc, /turf))
|
||||
del(src)
|
||||
qdel(src)
|
||||
return
|
||||
for(var/obj/machinery/am_shielding/AMS in loc.contents)
|
||||
if(AMS == src) continue
|
||||
spawn(0)
|
||||
del(src)
|
||||
qdel(src)
|
||||
return
|
||||
|
||||
//Search for shielding first
|
||||
@@ -61,11 +61,11 @@ proc/cardinalrange(var/center)
|
||||
controllerscan(1)//Last chance
|
||||
return
|
||||
spawn(0)
|
||||
del(src)
|
||||
qdel(src)
|
||||
return
|
||||
|
||||
|
||||
/obj/machinery/am_shielding/Del()
|
||||
/obj/machinery/am_shielding/Destroy()
|
||||
if(control_unit) control_unit.remove_shielding(src)
|
||||
if(processing) shutdown_core()
|
||||
visible_message("\red The [src.name] melts!")
|
||||
@@ -98,7 +98,7 @@ proc/cardinalrange(var/center)
|
||||
else
|
||||
new /obj/effect/blob(src.loc,60)
|
||||
spawn(0)
|
||||
del(src)
|
||||
qdel(src)
|
||||
return
|
||||
check_stability()
|
||||
return
|
||||
@@ -185,7 +185,7 @@ proc/cardinalrange(var/center)
|
||||
if(injecting_fuel && control_unit)
|
||||
control_unit.exploding = 1
|
||||
if(src)
|
||||
del(src)
|
||||
qdel(src)
|
||||
return
|
||||
|
||||
|
||||
@@ -215,7 +215,7 @@ proc/cardinalrange(var/center)
|
||||
/obj/item/device/am_shielding_container/attackby(var/obj/item/I, var/mob/user)
|
||||
if(istype(I, /obj/item/device/multitool) && istype(src.loc,/turf))
|
||||
new/obj/machinery/am_shielding(src.loc)
|
||||
del(src)
|
||||
qdel(src)
|
||||
return
|
||||
..()
|
||||
return
|
||||
+15
-13
@@ -96,7 +96,6 @@
|
||||
var/update_overlay = -1
|
||||
var/global/status_overlays = 0
|
||||
var/updating_icon = 0
|
||||
var/standard_max_charge
|
||||
var/global/list/status_overlays_lock
|
||||
var/global/list/status_overlays_charging
|
||||
var/global/list/status_overlays_equipment
|
||||
@@ -139,9 +138,6 @@
|
||||
/obj/machinery/power/apc/New(turf/loc, var/ndir, var/building=0)
|
||||
..()
|
||||
wires = new(src)
|
||||
var/tmp/obj/item/weapon/cell/tmp_cell = new
|
||||
standard_max_charge = tmp_cell.maxcharge
|
||||
del(tmp_cell)
|
||||
|
||||
// offset 24 pixels in direction of dir
|
||||
// this allows the APC to be embedded in a wall, yet still inside an area
|
||||
@@ -165,14 +161,18 @@
|
||||
spawn(5)
|
||||
src.update()
|
||||
|
||||
/obj/machinery/power/apc/Del()
|
||||
|
||||
/obj/machinery/power/apc/Destroy()
|
||||
area.power_light = 0
|
||||
area.power_equip = 0
|
||||
area.power_environ = 0
|
||||
area.power_change()
|
||||
del(wires)
|
||||
if(wires)
|
||||
wires.Destroy()
|
||||
wires = null
|
||||
if(cell)
|
||||
del(cell) // qdel
|
||||
cell.loc = loc
|
||||
cell = null
|
||||
if(terminal)
|
||||
disconnect_terminal()
|
||||
|
||||
@@ -559,7 +559,7 @@
|
||||
return
|
||||
new /obj/item/stack/cable_coil(loc,10)
|
||||
user << "<span class='notice'>You cut the cables and dismantle the power terminal.</span>"
|
||||
del(terminal) // qdel
|
||||
qdel(terminal)
|
||||
else if (istype(W, /obj/item/weapon/module/power_control) && opened && has_electronics==0 && !((stat & BROKEN)))
|
||||
user.visible_message("<span class='warning'>[user.name] inserts the power control board into [src].</span>", \
|
||||
"You start to insert the power control board into the frame...")
|
||||
@@ -568,7 +568,7 @@
|
||||
if(has_electronics==0)
|
||||
has_electronics = 1
|
||||
user << "<span class='notice'>You place the power control board inside the frame.</span>"
|
||||
del(W) // qdel
|
||||
qdel(W) // qdel
|
||||
else if (istype(W, /obj/item/weapon/module/power_control) && opened && has_electronics==0 && ((stat & BROKEN)))
|
||||
user << "<span class='warning'>You cannot put the board inside, the frame is damaged.</span>"
|
||||
return
|
||||
@@ -595,7 +595,7 @@
|
||||
"<span class='warning'>[src] has been cut from the wall by [user.name] with the weldingtool.</span>",\
|
||||
"<span class='notice'>You cut the APC frame from the wall.</span>",\
|
||||
"You hear welding.")
|
||||
del(src) // qdel
|
||||
qdel(src)
|
||||
return
|
||||
else if (istype(W, /obj/item/apc_frame) && opened && emagged)
|
||||
emagged = 0
|
||||
@@ -604,7 +604,7 @@
|
||||
user.visible_message(\
|
||||
"<span class='warning'>[user.name] has replaced the damaged APC frontal panel with a new one.</span>",\
|
||||
"<span class='notice'>You replace the damaged APC frontal panel with a new one.</span>")
|
||||
del(W) // qdel
|
||||
qdel(W)
|
||||
update_icon()
|
||||
else if (istype(W, /obj/item/apc_frame) && opened && ((stat & BROKEN) || hacker))
|
||||
if (has_electronics)
|
||||
@@ -616,7 +616,7 @@
|
||||
user.visible_message(\
|
||||
"<span class='notice'>[user.name] has replaced the damaged APC frame with new one.</span>",\
|
||||
"You replace the damaged APC frame with new one.")
|
||||
del(W) // qdel
|
||||
qdel(W)
|
||||
stat &= ~BROKEN
|
||||
hacker = null
|
||||
if (opened==2)
|
||||
@@ -1166,10 +1166,12 @@ obj/machinery/power/apc/proc/autoset(var/val, var/on)
|
||||
equipment = 0
|
||||
environ = 0
|
||||
update()
|
||||
update_icon()
|
||||
|
||||
spawn(600)
|
||||
update_channels()
|
||||
update()
|
||||
update_icon()
|
||||
..()
|
||||
|
||||
/obj/machinery/power/apc/ex_act(severity)
|
||||
@@ -1179,7 +1181,7 @@ obj/machinery/power/apc/proc/autoset(var/val, var/on)
|
||||
//set_broken() //now Del() do what we need
|
||||
if (cell)
|
||||
cell.ex_act(1.0) // more lags woohoo
|
||||
del(src) // qdel
|
||||
qdel(src)
|
||||
return
|
||||
if(2.0)
|
||||
if (prob(50))
|
||||
|
||||
@@ -78,7 +78,7 @@
|
||||
if(I.reliability != 100 && crit_fail)
|
||||
I.crit_fail = 1
|
||||
I.loc = src.loc
|
||||
del(src)
|
||||
qdel(src)
|
||||
return 1
|
||||
else
|
||||
user << "<span class='warning'>Turn off the [src] before dismantling it.</span>"
|
||||
|
||||
@@ -117,7 +117,7 @@
|
||||
else
|
||||
icon_state = icon_state_off
|
||||
for(var/obj/structure/cable/C in src.loc)
|
||||
del(C)
|
||||
qdel(C)
|
||||
|
||||
// Used by RCON to toggle the breaker box.
|
||||
/obj/machinery/power/breakerbox/proc/auto_toggle()
|
||||
|
||||
+10
-11
@@ -85,7 +85,7 @@ By design, d1 is the smallest direction and d2 is the highest
|
||||
cable_list += src //add it to the global cable list
|
||||
|
||||
|
||||
/obj/structure/cable/Del() // called when a cable is deleted
|
||||
/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
|
||||
@@ -154,11 +154,11 @@ By design, d1 is the smallest direction and d2 is the highest
|
||||
var/turf/below = locate(src.x, src.y, controller.down_target)
|
||||
for(var/obj/structure/cable/c in below)
|
||||
if(c.d1 == 12 || c.d2 == 12)
|
||||
c.Del()
|
||||
qdel(c)
|
||||
///// Z-Level Stuff
|
||||
investigate_log("was cut by [key_name(usr, usr.client)] in [user.loc.loc]","wires")
|
||||
|
||||
del(src) // qdel
|
||||
qdel(src)
|
||||
return
|
||||
|
||||
|
||||
@@ -201,16 +201,16 @@ By design, d1 is the smallest direction and d2 is the highest
|
||||
/obj/structure/cable/ex_act(severity)
|
||||
switch(severity)
|
||||
if(1.0)
|
||||
del(src) // qdel
|
||||
qdel(src)
|
||||
if(2.0)
|
||||
if (prob(50))
|
||||
new/obj/item/stack/cable_coil(src.loc, src.d1 ? 2 : 1, color)
|
||||
del(src) // qdel
|
||||
qdel(src)
|
||||
|
||||
if(3.0)
|
||||
if (prob(25))
|
||||
new/obj/item/stack/cable_coil(src.loc, src.d1 ? 2 : 1, color)
|
||||
del(src) // qdel
|
||||
qdel(src)
|
||||
return
|
||||
|
||||
obj/structure/cable/proc/cableColor(var/colorC)
|
||||
@@ -418,7 +418,7 @@ obj/structure/cable/proc/cableColor(var/colorC)
|
||||
propagate_network(powerlist[1],PN) //propagates the new powernet beginning at the source cable
|
||||
|
||||
if(PN.is_empty()) //can happen with machines made nodeless when smoothing cables
|
||||
del(PN) // qdel
|
||||
qdel(PN)
|
||||
|
||||
// cut the cable's powernet at this cable and updates the powergrid
|
||||
/obj/structure/cable/proc/cut_cable_from_powernet()
|
||||
@@ -470,7 +470,6 @@ obj/structure/cable/proc/cableColor(var/colorC)
|
||||
amount = MAXCOIL
|
||||
max_amount = MAXCOIL
|
||||
color = COLOR_RED
|
||||
//item_color = COLOR_RED Use regular "color" var instead. No need to have it duplicate in two vars. Causes confusion.
|
||||
desc = "A coil of power cable."
|
||||
throwforce = 10
|
||||
w_class = 2.0
|
||||
@@ -770,7 +769,7 @@ obj/structure/cable/proc/cableColor(var/colorC)
|
||||
if (C.shock(user, 50))
|
||||
if (prob(50)) //fail
|
||||
new/obj/item/stack/cable_coil(C.loc, 1, C.color)
|
||||
del(C) // qdel
|
||||
qdel(C)
|
||||
|
||||
// called when cable_coil is click on an installed obj/cable
|
||||
// or click on a turf that already contains a "node" cable
|
||||
@@ -834,7 +833,7 @@ obj/structure/cable/proc/cableColor(var/colorC)
|
||||
if (NC.shock(user, 50))
|
||||
if (prob(50)) //fail
|
||||
new/obj/item/stack/cable_coil(NC.loc, 1, NC.color)
|
||||
del(NC) // qdel
|
||||
qdel(NC)
|
||||
|
||||
return
|
||||
|
||||
@@ -882,7 +881,7 @@ obj/structure/cable/proc/cableColor(var/colorC)
|
||||
if (C.shock(user, 50))
|
||||
if (prob(50)) //fail
|
||||
new/obj/item/stack/cable_coil(C.loc, 2, C.color)
|
||||
del(C) // qdel
|
||||
qdel(C)
|
||||
return
|
||||
|
||||
C.denode()// this call may have disconnected some cables that terminated on the centre of the turf, if so split the powernets.
|
||||
|
||||
@@ -1,934 +0,0 @@
|
||||
///////////////////////////////
|
||||
//CABLE STRUCTURE
|
||||
///////////////////////////////
|
||||
|
||||
|
||||
////////////////////////////////
|
||||
// Definitions
|
||||
////////////////////////////////
|
||||
|
||||
/* Cable directions (d1 and d2)
|
||||
|
||||
|
||||
9 1 5
|
||||
\ | /
|
||||
8 - 0 - 4
|
||||
/ | \
|
||||
10 2 6
|
||||
|
||||
If d1 = 0 and d2 = 0, there's no cable
|
||||
If d1 = 0 and d2 = dir, it's a O-X cable, getting from the center of the tile to dir (knot cable)
|
||||
If d1 = dir1 and d2 = dir2, it's a full X-X cable, getting from dir1 to dir2
|
||||
By design, d1 is the smallest direction and d2 is the highest
|
||||
*/
|
||||
|
||||
/obj/structure/cable
|
||||
level = 1
|
||||
anchored =1
|
||||
var/datum/powernet/powernet
|
||||
name = "power cable"
|
||||
desc = "A flexible superconducting cable for heavy-duty power transfer"
|
||||
icon = 'icons/obj/power_cond_white.dmi'
|
||||
icon_state = "0-1"
|
||||
var/d1 = 0
|
||||
var/d2 = 1
|
||||
layer = 2.44 //Just below unary stuff, which is at 2.45 and above pipes, which are at 2.4
|
||||
color = COLOR_RED
|
||||
var/obj/machinery/power/breakerbox/breaker_box
|
||||
|
||||
/obj/structure/cable/drain_power(var/drain_check, var/surge, var/amount = 0)
|
||||
|
||||
if(drain_check)
|
||||
return 1
|
||||
|
||||
var/datum/powernet/PN = get_powernet()
|
||||
if(!PN) return 0
|
||||
|
||||
return PN.draw_power(amount)
|
||||
|
||||
/obj/structure/cable/yellow
|
||||
color = COLOR_YELLOW
|
||||
|
||||
/obj/structure/cable/green
|
||||
color = COLOR_GREEN
|
||||
|
||||
/obj/structure/cable/blue
|
||||
color = COLOR_BLUE
|
||||
|
||||
/obj/structure/cable/pink
|
||||
color = COLOR_PINK
|
||||
|
||||
/obj/structure/cable/orange
|
||||
color = COLOR_ORANGE
|
||||
|
||||
/obj/structure/cable/cyan
|
||||
color = COLOR_CYAN
|
||||
|
||||
/obj/structure/cable/white
|
||||
color = COLOR_WHITE
|
||||
|
||||
/obj/structure/cable/New()
|
||||
..()
|
||||
|
||||
|
||||
// ensure d1 & d2 reflect the icon_state for entering and exiting cable
|
||||
|
||||
var/dash = findtext(icon_state, "-")
|
||||
|
||||
d1 = text2num( copytext( icon_state, 1, dash ) )
|
||||
|
||||
d2 = text2num( copytext( icon_state, dash+1 ) )
|
||||
|
||||
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
|
||||
|
||||
|
||||
/obj/structure/cable/Del() // called when a cable is deleted
|
||||
if(powernet)
|
||||
cut_cable_from_powernet() // update the powernets
|
||||
cable_list -= src //remove it from global cable list
|
||||
..() // then go ahead and delete the cable
|
||||
|
||||
///////////////////////////////////
|
||||
// General procedures
|
||||
///////////////////////////////////
|
||||
|
||||
//If underfloor, hide the cable
|
||||
/obj/structure/cable/hide(var/i)
|
||||
|
||||
if(level == 1 && istype(loc, /turf))
|
||||
invisibility = i ? 101 : 0
|
||||
updateicon()
|
||||
|
||||
/obj/structure/cable/proc/updateicon()
|
||||
icon_state = "[d1]-[d2]"
|
||||
alpha = invisibility ? 127 : 255
|
||||
|
||||
// returns the powernet this cable belongs to
|
||||
/obj/structure/cable/proc/get_powernet() //TODO: remove this as it is obsolete
|
||||
return powernet
|
||||
|
||||
//Telekinesis has no effect on a cable
|
||||
/obj/structure/cable/attack_tk(mob/user)
|
||||
return
|
||||
|
||||
// Items usable on a cable :
|
||||
// - Wirecutters : cut it duh !
|
||||
// - Cable coil : merge cables
|
||||
// - Multitool : get the power currently passing through the cable
|
||||
//
|
||||
/obj/structure/cable/attackby(obj/item/W, mob/user)
|
||||
|
||||
var/turf/T = src.loc
|
||||
if(T.intact)
|
||||
return
|
||||
|
||||
if(istype(W, /obj/item/weapon/wirecutters))
|
||||
///// Z-Level Stuff
|
||||
if(src.d1 == 12 || src.d2 == 12)
|
||||
user << "<span class='warning'>You must cut this cable from above.</span>"
|
||||
return
|
||||
///// Z-Level Stuff
|
||||
if(breaker_box)
|
||||
user << "\red This cable is connected to nearby breaker box. Use breaker box to interact with it."
|
||||
return
|
||||
|
||||
if (shock(user, 50))
|
||||
return
|
||||
|
||||
if(src.d1) // 0-X cables are 1 unit, X-X cables are 2 units long
|
||||
new/obj/item/stack/cable_coil(T, 2, color)
|
||||
else
|
||||
new/obj/item/stack/cable_coil(T, 1, color)
|
||||
|
||||
for(var/mob/O in viewers(src, null))
|
||||
O.show_message("<span class='warning'>[user] cuts the cable.</span>", 1)
|
||||
|
||||
///// Z-Level Stuff
|
||||
if(src.d1 == 11 || src.d2 == 11)
|
||||
var/turf/controllerlocation = locate(1, 1, z)
|
||||
for(var/obj/effect/landmark/zcontroller/controller in controllerlocation)
|
||||
if(controller.down)
|
||||
var/turf/below = locate(src.x, src.y, controller.down_target)
|
||||
for(var/obj/structure/cable/c in below)
|
||||
if(c.d1 == 12 || c.d2 == 12)
|
||||
c.Del()
|
||||
///// Z-Level Stuff
|
||||
investigate_log("was cut by [key_name(usr, usr.client)] in [user.loc.loc]","wires")
|
||||
|
||||
del(src) // qdel
|
||||
return
|
||||
|
||||
|
||||
else if(istype(W, /obj/item/stack/cable_coil))
|
||||
var/obj/item/stack/cable_coil/coil = W
|
||||
if (coil.get_amount() < 1)
|
||||
user << "Not enough cable"
|
||||
return
|
||||
coil.cable_join(src, user)
|
||||
|
||||
else if(istype(W, /obj/item/device/multitool))
|
||||
|
||||
if(powernet && (powernet.avail > 0)) // is it powered?
|
||||
user << "<span class='warning'>[powernet.avail]W in power network.</span>"
|
||||
|
||||
else
|
||||
user << "<span class='warning'>The cable is not powered.</span>"
|
||||
|
||||
shock(user, 5, 0.2)
|
||||
|
||||
else
|
||||
if (W.flags & CONDUCT)
|
||||
shock(user, 50, 0.7)
|
||||
|
||||
src.add_fingerprint(user)
|
||||
|
||||
// shock the user with probability prb
|
||||
/obj/structure/cable/proc/shock(mob/user, prb, var/siemens_coeff = 1.0)
|
||||
if(!prob(prb))
|
||||
return 0
|
||||
if (electrocute_mob(user, powernet, src, siemens_coeff))
|
||||
var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread
|
||||
s.set_up(5, 1, src)
|
||||
s.start()
|
||||
if(usr.stunned)
|
||||
return 1
|
||||
return 0
|
||||
|
||||
//explosion handling
|
||||
/obj/structure/cable/ex_act(severity)
|
||||
switch(severity)
|
||||
if(1.0)
|
||||
del(src) // qdel
|
||||
if(2.0)
|
||||
if (prob(50))
|
||||
new/obj/item/stack/cable_coil(src.loc, src.d1 ? 2 : 1, color)
|
||||
del(src) // qdel
|
||||
|
||||
if(3.0)
|
||||
if (prob(25))
|
||||
new/obj/item/stack/cable_coil(src.loc, src.d1 ? 2 : 1, color)
|
||||
del(src) // qdel
|
||||
return
|
||||
|
||||
obj/structure/cable/proc/cableColor(var/colorC)
|
||||
var/color_n = "#DD0000"
|
||||
if(colorC)
|
||||
color_n = colorC
|
||||
color = color_n
|
||||
|
||||
/////////////////////////////////////////////////
|
||||
// Cable laying helpers
|
||||
////////////////////////////////////////////////
|
||||
|
||||
//handles merging diagonally matching cables
|
||||
//for info : direction^3 is flipping horizontally, direction^12 is flipping vertically
|
||||
/obj/structure/cable/proc/mergeDiagonalsNetworks(var/direction)
|
||||
|
||||
//search for and merge diagonally matching cables from the first direction component (north/south)
|
||||
var/turf/T = get_step(src, direction&3)//go north/south
|
||||
|
||||
for(var/obj/structure/cable/C in T)
|
||||
|
||||
if(!C)
|
||||
continue
|
||||
|
||||
if(src == C)
|
||||
continue
|
||||
|
||||
if(C.d1 == (direction^3) || C.d2 == (direction^3)) //we've got a diagonally matching cable
|
||||
if(!C.powernet) //if the matching cable somehow got no powernet, make him one (should not happen for cables)
|
||||
var/datum/powernet/newPN = new()
|
||||
newPN.add_cable(C)
|
||||
|
||||
if(powernet) //if we already have a powernet, then merge the two powernets
|
||||
merge_powernets(powernet,C.powernet)
|
||||
else
|
||||
C.powernet.add_cable(src) //else, we simply connect to the matching cable powernet
|
||||
|
||||
//the same from the second direction component (east/west)
|
||||
T = get_step(src, direction&12)//go east/west
|
||||
|
||||
for(var/obj/structure/cable/C in T)
|
||||
|
||||
if(!C)
|
||||
continue
|
||||
|
||||
if(src == C)
|
||||
continue
|
||||
if(C.d1 == (direction^12) || C.d2 == (direction^12)) //we've got a diagonally matching cable
|
||||
if(!C.powernet) //if the matching cable somehow got no powernet, make him one (should not happen for cables)
|
||||
var/datum/powernet/newPN = new()
|
||||
newPN.add_cable(C)
|
||||
|
||||
if(powernet) //if we already have a powernet, then merge the two powernets
|
||||
merge_powernets(powernet,C.powernet)
|
||||
else
|
||||
C.powernet.add_cable(src) //else, we simply connect to the matching cable powernet
|
||||
|
||||
// merge with the powernets of power objects in the given direction
|
||||
/obj/structure/cable/proc/mergeConnectedNetworks(var/direction)
|
||||
|
||||
var/fdir = (!direction)? 0 : turn(direction, 180) //flip the direction, to match with the source position on its turf
|
||||
|
||||
if(!(d1 == direction || d2 == direction)) //if the cable is not pointed in this direction, do nothing
|
||||
return
|
||||
|
||||
var/turf/TB = get_step(src, direction)
|
||||
|
||||
for(var/obj/structure/cable/C in TB)
|
||||
|
||||
if(!C)
|
||||
continue
|
||||
|
||||
if(src == C)
|
||||
continue
|
||||
|
||||
if(C.d1 == fdir || C.d2 == fdir) //we've got a matching cable in the neighbor turf
|
||||
if(!C.powernet) //if the matching cable somehow got no powernet, make him one (should not happen for cables)
|
||||
var/datum/powernet/newPN = new()
|
||||
newPN.add_cable(C)
|
||||
|
||||
if(powernet) //if we already have a powernet, then merge the two powernets
|
||||
merge_powernets(powernet,C.powernet)
|
||||
else
|
||||
C.powernet.add_cable(src) //else, we simply connect to the matching cable powernet
|
||||
|
||||
// merge with the powernets of power objects in the source turf
|
||||
/obj/structure/cable/proc/mergeConnectedNetworksOnTurf()
|
||||
var/list/to_connect = list()
|
||||
|
||||
if(!powernet) //if we somehow have no powernet, make one (should not happen for cables)
|
||||
var/datum/powernet/newPN = new()
|
||||
newPN.add_cable(src)
|
||||
|
||||
//first let's add turf cables to our powernet
|
||||
//then we'll connect machines on turf with a node cable is present
|
||||
for(var/AM in loc)
|
||||
if(istype(AM,/obj/structure/cable))
|
||||
var/obj/structure/cable/C = AM
|
||||
if(C.d1 == d1 || C.d2 == d1 || C.d1 == d2 || C.d2 == d2) //only connected if they have a common direction
|
||||
if(C.powernet == powernet) continue
|
||||
if(C.powernet)
|
||||
merge_powernets(powernet, C.powernet)
|
||||
else
|
||||
powernet.add_cable(C) //the cable was powernetless, let's just add it to our powernet
|
||||
|
||||
else if(istype(AM,/obj/machinery/power/apc))
|
||||
var/obj/machinery/power/apc/N = AM
|
||||
if(!N.terminal) continue // APC are connected through their terminal
|
||||
|
||||
if(N.terminal.powernet == powernet)
|
||||
continue
|
||||
|
||||
to_connect += N.terminal //we'll connect the machines after all cables are merged
|
||||
|
||||
else if(istype(AM,/obj/machinery/power)) //other power machines
|
||||
var/obj/machinery/power/M = AM
|
||||
|
||||
if(M.powernet == powernet)
|
||||
continue
|
||||
|
||||
to_connect += M //we'll connect the machines after all cables are merged
|
||||
|
||||
//now that cables are done, let's connect found machines
|
||||
for(var/obj/machinery/power/PM in to_connect)
|
||||
if(!PM.connect_to_network())
|
||||
PM.disconnect_from_network() //if we somehow can't connect the machine to the new powernet, remove it from the old nonetheless
|
||||
|
||||
//////////////////////////////////////////////
|
||||
// Powernets handling helpers
|
||||
//////////////////////////////////////////////
|
||||
|
||||
//if powernetless_only = 1, will only get connections without powernet
|
||||
/obj/structure/cable/proc/get_connections(var/powernetless_only = 0)
|
||||
. = list() // this will be a list of all connected power objects
|
||||
var/turf/T
|
||||
|
||||
///// Z-Level Stuff
|
||||
if (d1 == 11 || d1 == 12)
|
||||
var/turf/controllerlocation = locate(1, 1, z)
|
||||
for(var/obj/effect/landmark/zcontroller/controller in controllerlocation)
|
||||
if(controller.up && d1 == 12)
|
||||
T = locate(src.x, src.y, controller.up_target)
|
||||
if(T)
|
||||
. += power_list(T, src, 11, 1)
|
||||
if(controller.down && d1 == 11)
|
||||
T = locate(src.x, src.y, controller.down_target)
|
||||
if(T)
|
||||
. += power_list(T, src, 12, 1)
|
||||
///// Z-Level Stuff
|
||||
//get matching cables from the first direction
|
||||
else if(d1) //if not a node cable
|
||||
T = get_step(src, d1)
|
||||
if(T)
|
||||
. += power_list(T, src, turn(d1, 180), powernetless_only) //get adjacents matching cables
|
||||
|
||||
if(d1&(d1-1)) //diagonal direction, must check the 4 possibles adjacents tiles
|
||||
T = get_step(src,d1&3) // go north/south
|
||||
if(T)
|
||||
. += power_list(T, src, d1 ^ 3, powernetless_only) //get diagonally matching cables
|
||||
T = get_step(src,d1&12) // go east/west
|
||||
if(T)
|
||||
. += power_list(T, src, d1 ^ 12, powernetless_only) //get diagonally matching cables
|
||||
|
||||
. += power_list(loc, src, d1, powernetless_only) //get on turf matching cables
|
||||
|
||||
///// Z-Level Stuff
|
||||
if(d2 == 11 || d2 == 12)
|
||||
var/turf/controllerlocation = locate(1, 1, z)
|
||||
for(var/obj/effect/landmark/zcontroller/controller in controllerlocation)
|
||||
if(controller.up && d2 == 12)
|
||||
T = locate(src.x, src.y, controller.up_target)
|
||||
if(T)
|
||||
. += power_list(T, src, 11, 1)
|
||||
if(controller.down && d2 == 11)
|
||||
T = locate(src.x, src.y, controller.down_target)
|
||||
if(T)
|
||||
. += power_list(T, src, 12, 1)
|
||||
///// Z-Level Stuff
|
||||
else
|
||||
//do the same on the second direction (which can't be 0)
|
||||
T = get_step(src, d2)
|
||||
if(T)
|
||||
. += power_list(T, src, turn(d2, 180), powernetless_only) //get adjacents matching cables
|
||||
|
||||
if(d2&(d2-1)) //diagonal direction, must check the 4 possibles adjacents tiles
|
||||
T = get_step(src,d2&3) // go north/south
|
||||
if(T)
|
||||
. += power_list(T, src, d2 ^ 3, powernetless_only) //get diagonally matching cables
|
||||
T = get_step(src,d2&12) // go east/west
|
||||
if(T)
|
||||
. += power_list(T, src, d2 ^ 12, powernetless_only) //get diagonally matching cables
|
||||
. += power_list(loc, src, d2, powernetless_only) //get on turf matching cables
|
||||
|
||||
return .
|
||||
|
||||
//should be called after placing a cable which extends another cable, creating a "smooth" cable that no longer terminates in the centre of a turf.
|
||||
//needed as this can, unlike other placements, disconnect cables
|
||||
/obj/structure/cable/proc/denode()
|
||||
var/turf/T1 = loc
|
||||
if(!T1) return
|
||||
|
||||
var/list/powerlist = power_list(T1,src,0,0) //find the other cables that ended in the centre of the turf, with or without a powernet
|
||||
if(powerlist.len>0)
|
||||
var/datum/powernet/PN = new()
|
||||
propagate_network(powerlist[1],PN) //propagates the new powernet beginning at the source cable
|
||||
|
||||
if(PN.is_empty()) //can happen with machines made nodeless when smoothing cables
|
||||
del(PN) // qdel
|
||||
|
||||
// cut the cable's powernet at this cable and updates the powergrid
|
||||
/obj/structure/cable/proc/cut_cable_from_powernet()
|
||||
var/turf/T1 = loc
|
||||
var/list/P_list
|
||||
if(!T1) return
|
||||
if(d1)
|
||||
T1 = get_step(T1, d1)
|
||||
P_list = power_list(T1, src, turn(d1,180),0,cable_only = 1) // what adjacently joins on to cut cable...
|
||||
|
||||
P_list += power_list(loc, src, d1, 0, cable_only = 1)//... and on turf
|
||||
|
||||
|
||||
if(P_list.len == 0)//if nothing in both list, then the cable was a lone cable, just delete it and its powernet
|
||||
powernet.remove_cable(src)
|
||||
|
||||
for(var/obj/machinery/power/P in T1)//check if it was powering a machine
|
||||
if(!P.connect_to_network()) //can't find a node cable on a the turf to connect to
|
||||
P.disconnect_from_network() //remove from current network (and delete powernet)
|
||||
return
|
||||
|
||||
// remove the cut cable from its turf and powernet, so that it doesn't get count in propagate_network worklist
|
||||
loc = null
|
||||
powernet.remove_cable(src) //remove the cut cable from its powernet
|
||||
|
||||
var/datum/powernet/newPN = new()// creates a new powernet...
|
||||
propagate_network(P_list[1], newPN)//... and propagates it to the other side of the cable
|
||||
|
||||
// Disconnect machines connected to nodes
|
||||
if(d1 == 0) // if we cut a node (O-X) cable
|
||||
for(var/obj/machinery/power/P in T1)
|
||||
if(!P.connect_to_network()) //can't find a node cable on a the turf to connect to
|
||||
P.disconnect_from_network() //remove from current network
|
||||
|
||||
///////////////////////////////////////////////
|
||||
// The cable coil object, used for laying cable
|
||||
///////////////////////////////////////////////
|
||||
|
||||
////////////////////////////////
|
||||
// Definitions
|
||||
////////////////////////////////
|
||||
|
||||
#define MAXCOIL 30
|
||||
|
||||
/obj/item/stack/cable_coil
|
||||
name = "cable coil"
|
||||
icon = 'icons/obj/power.dmi'
|
||||
icon_state = "coil"
|
||||
amount = MAXCOIL
|
||||
max_amount = MAXCOIL
|
||||
color = COLOR_RED
|
||||
//item_color = COLOR_RED Use regular "color" var instead. No need to have it duplicate in two vars. Causes confusion.
|
||||
desc = "A coil of power cable."
|
||||
throwforce = 10
|
||||
w_class = 2.0
|
||||
throw_speed = 2
|
||||
throw_range = 5
|
||||
matter = list("metal" = 50, "glass" = 20)
|
||||
flags = CONDUCT
|
||||
slot_flags = SLOT_BELT
|
||||
item_state = "coil"
|
||||
attack_verb = list("whipped", "lashed", "disciplined", "flogged")
|
||||
|
||||
/obj/item/stack/cable_coil/cyborg
|
||||
name = "cable coil synthesizer"
|
||||
desc = "A device that makes cable."
|
||||
gender = NEUTER
|
||||
matter = null
|
||||
uses_charge = 1
|
||||
charge_costs = list(1)
|
||||
stacktype = /obj/item/stack/cable_coil
|
||||
|
||||
/obj/item/stack/cable_coil/suicide_act(mob/user)
|
||||
if(locate(/obj/item/weapon/stool) in user.loc)
|
||||
user.visible_message("<span class='suicide'>[user] is making a noose with the [src.name]! It looks like \he's trying to commit suicide.</span>")
|
||||
else
|
||||
user.visible_message("<span class='suicide'>[user] is strangling \himself with the [src.name]! It looks like \he's trying to commit suicide.</span>")
|
||||
return(OXYLOSS)
|
||||
|
||||
/obj/item/stack/cable_coil/New(loc, length = MAXCOIL, var/param_color = null)
|
||||
..()
|
||||
src.amount = length
|
||||
if (param_color) // It should be red by default, so only recolor it if parameter was specified.
|
||||
color = param_color
|
||||
pixel_x = rand(-2,2)
|
||||
pixel_y = rand(-2,2)
|
||||
update_icon()
|
||||
update_wclass()
|
||||
|
||||
///////////////////////////////////
|
||||
// General procedures
|
||||
///////////////////////////////////
|
||||
|
||||
//you can use wires to heal robotics
|
||||
/obj/item/stack/cable_coil/attack(mob/M as mob, mob/user as mob)
|
||||
if(istype(M,/mob/living/carbon/human))
|
||||
var/mob/living/carbon/human/H = M
|
||||
<<<<<<< HEAD
|
||||
var/datum/organ/external/S = H.get_organ(user.zone_sel.selecting)
|
||||
if(!(S.status & ORGAN_ROBOT) || user.a_intent != I_HELP)
|
||||
=======
|
||||
var/obj/item/organ/external/S = H.get_organ(user.zone_sel.selecting)
|
||||
if(!(S.status & ORGAN_ROBOT) || user.a_intent != "help")
|
||||
>>>>>>> d77010221cbd08f6373edebee25d727b6409413b
|
||||
return ..()
|
||||
|
||||
if(H.species.flags & IS_SYNTHETIC)
|
||||
if(M == user)
|
||||
user << "\red You can't repair damage to your own body - it's against OH&S."
|
||||
return
|
||||
|
||||
if(S.burn_dam > 0 && use(1))
|
||||
S.heal_damage(0,15,0,1)
|
||||
user.visible_message("\red \The [user] repairs some burn damage on \the [M]'s [S.name] with \the [src].")
|
||||
return
|
||||
else
|
||||
user << "Nothing to fix!"
|
||||
|
||||
else
|
||||
return ..()
|
||||
|
||||
|
||||
/obj/item/stack/cable_coil/update_icon()
|
||||
if (!color)
|
||||
color = pick(COLOR_RED, COLOR_BLUE, COLOR_GREEN, COLOR_ORANGE, COLOR_WHITE, COLOR_PINK, COLOR_YELLOW, COLOR_CYAN)
|
||||
if(amount == 1)
|
||||
icon_state = "coil1"
|
||||
name = "cable piece"
|
||||
else if(amount == 2)
|
||||
icon_state = "coil2"
|
||||
name = "cable piece"
|
||||
else
|
||||
icon_state = "coil"
|
||||
name = "cable coil"
|
||||
|
||||
/obj/item/stack/cable_coil/proc/update_wclass()
|
||||
if(amount == 1)
|
||||
w_class = 1.0
|
||||
else
|
||||
w_class = 2.0
|
||||
|
||||
/obj/item/stack/cable_coil/examine(mob/user)
|
||||
if(get_dist(src, user) > 1)
|
||||
return
|
||||
|
||||
if(get_amount() == 1)
|
||||
user << "A short piece of power cable."
|
||||
else if(get_amount() == 2)
|
||||
user << "A piece of power cable."
|
||||
else
|
||||
user << "A coil of power cable. There are [get_amount()] lengths of cable in the coil."
|
||||
|
||||
|
||||
/obj/item/stack/cable_coil/verb/make_restraint()
|
||||
set name = "Make Cable Restraints"
|
||||
set category = "Object"
|
||||
var/mob/M = usr
|
||||
|
||||
if(ishuman(M) && !M.restrained() && !M.stat && !M.paralysis && ! M.stunned)
|
||||
if(!istype(usr.loc,/turf)) return
|
||||
if(src.amount <= 14)
|
||||
usr << "\red You need at least 15 lengths to make restraints!"
|
||||
return
|
||||
var/obj/item/weapon/handcuffs/cable/B = new /obj/item/weapon/handcuffs/cable(usr.loc)
|
||||
B.color = color
|
||||
usr << "<span class='notice'>You wind some cable together to make some restraints.</span>"
|
||||
src.use(15)
|
||||
else
|
||||
usr << "\blue You cannot do that."
|
||||
..()
|
||||
|
||||
/obj/item/stack/cable_coil/cyborg/verb/set_colour()
|
||||
set name = "Change Colour"
|
||||
set category = "Object"
|
||||
|
||||
var/list/possible_colours = list ("Yellow", "Green", "Pink", "Blue", "Orange", "Cyan", "Red")
|
||||
var/selected_type = input("Pick new colour.", "Cable Colour", null, null) as null|anything in possible_colours
|
||||
|
||||
if(selected_type)
|
||||
switch(selected_type)
|
||||
if("Yellow")
|
||||
color = COLOR_YELLOW
|
||||
if("Green")
|
||||
color = COLOR_GREEN
|
||||
if("Pink")
|
||||
color = COLOR_PINK
|
||||
if("Blue")
|
||||
color = COLOR_BLUE
|
||||
if("Orange")
|
||||
color = COLOR_ORANGE
|
||||
if("Cyan")
|
||||
color = COLOR_CYAN
|
||||
else
|
||||
color = COLOR_RED
|
||||
usr << "You change your cable coil's colour to [selected_type]"
|
||||
|
||||
// Items usable on a cable coil :
|
||||
// - Wirecutters : cut them duh !
|
||||
// - Cable coil : merge cables
|
||||
/obj/item/stack/cable_coil/attackby(obj/item/weapon/W, mob/user)
|
||||
..()
|
||||
if( istype(W, /obj/item/weapon/wirecutters) && src.get_amount() > 1)
|
||||
src.use(1)
|
||||
new/obj/item/stack/cable_coil(user.loc, 1,color)
|
||||
user << "You cut a piece off the cable coil."
|
||||
src.update_icon()
|
||||
return
|
||||
else if(istype(W, /obj/item/stack/cable_coil))
|
||||
var/obj/item/stack/cable_coil/C = W
|
||||
if(C.get_amount() >= get_max_amount())
|
||||
user << "The coil is too long, you cannot add any more cable to it."
|
||||
return
|
||||
|
||||
if( (C.get_amount() + src.get_amount() <= get_max_amount()) )
|
||||
user << "You join the cable coils together."
|
||||
C.give(src.get_amount()) // give it cable
|
||||
src.use(src.get_amount()) // make sure this one cleans up right
|
||||
return
|
||||
|
||||
else
|
||||
var/amt = get_max_amount() - C.get_amount()
|
||||
user << "You transfer [amt] length\s of cable from one coil to the other."
|
||||
C.give(amt)
|
||||
src.use(amt)
|
||||
return
|
||||
|
||||
//remove cables from the stack
|
||||
/* This is probably reduntant
|
||||
/obj/item/stack/cable_coil/use(var/used)
|
||||
if(src.amount < used)
|
||||
return 0
|
||||
else if (src.amount == used)
|
||||
if(ismob(loc)) //handle mob icon update
|
||||
var/mob/M = loc
|
||||
M.unEquip(src)
|
||||
qdel(src)
|
||||
return 1
|
||||
else
|
||||
amount -= used
|
||||
update_icon()
|
||||
return 1
|
||||
*/
|
||||
/obj/item/stack/cable_coil/use(var/used)
|
||||
. = ..()
|
||||
update_icon()
|
||||
return
|
||||
|
||||
//add cables to the stack
|
||||
/obj/item/stack/cable_coil/proc/give(var/extra)
|
||||
if(amount + extra > MAXCOIL)
|
||||
amount = MAXCOIL
|
||||
else
|
||||
amount += extra
|
||||
update_icon()
|
||||
|
||||
///////////////////////////////////////////////
|
||||
// Cable laying procedures
|
||||
//////////////////////////////////////////////
|
||||
|
||||
// called when cable_coil is clicked on a turf/simulated/floor
|
||||
/obj/item/stack/cable_coil/proc/turf_place(turf/simulated/floor/F, mob/user)
|
||||
if(!isturf(user.loc))
|
||||
return
|
||||
|
||||
if(get_amount() < 1) // Out of cable
|
||||
user << "There is no cable left."
|
||||
return
|
||||
|
||||
if(get_dist(F,user) > 1) // Too far
|
||||
user << "You can't lay cable at a place that far away."
|
||||
return
|
||||
|
||||
if(F.intact) // Ff floor is intact, complain
|
||||
user << "You can't lay cable there unless the floor tiles are removed."
|
||||
return
|
||||
|
||||
else
|
||||
var/dirn
|
||||
|
||||
if(user.loc == F)
|
||||
dirn = user.dir // if laying on the tile we're on, lay in the direction we're facing
|
||||
else
|
||||
dirn = get_dir(F, user)
|
||||
|
||||
for(var/obj/structure/cable/LC in F)
|
||||
if((LC.d1 == dirn && LC.d2 == 0 ) || ( LC.d2 == dirn && LC.d1 == 0))
|
||||
user << "<span class='warning'>There's already a cable at that position.</span>"
|
||||
return
|
||||
///// Z-Level Stuff
|
||||
// check if the target is open space
|
||||
if(istype(F, /turf/simulated/floor/open))
|
||||
for(var/obj/structure/cable/LC in F)
|
||||
if((LC.d1 == dirn && LC.d2 == 11 ) || ( LC.d2 == dirn && LC.d1 == 11))
|
||||
user << "<span class='warning'>There's already a cable at that position.</span>"
|
||||
return
|
||||
|
||||
var/turf/simulated/floor/open/temp = F
|
||||
var/obj/structure/cable/C = new(F)
|
||||
var/obj/structure/cable/D = new(temp.floorbelow)
|
||||
|
||||
C.cableColor(color)
|
||||
|
||||
C.d1 = 11
|
||||
C.d2 = dirn
|
||||
C.add_fingerprint(user)
|
||||
C.updateicon()
|
||||
|
||||
var/datum/powernet/PN = new()
|
||||
PN.add_cable(C)
|
||||
|
||||
C.mergeConnectedNetworks(C.d2)
|
||||
C.mergeConnectedNetworksOnTurf()
|
||||
|
||||
D.cableColor(color)
|
||||
|
||||
D.d1 = 12
|
||||
D.d2 = 0
|
||||
D.add_fingerprint(user)
|
||||
D.updateicon()
|
||||
|
||||
PN.add_cable(D)
|
||||
D.mergeConnectedNetworksOnTurf()
|
||||
|
||||
// do the normal stuff
|
||||
else
|
||||
///// Z-Level Stuff
|
||||
for(var/obj/structure/cable/LC in F)
|
||||
if((LC.d1 == dirn && LC.d2 == 0 ) || ( LC.d2 == dirn && LC.d1 == 0))
|
||||
user << "There's already a cable at that position."
|
||||
return
|
||||
|
||||
var/obj/structure/cable/C = new(F)
|
||||
|
||||
C.cableColor(color)
|
||||
|
||||
//set up the new cable
|
||||
C.d1 = 0 //it's a O-X node cable
|
||||
C.d2 = dirn
|
||||
C.add_fingerprint(user)
|
||||
C.updateicon()
|
||||
|
||||
//create a new powernet with the cable, if needed it will be merged later
|
||||
var/datum/powernet/PN = new()
|
||||
PN.add_cable(C)
|
||||
|
||||
C.mergeConnectedNetworks(C.d2) //merge the powernet with adjacents powernets
|
||||
C.mergeConnectedNetworksOnTurf() //merge the powernet with on turf powernets
|
||||
|
||||
if(C.d2 & (C.d2 - 1))// if the cable is layed diagonally, check the others 2 possible directions
|
||||
C.mergeDiagonalsNetworks(C.d2)
|
||||
|
||||
|
||||
use(1)
|
||||
if (C.shock(user, 50))
|
||||
if (prob(50)) //fail
|
||||
new/obj/item/stack/cable_coil(C.loc, 1, C.color)
|
||||
del(C) // qdel
|
||||
|
||||
// called when cable_coil is click on an installed obj/cable
|
||||
// or click on a turf that already contains a "node" cable
|
||||
/obj/item/stack/cable_coil/proc/cable_join(obj/structure/cable/C, mob/user)
|
||||
var/turf/U = user.loc
|
||||
if(!isturf(U))
|
||||
return
|
||||
|
||||
var/turf/T = C.loc
|
||||
|
||||
if(!isturf(T) || T.intact) // sanity checks, also stop use interacting with T-scanner revealed cable
|
||||
return
|
||||
|
||||
if(get_dist(C, user) > 1) // make sure it's close enough
|
||||
user << "You can't lay cable at a place that far away."
|
||||
return
|
||||
|
||||
|
||||
if(U == T) //if clicked on the turf we're standing on, try to put a cable in the direction we're facing
|
||||
turf_place(T,user)
|
||||
return
|
||||
|
||||
var/dirn = get_dir(C, user)
|
||||
|
||||
// one end of the clicked cable is pointing towards us
|
||||
if(C.d1 == dirn || C.d2 == dirn)
|
||||
if(U.intact) // can't place a cable if the floor is complete
|
||||
user << "You can't lay cable there unless the floor tiles are removed."
|
||||
return
|
||||
else
|
||||
// cable is pointing at us, we're standing on an open tile
|
||||
// so create a stub pointing at the clicked cable on our tile
|
||||
|
||||
var/fdirn = turn(dirn, 180) // the opposite direction
|
||||
|
||||
for(var/obj/structure/cable/LC in U) // check to make sure there's not a cable there already
|
||||
if(LC.d1 == fdirn || LC.d2 == fdirn)
|
||||
user << "There's already a cable at that position."
|
||||
return
|
||||
|
||||
var/obj/structure/cable/NC = new(U)
|
||||
NC.cableColor(color)
|
||||
|
||||
NC.d1 = 0
|
||||
NC.d2 = fdirn
|
||||
NC.add_fingerprint()
|
||||
NC.updateicon()
|
||||
|
||||
//create a new powernet with the cable, if needed it will be merged later
|
||||
var/datum/powernet/newPN = new()
|
||||
newPN.add_cable(NC)
|
||||
|
||||
NC.mergeConnectedNetworks(NC.d2) //merge the powernet with adjacents powernets
|
||||
NC.mergeConnectedNetworksOnTurf() //merge the powernet with on turf powernets
|
||||
|
||||
if(NC.d2 & (NC.d2 - 1))// if the cable is layed diagonally, check the others 2 possible directions
|
||||
NC.mergeDiagonalsNetworks(NC.d2)
|
||||
|
||||
use(1)
|
||||
|
||||
if (NC.shock(user, 50))
|
||||
if (prob(50)) //fail
|
||||
new/obj/item/stack/cable_coil(NC.loc, 1, NC.color)
|
||||
del(NC) // qdel
|
||||
|
||||
return
|
||||
|
||||
// exisiting cable doesn't point at our position, so see if it's a stub
|
||||
else if(C.d1 == 0)
|
||||
// if so, make it a full cable pointing from it's old direction to our dirn
|
||||
var/nd1 = C.d2 // these will be the new directions
|
||||
var/nd2 = dirn
|
||||
|
||||
|
||||
if(nd1 > nd2) // swap directions to match icons/states
|
||||
nd1 = dirn
|
||||
nd2 = C.d2
|
||||
|
||||
|
||||
for(var/obj/structure/cable/LC in T) // check to make sure there's no matching cable
|
||||
if(LC == C) // skip the cable we're interacting with
|
||||
continue
|
||||
if((LC.d1 == nd1 && LC.d2 == nd2) || (LC.d1 == nd2 && LC.d2 == nd1) ) // make sure no cable matches either direction
|
||||
user << "There's already a cable at that position."
|
||||
return
|
||||
|
||||
|
||||
C.cableColor(color)
|
||||
|
||||
C.d1 = nd1
|
||||
C.d2 = nd2
|
||||
|
||||
C.add_fingerprint()
|
||||
C.updateicon()
|
||||
|
||||
|
||||
C.mergeConnectedNetworks(C.d1) //merge the powernets...
|
||||
C.mergeConnectedNetworks(C.d2) //...in the two new cable directions
|
||||
C.mergeConnectedNetworksOnTurf()
|
||||
|
||||
if(C.d1 & (C.d1 - 1))// if the cable is layed diagonally, check the others 2 possible directions
|
||||
C.mergeDiagonalsNetworks(C.d1)
|
||||
|
||||
if(C.d2 & (C.d2 - 1))// if the cable is layed diagonally, check the others 2 possible directions
|
||||
C.mergeDiagonalsNetworks(C.d2)
|
||||
|
||||
use(1)
|
||||
|
||||
if (C.shock(user, 50))
|
||||
if (prob(50)) //fail
|
||||
new/obj/item/stack/cable_coil(C.loc, 2, C.color)
|
||||
del(C) // qdel
|
||||
return
|
||||
|
||||
C.denode()// this call may have disconnected some cables that terminated on the centre of the turf, if so split the powernets.
|
||||
return
|
||||
|
||||
//////////////////////////////
|
||||
// Misc.
|
||||
/////////////////////////////
|
||||
|
||||
/obj/item/stack/cable_coil/cut
|
||||
item_state = "coil2"
|
||||
|
||||
/obj/item/stack/cable_coil/cut/New(loc)
|
||||
..()
|
||||
src.amount = rand(1,2)
|
||||
pixel_x = rand(-2,2)
|
||||
pixel_y = rand(-2,2)
|
||||
update_icon()
|
||||
update_wclass()
|
||||
|
||||
/obj/item/stack/cable_coil/yellow
|
||||
color = COLOR_YELLOW
|
||||
|
||||
/obj/item/stack/cable_coil/blue
|
||||
color = COLOR_BLUE
|
||||
|
||||
/obj/item/stack/cable_coil/green
|
||||
color = COLOR_GREEN
|
||||
|
||||
/obj/item/stack/cable_coil/pink
|
||||
color = COLOR_PINK
|
||||
|
||||
/obj/item/stack/cable_coil/orange
|
||||
color = COLOR_ORANGE
|
||||
|
||||
/obj/item/stack/cable_coil/cyan
|
||||
color = COLOR_CYAN
|
||||
|
||||
/obj/item/stack/cable_coil/white
|
||||
color = COLOR_WHITE
|
||||
|
||||
/obj/item/stack/cable_coil/random/New()
|
||||
color = pick(COLOR_RED, COLOR_BLUE, COLOR_GREEN, COLOR_WHITE, COLOR_PINK, COLOR_YELLOW, COLOR_CYAN)
|
||||
..()
|
||||
@@ -118,8 +118,7 @@
|
||||
|
||||
explosion(T, devastation_range, heavy_impact_range, light_impact_range, flash_range)
|
||||
|
||||
spawn(1)
|
||||
del(src)
|
||||
qdel(src)
|
||||
|
||||
/obj/item/weapon/cell/proc/corrupt()
|
||||
charge /= 2
|
||||
@@ -144,17 +143,17 @@
|
||||
|
||||
switch(severity)
|
||||
if(1.0)
|
||||
del(src)
|
||||
qdel(src)
|
||||
return
|
||||
if(2.0)
|
||||
if (prob(50))
|
||||
del(src)
|
||||
qdel(src)
|
||||
return
|
||||
if (prob(50))
|
||||
corrupt()
|
||||
if(3.0)
|
||||
if (prob(25))
|
||||
del(src)
|
||||
qdel(src)
|
||||
return
|
||||
if (prob(25))
|
||||
corrupt()
|
||||
|
||||
@@ -19,12 +19,12 @@
|
||||
switch(severity)
|
||||
if(1.0)
|
||||
ChangeTurf(/turf/space)
|
||||
del(src)
|
||||
qdel(src)
|
||||
return
|
||||
if(2.0)
|
||||
if (prob(50))
|
||||
ChangeTurf(/turf/space)
|
||||
del(src)
|
||||
qdel(src)
|
||||
return
|
||||
else
|
||||
return
|
||||
@@ -32,6 +32,6 @@
|
||||
/turf/simulated/floor/engine/blob_act()
|
||||
if (prob(25))
|
||||
ChangeTurf(/turf/space)
|
||||
del(src)
|
||||
qdel(src)
|
||||
return
|
||||
return
|
||||
@@ -9,7 +9,7 @@
|
||||
#define LIGHT_BROKEN 2
|
||||
#define LIGHT_BURNED 3
|
||||
|
||||
|
||||
#define LIGHT_BULB_TEMPERATURE 400 //K - used value for a 60W bulb
|
||||
|
||||
/obj/item/light_fixture_frame
|
||||
name = "light fixture frame"
|
||||
@@ -24,7 +24,7 @@
|
||||
/obj/item/light_fixture_frame/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
if (istype(W, /obj/item/weapon/wrench))
|
||||
new /obj/item/stack/sheet/metal( get_turf(src.loc), sheets_refunded )
|
||||
del(src)
|
||||
qdel(src)
|
||||
return
|
||||
..()
|
||||
|
||||
@@ -56,7 +56,7 @@
|
||||
|
||||
usr.visible_message("[usr.name] attaches [src] to the wall.", \
|
||||
"You attach [src] to the wall.")
|
||||
del(src)
|
||||
qdel(src)
|
||||
|
||||
/obj/item/light_fixture_frame/small
|
||||
name = "small light fixture frame"
|
||||
@@ -111,7 +111,7 @@
|
||||
user.visible_message("[user.name] deconstructs [src].", \
|
||||
"You deconstruct [src].", "You hear a noise.")
|
||||
playsound(src.loc, 'sound/items/Deconstruct.ogg', 75, 1)
|
||||
del(src)
|
||||
qdel(src)
|
||||
if (src.stage == 2)
|
||||
usr << "You have to remove the wires first."
|
||||
return
|
||||
@@ -169,7 +169,7 @@
|
||||
|
||||
newlight.dir = src.dir
|
||||
src.transfer_fingerprints_to(newlight)
|
||||
del(src)
|
||||
qdel(src)
|
||||
return
|
||||
..()
|
||||
|
||||
@@ -253,7 +253,7 @@
|
||||
spawn(1)
|
||||
update(0)
|
||||
|
||||
/obj/machinery/light/Del()
|
||||
/obj/machinery/light/Destroy()
|
||||
var/area/A = get_area(src)
|
||||
if(A)
|
||||
on = 0
|
||||
@@ -370,7 +370,7 @@
|
||||
update()
|
||||
|
||||
user.drop_item() //drop the item to update overlays and such
|
||||
del(L)
|
||||
qdel(L)
|
||||
|
||||
if(on && rigged)
|
||||
|
||||
@@ -424,7 +424,7 @@
|
||||
newlight.fingerprints = src.fingerprints
|
||||
newlight.fingerprintshidden = src.fingerprintshidden
|
||||
newlight.fingerprintslast = src.fingerprintslast
|
||||
del(src)
|
||||
qdel(src)
|
||||
return
|
||||
|
||||
user << "You stick \the [W] into the light socket!"
|
||||
@@ -487,11 +487,13 @@
|
||||
var/mob/living/carbon/human/H = user
|
||||
|
||||
if(istype(H))
|
||||
|
||||
if(H.gloves)
|
||||
if(H.species.heat_level_1 > LIGHT_BULB_TEMPERATURE)
|
||||
prot = 1
|
||||
else if(H.gloves)
|
||||
var/obj/item/clothing/gloves/G = H.gloves
|
||||
if(G.max_heat_protection_temperature)
|
||||
prot = (G.max_heat_protection_temperature > 360)
|
||||
if(G.max_heat_protection_temperature > LIGHT_BULB_TEMPERATURE)
|
||||
prot = 1
|
||||
else
|
||||
prot = 1
|
||||
|
||||
@@ -579,7 +581,7 @@
|
||||
/obj/machinery/light/ex_act(severity)
|
||||
switch(severity)
|
||||
if(1.0)
|
||||
del(src)
|
||||
qdel(src)
|
||||
return
|
||||
if(2.0)
|
||||
if (prob(75))
|
||||
@@ -629,7 +631,7 @@
|
||||
sleep(2)
|
||||
explosion(T, 0, 0, 2, 2)
|
||||
sleep(1)
|
||||
del(src)
|
||||
qdel(src)
|
||||
|
||||
// the light item
|
||||
// can be tube or bulb subtypes
|
||||
|
||||
@@ -113,7 +113,7 @@
|
||||
I.loc = src.loc
|
||||
new_frame.state = 2
|
||||
new_frame.icon_state = "box_1"
|
||||
del(src)
|
||||
qdel(src)
|
||||
|
||||
attack_hand(mob/user as mob)
|
||||
..()
|
||||
|
||||
@@ -76,7 +76,7 @@
|
||||
|
||||
/obj/machinery/power/port_gen/proc/explode()
|
||||
explosion(src.loc, -1, 3, 5, -1)
|
||||
del(src)
|
||||
qdel(src)
|
||||
|
||||
#define TEMPERATURE_DIVISOR 40
|
||||
#define TEMPERATURE_CHANGE_MAX 20
|
||||
@@ -125,7 +125,7 @@
|
||||
component_parts += new board_path(src)
|
||||
RefreshParts()
|
||||
|
||||
/obj/machinery/power/port_gen/pacman/Del()
|
||||
/obj/machinery/power/port_gen/pacman/Destroy()
|
||||
DropFuel()
|
||||
..()
|
||||
|
||||
@@ -301,7 +301,7 @@
|
||||
|
||||
new_frame.state = 2
|
||||
new_frame.icon_state = "box_1"
|
||||
del(src)
|
||||
qdel(src)
|
||||
|
||||
/obj/machinery/power/port_gen/pacman/attack_hand(mob/user as mob)
|
||||
..()
|
||||
@@ -342,6 +342,7 @@
|
||||
ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
|
||||
if (!ui)
|
||||
ui = new(user, src, ui_key, "pacman.tmpl", src.name, 500, 560)
|
||||
ui.set_initial_data(data)
|
||||
ui.open()
|
||||
ui.set_auto_update(1)
|
||||
|
||||
@@ -423,7 +424,7 @@
|
||||
L.apply_effect(max(20, round(rads/get_dist(L,src))), IRRADIATE)
|
||||
|
||||
explosion(src.loc, 3, 3, 5, 3)
|
||||
del(src)
|
||||
qdel(src)
|
||||
|
||||
/obj/machinery/power/port_gen/pacman/mrs
|
||||
name = "M.R.S.P.A.C.M.A.N.-type Portable Generator"
|
||||
@@ -445,4 +446,4 @@
|
||||
/obj/machinery/power/port_gen/pacman/mrs/explode()
|
||||
//no special effects, but the explosion is pretty big (same as a supermatter shard).
|
||||
explosion(src.loc, 3, 6, 12, 16, 1)
|
||||
del(src)
|
||||
qdel(src)
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
idle_power_usage = 0
|
||||
active_power_usage = 0
|
||||
|
||||
/obj/machinery/power/Del()
|
||||
/obj/machinery/power/Destroy()
|
||||
disconnect_from_network()
|
||||
..()
|
||||
|
||||
@@ -235,7 +235,7 @@
|
||||
// rebuild all power networks from scratch - only called at world creation or by the admin verb
|
||||
/proc/makepowernets()
|
||||
for(var/datum/powernet/PN in powernets)
|
||||
del(PN)
|
||||
qdel(PN)
|
||||
powernets.Cut()
|
||||
|
||||
for(var/obj/structure/cable/PC in cable_list)
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
powernets += src
|
||||
..()
|
||||
|
||||
/datum/powernet/Del()
|
||||
/datum/powernet/Destroy()
|
||||
powernets -= src
|
||||
..()
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
cables -= C
|
||||
C.powernet = null
|
||||
if(is_empty())//the powernet is now empty...
|
||||
del(src)///... delete it - qdel
|
||||
qdel(src)///... delete it
|
||||
|
||||
//add a cable to the current powernet
|
||||
//Warning : this proc DON'T check if the cable exists
|
||||
@@ -62,7 +62,7 @@
|
||||
nodes -=M
|
||||
M.powernet = null
|
||||
if(is_empty())//the powernet is now empty...
|
||||
del(src)///... delete it - qdel
|
||||
qdel(src)///... delete it - qdel
|
||||
|
||||
|
||||
//add a power machine to the current powernet
|
||||
|
||||
@@ -47,7 +47,7 @@ Deuterium-tritium fusion: 4.5 x 10^7 K
|
||||
owned_core = core
|
||||
|
||||
if(!owned_core)
|
||||
del(src)
|
||||
qdel(src)
|
||||
|
||||
//create the gimmicky things to handle field collisions
|
||||
var/obj/effect/rust_particle_catcher/catcher
|
||||
@@ -118,7 +118,7 @@ Deuterium-tritium fusion: 4.5 x 10^7 K
|
||||
/obj/effect/rust_em_field/process()
|
||||
//make sure the field generator is still intact
|
||||
if(!owned_core)
|
||||
del(src)
|
||||
qdel(src)
|
||||
|
||||
//handle radiation
|
||||
if(!radiator)
|
||||
@@ -427,10 +427,10 @@ Deuterium-tritium fusion: 4.5 x 10^7 K
|
||||
AddParticles(reactant, reactants_reacting_pool[reactant])
|
||||
//world << "retained: [reactant], [reactants_reacting_pool[reactant]]"
|
||||
|
||||
/obj/effect/rust_em_field/Del()
|
||||
/obj/effect/rust_em_field/Destroy()
|
||||
//radiate everything in one giant burst
|
||||
for(var/obj/effect/rust_particle_catcher/catcher in particle_catchers)
|
||||
del (catcher)
|
||||
qdel (catcher)
|
||||
RadiateAll()
|
||||
|
||||
processing_objects.Remove(src)
|
||||
|
||||
@@ -268,7 +268,7 @@ max volume of phoron storeable by the field = the total volume of a number of ti
|
||||
//todo: safety checks for field status
|
||||
if(owned_field)
|
||||
icon_state = "core0"
|
||||
del(owned_field)
|
||||
qdel(owned_field)
|
||||
luminosity = 0
|
||||
use_power = 1
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
/obj/item/rust_fuel_assembly_port_frame/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
if (istype(W, /obj/item/weapon/wrench))
|
||||
new /obj/item/stack/sheet/plasteel( get_turf(src.loc), 12 )
|
||||
del(src)
|
||||
qdel(src)
|
||||
return
|
||||
..()
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
usr << "\red Port cannot be placed in this area."
|
||||
return
|
||||
new /obj/machinery/rust_fuel_assembly_port(loc, ndir, 1)
|
||||
del(src)
|
||||
qdel(src)
|
||||
|
||||
//construction steps
|
||||
/obj/machinery/rust_fuel_assembly_port/New(turf/loc, var/ndir, var/building=0)
|
||||
@@ -110,7 +110,7 @@
|
||||
if(do_after(user, 10))
|
||||
has_electronics &= 1
|
||||
user << "You place the port control board inside the frame."
|
||||
del(W)
|
||||
qdel(W)
|
||||
return
|
||||
|
||||
else if (istype(W, /obj/item/weapon/weldingtool) && opened && !has_electronics)
|
||||
@@ -127,7 +127,7 @@
|
||||
"\red [src] has been cut away from the wall by [user.name].",\
|
||||
"You detached the port frame.",\
|
||||
"\red You hear welding.")
|
||||
del(src)
|
||||
qdel(src)
|
||||
return
|
||||
|
||||
..()
|
||||
|
||||
@@ -25,7 +25,7 @@ var/const/max_assembly_amount = 300
|
||||
/obj/machinery/rust_fuel_compressor/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
if (istype(W, /obj/item/weapon/rcd_ammo))
|
||||
compressed_matter += 10
|
||||
del(W)
|
||||
qdel(W)
|
||||
return
|
||||
..()
|
||||
|
||||
@@ -93,7 +93,7 @@ var/const/max_assembly_amount = 300
|
||||
break
|
||||
//world << "\blue [reagent]: new_assembly_quantities[reagent]<br>"
|
||||
if(fail)
|
||||
del(F)
|
||||
qdel(F)
|
||||
compressed_matter = old_matter
|
||||
usr << "\red \icon[src] [src] flashes red: \'Out of matter.\'"
|
||||
else
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
/obj/item/rust_fuel_compressor_frame/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
if (istype(W, /obj/item/weapon/wrench))
|
||||
new /obj/item/stack/sheet/plasteel( get_turf(src.loc), 12 )
|
||||
del(src)
|
||||
qdel(src)
|
||||
return
|
||||
..()
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
usr << "\red Compressor cannot be placed in this area."
|
||||
return
|
||||
new /obj/machinery/rust_fuel_assembly_port(loc, ndir, 1)
|
||||
del(src)
|
||||
qdel(src)
|
||||
|
||||
//construction steps
|
||||
/obj/machinery/rust_fuel_compressor/New(turf/loc, var/ndir, var/building=0)
|
||||
@@ -137,7 +137,7 @@
|
||||
if(do_after(user, 10))
|
||||
has_electronics &= 1
|
||||
user << "You place the circuitboard inside the frame."
|
||||
del(W)
|
||||
qdel(W)
|
||||
return
|
||||
|
||||
else if (istype(W, /obj/item/weapon/weldingtool) && opened && !has_electronics)
|
||||
@@ -154,7 +154,7 @@
|
||||
"\red [src] has been cut away from the wall by [user.name].",\
|
||||
"You detached the compressor frame.",\
|
||||
"\red You hear welding.")
|
||||
del(src)
|
||||
qdel(src)
|
||||
return
|
||||
|
||||
..()
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
else
|
||||
time_alive -= 0.1
|
||||
if(time_alive < 0)
|
||||
del(src)
|
||||
qdel(src)
|
||||
|
||||
//radiate mobs nearby here
|
||||
//
|
||||
|
||||
@@ -14,11 +14,11 @@
|
||||
for(var/obj/machinery/rust/em_field/field in range(6))
|
||||
parent = field
|
||||
if(!parent)
|
||||
del(src)*/
|
||||
qdel(src)*/
|
||||
|
||||
/obj/effect/rust_particle_catcher/process()
|
||||
if(!parent)
|
||||
del(src)
|
||||
qdel(src)
|
||||
|
||||
/obj/effect/rust_particle_catcher/proc/SetSize(var/newsize)
|
||||
name = "collector [newsize]"
|
||||
|
||||
@@ -1,7 +1,4 @@
|
||||
// POWERNET SENSOR MONITORING CONSOLE
|
||||
//
|
||||
// Last Change 31.12.2014 by Atlantis
|
||||
//
|
||||
// Connects to powernet sensors and loads data from them. Shows this data to the user.
|
||||
// Newly supports NanoUI.
|
||||
|
||||
@@ -22,18 +19,14 @@
|
||||
active_power_usage = 300
|
||||
var/obj/nano_module/power_monitor/power_monitor
|
||||
|
||||
// Proc: process()
|
||||
// Parameters: None
|
||||
// Description: Checks the sensors for alerts. If change (alerts cleared or detected) occurs, calls for icon update.
|
||||
// Checks the sensors for alerts. If change (alerts cleared or detected) occurs, calls for icon update.
|
||||
/obj/machinery/computer/power_monitor/process()
|
||||
var/alert = check_warnings()
|
||||
if(alert != alerting)
|
||||
alerting = !alerting
|
||||
update_icon()
|
||||
|
||||
// Proc: update_icon()
|
||||
// Parameters: None
|
||||
// Description: Updates icon of this computer according to current status.
|
||||
// Updates icon of this computer according to current status.
|
||||
/obj/machinery/computer/power_monitor/update_icon()
|
||||
if(stat & BROKEN)
|
||||
icon_state = "powerb"
|
||||
@@ -46,17 +39,12 @@
|
||||
return
|
||||
icon_state = "power"
|
||||
|
||||
// Proc: New()
|
||||
// Parameters: None
|
||||
// Description: On creation automatically connects to active sensors. This is delayed to ensure sensors already exist.
|
||||
// On creation automatically connects to active sensors. This is delayed to ensure sensors already exist.
|
||||
/obj/machinery/computer/power_monitor/New()
|
||||
..()
|
||||
spawn(50)
|
||||
power_monitor = new(src)
|
||||
power_monitor = new(src)
|
||||
|
||||
// Proc: attack_hand()
|
||||
// Parameters: None
|
||||
// Description: On user click opens the UI of this computer.
|
||||
// On user click opens the UI of this computer.
|
||||
/obj/machinery/computer/power_monitor/attack_hand(mob/user)
|
||||
add_fingerprint(user)
|
||||
|
||||
@@ -64,16 +52,12 @@
|
||||
return
|
||||
ui_interact(user)
|
||||
|
||||
// Proc: ui_interact()
|
||||
// Parameters: 4 (standard NanoUI parameters)
|
||||
// Description: Uses dark magic to operate the NanoUI of this computer.
|
||||
// Uses dark magic to operate the NanoUI of this computer.
|
||||
/obj/machinery/computer/power_monitor/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1)
|
||||
power_monitor.ui_interact(user, ui_key, ui, force_open)
|
||||
|
||||
|
||||
// Proc: check_warnings()
|
||||
// Parameters: None
|
||||
// Description: Verifies if any warnings were registered by connected sensors.
|
||||
// Verifies if any warnings were registered by connected sensors.
|
||||
/obj/machinery/computer/power_monitor/proc/check_warnings()
|
||||
for(var/obj/machinery/power/sensor/S in power_monitor.grid_sensors)
|
||||
if(S.check_grid_warning())
|
||||
|
||||
@@ -0,0 +1,138 @@
|
||||
#define I_SINGULO "singulo"
|
||||
|
||||
/atom/proc/singularity_act()
|
||||
return
|
||||
|
||||
/atom/proc/singularity_pull()
|
||||
return
|
||||
|
||||
/mob/living/singularity_act()
|
||||
investigate_log("has been consumed by a singularity", I_SINGULO)
|
||||
gib()
|
||||
return 20
|
||||
|
||||
/mob/living/singularity_pull(S)
|
||||
step_towards(src, S)
|
||||
|
||||
/mob/living/carbon/human/singularity_act()
|
||||
var/gain = 20
|
||||
if(mind)
|
||||
if((mind.assigned_role == "Station Engineer") || (mind.assigned_role == "Chief Engineer"))
|
||||
gain = 100
|
||||
if(mind.assigned_role == "Assistant")
|
||||
gain = rand(0, 300)
|
||||
investigate_log(I_SINGULO,"has been consumed by a singularity", I_SINGULO)
|
||||
gib()
|
||||
return gain
|
||||
|
||||
/mob/living/carbon/human/singularity_pull(S, current_size)
|
||||
if(current_size >= STAGE_THREE)
|
||||
var/list/handlist = list(l_hand, r_hand)
|
||||
for(var/obj/item/hand in handlist)
|
||||
if(prob(current_size*5) && hand.w_class >= ((11-current_size)/2) && u_equip(hand))
|
||||
step_towards(hand, src)
|
||||
src << "<span class = 'warning'>The [S] pulls \the [hand] from your grip!</span>"
|
||||
apply_effect(current_size * 3, IRRADIATE)
|
||||
if(shoes)
|
||||
if(shoes.flags & NOSLIP) return 0
|
||||
..()
|
||||
|
||||
/obj/singularity_act()
|
||||
ex_act(1)
|
||||
if(src)
|
||||
qdel(src)
|
||||
return 2
|
||||
|
||||
/obj/singularity_pull(S, current_size)
|
||||
if(anchored)
|
||||
if(current_size >= STAGE_FIVE)
|
||||
step_towards(src, S)
|
||||
else
|
||||
step_towards(src, S)
|
||||
|
||||
/obj/effect/beam/singularity_pull()
|
||||
return
|
||||
|
||||
/obj/effect/overlay/singularity_pull()
|
||||
return
|
||||
|
||||
/obj/item/singularity_pull(S, current_size)
|
||||
spawn(0) //this is needed or multiple items will be thrown sequentially and not simultaneously
|
||||
if(current_size >= STAGE_FOUR)
|
||||
//throw_at(S, 14, 3)
|
||||
step_towards(src,S)
|
||||
sleep(1)
|
||||
step_towards(src,S)
|
||||
else if(current_size > STAGE_ONE)
|
||||
step_towards(src,S)
|
||||
else ..()
|
||||
|
||||
/obj/machinery/atmospherics/pipe/singularity_pull()
|
||||
return
|
||||
|
||||
/obj/machinery/power/supermatter/shard/singularity_act()
|
||||
src.loc = null
|
||||
qdel(src)
|
||||
return 5000
|
||||
|
||||
/obj/machinery/power/supermatter/singularity_act()
|
||||
var/prints = ""
|
||||
if(src.fingerprintshidden)
|
||||
prints = ", all touchers : " + src.fingerprintshidden
|
||||
|
||||
SetUniversalState(/datum/universal_state/supermatter_cascade)
|
||||
log_admin("New super singularity made by eating a SM crystal [prints]. Last touched by [src.fingerprintslast].")
|
||||
message_admins("New super singularity made by eating a SM crystal [prints]. Last touched by [src.fingerprintslast].")
|
||||
src.loc = null
|
||||
qdel(src)
|
||||
return 50000
|
||||
|
||||
/obj/item/projectile/beam/emitter/singularity_pull()
|
||||
return
|
||||
|
||||
/obj/item/weapon/storage/backpack/holding/singularity_act(S, current_size)
|
||||
var/dist = max((current_size - 2), 1)
|
||||
explosion(src.loc,(dist),(dist*2),(dist*4))
|
||||
return 1000
|
||||
|
||||
/turf/singularity_act(S, current_size)
|
||||
if(intact)
|
||||
for(var/obj/O in contents)
|
||||
if(O.level != 1)
|
||||
continue
|
||||
if(O.invisibility == 101)
|
||||
O.singularity_act(src, current_size)
|
||||
ChangeTurf(/turf/space)
|
||||
return 2
|
||||
|
||||
/turf/simulated/wall/singularity_pull(S, current_size)
|
||||
if(current_size >= STAGE_FIVE)
|
||||
if(prob(75))
|
||||
dismantle_wall()
|
||||
return
|
||||
if(current_size == STAGE_FOUR)
|
||||
if(prob(30))
|
||||
dismantle_wall()
|
||||
|
||||
/turf/simulated/wall/r_wall/singularity_pull(S, current_size)
|
||||
if(current_size >= STAGE_FIVE)
|
||||
if(prob(30))
|
||||
dismantle_wall()
|
||||
|
||||
/turf/space/singularity_act()
|
||||
return
|
||||
|
||||
/*******************
|
||||
* Nar-Sie Act/Pull *
|
||||
*******************/
|
||||
/atom/proc/singuloCanEat()
|
||||
return 1
|
||||
|
||||
/mob/dead/singuloCanEat()
|
||||
return 0
|
||||
|
||||
/mob/eye/singuloCanEat()
|
||||
return 0
|
||||
|
||||
/mob/new_player/singuloCanEat()
|
||||
return 0
|
||||
@@ -21,7 +21,7 @@ var/global/list/rad_collectors = list()
|
||||
..()
|
||||
rad_collectors += src
|
||||
|
||||
/obj/machinery/power/rad_collector/Del()
|
||||
/obj/machinery/power/rad_collector/Destroy()
|
||||
rad_collectors -= src
|
||||
..()
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
var/obj/machinery/field_generator/FG2 = null
|
||||
var/hasShocked = 0 //Used to add a delay between shocks. In some cases this used to crash servers by spawning hundreds of sparks every second.
|
||||
|
||||
/obj/machinery/containment_field/Del()
|
||||
/obj/machinery/containment_field/Destroy()
|
||||
if(FG1 && !FG1.clean_up)
|
||||
FG1.cleanup()
|
||||
if(FG2 && !FG2.clean_up)
|
||||
@@ -54,7 +54,7 @@
|
||||
if(hasShocked)
|
||||
return 0
|
||||
if(!FG1 || !FG2)
|
||||
del(src)
|
||||
qdel(src)
|
||||
return 0
|
||||
if(isliving(user))
|
||||
hasShocked = 1
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
if(state == 2 && anchored)
|
||||
connect_to_network()
|
||||
|
||||
/obj/machinery/power/emitter/Del()
|
||||
/obj/machinery/power/emitter/Destroy()
|
||||
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])","singulo")
|
||||
|
||||
@@ -31,7 +31,7 @@ field_generator power level display
|
||||
var/list/obj/machinery/containment_field/fields
|
||||
var/list/obj/machinery/field_generator/connected_gens
|
||||
var/clean_up = 0
|
||||
|
||||
|
||||
//If keeping field generators powered is hard then increase the emitter active power usage.
|
||||
var/gen_power_draw = 5500 //power needed per generator
|
||||
var/field_power_draw = 2000 //power needed per field object
|
||||
@@ -61,7 +61,6 @@ field_generator power level display
|
||||
connected_gens = list()
|
||||
return
|
||||
|
||||
|
||||
/obj/machinery/field_generator/process()
|
||||
if(Varedit_start == 1)
|
||||
if(active == 0)
|
||||
@@ -177,7 +176,7 @@ field_generator power level display
|
||||
return 0
|
||||
|
||||
|
||||
/obj/machinery/field_generator/Del()
|
||||
/obj/machinery/field_generator/Destroy()
|
||||
src.cleanup()
|
||||
..()
|
||||
|
||||
@@ -231,22 +230,22 @@ field_generator power level display
|
||||
//Tries to draw the needed power from our own power reserve, or connected generators if we can. Returns the amount of power we were able to get.
|
||||
/obj/machinery/field_generator/proc/draw_power(var/draw = 0, var/list/flood_list = list())
|
||||
flood_list += src
|
||||
|
||||
|
||||
if(src.power >= draw)//We have enough power
|
||||
src.power -= draw
|
||||
return draw
|
||||
|
||||
|
||||
//Need more power
|
||||
var/actual_draw = src.power //already checked that power < draw
|
||||
src.power = 0
|
||||
|
||||
|
||||
for(var/obj/machinery/field_generator/FG in connected_gens)
|
||||
if (FG in flood_list)
|
||||
continue
|
||||
actual_draw += FG.draw_power(draw - actual_draw, flood_list) //since the flood list reference is shared this actually works.
|
||||
if (actual_draw >= draw)
|
||||
return actual_draw
|
||||
|
||||
|
||||
return actual_draw
|
||||
|
||||
/obj/machinery/field_generator/proc/start_fields()
|
||||
@@ -325,7 +324,7 @@ field_generator power level display
|
||||
for (var/obj/machinery/containment_field/F in fields)
|
||||
if (isnull(F))
|
||||
continue
|
||||
del(F)
|
||||
qdel(F)
|
||||
fields = list()
|
||||
for(var/obj/machinery/field_generator/FG in connected_gens)
|
||||
if (isnull(FG))
|
||||
@@ -343,7 +342,7 @@ field_generator power level display
|
||||
//I want to avoid using global variables.
|
||||
spawn(1)
|
||||
var/temp = 1 //stops spam
|
||||
for(var/obj/machinery/singularity/O in machines)
|
||||
for(var/obj/singularity/O in machines)
|
||||
if(O.last_warning && temp)
|
||||
if((world.time - O.last_warning) > 50) //to stop message-spam
|
||||
temp = 0
|
||||
|
||||
@@ -12,8 +12,8 @@
|
||||
/obj/machinery/the_singularitygen/process()
|
||||
var/turf/T = get_turf(src)
|
||||
if(src.energy >= 200)
|
||||
new /obj/machinery/singularity/(T, 50)
|
||||
if(src) del(src)
|
||||
new /obj/singularity/(T, 50)
|
||||
if(src) qdel(src)
|
||||
|
||||
/obj/machinery/the_singularitygen/attackby(obj/item/W, mob/user)
|
||||
if(istype(W, /obj/item/weapon/wrench))
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/area/engineering/power_alert(var/alarming)
|
||||
if (alarming)
|
||||
investigate_log("has a power alarm!","singulo")
|
||||
..()
|
||||
..()
|
||||
|
||||
@@ -0,0 +1,367 @@
|
||||
var/global/narsie_behaviour = "CultStation13"
|
||||
var/global/list/narsie_list = list()
|
||||
/obj/singularity/narsie //Moving narsie to its own file for the sake of being clearer
|
||||
name = "Nar-Sie"
|
||||
desc = "Your mind begins to bubble and ooze as it tries to comprehend what it sees."
|
||||
icon = 'icons/obj/narsie.dmi'
|
||||
icon_state = "narsie-small"
|
||||
pixel_x = -236
|
||||
pixel_y = -256
|
||||
|
||||
current_size = 9 //It moves/eats like a max-size singulo, aside from range. --NEO.
|
||||
contained = 0 // Are we going to move around?
|
||||
dissipate = 0 // Do we lose energy over time?
|
||||
grav_pull = 10 //How many tiles out do we pull?
|
||||
consume_range = 3 //How many tiles out do we eat
|
||||
|
||||
|
||||
/obj/singularity/narsie/New()
|
||||
..()
|
||||
narsie_list.Add(src)
|
||||
|
||||
/obj/singularity/narsie/Destroy()
|
||||
narsie_list.Remove(src)
|
||||
..()
|
||||
|
||||
/obj/singularity/narsie/large
|
||||
name = "Nar-Sie"
|
||||
icon = 'icons/obj/narsie.dmi'
|
||||
icon_state = "narsie"//mobs perceive the geometer of blood through their see_narsie proc
|
||||
|
||||
// Pixel stuff centers Narsie.
|
||||
pixel_x = -236
|
||||
pixel_y = -256
|
||||
luminosity = 1
|
||||
l_color = "#3e0000"
|
||||
|
||||
current_size = 12
|
||||
consume_range = 12 // How many tiles out do we eat.
|
||||
var/announce=1
|
||||
var/narnar = 1
|
||||
|
||||
/obj/singularity/narsie/large/New()
|
||||
..()
|
||||
if(announce)
|
||||
world << "<font size='15' color='red'><b>[uppertext(name)] HAS RISEN</b></font>"
|
||||
world << sound('sound/effects/wind/wind_5_1.ogg')
|
||||
|
||||
narsie_spawn_animation()
|
||||
|
||||
if(narnar)
|
||||
SetUniversalState(/datum/universal_state/hell)
|
||||
|
||||
spawn(10 SECONDS)
|
||||
if(emergency_shuttle && emergency_shuttle.can_call())
|
||||
emergency_shuttle.call_evac()
|
||||
emergency_shuttle.launch_time = 0 // Cannot recall
|
||||
|
||||
/obj/singularity/narsie/process()
|
||||
eat()
|
||||
|
||||
if (!target || prob(5))
|
||||
pickcultist()
|
||||
|
||||
move()
|
||||
|
||||
if (prob(25))
|
||||
mezzer()
|
||||
|
||||
/obj/singularity/narsie/large/eat()
|
||||
set background = BACKGROUND_ENABLED
|
||||
|
||||
for (var/turf/A in orange(consume_range, src))
|
||||
consume(A)
|
||||
|
||||
/obj/singularity/narsie/mezzer()
|
||||
for(var/mob/living/carbon/M in oviewers(8, src))
|
||||
if(M.stat == CONSCIOUS)
|
||||
if(M.status_flags & GODMODE)
|
||||
continue
|
||||
if(!iscultist(M))
|
||||
M << "<span class='danger'> You feel your sanity crumble away in an instant as you gaze upon [src.name]...</span>"
|
||||
M.apply_effect(3, STUN)
|
||||
|
||||
|
||||
/obj/singularity/narsie/large/Bump(atom/A)
|
||||
if(!narnar) return
|
||||
if(isturf(A))
|
||||
narsiewall(A)
|
||||
else if(istype(A, /obj/structure/cult))
|
||||
qdel(A)
|
||||
|
||||
/obj/singularity/narsie/large/Bumped(atom/A)
|
||||
if(!narnar) return
|
||||
if(isturf(A))
|
||||
narsiewall(A)
|
||||
else if(istype(A, /obj/structure/cult))
|
||||
qdel(A)
|
||||
|
||||
/obj/singularity/narsie/move(var/force_move = 0)
|
||||
if(!move_self)
|
||||
return 0
|
||||
|
||||
var/movement_dir = pick(alldirs - last_failed_movement)
|
||||
|
||||
if(force_move)
|
||||
movement_dir = force_move
|
||||
|
||||
if(target && prob(60))
|
||||
movement_dir = get_dir(src,target)
|
||||
|
||||
spawn(0)
|
||||
step(src, movement_dir)
|
||||
spawn(1)
|
||||
step(src, movement_dir)
|
||||
return 1
|
||||
|
||||
/obj/singularity/narsie/large/move(var/force_move = 0)
|
||||
if(!move_self)
|
||||
return 0
|
||||
|
||||
var/movement_dir = pick(alldirs - last_failed_movement)
|
||||
|
||||
if(force_move)
|
||||
movement_dir = force_move
|
||||
|
||||
if(target && prob(60))
|
||||
movement_dir = get_dir(src,target)
|
||||
spawn(0)
|
||||
step(src, movement_dir)
|
||||
narsiefloor(get_turf(loc))
|
||||
for(var/mob/M in player_list)
|
||||
if(M.client)
|
||||
M.see_narsie(src,movement_dir)
|
||||
spawn(10)
|
||||
step(src, movement_dir)
|
||||
narsiefloor(get_turf(loc))
|
||||
for(var/mob/M in player_list)
|
||||
if(M.client)
|
||||
M.see_narsie(src,movement_dir)
|
||||
return 1
|
||||
|
||||
/obj/singularity/narsie/proc/narsiefloor(var/turf/T)//leaving "footprints"
|
||||
if(!(istype(T, /turf/simulated/wall/cult)||istype(T, /turf/space)))
|
||||
if(T.icon_state != "cult-narsie")
|
||||
T.desc = "something that goes beyond your understanding went this way"
|
||||
T.icon_state = "cult-narsie"
|
||||
T.luminosity = 1
|
||||
|
||||
/obj/singularity/narsie/proc/narsiewall(var/turf/T)
|
||||
T.desc = "An opening has been made on that wall, but who can say if what you seek truly lies on the other side?"
|
||||
T.icon = 'icons/turf/walls.dmi'
|
||||
T.icon_state = "cult-narsie"
|
||||
T.opacity = 0
|
||||
T.density = 0
|
||||
luminosity = 1
|
||||
|
||||
/obj/singularity/narsie/large/consume(const/atom/A) //Has its own consume proc because it doesn't need energy and I don't want BoHs to explode it. --NEO
|
||||
//NEW BEHAVIOUR
|
||||
if(narsie_behaviour == "CultStation13")
|
||||
//MOB PROCESSING
|
||||
new_narsie(A)
|
||||
|
||||
//OLD BEHAVIOUR
|
||||
else if(narsie_behaviour == "Nar-Singulo")
|
||||
old_narsie(A)
|
||||
|
||||
/obj/singularity/narsie/proc/new_narsie(const/atom/A)
|
||||
if (istype(A, /mob/) && (get_dist(A, src) <= 7))
|
||||
var/mob/M = A
|
||||
|
||||
if(M.status_flags & GODMODE)
|
||||
return 0
|
||||
|
||||
M.cultify()
|
||||
|
||||
//ITEM PROCESSING
|
||||
else if (istype(A, /obj/))
|
||||
var/obj/O = A
|
||||
O.cultify()
|
||||
|
||||
//TURF PROCESSING
|
||||
else if (isturf(A))
|
||||
var/dist = get_dist(A, src)
|
||||
|
||||
for (var/atom/movable/AM in A.contents)
|
||||
if (dist <= consume_range)
|
||||
consume(AM)
|
||||
continue
|
||||
|
||||
if (dist <= consume_range && !istype(A, /turf/space))
|
||||
var/turf/T = A
|
||||
if(T.holy)
|
||||
T.holy = 0 //Nar-Sie doesn't give a shit about sacred grounds.
|
||||
T.cultify()
|
||||
|
||||
/obj/singularity/narsie/proc/old_narsie(const/atom/A)
|
||||
if(!(A.singuloCanEat()))
|
||||
return 0
|
||||
|
||||
if (istype(A, /mob/living/))
|
||||
var/mob/living/C2 = A
|
||||
|
||||
if(C2.status_flags & GODMODE)
|
||||
return 0
|
||||
|
||||
C2.dust() // Changed from gib(), just for less lag.
|
||||
|
||||
else if (istype(A, /obj/))
|
||||
qdel(A)
|
||||
|
||||
if (A)
|
||||
qdel(A)
|
||||
else if (isturf(A))
|
||||
var/dist = get_dist(A, src)
|
||||
|
||||
for (var/atom/movable/AM2 in A.contents)
|
||||
if (AM2 == src) // This is the snowflake.
|
||||
continue
|
||||
|
||||
if (dist <= consume_range)
|
||||
consume(AM2)
|
||||
continue
|
||||
|
||||
if (dist <= consume_range && !istype(A, /turf/space))
|
||||
var/turf/T2 = A
|
||||
T2.ChangeTurf(/turf/space)
|
||||
|
||||
/obj/singularity/narsie/consume(const/atom/A) //This one is for the small ones.
|
||||
if(!(A.singuloCanEat()))
|
||||
return 0
|
||||
|
||||
if (istype(A, /mob/living/))
|
||||
var/mob/living/C2 = A
|
||||
|
||||
if(C2.status_flags & GODMODE)
|
||||
return 0
|
||||
|
||||
C2.dust() // Changed from gib(), just for less lag.
|
||||
|
||||
else if (istype(A, /obj/))
|
||||
qdel(A)
|
||||
|
||||
if (A)
|
||||
qdel(A)
|
||||
else if (isturf(A))
|
||||
var/dist = get_dist(A, src)
|
||||
|
||||
for (var/atom/movable/AM2 in A.contents)
|
||||
if (AM2 == src) // This is the snowflake.
|
||||
continue
|
||||
|
||||
if (dist <= consume_range)
|
||||
consume(AM2)
|
||||
continue
|
||||
|
||||
if (dist > consume_range)
|
||||
if(!(AM2.singuloCanEat()))
|
||||
continue
|
||||
|
||||
if (101 == AM2.invisibility)
|
||||
continue
|
||||
|
||||
spawn (0)
|
||||
AM2.singularity_pull(src, src.current_size)
|
||||
|
||||
if (dist <= consume_range && !istype(A, /turf/space))
|
||||
var/turf/T2 = A
|
||||
T2.ChangeTurf(/turf/space)
|
||||
|
||||
/obj/singularity/narsie/ex_act(severity) //No throwing bombs at it either. --NEO
|
||||
return
|
||||
|
||||
/obj/singularity/narsie/proc/pickcultist() //Narsie rewards his cultists with being devoured first, then picks a ghost to follow. --NEO
|
||||
var/list/cultists = list()
|
||||
for(var/datum/mind/cult_nh_mind in cult.current_antagonists)
|
||||
if(!cult_nh_mind.current)
|
||||
continue
|
||||
if(cult_nh_mind.current.stat)
|
||||
continue
|
||||
var/turf/pos = get_turf(cult_nh_mind.current)
|
||||
if(pos.z != src.z)
|
||||
continue
|
||||
cultists += cult_nh_mind.current
|
||||
if(cultists.len)
|
||||
acquire(pick(cultists))
|
||||
return
|
||||
//If there was living cultists, it picks one to follow.
|
||||
for(var/mob/living/carbon/human/food in living_mob_list)
|
||||
if(food.stat)
|
||||
continue
|
||||
var/turf/pos = get_turf(food)
|
||||
if(pos.z != src.z)
|
||||
continue
|
||||
cultists += food
|
||||
if(cultists.len)
|
||||
acquire(pick(cultists))
|
||||
return
|
||||
//no living cultists, pick a living human instead.
|
||||
for(var/mob/dead/observer/ghost in player_list)
|
||||
if(!ghost.client)
|
||||
continue
|
||||
var/turf/pos = get_turf(ghost)
|
||||
if(pos.z != src.z)
|
||||
continue
|
||||
cultists += ghost
|
||||
if(cultists.len)
|
||||
acquire(pick(cultists))
|
||||
return
|
||||
//no living humans, follow a ghost instead.
|
||||
|
||||
/obj/singularity/narsie/proc/acquire(const/mob/food)
|
||||
var/capname = uppertext(name)
|
||||
|
||||
target << "<span class='notice'><b>[capname] HAS LOST INTEREST IN YOU.</b></span>"
|
||||
target = food
|
||||
|
||||
if (ishuman(target))
|
||||
target << "<span class='danger'>[capname] HUNGERS FOR YOUR SOUL.</span>"
|
||||
else
|
||||
target << "<span class='danger'>[capname] HAS CHOSEN YOU TO LEAD HIM TO HIS NEXT MEAL.</span>"
|
||||
|
||||
/obj/singularity/narsie/on_capture()
|
||||
chained = 1
|
||||
move_self = 0
|
||||
icon_state ="narsie-small-chains"
|
||||
|
||||
/obj/singularity/narsie/on_release()
|
||||
chained = 0
|
||||
move_self = 1
|
||||
icon_state ="narsie-small"
|
||||
|
||||
/obj/singularity/narsie/large/on_capture()
|
||||
chained = 1
|
||||
move_self = 0
|
||||
icon_state ="narsie-chains"
|
||||
for(var/mob/M in mob_list)//removing the client image of nar-sie while it is chained
|
||||
if(M.client)
|
||||
M.see_narsie(src)
|
||||
|
||||
/obj/singularity/narsie/large/on_release()
|
||||
chained = 0
|
||||
move_self = 1
|
||||
icon_state ="narsie"
|
||||
|
||||
/obj/singularity/narsie/cultify()
|
||||
return
|
||||
|
||||
/**
|
||||
* Wizard narsie.
|
||||
*/
|
||||
/obj/singularity/narsie/wizard
|
||||
grav_pull = 0
|
||||
|
||||
/obj/singularity/narsie/wizard/eat()
|
||||
set background = BACKGROUND_ENABLED
|
||||
|
||||
for (var/turf/T in trange(consume_range, src))
|
||||
consume(T)
|
||||
|
||||
/obj/singularity/narsie/proc/narsie_spawn_animation()
|
||||
icon = 'icons/obj/narsie_spawn_anim.dmi'
|
||||
dir = SOUTH
|
||||
move_self = 0
|
||||
flick("narsie_spawn_anim",src)
|
||||
sleep(11)
|
||||
move_self = 1
|
||||
icon = initial(icon)
|
||||
@@ -41,14 +41,14 @@
|
||||
if (A)
|
||||
if(ismob(A))
|
||||
toxmob(A)
|
||||
if((istype(A,/obj/machinery/the_singularitygen))||(istype(A,/obj/machinery/singularity/)))
|
||||
if((istype(A,/obj/machinery/the_singularitygen))||(istype(A,/obj/singularity/)))
|
||||
A:energy += energy
|
||||
else if( istype(A,/obj/effect/rust_particle_catcher) )
|
||||
var/obj/effect/rust_particle_catcher/collided_catcher = A
|
||||
if(particle_type && particle_type != "neutron")
|
||||
if(collided_catcher.AddParticles(particle_type, 1 + additional_particles))
|
||||
collided_catcher.parent.AddEnergy(energy,mega_energy)
|
||||
del (src)
|
||||
qdel(src)
|
||||
else if( istype(A,/obj/machinery/power/rust_core) )
|
||||
var/obj/machinery/power/rust_core/collided_core = A
|
||||
if(particle_type && particle_type != "neutron")
|
||||
@@ -56,7 +56,7 @@
|
||||
var/energy_loss_ratio = abs(collided_core.owned_field.frequency - frequency) / 1e9
|
||||
collided_core.owned_field.mega_energy += mega_energy - mega_energy * energy_loss_ratio
|
||||
collided_core.owned_field.energy += energy - energy * energy_loss_ratio
|
||||
del (src)
|
||||
qdel(src)
|
||||
return
|
||||
|
||||
|
||||
@@ -67,7 +67,7 @@
|
||||
|
||||
|
||||
/obj/effect/accelerated_particle/ex_act(severity)
|
||||
del(src)
|
||||
qdel(src)
|
||||
return
|
||||
|
||||
|
||||
@@ -95,7 +95,7 @@
|
||||
src.loc = get_step(src,dir)
|
||||
movement_range--
|
||||
if(movement_range <= 0)
|
||||
del(src)
|
||||
qdel(src)
|
||||
else
|
||||
sleep(lag)
|
||||
move(lag)
|
||||
|
||||
@@ -72,6 +72,12 @@ So, hopefully this is helpful if any more icons are to be added/changed/wonderin
|
||||
var/strength = null
|
||||
var/desc_holder = null
|
||||
|
||||
/obj/structure/particle_accelerator/Destroy()
|
||||
construction_state = 0
|
||||
if(master)
|
||||
master.part_scan()
|
||||
..()
|
||||
|
||||
/obj/structure/particle_accelerator/end_cap
|
||||
name = "Alpha Particle Generation Array"
|
||||
desc_holder = "This is where Alpha particles are generated from \[REDACTED\]"
|
||||
@@ -138,15 +144,15 @@ So, hopefully this is helpful if any more icons are to be added/changed/wonderin
|
||||
/obj/structure/particle_accelerator/ex_act(severity)
|
||||
switch(severity)
|
||||
if(1.0)
|
||||
del(src)
|
||||
qdel(src)
|
||||
return
|
||||
if(2.0)
|
||||
if (prob(50))
|
||||
del(src)
|
||||
qdel(src)
|
||||
return
|
||||
if(3.0)
|
||||
if (prob(25))
|
||||
del(src)
|
||||
qdel(src)
|
||||
return
|
||||
else
|
||||
return
|
||||
@@ -154,13 +160,13 @@ So, hopefully this is helpful if any more icons are to be added/changed/wonderin
|
||||
|
||||
/obj/structure/particle_accelerator/blob_act()
|
||||
if(prob(50))
|
||||
del(src)
|
||||
qdel(src)
|
||||
return
|
||||
|
||||
|
||||
/obj/structure/particle_accelerator/meteorhit()
|
||||
if(prob(50))
|
||||
del(src)
|
||||
qdel(src)
|
||||
return
|
||||
|
||||
/obj/structure/particle_accelerator/update_icon()
|
||||
@@ -325,15 +331,15 @@ So, hopefully this is helpful if any more icons are to be added/changed/wonderin
|
||||
/obj/machinery/particle_accelerator/ex_act(severity)
|
||||
switch(severity)
|
||||
if(1.0)
|
||||
del(src)
|
||||
qdel(src)
|
||||
return
|
||||
if(2.0)
|
||||
if (prob(50))
|
||||
del(src)
|
||||
qdel(src)
|
||||
return
|
||||
if(3.0)
|
||||
if (prob(25))
|
||||
del(src)
|
||||
qdel(src)
|
||||
return
|
||||
else
|
||||
return
|
||||
@@ -341,13 +347,13 @@ So, hopefully this is helpful if any more icons are to be added/changed/wonderin
|
||||
|
||||
/obj/machinery/particle_accelerator/blob_act()
|
||||
if(prob(50))
|
||||
del(src)
|
||||
qdel(src)
|
||||
return
|
||||
|
||||
|
||||
/obj/machinery/particle_accelerator/meteorhit()
|
||||
if(prob(50))
|
||||
del(src)
|
||||
qdel(src)
|
||||
return
|
||||
|
||||
|
||||
|
||||
@@ -27,6 +27,10 @@
|
||||
active_power_usage = initial(active_power_usage) * (strength + 1)
|
||||
..()
|
||||
|
||||
/obj/machinery/particle_accelerator/control_box/Destroy()
|
||||
if(active)
|
||||
toggle_power()
|
||||
..()
|
||||
|
||||
/obj/machinery/particle_accelerator/control_box/attack_hand(mob/user as mob)
|
||||
if(construction_state >= 3)
|
||||
|
||||
@@ -1,11 +1,6 @@
|
||||
//This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:33
|
||||
|
||||
var/global/list/uneatable = list(
|
||||
/turf/space,
|
||||
/obj/effect/overlay
|
||||
)
|
||||
|
||||
/obj/machinery/singularity/
|
||||
/obj/singularity/
|
||||
name = "gravitational singularity"
|
||||
desc = "A gravitational singularity."
|
||||
icon = 'icons/obj/singularity.dmi'
|
||||
@@ -15,7 +10,7 @@ var/global/list/uneatable = list(
|
||||
layer = 6
|
||||
luminosity = 6
|
||||
unacidable = 1 //Don't comment this out.
|
||||
use_power = 0
|
||||
|
||||
var/current_size = 1
|
||||
var/allowed_size = 1
|
||||
var/contained = 1 //Are we going to move around?
|
||||
@@ -26,102 +21,113 @@ var/global/list/uneatable = list(
|
||||
var/dissipate_strength = 1 //How much energy do we lose?
|
||||
var/move_self = 1 //Do we move on our own?
|
||||
var/grav_pull = 4 //How many tiles out do we pull?
|
||||
var/consume_range = 0 //How many tiles out do we eat
|
||||
var/event_chance = 15 //Prob for event each tick
|
||||
var/target = null //its target. moves towards the target if it has one
|
||||
var/last_failed_movement = 0//Will not move in the same dir if it couldnt before, will help with the getting stuck on fields thing
|
||||
var/teleport_del = 0
|
||||
var/consume_range = 0 //How many tiles out do we eat.
|
||||
var/event_chance = 15 //Prob for event each tick.
|
||||
var/target = null //Its target. Moves towards the target if it has one.
|
||||
var/last_failed_movement = 0 //Will not move in the same dir if it couldnt before, will help with the getting stuck on fields thing.
|
||||
var/last_warning
|
||||
|
||||
/obj/machinery/singularity/New(loc, var/starting_energy = 50, var/temp = 0)
|
||||
var/chained = 0//Adminbus chain-grab
|
||||
|
||||
/obj/singularity/New(loc, var/starting_energy = 50, var/temp = 0)
|
||||
//CARN: admin-alert for chuckle-fuckery.
|
||||
admin_investigate_setup()
|
||||
energy = starting_energy
|
||||
|
||||
if (temp)
|
||||
spawn (temp)
|
||||
qdel(src)
|
||||
|
||||
src.energy = starting_energy
|
||||
if(temp)
|
||||
spawn(temp)
|
||||
del(src)
|
||||
..()
|
||||
processing_objects += src
|
||||
for(var/obj/machinery/power/singularity_beacon/singubeacon in machines)
|
||||
if(singubeacon.active)
|
||||
target = singubeacon
|
||||
break
|
||||
return
|
||||
|
||||
/obj/singularity/Destroy()
|
||||
processing_objects -= src
|
||||
..()
|
||||
|
||||
/obj/machinery/singularity/attack_hand(mob/user as mob)
|
||||
/obj/singularity/attack_hand(mob/user as mob)
|
||||
consume(user)
|
||||
return 1
|
||||
|
||||
|
||||
/obj/machinery/singularity/blob_act(severity)
|
||||
/obj/singularity/blob_act(severity)
|
||||
return
|
||||
|
||||
|
||||
/obj/machinery/singularity/ex_act(severity)
|
||||
/obj/singularity/ex_act(severity)
|
||||
if(current_size == STAGE_SUPER)//IT'S UNSTOPPABLE
|
||||
return
|
||||
switch(severity)
|
||||
if(1.0)
|
||||
if(prob(25))
|
||||
del(src)
|
||||
investigate_log("has been destroyed by an explosion.", I_SINGULO)
|
||||
qdel(src)
|
||||
return
|
||||
else
|
||||
energy += 50
|
||||
if(2.0 to 3.0)
|
||||
energy += round((rand(20,60)/2),1)
|
||||
return
|
||||
return
|
||||
|
||||
/obj/singularity/bullet_act(obj/item/projectile/P)
|
||||
return 0 //Will there be an impact? Who knows. Will we see it? No.
|
||||
|
||||
/obj/machinery/singularity/Bump(atom/A)
|
||||
/obj/singularity/Bump(atom/A)
|
||||
consume(A)
|
||||
return
|
||||
|
||||
|
||||
/obj/machinery/singularity/Bumped(atom/A)
|
||||
/obj/singularity/Bumped(atom/A)
|
||||
consume(A)
|
||||
return
|
||||
|
||||
|
||||
/obj/machinery/singularity/process()
|
||||
/obj/singularity/process()
|
||||
eat()
|
||||
dissipate()
|
||||
check_energy()
|
||||
|
||||
if(current_size >= 3)
|
||||
if (current_size >= STAGE_THREE)
|
||||
move()
|
||||
pulse()
|
||||
if(prob(event_chance))//Chance for it to run a special event TODO:Come up with one or two more that fit
|
||||
|
||||
if (prob(event_chance)) //Chance for it to run a special event TODO: Come up with one or two more that fit.
|
||||
event()
|
||||
|
||||
/obj/singularity/attack_ai() //To prevent ais from gibbing themselves when they click on one.
|
||||
return
|
||||
|
||||
|
||||
/obj/machinery/singularity/attack_ai() //to prevent ais from gibbing themselves when they click on one.
|
||||
return
|
||||
|
||||
|
||||
/obj/machinery/singularity/proc/admin_investigate_setup()
|
||||
/obj/singularity/proc/admin_investigate_setup()
|
||||
last_warning = world.time
|
||||
var/count = locate(/obj/machinery/containment_field) in orange(30, src)
|
||||
if(!count) message_admins("A singulo has been created without containment fields active ([x],[y],[z])",1)
|
||||
investigate_log("was created. [count?"":"<font color='red'>No containment fields were active</font>"]","singulo")
|
||||
|
||||
/obj/machinery/singularity/proc/dissipate()
|
||||
if(!dissipate)
|
||||
if (!count)
|
||||
message_admins("A singulo has been created without containment fields active ([x], [y], [z] - <A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[x];Y=[y];Z=[z]'>JMP</a>).")
|
||||
|
||||
investigate_log("was created. [count ? "" : "<font color='red'>No containment fields were active.</font>"]", I_SINGULO)
|
||||
|
||||
/obj/singularity/proc/dissipate()
|
||||
if (!dissipate)
|
||||
return
|
||||
|
||||
if(dissipate_track >= dissipate_delay)
|
||||
src.energy -= dissipate_strength
|
||||
energy -= dissipate_strength
|
||||
dissipate_track = 0
|
||||
else
|
||||
dissipate_track++
|
||||
|
||||
/obj/singularity/proc/expand(var/force_size = 0, var/growing = 1)
|
||||
if(current_size == STAGE_SUPER)//if this is happening, this is an error
|
||||
message_admins("expand() was called on a super singulo. This should not happen. Contact a coder immediately!")
|
||||
return
|
||||
var/temp_allowed_size = allowed_size
|
||||
|
||||
/obj/machinery/singularity/proc/expand(var/force_size = 0)
|
||||
var/temp_allowed_size = src.allowed_size
|
||||
if(force_size)
|
||||
if (force_size)
|
||||
temp_allowed_size = force_size
|
||||
switch(temp_allowed_size)
|
||||
if(1)
|
||||
current_size = 1
|
||||
|
||||
switch (temp_allowed_size)
|
||||
if (STAGE_ONE)
|
||||
name = "gravitational singularity"
|
||||
desc = "A gravitational singularity."
|
||||
current_size = STAGE_ONE
|
||||
icon = 'icons/obj/singularity.dmi'
|
||||
icon_state = "singularity_s1"
|
||||
pixel_x = 0
|
||||
@@ -131,8 +137,14 @@ var/global/list/uneatable = list(
|
||||
dissipate_delay = 10
|
||||
dissipate_track = 0
|
||||
dissipate_strength = 1
|
||||
if(3)//1 to 3 does not check for the turfs if you put the gens right next to a 1x1 then its going to eat them
|
||||
current_size = 3
|
||||
overlays = 0
|
||||
if(chained)
|
||||
overlays = "chain_s1"
|
||||
visible_message("<span class='notice'>The singularity has shrunk to a rather pitiful size.</span>")
|
||||
if (STAGE_TWO) //1 to 3 does not check for the turfs if you put the gens right next to a 1x1 then its going to eat them.
|
||||
name = "gravitational singularity"
|
||||
desc = "A gravitational singularity."
|
||||
current_size = STAGE_TWO
|
||||
icon = 'icons/effects/96x96.dmi'
|
||||
icon_state = "singularity_s3"
|
||||
pixel_x = -32
|
||||
@@ -142,9 +154,18 @@ var/global/list/uneatable = list(
|
||||
dissipate_delay = 5
|
||||
dissipate_track = 0
|
||||
dissipate_strength = 5
|
||||
if(5)
|
||||
if((check_turfs_in(1,2))&&(check_turfs_in(2,2))&&(check_turfs_in(4,2))&&(check_turfs_in(8,2)))
|
||||
current_size = 5
|
||||
overlays = 0
|
||||
if(chained)
|
||||
overlays = "chain_s3"
|
||||
if(growing)
|
||||
visible_message("<span class='notice'>The singularity noticeably grows in size.</span>")
|
||||
else
|
||||
visible_message("<span class='notice'>The singularity has shrunk to a less powerful size.</span>")
|
||||
if (STAGE_THREE)
|
||||
if ((check_turfs_in(1, 2)) && (check_turfs_in(2, 2)) && (check_turfs_in(4, 2)) && (check_turfs_in(8, 2)))
|
||||
name = "gravitational singularity"
|
||||
desc = "A gravitational singularity."
|
||||
current_size = STAGE_THREE
|
||||
icon = 'icons/effects/160x160.dmi'
|
||||
icon_state = "singularity_s5"
|
||||
pixel_x = -64
|
||||
@@ -154,9 +175,18 @@ var/global/list/uneatable = list(
|
||||
dissipate_delay = 4
|
||||
dissipate_track = 0
|
||||
dissipate_strength = 20
|
||||
if(7)
|
||||
if((check_turfs_in(1,3))&&(check_turfs_in(2,3))&&(check_turfs_in(4,3))&&(check_turfs_in(8,3)))
|
||||
current_size = 7
|
||||
overlays = 0
|
||||
if(chained)
|
||||
overlays = "chain_s5"
|
||||
if(growing)
|
||||
visible_message("<span class='notice'>The singularity expands to a reasonable size.</span>")
|
||||
else
|
||||
visible_message("<span class='notice'>The singularity has returned to a safe size.</span>")
|
||||
if(STAGE_FOUR)
|
||||
if ((check_turfs_in(1, 3)) && (check_turfs_in(2, 3)) && (check_turfs_in(4, 3)) && (check_turfs_in(8, 3)))
|
||||
name = "gravitational singularity"
|
||||
desc = "A gravitational singularity."
|
||||
current_size = STAGE_FOUR
|
||||
icon = 'icons/effects/224x224.dmi'
|
||||
icon_state = "singularity_s7"
|
||||
pixel_x = -96
|
||||
@@ -166,125 +196,102 @@ var/global/list/uneatable = list(
|
||||
dissipate_delay = 10
|
||||
dissipate_track = 0
|
||||
dissipate_strength = 10
|
||||
if(9)//this one also lacks a check for gens because it eats everything
|
||||
current_size = 9
|
||||
overlays = 0
|
||||
if(chained)
|
||||
overlays = "chain_s7"
|
||||
if(growing)
|
||||
visible_message("<span class='warning'>The singularity expands to a dangerous size.</span>")
|
||||
else
|
||||
visible_message("<span class='notice'>Miraculously, the singularity reduces in size, and can be contained.</span>")
|
||||
if(STAGE_FIVE) //This one also lacks a check for gens because it eats everything.
|
||||
name = "gravitational singularity"
|
||||
desc = "A gravitational singularity."
|
||||
current_size = STAGE_FIVE
|
||||
icon = 'icons/effects/288x288.dmi'
|
||||
icon_state = "singularity_s9"
|
||||
pixel_x = -128
|
||||
pixel_y = -128
|
||||
grav_pull = 10
|
||||
consume_range = 4
|
||||
dissipate = 0 //It cant go smaller due to e loss.
|
||||
overlays = 0
|
||||
if(chained)
|
||||
overlays = "chain_s9"
|
||||
if(growing)
|
||||
visible_message("<span class='danger'><font size='2'>The singularity has grown out of control!</font></span>")
|
||||
else
|
||||
visible_message("<span class='warning'>The singularity miraculously reduces in size and loses its supermatter properties.</span>")
|
||||
if(STAGE_SUPER)//SUPERSINGULO
|
||||
name = "super gravitational singularity"
|
||||
desc = "A gravitational singularity with the properties of supermatter. <b>It has the power to destroy worlds.</b>"
|
||||
current_size = STAGE_SUPER
|
||||
icon = 'icons/effects/352x352.dmi'
|
||||
icon_state = "singularity_s11"//uh, whoever drew that, you know that black holes are supposed to look dark right? What's this, the clown's singulo?
|
||||
pixel_x = -160
|
||||
pixel_y = -160
|
||||
grav_pull = 16
|
||||
consume_range = 5
|
||||
dissipate = 0 //It cant go smaller due to e loss
|
||||
if(current_size == allowed_size)
|
||||
investigate_log("<font color='red'>grew to size [current_size]</font>","singulo")
|
||||
event_chance = 25 //Events will fire off more often.
|
||||
if(chained)
|
||||
overlays = "chain_s9"
|
||||
visible_message("<span class='sinister'><font size='3'>You witness the creation of a destructive force that cannot possibly be stopped by human hands.</font></span>")
|
||||
|
||||
if (current_size == allowed_size)
|
||||
investigate_log("<font color='red'>grew to size [current_size].</font>", I_SINGULO)
|
||||
return 1
|
||||
else if(current_size < (--temp_allowed_size))
|
||||
else if (current_size < (--temp_allowed_size) && current_size != STAGE_SUPER)
|
||||
expand(temp_allowed_size)
|
||||
else
|
||||
return 0
|
||||
|
||||
|
||||
/obj/machinery/singularity/proc/check_energy()
|
||||
if(energy <= 0)
|
||||
del(src)
|
||||
/obj/singularity/proc/check_energy()
|
||||
if (energy <= 0)
|
||||
investigate_log("collapsed.", I_SINGULO)
|
||||
qdel(src)
|
||||
return 0
|
||||
switch(energy)//Some of these numbers might need to be changed up later -Mport
|
||||
if(1 to 199)
|
||||
allowed_size = 1
|
||||
if(200 to 499)
|
||||
allowed_size = 3
|
||||
if(500 to 999)
|
||||
allowed_size = 5
|
||||
if(1000 to 1999)
|
||||
allowed_size = 7
|
||||
if(2000 to INFINITY)
|
||||
allowed_size = 9
|
||||
if(current_size != allowed_size)
|
||||
expand()
|
||||
|
||||
switch (energy) //Some of these numbers might need to be changed up later -Mport.
|
||||
if (1 to 199)
|
||||
allowed_size = STAGE_ONE
|
||||
if (200 to 499)
|
||||
allowed_size = STAGE_TWO
|
||||
if (500 to 999)
|
||||
allowed_size = STAGE_THREE
|
||||
if (1000 to 1999)
|
||||
allowed_size = STAGE_FOUR
|
||||
if(2000 to 49999)
|
||||
allowed_size = STAGE_FIVE
|
||||
if(50000 to INFINITY)
|
||||
allowed_size = STAGE_SUPER
|
||||
|
||||
if (current_size != allowed_size && current_size != STAGE_SUPER)
|
||||
expand(null, current_size > allowed_size)
|
||||
return 1
|
||||
|
||||
/obj/singularity/proc/eat()
|
||||
set background = BACKGROUND_ENABLED
|
||||
|
||||
/obj/machinery/singularity/proc/eat()
|
||||
set background = 1
|
||||
// Let's just make this one loop.
|
||||
for(var/atom/X in orange(grav_pull,src))
|
||||
for(var/atom/X in orange(grav_pull, src))
|
||||
var/dist = get_dist(X, src)
|
||||
// Movable atoms only
|
||||
if(dist > consume_range && istype(X, /atom/movable))
|
||||
if(is_type_in_list(X, uneatable)) continue
|
||||
if(((X) &&(!X:anchored) && (!istype(X,/mob/living/carbon/human)))|| (src.current_size >= 9))
|
||||
step_towards(X,src)
|
||||
else if(istype(X,/mob/living/carbon/human))
|
||||
var/mob/living/carbon/human/H = X
|
||||
if(istype(H.shoes,/obj/item/clothing/shoes/magboots))
|
||||
var/obj/item/clothing/shoes/magboots/M = H.shoes
|
||||
if(M.magpulse)
|
||||
continue
|
||||
step_towards(H,src)
|
||||
// Turf and movable atoms
|
||||
else if(dist <= consume_range && (isturf(X) || istype(X, /atom/movable)))
|
||||
consume(X)
|
||||
return
|
||||
|
||||
|
||||
/obj/machinery/singularity/proc/consume(var/atom/A)
|
||||
var/gain = 0
|
||||
if(is_type_in_list(A, uneatable))
|
||||
return 0
|
||||
if (istype(A,/mob/living))//Mobs get gibbed
|
||||
gain = 20
|
||||
if(istype(A,/mob/living/carbon/human))
|
||||
var/mob/living/carbon/human/H = A
|
||||
if(H.mind)
|
||||
|
||||
if((H.mind.assigned_role == "Station Engineer") || (H.mind.assigned_role == "Chief Engineer") )
|
||||
gain = 100
|
||||
|
||||
if(H.mind.assigned_role == "Clown")
|
||||
gain = rand(-300, 300) // HONK
|
||||
|
||||
spawn()
|
||||
A:gib()
|
||||
sleep(1)
|
||||
else if(istype(A,/obj/))
|
||||
|
||||
if (istype(A,/obj/item/weapon/storage/backpack/holding))
|
||||
var/dist = max((current_size - 2),1)
|
||||
explosion(src.loc,(dist),(dist*2),(dist*4))
|
||||
var/obj/singularity/S = src
|
||||
if(!istype(src))
|
||||
return
|
||||
if(dist > consume_range)
|
||||
X.singularity_pull(S, current_size)
|
||||
else if(dist <= consume_range)
|
||||
consume(X)
|
||||
|
||||
if(istype(A, /obj/machinery/singularity))//Welp now you did it
|
||||
var/obj/machinery/singularity/S = A
|
||||
src.energy += (S.energy/2)//Absorb most of it
|
||||
del(S)
|
||||
var/dist = max((current_size - 2),1)
|
||||
explosion(src.loc,(dist),(dist*2),(dist*4))
|
||||
return//Quits here, the obj should be gone, hell we might be
|
||||
//for (var/turf/T in trange(grav_pull, src)) //TODO: Create a similar trange for orange to prevent snowflake of self check.
|
||||
// consume(T)
|
||||
|
||||
if((teleport_del) && (!istype(A, /obj/machinery)))//Going to see if it does not lag less to tele items over to Z 2
|
||||
var/obj/O = A
|
||||
O.x = 2
|
||||
O.y = 2
|
||||
O.z = 2
|
||||
else
|
||||
A.ex_act(1.0)
|
||||
if(A) del(A)
|
||||
gain = 2
|
||||
else if(isturf(A))
|
||||
var/turf/T = A
|
||||
if(T.intact)
|
||||
for(var/obj/O in T.contents)
|
||||
if(O.level != 1)
|
||||
continue
|
||||
if(O.invisibility == 101)
|
||||
src.consume(O)
|
||||
T.ChangeTurf(/turf/space)
|
||||
gain = 2
|
||||
src.energy += gain
|
||||
return
|
||||
|
||||
/obj/singularity/proc/consume(const/atom/A)
|
||||
src.energy += A.singularity_act(src, current_size)
|
||||
return
|
||||
|
||||
/obj/machinery/singularity/proc/move(var/force_move = 0)
|
||||
/obj/singularity/proc/move(var/force_move = 0)
|
||||
if(!move_self)
|
||||
return 0
|
||||
|
||||
@@ -311,8 +318,7 @@ var/global/list/uneatable = list(
|
||||
last_failed_movement = movement_dir
|
||||
return 0
|
||||
|
||||
|
||||
/obj/machinery/singularity/proc/check_turfs_in(var/direction = 0, var/step = 0)
|
||||
/obj/singularity/proc/check_turfs_in(var/direction = 0, var/step = 0)
|
||||
if(!direction)
|
||||
return 0
|
||||
var/steps = 0
|
||||
@@ -328,6 +334,8 @@ var/global/list/uneatable = list(
|
||||
steps = 4
|
||||
if(9)
|
||||
steps = 5
|
||||
if(11)
|
||||
steps = 6
|
||||
else
|
||||
steps = step
|
||||
var/list/turfs = list()
|
||||
@@ -364,38 +372,42 @@ var/global/list/uneatable = list(
|
||||
return 0
|
||||
return 1
|
||||
|
||||
/obj/singularity/proc/can_move(const/turf/T)
|
||||
if (!isturf(T))
|
||||
return 0
|
||||
|
||||
/obj/machinery/singularity/proc/can_move(var/turf/T)
|
||||
if(!T)
|
||||
if ((locate(/obj/machinery/containment_field) in T) || (locate(/obj/machinery/shieldwall) in T))
|
||||
return 0
|
||||
if((locate(/obj/machinery/containment_field) in T)||(locate(/obj/machinery/shieldwall) in T))
|
||||
return 0
|
||||
else if(locate(/obj/machinery/field_generator) in T)
|
||||
else if (locate(/obj/machinery/field_generator) in T)
|
||||
var/obj/machinery/field_generator/G = locate(/obj/machinery/field_generator) in T
|
||||
if(G && G.active)
|
||||
|
||||
if (G && G.active)
|
||||
return 0
|
||||
else if(locate(/obj/machinery/shieldwallgen) in T)
|
||||
else if (locate(/obj/machinery/shieldwallgen) in T)
|
||||
var/obj/machinery/shieldwallgen/S = locate(/obj/machinery/shieldwallgen) in T
|
||||
if(S && S.active)
|
||||
|
||||
if (S && S.active)
|
||||
return 0
|
||||
return 1
|
||||
|
||||
/obj/singularity/proc/event()
|
||||
var/numb = pick(1, 2, 3, 4, 5, 6)
|
||||
|
||||
/obj/machinery/singularity/proc/event()
|
||||
var/numb = pick(1,2,3,4,5,6)
|
||||
switch(numb)
|
||||
if(1)//EMP
|
||||
switch (numb)
|
||||
if (1) //EMP.
|
||||
emp_area()
|
||||
if(2,3)//tox damage all carbon mobs in area
|
||||
if (2, 3) //Tox damage all carbon mobs in area.
|
||||
toxmob()
|
||||
if(4)//Stun mobs who lack optic scanners
|
||||
if (4) //Stun mobs who lack optic scanners.
|
||||
mezzer()
|
||||
else
|
||||
return 0
|
||||
if(current_size == 11)
|
||||
smwave()
|
||||
return 1
|
||||
|
||||
|
||||
/obj/machinery/singularity/proc/toxmob()
|
||||
/obj/singularity/proc/toxmob()
|
||||
var/toxrange = 10
|
||||
var/toxdamage = 4
|
||||
var/radiation = 15
|
||||
@@ -405,165 +417,82 @@ var/global/list/uneatable = list(
|
||||
radiation = round(((src.energy-150)/50)*5,1)
|
||||
radiationmin = round((radiation/5),1)//
|
||||
for(var/mob/living/M in view(toxrange, src.loc))
|
||||
if(M.status_flags & GODMODE)
|
||||
continue
|
||||
M.apply_effect(rand(radiationmin,radiation), IRRADIATE)
|
||||
toxdamage = (toxdamage - (toxdamage*M.getarmor(null, "rad")))
|
||||
M.apply_effect(toxdamage, TOX)
|
||||
return
|
||||
|
||||
|
||||
/obj/machinery/singularity/proc/mezzer()
|
||||
/obj/singularity/proc/mezzer()
|
||||
for(var/mob/living/carbon/M in oviewers(8, src))
|
||||
if(istype(M, /mob/living/carbon/brain)) //Ignore brains
|
||||
continue
|
||||
|
||||
if(M.status_flags & GODMODE)
|
||||
continue
|
||||
if(M.stat == CONSCIOUS)
|
||||
if (istype(M,/mob/living/carbon/human))
|
||||
var/mob/living/carbon/human/H = M
|
||||
if(istype(H.glasses,/obj/item/clothing/glasses/meson))
|
||||
H << "\blue You look directly into The [src.name], good thing you had your protective eyewear on!"
|
||||
if(istype(H.glasses,/obj/item/clothing/glasses/meson) && current_size != 11)
|
||||
H << "<span class=\"notice\">You look directly into The [src.name], good thing you had your protective eyewear on!</span>"
|
||||
return
|
||||
M << "\red You look directly into The [src.name] and feel weak."
|
||||
else
|
||||
H << "<span class=\"warning\">You look directly into The [src.name], but your eyewear does absolutely nothing to protect you from it!</span>"
|
||||
M << "<span class='danger'>You look directly into The [src.name] and feel [current_size == 11 ? "helpless" : "weak"].</span>"
|
||||
M.apply_effect(3, STUN)
|
||||
for(var/mob/O in viewers(M, null))
|
||||
O.show_message(text("\red <B>[] stares blankly at The []!</B>", M, src), 1)
|
||||
return
|
||||
O.show_message(text("<span class='danger'>[] stares blankly at The []!</span>", M, src), 1)
|
||||
|
||||
|
||||
/obj/machinery/singularity/proc/emp_area()
|
||||
empulse(src, 8, 10)
|
||||
return
|
||||
|
||||
|
||||
/obj/machinery/singularity/proc/pulse()
|
||||
|
||||
for(var/obj/machinery/power/rad_collector/R in rad_collectors)
|
||||
if(get_dist(R, src) <= 15) // Better than using orange() every process
|
||||
R.receive_pulse(energy)
|
||||
return
|
||||
|
||||
|
||||
|
||||
/obj/machinery/singularity/narsie //Moving narsie to a child object of the singularity so it can be made to function differently. --NEO
|
||||
name = "Nar-Sie"
|
||||
desc = "Your mind begins to bubble and ooze as it tries to comprehend what it sees."
|
||||
icon = 'icons/obj/magic_terror.dmi'
|
||||
pixel_x = -89
|
||||
pixel_y = -85
|
||||
current_size = 9 //It moves/eats like a max-size singulo, aside from range. --NEO
|
||||
contained = 0 //Are we going to move around?
|
||||
dissipate = 0 //Do we lose energy over time?
|
||||
move_self = 1 //Do we move on our own?
|
||||
grav_pull = 10 //How many tiles out do we pull?
|
||||
consume_range = 3 //How many tiles out do we eat
|
||||
var/last_boom = 0
|
||||
|
||||
/obj/machinery/singularity/narsie/large
|
||||
name = "Nar-Sie"
|
||||
icon = 'icons/obj/narsie.dmi'
|
||||
// Pixel stuff centers Narsie.
|
||||
pixel_x = -236
|
||||
pixel_y = -256
|
||||
current_size = 12
|
||||
move_self = 1 //Do we move on our own?
|
||||
consume_range = 12 //How many tiles out do we eat
|
||||
|
||||
/obj/machinery/singularity/narsie/large/New()
|
||||
..()
|
||||
world << "<font size='28' color='red'><b>NAR-SIE HAS RISEN</b></font>"
|
||||
if(emergency_shuttle && emergency_shuttle.can_call())
|
||||
emergency_shuttle.call_evac()
|
||||
emergency_shuttle.launch_time = 0 // Cannot recall
|
||||
|
||||
/obj/machinery/singularity/narsie/process()
|
||||
eat()
|
||||
if(!target || prob(5))
|
||||
pickcultist()
|
||||
move()
|
||||
if(prob(25))
|
||||
mezzer()
|
||||
|
||||
/obj/machinery/singularity/narsie/consume(var/atom/A) //Has its own consume proc because it doesn't need energy and I don't want BoHs to explode it. --NEO
|
||||
if(is_type_in_list(A, uneatable))
|
||||
return 0
|
||||
if (istype(A,/mob/living))//Mobs get gibbed
|
||||
A:gib()
|
||||
else if(istype(A,/obj))
|
||||
var/obj/O = A
|
||||
machines -= O
|
||||
processing_objects -= O
|
||||
O.loc = null
|
||||
else if(isturf(A))
|
||||
var/turf/T = A
|
||||
if(T.intact)
|
||||
for(var/obj/O in T.contents)
|
||||
if(O.level != 1)
|
||||
continue
|
||||
if(O.invisibility == 101)
|
||||
src.consume(O)
|
||||
A:ChangeTurf(/turf/space)
|
||||
if(last_boom + 100 < world.time && prob(5))
|
||||
explosion(loc, -1, -1, -1, 1, 0) //Since we're not exploding everything in consume() toss out an explosion effect every now and again
|
||||
last_boom = world.time
|
||||
return
|
||||
|
||||
/obj/machinery/singularity/narsie/ex_act() //No throwing bombs at it either. --NEO
|
||||
return
|
||||
|
||||
/obj/machinery/singularity/narsie/proc/pickcultist() //Narsie rewards his cultists with being devoured first, then picks a ghost to follow. --NEO
|
||||
var/list/cultists = list()
|
||||
if(cult && cult.current_antagonists.len)
|
||||
for(var/datum/mind/cult_nh_mind in cult.current_antagonists)
|
||||
if(!cult_nh_mind.current)
|
||||
continue
|
||||
if(cult_nh_mind.current.stat)
|
||||
continue
|
||||
var/turf/pos = get_turf(cult_nh_mind.current)
|
||||
if(pos.z != src.z)
|
||||
continue
|
||||
cultists += cult_nh_mind.current
|
||||
if(cultists.len)
|
||||
acquire(pick(cultists))
|
||||
return
|
||||
//If there was living cultists, it picks one to follow.
|
||||
for(var/mob/living/carbon/human/food in living_mob_list)
|
||||
if(food.stat)
|
||||
continue
|
||||
var/turf/pos = get_turf(food)
|
||||
if(pos.z != src.z)
|
||||
continue
|
||||
cultists += food
|
||||
if(cultists.len)
|
||||
acquire(pick(cultists))
|
||||
return
|
||||
//no living cultists, pick a living human instead.
|
||||
for(var/mob/dead/observer/ghost in player_list)
|
||||
if(!ghost.client)
|
||||
continue
|
||||
var/turf/pos = get_turf(ghost)
|
||||
if(pos.z != src.z)
|
||||
continue
|
||||
cultists += ghost
|
||||
if(cultists.len)
|
||||
acquire(pick(cultists))
|
||||
return
|
||||
//no living humans, follow a ghost instead.
|
||||
|
||||
/obj/machinery/singularity/narsie/proc/acquire(var/mob/food)
|
||||
target << "\blue <b>NAR-SIE HAS LOST INTEREST IN YOU</b>"
|
||||
target = food
|
||||
if(ishuman(target))
|
||||
target << "\red <b>NAR-SIE HUNGERS FOR YOUR SOUL</b>"
|
||||
/obj/singularity/proc/emp_area()
|
||||
if(current_size != 11)
|
||||
empulse(src, 8, 10)
|
||||
else
|
||||
target << "\red <b>NAR-SIE HAS CHOSEN YOU TO LEAD HIM TO HIS NEXT MEAL</b>"
|
||||
empulse(src, 12, 16)
|
||||
|
||||
//Wizard narsie
|
||||
|
||||
/obj/machinery/singularity/narsie/wizard
|
||||
grav_pull = 0
|
||||
|
||||
/obj/machinery/singularity/narsie/wizard/eat()
|
||||
set background = 1
|
||||
for(var/atom/X in orange(consume_range,src))
|
||||
if(isturf(X) || istype(X, /atom/movable))
|
||||
consume(X)
|
||||
/obj/singularity/proc/smwave()
|
||||
for(var/mob/living/M in view(10, src.loc))
|
||||
if(prob(67))
|
||||
M.apply_effect(rand(energy), IRRADIATE)
|
||||
M << "<span class=\"warning\">You hear an uneartly ringing, then what sounds like a shrilling kettle as you are washed with a wave of heat.</span>"
|
||||
M << "<span class=\"notice\">Miraculously, it fails to kill you.</span>"
|
||||
else
|
||||
M << "<span class=\"danger\">You hear an uneartly ringing, then what sounds like a shrilling kettle as you are washed with a wave of heat.</span>"
|
||||
M << "<span class=\"danger\">You don't even have a moment to react as you are reduced to ashes by the intense radiation.</span>"
|
||||
M.dust()
|
||||
return
|
||||
|
||||
/obj/singularity/proc/pulse()
|
||||
for(var/obj/machinery/power/rad_collector/R in rad_collectors)
|
||||
if (get_dist(R, src) <= 15) //Better than using orange() every process.
|
||||
R.receive_pulse(energy)
|
||||
|
||||
/obj/singularity/proc/on_capture()
|
||||
chained = 1
|
||||
overlays = 0
|
||||
move_self = 0
|
||||
switch (current_size)
|
||||
if(1)
|
||||
overlays += image('icons/obj/singularity.dmi',"chain_s1")
|
||||
if(3)
|
||||
overlays += image('icons/effects/96x96.dmi',"chain_s3")
|
||||
if(5)
|
||||
overlays += image('icons/effects/160x160.dmi',"chain_s5")
|
||||
if(7)
|
||||
overlays += image('icons/effects/224x224.dmi',"chain_s7")
|
||||
if(9)
|
||||
overlays += image('icons/effects/288x288.dmi',"chain_s9")
|
||||
|
||||
/obj/singularity/proc/on_release()
|
||||
chained = 0
|
||||
overlays = 0
|
||||
move_self = 1
|
||||
|
||||
/obj/singularity/singularity_act(S, size)
|
||||
if(current_size <= size)
|
||||
var/gain = (energy/2)
|
||||
var/dist = max((current_size - 2), 1)
|
||||
explosion(src.loc,(dist),(dist*2),(dist*4))
|
||||
spawn(0)
|
||||
qdel(src)
|
||||
return gain
|
||||
|
||||
@@ -83,6 +83,12 @@
|
||||
|
||||
return
|
||||
|
||||
|
||||
/obj/machinery/power/smes/Destroy()
|
||||
if(terminal)
|
||||
disconnect_terminal()
|
||||
..()
|
||||
|
||||
/obj/machinery/power/smes/update_icon()
|
||||
overlays.Cut()
|
||||
if(stat & BROKEN) return
|
||||
@@ -281,7 +287,7 @@
|
||||
user.visible_message(\
|
||||
"<span class='notice'>[user.name] cut the cables and dismantled the power terminal.</span>",\
|
||||
"<span class='notice'>You cut the cables and dismantle the power terminal.</span>")
|
||||
del(terminal)
|
||||
qdel(terminal)
|
||||
building_terminal = 0
|
||||
return 0
|
||||
return 1
|
||||
@@ -374,7 +380,7 @@
|
||||
smoke.attach(src)
|
||||
smoke.start()
|
||||
explosion(src.loc, -1, 0, 1, 3, 1, 0)
|
||||
del(src)
|
||||
qdel(src)
|
||||
return
|
||||
if(prob(15)) //Power drain
|
||||
var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread
|
||||
|
||||
@@ -258,7 +258,7 @@
|
||||
src.ping("DANGER! Magnetic containment field failure in 3 ... 2 ... 1 ...")
|
||||
explosion(src.loc,1,2,4,8)
|
||||
// Not sure if this is necessary, but just in case the SMES *somehow* survived..
|
||||
del(src)
|
||||
qdel(src)
|
||||
|
||||
|
||||
|
||||
@@ -345,7 +345,7 @@
|
||||
if(I.reliability != 100 && crit_fail)
|
||||
I.crit_fail = 1
|
||||
I.loc = src.loc
|
||||
del(src)
|
||||
qdel(src)
|
||||
return
|
||||
|
||||
// Superconducting Magnetic Coil - Upgrade the SMES
|
||||
|
||||
+11
-16
@@ -30,7 +30,7 @@ var/list/solars_list = list()
|
||||
Make(S)
|
||||
connect_to_network()
|
||||
|
||||
/obj/machinery/power/solar/Del()
|
||||
/obj/machinery/power/solar/Destroy()
|
||||
unset_control() //remove from control computer
|
||||
..()
|
||||
|
||||
@@ -71,7 +71,7 @@ var/list/solars_list = list()
|
||||
S.give_glass()
|
||||
playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1)
|
||||
user.visible_message("<span class='notice'>[user] takes the glass off the solar panel.</span>")
|
||||
del(src) // qdel
|
||||
qdel(src)
|
||||
return
|
||||
else if (W)
|
||||
src.add_fingerprint(user)
|
||||
@@ -93,7 +93,7 @@ var/list/solars_list = list()
|
||||
else
|
||||
new /obj/item/weapon/shard(src.loc)
|
||||
new /obj/item/weapon/shard(src.loc)
|
||||
del(src) // qdel
|
||||
qdel(src)
|
||||
return
|
||||
return
|
||||
|
||||
@@ -154,13 +154,13 @@ var/list/solars_list = list()
|
||||
if(1.0)
|
||||
if(prob(15))
|
||||
new /obj/item/weapon/shard( src.loc )
|
||||
del(src) // qdel
|
||||
qdel(src)
|
||||
return
|
||||
|
||||
if(2.0)
|
||||
if (prob(25))
|
||||
new /obj/item/weapon/shard( src.loc )
|
||||
del(src) // qdel
|
||||
qdel(src)
|
||||
return
|
||||
|
||||
if (prob(50))
|
||||
@@ -270,7 +270,7 @@ var/list/solars_list = list()
|
||||
if(istype(W, /obj/item/weapon/tracker_electronics))
|
||||
tracker = 1
|
||||
user.drop_item()
|
||||
del(W) // qdel
|
||||
qdel(W)
|
||||
user.visible_message("<span class='notice'>[user] inserts the electronics into the solar assembly.</span>")
|
||||
return 1
|
||||
else
|
||||
@@ -308,13 +308,7 @@ var/list/solars_list = list()
|
||||
/obj/machinery/power/solar_control/drain_power()
|
||||
return -1
|
||||
|
||||
/obj/machinery/power/solar_control/New()
|
||||
..()
|
||||
if(ticker)
|
||||
initialize()
|
||||
connect_to_network()
|
||||
|
||||
/obj/machinery/power/solar_control/Del()
|
||||
/obj/machinery/power/solar_control/Destroy()
|
||||
for(var/obj/machinery/power/solar/M in connected_panels)
|
||||
M.unset_control()
|
||||
if(connected_tracker)
|
||||
@@ -368,6 +362,7 @@ var/list/solars_list = list()
|
||||
..()
|
||||
if(!powernet) return
|
||||
set_panels(cdir)
|
||||
connect_to_network()
|
||||
|
||||
/obj/machinery/power/solar_control/update_icon()
|
||||
if(stat & BROKEN)
|
||||
@@ -433,7 +428,7 @@ var/list/solars_list = list()
|
||||
A.state = 3
|
||||
A.icon_state = "3"
|
||||
A.anchored = 1
|
||||
del(src) // qdel
|
||||
qdel(src)
|
||||
else
|
||||
user << "\blue You disconnect the monitor."
|
||||
var/obj/structure/computerframe/A = new /obj/structure/computerframe( src.loc )
|
||||
@@ -444,7 +439,7 @@ var/list/solars_list = list()
|
||||
A.state = 4
|
||||
A.icon_state = "4"
|
||||
A.anchored = 1
|
||||
del(src) // qdel
|
||||
qdel(src)
|
||||
else
|
||||
src.attack_hand(user)
|
||||
return
|
||||
@@ -534,7 +529,7 @@ var/list/solars_list = list()
|
||||
switch(severity)
|
||||
if(1.0)
|
||||
//SN src = null
|
||||
del(src) // qdel
|
||||
qdel(src)
|
||||
return
|
||||
if(2.0)
|
||||
if (prob(50))
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
if(level==1) hide(T.intact)
|
||||
return
|
||||
|
||||
/obj/machinery/power/terminal/Del()
|
||||
/obj/machinery/power/terminal/Destroy()
|
||||
if(master)
|
||||
master.disconnect_terminal()
|
||||
return ..()
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
Make(S)
|
||||
connect_to_network()
|
||||
|
||||
/obj/machinery/power/tracker/Del()
|
||||
/obj/machinery/power/tracker/Destroy()
|
||||
unset_control() //remove from control computer
|
||||
..()
|
||||
|
||||
@@ -69,7 +69,7 @@
|
||||
S.give_glass()
|
||||
playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1)
|
||||
user.visible_message("<span class='notice'>[user] takes the glass off the tracker.</span>")
|
||||
del(src) // qdel
|
||||
qdel(src)
|
||||
return
|
||||
..()
|
||||
|
||||
|
||||
@@ -243,7 +243,7 @@
|
||||
A.state = 3
|
||||
A.icon_state = "3"
|
||||
A.anchored = 1
|
||||
del(src)
|
||||
qdel(src)
|
||||
else
|
||||
user << "\blue You disconnect the monitor."
|
||||
var/obj/structure/computerframe/A = new /obj/structure/computerframe( src.loc )
|
||||
@@ -255,7 +255,7 @@
|
||||
A.state = 4
|
||||
A.icon_state = "4"
|
||||
A.anchored = 1
|
||||
del(src)
|
||||
qdel(src)
|
||||
else
|
||||
src.attack_hand(user)
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user