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_TOXIC "alcotoxic" // Liver damage
#define CE_SPEEDBOOST "gofast" // Hyperzine
#define CE_SLOWDOWN "goslow" // Slowdown
#define REAGENTS_PER_SHEET 20

View File

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

View File

@@ -241,6 +241,25 @@
#define USE_FAIL_NOT_IN_USER 6
#define USE_FAIL_IS_SILICON 7
// This creates a consistant definition for creating global lists, automatically inserting objects into it when they are created, and removing them when deleted.
// It is very good for removing the 'in world' junk that exists in the codebase painlessly.
// First argument is the list name/path desired, e.g. 'all_candles' would be 'var/list/all_candles = list()'.
// Second argument is the path the list is expected to contain. Note that children will also get added to the global list.
// If the GLOB system is ever ported, you can change this macro in one place and have less work to do than you otherwise would.
#define GLOBAL_LIST_BOILERPLATE(LIST_NAME, PATH)\
var/global/list/##LIST_NAME = list();\
##PATH/initialize(mapload, ...)\
{\
##LIST_NAME += src;\
return ..();\
}\
##PATH/Destroy(force, ...)\
{\
##LIST_NAME -= src;\
return ..();\
}\
//'Normal'ness v v v
//Various types of colorblindness R2R R2G R2B G2R G2G G2B B2R B2G B2B
#define MATRIX_Monochromia list(0.33, 0.33, 0.33, 0.59, 0.59, 0.59, 0.11, 0.11, 0.11)

View File

@@ -33,7 +33,7 @@
.= res
/proc/get_area_name(N) //get area by its name
for(var/area/A in world)
for(var/area/A in all_areas)
if(A.name == N)
return A
return 0

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)
for(var/mob/living/simple_animal/M in sortmob)
moblist.Add(M)
// for(var/mob/living/silicon/hivebot/M in world)
// for(var/mob/living/silicon/hivebot/M in sortmob)
// mob_list.Add(M)
// for(var/mob/living/silicon/hive_mainframe/M in world)
// for(var/mob/living/silicon/hive_mainframe/M in sortmob)
// mob_list.Add(M)
return moblist
@@ -672,7 +672,7 @@ proc/GaussRandRound(var/sigma,var/roundto)
//Returns: all the areas in the world
/proc/return_areas()
var/list/area/areas = list()
for(var/area/A in world)
for(var/area/A in all_areas)
areas += A
return areas
@@ -690,7 +690,7 @@ proc/GaussRandRound(var/sigma,var/roundto)
areatype = areatemp.type
var/list/areas = new/list()
for(var/area/N in world)
for(var/area/N in all_areas)
if(istype(N, areatype)) areas += N
return areas
@@ -704,7 +704,7 @@ proc/GaussRandRound(var/sigma,var/roundto)
areatype = areatemp.type
var/list/turfs = new/list()
for(var/area/N in world)
for(var/area/N in all_areas)
if(istype(N, areatype))
for(var/turf/T in N) turfs += T
return turfs
@@ -719,7 +719,7 @@ proc/GaussRandRound(var/sigma,var/roundto)
areatype = areatemp.type
var/list/atoms = new/list()
for(var/area/N in world)
for(var/area/N in all_areas)
if(istype(N, areatype))
for(var/atom/A in N)
atoms += A

View File

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

View File

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

View File

