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:
Arokha Sieyes
2018-05-25 13:23:47 -04:00
291 changed files with 324089 additions and 16301 deletions

View File

@@ -33,6 +33,7 @@
#define CE_ALCOHOL "alcohol" // Liver filtering #define CE_ALCOHOL "alcohol" // Liver filtering
#define CE_ALCOHOL_TOXIC "alcotoxic" // Liver damage #define CE_ALCOHOL_TOXIC "alcotoxic" // Liver damage
#define CE_SPEEDBOOST "gofast" // Hyperzine #define CE_SPEEDBOOST "gofast" // Hyperzine
#define CE_SLOWDOWN "goslow" // Slowdown
#define REAGENTS_PER_SHEET 20 #define REAGENTS_PER_SHEET 20

View File

@@ -22,19 +22,23 @@
#define SLOT_TIE 0x4000 #define SLOT_TIE 0x4000
#define SLOT_HOLSTER 0x8000 //16th bit - higher than this will overflow #define SLOT_HOLSTER 0x8000 //16th bit - higher than this will overflow
#define ACCESSORY_SLOT_UTILITY "Utility" #define ACCESSORY_SLOT_UTILITY 0x1
#define ACCESSORY_SLOT_ARMBAND "Armband" #define ACCESSORY_SLOT_WEAPON 0x2
#define ACCESSORY_SLOT_RANK "Rank" #define ACCESSORY_SLOT_ARMBAND 0x4
#define ACCESSORY_SLOT_DEPT "Department" #define ACCESSORY_SLOT_DECOR 0x8
#define ACCESSORY_SLOT_DECOR "Decor" #define ACCESSORY_SLOT_MEDAL 0x20
#define ACCESSORY_SLOT_MEDAL "Medal" #define ACCESSORY_SLOT_TIE 0x40
#define ACCESSORY_SLOT_INSIGNIA "Insignia" #define ACCESSORY_SLOT_INSIGNIA 0x80
#define ACCESSORY_SLOT_ARMOR_C "Chest armor" #define ACCESSORY_SLOT_OVER 0x100
#define ACCESSORY_SLOT_ARMOR_A "Arm armor" //Should these really be 'accessory' accessories
#define ACCESSORY_SLOT_ARMOR_L "Leg armor" #define ACCESSORY_SLOT_ARMOR_C 0x200
#define ACCESSORY_SLOT_ARMOR_S "Armor storage" #define ACCESSORY_SLOT_ARMOR_A 0x400
#define ACCESSORY_SLOT_ARMOR_M "Misc armor" #define ACCESSORY_SLOT_ARMOR_L 0x800
#define ACCESSORY_SLOT_HELM_C "Helmet cover" #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 // 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. #define NOBLUDGEON 0x1 // When an item has this it produces no "X has been hit by Y with Z" message with the default handler.

View File

@@ -241,6 +241,25 @@
#define USE_FAIL_NOT_IN_USER 6 #define USE_FAIL_NOT_IN_USER 6
#define USE_FAIL_IS_SILICON 7 #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 //'Normal'ness v v v
//Various types of colorblindness R2R R2G R2B G2R G2G G2B B2R B2G B2B //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) #define MATRIX_Monochromia list(0.33, 0.33, 0.33, 0.59, 0.59, 0.59, 0.11, 0.11, 0.11)

View File

@@ -33,7 +33,7 @@
.= res .= res
/proc/get_area_name(N) //get area by its name /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) if(A.name == N)
return A return A
return 0 return 0

View File

@@ -503,9 +503,9 @@ Turf and target are seperate in case you want to teleport some distance from a t
moblist.Add(M) moblist.Add(M)
for(var/mob/living/simple_animal/M in sortmob) for(var/mob/living/simple_animal/M in sortmob)
moblist.Add(M) 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) // 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) // mob_list.Add(M)
return moblist return moblist
@@ -672,7 +672,7 @@ proc/GaussRandRound(var/sigma,var/roundto)
//Returns: all the areas in the world //Returns: all the areas in the world
/proc/return_areas() /proc/return_areas()
var/list/area/areas = list() var/list/area/areas = list()
for(var/area/A in world) for(var/area/A in all_areas)
areas += A areas += A
return areas return areas
@@ -690,7 +690,7 @@ proc/GaussRandRound(var/sigma,var/roundto)
areatype = areatemp.type areatype = areatemp.type
var/list/areas = new/list() var/list/areas = new/list()
for(var/area/N in world) for(var/area/N in all_areas)
if(istype(N, areatype)) areas += N if(istype(N, areatype)) areas += N
return areas return areas
@@ -704,7 +704,7 @@ proc/GaussRandRound(var/sigma,var/roundto)
areatype = areatemp.type areatype = areatemp.type
var/list/turfs = new/list() var/list/turfs = new/list()
for(var/area/N in world) for(var/area/N in all_areas)
if(istype(N, areatype)) if(istype(N, areatype))
for(var/turf/T in N) turfs += T for(var/turf/T in N) turfs += T
return turfs return turfs
@@ -719,7 +719,7 @@ proc/GaussRandRound(var/sigma,var/roundto)
areatype = areatemp.type areatype = areatemp.type
var/list/atoms = new/list() var/list/atoms = new/list()
for(var/area/N in world) for(var/area/N in all_areas)
if(istype(N, areatype)) if(istype(N, areatype))
for(var/atom/A in N) for(var/atom/A in N)
atoms += A atoms += A

View File

@@ -97,6 +97,7 @@ var/list/gamemode_cache = list()
var/guests_allowed = 1 var/guests_allowed = 1
var/debugparanoid = 0 var/debugparanoid = 0
var/panic_bunker = 0 var/panic_bunker = 0
var/paranoia_logging = 0
var/serverurl var/serverurl
var/server var/server
@@ -737,6 +738,12 @@ var/list/gamemode_cache = list()
if("radiation_lower_limit") if("radiation_lower_limit")
radiation_lower_limit = text2num(value) radiation_lower_limit = text2num(value)
if ("panic_bunker")
config.panic_bunker = 1
if ("paranoia_logging")
config.paranoia_logging = 1
else else
log_misc("Unknown setting in configuration: '[name]'") log_misc("Unknown setting in configuration: '[name]'")

View File

@@ -84,7 +84,7 @@ var/global/datum/emergency_shuttle_controller/emergency_shuttle
evac = 1 evac = 1
emergency_shuttle_called.Announce(replacetext(using_map.emergency_shuttle_called_message, "%ETA%", "[estimated_time] minute\s")) 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)) if(istype(A, /area/hallway))
A.readyalert() A.readyalert()
@@ -116,7 +116,7 @@ var/global/datum/emergency_shuttle_controller/emergency_shuttle
if (evac) if (evac)
emergency_shuttle_recalled.Announce(using_map.emergency_shuttle_recall_message) 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)) if(istype(A, /area/hallway))
A.readyreset() A.readyreset()
evac = 0 evac = 0

View File

@@ -49,74 +49,8 @@ datum/controller/game_controller/proc/setup()
// #endif // #endif
datum/controller/game_controller/proc/setup_objects() datum/controller/game_controller/proc/setup_objects()
// #if !UNIT_TEST
// var/initialized_objects = 0
// #endif
// Set up antagonists. // Set up antagonists.
populate_antag_type_list() populate_antag_type_list()
//Set up spawn points. //Set up spawn points.
populate_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
*/

View File

@@ -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. // 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 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() /datum/controller/subsystem/air/PreInit()
air_master = src air_master = src
@@ -35,7 +38,7 @@ SUBSYSTEM_DEF(air)
current_cycle = 0 current_cycle = 0
var/simulated_turf_count = 0 var/simulated_turf_count = 0
for(var/turf/simulated/S in world) for(var/turf/simulated/S in turfs)
simulated_turf_count++ simulated_turf_count++
S.update_air_properties() S.update_air_properties()
CHECK_TICK 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) for(var/connection_edge/E in active_edges)
edge_log += "Active Edge [E] ([E.type])" edge_log += "Active Edge [E] ([E.type])"
for(var/turf/T in E.connecting_turfs) 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")) log_debug("Active Edges on ZAS Startup\n" + edge_log.Join("\n"))
startup_active_edge_log = edge_log.Copy()
..() ..()

View File

@@ -46,7 +46,7 @@ SUBSYSTEM_DEF(atoms)
CHECK_TICK CHECK_TICK
else else
count = 0 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) if(!A.initialized)
InitAtom(A, mapload_arg) InitAtom(A, mapload_arg)
++count ++count

View File

@@ -30,7 +30,7 @@ SUBSYSTEM_DEF(xenoarch)
. = ..() . = ..()
/datum/controller/subsystem/xenoarch/proc/SetupXenoarch() /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) if(!M.density)
continue continue

View File

@@ -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 return I.assignment ? "[I.registered_name] ([I.assignment])" : I.registered_name
/proc/level_seven_announcement() /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() /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) /proc/AnnounceArrival(var/mob/living/carbon/human/character, var/rank, var/join_message)
if (ticker.current_state == GAME_STATE_PLAYING) if (ticker.current_state == GAME_STATE_PLAYING)

View File

@@ -39,7 +39,7 @@
if(flags & ANTAG_HAS_NUKE) if(flags & ANTAG_HAS_NUKE)
dat += "<br><table><tr><td><B>Nuclear disk(s)</B></td></tr>" 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], " dat += "<tr><td>[N.name], "
var/atom/disk_loc = N.loc var/atom/disk_loc = N.loc
while(!istype(disk_loc, /turf)) while(!istype(disk_loc, /turf))

View File

@@ -385,7 +385,7 @@ var/list/mob/living/forced_ambiance_list = new
var/list/teleportlocs = list() var/list/teleportlocs = list()
/hook/startup/proc/setupTeleportLocs() /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(istype(AR, /area/shuttle) || istype(AR, /area/syndicate_station) || istype(AR, /area/wizard_station)) continue
if(teleportlocs.Find(AR.name)) continue if(teleportlocs.Find(AR.name)) continue
var/turf/picked = pick(get_area_turfs(AR.type)) var/turf/picked = pick(get_area_turfs(AR.type))
@@ -400,7 +400,7 @@ var/list/teleportlocs = list()
var/list/ghostteleportlocs = list() var/list/ghostteleportlocs = list()
/hook/startup/proc/setupGhostTeleportLocs() /hook/startup/proc/setupGhostTeleportLocs()
for(var/area/AR in world) for(var/area/AR in all_areas)
if(ghostteleportlocs.Find(AR.name)) continue 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)) if(istype(AR, /area/aisat) || istype(AR, /area/derelict) || istype(AR, /area/tdome) || istype(AR, /area/shuttle/specops/centcom))
ghostteleportlocs += AR.name ghostteleportlocs += AR.name

View File

@@ -1,3 +1,5 @@
GLOBAL_LIST_BOILERPLATE(all_atoms, /atom) // Use with care, its likely barely better than using world.
/atom /atom
layer = TURF_LAYER //This was here when I got here. Why though? layer = TURF_LAYER //This was here when I got here. Why though?
var/level = 2 var/level = 2

View File

@@ -319,7 +319,7 @@ var/global/list/rnwords = list("ire","ego","nahlizet","certum","veri","jatkaa","
runerandom() runerandom()
if(iscultist(user)) if(iscultist(user))
var/C = 0 var/C = 0
for(var/obj/effect/rune/N in world) for(var/obj/effect/rune/N in rune_list)
C++ C++
if (!istype(user.loc,/turf)) if (!istype(user.loc,/turf))
user << "<span class='warning'>You do not have enough space to write a proper rune.</span>" user << "<span class='warning'>You do not have enough space to write a proper rune.</span>"

View File

@@ -21,7 +21,7 @@ var/list/sacrificed = list()
allrunesloc = new/list() allrunesloc = new/list()
var/index = 0 var/index = 0
// var/tempnum = 0 // var/tempnum = 0
for(var/obj/effect/rune/R in world) for(var/obj/effect/rune/R in rune_list)
if(R == src) if(R == src)
continue continue
if(R.word1 == cultwords["travel"] && R.word2 == cultwords["self"] && R.word3 == key && isPlayerLevel(R.z)) 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/runecount = 0
var/obj/effect/rune/IP = null var/obj/effect/rune/IP = null
var/mob/living/user = usr 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) if(R == src)
continue continue
if(R.word1 == cultwords["travel"] && R.word2 == cultwords["other"] && R.word3 == key) if(R.word1 == cultwords["travel"] && R.word2 == cultwords["other"] && R.word3 == key)
@@ -243,7 +243,7 @@ var/list/sacrificed = list()
drain() drain()
var/drain = 0 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"]) if(R.word1==cultwords["travel"] && R.word2==cultwords["blood"] && R.word3==cultwords["self"])
for(var/mob/living/carbon/D in R.loc) for(var/mob/living/carbon/D in R.loc)
if(D.stat!=2) if(D.stat!=2)
@@ -343,7 +343,7 @@ var/list/sacrificed = list()
is_sacrifice_target = 0 is_sacrifice_target = 0
find_sacrifice: 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"]) if(R.word1==cultwords["blood"] && R.word2==cultwords["join"] && R.word3==cultwords["hell"])
for(var/mob/living/carbon/human/N in R.loc) for(var/mob/living/carbon/human/N in R.loc)
if(cult && N.mind && N.mind == cult.sacrifice_target) if(cult && N.mind && N.mind == cult.sacrifice_target)
@@ -374,7 +374,7 @@ var/list/sacrificed = list()
sleep(10 SECONDS) sleep(10 SECONDS)
if(corpse_to_raise.client) if(corpse_to_raise.client)
var/datum/gender/TU = gender_datums[corpse_to_raise.get_visible_gender()] var/datum/gender/TU = gender_datums[corpse_to_raise.get_visible_gender()]
var/datum/gender/TT = gender_datums[body_to_sacrifice.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) if(iscultist(C) && !C.stat)
culcount++ culcount++
if(culcount >= 5) 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) if(R.blood_DNA == src.blood_DNA)
for(var/mob/living/M in orange(2,R)) for(var/mob/living/M in orange(2,R))
M.take_overall_damage(0,15) M.take_overall_damage(0,15)

View File

