mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-22 19:47:22 +01:00
Merge branch 'master' of https://github.com/ParadiseSS13/Paradise into BookClub
This commit is contained in:
+68
-86
@@ -169,9 +169,7 @@
|
||||
/obj/machinery/power/apc/Destroy()
|
||||
apcs -= src
|
||||
if(malfai && operating)
|
||||
if(ticker.mode.config_tag == "malfunction")
|
||||
if(src.z == ZLEVEL_STATION)
|
||||
ticker.mode:apcs--
|
||||
malfai.malf_picker.processing_time = Clamp(malfai.malf_picker.processing_time - 10,0,1000)
|
||||
area.power_light = 0
|
||||
area.power_equip = 0
|
||||
area.power_environ = 0
|
||||
@@ -762,12 +760,12 @@
|
||||
return ui_interact(user)
|
||||
|
||||
|
||||
/obj/machinery/power/apc/proc/get_malf_status(mob/user)
|
||||
if(ticker && ticker.mode && (user.mind in ticker.mode.malf_ai) && istype(user, /mob/living/silicon/ai))
|
||||
if(src.malfai == (user:parent ? user:parent : user))
|
||||
if(src.occupier == user)
|
||||
/obj/machinery/power/apc/proc/get_malf_status(mob/living/silicon/ai/malf)
|
||||
if(istype(malf) && malf.malf_picker)
|
||||
if(malfai == (malf.parent || malf))
|
||||
if(occupier == malf)
|
||||
return 3 // 3 = User is shunted in this APC
|
||||
else if(istype(user.loc, /obj/machinery/power/apc))
|
||||
else if(istype(malf.loc, /obj/machinery/power/apc))
|
||||
return 4 // 4 = User is shunted in another APC
|
||||
else
|
||||
return 2 // 2 = APC hacked by user, and user is in its core.
|
||||
@@ -976,33 +974,12 @@
|
||||
return 0
|
||||
|
||||
else if(href_list["overload"])
|
||||
if(istype(usr, /mob/living/silicon) && !aidisabled)
|
||||
src.overload_lighting()
|
||||
if(issilicon(usr) && !aidisabled)
|
||||
overload_lighting()
|
||||
|
||||
else if(href_list["malfhack"])
|
||||
var/mob/living/silicon/ai/malfai = usr
|
||||
if(get_malf_status(malfai)==1)
|
||||
if(malfai.malfhacking)
|
||||
to_chat(malfai, "You are already hacking an APC.")
|
||||
return 0
|
||||
to_chat(malfai, "Beginning override of APC systems. This takes some time, and you cannot perform other actions during the process.")
|
||||
malfai.malfhack = src
|
||||
malfai.malfhacking = 1
|
||||
sleep(600)
|
||||
if(src)
|
||||
if(!src.aidisabled)
|
||||
malfai.malfhack = null
|
||||
malfai.malfhacking = 0
|
||||
locked = 1
|
||||
if(ticker.mode.config_tag == "malfunction")
|
||||
if((src.z in config.station_levels)) //if(is_type_in_list(get_area(src), the_station_areas))
|
||||
ticker.mode:apcs++
|
||||
if(usr:parent)
|
||||
src.malfai = usr:parent
|
||||
else
|
||||
src.malfai = usr
|
||||
to_chat(malfai, "Hack complete. The APC is now under your exclusive control.")
|
||||
update_icon()
|
||||
if(get_malf_status(usr))
|
||||
malfhack(usr)
|
||||
|
||||
else if(href_list["occupyapc"])
|
||||
if(get_malf_status(usr))
|
||||
@@ -1024,74 +1001,81 @@
|
||||
|
||||
/obj/machinery/power/apc/proc/toggle_breaker()
|
||||
operating = !operating
|
||||
|
||||
if(malfai)
|
||||
if(ticker.mode.config_tag == "malfunction")
|
||||
if((src.z in config.station_levels)) //if(is_type_in_list(get_area(src), the_station_areas))
|
||||
operating ? ticker.mode:apcs++ : ticker.mode:apcs--
|
||||
|
||||
src.update()
|
||||
update()
|
||||
update_icon()
|
||||
|
||||
/obj/machinery/power/apc/proc/malfoccupy(var/mob/living/silicon/ai/malf)
|
||||
/obj/machinery/power/apc/proc/malfhack(mob/living/silicon/ai/malf)
|
||||
if(!istype(malf))
|
||||
return
|
||||
if(get_malf_status(malf) != 1)
|
||||
return
|
||||
if(malf.malfhacking)
|
||||
to_chat(malf, "You are already hacking an APC.")
|
||||
return
|
||||
to_chat(malf, "Beginning override of APC systems. This takes some time, and you cannot perform other actions during the process.")
|
||||
malf.malfhack = src
|
||||
malf.malfhacking = addtimer(malf, "malfhacked", 600, FALSE, src)
|
||||
|
||||
var/obj/screen/alert/hackingapc/A
|
||||
A = malf.throw_alert("hackingapc", /obj/screen/alert/hackingapc)
|
||||
A.target = src
|
||||
|
||||
/obj/machinery/power/apc/proc/malfoccupy(mob/living/silicon/ai/malf)
|
||||
if(!istype(malf))
|
||||
return
|
||||
if(istype(malf.loc, /obj/machinery/power/apc)) // Already in an APC
|
||||
to_chat(malf, "<span class='warning'>You must evacuate your current apc first.</span>")
|
||||
to_chat(malf, "<span class='warning'>You must evacuate your current APC first!</span>")
|
||||
return
|
||||
if(!malf.can_shunt)
|
||||
to_chat(malf, "<span class='warning'>You cannot shunt.</span>")
|
||||
to_chat(malf, "<span class='warning'>You cannot shunt!</span>")
|
||||
return
|
||||
if(!(src.z in config.station_levels))
|
||||
if(!is_station_level(src.z))
|
||||
return
|
||||
src.occupier = new /mob/living/silicon/ai(src,malf.laws,null,1)
|
||||
src.occupier.adjustOxyLoss(malf.getOxyLoss())
|
||||
if(!findtext(src.occupier.name,"APC Copy"))
|
||||
src.occupier.name = "[malf.name] APC Copy"
|
||||
occupier = new /mob/living/silicon/ai(src,malf.laws,null,1)
|
||||
occupier.adjustOxyLoss(malf.getOxyLoss())
|
||||
if(!findtext(occupier.name, "APC Copy"))
|
||||
occupier.name = "[malf.name] APC Copy"
|
||||
if(malf.parent)
|
||||
src.occupier.parent = malf.parent
|
||||
occupier.parent = malf.parent
|
||||
else
|
||||
src.occupier.parent = malf
|
||||
malf.mind.transfer_to(src.occupier)
|
||||
src.occupier.eyeobj.name = "[src.occupier.name] (AI Eye)"
|
||||
occupier.parent = malf
|
||||
malf.shunted = 1
|
||||
malf.mind.transfer_to(occupier)
|
||||
occupier.eyeobj.name = "[occupier.name] (AI Eye)"
|
||||
if(malf.parent)
|
||||
qdel(malf)
|
||||
src.occupier.verbs += /mob/living/silicon/ai/proc/corereturn
|
||||
src.occupier.verbs += /datum/game_mode/malfunction/proc/takeover
|
||||
src.occupier.cancel_camera()
|
||||
if(seclevel2num(get_security_level()) == SEC_LEVEL_DELTA)
|
||||
for(var/obj/item/weapon/pinpointer/point in world)
|
||||
occupier.verbs += /mob/living/silicon/ai/proc/corereturn
|
||||
occupier.cancel_camera()
|
||||
if((seclevel2num(get_security_level()) == SEC_LEVEL_DELTA) && malf.nuking)
|
||||
for(var/obj/item/weapon/pinpointer/point in pinpointer_list)
|
||||
point.the_disk = src //the pinpointer will detect the shunted AI
|
||||
|
||||
|
||||
/obj/machinery/power/apc/proc/malfvacate(var/forced)
|
||||
if(!src.occupier)
|
||||
/obj/machinery/power/apc/proc/malfvacate(forced)
|
||||
if(!occupier)
|
||||
return
|
||||
if(src.occupier.parent && src.occupier.parent.stat != 2)
|
||||
src.occupier.mind.transfer_to(src.occupier.parent)
|
||||
src.occupier.parent.adjustOxyLoss(src.occupier.getOxyLoss())
|
||||
src.occupier.parent.cancel_camera()
|
||||
qdel(src.occupier) // qdel
|
||||
if(occupier.parent && occupier.parent.stat != DEAD)
|
||||
occupier.mind.transfer_to(occupier.parent)
|
||||
occupier.parent.shunted = 0
|
||||
occupier.parent.adjustOxyLoss(occupier.getOxyLoss())
|
||||
occupier.parent.cancel_camera()
|
||||
qdel(occupier)
|
||||
if(seclevel2num(get_security_level()) == SEC_LEVEL_DELTA)
|
||||
for(var/obj/item/weapon/pinpointer/point in world)
|
||||
for(var/datum/mind/AI_mind in ticker.mode.malf_ai)
|
||||
var/mob/living/silicon/ai/A = AI_mind.current // the current mob the mind owns
|
||||
if(A.stat != DEAD)
|
||||
for(var/obj/item/weapon/pinpointer/point in pinpointer_list)
|
||||
for(var/mob/living/silicon/ai/A in ai_list)
|
||||
if((A.stat != DEAD) && A.nuking)
|
||||
point.the_disk = A //The pinpointer tracks the AI back into its core.
|
||||
|
||||
else
|
||||
to_chat(src.occupier, "<span class='danger'>Primary core damaged, unable to return core processes.</span>")
|
||||
to_chat(occupier, "<span class='danger'>Primary core damaged, unable to return core processes.</span>")
|
||||
if(forced)
|
||||
src.occupier.loc = src.loc
|
||||
src.occupier.death()
|
||||
src.occupier.gib()
|
||||
for(var/obj/item/weapon/pinpointer/point in world)
|
||||
point.the_disk = null //the pinpointer will go back to pointing at the nuke disc.
|
||||
|
||||
occupier.loc = loc
|
||||
occupier.death()
|
||||
occupier.gib()
|
||||
for(var/obj/item/weapon/pinpointer/point in pinpointer_list)
|
||||
point.the_disk = null //Pinpointers go back to tracking the nuke disk
|
||||
|
||||
/obj/machinery/power/apc/proc/ion_act()
|
||||
//intended to be exactly the same as an AI malf attack
|
||||
if(!src.malfhack && (src.z in config.station_levels))
|
||||
if(!src.malfhack && is_station_level(src.z))
|
||||
if(prob(3))
|
||||
src.locked = 1
|
||||
if(src.cell.charge > 0)
|
||||
@@ -1365,9 +1349,7 @@
|
||||
|
||||
/obj/machinery/power/apc/proc/set_broken()
|
||||
if(malfai && operating)
|
||||
if(ticker.mode.config_tag == "malfunction")
|
||||
if((src.z in config.station_levels)) //if(is_type_in_list(get_area(src), the_station_areas))
|
||||
ticker.mode:apcs--
|
||||
malfai.malf_picker.processing_time = Clamp(malfai.malf_picker.processing_time - 10,0,1000)
|
||||
stat |= BROKEN
|
||||
operating = 0
|
||||
if(occupier)
|
||||
@@ -1377,17 +1359,17 @@
|
||||
|
||||
// overload all the lights in this APC area
|
||||
|
||||
/obj/machinery/power/apc/proc/overload_lighting(var/chance = 100)
|
||||
if(/* !get_connection() || */ !operating || shorted)
|
||||
/obj/machinery/power/apc/proc/overload_lighting(chance = 100)
|
||||
if(!operating || shorted)
|
||||
return
|
||||
if( cell && cell.charge>=20)
|
||||
cell.use(20);
|
||||
if(cell && cell.charge >= 20)
|
||||
cell.use(20)
|
||||
spawn(0)
|
||||
for(var/obj/machinery/light/L in area)
|
||||
if(prob(chance))
|
||||
L.on = 1
|
||||
L.broken()
|
||||
sleep(1)
|
||||
stoplag()
|
||||
|
||||
/obj/machinery/power/apc/proc/setsubsystem(val)
|
||||
if(cell && cell.charge > 0)
|
||||
|
||||
@@ -24,7 +24,7 @@ By design, d1 is the smallest direction and d2 is the highest
|
||||
|
||||
/obj/structure/cable
|
||||
level = 1
|
||||
anchored =1
|
||||
anchored = 1
|
||||
on_blueprints = TRUE
|
||||
var/datum/powernet/powernet
|
||||
name = "power cable"
|
||||
@@ -457,10 +457,16 @@ obj/structure/cable/proc/cableColor(var/colorC)
|
||||
|
||||
#define MAXCOIL 30
|
||||
|
||||
var/global/list/datum/stack_recipe/cable_coil_recipes = list(
|
||||
new /datum/stack_recipe/cable_restraints("cable restraints", /obj/item/weapon/restraints/handcuffs/cable, 15),
|
||||
)
|
||||
|
||||
/obj/item/stack/cable_coil
|
||||
name = "cable coil"
|
||||
singular_name = "cable"
|
||||
icon = 'icons/obj/power.dmi'
|
||||
icon_state = "coil"
|
||||
item_state = "coil_red"
|
||||
amount = MAXCOIL
|
||||
max_amount = MAXCOIL
|
||||
color = COLOR_RED
|
||||
@@ -492,6 +498,7 @@ obj/structure/cable/proc/cableColor(var/colorC)
|
||||
pixel_x = rand(-2,2)
|
||||
pixel_y = rand(-2,2)
|
||||
update_icon()
|
||||
recipes = cable_coil_recipes
|
||||
update_wclass()
|
||||
|
||||
///////////////////////////////////
|
||||
@@ -556,37 +563,12 @@ obj/structure/cable/proc/cableColor(var/colorC)
|
||||
else
|
||||
to_chat(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)
|
||||
to_chat(usr, "<span class='warning'>You need at least 15 lengths to make restraints!</span>")
|
||||
return
|
||||
var/obj/item/weapon/restraints/handcuffs/cable/B = new /obj/item/weapon/restraints/handcuffs/cable(usr.loc)
|
||||
B.color = color
|
||||
to_chat(usr, "<span class='notice'>You wind some cable together to make some restraints.</span>")
|
||||
src.use(15)
|
||||
else
|
||||
to_chat(usr, "<span class='warning'>You cannot do that.</span>")
|
||||
..()
|
||||
|
||||
// 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.amount > 1)
|
||||
src.amount--
|
||||
new/obj/item/stack/cable_coil(user.loc, 1,color)
|
||||
to_chat(user, "You cut a piece off the cable coil.")
|
||||
src.update_icon()
|
||||
return
|
||||
else if(istype(W, /obj/item/stack/cable_coil))
|
||||
if(istype(W, /obj/item/stack/cable_coil))
|
||||
var/obj/item/stack/cable_coil/C = W
|
||||
if(C.amount >= MAXCOIL)
|
||||
to_chat(user, "The coil is too long, you cannot add any more cable to it.")
|
||||
|
||||
@@ -124,7 +124,7 @@ var/const/GRAV_NEEDS_WRENCH = 3
|
||||
O.main_part = null
|
||||
qdel(O)
|
||||
for(var/area/A in world)
|
||||
if(!(A.z in config.station_levels)) continue
|
||||
if(!is_station_level(A.z)) continue
|
||||
A.gravitychange(0,A)
|
||||
shake_everyone()
|
||||
return ..()
|
||||
@@ -301,7 +301,7 @@ var/const/GRAV_NEEDS_WRENCH = 3
|
||||
investigate_log("was brought online and is now producing gravity for this level.", "gravity")
|
||||
message_admins("The gravity generator was brought online. (<A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[x];Y=[y];Z=[z]'>[area.name]</a>)")
|
||||
for(var/area/A in world)
|
||||
if(!(A.z in config.station_levels)) continue
|
||||
if(!is_station_level(A.z)) continue
|
||||
A.gravitychange(1,A)
|
||||
else
|
||||
if(gravity_in_level() == 1)
|
||||
@@ -309,7 +309,7 @@ var/const/GRAV_NEEDS_WRENCH = 3
|
||||
investigate_log("was brought offline and there is now no gravity for this level.", "gravity")
|
||||
message_admins("The gravity generator was brought offline with no backup generator. (<A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[x];Y=[y];Z=[z]'>[area.name]</a>)")
|
||||
for(var/area/A in world)
|
||||
if(!(A.z in config.station_levels)) continue
|
||||
if(!is_station_level(A.z)) continue
|
||||
A.gravitychange(0,A)
|
||||
|
||||
update_icon()
|
||||
@@ -377,6 +377,7 @@ var/const/GRAV_NEEDS_WRENCH = 3
|
||||
shake_camera(M, 15, 1)
|
||||
M.playsound_local(our_turf, 'sound/effects/alert.ogg', 100, 1, 0.5)
|
||||
|
||||
// TODO: Make the gravity generator cooperate with the space manager
|
||||
/obj/machinery/gravity_generator/main/proc/gravity_in_level()
|
||||
var/turf/T = get_turf(src)
|
||||
if(!T)
|
||||
|
||||
@@ -514,8 +514,8 @@
|
||||
status = LIGHT_EMPTY
|
||||
update()
|
||||
|
||||
/obj/machinery/light/proc/broken(var/skip_sound_and_sparks = 0)
|
||||
if(status == LIGHT_EMPTY)
|
||||
/obj/machinery/light/proc/broken(skip_sound_and_sparks = 0)
|
||||
if(status == LIGHT_EMPTY || status == LIGHT_BROKEN)
|
||||
return
|
||||
|
||||
if(!skip_sound_and_sparks)
|
||||
@@ -715,4 +715,4 @@
|
||||
var/obj/item/organ/external/limb = user.get_organ(oname)
|
||||
if(limb)
|
||||
limb.droplimb(0, DROPLIMB_BURN)
|
||||
return FIRELOSS
|
||||
return FIRELOSS
|
||||
|
||||
@@ -15,10 +15,8 @@
|
||||
var/obj/machinery/field/generator/FG2 = null
|
||||
|
||||
/obj/machinery/field/containment/Destroy()
|
||||
if(FG1 && !FG1.clean_up)
|
||||
FG1.cleanup()
|
||||
if(FG2 && !FG2.clean_up)
|
||||
FG2.cleanup()
|
||||
FG1.fields -= src
|
||||
FG2.fields -= src
|
||||
return ..()
|
||||
|
||||
/obj/machinery/field/containment/attack_hand(mob/user)
|
||||
@@ -67,35 +65,26 @@
|
||||
/obj/machinery/field
|
||||
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/field/CanPass(mob/mover, turf/target, height=0)
|
||||
/obj/machinery/field/CanPass(atom/movable/mover, turf/target, height=0)
|
||||
if(hasShocked)
|
||||
return 0
|
||||
if(isliving(mover)) // Don't let mobs through
|
||||
shock_field(mover)
|
||||
return 0
|
||||
return ..()
|
||||
|
||||
/obj/machinery/field/CanPass(obj/mover, turf/target, height=0)
|
||||
if((istype(mover, /obj/machinery) && !istype(mover, /obj/singularity)) || \
|
||||
istype(mover, /obj/structure) || \
|
||||
istype(mover, /obj/mecha))
|
||||
if(istype(mover, /obj/machinery) || istype(mover, /obj/structure) || istype(mover, /obj/mecha))
|
||||
bump_field(mover)
|
||||
return 0
|
||||
return ..()
|
||||
|
||||
/obj/machinery/field/proc/shock_field(mob/living/user)
|
||||
if(hasShocked)
|
||||
return 0
|
||||
if(isliving(user))
|
||||
hasShocked = 1
|
||||
var/shock_damage = min(rand(30,40),rand(30,40))
|
||||
|
||||
if(iscarbon(user))
|
||||
var/stun = min(shock_damage, 15)
|
||||
user.Stun(stun)
|
||||
user.Weaken(10)
|
||||
user.burn_skin(shock_damage)
|
||||
user.visible_message("<span class='danger'>[user.name] was shocked by the [src.name]!</span>", \
|
||||
"<span class='userdanger'>You feel a powerful shock course through your body, sending you flying!</span>", \
|
||||
"<span class='italics'>You hear a heavy electrical crack.</span>")
|
||||
user.electrocute_act(shock_damage, src, 1)
|
||||
|
||||
else if(issilicon(user))
|
||||
if(prob(20))
|
||||
@@ -108,13 +97,14 @@
|
||||
user.updatehealth()
|
||||
bump_field(user)
|
||||
|
||||
spawn(5)
|
||||
hasShocked = 0
|
||||
return
|
||||
|
||||
/obj/machinery/field/proc/bump_field(atom/movable/AM as mob|obj)
|
||||
if(hasShocked)
|
||||
return 0
|
||||
hasShocked = 1
|
||||
var/datum/effect/system/spark_spread/s = new /datum/effect/system/spark_spread
|
||||
s.set_up(5, 1, AM.loc)
|
||||
s.start()
|
||||
var/atom/target = get_edge_target_turf(AM, get_dir(src, get_step_away(AM, src)))
|
||||
AM.throw_at(target, 200, 4)
|
||||
spawn(5)
|
||||
hasShocked = 0
|
||||
|
||||
@@ -70,6 +70,14 @@
|
||||
src.dir = turn(src.dir, 90)
|
||||
return 1
|
||||
|
||||
/obj/machinery/power/emitter/AltClick(mob/user)
|
||||
if(user.incapacitated())
|
||||
to_chat(user, "<span class='warning'>You can't do that right now!</span>")
|
||||
return
|
||||
if(!Adjacent(user))
|
||||
return
|
||||
rotate()
|
||||
|
||||
/obj/machinery/power/emitter/initialize()
|
||||
..()
|
||||
if(state == 2 && anchored)
|
||||
|
||||
@@ -13,6 +13,15 @@ field_generator power level display
|
||||
*/
|
||||
|
||||
#define field_generator_max_power 250
|
||||
|
||||
#define FG_UNSECURED 0
|
||||
#define FG_SECURED 1
|
||||
#define FG_WELDED 2
|
||||
|
||||
#define FG_OFFLINE 0
|
||||
#define FG_CHARGING 1
|
||||
#define FG_ONLINE 2
|
||||
|
||||
/obj/machinery/field/generator
|
||||
name = "Field Generator"
|
||||
desc = "A large thermal battery that projects a high amount of energy when powered."
|
||||
@@ -22,134 +31,109 @@ field_generator power level display
|
||||
density = 1
|
||||
use_power = 0
|
||||
var/const/num_power_levels = 6 // Total number of power level icon has
|
||||
var/Varedit_start = 0
|
||||
var/Varpower = 0
|
||||
var/active = 0
|
||||
var/power_level = 0
|
||||
var/active = FG_OFFLINE
|
||||
var/power = 20 // Current amount of power
|
||||
var/state = 0
|
||||
var/state = FG_UNSECURED
|
||||
var/warming_up = 0
|
||||
var/list/obj/machinery/field/containment/fields
|
||||
var/list/obj/machinery/field/generator/connected_gens
|
||||
var/clean_up = 0
|
||||
|
||||
|
||||
/obj/machinery/field/generator/update_icon()
|
||||
overlays.Cut()
|
||||
if(warming_up)
|
||||
overlays += "+a[warming_up]"
|
||||
if(fields.len)
|
||||
overlays += "+on"
|
||||
// Power level indicator
|
||||
// Scale % power to % num_power_levels and truncate value
|
||||
var/level = round(num_power_levels * power / field_generator_max_power)
|
||||
// Clamp between 0 and num_power_levels for out of range power values
|
||||
level = Clamp(level, 0, num_power_levels)
|
||||
if(level)
|
||||
overlays += "+p[level]"
|
||||
|
||||
return
|
||||
if(power_level)
|
||||
overlays += "+p[power_level]"
|
||||
|
||||
|
||||
/obj/machinery/field/generator/New()
|
||||
..()
|
||||
fields = list()
|
||||
connected_gens = list()
|
||||
return
|
||||
|
||||
|
||||
/obj/machinery/field/generator/process()
|
||||
if(Varedit_start == 1)
|
||||
if(active == 0)
|
||||
active = 1
|
||||
state = 2
|
||||
power = field_generator_max_power
|
||||
anchored = 1
|
||||
warming_up = 3
|
||||
start_fields()
|
||||
update_icon()
|
||||
Varedit_start = 0
|
||||
|
||||
if(src.active == 2)
|
||||
if(active == FG_ONLINE)
|
||||
calc_power()
|
||||
update_icon()
|
||||
return
|
||||
|
||||
|
||||
/obj/machinery/field/generator/attack_hand(mob/user)
|
||||
if(state == 2)
|
||||
if(state == FG_WELDED)
|
||||
if(get_dist(src, user) <= 1)//Need to actually touch the thing to turn it on
|
||||
if(src.active >= 1)
|
||||
to_chat(user, "<span class='warning'>You are unable to turn off the [src.name] once it is online!</span>")
|
||||
if(active >= FG_CHARGING)
|
||||
to_chat(user, "<span class='warning'>You are unable to turn off the [name] once it is online!</span>")
|
||||
return 1
|
||||
else
|
||||
user.visible_message("[user.name] turns on the [src.name].", \
|
||||
"<span class='notice'>You turn on the [src.name].</span>", \
|
||||
user.visible_message("[user.name] turns on the [name].", \
|
||||
"<span class='notice'>You turn on the [name].</span>", \
|
||||
"<span class='italics'>You hear heavy droning.</span>")
|
||||
turn_on()
|
||||
investigate_log("<font color='green'>activated</font> by [user.key].","singulo")
|
||||
|
||||
src.add_fingerprint(user)
|
||||
add_fingerprint(user)
|
||||
else
|
||||
to_chat(user, "<span class='warning'>The [src] needs to be firmly secured to the floor first!</span>")
|
||||
return
|
||||
to_chat(user, "<span class='warning'>[src] needs to be firmly secured to the floor first!</span>")
|
||||
|
||||
|
||||
/obj/machinery/field/generator/attackby(obj/item/W, mob/user, params)
|
||||
if(active)
|
||||
to_chat(user, "<span class='warning'>The [src] needs to be off!</span>")
|
||||
to_chat(user, "<span class='warning'>[src] needs to be off!</span>")
|
||||
return
|
||||
else if(istype(W, /obj/item/weapon/wrench))
|
||||
switch(state)
|
||||
if(0)
|
||||
if(FG_UNSECURED)
|
||||
if(isinspace()) return
|
||||
state = 1
|
||||
playsound(src.loc, 'sound/items/Ratchet.ogg', 75, 1)
|
||||
user.visible_message("[user.name] secures [src.name] to the floor.", \
|
||||
state = FG_SECURED
|
||||
playsound(loc, 'sound/items/Ratchet.ogg', 75, 1)
|
||||
user.visible_message("[user.name] secures [name] to the floor.", \
|
||||
"<span class='notice'>You secure the external reinforcing bolts to the floor.</span>", \
|
||||
"<span class='italics'>You hear ratchet.</span>")
|
||||
src.anchored = 1
|
||||
if(1)
|
||||
state = 0
|
||||
playsound(src.loc, 'sound/items/Ratchet.ogg', 75, 1)
|
||||
user.visible_message("[user.name] unsecures [src.name] reinforcing bolts from the floor.", \
|
||||
anchored = 1
|
||||
if(FG_SECURED)
|
||||
state = FG_UNSECURED
|
||||
playsound(loc, 'sound/items/Ratchet.ogg', 75, 1)
|
||||
user.visible_message("[user.name] unsecures [name] reinforcing bolts from the floor.", \
|
||||
"<span class='notice'>You undo the external reinforcing bolts.</span>", \
|
||||
"<span class='italics'>You hear ratchet.</span>")
|
||||
src.anchored = 0
|
||||
if(2)
|
||||
to_chat(user, "<span class='warning'>The [src.name] needs to be unwelded from the floor!</span>")
|
||||
return
|
||||
anchored = 0
|
||||
if(FG_WELDED)
|
||||
to_chat(user, "<span class='warning'>The [name] needs to be unwelded from the floor!</span>")
|
||||
|
||||
else if(istype(W, /obj/item/weapon/weldingtool))
|
||||
var/obj/item/weapon/weldingtool/WT = W
|
||||
switch(state)
|
||||
if(0)
|
||||
to_chat(user, "<span class='warning'>The [src.name] needs to be wrenched to the floor!</span>")
|
||||
return
|
||||
if(1)
|
||||
if(FG_UNSECURED)
|
||||
to_chat(user, "<span class='warning'>The [name] needs to be wrenched to the floor!</span>")
|
||||
|
||||
if(FG_SECURED)
|
||||
if(WT.remove_fuel(0,user))
|
||||
playsound(src.loc, 'sound/items/Welder2.ogg', 50, 1)
|
||||
user.visible_message("[user.name] starts to weld the [src.name] to the floor.", \
|
||||
playsound(loc, 'sound/items/Welder2.ogg', 50, 1)
|
||||
user.visible_message("[user.name] starts to weld the [name] to the floor.", \
|
||||
"<span class='notice'>You start to weld \the [src] to the floor...</span>", \
|
||||
"<span class='italics'>You hear welding.</span>")
|
||||
if(do_after(user,20, target = src))
|
||||
if(!src || !WT.isOn()) return
|
||||
state = 2
|
||||
if(!src || !WT.isOn())
|
||||
return
|
||||
state = FG_WELDED
|
||||
to_chat(user, "<span class='notice'>You weld the field generator to the floor.</span>")
|
||||
else
|
||||
return
|
||||
if(2)
|
||||
|
||||
if(FG_WELDED)
|
||||
if(WT.remove_fuel(0,user))
|
||||
playsound(src.loc, 'sound/items/Welder2.ogg', 50, 1)
|
||||
user.visible_message("[user.name] starts to cut the [src.name] free from the floor.", \
|
||||
playsound(loc, 'sound/items/Welder2.ogg', 50, 1)
|
||||
user.visible_message("[user.name] starts to cut the [name] free from the floor.", \
|
||||
"<span class='notice'>You start to cut \the [src] free from the floor...</span>", \
|
||||
"<span class='italics'>You hear welding.</span>")
|
||||
if(do_after(user,20, target = src))
|
||||
if(!src || !WT.isOn()) return
|
||||
state = 1
|
||||
if(!src || !WT.isOn())
|
||||
return
|
||||
state = FG_SECURED
|
||||
to_chat(user, "<span class='notice'>You cut \the [src] free from the floor.</span>")
|
||||
else
|
||||
return
|
||||
|
||||
else
|
||||
..()
|
||||
return ..()
|
||||
|
||||
|
||||
/obj/machinery/field/generator/emp_act()
|
||||
@@ -164,30 +148,35 @@ field_generator power level display
|
||||
|
||||
/obj/machinery/field/generator/bullet_act(obj/item/projectile/Proj)
|
||||
if(Proj.flag != "bullet")
|
||||
power += Proj.damage
|
||||
update_icon()
|
||||
power = min(power + Proj.damage, field_generator_max_power)
|
||||
check_power_level()
|
||||
return 0
|
||||
|
||||
|
||||
/obj/machinery/field/generator/Destroy()
|
||||
src.cleanup()
|
||||
cleanup()
|
||||
return ..()
|
||||
|
||||
|
||||
/obj/machinery/field/generator/proc/check_power_level()
|
||||
var/new_level = round(num_power_levels * power / field_generator_max_power)
|
||||
if(new_level != power_level)
|
||||
power_level = new_level
|
||||
update_icon()
|
||||
|
||||
/obj/machinery/field/generator/proc/turn_off()
|
||||
active = 0
|
||||
active = FG_OFFLINE
|
||||
spawn(1)
|
||||
src.cleanup()
|
||||
while(warming_up>0 && !active)
|
||||
cleanup()
|
||||
while(warming_up > 0 && !active)
|
||||
sleep(50)
|
||||
warming_up--
|
||||
update_icon()
|
||||
|
||||
/obj/machinery/field/generator/proc/turn_on()
|
||||
active = 1
|
||||
active = FG_CHARGING
|
||||
spawn(1)
|
||||
while(warming_up<3 && active)
|
||||
while(warming_up < 3 && active)
|
||||
sleep(50)
|
||||
warming_up++
|
||||
update_icon()
|
||||
@@ -196,44 +185,35 @@ field_generator power level display
|
||||
|
||||
|
||||
/obj/machinery/field/generator/proc/calc_power()
|
||||
if(Varpower)
|
||||
return 1
|
||||
var/power_draw = 2 + fields.len
|
||||
|
||||
update_icon()
|
||||
if(src.power > field_generator_max_power)
|
||||
src.power = field_generator_max_power
|
||||
|
||||
var/power_draw = 2
|
||||
for(var/obj/machinery/field/containment/F in fields)
|
||||
if(isnull(F))
|
||||
continue
|
||||
power_draw++
|
||||
if(draw_power(round(power_draw/2,1)))
|
||||
if(draw_power(round(power_draw/2, 1)))
|
||||
check_power_level()
|
||||
return 1
|
||||
else
|
||||
visible_message("<span class='danger'>The [src.name] shuts down!</span>", "<span class='italics'>You hear something shutting down.</span>")
|
||||
visible_message("<span class='danger'>The [name] shuts down!</span>", "<span class='italics'>You hear something shutting down.</span>")
|
||||
turn_off()
|
||||
investigate_log("ran out of power and <font color='red'>deactivated</font>","singulo")
|
||||
src.power = 0
|
||||
power = 0
|
||||
check_power_level()
|
||||
return 0
|
||||
|
||||
//This could likely be better, it tends to start loopin if you have a complex generator loop setup. Still works well enough to run the engine fields will likely recode the field gens and fields sometime -Mport
|
||||
/obj/machinery/field/generator/proc/draw_power(draw = 0, failsafe = 0, obj/machinery/field/generator/G = null, obj/machinery/field/generator/last = null)
|
||||
if(Varpower)
|
||||
return 1
|
||||
if((G && G == src) || (failsafe >= 8))//Loopin, set fail
|
||||
if((G && (G == src)) || (failsafe >= 8))//Loopin, set fail
|
||||
return 0
|
||||
else
|
||||
failsafe++
|
||||
if(src.power >= draw)//We have enough power
|
||||
src.power -= draw
|
||||
|
||||
if(power >= draw)//We have enough power
|
||||
power -= draw
|
||||
return 1
|
||||
|
||||
else//Need more power
|
||||
draw -= src.power
|
||||
src.power = 0
|
||||
for(var/obj/machinery/field/generator/FG in connected_gens)
|
||||
if(isnull(FG))
|
||||
continue
|
||||
draw -= power
|
||||
power = 0
|
||||
for(var/CG in connected_gens)
|
||||
var/obj/machinery/field/generator/FG = CG
|
||||
if(FG == last)//We just asked you
|
||||
continue
|
||||
if(G)//Another gen is askin for power and we dont have it
|
||||
@@ -249,7 +229,7 @@ field_generator power level display
|
||||
|
||||
|
||||
/obj/machinery/field/generator/proc/start_fields()
|
||||
if(!src.state == 2 || !anchored)
|
||||
if(state != FG_WELDED || !anchored)
|
||||
turn_off()
|
||||
return
|
||||
spawn(1)
|
||||
@@ -260,82 +240,73 @@ field_generator power level display
|
||||
setup_field(4)
|
||||
spawn(4)
|
||||
setup_field(8)
|
||||
src.active = 2
|
||||
spawn(5)
|
||||
active = FG_ONLINE
|
||||
|
||||
|
||||
/obj/machinery/field/generator/proc/setup_field(NSEW)
|
||||
var/turf/T = src.loc
|
||||
var/obj/machinery/field/generator/G
|
||||
var/turf/T = loc
|
||||
if(!istype(T))
|
||||
return 0
|
||||
|
||||
var/obj/machinery/field/generator/G = null
|
||||
var/steps = 0
|
||||
if(!NSEW)//Make sure its ran right
|
||||
return
|
||||
for(var/dist = 0, dist <= 9, dist += 1) // checks out to 8 tiles away for another generator
|
||||
return 0
|
||||
for(var/dist in 0 to 7) // checks out to 8 tiles away for another generator
|
||||
T = get_step(T, NSEW)
|
||||
if(T.density)//We cant shoot a field though this
|
||||
return 0
|
||||
for(var/atom/A in T.contents)
|
||||
if(ismob(A))
|
||||
continue
|
||||
if(!istype(A,/obj/machinery/field/generator))
|
||||
if((istype(A,/obj/machinery/door)||istype(A,/obj/machinery/the_singularitygen))&&(A.density))
|
||||
return 0
|
||||
steps += 1
|
||||
|
||||
G = locate(/obj/machinery/field/generator) in T
|
||||
if(!isnull(G))
|
||||
if(G)
|
||||
steps -= 1
|
||||
if(!G.active)
|
||||
return 0
|
||||
break
|
||||
if(isnull(G))
|
||||
return
|
||||
T = src.loc
|
||||
for(var/dist = 0, dist < steps, dist += 1) // creates each field tile
|
||||
|
||||
for(var/TC in T.contents)
|
||||
var/atom/A = TC
|
||||
if(ismob(A))
|
||||
continue
|
||||
if(A.density)
|
||||
return 0
|
||||
|
||||
steps++
|
||||
|
||||
if(!G)
|
||||
return 0
|
||||
|
||||
T = loc
|
||||
for(var/dist in 0 to steps) // creates each field tile
|
||||
var/field_dir = get_dir(T,get_step(G.loc, NSEW))
|
||||
T = get_step(T, NSEW)
|
||||
if(!locate(/obj/machinery/field/containment) in T)
|
||||
var/obj/machinery/field/containment/CF = new/obj/machinery/field/containment()
|
||||
CF.set_master(src,G)
|
||||
fields += CF
|
||||
G.fields += CF
|
||||
CF.loc = T
|
||||
CF.dir = field_dir
|
||||
for(var/mob/living/L in CF.loc)
|
||||
fields += CF
|
||||
G.fields += CF
|
||||
for(var/mob/living/L in T)
|
||||
CF.Crossed(L)
|
||||
var/listcheck = 0
|
||||
for(var/obj/machinery/field/generator/FG in connected_gens)
|
||||
if(isnull(FG))
|
||||
continue
|
||||
if(FG == G)
|
||||
listcheck = 1
|
||||
break
|
||||
if(!listcheck)
|
||||
connected_gens.Add(G)
|
||||
listcheck = 0
|
||||
for(var/obj/machinery/field/generator/FG2 in G.connected_gens)
|
||||
if(isnull(FG2))
|
||||
continue
|
||||
if(FG2 == src)
|
||||
listcheck = 1
|
||||
break
|
||||
if(!listcheck)
|
||||
G.connected_gens.Add(src)
|
||||
|
||||
connected_gens |= G
|
||||
G.connected_gens |= src
|
||||
update_icon()
|
||||
|
||||
|
||||
/obj/machinery/field/generator/proc/cleanup()
|
||||
clean_up = 1
|
||||
for(var/obj/machinery/field/containment/F in fields)
|
||||
if(isnull(F))
|
||||
continue
|
||||
for(var/F in fields)
|
||||
qdel(F)
|
||||
fields = list()
|
||||
for(var/obj/machinery/field/generator/FG in connected_gens)
|
||||
if(isnull(FG))
|
||||
continue
|
||||
FG.connected_gens.Remove(src)
|
||||
|
||||
for(var/CG in connected_gens)
|
||||
var/obj/machinery/field/generator/FG = CG
|
||||
FG.connected_gens -= src
|
||||
if(!FG.clean_up)//Makes the other gens clean up as well
|
||||
FG.cleanup()
|
||||
connected_gens.Remove(FG)
|
||||
connected_gens = list()
|
||||
connected_gens -= FG
|
||||
clean_up = 0
|
||||
update_icon()
|
||||
|
||||
@@ -359,3 +330,11 @@ field_generator power level display
|
||||
/obj/machinery/field/generator/bump_field(atom/movable/AM as mob|obj)
|
||||
if(fields.len)
|
||||
..()
|
||||
|
||||
#undef FG_UNSECURED
|
||||
#undef FG_SECURED
|
||||
#undef FG_WELDED
|
||||
|
||||
#undef FG_OFFLINE
|
||||
#undef FG_CHARGING
|
||||
#undef FG_ONLINE
|
||||
|
||||
@@ -101,6 +101,14 @@ So, hopefully this is helpful if any more icons are to be added/changed/wonderin
|
||||
src.dir = turn(src.dir, 270)
|
||||
return 1
|
||||
|
||||
/obj/structure/particle_accelerator/AltClick(mob/user)
|
||||
if(user.incapacitated())
|
||||
to_chat(user, "<span class='warning'>You can't do that right now!</span>")
|
||||
return
|
||||
if(!Adjacent(user))
|
||||
return
|
||||
rotate()
|
||||
|
||||
/obj/structure/particle_accelerator/verb/rotateccw()
|
||||
set name = "Rotate Counter Clockwise"
|
||||
set category = "Object"
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
var/last_warning
|
||||
var/consumedSupermatter = 0 //If the singularity has eaten a supermatter shard and can go to stage six
|
||||
allow_spin = 0
|
||||
burn_state = LAVA_PROOF
|
||||
|
||||
/obj/singularity/New(loc, var/starting_energy = 50, var/temp = 0)
|
||||
//CARN: admin-alert for chuckle-fuckery.
|
||||
@@ -148,17 +149,18 @@
|
||||
dissipate_delay = 10
|
||||
dissipate_track = 0
|
||||
dissipate_strength = 1
|
||||
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
|
||||
current_size = STAGE_TWO
|
||||
icon = 'icons/effects/96x96.dmi'
|
||||
icon_state = "singularity_s3"
|
||||
pixel_x = -32
|
||||
pixel_y = -32
|
||||
grav_pull = 6
|
||||
consume_range = 1
|
||||
dissipate_delay = 5
|
||||
dissipate_track = 0
|
||||
dissipate_strength = 5
|
||||
if(STAGE_TWO)
|
||||
if((check_turfs_in(1,1))&&(check_turfs_in(2,1))&&(check_turfs_in(4,1))&&(check_turfs_in(8,1)))
|
||||
current_size = STAGE_TWO
|
||||
icon = 'icons/effects/96x96.dmi'
|
||||
icon_state = "singularity_s3"
|
||||
pixel_x = -32
|
||||
pixel_y = -32
|
||||
grav_pull = 6
|
||||
consume_range = 1
|
||||
dissipate_delay = 5
|
||||
dissipate_track = 0
|
||||
dissipate_strength = 5
|
||||
if(STAGE_THREE)
|
||||
if((check_turfs_in(1,2))&&(check_turfs_in(2,2))&&(check_turfs_in(4,2))&&(check_turfs_in(8,2)))
|
||||
current_size = STAGE_THREE
|
||||
@@ -237,22 +239,22 @@
|
||||
|
||||
/obj/singularity/proc/eat()
|
||||
set background = BACKGROUND_ENABLED
|
||||
for(var/tile in spiral_range_turfs(grav_pull, src, 1))
|
||||
for(var/tile in spiral_range_turfs(grav_pull, src))
|
||||
var/turf/T = tile
|
||||
if(!T)
|
||||
if(!T || !isturf(loc))
|
||||
continue
|
||||
if(get_dist(T, src) > consume_range)
|
||||
T.singularity_pull(src, current_size)
|
||||
else
|
||||
consume(T)
|
||||
for(var/thing in T)
|
||||
var/atom/movable/X = thing
|
||||
if(get_dist(X, src) > consume_range)
|
||||
X.singularity_pull(src, current_size)
|
||||
else
|
||||
consume(X)
|
||||
if(isturf(loc) && thing != src)
|
||||
var/atom/movable/X = thing
|
||||
if(get_dist(X, src) > consume_range)
|
||||
X.singularity_pull(src, current_size)
|
||||
else
|
||||
consume(X)
|
||||
CHECK_TICK
|
||||
return
|
||||
|
||||
/obj/singularity/proc/consume(var/atom/A)
|
||||
var/gain = A.singularity_act(current_size)
|
||||
|
||||
@@ -433,7 +433,7 @@
|
||||
return 1
|
||||
|
||||
/obj/machinery/power/smes/proc/ion_act()
|
||||
if(src.z in config.station_levels)
|
||||
if(is_station_level(src.z))
|
||||
if(prob(1)) //explosion
|
||||
for(var/mob/M in viewers(src))
|
||||
M.show_message("\red The [src.name] is making strange noises!", 3, "\red You hear sizzling electronics.", 2)
|
||||
|
||||
@@ -1,179 +0,0 @@
|
||||
//separate dm since hydro is getting bloated already
|
||||
|
||||
/obj/effect/supermatter_crystal
|
||||
name = "supermatter growth"
|
||||
anchored = 1
|
||||
opacity = 0
|
||||
density = 0
|
||||
icon = 'icons/obj/lighting.dmi'
|
||||
icon_state = "supermatter_crystalf"
|
||||
layer = 2.1
|
||||
light_color = "#8A8A00"
|
||||
|
||||
var/endurance = 100
|
||||
var/delay = 1200
|
||||
var/floor = 0
|
||||
var/spreadChance = 10
|
||||
var/spreadIntoAdjacentChance = 10
|
||||
var/lastTick = 0
|
||||
var/spreaded = 1
|
||||
var/deleted = 0
|
||||
|
||||
/obj/effect/supermatter_crystal/single
|
||||
spreadChance = 0
|
||||
|
||||
/obj/effect/supermatter_crystal/New()
|
||||
..()
|
||||
light_color = "#8A8A00"
|
||||
|
||||
dir = CalcDir()
|
||||
|
||||
if(!floor)
|
||||
switch(dir) //offset to make it be on the wall rather than on the floor
|
||||
if(NORTH)
|
||||
pixel_y = 32
|
||||
if(SOUTH)
|
||||
pixel_y = -32
|
||||
if(EAST)
|
||||
pixel_x = 32
|
||||
if(WEST)
|
||||
pixel_x = -32
|
||||
icon_state = "supermatter_crystal"
|
||||
else
|
||||
if( prob( 10 )) // Only 10% of all floor crystals survive, so there's not a forest of 'em
|
||||
icon_state = "supermatter_crystalf"
|
||||
name = "supermatter crystal"
|
||||
density = 1
|
||||
else
|
||||
deleted = 1
|
||||
del( src )
|
||||
|
||||
processing_objects += src
|
||||
|
||||
set_light(3)
|
||||
lastTick = world.timeofday
|
||||
|
||||
/obj/effect/supermatter_crystal/Del()
|
||||
if( !deleted )
|
||||
visible_message("\red <B>\The [src] shatters!</B>")
|
||||
new /obj/item/weapon/shard/supermatter( src.loc )
|
||||
|
||||
processing_objects -= src
|
||||
..()
|
||||
|
||||
/obj/effect/supermatter_crystal/process()
|
||||
if(!spreaded)
|
||||
return
|
||||
|
||||
if(((world.timeofday - lastTick) > delay) || ((world.timeofday - lastTick) < 0))
|
||||
lastTick = world.timeofday
|
||||
spreaded = 0
|
||||
|
||||
for(var/mob/living/l in range( src, 2 ))
|
||||
var/rads = 5
|
||||
l.apply_effect(rads, IRRADIATE)
|
||||
|
||||
for(var/i=1,i<=3,i++)
|
||||
if(prob(spreadChance))
|
||||
var/list/possibleLocs = list()
|
||||
var/spreadsIntoAdjacent = 0
|
||||
|
||||
if(prob(spreadIntoAdjacentChance))
|
||||
spreadsIntoAdjacent = 1
|
||||
|
||||
for(var/turf/simulated/floor/floor in view(3,src))
|
||||
if(spreadsIntoAdjacent || !locate(/obj/effect/supermatter_crystal) in view(1,floor))
|
||||
possibleLocs += floor
|
||||
|
||||
if(!possibleLocs.len)
|
||||
break
|
||||
|
||||
var/turf/newLoc = pick(possibleLocs)
|
||||
|
||||
var/crystalCount = 0 //hacky
|
||||
var/placeCount = 1
|
||||
for(var/obj/effect/supermatter_crystal/shroom in newLoc)
|
||||
crystalCount++
|
||||
for(var/wallDir in cardinal)
|
||||
var/turf/isWall = get_step(newLoc,wallDir)
|
||||
if(isWall.density)
|
||||
placeCount++
|
||||
if(crystalCount >= placeCount)
|
||||
continue
|
||||
|
||||
var/obj/effect/supermatter_crystal/child = new /obj/effect/supermatter_crystal(newLoc)
|
||||
if( child )
|
||||
child.delay = delay
|
||||
child.endurance = endurance
|
||||
|
||||
spreaded++
|
||||
|
||||
/obj/effect/supermatter_crystal/proc/CalcDir(turf/location = loc)
|
||||
for(var/wallDir in cardinal)
|
||||
var/turf/newTurf = get_step(location,wallDir)
|
||||
if(newTurf.density)
|
||||
return wallDir
|
||||
|
||||
/*
|
||||
var/direction = 16
|
||||
|
||||
for(var/wallDir in cardinal)
|
||||
var/turf/newTurf = get_step(location,wallDir)
|
||||
if(newTurf.density)
|
||||
direction |= wallDir
|
||||
|
||||
for(var/obj/effect/supermatter_crystal/crystal in location)
|
||||
if(crystal == src)
|
||||
continue
|
||||
if(crystal.floor) //special
|
||||
direction &= ~16
|
||||
else
|
||||
direction &= ~crystal.dir
|
||||
|
||||
var/list/dirList = list()
|
||||
|
||||
for(var/i=1,i<=16,i <<= 1)
|
||||
if(direction & i)
|
||||
dirList += i
|
||||
|
||||
if(dirList.len)
|
||||
var/newDir = pick(dirList)
|
||||
if(newDir == 16)
|
||||
floor = 1
|
||||
newDir = 1
|
||||
return newDir
|
||||
*/
|
||||
floor = 1
|
||||
return 1
|
||||
|
||||
/obj/effect/supermatter_crystal/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
..()
|
||||
|
||||
endurance -= W.force
|
||||
|
||||
CheckEndurance()
|
||||
|
||||
/obj/effect/supermatter_crystal/ex_act(severity)
|
||||
switch(severity)
|
||||
if(1.0)
|
||||
qdel(src)
|
||||
return
|
||||
if(2.0)
|
||||
if(prob(50))
|
||||
qdel(src)
|
||||
return
|
||||
if(3.0)
|
||||
if(prob(5))
|
||||
qdel(src)
|
||||
return
|
||||
else
|
||||
return
|
||||
|
||||
/obj/effect/supermatter_crystal/fire_act(datum/gas_mixture/air, exposed_temperature, exposed_volume)
|
||||
if(exposed_temperature > 300)
|
||||
endurance -= 5
|
||||
CheckEndurance()
|
||||
|
||||
/obj/effect/supermatter_crystal/proc/CheckEndurance()
|
||||
if(endurance <= 0)
|
||||
qdel(src)
|
||||
@@ -44,7 +44,7 @@
|
||||
/obj/item/weapon/shard/supermatter/Crossed(AM as mob|obj)
|
||||
if(ismob(AM))
|
||||
var/mob/M = AM
|
||||
to_chat(M, "\red <B>You step on \the [src]!</B>")
|
||||
to_chat(M, "<span class='danger'>You step on \the [src]!</span>")
|
||||
playsound(src.loc, 'sound/effects/glass_step_sm.ogg', 70, 1) // not sure how to handle metal shards with sounds
|
||||
if(ishuman(M))
|
||||
var/mob/living/carbon/human/H = M
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#define TESLA_DEFAULT_POWER 1738260
|
||||
#define TESLA_MINI_POWER 869130
|
||||
|
||||
var/list/blacklisted_tesla_types = list(/obj/machinery/atmospherics,
|
||||
var/list/blacklisted_tesla_types = typecacheof(list(/obj/machinery/atmospherics,
|
||||
/obj/machinery/power/emitter,
|
||||
/obj/machinery/field/generator,
|
||||
/mob/living/simple_animal,
|
||||
@@ -15,7 +15,7 @@ var/list/blacklisted_tesla_types = list(/obj/machinery/atmospherics,
|
||||
/obj/machinery/field/containment,
|
||||
/obj/structure/disposalpipe,
|
||||
/obj/structure/sign,
|
||||
/obj/machinery/gateway)
|
||||
/obj/machinery/gateway))
|
||||
|
||||
/obj/singularity/energy_ball
|
||||
name = "energy ball"
|
||||
@@ -175,7 +175,7 @@ var/list/blacklisted_tesla_types = list(/obj/machinery/atmospherics,
|
||||
closest_atom = A
|
||||
closest_dist = dist
|
||||
|
||||
else if(closest_grounding_rod || is_type_in_list(A, blacklisted_tesla_types))
|
||||
else if(closest_grounding_rod || is_type_in_typecache(A, blacklisted_tesla_types))
|
||||
continue
|
||||
|
||||
else if(istype(A, /mob/living))
|
||||
|
||||
Reference in New Issue
Block a user