emp rework

This commit is contained in:
Timothy Teakettle
2020-09-09 23:14:06 +01:00
parent 72cb1129db
commit f1cd94fc97
65 changed files with 109 additions and 212 deletions
+3 -22
View File
@@ -30,7 +30,6 @@
var/stored_power = 0//Power to deploy per tick
/obj/machinery/power/am_control_unit/Initialize()
. = ..()
linked_shielding = list()
@@ -44,7 +43,6 @@
QDEL_NULL(fueljar)
return ..()
/obj/machinery/power/am_control_unit/process()
if(exploding)
explosion(get_turf(src),8,12,18,12)
@@ -72,7 +70,6 @@
return
/obj/machinery/power/am_control_unit/proc/produce_power()
playsound(src.loc, 'sound/effects/bang.ogg', 25, 1)
var/core_power = reported_core_efficiency//Effectively how much fuel we can safely deal with
@@ -103,15 +100,9 @@
. = ..()
if(. & EMP_PROTECT_SELF)
return
switch(severity)
if(1)
if(active)
toggle_power()
stability -= rand(15,30)
if(2)
if(active)
toggle_power()
stability -= rand(10,20)
if(active)
toggle_power()
stability -= rand(round(severity/5),round(severity/3))
/obj/machinery/power/am_control_unit/blob_act()
stability -= 20
@@ -123,20 +114,17 @@
check_stability()
return
/obj/machinery/power/am_control_unit/ex_act(severity, target)
stability -= (80 - (severity * 20))
check_stability()
return
/obj/machinery/power/am_control_unit/bullet_act(obj/item/projectile/Proj)
. = ..()
if(Proj.flag != "bullet")
stability -= Proj.force
check_stability()
/obj/machinery/power/am_control_unit/power_change()
..()
if(stat & NOPOWER)
@@ -150,7 +138,6 @@
return
/obj/machinery/power/am_control_unit/update_icon_state()
if(active)
icon_state = "control_on"
@@ -158,7 +145,6 @@
icon_state = "control"
//No other icons for it atm
/obj/machinery/power/am_control_unit/attackby(obj/item/W, mob/user, params)
if(istype(W, /obj/item/wrench))
if(!anchored)
@@ -192,7 +178,6 @@
else
return ..()
/obj/machinery/power/am_control_unit/take_damage(damage, damage_type = BRUTE, sound_effect = 1)
switch(damage_type)
if(BRUTE)
@@ -221,7 +206,6 @@
update_shield_icons = 1
return 1
/obj/machinery/power/am_control_unit/proc/remove_shielding(obj/machinery/am_shielding/AMS)
if(!istype(AMS))
return 0
@@ -231,13 +215,11 @@
toggle_power()
return 1
/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)
qdel(src)
return
/obj/machinery/power/am_control_unit/proc/toggle_power(powerfail = 0)
active = !active
if(active)
@@ -249,7 +231,6 @@
update_icon()
return
/obj/machinery/power/am_control_unit/proc/check_shield_icons()//Forces icon_update for all shields
if(shield_icon_delay)
return