mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-22 11:37:40 +01:00
Merge branch 'master' of git://github.com/Baystation12/Baystation12
This commit is contained in:
@@ -216,6 +216,9 @@
|
||||
images_added += t.obscured
|
||||
|
||||
for(var/mob/aiEye/eye in seenby)
|
||||
if(eye.ai.client)
|
||||
eye.ai.client.images -= images_removed
|
||||
eye.ai.client.images |= images_added
|
||||
if(eye.ai)
|
||||
if(eye.ai.client)
|
||||
eye.ai.client.images -= images_removed
|
||||
eye.ai.client.images |= images_added
|
||||
else
|
||||
seenby -= eye
|
||||
@@ -50,7 +50,7 @@ max volume of plasma storeable by the field = the total volume of a number of ti
|
||||
var/obj/machinery/rust/em_field/owned_field
|
||||
var/field_strength = 0.01
|
||||
//
|
||||
req_access = list(access_engine)
|
||||
req_access = list(ACCESS_ENGINE)
|
||||
//
|
||||
use_power = 1
|
||||
idle_power_usage = 10
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
var/targetting_field = 0
|
||||
layer = 4
|
||||
//
|
||||
req_access = list(access_engine)
|
||||
req_access = list(ACCESS_ENGINE)
|
||||
//
|
||||
use_power = 1
|
||||
idle_power_usage = 10
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
var/on = 1
|
||||
var/remoteenabled = 1
|
||||
//
|
||||
req_access = list(access_engine)
|
||||
req_access = list(ACCESS_ENGINE)
|
||||
//
|
||||
use_power = 1
|
||||
idle_power_usage = 10
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
New()
|
||||
..()
|
||||
spawn(1)
|
||||
sd_SetLuminosity(4)
|
||||
ul_SetLuminosity(4,6,0)
|
||||
|
||||
bullet_act(var/obj/item/projectile/Proj)
|
||||
if(Proj.flag != "bullet")
|
||||
|
||||
@@ -115,62 +115,7 @@
|
||||
else if (length(message) >= 2)
|
||||
var/channel_prefix = copytext(message, 1, 3)
|
||||
|
||||
var/list/keys = list(
|
||||
":r" = "right ear",
|
||||
":l" = "left ear",
|
||||
":i" = "intercom",
|
||||
":h" = "department",
|
||||
":c" = "Command",
|
||||
":n" = "Science",
|
||||
":m" = "Medical",
|
||||
":e" = "Engineering",
|
||||
":s" = "Security",
|
||||
":w" = "whisper",
|
||||
":b" = "binary",
|
||||
":a" = "alientalk",
|
||||
":t" = "Syndicate",
|
||||
":d" = "Mining",
|
||||
":q" = "Cargo",
|
||||
":g" = "changeling",
|
||||
|
||||
":R" = "right hand",
|
||||
":L" = "left hand",
|
||||
":I" = "intercom",
|
||||
":H" = "department",
|
||||
":C" = "Command",
|
||||
":N" = "Science",
|
||||
":M" = "Medical",
|
||||
":E" = "Engineering",
|
||||
":S" = "Security",
|
||||
":W" = "whisper",
|
||||
":B" = "binary",
|
||||
":A" = "alientalk",
|
||||
":T" = "Syndicate",
|
||||
":D" = "Mining",
|
||||
":Q" = "Cargo",
|
||||
":G" = "changeling",
|
||||
|
||||
//kinda localization -- rastaf0
|
||||
//same keys as above, but on russian keyboard layout. This file uses cp1251 as encoding.
|
||||
":ê" = "right hand",
|
||||
":ä" = "left hand",
|
||||
":ø" = "intercom",
|
||||
":ð" = "department",
|
||||
":ñ" = "Command",
|
||||
":ò" = "Science",
|
||||
":ü" = "Medical",
|
||||
":ó" = "Engineering",
|
||||
":û" = "Security",
|
||||
":ö" = "whisper",
|
||||
":è" = "binary",
|
||||
":ô" = "alientalk",
|
||||
":å" = "Syndicate",
|
||||
":â" = "Mining",
|
||||
":é" = "Cargo",
|
||||
":ï" = "changeling",
|
||||
)
|
||||
|
||||
message_mode = keys[channel_prefix]
|
||||
message_mode = department_radio_keys[channel_prefix]
|
||||
//world << "channel_prefix=[channel_prefix]; message_mode=[message_mode]"
|
||||
if (message_mode)
|
||||
message = trim(copytext(message, 3))
|
||||
|
||||
@@ -192,29 +192,29 @@
|
||||
// Gloves
|
||||
var/datum/organ/external/lo = organs["l_hand"]
|
||||
var/datum/organ/external/ro = organs["r_hand"]
|
||||
if (!lo.destroyed || !ro.destroyed)
|
||||
if (!(lo.status & DESTROYED && ro.status & DESTROYED))
|
||||
if (gloves)
|
||||
var/t1 = gloves.item_state
|
||||
if (!t1)
|
||||
t1 = gloves.icon_state
|
||||
var/icon/gloves_icon = new /icon("icon" = 'hands.dmi', "icon_state" = text("[][]", t1, (!( lying ) ? null : "2")))
|
||||
if(lo.destroyed)
|
||||
if(lo.status & DESTROYED)
|
||||
gloves_icon.Blend(new /icon('limb_mask.dmi', "right_[lying?"l":"s"]"), ICON_MULTIPLY)
|
||||
else if(ro.destroyed)
|
||||
else if(ro.status & DESTROYED)
|
||||
gloves_icon.Blend(new /icon('limb_mask.dmi', "left_[lying?"l":"s"]"), ICON_MULTIPLY)
|
||||
overlays += image(gloves_icon, "layer" = MOB_LAYER)
|
||||
if (gloves.blood_DNA)
|
||||
var/icon/stain_icon = icon('blood.dmi', "bloodyhands[!lying ? "" : "2"]")
|
||||
if(lo.destroyed)
|
||||
if(lo.status & DESTROYED)
|
||||
stain_icon.Blend(new /icon('limb_mask.dmi', "right_[lying?"l":"s"]"), ICON_MULTIPLY)
|
||||
else if(ro.destroyed)
|
||||
else if(ro.status & DESTROYED)
|
||||
stain_icon.Blend(new /icon('limb_mask.dmi', "left_[lying?"l":"s"]"), ICON_MULTIPLY)
|
||||
overlays += image("icon" = stain_icon, "layer" = MOB_LAYER)
|
||||
else if (blood_DNA)
|
||||
var/icon/stain_icon = icon('blood.dmi', "bloodyhands[!lying ? "" : "2"]")
|
||||
if(lo.destroyed)
|
||||
if(lo.status & DESTROYED)
|
||||
stain_icon.Blend(new /icon('limb_mask.dmi', "right_[lying?"l":"s"]"), ICON_MULTIPLY)
|
||||
else if(ro.destroyed)
|
||||
else if(ro.status & DESTROYED)
|
||||
stain_icon.Blend(new /icon('limb_mask.dmi', "left_[lying?"l":"s"]"), ICON_MULTIPLY)
|
||||
overlays += image("icon" = stain_icon, "layer" = MOB_LAYER)
|
||||
// Glasses
|
||||
@@ -231,19 +231,19 @@
|
||||
// Shoes
|
||||
lo = organs["l_foot"]
|
||||
ro = organs["r_foot"]
|
||||
if ((!lo.destroyed || !ro.destroyed) && shoes)
|
||||
if (!(lo.status & DESTROYED && ro.status & DESTROYED) && shoes)
|
||||
var/t1 = shoes.icon_state
|
||||
var/icon/shoes_icon = new /icon("icon" = 'feet.dmi', "icon_state" = text("[][]", t1, (!( lying ) ? null : "2")))
|
||||
if(lo.destroyed && !lying)
|
||||
if(lo.status & DESTROYED && !lying)
|
||||
shoes_icon.Blend(new /icon('limb_mask.dmi', "right[lying?"_l":""]"), ICON_MULTIPLY)
|
||||
else if(ro.destroyed && !lying)
|
||||
else if(ro.status & DESTROYED && !lying)
|
||||
shoes_icon.Blend(new /icon('limb_mask.dmi', "left[lying?"_l":""]"), ICON_MULTIPLY)
|
||||
overlays += image(shoes_icon, "layer" = MOB_LAYER)
|
||||
if (shoes.blood_DNA)
|
||||
var/icon/stain_icon = icon('blood.dmi', "shoesblood[!lying ? "" : "2"]")
|
||||
if(lo.destroyed)
|
||||
if(lo.status & DESTROYED)
|
||||
stain_icon.Blend(new /icon('limb_mask.dmi', "right_[lying?"l":"s"]"), ICON_MULTIPLY)
|
||||
else if(ro.destroyed)
|
||||
else if(ro.status & DESTROYED)
|
||||
stain_icon.Blend(new /icon('limb_mask.dmi', "left_[lying?"l":"s"]"), ICON_MULTIPLY)
|
||||
overlays += image("icon" = stain_icon, "layer" = MOB_LAYER) // Radio
|
||||
/* if (w_radio)
|
||||
@@ -355,7 +355,7 @@
|
||||
head.screen_loc = ui_head
|
||||
else
|
||||
var/datum/organ/external/head = organs["head"]
|
||||
if(!head.destroyed)
|
||||
if(!(head.status & DESTROYED))
|
||||
//if not wearing anything on the head, show the ears
|
||||
overlays += image("icon" = icon('tajaran.dmi', "ears_[gender==FEMALE ? "f" : "m"]_[lying ? "l" : "s"]"), "layer" = MOB_LAYER)
|
||||
|
||||
@@ -482,7 +482,7 @@
|
||||
lying_icon.Blend(new /icon('tajaran.dmi', "chest_[g]_l"), ICON_OVERLAY)
|
||||
|
||||
var/datum/organ/external/head = organs["head"]
|
||||
if(!head.destroyed)
|
||||
if(!(head.status & DESTROYED))
|
||||
stand_icon.Blend(new /icon('tajaran.dmi', "head_[g]_s"), ICON_OVERLAY)
|
||||
lying_icon.Blend(new /icon('tajaran.dmi', "head_[g]_l"), ICON_OVERLAY)
|
||||
|
||||
@@ -491,12 +491,12 @@
|
||||
if(!istype(part, /datum/organ/external/groin) \
|
||||
&& !istype(part, /datum/organ/external/chest) \
|
||||
&& !istype(part, /datum/organ/external/head) \
|
||||
&& !part.destroyed)
|
||||
&& !(part.status & DESTROYED))
|
||||
var/icon/temp = new /icon('tajaran.dmi', "[part.icon_name]_s")
|
||||
if(part.robot) temp.MapColors(rgb(77,77,77), rgb(150,150,150), rgb(28,28,28), rgb(0,0,0))
|
||||
if(part.status & ROBOT) temp.MapColors(rgb(77,77,77), rgb(150,150,150), rgb(28,28,28), rgb(0,0,0))
|
||||
stand_icon.Blend(temp, ICON_OVERLAY)
|
||||
temp = new /icon('tajaran.dmi', "[part.icon_name]_l")
|
||||
if(part.robot) temp.MapColors(rgb(77,77,77), rgb(150,150,150), rgb(28,28,28), rgb(0,0,0))
|
||||
if(part.status & ROBOT) temp.MapColors(rgb(77,77,77), rgb(150,150,150), rgb(28,28,28), rgb(0,0,0))
|
||||
lying_icon.Blend(temp , ICON_OVERLAY)
|
||||
|
||||
stand_icon.Blend(new /icon('tajaran.dmi', "groin_[g]_s"), ICON_OVERLAY)
|
||||
@@ -511,7 +511,7 @@
|
||||
if(!istype(part, /datum/organ/external/groin) \
|
||||
&& !istype(part, /datum/organ/external/chest) \
|
||||
&& !istype(part, /datum/organ/external/head) \
|
||||
&& part.destroyed)
|
||||
&& (part.status & DESTROYED))
|
||||
husk_s.Blend(new /icon('dam_mask.dmi', "[part.icon_name]"), ICON_SUBTRACT)
|
||||
husk_l.Blend(new /icon('dam_mask.dmi', "[part.icon_name]2"), ICON_SUBTRACT)
|
||||
|
||||
@@ -539,7 +539,7 @@
|
||||
if(organs)
|
||||
var/datum/organ/external/head = organs["head"]
|
||||
if(head)
|
||||
if(head.destroyed)
|
||||
if(head.status & DESTROYED)
|
||||
del(face_standing)
|
||||
del(face_lying)
|
||||
return
|
||||
|
||||
@@ -5,6 +5,9 @@
|
||||
if (!message)
|
||||
return
|
||||
|
||||
if (silent)
|
||||
return
|
||||
|
||||
log_whisper("[src.name]/[src.key] : [message]")
|
||||
|
||||
if (src.client && (src.client.muted || src.client.muted_complete))
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
|
||||
//---------- actual energy field
|
||||
|
||||
/obj/effect/energy_field
|
||||
name = "energy field"
|
||||
desc = "Impenetrable field of energy, capable of blocking anything as long as it's active."
|
||||
icon = 'shielding.dmi'
|
||||
icon_state = "shieldsparkles"
|
||||
anchored = 1
|
||||
layer = 2.1
|
||||
density = 0
|
||||
invisibility = 2
|
||||
var/strength = 0
|
||||
var/obj/machinery/shield_gen/parent
|
||||
var/stress = 0
|
||||
|
||||
/obj/effect/energy_field/ex_act(var/severity)
|
||||
Stress(2)
|
||||
//nothing
|
||||
|
||||
/obj/effect/energy_field/meteorhit(obj/effect/meteor/M as obj)
|
||||
if(M)
|
||||
walk(M,0)
|
||||
|
||||
/obj/effect/energy_field/proc/Stress(var/severity)
|
||||
strength -= severity
|
||||
stress += severity
|
||||
|
||||
//if we take too much damage, drop out - the generator will bring us back up if we have enough power
|
||||
if(strength < 1)
|
||||
invisibility = 2
|
||||
density = 0
|
||||
|
||||
/obj/effect/energy_field/CanPass(atom/movable/mover, turf/target, height=1.5, air_group = 0)
|
||||
//Purpose: Determines if the object (or airflow) can pass this atom.
|
||||
//Called by: Movement, airflow.
|
||||
//Inputs: The moving atom (optional), target turf, "height" and air group
|
||||
//Outputs: Boolean if can pass.
|
||||
|
||||
//return (!density || !height || air_group)
|
||||
return 0
|
||||
@@ -0,0 +1,64 @@
|
||||
|
||||
//---------- external shield generator
|
||||
//generates an energy field that loops around any built up area in space (is useless inside) halts movement and airflow, is blocked by walls, windows, airlocks etc
|
||||
|
||||
/obj/machinery/shield_gen/external/New()
|
||||
..()
|
||||
|
||||
/obj/machinery/shield_gen/external/get_shielded_turfs()
|
||||
var
|
||||
list
|
||||
open = list(get_turf(src))
|
||||
closed = list()
|
||||
|
||||
while(open.len)
|
||||
for(var/turf/T in open)
|
||||
for(var/turf/O in orange(1, T))
|
||||
if(get_dist(O,src) > field_radius)
|
||||
continue
|
||||
var/add_this_turf = 0
|
||||
if(istype(O,/turf/space))
|
||||
for(var/turf/simulated/G in orange(1, O))
|
||||
add_this_turf = 1
|
||||
break
|
||||
for(var/obj/structure/S in orange(1, O))
|
||||
add_this_turf = 1
|
||||
break
|
||||
for(var/obj/structure/S in O)
|
||||
add_this_turf = 0
|
||||
break
|
||||
|
||||
if(add_this_turf && !(O in open) && !(O in closed))
|
||||
open += O
|
||||
open -= T
|
||||
closed += T
|
||||
|
||||
return closed
|
||||
|
||||
/obj/machinery/shield_gen/external/process()
|
||||
/*if(stat & (NOPOWER|BROKEN))
|
||||
return*/
|
||||
if(!active)
|
||||
return
|
||||
/*spawn(100)
|
||||
power()*/
|
||||
/*if(src.active >= 1)
|
||||
if(src.power == 0)
|
||||
src.visible_message("\red The [src.name] shuts down due to lack of power!", \
|
||||
"You hear heavy droning fade out")
|
||||
icon_state = "generator0"
|
||||
src.active = 0*/
|
||||
..()
|
||||
|
||||
/obj/item/weapon/circuitboard/shield_gen/external
|
||||
name = "Circuit Board (External Shield Generator)"
|
||||
build_path = "/obj/machinery/shield_gen/external"
|
||||
board_type = "machine"
|
||||
origin_tech = "electromagnetic=3;engineering=2;power=1"
|
||||
frame_desc = "Requires, 2 Cable Coil, 2 Nano Manipulator, 1 Advanced Matter Bin, 1 Console Screen and 1 High-Power Micro-Laser. "
|
||||
req_components = list(
|
||||
"/obj/item/weapon/cable_coil" = 2,
|
||||
"/obj/item/weapon/stock_parts/manipulator/nano" = 2,
|
||||
"/obj/item/weapon/stock_parts/matter_bin/adv" = 1,
|
||||
"/obj/item/weapon/stock_parts/console_screen" = 1,
|
||||
"/obj/item/weapon/stock_parts/micro_laser/high" = 1)
|
||||
@@ -1,226 +0,0 @@
|
||||
//links to a power monitor computer and transmits the amount of energy in the associated powercable network
|
||||
//uses the navbeacon sprite and transmits data via magic for now
|
||||
|
||||
/obj/machinery/powermonitor
|
||||
|
||||
icon = 'objects.dmi'
|
||||
icon_state = "navbeacon0-f"
|
||||
name = "power monitor"
|
||||
desc = "A monitoring device used to track power in a cable network."
|
||||
level = 1 // underfloor
|
||||
layer = 2.5
|
||||
anchored = 1
|
||||
|
||||
var/freq = 1427 // radio frequency
|
||||
var/powernet_tag = "" //the text tag associated with this power monitor's network
|
||||
var/open = 0 // true if cover is open
|
||||
var/locked = 1 // true if controls are locked
|
||||
var/list/codes // assoc. list of transponder codes
|
||||
var/codes_txt = "" // codes as set on map: "tag1;tag2" or "tag1=value;tag2=value"
|
||||
|
||||
req_access = list(access_engine)
|
||||
|
||||
New()
|
||||
..()
|
||||
var/turf/T = loc
|
||||
hide(T.intact)
|
||||
|
||||
set_codes()
|
||||
|
||||
spawn(5) // must wait for map loading to finish
|
||||
if(radio_controller)
|
||||
radio_controller.add_object(src, freq, RADIO_POWER)
|
||||
|
||||
// set the transponder codes assoc list from codes_txt
|
||||
proc/set_codes()
|
||||
if(!codes_txt)
|
||||
return
|
||||
|
||||
codes = new()
|
||||
|
||||
var/list/entries = dd_text2List(codes_txt, ";") // entries are separated by semicolons
|
||||
|
||||
for(var/e in entries)
|
||||
var/index = findtext(e, "=") // format is "key=value"
|
||||
if(index)
|
||||
var/key = copytext(e, 1, index)
|
||||
var/val = copytext(e, index+1)
|
||||
codes[key] = val
|
||||
else
|
||||
codes[e] = "1"
|
||||
|
||||
// called when turf state changes
|
||||
// hide the object if turf is intact
|
||||
hide(var/intact)
|
||||
invisibility = intact ? 101 : 0
|
||||
updateicon()
|
||||
|
||||
// update the icon_state
|
||||
proc/updateicon()
|
||||
var/state="navbeacon[open]"
|
||||
if(invisibility)
|
||||
icon_state = "[state]-f" // if invisible, set icon to faded version
|
||||
// in case revealed by T-scanner
|
||||
else
|
||||
icon_state = "[state]"
|
||||
|
||||
// look for a signal of the form "getpowerlevel"
|
||||
// where X is any
|
||||
// or the location
|
||||
// or one of the set transponder keys
|
||||
// if found, return a signal
|
||||
receive_signal(datum/signal/signal)
|
||||
|
||||
var/request = signal.data["getpowermonitor"]
|
||||
if(request && (request == "any" || request == powernet_tag) )
|
||||
spawn(1)
|
||||
post_signal()
|
||||
|
||||
// return a signal giving the power network energy level
|
||||
proc/post_signal()
|
||||
|
||||
var/datum/radio_frequency/frequency = radio_controller.return_frequency(freq)
|
||||
|
||||
if(!frequency) return
|
||||
|
||||
var/datum/signal/signal = new()
|
||||
signal.source = src
|
||||
signal.transmission_method = 1
|
||||
signal.data["powerlevel"] = 1 //TODO
|
||||
|
||||
for(var/key in codes)
|
||||
signal.data[key] = codes[key]
|
||||
|
||||
frequency.post_signal(src, signal, filter = RADIO_POWER)
|
||||
|
||||
attackby(var/obj/item/I, var/mob/user)
|
||||
var/turf/T = loc
|
||||
if(T.intact)
|
||||
return // prevent intraction when T-scanner revealed
|
||||
|
||||
if(istype(I, /obj/item/weapon/screwdriver))
|
||||
open = !open
|
||||
|
||||
user.visible_message("[user] [open ? "opens" : "closes"] the beacon's cover.", "You [open ? "open" : "close"] the beacon's cover.")
|
||||
|
||||
updateicon()
|
||||
|
||||
else if (istype(I, /obj/item/weapon/card/id)||istype(I, /obj/item/device/pda))
|
||||
if(open)
|
||||
if (src.allowed(user))
|
||||
src.locked = !src.locked
|
||||
user << "Controls are now [src.locked ? "locked." : "unlocked."]"
|
||||
else
|
||||
user << "\red Access denied."
|
||||
updateDialog()
|
||||
else
|
||||
user << "You must open the cover first!"
|
||||
return
|
||||
|
||||
attack_ai(var/mob/user)
|
||||
interact(user, 1)
|
||||
|
||||
attack_paw()
|
||||
return
|
||||
|
||||
attack_hand(var/mob/user)
|
||||
interact(user, 0)
|
||||
|
||||
proc/interact(var/mob/user, var/ai = 0)
|
||||
var/turf/T = loc
|
||||
if(T.intact)
|
||||
return // prevent intraction when T-scanner revealed
|
||||
|
||||
if(!open && !ai) // can't alter controls if not open, unless you're an AI
|
||||
user << "The monitor's control cover is closed."
|
||||
return
|
||||
|
||||
var/dat = "<TT><B>Navigation Beacon</B><HR>"
|
||||
if(locked && !ai)
|
||||
dat += "<i>(swipe card to unlock controls)</i><BR>"
|
||||
else if(!ai)
|
||||
dat += "<i>(swipe card to lock controls)</i><BR>"
|
||||
|
||||
dat += "Frequency: "
|
||||
if(!locked)
|
||||
dat += "<A href='byond://?src=\ref[src];freq=-10'>-</A>"
|
||||
dat += "<A href='byond://?src=\ref[src];freq=-2'>-</A>"
|
||||
dat += "[format_frequency(freq)]"
|
||||
if(!locked)
|
||||
dat += "<A href='byond://?src=\ref[src];freq=2'>+</A>"
|
||||
dat += "<A href='byond://?src=\ref[src];freq=10'>+</A>"
|
||||
dat += "<hr>"
|
||||
|
||||
dat += "Power network tag: [powernet_tag ? powernet_tag : "(none)"]</A><BR>"
|
||||
dat += "Transponder Codes:<UL>"
|
||||
for(var/key in codes)
|
||||
dat += "<LI>[key] ... [codes[key]]"
|
||||
if(!locked)
|
||||
dat += " <small><A href='byond://?src=\ref[src];edit=1;code=[key]'>(edit)</A>"
|
||||
dat += " <A href='byond://?src=\ref[src];delete=1;code=[key]'>(delete)</A></small><BR>"
|
||||
if(!locked)
|
||||
dat += "<small><A href='byond://?src=\ref[src];add=1;'>(add new)</A></small><BR>"
|
||||
dat += "<UL></TT>"
|
||||
|
||||
user << browse(dat, "window=powermonitor")
|
||||
onclose(user, "powermonitor")
|
||||
return
|
||||
|
||||
Topic(href, href_list)
|
||||
..()
|
||||
if (usr.stat)
|
||||
return
|
||||
if ((in_range(src, usr) && istype(src.loc, /turf)) || (istype(usr, /mob/living/silicon)))
|
||||
if(open && !locked)
|
||||
usr.machine = src
|
||||
|
||||
if (href_list["freq"])
|
||||
freq = sanitize_frequency(freq + text2num(href_list["freq"]))
|
||||
updateDialog()
|
||||
|
||||
else if(href_list["modifytag"])
|
||||
var/newtag = input("Enter new power network tag", "Power Monitor", powernet_tag) as text|null
|
||||
if(newtag)
|
||||
powernet_tag = newtag
|
||||
updateDialog()
|
||||
|
||||
else if(href_list["edit"])
|
||||
var/codekey = href_list["code"]
|
||||
|
||||
var/newkey = input("Enter Transponder Code Key", "Power Monitor", codekey) as text|null
|
||||
if(!newkey)
|
||||
return
|
||||
|
||||
var/codeval = codes[codekey]
|
||||
var/newval = input("Enter Transponder Code Value", "Power Monitor", codeval) as text|null
|
||||
if(!newval)
|
||||
newval = codekey
|
||||
return
|
||||
|
||||
codes.Remove(codekey)
|
||||
codes[newkey] = newval
|
||||
|
||||
updateDialog()
|
||||
|
||||
else if(href_list["delete"])
|
||||
var/codekey = href_list["code"]
|
||||
codes.Remove(codekey)
|
||||
updateDialog()
|
||||
|
||||
else if(href_list["add"])
|
||||
|
||||
var/newkey = input("Enter New Transponder Code Key", "Power Monitor") as text|null
|
||||
if(!newkey)
|
||||
return
|
||||
|
||||
var/newval = input("Enter New Transponder Code Value", "Power Monitor") as text|null
|
||||
if(!newval)
|
||||
newval = "1"
|
||||
return
|
||||
|
||||
if(!codes)
|
||||
codes = new()
|
||||
|
||||
codes[newkey] = newval
|
||||
|
||||
updateDialog()
|
||||
@@ -0,0 +1,263 @@
|
||||
|
||||
//sculpture
|
||||
//SCP-173, nothing more need be said
|
||||
/mob/living/simple_animal/sculpture
|
||||
name = "\improper sculpture"
|
||||
real_name = "sculpture"
|
||||
desc = "It's some kind of human sized, doll-like sculpture, with weird discolourations on some parts of it. It appears to be quite solid. "
|
||||
icon = 'unknown.dmi'
|
||||
icon_state = "sculpture"
|
||||
icon_living = "sculpture"
|
||||
icon_dead = "sculpture"
|
||||
emote_hear = list("makes a faint scraping sound")
|
||||
emote_see = list("twitches slightly", "shivers")
|
||||
response_help = "touches the"
|
||||
response_disarm = "pushes the"
|
||||
response_harm = "hits the"
|
||||
var/obj/item/weapon/grab/G
|
||||
var/observed = 0
|
||||
var/allow_escape = 0 //set this to 1 for src to drop it's target next Life() call and try to escape
|
||||
var/hibernate = 0
|
||||
var/random_escape_chance = 0.5
|
||||
|
||||
/mob/living/simple_animal/sculpture/proc/GrabMob(var/mob/living/target)
|
||||
if(target && target != src && ishuman(target))
|
||||
G = new /obj/item/weapon/grab(target)
|
||||
G.assailant = src
|
||||
G.layer = 20
|
||||
G.affecting = target
|
||||
target.grabbed_by += G
|
||||
G.synch()
|
||||
target.LAssailant = src
|
||||
|
||||
playsound(loc, 'thudswoosh.ogg', 50, 1, -1)
|
||||
visible_message("\red [src] has grabbed [target]!")
|
||||
target << "\red <b>You feel something suddenly grab you around the neck from behind!</b> Everything goes black..."
|
||||
|
||||
G.state = 3
|
||||
G.killing = 1
|
||||
|
||||
desc = "It's some kind of human sized, doll-like sculpture, with weird discolourations on some parts of it. It appears to be quite solid. [G ? "\red The sculpture is holding [G.affecting] in a vice-like grip." : ""]"
|
||||
target.attack_log += text("\[[time_stamp()]\] <font color='orange'>Has been grabbed by SCP-173, and is being strangled!</font>")
|
||||
log_admin("[target] ([target.ckey]) has been grabbed and is being strangled by SCP-173.")
|
||||
message_admins("Alert: [target.real_name] has been grabbed and is being strangled by SCP-173. Set var/allow_escape = 1 to allow this player to escape temporarily, or var/hibernate = 1 to disable it entirely.")
|
||||
|
||||
/mob/living/simple_animal/sculpture/proc/Escape()
|
||||
var/list/turfs = new/list()
|
||||
for(var/turf/thisturf in view(50,src))
|
||||
if(istype(thisturf, /turf/space))
|
||||
continue
|
||||
else if(istype(thisturf, /turf/simulated/wall))
|
||||
continue
|
||||
else if(istype(thisturf, /turf/simulated/mineral))
|
||||
continue
|
||||
else if(istype(thisturf, /turf/simulated/shuttle/wall))
|
||||
continue
|
||||
else if(istype(thisturf, /turf/unsimulated/wall))
|
||||
continue
|
||||
turfs += thisturf
|
||||
var/turf/target_turf = pick(turfs)
|
||||
src.dir = get_dir(src, target_turf)
|
||||
src.loc = target_turf
|
||||
|
||||
hibernate = 1
|
||||
spawn(rand(20,35) * 10)
|
||||
hibernate = 0
|
||||
|
||||
/mob/living/simple_animal/sculpture/Life()
|
||||
|
||||
observed = 0
|
||||
|
||||
//update the desc
|
||||
if(!G)
|
||||
desc = "It's some kind of human sized, doll-like sculpture, with weird discolourations on some parts of it. It appears to be quite solid."
|
||||
|
||||
//if we are sent into forced hibernation mode, allow our victim to escape
|
||||
if(hibernate && G && G.killing == 1)
|
||||
if(G)
|
||||
G.affecting << "\red You suddenly feel the grip around your neck being loosened!"
|
||||
visible_message("\red [src] suddenly loosens it's grip!")
|
||||
G.killing = 0
|
||||
G.state = 1
|
||||
return
|
||||
|
||||
//
|
||||
if(allow_escape)
|
||||
allow_escape = 0
|
||||
if(G)
|
||||
G.affecting << "\red You suddenly feel the grip around your neck being loosened!"
|
||||
visible_message("\red [src] suddenly loosens it's grip!")
|
||||
G.killing = 0
|
||||
G.state = 1
|
||||
if(!observed)
|
||||
Escape()
|
||||
observed = 1
|
||||
|
||||
//can't do anything in space at all
|
||||
if(istype(get_turf(src), /turf/space) || hibernate)
|
||||
return
|
||||
|
||||
for(var/mob/living/M in view(7, src))
|
||||
if(M.stat || M == src)
|
||||
continue
|
||||
var/xdif = M.x - src.x
|
||||
var/ydif = M.y - src.y
|
||||
if(abs(xdif) < abs(ydif))
|
||||
//mob is either above or below src
|
||||
if(ydif < 0 && M.dir == NORTH)
|
||||
//mob is below src and looking up
|
||||
observed = 1
|
||||
break
|
||||
else if(ydif > 0 && M.dir == SOUTH)
|
||||
//mob is above src and looking down
|
||||
observed = 1
|
||||
break
|
||||
else if(abs(xdif) > abs(ydif))
|
||||
//mob is either left or right of src
|
||||
if(xdif < 0 && M.dir == EAST)
|
||||
//mob is to the left of src and looking right
|
||||
observed = 1
|
||||
break
|
||||
else if(xdif > 0 && M.dir == WEST)
|
||||
//mob is to the right of src and looking left
|
||||
observed = 1
|
||||
break
|
||||
else if (xdif == 0 && ydif == 0)
|
||||
//mob is on the same tile as src
|
||||
observed = 1
|
||||
break
|
||||
|
||||
//account for darkness
|
||||
var/turf/T = get_turf(src)
|
||||
var/in_darkness = 0
|
||||
if(max(T.ul_GetRed(), T.ul_GetGreen(), T.ul_GetBlue()) == 0 && !istype(T, /turf/simulated))
|
||||
in_darkness = 1
|
||||
|
||||
//see if we're able to do stuff
|
||||
if(!observed || in_darkness)
|
||||
if(G)
|
||||
if(prob(random_escape_chance))
|
||||
//chance to allow the stranglee to escape
|
||||
allow_escape = 1
|
||||
if(G.affecting.stat == 2)
|
||||
del G
|
||||
else if(!G)
|
||||
//see if we're able to strangle anyone
|
||||
var/turf/myTurf = get_turf(src)
|
||||
for(var/mob/living/M in myTurf)
|
||||
GrabMob(M)
|
||||
if(G)
|
||||
break
|
||||
|
||||
//find out what mobs we can see
|
||||
var/list/incapacitated = list()
|
||||
var/list/conscious = list()
|
||||
for(var/mob/living/carbon/M in view(7, src))
|
||||
//this may not be quite the right test
|
||||
if(M == src)
|
||||
continue
|
||||
if(M.stat == 1)
|
||||
incapacitated.Add(M)
|
||||
else if(!M.stat)
|
||||
conscious.Add(M)
|
||||
|
||||
//pick the nearest valid conscious target
|
||||
var/mob/living/carbon/target_mob
|
||||
for(var/mob/living/carbon/M in conscious)
|
||||
if(!target_mob || get_dist(src, M) < get_dist(src, target_mob))
|
||||
target_mob = M
|
||||
|
||||
if(!target_mob)
|
||||
//get an unconscious mob
|
||||
for(var/mob/living/carbon/M in incapacitated)
|
||||
if(!target_mob || get_dist(src, M) < get_dist(src, target_mob))
|
||||
target_mob = M
|
||||
if(target_mob)
|
||||
var/turf/target_turf
|
||||
if(in_darkness)
|
||||
//move to right behind them
|
||||
target_turf = get_step(target_mob, src)
|
||||
else
|
||||
//move to them really really fast and knock them down
|
||||
target_turf = get_turf(target_mob)
|
||||
|
||||
//rampage along a path to get to them, in the blink of an eye
|
||||
var/turf/next_turf = get_step_towards(src, target_mob)
|
||||
var/num_turfs = get_dist(src,target_mob)
|
||||
while(get_turf(src) != target_turf && num_turfs > 0)
|
||||
for(var/obj/structure/window/W in next_turf)
|
||||
W.ex_act(2)
|
||||
for(var/obj/structure/table/O in next_turf)
|
||||
O.ex_act(1)
|
||||
for(var/obj/structure/grille/G in next_turf)
|
||||
G.ex_act(1)
|
||||
if(!next_turf.CanPass(src, next_turf))
|
||||
break
|
||||
src.loc = next_turf
|
||||
src.dir = get_dir(src, target_mob)
|
||||
next_turf = get_step(src, get_dir(next_turf,target_mob))
|
||||
num_turfs--
|
||||
|
||||
//if we reached them, knock them down and start strangling them
|
||||
if(get_turf(src) == target_turf)
|
||||
target_mob.Stun(1)
|
||||
target_mob.Paralyse(1)
|
||||
GrabMob(target_mob)
|
||||
|
||||
//if we're not strangling anyone, take a stroll
|
||||
if(!G && prob(10))
|
||||
var/list/turfs = new/list()
|
||||
for(var/turf/thisturf in view(7,src))
|
||||
if(istype(thisturf, /turf/space))
|
||||
continue
|
||||
else if(istype(thisturf, /turf/simulated/wall))
|
||||
continue
|
||||
else if(istype(thisturf, /turf/simulated/mineral))
|
||||
continue
|
||||
else if(istype(thisturf, /turf/simulated/shuttle/wall))
|
||||
continue
|
||||
else if(istype(thisturf, /turf/unsimulated/wall))
|
||||
continue
|
||||
turfs += thisturf
|
||||
var/turf/target_turf = pick(turfs)
|
||||
|
||||
//rampage along a path to get to it, in the blink of an eye
|
||||
var/turf/next_turf = get_step_towards(src, target_turf)
|
||||
var/num_turfs = get_dist(src,target_turf)
|
||||
while(get_turf(src) != target_turf && num_turfs > 0)
|
||||
for(var/obj/structure/window/W in next_turf)
|
||||
W.ex_act(2)
|
||||
for(var/obj/structure/table/O in next_turf)
|
||||
O.ex_act(1)
|
||||
for(var/obj/structure/grille/G in next_turf)
|
||||
G.ex_act(1)
|
||||
if(!next_turf.CanPass(src, next_turf))
|
||||
break
|
||||
src.loc = next_turf
|
||||
src.dir = get_dir(src, target_mob)
|
||||
next_turf = get_step(src, get_dir(next_turf,target_turf))
|
||||
num_turfs--
|
||||
else if(G)
|
||||
//we can't move while observed, so we can't effectively strangle any more
|
||||
//our grip is still rock solid, but the victim has a chance to escape
|
||||
G.affecting << "\red You suddenly feel the grip around your neck being loosened!"
|
||||
visible_message("\red [src] suddenly loosens it's grip!")
|
||||
G.state = 1
|
||||
G.killing = 0
|
||||
|
||||
/mob/living/simple_animal/sculpture/attackby(var/obj/item/O as obj, var/mob/user as mob)
|
||||
..()
|
||||
|
||||
/mob/living/simple_animal/sculpture/Topic(href, href_list)
|
||||
..()
|
||||
|
||||
/mob/living/simple_animal/sculpture/Bump(atom/movable/AM as mob, yes)
|
||||
if(!G)
|
||||
GrabMob(AM)
|
||||
|
||||
/mob/living/simple_animal/sculpture/Bumped(atom/movable/AM as mob, yes)
|
||||
if(!G)
|
||||
GrabMob(AM)
|
||||
|
||||
/mob/living/simple_animal/sculpture/ex_act(var/severity)
|
||||
//nothing
|
||||
@@ -0,0 +1,156 @@
|
||||
|
||||
//---------- shield capacitor
|
||||
//pulls energy out of a power net and charges an adjacent generator
|
||||
|
||||
/obj/machinery/shield_capacitor
|
||||
name = "shield capacitor"
|
||||
desc = "Machine that charges a shield generator."
|
||||
icon = 'shielding.dmi'
|
||||
icon_state = "capacitor"
|
||||
var/active = 1
|
||||
density = 1
|
||||
anchored = 1
|
||||
var/obj/machinery/shield_gen/target_generator
|
||||
var/stored_charge = 0
|
||||
var/time_since_fail = 100
|
||||
var/max_charge = 1000000
|
||||
var/max_charge_rate = 100000
|
||||
var/min_charge_rate = 0
|
||||
var/locked = 0
|
||||
//
|
||||
use_power = 1 //0 use nothing
|
||||
//1 use idle power
|
||||
//2 use active power
|
||||
idle_power_usage = 10
|
||||
active_power_usage = 100
|
||||
var/charge_rate = 100
|
||||
|
||||
/obj/machinery/shield_capacitor/New()
|
||||
..()
|
||||
target_generator = locate() in get_step(src,dir)
|
||||
if(target_generator && !target_generator.owned_capacitor)
|
||||
target_generator.owned_capacitor = src
|
||||
/*spawn(10)
|
||||
check_powered()*/
|
||||
|
||||
/obj/machinery/shield_capacitor/power_change()
|
||||
if(stat & BROKEN)
|
||||
icon_state = "broke"
|
||||
else
|
||||
if( powered() )
|
||||
if (src.active)
|
||||
icon_state = "capacitor"
|
||||
else
|
||||
icon_state = "capacitor"
|
||||
stat &= ~NOPOWER
|
||||
else
|
||||
spawn(rand(0, 15))
|
||||
src.icon_state = "capacitor"
|
||||
stat |= NOPOWER
|
||||
|
||||
/obj/machinery/shield_capacitor/process()
|
||||
//
|
||||
if(active)
|
||||
use_power = 2
|
||||
if(stored_charge + charge_rate > max_charge)
|
||||
active_power_usage = max_charge - stored_charge
|
||||
else
|
||||
active_power_usage = charge_rate
|
||||
stored_charge += active_power_usage
|
||||
else
|
||||
use_power = 1
|
||||
|
||||
time_since_fail++
|
||||
if(stored_charge < active_power_usage * 1.5)
|
||||
time_since_fail = 0
|
||||
//
|
||||
updateDialog()
|
||||
|
||||
/obj/machinery/shield_capacitor/attackby(obj/item/W, mob/user)
|
||||
/*if(istype(W, /obj/item/weapon/wrench))
|
||||
if(active)
|
||||
user << "Turn off the field generator first."
|
||||
return
|
||||
|
||||
else if(state == 0)
|
||||
state = 1
|
||||
playsound(src.loc, 'Ratchet.ogg', 75, 1)
|
||||
user << "You secure the external reinforcing bolts to the floor."
|
||||
src.anchored = 1
|
||||
return
|
||||
|
||||
else if(state == 1)
|
||||
state = 0
|
||||
playsound(src.loc, 'Ratchet.ogg', 75, 1)
|
||||
user << "You undo the external reinforcing bolts."
|
||||
src.anchored = 0
|
||||
return*/
|
||||
|
||||
if(istype(W, /obj/item/weapon/card/id)||istype(W, /obj/item/device/pda))
|
||||
if (src.allowed(user))
|
||||
src.locked = !src.locked
|
||||
user << "Controls are now [src.locked ? "locked." : "unlocked."]"
|
||||
else
|
||||
user << "\red Access denied."
|
||||
|
||||
else
|
||||
src.add_fingerprint(user)
|
||||
user << "\red You hit the [src.name] with your [W.name]!"
|
||||
for(var/mob/M in viewers(src))
|
||||
if(M == user) continue
|
||||
M.show_message("\red The [src.name] has been hit with the [W.name] by [user.name]!")
|
||||
|
||||
/obj/machinery/shield_capacitor/attack_hand(mob/user as mob)
|
||||
interact(user)
|
||||
src.add_fingerprint(user)
|
||||
|
||||
/obj/machinery/shield_capacitor/Topic(href, href_list[])
|
||||
..()
|
||||
if( href_list["close"] )
|
||||
usr << browse(null, "window=shield_capacitor")
|
||||
usr.machine = null
|
||||
return
|
||||
if( href_list["toggle"] )
|
||||
active = !active
|
||||
if(active)
|
||||
use_power = 2
|
||||
else
|
||||
use_power = 1
|
||||
if( href_list["charge_rate"] )
|
||||
charge_rate += text2num(href_list["charge_rate"])
|
||||
if(charge_rate > max_charge_rate)
|
||||
charge_rate = max_charge_rate
|
||||
else if(charge_rate < min_charge_rate)
|
||||
charge_rate = min_charge_rate
|
||||
//
|
||||
updateDialog()
|
||||
|
||||
/obj/machinery/shield_capacitor/proc/interact(mob/user)
|
||||
if ( (get_dist(src, user) > 1 ) || (stat & (BROKEN|NOPOWER)) )
|
||||
if (!istype(user, /mob/living/silicon))
|
||||
user.machine = null
|
||||
user << browse(null, "window=shield_capacitor")
|
||||
return
|
||||
var/t = "<B>Shield Capacitor Control Console</B><BR>"
|
||||
t += "[target_generator ? "<font color=green>Shield generator connected.</font>" : "<font color=red>Unable to locate shield generator!</font>"]<br>"
|
||||
t += "This capacitor is: [active ? "<font color=green>Online</font>" : "<font color=red>Offline</font>" ] <a href='?src=\ref[src];toggle=1'>[active ? "\[Deactivate\]" : "\[Activate\]"]</a><br>"
|
||||
t += "[time_since_fail > 2 ? "<font color=green>Charging stable.</font>" : "<font color=red>Warning, low charge!</font>"]<br>"
|
||||
t += "Capacitor charge: [stored_charge] Watts ([100 * stored_charge/max_charge]%)<br>"
|
||||
t += "Capacitor charge rate (approx): <a href='?src=\ref[src];charge_rate=[-max_charge_rate]'>\[min\]</a> <a href='?src=\ref[src];charge_rate=-1000'>\[--\]</a> <a href='?src=\ref[src];charge_rate=-100'>\[-\]</a>[charge_rate] Watts/sec <a href='?src=\ref[src];charge_rate=100'>\[+\]</a> <a href='?src=\ref[src];charge_rate=1000'>\[++\]</a> <a href='?src=\ref[src];charge_rate=[max_charge_rate]'>\[max\]</a><br>"
|
||||
t += "<hr>"
|
||||
t += "<A href='?src=\ref[src];close=1'>Close</A><BR>"
|
||||
user << browse(t, "window=shield_capacitor;size=500x800")
|
||||
user.machine = src
|
||||
|
||||
/obj/item/weapon/circuitboard/shield_capacitor
|
||||
name = "Circuit Board (Shield Capacitor)"
|
||||
build_path = "/obj/machinery/shield_capacitor"
|
||||
board_type = "machine"
|
||||
origin_tech = "electromagnetic=3;engineering=2;power=1"
|
||||
frame_desc = "Requires, 2 Cable Coil, 2 Nano Manipulator, 1 Advanced Matter Bin, 1 Console Screen and 1 High-Power Micro-Laser. "
|
||||
req_components = list(
|
||||
"/obj/item/weapon/cable_coil" = 2,
|
||||
"/obj/item/weapon/stock_parts/manipulator/nano" = 2,
|
||||
"/obj/item/weapon/stock_parts/matter_bin/adv" = 1,
|
||||
"/obj/item/weapon/stock_parts/console_screen" = 1,
|
||||
"/obj/item/weapon/stock_parts/micro_laser/high" = 1)
|
||||
@@ -0,0 +1,280 @@
|
||||
//renwicks: fictional unit to describe shield strength
|
||||
//a small meteor hit will deduct 1 renwick of strength from that shield tile
|
||||
//light explosion range will do 1 renwick's damage
|
||||
//medium explosion range will do 2 renwick's damage
|
||||
//heavy explosion range will do 3 renwick's damage
|
||||
//explosion damage is cumulative. if a tile is in range of light, medium and heavy damage, it will take a hit from all three
|
||||
|
||||
/obj/machinery/shield_gen
|
||||
name = "shield generator"
|
||||
desc = "Machine that generates an impenetrable field of energy when activated."
|
||||
icon = 'shielding.dmi'
|
||||
icon_state = "generator0"
|
||||
var/active = 0
|
||||
var/field_radius = 3
|
||||
var/list/field
|
||||
density = 1
|
||||
anchored = 1
|
||||
var/locked = 0
|
||||
var/average_field_strength = 0
|
||||
var/strengthen_rate = 0.2
|
||||
var/max_strengthen_rate = 0.2
|
||||
var/powered = 0
|
||||
var/check_powered = 1
|
||||
var/obj/machinery/shield_capacitor/owned_capacitor
|
||||
var/max_field_strength = 10
|
||||
var/time_since_fail = 100
|
||||
var/energy_conversion_rate = 0.01 //how many renwicks per watt?
|
||||
var/flicker_shield_glitch = 1 //shield is slightly faulty, and flickers
|
||||
//
|
||||
use_power = 1 //0 use nothing
|
||||
//1 use idle power
|
||||
//2 use active power
|
||||
idle_power_usage = 20
|
||||
active_power_usage = 100
|
||||
|
||||
/obj/machinery/shield_gen/New()
|
||||
..()
|
||||
field = new/list()
|
||||
for(var/obj/machinery/shield_capacitor/possible_cap in range(1))
|
||||
if(get_dir(possible_cap, src) == possible_cap.dir)
|
||||
owned_capacitor = possible_cap
|
||||
break
|
||||
/*spawn(10)
|
||||
check_powered()*/
|
||||
|
||||
//copied from a copypaste. DRY, right?
|
||||
/obj/machinery/shield_gen/proc/check_powered()
|
||||
/*
|
||||
check_powered = 1
|
||||
if(!anchored)
|
||||
powered = 0
|
||||
return 0
|
||||
var/turf/T = src.loc
|
||||
var/obj/structure/cable/C = T.get_cable_node()
|
||||
var/net
|
||||
if (C)
|
||||
net = C.netnum // find the powernet of the connected cable
|
||||
|
||||
if(!net)
|
||||
powered = 0
|
||||
return 0
|
||||
var/datum/powernet/PN = powernets[net] // find the powernet. Magic code, voodoo code.
|
||||
|
||||
if(!PN)
|
||||
powered = 0
|
||||
return 0
|
||||
var/surplus = max(PN.avail-PN.load, 0)
|
||||
var/shieldload = min(rand(50,200), surplus)
|
||||
if(shieldload==0 && !storedpower) // no cable or no power, and no power stored
|
||||
powered = 0
|
||||
return 0
|
||||
else
|
||||
powered = 1
|
||||
if(PN)
|
||||
storedpower += shieldload
|
||||
PN.newload += shieldload //uses powernet power.
|
||||
*/
|
||||
|
||||
/obj/machinery/shield_gen/process()
|
||||
|
||||
if(!owned_capacitor)
|
||||
for(var/obj/machinery/shield_capacitor/possible_cap in range(1))
|
||||
if(get_dir(possible_cap, src) == possible_cap.dir)
|
||||
owned_capacitor = possible_cap
|
||||
break
|
||||
|
||||
if(active && field.len)
|
||||
var/stored_renwicks = 0
|
||||
var/target_field_strength = min(average_field_strength + strengthen_rate, max_field_strength)
|
||||
if(owned_capacitor)
|
||||
var/assumed_charge = min(owned_capacitor.stored_charge, (target_field_strength / energy_conversion_rate) * field.len)
|
||||
stored_renwicks = assumed_charge * energy_conversion_rate
|
||||
owned_capacitor.stored_charge -= assumed_charge
|
||||
|
||||
time_since_fail++
|
||||
|
||||
average_field_strength = 0
|
||||
target_field_strength = stored_renwicks / field.len
|
||||
|
||||
if(!flicker_shield_glitch)
|
||||
for(var/obj/effect/energy_field/E in field)
|
||||
//check to see if the shield is strengthening or failing
|
||||
if(E.strength > target_field_strength)
|
||||
E.strength = target_field_strength
|
||||
else if(E.strength + strengthen_rate > target_field_strength)
|
||||
E.strength = target_field_strength
|
||||
else
|
||||
E.strength += strengthen_rate
|
||||
|
||||
if(stored_renwicks - E.strength < 0)
|
||||
E.strength = stored_renwicks
|
||||
stored_renwicks -= E.strength
|
||||
|
||||
average_field_strength += E.strength
|
||||
//check if the current shield tile has enough energy to maintain itself
|
||||
if(E.strength >= 1)
|
||||
E.density = 1
|
||||
E.invisibility = 0
|
||||
else
|
||||
E.density = 0
|
||||
E.invisibility = 2
|
||||
else
|
||||
//the flicker shield glitch is an intersting quirk in 'older' and/or faulty shielding models
|
||||
//basically, it strengthens the shields continuously until it can no longer sustain them... then it drops out for a few seconds and starts again
|
||||
//this makes the shield 'flicker' every now and then until it stabilises
|
||||
//when this glitch is fixed, shields will only be charged as much as is sustainable
|
||||
for(var/obj/effect/energy_field/E in field)
|
||||
//check to see if the shield is strengthening or failing
|
||||
if(E.strength < target_field_strength)
|
||||
E.strength += strengthen_rate
|
||||
|
||||
retry:
|
||||
if(stored_renwicks - E.strength < 0)
|
||||
if(owned_capacitor.stored_charge > 0)
|
||||
var/emergency_renwicks = min(E.strength, owned_capacitor.stored_charge * energy_conversion_rate)
|
||||
owned_capacitor.stored_charge -= emergency_renwicks / energy_conversion_rate
|
||||
stored_renwicks += emergency_renwicks
|
||||
goto retry
|
||||
else
|
||||
E.strength = stored_renwicks
|
||||
stored_renwicks -= E.strength
|
||||
|
||||
average_field_strength += E.strength
|
||||
//check if the current shield tile has enough energy to maintain itself
|
||||
if(E.strength >= 1)
|
||||
E.density = 1
|
||||
E.invisibility = 0
|
||||
else
|
||||
E.density = 0
|
||||
E.invisibility = 2
|
||||
|
||||
//add any leftover charge back to the capacitor
|
||||
if(owned_capacitor && stored_renwicks >= 0)
|
||||
owned_capacitor.stored_charge += stored_renwicks / energy_conversion_rate
|
||||
|
||||
average_field_strength /= field.len
|
||||
if(average_field_strength < 0)
|
||||
time_since_fail = 0
|
||||
else
|
||||
average_field_strength = 0
|
||||
//
|
||||
updateDialog()
|
||||
|
||||
/obj/machinery/shield_gen/attack_hand(mob/user as mob)
|
||||
|
||||
interact(user)
|
||||
src.add_fingerprint(user)
|
||||
|
||||
/obj/machinery/shield_gen/attackby(obj/item/W, mob/user)
|
||||
|
||||
if(istype(W, /obj/item/weapon/card/id)||istype(W, /obj/item/device/pda))
|
||||
if (src.allowed(user))
|
||||
src.locked = !src.locked
|
||||
user << "Controls are now [src.locked ? "locked." : "unlocked."]"
|
||||
else
|
||||
user << "\red Access denied."
|
||||
|
||||
else
|
||||
src.add_fingerprint(user)
|
||||
user << "\red You hit the [src.name] with your [W.name]!"
|
||||
for(var/mob/M in viewers(src))
|
||||
if(M == user) continue
|
||||
M.show_message("\red The [src.name] has been hit with the [W.name] by [user.name]!")
|
||||
|
||||
/obj/machinery/shield_gen/power_change()
|
||||
if(stat & BROKEN)
|
||||
icon_state = "broke"
|
||||
else
|
||||
if( powered() )
|
||||
if (src.active)
|
||||
icon_state = "generator1"
|
||||
else
|
||||
icon_state = "generator0"
|
||||
stat &= ~NOPOWER
|
||||
else
|
||||
spawn(rand(0, 15))
|
||||
src.icon_state = "generator0"
|
||||
stat |= NOPOWER
|
||||
if (src.active)
|
||||
toggle()
|
||||
|
||||
/obj/machinery/shield_gen/proc/toggle()
|
||||
active = !active
|
||||
power_change()
|
||||
if(active)
|
||||
var/list/covered_turfs = get_shielded_turfs()
|
||||
if(get_turf(src) in covered_turfs)
|
||||
covered_turfs.Remove(get_turf(src))
|
||||
for(var/turf/O in covered_turfs)
|
||||
var/obj/effect/energy_field/E = new(O)
|
||||
field.Add(E)
|
||||
del covered_turfs
|
||||
|
||||
for(var/mob/M in view(5,src))
|
||||
M << "\icon[src] You hear heavy droning start up."
|
||||
else
|
||||
for(var/obj/effect/energy_field/D in field)
|
||||
field.Remove(D)
|
||||
del D
|
||||
|
||||
for(var/mob/M in view(5,src))
|
||||
M << "\icon[src] You hear heavy droning fade out."
|
||||
|
||||
/obj/machinery/shield_gen/Topic(href, href_list[])
|
||||
..()
|
||||
if( href_list["close"] )
|
||||
usr << browse(null, "window=shield_generator")
|
||||
usr.machine = null
|
||||
return
|
||||
else if( href_list["toggle"] )
|
||||
toggle()
|
||||
else if( href_list["change_radius"] )
|
||||
field_radius += text2num(href_list["change_radius"])
|
||||
if(field_radius > 200)
|
||||
field_radius = 200
|
||||
else if(field_radius < 0)
|
||||
field_radius = 0
|
||||
else if( href_list["strengthen_rate"] )
|
||||
strengthen_rate += text2num(href_list["strengthen_rate"])
|
||||
if(strengthen_rate > 0.2)
|
||||
strengthen_rate = 0.2
|
||||
else if(strengthen_rate < 0)
|
||||
strengthen_rate = 0
|
||||
else if( href_list["max_field_strength"] )
|
||||
max_field_strength += text2num(href_list["max_field_strength"])
|
||||
if(max_field_strength > 1000)
|
||||
max_field_strength = 1000
|
||||
else if(max_field_strength < 0)
|
||||
max_field_strength = 0
|
||||
//
|
||||
updateDialog()
|
||||
|
||||
/obj/machinery/shield_gen/proc/interact(mob/user)
|
||||
if ( (get_dist(src, user) > 1 ) || (stat & (BROKEN|NOPOWER)) )
|
||||
if (!istype(user, /mob/living/silicon))
|
||||
user.machine = null
|
||||
user << browse(null, "window=shield_generator")
|
||||
return
|
||||
var/t = "<B>Shield Generator Control Console</B><BR>"
|
||||
t += "[owned_capacitor ? "<font color=green>Charge capacitor connected.</font>" : "<font color=red>Unable to locate charge capacitor!</font>"]<br>"
|
||||
t += "This generator is: [active ? "<font color=green>Online</font>" : "<font color=red>Offline</font>" ] <a href='?src=\ref[src];toggle=1'>[active ? "\[Deactivate\]" : "\[Activate\]"]</a><br>"
|
||||
t += "[time_since_fail > 2 ? "<font color=green>Field is stable.</font>" : "<font color=red>Warning, field is unstable!</font>"]<br>"
|
||||
t += "Coverage radius (generator will need a restart to take effect): <a href='?src=\ref[src];change_radius=-5'>--</a> <a href='?src=\ref[src];change_radius=-1'>-</a> [field_radius * 2]m <a href='?src=\ref[src];change_radius=1'>+</a> <a href='?src=\ref[src];change_radius=5'>++</a><br>"
|
||||
t += "Overall field strength: [average_field_strength] Renwicks ([100 * average_field_strength / max_field_strength]%)<br>"
|
||||
t += "Charge consumption: [( (min(average_field_strength + strengthen_rate, max_field_strength)) / energy_conversion_rate) * field.len] Watts/sec<br>"
|
||||
t += "Field charge rate (approx): <a href='?src=\ref[src];strengthen_rate=-0.1'>--</a> <a href='?src=\ref[src];strengthen_rate=-0.01'>-</a>[strengthen_rate] Renwicks/sec <a href='?src=\ref[src];strengthen_rate=0.01'>+</a> <a href='?src=\ref[src];strengthen_rate=0.1'>++</a><br>"
|
||||
t += "Maximum field strength (avg across field): <a href='?src=\ref[src];max_field_strength=-100'>\[min\]</a> <a href='?src=\ref[src];max_field_strength=-10'>--</a> <a href='?src=\ref[src];max_field_strength=-1'>-</a>[max_field_strength] Renwicks <a href='?src=\ref[src];max_field_strength=1'>+</a> <a href='?src=\ref[src];max_field_strength=10'>++</a> <a href='?src=\ref[src];max_field_strength=100'>\[max\]</a><br>"
|
||||
t += "<hr>"
|
||||
t += "<A href='?src=\ref[src];close=1'>Close</A><BR>"
|
||||
user << browse(t, "window=shield_generator;size=500x800")
|
||||
user.machine = src
|
||||
|
||||
/obj/machinery/shield_gen/proc/get_shielded_turfs()
|
||||
return list()
|
||||
|
||||
/obj/machinery/shield_gen/ex_act(var/severity)
|
||||
|
||||
if(active)
|
||||
toggle()
|
||||
return ..()
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 2.4 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 950 B |
@@ -0,0 +1,12 @@
|
||||
/obj/effect/admin_log_trap
|
||||
name = "Herprpr"
|
||||
desc = "Stepping on this is good."
|
||||
icon = 'screen1.dmi'
|
||||
icon_state = "x2"
|
||||
anchored = 1.0
|
||||
unacidable = 1
|
||||
invisibility = 101
|
||||
|
||||
/obj/effect/admin_log_trap/HasEntered(AM as mob|obj)
|
||||
if(istype(AM,/mob))
|
||||
message_admins("[AM] ([AM:ckey]) stepped on an alerted tile in [get_area(src)]. <a href=\"byond://?src=%admin_ref%;teleto=\ref[src.loc]\">Jump</a>", admin_ref = 1)
|
||||
@@ -1,24 +1,29 @@
|
||||
/obj/item/weapon/circuitboard/atmoscontrol
|
||||
name = "Central Atmospherics Computer Circuitboard"
|
||||
name = "\improper Central Atmospherics Computer Circuitboard"
|
||||
build_path = "/obj/machinery/computer/security/atmoscontrol"
|
||||
|
||||
/obj/machinery/computer/atmoscontrol
|
||||
name = "Central Atmospherics Computer"
|
||||
name = "\improper Central Atmospherics Computer"
|
||||
icon = 'computer.dmi'
|
||||
icon_state = "computer_generic"
|
||||
density = 1
|
||||
anchored = 1.0
|
||||
circuit = "/obj/item/weapon/circuitboard/atmoscontrol"
|
||||
var/obj/machinery/alarm/current = ""
|
||||
var/obj/machinery/alarm/current
|
||||
var/overridden = 0 //not set yet, can't think of a good way to do it
|
||||
req_access = list(ACCESS_CE)
|
||||
|
||||
/obj/machinery/computer/atmoscontrol/attack_hand(mob/user)
|
||||
if(..())
|
||||
return
|
||||
user.machine = src
|
||||
if(allowed(user))
|
||||
overridden = 1
|
||||
else if(!emagged)
|
||||
overridden = 0
|
||||
var/dat = "<a href='?src=\ref[src]&reset=1'>Main Menu</a><hr>"
|
||||
if(current)
|
||||
dat += src.specific()
|
||||
dat += specific()
|
||||
else
|
||||
for(var/obj/machinery/alarm/alarm in world)
|
||||
dat += "<a href='?src=\ref[src]&alarm=\ref[alarm]'>"
|
||||
@@ -32,13 +37,23 @@
|
||||
dat += "[alarm]</font></a><br/>"
|
||||
user << browse(dat, "window=atmoscontrol")
|
||||
|
||||
/obj/machinery/computer/atmoscontrol/attackby(var/obj/item/I as obj, var/mob/user as mob)
|
||||
if(istype(I, /obj/item/weapon/card/emag) && !emagged)
|
||||
user.visible_message("\red \The [user] swipes \a [I] through \the [src], causing the screen to flash!",\
|
||||
"\red You swipe your [I] through \the [src], the screen flashing as you gain full control.",\
|
||||
"You hear the swipe of a card through a reader, and an electronic warble.")
|
||||
emagged = 1
|
||||
overridden = 1
|
||||
return
|
||||
return ..()
|
||||
|
||||
/obj/machinery/computer/atmoscontrol/proc/specific()
|
||||
if(!current)
|
||||
return ""
|
||||
var/dat = "<h3>[current.name]</h3><hr>"
|
||||
dat += current.return_status()
|
||||
if(current.remote_control || overridden && current.rcon_setting)
|
||||
dat += "<hr>[src.return_controls()]"
|
||||
if(current.remote_control || overridden)
|
||||
dat += "<hr>[return_controls()]"
|
||||
return dat
|
||||
|
||||
//a bunch of this is copied from atmos alarms
|
||||
@@ -69,24 +84,53 @@
|
||||
//if("adjust_threshold") //was a good idea but required very wide window
|
||||
if("set_threshold")
|
||||
var/env = href_list["env"]
|
||||
var/varname = href_list["var"]
|
||||
var/datum/tlv/tlv = current.TLV[env]
|
||||
var/newval = input("Enter [varname] for env", "Alarm triggers", tlv.vars[varname]) as num|null
|
||||
var/threshold = text2num(href_list["var"])
|
||||
var/list/selected = current.TLV[env]
|
||||
var/list/thresholds = list("lower bound", "low warning", "high warning", "upper bound")
|
||||
var/newval = input("Enter [thresholds[threshold]] for [env]", "Alarm triggers", selected[threshold]) as num|null
|
||||
if (isnull(newval) || ..() || (current.locked && issilicon(usr)))
|
||||
return
|
||||
if (newval<0)
|
||||
tlv.vars[varname] = -1.0
|
||||
selected[threshold] = -1.0
|
||||
else if (env=="temperature" && newval>5000)
|
||||
tlv.vars[varname] = 5000
|
||||
selected[threshold] = 5000
|
||||
else if (env=="pressure" && newval>50*ONE_ATMOSPHERE)
|
||||
tlv.vars[varname] = 50*ONE_ATMOSPHERE
|
||||
selected[threshold] = 50*ONE_ATMOSPHERE
|
||||
else if (env!="temperature" && env!="pressure" && newval>200)
|
||||
tlv.vars[varname] = 200
|
||||
selected[threshold] = 200
|
||||
else
|
||||
newval = round(newval,0.01)
|
||||
tlv.vars[varname] = newval
|
||||
selected[threshold] = newval
|
||||
if(threshold == 1)
|
||||
if(selected[1] > selected[2])
|
||||
selected[2] = selected[1]
|
||||
if(selected[1] > selected[3])
|
||||
selected[3] = selected[1]
|
||||
if(selected[1] > selected[4])
|
||||
selected[4] = selected[1]
|
||||
if(threshold == 2)
|
||||
if(selected[1] > selected[2])
|
||||
selected[1] = selected[2]
|
||||
if(selected[2] > selected[3])
|
||||
selected[3] = selected[2]
|
||||
if(selected[2] > selected[4])
|
||||
selected[4] = selected[2]
|
||||
if(threshold == 3)
|
||||
if(selected[1] > selected[3])
|
||||
selected[1] = selected[3]
|
||||
if(selected[2] > selected[3])
|
||||
selected[2] = selected[3]
|
||||
if(selected[3] > selected[4])
|
||||
selected[4] = selected[3]
|
||||
if(threshold == 4)
|
||||
if(selected[1] > selected[4])
|
||||
selected[1] = selected[4]
|
||||
if(selected[2] > selected[4])
|
||||
selected[2] = selected[4]
|
||||
if(selected[3] > selected[4])
|
||||
selected[3] = selected[4]
|
||||
spawn(1)
|
||||
src.updateUsrDialog()
|
||||
updateUsrDialog()
|
||||
return
|
||||
|
||||
if(href_list["screen"])
|
||||
@@ -98,14 +142,14 @@
|
||||
|
||||
if(href_list["atmos_alarm"])
|
||||
if (current.alarm_area.atmosalert(2))
|
||||
current.post_alert(2)
|
||||
current.apply_danger_level(2)
|
||||
spawn(1)
|
||||
src.updateUsrDialog()
|
||||
current.update_icon()
|
||||
return
|
||||
if(href_list["atmos_reset"])
|
||||
if (current.alarm_area.atmosalert(0))
|
||||
current.post_alert(0)
|
||||
current.apply_danger_level(0)
|
||||
spawn(1)
|
||||
src.updateUsrDialog()
|
||||
current.update_icon()
|
||||
@@ -121,17 +165,6 @@
|
||||
|
||||
//copypasta from alarm code, changed to work with this without derping hard
|
||||
//---START COPYPASTA----
|
||||
#define AALARM_MODE_SCRUBBING 1
|
||||
#define AALARM_MODE_VENTING 2 //makes draught
|
||||
#define AALARM_MODE_PANIC 3 //constantly sucks all air
|
||||
#define AALARM_MODE_REPLACEMENT 4 //sucks off all air, then refill and swithes to scrubbing
|
||||
#define AALARM_MODE_OFF 5
|
||||
|
||||
#define AALARM_SCREEN_MAIN 1
|
||||
#define AALARM_SCREEN_VENT 2
|
||||
#define AALARM_SCREEN_SCRUB 3
|
||||
#define AALARM_SCREEN_MODE 4
|
||||
#define AALARM_SCREEN_SENSORS 5
|
||||
|
||||
/obj/machinery/computer/atmoscontrol/proc/return_controls()
|
||||
var/output = ""//"<B>[alarm_zone] Air [name]</B><HR>"
|
||||
@@ -151,7 +184,7 @@
|
||||
<HR>
|
||||
"}
|
||||
if (current.mode==AALARM_MODE_PANIC)
|
||||
output += "<font color='red'><B>PANIC SYPHON ACTIVE</B></font><br><A href='?src=\ref[src];alarm=\ref[current];mode=[AALARM_MODE_OFF]'>turn syphoning off</A>"
|
||||
output += "<font color='red'><B>PANIC SYPHON ACTIVE</B></font><br><A href='?src=\ref[src];alarm=\ref[current];mode=[AALARM_MODE_SCRUBBING]'>turn syphoning off</A>"
|
||||
else
|
||||
output += "<A href='?src=\ref[src];alarm=\ref[current];mode=[AALARM_MODE_PANIC]'><font color='red'><B>ACTIVATE PANIC SYPHON IN AREA</B></font></A>"
|
||||
if (AALARM_SCREEN_VENT)
|
||||
@@ -243,11 +276,11 @@ Nitrous Oxide
|
||||
<a href='?src=\ref[src];alarm=\ref[current];screen=[AALARM_SCREEN_MAIN]'>Main menu</a><br>
|
||||
<b>Air machinery mode for the area:</b><ul>"}
|
||||
var/list/modes = list(
|
||||
AALARM_MODE_SCRUBBING = "Filtering",
|
||||
AALARM_MODE_VENTING = "Draught",
|
||||
AALARM_MODE_PANIC = "<font color='red'>PANIC</font>",
|
||||
AALARM_MODE_REPLACEMENT = "<font color='red'>REPLACE AIR</font>",
|
||||
AALARM_MODE_OFF = "Off",
|
||||
AALARM_MODE_SCRUBBING = "Filtering",
|
||||
AALARM_MODE_REPLACEMENT = "<font color='red'>REPLACE AIR</font>",
|
||||
AALARM_MODE_PANIC = "<font color='red'>PANIC</font>",
|
||||
AALARM_MODE_CYCLE = "<font color='red'>CYCLE</font>",
|
||||
AALARM_MODE_FILL = "<font color='red'>FILL</font>",
|
||||
)
|
||||
for (var/m=1,m<=modes.len,m++)
|
||||
if (current.mode==m)
|
||||
@@ -278,49 +311,26 @@ table tr:first-child th:first-child { border: none;}
|
||||
"plasma" = "Toxin",
|
||||
"other" = "Other",
|
||||
)
|
||||
var/list/thresholds = list("min2", "min1", "max1", "max2")
|
||||
var/datum/tlv/tlv
|
||||
var/list/tlv
|
||||
for (var/g in gases)
|
||||
output += {"
|
||||
<TR><th>[gases[g]]</th>
|
||||
"}
|
||||
output += "<TR><th>[gases[g]]</th>"
|
||||
tlv = current.TLV[g]
|
||||
for (var/v in thresholds)
|
||||
output += {"
|
||||
<td>
|
||||
<A href='?src=\ref[src];alarm=\ref[current];command=set_threshold;env=[g];var=[v]'>[tlv.vars[v]>=0?tlv.vars[v]:"OFF"]</A>
|
||||
</td>
|
||||
"}
|
||||
output += {"
|
||||
</TR>
|
||||
"}
|
||||
for (var/i = 1, i <= 4, i++)
|
||||
output += "<td><A href='?src=\ref[src];alarm=\ref[current];command=set_threshold;env=[g];var=[i]'>[tlv[i] >= 0?tlv[i]:"OFF"]</A></td>"
|
||||
output += "</TR>"
|
||||
|
||||
tlv = current.TLV["pressure"]
|
||||
output += {"
|
||||
<TR><th>Pressure</th>
|
||||
"}
|
||||
for (var/v in thresholds)
|
||||
output += {"
|
||||
<td>
|
||||
<A href='?src=\ref[src];alarm=\ref[current];command=set_threshold;env=pressure;var=[v]'>[tlv.vars[v]>=0?tlv.vars[v]:"OFF"]</A>
|
||||
</td>
|
||||
"}
|
||||
output += {"
|
||||
</TR>
|
||||
"}
|
||||
output += "<TR><th>Pressure</th>"
|
||||
for (var/i = 1, i <= 4, i++)
|
||||
output += "<td><A href='?src=\ref[src];alarm=\ref[current];command=set_threshold;env=pressure;var=[i]'>[tlv[i]>= 0?tlv[i]:"OFF"]</A></td>"
|
||||
output += "</TR>"
|
||||
|
||||
tlv = current.TLV["temperature"]
|
||||
output += {"
|
||||
<TR><th>Temperature</th>
|
||||
"}
|
||||
for (var/v in thresholds)
|
||||
output += {"
|
||||
<td>
|
||||
<A href='?src=\ref[src];alarm=\ref[current];command=set_threshold;env=temperature;var=[v]'>[tlv.vars[v]>=0?tlv.vars[v]:"OFF"]</A>
|
||||
</td>
|
||||
"}
|
||||
output += {"
|
||||
</TR>
|
||||
"}
|
||||
output += {"</table>"}
|
||||
output += "<TR><th>Temperature</th>"
|
||||
for (var/i = 1, i <= 4, i++)
|
||||
output += "<td><A href='?src=\ref[src];alarm=\ref[current];command=set_threshold;env=temperature;var=[i]'>[tlv[i]>= 0?tlv[i]:"OFF"]</A></td>"
|
||||
output += "</TR>"
|
||||
output += "</table>"
|
||||
|
||||
return output
|
||||
//---END COPYPASTA----
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
/obj/item/tape/police
|
||||
name = "police tape"
|
||||
desc = "A length of police tape. Do not cross."
|
||||
req_access = list(access_security)
|
||||
req_access = list(ACCESS_SECURITY)
|
||||
icon_base = "police"
|
||||
|
||||
/obj/item/taperoll/engineering
|
||||
@@ -22,7 +22,7 @@
|
||||
/obj/item/tape/engineering
|
||||
name = "engineering tape"
|
||||
desc = "A length of engineering tape. Better not cross it."
|
||||
req_access = list(access_engine,access_atmospherics)
|
||||
req_access = list(ACCESS_ENGINE,ACCESS_ATMOSPHERICS)
|
||||
icon_base = "engineering"
|
||||
|
||||
/obj/item/taperoll/attack_self(mob/user as mob)
|
||||
|
||||
@@ -0,0 +1,361 @@
|
||||
//UltraLight system, by Sukasa
|
||||
|
||||
|
||||
#define UL_I_FALLOFF_SQUARE 0
|
||||
#define UL_I_FALLOFF_ROUND 1
|
||||
|
||||
#define UL_I_LIT 0
|
||||
#define UL_I_EXTINGUISHED 1
|
||||
#define UL_I_ONZERO 2
|
||||
|
||||
#define ul_LightingEnabled 1
|
||||
//#define ul_LightingResolution 2
|
||||
//Uncomment if you want maybe slightly smoother lighting
|
||||
#define ul_Steps 7
|
||||
#define ul_FalloffStyle UL_I_FALLOFF_ROUND // Sets the lighting falloff to be either squared or circular.
|
||||
#define ul_Layer 10
|
||||
#define ul_TopLuminosity 12 //Maximum brightness an object can have.
|
||||
|
||||
//#define ul_LightLevelChangedUpdates
|
||||
//Uncomment if you have code that you want triggered when the light level on an atom changes.
|
||||
|
||||
|
||||
#define ul_Clamp(Value) min(max(Value, 0), ul_Steps)
|
||||
#define ul_IsLuminous(A) (A.LuminosityRed || A.LuminosityGreen || A.LuminosityBlue)
|
||||
#define ul_Luminosity(A) max(A.LuminosityRed, A.LuminosityGreen, A.LuminosityBlue)
|
||||
|
||||
|
||||
#ifdef ul_LightingResolution
|
||||
var/ul_LightingResolutionSqrt = sqrt(ul_LightingResolution)
|
||||
#endif
|
||||
var/ul_SuppressLightLevelChanges = 0
|
||||
|
||||
|
||||
var/list/ul_FastRoot = list(0, 1, 1, 1, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5,
|
||||
5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
|
||||
7, 7)
|
||||
|
||||
|
||||
proc/ul_UnblankLocal(var/list/ReApply = view(ul_TopLuminosity, src))
|
||||
for(var/atom/Light in ReApply)
|
||||
if(ul_IsLuminous(Light))
|
||||
Light.ul_Illuminate()
|
||||
return
|
||||
|
||||
atom/var/LuminosityRed = 0
|
||||
atom/var/LuminosityGreen = 0
|
||||
atom/var/LuminosityBlue = 0
|
||||
|
||||
atom/var/ul_Extinguished = UL_I_ONZERO
|
||||
|
||||
atom/proc/ul_SetLuminosity(var/Red, var/Green = Red, var/Blue = Red)
|
||||
|
||||
if(LuminosityRed == min(Red, ul_TopLuminosity) && LuminosityGreen == min(Green, ul_TopLuminosity) && LuminosityBlue == min(Blue, ul_TopLuminosity))
|
||||
return //No point doing all that work if it won't have any effect anyways...
|
||||
|
||||
if (ul_Extinguished == UL_I_EXTINGUISHED)
|
||||
LuminosityRed = min(Red,ul_TopLuminosity)
|
||||
LuminosityGreen = min(Green,ul_TopLuminosity)
|
||||
LuminosityBlue = min(Blue,ul_TopLuminosity)
|
||||
|
||||
return
|
||||
|
||||
if (ul_IsLuminous(src))
|
||||
ul_Extinguish()
|
||||
|
||||
LuminosityRed = min(Red,ul_TopLuminosity)
|
||||
LuminosityGreen = min(Green,ul_TopLuminosity)
|
||||
LuminosityBlue = min(Blue,ul_TopLuminosity)
|
||||
|
||||
ul_Extinguished = UL_I_ONZERO
|
||||
|
||||
if (ul_IsLuminous(src))
|
||||
ul_Illuminate()
|
||||
|
||||
return
|
||||
|
||||
atom/proc/ul_Illuminate()
|
||||
if (ul_Extinguished == UL_I_LIT)
|
||||
return
|
||||
|
||||
ul_Extinguished = UL_I_LIT
|
||||
|
||||
luminosity = ul_Luminosity(src)
|
||||
|
||||
for(var/turf/Affected in view(luminosity, src))
|
||||
var/Falloff = src.ul_FalloffAmount(Affected)
|
||||
|
||||
var/DeltaRed = LuminosityRed - Falloff
|
||||
var/DeltaGreen = LuminosityGreen - Falloff
|
||||
var/DeltaBlue = LuminosityBlue - Falloff
|
||||
|
||||
if(DeltaRed > 0 || DeltaGreen > 0 || DeltaBlue > 0)
|
||||
|
||||
if(DeltaRed > 0)
|
||||
if(!Affected.MaxRed)
|
||||
Affected.MaxRed = list()
|
||||
Affected.MaxRed += DeltaRed
|
||||
|
||||
if(DeltaGreen > 0)
|
||||
if(!Affected.MaxGreen)
|
||||
Affected.MaxGreen = list()
|
||||
Affected.MaxGreen += DeltaGreen
|
||||
|
||||
if(DeltaBlue > 0)
|
||||
if(!Affected.MaxBlue)
|
||||
Affected.MaxBlue = list()
|
||||
Affected.MaxBlue += DeltaBlue
|
||||
|
||||
Affected.ul_UpdateLight()
|
||||
|
||||
#ifdef ul_LightLevelChangedUpdates
|
||||
if (ul_SuppressLightLevelChanges == 0)
|
||||
Affected.ul_LightLevelChanged()
|
||||
|
||||
for(var/atom/AffectedAtom in Affected)
|
||||
AffectedAtom.ul_LightLevelChanged()
|
||||
#endif
|
||||
return
|
||||
|
||||
atom/proc/ul_Extinguish()
|
||||
|
||||
if (ul_Extinguished != UL_I_LIT)
|
||||
return
|
||||
|
||||
ul_Extinguished = UL_I_EXTINGUISHED
|
||||
|
||||
for(var/turf/Affected in view(ul_Luminosity(src), src))
|
||||
|
||||
var/Falloff = ul_FalloffAmount(Affected)
|
||||
|
||||
var/DeltaRed = LuminosityRed - Falloff
|
||||
var/DeltaGreen = LuminosityGreen - Falloff
|
||||
var/DeltaBlue = LuminosityBlue - Falloff
|
||||
|
||||
if(DeltaRed > 0 || DeltaGreen > 0 || DeltaBlue > 0)
|
||||
|
||||
if(DeltaRed > 0)
|
||||
if(Affected.MaxRed)
|
||||
Affected.MaxRed -= DeltaRed
|
||||
if(!Affected.MaxRed.len)
|
||||
del Affected.MaxRed
|
||||
|
||||
if(DeltaGreen > 0)
|
||||
if(Affected.MaxGreen)
|
||||
Affected.MaxGreen -= DeltaGreen
|
||||
if(!Affected.MaxGreen.len)
|
||||
del Affected.MaxGreen
|
||||
|
||||
if(DeltaBlue > 0)
|
||||
if(Affected.MaxBlue)
|
||||
Affected.MaxBlue -= DeltaBlue
|
||||
if(!Affected.MaxBlue.len)
|
||||
del Affected.MaxBlue
|
||||
|
||||
Affected.ul_UpdateLight()
|
||||
|
||||
#ifdef ul_LightLevelChangedUpdates
|
||||
if (ul_SuppressLightLevelChanges == 0)
|
||||
Affected.ul_LightLevelChanged()
|
||||
|
||||
for(var/atom/AffectedAtom in Affected)
|
||||
AffectedAtom.ul_LightLevelChanged()
|
||||
#endif
|
||||
|
||||
luminosity = 0
|
||||
|
||||
return
|
||||
|
||||
|
||||
/*
|
||||
Calculates the correct lighting falloff value (used to calculate what brightness to set the turf to) to use,
|
||||
when called on a luminous atom and passed an atom in the turf to be lit.
|
||||
|
||||
Supports multiple configurations, BS12 uses the circular falloff setting. This setting uses an array lookup
|
||||
to avoid the cost of the square root function.
|
||||
*/
|
||||
atom/proc/ul_FalloffAmount(var/atom/ref)
|
||||
if (ul_FalloffStyle == UL_I_FALLOFF_ROUND)
|
||||
var/x = (ref.x - src.x)
|
||||
var/y = (ref.y - src.y)
|
||||
|
||||
#ifdef ul_LightingResolution
|
||||
if (round((x*x + y*y)*ul_LightingResolutionSqrt,1) > ul_FastRoot.len)
|
||||
for(var/i = ul_FastRoot.len, i <= round(x*x+y*y*ul_LightingResolutionSqrt,1), i++)
|
||||
ul_FastRoot += round(sqrt(i))
|
||||
return ul_FastRoot[round((x*x + y*y)*ul_LightingResolutionSqrt, 1) + 1]/ul_LightingResolution
|
||||
|
||||
#else
|
||||
if ((x*x + y*y) > ul_FastRoot.len)
|
||||
for(var/i = ul_FastRoot.len, i <= x*x+y*y, i++)
|
||||
ul_FastRoot += round(sqrt(i))
|
||||
return ul_FastRoot[x*x + y*y + 1]
|
||||
|
||||
#endif
|
||||
|
||||
else if (ul_FalloffStyle == UL_I_FALLOFF_SQUARE)
|
||||
return get_dist(src, ref)
|
||||
|
||||
return 0
|
||||
|
||||
atom/proc/ul_SetOpacity(var/NewOpacity)
|
||||
if(opacity != NewOpacity)
|
||||
|
||||
var/list/Blanked = ul_BlankLocal()
|
||||
|
||||
opacity = NewOpacity
|
||||
|
||||
ul_UnblankLocal(Blanked)
|
||||
|
||||
return
|
||||
|
||||
atom/proc/ul_BlankLocal()
|
||||
var/list/Blanked = list( )
|
||||
var/TurfAdjust = isturf(src) ? 1 : 0
|
||||
|
||||
for(var/atom/Affected in view(ul_TopLuminosity, src))
|
||||
if(ul_IsLuminous(Affected) && Affected.ul_Extinguished == UL_I_LIT && (ul_FalloffAmount(Affected) <= ul_Luminosity(Affected) + TurfAdjust))
|
||||
Affected.ul_Extinguish()
|
||||
Blanked += Affected
|
||||
|
||||
return Blanked
|
||||
|
||||
atom/proc/ul_LightLevelChanged()
|
||||
//Designed for client projects to use. Called on items when the turf they are in has its light level changed
|
||||
return
|
||||
|
||||
atom/New()
|
||||
. = ..()
|
||||
if(ul_IsLuminous(src))
|
||||
spawn(5)
|
||||
ul_Illuminate()
|
||||
|
||||
atom/Del()
|
||||
if(ul_IsLuminous(src))
|
||||
ul_Extinguish()
|
||||
. = ..()
|
||||
|
||||
atom/movable/Move()
|
||||
if(ul_IsLuminous(src))
|
||||
ul_Extinguish()
|
||||
. = ..()
|
||||
ul_Illuminate()
|
||||
else
|
||||
return ..()
|
||||
|
||||
|
||||
turf/var/list/MaxRed
|
||||
turf/var/list/MaxGreen
|
||||
turf/var/list/MaxBlue
|
||||
|
||||
turf/proc/ul_GetRed()
|
||||
if(MaxRed)
|
||||
return ul_Clamp(max(MaxRed))
|
||||
return 0
|
||||
turf/proc/ul_GetGreen()
|
||||
if(MaxGreen)
|
||||
return ul_Clamp(max(MaxGreen))
|
||||
return 0
|
||||
turf/proc/ul_GetBlue()
|
||||
if(MaxBlue)
|
||||
return ul_Clamp(max(MaxBlue))
|
||||
return 0
|
||||
|
||||
turf/proc/ul_UpdateLight()
|
||||
var/area/CurrentArea = loc
|
||||
|
||||
if(!isarea(CurrentArea) || !CurrentArea.ul_Lighting)
|
||||
return
|
||||
|
||||
var/LightingTag = copytext(CurrentArea.tag, 1, findtext(CurrentArea.tag, ":UL")) + ":UL[ul_GetRed()]_[ul_GetGreen()]_[ul_GetBlue()]"
|
||||
|
||||
if(CurrentArea.tag != LightingTag)
|
||||
var/area/NewArea = locate(LightingTag)
|
||||
|
||||
if(!NewArea)
|
||||
NewArea = new CurrentArea.type()
|
||||
NewArea.tag = LightingTag
|
||||
|
||||
for(var/V in CurrentArea.vars - "contents")
|
||||
if(issaved(CurrentArea.vars[V]))
|
||||
NewArea.vars[V] = CurrentArea.vars[V]
|
||||
|
||||
NewArea.tag = LightingTag
|
||||
|
||||
NewArea.ul_Light(ul_GetRed(), ul_GetGreen(), ul_GetBlue())
|
||||
|
||||
|
||||
NewArea.contents += src
|
||||
|
||||
return
|
||||
|
||||
turf/proc/ul_Recalculate()
|
||||
|
||||
ul_SuppressLightLevelChanges++
|
||||
|
||||
var/list/Lights = ul_BlankLocal()
|
||||
|
||||
ul_UnblankLocal(Lights)
|
||||
|
||||
ul_SuppressLightLevelChanges--
|
||||
|
||||
return
|
||||
|
||||
area/var/ul_Overlay = null
|
||||
area/var/ul_Lighting = 1
|
||||
|
||||
area/var/LightLevelRed = 0
|
||||
area/var/LightLevelGreen = 0
|
||||
area/var/LightLevelBlue = 0
|
||||
area/var/list/LightLevels
|
||||
|
||||
area/proc/ul_Light(var/Red = LightLevelRed, var/Green = LightLevelGreen, var/Blue = LightLevelBlue)
|
||||
|
||||
if(!src || !src.ul_Lighting)
|
||||
return
|
||||
|
||||
overlays -= ul_Overlay
|
||||
if(LightLevels)
|
||||
if(Red < LightLevels["Red"])
|
||||
Red = LightLevels["Red"]
|
||||
if(Green < LightLevels["Green"])
|
||||
Green = LightLevels["Green"]
|
||||
if(Blue < LightLevels["Blue"])
|
||||
Blue = LightLevels["Blue"]
|
||||
|
||||
LightLevelRed = Red
|
||||
LightLevelGreen = Green
|
||||
LightLevelBlue = Blue
|
||||
|
||||
luminosity = LightLevelRed || LightLevelGreen || LightLevelBlue
|
||||
|
||||
ul_Overlay = image('ULIcons.dmi', , num2text(LightLevelRed) + "-" + num2text(LightLevelGreen) + "-" + num2text(LightLevelBlue), ul_Layer)
|
||||
|
||||
overlays += ul_Overlay
|
||||
|
||||
return
|
||||
|
||||
area/proc/ul_Prep()
|
||||
|
||||
if(!tag)
|
||||
tag = "[type]"
|
||||
if(ul_Lighting)
|
||||
if(!findtext(tag,":UL"))
|
||||
ul_Light()
|
||||
//world.log << tag
|
||||
|
||||
return
|
||||
|
||||
#undef UL_I_FALLOFF_SQUARE
|
||||
#undef UL_I_FALLOFF_ROUND
|
||||
#undef UL_I_LIT
|
||||
#undef UL_I_EXTINGUISHED
|
||||
#undef UL_I_ONZERO
|
||||
#undef ul_LightingEnabled
|
||||
#undef ul_LightingResolution
|
||||
#undef ul_Steps
|
||||
#undef ul_FalloffStyle
|
||||
#undef ul_Layer
|
||||
#undef ul_TopLuminosity
|
||||
#undef ul_Clamp
|
||||
#undef ul_LightLevelChangedUpdates
|
||||
@@ -246,7 +246,7 @@
|
||||
new /obj/item/weapon/storage/box(BPK)
|
||||
new /obj/item/weapon/pen(src)
|
||||
new /obj/item/device/pda/heads/cmo(src)
|
||||
new /obj/item/weapon/storage/firstaid/regular(src)
|
||||
new /obj/item/weapon/storage/firstaid/adv(src)
|
||||
new /obj/item/device/flashlight/pen(src)
|
||||
new /obj/item/clothing/gloves/latex(src)
|
||||
new /obj/item/clothing/suit/bio_suit/cmo(src)
|
||||
@@ -268,7 +268,7 @@
|
||||
new /obj/item/weapon/storage/box(BPK)
|
||||
new /obj/item/weapon/pen(src)
|
||||
new /obj/item/device/pda/medical(src)
|
||||
new /obj/item/weapon/storage/firstaid/regular(src)
|
||||
new /obj/item/weapon/storage/firstaid/adv(src)
|
||||
new /obj/item/device/flashlight/pen(src)
|
||||
new /obj/item/clothing/suit/storage/labcoat(src)
|
||||
new /obj/item/clothing/head/nursehat (src)
|
||||
|
||||
@@ -455,12 +455,12 @@ proc/airborne_can_reach(turf/source, turf/target)
|
||||
var/name = pick(mob.organs)
|
||||
var/datum/organ/external/organ = mob.organs[name]
|
||||
|
||||
if(!organ.broken && !organ.robot)
|
||||
if(!(organ.status & BROKEN) && !(organ.status & ROBOT))
|
||||
mob.adjustBruteLoss(10)
|
||||
mob.visible_message("\red You hear a loud cracking sound coming from [mob.name].","\red <b>Something feels like it shattered in your [organ.display_name]!</b>","You hear a sickening crack.")
|
||||
mob.emote("scream")
|
||||
organ.broken = 1
|
||||
organ.wound = pick("broken","fracture","hairline fracture") //Randomise in future. Edit: Randomized. --SkyMarshal
|
||||
organ.status |= BROKEN
|
||||
organ.broken_description = pick("broken","fracture","hairline fracture") //Randomise in future. Edit: Randomized. --SkyMarshal
|
||||
organ.perma_injury = 10
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user