Merge pull request #6369 from Markolie/admin_interact

Admin interaction update
This commit is contained in:
Fox McCloud
2017-02-18 11:11:02 -05:00
committed by GitHub
39 changed files with 986 additions and 872 deletions
@@ -88,7 +88,10 @@
return 1
/obj/machinery/atmospherics/binary/passive_gate/interact(mob/user as mob)
/obj/machinery/atmospherics/binary/passive_gate/interact(mob/user)
user.set_machine(src)
add_fingerprint(user)
var/dat = {"<b>Power: </b><a href='?src=[UID()];power=1'>[on?"On":"Off"]</a><br>
<b>Desirable output pressure: </b>
[round(target_pressure,0.1)]kPa | <a href='?src=[UID()];set_press=1'>Change</a>
@@ -131,32 +134,35 @@
update_icon()
return
/obj/machinery/atmospherics/binary/passive_gate/attack_hand(user as mob)
/obj/machinery/atmospherics/binary/passive_gate/attack_hand(mob/user)
if(..())
return
src.add_fingerprint(usr)
if(!src.allowed(user))
if(!allowed(user))
to_chat(user, "<span class='alert'>Access denied.</span>")
return
usr.set_machine(src)
interact(user)
/obj/machinery/atmospherics/binary/passive_gate/attack_ghost(mob/user)
interact(user)
return
/obj/machinery/atmospherics/binary/passive_gate/Topic(href,href_list)
if(..()) return
if(..())
return 1
if(href_list["power"])
on = !on
investigate_log("was turned [on ? "on" : "off"] by [key_name(usr)]", "atmos")
if(href_list["set_press"])
var/new_pressure = input(usr,"Enter new output pressure (0-4500kPa)","Pressure control",src.target_pressure) as num
src.target_pressure = max(0, min(4500, new_pressure))
var/new_pressure = input(usr,"Enter new output pressure (0-4500kPa)","Pressure control",target_pressure) as num
target_pressure = max(0, min(4500, new_pressure))
investigate_log("was set to [target_pressure] kPa by [key_name(usr)]", "atmos")
usr.set_machine(src)
src.update_icon()
src.updateUsrDialog()
update_icon()
updateUsrDialog()
return
/obj/machinery/atmospherics/binary/passive_gate/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob, params)
/obj/machinery/atmospherics/binary/passive_gate/attackby(var/obj/item/weapon/W, var/mob/user, params)
if(!istype(W, /obj/item/weapon/wrench))
return ..()
if(on)
@@ -103,7 +103,10 @@ Thus, the two variables affect pump operation are set in New():
radio_connection.post_signal(src, signal, filter = RADIO_ATMOSIA)
return 1
/obj/machinery/atmospherics/binary/pump/interact(mob/user as mob)
/obj/machinery/atmospherics/binary/pump/interact(mob/user)
user.set_machine(src)
add_fingerprint(user)
var/dat = {"<b>Power: </b><a href='?src=[UID()];power=1'>[on?"On":"Off"]</a><br>
<b>Desirable output pressure: </b>
[round(target_pressure,0.1)]kPa | <a href='?src=[UID()];set_press=1'>Change</a>
@@ -151,16 +154,18 @@ Thus, the two variables affect pump operation are set in New():
update_icon()
return
/obj/machinery/atmospherics/binary/pump/attack_hand(user as mob)
/obj/machinery/atmospherics/binary/pump/attack_hand(mob/user)
if(..())
return
src.add_fingerprint(usr)
if(!src.allowed(user))
if(!allowed(user))
to_chat(user, "<span class='alert'>Access denied.</span>")
return
usr.set_machine(src)
interact(user)
/obj/machinery/atmospherics/binary/pump/attack_ghost(mob/user)
interact(user)
return
/obj/machinery/atmospherics/binary/pump/Topic(href,href_list)
if(..())
@@ -169,13 +174,12 @@ Thus, the two variables affect pump operation are set in New():
on = !on
investigate_log("was turned [on ? "on" : "off"] by [key_name(usr)]", "atmos")
if(href_list["set_press"])
var/new_pressure = input(usr,"Enter new output pressure (0-4500kPa)","Pressure control",src.target_pressure) as num
src.target_pressure = max(0, min(4500, new_pressure))
var/new_pressure = input(usr,"Enter new output pressure (0-4500kPa)","Pressure control",target_pressure) as num
target_pressure = max(0, min(4500, new_pressure))
investigate_log("was set to [target_pressure] kPa by [key_name(usr)]", "atmos")
usr.set_machine(src)
src.update_icon()
src.updateUsrDialog()
return
update_icon()
updateUsrDialog()
/obj/machinery/atmospherics/binary/pump/power_change()
var/old_stat = stat
@@ -183,7 +187,7 @@ Thus, the two variables affect pump operation are set in New():
if(old_stat != stat)
update_icon()
/obj/machinery/atmospherics/binary/pump/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob, params)
/obj/machinery/atmospherics/binary/pump/attackby(var/obj/item/weapon/W, var/mob/user, params)
if(!istype(W, /obj/item/weapon/wrench))
return ..()
if(!(stat & NOPOWER) && on)
@@ -45,17 +45,21 @@
investigate_log("was closed by [usr ? key_name(usr) : "a remote signal"]", "atmos")
return
/obj/machinery/atmospherics/binary/valve/attack_ai(mob/user as mob)
/obj/machinery/atmospherics/binary/valve/attack_ai(mob/user)
return
/obj/machinery/atmospherics/binary/valve/attack_ghost(mob/user)
if(user.can_advanced_admin_interact())
return attack_hand(user)
/obj/machinery/atmospherics/binary/valve/attack_hand(mob/user as mob)
/obj/machinery/atmospherics/binary/valve/attack_hand(mob/user)
add_fingerprint(usr)
update_icon(1)
sleep(10)
if(open)
close()
return
open()
else
open()
/obj/machinery/atmospherics/binary/valve/digital // can be controlled by AI
name = "digital valve"
@@ -67,13 +71,13 @@
var/datum/radio_frequency/radio_connection
settagwhitelist = list("id_tag")
/obj/machinery/atmospherics/binary/valve/digital/attack_ai(mob/user as mob)
return src.attack_hand(user)
/obj/machinery/atmospherics/binary/valve/digital/attack_ai(mob/user)
return attack_hand(user)
/obj/machinery/atmospherics/binary/valve/digital/attack_hand(mob/user as mob)
/obj/machinery/atmospherics/binary/valve/digital/attack_hand(mob/user)
if(!powered())
return
if(!src.allowed(user))
if(!allowed(user) && !user.can_advanced_admin_interact())
to_chat(user, "<span class='alert'>Access denied.</span>")
return
..()
@@ -130,7 +134,7 @@
if(open)
close()
/obj/machinery/atmospherics/binary/valve/digital/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob)
/obj/machinery/atmospherics/binary/valve/digital/attackby(var/obj/item/weapon/W as obj, var/mob/user)
if(istype(W, /obj/item/device/multitool))
update_multitool_menu(user)
return 1
@@ -99,7 +99,10 @@ Thus, the two variables affect pump operation are set in New():
return 1
/obj/machinery/atmospherics/binary/volume_pump/interact(mob/user as mob)
/obj/machinery/atmospherics/binary/volume_pump/interact(mob/user)
user.set_machine(src)
add_fingerprint(user)
var/dat = {"<b>Power: </b><a href='?src=[UID()];power=1'>[on?"On":"Off"]</a><br>
<b>Desirable output flow: </b>
[round(transfer_rate,1)]l/s | <a href='?src=[UID()];set_transfer_rate=1'>Change</a>
@@ -142,16 +145,18 @@ Thus, the two variables affect pump operation are set in New():
broadcast_status()
update_icon()
/obj/machinery/atmospherics/binary/volume_pump/attack_hand(user as mob)
/obj/machinery/atmospherics/binary/volume_pump/attack_hand(mob/user)
if(..())
return
src.add_fingerprint(usr)
if(!src.allowed(user))
if(!allowed(user))
to_chat(user, "<span class='alert'>Access denied.</span>")
return
usr.set_machine(src)
interact(user)
/obj/machinery/atmospherics/binary/volume_pump/attack_ghost(mob/user)
interact(user)
return
/obj/machinery/atmospherics/binary/volume_pump/Topic(href,href_list)
if(..())
@@ -160,13 +165,12 @@ Thus, the two variables affect pump operation are set in New():
on = !on
investigate_log("was turned [on ? "on" : "off"] by [key_name(usr)]", "atmos")
if(href_list["set_transfer_rate"])
var/new_transfer_rate = input(usr,"Enter new output volume (0-200l/s)","Flow control",src.transfer_rate) as num
src.transfer_rate = max(0, min(200, new_transfer_rate))
var/new_transfer_rate = input(usr,"Enter new output volume (0-200l/s)","Flow control",transfer_rate) as num
transfer_rate = max(0, min(200, new_transfer_rate))
investigate_log("was set to [transfer_rate] L/s by [key_name(usr)]", "atmos")
usr.set_machine(src)
src.update_icon()
src.updateUsrDialog()
return
update_icon()
updateUsrDialog()
/obj/machinery/atmospherics/binary/volume_pump/power_change()
var/old_stat = stat
@@ -174,7 +178,7 @@ Thus, the two variables affect pump operation are set in New():
if(old_stat != stat)
update_icon()
/obj/machinery/atmospherics/binary/volume_pump/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob, params)
/obj/machinery/atmospherics/binary/volume_pump/attackby(var/obj/item/weapon/W, var/mob/user, params)
if(!istype(W, /obj/item/weapon/wrench))
return ..()
if(!(stat & NOPOWER) && on)
@@ -107,7 +107,7 @@
to_chat(user, "<span class='danger'>You cannot unwrench [src], it is too exerted due to internal pressure.</span>")
add_fingerprint(user)
return 1
playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1)
playsound(loc, 'sound/items/Ratchet.ogg', 50, 1)
to_chat(user, "<span class='notice'>You begin to unfasten \the [src]...</span>")
if(do_after(user, 40, target = src))
user.visible_message( \
@@ -119,14 +119,16 @@
else
return ..()
/obj/machinery/atmospherics/omni/attack_hand(user as mob)
/obj/machinery/atmospherics/omni/attack_hand(mob/user)
if(..())
return
src.add_fingerprint(usr)
add_fingerprint(usr)
ui_interact(user)
return
/obj/machinery/atmospherics/omni/attack_ghost(mob/user)
ui_interact(user)
/obj/machinery/atmospherics/omni/proc/build_icons()
if(!check_icon_cache())
return
@@ -146,15 +146,24 @@ Filter types:
/obj/machinery/atmospherics/trinary/filter/initialize()
set_frequency(frequency)
..()
/obj/machinery/atmospherics/trinary/filter/attack_ghost(mob/user)
interact(user)
/obj/machinery/atmospherics/trinary/filter/attack_hand(user as mob) // -- TLE
/obj/machinery/atmospherics/trinary/filter/attack_hand(mob/user)
if(..())
return
if(!src.allowed(user))
if(!allowed(user))
to_chat(user, "<span class='alert'>Access denied.</span>")
return
interact(user)
/obj/machinery/atmospherics/trinary/filter/interact(mob/user)
user.set_machine(src)
add_fingerprint(user)
var/dat
var/current_filter_type
switch(filter_type)
@@ -184,34 +193,27 @@ Filter types:
<A href='?src=[UID()];filterset=4'>Nitrous Oxide</A><BR>
<A href='?src=[UID()];filterset=-1'>Nothing</A><BR>
<HR><B>Desirable output pressure:</B>
[src.target_pressure]kPa | <a href='?src=[UID()];set_press=1'>Change</a>
[target_pressure]kPa | <a href='?src=[UID()];set_press=1'>Change</a>
"}
var/datum/browser/popup = new(user, "atmo_filter", name, 400, 400)
popup.set_content(dat)
popup.open(0)
onclose(user, "atmo_filter")
return
/obj/machinery/atmospherics/trinary/filter/Topic(href, href_list) // -- TLE
if(..())
return 1
usr.set_machine(src)
src.add_fingerprint(usr)
add_fingerprint(usr)
if(href_list["filterset"])
src.filter_type = text2num(href_list["filterset"])
filter_type = text2num(href_list["filterset"])
if(href_list["temp"])
src.temp = null
temp = null
if(href_list["set_press"])
var/new_pressure = input(usr,"Enter new output pressure (0-4500kPa)","Pressure control",src.target_pressure) as num
src.target_pressure = max(0, min(4500, new_pressure))
var/new_pressure = input(usr,"Enter new output pressure (0-4500kPa)","Pressure control",target_pressure) as num
target_pressure = max(0, min(4500, new_pressure))
if(href_list["power"])
on=!on
src.update_icon()
src.updateUsrDialog()
/*
for(var/mob/M in viewers(1, src))
if((M.client && M.machine == src))
src.attack_hand(M)
*/
return
update_icon()
updateUsrDialog()
@@ -107,15 +107,23 @@
parent3.update = 1
return 1
/obj/machinery/atmospherics/trinary/mixer/attack_ghost(mob/user)
interact(user)
/obj/machinery/atmospherics/trinary/mixer/attack_hand(user as mob)
/obj/machinery/atmospherics/trinary/mixer/attack_hand(mob/user)
if(..())
return
src.add_fingerprint(usr)
if(!src.allowed(user))
if(!allowed(user))
to_chat(user, "<span class='alert'>Access denied.</span>")
return
usr.set_machine(src)
interact(user)
/obj/machinery/atmospherics/trinary/mixer/interact(mob/user)
user.set_machine(src)
add_fingerprint(user)
var/dat = {"<b>Power: </b><a href='?src=[UID()];power=1'>[on?"On":"Off"]</a><br>
<b>Desirable output pressure: </b>
[target_pressure]kPa | <a href='?src=[UID()];set_press=1'>Change</a>
@@ -139,7 +147,6 @@
popup.set_content(dat)
popup.open(0)
onclose(user, "atmo_mixer")
return
/obj/machinery/atmospherics/trinary/mixer/Topic(href,href_list)
if(..())
@@ -147,16 +154,16 @@
if(href_list["power"])
on = !on
if(href_list["set_press"])
var/new_pressure = input(usr,"Enter new output pressure (0-4500kPa)","Pressure control",src.target_pressure) as num
src.target_pressure = max(0, min(4500, new_pressure))
var/new_pressure = input(usr,"Enter new output pressure (0-4500kPa)","Pressure control",target_pressure) as num
target_pressure = max(0, min(4500, new_pressure))
if(href_list["node1_c"])
var/value = text2num(href_list["node1_c"])
src.node1_concentration = max(0, min(1, src.node1_concentration + value))
src.node2_concentration = max(0, min(1, src.node2_concentration - value))
node1_concentration = max(0, min(1, node1_concentration + value))
node2_concentration = max(0, min(1, node2_concentration - value))
if(href_list["node2_c"])
var/value = text2num(href_list["node2_c"])
src.node2_concentration = max(0, min(1, src.node2_concentration + value))
src.node1_concentration = max(0, min(1, src.node1_concentration - value))
src.update_icon()
src.updateUsrDialog()
node2_concentration = max(0, min(1, node2_concentration + value))
node1_concentration = max(0, min(1, node1_concentration - value))
update_icon()
updateUsrDialog()
return
@@ -30,7 +30,7 @@
if(flipped)
flipstate = "m"
if(animation)
flick("tvalve[flipstate][src.state][!src.state]",src)
flick("tvalve[flipstate][state][!state]",src)
else
icon_state = "tvalve[flipstate][state]"
@@ -52,9 +52,9 @@
/obj/machinery/atmospherics/trinary/tvalve/proc/switch_side()
if(state == TVALVE_STATE_STRAIGHT)
src.go_to_side()
go_to_side()
else
src.go_straight()
go_straight()
/obj/machinery/atmospherics/trinary/tvalve/proc/go_to_side()
if(state == TVALVE_STATE_SIDE)
@@ -86,10 +86,14 @@
investigate_log("was set to straight by [usr ? key_name(usr) : "a remote signal"]", "atmos")
return 1
/obj/machinery/atmospherics/trinary/tvalve/attack_ai(mob/user as mob)
/obj/machinery/atmospherics/trinary/tvalve/attack_ai(mob/user)
return
/obj/machinery/atmospherics/trinary/tvalve/attack_ghost(mob/user)
if(user.can_advanced_admin_interact())
return attack_hand(user)
/obj/machinery/atmospherics/trinary/tvalve/attack_hand(mob/user as mob)
/obj/machinery/atmospherics/trinary/tvalve/attack_hand(mob/usermob)
add_fingerprint(usr)
update_icon(1)
sleep(10)
@@ -128,13 +132,13 @@
if(!powered())
icon_state = "tvalvenopower"
/obj/machinery/atmospherics/trinary/tvalve/digital/attack_ai(mob/user as mob)
return src.attack_hand(user)
/obj/machinery/atmospherics/trinary/tvalve/digital/attack_ai(mob/user)
return attack_hand(user)
/obj/machinery/atmospherics/trinary/tvalve/digital/attack_hand(mob/user as mob)
/obj/machinery/atmospherics/trinary/tvalve/digital/attack_hand(mob/user)
if(!powered())
return
if(!src.allowed(user))
if(!allowed(user) && !user.can_advanced_admin_interact())
to_chat(user, "<span class='alert'>Access denied.</span>")
return
..()
+35 -40
View File
@@ -24,87 +24,83 @@
stat |= NOPOWER
/obj/machinery/ai_slipper/proc/setState(var/enabled, var/uses)
src.disabled = disabled
src.uses = uses
src.power_change()
disabled = disabled
uses = uses
power_change()
/obj/machinery/ai_slipper/attackby(obj/item/weapon/W, mob/user, params)
if(stat & (NOPOWER|BROKEN))
return
if(istype(user, /mob/living/silicon))
return src.attack_hand(user)
return attack_hand(user)
else // trying to unlock the interface
if(src.allowed(usr))
if(allowed(usr))
locked = !locked
to_chat(user, "You [ locked ? "lock" : "unlock"] the device.")
to_chat(user, "You [locked ? "lock" : "unlock"] the device.")
if(locked)
if(user.machine==src)
if(user.machine == src)
user.unset_machine()
user << browse(null, "window=ai_slipper")
else
if(user.machine==src)
src.attack_hand(usr)
if(user.machine == src)
attack_hand(usr)
else
to_chat(user, "\red Access denied.")
return
return
/obj/machinery/ai_slipper/attack_ai(mob/user as mob)
/obj/machinery/ai_slipper/attack_ai(mob/user)
return attack_hand(user)
/obj/machinery/ai_slipper/attack_ghost(mob/user)
return attack_hand(user)
/obj/machinery/ai_slipper/attack_hand(mob/user as mob)
/obj/machinery/ai_slipper/attack_hand(mob/user)
if(stat & (NOPOWER|BROKEN))
return
if( (get_dist(src, user) > 1 ))
if(!istype(user, /mob/living/silicon))
to_chat(user, text("Too far away."))
user.unset_machine()
user << browse(null, "window=ai_slipper")
return
if(get_dist(src, user) > 1 && (!issilicon(user) && !user.can_admin_interact()))
to_chat(user, "<span class='warning'>Too far away.</span>")
user.unset_machine()
user << browse(null, "window=ai_slipper")
return
user.set_machine(src)
var/loc = src.loc
if(istype(loc, /turf))
loc = loc:loc
if(!istype(loc, /area))
to_chat(user, text("Turret badly positioned - loc.loc is [].", loc))
return
var/area/area = loc
var/t = "<TT><B>AI Liquid Dispenser</B> ([area.name])<HR>"
var/area/myarea = get_area(src)
var/t = "<TT><B>AI Liquid Dispenser</B> ([myarea.name])<HR>"
if(src.locked && (!istype(user, /mob/living/silicon)))
if(locked && (!issilicon(user) && !user.can_admin_interact()))
t += "<I>(Swipe ID card to unlock control panel.)</I><BR>"
else
t += text("Dispenser [] - <A href='?src=[UID()];toggleOn=1'>[]?</a><br>\n", src.disabled?"deactivated":"activated", src.disabled?"Enable":"Disable")
t += text("Dispenser [] - <A href='?src=[UID()];toggleOn=1'>[]?</a><br>\n", disabled ? "deactivated" : "activated", disabled ? "Enable" : "Disable")
t += text("Uses Left: [uses]. <A href='?src=[UID()];toggleUse=1'>Activate the dispenser?</A><br>\n")
user << browse(t, "window=computer;size=575x450")
onclose(user, "computer")
return
/obj/machinery/ai_slipper/Topic(href, href_list)
if(..())
return 1
if(src.locked)
if(!istype(usr, /mob/living/silicon))
to_chat(usr, "Control panel is locked!")
return
if(locked && (!issilicon(usr) && !usr.can_admin_interact()))
to_chat(usr, "Control panel is locked!")
return 1
if(href_list["toggleOn"])
src.disabled = !src.disabled
icon_state = src.disabled? "motion0":"motion3"
disabled = !disabled
icon_state = disabled? "motion0":"motion3"
if(href_list["toggleUse"])
if(cooldown_on || disabled)
return
else
new /obj/effect/effect/foam(src.loc)
src.uses--
new /obj/effect/effect/foam(loc)
uses--
cooldown_on = 1
cooldown_time = world.timeofday + 100
slip_process()
return
src.attack_hand(usr)
return
attack_hand(usr)
/obj/machinery/ai_slipper/proc/slip_process()
while(cooldown_time - world.timeofday > 0)
@@ -120,5 +116,4 @@
return
if(uses >= 0)
cooldown_on = 0
src.power_change()
return
power_change()
+22 -51
View File
@@ -53,7 +53,11 @@
/obj/machinery/driver_button/attack_ai(mob/user as mob)
return src.attack_hand(user)
return attack_hand(user)
/obj/machinery/driver_button/attack_ghost(mob/user)
if(user.can_advanced_admin_interact())
return attack_hand(user)
/obj/machinery/driver_button/attackby(obj/item/weapon/W, mob/user as mob, params)
@@ -72,7 +76,7 @@
qdel(src)
return 1
return src.attack_hand(user)
return attack_hand(user)
/obj/machinery/driver_button/multitool_menu(var/mob/user, var/obj/item/device/multitool/P)
return {"
@@ -84,7 +88,7 @@
/obj/machinery/driver_button/attack_hand(mob/user as mob)
src.add_fingerprint(usr)
add_fingerprint(usr)
if(stat & (NOPOWER|BROKEN))
return
if(active)
@@ -95,8 +99,6 @@
launch_sequence()
return
/obj/machinery/driver_button/proc/launch_sequence()
active = 1
icon_state = "launcheract"
@@ -121,20 +123,20 @@
radio_connection.post_signal(src, signal, filter = RADIO_LOGIC)
for(var/obj/machinery/door/poddoor/M in range(src,range))
if(M.id_tag == src.id_tag && !M.protected)
if(M.id_tag == id_tag && !M.protected)
spawn()
M.open()
sleep(20)
for(var/obj/machinery/mass_driver/M in range(src,range))
if(M.id_tag == src.id_tag)
if(M.id_tag == id_tag)
M.drive()
sleep(50)
for(var/obj/machinery/door/poddoor/M in range(src,range))
if(M.id_tag == src.id_tag && !M.protected)
if(M.id_tag == id_tag && !M.protected)
spawn()
M.close()
return
@@ -163,14 +165,17 @@
idle_power_usage = 2
active_power_usage = 4
/obj/machinery/ignition_switch/attack_ai(mob/user as mob)
return src.attack_hand(user)
/obj/machinery/ignition_switch/attack_ai(mob/user)
return attack_hand(user)
/obj/machinery/ignition_switch/attack_ghost(mob/user)
if(user.can_advanced_admin_interact())
return attack_hand(user)
/obj/machinery/ignition_switch/attackby(obj/item/weapon/W, mob/user as mob, params)
return src.attack_hand(user)
/obj/machinery/ignition_switch/attack_hand(mob/user as mob)
/obj/machinery/ignition_switch/attackby(obj/item/weapon/W, mob/user, params)
return attack_hand(user)
/obj/machinery/ignition_switch/attack_hand(mob/user)
if(stat & (NOPOWER|BROKEN))
return
if(active)
@@ -182,12 +187,12 @@
icon_state = "launcheract"
for(var/obj/machinery/sparker/M in world)
if(M.id == src.id)
if(M.id == id)
spawn( 0 )
M.spark()
for(var/obj/machinery/igniter/M in world)
if(M.id == src.id)
if(M.id == id)
use_power(50)
M.on = !( M.on )
M.icon_state = text("igniter[]", M.on)
@@ -195,38 +200,4 @@
sleep(50)
icon_state = "launcherbtt"
active = 0
return
//////////////////////////////////////
// Flasher Button //
//////////////////////////////////////
/obj/machinery/flasher_button
name = "flasher button"
desc = "A remote control switch for a mounted flasher."
icon = 'icons/obj/objects.dmi'
icon_state = "launcherbtt"
var/id = null
var/active = 0
anchored = 1.0
use_power = 1
idle_power_usage = 2
active_power_usage = 4
//////////////////////////////////////
// Crematorium Switch //
//////////////////////////////////////
/obj/machinery/crema_switch
desc = "Burn baby burn!"
name = "crematorium igniter"
icon = 'icons/obj/power.dmi'
icon_state = "crema_switch"
anchored = 1.0
req_access = list(access_crematorium)
var/on = 0
var/area/area = null
var/otherarea = null
var/id = 1
active = 0
+2
View File
@@ -412,6 +412,7 @@ var/time_last_changed_position = 0
time_last_changed_position = world.time / 10
j.total_positions++
opened_positions[edit_job_target]++
log_game("[key_name(usr)] has opened a job slot for job \"[j]\".")
nanomanager.update_uis(src)
if("make_job_unavailable")
@@ -428,6 +429,7 @@ var/time_last_changed_position = 0
time_last_changed_position = world.time / 10
j.total_positions--
opened_positions[edit_job_target]--
log_game("[key_name(usr)] has closed a job slot for job \"[j]\".")
nanomanager.update_uis(src)
if(modify)
+12 -8
View File
@@ -33,7 +33,7 @@
/obj/machinery/door_control/attack_ai(mob/user as mob)
if(wires & 2)
return src.attack_hand(user)
return attack_hand(user)
else
to_chat(user, "Error, no route to host.")
@@ -54,22 +54,26 @@
*/
if(istype(W, /obj/item/device/detective_scanner))
return
return src.attack_hand(user)
return attack_hand(user)
/obj/machinery/door_control/emag_act(user as mob)
if(!emagged)
emagged = 1
req_access = list()
req_one_access = list()
playsound(src.loc, "sparks", 100, 1)
playsound(loc, "sparks", 100, 1)
/obj/machinery/door_control/attack_ghost(mob/user)
if(user.can_advanced_admin_interact())
return attack_hand(user)
/obj/machinery/door_control/attack_hand(mob/user as mob)
src.add_fingerprint(usr)
add_fingerprint(usr)
if(stat & (NOPOWER|BROKEN))
return
if(!allowed(user) && (wires & 1))
to_chat(user, "\red Access Denied")
if(!allowed(user) && (wires & 1) && !user.can_advanced_admin_interact())
to_chat(user, "<span class='warning'>Access Denied.</span>")
flick("doorctrl-denied",src)
return
@@ -79,7 +83,7 @@
if(normaldoorcontrol)
for(var/obj/machinery/door/airlock/D in range(range))
if(D.id_tag == src.id)
if(D.id_tag == id)
if(specialfunctions & OPEN)
if(D.density)
spawn(0)
@@ -110,7 +114,7 @@
else
for(var/obj/machinery/door/poddoor/M in airlocks)
if(M.id_tag == src.id)
if(M.id_tag == id)
if(M.density)
spawn( 0 )
M.open()
+92 -99
View File
@@ -556,17 +556,10 @@ About the new airlock wires panel:
flick("door_deny", src)
return
/obj/machinery/door/airlock/attack_ai(mob/user as mob)
ui_interact(user)
/obj/machinery/door/airlock/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1)
ui = nanomanager.try_update_ui(user, src, ui_key, ui, force_open)
if(!ui)
ui = new(user, src, ui_key, "door_control.tmpl", "Door Controls - [src]", 600, 375)
ui.open()
ui.set_auto_update(1)
/obj/machinery/door/airlock/attack_ai(mob/user as mob)
/obj/machinery/door/airlock/attack_ghost(mob/user)
ui_interact(user)
/obj/machinery/door/airlock/attack_ai(mob/user)
ui_interact(user)
/obj/machinery/door/airlock/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1)
@@ -682,17 +675,17 @@ About the new airlock wires panel:
return
/obj/machinery/door/airlock/CanUseTopic(var/mob/user)
if(!issilicon(user))
if(!issilicon(user) && !isobserver(user))
return STATUS_CLOSE
if(operating < 0) //emagged
to_chat(user, "<span class='warning'>Unable to interface: Internal error.</span>")
return STATUS_CLOSE
if(!src.canAIControl())
if(src.canAIHack(user))
src.hack(user)
if(!canAIControl() && !isobserver(user))
if(canAIHack(user))
hack(user)
else
if(src.isAllPowerLoss()) //don't really like how this gets checked a second time, but not sure how else to do it.
if(isAllPowerLoss()) //don't really like how this gets checked a second time, but not sure how else to do it.
to_chat(user, "<span class='warning'>Unable to interface: Connection timed out.</span>")
else
to_chat(user, "<span class='warning'>Unable to interface: Connection refused.</span>")
@@ -709,27 +702,27 @@ About the new airlock wires panel:
if("idscan")
if(src.isWireCut(AIRLOCK_WIRE_IDSCAN))
to_chat(usr, "The IdScan wire has been cut - IdScan feature permanently disabled.")
else if(activate && src.aiDisabledIdScanner)
src.aiDisabledIdScanner = 0
else if(activate && aiDisabledIdScanner)
aiDisabledIdScanner = 0
to_chat(usr, "IdScan feature has been enabled.")
else if(!activate && !src.aiDisabledIdScanner)
src.aiDisabledIdScanner = 1
else if(!activate && !aiDisabledIdScanner)
aiDisabledIdScanner = 1
to_chat(usr, "IdScan feature has been disabled.")
if("main_power")
if(!main_power_lost_until)
src.loseMainPower()
loseMainPower()
if("backup_power")
if(!backup_power_lost_until)
src.loseBackupPower()
loseBackupPower()
if("bolts")
if(src.isWireCut(AIRLOCK_WIRE_DOOR_BOLTS))
if(isWireCut(AIRLOCK_WIRE_DOOR_BOLTS))
to_chat(usr, "The door bolt control wire has been cut - Door bolts permanently dropped.")
else if(activate && src.lock())
else if(activate && lock())
to_chat(usr, "The door bolts have been dropped.")
else if(!activate && src.unlock())
else if(!activate && unlock())
to_chat(usr, "The door bolts have been raised.")
if("electrify_temporary")
if(activate && src.isWireCut(AIRLOCK_WIRE_ELECTRIFY))
if(activate && isWireCut(AIRLOCK_WIRE_ELECTRIFY))
to_chat(usr, text("The electrification wire is cut - Door permanently electrified."))
else if(!activate && electrified_until != 0)
to_chat(usr, "The door is now un-electrified.")
@@ -740,7 +733,7 @@ About the new airlock wires panel:
to_chat(usr, "The door is now electrified for thirty seconds.")
electrify(30)
if("electrify_permanently")
if(src.isWireCut(AIRLOCK_WIRE_ELECTRIFY))
if(isWireCut(AIRLOCK_WIRE_ELECTRIFY))
to_chat(usr, text("The electrification wire is cut - Cannot electrify the door."))
else if(!activate && electrified_until != 0)
to_chat(usr, "The door is now un-electrified.")
@@ -751,9 +744,9 @@ About the new airlock wires panel:
to_chat(usr, "The door is now electrified.")
electrify(-1)
if("open")
if(src.welded)
if(welded)
to_chat(usr, text("The airlock has been welded shut!"))
else if(src.locked)
else if(locked)
to_chat(usr, text("The door bolts are down!"))
else if(activate && density)
open()
@@ -761,33 +754,33 @@ About the new airlock wires panel:
close()
if("safeties")
// Safeties! We don't need no stinking safeties!
if(src.isWireCut(AIRLOCK_WIRE_SAFETY))
if(isWireCut(AIRLOCK_WIRE_SAFETY))
to_chat(usr, text("The safety wire is cut - Cannot secure the door."))
else if(activate && src.safe)
else if(activate && safe)
safe = 0
else if(!activate && !src.safe)
else if(!activate && !safe)
safe = 1
if("timing")
// Door speed control
if(src.isWireCut(AIRLOCK_WIRE_SPEED))
if(isWireCut(AIRLOCK_WIRE_SPEED))
to_chat(usr, text("The timing wire is cut - Cannot alter timing."))
else if(activate && src.normalspeed)
else if(activate && normalspeed)
normalspeed = 0
else if(!activate && !src.normalspeed)
else if(!activate && !normalspeed)
normalspeed = 1
if("lights")
// Bolt lights
if(src.isWireCut(AIRLOCK_WIRE_LIGHT))
if(isWireCut(AIRLOCK_WIRE_LIGHT))
to_chat(usr, "The bolt lights wire has been cut - The door bolt lights are permanently disabled.")
else if(!activate && src.lights)
else if(!activate && lights)
lights = 0
to_chat(usr, "The door bolt lights have been disabled.")
else if(activate && !src.lights)
else if(activate && !lights)
lights = 1
to_chat(usr, "The door bolt lights have been enabled.")
if("emergency")
// Emergency access
if(src.emergency)
if(emergency)
emergency = 0
to_chat(usr, "Emergency access has been disabled.")
else
@@ -800,35 +793,35 @@ About the new airlock wires panel:
/obj/machinery/door/airlock/attackby(C as obj, mob/user as mob, params)
// to_chat(world, text("airlock attackby src [] obj [] mob []", src, C, user))
if(!istype(usr, /mob/living/silicon))
if(src.isElectrified())
if(src.shock(user, 75))
if(isElectrified())
if(shock(user, 75))
return
if(istype(C, /obj/item/device/detective_scanner) || istype(C, /obj/item/taperoll))
return
src.add_fingerprint(user)
if((istype(C, /obj/item/weapon/weldingtool) && !( src.operating ) && src.density))
add_fingerprint(user)
if((istype(C, /obj/item/weapon/weldingtool) && !( operating ) && density))
var/obj/item/weapon/weldingtool/W = C
if(W.remove_fuel(0,user))
if(frozen)
frozen = 0
if(!src.welded)
src.welded = 1
if(!welded)
welded = 1
else
src.welded = null
src.update_icon()
welded = null
update_icon()
return
else
return
else if(istype(C, /obj/item/weapon/screwdriver))
src.p_open = !( src.p_open )
src.update_icon()
p_open = !( p_open )
update_icon()
else if(istype(C, /obj/item/weapon/wirecutters))
return src.attack_hand(user)
return attack_hand(user)
else if(istype(C, /obj/item/device/multitool))
return src.attack_hand(user)
return attack_hand(user)
else if(istype(C, /obj/item/device/assembly/signaler))
return src.attack_hand(user)
return attack_hand(user)
else if(istype(C, /obj/item/weapon/pai_cable)) // -- TLE
var/obj/item/weapon/pai_cable/cable = C
cable.plugin(src, user)
@@ -838,13 +831,13 @@ About the new airlock wires panel:
beingcrowbarred = 1 //derp, Agouri
else
beingcrowbarred = 0
if( beingcrowbarred && src.p_open && (operating == -1 || (density && welded && operating != 1 && !src.arePowerSystemsOn() && !src.locked)) )
playsound(src.loc, 'sound/items/Crowbar.ogg', 100, 1)
if( beingcrowbarred && p_open && (operating == -1 || (density && welded && operating != 1 && !arePowerSystemsOn() && !locked)) )
playsound(loc, 'sound/items/Crowbar.ogg', 100, 1)
user.visible_message("[user] removes the electronics from the airlock assembly.", "You start to remove electronics from the airlock assembly.")
if(do_after(user,40, target = src))
to_chat(user, "\blue You removed the airlock electronics!")
var/obj/structure/door_assembly/da = new assembly_type(src.loc)
var/obj/structure/door_assembly/da = new assembly_type(loc)
da.anchored = 1
if(mineral)
da.glass = mineral
@@ -852,23 +845,23 @@ About the new airlock wires panel:
else if(glass && !da.glass)
da.glass = 1
da.state = 1
da.created_name = src.name
da.created_name = name
da.update_state()
var/obj/item/weapon/airlock_electronics/ae
if(!electronics)
ae = new/obj/item/weapon/airlock_electronics( src.loc )
if(!src.req_access)
src.check_access()
if(src.req_access.len)
ae.conf_access = src.req_access
else if(src.req_one_access.len)
ae.conf_access = src.req_one_access
ae = new/obj/item/weapon/airlock_electronics( loc )
if(!req_access)
check_access()
if(req_access.len)
ae.conf_access = req_access
else if(req_one_access.len)
ae.conf_access = req_one_access
ae.one_access = 1
else
ae = electronics
electronics = null
ae.loc = src.loc
ae.loc = loc
if(operating == -1)
ae.icon_state = "door_electronics_smoked"
operating = 0
@@ -917,11 +910,11 @@ About the new airlock wires panel:
return 0
use_power(360) //360 W seems much more appropriate for an actuator moving an industrial door capable of crushing people
if(forced)
playsound(src.loc, 'sound/machines/airlockforced.ogg', 30, 1)
playsound(loc, 'sound/machines/airlockforced.ogg', 30, 1)
else
playsound(src.loc, doorOpen, 30, 1)
if(src.closeOther != null && istype(src.closeOther, /obj/machinery/door/airlock/) && !src.closeOther.density)
src.closeOther.close()
playsound(loc, doorOpen, 30, 1)
if(closeOther != null && istype(closeOther, /obj/machinery/door/airlock/) && !closeOther.density)
closeOther.close()
return ..()
/obj/machinery/door/airlock/close(var/forced=0, var/override = 0)
@@ -935,16 +928,16 @@ About the new airlock wires panel:
if(safe)
for(var/turf/turf in locs)
if(locate(/mob/living) in turf)
// playsound(src.loc, 'sound/machines/buzz-two.ogg', 50, 0) //THE BUZZING IT NEVER STOPS -Pete
// playsound(loc, 'sound/machines/buzz-two.ogg', 50, 0) //THE BUZZING IT NEVER STOPS -Pete
spawn (60)
autoclose()
return
use_power(360) //360 W seems much more appropriate for an actuator moving an industrial door capable of crushing people
if(forced)
playsound(src.loc, 'sound/machines/airlockforced.ogg', 30, 1)
playsound(loc, 'sound/machines/airlockforced.ogg', 30, 1)
else
playsound(src.loc, doorClose, 30, 1)
playsound(loc, doorClose, 30, 1)
var/obj/structure/window/killthis = (locate(/obj/structure/window) in get_turf(src))
if(killthis)
killthis.ex_act(2)//Smashin windows
@@ -953,9 +946,9 @@ About the new airlock wires panel:
return 1
operating = 1
do_animate("closing")
src.layer = 3.1
layer = 3.1
if(!override) sleep(5)
src.density = 1
density = 1
if(!safe)
crush()
if(!override) sleep(5)
@@ -977,19 +970,19 @@ About the new airlock wires panel:
if(operating && !forced) return 0
src.locked = 1
locked = 1
playsound(src, boltDown, 30, 0, 3)
update_icon()
return 1
/obj/machinery/door/airlock/proc/unlock(var/forced=0)
if(!src.locked)
if(!locked)
return
if(!forced)
if(operating || !src.arePowerSystemsOn() || isWireCut(AIRLOCK_WIRE_DOOR_BOLTS)) return
if(operating || !arePowerSystemsOn() || isWireCut(AIRLOCK_WIRE_DOOR_BOLTS)) return
src.locked = 0
locked = 0
playsound(src,boltUp, 30, 0, 3)
update_icon()
return 1
@@ -997,11 +990,11 @@ About the new airlock wires panel:
/obj/machinery/door/airlock/New()
..()
wires = new(src)
if(src.closeOtherId != null)
if(closeOtherId != null)
spawn (5)
for(var/obj/machinery/door/airlock/A in airlocks)
if(A.closeOtherId == src.closeOtherId && A != src)
src.closeOther = A
if(A.closeOtherId == closeOtherId && A != src)
closeOther = A
break
if(frozen)
welded = 1
@@ -1010,8 +1003,8 @@ About the new airlock wires panel:
/obj/machinery/door/airlock/hatch/gamma/attackby(C as obj, mob/user as mob, params)
// to_chat(world, text("airlock attackby src [] obj [] mob []", src, C, user))
if(!istype(usr, /mob/living/silicon))
if(src.isElectrified())
if(src.shock(user, 75))
if(isElectrified())
if(shock(user, 75))
return
if(istype(C, /obj/item/device/detective_scanner) || istype(C, /obj/item/taperoll))
return
@@ -1024,17 +1017,17 @@ About the new airlock wires panel:
to_chat(user, "The hatch is made of an advanced compound that cannot be deconstructed using an RCD.")
return
src.add_fingerprint(user)
if((istype(C, /obj/item/weapon/weldingtool) && !( src.operating > 0 ) && src.density))
add_fingerprint(user)
if((istype(C, /obj/item/weapon/weldingtool) && !( operating > 0 ) && density))
var/obj/item/weapon/weldingtool/W = C
if(W.remove_fuel(0,user))
if(frozen)
frozen = 0
if(!src.welded)
src.welded = 1
if(!welded)
welded = 1
else
src.welded = null
src.update_icon()
welded = null
update_icon()
return
else
return
@@ -1043,23 +1036,23 @@ About the new airlock wires panel:
/obj/machinery/door/airlock/highsecurity/red/attackby(C as obj, mob/user as mob, params)
// to_chat(world, text("airlock attackby src [] obj [] mob []", src, C, user))
if(!istype(usr, /mob/living/silicon))
if(src.isElectrified())
if(src.shock(user, 75))
if(isElectrified())
if(shock(user, 75))
return
if(istype(C, /obj/item/device/detective_scanner) || istype(C, /obj/item/taperoll))
return
src.add_fingerprint(user)
if((istype(C, /obj/item/weapon/weldingtool) && !( src.operating > 0 ) && src.density))
add_fingerprint(user)
if((istype(C, /obj/item/weapon/weldingtool) && !( operating > 0 ) && density))
var/obj/item/weapon/weldingtool/W = C
if(W.remove_fuel(0,user))
if(frozen)
frozen = 0
if(!src.welded)
src.welded = 1
if(!welded)
welded = 1
else
src.welded = null
src.update_icon()
welded = null
update_icon()
return
else
return
@@ -1085,9 +1078,9 @@ About the new airlock wires panel:
/obj/machinery/door/airlock/proc/prison_open()
if(arePowerSystemsOn())
src.unlock()
src.open()
src.lock()
unlock()
open()
lock()
/obj/machinery/door/airlock/hostile_lockdown(mob/origin)
// Must be powered and have working AI wire.
+10 -5
View File
@@ -172,8 +172,10 @@
//Allows AIs to use door_timer, see human attack_hand function below
/obj/machinery/door_timer/attack_ai(mob/user)
return attack_hand(user)
interact(user)
/obj/machinery/door_timer/attack_ghost(mob/user)
interact(user)
//Allows humans to use door_timer
//Opens dialog window when someone clicks on door timer
@@ -182,7 +184,9 @@
/obj/machinery/door_timer/attack_hand(mob/user)
if(..())
return
interact(user)
/obj/machinery/door_timer/interact(mob/user)
// Used for the 'time left' display
var/second = round(timeleft() % 60)
var/minute = round((timeleft() - second) / 60)
@@ -239,9 +243,10 @@
// Also updates dialog window and timer icon
/obj/machinery/door_timer/Topic(href, href_list)
if(..())
return
if(!allowed(usr))
return
return 1
if(!allowed(usr) && !usr.can_admin_interact())
return 1
usr.set_machine(src)
+29 -24
View File
@@ -77,7 +77,7 @@
if(istype(AM, /obj/mecha))
var/obj/mecha/mecha = AM
if(density)
if(mecha.occupant && (src.allowed(mecha.occupant) || src.check_access_list(mecha.operation_req_access) || emergency == 1))
if(mecha.occupant && (allowed(mecha.occupant) || check_access_list(mecha.operation_req_access) || emergency == 1))
open()
else
do_animate("deny")
@@ -111,38 +111,43 @@
do_animate("deny")
return
/obj/machinery/door/attack_ai(mob/user as mob)
return src.attack_hand(user)
/obj/machinery/door/attack_ai(mob/user)
return attack_hand(user)
/obj/machinery/door/attack_hand(mob/user as mob)
return src.attackby(user, user)
/obj/machinery/door/attack_ghost(mob/user)
if(user.can_advanced_admin_interact())
return attack_hand(user)
/obj/machinery/door/attack_hand(mob/user)
return attackby(user, user)
/obj/machinery/door/attack_tk(mob/user as mob)
/obj/machinery/door/attack_tk(mob/user)
if(requiresID() && !allowed(null))
return
..()
/obj/machinery/door/attackby(obj/item/I as obj, mob/user as mob, params)
/obj/machinery/door/attackby(obj/item/I, mob/user, params)
if(istype(I, /obj/item/device/detective_scanner))
return
if(src.operating || isrobot(user)) return //borgs can't attack doors open because it conflicts with their AI-like interaction with them.
src.add_fingerprint(user)
if(!Adjacent(user))
user = null
if(!src.requiresID())
user = null
if(src.density && (istype(I, /obj/item/weapon/card/emag)||istype(I, /obj/item/weapon/melee/energy/blade)))
if(operating || isrobot(user))
return //borgs can't attack doors open because it conflicts with their AI-like interaction with them.
add_fingerprint(user)
if(density && (istype(I, /obj/item/weapon/card/emag) || istype(I, /obj/item/weapon/melee/energy/blade)))
emag_act(user)
return 1
if(src.allowed(user) || src.emergency == 1)
if(src.density)
if(allowed(user) || emergency == 1 || user.can_advanced_admin_interact())
if(density)
open()
else
close()
return
if(src.density)
if(density)
do_animate("deny")
return
/obj/machinery/door/emag_act(user as mob)
if(density)
@@ -213,11 +218,11 @@
if(!operating) operating = 1
do_animate("opening")
src.set_opacity(0)
set_opacity(0)
sleep(5)
src.density = 0
density = 0
sleep(5)
src.layer = open_layer
layer = open_layer
update_icon()
set_opacity(0)
operating = 0
@@ -242,9 +247,9 @@
autoclose_timer = 0
do_animate("closing")
src.layer = closed_layer
layer = closed_layer
sleep(5)
src.density = 1
density = 1
sleep(5)
update_icon()
if(visible && !glass)
@@ -266,7 +271,7 @@
L.Weaken(5)
else //for simple_animals & borgs
L.adjustBruteLoss(DOOR_CRUSH_DAMAGE)
var/turf/simulated/location = src.loc
var/turf/simulated/location = loc
if(istype(location, /turf/simulated)) //add_blood doesn't work for borgs/xenos, but add_blood_floor does.
location.add_blood_floor(L)
+4
View File
@@ -101,6 +101,10 @@
/obj/machinery/door/firedoor/attack_ai(mob/user)
attack_hand(user)
/obj/machinery/door/firedoor/attack_ghost(mob/user)
if(user.can_advanced_admin_interact())
attack_hand(user)
/obj/machinery/door/firedoor/attack_alien(mob/user)
add_fingerprint(user)
+83 -81
View File
@@ -13,9 +13,9 @@
/obj/machinery/door/window/New()
..()
if(src.req_access && src.req_access.len)
src.icon_state = "[src.icon_state]"
src.base_state = src.icon_state
if(req_access && req_access.len)
icon_state = "[icon_state]"
base_state = icon_state
if(!color)
color = color_windows(src)
@@ -33,7 +33,7 @@
/obj/machinery/door/window/proc/open_and_close()
open()
if(src.check_access(null))
if(check_access(null))
sleep(50)
else //secure doors close faster
sleep(20)
@@ -45,10 +45,10 @@
if(!ismob(AM))
if(istype(AM, /obj/mecha))
var/obj/mecha/mecha = AM
if(mecha.occupant && src.allowed(mecha.occupant))
if(mecha.occupant && allowed(mecha.occupant))
open_and_close()
else
flick(text("[]deny", src.base_state), src)
flick(text("[]deny", base_state), src)
return
if(!ticker)
return
@@ -58,16 +58,16 @@
return
/obj/machinery/door/window/bumpopen(mob/user as mob)
if( operating || !src.density )
if( operating || !density )
return
src.add_fingerprint(user)
if(!src.requiresID())
add_fingerprint(user)
if(!requiresID())
user = null
if(allowed(user))
open_and_close()
else
flick(text("[]deny", src.base_state), src)
flick(text("[]deny", base_state), src)
return
/obj/machinery/door/window/CanPass(atom/movable/mover, turf/target, height=0)
@@ -97,7 +97,7 @@
return 1
/obj/machinery/door/window/open(var/forced=0)
if(src.operating == 1) //doors can still open when emag-disabled
if(operating == 1) //doors can still open when emag-disabled
return 0
if(!ticker)
return 0
@@ -107,24 +107,24 @@
if(forced < 2)
if(emagged)
return 0
if(!src.operating) //in case of emag
src.operating = 1
flick(text("[]opening", src.base_state), src)
playsound(src.loc, 'sound/machines/windowdoor.ogg', 100, 1)
src.icon_state = text("[]open", src.base_state)
if(!operating) //in case of emag
operating = 1
flick(text("[]opening", base_state), src)
playsound(loc, 'sound/machines/windowdoor.ogg', 100, 1)
icon_state = text("[]open", base_state)
sleep(10)
src.density = 0
// src.sd_set_opacity(0) //TODO: why is this here? Opaque windoors? ~Carn
density = 0
// sd_set_opacity(0) //TODO: why is this here? Opaque windoors? ~Carn
air_update_turf(1)
update_freelook_sight()
if(operating == 1) //emag again
src.operating = 0
operating = 0
return 1
/obj/machinery/door/window/close(var/forced=0)
if(src.operating)
if(operating)
return 0
if(!forced)
if(stat & NOPOWER)
@@ -132,33 +132,33 @@
if(forced < 2)
if(emagged)
return 0
src.operating = 1
flick(text("[]closing", src.base_state), src)
playsound(src.loc, 'sound/machines/windowdoor.ogg', 100, 1)
src.icon_state = src.base_state
operating = 1
flick(text("[]closing", base_state), src)
playsound(loc, 'sound/machines/windowdoor.ogg', 100, 1)
icon_state = base_state
src.density = 1
// if(src.visible)
density = 1
// if(visible)
// set_opacity(1) //TODO: why is this here? Opaque windoors? ~Carn
air_update_turf(1)
update_freelook_sight()
sleep(10)
src.operating = 0
operating = 0
return 1
/obj/machinery/door/window/proc/take_damage(var/damage)
src.health = max(0, src.health - damage)
if(src.health <= 0)
health = max(0, health - damage)
if(health <= 0)
var/debris = list(
new /obj/item/weapon/shard(src.loc),
new /obj/item/weapon/shard(src.loc),
new /obj/item/stack/rods(src.loc, 2),
new /obj/item/stack/cable_coil(src.loc, 2)
new /obj/item/weapon/shard(loc),
new /obj/item/weapon/shard(loc),
new /obj/item/stack/rods(loc, 2),
new /obj/item/stack/cable_coil(loc, 2)
)
for(var/obj/fragment in debris)
transfer_fingerprints_to(fragment)
src.density = 0
density = 0
qdel(src)
return
@@ -177,34 +177,37 @@
tforce = 40
else
tforce = AM:throwforce
playsound(src.loc, 'sound/effects/Glasshit.ogg', 100, 1)
playsound(loc, 'sound/effects/Glasshit.ogg', 100, 1)
take_damage(tforce)
//..() //Does this really need to be here twice? The parent proc doesn't even do anything yet. - Nodrak
return
/obj/machinery/door/window/mech_melee_attack(obj/mecha/M)
if(M.damtype == "brute")
playsound(src.loc, 'sound/effects/Glasshit.ogg', 75, 1)
playsound(loc, 'sound/effects/Glasshit.ogg', 75, 1)
M.occupant_message("<span class='danger'>You hit [src].</span>")
visible_message("<span class='danger'>[src] has been hit by [M.name].</span>")
take_damage(M.force)
return
/obj/machinery/door/window/attack_ai(mob/user as mob)
return src.attack_hand(user)
/obj/machinery/door/window/attack_ai(mob/user)
return attack_hand(user)
/obj/machinery/door/window/attack_ghost(mob/user)
if(user.can_advanced_admin_interact())
return attack_hand(user)
/obj/machinery/door/window/proc/attack_generic(mob/user as mob, damage = 0)
if(src.operating)
if(operating)
return
user.changeNext_move(CLICK_CD_MELEE)
user.do_attack_animation(src)
playsound(src.loc, 'sound/effects/Glasshit.ogg', 75, 1)
user.visible_message("<span class='danger'>[user] smashes against the [src.name].</span>", \
"<span class='userdanger'>[user] smashes against the [src.name].</span>")
playsound(loc, 'sound/effects/Glasshit.ogg', 75, 1)
user.visible_message("<span class='danger'>[user] smashes against the [name].</span>", \
"<span class='userdanger'>[user] smashes against the [name].</span>")
take_damage(damage)
/obj/machinery/door/window/attack_alien(mob/living/user as mob)
if(islarva(user))
return
attack_generic(user, 25)
@@ -221,22 +224,21 @@
return
attack_generic(user, 25)
/obj/machinery/door/window/attack_hand(mob/user as mob)
return src.attackby(user, user)
return attackby(user, user)
/obj/machinery/door/window/emag_act(user as mob, weapon as obj)
if(density)
src.operating = -1
flick("[src.base_state]spark", src)
operating = -1
flick("[base_state]spark", src)
sleep(6)
desc += "<BR><span class='warning'>Its access panel is smoking slightly.</span>"
if(istype(weapon, /obj/item/weapon/melee/energy/blade))
var/datum/effect/system/spark_spread/spark_system = new /datum/effect/system/spark_spread()
spark_system.set_up(5, 0, src.loc)
spark_system.set_up(5, 0, loc)
spark_system.start()
playsound(src.loc, "sparks", 50, 1)
playsound(src.loc, 'sound/weapons/blade1.ogg', 50, 1)
playsound(loc, "sparks", 50, 1)
playsound(loc, 'sound/weapons/blade1.ogg', 50, 1)
visible_message("<span class='warning'> The glass door was sliced open by [user]!</span>")
open(2)
emagged = 1
@@ -248,33 +250,33 @@
/obj/machinery/door/window/attackby(obj/item/weapon/I as obj, mob/living/user as mob, params)
//If it's in the process of opening/closing, ignore the click
if(src.operating)
if(operating)
return
add_fingerprint(user)
//Ninja swords? You may pass.
if(src.density && (istype(I, /obj/item/weapon/card/emag)||istype(I, /obj/item/weapon/melee/energy/blade)))
if(density && (istype(I, /obj/item/weapon/card/emag) || istype(I, /obj/item/weapon/melee/energy/blade)))
emag_act(user,I)
return 1
if(istype(I, /obj/item/weapon/screwdriver))
if(src.density || src.operating)
if(density || operating)
to_chat(user, "<span class='warning'>You need to open the door to access the maintenance panel.</span>")
return
playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1)
src.p_open = !( src.p_open )
to_chat(user, "<span class='notice'>You [p_open ? "open":"close"] the maintenance panel of the [src.name].</span>")
playsound(loc, 'sound/items/Screwdriver.ogg', 50, 1)
p_open = !( p_open )
to_chat(user, "<span class='notice'>You [p_open ? "open":"close"] the maintenance panel of the [name].</span>")
return
if(istype(I, /obj/item/weapon/crowbar))
if(p_open && !src.density && !src.operating)
playsound(src.loc, 'sound/items/Crowbar.ogg', 100, 1)
user.visible_message("<span class='warning'>[user] removes the electronics from the [src.name].</span>", \
"You start to remove electronics from the [src.name].")
if(p_open && !density && !operating)
playsound(loc, 'sound/items/Crowbar.ogg', 100, 1)
user.visible_message("<span class='warning'>[user] removes the electronics from the [name].</span>", \
"You start to remove electronics from the [name].")
if(do_after(user,40, target = src))
if(src.p_open && !src.density && !src.operating && src.loc)
var/obj/structure/windoor_assembly/WA = new /obj/structure/windoor_assembly(src.loc)
if(p_open && !density && !operating && loc)
var/obj/structure/windoor_assembly/WA = new /obj/structure/windoor_assembly(loc)
switch(base_state)
if("left")
WA.facing = "l"
@@ -288,10 +290,10 @@
WA.secure = 1
WA.anchored = 1
WA.state= "02"
WA.dir = src.dir
WA.ini_dir = src.dir
WA.dir = dir
WA.ini_dir = dir
WA.update_icon()
WA.created_name = src.name
WA.created_name = name
if(emagged)
to_chat(user, "<span class='warning'>You discard the damaged electronics.</span>")
@@ -302,18 +304,18 @@
var/obj/item/weapon/airlock_electronics/ae
if(!electronics)
ae = new/obj/item/weapon/airlock_electronics( src.loc )
if(!src.req_access)
src.check_access()
if(src.req_access.len)
ae.conf_access = src.req_access
else if(src.req_one_access.len)
ae.conf_access = src.req_one_access
ae = new/obj/item/weapon/airlock_electronics( loc )
if(!req_access)
check_access()
if(req_access.len)
ae.conf_access = req_access
else if(req_one_access.len)
ae.conf_access = req_one_access
ae.one_access = 1
else
ae = electronics
electronics = null
ae.loc = src.loc
ae.loc = loc
qdel(src)
return
@@ -322,37 +324,37 @@
//If windoor is unpowered, crowbar, fireaxe and armblade can force it.
if(istype(I, /obj/item/weapon/crowbar) || istype(I, /obj/item/weapon/twohanded/fireaxe))
if(stat & NOPOWER)
if(src.density)
if(density)
open(2)
else
close(2)
return
//If it's a weapon, smash windoor. Unless it's an id card, agent card, ect.. then ignore it (Cards really shouldnt damage a door anyway)
if(src.density && istype(I, /obj/item/weapon) && !istype(I, /obj/item/weapon/card) )
if(density && istype(I, /obj/item/weapon) && !istype(I, /obj/item/weapon/card) )
user.changeNext_move(CLICK_CD_MELEE)
user.do_attack_animation(src)
if( (I.flags&NOBLUDGEON) || !I.force )
return
var/aforce = I.force
playsound(src.loc, 'sound/effects/Glasshit.ogg', 75, 1)
playsound(loc, 'sound/effects/Glasshit.ogg', 75, 1)
visible_message("<span class='danger'>\The [src] has been hit by [user] with [I].</span>")
if(I.damtype == BURN || I.damtype == BRUTE)
take_damage(aforce)
return
if(!src.requiresID())
if(!requiresID())
//don't care who they are or what they have, act as if they're NOTHING
user = null
if(src.allowed(user))
if(src.density)
if(allowed(user) || user.can_advanced_admin_interact())
if(density)
open()
else
close()
else if(src.density)
flick(text("[]deny", src.base_state), src)
else if(density)
flick(text("[]deny", base_state), src)
return
+46 -30
View File
@@ -25,49 +25,51 @@
/*
/obj/machinery/flasher/New()
sleep(4) //<--- What the fuck are you doing? D=
src.sd_set_light(2)
sd_set_light(2)
*/
/obj/machinery/flasher/power_change()
if( powered() )
stat &= ~NOPOWER
icon_state = "[base_state]1"
// src.sd_set_light(2)
// sd_set_light(2)
else
stat |= ~NOPOWER
icon_state = "[base_state]1-p"
// src.sd_set_light(0)
// sd_set_light(0)
//Don't want to render prison breaks impossible
/obj/machinery/flasher/attackby(obj/item/weapon/W as obj, mob/user as mob, params)
if(istype(W, /obj/item/weapon/wirecutters))
add_fingerprint(user)
src.disable = !src.disable
if(src.disable)
disable = !disable
if(disable)
user.visible_message("\red [user] has disconnected the [src]'s flashbulb!", "\red You disconnect the [src]'s flashbulb!")
if(!src.disable)
if(!disable)
user.visible_message("\red [user] has connected the [src]'s flashbulb!", "\red You connect the [src]'s flashbulb!")
//Let the AI trigger them directly.
/obj/machinery/flasher/attack_ai()
if(src.anchored)
return src.flash()
else
return
/obj/machinery/flasher/attack_ai(mob/user)
if(anchored)
return flash()
/obj/machinery/flasher/attack_ghost(mob/user)
if(anchored && user.can_advanced_admin_interact())
return flash()
/obj/machinery/flasher/proc/flash()
if(!(powered()))
return
if((src.disable) || (src.last_flash && world.time < src.last_flash + 150))
if((disable) || (last_flash && world.time < last_flash + 150))
return
playsound(src.loc, 'sound/weapons/flash.ogg', 100, 1)
playsound(loc, 'sound/weapons/flash.ogg', 100, 1)
flick("[base_state]_flash", src)
src.last_flash = world.time
last_flash = world.time
use_power(1000)
for(var/mob/living/L in viewers(src, null))
if(get_dist(src, L) > src.range)
if(get_dist(src, L) > range)
continue
if(L.flash_eyes(affect_silicon = 1))
@@ -85,35 +87,51 @@
..(severity)
/obj/machinery/flasher/portable/HasProximity(atom/movable/AM as mob|obj)
if((src.disable) || (src.last_flash && world.time < src.last_flash + 150))
if((disable) || (last_flash && world.time < last_flash + 150))
return
if(istype(AM, /mob/living/carbon))
var/mob/living/carbon/M = AM
if((M.m_intent != "walk") && (src.anchored))
src.flash()
if((M.m_intent != "walk") && (anchored))
flash()
/obj/machinery/flasher/portable/attackby(obj/item/weapon/W as obj, mob/user as mob, params)
if(istype(W, /obj/item/weapon/wrench))
add_fingerprint(user)
src.anchored = !src.anchored
anchored = !anchored
if(!src.anchored)
if(!anchored)
user.show_message(text("\red [src] can now be moved."))
src.overlays.Cut()
overlays.Cut()
else if(src.anchored)
else if(anchored)
user.show_message(text("\red [src] is now secured."))
src.overlays += "[base_state]-s"
overlays += "[base_state]-s"
// Flasher button
/obj/machinery/flasher_button
name = "flasher button"
desc = "A remote control switch for a mounted flasher."
icon = 'icons/obj/objects.dmi'
icon_state = "launcherbtt"
var/id = null
var/active = 0
anchored = 1.0
use_power = 1
idle_power_usage = 2
active_power_usage = 4
/obj/machinery/flasher_button/attack_ai(mob/user as mob)
return src.attack_hand(user)
return attack_hand(user)
/obj/machinery/flasher_button/attack_ghost(mob/user)
if(user.can_advanced_admin_interact())
return attack_hand(user)
/obj/machinery/flasher_button/attackby(obj/item/weapon/W, mob/user as mob, params)
return src.attack_hand(user)
return attack_hand(user)
/obj/machinery/flasher_button/attack_hand(mob/user as mob)
if(stat & (NOPOWER|BROKEN))
return
if(active)
@@ -125,13 +143,11 @@
icon_state = "launcheract"
for(var/obj/machinery/flasher/M in world)
if(M.id == src.id)
if(M.id == id)
spawn()
M.flash()
sleep(50)
icon_state = "launcherbtt"
active = 0
return
active = 0
+4 -1
View File
@@ -72,8 +72,11 @@
if(..(user, 1))
to_chat(user, "A light switch. It is [on? "on" : "off"].")
/obj/machinery/light_switch/attack_ghost(mob/user)
if(user.can_advanced_admin_interact())
return attack_hand(user)
/obj/machinery/light_switch/attack_hand(mob/user)
on = !on
updateicon()
+258 -255
View File
@@ -27,22 +27,22 @@
//var/page = null //For newspapers
/datum/feed_message/proc/clear()
src.author = ""
src.body = ""
src.backup_body = ""
src.backup_author = ""
src.img = null
src.backup_img = null
author = ""
body = ""
backup_body = ""
backup_author = ""
img = null
backup_img = null
view_count = 0
/datum/feed_channel/proc/clear()
src.channel_name = ""
src.messages = list()
src.locked = 0
src.author = ""
src.backup_author = ""
src.censored = 0
src.is_admin_channel = 0
channel_name = ""
messages = list()
locked = 0
author = ""
backup_author = ""
censored = 0
is_admin_channel = 0
total_view_count = 0
/datum/feed_channel/proc/announce_news()
@@ -113,10 +113,10 @@ var/list/obj/machinery/newscaster/allCasters = list() //Global list that will co
/obj/machinery/newscaster/New() //Constructor, ho~
allCasters += src
src.paper_remaining = 15 // Will probably change this to something better
paper_remaining = 15 // Will probably change this to something better
for(var/obj/machinery/newscaster/NEWSCASTER in allCasters) // Let's give it an appropriate unit number
src.unit_no++
src.update_icon() //for any custom ones on the map...
unit_no++
update_icon() //for any custom ones on the map...
..() //I just realised the newscasters weren't in the global machines list. The superconstructor call will tend to that
/obj/machinery/newscaster/Destroy()
@@ -129,21 +129,21 @@ var/list/obj/machinery/newscaster/allCasters = list() //Global list that will co
if(!ispowered || isbroken)
icon_state = "newscaster_off"
if(isbroken) //If the thing is smashed, add crack overlay on top of the unpowered sprite.
src.overlays.Cut()
src.overlays += image(src.icon, "crack3")
overlays.Cut()
overlays += image(icon, "crack3")
return
src.overlays.Cut() //reset overlays
overlays.Cut() //reset overlays
if(news_network.wanted_issue) //wanted icon state, there can be no overlays on it as it's a priority message
icon_state = "newscaster_wanted"
return
if(alert) //new message alert overlay
src.overlays += "newscaster_alert"
overlays += "newscaster_alert"
if(hitstaken > 0) //Cosmetic damage overlay
src.overlays += image(src.icon, "crack[hitstaken]")
overlays += image(icon, "crack[hitstaken]")
icon_state = "newscaster_normal"
return
@@ -151,15 +151,15 @@ var/list/obj/machinery/newscaster/allCasters = list() //Global list that will co
/obj/machinery/newscaster/power_change()
if(isbroken) //Broken shit can't be powered.
return
if( src.powered() )
src.ispowered = 1
if( powered() )
ispowered = 1
stat &= ~NOPOWER
src.update_icon()
update_icon()
else
spawn(rand(0, 15))
src.ispowered = 0
ispowered = 0
stat |= NOPOWER
src.update_icon()
update_icon()
/obj/machinery/newscaster/ex_act(severity)
@@ -168,36 +168,42 @@ var/list/obj/machinery/newscaster/allCasters = list() //Global list that will co
qdel(src)
return
if(2.0)
src.isbroken=1
isbroken=1
if(prob(50))
qdel(src)
else
src.update_icon() //can't place it above the return and outside the if-else. or we might get runtimes of null.update_icon() if(prob(50)) goes in.
update_icon() //can't place it above the return and outside the if-else. or we might get runtimes of null.update_icon() if(prob(50)) goes in.
return
else
if(prob(50))
src.isbroken=1
src.update_icon()
isbroken=1
update_icon()
return
return
/obj/machinery/newscaster/attack_ai(mob/user as mob)
return src.attack_hand(user)
/obj/machinery/newscaster/attack_ai(mob/user)
return attack_hand(user)
/obj/machinery/newscaster/attack_ghost(mob/user)
return attack_hand(user)
/obj/machinery/newscaster/attack_hand(mob/user as mob) //########### THE MAIN BEEF IS HERE! And in the proc below this...############
if(!src.ispowered || src.isbroken)
/obj/machinery/newscaster/attack_hand(mob/user) //########### THE MAIN BEEF IS HERE! And in the proc below this...############
interact(user)
/obj/machinery/newscaster/interact(mob/user)
if(!ispowered || isbroken)
return
if(istype(user, /mob/living/carbon/human) || istype(user,/mob/living/silicon) )
var/mob/living/human_or_robot_user = user
if(ishuman(user) || issilicon(user) || isobserver(user))
var/dat
dat = text("<HEAD><TITLE>Newscaster</TITLE></HEAD><H3>Newscaster Unit #[src.unit_no]</H3>")
dat = text("<HEAD><TITLE>Newscaster</TITLE></HEAD><H3>Newscaster Unit #[unit_no]</H3>")
src.scan_user(human_or_robot_user) //Newscaster scans you
if(can_scan(user))
scan_user(user) //Newscaster scans you
switch(screen)
if(0)
dat += {"Welcome to Newscasting Unit #[src.unit_no].<BR> Interface & News networks Operational.
dat += {"Welcome to Newscasting Unit #[unit_no].<BR> Interface & News networks Operational.
<BR><FONT SIZE=1>Property of Nanotrasen</FONT>"}
if(news_network.wanted_issue)
dat+= "<HR><A href='?src=[UID()];view_wanted=1'>Read Wanted Issue</A>"
@@ -210,8 +216,8 @@ var/list/obj/machinery/newscaster/allCasters = list() //Global list that will co
else
dat+= "<BR><A href='?src=[UID()];unsilence_unit=1'>Unsilence unit</A>"
dat+= {"<BR><A href='?src=[UID()];refresh=1'>Re-scan User</A>
<BR><BR><A href='?src=[human_or_robot_user.UID()];mach_close=newscaster_main'>Exit</A>"}
if(src.securityCaster)
<BR><BR><A href='?src=[user.UID()];mach_close=newscaster_main'>Exit</A>"}
if(securityCaster)
var/wanted_already = 0
if(news_network.wanted_issue)
wanted_already = 1
@@ -220,7 +226,7 @@ var/list/obj/machinery/newscaster/allCasters = list() //Global list that will co
<BR><A href='?src=[UID()];menu_wanted=1'>[(wanted_already) ? ("Manage") : ("Publish")] \"Wanted\" Issue</A>
<BR><A href='?src=[UID()];menu_censor_story=1'>Censor Feed Stories</A>
<BR><A href='?src=[UID()];menu_censor_channel=1'>Mark Feed Channel with Nanotrasen D-Notice</A>
<BR><HR>The newscaster recognises you as: <FONT COLOR='green'>[src.scanned_user]</FONT>"}
<BR><HR>The newscaster recognises you as: <FONT COLOR='green'>[scanned_user]</FONT>"}
if(1)
dat+= "Station Feed Channels<HR>"
if( isemptylist(news_network.network_channels) )
@@ -231,7 +237,7 @@ var/list/obj/machinery/newscaster/allCasters = list() //Global list that will co
dat+="<B><A href='?src=[UID()];show_channel=\ref[CHANNEL]' style='background-color: #00F53D'>[CHANNEL.channel_name]</A></B><BR>"
else
dat+="<B><A href='?src=[UID()];show_channel=\ref[CHANNEL]'>[CHANNEL.channel_name]</A> [(CHANNEL.censored) ? ("<FONT COLOR='red'>***</FONT>") : ()]<BR></B>"
/*for(var/datum/feed_channel/CHANNEL in src.channel_list)
/*for(var/datum/feed_channel/CHANNEL in channel_list)
dat+="<B>[CHANNEL.channel_name]: </B> <BR><FONT SIZE=1>\[created by: <FONT COLOR='maroon'>[CHANNEL.author]</FONT>\]</FONT><BR><BR>"
if( isemptylist(CHANNEL.messages) )
dat+="<I>No feed messages found in channel...</I><BR><BR>"
@@ -243,30 +249,30 @@ var/list/obj/machinery/newscaster/allCasters = list() //Global list that will co
dat+="<BR><A href='?src=[UID()];setScreen=[0]'>Back</A>"
if(2)
dat+={"Creating new Feed Channel...
<HR><B><A href='?src=[UID()];set_channel_name=1'>Channel Name</A>:</B> [src.channel_name]<BR>
<B>Channel Author:</B> <FONT COLOR='green'>[src.scanned_user]</FONT><BR>
<B><A href='?src=[UID()];set_channel_lock=1'>Will Accept Public Feeds</A>:</B> [(src.c_locked) ? ("NO") : ("YES")]<BR><BR>
<HR><B><A href='?src=[UID()];set_channel_name=1'>Channel Name</A>:</B> [channel_name]<BR>
<B>Channel Author:</B> <FONT COLOR='green'>[scanned_user]</FONT><BR>
<B><A href='?src=[UID()];set_channel_lock=1'>Will Accept Public Feeds</A>:</B> [(c_locked) ? ("NO") : ("YES")]<BR><BR>
<BR><A href='?src=[UID()];submit_new_channel=1'>Submit</A><BR><BR><A href='?src=[UID()];setScreen=[0]'>Cancel</A><BR>"}
if(3)
dat+={"Creating new Feed Message...
<HR><B><A href='?src=[UID()];set_channel_receiving=1'>Receiving Channel</A>:</B> [src.channel_name]<BR>
<B>Message Author:</B> <FONT COLOR='green'>[src.scanned_user]</FONT><BR>
<B><A href='?src=[UID()];set_new_message=1'>Message Body</A>:</B> [src.msg] <BR>
<B><A href='?src=[UID()];set_attachment=1'>Attach Photo</A>:</B> [(src.photo ? "Photo Attached" : "No Photo")]</BR>
<HR><B><A href='?src=[UID()];set_channel_receiving=1'>Receiving Channel</A>:</B> [channel_name]<BR>
<B>Message Author:</B> <FONT COLOR='green'>[scanned_user]</FONT><BR>
<B><A href='?src=[UID()];set_new_message=1'>Message Body</A>:</B> [msg] <BR>
<B><A href='?src=[UID()];set_attachment=1'>Attach Photo</A>:</B> [(photo ? "Photo Attached" : "No Photo")]</BR>
<BR><A href='?src=[UID()];submit_new_message=1'>Submit</A><BR><BR><A href='?src=[UID()];setScreen=[0]'>Cancel</A><BR>"}
if(4)
dat+="Feed story successfully submitted to [src.channel_name].<BR><BR>"
dat+="Feed story successfully submitted to [channel_name].<BR><BR>"
dat+="<BR><A href='?src=[UID()];setScreen=[0]'>Return</A><BR>"
if(5)
dat+="Feed Channel [src.channel_name] created successfully.<BR><BR>"
dat+="Feed Channel [channel_name] created successfully.<BR><BR>"
dat+="<BR><A href='?src=[UID()];setScreen=[0]'>Return</A><BR>"
if(6)
dat+="<B><FONT COLOR='maroon'>ERROR: Could not submit Feed story to Network.</B></FONT><HR><BR>"
if(src.channel_name=="")
if(channel_name=="")
dat+="<FONT COLOR='maroon'>Invalid receiving channel name.</FONT><BR>"
if(src.scanned_user=="Unknown")
if(scanned_user=="Unknown")
dat+="<FONT COLOR='maroon'>Channel author unverified.</FONT><BR>"
if(src.msg == "" || src.msg == "\[REDACTED\]")
if(msg == "" || msg == "\[REDACTED\]")
dat+="<FONT COLOR='maroon'>Invalid message body.</FONT><BR>"
dat+="<BR><A href='?src=[UID()];setScreen=[3]'>Return</A><BR>"
@@ -280,18 +286,18 @@ var/list/obj/machinery/newscaster/allCasters = list() //Global list that will co
existing_authors += FC.backup_author
else
existing_authors += FC.author
if(src.scanned_user in existing_authors)
if(scanned_user in existing_authors)
dat+="<FONT COLOR='maroon'>There already exists a Feed channel under your name.</FONT><BR>"
if(src.channel_name=="" || src.channel_name == "\[REDACTED\]")
if(channel_name=="" || channel_name == "\[REDACTED\]")
dat+="<FONT COLOR='maroon'>Invalid channel name.</FONT><BR>"
var/check = 0
for(var/datum/feed_channel/FC in news_network.network_channels)
if(FC.channel_name == src.channel_name)
if(FC.channel_name == channel_name)
check = 1
break
if(check)
dat+="<FONT COLOR='maroon'>Channel name already in use.</FONT><BR>"
if(src.scanned_user=="Unknown")
if(scanned_user=="Unknown")
dat+="<FONT COLOR='maroon'>Channel author unverified.</FONT><BR>"
dat+="<BR><A href='?src=[UID()];setScreen=[2]'>Return</A><BR>"
if(8)
@@ -304,22 +310,22 @@ var/list/obj/machinery/newscaster/allCasters = list() //Global list that will co
else
active_num--
dat+="Network currently serves a total of [total_num] Feed channels, [active_num] of which are active, and a total of [message_num] Feed Stories." //TODO: CONTINUE
dat+="<BR><BR><B>Liquid Paper remaining:</B> [(src.paper_remaining) *100 ] cm^3"
dat+="<BR><BR><B>Liquid Paper remaining:</B> [(paper_remaining) *100 ] cm^3"
dat+="<BR><BR><A href='?src=[UID()];print_paper=[0]'>Print Paper</A>"
dat+="<BR><A href='?src=[UID()];setScreen=[0]'>Cancel</A>"
if(9)
dat+="<B>[src.viewing_channel.channel_name]: </B><FONT SIZE=1>\[created by: <FONT COLOR='maroon'>[src.viewing_channel.author]</FONT>\]</FONT><BR>"
dat+="<B>[viewing_channel.channel_name]: </B><FONT SIZE=1>\[created by: <FONT COLOR='maroon'>[viewing_channel.author]</FONT>\]</FONT><BR>"
dat+="<FONT SIZE=1><I>Feed view count: [viewing_channel.total_view_count]</I></FONT><HR>"
viewing_channel.total_view_count++
if(src.viewing_channel.censored)
if(viewing_channel.censored)
dat+="<FONT COLOR='red'><B>ATTENTION: </B></FONT>This channel has been deemed as threatening to the welfare of the station, and marked with a Nanotrasen D-Notice.<BR>"
dat+="No further feed story additions are allowed while the D-Notice is in effect.</FONT><BR><BR>"
else
if( isemptylist(src.viewing_channel.messages) )
if( isemptylist(viewing_channel.messages) )
dat+="<I>No feed messages found in channel...</I><BR>"
else
var/i = 0
for(var/datum/feed_message/MESSAGE in src.viewing_channel.messages)
for(var/datum/feed_message/MESSAGE in viewing_channel.messages)
i++
dat+="-[MESSAGE.body] <BR>"
if(MESSAGE.img)
@@ -354,28 +360,28 @@ var/list/obj/machinery/newscaster/allCasters = list() //Global list that will co
dat+="<BR><A href='?src=[UID()];setScreen=[0]'>Back</A>"
if(12)
dat+="<B>[src.viewing_channel.channel_name]: </B><FONT SIZE=1>\[ created by: <FONT COLOR='maroon'>[src.viewing_channel.author]</FONT> \]</FONT><BR>"
dat+="<FONT SIZE=2><A href='?src=[UID()];censor_channel_author=\ref[src.viewing_channel]'>[(src.viewing_channel.author=="\[REDACTED\]") ? ("Undo Author censorship") : ("Censor channel Author")]</A></FONT><HR>"
dat+="<B>[viewing_channel.channel_name]: </B><FONT SIZE=1>\[ created by: <FONT COLOR='maroon'>[viewing_channel.author]</FONT> \]</FONT><BR>"
dat+="<FONT SIZE=2><A href='?src=[UID()];censor_channel_author=\ref[viewing_channel]'>[(viewing_channel.author=="\[REDACTED\]") ? ("Undo Author censorship") : ("Censor channel Author")]</A></FONT><HR>"
if( isemptylist(src.viewing_channel.messages) )
if( isemptylist(viewing_channel.messages) )
dat+="<I>No feed messages found in channel...</I><BR>"
else
for(var/datum/feed_message/MESSAGE in src.viewing_channel.messages)
for(var/datum/feed_message/MESSAGE in viewing_channel.messages)
dat+="-[MESSAGE.body] <BR><FONT SIZE=1>\[[MESSAGE.message_type] by <FONT COLOR='maroon'>[MESSAGE.author]</FONT>\]</FONT><BR>"
dat+="<FONT SIZE=2><A href='?src=[UID()];censor_channel_story_body=\ref[MESSAGE]'>[(MESSAGE.body == "\[REDACTED\]") ? ("Undo story censorship") : ("Censor story")]</A> - <A href='?src=[UID()];censor_channel_story_author=\ref[MESSAGE]'>[(MESSAGE.author == "\[REDACTED\]") ? ("Undo Author Censorship") : ("Censor message Author")]</A></FONT><BR>"
dat+="<BR><A href='?src=[UID()];setScreen=[10]'>Back</A>"
if(13)
dat+="<B>[src.viewing_channel.channel_name]: </B><FONT SIZE=1>\[ created by: <FONT COLOR='maroon'>[src.viewing_channel.author]</FONT> \]</FONT><BR>"
dat+="Channel messages listed below. If you deem them dangerous to the station, you can <A href='?src=[UID()];toggle_d_notice=\ref[src.viewing_channel]'>Bestow a D-Notice upon the channel</A>.<HR>"
if(src.viewing_channel.censored)
dat+="<B>[viewing_channel.channel_name]: </B><FONT SIZE=1>\[ created by: <FONT COLOR='maroon'>[viewing_channel.author]</FONT> \]</FONT><BR>"
dat+="Channel messages listed below. If you deem them dangerous to the station, you can <A href='?src=[UID()];toggle_d_notice=\ref[viewing_channel]'>Bestow a D-Notice upon the channel</A>.<HR>"
if(viewing_channel.censored)
dat+="<FONT COLOR='red'><B>ATTENTION: </B></FONT>This channel has been deemed as threatening to the welfare of the station, and marked with a Nanotrasen D-Notice.<BR>"
dat+="No further feed story additions are allowed while the D-Notice is in effect.</FONT><BR><BR>"
else
if( isemptylist(src.viewing_channel.messages) )
if( isemptylist(viewing_channel.messages) )
dat+="<I>No feed messages found in channel...</I><BR>"
else
for(var/datum/feed_message/MESSAGE in src.viewing_channel.messages)
for(var/datum/feed_message/MESSAGE in viewing_channel.messages)
dat+="-[MESSAGE.body] <BR><FONT SIZE=1>\[[MESSAGE.message_type] by <FONT COLOR='maroon'>[MESSAGE.author]</FONT>\]</FONT><BR>"
dat+="<BR><A href='?src=[UID()];setScreen=[11]'>Back</A>"
@@ -390,27 +396,27 @@ var/list/obj/machinery/newscaster/allCasters = list() //Global list that will co
if(wanted_already)
dat+="<FONT SIZE=2><BR><I>A wanted issue is already in Feed Circulation. You can edit or cancel it below.</FONT></I>"
dat+="<HR>"
dat+="<A href='?src=[UID()];set_wanted_name=1'>Criminal Name</A>: [src.channel_name] <BR>"
dat+="<A href='?src=[UID()];set_wanted_desc=1'>Description</A>: [src.msg] <BR>"
dat+="<A href='?src=[UID()];set_attachment=1'>Attach Photo</A>: [(src.photo ? "Photo Attached" : "No Photo")]</BR>"
dat+="<A href='?src=[UID()];set_wanted_name=1'>Criminal Name</A>: [channel_name] <BR>"
dat+="<A href='?src=[UID()];set_wanted_desc=1'>Description</A>: [msg] <BR>"
dat+="<A href='?src=[UID()];set_attachment=1'>Attach Photo</A>: [(photo ? "Photo Attached" : "No Photo")]</BR>"
if(wanted_already)
dat+="<B>Wanted Issue created by:</B><FONT COLOR='green'> [news_network.wanted_issue.backup_author]</FONT><BR>"
else
dat+="<B>Wanted Issue will be created under prosecutor:</B><FONT COLOR='green'> [src.scanned_user]</FONT><BR>"
dat+="<B>Wanted Issue will be created under prosecutor:</B><FONT COLOR='green'> [scanned_user]</FONT><BR>"
dat+="<BR><A href='?src=[UID()];submit_wanted=[end_param]'>[(wanted_already) ? ("Edit Issue") : ("Submit")]</A>"
if(wanted_already)
dat+="<BR><A href='?src=[UID()];cancel_wanted=1'>Take down Issue</A>"
dat+="<BR><A href='?src=[UID()];setScreen=[0]'>Cancel</A>"
if(15)
dat+="<FONT COLOR='green'>Wanted issue for [src.channel_name] is now in Network Circulation.</FONT><BR><BR>"
dat+="<FONT COLOR='green'>Wanted issue for [channel_name] is now in Network Circulation.</FONT><BR><BR>"
dat+="<BR><A href='?src=[UID()];setScreen=[0]'>Return</A><BR>"
if(16)
dat+="<B><FONT COLOR='maroon'>ERROR: Wanted Issue rejected by Network.</B></FONT><HR><BR>"
if(src.channel_name=="" || src.channel_name == "\[REDACTED\]")
if(channel_name=="" || channel_name == "\[REDACTED\]")
dat+="<FONT COLOR='maroon'>Invalid name for person wanted.</FONT><BR>"
if(src.scanned_user=="Unknown")
if(scanned_user=="Unknown")
dat+="<FONT COLOR='maroon'>Issue author unverified.</FONT><BR>"
if(src.msg == "" || src.msg == "\[REDACTED\]")
if(msg == "" || msg == "\[REDACTED\]")
dat+="<FONT COLOR='maroon'>Invalid description.</FONT><BR>"
dat+="<BR><A href='?src=[UID()];setScreen=[0]'>Return</A><BR>"
if(17)
@@ -428,7 +434,7 @@ var/list/obj/machinery/newscaster/allCasters = list() //Global list that will co
dat+="None"
dat+="<BR><BR><A href='?src=[UID()];setScreen=[0]'>Back</A><BR>"
if(19)
dat+="<FONT COLOR='green'>Wanted issue for [src.channel_name] successfully edited.</FONT><BR><BR>"
dat+="<FONT COLOR='green'>Wanted issue for [channel_name] successfully edited.</FONT><BR><BR>"
dat+="<BR><A href='?src=[UID()];setScreen=[0]'>Return</A><BR>"
if(20)
dat+="<FONT COLOR='green'>Printing successfull. Please receive your newspaper from the bottom of the machine.</FONT><BR><BR>"
@@ -443,32 +449,24 @@ var/list/obj/machinery/newscaster/allCasters = list() //Global list that will co
var/datum/browser/popup = new(user, "newscaster_main", name, 400, 600)
popup.set_content(dat)
popup.open(0)
onclose(human_or_robot_user, "newscaster_main")
/*if(src.isbroken) //debugging shit
return
src.hitstaken++
if(src.hitstaken==3)
src.isbroken = 1
src.update_icon()*/
onclose(user, "newscaster_main")
/obj/machinery/newscaster/Topic(href, href_list)
if(..())
return 1
usr.set_machine(src)
if(href_list["set_channel_name"])
src.channel_name = sanitizeSQL(strip_html_simple(input(usr, "Provide a Feed Channel Name", "Network Channel Handler", "")))
while(findtext(src.channel_name," ") == 1)
src.channel_name = copytext(src.channel_name,2,lentext(src.channel_name)+1)
src.updateUsrDialog()
//src.update_icon()
channel_name = sanitizeSQL(strip_html_simple(input(usr, "Provide a Feed Channel Name", "Network Channel Handler", "")))
while(findtext(channel_name," ") == 1)
channel_name = copytext(channel_name,2,lentext(channel_name)+1)
updateUsrDialog()
//update_icon()
else if(href_list["set_channel_lock"])
src.c_locked = !src.c_locked
src.updateUsrDialog()
//src.update_icon()
c_locked = !c_locked
updateUsrDialog()
//update_icon()
else if(href_list["submit_new_channel"])
//var/list/existing_channels = list() //OBSOLETE
@@ -481,25 +479,25 @@ var/list/obj/machinery/newscaster/allCasters = list() //Global list that will co
existing_authors +=FC.author
var/check = 0
for(var/datum/feed_channel/FC in news_network.network_channels)
if(FC.channel_name == src.channel_name)
if(FC.channel_name == channel_name)
check = 1
break
if(src.channel_name == "" || src.channel_name == "\[REDACTED\]" || src.scanned_user == "Unknown" || check || (src.scanned_user in existing_authors) )
src.screen=7
if(channel_name == "" || channel_name == "\[REDACTED\]" || scanned_user == "Unknown" || check || (scanned_user in existing_authors) )
screen=7
else
var/choice = alert("Please confirm Feed channel creation","Network Channel Handler","Confirm","Cancel")
if(choice=="Confirm")
var/datum/feed_channel/newChannel = new /datum/feed_channel
newChannel.channel_name = src.channel_name
newChannel.author = src.scanned_user
newChannel.channel_name = channel_name
newChannel.author = scanned_user
newChannel.locked = c_locked
feedback_inc("newscaster_channels",1)
/*for(var/obj/machinery/newscaster/NEWSCASTER in allCasters) //Let's add the new channel in all casters.
NEWSCASTER.channel_list += newChannel*/ //Now that it is sane, get it into the list. -OBSOLETE
news_network.network_channels += newChannel //Adding channel to the global network
src.screen=5
src.updateUsrDialog()
//src.update_icon()
screen=5
updateUsrDialog()
//update_icon()
else if(href_list["set_channel_receiving"])
//var/list/datum/feed_channel/available_channels = list()
@@ -507,59 +505,59 @@ var/list/obj/machinery/newscaster/allCasters = list() //Global list that will co
for(var/datum/feed_channel/F in news_network.network_channels)
if( (!F.locked || F.author == scanned_user) && !F.censored)
available_channels += F.channel_name
src.channel_name = strip_html_simple(input(usr, "Choose receiving Feed Channel", "Network Channel Handler") in available_channels )
src.updateUsrDialog()
channel_name = strip_html_simple(input(usr, "Choose receiving Feed Channel", "Network Channel Handler") in available_channels )
updateUsrDialog()
else if(href_list["set_new_message"])
src.msg = strip_html(input(usr, "Write your feed story", "Network Channel Handler", ""))
while(findtext(src.msg," ") == 1)
src.msg = copytext(src.msg,2,lentext(src.msg)+1)
src.updateUsrDialog()
msg = strip_html(input(usr, "Write your feed story", "Network Channel Handler", ""))
while(findtext(msg," ") == 1)
msg = copytext(msg,2,lentext(msg)+1)
updateUsrDialog()
else if(href_list["set_attachment"])
AttachPhoto(usr)
src.updateUsrDialog()
updateUsrDialog()
else if(href_list["submit_new_message"])
if(src.msg =="" || src.msg=="\[REDACTED\]" || src.scanned_user == "Unknown" || src.channel_name == "" )
src.screen=6
if(msg =="" || msg=="\[REDACTED\]" || scanned_user == "Unknown" || channel_name == "" )
screen=6
else
var/datum/feed_message/newMsg = new /datum/feed_message
newMsg.author = src.scanned_user
newMsg.body = src.msg
newMsg.author = scanned_user
newMsg.body = msg
if(photo)
newMsg.img = photo.img
feedback_inc("newscaster_stories",1)
var/announcement = ""
for(var/datum/feed_channel/FC in news_network.network_channels)
if(FC.channel_name == src.channel_name)
if(FC.channel_name == channel_name)
FC.messages += newMsg //Adding message to the network's appropriate feed_channel
announcement = FC.announce_news()
break
src.screen=4
screen=4
for(var/obj/machinery/newscaster/NEWSCASTER in allCasters)
NEWSCASTER.newsAlert(announcement)
src.updateUsrDialog()
updateUsrDialog()
else if(href_list["create_channel"])
src.screen=2
src.updateUsrDialog()
screen=2
updateUsrDialog()
else if(href_list["create_feed_story"])
src.screen=3
src.updateUsrDialog()
screen=3
updateUsrDialog()
else if(href_list["menu_paper"])
src.screen=8
src.updateUsrDialog()
screen=8
updateUsrDialog()
else if(href_list["print_paper"])
if(!src.paper_remaining)
src.screen=21
if(!paper_remaining)
screen=21
else
src.print_paper()
src.screen = 20
src.updateUsrDialog()
print_paper()
screen = 20
updateUsrDialog()
else if(href_list["silence_unit"])
silence=1
@@ -570,12 +568,12 @@ var/list/obj/machinery/newscaster/allCasters = list() //Global list that will co
updateUsrDialog()
else if(href_list["menu_censor_story"])
src.screen=10
src.updateUsrDialog()
screen=10
updateUsrDialog()
else if(href_list["menu_censor_channel"])
src.screen=11
src.updateUsrDialog()
screen=11
updateUsrDialog()
else if(href_list["menu_wanted"])
var/already_wanted = 0
@@ -583,54 +581,54 @@ var/list/obj/machinery/newscaster/allCasters = list() //Global list that will co
already_wanted = 1
if(already_wanted)
src.channel_name = news_network.wanted_issue.author
src.msg = news_network.wanted_issue.body
src.screen = 14
src.updateUsrDialog()
channel_name = news_network.wanted_issue.author
msg = news_network.wanted_issue.body
screen = 14
updateUsrDialog()
else if(href_list["set_wanted_name"])
src.channel_name = strip_html(input(usr, "Provide the name of the Wanted person", "Network Security Handler", ""))
while(findtext(src.channel_name," ") == 1)
src.channel_name = copytext(src.channel_name,2,lentext(src.channel_name)+1)
src.updateUsrDialog()
channel_name = strip_html(input(usr, "Provide the name of the Wanted person", "Network Security Handler", ""))
while(findtext(channel_name," ") == 1)
channel_name = copytext(channel_name,2,lentext(channel_name)+1)
updateUsrDialog()
else if(href_list["set_wanted_desc"])
src.msg = strip_html(input(usr, "Provide the a description of the Wanted person and any other details you deem important", "Network Security Handler", ""))
while(findtext(src.msg," ") == 1)
src.msg = copytext(src.msg,2,lentext(src.msg)+1)
src.updateUsrDialog()
msg = strip_html(input(usr, "Provide the a description of the Wanted person and any other details you deem important", "Network Security Handler", ""))
while(findtext(msg," ") == 1)
msg = copytext(msg,2,lentext(msg)+1)
updateUsrDialog()
else if(href_list["submit_wanted"])
var/input_param = text2num(href_list["submit_wanted"])
if(src.msg == "" || src.channel_name == "" || src.scanned_user == "Unknown")
src.screen = 16
if(msg == "" || channel_name == "" || scanned_user == "Unknown")
screen = 16
else
var/choice = alert("Please confirm Wanted Issue [(input_param==1) ? ("creation.") : ("edit.")]","Network Security Handler","Confirm","Cancel")
if(choice=="Confirm")
if(input_param==1) //If input_param == 1 we're submitting a new wanted issue. At 2 we're just editing an existing one. See the else below
var/datum/feed_message/WANTED = new /datum/feed_message
WANTED.author = src.channel_name
WANTED.body = src.msg
WANTED.backup_author = src.scanned_user //I know, a bit wacky
WANTED.author = channel_name
WANTED.body = msg
WANTED.backup_author = scanned_user //I know, a bit wacky
if(photo)
WANTED.img = photo.img
news_network.wanted_issue = WANTED
for(var/obj/machinery/newscaster/NEWSCASTER in allCasters)
NEWSCASTER.newsAlert()
NEWSCASTER.update_icon()
src.screen = 15
screen = 15
else
if(news_network.wanted_issue.is_admin_message)
alert("The wanted issue has been distributed by a Nanotrasen higherup. You cannot edit it.","Ok")
return
news_network.wanted_issue.author = src.channel_name
news_network.wanted_issue.body = src.msg
news_network.wanted_issue.backup_author = src.scanned_user
news_network.wanted_issue.author = channel_name
news_network.wanted_issue.body = msg
news_network.wanted_issue.backup_author = scanned_user
if(photo)
news_network.wanted_issue.img = photo.img
src.screen = 19
screen = 19
src.updateUsrDialog()
updateUsrDialog()
else if(href_list["cancel_wanted"])
if(news_network.wanted_issue.is_admin_message)
@@ -641,12 +639,12 @@ var/list/obj/machinery/newscaster/allCasters = list() //Global list that will co
news_network.wanted_issue = null
for(var/obj/machinery/newscaster/NEWSCASTER in allCasters)
NEWSCASTER.update_icon()
src.screen=17
src.updateUsrDialog()
screen=17
updateUsrDialog()
else if(href_list["view_wanted"])
src.screen=18
src.updateUsrDialog()
screen=18
updateUsrDialog()
else if(href_list["censor_channel_author"])
var/datum/feed_channel/FC = locate(href_list["censor_channel_author"])
if(FC.is_admin_channel)
@@ -657,7 +655,7 @@ var/list/obj/machinery/newscaster/allCasters = list() //Global list that will co
FC.author = "<B>\[REDACTED\]</B>"
else
FC.author = FC.backup_author
src.updateUsrDialog()
updateUsrDialog()
else if(href_list["censor_channel_story_author"])
var/datum/feed_message/MSG = locate(href_list["censor_channel_story_author"])
@@ -669,7 +667,7 @@ var/list/obj/machinery/newscaster/allCasters = list() //Global list that will co
MSG.author = "<B>\[REDACTED\]</B>"
else
MSG.author = MSG.backup_author
src.updateUsrDialog()
updateUsrDialog()
else if(href_list["censor_channel_story_body"])
var/datum/feed_message/MSG = locate(href_list["censor_channel_story_body"])
@@ -686,13 +684,13 @@ var/list/obj/machinery/newscaster/allCasters = list() //Global list that will co
MSG.body = "<B>\[REDACTED\]</B>"
else
MSG.body = MSG.backup_body
src.updateUsrDialog()
updateUsrDialog()
else if(href_list["pick_d_notice"])
var/datum/feed_channel/FC = locate(href_list["pick_d_notice"])
src.viewing_channel = FC
src.screen=13
src.updateUsrDialog()
viewing_channel = FC
screen=13
updateUsrDialog()
else if(href_list["toggle_d_notice"])
var/datum/feed_channel/FC = locate(href_list["toggle_d_notice"])
@@ -700,75 +698,75 @@ var/list/obj/machinery/newscaster/allCasters = list() //Global list that will co
alert("This channel was created by a Nanotrasen Officer. You cannot place a D-Notice upon it.","Ok")
return
FC.censored = !FC.censored
src.updateUsrDialog()
updateUsrDialog()
else if(href_list["view"])
src.screen=1
src.updateUsrDialog()
screen=1
updateUsrDialog()
else if(href_list["setScreen"]) //Brings us to the main menu and resets all fields~
src.screen = text2num(href_list["setScreen"])
if(src.screen == 0)
src.scanned_user = "Unknown";
screen = text2num(href_list["setScreen"])
if(screen == 0)
scanned_user = "Unknown";
msg = "";
src.c_locked=0;
c_locked=0;
channel_name="";
src.viewing_channel = null
src.updateUsrDialog()
viewing_channel = null
updateUsrDialog()
else if(href_list["show_channel"])
var/datum/feed_channel/FC = locate(href_list["show_channel"])
src.viewing_channel = FC
src.screen = 9
src.updateUsrDialog()
viewing_channel = FC
screen = 9
updateUsrDialog()
else if(href_list["pick_censor_channel"])
var/datum/feed_channel/FC = locate(href_list["pick_censor_channel"])
src.viewing_channel = FC
src.screen = 12
src.updateUsrDialog()
viewing_channel = FC
screen = 12
updateUsrDialog()
else if(href_list["refresh"])
src.updateUsrDialog()
updateUsrDialog()
/obj/machinery/newscaster/attackby(obj/item/I as obj, mob/living/user as mob, params)
if(istype(I, /obj/item/weapon/wrench))
to_chat(user, "<span class='notice'>Now [anchored ? "un" : ""]securing [name]</span>")
playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1)
playsound(loc, 'sound/items/Ratchet.ogg', 50, 1)
if(do_after(user, 60, target = src))
new /obj/item/mounted/frame/newscaster_frame(loc)
playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1)
playsound(loc, 'sound/items/Deconstruct.ogg', 50, 1)
qdel(src)
return
if(isbroken)
playsound(src.loc, 'sound/effects/hit_on_shattered_glass.ogg', 100, 1)
visible_message("<span class='danger'>[user.name] further abuses the shattered [src.name].</span>", null, 5 )
playsound(loc, 'sound/effects/hit_on_shattered_glass.ogg', 100, 1)
visible_message("<span class='danger'>[user.name] further abuses the shattered [name].</span>", null, 5 )
else
if(istype(I, /obj/item/weapon) )
var/obj/item/weapon/W = I
if(W.damtype == STAMINA)
return
if(W.force <15)
visible_message("<span class='danger'>[user.name] hits the [src.name] with the [W.name] with no visible effect.</span>", null , 5 )
playsound(src.loc, 'sound/effects/Glasshit.ogg', 100, 1)
visible_message("<span class='danger'>[user.name] hits the [name] with the [W.name] with no visible effect.</span>", null , 5 )
playsound(loc, 'sound/effects/Glasshit.ogg', 100, 1)
else
hitstaken++
if(hitstaken==3)
visible_message("<span class='danger'>[user.name] smashes the [src.name]!</span>", null, 5 )
visible_message("<span class='danger'>[user.name] smashes the [name]!</span>", null, 5 )
isbroken=1
playsound(src.loc, 'sound/effects/Glassbr3.ogg', 100, 1)
playsound(loc, 'sound/effects/Glassbr3.ogg', 100, 1)
else
visible_message("<span class='danger'>[user.name] forcefully slams the [src.name] with the [I.name]!</span>", null, 5 )
playsound(src.loc, 'sound/effects/Glasshit.ogg', 100, 1)
visible_message("<span class='danger'>[user.name] forcefully slams the [name] with the [I.name]!</span>", null, 5 )
playsound(loc, 'sound/effects/Glasshit.ogg', 100, 1)
else
to_chat(user, "<FONT COLOR='blue'>This does nothing.</FONT>")
src.update_icon()
update_icon()
/obj/machinery/newscaster/proc/AttachPhoto(mob/user as mob)
if(photo)
if(!issilicon(user))
photo.loc = src.loc
photo.loc = loc
user.put_in_inactive_hand(photo)
photo = null
if(istype(user.get_active_hand(), /obj/item/weapon/photo))
@@ -813,34 +811,34 @@ var/list/obj/machinery/newscaster/allCasters = list() //Global list that will co
if(ishuman(user))
var/mob/living/carbon/human/human_user = user
var/dat
src.pages = 0
pages = 0
switch(screen)
if(0) //Cover
dat+="<DIV ALIGN='center'><B><FONT SIZE=6>The Griffon</FONT></B></div>"
dat+="<DIV ALIGN='center'><FONT SIZE=2>Nanotrasen-standard newspaper, for use on Nanotrasen Space Facilities</FONT></div><HR>"
if(isemptylist(src.news_content))
if(src.important_message)
dat+="Contents:<BR><ul><B><FONT COLOR='red'>**</FONT>Important Security Announcement<FONT COLOR='red'>**</FONT></B> <FONT SIZE=2>\[page [src.pages+2]\]</FONT><BR></ul>"
if(isemptylist(news_content))
if(important_message)
dat+="Contents:<BR><ul><B><FONT COLOR='red'>**</FONT>Important Security Announcement<FONT COLOR='red'>**</FONT></B> <FONT SIZE=2>\[page [pages+2]\]</FONT><BR></ul>"
else
dat+="<I>Other than the title, the rest of the newspaper is unprinted...</I>"
else
dat+="Contents:<BR><ul>"
for(var/datum/feed_channel/NP in src.news_content)
src.pages++
if(src.important_message)
dat+="<B><FONT COLOR='red'>**</FONT>Important Security Announcement<FONT COLOR='red'>**</FONT></B> <FONT SIZE=2>\[page [src.pages+2]\]</FONT><BR>"
for(var/datum/feed_channel/NP in news_content)
pages++
if(important_message)
dat+="<B><FONT COLOR='red'>**</FONT>Important Security Announcement<FONT COLOR='red'>**</FONT></B> <FONT SIZE=2>\[page [pages+2]\]</FONT><BR>"
var/temp_page=0
for(var/datum/feed_channel/NP in src.news_content)
for(var/datum/feed_channel/NP in news_content)
temp_page++
dat+="<B>[NP.channel_name]</B> <FONT SIZE=2>\[page [temp_page+1]\]</FONT><BR>"
dat+="</ul>"
if(scribble_page==curr_page)
dat+="<BR><I>There is a small scribble near the end of this page... It reads: \"[src.scribble]\"</I>"
dat+="<BR><I>There is a small scribble near the end of this page... It reads: \"[scribble]\"</I>"
dat+= "<HR><DIV STYLE='float:right;'><A href='?src=[UID()];next_page=1'>Next Page</A></DIV> <div style='float:left;'><A href='?src=[human_user.UID()];mach_close=newspaper_main'>Done reading</A></DIV>"
if(1) // X channel pages inbetween.
for(var/datum/feed_channel/NP in src.news_content)
src.pages++ //Let's get it right again.
var/datum/feed_channel/C = src.news_content[src.curr_page]
for(var/datum/feed_channel/NP in news_content)
pages++ //Let's get it right again.
var/datum/feed_channel/C = news_content[curr_page]
dat+="<FONT SIZE=4><B>[C.channel_name]</B></FONT><FONT SIZE=1> \[created by: <FONT COLOR='maroon'>[C.author]</FONT>\]</FONT><BR><BR>"
if(C.censored)
dat+="This channel was deemed dangerous to the general welfare of the station and therefore marked with a <B><FONT COLOR='red'>D-Notice</B></FONT>. Its contents were not transferred to the newspaper at the time of printing."
@@ -859,12 +857,12 @@ var/list/obj/machinery/newscaster/allCasters = list() //Global list that will co
dat+="<FONT SIZE=1>\[Story by <FONT COLOR='maroon'>[MESSAGE.author]</FONT>\]</FONT><BR><BR>"
dat+="</ul>"
if(scribble_page==curr_page)
dat+="<BR><I>There is a small scribble near the end of this page... It reads: \"[src.scribble]\"</I>"
dat+="<BR><I>There is a small scribble near the end of this page... It reads: \"[scribble]\"</I>"
dat+= "<BR><HR><DIV STYLE='float:left;'><A href='?src=[UID()];prev_page=1'>Previous Page</A></DIV> <DIV STYLE='float:right;'><A href='?src=[UID()];next_page=1'>Next Page</A></DIV>"
if(2) //Last page
for(var/datum/feed_channel/NP in src.news_content)
src.pages++
if(src.important_message!=null)
for(var/datum/feed_channel/NP in news_content)
pages++
if(important_message!=null)
dat+="<DIV STYLE='float:center;'><FONT SIZE=4><B>Wanted Issue:</B></FONT SIZE></DIV><BR><BR>"
dat+="<B>Criminal name</B>: <FONT COLOR='maroon'>[important_message.author]</FONT><BR>"
dat+="<B>Description</B>: [important_message.body]<BR>"
@@ -877,91 +875,96 @@ var/list/obj/machinery/newscaster/allCasters = list() //Global list that will co
else
dat+="<I>Apart from some uninteresting Classified ads, there's nothing on this page...</I>"
if(scribble_page==curr_page)
dat+="<BR><I>There is a small scribble near the end of this page... It reads: \"[src.scribble]\"</I>"
dat+="<BR><I>There is a small scribble near the end of this page... It reads: \"[scribble]\"</I>"
dat+= "<HR><DIV STYLE='float:left;'><A href='?src=[UID()];prev_page=1'>Previous Page</A></DIV>"
else
dat+="I'm sorry to break your immersion. This shit's bugged. Report this bug to Agouri, polyxenitopalidou@gmail.com"
dat+="<BR><HR><div align='center'>[src.curr_page+1]</div>"
dat+="<BR><HR><div align='center'>[curr_page+1]</div>"
human_user << browse(dat, "window=newspaper_main;size=300x400")
onclose(human_user, "newspaper_main")
else
to_chat(user, "The paper is full of intelligible symbols!")
obj/item/weapon/newspaper/Topic(href, href_list)
/obj/item/weapon/newspaper/Topic(href, href_list)
var/mob/living/U = usr
..()
if((src in U.contents) || ( istype(loc, /turf) && in_range(src, U) ))
U.set_machine(src)
if(href_list["next_page"])
if(curr_page==src.pages+1)
if(curr_page==pages+1)
return //Don't need that at all, but anyway.
if(src.curr_page == src.pages) //We're at the middle, get to the end
src.screen = 2
if(curr_page == pages) //We're at the middle, get to the end
screen = 2
else
if(curr_page == 0) //We're at the start, get to the middle
src.screen=1
src.curr_page++
playsound(src.loc, "pageturn", 50, 1)
screen=1
curr_page++
playsound(loc, "pageturn", 50, 1)
else if(href_list["prev_page"])
if(curr_page == 0)
return
if(curr_page == 1)
src.screen = 0
screen = 0
else
if(curr_page == src.pages+1) //we're at the end, let's go back to the middle.
src.screen = 1
src.curr_page--
playsound(src.loc, "pageturn", 50, 1)
if(curr_page == pages+1) //we're at the end, let's go back to the middle.
screen = 1
curr_page--
playsound(loc, "pageturn", 50, 1)
if(istype(src.loc, /mob))
src.attack_self(src.loc)
if(istype(loc, /mob))
attack_self(loc)
obj/item/weapon/newspaper/attackby(obj/item/weapon/W as obj, mob/user as mob, params)
/obj/item/weapon/newspaper/attackby(obj/item/weapon/W as obj, mob/user as mob, params)
if(istype(W, /obj/item/weapon/pen))
if(src.scribble_page == src.curr_page)
if(scribble_page == curr_page)
to_chat(user, "<FONT COLOR='blue'>There's already a scribble in this page... You wouldn't want to make things too cluttered, would you?</FONT>")
else
var/s = strip_html( input(user, "Write something", "Newspaper", "") )
s = sanitize(copytext(s, 1, MAX_MESSAGE_LEN))
if(!s)
return
if(!in_range(src, usr) && src.loc != usr)
if(!in_range(src, usr) && loc != usr)
return
src.scribble_page = src.curr_page
src.scribble = s
src.attack_self(user)
scribble_page = curr_page
scribble = s
attack_self(user)
return
////////////////////////////////////helper procs
/obj/machinery/newscaster/proc/scan_user(mob/living/user as mob)
if(istype(user,/mob/living/carbon/human)) //User is a human
/obj/machinery/newscaster/proc/scan_user(mob/user as mob)
if(ishuman(user)) //User is a human
var/mob/living/carbon/human/human_user = user
if(human_user.wear_id) //Newscaster scans you
if(istype(human_user.wear_id, /obj/item/device/pda) ) //autorecognition, woo!
var/obj/item/device/pda/P = human_user.wear_id
if(P.id)
src.scanned_user = "[P.id.registered_name] ([P.id.assignment])"
scanned_user = "[P.id.registered_name] ([P.id.assignment])"
else
src.scanned_user = "Unknown"
scanned_user = "Unknown"
else if(istype(human_user.wear_id, /obj/item/weapon/card/id) )
var/obj/item/weapon/card/id/ID = human_user.wear_id
src.scanned_user ="[ID.registered_name] ([ID.assignment])"
scanned_user ="[ID.registered_name] ([ID.assignment])"
else
src.scanned_user ="Unknown"
scanned_user = "Unknown"
else
src.scanned_user ="Unknown"
else
scanned_user = "Unknown"
else if(issilicon(user))
var/mob/living/silicon/ai_user = user
src.scanned_user = "[ai_user.name] ([ai_user.job])"
scanned_user = "[ai_user.name] ([ai_user.job])"
else
scanned_user = "Unknown"
/obj/machinery/newscaster/proc/can_scan(mob/user as mob)
if(ishuman(user) || issilicon(user))
. = TRUE
. = FALSE
/obj/machinery/newscaster/proc/print_paper()
feedback_inc("newscaster_newspapers_printed",1)
@@ -971,7 +974,7 @@ obj/item/weapon/newspaper/attackby(obj/item/weapon/W as obj, mob/user as mob, pa
if(news_network.wanted_issue)
NEWSPAPER.important_message = news_network.wanted_issue
NEWSPAPER.loc = get_turf(src)
src.paper_remaining--
paper_remaining--
return
//Removed for now so these aren't even checked every tick. Left this here in-case Agouri needs it later.
@@ -982,14 +985,14 @@ obj/item/weapon/newspaper/attackby(obj/item/weapon/W as obj, mob/user as mob, pa
if(news_call)
atom_say("[news_call]!")
src.alert = 1
src.update_icon()
alert = 1
update_icon()
spawn(300)
src.alert = 0
src.update_icon()
alert = 0
update_icon()
if(!silence)
playsound(src.loc, 'sound/machines/twobeep.ogg', 75, 1)
playsound(loc, 'sound/machines/twobeep.ogg', 75, 1)
else
atom_say("Attention! Wanted issue distributed!")
playsound(src.loc, 'sound/machines/warning-buzzer.ogg', 75, 1)
playsound(loc, 'sound/machines/warning-buzzer.ogg', 75, 1)
return
+75 -82
View File
@@ -7,9 +7,16 @@
var/unwrenched = 0
var/wait = 0
/obj/machinery/pipedispenser/attack_hand(user as mob)
/obj/machinery/pipedispenser/attack_hand(mob/user)
if(..())
return
return 1
interact(user)
/obj/machinery/pipedispenser/attack_ghost(mob/user)
interact(user)
/obj/machinery/pipedispenser/interact(mob/user)
var/dat = {"
<b>Regular pipes:</b><BR>
<A href='?src=[UID()];make=0;dir=1'>Pipe</A><BR>
@@ -65,21 +72,19 @@
popup.set_content(dat)
popup.open(0)
onclose(user, "pipedispenser")
return
/obj/machinery/pipedispenser/Topic(href, href_list)
if(..())
return
if(unwrenched || !usr.canmove || usr.stat || usr.restrained() || !in_range(loc, usr))
usr << browse(null, "window=pipedispenser")
return
if(..() || unwrenched)
return 1
usr.set_machine(src)
src.add_fingerprint(usr)
add_fingerprint(usr)
if(href_list["make"])
if(!wait)
var/p_type = text2num(href_list["make"])
var/p_dir = text2num(href_list["dir"])
var/obj/item/pipe/P = new (/*usr.loc*/ src.loc, pipe_type=p_type, dir=p_dir)
var/obj/item/pipe/P = new (loc, pipe_type=p_type, dir=p_dir)
P.update()
P.add_fingerprint(usr)
wait = 1
@@ -87,50 +92,49 @@
wait = 0
if(href_list["makemeter"])
if(!wait)
new /obj/item/pipe_meter(/*usr.loc*/ src.loc)
new /obj/item/pipe_meter(loc)
wait = 1
spawn(15)
wait = 0
if(href_list["makegsensor"])
if(!wait)
new /obj/item/pipe_gsensor(/*usr.loc*/ src.loc)
new /obj/item/pipe_gsensor(loc)
wait = 1
spawn(15)
wait = 0
return
/obj/machinery/pipedispenser/attackby(var/obj/item/W as obj, var/mob/user as mob, params)
src.add_fingerprint(usr)
add_fingerprint(usr)
if(istype(W, /obj/item/pipe) || istype(W, /obj/item/pipe_meter) || istype(W, /obj/item/pipe_gsensor))
to_chat(usr, "\blue You put [W] back to [src].")
to_chat(usr, "<span class='notice'>You put [W] back to [src].</span>")
user.drop_item()
qdel(W)
return
else if(istype(W, /obj/item/weapon/wrench))
if(unwrenched==0)
playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1)
to_chat(user, "\blue You begin to unfasten \the [src] from the floor...")
playsound(loc, 'sound/items/Ratchet.ogg', 50, 1)
to_chat(user, "<span class='notice'>You begin to unfasten \the [src] from the floor...</span>")
if(do_after(user, 40, target = src))
user.visible_message( \
"[user] unfastens \the [src].", \
"\blue You have unfastened \the [src]. Now it can be pulled somewhere else.", \
"<span class='notice'>You have unfastened \the [src]. Now it can be pulled somewhere else.</span>", \
"You hear ratchet.")
src.anchored = 0
src.stat |= MAINT
src.unwrenched = 1
anchored = 0
stat |= MAINT
unwrenched = 1
if(usr.machine==src)
usr << browse(null, "window=pipedispenser")
else /*if(unwrenched==1)*/
playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1)
to_chat(user, "\blue You begin to fasten \the [src] to the floor...")
playsound(loc, 'sound/items/Ratchet.ogg', 50, 1)
to_chat(user, "<span class='notice'>You begin to fasten \the [src] to the floor...</span>")
if(do_after(user, 20, target = src))
user.visible_message( \
"[user] fastens \the [src].", \
"\blue You have fastened \the [src]. Now it can dispense pipes.", \
"<span class='notice'>You have fastened \the [src]. Now it can dispense pipes.</span>", \
"You hear ratchet.")
src.anchored = 1
src.stat &= ~MAINT
src.unwrenched = 0
anchored = 1
stat &= ~MAINT
unwrenched = 0
power_change()
else
return ..()
@@ -143,21 +147,12 @@
density = 1
anchored = 1.0
/*
//Allow you to push disposal pipes into it (for those with density 1)
/obj/machinery/pipedispenser/disposal/Crossed(var/obj/structure/disposalconstruct/pipe as obj)
if(istype(pipe) && !pipe.anchored)
qdel(pipe)
Nah
*/
//Allow you to drag-drop disposal pipes into it
/obj/machinery/pipedispenser/disposal/MouseDrop_T(var/obj/structure/disposalconstruct/pipe as obj, mob/usr as mob)
if(!usr.canmove || usr.stat || usr.restrained())
/obj/machinery/pipedispenser/disposal/MouseDrop_T(var/obj/structure/disposalconstruct/pipe, mob/usr)
if(usr.incapacitated())
return
if(!istype(pipe) || get_dist(usr, src) > 1 || get_dist(src,pipe) > 1 )
if(!istype(pipe) || get_dist(usr, src) > 1 || get_dist(src, pipe) > 1 )
return
if(pipe.anchored)
@@ -165,10 +160,16 @@ Nah
qdel(pipe)
/obj/machinery/pipedispenser/disposal/attack_hand(user as mob)
/obj/machinery/pipedispenser/disposal/attack_hand(mob/user)
if(..())
return
interact(user)
/obj/machinery/pipedispenser/disposal/attack_ghost(mob/user)
interact(user)
/obj/machinery/pipedispenser/disposal/interact(mob/user)
var/dat = {"<b>Disposal Pipes</b><br><br>
<A href='?src=[UID()];dmake=0'>Pipe</A><BR>
<A href='?src=[UID()];dmake=1'>Bent Pipe</A><BR>
@@ -183,47 +184,39 @@ Nah
var/datum/browser/popup = new(user, "pipedispenser", name, 400, 400)
popup.set_content(dat)
popup.open()
return
// 0=straight, 1=bent, 2=junction-j1, 3=junction-j2, 4=junction-y, 5=trunk
/obj/machinery/pipedispenser/disposal/Topic(href, href_list)
if(..())
return
usr.set_machine(src)
src.add_fingerprint(usr)
if(href_list["dmake"])
if(unwrenched || !usr.canmove || usr.stat || usr.restrained() || !in_range(loc, usr))
usr << browse(null, "window=pipedispenser")
return
if(!wait)
var/p_type = text2num(href_list["dmake"])
var/obj/structure/disposalconstruct/C = new (src.loc)
switch(p_type)
if(0)
C.ptype = 0
if(1)
C.ptype = 1
if(2)
C.ptype = 2
if(3)
C.ptype = 4
if(4)
C.ptype = 5
if(5)
C.ptype = 6
C.density = 1
if(6)
C.ptype = 7
C.density = 1
if(7)
C.ptype = 8
C.density = 1
C.add_fingerprint(usr)
C.update()
wait = 1
spawn(15)
wait = 0
return
if(..() || unwrenched)
return 1
usr.set_machine(src)
add_fingerprint(usr)
if(!wait)
var/p_type = text2num(href_list["dmake"])
var/obj/structure/disposalconstruct/C = new (loc)
switch(p_type)
if(0)
C.ptype = 0
if(1)
C.ptype = 1
if(2)
C.ptype = 2
if(3)
C.ptype = 4
if(4)
C.ptype = 5
if(5)
C.ptype = 6
C.density = 1
if(6)
C.ptype = 7
C.density = 1
if(7)
C.ptype = 8
C.density = 1
C.add_fingerprint(usr)
C.update()
wait = 1
spawn(15)
wait = 0
+71 -67
View File
@@ -389,10 +389,13 @@
T.time = worldtime2text()
vendor_account.transaction_log.Add(T)
/obj/machinery/vending/attack_ai(mob/user as mob)
/obj/machinery/vending/attack_ai(mob/user)
return attack_hand(user)
/obj/machinery/vending/attack_ghost(mob/user)
return attack_hand(user)
/obj/machinery/vending/attack_hand(mob/user as mob)
/obj/machinery/vending/attack_hand(mob/user)
if(stat & (BROKEN|NOPOWER))
return
@@ -465,7 +468,7 @@
usr.put_in_hands(coin)
coin = null
to_chat(usr, "\blue You remove the [coin] from the [src]")
to_chat(usr, "<span class='notice'>You remove [coin] from [src].</span>")
categories &= ~CAT_COIN
if(href_list["pay"])
@@ -479,76 +482,77 @@
else if(istype(usr.get_active_hand(), /obj/item/weapon/card))
paid = pay_with_card(usr.get_active_hand())
handled = 1
else if(usr.can_admin_interact())
paid = 1
handled = 1
if(paid)
src.vend(currently_vending, usr)
vend(currently_vending, usr)
return
else if(handled)
nanomanager.update_uis(src)
return // don't smack that machine with your 2 credits
if((usr.contents.Find(src) || (in_range(src, usr) && istype(src.loc, /turf))))
if((href_list["vend"]) && (src.vend_ready) && (!currently_vending))
if((href_list["vend"]) && vend_ready && !currently_vending)
if(issilicon(usr) && !isrobot(usr))
to_chat(usr, "<span class=warning>The vending machine refuses to interface with you, as you are not in its target demographic!</span>")
return
if(issilicon(usr) && !isrobot(usr))
to_chat(usr, "<span class=warning>The vending machine refuses to interface with you, as you are not in its target demographic!</span>")
return
if((!allowed(usr)) && !emagged && scan_id) //For SECURE VENDING MACHINES YEAH
to_chat(usr, "<span class='warning'>Access denied.</span>")//Unless emagged of course
if((!allowed(usr) && !usr.can_admin_interact()) && !emagged && scan_id) //For SECURE VENDING MACHINES YEAH
to_chat(usr, "<span class='warning'>Access denied.</span>") //Unless emagged of course
flick(icon_deny,src)
return
flick(icon_deny,src)
return
var/key = text2num(href_list["vend"])
var/datum/data/vending_product/R = product_records[key]
var/key = text2num(href_list["vend"])
var/datum/data/vending_product/R = product_records[key]
// This should not happen unless the request from NanoUI was bad
if(!(R.category & categories))
return
// This should not happen unless the request from NanoUI was bad
if(!(R.category & src.categories))
return
if(R.price <= 0)
src.vend(R, usr)
if(R.price <= 0)
vend(R, usr)
else
currently_vending = R
if(!vendor_account || vendor_account.suspended)
status_message = "This machine is currently unable to process payments due to problems with the associated account."
status_error = 1
else
src.currently_vending = R
if(!vendor_account || vendor_account.suspended)
src.status_message = "This machine is currently unable to process payments due to problems with the associated account."
src.status_error = 1
else
src.status_message = "Please swipe a card or insert cash to pay for the item."
src.status_error = 0
status_message = "Please swipe a card or insert cash to pay for the item."
status_error = 0
else if(href_list["cancelpurchase"])
src.currently_vending = null
else if(href_list["cancelpurchase"])
currently_vending = null
else if((href_list["togglevoice"]) && (src.panel_open))
src.shut_up = !src.shut_up
else if(href_list["togglevoice"] && panel_open)
shut_up = !src.shut_up
src.add_fingerprint(usr)
nanomanager.update_uis(src)
add_fingerprint(usr)
nanomanager.update_uis(src)
/obj/machinery/vending/proc/vend(datum/data/vending_product/R, mob/user)
if((!allowed(usr)) && !emagged && scan_id) //For SECURE VENDING MACHINES YEAH
if((!allowed(usr) || !usr.can_admin_interact()) && !emagged && scan_id) //For SECURE VENDING MACHINES YEAH
to_chat(usr, "<span class='warning'>Access denied.</span>")//Unless emagged of course
flick(icon_deny,src)
return
flick(src.icon_deny,src)
return
if(!R.amount)
to_chat(user, "\red The vending machine has ran out of that product.")
to_chat(user, "<span class='warning'>The vending machine has ran out of that product.</span>")
return
src.vend_ready = 0 //One thing at a time!!
src.status_message = "Vending..."
src.status_error = 0
vend_ready = 0 //One thing at a time!!
status_message = "Vending..."
status_error = 0
nanomanager.update_uis(src)
if(R.category & CAT_COIN)
if(!coin)
to_chat(user, "\blue You need to insert a coin to get this item.")
to_chat(user, "<span class='notice'>You need to insert a coin to get this item.</span>")
return
if(coin.string_attached)
if(prob(50))
to_chat(user, "\blue You successfully pull the coin out before the [src] could swallow it.")
to_chat(user, "<span class='notice'>You successfully pull the coin out before the [src] could swallow it.</span>")
else
to_chat(user, "\blue You weren't able to pull the coin out fast enough, the machine ate it, string and all.")
to_chat(user, "<span class='notice'>You weren't able to pull the coin out fast enough, the machine ate it, string and all.</span>")
coin = null
qdel(coin)
categories &= ~CAT_COIN
@@ -559,47 +563,47 @@
R.amount--
if(((src.last_reply + (src.vend_delay + 200)) <= world.time) && src.vend_reply)
if(((last_reply + (vend_delay + 200)) <= world.time) && vend_reply)
spawn(0)
src.speak(src.vend_reply)
src.last_reply = world.time
speak(src.vend_reply)
last_reply = world.time
use_power(vend_power_usage) //actuators and stuff
if(src.icon_vend) //Show the vending animation if needed
flick(src.icon_vend,src)
if(icon_vend) //Show the vending animation if needed
flick(icon_vend,src)
spawn(src.vend_delay)
new R.product_path(get_turf(src))
src.status_message = ""
src.status_error = 0
src.vend_ready = 1
status_message = ""
status_error = 0
vend_ready = 1
currently_vending = null
nanomanager.update_uis(src)
/obj/machinery/vending/proc/stock(var/datum/data/vending_product/R, var/mob/user)
if(src.panel_open)
if(panel_open)
to_chat(user, "\blue You stock the [src] with \a [R.product_name]")
R.amount++
src.updateUsrDialog()
updateUsrDialog()
/obj/machinery/vending/process()
if(stat & (BROKEN|NOPOWER))
return
if(!src.active)
if(!active)
return
if(src.seconds_electrified > 0)
src.seconds_electrified--
//Pitch to the people! Really sell it!
if(((src.last_slogan + src.slogan_delay) <= world.time) && (src.slogan_list.len > 0) && (!src.shut_up) && prob(5))
if(((last_slogan + src.slogan_delay) <= world.time) && (slogan_list.len > 0) && (!shut_up) && prob(5))
var/slogan = pick(src.slogan_list)
src.speak(slogan)
src.last_slogan = world.time
speak(slogan)
last_slogan = world.time
if(src.shoot_inventory && prob(shoot_chance))
src.throw_item()
if(shoot_inventory && prob(shoot_chance))
throw_item()
return
@@ -620,12 +624,12 @@
stat &= ~NOPOWER
else
spawn(rand(0, 15))
src.icon_state = "[initial(icon_state)]-off"
icon_state = "[initial(icon_state)]-off"
stat |= NOPOWER
//Oh no we're malfunctioning! Dump out some product and break.
/obj/machinery/vending/proc/malfunction()
for(var/datum/data/vending_product/R in src.product_records)
for(var/datum/data/vending_product/R in product_records)
if(R.amount <= 0) //Try to use a record that actually has something to dump.
continue
var/dump_path = R.product_path
@@ -633,12 +637,12 @@
continue
while(R.amount>0)
new dump_path(src.loc)
new dump_path(loc)
R.amount--
break
stat |= BROKEN
src.icon_state = "[initial(icon_state)]-broken"
icon_state = "[initial(icon_state)]-broken"
return
//Somebody cut an important wire and now we're following a new definition of "pitch."
@@ -648,7 +652,7 @@
if(!target)
return 0
for(var/datum/data/vending_product/R in src.product_records)
for(var/datum/data/vending_product/R in product_records)
if(R.amount <= 0) //Try to use a record that actually has something to dump.
continue
var/dump_path = R.product_path
@@ -656,13 +660,13 @@
continue
R.amount--
throw_item = new dump_path(src.loc)
throw_item = new dump_path(loc)
break
if(!throw_item)
return 0
spawn(0)
throw_item.throw_at(target, 16, 3, src)
src.visible_message("<span class='danger'>[src] launches [throw_item.name] at [target.name]!</span>")
visible_message("<span class='danger'>[src] launches [throw_item.name] at [target.name]!</span>")
return 1
/*
+20 -4
View File
@@ -469,16 +469,32 @@
connected.connected = null
connected = null
return ..()
// Crematorium switch
/obj/machinery/crema_switch
desc = "Burn baby burn!"
name = "crematorium igniter"
icon = 'icons/obj/power.dmi'
icon_state = "crema_switch"
anchored = 1.0
req_access = list(access_crematorium)
var/on = 0
var/area/area = null
var/otherarea = null
var/id = 1
/obj/machinery/crema_switch/attack_ghost(mob/user)
if(user.can_advanced_admin_interact())
return attack_hand(user)
/obj/machinery/crema_switch/attack_hand(mob/user as mob)
if(allowed(usr))
/obj/machinery/crema_switch/attack_hand(mob/user)
if(allowed(usr) || user.can_advanced_admin_interact())
for(var/obj/structure/crematorium/C in world)
if(C.id == id)
if(!C.cremating)
C.cremate(user)
else
to_chat(usr, "\red Access denied.")
return
to_chat(usr, "<span class='warning'>Access denied.</span>")
/mob/proc/update_morgue()
if(stat == DEAD)
+19 -5
View File
@@ -76,7 +76,8 @@ var/list/admin_verbs_admin = list(
/client/proc/debug_variables,
/client/proc/show_snpc_verbs,
/client/proc/reset_all_tcs, /*resets all telecomms scripts*/
/client/proc/toggle_mentor_chat
/client/proc/toggle_mentor_chat,
/client/proc/toggle_advanced_interaction, /*toggle admin ability to interact with not only machines, but also atoms such as buttons and doors*/
)
var/list/admin_verbs_ban = list(
/client/proc/unban_panel,
@@ -970,20 +971,33 @@ var/list/admin_verbs_snpc = list(
set name = "Show SNPC Verbs"
set category = "Admin"
if(!holder)
if(!check_rights(R_ADMIN))
return
verbs += admin_verbs_snpc
verbs -= /client/proc/show_snpc_verbs
to_chat(src, "<span class='interface'>SNPC verbs on.</span>")
to_chat(src, "<span class='interface'>SNPC verbs have been toggled on.</span>")
/client/proc/hide_snpc_verbs()
set name = "Hide SNPC Verbs"
set category = "Admin"
if(!holder)
if(!check_rights(R_ADMIN))
return
verbs -= admin_verbs_snpc
verbs += /client/proc/show_snpc_verbs
to_chat(src, "<span class='interface'>SNPC verbs off.</span>")
to_chat(src, "<span class='interface'>SNPC verbs have been toggled off.</span>")
/client/proc/toggle_advanced_interaction()
set name = "Toggle Advanced Admin Interaction"
set category = "Admin"
set desc = "Allows you to interact with atoms such as buttons and doors, on top of regular machinery interaction."
if(!check_rights(R_ADMIN))
return
advanced_admin_interaction = !advanced_admin_interaction
log_admin("[key_name(usr)] has [advanced_admin_interaction ? "activated" : "deactivated"] their advanced admin interaction.")
message_admins("[key_name_admin(usr)] has [advanced_admin_interaction ? "activated" : "deactivated"] their advanced admin interaction.")
+2 -2
View File
@@ -10,11 +10,11 @@
var/input = input(usr, "Enter the description of the custom event. Be descriptive. To cancel the event, make this blank or hit cancel.", "Custom Event", custom_event_msg) as message|null
if(!input || input == "")
custom_event_msg = null
log_admin("[usr.key] has cleared the custom event text.")
log_admin("[key_name(usr)] has cleared the custom event text.")
message_admins("[key_name_admin(usr)] has cleared the custom event text.")
return
log_admin("[usr.key] has changed the custom event text.")
log_admin("[key_name(usr)] has changed the custom event text.")
message_admins("[key_name_admin(usr)] has changed the custom event text.")
custom_event_msg = input
+4
View File
@@ -93,5 +93,9 @@
// Donator stuff.
var/donator_level = DONATOR_LEVEL_NONE
// If set to true, this client can interact with atoms such as buttons and doors on top of regular machinery interaction
var/advanced_admin_interaction = FALSE
// Has the client been varedited by an admin?
var/var_edited = FALSE
+5 -1
View File
@@ -156,6 +156,7 @@
if(stat & BROKEN || panel_open)
return
user.set_machine(src)
add_fingerprint(user)
var/dat
if(processing)
dat += "<div class='statusDisplay'>Biogenerator is processing! Please wait...</div><BR>"
@@ -207,6 +208,9 @@
/obj/machinery/biogenerator/attack_hand(mob/user)
interact(user)
/obj/machinery/biogenerator/attack_ghost(mob/user)
interact(user)
/obj/machinery/biogenerator/proc/activate()
if(usr.stat != 0)
@@ -302,7 +306,7 @@
/obj/machinery/biogenerator/Topic(href, href_list)
if(..() || panel_open)
return
return 1
usr.set_machine(src)
+5 -4
View File
@@ -90,16 +90,17 @@
if(..())
return
interact(user)
/obj/machinery/plantgenes/attack_ghost(mob/user)
interact(user)
/obj/machinery/plantgenes/interact(mob/user)
add_fingerprint(user)
user.set_machine(src)
if(!user)
return
var/datum/browser/popup = new(user, "plantdna", "Plant DNA Manipulator", 450, 600)
if(!(in_range(src, user) || issilicon(user)))
popup.close()
return
var/dat = ""
@@ -216,7 +217,7 @@
/obj/machinery/plantgenes/Topic(var/href, var/list/href_list)
if(..())
return
return 1
usr.set_machine(src)
if(href_list["eject_seed"] && !operation)
+8 -3
View File
@@ -124,12 +124,17 @@
src.amount = am
/obj/machinery/seed_extractor/attack_hand(mob/user)
user.set_machine(src)
interact(user)
/obj/machinery/seed_extractor/attack_ghost(mob/user)
interact(user)
/obj/machinery/seed_extractor/interact(mob/user)
if (stat)
if(stat)
return 0
add_fingerprint(user)
user.set_machine(src)
var/dat = "<b>Stored seeds:</b><br>"
@@ -149,7 +154,7 @@
/obj/machinery/seed_extractor/Topic(var/href, var/list/href_list)
if(..())
return
return 1
usr.set_machine(src)
href_list["li"] = text2num(href_list["li"])
+13 -1
View File
@@ -641,10 +641,22 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
client.images -= ghostimage //remove ourself
/mob/proc/can_admin_interact()
return 0
return FALSE
/mob/proc/can_advanced_admin_interact()
return FALSE
/mob/dead/observer/can_admin_interact()
return check_rights(R_ADMIN, 0, src)
/mob/dead/observer/can_advanced_admin_interact()
if(!can_admin_interact())
return FALSE
if(client && client.advanced_admin_interaction)
return TRUE
return FALSE
//this is a mob verb instead of atom for performance reasons
//see /mob/verb/examinate() in mob.dm for more info
@@ -263,6 +263,9 @@
interact(H)
else
return ..()
/mob/living/simple_animal/bot/attack_ghost(mob/M)
interact(M)
/mob/living/simple_animal/bot/attack_ai(mob/user)
if(!topic_denied(user))
@@ -818,7 +821,7 @@ Pass a positive integer as an argument to override a bot's default speed.
return 1
add_fingerprint(usr)
if((href_list["power"]) && (bot_core.allowed(usr) || !locked))
if((href_list["power"]) && (bot_core.allowed(usr) || !locked || usr.can_admin_interact()))
if(on)
turn_off()
else
@@ -838,6 +841,7 @@ Pass a positive integer as an argument to override a bot's default speed.
to_chat(usr, "<span class='warning'>[text_hack]</span>")
show_laws()
bot_reset()
add_logs(usr, src, "hacked")
else if(!hacked)
to_chat(usr, "<span class='userdanger'>[text_dehack_fail]</span>")
else
@@ -846,8 +850,9 @@ Pass a positive integer as an argument to override a bot's default speed.
to_chat(usr, "<span class='notice'>[text_dehack]</span>")
show_laws()
bot_reset()
add_logs(usr, src, "dehacked")
if("ejectpai")
if(paicard && (!locked || issilicon(usr) || check_rights(R_ADMIN, 0, usr)))
if(paicard && (!locked || issilicon(usr) || usr.can_admin_interact()))
to_chat(usr, "<span class='notice'>You eject [paicard] from [bot_name]</span>")
ejectpai(usr)
update_controls()
@@ -867,19 +872,21 @@ Pass a positive integer as an argument to override a bot's default speed.
qdel(src)
/mob/living/simple_animal/bot/proc/topic_denied(mob/user) //Access check proc for bot topics! Remember to place in a bot's individual Topic if desired.
if(user.can_admin_interact())
return 0
if(user.incapacitated() || !(issilicon(user) || in_range(src, user)))
return 1
// 0 for access, 1 for denied.
if(emagged == 2) //An emagged bot cannot be controlled by humans, silicons can if one hacked it.
if(!hacked) //Manually emagged by a human - access denied to all.
return 1
else if(!issilicon(user) && !check_rights(R_ADMIN, 0, user)) //Bot is hacked, so only silicons and admins are allowed access.
else if(!issilicon(user)) //Bot is hacked, so only silicons are allowed access.
return 1
return 0
/mob/living/simple_animal/bot/proc/hack(mob/user)
var/hack
if(issilicon(user) || check_rights(R_ADMIN, 0, user)) //Allows silicons or admins to toggle the emag status of a bot.
if(issilicon(user) || user.can_admin_interact()) //Allows silicons or admins to toggle the emag status of a bot.
hack += "[emagged == 2 ? "Software compromised! Unit may exhibit dangerous or erratic behavior." : "Unit operating normally. Release safety lock?"]<BR>"
hack += "Harm Prevention Safety System: <A href='?src=[UID()];operation=hack'>[emagged ? "<span class='bad'>DANGER</span>" : "Engaged"]</A><BR>"
else if(!locked) //Humans with access can use this option to hide a bot from the AI's remote control panel and PDA control.
@@ -888,7 +895,7 @@ Pass a positive integer as an argument to override a bot's default speed.
/mob/living/simple_animal/bot/proc/showpai(mob/user)
var/eject = ""
if(!locked || issilicon(usr) || check_rights(R_ADMIN, 0, user))
if(!locked || issilicon(usr) || user.can_admin_interact())
if(paicard || allow_pai)
eject += "Personality card status: "
if(paicard)
@@ -204,7 +204,7 @@ Status: []<BR>
Behaviour controls are [locked ? "locked" : "unlocked"]<BR>
Maintenance panel panel is [open ? "opened" : "closed"]"},
text("<A href='?src=[UID()];power=1'>[on ? "On" : "Off"]</A>"))
if(!locked || issilicon(user) || check_rights(R_ADMIN, 0, user))
if(!locked || issilicon(user) || user.can_admin_interact())
dat += text({"<BR>Cleans Blood: []<BR>"}, text("<A href='?src=[UID()];operation=blood'>[blood ? "Yes" : "No"]</A>"))
dat += text({"<BR>Patrol station: []<BR>"}, text("<A href='?src=[UID()];operation=patrol'>[auto_patrol ? "Yes" : "No"]</A>"))
return dat
@@ -106,7 +106,7 @@ Maintenance panel panel is [open ? "opened" : "closed"]<BR>"},
"<A href='?src=[UID()];power=1'>[on ? "On" : "Off"]</A>" )
if(!locked || issilicon(user) || check_rights(R_ADMIN, 0, user))
if(!locked || issilicon(user) || user.can_admin_interact())
if(!lasercolor)
dat += text({"<BR>
Arrest Unidentifiable Persons: []<BR>
@@ -69,7 +69,7 @@
dat += "Maintenance panel panel is [open ? "opened" : "closed"]<BR>"
dat += "Tiles left: [amount]<BR>"
dat += "Behvaiour controls are [locked ? "locked" : "unlocked"]<BR>"
if(!locked || issilicon(user) || check_rights(R_ADMIN, 0, user))
if(!locked || issilicon(user) || user.can_admin_interact())
dat += "Add tiles to new hull plating: <A href='?src=[UID()];operation=autotile'>[autotile ? "Yes" : "No"]</A><BR>"
dat += "Replace floor tiles: <A href='?src=[UID()];operation=replace'>[replacetiles ? "Yes" : "No"]</A><BR>"
dat += "Finds tiles: <A href='?src=[UID()];operation=tiles'>[eattiles ? "Yes" : "No"]</A><BR>"
@@ -149,7 +149,7 @@
else
dat += "None Loaded"
dat += "<br>Behaviour controls are [locked ? "locked" : "unlocked"]<hr>"
if(!locked || issilicon(user) || check_rights(R_ADMIN, 0, user))
if(!locked || issilicon(user) || user.can_admin_interact())
dat += "<TT>Healing Threshold: "
dat += "<a href='?src=[UID()];adj_threshold=-10'>--</a> "
dat += "<a href='?src=[UID()];adj_threshold=-5'>-</a> "
@@ -284,7 +284,7 @@
dat += "<b>Destination:</b> [!destination ? "<i>none</i>" : destination]<BR>"
dat += "<b>Power level:</b> [cell ? cell.percent() : 0]%"
if(locked && !ai && !check_rights(R_ADMIN, 0, user))
if(locked && !ai && !user.can_admin_interact())
dat += "&nbsp;<br /><div class='notice'>Controls are locked</div><A href='?src=[UID()];op=unlock'>Unlock Controls</A>"
else
dat += "&nbsp;<br /><div class='notice'>Controls are unlocked</div><A href='?src=[UID()];op=lock'>Lock Controls</A><BR><BR>"
@@ -119,7 +119,7 @@ Maintenance panel panel is [open ? "opened" : "closed"]"},
"<A href='?src=[UID()];power=1'>[on ? "On" : "Off"]</A>" )
if(!locked || issilicon(user) || check_rights(R_ADMIN, 0, user))
if(!locked || issilicon(user) || user.can_admin_interact())
dat += text({"<BR>
Arrest Unidentifiable Persons: []<BR>
Arrest for Unauthorized Weapons: []<BR>
+19 -7
View File
@@ -37,9 +37,12 @@ var/list/alldepartments = list()
fax_network = "Central Command Quantum Entanglement Network"
long_range_enabled = 1
/obj/machinery/photocopier/faxmachine/attack_hand(mob/user as mob)
/obj/machinery/photocopier/faxmachine/attack_hand(mob/user)
ui_interact(user)
/obj/machinery/photocopier/faxmachine/attack_ghost(mob/user)
ui_interact(user)
/obj/machinery/photocopier/faxmachine/attackby(obj/item/weapon/item, mob/user, params)
if(istype(item,/obj/item/weapon/card/id) && !scan)
scan(item)
@@ -64,13 +67,14 @@ var/list/alldepartments = list()
/obj/machinery/photocopier/faxmachine/ui_data(mob/user, ui_key = "main", datum/topic_state/state = default_state)
var/data[0]
var/is_authenticated = is_authenticated(user)
if(scan)
data["scan_name"] = scan.name
else
data["scan_name"] = "-----"
data["authenticated"] = authenticated
if(!authenticated)
data["authenticated"] = is_authenticated
if(!is_authenticated)
data["network"] = "Disconnected"
else if(!emagged)
data["network"] = fax_network
@@ -91,12 +95,20 @@ var/list/alldepartments = list()
return data
/obj/machinery/photocopier/faxmachine/proc/is_authenticated(mob/user)
if(authenticated)
return TRUE
else if(user.can_admin_interact())
return TRUE
return FALSE
/obj/machinery/photocopier/faxmachine/Topic(href, href_list)
if(..())
return 1
var/is_authenticated = is_authenticated(usr)
if(href_list["send"])
if(copyitem && authenticated)
if(copyitem && is_authenticated)
if((destination in admin_departments) || (destination in hidden_admin_departments))
send_admin_fax(usr, destination)
else
@@ -128,7 +140,7 @@ var/list/alldepartments = list()
scan()
if(href_list["dept"])
if(authenticated)
if(is_authenticated)
var/lastdestination = destination
var/list/combineddepartments = alldepartments.Copy()
if(long_range_enabled)
@@ -145,7 +157,7 @@ var/list/alldepartments = list()
if((!authenticated) && scan)
if(check_access(scan))
authenticated = 1
else if(authenticated)
else if(!authenticated)
authenticated = 0
if(href_list["rename"])
+8 -2
View File
@@ -19,10 +19,13 @@
var/maxcopies = 10 //how many copies can be copied at once- idea shamelessly stolen from bs12's copier!
var/mob/living/ass = null
/obj/machinery/photocopier/attack_ai(mob/user as mob)
/obj/machinery/photocopier/attack_ai(mob/user)
return attack_hand(user)
/obj/machinery/photocopier/attack_ghost(mob/user)
return attack_hand(user)
/obj/machinery/photocopier/attack_hand(mob/user as mob)
/obj/machinery/photocopier/attack_hand(mob/user)
user.set_machine(src)
var/dat = "Photocopier<BR><BR>"
@@ -47,6 +50,9 @@
return
/obj/machinery/photocopier/Topic(href, href_list)
if(..())
return 1
if(href_list["copy"])
if(stat & (BROKEN|NOPOWER))
return