@@ -49,74 +49,8 @@ datum/controller/game_controller/proc/setup()
// #endif
datum/controller/game_controller/proc/setup_objects()
// #if !UNIT_TEST
// var/initialized_objects = 0
// #endif
// Set up antagonists.
populate_antag_type_list()
//Set up spawn points.
populate_spawn_points()
/*
to_world_log("Initializing Floor Decals")
admin_notice("<span class='danger'>Initializing Floor Decals</span>", R_DEBUG)
var/list/turfs_with_decals = list()
for(var/obj/effect/floor_decal/D in world)
var/T = D.add_to_turf_decals()
if(T) turfs_with_decals |= T
CHECK_SLEEP_MASTER
for(var/item in turfs_with_decals)
var/turf/T = item
if(T.decals) T.apply_decals()
CHECK_SLEEP_MASTER
floor_decals_initialized = TRUE
sleep(1)
to_world_log("Initializing objects") // VOREStation Edit
admin_notice("<span class='danger'>Initializing objects</span>", R_DEBUG)
for(var/atom/movable/object in world)
if(!QDELETED(object))
object.initialize()
CHECK_SLEEP_MASTER
sleep(1)
to_world_log("Initializing areas") // VOREStation Edit
admin_notice("<span class='danger'>Initializing areas</span>", R_DEBUG)
for(var/area/area in all_areas)
area.initialize()
CHECK_SLEEP_MASTER
sleep(1)
to_world_log("Initializing atmos machinery connections.") // VOREStation Edit
admin_notice("<span class='danger'>Initializing atmos machinery connections.</span>", R_DEBUG)
for(var/obj/machinery/atmospherics/machine in machines)
machine.atmos_init()
CHECK_SLEEP_MASTER
to_world_log("Initializing pipe networks") // VOREStation Edit
admin_notice("<span class='danger'>Initializing pipe networks</span>", R_DEBUG)
for(var/obj/machinery/atmospherics/machine in machines)
machine.build_network()
CHECK_SLEEP_MASTER
to_world_log("Initializing atmos machinery.") // VOREStation Edit
admin_notice("<span class='danger'>Initializing atmos machinery.</span>", R_DEBUG)
for(var/obj/machinery/atmospherics/unary/U in machines)
if(istype(U, /obj/machinery/atmospherics/unary/vent_pump))
var/obj/machinery/atmospherics/unary/vent_pump/T = U
T.broadcast_status()
else if(istype(U, /obj/machinery/atmospherics/unary/vent_scrubber))
var/obj/machinery/atmospherics/unary/vent_scrubber/T = U
T.broadcast_status()
CHECK_SLEEP_MASTER
to_world_log("Initializing turbolifts") // VOREStation Edit
admin_notice("<span class='danger'>Initializing turbolifts</span>", R_DEBUG)
for(var/thing in turbolifts)
var/obj/turbolift_map_holder/lift = thing
if(!QDELETED(lift))
lift.initialize()
CHECK_SLEEP_MASTER
*/

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.
var/list/selfblock_deferred = null
// This is used to tell Travis WHERE the edges are.
var/list/startup_active_edge_log = list()
/datum/controller/subsystem/air/PreInit()
air_master = src
@@ -35,7 +38,7 @@ SUBSYSTEM_DEF(air)
current_cycle = 0
var/simulated_turf_count = 0
for(var/turf/simulated/S in world)
for(var/turf/simulated/S in turfs)
simulated_turf_count++
S.update_air_properties()
CHECK_TICK
@@ -56,8 +59,9 @@ Total Unsimulated Turfs: [world.maxx*world.maxy*world.maxz - simulated_turf_coun
for(var/connection_edge/E in active_edges)
edge_log += "Active Edge [E] ([E.type])"
for(var/turf/T in E.connecting_turfs)
edge_log += "+--- Connecting Turf [T] @ [T.x], [T.y], [T.z]"
edge_log += "+--- Connecting Turf [T] ([T.type]) @ [T.x], [T.y], [T.z] ([T.loc])"
log_debug("Active Edges on ZAS Startup\n" + edge_log.Join("\n"))
startup_active_edge_log = edge_log.Copy()
..()

View File

@@ -46,7 +46,7 @@ SUBSYSTEM_DEF(atoms)
CHECK_TICK
else
count = 0
for(var/atom/A in world)
for(var/atom/A in world) // This must be world, since this operation adds all the atoms to their specific lists.
if(!A.initialized)
InitAtom(A, mapload_arg)
++count

View File

@@ -30,7 +30,7 @@ SUBSYSTEM_DEF(xenoarch)
. = ..()
/datum/controller/subsystem/xenoarch/proc/SetupXenoarch()
for(var/turf/simulated/mineral/M in world)
for(var/turf/simulated/mineral/M in turfs)
if(!M.density)
continue

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
/proc/level_seven_announcement()
command_announcement.Announce("Confirmed outbreak of level 7 biohazard aboard [station_name()]. All personnel must contain the outbreak.", "Biohazard Alert", new_sound = 'sound/AI/outbreak7.ogg')
command_announcement.Announce("Confirmed outbreak of level 7 biohazard aboard \the [station_name()]. All personnel must contain the outbreak.", "Biohazard Alert", new_sound = 'sound/AI/outbreak7.ogg')
/proc/ion_storm_announcement()
command_announcement.Announce("It has come to our attention that the station passed through an ion storm. Please monitor all electronic equipment for malfunctions.", "Anomaly Alert")
command_announcement.Announce("It has come to our attention that \the [station_name()] passed through an ion storm. Please monitor all electronic equipment for malfunctions.", "Anomaly Alert")
/proc/AnnounceArrival(var/mob/living/carbon/human/character, var/rank, var/join_message)
if (ticker.current_state == GAME_STATE_PLAYING)

View File

@@ -39,7 +39,7 @@
if(flags & ANTAG_HAS_NUKE)
dat += "<br><table><tr><td><B>Nuclear disk(s)</B></td></tr>"
for(var/obj/item/weapon/disk/nuclear/N in world)
for(var/obj/item/weapon/disk/nuclear/N in nuke_disks)
dat += "<tr><td>[N.name], "
var/atom/disk_loc = N.loc
while(!istype(disk_loc, /turf))

View File

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

View File

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

View File

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

View File

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

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
command_alert("Space-time anomalies detected on the station. There is no additional data.", "Anomaly Alert")
world << sound('sound/AI/spanomalies.ogg')
var/list/turfs = new
var/turf/picked
for(var/turf/simulated/floor/T in world)
if(T.z in station_levels)
turfs += T
for(var/turf/simulated/floor/T in turfs)
if(prob(20))
spawn(50+rand(0,3000))
@@ -135,12 +131,12 @@ var/hadevent = 0
spawncount--
spawn(rand(5000, 6000)) //Delayed announcements to keep the crew on their toes.
command_announcement.Announce("Unidentified lifesigns detected coming aboard [station_name()]. Secure any exterior access, including ducting and ventilation.", "Lifesign Alert", new_sound = 'sound/AI/aliens.ogg')
command_announcement.Announce("Unidentified lifesigns detected coming aboard \the [station_name()]. Secure any exterior access, including ducting and ventilation.", "Lifesign Alert", new_sound = 'sound/AI/aliens.ogg')
/proc/high_radiation_event()
/* // Haha, this is way too laggy. I'll keep the prison break though.
for(var/obj/machinery/light/L in world)
for(var/obj/machinery/light/L in machines)
if(isNotStationLevel(L.z)) continue
L.flicker(50)
@@ -164,7 +160,7 @@ var/hadevent = 0
randmutg(H)
domutcheck(H,null,MUTCHK_FORCED)
sleep(100)
command_announcement.Announce("High levels of radiation detected near the station. Please report to the Med-bay if you feel strange.", "Anomaly Alert", new_sound = 'sound/AI/radiation.ogg')
command_announcement.Announce("High levels of radiation detected near \the [station_name()]. Please report to the Med-bay if you feel strange.", "Anomaly Alert", new_sound = 'sound/AI/radiation.ogg')
@@ -173,7 +169,7 @@ var/hadevent = 0
var/list/area/areas = list()
for(var/area/A in world)
for(var/area/A in all_areas)
if(istype(A, /area/security/prison) || istype(A, /area/security/brig))
areas += A
@@ -213,7 +209,7 @@ var/hadevent = 0
new /mob/living/simple_animal/hostile/carp(C.loc)
//sleep(100)
spawn(rand(300, 600)) //Delayed announcements to keep the crew on their toes.
command_announcement.Announce("Unknown biological entities have been detected near [station_name()], please stand-by.", "Lifesign Alert", new_sound = 'sound/AI/commandreport.ogg')
command_announcement.Announce("Unknown biological entities have been detected near \the [station_name()], please stand-by.", "Lifesign Alert", new_sound = 'sound/AI/commandreport.ogg')
/proc/lightsout(isEvent = 0, lightsoutAmount = 1,lightsoutRange = 25) //leave lightsoutAmount as 0 to break ALL lights
if(isEvent)
@@ -366,21 +362,21 @@ Would like to add a law like "Law x is _______" where x = a number, and _____ is
spawn(0)
world << "Started processing APCs"
for (var/obj/machinery/power/apc/APC in world)
for (var/obj/machinery/power/apc/APC in machines)
if(APC.z in station_levels)
APC.ion_act()
apcnum++
world << "Finished processing APCs. Processed: [apcnum]"
spawn(0)
world << "Started processing SMES"
for (var/obj/machinery/power/smes/SMES in world)
for (var/obj/machinery/power/smes/SMES in machines)
if(SMES.z in station_levels)
SMES.ion_act()
smesnum++
world << "Finished processing SMES. Processed: [smesnum]"
spawn(0)
world << "Started processing AIRLOCKS"
for (var/obj/machinery/door/airlock/D in world)
for (var/obj/machinery/door/airlock/D in machines)
if(D.z in station_levels)
//if(length(D.req_access) > 0 && !(12 in D.req_access)) //not counting general access and maintenance airlocks
airlocknum++
@@ -389,7 +385,7 @@ Would like to add a law like "Law x is _______" where x = a number, and _____ is
world << "Finished processing AIRLOCKS. Processed: [airlocknum]"
spawn(0)
world << "Started processing FIREDOORS"
for (var/obj/machinery/door/firedoor/D in world)
for (var/obj/machinery/door/firedoor/D in machines)
if(D.z in station_levels)
firedoornum++;
spawn(0)

View File

@@ -5,7 +5,7 @@
var/list/skipped_areas = list(/area/ai)
for(var/obj/machinery/power/smes/S in world)
for(var/obj/machinery/power/smes/S in machines)
var/area/current_area = get_area(S)
if(current_area.type in skipped_areas || !(S.z in using_map.station_levels))
continue
@@ -19,7 +19,7 @@
S.power_change()
for(var/obj/machinery/power/apc/C in world)
for(var/obj/machinery/power/apc/C in machines)
if(!C.is_critical && C.cell && (C.z in using_map.station_levels))
C.cell.charge = 0
@@ -28,10 +28,10 @@
if(announce)
command_announcement.Announce("Power has been restored to [station_name()]. We apologize for the inconvenience.", "Power Systems Nominal", new_sound = 'sound/AI/poweron.ogg')
for(var/obj/machinery/power/apc/C in world)
for(var/obj/machinery/power/apc/C in machines)
if(C.cell && (C.z in using_map.station_levels))
C.cell.charge = C.cell.maxcharge
for(var/obj/machinery/power/smes/S in world)
for(var/obj/machinery/power/smes/S in machines)
var/area/current_area = get_area(S)
if(current_area.type in skipped_areas || isNotStationLevel(S.z))
continue
@@ -45,7 +45,7 @@
if(announce)
command_announcement.Announce("All SMESs on [station_name()] have been recharged. We apologize for the inconvenience.", "Power Systems Nominal", new_sound = 'sound/AI/poweron.ogg')
for(var/obj/machinery/power/smes/S in world)
for(var/obj/machinery/power/smes/S in machines)
if(isNotStationLevel(S.z))
continue
S.charge = S.capacity

View File

@@ -1,7 +1,7 @@
/proc/wormhole_event()
spawn()
var/list/pick_turfs = list()
for(var/turf/simulated/floor/T in world)
for(var/turf/simulated/floor/T in turfs)
if(T.z in using_map.station_levels)
pick_turfs += T

View File

@@ -82,7 +82,7 @@
if(!target)
var/list/robots = list()
var/list/robot_names = list()
for(var/mob/living/silicon/robot/R in world)
for(var/mob/living/silicon/robot/R in silicon_mob_list)
if(istype(R, /mob/living/silicon/robot/drone)) // No drones.
continue
if(R.connected_ai != user) // No robots linked to other AIs

View File

@@ -37,7 +37,7 @@ var/list/nuke_disks = list()
..()
return
var/disk_rescued = 1
for(var/obj/item/weapon/disk/nuclear/D in world)
for(var/obj/item/weapon/disk/nuclear/D in nuke_disks)
var/disk_area = get_area(D)
if(!is_type_in_list(disk_area, centcom_areas))
disk_rescued = 0

View File

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

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.
return 1
for(var/mob/living/silicon/ai/ai in world)
for(var/mob/living/silicon/ai/ai in mob_list)
var/turf/T = get_turf(ai)
if(istype(T))
var/area/check_area = get_area(ai)

View File

@@ -345,3 +345,9 @@
to_chat(user, "The subject has too many chemicals in their bloodstream.")
else
to_chat(user, "There's no suitable occupant in \the [src].")
//Survival/Stasis sleepers
/obj/machinery/sleeper/survival_pod
desc = "A limited functionality sleeper, all it can do is put patients into stasis. It lacks the medication and configuration of the larger units."
icon_state = "sleeper"
stasis_level = 100 //Just one setting

View File

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

View File

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

View File

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

View File

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

View File

@@ -420,7 +420,7 @@
return dat
/proc/enable_prison_shuttle(var/mob/user)
for(var/obj/machinery/computer/prison_shuttle/PS in world)
for(var/obj/machinery/computer/prison_shuttle/PS in machines)
PS.allowedtocall = !(PS.allowedtocall)
/proc/call_shuttle_proc(var/mob/user)

View File

@@ -10,7 +10,7 @@
var/opened = 0
verb/AccessInternals()
/obj/machinery/computer/aiupload/verb/AccessInternals()
set category = "Object"
set name = "Access Computer's Internals"
set src in oview(1)
@@ -19,15 +19,15 @@
opened = !opened
if(opened)
usr << "<span class='notice'>The access panel is now open.</span>"
to_chat(usr, "<span class='notice'>The access panel is now open.</span>")
else
usr << "<span class='notice'>The access panel is now closed.</span>"
to_chat(usr, "<span class='notice'>The access panel is now closed.</span>")
return
attackby(obj/item/weapon/O as obj, mob/user as mob)
/obj/machinery/computer/aiupload/attackby(obj/item/weapon/O as obj, mob/user as mob)
if (using_map && !(user.z in using_map.contact_levels))
user << "<span class='danger'>Unable to establish a connection:</span> You're too far away from the station!"
to_chat(user, "<span class='danger'>Unable to establish a connection:</span> You're too far away from the station!")
return
if(istype(O, /obj/item/weapon/aiModule))
var/obj/item/weapon/aiModule/M = O
@@ -36,23 +36,23 @@
..()
attack_hand(var/mob/user as mob)
/obj/machinery/computer/aiupload/attack_hand(var/mob/user as mob)
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!"
to_chat(user, "The upload computer is broken!")
return
src.current = select_active_ai(user)
if (!src.current)
usr << "No active AIs detected."
to_chat(user, "No active AIs detected.")
else
usr << "[src.current.name] selected for law changes."
to_chat(user, "[src.current.name] selected for law changes.")
return
attack_ghost(user as mob)
/obj/machinery/computer/aiupload/attack_ghost(user as mob)
return 1
@@ -65,28 +65,28 @@
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))
module.install(src)
module.install(src, user)
else
return ..()
attack_hand(var/mob/user as mob)
/obj/machinery/computer/borgupload/attack_hand(var/mob/user as mob)
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!"
to_chat(user, "The upload computer is broken!")
return
src.current = freeborg()
if (!src.current)
usr << "No free cyborgs detected."
to_chat(user, "No free cyborgs detected.")
else
usr << "[src.current.name] selected for law changes."
to_chat(user, "[src.current.name] selected for law changes.")
return
attack_ghost(user as mob)
/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 += "<br><b>Medical Robots:</b>"
var/bdat = null
for(var/mob/living/bot/medbot/M in world)
for(var/mob/living/bot/medbot/M in mob_list)
if(M.z != src.z) continue //only find medibots on the same z-level as the computer
var/turf/bl = get_turf(M)

View File

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

View File

@@ -29,7 +29,7 @@
else if(screen == 1)
dat += "<HR>Chemical Implants<BR>"
var/turf/Tr = null
for(var/obj/item/weapon/implant/chem/C in world)
for(var/obj/item/weapon/implant/chem/C in all_chem_implants)
Tr = get_turf(C)
if(!Tr) continue//Out of range
if(!C.implanted) continue
@@ -39,7 +39,7 @@
dat += "<A href='?src=\ref[src];inject10=\ref[C]'>(<font color=red>(10)</font>)</A><BR>"
dat += "********************************<BR>"
dat += "<HR>Tracking Implants<BR>"
for(var/obj/item/weapon/implant/tracking/T in world)
for(var/obj/item/weapon/implant/tracking/T in all_tracking_implants)
Tr = get_turf(T)
if(!Tr) continue//Out of range
if(!T.implanted) continue

View File

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

View File

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

View File

@@ -13,37 +13,28 @@
interactable(user): performs all standard sanity checks
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 )
return 0
if(!program)
return 0
if(!istype(loc,/turf) || !istype(user.loc,/turf)) // todo handheld maybe
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>"
if(!isturf(loc) || !isturf(user.loc)) // todo handheld maybe
return 0
if(user.restrained())
user << "<span class='warning'>You need a free hand!</span>"
to_chat(user, "<span class='warning'>You need a free hand!</span>")
return 0
if(!in_range(src,user))
// telekinesis check
if(ishuman(user) && istype(user.get_active_hand(),/obj/item/tk_grab))
if(program.human_controls)
user << "<span class='warning'>It's too complicated to work at a distance!</span>"
if(issilicon(user) &&!program.ai_allowed )
to_chat(user, "<span class='warning'>You are forbidden from accessing this program.</span>")
return 0
add_fingerprint(user)
user.set_machine(src)
return 1
if(!ishuman(user) && program.human_controls)
to_chat(user, "<span class='warning'>Your body can't work the controls!</span>")
return 0
if(!in_range(src,user) && (!program.human_controls || !istype(user.get_active_hand(),/obj/item/tk_grab)))
// telekinesis check
to_chat(user, "<span class='warning'>It's too complicated to work at a distance!</span>")
return 0
add_fingerprint(user)
@@ -55,7 +46,7 @@
This is used for networking so you can determine which of several
identically named objects you're referring to.
*/
proc/format_atomlist(var/list/atoms)
/obj/machinery/computer3/proc/format_atomlist(var/list/atoms)
var/list/output = list()
for(var/atom/A in atoms)
var/title = "[A] (Range [get_dist(A,src)] meters, [dir2text(get_dir(src,A))])"
@@ -65,7 +56,7 @@
/*
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(user.machine == src)
user.unset_machine()
@@ -85,7 +76,7 @@
(I don't know why but I don't want to rip data cards out.
It just seems... interesting?)
*/
proc/list_files(var/typekey = null)
/obj/machinery/computer3/proc/list_files(var/typekey = null)
var/list/files = list()
if(hdd)
files += hdd.files
@@ -108,7 +99,7 @@
Crash the computer with an error.
Todo: redo
*/
proc/Crash(var/errorcode = PROG_CRASH)
/obj/machinery/computer3/proc/Crash(var/errorcode = PROG_CRASH)
if(!src)
return null
@@ -145,7 +136,6 @@
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>"
@@ -161,11 +151,13 @@
// 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&PREFER_FLOPPY) && floppy && floppy.addfile(F))
return 1
if((where&PREFER_CARD) && cardslot && cardslot.addfile(F))
if((where&PREFER_CARD) && istype(cardslot, /obj/item/part/computer/cardslot/dual))
var/obj/item/part/computer/cardslot/dual/D = cardslot
if(D.addfile(F))
return 1
if((where&PREFER_HDD) && hdd && hdd.addfile(F))
return 1
@@ -175,7 +167,9 @@
if(floppy && floppy.addfile(F))
return 1
if(cardslot && cardslot.addfile(F))
if(istype(cardslot, /obj/item/part/computer/cardslot/dual))
var/obj/item/part/computer/cardslot/dual/D = cardslot
if(D.addfile(F))
return 1
if(hdd && hdd.addfile(F))
return 1

View File

@@ -81,46 +81,46 @@
if(istype(P, /obj/item/weapon/wrench))
playsound(src.loc, P.usesound, 50, 1)
if(do_after(user, 20 * P.toolspeed))
user << "<span class='notice'>You wrench the frame into place.</span>"
to_chat(user, "<span class='notice'>You wrench the frame into place.</span>")
src.anchored = 1
src.state = 1
if(istype(P, /obj/item/weapon/weldingtool))
var/obj/item/weapon/weldingtool/WT = P
if(!WT.remove_fuel(0, user))
user << "The welding tool must be on to complete this task."
to_chat(user, "The welding tool must be on to complete this task.")
return
playsound(src.loc, WT.usesound, 50, 1)
if(do_after(user, 20 * WT.toolspeed))
if(!src || !WT.isOn()) return
user << "<span class='notice'>You deconstruct the frame.</span>"
to_chat(user, "<span class='notice'>You deconstruct the frame.</span>")
new /obj/item/stack/material/steel( src.loc, 5 )
qdel(src)
if(1)
if(istype(P, /obj/item/weapon/wrench))
playsound(src.loc, P.usesound, 50, 1)
if(do_after(user, 20 * P.toolspeed))
user << "<span class='notice'>You unfasten the frame.</span>"
to_chat(user, "<span class='notice'>You unfasten the frame.</span>")
src.anchored = 0
src.state = 0
if(istype(P, /obj/item/weapon/circuitboard) && !circuit)
var/obj/item/weapon/circuitboard/B = P
if(B.board_type == "computer")
playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1)
user << "<span class='notice'>You place the circuit board inside the frame.</span>"
to_chat(user, "<span class='notice'>You place the circuit board inside the frame.</span>")
src.icon_state = "1"
src.circuit = P
user.drop_item()
P.loc = src
else
user << "<span class='warning'>This frame does not accept circuit boards of this type!</span>"
to_chat(user, "<span class='warning'>This frame does not accept circuit boards of this type!</span>")
if(istype(P, /obj/item/weapon/screwdriver) && circuit)
playsound(src.loc, P.usesound, 50, 1)
user << "<span class='notice'>You screw the circuit board into place.</span>"
to_chat(user, "<span class='notice'>You screw the circuit board into place.</span>")
src.state = 2
src.icon_state = "2"
if(istype(P, /obj/item/weapon/crowbar) && circuit)
playsound(src.loc, P.usesound, 50, 1)
user << "<span class='notice'>You remove the circuit board.</span>"
to_chat(user, "<span class='notice'>You remove the circuit board.</span>")
src.state = 1
src.icon_state = "0"
circuit.loc = src.loc
@@ -128,7 +128,7 @@
if(2)
if(istype(P, /obj/item/weapon/screwdriver) && circuit)
playsound(src.loc, P.usesound, 50, 1)
user << "<span class='notice'>You unfasten the circuit board.</span>"
to_chat(user, "<span class='notice'>You unfasten the circuit board.</span>")
src.state = 1
src.icon_state = "1"
@@ -137,10 +137,10 @@
playsound(src.loc, P.usesound, 50, 1)
if(do_after(10 * P.toolspeed))
battery.loc = loc
user << "<span class='notice'>You remove [battery].</span>"
to_chat(user, "<span class='notice'>You remove [battery].</span>")
battery = null
else
user << "<span class='warning'>There's no battery to remove!</span>"
to_chat(user, "<span class='warning'>There's no battery to remove!</span>")
if(istype(P, /obj/item/weapon/cell))
if(!battery)
@@ -148,9 +148,9 @@
if(do_after(5))
battery = P
P.loc = src
user << "<span class='notice'>You insert [battery].</span>"
to_chat(user, "<span class='notice'>You insert [battery].</span>")
else
user << "<span class='warning'>There's already \an [battery] in [src]!</span>"
to_chat(user, "<span class='warning'>There's already \an [battery] in [src]!</span>")
if(istype(P, /obj/item/stack/cable_coil))
@@ -160,16 +160,16 @@
if(P)
P:amount -= 5
if(!P:amount) qdel(P)
user << "<span class='notice'>You add cables to the frame.</span>"
to_chat(user, "<span class='notice'>You add cables to the frame.</span>")
src.state = 3
src.icon_state = "3"
if(3)
if(istype(P, /obj/item/weapon/wirecutters))
if(components.len)
user << "There are parts in the way!"
to_chat(user, "There are parts in the way!")
return
playsound(src.loc, P.usesound, 50, 1)
user << "<span class='notice'>You remove the cables.</span>"
to_chat(user, "<span class='notice'>You remove the cables.</span>")
src.state = 2
src.icon_state = "2"
var/obj/item/stack/cable_coil/A = new /obj/item/stack/cable_coil( src.loc )
@@ -185,19 +185,19 @@
if(do_after(user, 20))
if(S)
S.use(2)
user << "<span class='notice'>You put in the glass panel.</span>"
to_chat(user, "<span class='notice'>You put in the glass panel.</span>")
src.state = 4
src.icon_state = "4"
if(4)
if(istype(P, /obj/item/weapon/crowbar))
playsound(src.loc, P.usesound, 50, 1)
user << "<span class='notice'>You remove the glass panel.</span>"
to_chat(user, "<span class='notice'>You remove the glass panel.</span>")
src.state = 3
src.icon_state = "3"
new /obj/item/stack/material/glass( src.loc, 2 )
if(istype(P, /obj/item/weapon/screwdriver))
playsound(src.loc, P.usesound, 50, 1)
user << "<span class='notice'>You connect the monitor.</span>"
to_chat(user, "<span class='notice'>You connect the monitor.</span>")
var/obj/machinery/computer3/B = new src.circuit.build_path ( src.loc, built=1 )
/*if(circuit.powernet) B:powernet = circuit.powernet
if(circuit.id) B:id = circuit.id
@@ -220,7 +220,7 @@
*/
/obj/structure/computer3frame/proc/remove_peripheral(var/obj/item/I = null)
if(!components || !components.len)
usr << "<span class='warning'>There are no components in [src] to take out!</span>"
to_chat(usr, "<span class='warning'>There are no components in [src] to take out!</span>")
return 0
if(!I)
I = input(usr, "Remove which component?","Remove component", null) as null|obj in components
@@ -259,44 +259,45 @@
else
warning("Erronous component in computerframe/remove_peripheral: [I]")
I.loc = loc
usr << "<span class='notice'>You remove [I]</span>"
to_chat(usr, "<span class='notice'>You remove [I]</span>")
return 1
return 0
/obj/structure/computer3frame/proc/insert_peripheral(var/obj/item/I)
if(components.len >= max_components)
usr << "There isn't room in [src] for another component!"
to_chat(usr, "There isn't room in [src] for another component!")
return 0
switch(I.type)
if(/obj/item/part/computer/storage/hdd)
if(hdd)
usr << "There is already \an [hdd] in [src]!"
to_chat(usr, "There is already \an [hdd] in [src]!")
return 0
hdd = I
components += hdd
hdd.loc = src
if(/obj/item/part/computer/storage/removable)
if(floppy)
usr << "There is already \an [floppy] in [src]!"
to_chat(usr, "There is already \an [floppy] in [src]!")
return 0
floppy = I
components += floppy
floppy.loc = src
if(/obj/item/part/computer/networking/radio)
if(radio)
usr << "There is already \an [radio] in [src]!"
to_chat(usr, "There is already \an [radio] in [src]!")
return 0
radio = I
components += radio
radio.loc = src
if(/obj/item/part/computer/networking/cameras)
if(camnet)
usr << "There is already \an [camnet] in [src]!"
to_chat(usr, "There is already \an [camnet] in [src]!")
return 0
camnet = I
components += camnet
camnet.loc = src
if(/obj/item/part/computer/networking)
if(net)
usr << "There is already \an [net] in [src]!"
to_chat(usr, "There is already \an [net] in [src]!")

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.
var/list/attackby_types = list()
proc/allow_attackby(var/obj/item/I as obj,var/mob/user as mob)
for(var/typekey in attackby_types)
if(istype(I,typekey))
/obj/item/part/computer/proc/allow_attackby(var/obj/item/I, var/mob/user)
for(var/typepath in attackby_types)
if(istype(I, typepath))
return 1
return 0
proc/init(var/obj/machinery/computer/target)
/obj/item/part/computer/proc/init(var/obj/machinery/computer/target)
computer = target
// continue to handle all other type-specific procedures
@@ -49,40 +49,39 @@
var/mob/living/silicon/ai/occupant = null
var/busy = 0
attackby(obj/I as obj,mob/user as mob)
/obj/item/part/computer/ai_holder/attackby(obj/I as obj,mob/user as mob)
if(computer && !computer.stat)
if(istype(I, /obj/item/device/aicard))
var/obj/item/device/aicard/card = I
var/mob/living/silicon/ai/comp_ai = locate() in src
var/mob/living/silicon/ai/card_ai = locate() in card
if(istype(comp_ai))
if(busy)
user << "<span class='danger'>ERROR:</span> Reconstruction in progress."
to_chat(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
if(card.grab_ai(comp_ai, user))
occupant = null
else if(istype(card_ai))
load_ai(card_ai,card,user)
occupant = locate(/mob/living/silicon/ai) in src
if(computer.program)
computer.program.update_icon()
computer.update_icon()
computer.occupant = occupant
..()
return
/obj/item/part/computer/ai_holder/proc/load_ai(var/mob/living/silicon/ai/transfer, var/obj/item/device/aicard/card, var/mob/user)
if(!transfer)
if(!istype(transfer))
return
// Transfer over the AI.
transfer << "You have been transferred into a mobile terminal. Sadly, there is no remote access from here."
user << "<span class='notice'>Transfer successful:</span> [transfer.name] placed within mobile terminal."
to_chat(transfer, "You have been transferred into a mobile terminal. Sadly, there is no remote access from here.")
to_chat(user, "<span class='notice'>Transfer successful:</span> [transfer.name] placed within mobile terminal.")
transfer.loc = src
transfer.cancel_camera()
@@ -102,61 +101,33 @@
desc = "Contains a slot for reading magnetic swipe cards."
var/obj/item/weapon/card/reader = null
var/obj/item/weapon/card/writer = null // so that you don't need to typecast dual cardslots, but pretend it's not here
// alternately pretend they did it to save money on manufacturing somehow
var/dualslot = 0 // faster than typechecking
attackby_types = list(/obj/item/weapon/card)
attackby(var/obj/item/I as obj, var/mob/user as mob)
if(istype(I,/obj/item/weapon/card))
insert(I)
/obj/item/part/computer/cardslot/attackby(var/obj/item/I as obj, var/mob/user)
if(istype(I,/obj/item/weapon/card) && computer)
if(istype(I,/obj/item/weapon/card/emag) && !reader) // emag reader slot
user.visible_message("[computer]'s screen flickers for a moment.","You insert \the [I]. After a moment, the card ejects itself, and [computer] beeps.","[computer] beeps.")
computer.emagged = 1
return
insert(I, user)
return
..(I,user)
// cardslot.insert(card, slot)
// card: The card obj you want to insert (usually your ID)
// slot: Which slot to insert into (1: reader, 2: writer, 3: auto), 3 default
proc/insert(var/obj/item/weapon/card/card, var/slot = 3)
if(!computer)
return 0
// This shouldn't happen, just in case..
if(slot == 2 && !dualslot)
usr << "This device has only one card slot"
return 0
if(istype(card,/obj/item/weapon/card/emag)) // emag reader slot
if(!writer)
usr << "You insert \the [card], and the computer grinds, sparks, and beeps. After a moment, the card ejects itself."
computer.emagged = 1
// user: The mob inserting the card
/obj/item/part/computer/cardslot/proc/insert(var/obj/item/weapon/card/card, var/mob/user)
if(equip_to_reader(card, user))
to_chat(user, "You insert the card into reader slot")
return 1
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."
to_chat(user, "There is already something in the reader slot.")
return 0
// Usage of insert() preferred, as it also tells result to the user.
proc/equip_to_reader(var/obj/item/weapon/card/card, var/mob/living/L)
/obj/item/part/computer/cardslot/proc/equip_to_reader(var/obj/item/weapon/card/card, var/mob/living/L)
if(!reader)
L.drop_item()
card.loc = src
@@ -164,166 +135,97 @@
return 1
return 0
proc/equip_to_writer(var/obj/item/weapon/card/card, var/mob/living/L)
if(!writer && dualslot)
L.drop_item()
card.loc = src
writer = card
// cardslot.remove(slot)
// user: The mob removing the card
/obj/item/part/computer/cardslot/proc/remove(var/mob/user)
if(remove_reader(user))
to_chat(user, "You remove the card from reader slot")
return 1
to_chat(user, "There is nothing in the reader slot")
return 0
// cardslot.remove(slot)
// slot: Which slot to remove card(s) from (1: reader only, 2: writer only, 3: both [works even with one card], 4: reader and if empty then writer ), 3 default
proc/remove(var/slot = 3)
var/mob/living/L = usr
switch(slot)
if(1)
if (remove_reader(L))
L << "You remove the card from reader slot"
else
L << "There is no card in the reader slot"
if(2)
if (remove_writer(L))
L << "You remove the card from writer slot"
else
L << "There is no card in the writer slot"
if(3)
if (remove_reader(L))
if (remove_writer(L))
L << "You remove cards from both slots"
else
L << "You remove the card from reader slot"
else
if(remove_writer(L))
L << "You remove the card from writer slot"
else
L << "There are no cards in both slots"
if(4)
if (!remove_reader(L))
if (remove_writer(L))
L << "You remove the card from writer slot"
else if (!dualslot)
L << "There is no card in the reader slot"
else
L << "There are no cards in both slots"
else
L << "You remove the card from reader slot"
proc/remove_reader(var/mob/living/L)
/obj/item/part/computer/cardslot/proc/remove_reader(var/mob/living/L)
if(reader)
reader.loc = loc
if(istype(L) && !L.get_active_hand())
if(istype(L,/mob/living/carbon/human))
if(ishuman(L) && !L.get_active_hand())
L.put_in_hands(reader)
else
reader.loc = get_turf(computer)
else
reader.loc = get_turf(computer)
reader = null
return 1
return 0
proc/remove_writer(var/mob/living/L)
if(writer && dualslot)
writer.loc = loc
if(istype(L) && !L.get_active_hand())
if(istype(L,/mob/living/carbon/human))
// Authorizes the user based on the computer's requirements
/obj/item/part/computer/cardslot/proc/authenticate()
return computer.check_access(reader)
/obj/item/part/computer/cardslot/dual
name = "magnetic card reader"
desc = "Contains slots for inserting magnetic swipe cards for reading and writing."
var/obj/item/weapon/card/writer = null
// Ater: Single- and dual-slot card readers have separate functions.
// According to OOP principles, they should be separate classes and use inheritance, polymorphism.
/obj/item/part/computer/cardslot/dual/proc/equip_to_writer(var/obj/item/weapon/card/card, var/mob/living/L)
if(!writer)
L.drop_item()
card.loc = src
writer = card
return 1
return 0
/obj/item/part/computer/cardslot/dual/proc/remove_from_writer(var/mob/living/L)
if(writer)
if(ishuman(L) && !L.get_active_hand())
L.put_in_hands(writer)
else
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
proc/authenticate()
return computer.check_access(reader)
// 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
proc/addfile(var/datum/file/F)
if(!dualslot || !istype(writer,/obj/item/weapon/card/data))
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
/obj/item/part/computer/cardslot/dual
name = "magnetic card reader"
desc = "Contains slots for inserting magnetic swipe cards for reading and writing."
dualslot = 1
/*
// Atlantis: Reworked card manipulation a bit.
// No need for separated code for dual and single readers.
// Both is handled in single-slot reader code now, thanks to the "dualslot" var.
// Leaving this code here if someone wants to somehow use it, just uncomment.
insert(var/obj/item/weapon/card/card,var/slot = 0)
if(!computer)
return 0
if(istype(card,/obj/item/weapon/card/emag) && !reader) // emag reader slot
usr.visible_message("[computer]'s screen flickers for a moment.","You insert \the [card]. After a moment, the card ejects itself, and [computer] beeps.","[computer] beeps.")
computer.emagged = 1
return 1
if(slot == 1) // 1: writer
if(writer != null)
usr << "There's already a card in that slot!"
return 0
var/mob/living/L = usr
L.drop_item()
card.loc = src
writer = card
return 1
else if(slot == 2) // 2: reader
if(reader != null)
usr << "There's already a card in that slot!"
return 0
var/mob/living/L = usr
L.drop_item()
card.loc = src
reader = card
return 1
else // 0: auto
if(reader && writer)
usr << "Both slots are full!"
return 0
var/mob/living/L = usr
L.drop_item()
card.loc = src
if(reader)
writer = card
computer.updateUsrDialog()
return 1
if(istype(card,/obj/item/weapon/card/id) && !(access_change_ids in card:access) && !writer) // not authorized
writer = card
computer.updateUsrDialog()
return 1
if(!reader)
reader = card
computer.updateUsrDialog()
return 1
return 0
remove(var/obj/item/weapon/card/card)
if(card != reader && card != writer)
return
if(card == reader) reader = null
if(card == writer) writer = null
card.loc = loc
var/mob/living/carbon/human/user = usr
if(ishuman(user) && !user.get_active_hand())
user.put_in_hands(card)
else
card.loc = computer.loc
*/

View File

@@ -45,7 +45,6 @@
// Misc & special purpose
var/obj/item/part/computer/ai_holder/cradle = null
var/obj/item/part/computer/toybox/toybox = null
var/mob/living/silicon/ai/occupant = null
// Legacy variables
@@ -70,23 +69,7 @@
var/obj/item/weapon/cell/battery = null // uninterruptible power supply aka battery
verb/ResetComputer()
set name = "Reset Computer"
set category = "Object"
set src in view(1)
if(usr.stat || usr.restrained() || usr.lying || !istype(usr, /mob/living))
usr << "<span class='warning'>You can't do that.</span>"
return
if(!Adjacent(usr))
usr << "You can't reach it."
return
Reset()
New(var/L, var/built = 0)
/obj/machinery/computer3/New(var/L, var/built = 0)
..()
spawn(2)
power_change()
@@ -126,69 +109,96 @@
os = circuitb.OS
circuitb.name = "Circuitboard ([P])"
if(hdd) // Spawn files
for(var/typekey in spawn_files)
hdd.addfile(new typekey,1)
update_icon()
/obj/machinery/computer3/verb/ResetComputer()
set name = "Reset Computer"
set category = "Object"
set src in view(1)
proc/update_spawn_files()
if(usr.stat || usr.restrained() || usr.lying || !istype(usr, /mob/living))
to_chat(usr, "<span class='warning'>You can't do that.</span>")
return
if(!Adjacent(usr))
to_chat(usr, "You can't reach it.")
return
Reset()
/obj/machinery/computer3/proc/update_spawn_files()
for(var/typekey in spawn_files)
hdd.addfile(new typekey,1)
proc/spawn_parts()
/obj/machinery/computer3/proc/spawn_parts()
for(var/typekey in spawn_parts)
if(ispath(typekey,/obj/item/part/computer/storage/removable))
if(floppy) continue
if(floppy)
continue
floppy = new typekey(src)
floppy.init(src)
continue
if(ispath(typekey,/obj/item/part/computer/storage/hdd))
if(hdd) continue
if(hdd)
continue
hdd = new typekey(src)
hdd.init(src)
continue
if(ispath(typekey,/obj/item/part/computer/networking/cameras))
if(camnet) continue
if(camnet)
continue
camnet = new typekey(src)
camnet.init(src)
continue
if(ispath(typekey,/obj/item/part/computer/networking/radio))
if(radio) continue
if(radio)
continue
radio = new typekey(src)
radio.init(src)
continue
if(ispath(typekey,/obj/item/part/computer/networking))
if(net) continue
if(net)
continue
net = new typekey(src)
net.init(src)
continue
if(ispath(typekey,/obj/item/part/computer/cardslot))
if(cardslot) continue
if(cardslot)
continue
cardslot = new typekey(src)
cardslot.init(src)
continue
if(ispath(typekey,/obj/item/part/computer/ai_holder))
if(cradle) continue
if(cradle)
continue
cradle = new typekey(src)
cradle.init(src)
continue
if(ispath(typekey,/obj/item/part/computer/toybox))
if(toybox) continue
if(toybox)
continue
toybox = new typekey(src)
toybox.init(src)
continue
if(ispath(typekey,/obj/item/weapon/cell))
if(battery) continue
if(battery)
continue
battery = new typekey(src)
continue
proc/Reset(var/error = 0)
/obj/machinery/computer3/proc/Reset(var/error = 0)
for(var/mob/living/M in range(1))
M << browse(null,"window=\ref[src]")
if(program)
@@ -199,12 +209,12 @@
// todo does this do enough
emp_act(severity)
/obj/machinery/computer3/emp_act(severity)
if(prob(20/severity)) set_broken()
..()
ex_act(severity)
/obj/machinery/computer3/ex_act(severity)
switch(severity)
if(1.0)
qdel(src)
@@ -244,7 +254,7 @@
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(battery && battery.charge > 0)
if(use_power == 1)
@@ -259,7 +269,7 @@
use_power(active_power_usage,power_channel)
return 1
use_power(var/amount, var/chan = -1)
/obj/machinery/computer3/use_power(var/amount, var/chan = -1)
if(chan == -1)
chan = power_channel
@@ -269,13 +279,13 @@
else if(battery && battery.charge > 0)
battery.use(amount)
power_change()
/obj/machinery/computer3/power_change()
if( !powered(power_channel) && (!battery || battery.charge <= 0) )
stat |= NOPOWER
else
stat &= ~NOPOWER
process()
/obj/machinery/computer3/process()
auto_use_power()
power_change()
update_icon()
@@ -291,8 +301,7 @@
os.process()
return
proc/set_broken()
/obj/machinery/computer3/proc/set_broken()
icon_state = "computer_b"
stat |= BROKEN
if(program)
@@ -300,7 +309,7 @@
if(os)
os.error = BUSTED_ASS_COMPUTER
attackby(I as obj, mob/user as mob)
/obj/machinery/computer3/attackby(I as obj, mob/user as mob)
if(istype(I, /obj/item/weapon/screwdriver) && allow_disassemble)
disassemble(user)
return
@@ -310,10 +319,9 @@
|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)
for(var/obj/item/part/computer/C in src)
if(!isnull(C) && C.allow_attackby(I,user))
p_list += C
if(p_list.len)
@@ -328,7 +336,7 @@
return
..()
attack_hand(var/mob/user as mob)
/obj/machinery/computer3/attack_hand(var/mob/user as mob)
if(stat)
Reset()
return
@@ -356,9 +364,9 @@
os.attack_hand(user)
return
user << "\The [src] won't boot!"
to_chat(user, "\The [src] won't boot!")
attack_ai(var/mob/user as mob) // copypasta because server racks lose attack_hand()
/obj/machinery/computer3/attack_ai(var/mob/user as mob) // copypasta because server racks lose attack_hand()
if(stat)
Reset()
return
@@ -381,9 +389,9 @@
os.attack_hand(user)
return
user << "\The [src] won't boot!"
to_chat(user, "\The [src] won't boot!")
interact()
/obj/machinery/computer3/interact()
if(stat)
Reset()
return
@@ -400,7 +408,7 @@
os.interact()
return
update_icon()
/obj/machinery/computer3/update_icon()
if(legacy_icon)
icon_state = initial(icon_state)
// Broken
@@ -433,7 +441,7 @@
name = initial(name) + " (orange screen of death)"
//Returns percentage of battery charge remaining. Returns -1 if no battery is installed.
proc/check_battery_status()
/obj/machinery/computer3/proc/check_battery_status()
if (battery)
var/obj/item/weapon/cell/B = battery
return round(B.charge / (B.maxcharge / 100))

