Revert "12/21 modernizations from TG live"
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
desc = "This device injects antimatter into connected shielding units, the more antimatter injected the more power produced. Wrench the device to set it up."
|
||||
icon = 'icons/obj/machines/antimatter.dmi'
|
||||
icon_state = "control"
|
||||
anchored = 0
|
||||
anchored = 1
|
||||
density = 1
|
||||
use_power = 1
|
||||
idle_power_usage = 100
|
||||
@@ -37,10 +37,7 @@
|
||||
|
||||
/obj/machinery/power/am_control_unit/Destroy()//Perhaps damage and run stability checks rather than just del on the others
|
||||
for(var/obj/machinery/am_shielding/AMS in linked_shielding)
|
||||
AMS.control_unit = null
|
||||
qdel(AMS)
|
||||
qdel(fueljar)
|
||||
fueljar = null
|
||||
return ..()
|
||||
|
||||
|
||||
@@ -59,7 +56,7 @@
|
||||
|
||||
if(!fueljar)//No fuel but we are on, shutdown
|
||||
toggle_power()
|
||||
playsound(src.loc, 'sound/machines/buzz-two.ogg', 50, 0)
|
||||
//Angry buzz or such here
|
||||
return
|
||||
|
||||
add_avail(stored_power)
|
||||
@@ -138,15 +135,8 @@
|
||||
|
||||
/obj/machinery/power/am_control_unit/power_change()
|
||||
..()
|
||||
if(stat & NOPOWER)
|
||||
if(active)
|
||||
toggle_power(1)
|
||||
else
|
||||
use_power = 0
|
||||
|
||||
else if(!stat && anchored)
|
||||
use_power = 1
|
||||
|
||||
if(stat & NOPOWER && active)
|
||||
toggle_power()
|
||||
return
|
||||
|
||||
|
||||
@@ -160,14 +150,14 @@
|
||||
/obj/machinery/power/am_control_unit/attackby(obj/item/W, mob/user, params)
|
||||
if(istype(W, /obj/item/weapon/wrench))
|
||||
if(!anchored)
|
||||
playsound(src.loc, W.usesound, 75, 1)
|
||||
playsound(src.loc, 'sound/items/Ratchet.ogg', 75, 1)
|
||||
user.visible_message("[user.name] secures the [src.name] to the floor.", \
|
||||
"<span class='notice'>You secure the anchor bolts to the floor.</span>", \
|
||||
"<span class='italics'>You hear a ratchet.</span>")
|
||||
src.anchored = 1
|
||||
connect_to_network()
|
||||
else if(!linked_shielding.len > 0)
|
||||
playsound(src.loc, W.usesound, 75, 1)
|
||||
playsound(src.loc, 'sound/items/Ratchet.ogg', 75, 1)
|
||||
user.visible_message("[user.name] unsecures the [src.name].", \
|
||||
"<span class='notice'>You remove the anchor bolts.</span>", \
|
||||
"<span class='italics'>You hear a ratchet.</span>")
|
||||
@@ -180,18 +170,18 @@
|
||||
if(fueljar)
|
||||
user << "<span class='warning'>There is already a [fueljar] inside!</span>"
|
||||
return
|
||||
|
||||
if(!user.unEquip(W))
|
||||
return
|
||||
fueljar = W
|
||||
W.forceMove(src)
|
||||
W.loc = src
|
||||
if(user.client)
|
||||
user.client.screen -= W
|
||||
user.unEquip(W)
|
||||
user.update_icons()
|
||||
user.visible_message("[user.name] loads an [W.name] into the [src.name].", \
|
||||
"<span class='notice'>You load an [W.name].</span>", \
|
||||
"<span class='italics'>You hear a thunk.</span>")
|
||||
else
|
||||
return ..()
|
||||
|
||||
|
||||
/obj/machinery/power/am_control_unit/take_damage(damage, damage_type = BRUTE, sound_effect = 1)
|
||||
switch(damage_type)
|
||||
if(BRUTE)
|
||||
@@ -241,13 +231,13 @@
|
||||
return
|
||||
|
||||
|
||||
/obj/machinery/power/am_control_unit/proc/toggle_power(powerfail = 0)
|
||||
/obj/machinery/power/am_control_unit/proc/toggle_power()
|
||||
active = !active
|
||||
if(active)
|
||||
use_power = 2
|
||||
visible_message("The [src.name] starts up.")
|
||||
else
|
||||
use_power = !powerfail
|
||||
use_power = 1
|
||||
visible_message("The [src.name] shuts down.")
|
||||
update_icon()
|
||||
return
|
||||
@@ -289,7 +279,7 @@
|
||||
|
||||
/obj/machinery/power/am_control_unit/interact(mob/user)
|
||||
if((get_dist(src, user) > 1) || (stat & (BROKEN|NOPOWER)))
|
||||
if(!isAI(user))
|
||||
if(!istype(user, /mob/living/silicon/ai))
|
||||
user.unset_machine()
|
||||
user << browse(null, "window=AMcontrol")
|
||||
return
|
||||
@@ -360,4 +350,4 @@
|
||||
check_core_stability()
|
||||
|
||||
updateDialog()
|
||||
return
|
||||
return
|
||||
@@ -24,8 +24,6 @@
|
||||
var/processing = 0//To track if we are in the update list or not, we need to be when we are damaged and if we ever
|
||||
var/stability = 100//If this gets low bad things tend to happen
|
||||
var/efficiency = 1//How many cores this core counts for when doing power processing, plasma in the air and stability could affect this
|
||||
var/coredirs = 0
|
||||
var/dirs = 0
|
||||
|
||||
|
||||
/obj/machinery/am_shielding/New(loc)
|
||||
@@ -93,6 +91,20 @@
|
||||
/obj/machinery/am_shielding/emp_act()//Immune due to not really much in the way of electronics.
|
||||
return 0
|
||||
|
||||
|
||||
/obj/machinery/am_shielding/blob_act()
|
||||
stability -= 20
|
||||
if(prob(100-stability))
|
||||
if(prob(10))//Might create a node
|
||||
new /obj/effect/blob/node(src.loc,150)
|
||||
else
|
||||
new /obj/effect/blob(src.loc,60)
|
||||
qdel(src)
|
||||
return
|
||||
check_stability()
|
||||
return
|
||||
|
||||
|
||||
/obj/machinery/am_shielding/ex_act(severity, target)
|
||||
stability -= (80 - (severity * 20))
|
||||
check_stability()
|
||||
@@ -107,48 +119,25 @@
|
||||
|
||||
|
||||
/obj/machinery/am_shielding/update_icon()
|
||||
dirs = 0
|
||||
coredirs = 0
|
||||
cut_overlays()
|
||||
for(var/direction in alldirs)
|
||||
var/turf/T = get_step(loc, direction)
|
||||
for(var/obj/machinery/machine in T)
|
||||
if(istype(machine, /obj/machinery/am_shielding))
|
||||
var/obj/machinery/am_shielding/shield = machine
|
||||
if(shield.control_unit == control_unit)
|
||||
if(shield.processing)
|
||||
coredirs |= direction
|
||||
if(direction in cardinal)
|
||||
dirs |= direction
|
||||
|
||||
else
|
||||
if(istype(machine, /obj/machinery/power/am_control_unit) && (direction in cardinal))
|
||||
var/obj/machinery/power/am_control_unit/control = machine
|
||||
if(control == control_unit)
|
||||
dirs |= direction
|
||||
|
||||
|
||||
var/prefix = ""
|
||||
var/icondirs=dirs
|
||||
|
||||
if(coredirs)
|
||||
prefix="core"
|
||||
|
||||
icon_state = "[prefix]shield_[icondirs]"
|
||||
var/machine = locate(/obj/machinery, get_step(loc, direction))
|
||||
if((istype(machine, /obj/machinery/am_shielding) && machine:control_unit == control_unit)||(istype(machine, /obj/machinery/power/am_control_unit) && machine == control_unit))
|
||||
add_overlay("shield_[direction]")
|
||||
|
||||
if(core_check())
|
||||
add_overlay("core[control_unit && control_unit.active]")
|
||||
add_overlay("core")
|
||||
if(!processing)
|
||||
setup_core()
|
||||
else if(processing)
|
||||
shutdown_core()
|
||||
|
||||
|
||||
/obj/machinery/am_shielding/take_damage(damage_amount, damage_type = BRUTE, damage_flag = 0, sound_effect = 1)
|
||||
/obj/machinery/am_shielding/take_damage(damage, damage_type = BRUTE, sound_effect = 1)
|
||||
switch(damage_type)
|
||||
if(BRUTE)
|
||||
if(sound_effect)
|
||||
if(damage_amount)
|
||||
if(damage)
|
||||
playsound(loc, 'sound/weapons/smash.ogg', 50, 1)
|
||||
else
|
||||
playsound(loc, 'sound/weapons/tap.ogg', 50, 1)
|
||||
@@ -157,8 +146,8 @@
|
||||
playsound(src.loc, 'sound/items/Welder.ogg', 100, 1)
|
||||
else
|
||||
return
|
||||
if(damage_amount >= 10)
|
||||
stability -= damage_amount/2
|
||||
if(damage >= 10)
|
||||
stability -= damage/2
|
||||
check_stability()
|
||||
|
||||
|
||||
@@ -176,15 +165,10 @@
|
||||
//Scans cards for shields or the control unit and if all there it
|
||||
/obj/machinery/am_shielding/proc/core_check()
|
||||
for(var/direction in alldirs)
|
||||
var/found_am_device=0
|
||||
for(var/obj/machinery/machine in get_step(loc, direction))
|
||||
//var/machine = locate(/obj/machinery, get_step(loc, direction))
|
||||
if(!machine)
|
||||
continue//Need all for a core
|
||||
if(istype(machine, /obj/machinery/am_shielding) || istype(machine, /obj/machinery/power/am_control_unit))
|
||||
found_am_device = 1
|
||||
break
|
||||
if(!found_am_device)
|
||||
var/machine = locate(/obj/machinery, get_step(loc, direction))
|
||||
if(!machine)
|
||||
return 0//Need all for a core
|
||||
if(!istype(machine, /obj/machinery/am_shielding) && !istype(machine, /obj/machinery/power/am_control_unit))
|
||||
return 0
|
||||
return 1
|
||||
|
||||
@@ -236,7 +220,7 @@
|
||||
icon = 'icons/obj/machines/antimatter.dmi'
|
||||
icon_state = "box"
|
||||
item_state = "electronic"
|
||||
w_class = WEIGHT_CLASS_BULKY
|
||||
w_class = 4
|
||||
flags = CONDUCT
|
||||
throwforce = 5
|
||||
throw_speed = 1
|
||||
|
||||
Reference in New Issue
Block a user