mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-19 02:54:41 +01:00
Merge remote-tracking branch 'upstream/master'
This commit is contained in:
@@ -1,54 +0,0 @@
|
||||
var/global/wcBrig
|
||||
var/global/wcBar
|
||||
var/global/wcCommon
|
||||
|
||||
//for all window/New and door/window/New
|
||||
/proc/color_windows(area = "common")
|
||||
var/list/common = list("#379963", "#0d8395", "#58b5c3", "#49e46e", "#8fcf44", "#ffffff")
|
||||
if(!wcCommon)
|
||||
wcCommon = pick(common)
|
||||
return wcCommon
|
||||
|
||||
//This func called in master-controller, replaces color in some area
|
||||
/proc/color_windows_init()
|
||||
var/list/brig = list("#aa0808", "#7f0606", "#ff0000")
|
||||
var/list/bar = list("#0d8395", "#58b5c3", "#58c366", "#90d79a", "#ffffff")
|
||||
|
||||
wcBrig = pick(brig)
|
||||
wcBar = pick(bar)
|
||||
|
||||
//BRIG
|
||||
var/wsBrigList = list(
|
||||
/area/security/brig,
|
||||
/area/security/detectives_office,
|
||||
/area/security/hos,
|
||||
/area/security/lobby,
|
||||
/area/security/main,
|
||||
/area/security/prison,
|
||||
/area/security/warden,
|
||||
/area/security/range,
|
||||
/area/prison/cell_block/A,
|
||||
/area/prison/cell_block/B,
|
||||
/area/prison/cell_block/C,
|
||||
/area/security/prison/cell_block/A,
|
||||
/area/security/prison/cell_block/B,
|
||||
/area/security/prison/cell_block/C,
|
||||
/area/security/processing,
|
||||
/area/security/armoury,
|
||||
/area/security/securearmoury,
|
||||
/area/security/podbay,
|
||||
/area/security/securehallway,
|
||||
/area/security/medbay
|
||||
)
|
||||
|
||||
for(var/A in wsBrigList)
|
||||
for(var/obj/structure/window/W in locate(A))
|
||||
W.color = wcBrig
|
||||
for(var/obj/machinery/door/window/D in locate(A))
|
||||
D.color = wcBrig
|
||||
|
||||
//BAR
|
||||
for(var/obj/structure/window/W in locate(/area/crew_quarters/bar))
|
||||
W.color = wcBar
|
||||
for(var/obj/machinery/door/window/D in locate(/area/crew_quarters/bar))
|
||||
D.color = wcBar
|
||||
@@ -1051,6 +1051,10 @@ var/list/all_supply_groups = list("Operations","Security","Hospitality","Enginee
|
||||
/datum/supply_packs/vending
|
||||
name = "Bartending Supply Crate"
|
||||
contains = list(/obj/item/weapon/vending_refill/boozeomat,
|
||||
/obj/item/weapon/vending_refill/boozeomat,
|
||||
/obj/item/weapon/vending_refill/boozeomat,
|
||||
/obj/item/weapon/vending_refill/coffee,
|
||||
/obj/item/weapon/vending_refill/coffee,
|
||||
/obj/item/weapon/vending_refill/coffee)
|
||||
cost = 15
|
||||
containertype = /obj/structure/closet/crate
|
||||
@@ -1070,6 +1074,7 @@ var/list/all_supply_groups = list("Operations","Security","Hospitality","Enginee
|
||||
/datum/supply_packs/vending/cola
|
||||
name = "Softdrinks Supply Crate"
|
||||
contains = list(/obj/item/weapon/vending_refill/cola,
|
||||
/obj/item/weapon/vending_refill/cola,
|
||||
/obj/item/weapon/vending_refill/cola)
|
||||
cost = 15
|
||||
containertype = /obj/structure/closet/crate
|
||||
@@ -1078,7 +1083,9 @@ var/list/all_supply_groups = list("Operations","Security","Hospitality","Enginee
|
||||
|
||||
/datum/supply_packs/vending/cigarette
|
||||
name = "Cigarette Supply Crate"
|
||||
contains = list(/obj/item/weapon/vending_refill/cigarette)
|
||||
contains = list(/obj/item/weapon/vending_refill/cigarette,
|
||||
/obj/item/weapon/vending_refill/cigarette,
|
||||
/obj/item/weapon/vending_refill/cigarette)
|
||||
cost = 15
|
||||
containertype = /obj/structure/closet/crate
|
||||
containername = "cigarette supply crate"
|
||||
|
||||
@@ -229,6 +229,7 @@
|
||||
var/obj/effect/overlay/holograph/H = locate() in T
|
||||
if(H)
|
||||
user << "<span class='notice'>You use [src] to destroy [H].</span>"
|
||||
signs -= H
|
||||
del(H)
|
||||
else
|
||||
if(signs.len < max_signs)
|
||||
@@ -589,7 +590,7 @@
|
||||
icon_state = "RPED"
|
||||
item_state = "RPED"
|
||||
w_class = 5
|
||||
can_hold = list("/obj/item/weapon/stock_parts")
|
||||
can_hold = list("/obj/item/weapon/stock_parts","/obj/item/weapon/cell")
|
||||
storage_slots = 14
|
||||
use_to_pickup = 1
|
||||
allow_quick_gather = 1
|
||||
@@ -598,6 +599,9 @@
|
||||
max_w_class = 3
|
||||
max_combined_w_class = 28
|
||||
|
||||
/obj/item/weapon/storage/part_replacer/proc/play_rped_sound()
|
||||
//Plays the sound for RPED exchanging or installing parts.
|
||||
playsound(src, 'sound/items/rped.ogg', 40, 1)
|
||||
|
||||
/obj/item/weapon/stock_parts
|
||||
name = "stock part"
|
||||
|
||||
@@ -726,19 +726,23 @@ var/list/ghostteleportlocs = list()
|
||||
icon_state = "dk_yellow"
|
||||
|
||||
/area/prison/solitary
|
||||
name = "Solitary Confinement"
|
||||
name = "\improper Solitary Confinement"
|
||||
icon_state = "brig"
|
||||
|
||||
/area/prison/cell_block
|
||||
name = "\improper Prison Cell Block"
|
||||
icon_state = "brig"
|
||||
|
||||
/area/prison/cell_block/A
|
||||
name = "Prison Cell Block A"
|
||||
name = "\improper Prison Cell Block A"
|
||||
icon_state = "brig"
|
||||
|
||||
/area/prison/cell_block/B
|
||||
name = "Prison Cell Block B"
|
||||
name = "\improper Prison Cell Block B"
|
||||
icon_state = "brig"
|
||||
|
||||
/area/prison/cell_block/C
|
||||
name = "Prison Cell Block C"
|
||||
name = "\improper Prison Cell Block C"
|
||||
icon_state = "brig"
|
||||
|
||||
//STATION13
|
||||
@@ -746,6 +750,10 @@ var/list/ghostteleportlocs = list()
|
||||
/area/atmos
|
||||
name = "Atmospherics"
|
||||
icon_state = "atmos"
|
||||
|
||||
/area/atmos/control
|
||||
name = "Atmospherics Control Room"
|
||||
icon_state = "atmos"
|
||||
|
||||
//Maintenance
|
||||
|
||||
@@ -1025,7 +1033,7 @@ var/list/ghostteleportlocs = list()
|
||||
icon_state = "chapeloffice"
|
||||
|
||||
/area/escapepodbay
|
||||
name = "Escape Shuttle Hallway Podbay"
|
||||
name = "\improper Escape Shuttle Hallway Podbay"
|
||||
icon_state = "escape"
|
||||
|
||||
/area/lawoffice
|
||||
@@ -1036,11 +1044,11 @@ var/list/ghostteleportlocs = list()
|
||||
name = "\improper Magistrate's Office"
|
||||
icon_state = "law"
|
||||
|
||||
area/clownoffice
|
||||
/area/clownoffice
|
||||
name = "\improper Clown's Office"
|
||||
icon_state = "dk_yellow"
|
||||
|
||||
area/mimeoffice
|
||||
/area/mimeoffice
|
||||
name = "\improper Mime's Office"
|
||||
icon_state = "dk_yellow"
|
||||
|
||||
@@ -1150,27 +1158,42 @@ area/mimeoffice
|
||||
|
||||
//Engineering
|
||||
|
||||
/area/engine
|
||||
engine_smes
|
||||
name = "\improper Engineering SMES"
|
||||
icon_state = "engine_smes"
|
||||
requires_power = 0//This area only covers the batteries and they deal with their own power
|
||||
/area/engine/engine_smes
|
||||
name = "\improper Engineering SMES"
|
||||
icon_state = "engine_smes"
|
||||
requires_power = 0//This area only covers the batteries and they deal with their own power
|
||||
|
||||
engineering
|
||||
name = "Engineering"
|
||||
icon_state = "engine_smes"
|
||||
/area/engine/engineering
|
||||
name = "Engineering"
|
||||
icon_state = "engine_smes"
|
||||
|
||||
break_room
|
||||
name = "\improper Engineering Foyer"
|
||||
icon_state = "engine"
|
||||
/area/engine/break_room
|
||||
name = "\improper Engineering Foyer"
|
||||
icon_state = "engine"
|
||||
|
||||
/area/engine/equipmentstorage
|
||||
name = "\improper Engineering Equipment Storage"
|
||||
icon_state = "storage"
|
||||
|
||||
/area/engine/hardsuitstorage
|
||||
name = "\improper Engineering Equipment Storage"
|
||||
icon_state = "storage"
|
||||
|
||||
/area/engine/controlroom
|
||||
name = "\improper Engineering Control Room"
|
||||
icon_state = "engine_control"
|
||||
|
||||
chiefs_office
|
||||
name = "\improper Chief Engineer's office"
|
||||
icon_state = "engine_control"
|
||||
/area/engine/gravitygenerator
|
||||
name = "\improper Gravity Generator"
|
||||
icon_state = "engine"
|
||||
|
||||
/area/engine/chiefs_office
|
||||
name = "\improper Chief Engineer's office"
|
||||
icon_state = "engine_control"
|
||||
|
||||
mechanic_workshop
|
||||
name = "\improper Mechanic Workshop"
|
||||
icon_state = "engine"
|
||||
/area/engine/mechanic_workshop
|
||||
name = "\improper Mechanic Workshop"
|
||||
icon_state = "engine"
|
||||
|
||||
//Solars
|
||||
|
||||
@@ -1408,35 +1431,63 @@ area/mimeoffice
|
||||
/area/security/brig
|
||||
name = "\improper Brig"
|
||||
icon_state = "brig"
|
||||
|
||||
|
||||
/area/security/permabrig
|
||||
name = "\improper Prison Wing"
|
||||
icon_state = "sec_prison"
|
||||
|
||||
/area/security/prison
|
||||
name = "\improper Prison Wing"
|
||||
icon_state = "sec_prison"
|
||||
icon_state = "sec_prison"
|
||||
|
||||
/area/security/prison/cell_block
|
||||
name = "\improper Prison Cell Block"
|
||||
icon_state = "brig"
|
||||
|
||||
/area/security/prison/cell_block/A
|
||||
name = "Prison Cell Block A"
|
||||
name = "\improper Prison Cell Block A"
|
||||
icon_state = "brig"
|
||||
|
||||
/area/security/prison/cell_block/B
|
||||
name = "Prison Cell Block B"
|
||||
name = "\improper Prison Cell Block B"
|
||||
icon_state = "brig"
|
||||
|
||||
/area/security/prison/cell_block/C
|
||||
name = "Prison Cell Block C"
|
||||
name = "\improper Prison Cell Block C"
|
||||
icon_state = "brig"
|
||||
|
||||
/area/security/execution
|
||||
name = "\improper Execution"
|
||||
icon_state = "security"
|
||||
|
||||
/area/security/processing
|
||||
name = "\improper Prisoner Processing"
|
||||
icon_state = "security"
|
||||
|
||||
/area/security/interrogation
|
||||
name = "\improper Interrogation"
|
||||
icon_state = "security"
|
||||
|
||||
/area/security/interrogationobs
|
||||
name = "\improper Interrogation Observation"
|
||||
icon_state = "security"
|
||||
|
||||
/area/security/evidence
|
||||
name = "\improper Evidence Room"
|
||||
icon_state = "security"
|
||||
|
||||
/area/security/prisonlockers
|
||||
name = "\improper Prisoner Lockers"
|
||||
icon_state = "sec_prison"
|
||||
|
||||
/area/security/medbay
|
||||
name = "\improper Security Medbay"
|
||||
icon_state = "brig"
|
||||
|
||||
/area/security/processing
|
||||
name = "\improper Prisoner Processing"
|
||||
icon_state = "sec_prison"
|
||||
/area/security/prisonershuttle
|
||||
name = "\improper Security Prisoner Shuttle"
|
||||
icon_state = "security"
|
||||
|
||||
/area/security/warden
|
||||
name = "\improper Security Medbay"
|
||||
icon_state = "Warden"
|
||||
|
||||
/area/security/warden
|
||||
name = "\improper Warden"
|
||||
icon_state = "Warden"
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
name = "\improper DNA modifier"
|
||||
desc = "It scans DNA structures."
|
||||
icon = 'icons/obj/Cryogenic2.dmi'
|
||||
icon_state = "scanner_0"
|
||||
icon_state = "scanner_open"
|
||||
density = 1
|
||||
anchored = 1.0
|
||||
use_power = 1
|
||||
@@ -49,6 +49,9 @@
|
||||
var/mob/living/carbon/occupant = null
|
||||
var/obj/item/weapon/reagent_containers/glass/beaker = null
|
||||
var/opened = 0
|
||||
var/damage_coeff
|
||||
var/scan_level
|
||||
var/precision_coeff
|
||||
|
||||
/obj/machinery/dna_scannernew/New()
|
||||
..()
|
||||
@@ -58,10 +61,21 @@
|
||||
component_parts += new /obj/item/weapon/stock_parts/manipulator(src)
|
||||
component_parts += new /obj/item/weapon/stock_parts/micro_laser(src)
|
||||
component_parts += new /obj/item/weapon/stock_parts/console_screen(src)
|
||||
component_parts += new /obj/item/stack/cable_coil(src)
|
||||
component_parts += new /obj/item/stack/cable_coil(src)
|
||||
component_parts += new /obj/item/stack/cable_coil(src, 1)
|
||||
component_parts += new /obj/item/stack/cable_coil(src, 1)
|
||||
RefreshParts()
|
||||
|
||||
/obj/machinery/dna_scannernew/RefreshParts()
|
||||
scan_level = 0
|
||||
damage_coeff = 0
|
||||
precision_coeff = 0
|
||||
for(var/obj/item/weapon/stock_parts/scanning_module/P in component_parts)
|
||||
scan_level += P.rating
|
||||
for(var/obj/item/weapon/stock_parts/manipulator/P in component_parts)
|
||||
precision_coeff = P.rating
|
||||
for(var/obj/item/weapon/stock_parts/micro_laser/P in component_parts)
|
||||
damage_coeff = P.rating
|
||||
|
||||
/obj/machinery/dna_scannernew/allow_drop()
|
||||
return 0
|
||||
|
||||
@@ -119,7 +133,7 @@
|
||||
usr.client.eye = src
|
||||
usr.loc = src
|
||||
src.occupant = usr
|
||||
src.icon_state = "scanner_1"
|
||||
src.icon_state = "scanner_occupied"
|
||||
src.add_fingerprint(usr)
|
||||
return
|
||||
|
||||
@@ -165,31 +179,21 @@
|
||||
user.pulling = null
|
||||
|
||||
/obj/machinery/dna_scannernew/attackby(var/obj/item/weapon/item as obj, var/mob/user as mob)
|
||||
if (istype(item, /obj/item/weapon/screwdriver))
|
||||
if (!opened)
|
||||
src.opened = 1
|
||||
user << "You open the maintenance hatch of [src]."
|
||||
//src.icon_state = "autolathe_t"
|
||||
else
|
||||
src.opened = 0
|
||||
user << "You close the maintenance hatch of [src]."
|
||||
//src.icon_state = "autolathe"
|
||||
return 1
|
||||
else if(istype(item, /obj/item/weapon/crowbar))
|
||||
if (occupant)
|
||||
user << "\red You cannot disassemble this [src], it's occupado."
|
||||
return 1
|
||||
if (opened)
|
||||
playsound(get_turf(src), 'sound/items/Crowbar.ogg', 50, 1)
|
||||
var/obj/machinery/constructable_frame/machine_frame/M = new /obj/machinery/constructable_frame/machine_frame(src.loc)
|
||||
M.state = 2
|
||||
M.icon_state = "box_1"
|
||||
for(var/obj/I in component_parts)
|
||||
if(I.reliability != 100 && crit_fail)
|
||||
I.crit_fail = 1
|
||||
I.loc = src.loc
|
||||
del(src)
|
||||
if(istype(item, /obj/item/weapon/screwdriver))
|
||||
if(occupant)
|
||||
user << "<span class='notice'>The maintenance panel is locked.</span>"
|
||||
return
|
||||
default_deconstruction_screwdriver(user, "[icon_state]_maintenance", "[initial(icon_state)]", item)
|
||||
|
||||
if(exchange_parts(user, item))
|
||||
return
|
||||
|
||||
if(istype(item, /obj/item/weapon/crowbar))
|
||||
if(panel_open)
|
||||
for(var/obj/I in contents) // in case there is something in the scanner
|
||||
I.loc = src.loc
|
||||
default_deconstruction_crowbar(item)
|
||||
return
|
||||
else if(istype(item, /obj/item/weapon/reagent_containers/glass))
|
||||
if(beaker)
|
||||
user << "\red A beaker is already loaded into the machine."
|
||||
@@ -206,10 +210,13 @@
|
||||
if (!ismob(G.affecting))
|
||||
return
|
||||
if (src.occupant)
|
||||
user << "\blue <B>The scanner is already occupied!</B>"
|
||||
user << "\blue <b>The scanner is already occupied!</b>"
|
||||
return
|
||||
if (G.affecting.abiotic())
|
||||
user << "\blue <B>Subject cannot have abiotic items on.</B>"
|
||||
user << "\blue <b>Subject cannot have abiotic items on.</b>"
|
||||
return
|
||||
if(panel_open)
|
||||
usr << "\blue <b>Close the maintenance panel first.</b>"
|
||||
return
|
||||
put_in(G.affecting)
|
||||
src.add_fingerprint(user)
|
||||
@@ -222,7 +229,7 @@
|
||||
M.client.eye = src
|
||||
M.loc = src
|
||||
src.occupant = M
|
||||
src.icon_state = "scanner_1"
|
||||
src.icon_state = "scanner_occupied"
|
||||
|
||||
// search for ghosts, if the corpse is empty and the scanner is connected to a cloner
|
||||
if(locate(/obj/machinery/computer/cloning, get_step(src, NORTH)) \
|
||||
@@ -238,14 +245,20 @@
|
||||
return
|
||||
|
||||
/obj/machinery/dna_scannernew/proc/go_out()
|
||||
if ((!( src.occupant ) || src.locked))
|
||||
if (!src.occupant)
|
||||
usr << "<span class=\"warning\">The scanner is empty!</span>"
|
||||
return
|
||||
|
||||
if (src.locked)
|
||||
usr << "<span class=\"warning\">The scanner is locked!</span>"
|
||||
return
|
||||
|
||||
if (src.occupant.client)
|
||||
src.occupant.client.eye = src.occupant.client.mob
|
||||
src.occupant.client.perspective = MOB_PERSPECTIVE
|
||||
src.occupant.loc = src.loc
|
||||
src.occupant = null
|
||||
src.icon_state = "scanner_0"
|
||||
src.icon_state = "scanner_open"
|
||||
return
|
||||
|
||||
/obj/machinery/dna_scannernew/ex_act(severity)
|
||||
@@ -288,7 +301,7 @@
|
||||
|
||||
/obj/machinery/computer/scan_consolenew
|
||||
name = "DNA Modifier Access Console"
|
||||
desc = "Scand DNA."
|
||||
desc = "Allows you to scan and modify DNA."
|
||||
icon = 'icons/obj/computer.dmi'
|
||||
icon_state = "scanner"
|
||||
density = 1
|
||||
@@ -327,7 +340,6 @@
|
||||
return
|
||||
|
||||
/obj/machinery/computer/scan_consolenew/ex_act(severity)
|
||||
|
||||
switch(severity)
|
||||
if(1.0)
|
||||
//SN src = null
|
||||
@@ -342,7 +354,6 @@
|
||||
return
|
||||
|
||||
/obj/machinery/computer/scan_consolenew/blob_act()
|
||||
|
||||
if(prob(75))
|
||||
del(src)
|
||||
|
||||
@@ -395,14 +406,20 @@
|
||||
return
|
||||
*/
|
||||
/obj/machinery/computer/scan_consolenew/attack_paw(user as mob)
|
||||
ui_interact(user)
|
||||
attack_hand(user)
|
||||
|
||||
/obj/machinery/computer/scan_consolenew/attack_ai(user as mob)
|
||||
src.add_hiddenprint(user)
|
||||
ui_interact(user)
|
||||
attack_hand(user)
|
||||
|
||||
/obj/machinery/computer/scan_consolenew/attack_hand(user as mob)
|
||||
if(!..())
|
||||
if(isnull(connected))
|
||||
for(dir in list(NORTH,EAST,SOUTH,WEST))
|
||||
connected = locate(/obj/machinery/dna_scannernew, get_step(src, dir))
|
||||
if(!isnull(connected))
|
||||
attack_hand(user)
|
||||
break
|
||||
else if(!..())
|
||||
ui_interact(user)
|
||||
|
||||
/**
|
||||
@@ -475,7 +492,7 @@
|
||||
occupantData["name"] = connected.occupant.name
|
||||
occupantData["stat"] = connected.occupant.stat
|
||||
occupantData["isViableSubject"] = 1
|
||||
if (M_NOCLONE in connected.occupant.mutations || !src.connected.occupant.dna)
|
||||
if ((M_NOCLONE in connected.occupant.mutations && connected.scan_level < 3) || !src.connected.occupant.dna)
|
||||
occupantData["isViableSubject"] = 0
|
||||
occupantData["health"] = connected.occupant.health
|
||||
occupantData["maxHealth"] = connected.occupant.maxHealth
|
||||
@@ -553,7 +570,7 @@
|
||||
else
|
||||
randmuti(src.connected.occupant)
|
||||
|
||||
src.connected.occupant.radiation += ((src.radiation_intensity*3)+src.radiation_duration*3)
|
||||
src.connected.occupant.radiation += (((src.radiation_intensity*3)+src.radiation_duration*3) / connected.damage_coeff)
|
||||
src.connected.locked = lock_state
|
||||
return 1 // return 1 forces an update to all Nano uis attached to src
|
||||
|
||||
@@ -649,7 +666,7 @@
|
||||
src.connected.occupant.UpdateAppearance()
|
||||
src.connected.occupant.radiation += (src.radiation_intensity+src.radiation_duration)
|
||||
else
|
||||
if (prob(20+src.radiation_intensity))
|
||||
if (prob(20+src.radiation_intensity))
|
||||
randmutb(src.connected.occupant)
|
||||
domutcheck(src.connected.occupant,src.connected)
|
||||
else
|
||||
@@ -700,7 +717,7 @@
|
||||
irradiating = 0
|
||||
|
||||
if(src.connected.occupant)
|
||||
if (prob((80 + (src.radiation_duration / 2))))
|
||||
if (prob((80 + ((src.radiation_duration / 2) + (connected.precision_coeff ** 3)))))
|
||||
// FIXME: Find out what these corresponded to and change them to the WHATEVERBLOCK they need to be.
|
||||
//if ((src.selected_se_block != 2 || src.selected_se_block != 12 || src.selected_se_block != 8 || src.selected_se_block || 10) && prob (20))
|
||||
var/real_SE_block=selected_se_block
|
||||
@@ -713,11 +730,11 @@
|
||||
|
||||
//testing("Irradiated SE block [real_SE_block]:[src.selected_se_subblock] ([original_block] now [block]) [(real_SE_block!=selected_se_block) ? "(SHIFTED)":""]!")
|
||||
connected.occupant.dna.SetSESubBlock(real_SE_block,selected_se_subblock,block)
|
||||
src.connected.occupant.radiation += (src.radiation_intensity+src.radiation_duration)
|
||||
src.connected.occupant.radiation += ((src.radiation_intensity+src.radiation_duration) / connected.damage_coeff)
|
||||
domutcheck(src.connected.occupant,src.connected)
|
||||
else
|
||||
src.connected.occupant.radiation += ((src.radiation_intensity*2)+src.radiation_duration)
|
||||
if (prob(80-src.radiation_duration))
|
||||
src.connected.occupant.radiation += (((src.radiation_intensity*2)+src.radiation_duration) / connected.damage_coeff)
|
||||
if (prob(80-src.radiation_duration))
|
||||
//testing("Random bad mut!")
|
||||
randmutb(src.connected.occupant)
|
||||
domutcheck(src.connected.occupant,src.connected)
|
||||
@@ -814,7 +831,7 @@
|
||||
return 1
|
||||
|
||||
if (bufferOption == "transfer")
|
||||
if (!src.connected.occupant || (M_NOCLONE in src.connected.occupant.mutations) || !src.connected.occupant.dna)
|
||||
if (!src.connected.occupant || (M_NOCLONE in src.connected.occupant.mutations && connected.scan_level < 3) || !src.connected.occupant.dna)
|
||||
return
|
||||
|
||||
irradiating = 2
|
||||
@@ -838,7 +855,7 @@
|
||||
src.connected.occupant.dna.SE = buf.dna.SE
|
||||
src.connected.occupant.dna.UpdateSE()
|
||||
domutcheck(src.connected.occupant,src.connected)
|
||||
src.connected.occupant.radiation += rand(20,50)
|
||||
src.connected.occupant.radiation += (rand(20,50) / connected.damage_coeff)
|
||||
return 1
|
||||
|
||||
if (bufferOption == "createInjector")
|
||||
|
||||
@@ -221,14 +221,20 @@ Obviously, requires DNA2.
|
||||
|
||||
/obj/effect/proc_holder/spell/wizard/targeted/remotetalk/choose_targets(mob/user = usr)
|
||||
var/list/targets = new /list()
|
||||
targets += input("Choose the target to talk to.", "Targeting") as mob in living_mob_list
|
||||
var/list/validtargets = new /list()
|
||||
for(var/mob/M in view(usr))
|
||||
validtargets += M
|
||||
if(!validtargets.len || validtargets.len == 1)
|
||||
usr << "<span class='warning'>There are no valid targets in range!</span>"
|
||||
start_recharge()
|
||||
return
|
||||
targets += input("Choose the target to talk to.", "Targeting") as mob in validtargets
|
||||
|
||||
perform(targets)
|
||||
|
||||
/obj/effect/proc_holder/spell/wizard/targeted/remotetalk/cast(list/targets)
|
||||
if(!ishuman(usr)) return
|
||||
|
||||
var/say = input ("What do you wish to say")
|
||||
var/say = input("What do you wish to say")
|
||||
|
||||
for(var/mob/living/target in targets)
|
||||
if(M_REMOTE_TALK in target.mutations)
|
||||
@@ -267,8 +273,16 @@ Obviously, requires DNA2.
|
||||
icon_power_button = "genetic_view"
|
||||
|
||||
/obj/effect/proc_holder/spell/wizard/targeted/remoteview/choose_targets(mob/user = usr)
|
||||
var/list/targets = new /list()
|
||||
targets += input("Choose the target to spy on.", "Targeting") as mob in living_mob_list
|
||||
var/list/targets = living_mob_list
|
||||
var/list/remoteviewers = new /list()
|
||||
for(var/mob/M in targets)
|
||||
if(M_REMOTE_VIEW in M.mutations)
|
||||
remoteviewers += M
|
||||
if(!remoteviewers.len || remoteviewers.len == 1)
|
||||
usr << "<span class='warning'>No valid targets with remote view were found!</span>"
|
||||
start_recharge()
|
||||
return
|
||||
targets += input("Choose the target to spy on.", "Targeting") as mob in remoteviewers
|
||||
|
||||
perform(targets)
|
||||
|
||||
|
||||
+131
-50
@@ -1,47 +1,81 @@
|
||||
/obj/machinery/atmospherics/unary/cold_sink/freezer
|
||||
name = "gas cooling system"
|
||||
name = "freezer"
|
||||
icon = 'icons/obj/Cryogenic2.dmi'
|
||||
icon_state = "freezer_0"
|
||||
icon_state = "freezer"
|
||||
density = 1
|
||||
|
||||
var/min_temperature = 0
|
||||
anchored = 1.0
|
||||
|
||||
use_power = 1
|
||||
current_heat_capacity = 1000
|
||||
|
||||
/obj/machinery/atmospherics/unary/cold_sink/freezer/New()
|
||||
..()
|
||||
initialize_directions = dir
|
||||
component_parts = list()
|
||||
component_parts += new /obj/item/weapon/circuitboard/thermomachine(src)
|
||||
component_parts += new /obj/item/weapon/stock_parts/matter_bin(src)
|
||||
component_parts += new /obj/item/weapon/stock_parts/matter_bin(src)
|
||||
component_parts += new /obj/item/weapon/stock_parts/micro_laser(src)
|
||||
component_parts += new /obj/item/weapon/stock_parts/micro_laser(src)
|
||||
component_parts += new /obj/item/weapon/stock_parts/console_screen(src)
|
||||
component_parts += new /obj/item/stack/cable_coil(src, 1)
|
||||
RefreshParts()
|
||||
|
||||
/obj/machinery/atmospherics/unary/cold_sink/freezer/initialize()
|
||||
if(node) return
|
||||
/obj/machinery/atmospherics/unary/cold_sink/freezer/RefreshParts()
|
||||
var/H
|
||||
var/T
|
||||
for(var/obj/item/weapon/stock_parts/matter_bin/M in component_parts)
|
||||
H += M.rating
|
||||
for(var/obj/item/weapon/stock_parts/micro_laser/M in component_parts)
|
||||
T += M.rating
|
||||
min_temperature = T0C - (170 + (T*15))
|
||||
current_heat_capacity = 1000 * ((H - 1) ** 2)
|
||||
|
||||
var/node_connect = dir
|
||||
/obj/machinery/atmospherics/unary/cold_sink/freezer/attackby(obj/item/I, mob/user)
|
||||
if(default_deconstruction_screwdriver(user, "freezer-o", "freezer", I))
|
||||
on = 0
|
||||
update_icon()
|
||||
return
|
||||
|
||||
for(var/obj/machinery/atmospherics/target in get_step(src,node_connect))
|
||||
if(target.initialize_directions & get_dir(target,src))
|
||||
node = target
|
||||
break
|
||||
if(exchange_parts(user, I))
|
||||
return
|
||||
|
||||
update_icon()
|
||||
default_deconstruction_crowbar(I)
|
||||
|
||||
if (istype(I, /obj/item/weapon/wrench))
|
||||
if(!panel_open)
|
||||
user << "<span class='notice'>Open the maintenance panel first.</span>"
|
||||
return
|
||||
playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1)
|
||||
dir = pick(WEST,EAST,SOUTH,NORTH)
|
||||
var/node_connect = dir
|
||||
|
||||
for(var/obj/machinery/atmospherics/target in get_step(src,node_connect))
|
||||
if(target.initialize_directions & get_dir(target,src))
|
||||
node = target
|
||||
break
|
||||
|
||||
update_icon()
|
||||
|
||||
/obj/machinery/atmospherics/unary/cold_sink/freezer/update_icon()
|
||||
if(src.node)
|
||||
if(src.on)
|
||||
icon_state = "freezer_1"
|
||||
else
|
||||
icon_state = "freezer"
|
||||
if(panel_open)
|
||||
icon_state = "freezer-o"
|
||||
else if(src.on)
|
||||
icon_state = "freezer_1"
|
||||
else
|
||||
icon_state = "freezer_0"
|
||||
icon_state = "freezer"
|
||||
return
|
||||
|
||||
/obj/machinery/atmospherics/unary/cold_sink/freezer/attack_ai(mob/user as mob)
|
||||
src.ui_interact(user)
|
||||
src.attack_hand(user)
|
||||
|
||||
/obj/machinery/atmospherics/unary/cold_sink/freezer/attack_paw(mob/user as mob)
|
||||
src.ui_interact(user)
|
||||
src.attack_hand(user)
|
||||
|
||||
/obj/machinery/atmospherics/unary/cold_sink/freezer/attack_hand(mob/user as mob)
|
||||
if(panel_open)
|
||||
user << "<span class='notice'>Close the maintenance panel first.</span>"
|
||||
return
|
||||
src.ui_interact(user)
|
||||
|
||||
/obj/machinery/atmospherics/unary/cold_sink/freezer/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1)
|
||||
@@ -50,7 +84,7 @@
|
||||
data["on"] = on ? 1 : 0
|
||||
data["gasPressure"] = round(air_contents.return_pressure())
|
||||
data["gasTemperature"] = round(air_contents.temperature)
|
||||
data["minGasTemperature"] = round(T0C - 200)
|
||||
data["minGasTemperature"] = round(min_temperature)
|
||||
data["maxGasTemperature"] = round(T20C)
|
||||
data["targetGasTemperature"] = round(current_temperature)
|
||||
|
||||
@@ -74,7 +108,7 @@
|
||||
// auto update every Master Controller tick
|
||||
ui.set_auto_update(1)
|
||||
|
||||
/obj/machinery/atmospherics/unary/cold_sink/freezer/Topic(href, href_list)
|
||||
/obj/machinery/atmospherics/unary/cold_sink/freezer/Topic(href, href_list)
|
||||
if (href_list["toggleStatus"])
|
||||
src.on = !src.on
|
||||
update_icon()
|
||||
@@ -83,20 +117,25 @@
|
||||
if(amount > 0)
|
||||
src.current_temperature = min(T20C, src.current_temperature+amount)
|
||||
else
|
||||
src.current_temperature = max((T0C - 200), src.current_temperature+amount)
|
||||
|
||||
src.current_temperature = max(min_temperature, src.current_temperature+amount)
|
||||
src.add_fingerprint(usr)
|
||||
return 1
|
||||
|
||||
/obj/machinery/atmospherics/unary/cold_sink/freezer/process()
|
||||
..()
|
||||
|
||||
/obj/machinery/atmospherics/unary/heat_reservoir/heater
|
||||
name = "gas heating system"
|
||||
icon = 'icons/obj/Cryogenic2.dmi'
|
||||
icon_state = "freezer_0"
|
||||
density = 1
|
||||
/obj/machinery/atmospherics/unary/cold_sink/freezer/power_change()
|
||||
..()
|
||||
if(stat & NOPOWER)
|
||||
on = 0
|
||||
update_icon()
|
||||
|
||||
/obj/machinery/atmospherics/unary/heat_reservoir/heater/
|
||||
name = "heater"
|
||||
icon = 'icons/obj/Cryogenic2.dmi'
|
||||
icon_state = "heater"
|
||||
density = 1
|
||||
var/max_temperature = 0
|
||||
anchored = 1.0
|
||||
|
||||
current_heat_capacity = 1000
|
||||
@@ -104,39 +143,76 @@
|
||||
/obj/machinery/atmospherics/unary/heat_reservoir/heater/New()
|
||||
..()
|
||||
initialize_directions = dir
|
||||
var/obj/item/weapon/circuitboard/thermomachine/H = new /obj/item/weapon/circuitboard/thermomachine(null)
|
||||
H.build_path = /obj/machinery/atmospherics/unary/heat_reservoir/heater
|
||||
H.name = "circuit board (Heater)"
|
||||
component_parts = list()
|
||||
component_parts += H
|
||||
component_parts += new /obj/item/weapon/stock_parts/matter_bin(src)
|
||||
component_parts += new /obj/item/weapon/stock_parts/matter_bin(src)
|
||||
component_parts += new /obj/item/weapon/stock_parts/micro_laser(src)
|
||||
component_parts += new /obj/item/weapon/stock_parts/micro_laser(src)
|
||||
component_parts += new /obj/item/weapon/stock_parts/console_screen(src)
|
||||
component_parts += new /obj/item/stack/cable_coil(src, 1)
|
||||
RefreshParts()
|
||||
|
||||
/obj/machinery/atmospherics/unary/heat_reservoir/heater/initialize()
|
||||
if(node) return
|
||||
/obj/machinery/atmospherics/unary/heat_reservoir/heater/RefreshParts()
|
||||
var/H
|
||||
var/T
|
||||
for(var/obj/item/weapon/stock_parts/matter_bin/M in component_parts)
|
||||
H += M.rating
|
||||
for(var/obj/item/weapon/stock_parts/micro_laser/M in component_parts)
|
||||
T += M.rating
|
||||
max_temperature = T20C + (140 * T)
|
||||
current_heat_capacity = 1000 * ((H - 1) ** 2)
|
||||
|
||||
var/node_connect = dir
|
||||
/obj/machinery/atmospherics/unary/heat_reservoir/heater/attackby(obj/item/I, mob/user)
|
||||
if(default_deconstruction_screwdriver(user, "heater-o", "heater", I))
|
||||
on = 0
|
||||
update_icon()
|
||||
return
|
||||
|
||||
for(var/obj/machinery/atmospherics/target in get_step(src,node_connect))
|
||||
if(target.initialize_directions & get_dir(target,src))
|
||||
node = target
|
||||
break
|
||||
if(exchange_parts(user, I))
|
||||
return
|
||||
|
||||
update_icon()
|
||||
default_deconstruction_crowbar(I)
|
||||
|
||||
if (istype(I, /obj/item/weapon/wrench))
|
||||
if(!panel_open)
|
||||
user << "<span class='notice'>Open the maintenance panel first.</span>"
|
||||
return
|
||||
playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1)
|
||||
dir = pick(WEST,EAST,SOUTH,NORTH)
|
||||
var/node_connect = dir
|
||||
|
||||
for(var/obj/machinery/atmospherics/target in get_step(src,node_connect))
|
||||
if(target.initialize_directions & get_dir(target,src))
|
||||
node = target
|
||||
break
|
||||
|
||||
update_icon()
|
||||
|
||||
/obj/machinery/atmospherics/unary/heat_reservoir/heater/update_icon()
|
||||
if(src.node)
|
||||
if(src.on)
|
||||
icon_state = "heater_1"
|
||||
else
|
||||
icon_state = "heater"
|
||||
if(panel_open)
|
||||
icon_state = "heater-o"
|
||||
else if(src.on)
|
||||
icon_state = "heater_1"
|
||||
else
|
||||
icon_state = "heater_0"
|
||||
icon_state = "heater"
|
||||
return
|
||||
|
||||
/obj/machinery/atmospherics/unary/heat_reservoir/heater/attack_ai(mob/user as mob)
|
||||
src.ui_interact(user)
|
||||
src.attack_hand(user)
|
||||
|
||||
/obj/machinery/atmospherics/unary/heat_reservoir/heater/attack_paw(mob/user as mob)
|
||||
src.ui_interact(user)
|
||||
src.attack_hand(user)
|
||||
|
||||
/obj/machinery/atmospherics/unary/heat_reservoir/heater/attack_hand(mob/user as mob)
|
||||
if(panel_open)
|
||||
user << "<span class='notice'>Close the maintenance panel first.</span>"
|
||||
return
|
||||
src.ui_interact(user)
|
||||
|
||||
|
||||
/obj/machinery/atmospherics/unary/heat_reservoir/heater/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1)
|
||||
// this is the data which will be sent to the ui
|
||||
var/data[0]
|
||||
@@ -144,7 +220,7 @@
|
||||
data["gasPressure"] = round(air_contents.return_pressure())
|
||||
data["gasTemperature"] = round(air_contents.temperature)
|
||||
data["minGasTemperature"] = round(T20C)
|
||||
data["maxGasTemperature"] = round(T20C+280)
|
||||
data["maxGasTemperature"] = round(T20C+max_temperature)
|
||||
data["targetGasTemperature"] = round(current_temperature)
|
||||
|
||||
var/temp_class = "normal"
|
||||
@@ -172,12 +248,17 @@
|
||||
if(href_list["temp"])
|
||||
var/amount = text2num(href_list["temp"])
|
||||
if(amount > 0)
|
||||
src.current_temperature = min((T20C+280), src.current_temperature+amount)
|
||||
src.current_temperature = min((T20C+max_temperature), src.current_temperature+amount)
|
||||
else
|
||||
src.current_temperature = max(T20C, src.current_temperature+amount)
|
||||
|
||||
src.add_fingerprint(usr)
|
||||
return 1
|
||||
|
||||
/obj/machinery/atmospherics/unary/heat_reservoir/heater/process()
|
||||
..()
|
||||
..()
|
||||
|
||||
/obj/machinery/atmospherics/unary/heat_reservoir/heater/power_change()
|
||||
..()
|
||||
if(stat & NOPOWER)
|
||||
on = 0
|
||||
update_icon()
|
||||
|
||||
+334
-234
@@ -5,20 +5,38 @@
|
||||
/obj/machinery/sleep_console
|
||||
name = "Sleeper Console"
|
||||
icon = 'icons/obj/Cryogenic2.dmi'
|
||||
icon_state = "sleeperconsole"
|
||||
icon_state = "console"
|
||||
var/obj/machinery/sleeper/connected = null
|
||||
anchored = 1 //About time someone fixed this.
|
||||
density = 1
|
||||
var/orient = "LEFT" // "RIGHT" changes the dir suffix to "-r"
|
||||
|
||||
l_color = "#7BF9FF"
|
||||
power_change()
|
||||
..()
|
||||
if(!(stat & (BROKEN|NOPOWER)))
|
||||
SetLuminosity(2)
|
||||
else
|
||||
SetLuminosity(0)
|
||||
var/orient = "LEFT"
|
||||
dir = 8
|
||||
idle_power_usage = 250
|
||||
active_power_usage = 500
|
||||
|
||||
/obj/machinery/sleep_console/power_change()
|
||||
if(stat & BROKEN)
|
||||
icon_state = "console-p"
|
||||
else if(powered() && !panel_open)
|
||||
icon_state = initial(icon_state)
|
||||
stat &= ~NOPOWER
|
||||
else
|
||||
spawn(rand(0, 15))
|
||||
src.icon_state = "console-p"
|
||||
stat |= NOPOWER
|
||||
|
||||
/obj/machinery/sleep_console/New()
|
||||
..()
|
||||
component_parts = list()
|
||||
component_parts += new /obj/item/weapon/circuitboard/sleep_console(src)
|
||||
component_parts += new /obj/item/weapon/stock_parts/console_screen(src)
|
||||
component_parts += new /obj/item/weapon/stock_parts/console_screen(src)
|
||||
component_parts += new /obj/item/stack/cable_coil(src, 2)
|
||||
RefreshParts()
|
||||
findsleeper()
|
||||
|
||||
/obj/machinery/sleep_console/RefreshParts()
|
||||
|
||||
/obj/machinery/sleep_console/process()
|
||||
if(stat & (NOPOWER|BROKEN))
|
||||
return
|
||||
@@ -39,17 +57,38 @@
|
||||
else
|
||||
return
|
||||
|
||||
/obj/machinery/sleep_console/New()
|
||||
..()
|
||||
/obj/machinery/sleep_console/proc/findsleeper()
|
||||
spawn( 5 )
|
||||
if(orient == "RIGHT")
|
||||
icon_state = "sleeperconsole-r"
|
||||
src.connected = locate(/obj/machinery/sleeper, get_step(src, EAST))
|
||||
else
|
||||
src.connected = locate(/obj/machinery/sleeper, get_step(src, WEST))
|
||||
|
||||
var/obj/machinery/sleeper/sleepernew = null
|
||||
// Loop through every direction
|
||||
for(dir in list(NORTH,EAST,SOUTH,WEST))
|
||||
// Try to find a scanner in that direction
|
||||
sleepernew = locate(/obj/machinery/sleeper, get_step(src, dir))
|
||||
src.connected = sleepernew
|
||||
return
|
||||
return
|
||||
|
||||
/obj/machinery/sleep_console/attackby(var/obj/item/weapon/G as obj, var/mob/user as mob)
|
||||
if (istype(G, /obj/item/weapon/screwdriver))
|
||||
default_deconstruction_screwdriver(user, "console-p", "console", G)
|
||||
return
|
||||
|
||||
if (istype(G, /obj/item/weapon/wrench))
|
||||
if(panel_open)
|
||||
user << "<span class='notice'>Close the maintenance panel first.</span>"
|
||||
return
|
||||
if(dir == 4)
|
||||
orient = "LEFT"
|
||||
dir = 8
|
||||
else
|
||||
orient = "RIGHT"
|
||||
dir = 4
|
||||
playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1)
|
||||
|
||||
if(exchange_parts(user, G))
|
||||
return
|
||||
|
||||
default_deconstruction_crowbar(G)
|
||||
|
||||
/obj/machinery/sleep_console/attack_ai(mob/user as mob)
|
||||
return src.attack_hand(user)
|
||||
@@ -60,6 +99,13 @@
|
||||
/obj/machinery/sleep_console/attack_hand(mob/user as mob)
|
||||
if(..())
|
||||
return
|
||||
if(stat & (NOPOWER|BROKEN))
|
||||
return
|
||||
if (panel_open)
|
||||
user << "<span class='notice'>Close the maintenance panel first.</span>"
|
||||
return
|
||||
if (!src.connected)
|
||||
findsleeper()
|
||||
if (src.connected)
|
||||
var/mob/living/occupant = src.connected.occupant
|
||||
var/dat = "<font color='blue'><B>Occupant Statistics:</B></FONT><BR>"
|
||||
@@ -83,8 +129,9 @@
|
||||
dat += text("[]\t-Burn Severity %: []</FONT><BR>", (occupant.getFireLoss() < 60 ? "<font color='blue'>" : "<font color='red'>"), occupant.getFireLoss())
|
||||
dat += text("<HR>Paralysis Summary %: [] ([] seconds left!)<BR>", occupant.paralysis, round(occupant.paralysis / 4))
|
||||
if(occupant.reagents)
|
||||
for(var/chemical in connected.available_chemicals)
|
||||
dat += "[connected.available_chemicals[chemical]]: [occupant.reagents.get_reagent_amount(chemical)] units<br>"
|
||||
for(var/chemical in connected.injection_chems)
|
||||
var/datum/reagent/C = chemical_reagents_list[chemical]
|
||||
dat += "[C.name]: [occupant.reagents.get_reagent_amount(chemical)] units<br>"
|
||||
dat += "<A href='?src=\ref[src];refresh=1'>Refresh Meter Readings</A><BR>"
|
||||
if(src.connected.beaker)
|
||||
dat += "<HR><A href='?src=\ref[src];removebeaker=1'>Remove Beaker</A><BR>"
|
||||
@@ -96,8 +143,9 @@
|
||||
dat += text("Output Beaker has [] units of free space remaining<BR><HR>", src.connected.beaker.reagents.maximum_volume - src.connected.beaker.reagents.total_volume)
|
||||
else
|
||||
dat += "<HR>No Dialysis Output Beaker is present.<BR><HR>"
|
||||
for(var/chemical in connected.available_chemicals)
|
||||
dat += "Inject [connected.available_chemicals[chemical]]: "
|
||||
for(var/chemical in connected.injection_chems)
|
||||
var/datum/reagent/C = chemical_reagents_list[chemical]
|
||||
dat += "Inject [C.name]: "
|
||||
for(var/amount in connected.amounts)
|
||||
dat += "<a href ='?src=\ref[src];chemical=[chemical];amount=[amount]'>[amount] units</a><br> "
|
||||
dat += "<HR><A href='?src=\ref[src];ejectify=1'>Eject Patient</A>"
|
||||
@@ -111,6 +159,9 @@
|
||||
/obj/machinery/sleep_console/Topic(href, href_list)
|
||||
if(..())
|
||||
return
|
||||
if(panel_open)
|
||||
usr << "<span class='notice'>Close the maintenance panel first.</span>"
|
||||
return
|
||||
if ((usr.contents.Find(src) || ((get_dist(src, usr) <= 1) && istype(src.loc, /turf))) || (istype(usr, /mob/living/silicon/ai)))
|
||||
usr.set_machine(src)
|
||||
if (href_list["chemical"])
|
||||
@@ -118,7 +169,7 @@
|
||||
if (src.connected.occupant)
|
||||
if (src.connected.occupant.stat == DEAD)
|
||||
usr << "\red \b This person has no life for to preserve anymore. Take them to a department capable of reanimating them."
|
||||
else if(src.connected.occupant.health > 0 || href_list["chemical"] == "inaprovaline")
|
||||
else if(src.connected.occupant.health > src.connected.min_health || href_list["chemical"] == "inaprovaline")
|
||||
src.connected.inject_chemical(usr,href_list["chemical"],text2num(href_list["amount"]))
|
||||
else
|
||||
usr << "\red \b This person is not in good enough condition for sleepers to be effective! Use another means of treatment, such as cryogenics!"
|
||||
@@ -137,17 +188,6 @@
|
||||
src.add_fingerprint(usr)
|
||||
return
|
||||
|
||||
|
||||
/obj/machinery/sleep_console/power_change()
|
||||
return
|
||||
// no change - sleeper works without power (you just can't inject more)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/////////////////////////////////////////
|
||||
// THE SLEEPER ITSELF
|
||||
/////////////////////////////////////////
|
||||
@@ -155,242 +195,303 @@
|
||||
/obj/machinery/sleeper
|
||||
name = "Sleeper"
|
||||
icon = 'icons/obj/Cryogenic2.dmi'
|
||||
icon_state = "sleeper_0"
|
||||
icon_state = "sleeper-open"
|
||||
density = 1
|
||||
anchored = 1
|
||||
dir = 8
|
||||
var/orient = "LEFT" // "RIGHT" changes the dir suffix to "-r"
|
||||
var/mob/living/carbon/human/occupant = null
|
||||
var/available_chemicals = list("inaprovaline" = "Inaprovaline", "stoxin" = "Soporific", "paracetamol" = "Paracetamol", "anti_toxin" = "Dylovene", "dexalin" = "Dexalin")
|
||||
var/possible_chems = list(list("inaprovaline", "stoxin", "dexalin", "bicaridine", "kelotane"),
|
||||
list("inaprovaline", "stoxin", "dexalinp", "bicaridine", "dermaline", "kelotane", "imidazoline"),
|
||||
list("inaprovaline", "stoxin", "dexalinp", "bicaridine", "dermaline", "kelotane", "imidazoline", "anti_toxin", "ryetalyn", "alkysine", "arithrazine"))
|
||||
var/amounts = list(5, 10)
|
||||
var/obj/item/weapon/reagent_containers/glass/beaker = null
|
||||
var/filtering = 0
|
||||
|
||||
New()
|
||||
var/efficiency
|
||||
var/initial_bin_rating = 1
|
||||
var/min_health = 25
|
||||
var/injection_chems = list()
|
||||
idle_power_usage = 1250
|
||||
active_power_usage = 2500
|
||||
|
||||
l_color = "#7BF9FF"
|
||||
|
||||
power_change()
|
||||
..()
|
||||
beaker = new /obj/item/weapon/reagent_containers/glass/beaker/large()
|
||||
spawn( 5 )
|
||||
if(orient == "RIGHT")
|
||||
icon_state = "sleeper_0-r"
|
||||
return
|
||||
return
|
||||
if(!(stat & (BROKEN|NOPOWER)))
|
||||
SetLuminosity(2)
|
||||
else
|
||||
SetLuminosity(0)
|
||||
|
||||
process()
|
||||
if(filtering > 0)
|
||||
if(beaker)
|
||||
if(beaker.reagents.total_volume < beaker.reagents.maximum_volume)
|
||||
/obj/machinery/sleeper/New()
|
||||
..()
|
||||
component_parts = list()
|
||||
component_parts += new /obj/item/weapon/circuitboard/sleeper(src)
|
||||
|
||||
// Customizable bin rating, used by the labor camp to stop people filling themselves with chemicals and escaping.
|
||||
var/obj/item/weapon/stock_parts/matter_bin/B = new(src)
|
||||
B.rating = initial_bin_rating
|
||||
component_parts += B
|
||||
|
||||
component_parts += new /obj/item/weapon/stock_parts/manipulator(src)
|
||||
component_parts += new /obj/item/weapon/stock_parts/console_screen(src)
|
||||
component_parts += new /obj/item/weapon/stock_parts/console_screen(src)
|
||||
component_parts += new /obj/item/stack/cable_coil(src, 1)
|
||||
RefreshParts()
|
||||
|
||||
/obj/machinery/sleeper/RefreshParts()
|
||||
var/E
|
||||
var/I
|
||||
for(var/obj/item/weapon/stock_parts/matter_bin/B in component_parts)
|
||||
E += B.rating
|
||||
for(var/obj/item/weapon/stock_parts/manipulator/M in component_parts)
|
||||
I += M.rating
|
||||
|
||||
injection_chems = possible_chems[I]
|
||||
efficiency = E
|
||||
min_health = -E * 25
|
||||
|
||||
/obj/machinery/sleeper/process()
|
||||
if(filtering > 0)
|
||||
if(beaker)
|
||||
if(beaker.reagents.total_volume < beaker.reagents.maximum_volume)
|
||||
src.occupant.vessel.trans_to(beaker, 1)
|
||||
for(var/datum/reagent/x in src.occupant.reagents.reagent_list)
|
||||
// world << "FILTERING CHEMS"
|
||||
src.occupant.reagents.trans_to(beaker, 3)
|
||||
src.occupant.vessel.trans_to(beaker, 1)
|
||||
for(var/datum/reagent/x in src.occupant.reagents.reagent_list)
|
||||
// world << "FILTERING CHEMS"
|
||||
src.occupant.reagents.trans_to(beaker, 3)
|
||||
src.occupant.vessel.trans_to(beaker, 1)
|
||||
src.updateDialog()
|
||||
src.updateDialog()
|
||||
return
|
||||
|
||||
|
||||
/obj/machinery/sleeper/blob_act()
|
||||
if(prob(75))
|
||||
for(var/atom/movable/A as mob|obj in src)
|
||||
A.loc = src.loc
|
||||
A.blob_act()
|
||||
del(src)
|
||||
return
|
||||
|
||||
|
||||
/obj/machinery/sleeper/attackby(var/obj/item/weapon/G as obj, var/mob/user as mob)
|
||||
if(istype(G, /obj/item/weapon/reagent_containers/glass))
|
||||
if(!beaker)
|
||||
beaker = G
|
||||
user.drop_item()
|
||||
G.loc = src
|
||||
user.visible_message("[user] adds \a [G] to \the [src]!", "You add \a [G] to \the [src]!")
|
||||
src.updateUsrDialog()
|
||||
return
|
||||
else
|
||||
user << "\red The sleeper has a beaker already."
|
||||
return
|
||||
|
||||
if (istype(G, /obj/item/weapon/screwdriver))
|
||||
if(src.occupant)
|
||||
user << "<span class='notice'>The maintenance panel is locked.</span>"
|
||||
return
|
||||
default_deconstruction_screwdriver(user, "sleeper-o", "sleeper-open", G)
|
||||
return
|
||||
|
||||
if (istype(G, /obj/item/weapon/wrench))
|
||||
if(src.occupant)
|
||||
user << "<span class='notice'>The scanner is occupied.</span>"
|
||||
return
|
||||
if(panel_open)
|
||||
user << "<span class='notice'>Close the maintenance panel first.</span>"
|
||||
return
|
||||
if(dir == 4)
|
||||
orient = "LEFT"
|
||||
dir = 8
|
||||
else
|
||||
orient = "RIGHT"
|
||||
dir = 4
|
||||
playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1)
|
||||
|
||||
if(exchange_parts(user, G))
|
||||
return
|
||||
|
||||
|
||||
blob_act()
|
||||
if(prob(75))
|
||||
for(var/atom/movable/A as mob|obj in src)
|
||||
A.loc = src.loc
|
||||
A.blob_act()
|
||||
del(src)
|
||||
return
|
||||
|
||||
|
||||
attackby(var/obj/item/weapon/G as obj, var/mob/user as mob)
|
||||
if(istype(G, /obj/item/weapon/reagent_containers/glass))
|
||||
if(!beaker)
|
||||
beaker = G
|
||||
user.drop_item()
|
||||
G.loc = src
|
||||
user.visible_message("[user] adds \a [G] to \the [src]!", "You add \a [G] to \the [src]!")
|
||||
src.updateUsrDialog()
|
||||
return
|
||||
else
|
||||
user << "\red The sleeper has a beaker already."
|
||||
default_deconstruction_crowbar(G)
|
||||
|
||||
if(istype(G, /obj/item/weapon/grab))
|
||||
if(panel_open)
|
||||
user << "\blue <b>Close the maintenance panel first.</b>"
|
||||
return
|
||||
if(!ismob(G:affecting))
|
||||
return
|
||||
if(src.occupant)
|
||||
user << "\blue <B>The sleeper is already occupied!</B>"
|
||||
return
|
||||
for(var/mob/living/carbon/slime/M in range(1,G:affecting))
|
||||
if(M.Victim == G:affecting)
|
||||
usr << "[G:affecting.name] will not fit into the sleeper because they have a slime latched onto their head."
|
||||
return
|
||||
|
||||
else if(istype(G, /obj/item/weapon/grab))
|
||||
if(!ismob(G:affecting))
|
||||
return
|
||||
visible_message("[user] starts putting [G:affecting:name] into the sleeper.", 3)
|
||||
|
||||
if(do_after(user, 20))
|
||||
if(src.occupant)
|
||||
user << "\blue <B>The sleeper is already occupied!</B>"
|
||||
return
|
||||
for(var/mob/living/carbon/slime/M in range(1,G:affecting))
|
||||
if(M.Victim == G:affecting)
|
||||
usr << "[G:affecting.name] will not fit into the sleeper because they have a slime latched onto their head."
|
||||
return
|
||||
if(!G || !G:affecting) return
|
||||
var/mob/M = G:affecting
|
||||
if(M.client)
|
||||
M.client.perspective = EYE_PERSPECTIVE
|
||||
M.client.eye = src
|
||||
M.loc = src
|
||||
src.occupant = M
|
||||
src.icon_state = "sleeper"
|
||||
M << "\blue <b>You feel cool air surround you. You go numb as your senses turn inward.</b>"
|
||||
|
||||
visible_message("[user] starts putting [G:affecting:name] into the sleeper.", 3)
|
||||
|
||||
if(do_after(user, 20))
|
||||
if(src.occupant)
|
||||
user << "\blue <B>The sleeper is already occupied!</B>"
|
||||
return
|
||||
if(!G || !G:affecting) return
|
||||
var/mob/M = G:affecting
|
||||
if(M.client)
|
||||
M.client.perspective = EYE_PERSPECTIVE
|
||||
M.client.eye = src
|
||||
M.loc = src
|
||||
src.occupant = M
|
||||
src.icon_state = "sleeper_1"
|
||||
if(orient == "RIGHT")
|
||||
icon_state = "sleeper_1-r"
|
||||
|
||||
M << "\blue <b>You feel cool air surround you. You go numb as your senses turn inward.</b>"
|
||||
|
||||
src.add_fingerprint(user)
|
||||
del(G)
|
||||
return
|
||||
src.add_fingerprint(user)
|
||||
del(G)
|
||||
return
|
||||
return
|
||||
|
||||
|
||||
ex_act(severity)
|
||||
if(filtering)
|
||||
toggle_filter()
|
||||
switch(severity)
|
||||
if(1.0)
|
||||
/obj/machinery/sleeper/ex_act(severity)
|
||||
if(filtering)
|
||||
toggle_filter()
|
||||
switch(severity)
|
||||
if(1.0)
|
||||
for(var/atom/movable/A as mob|obj in src)
|
||||
A.loc = src.loc
|
||||
ex_act(severity)
|
||||
qdel(src)
|
||||
return
|
||||
if(2.0)
|
||||
if(prob(50))
|
||||
for(var/atom/movable/A as mob|obj in src)
|
||||
A.loc = src.loc
|
||||
ex_act(severity)
|
||||
qdel(src)
|
||||
return
|
||||
if(2.0)
|
||||
if(prob(50))
|
||||
for(var/atom/movable/A as mob|obj in src)
|
||||
A.loc = src.loc
|
||||
ex_act(severity)
|
||||
qdel(src)
|
||||
return
|
||||
if(3.0)
|
||||
if(prob(25))
|
||||
for(var/atom/movable/A as mob|obj in src)
|
||||
A.loc = src.loc
|
||||
ex_act(severity)
|
||||
qdel(src)
|
||||
return
|
||||
return
|
||||
emp_act(severity)
|
||||
if(filtering)
|
||||
toggle_filter()
|
||||
if(stat & (BROKEN|NOPOWER))
|
||||
..(severity)
|
||||
return
|
||||
if(occupant)
|
||||
go_out()
|
||||
if(3.0)
|
||||
if(prob(25))
|
||||
for(var/atom/movable/A as mob|obj in src)
|
||||
A.loc = src.loc
|
||||
ex_act(severity)
|
||||
qdel(src)
|
||||
return
|
||||
return
|
||||
|
||||
/obj/machinery/sleeper/emp_act(severity)
|
||||
if(filtering)
|
||||
toggle_filter()
|
||||
if(stat & (BROKEN|NOPOWER))
|
||||
..(severity)
|
||||
|
||||
alter_health(mob/living/M as mob)
|
||||
if (M.health > 0)
|
||||
if (M.getOxyLoss() >= 10)
|
||||
var/amount = max(0.15, 1)
|
||||
M.adjustOxyLoss(-amount)
|
||||
else
|
||||
M.adjustOxyLoss(-12)
|
||||
M.updatehealth()
|
||||
M.AdjustParalysis(-4)
|
||||
M.AdjustWeakened(-4)
|
||||
M.AdjustStunned(-4)
|
||||
M.Paralyse(1)
|
||||
M.Weaken(1)
|
||||
M.Stun(1)
|
||||
if (M:reagents.get_reagent_amount("inaprovaline") < 5)
|
||||
M:reagents.add_reagent("inaprovaline", 5)
|
||||
return
|
||||
if(occupant)
|
||||
go_out()
|
||||
..(severity)
|
||||
|
||||
proc/toggle_filter()
|
||||
if(filtering)
|
||||
filtering = 0
|
||||
/obj/machinery/sleeper/alter_health(mob/living/M as mob)
|
||||
if (M.health > 0)
|
||||
if (M.getOxyLoss() >= 10)
|
||||
var/amount = max(0.15, 1)
|
||||
M.adjustOxyLoss(-amount)
|
||||
else
|
||||
filtering = 1
|
||||
M.adjustOxyLoss(-12)
|
||||
M.updatehealth()
|
||||
M.AdjustParalysis(-4)
|
||||
M.AdjustWeakened(-4)
|
||||
M.AdjustStunned(-4)
|
||||
M.Paralyse(1)
|
||||
M.Weaken(1)
|
||||
M.Stun(1)
|
||||
if (M:reagents.get_reagent_amount("inaprovaline") < 5)
|
||||
M:reagents.add_reagent("inaprovaline", 5)
|
||||
return
|
||||
|
||||
proc/go_out()
|
||||
if(filtering)
|
||||
toggle_filter()
|
||||
if(!src.occupant)
|
||||
return
|
||||
if(src.occupant.client)
|
||||
src.occupant.client.eye = src.occupant.client.mob
|
||||
src.occupant.client.perspective = MOB_PERSPECTIVE
|
||||
src.occupant.loc = src.loc
|
||||
src.occupant = null
|
||||
if(orient == "RIGHT")
|
||||
icon_state = "sleeper_0-r"
|
||||
/obj/machinery/sleeper/proc/toggle_filter()
|
||||
if(filtering)
|
||||
filtering = 0
|
||||
else
|
||||
filtering = 1
|
||||
|
||||
/obj/machinery/sleeper/proc/go_out()
|
||||
if(filtering)
|
||||
toggle_filter()
|
||||
if(!src.occupant)
|
||||
return
|
||||
if(src.occupant.client)
|
||||
src.occupant.client.eye = src.occupant.client.mob
|
||||
src.occupant.client.perspective = MOB_PERSPECTIVE
|
||||
src.occupant.loc = src.loc
|
||||
src.occupant = null
|
||||
icon_state = "sleeper-open"
|
||||
return
|
||||
|
||||
|
||||
proc/inject_chemical(mob/living/user as mob, chemical, amount)
|
||||
if(src.occupant)
|
||||
if(src.occupant.reagents)
|
||||
if(src.occupant.reagents.get_reagent_amount(chemical) + amount <= 40)
|
||||
src.occupant.reagents.add_reagent(chemical, amount)
|
||||
user << "Occupant now has [src.occupant.reagents.get_reagent_amount(chemical)] units of [available_chemicals[chemical]] in his/her bloodstream."
|
||||
return
|
||||
else
|
||||
user << "Medical overdose safeties restrict you injecting any more of this chemical."
|
||||
return
|
||||
/obj/machinery/sleeper/proc/inject_chemical(mob/living/user as mob, chemical, amount)
|
||||
if(src.occupant)
|
||||
if(src.occupant.reagents)
|
||||
if(src.occupant.reagents.get_reagent_amount(chemical) + amount <= 20 * efficiency)
|
||||
src.occupant.reagents.add_reagent(chemical, amount)
|
||||
user << "Occupant now has [src.occupant.reagents.get_reagent_amount(chemical)] units of [chemical] in his/her bloodstream."
|
||||
return
|
||||
else
|
||||
user << "The patient rejects the chemicals!"
|
||||
user << "You can not inject any more of this chemical."
|
||||
return
|
||||
else
|
||||
user << "There's no occupant in the sleeper!"
|
||||
user << "The patient rejects the chemicals!"
|
||||
return
|
||||
else
|
||||
user << "There's no occupant in the sleeper!"
|
||||
return
|
||||
|
||||
|
||||
proc/check(mob/living/user as mob)
|
||||
if(src.occupant)
|
||||
user << text("\blue <B>Occupant ([]) Statistics:</B>", src.occupant)
|
||||
var/t1
|
||||
switch(src.occupant.stat)
|
||||
if(0.0)
|
||||
t1 = "Conscious"
|
||||
if(1.0)
|
||||
t1 = "Unconscious"
|
||||
if(2.0)
|
||||
t1 = "*dead*"
|
||||
else
|
||||
user << text("[]\t Health %: [] ([])", (src.occupant.health > 50 ? "\blue " : "\red "), src.occupant.health, t1)
|
||||
user << text("[]\t -Core Temperature: []°C ([]°F)</FONT><BR>", (src.occupant.bodytemperature > 50 ? "<font color='blue'>" : "<font color='red'>"), src.occupant.bodytemperature-T0C, src.occupant.bodytemperature*1.8-459.67)
|
||||
user << text("[]\t -Brute Damage %: []", (src.occupant.getBruteLoss() < 60 ? "\blue " : "\red "), src.occupant.getBruteLoss())
|
||||
user << text("[]\t -Respiratory Damage %: []", (src.occupant.getOxyLoss() < 60 ? "\blue " : "\red "), src.occupant.getOxyLoss())
|
||||
user << text("[]\t -Toxin Content %: []", (src.occupant.getToxLoss() < 60 ? "\blue " : "\red "), src.occupant.getToxLoss())
|
||||
user << text("[]\t -Burn Severity %: []", (src.occupant.getFireLoss() < 60 ? "\blue " : "\red "), src.occupant.getFireLoss())
|
||||
user << "\blue Expected time till occupant can safely awake: (note: If health is below 20% these times are inaccurate)"
|
||||
user << text("\blue \t [] second\s (if around 1 or 2 the sleeper is keeping them asleep.)", src.occupant.paralysis / 5)
|
||||
if(src.beaker)
|
||||
user << text("\blue \t Dialysis Output Beaker has [] of free space remaining.", src.beaker.reagents.maximum_volume - src.beaker.reagents.total_volume)
|
||||
/obj/machinery/sleeper/proc/check(mob/living/user as mob)
|
||||
if(src.occupant)
|
||||
user << text("\blue <B>Occupant ([]) Statistics:</B>", src.occupant)
|
||||
var/t1
|
||||
switch(src.occupant.stat)
|
||||
if(0.0)
|
||||
t1 = "Conscious"
|
||||
if(1.0)
|
||||
t1 = "Unconscious"
|
||||
if(2.0)
|
||||
t1 = "*dead*"
|
||||
else
|
||||
user << "\blue No Dialysis Output Beaker loaded."
|
||||
user << text("[]\t Health %: [] ([])", (src.occupant.health > 50 ? "\blue " : "\red "), src.occupant.health, t1)
|
||||
user << text("[]\t -Core Temperature: []°C ([]°F)</FONT><BR>", (src.occupant.bodytemperature > 50 ? "<font color='blue'>" : "<font color='red'>"), src.occupant.bodytemperature-T0C, src.occupant.bodytemperature*1.8-459.67)
|
||||
user << text("[]\t -Brute Damage %: []", (src.occupant.getBruteLoss() < 60 ? "\blue " : "\red "), src.occupant.getBruteLoss())
|
||||
user << text("[]\t -Respiratory Damage %: []", (src.occupant.getOxyLoss() < 60 ? "\blue " : "\red "), src.occupant.getOxyLoss())
|
||||
user << text("[]\t -Toxin Content %: []", (src.occupant.getToxLoss() < 60 ? "\blue " : "\red "), src.occupant.getToxLoss())
|
||||
user << text("[]\t -Burn Severity %: []", (src.occupant.getFireLoss() < 60 ? "\blue " : "\red "), src.occupant.getFireLoss())
|
||||
user << "\blue Expected time till occupant can safely awake: (note: If health is below 20% these times are inaccurate)"
|
||||
user << text("\blue \t [] second\s (if around 1 or 2 the sleeper is keeping them asleep.)", src.occupant.paralysis / 5)
|
||||
if(src.beaker)
|
||||
user << text("\blue \t Dialysis Output Beaker has [] of free space remaining.", src.beaker.reagents.maximum_volume - src.beaker.reagents.total_volume)
|
||||
else
|
||||
user << "\blue There is no one inside!"
|
||||
return
|
||||
user << "\blue No Dialysis Output Beaker loaded."
|
||||
else
|
||||
user << "\blue There is no one inside!"
|
||||
return
|
||||
|
||||
|
||||
verb/eject()
|
||||
set name = "Eject Sleeper"
|
||||
set category = null
|
||||
set src in oview(1)
|
||||
if(usr.stat != 0)
|
||||
return
|
||||
if(orient == "RIGHT")
|
||||
icon_state = "sleeper_0-r"
|
||||
src.icon_state = "sleeper_0"
|
||||
src.go_out()
|
||||
add_fingerprint(usr)
|
||||
/obj/machinery/sleeper/verb/eject()
|
||||
set name = "Eject Sleeper"
|
||||
set category = null
|
||||
set src in oview(1)
|
||||
if(usr.stat != 0)
|
||||
return
|
||||
src.icon_state = "sleeper-open"
|
||||
src.go_out()
|
||||
add_fingerprint(usr)
|
||||
return
|
||||
|
||||
verb/remove_beaker()
|
||||
set name = "Remove Beaker"
|
||||
set category = null
|
||||
set src in oview(1)
|
||||
if(usr.stat != 0)
|
||||
return
|
||||
if(beaker)
|
||||
filtering = 0
|
||||
beaker.loc = usr.loc
|
||||
beaker = null
|
||||
add_fingerprint(usr)
|
||||
/obj/machinery/sleeper/verb/remove_beaker()
|
||||
set name = "Remove Beaker"
|
||||
set category = null
|
||||
set src in oview(1)
|
||||
if(usr.stat != 0)
|
||||
return
|
||||
if(beaker)
|
||||
filtering = 0
|
||||
beaker.loc = usr.loc
|
||||
beaker = null
|
||||
add_fingerprint(usr)
|
||||
return
|
||||
|
||||
/obj/machinery/sleeper/MouseDrop_T(atom/movable/O as mob|obj, mob/user as mob)
|
||||
if(O.loc == user) //no you can't pull things out of your ass
|
||||
@@ -401,7 +502,7 @@
|
||||
return
|
||||
if(!ismob(O)) //humans only
|
||||
return
|
||||
if(istype(O, /mob/living/simple_animal) || istype(O, /mob/living/silicon)) //animals and robutts dont fit
|
||||
if(istype(O, /mob/living/simple_animal) || istype(O, /mob/living/silicon)) //animals and robots dont fit
|
||||
return
|
||||
if(!ishuman(user) && !isrobot(user)) //No ghosts or mice putting people into the sleeper
|
||||
return
|
||||
@@ -409,6 +510,9 @@
|
||||
return
|
||||
if(!istype(user.loc, /turf) || !istype(O.loc, /turf)) // are you in a container/closet/pod/etc?
|
||||
return
|
||||
if(panel_open)
|
||||
user << "\blue <B>Close the maintenance panel first.</B>"
|
||||
return
|
||||
if(occupant)
|
||||
user << "\blue <B>The sleeper is already occupied!</B>"
|
||||
return
|
||||
@@ -442,12 +546,8 @@
|
||||
L.client.eye = src
|
||||
L.loc = src
|
||||
src.occupant = L
|
||||
src.icon_state = "sleeper_1"
|
||||
if(orient == "RIGHT")
|
||||
icon_state = "sleeper_1-r"
|
||||
src.icon_state = "sleeper"
|
||||
L << "\blue <b>You feel cool air surround you. You go numb as your senses turn inward.</b>"
|
||||
for(var/obj/OO in src)
|
||||
OO.loc = src.loc
|
||||
src.add_fingerprint(user)
|
||||
if(user.pulling == L)
|
||||
user.pulling = null
|
||||
@@ -463,10 +563,12 @@
|
||||
set src in oview(1)
|
||||
if(usr.stat != 0 || !(ishuman(usr) || ismonkey(usr)))
|
||||
return
|
||||
|
||||
if(src.occupant)
|
||||
usr << "\blue <B>The sleeper is already occupied!</B>"
|
||||
return
|
||||
if (panel_open)
|
||||
usr << "\blue <B>Close the maintenance panel first.</B>"
|
||||
return
|
||||
if(usr.restrained() || usr.stat || usr.weakened || usr.stunned || usr.paralysis || usr.resting) //are you cuffed, dying, lying, stunned or other
|
||||
return
|
||||
for(var/mob/living/carbon/slime/M in range(1,usr))
|
||||
@@ -483,9 +585,7 @@
|
||||
usr.client.eye = src
|
||||
usr.loc = src
|
||||
src.occupant = usr
|
||||
src.icon_state = "sleeper_1"
|
||||
if(orient == "RIGHT")
|
||||
icon_state = "sleeper_1-r"
|
||||
src.icon_state = "sleeper"
|
||||
|
||||
for(var/obj/O in src)
|
||||
del(O)
|
||||
|
||||
+305
-218
@@ -1,18 +1,17 @@
|
||||
// Pretty much everything here is stolen from the dna scanner FYI
|
||||
|
||||
|
||||
/obj/machinery/bodyscanner
|
||||
var/mob/living/carbon/occupant
|
||||
var/locked
|
||||
name = "Body Scanner"
|
||||
icon = 'icons/obj/Cryogenic2.dmi'
|
||||
icon_state = "body_scanner_0"
|
||||
icon_state = "bodyscanner-open"
|
||||
density = 1
|
||||
dir = 8
|
||||
anchored = 1
|
||||
idle_power_usage = 1250
|
||||
active_power_usage = 2500
|
||||
|
||||
l_color = "#00FF00"
|
||||
|
||||
power_change()
|
||||
..()
|
||||
if(!(stat & (BROKEN|NOPOWER)))
|
||||
@@ -20,6 +19,72 @@
|
||||
else
|
||||
SetLuminosity(0)
|
||||
|
||||
/obj/machinery/bodyscanner/New()
|
||||
..()
|
||||
component_parts = list()
|
||||
component_parts += new /obj/item/weapon/circuitboard/bodyscanner(src)
|
||||
component_parts += new /obj/item/weapon/stock_parts/scanning_module(src)
|
||||
component_parts += new /obj/item/weapon/stock_parts/console_screen(src)
|
||||
component_parts += new /obj/item/weapon/stock_parts/console_screen(src)
|
||||
component_parts += new /obj/item/stack/cable_coil(src, 2)
|
||||
RefreshParts()
|
||||
|
||||
/obj/machinery/bodyscanner/RefreshParts()
|
||||
|
||||
/obj/machinery/bodyscanner/attackby(var/obj/item/weapon/G as obj, var/mob/user as mob)
|
||||
if (istype(G, /obj/item/weapon/screwdriver))
|
||||
if(src.occupant)
|
||||
user << "<span class='notice'>The maintenance panel is locked.</span>"
|
||||
return
|
||||
default_deconstruction_screwdriver(user, "bodyscanner-o", "bodyscanner-open", G)
|
||||
return
|
||||
|
||||
if (istype(G, /obj/item/weapon/wrench))
|
||||
if(src.occupant)
|
||||
user << "<span class='notice'>The scanner is occupied.</span>"
|
||||
return
|
||||
if(panel_open)
|
||||
user << "<span class='notice'>Close the maintenance panel first.</span>"
|
||||
return
|
||||
if(dir == 4)
|
||||
dir = 8
|
||||
else
|
||||
dir = 4
|
||||
playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1)
|
||||
|
||||
if(exchange_parts(user, G))
|
||||
return
|
||||
|
||||
default_deconstruction_crowbar(G)
|
||||
|
||||
if(istype(G, /obj/item/weapon/grab))
|
||||
if(panel_open)
|
||||
user << "\blue <b>Close the maintenance panel first.</b>"
|
||||
return
|
||||
if(!ismob(G:affecting))
|
||||
return
|
||||
if (src.occupant)
|
||||
user << "\blue <B>The scanner is already occupied!</B>"
|
||||
return
|
||||
for(var/mob/living/carbon/slime/M in range(1,G:affecting))
|
||||
if(M.Victim == G:affecting)
|
||||
usr << "[G:affecting.name] will not fit into the sleeper because they have a slime latched onto their head."
|
||||
return
|
||||
var/mob/M = G:affecting
|
||||
if (M.abiotic())
|
||||
user << "\blue <B>Subject cannot have abiotic items on.</B>"
|
||||
return
|
||||
if (M.client)
|
||||
M.client.perspective = EYE_PERSPECTIVE
|
||||
M.client.eye = src
|
||||
M.loc = src
|
||||
src.occupant = M
|
||||
src.icon_state = "body_scanner_1"
|
||||
src.add_fingerprint(user)
|
||||
//G = null
|
||||
del(G)
|
||||
return
|
||||
|
||||
/obj/machinery/bodyscanner/MouseDrop_T(atom/movable/O as mob|obj, mob/user as mob)
|
||||
if(O.loc == user) //no you can't pull things out of your ass
|
||||
return
|
||||
@@ -37,6 +102,9 @@
|
||||
return
|
||||
if(!istype(user.loc, /turf) || !istype(O.loc, /turf)) // are you in a container/closet/pod/etc?
|
||||
return
|
||||
if(panel_open)
|
||||
user << "\blue <B>Close the maintenance panel first.</B>"
|
||||
return
|
||||
if(occupant)
|
||||
user << "\blue <B>The body scanner is already occupied!</B>"
|
||||
return
|
||||
@@ -60,10 +128,7 @@
|
||||
L.client.eye = src
|
||||
L.loc = src
|
||||
src.occupant = L
|
||||
src.icon_state = "body_scanner_1"
|
||||
for(var/obj/OO in src)
|
||||
OO.loc = src.loc
|
||||
//Foreach goto(154)
|
||||
src.icon_state = "bodyscanner"
|
||||
src.add_fingerprint(user)
|
||||
return
|
||||
|
||||
@@ -97,6 +162,9 @@
|
||||
if (src.occupant)
|
||||
usr << "\blue <B>The scanner is already occupied!</B>"
|
||||
return
|
||||
if (panel_open)
|
||||
usr << "\blue <B>Close the maintenance panel first.</B>"
|
||||
return
|
||||
if (usr.abiotic())
|
||||
usr << "\blue <B>Subject cannot have abiotic items on.</B>"
|
||||
return
|
||||
@@ -105,7 +173,7 @@
|
||||
usr.client.eye = src
|
||||
usr.loc = src
|
||||
src.occupant = usr
|
||||
src.icon_state = "body_scanner_1"
|
||||
src.icon_state = "bodyscanner"
|
||||
for(var/obj/O in src)
|
||||
//O = null
|
||||
del(O)
|
||||
@@ -116,9 +184,6 @@
|
||||
/obj/machinery/bodyscanner/proc/go_out()
|
||||
if ((!( src.occupant ) || src.locked))
|
||||
return
|
||||
for(var/obj/O in src)
|
||||
O.loc = src.loc
|
||||
//Foreach goto(30)
|
||||
if (src.occupant.client)
|
||||
src.occupant.client.eye = src.occupant.client.mob
|
||||
src.occupant.client.perspective = MOB_PERSPECTIVE
|
||||
@@ -127,30 +192,6 @@
|
||||
src.icon_state = "body_scanner_0"
|
||||
return
|
||||
|
||||
/obj/machinery/bodyscanner/attackby(obj/item/weapon/grab/G as obj, user as mob)
|
||||
if ((!( istype(G, /obj/item/weapon/grab) ) || !( ismob(G.affecting) )))
|
||||
return
|
||||
if (src.occupant)
|
||||
user << "\blue <B>The scanner is already occupied!</B>"
|
||||
return
|
||||
if (G.affecting.abiotic())
|
||||
user << "\blue <B>Subject cannot have abiotic items on.</B>"
|
||||
return
|
||||
var/mob/M = G.affecting
|
||||
if (M.client)
|
||||
M.client.perspective = EYE_PERSPECTIVE
|
||||
M.client.eye = src
|
||||
M.loc = src
|
||||
src.occupant = M
|
||||
src.icon_state = "body_scanner_1"
|
||||
for(var/obj/O in src)
|
||||
O.loc = src.loc
|
||||
//Foreach goto(154)
|
||||
src.add_fingerprint(user)
|
||||
//G = null
|
||||
del(G)
|
||||
return
|
||||
|
||||
/obj/machinery/bodyscanner/ex_act(severity)
|
||||
switch(severity)
|
||||
if(1.0)
|
||||
@@ -188,8 +229,44 @@
|
||||
A.loc = src.loc
|
||||
del(src)
|
||||
|
||||
/obj/machinery/body_scanconsole/ex_act(severity)
|
||||
/obj/machinery/body_scanconsole
|
||||
var/obj/machinery/bodyscanner/connected
|
||||
var/known_implants = list(/obj/item/weapon/implant/chem, /obj/item/weapon/implant/death_alarm, /obj/item/weapon/implant/loyalty, /obj/item/weapon/implant/tracking)
|
||||
var/delete
|
||||
var/temphtml
|
||||
name = "Body Scanner Console"
|
||||
icon = 'icons/obj/Cryogenic2.dmi'
|
||||
icon_state = "bodyscannerconsole"
|
||||
density = 1
|
||||
anchored = 1
|
||||
dir = 8
|
||||
idle_power_usage = 250
|
||||
active_power_usage = 500
|
||||
|
||||
/obj/machinery/body_scanconsole/power_change()
|
||||
if(stat & BROKEN)
|
||||
icon_state = "bodyscannerconsole-p"
|
||||
else if(powered() && !panel_open)
|
||||
icon_state = initial(icon_state)
|
||||
stat &= ~NOPOWER
|
||||
else
|
||||
spawn(rand(0, 15))
|
||||
src.icon_state = "bodyscannerconsole-p"
|
||||
stat |= NOPOWER
|
||||
|
||||
/obj/machinery/body_scanconsole/New()
|
||||
..()
|
||||
component_parts = list()
|
||||
component_parts += new /obj/item/weapon/circuitboard/bodyscanner_console(src)
|
||||
component_parts += new /obj/item/weapon/stock_parts/console_screen(src)
|
||||
component_parts += new /obj/item/weapon/stock_parts/console_screen(src)
|
||||
component_parts += new /obj/item/stack/cable_coil(src, 2)
|
||||
RefreshParts()
|
||||
findscanner()
|
||||
|
||||
/obj/machinery/body_scanconsole/RefreshParts()
|
||||
|
||||
/obj/machinery/body_scanconsole/ex_act(severity)
|
||||
switch(severity)
|
||||
if(1.0)
|
||||
//SN src = null
|
||||
@@ -204,40 +281,20 @@
|
||||
return
|
||||
|
||||
/obj/machinery/body_scanconsole/blob_act()
|
||||
|
||||
if(prob(50))
|
||||
del(src)
|
||||
|
||||
/obj/machinery/body_scanconsole/power_change()
|
||||
if(stat & BROKEN)
|
||||
icon_state = "body_scannerconsole-p"
|
||||
else if(powered())
|
||||
icon_state = initial(icon_state)
|
||||
stat &= ~NOPOWER
|
||||
else
|
||||
spawn(rand(0, 15))
|
||||
src.icon_state = "body_scannerconsole-p"
|
||||
stat |= NOPOWER
|
||||
|
||||
/obj/machinery/body_scanconsole
|
||||
var/obj/machinery/bodyscanner/connected
|
||||
var/known_implants = list(/obj/item/weapon/implant/chem, /obj/item/weapon/implant/death_alarm, /obj/item/weapon/implant/loyalty, /obj/item/weapon/implant/tracking)
|
||||
var/delete
|
||||
var/temphtml
|
||||
name = "Body Scanner Console"
|
||||
icon = 'icons/obj/Cryogenic2.dmi'
|
||||
icon_state = "body_scannerconsole"
|
||||
density = 1
|
||||
anchored = 1
|
||||
|
||||
|
||||
/obj/machinery/body_scanconsole/New()
|
||||
..()
|
||||
/obj/machinery/body_scanconsole/proc/findscanner()
|
||||
spawn( 5 )
|
||||
src.connected = locate(/obj/machinery/bodyscanner, get_step(src, WEST))
|
||||
var/obj/machinery/bodyscanner/bodyscannernew = null
|
||||
// Loop through every direction
|
||||
for(dir in list(NORTH,EAST,SOUTH,WEST))
|
||||
// Try to find a scanner in that direction
|
||||
bodyscannernew = locate(/obj/machinery/bodyscanner, get_step(src, dir))
|
||||
src.connected = bodyscannernew
|
||||
return
|
||||
return
|
||||
|
||||
return
|
||||
|
||||
/*
|
||||
|
||||
/obj/machinery/body_scanconsole/process() //not really used right now
|
||||
@@ -261,6 +318,25 @@
|
||||
|
||||
*/
|
||||
|
||||
/obj/machinery/body_scanconsole/attackby(var/obj/item/weapon/G as obj, var/mob/user as mob)
|
||||
if (istype(G, /obj/item/weapon/screwdriver))
|
||||
default_deconstruction_screwdriver(user, "bodyscannerconsole-p", "bodyscannerconsole", G)
|
||||
return
|
||||
|
||||
if (istype(G, /obj/item/weapon/wrench))
|
||||
if(panel_open)
|
||||
user << "<span class='notice'>Close the maintenance panel first.</span>"
|
||||
return
|
||||
if(dir == 4)
|
||||
dir = 8
|
||||
else
|
||||
dir = 4
|
||||
playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1)
|
||||
|
||||
if(exchange_parts(user, G))
|
||||
return
|
||||
|
||||
default_deconstruction_crowbar(G)
|
||||
|
||||
/obj/machinery/body_scanconsole/attack_paw(user as mob)
|
||||
return src.attack_hand(user)
|
||||
@@ -271,158 +347,169 @@
|
||||
/obj/machinery/body_scanconsole/attack_hand(user as mob)
|
||||
if(..())
|
||||
return
|
||||
if(!ishuman(connected.occupant))
|
||||
user << "\red This device can only scan compatible lifeforms."
|
||||
if(stat & (NOPOWER|BROKEN))
|
||||
return
|
||||
var/dat
|
||||
if (src.delete && src.temphtml) //Window in buffer but its just simple message, so nothing
|
||||
src.delete = src.delete
|
||||
else if (!src.delete && src.temphtml) //Window in buffer - its a menu, dont add clear message
|
||||
dat = text("[]<BR><BR><A href='?src=\ref[];clear=1'>Main Menu</A>", src.temphtml, src)
|
||||
else
|
||||
if (src.connected) //Is something connected?
|
||||
var/mob/living/carbon/human/occupant = src.connected.occupant
|
||||
dat = "<font color='blue'><B>Occupant Statistics:</B></FONT><BR>" //Blah obvious
|
||||
if (istype(occupant)) //is there REALLY someone in there?
|
||||
var/t1
|
||||
switch(occupant.stat) // obvious, see what their status is
|
||||
if(0)
|
||||
t1 = "Conscious"
|
||||
if(1)
|
||||
t1 = "Unconscious"
|
||||
else
|
||||
t1 = "*dead*"
|
||||
if (!istype(occupant,/mob/living/carbon/human))
|
||||
dat += "<font color='red'>This device can only scan human occupants.</FONT>"
|
||||
else
|
||||
dat += text("[]\tHealth %: [] ([])</FONT><BR>", (occupant.health > 50 ? "<font color='blue'>" : "<font color='red'>"), occupant.health, t1)
|
||||
|
||||
if(occupant.virus2.len)
|
||||
dat += text("<font color='red'>Viral pathogen detected in blood stream.</font><BR>")
|
||||
|
||||
dat += text("[]\t-Brute Damage %: []</FONT><BR>", (occupant.getBruteLoss() < 60 ? "<font color='blue'>" : "<font color='red'>"), occupant.getBruteLoss())
|
||||
dat += text("[]\t-Respiratory Damage %: []</FONT><BR>", (occupant.getOxyLoss() < 60 ? "<font color='blue'>" : "<font color='red'>"), occupant.getOxyLoss())
|
||||
dat += text("[]\t-Toxin Content %: []</FONT><BR>", (occupant.getToxLoss() < 60 ? "<font color='blue'>" : "<font color='red'>"), occupant.getToxLoss())
|
||||
dat += text("[]\t-Burn Severity %: []</FONT><BR><BR>", (occupant.getFireLoss() < 60 ? "<font color='blue'>" : "<font color='red'>"), occupant.getFireLoss())
|
||||
|
||||
dat += text("[]\tRadiation Level %: []</FONT><BR>", (occupant.radiation < 10 ?"<font color='blue'>" : "<font color='red'>"), occupant.radiation)
|
||||
dat += text("[]\tGenetic Tissue Damage %: []</FONT><BR>", (occupant.getCloneLoss() < 1 ?"<font color='blue'>" : "<font color='red'>"), occupant.getCloneLoss())
|
||||
dat += text("[]\tApprox. Brain Damage %: []</FONT><BR>", (occupant.getBrainLoss() < 1 ?"<font color='blue'>" : "<font color='red'>"), occupant.getBrainLoss())
|
||||
dat += text("Paralysis Summary %: [] ([] seconds left!)<BR>", occupant.paralysis, round(occupant.paralysis / 4))
|
||||
dat += text("Body Temperature: [occupant.bodytemperature-T0C]°C ([occupant.bodytemperature*1.8-459.67]°F)<BR><HR>")
|
||||
|
||||
if(occupant.has_brain_worms())
|
||||
dat += "Large growth detected in frontal lobe, possibly cancerous. Surgical removal is recommended.<BR/>"
|
||||
|
||||
if(occupant.vessel)
|
||||
var/blood_volume = round(occupant.vessel.get_reagent_amount("blood"))
|
||||
var/blood_percent = blood_volume / 560
|
||||
blood_percent *= 100
|
||||
dat += text("[]\tBlood Level %: [] ([] units)</FONT><BR>", (blood_volume > 448 ?"<font color='blue'>" : "<font color='red'>"), blood_percent, blood_volume)
|
||||
if(occupant.reagents)
|
||||
dat += text("Inaprovaline units: [] units<BR>", occupant.reagents.get_reagent_amount("inaprovaline"))
|
||||
dat += text("Soporific (Sleep Toxin): [] units<BR>", occupant.reagents.get_reagent_amount("stoxin"))
|
||||
dat += text("[]\tDermaline: [] units</FONT><BR>", (occupant.reagents.get_reagent_amount("dermaline") < 30 ? "<font color='black'>" : "<font color='red'>"), occupant.reagents.get_reagent_amount("dermaline"))
|
||||
dat += text("[]\tBicaridine: [] units<BR>", (occupant.reagents.get_reagent_amount("bicaridine") < 30 ? "<font color='black'>" : "<font color='red'>"), occupant.reagents.get_reagent_amount("bicaridine"))
|
||||
dat += text("[]\tDexalin: [] units<BR>", (occupant.reagents.get_reagent_amount("dexalin") < 30 ? "<font color='black'>" : "<font color='red'>"), occupant.reagents.get_reagent_amount("dexalin"))
|
||||
|
||||
dat += "<HR><table border='1'>"
|
||||
dat += "<tr>"
|
||||
dat += "<th>Organ</th>"
|
||||
dat += "<th>Burn Damage</th>"
|
||||
dat += "<th>Brute Damage</th>"
|
||||
dat += "<th>Other Wounds</th>"
|
||||
dat += "</tr>"
|
||||
|
||||
for(var/datum/organ/external/e in occupant.organs)
|
||||
|
||||
dat += "<tr>"
|
||||
var/AN = ""
|
||||
var/open = ""
|
||||
var/infected = ""
|
||||
var/robot = ""
|
||||
var/imp = ""
|
||||
var/bled = ""
|
||||
var/splint = ""
|
||||
var/internal_bleeding = ""
|
||||
var/lung_ruptured = ""
|
||||
for(var/datum/wound/W in e.wounds) if(W.internal)
|
||||
internal_bleeding = "<br>Internal bleeding"
|
||||
break
|
||||
if(istype(e, /datum/organ/external/chest) && occupant.is_lung_ruptured())
|
||||
lung_ruptured = "Lung ruptured:"
|
||||
if(e.status & ORGAN_SPLINTED)
|
||||
splint = "Splinted:"
|
||||
if(e.status & ORGAN_BLEEDING)
|
||||
bled = "Bleeding:"
|
||||
if(e.status & ORGAN_BROKEN)
|
||||
AN = "[e.broken_description]:"
|
||||
if(e.status & ORGAN_ROBOT)
|
||||
robot = "Prosthetic:"
|
||||
if(e.open)
|
||||
open = "Open:"
|
||||
switch (e.germ_level)
|
||||
if (INFECTION_LEVEL_ONE to INFECTION_LEVEL_ONE + 200)
|
||||
infected = "Mild Infection:"
|
||||
if (INFECTION_LEVEL_ONE + 200 to INFECTION_LEVEL_ONE + 300)
|
||||
infected = "Mild Infection+:"
|
||||
if (INFECTION_LEVEL_ONE + 300 to INFECTION_LEVEL_ONE + 400)
|
||||
infected = "Mild Infection++:"
|
||||
if (INFECTION_LEVEL_TWO to INFECTION_LEVEL_TWO + 200)
|
||||
infected = "Acute Infection:"
|
||||
if (INFECTION_LEVEL_TWO + 200 to INFECTION_LEVEL_TWO + 300)
|
||||
infected = "Acute Infection+:"
|
||||
if (INFECTION_LEVEL_TWO + 300 to INFECTION_LEVEL_TWO + 400)
|
||||
infected = "Acute Infection++:"
|
||||
if (INFECTION_LEVEL_THREE to INFINITY)
|
||||
infected = "Septic:"
|
||||
|
||||
var/unknown_body = 0
|
||||
for(var/I in e.implants)
|
||||
if(is_type_in_list(I,known_implants))
|
||||
imp += "[I] implanted:"
|
||||
else
|
||||
unknown_body++
|
||||
|
||||
if(unknown_body || e.hidden)
|
||||
imp += "Unknown body present:"
|
||||
if(!AN && !open && !infected & !imp)
|
||||
AN = "None:"
|
||||
if(!(e.status & ORGAN_DESTROYED))
|
||||
dat += "<td>[e.display_name]</td><td>[e.burn_dam]</td><td>[e.brute_dam]</td><td>[robot][bled][AN][splint][open][infected][imp][internal_bleeding][lung_ruptured]</td>"
|
||||
else
|
||||
dat += "<td>[e.display_name]</td><td>-</td><td>-</td><td>Not Found</td>"
|
||||
dat += "</tr>"
|
||||
for(var/n in occupant.internal_organs_by_name)
|
||||
var/datum/organ/internal/i = occupant.internal_organs_by_name[n]
|
||||
var/mech = i.desc
|
||||
var/infection = "None"
|
||||
switch (i.germ_level)
|
||||
if (1 to INFECTION_LEVEL_ONE + 200)
|
||||
infection = "Mild Infection:"
|
||||
if (INFECTION_LEVEL_ONE + 200 to INFECTION_LEVEL_ONE + 300)
|
||||
infection = "Mild Infection+:"
|
||||
if (INFECTION_LEVEL_ONE + 300 to INFECTION_LEVEL_ONE + 400)
|
||||
infection = "Mild Infection++:"
|
||||
if (INFECTION_LEVEL_TWO to INFECTION_LEVEL_TWO + 200)
|
||||
infection = "Acute Infection:"
|
||||
if (INFECTION_LEVEL_TWO + 200 to INFECTION_LEVEL_TWO + 300)
|
||||
infection = "Acute Infection+:"
|
||||
if (INFECTION_LEVEL_TWO + 300 to INFINITY)
|
||||
infection = "Acute Infection++:"
|
||||
|
||||
dat += "<tr>"
|
||||
dat += "<td>[i.name]</td><td>N/A</td><td>[i.damage]</td><td>[infection]:[mech]</td><td></td>"
|
||||
dat += "</tr>"
|
||||
dat += "</table>"
|
||||
if(occupant.sdisabilities & BLIND)
|
||||
dat += text("<font color='red'>Cataracts detected.</font><BR>")
|
||||
if(occupant.sdisabilities & NEARSIGHTED)
|
||||
dat += text("<font color='red'>Retinal misalignment detected.</font><BR>")
|
||||
else
|
||||
dat += "\The [src] is empty."
|
||||
if (panel_open)
|
||||
user << "<span class='notice'>Close the maintenance panel first.</span>"
|
||||
return
|
||||
if(!src.connected)
|
||||
findscanner()
|
||||
if (src.connected)
|
||||
if(!connected.occupant)
|
||||
user << "<span class='notice'>The scanner is empty.</span>"
|
||||
return
|
||||
if(!ishuman(connected.occupant))
|
||||
user << "\red This device can only scan compatible lifeforms."
|
||||
return
|
||||
var/dat
|
||||
if (src.delete && src.temphtml) //Window in buffer but its just simple message, so nothing
|
||||
src.delete = src.delete
|
||||
else if (!src.delete && src.temphtml) //Window in buffer - its a menu, dont add clear message
|
||||
dat = text("[]<BR><BR><A href='?src=\ref[];clear=1'>Main Menu</A>", src.temphtml, src)
|
||||
else
|
||||
dat = "<font color='red'> Error: No Body Scanner connected.</font>"
|
||||
dat += text("<BR><BR><A href='?src=\ref[];mach_close=scanconsole'>Close</A>", user)
|
||||
user << browse(dat, "window=scanconsole;size=430x600")
|
||||
if (src.connected) //Is something connected?
|
||||
var/mob/living/carbon/human/occupant = src.connected.occupant
|
||||
dat = "<font color='blue'><B>Occupant Statistics:</B></FONT><BR>" //Blah obvious
|
||||
if (istype(occupant)) //is there REALLY someone in there?
|
||||
var/t1
|
||||
switch(occupant.stat) // obvious, see what their status is
|
||||
if(0)
|
||||
t1 = "Conscious"
|
||||
if(1)
|
||||
t1 = "Unconscious"
|
||||
else
|
||||
t1 = "*dead*"
|
||||
if (!istype(occupant,/mob/living/carbon/human))
|
||||
dat += "<font color='red'>This device can only scan human occupants.</FONT>"
|
||||
else
|
||||
dat += text("[]\tHealth %: [] ([])</FONT><BR>", (occupant.health > 50 ? "<font color='blue'>" : "<font color='red'>"), occupant.health, t1)
|
||||
|
||||
if(occupant.virus2.len)
|
||||
dat += text("<font color='red'>Viral pathogen detected in blood stream.</font><BR>")
|
||||
|
||||
dat += text("[]\t-Brute Damage %: []</FONT><BR>", (occupant.getBruteLoss() < 60 ? "<font color='blue'>" : "<font color='red'>"), occupant.getBruteLoss())
|
||||
dat += text("[]\t-Respiratory Damage %: []</FONT><BR>", (occupant.getOxyLoss() < 60 ? "<font color='blue'>" : "<font color='red'>"), occupant.getOxyLoss())
|
||||
dat += text("[]\t-Toxin Content %: []</FONT><BR>", (occupant.getToxLoss() < 60 ? "<font color='blue'>" : "<font color='red'>"), occupant.getToxLoss())
|
||||
dat += text("[]\t-Burn Severity %: []</FONT><BR><BR>", (occupant.getFireLoss() < 60 ? "<font color='blue'>" : "<font color='red'>"), occupant.getFireLoss())
|
||||
|
||||
dat += text("[]\tRadiation Level %: []</FONT><BR>", (occupant.radiation < 10 ?"<font color='blue'>" : "<font color='red'>"), occupant.radiation)
|
||||
dat += text("[]\tGenetic Tissue Damage %: []</FONT><BR>", (occupant.getCloneLoss() < 1 ?"<font color='blue'>" : "<font color='red'>"), occupant.getCloneLoss())
|
||||
dat += text("[]\tApprox. Brain Damage %: []</FONT><BR>", (occupant.getBrainLoss() < 1 ?"<font color='blue'>" : "<font color='red'>"), occupant.getBrainLoss())
|
||||
dat += text("Paralysis Summary %: [] ([] seconds left!)<BR>", occupant.paralysis, round(occupant.paralysis / 4))
|
||||
dat += text("Body Temperature: [occupant.bodytemperature-T0C]°C ([occupant.bodytemperature*1.8-459.67]°F)<BR><HR>")
|
||||
|
||||
if(occupant.has_brain_worms())
|
||||
dat += "Large growth detected in frontal lobe, possibly cancerous. Surgical removal is recommended.<BR/>"
|
||||
|
||||
if(occupant.vessel)
|
||||
var/blood_volume = round(occupant.vessel.get_reagent_amount("blood"))
|
||||
var/blood_percent = blood_volume / 560
|
||||
blood_percent *= 100
|
||||
dat += text("[]\tBlood Level %: [] ([] units)</FONT><BR>", (blood_volume > 448 ?"<font color='blue'>" : "<font color='red'>"), blood_percent, blood_volume)
|
||||
if(occupant.reagents)
|
||||
dat += text("Inaprovaline units: [] units<BR>", occupant.reagents.get_reagent_amount("inaprovaline"))
|
||||
dat += text("Soporific (Sleep Toxin): [] units<BR>", occupant.reagents.get_reagent_amount("stoxin"))
|
||||
dat += text("[]\tDermaline: [] units</FONT><BR>", (occupant.reagents.get_reagent_amount("dermaline") < 30 ? "<font color='black'>" : "<font color='red'>"), occupant.reagents.get_reagent_amount("dermaline"))
|
||||
dat += text("[]\tBicaridine: [] units<BR>", (occupant.reagents.get_reagent_amount("bicaridine") < 30 ? "<font color='black'>" : "<font color='red'>"), occupant.reagents.get_reagent_amount("bicaridine"))
|
||||
dat += text("[]\tDexalin: [] units<BR>", (occupant.reagents.get_reagent_amount("dexalin") < 30 ? "<font color='black'>" : "<font color='red'>"), occupant.reagents.get_reagent_amount("dexalin"))
|
||||
|
||||
dat += "<HR><table border='1'>"
|
||||
dat += "<tr>"
|
||||
dat += "<th>Organ</th>"
|
||||
dat += "<th>Burn Damage</th>"
|
||||
dat += "<th>Brute Damage</th>"
|
||||
dat += "<th>Other Wounds</th>"
|
||||
dat += "</tr>"
|
||||
|
||||
for(var/datum/organ/external/e in occupant.organs)
|
||||
|
||||
dat += "<tr>"
|
||||
var/AN = ""
|
||||
var/open = ""
|
||||
var/infected = ""
|
||||
var/robot = ""
|
||||
var/imp = ""
|
||||
var/bled = ""
|
||||
var/splint = ""
|
||||
var/internal_bleeding = ""
|
||||
var/lung_ruptured = ""
|
||||
for(var/datum/wound/W in e.wounds) if(W.internal)
|
||||
internal_bleeding = "<br>Internal bleeding"
|
||||
break
|
||||
if(istype(e, /datum/organ/external/chest) && occupant.is_lung_ruptured())
|
||||
lung_ruptured = "Lung ruptured:"
|
||||
if(e.status & ORGAN_SPLINTED)
|
||||
splint = "Splinted:"
|
||||
if(e.status & ORGAN_BLEEDING)
|
||||
bled = "Bleeding:"
|
||||
if(e.status & ORGAN_BROKEN)
|
||||
AN = "[e.broken_description]:"
|
||||
if(e.status & ORGAN_ROBOT)
|
||||
robot = "Prosthetic:"
|
||||
if(e.open)
|
||||
open = "Open:"
|
||||
switch (e.germ_level)
|
||||
if (INFECTION_LEVEL_ONE to INFECTION_LEVEL_ONE + 200)
|
||||
infected = "Mild Infection:"
|
||||
if (INFECTION_LEVEL_ONE + 200 to INFECTION_LEVEL_ONE + 300)
|
||||
infected = "Mild Infection+:"
|
||||
if (INFECTION_LEVEL_ONE + 300 to INFECTION_LEVEL_ONE + 400)
|
||||
infected = "Mild Infection++:"
|
||||
if (INFECTION_LEVEL_TWO to INFECTION_LEVEL_TWO + 200)
|
||||
infected = "Acute Infection:"
|
||||
if (INFECTION_LEVEL_TWO + 200 to INFECTION_LEVEL_TWO + 300)
|
||||
infected = "Acute Infection+:"
|
||||
if (INFECTION_LEVEL_TWO + 300 to INFECTION_LEVEL_TWO + 400)
|
||||
infected = "Acute Infection++:"
|
||||
if (INFECTION_LEVEL_THREE to INFINITY)
|
||||
infected = "Septic:"
|
||||
|
||||
var/unknown_body = 0
|
||||
for(var/I in e.implants)
|
||||
if(is_type_in_list(I,known_implants))
|
||||
imp += "[I] implanted:"
|
||||
else
|
||||
unknown_body++
|
||||
|
||||
if(unknown_body || e.hidden)
|
||||
imp += "Unknown body present:"
|
||||
if(!AN && !open && !infected & !imp)
|
||||
AN = "None:"
|
||||
if(!(e.status & ORGAN_DESTROYED))
|
||||
dat += "<td>[e.display_name]</td><td>[e.burn_dam]</td><td>[e.brute_dam]</td><td>[robot][bled][AN][splint][open][infected][imp][internal_bleeding][lung_ruptured]</td>"
|
||||
else
|
||||
dat += "<td>[e.display_name]</td><td>-</td><td>-</td><td>Not Found</td>"
|
||||
dat += "</tr>"
|
||||
for(var/n in occupant.internal_organs_by_name)
|
||||
var/datum/organ/internal/i = occupant.internal_organs_by_name[n]
|
||||
var/mech = i.desc
|
||||
var/infection = "None"
|
||||
switch (i.germ_level)
|
||||
if (1 to INFECTION_LEVEL_ONE + 200)
|
||||
infection = "Mild Infection:"
|
||||
if (INFECTION_LEVEL_ONE + 200 to INFECTION_LEVEL_ONE + 300)
|
||||
infection = "Mild Infection+:"
|
||||
if (INFECTION_LEVEL_ONE + 300 to INFECTION_LEVEL_ONE + 400)
|
||||
infection = "Mild Infection++:"
|
||||
if (INFECTION_LEVEL_TWO to INFECTION_LEVEL_TWO + 200)
|
||||
infection = "Acute Infection:"
|
||||
if (INFECTION_LEVEL_TWO + 200 to INFECTION_LEVEL_TWO + 300)
|
||||
infection = "Acute Infection+:"
|
||||
if (INFECTION_LEVEL_TWO + 300 to INFINITY)
|
||||
infection = "Acute Infection++:"
|
||||
|
||||
dat += "<tr>"
|
||||
dat += "<td>[i.name]</td><td>N/A</td><td>[i.damage]</td><td>[infection]:[mech]</td><td></td>"
|
||||
dat += "</tr>"
|
||||
dat += "</table>"
|
||||
if(occupant.sdisabilities & BLIND)
|
||||
dat += text("<font color='red'>Cataracts detected.</font><BR>")
|
||||
if(occupant.sdisabilities & NEARSIGHTED)
|
||||
dat += text("<font color='red'>Retinal misalignment detected.</font><BR>")
|
||||
else
|
||||
dat += "\The [src] is empty."
|
||||
else
|
||||
dat = "<font color='red'> Error: No Body Scanner connected.</font>"
|
||||
dat += text("<BR><BR><A href='?src=\ref[];mach_close=scanconsole'>Close</A>", user)
|
||||
user << browse(dat, "window=scanconsole;size=430x600")
|
||||
return
|
||||
|
||||
@@ -98,6 +98,7 @@ var/global/list/autolathe_recipes_hidden = list( \
|
||||
idle_power_usage = 10
|
||||
active_power_usage = 100
|
||||
var/busy = 0
|
||||
var/prod_coeff
|
||||
|
||||
l_color = "#7BF9FF"
|
||||
power_change()
|
||||
@@ -106,7 +107,22 @@ var/global/list/autolathe_recipes_hidden = list( \
|
||||
SetLuminosity(2)
|
||||
else
|
||||
SetLuminosity(0)
|
||||
|
||||
/obj/machinery/autolathe/New()
|
||||
..()
|
||||
component_parts = list()
|
||||
component_parts += new /obj/item/weapon/circuitboard/autolathe(src)
|
||||
component_parts += new /obj/item/weapon/stock_parts/matter_bin(src)
|
||||
component_parts += new /obj/item/weapon/stock_parts/matter_bin(src)
|
||||
component_parts += new /obj/item/weapon/stock_parts/matter_bin(src)
|
||||
component_parts += new /obj/item/weapon/stock_parts/manipulator(src)
|
||||
component_parts += new /obj/item/weapon/stock_parts/console_screen(src)
|
||||
RefreshParts()
|
||||
|
||||
wires = new(src)
|
||||
src.L = autolathe_recipes
|
||||
src.LL = autolathe_recipes_hidden
|
||||
|
||||
/obj/machinery/autolathe/proc/wires_win(mob/user as mob)
|
||||
var/dat as text
|
||||
dat += "Autolathe Wires:<BR>"
|
||||
@@ -120,6 +136,7 @@ var/global/list/autolathe_recipes_hidden = list( \
|
||||
onclose(user, "autolathe_hack")
|
||||
|
||||
/obj/machinery/autolathe/proc/regular_win(mob/user as mob)
|
||||
var/coeff = 2 ** prod_coeff
|
||||
var/dat as text
|
||||
dat = text("<B>Metal Amount:</B> [src.m_amount] cm<sup>3</sup> (MAX: [max_m_amount])<BR>\n<FONT color=blue><B>Glass Amount:</B></FONT> [src.g_amount] cm<sup>3</sup> (MAX: [max_g_amount])<BR>\n<FONT color=orange><B>Fur Amount:</B></FONT> [src.f_amount] cm<sup>3</sup> (MAX: [max_f_amount])<HR>")
|
||||
var/list/objs = list()
|
||||
@@ -127,7 +144,7 @@ var/global/list/autolathe_recipes_hidden = list( \
|
||||
if (src.hacked)
|
||||
objs += src.LL
|
||||
for(var/obj/t in objs)
|
||||
var/title = "[t.name] ([t.m_amt] m /[t.g_amt] g/[t.f_amt] f)"
|
||||
var/title = "[t.name] ([t.m_amt/coeff] m / [t.g_amt/coeff] g / [t.f_amt/coeff] f)"
|
||||
if (m_amount<t.m_amt || g_amount<t.g_amt || f_amount<t.f_amt)
|
||||
dat += title + "<br>"
|
||||
continue
|
||||
@@ -143,6 +160,8 @@ var/global/list/autolathe_recipes_hidden = list( \
|
||||
dat += " <A href='?src=\ref[src];make=\ref[t];multiplier=[25]'>x[25]</A>"
|
||||
if (max_multiplier>1)
|
||||
dat += " <A href='?src=\ref[src];make=\ref[t];multiplier=[max_multiplier]'>x[max_multiplier]</A>"
|
||||
else
|
||||
dat += " [t.m_amt/coeff] m / [t.g_amt/coeff] g / [t.f_amt/coeff] f"
|
||||
dat += "<br>"
|
||||
user << browse("<HTML><HEAD><TITLE>Autolathe Control Panel</TITLE></HEAD><BODY><TT>[dat]</TT></BODY></HTML>", "window=autolathe_regular")
|
||||
onclose(user, "autolathe_regular")
|
||||
@@ -163,34 +182,37 @@ var/global/list/autolathe_recipes_hidden = list( \
|
||||
/obj/machinery/autolathe/interact(mob/user as mob)
|
||||
if(..())
|
||||
return
|
||||
|
||||
if (src.shocked)
|
||||
src.shock(user,50)
|
||||
|
||||
if (src.opened)
|
||||
wires_win(user,50)
|
||||
return
|
||||
|
||||
if (src.disabled)
|
||||
user << "\red You press the button, but nothing happens."
|
||||
return
|
||||
|
||||
regular_win(user)
|
||||
return
|
||||
|
||||
/obj/machinery/autolathe/attackby(var/obj/item/O as obj, var/mob/user as mob)
|
||||
if (stat)
|
||||
return 1
|
||||
|
||||
if (busy)
|
||||
user << "\red The autolathe is busy. Please wait for completion of previous operation."
|
||||
return 1
|
||||
|
||||
if (istype(O, /obj/item/weapon/screwdriver))
|
||||
if (!opened)
|
||||
src.opened = 1
|
||||
src.icon_state = "autolathe_t"
|
||||
user << "You open the maintenance hatch of [src]."
|
||||
else
|
||||
src.opened = 0
|
||||
src.icon_state = "autolathe"
|
||||
user << "You close the maintenance hatch of [src]."
|
||||
default_deconstruction_screwdriver(user, "autolathe_t", "autolathe", O)
|
||||
return 1
|
||||
if (opened)
|
||||
|
||||
if(exchange_parts(user, O))
|
||||
return
|
||||
|
||||
if (panel_open)
|
||||
//Don't eat multitools or wirecutters used on an open lathe.
|
||||
if(istype(O, /obj/item/device/multitool) || istype(O, /obj/item/weapon/wirecutters))
|
||||
attack_hand(user)
|
||||
@@ -198,10 +220,6 @@ var/global/list/autolathe_recipes_hidden = list( \
|
||||
|
||||
//Dismantle the frame.
|
||||
if(istype(O, /obj/item/weapon/crowbar))
|
||||
playsound(get_turf(src), 'sound/items/Crowbar.ogg', 50, 1)
|
||||
var/obj/machinery/constructable_frame/machine_frame/M = new /obj/machinery/constructable_frame/machine_frame(src.loc)
|
||||
M.state = 2
|
||||
M.icon_state = "box_1"
|
||||
for(var/obj/I in component_parts)
|
||||
if(I.reliability != 100 && crit_fail)
|
||||
I.crit_fail = 1
|
||||
@@ -212,7 +230,7 @@ var/global/list/autolathe_recipes_hidden = list( \
|
||||
if(g_amount >= 3750)
|
||||
var/obj/item/stack/sheet/glass/G = new /obj/item/stack/sheet/glass(src.loc)
|
||||
G.amount = round(g_amount / 3750)
|
||||
del(src)
|
||||
default_deconstruction_crowbar(O)
|
||||
return 1
|
||||
else
|
||||
user.set_machine(src)
|
||||
@@ -288,7 +306,8 @@ var/global/list/autolathe_recipes_hidden = list( \
|
||||
usr.set_machine(src)
|
||||
src.add_fingerprint(usr)
|
||||
if (!busy)
|
||||
if(href_list["make"])
|
||||
if(href_list["make"])
|
||||
var/coeff = 2 ** prod_coeff
|
||||
var/turf/T = get_step(src.loc, get_dir(src,usr))
|
||||
|
||||
// critical exploit fix start -walter0o
|
||||
@@ -327,31 +346,36 @@ var/global/list/autolathe_recipes_hidden = list( \
|
||||
return
|
||||
|
||||
var/power = max(2000, (template.m_amt+template.g_amt+template.f_amt)*multiplier/5)
|
||||
if(src.m_amount >= template.m_amt*multiplier && src.g_amount >= template.g_amt*multiplier && src.f_amount >= template.f_amt*multiplier)
|
||||
if(src.m_amount >= template.m_amt*multiplier/coeff && src.g_amount >= template.g_amt*multiplier/coeff && src.f_amount >= template.f_amt*multiplier/coeff)
|
||||
busy = 1
|
||||
use_power(power)
|
||||
icon_state = "autolathe"
|
||||
flick("autolathe_n",src)
|
||||
spawn(16)
|
||||
spawn(32/coeff)
|
||||
use_power(power)
|
||||
spawn(16)
|
||||
use_power(power)
|
||||
spawn(16)
|
||||
src.m_amount -= template.m_amt*multiplier
|
||||
src.g_amount -= template.g_amt*multiplier
|
||||
src.f_amount -= template.f_amt*multiplier
|
||||
if(src.m_amount < 0)
|
||||
src.m_amount = 0
|
||||
if(src.g_amount < 0)
|
||||
src.g_amount = 0
|
||||
if(src.f_amount < 0)
|
||||
src.f_amount = 0
|
||||
var/obj/new_item = new template.type(T)
|
||||
if (multiplier>1)
|
||||
var/obj/item/stack/S = new_item
|
||||
S.amount = multiplier
|
||||
busy = 0
|
||||
src.updateUsrDialog()
|
||||
if(istype(template, /obj/item/stack))
|
||||
src.m_amount -= template.m_amt*multiplier
|
||||
src.g_amount -= template.g_amt*multiplier
|
||||
src.f_amount -= template.f_amt*multiplier
|
||||
var/obj/new_item = new template.type(T)
|
||||
var/obj/item/stack/S = new_item
|
||||
S.amount = multiplier
|
||||
else
|
||||
src.m_amount -= template.m_amt/coeff
|
||||
src.g_amount -= template.g_amt/coeff
|
||||
src.f_amount -= template.f_amt/coeff
|
||||
var/obj/item/new_item = new template.type(T)
|
||||
new_item.m_amt /= coeff
|
||||
new_item.g_amt /= coeff
|
||||
new_item.f_amt /= coeff
|
||||
if(src.m_amount < 0)
|
||||
src.m_amount = 0
|
||||
if(src.g_amount < 0)
|
||||
src.g_amount = 0
|
||||
if(src.f_amount < 0)
|
||||
src.f_amount = 0
|
||||
busy = 0
|
||||
|
||||
if(href_list["act"])
|
||||
var/temp_wire = href_list["wire"]
|
||||
if(href_list["act"] == "pulse")
|
||||
@@ -390,7 +414,18 @@ var/global/list/autolathe_recipes_hidden = list( \
|
||||
src.updateUsrDialog()
|
||||
return
|
||||
|
||||
|
||||
/obj/machinery/autolathe/RefreshParts()
|
||||
var/tot_rating = 0
|
||||
prod_coeff = 0
|
||||
for(var/obj/item/weapon/stock_parts/matter_bin/MB in component_parts)
|
||||
tot_rating += MB.rating
|
||||
tot_rating *= 25000
|
||||
max_m_amount = tot_rating * 2
|
||||
max_g_amount = tot_rating
|
||||
max_f_amount = tot_rating
|
||||
for(var/obj/item/weapon/stock_parts/manipulator/M in component_parts)
|
||||
prod_coeff += M.rating - 1
|
||||
|
||||
/obj/machinery/autolathe/RefreshParts()
|
||||
..()
|
||||
var/tot_rating = 0
|
||||
|
||||
+208
-122
@@ -1,8 +1,8 @@
|
||||
/obj/machinery/biogenerator
|
||||
name = "Biogenerator"
|
||||
desc = ""
|
||||
desc = "Converts plants into biomass, which can be used to construct useful items."
|
||||
icon = 'icons/obj/biogenerator.dmi'
|
||||
icon_state = "biogen-stand"
|
||||
icon_state = "biogen-empty"
|
||||
density = 1
|
||||
anchored = 1
|
||||
use_power = 1
|
||||
@@ -11,111 +11,165 @@
|
||||
var/obj/item/weapon/reagent_containers/glass/beaker = null
|
||||
var/points = 0
|
||||
var/menustat = "menu"
|
||||
var/efficiency = 0
|
||||
var/productivity = 0
|
||||
|
||||
New()
|
||||
/obj/machinery/biogenerator/New()
|
||||
..()
|
||||
var/datum/reagents/R = new/datum/reagents(1000)
|
||||
reagents = R
|
||||
R.my_atom = src
|
||||
beaker = new /obj/item/weapon/reagent_containers/glass/beaker/large(src)
|
||||
create_reagents(1000)
|
||||
component_parts = list()
|
||||
component_parts += new /obj/item/weapon/circuitboard/biogenerator(null)
|
||||
component_parts += new /obj/item/weapon/stock_parts/matter_bin(null)
|
||||
component_parts += new /obj/item/weapon/stock_parts/manipulator(null)
|
||||
component_parts += new /obj/item/weapon/stock_parts/console_screen(null)
|
||||
component_parts += new /obj/item/stack/cable_coil(null, 1)
|
||||
RefreshParts()
|
||||
|
||||
on_reagent_change() //When the reagents change, change the icon as well.
|
||||
/obj/machinery/biogenerator/RefreshParts()
|
||||
var/E = 0
|
||||
var/P = 0
|
||||
for(var/obj/item/weapon/stock_parts/matter_bin/B in component_parts)
|
||||
P += B.rating
|
||||
for(var/obj/item/weapon/stock_parts/manipulator/M in component_parts)
|
||||
E += M.rating
|
||||
efficiency = E
|
||||
productivity = P
|
||||
|
||||
/obj/machinery/biogenerator/on_reagent_change() //When the reagents change, change the icon as well.
|
||||
update_icon()
|
||||
|
||||
update_icon()
|
||||
if(!src.beaker)
|
||||
icon_state = "biogen-empty"
|
||||
else if(!src.processing)
|
||||
icon_state = "biogen-stand"
|
||||
else
|
||||
icon_state = "biogen-work"
|
||||
return
|
||||
/obj/machinery/biogenerator/update_icon()
|
||||
if(panel_open)
|
||||
icon_state = "biogen-empty-o"
|
||||
else if(!src.beaker)
|
||||
icon_state = "biogen-empty"
|
||||
else if(!src.processing)
|
||||
icon_state = "biogen-stand"
|
||||
else
|
||||
icon_state = "biogen-work"
|
||||
return
|
||||
|
||||
/obj/machinery/biogenerator/attackby(var/obj/item/O as obj, var/mob/user as mob)
|
||||
if(istype(O, /obj/item/weapon/reagent_containers/glass))
|
||||
if(istype(O, /obj/item/weapon/reagent_containers/glass) && !panel_open)
|
||||
if(beaker)
|
||||
user << "\red The biogenerator is already loaded."
|
||||
user << "<span class='warning'>A container is already loaded into the machine.</span>"
|
||||
else
|
||||
user.before_take_item(O)
|
||||
O.loc = src
|
||||
beaker = O
|
||||
user << "<span class='notice'>You add the container to the machine.</span>"
|
||||
updateUsrDialog()
|
||||
|
||||
if(!processing)
|
||||
if(default_deconstruction_screwdriver(user, "biogen-empty-o", "biogen-empty", O))
|
||||
if(beaker)
|
||||
var/obj/item/weapon/reagent_containers/glass/B = beaker
|
||||
B.loc = loc
|
||||
beaker = null
|
||||
return
|
||||
|
||||
if(exchange_parts(user, O))
|
||||
return
|
||||
|
||||
else if(istype(O, /obj/item/weapon/crowbar))
|
||||
else if(panel_open)
|
||||
user << "<span class='notice'>Close the maintenance panel first.</span>"
|
||||
else if(processing)
|
||||
user << "\red The biogenerator is currently processing."
|
||||
user << "<span class='warning'>The biogenerator is currently processing.</span>"
|
||||
else if(istype(O, /obj/item/weapon/storage/bag/plants))
|
||||
var/i = 0
|
||||
for(var/obj/item/weapon/reagent_containers/food/snacks/grown/G in contents)
|
||||
i++
|
||||
if(i >= 10)
|
||||
user << "\red The biogenerator is already full! Activate it."
|
||||
user << "<span class='warning'>The biogenerator is already full! Activate it.</span>"
|
||||
else
|
||||
for(var/obj/item/weapon/reagent_containers/food/snacks/grown/G in O.contents)
|
||||
if(i >= 10)
|
||||
break
|
||||
G.loc = src
|
||||
i++
|
||||
if(i >= 10)
|
||||
user << "\blue You fill the biogenerator to its capacity."
|
||||
break
|
||||
if(i<10)
|
||||
user << "\blue You empty the plant bag into the biogenerator."
|
||||
user << "<span class='info'>You empty the plant bag into the biogenerator.</span>"
|
||||
else if(O.contents.len == 0)
|
||||
user << "<span class='info'>You empty the plant bag into the biogenerator, filling it to its capacity.</span>"
|
||||
else
|
||||
user << "<span class='info'>You fill the biogenerator to its capacity.</span>"
|
||||
|
||||
|
||||
else if(!istype(O, /obj/item/weapon/reagent_containers/food/snacks/grown))
|
||||
user << "\red You cannot put this in [src.name]"
|
||||
else if(!istype(O, /obj/item/weapon/reagent_containers/food/snacks/grown) && !istype(O, /obj/item/weapon/crowbar))
|
||||
user << "<span class='warning'>You can not put this in [src.name]</span>"
|
||||
else
|
||||
var/i = 0
|
||||
for(var/obj/item/weapon/reagent_containers/food/snacks/grown/G in contents)
|
||||
i++
|
||||
if(i >= 10)
|
||||
user << "\red The biogenerator is full! Activate it."
|
||||
user << "<span class='warning'>The biogenerator is full! Activate it.</span>"
|
||||
else
|
||||
user.before_take_item(O)
|
||||
O.loc = src
|
||||
user << "\blue You put [O.name] in [src.name]"
|
||||
user << "<span class='info'>You put [O.name] in [src.name]</span>"
|
||||
|
||||
|
||||
default_deconstruction_crowbar(O)
|
||||
|
||||
update_icon()
|
||||
return
|
||||
|
||||
/obj/machinery/biogenerator/interact(mob/user as mob)
|
||||
if(stat & BROKEN)
|
||||
if(stat & BROKEN || panel_open)
|
||||
return
|
||||
user.set_machine(src)
|
||||
var/dat = "<TITLE>Biogenerator</TITLE>Biogenerator:<BR>"
|
||||
if (processing)
|
||||
dat += "<FONT COLOR=red>Biogenerator is processing! Please wait...</FONT>"
|
||||
var/dat
|
||||
if(processing)
|
||||
dat += "<div class='statusDisplay'>Biogenerator is processing! Please wait...</div><BR>"
|
||||
else
|
||||
dat += "Biomass: [points] points.<HR>"
|
||||
switch(menustat)
|
||||
if("menu")
|
||||
if (beaker)
|
||||
dat += "<A href='?src=\ref[src];action=activate'>Activate Biogenerator!</A><BR>"
|
||||
dat += "<A href='?src=\ref[src];action=detach'>Detach Container</A><BR><BR>"
|
||||
dat += "Food<BR>"
|
||||
dat += "<A href='?src=\ref[src];action=create;item=milk;cost=20'>10 milk</A> <FONT COLOR=blue>(20)</FONT><BR>"
|
||||
dat += "<A href='?src=\ref[src];action=create;item=meat;cost=50'>Slab of meat</A> <FONT COLOR=blue>(50)</FONT><BR>"
|
||||
dat += "Nutrient<BR>"
|
||||
dat += "<A href='?src=\ref[src];action=create;item=ez;cost=10'>E-Z-Nutrient</A> <FONT COLOR=blue>(10)</FONT> | <A href='?src=\ref[src];action=create;item=ez5;cost=50'>x5</A><BR>"
|
||||
dat += "<A href='?src=\ref[src];action=create;item=l4z;cost=20'>Left 4 Zed</A> <FONT COLOR=blue>(20)</FONT> | <A href='?src=\ref[src];action=create;item=l4z5;cost=100'>x5</A><BR>"
|
||||
dat += "<A href='?src=\ref[src];action=create;item=rh;cost=25'>Robust Harvest</A> <FONT COLOR=blue>(25)</FONT> | <A href='?src=\ref[src];action=create;item=rh5;cost=125'>x5</A><BR>"
|
||||
dat += "Leather<BR>"
|
||||
dat += "<A href='?src=\ref[src];action=create;item=wallet;cost=100'>Wallet</A> <FONT COLOR=blue>(100)</FONT><BR>"
|
||||
dat += "<A href='?src=\ref[src];action=create;item=gloves;cost=250'>Botanical gloves</A> <FONT COLOR=blue>(250)</FONT><BR>"
|
||||
dat += "<A href='?src=\ref[src];action=create;item=tbelt;cost=300'>Utility belt</A> <FONT COLOR=blue>(300)</FONT><BR>"
|
||||
dat += "<A href='?src=\ref[src];action=create;item=satchel;cost=400'>Leather Satchel</A> <FONT COLOR=blue>(400)</FONT><BR>"
|
||||
dat += "<A href='?src=\ref[src];action=create;item=cashbag;cost=400'>Cash Bag</A> <FONT COLOR=blue>(400)</FONT><BR>"
|
||||
//dat += "Other<BR>"
|
||||
//dat += "<A href='?src=\ref[src];action=create;item=monkey;cost=500'>Monkey</A> <FONT COLOR=blue>(500)</FONT><BR>"
|
||||
else
|
||||
dat += "<BR><FONT COLOR=red>No beaker inside. Please insert a beaker.</FONT><BR>"
|
||||
if("nopoints")
|
||||
dat += "You do not have biomass to create products.<BR>Please, put growns into reactor and activate it.<BR>"
|
||||
dat += "<A href='?src=\ref[src];action=menu'>Return to menu</A>"
|
||||
dat += "<div class='statusDisplay'>You do not have sufficient biomass to create products.<BR>Please put growns into the reactor and activate it.</div>"
|
||||
menustat = "menu"
|
||||
if("complete")
|
||||
dat += "Operation complete.<BR>"
|
||||
dat += "<A href='?src=\ref[src];action=menu'>Return to menu</A>"
|
||||
dat += "<div class='statusDisplay'>Operation complete.</div>"
|
||||
menustat = "menu"
|
||||
if("void")
|
||||
dat += "<FONT COLOR=red>Error: No growns inside.</FONT><BR>Please, put growns into reactor.<BR>"
|
||||
dat += "<A href='?src=\ref[src];action=menu'>Return to menu</A>"
|
||||
user << browse(dat, "window=biogenerator")
|
||||
onclose(user, "biogenerator")
|
||||
dat += "<div class='statusDisplay'>Error: No growns inside.<BR>Please put growns into reactor.</div>"
|
||||
menustat = "menu"
|
||||
if("nobeakerspace")
|
||||
dat += "<div class='statusDisplay'>Not enough space left in container. Unable to create product.</div>"
|
||||
menustat = "menu"
|
||||
if(beaker)
|
||||
dat += "<div class='statusDisplay'>Biomass: [points] units.</div><BR>"
|
||||
dat += "<A href='?src=\ref[src];activate=1'>Activate</A><A href='?src=\ref[src];detach=1'>Detach Container</A>"
|
||||
dat += "<h3>Food:</h3>"
|
||||
dat += "<div class='statusDisplay'>"
|
||||
dat += "10 milk: <A href='?src=\ref[src];create=milk;amount=1'>Make</A> ([20/efficiency])<BR>"
|
||||
/*dat += "10 cream: <A href='?src=\ref[src];create=cream;amount=1'>Make</A> ([30/efficiency])<BR>"*/
|
||||
dat += "Monkey cube: <A href='?src=\ref[src];create=meat;amount=1'>Make</A> ([250/efficiency])"
|
||||
dat += "</div>"
|
||||
dat += "<h3>Nutrients:</h3>"
|
||||
dat += "<div class='statusDisplay'>"
|
||||
dat += "E-Z-Nutrient: <A href='?src=\ref[src];create=ez;amount=1'>Make</A><A href='?src=\ref[src];create=ez;amount=5'>x5</A> ([10/efficiency])<BR>"
|
||||
dat += "Left 4 Zed: <A href='?src=\ref[src];create=l4z;amount=1'>Make</A><A href='?src=\ref[src];create=l4z;amount=5'>x5</A> ([20/efficiency])<BR>"
|
||||
dat += "Robust Harvest: <A href='?src=\ref[src];create=rh;amount=1'>Make</A><A href='?src=\ref[src];create=rh;amount=5'>x5</A> ([25/efficiency])<BR>"
|
||||
dat += "</div>"
|
||||
dat += "<h3>Leather:</h3>"
|
||||
dat += "<div class='statusDisplay'>"
|
||||
dat += "Wallet: <A href='?src=\ref[src];create=wallet;amount=1'>Make</A> ([100/efficiency])<BR>"
|
||||
/*dat += "Book bag: <A href='?src=\ref[src];create=bkbag;amount=1'>Make</A> ([200/efficiency])<BR>"
|
||||
dat += "Plant bag: <A href='?src=\ref[src];create=ptbag;amount=1'>Make</A> ([200/efficiency])<BR>"
|
||||
dat += "Mining satchel: <A href='?src=\ref[src];create=mnbag;amount=1'>Make</A> ([200/efficiency])<BR>"*/
|
||||
dat += "Botanical gloves: <A href='?src=\ref[src];create=gloves;amount=1'>Make</A> ([250/efficiency])<BR>"
|
||||
dat += "Utility belt: <A href='?src=\ref[src];create=tbelt;amount=1'>Make</A> ([300/efficiency])<BR>"
|
||||
dat += "Leather Satchel: <A href='?src=\ref[src];create=satchel;amount=1'>Make</A> ([400/efficiency])<BR>"
|
||||
dat += "Cash Bag: <A href='?src=\ref[src];create=cashbag;amount=1'>Make</A> ([400/efficiency])<BR>"
|
||||
/*dat += "Leather Jacket: <A href='?src=\ref[src];create=jacket;amount=1'>Make</A> ([500/efficiency])<BR>"*/
|
||||
//dat += "<h3>Other:</h3>"
|
||||
//dat += "Monkey: <A href='?src=\ref[src];create=monkey;amount=1'>Make</A> ([400/efficiency])<BR>"
|
||||
dat += "</div>"
|
||||
else
|
||||
dat += "<div class='statusDisplay'>No container inside. Please insert a container.</div>"
|
||||
|
||||
var/datum/browser/popup = new(user, "biogen", name, 350, 520)
|
||||
popup.set_content(dat)
|
||||
popup.open()
|
||||
return
|
||||
|
||||
/obj/machinery/biogenerator/attack_hand(mob/user as mob)
|
||||
@@ -127,100 +181,132 @@
|
||||
if (src.stat != 0) //NOPOWER etc
|
||||
return
|
||||
if(src.processing)
|
||||
usr << "\red The biogenerator is in the process of working."
|
||||
usr << "<span class='warning'>The biogenerator is in the process of working.</span>"
|
||||
return
|
||||
var/S = 0
|
||||
for(var/obj/item/weapon/reagent_containers/food/snacks/grown/I in contents)
|
||||
S += 5
|
||||
if(I.reagents.get_reagent_amount("nutriment") < 0.1)
|
||||
points += 1
|
||||
else points += I.reagents.get_reagent_amount("nutriment")*10
|
||||
del(I)
|
||||
points += 1*productivity
|
||||
else points += I.reagents.get_reagent_amount("nutriment")*10*productivity
|
||||
qdel(I)
|
||||
if(S)
|
||||
processing = 1
|
||||
update_icon()
|
||||
updateUsrDialog()
|
||||
playsound(src.loc, 'sound/machines/blender.ogg', 50, 1)
|
||||
use_power(S*30)
|
||||
sleep(S+15)
|
||||
sleep(S+15/productivity)
|
||||
processing = 0
|
||||
update_icon()
|
||||
else
|
||||
menustat = "void"
|
||||
return
|
||||
|
||||
/obj/machinery/biogenerator/proc/create_product(var/item,var/cost)
|
||||
if(cost > points)
|
||||
/obj/machinery/biogenerator/proc/check_cost(var/cost)
|
||||
if (cost > points)
|
||||
menustat = "nopoints"
|
||||
return 1
|
||||
else
|
||||
points -= cost
|
||||
processing = 1
|
||||
update_icon()
|
||||
updateUsrDialog()
|
||||
return 0
|
||||
processing = 1
|
||||
update_icon()
|
||||
updateUsrDialog()
|
||||
points -= cost
|
||||
sleep(30)
|
||||
switch(item)
|
||||
|
||||
/obj/machinery/biogenerator/proc/check_container_volume(var/reagent_amount)
|
||||
if(beaker.reagents.total_volume + reagent_amount > beaker.reagents.maximum_volume)
|
||||
menustat = "nobeakerspace"
|
||||
return 1
|
||||
|
||||
/obj/machinery/biogenerator/proc/create_product(var/create)
|
||||
switch(create)
|
||||
if("milk")
|
||||
beaker.reagents.add_reagent("milk",10)
|
||||
if(check_container_volume(10)) return 0
|
||||
else if (check_cost(20/efficiency)) return 0
|
||||
else beaker.reagents.add_reagent("milk",10)
|
||||
/*if("cream")
|
||||
if(check_container_volume(10)) return 0
|
||||
else if (check_cost(30/efficiency)) return 0
|
||||
else beaker.reagents.add_reagent("cream",10)*/
|
||||
if("meat")
|
||||
new/obj/item/weapon/reagent_containers/food/snacks/meat(src.loc)
|
||||
if (check_cost(250/efficiency)) return 0
|
||||
else new/obj/item/weapon/reagent_containers/food/snacks/monkeycube(src.loc)
|
||||
if("ez")
|
||||
new/obj/item/weapon/reagent_containers/glass/fertilizer/ez(src.loc)
|
||||
if (check_cost(10/efficiency)) return 0
|
||||
else new/obj/item/weapon/reagent_containers/glass/fertilizer/ez(src.loc)
|
||||
if("l4z")
|
||||
new/obj/item/weapon/reagent_containers/glass/fertilizer/l4z(src.loc)
|
||||
if (check_cost(20/efficiency)) return 0
|
||||
else new/obj/item/weapon/reagent_containers/glass/fertilizer/l4z(src.loc)
|
||||
if("rh")
|
||||
new/obj/item/weapon/reagent_containers/glass/fertilizer/rh(src.loc)
|
||||
if("ez5") //It's not an elegant method, but it's safe and easy. -Cheridan
|
||||
new/obj/item/weapon/reagent_containers/glass/fertilizer/ez(src.loc)
|
||||
new/obj/item/weapon/reagent_containers/glass/fertilizer/ez(src.loc)
|
||||
new/obj/item/weapon/reagent_containers/glass/fertilizer/ez(src.loc)
|
||||
new/obj/item/weapon/reagent_containers/glass/fertilizer/ez(src.loc)
|
||||
new/obj/item/weapon/reagent_containers/glass/fertilizer/ez(src.loc)
|
||||
if("l4z5")
|
||||
new/obj/item/weapon/reagent_containers/glass/fertilizer/l4z(src.loc)
|
||||
new/obj/item/weapon/reagent_containers/glass/fertilizer/l4z(src.loc)
|
||||
new/obj/item/weapon/reagent_containers/glass/fertilizer/l4z(src.loc)
|
||||
new/obj/item/weapon/reagent_containers/glass/fertilizer/l4z(src.loc)
|
||||
new/obj/item/weapon/reagent_containers/glass/fertilizer/l4z(src.loc)
|
||||
if("rh5")
|
||||
new/obj/item/weapon/reagent_containers/glass/fertilizer/rh(src.loc)
|
||||
new/obj/item/weapon/reagent_containers/glass/fertilizer/rh(src.loc)
|
||||
new/obj/item/weapon/reagent_containers/glass/fertilizer/rh(src.loc)
|
||||
new/obj/item/weapon/reagent_containers/glass/fertilizer/rh(src.loc)
|
||||
new/obj/item/weapon/reagent_containers/glass/fertilizer/rh(src.loc)
|
||||
if (check_cost(25/efficiency)) return 0
|
||||
else new/obj/item/weapon/reagent_containers/glass/fertilizer/rh(src.loc)
|
||||
if("wallet")
|
||||
new/obj/item/weapon/storage/wallet(src.loc)
|
||||
if (check_cost(100/efficiency)) return 0
|
||||
else new/obj/item/weapon/storage/wallet(src.loc)
|
||||
/*if("bkbag")
|
||||
if (check_cost(200/efficiency)) return 0
|
||||
else new/obj/item/weapon/storage/bag/books(src.loc)
|
||||
if("ptbag")
|
||||
if (check_cost(200/efficiency)) return 0
|
||||
else new/obj/item/weapon/storage/bag/plants(src.loc)
|
||||
if("mnbag")
|
||||
if (check_cost(200/efficiency)) return 0
|
||||
else new/obj/item/weapon/storage/bag/ore(src.loc)*/
|
||||
if("gloves")
|
||||
new/obj/item/clothing/gloves/botanic_leather(src.loc)
|
||||
if (check_cost(250/efficiency)) return 0
|
||||
else new/obj/item/clothing/gloves/botanic_leather(src.loc)
|
||||
if("tbelt")
|
||||
new/obj/item/weapon/storage/belt/utility(src.loc)
|
||||
if (check_cost(300/efficiency)) return 0
|
||||
else new/obj/item/weapon/storage/belt/utility(src.loc)
|
||||
if("satchel")
|
||||
new/obj/item/weapon/storage/backpack/satchel(src.loc)
|
||||
if (check_cost(400/efficiency)) return 0
|
||||
else new/obj/item/weapon/storage/backpack/satchel(src.loc)
|
||||
if("cashbag")
|
||||
new/obj/item/weapon/storage/bag/cash(src.loc)
|
||||
if("monkey")
|
||||
new/mob/living/carbon/monkey(src.loc)
|
||||
if (check_cost(400/efficiency)) return 0
|
||||
else new/obj/item/weapon/storage/bag/cash(src.loc)
|
||||
/*if("jacket")
|
||||
if (check_cost(500/efficiency)) return 0
|
||||
else new/obj/item/clothing/suit/jacket/leather(src.loc)*/
|
||||
//if("monkey")
|
||||
// if (check_cost(500)) return 0
|
||||
// else new/mob/living/carbon/monkey(src.loc)
|
||||
processing = 0
|
||||
menustat = "complete"
|
||||
update_icon()
|
||||
return 1
|
||||
|
||||
/obj/machinery/biogenerator/proc/detach()
|
||||
if(beaker)
|
||||
beaker.loc = src.loc
|
||||
beaker = null
|
||||
update_icon()
|
||||
|
||||
/obj/machinery/biogenerator/Topic(href, href_list)
|
||||
if(stat & BROKEN) return
|
||||
if(usr.stat || usr.restrained()) return
|
||||
if(!in_range(src, usr)) return
|
||||
if(..() || panel_open)
|
||||
return
|
||||
|
||||
usr.set_machine(src)
|
||||
|
||||
switch(href_list["action"])
|
||||
if("activate")
|
||||
activate()
|
||||
if("detach")
|
||||
if(beaker)
|
||||
beaker.loc = src.loc
|
||||
beaker = null
|
||||
update_icon()
|
||||
if("create")
|
||||
create_product(href_list["item"],text2num(href_list["cost"]))
|
||||
if("menu")
|
||||
menustat = "menu"
|
||||
updateUsrDialog()
|
||||
if(href_list["activate"])
|
||||
activate()
|
||||
updateUsrDialog()
|
||||
|
||||
else if(href_list["detach"])
|
||||
detach()
|
||||
updateUsrDialog()
|
||||
|
||||
else if(href_list["create"])
|
||||
var/amount = (text2num(href_list["amount"]))
|
||||
var/i = amount
|
||||
var/C = href_list["create"]
|
||||
if(i <= 0)
|
||||
return
|
||||
while(i >= 1)
|
||||
create_product(C)
|
||||
i--
|
||||
updateUsrDialog()
|
||||
|
||||
else if(href_list["menu"])
|
||||
menustat = "menu"
|
||||
updateUsrDialog()
|
||||
@@ -21,6 +21,8 @@
|
||||
var/attempting = 0 //One clone attempt at a time thanks
|
||||
var/eject_wait = 0 //Don't eject them as soon as they are created fuckkk
|
||||
var/biomass = CLONE_BIOMASS // * 3 - N3X
|
||||
var/speed_coeff
|
||||
var/efficiency
|
||||
|
||||
l_color = "#00FF00"
|
||||
power_change()
|
||||
@@ -30,7 +32,28 @@
|
||||
else
|
||||
SetLuminosity(0)
|
||||
|
||||
/obj/machinery/clonepod/New()
|
||||
..()
|
||||
component_parts = list()
|
||||
component_parts += new /obj/item/weapon/circuitboard/clonepod(src)
|
||||
component_parts += new /obj/item/weapon/stock_parts/scanning_module(src)
|
||||
component_parts += new /obj/item/weapon/stock_parts/scanning_module(src)
|
||||
component_parts += new /obj/item/weapon/stock_parts/manipulator(src)
|
||||
component_parts += new /obj/item/weapon/stock_parts/manipulator(src)
|
||||
component_parts += new /obj/item/weapon/stock_parts/console_screen(src)
|
||||
component_parts += new /obj/item/stack/cable_coil(src, 1)
|
||||
component_parts += new /obj/item/stack/cable_coil(src, 1)
|
||||
RefreshParts()
|
||||
|
||||
/obj/machinery/clonepod/RefreshParts()
|
||||
speed_coeff = 0
|
||||
efficiency = 0
|
||||
for(var/obj/item/weapon/stock_parts/scanning_module/S in component_parts)
|
||||
efficiency += S.rating
|
||||
for(var/obj/item/weapon/stock_parts/manipulator/P in component_parts)
|
||||
speed_coeff += P.rating
|
||||
heal_level = (efficiency * 15) + 10
|
||||
|
||||
//The return of data disks?? Just for transferring between genetics machine/cloning machine.
|
||||
//TO-DO: Make the genetics machine accept them.
|
||||
/obj/item/weapon/disk/data
|
||||
@@ -143,7 +166,7 @@
|
||||
|
||||
//Start growing a human clone in the pod!
|
||||
/obj/machinery/clonepod/proc/growclone(var/datum/dna2/record/R)
|
||||
if(mess || attempting)
|
||||
if(mess || attempting || panel_open)
|
||||
return 0
|
||||
var/datum/mind/clonemind = locate(R.mind)
|
||||
if(!istype(clonemind)) //not a mind
|
||||
@@ -165,7 +188,6 @@
|
||||
break
|
||||
return 0
|
||||
|
||||
src.heal_level = rand(10,40) //Randomizes what health the clone is when ejected
|
||||
src.attempting = 1 //One at a time!!
|
||||
src.locked = 1
|
||||
|
||||
@@ -182,8 +204,8 @@
|
||||
|
||||
src.icon_state = "pod_1"
|
||||
//Get the clone body ready
|
||||
H.adjustCloneLoss(150) //new damage var so you can't eject a clone early then stab them to abuse the current damage system --NeoFite
|
||||
H.adjustBrainLoss(src.heal_level + 50 + rand(10, 30)) // The rand(10, 30) will come out as extra brain damage
|
||||
H.adjustCloneLoss(190) //new damage var so you can't eject a clone early then stab them to abuse the current damage system --NeoFite
|
||||
H.adjustBrainLoss(190) // The rand(10, 30) will come out as extra brain damage
|
||||
H.Paralyse(4)
|
||||
|
||||
//Here let's calculate their health so the pod doesn't immediately eject them!!!
|
||||
@@ -217,7 +239,12 @@
|
||||
else
|
||||
H.dna=R.dna
|
||||
H.UpdateAppearance()
|
||||
randmutb(H) //Sometimes the clones come out wrong.
|
||||
if(efficiency > 2 && efficiency < 5 && prob(25))
|
||||
randmutb(H)
|
||||
if(efficiency > 5 && prob(20))
|
||||
randmutg(H)
|
||||
if(efficiency < 3 && prob(50))
|
||||
randmutb(H)
|
||||
H.dna.UpdateSE()
|
||||
H.dna.UpdateUI()
|
||||
|
||||
@@ -250,14 +277,14 @@
|
||||
src.connected_message("Clone Rejected: Deceased.")
|
||||
return
|
||||
|
||||
else if(src.occupant.health < src.heal_level)
|
||||
else if(src.occupant.cloneloss > (100 - src.heal_level))
|
||||
src.occupant.Paralyse(4)
|
||||
|
||||
//Slowly get that clone healed and finished.
|
||||
src.occupant.adjustCloneLoss(-2)
|
||||
src.occupant.adjustCloneLoss(-((speed_coeff/2)))
|
||||
|
||||
//Premature clones may have brain damage.
|
||||
src.occupant.adjustBrainLoss(-1)
|
||||
src.occupant.adjustBrainLoss(-((speed_coeff/2)))
|
||||
|
||||
//So clones don't die of oxyloss in a running pod.
|
||||
if (src.occupant.reagents.get_reagent_amount("inaprovaline") < 30)
|
||||
@@ -269,7 +296,7 @@
|
||||
use_power(7500) //This might need tweaking.
|
||||
return
|
||||
|
||||
else if((src.occupant.health >= src.heal_level) && (!src.eject_wait))
|
||||
else if((src.occupant.cloneloss <= (100 - src.heal_level)) && (!src.eject_wait))
|
||||
src.connected_message("Cloning Process Complete.")
|
||||
src.locked = 0
|
||||
src.go_out()
|
||||
@@ -279,7 +306,7 @@
|
||||
src.occupant = null
|
||||
if (src.locked)
|
||||
src.locked = 0
|
||||
if (!src.mess)
|
||||
if (!src.mess && !panel_open)
|
||||
icon_state = "pod_0"
|
||||
//use_power(200)
|
||||
return
|
||||
@@ -288,6 +315,20 @@
|
||||
|
||||
//Let's unlock this early I guess. Might be too early, needs tweaking.
|
||||
/obj/machinery/clonepod/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
if (istype(W, /obj/item/weapon/screwdriver))
|
||||
if(occupant || mess || locked)
|
||||
user << "<span class='notice'>The maintenance panel is locked.</span>"
|
||||
return
|
||||
default_deconstruction_screwdriver(user, "[icon_state]_maintenance", "[initial(icon_state)]", W)
|
||||
return
|
||||
|
||||
if(exchange_parts(user, W))
|
||||
return
|
||||
|
||||
if(istype(W, /obj/item/weapon/crowbar))
|
||||
if(panel_open)
|
||||
default_deconstruction_crowbar(W)
|
||||
return
|
||||
if (istype(W, /obj/item/weapon/card/id)||istype(W, /obj/item/device/pda))
|
||||
if (!src.check_access(W))
|
||||
user << "\red Access Denied."
|
||||
@@ -348,17 +389,16 @@
|
||||
set name = "Eject Cloner"
|
||||
set category = "Object"
|
||||
set src in oview(1)
|
||||
|
||||
|
||||
if(!usr)
|
||||
return
|
||||
if (usr.stat != 0)
|
||||
return
|
||||
src.go_out()
|
||||
src.go_out(usr)
|
||||
add_fingerprint(usr)
|
||||
return
|
||||
|
||||
/obj/machinery/clonepod/proc/go_out()
|
||||
if (src.locked)
|
||||
return
|
||||
|
||||
/obj/machinery/clonepod/proc/go_out(user)
|
||||
if (src.mess) //Clean that mess and dump those gibs!
|
||||
src.mess = 0
|
||||
gibs(src.loc)
|
||||
@@ -371,8 +411,12 @@
|
||||
return
|
||||
|
||||
if (!(src.occupant))
|
||||
user << "<span class=\"warning\">The cloning pod is empty!</span>"
|
||||
return
|
||||
|
||||
if (src.locked)
|
||||
user << "<span class=\"warning\">The cloning pod is locked!</span>"
|
||||
return
|
||||
/*
|
||||
for(var/obj/O in src)
|
||||
O.loc = src.loc
|
||||
@@ -409,7 +453,7 @@
|
||||
return
|
||||
|
||||
/obj/machinery/clonepod/emp_act(severity)
|
||||
if(prob(100/severity)) malfunction()
|
||||
if(prob(100/(severity*efficiency))) malfunction()
|
||||
..()
|
||||
|
||||
/obj/machinery/clonepod/ex_act(severity)
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
build_path = "/obj/machinery/computer/security"
|
||||
origin_tech = "programming=2"
|
||||
/obj/item/weapon/circuitboard/aicore
|
||||
name = "Circuit board (AI core)"
|
||||
name = "Circuit board (AI Core)"
|
||||
origin_tech = "programming=4;biotech=2"
|
||||
board_type = "other"
|
||||
/obj/item/weapon/circuitboard/aiupload
|
||||
@@ -62,7 +62,7 @@
|
||||
build_path = "/obj/machinery/computer/scan_consolenew"
|
||||
origin_tech = "programming=2;biotech=2"
|
||||
/obj/item/weapon/circuitboard/communications
|
||||
name = "Circuit board (Communications)"
|
||||
name = "Circuit board (Communications Console)"
|
||||
build_path = "/obj/machinery/computer/communications"
|
||||
origin_tech = "programming=2;magnets=2"
|
||||
/obj/item/weapon/circuitboard/card
|
||||
@@ -71,11 +71,8 @@
|
||||
/obj/item/weapon/circuitboard/card/centcom
|
||||
name = "Circuit board (CentCom ID Computer)"
|
||||
build_path = "/obj/machinery/computer/card/centcom"
|
||||
//obj/item/weapon/circuitboard/shield
|
||||
// name = "Circuit board (Shield Control)"
|
||||
// build_path = "/obj/machinery/computer/stationshield"
|
||||
/obj/item/weapon/circuitboard/teleporter
|
||||
name = "Circuit board (Teleporter)"
|
||||
name = "Circuit board (Teleporter Console)"
|
||||
build_path = "/obj/machinery/computer/teleporter"
|
||||
origin_tech = "programming=2;bluespace=2"
|
||||
/obj/item/weapon/circuitboard/secure_data
|
||||
@@ -88,22 +85,22 @@
|
||||
name = "Circuit board (Station Alerts)"
|
||||
build_path = "/obj/machinery/computer/station_alert"
|
||||
/obj/item/weapon/circuitboard/atmospheresiphonswitch
|
||||
name = "Circuit board (Atmosphere siphon control)"
|
||||
name = "Circuit board (Atmosphere Siphon control)"
|
||||
build_path = "/obj/machinery/computer/atmosphere/siphonswitch"
|
||||
/obj/item/weapon/circuitboard/air_management
|
||||
name = "Circuit board (Atmospheric monitor)"
|
||||
name = "Circuit board (Atmospheric Monitor)"
|
||||
build_path = "/obj/machinery/computer/general_air_control"
|
||||
/obj/item/weapon/circuitboard/injector_control
|
||||
name = "Circuit board (Injector control)"
|
||||
name = "Circuit board (Injector Control)"
|
||||
build_path = "/obj/machinery/computer/general_air_control/fuel_injection"
|
||||
/obj/item/weapon/circuitboard/atmos_alert
|
||||
name = "Circuit board (Atmospheric Alert)"
|
||||
build_path = "/obj/machinery/computer/atmos_alert"
|
||||
/obj/item/weapon/circuitboard/pod
|
||||
name = "Circuit board (Massdriver control)"
|
||||
name = "Circuit board (Massdriver Control)"
|
||||
build_path = "/obj/machinery/computer/pod"
|
||||
/obj/item/weapon/circuitboard/robotics
|
||||
name = "Circuit board (Robotics Control)"
|
||||
name = "Circuit board (Robotics Control Console)"
|
||||
build_path = "/obj/machinery/computer/robotics"
|
||||
origin_tech = "programming=3"
|
||||
/obj/item/weapon/circuitboard/drone_control
|
||||
@@ -111,7 +108,7 @@
|
||||
build_path = "/obj/machinery/computer/drone_control"
|
||||
origin_tech = "programming=3"
|
||||
/obj/item/weapon/circuitboard/cloning
|
||||
name = "Circuit board (Cloning)"
|
||||
name = "Circuit board (Cloning Machine Console)"
|
||||
build_path = "/obj/machinery/computer/cloning"
|
||||
origin_tech = "programming=3;biotech=3"
|
||||
/obj/item/weapon/circuitboard/arcade/battle
|
||||
@@ -119,18 +116,18 @@
|
||||
build_path = "/obj/machinery/computer/arcade/battle"
|
||||
origin_tech = "programming=1"
|
||||
/obj/item/weapon/circuitboard/arcade/orion_trail
|
||||
name = "circuit board (Orion_Trail)"
|
||||
name = "circuit board (Orion Trail)"
|
||||
build_path = "/obj/machinery/computer/arcade/orion_trail"
|
||||
origin_tech = "programming=2"
|
||||
/obj/item/weapon/circuitboard/turbine_control
|
||||
name = "Circuit board (Turbine control)"
|
||||
name = "Circuit board (Turbine Control)"
|
||||
build_path = "/obj/machinery/computer/turbine_computer"
|
||||
/obj/item/weapon/circuitboard/solar_control
|
||||
name = "Circuit board (Solar Control)" //name fixed 250810
|
||||
name = "Circuit board (Solar Control)"
|
||||
build_path = "/obj/machinery/power/solar_control"
|
||||
origin_tech = "programming=2;powerstorage=2"
|
||||
/obj/item/weapon/circuitboard/powermonitor
|
||||
name = "Circuit board (Power Monitor)" //name fixed 250810
|
||||
name = "Circuit board (Power Monitor)"
|
||||
build_path = "/obj/machinery/power/monitor"
|
||||
/obj/item/weapon/circuitboard/olddoor
|
||||
name = "Circuit board (DoorMex)"
|
||||
@@ -151,10 +148,10 @@
|
||||
name = "Circuit Board (Exosuit Control Console)"
|
||||
build_path = "/obj/machinery/computer/mecha"
|
||||
/obj/item/weapon/circuitboard/rdservercontrol
|
||||
name = "Circuit Board (R&D Server Control)"
|
||||
name = "Circuit Board (RD Server Control)"
|
||||
build_path = "/obj/machinery/computer/rdservercontrol"
|
||||
/obj/item/weapon/circuitboard/crew
|
||||
name = "Circuit board (Crew monitoring computer)"
|
||||
name = "Circuit board (Crew Monitoring Computer)"
|
||||
build_path = "/obj/machinery/computer/crew"
|
||||
origin_tech = "programming=3;biotech=2;magnets=2"
|
||||
/obj/item/weapon/circuitboard/mech_bay_power_console
|
||||
@@ -162,11 +159,11 @@
|
||||
build_path = "/obj/machinery/computer/mech_bay_power_console"
|
||||
origin_tech = "programming=2;powerstorage=3"
|
||||
/obj/item/weapon/circuitboard/ordercomp
|
||||
name = "Circuit board (Supply ordering console)"
|
||||
name = "Circuit board (Supply Ordering Console)"
|
||||
build_path = "/obj/machinery/computer/ordercomp"
|
||||
origin_tech = "programming=2"
|
||||
/obj/item/weapon/circuitboard/supplycomp
|
||||
name = "Circuit board (Supply shuttle console)"
|
||||
name = "Circuit board (Supply Shuttle Console)"
|
||||
build_path = "/obj/machinery/computer/supplycomp"
|
||||
origin_tech = "programming=3"
|
||||
var/contraband_enabled = 0
|
||||
@@ -189,7 +186,7 @@
|
||||
origin_tech = "programming=3"
|
||||
|
||||
/obj/item/weapon/circuitboard/curefab
|
||||
name = "Circuit board (Cure fab)"
|
||||
name = "Circuit board (Cure Fabricator)"
|
||||
build_path = "/obj/machinery/computer/curer"
|
||||
/obj/item/weapon/circuitboard/splicer
|
||||
name = "Circuit board (Disease Splicer)"
|
||||
@@ -206,7 +203,7 @@
|
||||
name = "Circuit board (Research Shuttle)"
|
||||
build_path = "/obj/machinery/computer/shuttle_control/research"
|
||||
origin_tech = "programming=2"
|
||||
/obj/item/weapon/circuitboard/HolodeckControl // Not going to let people get this, but it's just here for future
|
||||
/obj/item/weapon/circuitboard/HolodeckControl
|
||||
name = "Circuit board (Holodeck Control)"
|
||||
build_path = "/obj/machinery/computer/HolodeckControl"
|
||||
origin_tech = "programming=4"
|
||||
@@ -222,6 +219,10 @@
|
||||
name = "Circuit board (Prison Shuttle)"
|
||||
build_path = "/obj/machinery/computer/prison_shuttle"
|
||||
origin_tech = "programming=2"
|
||||
/obj/item/weapon/circuitboard/telesci_console
|
||||
name = "Circuit board (Telepad Control Console)"
|
||||
build_path = "/obj/machinery/computer/telescience"
|
||||
origin_tech = "programming=3;bluespace=2"
|
||||
|
||||
/obj/item/weapon/circuitboard/HONKputer
|
||||
name = "Circuit board (HONKputer)"
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/obj/machinery/computer/cloning
|
||||
name = "Cloning console"
|
||||
name = "Cloning Console"
|
||||
icon = 'icons/obj/computer.dmi'
|
||||
icon_state = "dna"
|
||||
circuit = "/obj/item/weapon/circuitboard/cloning"
|
||||
@@ -7,12 +7,14 @@
|
||||
var/obj/machinery/dna_scannernew/scanner = null //Linked scanner. For scanning.
|
||||
var/obj/machinery/clonepod/pod1 = null //Linked cloning pod.
|
||||
var/temp = ""
|
||||
var/scantemp = "Scanner unoccupied"
|
||||
var/scantemp = "Scanner ready."
|
||||
var/menu = 1 //Which menu screen to display
|
||||
var/list/records = list()
|
||||
var/datum/dna2/record/active_record = null
|
||||
var/obj/item/weapon/disk/data/diskette = null //Mostly so the geneticist can steal everything.
|
||||
var/loading = 0 // Nice loading text
|
||||
var/autoprocess = 0
|
||||
var/data[0]
|
||||
|
||||
l_color = "#0000FF"
|
||||
|
||||
@@ -23,6 +25,19 @@
|
||||
return
|
||||
return
|
||||
|
||||
/obj/machinery/computer/cloning/process()
|
||||
if(!(scanner && pod1 && autoprocess))
|
||||
return
|
||||
|
||||
if(scanner.occupant && (scanner.scan_level > 2))
|
||||
scan_mob(scanner.occupant)
|
||||
|
||||
if(!(pod1.occupant || pod1.mess) && (pod1.efficiency > 5))
|
||||
for(var/datum/dna2/record/R in src.records)
|
||||
if(!(pod1.occupant || pod1.mess))
|
||||
if(pod1.growclone(R))
|
||||
records.Remove(R)
|
||||
|
||||
/obj/machinery/computer/cloning/proc/updatemodules()
|
||||
src.scanner = findscanner()
|
||||
src.pod1 = findcloner()
|
||||
@@ -65,7 +80,7 @@
|
||||
W.loc = src
|
||||
src.diskette = W
|
||||
user << "You insert [W]."
|
||||
src.updateUsrDialog()
|
||||
nanomanager.update_uis(src)
|
||||
return
|
||||
else
|
||||
..()
|
||||
@@ -85,118 +100,58 @@
|
||||
return
|
||||
|
||||
updatemodules()
|
||||
ui_interact(user)
|
||||
|
||||
var/dat = "<h3>Cloning System Control</h3>"
|
||||
dat += "<font size=-1><a href='byond://?src=\ref[src];refresh=1'>Refresh</a></font>"
|
||||
/obj/machinery/computer/cloning/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1)
|
||||
if(..())
|
||||
return
|
||||
if(stat & (NOPOWER|BROKEN))
|
||||
return
|
||||
|
||||
dat += "<br><tt>[temp]</tt><br>"
|
||||
|
||||
switch(src.menu)
|
||||
if(1)
|
||||
// Modules
|
||||
dat += "<h4>Modules</h4>"
|
||||
//dat += "<a href='byond://?src=\ref[src];relmodules=1'>Reload Modules</a>"
|
||||
if (isnull(src.scanner))
|
||||
dat += " <font color=red>Scanner-ERROR</font><br>"
|
||||
else
|
||||
dat += " <font color=green>Scanner-Found!</font><br>"
|
||||
if (isnull(src.pod1))
|
||||
dat += " <font color=red>Pod-ERROR</font><br>"
|
||||
else
|
||||
dat += " <font color=green>Pod-Found!</font><br>"
|
||||
|
||||
// Scanner
|
||||
dat += "<h4>Scanner Functions</h4>"
|
||||
|
||||
if(loading)
|
||||
dat += "<b>Scanning...</b><br>"
|
||||
else
|
||||
dat += "<b>[scantemp]</b><br>"
|
||||
|
||||
if (isnull(src.scanner))
|
||||
dat += "No scanner connected!<br>"
|
||||
else
|
||||
if (src.scanner.occupant)
|
||||
if(scantemp == "Scanner unoccupied") scantemp = "" // Stupid check to remove the text
|
||||
|
||||
dat += "<a href='byond://?src=\ref[src];scan=1'>Scan - [src.scanner.occupant]</a><br>"
|
||||
else
|
||||
scantemp = "Scanner unoccupied"
|
||||
|
||||
dat += "Lock status: <a href='byond://?src=\ref[src];lock=1'>[src.scanner.locked ? "Locked" : "Unlocked"]</a><br>"
|
||||
|
||||
if (!isnull(src.pod1))
|
||||
dat += "Biomass: <i>[src.pod1.biomass]</i><br>"
|
||||
|
||||
// Database
|
||||
dat += "<h4>Database Functions</h4>"
|
||||
dat += "<a href='byond://?src=\ref[src];menu=2'>View Records</a><br>"
|
||||
if (src.diskette)
|
||||
dat += "<a href='byond://?src=\ref[src];disk=eject'>Eject Disk</a>"
|
||||
|
||||
|
||||
if(2)
|
||||
|
||||
// AUTOFIXED BY fix_string_idiocy.py
|
||||
// C:\Users\Rob\Documents\Projects\vgstation13\code\game\machinery\computer\cloning.dm:217: dat += "<h4>Current records</h4>"
|
||||
dat += {"<h4>Current records</h4>
|
||||
<a href='byond://?src=\ref[src];menu=1'>Back</a><br><ul>"}
|
||||
// END AUTOFIX
|
||||
for(var/datum/dna2/record/R in src.records)
|
||||
dat += "<li><a href='byond://?src=\ref[src];view_rec=\ref[R]'>[R.dna.real_name]</a><li>"
|
||||
|
||||
if(3)
|
||||
dat += "<h4>Selected Record</h4>"
|
||||
dat += "<a href='byond://?src=\ref[src];menu=2'>Back</a><br>"
|
||||
|
||||
if (!src.active_record)
|
||||
dat += "<font color=red>ERROR: Record not found.</font>"
|
||||
else
|
||||
// AUTOFIXED BY fix_string_idiocy.py
|
||||
// C:\Users\Rob\Documents\Projects\vgstation13\code\game\machinery\computer\cloning.dm:229: dat += "<br><font size=1><a href='byond://?src=\ref[src];del_rec=1'>Delete Record</a></font><br>"
|
||||
dat += {"<br><font size=1><a href='byond://?src=\ref[src];del_rec=1'>Delete Record</a></font><br>
|
||||
<b>Name:</b> [src.active_record.dna.real_name]<br>"}
|
||||
// END AUTOFIX
|
||||
var/obj/item/weapon/implant/health/H = null
|
||||
if(src.active_record.implant)
|
||||
H=locate(src.active_record.implant)
|
||||
|
||||
if ((H) && (istype(H)))
|
||||
dat += "<b>Health:</b> [H.sensehealth()] | OXY-BURN-TOX-BRUTE<br>"
|
||||
else
|
||||
dat += "<font color=red>Unable to locate implant.</font><br>"
|
||||
|
||||
if (!isnull(src.diskette))
|
||||
dat += "<a href='byond://?src=\ref[src];disk=load'>Load from disk.</a>"
|
||||
|
||||
dat += " | Save: <a href='byond://?src=\ref[src];save_disk=ue'>UI + UE</a>"
|
||||
dat += " | Save: <a href='byond://?src=\ref[src];save_disk=ui'>UI</a>"
|
||||
dat += " | Save: <a href='byond://?src=\ref[src];save_disk=se'>SE</a>"
|
||||
dat += "<br>"
|
||||
else
|
||||
dat += "<br>" //Keeping a line empty for appearances I guess.
|
||||
|
||||
dat += {"<b>UI:</b> [src.active_record.dna.uni_identity]<br>
|
||||
<b>SE:</b> [src.active_record.dna.struc_enzymes]<br><br>"}
|
||||
|
||||
if(pod1 && pod1.biomass >= CLONE_BIOMASS)
|
||||
dat += {"<a href='byond://?src=\ref[src];clone=\ref[src.active_record]'>Clone</a><br>"}
|
||||
else
|
||||
dat += {"<b>Unsufficient biomass</b><br>"}
|
||||
|
||||
if(4)
|
||||
if (!src.active_record)
|
||||
src.menu = 2
|
||||
dat = "[src.temp]<br>"
|
||||
dat += "<h4>Confirm Record Deletion</h4>"
|
||||
|
||||
dat += "<b><a href='byond://?src=\ref[src];del_rec=1'>Scan card to confirm.</a></b><br>"
|
||||
dat += "<b><a href='byond://?src=\ref[src];menu=3'>No</a></b>"
|
||||
|
||||
|
||||
user << browse(dat, "window=cloning")
|
||||
onclose(user, "cloning")
|
||||
return
|
||||
data["menu"] = src.menu
|
||||
data["scanner"] = src.scanner
|
||||
data["pod"] = src.pod1
|
||||
data["loading"] = loading
|
||||
data["autoprocess"] = autoprocess
|
||||
if(scanner && pod1 && ((scanner.scan_level > 2) || (pod1.efficiency > 5)))
|
||||
data["autoallowed"] = 1
|
||||
else
|
||||
data["autoallowed"] = 0
|
||||
data["occupant"] = src.scanner.occupant
|
||||
data["locked"] = src.scanner.locked
|
||||
data["biomass"] = src.pod1.biomass
|
||||
data["temp"] = temp
|
||||
data["scantemp"] = scantemp
|
||||
data["disk"] = src.diskette
|
||||
var/list/temprecords[0]
|
||||
for(var/datum/dna2/record/R in src.records)
|
||||
var tempRealName = R.dna.real_name
|
||||
temprecords.Add(list(list("record" = "\ref[R]", "realname" = tempRealName)))
|
||||
data["records"] = temprecords
|
||||
|
||||
if(src.menu == 3)
|
||||
if (src.active_record)
|
||||
data["activerecord"] = "\ref[src.active_record]"
|
||||
var/obj/item/weapon/implant/health/H = null
|
||||
if(src.active_record.implant)
|
||||
H = locate(src.active_record.implant)
|
||||
|
||||
if ((H) && (istype(H)))
|
||||
data["health"] = H.sensehealth()
|
||||
data["realname"] = src.active_record.dna.real_name
|
||||
data["unidentity"] = src.active_record.dna.uni_identity
|
||||
data["strucenzymes"] = src.active_record.dna.struc_enzymes
|
||||
if(pod1 && pod1.biomass >= CLONE_BIOMASS)
|
||||
data["enoughbiomass"] = 1
|
||||
else
|
||||
data["enougbiomass"] = 0
|
||||
|
||||
// Set up the Nano UI
|
||||
ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
|
||||
if (!ui)
|
||||
ui = new(user, src, ui_key, "cloning_console.tmpl", "Cloning Console UI", 640, 480)
|
||||
ui.set_initial_data(data)
|
||||
ui.open()
|
||||
|
||||
/obj/machinery/computer/cloning/Topic(href, href_list)
|
||||
if(..())
|
||||
@@ -206,42 +161,52 @@
|
||||
return
|
||||
|
||||
if ((href_list["scan"]) && (!isnull(src.scanner)))
|
||||
scantemp = ""
|
||||
scantemp = "Scanner ready."
|
||||
|
||||
loading = 1
|
||||
src.updateUsrDialog()
|
||||
nanomanager.update_uis(src)
|
||||
|
||||
spawn(20)
|
||||
src.scan_mob(src.scanner.occupant)
|
||||
|
||||
loading = 0
|
||||
src.updateUsrDialog()
|
||||
nanomanager.update_uis(src)
|
||||
|
||||
if(href_list["task"])
|
||||
switch(href_list["task"])
|
||||
if("autoprocess")
|
||||
autoprocess = 1
|
||||
nanomanager.update_uis(src)
|
||||
if("stopautoprocess")
|
||||
autoprocess = 0
|
||||
nanomanager.update_uis(src)
|
||||
|
||||
//No locking an open scanner.
|
||||
//No locking an open scanner.
|
||||
else if ((href_list["lock"]) && (!isnull(src.scanner)))
|
||||
if ((!src.scanner.locked) && (src.scanner.occupant))
|
||||
src.scanner.locked = 1
|
||||
else
|
||||
src.scanner.locked = 0
|
||||
nanomanager.update_uis(src)
|
||||
|
||||
else if (href_list["view_rec"])
|
||||
src.active_record = locate(href_list["view_rec"])
|
||||
if(istype(src.active_record,/datum/dna2/record))
|
||||
if ((isnull(src.active_record.ckey)))
|
||||
del(src.active_record)
|
||||
src.temp = "ERROR: Record Corrupt"
|
||||
src.temp = "<span class=\"bad\">Error: Record corrupt.</span>"
|
||||
else
|
||||
src.menu = 3
|
||||
else
|
||||
src.active_record = null
|
||||
src.temp = "Record missing."
|
||||
src.temp = "<span class=\"bad\">Error: Record missing.</span>"
|
||||
nanomanager.update_uis(src)
|
||||
|
||||
else if (href_list["del_rec"])
|
||||
if ((!src.active_record) || (src.menu < 3))
|
||||
return
|
||||
if (src.menu == 3) //If we are viewing a record, confirm deletion
|
||||
src.temp = "Delete record?"
|
||||
src.temp = "Please confirm that you want to delete the record?"
|
||||
src.menu = 4
|
||||
|
||||
else if (src.menu == 4)
|
||||
@@ -253,33 +218,36 @@
|
||||
src.temp = "Record deleted."
|
||||
src.menu = 2
|
||||
else
|
||||
src.temp = "Access Denied."
|
||||
src.temp = "<span class=\"bad\">Error: Access denied.</span>"
|
||||
nanomanager.update_uis(src)
|
||||
|
||||
else if (href_list["disk"]) //Load or eject.
|
||||
switch(href_list["disk"])
|
||||
if("load")
|
||||
if ((isnull(src.diskette)) || isnull(src.diskette.buf))
|
||||
src.temp = "Load error."
|
||||
src.updateUsrDialog()
|
||||
src.temp = "<span class=\"bad\">Error: The disk's data could not be read.</span>"
|
||||
nanomanager.update_uis(src)
|
||||
return
|
||||
if (isnull(src.active_record))
|
||||
src.temp = "Record error."
|
||||
src.temp = "<span class=\"bad\">Error: No active record was found.</span>"
|
||||
src.menu = 1
|
||||
src.updateUsrDialog()
|
||||
nanomanager.update_uis(src)
|
||||
return
|
||||
|
||||
src.active_record = src.diskette.buf
|
||||
|
||||
src.temp = "Load successful."
|
||||
nanomanager.update_uis(src)
|
||||
if("eject")
|
||||
if (!isnull(src.diskette))
|
||||
src.diskette.loc = src.loc
|
||||
src.diskette = null
|
||||
nanomanager.update_uis(src)
|
||||
|
||||
else if (href_list["save_disk"]) //Save to disk!
|
||||
if ((isnull(src.diskette)) || (src.diskette.read_only) || (isnull(src.active_record)))
|
||||
src.temp = "Save error."
|
||||
src.updateUsrDialog()
|
||||
src.temp = "<span class=\"bad\">Error: The data could not be saved.</span>"
|
||||
nanomanager.update_uis(src)
|
||||
return
|
||||
|
||||
// DNA2 makes things a little simpler.
|
||||
@@ -294,33 +262,32 @@
|
||||
src.diskette.buf.types=DNA2_BUF_SE
|
||||
src.diskette.name = "data disk - '[src.active_record.dna.real_name]'"
|
||||
src.temp = "Save \[[href_list["save_disk"]]\] successful."
|
||||
nanomanager.update_uis(src)
|
||||
|
||||
else if (href_list["refresh"])
|
||||
src.updateUsrDialog()
|
||||
nanomanager.update_uis(src)
|
||||
|
||||
else if (href_list["clone"])
|
||||
else if (href_list["clone"])
|
||||
var/datum/dna2/record/C = locate(href_list["clone"])
|
||||
//Look for that player! They better be dead!
|
||||
if(istype(C))
|
||||
if(C)
|
||||
//Can't clone without someone to clone. Or a pod. Or if the pod is busy. Or full of gibs.
|
||||
if(!pod1)
|
||||
temp = "Error: No Clonepod detected."
|
||||
temp = "<span class=\"bad\">Error: No cloning pod detected.</span>"
|
||||
else if(pod1.occupant)
|
||||
temp = "Error: Clonepod is currently occupied."
|
||||
temp = "<span class=\"bad\">Error: The cloning pod is currently occupied.</span>"
|
||||
else if(pod1.biomass < CLONE_BIOMASS)
|
||||
temp = "Error: Not enough biomass."
|
||||
temp = "<span class=\"bad\">Error: Not enough biomass.</span>"
|
||||
else if(pod1.mess)
|
||||
temp = "Error: Clonepod malfunction."
|
||||
temp = "<span class=\"bad\">Error: The cloning pod is malfunctioning.</span>"
|
||||
else if(!config.revival_cloning)
|
||||
temp = "Error: Unable to initiate cloning cycle."
|
||||
|
||||
temp = "<span class=\"bad\">Error: Unable to initiate cloning cycle.</span>"
|
||||
else if(pod1.growclone(C))
|
||||
temp = "Initiating cloning cycle..."
|
||||
records.Remove(C)
|
||||
del(C)
|
||||
menu = 1
|
||||
else
|
||||
|
||||
var/mob/selected = find_dead_player("[C.ckey]")
|
||||
selected << 'sound/machines/chime.ogg' //probably not the best sound but I think it's reasonable
|
||||
var/answer = alert(selected,"Do you want to return to life?","Cloning","Yes","No")
|
||||
@@ -330,36 +297,45 @@
|
||||
del(C)
|
||||
menu = 1
|
||||
else
|
||||
temp = "Initiating cloning cycle...<br>Error: Post-initialisation failed. Cloning cycle aborted."
|
||||
temp = "Initiating cloning cycle...<br /><span class=\"bad\">Error: Post-initialisation failed. Cloning cycle aborted.</span>"
|
||||
|
||||
else
|
||||
temp = "Error: Data corruption."
|
||||
temp = "<span class=\"bad\">Error: Data corruption.</span>"
|
||||
nanomanager.update_uis(src)
|
||||
|
||||
else if (href_list["menu"])
|
||||
src.menu = text2num(href_list["menu"])
|
||||
temp = ""
|
||||
scantemp = "Scanner ready."
|
||||
|
||||
src.add_fingerprint(usr)
|
||||
src.updateUsrDialog()
|
||||
nanomanager.update_uis(src)
|
||||
return
|
||||
|
||||
/obj/machinery/computer/cloning/proc/scan_mob(mob/living/carbon/human/subject as mob)
|
||||
if ((isnull(subject)) || (!(ishuman(subject))) || (!subject.dna) || (subject.species.flags & NO_SCAN))
|
||||
scantemp = "Error: Unable to locate valid genetic data."
|
||||
scantemp = "<span class=\"bad\">Error: Unable to locate valid genetic data.</span>"
|
||||
nanomanager.update_uis(src)
|
||||
return
|
||||
if (subject.brain_op_stage == 4.0)
|
||||
scantemp = "Error: No signs of intelligence detected."
|
||||
scantemp = "<span class=\"bad\">Error: No signs of intelligence detected.</span>"
|
||||
nanomanager.update_uis(src)
|
||||
return
|
||||
if (subject.suiciding == 1)
|
||||
scantemp = "Error: Subject's brain is not responding to scanning stimuli."
|
||||
if (subject.suiciding == 1 && src.scanner.scan_level < 2)
|
||||
scantemp = "<span class=\"bad\">Error: Subject's brain is not responding to scanning stimuli.</span>"
|
||||
nanomanager.update_uis(src)
|
||||
return
|
||||
if ((!subject.ckey) || (!subject.client))
|
||||
scantemp = "Error: Mental interface failure."
|
||||
scantemp = "<span class=\"bad\">Error: Mental interface failure.</span>"
|
||||
nanomanager.update_uis(src)
|
||||
return
|
||||
if (M_NOCLONE in subject.mutations)
|
||||
scantemp = "Error: Mental interface failure."
|
||||
if ((M_NOCLONE in subject.mutations) && src.scanner.scan_level < 2)
|
||||
scantemp = "<span class=\"bad\">Error: Mental interface failure.</span>"
|
||||
nanomanager.update_uis(src)
|
||||
return
|
||||
if (!isnull(find_record(subject.ckey)))
|
||||
scantemp = "Subject already in database."
|
||||
nanomanager.update_uis(src)
|
||||
return
|
||||
|
||||
subject.dna.check_integrity()
|
||||
@@ -387,6 +363,7 @@
|
||||
|
||||
src.records += R
|
||||
scantemp = "Subject successfully scanned."
|
||||
nanomanager.update_uis(src)
|
||||
|
||||
//Find a specific record by key.
|
||||
/obj/machinery/computer/cloning/proc/find_record(var/find_key)
|
||||
|
||||
@@ -2,8 +2,7 @@
|
||||
name = "Telepad Control Console"
|
||||
desc = "Used to teleport objects to and from the telescience telepad."
|
||||
icon_state = "teleport-sci"
|
||||
|
||||
// VARIABLES //
|
||||
circuit = "/obj/item/weapon/circuitboard/telesci_console"
|
||||
var/teles_left // How many teleports left until it becomes uncalibrated
|
||||
var/x_off // X offset
|
||||
var/y_off // Y offset
|
||||
@@ -12,8 +11,10 @@
|
||||
var/z_co // Z coordinate
|
||||
var/trueX // X + offset
|
||||
var/trueY // Y + offset
|
||||
var/obj/machinery/telepad
|
||||
var/obj/machinery/telepad/telepad
|
||||
var/tele_id = "Telesci"
|
||||
var/obj/item/device/sps/inserted_sps
|
||||
var/last_target
|
||||
|
||||
/obj/machinery/computer/telescience/update_icon()
|
||||
if(stat & BROKEN)
|
||||
@@ -25,6 +26,12 @@
|
||||
else
|
||||
icon_state = initial(icon_state)
|
||||
stat &= ~NOPOWER
|
||||
|
||||
/obj/machinery/computer/telescience/Destroy()
|
||||
if(inserted_sps)
|
||||
inserted_sps.loc = loc
|
||||
inserted_sps = null
|
||||
..()
|
||||
|
||||
/obj/machinery/computer/telescience/attack_paw(mob/user)
|
||||
usr << "You are too primitive to use this computer."
|
||||
@@ -54,11 +61,12 @@
|
||||
data["coordx"] = x_co
|
||||
data["coordy"] = y_co
|
||||
data["coordz"] = z_co
|
||||
data["sps"] = inserted_sps
|
||||
|
||||
// Set up the Nano UI
|
||||
ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
|
||||
if (!ui)
|
||||
ui = new(user, src, ui_key, "telescience_console.tmpl", "Telescience Console UI", 640, 480)
|
||||
ui = new(user, src, ui_key, "telescience_console.tmpl", "Telescience Console UI", 640, 300)
|
||||
ui.set_initial_data(data)
|
||||
ui.open()
|
||||
|
||||
@@ -110,7 +118,10 @@
|
||||
|
||||
/obj/machinery/computer/telescience/proc/teleprep(var/type)
|
||||
if(!telepad)
|
||||
usr << "\red Error: no associated telepad. Please recalibrate and try again."
|
||||
usr << "\red Error: No associated telepad. Please recalibrate and try again."
|
||||
return
|
||||
if(telepad.panel_open)
|
||||
usr << "\red Error: The telepad can not be used while in maintenance mode."
|
||||
return
|
||||
var/numpick
|
||||
var/failure = checkFail()
|
||||
@@ -119,7 +130,7 @@
|
||||
telefail(numpick)
|
||||
return
|
||||
if(teles_left > 0)
|
||||
if(prob(75))
|
||||
if(prob(70 + (5 * telepad.efficiency)))
|
||||
teles_left -= 1
|
||||
tele(type)
|
||||
if(teles_left == 0)
|
||||
@@ -127,7 +138,7 @@
|
||||
O.show_message("\red The telepad has become uncalibrated.", 2)
|
||||
return
|
||||
else
|
||||
if(prob(35))
|
||||
if(prob(25 + (10 * telepad.efficiency)))
|
||||
tele(type)
|
||||
else
|
||||
numpick = pick(1,1,1,2,2,3,4)
|
||||
@@ -142,6 +153,7 @@
|
||||
trueX = (x_co + x_off)
|
||||
trueY = (y_co + y_off)
|
||||
var/target = locate(trueX, trueY, z_co)
|
||||
last_target = target
|
||||
var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread
|
||||
s.set_up(5, 1, tele)
|
||||
s.start()
|
||||
@@ -187,32 +199,50 @@
|
||||
if(x_co == "" || x_co == "Unset")
|
||||
usr << "\red Error: set X coordinate."
|
||||
fail = 1
|
||||
return fail
|
||||
if(y_co == "" || y_co == "Unset")
|
||||
usr << "\red Error: set Y coordinate."
|
||||
fail = 1
|
||||
return fail
|
||||
if(z_co == "" || z_co == "Unset")
|
||||
usr << "\red Error: set Z coordinate."
|
||||
fail = 1
|
||||
return fail
|
||||
if(x_co < 11 || x_co > 245)
|
||||
usr << "\red Error: X is less than 11 or greater than 245."
|
||||
fail = 1
|
||||
return fail
|
||||
if(y_co < 11 || y_co > 245)
|
||||
usr << "\red Error: Y is less than 11 or greater than 245."
|
||||
fail = 1
|
||||
return fail
|
||||
if(z_co == 2 || z_co < 1 || z_co > 6)
|
||||
if (z_co == 7 & src.emagged == 1)
|
||||
// This should be empty, allows for it to continue if the z-level is 7 and the machine is emagged.
|
||||
else
|
||||
usr << "\red Error: Z is less than 1, greater than [src.emagged ? "7" : "6"], or equal to 2."
|
||||
fail = 1
|
||||
return fail
|
||||
if(istype(get_area(locate(x_co,y_co,z_co)), /area/security/armoury/gamma))
|
||||
usr << "\red Error: Attempting to access telescience-protected area."
|
||||
fail = 1
|
||||
return fail
|
||||
return fail
|
||||
|
||||
/obj/machinery/computer/telescience/Topic(href, href_list)
|
||||
if(..())
|
||||
return
|
||||
if(href_list["ejectSPS"])
|
||||
inserted_sps.loc = loc
|
||||
inserted_sps = null
|
||||
nanomanager.update_uis(src)
|
||||
if(href_list["setMemory"])
|
||||
if(last_target)
|
||||
inserted_sps.locked_location = last_target
|
||||
usr << "\blue Location saved."
|
||||
else
|
||||
usr << "\red Error: No data stored."
|
||||
nanomanager.update_uis(src)
|
||||
if(href_list["setx"])
|
||||
var/a = input("Please input desired X coordinate.", name, x_co) as num
|
||||
a = copytext(sanitize(a), 1, 20)
|
||||
@@ -247,6 +277,8 @@
|
||||
for(var/obj/machinery/telepad/T in range(src,10))
|
||||
telepad = T
|
||||
if(!telepad)
|
||||
usr << "\red Error: No telepads in range were found."
|
||||
nanomanager.update_uis(src)
|
||||
return
|
||||
var/teleturf = get_turf(telepad)
|
||||
teles_left = rand(8,12)
|
||||
@@ -259,12 +291,25 @@
|
||||
nanomanager.update_uis(src)
|
||||
return
|
||||
|
||||
/obj/machinery/computer/telescience/attackby(I as obj, user as mob) // Emagging
|
||||
/obj/machinery/computer/telescience/attackby(I as obj, var/mob/user as mob) // Emagging
|
||||
if(istype(I,/obj/item/weapon/card/emag))
|
||||
if (src.emagged == 0)
|
||||
user << "\blue You scramble the Telescience authentication key to an unknown signal. You should be able to teleport to more places now!"
|
||||
src.emagged = 1
|
||||
else
|
||||
user << "\red The machine seems unaffected by the card swipe..."
|
||||
else if(istype(I, /obj/item/device/sps))
|
||||
if(!inserted_sps)
|
||||
inserted_sps = I
|
||||
user.before_take_item(I)
|
||||
inserted_sps.loc = src
|
||||
user.visible_message("<span class='notice'>You insert [I] into the SPS device slot.</span>")
|
||||
attack_hand(user)
|
||||
else if(istype(I, /obj/item/device/multitool))
|
||||
var/obj/item/device/multitool/M = I
|
||||
if(M.buffer && istype(M.buffer, /obj/machinery/telepad))
|
||||
telepad = M.buffer
|
||||
M.buffer = null
|
||||
user << "<span class='caution'>You upload the data from [I]'s buffer.</span>"
|
||||
else
|
||||
return attack_hand(user)
|
||||
..()
|
||||
@@ -10,247 +10,271 @@
|
||||
var/obj/item/weapon/circuitboard/circuit = null
|
||||
var/list/components = null
|
||||
var/list/req_components = null
|
||||
var/list/req_component_names = null
|
||||
var/list/req_component_names = null // user-friendly names of components
|
||||
var/state = 1
|
||||
|
||||
// For pods
|
||||
var/list/connected_parts = list()
|
||||
var/pattern_idx=0
|
||||
// unfortunately, we have to instance the objects really quickly to get the names
|
||||
// fortunately, this is only called once when the board is added and the items are immediately GC'd
|
||||
// and none of the parts do much in their constructors
|
||||
/obj/machinery/constructable_frame/proc/update_namelist()
|
||||
if(!req_components)
|
||||
return
|
||||
|
||||
proc/update_desc()
|
||||
var/D
|
||||
if(req_components)
|
||||
D = "Requires "
|
||||
var/first = 1
|
||||
for(var/I in req_components)
|
||||
if(req_components[I] > 0)
|
||||
D += "[first?"":", "][num2text(req_components[I])] [req_component_names[I]]"
|
||||
first = 0
|
||||
if(first) // nothing needs to be added, then
|
||||
D += "nothing"
|
||||
D += "."
|
||||
desc = D
|
||||
req_component_names = new()
|
||||
for(var/tname in req_components)
|
||||
var/path = tname
|
||||
var/obj/O = new path()
|
||||
req_component_names[tname] = O.name
|
||||
|
||||
/obj/machinery/constructable_frame/machine_frame
|
||||
// update description of required components remaining
|
||||
/obj/machinery/constructable_frame/proc/update_req_desc()
|
||||
if(!req_components || !req_component_names)
|
||||
return
|
||||
|
||||
proc/find_square()
|
||||
// This is fucking stupid but what the hell.
|
||||
var/hasContent = 0
|
||||
desc = "Requires"
|
||||
for(var/i = 1 to req_components.len)
|
||||
var/tname = req_components[i]
|
||||
var/amt = req_components[tname]
|
||||
if(amt == 0)
|
||||
continue
|
||||
var/use_and = i == req_components.len
|
||||
desc += "[(hasContent ? (use_and ? ", and" : ",") : "")] [amt] [amt == 1 ? req_component_names[tname] : "[req_component_names[tname]]\s"]"
|
||||
hasContent = 1
|
||||
|
||||
// This corresponds to indicies from alldirs.
|
||||
// 1 2 3 4 5 6 7 8
|
||||
// var/list/alldirs = list(NORTH, SOUTH, EAST, WEST, NORTHEAST, NORTHWEST, SOUTHEAST, SOUTHWEST)
|
||||
var/valid_patterns=list(
|
||||
list(1,3,5), //SW - NORTH,EAST,NORTHEAST
|
||||
list(2,3,7), //NW - SOUTH,EAST,SOUTHEAST
|
||||
list(1,4,6), //SE - NORTH,WEST,NORTHWEST
|
||||
list(2,4,8) //NE - SOUTH,WEST,SOUTHWEST
|
||||
)
|
||||
var/detected_parts[8]
|
||||
var/tally=0
|
||||
var/turf/T
|
||||
var/obj/machinery/constructable_frame/machine_frame/friend
|
||||
for(var/i=1;i<=8;i++)
|
||||
T=get_step(src.loc,alldirs[i])
|
||||
friend = locate() in T
|
||||
if(friend)
|
||||
detected_parts[i]=friend
|
||||
tally++
|
||||
// Need at least 3 connections to make a square
|
||||
if(tally<3)
|
||||
return
|
||||
// Find stuff in the patterns indicated
|
||||
for(var/i=1;i<=4;i++)
|
||||
var/list/scanidxs=valid_patterns[i]
|
||||
var/list/new_connected=list()
|
||||
var/allfound=1
|
||||
for(var/diridx in scanidxs)
|
||||
if(detected_parts[diridx]==null)
|
||||
allfound=0
|
||||
break
|
||||
new_connected.Add(detected_parts[diridx])
|
||||
if(allfound)
|
||||
connected_parts=new_connected
|
||||
pattern_idx=i
|
||||
return 1
|
||||
return 0
|
||||
|
||||
attackby(obj/item/P as obj, mob/user as mob)
|
||||
if(P.crit_fail)
|
||||
user << "\red This part is faulty, you cannot add this to the machine!"
|
||||
return
|
||||
switch(state)
|
||||
if(1)
|
||||
if(istype(P, /obj/item/stack/cable_coil))
|
||||
var/obj/item/stack/cable_coil/C = P
|
||||
if(C.amount >= 5)
|
||||
playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1)
|
||||
user << "\blue You start to add cables to the frame."
|
||||
if(do_after(user, 20))
|
||||
if(C)
|
||||
C.amount -= 5
|
||||
if(!C.amount) del(C)
|
||||
user << "\blue You add cables to the frame."
|
||||
state = 2
|
||||
icon_state = "box_1"
|
||||
/*
|
||||
else if(istype(P, /obj/item/stack/sheet/glass))
|
||||
var/obj/item/stack/sheet/glass/G=P
|
||||
if(G.amount<1)
|
||||
user << "\red How...?"
|
||||
return
|
||||
G.use(1)
|
||||
user << "\blue You add the glass to the frame."
|
||||
playsound(get_turf(src), 'sound/items/Deconstruct.ogg', 50, 1)
|
||||
new /obj/structure/displaycase_frame(src.loc)
|
||||
del(src)
|
||||
return*/
|
||||
else if(istype(P, /obj/item/stack/rods))
|
||||
var/obj/item/stack/rods/R=P
|
||||
if(R.amount<10)
|
||||
user << "\red You need 10 rods to assemble a pod frame."
|
||||
return
|
||||
if(!find_square())
|
||||
user << "\red You cannot assemble a pod frame without a 2x2 square of machine frames."
|
||||
return
|
||||
|
||||
R.use(10)
|
||||
|
||||
for(var/obj/machinery/constructable_frame/machine_frame/F in connected_parts)
|
||||
qdel(F)
|
||||
|
||||
var/turf/T=get_turf(src)
|
||||
// Offset frame (if needed) so it doesn't look wonky when it spawns.
|
||||
switch(pattern_idx)
|
||||
if(2)
|
||||
T=get_step(T,SOUTH)
|
||||
if(3)
|
||||
T=get_step(T,WEST)
|
||||
if(4)
|
||||
T=get_step(T,SOUTHWEST)
|
||||
|
||||
new /obj/structure/spacepod_frame(T)
|
||||
user << "\blue You assemble the pod frame."
|
||||
playsound(get_turf(src), 'sound/items/Deconstruct.ogg', 50, 1)
|
||||
qdel(src)
|
||||
return
|
||||
if(!hasContent)
|
||||
desc = "Does not require any more components."
|
||||
else
|
||||
desc += "."
|
||||
|
||||
/obj/machinery/constructable_frame/machine_frame/attackby(obj/item/P as obj, mob/user as mob)
|
||||
if(P.crit_fail)
|
||||
user << "<span class='danger'>This part is faulty, you cannot add this to the machine!</span>"
|
||||
return
|
||||
switch(state)
|
||||
if(1)
|
||||
if(istype(P, /obj/item/stack/cable_coil))
|
||||
var/obj/item/stack/cable_coil/C = P
|
||||
if(C.amount >= 5)
|
||||
playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1)
|
||||
user << "<span class='notice'>You start to add cables to the frame.</span>"
|
||||
if(do_after(user, 20))
|
||||
if(C.amount >= 5 && state == 1)
|
||||
C.use(5)
|
||||
user << "<span class='notice'>You add cables to the frame.</span>"
|
||||
state = 2
|
||||
icon_state = "box_1"
|
||||
else
|
||||
if(istype(P, /obj/item/weapon/wrench))
|
||||
playsound(src.loc, 'sound/items/Ratchet.ogg', 75, 1)
|
||||
user << "\blue You dismantle the frame"
|
||||
new /obj/item/stack/sheet/metal(src.loc, 5)
|
||||
del(src)
|
||||
if(2)
|
||||
if(istype(P, /obj/item/weapon/circuitboard))
|
||||
var/obj/item/weapon/circuitboard/B = P
|
||||
if(B.board_type == "machine")
|
||||
user << "<span class='warning'>You need five length of cable to wire the frame.</span>"
|
||||
return
|
||||
if(istype(P, /obj/item/weapon/wrench))
|
||||
playsound(src.loc, 'sound/items/Ratchet.ogg', 75, 1)
|
||||
user << "<span class='notice'>You dismantle the frame.</span>"
|
||||
new /obj/item/stack/sheet/metal(src.loc, 5)
|
||||
qdel(src)
|
||||
if(2)
|
||||
if(istype(P, /obj/item/weapon/circuitboard))
|
||||
var/obj/item/weapon/circuitboard/B = P
|
||||
if(B.board_type == "machine")
|
||||
playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1)
|
||||
user << "<span class='notice'>You add the circuit board to the frame.</span>"
|
||||
circuit = P
|
||||
user.drop_item()
|
||||
P.loc = src
|
||||
icon_state = "box_2"
|
||||
state = 3
|
||||
components = list()
|
||||
req_components = circuit.req_components.Copy()
|
||||
update_namelist()
|
||||
update_req_desc()
|
||||
else
|
||||
user << "<span class='danger'>This frame does not accept circuit boards of this type!</span>"
|
||||
if(istype(P, /obj/item/weapon/wirecutters))
|
||||
playsound(src.loc, 'sound/items/Wirecutter.ogg', 50, 1)
|
||||
user << "<span class='notice'>You remove the cables.</span>"
|
||||
state = 1
|
||||
icon_state = "box_0"
|
||||
var/obj/item/stack/cable_coil/A = new /obj/item/stack/cable_coil(src.loc,5)
|
||||
A.amount = 5
|
||||
|
||||
if(3)
|
||||
if(istype(P, /obj/item/weapon/crowbar))
|
||||
playsound(src.loc, 'sound/items/Crowbar.ogg', 50, 1)
|
||||
state = 2
|
||||
circuit.loc = src.loc
|
||||
circuit = null
|
||||
if(components.len == 0)
|
||||
user << "<span class='notice'>You remove the circuit board.</span>"
|
||||
else
|
||||
user << "<span class='notice'>You remove the circuit board and other components.</span>"
|
||||
for(var/obj/item/weapon/W in components)
|
||||
W.loc = src.loc
|
||||
desc = initial(desc)
|
||||
req_components = null
|
||||
components = null
|
||||
icon_state = "box_1"
|
||||
|
||||
if(istype(P, /obj/item/weapon/screwdriver))
|
||||
var/component_check = 1
|
||||
for(var/R in req_components)
|
||||
if(req_components[R] > 0)
|
||||
component_check = 0
|
||||
break
|
||||
if(component_check)
|
||||
playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1)
|
||||
var/obj/machinery/new_machine = new src.circuit.build_path(src.loc)
|
||||
for(var/obj/O in new_machine.component_parts)
|
||||
qdel(O)
|
||||
new_machine.component_parts = list()
|
||||
for(var/obj/O in src)
|
||||
O.loc = null
|
||||
new_machine.component_parts += O
|
||||
circuit.loc = null
|
||||
new_machine.RefreshParts()
|
||||
qdel(src)
|
||||
|
||||
if(istype(P, /obj/item))
|
||||
var/success
|
||||
for(var/I in req_components)
|
||||
if(istype(P, I) && (req_components[I] > 0))
|
||||
success=1
|
||||
playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1)
|
||||
user << "\blue You add the circuit board to the frame."
|
||||
circuit = P
|
||||
if(istype(P, /obj/item/stack/cable_coil))
|
||||
var/obj/item/stack/cable_coil/CP = P
|
||||
var/camt = min(CP.amount, req_components[I])
|
||||
var/obj/item/stack/cable_coil/CC = new /obj/item/stack/cable_coil(src)
|
||||
CC.amount = camt
|
||||
CC.update_icon()
|
||||
CP.use(camt)
|
||||
components += CC
|
||||
req_components[I] -= camt
|
||||
update_req_desc()
|
||||
break
|
||||
user.drop_item()
|
||||
P.loc = src
|
||||
icon_state = "box_2"
|
||||
state = 3
|
||||
components = list()
|
||||
req_components = circuit.req_components.Copy()
|
||||
for(var/A in circuit.req_components)
|
||||
req_components[A] = circuit.req_components[A]
|
||||
req_component_names = circuit.req_components.Copy()
|
||||
for(var/A in req_components)
|
||||
var/cp = text2path(A)
|
||||
var/obj/ct = new cp() // have to quickly instantiate it get name
|
||||
req_component_names[A] = ct.name
|
||||
if(circuit.frame_desc)
|
||||
desc = circuit.frame_desc
|
||||
else
|
||||
update_desc()
|
||||
user << desc
|
||||
else
|
||||
user << "\red This frame does not accept circuit boards of this type!"
|
||||
else
|
||||
if(istype(P, /obj/item/weapon/wirecutters))
|
||||
playsound(src.loc, 'sound/items/Wirecutter.ogg', 50, 1)
|
||||
user << "\blue You remove the cables."
|
||||
state = 1
|
||||
icon_state = "box_0"
|
||||
var/obj/item/stack/cable_coil/A = new /obj/item/stack/cable_coil( src.loc )
|
||||
A.amount = 5
|
||||
|
||||
if(3)
|
||||
if(istype(P, /obj/item/weapon/crowbar))
|
||||
playsound(src.loc, 'sound/items/Crowbar.ogg', 50, 1)
|
||||
state = 2
|
||||
circuit.loc = src.loc
|
||||
circuit = null
|
||||
if(components.len == 0)
|
||||
user << "\blue You remove the circuit board."
|
||||
else
|
||||
user << "\blue You remove the circuit board and other components."
|
||||
for(var/obj/item/weapon/W in components)
|
||||
W.loc = src.loc
|
||||
desc = initial(desc)
|
||||
req_components = null
|
||||
components = null
|
||||
icon_state = "box_1"
|
||||
else
|
||||
if(istype(P, /obj/item/weapon/screwdriver))
|
||||
var/component_check = 1
|
||||
for(var/R in req_components)
|
||||
if(req_components[R] > 0)
|
||||
component_check = 0
|
||||
break
|
||||
if(component_check)
|
||||
playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1)
|
||||
var/obj/machinery/new_machine = new src.circuit.build_path(src.loc)
|
||||
for(var/obj/O in new_machine.component_parts)
|
||||
del(O)
|
||||
new_machine.component_parts = list()
|
||||
for(var/obj/O in src)
|
||||
if(circuit.contain_parts) // things like disposal don't want their parts in them
|
||||
O.loc = new_machine
|
||||
else
|
||||
O.loc = null
|
||||
new_machine.component_parts += O
|
||||
if(circuit.contain_parts)
|
||||
circuit.loc = new_machine
|
||||
else
|
||||
circuit.loc = null
|
||||
new_machine.RefreshParts()
|
||||
del(src)
|
||||
else
|
||||
if(istype(P, /obj/item))
|
||||
for(var/I in req_components)
|
||||
if(istype(P, text2path(I)) && (req_components[I] > 0))
|
||||
playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1)
|
||||
if(istype(P, /obj/item/stack/cable_coil))
|
||||
var/obj/item/stack/cable_coil/CP = P
|
||||
if(CP.amount > 1)
|
||||
var/camt = min(CP.amount, req_components[I]) // amount of cable to take, idealy amount required, but limited by amount provided
|
||||
var/obj/item/stack/cable_coil/CC = new /obj/item/stack/cable_coil(src)
|
||||
CC.amount = camt
|
||||
CC.update_icon()
|
||||
CP.use(camt)
|
||||
components += CC
|
||||
req_components[I] -= camt
|
||||
update_desc()
|
||||
break
|
||||
user.drop_item()
|
||||
P.loc = src
|
||||
components += P
|
||||
req_components[I]--
|
||||
update_desc()
|
||||
break
|
||||
user << desc
|
||||
if(P && P.loc != src && !istype(P, /obj/item/stack/cable_coil))
|
||||
user << "\red You cannot add that component to the machine!"
|
||||
|
||||
|
||||
components += P
|
||||
req_components[I]--
|
||||
update_req_desc()
|
||||
return 1
|
||||
if(!success)
|
||||
user << "<span class='danger'>You cannot add that to the machine!</span>"
|
||||
return 0
|
||||
|
||||
//Machine Frame Circuit Boards
|
||||
/*Common Parts: Parts List: Ignitor, Timer, Infra-red laser, Infra-red sensor, t_scanner, Capacitor, Valve, sensor unit,
|
||||
micro-manipulator, console screen, beaker, Microlaser, matter bin, power cells.
|
||||
Note: Once everything is added to the public areas, will add m_amt and g_amt to circuit boards since autolathe won't be able
|
||||
to destroy them and players will be able to make replacements.
|
||||
*/
|
||||
/obj/item/weapon/circuitboard/vendor
|
||||
name = "circuit board (Booze-O-Mat Vendor)"
|
||||
build_path = /obj/machinery/vending/boozeomat
|
||||
board_type = "machine"
|
||||
origin_tech = "programming=1"
|
||||
frame_desc = "Requires 3 Resupply Canisters."
|
||||
req_components = list(
|
||||
/obj/item/weapon/vending_refill/boozeomat = 3)
|
||||
|
||||
var/list/names_paths = list(/obj/machinery/vending/boozeomat = "Booze-O-Mat",
|
||||
/obj/machinery/vending/coffee = "Solar's Best Hot Drinks",
|
||||
/obj/machinery/vending/snack = "Getmore Chocolate Corp",
|
||||
/obj/machinery/vending/cola = "Robust Softdrinks",
|
||||
/obj/machinery/vending/cigarette = "ShadyCigs Deluxe",
|
||||
/obj/machinery/vending/autodrobe = "AutoDrobe")
|
||||
|
||||
/obj/item/weapon/circuitboard/vendor/attackby(obj/item/I, mob/user)
|
||||
if(istype(I, /obj/item/weapon/screwdriver))
|
||||
set_type(pick(names_paths), user)
|
||||
|
||||
|
||||
/obj/item/weapon/circuitboard/vendor/proc/set_type(typepath, mob/user)
|
||||
build_path = typepath
|
||||
name = "circuit board ([names_paths[build_path]] Vendor)"
|
||||
user << "<span class='notice'>You set the board to [names_paths[build_path]].</span>"
|
||||
req_components = list(text2path("/obj/item/weapon/vending_refill/[copytext("[build_path]", 24)]") = 3)
|
||||
|
||||
/obj/item/weapon/circuitboard/smes
|
||||
name = "circuit board (SMES)"
|
||||
build_path = /obj/machinery/power/smes
|
||||
board_type = "machine"
|
||||
origin_tech = "programming=4;powerstorage=5;engineering=5"
|
||||
frame_desc = "Requires 5 pieces of cable, 5 Power Cells and 1 Capacitor."
|
||||
req_components = list(
|
||||
/obj/item/stack/cable_coil = 5,
|
||||
/obj/item/weapon/cell = 5,
|
||||
/obj/item/weapon/stock_parts/capacitor = 1)
|
||||
|
||||
|
||||
/obj/item/weapon/circuitboard/thermomachine
|
||||
name = "circuit board (Freezer)"
|
||||
desc = "Use screwdriver to switch between heating and cooling modes."
|
||||
build_path = /obj/machinery/atmospherics/unary/cold_sink/freezer
|
||||
board_type = "machine"
|
||||
origin_tech = "programming=3;plasmatech=3"
|
||||
frame_desc = "Requires 2 Matter Bins, 2 Micro Lasers, 1 piece of cable and 1 Console Screen."
|
||||
req_components = list(
|
||||
/obj/item/weapon/stock_parts/matter_bin = 2,
|
||||
/obj/item/weapon/stock_parts/micro_laser = 2,
|
||||
/obj/item/stack/cable_coil = 1,
|
||||
/obj/item/weapon/stock_parts/console_screen = 1)
|
||||
|
||||
/obj/item/weapon/circuitboard/thermomachine/attackby(obj/item/I, mob/user)
|
||||
if(istype(I, /obj/item/weapon/screwdriver))
|
||||
if(build_path == /obj/machinery/atmospherics/unary/cold_sink/freezer)
|
||||
build_path = /obj/machinery/atmospherics/unary/heat_reservoir/heater
|
||||
name = "circuit board (Heater)"
|
||||
user << "<span class='notice'>You set the board to heating.</span>"
|
||||
else
|
||||
build_path = /obj/machinery/atmospherics/unary/cold_sink/freezer
|
||||
name = "circuit board (Freezer)"
|
||||
user << "<span class='notice'>You set the board to cooling.</span>"
|
||||
|
||||
/obj/item/weapon/circuitboard/biogenerator
|
||||
name = "circuit board (Biogenerator)"
|
||||
build_path = /obj/machinery/biogenerator
|
||||
board_type = "machine"
|
||||
origin_tech = "programming=3;biotech=2;materials=3"
|
||||
frame_desc = "Requires 1 Matter Bin, 1 Manipulator, 1 piece of cable and 1 Console Screen."
|
||||
req_components = list(
|
||||
/obj/item/weapon/stock_parts/matter_bin = 1,
|
||||
/obj/item/weapon/stock_parts/manipulator = 1,
|
||||
/obj/item/stack/cable_coil = 1,
|
||||
/obj/item/weapon/stock_parts/console_screen = 1)
|
||||
|
||||
/obj/item/weapon/circuitboard/hydroponics
|
||||
name = "circuit board (Hydroponics Tray)"
|
||||
build_path = /obj/machinery/portable_atmospherics/hydroponics
|
||||
board_type = "machine"
|
||||
origin_tech = "programming=1;biotech=1"
|
||||
frame_desc = "Requires 2 Matter Bins and 1 Console Screen."
|
||||
req_components = list(
|
||||
/obj/item/weapon/stock_parts/matter_bin = 2,
|
||||
/obj/item/weapon/stock_parts/console_screen = 1)
|
||||
|
||||
/obj/item/weapon/circuitboard/microwave
|
||||
name = "circuit board (Microwave)"
|
||||
build_path = /obj/machinery/microwave
|
||||
board_type = "machine"
|
||||
origin_tech = "programming=1"
|
||||
frame_desc = "Requires 1 Micro Laser, 1 piece of cable and 1 Console Screen."
|
||||
req_components = list(
|
||||
/obj/item/weapon/stock_parts/micro_laser = 1,
|
||||
/obj/item/stack/cable_coil = 2,
|
||||
/obj/item/weapon/stock_parts/console_screen = 1)
|
||||
|
||||
/obj/item/weapon/circuitboard/chem_dispenser
|
||||
name = "circuit board (Portable Chem Dispenser)"
|
||||
build_path = /obj/machinery/chem_dispenser/constructable
|
||||
board_type = "machine"
|
||||
origin_tech = "materials=4;engineering=4;programming=4;plasmatech=3;biotech=3"
|
||||
frame_desc = "Requires 1 Matter Bin, 1 Capacitor, 1 Manipulator, 1 Console Screen, and 1 Power Cell."
|
||||
req_components = list(
|
||||
/obj/item/weapon/stock_parts/matter_bin = 2,
|
||||
/obj/item/weapon/stock_parts/capacitor = 1,
|
||||
/obj/item/weapon/stock_parts/manipulator = 1,
|
||||
/obj/item/weapon/stock_parts/console_screen = 1,
|
||||
/obj/item/weapon/cell = 1)
|
||||
|
||||
/obj/item/weapon/circuitboard/destructive_analyzer
|
||||
name = "Circuit board (Destructive Analyzer)"
|
||||
build_path = "/obj/machinery/r_n_d/destructive_analyzer"
|
||||
@@ -258,9 +282,9 @@ to destroy them and players will be able to make replacements.
|
||||
origin_tech = "magnets=2;engineering=2;programming=2"
|
||||
frame_desc = "Requires 1 Scanning Module, 1 Manipulator, and 1 Micro-Laser."
|
||||
req_components = list(
|
||||
"/obj/item/weapon/stock_parts/scanning_module" = 1,
|
||||
"/obj/item/weapon/stock_parts/manipulator" = 1,
|
||||
"/obj/item/weapon/stock_parts/micro_laser" = 1)
|
||||
/obj/item/weapon/stock_parts/scanning_module = 1,
|
||||
/obj/item/weapon/stock_parts/manipulator = 1,
|
||||
/obj/item/weapon/stock_parts/micro_laser = 1)
|
||||
|
||||
/obj/item/weapon/circuitboard/autolathe
|
||||
name = "Circuit board (Autolathe)"
|
||||
@@ -269,9 +293,9 @@ to destroy them and players will be able to make replacements.
|
||||
origin_tech = "engineering=2;programming=2"
|
||||
frame_desc = "Requires 3 Matter Bins, 1 Manipulator, and 1 Console Screen."
|
||||
req_components = list(
|
||||
"/obj/item/weapon/stock_parts/matter_bin" = 3,
|
||||
"/obj/item/weapon/stock_parts/manipulator" = 1,
|
||||
"/obj/item/weapon/stock_parts/console_screen" = 1)
|
||||
/obj/item/weapon/stock_parts/matter_bin = 3,
|
||||
/obj/item/weapon/stock_parts/manipulator = 1,
|
||||
/obj/item/weapon/stock_parts/console_screen = 1)
|
||||
|
||||
/obj/item/weapon/circuitboard/protolathe
|
||||
name = "Circuit board (Protolathe)"
|
||||
@@ -280,9 +304,9 @@ to destroy them and players will be able to make replacements.
|
||||
origin_tech = "engineering=2;programming=2"
|
||||
frame_desc = "Requires 2 Matter Bins, 2 Manipulators, and 2 Beakers."
|
||||
req_components = list(
|
||||
"/obj/item/weapon/stock_parts/matter_bin" = 2,
|
||||
"/obj/item/weapon/stock_parts/manipulator" = 2,
|
||||
"/obj/item/weapon/reagent_containers/glass/beaker" = 2)
|
||||
/obj/item/weapon/stock_parts/matter_bin = 2,
|
||||
/obj/item/weapon/stock_parts/manipulator = 2,
|
||||
/obj/item/weapon/reagent_containers/glass/beaker = 2)
|
||||
|
||||
|
||||
/obj/item/weapon/circuitboard/circuit_imprinter
|
||||
@@ -292,9 +316,9 @@ to destroy them and players will be able to make replacements.
|
||||
origin_tech = "engineering=2;programming=2"
|
||||
frame_desc = "Requires 1 Matter Bin, 1 Manipulator, and 2 Beakers."
|
||||
req_components = list(
|
||||
"/obj/item/weapon/stock_parts/matter_bin" = 1,
|
||||
"/obj/item/weapon/stock_parts/manipulator" = 1,
|
||||
"/obj/item/weapon/reagent_containers/glass/beaker" = 2)
|
||||
/obj/item/weapon/stock_parts/matter_bin = 1,
|
||||
/obj/item/weapon/stock_parts/manipulator = 1,
|
||||
/obj/item/weapon/reagent_containers/glass/beaker = 2)
|
||||
|
||||
/obj/item/weapon/circuitboard/pacman
|
||||
name = "Circuit Board (PACMAN-type Generator)"
|
||||
@@ -303,10 +327,10 @@ to destroy them and players will be able to make replacements.
|
||||
origin_tech = "programming=3:powerstorage=3;plasmatech=3;engineering=3"
|
||||
frame_desc = "Requires 1 Matter Bin, 1 Micro-Laser, 2 Pieces of Cable, and 1 Capacitor."
|
||||
req_components = list(
|
||||
"/obj/item/weapon/stock_parts/matter_bin" = 1,
|
||||
"/obj/item/weapon/stock_parts/micro_laser" = 1,
|
||||
"/obj/item/stack/cable_coil" = 2,
|
||||
"/obj/item/weapon/stock_parts/capacitor" = 1)
|
||||
/obj/item/weapon/stock_parts/matter_bin = 1,
|
||||
/obj/item/weapon/stock_parts/micro_laser = 1,
|
||||
/obj/item/stack/cable_coil = 2,
|
||||
/obj/item/weapon/stock_parts/capacitor = 1)
|
||||
|
||||
/obj/item/weapon/circuitboard/pacman/super
|
||||
name = "Circuit Board (SUPERPACMAN-type Generator)"
|
||||
@@ -325,8 +349,8 @@ obj/item/weapon/circuitboard/rdserver
|
||||
origin_tech = "programming=3"
|
||||
frame_desc = "Requires 2 pieces of cable, and 1 Scanning Module."
|
||||
req_components = list(
|
||||
"/obj/item/stack/cable_coil" = 2,
|
||||
"/obj/item/weapon/stock_parts/scanning_module" = 1)
|
||||
/obj/item/stack/cable_coil = 2,
|
||||
/obj/item/weapon/stock_parts/scanning_module = 1)
|
||||
|
||||
/obj/item/weapon/circuitboard/mechfab
|
||||
name = "Circuit board (Exosuit Fabricator)"
|
||||
@@ -335,10 +359,10 @@ obj/item/weapon/circuitboard/rdserver
|
||||
origin_tech = "programming=3;engineering=3"
|
||||
frame_desc = "Requires 2 Matter Bins, 1 Manipulator, 1 Micro-Laser and 1 Console Screen."
|
||||
req_components = list(
|
||||
"/obj/item/weapon/stock_parts/matter_bin" = 2,
|
||||
"/obj/item/weapon/stock_parts/manipulator" = 1,
|
||||
"/obj/item/weapon/stock_parts/micro_laser" = 1,
|
||||
"/obj/item/weapon/stock_parts/console_screen" = 1)
|
||||
/obj/item/weapon/stock_parts/matter_bin = 2,
|
||||
/obj/item/weapon/stock_parts/manipulator = 1,
|
||||
/obj/item/weapon/stock_parts/micro_laser = 1,
|
||||
/obj/item/weapon/stock_parts/console_screen = 1)
|
||||
|
||||
/obj/item/weapon/circuitboard/clonepod
|
||||
name = "Circuit board (Clone Pod)"
|
||||
@@ -347,110 +371,213 @@ obj/item/weapon/circuitboard/rdserver
|
||||
origin_tech = "programming=3;biotech=3"
|
||||
frame_desc = "Requires 2 Manipulator, 2 Scanning Module, 2 pieces of cable and 1 Console Screen."
|
||||
req_components = list(
|
||||
"/obj/item/stack/cable_coil" = 2,
|
||||
"/obj/item/weapon/stock_parts/scanning_module" = 2,
|
||||
"/obj/item/weapon/stock_parts/manipulator" = 2,
|
||||
"/obj/item/weapon/stock_parts/console_screen" = 1)
|
||||
/obj/item/stack/cable_coil = 2,
|
||||
/obj/item/weapon/stock_parts/scanning_module = 2,
|
||||
/obj/item/weapon/stock_parts/manipulator = 2,
|
||||
/obj/item/weapon/stock_parts/console_screen = 1)
|
||||
|
||||
/obj/item/weapon/circuitboard/clonescanner
|
||||
name = "Circuit board (Cloning Scanner)"
|
||||
build_path = "/obj/machinery/dna_scannernew"
|
||||
board_type = "machine"
|
||||
origin_tech = "programming=2;biotech=2"
|
||||
frame_desc = "Requires 1 Scanning module, 1 Manipulator, 1 Micro-Laser, 2 pieces of cable and 1 Console Screen."
|
||||
frame_desc = "Requires 1 Scanning Module, 1 Manipulator, 1 Micro-Laser, 2 pieces of cable and 1 Console Screen."
|
||||
req_components = list(
|
||||
"/obj/item/weapon/stock_parts/scanning_module" = 1,
|
||||
"/obj/item/weapon/stock_parts/manipulator" = 1,
|
||||
"/obj/item/weapon/stock_parts/micro_laser" = 1,
|
||||
"/obj/item/weapon/stock_parts/console_screen" = 1,
|
||||
"/obj/item/stack/cable_coil" = 2,)
|
||||
/obj/item/weapon/stock_parts/scanning_module = 1,
|
||||
/obj/item/weapon/stock_parts/manipulator = 1,
|
||||
/obj/item/weapon/stock_parts/micro_laser = 1,
|
||||
/obj/item/weapon/stock_parts/console_screen = 1,
|
||||
/obj/item/stack/cable_coil = 2,)
|
||||
|
||||
/obj/item/weapon/circuitboard/mech_recharger
|
||||
name = "circuit board (Mech Bay Recharger)"
|
||||
build_path = /obj/machinery/mech_bay_recharge_port
|
||||
board_type = "machine"
|
||||
origin_tech = "programming=3;powerstorage=4;engineering=4"
|
||||
frame_desc = "Requires 1 piece of cable and 5 Capacitors."
|
||||
req_components = list(
|
||||
/obj/item/stack/cable_coil = 1,
|
||||
/obj/item/weapon/stock_parts/capacitor = 5)
|
||||
|
||||
/obj/item/weapon/circuitboard/teleporter_hub
|
||||
name = "circuit board (Teleporter Hub)"
|
||||
build_path = /obj/machinery/teleport/hub
|
||||
board_type = "machine"
|
||||
origin_tech = "programming=3;engineering=5;bluespace=5;materials=4"
|
||||
frame_desc = "Requires 3 Bluespace Crystals and 1 Matter Bin."
|
||||
req_components = list(
|
||||
/obj/item/bluespace_crystal = 3,
|
||||
/obj/item/weapon/stock_parts/matter_bin = 1)
|
||||
|
||||
/obj/item/weapon/circuitboard/teleporter_station
|
||||
name = "circuit board (Teleporter Station)"
|
||||
build_path = /obj/machinery/teleport/station
|
||||
board_type = "machine"
|
||||
origin_tech = "programming=4;engineering=4;bluespace=4"
|
||||
frame_desc = "Requires 2 Bluespace Crystals, 2 Capacitors and 1 Console Screen."
|
||||
req_components = list(
|
||||
/obj/item/bluespace_crystal = 2,
|
||||
/obj/item/weapon/stock_parts/capacitor = 2,
|
||||
/obj/item/weapon/stock_parts/console_screen = 1)
|
||||
|
||||
/obj/item/weapon/circuitboard/telesci_pad
|
||||
name = "Circuit board (Telepad)"
|
||||
build_path = /obj/machinery/telepad
|
||||
board_type = "machine"
|
||||
origin_tech = "programming=4;engineering=3;materials=3;bluespace=4"
|
||||
frame_desc = "Requires 2 Bluespace Crystals, 1 Capacitor, 1 piece of cable and 1 Console Screen."
|
||||
req_components = list(
|
||||
/obj/item/bluespace_crystal = 2,
|
||||
/obj/item/weapon/stock_parts/capacitor = 1,
|
||||
/obj/item/stack/cable_coil = 1,
|
||||
/obj/item/weapon/stock_parts/console_screen = 1)
|
||||
|
||||
|
||||
/obj/item/weapon/circuitboard/sleeper
|
||||
name = "circuit board (Sleeper)"
|
||||
build_path = /obj/machinery/sleeper
|
||||
board_type = "machine"
|
||||
origin_tech = "programming=3;biotech=2;engineering=3;materials=3"
|
||||
frame_desc = "Requires 1 Matter Bin, 1 Manipulator, 1 piece of cable and 2 Console Screens."
|
||||
req_components = list(
|
||||
/obj/item/weapon/stock_parts/matter_bin = 1,
|
||||
/obj/item/weapon/stock_parts/manipulator = 1,
|
||||
/obj/item/stack/cable_coil = 1,
|
||||
/obj/item/weapon/stock_parts/console_screen = 2)
|
||||
|
||||
/obj/item/weapon/circuitboard/sleep_console
|
||||
name = "circuit board (Sleeper Console)"
|
||||
build_path = /obj/machinery/sleep_console
|
||||
board_type = "machine"
|
||||
origin_tech = "programming=3;biotech=2;engineering=3;materials=3"
|
||||
frame_desc = "Requires 2 pieces of cable and 2 Console Screens."
|
||||
req_components = list(
|
||||
/obj/item/stack/cable_coil = 2,
|
||||
/obj/item/weapon/stock_parts/console_screen = 2)
|
||||
|
||||
/obj/item/weapon/circuitboard/bodyscanner
|
||||
name = "circuit board (Body Scanner)"
|
||||
build_path = /obj/machinery/bodyscanner
|
||||
board_type = "machine"
|
||||
origin_tech = "programming=3;biotech=2;engineering=3;materials=3"
|
||||
frame_desc = "Requires 1 Scanning Module, 2 pieces of cable and 2 Console Screens."
|
||||
req_components = list(
|
||||
/obj/item/weapon/stock_parts/scanning_module = 1,
|
||||
/obj/item/stack/cable_coil = 2,
|
||||
/obj/item/weapon/stock_parts/console_screen = 2)
|
||||
|
||||
/obj/item/weapon/circuitboard/bodyscanner_console
|
||||
name = "circuit board (Body Scanner Console)"
|
||||
build_path = /obj/machinery/body_scanconsole
|
||||
board_type = "machine"
|
||||
origin_tech = "programming=3;biotech=2;engineering=3;materials=3"
|
||||
frame_desc = "Requires 2 pieces of cable and 2 Console Screens."
|
||||
req_components = list(
|
||||
/obj/item/stack/cable_coil = 2,
|
||||
/obj/item/weapon/stock_parts/console_screen = 2)
|
||||
|
||||
/obj/item/weapon/circuitboard/cryo_tube
|
||||
name = "circuit board (Cryotube)"
|
||||
build_path = /obj/machinery/atmospherics/unary/cryo_cell
|
||||
board_type = "machine"
|
||||
origin_tech = "programming=4;biotech=3;engineering=4"
|
||||
frame_desc = "Requires 1 Matter Bin, 1 piece of cable and 4 Console Screens."
|
||||
req_components = list(
|
||||
/obj/item/weapon/stock_parts/matter_bin = 1,
|
||||
/obj/item/stack/cable_coil = 1,
|
||||
/obj/item/weapon/stock_parts/console_screen = 4)
|
||||
|
||||
/obj/item/weapon/circuitboard/cyborgrecharger
|
||||
name = "circuit board (Cyborg Recharger)"
|
||||
build_path = /obj/machinery/recharge_station
|
||||
board_type = "machine"
|
||||
origin_tech = "powerstorage=3;engineering=3"
|
||||
frame_desc = "Requires 2 Capacitors, 1 Power Cell and 1 Manipulator."
|
||||
req_components = list(
|
||||
/obj/item/weapon/stock_parts/capacitor = 2,
|
||||
/obj/item/weapon/cell = 1,
|
||||
/obj/item/weapon/stock_parts/manipulator = 1)
|
||||
|
||||
// Telecomms circuit boards:
|
||||
|
||||
/obj/item/weapon/circuitboard/telecomms/receiver
|
||||
name = "Circuit Board (Subspace Receiver)"
|
||||
build_path = "/obj/machinery/telecomms/receiver"
|
||||
build_path = /obj/machinery/telecomms/receiver
|
||||
board_type = "machine"
|
||||
origin_tech = "programming=4;engineering=3;bluespace=2"
|
||||
frame_desc = "Requires 1 Subspace Ansible, 1 Hyperwave Filter, 2 Manipulators, and 1 Micro-Laser."
|
||||
req_components = list(
|
||||
"/obj/item/weapon/stock_parts/subspace/ansible" = 1,
|
||||
"/obj/item/weapon/stock_parts/subspace/filter" = 1,
|
||||
"/obj/item/weapon/stock_parts/manipulator" = 2,
|
||||
"/obj/item/weapon/stock_parts/micro_laser" = 1)
|
||||
/obj/item/weapon/stock_parts/subspace/ansible = 1,
|
||||
/obj/item/weapon/stock_parts/subspace/filter = 1,
|
||||
/obj/item/weapon/stock_parts/manipulator = 2,
|
||||
/obj/item/weapon/stock_parts/micro_laser = 1)
|
||||
|
||||
/obj/item/weapon/circuitboard/telecomms/hub
|
||||
name = "Circuit Board (Hub Mainframe)"
|
||||
build_path = "/obj/machinery/telecomms/hub"
|
||||
build_path = /obj/machinery/telecomms/hub
|
||||
board_type = "machine"
|
||||
origin_tech = "programming=4;engineering=4"
|
||||
frame_desc = "Requires 2 Manipulators, 2 Cable Coil and 2 Hyperwave Filter."
|
||||
req_components = list(
|
||||
"/obj/item/weapon/stock_parts/manipulator" = 2,
|
||||
"/obj/item/stack/cable_coil" = 2,
|
||||
"/obj/item/weapon/stock_parts/subspace/filter" = 2)
|
||||
/obj/item/weapon/stock_parts/manipulator = 2,
|
||||
/obj/item/stack/cable_coil = 2,
|
||||
/obj/item/weapon/stock_parts/subspace/filter = 2)
|
||||
|
||||
/obj/item/weapon/circuitboard/telecomms/relay
|
||||
name = "Circuit Board (Relay Mainframe)"
|
||||
build_path = "/obj/machinery/telecomms/relay"
|
||||
build_path = /obj/machinery/telecomms/relay
|
||||
board_type = "machine"
|
||||
origin_tech = "programming=3;engineering=4;bluespace=3"
|
||||
frame_desc = "Requires 2 Manipulators, 2 Cable Coil and 2 Hyperwave Filters."
|
||||
req_components = list(
|
||||
"/obj/item/weapon/stock_parts/manipulator" = 2,
|
||||
"/obj/item/stack/cable_coil" = 2,
|
||||
"/obj/item/weapon/stock_parts/subspace/filter" = 2)
|
||||
/obj/item/weapon/stock_parts/manipulator = 2,
|
||||
/obj/item/stack/cable_coil = 2,
|
||||
/obj/item/weapon/stock_parts/subspace/filter = 2)
|
||||
|
||||
/obj/item/weapon/circuitboard/telecomms/bus
|
||||
name = "Circuit Board (Bus Mainframe)"
|
||||
build_path = "/obj/machinery/telecomms/bus"
|
||||
build_path = /obj/machinery/telecomms/bus
|
||||
board_type = "machine"
|
||||
origin_tech = "programming=4;engineering=4"
|
||||
frame_desc = "Requires 2 Manipulators, 1 Cable Coil and 1 Hyperwave Filter."
|
||||
req_components = list(
|
||||
"/obj/item/weapon/stock_parts/manipulator" = 2,
|
||||
"/obj/item/stack/cable_coil" = 1,
|
||||
"/obj/item/weapon/stock_parts/subspace/filter" = 1)
|
||||
/obj/item/weapon/stock_parts/manipulator = 2,
|
||||
/obj/item/stack/cable_coil = 1,
|
||||
/obj/item/weapon/stock_parts/subspace/filter = 1)
|
||||
|
||||
/obj/item/weapon/circuitboard/telecomms/processor
|
||||
name = "Circuit Board (Processor Unit)"
|
||||
build_path = "/obj/machinery/telecomms/processor"
|
||||
build_path = /obj/machinery/telecomms/processor
|
||||
board_type = "machine"
|
||||
origin_tech = "programming=4;engineering=4"
|
||||
frame_desc = "Requires 3 Manipulators, 1 Hyperwave Filter, 2 Treatment Disks, 1 Wavelength Analyzer, 2 Cable Coils and 1 Subspace Amplifier."
|
||||
req_components = list(
|
||||
"/obj/item/weapon/stock_parts/manipulator" = 3,
|
||||
"/obj/item/weapon/stock_parts/subspace/filter" = 1,
|
||||
"/obj/item/weapon/stock_parts/subspace/treatment" = 2,
|
||||
"/obj/item/weapon/stock_parts/subspace/analyzer" = 1,
|
||||
"/obj/item/stack/cable_coil" = 2,
|
||||
"/obj/item/weapon/stock_parts/subspace/amplifier" = 1)
|
||||
/obj/item/weapon/stock_parts/manipulator = 3,
|
||||
/obj/item/weapon/stock_parts/subspace/filter = 1,
|
||||
/obj/item/weapon/stock_parts/subspace/treatment = 2,
|
||||
/obj/item/weapon/stock_parts/subspace/analyzer = 1,
|
||||
/obj/item/stack/cable_coil = 2,
|
||||
/obj/item/weapon/stock_parts/subspace/amplifier = 1)
|
||||
|
||||
/obj/item/weapon/circuitboard/telecomms/server
|
||||
name = "Circuit Board (Telecommunication Server)"
|
||||
build_path = "/obj/machinery/telecomms/server"
|
||||
build_path = /obj/machinery/telecomms/server
|
||||
board_type = "machine"
|
||||
origin_tech = "programming=4;engineering=4"
|
||||
frame_desc = "Requires 2 Manipulators, 1 Cable Coil and 1 Hyperwave Filter."
|
||||
req_components = list(
|
||||
"/obj/item/weapon/stock_parts/manipulator" = 2,
|
||||
"/obj/item/stack/cable_coil" = 1,
|
||||
"/obj/item/weapon/stock_parts/subspace/filter" = 1)
|
||||
/obj/item/weapon/stock_parts/manipulator = 2,
|
||||
/obj/item/stack/cable_coil = 1,
|
||||
/obj/item/weapon/stock_parts/subspace/filter = 1)
|
||||
|
||||
/obj/item/weapon/circuitboard/telecomms/broadcaster
|
||||
name = "Circuit Board (Subspace Broadcaster)"
|
||||
build_path = "/obj/machinery/telecomms/broadcaster"
|
||||
build_path = /obj/machinery/telecomms/broadcaster
|
||||
board_type = "machine"
|
||||
origin_tech = "programming=4;engineering=4;bluespace=2"
|
||||
frame_desc = "Requires 2 Manipulators, 1 Cable Coil, 1 Hyperwave Filter, 1 Ansible Crystal and 2 High-Powered Micro-Lasers. "
|
||||
req_components = list(
|
||||
"/obj/item/weapon/stock_parts/manipulator" = 2,
|
||||
"/obj/item/stack/cable_coil" = 1,
|
||||
"/obj/item/weapon/stock_parts/subspace/filter" = 1,
|
||||
"/obj/item/weapon/stock_parts/subspace/crystal" = 1,
|
||||
"/obj/item/weapon/stock_parts/micro_laser/high" = 2)
|
||||
|
||||
|
||||
|
||||
|
||||
/obj/item/weapon/stock_parts/manipulator = 2,
|
||||
/obj/item/stack/cable_coil = 1,
|
||||
/obj/item/weapon/stock_parts/subspace/filter = 1,
|
||||
/obj/item/weapon/stock_parts/subspace/crystal = 1,
|
||||
/obj/item/weapon/stock_parts/micro_laser/high = 2)
|
||||
@@ -12,6 +12,7 @@
|
||||
var/obj/item/weapon/reagent_containers/glass/beaker = null
|
||||
|
||||
var/current_heat_capacity = 50
|
||||
var/efficiency
|
||||
|
||||
l_color = "#00FF00"
|
||||
power_change()
|
||||
@@ -24,7 +25,23 @@
|
||||
/obj/machinery/atmospherics/unary/cryo_cell/New()
|
||||
..()
|
||||
initialize_directions = dir
|
||||
initialize()
|
||||
component_parts = list()
|
||||
component_parts += new /obj/item/weapon/circuitboard/cryo_tube(src)
|
||||
component_parts += new /obj/item/weapon/stock_parts/matter_bin(src)
|
||||
component_parts += new /obj/item/weapon/stock_parts/console_screen(src)
|
||||
component_parts += new /obj/item/weapon/stock_parts/console_screen(src)
|
||||
component_parts += new /obj/item/weapon/stock_parts/console_screen(src)
|
||||
component_parts += new /obj/item/weapon/stock_parts/console_screen(src)
|
||||
component_parts += new /obj/item/stack/cable_coil(src, 1)
|
||||
RefreshParts()
|
||||
|
||||
/obj/machinery/atmospherics/unary/cryo_cell/RefreshParts()
|
||||
var/C
|
||||
for(var/obj/item/weapon/stock_parts/matter_bin/M in component_parts)
|
||||
C += M.rating
|
||||
current_heat_capacity = 50 * C
|
||||
efficiency = C
|
||||
|
||||
/obj/machinery/atmospherics/unary/cryo_cell/initialize()
|
||||
if(node) return
|
||||
@@ -35,7 +52,8 @@
|
||||
break
|
||||
|
||||
/obj/machinery/atmospherics/unary/cryo_cell/Destroy()
|
||||
go_out()
|
||||
var/turf/T = loc
|
||||
T.contents += contents
|
||||
var/obj/item/weapon/reagent_containers/glass/B = beaker
|
||||
if(beaker)
|
||||
B.loc = get_step(loc, SOUTH) //Beaker is carefully ejected from the wreckage of the cryotube
|
||||
@@ -118,7 +136,12 @@
|
||||
return
|
||||
|
||||
/obj/machinery/atmospherics/unary/cryo_cell/attack_hand(mob/user)
|
||||
if(panel_open)
|
||||
usr << "\blue <b>Close the maintenance panel first.</b>"
|
||||
return
|
||||
|
||||
ui_interact(user)
|
||||
|
||||
|
||||
/**
|
||||
* The ui_interact proc is used to open and update Nano UIs
|
||||
@@ -229,7 +252,23 @@
|
||||
user.drop_item()
|
||||
G.loc = src
|
||||
user.visible_message("[user] adds \a [G] to \the [src]!", "You add \a [G] to \the [src]!")
|
||||
else if(istype(G, /obj/item/weapon/grab))
|
||||
|
||||
if (istype(G, /obj/item/weapon/screwdriver))
|
||||
if(occupant || on)
|
||||
user << "<span class='notice'>The maintenance panel is locked.</span>"
|
||||
return
|
||||
default_deconstruction_screwdriver(user, "cell-o", "cell-off", G)
|
||||
return
|
||||
|
||||
if(exchange_parts(user, G))
|
||||
return
|
||||
|
||||
default_deconstruction_crowbar(G)
|
||||
|
||||
if(istype(G, /obj/item/weapon/grab))
|
||||
if(panel_open)
|
||||
user << "\blue <b>Close the maintenance panel first.</b>"
|
||||
return
|
||||
if(!ismob(G:affecting))
|
||||
return
|
||||
for(var/mob/living/carbon/slime/M in range(1,G:affecting))
|
||||
@@ -261,8 +300,8 @@
|
||||
occupant.bodytemperature = max(occupant.bodytemperature, air_contents.temperature) // this is so ugly i'm sorry for doing it i'll fix it later i promise
|
||||
occupant.stat = 1
|
||||
if(occupant.bodytemperature < T0C)
|
||||
occupant.sleeping = max(5, (1/occupant.bodytemperature)*2000)
|
||||
occupant.Paralyse(max(5, (1/occupant.bodytemperature)*3000))
|
||||
occupant.sleeping = max(5/efficiency, (1/occupant.bodytemperature)*2000/efficiency)
|
||||
occupant.Paralyse(max(5/efficiency, (1/occupant.bodytemperature)*3000/efficiency))
|
||||
if(air_contents.oxygen > 2)
|
||||
if(occupant.getOxyLoss()) occupant.adjustOxyLoss(-1)
|
||||
else
|
||||
@@ -270,9 +309,9 @@
|
||||
//severe damage should heal waaay slower without proper chemicals
|
||||
if(occupant.bodytemperature < 225)
|
||||
if (occupant.getToxLoss())
|
||||
occupant.adjustToxLoss(max(-1, -20/occupant.getToxLoss()))
|
||||
var/heal_brute = occupant.getBruteLoss() ? min(1, 20/occupant.getBruteLoss()) : 0
|
||||
var/heal_fire = occupant.getFireLoss() ? min(1, 20/occupant.getFireLoss()) : 0
|
||||
occupant.adjustToxLoss(max(-efficiency, (-20*(efficiency ** 2)) / occupant.getToxLoss()))
|
||||
var/heal_brute = occupant.getBruteLoss() ? min(efficiency, 20*(efficiency**2) / occupant.getBruteLoss()) : 0
|
||||
var/heal_fire = occupant.getFireLoss() ? min(efficiency, 20*(efficiency**2) / occupant.getFireLoss()) : 0
|
||||
occupant.heal_organ_damage(heal_brute,heal_fire)
|
||||
var/has_cryo = occupant.reagents.get_reagent_amount("cryoxadone") >= 1
|
||||
var/has_clonexa = occupant.reagents.get_reagent_amount("clonexadone") >= 1
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
icon = 'icons/obj/doors/windoor.dmi'
|
||||
icon_state = "left"
|
||||
var/base_state = "left"
|
||||
var/health = 150.0 //If you change this, consiter changing ../door/window/brigdoor/ health at the bottom of this .dm file
|
||||
var/health = 150.0 //If you change this, consider changing ../door/window/brigdoor/ health at the bottom of this .dm file
|
||||
visible = 0.0
|
||||
use_power = 0
|
||||
flags = ON_BORDER
|
||||
@@ -28,7 +28,7 @@
|
||||
src.icon_state = "[src.icon_state]"
|
||||
src.base_state = src.icon_state
|
||||
|
||||
color = color_windows()
|
||||
color = color_windows(src)
|
||||
return
|
||||
|
||||
/obj/machinery/door/window/Destroy()
|
||||
|
||||
@@ -12,7 +12,9 @@
|
||||
|
||||
// Plant maintenance vars.
|
||||
var/waterlevel = 100 // Water level (max 100)
|
||||
var/maxwater = 100
|
||||
var/nutrilevel = 10 // Nutrient level (max 10)
|
||||
var/maxnutri = 10
|
||||
var/pestlevel = 0 // Pests (max 10)
|
||||
var/weedlevel = 0 // Weeds (max 10)s
|
||||
|
||||
@@ -37,6 +39,9 @@
|
||||
// Seed details/line data.
|
||||
var/datum/seed/seed = null // The currently planted seed
|
||||
|
||||
// Construction
|
||||
var/unwrenchable = 1
|
||||
|
||||
// Reagent information for process(), consider moving this to a controller along
|
||||
// with cycle information under 'mechanical concerns' at some point.
|
||||
var/global/list/toxic_reagents = list(
|
||||
@@ -120,12 +125,29 @@
|
||||
|
||||
/obj/machinery/portable_atmospherics/hydroponics/New()
|
||||
..()
|
||||
|
||||
component_parts = list()
|
||||
component_parts += new /obj/item/weapon/circuitboard/hydroponics(src)
|
||||
component_parts += new /obj/item/weapon/stock_parts/matter_bin(src)
|
||||
component_parts += new /obj/item/weapon/stock_parts/matter_bin(src)
|
||||
component_parts += new /obj/item/weapon/stock_parts/console_screen(src)
|
||||
RefreshParts()
|
||||
|
||||
create_reagents(200)
|
||||
connect()
|
||||
update_icon()
|
||||
if(closed_system)
|
||||
flags &= ~OPENCONTAINER
|
||||
|
||||
/obj/machinery/portable_atmospherics/hydroponics/RefreshParts()
|
||||
var/tmp_capacity = 0
|
||||
for (var/obj/item/weapon/stock_parts/matter_bin/M in component_parts)
|
||||
tmp_capacity += M.rating
|
||||
maxwater = tmp_capacity * 50 // Up to 300
|
||||
maxnutri = tmp_capacity * 5 // Up to 30
|
||||
waterlevel = maxwater
|
||||
nutrilevel = 3
|
||||
|
||||
/obj/machinery/portable_atmospherics/hydroponics/bullet_act(var/obj/item/projectile/Proj)
|
||||
|
||||
//Don't act on seeds like dionaea that shouldn't change.
|
||||
@@ -512,8 +534,10 @@
|
||||
health = 0
|
||||
dead = 0
|
||||
|
||||
nutrilevel = max(0,min(nutrilevel,10))
|
||||
waterlevel = max(0,min(waterlevel,100))
|
||||
nutrilevel = max(nutrilevel, 0)
|
||||
nutrilevel = min(nutrilevel, maxnutri)
|
||||
waterlevel = max(waterlevel, 0)
|
||||
waterlevel = min(waterlevel, maxwater)
|
||||
pestlevel = max(0,min(pestlevel,10))
|
||||
weedlevel = max(0,min(weedlevel,10))
|
||||
toxins = max(0,min(toxins,10))
|
||||
@@ -541,7 +565,15 @@
|
||||
return
|
||||
|
||||
/obj/machinery/portable_atmospherics/hydroponics/attackby(var/obj/item/O as obj, var/mob/user as mob)
|
||||
if(exchange_parts(user, O))
|
||||
return
|
||||
|
||||
if(istype(O, /obj/item/weapon/crowbar))
|
||||
if(anchored==2)
|
||||
user << "Unscrew the hoses first!"
|
||||
return
|
||||
default_deconstruction_crowbar(O, 1)
|
||||
|
||||
//--FalseIncarnate
|
||||
//Check if held item is an open container
|
||||
if (O.is_open_container())
|
||||
@@ -611,8 +643,38 @@
|
||||
update_icon()
|
||||
else
|
||||
user << "There's nothing in [src] to spray!"
|
||||
|
||||
else if(istype(O, /obj/item/weapon/wrench) && unwrenchable)
|
||||
if(anchored == 2)
|
||||
user << "Unscrew the hoses first!"
|
||||
return
|
||||
|
||||
//--FalseIncarnate
|
||||
if(!anchored && !isinspace())
|
||||
playsound(loc, 'sound/items/Ratchet.ogg', 50, 1)
|
||||
anchored = 1
|
||||
user << "You wrench [src] in place."
|
||||
else if(anchored)
|
||||
playsound(loc, 'sound/items/Ratchet.ogg', 50, 1)
|
||||
anchored = 0
|
||||
user << "You unwrench [src]."
|
||||
|
||||
else if(istype(O, /obj/item/weapon/screwdriver) && unwrenchable) //THIS NEED TO BE DONE DIFFERENTLY, SOMEONE REFACTOR THE TRAY CODE ALREADY
|
||||
if(anchored)
|
||||
if(anchored == 2)
|
||||
playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1)
|
||||
anchored = 1
|
||||
user << "You unscrew the [src]'s hoses."
|
||||
panel_open = 0
|
||||
|
||||
else if(anchored == 1)
|
||||
playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1)
|
||||
anchored = 2
|
||||
user << "You screw in the [src]'s hoses."
|
||||
panel_open = 1
|
||||
|
||||
for(var/obj/machinery/portable_atmospherics/hydroponics/h in range(1,src))
|
||||
spawn()
|
||||
h.update_icon()
|
||||
|
||||
//Held item is not an open container, check to see if it can be used (this code was already here) --FalseIncarnate
|
||||
if(istype(O, /obj/item/weapon/wirecutters) || istype(O, /obj/item/weapon/scalpel))
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
var/global/list/acceptable_items // List of the items you can put in
|
||||
var/global/list/acceptable_reagents // List of the reagents you can put in
|
||||
var/global/max_n_of_items = 0
|
||||
var/efficiency
|
||||
|
||||
|
||||
// see code/modules/food/recipes_microwave.dm for recipes
|
||||
@@ -43,11 +44,44 @@
|
||||
if (recipe.items)
|
||||
max_n_of_items = max(max_n_of_items,recipe.items.len)
|
||||
|
||||
component_parts = list()
|
||||
component_parts += new /obj/item/weapon/circuitboard/microwave(null)
|
||||
component_parts += new /obj/item/weapon/stock_parts/micro_laser(null)
|
||||
component_parts += new /obj/item/weapon/stock_parts/console_screen(null)
|
||||
component_parts += new /obj/item/stack/cable_coil(null, 2)
|
||||
RefreshParts()
|
||||
|
||||
/obj/machinery/microwave/RefreshParts()
|
||||
var/E
|
||||
for(var/obj/item/weapon/stock_parts/micro_laser/M in component_parts)
|
||||
E += M.rating
|
||||
efficiency = E
|
||||
|
||||
/*******************
|
||||
* Item Adding
|
||||
********************/
|
||||
|
||||
/obj/machinery/microwave/attackby(var/obj/item/O as obj, var/mob/user as mob)
|
||||
if(operating)
|
||||
return
|
||||
if(!broken && dirty < 100)
|
||||
if(default_deconstruction_screwdriver(user, "mw-o", "mw", O))
|
||||
return
|
||||
if(exchange_parts(user, O))
|
||||
return
|
||||
if(istype(O, /obj/item/weapon/wrench))
|
||||
playsound(src, 'sound/items/Ratchet.ogg', 50, 1)
|
||||
if(anchored)
|
||||
anchored = 0
|
||||
user << "<span class='caution'>The [src] can now be moved.</span>"
|
||||
return
|
||||
else if(!anchored)
|
||||
anchored = 1
|
||||
user << "<span class='caution'>The [src] is now secured.</span>"
|
||||
return
|
||||
|
||||
default_deconstruction_crowbar(O)
|
||||
|
||||
if(src.broken > 0)
|
||||
if(src.broken == 2 && istype(O, /obj/item/weapon/screwdriver)) // If it's broken and they're using a screwdriver
|
||||
user.visible_message( \
|
||||
@@ -78,7 +112,7 @@
|
||||
user << "\red It's broken!"
|
||||
return 1
|
||||
else if(src.dirty==100) // The microwave is all dirty so can't be used!
|
||||
if(istype(O, /obj/item/weapon/reagent_containers/spray/cleaner)) // If they're trying to clean it then let them
|
||||
if(istype(O, /obj/item/weapon/reagent_containers/spray/cleaner) || istype(O, /obj/item/weapon/soap)) // If they're trying to clean it then let them
|
||||
user.visible_message( \
|
||||
"\blue [user] starts to clean the microwave.", \
|
||||
"\blue You start to clean the microwave." \
|
||||
@@ -147,6 +181,8 @@
|
||||
********************/
|
||||
|
||||
/obj/machinery/microwave/interact(mob/user as mob) // The microwave Menu
|
||||
if(panel_open || !anchored)
|
||||
return
|
||||
var/dat = ""
|
||||
if(src.broken > 0)
|
||||
dat = {"<TT>Bzzzzttttt</TT>"}
|
||||
@@ -269,7 +305,8 @@
|
||||
stop()
|
||||
if(cooked)
|
||||
cooked.loc = src.loc
|
||||
score_meals++
|
||||
for(var/i=1,i<efficiency,i++)
|
||||
cooked = new cooked.type(loc)
|
||||
return
|
||||
|
||||
/obj/machinery/microwave/proc/wzhzhzh(var/seconds as num)
|
||||
@@ -355,7 +392,7 @@
|
||||
return ffuu
|
||||
|
||||
/obj/machinery/microwave/Topic(href, href_list)
|
||||
if(..())
|
||||
if(..() || panel_open)
|
||||
return
|
||||
|
||||
usr.set_machine(src)
|
||||
|
||||
@@ -272,26 +272,50 @@ Class Procs:
|
||||
uid = gl_uid
|
||||
gl_uid++
|
||||
|
||||
/obj/machinery/proc/default_deconstruction_crowbar()
|
||||
playsound(src.loc, 'sound/items/Crowbar.ogg', 50, 1)
|
||||
var/obj/machinery/constructable_frame/machine_frame/M = new /obj/machinery/constructable_frame/machine_frame(src.loc)
|
||||
M.state = 2
|
||||
M.icon_state = "box_1"
|
||||
for(var/obj/I in component_parts)
|
||||
if(I.reliability != 100 && crit_fail)
|
||||
I.crit_fail = 1
|
||||
I.loc = src.loc
|
||||
del(src)
|
||||
/obj/machinery/proc/default_deconstruction_crowbar(var/obj/item/weapon/crowbar/C, var/ignore_panel = 0)
|
||||
if(istype(C) && (panel_open || ignore_panel))
|
||||
playsound(src.loc, 'sound/items/Crowbar.ogg', 50, 1)
|
||||
var/obj/machinery/constructable_frame/machine_frame/M = new /obj/machinery/constructable_frame/machine_frame(src.loc)
|
||||
M.state = 2
|
||||
M.icon_state = "box_1"
|
||||
for(var/obj/item/I in component_parts)
|
||||
if(I.reliability != 100 && crit_fail)
|
||||
I.crit_fail = 1
|
||||
I.loc = src.loc
|
||||
qdel(src)
|
||||
|
||||
/obj/machinery/proc/default_deconstruction_screwdriver(var/mob/user, var/icon_state_open, var/icon_state_closed)
|
||||
if (!panel_open)
|
||||
panel_open = 1
|
||||
icon_state = icon_state_open
|
||||
user << "<span class='notice'>You open the maintenance hatch of [src].</span>"
|
||||
else
|
||||
panel_open = 0
|
||||
icon_state = icon_state_closed
|
||||
user << "<span class='notice'>You close the maintenance hatch of [src].</span>"
|
||||
/obj/machinery/proc/default_deconstruction_screwdriver(var/mob/user, var/icon_state_open, var/icon_state_closed, var/obj/item/weapon/screwdriver/S)
|
||||
if(istype(S))
|
||||
playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1)
|
||||
if(!panel_open)
|
||||
panel_open = 1
|
||||
icon_state = icon_state_open
|
||||
user << "<span class='notice'>You open the maintenance hatch of [src].</span>"
|
||||
else
|
||||
panel_open = 0
|
||||
icon_state = icon_state_closed
|
||||
user << "<span class='notice'>You close the maintenance hatch of [src].</span>"
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/obj/machinery/proc/default_change_direction_wrench(var/mob/user, var/obj/item/weapon/wrench/W)
|
||||
if(panel_open && istype(W))
|
||||
playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1)
|
||||
dir = pick(WEST,EAST,SOUTH,NORTH)
|
||||
user << "<span class='notice'>You clumsily rotate [src].</span>"
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/obj/machinery/proc/default_unfasten_wrench(mob/user, obj/item/weapon/wrench/W, time = 20)
|
||||
if(istype(W))
|
||||
user << "<span class='notice'>Now [anchored ? "un" : ""]securing [name].</span>"
|
||||
playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1)
|
||||
if(do_after(user, time))
|
||||
user << "<span class='notice'>You've [anchored ? "un" : ""]secured [name].</span>"
|
||||
anchored = !anchored
|
||||
playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1)
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/obj/machinery/proc/state(var/msg)
|
||||
for(var/mob/O in hearers(src, null))
|
||||
@@ -304,15 +328,16 @@ Class Procs:
|
||||
state(text, "blue")
|
||||
playsound(src.loc, 'sound/machines/ping.ogg', 50, 0)
|
||||
|
||||
/obj/machinery/proc/exchange_parts(mob/user, obj/item/weapon/storage/part_replacer/W)
|
||||
/obj/machinery/proc/exchange_parts(mob/user, obj/item/weapon/storage/part_replacer/W)
|
||||
var/shouldplaysound = 0
|
||||
if(istype(W) && component_parts)
|
||||
if(panel_open)
|
||||
var/obj/item/weapon/circuitboard/CB = locate(/obj/item/weapon/circuitboard) in component_parts
|
||||
var/P
|
||||
for(var/obj/item/weapon/stock_parts/A in component_parts)
|
||||
for(var/D in CB.req_components)
|
||||
if(ispath(A.type, text2path(D)))
|
||||
P = text2path(D)
|
||||
if(ispath(A.type, D))
|
||||
P = D
|
||||
break
|
||||
for(var/obj/item/weapon/stock_parts/B in W.contents)
|
||||
if(istype(B, P) && istype(A, P))
|
||||
@@ -323,12 +348,31 @@ Class Procs:
|
||||
component_parts += B
|
||||
B.loc = null
|
||||
user << "<span class='notice'>[A.name] replaced with [B.name].</span>"
|
||||
shouldplaysound = 1
|
||||
break
|
||||
// Power cell snowflake
|
||||
for(var/obj/item/weapon/cell/A in component_parts)
|
||||
for(var/D in CB.req_components)
|
||||
if(ispath(A.type, D))
|
||||
P = D
|
||||
break
|
||||
for(var/obj/item/weapon/cell/B in W.contents)
|
||||
if(istype(B, P) && istype(A, P))
|
||||
if(B.rating > A.rating)
|
||||
W.remove_from_storage(B, src)
|
||||
W.handle_item_insertion(A, 1)
|
||||
component_parts -= A
|
||||
component_parts += B
|
||||
B.loc = null
|
||||
user << "<span class='notice'>[A.name] replaced with [B.name].</span>"
|
||||
break
|
||||
RefreshParts()
|
||||
else
|
||||
user << "<span class='notice'>Following parts detected in the machine:</span>"
|
||||
for(var/var/obj/item/C in component_parts)
|
||||
user << "<span class='notice'> [C.name]</span>"
|
||||
if(shouldplaysound)
|
||||
W.play_rped_sound()
|
||||
return 1
|
||||
else
|
||||
return 0
|
||||
|
||||
@@ -8,187 +8,214 @@
|
||||
idle_power_usage = 5
|
||||
active_power_usage = 1000
|
||||
var/mob/occupant = null
|
||||
var/circuitboard = "/obj/item/weapon/circuitboard/cyborgrecharger"
|
||||
var/recharge_speed
|
||||
var/repairs
|
||||
|
||||
/obj/machinery/recharge_station/New()
|
||||
..()
|
||||
component_parts = list()
|
||||
component_parts += new /obj/item/weapon/circuitboard/cyborgrecharger(src)
|
||||
component_parts += new /obj/item/weapon/stock_parts/capacitor(src)
|
||||
component_parts += new /obj/item/weapon/stock_parts/capacitor(src)
|
||||
component_parts += new /obj/item/weapon/stock_parts/manipulator(src)
|
||||
component_parts += new /obj/item/weapon/cell/high(src)
|
||||
RefreshParts()
|
||||
build_icon()
|
||||
|
||||
|
||||
New()
|
||||
..()
|
||||
build_icon()
|
||||
|
||||
process()
|
||||
if(!(NOPOWER|BROKEN))
|
||||
return
|
||||
|
||||
if(src.occupant)
|
||||
process_occupant()
|
||||
return 1
|
||||
|
||||
|
||||
allow_drop()
|
||||
return 0
|
||||
|
||||
|
||||
relaymove(mob/user as mob)
|
||||
if(user.stat)
|
||||
return
|
||||
src.go_out()
|
||||
/obj/machinery/recharge_station/RefreshParts()
|
||||
recharge_speed = 0
|
||||
repairs = 0
|
||||
for(var/obj/item/weapon/stock_parts/capacitor/C in component_parts)
|
||||
recharge_speed += C.rating * 100
|
||||
for(var/obj/item/weapon/stock_parts/manipulator/M in component_parts)
|
||||
repairs += M.rating - 1
|
||||
for(var/obj/item/weapon/cell/C in component_parts)
|
||||
recharge_speed *= C.maxcharge / 10000
|
||||
|
||||
/obj/machinery/recharge_station/process()
|
||||
if(!(NOPOWER|BROKEN))
|
||||
return
|
||||
|
||||
emp_act(severity)
|
||||
if(stat & (BROKEN|NOPOWER))
|
||||
..(severity)
|
||||
return
|
||||
if(occupant)
|
||||
occupant.emp_act(severity)
|
||||
go_out()
|
||||
..(severity)
|
||||
|
||||
proc
|
||||
build_icon()
|
||||
if(NOPOWER|BROKEN)
|
||||
if(src.occupant)
|
||||
icon_state = "borgcharger1"
|
||||
else
|
||||
icon_state = "borgcharger0"
|
||||
else
|
||||
icon_state = "borgcharger0"
|
||||
|
||||
if(src.occupant)
|
||||
process_occupant()
|
||||
if(src.occupant)
|
||||
if (istype(occupant, /mob/living/silicon/robot))
|
||||
var/mob/living/silicon/robot/R = occupant
|
||||
restock_modules()
|
||||
if(!R.cell)
|
||||
return
|
||||
else if(R.cell.charge >= R.cell.maxcharge)
|
||||
R.cell.charge = R.cell.maxcharge
|
||||
return
|
||||
else
|
||||
R.cell.charge = min(R.cell.charge + 200, R.cell.maxcharge)
|
||||
return
|
||||
return 1
|
||||
|
||||
/obj/machinery/recharge_station/allow_drop()
|
||||
return 0
|
||||
|
||||
/obj/machinery/recharge_station/relaymove(mob/user as mob)
|
||||
if(user.stat)
|
||||
return
|
||||
src.go_out()
|
||||
return
|
||||
|
||||
/obj/machinery/recharge_station/emp_act(severity)
|
||||
if(stat & (BROKEN|NOPOWER))
|
||||
..(severity)
|
||||
return
|
||||
if(occupant)
|
||||
occupant.emp_act(severity)
|
||||
go_out()
|
||||
if(!( src.occupant ))
|
||||
return
|
||||
//for(var/obj/O in src)
|
||||
// O.loc = src.loc
|
||||
if (src.occupant.client)
|
||||
src.occupant.client.eye = src.occupant.client.mob
|
||||
src.occupant.client.perspective = MOB_PERSPECTIVE
|
||||
src.occupant.loc = src.loc
|
||||
src.occupant = null
|
||||
build_icon()
|
||||
src.use_power = 1
|
||||
return
|
||||
..(severity)
|
||||
|
||||
/obj/machinery/recharge_station/proc/build_icon()
|
||||
if(NOPOWER|BROKEN)
|
||||
if(src.occupant)
|
||||
icon_state = "borgcharger1"
|
||||
else
|
||||
icon_state = "borgcharger0"
|
||||
else
|
||||
icon_state = "borgcharger0"
|
||||
|
||||
restock_modules()
|
||||
if(src.occupant)
|
||||
if(istype(occupant, /mob/living/silicon/robot))
|
||||
var/mob/living/silicon/robot/R = occupant
|
||||
if(R.module && R.module.modules)
|
||||
var/list/um = R.contents|R.module.modules
|
||||
// ^ makes sinle list of active (R.contents) and inactive modules (R.module.modules)
|
||||
for(var/obj/O in um)
|
||||
// Engineering
|
||||
if(istype(O,/obj/item/stack/sheet/metal) || istype(O,/obj/item/stack/sheet/rglass) || istype(O,/obj/item/stack/cable_coil))
|
||||
if(O:amount < 50)
|
||||
O:amount += 1
|
||||
// Security
|
||||
if(istype(O,/obj/item/device/flash))
|
||||
if(O:broken)
|
||||
O:broken = 0
|
||||
O:times_used = 0
|
||||
O:icon_state = "flash"
|
||||
if(istype(O,/obj/item/weapon/gun/energy/taser/cyborg))
|
||||
if(O:power_supply.charge < O:power_supply.maxcharge)
|
||||
O:power_supply.give(O:charge_cost)
|
||||
O:update_icon()
|
||||
else
|
||||
O:charge_tick = 0
|
||||
if(istype(O,/obj/item/weapon/melee/baton))
|
||||
var/obj/item/weapon/melee/baton/B = O
|
||||
if(B.bcell)
|
||||
B.bcell.charge = B.bcell.maxcharge
|
||||
//Service
|
||||
if(istype(O,/obj/item/weapon/reagent_containers/food/condiment/enzyme))
|
||||
if(O.reagents.get_reagent_amount("enzyme") < 50)
|
||||
O.reagents.add_reagent("enzyme", 2)
|
||||
//Medical
|
||||
if(istype(O,/obj/item/weapon/reagent_containers/glass/bottle/robot))
|
||||
var/obj/item/weapon/reagent_containers/glass/bottle/robot/B = O
|
||||
if(B.reagent && (B.reagents.get_reagent_amount(B.reagent) < B.volume))
|
||||
B.reagents.add_reagent(B.reagent, 2)
|
||||
//Janitor
|
||||
if(istype(O, /obj/item/device/lightreplacer))
|
||||
var/obj/item/device/lightreplacer/LR = O
|
||||
LR.Charge(R)
|
||||
//Alien
|
||||
if(istype(O,/obj/item/weapon/reagent_containers/spray/alien/smoke))
|
||||
if(O.reagents.get_reagent_amount("water") < 50)
|
||||
O.reagents.add_reagent("water", 2)
|
||||
if(istype(O,/obj/item/weapon/reagent_containers/spray/alien/stun))
|
||||
if(O.reagents.get_reagent_amount("stoxin") < 250)
|
||||
O.reagents.add_reagent("stoxin", 2)
|
||||
|
||||
|
||||
if(R)
|
||||
if(R.module)
|
||||
R.module.respawn_consumable(R)
|
||||
|
||||
//Emagged items for janitor and medical borg
|
||||
if(R.module.emag)
|
||||
if(istype(R.module.emag, /obj/item/weapon/reagent_containers/spray))
|
||||
var/obj/item/weapon/reagent_containers/spray/S = R.module.emag
|
||||
if(S.name == "polyacid spray")
|
||||
S.reagents.add_reagent("pacid", 2)
|
||||
if(S.name == "lube spray")
|
||||
S.reagents.add_reagent("lube", 2)
|
||||
else if(S.name == "acid synthesizer")
|
||||
S.reagents.add_reagent("pacid", 2)
|
||||
S.reagents.add_reagent("sacid", 2)
|
||||
|
||||
|
||||
|
||||
verb
|
||||
move_eject()
|
||||
set category = "Object"
|
||||
set src in oview(1)
|
||||
if (usr.stat != 0)
|
||||
return
|
||||
src.go_out()
|
||||
add_fingerprint(usr)
|
||||
return
|
||||
|
||||
move_inside()
|
||||
set category = "Object"
|
||||
set src in oview(1)
|
||||
if (usr.stat == 2)
|
||||
//Whoever had it so that a borg with a dead cell can't enter this thing should be shot. --NEO
|
||||
return
|
||||
if (!(istype(usr, /mob/living/silicon/)))
|
||||
usr << "\blue <B>Only non-organics may enter the recharger!</B>"
|
||||
return
|
||||
if (src.occupant)
|
||||
usr << "\blue <B>The cell is already occupied!</B>"
|
||||
return
|
||||
if (!usr:cell)
|
||||
usr<<"\blue Without a powercell, you can't be recharged."
|
||||
//Make sure they actually HAVE a cell, now that they can get in while powerless. --NEO
|
||||
return
|
||||
usr.stop_pulling()
|
||||
if(usr && usr.client)
|
||||
usr.client.perspective = EYE_PERSPECTIVE
|
||||
usr.client.eye = src
|
||||
usr.loc = src
|
||||
src.occupant = usr
|
||||
/*for(var/obj/O in src)
|
||||
O.loc = src.loc*/
|
||||
src.add_fingerprint(usr)
|
||||
build_icon()
|
||||
src.use_power = 2
|
||||
return
|
||||
/obj/machinery/recharge_station/attackby(obj/item/P as obj, mob/user as mob)
|
||||
if (istype(P, /obj/item/weapon/screwdriver))
|
||||
if(src.occupant)
|
||||
user << "<span class='notice'>The maintenance panel is locked.</span>"
|
||||
return
|
||||
default_deconstruction_screwdriver(user, "borgdecon2", "borgcharger0", P)
|
||||
return
|
||||
|
||||
if(exchange_parts(user, P))
|
||||
return
|
||||
|
||||
default_deconstruction_crowbar(P)
|
||||
|
||||
/obj/machinery/recharge_station/proc/process_occupant()
|
||||
if(src.occupant)
|
||||
if (istype(occupant, /mob/living/silicon/robot))
|
||||
var/mob/living/silicon/robot/R = occupant
|
||||
restock_modules()
|
||||
if(repairs)
|
||||
R.adjustBruteLoss(-(repairs))
|
||||
R.adjustFireLoss(-(repairs))
|
||||
R.updatehealth()
|
||||
if(R.cell)
|
||||
if(R.cell.charge >= R.cell.maxcharge)
|
||||
R.cell.charge = R.cell.maxcharge
|
||||
else
|
||||
R.cell.charge = min(R.cell.charge + recharge_speed, R.cell.maxcharge)
|
||||
|
||||
/obj/machinery/recharge_station/proc/go_out()
|
||||
if(!( src.occupant ))
|
||||
return
|
||||
//for(var/obj/O in src)
|
||||
// O.loc = src.loc
|
||||
if (src.occupant.client)
|
||||
src.occupant.client.eye = src.occupant.client.mob
|
||||
src.occupant.client.perspective = MOB_PERSPECTIVE
|
||||
src.occupant.loc = src.loc
|
||||
src.occupant = null
|
||||
build_icon()
|
||||
src.use_power = 1
|
||||
return
|
||||
|
||||
/obj/machinery/recharge_station/proc/restock_modules()
|
||||
if(src.occupant)
|
||||
if(istype(occupant, /mob/living/silicon/robot))
|
||||
var/mob/living/silicon/robot/R = occupant
|
||||
var/coeff = recharge_speed / 200
|
||||
if(R.module && R.module.modules)
|
||||
var/list/um = R.contents|R.module.modules
|
||||
// ^ makes sinle list of active (R.contents) and inactive modules (R.module.modules)
|
||||
for(var/obj/O in um)
|
||||
// Engineering
|
||||
if(istype(O,/obj/item/stack/sheet/metal) || istype(O,/obj/item/stack/sheet/rglass) || istype(O,/obj/item/stack/cable_coil))
|
||||
if(O:amount < 50)
|
||||
O:amount += 1 * coeff
|
||||
// Security
|
||||
if(istype(O,/obj/item/device/flash))
|
||||
if(O:broken)
|
||||
O:broken = 0
|
||||
O:times_used = 0
|
||||
O:icon_state = "flash"
|
||||
if(istype(O,/obj/item/weapon/gun/energy/taser/cyborg))
|
||||
if(O:power_supply.charge < O:power_supply.maxcharge)
|
||||
O:power_supply.give(O:charge_cost)
|
||||
O:update_icon()
|
||||
else
|
||||
O:charge_tick = 0
|
||||
if(istype(O,/obj/item/weapon/melee/baton))
|
||||
var/obj/item/weapon/melee/baton/B = O
|
||||
if(B.bcell)
|
||||
B.bcell.charge = B.bcell.maxcharge
|
||||
//Service
|
||||
if(istype(O,/obj/item/weapon/reagent_containers/food/condiment/enzyme))
|
||||
if(O.reagents.get_reagent_amount("enzyme") < 50)
|
||||
O.reagents.add_reagent("enzyme", 2 * coeff)
|
||||
//Medical
|
||||
if(istype(O,/obj/item/weapon/reagent_containers/glass/bottle/robot))
|
||||
var/obj/item/weapon/reagent_containers/glass/bottle/robot/B = O
|
||||
if(B.reagent && (B.reagents.get_reagent_amount(B.reagent) < B.volume))
|
||||
B.reagents.add_reagent(B.reagent, 2 * coeff)
|
||||
//Janitor
|
||||
if(istype(O, /obj/item/device/lightreplacer))
|
||||
var/obj/item/device/lightreplacer/LR = O
|
||||
var/i = 1
|
||||
for(1, i <= coeff, i++)
|
||||
LR.Charge(occupant)
|
||||
//Alien
|
||||
if(istype(O,/obj/item/weapon/reagent_containers/spray/alien/smoke))
|
||||
if(O.reagents.get_reagent_amount("water") < 50)
|
||||
O.reagents.add_reagent("water", 2 * coeff)
|
||||
if(istype(O,/obj/item/weapon/reagent_containers/spray/alien/stun))
|
||||
if(O.reagents.get_reagent_amount("stoxin") < 250)
|
||||
O.reagents.add_reagent("stoxin", 2 * coeff)
|
||||
|
||||
|
||||
if(R)
|
||||
if(R.module)
|
||||
R.module.respawn_consumable(R)
|
||||
|
||||
//Emagged items for janitor and medical borg
|
||||
if(R.module.emag)
|
||||
if(istype(R.module.emag, /obj/item/weapon/reagent_containers/spray))
|
||||
var/obj/item/weapon/reagent_containers/spray/S = R.module.emag
|
||||
if(S.name == "polyacid spray")
|
||||
S.reagents.add_reagent("pacid", 2 * coeff)
|
||||
if(S.name == "lube spray")
|
||||
S.reagents.add_reagent("lube", 2 * coeff)
|
||||
else if(S.name == "acid synthesizer")
|
||||
S.reagents.add_reagent("pacid", 2 * coeff)
|
||||
S.reagents.add_reagent("sacid", 2 * coeff)
|
||||
|
||||
/obj/machinery/recharge_station/verb/move_eject()
|
||||
set category = "Object"
|
||||
set src in oview(1)
|
||||
if (usr.stat != 0)
|
||||
return
|
||||
src.go_out()
|
||||
add_fingerprint(usr)
|
||||
return
|
||||
|
||||
/obj/machinery/recharge_station/verb/move_inside()
|
||||
set category = "Object"
|
||||
set src in oview(1)
|
||||
if (usr.stat == 2)
|
||||
//Whoever had it so that a borg with a dead cell can't enter this thing should be shot. --NEO
|
||||
return
|
||||
if (!(istype(usr, /mob/living/silicon/)))
|
||||
usr << "\blue <b>Only non-organics may enter the recharger!</b>"
|
||||
return
|
||||
if (src.occupant)
|
||||
usr << "\blue <b>The cell is already occupied!</b>"
|
||||
return
|
||||
if (!usr:cell)
|
||||
usr << "\blue <b>Without a powercell, you can't be recharged.</b>"
|
||||
//Make sure they actually HAVE a cell, now that they can get in while powerless. --NEO
|
||||
return
|
||||
if (panel_open)
|
||||
usr << "\blue <b>Close the maintenance panel first.</b>"
|
||||
return
|
||||
usr.stop_pulling()
|
||||
if(usr && usr.client)
|
||||
usr.client.perspective = EYE_PERSPECTIVE
|
||||
usr.client.eye = src
|
||||
usr.loc = src
|
||||
src.occupant = usr
|
||||
/*for(var/obj/O in src)
|
||||
O.loc = src.loc*/
|
||||
src.add_fingerprint(usr)
|
||||
build_icon()
|
||||
src.use_power = 2
|
||||
return
|
||||
@@ -18,7 +18,7 @@
|
||||
var/universal_translate = 0 // set to 1 if it can translate nonhuman speech
|
||||
|
||||
req_access = list(access_tcomsat)
|
||||
|
||||
circuit = "/obj/item/weapon/circuitboard/comm_server"
|
||||
|
||||
attack_hand(mob/user as mob)
|
||||
if(stat & (BROKEN|NOPOWER))
|
||||
|
||||
@@ -77,9 +77,11 @@
|
||||
user << "You finish prying out the components."
|
||||
|
||||
// Drop all the component stuff
|
||||
if(contents.len > 0)
|
||||
for(var/obj/x in src)
|
||||
x.loc = user.loc
|
||||
if(component_parts)
|
||||
for(var/obj/I in component_parts)
|
||||
if(I.reliability != 100 && crit_fail)
|
||||
I.crit_fail = 1
|
||||
I.loc = src.loc
|
||||
else
|
||||
|
||||
// If the machine wasn't made during runtime, probably doesn't have components:
|
||||
@@ -90,13 +92,13 @@
|
||||
for(var/i = 1, i <= C.req_components[I], i++)
|
||||
newpath = text2path(I)
|
||||
var/obj/item/s = new newpath
|
||||
s.loc = user.loc
|
||||
if(istype(P, /obj/item/stack/cable_coil))
|
||||
var/obj/item/stack/cable_coil/A = P
|
||||
s.loc = src.loc
|
||||
if(istype(s, /obj/item/stack/cable_coil))
|
||||
var/obj/item/stack/cable_coil/A = s
|
||||
A.amount = 1
|
||||
|
||||
// Drop a circuit board too
|
||||
C.loc = user.loc
|
||||
C.loc = src.loc
|
||||
|
||||
// Create a machine frame and delete the current machine
|
||||
var/obj/machinery/constructable_frame/machine_frame/F = new
|
||||
|
||||
@@ -18,7 +18,8 @@
|
||||
var/network = "NULL" // the network to probe
|
||||
|
||||
var/temp = "" // temporary feedback messages
|
||||
|
||||
circuit = "/obj/item/weapon/circuitboard/comm_monitor"
|
||||
|
||||
l_color = "#50AB00"
|
||||
|
||||
attack_hand(mob/user as mob)
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
l_color = "#50AB00"
|
||||
|
||||
req_access = list(access_tcomsat)
|
||||
circuit = "/obj/item/weapon/circuitboard/comm_traffic"
|
||||
|
||||
|
||||
proc/update_ide()
|
||||
|
||||
@@ -7,6 +7,39 @@
|
||||
use_power = 1
|
||||
idle_power_usage = 2
|
||||
active_power_usage = 50
|
||||
var/efficiency
|
||||
|
||||
/obj/machinery/telepad/New()
|
||||
..()
|
||||
component_parts = list()
|
||||
component_parts += new /obj/item/weapon/circuitboard/telesci_pad(src)
|
||||
component_parts += new /obj/item/bluespace_crystal/artificial(src)
|
||||
component_parts += new /obj/item/bluespace_crystal/artificial(src)
|
||||
component_parts += new /obj/item/weapon/stock_parts/capacitor(src)
|
||||
component_parts += new /obj/item/weapon/stock_parts/console_screen(src)
|
||||
component_parts += new /obj/item/stack/cable_coil(src, 1)
|
||||
RefreshParts()
|
||||
|
||||
/obj/machinery/telepad/RefreshParts()
|
||||
var/E
|
||||
for(var/obj/item/weapon/stock_parts/capacitor/C in component_parts)
|
||||
E += C.rating
|
||||
efficiency = E
|
||||
|
||||
/obj/machinery/telepad/attackby(obj/item/I, mob/user)
|
||||
if(default_deconstruction_screwdriver(user, "pad-idle-o", "pad-idle", I))
|
||||
return
|
||||
|
||||
if(panel_open)
|
||||
if(istype(I, /obj/item/device/multitool))
|
||||
var/obj/item/device/multitool/M = I
|
||||
M.buffer = src
|
||||
user << "<span class='caution'>You save the data in the [I.name]'s buffer.</span>"
|
||||
|
||||
if(exchange_parts(user, I))
|
||||
return
|
||||
|
||||
default_deconstruction_crowbar(I)
|
||||
|
||||
/obj/machinery/telepad_cargo
|
||||
name = "cargo telepad"
|
||||
@@ -17,29 +50,29 @@
|
||||
use_power = 1
|
||||
idle_power_usage = 2
|
||||
active_power_usage = 50
|
||||
var/stage = 0
|
||||
|
||||
var/stage = 0
|
||||
|
||||
/obj/machinery/telepad_cargo/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
if(istype(W, /obj/item/weapon/wrench))
|
||||
playsound(src, 'sound/items/Ratchet.ogg', 50, 1)
|
||||
if(anchored)
|
||||
anchored = 0
|
||||
user << "\blue The [src] can now be moved."
|
||||
user << "<span class='caution'>The [src] can now be moved.</span>"
|
||||
else if(!anchored)
|
||||
anchored = 1
|
||||
user << "\blue The [src] is now secured."
|
||||
user << "<span class='caution'>The [src] is now secured.</span>"
|
||||
if(istype(W, /obj/item/weapon/screwdriver))
|
||||
if(stage == 0)
|
||||
playsound(src, 'sound/items/Screwdriver.ogg', 50, 1)
|
||||
user << "\blue You unscrew the telepad's tracking beacon."
|
||||
user << "<span class='caution'>You unscrew the telepad's tracking beacon.</span>"
|
||||
stage = 1
|
||||
else if(stage == 1)
|
||||
playsound(src, 'sound/items/Screwdriver.ogg', 50, 1)
|
||||
user << "\blue You screw in the telepad's tracking beacon."
|
||||
user << "<span class='caution'>You screw in the telepad's tracking beacon.</span>"
|
||||
stage = 0
|
||||
if(istype(W, /obj/item/weapon/weldingtool) && stage == 1)
|
||||
playsound(src, 'sound/items/Welder.ogg', 50, 1)
|
||||
user << "\blue You disassemble the telepad."
|
||||
user << "<span class='caution'>You disassemble the telepad.</span>"
|
||||
new /obj/item/stack/sheet/metal(get_turf(src))
|
||||
new /obj/item/stack/sheet/glass(get_turf(src))
|
||||
del(src)
|
||||
qdel(src)
|
||||
+359
-318
@@ -1,165 +1,236 @@
|
||||
/obj/machinery/computer/teleporter
|
||||
name = "Teleporter"
|
||||
name = "Teleporter Control Console"
|
||||
desc = "Used to control a linked teleportation Hub and Station."
|
||||
icon_state = "teleport"
|
||||
circuit = "/obj/item/weapon/circuitboard/teleporter"
|
||||
var/obj/item/locked = null
|
||||
var/obj/item/device/sps/locked = null
|
||||
var/regime_set = "Teleporter"
|
||||
var/id = null
|
||||
var/one_time_use = 0 //Used for one-time-use teleport cards (such as clown planet coordinates.)
|
||||
var/obj/machinery/teleport/station/power_station
|
||||
var/calibrating
|
||||
var/turf/target //Used for one-time-use teleport cards (such as clown planet coordinates.)
|
||||
//Setting this to 1 will set src.locked to null after a player enters the portal and will not allow hand-teles to open portals to that location.
|
||||
var/data[0]
|
||||
|
||||
/obj/machinery/computer/teleporter/New()
|
||||
src.id = "[rand(1000, 9999)]"
|
||||
link_power_station()
|
||||
..()
|
||||
return
|
||||
|
||||
/*
|
||||
/obj/machinery/computer/teleporter/attackby(I as obj, mob/living/user as mob)
|
||||
if(istype(I, /obj/item/weapon/card/data/))
|
||||
var/obj/item/weapon/card/data/C = I
|
||||
if(stat & (NOPOWER|BROKEN) & (C.function != "teleporter"))
|
||||
src.attack_hand()
|
||||
/obj/machinery/computer/teleporter/initialize()
|
||||
link_power_station()
|
||||
|
||||
var/obj/L = null
|
||||
|
||||
for(var/obj/effect/landmark/sloc in landmarks_list)
|
||||
if(sloc.name != C.data) continue
|
||||
if(locate(/mob/living) in sloc.loc) continue
|
||||
L = sloc
|
||||
/obj/machinery/computer/teleporter/proc/link_power_station()
|
||||
if(power_station)
|
||||
return
|
||||
for(dir in list(NORTH,EAST,SOUTH,WEST))
|
||||
power_station = locate(/obj/machinery/teleport/station, get_step(src, dir))
|
||||
if(power_station)
|
||||
break
|
||||
|
||||
if(!L)
|
||||
L = locate("landmark*[C.data]") // use old stype
|
||||
|
||||
|
||||
if(istype(L, /obj/effect/landmark/) && istype(L.loc, /turf))
|
||||
usr << "You insert the coordinates into the machine."
|
||||
usr << "A message flashes across the screen reminding the traveller that the nuclear authentication disk is to remain on the station at all times."
|
||||
user.drop_item()
|
||||
del(I)
|
||||
|
||||
if(C.data == "Clown Land")
|
||||
//whoops
|
||||
for(var/mob/O in hearers(src, null))
|
||||
O.show_message("\red Incoming bluespace portal detected, unable to lock in.", 2)
|
||||
|
||||
for(var/obj/machinery/teleport/hub/H in range(1))
|
||||
var/amount = rand(2,5)
|
||||
for(var/i=0;i<amount;i++)
|
||||
new /mob/living/simple_animal/hostile/carp(get_turf(H))
|
||||
//
|
||||
else
|
||||
for(var/mob/O in hearers(src, null))
|
||||
O.show_message("\blue Locked In", 2)
|
||||
src.locked = L
|
||||
one_time_use = 1
|
||||
|
||||
src.add_fingerprint(usr)
|
||||
else
|
||||
..()
|
||||
|
||||
return
|
||||
*/
|
||||
return power_station
|
||||
|
||||
/obj/machinery/computer/teleporter/attackby(I as obj, mob/living/user as mob)
|
||||
if(istype(I, /obj/item/weapon/card/data/))
|
||||
var/obj/item/weapon/card/data/C = I
|
||||
if(stat & (NOPOWER|BROKEN) & (C.function != "teleporter"))
|
||||
src.attack_hand()
|
||||
|
||||
var/obj/L = null
|
||||
|
||||
for(var/obj/effect/landmark/sloc in landmarks_list)
|
||||
if(sloc.name != C.data) continue
|
||||
if(locate(/mob/living) in sloc.loc) continue
|
||||
L = sloc
|
||||
break
|
||||
|
||||
if(!L)
|
||||
L = locate("landmark*[C.data]") // use old stype
|
||||
|
||||
|
||||
if(istype(L, /obj/effect/landmark/) && istype(L.loc, /turf))
|
||||
src.locked = L
|
||||
one_time_use = 1
|
||||
|
||||
usr << "You insert the coordinates into the machine."
|
||||
usr << "A message flashes across the screen reminding the traveller that the nuclear authentication disk is to remain on the station at all times."
|
||||
user.drop_item()
|
||||
del(I)
|
||||
|
||||
for(var/mob/O in hearers(src, null))
|
||||
O.show_message("\blue Locked In", 2)
|
||||
src.add_fingerprint(usr)
|
||||
if(istype(I, /obj/item/device/sps))
|
||||
var/obj/item/device/sps/L = I
|
||||
if(L.locked_location && !(stat & (NOPOWER|BROKEN)))
|
||||
user.before_take_item(L)
|
||||
L.loc = src
|
||||
locked = L
|
||||
user << "<span class='caution'>You insert the SPS device into the [name]'s slot.</span>"
|
||||
src.attack_hand(user)
|
||||
else
|
||||
user << "<span class='warning'>No useable data was found on te SPS device.</span>"
|
||||
else
|
||||
..()
|
||||
|
||||
return
|
||||
|
||||
/obj/machinery/computer/teleporter/attack_paw()
|
||||
src.attack_hand()
|
||||
/obj/machinery/computer/teleporter/attack_paw(mob/user)
|
||||
usr << "You are too primitive to use this computer."
|
||||
return
|
||||
|
||||
/obj/machinery/teleport/station/attack_ai()
|
||||
src.attack_hand()
|
||||
/obj/machinery/computer/teleporter/attack_ai(mob/user)
|
||||
src.attack_hand(user)
|
||||
|
||||
/obj/machinery/computer/teleporter/attack_hand()
|
||||
/obj/machinery/computer/teleporter/attack_hand(mob/user)
|
||||
ui_interact(user)
|
||||
|
||||
/obj/machinery/computer/teleporter/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1)
|
||||
if(..())
|
||||
return
|
||||
if(stat & (NOPOWER|BROKEN))
|
||||
return
|
||||
|
||||
data["powerstation"] = power_station
|
||||
if(power_station)
|
||||
data["teleporterhub"] = power_station.teleporter_hub
|
||||
data["calibrated"] = power_station.teleporter_hub.calibrated
|
||||
data["accurate"] = power_station.teleporter_hub.accurate
|
||||
else
|
||||
data["teleporterhub"] = null
|
||||
data["calibrated"] = null
|
||||
data["accurate"] = null
|
||||
data["regime"] = regime_set
|
||||
data["target"] = (!target) ? "None" : get_area(target)
|
||||
data["calibrating"] = calibrating
|
||||
data["locked"] = locked
|
||||
|
||||
var/list/L = list()
|
||||
var/list/areaindex = list()
|
||||
// Set up the Nano UI
|
||||
ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
|
||||
if (!ui)
|
||||
ui = new(user, src, ui_key, "teleporter_console.tmpl", "Teleporter Console UI", 400, 400)
|
||||
ui.set_initial_data(data)
|
||||
ui.open()
|
||||
|
||||
for(var/obj/item/device/radio/beacon/R in world)
|
||||
var/turf/T = get_turf(R)
|
||||
if (!T)
|
||||
continue
|
||||
if(T.z == 2 || T.z > 6)
|
||||
if (T.z == 7 & src.emagged == 1)
|
||||
// This should be empty, allows for it to continue if the z-level is 7 and the machine.
|
||||
/obj/machinery/computer/teleporter/Topic(href, href_list)
|
||||
if(..())
|
||||
return
|
||||
|
||||
if(href_list["eject"])
|
||||
eject()
|
||||
nanomanager.update_uis(src)
|
||||
return
|
||||
|
||||
if(!check_hub_connection())
|
||||
usr << "<span class='warning'>Error: Unable to detect hub.</span>"
|
||||
nanomanager.update_uis(src)
|
||||
return
|
||||
if(calibrating)
|
||||
usr << "<span class='warning'>Error: Calibration in progress. Stand by.</span>"
|
||||
nanomanager.update_uis(src)
|
||||
return
|
||||
|
||||
if(href_list["regimeset"])
|
||||
power_station.engaged = 0
|
||||
power_station.teleporter_hub.update_icon()
|
||||
power_station.teleporter_hub.calibrated = 0
|
||||
reset_regime()
|
||||
nanomanager.update_uis(src)
|
||||
if(href_list["settarget"])
|
||||
power_station.engaged = 0
|
||||
power_station.teleporter_hub.update_icon()
|
||||
power_station.teleporter_hub.calibrated = 0
|
||||
set_target(usr)
|
||||
nanomanager.update_uis(src)
|
||||
if(href_list["locked"])
|
||||
power_station.engaged = 0
|
||||
power_station.teleporter_hub.update_icon()
|
||||
power_station.teleporter_hub.calibrated = 0
|
||||
target = get_turf(locked.locked_location)
|
||||
nanomanager.update_uis(src)
|
||||
if(href_list["calibrate"])
|
||||
if(!target)
|
||||
usr << "<span class='warning'>Error: No target set to calibrate to.</span>"
|
||||
nanomanager.update_uis(src)
|
||||
return
|
||||
if(power_station.teleporter_hub.calibrated || power_station.teleporter_hub.accurate >= 3)
|
||||
usr << "<span class='notice'>Hub is already calibrated.</span>"
|
||||
nanomanager.update_uis(src)
|
||||
return
|
||||
src.visible_message("<span class='notice'>Processing hub calibration to target...</span>")
|
||||
|
||||
calibrating = 1
|
||||
nanomanager.update_uis(src)
|
||||
spawn(50 * (3 - power_station.teleporter_hub.accurate)) //Better parts mean faster calibration
|
||||
calibrating = 0
|
||||
if(check_hub_connection())
|
||||
power_station.teleporter_hub.calibrated = 1
|
||||
src.visible_message("<span class='notice'>Calibration complete.</span>")
|
||||
else
|
||||
continue
|
||||
var/tmpname = T.loc.name
|
||||
if(areaindex[tmpname])
|
||||
tmpname = "[tmpname] ([++areaindex[tmpname]])"
|
||||
else
|
||||
areaindex[tmpname] = 1
|
||||
L[tmpname] = R
|
||||
src.visible_message("<span class='warning'>Error: Unable to detect hub.</span>")
|
||||
nanomanager.update_uis(src)
|
||||
|
||||
for (var/obj/item/weapon/implant/tracking/I in world)
|
||||
if (!I.implanted || !ismob(I.loc))
|
||||
continue
|
||||
else
|
||||
var/mob/M = I.loc
|
||||
if (M.stat == 2)
|
||||
if (M.timeofdeath + 6000 < world.time)
|
||||
continue
|
||||
var/turf/T = get_turf(M)
|
||||
if(T) continue
|
||||
if(T.z == 2) continue
|
||||
var/tmpname = M.real_name
|
||||
nanomanager.update_uis(src)
|
||||
|
||||
/obj/machinery/computer/teleporter/proc/check_hub_connection()
|
||||
if(!power_station)
|
||||
return
|
||||
if(!power_station.teleporter_hub)
|
||||
return
|
||||
return 1
|
||||
|
||||
/obj/machinery/computer/teleporter/proc/reset_regime()
|
||||
target = null
|
||||
if(regime_set == "Teleporter")
|
||||
regime_set = "Gate"
|
||||
else
|
||||
regime_set = "Teleporter"
|
||||
|
||||
/obj/machinery/computer/teleporter/proc/eject()
|
||||
if(locked)
|
||||
locked.loc = src.loc
|
||||
locked = null
|
||||
|
||||
/obj/machinery/computer/teleporter/proc/set_target(mob/user)
|
||||
if(regime_set == "Teleporter")
|
||||
var/list/L = list()
|
||||
var/list/areaindex = list()
|
||||
|
||||
for(var/obj/item/device/radio/beacon/R in world)
|
||||
var/turf/T = get_turf(R)
|
||||
if (!T)
|
||||
continue
|
||||
if(T.z == 2 || T.z > 7)
|
||||
continue
|
||||
var/tmpname = T.loc.name
|
||||
if(areaindex[tmpname])
|
||||
tmpname = "[tmpname] ([++areaindex[tmpname]])"
|
||||
else
|
||||
areaindex[tmpname] = 1
|
||||
L[tmpname] = I
|
||||
L[tmpname] = R
|
||||
|
||||
var/desc = input("Please select a location to lock in.", "Locking Computer") in L
|
||||
src.locked = L[desc]
|
||||
for(var/mob/O in hearers(src, null))
|
||||
O.show_message("\blue Locked In", 2)
|
||||
src.add_fingerprint(usr)
|
||||
return
|
||||
for (var/obj/item/weapon/implant/tracking/I in world)
|
||||
if (!I.implanted || !ismob(I.loc))
|
||||
continue
|
||||
else
|
||||
var/mob/M = I.loc
|
||||
if (M.stat == 2)
|
||||
if (M.timeofdeath + 6000 < world.time)
|
||||
continue
|
||||
var/turf/T = get_turf(M)
|
||||
if(!T) continue
|
||||
if(T.z == 2) continue
|
||||
var/tmpname = M.real_name
|
||||
if(areaindex[tmpname])
|
||||
tmpname = "[tmpname] ([++areaindex[tmpname]])"
|
||||
else
|
||||
areaindex[tmpname] = 1
|
||||
L[tmpname] = I
|
||||
|
||||
/obj/machinery/computer/teleporter/verb/set_id(t as text)
|
||||
set category = "Object"
|
||||
set name = "Set teleporter ID"
|
||||
set src in oview(1)
|
||||
set desc = "ID Tag:"
|
||||
var/desc = input("Please select a location to lock in.", "Locking Computer") in L
|
||||
target = L[desc]
|
||||
|
||||
if(stat & (NOPOWER|BROKEN) || !istype(usr,/mob/living))
|
||||
return
|
||||
if (t)
|
||||
src.id = t
|
||||
else
|
||||
var/list/L = list()
|
||||
var/list/areaindex = list()
|
||||
var/list/S = power_station.linked_stations
|
||||
if(!S.len)
|
||||
user << "<span class='alert'>No connected stations located.</span>"
|
||||
return
|
||||
for(var/obj/machinery/teleport/station/R in S)
|
||||
var/turf/T = get_turf(R)
|
||||
if (!T || !R.teleporter_hub || !R.teleporter_console)
|
||||
continue
|
||||
if(T.z == 2 || T.z > 7)
|
||||
continue
|
||||
var/tmpname = T.loc.name
|
||||
if(areaindex[tmpname])
|
||||
tmpname = "[tmpname] ([++areaindex[tmpname]])"
|
||||
else
|
||||
areaindex[tmpname] = 1
|
||||
L[tmpname] = R
|
||||
var/desc = input("Please select a station to lock in.", "Locking Computer") in L
|
||||
target = L[desc]
|
||||
if(target)
|
||||
var/obj/machinery/teleport/station/trg = target
|
||||
trg.linked_stations |= power_station
|
||||
trg.stat &= ~NOPOWER
|
||||
if(trg.teleporter_hub)
|
||||
trg.teleporter_hub.stat &= ~NOPOWER
|
||||
trg.teleporter_hub.update_icon()
|
||||
if(trg.teleporter_console)
|
||||
trg.teleporter_console.stat &= ~NOPOWER
|
||||
trg.teleporter_console.update_icon()
|
||||
return
|
||||
|
||||
/proc/find_loc(obj/R as obj)
|
||||
@@ -168,15 +239,13 @@
|
||||
while(!istype(T, /turf))
|
||||
T = T.loc
|
||||
if(!T || istype(T, /area)) return null
|
||||
return T
|
||||
|
||||
return T
|
||||
|
||||
/obj/machinery/teleport
|
||||
name = "teleport"
|
||||
icon = 'icons/obj/stationobjs.dmi'
|
||||
density = 1
|
||||
anchored = 1.0
|
||||
var/lockeddown = 0
|
||||
|
||||
|
||||
/obj/machinery/teleport/hub
|
||||
name = "teleporter hub"
|
||||
@@ -186,138 +255,163 @@
|
||||
use_power = 1
|
||||
idle_power_usage = 10
|
||||
active_power_usage = 2000
|
||||
var/obj/machinery/teleport/station/power_station
|
||||
var/calibrated //Calibration prevents mutation
|
||||
|
||||
/obj/machinery/teleport/hub/New()
|
||||
..()
|
||||
link_power_station()
|
||||
component_parts = list()
|
||||
component_parts += new /obj/item/weapon/circuitboard/teleporter_hub(null)
|
||||
component_parts += new /obj/item/bluespace_crystal/artificial(null)
|
||||
component_parts += new /obj/item/bluespace_crystal/artificial(null)
|
||||
component_parts += new /obj/item/bluespace_crystal/artificial(null)
|
||||
component_parts += new /obj/item/weapon/stock_parts/matter_bin(null)
|
||||
RefreshParts()
|
||||
|
||||
/obj/machinery/teleport/hub/initialize()
|
||||
link_power_station()
|
||||
|
||||
/obj/machinery/teleport/hub/RefreshParts()
|
||||
var/A = 0
|
||||
for(var/obj/item/weapon/stock_parts/matter_bin/M in component_parts)
|
||||
A += M.rating
|
||||
accurate = A
|
||||
|
||||
/obj/machinery/teleport/hub/proc/link_power_station()
|
||||
if(power_station)
|
||||
return
|
||||
for(dir in list(NORTH,EAST,SOUTH,WEST))
|
||||
power_station = locate(/obj/machinery/teleport/station, get_step(src, dir))
|
||||
if(power_station)
|
||||
break
|
||||
return power_station
|
||||
|
||||
/obj/machinery/teleport/hub/Bumped(M as mob|obj)
|
||||
spawn()
|
||||
if (src.icon_state == "tele1")
|
||||
teleport(M)
|
||||
use_power(5000)
|
||||
if(power_station && power_station.engaged && !panel_open)
|
||||
teleport(M)
|
||||
use_power(5000)
|
||||
return
|
||||
|
||||
/obj/machinery/teleport/hub/proc/teleport(atom/movable/M as mob|obj)
|
||||
var/atom/l = src.loc
|
||||
var/obj/machinery/computer/teleporter/com = locate(/obj/machinery/computer/teleporter, locate(l.x - 2, l.y, l.z))
|
||||
/obj/machinery/teleport/hub/attackby(obj/item/W, mob/user)
|
||||
if(default_deconstruction_screwdriver(user, "tele-o", "tele0", W))
|
||||
return
|
||||
|
||||
if(exchange_parts(user, W))
|
||||
return
|
||||
|
||||
default_deconstruction_crowbar(W)
|
||||
|
||||
/obj/machinery/teleport/hub/proc/teleport(atom/movable/M as mob|obj, turf/T)
|
||||
var/obj/machinery/computer/teleporter/com = power_station.teleporter_console
|
||||
if (!com)
|
||||
return
|
||||
if (!com.locked)
|
||||
for(var/mob/O in hearers(src, null))
|
||||
O.show_message("\red Failure: Cannot authenticate locked on coordinates. Please reinstate coordinate matrix.")
|
||||
if (!com.target)
|
||||
visible_message("<span class='notice'>Cannot authenticate locked on coordinates. Please reinstate coordinate matrix.</span>")
|
||||
return
|
||||
if (istype(M, /atom/movable))
|
||||
if(prob(5) && !accurate) //oh dear a problem, put em in deep space
|
||||
if(!calibrated && prob(25 - ((accurate) * 10))) //oh dear a problem
|
||||
do_teleport(M, locate(rand((2*TRANSITIONEDGE), world.maxx - (2*TRANSITIONEDGE)), rand((2*TRANSITIONEDGE), world.maxy - (2*TRANSITIONEDGE)), 3), 2)
|
||||
else
|
||||
do_teleport(M, com.locked) //dead-on precision
|
||||
|
||||
if(com.one_time_use) //Make one-time-use cards only usable one time!
|
||||
com.one_time_use = 0
|
||||
com.locked = null
|
||||
else
|
||||
var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread
|
||||
s.set_up(5, 1, src)
|
||||
s.start()
|
||||
for(var/mob/B in hearers(src, null))
|
||||
B.show_message("\blue Test fire completed.")
|
||||
else
|
||||
do_teleport(M, com.target)
|
||||
calibrated = 0
|
||||
return
|
||||
/*
|
||||
/proc/do_teleport(atom/movable/M as mob|obj, atom/destination, precision)
|
||||
if(istype(M, /obj/effect))
|
||||
del(M)
|
||||
return
|
||||
if (istype(M, /obj/item/weapon/disk/nuclear)) // Don't let nuke disks get teleported --NeoFite
|
||||
for(var/mob/O in viewers(M, null))
|
||||
O.show_message(text("\red <B>The [] bounces off of the portal!</B>", M.name), 1)
|
||||
return
|
||||
if (istype(M, /mob/living))
|
||||
var/mob/living/MM = M
|
||||
if(MM.check_contents_for(/obj/item/weapon/disk/nuclear))
|
||||
MM << "\red Something you are carrying seems to be unable to pass through the portal. Better drop it if you want to go through."
|
||||
return
|
||||
var/disky = 0
|
||||
for (var/atom/O in M.contents) //I'm pretty sure this accounts for the maximum amount of container in container stacking. --NeoFite
|
||||
if (istype(O, /obj/item/weapon/storage) || istype(O, /obj/item/weapon/gift))
|
||||
for (var/obj/OO in O.contents)
|
||||
if (istype(OO, /obj/item/weapon/storage) || istype(OO, /obj/item/weapon/gift))
|
||||
for (var/obj/OOO in OO.contents)
|
||||
if (istype(OOO, /obj/item/weapon/disk/nuclear))
|
||||
disky = 1
|
||||
if (istype(OO, /obj/item/weapon/disk/nuclear))
|
||||
disky = 1
|
||||
if (istype(O, /obj/item/weapon/disk/nuclear))
|
||||
disky = 1
|
||||
if (istype(O, /mob/living))
|
||||
var/mob/living/MM = O
|
||||
if(MM.check_contents_for(/obj/item/weapon/disk/nuclear))
|
||||
disky = 1
|
||||
if (disky)
|
||||
for(var/mob/P in viewers(M, null))
|
||||
P.show_message(text("\red <B>The [] bounces off of the portal!</B>", M.name), 1)
|
||||
return
|
||||
|
||||
//Bags of Holding cause bluespace teleportation to go funky. --NeoFite
|
||||
if (istype(M, /mob/living))
|
||||
var/mob/living/MM = M
|
||||
if(MM.check_contents_for(/obj/item/weapon/storage/backpack/holding))
|
||||
MM << "\red The Bluespace interface on your Bag of Holding interferes with the teleport!"
|
||||
precision = rand(1,100)
|
||||
if (istype(M, /obj/item/weapon/storage/backpack/holding))
|
||||
precision = rand(1,100)
|
||||
for (var/atom/O in M.contents) //I'm pretty sure this accounts for the maximum amount of container in container stacking. --NeoFite
|
||||
if (istype(O, /obj/item/weapon/storage) || istype(O, /obj/item/weapon/gift))
|
||||
for (var/obj/OO in O.contents)
|
||||
if (istype(OO, /obj/item/weapon/storage) || istype(OO, /obj/item/weapon/gift))
|
||||
for (var/obj/OOO in OO.contents)
|
||||
if (istype(OOO, /obj/item/weapon/storage/backpack/holding))
|
||||
precision = rand(1,100)
|
||||
if (istype(OO, /obj/item/weapon/storage/backpack/holding))
|
||||
precision = rand(1,100)
|
||||
if (istype(O, /obj/item/weapon/storage/backpack/holding))
|
||||
precision = rand(1,100)
|
||||
if (istype(O, /mob/living))
|
||||
var/mob/living/MM = O
|
||||
if(MM.check_contents_for(/obj/item/weapon/storage/backpack/holding))
|
||||
precision = rand(1,100)
|
||||
|
||||
|
||||
var/turf/destturf = get_turf(destination)
|
||||
|
||||
var/tx = destturf.x + rand(precision * -1, precision)
|
||||
var/ty = destturf.y + rand(precision * -1, precision)
|
||||
|
||||
var/tmploc
|
||||
|
||||
if (ismob(destination.loc)) //If this is an implant.
|
||||
tmploc = locate(tx, ty, destturf.z)
|
||||
/obj/machinery/teleport/hub/update_icon()
|
||||
if(panel_open)
|
||||
icon_state = "tele-o"
|
||||
else if(power_station && power_station.engaged)
|
||||
icon_state = "tele1"
|
||||
else
|
||||
tmploc = locate(tx, ty, destination.z)
|
||||
icon_state = "tele0"
|
||||
|
||||
if(tx == destturf.x && ty == destturf.y && (istype(destination.loc, /obj/structure/closet) || istype(destination.loc, /obj/structure/closet/secure_closet)))
|
||||
tmploc = destination.loc
|
||||
/obj/machinery/teleport/hub/syndicate/New()
|
||||
..()
|
||||
component_parts += new /obj/item/weapon/stock_parts/matter_bin/super(null)
|
||||
RefreshParts()
|
||||
|
||||
if(tmploc==null)
|
||||
return
|
||||
|
||||
M.loc = tmploc
|
||||
sleep(2)
|
||||
|
||||
var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread
|
||||
s.set_up(5, 1, M)
|
||||
s.start()
|
||||
return
|
||||
*/
|
||||
|
||||
/obj/machinery/teleport/station
|
||||
name = "station"
|
||||
desc = "It's the station thingy of a teleport thingy." //seriously, wtf.
|
||||
desc = "The power control station for a bluespace teleporter."
|
||||
icon_state = "controller"
|
||||
var/active = 0
|
||||
var/engaged = 0
|
||||
use_power = 1
|
||||
idle_power_usage = 10
|
||||
active_power_usage = 2000
|
||||
var/obj/machinery/computer/teleporter/teleporter_console
|
||||
var/obj/machinery/teleport/hub/teleporter_hub
|
||||
var/list/linked_stations = list()
|
||||
var/efficiency = 0
|
||||
|
||||
/obj/machinery/teleport/station/attackby(var/obj/item/weapon/W)
|
||||
src.attack_hand()
|
||||
/obj/machinery/teleport/station/New()
|
||||
..()
|
||||
component_parts = list()
|
||||
component_parts += new /obj/item/weapon/circuitboard/teleporter_station(null)
|
||||
component_parts += new /obj/item/bluespace_crystal/artificial(null)
|
||||
component_parts += new /obj/item/bluespace_crystal/artificial(null)
|
||||
component_parts += new /obj/item/weapon/stock_parts/capacitor(null)
|
||||
component_parts += new /obj/item/weapon/stock_parts/capacitor(null)
|
||||
component_parts += new /obj/item/weapon/stock_parts/console_screen(null)
|
||||
RefreshParts()
|
||||
link_console_and_hub()
|
||||
|
||||
/obj/machinery/teleport/station/initialize()
|
||||
link_console_and_hub()
|
||||
|
||||
/obj/machinery/teleport/station/RefreshParts()
|
||||
var/E
|
||||
for(var/obj/item/weapon/stock_parts/capacitor/C in component_parts)
|
||||
E += C.rating
|
||||
efficiency = E - 1
|
||||
|
||||
/obj/machinery/teleport/station/proc/link_console_and_hub()
|
||||
for(dir in list(NORTH,EAST,SOUTH,WEST))
|
||||
teleporter_hub = locate(/obj/machinery/teleport/hub, get_step(src, dir))
|
||||
if(teleporter_hub)
|
||||
teleporter_hub.link_power_station()
|
||||
break
|
||||
for(dir in list(NORTH,EAST,SOUTH,WEST))
|
||||
teleporter_console = locate(/obj/machinery/computer/teleporter, get_step(src, dir))
|
||||
if(teleporter_console)
|
||||
teleporter_console.link_power_station()
|
||||
break
|
||||
return teleporter_hub && teleporter_console
|
||||
|
||||
|
||||
/obj/machinery/teleport/station/Destroy()
|
||||
if(teleporter_hub)
|
||||
teleporter_hub.update_icon()
|
||||
..()
|
||||
|
||||
/obj/machinery/teleport/station/attackby(var/obj/item/weapon/W, mob/user)
|
||||
if(istype(W, /obj/item/device/multitool) && !panel_open)
|
||||
var/obj/item/device/multitool/M = W
|
||||
if(M.buffer && istype(M.buffer, /obj/machinery/teleport/station) && M.buffer != src)
|
||||
if(linked_stations.len < efficiency)
|
||||
linked_stations.Add(M.buffer)
|
||||
M.buffer = null
|
||||
user << "<span class='caution'>You upload the data from the [W.name]'s buffer.</span>"
|
||||
else
|
||||
user << "<span class='alert'>This station cant hold more information, try to use better parts.</span>"
|
||||
if(default_deconstruction_screwdriver(user, "controller-o", "controller", W))
|
||||
return
|
||||
|
||||
if(exchange_parts(user, W))
|
||||
return
|
||||
|
||||
default_deconstruction_crowbar(W)
|
||||
|
||||
if(panel_open)
|
||||
if(istype(W, /obj/item/device/multitool))
|
||||
var/obj/item/device/multitool/M = W
|
||||
M.buffer = src
|
||||
user << "<span class='caution'>You download the data to the [W.name]'s buffer.</span>"
|
||||
return
|
||||
if(istype(W, /obj/item/weapon/wirecutters))
|
||||
link_console_and_hub()
|
||||
user << "<span class='caution'>You reconnect the station to nearby machinery.</span>"
|
||||
return
|
||||
|
||||
/obj/machinery/teleport/station/attack_paw()
|
||||
src.attack_hand()
|
||||
@@ -325,93 +419,40 @@
|
||||
/obj/machinery/teleport/station/attack_ai()
|
||||
src.attack_hand()
|
||||
|
||||
/obj/machinery/teleport/station/attack_hand()
|
||||
if(engaged)
|
||||
src.disengage()
|
||||
/obj/machinery/teleport/station/attack_hand(mob/user)
|
||||
if(!panel_open)
|
||||
toggle(user)
|
||||
else
|
||||
src.engage()
|
||||
user << "<span class='notice'>Close the maintenance panel first.</span>"
|
||||
|
||||
/obj/machinery/teleport/station/proc/engage()
|
||||
if(stat & (BROKEN|NOPOWER))
|
||||
/obj/machinery/teleport/station/proc/toggle(mob/user)
|
||||
if (stat & (BROKEN|NOPOWER) || !teleporter_hub || !teleporter_console)
|
||||
return
|
||||
|
||||
var/atom/l = src.loc
|
||||
var/atom/com = locate(/obj/machinery/teleport/hub, locate(l.x + 1, l.y, l.z))
|
||||
if (com)
|
||||
com.icon_state = "tele1"
|
||||
if (teleporter_hub.panel_open)
|
||||
user << "<span class='notice'>Close the hub's maintenance panel first.</span>"
|
||||
return
|
||||
if (teleporter_console.target)
|
||||
src.engaged = !src.engaged
|
||||
use_power(5000)
|
||||
for(var/mob/O in hearers(src, null))
|
||||
O.show_message("\blue Teleporter engaged!", 2)
|
||||
src.add_fingerprint(usr)
|
||||
src.engaged = 1
|
||||
return
|
||||
|
||||
/obj/machinery/teleport/station/proc/disengage()
|
||||
if(stat & (BROKEN|NOPOWER))
|
||||
return
|
||||
|
||||
var/atom/l = src.loc
|
||||
var/atom/com = locate(/obj/machinery/teleport/hub, locate(l.x + 1, l.y, l.z))
|
||||
if (com)
|
||||
com.icon_state = "tele0"
|
||||
for(var/mob/O in hearers(src, null))
|
||||
O.show_message("\blue Teleporter disengaged!", 2)
|
||||
src.add_fingerprint(usr)
|
||||
src.engaged = 0
|
||||
return
|
||||
|
||||
/obj/machinery/teleport/station/verb/testfire()
|
||||
set name = "Test Fire Teleporter"
|
||||
set category = "Object"
|
||||
set src in oview(1)
|
||||
|
||||
if(stat & (BROKEN|NOPOWER) || !istype(usr,/mob/living))
|
||||
return
|
||||
|
||||
var/atom/l = src.loc
|
||||
var/obj/machinery/teleport/hub/com = locate(/obj/machinery/teleport/hub, locate(l.x + 1, l.y, l.z))
|
||||
if (com && !active)
|
||||
active = 1
|
||||
for(var/mob/O in hearers(src, null))
|
||||
O.show_message("\blue Test firing!", 2)
|
||||
com.teleport()
|
||||
use_power(5000)
|
||||
|
||||
spawn(30)
|
||||
active=0
|
||||
|
||||
src.add_fingerprint(usr)
|
||||
visible_message("<span class='notice'>Teleporter [engaged ? "" : "dis"]engaged!</span>")
|
||||
else
|
||||
visible_message("<span class='alert'>No target detected.</span>")
|
||||
src.engaged = 0
|
||||
teleporter_hub.update_icon()
|
||||
src.add_fingerprint(user)
|
||||
return
|
||||
|
||||
/obj/machinery/teleport/station/power_change()
|
||||
..()
|
||||
if(stat & NOPOWER)
|
||||
update_icon()
|
||||
if(teleporter_hub)
|
||||
teleporter_hub.update_icon()
|
||||
|
||||
/obj/machinery/teleport/station/update_icon()
|
||||
if(panel_open)
|
||||
icon_state = "controller-o"
|
||||
else if(stat & NOPOWER)
|
||||
icon_state = "controller-p"
|
||||
var/obj/machinery/teleport/hub/com = locate(/obj/machinery/teleport/hub, locate(x + 1, y, z))
|
||||
if(com)
|
||||
com.icon_state = "tele0"
|
||||
else
|
||||
icon_state = "controller"
|
||||
|
||||
|
||||
/obj/effect/laser/Bump()
|
||||
src.range--
|
||||
return
|
||||
|
||||
/obj/effect/laser/Move()
|
||||
src.range--
|
||||
return
|
||||
|
||||
/atom/proc/laserhit(L as obj)
|
||||
return 1
|
||||
|
||||
|
||||
/obj/machinery/computer/teleporter/attackby(I as obj, user as mob) //Emagging.
|
||||
if(istype(I,/obj/item/weapon/card/emag))
|
||||
if (src.emagged == 0)
|
||||
user << "\blue You scramble the Teleporter's circuits. You should be able to teleport to more places now!"
|
||||
src.emagged = 1
|
||||
else
|
||||
user << "\red The machine seems unaffected by the card swipe..."
|
||||
else
|
||||
return attack_hand(user)
|
||||
+128
-34
@@ -57,7 +57,6 @@
|
||||
var/obj/item/weapon/coin/coin
|
||||
var/datum/wires/vending/wires = null
|
||||
|
||||
|
||||
/obj/machinery/vending/New()
|
||||
..()
|
||||
wires = new(src)
|
||||
@@ -82,7 +81,13 @@
|
||||
return
|
||||
|
||||
|
||||
|
||||
/obj/machinery/vending/Destroy()
|
||||
del(wires)
|
||||
wires = null
|
||||
del(coin)
|
||||
coin = null
|
||||
..()
|
||||
|
||||
/obj/machinery/vending/ex_act(severity)
|
||||
switch(severity)
|
||||
if(1.0)
|
||||
@@ -96,7 +101,14 @@
|
||||
if(prob(25))
|
||||
malfunction()
|
||||
|
||||
|
||||
/obj/machinery/vending/RefreshParts() //Better would be to make constructable child
|
||||
if(component_parts)
|
||||
build_inventory(products, start_empty = 1)
|
||||
build_inventory(contraband, 1, 1)
|
||||
build_inventory(premium, 0, 1, 1)
|
||||
for(var/obj/item/weapon/vending_refill/VR in component_parts)
|
||||
refill_inventory(VR, product_records)
|
||||
|
||||
/obj/machinery/vending/blob_act()
|
||||
if(prob(75))
|
||||
malfunction()
|
||||
@@ -104,7 +116,7 @@
|
||||
del(src)
|
||||
|
||||
|
||||
/obj/machinery/vending/proc/build_inventory(var/list/productlist,hidden=0,req_coin=0)
|
||||
/obj/machinery/vending/proc/build_inventory(var/list/productlist,hidden=0,req_coin=0,start_empty = null)
|
||||
for(var/typepath in productlist)
|
||||
var/amount = productlist[typepath]
|
||||
var/price = prices[typepath]
|
||||
@@ -114,7 +126,8 @@
|
||||
var/datum/data/vending_product/R = new /datum/data/vending_product()
|
||||
|
||||
R.product_path = typepath
|
||||
R.amount = amount
|
||||
if(!start_empty)
|
||||
R.amount = amount
|
||||
R.max_amount = amount
|
||||
R.price = price
|
||||
R.display_color = pick("red","blue","green")
|
||||
@@ -166,13 +179,28 @@
|
||||
break
|
||||
return total
|
||||
|
||||
|
||||
/obj/machinery/vending/attackby(obj/item/weapon/W, mob/user)
|
||||
if(panel_open)
|
||||
if(default_unfasten_wrench(user, W, time = 60))
|
||||
return
|
||||
|
||||
if(component_parts && istype(W, /obj/item/weapon/crowbar))
|
||||
var/datum/data/vending_product/machine = product_records
|
||||
for(var/datum/data/vending_product/machine_content in machine)
|
||||
while(machine_content.amount !=0)
|
||||
for(var/obj/item/weapon/vending_refill/VR in component_parts)
|
||||
VR.charges++
|
||||
machine_content.amount--
|
||||
if(!machine_content.amount)
|
||||
break
|
||||
default_deconstruction_crowbar(W)
|
||||
|
||||
if(istype(W, /obj/item/weapon/card/emag))
|
||||
emagged = 1
|
||||
user << "You short out the product lock on [src]"
|
||||
return
|
||||
else if(istype(W, /obj/item/weapon/screwdriver))
|
||||
else if(istype(W, /obj/item/weapon/screwdriver) && anchored)
|
||||
playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1)
|
||||
panel_open = !panel_open
|
||||
user << "You [panel_open ? "open" : "close"] the maintenance panel."
|
||||
overlays.Cut()
|
||||
@@ -184,36 +212,15 @@
|
||||
if(panel_open)
|
||||
attack_hand(user)
|
||||
return
|
||||
else if(istype(W, /obj/item/weapon/card) && currently_vending)
|
||||
var/obj/item/weapon/card/I = W
|
||||
scan_card(I)
|
||||
else if(istype(W, /obj/item/weapon/coin) && premium.len > 0)
|
||||
user.drop_item()
|
||||
W.loc = src
|
||||
coin = W
|
||||
user << "<span class='notice'>You insert [W] into [src].</span>"
|
||||
return
|
||||
|
||||
else if(istype(W, /obj/item/weapon/wrench))
|
||||
|
||||
if(do_after(user, 20))
|
||||
if(!src) return
|
||||
playsound(src.loc, 'sound/items/Ratchet.ogg', 100, 1)
|
||||
switch (anchored)
|
||||
if (0)
|
||||
anchored = 1
|
||||
user.visible_message("[user] tightens the bolts securing \the [src] to the floor.", "You tighten the bolts securing \the [src] to the floor.")
|
||||
if (1)
|
||||
user.visible_message("[user] unfastens the bolts securing \the [src] to the floor.", "You unfasten the bolts securing \the [src] to the floor.")
|
||||
anchored = 0
|
||||
return
|
||||
|
||||
else if(src.panel_open)
|
||||
for(var/datum/data/vending_product/R in product_records)
|
||||
if(istype(W, R.product_path))
|
||||
stock(R, user)
|
||||
del(W)
|
||||
|
||||
else if(istype(W, /obj/item/weapon/card) && currently_vending)
|
||||
var/obj/item/weapon/card/I = W
|
||||
scan_card(I)
|
||||
else if(istype(W, refill_canister) && refill_canister != null)
|
||||
if(stat & (BROKEN|NOPOWER))
|
||||
user << "<span class='notice'>It does nothing.</span>"
|
||||
@@ -234,6 +241,8 @@
|
||||
else
|
||||
..()
|
||||
|
||||
|
||||
|
||||
/obj/machinery/vending/proc/scan_card(var/obj/item/weapon/card/I)
|
||||
if(!currently_vending) return
|
||||
if (istype(I, /obj/item/weapon/card/id))
|
||||
@@ -661,6 +670,16 @@
|
||||
contraband = list(/obj/item/device/flashlight = 5,/obj/item/device/assembly/timer = 2)
|
||||
product_ads = "Only the finest!;Have some tools.;The most robust equipment.;The finest gear in space!"
|
||||
|
||||
/obj/machinery/vending/boozeomat/New()
|
||||
..()
|
||||
component_parts = list()
|
||||
var/obj/item/weapon/circuitboard/vendor/V = new(null)
|
||||
V.set_type(type)
|
||||
component_parts += V
|
||||
component_parts += new /obj/item/weapon/vending_refill/boozeomat(0)
|
||||
component_parts += new /obj/item/weapon/vending_refill/boozeomat(0)
|
||||
component_parts += new /obj/item/weapon/vending_refill/boozeomat(0)
|
||||
|
||||
/obj/machinery/vending/coffee
|
||||
name = "Hot Drinks machine"
|
||||
desc = "A vending machine which dispenses hot drinks."
|
||||
@@ -673,7 +692,15 @@
|
||||
prices = list(/obj/item/weapon/reagent_containers/food/drinks/coffee = 25, /obj/item/weapon/reagent_containers/food/drinks/tea = 25, /obj/item/weapon/reagent_containers/food/drinks/h_chocolate = 25)
|
||||
refill_canister = /obj/item/weapon/vending_refill/coffee
|
||||
|
||||
|
||||
/obj/machinery/vending/coffee/New()
|
||||
..()
|
||||
component_parts = list()
|
||||
var/obj/item/weapon/circuitboard/vendor/V = new(null)
|
||||
V.set_type(type)
|
||||
component_parts += V
|
||||
component_parts += new /obj/item/weapon/vending_refill/coffee(0)
|
||||
component_parts += new /obj/item/weapon/vending_refill/coffee(0)
|
||||
component_parts += new /obj/item/weapon/vending_refill/coffee(0)
|
||||
|
||||
/obj/machinery/vending/snack
|
||||
name = "Getmore Chocolate Corp"
|
||||
@@ -699,6 +726,16 @@
|
||||
prices = list(/obj/item/weapon/reagent_containers/food/snacks/chinese/chowmein = 50, /obj/item/weapon/reagent_containers/food/snacks/chinese/tao = 50, /obj/item/weapon/reagent_containers/food/snacks/chinese/newdles = 50,
|
||||
/obj/item/weapon/reagent_containers/food/snacks/chinese/rice = 50, /obj/item/weapon/reagent_containers/food/snacks/wingfangchu = 50)
|
||||
|
||||
/obj/machinery/vending/snack/New()
|
||||
..()
|
||||
component_parts = list()
|
||||
var/obj/item/weapon/circuitboard/vendor/V = new(null)
|
||||
V.set_type(type)
|
||||
component_parts += V
|
||||
component_parts += new /obj/item/weapon/vending_refill/snack(0)
|
||||
component_parts += new /obj/item/weapon/vending_refill/snack(0)
|
||||
component_parts += new /obj/item/weapon/vending_refill/snack(0)
|
||||
|
||||
/obj/machinery/vending/cola
|
||||
name = "Robust Softdrinks"
|
||||
desc = "A softdrink vendor provided by Robust Industries, LLC."
|
||||
@@ -724,7 +761,16 @@
|
||||
/obj/item/weapon/cartridge/janitor = 10,/obj/item/weapon/cartridge/signal/toxins = 10,/obj/item/device/pda/heads = 10,
|
||||
/obj/item/weapon/cartridge/captain = 3,/obj/item/weapon/cartridge/quartermaster = 10)
|
||||
|
||||
|
||||
/obj/machinery/vending/cola/New()
|
||||
..()
|
||||
component_parts = list()
|
||||
var/obj/item/weapon/circuitboard/vendor/V = new(null)
|
||||
V.set_type(type)
|
||||
component_parts += V
|
||||
component_parts += new /obj/item/weapon/vending_refill/cola(0)
|
||||
component_parts += new /obj/item/weapon/vending_refill/cola(0)
|
||||
component_parts += new /obj/item/weapon/vending_refill/cola(0)
|
||||
|
||||
/obj/machinery/vending/cigarette
|
||||
name = "Cigarette machine" //OCD had to be uppercase to look nice with the new formating
|
||||
desc = "If you want to get cancer, might as well do it in style"
|
||||
@@ -738,6 +784,16 @@
|
||||
prices = list(/obj/item/weapon/storage/fancy/cigarettes = 60,/obj/item/weapon/storage/box/matches = 10,/obj/item/weapon/lighter/random = 60, /obj/item/weapon/rollingpaperpack = 20)
|
||||
refill_canister = /obj/item/weapon/vending_refill/cigarette
|
||||
|
||||
/obj/machinery/vending/cigarette/New()
|
||||
..()
|
||||
component_parts = list()
|
||||
var/obj/item/weapon/circuitboard/vendor/V = new(null)
|
||||
V.set_type(type)
|
||||
component_parts += V
|
||||
component_parts += new /obj/item/weapon/vending_refill/cigarette(0)
|
||||
component_parts += new /obj/item/weapon/vending_refill/cigarette(0)
|
||||
component_parts += new /obj/item/weapon/vending_refill/cigarette(0)
|
||||
|
||||
/obj/machinery/vending/medical
|
||||
name = "NanoMed Plus"
|
||||
desc = "Medical drug dispenser."
|
||||
@@ -783,6 +839,16 @@
|
||||
/obj/item/stack/medical/ointment =3,/obj/item/device/healthanalyzer = 3)
|
||||
contraband = list(/obj/item/weapon/reagent_containers/pill/tox = 3)
|
||||
|
||||
/obj/machinery/vending/wallmed1/syndicate
|
||||
name = "SyndiMed Plus"
|
||||
desc = "<b>EVIL</b> wall-mounted Medical Equipment dispenser."
|
||||
icon_state = "syndimed"
|
||||
icon_deny = "syndimed-deny"
|
||||
product_ads = "Go end some lives!;The best stuff for your ship.;Only the finest tools.;Natural chemicals!;This stuff saves lives.;Don't you want some?;Ping!"
|
||||
req_access_txt = "150"
|
||||
products = list(/obj/item/stack/medical/bruise_pack = 2,/obj/item/stack/medical/ointment = 2,/obj/item/weapon/reagent_containers/hypospray/autoinjector = 4,/obj/item/device/healthanalyzer = 1)
|
||||
contraband = list(/obj/item/weapon/reagent_containers/syringe/antitoxin = 4,/obj/item/weapon/reagent_containers/syringe/antiviral = 4,/obj/item/weapon/reagent_containers/pill/tox = 1)
|
||||
|
||||
/obj/machinery/vending/security
|
||||
name = "SecTech"
|
||||
desc = "A security equipment vendor"
|
||||
@@ -864,6 +930,17 @@
|
||||
contraband = list(/obj/item/clothing/suit/cardborg = 1,/obj/item/clothing/head/cardborg = 1,/obj/item/clothing/suit/judgerobe = 1,/obj/item/clothing/head/powdered_wig = 1,/obj/item/weapon/gun/magic/wand = 1)
|
||||
premium = list(/obj/item/clothing/suit/hgpirate = 1, /obj/item/clothing/head/hgpiratecap = 1, /obj/item/clothing/head/helmet/roman = 1, /obj/item/clothing/head/helmet/roman/legionaire = 1, /obj/item/clothing/under/roman = 1, /obj/item/clothing/shoes/roman = 1)
|
||||
refill_canister = /obj/item/weapon/vending_refill/autodrobe
|
||||
|
||||
/obj/machinery/vending/cigarette/New()
|
||||
..()
|
||||
component_parts = list()
|
||||
var/obj/item/weapon/circuitboard/vendor/V = new(null)
|
||||
V.set_type(type)
|
||||
component_parts += V
|
||||
component_parts += new /obj/item/weapon/vending_refill/cigarette(0)
|
||||
component_parts += new /obj/item/weapon/vending_refill/cigarette(0)
|
||||
component_parts += new /obj/item/weapon/vending_refill/cigarette(0)
|
||||
|
||||
/obj/machinery/vending/dinnerware
|
||||
name = "Dinnerware"
|
||||
desc = "A kitchen and restaurant equipment vendor"
|
||||
@@ -969,7 +1046,6 @@
|
||||
contraband = list(/obj/item/clothing/under/syndicate/tacticool = 5,/obj/item/clothing/under/color/orange = 5,/obj/item/clothing/under/psyche = 5)
|
||||
premium = list(/obj/item/clothing/under/rainbow = 1)
|
||||
|
||||
//THIS IS WHERE THE FEET LIVE, GIT YE SOME
|
||||
/obj/machinery/vending/shoedispenser
|
||||
name = "Shoelord 9000"
|
||||
desc = "Wow, hatlord looked fancy, suitlord looked streamlined, and this is just normal. The guy who disigned these must be an idiot."
|
||||
@@ -979,3 +1055,21 @@
|
||||
contraband = list(/obj/item/clothing/shoes/jackboots = 5,/obj/item/clothing/shoes/orange = 5)
|
||||
premium = list(/obj/item/clothing/shoes/rainbow = 1)
|
||||
|
||||
/obj/machinery/vending/syndicigs
|
||||
name = "Suspicious Cigarette Machine"
|
||||
desc = "Smoke 'em if you've got 'em."
|
||||
product_slogans = "Space cigs taste good like a cigarette should.;I'd rather toolbox than switch.;Smoke!;Don't believe the reports - smoke today!"
|
||||
product_ads = "Probably not bad for you!;Don't believe the scientists!;It's good for you!;Don't quit, buy more!;Smoke!;Nicotine heaven.;Best cigarettes since 2150.;Award-winning cigs."
|
||||
vend_delay = 34
|
||||
icon_state = "cigs"
|
||||
products = list(/obj/item/weapon/storage/fancy/cigarettes/syndicate = 10,/obj/item/weapon/lighter/random = 5)
|
||||
|
||||
/obj/machinery/vending/syndisnack
|
||||
name = "Getmore Chocolate Corp"
|
||||
desc = "A modified snack machine courtesy of the Getmore Chocolate Corporation, based out of Mars"
|
||||
product_slogans = "Try our new nougat bar!;Twice the calories for half the price!"
|
||||
product_ads = "The healthiest!;Award-winning chocolate bars!;Mmm! So good!;Oh my god it's so juicy!;Have a snack.;Snacks are good for you!;Have some more Getmore!;Best quality snacks straight from mars.;We love chocolate!;Try our new jerky!"
|
||||
icon_state = "snack"
|
||||
products = list(/obj/item/weapon/reagent_containers/food/snacks/chips =6,/obj/item/weapon/reagent_containers/food/snacks/sosjerky = 6,
|
||||
/obj/item/weapon/reagent_containers/food/snacks/syndicake = 6, /obj/item/weapon/reagent_containers/food/snacks/cheesiehonkers = 6)
|
||||
refill_canister = /obj/item/weapon/vending_refill/snack
|
||||
+117
-183
@@ -1,218 +1,152 @@
|
||||
/turf/simulated/floor/mech_bay_recharge_floor
|
||||
name = "Mech Bay Recharge Station"
|
||||
icon = 'icons/mecha/mech_bay.dmi'
|
||||
icon_state = "recharge_floor"
|
||||
var/obj/machinery/mech_bay_recharge_port/recharge_port
|
||||
var/obj/machinery/computer/mech_bay_power_console/recharge_console
|
||||
var/obj/mecha/recharging_mecha = null
|
||||
|
||||
Entered(var/obj/mecha/mecha)
|
||||
. = ..()
|
||||
if(istype(mecha))
|
||||
mecha.occupant_message("<b>Initializing power control devices.</b>")
|
||||
init_devices()
|
||||
if(recharge_console && recharge_port)
|
||||
recharging_mecha = mecha
|
||||
recharge_console.mecha_in(mecha)
|
||||
return
|
||||
else if(!recharge_console)
|
||||
mecha.occupant_message("<font color='red'>Control console not found. Terminating.</font>")
|
||||
else if(!recharge_port)
|
||||
mecha.occupant_message("<font color='red'>Power port not found. Terminating.</font>")
|
||||
return
|
||||
|
||||
Exited(atom)
|
||||
. = ..()
|
||||
if(atom == recharging_mecha)
|
||||
recharging_mecha = null
|
||||
if(recharge_console)
|
||||
recharge_console.mecha_out()
|
||||
return
|
||||
|
||||
proc/init_devices()
|
||||
recharge_console = locate() in range(1,src)
|
||||
recharge_port = locate(/obj/machinery/mech_bay_recharge_port, get_step(src, WEST))
|
||||
if(recharge_console)
|
||||
recharge_console.recharge_floor = src
|
||||
if(recharge_port)
|
||||
recharge_console.recharge_port = recharge_port
|
||||
if(recharge_port)
|
||||
recharge_port.recharge_floor = src
|
||||
if(recharge_console)
|
||||
recharge_port.recharge_console = recharge_console
|
||||
return
|
||||
|
||||
/turf/simulated/floor/mech_bay_recharge_floor // Whose idea it was
|
||||
name = "Mech Bay Recharge Station" // Recharging turfs
|
||||
icon = 'icons/turf/floors.dmi' // That are set in stone to check the west turf for recharge port
|
||||
icon_state = "recharge_floor" // Some people just want to watch the world burn i guess
|
||||
|
||||
/turf/simulated/floor/mech_bay_recharge_floor/break_tile()
|
||||
src.ChangeTurf(/turf/simulated/floor/plating)
|
||||
|
||||
/turf/simulated/floor/mech_bay_recharge_floor/airless
|
||||
icon_state = "recharge_floor_asteroid"
|
||||
oxygen = 0.01
|
||||
nitrogen = 0.01
|
||||
temperature = TCMB
|
||||
|
||||
/obj/machinery/mech_bay_recharge_port
|
||||
name = "Mech Bay Power Port"
|
||||
density = 1
|
||||
anchored = 1
|
||||
dir = 4
|
||||
icon = 'icons/mecha/mech_bay.dmi'
|
||||
icon_state = "recharge_port"
|
||||
var/turf/simulated/floor/mech_bay_recharge_floor/recharge_floor
|
||||
var/obj/mecha/recharging_mech
|
||||
var/obj/machinery/computer/mech_bay_power_console/recharge_console
|
||||
var/datum/global_iterator/mech_bay_recharger/pr_recharger
|
||||
var/max_charge = 50
|
||||
var/on = 0
|
||||
var/repairability = 0
|
||||
var/turf/recharging_turf = null
|
||||
|
||||
New()
|
||||
..()
|
||||
pr_recharger = new /datum/global_iterator/mech_bay_recharger(null,0)
|
||||
/obj/machinery/mech_bay_recharge_port/New()
|
||||
..()
|
||||
component_parts = list()
|
||||
component_parts += new /obj/item/weapon/circuitboard/mech_recharger(src)
|
||||
component_parts += new /obj/item/weapon/stock_parts/capacitor(src)
|
||||
component_parts += new /obj/item/weapon/stock_parts/capacitor(src)
|
||||
component_parts += new /obj/item/weapon/stock_parts/capacitor(src)
|
||||
component_parts += new /obj/item/weapon/stock_parts/capacitor(src)
|
||||
component_parts += new /obj/item/weapon/stock_parts/capacitor(src)
|
||||
component_parts += new /obj/item/stack/cable_coil(src, 1)
|
||||
RefreshParts()
|
||||
recharging_turf = get_step(loc, dir)
|
||||
|
||||
/obj/machinery/mech_bay_recharge_port/RefreshParts()
|
||||
var/MC
|
||||
for(var/obj/item/weapon/stock_parts/capacitor/C in component_parts)
|
||||
MC += C.rating
|
||||
max_charge = MC * 25
|
||||
|
||||
/obj/machinery/mech_bay_recharge_port/process()
|
||||
if(stat & NOPOWER || !recharge_console)
|
||||
return
|
||||
if(!recharging_mech)
|
||||
recharging_mech = locate(/obj/mecha) in recharging_turf
|
||||
if(recharging_mech)
|
||||
recharge_console.update_icon()
|
||||
if(recharging_mech && recharging_mech.cell)
|
||||
if(recharging_mech.cell.charge < recharging_mech.cell.maxcharge)
|
||||
var/delta = min(max_charge, recharging_mech.cell.maxcharge - recharging_mech.cell.charge)
|
||||
recharging_mech.give_power(delta)
|
||||
use_power(delta*150)
|
||||
else
|
||||
recharge_console.update_icon()
|
||||
if(recharging_mech.loc != recharging_turf)
|
||||
recharging_mech = null
|
||||
recharge_console.update_icon()
|
||||
|
||||
|
||||
/obj/machinery/mech_bay_recharge_port/attackby(obj/item/I, mob/user)
|
||||
if(default_deconstruction_screwdriver(user, "recharge_port-o", "recharge_port", I))
|
||||
return
|
||||
|
||||
proc/start_charge(var/obj/mecha/recharging_mecha)
|
||||
if(stat&(NOPOWER|BROKEN))
|
||||
recharging_mecha.occupant_message("<font color='red'>Power port not responding. Terminating.</font>")
|
||||
return 0
|
||||
else
|
||||
if(recharging_mecha.cell)
|
||||
recharging_mecha.occupant_message("Now charging...")
|
||||
pr_recharger.start(list(src,recharging_mecha))
|
||||
return 1
|
||||
else
|
||||
return 0
|
||||
|
||||
proc/stop_charge()
|
||||
if(recharge_console && !recharge_console.stat)
|
||||
recharge_console.icon_state = initial(recharge_console.icon_state)
|
||||
pr_recharger.stop()
|
||||
if(default_change_direction_wrench(user, I))
|
||||
recharging_turf = get_step(loc, dir)
|
||||
return
|
||||
|
||||
proc/active()
|
||||
if(pr_recharger.active())
|
||||
return 1
|
||||
else
|
||||
return 0
|
||||
|
||||
power_change()
|
||||
if(powered())
|
||||
stat &= ~NOPOWER
|
||||
else
|
||||
spawn(rand(0, 15))
|
||||
stat |= NOPOWER
|
||||
pr_recharger.stop()
|
||||
if(exchange_parts(user, I))
|
||||
return
|
||||
|
||||
proc/set_voltage(new_voltage)
|
||||
if(new_voltage && isnum(new_voltage))
|
||||
pr_recharger.max_charge = new_voltage
|
||||
return 1
|
||||
else
|
||||
return 0
|
||||
|
||||
|
||||
/datum/global_iterator/mech_bay_recharger
|
||||
delay = 20
|
||||
var/max_charge = 45
|
||||
check_for_null = 0 //since port.stop_charge() must be called. The checks are made in process()
|
||||
|
||||
process(var/obj/machinery/mech_bay_recharge_port/port, var/obj/mecha/mecha)
|
||||
if(!port)
|
||||
return 0
|
||||
if(mecha && mecha in port.recharge_floor)
|
||||
if(!mecha.cell) return
|
||||
var/delta = min(max_charge, mecha.cell.maxcharge - mecha.cell.charge)
|
||||
if(delta>0)
|
||||
mecha.give_power(delta)
|
||||
port.use_power(delta*150)
|
||||
else
|
||||
mecha.occupant_message("<font color='blue'><b>Fully charged.</b></font>")
|
||||
port.stop_charge()
|
||||
else
|
||||
port.stop_charge()
|
||||
return
|
||||
|
||||
|
||||
|
||||
default_deconstruction_crowbar(I)
|
||||
|
||||
/obj/machinery/computer/mech_bay_power_console
|
||||
name = "Mech Bay Power Control Console"
|
||||
desc = "Used to control mechbay power ports."
|
||||
density = 1
|
||||
anchored = 1
|
||||
icon = 'icons/obj/computer.dmi'
|
||||
icon_state = "recharge_comp"
|
||||
circuit = "/obj/item/weapon/circuitboard/mech_bay_power_console"
|
||||
var/autostart = 1
|
||||
var/voltage = 45
|
||||
var/turf/simulated/floor/mech_bay_recharge_floor/recharge_floor
|
||||
circuit = /obj/item/weapon/circuitboard/mech_bay_power_console
|
||||
var/obj/machinery/mech_bay_recharge_port/recharge_port
|
||||
|
||||
proc/mecha_in(var/obj/mecha/mecha)
|
||||
if(stat&(NOPOWER|BROKEN))
|
||||
mecha.occupant_message("<font color='red'>Control console not responding. Terminating...</font>")
|
||||
return
|
||||
if(recharge_port && autostart)
|
||||
var/answer = recharge_port.start_charge(mecha)
|
||||
if(answer)
|
||||
recharge_port.set_voltage(voltage)
|
||||
src.icon_state = initial(src.icon_state)+"_on"
|
||||
/obj/machinery/computer/mech_bay_power_console/attack_ai(mob/user)
|
||||
return interact(user)
|
||||
|
||||
/obj/machinery/computer/mech_bay_power_console/attack_hand(mob/user)
|
||||
if(..())
|
||||
return
|
||||
interact(user)
|
||||
|
||||
proc/mecha_out()
|
||||
if(recharge_port)
|
||||
recharge_port.stop_charge()
|
||||
/obj/machinery/computer/mech_bay_power_console/interact(mob/user)
|
||||
var/data
|
||||
if(!recharge_port)
|
||||
data += "<div class='statusDisplay'>No recharging port detected.</div><BR>"
|
||||
data += "<A href='?src=\ref[src];reconnect=1'>Reconnect</A>"
|
||||
else
|
||||
data += "<h3>Mech status</h3>"
|
||||
if(!recharge_port.recharging_mech)
|
||||
data += "<div class='statusDisplay'>No mech detected.</div>"
|
||||
else
|
||||
data += "<div class='statusDisplay'>Integrity: [recharge_port.recharging_mech.health]<BR>"
|
||||
data += "Power: [recharge_port.recharging_mech.cell.charge]/[recharge_port.recharging_mech.cell.maxcharge]</div>"
|
||||
|
||||
var/datum/browser/popup = new(user, "mech recharger", name, 300, 300)
|
||||
popup.set_content(data)
|
||||
popup.open()
|
||||
return
|
||||
|
||||
/obj/machinery/computer/mech_bay_power_console/Topic(href, href_list)
|
||||
if(..())
|
||||
return
|
||||
if(href_list["reconnect"])
|
||||
reconnect()
|
||||
updateUsrDialog()
|
||||
|
||||
|
||||
power_change()
|
||||
if(stat & BROKEN)
|
||||
icon_state = initial(icon_state)+"_broken"
|
||||
/obj/machinery/computer/mech_bay_power_console/proc/reconnect()
|
||||
if(recharge_port)
|
||||
return
|
||||
recharge_port = locate(/obj/machinery/mech_bay_recharge_port) in range(1)
|
||||
if(!recharge_port)
|
||||
for(var/D in cardinal)
|
||||
var/turf/A = get_step(src, D)
|
||||
A = get_step(A, D)
|
||||
recharge_port = locate(/obj/machinery/mech_bay_recharge_port) in A
|
||||
if(recharge_port)
|
||||
recharge_port.stop_charge()
|
||||
else if(powered())
|
||||
icon_state = initial(icon_state)
|
||||
stat &= ~NOPOWER
|
||||
break
|
||||
if(recharge_port)
|
||||
if(!recharge_port.recharge_console)
|
||||
recharge_port.recharge_console = src
|
||||
else
|
||||
spawn(rand(0, 15))
|
||||
icon_state = initial(icon_state)+"_nopower"
|
||||
stat |= NOPOWER
|
||||
if(recharge_port)
|
||||
recharge_port.stop_charge()
|
||||
recharge_port = null
|
||||
|
||||
set_broken()
|
||||
icon_state = initial(icon_state)+"_broken"
|
||||
stat |= BROKEN
|
||||
if(recharge_port)
|
||||
recharge_port.stop_charge()
|
||||
|
||||
attack_hand(mob/user as mob)
|
||||
if(..()) return
|
||||
var/output = "<html><head><title>[src.name]</title></head><body>"
|
||||
if(!recharge_floor)
|
||||
output += "<font color='red'>Mech Bay Recharge Station not initialized.</font><br>"
|
||||
else
|
||||
output += {"<b>Mech Bay Recharge Station Data:</b><div style='margin-left: 15px;'>
|
||||
<b>Mecha: </b>[recharge_floor.recharging_mecha||"None"]<br>"}
|
||||
if(recharge_floor.recharging_mecha)
|
||||
var/cell_charge = recharge_floor.recharging_mecha.get_charge()
|
||||
output += "<b>Cell charge: </b>[isnull(cell_charge)?"No powercell found":"[recharge_floor.recharging_mecha.cell.charge]/[recharge_floor.recharging_mecha.cell.maxcharge]"]<br>"
|
||||
output += "</div>"
|
||||
if(!recharge_port)
|
||||
output += "<font color='red'>Mech Bay Power Port not initialized.</font><br>"
|
||||
else
|
||||
output += "<b>Mech Bay Power Port Status: </b>[recharge_port.active()?"Now charging":"On hold"]<br>"
|
||||
|
||||
/*
|
||||
output += {"<hr>
|
||||
<b>Settings:</b>
|
||||
<div style='margin-left: 15px;'>
|
||||
<b>Start sequence on succesful init: </b><a href='?src=\ref[src];autostart=1'>[autostart?"On":"Off"]</a><br>
|
||||
<b>Recharge Port Voltage: </b><a href='?src=\ref[src];voltage=30'>Low</a> - <a href='?src=\ref[src];voltage=45'>Medium</a> - <a href='?src=\ref[src];voltage=60'>High</a><br>
|
||||
</div>"}
|
||||
*/
|
||||
|
||||
output += "</ body></html>"
|
||||
user << browse(output, "window=mech_bay_console")
|
||||
onclose(user, "mech_bay_console")
|
||||
return
|
||||
/obj/machinery/computer/mech_bay_power_console/process()
|
||||
if(recharge_port && recharge_port.recharging_mech && recharge_port.recharging_mech.cell)
|
||||
updateDialog()
|
||||
|
||||
|
||||
Topic(href, href_list)
|
||||
if(href_list["autostart"])
|
||||
autostart = !autostart
|
||||
if(href_list["voltage"])
|
||||
voltage = text2num(href_list["voltage"])
|
||||
if(recharge_port)
|
||||
recharge_port.set_voltage(voltage)
|
||||
updateUsrDialog()
|
||||
return
|
||||
/obj/machinery/computer/mech_bay_power_console/update_icon()
|
||||
if(!recharge_port || !recharge_port.recharging_mech || !recharge_port.recharging_mech.cell || !(recharge_port.recharging_mech.cell.charge < recharge_port.recharging_mech.cell.maxcharge))
|
||||
icon_state = "recharge_comp"
|
||||
else
|
||||
icon_state = "recharge_comp_on"
|
||||
|
||||
/obj/machinery/computer/mech_bay_power_console/initialize()
|
||||
reconnect()
|
||||
|
||||
@@ -13,8 +13,10 @@
|
||||
idle_power_usage = 20
|
||||
active_power_usage = 5000
|
||||
req_access = list(access_robotics)
|
||||
var/time_coeff = 1.5 //can be upgraded with research
|
||||
var/resource_coeff = 1.5 //can be upgraded with research
|
||||
var/time_coeff = 1
|
||||
var/resource_coeff = 1
|
||||
var/time_coeff_tech = 1
|
||||
var/resource_coeff_tech = 1
|
||||
var/list/resources = list(
|
||||
"metal"=0,
|
||||
"glass"=0,
|
||||
@@ -171,18 +173,16 @@
|
||||
T = 0
|
||||
for(var/obj/item/weapon/stock_parts/micro_laser/Ma in component_parts)
|
||||
T += Ma.rating
|
||||
if(T >= 1)
|
||||
T -= 1
|
||||
T -= 1
|
||||
var/diff
|
||||
diff = round(initial(resource_coeff) - (initial(resource_coeff)*(T))/25,0.01)
|
||||
diff = round(initial(resource_coeff) - (initial(resource_coeff)*(T))/8,0.01)
|
||||
if(resource_coeff!=diff)
|
||||
resource_coeff = diff
|
||||
T = 0
|
||||
for(var/obj/item/weapon/stock_parts/manipulator/Ml in component_parts)
|
||||
T += Ml.rating
|
||||
if(T>= 2)
|
||||
T -= 2
|
||||
diff = round(initial(time_coeff) - (initial(time_coeff)*(T))/25,0.01)
|
||||
T -= 1
|
||||
diff = round(initial(time_coeff) - (initial(time_coeff)*(T))/5,0.01)
|
||||
if(time_coeff!=diff)
|
||||
time_coeff = diff
|
||||
|
||||
@@ -447,20 +447,20 @@
|
||||
pmat += Ml.rating
|
||||
if(pmat >= 1)
|
||||
pmat -= 1//So the equations don't have to be reworked, upgrading a single part from T1 to T2 is == to 1 tech level
|
||||
diff = round(initial(resource_coeff) - (initial(resource_coeff)*(T.level+pmat))/25,0.01)
|
||||
if(resource_coeff!=diff)
|
||||
resource_coeff = diff
|
||||
output+="Production efficiency increased.<br>"
|
||||
diff = round(initial(resource_coeff_tech) - (initial(resource_coeff_tech)*(T.level+pmat))/30,0.01)
|
||||
if(resource_coeff_tech > diff)
|
||||
resource_coeff_tech = diff
|
||||
output += "Production efficiency increased.<br>"
|
||||
if("programming")
|
||||
var/ptime = 0
|
||||
for(var/obj/item/weapon/stock_parts/manipulator/Ma in component_parts)
|
||||
ptime += Ma.rating
|
||||
if(ptime >= 2)
|
||||
ptime -= 2
|
||||
diff = round(initial(time_coeff) - (initial(time_coeff)*(T.level+ptime))/25,0.1)
|
||||
if(time_coeff!=diff)
|
||||
time_coeff = diff
|
||||
output+="Production routines updated.<br>"
|
||||
diff = round(initial(time_coeff_tech) - (initial(time_coeff_tech)*(T.level+ptime))/25,0.1)
|
||||
if(time_coeff_tech > diff)
|
||||
time_coeff_tech = diff
|
||||
output += "Production routines updated.<br>"
|
||||
return output
|
||||
|
||||
|
||||
@@ -492,14 +492,14 @@
|
||||
if(part.vars.Find("construction_time") && part.vars.Find("construction_cost"))
|
||||
if (resource=="iron" && !("iron" in part:construction_cost))
|
||||
resource="metal"
|
||||
return round(part:construction_cost[resource]*resource_coeff, roundto)
|
||||
return round(part:construction_cost[resource]*resource_coeff*resource_coeff_tech, roundto)
|
||||
else
|
||||
return 0
|
||||
|
||||
/obj/machinery/mecha_part_fabricator/proc/get_construction_time_w_coeff(var/obj/item/part as obj, var/roundto=1)
|
||||
//Be SURE to add any new equipment to this switch, but don't be suprised if it spits out children objects
|
||||
if(part.vars.Find("construction_time") && part.vars.Find("construction_cost"))
|
||||
return round(part:construction_time*time_coeff, roundto)
|
||||
return round(part:construction_time*time_coeff*time_coeff_tech, roundto)
|
||||
else
|
||||
return 0
|
||||
|
||||
@@ -702,53 +702,44 @@
|
||||
|
||||
/obj/machinery/mecha_part_fabricator/attackby(obj/W as obj, mob/user as mob)
|
||||
if(exchange_parts(user, W))
|
||||
return
|
||||
if(istype(W,/obj/item/weapon/screwdriver))
|
||||
if (!opened)
|
||||
opened = 1
|
||||
icon_state = "fab-o"
|
||||
user << "You open the maintenance hatch of [src]."
|
||||
else
|
||||
opened = 0
|
||||
icon_state = "fab-idle"
|
||||
user << "You close the maintenance hatch of [src]."
|
||||
return
|
||||
if (opened)
|
||||
return 1
|
||||
|
||||
if(istype(W, /obj/item/weapon/screwdriver))
|
||||
default_deconstruction_screwdriver(user, "fab-o", "fab-idle", W)
|
||||
return 1
|
||||
|
||||
if (panel_open)
|
||||
if(istype(W, /obj/item/weapon/crowbar))
|
||||
playsound(src.loc, 'sound/items/Crowbar.ogg', 50, 1)
|
||||
var/obj/machinery/constructable_frame/machine_frame/M = new /obj/machinery/constructable_frame/machine_frame(src.loc)
|
||||
M.state = 2
|
||||
M.icon_state = "box_1"
|
||||
for(var/obj/I in component_parts)
|
||||
if(I.reliability != 100 && crit_fail)
|
||||
I.crit_fail = 1
|
||||
I.loc = src.loc
|
||||
if(src.resources["metal"] >= 3750)
|
||||
var/obj/item/stack/sheet/metal/G = new /obj/item/stack/sheet/metal(src.loc)
|
||||
G.amount = round(src.resources["metal"] / G.perunit)
|
||||
if(src.resources["glass"] >= 3750)
|
||||
var/obj/item/stack/sheet/glass/G = new /obj/item/stack/sheet/glass(src.loc)
|
||||
G.amount = round(src.resources["glass"] / G.perunit)
|
||||
if(src.resources["plasma"] >= 2000)
|
||||
var/obj/item/stack/sheet/mineral/plasma/G = new /obj/item/stack/sheet/mineral/plasma(src.loc)
|
||||
G.amount = round(src.resources["plasma"] / G.perunit)
|
||||
if(src.resources["silver"] >= 2000)
|
||||
var/obj/item/stack/sheet/mineral/silver/G = new /obj/item/stack/sheet/mineral/silver(src.loc)
|
||||
G.amount = round(src.resources["silver"] / G.perunit)
|
||||
if(src.resources["gold"] >= 2000)
|
||||
var/obj/item/stack/sheet/mineral/gold/G = new /obj/item/stack/sheet/mineral/gold(src.loc)
|
||||
G.amount = round(src.resources["gold"] / G.perunit)
|
||||
if(src.resources["uranium"] >= 2000)
|
||||
var/obj/item/stack/sheet/mineral/uranium/G = new /obj/item/stack/sheet/mineral/uranium(src.loc)
|
||||
G.amount = round(src.resources["uranium"] / G.perunit)
|
||||
if(src.resources["diamond"] >= 2000)
|
||||
var/obj/item/stack/sheet/mineral/diamond/G = new /obj/item/stack/sheet/mineral/diamond(src.loc)
|
||||
G.amount = round(src.resources["diamond"] / G.perunit)
|
||||
if(src.resources["bananium"] >= 2000)
|
||||
var/obj/item/stack/sheet/mineral/clown/G = new /obj/item/stack/sheet/mineral/clown(src.loc)
|
||||
G.amount = round(src.resources["bananium"] / G.perunit)
|
||||
del(src)
|
||||
return 1
|
||||
I.loc = src.loc
|
||||
if(src.resources["metal"] >= 3750)
|
||||
var/obj/item/stack/sheet/metal/G = new /obj/item/stack/sheet/metal(src.loc)
|
||||
G.amount = round(src.resources["metal"] / G.perunit)
|
||||
if(src.resources["glass"] >= 3750)
|
||||
var/obj/item/stack/sheet/glass/G = new /obj/item/stack/sheet/glass(src.loc)
|
||||
G.amount = round(src.resources["glass"] / G.perunit)
|
||||
if(src.resources["plasma"] >= 2000)
|
||||
var/obj/item/stack/sheet/mineral/plasma/G = new /obj/item/stack/sheet/mineral/plasma(src.loc)
|
||||
G.amount = round(src.resources["plasma"] / G.perunit)
|
||||
if(src.resources["silver"] >= 2000)
|
||||
var/obj/item/stack/sheet/mineral/silver/G = new /obj/item/stack/sheet/mineral/silver(src.loc)
|
||||
G.amount = round(src.resources["silver"] / G.perunit)
|
||||
if(src.resources["gold"] >= 2000)
|
||||
var/obj/item/stack/sheet/mineral/gold/G = new /obj/item/stack/sheet/mineral/gold(src.loc)
|
||||
G.amount = round(src.resources["gold"] / G.perunit)
|
||||
if(src.resources["uranium"] >= 2000)
|
||||
var/obj/item/stack/sheet/mineral/uranium/G = new /obj/item/stack/sheet/mineral/uranium(src.loc)
|
||||
G.amount = round(src.resources["uranium"] / G.perunit)
|
||||
if(src.resources["diamond"] >= 2000)
|
||||
var/obj/item/stack/sheet/mineral/diamond/G = new /obj/item/stack/sheet/mineral/diamond(src.loc)
|
||||
G.amount = round(src.resources["diamond"] / G.perunit)
|
||||
if(src.resources["bananium"] >= 2000)
|
||||
var/obj/item/stack/sheet/mineral/clown/G = new /obj/item/stack/sheet/mineral/clown(src.loc)
|
||||
G.amount = round(src.resources["bananium"] / G.perunit)
|
||||
default_deconstruction_crowbar(W)
|
||||
return 1
|
||||
else
|
||||
user << "\red You can't load the [src.name] while it's opened."
|
||||
return 1
|
||||
|
||||
@@ -36,6 +36,7 @@
|
||||
var/siemens_coefficient = 1 // for electrical admittance/conductance (electrocution checks and shit)
|
||||
var/slowdown = 0 // How much clothing is slowing you down. Negative values speeds you up
|
||||
var/canremove = 1 //Mostly for Ninja code at this point but basically will not allow the item to be removed if set to 0. /N
|
||||
var/reflect_chance = 0 //This var dictates what % of a time an object will reflect an energy based weapon's shot
|
||||
var/armor = list(melee = 0, bullet = 0, laser = 0,energy = 0, bomb = 0, bio = 0, rad = 0)
|
||||
var/list/allowed = null //suit storage stuff.
|
||||
var/obj/item/device/uplink/hidden/hidden_uplink = null // All items can have an uplink hidden inside, just remember to add the triggers.
|
||||
@@ -557,6 +558,10 @@
|
||||
/obj/item/proc/IsShield()
|
||||
return 0
|
||||
|
||||
/obj/item/proc/IsReflect(var/def_zone) //This proc determines if and at what% an object will reflect energy projectiles if it's in l_hand,r_hand or wear_suit
|
||||
if(prob(reflect_chance))
|
||||
return 1
|
||||
|
||||
/obj/item/proc/get_loc_turf()
|
||||
var/atom/L = loc
|
||||
while(L && !istype(L, /turf/))
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
// Bluespace crystals, used in telescience and when crushed it will blink you to a random turf.
|
||||
/obj/item/bluespace_crystal
|
||||
name = "bluespace crystal"
|
||||
desc = "A glowing bluespace crystal, not much is known about how they work. It looks very delicate."
|
||||
icon = 'icons/obj/telescience.dmi'
|
||||
icon_state = "bluespace_crystal"
|
||||
w_class = 1
|
||||
origin_tech = "bluespace=4;materials=5"
|
||||
var/blink_range = 8 // The teleport range when crushed/thrown at someone.
|
||||
|
||||
/obj/item/bluespace_crystal/New()
|
||||
..()
|
||||
pixel_x = rand(-5, 5)
|
||||
pixel_y = rand(-5, 5)
|
||||
|
||||
/obj/item/bluespace_crystal/attack_self(var/mob/user)
|
||||
blink_mob(user)
|
||||
user.drop_item()
|
||||
user.visible_message("<span class='notice'>[user] crushes the [src]!</span>")
|
||||
qdel(src)
|
||||
|
||||
/obj/item/bluespace_crystal/proc/blink_mob(var/mob/living/L)
|
||||
do_teleport(L, get_turf(L), blink_range, asoundin = 'sound/effects/phasein.ogg')
|
||||
|
||||
/obj/item/bluespace_crystal/throw_impact(atom/hit_atom)
|
||||
..()
|
||||
if(isliving(hit_atom))
|
||||
blink_mob(hit_atom)
|
||||
qdel(src)
|
||||
|
||||
// Artifical bluespace crystal, doesn't give you much research.
|
||||
/obj/item/bluespace_crystal/artificial
|
||||
name = "artificial bluespace crystal"
|
||||
desc = "An artificially made bluespace crystal, it looks delicate."
|
||||
origin_tech = "bluespace=2"
|
||||
blink_range = 4 // Not as good as the organic stuff!
|
||||
@@ -1,19 +1,26 @@
|
||||
var/list/sps_list = list()
|
||||
/obj/item/device/sps
|
||||
name = "Space Positioning System"
|
||||
desc = "Helping lost spacemen find their way through the galaxy since 3016."
|
||||
name = "space positioning system"
|
||||
desc = "Helping lost spacemen find their way through the planets since 2016."
|
||||
icon = 'icons/obj/telescience.dmi'
|
||||
icon_state = "gps-c"
|
||||
w_class = 2.0
|
||||
flags = FPRINT
|
||||
slot_flags = SLOT_BELT
|
||||
origin_tech = "programming=2;engineering=2"
|
||||
var/gpstag = "COM0"
|
||||
origin_tech = "materials=2;magnets=3;bluespace=2"
|
||||
var/spstag = "COM0"
|
||||
var/emped = 0
|
||||
var/turf/locked_location
|
||||
|
||||
/obj/item/device/sps/New()
|
||||
name = "Space Positioning System ([gpstag])"
|
||||
..()
|
||||
sps_list.Add(src)
|
||||
name = "space positioning system ([spstag])"
|
||||
overlays += "working"
|
||||
|
||||
/obj/item/device/sps/Destroy()
|
||||
sps_list.Remove(src)
|
||||
..()
|
||||
|
||||
/obj/item/device/sps/emp_act(severity)
|
||||
emped = 1
|
||||
overlays -= "working"
|
||||
@@ -24,43 +31,54 @@
|
||||
overlays += "working"
|
||||
|
||||
/obj/item/device/sps/attack_self(mob/user as mob)
|
||||
|
||||
var/obj/item/device/sps/t = ""
|
||||
var/sps_window_height = 110 + sps_list.len * 20 // Variable window height, depending on how many sps units there are to show
|
||||
if(emped)
|
||||
t += "ERROR"
|
||||
else
|
||||
t += "<BR><A href='?src=\ref[src];tag=1'>Set Tag</A> "
|
||||
t += "<BR>Tag: [gpstag]"
|
||||
t += "<A href='?src=\ref[src];tag=1'>Set Tag</A><A href='?src=\ref[src];refresh=1'>Refresh</A>"
|
||||
t += "<BR>Tag: [spstag]"
|
||||
if(locked_location && locked_location.loc)
|
||||
t += "<BR>Bluespace coordinates saved: [locked_location.loc]"
|
||||
sps_window_height += 20
|
||||
|
||||
for(var/obj/item/device/sps/G in world)
|
||||
for(var/obj/item/device/sps/G in sps_list)
|
||||
var/turf/pos = get_turf(G)
|
||||
var/area/gps_area = get_area(G)
|
||||
var/tracked_gpstag = G.gpstag
|
||||
var/area/sps_area = get_area(G)
|
||||
var/tracked_spstag = G.spstag
|
||||
if(G.emped == 1)
|
||||
t += "<BR>[tracked_gpstag]: ERROR"
|
||||
t += "<BR>[tracked_spstag]: ERROR"
|
||||
else
|
||||
t += "<BR>[tracked_gpstag]: [format_text(gps_area.name)] ([pos.x], [pos.y], [pos.z])"
|
||||
t += "<BR>[tracked_spstag]: [format_text(sps_area.name)] ([pos.x], [pos.y], [pos.z])"
|
||||
|
||||
var/datum/browser/popup = new(user, "SPS", name, 600, 450)
|
||||
var/datum/browser/popup = new(user, "sps", name, 360, min(sps_window_height, 800))
|
||||
popup.set_content(t)
|
||||
popup.set_title_image(user.browse_rsc_icon(src.icon, src.icon_state))
|
||||
popup.open()
|
||||
|
||||
/obj/item/device/sps/Topic(href, href_list)
|
||||
..()
|
||||
if(href_list["tag"] )
|
||||
var/a = input("Please enter desired tag.", name, gpstag) as text
|
||||
a = copytext(sanitize(a), 1, 20)
|
||||
if(length(a) != 4)
|
||||
usr << "\blue The tag must be four letters long!"
|
||||
return
|
||||
else
|
||||
gpstag = a
|
||||
name = "Space Positioning System ([gpstag])"
|
||||
return
|
||||
var/a = input("Please enter desired tag.", name, spstag) as text
|
||||
a = uppertext(copytext(sanitize(a), 1, 5))
|
||||
if(src.loc == usr)
|
||||
spstag = a
|
||||
name = "space positioning system ([spstag])"
|
||||
attack_self(usr)
|
||||
if(href_list["refresh"] )
|
||||
if(src.loc == usr)
|
||||
attack_self(usr)
|
||||
|
||||
/obj/item/device/sps/science
|
||||
icon_state = "gps-s"
|
||||
gpstag = "SCI0"
|
||||
spstag = "SCI0"
|
||||
|
||||
/obj/item/device/sps/engineering
|
||||
icon_state = "gps-e"
|
||||
gpstag = "ENG0"
|
||||
spstag = "ENG0"
|
||||
|
||||
/obj/item/device/sps/mining
|
||||
icon_state = "gps-m"
|
||||
spstag = "MINE0"
|
||||
desc = "A positioning system helpful for rescuing trapped or injured miners, keeping one on you at all times while mining might just save your life."
|
||||
|
||||
@@ -30,10 +30,13 @@
|
||||
return (BRUTELOSS|FIRELOSS)
|
||||
|
||||
/obj/item/weapon/melee/energy/sword
|
||||
var/hacked = 0
|
||||
var/blade_color
|
||||
color
|
||||
name = "energy sword"
|
||||
desc = "May the force be within you."
|
||||
icon_state = "sword0"
|
||||
icon_override = 'icons/mob/in-hand/swords.dmi'
|
||||
force = 3.0
|
||||
throwforce = 5.0
|
||||
throw_speed = 1
|
||||
|
||||
@@ -20,8 +20,8 @@
|
||||
create_reagents(mopcap)
|
||||
|
||||
|
||||
obj/item/weapon/mop/proc/clean(turf/simulated/A)
|
||||
if(reagents.has_reagent("water", 1) || reagents.has_reagent("holywater", 1))
|
||||
/obj/item/weapon/mop/proc/clean(turf/simulated/A)
|
||||
if(reagents.has_reagent("water", 1) || reagents.has_reagent("cleaner", 1) || reagents.has_reagent("holywater", 1))
|
||||
A.clean_blood()
|
||||
for(var/obj/effect/O in A)
|
||||
if(istype(O,/obj/effect/decal/cleanable) || istype(O,/obj/effect/overlay) || istype(O,/obj/effect/rune))
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
w_class = 3.0
|
||||
var/charge = 0 // note %age conveted to actual charge in New
|
||||
var/maxcharge = 10000
|
||||
var/rating = 1
|
||||
m_amt = 700
|
||||
g_amt = 50
|
||||
var/rigged = 0 // true if rigged to explode
|
||||
@@ -29,6 +30,7 @@
|
||||
desc = "You can't top the plasma top." //TOTALLY TRADEMARK INFRINGEMENT
|
||||
origin_tech = "powerstorage=0"
|
||||
maxcharge = 5000
|
||||
rating = 2
|
||||
g_amt = 40
|
||||
|
||||
/obj/item/weapon/cell/crap/empty/New()
|
||||
@@ -39,6 +41,7 @@
|
||||
name = "\improper Security borg rechargable D battery"
|
||||
origin_tech = "powerstorage=0"
|
||||
maxcharge = 6000 //6000 max charge / 1000 charge per shot = six shots
|
||||
rating = 2.5
|
||||
g_amt = 40
|
||||
|
||||
/obj/item/weapon/cell/secborg/empty/New()
|
||||
@@ -50,6 +53,7 @@
|
||||
origin_tech = "powerstorage=2"
|
||||
icon_state = "hcell"
|
||||
maxcharge = 15000
|
||||
rating = 3
|
||||
g_amt = 60
|
||||
|
||||
/obj/item/weapon/cell/high/empty/New()
|
||||
@@ -62,6 +66,7 @@
|
||||
icon_state = "scell"
|
||||
maxcharge = 20000
|
||||
g_amt = 70
|
||||
rating = 4
|
||||
construction_cost = list("metal"=750,"glass"=100)
|
||||
|
||||
/obj/item/weapon/cell/super/empty/New()
|
||||
@@ -73,6 +78,7 @@
|
||||
origin_tech = "powerstorage=6"
|
||||
icon_state = "hpcell"
|
||||
maxcharge = 30000
|
||||
rating = 5
|
||||
g_amt = 80
|
||||
construction_cost = list("metal"=500,"glass"=150,"gold"=200,"silver"=200)
|
||||
|
||||
@@ -85,6 +91,7 @@
|
||||
icon_state = "icell"
|
||||
origin_tech = null
|
||||
maxcharge = 30000
|
||||
rating = 6
|
||||
g_amt = 80
|
||||
use()
|
||||
return 1
|
||||
@@ -97,6 +104,7 @@
|
||||
icon_state = "potato_cell" //"potato_battery"
|
||||
charge = 100
|
||||
maxcharge = 3000
|
||||
rating = 1
|
||||
m_amt = 0
|
||||
g_amt = 0
|
||||
minor_fault = 1
|
||||
@@ -109,6 +117,6 @@
|
||||
icon = 'icons/mob/slimes.dmi' //'icons/obj/harvest.dmi'
|
||||
icon_state = "yellow slime extract" //"potato_battery"
|
||||
maxcharge = 10000
|
||||
maxcharge = 10000
|
||||
rating = 3
|
||||
m_amt = 0
|
||||
g_amt = 0
|
||||
|
||||
@@ -203,6 +203,17 @@
|
||||
item_state = "Dpacket"
|
||||
|
||||
|
||||
/obj/item/weapon/storage/fancy/cigarettes/syndicate
|
||||
name = "\improper Syndicate Cigarettes"
|
||||
desc = "A packet of six evil-looking cigarettes, A label on the packaging reads, \"Donk Co\""
|
||||
icon_state = "robustpacket"
|
||||
item_state = "robustpacket"
|
||||
|
||||
/obj/item/weapon/storage/fancy/cigarettes/syndicate/New()
|
||||
..()
|
||||
var/new_name = pick("evil", "suspicious", "ominous", "donk-flavored", "robust", "sneaky")
|
||||
name = "[new_name] cigarette packet"
|
||||
|
||||
/*
|
||||
* Vial Box
|
||||
*/
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
var/obj/item/weapon/cell/high/bcell = null
|
||||
var/mob/foundmob = "" //Used in throwing proc.
|
||||
var/hitcost = 1500 //oh god why do power cells carry so much charge? We probably need to make a distinction between "industrial" sized power cells for APCs and power cells for everything else.
|
||||
var/allowharm = 0 // Allow or disallow harming with the stunbaton
|
||||
|
||||
/obj/item/weapon/melee/baton/suicide_act(mob/user)
|
||||
user.visible_message("<span class='suicide'>[user] is putting the live [name] in \his mouth! It looks like \he's trying to commit suicide.</span>")
|
||||
@@ -123,7 +124,7 @@
|
||||
var/mob/living/L = M
|
||||
|
||||
var/target_zone = check_zone(user.zone_sel.selecting)
|
||||
if(user.a_intent == "hurt")
|
||||
if(user.a_intent == "harm" && allowharm == 1)
|
||||
if (!..()) //item/attack() does it's own messaging and logs
|
||||
return 0 // item/attack() will return 1 if they hit, 0 if they missed.
|
||||
agony *= 0.5 //whacking someone causes a much poorer contact than prodding them.
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
return 0
|
||||
|
||||
/obj/item/weapon/melee/energy/sword/New()
|
||||
_color = pick("red","blue","green","purple")
|
||||
blade_color = pick("red","blue","green","purple")
|
||||
|
||||
/obj/item/weapon/melee/energy/sword/attack_self(mob/living/user as mob)
|
||||
if ((M_CLUMSY in user.mutations) && prob(50))
|
||||
@@ -36,7 +36,7 @@
|
||||
if(istype(src,/obj/item/weapon/melee/energy/sword/pirate))
|
||||
icon_state = "cutlass1"
|
||||
else
|
||||
icon_state = "sword[_color]"
|
||||
icon_state = "sword[blade_color]"
|
||||
w_class = 4
|
||||
playsound(user, 'sound/weapons/saberon.ogg', 50, 1)
|
||||
hitsound = 'sound/weapons/blade1.ogg'
|
||||
@@ -67,9 +67,29 @@
|
||||
user.adjustBrainLoss(10)
|
||||
else
|
||||
user << "<span class='notice'>You attach the ends of the two energy swords, making a single double-bladed weapon! You're cool.</span>"
|
||||
new /obj/item/weapon/twohanded/dualsaber(user.loc)
|
||||
var/obj/item/weapon/twohanded/dualsaber/newSaber = new /obj/item/weapon/twohanded/dualsaber(user.loc)
|
||||
if(src.hacked) // That's right, we'll only check the "original" esword.
|
||||
newSaber.hacked = 1
|
||||
newSaber.blade_color = "rainbow"
|
||||
del(W)
|
||||
del(src)
|
||||
|
||||
else if(istype(W, /obj/item/device/multitool))
|
||||
if(hacked == 0)
|
||||
hacked = 1
|
||||
blade_color = "rainbow"
|
||||
user << "<span class='warning'>RNBW_ENGAGE</span>"
|
||||
|
||||
if(active)
|
||||
icon_state = "swordrainbow"
|
||||
// Updating overlays, copied from welder code.
|
||||
// I tried calling attack_self twice, which looked cool, except it somehow didn't update the overlays!!
|
||||
if(user.r_hand == src)
|
||||
user.update_inv_r_hand(0)
|
||||
else if(user.l_hand == src)
|
||||
user.update_inv_l_hand(0)
|
||||
else
|
||||
user << "<span class='warning'>It's already fabulous!</span>"
|
||||
/*
|
||||
* Classic Baton
|
||||
*/
|
||||
@@ -215,8 +235,7 @@
|
||||
return
|
||||
else
|
||||
return ..()
|
||||
|
||||
|
||||
|
||||
/*
|
||||
*Energy Blade
|
||||
*/
|
||||
@@ -282,6 +301,7 @@
|
||||
active = !active
|
||||
if (active)
|
||||
force = 10
|
||||
reflect_chance = 80
|
||||
icon_state = "eshield[active]"
|
||||
w_class = 4
|
||||
playsound(user, 'sound/weapons/saberon.ogg', 50, 1)
|
||||
@@ -290,6 +310,7 @@
|
||||
force = 3
|
||||
icon_state = "eshield[active]"
|
||||
w_class = 1
|
||||
reflect_chance = 0
|
||||
playsound(user, 'sound/weapons/saberoff.ogg', 50, 1)
|
||||
user << "\blue [src] can now be concealed."
|
||||
if(istype(user,/mob/living/carbon/human))
|
||||
|
||||
@@ -128,26 +128,26 @@ Frequency:
|
||||
icon = 'icons/obj/device.dmi'
|
||||
icon_state = "hand_tele"
|
||||
item_state = "electronic"
|
||||
throwforce = 5
|
||||
throwforce = 0
|
||||
w_class = 2.0
|
||||
throw_speed = 3
|
||||
throw_range = 5
|
||||
m_amt = 10000
|
||||
origin_tech = "magnets=1;bluespace=3"
|
||||
var/active_portals = 0
|
||||
|
||||
/obj/item/weapon/hand_tele/attack_self(mob/user as mob)
|
||||
var/turf/current_location = get_turf(user)//What turf is the user on?
|
||||
if(!current_location||current_location.z==2||current_location.z>=8)//If turf was not found or they're on z level 2 or >8 which does not currently exist.
|
||||
if(!current_location||current_location.z==2||current_location.z>=7)//If turf was not found or they're on z level 2 or >7 which does not currently exist.
|
||||
user << "<span class='notice'>\The [src] is malfunctioning.</span>"
|
||||
return
|
||||
var/list/L = list( )
|
||||
for(var/obj/machinery/teleport/hub/R in world)
|
||||
var/obj/machinery/computer/teleporter/com = locate(/obj/machinery/computer/teleporter, locate(R.x - 2, R.y, R.z))
|
||||
if (istype(com, /obj/machinery/computer/teleporter) && com.locked && !com.one_time_use)
|
||||
if(R.icon_state == "tele1")
|
||||
L["[com.id] (Active)"] = com.locked
|
||||
for(var/obj/machinery/computer/teleporter/com in world)
|
||||
if(com.target)
|
||||
if(com.power_station && com.power_station.teleporter_hub && com.power_station.engaged)
|
||||
L["[com.id] (Active)"] = com.target
|
||||
else
|
||||
L["[com.id] (Inactive)"] = com.locked
|
||||
L["[com.id] (Inactive)"] = com.target
|
||||
var/list/turfs = list( )
|
||||
for(var/turf/T in orange(10))
|
||||
if(T.x>world.maxx-8 || T.x<8) continue //putting them at the edge is dumb
|
||||
@@ -158,19 +158,16 @@ Frequency:
|
||||
var/t1 = input(user, "Please select a teleporter to lock in on.", "Hand Teleporter") in L
|
||||
if ((user.get_active_hand() != src || user.stat || user.restrained()))
|
||||
return
|
||||
var/count = 0 //num of portals from this teleport in world
|
||||
for(var/obj/effect/portal/PO in world)
|
||||
if(PO.creator == src) count++
|
||||
if(count >= 3)
|
||||
if(active_portals >= 3)
|
||||
user.show_message("<span class='notice'>\The [src] is recharging!</span>")
|
||||
return
|
||||
var/T = L[t1]
|
||||
for(var/mob/O in hearers(user, null))
|
||||
O.show_message("<span class='notice'>Locked In.</span>", 2)
|
||||
user.show_message("<span class='notice'>Locked In.</span>", 2)
|
||||
var/obj/effect/portal/P = new /obj/effect/portal( get_turf(src) )
|
||||
P.target = T
|
||||
P.creator = src
|
||||
try_move_adjacent(P)
|
||||
active_portals++
|
||||
src.add_fingerprint(user)
|
||||
return
|
||||
|
||||
|
||||
|
||||
@@ -191,6 +191,9 @@ obj/item/weapon/twohanded/
|
||||
* Double-Bladed Energy Swords - Cheridan
|
||||
*/
|
||||
/obj/item/weapon/twohanded/dualsaber
|
||||
var/hacked = 0
|
||||
var/blade_color
|
||||
icon_override = 'icons/mob/in-hand/swords.dmi'
|
||||
icon_state = "dualsaber0"
|
||||
name = "double-bladed energy sword"
|
||||
desc = "Handle with care."
|
||||
@@ -210,20 +213,16 @@ obj/item/weapon/twohanded/
|
||||
edge = 1
|
||||
no_embed = 1 // Like with the single-handed esword, this shouldn't be embedding in people.
|
||||
|
||||
/* Here for when we can add items to left and right hands again, but currently this cannot be done due to the lack of in-hand icons for dual eswords aside from the green one.
|
||||
/obj/item/weapon/twohanded/dualsaber/New()
|
||||
item_color = pick("red", "blue", "green", "purple")
|
||||
blade_color = pick("red", "blue", "green", "purple")
|
||||
|
||||
/obj/item/weapon/twohanded/dualsaber/update_icon()
|
||||
if(wielded)
|
||||
icon_state = "dualsaber[item_color][wielded]"
|
||||
icon_state = "dualsaber[blade_color][wielded]"
|
||||
reflect_chance = 80
|
||||
else
|
||||
icon_state = "dualsaber0"
|
||||
*/
|
||||
|
||||
/obj/item/weapon/twohanded/dualsaber/update_icon()
|
||||
icon_state = "dualsaber[wielded]"
|
||||
return
|
||||
reflect_chance = 0
|
||||
|
||||
/obj/item/weapon/twohanded/dualsaber/attack(target as mob, mob/living/user as mob)
|
||||
..()
|
||||
@@ -245,11 +244,19 @@ obj/item/weapon/twohanded/
|
||||
|
||||
/obj/item/weapon/twohanded/dualsaber/green
|
||||
New()
|
||||
color = "green"
|
||||
blade_color = "green"
|
||||
|
||||
/obj/item/weapon/twohanded/dualsaber/red
|
||||
New()
|
||||
color = "red"
|
||||
blade_color = "red"
|
||||
|
||||
/obj/item/weapon/twohanded/dualsaber/purple
|
||||
New()
|
||||
blade_color = "purple"
|
||||
|
||||
/obj/item/weapon/twohanded/dualsaber/blue
|
||||
New()
|
||||
blade_color = "blue"
|
||||
|
||||
/obj/item/weapon/twohanded/dualsaber/unwield()
|
||||
..()
|
||||
@@ -259,6 +266,18 @@ obj/item/weapon/twohanded/
|
||||
..()
|
||||
hitsound = 'sound/weapons/blade1.ogg'
|
||||
|
||||
/obj/item/weapon/twohanded/dualsaber/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
..()
|
||||
if(istype(W, /obj/item/device/multitool))
|
||||
if(hacked == 0)
|
||||
hacked = 1
|
||||
user << "<span class='warning'>2XRNBW_ENGAGE</span>"
|
||||
blade_color = "rainbow"
|
||||
update_icon()
|
||||
else
|
||||
user << "<span class='warning'>It's starting to look like a triple rainbow - no, nevermind.</span>"
|
||||
|
||||
|
||||
//spears
|
||||
/obj/item/weapon/twohanded/spear
|
||||
icon_state = "spearglass0"
|
||||
@@ -284,4 +303,199 @@ obj/item/weapon/twohanded/
|
||||
/obj/item/weapon/twohanded/spear/kidan
|
||||
icon_state = "kidanspear0"
|
||||
name = "Kidan spear"
|
||||
desc = "A spear brought over from the Kidan homeworld."
|
||||
desc = "A spear brought over from the Kidan homeworld."
|
||||
|
||||
|
||||
// SINGULOHAMMER
|
||||
|
||||
/obj/item/weapon/twohanded/singularityhammer
|
||||
name = "singularity hammer"
|
||||
desc = "The pinnacle of close combat technology, the hammer harnesses the power of a miniaturized singularity to deal crushing blows."
|
||||
|
||||
icon_override = 'icons/mob/in-hand/swords.dmi'
|
||||
icon_state = "mjollnir0"
|
||||
flags = CONDUCT
|
||||
slot_flags = SLOT_BACK
|
||||
no_embed = 1
|
||||
force = 5
|
||||
force_unwielded = 5
|
||||
force_wielded = 20
|
||||
throwforce = 15
|
||||
throw_range = 1
|
||||
w_class = 5
|
||||
var/charged = 5
|
||||
origin_tech = "combat=5;bluespace=4"
|
||||
|
||||
|
||||
|
||||
/obj/item/weapon/twohanded/singularityhammer/New()
|
||||
..()
|
||||
processing_objects.Add(src)
|
||||
|
||||
|
||||
/obj/item/weapon/twohanded/singularityhammer/Destroy()
|
||||
processing_objects.Remove(src)
|
||||
..()
|
||||
|
||||
|
||||
/obj/item/weapon/twohanded/singularityhammer/process()
|
||||
if(charged < 5)
|
||||
charged++
|
||||
return
|
||||
|
||||
/obj/item/weapon/twohanded/singularityhammer/update_icon() //Currently only here to fuck with the on-mob icons.
|
||||
icon_state = "mjollnir[wielded]"
|
||||
return
|
||||
|
||||
|
||||
/obj/item/weapon/twohanded/singularityhammer/proc/vortex(var/turf/pull as turf, mob/wielder as mob)
|
||||
for(var/atom/X in orange(5,pull))
|
||||
if(istype(X, /atom/movable))
|
||||
if(X == wielder) continue
|
||||
if((X) &&(!X:anchored) && (!istype(X,/mob/living/carbon/human)))
|
||||
step_towards(X,pull)
|
||||
step_towards(X,pull)
|
||||
step_towards(X,pull)
|
||||
else if(istype(X,/mob/living/carbon/human))
|
||||
var/mob/living/carbon/human/H = X
|
||||
if(istype(H.shoes,/obj/item/clothing/shoes/magboots))
|
||||
var/obj/item/clothing/shoes/magboots/M = H.shoes
|
||||
if(M.magpulse)
|
||||
continue
|
||||
H.apply_effect(1, WEAKEN, 0)
|
||||
step_towards(H,pull)
|
||||
step_towards(H,pull)
|
||||
step_towards(H,pull)
|
||||
return
|
||||
|
||||
|
||||
|
||||
/obj/item/weapon/twohanded/singularityhammer/afterattack(atom/A as mob|obj|turf|area, mob/user as mob, proximity)
|
||||
if(!proximity) return
|
||||
if(wielded)
|
||||
if(charged == 5)
|
||||
charged = 0
|
||||
if(istype(A, /mob/living/))
|
||||
var/mob/living/Z = A
|
||||
Z.take_organ_damage(20,0)
|
||||
playsound(user, 'sound/weapons/marauder.ogg', 50, 1)
|
||||
var/turf/target = get_turf(A)
|
||||
vortex(target,user)
|
||||
|
||||
|
||||
/obj/item/weapon/twohanded/mjollnir
|
||||
name = "Mjollnir"
|
||||
desc = "A weapon worthy of a god, able to strike with the force of a lightning bolt. It crackles with barely contained energy."
|
||||
icon_override = 'icons/mob/in-hand/swords.dmi'
|
||||
icon_state = "mjollnir0"
|
||||
flags = CONDUCT
|
||||
slot_flags = SLOT_BACK
|
||||
no_embed = 1
|
||||
force = 5
|
||||
force_unwielded = 5
|
||||
force_wielded = 20
|
||||
throwforce = 30
|
||||
throw_range = 7
|
||||
w_class = 5
|
||||
//var/charged = 5
|
||||
origin_tech = "combat=5;powerstorage=5"
|
||||
|
||||
/obj/item/weapon/twohanded/mjollnir/proc/shock(mob/living/target as mob)
|
||||
var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread()
|
||||
s.set_up(5, 1, target.loc)
|
||||
s.start()
|
||||
target.take_organ_damage(0,30)
|
||||
target.visible_message("<span class='danger'>[target.name] was shocked by the [src.name]!</span>", \
|
||||
"<span class='userdanger'>You feel a powerful shock course through your body sending you flying!</span>", \
|
||||
"<span class='danger'>You hear a heavy electrical crack.</span>")
|
||||
var/atom/throw_target = get_edge_target_turf(target, get_dir(src, get_step_away(target, src)))
|
||||
target.throw_at(throw_target, 200, 4)
|
||||
return
|
||||
|
||||
|
||||
/obj/item/weapon/twohanded/mjollnir/attack(mob/M as mob, mob/user as mob)
|
||||
..()
|
||||
spawn(0)
|
||||
if(wielded)
|
||||
//if(charged == 5)
|
||||
//charged = 0
|
||||
playsound(src.loc, "sparks", 50, 1)
|
||||
if(istype(M, /mob/living))
|
||||
M.Stun(10)
|
||||
shock(M)
|
||||
|
||||
|
||||
/obj/item/weapon/twohanded/mjollnir/update_icon() //Currently only here to fuck with the on-mob icons.
|
||||
icon_state = "mjollnir[wielded]"
|
||||
return
|
||||
|
||||
|
||||
|
||||
/obj/item/weapon/twohanded/knighthammer
|
||||
name = "singuloth knight's hammer"
|
||||
desc = "A hammer made of sturdy metal with a golden skull adorned with wings on either side of the head. <br>This weapon causes devastating damage to those it hits due to a power field sustained by a mini-singularity inside of the hammer."
|
||||
|
||||
icon_override = 'icons/mob/in-hand/swords.dmi'
|
||||
icon_state = "adrhammer0"
|
||||
flags = CONDUCT
|
||||
slot_flags = SLOT_BACK
|
||||
no_embed = 1
|
||||
force = 5
|
||||
force_unwielded = 5
|
||||
force_wielded = 20
|
||||
throwforce = 15
|
||||
throw_range = 1
|
||||
w_class = 5
|
||||
var/charged = 5
|
||||
origin_tech = "combat=5;bluespace=4"
|
||||
|
||||
|
||||
|
||||
/obj/item/weapon/twohanded/knighthammer/New()
|
||||
..()
|
||||
processing_objects.Add(src)
|
||||
|
||||
|
||||
/obj/item/weapon/twohanded/knighthammer/Destroy()
|
||||
processing_objects.Remove(src)
|
||||
..()
|
||||
|
||||
|
||||
/obj/item/weapon/twohanded/knighthammer/process()
|
||||
if(charged < 5)
|
||||
charged++
|
||||
return
|
||||
|
||||
/obj/item/weapon/twohanded/knighthammer/update_icon() //Currently only here to fuck with the on-mob icons.
|
||||
icon_state = "adrhammer[wielded]"
|
||||
return
|
||||
|
||||
|
||||
/obj/item/weapon/twohanded/knighthammer/afterattack(atom/A as mob|obj|turf|area, mob/user as mob, proximity)
|
||||
if(!proximity) return
|
||||
if(wielded)
|
||||
if(charged == 5)
|
||||
charged = 0
|
||||
if(istype(A, /mob/living/))
|
||||
var/mob/living/Z = A
|
||||
if(Z.health < 1)
|
||||
Z.visible_message("<span class='danger'>[Z.name] was blown to peices by the power of [src.name]!</span>", \
|
||||
"<span class='userdanger'>You feel a powerful blow rip you apart!</span>", \
|
||||
"<span class='danger'>You hear a heavy impact and the sound of ripping flesh!.</span>")
|
||||
Z.gib()
|
||||
else
|
||||
Z.take_organ_damage(0,30)
|
||||
Z.visible_message("<span class='danger'>[Z.name] was sent flying by a blow from the [src.name]!</span>", \
|
||||
"<span class='userdanger'>You feel a powerful blow connect with your body and send you flying!</span>", \
|
||||
"<span class='danger'>You hear something heavy impact flesh!.</span>")
|
||||
var/atom/throw_target = get_edge_target_turf(Z, get_dir(src, get_step_away(Z, src)))
|
||||
Z.throw_at(throw_target, 200, 4)
|
||||
else if(istype(A, /turf/simulated/wall))
|
||||
var/turf/simulated/wall/Z = A
|
||||
Z.ex_act(2)
|
||||
charged = 3
|
||||
else if (istype(A, /obj/structure) || istype(A, /obj/mecha/))
|
||||
var/obj/Z = A
|
||||
Z.ex_act(2)
|
||||
charged = 3
|
||||
playsound(user, 'sound/weapons/marauder.ogg', 50, 1)
|
||||
|
||||
@@ -1,58 +1,59 @@
|
||||
/obj/item/weapon/vending_refill
|
||||
name = "Resupply canister"
|
||||
name = "resupply canister"
|
||||
var/machine_name = "Generic"
|
||||
|
||||
icon = 'icons/obj/vending_restock.dmi'
|
||||
icon_state = "refill_snack"
|
||||
item_state = "restock_unit"
|
||||
flags = FPRINT | TABLEPASS| CONDUCT
|
||||
flags = CONDUCT
|
||||
force = 7.0
|
||||
throwforce = 15.0
|
||||
throwforce = 10.0
|
||||
throw_speed = 1
|
||||
throw_range = 7
|
||||
w_class = 4.0
|
||||
|
||||
var/charges = 0 //how many restocking "charges" the refill has
|
||||
|
||||
/obj/item/weapon/vending_refill/New()
|
||||
/obj/item/weapon/vending_refill/New(amt = -1)
|
||||
..()
|
||||
name = "\improper [machine_name] restocking unit"
|
||||
if(isnum(amt) && amt > -1)
|
||||
charges = amt
|
||||
|
||||
/obj/item/weapon/vending_refill/examine()
|
||||
set src in usr
|
||||
/obj/item/weapon/vending_refill/examine(mob/user)
|
||||
..()
|
||||
if(charges)
|
||||
usr << "It can restock [charges] item(s)."
|
||||
user << "It can restock [charges] item(s)."
|
||||
else
|
||||
usr << "It's empty!"
|
||||
user << "It's empty!"
|
||||
|
||||
//NOTE I decided to go for about 1/3 of a machine's capacity
|
||||
|
||||
/obj/item/weapon/vending_refill/boozeomat
|
||||
machine_name = "Booze-O-Mat"
|
||||
icon_state = "refill_booze"
|
||||
charges = 50//of 138
|
||||
charges = 46//of 138
|
||||
|
||||
/obj/item/weapon/vending_refill/coffee
|
||||
machine_name = "hot drinks"
|
||||
icon_state = "refill_joe"
|
||||
charges = 30//of 85
|
||||
charges = 28//of 85
|
||||
|
||||
/obj/item/weapon/vending_refill/snack
|
||||
machine_name = "Getmore Chocolate Corp"
|
||||
charges = 15//of 48
|
||||
charges = 16//of 48
|
||||
|
||||
/obj/item/weapon/vending_refill/cola
|
||||
machine_name = "Robust Softdrinks"
|
||||
icon_state = "refill_cola"
|
||||
charges = 20//of 65
|
||||
charges = 21//of 65
|
||||
|
||||
/obj/item/weapon/vending_refill/cigarette
|
||||
machine_name = "cigarette"
|
||||
icon_state = "refill_smoke"
|
||||
charges = 10// of 30
|
||||
charges = 9// of 30
|
||||
|
||||
/obj/item/weapon/vending_refill/autodrobe
|
||||
machine_name = "AutoDrobe"
|
||||
icon_state = "refill_costume"
|
||||
charges = 28// of 58
|
||||
charges = 19// of 58
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
if(climbable)
|
||||
structure_shaken()
|
||||
|
||||
return
|
||||
return 1
|
||||
|
||||
/obj/structure/closet/crate/close()
|
||||
if(!src.opened)
|
||||
|
||||
@@ -1,3 +1,41 @@
|
||||
//This proc is called in master-controller, and updates the color of all windows and windoors on the map
|
||||
var/global/wcBar
|
||||
var/global/wcBrig
|
||||
var/global/wcCommon
|
||||
var/global/wcColored
|
||||
/proc/color_windows_init()
|
||||
var/list/bar = list("#0d8395", "#58b5c3", "#58c366", "#90d79a", "#ffffff")
|
||||
var/list/brig = list("#aa0808", "#7f0606", "#ff0000")
|
||||
var/list/common = list("#379963", "#0d8395", "#58b5c3", "#49e46e", "#8fcf44", "#ffffff")
|
||||
|
||||
wcBar = pick(bar)
|
||||
wcBrig = pick(brig)
|
||||
wcCommon = pick(common)
|
||||
|
||||
/obj/proc/color_windows(var/obj/W as obj)
|
||||
if(!wcColored)
|
||||
sleep(50) // Sleeping to make sure the glass has initialized on the map
|
||||
wcColored = 1
|
||||
|
||||
var/list/wcBarAreas = list(/area/crew_quarters/bar)
|
||||
var/list/wcBrigAreas = list(/area/security,/area/security/main,/area/security/lobby,/area/security/brig,/area/security/permabrig,/area/security/prison,/area/security/prison/cell_block/A,/area/security/prison/cell_block/B,/area/security/prison/cell_block/C,/area/security/execution,/area/security/processing,/area/security/interrogation,/area/security/interrogationobs,/area/security/evidence,/area/security/prisonlockers,/area/security/medbay,/area/security/processing,/area/security/warden,/area/security/armoury,/area/security/securearmoury,/area/security/armoury/gamma,/area/security/securehallway,/area/security/hos,/area/security/podbay,/area/security/detectives_office,/area/security/range,/area/security/nuke_storage,/area/security/checkpoint,/area/security/checkpoint2,/area/security/checkpoint2,/area/security/checkpoint/supply,/area/security/checkpoint/engineering,/area/security/checkpoint/medical,/area/security/checkpoint/science,/area/security/vacantoffice,/area/security/vacantoffice2,/area/prison,/area/prison/arrival_airlock,/area/prison/control,/area/prison/crew_quarters,/area/prison/rec_room,/area/prison/closet,/area/prison/hallway/fore,/area/prison/hallway/aft,/area/prison/hallway/port,/area/prison/hallway/starboard,/area/prison/morgue,/area/prison/medical_research,/area/prison/medical,/area/prison/solar,/area/prison/podbay,/area/prison/solar_control,/area/prison/solitary,/area/prison/cell_block,/area/prison/cell_block/A,/area/prison/cell_block/B,/area/prison/cell_block/C)
|
||||
|
||||
var/newcolor
|
||||
for(var/A in wcBarAreas)
|
||||
if(W.areaMaster == locate(A))
|
||||
newcolor = wcBar
|
||||
break
|
||||
|
||||
for(var/A in wcBrigAreas)
|
||||
if(W.areaMaster == locate(A))
|
||||
newcolor = wcBrig
|
||||
break
|
||||
|
||||
if(!newcolor)
|
||||
newcolor = wcCommon
|
||||
|
||||
return newcolor
|
||||
|
||||
/obj/structure/window
|
||||
name = "window"
|
||||
desc = "A window."
|
||||
@@ -18,9 +56,8 @@
|
||||
var/sheets = 1 // Number of sheets needed to build this window (determines how much shit is spawned by destroy())
|
||||
// var/silicate = 0 // number of units of silicate
|
||||
// var/icon/silicateIcon = null // the silicated icon
|
||||
|
||||
|
||||
/obj/structure/window/bullet_act(var/obj/item/projectile/Proj)
|
||||
|
||||
//Tasers and the like should not damage windows.
|
||||
if(Proj.damage_type == HALLOSS)
|
||||
return
|
||||
@@ -338,31 +375,14 @@
|
||||
silicateIcon = I
|
||||
*/
|
||||
|
||||
|
||||
/obj/structure/window/New(Loc,re=0)
|
||||
..()
|
||||
|
||||
// if(re) reinf = re
|
||||
|
||||
ini_dir = dir
|
||||
/* if(reinf)
|
||||
icon_state = "rwindow"
|
||||
desc = "A reinforced window."
|
||||
name = "reinforced window"
|
||||
state = 2*anchored
|
||||
health = 40
|
||||
if(opacity)
|
||||
icon_state = "twindow"
|
||||
else
|
||||
icon_state = "window"*/
|
||||
|
||||
color = color_windows()
|
||||
color = color_windows(src)
|
||||
update_nearby_tiles(need_rebuild=1)
|
||||
update_nearby_icons()
|
||||
|
||||
return
|
||||
|
||||
|
||||
/obj/structure/window/Destroy()
|
||||
density = 0
|
||||
update_nearby_tiles()
|
||||
@@ -479,6 +499,4 @@
|
||||
desc = "It looks rather strong and frosted over. Looks like it might take a few less hits then a normal reinforced window."
|
||||
icon_state = "fwindow"
|
||||
basestate = "fwindow"
|
||||
health = 30
|
||||
|
||||
|
||||
health = 30
|
||||
@@ -24,7 +24,7 @@
|
||||
if(istype(I,/obj/item/weapon/modkit/unathi))
|
||||
user.drop_item()
|
||||
playsound(src.loc, 'sound/items/Screwdriver.ogg', 100, 1)
|
||||
user << "\red You painstakingly modify [src] to make it more suitable for a Tajaran user."
|
||||
user << "\red You painstakingly modify [src] to make it more suitable for a Unathi user."
|
||||
new /obj/item/clothing/head/helmet/space/rig/unathi(user.loc)
|
||||
del(I)
|
||||
del(src)
|
||||
|
||||
@@ -60,9 +60,17 @@
|
||||
icon_state = "armor_reflec"
|
||||
item_state = "armor_reflec"
|
||||
blood_overlay_type = "armor"
|
||||
reflect_chance = 40
|
||||
armor = list(melee = 10, bullet = 10, laser = 80, energy = 50, bomb = 0, bio = 0, rad = 0)
|
||||
siemens_coefficient = 0
|
||||
|
||||
/obj/item/clothing/suit/armor/laserproof/IsReflect(var/def_zone)
|
||||
var/hit_reflect_chance = reflect_chance
|
||||
if(!(def_zone in list("chest", "groin"))) //If not shot where ablative is covering you, you don't get the reflection bonus!
|
||||
hit_reflect_chance = 0
|
||||
if (prob(hit_reflect_chance))
|
||||
return 1
|
||||
|
||||
/obj/item/clothing/suit/armor/swat
|
||||
name = "swat suit"
|
||||
desc = "A heavily armored suit that protects against moderate damage. Used in special operations."
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
|
||||
/datum/event/prison_break/start()
|
||||
for(var/area/A in world)
|
||||
if(istype(A, /area/security/prison) || istype(A, /area/security/brig) || istype(A, /area/prison) || istype(A, /area/security/lobby))
|
||||
if(istype(A, /area/security/prison) || istype(A, /area/security/brig) || istype(A, /area/prison) || istype(A, /area/security/permabrig) || istype(A, /area/security/prisonlockers) || istype(A, /area/security/lobby) || istype(A, /area/security/processing))
|
||||
prisonAreas += A
|
||||
|
||||
if(prisonAreas && prisonAreas.len > 0)
|
||||
|
||||
@@ -12,35 +12,31 @@ emp_act
|
||||
|
||||
var/datum/organ/external/organ = get_organ(check_zone(def_zone))
|
||||
|
||||
if(istype(P, /obj/item/projectile/energy) || istype(P, /obj/item/projectile/beam))
|
||||
if(check_reflect(def_zone)) // Checks if you've passed a reflection% check
|
||||
visible_message("<span class='danger'>The [P.name] gets reflected by [src]!</span>", \
|
||||
"<span class='userdanger'>The [P.name] gets reflected by [src]!</span>")
|
||||
// Find a turf near or on the original location to bounce to
|
||||
if(P.starting)
|
||||
var/new_x = P.starting.x + pick(0, 0, 0, 0, 0, -1, 1, -2, 2)
|
||||
var/new_y = P.starting.y + pick(0, 0, 0, 0, 0, -1, 1, -2, 2)
|
||||
var/turf/curloc = get_turf(src)
|
||||
|
||||
// redirect the projectile
|
||||
P.original = locate(new_x, new_y, P.z)
|
||||
P.starting = curloc
|
||||
P.current = curloc
|
||||
P.firer = src
|
||||
P.yo = new_y - curloc.y
|
||||
P.xo = new_x - curloc.x
|
||||
|
||||
return -1 // complete projectile permutation
|
||||
|
||||
//Shields
|
||||
if(check_shields(P.damage, "the [P.name]"))
|
||||
P.on_hit(src, 2, def_zone)
|
||||
return 2
|
||||
|
||||
//Laserproof armour
|
||||
if(wear_suit && istype(wear_suit, /obj/item/clothing/suit/armor/laserproof))
|
||||
if(istype(P, /obj/item/projectile/energy) || istype(P, /obj/item/projectile/beam))
|
||||
var/reflectchance = 40 - round(P.damage/3)
|
||||
if(!(def_zone in list("chest", "groin")))
|
||||
reflectchance /= 2
|
||||
if(prob(reflectchance))
|
||||
visible_message("\red <B>The [P.name] gets reflected by [src]'s [wear_suit.name]!</B>")
|
||||
|
||||
// Find a turf near or on the original location to bounce to
|
||||
if(P.starting)
|
||||
var/new_x = P.starting.x + pick(0, 0, 0, 0, 0, -1, 1, -2, 2)
|
||||
var/new_y = P.starting.y + pick(0, 0, 0, 0, 0, -1, 1, -2, 2)
|
||||
var/turf/curloc = get_turf(src)
|
||||
|
||||
// redirect the projectile
|
||||
P.original = locate(new_x, new_y, P.z)
|
||||
P.starting = curloc
|
||||
P.current = curloc
|
||||
P.firer = src
|
||||
P.yo = new_y - curloc.y
|
||||
P.xo = new_x - curloc.x
|
||||
|
||||
return -1 // complete projectile permutation
|
||||
|
||||
//Shrapnel
|
||||
if (P.damage_type == BRUTE)
|
||||
@@ -138,6 +134,20 @@ emp_act
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/mob/living/carbon/human/proc/check_reflect(var/def_zone) //Reflection checks for anything in your l_hand, r_hand, or wear_suit based on reflect_chance var of the object
|
||||
if(wear_suit && istype(wear_suit, /obj/item/))
|
||||
var/obj/item/I = wear_suit
|
||||
if(I.IsReflect(def_zone) == 1)
|
||||
return 1
|
||||
if(l_hand && istype(l_hand, /obj/item/))
|
||||
var/obj/item/I = l_hand
|
||||
if(I.IsReflect(def_zone) == 1)
|
||||
return 1
|
||||
if(r_hand && istype(r_hand, /obj/item/))
|
||||
var/obj/item/I = r_hand
|
||||
if(I.IsReflect(def_zone) == 1)
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/mob/living/carbon/human/proc/check_shields(var/damage = 0, var/attack_text = "the attack")
|
||||
if(l_hand && istype(l_hand, /obj/item/weapon))//Current base is the prob(50-d/3)
|
||||
|
||||
@@ -28,6 +28,7 @@ var/list/ai_list = list()
|
||||
var/viewalerts = 0
|
||||
var/lawcheck[1]
|
||||
var/ioncheck[1]
|
||||
var/lawchannel = "Common" // Default channel on which to state laws
|
||||
var/icon/holo_icon//Default is assigned when AI is created.
|
||||
var/obj/item/device/pda/ai/aiPDA = null
|
||||
var/obj/item/device/multitool/aiMulti = null
|
||||
@@ -413,9 +414,12 @@ var/list/ai_list = list()
|
||||
// src << text ("Switching Law [L]'s report status to []", lawcheck[L+1])
|
||||
checklaws()
|
||||
|
||||
if(href_list["say_word"])
|
||||
play_vox_word(href_list["say_word"], null, src)
|
||||
return
|
||||
if (href_list["lawr"]) // Selects on which channel to state laws
|
||||
var/setchannel = input(usr, "Specify channel.", "Channel selection") in list("State","Common","Science","Command","Medical","Engineering","Security","Supply","Binary","Holopad", "Cancel")
|
||||
if(setchannel == "Cancel")
|
||||
return
|
||||
lawchannel = setchannel
|
||||
checklaws()
|
||||
|
||||
if (href_list["lawi"]) // Toggling whether or not a law gets stated by the State Laws verb --NeoFite
|
||||
var/L = text2num(href_list["lawi"])
|
||||
@@ -427,7 +431,11 @@ var/list/ai_list = list()
|
||||
|
||||
if (href_list["laws"]) // With how my law selection code works, I changed statelaws from a verb to a proc, and call it through my law selection panel. --NeoFite
|
||||
statelaws()
|
||||
|
||||
|
||||
if(href_list["say_word"])
|
||||
play_vox_word(href_list["say_word"], null, src)
|
||||
return
|
||||
|
||||
if (href_list["track"])
|
||||
var/mob/target = locate(href_list["track"]) in mob_list
|
||||
var/mob/living/silicon/ai/A = locate(href_list["track2"]) in mob_list
|
||||
|
||||
@@ -51,24 +51,32 @@
|
||||
src.laws_sanity_check()
|
||||
src.laws.clear_supplied_laws()
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/mob/living/silicon/ai/proc/statelaws() // -- TLE
|
||||
// set category = "AI Commands"
|
||||
// set name = "State Laws"
|
||||
src.say("Current Active Laws:")
|
||||
/var/prefix = ""
|
||||
switch(lawchannel)
|
||||
if("Common") prefix = ";"
|
||||
if("Science") prefix = ":n "
|
||||
if("Command") prefix = ":c "
|
||||
if("Medical") prefix = ":m "
|
||||
if("Engineering") prefix = ":e "
|
||||
if("Security") prefix = ":s "
|
||||
if("Supply") prefix = ":u "
|
||||
if("Binary") prefix = ":b "
|
||||
if("Holopad") prefix = ":h "
|
||||
else prefix = ""
|
||||
|
||||
src.say("[prefix]Current Active Laws:")
|
||||
|
||||
//src.laws_sanity_check()
|
||||
//src.laws.show_laws(world)
|
||||
var/number = 1
|
||||
sleep(10)
|
||||
|
||||
|
||||
|
||||
if (src.laws.zeroth)
|
||||
if (src.lawcheck[1] == "Yes") //This line and the similar lines below make sure you don't state a law unless you want to. --NeoFite
|
||||
src.say("0. [src.laws.zeroth]")
|
||||
src.say("[prefix]0. [src.laws.zeroth]")
|
||||
sleep(10)
|
||||
|
||||
for (var/index = 1, index <= src.laws.ion.len, index++)
|
||||
@@ -76,7 +84,7 @@
|
||||
var/num = ionnum()
|
||||
if (length(law) > 0)
|
||||
if (src.ioncheck[index] == "Yes")
|
||||
src.say("[num]. [law]")
|
||||
src.say("[prefix][num]. [law]")
|
||||
sleep(10)
|
||||
|
||||
for (var/index = 1, index <= src.laws.inherent.len, index++)
|
||||
@@ -84,7 +92,7 @@
|
||||
|
||||
if (length(law) > 0)
|
||||
if (src.lawcheck[index+1] == "Yes")
|
||||
src.say("[number]. [law]")
|
||||
src.say("[prefix][number]. [law]")
|
||||
sleep(10)
|
||||
number++
|
||||
|
||||
@@ -95,7 +103,7 @@
|
||||
if (length(law) > 0)
|
||||
if(src.lawcheck.len >= number+1)
|
||||
if (src.lawcheck[number+1] == "Yes")
|
||||
src.say("[number]. [law]")
|
||||
src.say("[prefix][number]. [law]")
|
||||
sleep(10)
|
||||
number++
|
||||
|
||||
@@ -106,8 +114,6 @@
|
||||
|
||||
var/list = "<b>Which laws do you want to include when stating them for the crew?</b><br><br>"
|
||||
|
||||
|
||||
|
||||
if (src.laws.zeroth)
|
||||
if (!src.lawcheck[1])
|
||||
src.lawcheck[1] = "No" //Given Law 0's usual nature, it defaults to NOT getting reported. --NeoFite
|
||||
@@ -144,6 +150,8 @@
|
||||
src.lawcheck[number+1] = "Yes"
|
||||
list += {"<A href='byond://?src=\ref[src];lawc=[number]'>[src.lawcheck[number+1]] [number]:</A> [law]<BR>"}
|
||||
number++
|
||||
list += {"<br><br><A href='byond://?src=\ref[src];laws=1'>State Laws</A>"}
|
||||
|
||||
list += {"<br><A href='byond://?src=\ref[src];lawr=1'>Channel: [src.lawchannel]</A><br>"}
|
||||
list += {"<A href='byond://?src=\ref[src];laws=1'>State Laws</A>"}
|
||||
|
||||
usr << browse(list, "window=laws")
|
||||
@@ -253,6 +253,10 @@
|
||||
stored_comms["wood"]++
|
||||
stored_comms["wood"]++
|
||||
stored_comms["wood"]++
|
||||
else if(istype(W,/obj/item/weapon/broken_bottle))
|
||||
stored_comms["glass"]++
|
||||
stored_comms["glass"]++
|
||||
stored_comms["glass"]++
|
||||
else
|
||||
continue
|
||||
|
||||
|
||||
@@ -108,3 +108,92 @@
|
||||
if(2)
|
||||
var/datum/ai_laws/lawtype = pick(typesof(/datum/ai_laws/default) - /datum/ai_laws/default)
|
||||
laws = new lawtype()
|
||||
|
||||
/mob/living/silicon/robot/proc/statelaws() // -- TLE
|
||||
// set category = "AI Commands"
|
||||
// set name = "State Laws"
|
||||
src.say("Current Active Laws:")
|
||||
//src.laws_sanity_check()
|
||||
//src.laws.show_laws(world)
|
||||
var/number = 1
|
||||
sleep(10)
|
||||
|
||||
if (src.laws.zeroth)
|
||||
if (src.lawcheck[1] == "Yes") //This line and the similar lines below make sure you don't state a law unless you want to. --NeoFite
|
||||
src.say("0. [src.laws.zeroth]")
|
||||
sleep(10)
|
||||
|
||||
for (var/index = 1, index <= src.laws.ion.len, index++)
|
||||
var/law = src.laws.ion[index]
|
||||
var/num = ionnum()
|
||||
if (length(law) > 0)
|
||||
if (src.ioncheck[index] == "Yes")
|
||||
src.say("[num]. [law]")
|
||||
sleep(10)
|
||||
|
||||
for (var/index = 1, index <= src.laws.inherent.len, index++)
|
||||
var/law = src.laws.inherent[index]
|
||||
|
||||
if (length(law) > 0)
|
||||
if (src.lawcheck[index+1] == "Yes")
|
||||
src.say("[number]. [law]")
|
||||
sleep(10)
|
||||
number++
|
||||
|
||||
|
||||
for (var/index = 1, index <= src.laws.supplied.len, index++)
|
||||
var/law = src.laws.supplied[index]
|
||||
|
||||
if (length(law) > 0)
|
||||
if(src.lawcheck.len >= number+1)
|
||||
if (src.lawcheck[number+1] == "Yes")
|
||||
src.say("[number]. [law]")
|
||||
sleep(10)
|
||||
number++
|
||||
|
||||
|
||||
/mob/living/silicon/robot/verb/checklaws() //Gives you a link-driven interface for deciding what laws the statelaws() proc will share with the crew. --NeoFite
|
||||
set category = "Robot Commands"
|
||||
set name = "State Laws"
|
||||
var/list = "<b>Which laws do you want to include when stating them for the crew?</b><br><br>"
|
||||
|
||||
if (src.laws.zeroth)
|
||||
if (!src.lawcheck[1])
|
||||
src.lawcheck[1] = "No" //Given Law 0's usual nature, it defaults to NOT getting reported. --NeoFite
|
||||
list += {"<A href='byond://?src=\ref[src];lawc=0'>[src.lawcheck[1]] 0:</A> [src.laws.zeroth]<BR>"}
|
||||
|
||||
for (var/index = 1, index <= src.laws.ion.len, index++)
|
||||
var/law = src.laws.ion[index]
|
||||
|
||||
if (length(law) > 0)
|
||||
|
||||
|
||||
if (!src.ioncheck[index])
|
||||
src.ioncheck[index] = "Yes"
|
||||
list += {"<A href='byond://?src=\ref[src];lawi=[index]'>[src.ioncheck[index]] [ionnum()]:</A> [law]<BR>"}
|
||||
src.ioncheck.len += 1
|
||||
|
||||
var/number = 1
|
||||
for (var/index = 1, index <= src.laws.inherent.len, index++)
|
||||
var/law = src.laws.inherent[index]
|
||||
|
||||
if (length(law) > 0)
|
||||
src.lawcheck.len += 1
|
||||
|
||||
if (!src.lawcheck[number+1])
|
||||
src.lawcheck[number+1] = "Yes"
|
||||
list += {"<A href='byond://?src=\ref[src];lawc=[number]'>[src.lawcheck[number+1]] [number]:</A> [law]<BR>"}
|
||||
number++
|
||||
|
||||
for (var/index = 1, index <= src.laws.supplied.len, index++)
|
||||
var/law = src.laws.supplied[index]
|
||||
if (length(law) > 0)
|
||||
src.lawcheck.len += 1
|
||||
if (!src.lawcheck[number+1])
|
||||
src.lawcheck[number+1] = "Yes"
|
||||
list += {"<A href='byond://?src=\ref[src];lawc=[number]'>[src.lawcheck[number+1]] [number]:</A> [law]<BR>"}
|
||||
number++
|
||||
|
||||
list += {"<br><br><A href='byond://?src=\ref[src];laws=1'>State Laws</A>"}
|
||||
|
||||
usr << browse(list, "window=laws")
|
||||
@@ -63,6 +63,8 @@
|
||||
var/weapon_lock = 0
|
||||
var/weaponlock_time = 120
|
||||
var/lawupdate = 1 //Cyborgs will sync their laws with their AI by default
|
||||
var/lawcheck[1] //For stating laws.
|
||||
var/ioncheck[1] //Ditto.
|
||||
var/lockcharge //Used when locking down a borg to preserve cell charge
|
||||
var/speed = 0 //Cause sec borgs gotta go fast //No they dont!
|
||||
var/scrambledcodes = 0 // Used to determine if a borg shows up on the robotics console. Setting to one hides them.
|
||||
@@ -565,7 +567,11 @@
|
||||
..()
|
||||
if (istype(AM, /obj/machinery/recharge_station))
|
||||
var/obj/machinery/recharge_station/F = AM
|
||||
F.move_inside()
|
||||
if(F.panel_open)
|
||||
usr << "\blue <b>Close the maintenance panel first.</b>"
|
||||
return
|
||||
else
|
||||
F.move_inside()
|
||||
if (!istype(AM, /atom/movable))
|
||||
return
|
||||
if (!now_pushing)
|
||||
@@ -1228,6 +1234,25 @@
|
||||
else
|
||||
src << "Module isn't activated"
|
||||
installed_modules()
|
||||
|
||||
if (href_list["lawc"]) // Toggling whether or not a law gets stated by the State Laws verb --NeoFite
|
||||
var/L = text2num(href_list["lawc"])
|
||||
switch(lawcheck[L+1])
|
||||
if ("Yes") lawcheck[L+1] = "No"
|
||||
if ("No") lawcheck[L+1] = "Yes"
|
||||
// src << text ("Switching Law [L]'s report status to []", lawcheck[L+1])
|
||||
checklaws()
|
||||
|
||||
if (href_list["lawi"]) // Toggling whether or not a law gets stated by the State Laws verb --NeoFite
|
||||
var/L = text2num(href_list["lawi"])
|
||||
switch(ioncheck[L])
|
||||
if ("Yes") ioncheck[L] = "No"
|
||||
if ("No") ioncheck[L] = "Yes"
|
||||
// src << text ("Switching Law [L]'s report status to []", lawcheck[L+1])
|
||||
checklaws()
|
||||
|
||||
if (href_list["laws"]) // With how my law selection code works, I changed statelaws from a verb to a proc, and call it through my law selection panel. --NeoFite
|
||||
statelaws()
|
||||
return
|
||||
|
||||
/mob/living/silicon/robot/proc/radio_menu()
|
||||
|
||||
@@ -235,6 +235,7 @@
|
||||
src.modules += new /obj/item/weapon/melee/baton/robot(src)
|
||||
src.modules += new /obj/item/weapon/gun/energy/taser/cyborg(src)
|
||||
src.modules += new /obj/item/taperoll/police(src)
|
||||
src.modules += new /obj/item/device/taperecorder(src)
|
||||
src.emag = new /obj/item/weapon/gun/energy/laser/cyborg(src)
|
||||
return
|
||||
|
||||
@@ -299,6 +300,7 @@
|
||||
src.modules += new /obj/item/device/flash(src)
|
||||
src.modules += new /obj/item/weapon/pen/robopen(src)
|
||||
src.modules += new /obj/item/weapon/form_printer(src)
|
||||
src.modules += new /obj/item/device/taperecorder(src)
|
||||
src.modules += new /obj/item/weapon/gripper/paperwork(src)
|
||||
|
||||
src.emag = new /obj/item/weapon/stamp/denied(src)
|
||||
@@ -395,6 +397,7 @@
|
||||
src.modules += new /obj/item/weapon/gripper(src)
|
||||
src.modules += new /obj/item/weapon/matter_decompiler(src)
|
||||
src.modules += new /obj/item/weapon/reagent_containers/spray/cleaner/drone(src)
|
||||
src.modules += new /obj/item/weapon/soap(src)
|
||||
|
||||
src.emag = new /obj/item/weapon/pickaxe/plasmacutter(src)
|
||||
src.emag.name = "Plasma Cutter"
|
||||
|
||||
@@ -56,6 +56,7 @@ display round(lastgen) and plasmatank amount
|
||||
var/open = 0
|
||||
var/recent_fault = 0
|
||||
var/power_output = 1
|
||||
var/consumption = 0
|
||||
|
||||
/obj/machinery/power/port_gen/proc/HasFuel() //Placeholder for fuel check.
|
||||
return 1
|
||||
@@ -101,7 +102,7 @@ display round(lastgen) and plasmatank amount
|
||||
var/sheet_path = /obj/item/stack/sheet/mineral/plasma
|
||||
var/board_path = "/obj/item/weapon/circuitboard/pacman"
|
||||
var/sheet_left = 0 // How much is left of the sheet
|
||||
var/time_per_sheet = 40
|
||||
var/time_per_sheet = 260
|
||||
var/heat = 0
|
||||
|
||||
/obj/machinery/power/port_gen/pacman/initialize()
|
||||
@@ -114,8 +115,8 @@ display round(lastgen) and plasmatank amount
|
||||
component_parts = list()
|
||||
component_parts += new /obj/item/weapon/stock_parts/matter_bin(src)
|
||||
component_parts += new /obj/item/weapon/stock_parts/micro_laser(src)
|
||||
component_parts += new /obj/item/stack/cable_coil(src)
|
||||
component_parts += new /obj/item/stack/cable_coil(src)
|
||||
component_parts += new /obj/item/stack/cable_coil(src, 1)
|
||||
component_parts += new /obj/item/stack/cable_coil(src, 1)
|
||||
component_parts += new /obj/item/weapon/stock_parts/capacitor(src)
|
||||
component_parts += new board_path(src)
|
||||
var/obj/sheet = new sheet_path(null)
|
||||
@@ -128,16 +129,16 @@ display round(lastgen) and plasmatank amount
|
||||
|
||||
/obj/machinery/power/port_gen/pacman/RefreshParts()
|
||||
var/temp_rating = 0
|
||||
var/temp_reliability = 0
|
||||
var/consumption_coeff = 0
|
||||
for(var/obj/item/weapon/stock_parts/SP in component_parts)
|
||||
if(istype(SP, /obj/item/weapon/stock_parts/matter_bin))
|
||||
max_sheets = SP.rating * SP.rating * 50
|
||||
else if(istype(SP, /obj/item/weapon/stock_parts/micro_laser) || istype(SP, /obj/item/weapon/stock_parts/capacitor))
|
||||
else if(istype(SP, /obj/item/weapon/stock_parts/capacitor))
|
||||
temp_rating += SP.rating
|
||||
for(var/obj/item/weapon/CP in component_parts)
|
||||
temp_reliability += CP.reliability
|
||||
reliability = min(round(temp_reliability / 4), 100)
|
||||
power_gen = round(initial(power_gen) * (max(2, temp_rating) / 2))
|
||||
else
|
||||
consumption_coeff += SP.rating
|
||||
power_gen = round(initial(power_gen) * temp_rating * 2)
|
||||
consumption = consumption_coeff
|
||||
|
||||
/obj/machinery/power/port_gen/pacman/examine()
|
||||
..()
|
||||
@@ -160,7 +161,7 @@ display round(lastgen) and plasmatank amount
|
||||
sheets -= amount
|
||||
|
||||
/obj/machinery/power/port_gen/pacman/UseFuel()
|
||||
var/needed_sheets = 1 / (time_per_sheet / power_output)
|
||||
var/needed_sheets = 1 / (time_per_sheet * consumption / power_output)
|
||||
var/temp = min(needed_sheets, sheet_left)
|
||||
needed_sheets -= temp
|
||||
sheet_left -= temp
|
||||
@@ -175,9 +176,9 @@ display round(lastgen) and plasmatank amount
|
||||
var/bias = 0
|
||||
if (power_output > 4)
|
||||
upper_limit = 400
|
||||
bias = power_output * 3
|
||||
bias = power_output - consumption * (4 - consumption)
|
||||
if (heat < lower_limit)
|
||||
heat += 3
|
||||
heat += 4 - consumption
|
||||
else
|
||||
heat += rand(-7 + bias, 7 + bias)
|
||||
if (heat < lower_limit)
|
||||
@@ -191,7 +192,6 @@ display round(lastgen) and plasmatank amount
|
||||
return
|
||||
|
||||
/obj/machinery/power/port_gen/pacman/handleInactive()
|
||||
|
||||
if (heat > 0)
|
||||
heat = max(heat - 2, 0)
|
||||
src.updateDialog()
|
||||
@@ -215,45 +215,29 @@ display round(lastgen) and plasmatank amount
|
||||
emagged = 1
|
||||
emp_act(1)
|
||||
else if(!active)
|
||||
|
||||
if(istype(O, /obj/item/weapon/wrench))
|
||||
|
||||
if(!anchored)
|
||||
if(!anchored && !isinspace())
|
||||
connect_to_network()
|
||||
user << "\blue You secure the generator to the floor."
|
||||
anchored = 1
|
||||
else
|
||||
disconnect_from_network()
|
||||
user << "\blue You unsecure the generator from the floor."
|
||||
anchored = 0
|
||||
|
||||
playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1)
|
||||
anchored = !anchored
|
||||
|
||||
else if(istype(O, /obj/item/weapon/screwdriver))
|
||||
open = !open
|
||||
panel_open = !panel_open
|
||||
playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1)
|
||||
if(open)
|
||||
user << "\blue You open the access panel."
|
||||
if(panel_open)
|
||||
user << "<span class='notice'>You open the access panel.</span>"
|
||||
else
|
||||
user << "\blue You close the access panel."
|
||||
else if(istype(O, /obj/item/weapon/crowbar) && open)
|
||||
var/obj/machinery/constructable_frame/machine_frame/new_frame = new /obj/machinery/constructable_frame/machine_frame(src.loc)
|
||||
for(var/obj/item/I in component_parts)
|
||||
if(I.reliability < 100)
|
||||
I.crit_fail = 1
|
||||
I.loc = src.loc
|
||||
while ( sheets > 0 )
|
||||
var/obj/item/stack/sheet/G = new sheet_path(src.loc)
|
||||
|
||||
if ( sheets > 50 )
|
||||
G.amount = 50
|
||||
else
|
||||
G.amount = sheets
|
||||
|
||||
sheets -= G.amount
|
||||
|
||||
new_frame.state = 2
|
||||
new_frame.icon_state = "box_1"
|
||||
del(src)
|
||||
user << "<span class='notice'>You close the access panel.</span>"
|
||||
else if(istype(O, /obj/item/weapon/storage/part_replacer) && panel_open)
|
||||
exchange_parts(user, O)
|
||||
return
|
||||
else if(istype(O, /obj/item/weapon/crowbar) && panel_open)
|
||||
default_deconstruction_crowbar(O)
|
||||
|
||||
/obj/machinery/power/port_gen/pacman/attack_hand(mob/user as mob)
|
||||
..()
|
||||
|
||||
+158
-12
@@ -22,6 +22,8 @@
|
||||
var/chargemode = 0
|
||||
var/chargecount = 0
|
||||
var/chargelevel = 50000
|
||||
var/input_level_max = 200000 // cap on input_level
|
||||
var/output_level_max = 200000 // cap on output_level
|
||||
var/online = 1
|
||||
var/name_tag = null
|
||||
var/obj/machinery/power/terminal/terminal = null
|
||||
@@ -29,6 +31,16 @@
|
||||
|
||||
/obj/machinery/power/smes/New()
|
||||
..()
|
||||
component_parts = list()
|
||||
component_parts += new /obj/item/weapon/circuitboard/smes(null)
|
||||
component_parts += new /obj/item/weapon/cell/high(null)
|
||||
component_parts += new /obj/item/weapon/cell/high(null)
|
||||
component_parts += new /obj/item/weapon/cell/high(null)
|
||||
component_parts += new /obj/item/weapon/cell/high(null)
|
||||
component_parts += new /obj/item/weapon/cell/high(null)
|
||||
component_parts += new /obj/item/weapon/stock_parts/capacitor(null)
|
||||
component_parts += new /obj/item/stack/cable_coil(null, 5)
|
||||
RefreshParts()
|
||||
spawn(5)
|
||||
if(!powernet)
|
||||
connect_to_network()
|
||||
@@ -49,7 +61,17 @@
|
||||
updateicon()
|
||||
return
|
||||
|
||||
|
||||
/obj/machinery/power/smes/RefreshParts()
|
||||
var/IO = 0
|
||||
var/C = 0
|
||||
for(var/obj/item/weapon/stock_parts/capacitor/CP in component_parts)
|
||||
IO += CP.rating
|
||||
input_level_max = 200000 * IO
|
||||
output_level_max = 200000 * IO
|
||||
for(var/obj/item/weapon/cell/PC in component_parts)
|
||||
C += PC.maxcharge
|
||||
capacity = C / (15000) * 1e6
|
||||
|
||||
/obj/machinery/power/smes/proc/updateicon()
|
||||
overlays.Cut()
|
||||
if(stat & BROKEN) return
|
||||
@@ -85,15 +107,139 @@
|
||||
return
|
||||
|
||||
|
||||
/obj/machinery/power/smes/attackby(obj/item/I, mob/user)
|
||||
//opening using screwdriver
|
||||
if(default_deconstruction_screwdriver(user, "[initial(icon_state)]-o", initial(icon_state), I))
|
||||
update_icon()
|
||||
return
|
||||
|
||||
//changing direction using wrench
|
||||
if(default_change_direction_wrench(user, I))
|
||||
terminal = null
|
||||
var/turf/T = get_step(src, dir)
|
||||
for(var/obj/machinery/power/terminal/term in T)
|
||||
if(term && term.dir == turn(dir, 180))
|
||||
terminal = term
|
||||
terminal.master = src
|
||||
user << "<span class='notice'>Terminal found.</span>"
|
||||
break
|
||||
if(!terminal)
|
||||
user << "<span class='alert'>No power source found.</span>"
|
||||
return
|
||||
stat &= ~BROKEN
|
||||
update_icon()
|
||||
return
|
||||
|
||||
//exchanging parts using the RPE
|
||||
if(exchange_parts(user, I))
|
||||
return
|
||||
|
||||
//building and linking a terminal
|
||||
if(istype(I, /obj/item/stack/cable_coil))
|
||||
var/dir = get_dir(user,src)
|
||||
if(dir & (dir-1))//we don't want diagonal click
|
||||
return
|
||||
|
||||
if(terminal) //is there already a terminal ?
|
||||
user << "<span class='alert'>This SMES already have a power terminal!</span>"
|
||||
return
|
||||
|
||||
if(!panel_open) //is the panel open ?
|
||||
user << "<span class='alert'>You must open the maintenance panel first!</span>"
|
||||
return
|
||||
|
||||
var/turf/T = get_turf(user)
|
||||
if (T.intact) //is the floor plating removed ?
|
||||
user << "<span class='alert'>You must first remove the floor plating!</span>"
|
||||
return
|
||||
|
||||
|
||||
var/obj/item/stack/cable_coil/C = I
|
||||
if(C.amount < 10)
|
||||
user << "<span class='alert'>You need more wires.</span>"
|
||||
return
|
||||
|
||||
user << "You start building the power terminal..."
|
||||
playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1)
|
||||
|
||||
if(do_after(user, 20) && C.amount >= 10)
|
||||
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
|
||||
var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread
|
||||
s.set_up(5, 1, src)
|
||||
s.start()
|
||||
return
|
||||
|
||||
C.use(10)
|
||||
user.visible_message(\
|
||||
"<span class='alert'>[user.name] has built a power terminal!</span>",\
|
||||
"You build the power terminal.")
|
||||
|
||||
//build the terminal and link it to the network
|
||||
make_terminal(T)
|
||||
terminal.connect_to_network()
|
||||
return
|
||||
|
||||
//disassembling the terminal
|
||||
if(istype(I, /obj/item/weapon/wirecutters) && terminal && panel_open)
|
||||
var/turf/T = get_turf(terminal)
|
||||
if (T.intact) //is the floor plating removed ?
|
||||
user << "<span class='alert'>You must first expose the power terminal!</span>"
|
||||
return
|
||||
|
||||
user << "You begin to dismantle the power terminal..."
|
||||
playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1)
|
||||
|
||||
if(do_after(user, 50))
|
||||
if (prob(50) && electrocute_mob(usr, terminal.powernet, terminal)) //animate the electrocution if uncautious and unlucky
|
||||
var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread
|
||||
s.set_up(5, 1, src)
|
||||
s.start()
|
||||
return
|
||||
|
||||
//give the wires back and delete the terminal
|
||||
new /obj/item/stack/cable_coil(T,10)
|
||||
user.visible_message(\
|
||||
"<span class='alert'>[user.name] cuts the cables and dismantles the power terminal.</span>",\
|
||||
"You cut the cables and dismantle the power terminal.")
|
||||
charging = 0 //stop inputting, since we have don't have a terminal anymore
|
||||
del(terminal)
|
||||
return
|
||||
|
||||
//crowbarring it !
|
||||
default_deconstruction_crowbar(I)
|
||||
|
||||
/obj/machinery/power/smes/Destroy()
|
||||
if(ticker && ticker.current_state == GAME_STATE_PLAYING)
|
||||
var/area/area = get_area(src)
|
||||
message_admins("SMES deleted at (<A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[x];Y=[y];Z=[z]'>[area.name]</a>)")
|
||||
log_game("SMES deleted at ([area.name])")
|
||||
investigate_log("<font color='red'>deleted</font> at ([area.name])","singulo")
|
||||
if(terminal)
|
||||
disconnect_terminal()
|
||||
..()
|
||||
|
||||
// create a terminal object pointing towards the SMES
|
||||
// wires will attach to this
|
||||
/obj/machinery/power/smes/proc/make_terminal(var/turf/T)
|
||||
terminal = new/obj/machinery/power/terminal(T)
|
||||
terminal.dir = get_dir(T,src)
|
||||
terminal.master = src
|
||||
|
||||
/obj/machinery/power/smes/proc/disconnect_terminal()
|
||||
if(terminal)
|
||||
terminal.master = null
|
||||
terminal = null
|
||||
|
||||
/obj/machinery/power/smes/proc/chargedisplay()
|
||||
return round(5.5*charge/(capacity ? capacity : 5e6))
|
||||
return round(5.5*charge/capacity)
|
||||
|
||||
#define SMESRATE 0.05 // rate of internal charge to external power
|
||||
|
||||
|
||||
/obj/machinery/power/smes/process()
|
||||
|
||||
if(stat & BROKEN) return
|
||||
if(stat & BROKEN)
|
||||
return
|
||||
|
||||
//store machine state to see if we need to update the icon overlays
|
||||
var/last_disp = chargedisplay()
|
||||
@@ -205,10 +351,10 @@
|
||||
data["charging"] = charging
|
||||
data["chargeMode"] = chargemode
|
||||
data["chargeLevel"] = chargelevel
|
||||
data["chargeMax"] = SMESMAXCHARGELEVEL
|
||||
data["chargeMax"] = input_level_max
|
||||
data["outputOnline"] = online
|
||||
data["outputLevel"] = output
|
||||
data["outputMax"] = SMESMAXOUTPUT
|
||||
data["outputMax"] = output_level_max
|
||||
data["outputLoad"] = round(loaddemand)
|
||||
|
||||
// update the ui if it exists, returns null if no ui is passed/found
|
||||
@@ -254,20 +400,20 @@
|
||||
if("min")
|
||||
chargelevel = 0
|
||||
if("max")
|
||||
chargelevel = SMESMAXCHARGELEVEL //30000
|
||||
chargelevel = input_level_max //30000
|
||||
if("set")
|
||||
chargelevel = input(usr, "Enter new input level (0-[SMESMAXCHARGELEVEL])", "SMES Input Power Control", chargelevel) as num
|
||||
chargelevel = max(0, min(SMESMAXCHARGELEVEL, chargelevel)) // clamp to range
|
||||
chargelevel = input(usr, "Enter new input level (0-[input_level_max])", "SMES Input Power Control", chargelevel) as num
|
||||
chargelevel = max(0, min(input_level_max, chargelevel)) // clamp to range
|
||||
|
||||
else if( href_list["output"] )
|
||||
switch( href_list["output"] )
|
||||
if("min")
|
||||
output = 0
|
||||
if("max")
|
||||
output = SMESMAXOUTPUT //30000
|
||||
output = output_level_max //30000
|
||||
if("set")
|
||||
output = input(usr, "Enter new output level (0-[SMESMAXOUTPUT])", "SMES Output Power Control", output) as num
|
||||
output = max(0, min(SMESMAXOUTPUT, output)) // clamp to range
|
||||
output = input(usr, "Enter new output level (0-[output_level_max])", "SMES Output Power Control", output) as num
|
||||
output = max(0, min(output_level_max, output)) // clamp to range
|
||||
|
||||
investigate_log("input/output; [chargelevel>output?"<font color='green'>":"<font color='red'>"][chargelevel]/[output]</font> | Output-mode: [online?"<font color='green'>on</font>":"<font color='red'>off</font>"] | Input-mode: [chargemode?"<font color='green'>auto</font>":"<font color='red'>off</font>"] by [usr.key]","singulo")
|
||||
|
||||
|
||||
@@ -118,7 +118,8 @@
|
||||
name = "\improper Bulldog shotgun"
|
||||
desc = "A compact, mag-fed semi-automatic shotgun for combat in narrow corridors. Compatible only with specialized magazines."
|
||||
icon_state = "bulldog"
|
||||
item_state = "c20r"
|
||||
item_state = "bulldog"
|
||||
icon_override = 'icons/mob/in-hand/guns.dmi'
|
||||
w_class = 3.0
|
||||
origin_tech = "combat=5;materials=4;syndicate=6"
|
||||
mag_type = "/obj/item/ammo_box/magazine/m12g"
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
var/unhack_message = "You re-enable the safety safeguards, enabling the \"NT Standard\" mode."
|
||||
var/list/broken_requirements = list()
|
||||
var/broken_on_spawn = 0
|
||||
var/recharge_delay = 15
|
||||
|
||||
|
||||
/obj/machinery/chem_dispenser/proc/recharge()
|
||||
@@ -48,7 +49,7 @@
|
||||
|
||||
if(recharged < 0)
|
||||
recharge()
|
||||
recharged = 15
|
||||
recharged = recharge_delay
|
||||
else
|
||||
recharged -= 1
|
||||
|
||||
@@ -180,7 +181,8 @@
|
||||
var/obj/item/weapon/reagent_containers/glass/B = beaker
|
||||
B.loc = loc
|
||||
beaker = null
|
||||
icon_state = initial(icon_state)
|
||||
if(!panel_open)
|
||||
icon_state = initial(icon_state)
|
||||
add_fingerprint(usr)
|
||||
return 1 // update UIs attached to this object
|
||||
|
||||
@@ -266,6 +268,84 @@
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/obj/machinery/chem_dispenser/constructable
|
||||
name = "portable chem dispenser"
|
||||
icon = 'icons/obj/chemical.dmi'
|
||||
icon_state = "minidispenser"
|
||||
energy = 5
|
||||
max_energy = 5
|
||||
amount = 5
|
||||
recharge_delay = 30
|
||||
dispensable_reagents = list()
|
||||
var/list/special_reagents = list(list("hydrogen", "oxygen", "silicon", "phosphorus", "sulfur", "carbon", "nitrogen"),
|
||||
list("lithium", "sugar", "sacid", "water", "copper", "mercury", "sodium"),
|
||||
list("ethanol", "chlorine", "potassium", "aluminium", "radium", "fluorine", "iron"))
|
||||
|
||||
/obj/machinery/chem_dispenser/constructable/New()
|
||||
..()
|
||||
component_parts = list()
|
||||
component_parts += new /obj/item/weapon/circuitboard/chem_dispenser(src)
|
||||
component_parts += new /obj/item/weapon/stock_parts/matter_bin(src)
|
||||
component_parts += new /obj/item/weapon/stock_parts/matter_bin(src)
|
||||
component_parts += new /obj/item/weapon/stock_parts/manipulator(src)
|
||||
component_parts += new /obj/item/weapon/stock_parts/capacitor(src)
|
||||
component_parts += new /obj/item/weapon/stock_parts/console_screen(src)
|
||||
component_parts += new /obj/item/weapon/cell/super(src)
|
||||
RefreshParts()
|
||||
|
||||
/obj/machinery/chem_dispenser/constructable/RefreshParts()
|
||||
var/time = 0
|
||||
var/temp_energy = 0
|
||||
var/i
|
||||
for(var/obj/item/weapon/stock_parts/matter_bin/M in component_parts)
|
||||
temp_energy += M.rating
|
||||
temp_energy--
|
||||
max_energy = temp_energy * 5 //max energy = (bin1.rating + bin2.rating - 1) * 5, 5 on lowest 25 on highest
|
||||
for(var/obj/item/weapon/stock_parts/capacitor/C in component_parts)
|
||||
time += C.rating
|
||||
for(var/obj/item/weapon/cell/P in component_parts)
|
||||
time += round(P.maxcharge, 10000) / 10000
|
||||
recharge_delay /= time/2 //delay between recharges, double the usual time on lowest 50% less than usual on highest
|
||||
for(var/obj/item/weapon/stock_parts/manipulator/M in component_parts)
|
||||
for(i=1, i<=M.rating, i++)
|
||||
dispensable_reagents = sortList(dispensable_reagents | special_reagents[i])
|
||||
|
||||
/obj/machinery/chem_dispenser/constructable/attackby(var/obj/item/I, var/mob/user)
|
||||
if(istype(I, /obj/item/weapon/reagent_containers/glass))
|
||||
if(panel_open)
|
||||
user << "<span class='notice'>Close the maintenance panel first.</span>"
|
||||
return
|
||||
..()
|
||||
else
|
||||
..()
|
||||
|
||||
if(default_deconstruction_screwdriver(user, "minidispenser-o", "minidispenser", I))
|
||||
return
|
||||
|
||||
if(exchange_parts(user, I))
|
||||
return
|
||||
|
||||
if(istype(I, /obj/item/weapon/wrench))
|
||||
playsound(src, 'sound/items/Ratchet.ogg', 50, 1)
|
||||
if(anchored)
|
||||
anchored = 0
|
||||
user << "<span class='caution'>The [src] can now be moved.</span>"
|
||||
else if(!anchored)
|
||||
anchored = 1
|
||||
user << "<span class='caution'>The [src] is now secured.</span>"
|
||||
|
||||
if(panel_open)
|
||||
if(istype(I, /obj/item/weapon/crowbar))
|
||||
if(beaker)
|
||||
var/obj/item/weapon/reagent_containers/glass/B = beaker
|
||||
B.loc = loc
|
||||
beaker = null
|
||||
default_deconstruction_crowbar(I)
|
||||
return 1
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/obj/machinery/chem_master
|
||||
name = "ChemMaster 3000"
|
||||
density = 1
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
/obj/item/weapon/reagent_containers/spray/afterattack(atom/A as mob|obj, mob/user as mob)
|
||||
if(istype(A, /obj/item/weapon/storage) || istype(A, /obj/structure/table) || istype(A, /obj/structure/rack) || istype(A, /obj/structure/closet) \
|
||||
|| istype(A, /obj/item/weapon/reagent_containers) || istype(A, /obj/structure/sink))
|
||||
|| istype(A, /obj/item/weapon/reagent_containers) || istype(A, /obj/structure/sink) || istype(A, /obj/structure/janitorialcart) || istype(A, /obj/machinery/portable_atmospherics/hydroponics))
|
||||
return
|
||||
|
||||
if(istype(A, /obj/effect/proc_holder/spell))
|
||||
|
||||
@@ -14,6 +14,7 @@ using metal and glass, it uses glass and reagents (usually sulfuric acis).
|
||||
var/diamond_amount = 0
|
||||
var/uranium_amount = 0
|
||||
var/max_material_amount = 75000.0
|
||||
var/efficiency_coeff
|
||||
|
||||
New()
|
||||
..()
|
||||
@@ -36,7 +37,10 @@ using metal and glass, it uses glass and reagents (usually sulfuric acis).
|
||||
for(var/obj/item/weapon/stock_parts/matter_bin/M in component_parts)
|
||||
T += M.rating
|
||||
max_material_amount = T * 75000.0
|
||||
|
||||
T = 0
|
||||
for(var/obj/item/weapon/stock_parts/manipulator/M in component_parts)
|
||||
T += M.rating
|
||||
efficiency_coeff = 2 ** (T - 1) //Only 1 manipulator here, you're making runtimes Razharas
|
||||
|
||||
blob_act()
|
||||
if (prob(50))
|
||||
@@ -52,33 +56,19 @@ using metal and glass, it uses glass and reagents (usually sulfuric acis).
|
||||
attackby(var/obj/item/O as obj, var/mob/user as mob)
|
||||
if(exchange_parts(user, O))
|
||||
return
|
||||
|
||||
if (shocked)
|
||||
shock(user,50)
|
||||
|
||||
if (istype(O, /obj/item/weapon/screwdriver))
|
||||
if (!opened)
|
||||
opened = 1
|
||||
if (default_deconstruction_screwdriver(user, "circuit_imprinter_t", "circuit_imprinter", O))
|
||||
if(linked_console)
|
||||
linked_console.linked_imprinter = null
|
||||
linked_console = null
|
||||
icon_state = "circuit_imprinter_t"
|
||||
user << "You open the maintenance hatch of [src]."
|
||||
else
|
||||
opened = 0
|
||||
icon_state = "circuit_imprinter"
|
||||
user << "You close the maintenance hatch of [src]."
|
||||
return
|
||||
if (opened)
|
||||
|
||||
if (panel_open)
|
||||
if(istype(O, /obj/item/weapon/crowbar))
|
||||
playsound(src.loc, 'sound/items/Crowbar.ogg', 50, 1)
|
||||
var/obj/machinery/constructable_frame/machine_frame/M = new /obj/machinery/constructable_frame/machine_frame(src.loc)
|
||||
M.state = 2
|
||||
M.icon_state = "box_1"
|
||||
for(var/obj/I in component_parts)
|
||||
if(istype(I, /obj/item/weapon/reagent_containers/glass/beaker))
|
||||
reagents.trans_to(I, reagents.total_volume)
|
||||
if(I.reliability != 100 && crit_fail)
|
||||
I.crit_fail = 1
|
||||
I.loc = src.loc
|
||||
if(g_amount >= 3750)
|
||||
var/obj/item/stack/sheet/glass/G = new /obj/item/stack/sheet/glass(src.loc)
|
||||
G.amount = round(g_amount / 3750)
|
||||
@@ -91,7 +81,7 @@ using metal and glass, it uses glass and reagents (usually sulfuric acis).
|
||||
if(uranium_amount >= 2000)
|
||||
var/obj/item/stack/sheet/mineral/uranium/G = new /obj/item/stack/sheet/mineral/uranium(src.loc)
|
||||
G.amount = round(uranium_amount / 2000)
|
||||
del(src)
|
||||
default_deconstruction_crowbar(O)
|
||||
return 1
|
||||
else
|
||||
user << "\red You can't load the [src.name] while it's opened."
|
||||
|
||||
@@ -142,7 +142,7 @@ datum/design/scan_console
|
||||
build_path = "/obj/item/weapon/circuitboard/scan_consolenew"
|
||||
|
||||
datum/design/comconsole
|
||||
name = "Circuit Design (Communications)"
|
||||
name = "Circuit Design (Communications Console)"
|
||||
desc = "Allows for the construction of circuit boards used to build a communications console."
|
||||
id = "comconsole"
|
||||
req_tech = list("programming" = 2, "magnets" = 2)
|
||||
@@ -160,7 +160,7 @@ datum/design/idcardconsole
|
||||
build_path = "/obj/item/weapon/circuitboard/card"
|
||||
|
||||
datum/design/crewconsole
|
||||
name = "Circuit Design (Crew monitoring computer)"
|
||||
name = "Circuit Design (Crew Monitoring Computer)"
|
||||
desc = "Allows for the construction of circuit boards used to build a Crew monitoring computer."
|
||||
id = "crewconsole"
|
||||
req_tech = list("programming" = 3, "magnets" = 2, "biotech" = 2)
|
||||
@@ -243,7 +243,7 @@ datum/design/clonecontrol
|
||||
build_path = "/obj/item/weapon/circuitboard/cloning"
|
||||
|
||||
datum/design/clonepod
|
||||
name = "Circuit Design (Clone Pod)"
|
||||
name = "Circuit Design (Cloning Pod)"
|
||||
desc = "Allows for the construction of circuit boards used to build a Cloning Pod."
|
||||
id = "clonepod"
|
||||
req_tech = list("programming" = 3, "biotech" = 3)
|
||||
@@ -260,10 +260,82 @@ datum/design/clonescanner
|
||||
materials = list("$glass" = 2000, "sacid" = 20)
|
||||
build_path = "/obj/item/weapon/circuitboard/clonescanner"
|
||||
|
||||
datum/design/teleport_station
|
||||
name = "Circuit Design (Teleportation Station Board)"
|
||||
desc = "Allows for the construction of circuit boards used to build a Teleporter Station."
|
||||
id = "tele_station"
|
||||
req_tech = list("programming" = 4, "bluespace" = 4, "engineering" = 4)
|
||||
build_type = IMPRINTER
|
||||
materials = list("$glass" = 1000, "sacid" = 20)
|
||||
build_path = /obj/item/weapon/circuitboard/teleporter_station
|
||||
|
||||
datum/design/teleport_hub
|
||||
name = "Circuit Design (Teleportation Hub Board)"
|
||||
desc = "Allows for the construction of circuit boards used to build a Teleportation Hub."
|
||||
id = "tele_hub"
|
||||
req_tech = list("programming" = 3, "bluespace" = 5, "materials" = 4, "engineering" = 5)
|
||||
build_type = IMPRINTER
|
||||
materials = list("$glass" = 1000, "sacid" = 20)
|
||||
build_path = /obj/item/weapon/circuitboard/teleporter_hub
|
||||
|
||||
datum/design/telepad
|
||||
name = "Circuit Design (Telepad Board)"
|
||||
desc = "Allows for the construction of circuit boards used to build a Telepad."
|
||||
id = "telepad"
|
||||
req_tech = list("programming" = 4, "bluespace" = 4, "materials" = 3, "engineering" = 3)
|
||||
build_type = IMPRINTER
|
||||
materials = list("$glass" = 1000, "sacid" = 20)
|
||||
build_path = "/obj/item/weapon/circuitboard/telesci_pad"
|
||||
|
||||
datum/design/sleeper
|
||||
name = "Circuit Design (Sleeper Board)"
|
||||
desc = "Allows for the construction of circuit boards used to build a Sleeper."
|
||||
id = "sleeper"
|
||||
req_tech = list("programming" = 3, "biotech" = 2, "materials" = 3, "engineering" = 3)
|
||||
build_type = IMPRINTER
|
||||
materials = list("$glass" = 1000, "sacid" = 20)
|
||||
build_path = "/obj/item/weapon/circuitboard/sleeper"
|
||||
|
||||
datum/design/sleep_console
|
||||
name = "Circuit Design (Sleeper Console)"
|
||||
desc = "Allows for the construction of circuit boards used to build a Sleeper Console."
|
||||
id = "sleeper"
|
||||
req_tech = list("programming" = 3, "biotech" = 2, "materials" = 3, "engineering" = 3)
|
||||
build_type = IMPRINTER
|
||||
materials = list("$glass" = 1000, "sacid" = 20)
|
||||
build_path = "/obj/item/weapon/circuitboard/sleep_console"
|
||||
|
||||
datum/design/bodyscanner
|
||||
name = "Circuit Design (Body Scanner Board)"
|
||||
desc = "Allows for the construction of circuit boards used to build a Body Scanner."
|
||||
id = "sleeper"
|
||||
req_tech = list("programming" = 3, "biotech" = 2, "materials" = 3, "engineering" = 3)
|
||||
build_type = IMPRINTER
|
||||
materials = list("$glass" = 1000, "sacid" = 20)
|
||||
build_path = "/obj/item/weapon/circuitboard/bodyscanner"
|
||||
|
||||
datum/design/sleep_console
|
||||
name = "Circuit Design (Body Scanner Console)"
|
||||
desc = "Allows for the construction of circuit boards used to build a Body Scanner Console."
|
||||
id = "sleeper"
|
||||
req_tech = list("programming" = 3, "biotech" = 2, "materials" = 3, "engineering" = 3)
|
||||
build_type = IMPRINTER
|
||||
materials = list("$glass" = 1000, "sacid" = 20)
|
||||
build_path = "/obj/item/weapon/circuitboard/bodyscanner_console"
|
||||
|
||||
datum/design/cryotube
|
||||
name = "Circuit Design (Cryotube Board)"
|
||||
desc = "Allows for the construction of circuit boards used to build a Cryotube."
|
||||
id = "cryotube"
|
||||
req_tech = list("programming" = 4, "biotech" = 3, "engineering" = 4)
|
||||
build_type = IMPRINTER
|
||||
materials = list("$glass" = 1000, "sacid" = 20)
|
||||
build_path = "/obj/item/weapon/circuitboard/cryo_tube"
|
||||
|
||||
datum/design/arcadebattle
|
||||
name = "Circuit Design (Battle Arcade Machine)"
|
||||
desc = "Allows for the construction of circuit boards used to build a new arcade machine."
|
||||
id = "arcademachine"
|
||||
id = "arcademachinebattle"
|
||||
req_tech = list("programming" = 1)
|
||||
build_type = IMPRINTER
|
||||
materials = list("$glass" = 2000, "sacid" = 20)
|
||||
@@ -272,7 +344,7 @@ datum/design/arcadebattle
|
||||
datum/design/orion_trail
|
||||
name = "Circuit Design (Orion Trail Arcade Machine)"
|
||||
desc = "Allows for the construction of circuit boards used to build a new Orion Trail machine."
|
||||
id = "arcademachine"
|
||||
id = "arcademachineonion"
|
||||
req_tech = list("programming" = 2)
|
||||
build_type = IMPRINTER
|
||||
materials = list("$glass" = 2000, "sacid" = 20)
|
||||
@@ -333,8 +405,8 @@ datum/design/rdconsole
|
||||
build_path = "/obj/item/weapon/circuitboard/rdconsole"
|
||||
|
||||
datum/design/ordercomp
|
||||
name = "Circuit Design (Supply ordering console)"
|
||||
desc = "Allows for the construction of circuit boards used to build a Supply ordering console."
|
||||
name = "Circuit Design (Supply Ordering Console)"
|
||||
desc = "Allows for the construction of circuit boards used to build a supply ordering console."
|
||||
id = "ordercomp"
|
||||
req_tech = list("programming" = 2)
|
||||
build_type = IMPRINTER
|
||||
@@ -342,8 +414,8 @@ datum/design/ordercomp
|
||||
build_path = "/obj/item/weapon/circuitboard/ordercomp"
|
||||
|
||||
datum/design/supplycomp
|
||||
name = "Circuit Design (Supply shuttle console)"
|
||||
desc = "Allows for the construction of circuit boards used to build a Supply shuttle console."
|
||||
name = "Circuit Design (Supply Shuttle Console)"
|
||||
desc = "Allows for the construction of circuit boards used to build a supply shuttle console."
|
||||
id = "supplycomp"
|
||||
req_tech = list("programming" = 3)
|
||||
build_type = IMPRINTER
|
||||
@@ -377,6 +449,24 @@ datum/design/message_monitor
|
||||
materials = list("$glass" = 2000, "sacid" = 20)
|
||||
build_path = "/obj/item/weapon/circuitboard/message_monitor"
|
||||
|
||||
datum/design/comm_traffic
|
||||
name = "Circuit Design (Telecommunications Traffic Control Console)"
|
||||
desc = "Allows for the construction of circuit boards used to build a telecommunications traffic control console."
|
||||
id = "comm_traffic"
|
||||
req_tech = list("programming" = 3)
|
||||
build_type = IMPRINTER
|
||||
materials = list("$glass" = 1000, "sacid" = 20)
|
||||
build_path = "/obj/item/weapon/circuitboard/comm_traffic"
|
||||
|
||||
datum/design/telesci_console
|
||||
name = "Circuit Design (Telepad Control Console Board)"
|
||||
desc = "Allows for the construction of circuit boards used to build a telescience console."
|
||||
id = "telesci_console"
|
||||
req_tech = list("programming" = 3, "bluespace" = 2)
|
||||
build_type = IMPRINTER
|
||||
materials = list("$glass" = 1000, "sacid" = 20)
|
||||
build_path = "/obj/item/weapon/circuitboard/telesci_console"
|
||||
|
||||
datum/design/aifixer
|
||||
name = "Circuit Design (AI Integrity Restorer)"
|
||||
desc = "Allows for the construction of circuit boards used to build an AI Integrity Restorer."
|
||||
@@ -1235,6 +1325,59 @@ datum/design/light_replacer
|
||||
////////////////////////////////////////
|
||||
//////////////MISC Boards///////////////
|
||||
////////////////////////////////////////
|
||||
datum/design/smes
|
||||
name = "SMES Board"
|
||||
desc = "The circuit board for a SMES."
|
||||
id = "smes"
|
||||
req_tech = list("programming" = 4, "power" = 5, "engineering" = 4)
|
||||
build_type = IMPRINTER
|
||||
materials = list("$glass" = 1000, "sacid" = 20)
|
||||
build_path = /obj/item/weapon/circuitboard/smes
|
||||
|
||||
datum/design/thermomachine
|
||||
name = "Freezer/Heater Board"
|
||||
desc = "The circuit board for a freezer/heater."
|
||||
id = "thermomachine"
|
||||
req_tech = list("programming" = 3, "plasmatech" = 3)
|
||||
build_type = IMPRINTER
|
||||
materials = list("$glass" = 1000, "sacid" = 20)
|
||||
build_path = /obj/item/weapon/circuitboard/thermomachine
|
||||
|
||||
datum/design/biogenerator
|
||||
name = "Biogenerator Board"
|
||||
desc = "The circuit board for a biogenerator."
|
||||
id = "biogenerator"
|
||||
req_tech = list("programming" = 3, "biotech" = 2, "materials" = 3)
|
||||
build_type = IMPRINTER
|
||||
materials = list("$glass" = 1000, "sacid" = 20)
|
||||
build_path = /obj/item/weapon/circuitboard/biogenerator
|
||||
|
||||
datum/design/hydroponics
|
||||
name = "Hydroponics Tray Board"
|
||||
desc = "The circuit board for a hydroponics tray."
|
||||
id = "hydro_tray"
|
||||
req_tech = list("programming" = 1, "biotech" = 1)
|
||||
build_type = IMPRINTER
|
||||
materials = list("$glass" = 1000, "sacid" = 20)
|
||||
build_path = /obj/item/weapon/circuitboard/hydroponics
|
||||
|
||||
datum/design/microwave
|
||||
name = "Microwave Board"
|
||||
desc = "The circuit board for a microwave."
|
||||
id = "microwave"
|
||||
req_tech = list("programming" = 1)
|
||||
build_type = IMPRINTER
|
||||
materials = list("$glass" = 1000, "sacid" = 20)
|
||||
build_path = "/obj/item/weapon/circuitboard/microwave"
|
||||
|
||||
datum/design/chem_dispenser
|
||||
name = "Portable Chem Dispenser Board"
|
||||
desc = "The circuit board for a portable chem dispenser."
|
||||
id = "chem_dispenser"
|
||||
req_tech = list("programming" = 4, "biotech" = 3, "engineering" = 4, "materials" = 4, "plasmatech" = 3)
|
||||
build_type = IMPRINTER
|
||||
materials = list("$glass" = 1000, "sacid" = 20)
|
||||
build_path = "/obj/item/weapon/circuitboard/chem_dispenser"
|
||||
|
||||
datum/design/destructive_analyzer
|
||||
name = "Destructive Analyzer Board"
|
||||
@@ -1299,7 +1442,33 @@ datum/design/mechfab
|
||||
materials = list("$glass" = 2000, "sacid" = 20)
|
||||
build_path = "/obj/item/weapon/circuitboard/mechfab"
|
||||
|
||||
|
||||
datum/design/cyborgrecharger
|
||||
name = "Cyborg Recharger Board"
|
||||
desc = "The circuit board for a Cyborg Recharger."
|
||||
id = "cyborgrecharger"
|
||||
req_tech = list("powerstorage" = 3, "engineering" = 3)
|
||||
build_type = IMPRINTER
|
||||
materials = list("$glass" = 1000, "sacid" = 20)
|
||||
build_path = "/obj/item/weapon/circuitboard/cyborgrecharger"
|
||||
|
||||
datum/design/mech_recharger
|
||||
name = "Mech Bay Recharger Board"
|
||||
desc = "The circuit board for a Mech Bay Recharger."
|
||||
id = "mech_recharger"
|
||||
req_tech = list("programming" = 3, "powerstorage" = 4, "engineering" = 4)
|
||||
build_type = IMPRINTER
|
||||
materials = list("$glass" = 1000, "sacid" = 20)
|
||||
build_path = "/obj/item/weapon/circuitboard/mech_recharger"
|
||||
|
||||
datum/design/vendor
|
||||
name = "Vendor Board"
|
||||
desc = "The circuit board for a Vendor."
|
||||
id = "vendor"
|
||||
req_tech = list("programming" = 1)
|
||||
build_type = IMPRINTER
|
||||
materials = list("$glass" = 1000, "sacid" = 20)
|
||||
build_path = "/obj/item/weapon/circuitboard/vendor"
|
||||
|
||||
/////////////////////////////////////////
|
||||
////////////Power Stuff//////////////////
|
||||
/////////////////////////////////////////
|
||||
@@ -1334,7 +1503,6 @@ datum/design/mrspacman
|
||||
materials = list("$glass" = 2000, "sacid" = 20)
|
||||
build_path = "/obj/item/weapon/circuitboard/pacman/mrs"
|
||||
|
||||
|
||||
/////////////////////////////////////////
|
||||
////////////Medical Tools////////////////
|
||||
/////////////////////////////////////////
|
||||
@@ -1865,8 +2033,7 @@ datum/design/telepad_beacon
|
||||
build_type = PROTOLATHE
|
||||
materials = list ("$metal" = 2000, "$glass" = 1750, "$silver" = 500)
|
||||
build_path = "/obj/item/device/telepad_beacon"
|
||||
|
||||
|
||||
|
||||
datum/design/bag_holding
|
||||
name = "Bag of Holding"
|
||||
desc = "A backpack that opens into a localized pocket of Blue Space."
|
||||
@@ -1876,6 +2043,25 @@ datum/design/bag_holding
|
||||
materials = list("$gold" = 3000, "$diamond" = 1500, "$uranium" = 250)
|
||||
reliability_base = 80
|
||||
build_path = "/obj/item/weapon/storage/backpack/holding"
|
||||
|
||||
datum/design/bluespace_crystal
|
||||
name = "Artificial Bluespace Crystal"
|
||||
desc = "A small blue crystal with mystical properties."
|
||||
id = "bluespace_crystal"
|
||||
req_tech = list("bluespace" = 4, "materials" = 6)
|
||||
build_type = PROTOLATHE
|
||||
materials = list("$gold" = 1500, "$diamond" = 3000, "$plasma" = 1500)
|
||||
reliability_base = 100
|
||||
build_path = "/obj/item/bluespace_crystal/artificial"
|
||||
|
||||
datum/design/telesci_sps
|
||||
name = "SPS Device"
|
||||
desc = "A device that can track its position at all times."
|
||||
id = "telesci_sps"
|
||||
req_tech = list("materials" = 2, "magnets" = 3, "bluespace" = 3)
|
||||
build_type = PROTOLATHE
|
||||
materials = list("$metal" = 500, "$glass" = 1000)
|
||||
build_path = /obj/item/device/sps
|
||||
|
||||
/////////////////////////////////////////
|
||||
/////////////////HUDs////////////////////
|
||||
|
||||
@@ -11,7 +11,7 @@ Note: Must be placed within 3 tiles of the R&D Console
|
||||
name = "Destructive Analyzer"
|
||||
icon_state = "d_analyzer"
|
||||
var/obj/item/weapon/loaded_item = null
|
||||
var/decon_mod = 1
|
||||
var/decon_mod = 0
|
||||
|
||||
/obj/machinery/r_n_d/destructive_analyzer/New()
|
||||
..()
|
||||
@@ -24,9 +24,8 @@ Note: Must be placed within 3 tiles of the R&D Console
|
||||
|
||||
/obj/machinery/r_n_d/destructive_analyzer/RefreshParts()
|
||||
var/T = 0
|
||||
for(var/obj/item/weapon/stock_parts/S in src)
|
||||
T += S.rating * 0.1
|
||||
T = between (0, T, 1)
|
||||
for(var/obj/item/weapon/stock_parts/S in component_parts)
|
||||
T += S.rating
|
||||
decon_mod = T
|
||||
|
||||
/obj/machinery/r_n_d/destructive_analyzer/meteorhit()
|
||||
@@ -43,28 +42,20 @@ Note: Must be placed within 3 tiles of the R&D Console
|
||||
/obj/machinery/r_n_d/destructive_analyzer/attackby(var/obj/O as obj, var/mob/user as mob)
|
||||
if (shocked)
|
||||
shock(user,50)
|
||||
|
||||
if (istype(O, /obj/item/weapon/screwdriver))
|
||||
if (!opened)
|
||||
opened = 1
|
||||
if (default_deconstruction_screwdriver(user, "d_analyzer_t", "d_analyzer", O))
|
||||
if(linked_console)
|
||||
linked_console.linked_destroy = null
|
||||
linked_console = null
|
||||
icon_state = "d_analyzer_t"
|
||||
user << "You open the maintenance hatch of [src]."
|
||||
else
|
||||
opened = 0
|
||||
icon_state = "d_analyzer"
|
||||
user << "You close the maintenance hatch of [src]."
|
||||
return
|
||||
if (opened)
|
||||
return 1
|
||||
|
||||
if(exchange_parts(user, O))
|
||||
return 1
|
||||
|
||||
if (panel_open)
|
||||
if(istype(O, /obj/item/weapon/crowbar))
|
||||
playsound(src.loc, 'sound/items/Crowbar.ogg', 50, 1)
|
||||
var/obj/machinery/constructable_frame/machine_frame/M = new /obj/machinery/constructable_frame/machine_frame(src.loc)
|
||||
M.state = 2
|
||||
M.icon_state = "box_1"
|
||||
for(var/obj/I in component_parts)
|
||||
I.loc = src.loc
|
||||
del(src)
|
||||
default_deconstruction_crowbar(O)
|
||||
return 1
|
||||
else
|
||||
user << "\red You can't load the [src.name] while it's opened."
|
||||
|
||||
@@ -22,6 +22,7 @@ Note: Must be placed west/left of and R&D console to function.
|
||||
var/uranium_amount = 0.0
|
||||
var/diamond_amount = 0.0
|
||||
var/clown_amount = 0.0
|
||||
var/efficiency_coeff
|
||||
|
||||
|
||||
/obj/machinery/r_n_d/protolathe/New()
|
||||
@@ -50,33 +51,30 @@ Note: Must be placed west/left of and R&D console to function.
|
||||
for(var/obj/item/weapon/stock_parts/matter_bin/M in component_parts)
|
||||
T += M.rating
|
||||
max_material_storage = T * 75000
|
||||
T = 0
|
||||
for(var/obj/item/weapon/stock_parts/manipulator/M in component_parts)
|
||||
T += (M.rating/3)
|
||||
efficiency_coeff = max(T, 1)
|
||||
|
||||
/obj/machinery/r_n_d/protolathe/attackby(var/obj/item/O as obj, var/mob/user as mob)
|
||||
if(exchange_parts(user, O))
|
||||
return
|
||||
if (shocked)
|
||||
shock(user,50)
|
||||
shock(user,50)
|
||||
|
||||
if(exchange_parts(user, O))
|
||||
return 1
|
||||
|
||||
if (O.is_open_container())
|
||||
return
|
||||
return 1
|
||||
|
||||
if (istype(O, /obj/item/weapon/screwdriver))
|
||||
if (!opened)
|
||||
opened = 1
|
||||
if (default_deconstruction_screwdriver(user, "protolathe_t", "protolathe", O))
|
||||
if(linked_console)
|
||||
linked_console.linked_lathe = null
|
||||
linked_console.linked_imprinter = null
|
||||
linked_console = null
|
||||
icon_state = "protolathe_t"
|
||||
user << "You open the maintenance hatch of [src]."
|
||||
else
|
||||
opened = 0
|
||||
icon_state = "protolathe"
|
||||
user << "You close the maintenance hatch of [src]."
|
||||
return
|
||||
if (opened)
|
||||
return 1
|
||||
|
||||
if (panel_open)
|
||||
if(istype(O, /obj/item/weapon/crowbar))
|
||||
playsound(src.loc, 'sound/items/Crowbar.ogg', 50, 1)
|
||||
var/obj/machinery/constructable_frame/machine_frame/M = new /obj/machinery/constructable_frame/machine_frame(src.loc)
|
||||
M.state = 2
|
||||
M.icon_state = "box_1"
|
||||
for(var/obj/I in component_parts)
|
||||
if(istype(I, /obj/item/weapon/reagent_containers/glass/beaker))
|
||||
reagents.trans_to(I, reagents.total_volume)
|
||||
@@ -110,7 +108,7 @@ Note: Must be placed west/left of and R&D console to function.
|
||||
if(clown_amount >= 2000)
|
||||
var/obj/item/stack/sheet/mineral/clown/G = new /obj/item/stack/sheet/mineral/clown(src.loc)
|
||||
G.amount = round(clown_amount / G.perunit)
|
||||
del(src)
|
||||
default_deconstruction_crowbar(O)
|
||||
return 1
|
||||
else
|
||||
user << "\red You can't load the [src.name] while it's opened."
|
||||
|
||||
@@ -274,7 +274,7 @@ won't update every console in existence) but it's more of a hassle to do. Also,
|
||||
usr <<"\red The destructive analyzer appears to be empty."
|
||||
screen = 1.0
|
||||
return
|
||||
if(linked_destroy.loaded_item.reliability >= 90)
|
||||
if((linked_destroy.loaded_item.reliability >= 99 - (linked_destroy.decon_mod * 3)))
|
||||
var/list/temp_tech = linked_destroy.ConvertReqString2List(linked_destroy.loaded_item.origin_tech)
|
||||
for(var/T in temp_tech)
|
||||
files.UpdateTech(T, temp_tech[T])
|
||||
@@ -349,7 +349,7 @@ won't update every console in existence) but it's more of a hassle to do. Also,
|
||||
for(var/datum/design/D in files.known_designs)
|
||||
if(D.id == href_list["build"])
|
||||
being_built = D
|
||||
break
|
||||
break
|
||||
if(being_built)
|
||||
var/power = 2000
|
||||
for(var/M in being_built.materials)
|
||||
@@ -358,6 +358,7 @@ won't update every console in existence) but it's more of a hassle to do. Also,
|
||||
screen = 0.3
|
||||
linked_lathe.busy = 1
|
||||
flick("protolathe_n",linked_lathe)
|
||||
var/prot_efficiency = linked_lathe.efficiency_coeff
|
||||
var/key = usr.key //so we don't lose the info during the spawn delay
|
||||
spawn(16)
|
||||
use_power(power)
|
||||
@@ -365,25 +366,25 @@ won't update every console in existence) but it's more of a hassle to do. Also,
|
||||
for(var/M in being_built.materials)
|
||||
switch(M)
|
||||
if("$metal")
|
||||
linked_lathe.m_amount = max(0, (linked_lathe.m_amount-being_built.materials[M]))
|
||||
linked_lathe.m_amount = max(0, (linked_lathe.m_amount - (being_built.materials[M] / prot_efficiency)))
|
||||
if("$glass")
|
||||
linked_lathe.g_amount = max(0, (linked_lathe.g_amount-being_built.materials[M]))
|
||||
linked_lathe.g_amount = max(0, (linked_lathe.g_amount - (being_built.materials[M] / prot_efficiency)))
|
||||
if("$plasteel")
|
||||
linked_lathe.plasteel_amount = max(0, (linked_lathe.plasteel_amount-being_built.materials[M]))
|
||||
linked_lathe.plasteel_amount = max(0, (linked_lathe.plasteel_amount - (being_built.materials[M] / prot_efficiency)))
|
||||
if("$gold")
|
||||
linked_lathe.gold_amount = max(0, (linked_lathe.gold_amount-being_built.materials[M]))
|
||||
linked_lathe.gold_amount = max(0, (linked_lathe.gold_amount - (being_built.materials[M] / prot_efficiency)))
|
||||
if("$silver")
|
||||
linked_lathe.silver_amount = max(0, (linked_lathe.silver_amount-being_built.materials[M]))
|
||||
linked_lathe.silver_amount = max(0, (linked_lathe.silver_amount - (being_built.materials[M] / prot_efficiency)))
|
||||
if("$plasma")
|
||||
linked_lathe.plasma_amount = max(0, (linked_lathe.plasma_amount-being_built.materials[M]))
|
||||
linked_lathe.plasma_amount = max(0, (linked_lathe.plasma_amount - (being_built.materials[M] / prot_efficiency)))
|
||||
if("$uranium")
|
||||
linked_lathe.uranium_amount = max(0, (linked_lathe.uranium_amount-being_built.materials[M]))
|
||||
linked_lathe.uranium_amount = max(0, (linked_lathe.uranium_amount - (being_built.materials[M] / prot_efficiency)))
|
||||
if("$diamond")
|
||||
linked_lathe.diamond_amount = max(0, (linked_lathe.diamond_amount-being_built.materials[M]))
|
||||
linked_lathe.diamond_amount = max(0, (linked_lathe.diamond_amount - (being_built.materials[M] / prot_efficiency)))
|
||||
if("$clown")
|
||||
linked_lathe.clown_amount = max(0, (linked_lathe.clown_amount-being_built.materials[M]))
|
||||
linked_lathe.clown_amount = max(0, (linked_lathe.clown_amount - (being_built.materials[M] / prot_efficiency)))
|
||||
else
|
||||
linked_lathe.reagents.remove_reagent(M, being_built.materials[M])
|
||||
linked_lathe.reagents.remove_reagent(M, (being_built.materials[M] / prot_efficiency))
|
||||
|
||||
if(being_built.build_path)
|
||||
var/obj/new_item = new being_built.build_path(src)
|
||||
@@ -416,20 +417,21 @@ won't update every console in existence) but it's more of a hassle to do. Also,
|
||||
screen = 0.4
|
||||
linked_imprinter.busy = 1
|
||||
flick("circuit_imprinter_ani",linked_imprinter)
|
||||
var/imprinter_efficiency = linked_imprinter.efficiency_coeff
|
||||
spawn(16)
|
||||
use_power(power)
|
||||
for(var/M in being_built.materials)
|
||||
switch(M)
|
||||
if("$glass")
|
||||
linked_imprinter.g_amount = max(0, (linked_imprinter.g_amount-being_built.materials[M]))
|
||||
linked_imprinter.g_amount = max(0, linked_imprinter.g_amount - (being_built.materials[M] / imprinter_efficiency))
|
||||
if("$gold")
|
||||
linked_imprinter.gold_amount = max(0, (linked_imprinter.gold_amount-being_built.materials[M]))
|
||||
linked_imprinter.gold_amount = max(0, linked_imprinter.gold_amount - (being_built.materials[M] / imprinter_efficiency))
|
||||
if("$diamond")
|
||||
linked_imprinter.diamond_amount = max(0, (linked_imprinter.diamond_amount-being_built.materials[M]))
|
||||
linked_imprinter.diamond_amount = max(0, linked_imprinter.diamond_amount - (being_built.materials[M] / imprinter_efficiency))
|
||||
if("$uranium")
|
||||
linked_imprinter.uranium_amount = max(0, (linked_imprinter.uranium_amount-being_built.materials[M]))
|
||||
linked_imprinter.uranium_amount = max(0, linked_imprinter.uranium_amount - (being_built.materials[M] / imprinter_efficiency))
|
||||
else
|
||||
linked_imprinter.reagents.remove_reagent(M, being_built.materials[M])
|
||||
linked_imprinter.reagents.remove_reagent(M, being_built.materials[M] / imprinter_efficiency)
|
||||
var/obj/new_item = new being_built.build_path(src)
|
||||
new_item.reliability = being_built.reliability
|
||||
if(linked_imprinter.hacked) being_built.reliability = max((reliability / 2), 0)
|
||||
@@ -728,28 +730,30 @@ won't update every console in existence) but it's more of a hassle to do. Also,
|
||||
continue
|
||||
var/temp_dat = "[D.name]"
|
||||
var/check_materials = 1
|
||||
var/prot_efficiency = linked_lathe.efficiency_coeff
|
||||
for(var/M in D.materials)
|
||||
temp_dat += " [D.materials[M]] [CallMaterialName(M)]"
|
||||
var neededmaterials = (D.materials[M] / prot_efficiency)
|
||||
temp_dat += " [neededmaterials] [CallMaterialName(M)]"
|
||||
if(copytext(M, 1, 2) == "$")
|
||||
switch(M)
|
||||
if("$glass")
|
||||
if(D.materials[M] > linked_lathe.g_amount) check_materials = 0
|
||||
if((D.materials[M] / prot_efficiency) > linked_lathe.g_amount) check_materials = 0
|
||||
if("$metal")
|
||||
if(D.materials[M] > linked_lathe.m_amount) check_materials = 0
|
||||
if((D.materials[M] / prot_efficiency) > linked_lathe.m_amount) check_materials = 0
|
||||
if("$plasteel")
|
||||
if(D.materials[M] > linked_lathe.plasteel_amount) check_materials = 0
|
||||
if((D.materials[M] / prot_efficiency) > linked_lathe.plasteel_amount) check_materials = 0
|
||||
if("$gold")
|
||||
if(D.materials[M] > linked_lathe.gold_amount) check_materials = 0
|
||||
if((D.materials[M] / prot_efficiency) > linked_lathe.gold_amount) check_materials = 0
|
||||
if("$silver")
|
||||
if(D.materials[M] > linked_lathe.silver_amount) check_materials = 0
|
||||
if((D.materials[M] / prot_efficiency) > linked_lathe.silver_amount) check_materials = 0
|
||||
if("$plasma")
|
||||
if(D.materials[M] > linked_lathe.plasma_amount) check_materials = 0
|
||||
if((D.materials[M] / prot_efficiency) > linked_lathe.plasma_amount) check_materials = 0
|
||||
if("$uranium")
|
||||
if(D.materials[M] > linked_lathe.uranium_amount) check_materials = 0
|
||||
if((D.materials[M] / prot_efficiency) > linked_lathe.uranium_amount) check_materials = 0
|
||||
if("$diamond")
|
||||
if(D.materials[M] > linked_lathe.diamond_amount) check_materials = 0
|
||||
if((D.materials[M] / prot_efficiency) > linked_lathe.diamond_amount) check_materials = 0
|
||||
if("$clown")
|
||||
if(D.materials[M] > linked_lathe.clown_amount) check_materials = 0
|
||||
if((D.materials[M] / prot_efficiency) > linked_lathe.clown_amount) check_materials = 0
|
||||
else if (!linked_lathe.reagents.has_reagent(M, D.materials[M]))
|
||||
check_materials = 0
|
||||
if (check_materials)
|
||||
@@ -851,19 +855,21 @@ won't update every console in existence) but it's more of a hassle to do. Also,
|
||||
continue
|
||||
var/temp_dat = "[D.name]"
|
||||
var/check_materials = 1
|
||||
var/imp_efficiency = linked_imprinter.efficiency_coeff
|
||||
for(var/M in D.materials)
|
||||
temp_dat += " [D.materials[M]] [CallMaterialName(M)]"
|
||||
var/materialsneeded = (D.materials[M] / imp_efficiency)
|
||||
temp_dat += " [materialsneeded] [CallMaterialName(M)]"
|
||||
if(copytext(M, 1, 2) == "$")
|
||||
switch(M)
|
||||
if("$glass")
|
||||
if(D.materials[M] > linked_imprinter.g_amount) check_materials = 0
|
||||
if((D.materials[M] / imp_efficiency) > linked_imprinter.g_amount) check_materials = 0
|
||||
if("$gold")
|
||||
if(D.materials[M] > linked_imprinter.gold_amount) check_materials = 0
|
||||
if((D.materials[M] / imp_efficiency) > linked_imprinter.gold_amount) check_materials = 0
|
||||
if("$diamond")
|
||||
if(D.materials[M] > linked_imprinter.diamond_amount) check_materials = 0
|
||||
if((D.materials[M] / imp_efficiency) > linked_imprinter.diamond_amount) check_materials = 0
|
||||
if("$uranium")
|
||||
if(D.materials[M] > linked_imprinter.uranium_amount) check_materials = 0
|
||||
else if (!linked_imprinter.reagents.has_reagent(M, D.materials[M]))
|
||||
if((D.materials[M] / imp_efficiency) > linked_imprinter.uranium_amount) check_materials = 0
|
||||
else if (!linked_imprinter.reagents.has_reagent(M, (D.materials[M] / imp_efficiency)))
|
||||
check_materials = 0
|
||||
if (check_materials)
|
||||
dat += "* <A href='?src=\ref[src];imprint=[D.id]'>[temp_dat]</A><BR>"
|
||||
|
||||
@@ -19,8 +19,8 @@
|
||||
component_parts = list()
|
||||
component_parts += new /obj/item/weapon/circuitboard/rdserver(src)
|
||||
component_parts += new /obj/item/weapon/stock_parts/scanning_module(src)
|
||||
component_parts += new /obj/item/stack/cable_coil(src)
|
||||
component_parts += new /obj/item/stack/cable_coil(src)
|
||||
component_parts += new /obj/item/stack/cable_coil(src,1)
|
||||
component_parts += new /obj/item/stack/cable_coil(src,1)
|
||||
RefreshParts()
|
||||
src.initialize(); //Agouri
|
||||
|
||||
@@ -89,9 +89,7 @@
|
||||
griefProtection()
|
||||
..()
|
||||
|
||||
|
||||
|
||||
//Backup files to centcomm to help admins recover data after greifer attacks
|
||||
// Backup files to CentComm to help admins recover data after griefer attacks
|
||||
/obj/machinery/r_n_d/server/proc/griefProtection()
|
||||
for(var/obj/machinery/r_n_d/server/centcom/C in machines)
|
||||
for(var/datum/tech/T in files.known_tech)
|
||||
@@ -101,7 +99,7 @@
|
||||
C.files.RefreshResearch()
|
||||
|
||||
/obj/machinery/r_n_d/server/proc/produce_heat(heat_amt)
|
||||
if(!(stat & (NOPOWER|BROKEN))) //Blatently stolen from space heater.
|
||||
if(!(stat & (NOPOWER|BROKEN))) // Blatantly stolen from space heater.
|
||||
var/turf/simulated/L = loc
|
||||
if(istype(L))
|
||||
var/datum/gas_mixture/env = L.return_air()
|
||||
@@ -121,49 +119,35 @@
|
||||
env.merge(removed)
|
||||
|
||||
/obj/machinery/r_n_d/server/attackby(var/obj/item/O as obj, var/mob/user as mob)
|
||||
if(exchange_parts(user, O))
|
||||
return
|
||||
if (disabled)
|
||||
return
|
||||
|
||||
if (shocked)
|
||||
shock(user,50)
|
||||
if (istype(O, /obj/item/weapon/screwdriver))
|
||||
if (!opened)
|
||||
opened = 1
|
||||
icon_state = "server_o"
|
||||
user << "You open the maintenance hatch of [src]."
|
||||
else
|
||||
opened = 0
|
||||
icon_state = "server"
|
||||
user << "You close the maintenance hatch of [src]."
|
||||
return
|
||||
if (opened)
|
||||
|
||||
if(istype(O, /obj/item/weapon/screwdriver))
|
||||
default_deconstruction_screwdriver(user, "server_o", "server")
|
||||
return 1
|
||||
|
||||
if(exchange_parts(user, O))
|
||||
return 1
|
||||
|
||||
if (panel_open)
|
||||
if(istype(O, /obj/item/weapon/crowbar))
|
||||
griefProtection()
|
||||
playsound(src.loc, 'sound/items/Crowbar.ogg', 50, 1)
|
||||
var/obj/machinery/constructable_frame/machine_frame/M = new /obj/machinery/constructable_frame/machine_frame(src.loc)
|
||||
M.state = 2
|
||||
M.icon_state = "box_1"
|
||||
for(var/obj/I in component_parts)
|
||||
if(I.reliability != 100 && crit_fail)
|
||||
I.crit_fail = 1
|
||||
I.loc = src.loc
|
||||
del(src)
|
||||
default_deconstruction_crowbar(O)
|
||||
return 1
|
||||
|
||||
/obj/machinery/r_n_d/server/attack_hand(mob/user as mob)
|
||||
if (disabled)
|
||||
return
|
||||
|
||||
if (shocked)
|
||||
shock(user,50)
|
||||
|
||||
return
|
||||
|
||||
|
||||
|
||||
|
||||
/obj/machinery/r_n_d/server/centcom
|
||||
name = "Centcom Central R&D Database"
|
||||
name = "CentComm. Central R&D Database"
|
||||
server_id = -1
|
||||
|
||||
/obj/machinery/r_n_d/server/centcom/initialize()
|
||||
|
||||
Reference in New Issue
Block a user