View File

@@ -22,7 +22,7 @@
var/emagged = 0
interact()
/datum/file/program/holodeck/interact()
if(!interactable())
return
var/dat = "<h3>Current Loaded Programs</h3>"
@@ -55,8 +55,7 @@
popup.open()
return
Topic(var/href, var/list/href_list)
/datum/file/program/holodeck/Topic(var/href, var/list/href_list)
if(!interactable() || ..(href,href_list))
return
@@ -91,19 +90,22 @@
loadProgram(target)
else if("burntest" in href_list)
if(!emagged) return
if(!emagged)
return
target = locate(/area/holodeck/source_burntest)
if(target)
loadProgram(target)
else if("wildlifecarp" in href_list)
if(!emagged) return
if(!emagged)
return
target = locate(/area/holodeck/source_wildlife)
if(target)
loadProgram(target)
else if("AIoverride" in href_list)
if(!issilicon(usr)) return
if(!issilicon(usr))
return
emagged = !emagged
if(emagged)
message_admins("[key_name_admin(usr)] overrode the holodeck's safeties")
@@ -115,10 +117,10 @@
interact()
return
Reset()
/datum/file/program/holodeck/Reset()
emergencyShutdown()
process()
/datum/file/program/holodeck/process()
if(active)
if(!checkInteg(linkedholodeck))
damaged = 1
@@ -129,7 +131,6 @@
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
@@ -138,14 +139,11 @@
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)
/datum/file/program/holodeck/proc/derez(var/obj/obj , var/silent = 1)
holographic_items.Remove(obj)
if(obj == null)
@@ -161,15 +159,13 @@
obj.visible_message("The [oldobj.name] fades away!")
qdel(obj)
proc/checkInteg(var/area/A)
/datum/file/program/holodeck/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)
/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)
@@ -185,7 +181,6 @@
if(T)
T.temperature = 5000
T.hotspot_expose(50000,50000,1)
active = 1
else
for(var/item in holographic_items)
@@ -194,9 +189,7 @@
targetsource.copy_contents_to(linkedholodeck , 1)
active = 0
proc/loadProgram(var/area/A)
/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
@@ -238,7 +231,7 @@
new /mob/living/simple_animal/hostile/carp(L.loc)
proc/emergencyShutdown()
/datum/file/program/holodeck/proc/emergencyShutdown()
//Get rid of any items
for(var/item in holographic_items)
derez(item)
@@ -250,4 +243,3 @@
var/area/targetsource = locate(/area/holodeck/source_plating)
targetsource.copy_contents_to(linkedholodeck , 1)
active = 0