@@ -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 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") command_alert("Space-time anomalies detected on the station. There is no additional data.", "Anomaly Alert")
world << sound('sound/AI/spanomalies.ogg') world << sound('sound/AI/spanomalies.ogg')
var/list/turfs = new
var/turf/picked 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) for(var/turf/simulated/floor/T in turfs)
if(prob(20)) if(prob(20))
spawn(50+rand(0,3000)) spawn(50+rand(0,3000))
@@ -135,12 +131,12 @@ var/hadevent = 0
spawncount-- spawncount--
spawn(rand(5000, 6000)) //Delayed announcements to keep the crew on their toes. 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() /proc/high_radiation_event()
/* // Haha, this is way too laggy. I'll keep the prison break though. /* // 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 if(isNotStationLevel(L.z)) continue
L.flicker(50) L.flicker(50)
@@ -164,7 +160,7 @@ var/hadevent = 0
randmutg(H) randmutg(H)
domutcheck(H,null,MUTCHK_FORCED) domutcheck(H,null,MUTCHK_FORCED)
sleep(100) 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() 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)) if(istype(A, /area/security/prison) || istype(A, /area/security/brig))
areas += A areas += A
@@ -213,7 +209,7 @@ var/hadevent = 0
new /mob/living/simple_animal/hostile/carp(C.loc) new /mob/living/simple_animal/hostile/carp(C.loc)
//sleep(100) //sleep(100)
spawn(rand(300, 600)) //Delayed announcements to keep the crew on their toes. 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 /proc/lightsout(isEvent = 0, lightsoutAmount = 1,lightsoutRange = 25) //leave lightsoutAmount as 0 to break ALL lights
if(isEvent) if(isEvent)
@@ -366,21 +362,21 @@ Would like to add a law like "Law x is _______" where x = a number, and _____ is
spawn(0) spawn(0)
world << "Started processing APCs" 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) if(APC.z in station_levels)
APC.ion_act() APC.ion_act()
apcnum++ apcnum++
world << "Finished processing APCs. Processed: [apcnum]" world << "Finished processing APCs. Processed: [apcnum]"
spawn(0) spawn(0)
world << "Started processing SMES" 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) if(SMES.z in station_levels)
SMES.ion_act() SMES.ion_act()
smesnum++ smesnum++
world << "Finished processing SMES. Processed: [smesnum]" world << "Finished processing SMES. Processed: [smesnum]"
spawn(0) spawn(0)
world << "Started processing AIRLOCKS" 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(D.z in station_levels)
//if(length(D.req_access) > 0 && !(12 in D.req_access)) //not counting general access and maintenance airlocks //if(length(D.req_access) > 0 && !(12 in D.req_access)) //not counting general access and maintenance airlocks
airlocknum++ 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]" world << "Finished processing AIRLOCKS. Processed: [airlocknum]"
spawn(0) spawn(0)
world << "Started processing FIREDOORS" 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) if(D.z in station_levels)
firedoornum++; firedoornum++;
spawn(0) spawn(0)

View File

@@ -5,7 +5,7 @@
var/list/skipped_areas = list(/area/ai) 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) var/area/current_area = get_area(S)
if(current_area.type in skipped_areas || !(S.z in using_map.station_levels)) if(current_area.type in skipped_areas || !(S.z in using_map.station_levels))
continue continue
@@ -19,7 +19,7 @@
S.power_change() 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)) if(!C.is_critical && C.cell && (C.z in using_map.station_levels))
C.cell.charge = 0 C.cell.charge = 0
@@ -28,10 +28,10 @@
if(announce) 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') 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)) if(C.cell && (C.z in using_map.station_levels))
C.cell.charge = C.cell.maxcharge 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) var/area/current_area = get_area(S)
if(current_area.type in skipped_areas || isNotStationLevel(S.z)) if(current_area.type in skipped_areas || isNotStationLevel(S.z))
continue continue
@@ -45,7 +45,7 @@
if(announce) 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') 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)) if(isNotStationLevel(S.z))
continue continue
S.charge = S.capacity S.charge = S.capacity

View File

@@ -1,7 +1,7 @@
/proc/wormhole_event() /proc/wormhole_event()
spawn() spawn()
var/list/pick_turfs = list() 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) if(T.z in using_map.station_levels)
pick_turfs += T pick_turfs += T

View File

@@ -82,7 +82,7 @@
if(!target) if(!target)
var/list/robots = list() var/list/robots = list()
var/list/robot_names = 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. if(istype(R, /mob/living/silicon/robot/drone)) // No drones.
continue continue
if(R.connected_ai != user) // No robots linked to other AIs if(R.connected_ai != user) // No robots linked to other AIs

View File

@@ -37,7 +37,7 @@ var/list/nuke_disks = list()
..() ..()
return return
var/disk_rescued = 1 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) var/disk_area = get_area(D)
if(!is_type_in_list(disk_area, centcom_areas)) if(!is_type_in_list(disk_area, centcom_areas))
disk_rescued = 0 disk_rescued = 0

View File

@@ -45,7 +45,7 @@
examine(mob/user) examine(mob/user)
..(user) ..(user)
for(var/obj/machinery/nuclearbomb/bomb in world) for(var/obj/machinery/nuclearbomb/bomb in machines)
if(bomb.timing) if(bomb.timing)
user << "Extreme danger. Arming signal detected. Time remaining: [bomb.timeleft]" user << "Extreme danger. Arming signal detected. Time remaining: [bomb.timeleft]"

View File

@@ -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. if(istype(M, /mob/living/silicon/ai) && M.stat != 2) //See if any AI's are alive inside that card.
return 1 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) var/turf/T = get_turf(ai)
if(istype(T)) if(istype(T))
var/area/check_area = get_area(ai) var/area/check_area = get_area(ai)

View File

@@ -345,3 +345,9 @@
to_chat(user, "The subject has too many chemicals in their bloodstream.") to_chat(user, "The subject has too many chemicals in their bloodstream.")
else else
to_chat(user, "There's no suitable occupant in \the [src].") 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

View File

@@ -7,6 +7,8 @@
flags = CONDUCT flags = CONDUCT
w_class = ITEMSIZE_HUGE w_class = ITEMSIZE_HUGE
layer = TABLE_LAYER // Above catwalks, hopefully below other things
var/valve_open = 0 var/valve_open = 0
var/release_pressure = ONE_ATMOSPHERE var/release_pressure = ONE_ATMOSPHERE
var/release_flow_rate = ATMOS_DEFAULT_VOLUME_PUMP //in L/s var/release_flow_rate = ATMOS_DEFAULT_VOLUME_PUMP //in L/s

View File

@@ -88,9 +88,8 @@
/obj/machinery/camera/emp_act(severity) /obj/machinery/camera/emp_act(severity)
if(!isEmpProof() && prob(100/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)) affected_by_emp_until = max(affected_by_emp_until, world.time + (90 SECONDS / severity))
else
stat |= EMPED stat |= EMPED
set_light(0) set_light(0)
triggerCameraAlarm() triggerCameraAlarm()

View File

@@ -162,7 +162,7 @@ var/global/list/engineering_networks = list(
number = 1 number = 1
var/area/A = get_area(src) var/area/A = get_area(src)
if(A) if(A)
for(var/obj/machinery/camera/autoname/C in world) for(var/obj/machinery/camera/autoname/C in machines)
if(C == src) continue if(C == src) continue
var/area/CA = get_area(C) var/area/CA = get_area(C)
if(CA.type == A.type) if(CA.type == A.type)

View File

@@ -181,6 +181,8 @@
feedback_inc("cyborg_ais_created",1) feedback_inc("cyborg_ais_created",1)
qdel(src) qdel(src)
GLOBAL_LIST_BOILERPLATE(all_deactivated_AI_cores, /obj/structure/AIcore/deactivated)
/obj/structure/AIcore/deactivated /obj/structure/AIcore/deactivated
name = "inactive AI" name = "inactive AI"
icon = 'icons/mob/AI.dmi' icon = 'icons/mob/AI.dmi'
@@ -255,7 +257,7 @@
set category = "Admin" set category = "Admin"
var/list/cores = list() 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 cores["[D] ([D.loc.loc])"] = D
var/id = input("Which core?", "Toggle AI Core Latejoin", null) as null|anything in cores var/id = input("Which core?", "Toggle AI Core Latejoin", null) as null|anything in cores

View File

@@ -420,7 +420,7 @@
return dat return dat
/proc/enable_prison_shuttle(var/mob/user) /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) PS.allowedtocall = !(PS.allowedtocall)
/proc/call_shuttle_proc(var/mob/user) /proc/call_shuttle_proc(var/mob/user)

View File

@@ -10,50 +10,50 @@
var/opened = 0 var/opened = 0
verb/AccessInternals() /obj/machinery/computer/aiupload/verb/AccessInternals()
set category = "Object" set category = "Object"
set name = "Access Computer's Internals" set name = "Access Computer's Internals"
set src in oview(1) set src in oview(1)
if(get_dist(src, usr) > 1 || usr.restrained() || usr.lying || usr.stat || istype(usr, /mob/living/silicon)) 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>"
return return
opened = !opened
attackby(obj/item/weapon/O as obj, mob/user as mob) if(opened)
if (using_map && !(user.z in using_map.contact_levels)) to_chat(usr, "<span class='notice'>The access panel is now open.</span>")
user << "<span class='danger'>Unable to establish a connection:</span> You're too far away from the station!" else
return to_chat(usr, "<span class='notice'>The access panel is now closed.</span>")
if(istype(O, /obj/item/weapon/aiModule)) return
var/obj/item/weapon/aiModule/M = O
M.install(src, user)
else
..()
attack_hand(var/mob/user as mob) /obj/machinery/computer/aiupload/attackby(obj/item/weapon/O as obj, mob/user as mob)
if(src.stat & NOPOWER) if (using_map && !(user.z in using_map.contact_levels))
usr << "The upload computer has no power!" to_chat(user, "<span class='danger'>Unable to establish a connection:</span> You're too far away from the station!")
return return
if(src.stat & BROKEN) if(istype(O, /obj/item/weapon/aiModule))
usr << "The upload computer is broken!" var/obj/item/weapon/aiModule/M = O
return M.install(src, user)
else
..()
src.current = select_active_ai(user)
if (!src.current) /obj/machinery/computer/aiupload/attack_hand(var/mob/user as mob)
usr << "No active AIs detected." if(src.stat & NOPOWER)
else to_chat(user, "The upload computer has no power!")
usr << "[src.current.name] selected for law changes." return
if(src.stat & BROKEN)
to_chat(user, "The upload computer is broken!")
return return
attack_ghost(user as mob) src.current = select_active_ai(user)
return 1
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 /obj/machinery/computer/borgupload
@@ -65,28 +65,28 @@
var/mob/living/silicon/robot/current = null var/mob/living/silicon/robot/current = null
attackby(obj/item/weapon/aiModule/module as obj, mob/user as mob) /obj/machinery/computer/borgupload/attackby(obj/item/weapon/aiModule/module as obj, mob/user as mob)
if(istype(module, /obj/item/weapon/aiModule)) if(istype(module, /obj/item/weapon/aiModule))
module.install(src) module.install(src, user)
else else
return ..() return ..()
attack_hand(var/mob/user as mob) /obj/machinery/computer/borgupload/attack_hand(var/mob/user as mob)
if(src.stat & NOPOWER) if(src.stat & NOPOWER)
usr << "The upload computer has no power!" to_chat(user, "The upload computer has no power!")
return return
if(src.stat & BROKEN) if(src.stat & BROKEN)
usr << "The upload computer is broken!" to_chat(user, "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."
return return
attack_ghost(user as mob) src.current = freeborg()
return 1
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

View File

@@ -122,7 +122,7 @@
dat += "<a href='?src=\ref[src];screen=1'>Back</a>" dat += "<a href='?src=\ref[src];screen=1'>Back</a>"
dat += "<br><b>Medical Robots:</b>" dat += "<br><b>Medical Robots:</b>"
var/bdat = null 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 if(M.z != src.z) continue //only find medibots on the same z-level as the computer
var/turf/bl = get_turf(M) var/turf/bl = get_turf(M)

View File

@@ -16,7 +16,7 @@
/obj/machinery/computer/pod/New() /obj/machinery/computer/pod/New()
..() ..()
spawn( 5 ) spawn( 5 )
for(var/obj/machinery/mass_driver/M in world) for(var/obj/machinery/mass_driver/M in machines)
if(M.id == id) if(M.id == id)
connected = M connected = M
else else
@@ -32,19 +32,19 @@
viewers(null, null) << "Cannot locate mass driver connector. Cancelling firing sequence!" viewers(null, null) << "Cannot locate mass driver connector. Cancelling firing sequence!"
return return
for(var/obj/machinery/door/blast/M in world) for(var/obj/machinery/door/blast/M in machines)
if(M.id == id) if(M.id == id)
M.open() M.open()
sleep(20) sleep(20)
for(var/obj/machinery/mass_driver/M in world) for(var/obj/machinery/mass_driver/M in machines)
if(M.id == id) if(M.id == id)
M.power = connected.power M.power = connected.power
M.drive() M.drive()
sleep(50) sleep(50)
for(var/obj/machinery/door/blast/M in world) for(var/obj/machinery/door/blast/M in machines)
if(M.id == id) if(M.id == id)
M.close() M.close()
return return
@@ -182,7 +182,7 @@
time += tp time += tp
time = min(max(round(time), 0), 120) time = min(max(round(time), 0), 120)
if(href_list["door"]) 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.id == id)
if(M.density) if(M.density)
M.open() M.open()

View File

@@ -29,7 +29,7 @@
else if(screen == 1) else if(screen == 1)
dat += "<HR>Chemical Implants<BR>" dat += "<HR>Chemical Implants<BR>"
var/turf/Tr = null 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) Tr = get_turf(C)
if(!Tr) continue//Out of range if(!Tr) continue//Out of range
if(!C.implanted) continue 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 += "<A href='?src=\ref[src];inject10=\ref[C]'>(<font color=red>(10)</font>)</A><BR>"
dat += "********************************<BR>" dat += "********************************<BR>"
dat += "<HR>Tracking Implants<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) Tr = get_turf(T)
if(!Tr) continue//Out of range if(!Tr) continue//Out of range
if(!T.implanted) continue if(!T.implanted) continue

View File

@@ -92,7 +92,7 @@ var/specops_shuttle_timeleft = 0
specops_shuttle_at_station = 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 S.specops_shuttle_timereset = world.time + SPECOPS_RETURN_DELAY
qdel(announcer) qdel(announcer)
@@ -159,10 +159,10 @@ var/specops_shuttle_timeleft = 0
sleep(10) sleep(10)
var/spawn_marauder[] = new() 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") if(L.name == "Marauder Entry")
spawn_marauder.Add(L) 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") if(L.name == "Marauder Exit")
var/obj/effect/portal/P = new(L.loc) var/obj/effect/portal/P = new(L.loc)
P.invisibility = 101//So it is not seen by anyone. 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 var/mob/M = locate(/mob) in T
M << "<span class='notice'>You have arrived to [station_name()]. Commence operation!</span>" 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 S.specops_shuttle_timereset = world.time + SPECOPS_RETURN_DELAY
qdel(announcer) qdel(announcer)
@@ -241,7 +241,7 @@ var/specops_shuttle_timeleft = 0
/proc/specops_can_move() /proc/specops_can_move()
if(specops_shuttle_moving_to_station || specops_shuttle_moving_to_centcom) if(specops_shuttle_moving_to_station || specops_shuttle_moving_to_centcom)
return 0 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) if(world.timeofday <= S.specops_shuttle_timereset)
return 0 return 0
return 1 return 1

View File

@@ -209,8 +209,8 @@
return return
if("viewperipheral" in href_list) // open drive, show status of peripheral if("viewperipheral" in href_list) // open drive, show status of peripheral
var/obj/item/part/computer/C = locate(href_list["viewperipheral"]) var/obj/item/part/computer/C = locate(href_list["viewperipheral"]) in src.computer
if(!istype(C) || (C.loc != src.computer)) if(!istype(C))
return return
if(istype(C,/obj/item/part/computer/storage)) if(istype(C,/obj/item/part/computer/storage))
@@ -219,13 +219,7 @@
return return
// else ??? // else ???
if(istype(C,/obj/item/part/computer/cardslot)) if(istype(C,/obj/item/part/computer/cardslot))
if(computer.cardslot.reader != null) computer.cardslot.remove(usr)
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)
interact() interact()
return return

View File

@@ -13,147 +13,137 @@
interactable(user): performs all standard sanity checks interactable(user): performs all standard sanity checks
Call in topic() and interact(). Call in topic() and interact().
*/ */
proc/interactable(var/mob/user) /obj/machinery/computer3/proc/interactable(var/mob/user)
if( !src || !user || stat || user.stat || user.lying || user.blinded ) if( !src || !user || stat || user.stat || user.lying || user.blinded )
return 0 return 0
if(!program) if(!program)
return 0 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 if(issilicon(user) &&!program.ai_allowed )
return 0 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)) if(!in_range(src,user) && (!program.human_controls || !istype(user.get_active_hand(),/obj/item/tk_grab)))
// telekinesis check // telekinesis check
if(ishuman(user) && istype(user.get_active_hand(),/obj/item/tk_grab)) to_chat(user, "<span class='warning'>It's too complicated to work at a distance!</span>")
if(program.human_controls) return 0
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
add_fingerprint(user) add_fingerprint(user)
user.set_machine(src) user.set_machine(src)
return 1 return 1
/* /*
Deduplicates an item list and gives you range and direction. Deduplicates an item list and gives you range and direction.
This is used for networking so you can determine which of several This is used for networking so you can determine which of several
identically named objects you're referring to. identically named objects you're referring to.
*/ */
proc/format_atomlist(var/list/atoms) /obj/machinery/computer3/proc/format_atomlist(var/list/atoms)
var/list/output = list() var/list/output = list()
for(var/atom/A in atoms) for(var/atom/A in atoms)
var/title = "[A] (Range [get_dist(A,src)] meters, [dir2text(get_dir(src,A))])" var/title = "[A] (Range [get_dist(A,src)] meters, [dir2text(get_dir(src,A))])"
output[title] = A output[title] = A
return output return output
/* /*
This is used by the camera monitoring program to see if you're still in range This is used by the camera monitoring program to see if you're still in range
*/ */
check_eye(var/mob/user as mob) /obj/machinery/computer3/check_eye(var/mob/user as mob)
if(!interactable(user) || user.machine != src) if(!interactable(user) || user.machine != src)
if(user.machine == src) if(user.machine == src)
user.unset_machine() user.unset_machine()
return -1 return -1
var/datum/file/program/security/S = program var/datum/file/program/security/S = program
if( !istype(S) || !S.current || !S.current.status || !camnet ) if( !istype(S) || !S.current || !S.current.status || !camnet )
if( user.machine == src ) if( user.machine == src )
user.unset_machine() user.unset_machine()
return -1 return -1
user.reset_view(S.current, 0) user.reset_view(S.current, 0)
return 0 return 0
/* /*
List all files, including removable disks and data cards List all files, including removable disks and data cards
(I don't know why but I don't want to rip data cards out. (I don't know why but I don't want to rip data cards out.
It just seems... interesting?) It just seems... interesting?)
*/ */
proc/list_files(var/typekey = null) /obj/machinery/computer3/proc/list_files(var/typekey = null)
var/list/files = list() var/list/files = list()
if(hdd) if(hdd)
files += hdd.files files += hdd.files
if(floppy && floppy.inserted) if(floppy && floppy.inserted)
files += floppy.inserted.files files += floppy.inserted.files
if(cardslot && istype(cardslot.reader,/obj/item/weapon/card/data)) if(cardslot && istype(cardslot.reader,/obj/item/weapon/card/data))
files += cardslot.reader:files files += cardslot.reader:files
if(!ispath(typekey)) 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 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. Crash the computer with an error.
Todo: redo Todo: redo
*/ */
proc/Crash(var/errorcode = PROG_CRASH) /obj/machinery/computer3/proc/Crash(var/errorcode = PROG_CRASH)
if(!src) 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 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 ANY_DRIVE 0
#define PREFER_FLOPPY 1 #define PREFER_FLOPPY 1
#define PREFER_CARD 2 #define PREFER_CARD 2
@@ -161,22 +151,26 @@
// required_location: only put on preferred devices // required_location: only put on preferred devices
proc/writefile(var/datum/file/F, var/where = ANY_DRIVE, var/required_location = 0) /obj/machinery/computer3/proc/writefile(var/datum/file/F, var/where = ANY_DRIVE, var/required_location = 0)
if(where != ANY_DRIVE) if(where != ANY_DRIVE)
if((where&PREFER_FLOPPY) && floppy && floppy.addfile(F)) if((where&PREFER_FLOPPY) && floppy && floppy.addfile(F))
return 1 return 1
if((where&PREFER_CARD) && cardslot && cardslot.addfile(F)) if((where&PREFER_CARD) && istype(cardslot, /obj/item/part/computer/cardslot/dual))
return 1 var/obj/item/part/computer/cardslot/dual/D = cardslot
if((where&PREFER_HDD) && hdd && hdd.addfile(F)) if(D.addfile(F))
return 1 return 1
if((where&PREFER_HDD) && hdd && hdd.addfile(F))
return 1
if(required_location) if(required_location)
return 0 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 return 1
if(cardslot && cardslot.addfile(F)) if(hdd && hdd.addfile(F))
return 1 return 1
if(hdd && hdd.addfile(F)) return 0
return 1
return 0

View File

@@ -81,46 +81,46 @@
if(istype(P, /obj/item/weapon/wrench)) if(istype(P, /obj/item/weapon/wrench))
playsound(src.loc, P.usesound, 50, 1) playsound(src.loc, P.usesound, 50, 1)
if(do_after(user, 20 * P.toolspeed)) 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.anchored = 1
src.state = 1 src.state = 1
if(istype(P, /obj/item/weapon/weldingtool)) if(istype(P, /obj/item/weapon/weldingtool))
var/obj/item/weapon/weldingtool/WT = P var/obj/item/weapon/weldingtool/WT = P
if(!WT.remove_fuel(0, user)) 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 return
playsound(src.loc, WT.usesound, 50, 1) playsound(src.loc, WT.usesound, 50, 1)
if(do_after(user, 20 * WT.toolspeed)) if(do_after(user, 20 * WT.toolspeed))
if(!src || !WT.isOn()) return 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 ) new /obj/item/stack/material/steel( src.loc, 5 )
qdel(src) qdel(src)
if(1) if(1)
if(istype(P, /obj/item/weapon/wrench)) if(istype(P, /obj/item/weapon/wrench))
playsound(src.loc, P.usesound, 50, 1) playsound(src.loc, P.usesound, 50, 1)
if(do_after(user, 20 * P.toolspeed)) 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.anchored = 0
src.state = 0 src.state = 0
if(istype(P, /obj/item/weapon/circuitboard) && !circuit) if(istype(P, /obj/item/weapon/circuitboard) && !circuit)
var/obj/item/weapon/circuitboard/B = P var/obj/item/weapon/circuitboard/B = P
if(B.board_type == "computer") if(B.board_type == "computer")
playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1) 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.icon_state = "1"
src.circuit = P src.circuit = P
user.drop_item() user.drop_item()
P.loc = src P.loc = src
else 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) if(istype(P, /obj/item/weapon/screwdriver) && circuit)
playsound(src.loc, P.usesound, 50, 1) 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.state = 2
src.icon_state = "2" src.icon_state = "2"
if(istype(P, /obj/item/weapon/crowbar) && circuit) if(istype(P, /obj/item/weapon/crowbar) && circuit)
playsound(src.loc, P.usesound, 50, 1) 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.state = 1
src.icon_state = "0" src.icon_state = "0"
circuit.loc = src.loc circuit.loc = src.loc
@@ -128,7 +128,7 @@
if(2) if(2)
if(istype(P, /obj/item/weapon/screwdriver) && circuit) if(istype(P, /obj/item/weapon/screwdriver) && circuit)
playsound(src.loc, P.usesound, 50, 1) 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.state = 1
src.icon_state = "1" src.icon_state = "1"
@@ -137,10 +137,10 @@
playsound(src.loc, P.usesound, 50, 1) playsound(src.loc, P.usesound, 50, 1)
if(do_after(10 * P.toolspeed)) if(do_after(10 * P.toolspeed))
battery.loc = loc battery.loc = loc
user << "<span class='notice'>You remove [battery].</span>" to_chat(user, "<span class='notice'>You remove [battery].</span>")
battery = null battery = null
else 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(istype(P, /obj/item/weapon/cell))
if(!battery) if(!battery)
@@ -148,9 +148,9 @@
if(do_after(5)) if(do_after(5))
battery = P battery = P
P.loc = src P.loc = src
user << "<span class='notice'>You insert [battery].</span>" to_chat(user, "<span class='notice'>You insert [battery].</span>")
else 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)) if(istype(P, /obj/item/stack/cable_coil))
@@ -160,16 +160,16 @@
if(P) if(P)
P:amount -= 5 P:amount -= 5
if(!P:amount) qdel(P) 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.state = 3
src.icon_state = "3" src.icon_state = "3"
if(3) if(3)
if(istype(P, /obj/item/weapon/wirecutters)) if(istype(P, /obj/item/weapon/wirecutters))
if(components.len) if(components.len)
user << "There are parts in the way!" to_chat(user, "There are parts in the way!")
return return
playsound(src.loc, P.usesound, 50, 1) 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.state = 2
src.icon_state = "2" src.icon_state = "2"
var/obj/item/stack/cable_coil/A = new /obj/item/stack/cable_coil( src.loc ) 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(do_after(user, 20))
if(S) if(S)
S.use(2) 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.state = 4
src.icon_state = "4" src.icon_state = "4"
if(4) if(4)
if(istype(P, /obj/item/weapon/crowbar)) if(istype(P, /obj/item/weapon/crowbar))
playsound(src.loc, P.usesound, 50, 1) 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.state = 3
src.icon_state = "3" src.icon_state = "3"
new /obj/item/stack/material/glass( src.loc, 2 ) new /obj/item/stack/material/glass( src.loc, 2 )
if(istype(P, /obj/item/weapon/screwdriver)) if(istype(P, /obj/item/weapon/screwdriver))
playsound(src.loc, P.usesound, 50, 1) 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 ) var/obj/machinery/computer3/B = new src.circuit.build_path ( src.loc, built=1 )
/*if(circuit.powernet) B:powernet = circuit.powernet /*if(circuit.powernet) B:powernet = circuit.powernet
if(circuit.id) B:id = circuit.id if(circuit.id) B:id = circuit.id
@@ -220,7 +220,7 @@
*/ */
/obj/structure/computer3frame/proc/remove_peripheral(var/obj/item/I = null) /obj/structure/computer3frame/proc/remove_peripheral(var/obj/item/I = null)
if(!components || !components.len) 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 return 0
if(!I) if(!I)
I = input(usr, "Remove which component?","Remove component", null) as null|obj in components I = input(usr, "Remove which component?","Remove component", null) as null|obj in components
@@ -259,44 +259,45 @@
else else
warning("Erronous component in computerframe/remove_peripheral: [I]") warning("Erronous component in computerframe/remove_peripheral: [I]")
I.loc = loc I.loc = loc
usr << "<span class='notice'>You remove [I]</span>" to_chat(usr, "<span class='notice'>You remove [I]</span>")
return 1 return 1
return 0 return 0
/obj/structure/computer3frame/proc/insert_peripheral(var/obj/item/I) /obj/structure/computer3frame/proc/insert_peripheral(var/obj/item/I)
if(components.len >= max_components) 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 return 0
switch(I.type) switch(I.type)
if(/obj/item/part/computer/storage/hdd) if(/obj/item/part/computer/storage/hdd)
if(hdd) if(hdd)
usr << "There is already \an [hdd] in [src]!" to_chat(usr, "There is already \an [hdd] in [src]!")
return 0 return 0
hdd = I hdd = I
components += hdd components += hdd
hdd.loc = src hdd.loc = src
if(/obj/item/part/computer/storage/removable) if(/obj/item/part/computer/storage/removable)
if(floppy) if(floppy)
usr << "There is already \an [floppy] in [src]!" to_chat(usr, "There is already \an [floppy] in [src]!")
return 0 return 0
floppy = I floppy = I
components += floppy components += floppy
floppy.loc = src floppy.loc = src
if(/obj/item/part/computer/networking/radio) if(/obj/item/part/computer/networking/radio)
if(radio) if(radio)
usr << "There is already \an [radio] in [src]!" to_chat(usr, "There is already \an [radio] in [src]!")
return 0 return 0
radio = I radio = I
components += radio components += radio
radio.loc = src radio.loc = src
if(/obj/item/part/computer/networking/cameras) if(/obj/item/part/computer/networking/cameras)
if(camnet) if(camnet)
usr << "There is already \an [camnet] in [src]!" to_chat(usr, "There is already \an [camnet] in [src]!")
return 0 return 0
camnet = I camnet = I
components += camnet components += camnet
camnet.loc = src camnet.loc = src
if(/obj/item/part/computer/networking) if(/obj/item/part/computer/networking)
if(net) if(net)
usr << "There is already \an [net] in [src]!" to_chat(usr, "There is already \an [net] in [src]!")

