mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-11 07:03:30 +01:00
Admin interaction update
This commit is contained in:
@@ -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_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_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
|
||||
@@ -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_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_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()
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
@@ -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_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/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_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)
|
||||
|
||||
|
||||
@@ -173,12 +173,15 @@
|
||||
if(alarmed)
|
||||
nextstate = CLOSED
|
||||
|
||||
/obj/machinery/door/firedoor/attack_ai(mob/user as mob)
|
||||
/obj/machinery/door/firedoor/attack_ghost(mob/user as mob)
|
||||
return attack_ai(user)
|
||||
|
||||
/obj/machinery/door/firedoor/attack_ai(mob/user)
|
||||
if(operating || stat & NOPOWER)
|
||||
return //Already doing something or depowered.
|
||||
|
||||
if(blocked)
|
||||
to_chat(user, "\red \The [src] is welded solid!")
|
||||
to_chat(user, "<span class='warning'>\The [src] is welded solid!</span>")
|
||||
return
|
||||
|
||||
var/area/A = get_area_master(src)
|
||||
@@ -186,11 +189,11 @@
|
||||
var/alarmed = A.air_doors_activated || A.fire
|
||||
|
||||
var/access_granted = 0
|
||||
if(isAI(user) || isrobot(user))
|
||||
if(isAI(user) || isrobot(user) || user.can_admin_interact())
|
||||
access_granted = 1
|
||||
|
||||
if(access_granted == 1)
|
||||
user.visible_message("\blue \The [src] [density ? "open" : "close"]s for \the [user].",\
|
||||
user.visible_message("<span class='notice'>\The [src] [density ? "open" : "close"]s for \the [user].</span>",\
|
||||
"\The [src] [density ? "open" : "close"]s.",\
|
||||
"You hear a beep, and a door opening.")
|
||||
|
||||
|
||||
@@ -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_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_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
|
||||
|
||||
|
||||
@@ -25,32 +25,32 @@
|
||||
/*
|
||||
/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()
|
||||
if(anchored)
|
||||
return flash()
|
||||
else
|
||||
return
|
||||
|
||||
@@ -58,16 +58,16 @@
|
||||
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 +85,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_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 +141,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
|
||||
+258
-255
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
/*
|
||||
|
||||
@@ -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_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_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)
|
||||
|
||||
@@ -76,7 +76,8 @@ var/list/admin_verbs_admin = list(
|
||||
/client/proc/show_snpc_verbs,
|
||||
/client/proc/reset_all_tcs, /*resets all telecomms scripts*/
|
||||
/client/proc/cmd_admin_check_player_exp, /* shows players by playtime */
|
||||
/client/proc/toggle_mentor_chat
|
||||
/client/proc/toggle_mentor_chat,
|
||||
/client/proc/toggle_AI_interact, /*toggle admin ability to interact with machines as an AI*/
|
||||
)
|
||||
var/list/admin_verbs_ban = list(
|
||||
/client/proc/unban_panel,
|
||||
@@ -965,20 +966,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_AI_interact()
|
||||
set name = "Toggle Admin Observer Interaction"
|
||||
set category = "Admin"
|
||||
set desc = "Allows you to interact with most machines, computers and other objects while observing."
|
||||
|
||||
if(!check_rights(R_ADMIN))
|
||||
return
|
||||
|
||||
observer_interact = !observer_interact
|
||||
|
||||
log_admin("[key_name(usr)] has [observer_interact ? "activated" : "deactivated"] their admin observer interaction.")
|
||||
message_admins("[key_name_admin(usr)] has [observer_interact ? "activated" : "deactivated"] their admin observer interaction.")
|
||||
|
||||
@@ -92,4 +92,7 @@
|
||||
var/datum/chatOutput/chatOutput
|
||||
|
||||
// Donator stuff.
|
||||
var/donator_level = DONATOR_LEVEL_NONE
|
||||
var/donator_level = DONATOR_LEVEL_NONE
|
||||
|
||||
// If set to true, this client can interact with most machines/computers/objects while observing
|
||||
var/observer_interact = FALSE
|
||||
@@ -207,6 +207,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 +305,7 @@
|
||||
|
||||
/obj/machinery/biogenerator/Topic(href, href_list)
|
||||
if(..() || panel_open)
|
||||
return
|
||||
return 1
|
||||
|
||||
usr.set_machine(src)
|
||||
|
||||
|
||||
@@ -90,6 +90,9 @@
|
||||
if(..())
|
||||
return
|
||||
interact(user)
|
||||
|
||||
/obj/machinery/plantgenes/attack_ghost(mob/user)
|
||||
interact(user)
|
||||
|
||||
/obj/machinery/plantgenes/interact(mob/user)
|
||||
user.set_machine(src)
|
||||
@@ -97,9 +100,6 @@
|
||||
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 +216,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)
|
||||
|
||||
@@ -124,12 +124,16 @@
|
||||
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
|
||||
|
||||
user.set_machine(src)
|
||||
|
||||
var/dat = "<b>Stored seeds:</b><br>"
|
||||
|
||||
@@ -149,7 +153,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"])
|
||||
|
||||
@@ -648,7 +648,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
|
||||
return 0
|
||||
|
||||
/mob/dead/observer/can_admin_interact()
|
||||
return check_rights(R_ADMIN, 0, src)
|
||||
return client && client.observer_interact
|
||||
|
||||
//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))
|
||||
@@ -867,6 +870,8 @@ 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.
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user