View File

@@ -24,7 +24,11 @@
/obj/item/toy/prize/odysseus = 1,
/obj/item/toy/prize/phazon = 1
)
proc/dispense()
/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)
@@ -35,7 +39,6 @@
feedback_inc("arcade_win_normal")
computer.use_power(500)
/datum/file/program/arcade
desc = "The best arcade game ever produced by the Company's short-lived entertainment divison."
//headcanon: they also ported E.T. for the atari 2600, superman 64, and basically every other movie tie-in game ever
@@ -66,7 +69,6 @@
enemy_name = replacetext(name_part1, "the ", "") + name_part2
name = (name_action + name_part1 + name_part2)
/datum/file/program/arcade/interact()
if(!interactable())
return

View File

@@ -9,7 +9,7 @@
active_state = "alert:2"
refresh = 1
execute(var/datum/file/program/source)
/datum/file/program/atmos_alert/execute(var/datum/file/program/source)
..(source)
if(!computer.radio)
@@ -19,12 +19,14 @@
// This will be called as long as the program is running on the parent computer
// and the computer has the radio peripheral
receive_signal(datum/signal/signal)
if(!signal || signal.encryption) return
/datum/file/program/atmos_alert/receive_signal(datum/signal/signal)
if(!signal || signal.encryption)
return
var/zone = signal.data["zone"]
var/severity = signal.data["alert"]
if(!zone || !severity) return
if(!zone || !severity)
return
minor_air_alarms -= zone
priority_air_alarms -= zone
@@ -36,7 +38,7 @@
return
interact()
/datum/file/program/atmos_alert/interact()
if(!interactable())
return
if(!computer.radio)
@@ -45,8 +47,7 @@
popup.set_content(return_text())
popup.open()
update_icon()
/datum/file/program/atmos_alert/update_icon()
..()
if(priority_air_alarms.len > 0)
overlay.icon_state = "alert:2"
@@ -59,7 +60,7 @@
computer.update_icon()
proc/return_text()
/datum/file/program/atmos_alert/proc/return_text()
var/priority_text = "<h2>Priority Alerts:</h2>"
var/minor_text = "<h2>Minor Alerts:</h2>"
@@ -78,7 +79,7 @@
return "[priority_text]<BR><HR>[minor_text]<BR>[topic_link(src,"close","Close")]"
Topic(var/href, var/list/href_list)
/datum/file/program/atmos_alert/Topic(var/href, var/list/href_list)
if(!interactable() || ..(href,href_list))
return
@@ -86,14 +87,14 @@
var/removing_zone = href_list["priority_clear"]
for(var/zone in priority_air_alarms)
if(ckey(zone) == removing_zone)
usr << "<span class='notice'>Priority Alert for area [zone] cleared.</span>"
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)
usr << "<span class='notice'>Minor Alert for area [zone] cleared.</span>"
to_chat(usr, "<span class='notice'>Minor Alert for area [zone] cleared.</span>")
minor_air_alarms -= zone
computer.updateUsrDialog()

View File

@@ -23,7 +23,7 @@
allow_disassemble = 0
// No operating system
New()
/obj/machinery/computer3/security/wooden_tv/New()
..(built=0)
os = program
circuitb.OS = os
@@ -59,7 +59,7 @@
var/networks = list("ALL") // A little workaround as it is not possible to place station_networks here
var/screen = "cameras"
execute(var/datum/file/source)
/datum/file/camnet_key/execute(var/datum/file/source)
if(istype(source,/datum/file/program/security))
var/datum/file/program/security/prog = source
prog.key = src
@@ -150,7 +150,7 @@
var/mapping = 0//For the overview file, interesting bit of code.
//proc/camera_list(var/datum/file/camnet_key/key)
get_machines(var/datum/file/camnet_key/key)
/obj/item/part/computer/networking/cameras/get_machines(var/datum/file/camnet_key/key)
if (!computer || computer.z > 6)
return null
@@ -163,7 +163,8 @@
L.Add(C)
return L
verify_machine(var/obj/machinery/camera/C,var/datum/file/camnet_key/key = null)
/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
@@ -198,7 +199,7 @@
var/obj/machinery/camera/current = null
execute(var/datum/file/program/caller)
/datum/file/program/security/execute(var/datum/file/program/caller)
..(caller)
if(computer && !key)
var/list/fkeys = computer.list_files(/datum/file/camnet_key)
@@ -211,14 +212,14 @@
L.reset_view(null)
Reset()
/datum/file/program/security/Reset()
..()
reset_current()
for(var/mob/living/L in viewers(1))
if(!istype(L,/mob/living/silicon/ai) && L.machine == src)
L.reset_view(null)
interact()
/datum/file/program/security/interact()
if(!interactable())
return
@@ -255,7 +256,7 @@
popup.open()
update_icon()
/datum/file/program/security/update_icon()
if(key)
overlay.icon_state = key.screen
name = key.title + " Camera Monitor"
@@ -265,7 +266,7 @@
Topic(var/href,var/list/href_list)
/datum/file/program/security/Topic(var/href,var/list/href_list)
if(!interactable() || !computer.camnet || ..(href,href_list))
return
@@ -285,7 +286,7 @@
if(key)
interact()
else
usr << "The screen turns to static."
to_chat(usr, "The screen turns to static.")
return
/datum/file/program/security/proc/select_key(var/selected_key)
@@ -332,7 +333,7 @@
var/special_key = new/datum/file/camnet_key/syndicate
var/camera_conn = null
interact()
/datum/file/program/security/syndicate/interact()
if(!interactable())
return

View File

@@ -23,13 +23,13 @@
var/auth = 0
var/printing = 0
proc/list_jobs()
/datum/file/program/card_comp/proc/list_jobs()
return get_all_jobs() + "Custom"
// creates the block with the script in it
// cache the result since it's almost constant but not quite
// the list of jobs won't change after all...
proc/scriptblock()
/datum/file/program/card_comp/proc/scriptblock()
var/global/dat = null
var/counter = 0
var jobs_all = ""
@@ -113,7 +113,7 @@
return dat
// 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>"
accesses += "<table style='width:100%'>"
accesses += "<tr>"
@@ -132,7 +132,7 @@
accesses += "</tr></table>"
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
// Header
@@ -157,10 +157,9 @@
// list of access rights
dat += accessblock()
return dat
proc/login_menu()
/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>"
@@ -177,7 +176,7 @@
dat += topic_link(src,"mode=1","Access Crew Manifest")
return dat
proc/show_manifest()
/datum/file/program/card_comp/proc/show_manifest()
// assume linked_db since called by interact()
var/crew = ""
var/list/L = list()
@@ -189,14 +188,14 @@
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
proc/authenticate()
/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
proc/set_default_access(var/jobname)
/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
@@ -207,15 +206,17 @@
writer.access = jobdatum.get_access() // ( istype(src,/obj/machinery/computer/card/centcom) ? get_centcom_access(t1)
interact()
if(!interactable()) return
/datum/file/program/card_comp/interact()
if(!interactable())
return
if(!computer.cardslot || !computer.cardslot.dualslot)
if(!istype(computer.cardslot, /obj/item/part/computer/cardslot/dual))
computer.Crash(MISSING_PERIPHERAL)
return
reader = computer.cardslot.reader
writer = computer.cardslot.writer
var/obj/item/part/computer/cardslot/dual/D = computer.cardslot
reader = D.reader
writer = D.writer
var/dat
@@ -238,7 +239,7 @@
return
Topic(href, list/href_list)
/datum/file/program/card_comp/Topic(href, list/href_list)
if(!interactable() || !computer.cardslot || ..(href,href_list))
return
// todo distance/disability checks
@@ -253,9 +254,9 @@
if("remove" in href_list)
var/which = href_list["remove"]
if(which == "writer")
computer.cardslot.remove(2)
computer.cardslot.remove(usr, 2)
else
computer.cardslot.remove(1)
computer.cardslot.remove(usr, 1)
auth = 0
if("insert" in href_list)
@@ -264,9 +265,9 @@
var/which = href_list["insert"]
if(which == "writer")
computer.cardslot.insert(card,2)
computer.cardslot.insert(card, usr, 2)
else
computer.cardslot.insert(card,1)
computer.cardslot.insert(card,usr)
if("print" in href_list)
if (printing)
@@ -324,19 +325,14 @@
computer.updateUsrDialog()
return
/datum/file/program/card_comp/centcom
name = "CentCom identification console"
drm = 1
list_jobs()
/datum/file/program/card_comp/centcom/list_jobs()
return get_all_centcom_jobs() + "Custom"
accessblock()
/datum/file/program/card_comp/centcom/accessblock()
var/accesses = "<h5>[using_map.boss_name]:</h5>"
for(var/A in get_all_centcom_access())
if(A in writer.access)
@@ -345,7 +341,7 @@
accesses += topic_link(src,"access=[A]",replacetext(get_centcom_access_desc(A), " ", "&nbsp")) + " "
return accesses
authenticate()
/datum/file/program/card_comp/centcom/authenticate()
if(access_cent_captain in reader.access)
return 1
return 0

View File

@@ -45,26 +45,27 @@
var/datum/announcement/priority/crew_announcement = new
New()
/datum/file/program/communications/New()
..()
crew_announcement.newscast = 1
Reset()
/datum/file/program/communications/Reset()
..()
authenticated = 0
state = STATE_DEFAULT
aistate = STATE_DEFAULT
Topic(var/href, var/list/href_list)
/datum/file/program/communications/Topic(var/href, var/list/href_list)
if(!interactable() || !computer.radio || ..(href,href_list) )
return
if (computer.z > 1)
usr << "<span class='danger'>Unable to establish a connection:</span> You're too far away from the station!"
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
if("login" in href_list)
var/mob/M = usr
var/obj/item/I = M.get_active_hand()
@@ -78,6 +79,7 @@
if(istype(I,/obj/item/weapon/card/emag))
authenticated = 2
computer.emagged = 1
if("logout" in href_list)
authenticated = 0
crew_announcement.announcer = ""
@@ -90,9 +92,12 @@
if (istype(I,/obj/item/weapon/card/id))
if(access_captain in I.GetAccess())
var/old_level = security_level
if(!tmp_alertlevel) tmp_alertlevel = SEC_LEVEL_GREEN
if(tmp_alertlevel < SEC_LEVEL_GREEN) tmp_alertlevel = SEC_LEVEL_GREEN
if(tmp_alertlevel > SEC_LEVEL_BLUE) tmp_alertlevel = SEC_LEVEL_BLUE //Cannot engage delta with this
if(!tmp_alertlevel)
tmp_alertlevel = SEC_LEVEL_GREEN
if(tmp_alertlevel < SEC_LEVEL_GREEN)
tmp_alertlevel = SEC_LEVEL_GREEN
if(tmp_alertlevel > SEC_LEVEL_BLUE)
tmp_alertlevel = SEC_LEVEL_BLUE //Cannot engage delta with this
set_security_level(tmp_alertlevel)
if(security_level != old_level)
//Only notify the admins if an actual change happened
@@ -104,12 +109,13 @@
if(SEC_LEVEL_BLUE)
feedback_inc("alert_comms_blue",1)
tmp_alertlevel = 0
else:
usr << "You are not authorized to do this."
else
to_chat(usr, "You are not authorized to do this.")
tmp_alertlevel = 0
state = STATE_DEFAULT
else
usr << "You need to swipe your ID."
to_chat(usr, "You need to swipe your ID.")
if("announce" in href_list)
if(authenticated==2)
if(message_cooldown)
@@ -127,6 +133,7 @@
state = STATE_DEFAULT
if(authenticated)
state = STATE_CALLSHUTTLE
if("callshuttle2" in href_list)
if(!computer.radio.subspace)
return
@@ -135,13 +142,16 @@
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)
@@ -149,8 +159,10 @@
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)
@@ -164,6 +176,7 @@
state = STATE_MESSAGELIST
else
state = STATE_VIEWMESSAGE
if("status" in href_list)
state = STATE_STATUSDISPLAY
@@ -180,6 +193,7 @@
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()
@@ -190,56 +204,58 @@
return
if(authenticated==2)
if(centcomm_message_cooldown)
usr << "Arrays recycling. Please stand by."
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)
usr << "Message transmitted."
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)
usr << "Arrays recycling. Please stand by."
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)
usr << "Message transmitted."
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)
usr << "Backup routing data restored!"
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)
@@ -247,8 +263,10 @@
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]
@@ -259,6 +277,7 @@
currmsg = 0
aicurrmsg = 0
aistate = STATE_MESSAGELIST
if("ai-status" in href_list)
aistate = STATE_STATUSDISPLAY
@@ -274,7 +293,7 @@
proc/main_menu()
/datum/file/program/communications/proc/main_menu()
var/dat = ""
if (computer.radio.subspace)
if(emergency_shuttle.online() && emergency_shuttle.location())
@@ -306,10 +325,10 @@
dat += "<BR>\[ <A HREF='?src=\ref[src];messagelist'>Message List</A> \]"
return dat
proc/confirm_menu(var/prompt,var/yes_option)
/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")] \]"
interact()
/datum/file/program/communications/interact()
if(!interactable())
return
if(!computer.radio)
@@ -373,10 +392,11 @@
popup.open()
proc/post_status(var/command, var/data1, var/data2)
/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
if(!frequency)
return
var/datum/signal/status_signal = new
status_signal.source = src