View File

@@ -23,14 +23,14 @@
// If the computer is attacked by an item it will reference this to decide which peripheral(s) are affected. // If the computer is attacked by an item it will reference this to decide which peripheral(s) are affected.
var/list/attackby_types = list() 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) /obj/item/part/computer/proc/allow_attackby(var/obj/item/I, var/mob/user)
if(istype(I,typekey)) for(var/typepath in attackby_types)
return 1 if(istype(I, typepath))
return 0 return 1
return 0
proc/init(var/obj/machinery/computer/target) /obj/item/part/computer/proc/init(var/obj/machinery/computer/target)
computer = target computer = target
// continue to handle all other type-specific procedures // continue to handle all other type-specific procedures
@@ -49,40 +49,39 @@
var/mob/living/silicon/ai/occupant = null var/mob/living/silicon/ai/occupant = null
var/busy = 0 var/busy = 0
attackby(obj/I as obj,mob/user as mob) /obj/item/part/computer/ai_holder/attackby(obj/I as obj,mob/user as mob)
if(computer && !computer.stat) 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 if(card.grab_ai(comp_ai, user))
var/mob/living/silicon/ai/comp_ai = locate() in src occupant = null
var/mob/living/silicon/ai/card_ai = locate() in card
if(istype(comp_ai)) else if(istype(card_ai))
if(busy) load_ai(card_ai,card,user)
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
if(computer.program) if(computer.program)
computer.program.update_icon() computer.program.update_icon()
computer.update_icon()
computer.occupant = occupant computer.update_icon()
..() ..()
return 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) /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 return
// Transfer over the AI. // Transfer over the AI.
transfer << "You have been transferred into a mobile terminal. Sadly, there is no remote access from here." to_chat(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(user, "<span class='notice'>Transfer successful:</span> [transfer.name] placed within mobile terminal.")
transfer.loc = src transfer.loc = src
transfer.cancel_camera() transfer.cancel_camera()
@@ -102,228 +101,131 @@
desc = "Contains a slot for reading magnetic swipe cards." desc = "Contains a slot for reading magnetic swipe cards."
var/obj/item/weapon/card/reader = null 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_types = list(/obj/item/weapon/card)
attackby(var/obj/item/I as obj, var/mob/user as mob) /obj/item/part/computer/cardslot/attackby(var/obj/item/I as obj, var/mob/user)
if(istype(I,/obj/item/weapon/card)) if(istype(I,/obj/item/weapon/card) && computer)
insert(I) 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 return
..(I,user)
insert(I, user)
return
..(I,user)
// cardslot.insert(card, slot) // cardslot.insert(card, slot)
// card: The card obj you want to insert (usually your ID) // 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 // user: The mob inserting the card
proc/insert(var/obj/item/weapon/card/card, var/slot = 3) /obj/item/part/computer/cardslot/proc/insert(var/obj/item/weapon/card/card, var/mob/user)
if(!computer) if(equip_to_reader(card, user))
return 0 to_chat(user, "You insert the card into reader slot")
// This shouldn't happen, just in case.. return 1
if(slot == 2 && !dualslot) to_chat(user, "There is already something in the reader slot.")
usr << "This device has only one card slot" return 0
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."
// Usage of insert() preferred, as it also tells result to the user. // 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) /obj/item/part/computer/cardslot/proc/equip_to_reader(var/obj/item/weapon/card/card, var/mob/living/L)
if(!reader) if(!reader)
L.drop_item() L.drop_item()
card.loc = src card.loc = src
reader = card reader = card
return 1 return 1
return 0 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
// cardslot.remove(slot) // 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 // user: The mob removing the card
proc/remove(var/slot = 3) /obj/item/part/computer/cardslot/proc/remove(var/mob/user)
var/mob/living/L = usr if(remove_reader(user))
switch(slot) to_chat(user, "You remove the card from reader slot")
if(1) return 1
if (remove_reader(L)) to_chat(user, "There is nothing in the reader slot")
L << "You remove the card from reader slot" return 0
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"
/obj/item/part/computer/cardslot/proc/remove_reader(var/mob/living/L)
proc/remove_reader(var/mob/living/L) if(reader)
if(reader) if(ishuman(L) && !L.get_active_hand())
reader.loc = loc L.put_in_hands(reader)
if(istype(L) && !L.get_active_hand()) else
if(istype(L,/mob/living/carbon/human)) reader.loc = get_turf(computer)
L.put_in_hands(reader) reader = null
else return 1
reader.loc = get_turf(computer) return 0
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
// Authorizes the user based on the computer's requirements // Authorizes the user based on the computer's requirements
proc/authenticate() /obj/item/part/computer/cardslot/proc/authenticate()
return computer.check_access(reader) 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 /obj/item/part/computer/cardslot/dual
name = "magnetic card reader" name = "magnetic card reader"
desc = "Contains slots for inserting magnetic swipe cards for reading and writing." desc = "Contains slots for inserting magnetic swipe cards for reading and writing."
dualslot = 1
var/obj/item/weapon/card/writer = null
/* // Ater: Single- and dual-slot card readers have separate functions.
// Atlantis: Reworked card manipulation a bit. // According to OOP principles, they should be separate classes and use inheritance, polymorphism.
// 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.
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 /obj/item/part/computer/cardslot/dual/proc/equip_to_writer(var/obj/item/weapon/card/card, var/mob/living/L)
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.") if(!writer)
computer.emagged = 1 L.drop_item()
return 1 card.loc = src
writer = card
return 1
return 0
if(slot == 1) // 1: writer /obj/item/part/computer/cardslot/dual/proc/remove_from_writer(var/mob/living/L)
if(writer != null) if(writer)
usr << "There's already a card in that slot!" if(ishuman(L) && !L.get_active_hand())
return 0 L.put_in_hands(writer)
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)
else 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

View File

@@ -45,7 +45,6 @@
// Misc & special purpose // Misc & special purpose
var/obj/item/part/computer/ai_holder/cradle = null var/obj/item/part/computer/ai_holder/cradle = null
var/obj/item/part/computer/toybox/toybox = null var/obj/item/part/computer/toybox/toybox = null
var/mob/living/silicon/ai/occupant = null
// Legacy variables // Legacy variables
@@ -70,160 +69,171 @@
var/obj/item/weapon/cell/battery = null // uninterruptible power supply aka battery 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() if(show_keyboard)
set name = "Reset Computer" var/kb_state = "kb[rand(1,15)]"
set category = "Object" kb = image('icons/obj/computer3.dmi',icon_state=kb_state)
set src in view(1) overlays += kb
if(usr.stat || usr.restrained() || usr.lying || !istype(usr, /mob/living)) if(!built)
usr << "<span class='warning'>You can't do that.</span>" if(!circuitb || !istype(circuitb))
return circuitb = new(src)
if(circuitb.OS)
os = circuitb.OS
circuitb.OS.computer = src
else
os = null
if(!Adjacent(usr)) // separated into its own function because blech
usr << "You can't reach it." spawn_parts()
return
Reset() if(default_prog) // Add the default software if applicable
var/datum/file/program/P = new default_prog
New(var/L, var/built = 0) if(hdd)
..() hdd.addfile(P,1)
spawn(2) program = P
power_change() if(!os)
os = P
if(show_keyboard) else if(floppy)
var/kb_state = "kb[rand(1,15)]" floppy.inserted = new(floppy)
kb = image('icons/obj/computer3.dmi',icon_state=kb_state) floppy.files = floppy.inserted.files
overlays += kb floppy.addfile(P)
program = P
if(!built)
if(!circuitb || !istype(circuitb))
circuitb = new(src)
if(circuitb.OS)
os = circuitb.OS
circuitb.OS.computer = src
else else
os = null circuitb.OS = P
circuitb.OS.computer = src
os = circuitb.OS
circuitb.name = "Circuitboard ([P])"
// separated into its own function because blech if(hdd) // Spawn files
spawn_parts() for(var/typekey in spawn_files)
hdd.addfile(new typekey,1)
if(default_prog) // Add the default software if applicable update_icon()
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])"
/obj/machinery/computer3/verb/ResetComputer()
set name = "Reset Computer"
set category = "Object"
set src in view(1)
if(hdd) // Spawn files if(usr.stat || usr.restrained() || usr.lying || !istype(usr, /mob/living))
for(var/typekey in spawn_files) to_chat(usr, "<span class='warning'>You can't do that.</span>")
hdd.addfile(new typekey,1) return
update_icon() if(!Adjacent(usr))
to_chat(usr, "You can't reach it.")
return
Reset()
proc/update_spawn_files() /obj/machinery/computer3/proc/update_spawn_files()
for(var/typekey in spawn_files) for(var/typekey in spawn_files)
hdd.addfile(new typekey,1) hdd.addfile(new typekey,1)
proc/spawn_parts() /obj/machinery/computer3/proc/spawn_parts()
for(var/typekey in spawn_parts) for(var/typekey in spawn_parts)
if(ispath(typekey,/obj/item/part/computer/storage/removable))
if(ispath(typekey,/obj/item/part/computer/storage/removable)) if(floppy)
if(floppy) continue
floppy = new typekey(src)
floppy.init(src)
continue continue
if(ispath(typekey,/obj/item/part/computer/storage/hdd)) floppy = new typekey(src)
if(hdd) continue floppy.init(src)
hdd = new typekey(src) continue
hdd.init(src)
if(ispath(typekey,/obj/item/part/computer/storage/hdd))
if(hdd)
continue continue
hdd = new typekey(src)
hdd.init(src)
continue
if(ispath(typekey,/obj/item/part/computer/networking/cameras)) if(ispath(typekey,/obj/item/part/computer/networking/cameras))
if(camnet) continue if(camnet)
camnet = new typekey(src)
camnet.init(src)
continue continue
if(ispath(typekey,/obj/item/part/computer/networking/radio)) camnet = new typekey(src)
if(radio) continue camnet.init(src)
radio = new typekey(src) continue
radio.init(src)
if(ispath(typekey,/obj/item/part/computer/networking/radio))
if(radio)
continue continue
if(ispath(typekey,/obj/item/part/computer/networking)) radio = new typekey(src)
if(net) continue radio.init(src)
net = new typekey(src) continue
net.init(src)
if(ispath(typekey,/obj/item/part/computer/networking))
if(net)
continue continue
net = new typekey(src)
net.init(src)
continue
if(ispath(typekey,/obj/item/part/computer/cardslot)) if(ispath(typekey,/obj/item/part/computer/cardslot))
if(cardslot) continue if(cardslot)
cardslot = new typekey(src)
cardslot.init(src)
continue continue
if(ispath(typekey,/obj/item/part/computer/ai_holder)) cardslot = new typekey(src)
if(cradle) continue cardslot.init(src)
cradle = new typekey(src) continue
cradle.init(src)
if(ispath(typekey,/obj/item/part/computer/toybox)) if(ispath(typekey,/obj/item/part/computer/ai_holder))
if(toybox) continue if(cradle)
toybox = new typekey(src)
toybox.init(src)
continue continue
cradle = new typekey(src)
cradle.init(src)
continue
if(ispath(typekey,/obj/item/weapon/cell)) if(ispath(typekey,/obj/item/part/computer/toybox))
if(battery) continue if(toybox)
battery = new typekey(src)
continue continue
toybox = new typekey(src)
toybox.init(src)
continue
proc/Reset(var/error = 0) if(ispath(typekey,/obj/item/weapon/cell))
for(var/mob/living/M in range(1)) if(battery)
M << browse(null,"window=\ref[src]") continue
if(program) battery = new typekey(src)
program.Reset() continue
program = null
req_access = os.req_access
update_icon()
// 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) // todo does this do enough
if(prob(20/severity)) set_broken()
..() /obj/machinery/computer3/emp_act(severity)
if(prob(20/severity)) set_broken()
..()
ex_act(severity) /obj/machinery/computer3/ex_act(severity)
switch(severity) switch(severity)
if(1.0) if(1.0)
qdel(src)
return
if(2.0)
if (prob(25))
qdel(src) qdel(src)
return return
if(2.0) if (prob(50))
if (prob(25)) for(var/x in verbs)
qdel(src) verbs -= x
return set_broken()
if (prob(50)) if(3.0)
for(var/x in verbs) if (prob(25))
verbs -= x for(var/x in verbs)
set_broken() verbs -= x
if(3.0) set_broken()
if (prob(25)) else
for(var/x in verbs) return
verbs -= x
set_broken()
else
return
/* /*
Computers have the capability to use a battery backup. Computers have the capability to use a battery backup.
@@ -244,201 +254,199 @@
Make sure to use use_power() a bunch in peripherals code Make sure to use use_power() a bunch in peripherals code
*/ */
auto_use_power() /obj/machinery/computer3/auto_use_power()
if(!powered(power_channel)) if(!powered(power_channel))
if(battery && battery.charge > 0) if(battery && battery.charge > 0)
if(use_power == 1) if(use_power == 1)
battery.use(idle_power_usage) 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]
else 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) /obj/machinery/computer3/use_power(var/amount, var/chan = -1)
P.attackby(I,user) if(chan == -1)
return chan = power_channel
..()
attack_hand(var/mob/user as mob) var/area/A = get_area(loc)
if(stat) if(istype(A) && A.powered(chan))
Reset() A.use_power(amount, chan)
return 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 /obj/machinery/computer3/power_change()
// there is still cardauth anyway if( !powered(power_channel) && (!battery || battery.charge <= 0) )
//if(!allowed(user)) stat |= NOPOWER
// return else
stat &= ~NOPOWER
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/process()
auto_use_power()
power_change()
update_icon() 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) icon_state = initial(icon_state)
// Broken icon_state += "0"
if(stat & BROKEN) return
icon_state += "b" 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 //Returns percentage of battery charge remaining. Returns -1 if no battery is installed.
else if(stat & NOPOWER) /obj/machinery/computer3/proc/check_battery_status()
icon_state = initial(icon_state) if (battery)
icon_state += "0" var/obj/item/weapon/cell/B = battery
return return round(B.charge / (B.maxcharge / 100))
if(stat) else
overlays.Cut() return -1
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

View File

