mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-21 19:17:50 +01:00
Merge branch 'master' of https://github.com/ParadiseSS13/Paradise into space_ruins
All hail glorious leader tigercat
This commit is contained in:
+90
-90
@@ -146,14 +146,14 @@
|
||||
|
||||
// offset 24 pixels in direction of dir
|
||||
// this allows the APC to be embedded in a wall, yet still inside an area
|
||||
if (building)
|
||||
if(building)
|
||||
dir = ndir
|
||||
src.tdir = dir // to fix Vars bug
|
||||
dir = SOUTH
|
||||
|
||||
pixel_x = (src.tdir & 3)? 0 : (src.tdir == 4 ? 24 : -24)
|
||||
pixel_y = (src.tdir & 3)? (src.tdir ==1 ? 24 : -24) : 0
|
||||
if (building==0)
|
||||
if(building==0)
|
||||
init()
|
||||
else
|
||||
area = src.loc.loc
|
||||
@@ -169,8 +169,8 @@
|
||||
/obj/machinery/power/apc/Destroy()
|
||||
apcs -= src
|
||||
if(malfai && operating)
|
||||
if (ticker.mode.config_tag == "malfunction")
|
||||
if (src.z == ZLEVEL_STATION)
|
||||
if(ticker.mode.config_tag == "malfunction")
|
||||
if(src.z == ZLEVEL_STATION)
|
||||
ticker.mode:apcs--
|
||||
area.power_light = 0
|
||||
area.power_equip = 0
|
||||
@@ -233,17 +233,17 @@
|
||||
if(opened)
|
||||
if(has_electronics && terminal)
|
||||
to_chat(user, "The cover is [opened==2?"removed":"open"] and the power cell is [ cell ? "installed" : "missing"].")
|
||||
else if (!has_electronics && terminal)
|
||||
else if(!has_electronics && terminal)
|
||||
to_chat(user, "There are some wires but no any electronics.")
|
||||
else if (has_electronics && !terminal)
|
||||
else if(has_electronics && !terminal)
|
||||
to_chat(user, "Electronics installed but not wired.")
|
||||
else /* if (!has_electronics && !terminal) */
|
||||
else /* if(!has_electronics && !terminal) */
|
||||
to_chat(user, "There is no electronics nor connected wires.")
|
||||
|
||||
else
|
||||
if (stat & MAINT)
|
||||
if(stat & MAINT)
|
||||
to_chat(user, "The cover is closed. Something wrong with it: it doesn't work.")
|
||||
else if (malfhack)
|
||||
else if(malfhack)
|
||||
to_chat(user, "The cover is broken. It may be hard to force it open.")
|
||||
else
|
||||
to_chat(user, "The cover is closed.")
|
||||
@@ -252,7 +252,7 @@
|
||||
// also add overlays for indicator lights
|
||||
/obj/machinery/power/apc/update_icon()
|
||||
|
||||
if (!status_overlays)
|
||||
if(!status_overlays)
|
||||
status_overlays = 1
|
||||
status_overlays_lock = new
|
||||
status_overlays_charging = new
|
||||
@@ -374,7 +374,7 @@
|
||||
else if(charging == 2)
|
||||
update_overlay |= APC_UPOVERLAY_CHARGEING2
|
||||
|
||||
if (!equipment)
|
||||
if(!equipment)
|
||||
update_overlay |= APC_UPOVERLAY_EQUIPMENT0
|
||||
else if(equipment == 1)
|
||||
update_overlay |= APC_UPOVERLAY_EQUIPMENT1
|
||||
@@ -426,20 +426,20 @@
|
||||
//attack with an item - open/close cover, insert cell, or (un)lock interface
|
||||
/obj/machinery/power/apc/attackby(obj/item/W, mob/living/user, params)
|
||||
|
||||
if (istype(user, /mob/living/silicon) && get_dist(src,user)>1)
|
||||
if(istype(user, /mob/living/silicon) && get_dist(src,user)>1)
|
||||
return src.attack_hand(user)
|
||||
if (istype(W, /obj/item/weapon/crowbar) && opened)
|
||||
if (has_electronics==1)
|
||||
if (terminal)
|
||||
if(istype(W, /obj/item/weapon/crowbar) && opened)
|
||||
if(has_electronics==1)
|
||||
if(terminal)
|
||||
to_chat(user, "<span class='warning'>Disconnect wires first.</span>")
|
||||
return
|
||||
playsound(src.loc, 'sound/items/Crowbar.ogg', 50, 1)
|
||||
to_chat(user, "You are trying to remove the power control board...")//lpeters - fixed grammar issues
|
||||
|
||||
if(do_after(user, 50, target = src))
|
||||
if (has_electronics==1)
|
||||
if(has_electronics==1)
|
||||
has_electronics = 0
|
||||
if ((stat & BROKEN) || malfhack)
|
||||
if((stat & BROKEN) || malfhack)
|
||||
user.visible_message(\
|
||||
"<span class='warning'>[user.name] has broken the power control board inside [src.name]!</span>",\
|
||||
"<span class='notice'>You broke the charred power control board and remove the remains.</span>",
|
||||
@@ -450,22 +450,22 @@
|
||||
"<span class='warning'>[user.name] has removed the power control board from [src.name]!</span>",\
|
||||
"<span class='notice'>You remove the power control board.</span>")
|
||||
new /obj/item/weapon/apc_electronics(loc)
|
||||
else if (opened!=2) //cover isn't removed
|
||||
else if(opened!=2) //cover isn't removed
|
||||
opened = 0
|
||||
update_icon()
|
||||
else if (istype(W, /obj/item/weapon/crowbar) && !((stat & BROKEN) || malfhack) )
|
||||
else if(istype(W, /obj/item/weapon/crowbar) && !((stat & BROKEN) || malfhack) )
|
||||
if(coverlocked && !(stat & MAINT))
|
||||
to_chat(user, "<span class='warning'>The cover is locked and cannot be opened.</span>")
|
||||
return
|
||||
else
|
||||
opened = 1
|
||||
update_icon()
|
||||
else if (istype(W, /obj/item/weapon/stock_parts/cell) && opened) // trying to put a cell inside
|
||||
else if(istype(W, /obj/item/weapon/stock_parts/cell) && opened) // trying to put a cell inside
|
||||
if(cell)
|
||||
to_chat(user, "There is a power cell already installed.")
|
||||
return
|
||||
else
|
||||
if (stat & MAINT)
|
||||
if(stat & MAINT)
|
||||
to_chat(user, "<span class='warning'>There is no connector for your power cell.</span>")
|
||||
return
|
||||
user.drop_item()
|
||||
@@ -476,19 +476,19 @@
|
||||
"You insert the power cell.")
|
||||
chargecount = 0
|
||||
update_icon()
|
||||
else if (istype(W, /obj/item/weapon/screwdriver)) // haxing
|
||||
else if(istype(W, /obj/item/weapon/screwdriver)) // haxing
|
||||
if(opened)
|
||||
if (cell)
|
||||
if(cell)
|
||||
to_chat(user, "<span class='warning'>Close the APC first.</span>")//Less hints more mystery!
|
||||
|
||||
return
|
||||
else
|
||||
if (has_electronics==1 && terminal)
|
||||
if(has_electronics==1 && terminal)
|
||||
has_electronics = 2
|
||||
stat &= ~MAINT
|
||||
playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1)
|
||||
to_chat(user, "You screw the circuit electronics into place.")
|
||||
else if (has_electronics==2)
|
||||
else if(has_electronics==2)
|
||||
has_electronics = 1
|
||||
stat |= MAINT
|
||||
playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1)
|
||||
@@ -504,7 +504,7 @@
|
||||
to_chat(user, "The wires have been [wiresexposed ? "exposed" : "unexposed"]")
|
||||
update_icon()
|
||||
|
||||
else if (istype(W, /obj/item/weapon/card/id)||istype(W, /obj/item/device/pda)) // trying to unlock the interface with an ID card
|
||||
else if(istype(W, /obj/item/weapon/card/id)||istype(W, /obj/item/device/pda)) // trying to unlock the interface with an ID card
|
||||
if(emagged)
|
||||
to_chat(user, "The interface is broken.")
|
||||
else if(opened)
|
||||
@@ -520,8 +520,8 @@
|
||||
update_icon()
|
||||
else
|
||||
to_chat(user, "<span class='warning'>Access denied.</span>")
|
||||
else if (istype(W, /obj/item/stack/cable_coil) && !terminal && opened && has_electronics!=2)
|
||||
if (src.loc:intact)
|
||||
else if(istype(W, /obj/item/stack/cable_coil) && !terminal && opened && has_electronics!=2)
|
||||
if(src.loc:intact)
|
||||
to_chat(user, "<span class='warning'>You must remove the floor plating in front of the APC first.</span>")
|
||||
return
|
||||
var/obj/item/stack/cable_coil/C = W
|
||||
@@ -531,10 +531,10 @@
|
||||
to_chat(user, "You start adding cables to the APC frame...")
|
||||
playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1)
|
||||
if(do_after(user, 20, target = src))
|
||||
if (C.amount >= 10 && !terminal && opened && has_electronics != 2)
|
||||
if(C.amount >= 10 && !terminal && opened && has_electronics != 2)
|
||||
var/turf/T = get_turf(src)
|
||||
var/obj/structure/cable/N = T.get_cable_node()
|
||||
if (prob(50) && electrocute_mob(usr, N, N))
|
||||
if(prob(50) && electrocute_mob(usr, N, N))
|
||||
var/datum/effect/system/spark_spread/s = new /datum/effect/system/spark_spread
|
||||
s.set_up(5, 1, src)
|
||||
s.start()
|
||||
@@ -545,15 +545,15 @@
|
||||
"You add cables to the APC frame.")
|
||||
make_terminal()
|
||||
terminal.connect_to_network()
|
||||
else if (istype(W, /obj/item/weapon/wirecutters) && terminal && opened && has_electronics!=2)
|
||||
if (src.loc:intact)
|
||||
else if(istype(W, /obj/item/weapon/wirecutters) && terminal && opened && has_electronics!=2)
|
||||
if(src.loc:intact)
|
||||
to_chat(user, "<span class='warning'>You must remove the floor plating in front of the APC first.</span>")
|
||||
return
|
||||
to_chat(user, "You begin to cut the cables...")
|
||||
playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1)
|
||||
if(do_after(user, 50, target = src))
|
||||
if(terminal && opened && has_electronics!=2)
|
||||
if (prob(50) && electrocute_mob(usr, terminal.powernet, terminal))
|
||||
if(prob(50) && electrocute_mob(usr, terminal.powernet, terminal))
|
||||
var/datum/effect/system/spark_spread/s = new /datum/effect/system/spark_spread
|
||||
s.set_up(5, 1, src)
|
||||
s.start()
|
||||
@@ -561,7 +561,7 @@
|
||||
new /obj/item/stack/cable_coil(loc,10)
|
||||
to_chat(user, "<span class='notice'>You cut the cables and dismantle the power terminal.</span>")
|
||||
qdel(terminal) // qdel
|
||||
else if (istype(W, /obj/item/weapon/apc_electronics) && opened && has_electronics==0 && !((stat & BROKEN) || malfhack))
|
||||
else if(istype(W, /obj/item/weapon/apc_electronics) && opened && has_electronics==0 && !((stat & BROKEN) || malfhack))
|
||||
to_chat(user, "You trying to insert the power control board into the frame...")
|
||||
playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1)
|
||||
if(do_after(user, 10, target = src))
|
||||
@@ -569,12 +569,12 @@
|
||||
has_electronics = 1
|
||||
to_chat(user, "<span class='notice'>You place the power control board inside the frame.</span>")
|
||||
qdel(W) // qdel
|
||||
else if (istype(W, /obj/item/weapon/apc_electronics) && opened && has_electronics==0 && ((stat & BROKEN) || malfhack))
|
||||
else if(istype(W, /obj/item/weapon/apc_electronics) && opened && has_electronics==0 && ((stat & BROKEN) || malfhack))
|
||||
to_chat(user, "<span class='warning'>You cannot put the board inside, the frame is damaged.</span>")
|
||||
return
|
||||
else if (istype(W, /obj/item/weapon/weldingtool) && opened && has_electronics==0 && !terminal)
|
||||
else if(istype(W, /obj/item/weapon/weldingtool) && opened && has_electronics==0 && !terminal)
|
||||
var/obj/item/weapon/weldingtool/WT = W
|
||||
if (WT.get_fuel() < 3)
|
||||
if(WT.get_fuel() < 3)
|
||||
to_chat(user, "<span class='warning'>You need more welding fuel to complete this task.</span>")
|
||||
return
|
||||
user.visible_message("<span class='warning'>[user.name] welds [src].</span>", \
|
||||
@@ -583,7 +583,7 @@
|
||||
playsound(src.loc, 'sound/items/Welder.ogg', 50, 1)
|
||||
if(do_after(user, 50, target = src))
|
||||
if(!src || !WT.remove_fuel(3, user)) return
|
||||
if (emagged || malfhack || (stat & BROKEN) || opened==2)
|
||||
if(emagged || malfhack || (stat & BROKEN) || opened==2)
|
||||
new /obj/item/stack/sheet/metal(loc)
|
||||
user.visible_message(\
|
||||
"<span class='warning'>[src] has been cut apart by [user.name] with the weldingtool.</span>",\
|
||||
@@ -597,17 +597,17 @@
|
||||
"You hear welding.")
|
||||
qdel(src) // qdel
|
||||
return
|
||||
else if (istype(W, /obj/item/mounted/frame/apc_frame) && opened && emagged)
|
||||
else if(istype(W, /obj/item/mounted/frame/apc_frame) && opened && emagged)
|
||||
emagged = 0
|
||||
if (opened==2)
|
||||
if(opened==2)
|
||||
opened = 1
|
||||
user.visible_message(\
|
||||
"<span class='warning'>[user.name] has replaced the damaged APC frontal panel with a new one.</span>",\
|
||||
"You replace the damaged APC frontal panel with a new one.")
|
||||
qdel(W)
|
||||
update_icon()
|
||||
else if (istype(W, /obj/item/mounted/frame/apc_frame) && opened && ((stat & BROKEN) || malfhack))
|
||||
if (has_electronics)
|
||||
else if(istype(W, /obj/item/mounted/frame/apc_frame) && opened && ((stat & BROKEN) || malfhack))
|
||||
if(has_electronics)
|
||||
to_chat(user, "You cannot repair this APC until you remove the electronics still inside.")
|
||||
return
|
||||
to_chat(user, "You begin to replace the damaged APC frame...")
|
||||
@@ -619,11 +619,11 @@
|
||||
stat &= ~BROKEN
|
||||
malfai = null
|
||||
malfhack = 0
|
||||
if (opened==2)
|
||||
if(opened==2)
|
||||
opened = 1
|
||||
update_icon()
|
||||
else
|
||||
if (((stat & BROKEN) || malfhack) \
|
||||
if(((stat & BROKEN) || malfhack) \
|
||||
&& !opened \
|
||||
&& ( \
|
||||
(W.force >= 5 && W.w_class >= 3.0) \
|
||||
@@ -636,9 +636,9 @@
|
||||
"You hear bang")
|
||||
update_icon()
|
||||
else
|
||||
if (istype(user, /mob/living/silicon))
|
||||
if(istype(user, /mob/living/silicon))
|
||||
return src.attack_hand(user)
|
||||
if (!opened && wiresexposed && \
|
||||
if(!opened && wiresexposed && \
|
||||
(istype(W, /obj/item/device/multitool) || \
|
||||
istype(W, /obj/item/weapon/wirecutters) || istype(W, /obj/item/device/assembly/signaler)))
|
||||
return src.attack_hand(user)
|
||||
@@ -648,7 +648,7 @@
|
||||
"You hear bang")
|
||||
|
||||
/obj/machinery/power/apc/emag_act(user as mob)
|
||||
if (!(emagged || malfhack)) // trying to unlock with an emag card
|
||||
if(!(emagged || malfhack)) // trying to unlock with an emag card
|
||||
if(opened)
|
||||
to_chat(user, "You must close the cover to swipe an ID card.")
|
||||
else if(wiresexposed)
|
||||
@@ -664,7 +664,7 @@
|
||||
|
||||
// attack with hand - remove cell (if cover open) or interact with the APC
|
||||
/obj/machinery/power/apc/attack_hand(mob/user)
|
||||
// if (!can_use(user)) This already gets called in interact() and in topic()
|
||||
// if(!can_use(user)) This already gets called in interact() and in topic()
|
||||
// return
|
||||
if(!user)
|
||||
return
|
||||
@@ -763,11 +763,11 @@
|
||||
|
||||
|
||||
/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)
|
||||
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)
|
||||
return 3 // 3 = User is shunted in this APC
|
||||
else if (istype(user.loc, /obj/machinery/power/apc))
|
||||
else if(istype(user.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.
|
||||
@@ -828,7 +828,7 @@
|
||||
|
||||
// update the ui if it exists, returns null if no ui is passed/found
|
||||
ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
|
||||
if (!ui)
|
||||
if(!ui)
|
||||
// the ui does not exist, so we'll create a new one
|
||||
ui = new(user, src, ui_key, "apc.tmpl", "[area.name] - APC", 510, data["siliconUser"] ? 535 : 460)
|
||||
// When the UI is first opened this is the data it will use
|
||||
@@ -845,14 +845,14 @@
|
||||
area.power_light = (lighting > 1)
|
||||
area.power_equip = (equipment > 1)
|
||||
area.power_environ = (environ > 1)
|
||||
// if (area.name == "AI Chamber")
|
||||
// if(area.name == "AI Chamber")
|
||||
// spawn(10)
|
||||
// to_chat(world, " [area.name] [area.power_equip]")
|
||||
else
|
||||
area.power_light = 0
|
||||
area.power_equip = 0
|
||||
area.power_environ = 0
|
||||
// if (area.name == "AI Chamber")
|
||||
// if(area.name == "AI Chamber")
|
||||
// to_chat(world, "[area.power_equip]")
|
||||
area.power_change()
|
||||
|
||||
@@ -865,10 +865,10 @@
|
||||
return 1
|
||||
|
||||
autoflag = 5
|
||||
if (istype(user, /mob/living/silicon))
|
||||
if(istype(user, /mob/living/silicon))
|
||||
var/mob/living/silicon/ai/AI = user
|
||||
var/mob/living/silicon/robot/robot = user
|
||||
if ( \
|
||||
if( \
|
||||
src.aidisabled || \
|
||||
malfhack && istype(malfai) && \
|
||||
( \
|
||||
@@ -882,11 +882,11 @@
|
||||
user.unset_machine()
|
||||
return 0
|
||||
else
|
||||
if ((!in_range(src, user) || !istype(src.loc, /turf)))
|
||||
if((!in_range(src, user) || !istype(src.loc, /turf)))
|
||||
return 0
|
||||
|
||||
var/mob/living/carbon/human/H = user
|
||||
if (istype(H))
|
||||
if(istype(H))
|
||||
if(H.getBrainLoss() >= 60)
|
||||
for(var/mob/M in viewers(src, null))
|
||||
to_chat(M, "<span class='danger'>[H] stares cluelessly at [src] and drools.</span>")
|
||||
@@ -919,19 +919,19 @@
|
||||
if(!can_use(usr, 1))
|
||||
return 1
|
||||
|
||||
if (href_list["lock"])
|
||||
if(href_list["lock"])
|
||||
if(!is_authenticated(usr))
|
||||
return
|
||||
|
||||
coverlocked = !coverlocked
|
||||
|
||||
else if (href_list["breaker"])
|
||||
else if(href_list["breaker"])
|
||||
if(!is_authenticated(usr))
|
||||
return
|
||||
|
||||
toggle_breaker()
|
||||
|
||||
else if (href_list["cmode"])
|
||||
else if(href_list["cmode"])
|
||||
if(!is_authenticated(usr))
|
||||
return
|
||||
|
||||
@@ -940,7 +940,7 @@
|
||||
charging = 0
|
||||
update_icon()
|
||||
|
||||
else if (href_list["eqp"])
|
||||
else if(href_list["eqp"])
|
||||
if(!is_authenticated(usr))
|
||||
return
|
||||
|
||||
@@ -949,7 +949,7 @@
|
||||
update_icon()
|
||||
update()
|
||||
|
||||
else if (href_list["lgt"])
|
||||
else if(href_list["lgt"])
|
||||
if(!is_authenticated(usr))
|
||||
return
|
||||
|
||||
@@ -958,7 +958,7 @@
|
||||
update_icon()
|
||||
update()
|
||||
|
||||
else if (href_list["env"])
|
||||
else if(href_list["env"])
|
||||
if(!is_authenticated(usr))
|
||||
return
|
||||
|
||||
@@ -970,19 +970,19 @@
|
||||
nanomanager.close_user_uis(usr, src)
|
||||
|
||||
return 0
|
||||
else if (href_list["close2"])
|
||||
else if(href_list["close2"])
|
||||
usr << browse(null, "window=apcwires")
|
||||
|
||||
return 0
|
||||
|
||||
else if (href_list["overload"])
|
||||
else if(href_list["overload"])
|
||||
if(istype(usr, /mob/living/silicon) && !aidisabled)
|
||||
src.overload_lighting()
|
||||
|
||||
else if (href_list["malfhack"])
|
||||
else if(href_list["malfhack"])
|
||||
var/mob/living/silicon/ai/malfai = usr
|
||||
if(get_malf_status(malfai)==1)
|
||||
if (malfai.malfhacking)
|
||||
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.")
|
||||
@@ -990,12 +990,12 @@
|
||||
malfai.malfhacking = 1
|
||||
sleep(600)
|
||||
if(src)
|
||||
if (!src.aidisabled)
|
||||
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))
|
||||
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
|
||||
@@ -1004,15 +1004,15 @@
|
||||
to_chat(malfai, "Hack complete. The APC is now under your exclusive control.")
|
||||
update_icon()
|
||||
|
||||
else if (href_list["occupyapc"])
|
||||
else if(href_list["occupyapc"])
|
||||
if(get_malf_status(usr))
|
||||
malfoccupy(usr)
|
||||
|
||||
else if (href_list["deoccupyapc"])
|
||||
else if(href_list["deoccupyapc"])
|
||||
if(get_malf_status(usr))
|
||||
malfvacate()
|
||||
|
||||
else if (href_list["toggleaccess"])
|
||||
else if(href_list["toggleaccess"])
|
||||
if(istype(usr, /mob/living/silicon))
|
||||
if(emagged || aidisabled || (stat & (BROKEN|MAINT)))
|
||||
to_chat(usr, "The APC does not respond to the command.")
|
||||
@@ -1026,8 +1026,8 @@
|
||||
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))
|
||||
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()
|
||||
@@ -1059,7 +1059,7 @@
|
||||
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)
|
||||
if(seclevel2num(get_security_level()) == SEC_LEVEL_DELTA)
|
||||
for(var/obj/item/weapon/pinpointer/point in world)
|
||||
point.the_disk = src //the pinpointer will detect the shunted AI
|
||||
|
||||
@@ -1072,7 +1072,7 @@
|
||||
src.occupier.parent.adjustOxyLoss(src.occupier.getOxyLoss())
|
||||
src.occupier.parent.cancel_camera()
|
||||
qdel(src.occupier) // qdel
|
||||
if (seclevel2num(get_security_level()) == SEC_LEVEL_DELTA)
|
||||
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
|
||||
@@ -1094,7 +1094,7 @@
|
||||
if(!src.malfhack && (src.z in config.station_levels))
|
||||
if(prob(3))
|
||||
src.locked = 1
|
||||
if (src.cell.charge > 0)
|
||||
if(src.cell.charge > 0)
|
||||
// to_chat(world, "<span class='warning'>blew APC in [src.loc.loc]</span>")
|
||||
src.cell.charge = 0
|
||||
cell.corrupt()
|
||||
@@ -1295,7 +1295,7 @@
|
||||
if(last_lt != lighting || last_eq != equipment || last_en != environ)
|
||||
queue_icon_update()
|
||||
update()
|
||||
else if (last_ch != charging)
|
||||
else if(last_ch != charging)
|
||||
queue_icon_update()
|
||||
|
||||
/obj/machinery/power/apc/proc/autoset(var/val, var/on)
|
||||
@@ -1335,26 +1335,26 @@
|
||||
switch(severity)
|
||||
if(1.0)
|
||||
//set_broken() //now Destroy() do what we need
|
||||
if (cell)
|
||||
if(cell)
|
||||
cell.ex_act(1.0) // more lags woohoo
|
||||
qdel(src)
|
||||
return
|
||||
if(2.0)
|
||||
if (prob(50))
|
||||
if(prob(50))
|
||||
set_broken()
|
||||
if (cell && prob(50))
|
||||
if(cell && prob(50))
|
||||
cell.ex_act(2.0)
|
||||
if(3.0)
|
||||
if (prob(25))
|
||||
if(prob(25))
|
||||
set_broken()
|
||||
if (cell && prob(25))
|
||||
if(cell && prob(25))
|
||||
cell.ex_act(3.0)
|
||||
return
|
||||
|
||||
/obj/machinery/power/apc/blob_act()
|
||||
if (prob(75))
|
||||
if(prob(75))
|
||||
set_broken()
|
||||
if (cell && prob(5))
|
||||
if(cell && prob(5))
|
||||
cell.blob_act()
|
||||
|
||||
|
||||
@@ -1365,8 +1365,8 @@
|
||||
|
||||
/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))
|
||||
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--
|
||||
stat |= BROKEN
|
||||
operating = 0
|
||||
|
||||
+15
-15
@@ -128,7 +128,7 @@ By design, d1 is the smallest direction and d2 is the highest
|
||||
to_chat(user, "\red This cable is connected to nearby breaker box. Use breaker box to interact with it.")
|
||||
return */
|
||||
|
||||
if (shock(user, 50))
|
||||
if(shock(user, 50))
|
||||
return
|
||||
|
||||
if(src.d1) // 0-X cables are 1 unit, X-X cables are 2 units long
|
||||
@@ -157,7 +157,7 @@ By design, d1 is the smallest direction and d2 is the highest
|
||||
|
||||
else if(istype(W, /obj/item/stack/cable_coil))
|
||||
var/obj/item/stack/cable_coil/coil = W
|
||||
if (coil.get_amount() < 1)
|
||||
if(coil.get_amount() < 1)
|
||||
to_chat(user, "Not enough cable")
|
||||
return
|
||||
coil.cable_join(src, user)
|
||||
@@ -173,7 +173,7 @@ By design, d1 is the smallest direction and d2 is the highest
|
||||
shock(user, 5, 0.2)
|
||||
|
||||
else
|
||||
if (W.flags & CONDUCT)
|
||||
if(W.flags & CONDUCT)
|
||||
shock(user, 50, 0.7)
|
||||
|
||||
src.add_fingerprint(user)
|
||||
@@ -182,7 +182,7 @@ By design, d1 is the smallest direction and d2 is the highest
|
||||
/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))
|
||||
if(electrocute_mob(user, powernet, src, siemens_coeff))
|
||||
var/datum/effect/system/spark_spread/s = new /datum/effect/system/spark_spread
|
||||
s.set_up(5, 1, src)
|
||||
s.start()
|
||||
@@ -196,12 +196,12 @@ By design, d1 is the smallest direction and d2 is the highest
|
||||
if(1.0)
|
||||
qdel(src) // qdel
|
||||
if(2.0)
|
||||
if (prob(50))
|
||||
if(prob(50))
|
||||
new/obj/item/stack/cable_coil(src.loc, src.d1 ? 2 : 1, color)
|
||||
qdel(src) // qdel
|
||||
|
||||
if(3.0)
|
||||
if (prob(25))
|
||||
if(prob(25))
|
||||
new/obj/item/stack/cable_coil(src.loc, src.d1 ? 2 : 1, color)
|
||||
qdel(src) // qdel
|
||||
return
|
||||
@@ -341,7 +341,7 @@ obj/structure/cable/proc/cableColor(var/colorC)
|
||||
var/turf/T
|
||||
|
||||
///// Z-Level Stuff
|
||||
/* if (d1 == 11 || d1 == 12)
|
||||
/* 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)
|
||||
@@ -485,7 +485,7 @@ obj/structure/cable/proc/cableColor(var/colorC)
|
||||
/obj/item/stack/cable_coil/New(loc, length = MAXCOIL, var/paramcolor = null)
|
||||
..()
|
||||
src.amount = length
|
||||
if (paramcolor)
|
||||
if(paramcolor)
|
||||
color = paramcolor
|
||||
else
|
||||
color = color
|
||||
@@ -526,7 +526,7 @@ obj/structure/cable/proc/cableColor(var/colorC)
|
||||
return C
|
||||
|
||||
/obj/item/stack/cable_coil/update_icon()
|
||||
if (!color)
|
||||
if(!color)
|
||||
color = pick(COLOR_RED, COLOR_BLUE, COLOR_GREEN, COLOR_ORANGE, COLOR_WHITE, COLOR_PINK, COLOR_YELLOW, COLOR_CYAN)
|
||||
color = color
|
||||
if(amount == 1)
|
||||
@@ -674,8 +674,8 @@ obj/structure/cable/proc/cableColor(var/colorC)
|
||||
|
||||
use(1)
|
||||
|
||||
if (C.shock(user, 50))
|
||||
if (prob(50)) //fail
|
||||
if(C.shock(user, 50))
|
||||
if(prob(50)) //fail
|
||||
new/obj/item/stack/cable_coil(C.loc, 1, C.color)
|
||||
qdel(C) // qdel
|
||||
|
||||
@@ -738,8 +738,8 @@ obj/structure/cable/proc/cableColor(var/colorC)
|
||||
|
||||
use(1)
|
||||
|
||||
if (NC.shock(user, 50))
|
||||
if (prob(50)) //fail
|
||||
if(NC.shock(user, 50))
|
||||
if(prob(50)) //fail
|
||||
new/obj/item/stack/cable_coil(NC.loc, 1, NC.color)
|
||||
qdel(NC) // qdel
|
||||
|
||||
@@ -786,8 +786,8 @@ obj/structure/cable/proc/cableColor(var/colorC)
|
||||
|
||||
use(1)
|
||||
|
||||
if (C.shock(user, 50))
|
||||
if (prob(50)) //fail
|
||||
if(C.shock(user, 50))
|
||||
if(prob(50)) //fail
|
||||
new/obj/item/stack/cable_coil(C.loc, 2, C.color)
|
||||
qdel(C) // qdel
|
||||
return
|
||||
|
||||
+23
-23
@@ -98,13 +98,13 @@
|
||||
* 10000-cell explosion(T, -1, 1, 3, 3)
|
||||
* 15000-cell explosion(T, -1, 2, 4, 4)
|
||||
* */
|
||||
if (charge==0)
|
||||
if(charge==0)
|
||||
return
|
||||
var/devastation_range = -1 //round(charge/11000)
|
||||
var/heavy_impact_range = round(sqrt(charge)/60)
|
||||
var/light_impact_range = round(sqrt(charge)/30)
|
||||
var/flash_range = light_impact_range
|
||||
if (light_impact_range==0)
|
||||
if(light_impact_range==0)
|
||||
rigged = 0
|
||||
corrupt()
|
||||
return
|
||||
@@ -119,12 +119,12 @@
|
||||
/obj/item/weapon/stock_parts/cell/proc/corrupt()
|
||||
charge /= 2
|
||||
maxcharge /= 2
|
||||
if (prob(10))
|
||||
if(prob(10))
|
||||
rigged = 1 //broken batterys are dangerous
|
||||
|
||||
/obj/item/weapon/stock_parts/cell/emp_act(severity)
|
||||
charge -= 1000 / severity
|
||||
if (charge < 0)
|
||||
if(charge < 0)
|
||||
charge = 0
|
||||
if(reliability != 100 && prob(50/severity))
|
||||
reliability -= 10 / severity
|
||||
@@ -137,16 +137,16 @@
|
||||
qdel(src)
|
||||
return
|
||||
if(2.0)
|
||||
if (prob(50))
|
||||
if(prob(50))
|
||||
qdel(src)
|
||||
return
|
||||
if (prob(50))
|
||||
if(prob(50))
|
||||
corrupt()
|
||||
if(3.0)
|
||||
if (prob(25))
|
||||
if(prob(25))
|
||||
qdel(src)
|
||||
return
|
||||
if (prob(25))
|
||||
if(prob(25))
|
||||
corrupt()
|
||||
return
|
||||
|
||||
@@ -154,34 +154,34 @@
|
||||
ex_act(1)
|
||||
|
||||
/obj/item/weapon/stock_parts/cell/proc/get_electrocute_damage()
|
||||
switch (charge)
|
||||
/* if (9000 to INFINITY)
|
||||
switch(charge)
|
||||
/* if(9000 to INFINITY)
|
||||
return min(rand(90,150),rand(90,150))
|
||||
if (2500 to 9000-1)
|
||||
if(2500 to 9000-1)
|
||||
return min(rand(70,145),rand(70,145))
|
||||
if (1750 to 2500-1)
|
||||
if(1750 to 2500-1)
|
||||
return min(rand(35,110),rand(35,110))
|
||||
if (1500 to 1750-1)
|
||||
if(1500 to 1750-1)
|
||||
return min(rand(30,100),rand(30,100))
|
||||
if (750 to 1500-1)
|
||||
if(750 to 1500-1)
|
||||
return min(rand(25,90),rand(25,90))
|
||||
if (250 to 750-1)
|
||||
if(250 to 750-1)
|
||||
return min(rand(20,80),rand(20,80))
|
||||
if (100 to 250-1)
|
||||
if(100 to 250-1)
|
||||
return min(rand(20,65),rand(20,65))*/
|
||||
if (5000000 to INFINITY)
|
||||
if(5000000 to INFINITY)
|
||||
return min(rand(200,300),rand(200,300))
|
||||
if (4000000 to 5000000-1)
|
||||
if(4000000 to 5000000-1)
|
||||
return min(rand(80,180),rand(80,180))
|
||||
if (1000000 to 4000000-1)
|
||||
if(1000000 to 4000000-1)
|
||||
return min(rand(50,160),rand(50,160))
|
||||
if (200000 to 1000000-1)
|
||||
if(200000 to 1000000-1)
|
||||
return min(rand(25,80),rand(25,80))
|
||||
if (100000 to 200000-1)//Ave powernet
|
||||
if(100000 to 200000-1)//Ave powernet
|
||||
return min(rand(20,60),rand(20,60))
|
||||
if (50000 to 100000-1)
|
||||
if(50000 to 100000-1)
|
||||
return min(rand(15,40),rand(15,40))
|
||||
if (1000 to 50000-1)
|
||||
if(1000 to 50000-1)
|
||||
return min(rand(10,20),rand(10,20))
|
||||
else
|
||||
return 0
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
qdel(src)
|
||||
return
|
||||
if(2.0)
|
||||
if (prob(50))
|
||||
if(prob(50))
|
||||
ChangeTurf(/turf/space)
|
||||
qdel(src)
|
||||
return
|
||||
@@ -17,7 +17,7 @@
|
||||
return
|
||||
|
||||
/turf/simulated/floor/engine/blob_act()
|
||||
if (prob(25))
|
||||
if(prob(25))
|
||||
ChangeTurf(/turf/space)
|
||||
qdel(src)
|
||||
return
|
||||
|
||||
@@ -92,9 +92,9 @@
|
||||
air1.temperature = air1.temperature - energy_transfer/air1_heat_capacity
|
||||
|
||||
//Transfer the air
|
||||
if (air1)
|
||||
if(air1)
|
||||
circ1.air2.merge(air1)
|
||||
if (air2)
|
||||
if(air2)
|
||||
circ2.air2.merge(air2)
|
||||
|
||||
//Update the gas networks
|
||||
@@ -137,7 +137,7 @@
|
||||
|
||||
|
||||
/obj/machinery/power/generator/interact(mob/user)
|
||||
if ( (get_dist(src, user) > 1 ) && (!istype(user, /mob/living/silicon/ai)))
|
||||
if( (get_dist(src, user) > 1 ) && (!istype(user, /mob/living/silicon/ai)))
|
||||
user.unset_machine()
|
||||
user << browse(null, "window=teg")
|
||||
return
|
||||
@@ -195,7 +195,7 @@
|
||||
set name = "Rotate Generator (Clockwise)"
|
||||
set src in view(1)
|
||||
|
||||
if (usr.stat || usr.restrained() || anchored)
|
||||
if(usr.stat || usr.restrained() || anchored)
|
||||
return
|
||||
|
||||
src.dir = turn(src.dir, 90)
|
||||
@@ -205,7 +205,7 @@
|
||||
set name = "Rotate Generator (Counterclockwise)"
|
||||
set src in view(1)
|
||||
|
||||
if (usr.stat || usr.restrained() || anchored)
|
||||
if(usr.stat || usr.restrained() || anchored)
|
||||
return
|
||||
|
||||
src.dir = turn(src.dir, -90)
|
||||
@@ -100,7 +100,7 @@
|
||||
|
||||
|
||||
/obj/machinery/power/generator_type2/interact(mob/user)
|
||||
if ( (get_dist(src, user) > 1 ) && (!istype(user, /mob/living/silicon/ai)))
|
||||
if( (get_dist(src, user) > 1 ) && (!istype(user, /mob/living/silicon/ai)))
|
||||
user.unset_machine()
|
||||
user << browse(null, "window=teg")
|
||||
return
|
||||
|
||||
@@ -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(!(A.z in config.station_levels)) 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(!(A.z in config.station_levels)) 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(!(A.z in config.station_levels)) continue
|
||||
A.gravitychange(0,A)
|
||||
|
||||
update_icon()
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
|
||||
/obj/machinery/light_construct/New()
|
||||
..()
|
||||
if (fixture_type == "bulb")
|
||||
if(fixture_type == "bulb")
|
||||
icon_state = "bulb-construct-stage1"
|
||||
|
||||
/obj/machinery/light_construct/examine(mob/user)
|
||||
@@ -38,30 +38,30 @@
|
||||
|
||||
/obj/machinery/light_construct/attackby(obj/item/weapon/W as obj, mob/living/user as mob, params)
|
||||
src.add_fingerprint(user)
|
||||
if (istype(W, /obj/item/weapon/wrench))
|
||||
if (src.stage == 1)
|
||||
if(istype(W, /obj/item/weapon/wrench))
|
||||
if(src.stage == 1)
|
||||
playsound(src.loc, 'sound/items/Ratchet.ogg', 75, 1)
|
||||
to_chat(usr, "You begin deconstructing [src].")
|
||||
if (!do_after(usr, 30, target = src))
|
||||
if(!do_after(usr, 30, target = src))
|
||||
return
|
||||
new /obj/item/stack/sheet/metal( get_turf(src.loc), sheets_refunded )
|
||||
user.visible_message("[user.name] deconstructs [src].", \
|
||||
"You deconstruct [src].", "You hear a noise.")
|
||||
playsound(src.loc, 'sound/items/Deconstruct.ogg', 75, 1)
|
||||
qdel(src)
|
||||
if (src.stage == 2)
|
||||
if(src.stage == 2)
|
||||
to_chat(usr, "You have to remove the wires first.")
|
||||
return
|
||||
|
||||
if (src.stage == 3)
|
||||
if(src.stage == 3)
|
||||
to_chat(usr, "You have to unscrew the case first.")
|
||||
return
|
||||
|
||||
if(istype(W, /obj/item/weapon/wirecutters))
|
||||
if (src.stage != 2) return
|
||||
if(src.stage != 2) return
|
||||
src.stage = 1
|
||||
switch(fixture_type)
|
||||
if ("tube")
|
||||
if("tube")
|
||||
src.icon_state = "tube-construct-stage1"
|
||||
if("bulb")
|
||||
src.icon_state = "bulb-construct-stage1"
|
||||
@@ -72,11 +72,11 @@
|
||||
return
|
||||
|
||||
if(istype(W, /obj/item/stack/cable_coil))
|
||||
if (src.stage != 1) return
|
||||
if(src.stage != 1) return
|
||||
var/obj/item/stack/cable_coil/coil = W
|
||||
coil.use(1)
|
||||
switch(fixture_type)
|
||||
if ("tube")
|
||||
if("tube")
|
||||
src.icon_state = "tube-construct-stage2"
|
||||
if("bulb")
|
||||
src.icon_state = "bulb-construct-stage2"
|
||||
@@ -86,9 +86,9 @@
|
||||
return
|
||||
|
||||
if(istype(W, /obj/item/weapon/screwdriver))
|
||||
if (src.stage == 2)
|
||||
if(src.stage == 2)
|
||||
switch(fixture_type)
|
||||
if ("tube")
|
||||
if("tube")
|
||||
src.icon_state = "tube-empty"
|
||||
if("bulb")
|
||||
src.icon_state = "bulb-empty"
|
||||
@@ -101,7 +101,7 @@
|
||||
|
||||
if("tube")
|
||||
newlight = new /obj/machinery/light/built(src.loc)
|
||||
if ("bulb")
|
||||
if("bulb")
|
||||
newlight = new /obj/machinery/light/small/built(src.loc)
|
||||
|
||||
newlight.dir = src.dir
|
||||
@@ -337,7 +337,7 @@
|
||||
continue
|
||||
M.show_message("[user.name] smashed the light!", 3, "You hear a tinkle of breaking glass", 2)
|
||||
if(on && (W.flags & CONDUCT))
|
||||
if (prob(12))
|
||||
if(prob(12))
|
||||
electrocute_mob(user, get_area(src), src, 0.3)
|
||||
broken()
|
||||
|
||||
@@ -373,7 +373,7 @@
|
||||
var/datum/effect/system/spark_spread/s = new /datum/effect/system/spark_spread
|
||||
s.set_up(3, 1, src)
|
||||
s.start()
|
||||
if (prob(75))
|
||||
if(prob(75))
|
||||
electrocute_mob(user, get_area(src), src, rand(0.7,1.0))
|
||||
|
||||
|
||||
@@ -407,7 +407,7 @@
|
||||
if(status == LIGHT_EMPTY||status == LIGHT_BROKEN)
|
||||
to_chat(user, "\green That object is useless to you.")
|
||||
return
|
||||
else if (status == LIGHT_OK||status == LIGHT_BURNED)
|
||||
else if(status == LIGHT_OK||status == LIGHT_BURNED)
|
||||
user.do_attack_animation(src)
|
||||
visible_message("<span class='danger'>[user.name] smashed the light!</span>", "You hear a tinkle of breaking glass")
|
||||
broken()
|
||||
@@ -418,7 +418,7 @@
|
||||
if(status == LIGHT_EMPTY||status == LIGHT_BROKEN)
|
||||
to_chat(M, "\red That object is useless to you.")
|
||||
return
|
||||
else if (status == LIGHT_OK||status == LIGHT_BURNED)
|
||||
else if(status == LIGHT_OK||status == LIGHT_BURNED)
|
||||
M.do_attack_animation(src)
|
||||
visible_message("<span class='danger'>[M.name] smashed the light!</span>", "You hear a tinkle of breaking glass")
|
||||
broken()
|
||||
|
||||
@@ -179,7 +179,7 @@
|
||||
|
||||
//HasFuel() should guarantee us that there is enough fuel left, so no need to check that
|
||||
//the only thing we need to worry about is if we are going to rollover to the next sheet
|
||||
if (needed_sheets > sheet_left)
|
||||
if(needed_sheets > sheet_left)
|
||||
sheets--
|
||||
sheet_left = (1 + sheet_left) - needed_sheets
|
||||
else
|
||||
@@ -197,7 +197,7 @@
|
||||
cooling in order to get more power out.
|
||||
*/
|
||||
var/datum/gas_mixture/environment = loc.return_air()
|
||||
if (environment)
|
||||
if(environment)
|
||||
var/ratio = min(environment.return_pressure()/ONE_ATMOSPHERE, 1)
|
||||
var/ambient = environment.temperature - T20C
|
||||
lower_limit += ambient*ratio
|
||||
@@ -207,9 +207,9 @@
|
||||
|
||||
//calculate the temperature increase
|
||||
var/bias = 0
|
||||
if (temperature < lower_limit)
|
||||
if(temperature < lower_limit)
|
||||
bias = min(round((average - temperature)/TEMPERATURE_DIVISOR, 1), TEMPERATURE_CHANGE_MAX)
|
||||
else if (temperature > upper_limit)
|
||||
else if(temperature > upper_limit)
|
||||
bias = max(round((temperature - average)/TEMPERATURE_DIVISOR, 1), -TEMPERATURE_CHANGE_MAX)
|
||||
|
||||
//limit temperature increase so that it cannot raise temperature above upper_limit,
|
||||
@@ -218,20 +218,20 @@
|
||||
var/dec_limit = min(temperature - lower_limit, 0)
|
||||
temperature += between(dec_limit, rand(-7 + bias, 7 + bias), inc_limit)
|
||||
|
||||
if (temperature > max_temperature)
|
||||
if(temperature > max_temperature)
|
||||
overheat()
|
||||
else if (overheating > 0)
|
||||
else if(overheating > 0)
|
||||
overheating--
|
||||
|
||||
/obj/machinery/power/port_gen/pacman/handleInactive()
|
||||
var/cooling_temperature = 20
|
||||
var/datum/gas_mixture/environment = loc.return_air()
|
||||
if (environment)
|
||||
if(environment)
|
||||
var/ratio = min(environment.return_pressure()/ONE_ATMOSPHERE, 1)
|
||||
var/ambient = environment.temperature - T20C
|
||||
cooling_temperature += ambient*ratio
|
||||
|
||||
if (temperature > cooling_temperature)
|
||||
if(temperature > cooling_temperature)
|
||||
var/temp_loss = (temperature - cooling_temperature)/TEMPERATURE_DIVISOR
|
||||
temp_loss = between(2, round(temp_loss, 1), TEMPERATURE_CHANGE_MAX)
|
||||
temperature = max(temperature - temp_loss, cooling_temperature)
|
||||
@@ -242,7 +242,7 @@
|
||||
|
||||
/obj/machinery/power/port_gen/pacman/proc/overheat()
|
||||
overheating++
|
||||
if (overheating > 60)
|
||||
if(overheating > 60)
|
||||
explode()
|
||||
|
||||
/obj/machinery/power/port_gen/pacman/explode()
|
||||
@@ -251,7 +251,7 @@
|
||||
//1 mol = 10 u? I dunno. 1 mol of carbon is definitely bigger than a pill
|
||||
/*var/plasma = (sheets+sheet_left)*20
|
||||
var/datum/gas_mixture/environment = loc.return_air()
|
||||
if (environment)
|
||||
if(environment)
|
||||
environment.adjust_gas("plasma", plasma/10, temperature + T0C)*/
|
||||
|
||||
sheets = 0
|
||||
@@ -259,10 +259,10 @@
|
||||
..()
|
||||
|
||||
/obj/machinery/power/port_gen/pacman/emag_act(var/remaining_charges, var/mob/user)
|
||||
if (active && prob(25))
|
||||
if(active && prob(25))
|
||||
explode() //if they're foolish enough to emag while it's running
|
||||
|
||||
if (!emagged)
|
||||
if(!emagged)
|
||||
emagged = 1
|
||||
return 1
|
||||
|
||||
@@ -306,7 +306,7 @@
|
||||
|
||||
/obj/machinery/power/port_gen/pacman/attack_hand(mob/user as mob)
|
||||
..()
|
||||
if (!anchored)
|
||||
if(!anchored)
|
||||
return
|
||||
ui_interact(user)
|
||||
|
||||
@@ -343,7 +343,7 @@
|
||||
data["fuel_type"] = sheet_name
|
||||
|
||||
ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
|
||||
if (!ui)
|
||||
if(!ui)
|
||||
ui = new(user, src, ui_key, "pacman.tmpl", src.name, 500, 560)
|
||||
ui.set_initial_data(data)
|
||||
ui.open()
|
||||
@@ -360,17 +360,17 @@
|
||||
active = 1
|
||||
icon_state = "portgen1"
|
||||
if(href_list["action"] == "disable")
|
||||
if (active)
|
||||
if(active)
|
||||
active = 0
|
||||
icon_state = "portgen0"
|
||||
if(href_list["action"] == "eject")
|
||||
if(!active)
|
||||
DropFuel()
|
||||
if(href_list["action"] == "lower_power")
|
||||
if (power_output > 1)
|
||||
if(power_output > 1)
|
||||
power_output--
|
||||
if (href_list["action"] == "higher_power")
|
||||
if (power_output < max_power_output || (emagged && power_output < round(max_power_output*2.5)))
|
||||
if(href_list["action"] == "higher_power")
|
||||
if(power_output < max_power_output || (emagged && power_output < round(max_power_output*2.5)))
|
||||
power_output++
|
||||
|
||||
nanomanager.update_uis(src)
|
||||
@@ -397,15 +397,15 @@
|
||||
|
||||
/obj/machinery/power/port_gen/pacman/super/UseFuel()
|
||||
//produces a tiny amount of radiation when in use
|
||||
if (prob(2*power_output))
|
||||
for (var/mob/living/L in range(src, 5))
|
||||
if(prob(2*power_output))
|
||||
for(var/mob/living/L in range(src, 5))
|
||||
L.apply_effect(1, IRRADIATE) //should amount to ~5 rads per minute at max safe power
|
||||
..()
|
||||
|
||||
/obj/machinery/power/port_gen/pacman/super/explode()
|
||||
//a nice burst of radiation
|
||||
var/rads = 50 + (sheets + sheet_left)*1.5
|
||||
for (var/mob/living/L in range(src, 10))
|
||||
for(var/mob/living/L in range(src, 10))
|
||||
//should really fall with the square of the distance, but that makes the rads value drop too fast
|
||||
//I dunno, maybe physics works different when you live in 2D -- SM radiation also works like this, apparently
|
||||
L.apply_effect(max(20, round(rads/get_dist(L,src))), IRRADIATE)
|
||||
|
||||
+10
-10
@@ -204,7 +204,7 @@
|
||||
var/Zdir
|
||||
if(d==11)
|
||||
Zdir = 11
|
||||
else if (d==12)
|
||||
else if(d==12)
|
||||
Zdir = 12
|
||||
else
|
||||
Zdir = 999
|
||||
@@ -342,23 +342,23 @@
|
||||
else if(istype(power_source,/obj/machinery/power/apc))
|
||||
var/obj/machinery/power/apc/apc = power_source
|
||||
cell = apc.cell
|
||||
if (apc.terminal)
|
||||
if(apc.terminal)
|
||||
PN = apc.terminal.powernet
|
||||
else if (!power_source)
|
||||
else if(!power_source)
|
||||
return 0
|
||||
else
|
||||
log_admin("ERROR: /proc/electrocute_mob([M], [power_source], [source]): wrong power_source")
|
||||
return 0
|
||||
if (!cell && !PN)
|
||||
if(!cell && !PN)
|
||||
return 0
|
||||
var/PN_damage = 0
|
||||
var/cell_damage = 0
|
||||
if (PN)
|
||||
if(PN)
|
||||
PN_damage = PN.get_electrocute_damage()
|
||||
if (cell)
|
||||
if(cell)
|
||||
cell_damage = cell.get_electrocute_damage()
|
||||
var/shock_damage = 0
|
||||
if (PN_damage>=cell_damage)
|
||||
if(PN_damage>=cell_damage)
|
||||
power_source = PN
|
||||
shock_damage = PN_damage
|
||||
else
|
||||
@@ -367,11 +367,11 @@
|
||||
var/drained_hp = M.electrocute_act(shock_damage, source, siemens_coeff) //zzzzzzap!
|
||||
var/drained_energy = drained_hp*20
|
||||
|
||||
if (source_area)
|
||||
if(source_area)
|
||||
source_area.use_power(drained_energy/CELLRATE)
|
||||
else if (istype(power_source,/datum/powernet))
|
||||
else if(istype(power_source,/datum/powernet))
|
||||
var/drained_power = drained_energy/CELLRATE //convert from "joules" to "watts"
|
||||
drained_power = PN.draw_power(drained_power)
|
||||
else if (istype(power_source, /obj/item/weapon/stock_parts/cell))
|
||||
else if(istype(power_source, /obj/item/weapon/stock_parts/cell))
|
||||
cell.use(drained_energy)
|
||||
return drained_energy
|
||||
|
||||
@@ -108,7 +108,7 @@
|
||||
//very simple load balancing. If there was a net excess this tick then it must have been that some APCs used less than perapc, since perapc*numapc = avail
|
||||
//Therefore we can raise the amount of power rationed out to APCs on the assumption that those APCs that used less than perapc will continue to do so.
|
||||
//If that assumption fails, then some APCs will miss out on power next tick, however it will be rebalanced for the tick after.
|
||||
if (netexcess >= 0)
|
||||
if(netexcess >= 0)
|
||||
perapc_excess += min(netexcess/numapc, (avail - perapc) - perapc_excess)
|
||||
else
|
||||
perapc_excess = 0
|
||||
@@ -129,19 +129,19 @@
|
||||
|
||||
/datum/powernet/proc/get_electrocute_damage()
|
||||
switch(avail)
|
||||
if (5000000 to INFINITY)
|
||||
if(5000000 to INFINITY)
|
||||
return min(rand(200,300),rand(200,300))
|
||||
if (4000000 to 5000000)
|
||||
if(4000000 to 5000000)
|
||||
return min(rand(80,180),rand(80,180))
|
||||
if (1000000 to 4000000)
|
||||
if(1000000 to 4000000)
|
||||
return min(rand(50,160),rand(50,160))
|
||||
if (200000 to 1000000)
|
||||
if(200000 to 1000000)
|
||||
return min(rand(25,80),rand(25,80))
|
||||
if (100000 to 200000)//Ave powernet
|
||||
if(100000 to 200000)//Ave powernet
|
||||
return min(rand(20,60),rand(20,60))
|
||||
if (50000 to 100000)
|
||||
if(50000 to 100000)
|
||||
return min(rand(15,40),rand(15,40))
|
||||
if (1000 to 50000)
|
||||
if(1000 to 50000)
|
||||
return min(rand(10,20),rand(10,20))
|
||||
else
|
||||
return 0
|
||||
|
||||
@@ -84,7 +84,7 @@ var/global/list/rad_collectors = list()
|
||||
else
|
||||
disconnect_from_network()
|
||||
else if(istype(W, /obj/item/weapon/card/id)||istype(W, /obj/item/device/pda))
|
||||
if (src.allowed(user))
|
||||
if(src.allowed(user))
|
||||
if(active)
|
||||
src.locked = !src.locked
|
||||
to_chat(user, "The controls are now [src.locked ? "locked." : "unlocked."]")
|
||||
@@ -109,7 +109,7 @@ var/global/list/rad_collectors = list()
|
||||
/obj/machinery/power/rad_collector/proc/eject()
|
||||
locked = 0
|
||||
var/obj/item/weapon/tank/plasma/Z = src.P
|
||||
if (!Z)
|
||||
if(!Z)
|
||||
return
|
||||
Z.loc = get_turf(src)
|
||||
Z.layer = initial(Z.layer)
|
||||
|
||||
@@ -64,7 +64,7 @@
|
||||
set category = "Object"
|
||||
set src in oview(1)
|
||||
|
||||
if (src.anchored || usr:stat)
|
||||
if(src.anchored || usr:stat)
|
||||
to_chat(usr, "It is fastened to the floor!")
|
||||
return 0
|
||||
src.dir = turn(src.dir, 90)
|
||||
@@ -117,7 +117,7 @@
|
||||
return ..()
|
||||
|
||||
/obj/machinery/power/emitter/update_icon()
|
||||
if (active && powernet && avail(active_power_usage))
|
||||
if(active && powernet && avail(active_power_usage))
|
||||
icon_state = "emitter_+a"
|
||||
else
|
||||
icon_state = "emitter"
|
||||
@@ -253,12 +253,12 @@
|
||||
if(0)
|
||||
to_chat(user, "\red The [src.name] needs to be wrenched to the floor.")
|
||||
if(1)
|
||||
if (WT.remove_fuel(0,user))
|
||||
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.", \
|
||||
"You start to weld the [src] to the floor.", \
|
||||
"You hear welding")
|
||||
if (do_after(user,20, target = src))
|
||||
if(do_after(user,20, target = src))
|
||||
if(!src || !WT.isOn()) return
|
||||
state = 2
|
||||
to_chat(user, "You weld the [src] to the floor.")
|
||||
@@ -266,12 +266,12 @@
|
||||
else
|
||||
to_chat(user, "\red You need more welding fuel to complete this task.")
|
||||
if(2)
|
||||
if (WT.remove_fuel(0,user))
|
||||
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.", \
|
||||
"You start to cut the [src] free from the floor.", \
|
||||
"You hear welding")
|
||||
if (do_after(user,20, target = src))
|
||||
if(do_after(user,20, target = src))
|
||||
if(!src || !WT.isOn()) return
|
||||
state = 1
|
||||
to_chat(user, "You cut the [src] free from the floor.")
|
||||
|
||||
@@ -125,24 +125,24 @@ field_generator power level display
|
||||
to_chat(user, "<span class='warning'>The [src.name] needs to be wrenched to the floor!</span>")
|
||||
return
|
||||
if(1)
|
||||
if (WT.remove_fuel(0,user))
|
||||
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.", \
|
||||
"<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(do_after(user,20, target = src))
|
||||
if(!src || !WT.isOn()) return
|
||||
state = 2
|
||||
to_chat(user, "<span class='notice'>You weld the field generator to the floor.</span>")
|
||||
else
|
||||
return
|
||||
if(2)
|
||||
if (WT.remove_fuel(0,user))
|
||||
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.", \
|
||||
"<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(do_after(user,20, target = src))
|
||||
if(!src || !WT.isOn()) return
|
||||
state = 1
|
||||
to_chat(user, "<span class='notice'>You cut \the [src] free from the floor.</span>")
|
||||
@@ -179,7 +179,7 @@ field_generator power level display
|
||||
active = 0
|
||||
spawn(1)
|
||||
src.cleanup()
|
||||
while (warming_up>0 && !active)
|
||||
while(warming_up>0 && !active)
|
||||
sleep(50)
|
||||
warming_up--
|
||||
update_icon()
|
||||
@@ -187,7 +187,7 @@ field_generator power level display
|
||||
/obj/machinery/field/generator/proc/turn_on()
|
||||
active = 1
|
||||
spawn(1)
|
||||
while (warming_up<3 && active)
|
||||
while(warming_up<3 && active)
|
||||
sleep(50)
|
||||
warming_up++
|
||||
update_icon()
|
||||
@@ -204,8 +204,8 @@ field_generator power level display
|
||||
src.power = field_generator_max_power
|
||||
|
||||
var/power_draw = 2
|
||||
for (var/obj/machinery/field/containment/F in fields)
|
||||
if (isnull(F))
|
||||
for(var/obj/machinery/field/containment/F in fields)
|
||||
if(isnull(F))
|
||||
continue
|
||||
power_draw++
|
||||
if(draw_power(round(power_draw/2,1)))
|
||||
@@ -303,7 +303,7 @@ field_generator power level display
|
||||
CF.Crossed(L)
|
||||
var/listcheck = 0
|
||||
for(var/obj/machinery/field/generator/FG in connected_gens)
|
||||
if (isnull(FG))
|
||||
if(isnull(FG))
|
||||
continue
|
||||
if(FG == G)
|
||||
listcheck = 1
|
||||
@@ -312,7 +312,7 @@ field_generator power level display
|
||||
connected_gens.Add(G)
|
||||
listcheck = 0
|
||||
for(var/obj/machinery/field/generator/FG2 in G.connected_gens)
|
||||
if (isnull(FG2))
|
||||
if(isnull(FG2))
|
||||
continue
|
||||
if(FG2 == src)
|
||||
listcheck = 1
|
||||
@@ -323,13 +323,13 @@ field_generator power level display
|
||||
|
||||
/obj/machinery/field/generator/proc/cleanup()
|
||||
clean_up = 1
|
||||
for (var/obj/machinery/field/containment/F in fields)
|
||||
if (isnull(F))
|
||||
for(var/obj/machinery/field/containment/F in fields)
|
||||
if(isnull(F))
|
||||
continue
|
||||
qdel(F)
|
||||
fields = list()
|
||||
for(var/obj/machinery/field/generator/FG in connected_gens)
|
||||
if (isnull(FG))
|
||||
if(isnull(FG))
|
||||
continue
|
||||
FG.connected_gens.Remove(src)
|
||||
if(!FG.clean_up)//Makes the other gens clean up as well
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/area/engine/engineering/power_alert(var/alarming)
|
||||
if (alarming)
|
||||
if(alarming)
|
||||
investigate_log("has a power alarm!","singulo")
|
||||
..()
|
||||
@@ -35,7 +35,7 @@
|
||||
|
||||
|
||||
/obj/effect/accelerated_particle/Bump(atom/A)
|
||||
if (A)
|
||||
if(A)
|
||||
if(ismob(A))
|
||||
toxmob(A)
|
||||
if((istype(A,/obj/machinery/the_singularitygen))||(istype(A,/obj/singularity/)))
|
||||
|
||||
@@ -95,7 +95,7 @@ So, hopefully this is helpful if any more icons are to be added/changed/wonderin
|
||||
|
||||
if(usr.stat || !usr.canmove || usr.restrained())
|
||||
return
|
||||
if (src.anchored)
|
||||
if(src.anchored)
|
||||
to_chat(usr, "It is fastened to the floor!")
|
||||
return 0
|
||||
src.dir = turn(src.dir, 270)
|
||||
@@ -108,7 +108,7 @@ So, hopefully this is helpful if any more icons are to be added/changed/wonderin
|
||||
|
||||
if(usr.stat || !usr.canmove || usr.restrained())
|
||||
return
|
||||
if (src.anchored)
|
||||
if(src.anchored)
|
||||
to_chat(usr, "It is fastened to the floor!")
|
||||
return 0
|
||||
src.dir = turn(src.dir, 90)
|
||||
@@ -149,11 +149,11 @@ So, hopefully this is helpful if any more icons are to be added/changed/wonderin
|
||||
qdel(src)
|
||||
return
|
||||
if(2.0)
|
||||
if (prob(50))
|
||||
if(prob(50))
|
||||
qdel(src)
|
||||
return
|
||||
if(3.0)
|
||||
if (prob(25))
|
||||
if(prob(25))
|
||||
qdel(src)
|
||||
return
|
||||
else
|
||||
@@ -288,7 +288,7 @@ So, hopefully this is helpful if any more icons are to be added/changed/wonderin
|
||||
|
||||
if(usr.stat || !usr.canmove || usr.restrained())
|
||||
return
|
||||
if (src.anchored)
|
||||
if(src.anchored)
|
||||
to_chat(usr, "It is fastened to the floor!")
|
||||
return 0
|
||||
src.dir = turn(src.dir, 270)
|
||||
@@ -301,7 +301,7 @@ So, hopefully this is helpful if any more icons are to be added/changed/wonderin
|
||||
|
||||
if(usr.stat || !usr.canmove || usr.restrained())
|
||||
return
|
||||
if (src.anchored)
|
||||
if(src.anchored)
|
||||
to_chat(usr, "It is fastened to the floor!")
|
||||
return 0
|
||||
src.dir = turn(src.dir, 90)
|
||||
@@ -323,11 +323,11 @@ So, hopefully this is helpful if any more icons are to be added/changed/wonderin
|
||||
qdel(src)
|
||||
return
|
||||
if(2.0)
|
||||
if (prob(50))
|
||||
if(prob(50))
|
||||
qdel(src)
|
||||
return
|
||||
if(3.0)
|
||||
if (prob(25))
|
||||
if(prob(25))
|
||||
qdel(src)
|
||||
return
|
||||
else
|
||||
|
||||
@@ -221,7 +221,7 @@
|
||||
/obj/machinery/particle_accelerator/control_box/proc/toggle_power()
|
||||
src.active = !src.active
|
||||
investigate_log("turned [active?"<font color='red'>ON</font>":"<font color='green'>OFF</font>"] by [usr ? usr.key : "outside forces"]","singulo")
|
||||
if (active)
|
||||
if(active)
|
||||
msg_admin_attack("PA Control Computer turned ON by [key_name(usr, usr.client)](<A HREF='?_src_=holder;adminmoreinfo=\ref[usr]'>?</A>) in ([x],[y],[z] - <A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[x];Y=[y];Z=[z]'>JMP</a>)",0,1)
|
||||
log_game("PA Control Computer turned ON by [usr.ckey]([usr]) in ([x],[y],[z])")
|
||||
use_log += text("\[[time_stamp()]\] <font color='red'>[usr.name] ([usr.ckey]) has turned on the PA Control Computer.</font>")
|
||||
|
||||
@@ -370,7 +370,7 @@
|
||||
var/toxrange = 10
|
||||
var/radiation = 15
|
||||
var/radiationmin = 3
|
||||
if (energy>200)
|
||||
if(energy>200)
|
||||
radiation += round((energy-150)/10,1)
|
||||
radiationmin = round((radiation/5),1)
|
||||
for(var/mob/living/M in view(toxrange, src.loc))
|
||||
@@ -392,7 +392,7 @@
|
||||
continue
|
||||
|
||||
if(M.stat == CONSCIOUS)
|
||||
if (istype(M,/mob/living/carbon/human))
|
||||
if(istype(M,/mob/living/carbon/human))
|
||||
var/mob/living/carbon/human/H = M
|
||||
if(istype(H.glasses, /obj/item/clothing/glasses/meson))
|
||||
var/obj/item/clothing/glasses/meson/MS = H.glasses
|
||||
|
||||
+14
-14
@@ -105,7 +105,7 @@
|
||||
|
||||
if(inputting == 2)
|
||||
overlays += image('icons/obj/power.dmi', "smes-oc2")
|
||||
else if (inputting == 1)
|
||||
else if(inputting == 1)
|
||||
overlays += image('icons/obj/power.dmi', "smes-oc1")
|
||||
else
|
||||
if(input_attempt)
|
||||
@@ -158,7 +158,7 @@
|
||||
return
|
||||
|
||||
var/turf/T = get_turf(user)
|
||||
if (T.intact) //is the floor plating removed ?
|
||||
if(T.intact) //is the floor plating removed ?
|
||||
to_chat(user, "<span class='alert'>You must first remove the floor plating!</span>")
|
||||
return
|
||||
|
||||
@@ -175,7 +175,7 @@
|
||||
//disassembling the terminal
|
||||
if(istype(I, /obj/item/weapon/wirecutters) && terminal && panel_open)
|
||||
var/turf/T = get_turf(terminal)
|
||||
if (T.intact) //is the floor plating removed ?
|
||||
if(T.intact) //is the floor plating removed ?
|
||||
to_chat(user, "<span class='alert'>You must first expose the power terminal!</span>")
|
||||
return
|
||||
|
||||
@@ -183,7 +183,7 @@
|
||||
playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1)
|
||||
|
||||
if(do_after(user, 50, target = src))
|
||||
if (prob(50) && electrocute_mob(usr, terminal.powernet, terminal)) //animate the electrocution if uncautious and unlucky
|
||||
if(prob(50) && electrocute_mob(usr, terminal.powernet, terminal)) //animate the electrocution if uncautious and unlucky
|
||||
var/datum/effect/system/spark_spread/s = new /datum/effect/system/spark_spread
|
||||
s.set_up(5, 1, src)
|
||||
s.start()
|
||||
@@ -241,9 +241,9 @@
|
||||
var/actual_load = draw_power(target_load) // add the load to the terminal side network
|
||||
charge += actual_load * SMESRATE // increase the charge
|
||||
|
||||
if (actual_load >= target_load) // Did we charge at full rate?
|
||||
if(actual_load >= target_load) // Did we charge at full rate?
|
||||
inputting = 2
|
||||
else if (actual_load) // If not, did we charge at least partially?
|
||||
else if(actual_load) // If not, did we charge at least partially?
|
||||
inputting = 1
|
||||
else // Or not at all?
|
||||
inputting = 0
|
||||
@@ -301,22 +301,22 @@
|
||||
|
||||
//Will return 1 on failure
|
||||
/obj/machinery/power/smes/proc/make_terminal(const/mob/user)
|
||||
if (user.loc == loc)
|
||||
if(user.loc == loc)
|
||||
to_chat(user, "<span class='warning'>You must not be on the same tile as the [src].</span>")
|
||||
return 1
|
||||
|
||||
//Direction the terminal will face to
|
||||
var/tempDir = get_dir(user, src)
|
||||
switch(tempDir)
|
||||
if (NORTHEAST, SOUTHEAST)
|
||||
if(NORTHEAST, SOUTHEAST)
|
||||
tempDir = EAST
|
||||
if (NORTHWEST, SOUTHWEST)
|
||||
if(NORTHWEST, SOUTHWEST)
|
||||
tempDir = WEST
|
||||
var/turf/tempLoc = get_step(src, reverse_direction(tempDir))
|
||||
if (istype(tempLoc, /turf/space))
|
||||
if(istype(tempLoc, /turf/space))
|
||||
to_chat(user, "<span class='warning'>You can't build a terminal on space.</span>")
|
||||
return 1
|
||||
else if (istype(tempLoc))
|
||||
else if(istype(tempLoc))
|
||||
if(tempLoc.intact)
|
||||
to_chat(user, "<span class='warning'>You must remove the floor plating first.</span>")
|
||||
return 1
|
||||
@@ -324,7 +324,7 @@
|
||||
if(do_after(user, 50, target = src))
|
||||
var/turf/T = get_turf(user)
|
||||
var/obj/structure/cable/N = T.get_cable_node() //get the connecting node cable, if there's one
|
||||
if (prob(50) && electrocute_mob(user, N, N)) //animate the electrocution if uncautious and unlucky
|
||||
if(prob(50) && electrocute_mob(user, N, N)) //animate the electrocution if uncautious and unlucky
|
||||
var/datum/effect/system/spark_spread/s = new /datum/effect/system/spark_spread
|
||||
s.set_up(5, 1, src)
|
||||
s.start()
|
||||
@@ -385,7 +385,7 @@
|
||||
|
||||
// update the ui if it exists, returns null if no ui is passed/found
|
||||
ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
|
||||
if (!ui)
|
||||
if(!ui)
|
||||
// the ui does not exist, so we'll create a new() one
|
||||
// for a list of parameters and their descriptions see the code docs in \code\modules\nano\nanoui.dm
|
||||
ui = new(user, src, ui_key, "smes.tmpl", "SMES Power Storage Unit", 540, 380)
|
||||
@@ -475,7 +475,7 @@
|
||||
output_level = rand(0, output_level_max)
|
||||
input_level = rand(0, input_level_max)
|
||||
charge -= 1e6/severity
|
||||
if (charge < 0)
|
||||
if(charge < 0)
|
||||
charge = 0
|
||||
update_icon()
|
||||
..()
|
||||
|
||||
@@ -69,7 +69,7 @@
|
||||
user.visible_message("[user] takes the glass off the solar panel.", "<span class='notice'>You take the glass off the solar panel.</span>")
|
||||
qdel(src)
|
||||
return
|
||||
else if (W)
|
||||
else if(W)
|
||||
src.add_fingerprint(user)
|
||||
src.health -= W.force
|
||||
src.healthcheck()
|
||||
@@ -83,7 +83,7 @@
|
||||
|
||||
|
||||
/obj/machinery/power/solar/proc/healthcheck()
|
||||
if (src.health <= 0)
|
||||
if(src.health <= 0)
|
||||
if(!(stat & BROKEN))
|
||||
broken()
|
||||
else
|
||||
@@ -404,7 +404,7 @@
|
||||
data["connected_tracker"] = (connected_tracker ? 1 : 0)
|
||||
|
||||
ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
|
||||
if (!ui)
|
||||
if(!ui)
|
||||
ui = new(user, src, ui_key, "solar_control.tmpl", name, 490, 420)
|
||||
ui.set_initial_data(data)
|
||||
ui.open()
|
||||
@@ -414,12 +414,12 @@
|
||||
if(istype(I, /obj/item/weapon/screwdriver))
|
||||
playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1)
|
||||
if(do_after(user, 20, target = src))
|
||||
if (src.stat & BROKEN)
|
||||
if(src.stat & BROKEN)
|
||||
to_chat(user, "<span class='notice'>The broken glass falls out.</span>")
|
||||
var/obj/structure/computerframe/A = new /obj/structure/computerframe( src.loc )
|
||||
new /obj/item/weapon/shard( src.loc )
|
||||
var/obj/item/weapon/circuitboard/solar_control/M = new /obj/item/weapon/circuitboard/solar_control( A )
|
||||
for (var/obj/C in src)
|
||||
for(var/obj/C in src)
|
||||
C.loc = src.loc
|
||||
A.circuit = M
|
||||
A.state = 3
|
||||
@@ -430,7 +430,7 @@
|
||||
to_chat(user, "<span class='notice'>You disconnect the monitor.</span>")
|
||||
var/obj/structure/computerframe/A = new /obj/structure/computerframe( src.loc )
|
||||
var/obj/item/weapon/circuitboard/solar_control/M = new /obj/item/weapon/circuitboard/solar_control( A )
|
||||
for (var/obj/C in src)
|
||||
for(var/obj/C in src)
|
||||
C.loc = src.loc
|
||||
A.circuit = M
|
||||
A.state = 4
|
||||
@@ -479,7 +479,7 @@
|
||||
if(connected_tracker)
|
||||
connected_tracker.set_angle(sun.angle)
|
||||
set_panels(cdir)
|
||||
else if (track == 1) //begin manual tracking
|
||||
else if(track == 1) //begin manual tracking
|
||||
src.targetdir = src.cdir
|
||||
if(src.trackrate) nexttime = world.time + 36000/abs(trackrate)
|
||||
set_panels(targetdir)
|
||||
@@ -525,7 +525,7 @@
|
||||
broken()
|
||||
|
||||
/obj/machinery/power/solar_control/blob_act()
|
||||
if (prob(75))
|
||||
if(prob(75))
|
||||
broken()
|
||||
src.density = 0
|
||||
|
||||
|
||||
@@ -159,11 +159,11 @@
|
||||
qdel(src)
|
||||
return
|
||||
if(2.0)
|
||||
if (prob(50))
|
||||
if(prob(50))
|
||||
qdel(src)
|
||||
return
|
||||
if(3.0)
|
||||
if (prob(5))
|
||||
if(prob(5))
|
||||
qdel(src)
|
||||
return
|
||||
else
|
||||
|
||||
@@ -278,7 +278,7 @@
|
||||
data["detonating"] = 0
|
||||
|
||||
ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
|
||||
if (!ui)
|
||||
if(!ui)
|
||||
ui = new(user, src, ui_key, "supermatter_crystal.tmpl", "Supermatter Crystal", 500, 300)
|
||||
ui.set_initial_data(data)
|
||||
ui.open()
|
||||
|
||||
@@ -62,7 +62,7 @@ var/list/blacklisted_tesla_types = list(/obj/machinery/atmospherics,
|
||||
|
||||
pixel_x = -32
|
||||
pixel_y = -32
|
||||
for (var/ball in orbiting_balls)
|
||||
for(var/ball in orbiting_balls)
|
||||
tesla_zap(ball, rand(1, Clamp(orbiting_balls.len, 3, 7)), TESLA_MINI_POWER)
|
||||
else
|
||||
energy = 0 // ensure we dont have miniballs of miniballs
|
||||
@@ -94,7 +94,7 @@ var/list/blacklisted_tesla_types = list(/obj/machinery/atmospherics,
|
||||
|
||||
playsound(src.loc, 'sound/magic/lightning_chargeup.ogg', 100, 1, extrarange = 30)
|
||||
spawn(100)
|
||||
if (!loc)
|
||||
if(!loc)
|
||||
return
|
||||
var/obj/singularity/energy_ball/EB = new(loc)
|
||||
|
||||
@@ -123,14 +123,14 @@ var/list/blacklisted_tesla_types = list(/obj/machinery/atmospherics,
|
||||
dust_mobs(A)
|
||||
|
||||
/obj/singularity/energy_ball/orbit(obj/singularity/energy_ball/target)
|
||||
if (istype(target))
|
||||
if(istype(target))
|
||||
target.orbiting_balls += src
|
||||
|
||||
. = ..()
|
||||
|
||||
if (istype(target))
|
||||
if(istype(target))
|
||||
target.orbiting_balls -= src
|
||||
if (!loc)
|
||||
if(!loc)
|
||||
qdel(src)
|
||||
|
||||
/obj/singularity/energy_ball/proc/dust_mobs(atom/A)
|
||||
|
||||
@@ -293,7 +293,7 @@
|
||||
|
||||
/obj/machinery/power/turbine/interact(mob/user)
|
||||
|
||||
if ( !Adjacent(user) || (stat & (NOPOWER|BROKEN)) && (!istype(user, /mob/living/silicon)) )
|
||||
if( !Adjacent(user) || (stat & (NOPOWER|BROKEN)) && (!istype(user, /mob/living/silicon)) )
|
||||
user.unset_machine(src)
|
||||
user << browse(null, "window=turbine")
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user