View File

@@ -9,7 +9,7 @@
active_state = "crew"
var/list/tracked = list( )
interact(mob/user)
/datum/file/program/crew/interact(mob/user)
if(!interactable())
return
@@ -24,7 +24,6 @@
var/turf/pos = get_turf(C)
if((C) && (C.has_sensor) && (pos) && (pos.z == computer.z) && C.sensor_mode)
if(istype(C.loc, /mob/living/carbon/human))
var/mob/living/carbon/human/H = C.loc
var/dam1 = round(H.getOxyLoss(),1)
@@ -56,19 +55,21 @@
popup.open()
proc/scan()
for(var/obj/item/clothing/under/C in world)
/datum/file/program/crew/proc/scan()
for(var/obj/item/clothing/under/C in all_clothing)
if((C.has_sensor) && (istype(C.loc, /mob/living/carbon/human)))
tracked |= C
return 1
Topic(href, list/href_list)
/datum/file/program/crew/Topic(href, list/href_list)
if(!interactable() || !computer.cardslot || ..(href,href_list))
return
if( href_list["close"] )
usr << browse(null, "window=crewcomp")
usr.unset_machine()
return
if(href_list["update"])
interact()
//src.updateUsrDialog()

View File

@@ -9,7 +9,7 @@
var/opened = 0
verb/AccessInternals()
/obj/machinery/computer3/aiupload/verb/AccessInternals()
set category = "Object"
set name = "Access Computer's Internals"
set src in oview(1)
@@ -18,36 +18,36 @@
opened = !opened
if(opened)
usr << "<span class='notice'>The access panel is now open.</span>"
to_chat(usr, "<span class='notice'>The access panel is now open.</span>")
else
usr << "<span class='notice'>The access panel is now closed.</span>"
to_chat(usr, "<span class='notice'>The access panel is now closed.</span>")
return
attackby(obj/item/weapon/aiModule/module as obj, mob/user as mob)
/obj/machinery/computer3/aiupload/attackby(obj/item/weapon/aiModule/module as obj, mob/user as mob)
if (user.z > 6)
user << "<span class='danger'>Unable to establish a connection:</span> You're too far away from the station!"
to_chat(user, "<span class='danger'>Unable to establish a connection:</span> You're too far away from the station!")
return
if(istype(module, /obj/item/weapon/aiModule))
module.install(src)
module.install(src, user)
else
return ..()
attack_hand(var/mob/user as mob)
/obj/machinery/computer3/aiupload/attack_hand(var/mob/user as mob)
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!"
to_chat(user, "The upload computer is broken!")
return
src.current = select_active_ai(user)
if (!src.current)
usr << "No active AIs detected."
to_chat(user, "No active AIs detected.")
else
usr << "[src.current.name] selected for law changes."
to_chat(user, "[src.current.name] selected for law changes.")
return
@@ -60,25 +60,25 @@
var/mob/living/silicon/robot/current = null
attackby(obj/item/weapon/aiModule/module as obj, mob/user as mob)
/obj/machinery/computer3/borgupload/attackby(obj/item/weapon/aiModule/module as obj, mob/user as mob)
if(istype(module, /obj/item/weapon/aiModule))
module.install(src)
module.install(src, user)
else
return ..()
attack_hand(var/mob/user as mob)
/obj/machinery/computer3/borgupload/attack_hand(var/mob/user as mob)
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!"
to_chat(user, "The upload computer is broken!")
return
src.current = freeborg()
if (!src.current)
usr << "No free cyborgs detected."
to_chat(user, "No free cyborgs detected.")
else
usr << "[src.current.name] selected for law changes."
to_chat(user, "[src.current.name] selected for law changes.")
return

View File

@@ -34,14 +34,12 @@
var/printing = null
proc/authenticate()
if(access_medical in scan.access)
return 1
if(istype(usr,/mob/living/silicon/ai))
/datum/file/program/med_data/proc/authenticate()
if(isAI(usr) || access_medical in scan.access)
return 1
return 0
interact()
/datum/file/program/med_data/interact()
if(!computer.cardslot)
computer.Crash(MISSING_PERIPHERAL)
return
@@ -50,7 +48,7 @@
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!"
to_chat(usr, "<span class='danger'>Unable to establish a connection:</span> You're too far away from the station!")
return
var/dat
@@ -58,7 +56,7 @@
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)
if (istype(computer.cardslot, /obj/item/part/computer/cardslot/dual))
dat += text("Check Identity (W): <A href='?src=\ref[];cardw=1'>[]</A><BR>", src, (scan2 ? text("[]", scan2.name) : "----------"))
if(scan2 && !scan)
dat += text("<div class='notice'>Insert card into reader slot to log in.</div><br>")
@@ -128,7 +126,7 @@
dat += "<a href='?src=\ref[src];screen=1'>Back</a>"
dat += "<br><b>Medical Robots:</b>"
var/bdat = null
for(var/mob/living/bot/medbot/M in world)
for(var/mob/living/bot/medbot/M in mob_list)
if(M.z != computer.z) continue //only find medibots on the same z-level as the computer
var/turf/bl = get_turf(M)
@@ -144,7 +142,6 @@
dat += "<br>[bdat]"
else
else
dat += text("<A href='?src=\ref[];login=1'>{Log In}</A>", src)
popup.width = 600
popup.height = 400
@@ -153,12 +150,12 @@
popup.open()
return
Topic(href, href_list)
/datum/file/program/med_data/Topic(href, href_list)
if(!interactable() || !computer.cardslot || ..(href,href_list))
return
if (!( data_core.general.Find(src.active1) ))
if(!data_core.general.Find(src.active1))
src.active1 = null
if (!( data_core.medical.Find(src.active2) ))
if(!data_core.medical.Find(src.active2))
src.active2 = null
if(href_list["temp"])
@@ -167,27 +164,27 @@
if(href_list["cardr"])
if(scan)
if(istype(usr,/mob/living/carbon/human) && !usr.get_active_hand())
computer.cardslot.remove(1)
computer.cardslot.remove(usr, 1)
else
scan.loc = get_turf(src)
scan = null
else
var/obj/item/I = usr.get_active_hand()
if (istype(I, /obj/item/weapon/card/id) && usr.drop_item(I))
computer.cardslot.insert(I, 1)
if(istype(I, /obj/item/weapon/card/id))
computer.cardslot.insert(I, usr)
scan = I
if(href_list["cardw"])
if(scan2)
if(istype(usr,/mob/living/carbon/human) && !usr.get_active_hand())
computer.cardslot.remove(2)
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) && usr.drop_item(I))
computer.cardslot.insert(I, 2)
if(istype(I, /obj/item/weapon/card/id))
computer.cardslot.insert(I, usr, 2)
scan2 = I
else if(href_list["logout"])
@@ -198,14 +195,14 @@
else if(href_list["login"])
if (istype(usr, /mob/living/silicon/ai))
if(isAI(usr))
src.active1 = null
src.active2 = null
src.authenticated = usr.name
src.rank = "AI"
src.screen = 1
else if (istype(usr, /mob/living/silicon/robot))
else if(isrobot(usr))
src.active1 = null
src.active2 = null
src.authenticated = usr.name
@@ -257,7 +254,7 @@
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))
if(!t1 || !src.authenticated || usr.stat || usr.restrained() || (!interactable() && !issilicon(usr)) || src.active1 != a1)
return
src.active1.fields["fingerprint"] = t1
if("sex")
@@ -269,61 +266,61 @@
if("age")
if(istype(src.active1, /datum/data/record))
var/t1 = input("Please input age:", "Med. records", src.active1.fields["age"], null) as num
if ((!( t1 ) || !( src.authenticated ) || usr.stat || usr.restrained() || (!interactable() && (!istype(usr, /mob/living/silicon))) || src.active1 != a1))
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() && (!istype(usr, /mob/living/silicon))) || src.active2 != a2))
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() && (!istype(usr, /mob/living/silicon))) || src.active2 != a2))
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() && (!istype(usr, /mob/living/silicon))) || src.active2 != a2))
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() && (!istype(usr, /mob/living/silicon))) || src.active2 != a2))
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() && (!istype(usr, /mob/living/silicon))) || src.active2 != a2))
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() && (!istype(usr, /mob/living/silicon))) || src.active2 != a2))
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() && (!istype(usr, /mob/living/silicon))) || src.active2 != a2))
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() && (!istype(usr, /mob/living/silicon))) || src.active2 != a2))
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() && (!istype(usr, /mob/living/silicon))) || src.active2 != a2))
if(!t1 || !src.authenticated || usr.stat || usr.restrained() || (!interactable() && !issilicon(usr)) || src.active2 != a2)
return
src.active2.fields["notes"] = t1
if("p_stat")
@@ -338,24 +335,23 @@
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))
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() && (!istype(usr, /mob/living/silicon))) || src.active1 != a1))
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() && (!istype(usr, /mob/living/silicon))) || src.active1 != a1))
if(!t1 || !src.authenticated || usr.stat || usr.restrained() || (!interactable() && !issilicon(usr)) || src.active1 != a1)
return
v.fields["description"] = t1
else
if(href_list["p_stat"])
if(src.active1)
@@ -385,7 +381,6 @@
if("stable")
src.active1.fields["m_stat"] = "Stable"
if(href_list["b_type"])
if(src.active2)
switch(href_list["b_type"])
@@ -406,7 +401,6 @@
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)
@@ -419,11 +413,11 @@
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) ))
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"]))
if(E.fields["name"] == R.fields["name"] || E.fields["id"] == R.fields["id"])
M = E
else
//Foreach continue //goto(2540)
@@ -432,7 +426,7 @@
src.screen = 4
if(href_list["new"])
if ((istype(src.active1, /datum/data/record) && !( istype(src.active2, /datum/data/record) )))
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"]
@@ -453,11 +447,11 @@
src.screen = 4
if(href_list["add_c"])
if (!( istype(src.active2, /datum/data/record) ))
if(!istype(src.active2, /datum/data/record))
return
var/a2 = src.active2
var/t1 = sanitize(input("Add Comment:", "Med. records", null, null) as message)
if ((!( t1 ) || !( src.authenticated ) || usr.stat || usr.restrained() || (!interactable() && (!istype(usr, /mob/living/silicon))) || src.active2 != a2))
if(!t1 || !src.authenticated || usr.stat || usr.restrained() || (!interactable() && !issilicon(usr)) || src.active2 != a2)
return
var/counter = 1
while(src.active2.fields[text("com_[]", counter)])
@@ -465,33 +459,29 @@
src.active2.fields[text("com_[counter]")] = text("Made by [authenticated] ([rank]) on [time2text(world.realtime, "DDD MMM DD")] [stationtime2text()], [game_year]<BR>[t1]")
if(href_list["del_c"])
if ((istype(src.active2, /datum/data/record) && src.active2.fields[text("com_[]", href_list["del_c"])]))
if(istype(src.active2, /datum/data/record) && src.active2.fields[text("com_[]", href_list["del_c"])])
src.active2.fields[text("com_[]", href_list["del_c"])] = "<B>Deleted</B>"
if(href_list["search"])
var/t1 = input("Search String: (Name, DNA, or ID)", "Med. records", null, null) as text
if ((!( t1 ) || usr.stat || !( src.authenticated ) || usr.restrained() || ((!interactable()) && (!istype(usr, /mob/living/silicon)))))
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"])))
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 ))
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"]))
if(E.fields["name"] == src.active2.fields["name"] || E.fields["id"] == src.active2.fields["id"])
src.active1 = E
else
//Foreach continue //goto(3334)
src.screen = 4
if(href_list["print_p"])
if (!( src.printing ))
if(!src.printing)
src.printing = 1
var/datum/data/record/record1 = null
var/datum/data/record/record2 = null
@@ -518,6 +508,5 @@
P.info += "<B>Medical Record Lost!</B><BR>"
P.info += "</TT>"
src.printing = null
interact()
return

View File

@@ -8,13 +8,13 @@
desc = "It monitors APC status."
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/chg = list("N","C","F")
return "[copytext(add_tspace("\The [A.area]", 30), 1, 30)] [S[A.equipment+1]] [S[A.lighting+1]] [S[A.environ+1]] \
[add_lspace(A.lastused_total, 6)] [A.cell ? "[add_lspace(round(A.cell.percent()), 3)]% [chg[A.charging+1]]" : " N/C"]<BR>"
interact()
/datum/file/program/powermon/interact()
if(!interactable())
return
if(!computer.net)
@@ -42,7 +42,7 @@
popup.set_content(t)
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))
return
interact()

View File

@@ -17,7 +17,7 @@
var/screen = 0 // 0 - No Access Denied, 1 - Access allowed
interact()
/datum/file/program/prisoner/interact()
if(!interactable())
return
var/dat
@@ -27,20 +27,24 @@
else if(screen == 1)
dat += "<HR>Chemical Implants<BR>"
var/turf/Tr = null
for(var/obj/item/weapon/implant/chem/C in world)
for(var/obj/item/weapon/implant/chem/C in all_chem_implants)
Tr = get_turf(C)
if((Tr) && (Tr.z != computer.z)) continue//Out of range
if(!C.implanted) continue
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)
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
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))
@@ -60,14 +64,12 @@
popup.open()
return
process()
/datum/file/program/prisoner/process()
if(!..())
interact()
return
Topic(href, href_list)
/datum/file/program/prisoner/Topic(href, href_list)
if(!interactable() || ..(href,href_list))
return
@@ -96,7 +98,7 @@
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>"
to_chat(R, "<span class='notice'>You hear a voice in your head saying: '[warning]'</span>")
interact()
return

View File