@@ -22,206 +22,153 @@
var/emagged = 0 var/emagged = 0
interact() /datum/file/program/holodeck/interact()
if(!interactable()) if(!interactable())
return return
var/dat = "<h3>Current Loaded Programs</h3>" var/dat = "<h3>Current Loaded Programs</h3>"
dat += "<A href='?src=\ref[src];emptycourt'>((Empty Court))</A><BR>" 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];boxingcourt'>((Boxing Court))</A><BR>"
dat += "<A href='?src=\ref[src];basketball'>((Basketball 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];thunderdomecourt'>((Thunderdome Court))</A><BR>"
dat += "<A href='?src=\ref[src];beach'>((Beach))</A><BR>" dat += "<A href='?src=\ref[src];beach'>((Beach))</A><BR>"
// dat += "<A href='?src=\ref[src];turnoff'>((Shutdown System))</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) if(emagged)
dat += "<A href='?src=\ref[src];burntest'>(<font color=red>Begin Atmospheric Burn Simulation</font>)</A><BR>" 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 += "Ensure the holodeck is empty before testing.<BR>"
dat += "<BR>" dat += "<BR>"
dat += "<A href='?src=\ref[src];wildlifecarp'>(<font color=red>Begin Wildlife Simulation</font>)</A><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 += "Ensure the holodeck is empty before testing.<BR>"
dat += "<BR>" dat += "<BR>"
if(issilicon(usr)) if(issilicon(usr))
dat += "<A href='?src=\ref[src];AIoverride'>(<font color=green>Re-Enable Safety Protocols?</font>)</A><BR>" 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>" dat += "Safety Protocols are <font class='bad'>DISABLED</font><BR>"
else else
if(issilicon(usr)) if(issilicon(usr))
dat += "<A href='?src=\ref[src];AIoverride'>(<font color=red>Override Safety Protocols?</font>)</A><BR>" dat += "<A href='?src=\ref[src];AIoverride'>(<font color=red>Override Safety Protocols?</font>)</A><BR>"
dat += "<BR>" dat += "<BR>"
dat += "Safety Protocols are <font class='good'>ENABLED</font><BR>" dat += "Safety Protocols are <font class='good'>ENABLED</font><BR>"
popup.set_content(dat) popup.set_content(dat)
popup.open() popup.open()
return
/datum/file/program/holodeck/Topic(var/href, var/list/href_list)
if(!interactable() || ..(href,href_list))
return return
if("emptycourt" in href_list)
target = locate(/area/holodeck/source_emptycourt)
if(target)
loadProgram(target)
Topic(var/href, var/list/href_list) else if("boxingcourt" in href_list)
if(!interactable() || ..(href,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 return
target = locate(/area/holodeck/source_burntest)
if(target)
loadProgram(target)
if("emptycourt" in href_list) else if("wildlifecarp" in href_list)
target = locate(/area/holodeck/source_emptycourt) if(!emagged)
if(target) return
loadProgram(target) target = locate(/area/holodeck/source_wildlife)
if(target)
loadProgram(target)
else if("boxingcourt" in href_list) else if("AIoverride" in href_list)
target = locate(/area/holodeck/source_boxingcourt) if(!issilicon(usr))
if(target) return
loadProgram(target) 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) interact()
target = locate(/area/holodeck/source_basketball) return
if(target)
loadProgram(target)
else if("thunderdomecourt" in href_list) /datum/file/program/holodeck/Reset()
target = locate(/area/holodeck/source_thunderdomecourt) emergencyShutdown()
if(target)
loadProgram(target)
else if("beach" in href_list) /datum/file/program/holodeck/process()
target = locate(/area/holodeck/source_beach) if(active)
if(target) if(!checkInteg(linkedholodeck))
loadProgram(target) damaged = 1
else if("turnoff" in href_list)
target = locate(/area/holodeck/source_plating) target = locate(/area/holodeck/source_plating)
if(target) if(target)
loadProgram(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 active = 0
for(var/mob/M in range(10,src))
M.show_message("The holodeck overloads!")
for(var/turf/T in linkedholodeck)
proc/loadProgram(var/area/A) if(prob(30))
var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread
if(world.time < (last_change + 25)) s.set_up(2, 1, T)
if(world.time < (last_change + 15))//To prevent super-spam clicking, reduced process size and annoyance -Sieve s.start()
return T.ex_act(3)
for(var/mob/M in range(3,src)) T.hotspot_expose(1000,500,1)
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) 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) /datum/file/program/holodeck/proc/derez(var/obj/obj , var/silent = 1)
qdel(B) holographic_items.Remove(obj)
for(var/mob/living/simple_animal/hostile/carp/C in linkedholodeck) if(obj == null)
qdel(C) 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) if(!silent)
for(var/obj/item/weapon/holo/esword/H in linkedholodeck) var/obj/oldobj = obj
H.damtype = BRUTE 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) spawn(30)
for(var/obj/effect/landmark/L in linkedholodeck) for(var/obj/effect/landmark/L in linkedholodeck)
@@ -234,20 +181,65 @@
if(T) if(T)
T.temperature = 5000 T.temperature = 5000
T.hotspot_expose(50000,50000,1) T.hotspot_expose(50000,50000,1)
if(L.name=="Holocarp Spawn") active = 1
new /mob/living/simple_animal/hostile/carp(L.loc) else
proc/emergencyShutdown()
//Get rid of any items
for(var/item in holographic_items) for(var/item in holographic_items)
derez(item) 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) var/area/targetsource = locate(/area/holodeck/source_plating)
targetsource.copy_contents_to(linkedholodeck , 1) targetsource.copy_contents_to(linkedholodeck , 1)
active = 0 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

View File

@@ -24,17 +24,20 @@
/obj/item/toy/prize/odysseus = 1, /obj/item/toy/prize/odysseus = 1,
/obj/item/toy/prize/phazon = 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 /datum/file/program/arcade
desc = "The best arcade game ever produced by the Company's short-lived entertainment divison." 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 enemy_name = replacetext(name_part1, "the ", "") + name_part2
name = (name_action + name_part1 + name_part2) name = (name_action + name_part1 + name_part2)
/datum/file/program/arcade/interact() /datum/file/program/arcade/interact()
if(!interactable()) if(!interactable())
return return

View File

@@ -9,91 +9,92 @@
active_state = "alert:2" active_state = "alert:2"
refresh = 1 refresh = 1
execute(var/datum/file/program/source) /datum/file/program/atmos_alert/execute(var/datum/file/program/source)
..(source) ..(source)
if(!computer.radio) if(!computer.radio)
computer.Crash(MISSING_PERIPHERAL) 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 // This will be called as long as the program is running on the parent computer
// and the computer has the radio peripheral // and the computer has the radio peripheral
receive_signal(datum/signal/signal) /datum/file/program/atmos_alert/receive_signal(datum/signal/signal)
if(!signal || signal.encryption) return if(!signal || signal.encryption)
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()
return return
var/zone = signal.data["zone"]
var/severity = signal.data["alert"]
if(!zone || !severity)
return
interact() minor_air_alarms -= zone
if(!interactable()) priority_air_alarms -= zone
return if(severity=="severe")
if(!computer.radio) priority_air_alarms += zone
computer.Crash(MISSING_PERIPHERAL) else if (severity=="minor")
minor_air_alarms += zone
popup.set_content(return_text())
popup.open()
update_icon() update_icon()
..() return
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()
proc/return_text() /datum/file/program/atmos_alert/interact()
var/priority_text = "<h2>Priority Alerts:</h2>" if(!interactable())
var/minor_text = "<h2>Minor Alerts:</h2>" return
if(!computer.radio)
computer.Crash(MISSING_PERIPHERAL)
if(priority_air_alarms.len) popup.set_content(return_text())
for(var/zone in priority_air_alarms) popup.open()
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_air_alarms.len) /datum/file/program/atmos_alert/update_icon()
for(var/zone in minor_air_alarms) ..()
minor_text += "<B>[format_text(zone)]</B> [topic_link(src,"minor_clear=[ckey(zone)]","X")]<BR>" if(priority_air_alarms.len > 0)
else overlay.icon_state = "alert:2"
minor_text += "No minor alerts detected.<BR>" 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) /datum/file/program/atmos_alert/proc/return_text()
if(!interactable() || ..(href,href_list)) var/priority_text = "<h2>Priority Alerts:</h2>"
return var/minor_text = "<h2>Minor Alerts:</h2>"
if("priority_clear" in href_list) if(priority_air_alarms.len)
var/removing_zone = href_list["priority_clear"] for(var/zone in priority_air_alarms)
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>"
if(ckey(zone) == removing_zone) else
usr << "<span class='notice'>Priority Alert for area [zone] cleared.</span>" priority_text += "No priority alerts detected.<BR>"
priority_air_alarms -= zone
if("minor_clear" in href_list) if(minor_air_alarms.len)
var/removing_zone = href_list["minor_clear"] for(var/zone in minor_air_alarms)
for(var/zone in minor_air_alarms) minor_text += "<B>[format_text(zone)]</B> [topic_link(src,"minor_clear=[ckey(zone)]","X")]<BR>"
if(ckey(zone) == removing_zone) else
usr << "<span class='notice'>Minor Alert for area [zone] cleared.</span>" minor_text += "No minor alerts detected.<BR>"
minor_air_alarms -= zone
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()

View File

