12/21 modernizations from TG live (#103)

* sync (#3)

* shuttle auto call

* Merge /vore into /master (#39)

* progress

* Compile errors fixed

No idea if it's test worthy tho as conflicts with race overhaul and
narky removal.

* Update admins.txt

* efforts continue

Fuck grab code, seriously

* grab code is cancer

* Execute the Narkism

Do not hesitate.

Show no mercy.

* holy shit grab code is awful

* have I bitched about grab code

My bitching, let me show you it

* código de agarre es una mierda

No really it is

* yeah I don't even know anymore.

* Lolnope. Fuck grab code

* I'm not even sure what to fix anymore

* Self eating is not an acceptable fate

* Taste the void, son.

* My code doesn't pass it's own sanity check.

Maybe it's a sign of things to come.

* uncommented and notes

* It Works and I Don't Know Why (#38)

* shuttle auto call

* it works and I don't know why

* Subsystem 12/21

Most Recent TG subsystem folder

* globalvars 12/21

Tossed out the flavor_misc and parallax files

* Onclick 12/21

as well as .dme updates

* _defines 12/21

ommited old _MC.dm

* _HELPERS 12/21

Preserved snowflake placement of furry sprites

* _defeines/genetics

reapplied narkism holdover for snowflake races.

* Oops forgot mutant colors

* modules porting 12/21 + Sounds/icons

Admin, Client and most of mob life files ommitted

* enviroment file

* Admin optimizations

ahelp log system kept

* Mob ports 12/21

Flavor text preserved

* datums ported 12/21

* Game ported 12/21

* batch of duplicate fixes/dogborg work

Dogborgs need to be modernized to refractored borg standards.

* moar fixes

* Maps and futher compile fixes
This commit is contained in:
Poojawa
2016-12-22 03:57:55 -06:00
committed by GitHub
parent f5e143a452
commit cf59ac1c3d
2215 changed files with 707445 additions and 87041 deletions
+25 -15
View File
@@ -3,7 +3,7 @@
desc = "This device injects antimatter into connected shielding units, the more antimatter injected the more power produced. Wrench the device to set it up."
icon = 'icons/obj/machines/antimatter.dmi'
icon_state = "control"
anchored = 1
anchored = 0
density = 1
use_power = 1
idle_power_usage = 100
@@ -37,7 +37,10 @@
/obj/machinery/power/am_control_unit/Destroy()//Perhaps damage and run stability checks rather than just del on the others
for(var/obj/machinery/am_shielding/AMS in linked_shielding)
AMS.control_unit = null
qdel(AMS)
qdel(fueljar)
fueljar = null
return ..()
@@ -56,7 +59,7 @@
if(!fueljar)//No fuel but we are on, shutdown
toggle_power()
//Angry buzz or such here
playsound(src.loc, 'sound/machines/buzz-two.ogg', 50, 0)
return
add_avail(stored_power)
@@ -135,8 +138,15 @@
/obj/machinery/power/am_control_unit/power_change()
..()
if(stat & NOPOWER && active)
toggle_power()
if(stat & NOPOWER)
if(active)
toggle_power(1)
else
use_power = 0
else if(!stat && anchored)
use_power = 1
return
@@ -150,14 +160,14 @@
/obj/machinery/power/am_control_unit/attackby(obj/item/W, mob/user, params)
if(istype(W, /obj/item/weapon/wrench))
if(!anchored)
playsound(src.loc, 'sound/items/Ratchet.ogg', 75, 1)
playsound(src.loc, W.usesound, 75, 1)
user.visible_message("[user.name] secures the [src.name] to the floor.", \
"<span class='notice'>You secure the anchor bolts to the floor.</span>", \
"<span class='italics'>You hear a ratchet.</span>")
src.anchored = 1
connect_to_network()
else if(!linked_shielding.len > 0)
playsound(src.loc, 'sound/items/Ratchet.ogg', 75, 1)
playsound(src.loc, W.usesound, 75, 1)
user.visible_message("[user.name] unsecures the [src.name].", \
"<span class='notice'>You remove the anchor bolts.</span>", \
"<span class='italics'>You hear a ratchet.</span>")
@@ -170,18 +180,18 @@
if(fueljar)
user << "<span class='warning'>There is already a [fueljar] inside!</span>"
return
if(!user.unEquip(W))
return
fueljar = W
W.loc = src
if(user.client)
user.client.screen -= W
user.unEquip(W)
user.update_icons()
W.forceMove(src)
user.visible_message("[user.name] loads an [W.name] into the [src.name].", \
"<span class='notice'>You load an [W.name].</span>", \
"<span class='italics'>You hear a thunk.</span>")
else
return ..()
/obj/machinery/power/am_control_unit/take_damage(damage, damage_type = BRUTE, sound_effect = 1)
switch(damage_type)
if(BRUTE)
@@ -231,13 +241,13 @@
return
/obj/machinery/power/am_control_unit/proc/toggle_power()
/obj/machinery/power/am_control_unit/proc/toggle_power(powerfail = 0)
active = !active
if(active)
use_power = 2
visible_message("The [src.name] starts up.")
else
use_power = 1
use_power = !powerfail
visible_message("The [src.name] shuts down.")
update_icon()
return
@@ -279,7 +289,7 @@
/obj/machinery/power/am_control_unit/interact(mob/user)
if((get_dist(src, user) > 1) || (stat & (BROKEN|NOPOWER)))
if(!istype(user, /mob/living/silicon/ai))
if(!isAI(user))
user.unset_machine()
user << browse(null, "window=AMcontrol")
return
@@ -350,4 +360,4 @@
check_core_stability()
updateDialog()
return
return
+43 -27
View File
@@ -24,6 +24,8 @@
var/processing = 0//To track if we are in the update list or not, we need to be when we are damaged and if we ever
var/stability = 100//If this gets low bad things tend to happen
var/efficiency = 1//How many cores this core counts for when doing power processing, plasma in the air and stability could affect this
var/coredirs = 0
var/dirs = 0
/obj/machinery/am_shielding/New(loc)
@@ -91,20 +93,6 @@
/obj/machinery/am_shielding/emp_act()//Immune due to not really much in the way of electronics.
return 0
/obj/machinery/am_shielding/blob_act()
stability -= 20
if(prob(100-stability))
if(prob(10))//Might create a node
new /obj/effect/blob/node(src.loc,150)
else
new /obj/effect/blob(src.loc,60)
qdel(src)
return
check_stability()
return
/obj/machinery/am_shielding/ex_act(severity, target)
stability -= (80 - (severity * 20))
check_stability()
@@ -119,25 +107,48 @@
/obj/machinery/am_shielding/update_icon()
dirs = 0
coredirs = 0
cut_overlays()
for(var/direction in alldirs)
var/machine = locate(/obj/machinery, get_step(loc, direction))
if((istype(machine, /obj/machinery/am_shielding) && machine:control_unit == control_unit)||(istype(machine, /obj/machinery/power/am_control_unit) && machine == control_unit))
add_overlay("shield_[direction]")
var/turf/T = get_step(loc, direction)
for(var/obj/machinery/machine in T)
if(istype(machine, /obj/machinery/am_shielding))
var/obj/machinery/am_shielding/shield = machine
if(shield.control_unit == control_unit)
if(shield.processing)
coredirs |= direction
if(direction in cardinal)
dirs |= direction
else
if(istype(machine, /obj/machinery/power/am_control_unit) && (direction in cardinal))
var/obj/machinery/power/am_control_unit/control = machine
if(control == control_unit)
dirs |= direction
var/prefix = ""
var/icondirs=dirs
if(coredirs)
prefix="core"
icon_state = "[prefix]shield_[icondirs]"
if(core_check())
add_overlay("core")
add_overlay("core[control_unit && control_unit.active]")
if(!processing)
setup_core()
else if(processing)
shutdown_core()
/obj/machinery/am_shielding/take_damage(damage, damage_type = BRUTE, sound_effect = 1)
/obj/machinery/am_shielding/take_damage(damage_amount, damage_type = BRUTE, damage_flag = 0, sound_effect = 1)
switch(damage_type)
if(BRUTE)
if(sound_effect)
if(damage)
if(damage_amount)
playsound(loc, 'sound/weapons/smash.ogg', 50, 1)
else
playsound(loc, 'sound/weapons/tap.ogg', 50, 1)
@@ -146,8 +157,8 @@
playsound(src.loc, 'sound/items/Welder.ogg', 100, 1)
else
return
if(damage >= 10)
stability -= damage/2
if(damage_amount >= 10)
stability -= damage_amount/2
check_stability()
@@ -165,10 +176,15 @@
//Scans cards for shields or the control unit and if all there it
/obj/machinery/am_shielding/proc/core_check()
for(var/direction in alldirs)
var/machine = locate(/obj/machinery, get_step(loc, direction))
if(!machine)
return 0//Need all for a core
if(!istype(machine, /obj/machinery/am_shielding) && !istype(machine, /obj/machinery/power/am_control_unit))
var/found_am_device=0
for(var/obj/machinery/machine in get_step(loc, direction))
//var/machine = locate(/obj/machinery, get_step(loc, direction))
if(!machine)
continue//Need all for a core
if(istype(machine, /obj/machinery/am_shielding) || istype(machine, /obj/machinery/power/am_control_unit))
found_am_device = 1
break
if(!found_am_device)
return 0
return 1
@@ -220,7 +236,7 @@
icon = 'icons/obj/machines/antimatter.dmi'
icon_state = "box"
item_state = "electronic"
w_class = 4
w_class = WEIGHT_CLASS_BULKY
flags = CONDUCT
throwforce = 5
throw_speed = 1
+284 -197
View File
@@ -47,7 +47,10 @@
icon_state = "apc0"
anchored = 1
use_power = 0
req_access = list(access_engine_equip)
req_access = null
obj_integrity = 200
max_integrity = 200
integrity_failure = 50
var/area/area
var/areastring = null
var/obj/item/weapon/stock_parts/cell/cell
@@ -80,18 +83,20 @@
var/overload = 1 //used for the Blackout malf module
var/beenhit = 0 // used for counting how many times it has been hit, used for Aliens at the moment
var/mob/living/silicon/ai/occupier = null
var/transfer_in_progress = FALSE //Is there an AI being transferred out of us?
var/longtermpower = 10
var/auto_name = 0
var/failure_timer = 0
var/force_update = 0
var/update_state = -1
var/update_overlay = -1
var/global/status_overlays = 0
var/updating_icon = 0
var/global/list/status_overlays_lock
var/global/list/status_overlays_charging
var/global/list/status_overlays_equipment
var/global/list/status_overlays_lighting
var/global/list/status_overlays_environ
var/health = 50
/obj/machinery/power/apc/connect_to_network()
//Override because the APC does not directly connect to the network; it goes through a terminal.
@@ -102,6 +107,10 @@
terminal.connect_to_network()
/obj/machinery/power/apc/New(turf/loc, var/ndir, var/building=0)
if (!req_access)
req_access = list(access_engine_equip)
if (!armor)
armor = list(melee = 20, bullet = 20, laser = 10, energy = 100, bomb = 30, bio = 100, rad = 100, fire = 90, acid = 50)
..()
apcs_list += src
@@ -114,21 +123,18 @@
setDir(SOUTH)
if(auto_name)
name = "[get_area(src)] APC"
name = "\improper [get_area(src)] APC"
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)
init()
else
if (building)
area = src.loc.loc:master
opened = 1
operating = 0
name = "[area.name] APC"
stat |= MAINT
src.update_icon()
spawn(5)
src.update()
addtimer(src, "update", 5)
/obj/machinery/power/apc/Destroy()
apcs_list -= src
@@ -147,7 +153,14 @@
qdel(cell)
if(terminal)
disconnect_terminal()
return ..()
. = ..()
/obj/machinery/power/apc/handle_atom_del(atom/A)
if(A == cell)
cell = null
update_icon()
update_icon()
updateUsrDialog()
/obj/machinery/power/apc/proc/make_terminal()
// create a terminal object at the same position as original turf loc
@@ -156,7 +169,7 @@
terminal.setDir(tdir)
terminal.master = src
/obj/machinery/power/apc/proc/init()
/obj/machinery/power/apc/initialize()
has_electronics = 2 //installed and secured
// is starting with a power cell installed, create it and set its charge level
if(cell_type)
@@ -170,24 +183,22 @@
if(isarea(A) && src.areastring == null)
src.area = A
else
src.area = get_area_name(areastring)
src.area = get_area_by_name(areastring)
update_icon()
make_terminal()
spawn(5)
src.update()
addtimer(src, "update", 5)
/obj/machinery/power/apc/examine(mob/user)
..()
if(stat & BROKEN)
user << "Looks broken."
return
if(opened)
if(has_electronics && terminal)
user << "The cover is [opened==2?"removed":"open"] and the power cell is [ cell ? "installed" : "missing"]."
else
user << "It's [!terminal?" not":""]wired up."
user << "It's [ !terminal ? "not" : "" ] wired up."
user << "The electronics are[!has_electronics?"n't":""] installed."
else
@@ -204,17 +215,11 @@
/obj/machinery/power/apc/update_icon()
if (!status_overlays)
status_overlays = 1
status_overlays_lock = new
status_overlays_charging = new
status_overlays_equipment = new
status_overlays_lighting = new
status_overlays_environ = new
status_overlays_lock.len = 2
status_overlays_charging.len = 3
status_overlays_equipment.len = 4
status_overlays_lighting.len = 4
status_overlays_environ.len = 4
status_overlays_lock = new(2)
status_overlays_charging = new(3)
status_overlays_equipment = new(4)
status_overlays_lighting = new(4)
status_overlays_environ = new(4)
status_overlays_lock[1] = image(icon, "apcox-0") // 0=blue 1=red
status_overlays_lock[2] = image(icon, "apcox-1")
@@ -268,18 +273,20 @@
if(!(update_state & UPSTATE_ALLGOOD))
if(overlays.len)
overlays = 0
cut_overlays()
if(update & 2)
if(overlays.len)
overlays.len = 0
cut_overlays()
if(!(stat & (BROKEN|MAINT)) && update_state & UPSTATE_ALLGOOD)
add_overlay(status_overlays_lock[locked+1])
add_overlay(status_overlays_charging[charging+1])
var/list/O = list(
status_overlays_lock[locked+1],
status_overlays_charging[charging+1])
if(operating)
add_overlay(status_overlays_equipment[equipment+1])
add_overlay(status_overlays_lighting[lighting+1])
add_overlay(status_overlays_environ[environ+1])
O += status_overlays_equipment[equipment+1]
O += status_overlays_lighting[lighting+1]
O += status_overlays_environ[environ+1]
add_overlay(O)
/obj/machinery/power/apc/proc/check_updates()
@@ -354,51 +361,68 @@
// Used in process so it doesn't update the icon too much
/obj/machinery/power/apc/proc/queue_icon_update()
if(!updating_icon)
updating_icon = 1
// Start the update
spawn(APC_UPDATE_ICON_COOLDOWN)
update_icon()
updating_icon = 0
addtimer(src, "update_icon", APC_UPDATE_ICON_COOLDOWN, TIMER_UNIQUE)
//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(issilicon(user) && get_dist(src,user)>1)
return src.attack_hand(user)
if (istype(W, /obj/item/weapon/crowbar) && opened)
if (has_electronics==1)
if (terminal)
user << "<span class='warning'>Disconnect the wires first!</span>"
if (istype(W, /obj/item/weapon/crowbar)) //Using crowbar
if (opened) // a) on open apc
if (has_electronics==1)
if (terminal)
user << "<span class='warning'>Disconnect the wires first!</span>"
return
playsound(src.loc, W.usesound, 50, 1)
user << "<span class='notice'>You are trying to remove the power control board...</span>" //lpeters - fixed grammar issues
if(do_after(user, 50*W.toolspeed, target = src))
if (has_electronics==1)
has_electronics = 0
if (stat & BROKEN)
user.visible_message(\
"[user.name] has broken the power control board inside [src.name]!",\
"<span class='notice'>You break the charred power control board and remove the remains.</span>",
"<span class='italics'>You hear a crack.</span>")
return
//ticker.mode:apcs-- //XSI said no and I agreed. -rastaf0
else if (emagged) // We emag board, not APC's frame
emagged = 0
user.visible_message(\
"[user.name] has discarded emaged power control board from [src.name]!",\
"<span class='notice'>You discarded shorten board.</span>")
return
else if (malfhack) // AI hacks board, not APC's frame
user.visible_message(\
"[user.name] has discarded strangely programmed power control board from [src.name]!",\
"<span class='notice'>You discarded strangely programmed board.</span>")
malfai = null
malfhack = 0
return
else
user.visible_message(\
"[user.name] has removed the power control board from [src.name]!",\
"<span class='notice'>You remove the power control board.</span>")
new /obj/item/weapon/electronics/apc(loc)
return
else if (opened!=2) //cover isn't removed
opened = 0
coverlocked = 1 //closing cover relocks it
update_icon()
return
playsound(src.loc, W.usesound, 50, 1)
user << "<span class='notice'>You are trying to remove the power control board...</span>" //lpeters - fixed grammar issues
if(do_after(user, 50/W.toolspeed, target = src))
if (has_electronics==1)
has_electronics = 0
if ((stat & BROKEN) || malfhack)
user.visible_message(\
"[user.name] has broken the power control board inside [src.name]!",\
"<span class='notice'>You break the charred power control board and remove the remains.</span>",
"<span class='italics'>You hear a crack.</span>")
//ticker.mode:apcs-- //XSI said no and I agreed. -rastaf0
else
user.visible_message(\
"[user.name] has removed the power control board from [src.name]!",\
"<span class='notice'>You remove the power control board.</span>")
new /obj/item/weapon/electronics/apc(loc)
else if (opened!=2) //cover isn't removed
opened = 0
update_icon()
else if (istype(W, /obj/item/weapon/crowbar) && !((stat & BROKEN) || malfhack) )
if(coverlocked && !(stat & MAINT))
user << "<span class='warning'>The cover is locked and cannot be opened!</span>"
return
else
opened = 1
update_icon()
else if (!(stat & BROKEN)) // b) on closed and not broken APC
if(coverlocked && !(stat & MAINT)) // locked...
user << "<span class='warning'>The cover is locked and cannot be opened!</span>"
return
else if (panel_open) // wires are exposed
user << "<span class='warning'>Exposed wires prevents you from opening it!</span>"
return
else
opened = 1
update_icon()
return
else if (istype(W, /obj/item/weapon/stock_parts/cell) && opened) // trying to put a cell inside
if(cell)
user << "<span class='warning'>There is a power cell already installed!</span>"
@@ -409,20 +433,21 @@
return
if(!user.drop_item())
return
W.loc = src
W.forceMove(src)
cell = W
user.visible_message(\
"[user.name] has inserted the power cell to [src.name]!",\
"<span class='notice'>You insert the power cell.</span>")
chargecount = 0
update_icon()
else if (istype(W, /obj/item/weapon/screwdriver)) // haxing
if(opened)
if (cell)
user << "<span class='warning'>Close the APC first!</span>" //Less hints more mystery!
return
else
if (has_electronics==1 && terminal)
if (has_electronics==1)
has_electronics = 2
stat &= ~MAINT
playsound(src.loc, W.usesound, 50, 1)
@@ -453,16 +478,28 @@
else if(stat & (BROKEN|MAINT))
user << "<span class='warning'>Nothing happens!</span>"
else
if(allowed(usr) && !wires.is_cut(WIRE_IDSCAN))
if(allowed(usr) && !wires.is_cut(WIRE_IDSCAN) && !malfhack)
locked = !locked
user << "<span class='notice'>You [ locked ? "lock" : "unlock"] the APC interface.</span>"
update_icon()
else
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) && opened)
var/turf/host_turf = get_turf(src)
if(!host_turf)
throw EXCEPTION("attackby on APC when it's not on a turf")
return
if (host_turf.intact)
user << "<span class='warning'>You must remove the floor plating in front of the APC first!</span>"
return
else if (terminal) // it already have terminal
user << "<span class='warning'>This APC is already wired!</span>"
return
else if (has_electronics == 0)
user << "<span class='warning'>There is nothing to wire!</span>"
return
var/obj/item/stack/cable_coil/C = W
if(C.get_amount() < 10)
user << "<span class='warning'>You need ten lengths of cable for APC!</span>"
@@ -471,10 +508,12 @@
"<span class='notice'>You start adding cables to the APC frame...</span>")
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.get_amount() < 10 || !C)
return
if (C.get_amount() >= 10 && !terminal && opened && has_electronics > 0)
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, 1, TRUE))
var/datum/effect_system/spark_spread/s = new /datum/effect_system/spark_spread
s.set_up(5, 1, src)
s.start()
@@ -483,21 +522,28 @@
user << "<span class='notice'>You add cables to the APC frame.</span>"
make_terminal()
terminal.connect_to_network()
else if (istype(W, /obj/item/weapon/wirecutters) && terminal && opened && has_electronics!=2)
terminal.dismantle(user)
else if (istype(W, /obj/item/weapon/electronics/apc) && opened && has_electronics==0 && !((stat & BROKEN) || malfhack))
else if (istype(W, /obj/item/weapon/wirecutters) && terminal && opened)
terminal.dismantle(user, W)
else if (istype(W, /obj/item/weapon/electronics/apc) && opened)
if (has_electronics!=0) // there are already electronicks inside
user << "<span class='warning'>You cannot put the board inside, there already is one!</span>"
return
else if (stat & BROKEN)
user << "<span class='warning'>You cannot put the board inside, the frame is damaged!</span>"
return
user.visible_message("[user.name] inserts the power control board into [src].", \
"<span class='notice'>You start to insert the power control board into the frame...</span>")
playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1)
if(do_after(user, 10, target = src))
if(has_electronics==0)
has_electronics = 1
locked = 1 //We placed new, locked board in
user << "<span class='notice'>You place the power control board inside the frame.</span>"
qdel(W)
else if (istype(W, /obj/item/weapon/electronics/apc) && opened && has_electronics==0 && ((stat & BROKEN) || malfhack))
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)
var/obj/item/weapon/weldingtool/WT = W
if (WT.get_fuel() < 3)
@@ -506,10 +552,10 @@
user.visible_message("[user.name] welds [src].", \
"<span class='notice'>You start welding the APC frame...</span>", \
"<span class='italics'>You hear welding.</span>")
playsound(src.loc, 'sound/items/Welder.ogg', 50, 1)
if(do_after(user, 50/W.toolspeed, target = src))
playsound(src.loc, WT.usesound, 50, 1)
if(do_after(user, 50*W.toolspeed, target = src))
if(!src || !WT.remove_fuel(3, user)) return
if (emagged || malfhack || (stat & BROKEN) || opened==2)
if ((stat & BROKEN) || opened==2)
new /obj/item/stack/sheet/metal(loc)
user.visible_message(\
"[user.name] has cut [src] apart with [W].",\
@@ -521,16 +567,20 @@
"<span class='notice'>You cut the APC frame from the wall.</span>")
qdel(src)
return
else if (istype(W, /obj/item/wallframe/apc) && opened && emagged)
emagged = 0
if (opened==2)
opened = 1
user.visible_message(\
"[user.name] has replaced the damaged APC frontal panel with a new one.",\
"<span class='notice'>You replace the damaged APC frontal panel with a new one.</span>")
qdel(W)
update_icon()
else if (istype(W, /obj/item/wallframe/apc) && opened && ((stat & BROKEN) || malfhack))
else if (istype(W, /obj/item/wallframe/apc) && opened)
if (!(stat & BROKEN || opened==2 || obj_integrity < max_integrity)) // There is nothing to repair
user << "<span class='warning'>You found no reason for repairing this APC</span>"
return
if (!(stat & BROKEN) && opened==2) // Cover is the only thing broken, we do not need to remove elctronicks to replace cover
user.visible_message("[user.name] replaces missing APC's cover.",\
"<span class='notice'>You begin to replace APC's cover...</span>")
if(do_after(user, 20, target = src)) // replacing cover is quicker than replacing whole frame
user << "<span class='notice'>You replace missing APC's cover.</span>"
qdel(W)
opened = 1
update_icon()
return
if (has_electronics)
user << "<span class='warning'>You cannot repair this APC until you remove the electronics still inside!</span>"
return
@@ -540,24 +590,30 @@
user << "<span class='notice'>You replace the damaged APC frame with a new one.</span>"
qdel(W)
stat &= ~BROKEN
malfai = null
malfhack = 0
obj_integrity = max_integrity
if (opened==2)
opened = 1
update_icon()
else if(panel_open && !opened && is_wire_tool(W))
wires.interact(user)
else
return ..()
/obj/machinery/power/apc/take_damage(damage, damage_type = BRUTE, sound_effect = 1)
..()
if((malfhack || (stat & BROKEN)) && !opened)
if(damage < 10)
return
health -= damage
if(health <= 0)
/obj/machinery/power/apc/run_obj_armor(damage_amount, damage_type, damage_flag = 0, attack_dir)
if(damage_flag == "melee" && damage_amount < 15 && (!(stat & BROKEN) || malfai))
return 0
. = ..()
/obj/machinery/power/apc/obj_break(damage_flag)
if(!(flags & NODECONSTRUCT))
set_broken()
/obj/machinery/power/apc/deconstruct(disassembled = TRUE)
if(!(flags & NODECONSTRUCT))
if(!(stat & BROKEN))
set_broken()
if(opened != 2)
opened = 2
visible_message("<span class='warning'>The APC cover is knocked down!</span>")
update_icon()
@@ -598,39 +654,24 @@
..()
/obj/machinery/power/apc/attack_alien(mob/living/carbon/alien/humanoid/user)
..()
if(malfhack || (stat & BROKEN))
if(malfhack)
return
if(opened == 0)
if(!panel_open)
panel_open = 1
update_icon()
visible_message("<span class='danger'>The [src.name]'s cover flies open, exposing the wires!</span>")
else if(panel_open && !wires.is_all_cut())
wires.cut_all()
update_icon()
visible_message("<span class='danger'>The [src.name]'s wires are shredded!</span>")
else if(opened == 1)
if(cell)
cell.loc = user.loc
cell.updateicon()
cell = null
visible_message("<span class='danger'>The [src.name]'s power cell flies off!</span>")
charging = 0
update_icon()
..()
/obj/machinery/power/apc/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = 0, \
datum/tgui/master_ui = null, datum/ui_state/state = default_state)
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
if(!ui)
ui = new(user, src, ui_key, "apc", name, 535, 515, master_ui, state)
ui.open()
if(ui)
ui.set_autoupdate(state = (failure_timer ? 1 : 0))
/obj/machinery/power/apc/ui_data(mob/user)
var/list/data = list(
"locked" = locked,
"failTime" = failure_timer,
"isOperating" = operating,
"externalPower" = main_status,
"powerCellStatus" = cell ? cell.percent() : null,
@@ -695,7 +736,7 @@
return "[area.name] : [equipment]/[lighting]/[environ] ([lastused_equip+lastused_light+lastused_environ]) : [cell? cell.percent() : "N/C"] ([charging])"
/obj/machinery/power/apc/proc/update()
if(operating && !shorted)
if(operating && !shorted && !failure_timer)
area.power_light = (lighting > 1)
area.power_equip = (equipment > 1)
area.power_environ = (environ > 1)
@@ -730,7 +771,7 @@
return TRUE
/obj/machinery/power/apc/ui_act(action, params)
if(..() || !can_use(usr, 1) || (locked && !usr.has_unlimited_silicon_privilege))
if(..() || !can_use(usr, 1) || (locked && !usr.has_unlimited_silicon_privilege && !failure_timer))
return
switch(action)
if("lock")
@@ -780,6 +821,11 @@
if("deoccupy")
if(get_malf_status(usr))
malfvacate()
if("reboot")
failure_timer = 0
update_icon()
update()
return 1
/obj/machinery/power/apc/proc/toggle_breaker()
operating = !operating
@@ -796,25 +842,11 @@
return
malf << "Beginning override of APC systems. This takes some time, and you cannot perform other actions during the process."
malf.malfhack = src
malf.malfhacking = TRUE
addtimer(src, "malfhacked", 600, FALSE, malf)
malf.malfhacking = addtimer(malf, "malfhacked", 600, TIMER_NORMAL, src)
/obj/machinery/power/apc/proc/malfhacked(mob/living/silicon/ai/malf)
if(!istype(malf))
return
malf.malfhack = null
malf.malfhacking = FALSE
if(src && !src.aidisabled)
malf.malf_picker.processing_time += 10
malfai = malf.parent || malf
malfhack = TRUE
locked = TRUE
malf << "Hack complete. The APC is now under your exclusive control."
update_icon()
else
malf << "Hack aborted. The designated APC has stopped responding and no longer exists on the power network."
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))
@@ -827,50 +859,96 @@
return
if(src.z != 1)
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) //DEAR GOD WHY?
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
occupier.parent = malf
malf.shunted = 1
malf.mind.transfer_to(src.occupier)
src.occupier.eyeobj.name = "[src.occupier.name] (AI Eye)"
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.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
occupier.verbs += /mob/living/silicon/ai/proc/corereturn
occupier.cancel_camera()
/obj/machinery/power/apc/proc/malfvacate(forced)
if(!src.occupier)
if(!occupier)
return
if(src.occupier.parent && src.occupier.parent.stat != 2)
src.occupier.mind.transfer_to(src.occupier.parent)
src.occupier.parent.shunted = 0
src.occupier.parent.adjustOxyLoss(src.occupier.getOxyLoss())
src.occupier.parent.cancel_camera()
qdel(src.occupier)
if (seclevel2num(get_security_level()) == SEC_LEVEL_DELTA)
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.
if(occupier.parent && occupier.parent.stat != 2)
occupier.mind.transfer_to(occupier.parent)
occupier.parent.shunted = 0
occupier.parent.adjustOxyLoss(occupier.getOxyLoss())
occupier.parent.cancel_camera()
qdel(occupier)
else
src.occupier << "<span class='danger'>Primary core damaged, unable to return core processes.</span>"
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 pinpointer_list)
point.the_disk = null //the pinpointer will go back to pointing at the nuke disc.
occupier.loc = src.loc
occupier.death()
occupier.gib()
for(var/obj/item/weapon/pinpointer/P in pinpointer_list)
P.switch_mode_to(TRACK_NUKE_DISK) //Pinpointers go back to tracking the nuke disk
P.nuke_warning = FALSE
/obj/machinery/power/apc/transfer_ai(interaction, mob/user, mob/living/silicon/ai/AI, obj/item/device/aicard/card)
if(card.AI)
user << "<span class='warning'>[card] is already occupied!</span>"
return
if(!occupier)
user << "<span class='warning'>There's nothing in [src] to transfer!</span>"
return
if(!occupier.mind || !occupier.client)
user << "<span class='warning'>[occupier] is either inactive, destroyed, or braindead!</span>"
return
if(!occupier.parent.stat)
user << "<span class='warning'>[occupier] is refusing all attempts at transfer!</span>" //We can return to our core, no need to shunt right now
return
if(transfer_in_progress)
user << "<span class='warning'>There's already a transfer in progress!</span>"
return
if(interaction != AI_TRANS_TO_CARD || occupier.stat)
return
var/turf/T = get_turf(user)
if(!T)
return
transfer_in_progress = TRUE
user.visible_message("<span class='notice'>[user] slots [card] into [src]...</span>", "<span class='notice'>Transfer process initiated. Sending request for AI approval...</span>")
playsound(src, 'sound/machines/click.ogg', 50, 1)
occupier << sound('sound/misc/notice2.ogg') //To alert the AI that someone's trying to card them if they're tabbed out
if(alert(occupier, "[user] is attempting to transfer you to \a [card.name]. Do you consent to this?", "APC Transfer", "Yes - Transfer Me", "No - Keep Me Here") == "No - Keep Me Here")
user << "<span class='danger'>AI denied transfer request. Process terminated.</span>"
playsound(src, 'sound/machines/buzz-sigh.ogg', 50, 1)
transfer_in_progress = FALSE
return
if(user.loc != T)
user << "<span class='danger'>Location changed. Process terminated.</span>"
occupier << "<span class='warning'>[user] moved away! Transfer canceled.</span>"
transfer_in_progress = FALSE
return
user << "<span class='notice'>AI accepted request. Transferring stored intelligence to [card]...</span>"
occupier << "<span class='notice'>Transfer starting. You will be moved to [card] shortly.</span>"
if(!do_after(user, 50, target = src))
occupier << "<span class='warning'>[user] was interrupted! Transfer canceled.</span>"
transfer_in_progress = FALSE
return
if(!occupier || !card)
transfer_in_progress = FALSE
return
user.visible_message("<span class='notice'>[user] transfers [occupier] to [card]!</span>", "<span class='notice'>Transfer complete! [occupier] is now stored in [card].</span>")
occupier << "<span class='notice'>Transfer complete! You've been stored in [user]'s [card.name].</span>"
occupier.forceMove(card)
card.AI = occupier
occupier.parent.shunted = FALSE
occupier.cancel_camera()
occupier = null
transfer_in_progress = FALSE
return
/obj/machinery/power/apc/surplus()
if(terminal)
@@ -894,6 +972,12 @@
return
if(!area.requires_power)
return
if(failure_timer)
update()
queue_icon_update()
failure_timer--
force_update = 1
return
/*
if (equipment > 1) // off=0, off auto=1, on=2, on auto=3
@@ -1033,7 +1117,8 @@
// update icon & area power if anything changed
if(last_lt != lighting || last_eq != equipment || last_en != environ)
if(last_lt != lighting || last_eq != equipment || last_en != environ || force_update)
force_update = 0
queue_icon_update()
update()
else if (last_ch != charging)
@@ -1083,21 +1168,10 @@
environ = 0
update_icon()
update()
addtimer(src, "reset", 600, FALSE, APC_RESET_EMP)
addtimer(src, "reset", 600, TIMER_NORMAL, APC_RESET_EMP)
..()
/obj/machinery/power/apc/ex_act(severity, target)
..()
if(!qdeleted(src))
switch(severity)
if(2)
if(prob(50))
set_broken()
if(3)
if(prob(25))
set_broken()
/obj/machinery/power/apc/blob_act(obj/effect/blob/B)
/obj/machinery/power/apc/blob_act(obj/structure/blob/B)
set_broken()
/obj/machinery/power/apc/disconnect_terminal()
@@ -1126,7 +1200,7 @@
for(var/area/A in area.related)
for(var/obj/machinery/light/L in A)
L.on = 1
L.broken()
L.break_light_tube()
stoplag()
/obj/machinery/power/apc/proc/shock(mob/user, prb)
@@ -1137,7 +1211,7 @@
s.start()
if(isalien(user))
return 0
if(electrocute_mob(user, src, src))
if(electrocute_mob(user, src, src, 1, TRUE))
return 1
else
return 0
@@ -1150,10 +1224,23 @@
else
return 0
/obj/machinery/power/apc/proc/energy_fail(duration)
for(var/obj/machinery/M in area.contents)
if(M.critical_machine)
return
for(var/A in ai_list)
var/mob/living/silicon/ai/I = A
if(get_area(I) == area)
return
failure_timer = max(failure_timer, round(duration))
#undef APC_UPDATE_ICON_COOLDOWN
/*Power module, used for APC construction*/
/obj/item/weapon/electronics/apc
name = "power control module"
icon_state = "power_mod"
desc = "Heavy-duty switching circuits for power control."
desc = "Heavy-duty switching circuits for power control."
+17 -31
View File
@@ -93,10 +93,11 @@ By design, d1 is the smallest direction and d2 is the highest
cable_list -= src //remove it from global cable list
return ..() // then go ahead and delete the cable
/obj/structure/cable/Deconstruct()
var/turf/T = loc
stored.loc = T
..()
/obj/structure/cable/deconstruct(disassembled = TRUE)
if(!(flags & NODECONSTRUCT))
var/turf/T = loc
stored.forceMove(T)
qdel(src)
///////////////////////////////////
// General procedures
@@ -105,7 +106,7 @@ By design, d1 is the smallest direction and d2 is the highest
//If underfloor, hide the cable
/obj/structure/cable/hide(i)
if(level == 1 && istype(loc, /turf))
if(level == 1 && isturf(loc))
invisibility = i ? INVISIBILITY_MAXIMUM : 0
updateicon()
@@ -115,9 +116,6 @@ By design, d1 is the smallest direction and d2 is the highest
else
icon_state = "[d1]-[d2]"
//Telekinesis has no effect on a cable
/obj/structure/cable/attack_tk(mob/user)
return
// Items usable on a cable :
// - Wirecutters : cut it duh !
@@ -134,7 +132,7 @@ By design, d1 is the smallest direction and d2 is the highest
user.visible_message("[user] cuts the cable.", "<span class='notice'>You cut the cable.</span>")
stored.add_fingerprint(user)
investigate_log("was cut by [key_name(usr, usr.client)] in [user.loc.loc]","wires")
Deconstruct()
deconstruct()
return
else if(istype(W, /obj/item/stack/cable_coil))
@@ -165,21 +163,9 @@ By design, d1 is the smallest direction and d2 is the highest
else
return 0
//explosion handling
/obj/structure/cable/ex_act(severity, target)
..()
if(!qdeleted(src))
switch(severity)
if(2)
if(prob(50))
Deconstruct()
if(3)
if(prob(25))
Deconstruct()
/obj/structure/cable/singularity_pull(S, current_size)
if(current_size >= STAGE_FIVE)
Deconstruct()
deconstruct()
/obj/structure/cable/proc/cableColor(colorC = "red")
cable_color = colorC
@@ -201,9 +187,9 @@ By design, d1 is the smallest direction and d2 is the highest
if("white")
icon = 'icons/obj/power_cond/power_cond_white.dmi'
/obj/structure/cable/proc/update_stored(var/length = 1, var/color = "red")
/obj/structure/cable/proc/update_stored(length = 1, colorC = "red")
stored.amount = length
stored.item_color = color
stored.item_color = colorC
stored.update_icon()
////////////////////////////////////////////
@@ -467,7 +453,7 @@ var/global/list/datum/stack_recipe/cable_coil_recipes = list ( \
item_color = "red"
desc = "A coil of insulated power cable."
throwforce = 0
w_class = 2
w_class = WEIGHT_CLASS_SMALL
throw_speed = 3
throw_range = 5
materials = list(MAT_METAL=10, MAT_GLASS=5)
@@ -488,9 +474,9 @@ var/global/list/datum/stack_recipe/cable_coil_recipes = list ( \
/obj/item/stack/cable_coil/suicide_act(mob/user)
if(locate(/obj/structure/chair/stool) in get_turf(user))
user.visible_message("<span class='suicide'>[user] is making a noose with the [src.name]! It looks like \he's trying to commit suicide.</span>")
user.visible_message("<span class='suicide'>[user] is making a noose with [src]! It looks like [user.p_theyre()] trying to commit suicide!</span>")
else
user.visible_message("<span class='suicide'>[user] is strangling \himself with the [src.name]! It looks like \he's trying to commit suicide.</span>")
user.visible_message("<span class='suicide'>[user] is strangling [user.p_them()]self with [src]! It looks like [user.p_theyre()] trying to commit suicide!</span>")
return(OXYLOSS)
/obj/item/stack/cable_coil/New(loc, amount = MAXCOIL, var/param_color = null)
@@ -513,7 +499,7 @@ var/global/list/datum/stack_recipe/cable_coil_recipes = list ( \
return ..()
var/obj/item/bodypart/affecting = H.get_bodypart(check_zone(user.zone_selected))
if(affecting && affecting.status == ORGAN_ROBOTIC)
if(affecting && affecting.status == BODYPART_ROBOTIC)
user.visible_message("<span class='notice'>[user] starts to fix some of the wires in [H]'s [affecting.name].</span>", "<span class='notice'>You start fixing some of the wires in [H]'s [affecting.name].</span>")
if(!do_mob(user, H, 50))
return
@@ -615,7 +601,7 @@ var/global/list/datum/stack_recipe/cable_coil_recipes = list ( \
if (C.shock(user, 50))
if (prob(50)) //fail
C.Deconstruct()
C.deconstruct()
// called when cable_coil is click on an installed obj/cable
// or click on a turf that already contains a "node" cable
@@ -680,7 +666,7 @@ var/global/list/datum/stack_recipe/cable_coil_recipes = list ( \
if (NC.shock(user, 50))
if (prob(50)) //fail
NC.Deconstruct()
NC.deconstruct()
return
@@ -730,7 +716,7 @@ var/global/list/datum/stack_recipe/cable_coil_recipes = list ( \
if (C.shock(user, 50))
if (prob(50)) //fail
C.Deconstruct()
C.deconstruct()
return
C.denode()// this call may have disconnected some cables that terminated on the centre of the turf, if so split the powernets.
+34 -15
View File
@@ -1,7 +1,6 @@
/obj/item/weapon/stock_parts/cell
name = "power cell"
desc = "A rechargable electrochemical power cell."
var/ratingdesc
icon = 'icons/obj/power.dmi'
icon_state = "cell"
item_state = "cell"
@@ -10,33 +9,36 @@
throwforce = 5
throw_speed = 2
throw_range = 5
w_class = 2
w_class = WEIGHT_CLASS_SMALL
var/charge = 0 // note %age conveted to actual charge in New
var/maxcharge = 1000
materials = list(MAT_METAL=700, MAT_GLASS=50)
var/rigged = 0 // true if rigged to explode
var/chargerate = 100 //how much power is given every tick in a recharger
var/self_recharge = 0 //does it self recharge, over time, or not?
var/ratingdesc = TRUE
var/grown_battery = FALSE // If it's a grown that acts as a battery, add a wire overlay to it.
/obj/item/weapon/stock_parts/cell/New()
..()
START_PROCESSING(SSobj, src)
charge = maxcharge
ratingdesc = " This one has a power rating of [maxcharge], and you should not swallow it."
desc = desc + ratingdesc
if(ratingdesc)
desc += " This one has a power rating of [maxcharge], and you should not swallow it."
updateicon()
/obj/item/weapon/stock_parts/cell/Destroy()
STOP_PROCESSING(SSobj, src)
return ..()
/obj/item/weapon/stock_parts/cell/on_varedit(modified_var)
if(modified_var == "self_recharge")
if(self_recharge)
START_PROCESSING(SSobj, src)
else
STOP_PROCESSING(SSobj, src)
..()
/obj/item/weapon/stock_parts/cell/vv_edit_var(var_name, var_value)
switch(var_name)
if("self_recharge")
if(var_value)
START_PROCESSING(SSobj, src)
else
STOP_PROCESSING(SSobj, src)
. = ..()
/obj/item/weapon/stock_parts/cell/process()
if(self_recharge)
@@ -46,6 +48,8 @@
/obj/item/weapon/stock_parts/cell/proc/updateicon()
cut_overlays()
if(grown_battery)
add_overlay(image('icons/obj/power.dmi', "grown_wires"))
if(charge < 0.01)
return
else if(charge/maxcharge >=0.995)
@@ -87,7 +91,7 @@
user << "The charge meter reads [round(src.percent() )]%."
/obj/item/weapon/stock_parts/cell/suicide_act(mob/user)
user.visible_message("<span class='suicide'>[user] is licking the electrodes of the [src.name]! It looks like \he's trying to commit suicide.</span>")
user.visible_message("<span class='suicide'>[user] is licking the electrodes of [src]! It looks like [user.p_theyre()] trying to commit suicide!</span>")
return (FIRELOSS)
/obj/item/weapon/stock_parts/cell/attackby(obj/item/W, mob/user, params)
@@ -146,7 +150,7 @@
corrupt()
/obj/item/weapon/stock_parts/cell/blob_act(obj/effect/blob/B)
/obj/item/weapon/stock_parts/cell/blob_act(obj/structure/blob/B)
ex_act(1)
/obj/item/weapon/stock_parts/cell/proc/get_electrocute_damage()
@@ -264,16 +268,31 @@
/obj/item/weapon/stock_parts/cell/infinite/use()
return 1
/obj/item/weapon/stock_parts/cell/infinite/abductor
name = "void core"
desc = "An alien power cell that produces energy seemingly out of nowhere."
icon = 'icons/obj/abductor.dmi'
icon_state = "cell"
origin_tech = "abductor=5;powerstorage=8;engineering=6"
maxcharge = 50000
rating = 12
ratingdesc = FALSE
/obj/item/weapon/stock_parts/cell/infinite/abductor/update_icon()
return
/obj/item/weapon/stock_parts/cell/potato
name = "potato battery"
desc = "A rechargable starch based power cell."
icon = 'icons/obj/power.dmi' //'icons/obj/hydroponics/harvest.dmi'
icon_state = "potato_cell" //"potato_battery"
icon = 'icons/obj/hydroponics/harvest.dmi'
icon_state = "potato"
origin_tech = "powerstorage=1;biotech=1"
charge = 100
maxcharge = 300
materials = list()
rating = 1
grown_battery = TRUE //it has the overlays for wires
/obj/item/weapon/stock_parts/cell/high/slime
name = "charged slime core"
-4
View File
@@ -173,10 +173,6 @@
/obj/machinery/power/generator/interact(mob/user)
user.set_machine(src)
//user << browse(t, "window=teg;size=460x300")
//onclose(user, "teg")
var/datum/browser/popup = new(user, "teg", "Thermo-Electric Generator", 460, 300)
popup.set_content(get_menu())
popup.set_title_image(user.browse_rsc_icon(src.icon, src.icon_state))
+8 -3
View File
@@ -25,17 +25,22 @@ var/const/GRAV_NEEDS_WRENCH = 3
anchored = 1
density = 1
use_power = 0
unacidable = 1
resistance_flags = INDESTRUCTIBLE | LAVA_PROOF | FIRE_PROOF | UNACIDABLE | ACID_PROOF
var/sprite_number = 0
/obj/machinery/gravity_generator/ex_act(severity, target)
if(severity == 1) // Very sturdy.
set_broken()
/obj/machinery/gravity_generator/blob_act(obj/effect/blob/B)
/obj/machinery/gravity_generator/blob_act(obj/structure/blob/B)
if(prob(20))
set_broken()
/obj/machinery/gravity_generator/tesla_act(power, explosive)
..()
if(explosive)
qdel(src)//like the singulo, tesla deletes it. stops it from exploding over and over
/obj/machinery/gravity_generator/update_icon()
..()
icon_state = "[get_status()]_[sprite_number]"
@@ -204,7 +209,7 @@ var/const/GRAV_NEEDS_WRENCH = 3
if(GRAV_NEEDS_PLASTEEL)
if(istype(I, /obj/item/stack/sheet/plasteel))
var/obj/item/stack/sheet/plasteel/PS = I
if(PS.amount >= 10)
if(PS.get_amount() >= 10)
PS.use(10)
user << "<span class='notice'>You add the plating to the framework.</span>"
playsound(src.loc, 'sound/machines/click.ogg', 75, 1)
+109 -108
View File
@@ -16,34 +16,38 @@
desc = "Used for building lights."
icon = 'icons/obj/lighting.dmi'
icon_state = "tube-construct-item"
result_path = /obj/machinery/light_construct
result_path = /obj/structure/light_construct
inverse = 1
/obj/item/wallframe/light_fixture/small
name = "small light fixture frame"
icon_state = "bulb-construct-item"
result_path = /obj/machinery/light_construct/small
result_path = /obj/structure/light_construct/small
materials = list(MAT_METAL=MINERAL_MATERIAL_AMOUNT)
/obj/machinery/light_construct
/obj/structure/light_construct
name = "light fixture frame"
desc = "A light fixture under construction."
icon = 'icons/obj/lighting.dmi'
icon_state = "tube-construct-stage1"
anchored = 1
layer = WALL_OBJ_LAYER
obj_integrity = 200
max_integrity = 200
armor = list(melee = 50, bullet = 10, laser = 10, energy = 0, bomb = 0, bio = 0, rad = 0, fire = 80, acid = 50)
var/stage = 1
var/fixture_type = "tube"
var/sheets_refunded = 2
var/obj/machinery/light/newlight = null
/obj/machinery/light_construct/New(loc, ndir, building)
/obj/structure/light_construct/New(loc, ndir, building)
..()
if(building)
setDir(ndir)
/obj/machinery/light_construct/examine(mob/user)
/obj/structure/light_construct/examine(mob/user)
..()
switch(src.stage)
if(1)
@@ -53,14 +57,14 @@
if(3)
user << "The casing is closed."
/obj/machinery/light_construct/attackby(obj/item/weapon/W, mob/user, params)
/obj/structure/light_construct/attackby(obj/item/weapon/W, mob/user, params)
add_fingerprint(user)
switch(stage)
if(1)
if(istype(W, /obj/item/weapon/wrench))
playsound(src.loc, W.usesound, 75, 1)
usr << "<span class='notice'>You begin deconstructing [src]...</span>"
if (!do_after(usr, 30/W.toolspeed, target = src))
if (!do_after(usr, 30*W.toolspeed, target = src))
return
new /obj/item/stack/sheet/metal( get_turf(src.loc), sheets_refunded )
user.visible_message("[user.name] deconstructs [src].", \
@@ -116,13 +120,24 @@
return
return ..()
/obj/structure/light_construct/blob_act(obj/structure/blob/B)
if(B && B.loc == loc)
qdel(src)
/obj/machinery/light_construct/small
/obj/structure/light_construct/deconstruct(disassembled = TRUE)
if(!(flags & NODECONSTRUCT))
new /obj/item/stack/sheet/metal(loc, sheets_refunded)
qdel(src)
/obj/structure/light_construct/small
name = "small light fixture frame"
icon_state = "bulb-construct-stage1"
fixture_type = "bulb"
sheets_refunded = 1
// the standard tube light fixture
/obj/machinery/light
name = "light fixture"
@@ -132,6 +147,8 @@
desc = "A lighting fixture."
anchored = 1
layer = WALL_OBJ_LAYER
obj_integrity = 100
max_integrity = 100
use_power = 2
idle_power_usage = 2
active_power_usage = 20
@@ -148,7 +165,6 @@
// this is used to calc the probability the light burns out
var/rigged = 0 // true if rigged to explode
var/health = 20
// the smaller bulb light fixture
@@ -159,12 +175,12 @@
brightness = 4
desc = "A small lighting fixture."
light_type = /obj/item/weapon/light/bulb
health = 15
/obj/machinery/light/Move()
if(status != LIGHT_BROKEN)
broken(1)
break_light_tube(1)
return ..()
/obj/machinery/light/built/New()
@@ -186,11 +202,11 @@
if("tube")
brightness = 8
if(prob(2))
broken(1)
break_light_tube(1)
if("bulb")
brightness = 4
if(prob(5))
broken(1)
break_light_tube(1)
spawn(1)
update(0)
@@ -222,23 +238,20 @@
update_icon()
if(on)
if(!light || light.light_range != brightness)
if(!light || light.luminosity != brightness)
switchcount++
if(rigged)
if(status == LIGHT_OK && trigger)
explode()
else if( prob( min(60, switchcount*switchcount*0.01) ) )
if(status == LIGHT_OK && trigger)
status = LIGHT_BURNED
icon_state = "[base_state]-burned"
on = 0
set_light(0)
if(trigger)
burn_out()
else
use_power = 2
set_light(brightness)
SetLuminosity(brightness)
else
use_power = 1
set_light(0)
SetLuminosity(0)
active_power_usage = (brightness * 10)
if(on != on_gs)
@@ -250,6 +263,13 @@
removeStaticPower(static_power_used, STATIC_LIGHT)
/obj/machinery/light/proc/burn_out()
if(status == LIGHT_OK)
status = LIGHT_BURNED
icon_state = "[base_state]-burned"
on = 0
SetLuminosity(0)
// attempt to set the light's on/off status
// will not switch on if broken/burned/empty
/obj/machinery/light/proc/seton(s)
@@ -311,19 +331,7 @@
playsound(src.loc, W.usesound, 75, 1)
user.visible_message("[user.name] opens [src]'s casing.", \
"<span class='notice'>You open [src]'s casing.</span>", "<span class='italics'>You hear a noise.</span>")
var/obj/machinery/light_construct/newlight = null
switch(fitting)
if("tube")
newlight = new /obj/machinery/light_construct(src.loc)
newlight.icon_state = "tube-construct-stage2"
if("bulb")
newlight = new /obj/machinery/light_construct/small(src.loc)
newlight.icon_state = "bulb-construct-stage2"
newlight.setDir(src.dir)
newlight.stage = 2
transfer_fingerprints_to(newlight)
qdel(src)
deconstruct()
else
user << "<span class='userdanger'>You stick \the [W] into the light socket!</span>"
if(has_power() && (W.flags & CONDUCT))
@@ -331,36 +339,64 @@
s.set_up(3, 1, src)
s.start()
if (prob(75))
electrocute_mob(user, get_area(src), src, rand(0.7,1.0))
electrocute_mob(user, get_area(src), src, rand(0.7,1.0), TRUE)
else
return ..()
/obj/machinery/light/deconstruct(disassembled = TRUE)
if(!(flags & NODECONSTRUCT))
var/obj/structure/light_construct/newlight = null
var/cur_stage = 2
if(!disassembled)
cur_stage = 1
switch(fitting)
if("tube")
newlight = new /obj/structure/light_construct(src.loc)
newlight.icon_state = "tube-construct-stage[cur_stage]"
if("bulb")
newlight = new /obj/structure/light_construct/small(src.loc)
newlight.icon_state = "bulb-construct-stage[cur_stage]"
newlight.setDir(src.dir)
newlight.stage = cur_stage
if(!disassembled)
newlight.obj_integrity = newlight.max_integrity * 0.5
if(status != LIGHT_BROKEN)
break_light_tube()
if(status != LIGHT_EMPTY)
drop_light_tube()
new /obj/item/stack/cable_coil(loc, 1, "red")
transfer_fingerprints_to(newlight)
qdel(src)
/obj/machinery/light/attacked_by(obj/item/I, mob/living/user)
..()
if(status == LIGHT_BROKEN || status == LIGHT_EMPTY)
if(on && (I.flags & CONDUCT))
if(prob(12))
electrocute_mob(user, get_area(src), src, 0.3)
electrocute_mob(user, get_area(src), src, 0.3, TRUE)
/obj/machinery/light/take_damage(damage, damage_type = BRUTE, sound_effect = 1)
/obj/machinery/light/take_damage(damage_amount, damage_type = BRUTE, damage_flag = 0, sound_effect = 1)
. = ..()
if(. && !qdeleted(src))
if(prob(damage_amount * 5))
break_light_tube()
/obj/machinery/light/play_attack_sound(damage_amount, damage_type = BRUTE, damage_flag = 0)
switch(damage_type)
if(BRUTE)
if(sound_effect)
switch(status)
if(LIGHT_EMPTY)
playsound(loc, 'sound/weapons/smash.ogg', 50, 1)
if(LIGHT_BROKEN)
playsound(loc, 'sound/effects/hit_on_shattered_glass.ogg', 90, 1)
else
playsound(loc, 'sound/effects/Glasshit.ogg', 90, 1)
switch(status)
if(LIGHT_EMPTY)
playsound(loc, 'sound/weapons/smash.ogg', 50, 1)
if(LIGHT_BROKEN)
playsound(loc, 'sound/effects/hit_on_shattered_glass.ogg', 90, 1)
else
playsound(loc, 'sound/effects/Glasshit.ogg', 90, 1)
if(BURN)
if(sound_effect)
playsound(src.loc, 'sound/items/Welder.ogg', 100, 1)
else
return
health -= damage
if(health <= 0)
broken()
playsound(src.loc, 'sound/items/Welder.ogg', 100, 1)
// returns whether this light has power
@@ -389,20 +425,6 @@
src.flicker(1)
return
/obj/machinery/light/bullet_act(obj/item/projectile/P)
. = ..()
take_damage(P.damage, P.damage_type, 0)
/obj/machinery/light/hitby(AM as mob|obj)
..()
var/tforce = 0
if(ismob(AM))
tforce = 40
else if(isobj(AM))
var/obj/item/I = AM
tforce = I.throwforce
take_damage(tforce)
// attack with hand - remove tube/bulb
// if hands aren't protected and the light is on, burn the player
@@ -435,14 +457,16 @@
else
user << "<span class='warning'>You try to remove the light [fitting], but you burn your hand on it!</span>"
var/obj/item/bodypart/affecting = H.get_bodypart("[user.hand ? "l" : "r" ]_arm")
if(affecting && affecting.take_damage( 0, 5 )) // 5 burn damage
H.update_damage_overlays(0)
H.updatehealth()
var/obj/item/bodypart/affecting = H.get_bodypart("[(user.active_hand_index % 2 == 0) ? "r" : "l" ]_arm")
if(affecting && affecting.receive_damage( 0, 5 )) // 5 burn damage
H.update_damage_overlays()
return // if burned, don't remove the light
else
user << "<span class='notice'>You remove the light [fitting].</span>"
// create a light tube/bulb item and put it in the user's hand
drop_light_tube(user)
/obj/machinery/light/proc/drop_light_tube(mob/user)
var/obj/item/weapon/light/L = new light_type()
L.status = status
L.rigged = rigged
@@ -453,10 +477,11 @@
switchcount = 0
L.update()
L.add_fingerprint(user)
L.loc = loc
L.forceMove(loc)
user.put_in_active_hand(L) //puts it in our active hand
if(user) //puts it in our active hand
L.add_fingerprint(user)
user.put_in_active_hand(L)
status = LIGHT_EMPTY
update()
@@ -468,26 +493,13 @@
user << "<span class='notice'>You telekinetically remove the light [fitting].</span>"
// create a light tube/bulb item and put it in the user's hand
var/obj/item/weapon/light/L = new light_type()
L.status = status
L.rigged = rigged
L.brightness = brightness
drop_light_tube()
// light item inherits the switchcount, then zero it
L.switchcount = switchcount
switchcount = 0
L.update()
L.add_fingerprint(user)
L.loc = loc
status = LIGHT_EMPTY
update()
// break the light and make sparks if was on
/obj/machinery/light/proc/broken(skip_sound_and_sparks = 0)
if(status == LIGHT_EMPTY)
/obj/machinery/light/proc/break_light_tube(skip_sound_and_sparks = 0)
if(status == LIGHT_EMPTY || status == LIGHT_BROKEN)
return
if(!skip_sound_and_sparks)
@@ -508,19 +520,10 @@
on = 1
update()
// explosion effect
// destroy the whole light fixture or just shatter it
/obj/machinery/light/ex_act(severity, target)
..()
if(!qdeleted(src))
switch(severity)
if(2)
if(prob(50))
broken()
if(3)
if(prob(25))
broken()
/obj/machinery/light/tesla_act(power, explosive = FALSE)
if(explosive)
explosion(src.loc,0,0,0,flame_range = 5, adminlog = 0)
qdel(src)
// called when area power state changes
/obj/machinery/light/power_change()
@@ -532,14 +535,14 @@
/obj/machinery/light/temperature_expose(datum/gas_mixture/air, exposed_temperature, exposed_volume)
if(prob(max(0, exposed_temperature - 673))) //0% at <400C, 100% at >500C
broken()
break_light_tube()
// explode the light
/obj/machinery/light/proc/explode()
set waitfor = 0
var/turf/T = get_turf(src.loc)
broken() // break it first to give a warning
break_light_tube() // break it first to give a warning
sleep(2)
explosion(T, 0, 0, 2, 2)
sleep(1)
@@ -553,11 +556,11 @@
icon = 'icons/obj/lighting.dmi'
force = 2
throwforce = 5
w_class = 1
w_class = WEIGHT_CLASS_TINY
var/status = 0 // LIGHT_OK, LIGHT_BURNED or LIGHT_BROKEN
var/base_state
var/switchcount = 0 // number of times switched
materials = list(MAT_METAL=60)
materials = list(MAT_GLASS=100)
var/rigged = 0 // true if rigged to explode
var/brightness = 2 //how much light it gives off
@@ -567,7 +570,6 @@
icon_state = "ltube"
base_state = "ltube"
item_state = "c_tube"
materials = list(MAT_GLASS=100)
brightness = 8
/obj/item/weapon/light/bulb
@@ -576,7 +578,6 @@
icon_state = "lbulb"
base_state = "lbulb"
item_state = "contvapour"
materials = list(MAT_GLASS=100)
brightness = 4
/obj/item/weapon/light/throw_impact(atom/hit_atom)
+6 -2
View File
@@ -7,7 +7,6 @@
idle_power_usage = 20
active_power_usage = 100
circuit = /obj/item/weapon/circuitboard/computer/powermonitor
light_color = LIGHT_COLOR_ORANGE
var/obj/structure/cable/attached
@@ -69,9 +68,14 @@
for(var/obj/machinery/power/terminal/term in attached.powernet.nodes)
var/obj/machinery/power/apc/A = term.master
if(istype(A))
var/cell_charge
if(!A.cell)
cell_charge = 0
else
cell_charge = A.cell.percent()
data["areas"] += list(list(
"name" = A.area.name,
"charge" = A.cell.percent(),
"charge" = cell_charge,
"load" = A.lastused_total,
"charging" = A.charging,
"eqp" = A.equipment,
+9 -7
View File
@@ -1,4 +1,4 @@
//This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:33
/* new portable generator - work in progress
@@ -271,7 +271,7 @@ display round(lastgen) and plasmatank amount
/obj/machinery/power/port_gen/pacman/interact(mob/user)
if (get_dist(src, user) > 1 )
if (!istype(user, /mob/living/silicon/ai))
if(!isAI(user))
user.unset_machine()
user << browse(null, "window=port_gen")
return
@@ -290,7 +290,7 @@ display round(lastgen) and plasmatank amount
dat += text("Power current: [(powernet == null ? "Unconnected" : "[avail()]")]<br>")
dat += text("Heat: [current_heat]<br>")
dat += "<br><A href='?src=\ref[src];action=close'>Close</A>"
user << browse("[dat]", "window=port_gen")
user << browse(dat, "window=port_gen")
onclose(user, "port_gen")
/obj/machinery/power/port_gen/pacman/Topic(href, href_list)
@@ -332,8 +332,9 @@ display round(lastgen) and plasmatank amount
power_gen = 15000
time_per_sheet = 85
board_path = /obj/item/weapon/circuitboard/machine/pacman/super
overheat()
explosion(src.loc, 3, 3, 3, -1)
/obj/machinery/power/port_gen/pacman/super/overheat()
explosion(src.loc, 3, 3, 3, -1)
/obj/machinery/power/port_gen/pacman/mrs
name = "\improper M.R.S.P.A.C.M.A.N.-type portable generator"
@@ -342,5 +343,6 @@ display round(lastgen) and plasmatank amount
power_gen = 40000
time_per_sheet = 80
board_path = /obj/item/weapon/circuitboard/machine/pacman/mrs
overheat()
explosion(src.loc, 4, 4, 4, -1)
/obj/machinery/power/port_gen/pacman/mrs/overheat()
explosion(src.loc, 4, 4, 4, -1)
+8 -12
View File
@@ -86,18 +86,9 @@
// can override if needed
if(powered(power_channel))
stat &= ~NOPOWER
if(!use_auto_lights)
return
set_light(light_range_on, light_power_on)
else
stat |= NOPOWER
if(!use_auto_lights)
return
set_light(0)
return
// connect the machine to a powernet if a node cable is present on the turf
@@ -126,7 +117,7 @@
if(istype(W, /obj/item/stack/cable_coil))
var/obj/item/stack/cable_coil/coil = W
var/turf/T = user.loc
if(T.intact || !istype(T, /turf/open/floor))
if(T.intact || !isfloorturf(T))
return
if(get_dist(src, user) > 1)
return
@@ -284,11 +275,16 @@
//M is a mob who touched wire/whatever
//power_source is a source of electricity, can be powercell, area, apc, cable, powernet or null
//source is an object caused electrocuting (airlock, grille, etc)
//siemens_coeff - layman's terms, conductivity
//dist_check - set to only shock mobs within 1 of source (vendors, airlocks, etc.)
//No animations will be performed by this proc.
/proc/electrocute_mob(mob/living/carbon/M, power_source, obj/source, siemens_coeff = 1)
/proc/electrocute_mob(mob/living/carbon/M, power_source, obj/source, siemens_coeff = 1, dist_check = FALSE)
if(istype(M.loc,/obj/mecha))
return 0 //feckin mechs are dumb
if(istype(M,/mob/living/carbon/human))
if(dist_check)
if(!in_range(source,M))
return 0
if(ishuman(M))
var/mob/living/carbon/human/H = M
if(H.gloves)
var/obj/item/clothing/gloves/G = H.gloves
+150
View File
@@ -0,0 +1,150 @@
// Radioisotope Thermoelectric Generator (RTG)
// Simple power generator that would replace "magic SMES" on various derelicts.
/obj/machinery/power/rtg
name = "radioisotope thermoelectric generator"
desc = "A simple nuclear power generator, used in small outposts to reliably provide power for decades."
icon = 'icons/obj/power.dmi'
icon_state = "rtg"
density = 1
anchored = 1
use_power = 0
// You can buckle someone to RTG, then open its panel. Fun stuff.
can_buckle = TRUE
buckle_lying = FALSE
buckle_requires_restraints = TRUE
var/power_gen = 1000 // Enough to power a single APC. 4000 output with T4 capacitor.
var/board_path = /obj/item/weapon/circuitboard/machine/rtg
var/irradiate = TRUE // RTGs irradiate surroundings, but only when panel is open.
/obj/machinery/power/rtg/New()
..()
var/obj/item/weapon/circuitboard/machine/B = new board_path(null)
B.apply_default_parts(src)
connect_to_network()
/obj/item/weapon/circuitboard/machine/rtg
name = "circuit board (RTG)"
build_path = /obj/machinery/power/rtg
origin_tech = "programming=2;materials=4;powerstorage=3;engineering=2"
req_components = list(
/obj/item/stack/cable_coil = 5,
/obj/item/weapon/stock_parts/capacitor = 1,
/obj/item/stack/sheet/mineral/uranium = 10) // We have no Pu-238, and this is the closest thing to it.
/obj/machinery/power/rtg/initialize()
..()
connect_to_network()
/obj/machinery/power/rtg/process()
..()
add_avail(power_gen)
if(panel_open && irradiate)
radiation_pulse(get_turf(src), 2, 3, 6) // Weak but noticeable.
/obj/machinery/power/rtg/RefreshParts()
var/part_level = 0
for(var/obj/item/weapon/stock_parts/SP in component_parts)
part_level += SP.rating
power_gen = initial(power_gen) * part_level
/obj/machinery/power/rtg/attackby(obj/item/I, mob/user, params)
if(exchange_parts(user, I))
return
else if(default_deconstruction_screwdriver(user, "[initial(icon_state)]-open", initial(icon_state), I))
return
else if(default_deconstruction_crowbar(I))
return
return ..()
/obj/machinery/power/rtg/attack_hand(mob/user)
if(can_buckle && isliving(user.pulling) && user.a_intent == INTENT_GRAB && !has_buckled_mobs())
var/mob/living/L = user.pulling
if(L.buckled)
return
L.loc = src.loc
user_buckle_mob(L, user)
else
..()
/obj/machinery/power/rtg/advanced
desc = "An advanced RTG capable of moderating isotope decay, increasing power output but reducing lifetime. It uses plasma-fueled radiation collectors to increase output even further."
power_gen = 1250 // 2500 on T1, 10000 on T4.
board_path = /obj/item/weapon/circuitboard/machine/rtg/advanced
/obj/item/weapon/circuitboard/machine/rtg/advanced
name = "circuit board (Advanced RTG)"
build_path = /obj/machinery/power/rtg/advanced
origin_tech = "programming=3;materials=5;powerstorage=4;engineering=3;plasmatech=3"
req_components = list(
/obj/item/stack/cable_coil = 5,
/obj/item/weapon/stock_parts/capacitor = 1,
/obj/item/weapon/stock_parts/micro_laser = 1,
/obj/item/stack/sheet/mineral/uranium = 10,
/obj/item/stack/sheet/mineral/plasma = 5)
// Void Core, power source for Abductor ships and bases.
// Provides a lot of power, but tends to explode when mistreated.
/obj/machinery/power/rtg/abductor
name = "Void Core"
icon = 'icons/obj/abductor.dmi'
icon_state = "core"
desc = "An alien power source that produces energy seemingly out of nowhere."
board_path = /obj/item/weapon/circuitboard/machine/abductor/core
power_gen = 20000 // 280 000 at T1, 400 000 at T4. Starts at T4.
irradiate = FALSE // Green energy!
can_buckle = FALSE
pixel_y = 7
var/going_kaboom = FALSE // Is it about to explode?
/obj/item/weapon/circuitboard/machine/abductor/core
name = "alien board (Void Core)"
build_path = /obj/machinery/power/rtg/abductor
origin_tech = "programming=5;abductor=5;powerstorage=8;engineering=8"
req_components = list(
/obj/item/weapon/stock_parts/capacitor = 1,
/obj/item/weapon/stock_parts/micro_laser = 1,
/obj/item/weapon/stock_parts/cell/infinite/abductor = 1)
def_components = list(
/obj/item/weapon/stock_parts/capacitor = /obj/item/weapon/stock_parts/capacitor/quadratic,
/obj/item/weapon/stock_parts/micro_laser = /obj/item/weapon/stock_parts/micro_laser/quadultra)
/obj/machinery/power/rtg/abductor/proc/overload()
if(going_kaboom)
return
going_kaboom = TRUE
visible_message("<span class='danger'>\The [src] lets out an shower of sparks as it starts to lose stability!</span>",\
"<span class='italics'>You hear a loud electrical crack!</span>")
playsound(src.loc, 'sound/magic/LightningShock.ogg', 100, 1, extrarange = 5)
tesla_zap(src, 5, power_gen * 0.05)
addtimer(GLOBAL_PROC, "explosion", 100, TIMER_NORMAL, get_turf(src), 2, 3, 4, 8) // Not a normal explosion.
/obj/machinery/power/rtg/abductor/bullet_act(obj/item/projectile/Proj)
..()
if(!going_kaboom && istype(Proj) && !Proj.nodamage && ((Proj.damage_type == BURN) || (Proj.damage_type == BRUTE)))
message_admins("[key_name_admin(Proj.firer)] triggered an Abductor Core explosion via projectile.")
log_game("[key_name(Proj.firer)] triggered an Abductor Core explosion via projectile.")
overload()
/obj/machinery/power/rtg/abductor/blob_act(obj/structure/blob/B)
overload()
/obj/machinery/power/rtg/abductor/ex_act()
if(going_kaboom)
qdel(src)
else
overload()
/obj/machinery/power/rtg/abductor/fire_act(exposed_temperature, exposed_volume)
overload()
/obj/machinery/power/rtg/abductor/tesla_act()
..() //extend the zap
overload()
+11 -10
View File
@@ -1,4 +1,4 @@
//This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:33
var/global/list/rad_collectors = list()
/obj/machinery/power/rad_collector
@@ -10,6 +10,9 @@ var/global/list/rad_collectors = list()
density = 1
req_access = list(access_engine_equip)
// use_power = 0
obj_integrity = 350
max_integrity = 350
integrity_failure = 80
var/obj/item/weapon/tank/internals/plasma/loaded_tank = null
var/last_power = 0
var/active = 0
@@ -78,14 +81,14 @@ var/global/list/rad_collectors = list()
user << "<span class='warning'>Remove the plasma tank first!</span>"
return 1
if(!anchored && !isinspace())
playsound(src.loc, 'sound/items/Ratchet.ogg', 75, 1)
playsound(src.loc, W.usesound, 75, 1)
anchored = 1
user.visible_message("[user.name] secures the [src.name].", \
"<span class='notice'>You secure the external bolts.</span>", \
"<span class='italics'>You hear a ratchet.</span>")
connect_to_network()
else if(anchored)
playsound(src.loc, 'sound/items/Ratchet.ogg', 75, 1)
playsound(src.loc, W.usesound, 75, 1)
anchored = 0
user.visible_message("[user.name] unsecures the [src.name].", \
"<span class='notice'>You unsecure the external bolts.</span>", \
@@ -105,12 +108,10 @@ var/global/list/rad_collectors = list()
return ..()
/obj/machinery/power/rad_collector/ex_act(severity, target)
switch(severity)
if(2, 3)
eject()
return ..()
/obj/machinery/power/rad_collector/obj_break(damage_flag)
if(!(stat & BROKEN) && !(flags & NODECONSTRUCT))
eject()
stat |= BROKEN
/obj/machinery/power/rad_collector/proc/eject()
locked = 0
@@ -119,6 +120,7 @@ var/global/list/rad_collectors = list()
return
Z.loc = get_turf(src)
Z.layer = initial(Z.layer)
Z.plane = initial(Z.plane)
src.loaded_tank = null
if(active)
toggle_power()
@@ -155,4 +157,3 @@ var/global/list/rad_collectors = list()
flick("ca_deactive", src)
update_icons()
return
@@ -1,13 +1,13 @@
//This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:33
/obj/machinery/field/containment
name = "Containment Field"
name = "containment field"
desc = "An energy field."
icon = 'icons/obj/singularity.dmi'
icon_state = "Contain_F"
anchored = 1
density = 0
unacidable = 1
resistance_flags = INDESTRUCTIBLE | LAVA_PROOF | FIRE_PROOF | UNACIDABLE | ACID_PROOF
use_power = 0
luminosity = 4
layer = ABOVE_OBJ_LAYER
@@ -26,14 +26,33 @@
shock(user)
return 1
/obj/machinery/field/containment/attackby(obj/item/W, mob/user, params)
shock(user)
return 1
/obj/machinery/field/containment/blob_act(obj/effect/blob/B)
/obj/machinery/field/containment/play_attack_sound(damage_amount, damage_type = BRUTE, damage_flag = 0)
switch(damage_type)
if(BURN)
playsound(loc, 'sound/effects/EMPulse.ogg', 75, 1)
if(BRUTE)
playsound(loc, 'sound/effects/EMPulse.ogg', 75, 1)
/obj/machinery/field/containment/blob_act(obj/structure/blob/B)
return 0
/obj/machinery/field/containment/ex_act(severity, target)
return 0
/obj/machinery/field/containment/attack_animal(mob/living/simple_animal/M)
if(!FG1 || !FG2)
qdel(src)
return
if(ismegafauna(M))
M.visible_message("<span class='warning'>[M] glows fiercely as the containment field flickers out!</span>")
FG1.calc_power(INFINITY) //rip that 'containment' field
M.adjustHealth(-M.obj_damage)
else
..()
/obj/machinery/field/containment/Crossed(mob/mover)
if(isliving(mover))
@@ -59,6 +78,8 @@
/obj/machinery/field/containment/Move()
qdel(src)
// Abstract Field Class
// Used for overriding certain procs
@@ -77,26 +98,23 @@
return ..()
/obj/machinery/field/proc/shock(mob/living/user)
if(isliving(user))
var/shock_damage = min(rand(30,40),rand(30,40))
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.electrocute_act(shock_damage, src, 1)
if(iscarbon(user))
user.Stun(15)
user.Weaken(10)
user.electrocute_act(shock_damage, src, 1)
else if(issilicon(user))
if(prob(20))
user.Stun(2)
user.take_overall_damage(0, shock_damage)
user.visible_message("<span class='danger'>[user.name] was shocked by the [src.name]!</span>", \
"<span class='userdanger'>Energy pulse detected, system damaged!</span>", \
"<span class='italics'>You hear an electrical crack.</span>")
else if(issilicon(user))
if(prob(20))
user.Stun(2)
user.take_overall_damage(0, shock_damage)
user.visible_message("<span class='danger'>[user.name] was shocked by the [src.name]!</span>", \
"<span class='userdanger'>Energy pulse detected, system damaged!</span>", \
"<span class='italics'>You hear an electrical crack.</span>")
user.updatehealth()
bump_field(user)
return
user.updatehealth()
bump_field(user)
/obj/machinery/field/proc/clear_shock()
hasShocked = 0
+15 -5
View File
@@ -1,4 +1,4 @@
//This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:33
/obj/machinery/power/emitter
name = "Emitter"
@@ -126,6 +126,16 @@
user << "<span class='warning'>The [src] needs to be firmly secured to the floor first!</span>"
return 1
/obj/machinery/power/emitter/attack_animal(mob/living/simple_animal/M)
if(ismegafauna(M))
state = 0
anchored = FALSE
M.visible_message("<span class='warning'>[M] rips [src] free from its moorings!</span>")
else
..()
if(!anchored)
step(src, get_dir(M, src))
/obj/machinery/power/emitter/emp_act(severity)//Emitters are hardened but still might have issues
// add_load(1000)
@@ -205,14 +215,14 @@
if(0)
if(isinspace()) return
state = 1
playsound(src.loc, 'sound/items/Ratchet.ogg', 75, 1)
playsound(src.loc, W.usesound, 75, 1)
user.visible_message("[user.name] secures [src.name] to the floor.", \
"<span class='notice'>You secure the external reinforcing bolts to the floor.</span>", \
"<span class='italics'>You hear a ratchet</span>")
src.anchored = 1
if(1)
state = 0
playsound(src.loc, 'sound/items/Ratchet.ogg', 75, 1)
playsound(src.loc, W.usesound, 75, 1)
user.visible_message("[user.name] unsecures [src.name] reinforcing bolts from the floor.", \
"<span class='notice'>You undo the external reinforcing bolts.</span>", \
"<span class='italics'>You hear a ratchet.</span>")
@@ -235,7 +245,7 @@
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/W.toolspeed, target = src))
if (do_after(user,20*W.toolspeed, target = src))
if(!src || !WT.isOn()) return
state = 2
user << "<span class='notice'>You weld \the [src] to the floor.</span>"
@@ -246,7 +256,7 @@
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/W.toolspeed, target = src))
if (do_after(user,20*W.toolspeed, target = src))
if(!src || !WT.isOn()) return
state = 1
user << "<span class='notice'>You cut \the [src] free from the floor.</span>"
@@ -1,4 +1,4 @@
//This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:33
/*
@@ -23,13 +23,17 @@ field_generator power level display
#define FG_ONLINE 2
/obj/machinery/field/generator
name = "Field Generator"
name = "field generator"
desc = "A large thermal battery that projects a high amount of energy when powered."
icon = 'icons/obj/machines/field_generator.dmi'
icon_state = "Field_Gen"
anchored = 0
density = 1
use_power = 0
obj_integrity = 500
max_integrity = 500
//100% immune to lasers and energy projectiles since it absorbs their energy.
armor = list(melee = 25, bullet = 10, laser = 100, energy = 100, bomb = 0, bio = 0, rad = 0, fire = 50, acid = 70)
var/const/num_power_levels = 6 // Total number of power level icon has
var/power_level = 0
var/active = FG_OFFLINE
@@ -87,14 +91,14 @@ field_generator power level display
if(FG_UNSECURED)
if(isinspace()) return
state = FG_SECURED
playsound(loc, 'sound/items/Ratchet.ogg', 75, 1)
playsound(loc, W.usesound, 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>")
anchored = 1
if(FG_SECURED)
state = FG_UNSECURED
playsound(loc, 'sound/items/Ratchet.ogg', 75, 1)
playsound(loc, W.usesound, 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>")
@@ -114,7 +118,7 @@ field_generator power level display
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/W.toolspeed, target = src))
if (do_after(user,20*W.toolspeed, target = src))
if(!src || !WT.isOn()) return
state = FG_WELDED
user << "<span class='notice'>You weld the field generator to the floor.</span>"
@@ -125,7 +129,7 @@ field_generator power level display
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/W.toolspeed, target = src))
if (do_after(user,20*W.toolspeed, target = src))
if(!src || !WT.isOn()) return
state = FG_SECURED
user << "<span class='notice'>You cut \the [src] free from the floor.</span>"
@@ -133,12 +137,21 @@ field_generator power level display
else
return ..()
/obj/machinery/field/generator/attack_animal(mob/living/simple_animal/M)
if(M.environment_smash >= 3 && active == FG_OFFLINE && state != FG_UNSECURED)
state = FG_UNSECURED
anchored = FALSE
M.visible_message("<span class='warning'>[M] rips [src] free from its moorings!</span>")
else
..()
if(!anchored)
step(src, get_dir(M, src))
/obj/machinery/field/generator/emp_act()
return 0
/obj/machinery/field/generator/blob_act(obj/effect/blob/B)
/obj/machinery/field/generator/blob_act(obj/structure/blob/B)
if(active)
return 0
else
@@ -148,7 +161,7 @@ field_generator power level display
if(Proj.flag != "bullet")
power = min(power + Proj.damage, field_generator_max_power)
check_power_level()
return 0
..()
/obj/machinery/field/generator/Destroy()
@@ -182,8 +195,10 @@ field_generator power level display
start_fields()
/obj/machinery/field/generator/proc/calc_power()
/obj/machinery/field/generator/proc/calc_power(set_power_draw)
var/power_draw = 2 + fields.len
if(set_power_draw)
power_draw = set_power_draw
if(draw_power(round(power_draw/2,1)))
check_power_level()
+4 -3
View File
@@ -1,5 +1,5 @@
/////SINGULARITY SPAWNER
/obj/machinery/the_singularitygen/
/obj/machinery/the_singularitygen
name = "Gravitational Singularity Generator"
desc = "An Odd Device which produces a Gravitational Singularity when set up."
icon = 'icons/obj/singularity.dmi'
@@ -7,6 +7,7 @@
anchored = 0
density = 1
use_power = 0
resistance_flags = FIRE_PROOF
var/energy = 0
var/creation_type = /obj/singularity
@@ -25,13 +26,13 @@
user.visible_message("[user.name] secures [src.name] to the floor.", \
"<span class='notice'>You secure the [src.name] to the floor.</span>", \
"<span class='italics'>You hear a ratchet.</span>")
playsound(src.loc, 'sound/items/Ratchet.ogg', 75, 1)
playsound(src.loc, W.usesound, 75, 1)
anchored = 1
else if(anchored)
user.visible_message("[user.name] unsecures [src.name] from the floor.", \
"<span class='notice'>You unsecure the [src.name] from the floor.</span>", \
"<span class='italics'>You hear a ratchet.</span>")
playsound(src.loc, 'sound/items/Ratchet.ogg', 75, 1)
playsound(src.loc, W.usesound, 75, 1)
anchored = 0
else
return ..()
+5 -5
View File
@@ -25,8 +25,8 @@
/obj/singularity/narsie/large/New()
..()
world << "<span class='narsie'>NAR-SIE HAS RISEN</span>"
world << pick('sound/hallucinations/im_here1.ogg', 'sound/hallucinations/im_here2.ogg')
send_to_playing_players("<span class='narsie'>NAR-SIE HAS RISEN</span>")
send_to_playing_players(pick('sound/hallucinations/im_here1.ogg', 'sound/hallucinations/im_here2.ogg'))
var/area/A = get_area(src)
if(A)
@@ -36,7 +36,7 @@
narsie_spawn_animation()
sleep(70)
SSshuttle.emergency.request(null, 0.3) // Cannot recall
SSshuttle.emergency.request(null, 0.1) // Cannot recall
/obj/singularity/narsie/large/attack_ghost(mob/dead/observer/user as mob)
@@ -50,7 +50,7 @@
eat()
if(!target || prob(5))
pickcultist()
if(istype(target, /obj/structure/clockwork/massive/ratvar))
if(istype(target, /obj/structure/destructible/clockwork/massive/ratvar))
move(get_dir(src, target)) //Oh, it's you again.
else
move()
@@ -86,7 +86,7 @@
/obj/singularity/narsie/proc/pickcultist() //Narsie rewards her cultists with being devoured first, then picks a ghost to follow.
var/list/cultists = list()
var/list/noncultists = list()
for(var/obj/structure/clockwork/massive/ratvar/enemy in poi_list) //Prioritize killing Ratvar
for(var/obj/structure/destructible/clockwork/massive/ratvar/enemy in poi_list) //Prioritize killing Ratvar
if(enemy.z != z)
continue
acquire(enemy)
@@ -4,9 +4,10 @@
icon = 'icons/obj/machines/particle_accelerator.dmi'
icon_state = "particle"
anchored = 1
density = 1
density = 0
var/movement_range = 10
var/energy = 10
var/speed = 1
/obj/effect/accelerated_particle/weak
movement_range = 8
@@ -21,24 +22,27 @@
energy = 50
/obj/effect/accelerated_particle/New(loc, dir = 2)
src.setDir(dir)
/obj/effect/accelerated_particle/New(loc)
..()
spawn(0)
move(1)
addtimer(src, "move", 1)
/obj/effect/accelerated_particle/Bump(atom/A)
if (A)
if(ismob(A))
if(A)
if(isliving(A))
toxmob(A)
if((istype(A,/obj/machinery/the_singularitygen))||(istype(A,/obj/singularity/)))
A:energy += energy
else if(istype(A, /obj/machinery/the_singularitygen))
var/obj/machinery/the_singularitygen/S = A
S.energy += energy
else if(istype(A, /obj/singularity))
var/obj/singularity/S = A
S.energy += energy
/obj/effect/accelerated_particle/Bumped(atom/A)
if(ismob(A))
Bump(A)
/obj/effect/accelerated_particle/Crossed(atom/A)
if(isliving(A))
toxmob(A)
/obj/effect/accelerated_particle/ex_act(severity, target)
@@ -46,15 +50,13 @@
/obj/effect/accelerated_particle/proc/toxmob(mob/living/M)
M.rad_act(energy*6)
M.updatehealth()
/obj/effect/accelerated_particle/proc/move(lag)
/obj/effect/accelerated_particle/proc/move()
if(!step(src,dir))
loc = get_step(src,dir)
forceMove(get_step(src,dir))
movement_range--
if(movement_range == 0)
qdel(src)
else
sleep(lag)
move(lag)
sleep(speed)
move()
@@ -26,6 +26,10 @@
icon_state = "none"
anchored = 0
density = 1
obj_integrity = 500
max_integrity = 500
armor = list(melee = 30, bullet = 20, laser = 20, energy = 0, bomb = 0, bio = 0, rad = 0, fire = 90, acid = 80)
var/obj/machinery/particle_accelerator/control_box/master = null
var/construction_state = PA_CONSTRUCTION_UNSECURED
var/reference = null
@@ -95,7 +99,7 @@
switch(construction_state)
if(PA_CONSTRUCTION_UNSECURED)
if(istype(W, /obj/item/weapon/wrench) && !isinspace())
playsound(loc, 'sound/items/Ratchet.ogg', 75, 1)
playsound(loc, W.usesound, 75, 1)
anchored = 1
user.visible_message("[user.name] secures the [name] to the floor.", \
"You secure the external bolts.")
@@ -103,7 +107,7 @@
did_something = TRUE
if(PA_CONSTRUCTION_UNWIRED)
if(istype(W, /obj/item/weapon/wrench))
playsound(loc, 'sound/items/Ratchet.ogg', 75, 1)
playsound(loc, W.usesound, 75, 1)
anchored = 0
user.visible_message("[user.name] detaches the [name] from the floor.", \
"You remove the external bolts.")
@@ -143,16 +147,17 @@
return ..()
/obj/structure/particle_accelerator/deconstruct(disassembled = TRUE)
if(!(flags & NODECONSTRUCT))
new /obj/item/stack/sheet/metal (loc, 5)
qdel(src)
/obj/structure/particle_accelerator/Move()
..()
if(master && master.active)
master.toggle_power()
investigate_log("was moved whilst active; it <font color='red'>powered down</font>.","singulo")
/obj/structure/particle_accelerator/blob_act(obj/effect/blob/B)
if(prob(50))
qdel(src)
/obj/structure/particle_accelerator/update_icon()
switch(construction_state)
@@ -165,7 +170,6 @@
icon_state="[reference]p[strength]"
else
icon_state="[reference]c"
return
/obj/structure/particle_accelerator/proc/update_state()
if(master)
@@ -1,5 +1,3 @@
/obj/machinery/particle_accelerator/control_box
name = "Particle Accelerator Control Console"
desc = "This controls the density of the particles."
@@ -161,6 +159,7 @@
var/turf/T = loc
assembled = 0
critical_machine = FALSE
var/obj/structure/particle_accelerator/fuel_chamber/F = locate() in orange(1,src)
if(!F)
@@ -191,6 +190,7 @@
return 0
assembled = 1
critical_machine = TRUE //Only counts if the PA is actually assembled.
return 1
/obj/machinery/particle_accelerator/control_box/proc/check_part(turf/T, type)
@@ -204,7 +204,7 @@
/obj/machinery/particle_accelerator/control_box/proc/toggle_power()
active = !active
investigate_log("turned [active?"<font color='red'>ON</font>":"<font color='green'>OFF</font>"] by [usr ? key_name(usr) : "outside forces"]","singulo")
investigate_log("turned [active?"<font color='green'>ON</font>":"<font color='red'>OFF</font>"] by [usr ? key_name(usr) : "outside forces"]","singulo")
message_admins("PA Control Computer turned [active ?"ON":"OFF"] by [usr ? key_name_admin(usr) : "outside forces"](<A HREF='?_src_=holder;adminmoreinfo=\ref[usr]'>?</A>) (<A HREF='?_src_=holder;adminplayerobservefollow=\ref[usr]'>FLW</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 [active ?"ON":"OFF"] by [usr ? "[key_name(usr)]" : "outside forces"] in ([x],[y],[z])")
if(active)
@@ -226,7 +226,7 @@
/obj/machinery/particle_accelerator/control_box/interact(mob/user)
if((get_dist(src, user) > 1) || (stat & (BROKEN|NOPOWER)))
if(!istype(user, /mob/living/silicon))
if(!issilicon(user))
user.unset_machine()
user << browse(null, "window=pacontrol")
return
@@ -249,8 +249,6 @@
dat += "Particle Strength: [strength] "
dat += "<A href='?src=\ref[src];strengthdown=1'>--</A>|<A href='?src=\ref[src];strengthup=1'>++</A><BR><BR>"
//user << browse(dat, "window=pacontrol;size=420x500")
//onclose(user, "pacontrol")
var/datum/browser/popup = new(user, "pacontrol", name, 420, 300)
popup.set_content(dat)
popup.set_title_image(user.browse_rsc_icon(icon, icon_state))
@@ -273,7 +271,7 @@
switch(construction_state)
if(PA_CONSTRUCTION_UNSECURED)
if(istype(W, /obj/item/weapon/wrench) && !isinspace())
playsound(loc, 'sound/items/Ratchet.ogg', 75, 1)
playsound(loc, W.usesound, 75, 1)
anchored = 1
user.visible_message("[user.name] secures the [name] to the floor.", \
"You secure the external bolts.")
@@ -281,7 +279,7 @@
did_something = TRUE
if(PA_CONSTRUCTION_UNWIRED)
if(istype(W, /obj/item/weapon/wrench))
playsound(loc, 'sound/items/Ratchet.ogg', 75, 1)
playsound(loc, W.usesound, 75, 1)
anchored = 0
user.visible_message("[user.name] detaches the [name] from the floor.", \
"You remove the external bolts.")
@@ -320,7 +318,7 @@
..()
/obj/machinery/particle_accelerator/control_box/blob_act(obj/effect/blob/B)
/obj/machinery/particle_accelerator/control_box/blob_act(obj/structure/blob/B)
if(prob(50))
qdel(src)
@@ -27,15 +27,17 @@
/obj/structure/particle_accelerator/particle_emitter/proc/emit_particle(strength = 0)
if((last_shot + fire_delay) <= world.time)
last_shot = world.time
var/turf/T = get_step(src,dir)
var/turf/T = get_turf(src)
var/obj/effect/accelerated_particle/P
switch(strength)
if(0)
new/obj/effect/accelerated_particle/weak(T, dir)
P = new/obj/effect/accelerated_particle/weak(T)
if(1)
new/obj/effect/accelerated_particle(T, dir)
P = new/obj/effect/accelerated_particle(T)
if(2)
new/obj/effect/accelerated_particle/strong(T, dir)
P = new/obj/effect/accelerated_particle/strong(T)
if(3)
new/obj/effect/accelerated_particle/powerful(T, dir)
P = new/obj/effect/accelerated_particle/powerful(T)
P.setDir(dir)
return 1
return 0
+22 -11
View File
@@ -1,4 +1,4 @@
//This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:33
/obj/singularity
name = "gravitational singularity"
@@ -9,7 +9,7 @@
density = 1
layer = MASSIVE_OBJ_LAYER
luminosity = 6
unacidable = 1 //Don't comment this out.
appearance_flags = 0
var/current_size = 1
var/allowed_size = 1
var/contained = 1 //Are we going to move around?
@@ -26,7 +26,7 @@
var/last_failed_movement = 0//Will not move in the same dir if it couldnt before, will help with the getting stuck on fields thing
var/last_warning
var/consumedSupermatter = 0 //If the singularity has eaten a supermatter shard and can go to stage six
burn_state = LAVA_PROOF
resistance_flags = INDESTRUCTIBLE | LAVA_PROOF | FIRE_PROOF | UNACIDABLE | ACID_PROOF
/obj/singularity/New(loc, var/starting_energy = 50, var/temp = 0)
//CARN: admin-alert for chuckle-fuckery.
@@ -60,10 +60,23 @@
consume(user)
return 1
/obj/singularity/attack_paw(mob/user)
consume(user)
/obj/singularity/attack_alien(mob/user)
consume(user)
/obj/singularity/attack_animal(mob/user)
consume(user)
/obj/singularity/attackby(obj/item/weapon/W, mob/user, params)
consume(user)
return 1
/obj/singularity/Process_Spacemove() //The singularity stops drifting for no man!
return 0
/obj/singularity/blob_act(obj/effect/blob/B)
/obj/singularity/blob_act(obj/structure/blob/B)
return
/obj/singularity/ex_act(severity, target)
@@ -237,7 +250,7 @@
/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 || !isturf(loc))
continue
@@ -246,7 +259,7 @@
else
consume(T)
for(var/thing in T)
if(isturf(loc))
if(isturf(loc) && thing != src)
var/atom/movable/X = thing
if(get_dist(X, src) > consume_range)
X.singularity_pull(src, current_size)
@@ -391,11 +404,11 @@
/obj/singularity/proc/mezzer()
for(var/mob/living/carbon/M in oviewers(8, src))
if(istype(M, /mob/living/carbon/brain)) //Ignore brains
if(istype(M, /mob/living/brain)) //Ignore brains
continue
if(M.stat == CONSCIOUS)
if (istype(M,/mob/living/carbon/human))
if (ishuman(M))
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
@@ -415,11 +428,9 @@
/obj/singularity/proc/pulse()
for(var/obj/machinery/power/rad_collector/R in rad_collectors)
if(get_dist(R, src) <= 15) // Better than using orange() every process
if(R.z == z && get_dist(R, src) <= 15) // Better than using orange() every process
R.receive_pulse(energy)
return
/obj/singularity/singularity_act()
var/gain = (energy/2)
+7 -5
View File
@@ -135,16 +135,18 @@
var/obj/item/stack/cable_coil/C = I
if(C.amount < 10)
if(C.get_amount() < 10)
user << "<span class='warning'>You need more wires!</span>"
return
user << "<span class='notice'>You start building the power terminal...</span>"
playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1)
if(do_after(user, 20, target = src) && C.amount >= 10)
if(do_after(user, 20, target = src) && C.get_amount() >= 10)
if(C.get_amount() < 10 || !C)
return
var/obj/structure/cable/N = T.get_cable_node() //get the connecting node cable, if there's one
if (prob(50) && electrocute_mob(usr, N, N)) //animate the electrocution if uncautious and unlucky
if (prob(50) && electrocute_mob(usr, N, N, 1, TRUE)) //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()
@@ -162,7 +164,7 @@
//disassembling the terminal
if(istype(I, /obj/item/weapon/wirecutters) && terminal && panel_open)
terminal.dismantle(user)
terminal.dismantle(user, I)
return
//crowbarring it !
@@ -175,7 +177,7 @@
return ..()
/obj/machinery/power/smes/deconstruction()
/obj/machinery/power/smes/on_deconstruction()
for(var/obj/item/weapon/stock_parts/cell/cell in component_parts)
cell.charge = (charge / capacity) * cell.maxcharge
+50 -101
View File
@@ -12,7 +12,9 @@
idle_power_usage = 0
active_power_usage = 0
var/id = 0
var/health = 20
obj_integrity = 150
max_integrity = 150
integrity_failure = 50
var/obscured = 0
var/sunfrac = 0
var/adir = SOUTH // actual dir
@@ -50,62 +52,52 @@
S.anchored = 1
S.loc = src
if(S.glass_type == /obj/item/stack/sheet/rglass) //if the panel is in reinforced glass
health *= 2 //this need to be placed here, because panels already on the map don't have an assembly linked to
max_integrity *= 2 //this need to be placed here, because panels already on the map don't have an assembly linked to
obj_integrity = max_integrity
update_icon()
/obj/machinery/power/solar/attackby(obj/item/weapon/W, mob/user, params)
if(istype(W, /obj/item/weapon/crowbar))
playsound(src.loc, 'sound/machines/click.ogg', 50, 1)
user.visible_message("[user] begins to take the glass off the solar panel.", "<span class='notice'>You begin to take the glass off the solar panel...</span>")
if(do_after(user, 50/W.toolspeed, target = src))
var/obj/item/solar_assembly/S = locate() in src
if(S)
S.loc = src.loc
S.give_glass(stat & BROKEN)
if(do_after(user, 50*W.toolspeed, target = src))
playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1)
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)
deconstruct(TRUE)
else
return ..()
/obj/machinery/power/solar/bullet_act(obj/item/projectile/P)
. = ..()
take_damage(P.damage, P.damage_type)
/obj/machinery/power/solar/hitby(AM as mob|obj)
..()
var/tforce = 0
if(ismob(AM))
tforce = 20
else if(isobj(AM))
var/obj/item/I = AM
tforce = I.throwforce
take_damage(tforce)
/obj/machinery/power/solar/take_damage(damage, damage_type = BRUTE, sound_effect = 1)
/obj/machinery/power/solar/play_attack_sound(damage_amount, damage_type = BRUTE, damage_flag = 0)
switch(damage_type)
if(BRUTE)
if(sound_effect)
if(stat & BROKEN)
playsound(loc, 'sound/effects/hit_on_shattered_glass.ogg', 60, 1)
else
playsound(loc, 'sound/effects/Glasshit.ogg', 90, 1)
if(stat & BROKEN)
playsound(loc, 'sound/effects/hit_on_shattered_glass.ogg', 60, 1)
else
playsound(loc, 'sound/effects/Glasshit.ogg', 90, 1)
if(BURN)
if(sound_effect)
playsound(loc, 'sound/items/Welder.ogg', 100, 1)
playsound(loc, 'sound/items/Welder.ogg', 100, 1)
/obj/machinery/power/solar/obj_break(damage_flag)
if(!(stat & BROKEN) && !(flags & NODECONSTRUCT))
playsound(loc, 'sound/effects/Glassbr3.ogg', 100, 1)
stat |= BROKEN
unset_control()
update_icon()
/obj/machinery/power/solar/deconstruct(disassembled = TRUE)
if(!(flags & NODECONSTRUCT))
if(disassembled)
var/obj/item/solar_assembly/S = locate() in src
if(S)
S.forceMove(loc)
S.give_glass(stat & BROKEN)
else
return
health -= damage
if(health <= 0)
playsound(src, "shatter", 70, 1)
new /obj/item/weapon/shard(src.loc)
new /obj/item/weapon/shard(src.loc)
qdel(src)
else if(health <= 10)
if(!(stat & BROKEN))
playsound(loc, 'sound/effects/Glassbr3.ogg', 100, 1)
set_broken()
playsound(src, "shatter", 70, 1)
new /obj/item/weapon/shard(src.loc)
new /obj/item/weapon/shard(src.loc)
qdel(src)
/obj/machinery/power/solar/update_icon()
..()
@@ -115,7 +107,6 @@
else
add_overlay(image('icons/obj/power.dmi', icon_state = "solar_panel", layer = FLY_LAYER))
src.setDir(angle2dir(adir))
return
//calculates the fraction of the sunlight that the panel recieves
/obj/machinery/power/solar/proc/update_solar_exposure()
@@ -149,21 +140,6 @@
else //if we're no longer on the same powernet, remove from control computer
unset_control()
/obj/machinery/power/solar/proc/set_broken()
. = (!(stat & BROKEN))
stat |= BROKEN
unset_control()
update_icon()
/obj/machinery/power/solar/ex_act(severity, target)
..()
if(!qdeleted(src))
switch(severity)
if(2)
take_damage(rand(10,20), BRUTE, 0)
if(3)
take_damage(rand(5,15), BRUTE, 0)
/obj/machinery/power/solar/fake/New(var/turf/loc, var/obj/item/solar_assembly/S)
..(loc, S, 0)
@@ -208,7 +184,7 @@
icon = 'icons/obj/power.dmi'
icon_state = "sp_base"
item_state = "electropack"
w_class = 4 // Pretty big!
w_class = WEIGHT_CLASS_BULKY // Pretty big!
anchored = 0
var/tracker = 0
var/glass_type = null
@@ -289,7 +265,9 @@
density = 1
use_power = 1
idle_power_usage = 250
var/health = 25
obj_integrity = 200
max_integrity = 200
integrity_failure = 100
var/icon_screen = "solar"
var/icon_keyboard = "power_key"
var/id = 0
@@ -299,13 +277,9 @@
var/lastgen = 0
var/track = 0 // 0= off 1=timed 2=auto (tracker)
var/trackrate = 600 // 300-900 seconds
var/nexttime = 0 // time for a panel to rotate of 1 in manual tracking
var/nexttime = 0 // time for a panel to rotate of 1 degree in manual tracking
var/obj/machinery/power/tracker/connected_tracker = null
var/list/connected_panels = list()
use_auto_lights = 1
light_power_on = 1
light_range_on = 3
light_color = LIGHT_COLOR_ORANGE
/obj/machinery/power/solar_control/New()
@@ -443,7 +417,7 @@
/obj/machinery/power/solar_control/attackby(obj/item/I, mob/user, params)
if(istype(I, /obj/item/weapon/screwdriver))
playsound(src.loc, I.usesound, 50, 1)
if(do_after(user, 20/I.toolspeed, target = src))
if(do_after(user, 20*I.toolspeed, target = src))
if (src.stat & BROKEN)
user << "<span class='notice'>The broken glass falls out.</span>"
var/obj/structure/frame/computer/A = new /obj/structure/frame/computer( src.loc )
@@ -467,30 +441,23 @@
A.icon_state = "4"
A.anchored = 1
qdel(src)
else if(user.a_intent != "harm" && !(I.flags & NOBLUDGEON))
else if(user.a_intent != INTENT_HARM && !(I.flags & NOBLUDGEON))
src.attack_hand(user)
else
return ..()
/obj/machinery/power/solar_control/bullet_act(obj/item/projectile/P)
. = ..()
take_damage(P.damage, P.damage_type)
/obj/machinery/power/solar_control/take_damage(damage, damage_type = BRUTE, sound_effect = 1)
/obj/machinery/power/solar_control/play_attack_sound(damage_amount, damage_type = BRUTE, damage_flag = 0)
switch(damage_type)
if(BRUTE)
if(sound_effect)
if(stat & BROKEN)
playsound(src.loc, 'sound/effects/hit_on_shattered_glass.ogg', 70, 1)
else
playsound(src.loc, 'sound/effects/Glasshit.ogg', 75, 1)
if(stat & BROKEN)
playsound(src.loc, 'sound/effects/hit_on_shattered_glass.ogg', 70, 1)
else
playsound(src.loc, 'sound/effects/Glasshit.ogg', 75, 1)
if(BURN)
if(sound_effect)
playsound(src.loc, 'sound/items/Welder.ogg', 100, 1)
else
return
health -= damage
if(health <= 0 && !(stat & BROKEN))
playsound(src.loc, 'sound/items/Welder.ogg', 100, 1)
/obj/machinery/power/solar_control/obj_break(damage_flag)
if(!(stat & BROKEN) && !(flags & NODECONSTRUCT))
playsound(loc, 'sound/effects/Glassbr3.ogg', 100, 1)
stat |= BROKEN
update_icon()
@@ -527,24 +494,6 @@
update_icon()
/obj/machinery/power/solar_control/proc/set_broken()
stat |= BROKEN
update_icon()
/obj/machinery/power/solar_control/ex_act(severity, target)
..()
if(!qdeleted(src))
switch(severity)
if(2)
take_damage(rand(20,30), BRUTE, 0)
if(3)
take_damage(rand(10,20), BRUTE, 0)
/obj/machinery/power/solar_control/blob_act(obj/effect/blob/B)
if (prob(75))
set_broken()
src.density = 0
//
+34 -29
View File
@@ -24,7 +24,7 @@
density = 1
anchored = 0
luminosity = 4
resistance_flags = INDESTRUCTIBLE | LAVA_PROOF | FIRE_PROOF | UNACIDABLE | ACID_PROOF
var/gasefficency = 0.125
@@ -76,7 +76,9 @@
/obj/machinery/power/supermatter_shard/Destroy()
investigate_log("has been destroyed.", "supermatter")
qdel(radio)
if(radio)
qdel(radio)
radio = null
poi_list -= src
. = ..()
@@ -86,15 +88,15 @@
qdel(src)
/obj/machinery/power/supermatter_shard/process()
var/turf/L = loc
var/turf/T = loc
if(isnull(L)) // We have a null turf...something is wrong, stop processing this entity.
if(isnull(T)) // We have a null turf...something is wrong, stop processing this entity.
return PROCESS_KILL
if(!istype(L)) //We are in a crate or somewhere that isn't turf, if we return to turf resume processing but for now.
if(!istype(T)) //We are in a crate or somewhere that isn't turf, if we return to turf resume processing but for now.
return //Yeah just stop.
if(istype(L, /turf/open/space)) // Stop processing this stuff if we've been ejected.
if(isspaceturf(T)) // Stop processing this stuff if we've been ejected.
return
if(damage > warning_point) // while the core is still damaged and it's still worth noting its status
@@ -118,18 +120,20 @@
lastwarning = world.timeofday
if(damage > explosion_point)
for(var/mob/living/mob in living_mob_list)
if(istype(mob, /mob/living/carbon/human))
//Hilariously enough, running into a closet should make you get hit the hardest.
var/mob/living/carbon/human/H = mob
H.hallucination += max(50, min(300, DETONATION_HALLUCINATION * sqrt(1 / (get_dist(mob, src) + 1)) ) )
var/rads = DETONATION_RADS * sqrt( 1 / (get_dist(mob, src) + 1) )
mob.rad_act(rads)
for(var/mob in living_mob_list)
var/mob/living/L = mob
if(istype(L) && L.z == z)
if(ishuman(mob))
//Hilariously enough, running into a closet should make you get hit the hardest.
var/mob/living/carbon/human/H = mob
H.hallucination += max(50, min(300, DETONATION_HALLUCINATION * sqrt(1 / (get_dist(mob, src) + 1)) ) )
var/rads = DETONATION_RADS * sqrt( 1 / (get_dist(L, src) + 1) )
L.rad_act(rads)
explode()
//Ok, get the air from the turf
var/datum/gas_mixture/env = L.return_air()
var/datum/gas_mixture/env = T.return_air()
var/datum/gas_mixture/removed
@@ -234,19 +238,20 @@
message_admins("Singularity has consumed a supermatter shard and can now become stage six.")
visible_message("<span class='userdanger'>[src] is consumed by the singularity!</span>")
for(var/mob/M in mob_list)
M << 'sound/effects/supermatter.ogg' //everyone goan know bout this
M << "<span class='boldannounce'>A horrible screeching fills your ears, and a wave of dread washes over you...</span>"
if(M.z == z)
M << 'sound/effects/supermatter.ogg' //everyone goan know bout this
M << "<span class='boldannounce'>A horrible screeching fills your ears, and a wave of dread washes over you...</span>"
qdel(src)
return(gain)
/obj/machinery/power/supermatter_shard/blob_act(obj/effect/blob/B)
if(B && !istype(loc, /turf/open/space)) //does nothing in space
/obj/machinery/power/supermatter_shard/blob_act(obj/structure/blob/B)
if(B && !isspaceturf(loc)) //does nothing in space
playsound(get_turf(src), 'sound/effects/supermatter.ogg', 50, 1)
damage += B.health * 0.5 //take damage equal to 50% of remaining blob health before it tried to eat us
if(B.health > 100)
damage += B.obj_integrity * 0.5 //take damage equal to 50% of remaining blob health before it tried to eat us
if(B.obj_integrity > 100)
B.visible_message("<span class='danger'>\The [B] strikes at \the [src] and flinches away!</span>",\
"<span class='italics'>You hear a loud crack as you are washed with a wave of heat.</span>")
B.take_damage(100, BURN, src)
B.take_damage(100, BURN)
else
B.visible_message("<span class='danger'>\The [B] strikes at \the [src] and rapidly flashes to ash.</span>",\
"<span class='italics'>You hear a loud crack as you are washed with a wave of heat.</span>")
@@ -268,7 +273,7 @@
/obj/machinery/power/supermatter_shard/attack_hand(mob/living/user)
if(!istype(user))
return
user.visible_message("<span class='danger'>\The [user] reaches out and touches \the [src], inducing a resonance... \his body starts to glow and bursts into flames before flashing into ash.</span>",\
user.visible_message("<span class='danger'>\The [user] reaches out and touches \the [src], inducing a resonance... [user.p_their()] body starts to glow and bursts into flames before flashing into ash.</span>",\
"<span class='userdanger'>You reach out and touch \the [src]. Everything starts burning and all you can hear is ringing. Your last thought is \"That was not a wise decision.\"</span>",\
"<span class='italics'>You hear an unearthly noise as a wave of heat washes over you.</span>")
@@ -278,7 +283,7 @@
/obj/machinery/power/supermatter_shard/proc/transfer_energy()
for(var/obj/machinery/power/rad_collector/R in rad_collectors)
if(get_dist(R, src) <= 15) // Better than using orange() every process
if(R.z == z && get_dist(R, src) <= 15) //Better than using orange() every process
R.receive_pulse(power/10)
/obj/machinery/power/supermatter_shard/attackby(obj/item/W, mob/living/user, params)
@@ -295,13 +300,13 @@
radiation_pulse(get_turf(src), 1, 1, 150, 1)
/obj/machinery/power/supermatter_shard/Bumped(atom/AM as mob|obj)
if(istype(AM, /mob/living))
AM.visible_message("<span class='danger'>\The [AM] slams into \the [src] inducing a resonance... \his body starts to glow and catch flame before flashing into ash.</span>",\
/obj/machinery/power/supermatter_shard/Bumped(atom/AM)
if(isliving(AM))
AM.visible_message("<span class='danger'>\The [AM] slams into \the [src] inducing a resonance... [AM.p_their()] body starts to glow and catch flame before flashing into ash.</span>",\
"<span class='userdanger'>You slam into \the [src] as your ears are filled with unearthly ringing. Your last thought is \"Oh, fuck.\"</span>",\
"<span class='italics'>You hear an unearthly noise as a wave of heat washes over you.</span>")
else if(isobj(AM) && !istype(AM, /obj/effect))
AM.visible_message("<span class='danger'>\The [AM] smacks into \the [src] and rapidly flashes to ash.</span>",\
AM.visible_message("<span class='danger'>\The [AM] smacks into \the [src] and rapidly flashes to ash.</span>", null,\
"<span class='italics'>You hear a loud crack as you are washed with a wave of heat.</span>")
else
return
@@ -312,13 +317,13 @@
/obj/machinery/power/supermatter_shard/proc/Consume(atom/movable/AM)
if(istype(AM, /mob/living))
if(isliving(AM))
var/mob/living/user = AM
message_admins("[src] has consumed [key_name_admin(user)]<A HREF='?_src_=holder;adminmoreinfo=\ref[user]'>?</A> (<A HREF='?_src_=holder;adminplayerobservefollow=\ref[user]'>FLW</A>) <A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[x];Y=[y];Z=[z]'>(JMP)</a>.")
investigate_log("has consumed [key_name(user)].", "supermatter")
user.dust()
power += 200
else if(isobj(AM) && (!istype(AM, /obj/effect) || istype(AM, /obj/effect/blob)))
else if(isobj(AM) && !istype(AM, /obj/effect))
investigate_log("has consumed [AM].", "supermatter")
qdel(AM)
+6 -6
View File
@@ -38,7 +38,7 @@
/obj/machinery/power/apc/can_terminal_dismantle()
. = 0
if(opened && has_electronics != 2)
if(opened)
. = 1
/obj/machinery/power/smes/can_terminal_dismantle()
@@ -47,8 +47,8 @@
. = 1
/obj/machinery/power/terminal/proc/dismantle(mob/living/user)
if(istype(loc, /turf))
/obj/machinery/power/terminal/proc/dismantle(mob/living/user, obj/item/W)
if(isturf(loc))
var/turf/T = loc
if(T.intact)
user << "<span class='warning'>You must first expose the power terminal!</span>"
@@ -59,9 +59,9 @@
"<span class='notice'>You begin to cut the cables...</span>")
playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1)
if(do_after(user, 50, target = src))
if(do_after(user, 50*W.toolspeed, target = src))
if(master && master.can_terminal_dismantle())
if(prob(50) && electrocute_mob(user, powernet, src))
if(prob(50) && electrocute_mob(user, powernet, src, 1, TRUE))
var/datum/effect_system/spark_spread/s = new /datum/effect_system/spark_spread
s.set_up(5, 1, master)
s.start()
@@ -73,6 +73,6 @@
/obj/machinery/power/terminal/attackby(obj/item/W, mob/living/user, params)
if(istype(W, /obj/item/weapon/wirecutters))
dismantle(user)
dismantle(user, W)
else
return ..()
+3 -1
View File
@@ -49,7 +49,9 @@
/obj/machinery/power/tesla_coil/tesla_act(var/power)
being_shocked = 1
var/power_produced = power / power_loss
//don't lose arc power when it's not connected to anything
//please place tesla coils all around the station to maximize effectiveness
var/power_produced = powernet ? power / power_loss : power
add_avail(power_produced*input_power_multiplier)
flick("coilhit", src)
playsound(src.loc, 'sound/magic/LightningShock.ogg', 100, 1, extrarange = 5)
+46 -42
View File
@@ -15,7 +15,8 @@ var/list/blacklisted_tesla_types = typecacheof(list(/obj/machinery/atmospherics,
/obj/machinery/field/containment,
/obj/structure/disposalpipe,
/obj/structure/sign,
/obj/machinery/gateway))
/obj/machinery/gateway,
/obj/structure/lattice))
/obj/singularity/energy_ball
name = "energy ball"
@@ -38,17 +39,19 @@ var/list/blacklisted_tesla_types = typecacheof(list(/obj/machinery/atmospherics,
var/energy_to_raise = 32
var/energy_to_lower = -20
/obj/singularity/energy_ball/ex_act(severity, target)
return
/obj/singularity/energy_ball/Destroy()
if(orbiting && istype(orbiting, /obj/singularity/energy_ball))
var/obj/singularity/energy_ball/EB = orbiting
if(orbiting && istype(orbiting.orbiting, /obj/singularity/energy_ball))
var/obj/singularity/energy_ball/EB = orbiting.orbiting
EB.orbiting_balls -= src
orbiting = null
for(var/ball in orbiting_balls)
var/obj/singularity/energy_ball/EB = ball
qdel(EB)
return ..()
. = ..()
/obj/singularity/energy_ball/process()
if(!orbiting)
@@ -61,18 +64,16 @@ var/list/blacklisted_tesla_types = typecacheof(list(/obj/machinery/atmospherics,
pixel_x = 0
pixel_y = 0
setDir(tesla_zap(src, 7, TESLA_DEFAULT_POWER))
setDir(tesla_zap(src, 7, TESLA_DEFAULT_POWER, TRUE))
pixel_x = -32
pixel_y = -32
for (var/ball in orbiting_balls)
var/range = rand(1, Clamp(orbiting_balls.len, 3, 7))
tesla_zap(ball, range, TESLA_MINI_POWER/7*range)
tesla_zap(ball, range, TESLA_MINI_POWER/7*range, TRUE)
else
energy = 0 // ensure we dont have miniballs of miniballs
return
/obj/singularity/energy_ball/examine(mob/user)
..()
if(orbiting_balls.len)
@@ -89,28 +90,17 @@ var/list/blacklisted_tesla_types = typecacheof(list(/obj/machinery/atmospherics,
var/turf/T = get_step(src, move_dir)
if(can_move(T))
loc = T
for(var/mob/living/carbon/C in loc)
dust_mobs(C)
/obj/singularity/energy_ball/proc/handle_energy()
if(energy >= energy_to_raise)
energy_to_lower = energy_to_raise - 20
energy_to_raise = energy_to_raise * 1.25
playsound(src.loc, 'sound/magic/lightning_chargeup.ogg', 100, 1, extrarange = 30)
spawn(100)
if (!loc)
return
var/obj/singularity/energy_ball/EB = new(loc)
EB.transform *= pick(0.3, 0.4, 0.5, 0.6, 0.7)
var/icon/I = icon(icon,icon_state,dir)
var/orbitsize = (I.Width() + I.Height()) * pick(0.4, 0.5, 0.6, 0.7, 0.8)
orbitsize -= (orbitsize / world.icon_size) * (world.icon_size * 0.25)
EB.orbit(src, orbitsize, pick(FALSE, TRUE), rand(10, 25), pick(3, 4, 5, 6, 36))
addtimer(src, "new_mini_ball", 100)
else if(energy < energy_to_lower && orbiting_balls.len)
energy_to_raise = energy_to_raise / 1.25
@@ -122,6 +112,20 @@ var/list/blacklisted_tesla_types = typecacheof(list(/obj/machinery/atmospherics,
else if(orbiting_balls.len)
dissipate() //sing code has a much better system.
/obj/singularity/energy_ball/proc/new_mini_ball()
if(!loc)
return
var/obj/singularity/energy_ball/EB = new(loc)
EB.transform *= pick(0.3, 0.4, 0.5, 0.6, 0.7)
var/icon/I = icon(icon,icon_state,dir)
var/orbitsize = (I.Width() + I.Height()) * pick(0.4, 0.5, 0.6, 0.7, 0.8)
orbitsize -= (orbitsize / world.icon_size) * (world.icon_size * 0.25)
EB.orbit(src, orbitsize, pick(FALSE, TRUE), rand(10, 25), pick(3, 4, 5, 6, 36))
/obj/singularity/energy_ball/Bump(atom/A)
dust_mobs(A)
@@ -135,20 +139,22 @@ var/list/blacklisted_tesla_types = typecacheof(list(/obj/machinery/atmospherics,
target.dissipate_strength = target.orbiting_balls.len
. = ..()
if (istype(target))
target.orbiting_balls -= src
target.dissipate_strength = target.orbiting_balls.len
/obj/singularity/energy_ball/stop_orbit()
if (orbiting && istype(orbiting.orbiting, /obj/singularity/energy_ball))
var/obj/singularity/energy_ball/orbitingball = orbiting.orbiting
orbitingball.orbiting_balls -= src
orbitingball.dissipate_strength = orbitingball.orbiting_balls.len
..()
if (!loc)
qdel(src)
/obj/singularity/energy_ball/proc/dust_mobs(atom/A)
if(istype(A, /mob/living/carbon))
var/mob/living/carbon/C = A
C.dust()
return
/proc/tesla_zap(var/atom/source, zap_range = 3, power)
/proc/tesla_zap(atom/source, zap_range = 3, power, explosive = FALSE)
. = source.dir
if(power < 1000)
return
@@ -160,7 +166,7 @@ var/list/blacklisted_tesla_types = typecacheof(list(/obj/machinery/atmospherics,
var/mob/living/closest_mob
var/obj/machinery/closest_machine
var/obj/structure/closest_structure
var/obj/effect/blob/closest_blob
var/obj/structure/blob/closest_blob
for(var/A in oview(source, zap_range+2))
if(istype(A, /obj/machinery/power/tesla_coil))
@@ -188,7 +194,7 @@ var/list/blacklisted_tesla_types = typecacheof(list(/obj/machinery/atmospherics,
else if(closest_grounding_rod || is_type_in_typecache(A, blacklisted_tesla_types))
continue
else if(istype(A, /mob/living))
else if(isliving(A))
var/dist = get_dist(source, A)
var/mob/living/L = A
if(dist <= zap_range && (dist < closest_dist || !closest_mob) && L.stat != DEAD)
@@ -210,8 +216,8 @@ var/list/blacklisted_tesla_types = typecacheof(list(/obj/machinery/atmospherics,
else if(closest_mob)
continue
else if(istype(A, /obj/effect/blob))
var/obj/effect/blob/B = A
else if(istype(A, /obj/structure/blob))
var/obj/structure/blob/B = A
var/dist = get_dist(source, A)
if(dist <= zap_range && (dist < closest_dist || !closest_tesla_coil) && !B.being_shocked)
closest_blob = B
@@ -232,22 +238,22 @@ var/list/blacklisted_tesla_types = typecacheof(list(/obj/machinery/atmospherics,
//Alright, we've done our loop, now lets see if was anything interesting in range
if(closest_atom)
//common stuff
source.Beam(closest_atom, icon_state="lightning[rand(1,12)]", icon='icons/effects/effects.dmi', time=5)
source.Beam(closest_atom, icon_state="lightning[rand(1,12)]", time=5)
var/zapdir = get_dir(source, closest_atom)
if(zapdir)
. = zapdir
//per type stuff:
if(closest_tesla_coil)
closest_tesla_coil.tesla_act(power)
closest_tesla_coil.tesla_act(power, explosive)
else if(closest_grounding_rod)
closest_grounding_rod.tesla_act(power)
closest_grounding_rod.tesla_act(power, explosive)
else if(closest_mob)
var/shock_damage = Clamp(round(power/400), 10, 90) + rand(-5, 5)
closest_mob.electrocute_act(shock_damage, source, 1, tesla_shock = 1)
if(istype(closest_mob, /mob/living/silicon))
if(issilicon(closest_mob))
var/mob/living/silicon/S = closest_mob
S.emp_act(2)
tesla_zap(S, 7, power / 1.5) // metallic folks bounce it further
@@ -255,12 +261,10 @@ var/list/blacklisted_tesla_types = typecacheof(list(/obj/machinery/atmospherics,
tesla_zap(closest_mob, 5, power / 1.5)
else if(closest_machine)
closest_machine.tesla_act(power)
closest_machine.tesla_act(power, explosive)
else if(closest_blob)
closest_blob.tesla_act(power)
closest_blob.tesla_act(power, explosive)
else if(closest_structure)
closest_structure.tesla_act(power)
closest_structure.tesla_act(power, explosive)
+24 -6
View File
@@ -11,6 +11,9 @@
anchored = 1
density = 1
use_power = 0
obj_integrity = 250
max_integrity = 250
integrity_failure = 50
var/id = 0
var/sun_angle = 0 // sun angle as set by sun datum
@@ -63,17 +66,32 @@
if(istype(W, /obj/item/weapon/crowbar))
playsound(src.loc, 'sound/machines/click.ogg', 50, 1)
user.visible_message("[user] begins to take the glass off the solar tracker.", "<span class='notice'>You begin to take the glass off the solar tracker...</span>")
if(do_after(user, 50/W.toolspeed, target = src))
var/obj/item/solar_assembly/S = locate() in src
if(S)
S.loc = src.loc
S.give_glass(stat & BROKEN)
if(do_after(user, 50*W.toolspeed, target = src))
playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1)
user.visible_message("[user] takes the glass off the tracker.", "<span class='notice'>You take the glass off the tracker.</span>")
qdel(src)
deconstruct(TRUE)
else
return ..()
/obj/machinery/power/tracker/obj_break(damage_flag)
if(!(stat & BROKEN) && !(flags & NODECONSTRUCT))
playsound(loc, 'sound/effects/Glassbr3.ogg', 100, 1)
stat |= BROKEN
unset_control()
/obj/machinery/power/solar/deconstruct(disassembled = TRUE)
if(!(flags & NODECONSTRUCT))
if(disassembled)
var/obj/item/solar_assembly/S = locate() in src
if(S)
S.forceMove(loc)
S.give_glass(stat & BROKEN)
else
playsound(src, "shatter", 70, 1)
new /obj/item/weapon/shard(src.loc)
new /obj/item/weapon/shard(src.loc)
qdel(src)
// Tracker Electronic
/obj/item/weapon/electronics/tracker
+6 -8
View File
@@ -29,6 +29,8 @@
icon_state = "compressor"
anchored = 1
density = 1
resistance_flags = FIRE_PROOF
CanAtmosPass = ATMOS_PASS_DENSITY
var/obj/machinery/power/turbine/turbine
var/datum/gas_mixture/gas_contained
var/turf/inturf
@@ -47,6 +49,8 @@
icon_state = "turbine"
anchored = 1
density = 1
resistance_flags = FIRE_PROOF
CanAtmosPass = ATMOS_PASS_DENSITY
var/opened = 0
var/obj/machinery/power/compressor/compressor
var/turf/outturf
@@ -131,9 +135,6 @@
default_deconstruction_crowbar(I)
/obj/machinery/power/compressor/CanAtmosPass(turf/T)
return !density
/obj/machinery/power/compressor/process()
if(!turbine)
stat = BROKEN
@@ -155,7 +156,7 @@
// RPM function to include compression friction - be advised that too low/high of a compfriction value can make things screwy
rpm = max(0, rpm - (rpm*rpm)/(COMPFRICTION/efficiency))
rpm = max(0, rpm - (rpm*rpm)/(COMPFRICTION*efficiency))
if(starter && !(stat & NOPOWER))
@@ -219,9 +220,6 @@
if(compressor)
compressor.locate_machinery()
/obj/machinery/power/turbine/CanAtmosPass(turf/T)
return !density
/obj/machinery/power/turbine/process()
if(!compressor)
@@ -291,7 +289,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)) && !issilicon(user))
user.unset_machine(src)
user << browse(null, "window=turbine")
return