@@ -15,7 +15,7 @@
var/screen = 0 // 0 - Main Menu, 1 - Cyborg Status, 2 - Kill 'em All! -- In text
req_access = list(access_robotics)
proc/start_sequence()
/datum/file/program/borg_control/proc/start_sequence()
do
if(src.stop)
src.stop = 0
@@ -30,7 +30,7 @@
return
interact()
/datum/file/program/borg_control/interact()
if(!interactable() || computer.z > 6)
return
var/dat
@@ -96,12 +96,11 @@
\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)
/datum/file/program/borg_control/Topic(var/href, var/list/href_list)
if(!interactable() || ..(href,href_list))
return
@@ -125,7 +124,7 @@
src.temp = null
else
usr << "<span class='warning'>Access Denied.</span>"
to_chat(usr, "<span class='warning'>Access Denied.</span>")
if("stop" in href_list)
src.temp = {"
@@ -159,17 +158,17 @@
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."
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)
R.connected_ai << "<br><br><span class='alert'>ALERT - Cyborg kill-switch activated: [R.name]</span><br>"
to_chat(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>"
to_chat(usr, "<span class='warning'>Access Denied.</span>")
if("stopbot" in href_list)
if(computer.allowed(usr))
@@ -183,13 +182,13 @@
R.canmove = !R.canmove
if(R.lockcharge)
R.lockcharge = !R.lockcharge
R << "Your lockdown has been lifted!"
to_chat(R, "Your lockdown has been lifted!")
else
R.lockcharge = !R.lockcharge
R << "You have been locked down!"
to_chat(R, "You have been locked down!")
else
usr << "<span class='warning'>Access Denied.</span>"
to_chat(usr, "<span class='warning'>Access Denied.</span>")
if ("magbot" in href_list)
if(computer.allowed(usr))

View File

@@ -33,32 +33,33 @@
var/tempname = null
//Sorting Variables
var/sortBy = "name"
var/order = 1 // -1 = Descending - 1 = Ascending
var/order = 1 // -1 = Descending // 1 = Ascending
proc/authenticate()
/datum/file/program/secure_data/proc/authenticate()
if(access_security in scan.access || access_forensics_lockers in scan.access )
return 1
if(istype(usr,/mob/living/silicon/ai))
if(isAI(usr))
return 1
return 0
interact()
/datum/file/program/secure_data/interact()
if(!computer.cardslot)
computer.Crash(MISSING_PERIPHERAL)
return
usr.set_machine(src)
scan = computer.cardslot.reader
if (computer.cardslot.dualslot)
scan2 = computer.cardslot.writer
if(istype(computer.cardslot, /obj/item/part/computer/cardslot/dual))
var/obj/item/part/computer/cardslot/dual/D = computer.cardslot
scan2 = D.writer
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!"
to_chat(usr, "<span class='danger'>Unable to establish a connection:</span> You're too far away from the station!")
return
var/dat
@@ -66,15 +67,14 @@
dat = text("<TT>[]</TT><BR><BR><A href='?src=\ref[];choice=Clear Screen'>Clear Screen</A>", temp, src)
else
dat = text("Confirm Identity (R): <A href='?src=\ref[];choice=Confirm Identity R'>[]</A><HR>", src, (scan ? text("[]", scan.name) : "----------"))
if (computer.cardslot.dualslot)
dat += text("Check Identity (W): <A href='?src=\ref[];choice=Confirm Identity W'>[]</A><BR>", src, (scan2 ? text("[]", scan2.name) : "----------"))
if(istype(computer.cardslot, /obj/item/part/computer/cardslot/dual))
dat += text("Confirm Identity (W): <A href='?src=\ref[];choice=Confirm Identity W'>[]</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(authenticated)
switch(screen)
if(1.0)
dat += {"
<p style='text-align:center;'>"}
dat += "<p style='text-align:center;'>"
dat += text("<A href='?src=\ref[];choice=Search Records'>Search Records</A><BR>", src)
dat += text("<A href='?src=\ref[];choice=New Record (General)'>New Record</A><BR>", src)
dat += {"
@@ -96,7 +96,7 @@
for(var/datum/data/record/R in sortRecord(data_core.general, sortBy, order))
var/crimstat = ""
for(var/datum/data/record/E in data_core.security)
if ((E.fields["name"] == R.fields["name"] && E.fields["id"] == R.fields["id"]))
if(E.fields["name"] == R.fields["name"] && E.fields["id"] == R.fields["id"])
crimstat = E.fields["criminal"]
var/background
switch(crimstat)
@@ -126,7 +126,7 @@
dat += "<BR><A href='?src=\ref[src];choice=Delete All Records'>Delete All Records</A><BR><BR><A href='?src=\ref[src];choice=Return'>Back</A>"
if(3.0)
dat += "<CENTER><B>Security Record</B></CENTER><BR>"
if ((istype(active1, /datum/data/record) && data_core.general.Find(active1)))
if(istype(active1, /datum/data/record) && data_core.general.Find(active1))
var/icon/front = active1.fields["photo_front"]
var/icon/side = active1.fields["photo_side"]
usr << browse_rsc(front, "front.png")
@@ -145,7 +145,7 @@
<img src=side.png height=80 width=80 border=4></td></tr></table>")
else
dat += "<B>General Record Lost!</B><BR>"
if ((istype(active2, /datum/data/record) && data_core.security.Find(active2)))
if(istype(active2, /datum/data/record) && data_core.security.Find(active2))
dat += text("<BR>\n<CENTER><B>Security Data</B></CENTER><BR>\nCriminal Status: <A href='?src=\ref[];choice=Edit Field;field=criminal'>[]</A><BR>\n<BR>\nMinor Crimes: <A href='?src=\ref[];choice=Edit Field;field=mi_crim'>[]</A><BR>\nDetails: <A href='?src=\ref[];choice=Edit Field;field=mi_crim_d'>[]</A><BR>\n<BR>\nMajor Crimes: <A href='?src=\ref[];choice=Edit Field;field=ma_crim'>[]</A><BR>\nDetails: <A href='?src=\ref[];choice=Edit Field;field=ma_crim_d'>[]</A><BR>\n<BR>\nImportant Notes:<BR>\n\t<A href='?src=\ref[];choice=Edit Field;field=notes'>[]</A><BR>\n<BR>\n<CENTER><B>Comments/Log</B></CENTER><BR>", src, active2.fields["criminal"], src, active2.fields["mi_crim"], src, active2.fields["mi_crim_d"], src, active2.fields["ma_crim"], src, active2.fields["ma_crim_d"], src, decode(active2.fields["notes"]))
var/counter = 1
while(active2.fields[text("com_[]", counter)])
@@ -217,12 +217,12 @@
/*Revised /N
I can't be bothered to look more of the actual code outside of switch but that probably needs revising too.
What a mess.*/
Topic(href, href_list)
/datum/file/program/secure_data/Topic(href, href_list)
if(!interactable() || !computer.cardslot || ..(href,href_list))
return
if (!( data_core.general.Find(active1) ))
if (!data_core.general.Find(active1))
active1 = null
if (!( data_core.security.Find(active2) ))
if(!data_core.security.Find(active2))
active2 = null
switch(href_list["choice"])
// SORTING!
@@ -248,28 +248,29 @@ What a mess.*/
if("Confirm Identity R")
if(scan)
if(istype(usr,/mob/living/carbon/human) && !usr.get_active_hand())
computer.cardslot.remove(1)
if(ishuman(usr) && !usr.get_active_hand())
computer.cardslot.remove(usr, 1)
else
scan.loc = get_turf(src)
scan = null
else
var/obj/item/I = usr.get_active_hand()
if (istype(I, /obj/item/weapon/card/id) && usr.drop_item(I))
computer.cardslot.insert(I, 1)
if(istype(I, /obj/item/weapon/card/id))
usr << "Attempting to insert"
computer.cardslot.insert(I, usr) // No slot, will autofill
scan = I
if("Confirm Identity W")
if(scan2)
if(istype(usr,/mob/living/carbon/human) && !usr.get_active_hand())
computer.cardslot.remove(2)
if(ishuman(usr) && !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) && usr.drop_item(I))
computer.cardslot.insert(I, 2)
if(istype(I, /obj/item/weapon/card/id))
computer.cardslot.insert(I, usr, 2) // Specifically writer slot
scan2 = I
if("Log Out")
@@ -279,13 +280,13 @@ What a mess.*/
active2 = null
if("Log In")
if (istype(usr, /mob/living/silicon/ai))
if(isAI(usr))
src.active1 = null
src.active2 = null
src.authenticated = usr.name
src.rank = "AI"
src.screen = 1
else if (istype(usr, /mob/living/silicon/robot))
else if(isrobot(usr))
src.active1 = null
src.active2 = null
src.authenticated = usr.name
@@ -302,7 +303,7 @@ What a mess.*/
//RECORD FUNCTIONS
if("Search Records")
var/t1 = input("Search String: (Partial Name or ID or Fingerprints or Rank)", "Secure. records", null, null) as text
if ((!( t1 ) || usr.stat || !( authenticated ) || usr.restrained() || !interactable()))
if(!t1 || usr.stat || !authenticated || usr.restrained() || !interactable())
return
Perp = new/list()
t1 = lowertext(t1)
@@ -319,7 +320,7 @@ What a mess.*/
for(var/i = 1, i<=Perp.len, i+=2)
for(var/datum/data/record/E in data_core.security)
var/datum/data/record/R = Perp[i]
if ((E.fields["name"] == R.fields["name"] && E.fields["id"] == R.fields["id"]))
if(E.fields["name"] == R.fields["name"] && E.fields["id"] == R.fields["id"])
Perp[i+1] = E
tempname = t1
screen = 4
@@ -332,11 +333,11 @@ What a mess.*/
if("Browse Record")
var/datum/data/record/R = locate(href_list["d_rec"])
var/S = locate(href_list["d_rec"])
if (!( data_core.general.Find(R) ))
if(!data_core.general.Find(R))
temp = "Record Not Found!"
else
for(var/datum/data/record/E in data_core.security)
if ((E.fields["name"] == R.fields["name"] || E.fields["id"] == R.fields["id"]))
if(E.fields["name"] == R.fields["name"] || E.fields["id"] == R.fields["id"])
S = E
active1 = R
active2 = S
@@ -361,13 +362,13 @@ What a mess.*/
screen = 3 */
if("Print Record")
if (!( printing ))
if(!printing)
printing = 1
var/datum/data/record/record1 = null
var/datum/data/record/record2 = null
if ((istype(active1, /datum/data/record) && data_core.general.Find(active1)))
if(istype(active1, /datum/data/record) && data_core.general.Find(active1))
record1 = active1
if ((istype(active2, /datum/data/record) && data_core.security.Find(active2)))
if(istype(active2, /datum/data/record) && data_core.security.Find(active2))
record2 = active2
sleep(50)
var/obj/item/weapon/paper/P = new /obj/item/weapon/paper( computer.loc )
@@ -402,11 +403,11 @@ What a mess.*/
temp = "All Security records deleted."
if("Add Entry")
if (!( istype(active2, /datum/data/record) ))
if(!istype(active2, /datum/data/record))
return
var/a2 = active2
var/t1 = sanitize(input("Add Comment:", "Secure. records", null, null) as message)
if ((!( t1 ) || !( authenticated ) || usr.stat || usr.restrained() || (!interactable() && (!istype(usr, /mob/living/silicon))) || active2 != a2))
if(!t1 || !authenticated || usr.stat || usr.restrained() || (!interactable() && !issilicon(usr)) || active2 != a2)
return
var/counter = 1
while(active2.fields[text("com_[]", counter)])
@@ -426,11 +427,11 @@ What a mess.*/
temp += "<a href='?src=\ref[src];choice=Clear Screen'>No</a>"
if("Delete Entry")
if ((istype(active2, /datum/data/record) && active2.fields[text("com_[]", href_list["del_c"])]))
if(istype(active2, /datum/data/record) && active2.fields[text("com_[]", href_list["del_c"])])
active2.fields[text("com_[]", href_list["del_c"])] = "<B>Deleted</B>"
//RECORD CREATE
if("New Record (Security)")
if ((istype(active1, /datum/data/record) && !( istype(active2, /datum/data/record) )))
if(istype(active1, /datum/data/record) && !istype(active2, /datum/data/record))
active2 = data_core.CreateSecurityRecord(active1.fields["name"], active1.fields["id"])
screen = 3
@@ -446,19 +447,19 @@ What a mess.*/
if("name")
if(istype(active1, /datum/data/record))
var/t1 = sanitizeName(input("Please input name:", "Secure. records", active1.fields["name"], null) as text)
if ((!( t1 ) || !length(trim(t1)) || !( authenticated ) || usr.stat || usr.restrained() || (!interactable() && (!istype(usr, /mob/living/silicon)))) || active1 != a1)
if(!t1 || !length(trim(t1)) || !authenticated || usr.stat || usr.restrained() || (!interactable() && !issilicon(usr)) || active1 != a1)
return
active1.fields["name"] = t1
if("id")
if(istype(active2, /datum/data/record))
var/t1 = sanitize(input("Please input id:", "Secure. records", active1.fields["id"], null) as text)
if ((!( t1 ) || !( authenticated ) || usr.stat || usr.restrained() || (!interactable() && (!istype(usr, /mob/living/silicon))) || active1 != a1))
if(!t1 || !authenticated || usr.stat || usr.restrained() || (!interactable() && !issilicon(usr)) || active1 != a1)
return
active1.fields["id"] = t1
if("fingerprint")
if(istype(active1, /datum/data/record))
var/t1 = sanitize(input("Please input fingerprint hash:", "Secure. records", active1.fields["fingerprint"], null) as text)
if ((!( t1 ) || !( authenticated ) || usr.stat || usr.restrained() || (!interactable() && (!istype(usr, /mob/living/silicon))) || active1 != a1))
if(!t1 || !authenticated || usr.stat || usr.restrained() || (!interactable() && !issilicon(usr)) || active1 != a1)
return
active1.fields["fingerprint"] = t1
if("sex")
@@ -470,37 +471,37 @@ What a mess.*/
if("age")
if(istype(active1, /datum/data/record))
var/t1 = input("Please input age:", "Secure. records", active1.fields["age"], null) as num
if ((!( t1 ) || !( authenticated ) || usr.stat || usr.restrained() || (!interactable() && (!istype(usr, /mob/living/silicon))) || active1 != a1))
if(!t1 || !authenticated || usr.stat || usr.restrained() || (!interactable() && !issilicon(usr)) || active1 != a1)
return
active1.fields["age"] = t1
if("mi_crim")
if(istype(active2, /datum/data/record))
var/t1 = sanitize(input("Please input minor disabilities list:", "Secure. records", active2.fields["mi_crim"], null) as text)
if ((!( t1 ) || !( authenticated ) || usr.stat || usr.restrained() || (!interactable() && (!istype(usr, /mob/living/silicon))) || active2 != a2))
if(!t1 || !authenticated || usr.stat || usr.restrained() || (!interactable() && !issilicon(usr)) || active2 != a2)
return
active2.fields["mi_crim"] = t1
if("mi_crim_d")
if(istype(active2, /datum/data/record))
var/t1 = sanitize(input("Please summarize minor dis.:", "Secure. records", active2.fields["mi_crim_d"], null) as message)
if ((!( t1 ) || !( authenticated ) || usr.stat || usr.restrained() || (!interactable() && (!istype(usr, /mob/living/silicon))) || active2 != a2))
if (!t1 || !authenticated || usr.stat || usr.restrained() || (!interactable() && !issilicon(usr)) || active2 != a2)
return
active2.fields["mi_crim_d"] = t1
if("ma_crim")
if(istype(active2, /datum/data/record))
var/t1 = sanitize(input("Please input major diabilities list:", "Secure. records", active2.fields["ma_crim"], null) as text)
if ((!( t1 ) || !( authenticated ) || usr.stat || usr.restrained() || (!interactable() && (!istype(usr, /mob/living/silicon))) || active2 != a2))
if(!t1 || !authenticated || usr.stat || usr.restrained() || (!interactable() && !issilicon(usr)) || active2 != a2)
return
active2.fields["ma_crim"] = t1
if("ma_crim_d")
if(istype(active2, /datum/data/record))
var/t1 = sanitize(input("Please summarize major dis.:", "Secure. records", active2.fields["ma_crim_d"], null) as message)
if ((!( t1 ) || !( authenticated ) || usr.stat || usr.restrained() || (!interactable() && (!istype(usr, /mob/living/silicon))) || active2 != a2))
if(!t1 || !authenticated || usr.stat || usr.restrained() || (!interactable() && !issilicon(usr)) || active2 != a2)
return
active2.fields["ma_crim_d"] = t1
if("notes")
if(istype(active2, /datum/data/record))
var/t1 = sanitize(input("Please summarize notes:", "Secure. records", html_decode(active2.fields["notes"]), null) as message, extra = 0)
if ((!( t1 ) || !( authenticated ) || usr.stat || usr.restrained() || (!interactable() && (!istype(usr, /mob/living/silicon))) || active2 != a2))
if(!t1 || !authenticated || usr.stat || usr.restrained() || (!interactable() && !issilicon(usr)) || active2 != a2)
return
active2.fields["notes"] = t1
if("criminal")
@@ -527,7 +528,7 @@ What a mess.*/
if("species")
if (istype(active1, /datum/data/record))
var/t1 = sanitize(input("Please enter race:", "General records", active1.fields["species"], null) as message)
if ((!( t1 ) || !( authenticated ) || usr.stat || usr.restrained() || (!interactable() && (!istype(usr, /mob/living/silicon))) || active1 != a1))
if(!t1 || !authenticated || usr.stat || usr.restrained() || (!interactable() && !issilicon(usr)) || active1 != a1)
return
active1.fields["species"] = t1
@@ -564,7 +565,7 @@ What a mess.*/
if("Delete Record (ALL) Execute")
if(active1)
for(var/datum/data/record/R in data_core.medical)
if ((R.fields["name"] == active1.fields["name"] || R.fields["id"] == active1.fields["id"]))
if(R.fields["name"] == active1.fields["name"] || R.fields["id"] == active1.fields["id"])
qdel(R)
else
qdel(active1)

View File

@@ -9,7 +9,7 @@
image = 'icons/ntos/program.png'
interact()
/datum/file/program/welcome/interact()
usr.set_machine(src)
if(!interactable())
return
@@ -27,7 +27,7 @@
popup.open()
return
Topic(href, href_list)
/datum/file/program/welcome/Topic(href, href_list)
if(!interactable() || ..(href,href_list))
return
interact()

View File

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

View File

@@ -28,28 +28,28 @@
var/obj/machinery/computer3/laptop/stored_computer = null
verb/open_computer()
/obj/item/device/laptop/verb/open_computer()
set name = "Open Laptop"
set category = "Object"
set src in view(1)
if(usr.stat || usr.restrained() || usr.lying || !istype(usr, /mob/living))
usr << "<span class='warning'>You can't do that.</span>"
to_chat(usr, "<span class='warning'>You can't do that.</span>")
return
if(!Adjacent(usr))
usr << "You can't reach it."
to_chat(usr, "You can't reach it.")
return
if(!istype(loc,/turf))
usr << "[src] is too bulky! You'll have to set it down."
to_chat(usr, "[src] is too bulky! You'll have to set it down.")
return
if(!stored_computer)
if(contents.len)
for(var/obj/O in contents)
O.loc = loc
usr << "\The [src] crumbles to pieces."
to_chat(usr, "\The [src] crumbles to pieces.")
spawn(5)
qdel(src)
return
@@ -58,10 +58,9 @@
stored_computer.stat &= ~MAINT
stored_computer.update_icon()
loc = stored_computer
usr << "You open \the [src]."
to_chat(usr, "You open \the [src].")
AltClick()
/obj/item/device/laptop/AltClick()
if(Adjacent(usr))
open_computer()
@@ -73,6 +72,7 @@
if(stored_computer)
stored_computer.eject_id()
/obj/machinery/computer3/laptop/verb/eject_id()
set category = "Object"
set name = "Eject ID Card"
@@ -80,22 +80,12 @@
var/obj/item/part/computer/cardslot/C = locate() in src.contents
if(!C)
usr << "There is no card port on the laptop."
to_chat(usr, "There is no card port on the laptop.")
return
var/obj/item/weapon/card/id/card
if(C.reader)
card = C.reader
else if(C.writer)
card = C.writer
else
usr << "There is nothing to remove from the laptop card port."
C.remove(usr)
return
usr << "You remove [card] from the laptop."
C.remove(4)
/obj/machinery/computer3/laptop
name = "Laptop Computer"
desc = "A clamshell portable computer. It is open."
@@ -110,29 +100,29 @@
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)
battery = new /obj/item/weapon/cell(src)
battery.maxcharge = 500
battery.charge = 500
..(L,built)
verb/close_computer()
/obj/machinery/computer3/laptop/verb/close_computer()
set name = "Close Laptop"
set category = "Object"
set src in view(1)
if(usr.stat || usr.restrained() || usr.lying || !istype(usr, /mob/living))
usr << "<span class='warning'>You can't do that.</span>"
to_chat(usr, "<span class='warning'>You can't do that.</span>")
return
if(!Adjacent(usr))
usr << "<span class='warning'>You can't reach it.</span>"
to_chat(usr, "<span class='warning'>You can't reach it.</span>")
return
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))
testing("Close closed computer")
return
@@ -142,7 +132,7 @@
if(stat&BROKEN)
if(user)
user << "\The [src] is broken! You can't quite get it closed."
to_chat(user, "\The [src] is broken! You can't quite get it closed.")
return
if(!portable)
@@ -153,9 +143,9 @@
loc = portable
stat |= MAINT
if(user)
user << "You close \the [src]."
to_chat(user, "You close \the [src].")
auto_use_power()
/obj/machinery/computer3/laptop/auto_use_power()
if(stat&MAINT)
return
if(use_power && istype(battery) && battery.charge > 0)
@@ -166,17 +156,17 @@
return 1
return 0
use_power(var/amount, var/chan = -1)
/obj/machinery/computer3/laptop/use_power(var/amount, var/chan = -1)
if(battery && battery.charge > 0)
battery.use(amount*CELLRATE)
power_change()
/obj/machinery/computer3/laptop/power_change()
if( !battery || battery.charge <= 0 )
stat |= NOPOWER
else
stat &= ~NOPOWER
Destroy()
/obj/machinery/computer3/laptop/Destroy()
if(istype(loc,/obj/item/device/laptop))
var/obj/O = loc
spawn(5)
@@ -185,6 +175,6 @@
..()
AltClick()
/obj/machinery/computer3/laptop/AltClick()
if(Adjacent(usr))
close_computer()