@@ -23,10 +23,10 @@
allow_disassemble = 0 allow_disassemble = 0
// No operating system // No operating system
New() /obj/machinery/computer3/security/wooden_tv/New()
..(built=0) ..(built=0)
os = program os = program
circuitb.OS = os circuitb.OS = os
/obj/machinery/computer3/security/mining /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/networks = list("ALL") // A little workaround as it is not possible to place station_networks here
var/screen = "cameras" var/screen = "cameras"
execute(var/datum/file/source) /datum/file/camnet_key/execute(var/datum/file/source)
if(istype(source,/datum/file/program/security)) if(istype(source,/datum/file/program/security))
var/datum/file/program/security/prog = source var/datum/file/program/security/prog = source
prog.key = src prog.key = src
prog.camera_list = null prog.camera_list = null
return return
if(istype(source,/datum/file/program/ntos)) if(istype(source,/datum/file/program/ntos))
for(var/obj/item/part/computer/storage/S in list(computer.hdd,computer.floppy)) for(var/obj/item/part/computer/storage/S in list(computer.hdd,computer.floppy))
for(var/datum/file/F in S.files) for(var/datum/file/F in S.files)
if(istype(F,/datum/file/program/security)) if(istype(F,/datum/file/program/security))
var/datum/file/program/security/Sec = F var/datum/file/program/security/Sec = F
Sec.key = src Sec.key = src
Sec.camera_list = null Sec.camera_list = null
Sec.execute(source) Sec.execute(source)
return return
computer.Crash(MISSING_PROGRAM) computer.Crash(MISSING_PROGRAM)
/datum/file/camnet_key/New() /datum/file/camnet_key/New()
for(var/N in networks) for(var/N in networks)
@@ -150,28 +150,29 @@
var/mapping = 0//For the overview file, interesting bit of code. var/mapping = 0//For the overview file, interesting bit of code.
//proc/camera_list(var/datum/file/camnet_key/key) //proc/camera_list(var/datum/file/camnet_key/key)
get_machines(var/datum/file/camnet_key/key) /obj/item/part/computer/networking/cameras/get_machines(var/datum/file/camnet_key/key)
if (!computer || computer.z > 6) if (!computer || computer.z > 6)
return null return null
cameranet.process_sort() cameranet.process_sort()
var/list/L = list() var/list/L = list()
for(var/obj/machinery/camera/C in cameranet.cameras) for(var/obj/machinery/camera/C in cameranet.cameras)
var/list/temp = C.network & key.networks var/list/temp = C.network & key.networks
if(temp.len) if(temp.len)
L.Add(C) L.Add(C)
return L return L
verify_machine(var/obj/machinery/camera/C,var/datum/file/camnet_key/key = null)
if(!istype(C) || !C.can_use()) /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 return 0
return 1
if(key)
var/list/temp = C.network & key.networks
if(!temp.len)
return 0
return 1
/* /*
Camera monitoring program Camera monitoring program
@@ -198,96 +199,96 @@
var/obj/machinery/camera/current = null var/obj/machinery/camera/current = null
execute(var/datum/file/program/caller) /datum/file/program/security/execute(var/datum/file/program/caller)
..(caller) ..(caller)
if(computer && !key) if(computer && !key)
var/list/fkeys = computer.list_files(/datum/file/camnet_key) var/list/fkeys = computer.list_files(/datum/file/camnet_key)
if(fkeys && fkeys.len) if(fkeys && fkeys.len)
key = fkeys[1] key = fkeys[1]
update_icon() update_icon()
computer.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()
for(var/mob/living/L in viewers(1)) for(var/mob/living/L in viewers(1))
if(!istype(L,/mob/living/silicon/ai) && L.machine == src) if(!istype(L,/mob/living/silicon/ai) && L.machine == src)
L.reset_view(null) L.reset_view(null)
interact()
if(!interactable())
return
if(!computer.camnet) /datum/file/program/security/Reset()
computer.Crash(MISSING_PERIPHERAL) ..()
return 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) 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 return
if("show" in href_list) if(computer.camnet.verify_machine(current))
var/obj/machinery/camera/C = locate(href_list["show"]) usr.reset_view(current)
if(istype(C) && C.can_use())
set_current(C)
usr.reset_view(C)
interact()
return
if("keyselect" in href_list) if(world.time - last_camera_refresh > 50 || !camera_list)
reset_current() last_camera_refresh = world.time
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) var/list/temp_list = computer.camnet.get_machines(key)
select_key(key)
if(key) camera_list = "Network Key: [key.title] [topic_link(src,"keyselect","\[ Select key \]")]<hr>"
interact() 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 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 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) /datum/file/program/security/proc/select_key(var/selected_key)
key = selected_key key = selected_key
camera_list = null camera_list = null
@@ -332,20 +333,20 @@
var/special_key = new/datum/file/camnet_key/syndicate var/special_key = new/datum/file/camnet_key/syndicate
var/camera_conn = null var/camera_conn = null
interact() /datum/file/program/security/syndicate/interact()
if(!interactable()) if(!interactable())
return return
if(!computer.net) if(!computer.net)
computer.Crash(MISSING_PERIPHERAL) computer.Crash(MISSING_PERIPHERAL)
return 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) if(!camera_conn)
computer.Crash(NETWORK_FAILURE) computer.Crash(NETWORK_FAILURE)
return return
// On interact, override camera key selection // On interact, override camera key selection
select_key(special_key) select_key(special_key)
..() ..()

View File

@@ -23,329 +23,325 @@
var/auth = 0 var/auth = 0
var/printing = 0 var/printing = 0
proc/list_jobs() /datum/file/program/card_comp/proc/list_jobs()
return get_all_jobs() + "Custom" return get_all_jobs() + "Custom"
// creates the block with the script in it // creates the block with the script in it
// cache the result since it's almost constant but not quite // cache the result since it's almost constant but not quite
// the list of jobs won't change after all... // the list of jobs won't change after all...
proc/scriptblock() /datum/file/program/card_comp/proc/scriptblock()
var/global/dat = null var/global/dat = null
var/counter = 0 var/counter = 0
var jobs_all = "" var jobs_all = ""
jobs_all += "<table><tr><td></td><td><b>Command</b></td>" 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 += "</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=Colony Director'>Colony Director</a></td>"
jobs_all += "<td weight='100'><a href='?src=\ref[src];;assign=Custom'>Custom</a></td>" jobs_all += "<td weight='100'><a href='?src=\ref[src];;assign=Custom'>Custom</a></td>"
counter = 0 counter = 0
jobs_all += "</tr><tr><td><font color='#A50000'><b>Security</b></font></td>"//Red jobs_all += "</tr><tr><td><font color='#A50000'><b>Security</b></font></td>"//Red
for(var/job in security_positions) for(var/job in security_positions)
counter++ counter++
if(counter >= 6) if(counter >= 6)
jobs_all += "</tr><tr height='20'><td></td><td></td>" jobs_all += "</tr><tr height='20'><td></td><td></td>"
counter = 0 counter = 0
jobs_all += "<td height='20' weight='100'><a href='?src=\ref[src];assign=[job]'>[replacetext(job, " ", "&nbsp")]</a></td>" jobs_all += "<td height='20' weight='100'><a href='?src=\ref[src];assign=[job]'>[replacetext(job, " ", "&nbsp")]</a></td>"
counter = 0 counter = 0
jobs_all += "</tr><tr><td><font color='#FFA500'><b>Engineering</b></font></td>"//Orange jobs_all += "</tr><tr><td><font color='#FFA500'><b>Engineering</b></font></td>"//Orange
for(var/job in engineering_positions) for(var/job in engineering_positions)
counter++ counter++
if(counter >= 6) if(counter >= 6)
jobs_all += "</tr><tr height='20'><td></td><td></td>" jobs_all += "</tr><tr height='20'><td></td><td></td>"
counter = 0 counter = 0
jobs_all += "<td height='20' weight='100'><a href='?src=\ref[src];assign=[job]'>[replacetext(job, " ", "&nbsp")]</a></td>" jobs_all += "<td height='20' weight='100'><a href='?src=\ref[src];assign=[job]'>[replacetext(job, " ", "&nbsp")]</a></td>"
counter = 0 counter = 0
jobs_all += "</tr><tr height='20'><td><font color='#008000'><b>Medical</b></font></td>"//Green jobs_all += "</tr><tr height='20'><td><font color='#008000'><b>Medical</b></font></td>"//Green
for(var/job in medical_positions) for(var/job in medical_positions)
counter++ counter++
if(counter >= 6) if(counter >= 6)
jobs_all += "</tr><tr height='20'><td></td><td></td>" jobs_all += "</tr><tr height='20'><td></td><td></td>"
counter = 0 counter = 0
jobs_all += "<td weight='100'><a href='?src=\ref[src];assign=[job]'>[replacetext(job, " ", "&nbsp")]</a></td>" jobs_all += "<td weight='100'><a href='?src=\ref[src];assign=[job]'>[replacetext(job, " ", "&nbsp")]</a></td>"
counter = 0 counter = 0
jobs_all += "</tr><tr height='20'><td><font color='#800080'><b>Science</b></font></td>"//Purple jobs_all += "</tr><tr height='20'><td><font color='#800080'><b>Science</b></font></td>"//Purple
for(var/job in science_positions) for(var/job in science_positions)
counter++ counter++
if(counter >= 6) if(counter >= 6)
jobs_all += "</tr><tr height='20'><td></td><td></td>" jobs_all += "</tr><tr height='20'><td></td><td></td>"
counter = 0 counter = 0
jobs_all += "<td weight='100'><a href='?src=\ref[src];assign=[job]'>[replacetext(job, " ", "&nbsp")]</a></td>" jobs_all += "<td weight='100'><a href='?src=\ref[src];assign=[job]'>[replacetext(job, " ", "&nbsp")]</a></td>"
counter = 0 counter = 0
jobs_all += "</tr><tr height='20'><td><font color='#808080'><b>Civilian</b></font></td>"//Grey jobs_all += "</tr><tr height='20'><td><font color='#808080'><b>Civilian</b></font></td>"//Grey
for(var/job in civilian_positions) for(var/job in civilian_positions)
counter++ counter++
if(counter >= 6) if(counter >= 6)
jobs_all += "</tr><tr height='20'><td></td><td></td>" jobs_all += "</tr><tr height='20'><td></td><td></td>"
counter = 0 counter = 0
jobs_all += "<td weight='100'><a href='?src=\ref[src];assign=[job]'>[replacetext(job, " ", "&nbsp")]</a></td>" jobs_all += "<td weight='100'><a href='?src=\ref[src];assign=[job]'>[replacetext(job, " ", "&nbsp")]</a></td>"
dat = {"<script type="text/javascript"> dat = {"<script type="text/javascript">
function markRed(){ function markRed(){
var nameField = document.getElementById('namefield'); var nameField = document.getElementById('namefield');
nameField.style.backgroundColor = "#FFDDDD"; nameField.style.backgroundColor = "#FFDDDD";
} }
function markGreen(){ function markGreen(){
var nameField = document.getElementById('namefield'); var nameField = document.getElementById('namefield');
nameField.style.backgroundColor = "#DDFFDD"; nameField.style.backgroundColor = "#DDFFDD";
} }
function markAccountGreen(){ function markAccountGreen(){
var nameField = document.getElementById('accountfield'); var nameField = document.getElementById('accountfield');
nameField.style.backgroundColor = "#DDFFDD"; nameField.style.backgroundColor = "#DDFFDD";
} }
function markAccountRed(){ function markAccountRed(){
var nameField = document.getElementById('accountfield'); var nameField = document.getElementById('accountfield');
nameField.style.backgroundColor = "#FFDDDD"; nameField.style.backgroundColor = "#FFDDDD";
} }
function showAll(){ function showAll(){
var allJobsSlot = document.getElementById('alljobsslot'); var allJobsSlot = document.getElementById('alljobsslot');
allJobsSlot.innerHTML = "<a href='#' onclick='hideAll()'>hide</a><br>"+ "[jobs_all]"; allJobsSlot.innerHTML = "<a href='#' onclick='hideAll()'>hide</a><br>"+ "[jobs_all]";
} }
function hideAll(){ function hideAll(){
var allJobsSlot = document.getElementById('alljobsslot'); var allJobsSlot = document.getElementById('alljobsslot');
allJobsSlot.innerHTML = "<a href='#' onclick='showAll()'>[(writer.assignment) ? writer.assignment : "Unassgied"]</a>"; allJobsSlot.innerHTML = "<a href='#' onclick='showAll()'>[(writer.assignment) ? writer.assignment : "Unassgied"]</a>";
} }
</script>"} </script>"}
return dat return dat
// creates the list of access rights on the card // creates the list of access rights on the card
proc/accessblock() /datum/file/program/card_comp/proc/accessblock()
var/accesses = "<div align='center'><b>Access</b></div>" var/accesses = "<div align='center'><b>Access</b></div>"
accesses += "<table style='width:100%'>" accesses += "<table style='width:100%'>"
accesses += "<tr>" accesses += "<tr>"
for(var/i = 1; i <= 7; i++) for(var/i = 1; i <= 7; i++)
accesses += "<td style='width:14%'><b>[get_region_accesses_name(i)]:</b></td>" accesses += "<td style='width:14%'><b>[get_region_accesses_name(i)]:</b></td>"
accesses += "</tr><tr>" accesses += "</tr><tr>"
for(var/i = 1; i <= 7; i++) for(var/i = 1; i <= 7; i++)
accesses += "<td style='width:14%' valign='top'>" accesses += "<td style='width:14%' valign='top'>"
for(var/A in get_region_accesses(i)) for(var/A in get_region_accesses(i))
if(A in writer.access) if(A in writer.access)
accesses += topic_link(src,"access=[A]","<font color='red'>[replacetext(get_access_desc(A), " ", "&nbsp")]</font>") + " " accesses += topic_link(src,"access=[A]","<font color='red'>[replacetext(get_access_desc(A), " ", "&nbsp")]</font>") + " "
else else
accesses += topic_link(src,"access=[A]",replacetext(get_access_desc(A), " ", "&nbsp")) + " " accesses += topic_link(src,"access=[A]",replacetext(get_access_desc(A), " ", "&nbsp")) + " "
accesses += "<br>" accesses += "<br>"
accesses += "</td>" accesses += "</td>"
accesses += "</tr></table>" accesses += "</tr></table>"
return accesses return accesses
proc/card_modify_menu() /datum/file/program/card_comp/proc/card_modify_menu()
//assume peripherals and cards, do checks for them in interact //assume peripherals and cards, do checks for them in interact
// Header // Header
var/dat = "<div align='center'><br>" var/dat = "<div align='center'><br>"
dat += topic_link(src,"remove=writer","Remove [writer.name]") + " || " dat += topic_link(src,"remove=writer","Remove [writer.name]") + " || "
dat += topic_link(src,"remove=reader","Remove [reader.name]") + " <br> " dat += topic_link(src,"remove=reader","Remove [reader.name]") + " <br> "
dat += topic_link(src,"mode=1","Access Crew Manifest") + " || " dat += topic_link(src,"mode=1","Access Crew Manifest") + " || "
dat += topic_link(src,"logout","Log Out") + "</div>" dat += topic_link(src,"logout","Log Out") + "</div>"
dat += "<hr>" + scriptblock() dat += "<hr>" + scriptblock()
// form for renaming the ID // form for renaming the ID
dat += "<form name='cardcomp' action='byond://' method='get'>" dat += "<form name='cardcomp' action='byond://' method='get'>"
dat += "<input type='hidden' name='src' value='\ref[src]'>" 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 += "<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 += "<input type='submit' value='Rename' onclick='markGreen()'>"
dat += "</form>" dat += "</form>"
// form for changing assignment, taken care of by scriptblock() mostly // form for changing assignment, taken care of by scriptblock() mostly
var/assign_temp = writer.assignment var/assign_temp = writer.assignment
if(!assign_temp || assign_temp == "") assign_temp = "Unassigned" if(!assign_temp || assign_temp == "") assign_temp = "Unassigned"
dat += "<b>Assignment:</b> [assign_temp] <span id='alljobsslot'><a href='#' onclick='showAll()'>change</a></span>" dat += "<b>Assignment:</b> [assign_temp] <span id='alljobsslot'><a href='#' onclick='showAll()'>change</a></span>"
// list of access rights // list of access rights
dat += accessblock() 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() if(istype(writer))
//assume peripherals and cards, do checks for them in interact dat += "Target: [topic_link(src,"remove=writer",writer.name)]<br>"
var/dat = "<br><i>Please insert the cards into the slots</i><br>" else
dat += "Target: [topic_link(src,"insert=writer","--------")]<br>"
if(istype(writer)) if(istype(reader))
dat += "Target: [topic_link(src,"remove=writer",writer.name)]<br>" 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 else
dat += "Target: [topic_link(src,"insert=writer","--------")]<br>" computer.cardslot.remove(usr, 1)
auth = 0
if(istype(reader)) if("insert" in href_list)
dat += "Confirm Identity: [topic_link(src,"remove=reader",reader.name)]<br>" 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 else
dat += "Confirm Identity: [topic_link(src,"insert=reader","--------")]<br>" computer.cardslot.insert(card,usr)
dat += "[topic_link(src,"auth","{Log in}")]<br><hr>"
dat += topic_link(src,"mode=1","Access Crew Manifest")
return dat
proc/show_manifest() if("print" in href_list)
// assume linked_db since called by interact() if (printing)
var/crew = "" 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() var/list/L = list()
for (var/datum/data/record/t in data_core.general) for (var/datum/data/record/t in data_core.general)
var/R = t.fields["name"] + " - " + t.fields["rank"] var/R = t.fields["name"] + " - " + t.fields["rank"]
L += R L += R
for(var/R in sortList(L)) for(var/R in sortList(L))
crew += "[R]<br>" P.info += "[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.name = "paper- 'Crew Manifest'"
printing = 0
// These are here partly in order to be overwritten by the centcom card computer code if("auth" in href_list)
proc/authenticate() auth = 0
if(access_change_ids in reader.access) if(istype(reader) && istype(writer) && authenticate())
return 1 auth = 1
if(istype(usr,/mob/living/silicon/ai))
return 1
return 0
proc/set_default_access(var/jobname) if("logout" in href_list)
var/datum/job/jobdatum auth = 0
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)
// Actual ID changing
interact() if("access" in href_list)
if(!interactable()) return if(auth)
var/access_type = text2num(href_list["access"])
if(!computer.cardslot || !computer.cardslot.dualslot) writer.access ^= list(access_type) //logical xor: remove if present, add if not
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("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 /datum/file/program/card_comp/centcom
name = "CentCom identification console" name = "CentCom identification console"
drm = 1 drm = 1
list_jobs() /datum/file/program/card_comp/centcom/list_jobs()
return get_all_centcom_jobs() + "Custom" return get_all_centcom_jobs() + "Custom"
accessblock() /datum/file/program/card_comp/centcom/accessblock()
var/accesses = "<h5>[using_map.boss_name]:</h5>" var/accesses = "<h5>[using_map.boss_name]:</h5>"
for(var/A in get_all_centcom_access()) for(var/A in get_all_centcom_access())
if(A in writer.access) if(A in writer.access)
accesses += topic_link(src,"access=[A]","<font color='red'>[replacetext(get_centcom_access_desc(A), " ", "&nbsp")]</font>") + " " accesses += topic_link(src,"access=[A]","<font color='red'>[replacetext(get_centcom_access_desc(A), " ", "&nbsp")]</font>") + " "
else else
accesses += topic_link(src,"access=[A]",replacetext(get_centcom_access_desc(A), " ", "&nbsp")) + " " accesses += topic_link(src,"access=[A]",replacetext(get_centcom_access_desc(A), " ", "&nbsp")) + " "
return accesses return accesses
authenticate() /datum/file/program/card_comp/centcom/authenticate()
if(access_cent_captain in reader.access) if(access_cent_captain in reader.access)
return 1 return 1
return 0 return 0

View File

@@ -45,349 +45,369 @@
var/datum/announcement/priority/crew_announcement = new var/datum/announcement/priority/crew_announcement = new
New() /datum/file/program/communications/New()
..() ..()
crew_announcement.newscast = 1 crew_announcement.newscast = 1
Reset() /datum/file/program/communications/Reset()
..() ..()
authenticated = 0 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 state = STATE_DEFAULT
aistate = STATE_DEFAULT
if("login" in href_list)
Topic(var/href, var/list/href_list) var/mob/M = usr
if(!interactable() || !computer.radio || ..(href,href_list) ) var/obj/item/I = M.get_active_hand()
return if(I)
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()
I = I.GetID() 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("logout" in href_list)
if(access_captain in I.GetAccess()) authenticated = 0
var/old_level = security_level crew_announcement.announcer = ""
if(!tmp_alertlevel) tmp_alertlevel = SEC_LEVEL_GREEN
if(tmp_alertlevel < SEC_LEVEL_GREEN) tmp_alertlevel = SEC_LEVEL_GREEN if("swipeidseclevel" in href_list)
if(tmp_alertlevel > SEC_LEVEL_BLUE) tmp_alertlevel = SEC_LEVEL_BLUE //Cannot engage delta with this var/mob/M = usr
set_security_level(tmp_alertlevel) var/obj/item/I = M.get_active_hand()
if(security_level != old_level) I = I.GetID()
//Only notify the admins if an actual change happened
log_game("[key_name(usr)] has changed the security level to [get_security_level()].") if (istype(I,/obj/item/weapon/card/id))
message_admins("[key_name_admin(usr)] has changed the security level to [get_security_level()].") if(access_captain in I.GetAccess())
switch(security_level) var/old_level = security_level
if(SEC_LEVEL_GREEN) if(!tmp_alertlevel)
feedback_inc("alert_comms_green",1) tmp_alertlevel = SEC_LEVEL_GREEN
if(SEC_LEVEL_BLUE) if(tmp_alertlevel < SEC_LEVEL_GREEN)
feedback_inc("alert_comms_blue",1) tmp_alertlevel = SEC_LEVEL_GREEN
tmp_alertlevel = 0 if(tmp_alertlevel > SEC_LEVEL_BLUE)
else: tmp_alertlevel = SEC_LEVEL_BLUE //Cannot engage delta with this
usr << "You are not authorized to do this." set_security_level(tmp_alertlevel)
tmp_alertlevel = 0 if(security_level != old_level)
state = STATE_DEFAULT //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 else
usr << "You need to swipe your ID." to_chat(usr, "You are not authorized to do this.")
if("announce" in href_list) tmp_alertlevel = 0
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)
state = STATE_DEFAULT state = STATE_DEFAULT
if(authenticated) else
state = STATE_CALLSHUTTLE to_chat(usr, "You need to swipe your ID.")
if("callshuttle2" in href_list)
if(!computer.radio.subspace) if("announce" in href_list)
if(authenticated==2)
if(message_cooldown)
usr << "Please allow at least one minute to pass between announcements"
return return
if(authenticated) var/input = input(usr, "Please write a message to announce to the station crew.", "Priority Announcement")
call_shuttle_proc(usr) if(!input || !interactable())
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)
return return
if(authenticated==2) crew_announcement.Announce(input)
if(centcomm_message_cooldown) message_cooldown = 1
usr << "Arrays recycling. Please stand by." spawn(600)//One minute cooldown
return message_cooldown = 0
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
if("callshuttle" in href_list)
state = STATE_DEFAULT
if(authenticated)
state = STATE_CALLSHUTTLE
// OMG SYNDICATE ...LETTERHEAD if("callshuttle2" in href_list)
if("MessageSyndicate" in href_list) if(!computer.radio.subspace)
if((authenticated==2) && (computer.emagged)) return
if(centcomm_message_cooldown) if(authenticated)
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
call_shuttle_proc(usr) call_shuttle_proc(usr)
aistate = STATE_DEFAULT if(emergency_shuttle.online())
if("ai-messagelist" in href_list) post_status("shuttle")
aicurrmsg = 0 state = STATE_DEFAULT
aistate = STATE_MESSAGELIST
if("ai-viewmessage" in href_list) if("cancelshuttle" in href_list)
aistate = STATE_VIEWMESSAGE state = STATE_DEFAULT
if (!aicurrmsg) if(authenticated)
if(href_list["message-num"]) state = STATE_CANCELSHUTTLE
aicurrmsg = text2num(href_list["message-num"])
else if("messagelist" in href_list)
aistate = STATE_MESSAGELIST currmsg = 0
if("ai-delmessage" in href_list) state = STATE_MESSAGELIST
aistate = (aicurrmsg) ? STATE_DELMESSAGE : STATE_MESSAGELIST
if("ai-delmessage2" in href_list) if("viewmessage" in href_list)
if(aicurrmsg) state = STATE_VIEWMESSAGE
var/title = messagetitle[aicurrmsg] if (!currmsg)
var/text = messagetext[aicurrmsg] 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) messagetitle.Remove(title)
messagetext.Remove(text) messagetext.Remove(text)
if(currmsg == aicurrmsg) if(currmsg == aicurrmsg)
currmsg = 0 aicurrmsg = 0
aicurrmsg = 0 currmsg = 0
aistate = STATE_MESSAGELIST state = 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> \]"
else else
dat += "<BR>\[ <A HREF='?src=\ref[src];login'>Log In</A> \]" state = STATE_VIEWMESSAGE
dat += "<BR>\[ <A HREF='?src=\ref[src];messagelist'>Message List</A> \]"
return dat
proc/confirm_menu(var/prompt,var/yes_option) if("status" in href_list)
return "Are you sure you want to [prompt]? \[ [topic_link(src,yes_option,"OK")] | [topic_link(src,"main","Cancel")] \]" state = STATE_STATUSDISPLAY
interact() // Status display stuff
if(!interactable()) if("setstat" in href_list)
return switch(href_list["statdisp"])
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)
if("message") if("message")
status_signal.data["msg1"] = data1 post_status("message", stat_msg1, stat_msg2)
status_signal.data["msg2"] = data2
if("alert") 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)

View File

@@ -9,67 +9,68 @@
active_state = "crew" active_state = "crew"
var/list/tracked = list( ) var/list/tracked = list( )
interact(mob/user) /datum/file/program/crew/interact(mob/user)
if(!interactable()) if(!interactable())
return return
scan() scan()
var/t = "<TT><B>Crew Monitoring</B><HR>" var/t = "<TT><B>Crew Monitoring</B><HR>"
t += "<BR><A href='?src=\ref[src];update=1'>Refresh</A> " t += "<BR><A href='?src=\ref[src];update=1'>Refresh</A> "
t += "<A href='?src=\ref[src];close=1'>Close</A><BR>" 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>" t += "<table><tr><td width='40%'>Name</td><td width='20%'>Vitals</td><td width='40%'>Position</td></tr>"
var/list/logs = list() var/list/logs = list()
for(var/obj/item/clothing/under/C in src.tracked) for(var/obj/item/clothing/under/C in src.tracked)
var/log = "" var/log = ""
var/turf/pos = get_turf(C) var/turf/pos = get_turf(C)
if((C) && (C.has_sensor) && (pos) && (pos.z == computer.z) && C.sensor_mode) if((C) && (C.has_sensor) && (pos) && (pos.z == computer.z) && C.sensor_mode)
if(istype(C.loc, /mob/living/carbon/human)) 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/life_status = "[H.stat > 1 ? "<font color=red>Deceased</font>" : "Living"]"
var/dam2 = round(H.getToxLoss(),1) var/damage_report = "(<font color='blue'>[dam1]</font>/<font color='green'>[dam2]</font>/<font color='orange'>[dam3]</font>/<font color='red'>[dam4]</font>)"
var/dam3 = round(H.getFireLoss(),1)
var/dam4 = round(H.getBruteLoss(),1)
var/life_status = "[H.stat > 1 ? "<font color=red>Deceased</font>" : "Living"]" log += "<tr><td width='40%'>[H.get_authentification_name()] ([H.get_assignment()])</td>"
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>" 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) popup.set_content(t)
if(1) popup.open()
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()
proc/scan() /datum/file/program/crew/proc/scan()
for(var/obj/item/clothing/under/C in world) for(var/obj/item/clothing/under/C in all_clothing)
if((C.has_sensor) && (istype(C.loc, /mob/living/carbon/human))) if((C.has_sensor) && (istype(C.loc, /mob/living/carbon/human)))
tracked |= C tracked |= C
return 1 return 1
Topic(href, list/href_list) /datum/file/program/crew/Topic(href, list/href_list)
if(!interactable() || !computer.cardslot || ..(href,href_list)) if(!interactable() || !computer.cardslot || ..(href,href_list))
return return
if( href_list["close"] )
usr << browse(null, "window=crewcomp") if( href_list["close"] )
usr.unset_machine() usr << browse(null, "window=crewcomp")
return usr.unset_machine()
if(href_list["update"]) return
interact()
//src.updateUsrDialog() if(href_list["update"])
return interact()
//src.updateUsrDialog()
return

View File

@@ -9,46 +9,46 @@
var/opened = 0 var/opened = 0
verb/AccessInternals() /obj/machinery/computer3/aiupload/verb/AccessInternals()
set category = "Object" set category = "Object"
set name = "Access Computer's Internals" set name = "Access Computer's Internals"
set src in oview(1) set src in oview(1)
if(!Adjacent(usr) || usr.restrained() || usr.lying || usr.stat || istype(usr, /mob/living/silicon) || !istype(usr, /mob/living)) 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>"
return return
opened = !opened
attackby(obj/item/weapon/aiModule/module as obj, mob/user as mob) if(opened)
if (user.z > 6) to_chat(usr, "<span class='notice'>The access panel is now open.</span>")
user << "<span class='danger'>Unable to establish a connection:</span> You're too far away from the station!" else
return to_chat(usr, "<span class='notice'>The access panel is now closed.</span>")
if(istype(module, /obj/item/weapon/aiModule)) return
module.install(src)
else
return ..()
attack_hand(var/mob/user as mob) /obj/machinery/computer3/aiupload/attackby(obj/item/weapon/aiModule/module as obj, mob/user as mob)
if(src.stat & NOPOWER) if (user.z > 6)
usr << "The upload computer has no power!" to_chat(user, "<span class='danger'>Unable to establish a connection:</span> You're too far away from the station!")
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."
return 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 var/mob/living/silicon/robot/current = null
attackby(obj/item/weapon/aiModule/module as obj, mob/user as mob) /obj/machinery/computer3/borgupload/attackby(obj/item/weapon/aiModule/module as obj, mob/user as mob)
if(istype(module, /obj/item/weapon/aiModule)) if(istype(module, /obj/item/weapon/aiModule))
module.install(src) module.install(src, user)
else else
return ..() return ..()
attack_hand(var/mob/user as mob) /obj/machinery/computer3/borgupload/attack_hand(var/mob/user as mob)
if(src.stat & NOPOWER) if(src.stat & NOPOWER)
usr << "The upload computer has no power!" to_chat(user, "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."
return 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

View File

@@ -34,490 +34,479 @@
var/printing = null var/printing = null
proc/authenticate() /datum/file/program/med_data/proc/authenticate()
if(access_medical in scan.access) if(isAI(usr) || access_medical in scan.access)
return 1 return 1
if(istype(usr,/mob/living/silicon/ai)) return 0
return 1
return 0
interact() /datum/file/program/med_data/interact()
if(!computer.cardslot) if(!computer.cardslot)
computer.Crash(MISSING_PERIPHERAL) 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()
return 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 (temp)
if(!interactable() || !computer.cardslot || ..(href,href_list)) dat = text("<TT>[src.temp]</TT><BR><BR><A href='?src=\ref[src];temp=1'>Clear Screen</A>")
return else
if (!( data_core.general.Find(src.active1) )) dat = text("Confirm Identity (R): <A href='?src=\ref[];cardr=1'>[]</A><HR>", src, (scan ? text("[]", scan.name) : "----------"))
src.active1 = null if (istype(computer.cardslot, /obj/item/part/computer/cardslot/dual))
if (!( data_core.medical.Find(src.active2) )) dat += text("Check Identity (W): <A href='?src=\ref[];cardw=1'>[]</A><BR>", src, (scan2 ? text("[]", scan2.name) : "----------"))
src.active2 = null if(scan2 && !scan)
dat += text("<div class='notice'>Insert card into reader slot to log in.</div><br>")
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 (src.authenticated) 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"]) dat += "<table><tr><td>Name: [active1.fields["name"]] \
src.screen = text2num(href_list["screen"]) ID: [active1.fields["id"]]<BR>\n \
if(src.screen < 1) Entity Classification: <A href='?src=\ref[src];field=brain_type'>[active1.fields["brain_type"]]</A><BR>\n \
src.screen = 1 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 dat += "<br><a href='?src=\ref[src];screen=1'>Back</a>"
src.active2 = null 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"]) if(M.z != computer.z) continue //only find medibots on the same z-level as the computer
var/datum/data/record/v = locate(href_list["vir"]) var/turf/bl = get_turf(M)
src.temp = "<center>GNAv2 based virus lifeform V-[v.fields["id"]]</center>" if(bl) //if it can't find a turf for the medibot, then it probably shouldn't be showing up
src.temp += "<br><b>Name:</b> <A href='?src=\ref[src];field=vir_name;edit_vir=\ref[v]'>[v.fields["name"]]</A>" bdat += "[M.name] - <b>\[[bl.x],[bl.y]\]</b> - [M.on ? "Online" : "Offline"]<br>"
src.temp += "<br><b>Antigen:</b> [v.fields["antigen"]]" if((!isnull(M.reagent_glass)) && M.use_beaker)
src.temp += "<br><b>Spread:</b> [v.fields["spread type"]] " bdat += "Reservoir: \[[M.reagent_glass.reagents.total_volume]/[M.reagent_glass.reagents.maximum_volume]\]<br>"
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"
else else
src.active1.fields["sex"] = "Male" bdat += "Using Internal Synthesizer.<br>"
if("age") if(!bdat)
if (istype(src.active1, /datum/data/record)) dat += "<br><center>None detected</center>"
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
else else
dat += "<br>[bdat]"
if (href_list["p_stat"]) else
if (src.active1) dat += text("<A href='?src=\ref[];login=1'>{Log In}</A>", src)
switch(href_list["p_stat"]) popup.width = 600
if("deceased") popup.height = 400
src.active1.fields["p_stat"] = "*Deceased*" popup.set_content(dat)
if("ssd") popup.set_title_image(usr.browse_rsc_icon(computer.icon, computer.icon_state))
src.active1.fields["p_stat"] = "*SSD*" popup.open()
if("active") return
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"]) /datum/file/program/med_data/Topic(href, href_list)
if (src.active1) if(!interactable() || !computer.cardslot || ..(href,href_list))
switch(href_list["m_stat"]) return
if("insane") if(!data_core.general.Find(src.active1))
src.active1.fields["m_stat"] = "*Insane*" src.active1 = null
if("unstable") if(!data_core.medical.Find(src.active2))
src.active1.fields["m_stat"] = "*Unstable*" src.active2 = null
if("watch")
src.active1.fields["m_stat"] = "*Watch*"
if("stable")
src.active1.fields["m_stat"] = "Stable"
if(href_list["temp"])
src.temp = null
if (href_list["b_type"]) if(href_list["cardr"])
if (src.active2) if(scan)
switch(href_list["b_type"]) if(istype(usr,/mob/living/carbon/human) && !usr.get_active_hand())
if("an") computer.cardslot.remove(usr, 1)
src.active2.fields["b_type"] = "A-" else
if("bn") scan.loc = get_turf(src)
src.active2.fields["b_type"] = "B-" scan = null
if("abn") else
src.active2.fields["b_type"] = "AB-" var/obj/item/I = usr.get_active_hand()
if("on") if(istype(I, /obj/item/weapon/card/id))
src.active2.fields["b_type"] = "O-" computer.cardslot.insert(I, usr)
if("ap") scan = I
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["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"]) else if(href_list["logout"])
if (src.active2) src.authenticated = null
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) src.screen = null
src.active1 = null
src.active2 = null
if (href_list["del_r2"]) else if(href_list["login"])
if (src.active2)
//src.active2 = null
qdel(src.active2)
if (href_list["d_rec"]) if(isAI(usr))
var/datum/data/record/R = locate(href_list["d_rec"]) src.active1 = null
var/datum/data/record/M = locate(href_list["d_rec"]) src.active2 = null
if (!( data_core.general.Find(R) )) src.authenticated = usr.name
src.temp = "Record Not Found!" src.rank = "AI"
return src.screen = 1
for(var/datum/data/record/E in data_core.medical)
if ((E.fields["name"] == R.fields["name"] || E.fields["id"] == R.fields["id"])) else if(isrobot(usr))
M = E src.active1 = null
else src.active2 = null
//Foreach continue //goto(2540) src.authenticated = usr.name
src.active1 = R var/mob/living/silicon/robot/R = usr
src.active2 = M 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 src.screen = 4
if (href_list["new"]) if(href_list["add_c"])
if ((istype(src.active1, /datum/data/record) && !( istype(src.active2, /datum/data/record) ))) if(!istype(src.active2, /datum/data/record))
var/datum/data/record/R = new /datum/data/record( ) return
R.fields["name"] = src.active1.fields["name"] var/a2 = src.active2
R.fields["id"] = src.active1.fields["id"] var/t1 = sanitize(input("Add Comment:", "Med. records", null, null) as message)
R.name = text("Medical Record #[]", R.fields["id"]) if(!t1 || !src.authenticated || usr.stat || usr.restrained() || (!interactable() && !issilicon(usr)) || src.active2 != a2)
R.fields["b_type"] = "Unknown" return
R.fields["b_dna"] = "Unknown" var/counter = 1
R.fields["mi_dis"] = "None" while(src.active2.fields[text("com_[]", counter)])
R.fields["mi_dis_d"] = "No minor disabilities have been declared." counter++
R.fields["ma_dis"] = "None" src.active2.fields[text("com_[counter]")] = text("Made by [authenticated] ([rank]) on [time2text(world.realtime, "DDD MMM DD")] [stationtime2text()], [game_year]<BR>[t1]")
R.fields["ma_dis_d"] = "No major disabilities have been diagnosed."
R.fields["alg"] = "None" if(href_list["del_c"])
R.fields["alg_d"] = "No allergies have been detected in this patient." if(istype(src.active2, /datum/data/record) && src.active2.fields[text("com_[]", href_list["del_c"])])
R.fields["cdi"] = "None" src.active2.fields[text("com_[]", href_list["del_c"])] = "<B>Deleted</B>"
R.fields["cdi_d"] = "No diseases have been diagnosed at the moment."
R.fields["notes"] = "No notes." if(href_list["search"])
data_core.medical += R 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.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(href_list["print_p"])
if (!( istype(src.active2, /datum/data/record) )) if(!src.printing)
return src.printing = 1
var/a2 = src.active2 var/datum/data/record/record1 = null
var/t1 = sanitize(input("Add Comment:", "Med. records", null, null) as message) var/datum/data/record/record2 = null
if ((!( t1 ) || !( src.authenticated ) || usr.stat || usr.restrained() || (!interactable() && (!istype(usr, /mob/living/silicon))) || src.active2 != a2)) if ((istype(src.active1, /datum/data/record) && data_core.general.Find(src.active1)))
return record1 = active1
var/counter = 1 if ((istype(src.active2, /datum/data/record) && data_core.medical.Find(src.active2)))
while(src.active2.fields[text("com_[]", counter)]) record2 = active2
counter++ sleep(50)
src.active2.fields[text("com_[counter]")] = text("Made by [authenticated] ([rank]) on [time2text(world.realtime, "DDD MMM DD")] [stationtime2text()], [game_year]<BR>[t1]") var/obj/item/weapon/paper/P = new /obj/item/weapon/paper( computer.loc )
P.info = "<CENTER><B>Medical Record</B></CENTER><BR>"
if (href_list["del_c"]) if(record1)
if ((istype(src.active2, /datum/data/record) && src.active2.fields[text("com_[]", href_list["del_c"])])) 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"])
src.active2.fields[text("com_[]", href_list["del_c"])] = "<B>Deleted</B>" P.name = text("Medical Record ([])", record1.fields["name"])
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)
else else
for(var/datum/data/record/E in data_core.general) P.info += "<B>General Record Lost!</B><BR>"
if ((E.fields["name"] == src.active2.fields["name"] || E.fields["id"] == src.active2.fields["id"])) P.name = "Medical Record"
src.active1 = E if(record2)
else 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"]))
//Foreach continue //goto(3334) var/counter = 1
src.screen = 4 while(record2.fields[text("com_[]", counter)])
P.info += text("[]<BR>", record2.fields[text("com_[]", counter)])
if (href_list["print_p"]) counter++
if (!( src.printing )) else
src.printing = 1 P.info += "<B>Medical Record Lost!</B><BR>"
var/datum/data/record/record1 = null P.info += "</TT>"
var/datum/data/record/record2 = null src.printing = null
if ((istype(src.active1, /datum/data/record) && data_core.general.Find(src.active1))) interact()
record1 = active1 return
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

View File

@@ -8,41 +8,41 @@
desc = "It monitors APC status." desc = "It monitors APC status."
active_state = "power" active_state = "power"
proc/format(var/obj/machinery/power/apc/A) /datum/file/program/powermon/proc/format(var/obj/machinery/power/apc/A)
var/static/list/S = list(" Off","AOff"," On", " AOn") var/static/list/S = list(" Off","AOff"," On", " AOn")
var/static/list/chg = list("N","C","F") 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]] \ 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>" [add_lspace(A.lastused_total, 6)] [A.cell ? "[add_lspace(round(A.cell.percent()), 3)]% [chg[A.charging+1]]" : " N/C"]<BR>"
interact() /datum/file/program/powermon/interact()
if(!interactable()) if(!interactable())
return return
if(!computer.net) if(!computer.net)
computer.Crash(MISSING_PERIPHERAL) computer.Crash(MISSING_PERIPHERAL)
return return
var/list/L = computer.net.get_machines(/obj/machinery/power/apc) var/list/L = computer.net.get_machines(/obj/machinery/power/apc)
var/t = "" var/t = ""
t += "<A href='?src=\ref[src]'>Refresh</A><br /><br />" t += "<A href='?src=\ref[src]'>Refresh</A><br /><br />"
if(!L || !L.len) if(!L || !L.len)
t += "No connection" 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 else
var/datum/powernet/powernet = computer.net.connect_to(/datum/powernet,null) t += "<PRE><i>Power statistics unavailable</i><BR>"
if(powernet) t += "<FONT SIZE=-1>"
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>"
if(L.len > 0) if(L.len > 0)
t += "Area Eqp./Lgt./Env. Load Cell<HR>" t += "Area Eqp./Lgt./Env. Load Cell<HR>"
for(var/obj/machinery/power/apc/A in L) for(var/obj/machinery/power/apc/A in L)
t += src.format(A) t += src.format(A)
t += "</FONT></PRE>" t += "</FONT></PRE>"
popup.set_content(t) popup.set_content(t)
popup.open() popup.open()
Topic(var/href, var/list/href_list) /datum/file/program/powermon/Topic(var/href, var/list/href_list)
if(!interactable() || ..(href,href_list)) if(!interactable() || ..(href,href_list))
return return
interact() interact()

View File

@@ -17,88 +17,90 @@
var/screen = 0 // 0 - No Access Denied, 1 - Access allowed var/screen = 0 // 0 - No Access Denied, 1 - Access allowed
interact() /datum/file/program/prisoner/interact()
if(!interactable()) 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()
return 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() /datum/file/program/prisoner/process()
if(!..()) 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>"
interact() interact()
return
/datum/file/program/prisoner/Topic(href, href_list)
if(!interactable() || ..(href,href_list))
return 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

View File

@@ -15,197 +15,196 @@
var/screen = 0 // 0 - Main Menu, 1 - Cyborg Status, 2 - Kill 'em All! -- In text var/screen = 0 // 0 - Main Menu, 1 - Cyborg Status, 2 - Kill 'em All! -- In text
req_access = list(access_robotics) req_access = list(access_robotics)
proc/start_sequence() /datum/file/program/borg_control/proc/start_sequence()
do do
if(src.stop) if(src.stop)
src.stop = 0 src.stop = 0
return return
src.timeleft-- src.timeleft--
sleep(10) sleep(10)
while(src.timeleft) while(src.timeleft)
for(var/mob/living/silicon/robot/R in mob_list) for(var/mob/living/silicon/robot/R in mob_list)
if(!R.scrambledcodes) if(!R.scrambledcodes)
R.self_destruct() 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 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() interact()
if(!interactable() || computer.z > 6) return
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

File diff suppressed because it is too large Load Diff

View File

@@ -9,26 +9,26 @@
image = 'icons/ntos/program.png' image = 'icons/ntos/program.png'
interact() /datum/file/program/welcome/interact()
usr.set_machine(src) usr.set_machine(src)
if(!interactable()) 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 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) /datum/file/program/welcome/Topic(href, href_list)
if(!interactable() || ..(href,href_list)) if(!interactable() || ..(href,href_list))
return return
interact() interact()
return return

View File

@@ -17,49 +17,49 @@
var/drm = 0 // Copy protection, called by copy() and move() var/drm = 0 // Copy protection, called by copy() and move()
var/readonly = 0 // Edit protection, called by edit(), which is just a failcheck proc var/readonly = 0 // Edit protection, called by edit(), which is just a failcheck proc
proc/execute(var/datum/file/source) /datum/file/proc/execute(var/datum/file/source)
return return
// //
// Copy file to device. // Copy file to device.
// If you overwrite this function, use the return value to make sure it succeeded // If you overwrite this function, use the return value to make sure it succeeded
// //
proc/copy(var/obj/item/part/computer/storage/dest) /datum/file/proc/copy(var/obj/item/part/computer/storage/dest)
if(!computer) return null if(!computer) return null
if(drm) if(drm)
if(!computer.emagged) 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))
return null return null
current.removefile(src) var/datum/file/F = new type()
return src 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, // Move file to device
// but instead the readonly flag. // 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) // Determines if the file is editable. This does not use the DRM flag,
return 0 // but instead the readonly flag.
if(readonly && !computer.emagged) //
return 0 //
return 1 /datum/file/proc/edit()
if(!computer)
return 0
if(readonly && !computer.emagged)
return 0
return 1
/* /*
CentCom root authorization certificate CentCom root authorization certificate
@@ -84,23 +84,23 @@
var/file_increment = 1 var/file_increment = 1
var/binary = 0 // determines if the file can't be opened by editor var/binary = 0 // determines if the file can't be opened by editor
// Set the content to a specific amount, increase filesize appropriately. /datum/file/data/New()
proc/set_content(var/text) if(content)
content = text
if(file_increment > 1) if(file_increment > 1)
volume = round(file_increment * length(text)) volume = round(file_increment * length(content))
..()
copy(var/obj/O) // Set the content to a specific amount, increase filesize appropriately.
var/datum/file/data/D = ..(O) /datum/file/data/proc/set_content(var/text)
if(D) content = text
D.content = content if(file_increment > 1)
D.readonly = readonly volume = round(file_increment * length(text))
New() /datum/file/data/copy(var/obj/O)
if(content) var/datum/file/data/D = ..(O)
if(file_increment > 1) if(D)
volume = round(file_increment * length(content)) D.content = content
..() D.readonly = readonly
/* /*
A generic file that contains text A generic file that contains text

View File

@@ -28,42 +28,41 @@
var/obj/machinery/computer3/laptop/stored_computer = null var/obj/machinery/computer3/laptop/stored_computer = null
verb/open_computer() /obj/item/device/laptop/verb/open_computer()
set name = "Open Laptop" set name = "Open Laptop"
set category = "Object" set category = "Object"
set src in view(1) set src in view(1)
if(usr.stat || usr.restrained() || usr.lying || !istype(usr, /mob/living)) if(usr.stat || usr.restrained() || usr.lying || !istype(usr, /mob/living))
usr << "<span class='warning'>You can't do that.</span>" to_chat(usr, "<span class='warning'>You can't do that.</span>")
return return
if(!Adjacent(usr)) if(!Adjacent(usr))
usr << "You can't reach it." to_chat(usr, "You can't reach it.")
return return
if(!istype(loc,/turf)) if(!istype(loc,/turf))
usr << "[src] is too bulky! You'll have to set it down." to_chat(usr, "[src] is too bulky! You'll have to set it down.")
return return
if(!stored_computer) if(!stored_computer)
if(contents.len) if(contents.len)
for(var/obj/O in contents) for(var/obj/O in contents)
O.loc = loc O.loc = loc
usr << "\The [src] crumbles to pieces." to_chat(usr, "\The [src] crumbles to pieces.")
spawn(5) spawn(5)
qdel(src) qdel(src)
return return
stored_computer.loc = loc stored_computer.loc = loc
stored_computer.stat &= ~MAINT stored_computer.stat &= ~MAINT
stored_computer.update_icon() stored_computer.update_icon()
loc = stored_computer loc = stored_computer
usr << "You open \the [src]." to_chat(usr, "You open \the [src].")
/obj/item/device/laptop/AltClick()
AltClick() if(Adjacent(usr))
if(Adjacent(usr)) open_computer()
open_computer()
//Quickfix until Snapshot works out how he wants to redo power. ~Z //Quickfix until Snapshot works out how he wants to redo power. ~Z
/obj/item/device/laptop/verb/eject_id() /obj/item/device/laptop/verb/eject_id()
@@ -73,6 +72,7 @@
if(stored_computer) if(stored_computer)
stored_computer.eject_id() stored_computer.eject_id()
/obj/machinery/computer3/laptop/verb/eject_id() /obj/machinery/computer3/laptop/verb/eject_id()
set category = "Object" set category = "Object"
set name = "Eject ID Card" set name = "Eject ID Card"
@@ -80,21 +80,11 @@
var/obj/item/part/computer/cardslot/C = locate() in src.contents var/obj/item/part/computer/cardslot/C = locate() in src.contents
if(!C) if(!C)
usr << "There is no card port on the laptop." to_chat(usr, "There is no card port on the laptop.")
return return
var/obj/item/weapon/card/id/card C.remove(usr)
if(C.reader) return
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)
/obj/machinery/computer3/laptop /obj/machinery/computer3/laptop
name = "Laptop Computer" name = "Laptop Computer"
@@ -110,81 +100,81 @@
var/obj/item/device/laptop/portable = null var/obj/item/device/laptop/portable = null
New(var/L, var/built = 0) /obj/machinery/computer3/laptop/New(var/L, var/built = 0)
if(!built && !battery) if(!built && !battery)
battery = new /obj/item/weapon/cell(src) battery = new /obj/item/weapon/cell(src)
battery.maxcharge = 500 battery.maxcharge = 500
battery.charge = 500 battery.charge = 500
..(L,built) ..(L,built)
verb/close_computer() /obj/machinery/computer3/laptop/verb/close_computer()
set name = "Close Laptop" set name = "Close Laptop"
set category = "Object" set category = "Object"
set src in view(1) set src in view(1)
if(usr.stat || usr.restrained() || usr.lying || !istype(usr, /mob/living)) if(usr.stat || usr.restrained() || usr.lying || !istype(usr, /mob/living))
usr << "<span class='warning'>You can't do that.</span>" to_chat(usr, "<span class='warning'>You can't do that.</span>")
return return
if(!Adjacent(usr)) if(!Adjacent(usr))
usr << "<span class='warning'>You can't reach it.</span>" to_chat(usr, "<span class='warning'>You can't reach it.</span>")
return return
close_laptop(usr) close_laptop(usr)
proc/close_laptop(mob/user = null) /obj/machinery/computer3/laptop/proc/close_laptop(mob/user = null)
if(istype(loc,/obj/item/device/laptop)) if(istype(loc,/obj/item/device/laptop))
testing("Close closed computer") testing("Close closed computer")
return return
if(!istype(loc,/turf)) if(!istype(loc,/turf))
testing("Odd computer location: [loc] - close laptop") testing("Odd computer location: [loc] - close laptop")
return return
if(stat&BROKEN) 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(user) 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(!portable)
if(stat&MAINT) portable=new
return portable.stored_computer = src
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
use_power(var/amount, var/chan = -1) portable.loc = loc
if(battery && battery.charge > 0) loc = portable
battery.use(amount*CELLRATE) stat |= MAINT
if(user)
to_chat(user, "You close \the [src].")
power_change() /obj/machinery/computer3/laptop/auto_use_power()
if( !battery || battery.charge <= 0 ) if(stat&MAINT)
stat |= NOPOWER 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 else
stat &= ~NOPOWER battery.use(active_power_usage*CELLRATE)
return 1
return 0
Destroy() /obj/machinery/computer3/laptop/use_power(var/amount, var/chan = -1)
if(istype(loc,/obj/item/device/laptop)) if(battery && battery.charge > 0)
var/obj/O = loc battery.use(amount*CELLRATE)
spawn(5)
if(O) /obj/machinery/computer3/laptop/power_change()
qdel(O) 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() /obj/machinery/computer3/laptop/AltClick()
if(Adjacent(usr)) if(Adjacent(usr))
close_computer() close_computer()

View File

@@ -47,7 +47,7 @@
usr.drop_item() usr.drop_item()
L.loc = src L.loc = src
vendmode = 2 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) nanomanager.update_uis(src)
else else
..() ..()
@@ -169,7 +169,7 @@
visible_message("<span class='info'>\The [usr] swipes \the [I] through \the [src].</span>") 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) var/datum/money_account/CH = get_account(C.associated_account_number)
if(!CH) 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 return
if(CH.security_level != 0) //If card requires pin authentication (ie seclevel 1 or 2) if(CH.security_level != 0) //If card requires pin authentication (ie seclevel 1 or 2)
if(vendor_account) if(vendor_account)
@@ -178,9 +178,9 @@
if(D) if(D)
transfer_and_vend(D, C) transfer_and_vend(D, C)
else 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 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 else
transfer_and_vend(CH, C) transfer_and_vend(CH, C)
@@ -228,7 +228,7 @@
network = 0 network = 0
power = 0 power = 0
else 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() /obj/machinery/lapvend/proc/total()
var/total = 0 var/total = 0
@@ -317,7 +317,7 @@
visible_message("<span class='info'>\The [usr] swipes \the [I] through \the [src].</span>") 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) var/datum/money_account/CH = get_account(C.associated_account_number)
if(!CH) 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 return 0
if(CH.security_level != 0) //If card requires pin authentication (ie seclevel 1 or 2) if(CH.security_level != 0) //If card requires pin authentication (ie seclevel 1 or 2)
if(vendor_account) if(vendor_account)
@@ -327,10 +327,10 @@
transfer_and_reimburse(D) transfer_and_reimburse(D)
return 1 return 1
else 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 return 0
else 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 return 0
else else
transfer_and_reimburse(CH) transfer_and_reimburse(CH)

View File

@@ -1,58 +1,60 @@
/obj/item/part/computer/networking /obj/item/part/computer/networking
name = "Computer networking component" name = "Computer networking component"
/* /obj/item/part/computer/networking/allow_attackby(var/obj/item/I, var/mob/user)
This is the public-facing proc used by NETUP. return 0
It does additional checking before and after calling get_machines()
*/ /*
proc/connect_to(var/typekey,var/atom/previous) This is the public-facing proc used by NETUP.
if(!computer || computer.stat) 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 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)) if(isobj(result))
return previous 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)) Overwite this on any networking component.
var/list/R = result */
if(R.len == 0) /obj/item/part/computer/networking/proc/get_machines(var/typekey)
return null return list()
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(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 // ? Overwrite this on any networking component.
*/
/* /obj/item/part/computer/networking/proc/verify_machine(var/obj/previous)
This one is used to determine the candidate machines. return 0
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
/* /*
Provides radio/signaler functionality, and also Provides radio/signaler functionality, and also
@@ -69,56 +71,58 @@
var/range = null var/range = null
var/subspace = 0 var/subspace = 0
init() /obj/item/part/computer/networking/radio/init()
..() ..()
spawn(5) spawn(5)
radio_connection = radio_controller.add_object(src, src.frequency, src.rad_filter) radio_connection = radio_controller.add_object(src, src.frequency, src.rad_filter)
proc/set_frequency(new_frequency) /obj/item/part/computer/networking/radio/proc/set_frequency(new_frequency)
if(radio_controller) if(radio_controller)
radio_controller.remove_object(src, frequency) radio_controller.remove_object(src, frequency)
frequency = new_frequency frequency = new_frequency
radio_connection = radio_controller.add_object(src, frequency, rad_filter) radio_connection = radio_controller.add_object(src, frequency, rad_filter)
else else
frequency = new_frequency frequency = new_frequency
spawn(rand(5,10)) spawn(rand(5,10))
set_frequency(new_frequency) set_frequency(new_frequency)
receive_signal(var/datum/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 if(!signal || !computer || (computer.stat&~MAINT)) // closed laptops use maint, allow it
return return
if(computer.program) if(computer.program)
computer.program.receive_signal(signal) computer.program.receive_signal(signal)
proc/post_signal(var/datum/signal/signal) /obj/item/part/computer/networking/radio/proc/post_signal(var/datum/signal/signal)
if(!computer || (computer.stat&~MAINT) || !computer.program) return if(!computer || (computer.stat&~MAINT) || !computer.program)
if(!radio_connection) return 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) /obj/item/part/computer/networking/radio/verify_machine(var/obj/previous)
if(!radio_connection || !radio_connection.frequency) if(!previous)
return list() return 0
var/list/result = list() if(subspace)
return ( radio_connection && (previous in radio_connection.devices) )
else
var/turf/T = get_turf(loc) var/turf/T = get_turf(loc)
var/z_level = T.z var/turf/O = get_turf(previous)
for(var/obj/O in radio_connection.devices) if(!T || !O)
if(istype(O,typekey)) return 0
T = get_turf(O) return ( radio_connection && (previous in radio_connection.devices) && (T.z == O.z))
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))
/* /*
Subspace networking: Communicates off-station. Allows centcom communications. Subspace networking: Communicates off-station. Allows centcom communications.
@@ -136,23 +140,24 @@
name = "short-wave networking terminal" name = "short-wave networking terminal"
desc = "Connects to nearby computers through the area power network" desc = "Connects to nearby computers through the area power network"
get_machines(var/typekey) /obj/item/part/computer/networking/area/get_machines(var/typekey)
var/area/A = get_area(loc) var/area/A = get_area(loc)
if(!istype(A) || A == /area) if(!istype(A) || A == /area)
return list() return list()
if(typekey == null) if(typekey == null)
typekey = /obj/machinery typekey = /obj/machinery
var/list/machines = list() var/list/machines = list()
for(var/obj/O in A.contents) for(var/obj/O in A.contents)
if(istype(O,typekey)) if(istype(O,typekey))
machines |= O machines |= O
return machines return machines
verify_machine(var/obj/previous)
if(!previous) return 0 /obj/item/part/computer/networking/area/verify_machine(var/obj/previous)
var/area/A = get_area(src) if(!previous) return 0
if( A && A == get_area(previous) ) var/area/A = get_area(src)
return 1 if( A && A == get_area(previous) )
return 0 return 1
return 0
/* /*
Proximity networking: Connects to machines or computers adjacent to this device Proximity networking: Connects to machines or computers adjacent to this device
@@ -161,78 +166,78 @@
name = "proximity networking terminal" name = "proximity networking terminal"
desc = "Connects a computer to adjacent machines" desc = "Connects a computer to adjacent machines"
get_machines(var/typekey) /obj/item/part/computer/networking/prox/get_machines(var/typekey)
var/turf/T = get_turf(loc) var/turf/T = get_turf(loc)
if(!istype(T)) if(!istype(T))
return list() return list()
if(typekey == null) if(typekey == null)
typekey = /obj/machinery typekey = /obj/machinery
var/list/machines = list() var/list/machines = list()
for(var/obj/O in T) 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)) if(istype(O,typekey))
machines += O machines += O
for(var/d in cardinal) return machines
var/turf/T2 = get_step(T,d)
for(var/obj/O in T2)
if(istype(O,typekey))
machines += O
return machines
verify_machine(var/obj/previous) /obj/item/part/computer/networking/prox/verify_machine(var/obj/previous)
if(!previous) if(!previous)
return 0
if(get_dist(get_turf(previous),get_turf(loc)) == 1)
return 1
return 0 return 0
if(get_dist(get_turf(previous),get_turf(loc)) == 1)
return 1
return 0
/* /*
Cable networking: Not currently used Cable networking: Not currently used
*/ */
/obj/item/part/computer/networking/cable /obj/item/part/computer/networking/cable
name = "cable networking terminal" name = "cable networking terminal"
desc = "Connects to other machines on the same cable network." desc = "Connects to other machines on the same cable network."
get_machines(var/typekey) /obj/item/part/computer/networking/cable/get_machines(var/typekey)
// if(istype(computer,/obj/machinery/computer/laptop)) // laptops move, this could get breaky // if(istype(computer,/obj/machinery/computer/laptop)) // laptops move, this could get breaky
// return list() // return list()
var/turf/T = get_turf(loc) var/turf/T = get_turf(loc)
var/datum/powernet/P = null var/datum/powernet/P = null
for(var/obj/structure/cable/C in T) for(var/obj/structure/cable/C in T)
if(C.d1 == 0) if(C.d1 == 0)
P = C.powernet P = C.powernet
break break
if(!P) if(!P)
return list() return list()
if(!typekey) if(!typekey)
typekey = /obj/machinery typekey = /obj/machinery
else if(typekey == /datum/powernet) else if(typekey == /datum/powernet)
return list(P) return list(P)
var/list/candidates = list() var/list/candidates = list()
for(var/atom/A in P.nodes) for(var/atom/A in P.nodes)
if(istype(A,typekey)) if(istype(A,typekey))
candidates += A candidates += A
else if(istype(A,/obj/machinery/power/terminal)) else if(istype(A,/obj/machinery/power/terminal))
var/obj/machinery/power/terminal/PT = A var/obj/machinery/power/terminal/PT = A
if(istype(PT.master,typekey)) if(istype(PT.master,typekey))
candidates += PT.master candidates += PT.master
return candidates return candidates
verify_machine(var/obj/previous) /obj/item/part/computer/networking/cable/verify_machine(var/obj/previous)
if(!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 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

View File

@@ -228,10 +228,10 @@ Programs are a file that can be executed
// //
if("eject_card" in href_list) if("eject_card" in href_list)
if(computer.cardslot) if(computer.cardslot)
if(computer.cardslot.dualslot && href_list["eject_card"] == "writer") if(istype(computer.cardslot, /obj/item/part/computer/cardslot/dual) && href_list["eject_card"] == "writer")
computer.cardslot.remove(computer.cardslot.writer) computer.cardslot.remove(usr)
else else
computer.cardslot.remove(computer.cardslot.reader) computer.cardslot.remove(usr)
return 1 return 1
// //
// usage: runfile=\ref[file] // usage: runfile=\ref[file]

View File

@@ -24,9 +24,9 @@
spawn_parts = list(/obj/item/part/computer/storage/hdd,/obj/item/part/computer/networking/radio/subspace) 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() //overlays.Cut()
return 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 return

View File

@@ -21,56 +21,55 @@
var/list/spawnfiles = list()// For mappers, special drives, and data disks var/list/spawnfiles = list()// For mappers, special drives, and data disks
New() /obj/item/part/computer/storage/New()
..() ..()
if(islist(spawnfiles)) if(islist(spawnfiles))
if(removeable && spawnfiles.len) if(removeable && spawnfiles.len)
var/obj/item/part/computer/storage/removable/R = src var/obj/item/part/computer/storage/removable/R = src
R.inserted = new(src) R.inserted = new(src)
if(writeprotect) if(writeprotect)
R.inserted.writeprotect = 1 R.inserted.writeprotect = 1
for(var/typekey in spawnfiles) for(var/typekey in spawnfiles)
addfile(new typekey(),1) addfile(new typekey(),1)
// Add a file to the hard drive, returns 0 if failed // Add a file to the hard drive, returns 0 if failed
// forced is used when spawning files on a write-protect drive // forced is used when spawning files on a write-protect drive
proc/addfile(var/datum/file/F,var/forced = 0) /obj/item/part/computer/storage/proc/addfile(var/datum/file/F,var/forced = 0)
if(!F || (F in files)) if(!F || (F in files))
return 1 return 1
if(writeprotect && !forced) if(writeprotect && !forced)
return 0
if(volume + F.volume > max_volume)
if(!forced)
return 0 return 0
if(volume + F.volume > max_volume) max_volume = volume + F.volume
if(!forced)
return 0
max_volume = volume + F.volume
files.Add(F) files.Add(F)
volume += F.volume 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.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 Standard hard drives for computers. Used in computer construction
*/ */
/obj/item/part/computer/storage/hdd /obj/item/part/computer/storage/hdd
name = "Hard Drive" name = "Hard Drive"
max_volume = 25000 max_volume = 25000
@@ -99,66 +98,64 @@
attackby_types = list(/obj/item/weapon/disk/file, /obj/item/weapon/pen) attackby_types = list(/obj/item/weapon/disk/file, /obj/item/weapon/pen)
var/obj/item/weapon/disk/file/inserted = null var/obj/item/weapon/disk/file/inserted = null
proc/eject_disk(var/forced = 0) /obj/item/part/computer/storage/removable/proc/eject_disk(var/forced = 0)
if(!forced) 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 return
files = list()
inserted.loc = computer.loc to_chat(usr, "You insert [O] into [src].")
if(usr) usr.drop_item()
if(!usr.get_active_hand()) O.loc = src
usr.put_in_active_hand(inserted) inserted = O
else if(forced && !usr.get_inactive_hand()) writeprotect = inserted.writeprotect
usr.put_in_inactive_hand(inserted)
files = inserted.files
for(var/datum/file/F in inserted.files) for(var/datum/file/F in inserted.files)
F.computer = null F.computer = computer
inserted = null
return
..()
attackby(obj/O as obj, mob/user as mob) /obj/item/part/computer/storage/removable/addfile(var/datum/file/F)
if(inserted && istype(O,/obj/item/weapon/pen)) if(!F || !inserted)
usr << "You use [O] to carefully pry [inserted] out of [src]." return 0
eject_disk(forced = 1)
return
if(istype(O,/obj/item/weapon/disk/file)) if(F in inserted.files)
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
return 1 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... Removable hard drive presents...
removeable disk! removeable disk!
*/ */
/obj/item/weapon/disk/file /obj/item/weapon/disk/file
//parent_type = /obj/item/part/computer/storage // todon't: do this //parent_type = /obj/item/part/computer/storage // todon't: do this
name = "Data Disk" name = "Data Disk"
@@ -170,15 +167,15 @@
var/max_volume = 1028 var/max_volume = 1028
New() /obj/item/weapon/disk/file/New()
..() ..()
icon_state = "datadisk[rand(0,6)]" icon_state = "datadisk[rand(0,6)]"
src.pixel_x = rand(-5, 5) src.pixel_x = rand(-5, 5)
src.pixel_y = rand(-5, 5) src.pixel_y = rand(-5, 5)
files = list() files = list()
if(istype(spawn_files)) if(istype(spawn_files))
for(var/typekey in spawn_files) for(var/typekey in spawn_files)
var/datum/file/F = new typekey() var/datum/file/F = new typekey()
F.device = src F.device = src
files += F files += F
volume += F.volume volume += F.volume

View File

@@ -422,7 +422,7 @@
preserve = 1 preserve = 1
if(istype(W,/obj/item/weapon/implant/health)) 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) for(var/datum/dna2/record/R in com.records)
if(locate(R.implant) == W) if(locate(R.implant) == W)
qdel(R) qdel(R)

View File

@@ -92,7 +92,7 @@
*/ */
/obj/machinery/button/remote/airlock/trigger() /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(D.id_tag == id)
if(specialfunctions & OPEN) if(specialfunctions & OPEN)
if(D.density) if(D.density)
@@ -137,7 +137,7 @@
desc = "It controls blast doors, remotely." desc = "It controls blast doors, remotely."
/obj/machinery/button/remote/blast_door/trigger() /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.id == id)
if(M.density) if(M.density)
spawn(0) spawn(0)
@@ -156,7 +156,7 @@
desc = "It controls emitters, remotely." desc = "It controls emitters, remotely."
/obj/machinery/button/remote/emitter/trigger(mob/user as mob) /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) if(E.id == id)
spawn(0) spawn(0)
E.activate(user) E.activate(user)

