mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 02:09:41 +00:00
Merge branch 'master' of https://github.com/VOREStation/Polaris into aro-sync-05-25-2018
# Conflicts: # code/__defines/misc.dm # code/controllers/master_controller.dm # code/game/machinery/computer3/computers/card.dm # code/game/objects/items/devices/communicator/UI.dm # code/game/objects/items/stacks/medical.dm # code/game/objects/structures/signs.dm # code/modules/admin/admin_verbs.dm # code/modules/client/client defines.dm # code/modules/client/client procs.dm # code/modules/clothing/clothing.dm # code/modules/clothing/under/accessories/holster.dm # code/modules/events/radiation_storm.dm # code/modules/mining/machine_processing.dm # code/modules/mob/living/carbon/human/species/station/prometheans.dm # code/modules/mob/living/living.dm # code/modules/mob/living/simple_animal/animals/bear.dm # code/modules/mob/living/simple_animal/animals/cat.dm # code/modules/mob/living/simple_animal/animals/parrot.dm # code/modules/mob/mob.dm # code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents-Core.dm # code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents-Food-Drinks.dm # code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents-Medicine.dm # code/modules/reagents/reagent_dispenser.dm # config/example/config.txt # html/changelogs/.all_changelog.yml # interface/skin.dmf # maps/southern_cross/southern_cross-1.dmm # vorestation.dme
This commit is contained in:
@@ -33,6 +33,7 @@
|
||||
#define CE_ALCOHOL "alcohol" // Liver filtering
|
||||
#define CE_ALCOHOL_TOXIC "alcotoxic" // Liver damage
|
||||
#define CE_SPEEDBOOST "gofast" // Hyperzine
|
||||
#define CE_SLOWDOWN "goslow" // Slowdown
|
||||
|
||||
#define REAGENTS_PER_SHEET 20
|
||||
|
||||
|
||||
@@ -22,19 +22,23 @@
|
||||
#define SLOT_TIE 0x4000
|
||||
#define SLOT_HOLSTER 0x8000 //16th bit - higher than this will overflow
|
||||
|
||||
#define ACCESSORY_SLOT_UTILITY "Utility"
|
||||
#define ACCESSORY_SLOT_ARMBAND "Armband"
|
||||
#define ACCESSORY_SLOT_RANK "Rank"
|
||||
#define ACCESSORY_SLOT_DEPT "Department"
|
||||
#define ACCESSORY_SLOT_DECOR "Decor"
|
||||
#define ACCESSORY_SLOT_MEDAL "Medal"
|
||||
#define ACCESSORY_SLOT_INSIGNIA "Insignia"
|
||||
#define ACCESSORY_SLOT_ARMOR_C "Chest armor"
|
||||
#define ACCESSORY_SLOT_ARMOR_A "Arm armor"
|
||||
#define ACCESSORY_SLOT_ARMOR_L "Leg armor"
|
||||
#define ACCESSORY_SLOT_ARMOR_S "Armor storage"
|
||||
#define ACCESSORY_SLOT_ARMOR_M "Misc armor"
|
||||
#define ACCESSORY_SLOT_HELM_C "Helmet cover"
|
||||
#define ACCESSORY_SLOT_UTILITY 0x1
|
||||
#define ACCESSORY_SLOT_WEAPON 0x2
|
||||
#define ACCESSORY_SLOT_ARMBAND 0x4
|
||||
#define ACCESSORY_SLOT_DECOR 0x8
|
||||
#define ACCESSORY_SLOT_MEDAL 0x20
|
||||
#define ACCESSORY_SLOT_TIE 0x40
|
||||
#define ACCESSORY_SLOT_INSIGNIA 0x80
|
||||
#define ACCESSORY_SLOT_OVER 0x100
|
||||
//Should these really be 'accessory' accessories
|
||||
#define ACCESSORY_SLOT_ARMOR_C 0x200
|
||||
#define ACCESSORY_SLOT_ARMOR_A 0x400
|
||||
#define ACCESSORY_SLOT_ARMOR_L 0x800
|
||||
#define ACCESSORY_SLOT_ARMOR_S 0x1000
|
||||
#define ACCESSORY_SLOT_ARMOR_M 0x2000
|
||||
#define ACCESSORY_SLOT_HELM_C 0x4000
|
||||
|
||||
#define ACCESSORY_SLOT_TORSO (ACCESSORY_SLOT_UTILITY|ACCESSORY_SLOT_WEAPON)
|
||||
|
||||
// Flags bitmasks. - Used in /atom/var/flags
|
||||
#define NOBLUDGEON 0x1 // When an item has this it produces no "X has been hit by Y with Z" message with the default handler.
|
||||
|
||||
@@ -241,6 +241,25 @@
|
||||
#define USE_FAIL_NOT_IN_USER 6
|
||||
#define USE_FAIL_IS_SILICON 7
|
||||
|
||||
// This creates a consistant definition for creating global lists, automatically inserting objects into it when they are created, and removing them when deleted.
|
||||
// It is very good for removing the 'in world' junk that exists in the codebase painlessly.
|
||||
// First argument is the list name/path desired, e.g. 'all_candles' would be 'var/list/all_candles = list()'.
|
||||
// Second argument is the path the list is expected to contain. Note that children will also get added to the global list.
|
||||
// If the GLOB system is ever ported, you can change this macro in one place and have less work to do than you otherwise would.
|
||||
#define GLOBAL_LIST_BOILERPLATE(LIST_NAME, PATH)\
|
||||
var/global/list/##LIST_NAME = list();\
|
||||
##PATH/initialize(mapload, ...)\
|
||||
{\
|
||||
##LIST_NAME += src;\
|
||||
return ..();\
|
||||
}\
|
||||
##PATH/Destroy(force, ...)\
|
||||
{\
|
||||
##LIST_NAME -= src;\
|
||||
return ..();\
|
||||
}\
|
||||
|
||||
|
||||
//'Normal'ness v v v
|
||||
//Various types of colorblindness R2R R2G R2B G2R G2G G2B B2R B2G B2B
|
||||
#define MATRIX_Monochromia list(0.33, 0.33, 0.33, 0.59, 0.59, 0.59, 0.11, 0.11, 0.11)
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
.= res
|
||||
|
||||
/proc/get_area_name(N) //get area by its name
|
||||
for(var/area/A in world)
|
||||
for(var/area/A in all_areas)
|
||||
if(A.name == N)
|
||||
return A
|
||||
return 0
|
||||
|
||||
@@ -503,9 +503,9 @@ Turf and target are seperate in case you want to teleport some distance from a t
|
||||
moblist.Add(M)
|
||||
for(var/mob/living/simple_animal/M in sortmob)
|
||||
moblist.Add(M)
|
||||
// for(var/mob/living/silicon/hivebot/M in world)
|
||||
// for(var/mob/living/silicon/hivebot/M in sortmob)
|
||||
// mob_list.Add(M)
|
||||
// for(var/mob/living/silicon/hive_mainframe/M in world)
|
||||
// for(var/mob/living/silicon/hive_mainframe/M in sortmob)
|
||||
// mob_list.Add(M)
|
||||
return moblist
|
||||
|
||||
@@ -672,7 +672,7 @@ proc/GaussRandRound(var/sigma,var/roundto)
|
||||
//Returns: all the areas in the world
|
||||
/proc/return_areas()
|
||||
var/list/area/areas = list()
|
||||
for(var/area/A in world)
|
||||
for(var/area/A in all_areas)
|
||||
areas += A
|
||||
return areas
|
||||
|
||||
@@ -690,7 +690,7 @@ proc/GaussRandRound(var/sigma,var/roundto)
|
||||
areatype = areatemp.type
|
||||
|
||||
var/list/areas = new/list()
|
||||
for(var/area/N in world)
|
||||
for(var/area/N in all_areas)
|
||||
if(istype(N, areatype)) areas += N
|
||||
return areas
|
||||
|
||||
@@ -704,7 +704,7 @@ proc/GaussRandRound(var/sigma,var/roundto)
|
||||
areatype = areatemp.type
|
||||
|
||||
var/list/turfs = new/list()
|
||||
for(var/area/N in world)
|
||||
for(var/area/N in all_areas)
|
||||
if(istype(N, areatype))
|
||||
for(var/turf/T in N) turfs += T
|
||||
return turfs
|
||||
@@ -719,7 +719,7 @@ proc/GaussRandRound(var/sigma,var/roundto)
|
||||
areatype = areatemp.type
|
||||
|
||||
var/list/atoms = new/list()
|
||||
for(var/area/N in world)
|
||||
for(var/area/N in all_areas)
|
||||
if(istype(N, areatype))
|
||||
for(var/atom/A in N)
|
||||
atoms += A
|
||||
|
||||
@@ -97,6 +97,7 @@ var/list/gamemode_cache = list()
|
||||
var/guests_allowed = 1
|
||||
var/debugparanoid = 0
|
||||
var/panic_bunker = 0
|
||||
var/paranoia_logging = 0
|
||||
|
||||
var/serverurl
|
||||
var/server
|
||||
@@ -737,6 +738,12 @@ var/list/gamemode_cache = list()
|
||||
if("radiation_lower_limit")
|
||||
radiation_lower_limit = text2num(value)
|
||||
|
||||
if ("panic_bunker")
|
||||
config.panic_bunker = 1
|
||||
|
||||
if ("paranoia_logging")
|
||||
config.paranoia_logging = 1
|
||||
|
||||
else
|
||||
log_misc("Unknown setting in configuration: '[name]'")
|
||||
|
||||
|
||||
@@ -84,7 +84,7 @@ var/global/datum/emergency_shuttle_controller/emergency_shuttle
|
||||
|
||||
evac = 1
|
||||
emergency_shuttle_called.Announce(replacetext(using_map.emergency_shuttle_called_message, "%ETA%", "[estimated_time] minute\s"))
|
||||
for(var/area/A in world)
|
||||
for(var/area/A in all_areas)
|
||||
if(istype(A, /area/hallway))
|
||||
A.readyalert()
|
||||
|
||||
@@ -116,7 +116,7 @@ var/global/datum/emergency_shuttle_controller/emergency_shuttle
|
||||
if (evac)
|
||||
emergency_shuttle_recalled.Announce(using_map.emergency_shuttle_recall_message)
|
||||
|
||||
for(var/area/A in world)
|
||||
for(var/area/A in all_areas)
|
||||
if(istype(A, /area/hallway))
|
||||
A.readyreset()
|
||||
evac = 0
|
||||
|
||||
@@ -49,74 +49,8 @@ datum/controller/game_controller/proc/setup()
|
||||
// #endif
|
||||
|
||||
datum/controller/game_controller/proc/setup_objects()
|
||||
// #if !UNIT_TEST
|
||||
// var/initialized_objects = 0
|
||||
// #endif
|
||||
|
||||
// Set up antagonists.
|
||||
populate_antag_type_list()
|
||||
|
||||
//Set up spawn points.
|
||||
populate_spawn_points()
|
||||
|
||||
/*
|
||||
to_world_log("Initializing Floor Decals")
|
||||
admin_notice("<span class='danger'>Initializing Floor Decals</span>", R_DEBUG)
|
||||
var/list/turfs_with_decals = list()
|
||||
for(var/obj/effect/floor_decal/D in world)
|
||||
var/T = D.add_to_turf_decals()
|
||||
if(T) turfs_with_decals |= T
|
||||
CHECK_SLEEP_MASTER
|
||||
for(var/item in turfs_with_decals)
|
||||
var/turf/T = item
|
||||
if(T.decals) T.apply_decals()
|
||||
CHECK_SLEEP_MASTER
|
||||
floor_decals_initialized = TRUE
|
||||
sleep(1)
|
||||
|
||||
to_world_log("Initializing objects") // VOREStation Edit
|
||||
admin_notice("<span class='danger'>Initializing objects</span>", R_DEBUG)
|
||||
for(var/atom/movable/object in world)
|
||||
if(!QDELETED(object))
|
||||
object.initialize()
|
||||
CHECK_SLEEP_MASTER
|
||||
sleep(1)
|
||||
|
||||
to_world_log("Initializing areas") // VOREStation Edit
|
||||
admin_notice("<span class='danger'>Initializing areas</span>", R_DEBUG)
|
||||
for(var/area/area in all_areas)
|
||||
area.initialize()
|
||||
CHECK_SLEEP_MASTER
|
||||
sleep(1)
|
||||
|
||||
to_world_log("Initializing atmos machinery connections.") // VOREStation Edit
|
||||
admin_notice("<span class='danger'>Initializing atmos machinery connections.</span>", R_DEBUG)
|
||||
for(var/obj/machinery/atmospherics/machine in machines)
|
||||
machine.atmos_init()
|
||||
CHECK_SLEEP_MASTER
|
||||
|
||||
to_world_log("Initializing pipe networks") // VOREStation Edit
|
||||
admin_notice("<span class='danger'>Initializing pipe networks</span>", R_DEBUG)
|
||||
for(var/obj/machinery/atmospherics/machine in machines)
|
||||
machine.build_network()
|
||||
CHECK_SLEEP_MASTER
|
||||
|
||||
to_world_log("Initializing atmos machinery.") // VOREStation Edit
|
||||
admin_notice("<span class='danger'>Initializing atmos machinery.</span>", R_DEBUG)
|
||||
for(var/obj/machinery/atmospherics/unary/U in machines)
|
||||
if(istype(U, /obj/machinery/atmospherics/unary/vent_pump))
|
||||
var/obj/machinery/atmospherics/unary/vent_pump/T = U
|
||||
T.broadcast_status()
|
||||
else if(istype(U, /obj/machinery/atmospherics/unary/vent_scrubber))
|
||||
var/obj/machinery/atmospherics/unary/vent_scrubber/T = U
|
||||
T.broadcast_status()
|
||||
CHECK_SLEEP_MASTER
|
||||
|
||||
to_world_log("Initializing turbolifts") // VOREStation Edit
|
||||
admin_notice("<span class='danger'>Initializing turbolifts</span>", R_DEBUG)
|
||||
for(var/thing in turbolifts)
|
||||
var/obj/turbolift_map_holder/lift = thing
|
||||
if(!QDELETED(lift))
|
||||
lift.initialize()
|
||||
CHECK_SLEEP_MASTER
|
||||
*/
|
||||
@@ -27,6 +27,9 @@ SUBSYSTEM_DEF(air)
|
||||
// Updating zone tiles requires temporary storage location of self-zone-blocked turfs across resumes. Used only by process_tiles_to_update.
|
||||
var/list/selfblock_deferred = null
|
||||
|
||||
// This is used to tell Travis WHERE the edges are.
|
||||
var/list/startup_active_edge_log = list()
|
||||
|
||||
/datum/controller/subsystem/air/PreInit()
|
||||
air_master = src
|
||||
|
||||
@@ -35,7 +38,7 @@ SUBSYSTEM_DEF(air)
|
||||
|
||||
current_cycle = 0
|
||||
var/simulated_turf_count = 0
|
||||
for(var/turf/simulated/S in world)
|
||||
for(var/turf/simulated/S in turfs)
|
||||
simulated_turf_count++
|
||||
S.update_air_properties()
|
||||
CHECK_TICK
|
||||
@@ -56,8 +59,9 @@ Total Unsimulated Turfs: [world.maxx*world.maxy*world.maxz - simulated_turf_coun
|
||||
for(var/connection_edge/E in active_edges)
|
||||
edge_log += "Active Edge [E] ([E.type])"
|
||||
for(var/turf/T in E.connecting_turfs)
|
||||
edge_log += "+--- Connecting Turf [T] @ [T.x], [T.y], [T.z]"
|
||||
edge_log += "+--- Connecting Turf [T] ([T.type]) @ [T.x], [T.y], [T.z] ([T.loc])"
|
||||
log_debug("Active Edges on ZAS Startup\n" + edge_log.Join("\n"))
|
||||
startup_active_edge_log = edge_log.Copy()
|
||||
|
||||
..()
|
||||
|
||||
|
||||
@@ -46,7 +46,7 @@ SUBSYSTEM_DEF(atoms)
|
||||
CHECK_TICK
|
||||
else
|
||||
count = 0
|
||||
for(var/atom/A in world)
|
||||
for(var/atom/A in world) // This must be world, since this operation adds all the atoms to their specific lists.
|
||||
if(!A.initialized)
|
||||
InitAtom(A, mapload_arg)
|
||||
++count
|
||||
|
||||
@@ -30,7 +30,7 @@ SUBSYSTEM_DEF(xenoarch)
|
||||
. = ..()
|
||||
|
||||
/datum/controller/subsystem/xenoarch/proc/SetupXenoarch()
|
||||
for(var/turf/simulated/mineral/M in world)
|
||||
for(var/turf/simulated/mineral/M in turfs)
|
||||
if(!M.density)
|
||||
continue
|
||||
|
||||
|
||||
@@ -102,10 +102,10 @@ datum/announcement/proc/Log(message as text, message_title as text)
|
||||
return I.assignment ? "[I.registered_name] ([I.assignment])" : I.registered_name
|
||||
|
||||
/proc/level_seven_announcement()
|
||||
command_announcement.Announce("Confirmed outbreak of level 7 biohazard aboard [station_name()]. All personnel must contain the outbreak.", "Biohazard Alert", new_sound = 'sound/AI/outbreak7.ogg')
|
||||
command_announcement.Announce("Confirmed outbreak of level 7 biohazard aboard \the [station_name()]. All personnel must contain the outbreak.", "Biohazard Alert", new_sound = 'sound/AI/outbreak7.ogg')
|
||||
|
||||
/proc/ion_storm_announcement()
|
||||
command_announcement.Announce("It has come to our attention that the station passed through an ion storm. Please monitor all electronic equipment for malfunctions.", "Anomaly Alert")
|
||||
command_announcement.Announce("It has come to our attention that \the [station_name()] passed through an ion storm. Please monitor all electronic equipment for malfunctions.", "Anomaly Alert")
|
||||
|
||||
/proc/AnnounceArrival(var/mob/living/carbon/human/character, var/rank, var/join_message)
|
||||
if (ticker.current_state == GAME_STATE_PLAYING)
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
|
||||
if(flags & ANTAG_HAS_NUKE)
|
||||
dat += "<br><table><tr><td><B>Nuclear disk(s)</B></td></tr>"
|
||||
for(var/obj/item/weapon/disk/nuclear/N in world)
|
||||
for(var/obj/item/weapon/disk/nuclear/N in nuke_disks)
|
||||
dat += "<tr><td>[N.name], "
|
||||
var/atom/disk_loc = N.loc
|
||||
while(!istype(disk_loc, /turf))
|
||||
|
||||
@@ -385,7 +385,7 @@ var/list/mob/living/forced_ambiance_list = new
|
||||
var/list/teleportlocs = list()
|
||||
|
||||
/hook/startup/proc/setupTeleportLocs()
|
||||
for(var/area/AR in world)
|
||||
for(var/area/AR in all_areas)
|
||||
if(istype(AR, /area/shuttle) || istype(AR, /area/syndicate_station) || istype(AR, /area/wizard_station)) continue
|
||||
if(teleportlocs.Find(AR.name)) continue
|
||||
var/turf/picked = pick(get_area_turfs(AR.type))
|
||||
@@ -400,7 +400,7 @@ var/list/teleportlocs = list()
|
||||
var/list/ghostteleportlocs = list()
|
||||
|
||||
/hook/startup/proc/setupGhostTeleportLocs()
|
||||
for(var/area/AR in world)
|
||||
for(var/area/AR in all_areas)
|
||||
if(ghostteleportlocs.Find(AR.name)) continue
|
||||
if(istype(AR, /area/aisat) || istype(AR, /area/derelict) || istype(AR, /area/tdome) || istype(AR, /area/shuttle/specops/centcom))
|
||||
ghostteleportlocs += AR.name
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
GLOBAL_LIST_BOILERPLATE(all_atoms, /atom) // Use with care, its likely barely better than using world.
|
||||
|
||||
/atom
|
||||
layer = TURF_LAYER //This was here when I got here. Why though?
|
||||
var/level = 2
|
||||
|
||||
@@ -319,7 +319,7 @@ var/global/list/rnwords = list("ire","ego","nahlizet","certum","veri","jatkaa","
|
||||
runerandom()
|
||||
if(iscultist(user))
|
||||
var/C = 0
|
||||
for(var/obj/effect/rune/N in world)
|
||||
for(var/obj/effect/rune/N in rune_list)
|
||||
C++
|
||||
if (!istype(user.loc,/turf))
|
||||
user << "<span class='warning'>You do not have enough space to write a proper rune.</span>"
|
||||
|
||||
@@ -21,7 +21,7 @@ var/list/sacrificed = list()
|
||||
allrunesloc = new/list()
|
||||
var/index = 0
|
||||
// var/tempnum = 0
|
||||
for(var/obj/effect/rune/R in world)
|
||||
for(var/obj/effect/rune/R in rune_list)
|
||||
if(R == src)
|
||||
continue
|
||||
if(R.word1 == cultwords["travel"] && R.word2 == cultwords["self"] && R.word3 == key && isPlayerLevel(R.z))
|
||||
@@ -59,7 +59,7 @@ var/list/sacrificed = list()
|
||||
var/runecount = 0
|
||||
var/obj/effect/rune/IP = null
|
||||
var/mob/living/user = usr
|
||||
for(var/obj/effect/rune/R in world)
|
||||
for(var/obj/effect/rune/R in rune_list)
|
||||
if(R == src)
|
||||
continue
|
||||
if(R.word1 == cultwords["travel"] && R.word2 == cultwords["other"] && R.word3 == key)
|
||||
@@ -243,7 +243,7 @@ var/list/sacrificed = list()
|
||||
|
||||
drain()
|
||||
var/drain = 0
|
||||
for(var/obj/effect/rune/R in world)
|
||||
for(var/obj/effect/rune/R in rune_list)
|
||||
if(R.word1==cultwords["travel"] && R.word2==cultwords["blood"] && R.word3==cultwords["self"])
|
||||
for(var/mob/living/carbon/D in R.loc)
|
||||
if(D.stat!=2)
|
||||
@@ -343,7 +343,7 @@ var/list/sacrificed = list()
|
||||
|
||||
is_sacrifice_target = 0
|
||||
find_sacrifice:
|
||||
for(var/obj/effect/rune/R in world)
|
||||
for(var/obj/effect/rune/R in rune_list)
|
||||
if(R.word1==cultwords["blood"] && R.word2==cultwords["join"] && R.word3==cultwords["hell"])
|
||||
for(var/mob/living/carbon/human/N in R.loc)
|
||||
if(cult && N.mind && N.mind == cult.sacrifice_target)
|
||||
@@ -374,7 +374,7 @@ var/list/sacrificed = list()
|
||||
sleep(10 SECONDS)
|
||||
|
||||
if(corpse_to_raise.client)
|
||||
|
||||
|
||||
var/datum/gender/TU = gender_datums[corpse_to_raise.get_visible_gender()]
|
||||
var/datum/gender/TT = gender_datums[body_to_sacrifice.get_visible_gender()]
|
||||
|
||||
@@ -1049,7 +1049,7 @@ var/list/sacrificed = list()
|
||||
if(iscultist(C) && !C.stat)
|
||||
culcount++
|
||||
if(culcount >= 5)
|
||||
for(var/obj/effect/rune/R in world)
|
||||
for(var/obj/effect/rune/R in rune_list)
|
||||
if(R.blood_DNA == src.blood_DNA)
|
||||
for(var/mob/living/M in orange(2,R))
|
||||
M.take_overall_damage(0,15)
|
||||
|
||||
@@ -54,11 +54,7 @@
|
||||
if(3) //Leaving the code in so someone can try and delag it, but this event can no longer occur randomly, per SoS's request. --NEO
|
||||
command_alert("Space-time anomalies detected on the station. There is no additional data.", "Anomaly Alert")
|
||||
world << sound('sound/AI/spanomalies.ogg')
|
||||
var/list/turfs = new
|
||||
var/turf/picked
|
||||
for(var/turf/simulated/floor/T in world)
|
||||
if(T.z in station_levels)
|
||||
turfs += T
|
||||
for(var/turf/simulated/floor/T in turfs)
|
||||
if(prob(20))
|
||||
spawn(50+rand(0,3000))
|
||||
@@ -135,12 +131,12 @@ var/hadevent = 0
|
||||
spawncount--
|
||||
|
||||
spawn(rand(5000, 6000)) //Delayed announcements to keep the crew on their toes.
|
||||
command_announcement.Announce("Unidentified lifesigns detected coming aboard [station_name()]. Secure any exterior access, including ducting and ventilation.", "Lifesign Alert", new_sound = 'sound/AI/aliens.ogg')
|
||||
command_announcement.Announce("Unidentified lifesigns detected coming aboard \the [station_name()]. Secure any exterior access, including ducting and ventilation.", "Lifesign Alert", new_sound = 'sound/AI/aliens.ogg')
|
||||
|
||||
/proc/high_radiation_event()
|
||||
|
||||
/* // Haha, this is way too laggy. I'll keep the prison break though.
|
||||
for(var/obj/machinery/light/L in world)
|
||||
for(var/obj/machinery/light/L in machines)
|
||||
if(isNotStationLevel(L.z)) continue
|
||||
L.flicker(50)
|
||||
|
||||
@@ -164,7 +160,7 @@ var/hadevent = 0
|
||||
randmutg(H)
|
||||
domutcheck(H,null,MUTCHK_FORCED)
|
||||
sleep(100)
|
||||
command_announcement.Announce("High levels of radiation detected near the station. Please report to the Med-bay if you feel strange.", "Anomaly Alert", new_sound = 'sound/AI/radiation.ogg')
|
||||
command_announcement.Announce("High levels of radiation detected near \the [station_name()]. Please report to the Med-bay if you feel strange.", "Anomaly Alert", new_sound = 'sound/AI/radiation.ogg')
|
||||
|
||||
|
||||
|
||||
@@ -173,7 +169,7 @@ var/hadevent = 0
|
||||
|
||||
|
||||
var/list/area/areas = list()
|
||||
for(var/area/A in world)
|
||||
for(var/area/A in all_areas)
|
||||
if(istype(A, /area/security/prison) || istype(A, /area/security/brig))
|
||||
areas += A
|
||||
|
||||
@@ -213,7 +209,7 @@ var/hadevent = 0
|
||||
new /mob/living/simple_animal/hostile/carp(C.loc)
|
||||
//sleep(100)
|
||||
spawn(rand(300, 600)) //Delayed announcements to keep the crew on their toes.
|
||||
command_announcement.Announce("Unknown biological entities have been detected near [station_name()], please stand-by.", "Lifesign Alert", new_sound = 'sound/AI/commandreport.ogg')
|
||||
command_announcement.Announce("Unknown biological entities have been detected near \the [station_name()], please stand-by.", "Lifesign Alert", new_sound = 'sound/AI/commandreport.ogg')
|
||||
|
||||
/proc/lightsout(isEvent = 0, lightsoutAmount = 1,lightsoutRange = 25) //leave lightsoutAmount as 0 to break ALL lights
|
||||
if(isEvent)
|
||||
@@ -366,21 +362,21 @@ Would like to add a law like "Law x is _______" where x = a number, and _____ is
|
||||
|
||||
spawn(0)
|
||||
world << "Started processing APCs"
|
||||
for (var/obj/machinery/power/apc/APC in world)
|
||||
for (var/obj/machinery/power/apc/APC in machines)
|
||||
if(APC.z in station_levels)
|
||||
APC.ion_act()
|
||||
apcnum++
|
||||
world << "Finished processing APCs. Processed: [apcnum]"
|
||||
spawn(0)
|
||||
world << "Started processing SMES"
|
||||
for (var/obj/machinery/power/smes/SMES in world)
|
||||
for (var/obj/machinery/power/smes/SMES in machines)
|
||||
if(SMES.z in station_levels)
|
||||
SMES.ion_act()
|
||||
smesnum++
|
||||
world << "Finished processing SMES. Processed: [smesnum]"
|
||||
spawn(0)
|
||||
world << "Started processing AIRLOCKS"
|
||||
for (var/obj/machinery/door/airlock/D in world)
|
||||
for (var/obj/machinery/door/airlock/D in machines)
|
||||
if(D.z in station_levels)
|
||||
//if(length(D.req_access) > 0 && !(12 in D.req_access)) //not counting general access and maintenance airlocks
|
||||
airlocknum++
|
||||
@@ -389,7 +385,7 @@ Would like to add a law like "Law x is _______" where x = a number, and _____ is
|
||||
world << "Finished processing AIRLOCKS. Processed: [airlocknum]"
|
||||
spawn(0)
|
||||
world << "Started processing FIREDOORS"
|
||||
for (var/obj/machinery/door/firedoor/D in world)
|
||||
for (var/obj/machinery/door/firedoor/D in machines)
|
||||
if(D.z in station_levels)
|
||||
firedoornum++;
|
||||
spawn(0)
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
var/list/skipped_areas = list(/area/ai)
|
||||
|
||||
for(var/obj/machinery/power/smes/S in world)
|
||||
for(var/obj/machinery/power/smes/S in machines)
|
||||
var/area/current_area = get_area(S)
|
||||
if(current_area.type in skipped_areas || !(S.z in using_map.station_levels))
|
||||
continue
|
||||
@@ -19,7 +19,7 @@
|
||||
S.power_change()
|
||||
|
||||
|
||||
for(var/obj/machinery/power/apc/C in world)
|
||||
for(var/obj/machinery/power/apc/C in machines)
|
||||
if(!C.is_critical && C.cell && (C.z in using_map.station_levels))
|
||||
C.cell.charge = 0
|
||||
|
||||
@@ -28,10 +28,10 @@
|
||||
|
||||
if(announce)
|
||||
command_announcement.Announce("Power has been restored to [station_name()]. We apologize for the inconvenience.", "Power Systems Nominal", new_sound = 'sound/AI/poweron.ogg')
|
||||
for(var/obj/machinery/power/apc/C in world)
|
||||
for(var/obj/machinery/power/apc/C in machines)
|
||||
if(C.cell && (C.z in using_map.station_levels))
|
||||
C.cell.charge = C.cell.maxcharge
|
||||
for(var/obj/machinery/power/smes/S in world)
|
||||
for(var/obj/machinery/power/smes/S in machines)
|
||||
var/area/current_area = get_area(S)
|
||||
if(current_area.type in skipped_areas || isNotStationLevel(S.z))
|
||||
continue
|
||||
@@ -45,7 +45,7 @@
|
||||
|
||||
if(announce)
|
||||
command_announcement.Announce("All SMESs on [station_name()] have been recharged. We apologize for the inconvenience.", "Power Systems Nominal", new_sound = 'sound/AI/poweron.ogg')
|
||||
for(var/obj/machinery/power/smes/S in world)
|
||||
for(var/obj/machinery/power/smes/S in machines)
|
||||
if(isNotStationLevel(S.z))
|
||||
continue
|
||||
S.charge = S.capacity
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/proc/wormhole_event()
|
||||
spawn()
|
||||
var/list/pick_turfs = list()
|
||||
for(var/turf/simulated/floor/T in world)
|
||||
for(var/turf/simulated/floor/T in turfs)
|
||||
if(T.z in using_map.station_levels)
|
||||
pick_turfs += T
|
||||
|
||||
|
||||
@@ -82,7 +82,7 @@
|
||||
if(!target)
|
||||
var/list/robots = list()
|
||||
var/list/robot_names = list()
|
||||
for(var/mob/living/silicon/robot/R in world)
|
||||
for(var/mob/living/silicon/robot/R in silicon_mob_list)
|
||||
if(istype(R, /mob/living/silicon/robot/drone)) // No drones.
|
||||
continue
|
||||
if(R.connected_ai != user) // No robots linked to other AIs
|
||||
|
||||
@@ -37,7 +37,7 @@ var/list/nuke_disks = list()
|
||||
..()
|
||||
return
|
||||
var/disk_rescued = 1
|
||||
for(var/obj/item/weapon/disk/nuclear/D in world)
|
||||
for(var/obj/item/weapon/disk/nuclear/D in nuke_disks)
|
||||
var/disk_area = get_area(D)
|
||||
if(!is_type_in_list(disk_area, centcom_areas))
|
||||
disk_rescued = 0
|
||||
|
||||
@@ -45,7 +45,7 @@
|
||||
|
||||
examine(mob/user)
|
||||
..(user)
|
||||
for(var/obj/machinery/nuclearbomb/bomb in world)
|
||||
for(var/obj/machinery/nuclearbomb/bomb in machines)
|
||||
if(bomb.timing)
|
||||
user << "Extreme danger. Arming signal detected. Time remaining: [bomb.timeleft]"
|
||||
|
||||
|
||||
@@ -524,7 +524,7 @@ datum/objective/steal
|
||||
if(istype(M, /mob/living/silicon/ai) && M.stat != 2) //See if any AI's are alive inside that card.
|
||||
return 1
|
||||
|
||||
for(var/mob/living/silicon/ai/ai in world)
|
||||
for(var/mob/living/silicon/ai/ai in mob_list)
|
||||
var/turf/T = get_turf(ai)
|
||||
if(istype(T))
|
||||
var/area/check_area = get_area(ai)
|
||||
|
||||
@@ -345,3 +345,9 @@
|
||||
to_chat(user, "The subject has too many chemicals in their bloodstream.")
|
||||
else
|
||||
to_chat(user, "There's no suitable occupant in \the [src].")
|
||||
|
||||
//Survival/Stasis sleepers
|
||||
/obj/machinery/sleeper/survival_pod
|
||||
desc = "A limited functionality sleeper, all it can do is put patients into stasis. It lacks the medication and configuration of the larger units."
|
||||
icon_state = "sleeper"
|
||||
stasis_level = 100 //Just one setting
|
||||
|
||||
@@ -7,6 +7,8 @@
|
||||
flags = CONDUCT
|
||||
w_class = ITEMSIZE_HUGE
|
||||
|
||||
layer = TABLE_LAYER // Above catwalks, hopefully below other things
|
||||
|
||||
var/valve_open = 0
|
||||
var/release_pressure = ONE_ATMOSPHERE
|
||||
var/release_flow_rate = ATMOS_DEFAULT_VOLUME_PUMP //in L/s
|
||||
|
||||
@@ -88,9 +88,8 @@
|
||||
|
||||
/obj/machinery/camera/emp_act(severity)
|
||||
if(!isEmpProof() && prob(100/severity))
|
||||
if(!affected_by_emp_until || (world.time < affected_by_emp_until))
|
||||
if(!affected_by_emp_until || (world.time > affected_by_emp_until))
|
||||
affected_by_emp_until = max(affected_by_emp_until, world.time + (90 SECONDS / severity))
|
||||
else
|
||||
stat |= EMPED
|
||||
set_light(0)
|
||||
triggerCameraAlarm()
|
||||
|
||||
@@ -162,7 +162,7 @@ var/global/list/engineering_networks = list(
|
||||
number = 1
|
||||
var/area/A = get_area(src)
|
||||
if(A)
|
||||
for(var/obj/machinery/camera/autoname/C in world)
|
||||
for(var/obj/machinery/camera/autoname/C in machines)
|
||||
if(C == src) continue
|
||||
var/area/CA = get_area(C)
|
||||
if(CA.type == A.type)
|
||||
|
||||
@@ -181,6 +181,8 @@
|
||||
feedback_inc("cyborg_ais_created",1)
|
||||
qdel(src)
|
||||
|
||||
GLOBAL_LIST_BOILERPLATE(all_deactivated_AI_cores, /obj/structure/AIcore/deactivated)
|
||||
|
||||
/obj/structure/AIcore/deactivated
|
||||
name = "inactive AI"
|
||||
icon = 'icons/mob/AI.dmi'
|
||||
@@ -255,7 +257,7 @@
|
||||
set category = "Admin"
|
||||
|
||||
var/list/cores = list()
|
||||
for(var/obj/structure/AIcore/deactivated/D in world)
|
||||
for(var/obj/structure/AIcore/deactivated/D in all_deactivated_AI_cores)
|
||||
cores["[D] ([D.loc.loc])"] = D
|
||||
|
||||
var/id = input("Which core?", "Toggle AI Core Latejoin", null) as null|anything in cores
|
||||
|
||||
@@ -420,7 +420,7 @@
|
||||
return dat
|
||||
|
||||
/proc/enable_prison_shuttle(var/mob/user)
|
||||
for(var/obj/machinery/computer/prison_shuttle/PS in world)
|
||||
for(var/obj/machinery/computer/prison_shuttle/PS in machines)
|
||||
PS.allowedtocall = !(PS.allowedtocall)
|
||||
|
||||
/proc/call_shuttle_proc(var/mob/user)
|
||||
|
||||
@@ -10,50 +10,50 @@
|
||||
var/opened = 0
|
||||
|
||||
|
||||
verb/AccessInternals()
|
||||
set category = "Object"
|
||||
set name = "Access Computer's Internals"
|
||||
set src in oview(1)
|
||||
if(get_dist(src, usr) > 1 || usr.restrained() || usr.lying || usr.stat || istype(usr, /mob/living/silicon))
|
||||
return
|
||||
|
||||
opened = !opened
|
||||
if(opened)
|
||||
usr << "<span class='notice'>The access panel is now open.</span>"
|
||||
else
|
||||
usr << "<span class='notice'>The access panel is now closed.</span>"
|
||||
/obj/machinery/computer/aiupload/verb/AccessInternals()
|
||||
set category = "Object"
|
||||
set name = "Access Computer's Internals"
|
||||
set src in oview(1)
|
||||
if(get_dist(src, usr) > 1 || usr.restrained() || usr.lying || usr.stat || istype(usr, /mob/living/silicon))
|
||||
return
|
||||
|
||||
|
||||
attackby(obj/item/weapon/O as obj, mob/user as mob)
|
||||
if (using_map && !(user.z in using_map.contact_levels))
|
||||
user << "<span class='danger'>Unable to establish a connection:</span> You're too far away from the station!"
|
||||
return
|
||||
if(istype(O, /obj/item/weapon/aiModule))
|
||||
var/obj/item/weapon/aiModule/M = O
|
||||
M.install(src, user)
|
||||
else
|
||||
..()
|
||||
opened = !opened
|
||||
if(opened)
|
||||
to_chat(usr, "<span class='notice'>The access panel is now open.</span>")
|
||||
else
|
||||
to_chat(usr, "<span class='notice'>The access panel is now closed.</span>")
|
||||
return
|
||||
|
||||
|
||||
attack_hand(var/mob/user as mob)
|
||||
if(src.stat & NOPOWER)
|
||||
usr << "The upload computer has no power!"
|
||||
return
|
||||
if(src.stat & BROKEN)
|
||||
usr << "The upload computer is broken!"
|
||||
return
|
||||
/obj/machinery/computer/aiupload/attackby(obj/item/weapon/O as obj, mob/user as mob)
|
||||
if (using_map && !(user.z in using_map.contact_levels))
|
||||
to_chat(user, "<span class='danger'>Unable to establish a connection:</span> You're too far away from the station!")
|
||||
return
|
||||
if(istype(O, /obj/item/weapon/aiModule))
|
||||
var/obj/item/weapon/aiModule/M = O
|
||||
M.install(src, user)
|
||||
else
|
||||
..()
|
||||
|
||||
src.current = select_active_ai(user)
|
||||
|
||||
if (!src.current)
|
||||
usr << "No active AIs detected."
|
||||
else
|
||||
usr << "[src.current.name] selected for law changes."
|
||||
/obj/machinery/computer/aiupload/attack_hand(var/mob/user as mob)
|
||||
if(src.stat & NOPOWER)
|
||||
to_chat(user, "The upload computer has no power!")
|
||||
return
|
||||
if(src.stat & BROKEN)
|
||||
to_chat(user, "The upload computer is broken!")
|
||||
return
|
||||
|
||||
attack_ghost(user as mob)
|
||||
return 1
|
||||
src.current = select_active_ai(user)
|
||||
|
||||
if (!src.current)
|
||||
to_chat(user, "No active AIs detected.")
|
||||
else
|
||||
to_chat(user, "[src.current.name] selected for law changes.")
|
||||
return
|
||||
|
||||
/obj/machinery/computer/aiupload/attack_ghost(user as mob)
|
||||
return 1
|
||||
|
||||
|
||||
/obj/machinery/computer/borgupload
|
||||
@@ -65,28 +65,28 @@
|
||||
var/mob/living/silicon/robot/current = null
|
||||
|
||||
|
||||
attackby(obj/item/weapon/aiModule/module as obj, mob/user as mob)
|
||||
if(istype(module, /obj/item/weapon/aiModule))
|
||||
module.install(src)
|
||||
else
|
||||
return ..()
|
||||
/obj/machinery/computer/borgupload/attackby(obj/item/weapon/aiModule/module as obj, mob/user as mob)
|
||||
if(istype(module, /obj/item/weapon/aiModule))
|
||||
module.install(src, user)
|
||||
else
|
||||
return ..()
|
||||
|
||||
|
||||
attack_hand(var/mob/user as mob)
|
||||
if(src.stat & NOPOWER)
|
||||
usr << "The upload computer has no power!"
|
||||
return
|
||||
if(src.stat & BROKEN)
|
||||
usr << "The upload computer is broken!"
|
||||
return
|
||||
|
||||
src.current = freeborg()
|
||||
|
||||
if (!src.current)
|
||||
usr << "No free cyborgs detected."
|
||||
else
|
||||
usr << "[src.current.name] selected for law changes."
|
||||
/obj/machinery/computer/borgupload/attack_hand(var/mob/user as mob)
|
||||
if(src.stat & NOPOWER)
|
||||
to_chat(user, "The upload computer has no power!")
|
||||
return
|
||||
if(src.stat & BROKEN)
|
||||
to_chat(user, "The upload computer is broken!")
|
||||
return
|
||||
|
||||
attack_ghost(user as mob)
|
||||
return 1
|
||||
src.current = freeborg()
|
||||
|
||||
if (!src.current)
|
||||
to_chat(user, "No free cyborgs detected.")
|
||||
else
|
||||
to_chat(user, "[src.current.name] selected for law changes.")
|
||||
return
|
||||
|
||||
/obj/machinery/computer/borgupload/attack_ghost(user as mob)
|
||||
return 1
|
||||
|
||||
@@ -122,7 +122,7 @@
|
||||
dat += "<a href='?src=\ref[src];screen=1'>Back</a>"
|
||||
dat += "<br><b>Medical Robots:</b>"
|
||||
var/bdat = null
|
||||
for(var/mob/living/bot/medbot/M in world)
|
||||
for(var/mob/living/bot/medbot/M in mob_list)
|
||||
|
||||
if(M.z != src.z) continue //only find medibots on the same z-level as the computer
|
||||
var/turf/bl = get_turf(M)
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
/obj/machinery/computer/pod/New()
|
||||
..()
|
||||
spawn( 5 )
|
||||
for(var/obj/machinery/mass_driver/M in world)
|
||||
for(var/obj/machinery/mass_driver/M in machines)
|
||||
if(M.id == id)
|
||||
connected = M
|
||||
else
|
||||
@@ -32,19 +32,19 @@
|
||||
viewers(null, null) << "Cannot locate mass driver connector. Cancelling firing sequence!"
|
||||
return
|
||||
|
||||
for(var/obj/machinery/door/blast/M in world)
|
||||
for(var/obj/machinery/door/blast/M in machines)
|
||||
if(M.id == id)
|
||||
M.open()
|
||||
|
||||
sleep(20)
|
||||
|
||||
for(var/obj/machinery/mass_driver/M in world)
|
||||
for(var/obj/machinery/mass_driver/M in machines)
|
||||
if(M.id == id)
|
||||
M.power = connected.power
|
||||
M.drive()
|
||||
|
||||
sleep(50)
|
||||
for(var/obj/machinery/door/blast/M in world)
|
||||
for(var/obj/machinery/door/blast/M in machines)
|
||||
if(M.id == id)
|
||||
M.close()
|
||||
return
|
||||
@@ -182,7 +182,7 @@
|
||||
time += tp
|
||||
time = min(max(round(time), 0), 120)
|
||||
if(href_list["door"])
|
||||
for(var/obj/machinery/door/blast/M in world)
|
||||
for(var/obj/machinery/door/blast/M in machines)
|
||||
if(M.id == id)
|
||||
if(M.density)
|
||||
M.open()
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
else if(screen == 1)
|
||||
dat += "<HR>Chemical Implants<BR>"
|
||||
var/turf/Tr = null
|
||||
for(var/obj/item/weapon/implant/chem/C in world)
|
||||
for(var/obj/item/weapon/implant/chem/C in all_chem_implants)
|
||||
Tr = get_turf(C)
|
||||
if(!Tr) continue//Out of range
|
||||
if(!C.implanted) continue
|
||||
@@ -39,7 +39,7 @@
|
||||
dat += "<A href='?src=\ref[src];inject10=\ref[C]'>(<font color=red>(10)</font>)</A><BR>"
|
||||
dat += "********************************<BR>"
|
||||
dat += "<HR>Tracking Implants<BR>"
|
||||
for(var/obj/item/weapon/implant/tracking/T in world)
|
||||
for(var/obj/item/weapon/implant/tracking/T in all_tracking_implants)
|
||||
Tr = get_turf(T)
|
||||
if(!Tr) continue//Out of range
|
||||
if(!T.implanted) continue
|
||||
|
||||
@@ -92,7 +92,7 @@ var/specops_shuttle_timeleft = 0
|
||||
|
||||
specops_shuttle_at_station = 0
|
||||
|
||||
for(var/obj/machinery/computer/specops_shuttle/S in world)
|
||||
for(var/obj/machinery/computer/specops_shuttle/S in machines)
|
||||
S.specops_shuttle_timereset = world.time + SPECOPS_RETURN_DELAY
|
||||
|
||||
qdel(announcer)
|
||||
@@ -159,10 +159,10 @@ var/specops_shuttle_timeleft = 0
|
||||
sleep(10)
|
||||
|
||||
var/spawn_marauder[] = new()
|
||||
for(var/obj/effect/landmark/L in world)
|
||||
for(var/obj/effect/landmark/L in landmarks_list)
|
||||
if(L.name == "Marauder Entry")
|
||||
spawn_marauder.Add(L)
|
||||
for(var/obj/effect/landmark/L in world)
|
||||
for(var/obj/effect/landmark/L in landmarks_list)
|
||||
if(L.name == "Marauder Exit")
|
||||
var/obj/effect/portal/P = new(L.loc)
|
||||
P.invisibility = 101//So it is not seen by anyone.
|
||||
@@ -233,7 +233,7 @@ var/specops_shuttle_timeleft = 0
|
||||
var/mob/M = locate(/mob) in T
|
||||
M << "<span class='notice'>You have arrived to [station_name()]. Commence operation!</span>"
|
||||
|
||||
for(var/obj/machinery/computer/specops_shuttle/S in world)
|
||||
for(var/obj/machinery/computer/specops_shuttle/S in machines)
|
||||
S.specops_shuttle_timereset = world.time + SPECOPS_RETURN_DELAY
|
||||
|
||||
qdel(announcer)
|
||||
@@ -241,7 +241,7 @@ var/specops_shuttle_timeleft = 0
|
||||
/proc/specops_can_move()
|
||||
if(specops_shuttle_moving_to_station || specops_shuttle_moving_to_centcom)
|
||||
return 0
|
||||
for(var/obj/machinery/computer/specops_shuttle/S in world)
|
||||
for(var/obj/machinery/computer/specops_shuttle/S in machines)
|
||||
if(world.timeofday <= S.specops_shuttle_timereset)
|
||||
return 0
|
||||
return 1
|
||||
|
||||
@@ -209,8 +209,8 @@
|
||||
return
|
||||
|
||||
if("viewperipheral" in href_list) // open drive, show status of peripheral
|
||||
var/obj/item/part/computer/C = locate(href_list["viewperipheral"])
|
||||
if(!istype(C) || (C.loc != src.computer))
|
||||
var/obj/item/part/computer/C = locate(href_list["viewperipheral"]) in src.computer
|
||||
if(!istype(C))
|
||||
return
|
||||
|
||||
if(istype(C,/obj/item/part/computer/storage))
|
||||
@@ -219,13 +219,7 @@
|
||||
return
|
||||
// else ???
|
||||
if(istype(C,/obj/item/part/computer/cardslot))
|
||||
if(computer.cardslot.reader != null)
|
||||
computer.cardslot.remove()
|
||||
if(istype(C,/obj/item/part/computer/cardslot/dual))
|
||||
if(computer.cardslot.writer != null)
|
||||
computer.cardslot.remove(computer.cardslot.writer)
|
||||
if(computer.cardslot.reader != null)
|
||||
computer.cardslot.remove(computer.cardslot.reader)
|
||||
computer.cardslot.remove(usr)
|
||||
interact()
|
||||
return
|
||||
|
||||
|
||||
@@ -13,147 +13,137 @@
|
||||
interactable(user): performs all standard sanity checks
|
||||
Call in topic() and interact().
|
||||
*/
|
||||
proc/interactable(var/mob/user)
|
||||
if( !src || !user || stat || user.stat || user.lying || user.blinded )
|
||||
return 0
|
||||
if(!program)
|
||||
return 0
|
||||
/obj/machinery/computer3/proc/interactable(var/mob/user)
|
||||
if( !src || !user || stat || user.stat || user.lying || user.blinded )
|
||||
return 0
|
||||
if(!program)
|
||||
return 0
|
||||
if(!isturf(loc) || !isturf(user.loc)) // todo handheld maybe
|
||||
return 0
|
||||
if(user.restrained())
|
||||
to_chat(user, "<span class='warning'>You need a free hand!</span>")
|
||||
return 0
|
||||
|
||||
if(!istype(loc,/turf) || !istype(user.loc,/turf)) // todo handheld maybe
|
||||
return 0
|
||||
if(issilicon(user) &&!program.ai_allowed )
|
||||
to_chat(user, "<span class='warning'>You are forbidden from accessing this program.</span>")
|
||||
return 0
|
||||
if(!ishuman(user) && program.human_controls)
|
||||
to_chat(user, "<span class='warning'>Your body can't work the controls!</span>")
|
||||
return 0
|
||||
|
||||
if(istype(user,/mob/living/silicon))
|
||||
if(!program.ai_allowed)
|
||||
user << "<span class='warning'>You are forbidden from accessing this program.</span>"
|
||||
return 0
|
||||
else
|
||||
if(program.human_controls)
|
||||
if(!ishuman(user))
|
||||
user << "<span class='warning'>Your body can't work the controls!</span>"
|
||||
return 0
|
||||
if(user.restrained())
|
||||
user << "<span class='warning'>You need a free hand!</span>"
|
||||
return 0
|
||||
|
||||
if(!in_range(src,user))
|
||||
// telekinesis check
|
||||
if(ishuman(user) && istype(user.get_active_hand(),/obj/item/tk_grab))
|
||||
if(program.human_controls)
|
||||
user << "<span class='warning'>It's too complicated to work at a distance!</span>"
|
||||
return 0
|
||||
add_fingerprint(user)
|
||||
user.set_machine(src)
|
||||
return 1
|
||||
return 0
|
||||
if(!in_range(src,user) && (!program.human_controls || !istype(user.get_active_hand(),/obj/item/tk_grab)))
|
||||
// telekinesis check
|
||||
to_chat(user, "<span class='warning'>It's too complicated to work at a distance!</span>")
|
||||
return 0
|
||||
|
||||
add_fingerprint(user)
|
||||
user.set_machine(src)
|
||||
return 1
|
||||
add_fingerprint(user)
|
||||
user.set_machine(src)
|
||||
return 1
|
||||
|
||||
/*
|
||||
Deduplicates an item list and gives you range and direction.
|
||||
This is used for networking so you can determine which of several
|
||||
identically named objects you're referring to.
|
||||
*/
|
||||
proc/format_atomlist(var/list/atoms)
|
||||
var/list/output = list()
|
||||
for(var/atom/A in atoms)
|
||||
var/title = "[A] (Range [get_dist(A,src)] meters, [dir2text(get_dir(src,A))])"
|
||||
output[title] = A
|
||||
return output
|
||||
/obj/machinery/computer3/proc/format_atomlist(var/list/atoms)
|
||||
var/list/output = list()
|
||||
for(var/atom/A in atoms)
|
||||
var/title = "[A] (Range [get_dist(A,src)] meters, [dir2text(get_dir(src,A))])"
|
||||
output[title] = A
|
||||
return output
|
||||
|
||||
/*
|
||||
This is used by the camera monitoring program to see if you're still in range
|
||||
*/
|
||||
check_eye(var/mob/user as mob)
|
||||
if(!interactable(user) || user.machine != src)
|
||||
if(user.machine == src)
|
||||
user.unset_machine()
|
||||
return -1
|
||||
/obj/machinery/computer3/check_eye(var/mob/user as mob)
|
||||
if(!interactable(user) || user.machine != src)
|
||||
if(user.machine == src)
|
||||
user.unset_machine()
|
||||
return -1
|
||||
|
||||
var/datum/file/program/security/S = program
|
||||
if( !istype(S) || !S.current || !S.current.status || !camnet )
|
||||
if( user.machine == src )
|
||||
user.unset_machine()
|
||||
return -1
|
||||
var/datum/file/program/security/S = program
|
||||
if( !istype(S) || !S.current || !S.current.status || !camnet )
|
||||
if( user.machine == src )
|
||||
user.unset_machine()
|
||||
return -1
|
||||
|
||||
user.reset_view(S.current, 0)
|
||||
return 0
|
||||
user.reset_view(S.current, 0)
|
||||
return 0
|
||||
|
||||
/*
|
||||
List all files, including removable disks and data cards
|
||||
(I don't know why but I don't want to rip data cards out.
|
||||
It just seems... interesting?)
|
||||
*/
|
||||
proc/list_files(var/typekey = null)
|
||||
var/list/files = list()
|
||||
if(hdd)
|
||||
files += hdd.files
|
||||
if(floppy && floppy.inserted)
|
||||
files += floppy.inserted.files
|
||||
if(cardslot && istype(cardslot.reader,/obj/item/weapon/card/data))
|
||||
files += cardslot.reader:files
|
||||
if(!ispath(typekey))
|
||||
return files
|
||||
|
||||
var/i = 1
|
||||
while(i<=files.len)
|
||||
if(istype(files[i],typekey))
|
||||
i++
|
||||
continue
|
||||
files.Cut(i,i+1)
|
||||
/obj/machinery/computer3/proc/list_files(var/typekey = null)
|
||||
var/list/files = list()
|
||||
if(hdd)
|
||||
files += hdd.files
|
||||
if(floppy && floppy.inserted)
|
||||
files += floppy.inserted.files
|
||||
if(cardslot && istype(cardslot.reader,/obj/item/weapon/card/data))
|
||||
files += cardslot.reader:files
|
||||
if(!ispath(typekey))
|
||||
return files
|
||||
|
||||
var/i = 1
|
||||
while(i<=files.len)
|
||||
if(istype(files[i],typekey))
|
||||
i++
|
||||
continue
|
||||
files.Cut(i,i+1)
|
||||
return files
|
||||
|
||||
/*
|
||||
Crash the computer with an error.
|
||||
Todo: redo
|
||||
*/
|
||||
proc/Crash(var/errorcode = PROG_CRASH)
|
||||
if(!src)
|
||||
return null
|
||||
|
||||
switch(errorcode)
|
||||
if(PROG_CRASH)
|
||||
if(usr)
|
||||
usr << "<span class='warning'>The program crashed!</span>"
|
||||
usr << browse(null,"\ref[src]")
|
||||
Reset()
|
||||
|
||||
if(MISSING_PERIPHERAL)
|
||||
Reset()
|
||||
if(usr)
|
||||
usr << browse("<h2>ERROR: Missing or disabled component</h2><b>A hardware failure has occured. Please insert or replace the missing or damaged component and restart the computer.</b>","window=\ref[src]")
|
||||
|
||||
if(BUSTED_ASS_COMPUTER)
|
||||
Reset()
|
||||
os.error = BUSTED_ASS_COMPUTER
|
||||
if(usr)
|
||||
usr << browse("<h2>ERROR: Missing or disabled component</h2><b>A hardware failure has occured. Please insert or replace the missing or damaged component and restart the computer.</b>","window=\ref[src]")
|
||||
|
||||
if(MISSING_PROGRAM)
|
||||
Reset()
|
||||
if(usr)
|
||||
usr << browse("<h2>ERROR: No associated program</h2><b>This file requires a specific program to open, which cannot be located. Please install the related program and try again.</b>","window=\ref[src]")
|
||||
|
||||
if(FILE_DRM)
|
||||
Reset()
|
||||
if(usr)
|
||||
usr << browse("<h2>ERROR: File operation prohibited</h2><b>Copy protection exception: missing authorization token.</b>","window=\ref[src]")
|
||||
|
||||
if(NETWORK_FAILURE)
|
||||
Reset()
|
||||
if(usr)
|
||||
usr << browse("<h2>ERROR: Networking exception: Unable to connect to remote host.</h2>","window=\ref[src]")
|
||||
|
||||
|
||||
else
|
||||
if(usr)
|
||||
usr << "<span class='warning'>The program crashed!</span>"
|
||||
usr << browse(null,"\ref[src]")
|
||||
testing("computer/Crash() - unknown error code [errorcode]")
|
||||
Reset()
|
||||
/obj/machinery/computer3/proc/Crash(var/errorcode = PROG_CRASH)
|
||||
if(!src)
|
||||
return null
|
||||
|
||||
switch(errorcode)
|
||||
if(PROG_CRASH)
|
||||
if(usr)
|
||||
usr << "<span class='warning'>The program crashed!</span>"
|
||||
usr << browse(null,"\ref[src]")
|
||||
Reset()
|
||||
|
||||
if(MISSING_PERIPHERAL)
|
||||
Reset()
|
||||
if(usr)
|
||||
usr << browse("<h2>ERROR: Missing or disabled component</h2><b>A hardware failure has occured. Please insert or replace the missing or damaged component and restart the computer.</b>","window=\ref[src]")
|
||||
|
||||
if(BUSTED_ASS_COMPUTER)
|
||||
Reset()
|
||||
os.error = BUSTED_ASS_COMPUTER
|
||||
if(usr)
|
||||
usr << browse("<h2>ERROR: Missing or disabled component</h2><b>A hardware failure has occured. Please insert or replace the missing or damaged component and restart the computer.</b>","window=\ref[src]")
|
||||
|
||||
if(MISSING_PROGRAM)
|
||||
Reset()
|
||||
if(usr)
|
||||
usr << browse("<h2>ERROR: No associated program</h2><b>This file requires a specific program to open, which cannot be located. Please install the related program and try again.</b>","window=\ref[src]")
|
||||
|
||||
if(FILE_DRM)
|
||||
Reset()
|
||||
if(usr)
|
||||
usr << browse("<h2>ERROR: File operation prohibited</h2><b>Copy protection exception: missing authorization token.</b>","window=\ref[src]")
|
||||
|
||||
if(NETWORK_FAILURE)
|
||||
Reset()
|
||||
if(usr)
|
||||
usr << browse("<h2>ERROR: Networking exception: Unable to connect to remote host.</h2>","window=\ref[src]")
|
||||
|
||||
else
|
||||
if(usr)
|
||||
usr << "<span class='warning'>The program crashed!</span>"
|
||||
usr << browse(null,"\ref[src]")
|
||||
testing("computer/Crash() - unknown error code [errorcode]")
|
||||
Reset()
|
||||
return null
|
||||
|
||||
#define ANY_DRIVE 0
|
||||
#define PREFER_FLOPPY 1
|
||||
#define PREFER_CARD 2
|
||||
@@ -161,22 +151,26 @@
|
||||
|
||||
|
||||
// required_location: only put on preferred devices
|
||||
proc/writefile(var/datum/file/F, var/where = ANY_DRIVE, var/required_location = 0)
|
||||
if(where != ANY_DRIVE)
|
||||
if((where&PREFER_FLOPPY) && floppy && floppy.addfile(F))
|
||||
return 1
|
||||
if((where&PREFER_CARD) && cardslot && cardslot.addfile(F))
|
||||
return 1
|
||||
if((where&PREFER_HDD) && hdd && hdd.addfile(F))
|
||||
/obj/machinery/computer3/proc/writefile(var/datum/file/F, var/where = ANY_DRIVE, var/required_location = 0)
|
||||
if(where != ANY_DRIVE)
|
||||
if((where&PREFER_FLOPPY) && floppy && floppy.addfile(F))
|
||||
return 1
|
||||
if((where&PREFER_CARD) && istype(cardslot, /obj/item/part/computer/cardslot/dual))
|
||||
var/obj/item/part/computer/cardslot/dual/D = cardslot
|
||||
if(D.addfile(F))
|
||||
return 1
|
||||
if((where&PREFER_HDD) && hdd && hdd.addfile(F))
|
||||
return 1
|
||||
|
||||
if(required_location)
|
||||
return 0
|
||||
if(required_location)
|
||||
return 0
|
||||
|
||||
if(floppy && floppy.addfile(F))
|
||||
if(floppy && floppy.addfile(F))
|
||||
return 1
|
||||
if(istype(cardslot, /obj/item/part/computer/cardslot/dual))
|
||||
var/obj/item/part/computer/cardslot/dual/D = cardslot
|
||||
if(D.addfile(F))
|
||||
return 1
|
||||
if(cardslot && cardslot.addfile(F))
|
||||
return 1
|
||||
if(hdd && hdd.addfile(F))
|
||||
return 1
|
||||
return 0
|
||||
if(hdd && hdd.addfile(F))
|
||||
return 1
|
||||
return 0
|
||||
|
||||
@@ -81,46 +81,46 @@
|
||||
if(istype(P, /obj/item/weapon/wrench))
|
||||
playsound(src.loc, P.usesound, 50, 1)
|
||||
if(do_after(user, 20 * P.toolspeed))
|
||||
user << "<span class='notice'>You wrench the frame into place.</span>"
|
||||
to_chat(user, "<span class='notice'>You wrench the frame into place.</span>")
|
||||
src.anchored = 1
|
||||
src.state = 1
|
||||
if(istype(P, /obj/item/weapon/weldingtool))
|
||||
var/obj/item/weapon/weldingtool/WT = P
|
||||
if(!WT.remove_fuel(0, user))
|
||||
user << "The welding tool must be on to complete this task."
|
||||
to_chat(user, "The welding tool must be on to complete this task.")
|
||||
return
|
||||
playsound(src.loc, WT.usesound, 50, 1)
|
||||
if(do_after(user, 20 * WT.toolspeed))
|
||||
if(!src || !WT.isOn()) return
|
||||
user << "<span class='notice'>You deconstruct the frame.</span>"
|
||||
to_chat(user, "<span class='notice'>You deconstruct the frame.</span>")
|
||||
new /obj/item/stack/material/steel( src.loc, 5 )
|
||||
qdel(src)
|
||||
if(1)
|
||||
if(istype(P, /obj/item/weapon/wrench))
|
||||
playsound(src.loc, P.usesound, 50, 1)
|
||||
if(do_after(user, 20 * P.toolspeed))
|
||||
user << "<span class='notice'>You unfasten the frame.</span>"
|
||||
to_chat(user, "<span class='notice'>You unfasten the frame.</span>")
|
||||
src.anchored = 0
|
||||
src.state = 0
|
||||
if(istype(P, /obj/item/weapon/circuitboard) && !circuit)
|
||||
var/obj/item/weapon/circuitboard/B = P
|
||||
if(B.board_type == "computer")
|
||||
playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1)
|
||||
user << "<span class='notice'>You place the circuit board inside the frame.</span>"
|
||||
to_chat(user, "<span class='notice'>You place the circuit board inside the frame.</span>")
|
||||
src.icon_state = "1"
|
||||
src.circuit = P
|
||||
user.drop_item()
|
||||
P.loc = src
|
||||
else
|
||||
user << "<span class='warning'>This frame does not accept circuit boards of this type!</span>"
|
||||
to_chat(user, "<span class='warning'>This frame does not accept circuit boards of this type!</span>")
|
||||
if(istype(P, /obj/item/weapon/screwdriver) && circuit)
|
||||
playsound(src.loc, P.usesound, 50, 1)
|
||||
user << "<span class='notice'>You screw the circuit board into place.</span>"
|
||||
to_chat(user, "<span class='notice'>You screw the circuit board into place.</span>")
|
||||
src.state = 2
|
||||
src.icon_state = "2"
|
||||
if(istype(P, /obj/item/weapon/crowbar) && circuit)
|
||||
playsound(src.loc, P.usesound, 50, 1)
|
||||
user << "<span class='notice'>You remove the circuit board.</span>"
|
||||
to_chat(user, "<span class='notice'>You remove the circuit board.</span>")
|
||||
src.state = 1
|
||||
src.icon_state = "0"
|
||||
circuit.loc = src.loc
|
||||
@@ -128,7 +128,7 @@
|
||||
if(2)
|
||||
if(istype(P, /obj/item/weapon/screwdriver) && circuit)
|
||||
playsound(src.loc, P.usesound, 50, 1)
|
||||
user << "<span class='notice'>You unfasten the circuit board.</span>"
|
||||
to_chat(user, "<span class='notice'>You unfasten the circuit board.</span>")
|
||||
src.state = 1
|
||||
src.icon_state = "1"
|
||||
|
||||
@@ -137,10 +137,10 @@
|
||||
playsound(src.loc, P.usesound, 50, 1)
|
||||
if(do_after(10 * P.toolspeed))
|
||||
battery.loc = loc
|
||||
user << "<span class='notice'>You remove [battery].</span>"
|
||||
to_chat(user, "<span class='notice'>You remove [battery].</span>")
|
||||
battery = null
|
||||
else
|
||||
user << "<span class='warning'>There's no battery to remove!</span>"
|
||||
to_chat(user, "<span class='warning'>There's no battery to remove!</span>")
|
||||
|
||||
if(istype(P, /obj/item/weapon/cell))
|
||||
if(!battery)
|
||||
@@ -148,9 +148,9 @@
|
||||
if(do_after(5))
|
||||
battery = P
|
||||
P.loc = src
|
||||
user << "<span class='notice'>You insert [battery].</span>"
|
||||
to_chat(user, "<span class='notice'>You insert [battery].</span>")
|
||||
else
|
||||
user << "<span class='warning'>There's already \an [battery] in [src]!</span>"
|
||||
to_chat(user, "<span class='warning'>There's already \an [battery] in [src]!</span>")
|
||||
|
||||
|
||||
if(istype(P, /obj/item/stack/cable_coil))
|
||||
@@ -160,16 +160,16 @@
|
||||
if(P)
|
||||
P:amount -= 5
|
||||
if(!P:amount) qdel(P)
|
||||
user << "<span class='notice'>You add cables to the frame.</span>"
|
||||
to_chat(user, "<span class='notice'>You add cables to the frame.</span>")
|
||||
src.state = 3
|
||||
src.icon_state = "3"
|
||||
if(3)
|
||||
if(istype(P, /obj/item/weapon/wirecutters))
|
||||
if(components.len)
|
||||
user << "There are parts in the way!"
|
||||
to_chat(user, "There are parts in the way!")
|
||||
return
|
||||
playsound(src.loc, P.usesound, 50, 1)
|
||||
user << "<span class='notice'>You remove the cables.</span>"
|
||||
to_chat(user, "<span class='notice'>You remove the cables.</span>")
|
||||
src.state = 2
|
||||
src.icon_state = "2"
|
||||
var/obj/item/stack/cable_coil/A = new /obj/item/stack/cable_coil( src.loc )
|
||||
@@ -185,19 +185,19 @@
|
||||
if(do_after(user, 20))
|
||||
if(S)
|
||||
S.use(2)
|
||||
user << "<span class='notice'>You put in the glass panel.</span>"
|
||||
to_chat(user, "<span class='notice'>You put in the glass panel.</span>")
|
||||
src.state = 4
|
||||
src.icon_state = "4"
|
||||
if(4)
|
||||
if(istype(P, /obj/item/weapon/crowbar))
|
||||
playsound(src.loc, P.usesound, 50, 1)
|
||||
user << "<span class='notice'>You remove the glass panel.</span>"
|
||||
to_chat(user, "<span class='notice'>You remove the glass panel.</span>")
|
||||
src.state = 3
|
||||
src.icon_state = "3"
|
||||
new /obj/item/stack/material/glass( src.loc, 2 )
|
||||
if(istype(P, /obj/item/weapon/screwdriver))
|
||||
playsound(src.loc, P.usesound, 50, 1)
|
||||
user << "<span class='notice'>You connect the monitor.</span>"
|
||||
to_chat(user, "<span class='notice'>You connect the monitor.</span>")
|
||||
var/obj/machinery/computer3/B = new src.circuit.build_path ( src.loc, built=1 )
|
||||
/*if(circuit.powernet) B:powernet = circuit.powernet
|
||||
if(circuit.id) B:id = circuit.id
|
||||
@@ -220,7 +220,7 @@
|
||||
*/
|
||||
/obj/structure/computer3frame/proc/remove_peripheral(var/obj/item/I = null)
|
||||
if(!components || !components.len)
|
||||
usr << "<span class='warning'>There are no components in [src] to take out!</span>"
|
||||
to_chat(usr, "<span class='warning'>There are no components in [src] to take out!</span>")
|
||||
return 0
|
||||
if(!I)
|
||||
I = input(usr, "Remove which component?","Remove component", null) as null|obj in components
|
||||
@@ -259,44 +259,45 @@
|
||||
else
|
||||
warning("Erronous component in computerframe/remove_peripheral: [I]")
|
||||
I.loc = loc
|
||||
usr << "<span class='notice'>You remove [I]</span>"
|
||||
to_chat(usr, "<span class='notice'>You remove [I]</span>")
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/obj/structure/computer3frame/proc/insert_peripheral(var/obj/item/I)
|
||||
if(components.len >= max_components)
|
||||
usr << "There isn't room in [src] for another component!"
|
||||
to_chat(usr, "There isn't room in [src] for another component!")
|
||||
return 0
|
||||
switch(I.type)
|
||||
if(/obj/item/part/computer/storage/hdd)
|
||||
if(hdd)
|
||||
usr << "There is already \an [hdd] in [src]!"
|
||||
to_chat(usr, "There is already \an [hdd] in [src]!")
|
||||
return 0
|
||||
hdd = I
|
||||
components += hdd
|
||||
hdd.loc = src
|
||||
if(/obj/item/part/computer/storage/removable)
|
||||
if(floppy)
|
||||
usr << "There is already \an [floppy] in [src]!"
|
||||
to_chat(usr, "There is already \an [floppy] in [src]!")
|
||||
return 0
|
||||
floppy = I
|
||||
components += floppy
|
||||
floppy.loc = src
|
||||
if(/obj/item/part/computer/networking/radio)
|
||||
if(radio)
|
||||
usr << "There is already \an [radio] in [src]!"
|
||||
to_chat(usr, "There is already \an [radio] in [src]!")
|
||||
return 0
|
||||
radio = I
|
||||
components += radio
|
||||
radio.loc = src
|
||||
if(/obj/item/part/computer/networking/cameras)
|
||||
if(camnet)
|
||||
usr << "There is already \an [camnet] in [src]!"
|
||||
to_chat(usr, "There is already \an [camnet] in [src]!")
|
||||
return 0
|
||||
camnet = I
|
||||
components += camnet
|
||||
camnet.loc = src
|
||||
if(/obj/item/part/computer/networking)
|
||||
if(net)
|
||||
usr << "There is already \an [net] in [src]!"
|
||||
to_chat(usr, "There is already \an [net] in [src]!")
|
||||
|
||||
|
||||
|
||||
@@ -23,14 +23,14 @@
|
||||
|
||||
// If the computer is attacked by an item it will reference this to decide which peripheral(s) are affected.
|
||||
var/list/attackby_types = list()
|
||||
proc/allow_attackby(var/obj/item/I as obj,var/mob/user as mob)
|
||||
|
||||
for(var/typekey in attackby_types)
|
||||
if(istype(I,typekey))
|
||||
return 1
|
||||
return 0
|
||||
/obj/item/part/computer/proc/allow_attackby(var/obj/item/I, var/mob/user)
|
||||
for(var/typepath in attackby_types)
|
||||
if(istype(I, typepath))
|
||||
return 1
|
||||
return 0
|
||||
|
||||
proc/init(var/obj/machinery/computer/target)
|
||||
/obj/item/part/computer/proc/init(var/obj/machinery/computer/target)
|
||||
computer = target
|
||||
// continue to handle all other type-specific procedures
|
||||
|
||||
@@ -49,40 +49,39 @@
|
||||
var/mob/living/silicon/ai/occupant = null
|
||||
var/busy = 0
|
||||
|
||||
attackby(obj/I as obj,mob/user as mob)
|
||||
if(computer && !computer.stat)
|
||||
/obj/item/part/computer/ai_holder/attackby(obj/I as obj,mob/user as mob)
|
||||
if(computer && !computer.stat)
|
||||
if(istype(I, /obj/item/device/aicard))
|
||||
var/obj/item/device/aicard/card = I
|
||||
var/mob/living/silicon/ai/comp_ai = locate() in src
|
||||
var/mob/living/silicon/ai/card_ai = locate() in card
|
||||
|
||||
if(istype(I, /obj/item/device/aicard))
|
||||
if(istype(comp_ai))
|
||||
if(busy)
|
||||
to_chat(user, "<span class='danger'>ERROR:</span> Reconstruction in progress.")
|
||||
return
|
||||
|
||||
var/obj/item/device/aicard/card = I
|
||||
var/mob/living/silicon/ai/comp_ai = locate() in src
|
||||
var/mob/living/silicon/ai/card_ai = locate() in card
|
||||
if(card.grab_ai(comp_ai, user))
|
||||
occupant = null
|
||||
|
||||
if(istype(comp_ai))
|
||||
if(busy)
|
||||
user << "<span class='danger'>ERROR:</span> Reconstruction in progress."
|
||||
return
|
||||
card.grab_ai(comp_ai, user)
|
||||
if(!(locate(/mob/living/silicon/ai) in src)) occupant = null
|
||||
else if(istype(card_ai))
|
||||
load_ai(card_ai,card,user)
|
||||
occupant = locate(/mob/living/silicon/ai) in src
|
||||
else if(istype(card_ai))
|
||||
load_ai(card_ai,card,user)
|
||||
|
||||
if(computer.program)
|
||||
computer.program.update_icon()
|
||||
computer.update_icon()
|
||||
computer.occupant = occupant
|
||||
..()
|
||||
return
|
||||
if(computer.program)
|
||||
computer.program.update_icon()
|
||||
|
||||
computer.update_icon()
|
||||
..()
|
||||
return
|
||||
|
||||
/obj/item/part/computer/ai_holder/proc/load_ai(var/mob/living/silicon/ai/transfer, var/obj/item/device/aicard/card, var/mob/user)
|
||||
|
||||
if(!transfer)
|
||||
if(!istype(transfer))
|
||||
return
|
||||
|
||||
// Transfer over the AI.
|
||||
transfer << "You have been transferred into a mobile terminal. Sadly, there is no remote access from here."
|
||||
user << "<span class='notice'>Transfer successful:</span> [transfer.name] placed within mobile terminal."
|
||||
to_chat(transfer, "You have been transferred into a mobile terminal. Sadly, there is no remote access from here.")
|
||||
to_chat(user, "<span class='notice'>Transfer successful:</span> [transfer.name] placed within mobile terminal.")
|
||||
|
||||
transfer.loc = src
|
||||
transfer.cancel_camera()
|
||||
@@ -102,228 +101,131 @@
|
||||
desc = "Contains a slot for reading magnetic swipe cards."
|
||||
|
||||
var/obj/item/weapon/card/reader = null
|
||||
var/obj/item/weapon/card/writer = null // so that you don't need to typecast dual cardslots, but pretend it's not here
|
||||
// alternately pretend they did it to save money on manufacturing somehow
|
||||
var/dualslot = 0 // faster than typechecking
|
||||
|
||||
attackby_types = list(/obj/item/weapon/card)
|
||||
|
||||
attackby(var/obj/item/I as obj, var/mob/user as mob)
|
||||
if(istype(I,/obj/item/weapon/card))
|
||||
insert(I)
|
||||
/obj/item/part/computer/cardslot/attackby(var/obj/item/I as obj, var/mob/user)
|
||||
if(istype(I,/obj/item/weapon/card) && computer)
|
||||
if(istype(I,/obj/item/weapon/card/emag) && !reader) // emag reader slot
|
||||
user.visible_message("[computer]'s screen flickers for a moment.","You insert \the [I]. After a moment, the card ejects itself, and [computer] beeps.","[computer] beeps.")
|
||||
computer.emagged = 1
|
||||
return
|
||||
..(I,user)
|
||||
|
||||
insert(I, user)
|
||||
return
|
||||
..(I,user)
|
||||
|
||||
// cardslot.insert(card, slot)
|
||||
// card: The card obj you want to insert (usually your ID)
|
||||
// slot: Which slot to insert into (1: reader, 2: writer, 3: auto), 3 default
|
||||
proc/insert(var/obj/item/weapon/card/card, var/slot = 3)
|
||||
if(!computer)
|
||||
return 0
|
||||
// This shouldn't happen, just in case..
|
||||
if(slot == 2 && !dualslot)
|
||||
usr << "This device has only one card slot"
|
||||
return 0
|
||||
|
||||
if(istype(card,/obj/item/weapon/card/emag)) // emag reader slot
|
||||
if(!writer)
|
||||
usr << "You insert \the [card], and the computer grinds, sparks, and beeps. After a moment, the card ejects itself."
|
||||
computer.emagged = 1
|
||||
return 1
|
||||
else
|
||||
usr << "You are unable to insert \the [card], as the reader slot is occupied"
|
||||
|
||||
var/mob/living/L = usr
|
||||
switch(slot)
|
||||
if(1)
|
||||
if(equip_to_reader(card, L))
|
||||
usr << "You insert the card into reader slot"
|
||||
else
|
||||
usr << "There is already something in the reader slot."
|
||||
if(2)
|
||||
if(equip_to_writer(card, L))
|
||||
usr << "You insert the card into writer slot"
|
||||
else
|
||||
usr << "There is already something in the reader slot."
|
||||
if(3)
|
||||
if(equip_to_reader(card, L))
|
||||
usr << "You insert the card into reader slot"
|
||||
else if (equip_to_writer(card, L) && dualslot)
|
||||
usr << "You insert the card into writer slot"
|
||||
else if (dualslot)
|
||||
usr << "There is already something in both slots."
|
||||
else
|
||||
usr << "There is already something in the reader slot."
|
||||
// user: The mob inserting the card
|
||||
/obj/item/part/computer/cardslot/proc/insert(var/obj/item/weapon/card/card, var/mob/user)
|
||||
if(equip_to_reader(card, user))
|
||||
to_chat(user, "You insert the card into reader slot")
|
||||
return 1
|
||||
to_chat(user, "There is already something in the reader slot.")
|
||||
return 0
|
||||
|
||||
|
||||
// Usage of insert() preferred, as it also tells result to the user.
|
||||
proc/equip_to_reader(var/obj/item/weapon/card/card, var/mob/living/L)
|
||||
if(!reader)
|
||||
L.drop_item()
|
||||
card.loc = src
|
||||
reader = card
|
||||
return 1
|
||||
return 0
|
||||
|
||||
proc/equip_to_writer(var/obj/item/weapon/card/card, var/mob/living/L)
|
||||
if(!writer && dualslot)
|
||||
L.drop_item()
|
||||
card.loc = src
|
||||
writer = card
|
||||
return 1
|
||||
return 0
|
||||
/obj/item/part/computer/cardslot/proc/equip_to_reader(var/obj/item/weapon/card/card, var/mob/living/L)
|
||||
if(!reader)
|
||||
L.drop_item()
|
||||
card.loc = src
|
||||
reader = card
|
||||
return 1
|
||||
return 0
|
||||
|
||||
// cardslot.remove(slot)
|
||||
// slot: Which slot to remove card(s) from (1: reader only, 2: writer only, 3: both [works even with one card], 4: reader and if empty then writer ), 3 default
|
||||
proc/remove(var/slot = 3)
|
||||
var/mob/living/L = usr
|
||||
switch(slot)
|
||||
if(1)
|
||||
if (remove_reader(L))
|
||||
L << "You remove the card from reader slot"
|
||||
else
|
||||
L << "There is no card in the reader slot"
|
||||
if(2)
|
||||
if (remove_writer(L))
|
||||
L << "You remove the card from writer slot"
|
||||
else
|
||||
L << "There is no card in the writer slot"
|
||||
if(3)
|
||||
if (remove_reader(L))
|
||||
if (remove_writer(L))
|
||||
L << "You remove cards from both slots"
|
||||
else
|
||||
L << "You remove the card from reader slot"
|
||||
else
|
||||
if(remove_writer(L))
|
||||
L << "You remove the card from writer slot"
|
||||
else
|
||||
L << "There are no cards in both slots"
|
||||
if(4)
|
||||
if (!remove_reader(L))
|
||||
if (remove_writer(L))
|
||||
L << "You remove the card from writer slot"
|
||||
else if (!dualslot)
|
||||
L << "There is no card in the reader slot"
|
||||
else
|
||||
L << "There are no cards in both slots"
|
||||
else
|
||||
L << "You remove the card from reader slot"
|
||||
// user: The mob removing the card
|
||||
/obj/item/part/computer/cardslot/proc/remove(var/mob/user)
|
||||
if(remove_reader(user))
|
||||
to_chat(user, "You remove the card from reader slot")
|
||||
return 1
|
||||
to_chat(user, "There is nothing in the reader slot")
|
||||
return 0
|
||||
|
||||
|
||||
proc/remove_reader(var/mob/living/L)
|
||||
if(reader)
|
||||
reader.loc = loc
|
||||
if(istype(L) && !L.get_active_hand())
|
||||
if(istype(L,/mob/living/carbon/human))
|
||||
L.put_in_hands(reader)
|
||||
else
|
||||
reader.loc = get_turf(computer)
|
||||
else
|
||||
reader.loc = get_turf(computer)
|
||||
reader = null
|
||||
return 1
|
||||
return 0
|
||||
|
||||
proc/remove_writer(var/mob/living/L)
|
||||
if(writer && dualslot)
|
||||
writer.loc = loc
|
||||
if(istype(L) && !L.get_active_hand())
|
||||
if(istype(L,/mob/living/carbon/human))
|
||||
L.put_in_hands(writer)
|
||||
else
|
||||
writer.loc = get_turf(computer)
|
||||
else
|
||||
writer.loc = get_turf(computer)
|
||||
writer = null
|
||||
return 1
|
||||
return 0
|
||||
/obj/item/part/computer/cardslot/proc/remove_reader(var/mob/living/L)
|
||||
if(reader)
|
||||
if(ishuman(L) && !L.get_active_hand())
|
||||
L.put_in_hands(reader)
|
||||
else
|
||||
reader.loc = get_turf(computer)
|
||||
reader = null
|
||||
return 1
|
||||
return 0
|
||||
|
||||
// Authorizes the user based on the computer's requirements
|
||||
proc/authenticate()
|
||||
/obj/item/part/computer/cardslot/proc/authenticate()
|
||||
return computer.check_access(reader)
|
||||
|
||||
proc/addfile(var/datum/file/F)
|
||||
if(!dualslot || !istype(writer,/obj/item/weapon/card/data))
|
||||
return 0
|
||||
var/obj/item/weapon/card/data/D = writer
|
||||
if(D.files.len > 3)
|
||||
return 0
|
||||
D.files += F
|
||||
return 1
|
||||
|
||||
/obj/item/part/computer/cardslot/dual
|
||||
name = "magnetic card reader"
|
||||
desc = "Contains slots for inserting magnetic swipe cards for reading and writing."
|
||||
dualslot = 1
|
||||
|
||||
var/obj/item/weapon/card/writer = null
|
||||
|
||||
|
||||
/*
|
||||
// Atlantis: Reworked card manipulation a bit.
|
||||
// No need for separated code for dual and single readers.
|
||||
// Both is handled in single-slot reader code now, thanks to the "dualslot" var.
|
||||
// Leaving this code here if someone wants to somehow use it, just uncomment.
|
||||
// Ater: Single- and dual-slot card readers have separate functions.
|
||||
// According to OOP principles, they should be separate classes and use inheritance, polymorphism.
|
||||
|
||||
insert(var/obj/item/weapon/card/card,var/slot = 0)
|
||||
if(!computer)
|
||||
return 0
|
||||
|
||||
if(istype(card,/obj/item/weapon/card/emag) && !reader) // emag reader slot
|
||||
usr.visible_message("[computer]'s screen flickers for a moment.","You insert \the [card]. After a moment, the card ejects itself, and [computer] beeps.","[computer] beeps.")
|
||||
computer.emagged = 1
|
||||
return 1
|
||||
/obj/item/part/computer/cardslot/dual/proc/equip_to_writer(var/obj/item/weapon/card/card, var/mob/living/L)
|
||||
if(!writer)
|
||||
L.drop_item()
|
||||
card.loc = src
|
||||
writer = card
|
||||
return 1
|
||||
return 0
|
||||
|
||||
if(slot == 1) // 1: writer
|
||||
if(writer != null)
|
||||
usr << "There's already a card in that slot!"
|
||||
return 0
|
||||
var/mob/living/L = usr
|
||||
L.drop_item()
|
||||
card.loc = src
|
||||
writer = card
|
||||
return 1
|
||||
else if(slot == 2) // 2: reader
|
||||
if(reader != null)
|
||||
usr << "There's already a card in that slot!"
|
||||
return 0
|
||||
var/mob/living/L = usr
|
||||
L.drop_item()
|
||||
card.loc = src
|
||||
reader = card
|
||||
return 1
|
||||
else // 0: auto
|
||||
if(reader && writer)
|
||||
usr << "Both slots are full!"
|
||||
return 0
|
||||
var/mob/living/L = usr
|
||||
L.drop_item()
|
||||
card.loc = src
|
||||
if(reader)
|
||||
writer = card
|
||||
computer.updateUsrDialog()
|
||||
return 1
|
||||
if(istype(card,/obj/item/weapon/card/id) && !(access_change_ids in card:access) && !writer) // not authorized
|
||||
writer = card
|
||||
computer.updateUsrDialog()
|
||||
return 1
|
||||
if(!reader)
|
||||
reader = card
|
||||
computer.updateUsrDialog()
|
||||
return 1
|
||||
return 0
|
||||
|
||||
remove(var/obj/item/weapon/card/card)
|
||||
if(card != reader && card != writer)
|
||||
return
|
||||
|
||||
if(card == reader) reader = null
|
||||
if(card == writer) writer = null
|
||||
card.loc = loc
|
||||
|
||||
var/mob/living/carbon/human/user = usr
|
||||
if(ishuman(user) && !user.get_active_hand())
|
||||
user.put_in_hands(card)
|
||||
/obj/item/part/computer/cardslot/dual/proc/remove_from_writer(var/mob/living/L)
|
||||
if(writer)
|
||||
if(ishuman(L) && !L.get_active_hand())
|
||||
L.put_in_hands(writer)
|
||||
else
|
||||
card.loc = computer.loc
|
||||
*/
|
||||
writer.loc = get_turf(computer)
|
||||
writer = null
|
||||
return 1
|
||||
return 0
|
||||
|
||||
// cardslot.insert(card, slot)
|
||||
// card: The card obj you want to insert (usually your ID)
|
||||
// user: The mob inserting the card
|
||||
// slot: Which slot to insert into (1->Reader, 2->Writer, 3->Auto) Default 3
|
||||
/obj/item/part/computer/cardslot/dual/insert(var/obj/item/weapon/card/card, var/mob/user, var/slot = 3)
|
||||
world << "User is [user]"
|
||||
if(slot != 2)
|
||||
if(..(card, user))
|
||||
return 1
|
||||
|
||||
if(slot != 1)
|
||||
if(equip_to_writer(card, user))
|
||||
to_chat(user, "You insert the card into writer slot")
|
||||
return 1
|
||||
else
|
||||
to_chat(user, "There is already something in the writer slot.")
|
||||
return 0
|
||||
|
||||
// cardslot/dual.insert(card, slot)
|
||||
// user: The mob removing the card
|
||||
// slot: Which slot to remove from (1->Reader, 2->Writer, 3->Both, 4->Reader and if empty, Writer) Default 3
|
||||
/obj/item/part/computer/cardslot/dual/remove(var/mob/user, var/slot = 3)
|
||||
if(slot != 2)
|
||||
if(..(user) && slot != 3) // ..() probes reader
|
||||
return 1 // slot is either 1 or 4, where we only probe reader if there's anything in it
|
||||
|
||||
if(slot != 1) // If slot is 1, then we only probe reader
|
||||
if(remove_from_writer(user)) // Probe writer
|
||||
to_chat(user, "You remove the card from the writer slot")
|
||||
return 1
|
||||
to_chat(user, "There is nothing in the writer slot.")
|
||||
return 0
|
||||
|
||||
/obj/item/part/computer/cardslot/dual/proc/addfile(var/datum/file/F)
|
||||
if(!istype(writer,/obj/item/weapon/card/data))
|
||||
return 0
|
||||
var/obj/item/weapon/card/data/D = writer
|
||||
if(D.files.len > 3)
|
||||
return 0
|
||||
D.files += F
|
||||
return 1
|
||||
@@ -45,7 +45,6 @@
|
||||
// Misc & special purpose
|
||||
var/obj/item/part/computer/ai_holder/cradle = null
|
||||
var/obj/item/part/computer/toybox/toybox = null
|
||||
var/mob/living/silicon/ai/occupant = null
|
||||
|
||||
|
||||
// Legacy variables
|
||||
@@ -70,160 +69,171 @@
|
||||
|
||||
var/obj/item/weapon/cell/battery = null // uninterruptible power supply aka battery
|
||||
|
||||
/obj/machinery/computer3/New(var/L, var/built = 0)
|
||||
..()
|
||||
spawn(2)
|
||||
power_change()
|
||||
|
||||
verb/ResetComputer()
|
||||
set name = "Reset Computer"
|
||||
set category = "Object"
|
||||
set src in view(1)
|
||||
if(show_keyboard)
|
||||
var/kb_state = "kb[rand(1,15)]"
|
||||
kb = image('icons/obj/computer3.dmi',icon_state=kb_state)
|
||||
overlays += kb
|
||||
|
||||
if(usr.stat || usr.restrained() || usr.lying || !istype(usr, /mob/living))
|
||||
usr << "<span class='warning'>You can't do that.</span>"
|
||||
return
|
||||
if(!built)
|
||||
if(!circuitb || !istype(circuitb))
|
||||
circuitb = new(src)
|
||||
if(circuitb.OS)
|
||||
os = circuitb.OS
|
||||
circuitb.OS.computer = src
|
||||
else
|
||||
os = null
|
||||
|
||||
if(!Adjacent(usr))
|
||||
usr << "You can't reach it."
|
||||
return
|
||||
// separated into its own function because blech
|
||||
spawn_parts()
|
||||
|
||||
Reset()
|
||||
|
||||
New(var/L, var/built = 0)
|
||||
..()
|
||||
spawn(2)
|
||||
power_change()
|
||||
|
||||
if(show_keyboard)
|
||||
var/kb_state = "kb[rand(1,15)]"
|
||||
kb = image('icons/obj/computer3.dmi',icon_state=kb_state)
|
||||
overlays += kb
|
||||
|
||||
if(!built)
|
||||
if(!circuitb || !istype(circuitb))
|
||||
circuitb = new(src)
|
||||
if(circuitb.OS)
|
||||
os = circuitb.OS
|
||||
circuitb.OS.computer = src
|
||||
if(default_prog) // Add the default software if applicable
|
||||
var/datum/file/program/P = new default_prog
|
||||
if(hdd)
|
||||
hdd.addfile(P,1)
|
||||
program = P
|
||||
if(!os)
|
||||
os = P
|
||||
else if(floppy)
|
||||
floppy.inserted = new(floppy)
|
||||
floppy.files = floppy.inserted.files
|
||||
floppy.addfile(P)
|
||||
program = P
|
||||
else
|
||||
os = null
|
||||
circuitb.OS = P
|
||||
circuitb.OS.computer = src
|
||||
os = circuitb.OS
|
||||
circuitb.name = "Circuitboard ([P])"
|
||||
|
||||
// separated into its own function because blech
|
||||
spawn_parts()
|
||||
if(hdd) // Spawn files
|
||||
for(var/typekey in spawn_files)
|
||||
hdd.addfile(new typekey,1)
|
||||
|
||||
if(default_prog) // Add the default software if applicable
|
||||
var/datum/file/program/P = new default_prog
|
||||
if(hdd)
|
||||
hdd.addfile(P,1)
|
||||
program = P
|
||||
if(!os)
|
||||
os = P
|
||||
else if(floppy)
|
||||
floppy.inserted = new(floppy)
|
||||
floppy.files = floppy.inserted.files
|
||||
floppy.addfile(P)
|
||||
program = P
|
||||
else
|
||||
circuitb.OS = P
|
||||
circuitb.OS.computer = src
|
||||
os = circuitb.OS
|
||||
circuitb.name = "Circuitboard ([P])"
|
||||
update_icon()
|
||||
|
||||
/obj/machinery/computer3/verb/ResetComputer()
|
||||
set name = "Reset Computer"
|
||||
set category = "Object"
|
||||
set src in view(1)
|
||||
|
||||
if(hdd) // Spawn files
|
||||
for(var/typekey in spawn_files)
|
||||
hdd.addfile(new typekey,1)
|
||||
if(usr.stat || usr.restrained() || usr.lying || !istype(usr, /mob/living))
|
||||
to_chat(usr, "<span class='warning'>You can't do that.</span>")
|
||||
return
|
||||
|
||||
update_icon()
|
||||
if(!Adjacent(usr))
|
||||
to_chat(usr, "You can't reach it.")
|
||||
return
|
||||
|
||||
Reset()
|
||||
|
||||
proc/update_spawn_files()
|
||||
for(var/typekey in spawn_files)
|
||||
hdd.addfile(new typekey,1)
|
||||
/obj/machinery/computer3/proc/update_spawn_files()
|
||||
for(var/typekey in spawn_files)
|
||||
hdd.addfile(new typekey,1)
|
||||
|
||||
proc/spawn_parts()
|
||||
for(var/typekey in spawn_parts)
|
||||
|
||||
if(ispath(typekey,/obj/item/part/computer/storage/removable))
|
||||
if(floppy) continue
|
||||
floppy = new typekey(src)
|
||||
floppy.init(src)
|
||||
/obj/machinery/computer3/proc/spawn_parts()
|
||||
for(var/typekey in spawn_parts)
|
||||
if(ispath(typekey,/obj/item/part/computer/storage/removable))
|
||||
if(floppy)
|
||||
continue
|
||||
if(ispath(typekey,/obj/item/part/computer/storage/hdd))
|
||||
if(hdd) continue
|
||||
hdd = new typekey(src)
|
||||
hdd.init(src)
|
||||
floppy = new typekey(src)
|
||||
floppy.init(src)
|
||||
continue
|
||||
|
||||
if(ispath(typekey,/obj/item/part/computer/storage/hdd))
|
||||
if(hdd)
|
||||
continue
|
||||
hdd = new typekey(src)
|
||||
hdd.init(src)
|
||||
continue
|
||||
|
||||
if(ispath(typekey,/obj/item/part/computer/networking/cameras))
|
||||
if(camnet) continue
|
||||
camnet = new typekey(src)
|
||||
camnet.init(src)
|
||||
if(ispath(typekey,/obj/item/part/computer/networking/cameras))
|
||||
if(camnet)
|
||||
continue
|
||||
if(ispath(typekey,/obj/item/part/computer/networking/radio))
|
||||
if(radio) continue
|
||||
radio = new typekey(src)
|
||||
radio.init(src)
|
||||
camnet = new typekey(src)
|
||||
camnet.init(src)
|
||||
continue
|
||||
|
||||
if(ispath(typekey,/obj/item/part/computer/networking/radio))
|
||||
if(radio)
|
||||
continue
|
||||
if(ispath(typekey,/obj/item/part/computer/networking))
|
||||
if(net) continue
|
||||
net = new typekey(src)
|
||||
net.init(src)
|
||||
radio = new typekey(src)
|
||||
radio.init(src)
|
||||
continue
|
||||
|
||||
if(ispath(typekey,/obj/item/part/computer/networking))
|
||||
if(net)
|
||||
continue
|
||||
net = new typekey(src)
|
||||
net.init(src)
|
||||
continue
|
||||
|
||||
if(ispath(typekey,/obj/item/part/computer/cardslot))
|
||||
if(cardslot) continue
|
||||
cardslot = new typekey(src)
|
||||
cardslot.init(src)
|
||||
if(ispath(typekey,/obj/item/part/computer/cardslot))
|
||||
if(cardslot)
|
||||
continue
|
||||
if(ispath(typekey,/obj/item/part/computer/ai_holder))
|
||||
if(cradle) continue
|
||||
cradle = new typekey(src)
|
||||
cradle.init(src)
|
||||
if(ispath(typekey,/obj/item/part/computer/toybox))
|
||||
if(toybox) continue
|
||||
toybox = new typekey(src)
|
||||
toybox.init(src)
|
||||
cardslot = new typekey(src)
|
||||
cardslot.init(src)
|
||||
continue
|
||||
|
||||
if(ispath(typekey,/obj/item/part/computer/ai_holder))
|
||||
if(cradle)
|
||||
continue
|
||||
cradle = new typekey(src)
|
||||
cradle.init(src)
|
||||
continue
|
||||
|
||||
if(ispath(typekey,/obj/item/weapon/cell))
|
||||
if(battery) continue
|
||||
battery = new typekey(src)
|
||||
if(ispath(typekey,/obj/item/part/computer/toybox))
|
||||
if(toybox)
|
||||
continue
|
||||
toybox = new typekey(src)
|
||||
toybox.init(src)
|
||||
continue
|
||||
|
||||
proc/Reset(var/error = 0)
|
||||
for(var/mob/living/M in range(1))
|
||||
M << browse(null,"window=\ref[src]")
|
||||
if(program)
|
||||
program.Reset()
|
||||
program = null
|
||||
req_access = os.req_access
|
||||
update_icon()
|
||||
if(ispath(typekey,/obj/item/weapon/cell))
|
||||
if(battery)
|
||||
continue
|
||||
battery = new typekey(src)
|
||||
continue
|
||||
|
||||
// todo does this do enough
|
||||
/obj/machinery/computer3/proc/Reset(var/error = 0)
|
||||
for(var/mob/living/M in range(1))
|
||||
M << browse(null,"window=\ref[src]")
|
||||
if(program)
|
||||
program.Reset()
|
||||
program = null
|
||||
req_access = os.req_access
|
||||
update_icon()
|
||||
|
||||
emp_act(severity)
|
||||
if(prob(20/severity)) set_broken()
|
||||
..()
|
||||
// todo does this do enough
|
||||
|
||||
/obj/machinery/computer3/emp_act(severity)
|
||||
if(prob(20/severity)) set_broken()
|
||||
..()
|
||||
|
||||
|
||||
ex_act(severity)
|
||||
switch(severity)
|
||||
if(1.0)
|
||||
/obj/machinery/computer3/ex_act(severity)
|
||||
switch(severity)
|
||||
if(1.0)
|
||||
qdel(src)
|
||||
return
|
||||
if(2.0)
|
||||
if (prob(25))
|
||||
qdel(src)
|
||||
return
|
||||
if(2.0)
|
||||
if (prob(25))
|
||||
qdel(src)
|
||||
return
|
||||
if (prob(50))
|
||||
for(var/x in verbs)
|
||||
verbs -= x
|
||||
set_broken()
|
||||
if(3.0)
|
||||
if (prob(25))
|
||||
for(var/x in verbs)
|
||||
verbs -= x
|
||||
set_broken()
|
||||
else
|
||||
return
|
||||
if (prob(50))
|
||||
for(var/x in verbs)
|
||||
verbs -= x
|
||||
set_broken()
|
||||
if(3.0)
|
||||
if (prob(25))
|
||||
for(var/x in verbs)
|
||||
verbs -= x
|
||||
set_broken()
|
||||
else
|
||||
return
|
||||
|
||||
/*
|
||||
Computers have the capability to use a battery backup.
|
||||
@@ -244,201 +254,199 @@
|
||||
|
||||
Make sure to use use_power() a bunch in peripherals code
|
||||
*/
|
||||
auto_use_power()
|
||||
if(!powered(power_channel))
|
||||
if(battery && battery.charge > 0)
|
||||
if(use_power == 1)
|
||||
battery.use(idle_power_usage)
|
||||
else
|
||||
battery.use(active_power_usage)
|
||||
return 1
|
||||
return 0
|
||||
if(src.use_power == 1)
|
||||
use_power(idle_power_usage,power_channel)
|
||||
else if(src.use_power >= 2)
|
||||
use_power(active_power_usage,power_channel)
|
||||
return 1
|
||||
|
||||
use_power(var/amount, var/chan = -1)
|
||||
if(chan == -1)
|
||||
chan = power_channel
|
||||
|
||||
var/area/A = get_area(loc)
|
||||
if(istype(A) && A.powered(chan))
|
||||
A.use_power(amount, chan)
|
||||
else if(battery && battery.charge > 0)
|
||||
battery.use(amount)
|
||||
|
||||
power_change()
|
||||
if( !powered(power_channel) && (!battery || battery.charge <= 0) )
|
||||
stat |= NOPOWER
|
||||
else
|
||||
stat &= ~NOPOWER
|
||||
|
||||
process()
|
||||
auto_use_power()
|
||||
power_change()
|
||||
update_icon()
|
||||
if(stat & (NOPOWER|BROKEN))
|
||||
return
|
||||
|
||||
if(program)
|
||||
program.process()
|
||||
return
|
||||
|
||||
if(os)
|
||||
program = os
|
||||
os.process()
|
||||
return
|
||||
|
||||
|
||||
proc/set_broken()
|
||||
icon_state = "computer_b"
|
||||
stat |= BROKEN
|
||||
if(program)
|
||||
program.error = BUSTED_ASS_COMPUTER
|
||||
if(os)
|
||||
os.error = BUSTED_ASS_COMPUTER
|
||||
|
||||
attackby(I as obj, mob/user as mob)
|
||||
if(istype(I, /obj/item/weapon/screwdriver) && allow_disassemble)
|
||||
disassemble(user)
|
||||
return
|
||||
|
||||
/*
|
||||
+++++++++++
|
||||
|IMPORTANT| If you add a peripheral, put it in this list
|
||||
+++++++++++ --------------------------------------------
|
||||
*/
|
||||
var/list/peripherals = list(hdd,floppy,radio,net,cardslot,cradle) //camnet, toybox removed
|
||||
|
||||
var/list/p_list = list()
|
||||
for(var/obj/item/part/computer/C in peripherals)
|
||||
if(!isnull(C) && C.allow_attackby(I,user))
|
||||
p_list += C
|
||||
if(p_list.len)
|
||||
var/obj/item/part/computer/P = null
|
||||
if(p_list.len == 1)
|
||||
P = p_list[1]
|
||||
/obj/machinery/computer3/auto_use_power()
|
||||
if(!powered(power_channel))
|
||||
if(battery && battery.charge > 0)
|
||||
if(use_power == 1)
|
||||
battery.use(idle_power_usage)
|
||||
else
|
||||
P = input(user,"Which component?") as null|anything in p_list
|
||||
battery.use(active_power_usage)
|
||||
return 1
|
||||
return 0
|
||||
if(src.use_power == 1)
|
||||
use_power(idle_power_usage,power_channel)
|
||||
else if(src.use_power >= 2)
|
||||
use_power(active_power_usage,power_channel)
|
||||
return 1
|
||||
|
||||
if(P)
|
||||
P.attackby(I,user)
|
||||
return
|
||||
..()
|
||||
/obj/machinery/computer3/use_power(var/amount, var/chan = -1)
|
||||
if(chan == -1)
|
||||
chan = power_channel
|
||||
|
||||
attack_hand(var/mob/user as mob)
|
||||
if(stat)
|
||||
Reset()
|
||||
return
|
||||
var/area/A = get_area(loc)
|
||||
if(istype(A) && A.powered(chan))
|
||||
A.use_power(amount, chan)
|
||||
else if(battery && battery.charge > 0)
|
||||
battery.use(amount)
|
||||
|
||||
// I don't want to deal with computers that you can't walk up to and use
|
||||
// there is still cardauth anyway
|
||||
//if(!allowed(user))
|
||||
// return
|
||||
|
||||
if(program)
|
||||
if(program.computer != src) // floppy disk may have been removed, etc
|
||||
Reset()
|
||||
attack_hand(user)
|
||||
return
|
||||
if(program.error)
|
||||
Crash(program.error)
|
||||
return
|
||||
user.set_machine(src)
|
||||
program.attack_hand(user) // will normally translate to program/interact()
|
||||
return
|
||||
|
||||
if(os)
|
||||
program = os
|
||||
user.set_machine(src)
|
||||
os.attack_hand(user)
|
||||
return
|
||||
|
||||
user << "\The [src] won't boot!"
|
||||
|
||||
attack_ai(var/mob/user as mob) // copypasta because server racks lose attack_hand()
|
||||
if(stat)
|
||||
Reset()
|
||||
return
|
||||
|
||||
if(program)
|
||||
if(program.computer != src) // floppy disk may have been removed, etc
|
||||
Reset()
|
||||
attack_ai(user)
|
||||
return
|
||||
if(program.error)
|
||||
Crash(program.error)
|
||||
return
|
||||
user.set_machine(src)
|
||||
program.attack_hand(user) // will normally translate to program/interact()
|
||||
return
|
||||
|
||||
if(os)
|
||||
program = os
|
||||
user.set_machine(src)
|
||||
os.attack_hand(user)
|
||||
return
|
||||
|
||||
user << "\The [src] won't boot!"
|
||||
|
||||
interact()
|
||||
if(stat)
|
||||
Reset()
|
||||
return
|
||||
if(!allowed(usr) || !usr in view(1))
|
||||
usr.unset_machine()
|
||||
return
|
||||
|
||||
if(program)
|
||||
program.interact()
|
||||
return
|
||||
|
||||
if(os)
|
||||
program = os
|
||||
os.interact()
|
||||
return
|
||||
/obj/machinery/computer3/power_change()
|
||||
if( !powered(power_channel) && (!battery || battery.charge <= 0) )
|
||||
stat |= NOPOWER
|
||||
else
|
||||
stat &= ~NOPOWER
|
||||
|
||||
/obj/machinery/computer3/process()
|
||||
auto_use_power()
|
||||
power_change()
|
||||
update_icon()
|
||||
if(legacy_icon)
|
||||
if(stat & (NOPOWER|BROKEN))
|
||||
return
|
||||
|
||||
if(program)
|
||||
program.process()
|
||||
return
|
||||
|
||||
if(os)
|
||||
program = os
|
||||
os.process()
|
||||
return
|
||||
|
||||
/obj/machinery/computer3/proc/set_broken()
|
||||
icon_state = "computer_b"
|
||||
stat |= BROKEN
|
||||
if(program)
|
||||
program.error = BUSTED_ASS_COMPUTER
|
||||
if(os)
|
||||
os.error = BUSTED_ASS_COMPUTER
|
||||
|
||||
/obj/machinery/computer3/attackby(I as obj, mob/user as mob)
|
||||
if(istype(I, /obj/item/weapon/screwdriver) && allow_disassemble)
|
||||
disassemble(user)
|
||||
return
|
||||
|
||||
/*
|
||||
+++++++++++
|
||||
|IMPORTANT| If you add a peripheral, put it in this list
|
||||
+++++++++++ --------------------------------------------
|
||||
*/
|
||||
|
||||
var/list/p_list = list()
|
||||
for(var/obj/item/part/computer/C in src)
|
||||
if(!isnull(C) && C.allow_attackby(I,user))
|
||||
p_list += C
|
||||
if(p_list.len)
|
||||
var/obj/item/part/computer/P = null
|
||||
if(p_list.len == 1)
|
||||
P = p_list[1]
|
||||
else
|
||||
P = input(user,"Which component?") as null|anything in p_list
|
||||
|
||||
if(P)
|
||||
P.attackby(I,user)
|
||||
return
|
||||
..()
|
||||
|
||||
/obj/machinery/computer3/attack_hand(var/mob/user as mob)
|
||||
if(stat)
|
||||
Reset()
|
||||
return
|
||||
|
||||
// I don't want to deal with computers that you can't walk up to and use
|
||||
// there is still cardauth anyway
|
||||
//if(!allowed(user))
|
||||
// return
|
||||
|
||||
if(program)
|
||||
if(program.computer != src) // floppy disk may have been removed, etc
|
||||
Reset()
|
||||
attack_hand(user)
|
||||
return
|
||||
if(program.error)
|
||||
Crash(program.error)
|
||||
return
|
||||
user.set_machine(src)
|
||||
program.attack_hand(user) // will normally translate to program/interact()
|
||||
return
|
||||
|
||||
if(os)
|
||||
program = os
|
||||
user.set_machine(src)
|
||||
os.attack_hand(user)
|
||||
return
|
||||
|
||||
to_chat(user, "\The [src] won't boot!")
|
||||
|
||||
/obj/machinery/computer3/attack_ai(var/mob/user as mob) // copypasta because server racks lose attack_hand()
|
||||
if(stat)
|
||||
Reset()
|
||||
return
|
||||
|
||||
if(program)
|
||||
if(program.computer != src) // floppy disk may have been removed, etc
|
||||
Reset()
|
||||
attack_ai(user)
|
||||
return
|
||||
if(program.error)
|
||||
Crash(program.error)
|
||||
return
|
||||
user.set_machine(src)
|
||||
program.attack_hand(user) // will normally translate to program/interact()
|
||||
return
|
||||
|
||||
if(os)
|
||||
program = os
|
||||
user.set_machine(src)
|
||||
os.attack_hand(user)
|
||||
return
|
||||
|
||||
to_chat(user, "\The [src] won't boot!")
|
||||
|
||||
/obj/machinery/computer3/interact()
|
||||
if(stat)
|
||||
Reset()
|
||||
return
|
||||
if(!allowed(usr) || !usr in view(1))
|
||||
usr.unset_machine()
|
||||
return
|
||||
|
||||
if(program)
|
||||
program.interact()
|
||||
return
|
||||
|
||||
if(os)
|
||||
program = os
|
||||
os.interact()
|
||||
return
|
||||
|
||||
/obj/machinery/computer3/update_icon()
|
||||
if(legacy_icon)
|
||||
icon_state = initial(icon_state)
|
||||
// Broken
|
||||
if(stat & BROKEN)
|
||||
icon_state += "b"
|
||||
|
||||
// Powered
|
||||
else if(stat & NOPOWER)
|
||||
icon_state = initial(icon_state)
|
||||
// Broken
|
||||
if(stat & BROKEN)
|
||||
icon_state += "b"
|
||||
icon_state += "0"
|
||||
return
|
||||
if(stat)
|
||||
overlays.Cut()
|
||||
return
|
||||
if(program)
|
||||
overlays = list(program.overlay)
|
||||
if(show_keyboard)
|
||||
overlays += kb
|
||||
name = "[program.name] [initial(name)]"
|
||||
else if(os)
|
||||
overlays = list(os.overlay)
|
||||
if(show_keyboard)
|
||||
overlays += kb
|
||||
name = initial(name)
|
||||
else
|
||||
var/global/image/generic = image('icons/obj/computer3.dmi',icon_state="osod") // orange screen of death
|
||||
overlays = list(generic)
|
||||
if(show_keyboard)
|
||||
overlays += kb
|
||||
name = initial(name) + " (orange screen of death)"
|
||||
|
||||
// Powered
|
||||
else if(stat & NOPOWER)
|
||||
icon_state = initial(icon_state)
|
||||
icon_state += "0"
|
||||
return
|
||||
if(stat)
|
||||
overlays.Cut()
|
||||
return
|
||||
if(program)
|
||||
overlays = list(program.overlay)
|
||||
if(show_keyboard)
|
||||
overlays += kb
|
||||
name = "[program.name] [initial(name)]"
|
||||
else if(os)
|
||||
overlays = list(os.overlay)
|
||||
if(show_keyboard)
|
||||
overlays += kb
|
||||
name = initial(name)
|
||||
else
|
||||
var/global/image/generic = image('icons/obj/computer3.dmi',icon_state="osod") // orange screen of death
|
||||
overlays = list(generic)
|
||||
if(show_keyboard)
|
||||
overlays += kb
|
||||
name = initial(name) + " (orange screen of death)"
|
||||
|
||||
//Returns percentage of battery charge remaining. Returns -1 if no battery is installed.
|
||||
proc/check_battery_status()
|
||||
if (battery)
|
||||
var/obj/item/weapon/cell/B = battery
|
||||
return round(B.charge / (B.maxcharge / 100))
|
||||
else
|
||||
return -1
|
||||
//Returns percentage of battery charge remaining. Returns -1 if no battery is installed.
|
||||
/obj/machinery/computer3/proc/check_battery_status()
|
||||
if (battery)
|
||||
var/obj/item/weapon/cell/B = battery
|
||||
return round(B.charge / (B.maxcharge / 100))
|
||||
else
|
||||
return -1
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -22,206 +22,153 @@
|
||||
var/emagged = 0
|
||||
|
||||
|
||||
interact()
|
||||
if(!interactable())
|
||||
return
|
||||
var/dat = "<h3>Current Loaded Programs</h3>"
|
||||
dat += "<A href='?src=\ref[src];emptycourt'>((Empty Court))</A><BR>"
|
||||
dat += "<A href='?src=\ref[src];boxingcourt'>((Boxing Court))</A><BR>"
|
||||
dat += "<A href='?src=\ref[src];basketball'>((Basketball Court))</A><BR>"
|
||||
dat += "<A href='?src=\ref[src];thunderdomecourt'>((Thunderdome Court))</A><BR>"
|
||||
dat += "<A href='?src=\ref[src];beach'>((Beach))</A><BR>"
|
||||
// dat += "<A href='?src=\ref[src];turnoff'>((Shutdown System))</A><BR>"
|
||||
/datum/file/program/holodeck/interact()
|
||||
if(!interactable())
|
||||
return
|
||||
var/dat = "<h3>Current Loaded Programs</h3>"
|
||||
dat += "<A href='?src=\ref[src];emptycourt'>((Empty Court))</A><BR>"
|
||||
dat += "<A href='?src=\ref[src];boxingcourt'>((Boxing Court))</A><BR>"
|
||||
dat += "<A href='?src=\ref[src];basketball'>((Basketball Court))</A><BR>"
|
||||
dat += "<A href='?src=\ref[src];thunderdomecourt'>((Thunderdome Court))</A><BR>"
|
||||
dat += "<A href='?src=\ref[src];beach'>((Beach))</A><BR>"
|
||||
// dat += "<A href='?src=\ref[src];turnoff'>((Shutdown System))</A><BR>"
|
||||
|
||||
dat += "<span class='notice'>Please ensure that only holographic weapons are used in the holodeck if a combat simulation has been loaded.</span><BR>"
|
||||
dat += "<span class='notice'>Please ensure that only holographic weapons are used in the holodeck if a combat simulation has been loaded.</span><BR>"
|
||||
|
||||
if(emagged)
|
||||
dat += "<A href='?src=\ref[src];burntest'>(<font color=red>Begin Atmospheric Burn Simulation</font>)</A><BR>"
|
||||
dat += "Ensure the holodeck is empty before testing.<BR>"
|
||||
dat += "<BR>"
|
||||
dat += "<A href='?src=\ref[src];wildlifecarp'>(<font color=red>Begin Wildlife Simulation</font>)</A><BR>"
|
||||
dat += "Ensure the holodeck is empty before testing.<BR>"
|
||||
dat += "<BR>"
|
||||
if(issilicon(usr))
|
||||
dat += "<A href='?src=\ref[src];AIoverride'>(<font color=green>Re-Enable Safety Protocols?</font>)</A><BR>"
|
||||
dat += "Safety Protocols are <font class='bad'>DISABLED</font><BR>"
|
||||
else
|
||||
if(issilicon(usr))
|
||||
dat += "<A href='?src=\ref[src];AIoverride'>(<font color=red>Override Safety Protocols?</font>)</A><BR>"
|
||||
dat += "<BR>"
|
||||
dat += "Safety Protocols are <font class='good'>ENABLED</font><BR>"
|
||||
if(emagged)
|
||||
dat += "<A href='?src=\ref[src];burntest'>(<font color=red>Begin Atmospheric Burn Simulation</font>)</A><BR>"
|
||||
dat += "Ensure the holodeck is empty before testing.<BR>"
|
||||
dat += "<BR>"
|
||||
dat += "<A href='?src=\ref[src];wildlifecarp'>(<font color=red>Begin Wildlife Simulation</font>)</A><BR>"
|
||||
dat += "Ensure the holodeck is empty before testing.<BR>"
|
||||
dat += "<BR>"
|
||||
if(issilicon(usr))
|
||||
dat += "<A href='?src=\ref[src];AIoverride'>(<font color=green>Re-Enable Safety Protocols?</font>)</A><BR>"
|
||||
dat += "Safety Protocols are <font class='bad'>DISABLED</font><BR>"
|
||||
else
|
||||
if(issilicon(usr))
|
||||
dat += "<A href='?src=\ref[src];AIoverride'>(<font color=red>Override Safety Protocols?</font>)</A><BR>"
|
||||
dat += "<BR>"
|
||||
dat += "Safety Protocols are <font class='good'>ENABLED</font><BR>"
|
||||
|
||||
popup.set_content(dat)
|
||||
popup.open()
|
||||
popup.set_content(dat)
|
||||
popup.open()
|
||||
return
|
||||
|
||||
/datum/file/program/holodeck/Topic(var/href, var/list/href_list)
|
||||
if(!interactable() || ..(href,href_list))
|
||||
return
|
||||
|
||||
if("emptycourt" in href_list)
|
||||
target = locate(/area/holodeck/source_emptycourt)
|
||||
if(target)
|
||||
loadProgram(target)
|
||||
|
||||
Topic(var/href, var/list/href_list)
|
||||
if(!interactable() || ..(href,href_list))
|
||||
else if("boxingcourt" in href_list)
|
||||
target = locate(/area/holodeck/source_boxingcourt)
|
||||
if(target)
|
||||
loadProgram(target)
|
||||
|
||||
else if("basketball" in href_list)
|
||||
target = locate(/area/holodeck/source_basketball)
|
||||
if(target)
|
||||
loadProgram(target)
|
||||
|
||||
else if("thunderdomecourt" in href_list)
|
||||
target = locate(/area/holodeck/source_thunderdomecourt)
|
||||
if(target)
|
||||
loadProgram(target)
|
||||
|
||||
else if("beach" in href_list)
|
||||
target = locate(/area/holodeck/source_beach)
|
||||
if(target)
|
||||
loadProgram(target)
|
||||
|
||||
else if("turnoff" in href_list)
|
||||
target = locate(/area/holodeck/source_plating)
|
||||
if(target)
|
||||
loadProgram(target)
|
||||
|
||||
else if("burntest" in href_list)
|
||||
if(!emagged)
|
||||
return
|
||||
target = locate(/area/holodeck/source_burntest)
|
||||
if(target)
|
||||
loadProgram(target)
|
||||
|
||||
if("emptycourt" in href_list)
|
||||
target = locate(/area/holodeck/source_emptycourt)
|
||||
if(target)
|
||||
loadProgram(target)
|
||||
else if("wildlifecarp" in href_list)
|
||||
if(!emagged)
|
||||
return
|
||||
target = locate(/area/holodeck/source_wildlife)
|
||||
if(target)
|
||||
loadProgram(target)
|
||||
|
||||
else if("boxingcourt" in href_list)
|
||||
target = locate(/area/holodeck/source_boxingcourt)
|
||||
if(target)
|
||||
loadProgram(target)
|
||||
else if("AIoverride" in href_list)
|
||||
if(!issilicon(usr))
|
||||
return
|
||||
emagged = !emagged
|
||||
if(emagged)
|
||||
message_admins("[key_name_admin(usr)] overrode the holodeck's safeties")
|
||||
log_game("[key_name(usr)] overrided the holodeck's safeties")
|
||||
else
|
||||
message_admins("[key_name_admin(usr)] restored the holodeck's safeties")
|
||||
log_game("[key_name(usr)] restored the holodeck's safeties")
|
||||
|
||||
else if("basketball" in href_list)
|
||||
target = locate(/area/holodeck/source_basketball)
|
||||
if(target)
|
||||
loadProgram(target)
|
||||
interact()
|
||||
return
|
||||
|
||||
else if("thunderdomecourt" in href_list)
|
||||
target = locate(/area/holodeck/source_thunderdomecourt)
|
||||
if(target)
|
||||
loadProgram(target)
|
||||
/datum/file/program/holodeck/Reset()
|
||||
emergencyShutdown()
|
||||
|
||||
else if("beach" in href_list)
|
||||
target = locate(/area/holodeck/source_beach)
|
||||
if(target)
|
||||
loadProgram(target)
|
||||
|
||||
else if("turnoff" in href_list)
|
||||
/datum/file/program/holodeck/process()
|
||||
if(active)
|
||||
if(!checkInteg(linkedholodeck))
|
||||
damaged = 1
|
||||
target = locate(/area/holodeck/source_plating)
|
||||
if(target)
|
||||
loadProgram(target)
|
||||
|
||||
else if("burntest" in href_list)
|
||||
if(!emagged) return
|
||||
target = locate(/area/holodeck/source_burntest)
|
||||
if(target)
|
||||
loadProgram(target)
|
||||
|
||||
else if("wildlifecarp" in href_list)
|
||||
if(!emagged) return
|
||||
target = locate(/area/holodeck/source_wildlife)
|
||||
if(target)
|
||||
loadProgram(target)
|
||||
|
||||
else if("AIoverride" in href_list)
|
||||
if(!issilicon(usr)) return
|
||||
emagged = !emagged
|
||||
if(emagged)
|
||||
message_admins("[key_name_admin(usr)] overrode the holodeck's safeties")
|
||||
log_game("[key_name(usr)] overrided the holodeck's safeties")
|
||||
else
|
||||
message_admins("[key_name_admin(usr)] restored the holodeck's safeties")
|
||||
log_game("[key_name(usr)] restored the holodeck's safeties")
|
||||
|
||||
interact()
|
||||
return
|
||||
|
||||
Reset()
|
||||
emergencyShutdown()
|
||||
|
||||
process()
|
||||
if(active)
|
||||
if(!checkInteg(linkedholodeck))
|
||||
damaged = 1
|
||||
target = locate(/area/holodeck/source_plating)
|
||||
if(target)
|
||||
loadProgram(target)
|
||||
active = 0
|
||||
for(var/mob/M in range(10,src))
|
||||
M.show_message("The holodeck overloads!")
|
||||
|
||||
|
||||
for(var/turf/T in linkedholodeck)
|
||||
if(prob(30))
|
||||
var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread
|
||||
s.set_up(2, 1, T)
|
||||
s.start()
|
||||
T.ex_act(3)
|
||||
T.hotspot_expose(1000,500,1)
|
||||
|
||||
|
||||
for(var/item in holographic_items)
|
||||
if(!(get_turf(item) in linkedholodeck))
|
||||
derez(item, 0)
|
||||
|
||||
|
||||
|
||||
proc/derez(var/obj/obj , var/silent = 1)
|
||||
holographic_items.Remove(obj)
|
||||
|
||||
if(obj == null)
|
||||
return
|
||||
|
||||
if(isobj(obj))
|
||||
var/mob/M = obj.loc
|
||||
if(ismob(M))
|
||||
M.remove_from_mob(obj)
|
||||
|
||||
if(!silent)
|
||||
var/obj/oldobj = obj
|
||||
obj.visible_message("The [oldobj.name] fades away!")
|
||||
qdel(obj)
|
||||
|
||||
proc/checkInteg(var/area/A)
|
||||
for(var/turf/T in A)
|
||||
if(istype(T, /turf/space))
|
||||
return 0
|
||||
|
||||
return 1
|
||||
|
||||
proc/togglePower(var/toggleOn = 0)
|
||||
|
||||
if(toggleOn)
|
||||
var/area/targetsource = locate(/area/holodeck/source_emptycourt)
|
||||
holographic_items = targetsource.copy_contents_to(linkedholodeck)
|
||||
|
||||
spawn(30)
|
||||
for(var/obj/effect/landmark/L in linkedholodeck)
|
||||
if(L.name=="Atmospheric Test Start")
|
||||
spawn(20)
|
||||
var/turf/T = get_turf(L)
|
||||
var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread
|
||||
s.set_up(2, 1, T)
|
||||
s.start()
|
||||
if(T)
|
||||
T.temperature = 5000
|
||||
T.hotspot_expose(50000,50000,1)
|
||||
|
||||
active = 1
|
||||
else
|
||||
for(var/item in holographic_items)
|
||||
derez(item)
|
||||
var/area/targetsource = locate(/area/holodeck/source_plating)
|
||||
targetsource.copy_contents_to(linkedholodeck , 1)
|
||||
active = 0
|
||||
for(var/mob/M in range(10,src))
|
||||
M.show_message("The holodeck overloads!")
|
||||
|
||||
|
||||
proc/loadProgram(var/area/A)
|
||||
|
||||
if(world.time < (last_change + 25))
|
||||
if(world.time < (last_change + 15))//To prevent super-spam clicking, reduced process size and annoyance -Sieve
|
||||
return
|
||||
for(var/mob/M in range(3,src))
|
||||
M.show_message("<span class='warning'>ERROR. Recalibrating projetion apparatus.</span>")
|
||||
last_change = world.time
|
||||
return
|
||||
|
||||
last_change = world.time
|
||||
active = 1
|
||||
for(var/turf/T in linkedholodeck)
|
||||
if(prob(30))
|
||||
var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread
|
||||
s.set_up(2, 1, T)
|
||||
s.start()
|
||||
T.ex_act(3)
|
||||
T.hotspot_expose(1000,500,1)
|
||||
|
||||
for(var/item in holographic_items)
|
||||
derez(item)
|
||||
if(!(get_turf(item) in linkedholodeck))
|
||||
derez(item, 0)
|
||||
|
||||
for(var/obj/effect/decal/cleanable/blood/B in linkedholodeck)
|
||||
qdel(B)
|
||||
/datum/file/program/holodeck/proc/derez(var/obj/obj , var/silent = 1)
|
||||
holographic_items.Remove(obj)
|
||||
|
||||
for(var/mob/living/simple_animal/hostile/carp/C in linkedholodeck)
|
||||
qdel(C)
|
||||
if(obj == null)
|
||||
return
|
||||
|
||||
holographic_items = A.copy_contents_to(linkedholodeck , 1)
|
||||
if(isobj(obj))
|
||||
var/mob/M = obj.loc
|
||||
if(ismob(M))
|
||||
M.remove_from_mob(obj)
|
||||
|
||||
if(emagged)
|
||||
for(var/obj/item/weapon/holo/esword/H in linkedholodeck)
|
||||
H.damtype = BRUTE
|
||||
if(!silent)
|
||||
var/obj/oldobj = obj
|
||||
obj.visible_message("The [oldobj.name] fades away!")
|
||||
qdel(obj)
|
||||
|
||||
/datum/file/program/holodeck/proc/checkInteg(var/area/A)
|
||||
for(var/turf/T in A)
|
||||
if(istype(T, /turf/space))
|
||||
return 0
|
||||
return 1
|
||||
|
||||
/datum/file/program/holodeck/proc/togglePower(var/toggleOn = 0)
|
||||
if(toggleOn)
|
||||
var/area/targetsource = locate(/area/holodeck/source_emptycourt)
|
||||
holographic_items = targetsource.copy_contents_to(linkedholodeck)
|
||||
|
||||
spawn(30)
|
||||
for(var/obj/effect/landmark/L in linkedholodeck)
|
||||
@@ -234,20 +181,65 @@
|
||||
if(T)
|
||||
T.temperature = 5000
|
||||
T.hotspot_expose(50000,50000,1)
|
||||
if(L.name=="Holocarp Spawn")
|
||||
new /mob/living/simple_animal/hostile/carp(L.loc)
|
||||
|
||||
|
||||
proc/emergencyShutdown()
|
||||
//Get rid of any items
|
||||
active = 1
|
||||
else
|
||||
for(var/item in holographic_items)
|
||||
derez(item)
|
||||
//Turn it back to the regular non-holographic room
|
||||
target = locate(/area/holodeck/source_plating)
|
||||
if(target)
|
||||
loadProgram(target)
|
||||
|
||||
var/area/targetsource = locate(/area/holodeck/source_plating)
|
||||
targetsource.copy_contents_to(linkedholodeck , 1)
|
||||
active = 0
|
||||
|
||||
/datum/file/program/holodeck/proc/loadProgram(var/area/A)
|
||||
if(world.time < (last_change + 25))
|
||||
if(world.time < (last_change + 15))//To prevent super-spam clicking, reduced process size and annoyance -Sieve
|
||||
return
|
||||
for(var/mob/M in range(3,src))
|
||||
M.show_message("<span class='warning'>ERROR. Recalibrating projetion apparatus.</span>")
|
||||
last_change = world.time
|
||||
return
|
||||
|
||||
last_change = world.time
|
||||
active = 1
|
||||
|
||||
for(var/item in holographic_items)
|
||||
derez(item)
|
||||
|
||||
for(var/obj/effect/decal/cleanable/blood/B in linkedholodeck)
|
||||
qdel(B)
|
||||
|
||||
for(var/mob/living/simple_animal/hostile/carp/C in linkedholodeck)
|
||||
qdel(C)
|
||||
|
||||
holographic_items = A.copy_contents_to(linkedholodeck , 1)
|
||||
|
||||
if(emagged)
|
||||
for(var/obj/item/weapon/holo/esword/H in linkedholodeck)
|
||||
H.damtype = BRUTE
|
||||
|
||||
spawn(30)
|
||||
for(var/obj/effect/landmark/L in linkedholodeck)
|
||||
if(L.name=="Atmospheric Test Start")
|
||||
spawn(20)
|
||||
var/turf/T = get_turf(L)
|
||||
var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread
|
||||
s.set_up(2, 1, T)
|
||||
s.start()
|
||||
if(T)
|
||||
T.temperature = 5000
|
||||
T.hotspot_expose(50000,50000,1)
|
||||
if(L.name=="Holocarp Spawn")
|
||||
new /mob/living/simple_animal/hostile/carp(L.loc)
|
||||
|
||||
|
||||
/datum/file/program/holodeck/proc/emergencyShutdown()
|
||||
//Get rid of any items
|
||||
for(var/item in holographic_items)
|
||||
derez(item)
|
||||
//Turn it back to the regular non-holographic room
|
||||
target = locate(/area/holodeck/source_plating)
|
||||
if(target)
|
||||
loadProgram(target)
|
||||
|
||||
var/area/targetsource = locate(/area/holodeck/source_plating)
|
||||
targetsource.copy_contents_to(linkedholodeck , 1)
|
||||
active = 0
|
||||
|
||||
@@ -24,17 +24,20 @@
|
||||
/obj/item/toy/prize/odysseus = 1,
|
||||
/obj/item/toy/prize/phazon = 1
|
||||
)
|
||||
proc/dispense()
|
||||
if(computer && !computer.stat)
|
||||
var/prizeselect = pickweight(prizes)
|
||||
new prizeselect(computer.loc)
|
||||
if(istype(prizeselect, /obj/item/weapon/gun/projectile/revolver/capgun)) //Ammo comes with the gun
|
||||
new /obj/item/projectile/bullet/pistol/cap(src.loc)
|
||||
else if(istype(prizeselect, /obj/item/clothing/suit/syndicatefake)) //Helmet is part of the suit
|
||||
new /obj/item/clothing/head/syndicatefake(computer.loc)
|
||||
feedback_inc("arcade_win_normal")
|
||||
computer.use_power(500)
|
||||
|
||||
/obj/item/part/computer/toybox/allow_attackby(var/obj/item/I, var/mob/user)
|
||||
return 0
|
||||
|
||||
/obj/item/part/computer/toybox/proc/dispense()
|
||||
if(computer && !computer.stat)
|
||||
var/prizeselect = pickweight(prizes)
|
||||
new prizeselect(computer.loc)
|
||||
if(istype(prizeselect, /obj/item/weapon/gun/projectile/revolver/capgun)) //Ammo comes with the gun
|
||||
new /obj/item/projectile/bullet/pistol/cap(src.loc)
|
||||
else if(istype(prizeselect, /obj/item/clothing/suit/syndicatefake)) //Helmet is part of the suit
|
||||
new /obj/item/clothing/head/syndicatefake(computer.loc)
|
||||
feedback_inc("arcade_win_normal")
|
||||
computer.use_power(500)
|
||||
|
||||
/datum/file/program/arcade
|
||||
desc = "The best arcade game ever produced by the Company's short-lived entertainment divison."
|
||||
@@ -66,7 +69,6 @@
|
||||
enemy_name = replacetext(name_part1, "the ", "") + name_part2
|
||||
name = (name_action + name_part1 + name_part2)
|
||||
|
||||
|
||||
/datum/file/program/arcade/interact()
|
||||
if(!interactable())
|
||||
return
|
||||
|
||||
@@ -9,91 +9,92 @@
|
||||
active_state = "alert:2"
|
||||
refresh = 1
|
||||
|
||||
execute(var/datum/file/program/source)
|
||||
..(source)
|
||||
/datum/file/program/atmos_alert/execute(var/datum/file/program/source)
|
||||
..(source)
|
||||
|
||||
if(!computer.radio)
|
||||
computer.Crash(MISSING_PERIPHERAL)
|
||||
if(!computer.radio)
|
||||
computer.Crash(MISSING_PERIPHERAL)
|
||||
|
||||
computer.radio.set_frequency(1437,RADIO_ATMOSIA)
|
||||
computer.radio.set_frequency(1437,RADIO_ATMOSIA)
|
||||
|
||||
// This will be called as long as the program is running on the parent computer
|
||||
// and the computer has the radio peripheral
|
||||
receive_signal(datum/signal/signal)
|
||||
if(!signal || signal.encryption) return
|
||||
|
||||
var/zone = signal.data["zone"]
|
||||
var/severity = signal.data["alert"]
|
||||
if(!zone || !severity) return
|
||||
|
||||
minor_air_alarms -= zone
|
||||
priority_air_alarms -= zone
|
||||
if(severity=="severe")
|
||||
priority_air_alarms += zone
|
||||
else if (severity=="minor")
|
||||
minor_air_alarms += zone
|
||||
update_icon()
|
||||
// This will be called as long as the program is running on the parent computer
|
||||
// and the computer has the radio peripheral
|
||||
/datum/file/program/atmos_alert/receive_signal(datum/signal/signal)
|
||||
if(!signal || signal.encryption)
|
||||
return
|
||||
|
||||
var/zone = signal.data["zone"]
|
||||
var/severity = signal.data["alert"]
|
||||
if(!zone || !severity)
|
||||
return
|
||||
|
||||
interact()
|
||||
if(!interactable())
|
||||
return
|
||||
if(!computer.radio)
|
||||
computer.Crash(MISSING_PERIPHERAL)
|
||||
|
||||
popup.set_content(return_text())
|
||||
popup.open()
|
||||
|
||||
|
||||
minor_air_alarms -= zone
|
||||
priority_air_alarms -= zone
|
||||
if(severity=="severe")
|
||||
priority_air_alarms += zone
|
||||
else if (severity=="minor")
|
||||
minor_air_alarms += zone
|
||||
update_icon()
|
||||
..()
|
||||
if(priority_air_alarms.len > 0)
|
||||
overlay.icon_state = "alert:2"
|
||||
else if(minor_air_alarms.len > 0)
|
||||
overlay.icon_state = "alert:1"
|
||||
else
|
||||
overlay.icon_state = "alert:0"
|
||||
|
||||
if(computer)
|
||||
computer.update_icon()
|
||||
return
|
||||
|
||||
|
||||
proc/return_text()
|
||||
var/priority_text = "<h2>Priority Alerts:</h2>"
|
||||
var/minor_text = "<h2>Minor Alerts:</h2>"
|
||||
/datum/file/program/atmos_alert/interact()
|
||||
if(!interactable())
|
||||
return
|
||||
if(!computer.radio)
|
||||
computer.Crash(MISSING_PERIPHERAL)
|
||||
|
||||
if(priority_air_alarms.len)
|
||||
for(var/zone in priority_air_alarms)
|
||||
priority_text += "<FONT color='red'><B>[format_text(zone)]</B></FONT> [topic_link(src,"priority_clear=[ckey(zone)]","X")]<BR>"
|
||||
else
|
||||
priority_text += "No priority alerts detected.<BR>"
|
||||
popup.set_content(return_text())
|
||||
popup.open()
|
||||
|
||||
if(minor_air_alarms.len)
|
||||
for(var/zone in minor_air_alarms)
|
||||
minor_text += "<B>[format_text(zone)]</B> [topic_link(src,"minor_clear=[ckey(zone)]","X")]<BR>"
|
||||
else
|
||||
minor_text += "No minor alerts detected.<BR>"
|
||||
/datum/file/program/atmos_alert/update_icon()
|
||||
..()
|
||||
if(priority_air_alarms.len > 0)
|
||||
overlay.icon_state = "alert:2"
|
||||
else if(minor_air_alarms.len > 0)
|
||||
overlay.icon_state = "alert:1"
|
||||
else
|
||||
overlay.icon_state = "alert:0"
|
||||
|
||||
return "[priority_text]<BR><HR>[minor_text]<BR>[topic_link(src,"close","Close")]"
|
||||
if(computer)
|
||||
computer.update_icon()
|
||||
|
||||
|
||||
Topic(var/href, var/list/href_list)
|
||||
if(!interactable() || ..(href,href_list))
|
||||
return
|
||||
/datum/file/program/atmos_alert/proc/return_text()
|
||||
var/priority_text = "<h2>Priority Alerts:</h2>"
|
||||
var/minor_text = "<h2>Minor Alerts:</h2>"
|
||||
|
||||
if("priority_clear" in href_list)
|
||||
var/removing_zone = href_list["priority_clear"]
|
||||
for(var/zone in priority_air_alarms)
|
||||
if(ckey(zone) == removing_zone)
|
||||
usr << "<span class='notice'>Priority Alert for area [zone] cleared.</span>"
|
||||
priority_air_alarms -= zone
|
||||
if(priority_air_alarms.len)
|
||||
for(var/zone in priority_air_alarms)
|
||||
priority_text += "<FONT color='red'><B>[format_text(zone)]</B></FONT> [topic_link(src,"priority_clear=[ckey(zone)]","X")]<BR>"
|
||||
else
|
||||
priority_text += "No priority alerts detected.<BR>"
|
||||
|
||||
if("minor_clear" in href_list)
|
||||
var/removing_zone = href_list["minor_clear"]
|
||||
for(var/zone in minor_air_alarms)
|
||||
if(ckey(zone) == removing_zone)
|
||||
usr << "<span class='notice'>Minor Alert for area [zone] cleared.</span>"
|
||||
minor_air_alarms -= zone
|
||||
if(minor_air_alarms.len)
|
||||
for(var/zone in minor_air_alarms)
|
||||
minor_text += "<B>[format_text(zone)]</B> [topic_link(src,"minor_clear=[ckey(zone)]","X")]<BR>"
|
||||
else
|
||||
minor_text += "No minor alerts detected.<BR>"
|
||||
|
||||
computer.updateUsrDialog()
|
||||
return "[priority_text]<BR><HR>[minor_text]<BR>[topic_link(src,"close","Close")]"
|
||||
|
||||
|
||||
/datum/file/program/atmos_alert/Topic(var/href, var/list/href_list)
|
||||
if(!interactable() || ..(href,href_list))
|
||||
return
|
||||
|
||||
if("priority_clear" in href_list)
|
||||
var/removing_zone = href_list["priority_clear"]
|
||||
for(var/zone in priority_air_alarms)
|
||||
if(ckey(zone) == removing_zone)
|
||||
to_chat(usr, "<span class='notice'>Priority Alert for area [zone] cleared.</span>")
|
||||
priority_air_alarms -= zone
|
||||
|
||||
if("minor_clear" in href_list)
|
||||
var/removing_zone = href_list["minor_clear"]
|
||||
for(var/zone in minor_air_alarms)
|
||||
if(ckey(zone) == removing_zone)
|
||||
to_chat(usr, "<span class='notice'>Minor Alert for area [zone] cleared.</span>")
|
||||
minor_air_alarms -= zone
|
||||
|
||||
computer.updateUsrDialog()
|
||||
|
||||
@@ -23,10 +23,10 @@
|
||||
allow_disassemble = 0
|
||||
|
||||
// No operating system
|
||||
New()
|
||||
..(built=0)
|
||||
os = program
|
||||
circuitb.OS = os
|
||||
/obj/machinery/computer3/security/wooden_tv/New()
|
||||
..(built=0)
|
||||
os = program
|
||||
circuitb.OS = os
|
||||
|
||||
|
||||
/obj/machinery/computer3/security/mining
|
||||
@@ -59,22 +59,22 @@
|
||||
var/networks = list("ALL") // A little workaround as it is not possible to place station_networks here
|
||||
var/screen = "cameras"
|
||||
|
||||
execute(var/datum/file/source)
|
||||
if(istype(source,/datum/file/program/security))
|
||||
var/datum/file/program/security/prog = source
|
||||
prog.key = src
|
||||
prog.camera_list = null
|
||||
return
|
||||
if(istype(source,/datum/file/program/ntos))
|
||||
for(var/obj/item/part/computer/storage/S in list(computer.hdd,computer.floppy))
|
||||
for(var/datum/file/F in S.files)
|
||||
if(istype(F,/datum/file/program/security))
|
||||
var/datum/file/program/security/Sec = F
|
||||
Sec.key = src
|
||||
Sec.camera_list = null
|
||||
Sec.execute(source)
|
||||
return
|
||||
computer.Crash(MISSING_PROGRAM)
|
||||
/datum/file/camnet_key/execute(var/datum/file/source)
|
||||
if(istype(source,/datum/file/program/security))
|
||||
var/datum/file/program/security/prog = source
|
||||
prog.key = src
|
||||
prog.camera_list = null
|
||||
return
|
||||
if(istype(source,/datum/file/program/ntos))
|
||||
for(var/obj/item/part/computer/storage/S in list(computer.hdd,computer.floppy))
|
||||
for(var/datum/file/F in S.files)
|
||||
if(istype(F,/datum/file/program/security))
|
||||
var/datum/file/program/security/Sec = F
|
||||
Sec.key = src
|
||||
Sec.camera_list = null
|
||||
Sec.execute(source)
|
||||
return
|
||||
computer.Crash(MISSING_PROGRAM)
|
||||
|
||||
/datum/file/camnet_key/New()
|
||||
for(var/N in networks)
|
||||
@@ -150,28 +150,29 @@
|
||||
var/mapping = 0//For the overview file, interesting bit of code.
|
||||
|
||||
//proc/camera_list(var/datum/file/camnet_key/key)
|
||||
get_machines(var/datum/file/camnet_key/key)
|
||||
if (!computer || computer.z > 6)
|
||||
return null
|
||||
/obj/item/part/computer/networking/cameras/get_machines(var/datum/file/camnet_key/key)
|
||||
if (!computer || computer.z > 6)
|
||||
return null
|
||||
|
||||
cameranet.process_sort()
|
||||
cameranet.process_sort()
|
||||
|
||||
var/list/L = list()
|
||||
for(var/obj/machinery/camera/C in cameranet.cameras)
|
||||
var/list/temp = C.network & key.networks
|
||||
if(temp.len)
|
||||
L.Add(C)
|
||||
var/list/L = list()
|
||||
for(var/obj/machinery/camera/C in cameranet.cameras)
|
||||
var/list/temp = C.network & key.networks
|
||||
if(temp.len)
|
||||
L.Add(C)
|
||||
|
||||
return L
|
||||
verify_machine(var/obj/machinery/camera/C,var/datum/file/camnet_key/key = null)
|
||||
if(!istype(C) || !C.can_use())
|
||||
return L
|
||||
|
||||
/obj/item/part/computer/networking/cameras/verify_machine(var/obj/machinery/camera/C,var/datum/file/camnet_key/key = null)
|
||||
if(!istype(C) || !C.can_use())
|
||||
return 0
|
||||
|
||||
if(key)
|
||||
var/list/temp = C.network & key.networks
|
||||
if(!temp.len)
|
||||
return 0
|
||||
|
||||
if(key)
|
||||
var/list/temp = C.network & key.networks
|
||||
if(!temp.len)
|
||||
return 0
|
||||
return 1
|
||||
return 1
|
||||
|
||||
/*
|
||||
Camera monitoring program
|
||||
@@ -198,96 +199,96 @@
|
||||
|
||||
var/obj/machinery/camera/current = null
|
||||
|
||||
execute(var/datum/file/program/caller)
|
||||
..(caller)
|
||||
if(computer && !key)
|
||||
var/list/fkeys = computer.list_files(/datum/file/camnet_key)
|
||||
if(fkeys && fkeys.len)
|
||||
key = fkeys[1]
|
||||
update_icon()
|
||||
computer.update_icon()
|
||||
for(var/mob/living/L in viewers(1))
|
||||
if(!istype(L,/mob/living/silicon/ai) && L.machine == src)
|
||||
L.reset_view(null)
|
||||
|
||||
|
||||
Reset()
|
||||
..()
|
||||
reset_current()
|
||||
/datum/file/program/security/execute(var/datum/file/program/caller)
|
||||
..(caller)
|
||||
if(computer && !key)
|
||||
var/list/fkeys = computer.list_files(/datum/file/camnet_key)
|
||||
if(fkeys && fkeys.len)
|
||||
key = fkeys[1]
|
||||
update_icon()
|
||||
computer.update_icon()
|
||||
for(var/mob/living/L in viewers(1))
|
||||
if(!istype(L,/mob/living/silicon/ai) && L.machine == src)
|
||||
L.reset_view(null)
|
||||
|
||||
interact()
|
||||
if(!interactable())
|
||||
return
|
||||
|
||||
if(!computer.camnet)
|
||||
computer.Crash(MISSING_PERIPHERAL)
|
||||
return
|
||||
/datum/file/program/security/Reset()
|
||||
..()
|
||||
reset_current()
|
||||
for(var/mob/living/L in viewers(1))
|
||||
if(!istype(L,/mob/living/silicon/ai) && L.machine == src)
|
||||
L.reset_view(null)
|
||||
|
||||
/datum/file/program/security/interact()
|
||||
if(!interactable())
|
||||
return
|
||||
|
||||
if(!computer.camnet)
|
||||
computer.Crash(MISSING_PERIPHERAL)
|
||||
return
|
||||
|
||||
if(!key)
|
||||
var/list/fkeys = computer.list_files(/datum/file/camnet_key)
|
||||
if(fkeys && fkeys.len)
|
||||
key = fkeys[1]
|
||||
update_icon()
|
||||
computer.update_icon()
|
||||
if(!key)
|
||||
var/list/fkeys = computer.list_files(/datum/file/camnet_key)
|
||||
if(fkeys && fkeys.len)
|
||||
key = fkeys[1]
|
||||
update_icon()
|
||||
computer.update_icon()
|
||||
if(!key)
|
||||
return
|
||||
|
||||
if(computer.camnet.verify_machine(current))
|
||||
usr.reset_view(current)
|
||||
|
||||
if(world.time - last_camera_refresh > 50 || !camera_list)
|
||||
last_camera_refresh = world.time
|
||||
|
||||
var/list/temp_list = computer.camnet.get_machines(key)
|
||||
|
||||
camera_list = "Network Key: [key.title] [topic_link(src,"keyselect","\[ Select key \]")]<hr>"
|
||||
for(var/obj/machinery/camera/C in temp_list)
|
||||
if(C.can_use())
|
||||
camera_list += "[C.c_tag] - [topic_link(src,"show=\ref[C]","Show")]<br>"
|
||||
else
|
||||
camera_list += "[C.c_tag] - <b>DEACTIVATED</b><br>"
|
||||
//camera_list += "<br>" + topic_link(src,"close","Close")
|
||||
|
||||
popup.set_content(camera_list)
|
||||
popup.open()
|
||||
|
||||
|
||||
update_icon()
|
||||
if(key)
|
||||
overlay.icon_state = key.screen
|
||||
name = key.title + " Camera Monitor"
|
||||
else
|
||||
overlay.icon_state = "camera-static"
|
||||
name = initial(name)
|
||||
|
||||
|
||||
|
||||
Topic(var/href,var/list/href_list)
|
||||
if(!interactable() || !computer.camnet || ..(href,href_list))
|
||||
return
|
||||
|
||||
if("show" in href_list)
|
||||
var/obj/machinery/camera/C = locate(href_list["show"])
|
||||
if(istype(C) && C.can_use())
|
||||
set_current(C)
|
||||
usr.reset_view(C)
|
||||
interact()
|
||||
return
|
||||
if(computer.camnet.verify_machine(current))
|
||||
usr.reset_view(current)
|
||||
|
||||
if("keyselect" in href_list)
|
||||
reset_current()
|
||||
usr.reset_view(null)
|
||||
key = input(usr,"Select a camera network key:", "Key Select", null) as null|anything in computer.list_files(/datum/file/camnet_key)
|
||||
select_key(key)
|
||||
if(key)
|
||||
interact()
|
||||
if(world.time - last_camera_refresh > 50 || !camera_list)
|
||||
last_camera_refresh = world.time
|
||||
|
||||
var/list/temp_list = computer.camnet.get_machines(key)
|
||||
|
||||
camera_list = "Network Key: [key.title] [topic_link(src,"keyselect","\[ Select key \]")]<hr>"
|
||||
for(var/obj/machinery/camera/C in temp_list)
|
||||
if(C.can_use())
|
||||
camera_list += "[C.c_tag] - [topic_link(src,"show=\ref[C]","Show")]<br>"
|
||||
else
|
||||
usr << "The screen turns to static."
|
||||
camera_list += "[C.c_tag] - <b>DEACTIVATED</b><br>"
|
||||
//camera_list += "<br>" + topic_link(src,"close","Close")
|
||||
|
||||
popup.set_content(camera_list)
|
||||
popup.open()
|
||||
|
||||
|
||||
/datum/file/program/security/update_icon()
|
||||
if(key)
|
||||
overlay.icon_state = key.screen
|
||||
name = key.title + " Camera Monitor"
|
||||
else
|
||||
overlay.icon_state = "camera-static"
|
||||
name = initial(name)
|
||||
|
||||
|
||||
|
||||
/datum/file/program/security/Topic(var/href,var/list/href_list)
|
||||
if(!interactable() || !computer.camnet || ..(href,href_list))
|
||||
return
|
||||
|
||||
if("show" in href_list)
|
||||
var/obj/machinery/camera/C = locate(href_list["show"])
|
||||
if(istype(C) && C.can_use())
|
||||
set_current(C)
|
||||
usr.reset_view(C)
|
||||
interact()
|
||||
return
|
||||
|
||||
if("keyselect" in href_list)
|
||||
reset_current()
|
||||
usr.reset_view(null)
|
||||
key = input(usr,"Select a camera network key:", "Key Select", null) as null|anything in computer.list_files(/datum/file/camnet_key)
|
||||
select_key(key)
|
||||
if(key)
|
||||
interact()
|
||||
else
|
||||
to_chat(usr, "The screen turns to static.")
|
||||
return
|
||||
|
||||
/datum/file/program/security/proc/select_key(var/selected_key)
|
||||
key = selected_key
|
||||
camera_list = null
|
||||
@@ -332,20 +333,20 @@
|
||||
var/special_key = new/datum/file/camnet_key/syndicate
|
||||
var/camera_conn = null
|
||||
|
||||
interact()
|
||||
if(!interactable())
|
||||
return
|
||||
/datum/file/program/security/syndicate/interact()
|
||||
if(!interactable())
|
||||
return
|
||||
|
||||
if(!computer.net)
|
||||
computer.Crash(MISSING_PERIPHERAL)
|
||||
return
|
||||
if(!computer.net)
|
||||
computer.Crash(MISSING_PERIPHERAL)
|
||||
return
|
||||
|
||||
camera_conn = computer.net.connect_to(/obj/machinery/camera,camera_conn)
|
||||
camera_conn = computer.net.connect_to(/obj/machinery/camera,camera_conn)
|
||||
|
||||
if(!camera_conn)
|
||||
computer.Crash(NETWORK_FAILURE)
|
||||
return
|
||||
if(!camera_conn)
|
||||
computer.Crash(NETWORK_FAILURE)
|
||||
return
|
||||
|
||||
// On interact, override camera key selection
|
||||
select_key(special_key)
|
||||
..()
|
||||
// On interact, override camera key selection
|
||||
select_key(special_key)
|
||||
..()
|
||||
|
||||
@@ -23,329 +23,325 @@
|
||||
var/auth = 0
|
||||
var/printing = 0
|
||||
|
||||
proc/list_jobs()
|
||||
return get_all_jobs() + "Custom"
|
||||
/datum/file/program/card_comp/proc/list_jobs()
|
||||
return get_all_jobs() + "Custom"
|
||||
|
||||
// creates the block with the script in it
|
||||
// cache the result since it's almost constant but not quite
|
||||
// the list of jobs won't change after all...
|
||||
proc/scriptblock()
|
||||
var/global/dat = null
|
||||
var/counter = 0
|
||||
var jobs_all = ""
|
||||
jobs_all += "<table><tr><td></td><td><b>Command</b></td>"
|
||||
// creates the block with the script in it
|
||||
// cache the result since it's almost constant but not quite
|
||||
// the list of jobs won't change after all...
|
||||
/datum/file/program/card_comp/proc/scriptblock()
|
||||
var/global/dat = null
|
||||
var/counter = 0
|
||||
var jobs_all = ""
|
||||
jobs_all += "<table><tr><td></td><td><b>Command</b></td>"
|
||||
|
||||
jobs_all += "</tr><tr height='20'><td><b>Special</b></td>"//Colony Director in special because he is head of heads ~Intercross21
|
||||
jobs_all += "<td weight='100'><a href='?src=\ref[src];;assign=Colony Director'>Colony Director</a></td>"
|
||||
jobs_all += "<td weight='100'><a href='?src=\ref[src];;assign=Custom'>Custom</a></td>"
|
||||
jobs_all += "</tr><tr height='20'><td><b>Special</b></td>"//Colony Director in special because he is head of heads ~Intercross21
|
||||
jobs_all += "<td weight='100'><a href='?src=\ref[src];;assign=Colony Director'>Colony Director</a></td>"
|
||||
jobs_all += "<td weight='100'><a href='?src=\ref[src];;assign=Custom'>Custom</a></td>"
|
||||
|
||||
counter = 0
|
||||
jobs_all += "</tr><tr><td><font color='#A50000'><b>Security</b></font></td>"//Red
|
||||
for(var/job in security_positions)
|
||||
counter++
|
||||
if(counter >= 6)
|
||||
jobs_all += "</tr><tr height='20'><td></td><td></td>"
|
||||
counter = 0
|
||||
jobs_all += "<td height='20' weight='100'><a href='?src=\ref[src];assign=[job]'>[replacetext(job, " ", " ")]</a></td>"
|
||||
counter = 0
|
||||
jobs_all += "</tr><tr><td><font color='#A50000'><b>Security</b></font></td>"//Red
|
||||
for(var/job in security_positions)
|
||||
counter++
|
||||
if(counter >= 6)
|
||||
jobs_all += "</tr><tr height='20'><td></td><td></td>"
|
||||
counter = 0
|
||||
jobs_all += "<td height='20' weight='100'><a href='?src=\ref[src];assign=[job]'>[replacetext(job, " ", " ")]</a></td>"
|
||||
|
||||
counter = 0
|
||||
jobs_all += "</tr><tr><td><font color='#FFA500'><b>Engineering</b></font></td>"//Orange
|
||||
for(var/job in engineering_positions)
|
||||
counter++
|
||||
if(counter >= 6)
|
||||
jobs_all += "</tr><tr height='20'><td></td><td></td>"
|
||||
counter = 0
|
||||
jobs_all += "<td height='20' weight='100'><a href='?src=\ref[src];assign=[job]'>[replacetext(job, " ", " ")]</a></td>"
|
||||
counter = 0
|
||||
jobs_all += "</tr><tr><td><font color='#FFA500'><b>Engineering</b></font></td>"//Orange
|
||||
for(var/job in engineering_positions)
|
||||
counter++
|
||||
if(counter >= 6)
|
||||
jobs_all += "</tr><tr height='20'><td></td><td></td>"
|
||||
counter = 0
|
||||
jobs_all += "<td height='20' weight='100'><a href='?src=\ref[src];assign=[job]'>[replacetext(job, " ", " ")]</a></td>"
|
||||
|
||||
counter = 0
|
||||
jobs_all += "</tr><tr height='20'><td><font color='#008000'><b>Medical</b></font></td>"//Green
|
||||
for(var/job in medical_positions)
|
||||
counter++
|
||||
if(counter >= 6)
|
||||
jobs_all += "</tr><tr height='20'><td></td><td></td>"
|
||||
counter = 0
|
||||
jobs_all += "<td weight='100'><a href='?src=\ref[src];assign=[job]'>[replacetext(job, " ", " ")]</a></td>"
|
||||
counter = 0
|
||||
jobs_all += "</tr><tr height='20'><td><font color='#008000'><b>Medical</b></font></td>"//Green
|
||||
for(var/job in medical_positions)
|
||||
counter++
|
||||
if(counter >= 6)
|
||||
jobs_all += "</tr><tr height='20'><td></td><td></td>"
|
||||
counter = 0
|
||||
jobs_all += "<td weight='100'><a href='?src=\ref[src];assign=[job]'>[replacetext(job, " ", " ")]</a></td>"
|
||||
|
||||
counter = 0
|
||||
jobs_all += "</tr><tr height='20'><td><font color='#800080'><b>Science</b></font></td>"//Purple
|
||||
for(var/job in science_positions)
|
||||
counter++
|
||||
if(counter >= 6)
|
||||
jobs_all += "</tr><tr height='20'><td></td><td></td>"
|
||||
counter = 0
|
||||
jobs_all += "<td weight='100'><a href='?src=\ref[src];assign=[job]'>[replacetext(job, " ", " ")]</a></td>"
|
||||
counter = 0
|
||||
jobs_all += "</tr><tr height='20'><td><font color='#800080'><b>Science</b></font></td>"//Purple
|
||||
for(var/job in science_positions)
|
||||
counter++
|
||||
if(counter >= 6)
|
||||
jobs_all += "</tr><tr height='20'><td></td><td></td>"
|
||||
counter = 0
|
||||
jobs_all += "<td weight='100'><a href='?src=\ref[src];assign=[job]'>[replacetext(job, " ", " ")]</a></td>"
|
||||
|
||||
counter = 0
|
||||
jobs_all += "</tr><tr height='20'><td><font color='#808080'><b>Civilian</b></font></td>"//Grey
|
||||
for(var/job in civilian_positions)
|
||||
counter++
|
||||
if(counter >= 6)
|
||||
jobs_all += "</tr><tr height='20'><td></td><td></td>"
|
||||
counter = 0
|
||||
jobs_all += "<td weight='100'><a href='?src=\ref[src];assign=[job]'>[replacetext(job, " ", " ")]</a></td>"
|
||||
counter = 0
|
||||
jobs_all += "</tr><tr height='20'><td><font color='#808080'><b>Civilian</b></font></td>"//Grey
|
||||
for(var/job in civilian_positions)
|
||||
counter++
|
||||
if(counter >= 6)
|
||||
jobs_all += "</tr><tr height='20'><td></td><td></td>"
|
||||
counter = 0
|
||||
jobs_all += "<td weight='100'><a href='?src=\ref[src];assign=[job]'>[replacetext(job, " ", " ")]</a></td>"
|
||||
|
||||
dat = {"<script type="text/javascript">
|
||||
function markRed(){
|
||||
var nameField = document.getElementById('namefield');
|
||||
nameField.style.backgroundColor = "#FFDDDD";
|
||||
}
|
||||
function markGreen(){
|
||||
var nameField = document.getElementById('namefield');
|
||||
nameField.style.backgroundColor = "#DDFFDD";
|
||||
}
|
||||
function markAccountGreen(){
|
||||
var nameField = document.getElementById('accountfield');
|
||||
nameField.style.backgroundColor = "#DDFFDD";
|
||||
}
|
||||
function markAccountRed(){
|
||||
var nameField = document.getElementById('accountfield');
|
||||
nameField.style.backgroundColor = "#FFDDDD";
|
||||
}
|
||||
function showAll(){
|
||||
var allJobsSlot = document.getElementById('alljobsslot');
|
||||
allJobsSlot.innerHTML = "<a href='#' onclick='hideAll()'>hide</a><br>"+ "[jobs_all]";
|
||||
}
|
||||
function hideAll(){
|
||||
var allJobsSlot = document.getElementById('alljobsslot');
|
||||
allJobsSlot.innerHTML = "<a href='#' onclick='showAll()'>[(writer.assignment) ? writer.assignment : "Unassgied"]</a>";
|
||||
}
|
||||
</script>"}
|
||||
return dat
|
||||
dat = {"<script type="text/javascript">
|
||||
function markRed(){
|
||||
var nameField = document.getElementById('namefield');
|
||||
nameField.style.backgroundColor = "#FFDDDD";
|
||||
}
|
||||
function markGreen(){
|
||||
var nameField = document.getElementById('namefield');
|
||||
nameField.style.backgroundColor = "#DDFFDD";
|
||||
}
|
||||
function markAccountGreen(){
|
||||
var nameField = document.getElementById('accountfield');
|
||||
nameField.style.backgroundColor = "#DDFFDD";
|
||||
}
|
||||
function markAccountRed(){
|
||||
var nameField = document.getElementById('accountfield');
|
||||
nameField.style.backgroundColor = "#FFDDDD";
|
||||
}
|
||||
function showAll(){
|
||||
var allJobsSlot = document.getElementById('alljobsslot');
|
||||
allJobsSlot.innerHTML = "<a href='#' onclick='hideAll()'>hide</a><br>"+ "[jobs_all]";
|
||||
}
|
||||
function hideAll(){
|
||||
var allJobsSlot = document.getElementById('alljobsslot');
|
||||
allJobsSlot.innerHTML = "<a href='#' onclick='showAll()'>[(writer.assignment) ? writer.assignment : "Unassgied"]</a>";
|
||||
}
|
||||
</script>"}
|
||||
return dat
|
||||
|
||||
// creates the list of access rights on the card
|
||||
proc/accessblock()
|
||||
var/accesses = "<div align='center'><b>Access</b></div>"
|
||||
accesses += "<table style='width:100%'>"
|
||||
accesses += "<tr>"
|
||||
for(var/i = 1; i <= 7; i++)
|
||||
accesses += "<td style='width:14%'><b>[get_region_accesses_name(i)]:</b></td>"
|
||||
accesses += "</tr><tr>"
|
||||
for(var/i = 1; i <= 7; i++)
|
||||
accesses += "<td style='width:14%' valign='top'>"
|
||||
for(var/A in get_region_accesses(i))
|
||||
if(A in writer.access)
|
||||
accesses += topic_link(src,"access=[A]","<font color='red'>[replacetext(get_access_desc(A), " ", " ")]</font>") + " "
|
||||
else
|
||||
accesses += topic_link(src,"access=[A]",replacetext(get_access_desc(A), " ", " ")) + " "
|
||||
accesses += "<br>"
|
||||
accesses += "</td>"
|
||||
accesses += "</tr></table>"
|
||||
return accesses
|
||||
// creates the list of access rights on the card
|
||||
/datum/file/program/card_comp/proc/accessblock()
|
||||
var/accesses = "<div align='center'><b>Access</b></div>"
|
||||
accesses += "<table style='width:100%'>"
|
||||
accesses += "<tr>"
|
||||
for(var/i = 1; i <= 7; i++)
|
||||
accesses += "<td style='width:14%'><b>[get_region_accesses_name(i)]:</b></td>"
|
||||
accesses += "</tr><tr>"
|
||||
for(var/i = 1; i <= 7; i++)
|
||||
accesses += "<td style='width:14%' valign='top'>"
|
||||
for(var/A in get_region_accesses(i))
|
||||
if(A in writer.access)
|
||||
accesses += topic_link(src,"access=[A]","<font color='red'>[replacetext(get_access_desc(A), " ", " ")]</font>") + " "
|
||||
else
|
||||
accesses += topic_link(src,"access=[A]",replacetext(get_access_desc(A), " ", " ")) + " "
|
||||
accesses += "<br>"
|
||||
accesses += "</td>"
|
||||
accesses += "</tr></table>"
|
||||
return accesses
|
||||
|
||||
proc/card_modify_menu()
|
||||
//assume peripherals and cards, do checks for them in interact
|
||||
/datum/file/program/card_comp/proc/card_modify_menu()
|
||||
//assume peripherals and cards, do checks for them in interact
|
||||
|
||||
// Header
|
||||
var/dat = "<div align='center'><br>"
|
||||
dat += topic_link(src,"remove=writer","Remove [writer.name]") + " || "
|
||||
dat += topic_link(src,"remove=reader","Remove [reader.name]") + " <br> "
|
||||
dat += topic_link(src,"mode=1","Access Crew Manifest") + " || "
|
||||
dat += topic_link(src,"logout","Log Out") + "</div>"
|
||||
dat += "<hr>" + scriptblock()
|
||||
// Header
|
||||
var/dat = "<div align='center'><br>"
|
||||
dat += topic_link(src,"remove=writer","Remove [writer.name]") + " || "
|
||||
dat += topic_link(src,"remove=reader","Remove [reader.name]") + " <br> "
|
||||
dat += topic_link(src,"mode=1","Access Crew Manifest") + " || "
|
||||
dat += topic_link(src,"logout","Log Out") + "</div>"
|
||||
dat += "<hr>" + scriptblock()
|
||||
|
||||
// form for renaming the ID
|
||||
dat += "<form name='cardcomp' action='byond://' method='get'>"
|
||||
dat += "<input type='hidden' name='src' value='\ref[src]'>"
|
||||
dat += "<b>registered_name:</b> <input type='text' id='namefield' name='reg' value='[writer.registered_name]' style='width:250px; background-color:white;' onchange='markRed()'>"
|
||||
dat += "<input type='submit' value='Rename' onclick='markGreen()'>"
|
||||
dat += "</form>"
|
||||
// form for renaming the ID
|
||||
dat += "<form name='cardcomp' action='byond://' method='get'>"
|
||||
dat += "<input type='hidden' name='src' value='\ref[src]'>"
|
||||
dat += "<b>registered_name:</b> <input type='text' id='namefield' name='reg' value='[writer.registered_name]' style='width:250px; background-color:white;' onchange='markRed()'>"
|
||||
dat += "<input type='submit' value='Rename' onclick='markGreen()'>"
|
||||
dat += "</form>"
|
||||
|
||||
// form for changing assignment, taken care of by scriptblock() mostly
|
||||
var/assign_temp = writer.assignment
|
||||
if(!assign_temp || assign_temp == "") assign_temp = "Unassigned"
|
||||
dat += "<b>Assignment:</b> [assign_temp] <span id='alljobsslot'><a href='#' onclick='showAll()'>change</a></span>"
|
||||
// form for changing assignment, taken care of by scriptblock() mostly
|
||||
var/assign_temp = writer.assignment
|
||||
if(!assign_temp || assign_temp == "") assign_temp = "Unassigned"
|
||||
dat += "<b>Assignment:</b> [assign_temp] <span id='alljobsslot'><a href='#' onclick='showAll()'>change</a></span>"
|
||||
|
||||
// list of access rights
|
||||
dat += accessblock()
|
||||
// list of access rights
|
||||
dat += accessblock()
|
||||
return dat
|
||||
|
||||
return dat
|
||||
/datum/file/program/card_comp/proc/login_menu()
|
||||
//assume peripherals and cards, do checks for them in interact
|
||||
var/dat = "<br><i>Please insert the cards into the slots</i><br>"
|
||||
|
||||
proc/login_menu()
|
||||
//assume peripherals and cards, do checks for them in interact
|
||||
var/dat = "<br><i>Please insert the cards into the slots</i><br>"
|
||||
if(istype(writer))
|
||||
dat += "Target: [topic_link(src,"remove=writer",writer.name)]<br>"
|
||||
else
|
||||
dat += "Target: [topic_link(src,"insert=writer","--------")]<br>"
|
||||
|
||||
if(istype(writer))
|
||||
dat += "Target: [topic_link(src,"remove=writer",writer.name)]<br>"
|
||||
if(istype(reader))
|
||||
dat += "Confirm Identity: [topic_link(src,"remove=reader",reader.name)]<br>"
|
||||
else
|
||||
dat += "Confirm Identity: [topic_link(src,"insert=reader","--------")]<br>"
|
||||
dat += "[topic_link(src,"auth","{Log in}")]<br><hr>"
|
||||
dat += topic_link(src,"mode=1","Access Crew Manifest")
|
||||
return dat
|
||||
|
||||
/datum/file/program/card_comp/proc/show_manifest()
|
||||
// assume linked_db since called by interact()
|
||||
var/crew = ""
|
||||
var/list/L = list()
|
||||
for (var/datum/data/record/t in data_core.general)
|
||||
var/R = t.fields["name"] + " - " + t.fields["rank"]
|
||||
L += R
|
||||
for(var/R in sortList(L))
|
||||
crew += "[R]<br>"
|
||||
return "<tt><b>Crew Manifest:</b><br>Please use security record computer to modify entries.<br><br>[crew][topic_link(src,"print","Print")]<br><br>[topic_link(src,"mode=0","Access ID modification console.")]<br></tt>"
|
||||
|
||||
// These are here partly in order to be overwritten by the centcom card computer code
|
||||
/datum/file/program/card_comp/proc/authenticate()
|
||||
if(access_change_ids in reader.access)
|
||||
return 1
|
||||
if(istype(usr,/mob/living/silicon/ai))
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/datum/file/program/card_comp/proc/set_default_access(var/jobname)
|
||||
var/datum/job/jobdatum
|
||||
for(var/jobtype in typesof(/datum/job))
|
||||
var/datum/job/J = new jobtype
|
||||
if(ckey(J.title) == ckey(jobname))
|
||||
jobdatum = J
|
||||
break
|
||||
if(jobdatum)
|
||||
writer.access = jobdatum.get_access() // ( istype(src,/obj/machinery/computer/card/centcom) ? get_centcom_access(t1)
|
||||
|
||||
|
||||
/datum/file/program/card_comp/interact()
|
||||
if(!interactable())
|
||||
return
|
||||
|
||||
if(!istype(computer.cardslot, /obj/item/part/computer/cardslot/dual))
|
||||
computer.Crash(MISSING_PERIPHERAL)
|
||||
return
|
||||
|
||||
var/obj/item/part/computer/cardslot/dual/D = computer.cardslot
|
||||
reader = D.reader
|
||||
writer = D.writer
|
||||
|
||||
var/dat
|
||||
|
||||
switch(mode)
|
||||
if(0)
|
||||
if( !istype(writer) || !istype(reader) )
|
||||
auth = 0
|
||||
if( !auth )
|
||||
dat = login_menu()
|
||||
else
|
||||
dat = card_modify_menu()
|
||||
if(1)
|
||||
dat = show_manifest()
|
||||
|
||||
|
||||
popup.width = 940
|
||||
popup.height = 520
|
||||
popup.set_content(dat)
|
||||
popup.open()
|
||||
return
|
||||
|
||||
|
||||
/datum/file/program/card_comp/Topic(href, list/href_list)
|
||||
if(!interactable() || !computer.cardslot || ..(href,href_list))
|
||||
return
|
||||
// todo distance/disability checks
|
||||
|
||||
if("mode" in href_list)
|
||||
mode = text2num(href_list["mode"])
|
||||
if(mode != 0 && mode != 1)
|
||||
mode = 0
|
||||
|
||||
auth = 0 // always log out if switching modes just in case
|
||||
|
||||
if("remove" in href_list)
|
||||
var/which = href_list["remove"]
|
||||
if(which == "writer")
|
||||
computer.cardslot.remove(usr, 2)
|
||||
else
|
||||
dat += "Target: [topic_link(src,"insert=writer","--------")]<br>"
|
||||
computer.cardslot.remove(usr, 1)
|
||||
auth = 0
|
||||
|
||||
if(istype(reader))
|
||||
dat += "Confirm Identity: [topic_link(src,"remove=reader",reader.name)]<br>"
|
||||
if("insert" in href_list)
|
||||
var/obj/item/weapon/card/card = usr.get_active_hand()
|
||||
if(!istype(card)) return
|
||||
|
||||
var/which = href_list["insert"]
|
||||
if(which == "writer")
|
||||
computer.cardslot.insert(card, usr, 2)
|
||||
else
|
||||
dat += "Confirm Identity: [topic_link(src,"insert=reader","--------")]<br>"
|
||||
dat += "[topic_link(src,"auth","{Log in}")]<br><hr>"
|
||||
dat += topic_link(src,"mode=1","Access Crew Manifest")
|
||||
return dat
|
||||
computer.cardslot.insert(card,usr)
|
||||
|
||||
proc/show_manifest()
|
||||
// assume linked_db since called by interact()
|
||||
var/crew = ""
|
||||
if("print" in href_list)
|
||||
if (printing)
|
||||
return
|
||||
|
||||
printing = 1
|
||||
sleep(50)
|
||||
var/obj/item/weapon/paper/P = new /obj/item/weapon/paper( computer.loc )
|
||||
P.info = "<B>Crew Manifest:</B><BR>"
|
||||
var/list/L = list()
|
||||
for (var/datum/data/record/t in data_core.general)
|
||||
var/R = t.fields["name"] + " - " + t.fields["rank"]
|
||||
L += R
|
||||
for(var/R in sortList(L))
|
||||
crew += "[R]<br>"
|
||||
return "<tt><b>Crew Manifest:</b><br>Please use security record computer to modify entries.<br><br>[crew][topic_link(src,"print","Print")]<br><br>[topic_link(src,"mode=0","Access ID modification console.")]<br></tt>"
|
||||
P.info += "[R]<br>"
|
||||
P.name = "paper- 'Crew Manifest'"
|
||||
printing = 0
|
||||
|
||||
// These are here partly in order to be overwritten by the centcom card computer code
|
||||
proc/authenticate()
|
||||
if(access_change_ids in reader.access)
|
||||
return 1
|
||||
if(istype(usr,/mob/living/silicon/ai))
|
||||
return 1
|
||||
return 0
|
||||
if("auth" in href_list)
|
||||
auth = 0
|
||||
if(istype(reader) && istype(writer) && authenticate())
|
||||
auth = 1
|
||||
|
||||
proc/set_default_access(var/jobname)
|
||||
var/datum/job/jobdatum
|
||||
for(var/jobtype in typesof(/datum/job))
|
||||
var/datum/job/J = new jobtype
|
||||
if(ckey(J.title) == ckey(jobname))
|
||||
jobdatum = J
|
||||
break
|
||||
if(jobdatum)
|
||||
writer.access = jobdatum.get_access() // ( istype(src,/obj/machinery/computer/card/centcom) ? get_centcom_access(t1)
|
||||
if("logout" in href_list)
|
||||
auth = 0
|
||||
|
||||
// Actual ID changing
|
||||
|
||||
interact()
|
||||
if(!interactable()) return
|
||||
|
||||
if(!computer.cardslot || !computer.cardslot.dualslot)
|
||||
computer.Crash(MISSING_PERIPHERAL)
|
||||
return
|
||||
|
||||
reader = computer.cardslot.reader
|
||||
writer = computer.cardslot.writer
|
||||
|
||||
var/dat
|
||||
|
||||
switch(mode)
|
||||
if(0)
|
||||
if( !istype(writer) || !istype(reader) )
|
||||
auth = 0
|
||||
if( !auth )
|
||||
dat = login_menu()
|
||||
else
|
||||
dat = card_modify_menu()
|
||||
if(1)
|
||||
dat = show_manifest()
|
||||
|
||||
|
||||
popup.width = 940
|
||||
popup.height = 520
|
||||
popup.set_content(dat)
|
||||
popup.open()
|
||||
return
|
||||
|
||||
|
||||
Topic(href, list/href_list)
|
||||
if(!interactable() || !computer.cardslot || ..(href,href_list))
|
||||
return
|
||||
// todo distance/disability checks
|
||||
|
||||
if("mode" in href_list)
|
||||
mode = text2num(href_list["mode"])
|
||||
if(mode != 0 && mode != 1)
|
||||
mode = 0
|
||||
|
||||
auth = 0 // always log out if switching modes just in case
|
||||
|
||||
if("remove" in href_list)
|
||||
var/which = href_list["remove"]
|
||||
if(which == "writer")
|
||||
computer.cardslot.remove(2)
|
||||
else
|
||||
computer.cardslot.remove(1)
|
||||
auth = 0
|
||||
|
||||
if("insert" in href_list)
|
||||
var/obj/item/weapon/card/card = usr.get_active_hand()
|
||||
if(!istype(card)) return
|
||||
|
||||
var/which = href_list["insert"]
|
||||
if(which == "writer")
|
||||
computer.cardslot.insert(card,2)
|
||||
else
|
||||
computer.cardslot.insert(card,1)
|
||||
|
||||
if("print" in href_list)
|
||||
if (printing)
|
||||
return
|
||||
|
||||
printing = 1
|
||||
sleep(50)
|
||||
var/obj/item/weapon/paper/P = new /obj/item/weapon/paper( computer.loc )
|
||||
P.info = "<B>Crew Manifest:</B><BR>"
|
||||
var/list/L = list()
|
||||
for (var/datum/data/record/t in data_core.general)
|
||||
var/R = t.fields["name"] + " - " + t.fields["rank"]
|
||||
L += R
|
||||
for(var/R in sortList(L))
|
||||
P.info += "[R]<br>"
|
||||
P.name = "paper- 'Crew Manifest'"
|
||||
printing = 0
|
||||
|
||||
if("auth" in href_list)
|
||||
auth = 0
|
||||
if(istype(reader) && istype(writer) && authenticate())
|
||||
auth = 1
|
||||
|
||||
if("logout" in href_list)
|
||||
auth = 0
|
||||
|
||||
// Actual ID changing
|
||||
|
||||
if("access" in href_list)
|
||||
if(auth)
|
||||
var/access_type = text2num(href_list["access"])
|
||||
writer.access ^= list(access_type) //logical xor: remove if present, add if not
|
||||
|
||||
if("assign" in href_list)
|
||||
if(auth)
|
||||
var/t1 = href_list["assign"]
|
||||
if(t1 == "Custom")
|
||||
var/temp_t = sanitize(input("Enter a custom job assignment.","Assignment"))
|
||||
if(temp_t)
|
||||
t1 = temp_t
|
||||
set_default_access(t1)
|
||||
|
||||
writer.assignment = t1
|
||||
writer.name = text("[writer.registered_name]'s ID Card ([writer.assignment])")
|
||||
data_core.manifest_modify(writer.registered_name, writer.assignment)
|
||||
callHook("reassign_employee", list(writer))
|
||||
|
||||
if("reg" in href_list)
|
||||
if(auth)
|
||||
writer.registered_name = href_list["reg"]
|
||||
writer.name = text("[writer.registered_name]'s ID Card ([writer.assignment])")
|
||||
data_core.manifest_modify(writer.registered_name, writer.assignment)
|
||||
callHook("reassign_employee", list(writer))
|
||||
|
||||
computer.updateUsrDialog()
|
||||
return
|
||||
|
||||
if("access" in href_list)
|
||||
if(auth)
|
||||
var/access_type = text2num(href_list["access"])
|
||||
writer.access ^= list(access_type) //logical xor: remove if present, add if not
|
||||
|
||||
if("assign" in href_list)
|
||||
if(auth)
|
||||
var/t1 = href_list["assign"]
|
||||
if(t1 == "Custom")
|
||||
var/temp_t = sanitize(input("Enter a custom job assignment.","Assignment"))
|
||||
if(temp_t)
|
||||
t1 = temp_t
|
||||
set_default_access(t1)
|
||||
|
||||
writer.assignment = t1
|
||||
writer.name = text("[writer.registered_name]'s ID Card ([writer.assignment])")
|
||||
data_core.manifest_modify(writer.registered_name, writer.assignment)
|
||||
callHook("reassign_employee", list(writer))
|
||||
|
||||
if("reg" in href_list)
|
||||
if(auth)
|
||||
writer.registered_name = href_list["reg"]
|
||||
writer.name = text("[writer.registered_name]'s ID Card ([writer.assignment])")
|
||||
data_core.manifest_modify(writer.registered_name, writer.assignment)
|
||||
callHook("reassign_employee", list(writer))
|
||||
|
||||
computer.updateUsrDialog()
|
||||
return
|
||||
|
||||
/datum/file/program/card_comp/centcom
|
||||
name = "CentCom identification console"
|
||||
drm = 1
|
||||
|
||||
list_jobs()
|
||||
return get_all_centcom_jobs() + "Custom"
|
||||
/datum/file/program/card_comp/centcom/list_jobs()
|
||||
return get_all_centcom_jobs() + "Custom"
|
||||
|
||||
accessblock()
|
||||
var/accesses = "<h5>[using_map.boss_name]:</h5>"
|
||||
for(var/A in get_all_centcom_access())
|
||||
if(A in writer.access)
|
||||
accesses += topic_link(src,"access=[A]","<font color='red'>[replacetext(get_centcom_access_desc(A), " ", " ")]</font>") + " "
|
||||
else
|
||||
accesses += topic_link(src,"access=[A]",replacetext(get_centcom_access_desc(A), " ", " ")) + " "
|
||||
return accesses
|
||||
/datum/file/program/card_comp/centcom/accessblock()
|
||||
var/accesses = "<h5>[using_map.boss_name]:</h5>"
|
||||
for(var/A in get_all_centcom_access())
|
||||
if(A in writer.access)
|
||||
accesses += topic_link(src,"access=[A]","<font color='red'>[replacetext(get_centcom_access_desc(A), " ", " ")]</font>") + " "
|
||||
else
|
||||
accesses += topic_link(src,"access=[A]",replacetext(get_centcom_access_desc(A), " ", " ")) + " "
|
||||
return accesses
|
||||
|
||||
authenticate()
|
||||
if(access_cent_captain in reader.access)
|
||||
return 1
|
||||
return 0
|
||||
/datum/file/program/card_comp/centcom/authenticate()
|
||||
if(access_cent_captain in reader.access)
|
||||
return 1
|
||||
return 0
|
||||
|
||||
@@ -45,349 +45,369 @@
|
||||
|
||||
var/datum/announcement/priority/crew_announcement = new
|
||||
|
||||
New()
|
||||
..()
|
||||
crew_announcement.newscast = 1
|
||||
/datum/file/program/communications/New()
|
||||
..()
|
||||
crew_announcement.newscast = 1
|
||||
|
||||
Reset()
|
||||
..()
|
||||
authenticated = 0
|
||||
/datum/file/program/communications/Reset()
|
||||
..()
|
||||
authenticated = 0
|
||||
state = STATE_DEFAULT
|
||||
aistate = STATE_DEFAULT
|
||||
|
||||
|
||||
/datum/file/program/communications/Topic(var/href, var/list/href_list)
|
||||
if(!interactable() || !computer.radio || ..(href,href_list) )
|
||||
return
|
||||
if (computer.z > 1)
|
||||
to_chat(usr, "<span class='danger'>Unable to establish a connection:</span> You're too far away from the station!")
|
||||
return
|
||||
|
||||
if("main" in href_list)
|
||||
state = STATE_DEFAULT
|
||||
aistate = STATE_DEFAULT
|
||||
|
||||
|
||||
Topic(var/href, var/list/href_list)
|
||||
if(!interactable() || !computer.radio || ..(href,href_list) )
|
||||
return
|
||||
if (computer.z > 1)
|
||||
usr << "<span class='danger'>Unable to establish a connection:</span> You're too far away from the station!"
|
||||
return
|
||||
|
||||
if("main" in href_list)
|
||||
state = STATE_DEFAULT
|
||||
if("login" in href_list)
|
||||
var/mob/M = usr
|
||||
var/obj/item/I = M.get_active_hand()
|
||||
if(I)
|
||||
I = I.GetID()
|
||||
if(istype(I,/obj/item/weapon/card/id) && check_access(I))
|
||||
authenticated = 1
|
||||
if(access_captain in I.GetAccess())
|
||||
authenticated = 2
|
||||
crew_announcement.announcer = GetNameAndAssignmentFromId(I)
|
||||
if(istype(I,/obj/item/weapon/card/emag))
|
||||
authenticated = 2
|
||||
computer.emagged = 1
|
||||
if("logout" in href_list)
|
||||
authenticated = 0
|
||||
crew_announcement.announcer = ""
|
||||
|
||||
if("swipeidseclevel" in href_list)
|
||||
var/mob/M = usr
|
||||
var/obj/item/I = M.get_active_hand()
|
||||
if("login" in href_list)
|
||||
var/mob/M = usr
|
||||
var/obj/item/I = M.get_active_hand()
|
||||
if(I)
|
||||
I = I.GetID()
|
||||
if(istype(I,/obj/item/weapon/card/id) && check_access(I))
|
||||
authenticated = 1
|
||||
if(access_captain in I.GetAccess())
|
||||
authenticated = 2
|
||||
crew_announcement.announcer = GetNameAndAssignmentFromId(I)
|
||||
if(istype(I,/obj/item/weapon/card/emag))
|
||||
authenticated = 2
|
||||
computer.emagged = 1
|
||||
|
||||
if (istype(I,/obj/item/weapon/card/id))
|
||||
if(access_captain in I.GetAccess())
|
||||
var/old_level = security_level
|
||||
if(!tmp_alertlevel) tmp_alertlevel = SEC_LEVEL_GREEN
|
||||
if(tmp_alertlevel < SEC_LEVEL_GREEN) tmp_alertlevel = SEC_LEVEL_GREEN
|
||||
if(tmp_alertlevel > SEC_LEVEL_BLUE) tmp_alertlevel = SEC_LEVEL_BLUE //Cannot engage delta with this
|
||||
set_security_level(tmp_alertlevel)
|
||||
if(security_level != old_level)
|
||||
//Only notify the admins if an actual change happened
|
||||
log_game("[key_name(usr)] has changed the security level to [get_security_level()].")
|
||||
message_admins("[key_name_admin(usr)] has changed the security level to [get_security_level()].")
|
||||
switch(security_level)
|
||||
if(SEC_LEVEL_GREEN)
|
||||
feedback_inc("alert_comms_green",1)
|
||||
if(SEC_LEVEL_BLUE)
|
||||
feedback_inc("alert_comms_blue",1)
|
||||
tmp_alertlevel = 0
|
||||
else:
|
||||
usr << "You are not authorized to do this."
|
||||
tmp_alertlevel = 0
|
||||
state = STATE_DEFAULT
|
||||
if("logout" in href_list)
|
||||
authenticated = 0
|
||||
crew_announcement.announcer = ""
|
||||
|
||||
if("swipeidseclevel" in href_list)
|
||||
var/mob/M = usr
|
||||
var/obj/item/I = M.get_active_hand()
|
||||
I = I.GetID()
|
||||
|
||||
if (istype(I,/obj/item/weapon/card/id))
|
||||
if(access_captain in I.GetAccess())
|
||||
var/old_level = security_level
|
||||
if(!tmp_alertlevel)
|
||||
tmp_alertlevel = SEC_LEVEL_GREEN
|
||||
if(tmp_alertlevel < SEC_LEVEL_GREEN)
|
||||
tmp_alertlevel = SEC_LEVEL_GREEN
|
||||
if(tmp_alertlevel > SEC_LEVEL_BLUE)
|
||||
tmp_alertlevel = SEC_LEVEL_BLUE //Cannot engage delta with this
|
||||
set_security_level(tmp_alertlevel)
|
||||
if(security_level != old_level)
|
||||
//Only notify the admins if an actual change happened
|
||||
log_game("[key_name(usr)] has changed the security level to [get_security_level()].")
|
||||
message_admins("[key_name_admin(usr)] has changed the security level to [get_security_level()].")
|
||||
switch(security_level)
|
||||
if(SEC_LEVEL_GREEN)
|
||||
feedback_inc("alert_comms_green",1)
|
||||
if(SEC_LEVEL_BLUE)
|
||||
feedback_inc("alert_comms_blue",1)
|
||||
tmp_alertlevel = 0
|
||||
else
|
||||
usr << "You need to swipe your ID."
|
||||
if("announce" in href_list)
|
||||
if(authenticated==2)
|
||||
if(message_cooldown)
|
||||
usr << "Please allow at least one minute to pass between announcements"
|
||||
return
|
||||
var/input = input(usr, "Please write a message to announce to the station crew.", "Priority Announcement")
|
||||
if(!input || !interactable())
|
||||
return
|
||||
crew_announcement.Announce(input)
|
||||
message_cooldown = 1
|
||||
spawn(600)//One minute cooldown
|
||||
message_cooldown = 0
|
||||
|
||||
if("callshuttle" in href_list)
|
||||
to_chat(usr, "You are not authorized to do this.")
|
||||
tmp_alertlevel = 0
|
||||
state = STATE_DEFAULT
|
||||
if(authenticated)
|
||||
state = STATE_CALLSHUTTLE
|
||||
if("callshuttle2" in href_list)
|
||||
if(!computer.radio.subspace)
|
||||
else
|
||||
to_chat(usr, "You need to swipe your ID.")
|
||||
|
||||
if("announce" in href_list)
|
||||
if(authenticated==2)
|
||||
if(message_cooldown)
|
||||
usr << "Please allow at least one minute to pass between announcements"
|
||||
return
|
||||
if(authenticated)
|
||||
call_shuttle_proc(usr)
|
||||
if(emergency_shuttle.online())
|
||||
post_status("shuttle")
|
||||
state = STATE_DEFAULT
|
||||
if("cancelshuttle" in href_list)
|
||||
state = STATE_DEFAULT
|
||||
if(authenticated)
|
||||
state = STATE_CANCELSHUTTLE
|
||||
if("messagelist" in href_list)
|
||||
currmsg = 0
|
||||
state = STATE_MESSAGELIST
|
||||
if("viewmessage" in href_list)
|
||||
state = STATE_VIEWMESSAGE
|
||||
if (!currmsg)
|
||||
if(href_list["message-num"])
|
||||
currmsg = text2num(href_list["message-num"])
|
||||
else
|
||||
state = STATE_MESSAGELIST
|
||||
if("delmessage" in href_list)
|
||||
state = (currmsg) ? STATE_DELMESSAGE : STATE_MESSAGELIST
|
||||
if("delmessage2" in href_list)
|
||||
if(authenticated)
|
||||
if(currmsg)
|
||||
var/title = messagetitle[currmsg]
|
||||
var/text = messagetext[currmsg]
|
||||
messagetitle.Remove(title)
|
||||
messagetext.Remove(text)
|
||||
if(currmsg == aicurrmsg)
|
||||
aicurrmsg = 0
|
||||
currmsg = 0
|
||||
state = STATE_MESSAGELIST
|
||||
else
|
||||
state = STATE_VIEWMESSAGE
|
||||
if("status" in href_list)
|
||||
state = STATE_STATUSDISPLAY
|
||||
|
||||
// Status display stuff
|
||||
if("setstat" in href_list)
|
||||
switch(href_list["statdisp"])
|
||||
if("message")
|
||||
post_status("message", stat_msg1, stat_msg2)
|
||||
if("alert")
|
||||
post_status("alert", href_list["alert"])
|
||||
else
|
||||
post_status(href_list["statdisp"])
|
||||
|
||||
if("setmsg1" in href_list)
|
||||
stat_msg1 = reject_bad_text(sanitize(input("Line 1", "Enter Message Text", stat_msg1) as text|null, 40), 40)
|
||||
computer.updateDialog()
|
||||
if("setmsg2" in href_list)
|
||||
stat_msg2 = reject_bad_text(sanitize(input("Line 2", "Enter Message Text", stat_msg2) as text|null, 40), 40)
|
||||
computer.updateDialog()
|
||||
|
||||
// OMG CENTCOM LETTERHEAD
|
||||
if("MessageCentCom" in href_list)
|
||||
if(!computer.radio.subspace)
|
||||
var/input = input(usr, "Please write a message to announce to the station crew.", "Priority Announcement")
|
||||
if(!input || !interactable())
|
||||
return
|
||||
if(authenticated==2)
|
||||
if(centcomm_message_cooldown)
|
||||
usr << "Arrays recycling. Please stand by."
|
||||
return
|
||||
var/input = sanitize(input("Please choose a message to transmit to [using_map.boss_short] via quantum entanglement. Please be aware that this process is very expensive, and abuse will lead to... termination. Transmission does not guarantee a response.", "To abort, send an empty message.", ""))
|
||||
if(!input || !interactable())
|
||||
return
|
||||
CentCom_announce(input, usr)
|
||||
usr << "Message transmitted."
|
||||
log_game("[key_name(usr)] has made a [using_map.boss_short] announcement: [input]")
|
||||
centcomm_message_cooldown = 1
|
||||
spawn(600)//10 minute cooldown
|
||||
centcomm_message_cooldown = 0
|
||||
crew_announcement.Announce(input)
|
||||
message_cooldown = 1
|
||||
spawn(600)//One minute cooldown
|
||||
message_cooldown = 0
|
||||
|
||||
if("callshuttle" in href_list)
|
||||
state = STATE_DEFAULT
|
||||
if(authenticated)
|
||||
state = STATE_CALLSHUTTLE
|
||||
|
||||
// OMG SYNDICATE ...LETTERHEAD
|
||||
if("MessageSyndicate" in href_list)
|
||||
if((authenticated==2) && (computer.emagged))
|
||||
if(centcomm_message_cooldown)
|
||||
usr << "Arrays recycling. Please stand by."
|
||||
return
|
||||
var/input = sanitize(input(usr, "Please choose a message to transmit to \[ABNORMAL ROUTING CORDINATES\] via quantum entanglement. Please be aware that this process is very expensive, and abuse will lead to... termination. Transmission does not guarantee a response.", "To abort, send an empty message.", ""))
|
||||
if(!input || !interactable())
|
||||
return
|
||||
Syndicate_announce(input, usr)
|
||||
usr << "Message transmitted."
|
||||
log_game("[key_name(usr)] has made an illegal announcement: [input]")
|
||||
centcomm_message_cooldown = 1
|
||||
spawn(600)//10 minute cooldown
|
||||
centcomm_message_cooldown = 0
|
||||
|
||||
if("RestoreBackup" in href_list)
|
||||
usr << "Backup routing data restored!"
|
||||
computer.emagged = 0
|
||||
computer.updateDialog()
|
||||
|
||||
|
||||
|
||||
// AI interface
|
||||
if("ai-main" in href_list)
|
||||
aicurrmsg = 0
|
||||
aistate = STATE_DEFAULT
|
||||
if("ai-callshuttle" in href_list)
|
||||
aistate = STATE_CALLSHUTTLE
|
||||
if("ai-callshuttle2" in href_list)
|
||||
if(!computer.radio.subspace)
|
||||
return
|
||||
if("callshuttle2" in href_list)
|
||||
if(!computer.radio.subspace)
|
||||
return
|
||||
if(authenticated)
|
||||
call_shuttle_proc(usr)
|
||||
aistate = STATE_DEFAULT
|
||||
if("ai-messagelist" in href_list)
|
||||
aicurrmsg = 0
|
||||
aistate = STATE_MESSAGELIST
|
||||
if("ai-viewmessage" in href_list)
|
||||
aistate = STATE_VIEWMESSAGE
|
||||
if (!aicurrmsg)
|
||||
if(href_list["message-num"])
|
||||
aicurrmsg = text2num(href_list["message-num"])
|
||||
else
|
||||
aistate = STATE_MESSAGELIST
|
||||
if("ai-delmessage" in href_list)
|
||||
aistate = (aicurrmsg) ? STATE_DELMESSAGE : STATE_MESSAGELIST
|
||||
if("ai-delmessage2" in href_list)
|
||||
if(aicurrmsg)
|
||||
var/title = messagetitle[aicurrmsg]
|
||||
var/text = messagetext[aicurrmsg]
|
||||
if(emergency_shuttle.online())
|
||||
post_status("shuttle")
|
||||
state = STATE_DEFAULT
|
||||
|
||||
if("cancelshuttle" in href_list)
|
||||
state = STATE_DEFAULT
|
||||
if(authenticated)
|
||||
state = STATE_CANCELSHUTTLE
|
||||
|
||||
if("messagelist" in href_list)
|
||||
currmsg = 0
|
||||
state = STATE_MESSAGELIST
|
||||
|
||||
if("viewmessage" in href_list)
|
||||
state = STATE_VIEWMESSAGE
|
||||
if (!currmsg)
|
||||
if(href_list["message-num"])
|
||||
currmsg = text2num(href_list["message-num"])
|
||||
else
|
||||
state = STATE_MESSAGELIST
|
||||
|
||||
if("delmessage" in href_list)
|
||||
state = (currmsg) ? STATE_DELMESSAGE : STATE_MESSAGELIST
|
||||
|
||||
if("delmessage2" in href_list)
|
||||
if(authenticated)
|
||||
if(currmsg)
|
||||
var/title = messagetitle[currmsg]
|
||||
var/text = messagetext[currmsg]
|
||||
messagetitle.Remove(title)
|
||||
messagetext.Remove(text)
|
||||
if(currmsg == aicurrmsg)
|
||||
currmsg = 0
|
||||
aicurrmsg = 0
|
||||
aistate = STATE_MESSAGELIST
|
||||
if("ai-status" in href_list)
|
||||
aistate = STATE_STATUSDISPLAY
|
||||
|
||||
if("securitylevel" in href_list)
|
||||
tmp_alertlevel = text2num( href_list["newalertlevel"] )
|
||||
if(!tmp_alertlevel) tmp_alertlevel = 0
|
||||
state = STATE_CONFIRM_LEVEL
|
||||
|
||||
if("changeseclevel" in href_list)
|
||||
state = STATE_ALERT_LEVEL
|
||||
|
||||
computer.updateUsrDialog()
|
||||
|
||||
|
||||
|
||||
proc/main_menu()
|
||||
var/dat = ""
|
||||
if (computer.radio.subspace)
|
||||
if(emergency_shuttle.online() && emergency_shuttle.location())
|
||||
var/timeleft = emergency_shuttle.estimate_arrival_time()
|
||||
dat += "<B>Emergency shuttle</B>\n<BR>\nETA: [timeleft / 60 % 60]:[add_zero(num2text(timeleft % 60), 2)]<BR>"
|
||||
refresh = 1
|
||||
else
|
||||
refresh = 0
|
||||
if (authenticated)
|
||||
dat += "<BR>\[ <A HREF='?src=\ref[src];logout'>Log Out</A> \]"
|
||||
if (authenticated==2)
|
||||
dat += "<BR>\[ <A HREF='?src=\ref[src];announce'>Make An Announcement</A> \]"
|
||||
if(computer.emagged == 0)
|
||||
dat += "<BR>\[ <A HREF='?src=\ref[src];MessageCentCom'>Send an emergency message to [using_map.boss_short]</A> \]"
|
||||
else
|
||||
dat += "<BR>\[ <A HREF='?src=\ref[src];MessageSyndicate'>Send an emergency message to \[UNKNOWN\]</A> \]"
|
||||
dat += "<BR>\[ <A HREF='?src=\ref[src];RestoreBackup'>Restore Backup Routing Data</A> \]"
|
||||
|
||||
dat += "<BR>\[ <A HREF='?src=\ref[src];changeseclevel'>Change alert level</A> \]"
|
||||
if(emergency_shuttle.location())
|
||||
if (emergency_shuttle.online())
|
||||
dat += "<BR>\[ <A HREF='?src=\ref[src];cancelshuttle'>Cancel Shuttle Call</A> \]"
|
||||
else
|
||||
dat += "<BR>\[ <A HREF='?src=\ref[src];callshuttle'>Call Emergency Shuttle</A> \]"
|
||||
|
||||
dat += "<BR>\[ <A HREF='?src=\ref[src];status'>Set Status Display</A> \]"
|
||||
aicurrmsg = 0
|
||||
currmsg = 0
|
||||
state = STATE_MESSAGELIST
|
||||
else
|
||||
dat += "<BR>\[ <A HREF='?src=\ref[src];login'>Log In</A> \]"
|
||||
dat += "<BR>\[ <A HREF='?src=\ref[src];messagelist'>Message List</A> \]"
|
||||
return dat
|
||||
state = STATE_VIEWMESSAGE
|
||||
|
||||
proc/confirm_menu(var/prompt,var/yes_option)
|
||||
return "Are you sure you want to [prompt]? \[ [topic_link(src,yes_option,"OK")] | [topic_link(src,"main","Cancel")] \]"
|
||||
if("status" in href_list)
|
||||
state = STATE_STATUSDISPLAY
|
||||
|
||||
interact()
|
||||
if(!interactable())
|
||||
return
|
||||
if(!computer.radio)
|
||||
computer.Crash(MISSING_PERIPHERAL)
|
||||
return
|
||||
|
||||
var/dat = ""
|
||||
switch(state)
|
||||
if(STATE_DEFAULT)
|
||||
dat = main_menu()
|
||||
if(STATE_CALLSHUTTLE)
|
||||
dat = confirm_menu("call the shuttle","callshuttle2")
|
||||
if(STATE_CANCELSHUTTLE)
|
||||
dat = confirm_menu("cancel the shuttle","cancelshuttle2")
|
||||
if(STATE_MESSAGELIST)
|
||||
dat += "Messages:"
|
||||
for(var/i = 1; i<=messagetitle.len; i++)
|
||||
dat += "<BR><A HREF='?src=\ref[src];viewmessage;message-num=[i]'>[messagetitle[i]]</A>"
|
||||
if(STATE_VIEWMESSAGE)
|
||||
if (currmsg)
|
||||
dat += "<B>[messagetitle[currmsg]]</B><BR><BR>[messagetext[currmsg]]"
|
||||
if (authenticated)
|
||||
dat += "<BR><BR>\[ <A HREF='?src=\ref[src];delmessage'>Delete \]"
|
||||
else
|
||||
state = STATE_MESSAGELIST
|
||||
interact()
|
||||
return
|
||||
if(STATE_DELMESSAGE)
|
||||
if (currmsg)
|
||||
dat += "Are you sure you want to delete this message? \[ <A HREF='?src=\ref[src];delmessage2'>OK</A> | <A HREF='?src=\ref[src];viewmessage'>Cancel</A> \]"
|
||||
else
|
||||
state = STATE_MESSAGELIST
|
||||
interact()
|
||||
return
|
||||
if(STATE_STATUSDISPLAY)
|
||||
dat += "\[ <A HREF='?src=\ref[src];main'>Back</A> \]<BR>"
|
||||
dat += "Set Status Displays<BR>"
|
||||
dat += "\[ <A HREF='?src=\ref[src];setstat;statdisp=blank'>Clear</A> \]<BR>"
|
||||
dat += "\[ <A HREF='?src=\ref[src];setstat;statdisp=time'>Station Time</A> \]"
|
||||
dat += "\[ <A HREF='?src=\ref[src];setstat;statdisp=shuttle'>Shuttle ETA</A> \]<BR>"
|
||||
dat += "\[ <A HREF='?src=\ref[src];setstat;statdisp=message'>Message</A> \]"
|
||||
dat += "<ul><li> Line 1: <A HREF='?src=\ref[src];setmsg1'>[ stat_msg1 ? stat_msg1 : "(none)"]</A>"
|
||||
dat += "<li> Line 2: <A HREF='?src=\ref[src];setmsg2'>[ stat_msg2 ? stat_msg2 : "(none)"]</A></ul><br>"
|
||||
dat += "\[ Alert: <A HREF='?src=\ref[src];setstat;statdisp=alert;alert=default'>None</A> |"
|
||||
dat += " <A HREF='?src=\ref[src];setstat;statdisp=alert;alert=redalert'>Red Alert</A> |"
|
||||
dat += " <A HREF='?src=\ref[src];setstat;statdisp=alert;alert=lockdown'>Lockdown</A> |"
|
||||
dat += " <A HREF='?src=\ref[src];setstat;statdisp=alert;alert=biohazard'>Biohazard</A> \]<BR><HR>"
|
||||
if(STATE_ALERT_LEVEL)
|
||||
dat += "Current alert level: [get_security_level()]<BR>"
|
||||
if(security_level == SEC_LEVEL_DELTA)
|
||||
dat += "<font color='red'><b>The self-destruct mechanism is active. Find a way to deactivate the mechanism to lower the alert level or evacuate.</b></font>"
|
||||
else
|
||||
dat += "<A HREF='?src=\ref[src];securitylevel;newalertlevel=[SEC_LEVEL_BLUE]'>Blue</A><BR>"
|
||||
dat += "<A HREF='?src=\ref[src];securitylevel;newalertlevel=[SEC_LEVEL_GREEN]'>Green</A>"
|
||||
if(STATE_CONFIRM_LEVEL)
|
||||
dat += "Current alert level: [get_security_level()]<BR>"
|
||||
dat += "Confirm the change to: [num2seclevel(tmp_alertlevel)]<BR>"
|
||||
dat += "<A HREF='?src=\ref[src];swipeidseclevel'>Swipe ID</A> to confirm change.<BR>"
|
||||
|
||||
popup.set_content(dat)
|
||||
popup.open()
|
||||
|
||||
|
||||
proc/post_status(var/command, var/data1, var/data2)
|
||||
var/datum/radio_frequency/frequency = radio_controller.return_frequency(1435)
|
||||
|
||||
if(!frequency) return
|
||||
|
||||
var/datum/signal/status_signal = new
|
||||
status_signal.source = src
|
||||
status_signal.transmission_method = 1
|
||||
status_signal.data["command"] = command
|
||||
|
||||
switch(command)
|
||||
// Status display stuff
|
||||
if("setstat" in href_list)
|
||||
switch(href_list["statdisp"])
|
||||
if("message")
|
||||
status_signal.data["msg1"] = data1
|
||||
status_signal.data["msg2"] = data2
|
||||
post_status("message", stat_msg1, stat_msg2)
|
||||
if("alert")
|
||||
status_signal.data["picture_state"] = data1
|
||||
post_status("alert", href_list["alert"])
|
||||
else
|
||||
post_status(href_list["statdisp"])
|
||||
|
||||
frequency.post_signal(src, status_signal)
|
||||
if("setmsg1" in href_list)
|
||||
stat_msg1 = reject_bad_text(sanitize(input("Line 1", "Enter Message Text", stat_msg1) as text|null, 40), 40)
|
||||
computer.updateDialog()
|
||||
|
||||
if("setmsg2" in href_list)
|
||||
stat_msg2 = reject_bad_text(sanitize(input("Line 2", "Enter Message Text", stat_msg2) as text|null, 40), 40)
|
||||
computer.updateDialog()
|
||||
|
||||
// OMG CENTCOM LETTERHEAD
|
||||
if("MessageCentCom" in href_list)
|
||||
if(!computer.radio.subspace)
|
||||
return
|
||||
if(authenticated==2)
|
||||
if(centcomm_message_cooldown)
|
||||
to_chat(usr, "Arrays recycling. Please stand by.")
|
||||
return
|
||||
var/input = sanitize(input("Please choose a message to transmit to [using_map.boss_short] via quantum entanglement. Please be aware that this process is very expensive, and abuse will lead to... termination. Transmission does not guarantee a response.", "To abort, send an empty message.", ""))
|
||||
if(!input || !interactable())
|
||||
return
|
||||
CentCom_announce(input, usr)
|
||||
to_chat(usr, "Message transmitted.")
|
||||
log_game("[key_name(usr)] has made a [using_map.boss_short] announcement: [input]")
|
||||
centcomm_message_cooldown = 1
|
||||
spawn(600)//10 minute cooldown
|
||||
centcomm_message_cooldown = 0
|
||||
|
||||
// OMG SYNDICATE ...LETTERHEAD
|
||||
if("MessageSyndicate" in href_list)
|
||||
if((authenticated==2) && (computer.emagged))
|
||||
if(centcomm_message_cooldown)
|
||||
to_chat(usr, "Arrays recycling. Please stand by.")
|
||||
return
|
||||
var/input = sanitize(input(usr, "Please choose a message to transmit to \[ABNORMAL ROUTING CORDINATES\] via quantum entanglement. Please be aware that this process is very expensive, and abuse will lead to... termination. Transmission does not guarantee a response.", "To abort, send an empty message.", ""))
|
||||
if(!input || !interactable())
|
||||
return
|
||||
Syndicate_announce(input, usr)
|
||||
to_chat(usr, "Message transmitted.")
|
||||
log_game("[key_name(usr)] has made an illegal announcement: [input]")
|
||||
centcomm_message_cooldown = 1
|
||||
spawn(600)//10 minute cooldown
|
||||
centcomm_message_cooldown = 0
|
||||
|
||||
if("RestoreBackup" in href_list)
|
||||
to_chat(usr, "Backup routing data restored!")
|
||||
computer.emagged = 0
|
||||
computer.updateDialog()
|
||||
|
||||
|
||||
// AI interface
|
||||
if("ai-main" in href_list)
|
||||
aicurrmsg = 0
|
||||
aistate = STATE_DEFAULT
|
||||
|
||||
if("ai-callshuttle" in href_list)
|
||||
aistate = STATE_CALLSHUTTLE
|
||||
|
||||
if("ai-callshuttle2" in href_list)
|
||||
if(!computer.radio.subspace)
|
||||
return
|
||||
call_shuttle_proc(usr)
|
||||
aistate = STATE_DEFAULT
|
||||
|
||||
if("ai-messagelist" in href_list)
|
||||
aicurrmsg = 0
|
||||
aistate = STATE_MESSAGELIST
|
||||
|
||||
if("ai-viewmessage" in href_list)
|
||||
aistate = STATE_VIEWMESSAGE
|
||||
if (!aicurrmsg)
|
||||
if(href_list["message-num"])
|
||||
aicurrmsg = text2num(href_list["message-num"])
|
||||
else
|
||||
aistate = STATE_MESSAGELIST
|
||||
|
||||
if("ai-delmessage" in href_list)
|
||||
aistate = (aicurrmsg) ? STATE_DELMESSAGE : STATE_MESSAGELIST
|
||||
|
||||
if("ai-delmessage2" in href_list)
|
||||
if(aicurrmsg)
|
||||
var/title = messagetitle[aicurrmsg]
|
||||
var/text = messagetext[aicurrmsg]
|
||||
messagetitle.Remove(title)
|
||||
messagetext.Remove(text)
|
||||
if(currmsg == aicurrmsg)
|
||||
currmsg = 0
|
||||
aicurrmsg = 0
|
||||
aistate = STATE_MESSAGELIST
|
||||
|
||||
if("ai-status" in href_list)
|
||||
aistate = STATE_STATUSDISPLAY
|
||||
|
||||
if("securitylevel" in href_list)
|
||||
tmp_alertlevel = text2num( href_list["newalertlevel"] )
|
||||
if(!tmp_alertlevel) tmp_alertlevel = 0
|
||||
state = STATE_CONFIRM_LEVEL
|
||||
|
||||
if("changeseclevel" in href_list)
|
||||
state = STATE_ALERT_LEVEL
|
||||
|
||||
computer.updateUsrDialog()
|
||||
|
||||
|
||||
|
||||
/datum/file/program/communications/proc/main_menu()
|
||||
var/dat = ""
|
||||
if (computer.radio.subspace)
|
||||
if(emergency_shuttle.online() && emergency_shuttle.location())
|
||||
var/timeleft = emergency_shuttle.estimate_arrival_time()
|
||||
dat += "<B>Emergency shuttle</B>\n<BR>\nETA: [timeleft / 60 % 60]:[add_zero(num2text(timeleft % 60), 2)]<BR>"
|
||||
refresh = 1
|
||||
else
|
||||
refresh = 0
|
||||
if (authenticated)
|
||||
dat += "<BR>\[ <A HREF='?src=\ref[src];logout'>Log Out</A> \]"
|
||||
if (authenticated==2)
|
||||
dat += "<BR>\[ <A HREF='?src=\ref[src];announce'>Make An Announcement</A> \]"
|
||||
if(computer.emagged == 0)
|
||||
dat += "<BR>\[ <A HREF='?src=\ref[src];MessageCentCom'>Send an emergency message to [using_map.boss_short]</A> \]"
|
||||
else
|
||||
dat += "<BR>\[ <A HREF='?src=\ref[src];MessageSyndicate'>Send an emergency message to \[UNKNOWN\]</A> \]"
|
||||
dat += "<BR>\[ <A HREF='?src=\ref[src];RestoreBackup'>Restore Backup Routing Data</A> \]"
|
||||
|
||||
dat += "<BR>\[ <A HREF='?src=\ref[src];changeseclevel'>Change alert level</A> \]"
|
||||
if(emergency_shuttle.location())
|
||||
if (emergency_shuttle.online())
|
||||
dat += "<BR>\[ <A HREF='?src=\ref[src];cancelshuttle'>Cancel Shuttle Call</A> \]"
|
||||
else
|
||||
dat += "<BR>\[ <A HREF='?src=\ref[src];callshuttle'>Call Emergency Shuttle</A> \]"
|
||||
|
||||
dat += "<BR>\[ <A HREF='?src=\ref[src];status'>Set Status Display</A> \]"
|
||||
else
|
||||
dat += "<BR>\[ <A HREF='?src=\ref[src];login'>Log In</A> \]"
|
||||
dat += "<BR>\[ <A HREF='?src=\ref[src];messagelist'>Message List</A> \]"
|
||||
return dat
|
||||
|
||||
/datum/file/program/communications/proc/confirm_menu(var/prompt,var/yes_option)
|
||||
return "Are you sure you want to [prompt]? \[ [topic_link(src,yes_option,"OK")] | [topic_link(src,"main","Cancel")] \]"
|
||||
|
||||
/datum/file/program/communications/interact()
|
||||
if(!interactable())
|
||||
return
|
||||
if(!computer.radio)
|
||||
computer.Crash(MISSING_PERIPHERAL)
|
||||
return
|
||||
|
||||
var/dat = ""
|
||||
switch(state)
|
||||
if(STATE_DEFAULT)
|
||||
dat = main_menu()
|
||||
if(STATE_CALLSHUTTLE)
|
||||
dat = confirm_menu("call the shuttle","callshuttle2")
|
||||
if(STATE_CANCELSHUTTLE)
|
||||
dat = confirm_menu("cancel the shuttle","cancelshuttle2")
|
||||
if(STATE_MESSAGELIST)
|
||||
dat += "Messages:"
|
||||
for(var/i = 1; i<=messagetitle.len; i++)
|
||||
dat += "<BR><A HREF='?src=\ref[src];viewmessage;message-num=[i]'>[messagetitle[i]]</A>"
|
||||
if(STATE_VIEWMESSAGE)
|
||||
if (currmsg)
|
||||
dat += "<B>[messagetitle[currmsg]]</B><BR><BR>[messagetext[currmsg]]"
|
||||
if (authenticated)
|
||||
dat += "<BR><BR>\[ <A HREF='?src=\ref[src];delmessage'>Delete \]"
|
||||
else
|
||||
state = STATE_MESSAGELIST
|
||||
interact()
|
||||
return
|
||||
if(STATE_DELMESSAGE)
|
||||
if (currmsg)
|
||||
dat += "Are you sure you want to delete this message? \[ <A HREF='?src=\ref[src];delmessage2'>OK</A> | <A HREF='?src=\ref[src];viewmessage'>Cancel</A> \]"
|
||||
else
|
||||
state = STATE_MESSAGELIST
|
||||
interact()
|
||||
return
|
||||
if(STATE_STATUSDISPLAY)
|
||||
dat += "\[ <A HREF='?src=\ref[src];main'>Back</A> \]<BR>"
|
||||
dat += "Set Status Displays<BR>"
|
||||
dat += "\[ <A HREF='?src=\ref[src];setstat;statdisp=blank'>Clear</A> \]<BR>"
|
||||
dat += "\[ <A HREF='?src=\ref[src];setstat;statdisp=time'>Station Time</A> \]"
|
||||
dat += "\[ <A HREF='?src=\ref[src];setstat;statdisp=shuttle'>Shuttle ETA</A> \]<BR>"
|
||||
dat += "\[ <A HREF='?src=\ref[src];setstat;statdisp=message'>Message</A> \]"
|
||||
dat += "<ul><li> Line 1: <A HREF='?src=\ref[src];setmsg1'>[ stat_msg1 ? stat_msg1 : "(none)"]</A>"
|
||||
dat += "<li> Line 2: <A HREF='?src=\ref[src];setmsg2'>[ stat_msg2 ? stat_msg2 : "(none)"]</A></ul><br>"
|
||||
dat += "\[ Alert: <A HREF='?src=\ref[src];setstat;statdisp=alert;alert=default'>None</A> |"
|
||||
dat += " <A HREF='?src=\ref[src];setstat;statdisp=alert;alert=redalert'>Red Alert</A> |"
|
||||
dat += " <A HREF='?src=\ref[src];setstat;statdisp=alert;alert=lockdown'>Lockdown</A> |"
|
||||
dat += " <A HREF='?src=\ref[src];setstat;statdisp=alert;alert=biohazard'>Biohazard</A> \]<BR><HR>"
|
||||
if(STATE_ALERT_LEVEL)
|
||||
dat += "Current alert level: [get_security_level()]<BR>"
|
||||
if(security_level == SEC_LEVEL_DELTA)
|
||||
dat += "<font color='red'><b>The self-destruct mechanism is active. Find a way to deactivate the mechanism to lower the alert level or evacuate.</b></font>"
|
||||
else
|
||||
dat += "<A HREF='?src=\ref[src];securitylevel;newalertlevel=[SEC_LEVEL_BLUE]'>Blue</A><BR>"
|
||||
dat += "<A HREF='?src=\ref[src];securitylevel;newalertlevel=[SEC_LEVEL_GREEN]'>Green</A>"
|
||||
if(STATE_CONFIRM_LEVEL)
|
||||
dat += "Current alert level: [get_security_level()]<BR>"
|
||||
dat += "Confirm the change to: [num2seclevel(tmp_alertlevel)]<BR>"
|
||||
dat += "<A HREF='?src=\ref[src];swipeidseclevel'>Swipe ID</A> to confirm change.<BR>"
|
||||
|
||||
popup.set_content(dat)
|
||||
popup.open()
|
||||
|
||||
|
||||
/datum/file/program/communications/proc/post_status(var/command, var/data1, var/data2)
|
||||
var/datum/radio_frequency/frequency = radio_controller.return_frequency(1435)
|
||||
|
||||
if(!frequency)
|
||||
return
|
||||
|
||||
var/datum/signal/status_signal = new
|
||||
status_signal.source = src
|
||||
status_signal.transmission_method = 1
|
||||
status_signal.data["command"] = command
|
||||
|
||||
switch(command)
|
||||
if("message")
|
||||
status_signal.data["msg1"] = data1
|
||||
status_signal.data["msg2"] = data2
|
||||
if("alert")
|
||||
status_signal.data["picture_state"] = data1
|
||||
|
||||
frequency.post_signal(src, status_signal)
|
||||
|
||||
@@ -9,67 +9,68 @@
|
||||
active_state = "crew"
|
||||
var/list/tracked = list( )
|
||||
|
||||
interact(mob/user)
|
||||
if(!interactable())
|
||||
return
|
||||
/datum/file/program/crew/interact(mob/user)
|
||||
if(!interactable())
|
||||
return
|
||||
|
||||
scan()
|
||||
var/t = "<TT><B>Crew Monitoring</B><HR>"
|
||||
t += "<BR><A href='?src=\ref[src];update=1'>Refresh</A> "
|
||||
t += "<A href='?src=\ref[src];close=1'>Close</A><BR>"
|
||||
t += "<table><tr><td width='40%'>Name</td><td width='20%'>Vitals</td><td width='40%'>Position</td></tr>"
|
||||
var/list/logs = list()
|
||||
for(var/obj/item/clothing/under/C in src.tracked)
|
||||
var/log = ""
|
||||
var/turf/pos = get_turf(C)
|
||||
if((C) && (C.has_sensor) && (pos) && (pos.z == computer.z) && C.sensor_mode)
|
||||
if(istype(C.loc, /mob/living/carbon/human))
|
||||
scan()
|
||||
var/t = "<TT><B>Crew Monitoring</B><HR>"
|
||||
t += "<BR><A href='?src=\ref[src];update=1'>Refresh</A> "
|
||||
t += "<A href='?src=\ref[src];close=1'>Close</A><BR>"
|
||||
t += "<table><tr><td width='40%'>Name</td><td width='20%'>Vitals</td><td width='40%'>Position</td></tr>"
|
||||
var/list/logs = list()
|
||||
for(var/obj/item/clothing/under/C in src.tracked)
|
||||
var/log = ""
|
||||
var/turf/pos = get_turf(C)
|
||||
if((C) && (C.has_sensor) && (pos) && (pos.z == computer.z) && C.sensor_mode)
|
||||
if(istype(C.loc, /mob/living/carbon/human))
|
||||
var/mob/living/carbon/human/H = C.loc
|
||||
|
||||
var/mob/living/carbon/human/H = C.loc
|
||||
var/dam1 = round(H.getOxyLoss(),1)
|
||||
var/dam2 = round(H.getToxLoss(),1)
|
||||
var/dam3 = round(H.getFireLoss(),1)
|
||||
var/dam4 = round(H.getBruteLoss(),1)
|
||||
|
||||
var/dam1 = round(H.getOxyLoss(),1)
|
||||
var/dam2 = round(H.getToxLoss(),1)
|
||||
var/dam3 = round(H.getFireLoss(),1)
|
||||
var/dam4 = round(H.getBruteLoss(),1)
|
||||
var/life_status = "[H.stat > 1 ? "<font color=red>Deceased</font>" : "Living"]"
|
||||
var/damage_report = "(<font color='blue'>[dam1]</font>/<font color='green'>[dam2]</font>/<font color='orange'>[dam3]</font>/<font color='red'>[dam4]</font>)"
|
||||
|
||||
var/life_status = "[H.stat > 1 ? "<font color=red>Deceased</font>" : "Living"]"
|
||||
var/damage_report = "(<font color='blue'>[dam1]</font>/<font color='green'>[dam2]</font>/<font color='orange'>[dam3]</font>/<font color='red'>[dam4]</font>)"
|
||||
log += "<tr><td width='40%'>[H.get_authentification_name()] ([H.get_assignment()])</td>"
|
||||
|
||||
log += "<tr><td width='40%'>[H.get_authentification_name()] ([H.get_assignment()])</td>"
|
||||
switch(C.sensor_mode)
|
||||
if(1)
|
||||
log += "<td width='15%'>[life_status]</td><td width='40%'>Not Available</td></tr>"
|
||||
if(2)
|
||||
log += "<td width='20%'>[life_status] [damage_report]</td><td width='40%'>Not Available</td></tr>"
|
||||
if(3)
|
||||
var/area/player_area = get_area(H)
|
||||
log += "<td width='20%'>[life_status] [damage_report]</td><td width='40%'>[sanitize(player_area.name)] ([pos.x], [pos.y])</td></tr>"
|
||||
logs += log
|
||||
logs = sortList(logs)
|
||||
for(var/log in logs)
|
||||
t += log
|
||||
t += "</table>"
|
||||
t += "</TT>"
|
||||
|
||||
switch(C.sensor_mode)
|
||||
if(1)
|
||||
log += "<td width='15%'>[life_status]</td><td width='40%'>Not Available</td></tr>"
|
||||
if(2)
|
||||
log += "<td width='20%'>[life_status] [damage_report]</td><td width='40%'>Not Available</td></tr>"
|
||||
if(3)
|
||||
var/area/player_area = get_area(H)
|
||||
log += "<td width='20%'>[life_status] [damage_report]</td><td width='40%'>[sanitize(player_area.name)] ([pos.x], [pos.y])</td></tr>"
|
||||
logs += log
|
||||
logs = sortList(logs)
|
||||
for(var/log in logs)
|
||||
t += log
|
||||
t += "</table>"
|
||||
t += "</TT>"
|
||||
|
||||
popup.set_content(t)
|
||||
popup.open()
|
||||
popup.set_content(t)
|
||||
popup.open()
|
||||
|
||||
|
||||
proc/scan()
|
||||
for(var/obj/item/clothing/under/C in world)
|
||||
if((C.has_sensor) && (istype(C.loc, /mob/living/carbon/human)))
|
||||
tracked |= C
|
||||
return 1
|
||||
/datum/file/program/crew/proc/scan()
|
||||
for(var/obj/item/clothing/under/C in all_clothing)
|
||||
if((C.has_sensor) && (istype(C.loc, /mob/living/carbon/human)))
|
||||
tracked |= C
|
||||
return 1
|
||||
|
||||
Topic(href, list/href_list)
|
||||
if(!interactable() || !computer.cardslot || ..(href,href_list))
|
||||
return
|
||||
if( href_list["close"] )
|
||||
usr << browse(null, "window=crewcomp")
|
||||
usr.unset_machine()
|
||||
return
|
||||
if(href_list["update"])
|
||||
interact()
|
||||
//src.updateUsrDialog()
|
||||
return
|
||||
/datum/file/program/crew/Topic(href, list/href_list)
|
||||
if(!interactable() || !computer.cardslot || ..(href,href_list))
|
||||
return
|
||||
|
||||
if( href_list["close"] )
|
||||
usr << browse(null, "window=crewcomp")
|
||||
usr.unset_machine()
|
||||
return
|
||||
|
||||
if(href_list["update"])
|
||||
interact()
|
||||
//src.updateUsrDialog()
|
||||
return
|
||||
|
||||
@@ -9,46 +9,46 @@
|
||||
var/opened = 0
|
||||
|
||||
|
||||
verb/AccessInternals()
|
||||
set category = "Object"
|
||||
set name = "Access Computer's Internals"
|
||||
set src in oview(1)
|
||||
if(!Adjacent(usr) || usr.restrained() || usr.lying || usr.stat || istype(usr, /mob/living/silicon) || !istype(usr, /mob/living))
|
||||
return
|
||||
|
||||
opened = !opened
|
||||
if(opened)
|
||||
usr << "<span class='notice'>The access panel is now open.</span>"
|
||||
else
|
||||
usr << "<span class='notice'>The access panel is now closed.</span>"
|
||||
/obj/machinery/computer3/aiupload/verb/AccessInternals()
|
||||
set category = "Object"
|
||||
set name = "Access Computer's Internals"
|
||||
set src in oview(1)
|
||||
if(!Adjacent(usr) || usr.restrained() || usr.lying || usr.stat || istype(usr, /mob/living/silicon) || !istype(usr, /mob/living))
|
||||
return
|
||||
|
||||
|
||||
attackby(obj/item/weapon/aiModule/module as obj, mob/user as mob)
|
||||
if (user.z > 6)
|
||||
user << "<span class='danger'>Unable to establish a connection:</span> You're too far away from the station!"
|
||||
return
|
||||
if(istype(module, /obj/item/weapon/aiModule))
|
||||
module.install(src)
|
||||
else
|
||||
return ..()
|
||||
opened = !opened
|
||||
if(opened)
|
||||
to_chat(usr, "<span class='notice'>The access panel is now open.</span>")
|
||||
else
|
||||
to_chat(usr, "<span class='notice'>The access panel is now closed.</span>")
|
||||
return
|
||||
|
||||
|
||||
attack_hand(var/mob/user as mob)
|
||||
if(src.stat & NOPOWER)
|
||||
usr << "The upload computer has no power!"
|
||||
return
|
||||
if(src.stat & BROKEN)
|
||||
usr << "The upload computer is broken!"
|
||||
return
|
||||
|
||||
src.current = select_active_ai(user)
|
||||
|
||||
if (!src.current)
|
||||
usr << "No active AIs detected."
|
||||
else
|
||||
usr << "[src.current.name] selected for law changes."
|
||||
/obj/machinery/computer3/aiupload/attackby(obj/item/weapon/aiModule/module as obj, mob/user as mob)
|
||||
if (user.z > 6)
|
||||
to_chat(user, "<span class='danger'>Unable to establish a connection:</span> You're too far away from the station!")
|
||||
return
|
||||
if(istype(module, /obj/item/weapon/aiModule))
|
||||
module.install(src, user)
|
||||
else
|
||||
return ..()
|
||||
|
||||
|
||||
/obj/machinery/computer3/aiupload/attack_hand(var/mob/user as mob)
|
||||
if(src.stat & NOPOWER)
|
||||
to_chat(user, "The upload computer has no power!")
|
||||
return
|
||||
if(src.stat & BROKEN)
|
||||
to_chat(user, "The upload computer is broken!")
|
||||
return
|
||||
|
||||
src.current = select_active_ai(user)
|
||||
|
||||
if (!src.current)
|
||||
to_chat(user, "No active AIs detected.")
|
||||
else
|
||||
to_chat(user, "[src.current.name] selected for law changes.")
|
||||
return
|
||||
|
||||
|
||||
|
||||
@@ -60,25 +60,25 @@
|
||||
var/mob/living/silicon/robot/current = null
|
||||
|
||||
|
||||
attackby(obj/item/weapon/aiModule/module as obj, mob/user as mob)
|
||||
if(istype(module, /obj/item/weapon/aiModule))
|
||||
module.install(src)
|
||||
else
|
||||
return ..()
|
||||
/obj/machinery/computer3/borgupload/attackby(obj/item/weapon/aiModule/module as obj, mob/user as mob)
|
||||
if(istype(module, /obj/item/weapon/aiModule))
|
||||
module.install(src, user)
|
||||
else
|
||||
return ..()
|
||||
|
||||
|
||||
attack_hand(var/mob/user as mob)
|
||||
if(src.stat & NOPOWER)
|
||||
usr << "The upload computer has no power!"
|
||||
return
|
||||
if(src.stat & BROKEN)
|
||||
usr << "The upload computer is broken!"
|
||||
return
|
||||
|
||||
src.current = freeborg()
|
||||
|
||||
if (!src.current)
|
||||
usr << "No free cyborgs detected."
|
||||
else
|
||||
usr << "[src.current.name] selected for law changes."
|
||||
/obj/machinery/computer3/borgupload/attack_hand(var/mob/user as mob)
|
||||
if(src.stat & NOPOWER)
|
||||
to_chat(user, "The upload computer has no power!")
|
||||
return
|
||||
if(src.stat & BROKEN)
|
||||
to_chat(user, "The upload computer is broken!")
|
||||
return
|
||||
|
||||
src.current = freeborg()
|
||||
|
||||
if (!src.current)
|
||||
to_chat(user, "No free cyborgs detected.")
|
||||
else
|
||||
to_chat(user, "[src.current.name] selected for law changes.")
|
||||
return
|
||||
|
||||
@@ -34,490 +34,479 @@
|
||||
var/printing = null
|
||||
|
||||
|
||||
proc/authenticate()
|
||||
if(access_medical in scan.access)
|
||||
return 1
|
||||
if(istype(usr,/mob/living/silicon/ai))
|
||||
return 1
|
||||
return 0
|
||||
/datum/file/program/med_data/proc/authenticate()
|
||||
if(isAI(usr) || access_medical in scan.access)
|
||||
return 1
|
||||
return 0
|
||||
|
||||
interact()
|
||||
if(!computer.cardslot)
|
||||
computer.Crash(MISSING_PERIPHERAL)
|
||||
return
|
||||
usr.set_machine(src)
|
||||
scan = computer.cardslot.reader
|
||||
if(!interactable())
|
||||
return
|
||||
if (computer.z > 6)
|
||||
usr << "<span class='danger'>Unable to establish a connection:</span> You're too far away from the station!"
|
||||
return
|
||||
var/dat
|
||||
|
||||
if (temp)
|
||||
dat = text("<TT>[src.temp]</TT><BR><BR><A href='?src=\ref[src];temp=1'>Clear Screen</A>")
|
||||
else
|
||||
dat = text("Confirm Identity (R): <A href='?src=\ref[];cardr=1'>[]</A><HR>", src, (scan ? text("[]", scan.name) : "----------"))
|
||||
if (computer.cardslot.dualslot)
|
||||
dat += text("Check Identity (W): <A href='?src=\ref[];cardw=1'>[]</A><BR>", src, (scan2 ? text("[]", scan2.name) : "----------"))
|
||||
if(scan2 && !scan)
|
||||
dat += text("<div class='notice'>Insert card into reader slot to log in.</div><br>")
|
||||
|
||||
if (src.authenticated)
|
||||
switch(src.screen)
|
||||
if(1.0)
|
||||
dat += {"
|
||||
<A href='?src=\ref[src];search=1'>Search Records</A>
|
||||
<BR><A href='?src=\ref[src];screen=2'>List Records</A>
|
||||
<BR>
|
||||
<BR><A href='?src=\ref[src];screen=5'>Virus Database</A>
|
||||
<BR><A href='?src=\ref[src];screen=6'>Medbot Tracking</A>
|
||||
<BR>
|
||||
<BR><A href='?src=\ref[src];screen=3'>Record Maintenance</A>
|
||||
<BR><A href='?src=\ref[src];logout=1'>{Log Out}</A><BR>
|
||||
"}
|
||||
if(2.0)
|
||||
dat += "<B>Record List</B>:<HR>"
|
||||
if(!isnull(data_core.general))
|
||||
for(var/datum/data/record/R in sortRecord(data_core.general))
|
||||
dat += text("<A href='?src=\ref[];d_rec=\ref[]'>[]: []<BR>", src, R, R.fields["id"], R.fields["name"])
|
||||
//Foreach goto(132)
|
||||
dat += text("<HR><A href='?src=\ref[];screen=1'>Back</A>", src)
|
||||
if(3.0)
|
||||
dat += text("<B>Records Maintenance</B><HR>\n<A href='?src=\ref[];back=1'>Backup To Disk</A><BR>\n<A href='?src=\ref[];u_load=1'>Upload From disk</A><BR>\n<A href='?src=\ref[];del_all=1'>Delete All Records</A><BR>\n<BR>\n<A href='?src=\ref[];screen=1'>Back</A>", src, src, src, src)
|
||||
if(4.0)
|
||||
dat += "<CENTER><B>Medical Record</B></CENTER><BR>"
|
||||
if ((istype(src.active1, /datum/data/record) && data_core.general.Find(src.active1)))
|
||||
var/icon/front = active1.fields["photo_front"]
|
||||
var/icon/side = active1.fields["photo_side"]
|
||||
usr << browse_rsc(front, "front.png")
|
||||
usr << browse_rsc(side, "side.png")
|
||||
|
||||
dat += "<table><tr><td>Name: [active1.fields["name"]] \
|
||||
ID: [active1.fields["id"]]<BR>\n \
|
||||
Entity Classification: <A href='?src=\ref[src];field=brain_type'>[active1.fields["brain_type"]]</A><BR>\n \
|
||||
Sex: <A href='?src=\ref[src];field=sex'>[active1.fields["sex"]]</A><BR>\n \
|
||||
Age: <A href='?src=\ref[src];field=age'>[active1.fields["age"]]</A><BR>\n \
|
||||
Fingerprint: <A href='?src=\ref[src];field=fingerprint'>[active1.fields["fingerprint"]]</A><BR>\n \
|
||||
Physical Status: <A href='?src=\ref[src];field=p_stat'>[active1.fields["p_stat"]]</A><BR>\n \
|
||||
Mental Status: <A href='?src=\ref[src];field=m_stat'>[active1.fields["m_stat"]]</A><BR></td><td align = center valign = top> \
|
||||
Photo:<br><img src=front.png height=64 width=64 border=5><img src=side.png height=64 width=64 border=5></td></tr></table>"
|
||||
else
|
||||
dat += "<B>General Record Lost!</B><BR>"
|
||||
if ((istype(src.active2, /datum/data/record) && data_core.medical.Find(src.active2)))
|
||||
dat += text("<BR>\n<CENTER><B>Medical Data</B></CENTER><BR>\nBlood Type: <A href='?src=\ref[];field=b_type'>[]</A><BR>\nDNA: <A href='?src=\ref[];field=b_dna'>[]</A><BR>\n<BR>\nMinor Disabilities: <A href='?src=\ref[];field=mi_dis'>[]</A><BR>\nDetails: <A href='?src=\ref[];field=mi_dis_d'>[]</A><BR>\n<BR>\nMajor Disabilities: <A href='?src=\ref[];field=ma_dis'>[]</A><BR>\nDetails: <A href='?src=\ref[];field=ma_dis_d'>[]</A><BR>\n<BR>\nAllergies: <A href='?src=\ref[];field=alg'>[]</A><BR>\nDetails: <A href='?src=\ref[];field=alg_d'>[]</A><BR>\n<BR>\nCurrent Diseases: <A href='?src=\ref[];field=cdi'>[]</A> (per disease info placed in log/comment section)<BR>\nDetails: <A href='?src=\ref[];field=cdi_d'>[]</A><BR>\n<BR>\nImportant Notes:<BR>\n\t<A href='?src=\ref[];field=notes'>[]</A><BR>\n<BR>\n<CENTER><B>Comments/Log</B></CENTER><BR>", src, src.active2.fields["b_type"], src, src.active2.fields["b_dna"], src, src.active2.fields["mi_dis"], src, src.active2.fields["mi_dis_d"], src, src.active2.fields["ma_dis"], src, src.active2.fields["ma_dis_d"], src, src.active2.fields["alg"], src, src.active2.fields["alg_d"], src, src.active2.fields["cdi"], src, src.active2.fields["cdi_d"], src, decode(src.active2.fields["notes"]))
|
||||
var/counter = 1
|
||||
while(src.active2.fields[text("com_[]", counter)])
|
||||
dat += text("[]<BR><A href='?src=\ref[];del_c=[]'>Delete Entry</A><BR><BR>", src.active2.fields[text("com_[]", counter)], src, counter)
|
||||
counter++
|
||||
dat += text("<A href='?src=\ref[];add_c=1'>Add Entry</A><BR><BR>", src)
|
||||
dat += text("<A href='?src=\ref[];del_r=1'>Delete Record (Medical Only)</A><BR><BR>", src)
|
||||
else
|
||||
dat += "<B>Medical Record Lost!</B><BR>"
|
||||
dat += text("<A href='?src=\ref[src];new=1'>New Record</A><BR><BR>")
|
||||
dat += text("\n<A href='?src=\ref[];print_p=1'>Print Record</A><BR>\n<A href='?src=\ref[];screen=2'>Back</A><BR>", src, src)
|
||||
if(5.0)
|
||||
dat += "<CENTER><B>Virus Database</B></CENTER>"
|
||||
for (var/ID in virusDB)
|
||||
var/datum/data/record/v = virusDB[ID]
|
||||
dat += "<br><a href='?src=\ref[src];vir=\ref[v]'>[v.fields["name"]]</a>"
|
||||
|
||||
dat += "<br><a href='?src=\ref[src];screen=1'>Back</a>"
|
||||
if(6.0)
|
||||
dat += "<center><b>Medical Robot Monitor</b></center>"
|
||||
dat += "<a href='?src=\ref[src];screen=1'>Back</a>"
|
||||
dat += "<br><b>Medical Robots:</b>"
|
||||
var/bdat = null
|
||||
for(var/mob/living/bot/medbot/M in world)
|
||||
|
||||
if(M.z != computer.z) continue //only find medibots on the same z-level as the computer
|
||||
var/turf/bl = get_turf(M)
|
||||
if(bl) //if it can't find a turf for the medibot, then it probably shouldn't be showing up
|
||||
bdat += "[M.name] - <b>\[[bl.x],[bl.y]\]</b> - [M.on ? "Online" : "Offline"]<br>"
|
||||
if((!isnull(M.reagent_glass)) && M.use_beaker)
|
||||
bdat += "Reservoir: \[[M.reagent_glass.reagents.total_volume]/[M.reagent_glass.reagents.maximum_volume]\]<br>"
|
||||
else
|
||||
bdat += "Using Internal Synthesizer.<br>"
|
||||
if(!bdat)
|
||||
dat += "<br><center>None detected</center>"
|
||||
else
|
||||
dat += "<br>[bdat]"
|
||||
|
||||
else
|
||||
else
|
||||
dat += text("<A href='?src=\ref[];login=1'>{Log In}</A>", src)
|
||||
popup.width = 600
|
||||
popup.height = 400
|
||||
popup.set_content(dat)
|
||||
popup.set_title_image(usr.browse_rsc_icon(computer.icon, computer.icon_state))
|
||||
popup.open()
|
||||
/datum/file/program/med_data/interact()
|
||||
if(!computer.cardslot)
|
||||
computer.Crash(MISSING_PERIPHERAL)
|
||||
return
|
||||
usr.set_machine(src)
|
||||
scan = computer.cardslot.reader
|
||||
if(!interactable())
|
||||
return
|
||||
if(computer.z > 6)
|
||||
to_chat(usr, "<span class='danger'>Unable to establish a connection:</span> You're too far away from the station!")
|
||||
return
|
||||
var/dat
|
||||
|
||||
Topic(href, href_list)
|
||||
if(!interactable() || !computer.cardslot || ..(href,href_list))
|
||||
return
|
||||
if (!( data_core.general.Find(src.active1) ))
|
||||
src.active1 = null
|
||||
if (!( data_core.medical.Find(src.active2) ))
|
||||
src.active2 = null
|
||||
|
||||
if (href_list["temp"])
|
||||
src.temp = null
|
||||
|
||||
if (href_list["cardr"])
|
||||
if (scan)
|
||||
if(istype(usr,/mob/living/carbon/human) && !usr.get_active_hand())
|
||||
computer.cardslot.remove(1)
|
||||
else
|
||||
scan.loc = get_turf(src)
|
||||
scan = null
|
||||
else
|
||||
var/obj/item/I = usr.get_active_hand()
|
||||
if (istype(I, /obj/item/weapon/card/id) && usr.drop_item(I))
|
||||
computer.cardslot.insert(I, 1)
|
||||
scan = I
|
||||
|
||||
if (href_list["cardw"])
|
||||
if (scan2)
|
||||
if(istype(usr,/mob/living/carbon/human) && !usr.get_active_hand())
|
||||
computer.cardslot.remove(2)
|
||||
else
|
||||
scan2.loc = get_turf(src)
|
||||
scan2 = null
|
||||
else
|
||||
var/obj/item/I = usr.get_active_hand()
|
||||
if (istype(I, /obj/item/weapon/card/id) && usr.drop_item(I))
|
||||
computer.cardslot.insert(I, 2)
|
||||
scan2 = I
|
||||
|
||||
else if (href_list["logout"])
|
||||
src.authenticated = null
|
||||
src.screen = null
|
||||
src.active1 = null
|
||||
src.active2 = null
|
||||
|
||||
else if (href_list["login"])
|
||||
|
||||
if (istype(usr, /mob/living/silicon/ai))
|
||||
src.active1 = null
|
||||
src.active2 = null
|
||||
src.authenticated = usr.name
|
||||
src.rank = "AI"
|
||||
src.screen = 1
|
||||
|
||||
else if (istype(usr, /mob/living/silicon/robot))
|
||||
src.active1 = null
|
||||
src.active2 = null
|
||||
src.authenticated = usr.name
|
||||
var/mob/living/silicon/robot/R = usr
|
||||
src.rank = "[R.modtype] [R.braintype]"
|
||||
src.screen = 1
|
||||
|
||||
else if (istype(src.scan, /obj/item/weapon/card/id))
|
||||
src.active1 = null
|
||||
src.active2 = null
|
||||
|
||||
if (src.check_access(src.scan))
|
||||
src.authenticated = src.scan.registered_name
|
||||
src.rank = src.scan.assignment
|
||||
src.screen = 1
|
||||
if (temp)
|
||||
dat = text("<TT>[src.temp]</TT><BR><BR><A href='?src=\ref[src];temp=1'>Clear Screen</A>")
|
||||
else
|
||||
dat = text("Confirm Identity (R): <A href='?src=\ref[];cardr=1'>[]</A><HR>", src, (scan ? text("[]", scan.name) : "----------"))
|
||||
if (istype(computer.cardslot, /obj/item/part/computer/cardslot/dual))
|
||||
dat += text("Check Identity (W): <A href='?src=\ref[];cardw=1'>[]</A><BR>", src, (scan2 ? text("[]", scan2.name) : "----------"))
|
||||
if(scan2 && !scan)
|
||||
dat += text("<div class='notice'>Insert card into reader slot to log in.</div><br>")
|
||||
|
||||
if (src.authenticated)
|
||||
switch(src.screen)
|
||||
if(1.0)
|
||||
dat += {"
|
||||
<A href='?src=\ref[src];search=1'>Search Records</A>
|
||||
<BR><A href='?src=\ref[src];screen=2'>List Records</A>
|
||||
<BR>
|
||||
<BR><A href='?src=\ref[src];screen=5'>Virus Database</A>
|
||||
<BR><A href='?src=\ref[src];screen=6'>Medbot Tracking</A>
|
||||
<BR>
|
||||
<BR><A href='?src=\ref[src];screen=3'>Record Maintenance</A>
|
||||
<BR><A href='?src=\ref[src];logout=1'>{Log Out}</A><BR>
|
||||
"}
|
||||
if(2.0)
|
||||
dat += "<B>Record List</B>:<HR>"
|
||||
if(!isnull(data_core.general))
|
||||
for(var/datum/data/record/R in sortRecord(data_core.general))
|
||||
dat += text("<A href='?src=\ref[];d_rec=\ref[]'>[]: []<BR>", src, R, R.fields["id"], R.fields["name"])
|
||||
//Foreach goto(132)
|
||||
dat += text("<HR><A href='?src=\ref[];screen=1'>Back</A>", src)
|
||||
if(3.0)
|
||||
dat += text("<B>Records Maintenance</B><HR>\n<A href='?src=\ref[];back=1'>Backup To Disk</A><BR>\n<A href='?src=\ref[];u_load=1'>Upload From disk</A><BR>\n<A href='?src=\ref[];del_all=1'>Delete All Records</A><BR>\n<BR>\n<A href='?src=\ref[];screen=1'>Back</A>", src, src, src, src)
|
||||
if(4.0)
|
||||
dat += "<CENTER><B>Medical Record</B></CENTER><BR>"
|
||||
if ((istype(src.active1, /datum/data/record) && data_core.general.Find(src.active1)))
|
||||
var/icon/front = active1.fields["photo_front"]
|
||||
var/icon/side = active1.fields["photo_side"]
|
||||
usr << browse_rsc(front, "front.png")
|
||||
usr << browse_rsc(side, "side.png")
|
||||
|
||||
if(href_list["screen"])
|
||||
src.screen = text2num(href_list["screen"])
|
||||
if(src.screen < 1)
|
||||
src.screen = 1
|
||||
dat += "<table><tr><td>Name: [active1.fields["name"]] \
|
||||
ID: [active1.fields["id"]]<BR>\n \
|
||||
Entity Classification: <A href='?src=\ref[src];field=brain_type'>[active1.fields["brain_type"]]</A><BR>\n \
|
||||
Sex: <A href='?src=\ref[src];field=sex'>[active1.fields["sex"]]</A><BR>\n \
|
||||
Age: <A href='?src=\ref[src];field=age'>[active1.fields["age"]]</A><BR>\n \
|
||||
Fingerprint: <A href='?src=\ref[src];field=fingerprint'>[active1.fields["fingerprint"]]</A><BR>\n \
|
||||
Physical Status: <A href='?src=\ref[src];field=p_stat'>[active1.fields["p_stat"]]</A><BR>\n \
|
||||
Mental Status: <A href='?src=\ref[src];field=m_stat'>[active1.fields["m_stat"]]</A><BR></td><td align = center valign = top> \
|
||||
Photo:<br><img src=front.png height=64 width=64 border=5><img src=side.png height=64 width=64 border=5></td></tr></table>"
|
||||
else
|
||||
dat += "<B>General Record Lost!</B><BR>"
|
||||
if ((istype(src.active2, /datum/data/record) && data_core.medical.Find(src.active2)))
|
||||
dat += text("<BR>\n<CENTER><B>Medical Data</B></CENTER><BR>\nBlood Type: <A href='?src=\ref[];field=b_type'>[]</A><BR>\nDNA: <A href='?src=\ref[];field=b_dna'>[]</A><BR>\n<BR>\nMinor Disabilities: <A href='?src=\ref[];field=mi_dis'>[]</A><BR>\nDetails: <A href='?src=\ref[];field=mi_dis_d'>[]</A><BR>\n<BR>\nMajor Disabilities: <A href='?src=\ref[];field=ma_dis'>[]</A><BR>\nDetails: <A href='?src=\ref[];field=ma_dis_d'>[]</A><BR>\n<BR>\nAllergies: <A href='?src=\ref[];field=alg'>[]</A><BR>\nDetails: <A href='?src=\ref[];field=alg_d'>[]</A><BR>\n<BR>\nCurrent Diseases: <A href='?src=\ref[];field=cdi'>[]</A> (per disease info placed in log/comment section)<BR>\nDetails: <A href='?src=\ref[];field=cdi_d'>[]</A><BR>\n<BR>\nImportant Notes:<BR>\n\t<A href='?src=\ref[];field=notes'>[]</A><BR>\n<BR>\n<CENTER><B>Comments/Log</B></CENTER><BR>", src, src.active2.fields["b_type"], src, src.active2.fields["b_dna"], src, src.active2.fields["mi_dis"], src, src.active2.fields["mi_dis_d"], src, src.active2.fields["ma_dis"], src, src.active2.fields["ma_dis_d"], src, src.active2.fields["alg"], src, src.active2.fields["alg_d"], src, src.active2.fields["cdi"], src, src.active2.fields["cdi_d"], src, decode(src.active2.fields["notes"]))
|
||||
var/counter = 1
|
||||
while(src.active2.fields[text("com_[]", counter)])
|
||||
dat += text("[]<BR><A href='?src=\ref[];del_c=[]'>Delete Entry</A><BR><BR>", src.active2.fields[text("com_[]", counter)], src, counter)
|
||||
counter++
|
||||
dat += text("<A href='?src=\ref[];add_c=1'>Add Entry</A><BR><BR>", src)
|
||||
dat += text("<A href='?src=\ref[];del_r=1'>Delete Record (Medical Only)</A><BR><BR>", src)
|
||||
else
|
||||
dat += "<B>Medical Record Lost!</B><BR>"
|
||||
dat += text("<A href='?src=\ref[src];new=1'>New Record</A><BR><BR>")
|
||||
dat += text("\n<A href='?src=\ref[];print_p=1'>Print Record</A><BR>\n<A href='?src=\ref[];screen=2'>Back</A><BR>", src, src)
|
||||
if(5.0)
|
||||
dat += "<CENTER><B>Virus Database</B></CENTER>"
|
||||
for (var/ID in virusDB)
|
||||
var/datum/data/record/v = virusDB[ID]
|
||||
dat += "<br><a href='?src=\ref[src];vir=\ref[v]'>[v.fields["name"]]</a>"
|
||||
|
||||
src.active1 = null
|
||||
src.active2 = null
|
||||
dat += "<br><a href='?src=\ref[src];screen=1'>Back</a>"
|
||||
if(6.0)
|
||||
dat += "<center><b>Medical Robot Monitor</b></center>"
|
||||
dat += "<a href='?src=\ref[src];screen=1'>Back</a>"
|
||||
dat += "<br><b>Medical Robots:</b>"
|
||||
var/bdat = null
|
||||
for(var/mob/living/bot/medbot/M in mob_list)
|
||||
|
||||
if(href_list["vir"])
|
||||
var/datum/data/record/v = locate(href_list["vir"])
|
||||
src.temp = "<center>GNAv2 based virus lifeform V-[v.fields["id"]]</center>"
|
||||
src.temp += "<br><b>Name:</b> <A href='?src=\ref[src];field=vir_name;edit_vir=\ref[v]'>[v.fields["name"]]</A>"
|
||||
src.temp += "<br><b>Antigen:</b> [v.fields["antigen"]]"
|
||||
src.temp += "<br><b>Spread:</b> [v.fields["spread type"]] "
|
||||
src.temp += "<br><b>Details:</b><br> <A href='?src=\ref[src];field=vir_desc;edit_vir=\ref[v]'>[v.fields["description"]]</A>"
|
||||
|
||||
if (href_list["del_all"])
|
||||
src.temp = text("Are you sure you wish to delete all records?<br>\n\t<A href='?src=\ref[];temp=1;del_all2=1'>Yes</A><br>\n\t<A href='?src=\ref[];temp=1'>No</A><br>", src, src)
|
||||
|
||||
if (href_list["del_all2"])
|
||||
for(var/datum/data/record/R in data_core.medical)
|
||||
//R = null
|
||||
qdel(R)
|
||||
//Foreach goto(494)
|
||||
src.temp = "All records deleted."
|
||||
|
||||
if (href_list["field"])
|
||||
var/a1 = src.active1
|
||||
var/a2 = src.active2
|
||||
switch(href_list["field"])
|
||||
if("fingerprint")
|
||||
if (istype(src.active1, /datum/data/record))
|
||||
var/t1 = sanitize(input("Please input fingerprint hash:", "Med. records", src.active1.fields["fingerprint"], null) as text)
|
||||
if ((!( t1 ) || !( src.authenticated ) || usr.stat || usr.restrained() || (!interactable() && (!istype(usr, /mob/living/silicon))) || src.active1 != a1))
|
||||
return
|
||||
src.active1.fields["fingerprint"] = t1
|
||||
if("sex")
|
||||
if (istype(src.active1, /datum/data/record))
|
||||
if (src.active1.fields["sex"] == "Male")
|
||||
src.active1.fields["sex"] = "Female"
|
||||
if(M.z != computer.z) continue //only find medibots on the same z-level as the computer
|
||||
var/turf/bl = get_turf(M)
|
||||
if(bl) //if it can't find a turf for the medibot, then it probably shouldn't be showing up
|
||||
bdat += "[M.name] - <b>\[[bl.x],[bl.y]\]</b> - [M.on ? "Online" : "Offline"]<br>"
|
||||
if((!isnull(M.reagent_glass)) && M.use_beaker)
|
||||
bdat += "Reservoir: \[[M.reagent_glass.reagents.total_volume]/[M.reagent_glass.reagents.maximum_volume]\]<br>"
|
||||
else
|
||||
src.active1.fields["sex"] = "Male"
|
||||
if("age")
|
||||
if (istype(src.active1, /datum/data/record))
|
||||
var/t1 = input("Please input age:", "Med. records", src.active1.fields["age"], null) as num
|
||||
if ((!( t1 ) || !( src.authenticated ) || usr.stat || usr.restrained() || (!interactable() && (!istype(usr, /mob/living/silicon))) || src.active1 != a1))
|
||||
return
|
||||
src.active1.fields["age"] = t1
|
||||
if("mi_dis")
|
||||
if (istype(src.active2, /datum/data/record))
|
||||
var/t1 = sanitize(input("Please input minor disabilities list:", "Med. records", src.active2.fields["mi_dis"], null) as text)
|
||||
if ((!( t1 ) || !( src.authenticated ) || usr.stat || usr.restrained() || (!interactable() && (!istype(usr, /mob/living/silicon))) || src.active2 != a2))
|
||||
return
|
||||
src.active2.fields["mi_dis"] = t1
|
||||
if("mi_dis_d")
|
||||
if (istype(src.active2, /datum/data/record))
|
||||
var/t1 = sanitize(input("Please summarize minor dis.:", "Med. records", src.active2.fields["mi_dis_d"], null) as message)
|
||||
if ((!( t1 ) || !( src.authenticated ) || usr.stat || usr.restrained() || (!interactable() && (!istype(usr, /mob/living/silicon))) || src.active2 != a2))
|
||||
return
|
||||
src.active2.fields["mi_dis_d"] = t1
|
||||
if("ma_dis")
|
||||
if (istype(src.active2, /datum/data/record))
|
||||
var/t1 = sanitize(input("Please input major diabilities list:", "Med. records", src.active2.fields["ma_dis"], null) as text)
|
||||
if ((!( t1 ) || !( src.authenticated ) || usr.stat || usr.restrained() || (!interactable() && (!istype(usr, /mob/living/silicon))) || src.active2 != a2))
|
||||
return
|
||||
src.active2.fields["ma_dis"] = t1
|
||||
if("ma_dis_d")
|
||||
if (istype(src.active2, /datum/data/record))
|
||||
var/t1 = sanitize(input("Please summarize major dis.:", "Med. records", src.active2.fields["ma_dis_d"], null) as message)
|
||||
if ((!( t1 ) || !( src.authenticated ) || usr.stat || usr.restrained() || (!interactable() && (!istype(usr, /mob/living/silicon))) || src.active2 != a2))
|
||||
return
|
||||
src.active2.fields["ma_dis_d"] = t1
|
||||
if("alg")
|
||||
if (istype(src.active2, /datum/data/record))
|
||||
var/t1 = sanitize(input("Please state allergies:", "Med. records", src.active2.fields["alg"], null) as text)
|
||||
if ((!( t1 ) || !( src.authenticated ) || usr.stat || usr.restrained() || (!interactable() && (!istype(usr, /mob/living/silicon))) || src.active2 != a2))
|
||||
return
|
||||
src.active2.fields["alg"] = t1
|
||||
if("alg_d")
|
||||
if (istype(src.active2, /datum/data/record))
|
||||
var/t1 = sanitize(input("Please summarize allergies:", "Med. records", src.active2.fields["alg_d"], null) as message)
|
||||
if ((!( t1 ) || !( src.authenticated ) || usr.stat || usr.restrained() || (!interactable() && (!istype(usr, /mob/living/silicon))) || src.active2 != a2))
|
||||
return
|
||||
src.active2.fields["alg_d"] = t1
|
||||
if("cdi")
|
||||
if (istype(src.active2, /datum/data/record))
|
||||
var/t1 = sanitize(input("Please state diseases:", "Med. records", src.active2.fields["cdi"], null) as text)
|
||||
if ((!( t1 ) || !( src.authenticated ) || usr.stat || usr.restrained() || (!interactable() && (!istype(usr, /mob/living/silicon))) || src.active2 != a2))
|
||||
return
|
||||
src.active2.fields["cdi"] = t1
|
||||
if("cdi_d")
|
||||
if (istype(src.active2, /datum/data/record))
|
||||
var/t1 = sanitize(input("Please summarize diseases:", "Med. records", src.active2.fields["cdi_d"], null) as message)
|
||||
if ((!( t1 ) || !( src.authenticated ) || usr.stat || usr.restrained() || (!interactable() && (!istype(usr, /mob/living/silicon))) || src.active2 != a2))
|
||||
return
|
||||
src.active2.fields["cdi_d"] = t1
|
||||
if("notes")
|
||||
if (istype(src.active2, /datum/data/record))
|
||||
var/t1 = sanitize(input("Please summarize notes:", "Med. records", html_decode(src.active2.fields["notes"]), null) as message, extra = 0)
|
||||
if ((!( t1 ) || !( src.authenticated ) || usr.stat || usr.restrained() || (!interactable() && (!istype(usr, /mob/living/silicon))) || src.active2 != a2))
|
||||
return
|
||||
src.active2.fields["notes"] = t1
|
||||
if("p_stat")
|
||||
if (istype(src.active1, /datum/data/record))
|
||||
src.temp = text("<B>Physical Condition:</B><BR>\n\t<A href='?src=\ref[];temp=1;p_stat=deceased'>*Deceased*</A><BR>\n\t<A href='?src=\ref[];temp=1;p_stat=ssd'>*SSD*</A><BR>\n\t<A href='?src=\ref[];temp=1;p_stat=active'>Active</A><BR>\n\t<A href='?src=\ref[];temp=1;p_stat=unfit'>Physically Unfit</A><BR>\n\t<A href='?src=\ref[];temp=1;p_stat=disabled'>Disabled</A><BR>", src, src, src, src, src)
|
||||
if("m_stat")
|
||||
if (istype(src.active1, /datum/data/record))
|
||||
src.temp = text("<B>Mental Condition:</B><BR>\n\t<A href='?src=\ref[];temp=1;m_stat=insane'>*Insane*</A><BR>\n\t<A href='?src=\ref[];temp=1;m_stat=unstable'>*Unstable*</A><BR>\n\t<A href='?src=\ref[];temp=1;m_stat=watch'>*Watch*</A><BR>\n\t<A href='?src=\ref[];temp=1;m_stat=stable'>Stable</A><BR>", src, src, src, src)
|
||||
if("b_type")
|
||||
if (istype(src.active2, /datum/data/record))
|
||||
src.temp = text("<B>Blood Type:</B><BR>\n\t<A href='?src=\ref[];temp=1;b_type=an'>A-</A> <A href='?src=\ref[];temp=1;b_type=ap'>A+</A><BR>\n\t<A href='?src=\ref[];temp=1;b_type=bn'>B-</A> <A href='?src=\ref[];temp=1;b_type=bp'>B+</A><BR>\n\t<A href='?src=\ref[];temp=1;b_type=abn'>AB-</A> <A href='?src=\ref[];temp=1;b_type=abp'>AB+</A><BR>\n\t<A href='?src=\ref[];temp=1;b_type=on'>O-</A> <A href='?src=\ref[];temp=1;b_type=op'>O+</A><BR>", src, src, src, src, src, src, src, src)
|
||||
if("b_dna")
|
||||
if (istype(src.active2, /datum/data/record))
|
||||
var/t1 = sanitize(input("Please input DNA hash:", "Med. records", src.active2.fields["b_dna"], null) as text)
|
||||
if ((!( t1 ) || !( src.authenticated ) || usr.stat || usr.restrained() || (!interactable() && (!istype(usr, /mob/living/silicon))) || src.active2 != a2))
|
||||
return
|
||||
src.active2.fields["b_dna"] = t1
|
||||
if("vir_name")
|
||||
var/datum/data/record/v = locate(href_list["edit_vir"])
|
||||
if (v)
|
||||
var/t1 = sanitize(input("Please input pathogen name:", "VirusDB", v.fields["name"], null) as text)
|
||||
if ((!( t1 ) || !( src.authenticated ) || usr.stat || usr.restrained() || (!interactable() && (!istype(usr, /mob/living/silicon))) || src.active1 != a1))
|
||||
return
|
||||
v.fields["name"] = t1
|
||||
if("vir_desc")
|
||||
var/datum/data/record/v = locate(href_list["edit_vir"])
|
||||
if (v)
|
||||
var/t1 = sanitize(input("Please input information about pathogen:", "VirusDB", v.fields["description"], null) as message)
|
||||
if ((!( t1 ) || !( src.authenticated ) || usr.stat || usr.restrained() || (!interactable() && (!istype(usr, /mob/living/silicon))) || src.active1 != a1))
|
||||
return
|
||||
v.fields["description"] = t1
|
||||
bdat += "Using Internal Synthesizer.<br>"
|
||||
if(!bdat)
|
||||
dat += "<br><center>None detected</center>"
|
||||
else
|
||||
dat += "<br>[bdat]"
|
||||
|
||||
if (href_list["p_stat"])
|
||||
if (src.active1)
|
||||
switch(href_list["p_stat"])
|
||||
if("deceased")
|
||||
src.active1.fields["p_stat"] = "*Deceased*"
|
||||
if("ssd")
|
||||
src.active1.fields["p_stat"] = "*SSD*"
|
||||
if("active")
|
||||
src.active1.fields["p_stat"] = "Active"
|
||||
if("unfit")
|
||||
src.active1.fields["p_stat"] = "Physically Unfit"
|
||||
if("disabled")
|
||||
src.active1.fields["p_stat"] = "Disabled"
|
||||
if(PDA_Manifest.len)
|
||||
PDA_Manifest.Cut()
|
||||
else
|
||||
dat += text("<A href='?src=\ref[];login=1'>{Log In}</A>", src)
|
||||
popup.width = 600
|
||||
popup.height = 400
|
||||
popup.set_content(dat)
|
||||
popup.set_title_image(usr.browse_rsc_icon(computer.icon, computer.icon_state))
|
||||
popup.open()
|
||||
return
|
||||
|
||||
if (href_list["m_stat"])
|
||||
if (src.active1)
|
||||
switch(href_list["m_stat"])
|
||||
if("insane")
|
||||
src.active1.fields["m_stat"] = "*Insane*"
|
||||
if("unstable")
|
||||
src.active1.fields["m_stat"] = "*Unstable*"
|
||||
if("watch")
|
||||
src.active1.fields["m_stat"] = "*Watch*"
|
||||
if("stable")
|
||||
src.active1.fields["m_stat"] = "Stable"
|
||||
/datum/file/program/med_data/Topic(href, href_list)
|
||||
if(!interactable() || !computer.cardslot || ..(href,href_list))
|
||||
return
|
||||
if(!data_core.general.Find(src.active1))
|
||||
src.active1 = null
|
||||
if(!data_core.medical.Find(src.active2))
|
||||
src.active2 = null
|
||||
|
||||
if(href_list["temp"])
|
||||
src.temp = null
|
||||
|
||||
if (href_list["b_type"])
|
||||
if (src.active2)
|
||||
switch(href_list["b_type"])
|
||||
if("an")
|
||||
src.active2.fields["b_type"] = "A-"
|
||||
if("bn")
|
||||
src.active2.fields["b_type"] = "B-"
|
||||
if("abn")
|
||||
src.active2.fields["b_type"] = "AB-"
|
||||
if("on")
|
||||
src.active2.fields["b_type"] = "O-"
|
||||
if("ap")
|
||||
src.active2.fields["b_type"] = "A+"
|
||||
if("bp")
|
||||
src.active2.fields["b_type"] = "B+"
|
||||
if("abp")
|
||||
src.active2.fields["b_type"] = "AB+"
|
||||
if("op")
|
||||
src.active2.fields["b_type"] = "O+"
|
||||
if(href_list["cardr"])
|
||||
if(scan)
|
||||
if(istype(usr,/mob/living/carbon/human) && !usr.get_active_hand())
|
||||
computer.cardslot.remove(usr, 1)
|
||||
else
|
||||
scan.loc = get_turf(src)
|
||||
scan = null
|
||||
else
|
||||
var/obj/item/I = usr.get_active_hand()
|
||||
if(istype(I, /obj/item/weapon/card/id))
|
||||
computer.cardslot.insert(I, usr)
|
||||
scan = I
|
||||
|
||||
if(href_list["cardw"])
|
||||
if(scan2)
|
||||
if(istype(usr,/mob/living/carbon/human) && !usr.get_active_hand())
|
||||
computer.cardslot.remove(usr, 2)
|
||||
else
|
||||
scan2.loc = get_turf(src)
|
||||
scan2 = null
|
||||
else
|
||||
var/obj/item/I = usr.get_active_hand()
|
||||
if(istype(I, /obj/item/weapon/card/id))
|
||||
computer.cardslot.insert(I, usr, 2)
|
||||
scan2 = I
|
||||
|
||||
if (href_list["del_r"])
|
||||
if (src.active2)
|
||||
src.temp = text("Are you sure you wish to delete the record (Medical Portion Only)?<br>\n\t<A href='?src=\ref[];temp=1;del_r2=1'>Yes</A><br>\n\t<A href='?src=\ref[];temp=1'>No</A><br>", src, src)
|
||||
else if(href_list["logout"])
|
||||
src.authenticated = null
|
||||
src.screen = null
|
||||
src.active1 = null
|
||||
src.active2 = null
|
||||
|
||||
if (href_list["del_r2"])
|
||||
if (src.active2)
|
||||
//src.active2 = null
|
||||
qdel(src.active2)
|
||||
else if(href_list["login"])
|
||||
|
||||
if (href_list["d_rec"])
|
||||
var/datum/data/record/R = locate(href_list["d_rec"])
|
||||
var/datum/data/record/M = locate(href_list["d_rec"])
|
||||
if (!( data_core.general.Find(R) ))
|
||||
src.temp = "Record Not Found!"
|
||||
return
|
||||
for(var/datum/data/record/E in data_core.medical)
|
||||
if ((E.fields["name"] == R.fields["name"] || E.fields["id"] == R.fields["id"]))
|
||||
M = E
|
||||
else
|
||||
//Foreach continue //goto(2540)
|
||||
src.active1 = R
|
||||
src.active2 = M
|
||||
if(isAI(usr))
|
||||
src.active1 = null
|
||||
src.active2 = null
|
||||
src.authenticated = usr.name
|
||||
src.rank = "AI"
|
||||
src.screen = 1
|
||||
|
||||
else if(isrobot(usr))
|
||||
src.active1 = null
|
||||
src.active2 = null
|
||||
src.authenticated = usr.name
|
||||
var/mob/living/silicon/robot/R = usr
|
||||
src.rank = "[R.modtype] [R.braintype]"
|
||||
src.screen = 1
|
||||
|
||||
else if(istype(src.scan, /obj/item/weapon/card/id))
|
||||
src.active1 = null
|
||||
src.active2 = null
|
||||
|
||||
if(src.check_access(src.scan))
|
||||
src.authenticated = src.scan.registered_name
|
||||
src.rank = src.scan.assignment
|
||||
src.screen = 1
|
||||
|
||||
if(src.authenticated)
|
||||
|
||||
if(href_list["screen"])
|
||||
src.screen = text2num(href_list["screen"])
|
||||
if(src.screen < 1)
|
||||
src.screen = 1
|
||||
|
||||
src.active1 = null
|
||||
src.active2 = null
|
||||
|
||||
if(href_list["vir"])
|
||||
var/datum/data/record/v = locate(href_list["vir"])
|
||||
src.temp = "<center>GNAv2 based virus lifeform V-[v.fields["id"]]</center>"
|
||||
src.temp += "<br><b>Name:</b> <A href='?src=\ref[src];field=vir_name;edit_vir=\ref[v]'>[v.fields["name"]]</A>"
|
||||
src.temp += "<br><b>Antigen:</b> [v.fields["antigen"]]"
|
||||
src.temp += "<br><b>Spread:</b> [v.fields["spread type"]] "
|
||||
src.temp += "<br><b>Details:</b><br> <A href='?src=\ref[src];field=vir_desc;edit_vir=\ref[v]'>[v.fields["description"]]</A>"
|
||||
|
||||
if(href_list["del_all"])
|
||||
src.temp = text("Are you sure you wish to delete all records?<br>\n\t<A href='?src=\ref[];temp=1;del_all2=1'>Yes</A><br>\n\t<A href='?src=\ref[];temp=1'>No</A><br>", src, src)
|
||||
|
||||
if(href_list["del_all2"])
|
||||
for(var/datum/data/record/R in data_core.medical)
|
||||
//R = null
|
||||
qdel(R)
|
||||
//Foreach goto(494)
|
||||
src.temp = "All records deleted."
|
||||
|
||||
if(href_list["field"])
|
||||
var/a1 = src.active1
|
||||
var/a2 = src.active2
|
||||
switch(href_list["field"])
|
||||
if("fingerprint")
|
||||
if(istype(src.active1, /datum/data/record))
|
||||
var/t1 = sanitize(input("Please input fingerprint hash:", "Med. records", src.active1.fields["fingerprint"], null) as text)
|
||||
if(!t1 || !src.authenticated || usr.stat || usr.restrained() || (!interactable() && !issilicon(usr)) || src.active1 != a1)
|
||||
return
|
||||
src.active1.fields["fingerprint"] = t1
|
||||
if("sex")
|
||||
if(istype(src.active1, /datum/data/record))
|
||||
if (src.active1.fields["sex"] == "Male")
|
||||
src.active1.fields["sex"] = "Female"
|
||||
else
|
||||
src.active1.fields["sex"] = "Male"
|
||||
if("age")
|
||||
if(istype(src.active1, /datum/data/record))
|
||||
var/t1 = input("Please input age:", "Med. records", src.active1.fields["age"], null) as num
|
||||
if(!t1 || !src.authenticated || usr.stat || usr.restrained() || (!interactable() && !issilicon(usr)) || src.active1 != a1)
|
||||
return
|
||||
src.active1.fields["age"] = t1
|
||||
if("mi_dis")
|
||||
if(istype(src.active2, /datum/data/record))
|
||||
var/t1 = sanitize(input("Please input minor disabilities list:", "Med. records", src.active2.fields["mi_dis"], null) as text)
|
||||
if(!t1 || !src.authenticated || usr.stat || usr.restrained() || (!interactable() && !issilicon(usr)) || src.active2 != a2)
|
||||
return
|
||||
src.active2.fields["mi_dis"] = t1
|
||||
if("mi_dis_d")
|
||||
if(istype(src.active2, /datum/data/record))
|
||||
var/t1 = sanitize(input("Please summarize minor dis.:", "Med. records", src.active2.fields["mi_dis_d"], null) as message)
|
||||
if(!t1 || !src.authenticated || usr.stat || usr.restrained() || (!interactable() && !issilicon(usr)) || src.active2 != a2)
|
||||
return
|
||||
src.active2.fields["mi_dis_d"] = t1
|
||||
if("ma_dis")
|
||||
if(istype(src.active2, /datum/data/record))
|
||||
var/t1 = sanitize(input("Please input major diabilities list:", "Med. records", src.active2.fields["ma_dis"], null) as text)
|
||||
if(!t1 || !src.authenticated || usr.stat || usr.restrained() || (!interactable() && !issilicon(usr)) || src.active2 != a2)
|
||||
return
|
||||
src.active2.fields["ma_dis"] = t1
|
||||
if("ma_dis_d")
|
||||
if(istype(src.active2, /datum/data/record))
|
||||
var/t1 = sanitize(input("Please summarize major dis.:", "Med. records", src.active2.fields["ma_dis_d"], null) as message)
|
||||
if(!t1 || !src.authenticated || usr.stat || usr.restrained() || (!interactable() && !issilicon(usr)) || src.active2 != a2)
|
||||
return
|
||||
src.active2.fields["ma_dis_d"] = t1
|
||||
if("alg")
|
||||
if(istype(src.active2, /datum/data/record))
|
||||
var/t1 = sanitize(input("Please state allergies:", "Med. records", src.active2.fields["alg"], null) as text)
|
||||
if(!t1 || !src.authenticated || usr.stat || usr.restrained() || (!interactable() && !issilicon(usr)) || src.active2 != a2)
|
||||
return
|
||||
src.active2.fields["alg"] = t1
|
||||
if("alg_d")
|
||||
if(istype(src.active2, /datum/data/record))
|
||||
var/t1 = sanitize(input("Please summarize allergies:", "Med. records", src.active2.fields["alg_d"], null) as message)
|
||||
if(!t1 || !src.authenticated || usr.stat || usr.restrained() || (!interactable() && !issilicon(usr)) || src.active2 != a2)
|
||||
return
|
||||
src.active2.fields["alg_d"] = t1
|
||||
if("cdi")
|
||||
if(istype(src.active2, /datum/data/record))
|
||||
var/t1 = sanitize(input("Please state diseases:", "Med. records", src.active2.fields["cdi"], null) as text)
|
||||
if(!t1 || !src.authenticated || usr.stat || usr.restrained() || (!interactable() && !issilicon(usr)) || src.active2 != a2)
|
||||
return
|
||||
src.active2.fields["cdi"] = t1
|
||||
if("cdi_d")
|
||||
if(istype(src.active2, /datum/data/record))
|
||||
var/t1 = sanitize(input("Please summarize diseases:", "Med. records", src.active2.fields["cdi_d"], null) as message)
|
||||
if(!t1 || !src.authenticated || usr.stat || usr.restrained() || (!interactable() && !issilicon(usr)) || src.active2 != a2)
|
||||
return
|
||||
src.active2.fields["cdi_d"] = t1
|
||||
if("notes")
|
||||
if(istype(src.active2, /datum/data/record))
|
||||
var/t1 = sanitize(input("Please summarize notes:", "Med. records", html_decode(src.active2.fields["notes"]), null) as message, extra = 0)
|
||||
if(!t1 || !src.authenticated || usr.stat || usr.restrained() || (!interactable() && !issilicon(usr)) || src.active2 != a2)
|
||||
return
|
||||
src.active2.fields["notes"] = t1
|
||||
if("p_stat")
|
||||
if (istype(src.active1, /datum/data/record))
|
||||
src.temp = text("<B>Physical Condition:</B><BR>\n\t<A href='?src=\ref[];temp=1;p_stat=deceased'>*Deceased*</A><BR>\n\t<A href='?src=\ref[];temp=1;p_stat=ssd'>*SSD*</A><BR>\n\t<A href='?src=\ref[];temp=1;p_stat=active'>Active</A><BR>\n\t<A href='?src=\ref[];temp=1;p_stat=unfit'>Physically Unfit</A><BR>\n\t<A href='?src=\ref[];temp=1;p_stat=disabled'>Disabled</A><BR>", src, src, src, src, src)
|
||||
if("m_stat")
|
||||
if (istype(src.active1, /datum/data/record))
|
||||
src.temp = text("<B>Mental Condition:</B><BR>\n\t<A href='?src=\ref[];temp=1;m_stat=insane'>*Insane*</A><BR>\n\t<A href='?src=\ref[];temp=1;m_stat=unstable'>*Unstable*</A><BR>\n\t<A href='?src=\ref[];temp=1;m_stat=watch'>*Watch*</A><BR>\n\t<A href='?src=\ref[];temp=1;m_stat=stable'>Stable</A><BR>", src, src, src, src)
|
||||
if("b_type")
|
||||
if (istype(src.active2, /datum/data/record))
|
||||
src.temp = text("<B>Blood Type:</B><BR>\n\t<A href='?src=\ref[];temp=1;b_type=an'>A-</A> <A href='?src=\ref[];temp=1;b_type=ap'>A+</A><BR>\n\t<A href='?src=\ref[];temp=1;b_type=bn'>B-</A> <A href='?src=\ref[];temp=1;b_type=bp'>B+</A><BR>\n\t<A href='?src=\ref[];temp=1;b_type=abn'>AB-</A> <A href='?src=\ref[];temp=1;b_type=abp'>AB+</A><BR>\n\t<A href='?src=\ref[];temp=1;b_type=on'>O-</A> <A href='?src=\ref[];temp=1;b_type=op'>O+</A><BR>", src, src, src, src, src, src, src, src)
|
||||
if("b_dna")
|
||||
if(istype(src.active2, /datum/data/record))
|
||||
var/t1 = sanitize(input("Please input DNA hash:", "Med. records", src.active2.fields["b_dna"], null) as text)
|
||||
if(!t1 || !src.authenticated || usr.stat || usr.restrained() || (!interactable() && !issilicon(usr)) || src.active2 != a2)
|
||||
return
|
||||
src.active2.fields["b_dna"] = t1
|
||||
if("vir_name")
|
||||
var/datum/data/record/v = locate(href_list["edit_vir"])
|
||||
if(v)
|
||||
var/t1 = sanitize(input("Please input pathogen name:", "VirusDB", v.fields["name"], null) as text)
|
||||
if (!t1 || !src.authenticated || usr.stat || usr.restrained() || (!interactable() && !issilicon(usr)) || src.active1 != a1)
|
||||
return
|
||||
v.fields["name"] = t1
|
||||
if("vir_desc")
|
||||
var/datum/data/record/v = locate(href_list["edit_vir"])
|
||||
if(v)
|
||||
var/t1 = sanitize(input("Please input information about pathogen:", "VirusDB", v.fields["description"], null) as message)
|
||||
if(!t1 || !src.authenticated || usr.stat || usr.restrained() || (!interactable() && !issilicon(usr)) || src.active1 != a1)
|
||||
return
|
||||
v.fields["description"] = t1
|
||||
|
||||
if(href_list["p_stat"])
|
||||
if(src.active1)
|
||||
switch(href_list["p_stat"])
|
||||
if("deceased")
|
||||
src.active1.fields["p_stat"] = "*Deceased*"
|
||||
if("ssd")
|
||||
src.active1.fields["p_stat"] = "*SSD*"
|
||||
if("active")
|
||||
src.active1.fields["p_stat"] = "Active"
|
||||
if("unfit")
|
||||
src.active1.fields["p_stat"] = "Physically Unfit"
|
||||
if("disabled")
|
||||
src.active1.fields["p_stat"] = "Disabled"
|
||||
if(PDA_Manifest.len)
|
||||
PDA_Manifest.Cut()
|
||||
|
||||
if(href_list["m_stat"])
|
||||
if(src.active1)
|
||||
switch(href_list["m_stat"])
|
||||
if("insane")
|
||||
src.active1.fields["m_stat"] = "*Insane*"
|
||||
if("unstable")
|
||||
src.active1.fields["m_stat"] = "*Unstable*"
|
||||
if("watch")
|
||||
src.active1.fields["m_stat"] = "*Watch*"
|
||||
if("stable")
|
||||
src.active1.fields["m_stat"] = "Stable"
|
||||
|
||||
if(href_list["b_type"])
|
||||
if(src.active2)
|
||||
switch(href_list["b_type"])
|
||||
if("an")
|
||||
src.active2.fields["b_type"] = "A-"
|
||||
if("bn")
|
||||
src.active2.fields["b_type"] = "B-"
|
||||
if("abn")
|
||||
src.active2.fields["b_type"] = "AB-"
|
||||
if("on")
|
||||
src.active2.fields["b_type"] = "O-"
|
||||
if("ap")
|
||||
src.active2.fields["b_type"] = "A+"
|
||||
if("bp")
|
||||
src.active2.fields["b_type"] = "B+"
|
||||
if("abp")
|
||||
src.active2.fields["b_type"] = "AB+"
|
||||
if("op")
|
||||
src.active2.fields["b_type"] = "O+"
|
||||
|
||||
if(href_list["del_r"])
|
||||
if(src.active2)
|
||||
src.temp = text("Are you sure you wish to delete the record (Medical Portion Only)?<br>\n\t<A href='?src=\ref[];temp=1;del_r2=1'>Yes</A><br>\n\t<A href='?src=\ref[];temp=1'>No</A><br>", src, src)
|
||||
|
||||
if(href_list["del_r2"])
|
||||
if(src.active2)
|
||||
//src.active2 = null
|
||||
qdel(src.active2)
|
||||
|
||||
if(href_list["d_rec"])
|
||||
var/datum/data/record/R = locate(href_list["d_rec"])
|
||||
var/datum/data/record/M = locate(href_list["d_rec"])
|
||||
if(!data_core.general.Find(R))
|
||||
src.temp = "Record Not Found!"
|
||||
return
|
||||
for(var/datum/data/record/E in data_core.medical)
|
||||
if(E.fields["name"] == R.fields["name"] || E.fields["id"] == R.fields["id"])
|
||||
M = E
|
||||
else
|
||||
//Foreach continue //goto(2540)
|
||||
src.active1 = R
|
||||
src.active2 = M
|
||||
src.screen = 4
|
||||
|
||||
if(href_list["new"])
|
||||
if(istype(src.active1, /datum/data/record) && !istype(src.active2, /datum/data/record))
|
||||
var/datum/data/record/R = new /datum/data/record( )
|
||||
R.fields["name"] = src.active1.fields["name"]
|
||||
R.fields["id"] = src.active1.fields["id"]
|
||||
R.name = text("Medical Record #[]", R.fields["id"])
|
||||
R.fields["b_type"] = "Unknown"
|
||||
R.fields["b_dna"] = "Unknown"
|
||||
R.fields["mi_dis"] = "None"
|
||||
R.fields["mi_dis_d"] = "No minor disabilities have been declared."
|
||||
R.fields["ma_dis"] = "None"
|
||||
R.fields["ma_dis_d"] = "No major disabilities have been diagnosed."
|
||||
R.fields["alg"] = "None"
|
||||
R.fields["alg_d"] = "No allergies have been detected in this patient."
|
||||
R.fields["cdi"] = "None"
|
||||
R.fields["cdi_d"] = "No diseases have been diagnosed at the moment."
|
||||
R.fields["notes"] = "No notes."
|
||||
data_core.medical += R
|
||||
src.active2 = R
|
||||
src.screen = 4
|
||||
|
||||
if (href_list["new"])
|
||||
if ((istype(src.active1, /datum/data/record) && !( istype(src.active2, /datum/data/record) )))
|
||||
var/datum/data/record/R = new /datum/data/record( )
|
||||
R.fields["name"] = src.active1.fields["name"]
|
||||
R.fields["id"] = src.active1.fields["id"]
|
||||
R.name = text("Medical Record #[]", R.fields["id"])
|
||||
R.fields["b_type"] = "Unknown"
|
||||
R.fields["b_dna"] = "Unknown"
|
||||
R.fields["mi_dis"] = "None"
|
||||
R.fields["mi_dis_d"] = "No minor disabilities have been declared."
|
||||
R.fields["ma_dis"] = "None"
|
||||
R.fields["ma_dis_d"] = "No major disabilities have been diagnosed."
|
||||
R.fields["alg"] = "None"
|
||||
R.fields["alg_d"] = "No allergies have been detected in this patient."
|
||||
R.fields["cdi"] = "None"
|
||||
R.fields["cdi_d"] = "No diseases have been diagnosed at the moment."
|
||||
R.fields["notes"] = "No notes."
|
||||
data_core.medical += R
|
||||
if(href_list["add_c"])
|
||||
if(!istype(src.active2, /datum/data/record))
|
||||
return
|
||||
var/a2 = src.active2
|
||||
var/t1 = sanitize(input("Add Comment:", "Med. records", null, null) as message)
|
||||
if(!t1 || !src.authenticated || usr.stat || usr.restrained() || (!interactable() && !issilicon(usr)) || src.active2 != a2)
|
||||
return
|
||||
var/counter = 1
|
||||
while(src.active2.fields[text("com_[]", counter)])
|
||||
counter++
|
||||
src.active2.fields[text("com_[counter]")] = text("Made by [authenticated] ([rank]) on [time2text(world.realtime, "DDD MMM DD")] [stationtime2text()], [game_year]<BR>[t1]")
|
||||
|
||||
if(href_list["del_c"])
|
||||
if(istype(src.active2, /datum/data/record) && src.active2.fields[text("com_[]", href_list["del_c"])])
|
||||
src.active2.fields[text("com_[]", href_list["del_c"])] = "<B>Deleted</B>"
|
||||
|
||||
if(href_list["search"])
|
||||
var/t1 = input("Search String: (Name, DNA, or ID)", "Med. records", null, null) as text
|
||||
if(!t1 || usr.stat || !src.authenticated || usr.restrained() || (!interactable() && !issilicon(usr)))
|
||||
return
|
||||
src.active1 = null
|
||||
src.active2 = null
|
||||
t1 = lowertext(t1)
|
||||
for(var/datum/data/record/R in data_core.medical)
|
||||
if(lowertext(R.fields["name"]) == t1 || t1 == lowertext(R.fields["id"]) || t1 == lowertext(R.fields["b_dna"]))
|
||||
src.active2 = R
|
||||
src.screen = 4
|
||||
if (!src.active2)
|
||||
src.temp = text("Could not locate record [].", t1)
|
||||
else
|
||||
for(var/datum/data/record/E in data_core.general)
|
||||
if(E.fields["name"] == src.active2.fields["name"] || E.fields["id"] == src.active2.fields["id"])
|
||||
src.active1 = E
|
||||
src.screen = 4
|
||||
|
||||
if (href_list["add_c"])
|
||||
if (!( istype(src.active2, /datum/data/record) ))
|
||||
return
|
||||
var/a2 = src.active2
|
||||
var/t1 = sanitize(input("Add Comment:", "Med. records", null, null) as message)
|
||||
if ((!( t1 ) || !( src.authenticated ) || usr.stat || usr.restrained() || (!interactable() && (!istype(usr, /mob/living/silicon))) || src.active2 != a2))
|
||||
return
|
||||
var/counter = 1
|
||||
while(src.active2.fields[text("com_[]", counter)])
|
||||
counter++
|
||||
src.active2.fields[text("com_[counter]")] = text("Made by [authenticated] ([rank]) on [time2text(world.realtime, "DDD MMM DD")] [stationtime2text()], [game_year]<BR>[t1]")
|
||||
|
||||
if (href_list["del_c"])
|
||||
if ((istype(src.active2, /datum/data/record) && src.active2.fields[text("com_[]", href_list["del_c"])]))
|
||||
src.active2.fields[text("com_[]", href_list["del_c"])] = "<B>Deleted</B>"
|
||||
|
||||
if (href_list["search"])
|
||||
var/t1 = input("Search String: (Name, DNA, or ID)", "Med. records", null, null) as text
|
||||
if ((!( t1 ) || usr.stat || !( src.authenticated ) || usr.restrained() || ((!interactable()) && (!istype(usr, /mob/living/silicon)))))
|
||||
return
|
||||
src.active1 = null
|
||||
src.active2 = null
|
||||
t1 = lowertext(t1)
|
||||
for(var/datum/data/record/R in data_core.medical)
|
||||
if ((lowertext(R.fields["name"]) == t1 || t1 == lowertext(R.fields["id"]) || t1 == lowertext(R.fields["b_dna"])))
|
||||
src.active2 = R
|
||||
else
|
||||
//Foreach continue //goto(3229)
|
||||
if (!( src.active2 ))
|
||||
src.temp = text("Could not locate record [].", t1)
|
||||
if(href_list["print_p"])
|
||||
if(!src.printing)
|
||||
src.printing = 1
|
||||
var/datum/data/record/record1 = null
|
||||
var/datum/data/record/record2 = null
|
||||
if ((istype(src.active1, /datum/data/record) && data_core.general.Find(src.active1)))
|
||||
record1 = active1
|
||||
if ((istype(src.active2, /datum/data/record) && data_core.medical.Find(src.active2)))
|
||||
record2 = active2
|
||||
sleep(50)
|
||||
var/obj/item/weapon/paper/P = new /obj/item/weapon/paper( computer.loc )
|
||||
P.info = "<CENTER><B>Medical Record</B></CENTER><BR>"
|
||||
if(record1)
|
||||
P.info += text("Name: [] ID: []<BR>\nSex: []<BR>\nAge: []<BR>\nFingerprint: []<BR>\nPhysical Status: []<BR>\nMental Status: []<BR>", record1.fields["name"], record1.fields["id"], record1.fields["sex"], record1.fields["age"], record1.fields["fingerprint"], record1.fields["p_stat"], record1.fields["m_stat"])
|
||||
P.name = text("Medical Record ([])", record1.fields["name"])
|
||||
else
|
||||
for(var/datum/data/record/E in data_core.general)
|
||||
if ((E.fields["name"] == src.active2.fields["name"] || E.fields["id"] == src.active2.fields["id"]))
|
||||
src.active1 = E
|
||||
else
|
||||
//Foreach continue //goto(3334)
|
||||
src.screen = 4
|
||||
|
||||
if (href_list["print_p"])
|
||||
if (!( src.printing ))
|
||||
src.printing = 1
|
||||
var/datum/data/record/record1 = null
|
||||
var/datum/data/record/record2 = null
|
||||
if ((istype(src.active1, /datum/data/record) && data_core.general.Find(src.active1)))
|
||||
record1 = active1
|
||||
if ((istype(src.active2, /datum/data/record) && data_core.medical.Find(src.active2)))
|
||||
record2 = active2
|
||||
sleep(50)
|
||||
var/obj/item/weapon/paper/P = new /obj/item/weapon/paper( computer.loc )
|
||||
P.info = "<CENTER><B>Medical Record</B></CENTER><BR>"
|
||||
if (record1)
|
||||
P.info += text("Name: [] ID: []<BR>\nSex: []<BR>\nAge: []<BR>\nFingerprint: []<BR>\nPhysical Status: []<BR>\nMental Status: []<BR>", record1.fields["name"], record1.fields["id"], record1.fields["sex"], record1.fields["age"], record1.fields["fingerprint"], record1.fields["p_stat"], record1.fields["m_stat"])
|
||||
P.name = text("Medical Record ([])", record1.fields["name"])
|
||||
else
|
||||
P.info += "<B>General Record Lost!</B><BR>"
|
||||
P.name = "Medical Record"
|
||||
if (record2)
|
||||
P.info += text("<BR>\n<CENTER><B>Medical Data</B></CENTER><BR>\nBlood Type: []<BR>\nDNA: []<BR>\n<BR>\nMinor Disabilities: []<BR>\nDetails: []<BR>\n<BR>\nMajor Disabilities: []<BR>\nDetails: []<BR>\n<BR>\nAllergies: []<BR>\nDetails: []<BR>\n<BR>\nCurrent Diseases: [] (per disease info placed in log/comment section)<BR>\nDetails: []<BR>\n<BR>\nImportant Notes:<BR>\n\t[]<BR>\n<BR>\n<CENTER><B>Comments/Log</B></CENTER><BR>", record2.fields["b_type"], record2.fields["b_dna"], record2.fields["mi_dis"], record2.fields["mi_dis_d"], record2.fields["ma_dis"], record2.fields["ma_dis_d"], record2.fields["alg"], record2.fields["alg_d"], record2.fields["cdi"], record2.fields["cdi_d"], decode(record2.fields["notes"]))
|
||||
var/counter = 1
|
||||
while(record2.fields[text("com_[]", counter)])
|
||||
P.info += text("[]<BR>", record2.fields[text("com_[]", counter)])
|
||||
counter++
|
||||
else
|
||||
P.info += "<B>Medical Record Lost!</B><BR>"
|
||||
P.info += "</TT>"
|
||||
src.printing = null
|
||||
|
||||
interact()
|
||||
return
|
||||
P.info += "<B>General Record Lost!</B><BR>"
|
||||
P.name = "Medical Record"
|
||||
if(record2)
|
||||
P.info += text("<BR>\n<CENTER><B>Medical Data</B></CENTER><BR>\nBlood Type: []<BR>\nDNA: []<BR>\n<BR>\nMinor Disabilities: []<BR>\nDetails: []<BR>\n<BR>\nMajor Disabilities: []<BR>\nDetails: []<BR>\n<BR>\nAllergies: []<BR>\nDetails: []<BR>\n<BR>\nCurrent Diseases: [] (per disease info placed in log/comment section)<BR>\nDetails: []<BR>\n<BR>\nImportant Notes:<BR>\n\t[]<BR>\n<BR>\n<CENTER><B>Comments/Log</B></CENTER><BR>", record2.fields["b_type"], record2.fields["b_dna"], record2.fields["mi_dis"], record2.fields["mi_dis_d"], record2.fields["ma_dis"], record2.fields["ma_dis_d"], record2.fields["alg"], record2.fields["alg_d"], record2.fields["cdi"], record2.fields["cdi_d"], decode(record2.fields["notes"]))
|
||||
var/counter = 1
|
||||
while(record2.fields[text("com_[]", counter)])
|
||||
P.info += text("[]<BR>", record2.fields[text("com_[]", counter)])
|
||||
counter++
|
||||
else
|
||||
P.info += "<B>Medical Record Lost!</B><BR>"
|
||||
P.info += "</TT>"
|
||||
src.printing = null
|
||||
interact()
|
||||
return
|
||||
|
||||
@@ -8,41 +8,41 @@
|
||||
desc = "It monitors APC status."
|
||||
active_state = "power"
|
||||
|
||||
proc/format(var/obj/machinery/power/apc/A)
|
||||
var/static/list/S = list(" Off","AOff"," On", " AOn")
|
||||
var/static/list/chg = list("N","C","F")
|
||||
return "[copytext(add_tspace("\The [A.area]", 30), 1, 30)] [S[A.equipment+1]] [S[A.lighting+1]] [S[A.environ+1]] \
|
||||
[add_lspace(A.lastused_total, 6)] [A.cell ? "[add_lspace(round(A.cell.percent()), 3)]% [chg[A.charging+1]]" : " N/C"]<BR>"
|
||||
/datum/file/program/powermon/proc/format(var/obj/machinery/power/apc/A)
|
||||
var/static/list/S = list(" Off","AOff"," On", " AOn")
|
||||
var/static/list/chg = list("N","C","F")
|
||||
return "[copytext(add_tspace("\The [A.area]", 30), 1, 30)] [S[A.equipment+1]] [S[A.lighting+1]] [S[A.environ+1]] \
|
||||
[add_lspace(A.lastused_total, 6)] [A.cell ? "[add_lspace(round(A.cell.percent()), 3)]% [chg[A.charging+1]]" : " N/C"]<BR>"
|
||||
|
||||
interact()
|
||||
if(!interactable())
|
||||
return
|
||||
if(!computer.net)
|
||||
computer.Crash(MISSING_PERIPHERAL)
|
||||
return
|
||||
var/list/L = computer.net.get_machines(/obj/machinery/power/apc)
|
||||
var/t = ""
|
||||
t += "<A href='?src=\ref[src]'>Refresh</A><br /><br />"
|
||||
if(!L || !L.len)
|
||||
t += "No connection"
|
||||
/datum/file/program/powermon/interact()
|
||||
if(!interactable())
|
||||
return
|
||||
if(!computer.net)
|
||||
computer.Crash(MISSING_PERIPHERAL)
|
||||
return
|
||||
var/list/L = computer.net.get_machines(/obj/machinery/power/apc)
|
||||
var/t = ""
|
||||
t += "<A href='?src=\ref[src]'>Refresh</A><br /><br />"
|
||||
if(!L || !L.len)
|
||||
t += "No connection"
|
||||
else
|
||||
var/datum/powernet/powernet = computer.net.connect_to(/datum/powernet,null)
|
||||
if(powernet)
|
||||
t += "<PRE>Total power: [powernet.avail] W<BR>Total load: [num2text(powernet.viewload,10)] W<BR>"
|
||||
else
|
||||
var/datum/powernet/powernet = computer.net.connect_to(/datum/powernet,null)
|
||||
if(powernet)
|
||||
t += "<PRE>Total power: [powernet.avail] W<BR>Total load: [num2text(powernet.viewload,10)] W<BR>"
|
||||
else
|
||||
t += "<PRE><i>Power statistics unavailable</i><BR>"
|
||||
t += "<FONT SIZE=-1>"
|
||||
t += "<PRE><i>Power statistics unavailable</i><BR>"
|
||||
t += "<FONT SIZE=-1>"
|
||||
|
||||
if(L.len > 0)
|
||||
t += "Area Eqp./Lgt./Env. Load Cell<HR>"
|
||||
for(var/obj/machinery/power/apc/A in L)
|
||||
t += src.format(A)
|
||||
t += "</FONT></PRE>"
|
||||
if(L.len > 0)
|
||||
t += "Area Eqp./Lgt./Env. Load Cell<HR>"
|
||||
for(var/obj/machinery/power/apc/A in L)
|
||||
t += src.format(A)
|
||||
t += "</FONT></PRE>"
|
||||
|
||||
popup.set_content(t)
|
||||
popup.open()
|
||||
popup.set_content(t)
|
||||
popup.open()
|
||||
|
||||
Topic(var/href, var/list/href_list)
|
||||
if(!interactable() || ..(href,href_list))
|
||||
return
|
||||
interact()
|
||||
/datum/file/program/powermon/Topic(var/href, var/list/href_list)
|
||||
if(!interactable() || ..(href,href_list))
|
||||
return
|
||||
interact()
|
||||
|
||||
@@ -17,88 +17,90 @@
|
||||
var/screen = 0 // 0 - No Access Denied, 1 - Access allowed
|
||||
|
||||
|
||||
interact()
|
||||
if(!interactable())
|
||||
return
|
||||
var/dat
|
||||
dat += "<B>Prisoner Implant Manager System</B><BR>"
|
||||
if(screen == 0)
|
||||
dat += "<HR><A href='?src=\ref[src];lock=1'>Unlock Console</A>"
|
||||
else if(screen == 1)
|
||||
dat += "<HR>Chemical Implants<BR>"
|
||||
var/turf/Tr = null
|
||||
for(var/obj/item/weapon/implant/chem/C in world)
|
||||
Tr = get_turf(C)
|
||||
if((Tr) && (Tr.z != computer.z)) continue//Out of range
|
||||
if(!C.implanted) continue
|
||||
dat += "[C.imp_in.name] | Remaining Units: [C.reagents.total_volume] | Inject: "
|
||||
dat += "<A href='?src=\ref[src];inject1=\ref[C]'>(<font color=red>(1)</font>)</A>"
|
||||
dat += "<A href='?src=\ref[src];inject5=\ref[C]'>(<font color=red>(5)</font>)</A>"
|
||||
dat += "<A href='?src=\ref[src];inject10=\ref[C]'>(<font color=red>(10)</font>)</A><BR>"
|
||||
dat += "********************************<BR>"
|
||||
dat += "<HR>Tracking Implants<BR>"
|
||||
for(var/obj/item/weapon/implant/tracking/T in world)
|
||||
Tr = get_turf(T)
|
||||
if((Tr) && (Tr.z != computer.z)) continue//Out of range
|
||||
if(!T.implanted) continue
|
||||
var/loc_display = "Unknown"
|
||||
var/mob/living/carbon/M = T.imp_in
|
||||
if(M.z in using_map.station_levels && !istype(M.loc, /turf/space))
|
||||
var/turf/mob_loc = get_turf(M)
|
||||
loc_display = mob_loc.loc
|
||||
if(T.malfunction)
|
||||
loc_display = pick(teleportlocs)
|
||||
dat += "ID: [T.id] | Location: [loc_display]<BR>"
|
||||
dat += "<A href='?src=\ref[src];warn=\ref[T]'>(<font color=red><i>Send Message</i></font>)</A> |<BR>"
|
||||
dat += "********************************<BR>"
|
||||
dat += "<HR><A href='?src=\ref[src];lock=1'>Lock Console</A>"
|
||||
|
||||
popup.width = 400
|
||||
popup.height = 500
|
||||
popup.set_content(dat)
|
||||
popup.set_title_image(usr.browse_rsc_icon(computer.icon, computer.icon_state))
|
||||
popup.open()
|
||||
/datum/file/program/prisoner/interact()
|
||||
if(!interactable())
|
||||
return
|
||||
var/dat
|
||||
dat += "<B>Prisoner Implant Manager System</B><BR>"
|
||||
if(screen == 0)
|
||||
dat += "<HR><A href='?src=\ref[src];lock=1'>Unlock Console</A>"
|
||||
else if(screen == 1)
|
||||
dat += "<HR>Chemical Implants<BR>"
|
||||
var/turf/Tr = null
|
||||
for(var/obj/item/weapon/implant/chem/C in all_chem_implants)
|
||||
Tr = get_turf(C)
|
||||
if((Tr) && (Tr.z != computer.z))
|
||||
continue //Out of range
|
||||
if(!C.implanted)
|
||||
continue
|
||||
dat += "[C.imp_in.name] | Remaining Units: [C.reagents.total_volume] | Inject: "
|
||||
dat += "<A href='?src=\ref[src];inject1=\ref[C]'>(<font color=red>(1)</font>)</A>"
|
||||
dat += "<A href='?src=\ref[src];inject5=\ref[C]'>(<font color=red>(5)</font>)</A>"
|
||||
dat += "<A href='?src=\ref[src];inject10=\ref[C]'>(<font color=red>(10)</font>)</A><BR>"
|
||||
dat += "********************************<BR>"
|
||||
dat += "<HR>Tracking Implants<BR>"
|
||||
for(var/obj/item/weapon/implant/tracking/T in all_tracking_implants)
|
||||
Tr = get_turf(T)
|
||||
if((Tr) && (Tr.z != computer.z))
|
||||
continue //Out of range
|
||||
if(!T.implanted)
|
||||
continue
|
||||
var/loc_display = "Unknown"
|
||||
var/mob/living/carbon/M = T.imp_in
|
||||
if(M.z in using_map.station_levels && !istype(M.loc, /turf/space))
|
||||
var/turf/mob_loc = get_turf(M)
|
||||
loc_display = mob_loc.loc
|
||||
if(T.malfunction)
|
||||
loc_display = pick(teleportlocs)
|
||||
dat += "ID: [T.id] | Location: [loc_display]<BR>"
|
||||
dat += "<A href='?src=\ref[src];warn=\ref[T]'>(<font color=red><i>Send Message</i></font>)</A> |<BR>"
|
||||
dat += "********************************<BR>"
|
||||
dat += "<HR><A href='?src=\ref[src];lock=1'>Lock Console</A>"
|
||||
|
||||
popup.width = 400
|
||||
popup.height = 500
|
||||
popup.set_content(dat)
|
||||
popup.set_title_image(usr.browse_rsc_icon(computer.icon, computer.icon_state))
|
||||
popup.open()
|
||||
return
|
||||
|
||||
process()
|
||||
if(!..())
|
||||
interact()
|
||||
return
|
||||
|
||||
|
||||
Topic(href, href_list)
|
||||
if(!interactable() || ..(href,href_list))
|
||||
return
|
||||
|
||||
if(href_list["inject1"])
|
||||
var/obj/item/weapon/implant/I = locate(href_list["inject1"])
|
||||
if(istype(I))
|
||||
I.activate(1)
|
||||
|
||||
else if(href_list["inject5"])
|
||||
var/obj/item/weapon/implant/I = locate(href_list["inject5"])
|
||||
if(istype(I))
|
||||
I.activate(5)
|
||||
|
||||
else if(href_list["inject10"])
|
||||
var/obj/item/weapon/implant/I = locate(href_list["inject10"])
|
||||
if(istype(I))
|
||||
I.activate(10)
|
||||
|
||||
else if(href_list["lock"])
|
||||
screen = !screen
|
||||
|
||||
else if(href_list["warn"])
|
||||
var/warning = sanitize(input(usr,"Message:","Enter your message here!",""))
|
||||
if(!warning) return
|
||||
var/obj/item/weapon/implant/I = locate(href_list["warn"])
|
||||
if( istype(I) && I.imp_in)
|
||||
var/mob/living/carbon/R = I.imp_in
|
||||
log_game("PrisonComputer3 message: [key_name(usr)]->[key_name(R)] : [warning]")
|
||||
R << "<span class='notice'>You hear a voice in your head saying: '[warning]'</span>"
|
||||
|
||||
/datum/file/program/prisoner/process()
|
||||
if(!..())
|
||||
interact()
|
||||
return
|
||||
|
||||
/datum/file/program/prisoner/Topic(href, href_list)
|
||||
if(!interactable() || ..(href,href_list))
|
||||
return
|
||||
|
||||
if(href_list["inject1"])
|
||||
var/obj/item/weapon/implant/I = locate(href_list["inject1"])
|
||||
if(istype(I))
|
||||
I.activate(1)
|
||||
|
||||
else if(href_list["inject5"])
|
||||
var/obj/item/weapon/implant/I = locate(href_list["inject5"])
|
||||
if(istype(I))
|
||||
I.activate(5)
|
||||
|
||||
else if(href_list["inject10"])
|
||||
var/obj/item/weapon/implant/I = locate(href_list["inject10"])
|
||||
if(istype(I))
|
||||
I.activate(10)
|
||||
|
||||
else if(href_list["lock"])
|
||||
screen = !screen
|
||||
|
||||
else if(href_list["warn"])
|
||||
var/warning = sanitize(input(usr,"Message:","Enter your message here!",""))
|
||||
if(!warning) return
|
||||
var/obj/item/weapon/implant/I = locate(href_list["warn"])
|
||||
if(istype(I) && I.imp_in)
|
||||
var/mob/living/carbon/R = I.imp_in
|
||||
log_game("PrisonComputer3 message: [key_name(usr)]->[key_name(R)] : [warning]")
|
||||
to_chat(R, "<span class='notice'>You hear a voice in your head saying: '[warning]'</span>")
|
||||
|
||||
interact()
|
||||
return
|
||||
|
||||
|
||||
|
||||
@@ -15,197 +15,196 @@
|
||||
var/screen = 0 // 0 - Main Menu, 1 - Cyborg Status, 2 - Kill 'em All! -- In text
|
||||
req_access = list(access_robotics)
|
||||
|
||||
proc/start_sequence()
|
||||
do
|
||||
if(src.stop)
|
||||
src.stop = 0
|
||||
return
|
||||
src.timeleft--
|
||||
sleep(10)
|
||||
while(src.timeleft)
|
||||
/datum/file/program/borg_control/proc/start_sequence()
|
||||
do
|
||||
if(src.stop)
|
||||
src.stop = 0
|
||||
return
|
||||
src.timeleft--
|
||||
sleep(10)
|
||||
while(src.timeleft)
|
||||
|
||||
for(var/mob/living/silicon/robot/R in mob_list)
|
||||
if(!R.scrambledcodes)
|
||||
R.self_destruct()
|
||||
for(var/mob/living/silicon/robot/R in mob_list)
|
||||
if(!R.scrambledcodes)
|
||||
R.self_destruct()
|
||||
return
|
||||
|
||||
|
||||
/datum/file/program/borg_control/interact()
|
||||
if(!interactable() || computer.z > 6)
|
||||
return
|
||||
var/dat
|
||||
if (src.temp)
|
||||
dat = "<TT>[src.temp]</TT><BR><BR><A href='?src=\ref[src];temp=1'>Clear Screen</A>"
|
||||
else
|
||||
if(screen == 0)
|
||||
//dat += "<h3>Cyborg Control Console</h3><BR>"
|
||||
dat += "<A href='?src=\ref[src];screen=1'>1. Cyborg Status</A><BR>"
|
||||
dat += "<A href='?src=\ref[src];screen=2'>2. Emergency Full Destruct</A><BR>"
|
||||
if(screen == 1)
|
||||
for(var/mob/living/silicon/robot/R in mob_list)
|
||||
if(istype(usr, /mob/living/silicon/ai))
|
||||
if (R.connected_ai != usr)
|
||||
continue
|
||||
if(istype(usr, /mob/living/silicon/robot))
|
||||
if (R != usr)
|
||||
continue
|
||||
if(R.scrambledcodes)
|
||||
continue
|
||||
|
||||
dat += "[R.name] |"
|
||||
if(R.stat)
|
||||
dat += " Not Responding |"
|
||||
else if (!R.canmove)
|
||||
dat += " Locked Down |"
|
||||
else
|
||||
dat += " Operating Normally |"
|
||||
if (!R.canmove)
|
||||
else if(R.cell)
|
||||
dat += " Battery Installed ([R.cell.charge]/[R.cell.maxcharge]) |"
|
||||
else
|
||||
dat += " No Cell Installed |"
|
||||
if(R.module)
|
||||
dat += " Module Installed ([R.module.name]) |"
|
||||
else
|
||||
dat += " No Module Installed |"
|
||||
if(R.connected_ai)
|
||||
dat += " Slaved to [R.connected_ai.name] |"
|
||||
else
|
||||
dat += " Independent from AI |"
|
||||
if (istype(usr, /mob/living/silicon))
|
||||
if(issilicon(usr) && is_special_character(usr) && !R.emagged)
|
||||
dat += "<A href='?src=\ref[src];magbot=\ref[R]'>(<i>Hack</i>)</A> "
|
||||
dat += "<A href='?src=\ref[src];stopbot=\ref[R]'>(<i>[R.canmove ? "Lockdown" : "Release"]</i>)</A> "
|
||||
dat += "<A href='?src=\ref[src];killbot=\ref[R]'>(<i>Destroy</i>)</A>"
|
||||
dat += "<BR>"
|
||||
dat += "<A href='?src=\ref[src];screen=0'>(Return to Main Menu)</A><BR>"
|
||||
if(screen == 2)
|
||||
if(!src.status)
|
||||
dat += {"<BR><B>Emergency Robot Self-Destruct</B><HR>\nStatus: Off<BR>
|
||||
\n<BR>
|
||||
\nCountdown: [src.timeleft]/60 <A href='?src=\ref[src];reset=1'>\[Reset\]</A><BR>
|
||||
\n<BR>
|
||||
\n<A href='?src=\ref[src];killall'>Start Sequence</A><BR>
|
||||
\n<BR>
|
||||
\n<A href='?src=\ref[usr];close'>Close</A>"}
|
||||
else
|
||||
dat = {"<B>Emergency Robot Self-Destruct</B><HR>\nStatus: Activated<BR>
|
||||
\n<BR>
|
||||
\nCountdown: [src.timeleft]/60 \[Reset\]<BR>
|
||||
\n<BR>\n<A href='?src=\ref[src];stop=1'>Stop Sequence</A><BR>
|
||||
\n<BR>
|
||||
\n<A href='?src=\ref[usr];mach_close=computer'>Close</A>"}
|
||||
dat += "<A href='?src=\ref[src];screen=0'>(Return to Main Menu)</A><BR>"
|
||||
popup.set_content(dat)
|
||||
popup.open()
|
||||
return
|
||||
|
||||
/datum/file/program/borg_control/Topic(var/href, var/list/href_list)
|
||||
if(!interactable() || ..(href,href_list))
|
||||
return
|
||||
|
||||
if("killall" in href_list)
|
||||
src.temp = {"Destroy Robots?<BR>
|
||||
<BR><B><A href='?src=\ref[src];do_killall'>\[Swipe ID to initiate destruction sequence\]</A></B><BR>
|
||||
<A href='?src=\ref[src];temp=1'>Cancel</A>"}
|
||||
|
||||
if("do_killall" in href_list)
|
||||
var/obj/item/weapon/card/id/I = usr.get_active_hand()
|
||||
if(istype(I, /obj/item/device/pda))
|
||||
var/obj/item/device/pda/pda = I
|
||||
I = pda.id
|
||||
if(istype(I))
|
||||
if(src.check_access(I))
|
||||
if(!status)
|
||||
message_admins("<span class='notice'>[key_name_admin(usr)] has initiated the global cyborg killswitch!</span>")
|
||||
log_game("[key_name(usr)] has initiated the global cyborg killswitch!")
|
||||
src.status = 1
|
||||
src.start_sequence()
|
||||
src.temp = null
|
||||
|
||||
else
|
||||
to_chat(usr, "<span class='warning'>Access Denied.</span>")
|
||||
|
||||
if("stop" in href_list)
|
||||
src.temp = {"
|
||||
Stop Robot Destruction Sequence?<BR>
|
||||
<BR><A href='?src=\ref[src];stop2=1'>Yes</A><BR>
|
||||
<A href='?src=\ref[src];temp=1'>No</A>"}
|
||||
|
||||
if("stop2" in href_list)
|
||||
src.stop = 1
|
||||
src.temp = null
|
||||
src.status = 0
|
||||
|
||||
if("reset" in href_list)
|
||||
src.timeleft = 60
|
||||
|
||||
if("temp" in href_list)
|
||||
src.temp = null
|
||||
if("screen" in href_list)
|
||||
switch(href_list["screen"])
|
||||
if("0")
|
||||
screen = 0
|
||||
if("1")
|
||||
screen = 1
|
||||
if("2")
|
||||
screen = 2
|
||||
if("killbot" in href_list)
|
||||
if(computer.allowed(usr))
|
||||
var/mob/living/silicon/robot/R = locate(href_list["killbot"])
|
||||
if(R)
|
||||
var/choice = input("Are you certain you wish to detonate [R.name]?") in list("Confirm", "Abort")
|
||||
if(choice == "Confirm")
|
||||
if(R && istype(R))
|
||||
if(R.mind && R.mind.special_role && R.emagged)
|
||||
to_chat(R, "Extreme danger. Termination codes detected. Scrambling security codes and automatic AI unlink triggered.")
|
||||
R.ResetSecurityCodes()
|
||||
|
||||
else
|
||||
message_admins("<span class='notice'>[key_name_admin(usr)] detonated [key_name(R.name)]!</span>")
|
||||
log_game("<span class='notice'>[key_name_admin(usr)] detonated [key_name(R.name)]!</span>")
|
||||
if(R.connected_ai)
|
||||
to_chat(R.connected_ai, "<br><br><span class='alert'>ALERT - Cyborg kill-switch activated: [R.name]</span><br>")
|
||||
R.self_destruct()
|
||||
else
|
||||
to_chat(usr, "<span class='warning'>Access Denied.</span>")
|
||||
|
||||
if("stopbot" in href_list)
|
||||
if(computer.allowed(usr))
|
||||
var/mob/living/silicon/robot/R = locate(href_list["stopbot"])
|
||||
if(R && istype(R)) // Extra sancheck because of input var references
|
||||
var/choice = input("Are you certain you wish to [R.canmove ? "lock down" : "release"] [R.name]?") in list("Confirm", "Abort")
|
||||
if(choice == "Confirm")
|
||||
if(R && istype(R))
|
||||
message_admins("<span class='notice'>[key_name_admin(usr)] [R.canmove ? "locked down" : "released"] [R.name]!</span>")
|
||||
log_game("[key_name(usr)] [R.canmove ? "locked down" : "released"] [key_name(R.name)]!")
|
||||
R.canmove = !R.canmove
|
||||
if(R.lockcharge)
|
||||
R.lockcharge = !R.lockcharge
|
||||
to_chat(R, "Your lockdown has been lifted!")
|
||||
else
|
||||
R.lockcharge = !R.lockcharge
|
||||
to_chat(R, "You have been locked down!")
|
||||
|
||||
else
|
||||
to_chat(usr, "<span class='warning'>Access Denied.</span>")
|
||||
|
||||
if ("magbot" in href_list)
|
||||
if(computer.allowed(usr))
|
||||
var/mob/living/silicon/robot/R = locate(href_list["magbot"])
|
||||
if(R)
|
||||
var/choice = input("Are you certain you wish to hack [R.name]?") in list("Confirm", "Abort")
|
||||
if(choice == "Confirm")
|
||||
if(R && istype(R))
|
||||
// message_admins("<span class='notice'>[key_name_admin(usr)] emagged [R.name] using robotic console!</span>") // why is this commented out?
|
||||
log_game("[key_name(usr)] emagged [R.name] using robotic console!")
|
||||
R.emagged = 1
|
||||
if(R.mind.special_role)
|
||||
R.verbs += /mob/living/silicon/robot/proc/ResetSecurityCodes
|
||||
|
||||
interact()
|
||||
if(!interactable() || computer.z > 6)
|
||||
return
|
||||
var/dat
|
||||
if (src.temp)
|
||||
dat = "<TT>[src.temp]</TT><BR><BR><A href='?src=\ref[src];temp=1'>Clear Screen</A>"
|
||||
else
|
||||
if(screen == 0)
|
||||
//dat += "<h3>Cyborg Control Console</h3><BR>"
|
||||
dat += "<A href='?src=\ref[src];screen=1'>1. Cyborg Status</A><BR>"
|
||||
dat += "<A href='?src=\ref[src];screen=2'>2. Emergency Full Destruct</A><BR>"
|
||||
if(screen == 1)
|
||||
for(var/mob/living/silicon/robot/R in mob_list)
|
||||
if(istype(usr, /mob/living/silicon/ai))
|
||||
if (R.connected_ai != usr)
|
||||
continue
|
||||
if(istype(usr, /mob/living/silicon/robot))
|
||||
if (R != usr)
|
||||
continue
|
||||
if(R.scrambledcodes)
|
||||
continue
|
||||
|
||||
dat += "[R.name] |"
|
||||
if(R.stat)
|
||||
dat += " Not Responding |"
|
||||
else if (!R.canmove)
|
||||
dat += " Locked Down |"
|
||||
else
|
||||
dat += " Operating Normally |"
|
||||
if (!R.canmove)
|
||||
else if(R.cell)
|
||||
dat += " Battery Installed ([R.cell.charge]/[R.cell.maxcharge]) |"
|
||||
else
|
||||
dat += " No Cell Installed |"
|
||||
if(R.module)
|
||||
dat += " Module Installed ([R.module.name]) |"
|
||||
else
|
||||
dat += " No Module Installed |"
|
||||
if(R.connected_ai)
|
||||
dat += " Slaved to [R.connected_ai.name] |"
|
||||
else
|
||||
dat += " Independent from AI |"
|
||||
if (istype(usr, /mob/living/silicon))
|
||||
if(issilicon(usr) && is_special_character(usr) && !R.emagged)
|
||||
dat += "<A href='?src=\ref[src];magbot=\ref[R]'>(<i>Hack</i>)</A> "
|
||||
dat += "<A href='?src=\ref[src];stopbot=\ref[R]'>(<i>[R.canmove ? "Lockdown" : "Release"]</i>)</A> "
|
||||
dat += "<A href='?src=\ref[src];killbot=\ref[R]'>(<i>Destroy</i>)</A>"
|
||||
dat += "<BR>"
|
||||
dat += "<A href='?src=\ref[src];screen=0'>(Return to Main Menu)</A><BR>"
|
||||
if(screen == 2)
|
||||
if(!src.status)
|
||||
dat += {"<BR><B>Emergency Robot Self-Destruct</B><HR>\nStatus: Off<BR>
|
||||
\n<BR>
|
||||
\nCountdown: [src.timeleft]/60 <A href='?src=\ref[src];reset=1'>\[Reset\]</A><BR>
|
||||
\n<BR>
|
||||
\n<A href='?src=\ref[src];killall'>Start Sequence</A><BR>
|
||||
\n<BR>
|
||||
\n<A href='?src=\ref[usr];close'>Close</A>"}
|
||||
else
|
||||
dat = {"<B>Emergency Robot Self-Destruct</B><HR>\nStatus: Activated<BR>
|
||||
\n<BR>
|
||||
\nCountdown: [src.timeleft]/60 \[Reset\]<BR>
|
||||
\n<BR>\n<A href='?src=\ref[src];stop=1'>Stop Sequence</A><BR>
|
||||
\n<BR>
|
||||
\n<A href='?src=\ref[usr];mach_close=computer'>Close</A>"}
|
||||
dat += "<A href='?src=\ref[src];screen=0'>(Return to Main Menu)</A><BR>"
|
||||
|
||||
popup.set_content(dat)
|
||||
popup.open()
|
||||
return
|
||||
|
||||
Topic(var/href, var/list/href_list)
|
||||
if(!interactable() || ..(href,href_list))
|
||||
return
|
||||
|
||||
if ("killall" in href_list)
|
||||
src.temp = {"Destroy Robots?<BR>
|
||||
<BR><B><A href='?src=\ref[src];do_killall'>\[Swipe ID to initiate destruction sequence\]</A></B><BR>
|
||||
<A href='?src=\ref[src];temp=1'>Cancel</A>"}
|
||||
|
||||
if ("do_killall" in href_list)
|
||||
var/obj/item/weapon/card/id/I = usr.get_active_hand()
|
||||
if (istype(I, /obj/item/device/pda))
|
||||
var/obj/item/device/pda/pda = I
|
||||
I = pda.id
|
||||
if (istype(I))
|
||||
if(src.check_access(I))
|
||||
if (!status)
|
||||
message_admins("<span class='notice'>[key_name_admin(usr)] has initiated the global cyborg killswitch!</span>")
|
||||
log_game("[key_name(usr)] has initiated the global cyborg killswitch!")
|
||||
src.status = 1
|
||||
src.start_sequence()
|
||||
src.temp = null
|
||||
|
||||
else
|
||||
usr << "<span class='warning'>Access Denied.</span>"
|
||||
|
||||
if ("stop" in href_list)
|
||||
src.temp = {"
|
||||
Stop Robot Destruction Sequence?<BR>
|
||||
<BR><A href='?src=\ref[src];stop2=1'>Yes</A><BR>
|
||||
<A href='?src=\ref[src];temp=1'>No</A>"}
|
||||
|
||||
if ("stop2" in href_list)
|
||||
src.stop = 1
|
||||
src.temp = null
|
||||
src.status = 0
|
||||
|
||||
if ("reset" in href_list)
|
||||
src.timeleft = 60
|
||||
|
||||
if ("temp" in href_list)
|
||||
src.temp = null
|
||||
if ("screen" in href_list)
|
||||
switch(href_list["screen"])
|
||||
if("0")
|
||||
screen = 0
|
||||
if("1")
|
||||
screen = 1
|
||||
if("2")
|
||||
screen = 2
|
||||
if ("killbot" in href_list)
|
||||
if(computer.allowed(usr))
|
||||
var/mob/living/silicon/robot/R = locate(href_list["killbot"])
|
||||
if(R)
|
||||
var/choice = input("Are you certain you wish to detonate [R.name]?") in list("Confirm", "Abort")
|
||||
if(choice == "Confirm")
|
||||
if(R && istype(R))
|
||||
if(R.mind && R.mind.special_role && R.emagged)
|
||||
R << "Extreme danger. Termination codes detected. Scrambling security codes and automatic AI unlink triggered."
|
||||
R.ResetSecurityCodes()
|
||||
|
||||
else
|
||||
message_admins("<span class='notice'>[key_name_admin(usr)] detonated [key_name(R.name)]!</span>")
|
||||
log_game("<span class='notice'>[key_name_admin(usr)] detonated [key_name(R.name)]!</span>")
|
||||
if(R.connected_ai)
|
||||
R.connected_ai << "<br><br><span class='alert'>ALERT - Cyborg kill-switch activated: [R.name]</span><br>"
|
||||
R.self_destruct()
|
||||
else
|
||||
usr << "<span class='warning'>Access Denied.</span>"
|
||||
|
||||
if ("stopbot" in href_list)
|
||||
if(computer.allowed(usr))
|
||||
var/mob/living/silicon/robot/R = locate(href_list["stopbot"])
|
||||
if(R && istype(R)) // Extra sancheck because of input var references
|
||||
var/choice = input("Are you certain you wish to [R.canmove ? "lock down" : "release"] [R.name]?") in list("Confirm", "Abort")
|
||||
if(choice == "Confirm")
|
||||
if(R && istype(R))
|
||||
message_admins("<span class='notice'>[key_name_admin(usr)] [R.canmove ? "locked down" : "released"] [R.name]!</span>")
|
||||
log_game("[key_name(usr)] [R.canmove ? "locked down" : "released"] [key_name(R.name)]!")
|
||||
R.canmove = !R.canmove
|
||||
if (R.lockcharge)
|
||||
R.lockcharge = !R.lockcharge
|
||||
R << "Your lockdown has been lifted!"
|
||||
else
|
||||
R.lockcharge = !R.lockcharge
|
||||
R << "You have been locked down!"
|
||||
|
||||
else
|
||||
usr << "<span class='warning'>Access Denied.</span>"
|
||||
|
||||
if ("magbot" in href_list)
|
||||
if(computer.allowed(usr))
|
||||
var/mob/living/silicon/robot/R = locate(href_list["magbot"])
|
||||
if(R)
|
||||
var/choice = input("Are you certain you wish to hack [R.name]?") in list("Confirm", "Abort")
|
||||
if(choice == "Confirm")
|
||||
if(R && istype(R))
|
||||
// message_admins("<span class='notice'>[key_name_admin(usr)] emagged [R.name] using robotic console!</span>") // why is this commented out?
|
||||
log_game("[key_name(usr)] emagged [R.name] using robotic console!")
|
||||
R.emagged = 1
|
||||
if(R.mind.special_role)
|
||||
R.verbs += /mob/living/silicon/robot/proc/ResetSecurityCodes
|
||||
|
||||
interact()
|
||||
return
|
||||
return
|
||||
|
||||
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -9,26 +9,26 @@
|
||||
image = 'icons/ntos/program.png'
|
||||
|
||||
|
||||
interact()
|
||||
usr.set_machine(src)
|
||||
if(!interactable())
|
||||
return
|
||||
var/dat = ""
|
||||
dat += "<center><span style='font-size:24pt'><b>Welcome to NTOS</b></span></center>"
|
||||
dat += "<center><span style='font-size:8pt'>Thank you for choosing NTOS, your gateway to the future of mobile computing technology, sponsored by [using_map.company_name] (R)</span></center><br>"
|
||||
dat += "<span style='font-size:12pt'><b>Getting started with NTOS:</b></span><br>"
|
||||
dat += "To leave a current program, click the X button in the top right corner of the window. This will return you to the NTOS desktop. \
|
||||
From the desktop, you can open the hard drive, usually located in the top left corner to access all the programs installed on your computer. \
|
||||
When you rented your laptop, you were supplied with programs that your [using_map.company_name] Issued ID has given you access to use. \
|
||||
In the event of a serious error, the right click menu will give you the ability to reset your computer. To open and close your laptop, alt-click your device.\
|
||||
If you have any questions or technical issues, please contact your local computer technical experts at your local [using_map.boss_name]."
|
||||
popup.set_content(dat)
|
||||
popup.set_title_image(usr.browse_rsc_icon(computer.icon, computer.icon_state))
|
||||
popup.open()
|
||||
/datum/file/program/welcome/interact()
|
||||
usr.set_machine(src)
|
||||
if(!interactable())
|
||||
return
|
||||
var/dat = ""
|
||||
dat += "<center><span style='font-size:24pt'><b>Welcome to NTOS</b></span></center>"
|
||||
dat += "<center><span style='font-size:8pt'>Thank you for choosing NTOS, your gateway to the future of mobile computing technology, sponsored by [using_map.company_name] (R)</span></center><br>"
|
||||
dat += "<span style='font-size:12pt'><b>Getting started with NTOS:</b></span><br>"
|
||||
dat += "To leave a current program, click the X button in the top right corner of the window. This will return you to the NTOS desktop. \
|
||||
From the desktop, you can open the hard drive, usually located in the top left corner to access all the programs installed on your computer. \
|
||||
When you rented your laptop, you were supplied with programs that your [using_map.company_name] Issued ID has given you access to use. \
|
||||
In the event of a serious error, the right click menu will give you the ability to reset your computer. To open and close your laptop, alt-click your device.\
|
||||
If you have any questions or technical issues, please contact your local computer technical experts at your local [using_map.boss_name]."
|
||||
popup.set_content(dat)
|
||||
popup.set_title_image(usr.browse_rsc_icon(computer.icon, computer.icon_state))
|
||||
popup.open()
|
||||
return
|
||||
|
||||
Topic(href, href_list)
|
||||
if(!interactable() || ..(href,href_list))
|
||||
return
|
||||
interact()
|
||||
return
|
||||
/datum/file/program/welcome/Topic(href, href_list)
|
||||
if(!interactable() || ..(href,href_list))
|
||||
return
|
||||
interact()
|
||||
return
|
||||
@@ -17,49 +17,49 @@
|
||||
var/drm = 0 // Copy protection, called by copy() and move()
|
||||
var/readonly = 0 // Edit protection, called by edit(), which is just a failcheck proc
|
||||
|
||||
proc/execute(var/datum/file/source)
|
||||
return
|
||||
/datum/file/proc/execute(var/datum/file/source)
|
||||
return
|
||||
|
||||
//
|
||||
// Copy file to device.
|
||||
// If you overwrite this function, use the return value to make sure it succeeded
|
||||
//
|
||||
proc/copy(var/obj/item/part/computer/storage/dest)
|
||||
if(!computer) return null
|
||||
if(drm)
|
||||
if(!computer.emagged)
|
||||
return null
|
||||
var/datum/file/F = new type()
|
||||
if(!dest.addfile(F))
|
||||
return null // todo: arf here even though the player can't do a damn thing due to concurrency
|
||||
return F
|
||||
|
||||
//
|
||||
// Move file to device
|
||||
// Returns null on failure even though the existing file doesn't go away
|
||||
//
|
||||
proc/move(var/obj/item/part/computer/storage/dest)
|
||||
if(!computer) return null
|
||||
if(drm)
|
||||
if(!computer.emagged)
|
||||
return null
|
||||
var/obj/item/part/computer/storage/current = device
|
||||
if(!dest.addfile(src))
|
||||
//
|
||||
// Copy file to device.
|
||||
// If you overwrite this function, use the return value to make sure it succeeded
|
||||
//
|
||||
/datum/file/proc/copy(var/obj/item/part/computer/storage/dest)
|
||||
if(!computer) return null
|
||||
if(drm)
|
||||
if(!computer.emagged)
|
||||
return null
|
||||
current.removefile(src)
|
||||
return src
|
||||
var/datum/file/F = new type()
|
||||
if(!dest.addfile(F))
|
||||
return null // todo: arf here even though the player can't do a damn thing due to concurrency
|
||||
return F
|
||||
|
||||
//
|
||||
// Determines if the file is editable. This does not use the DRM flag,
|
||||
// but instead the readonly flag.
|
||||
//
|
||||
//
|
||||
// Move file to device
|
||||
// Returns null on failure even though the existing file doesn't go away
|
||||
//
|
||||
/datum/file/proc/move(var/obj/item/part/computer/storage/dest)
|
||||
if(!computer) return null
|
||||
if(drm)
|
||||
if(!computer.emagged)
|
||||
return null
|
||||
var/obj/item/part/computer/storage/current = device
|
||||
if(!dest.addfile(src))
|
||||
return null
|
||||
current.removefile(src)
|
||||
return src
|
||||
|
||||
proc/edit()
|
||||
if(!computer)
|
||||
return 0
|
||||
if(readonly && !computer.emagged)
|
||||
return 0 //
|
||||
return 1
|
||||
//
|
||||
// Determines if the file is editable. This does not use the DRM flag,
|
||||
// but instead the readonly flag.
|
||||
//
|
||||
|
||||
/datum/file/proc/edit()
|
||||
if(!computer)
|
||||
return 0
|
||||
if(readonly && !computer.emagged)
|
||||
return 0
|
||||
return 1
|
||||
|
||||
/*
|
||||
CentCom root authorization certificate
|
||||
@@ -84,23 +84,23 @@
|
||||
var/file_increment = 1
|
||||
var/binary = 0 // determines if the file can't be opened by editor
|
||||
|
||||
// Set the content to a specific amount, increase filesize appropriately.
|
||||
proc/set_content(var/text)
|
||||
content = text
|
||||
/datum/file/data/New()
|
||||
if(content)
|
||||
if(file_increment > 1)
|
||||
volume = round(file_increment * length(text))
|
||||
volume = round(file_increment * length(content))
|
||||
..()
|
||||
|
||||
copy(var/obj/O)
|
||||
var/datum/file/data/D = ..(O)
|
||||
if(D)
|
||||
D.content = content
|
||||
D.readonly = readonly
|
||||
// Set the content to a specific amount, increase filesize appropriately.
|
||||
/datum/file/data/proc/set_content(var/text)
|
||||
content = text
|
||||
if(file_increment > 1)
|
||||
volume = round(file_increment * length(text))
|
||||
|
||||
New()
|
||||
if(content)
|
||||
if(file_increment > 1)
|
||||
volume = round(file_increment * length(content))
|
||||
..()
|
||||
/datum/file/data/copy(var/obj/O)
|
||||
var/datum/file/data/D = ..(O)
|
||||
if(D)
|
||||
D.content = content
|
||||
D.readonly = readonly
|
||||
|
||||
/*
|
||||
A generic file that contains text
|
||||
|
||||
@@ -28,42 +28,41 @@
|
||||
|
||||
var/obj/machinery/computer3/laptop/stored_computer = null
|
||||
|
||||
verb/open_computer()
|
||||
set name = "Open Laptop"
|
||||
set category = "Object"
|
||||
set src in view(1)
|
||||
/obj/item/device/laptop/verb/open_computer()
|
||||
set name = "Open Laptop"
|
||||
set category = "Object"
|
||||
set src in view(1)
|
||||
|
||||
if(usr.stat || usr.restrained() || usr.lying || !istype(usr, /mob/living))
|
||||
usr << "<span class='warning'>You can't do that.</span>"
|
||||
return
|
||||
if(usr.stat || usr.restrained() || usr.lying || !istype(usr, /mob/living))
|
||||
to_chat(usr, "<span class='warning'>You can't do that.</span>")
|
||||
return
|
||||
|
||||
if(!Adjacent(usr))
|
||||
usr << "You can't reach it."
|
||||
return
|
||||
if(!Adjacent(usr))
|
||||
to_chat(usr, "You can't reach it.")
|
||||
return
|
||||
|
||||
if(!istype(loc,/turf))
|
||||
usr << "[src] is too bulky! You'll have to set it down."
|
||||
return
|
||||
if(!istype(loc,/turf))
|
||||
to_chat(usr, "[src] is too bulky! You'll have to set it down.")
|
||||
return
|
||||
|
||||
if(!stored_computer)
|
||||
if(contents.len)
|
||||
for(var/obj/O in contents)
|
||||
O.loc = loc
|
||||
usr << "\The [src] crumbles to pieces."
|
||||
spawn(5)
|
||||
qdel(src)
|
||||
return
|
||||
if(!stored_computer)
|
||||
if(contents.len)
|
||||
for(var/obj/O in contents)
|
||||
O.loc = loc
|
||||
to_chat(usr, "\The [src] crumbles to pieces.")
|
||||
spawn(5)
|
||||
qdel(src)
|
||||
return
|
||||
|
||||
stored_computer.loc = loc
|
||||
stored_computer.stat &= ~MAINT
|
||||
stored_computer.update_icon()
|
||||
loc = stored_computer
|
||||
usr << "You open \the [src]."
|
||||
stored_computer.loc = loc
|
||||
stored_computer.stat &= ~MAINT
|
||||
stored_computer.update_icon()
|
||||
loc = stored_computer
|
||||
to_chat(usr, "You open \the [src].")
|
||||
|
||||
|
||||
AltClick()
|
||||
if(Adjacent(usr))
|
||||
open_computer()
|
||||
/obj/item/device/laptop/AltClick()
|
||||
if(Adjacent(usr))
|
||||
open_computer()
|
||||
|
||||
//Quickfix until Snapshot works out how he wants to redo power. ~Z
|
||||
/obj/item/device/laptop/verb/eject_id()
|
||||
@@ -73,6 +72,7 @@
|
||||
|
||||
if(stored_computer)
|
||||
stored_computer.eject_id()
|
||||
|
||||
/obj/machinery/computer3/laptop/verb/eject_id()
|
||||
set category = "Object"
|
||||
set name = "Eject ID Card"
|
||||
@@ -80,21 +80,11 @@
|
||||
var/obj/item/part/computer/cardslot/C = locate() in src.contents
|
||||
|
||||
if(!C)
|
||||
usr << "There is no card port on the laptop."
|
||||
to_chat(usr, "There is no card port on the laptop.")
|
||||
return
|
||||
|
||||
var/obj/item/weapon/card/id/card
|
||||
if(C.reader)
|
||||
card = C.reader
|
||||
else if(C.writer)
|
||||
card = C.writer
|
||||
else
|
||||
usr << "There is nothing to remove from the laptop card port."
|
||||
return
|
||||
|
||||
usr << "You remove [card] from the laptop."
|
||||
C.remove(4)
|
||||
|
||||
C.remove(usr)
|
||||
return
|
||||
|
||||
/obj/machinery/computer3/laptop
|
||||
name = "Laptop Computer"
|
||||
@@ -110,81 +100,81 @@
|
||||
|
||||
var/obj/item/device/laptop/portable = null
|
||||
|
||||
New(var/L, var/built = 0)
|
||||
if(!built && !battery)
|
||||
battery = new /obj/item/weapon/cell(src)
|
||||
battery.maxcharge = 500
|
||||
battery.charge = 500
|
||||
..(L,built)
|
||||
/obj/machinery/computer3/laptop/New(var/L, var/built = 0)
|
||||
if(!built && !battery)
|
||||
battery = new /obj/item/weapon/cell(src)
|
||||
battery.maxcharge = 500
|
||||
battery.charge = 500
|
||||
..(L,built)
|
||||
|
||||
verb/close_computer()
|
||||
set name = "Close Laptop"
|
||||
set category = "Object"
|
||||
set src in view(1)
|
||||
/obj/machinery/computer3/laptop/verb/close_computer()
|
||||
set name = "Close Laptop"
|
||||
set category = "Object"
|
||||
set src in view(1)
|
||||
|
||||
if(usr.stat || usr.restrained() || usr.lying || !istype(usr, /mob/living))
|
||||
usr << "<span class='warning'>You can't do that.</span>"
|
||||
return
|
||||
if(usr.stat || usr.restrained() || usr.lying || !istype(usr, /mob/living))
|
||||
to_chat(usr, "<span class='warning'>You can't do that.</span>")
|
||||
return
|
||||
|
||||
if(!Adjacent(usr))
|
||||
usr << "<span class='warning'>You can't reach it.</span>"
|
||||
return
|
||||
if(!Adjacent(usr))
|
||||
to_chat(usr, "<span class='warning'>You can't reach it.</span>")
|
||||
return
|
||||
|
||||
close_laptop(usr)
|
||||
close_laptop(usr)
|
||||
|
||||
proc/close_laptop(mob/user = null)
|
||||
if(istype(loc,/obj/item/device/laptop))
|
||||
testing("Close closed computer")
|
||||
return
|
||||
if(!istype(loc,/turf))
|
||||
testing("Odd computer location: [loc] - close laptop")
|
||||
return
|
||||
/obj/machinery/computer3/laptop/proc/close_laptop(mob/user = null)
|
||||
if(istype(loc,/obj/item/device/laptop))
|
||||
testing("Close closed computer")
|
||||
return
|
||||
if(!istype(loc,/turf))
|
||||
testing("Odd computer location: [loc] - close laptop")
|
||||
return
|
||||
|
||||
if(stat&BROKEN)
|
||||
if(user)
|
||||
user << "\The [src] is broken! You can't quite get it closed."
|
||||
return
|
||||
|
||||
if(!portable)
|
||||
portable=new
|
||||
portable.stored_computer = src
|
||||
|
||||
portable.loc = loc
|
||||
loc = portable
|
||||
stat |= MAINT
|
||||
if(stat&BROKEN)
|
||||
if(user)
|
||||
user << "You close \the [src]."
|
||||
to_chat(user, "\The [src] is broken! You can't quite get it closed.")
|
||||
return
|
||||
|
||||
auto_use_power()
|
||||
if(stat&MAINT)
|
||||
return
|
||||
if(use_power && istype(battery) && battery.charge > 0)
|
||||
if(use_power == 1)
|
||||
battery.use(idle_power_usage*CELLRATE) //idle and active_power_usage are in WATTS. battery.use() expects CHARGE.
|
||||
else
|
||||
battery.use(active_power_usage*CELLRATE)
|
||||
return 1
|
||||
return 0
|
||||
if(!portable)
|
||||
portable=new
|
||||
portable.stored_computer = src
|
||||
|
||||
use_power(var/amount, var/chan = -1)
|
||||
if(battery && battery.charge > 0)
|
||||
battery.use(amount*CELLRATE)
|
||||
portable.loc = loc
|
||||
loc = portable
|
||||
stat |= MAINT
|
||||
if(user)
|
||||
to_chat(user, "You close \the [src].")
|
||||
|
||||
power_change()
|
||||
if( !battery || battery.charge <= 0 )
|
||||
stat |= NOPOWER
|
||||
/obj/machinery/computer3/laptop/auto_use_power()
|
||||
if(stat&MAINT)
|
||||
return
|
||||
if(use_power && istype(battery) && battery.charge > 0)
|
||||
if(use_power == 1)
|
||||
battery.use(idle_power_usage*CELLRATE) //idle and active_power_usage are in WATTS. battery.use() expects CHARGE.
|
||||
else
|
||||
stat &= ~NOPOWER
|
||||
battery.use(active_power_usage*CELLRATE)
|
||||
return 1
|
||||
return 0
|
||||
|
||||
Destroy()
|
||||
if(istype(loc,/obj/item/device/laptop))
|
||||
var/obj/O = loc
|
||||
spawn(5)
|
||||
if(O)
|
||||
qdel(O)
|
||||
..()
|
||||
/obj/machinery/computer3/laptop/use_power(var/amount, var/chan = -1)
|
||||
if(battery && battery.charge > 0)
|
||||
battery.use(amount*CELLRATE)
|
||||
|
||||
/obj/machinery/computer3/laptop/power_change()
|
||||
if( !battery || battery.charge <= 0 )
|
||||
stat |= NOPOWER
|
||||
else
|
||||
stat &= ~NOPOWER
|
||||
|
||||
/obj/machinery/computer3/laptop/Destroy()
|
||||
if(istype(loc,/obj/item/device/laptop))
|
||||
var/obj/O = loc
|
||||
spawn(5)
|
||||
if(O)
|
||||
qdel(O)
|
||||
..()
|
||||
|
||||
|
||||
AltClick()
|
||||
if(Adjacent(usr))
|
||||
close_computer()
|
||||
/obj/machinery/computer3/laptop/AltClick()
|
||||
if(Adjacent(usr))
|
||||
close_computer()
|
||||
|
||||
@@ -47,7 +47,7 @@
|
||||
usr.drop_item()
|
||||
L.loc = src
|
||||
vendmode = 2
|
||||
usr << "<span class='notice'>You slot your [L.name] into \The [src.name]</span>"
|
||||
to_chat(user, "<span class='notice'>You slot your [L.name] into \The [src.name]</span>")
|
||||
nanomanager.update_uis(src)
|
||||
else
|
||||
..()
|
||||
@@ -169,7 +169,7 @@
|
||||
visible_message("<span class='info'>\The [usr] swipes \the [I] through \the [src].</span>")
|
||||
var/datum/money_account/CH = get_account(C.associated_account_number)
|
||||
if(!CH)
|
||||
usr << "\icon[src]<span class='warning'>No valid account number is associated with this card.</span>"
|
||||
to_chat(usr, "\icon[src]<span class='warning'>No valid account number is associated with this card.</span>")
|
||||
return
|
||||
if(CH.security_level != 0) //If card requires pin authentication (ie seclevel 1 or 2)
|
||||
if(vendor_account)
|
||||
@@ -178,9 +178,9 @@
|
||||
if(D)
|
||||
transfer_and_vend(D, C)
|
||||
else
|
||||
usr << "\icon[src]<span class='warning'>Unable to access vendor account. Please record the machine ID and call [using_map.boss_short] Support.</span>"
|
||||
to_chat(usr, "\icon[src]<span class='warning'>Unable to access vendor account. Please record the machine ID and call [using_map.boss_short] Support.</span>")
|
||||
else
|
||||
usr << "\icon[src]<span class='warning'>Unable to access vendor account. Please record the machine ID and call [using_map.boss_short] Support.</span>"
|
||||
to_chat(usr, "\icon[src]<span class='warning'>Unable to access vendor account. Please record the machine ID and call [using_map.boss_short] Support.</span>")
|
||||
else
|
||||
transfer_and_vend(CH, C)
|
||||
|
||||
@@ -228,7 +228,7 @@
|
||||
network = 0
|
||||
power = 0
|
||||
else
|
||||
usr << "\icon[src]<span class='warning'>You don't have that much money!</span>"
|
||||
to_chat(usr, "\icon[src]<span class='warning'>You don't have that much money!</span>")
|
||||
|
||||
/obj/machinery/lapvend/proc/total()
|
||||
var/total = 0
|
||||
@@ -317,7 +317,7 @@
|
||||
visible_message("<span class='info'>\The [usr] swipes \the [I] through \the [src].</span>")
|
||||
var/datum/money_account/CH = get_account(C.associated_account_number)
|
||||
if(!CH)
|
||||
usr << "\icon[src]<span class='warning'>No valid account number is associated with this card.</span>"
|
||||
to_chat(usr, "\icon[src]<span class='warning'>No valid account number is associated with this card.</span>")
|
||||
return 0
|
||||
if(CH.security_level != 0) //If card requires pin authentication (ie seclevel 1 or 2)
|
||||
if(vendor_account)
|
||||
@@ -327,10 +327,10 @@
|
||||
transfer_and_reimburse(D)
|
||||
return 1
|
||||
else
|
||||
usr << "\icon[src]<span class='warning'>Unable to access vendor account. Please record the machine ID and call [using_map.boss_short] Support.</span>"
|
||||
to_chat(usr, "\icon[src]<span class='warning'>Unable to access vendor account. Please record the machine ID and call [using_map.boss_short] Support.</span>")
|
||||
return 0
|
||||
else
|
||||
usr << "\icon[src]<span class='warning'>Unable to access vendor account. Please record the machine ID and call [using_map.boss_short] Support.</span>"
|
||||
to_chat(usr, "\icon[src]<span class='warning'>Unable to access vendor account. Please record the machine ID and call [using_map.boss_short] Support.</span>")
|
||||
return 0
|
||||
else
|
||||
transfer_and_reimburse(CH)
|
||||
|
||||
@@ -1,58 +1,60 @@
|
||||
/obj/item/part/computer/networking
|
||||
name = "Computer networking component"
|
||||
|
||||
/*
|
||||
This is the public-facing proc used by NETUP.
|
||||
It does additional checking before and after calling get_machines()
|
||||
/obj/item/part/computer/networking/allow_attackby(var/obj/item/I, var/mob/user)
|
||||
return 0
|
||||
|
||||
*/
|
||||
proc/connect_to(var/typekey,var/atom/previous)
|
||||
if(!computer || computer.stat)
|
||||
/*
|
||||
This is the public-facing proc used by NETUP.
|
||||
It does additional checking before and after calling get_machines()
|
||||
*/
|
||||
/obj/item/part/computer/networking/proc/connect_to(var/typekey,var/atom/previous)
|
||||
if(!computer || computer.stat)
|
||||
return null
|
||||
|
||||
if(istype(previous,typekey) && verify_machine(previous))
|
||||
return previous
|
||||
|
||||
var/result = get_machines(typekey)
|
||||
|
||||
if(!result)
|
||||
return null
|
||||
|
||||
if(islist(result))
|
||||
var/list/R = result
|
||||
if(R.len == 0)
|
||||
return null
|
||||
else if(R.len == 1)
|
||||
return R[1]
|
||||
else
|
||||
var/list/atomlist = computer.format_atomlist(R)
|
||||
result = input("Select:","Multiple destination machines located",atomlist[1]) as null|anything in atomlist
|
||||
return atomlist[result]
|
||||
|
||||
if(istype(previous,typekey) && verify_machine(previous))
|
||||
return previous
|
||||
if(isobj(result))
|
||||
return result
|
||||
|
||||
var/result = get_machines(typekey)
|
||||
return null // ?
|
||||
|
||||
if(!result)
|
||||
return null
|
||||
/*
|
||||
This one is used to determine the candidate machines.
|
||||
It may return an object, a list of objects, or null.
|
||||
|
||||
if(islist(result))
|
||||
var/list/R = result
|
||||
if(R.len == 0)
|
||||
return null
|
||||
else if(R.len == 1)
|
||||
return R[1]
|
||||
else
|
||||
var/list/atomlist = computer.format_atomlist(R)
|
||||
result = input("Select:","Multiple destination machines located",atomlist[1]) as null|anything in atomlist
|
||||
return atomlist[result]
|
||||
Overwite this on any networking component.
|
||||
*/
|
||||
/obj/item/part/computer/networking/proc/get_machines(var/typekey)
|
||||
return list()
|
||||
|
||||
if(isobj(result))
|
||||
return result
|
||||
/*
|
||||
This is used to verify that an existing machine is within the network.
|
||||
Calling NETUP() with an object argument will run this check, and if
|
||||
the object is still accessible, it will be used. Otherwise, another
|
||||
search will be run.
|
||||
|
||||
return null // ?
|
||||
|
||||
/*
|
||||
This one is used to determine the candidate machines.
|
||||
It may return an object, a list of objects, or null.
|
||||
|
||||
Overwite this on any networking component.
|
||||
*/
|
||||
proc/get_machines(var/typekey)
|
||||
return list()
|
||||
|
||||
/*
|
||||
This is used to verify that an existing machine is within the network.
|
||||
Calling NETUP() with an object argument will run this check, and if
|
||||
the object is still accessible, it will be used. Otherwise, another
|
||||
search will be run.
|
||||
|
||||
Overwrite this on any networking component.
|
||||
*/
|
||||
proc/verify_machine(var/obj/previous)
|
||||
return 0
|
||||
Overwrite this on any networking component.
|
||||
*/
|
||||
/obj/item/part/computer/networking/proc/verify_machine(var/obj/previous)
|
||||
return 0
|
||||
|
||||
/*
|
||||
Provides radio/signaler functionality, and also
|
||||
@@ -69,56 +71,58 @@
|
||||
var/range = null
|
||||
var/subspace = 0
|
||||
|
||||
init()
|
||||
..()
|
||||
spawn(5)
|
||||
radio_connection = radio_controller.add_object(src, src.frequency, src.rad_filter)
|
||||
/obj/item/part/computer/networking/radio/init()
|
||||
..()
|
||||
spawn(5)
|
||||
radio_connection = radio_controller.add_object(src, src.frequency, src.rad_filter)
|
||||
|
||||
proc/set_frequency(new_frequency)
|
||||
if(radio_controller)
|
||||
radio_controller.remove_object(src, frequency)
|
||||
frequency = new_frequency
|
||||
radio_connection = radio_controller.add_object(src, frequency, rad_filter)
|
||||
else
|
||||
frequency = new_frequency
|
||||
spawn(rand(5,10))
|
||||
set_frequency(new_frequency)
|
||||
/obj/item/part/computer/networking/radio/proc/set_frequency(new_frequency)
|
||||
if(radio_controller)
|
||||
radio_controller.remove_object(src, frequency)
|
||||
frequency = new_frequency
|
||||
radio_connection = radio_controller.add_object(src, frequency, rad_filter)
|
||||
else
|
||||
frequency = new_frequency
|
||||
spawn(rand(5,10))
|
||||
set_frequency(new_frequency)
|
||||
|
||||
receive_signal(var/datum/signal/signal)
|
||||
if(!signal || !computer || (computer.stat&~MAINT)) // closed laptops use maint, allow it
|
||||
return
|
||||
if(computer.program)
|
||||
computer.program.receive_signal(signal)
|
||||
/obj/item/part/computer/networking/radio/receive_signal(var/datum/signal/signal)
|
||||
if(!signal || !computer || (computer.stat&~MAINT)) // closed laptops use maint, allow it
|
||||
return
|
||||
if(computer.program)
|
||||
computer.program.receive_signal(signal)
|
||||
|
||||
proc/post_signal(var/datum/signal/signal)
|
||||
if(!computer || (computer.stat&~MAINT) || !computer.program) return
|
||||
if(!radio_connection) return
|
||||
/obj/item/part/computer/networking/radio/proc/post_signal(var/datum/signal/signal)
|
||||
if(!computer || (computer.stat&~MAINT) || !computer.program)
|
||||
return
|
||||
if(!radio_connection)
|
||||
return
|
||||
radio_connection.post_signal(src,signal,rad_filter,range)
|
||||
|
||||
radio_connection.post_signal(src,signal,rad_filter,range)
|
||||
/obj/item/part/computer/networking/radio/get_machines(var/typekey)
|
||||
if(!radio_connection || !radio_connection.frequency)
|
||||
return list()
|
||||
var/list/result = list()
|
||||
var/turf/T = get_turf(loc)
|
||||
var/z_level = T.z
|
||||
for(var/obj/O in radio_connection.devices)
|
||||
if(istype(O,typekey))
|
||||
T = get_turf(O)
|
||||
if(istype(O) && (subspace || (O.z == z_level))) // radio does not work across z-levels
|
||||
result |= O
|
||||
return result
|
||||
|
||||
get_machines(var/typekey)
|
||||
if(!radio_connection || !radio_connection.frequency)
|
||||
return list()
|
||||
var/list/result = list()
|
||||
/obj/item/part/computer/networking/radio/verify_machine(var/obj/previous)
|
||||
if(!previous)
|
||||
return 0
|
||||
if(subspace)
|
||||
return ( radio_connection && (previous in radio_connection.devices) )
|
||||
else
|
||||
var/turf/T = get_turf(loc)
|
||||
var/z_level = T.z
|
||||
for(var/obj/O in radio_connection.devices)
|
||||
if(istype(O,typekey))
|
||||
T = get_turf(O)
|
||||
if(istype(O) && (subspace || (O.z == z_level))) // radio does not work across z-levels
|
||||
result |= O
|
||||
return result
|
||||
|
||||
verify_machine(var/obj/previous)
|
||||
if(!previous) return 0
|
||||
if(subspace)
|
||||
return ( radio_connection && (previous in radio_connection.devices) )
|
||||
else
|
||||
var/turf/T = get_turf(loc)
|
||||
var/turf/O = get_turf(previous)
|
||||
if(!T || !O)
|
||||
return 0
|
||||
return ( radio_connection && (previous in radio_connection.devices) && (T.z == O.z))
|
||||
var/turf/O = get_turf(previous)
|
||||
if(!T || !O)
|
||||
return 0
|
||||
return ( radio_connection && (previous in radio_connection.devices) && (T.z == O.z))
|
||||
|
||||
/*
|
||||
Subspace networking: Communicates off-station. Allows centcom communications.
|
||||
@@ -136,23 +140,24 @@
|
||||
name = "short-wave networking terminal"
|
||||
desc = "Connects to nearby computers through the area power network"
|
||||
|
||||
get_machines(var/typekey)
|
||||
var/area/A = get_area(loc)
|
||||
if(!istype(A) || A == /area)
|
||||
return list()
|
||||
if(typekey == null)
|
||||
typekey = /obj/machinery
|
||||
var/list/machines = list()
|
||||
for(var/obj/O in A.contents)
|
||||
if(istype(O,typekey))
|
||||
machines |= O
|
||||
return machines
|
||||
verify_machine(var/obj/previous)
|
||||
if(!previous) return 0
|
||||
var/area/A = get_area(src)
|
||||
if( A && A == get_area(previous) )
|
||||
return 1
|
||||
return 0
|
||||
/obj/item/part/computer/networking/area/get_machines(var/typekey)
|
||||
var/area/A = get_area(loc)
|
||||
if(!istype(A) || A == /area)
|
||||
return list()
|
||||
if(typekey == null)
|
||||
typekey = /obj/machinery
|
||||
var/list/machines = list()
|
||||
for(var/obj/O in A.contents)
|
||||
if(istype(O,typekey))
|
||||
machines |= O
|
||||
return machines
|
||||
|
||||
/obj/item/part/computer/networking/area/verify_machine(var/obj/previous)
|
||||
if(!previous) return 0
|
||||
var/area/A = get_area(src)
|
||||
if( A && A == get_area(previous) )
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/*
|
||||
Proximity networking: Connects to machines or computers adjacent to this device
|
||||
@@ -161,78 +166,78 @@
|
||||
name = "proximity networking terminal"
|
||||
desc = "Connects a computer to adjacent machines"
|
||||
|
||||
get_machines(var/typekey)
|
||||
var/turf/T = get_turf(loc)
|
||||
if(!istype(T))
|
||||
return list()
|
||||
if(typekey == null)
|
||||
typekey = /obj/machinery
|
||||
var/list/machines = list()
|
||||
for(var/obj/O in T)
|
||||
/obj/item/part/computer/networking/prox/get_machines(var/typekey)
|
||||
var/turf/T = get_turf(loc)
|
||||
if(!istype(T))
|
||||
return list()
|
||||
if(typekey == null)
|
||||
typekey = /obj/machinery
|
||||
var/list/machines = list()
|
||||
for(var/obj/O in T)
|
||||
if(istype(O,typekey))
|
||||
machines += O
|
||||
for(var/d in cardinal)
|
||||
var/turf/T2 = get_step(T,d)
|
||||
for(var/obj/O in T2)
|
||||
if(istype(O,typekey))
|
||||
machines += O
|
||||
for(var/d in cardinal)
|
||||
var/turf/T2 = get_step(T,d)
|
||||
for(var/obj/O in T2)
|
||||
if(istype(O,typekey))
|
||||
machines += O
|
||||
return machines
|
||||
return machines
|
||||
|
||||
verify_machine(var/obj/previous)
|
||||
if(!previous)
|
||||
return 0
|
||||
if(get_dist(get_turf(previous),get_turf(loc)) == 1)
|
||||
return 1
|
||||
/obj/item/part/computer/networking/prox/verify_machine(var/obj/previous)
|
||||
if(!previous)
|
||||
return 0
|
||||
if(get_dist(get_turf(previous),get_turf(loc)) == 1)
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/*
|
||||
Cable networking: Not currently used
|
||||
*/
|
||||
|
||||
/obj/item/part/computer/networking/cable
|
||||
name = "cable networking terminal"
|
||||
desc = "Connects to other machines on the same cable network."
|
||||
|
||||
get_machines(var/typekey)
|
||||
// if(istype(computer,/obj/machinery/computer/laptop)) // laptops move, this could get breaky
|
||||
// return list()
|
||||
var/turf/T = get_turf(loc)
|
||||
var/datum/powernet/P = null
|
||||
for(var/obj/structure/cable/C in T)
|
||||
if(C.d1 == 0)
|
||||
P = C.powernet
|
||||
break
|
||||
if(!P)
|
||||
return list()
|
||||
if(!typekey)
|
||||
typekey = /obj/machinery
|
||||
else if(typekey == /datum/powernet)
|
||||
return list(P)
|
||||
var/list/candidates = list()
|
||||
for(var/atom/A in P.nodes)
|
||||
if(istype(A,typekey))
|
||||
candidates += A
|
||||
else if(istype(A,/obj/machinery/power/terminal))
|
||||
var/obj/machinery/power/terminal/PT = A
|
||||
if(istype(PT.master,typekey))
|
||||
candidates += PT.master
|
||||
return candidates
|
||||
/obj/item/part/computer/networking/cable/get_machines(var/typekey)
|
||||
// if(istype(computer,/obj/machinery/computer/laptop)) // laptops move, this could get breaky
|
||||
// return list()
|
||||
var/turf/T = get_turf(loc)
|
||||
var/datum/powernet/P = null
|
||||
for(var/obj/structure/cable/C in T)
|
||||
if(C.d1 == 0)
|
||||
P = C.powernet
|
||||
break
|
||||
if(!P)
|
||||
return list()
|
||||
if(!typekey)
|
||||
typekey = /obj/machinery
|
||||
else if(typekey == /datum/powernet)
|
||||
return list(P)
|
||||
var/list/candidates = list()
|
||||
for(var/atom/A in P.nodes)
|
||||
if(istype(A,typekey))
|
||||
candidates += A
|
||||
else if(istype(A,/obj/machinery/power/terminal))
|
||||
var/obj/machinery/power/terminal/PT = A
|
||||
if(istype(PT.master,typekey))
|
||||
candidates += PT.master
|
||||
return candidates
|
||||
|
||||
verify_machine(var/obj/previous)
|
||||
if(!previous)
|
||||
return 0
|
||||
var/turf/T = get_turf(loc)
|
||||
var/datum/powernet/P = null
|
||||
for(var/obj/structure/cable/C in T)
|
||||
if(C.d1 == 0)
|
||||
P = C.powernet
|
||||
break
|
||||
if(istype(previous,/datum/powernet))
|
||||
if(previous == P)
|
||||
return 1
|
||||
return 0
|
||||
T = get_turf(previous.loc)
|
||||
for(var/obj/structure/cable/C in T)
|
||||
if(C.d1 == 0 && (C.powernet == P))
|
||||
return 1
|
||||
/obj/item/part/computer/networking/cable/verify_machine(var/obj/previous)
|
||||
if(!previous)
|
||||
return 0
|
||||
var/turf/T = get_turf(loc)
|
||||
var/datum/powernet/P = null
|
||||
for(var/obj/structure/cable/C in T)
|
||||
if(C.d1 == 0)
|
||||
P = C.powernet
|
||||
break
|
||||
if(istype(previous,/datum/powernet))
|
||||
if(previous == P)
|
||||
return 1
|
||||
return 0
|
||||
T = get_turf(previous.loc)
|
||||
for(var/obj/structure/cable/C in T)
|
||||
if(C.d1 == 0 && (C.powernet == P))
|
||||
return 1
|
||||
return 0
|
||||
|
||||
|
||||
@@ -228,10 +228,10 @@ Programs are a file that can be executed
|
||||
//
|
||||
if("eject_card" in href_list)
|
||||
if(computer.cardslot)
|
||||
if(computer.cardslot.dualslot && href_list["eject_card"] == "writer")
|
||||
computer.cardslot.remove(computer.cardslot.writer)
|
||||
if(istype(computer.cardslot, /obj/item/part/computer/cardslot/dual) && href_list["eject_card"] == "writer")
|
||||
computer.cardslot.remove(usr)
|
||||
else
|
||||
computer.cardslot.remove(computer.cardslot.reader)
|
||||
computer.cardslot.remove(usr)
|
||||
return 1
|
||||
//
|
||||
// usage: runfile=\ref[file]
|
||||
|
||||
@@ -24,9 +24,9 @@
|
||||
|
||||
spawn_parts = list(/obj/item/part/computer/storage/hdd,/obj/item/part/computer/networking/radio/subspace)
|
||||
|
||||
update_icon()
|
||||
/obj/machinery/computer3/server/rack/update_icon()
|
||||
//overlays.Cut()
|
||||
return
|
||||
|
||||
attack_hand() // Racks have no screen, only AI can use them
|
||||
/obj/machinery/computer3/server/rack/attack_hand() // Racks have no screen, only AI can use them
|
||||
return
|
||||
|
||||
@@ -21,56 +21,55 @@
|
||||
|
||||
var/list/spawnfiles = list()// For mappers, special drives, and data disks
|
||||
|
||||
New()
|
||||
..()
|
||||
if(islist(spawnfiles))
|
||||
if(removeable && spawnfiles.len)
|
||||
var/obj/item/part/computer/storage/removable/R = src
|
||||
R.inserted = new(src)
|
||||
if(writeprotect)
|
||||
R.inserted.writeprotect = 1
|
||||
for(var/typekey in spawnfiles)
|
||||
addfile(new typekey(),1)
|
||||
/obj/item/part/computer/storage/New()
|
||||
..()
|
||||
if(islist(spawnfiles))
|
||||
if(removeable && spawnfiles.len)
|
||||
var/obj/item/part/computer/storage/removable/R = src
|
||||
R.inserted = new(src)
|
||||
if(writeprotect)
|
||||
R.inserted.writeprotect = 1
|
||||
for(var/typekey in spawnfiles)
|
||||
addfile(new typekey(),1)
|
||||
|
||||
// Add a file to the hard drive, returns 0 if failed
|
||||
// forced is used when spawning files on a write-protect drive
|
||||
proc/addfile(var/datum/file/F,var/forced = 0)
|
||||
if(!F || (F in files))
|
||||
return 1
|
||||
if(writeprotect && !forced)
|
||||
// Add a file to the hard drive, returns 0 if failed
|
||||
// forced is used when spawning files on a write-protect drive
|
||||
/obj/item/part/computer/storage/proc/addfile(var/datum/file/F,var/forced = 0)
|
||||
if(!F || (F in files))
|
||||
return 1
|
||||
if(writeprotect && !forced)
|
||||
return 0
|
||||
if(volume + F.volume > max_volume)
|
||||
if(!forced)
|
||||
return 0
|
||||
if(volume + F.volume > max_volume)
|
||||
if(!forced)
|
||||
return 0
|
||||
max_volume = volume + F.volume
|
||||
max_volume = volume + F.volume
|
||||
|
||||
files.Add(F)
|
||||
volume += F.volume
|
||||
files.Add(F)
|
||||
volume += F.volume
|
||||
F.computer = computer
|
||||
F.device = src
|
||||
return 1
|
||||
/obj/item/part/computer/storage/proc/removefile(var/datum/file/F,var/forced = 0)
|
||||
if(!F || !(F in files))
|
||||
return 1
|
||||
if(writeprotect && !forced)
|
||||
return 0
|
||||
|
||||
files -= F
|
||||
volume -= F.volume
|
||||
if(F.device == src)
|
||||
F.device = null
|
||||
F.computer = null
|
||||
return 1
|
||||
|
||||
/obj/item/part/computer/storage/init(var/obj/machinery/computer/target)
|
||||
computer = target
|
||||
for(var/datum/file/F in files)
|
||||
F.computer = computer
|
||||
F.device = src
|
||||
return 1
|
||||
proc/removefile(var/datum/file/F,var/forced = 0)
|
||||
if(!F || !(F in files))
|
||||
return 1
|
||||
if(writeprotect && !forced)
|
||||
return 0
|
||||
|
||||
files -= F
|
||||
volume -= F.volume
|
||||
if(F.device == src)
|
||||
F.device = null
|
||||
F.computer = null
|
||||
return 1
|
||||
|
||||
init(var/obj/machinery/computer/target)
|
||||
computer = target
|
||||
for(var/datum/file/F in files)
|
||||
F.computer = computer
|
||||
|
||||
/*
|
||||
Standard hard drives for computers. Used in computer construction
|
||||
*/
|
||||
|
||||
/obj/item/part/computer/storage/hdd
|
||||
name = "Hard Drive"
|
||||
max_volume = 25000
|
||||
@@ -99,66 +98,64 @@
|
||||
attackby_types = list(/obj/item/weapon/disk/file, /obj/item/weapon/pen)
|
||||
var/obj/item/weapon/disk/file/inserted = null
|
||||
|
||||
proc/eject_disk(var/forced = 0)
|
||||
if(!forced)
|
||||
/obj/item/part/computer/storage/removable/proc/eject_disk(var/forced = 0)
|
||||
if(!forced)
|
||||
return
|
||||
files = list()
|
||||
inserted.loc = computer.loc
|
||||
if(usr)
|
||||
if(!usr.get_active_hand())
|
||||
usr.put_in_active_hand(inserted)
|
||||
else if(forced && !usr.get_inactive_hand())
|
||||
usr.put_in_inactive_hand(inserted)
|
||||
for(var/datum/file/F in inserted.files)
|
||||
F.computer = null
|
||||
inserted = null
|
||||
|
||||
|
||||
/obj/item/part/computer/storage/removable/attackby(obj/O as obj, mob/user as mob)
|
||||
if(inserted && istype(O,/obj/item/weapon/pen))
|
||||
to_chat(usr, "You use [O] to carefully pry [inserted] out of [src].")
|
||||
eject_disk(forced = 1)
|
||||
return
|
||||
|
||||
if(istype(O,/obj/item/weapon/disk/file))
|
||||
if(inserted)
|
||||
to_chat(usr, "There's already a disk in [src]!")
|
||||
return
|
||||
files = list()
|
||||
inserted.loc = computer.loc
|
||||
if(usr)
|
||||
if(!usr.get_active_hand())
|
||||
usr.put_in_active_hand(inserted)
|
||||
else if(forced && !usr.get_inactive_hand())
|
||||
usr.put_in_inactive_hand(inserted)
|
||||
|
||||
to_chat(usr, "You insert [O] into [src].")
|
||||
usr.drop_item()
|
||||
O.loc = src
|
||||
inserted = O
|
||||
writeprotect = inserted.writeprotect
|
||||
|
||||
files = inserted.files
|
||||
for(var/datum/file/F in inserted.files)
|
||||
F.computer = null
|
||||
inserted = null
|
||||
F.computer = computer
|
||||
|
||||
return
|
||||
..()
|
||||
|
||||
attackby(obj/O as obj, mob/user as mob)
|
||||
if(inserted && istype(O,/obj/item/weapon/pen))
|
||||
usr << "You use [O] to carefully pry [inserted] out of [src]."
|
||||
eject_disk(forced = 1)
|
||||
return
|
||||
/obj/item/part/computer/storage/removable/addfile(var/datum/file/F)
|
||||
if(!F || !inserted)
|
||||
return 0
|
||||
|
||||
if(istype(O,/obj/item/weapon/disk/file))
|
||||
if(inserted)
|
||||
usr << "There's already a disk in [src]!"
|
||||
return
|
||||
|
||||
usr << "You insert [O] into [src]."
|
||||
usr.drop_item()
|
||||
O.loc = src
|
||||
inserted = O
|
||||
writeprotect = inserted.writeprotect
|
||||
|
||||
files = inserted.files
|
||||
for(var/datum/file/F in inserted.files)
|
||||
F.computer = computer
|
||||
|
||||
return
|
||||
|
||||
..()
|
||||
|
||||
addfile(var/datum/file/F)
|
||||
if(!F || !inserted)
|
||||
return 0
|
||||
|
||||
if(F in inserted.files)
|
||||
return 1
|
||||
|
||||
if(inserted.volume + F.volume > inserted.max_volume)
|
||||
return 0
|
||||
|
||||
inserted.files.Add(F)
|
||||
F.computer = computer
|
||||
F.device = inserted
|
||||
if(F in inserted.files)
|
||||
return 1
|
||||
|
||||
if(inserted.volume + F.volume > inserted.max_volume)
|
||||
return 0
|
||||
|
||||
inserted.files.Add(F)
|
||||
F.computer = computer
|
||||
F.device = inserted
|
||||
return 1
|
||||
|
||||
/*
|
||||
Removable hard drive presents...
|
||||
removeable disk!
|
||||
*/
|
||||
|
||||
/obj/item/weapon/disk/file
|
||||
//parent_type = /obj/item/part/computer/storage // todon't: do this
|
||||
name = "Data Disk"
|
||||
@@ -170,15 +167,15 @@
|
||||
var/max_volume = 1028
|
||||
|
||||
|
||||
New()
|
||||
..()
|
||||
icon_state = "datadisk[rand(0,6)]"
|
||||
src.pixel_x = rand(-5, 5)
|
||||
src.pixel_y = rand(-5, 5)
|
||||
files = list()
|
||||
if(istype(spawn_files))
|
||||
for(var/typekey in spawn_files)
|
||||
var/datum/file/F = new typekey()
|
||||
F.device = src
|
||||
files += F
|
||||
volume += F.volume
|
||||
/obj/item/weapon/disk/file/New()
|
||||
..()
|
||||
icon_state = "datadisk[rand(0,6)]"
|
||||
src.pixel_x = rand(-5, 5)
|
||||
src.pixel_y = rand(-5, 5)
|
||||
files = list()
|
||||
if(istype(spawn_files))
|
||||
for(var/typekey in spawn_files)
|
||||
var/datum/file/F = new typekey()
|
||||
F.device = src
|
||||
files += F
|
||||
volume += F.volume
|
||||
|
||||
@@ -422,7 +422,7 @@
|
||||
preserve = 1
|
||||
|
||||
if(istype(W,/obj/item/weapon/implant/health))
|
||||
for(var/obj/machinery/computer/cloning/com in world)
|
||||
for(var/obj/machinery/computer/cloning/com in machines)
|
||||
for(var/datum/dna2/record/R in com.records)
|
||||
if(locate(R.implant) == W)
|
||||
qdel(R)
|
||||
|
||||
@@ -92,7 +92,7 @@
|
||||
*/
|
||||
|
||||
/obj/machinery/button/remote/airlock/trigger()
|
||||
for(var/obj/machinery/door/airlock/D in world)
|
||||
for(var/obj/machinery/door/airlock/D in machines)
|
||||
if(D.id_tag == id)
|
||||
if(specialfunctions & OPEN)
|
||||
if(D.density)
|
||||
@@ -137,7 +137,7 @@
|
||||
desc = "It controls blast doors, remotely."
|
||||
|
||||
/obj/machinery/button/remote/blast_door/trigger()
|
||||
for(var/obj/machinery/door/blast/M in world)
|
||||
for(var/obj/machinery/door/blast/M in machines)
|
||||
if(M.id == id)
|
||||
if(M.density)
|
||||
spawn(0)
|
||||
@@ -156,7 +156,7 @@
|
||||
desc = "It controls emitters, remotely."
|
||||
|
||||
/obj/machinery/button/remote/emitter/trigger(mob/user as mob)
|
||||
for(var/obj/machinery/power/emitter/E in world)
|
||||
for(var/obj/machinery/power/emitter/E in machines)
|
||||
if(E.id == id)
|
||||
spawn(0)
|
||||
E.activate(user)
|
||||
|
||||
@@ -1208,7 +1208,7 @@ About the new airlock wires panel:
|
||||
|
||||
/obj/machinery/door/airlock/initialize()
|
||||
if(src.closeOtherId != null)
|
||||
for (var/obj/machinery/door/airlock/A in world)
|
||||
for (var/obj/machinery/door/airlock/A in machines)
|
||||
if(A.closeOtherId == src.closeOtherId && A != src)
|
||||
src.closeOther = A
|
||||
break
|
||||
|
||||
@@ -47,7 +47,7 @@
|
||||
if(F.id == src.id)
|
||||
LAZYADD(targets,F)
|
||||
|
||||
for(var/obj/structure/closet/secure_closet/brig/C in world)
|
||||
for(var/obj/structure/closet/secure_closet/brig/C in all_brig_closets)
|
||||
if(C.id == src.id)
|
||||
LAZYADD(targets,C)
|
||||
|
||||
|
||||
@@ -213,7 +213,7 @@
|
||||
..()
|
||||
|
||||
if(autolink)
|
||||
for(var/obj/machinery/magnetic_module/M in world)
|
||||
for(var/obj/machinery/magnetic_module/M in machines)
|
||||
if(M.freq == frequency && M.code == code)
|
||||
magnets.Add(M)
|
||||
|
||||
@@ -229,7 +229,7 @@
|
||||
|
||||
/obj/machinery/magnetic_controller/process()
|
||||
if(magnets.len == 0 && autolink)
|
||||
for(var/obj/machinery/magnetic_module/M in world)
|
||||
for(var/obj/machinery/magnetic_module/M in machines)
|
||||
if(M.freq == frequency && M.code == code)
|
||||
magnets.Add(M)
|
||||
|
||||
|
||||
@@ -168,7 +168,7 @@ var/list/obj/machinery/requests_console/allConsoles = list()
|
||||
var/log_msg = message
|
||||
var/pass = 0
|
||||
screen = RCS_SENTFAIL
|
||||
for (var/obj/machinery/message_server/MS in world)
|
||||
for (var/obj/machinery/message_server/MS in machines)
|
||||
if(!MS.active) continue
|
||||
MS.send_rc_message(ckey(href_list["department"]),department,log_msg,msgStamped,msgVerified,priority)
|
||||
pass = 1
|
||||
|
||||
@@ -89,7 +89,7 @@
|
||||
if(surplus() < 1500)
|
||||
if(user) user << "<span class='notice'>The connected wire doesn't have enough current.</span>"
|
||||
return
|
||||
for(var/obj/singularity/singulo in world)
|
||||
for(var/obj/singularity/singulo in all_singularities)
|
||||
if(singulo.z == z)
|
||||
singulo.target = src
|
||||
icon_state = "[icontype]1"
|
||||
@@ -99,7 +99,7 @@
|
||||
user << "<span class='notice'>You activate the beacon.</span>"
|
||||
|
||||
/obj/machinery/power/singularity_beacon/proc/Deactivate(mob/user = null)
|
||||
for(var/obj/singularity/singulo in world)
|
||||
for(var/obj/singularity/singulo in all_singularities)
|
||||
if(singulo.target == src)
|
||||
singulo.target = null
|
||||
icon_state = "[icontype]0"
|
||||
|
||||
@@ -95,7 +95,7 @@
|
||||
var/list/L = list()
|
||||
var/list/areaindex = list()
|
||||
|
||||
for(var/obj/item/device/radio/beacon/R in world)
|
||||
for(var/obj/item/device/radio/beacon/R in all_beacons)
|
||||
var/turf/T = get_turf(R)
|
||||
if(!T)
|
||||
continue
|
||||
@@ -108,7 +108,7 @@
|
||||
areaindex[tmpname] = 1
|
||||
L[tmpname] = R
|
||||
|
||||
for (var/obj/item/weapon/implant/tracking/I in world)
|
||||
for (var/obj/item/weapon/implant/tracking/I in all_tracking_implants)
|
||||
if(!I.implanted || !ismob(I.loc))
|
||||
continue
|
||||
else
|
||||
|
||||
@@ -51,7 +51,7 @@
|
||||
else if(ispath(control_area))
|
||||
control_area = locate(control_area)
|
||||
else if(istext(control_area))
|
||||
for(var/area/A in world)
|
||||
for(var/area/A in all_areas)
|
||||
if(A.name && A.name==control_area)
|
||||
control_area = A
|
||||
break
|
||||
|
||||
@@ -510,6 +510,8 @@
|
||||
if(R.get_product(get_turf(src)))
|
||||
visible_message("<span class='notice'>\The [src] clunks as it vends an additional item.</span>")
|
||||
|
||||
playsound(src, 'sound/items/vending.ogg', 50, 1, 1)
|
||||
|
||||
status_message = ""
|
||||
status_error = 0
|
||||
vend_ready = 1
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
GLOBAL_LIST_BOILERPLATE(all_portals, /obj/effect/portal)
|
||||
|
||||
/obj/effect/portal
|
||||
name = "portal"
|
||||
desc = "Looks unstable. Best to test it with the clown."
|
||||
|
||||
@@ -46,7 +46,7 @@ proc/explosion(turf/epicenter, devastation_range, heavy_impact_range, light_impa
|
||||
|
||||
var/close = range(world.view+round(devastation_range,1), epicenter)
|
||||
// to all distanced mobs play a different sound
|
||||
for(var/mob/M in world)
|
||||
for(var/mob/M in player_list)
|
||||
if(M.z == epicenter.z)
|
||||
if(!(M in close))
|
||||
// check if the mob can hear
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
GLOBAL_LIST_BOILERPLATE(all_items, /obj/item)
|
||||
|
||||
/obj/item
|
||||
name = "item"
|
||||
icon = 'icons/obj/items.dmi'
|
||||
@@ -587,7 +589,7 @@ var/list/global/slot_flags_enumeration = list(
|
||||
I.Blend(new /icon('icons/effects/blood.dmi', "itemblood"),ICON_MULTIPLY) //adds blood and the remaining white areas become transparant
|
||||
|
||||
//not sure if this is worth it. It attaches the blood_overlay to every item of the same type if they don't have one already made.
|
||||
for(var/obj/item/A in world)
|
||||
for(var/obj/item/A in all_items)
|
||||
if(A.type == type && !A.blood_overlay)
|
||||
A.blood_overlay = image(I)
|
||||
|
||||
@@ -685,6 +687,10 @@ modules/mob/living/carbon/human/life.dm if you die, you will be zoomed out.
|
||||
/obj/item/proc/is_hot()
|
||||
return FALSE
|
||||
|
||||
// Called when you swap hands away from the item
|
||||
/obj/item/proc/in_inactive_hand(mob/user)
|
||||
return
|
||||
|
||||
// My best guess as to why this is here would be that it does so little. Still, keep it under all the procs, for sanity's sake.
|
||||
/obj/item/device
|
||||
icon = 'icons/obj/device.dmi'
|
||||
|
||||
@@ -653,8 +653,9 @@ var/global/list/obj/item/device/pda/PDAs = list()
|
||||
// the ui does not exist, so we'll create a new() one
|
||||
// for a list of parameters and their descriptions see the code docs in \code\modules\nano\nanoui.dm
|
||||
ui = new(user, src, ui_key, "pda.tmpl", title, 520, 400, state = inventory_state)
|
||||
// add templates for screens in common with communicator.
|
||||
ui.add_template("atmosphericScan", "atmospheric_scan.tmpl")
|
||||
// when the ui is first opened this is the data it will use
|
||||
|
||||
ui.set_initial_data(data)
|
||||
// open the new ui window
|
||||
ui.open()
|
||||
@@ -893,7 +894,7 @@ var/global/list/obj/item/device/pda/PDAs = list()
|
||||
|
||||
if("Toggle Door")
|
||||
if(cartridge && cartridge.access_remote_door)
|
||||
for(var/obj/machinery/door/blast/M in world)
|
||||
for(var/obj/machinery/door/blast/M in machines)
|
||||
if(M.id == cartridge.remote_door_id)
|
||||
if(M.density)
|
||||
M.open()
|
||||
@@ -1247,19 +1248,24 @@ var/global/list/obj/item/device/pda/PDAs = list()
|
||||
if(issilicon(usr))
|
||||
return
|
||||
|
||||
if(can_use(usr) && !isnull(cartridge))
|
||||
cartridge.forceMove(get_turf(src))
|
||||
if(ismob(loc))
|
||||
var/mob/M = loc
|
||||
M.put_in_hands(cartridge)
|
||||
mode = 0
|
||||
scanmode = 0
|
||||
if (cartridge.radio)
|
||||
cartridge.radio.hostpda = null
|
||||
to_chat(usr, "<span class='notice'>You remove \the [cartridge] from the [name].</span>")
|
||||
cartridge = null
|
||||
else
|
||||
if(!can_use(usr))
|
||||
to_chat(usr, "<span class='notice'>You cannot do this while restrained.</span>")
|
||||
return
|
||||
|
||||
if(isnull(cartridge))
|
||||
to_chat(usr, "<span class='notice'>There's no cartridge to eject.</span>")
|
||||
return
|
||||
|
||||
cartridge.forceMove(get_turf(src))
|
||||
if(ismob(loc))
|
||||
var/mob/M = loc
|
||||
M.put_in_hands(cartridge)
|
||||
mode = 0
|
||||
scanmode = 0
|
||||
if (cartridge.radio)
|
||||
cartridge.radio.hostpda = null
|
||||
to_chat(usr, "<span class='notice'>You remove \the [cartridge] from the [name].</span>")
|
||||
cartridge = null
|
||||
|
||||
/obj/item/device/pda/proc/id_check(mob/user as mob, choice as num)//To check for IDs; 1 for in-pda use, 2 for out of pda use.
|
||||
if(choice == 1)
|
||||
|
||||
@@ -468,7 +468,7 @@ var/list/civilian_cartridges = list(
|
||||
else
|
||||
JaniData["user_loc"] = list("x" = 0, "y" = 0)
|
||||
var/MopData[0]
|
||||
for(var/obj/item/weapon/mop/M in world)
|
||||
for(var/obj/item/weapon/mop/M in all_mops)
|
||||
var/turf/ml = get_turf(M)
|
||||
if(ml)
|
||||
if(ml.z != cl.z)
|
||||
@@ -481,7 +481,7 @@ var/list/civilian_cartridges = list(
|
||||
|
||||
|
||||
var/BucketData[0]
|
||||
for(var/obj/structure/mopbucket/B in world)
|
||||
for(var/obj/structure/mopbucket/B in all_mopbuckets)
|
||||
var/turf/bl = get_turf(B)
|
||||
if(bl)
|
||||
if(bl.z != cl.z)
|
||||
@@ -493,7 +493,7 @@ var/list/civilian_cartridges = list(
|
||||
BucketData[++BucketData.len] = list("x" = 0, "y" = 0, dir=null, status = null)
|
||||
|
||||
var/CbotData[0]
|
||||
for(var/mob/living/bot/cleanbot/B in world)
|
||||
for(var/mob/living/bot/cleanbot/B in mob_list)
|
||||
var/turf/bl = get_turf(B)
|
||||
if(bl)
|
||||
if(bl.z != cl.z)
|
||||
@@ -505,7 +505,7 @@ var/list/civilian_cartridges = list(
|
||||
if(!CbotData.len)
|
||||
CbotData[++CbotData.len] = list("x" = 0, "y" = 0, dir=null, status = null)
|
||||
var/CartData[0]
|
||||
for(var/obj/structure/janitorialcart/B in world)
|
||||
for(var/obj/structure/janitorialcart/B in all_janitorial_carts)
|
||||
var/turf/bl = get_turf(B)
|
||||
if(bl)
|
||||
if(bl.z != cl.z)
|
||||
|
||||
@@ -118,6 +118,8 @@
|
||||
// the ui does not exist, so we'll create a new() one
|
||||
// for a list of parameters and their descriptions see the code docs in \code\modules\nano\nanoui.dm
|
||||
ui = new(user, src, ui_key, "communicator.tmpl", "Communicator", 475, 700, state = key_state)
|
||||
// add templates for screens in common with communicator.
|
||||
ui.add_template("atmosphericScan", "atmospheric_scan.tmpl")
|
||||
// when the ui is first opened this is the data it will use
|
||||
ui.set_initial_data(data)
|
||||
// open the new ui window
|
||||
|
||||
219
code/game/objects/items/devices/laserpointer.dm
Normal file
219
code/game/objects/items/devices/laserpointer.dm
Normal file
@@ -0,0 +1,219 @@
|
||||
/obj/item/device/laser_pointer
|
||||
name = "laser pointer"
|
||||
desc = "Don't shine it in your eyes!"
|
||||
icon = 'icons/obj/device.dmi'
|
||||
icon_state = "pointer"
|
||||
item_state = "pen"
|
||||
var/pointer_icon_state
|
||||
slot_flags = SLOT_BELT
|
||||
matter = list("glass" = 500,"metal" = 500)
|
||||
w_class = 2 //Increased to 2, because diodes are w_class 2. Conservation of matter.
|
||||
origin_tech = list(TECH_MAGNET = 2, TECH_COMBAT = 1)
|
||||
var/turf/pointer_loc
|
||||
var/energy = 8
|
||||
var/max_energy = 8
|
||||
var/effectchance = 20
|
||||
var/cooldown = 10
|
||||
var/last_used_time = 0
|
||||
var/recharging = 0
|
||||
var/recharge_locked = 0
|
||||
var/obj/item/weapon/stock_parts/micro_laser/diode //used for upgrading!
|
||||
|
||||
|
||||
/obj/item/device/laser_pointer/red
|
||||
pointer_icon_state = "red_laser"
|
||||
/obj/item/device/laser_pointer/green
|
||||
pointer_icon_state = "green_laser"
|
||||
/obj/item/device/laser_pointer/blue
|
||||
pointer_icon_state = "blue_laser"
|
||||
/obj/item/device/laser_pointer/purple
|
||||
pointer_icon_state = "purple_laser"
|
||||
|
||||
/obj/item/device/laser_pointer/New()
|
||||
..()
|
||||
diode = new(src)
|
||||
if(!pointer_icon_state)
|
||||
pointer_icon_state = pick("red_laser","green_laser","blue_laser","purple_laser")
|
||||
|
||||
/obj/item/device/laser_pointer/upgraded/New()
|
||||
..()
|
||||
diode = new /obj/item/weapon/stock_parts/micro_laser/ultra
|
||||
|
||||
|
||||
|
||||
/obj/item/device/laser_pointer/attack(mob/living/M, mob/user)
|
||||
laser_act(M, user)
|
||||
|
||||
/obj/item/device/laser_pointer/attackby(obj/item/W, mob/user)
|
||||
if(istype(W, /obj/item/weapon/stock_parts/micro_laser))
|
||||
if(!diode)
|
||||
user.drop_item()
|
||||
W.loc = src
|
||||
diode = W
|
||||
to_chat(user, "<span class='notice'>You install a [diode.name] in [src].</span>")
|
||||
else
|
||||
to_chat(user, "<span class='notice'>[src] already has a diode.</span>")
|
||||
|
||||
else if(istype(W, /obj/item/weapon/screwdriver))
|
||||
if(diode)
|
||||
to_chat(user, "<span class='notice'>You remove the [diode.name] from the [src].</span>")
|
||||
diode.loc = get_turf(src.loc)
|
||||
diode = null
|
||||
return
|
||||
..()
|
||||
return
|
||||
|
||||
/obj/item/device/laser_pointer/afterattack(var/atom/target, var/mob/living/user, flag, params)
|
||||
if(flag) //we're placing the object on a table or in backpack
|
||||
return
|
||||
laser_act(target, user)
|
||||
|
||||
/obj/item/device/laser_pointer/proc/laser_act(var/atom/target, var/mob/living/user)
|
||||
if(!(user in (viewers(world.view,target))))
|
||||
return
|
||||
if(!(world.time - last_used_time >= cooldown))
|
||||
return
|
||||
if (!diode)
|
||||
to_chat(user, "<span class='notice'>You point [src] at [target], but nothing happens!</span>")
|
||||
return
|
||||
if (!user.IsAdvancedToolUser())
|
||||
to_chat(user, "<span class='warning'>You don't have the dexterity to do this!</span>")
|
||||
return
|
||||
|
||||
add_fingerprint(user)
|
||||
|
||||
//nothing happens if the battery is drained
|
||||
if(recharge_locked)
|
||||
to_chat(user, "<span class='notice'>You point [src] at [target], but it's still charging.</span>")
|
||||
return
|
||||
|
||||
var/outmsg
|
||||
var/turf/targloc = get_turf(target)
|
||||
|
||||
//human/alien mobs
|
||||
if(iscarbon(target))
|
||||
if(user.zone_sel.selecting == "eyes")
|
||||
var/mob/living/carbon/C = target
|
||||
|
||||
//20% chance to actually hit the eyes
|
||||
|
||||
if(prob(effectchance * diode.rating))
|
||||
add_attack_logs(user,C,"Tried blinding using [src]")
|
||||
|
||||
//eye target check, will return -1 to 2
|
||||
var/eye_prot = C.eyecheck()
|
||||
if(C.blinded)
|
||||
eye_prot = 4
|
||||
var/severity = (rand(0, 1) + diode.rating - eye_prot)
|
||||
var/mob/living/carbon/human/H = C
|
||||
var/obj/item/organ/internal/eyes/E = H.internal_organs_by_name[O_EYES]
|
||||
if(!E)
|
||||
outmsg = "<span class='notice'>You shine [src] at [C], but they don't seem to have eyes.</span>"
|
||||
return
|
||||
|
||||
outmsg = "<span class='notice'>You shine [src] into [C]'s eyes.</span>"
|
||||
switch(severity)
|
||||
if(0)
|
||||
//rank 1 diode with basic eye protection (like sunglasses), or rank 2 with industrial protection (like welding goggles)
|
||||
to_chat(C, "<span class='info'>A small, bright dot appears in your vision.</span>")
|
||||
if(1)
|
||||
//rank 1 with no protection, rank 2 with basic protection, or rank 3 with industrial protection
|
||||
to_chat(C, "<span class='notice'>Something bright flashes in the corner of your vision.</span>")
|
||||
if(2)
|
||||
//rank 1 or 2 with no protection, rank 2 or 3 with basic protection, or rank 3 with industrial protection
|
||||
//alternatively, rank 1 with minor vulnerability (like night vision goggles)
|
||||
flick("flash", C.flash_eyes())
|
||||
to_chat(C, "<span class='danger'>A bright light shines across your eyes!</span>")
|
||||
if(3)
|
||||
//rank 1 with minor vulnerability, rank 2 or 3 with no protection, or rank 3 with basic protection
|
||||
if(prob(3 * diode.rating))
|
||||
C.Weaken(1)
|
||||
flick("flash", C.flash_eyes())
|
||||
E.damage += 1
|
||||
to_chat(C, "<span class='danger'>A bright light briefly blinds you!</span>")
|
||||
if(4)
|
||||
//rank 3 with no protection, or rank 2 with minor vulnerability
|
||||
if(prob(5 * diode.rating))
|
||||
C.Weaken(1)
|
||||
flick("e_flash", C.flash_eyes())
|
||||
E.damage += 2
|
||||
to_chat(C, "<span class='danger'>A blinding light burns your eyes!</span>")
|
||||
else
|
||||
outmsg = "<span class='notice'>You shine the [src] at [C], but miss their eyes.</span>"
|
||||
|
||||
//robots and AI
|
||||
else if(issilicon(target))
|
||||
var/mob/living/silicon/S = target
|
||||
//20% chance to actually hit the sensors
|
||||
if(prob(effectchance * diode.rating))
|
||||
flick("flash", S.flash_eyes(affect_silicon = TRUE))
|
||||
if (prob(3 * diode.rating))
|
||||
S.Weaken(1)
|
||||
to_chat(S, "<span class='warning'>Your sensors were blinded by a laser!</span>")
|
||||
outmsg = "<span class='notice'>You blind [S] by shining [src] at their sensors.</span>"
|
||||
add_attack_logs(user,S,"Tried disabling using [src]")
|
||||
else
|
||||
outmsg = "<span class='notice'>You shine the [src] at [S], but miss their sensors.</span>"
|
||||
|
||||
//cameras
|
||||
else if(istype(target, /obj/machinery/camera))
|
||||
var/obj/machinery/camera/C = target
|
||||
if(prob(effectchance * diode.rating))
|
||||
C.emp_act(4 - diode.rating)
|
||||
outmsg = "<span class='notice'>You shine the [src] into the lens of [C].</span>"
|
||||
add_attack_logs(user,C.name,"Tried disabling using [src]")
|
||||
else
|
||||
outmsg = "<span class='info'>You missed the lens of [C] with [src].</span>"
|
||||
|
||||
//cats!
|
||||
for(var/mob/living/simple_animal/cat/C in viewers(1,targloc))
|
||||
if (!(C.stat || C.buckled))
|
||||
if(prob(50) && !(C.client))
|
||||
C.visible_message("<span class='warning'>[C] pounces on the light!</span>", "<span class='warning'>You pounce on the light!</span>")
|
||||
step_towards(C, targloc)
|
||||
C.lay_down()
|
||||
spawn(10)
|
||||
C.lay_down()
|
||||
else
|
||||
C.set_dir(get_dir(C,targloc))
|
||||
C.visible_message("<span class='notice'>[C] watches the light.</span>", "<span class='notice'>Your attention is drawn to the mysterious glowing dot.</span>")
|
||||
|
||||
|
||||
//laser pointer image
|
||||
icon_state = "pointer_[pointer_icon_state]"
|
||||
var/list/showto = list()
|
||||
for(var/mob/M in viewers(world.view,targloc))
|
||||
if(M.client)
|
||||
showto.Add(M.client)
|
||||
var/image/I = image('icons/obj/projectiles.dmi',targloc,pointer_icon_state,cooldown)
|
||||
I.plane = PLANE_LIGHTING_ABOVE
|
||||
I.pixel_x = target.pixel_x + rand(-5,5)
|
||||
I.pixel_y = target.pixel_y + rand(-5,5)
|
||||
|
||||
if(outmsg)
|
||||
user.visible_message("<span class='info'>[user] points [src] at [target].</span>", outmsg)
|
||||
else
|
||||
user.visible_message("<span class='info'>[user] points [src] at [target].</span>", "<span class='info'>You point [src] at [target].</span>")
|
||||
|
||||
last_used_time = world.time
|
||||
energy -= 1
|
||||
if(energy <= max_energy)
|
||||
if(!recharging)
|
||||
recharging = 1
|
||||
processing_objects.Add(src)
|
||||
if(energy <= 0)
|
||||
to_chat(user, "<span class='warning'>You've overused the battery of [src], now it needs time to recharge!</span>")
|
||||
recharge_locked = 1
|
||||
|
||||
flick_overlay(I, showto, cooldown)
|
||||
spawn(cooldown)
|
||||
icon_state = "pointer"
|
||||
|
||||
/obj/item/device/laser_pointer/process()
|
||||
if(prob(20 - recharge_locked*5))
|
||||
energy += 1
|
||||
if(energy >= max_energy)
|
||||
energy = max_energy
|
||||
recharging = 0
|
||||
recharge_locked = 0
|
||||
..()
|
||||
@@ -1,167 +0,0 @@
|
||||
/obj/item/device/laser_pointer
|
||||
name = "laser pointer"
|
||||
desc = "Don't shine it in your eyes!"
|
||||
icon = 'icons/obj/device_alt.dmi'
|
||||
icon_state = "pointer"
|
||||
item_state = "pen"
|
||||
var/pointer_icon_state
|
||||
flags = CONDUCT
|
||||
slot_flags = SLOT_BELT
|
||||
matter = list(DEFAULT_WALL_MATERIAL = 500, "glass" = 500)
|
||||
w_class = ITEMSIZE_SMALL
|
||||
origin_tech = list(TECH_COMBAT = 1, TECH_MAGNET = 2)
|
||||
var/energy = 5
|
||||
var/max_energy = 5
|
||||
var/effectchance = 33
|
||||
var/recharging = 0
|
||||
var/recharge_locked = 0
|
||||
var/obj/item/weapon/stock_parts/micro_laser/diode //used for upgrading!
|
||||
|
||||
/obj/item/device/laser_pointer/red
|
||||
pointer_icon_state = "red_laser"
|
||||
/obj/item/device/laser_pointer/green
|
||||
pointer_icon_state = "green_laser"
|
||||
/obj/item/device/laser_pointer/blue
|
||||
pointer_icon_state = "blue_laser"
|
||||
/obj/item/device/laser_pointer/purple
|
||||
pointer_icon_state = "purple_laser"
|
||||
|
||||
/obj/item/device/laser_pointer/New()
|
||||
..()
|
||||
diode = new(src)
|
||||
if(!pointer_icon_state)
|
||||
pointer_icon_state = pick("red_laser","green_laser","blue_laser","purple_laser")
|
||||
|
||||
/obj/item/device/laser_pointer/upgraded/New()
|
||||
..()
|
||||
diode = new /obj/item/weapon/stock_parts/micro_laser/ultra
|
||||
|
||||
/obj/item/device/laser_pointer/Destroy()
|
||||
qdel_null(diode)
|
||||
processing_objects -= src
|
||||
. = ..()
|
||||
|
||||
/obj/item/device/laser_pointer/attackby(obj/item/W, mob/user)
|
||||
if(istype(W, /obj/item/weapon/stock_parts/micro_laser))
|
||||
if(!diode)
|
||||
user.drop_item()
|
||||
W.forceMove(src)
|
||||
diode = W
|
||||
to_chat(user, "<span class='notice'>You install \a [diode] in [src].</span>")
|
||||
else
|
||||
to_chat(user, "<span class='notice'>\The [src] already has a diode installed.</span>")
|
||||
|
||||
else if(isscrewdriver(W))
|
||||
if(diode)
|
||||
to_chat(user, "<span class='notice'>You remove \the [diode] from \the [src].</span>")
|
||||
diode.forceMove(drop_location())
|
||||
diode = null
|
||||
else
|
||||
return ..()
|
||||
|
||||
/obj/item/device/laser_pointer/afterattack(atom/target, mob/user, proximity_flag, click_parameters)
|
||||
laser_act(target, user, click_parameters)
|
||||
|
||||
/obj/item/device/laser_pointer/proc/laser_act(atom/target, mob/living/user, click_parameters)
|
||||
if( !(user in (viewers(world.view, target))) )
|
||||
return
|
||||
if (!diode)
|
||||
to_chat(user, "<span class='notice'>You point \the [src] at \the [target], but nothing happens!</span>")
|
||||
return
|
||||
if (!user.IsAdvancedToolUser())
|
||||
to_chat(user, "<span class='warning'>You don't have the dexterity to do this!</span>")
|
||||
return
|
||||
if(ishuman(user))
|
||||
var/mob/living/carbon/human/H = user
|
||||
if(HULK in H.mutations)
|
||||
to_chat(user, "<span class='warning'>Your fingers can't press the button!</span>")
|
||||
return
|
||||
|
||||
add_fingerprint(user)
|
||||
|
||||
//nothing happens if the battery is drained
|
||||
if(recharge_locked)
|
||||
to_chat(user, "<span class='notice'>You point \the [src] at \the [target], but it's still charging.</span>")
|
||||
return
|
||||
|
||||
var/outmsg
|
||||
var/turf/targloc = get_turf(target)
|
||||
|
||||
//human/alien mobs
|
||||
if(iscarbon(target))
|
||||
var/mob/living/carbon/C = target
|
||||
if(user.zone_sel.selecting == O_EYES)
|
||||
add_attack_logs(user, C, "shone [src] in the eyes")
|
||||
|
||||
var/severity = 1
|
||||
if(prob(33))
|
||||
severity = 2
|
||||
else if(prob(50))
|
||||
severity = 0
|
||||
|
||||
//20% chance to actually hit the eyes
|
||||
if(prob(effectchance * diode.rating) && C.flash_eyes(severity))
|
||||
outmsg = "<span class='notice'>You blind [C] by shining [src] in their eyes.</span>"
|
||||
else
|
||||
outmsg = "<span class='warning'>You fail to blind [C] by shining [src] at their eyes!</span>"
|
||||
|
||||
//cameras
|
||||
else if(istype(target, /obj/machinery/camera))
|
||||
var/obj/machinery/camera/C = target
|
||||
if(prob(effectchance * diode.rating))
|
||||
C.emp_act(1)
|
||||
outmsg = "<span class='notice'>You hit the lens of [C] with [src], temporarily disabling the camera!</span>"
|
||||
add_attack_logs(user, C, "EMPed with [src]")
|
||||
else
|
||||
outmsg = "<span class='warning'>You miss the lens of [C] with [src]!</span>"
|
||||
|
||||
//cats!
|
||||
for(var/mob/living/simple_animal/cat/C in view(1, targloc))
|
||||
if(prob(50))
|
||||
C.visible_message("<span class='notice'>[C] pounces on the light!</span>", "<span class='warning'>LIGHT!</span>")
|
||||
C.Move(targloc)
|
||||
C.resting = TRUE
|
||||
C.update_canmove()
|
||||
else
|
||||
C.visible_message("<span class='notice'>[C] looks uninterested in your games.</span>", "<span class='warning'>You spot [user] shining [src] at you. How insulting!</span>")
|
||||
|
||||
//laser pointer image
|
||||
icon_state = "pointer_[pointer_icon_state]"
|
||||
var/image/I = image('icons/obj/projectiles_vr.dmi', targloc, pointer_icon_state)
|
||||
I.plane = ABOVE_PLANE
|
||||
var/list/click_params = params2list(click_parameters)
|
||||
if(click_params)
|
||||
if(click_params["icon-x"])
|
||||
I.pixel_x = (text2num(click_params["icon-x"]) - 16)
|
||||
if(click_params["icon-y"])
|
||||
I.pixel_y = (text2num(click_params["icon-y"]) - 16)
|
||||
else
|
||||
I.pixel_x = target.pixel_x + rand(-5,5)
|
||||
I.pixel_y = target.pixel_y + rand(-5,5)
|
||||
|
||||
if(outmsg)
|
||||
to_chat(user, outmsg)
|
||||
else
|
||||
to_chat(user, "<span class='info'>You point [src] at [target].</span>")
|
||||
|
||||
energy -= 1
|
||||
if(energy <= max_energy)
|
||||
if(!recharging)
|
||||
recharging = 1
|
||||
processing_objects.Add(src)
|
||||
if(energy <= 0)
|
||||
to_chat(user, "<span class='warning'>[src]'s battery is overused, it needs time to recharge!</span>")
|
||||
recharge_locked = TRUE
|
||||
|
||||
flick_overlay_view(I, targloc, 1 SECOND)
|
||||
sleep(1 SECOND)
|
||||
icon_state = "pointer"
|
||||
|
||||
/obj/item/device/laser_pointer/process()
|
||||
if(prob(20 - recharge_locked*5))
|
||||
energy += 1
|
||||
if(energy >= max_energy)
|
||||
energy = max_energy
|
||||
recharging = 0
|
||||
recharge_locked = FALSE
|
||||
..()
|
||||
@@ -1,3 +1,5 @@
|
||||
GLOBAL_LIST_BOILERPLATE(all_pai_cards, /obj/item/device/paicard)
|
||||
|
||||
/obj/item/device/paicard
|
||||
name = "personal AI device"
|
||||
icon = 'icons/obj/pda.dmi'
|
||||
|
||||
@@ -6,6 +6,8 @@
|
||||
var/code = "electronic"
|
||||
origin_tech = list(TECH_BLUESPACE = 1)
|
||||
|
||||
GLOBAL_LIST_BOILERPLATE(all_beacons, /obj/item/device/radio/beacon)
|
||||
|
||||
/obj/item/device/radio/beacon/hear_talk()
|
||||
return
|
||||
|
||||
|
||||
@@ -51,4 +51,15 @@
|
||||
|
||||
/obj/item/poi/brokenoldreactor/Destroy()
|
||||
processing_objects -= src
|
||||
return ..()
|
||||
return ..()
|
||||
|
||||
|
||||
//Crashed Cargo Shuttle PoI
|
||||
|
||||
/obj/structure/largecrate/animal/crashedshuttle
|
||||
name = "SCP"
|
||||
/obj/structure/largecrate/animal/crashedshuttle/New()
|
||||
held_type = pick(/mob/living/simple_animal/hostile/statue, /obj/item/cursed_marble)
|
||||
name = pick("Spicy Crust Pizzeria", "Soap and Care Products", "Sally's Computer Parts", "Steve's Chocolate Pastries", "Smith & Christian's Plastics","Standard Containers & Packaging Co.", "Sanitary Chemical Purgation (LTD)")
|
||||
name += " delivery crate"
|
||||
..()
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
throw_range = 20
|
||||
var/heal_brute = 0
|
||||
var/heal_burn = 0
|
||||
var/apply_sounds
|
||||
|
||||
/obj/item/stack/medical/attack(mob/living/carbon/M as mob, mob/user as mob)
|
||||
if (!istype(M))
|
||||
@@ -65,6 +66,7 @@
|
||||
icon_state = "brutepack"
|
||||
origin_tech = list(TECH_BIO = 1)
|
||||
no_variants = FALSE
|
||||
apply_sounds = list('sound/effects/rip1.ogg','sound/effects/rip2.ogg')
|
||||
|
||||
/obj/item/stack/medical/bruise_pack/attack(mob/living/carbon/M as mob, mob/user as mob)
|
||||
if(..())
|
||||
@@ -112,6 +114,7 @@
|
||||
"<span class='notice'>You place a bandaid over \a [W.desc] on [M]'s [affecting.name].</span>" )
|
||||
W.bandage()
|
||||
// W.disinfect() // VOREStation - Tech1 should not disinfect
|
||||
playsound(src, pick(apply_sounds), 25)
|
||||
used++
|
||||
affecting.update_damages()
|
||||
if(used == amount)
|
||||
@@ -130,6 +133,7 @@
|
||||
heal_burn = 1
|
||||
origin_tech = list(TECH_BIO = 1)
|
||||
no_variants = FALSE
|
||||
apply_sounds = list('sound/effects/ointment.ogg')
|
||||
|
||||
/obj/item/stack/medical/ointment/attack(mob/living/carbon/M as mob, mob/user as mob)
|
||||
if(..())
|
||||
@@ -159,6 +163,7 @@
|
||||
"<span class='notice'>You salved wounds on [M]'s [affecting.name].</span>" )
|
||||
use(1)
|
||||
affecting.salve()
|
||||
playsound(src, pick(apply_sounds), 25)
|
||||
|
||||
/obj/item/stack/medical/advanced/bruise_pack
|
||||
name = "advanced trauma kit"
|
||||
@@ -167,6 +172,7 @@
|
||||
icon_state = "traumakit"
|
||||
heal_brute = 3
|
||||
origin_tech = list(TECH_BIO = 1)
|
||||
apply_sounds = list('sound/effects/rip1.ogg','sound/effects/rip2.ogg','sound/effects/tape.ogg')
|
||||
|
||||
/obj/item/stack/medical/advanced/bruise_pack/attack(mob/living/carbon/M as mob, mob/user as mob)
|
||||
if(..())
|
||||
@@ -212,6 +218,7 @@
|
||||
W.bandage()
|
||||
W.disinfect()
|
||||
W.heal_damage(heal_brute)
|
||||
playsound(src, pick(apply_sounds), 25)
|
||||
used++
|
||||
affecting.update_damages()
|
||||
if(used == amount)
|
||||
@@ -228,7 +235,7 @@
|
||||
icon_state = "burnkit"
|
||||
heal_burn = 3
|
||||
origin_tech = list(TECH_BIO = 1)
|
||||
|
||||
apply_sounds = list('sound/effects/ointment.ogg')
|
||||
|
||||
/obj/item/stack/medical/advanced/ointment/attack(mob/living/carbon/M as mob, mob/user as mob)
|
||||
if(..())
|
||||
@@ -258,6 +265,7 @@
|
||||
affecting.heal_damage(0,heal_burn)
|
||||
use(1)
|
||||
affecting.salve()
|
||||
playsound(src, pick(apply_sounds), 25)
|
||||
|
||||
/obj/item/stack/medical/splint
|
||||
name = "medical splints"
|
||||
|
||||
@@ -3,19 +3,20 @@
|
||||
icon_state = "flashbang"
|
||||
item_state = "flashbang"
|
||||
origin_tech = list(TECH_MATERIAL = 2, TECH_COMBAT = 1)
|
||||
var/max_range = 10 //The maximum range possible, including species effect mods. Cuts off at 7 for normal humans. Should be 3 higher than your intended target range for affecting normal humans.
|
||||
var/banglet = 0
|
||||
|
||||
/obj/item/weapon/grenade/flashbang/prime()
|
||||
..()
|
||||
for(var/obj/structure/closet/L in hear(7, get_turf(src)))
|
||||
for(var/obj/structure/closet/L in hear(max_range, get_turf(src)))
|
||||
if(locate(/mob/living/carbon/, L))
|
||||
for(var/mob/living/carbon/M in L)
|
||||
bang(get_turf(src), M)
|
||||
|
||||
for(var/mob/living/carbon/M in hear(7, get_turf(src)))
|
||||
for(var/mob/living/carbon/M in hear(max_range, get_turf(src)))
|
||||
bang(get_turf(src), M)
|
||||
|
||||
for(var/obj/structure/blob/B in hear(8,get_turf(src))) //Blob damage here
|
||||
for(var/obj/structure/blob/B in hear(max_range - 2,get_turf(src))) //Blob damage here
|
||||
var/damage = round(30/(get_dist(B,get_turf(src))+1))
|
||||
if(B.overmind)
|
||||
damage *= B.overmind.blob_type.burn_multiplier
|
||||
@@ -39,13 +40,19 @@
|
||||
ear_safety = M.get_ear_protection()
|
||||
|
||||
//Flashing everyone
|
||||
if(eye_safety < 1)
|
||||
var/mob/living/carbon/human/H = M
|
||||
var/flash_effectiveness = 1
|
||||
var/bang_effectiveness = 1
|
||||
if(ishuman(M))
|
||||
flash_effectiveness = H.species.flash_mod
|
||||
bang_effectiveness = H.species.sound_mod
|
||||
if(eye_safety < 1 && get_dist(M, T) <= round(max_range * 0.7 * flash_effectiveness))
|
||||
M.flash_eyes()
|
||||
M.Confuse(2)
|
||||
M.Weaken(5)
|
||||
M.Confuse(2 * flash_effectiveness)
|
||||
M.Weaken(5 * flash_effectiveness)
|
||||
|
||||
//Now applying sound
|
||||
if((get_dist(M, T) <= 2 || src.loc == M.loc || src.loc == M))
|
||||
if((get_dist(M, T) <= round(max_range * 0.3 * bang_effectiveness) || src.loc == M.loc || src.loc == M))
|
||||
if(ear_safety > 0)
|
||||
M.Confuse(2)
|
||||
M.Weaken(1)
|
||||
@@ -58,20 +65,19 @@
|
||||
M.ear_damage += rand(0, 5)
|
||||
M.ear_deaf = max(M.ear_deaf,15)
|
||||
|
||||
else if(get_dist(M, T) <= 5)
|
||||
else if(get_dist(M, T) <= round(max_range * 0.5 * bang_effectiveness))
|
||||
if(!ear_safety)
|
||||
M.Confuse(8)
|
||||
M.ear_damage += rand(0, 3)
|
||||
M.ear_deaf = max(M.ear_deaf,10)
|
||||
|
||||
else if(!ear_safety)
|
||||
else if(!ear_safety && get_dist(M, T) <= (max_range * 0.7 * bang_effectiveness))
|
||||
M.Confuse(4)
|
||||
M.ear_damage += rand(0, 1)
|
||||
M.ear_deaf = max(M.ear_deaf,5)
|
||||
|
||||
//This really should be in mob not every check
|
||||
if(ishuman(M))
|
||||
var/mob/living/carbon/human/H = M
|
||||
var/obj/item/organ/internal/eyes/E = H.internal_organs_by_name[O_EYES]
|
||||
if (E && E.damage >= E.min_bruised_damage)
|
||||
M << "<span class='danger'>Your eyes start to burn badly!</span>"
|
||||
|
||||
@@ -69,6 +69,8 @@
|
||||
else
|
||||
..()
|
||||
|
||||
GLOBAL_LIST_BOILERPLATE(all_tracking_implants, /obj/item/weapon/implant/tracking)
|
||||
|
||||
/obj/item/weapon/implant/tracking
|
||||
name = "tracking implant"
|
||||
desc = "An implant normally given to dangerous criminals. Allows security to track your location."
|
||||
@@ -309,6 +311,8 @@ Implant Specifics:<BR>"}
|
||||
explosion(get_turf(imp_in), -1, -1, 1, 3)
|
||||
qdel(src)
|
||||
|
||||
GLOBAL_LIST_BOILERPLATE(all_chem_implants, /obj/item/weapon/implant/chem)
|
||||
|
||||
/obj/item/weapon/implant/chem
|
||||
name = "chemical implant"
|
||||
desc = "Injects things."
|
||||
|
||||
@@ -144,9 +144,9 @@
|
||||
force = 10
|
||||
w_class = ITEMSIZE_LARGE
|
||||
slot_flags = SLOT_BACK
|
||||
force_divisor = 0.5 // 15 when wielded with hardness 15 (glass)
|
||||
force_divisor = 0.5 // 15 when wielded with hardness 30 (glass)
|
||||
unwielded_force_divisor = 0.375
|
||||
thrown_force_divisor = 1.5 // 20 when thrown with weight 15 (glass)
|
||||
thrown_force_divisor = 1.5 // 22.5 when thrown with weight 15 (glass)
|
||||
throw_speed = 3
|
||||
edge = 0
|
||||
sharp = 1
|
||||
@@ -156,4 +156,4 @@
|
||||
applies_material_colour = 0
|
||||
fragile = 1 //It's a haphazard thing of glass, wire, and steel
|
||||
reach = 2 // Spears are long.
|
||||
attackspeed = 14
|
||||
attackspeed = 14
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
GLOBAL_LIST_BOILERPLATE(all_mops, /obj/item/weapon/mop)
|
||||
|
||||
/obj/item/weapon/mop
|
||||
desc = "The world of janitalia wouldn't be complete without a mop."
|
||||
name = "mop"
|
||||
@@ -12,7 +14,6 @@
|
||||
var/mopping = 0
|
||||
var/mopcount = 0
|
||||
|
||||
|
||||
/obj/item/weapon/mop/New()
|
||||
create_reagents(30)
|
||||
|
||||
|
||||
@@ -47,6 +47,10 @@
|
||||
max_storage_space = ITEMSIZE_COST_NORMAL * 14 // 56
|
||||
storage_cost = INVENTORY_STANDARD_SPACE + 1
|
||||
|
||||
/obj/item/weapon/storage/backpack/holding/duffle
|
||||
name = "dufflebag of holding"
|
||||
icon_state = "holdingduffle"
|
||||
|
||||
/obj/item/weapon/storage/backpack/holding/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
if(istype(W, /obj/item/weapon/storage/backpack/holding))
|
||||
user << "<span class='warning'>The Bluespace interfaces of the two devices conflict and malfunction.</span>"
|
||||
|
||||
@@ -254,6 +254,7 @@
|
||||
description_antag = "This case will likely contain a charged fuel rod gun, and a few fuel rods to go with it. It can only hold the fuel rod gun, fuel rods, batteries, a screwdriver, and stock machine parts."
|
||||
force = 12 //Anti-rad lined i.e. Lead, probably gonna hurt a bit if you get bashed with it.
|
||||
can_hold = list(/obj/item/weapon/gun/magnetic/fuelrod, /obj/item/weapon/fuel_assembly, /obj/item/weapon/cell, /obj/item/weapon/stock_parts, /obj/item/weapon/screwdriver)
|
||||
cant_hold = list(/obj/item/weapon/screwdriver/power)
|
||||
starts_with = list(
|
||||
/obj/item/weapon/gun/magnetic/fuelrod,
|
||||
/obj/item/weapon/fuel_assembly/deuterium,
|
||||
|
||||
@@ -37,6 +37,7 @@
|
||||
/obj/item/clothing/accessory/permit,
|
||||
/obj/item/clothing/accessory/badge
|
||||
)
|
||||
cant_hold = list(/obj/item/weapon/screwdriver/power)
|
||||
slot_flags = SLOT_ID
|
||||
|
||||
var/obj/item/weapon/card/id/front_id = null
|
||||
|
||||
@@ -56,6 +56,7 @@
|
||||
user.visible_message("<span class='danger'>\The [user] has taped up \the [H]'s eyes!</span>")
|
||||
H.equip_to_slot_or_del(new /obj/item/clothing/glasses/sunglasses/blindfold/tape(H), slot_glasses)
|
||||
H.update_inv_glasses()
|
||||
playsound(src, 'sound/effects/tape.ogg',25)
|
||||
|
||||
else if(user.zone_sel.selecting == O_MOUTH || user.zone_sel.selecting == BP_HEAD)
|
||||
if(!H.organs_by_name[BP_HEAD])
|
||||
@@ -94,6 +95,7 @@
|
||||
|
||||
H.equip_to_slot_or_del(new /obj/item/clothing/mask/muzzle/tape(H), slot_wear_mask)
|
||||
H.update_inv_wear_mask()
|
||||
playsound(src, 'sound/effects/tape.ogg',25)
|
||||
|
||||
else if(user.zone_sel.selecting == "r_hand" || user.zone_sel.selecting == "l_hand")
|
||||
can_place = 0
|
||||
@@ -109,6 +111,7 @@
|
||||
return
|
||||
|
||||
var/obj/item/weapon/handcuffs/cable/tape/T = new(user)
|
||||
playsound(src, 'sound/effects/tape.ogg',25)
|
||||
|
||||
if(!T.place_handcuffs(H, user))
|
||||
user.unEquip(T)
|
||||
@@ -124,6 +127,7 @@
|
||||
var/obj/item/weapon/ducttape/tape = new(get_turf(src))
|
||||
tape.attach(W)
|
||||
user.put_in_hands(tape)
|
||||
playsound(src, 'sound/effects/tape.ogg',25)
|
||||
|
||||
/obj/item/weapon/ducttape
|
||||
name = "tape"
|
||||
@@ -188,6 +192,7 @@
|
||||
return // reduce papers around corners issue.
|
||||
|
||||
user.drop_from_inventory(src)
|
||||
playsound(src, 'sound/effects/tape.ogg',25)
|
||||
forceMove(source_turf)
|
||||
|
||||
if(params)
|
||||
|
||||
@@ -60,7 +60,7 @@ Frequency:
|
||||
if (sr)
|
||||
src.temp += "<B>Located Beacons:</B><BR>"
|
||||
|
||||
for(var/obj/item/device/radio/beacon/W in world)
|
||||
for(var/obj/item/device/radio/beacon/W in all_beacons)
|
||||
if (W.frequency == src.frequency)
|
||||
var/turf/tr = get_turf(W)
|
||||
if (tr.z == sr.z && tr)
|
||||
@@ -78,7 +78,7 @@ Frequency:
|
||||
src.temp += "[W.code]-[dir2text(get_dir(sr, tr))]-[direct]<BR>"
|
||||
|
||||
src.temp += "<B>Extranneous Signals:</B><BR>"
|
||||
for (var/obj/item/weapon/implant/tracking/W in world)
|
||||
for (var/obj/item/weapon/implant/tracking/W in all_tracking_implants)
|
||||
if (!W.implanted || !(istype(W.loc,/obj/item/organ/external) || ismob(W.loc) || W.malfunction))
|
||||
continue
|
||||
|
||||
@@ -137,7 +137,7 @@ Frequency:
|
||||
user << "<span class='notice'>\The [src] is malfunctioning.</span>"
|
||||
return
|
||||
var/list/L = list( )
|
||||
for(var/obj/machinery/teleport/hub/R in world)
|
||||
for(var/obj/machinery/teleport/hub/R in machines)
|
||||
var/obj/machinery/computer/teleporter/com = locate(/obj/machinery/computer/teleporter, locate(R.x - 2, R.y, R.z))
|
||||
if (istype(com, /obj/machinery/computer/teleporter) && com.locked && !com.one_time_use)
|
||||
if(R.icon_state == "tele1")
|
||||
@@ -156,7 +156,7 @@ Frequency:
|
||||
if ((user.get_active_hand() != src || user.stat || user.restrained()))
|
||||
return
|
||||
var/count = 0 //num of portals from this teleport in world
|
||||
for(var/obj/effect/portal/PO in world)
|
||||
for(var/obj/effect/portal/PO in all_portals)
|
||||
if(PO.creator == src) count++
|
||||
if(count >= 3)
|
||||
user.show_message("<span class='notice'>\The [src] is recharging!</span>")
|
||||
|
||||
@@ -172,7 +172,7 @@
|
||||
item_state = "drill"
|
||||
matter = list(DEFAULT_WALL_MATERIAL = 150, MAT_SILVER = 50)
|
||||
origin_tech = list(TECH_MATERIAL = 2, TECH_ENGINEERING = 2)
|
||||
|
||||
slot_flags = SLOT_BELT
|
||||
force = 8
|
||||
w_class = ITEMSIZE_SMALL
|
||||
throwforce = 8
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
GLOBAL_LIST_BOILERPLATE(all_objs, /obj)
|
||||
|
||||
/obj
|
||||
layer = OBJ_LAYER
|
||||
plane = OBJ_PLANE
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
/obj/structure/Destroy()
|
||||
if(parts)
|
||||
new parts(loc)
|
||||
. = ..()
|
||||
. = ..()
|
||||
|
||||
/obj/structure/attack_hand(mob/user)
|
||||
if(breakable)
|
||||
@@ -177,7 +177,7 @@
|
||||
return 1
|
||||
|
||||
/obj/structure/attack_generic(var/mob/user, var/damage, var/attack_verb, var/wallbreaker)
|
||||
if(!breakable || !damage || !wallbreaker)
|
||||
if(!breakable || damage < 10 || !wallbreaker)
|
||||
return 0
|
||||
visible_message("<span class='danger'>[user] [attack_verb] the [src] apart!</span>")
|
||||
user.do_attack_animation(src)
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
// Based on catwalk.dm from https://github.com/Endless-Horizon/CEV-Eris
|
||||
/obj/structure/catwalk
|
||||
layer = TURF_LAYER + 0.5
|
||||
icon = 'icons/turf/catwalks.dmi'
|
||||
icon_state = "catwalk"
|
||||
name = "catwalk"
|
||||
desc = "Cats really don't like these things."
|
||||
plane = TURF_PLANE
|
||||
layer = ABOVE_UTILITY
|
||||
icon = 'icons/turf/catwalks.dmi'
|
||||
icon_state = "catwalk"
|
||||
density = 0
|
||||
var/health = 100
|
||||
var/maxhealth = 100
|
||||
|
||||
@@ -346,7 +346,7 @@
|
||||
icon_state = icon_opened
|
||||
|
||||
/obj/structure/closet/attack_generic(var/mob/user, var/damage, var/attack_message = "destroys", var/wallbreaker)
|
||||
if(!damage || !wallbreaker)
|
||||
if(damage < 10 || !wallbreaker)
|
||||
return
|
||||
user.do_attack_animation(src)
|
||||
visible_message("<span class='danger'>[user] [attack_message] the [src]!</span>")
|
||||
|
||||
@@ -340,7 +340,7 @@
|
||||
new /obj/item/weapon/reagent_containers/syringe/ld50_syringe/choral(src)
|
||||
return
|
||||
|
||||
|
||||
GLOBAL_LIST_BOILERPLATE(all_brig_closets, /obj/structure/closet/secure_closet/brig)
|
||||
|
||||
/obj/structure/closet/secure_closet/brig
|
||||
name = "brig locker"
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
anchored = 1
|
||||
flags = CONDUCT
|
||||
pressure_resistance = 5*ONE_ATMOSPHERE
|
||||
layer = UNDER_JUNK_LAYER
|
||||
layer = TABLE_LAYER
|
||||
explosion_resistance = 1
|
||||
var/health = 10
|
||||
var/destroyed = 0
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
GLOBAL_LIST_BOILERPLATE(all_janitorial_carts, /obj/structure/janitorialcart)
|
||||
|
||||
/obj/structure/janitorialcart
|
||||
name = "janitorial cart"
|
||||
desc = "The ultimate in janitorial carts! Has space for water, mops, signs, trash bags, and more!"
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user