View File

@@ -47,7 +47,7 @@
usr.drop_item()
L.loc = src
vendmode = 2
usr << "<span class='notice'>You slot your [L.name] into \The [src.name]</span>"
to_chat(user, "<span class='notice'>You slot your [L.name] into \The [src.name]</span>")
nanomanager.update_uis(src)
else
..()
@@ -169,7 +169,7 @@
visible_message("<span class='info'>\The [usr] swipes \the [I] through \the [src].</span>")
var/datum/money_account/CH = get_account(C.associated_account_number)
if(!CH)
usr << "\icon[src]<span class='warning'>No valid account number is associated with this card.</span>"
to_chat(usr, "\icon[src]<span class='warning'>No valid account number is associated with this card.</span>")
return
if(CH.security_level != 0) //If card requires pin authentication (ie seclevel 1 or 2)
if(vendor_account)
@@ -178,9 +178,9 @@
if(D)
transfer_and_vend(D, C)
else
usr << "\icon[src]<span class='warning'>Unable to access vendor account. Please record the machine ID and call [using_map.boss_short] Support.</span>"
to_chat(usr, "\icon[src]<span class='warning'>Unable to access vendor account. Please record the machine ID and call [using_map.boss_short] Support.</span>")
else
usr << "\icon[src]<span class='warning'>Unable to access vendor account. Please record the machine ID and call [using_map.boss_short] Support.</span>"
to_chat(usr, "\icon[src]<span class='warning'>Unable to access vendor account. Please record the machine ID and call [using_map.boss_short] Support.</span>")
else
transfer_and_vend(CH, C)
@@ -228,7 +228,7 @@
network = 0
power = 0
else
usr << "\icon[src]<span class='warning'>You don't have that much money!</span>"
to_chat(usr, "\icon[src]<span class='warning'>You don't have that much money!</span>")
/obj/machinery/lapvend/proc/total()
var/total = 0
@@ -317,7 +317,7 @@
visible_message("<span class='info'>\The [usr] swipes \the [I] through \the [src].</span>")
var/datum/money_account/CH = get_account(C.associated_account_number)
if(!CH)
usr << "\icon[src]<span class='warning'>No valid account number is associated with this card.</span>"
to_chat(usr, "\icon[src]<span class='warning'>No valid account number is associated with this card.</span>")
return 0
if(CH.security_level != 0) //If card requires pin authentication (ie seclevel 1 or 2)
if(vendor_account)
@@ -327,10 +327,10 @@
transfer_and_reimburse(D)
return 1
else
usr << "\icon[src]<span class='warning'>Unable to access vendor account. Please record the machine ID and call [using_map.boss_short] Support.</span>"
to_chat(usr, "\icon[src]<span class='warning'>Unable to access vendor account. Please record the machine ID and call [using_map.boss_short] Support.</span>")
return 0
else
usr << "\icon[src]<span class='warning'>Unable to access vendor account. Please record the machine ID and call [using_map.boss_short] Support.</span>"
to_chat(usr, "\icon[src]<span class='warning'>Unable to access vendor account. Please record the machine ID and call [using_map.boss_short] Support.</span>")
return 0
else
transfer_and_reimburse(CH)

View File

@@ -1,12 +1,14 @@
/obj/item/part/computer/networking
name = "Computer networking component"
/obj/item/part/computer/networking/allow_attackby(var/obj/item/I, var/mob/user)
return 0
/*
This is the public-facing proc used by NETUP.
It does additional checking before and after calling get_machines()
*/
proc/connect_to(var/typekey,var/atom/previous)
/obj/item/part/computer/networking/proc/connect_to(var/typekey,var/atom/previous)
if(!computer || computer.stat)
return null
@@ -40,7 +42,7 @@
Overwite this on any networking component.
*/
proc/get_machines(var/typekey)
/obj/item/part/computer/networking/proc/get_machines(var/typekey)
return list()
/*
@@ -51,7 +53,7 @@
Overwrite this on any networking component.
*/
proc/verify_machine(var/obj/previous)
/obj/item/part/computer/networking/proc/verify_machine(var/obj/previous)
return 0
/*
@@ -69,12 +71,12 @@
var/range = null
var/subspace = 0
init()
/obj/item/part/computer/networking/radio/init()
..()
spawn(5)
radio_connection = radio_controller.add_object(src, src.frequency, src.rad_filter)
proc/set_frequency(new_frequency)
/obj/item/part/computer/networking/radio/proc/set_frequency(new_frequency)
if(radio_controller)
radio_controller.remove_object(src, frequency)
frequency = new_frequency
@@ -84,19 +86,20 @@
spawn(rand(5,10))
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
return
if(computer.program)
computer.program.receive_signal(signal)
proc/post_signal(var/datum/signal/signal)
if(!computer || (computer.stat&~MAINT) || !computer.program) return
if(!radio_connection) return
/obj/item/part/computer/networking/radio/proc/post_signal(var/datum/signal/signal)
if(!computer || (computer.stat&~MAINT) || !computer.program)
return
if(!radio_connection)
return
radio_connection.post_signal(src,signal,rad_filter,range)
get_machines(var/typekey)
/obj/item/part/computer/networking/radio/get_machines(var/typekey)
if(!radio_connection || !radio_connection.frequency)
return list()
var/list/result = list()
@@ -109,8 +112,9 @@
result |= O
return result
verify_machine(var/obj/previous)
if(!previous) return 0
/obj/item/part/computer/networking/radio/verify_machine(var/obj/previous)
if(!previous)
return 0
if(subspace)
return ( radio_connection && (previous in radio_connection.devices) )
else
@@ -136,7 +140,7 @@
name = "short-wave networking terminal"
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)
if(!istype(A) || A == /area)
return list()
@@ -147,7 +151,8 @@
if(istype(O,typekey))
machines |= O
return machines
verify_machine(var/obj/previous)
/obj/item/part/computer/networking/area/verify_machine(var/obj/previous)
if(!previous) return 0
var/area/A = get_area(src)
if( A && A == get_area(previous) )
@@ -161,7 +166,7 @@
name = "proximity networking terminal"
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)
if(!istype(T))
return list()
@@ -178,21 +183,21 @@
machines += O
return machines
verify_machine(var/obj/previous)
/obj/item/part/computer/networking/prox/verify_machine(var/obj/previous)
if(!previous)
return 0
if(get_dist(get_turf(previous),get_turf(loc)) == 1)
return 1
return 0
/*
Cable networking: Not currently used
*/
/obj/item/part/computer/networking/cable
name = "cable networking terminal"
desc = "Connects to other machines on the same cable network."
get_machines(var/typekey)
/obj/item/part/computer/networking/cable/get_machines(var/typekey)
// if(istype(computer,/obj/machinery/computer/laptop)) // laptops move, this could get breaky
// return list()
var/turf/T = get_turf(loc)
@@ -217,7 +222,7 @@
candidates += PT.master
return candidates
verify_machine(var/obj/previous)
/obj/item/part/computer/networking/cable/verify_machine(var/obj/previous)
if(!previous)
return 0
var/turf/T = get_turf(loc)

View File

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

View File

@@ -24,9 +24,9 @@
spawn_parts = list(/obj/item/part/computer/storage/hdd,/obj/item/part/computer/networking/radio/subspace)
update_icon()
/obj/machinery/computer3/server/rack/update_icon()
//overlays.Cut()
return
attack_hand() // Racks have no screen, only AI can use them
/obj/machinery/computer3/server/rack/attack_hand() // Racks have no screen, only AI can use them
return

View File