View File

@@ -1208,7 +1208,7 @@ About the new airlock wires panel:
/obj/machinery/door/airlock/initialize() /obj/machinery/door/airlock/initialize()
if(src.closeOtherId != null) 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) if(A.closeOtherId == src.closeOtherId && A != src)
src.closeOther = A src.closeOther = A
break break

View File

@@ -47,7 +47,7 @@
if(F.id == src.id) if(F.id == src.id)
LAZYADD(targets,F) 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) if(C.id == src.id)
LAZYADD(targets,C) LAZYADD(targets,C)

View File

@@ -213,7 +213,7 @@
..() ..()
if(autolink) 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) if(M.freq == frequency && M.code == code)
magnets.Add(M) magnets.Add(M)
@@ -229,7 +229,7 @@
/obj/machinery/magnetic_controller/process() /obj/machinery/magnetic_controller/process()
if(magnets.len == 0 && autolink) 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) if(M.freq == frequency && M.code == code)
magnets.Add(M) magnets.Add(M)

View File

@@ -168,7 +168,7 @@ var/list/obj/machinery/requests_console/allConsoles = list()
var/log_msg = message var/log_msg = message
var/pass = 0 var/pass = 0
screen = RCS_SENTFAIL 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 if(!MS.active) continue
MS.send_rc_message(ckey(href_list["department"]),department,log_msg,msgStamped,msgVerified,priority) MS.send_rc_message(ckey(href_list["department"]),department,log_msg,msgStamped,msgVerified,priority)
pass = 1 pass = 1

