Merge remote-tracking branch 'refs/remotes/origin/master' into custom_roundstart_items

# Conflicts:
#	code/controllers/configuration.dm
#	code/game/objects/items.dm
This commit is contained in:
kevinz000
2017-05-21 18:17:42 -07:00
571 changed files with 74297 additions and 79090 deletions
@@ -1,15 +0,0 @@
diff a/code/modules/power/singularity/emitter.dm b/code/modules/power/singularity/emitter.dm (rejected hunks)
@@ -98,9 +98,10 @@
/obj/machinery/power/emitter/Destroy()
if(SSticker && SSticker.IsRoundInProgress())
- message_admins("Emitter deleted at ([x],[y],[z] - <A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[x];Y=[y];Z=[z]'>JMP</a>)",0,1)
- log_game("Emitter deleted at ([x],[y],[z])")
- investigate_log("<font color='red'>deleted</font> at ([x],[y],[z]) at [get_area(src)]","singulo")
+ var/turf/T = get_turf(src)
+ message_admins("Emitter deleted at [ADMIN_COORDJMP(T)]",0,1)
+ log_game("Emitter deleted at [COORD(T)]")
+ investigate_log("<font color='red'>deleted</font> at [get_area(src)] [COORD(T)]","singulo")
QDEL_NULL(sparks)
return ..()
+56 -8
View File
@@ -34,18 +34,65 @@
var/area/A = get_area(src)
if(A)
var/mutable_appearance/alert_overlay = mutable_appearance('icons/effects/effects.dmi', "ghostalertsie")
var/mutable_appearance/alert_overlay = mutable_appearance('icons/effects/cult_effects.dmi', "ghostalertsie")
notify_ghosts("Nar-Sie has risen in \the [A.name]. Reach out to the Geometer to be given a new shell for your soul.", source = src, alert_overlay = alert_overlay, action=NOTIFY_ATTACK)
INVOKE_ASYNC(src, .proc/narsie_spawn_animation)
narsie_spawn_animation()
/obj/singularity/narsie/large/cult // For the new cult ending, guaranteed to end the round within 3 minutes
var/list/souls_needed = list()
var/soul_goal = 0
var/souls = 0
var/resolved = FALSE
sleep(70)
SSshuttle.emergency.request(null, set_coefficient = 0.1) // Cannot recall
/obj/singularity/narsie/large/cult/proc/resize(var/ratio)
var/matrix/ntransform = matrix(transform) //aka transform.Copy()
ntransform.Scale(ratio)
animate(src, transform = ntransform, time = 40, easing = EASE_IN|EASE_OUT)
/obj/singularity/narsie/large/cult/Initialize()
. = ..()
GLOB.cult_narsie = src
GLOB.blood_target = src
resize(0.6)
for(var/datum/mind/cult_mind in SSticker.mode.cult)
if(isliving(cult_mind.current))
var/mob/living/L = cult_mind.current
L.narsie_act()
for(var/mob/living/player in GLOB.player_list)
if(player.stat != DEAD && player.loc.z == ZLEVEL_STATION && !iscultist(player) && isliving(player))
souls_needed[player] = TRUE
soul_goal = round(1 + LAZYLEN(souls_needed) * 0.6)
INVOKE_ASYNC(src, .proc/begin_the_end)
/obj/singularity/narsie/large/cult/proc/begin_the_end()
sleep(50)
priority_announce("An acausal dimensional event has been detected in your sector. Event has been flagged EXTINCTION-CLASS. Directing all available assets toward simulating solutions. SOLUTION ETA: 60 SECONDS.","Central Command Higher Dimensional Affairs", 'sound/misc/airraid.ogg')
sleep(550)
priority_announce("Simulations on acausal dimensional event complete. Deploying solution package now. Deployment ETA: TWO MINUTES. ","Central Command Higher Dimensional Affairs")
sleep(50)
set_security_level("delta")
SSshuttle.registerHostileEnvironment(src)
SSshuttle.lockdown = TRUE
sleep(1150)
if(resolved == FALSE)
resolved = TRUE
world << sound('sound/machines/Alarm.ogg')
addtimer(CALLBACK(GLOBAL_PROC, .proc/cult_ending_helper), 120)
addtimer(CALLBACK(GLOBAL_PROC, .proc/ending_helper), 220)
/obj/singularity/narsie/large/cult/Destroy()
GLOB.cult_narsie = null
return ..()
/proc/ending_helper()
SSticker.force_ending = 1
/proc/cult_ending_helper(var/no_explosion = 0)
SSticker.station_explosion_cinematic(no_explosion, "cult", null)
/obj/singularity/narsie/large/attack_ghost(mob/dead/observer/user as mob)
makeNewConstruct(/mob/living/simple_animal/hostile/construct/harvester, user, null, 0, loc_override = src.loc)
new /obj/effect/particle_effect/smoke/sleeping(src.loc)
makeNewConstruct(/mob/living/simple_animal/hostile/construct/harvester, user, cultoverride = TRUE, loc_override = src.loc)
/obj/singularity/narsie/process()
@@ -82,7 +129,8 @@
/obj/singularity/narsie/consume(atom/A)
A.narsie_act()
if(isturf(A))
A.narsie_act()
/obj/singularity/narsie/ex_act() //No throwing bombs at her either.
@@ -134,7 +182,7 @@
return
to_chat(target, "<span class='cultsmall'>NAR-SIE HAS LOST INTEREST IN YOU.</span>")
target = food
if(isliving(target))
if(ishuman(target))
to_chat(target, "<span class ='cult'>NAR-SIE HUNGERS FOR YOUR SOUL.</span>")
else
to_chat(target, "<span class ='cult'>NAR-SIE HAS CHOSEN YOU TO LEAD HER TO HER NEXT MEAL.</span>")
@@ -1,328 +1,328 @@
/obj/machinery/particle_accelerator/control_box
name = "Particle Accelerator Control Console"
desc = "This controls the density of the particles."
icon = 'icons/obj/machines/particle_accelerator.dmi'
icon_state = "control_box"
anchored = 0
density = 1
use_power = 0
idle_power_usage = 500
active_power_usage = 10000
dir = NORTH
var/strength_upper_limit = 2
var/interface_control = 1
var/list/obj/structure/particle_accelerator/connected_parts
var/assembled = 0
var/construction_state = PA_CONSTRUCTION_UNSECURED
var/active = 0
var/strength = 0
var/powered = 0
mouse_opacity = 2
/obj/machinery/particle_accelerator/control_box/New()
wires = new /datum/wires/particle_accelerator/control_box(src)
connected_parts = list()
..()
/obj/machinery/particle_accelerator/control_box/Destroy()
if(active)
toggle_power()
for(var/CP in connected_parts)
var/obj/structure/particle_accelerator/part = CP
part.master = null
connected_parts.Cut()
qdel(wires)
wires = null
return ..()
/obj/machinery/particle_accelerator/control_box/attack_hand(mob/user)
if(construction_state == PA_CONSTRUCTION_COMPLETE)
interact(user)
else if(construction_state == PA_CONSTRUCTION_PANEL_OPEN)
wires.interact(user)
/obj/machinery/particle_accelerator/control_box/proc/update_state()
if(construction_state < PA_CONSTRUCTION_COMPLETE)
use_power = 0
assembled = 0
active = 0
for(var/CP in connected_parts)
var/obj/structure/particle_accelerator/part = CP
part.strength = null
part.powered = 0
part.update_icon()
connected_parts.Cut()
return
if(!part_scan())
use_power = 1
active = 0
connected_parts.Cut()
/obj/machinery/particle_accelerator/control_box/update_icon()
if(active)
icon_state = "control_boxp1"
else
if(use_power)
if(assembled)
icon_state = "control_boxp"
else
icon_state = "ucontrol_boxp"
else
switch(construction_state)
if(PA_CONSTRUCTION_UNSECURED, PA_CONSTRUCTION_UNWIRED)
icon_state = "control_box"
if(PA_CONSTRUCTION_PANEL_OPEN)
icon_state = "control_boxw"
else
icon_state = "control_boxc"
/obj/machinery/particle_accelerator/control_box/Topic(href, href_list)
if(..())
return
if(!interface_control)
to_chat(usr, "<span class='error'>ERROR: Request timed out. Check wire contacts.</span>")
return
if(href_list["close"])
usr << browse(null, "window=pacontrol")
usr.unset_machine()
return
if(href_list["togglep"])
if(!wires.is_cut(WIRE_POWER))
toggle_power()
else if(href_list["scan"])
part_scan()
else if(href_list["strengthup"])
if(!wires.is_cut(WIRE_STRENGTH))
add_strength()
else if(href_list["strengthdown"])
if(!wires.is_cut(WIRE_STRENGTH))
remove_strength()
updateDialog()
update_icon()
/obj/machinery/particle_accelerator/control_box/proc/strength_change()
for(var/CP in connected_parts)
var/obj/structure/particle_accelerator/part = CP
part.strength = strength
part.update_icon()
/obj/machinery/particle_accelerator/control_box/proc/add_strength(s)
if(assembled && (strength < strength_upper_limit))
strength++
strength_change()
/obj/machinery/particle_accelerator/control_box
name = "Particle Accelerator Control Console"
desc = "This controls the density of the particles."
icon = 'icons/obj/machines/particle_accelerator.dmi'
icon_state = "control_box"
anchored = 0
density = 1
use_power = 0
idle_power_usage = 500
active_power_usage = 10000
dir = NORTH
var/strength_upper_limit = 2
var/interface_control = 1
var/list/obj/structure/particle_accelerator/connected_parts
var/assembled = 0
var/construction_state = PA_CONSTRUCTION_UNSECURED
var/active = 0
var/strength = 0
var/powered = 0
mouse_opacity = 2
/obj/machinery/particle_accelerator/control_box/New()
wires = new /datum/wires/particle_accelerator/control_box(src)
connected_parts = list()
..()
/obj/machinery/particle_accelerator/control_box/Destroy()
if(active)
toggle_power()
for(var/CP in connected_parts)
var/obj/structure/particle_accelerator/part = CP
part.master = null
connected_parts.Cut()
qdel(wires)
wires = null
return ..()
/obj/machinery/particle_accelerator/control_box/attack_hand(mob/user)
if(construction_state == PA_CONSTRUCTION_COMPLETE)
interact(user)
else if(construction_state == PA_CONSTRUCTION_PANEL_OPEN)
wires.interact(user)
/obj/machinery/particle_accelerator/control_box/proc/update_state()
if(construction_state < PA_CONSTRUCTION_COMPLETE)
use_power = 0
assembled = 0
active = 0
for(var/CP in connected_parts)
var/obj/structure/particle_accelerator/part = CP
part.strength = null
part.powered = 0
part.update_icon()
connected_parts.Cut()
return
if(!part_scan())
use_power = 1
active = 0
connected_parts.Cut()
/obj/machinery/particle_accelerator/control_box/update_icon()
if(active)
icon_state = "control_boxp1"
else
if(use_power)
if(assembled)
icon_state = "control_boxp"
else
icon_state = "ucontrol_boxp"
else
switch(construction_state)
if(PA_CONSTRUCTION_UNSECURED, PA_CONSTRUCTION_UNWIRED)
icon_state = "control_box"
if(PA_CONSTRUCTION_PANEL_OPEN)
icon_state = "control_boxw"
else
icon_state = "control_boxc"
/obj/machinery/particle_accelerator/control_box/Topic(href, href_list)
if(..())
return
if(!interface_control)
to_chat(usr, "<span class='error'>ERROR: Request timed out. Check wire contacts.</span>")
return
if(href_list["close"])
usr << browse(null, "window=pacontrol")
usr.unset_machine()
return
if(href_list["togglep"])
if(!wires.is_cut(WIRE_POWER))
toggle_power()
else if(href_list["scan"])
part_scan()
else if(href_list["strengthup"])
if(!wires.is_cut(WIRE_STRENGTH))
add_strength()
else if(href_list["strengthdown"])
if(!wires.is_cut(WIRE_STRENGTH))
remove_strength()
updateDialog()
update_icon()
/obj/machinery/particle_accelerator/control_box/proc/strength_change()
for(var/CP in connected_parts)
var/obj/structure/particle_accelerator/part = CP
part.strength = strength
part.update_icon()
/obj/machinery/particle_accelerator/control_box/proc/add_strength(s)
if(assembled && (strength < strength_upper_limit))
strength++
strength_change()
message_admins("PA Control Computer increased to [strength] by [ADMIN_LOOKUPFLW(usr)] in [ADMIN_COORDJMP(src)]",0,1)
log_game("PA Control Computer increased to [strength] by [key_name(usr)] in [COORD(src)]")
investigate_log("increased to <font color='red'>[strength]</font> by [key_name(usr)]","singulo")
/obj/machinery/particle_accelerator/control_box/proc/remove_strength(s)
if(assembled && (strength > 0))
strength--
strength_change()
investigate_log("increased to <font color='red'>[strength]</font> by [key_name(usr)]","singulo")
/obj/machinery/particle_accelerator/control_box/proc/remove_strength(s)
if(assembled && (strength > 0))
strength--
strength_change()
message_admins("PA Control Computer decreased to [strength] by [ADMIN_LOOKUPFLW(usr)] in [ADMIN_COORDJMP(src)]",0,1)
log_game("PA Control Computer decreased to [strength] by [key_name(usr)] in [COORD(src)]")
investigate_log("decreased to <font color='green'>[strength]</font> by [key_name(usr)]","singulo")
/obj/machinery/particle_accelerator/control_box/power_change()
..()
if(stat & NOPOWER)
active = 0
use_power = 0
else if(!stat && construction_state == PA_CONSTRUCTION_COMPLETE)
use_power = 1
/obj/machinery/particle_accelerator/control_box/process()
if(active)
//a part is missing!
if(connected_parts.len < 6)
investigate_log("lost a connected part; It <font color='red'>powered down</font>.","singulo")
toggle_power()
update_icon()
return
//emit some particles
for(var/obj/structure/particle_accelerator/particle_emitter/PE in connected_parts)
PE.emit_particle(strength)
/obj/machinery/particle_accelerator/control_box/proc/part_scan()
var/ldir = turn(dir,-90)
var/rdir = turn(dir,90)
var/odir = turn(dir,180)
var/turf/T = loc
assembled = 0
critical_machine = FALSE
var/obj/structure/particle_accelerator/fuel_chamber/F = locate() in orange(1,src)
if(!F)
return 0
setDir(F.dir)
connected_parts.Cut()
T = get_step(T,rdir)
if(!check_part(T,/obj/structure/particle_accelerator/fuel_chamber))
return 0
T = get_step(T,odir)
if(!check_part(T,/obj/structure/particle_accelerator/end_cap))
return 0
T = get_step(T,dir)
T = get_step(T,dir)
if(!check_part(T,/obj/structure/particle_accelerator/power_box))
return 0
T = get_step(T,dir)
if(!check_part(T,/obj/structure/particle_accelerator/particle_emitter/center))
return 0
T = get_step(T,ldir)
if(!check_part(T,/obj/structure/particle_accelerator/particle_emitter/left))
return 0
T = get_step(T,rdir)
T = get_step(T,rdir)
if(!check_part(T,/obj/structure/particle_accelerator/particle_emitter/right))
return 0
assembled = 1
critical_machine = TRUE //Only counts if the PA is actually assembled.
return 1
/obj/machinery/particle_accelerator/control_box/proc/check_part(turf/T, type)
var/obj/structure/particle_accelerator/PA = locate(/obj/structure/particle_accelerator) in T
if(istype(PA, type) && (PA.construction_state == PA_CONSTRUCTION_COMPLETE))
if(PA.connect_master(src))
connected_parts.Add(PA)
return 1
return 0
/obj/machinery/particle_accelerator/control_box/proc/toggle_power()
active = !active
investigate_log("turned [active?"<font color='green'>ON</font>":"<font color='red'>OFF</font>"] by [usr ? key_name(usr) : "outside forces"]","singulo")
message_admins("PA Control Computer turned [active ?"ON":"OFF"] by [usr ? key_name_admin(usr) : "outside forces"](<A HREF='?_src_=holder;adminmoreinfo=\ref[usr]'>?</A>) (<A HREF='?_src_=holder;adminplayerobservefollow=\ref[usr]'>FLW</A>) in ([x],[y],[z] - <A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[x];Y=[y];Z=[z]'>JMP</a>)",0,1)
log_game("PA Control Computer turned [active ?"ON":"OFF"] by [usr ? "[key_name(usr)]" : "outside forces"] in ([x],[y],[z])")
if(active)
use_power = 2
for(var/CP in connected_parts)
var/obj/structure/particle_accelerator/part = CP
part.strength = strength
part.powered = 1
part.update_icon()
else
use_power = 1
for(var/CP in connected_parts)
var/obj/structure/particle_accelerator/part = CP
part.strength = null
part.powered = 0
part.update_icon()
return 1
/obj/machinery/particle_accelerator/control_box/interact(mob/user)
if((get_dist(src, user) > 1) || (stat & (BROKEN|NOPOWER)))
if(!issilicon(user))
user.unset_machine()
user << browse(null, "window=pacontrol")
return
user.set_machine(src)
var/dat = ""
dat += "<A href='?src=\ref[src];close=1'>Close</A><BR><BR>"
dat += "<h3>Status</h3>"
if(!assembled)
dat += "Unable to detect all parts!<BR>"
dat += "<A href='?src=\ref[src];scan=1'>Run Scan</A><BR><BR>"
else
dat += "All parts in place.<BR><BR>"
dat += "Power:"
if(active)
dat += "On<BR>"
else
dat += "Off <BR>"
dat += "<A href='?src=\ref[src];togglep=1'>Toggle Power</A><BR><BR>"
dat += "Particle Strength: [strength] "
dat += "<A href='?src=\ref[src];strengthdown=1'>--</A>|<A href='?src=\ref[src];strengthup=1'>++</A><BR><BR>"
var/datum/browser/popup = new(user, "pacontrol", name, 420, 300)
popup.set_content(dat)
popup.set_title_image(user.browse_rsc_icon(icon, icon_state))
popup.open()
/obj/machinery/particle_accelerator/control_box/examine(mob/user)
..()
switch(construction_state)
if(PA_CONSTRUCTION_UNSECURED)
to_chat(user, "Looks like it's not attached to the flooring")
if(PA_CONSTRUCTION_UNWIRED)
to_chat(user, "It is missing some cables")
if(PA_CONSTRUCTION_PANEL_OPEN)
to_chat(user, "The panel is open")
/obj/machinery/particle_accelerator/control_box/attackby(obj/item/W, mob/user, params)
var/did_something = FALSE
switch(construction_state)
if(PA_CONSTRUCTION_UNSECURED)
if(istype(W, /obj/item/weapon/wrench) && !isinspace())
playsound(loc, W.usesound, 75, 1)
anchored = 1
user.visible_message("[user.name] secures the [name] to the floor.", \
"You secure the external bolts.")
construction_state = PA_CONSTRUCTION_UNWIRED
did_something = TRUE
if(PA_CONSTRUCTION_UNWIRED)
if(istype(W, /obj/item/weapon/wrench))
playsound(loc, W.usesound, 75, 1)
anchored = 0
user.visible_message("[user.name] detaches the [name] from the floor.", \
"You remove the external bolts.")
construction_state = PA_CONSTRUCTION_UNSECURED
did_something = TRUE
else if(istype(W, /obj/item/stack/cable_coil))
var/obj/item/stack/cable_coil/CC = W
if(CC.use(1))
user.visible_message("[user.name] adds wires to the [name].", \
"You add some wires.")
construction_state = PA_CONSTRUCTION_PANEL_OPEN
did_something = TRUE
if(PA_CONSTRUCTION_PANEL_OPEN)
if(istype(W, /obj/item/weapon/wirecutters))//TODO:Shock user if its on?
user.visible_message("[user.name] removes some wires from the [name].", \
"You remove some wires.")
construction_state = PA_CONSTRUCTION_UNWIRED
did_something = TRUE
else if(istype(W, /obj/item/weapon/screwdriver))
user.visible_message("[user.name] closes the [name]'s access panel.", \
"You close the access panel.")
construction_state = PA_CONSTRUCTION_COMPLETE
did_something = TRUE
if(PA_CONSTRUCTION_COMPLETE)
if(istype(W, /obj/item/weapon/screwdriver))
user.visible_message("[user.name] opens the [name]'s access panel.", \
"You open the access panel.")
construction_state = PA_CONSTRUCTION_PANEL_OPEN
did_something = TRUE
if(did_something)
user.changeNext_move(CLICK_CD_MELEE)
update_state()
update_icon()
return
..()
/obj/machinery/particle_accelerator/control_box/blob_act(obj/structure/blob/B)
if(prob(50))
qdel(src)
#undef PA_CONSTRUCTION_UNSECURED
#undef PA_CONSTRUCTION_UNWIRED
#undef PA_CONSTRUCTION_PANEL_OPEN
#undef PA_CONSTRUCTION_COMPLETE
investigate_log("decreased to <font color='green'>[strength]</font> by [key_name(usr)]","singulo")
/obj/machinery/particle_accelerator/control_box/power_change()
..()
if(stat & NOPOWER)
active = 0
use_power = 0
else if(!stat && construction_state == PA_CONSTRUCTION_COMPLETE)
use_power = 1
/obj/machinery/particle_accelerator/control_box/process()
if(active)
//a part is missing!
if(connected_parts.len < 6)
investigate_log("lost a connected part; It <font color='red'>powered down</font>.","singulo")
toggle_power()
update_icon()
return
//emit some particles
for(var/obj/structure/particle_accelerator/particle_emitter/PE in connected_parts)
PE.emit_particle(strength)
/obj/machinery/particle_accelerator/control_box/proc/part_scan()
var/ldir = turn(dir,-90)
var/rdir = turn(dir,90)
var/odir = turn(dir,180)
var/turf/T = loc
assembled = 0
critical_machine = FALSE
var/obj/structure/particle_accelerator/fuel_chamber/F = locate() in orange(1,src)
if(!F)
return 0
setDir(F.dir)
connected_parts.Cut()
T = get_step(T,rdir)
if(!check_part(T,/obj/structure/particle_accelerator/fuel_chamber))
return 0
T = get_step(T,odir)
if(!check_part(T,/obj/structure/particle_accelerator/end_cap))
return 0
T = get_step(T,dir)
T = get_step(T,dir)
if(!check_part(T,/obj/structure/particle_accelerator/power_box))
return 0
T = get_step(T,dir)
if(!check_part(T,/obj/structure/particle_accelerator/particle_emitter/center))
return 0
T = get_step(T,ldir)
if(!check_part(T,/obj/structure/particle_accelerator/particle_emitter/left))
return 0
T = get_step(T,rdir)
T = get_step(T,rdir)
if(!check_part(T,/obj/structure/particle_accelerator/particle_emitter/right))
return 0
assembled = 1
critical_machine = TRUE //Only counts if the PA is actually assembled.
return 1
/obj/machinery/particle_accelerator/control_box/proc/check_part(turf/T, type)
var/obj/structure/particle_accelerator/PA = locate(/obj/structure/particle_accelerator) in T
if(istype(PA, type) && (PA.construction_state == PA_CONSTRUCTION_COMPLETE))
if(PA.connect_master(src))
connected_parts.Add(PA)
return 1
return 0
/obj/machinery/particle_accelerator/control_box/proc/toggle_power()
active = !active
investigate_log("turned [active?"<font color='green'>ON</font>":"<font color='red'>OFF</font>"] by [usr ? key_name(usr) : "outside forces"]","singulo")
message_admins("PA Control Computer turned [active ?"ON":"OFF"] by [usr ? key_name_admin(usr) : "outside forces"](<A HREF='?_src_=holder;adminmoreinfo=\ref[usr]'>?</A>) (<A HREF='?_src_=holder;adminplayerobservefollow=\ref[usr]'>FLW</A>) in ([x],[y],[z] - <A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[x];Y=[y];Z=[z]'>JMP</a>)",0,1)
log_game("PA Control Computer turned [active ?"ON":"OFF"] by [usr ? "[key_name(usr)]" : "outside forces"] in ([x],[y],[z])")
if(active)
use_power = 2
for(var/CP in connected_parts)
var/obj/structure/particle_accelerator/part = CP
part.strength = strength
part.powered = 1
part.update_icon()
else
use_power = 1
for(var/CP in connected_parts)
var/obj/structure/particle_accelerator/part = CP
part.strength = null
part.powered = 0
part.update_icon()
return 1
/obj/machinery/particle_accelerator/control_box/interact(mob/user)
if((get_dist(src, user) > 1) || (stat & (BROKEN|NOPOWER)))
if(!issilicon(user))
user.unset_machine()
user << browse(null, "window=pacontrol")
return
user.set_machine(src)
var/dat = ""
dat += "<A href='?src=\ref[src];close=1'>Close</A><BR><BR>"
dat += "<h3>Status</h3>"
if(!assembled)
dat += "Unable to detect all parts!<BR>"
dat += "<A href='?src=\ref[src];scan=1'>Run Scan</A><BR><BR>"
else
dat += "All parts in place.<BR><BR>"
dat += "Power:"
if(active)
dat += "On<BR>"
else
dat += "Off <BR>"
dat += "<A href='?src=\ref[src];togglep=1'>Toggle Power</A><BR><BR>"
dat += "Particle Strength: [strength] "
dat += "<A href='?src=\ref[src];strengthdown=1'>--</A>|<A href='?src=\ref[src];strengthup=1'>++</A><BR><BR>"
var/datum/browser/popup = new(user, "pacontrol", name, 420, 300)
popup.set_content(dat)
popup.set_title_image(user.browse_rsc_icon(icon, icon_state))
popup.open()
/obj/machinery/particle_accelerator/control_box/examine(mob/user)
..()
switch(construction_state)
if(PA_CONSTRUCTION_UNSECURED)
to_chat(user, "Looks like it's not attached to the flooring")
if(PA_CONSTRUCTION_UNWIRED)
to_chat(user, "It is missing some cables")
if(PA_CONSTRUCTION_PANEL_OPEN)
to_chat(user, "The panel is open")
/obj/machinery/particle_accelerator/control_box/attackby(obj/item/W, mob/user, params)
var/did_something = FALSE
switch(construction_state)
if(PA_CONSTRUCTION_UNSECURED)
if(istype(W, /obj/item/weapon/wrench) && !isinspace())
playsound(loc, W.usesound, 75, 1)
anchored = 1
user.visible_message("[user.name] secures the [name] to the floor.", \
"You secure the external bolts.")
construction_state = PA_CONSTRUCTION_UNWIRED
did_something = TRUE
if(PA_CONSTRUCTION_UNWIRED)
if(istype(W, /obj/item/weapon/wrench))
playsound(loc, W.usesound, 75, 1)
anchored = 0
user.visible_message("[user.name] detaches the [name] from the floor.", \
"You remove the external bolts.")
construction_state = PA_CONSTRUCTION_UNSECURED
did_something = TRUE
else if(istype(W, /obj/item/stack/cable_coil))
var/obj/item/stack/cable_coil/CC = W
if(CC.use(1))
user.visible_message("[user.name] adds wires to the [name].", \
"You add some wires.")
construction_state = PA_CONSTRUCTION_PANEL_OPEN
did_something = TRUE
if(PA_CONSTRUCTION_PANEL_OPEN)
if(istype(W, /obj/item/weapon/wirecutters))//TODO:Shock user if its on?
user.visible_message("[user.name] removes some wires from the [name].", \
"You remove some wires.")
construction_state = PA_CONSTRUCTION_UNWIRED
did_something = TRUE
else if(istype(W, /obj/item/weapon/screwdriver))
user.visible_message("[user.name] closes the [name]'s access panel.", \
"You close the access panel.")
construction_state = PA_CONSTRUCTION_COMPLETE
did_something = TRUE
if(PA_CONSTRUCTION_COMPLETE)
if(istype(W, /obj/item/weapon/screwdriver))
user.visible_message("[user.name] opens the [name]'s access panel.", \
"You open the access panel.")
construction_state = PA_CONSTRUCTION_PANEL_OPEN
did_something = TRUE
if(did_something)
user.changeNext_move(CLICK_CD_MELEE)
update_state()
update_icon()
return
..()
/obj/machinery/particle_accelerator/control_box/blob_act(obj/structure/blob/B)
if(prob(50))
qdel(src)
#undef PA_CONSTRUCTION_UNSECURED
#undef PA_CONSTRUCTION_UNWIRED
#undef PA_CONSTRUCTION_PANEL_OPEN
#undef PA_CONSTRUCTION_COMPLETE