@@ -21,7 +21,7 @@
var/list/spawnfiles = list()// For mappers, special drives, and data disks
New()
/obj/item/part/computer/storage/New()
..()
if(islist(spawnfiles))
if(removeable && spawnfiles.len)
@@ -34,7 +34,7 @@
// Add a file to the hard drive, returns 0 if failed
// forced is used when spawning files on a write-protect drive
proc/addfile(var/datum/file/F,var/forced = 0)
/obj/item/part/computer/storage/proc/addfile(var/datum/file/F,var/forced = 0)
if(!F || (F in files))
return 1
if(writeprotect && !forced)
@@ -49,7 +49,7 @@
F.computer = computer
F.device = src
return 1
proc/removefile(var/datum/file/F,var/forced = 0)
/obj/item/part/computer/storage/proc/removefile(var/datum/file/F,var/forced = 0)
if(!F || !(F in files))
return 1
if(writeprotect && !forced)
@@ -62,7 +62,7 @@
F.computer = null
return 1
init(var/obj/machinery/computer/target)
/obj/item/part/computer/storage/init(var/obj/machinery/computer/target)
computer = target
for(var/datum/file/F in files)
F.computer = computer
@@ -70,7 +70,6 @@
/*
Standard hard drives for computers. Used in computer construction
*/
/obj/item/part/computer/storage/hdd
name = "Hard Drive"
max_volume = 25000
@@ -99,7 +98,7 @@
attackby_types = list(/obj/item/weapon/disk/file, /obj/item/weapon/pen)
var/obj/item/weapon/disk/file/inserted = null
proc/eject_disk(var/forced = 0)
/obj/item/part/computer/storage/removable/proc/eject_disk(var/forced = 0)
if(!forced)
return
files = list()
@@ -114,18 +113,18 @@
inserted = null
attackby(obj/O as obj, mob/user as mob)
/obj/item/part/computer/storage/removable/attackby(obj/O as obj, mob/user as mob)
if(inserted && istype(O,/obj/item/weapon/pen))
usr << "You use [O] to carefully pry [inserted] out of [src]."
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)
usr << "There's already a disk in [src]!"
to_chat(usr, "There's already a disk in [src]!")
return
usr << "You insert [O] into [src]."
to_chat(usr, "You insert [O] into [src].")
usr.drop_item()
O.loc = src
inserted = O
@@ -136,10 +135,9 @@
F.computer = computer
return
..()
addfile(var/datum/file/F)
/obj/item/part/computer/storage/removable/addfile(var/datum/file/F)
if(!F || !inserted)
return 0
@@ -158,7 +156,6 @@
Removable hard drive presents...
removeable disk!
*/
/obj/item/weapon/disk/file
//parent_type = /obj/item/part/computer/storage // todon't: do this
name = "Data Disk"
@@ -170,7 +167,7 @@
var/max_volume = 1028
New()
/obj/item/weapon/disk/file/New()
..()
icon_state = "datadisk[rand(0,6)]"
src.pixel_x = rand(-5, 5)

View File

@@ -422,7 +422,7 @@
preserve = 1
if(istype(W,/obj/item/weapon/implant/health))
for(var/obj/machinery/computer/cloning/com in world)
for(var/obj/machinery/computer/cloning/com in machines)
for(var/datum/dna2/record/R in com.records)
if(locate(R.implant) == W)
qdel(R)

View File

@@ -92,7 +92,7 @@
*/
/obj/machinery/button/remote/airlock/trigger()
for(var/obj/machinery/door/airlock/D in world)
for(var/obj/machinery/door/airlock/D in machines)
if(D.id_tag == id)
if(specialfunctions & OPEN)
if(D.density)
@@ -137,7 +137,7 @@
desc = "It controls blast doors, remotely."
/obj/machinery/button/remote/blast_door/trigger()
for(var/obj/machinery/door/blast/M in world)
for(var/obj/machinery/door/blast/M in machines)
if(M.id == id)
if(M.density)
spawn(0)
@@ -156,7 +156,7 @@
desc = "It controls emitters, remotely."
/obj/machinery/button/remote/emitter/trigger(mob/user as mob)
for(var/obj/machinery/power/emitter/E in world)
for(var/obj/machinery/power/emitter/E in machines)
if(E.id == id)
spawn(0)
E.activate(user)

View File

@@ -1208,7 +1208,7 @@ About the new airlock wires panel:
/obj/machinery/door/airlock/initialize()
if(src.closeOtherId != null)
for (var/obj/machinery/door/airlock/A in world)
for (var/obj/machinery/door/airlock/A in machines)
if(A.closeOtherId == src.closeOtherId && A != src)
src.closeOther = A
break

View File

@@ -47,7 +47,7 @@
if(F.id == src.id)
LAZYADD(targets,F)
for(var/obj/structure/closet/secure_closet/brig/C in world)
for(var/obj/structure/closet/secure_closet/brig/C in all_brig_closets)
if(C.id == src.id)
LAZYADD(targets,C)

View File

@@ -213,7 +213,7 @@
..()
if(autolink)
for(var/obj/machinery/magnetic_module/M in world)
for(var/obj/machinery/magnetic_module/M in machines)
if(M.freq == frequency && M.code == code)
magnets.Add(M)
@@ -229,7 +229,7 @@
/obj/machinery/magnetic_controller/process()
if(magnets.len == 0 && autolink)
for(var/obj/machinery/magnetic_module/M in world)
for(var/obj/machinery/magnetic_module/M in machines)
if(M.freq == frequency && M.code == code)
magnets.Add(M)

View File

@@ -168,7 +168,7 @@ var/list/obj/machinery/requests_console/allConsoles = list()
var/log_msg = message
var/pass = 0
screen = RCS_SENTFAIL
for (var/obj/machinery/message_server/MS in world)
for (var/obj/machinery/message_server/MS in machines)
if(!MS.active) continue
MS.send_rc_message(ckey(href_list["department"]),department,log_msg,msgStamped,msgVerified,priority)
pass = 1

View File

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

View File

@@ -95,7 +95,7 @@
var/list/L = list()
var/list/areaindex = list()
for(var/obj/item/device/radio/beacon/R in world)
for(var/obj/item/device/radio/beacon/R in all_beacons)
var/turf/T = get_turf(R)
if(!T)
continue
@@ -108,7 +108,7 @@
areaindex[tmpname] = 1
L[tmpname] = R
for (var/obj/item/weapon/implant/tracking/I in world)
for (var/obj/item/weapon/implant/tracking/I in all_tracking_implants)
if(!I.implanted || !ismob(I.loc))
continue
else

View File

@@ -51,7 +51,7 @@
else if(ispath(control_area))
control_area = locate(control_area)
else if(istext(control_area))
for(var/area/A in world)
for(var/area/A in all_areas)
if(A.name && A.name==control_area)
control_area = A
break

View File

@@ -510,6 +510,8 @@
if(R.get_product(get_turf(src)))
visible_message("<span class='notice'>\The [src] clunks as it vends an additional item.</span>")
playsound(src, 'sound/items/vending.ogg', 50, 1, 1)
status_message = ""
status_error = 0
vend_ready = 1

View File

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

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)
// to all distanced mobs play a different sound
for(var/mob/M in world)
for(var/mob/M in player_list)
if(M.z == epicenter.z)
if(!(M in close))
// check if the mob can hear

View File

@@ -1,3 +1,5 @@
GLOBAL_LIST_BOILERPLATE(all_items, /obj/item)
/obj/item
name = "item"
icon = 'icons/obj/items.dmi'
@@ -587,7 +589,7 @@ var/list/global/slot_flags_enumeration = list(
I.Blend(new /icon('icons/effects/blood.dmi', "itemblood"),ICON_MULTIPLY) //adds blood and the remaining white areas become transparant
//not sure if this is worth it. It attaches the blood_overlay to every item of the same type if they don't have one already made.
for(var/obj/item/A in world)
for(var/obj/item/A in all_items)
if(A.type == type && !A.blood_overlay)
A.blood_overlay = image(I)
@@ -685,6 +687,10 @@ modules/mob/living/carbon/human/life.dm if you die, you will be zoomed out.
/obj/item/proc/is_hot()
return FALSE
// Called when you swap hands away from the item
/obj/item/proc/in_inactive_hand(mob/user)
return
// My best guess as to why this is here would be that it does so little. Still, keep it under all the procs, for sanity's sake.
/obj/item/device
icon = 'icons/obj/device.dmi'

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
// for a list of parameters and their descriptions see the code docs in \code\modules\nano\nanoui.dm
ui = new(user, src, ui_key, "pda.tmpl", title, 520, 400, state = inventory_state)
// add templates for screens in common with communicator.
ui.add_template("atmosphericScan", "atmospheric_scan.tmpl")
// when the ui is first opened this is the data it will use
ui.set_initial_data(data)
// open the new ui window
ui.open()
@@ -893,7 +894,7 @@ var/global/list/obj/item/device/pda/PDAs = list()
if("Toggle Door")
if(cartridge && cartridge.access_remote_door)
for(var/obj/machinery/door/blast/M in world)
for(var/obj/machinery/door/blast/M in machines)
if(M.id == cartridge.remote_door_id)
if(M.density)
M.open()
@@ -1247,7 +1248,14 @@ var/global/list/obj/item/device/pda/PDAs = list()
if(issilicon(usr))
return
if(can_use(usr) && !isnull(cartridge))
if(!can_use(usr))
to_chat(usr, "<span class='notice'>You cannot do this while restrained.</span>")
return
if(isnull(cartridge))
to_chat(usr, "<span class='notice'>There's no cartridge to eject.</span>")
return
cartridge.forceMove(get_turf(src))
if(ismob(loc))
var/mob/M = loc
@@ -1258,8 +1266,6 @@ var/global/list/obj/item/device/pda/PDAs = list()
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>")
/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)

View File

@@ -468,7 +468,7 @@ var/list/civilian_cartridges = list(
else
JaniData["user_loc"] = list("x" = 0, "y" = 0)
var/MopData[0]
for(var/obj/item/weapon/mop/M in world)
for(var/obj/item/weapon/mop/M in all_mops)
var/turf/ml = get_turf(M)
if(ml)
if(ml.z != cl.z)
@@ -481,7 +481,7 @@ var/list/civilian_cartridges = list(
var/BucketData[0]
for(var/obj/structure/mopbucket/B in world)
for(var/obj/structure/mopbucket/B in all_mopbuckets)
var/turf/bl = get_turf(B)
if(bl)
if(bl.z != cl.z)
@@ -493,7 +493,7 @@ var/list/civilian_cartridges = list(
BucketData[++BucketData.len] = list("x" = 0, "y" = 0, dir=null, status = null)
var/CbotData[0]
for(var/mob/living/bot/cleanbot/B in world)
for(var/mob/living/bot/cleanbot/B in mob_list)
var/turf/bl = get_turf(B)
if(bl)
if(bl.z != cl.z)
@@ -505,7 +505,7 @@ var/list/civilian_cartridges = list(
if(!CbotData.len)
CbotData[++CbotData.len] = list("x" = 0, "y" = 0, dir=null, status = null)
var/CartData[0]
for(var/obj/structure/janitorialcart/B in world)
for(var/obj/structure/janitorialcart/B in all_janitorial_carts)
var/turf/bl = get_turf(B)
if(bl)
if(bl.z != cl.z)

View File

@@ -118,6 +118,8 @@
// the ui does not exist, so we'll create a new() one
// for a list of parameters and their descriptions see the code docs in \code\modules\nano\nanoui.dm
ui = new(user, src, ui_key, "communicator.tmpl", "Communicator", 475, 700, state = key_state)
// add templates for screens in common with communicator.
ui.add_template("atmosphericScan", "atmospheric_scan.tmpl")
// when the ui is first opened this is the data it will use
ui.set_initial_data(data)
// open the new ui window

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
name = "personal AI device"
icon = 'icons/obj/pda.dmi'

View File

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

View File

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

View File

@@ -3,19 +3,20 @@
icon_state = "flashbang"
item_state = "flashbang"
origin_tech = list(TECH_MATERIAL = 2, TECH_COMBAT = 1)
var/max_range = 10 //The maximum range possible, including species effect mods. Cuts off at 7 for normal humans. Should be 3 higher than your intended target range for affecting normal humans.
var/banglet = 0
/obj/item/weapon/grenade/flashbang/prime()
..()
for(var/obj/structure/closet/L in hear(7, get_turf(src)))
for(var/obj/structure/closet/L in hear(max_range, get_turf(src)))
if(locate(/mob/living/carbon/, L))
for(var/mob/living/carbon/M in L)
bang(get_turf(src), M)
for(var/mob/living/carbon/M in hear(7, get_turf(src)))
for(var/mob/living/carbon/M in hear(max_range, get_turf(src)))
bang(get_turf(src), M)
for(var/obj/structure/blob/B in hear(8,get_turf(src))) //Blob damage here
for(var/obj/structure/blob/B in hear(max_range - 2,get_turf(src))) //Blob damage here
var/damage = round(30/(get_dist(B,get_turf(src))+1))
if(B.overmind)
damage *= B.overmind.blob_type.burn_multiplier
@@ -39,13 +40,19 @@
ear_safety = M.get_ear_protection()
//Flashing everyone
if(eye_safety < 1)
var/mob/living/carbon/human/H = M
var/flash_effectiveness = 1
var/bang_effectiveness = 1
if(ishuman(M))
flash_effectiveness = H.species.flash_mod
bang_effectiveness = H.species.sound_mod
if(eye_safety < 1 && get_dist(M, T) <= round(max_range * 0.7 * flash_effectiveness))
M.flash_eyes()
M.Confuse(2)
M.Weaken(5)
M.Confuse(2 * flash_effectiveness)
M.Weaken(5 * flash_effectiveness)
//Now applying sound
if((get_dist(M, T) <= 2 || src.loc == M.loc || src.loc == M))
if((get_dist(M, T) <= round(max_range * 0.3 * bang_effectiveness) || src.loc == M.loc || src.loc == M))
if(ear_safety > 0)
M.Confuse(2)
M.Weaken(1)
@@ -58,20 +65,19 @@
M.ear_damage += rand(0, 5)
M.ear_deaf = max(M.ear_deaf,15)
else if(get_dist(M, T) <= 5)
else if(get_dist(M, T) <= round(max_range * 0.5 * bang_effectiveness))
if(!ear_safety)
M.Confuse(8)
M.ear_damage += rand(0, 3)
M.ear_deaf = max(M.ear_deaf,10)
else if(!ear_safety)
else if(!ear_safety && get_dist(M, T) <= (max_range * 0.7 * bang_effectiveness))
M.Confuse(4)
M.ear_damage += rand(0, 1)
M.ear_deaf = max(M.ear_deaf,5)
//This really should be in mob not every check
if(ishuman(M))
var/mob/living/carbon/human/H = M
var/obj/item/organ/internal/eyes/E = H.internal_organs_by_name[O_EYES]
if (E && E.damage >= E.min_bruised_damage)
M << "<span class='danger'>Your eyes start to burn badly!</span>"

View File

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

View File

@@ -144,9 +144,9 @@
force = 10
w_class = ITEMSIZE_LARGE
slot_flags = SLOT_BACK
force_divisor = 0.5 // 15 when wielded with hardness 15 (glass)
force_divisor = 0.5 // 15 when wielded with hardness 30 (glass)
unwielded_force_divisor = 0.375
thrown_force_divisor = 1.5 // 20 when thrown with weight 15 (glass)
thrown_force_divisor = 1.5 // 22.5 when thrown with weight 15 (glass)
throw_speed = 3
edge = 0
sharp = 1

View File

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

View File

@@ -47,6 +47,10 @@
max_storage_space = ITEMSIZE_COST_NORMAL * 14 // 56
storage_cost = INVENTORY_STANDARD_SPACE + 1
/obj/item/weapon/storage/backpack/holding/duffle
name = "dufflebag of holding"
icon_state = "holdingduffle"
/obj/item/weapon/storage/backpack/holding/attackby(obj/item/weapon/W as obj, mob/user as mob)
if(istype(W, /obj/item/weapon/storage/backpack/holding))
user << "<span class='warning'>The Bluespace interfaces of the two devices conflict and malfunction.</span>"

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."
force = 12 //Anti-rad lined i.e. Lead, probably gonna hurt a bit if you get bashed with it.
can_hold = list(/obj/item/weapon/gun/magnetic/fuelrod, /obj/item/weapon/fuel_assembly, /obj/item/weapon/cell, /obj/item/weapon/stock_parts, /obj/item/weapon/screwdriver)
cant_hold = list(/obj/item/weapon/screwdriver/power)
starts_with = list(
/obj/item/weapon/gun/magnetic/fuelrod,
/obj/item/weapon/fuel_assembly/deuterium,

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

Some files were not shown because too many files have changed in this diff Show More