View File

@@ -89,7 +89,7 @@
if(surplus() < 1500) if(surplus() < 1500)
if(user) user << "<span class='notice'>The connected wire doesn't have enough current.</span>" if(user) user << "<span class='notice'>The connected wire doesn't have enough current.</span>"
return return
for(var/obj/singularity/singulo in world) for(var/obj/singularity/singulo in all_singularities)
if(singulo.z == z) if(singulo.z == z)
singulo.target = src singulo.target = src
icon_state = "[icontype]1" icon_state = "[icontype]1"
@@ -99,7 +99,7 @@
user << "<span class='notice'>You activate the beacon.</span>" user << "<span class='notice'>You activate the beacon.</span>"
/obj/machinery/power/singularity_beacon/proc/Deactivate(mob/user = null) /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) if(singulo.target == src)
singulo.target = null singulo.target = null
icon_state = "[icontype]0" icon_state = "[icontype]0"

View File

@@ -95,7 +95,7 @@
var/list/L = list() var/list/L = list()
var/list/areaindex = 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) var/turf/T = get_turf(R)
if(!T) if(!T)
continue continue
@@ -108,7 +108,7 @@
areaindex[tmpname] = 1 areaindex[tmpname] = 1
L[tmpname] = R 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)) if(!I.implanted || !ismob(I.loc))
continue continue
else else

View File

@@ -51,7 +51,7 @@
else if(ispath(control_area)) else if(ispath(control_area))
control_area = locate(control_area) control_area = locate(control_area)
else if(istext(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) if(A.name && A.name==control_area)
control_area = A control_area = A
break break

View File

@@ -510,6 +510,8 @@
if(R.get_product(get_turf(src))) if(R.get_product(get_turf(src)))
visible_message("<span class='notice'>\The [src] clunks as it vends an additional item.</span>") 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_message = ""
status_error = 0 status_error = 0
vend_ready = 1 vend_ready = 1

View File

@@ -1,3 +1,5 @@
GLOBAL_LIST_BOILERPLATE(all_portals, /obj/effect/portal)
/obj/effect/portal /obj/effect/portal
name = "portal" name = "portal"
desc = "Looks unstable. Best to test it with the clown." desc = "Looks unstable. Best to test it with the clown."

View File

@@ -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) var/close = range(world.view+round(devastation_range,1), epicenter)
// to all distanced mobs play a different sound // 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.z == epicenter.z)
if(!(M in close)) if(!(M in close))
// check if the mob can hear // check if the mob can hear

View File

@@ -1,3 +1,5 @@
GLOBAL_LIST_BOILERPLATE(all_items, /obj/item)
/obj/item /obj/item
name = "item" name = "item"
icon = 'icons/obj/items.dmi' 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 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. //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) if(A.type == type && !A.blood_overlay)
A.blood_overlay = image(I) 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() /obj/item/proc/is_hot()
return FALSE 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. // 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 /obj/item/device
icon = 'icons/obj/device.dmi' icon = 'icons/obj/device.dmi'

View File

@@ -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 // 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 // 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) 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 // when the ui is first opened this is the data it will use
ui.set_initial_data(data) ui.set_initial_data(data)
// open the new ui window // open the new ui window
ui.open() ui.open()
@@ -893,7 +894,7 @@ var/global/list/obj/item/device/pda/PDAs = list()
if("Toggle Door") if("Toggle Door")
if(cartridge && cartridge.access_remote_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.id == cartridge.remote_door_id)
if(M.density) if(M.density)
M.open() M.open()
@@ -1247,19 +1248,24 @@ var/global/list/obj/item/device/pda/PDAs = list()
if(issilicon(usr)) if(issilicon(usr))
return return
if(can_use(usr) && !isnull(cartridge)) if(!can_use(usr))
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
to_chat(usr, "<span class='notice'>You cannot do this while restrained.</span>") 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. /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) if(choice == 1)

View File

@@ -468,7 +468,7 @@ var/list/civilian_cartridges = list(
else else
JaniData["user_loc"] = list("x" = 0, "y" = 0) JaniData["user_loc"] = list("x" = 0, "y" = 0)
var/MopData[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) var/turf/ml = get_turf(M)
if(ml) if(ml)
if(ml.z != cl.z) if(ml.z != cl.z)
@@ -481,7 +481,7 @@ var/list/civilian_cartridges = list(
var/BucketData[0] 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) var/turf/bl = get_turf(B)
if(bl) if(bl)
if(bl.z != cl.z) 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) BucketData[++BucketData.len] = list("x" = 0, "y" = 0, dir=null, status = null)
var/CbotData[0] 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) var/turf/bl = get_turf(B)
if(bl) if(bl)
if(bl.z != cl.z) if(bl.z != cl.z)
@@ -505,7 +505,7 @@ var/list/civilian_cartridges = list(
if(!CbotData.len) if(!CbotData.len)
CbotData[++CbotData.len] = list("x" = 0, "y" = 0, dir=null, status = null) CbotData[++CbotData.len] = list("x" = 0, "y" = 0, dir=null, status = null)
var/CartData[0] 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) var/turf/bl = get_turf(B)
if(bl) if(bl)
if(bl.z != cl.z) if(bl.z != cl.z)

View File

@@ -118,6 +118,8 @@
// the ui does not exist, so we'll create a new() one // 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 // 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) 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 // when the ui is first opened this is the data it will use
ui.set_initial_data(data) ui.set_initial_data(data)
// open the new ui window // open the new ui window

View 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
..()

View File

@@ -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
..()

View File

@@ -1,3 +1,5 @@
GLOBAL_LIST_BOILERPLATE(all_pai_cards, /obj/item/device/paicard)
/obj/item/device/paicard /obj/item/device/paicard
name = "personal AI device" name = "personal AI device"
icon = 'icons/obj/pda.dmi' icon = 'icons/obj/pda.dmi'

View File

@@ -6,6 +6,8 @@
var/code = "electronic" var/code = "electronic"
origin_tech = list(TECH_BLUESPACE = 1) origin_tech = list(TECH_BLUESPACE = 1)
GLOBAL_LIST_BOILERPLATE(all_beacons, /obj/item/device/radio/beacon)
/obj/item/device/radio/beacon/hear_talk() /obj/item/device/radio/beacon/hear_talk()
return return

View File

@@ -51,4 +51,15 @@
/obj/item/poi/brokenoldreactor/Destroy() /obj/item/poi/brokenoldreactor/Destroy()
processing_objects -= src 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"
..()

View File

@@ -9,6 +9,7 @@
throw_range = 20 throw_range = 20
var/heal_brute = 0 var/heal_brute = 0
var/heal_burn = 0 var/heal_burn = 0
var/apply_sounds
/obj/item/stack/medical/attack(mob/living/carbon/M as mob, mob/user as mob) /obj/item/stack/medical/attack(mob/living/carbon/M as mob, mob/user as mob)
if (!istype(M)) if (!istype(M))
@@ -65,6 +66,7 @@
icon_state = "brutepack" icon_state = "brutepack"
origin_tech = list(TECH_BIO = 1) origin_tech = list(TECH_BIO = 1)
no_variants = FALSE 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) /obj/item/stack/medical/bruise_pack/attack(mob/living/carbon/M as mob, mob/user as mob)
if(..()) if(..())
@@ -112,6 +114,7 @@
"<span class='notice'>You place a bandaid over \a [W.desc] on [M]'s [affecting.name].</span>" ) "<span class='notice'>You place a bandaid over \a [W.desc] on [M]'s [affecting.name].</span>" )
W.bandage() W.bandage()
// W.disinfect() // VOREStation - Tech1 should not disinfect // W.disinfect() // VOREStation - Tech1 should not disinfect
playsound(src, pick(apply_sounds), 25)
used++ used++
affecting.update_damages() affecting.update_damages()
if(used == amount) if(used == amount)
@@ -130,6 +133,7 @@
heal_burn = 1 heal_burn = 1
origin_tech = list(TECH_BIO = 1) origin_tech = list(TECH_BIO = 1)
no_variants = FALSE 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) /obj/item/stack/medical/ointment/attack(mob/living/carbon/M as mob, mob/user as mob)
if(..()) if(..())
@@ -159,6 +163,7 @@
"<span class='notice'>You salved wounds on [M]'s [affecting.name].</span>" ) "<span class='notice'>You salved wounds on [M]'s [affecting.name].</span>" )
use(1) use(1)
affecting.salve() affecting.salve()
playsound(src, pick(apply_sounds), 25)
/obj/item/stack/medical/advanced/bruise_pack /obj/item/stack/medical/advanced/bruise_pack
name = "advanced trauma kit" name = "advanced trauma kit"
@@ -167,6 +172,7 @@
icon_state = "traumakit" icon_state = "traumakit"
heal_brute = 3 heal_brute = 3
origin_tech = list(TECH_BIO = 1) 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) /obj/item/stack/medical/advanced/bruise_pack/attack(mob/living/carbon/M as mob, mob/user as mob)
if(..()) if(..())
@@ -212,6 +218,7 @@
W.bandage() W.bandage()
W.disinfect() W.disinfect()
W.heal_damage(heal_brute) W.heal_damage(heal_brute)
playsound(src, pick(apply_sounds), 25)
used++ used++
affecting.update_damages() affecting.update_damages()
if(used == amount) if(used == amount)
@@ -228,7 +235,7 @@
icon_state = "burnkit" icon_state = "burnkit"
heal_burn = 3 heal_burn = 3
origin_tech = list(TECH_BIO = 1) 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) /obj/item/stack/medical/advanced/ointment/attack(mob/living/carbon/M as mob, mob/user as mob)
if(..()) if(..())
@@ -258,6 +265,7 @@
affecting.heal_damage(0,heal_burn) affecting.heal_damage(0,heal_burn)
use(1) use(1)
affecting.salve() affecting.salve()
playsound(src, pick(apply_sounds), 25)
/obj/item/stack/medical/splint /obj/item/stack/medical/splint
name = "medical splints" name = "medical splints"

View File

@@ -3,19 +3,20 @@
icon_state = "flashbang" icon_state = "flashbang"
item_state = "flashbang" item_state = "flashbang"
origin_tech = list(TECH_MATERIAL = 2, TECH_COMBAT = 1) 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 var/banglet = 0
/obj/item/weapon/grenade/flashbang/prime() /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)) if(locate(/mob/living/carbon/, L))
for(var/mob/living/carbon/M in L) for(var/mob/living/carbon/M in L)
bang(get_turf(src), M) 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) 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)) var/damage = round(30/(get_dist(B,get_turf(src))+1))
if(B.overmind) if(B.overmind)
damage *= B.overmind.blob_type.burn_multiplier damage *= B.overmind.blob_type.burn_multiplier
@@ -39,13 +40,19 @@
ear_safety = M.get_ear_protection() ear_safety = M.get_ear_protection()
//Flashing everyone //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.flash_eyes()
M.Confuse(2) M.Confuse(2 * flash_effectiveness)
M.Weaken(5) M.Weaken(5 * flash_effectiveness)
//Now applying sound //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) if(ear_safety > 0)
M.Confuse(2) M.Confuse(2)
M.Weaken(1) M.Weaken(1)
@@ -58,20 +65,19 @@
M.ear_damage += rand(0, 5) M.ear_damage += rand(0, 5)
M.ear_deaf = max(M.ear_deaf,15) 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) if(!ear_safety)
M.Confuse(8) M.Confuse(8)
M.ear_damage += rand(0, 3) M.ear_damage += rand(0, 3)
M.ear_deaf = max(M.ear_deaf,10) 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.Confuse(4)
M.ear_damage += rand(0, 1) M.ear_damage += rand(0, 1)
M.ear_deaf = max(M.ear_deaf,5) M.ear_deaf = max(M.ear_deaf,5)
//This really should be in mob not every check //This really should be in mob not every check
if(ishuman(M)) if(ishuman(M))
var/mob/living/carbon/human/H = M
var/obj/item/organ/internal/eyes/E = H.internal_organs_by_name[O_EYES] var/obj/item/organ/internal/eyes/E = H.internal_organs_by_name[O_EYES]
if (E && E.damage >= E.min_bruised_damage) if (E && E.damage >= E.min_bruised_damage)
M << "<span class='danger'>Your eyes start to burn badly!</span>" M << "<span class='danger'>Your eyes start to burn badly!</span>"

View File

@@ -69,6 +69,8 @@
else else
..() ..()
GLOBAL_LIST_BOILERPLATE(all_tracking_implants, /obj/item/weapon/implant/tracking)
/obj/item/weapon/implant/tracking /obj/item/weapon/implant/tracking
name = "tracking implant" name = "tracking implant"
desc = "An implant normally given to dangerous criminals. Allows security to track your location." 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) explosion(get_turf(imp_in), -1, -1, 1, 3)
qdel(src) qdel(src)
GLOBAL_LIST_BOILERPLATE(all_chem_implants, /obj/item/weapon/implant/chem)
/obj/item/weapon/implant/chem /obj/item/weapon/implant/chem
name = "chemical implant" name = "chemical implant"
desc = "Injects things." desc = "Injects things."

View File

@@ -144,9 +144,9 @@
force = 10 force = 10
w_class = ITEMSIZE_LARGE w_class = ITEMSIZE_LARGE
slot_flags = SLOT_BACK 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 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 throw_speed = 3
edge = 0 edge = 0
sharp = 1 sharp = 1
@@ -156,4 +156,4 @@
applies_material_colour = 0 applies_material_colour = 0
fragile = 1 //It's a haphazard thing of glass, wire, and steel fragile = 1 //It's a haphazard thing of glass, wire, and steel
reach = 2 // Spears are long. reach = 2 // Spears are long.
attackspeed = 14 attackspeed = 14

View File

@@ -1,3 +1,5 @@
GLOBAL_LIST_BOILERPLATE(all_mops, /obj/item/weapon/mop)
/obj/item/weapon/mop /obj/item/weapon/mop
desc = "The world of janitalia wouldn't be complete without a mop." desc = "The world of janitalia wouldn't be complete without a mop."
name = "mop" name = "mop"
@@ -12,7 +14,6 @@
var/mopping = 0 var/mopping = 0
var/mopcount = 0 var/mopcount = 0
/obj/item/weapon/mop/New() /obj/item/weapon/mop/New()
create_reagents(30) create_reagents(30)

View File

@@ -47,6 +47,10 @@
max_storage_space = ITEMSIZE_COST_NORMAL * 14 // 56 max_storage_space = ITEMSIZE_COST_NORMAL * 14 // 56
storage_cost = INVENTORY_STANDARD_SPACE + 1 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) /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)) if(istype(W, /obj/item/weapon/storage/backpack/holding))
user << "<span class='warning'>The Bluespace interfaces of the two devices conflict and malfunction.</span>" user << "<span class='warning'>The Bluespace interfaces of the two devices conflict and malfunction.</span>"

View File

@@ -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." 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. 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) 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( starts_with = list(
/obj/item/weapon/gun/magnetic/fuelrod, /obj/item/weapon/gun/magnetic/fuelrod,
/obj/item/weapon/fuel_assembly/deuterium, /obj/item/weapon/fuel_assembly/deuterium,

View File

@@ -37,6 +37,7 @@
/obj/item/clothing/accessory/permit, /obj/item/clothing/accessory/permit,
/obj/item/clothing/accessory/badge /obj/item/clothing/accessory/badge
) )
cant_hold = list(/obj/item/weapon/screwdriver/power)
slot_flags = SLOT_ID slot_flags = SLOT_ID
var/obj/item/weapon/card/id/front_id = null var/obj/item/weapon/card/id/front_id = null

View File

@@ -56,6 +56,7 @@
user.visible_message("<span class='danger'>\The [user] has taped up \the [H]'s eyes!</span>") 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.equip_to_slot_or_del(new /obj/item/clothing/glasses/sunglasses/blindfold/tape(H), slot_glasses)
H.update_inv_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) else if(user.zone_sel.selecting == O_MOUTH || user.zone_sel.selecting == BP_HEAD)
if(!H.organs_by_name[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.equip_to_slot_or_del(new /obj/item/clothing/mask/muzzle/tape(H), slot_wear_mask)
H.update_inv_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") else if(user.zone_sel.selecting == "r_hand" || user.zone_sel.selecting == "l_hand")
can_place = 0 can_place = 0
@@ -109,6 +111,7 @@
return return
var/obj/item/weapon/handcuffs/cable/tape/T = new(user) var/obj/item/weapon/handcuffs/cable/tape/T = new(user)
playsound(src, 'sound/effects/tape.ogg',25)
if(!T.place_handcuffs(H, user)) if(!T.place_handcuffs(H, user))
user.unEquip(T) user.unEquip(T)
@@ -124,6 +127,7 @@
var/obj/item/weapon/ducttape/tape = new(get_turf(src)) var/obj/item/weapon/ducttape/tape = new(get_turf(src))
tape.attach(W) tape.attach(W)
user.put_in_hands(tape) user.put_in_hands(tape)
playsound(src, 'sound/effects/tape.ogg',25)
/obj/item/weapon/ducttape /obj/item/weapon/ducttape
name = "tape" name = "tape"
@@ -188,6 +192,7 @@
return // reduce papers around corners issue. return // reduce papers around corners issue.
user.drop_from_inventory(src) user.drop_from_inventory(src)
playsound(src, 'sound/effects/tape.ogg',25)
forceMove(source_turf) forceMove(source_turf)
if(params) if(params)

View File

@@ -60,7 +60,7 @@ Frequency:
if (sr) if (sr)
src.temp += "<B>Located Beacons:</B><BR>" 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) if (W.frequency == src.frequency)
var/turf/tr = get_turf(W) var/turf/tr = get_turf(W)
if (tr.z == sr.z && tr) if (tr.z == sr.z && tr)
@@ -78,7 +78,7 @@ Frequency:
src.temp += "[W.code]-[dir2text(get_dir(sr, tr))]-[direct]<BR>" src.temp += "[W.code]-[dir2text(get_dir(sr, tr))]-[direct]<BR>"
src.temp += "<B>Extranneous Signals:</B><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)) if (!W.implanted || !(istype(W.loc,/obj/item/organ/external) || ismob(W.loc) || W.malfunction))
continue continue
@@ -137,7 +137,7 @@ Frequency:
user << "<span class='notice'>\The [src] is malfunctioning.</span>" user << "<span class='notice'>\The [src] is malfunctioning.</span>"
return return
var/list/L = list( ) 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)) 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 (istype(com, /obj/machinery/computer/teleporter) && com.locked && !com.one_time_use)
if(R.icon_state == "tele1") if(R.icon_state == "tele1")
@@ -156,7 +156,7 @@ Frequency:
if ((user.get_active_hand() != src || user.stat || user.restrained())) if ((user.get_active_hand() != src || user.stat || user.restrained()))
return return
var/count = 0 //num of portals from this teleport in world 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(PO.creator == src) count++
if(count >= 3) if(count >= 3)
user.show_message("<span class='notice'>\The [src] is recharging!</span>") user.show_message("<span class='notice'>\The [src] is recharging!</span>")

View File

@@ -172,7 +172,7 @@
item_state = "drill" item_state = "drill"
matter = list(DEFAULT_WALL_MATERIAL = 150, MAT_SILVER = 50) matter = list(DEFAULT_WALL_MATERIAL = 150, MAT_SILVER = 50)
origin_tech = list(TECH_MATERIAL = 2, TECH_ENGINEERING = 2) origin_tech = list(TECH_MATERIAL = 2, TECH_ENGINEERING = 2)
slot_flags = SLOT_BELT
force = 8 force = 8
w_class = ITEMSIZE_SMALL w_class = ITEMSIZE_SMALL
throwforce = 8 throwforce = 8

View File

@@ -1,3 +1,5 @@
GLOBAL_LIST_BOILERPLATE(all_objs, /obj)
/obj /obj
layer = OBJ_LAYER layer = OBJ_LAYER
plane = OBJ_PLANE plane = OBJ_PLANE

View File

@@ -10,7 +10,7 @@
/obj/structure/Destroy() /obj/structure/Destroy()
if(parts) if(parts)
new parts(loc) new parts(loc)
. = ..() . = ..()
/obj/structure/attack_hand(mob/user) /obj/structure/attack_hand(mob/user)
if(breakable) if(breakable)
@@ -177,7 +177,7 @@
return 1 return 1
/obj/structure/attack_generic(var/mob/user, var/damage, var/attack_verb, var/wallbreaker) /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 return 0
visible_message("<span class='danger'>[user] [attack_verb] the [src] apart!</span>") visible_message("<span class='danger'>[user] [attack_verb] the [src] apart!</span>")
user.do_attack_animation(src) user.do_attack_animation(src)

View File

@@ -1,10 +1,11 @@
// Based on catwalk.dm from https://github.com/Endless-Horizon/CEV-Eris // Based on catwalk.dm from https://github.com/Endless-Horizon/CEV-Eris
/obj/structure/catwalk /obj/structure/catwalk
layer = TURF_LAYER + 0.5
icon = 'icons/turf/catwalks.dmi'
icon_state = "catwalk"
name = "catwalk" name = "catwalk"
desc = "Cats really don't like these things." desc = "Cats really don't like these things."
plane = TURF_PLANE
layer = ABOVE_UTILITY
icon = 'icons/turf/catwalks.dmi'
icon_state = "catwalk"
density = 0 density = 0
var/health = 100 var/health = 100
var/maxhealth = 100 var/maxhealth = 100

View File

@@ -346,7 +346,7 @@
icon_state = icon_opened icon_state = icon_opened
/obj/structure/closet/attack_generic(var/mob/user, var/damage, var/attack_message = "destroys", var/wallbreaker) /obj/structure/closet/attack_generic(var/mob/user, var/damage, var/attack_message = "destroys", var/wallbreaker)
if(!damage || !wallbreaker) if(damage < 10 || !wallbreaker)
return return
user.do_attack_animation(src) user.do_attack_animation(src)
visible_message("<span class='danger'>[user] [attack_message] the [src]!</span>") visible_message("<span class='danger'>[user] [attack_message] the [src]!</span>")

View File

@@ -340,7 +340,7 @@
new /obj/item/weapon/reagent_containers/syringe/ld50_syringe/choral(src) new /obj/item/weapon/reagent_containers/syringe/ld50_syringe/choral(src)
return return
GLOBAL_LIST_BOILERPLATE(all_brig_closets, /obj/structure/closet/secure_closet/brig)
/obj/structure/closet/secure_closet/brig /obj/structure/closet/secure_closet/brig
name = "brig locker" name = "brig locker"

View File

@@ -7,7 +7,7 @@
anchored = 1 anchored = 1
flags = CONDUCT flags = CONDUCT
pressure_resistance = 5*ONE_ATMOSPHERE pressure_resistance = 5*ONE_ATMOSPHERE
layer = UNDER_JUNK_LAYER layer = TABLE_LAYER
explosion_resistance = 1 explosion_resistance = 1
var/health = 10 var/health = 10
var/destroyed = 0 var/destroyed = 0

View File

@@ -1,3 +1,5 @@
GLOBAL_LIST_BOILERPLATE(all_janitorial_carts, /obj/structure/janitorialcart)
/obj/structure/janitorialcart /obj/structure/janitorialcart
name = "janitorial cart" name = "janitorial cart"
desc = "The ultimate in janitorial carts! Has space for water, mops, signs, trash bags, and more!" 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