diff --git a/_maps/map_files/RandomRuins/SpaceRuins/deepstorage.dmm b/_maps/map_files/RandomRuins/SpaceRuins/deepstorage.dmm index 82ed8ece1a7..c53640a6726 100644 --- a/_maps/map_files/RandomRuins/SpaceRuins/deepstorage.dmm +++ b/_maps/map_files/RandomRuins/SpaceRuins/deepstorage.dmm @@ -82,7 +82,7 @@ "bD" = (/obj/structure/table,/obj/item/weapon/reagent_containers/food/snacks/beans,/turf/simulated/floor/plasteel{tag = "icon-bar"; icon_state = "bar"},/area/ruin/unpowered) "bE" = (/obj/structure/stool/bed/chair{dir = 8},/turf/simulated/floor/plasteel{tag = "icon-bar"; icon_state = "bar"},/area/ruin/unpowered) "bF" = (/obj/machinery/seed_extractor,/turf/simulated/floor/plasteel,/area/ruin/unpowered) -"bG" = (/obj/machinery/power/apc{dir = 8; name = "Bunker APC"; keep_preset_name = 1; pixel_x = -24; pixel_y = 0},/obj/structure/cable{icon_state = "0-4"; d2 = 4},/turf/simulated/floor/plasteel,/area/ruin/unpowered) +"bG" = (/obj/machinery/power/apc/noalarm{dir = 8; name = "Bunker APC"; keep_preset_name = 1; pixel_x = -24; pixel_y = 0},/obj/structure/cable{icon_state = "0-4"; d2 = 4},/turf/simulated/floor/plasteel,/area/ruin/unpowered) "bH" = (/obj/structure/cable{d1 = 4; d2 = 8; icon_state = "4-8"; pixel_y = 0; tag = ""},/turf/simulated/floor/plasteel,/area/ruin/unpowered) "bI" = (/obj/structure/cable{d1 = 1; d2 = 8; icon_state = "1-8"; tag = ""},/turf/simulated/floor/plasteel,/area/ruin/unpowered) "bJ" = (/obj/structure/reagent_dispensers/watertank,/turf/simulated/floor/plasteel,/area/ruin/unpowered) diff --git a/_maps/map_files/RandomRuins/SpaceRuins/onehalf.dmm b/_maps/map_files/RandomRuins/SpaceRuins/onehalf.dmm index 30445ea3b05..482c4eee1a3 100644 --- a/_maps/map_files/RandomRuins/SpaceRuins/onehalf.dmm +++ b/_maps/map_files/RandomRuins/SpaceRuins/onehalf.dmm @@ -35,7 +35,7 @@ "aI" = (/turf/simulated/floor/plasteel/airless{icon_state = "damaged5"},/area/ruin/onehalf/hallway) "aJ" = (/obj/machinery/iv_drip,/turf/simulated/floor/plasteel{tag = "icon-white"; icon_state = "white"},/area/ruin/onehalf/dorms_med) "aK" = (/obj/structure/cable{d1 = 2; d2 = 4; icon_state = "2-4"; tag = ""},/turf/simulated/floor/plasteel{tag = "icon-white"; icon_state = "white"},/area/ruin/onehalf/dorms_med) -"aL" = (/obj/structure/disposalpipe/segment{dir = 4},/obj/structure/cable,/obj/machinery/power/apc{keep_preset_name = 1; name = "Hallway APC"; pixel_x = 0; pixel_y = -24},/turf/simulated/floor/plasteel/airless,/area/ruin/onehalf/hallway) +"aL" = (/obj/structure/disposalpipe/segment{dir = 4},/obj/structure/cable,/obj/machinery/power/apc/noalarm{keep_preset_name = 1; name = "Hallway APC"; pixel_x = 0; pixel_y = -24},/turf/simulated/floor/plasteel/airless,/area/ruin/onehalf/hallway) "aM" = (/obj/structure/disposalpipe/segment,/obj/structure/disposalpipe/segment,/obj/machinery/door/poddoor{id_tag = "bayint1"; name = "mining drone bay blast door"},/turf/simulated/floor/plating,/area/ruin/onehalf/drone_bay) "aN" = (/obj/machinery/door_control{id = "bayint1"; name = "Pod Bay 1 Internal"; pixel_x = -5; pixel_y = -6},/obj/machinery/door_control{id = "bayext1"; name = "Pod Bay 1 External"; pixel_x = -5; pixel_y = 6},/obj/machinery/door_control{id = "bayint2"; name = "Pod Bay 2 Internal"; pixel_x = 7; pixel_y = -6},/obj/machinery/door_control{id = "bayext2"; name = "Pod Bay 2 External"; pixel_x = 7; pixel_y = 6},/turf/simulated/wall,/area/ruin/onehalf/drone_bay) "aO" = (/obj/structure/disposalpipe/segment,/obj/machinery/door/poddoor{id_tag = "bayint2"; name = "mining drone bay blast door"},/turf/simulated/floor/plating,/area/ruin/onehalf/drone_bay) @@ -48,7 +48,7 @@ "aV" = (/obj/machinery/door/airlock/glass_medical{name = "airlock"},/obj/structure/cable{d1 = 1; d2 = 2; icon_state = "1-2"},/turf/simulated/floor/plasteel{tag = "icon-white"; icon_state = "white"},/area/ruin/onehalf/dorms_med) "aW" = (/obj/machinery/door/airlock,/turf/simulated/floor/plasteel,/area/ruin/onehalf/dorms_med) "aX" = (/obj/structure/cable{d1 = 1; d2 = 2; icon_state = "1-2"},/obj/structure/cable{d1 = 1; d2 = 4; icon_state = "1-4"},/turf/simulated/floor/plasteel{dir = 9; icon_state = "warning"},/area/ruin/onehalf/drone_bay) -"aY" = (/obj/structure/cable{d2 = 8; icon_state = "0-8"},/obj/structure/closet/crate/medical,/obj/item/clothing/accessory/stethoscope,/obj/item/device/healthanalyzer,/obj/item/weapon/reagent_containers/blood/OMinus,/obj/item/weapon/reagent_containers/blood/OMinus,/obj/machinery/power/apc{dir = 4; keep_preset_name = 1; name = "Crew Quarters APC"; pixel_x = 27},/turf/simulated/floor/plasteel{tag = "icon-white"; icon_state = "white"},/area/ruin/onehalf/dorms_med) +"aY" = (/obj/structure/cable{d2 = 8; icon_state = "0-8"},/obj/structure/closet/crate/medical,/obj/item/clothing/accessory/stethoscope,/obj/item/device/healthanalyzer,/obj/item/weapon/reagent_containers/blood/OMinus,/obj/item/weapon/reagent_containers/blood/OMinus,/obj/machinery/power/apc/noalarm{dir = 4; keep_preset_name = 1; name = "Crew Quarters APC"; pixel_x = 27},/turf/simulated/floor/plasteel{tag = "icon-white"; icon_state = "white"},/area/ruin/onehalf/dorms_med) "aZ" = (/obj/structure/disposalpipe/segment,/turf/simulated/floor/plasteel{dir = 1; icon_state = "warning"},/area/ruin/onehalf/drone_bay) "ba" = (/turf/simulated/floor/plasteel{dir = 1; icon_state = "warning"},/area/ruin/onehalf/drone_bay) "bb" = (/obj/structure/disposalpipe/segment,/turf/simulated/floor/plasteel{dir = 5; icon_state = "warning"},/area/ruin/onehalf/drone_bay) @@ -74,7 +74,7 @@ "bv" = (/obj/structure/disposalpipe/segment{dir = 4},/turf/simulated/floor/plasteel/airless{icon_state = "damaged3"},/area/ruin/onehalf/hallway) "bw" = (/obj/structure/disposalpipe/segment{dir = 4},/turf/simulated/floor/plasteel/airless,/area/ruin/onehalf/hallway) "bx" = (/obj/structure/disposalpipe/segment,/obj/structure/disposalpipe/segment{dir = 4},/turf/simulated/floor/plasteel/airless{icon_state = "damaged1"},/area/ruin/onehalf/hallway) -"by" = (/obj/structure/cable{d2 = 8; icon_state = "0-8"},/obj/machinery/power/apc{dir = 1; keep_preset_name = 1; name = "Mining Drone Bay APC"; pixel_y = 26},/turf/simulated/floor/plasteel{dir = 1; icon_state = "warning"},/area/ruin/onehalf/drone_bay) +"by" = (/obj/structure/cable{d2 = 8; icon_state = "0-8"},/obj/machinery/power/apc/noalarm{dir = 1; keep_preset_name = 1; name = "Mining Drone Bay APC"; pixel_y = 26},/turf/simulated/floor/plasteel{dir = 1; icon_state = "warning"},/area/ruin/onehalf/drone_bay) "bz" = (/obj/structure/disposalpipe/segment{dir = 4},/turf/simulated/floor/plasteel/airless{icon_state = "damaged4"},/area/ruin/onehalf/hallway) "bA" = (/obj/structure/disposalpipe/segment,/obj/structure/disposalpipe/segment{dir = 4},/obj/structure/disposalpipe/segment{dir = 4},/turf/simulated/floor/plasteel/airless,/area/ruin/onehalf/hallway) "bB" = (/obj/machinery/door/airlock/glass{name = "glass airlock"},/obj/structure/disposalpipe/segment{dir = 4},/turf/simulated/floor/plasteel,/area/ruin/onehalf/drone_bay) @@ -92,7 +92,7 @@ "bN" = (/obj/structure/disposalpipe/trunk{dir = 1},/obj/machinery/disposal,/turf/simulated/floor/plasteel/airless,/area/ruin/onehalf/hallway) "bO" = (/obj/structure/girder/reinforced,/obj/item/stack/sheet/plasteel,/turf/simulated/floor/plating/airless,/area/ruin/onehalf/hallway) "bP" = (/obj/structure/girder/reinforced,/turf/simulated/floor/plating/airless,/area/ruin/onehalf/hallway) -"bQ" = (/obj/structure/cable{d2 = 4; icon_state = "0-4"},/obj/machinery/power/apc{dir = 1; keep_preset_name = 1; name = "Bridge APC"; pixel_y = 26},/turf/simulated/floor/plasteel,/area/ruin/onehalf/bridge) +"bQ" = (/obj/structure/cable{d2 = 4; icon_state = "0-4"},/obj/machinery/power/apc/noalarm{dir = 1; keep_preset_name = 1; name = "Bridge APC"; pixel_y = 26},/turf/simulated/floor/plasteel,/area/ruin/onehalf/bridge) "bR" = (/turf/simulated/floor/plasteel/airless{icon_state = "damaged2"},/area/ruin/onehalf/hallway) "bS" = (/obj/structure/disposalpipe/segment,/turf/simulated/floor/plasteel/airless,/area/ruin/onehalf/hallway) "bT" = (/turf/simulated/wall/r_wall,/area/ruin/onehalf/bridge) diff --git a/_maps/map_files/RandomRuins/SpaceRuins/turretedoutpost.dmm b/_maps/map_files/RandomRuins/SpaceRuins/turretedoutpost.dmm index 87e1a46f41f..5291cdea5a3 100644 --- a/_maps/map_files/RandomRuins/SpaceRuins/turretedoutpost.dmm +++ b/_maps/map_files/RandomRuins/SpaceRuins/turretedoutpost.dmm @@ -20,7 +20,7 @@ "t" = (/obj/item/weapon/rack_parts,/obj/machinery/light{dir = 1},/turf/simulated/floor/plasteel{icon_state = "vault"; dir = 8},/area/ruin/unpowered) "u" = (/obj/machinery/door/airlock/glass,/turf/simulated/floor/plasteel,/area/ruin/unpowered) "v" = (/obj/machinery/door/airlock,/turf/simulated/floor/plasteel,/area/ruin/unpowered) -"w" = (/obj/machinery/power/apc{dir = 2; name = "Outpost APC"; keep_preset_name = 1; pixel_y = -24},/turf/simulated/floor/plasteel,/area/ruin/unpowered) +"w" = (/obj/machinery/power/apc/noalarm{dir = 2; name = "Outpost APC"; keep_preset_name = 1; pixel_y = -24},/turf/simulated/floor/plasteel,/area/ruin/unpowered) "x" = (/turf/simulated/floor/plasteel{icon_state = "dark"},/area/ruin/unpowered) "y" = (/obj/structure/dispenser/oxygen,/turf/simulated/floor/plasteel{icon_state = "dark"},/area/ruin/unpowered) "z" = (/obj/structure/table/reinforced,/obj/item/clothing/head/ushanka,/turf/simulated/floor/plasteel{dir = 4; icon_state = "darkredfull"},/area/ruin/unpowered) diff --git a/code/ATMOSPHERICS/atmospherics.dm b/code/ATMOSPHERICS/atmospherics.dm index aeadda0a7b4..fad455ed438 100644 --- a/code/ATMOSPHERICS/atmospherics.dm +++ b/code/ATMOSPHERICS/atmospherics.dm @@ -33,7 +33,7 @@ Pipelines + Other Objects -> Pipe network /obj/machinery/atmospherics/New() ..() - + if(!icon_manager) icon_manager = new() @@ -318,3 +318,6 @@ Pipelines + Other Objects -> Pipe network /obj/machinery/atmospherics/singularity_pull(S, current_size) if(current_size >= STAGE_FIVE) Deconstruct() + +/obj/machinery/atmospherics/update_remote_sight(mob/user) + user.sight |= (SEE_TURFS|BLIND) diff --git a/code/ATMOSPHERICS/components/omni_devices/filter.dm b/code/ATMOSPHERICS/components/omni_devices/filter.dm index 94efade9b1a..cbe1422c38a 100644 --- a/code/ATMOSPHERICS/components/omni_devices/filter.dm +++ b/code/ATMOSPHERICS/components/omni_devices/filter.dm @@ -108,22 +108,16 @@ return 1 -/obj/machinery/atmospherics/omni/filter/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null) +/obj/machinery/atmospherics/omni/filter/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, force_open = 0) usr.set_machine(src) - var/list/data = new() - - data = build_uidata() - - ui = nanomanager.try_update_ui(user, src, ui_key, ui, data) - + ui = nanomanager.try_update_ui(user, src, ui_key, ui, force_open) if(!ui) ui = new(user, src, ui_key, "omni_filter.tmpl", "Omni Filter Control", 330, 330) - ui.set_initial_data(data) ui.open() -/obj/machinery/atmospherics/omni/filter/proc/build_uidata() - var/list/data = new() +/obj/machinery/atmospherics/omni/filter/ui_data(mob/user, datum/topic_state/state) + var/data[0] data["power"] = on data["config"] = configuring diff --git a/code/ATMOSPHERICS/components/omni_devices/mixer.dm b/code/ATMOSPHERICS/components/omni_devices/mixer.dm index c64703773d3..07269c5f3db 100644 --- a/code/ATMOSPHERICS/components/omni_devices/mixer.dm +++ b/code/ATMOSPHERICS/components/omni_devices/mixer.dm @@ -132,22 +132,16 @@ return 1 -/obj/machinery/atmospherics/omni/mixer/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null) +/obj/machinery/atmospherics/omni/mixer/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, force_open = 0) usr.set_machine(src) - var/list/data = new() - - data = build_uidata() - - ui = nanomanager.try_update_ui(user, src, ui_key, ui, data) - + ui = nanomanager.try_update_ui(user, src, ui_key, ui, force_open) if(!ui) ui = new(user, src, ui_key, "omni_mixer.tmpl", "Omni Mixer Control", 360, 330) - ui.set_initial_data(data) ui.open() -/obj/machinery/atmospherics/omni/mixer/proc/build_uidata() - var/list/data = new() +/obj/machinery/atmospherics/omni/mixer/ui_data(mob/user, datum/topic_state/state) + var/data[0] data["power"] = on data["config"] = configuring diff --git a/code/__DEFINES/admin.dm b/code/__DEFINES/admin.dm index 49ef7a72855..0397b5bcdde 100644 --- a/code/__DEFINES/admin.dm +++ b/code/__DEFINES/admin.dm @@ -43,4 +43,21 @@ #define R_MAXPERMISSION 32768 //This holds the maximum value for a permission. It is used in iteration, so keep it updated. -#define R_HOST 65535 \ No newline at end of file +#define R_HOST 65535 + +#define ADMIN_QUE(user) "(?)" +#define ADMIN_FLW(user) "(FLW)" +#define ADMIN_PP(user) "(PP)" +#define ADMIN_VV(atom) "(VV)" +#define ADMIN_SM(user) "(SM)" +#define ADMIN_TP(user) "(TP)" +#define ADMIN_BSA(user) "(BSA)" +#define ADMIN_CENTCOM_REPLY(user) "(RPLY)" +#define ADMIN_SYNDICATE_REPLY(user) "(RPLY)" +#define ADMIN_SC(user) "(SC)" +#define ADMIN_LOOKUP(user) "[key_name_admin(user)][ADMIN_QUE(user)]" +#define ADMIN_LOOKUPFLW(user) "[key_name_admin(user)][ADMIN_QUE(user)] [ADMIN_FLW(user)]" +#define ADMIN_FULLMONTY(user) "[key_name_admin(user)] [ADMIN_QUE(user)] [ADMIN_PP(user)] [ADMIN_VV(user)] [ADMIN_SM(user)] [ADMIN_FLW(user)] [ADMIN_TP(user)]" +#define ADMIN_JMP(src) "(JMP)" +#define COORD(src) "[src ? "([src.x],[src.y],[src.z])" : "nonexistent location"]" +#define ADMIN_COORDJMP(src) "[src ? "[COORD(src)] [ADMIN_JMP(src)]" : "nonexistent location"]" \ No newline at end of file diff --git a/code/__DEFINES/misc.dm b/code/__DEFINES/misc.dm index 049019a32d2..e6804ee1f96 100644 --- a/code/__DEFINES/misc.dm +++ b/code/__DEFINES/misc.dm @@ -196,7 +196,7 @@ //Human Overlays Indexes///////// #define MUTANTRACE_LAYER 1 -#define TAIL_UNDERLIMBS_LAYER 2 +#define TAIL_UNDERLIMBS_LAYER 2 //Tail split-rendering. #define LIMBS_LAYER 3 #define MARKINGS_LAYER 4 #define UNDERWEAR_LAYER 5 @@ -211,21 +211,24 @@ #define BELT_LAYER 14 //Possible make this an overlay of somethign required to wear a belt? #define SUIT_STORE_LAYER 15 #define BACK_LAYER 16 -#define HAIR_LAYER 17 //TODO: make part of head layer? -#define HEAD_ACCESSORY_LAYER 18 -#define FHAIR_LAYER 19 -#define TAIL_LAYER 20 //bs12 specific. this hack is probably gonna come back to haunt me -#define GLASSES_LAYER 21 -#define FACEMASK_LAYER 22 -#define HEAD_LAYER 23 -#define COLLAR_LAYER 24 -#define HANDCUFF_LAYER 25 -#define LEGCUFF_LAYER 26 -#define L_HAND_LAYER 27 -#define R_HAND_LAYER 28 -#define TARGETED_LAYER 29 //BS12: Layer for the target overlay from weapon targeting system -#define FIRE_LAYER 30 //If you're on fire -#define TOTAL_LAYERS 30 +#define HEAD_ACCESSORY_LAYER 17 +#define FHAIR_LAYER 18 +#define GLASSES_LAYER 19 +#define HAIR_LAYER 20 //TODO: make part of head layer? +#define HEAD_ACC_OVER_LAYER 21 //Select-layer rendering. +#define FHAIR_OVER_LAYER 22 //Select-layer rendering. +#define GLASSES_OVER_LAYER 23 //Select-layer rendering. +#define TAIL_LAYER 24 //bs12 specific. this hack is probably gonna come back to haunt me +#define FACEMASK_LAYER 25 +#define HEAD_LAYER 26 +#define COLLAR_LAYER 27 +#define HANDCUFF_LAYER 28 +#define LEGCUFF_LAYER 29 +#define L_HAND_LAYER 30 +#define R_HAND_LAYER 31 +#define TARGETED_LAYER 32 //BS12: Layer for the target overlay from weapon targeting system +#define FIRE_LAYER 33 //If you're on fire +#define TOTAL_LAYERS 33 ///Access Region Codes/// #define REGION_ALL 0 diff --git a/code/__DEFINES/mob.dm b/code/__DEFINES/mob.dm index bf9c479d3e8..7ab8a19f86d 100644 --- a/code/__DEFINES/mob.dm +++ b/code/__DEFINES/mob.dm @@ -110,6 +110,9 @@ #define CHEM_MOB_SPAWN_HOSTILE 1 #define CHEM_MOB_SPAWN_FRIENDLY 2 +#define TINT_IMPAIR 2 //Threshold of tint level to apply weld mask overlay +#define TINT_BLIND 3 //Threshold of tint level to obscure vision fully + #define isliving(A) (istype((A), /mob/living)) #define iscarbon(A) (istype((A), /mob/living/carbon)) #define ishuman(A) (istype((A), /mob/living/carbon/human)) @@ -146,4 +149,4 @@ #define isorgan(A) (istype((A), /obj/item/organ/external)) #define hasorgans(A) (ishuman(A)) -#define is_admin(user) (check_rights(R_ADMIN, 0, (user)) != 0) \ No newline at end of file +#define is_admin(user) (check_rights(R_ADMIN, 0, (user)) != 0) diff --git a/code/__HELPERS/matrices.dm b/code/__HELPERS/matrices.dm index 94668321c60..3b370f8a945 100644 --- a/code/__HELPERS/matrices.dm +++ b/code/__HELPERS/matrices.dm @@ -24,3 +24,39 @@ animate(transform = matrices[i], time = speed) //doesn't have an object argument because this is "Stacking" with the animate call above //3 billion% intentional + +//Dumps the matrix data in format a-f +/matrix/proc/tolist() + . = list() + . += a + . += b + . += c + . += d + . += e + . += f + +//Dumps the matrix data in a matrix-grid format +/* + a d 0 + b e 0 + c f 1 +*/ +/matrix/proc/togrid() + . = list() + . += a + . += d + . += 0 + . += b + . += e + . += 0 + . += c + . += f + . += 1 + +//The X pixel offset of this matrix +/matrix/proc/get_x_shift() + . = c + +//The Y pixel offset of this matrix +/matrix/proc/get_y_shift() + . = f \ No newline at end of file diff --git a/code/__HELPERS/unsorted.dm b/code/__HELPERS/unsorted.dm index de091cb8584..e0d25da3ffd 100644 --- a/code/__HELPERS/unsorted.dm +++ b/code/__HELPERS/unsorted.dm @@ -1009,6 +1009,50 @@ proc/get_mob_with_client_list() else if(zone == "l_foot") return "left foot" else if(zone == "r_foot") return "right foot" else return zone + +/* + + Gets the turf this atom's *ICON* appears to inhabit + It takes into account: + * Pixel_x/y + * Matrix x/y + + NOTE: if your atom has non-standard bounds then this proc + will handle it, but: + * if the bounds are even, then there are an even amount of "middle" turfs, the one to the EAST, NORTH, or BOTH is picked + (this may seem bad, but you're atleast as close to the center of the atom as possible, better than byond's default loc being all the way off) + * if the bounds are odd, the true middle turf of the atom is returned + +*/ + +/proc/get_turf_pixel(atom/movable/AM) + if(!istype(AM)) + return + + //Find AM's matrix so we can use it's X/Y pixel shifts + var/matrix/M = matrix(AM.transform) + + var/pixel_x_offset = AM.pixel_x + M.get_x_shift() + var/pixel_y_offset = AM.pixel_y + M.get_y_shift() + + //Irregular objects + if(AM.bound_height != world.icon_size || AM.bound_width != world.icon_size) + var/icon/AMicon = icon(AM.icon, AM.icon_state) + pixel_x_offset += ((AMicon.Width()/world.icon_size)-1)*(world.icon_size*0.5) + pixel_y_offset += ((AMicon.Height()/world.icon_size)-1)*(world.icon_size*0.5) + qdel(AMicon) + + //DY and DX + var/rough_x = round(round(pixel_x_offset,world.icon_size)/world.icon_size) + var/rough_y = round(round(pixel_y_offset,world.icon_size)/world.icon_size) + + //Find coordinates + var/turf/T = get_turf(AM) //use AM's turfs, as it's coords are the same as AM's AND AM's coords are lost if it is inside another atom + var/final_x = T.x + rough_x + var/final_y = T.y + rough_y + + if(final_x || final_y) + return locate(final_x, final_y, T.z) //Finds the distance between two atoms, in pixels //centered = 0 counts from turf edge to edge diff --git a/code/_onclick/ai.dm b/code/_onclick/ai.dm index cdce17f6277..f3ae2fdea48 100644 --- a/code/_onclick/ai.dm +++ b/code/_onclick/ai.dm @@ -31,9 +31,15 @@ return next_click = world.time + 1 - if(control_disabled || stat) return + + var/turf/pixel_turf = get_turf_pixel(A) + if(pixel_turf && !cameranet.checkTurfVis(pixel_turf)) + log_admin("[key_name_admin(src)] might be running a modified client! (failed checkTurfVis on AI click of [A]([COORD(A)])") + message_admins("[key_name_admin(src)] might be running a modified client! (failed checkTurfVis on AI click of [A]([ADMIN_COORDJMP(A)]))") + send2irc_adminless_only("NOCHEAT", "[key_name(src)] might be running a modified client! (failed checkTurfVis on AI click of [A]([COORD(A)]))") + return var/list/modifiers = params2list(params) if(modifiers["shift"] && modifiers["ctrl"]) diff --git a/code/datums/cargoprofile.dm b/code/datums/cargoprofile.dm index ab98e25c547..ada85c38611 100644 --- a/code/datums/cargoprofile.dm +++ b/code/datums/cargoprofile.dm @@ -643,9 +643,7 @@ //this is necessarily damaging var/damage = rand(1,5) to_chat(M, "The unloading machine grabs you with a hard metallic claw!") - if(M.client) - M.client.eye = master - M.client.perspective = EYE_PERSPECTIVE + M.reset_perspective(master) M.loc = master master.types[M.type] = src M.apply_damage(damage) // todo: ugly @@ -699,10 +697,7 @@ //this is necessarily damaging var/damage = rand(1,5) to_chat(M, "The unloading machine grabs you with a hard metallic claw!") - if(M.client) - M.client.eye = master - M.client.perspective = EYE_PERSPECTIVE - M.loc = master + M.forceMove(master) master.types[M.type] = src M.apply_damage(damage) // todo: ugly M.visible_message("\red [M.name] gets pulled into the machine!") @@ -710,11 +705,8 @@ outlet_reaction(var/atom/W,var/turf/D) var/mob/living/M = W - M.loc = master.loc + M.forceMove(master.loc) M.dir = master.outdir - if(M.client) - M.client.eye = M.client.mob - M.client.perspective = MOB_PERSPECTIVE D = get_step(D,master.outdir) // throw attempt eject_speed = rand(0,4) @@ -796,4 +788,4 @@ var/punches = punch(M,remaining / PUNCH_WORK) if(punches>1)master.sleep++ return punches * PUNCH_WORK -#undef MAXCOIL \ No newline at end of file +#undef MAXCOIL diff --git a/code/datums/datumvars.dm b/code/datums/datumvars.dm index 6664c06dda0..53a927386bd 100644 --- a/code/datums/datumvars.dm +++ b/code/datums/datumvars.dm @@ -1028,7 +1028,7 @@ body to_chat(usr, "Mob doesn't exist anymore") return - if(!(locateUID(rem_organ) in M.internal_organs)) + if(!(rem_organ in M.internal_organs)) to_chat(usr, "Mob does not have that organ.") return diff --git a/code/datums/spell.dm b/code/datums/spell.dm index f16e1f6b263..332d96779e6 100644 --- a/code/datums/spell.dm +++ b/code/datums/spell.dm @@ -64,7 +64,7 @@ var/list/spells = typesof(/obj/effect/proc_holder/spell) //needed for the badmin var/mob/living/carbon/human/caster = user if(caster.remoteview_target) caster.remoteview_target = null - caster.reset_view(0) + caster.reset_perspective(0) return 0 if(is_admin_level(user.z) && (!centcom_cancast || ticker.mode.name == "ragin' mages")) //Certain spells are not allowed on the centcom zlevel diff --git a/code/datums/uplink_item.dm b/code/datums/uplink_item.dm index bba4971acd9..2c5b9375918 100644 --- a/code/datums/uplink_item.dm +++ b/code/datums/uplink_item.dm @@ -207,6 +207,7 @@ var/list/uplink_items = list() item = /obj/item/weapon/caution/proximity_sign cost = 4 job = list("Janitor") + surplus = 0 //Medical diff --git a/code/game/atoms.dm b/code/game/atoms.dm index c60d726236b..663d6c5a8f9 100644 --- a/code/game/atoms.dm +++ b/code/game/atoms.dm @@ -427,6 +427,15 @@ else return 0 +// Used to provide overlays when using this atom as a viewing focus +// (cameras, locker tint, etc.) +/atom/proc/get_remote_view_fullscreens(mob/user) + return + +//the sight changes to give to the mob whose perspective is set to that atom (e.g. A mob with nightvision loses its nightvision while looking through a normal camera) +/atom/proc/update_remote_sight(mob/living/user) + return + /atom/proc/checkpass(passflag) return pass_flags&passflag diff --git a/code/game/atoms_movable.dm b/code/game/atoms_movable.dm index 7f4b0574450..f45f2daa07b 100644 --- a/code/game/atoms_movable.dm +++ b/code/game/atoms_movable.dm @@ -147,6 +147,18 @@ return 1 +/mob/living/forceMove(atom/destination) + stop_pulling() + if(buckled) + buckled.unbuckle_mob(src,force=1) + // in lieu of "unbuckle_all_mobs" + if(buckled_mob) + unbuckle_mob(buckled_mob,force=1) + . = ..() + if(client) + reset_perspective(destination) + update_canmove() //if the mob was asleep inside a container and then got forceMoved out we need to make them fall. + //called when src is thrown into hit_atom /atom/movable/proc/throw_impact(atom/hit_atom, var/speed) if(istype(hit_atom,/mob/living)) diff --git a/code/game/dna/dna_modifier.dm b/code/game/dna/dna_modifier.dm index 63c42687b67..0533afe2911 100644 --- a/code/game/dna/dna_modifier.dm +++ b/code/game/dna/dna_modifier.dm @@ -156,8 +156,6 @@ to_chat(usr, "Subject cannot have abiotic items on.") return usr.stop_pulling() - usr.client.perspective = EYE_PERSPECTIVE - usr.client.eye = src usr.forceMove(src) src.occupant = usr src.icon_state = "scanner_occupied" @@ -258,9 +256,6 @@ go_out() /obj/machinery/dna_scannernew/proc/put_in(var/mob/M) - if(M.client) - M.client.perspective = EYE_PERSPECTIVE - M.client.eye = src M.forceMove(src) src.occupant = M src.icon_state = "scanner_occupied" @@ -283,9 +278,6 @@ to_chat(usr, "The scanner is locked!") return - if(src.occupant.client) - src.occupant.client.eye = src.occupant.client.mob - src.occupant.client.perspective = MOB_PERSPECTIVE src.occupant.forceMove(src.loc) src.occupant = null src.icon_state = "scanner_open" @@ -476,7 +468,18 @@ if(user == connected.occupant) return - // this is the data which will be sent to the ui + // update the ui if it exists, returns null if no ui is passed/found + ui = nanomanager.try_update_ui(user, src, ui_key, ui, force_open) + if(!ui) + // 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, "dna_modifier.tmpl", "DNA Modifier Console", 660, 700) + // open the new ui window + ui.open() + // auto update every Master Controller tick + ui.set_auto_update(1) + +/obj/machinery/computer/scan_consolenew/ui_data(mob/user, datum/topic_state/state) var/data[0] data["selectedMenuKey"] = selected_menu_key data["locked"] = src.connected.locked @@ -550,18 +553,7 @@ for(var/datum/reagent/R in connected.beaker.reagents.reagent_list) data["beakerVolume"] += R.volume - // update the ui if it exists, returns null if no ui is passed/found - ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open) - if(!ui) - // 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, "dna_modifier.tmpl", "DNA Modifier Console", 660, 700) - // 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() - // auto update every Master Controller tick - ui.set_auto_update(1) + return data /obj/machinery/computer/scan_consolenew/Topic(href, href_list) if(..()) diff --git a/code/game/dna/genes/goon_powers.dm b/code/game/dna/genes/goon_powers.dm index 1ada7c0f5ac..36c9af1c48c 100644 --- a/code/game/dna/genes/goon_powers.dm +++ b/code/game/dna/genes/goon_powers.dm @@ -619,7 +619,7 @@ numbers += H.mind.initial_account.account_number numbers += H.mind.initial_account.remote_access_pin if(numbers.len>0) - to_chat(usr, "b>Numbers: You sense the number[numbers.len>1?"s":""] [english_list(numbers)] [numbers.len>1?"are":"is"] important to [M.name].") + to_chat(usr, "Numbers: You sense the number[numbers.len>1?"s":""] [english_list(numbers)] [numbers.len>1?"are":"is"] important to [M.name].") to_chat(usr, "Thoughts: [M.name] is currently [thoughts].") if(EMPATH in M.mutations) diff --git a/code/game/dna/genes/powers.dm b/code/game/dna/genes/powers.dm index 9bc3aa974e6..27c82a1d20f 100644 --- a/code/game/dna/genes/powers.dm +++ b/code/game/dna/genes/powers.dm @@ -161,6 +161,14 @@ /datum/dna/gene/basic/xray/New() block=XRAYBLOCK +/datum/dna/gene/basic/xray/activate(mob/living/M, connected, flags) + ..() + M.update_sight() + +/datum/dna/gene/basic/xray/deactivate(mob/living/M, connected, flags) + ..() + M.update_sight() + /datum/dna/gene/basic/tk name="Telekenesis" activation_messages = list("You feel smarter.") diff --git a/code/game/dna/genes/vg_powers.dm b/code/game/dna/genes/vg_powers.dm index a194ddfeed1..c42ac3e43e3 100644 --- a/code/game/dna/genes/vg_powers.dm +++ b/code/game/dna/genes/vg_powers.dm @@ -302,12 +302,12 @@ if(istype(user.l_hand, /obj/item/tk_grab) || istype(user.r_hand, /obj/item/tk_grab/)) to_chat(user, "Your mind is too busy with that telekinetic grab.") user.remoteview_target = null - user.reset_view(0) + user.reset_perspective(0) return if(user.client.eye != user.client.mob) user.remoteview_target = null - user.reset_view(0) + user.reset_perspective(0) return for(var/mob/living/L in targets) @@ -315,7 +315,7 @@ if(target) user.remoteview_target = target - user.reset_view(target) + user.reset_perspective(target) else user.remoteview_target = null - user.reset_view(0) + user.reset_perspective(0) diff --git a/code/game/gamemodes/cult/ritual.dm b/code/game/gamemodes/cult/ritual.dm index e60b7406675..8e288c39a70 100644 --- a/code/game/gamemodes/cult/ritual.dm +++ b/code/game/gamemodes/cult/ritual.dm @@ -6,13 +6,20 @@ var/runedec = 0 var/engwords = list("travel", "blood", "join", "hell", "destroy", "technology", "self", "see", "other", "hide") /client/proc/check_words() // -- Urist - set category = "Special Verbs" + set category = "Admin" set name = "Check Rune Words" set desc = "Check the rune-word meaning" + + if(!check_rights(R_ADMIN)) + return + if(!cultwords["travel"]) runerandom() for(var/word in engwords) to_chat(usr, "[cultwords[word]] is [word]") + + log_and_message_admins("checked the rune words.") + feedback_add_details("admin_verb","CRW") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! /proc/runerandom() //randomizes word meaning var/list/runewords=list("ire","ego","nahlizet","certum","veri","jatkaa","mgar","balaq", "karazet", "geeri") ///"orkan" and "allaq" removed. @@ -100,6 +107,11 @@ var/engwords = list("travel", "blood", "join", "hell", "destroy", "technology", return return +// This is for the seer rune, so you don't get permanent ghost sight +/obj/effect/rune/Uncrossed(atom/movable/O) + if(isliving(O)) + var/mob/living/L = O + L.update_sight() /obj/effect/rune/proc/get_word_string() if(word1 == cultwords["travel"]) diff --git a/code/game/gamemodes/cult/runes.dm b/code/game/gamemodes/cult/runes.dm index 20133d972c8..ff08b31e700 100644 --- a/code/game/gamemodes/cult/runes.dm +++ b/code/game/gamemodes/cult/runes.dm @@ -210,6 +210,8 @@ var/list/sacrificed = list() /obj/effect/rune/proc/seer() if(usr.loc==src.loc) + // No. Bad cultcode. Bad. + var/mob/living/carbon/human/H = usr if(usr.seer==1) usr.say("Rash'tla sektath mal[pick("'","`")]zua. Zasan therium viortia.") to_chat(usr, "\red The world beyond fades from your vision.") @@ -224,6 +226,7 @@ var/list/sacrificed = list() to_chat(usr, "\red The world beyond opens to your eyes.") usr.see_invisible = SEE_INVISIBLE_OBSERVER usr.seer = 1 + H.update_sight() return return fizzle() diff --git a/code/game/gamemodes/gameticker.dm b/code/game/gamemodes/gameticker.dm index 1b31f2d554a..bc682a4f168 100644 --- a/code/game/gamemodes/gameticker.dm +++ b/code/game/gamemodes/gameticker.dm @@ -411,7 +411,7 @@ var/round_start_time = 0 var/dat dat += {"Karma Reminder

Karma Reminder


You have not yet spent your karma for the round, surely there is a player who was worthy of receiving
- your reward? Look under 'Special Verbs' for the 'Award Karma' button, and use it once a round for best results!"} + your reward? Look under 'OOC' for the 'Award Karma' button, and use it once a round for best results!"} player << browse(dat, "window=karmareminder;size=400x300") diff --git a/code/game/gamemodes/miniantags/abduction/machinery/camera.dm b/code/game/gamemodes/miniantags/abduction/machinery/camera.dm index 8d6a3e08c2e..24b02aea489 100644 --- a/code/game/gamemodes/miniantags/abduction/machinery/camera.dm +++ b/code/game/gamemodes/miniantags/abduction/machinery/camera.dm @@ -76,10 +76,9 @@ origin.vest_mode_action.Remove(C) origin.vest_disguise_action.Remove(C) origin.set_droppoint_action.Remove(C) - remote_eye.user = null + remote_eye.eye_user = null + C.reset_perspective(null) if(C.client) - C.client.perspective = MOB_PERSPECTIVE - C.client.eye = src C.client.images -= remote_eye.user_image for(var/datum/camerachunk/chunk in remote_eye.visibleCameraChunks) C.client.images -= chunk.obscured diff --git a/code/game/gamemodes/miniantags/abduction/machinery/experiment.dm b/code/game/gamemodes/miniantags/abduction/machinery/experiment.dm index aea520a48cc..755bd21e2e5 100644 --- a/code/game/gamemodes/miniantags/abduction/machinery/experiment.dm +++ b/code/game/gamemodes/miniantags/abduction/machinery/experiment.dm @@ -203,9 +203,6 @@ /obj/machinery/abductor/experiment/proc/eject_abductee() if(!occupant) return - if(occupant.client) - occupant.client.eye = occupant.client.mob - occupant.client.perspective = MOB_PERSPECTIVE occupant.forceMove(get_turf(src)) occupant = null - icon_state = "experiment-open" \ No newline at end of file + icon_state = "experiment-open" diff --git a/code/game/gamemodes/miniantags/borer/borer.dm b/code/game/gamemodes/miniantags/borer/borer.dm index e63221970c0..a074773932b 100644 --- a/code/game/gamemodes/miniantags/borer/borer.dm +++ b/code/game/gamemodes/miniantags/borer/borer.dm @@ -446,7 +446,7 @@ controlling = 0 - reset_view(null) + reset_perspective(null) machine = null host.verbs -= /mob/living/carbon/proc/release_control @@ -562,10 +562,10 @@ src.forceMove(get_turf(host)) - reset_view(null) + reset_perspective(null) machine = null - host.reset_view(null) + host.reset_perspective(null) host.machine = null var/mob/living/H = host diff --git a/code/game/gamemodes/nuclear/nuclearbomb.dm b/code/game/gamemodes/nuclear/nuclearbomb.dm index 1ac6b6b491c..060dd76cc66 100644 --- a/code/game/gamemodes/nuclear/nuclearbomb.dm +++ b/code/game/gamemodes/nuclear/nuclearbomb.dm @@ -175,6 +175,13 @@ var/bomb_set return /obj/machinery/nuclearbomb/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1) + ui = nanomanager.try_update_ui(user, src, ui_key, ui, force_open) + if(!ui) + ui = new(user, src, ui_key, "nuclear_bomb.tmpl", "Nuke Control Panel", 450, 550, state = physical_state) + ui.open() + ui.set_auto_update(1) + +/obj/machinery/nuclearbomb/ui_data(mob/user, datum/topic_state/state) var/data[0] data["is_syndicate"] = is_syndicate data["hacking"] = 0 @@ -201,12 +208,7 @@ var/bomb_set if(yes_code) data["message"] = "*****" - ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open) - if(!ui) - ui = new(user, src, ui_key, "nuclear_bomb.tmpl", "Nuke Control Panel", 450, 550, state = physical_state) - ui.set_initial_data(data) - ui.open() - ui.set_auto_update(1) + return data /obj/machinery/nuclearbomb/verb/make_deployable() set category = "Object" diff --git a/code/game/gamemodes/wizard/artefact.dm b/code/game/gamemodes/wizard/artefact.dm index 689fb350b0d..44565a6d157 100644 --- a/code/game/gamemodes/wizard/artefact.dm +++ b/code/game/gamemodes/wizard/artefact.dm @@ -817,11 +817,9 @@ var/global/list/multiverse = list() log_game("[user][user.key] made [target][target.key] say [wgw] with a voodoo doll.") if("eyes") user.set_machine(src) - if(user.client) - user.client.eye = target - user.client.perspective = EYE_PERSPECTIVE + user.reset_perspective(target) spawn(100) - user.reset_view() + user.reset_perspective(null) user.unset_machine() if("r_leg","l_leg") to_chat(user, "You move the doll's legs around.") diff --git a/code/game/machinery/Freezer.dm b/code/game/machinery/Freezer.dm index 7f1a89ab0a4..8a8c7a04114 100644 --- a/code/game/machinery/Freezer.dm +++ b/code/game/machinery/Freezer.dm @@ -98,7 +98,18 @@ src.ui_interact(user) /obj/machinery/atmospherics/unary/cold_sink/freezer/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1) - // this is the data which will be sent to the ui + // update the ui if it exists, returns null if no ui is passed/found + ui = nanomanager.try_update_ui(user, src, ui_key, ui, force_open) + if(!ui) + // 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, "freezer.tmpl", "Gas Cooling System", 540, 300) + // open the new ui window + ui.open() + // auto update every Master Controller tick + ui.set_auto_update(1) + +/obj/machinery/atmospherics/unary/cold_sink/freezer/ui_data(mob/user, datum/topic_state/state = default_state) var/data[0] data["on"] = on ? 1 : 0 data["gasPressure"] = round(air_contents.return_pressure()) @@ -117,19 +128,7 @@ else if(air_contents.temperature < (T0C - 20) && air_contents.temperature > (T0C - 100)) temp_class = "average" data["gasTemperatureClass"] = temp_class - - // update the ui if it exists, returns null if no ui is passed/found - ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open) - if(!ui) - // 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, "freezer.tmpl", "Gas Cooling System", 540, 300) - // 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() - // auto update every Master Controller tick - ui.set_auto_update(1) + return data /obj/machinery/atmospherics/unary/cold_sink/freezer/Topic(href, href_list) if(..()) @@ -257,7 +256,18 @@ src.ui_interact(user) /obj/machinery/atmospherics/unary/heat_reservoir/heater/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1) - // this is the data which will be sent to the ui + // update the ui if it exists, returns null if no ui is passed/found + ui = nanomanager.try_update_ui(user, src, ui_key, ui, force_open) + if(!ui) + // 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, "freezer.tmpl", "Gas Heating System", 540, 300) + // open the new ui window + ui.open() + // auto update every Master Controller tick + ui.set_auto_update(1) + +/obj/machinery/atmospherics/unary/heat_reservoir/heater/ui_data(mob/user, datum/topic_state/state = default_state) var/data[0] data["on"] = on ? 1 : 0 data["gasPressure"] = round(air_contents.return_pressure()) @@ -274,19 +284,7 @@ if(air_contents.temperature > (T20C+40)) temp_class = "bad" data["gasTemperatureClass"] = temp_class - - // update the ui if it exists, returns null if no ui is passed/found - ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open) - if(!ui) - // 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, "freezer.tmpl", "Gas Heating System", 540, 300) - // 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() - // auto update every Master Controller tick - ui.set_auto_update(1) + return data /obj/machinery/atmospherics/unary/heat_reservoir/heater/Topic(href, href_list) if(..()) diff --git a/code/game/machinery/OpTable.dm b/code/game/machinery/OpTable.dm index e901a245bea..873b86d9400 100644 --- a/code/game/machinery/OpTable.dm +++ b/code/game/machinery/OpTable.dm @@ -96,12 +96,9 @@ user.visible_message("[user] climbs on the operating table.","You climb on the operating table.") else visible_message("[C] has been laid on the operating table by [user].") - if(C.client) - C.client.perspective = EYE_PERSPECTIVE - C.client.eye = src C.resting = 1 C.update_canmove() - C.loc = src.loc + C.forceMove(loc) if(user.pulling == C) user.stop_pulling() for(var/obj/O in src) diff --git a/code/game/machinery/Sleeper.dm b/code/game/machinery/Sleeper.dm index d5179a9c19b..0e0067eafe9 100644 --- a/code/game/machinery/Sleeper.dm +++ b/code/game/machinery/Sleeper.dm @@ -135,6 +135,13 @@ ui_interact(user) /obj/machinery/sleeper/ui_interact(mob/user, ui_key = "main", datum/nanoui/ui = null, force_open = 1) + ui = nanomanager.try_update_ui(user, src, ui_key, ui, force_open) + if(!ui) + ui = new(user, src, ui_key, "sleeper.tmpl", "Sleeper", 550, 770) + ui.open() + ui.set_auto_update(1) + +/obj/machinery/sleeper/ui_data(mob/user, datum/topic_state/state) var/data[0] data["hasOccupant"] = occupant ? 1 : 0 var/occupantData[0] @@ -229,13 +236,7 @@ chemicals.Add(list(list("title" = temp.name, "id" = temp.id, "commands" = list("chemical" = temp.id), "occ_amount" = reagent_amount, "pretty_amount" = pretty_amount, "injectable" = injectable, "overdosing" = overdosing, "od_warning" = caution))) data["chemicals"] = chemicals - - ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open) - if(!ui) - ui = new(user, src, ui_key, "sleeper.tmpl", "Sleeper", 550, 770) - ui.set_initial_data(data) - ui.open() - ui.set_auto_update(1) + return data /obj/machinery/sleeper/Topic(href, href_list) if(!controls_inside && usr == occupant) @@ -343,9 +344,6 @@ return if(!G || !G:affecting) return var/mob/M = G:affecting - if(M.client) - M.client.perspective = EYE_PERSPECTIVE - M.client.eye = src M.forceMove(src) src.occupant = M src.icon_state = "[base_icon]" @@ -420,9 +418,6 @@ toggle_filter() if(!occupant) return - if(occupant.client) - occupant.client.eye = occupant.client.mob - occupant.client.perspective = MOB_PERSPECTIVE occupant.forceMove(loc) occupant = null icon_state = "[base_icon]-open" @@ -454,10 +449,10 @@ set name = "Eject Sleeper" set category = "Object" set src in oview(1) - + if(usr.incapacitated()) //are you cuffed, dying, lying, stunned or other return - + src.icon_state = "[base_icon]-open" src.go_out() add_fingerprint(usr) @@ -467,10 +462,10 @@ set name = "Remove Beaker" set category = "Object" set src in oview(1) - + if(usr.incapacitated()) //are you cuffed, dying, lying, stunned or other return - + if(beaker) filtering = 0 beaker.forceMove(usr.loc) @@ -521,10 +516,6 @@ to_chat(user, ">The sleeper is already occupied!") return if(!L) return - - if(L.client) - L.client.perspective = EYE_PERSPECTIVE - L.client.eye = src L.forceMove(src) src.occupant = L src.icon_state = "[base_icon]" @@ -562,8 +553,6 @@ to_chat(usr, "The sleeper is already occupied!") return usr.stop_pulling() - usr.client.perspective = EYE_PERSPECTIVE - usr.client.eye = src usr.forceMove(src) src.occupant = usr src.icon_state = "[base_icon]" diff --git a/code/game/machinery/adv_med.dm b/code/game/machinery/adv_med.dm index 8ea98b53c8b..538e389c083 100644 --- a/code/game/machinery/adv_med.dm +++ b/code/game/machinery/adv_med.dm @@ -93,9 +93,6 @@ if(M.abiotic()) to_chat(user, "Subject cannot have abiotic items on.") return - /*if(M.client) - M.client.perspective = EYE_PERSPECTIVE - M.client.eye = src*///THIS IS FUCKING POINTLESS BECAUSE OF ON-LIFE() FUCKING RESET_VIEW() AHHHHHHHHHHGGGGGGGGGG M.forceMove(src) occupant = M icon_state = "body_scanner_1" @@ -159,9 +156,6 @@ /obj/machinery/bodyscanner/proc/go_out() if(!occupant || locked) return - if(occupant.client) - occupant.client.eye = occupant.client.mob - occupant.client.perspective = MOB_PERSPECTIVE occupant.forceMove(loc) occupant = null icon_state = "body_scanner_0" @@ -322,140 +316,142 @@ /obj/machinery/body_scanconsole/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1) + ui = nanomanager.try_update_ui(user, src, ui_key, ui, force_open) + if(!ui) + ui = new(user, src, ui_key, "adv_med.tmpl", "Body Scanner", 690, 600) + ui.open() + ui.set_auto_update(1) + +/obj/machinery/body_scanconsole/ui_data(mob/user, datum/topic_state/state) var/data[0] data["connected"] = connected ? 1 : 0 - if(connected) - data["occupied"] = connected.occupant ? 1 : 0 + if(!connected) + return data - var/occupantData[0] - if(connected.occupant) - var/mob/living/carbon/human/H = connected.occupant - occupantData["name"] = H.name - occupantData["stat"] = H.stat - occupantData["health"] = H.health - occupantData["maxHealth"] = H.maxHealth + data["occupied"] = connected.occupant ? 1 : 0 - occupantData["hasVirus"] = H.viruses.len + var/occupantData[0] + if(connected.occupant) + var/mob/living/carbon/human/H = connected.occupant + occupantData["name"] = H.name + occupantData["stat"] = H.stat + occupantData["health"] = H.health + occupantData["maxHealth"] = H.maxHealth - occupantData["bruteLoss"] = H.getBruteLoss() - occupantData["oxyLoss"] = H.getOxyLoss() - occupantData["toxLoss"] = H.getToxLoss() - occupantData["fireLoss"] = H.getFireLoss() + occupantData["hasVirus"] = H.viruses.len - occupantData["radLoss"] = H.radiation - occupantData["cloneLoss"] = H.getCloneLoss() - occupantData["brainLoss"] = H.getBrainLoss() - occupantData["paralysis"] = H.paralysis - occupantData["paralysisSeconds"] = round(H.paralysis / 4) - occupantData["bodyTempC"] = H.bodytemperature-T0C - occupantData["bodyTempF"] = (((H.bodytemperature-T0C) * 1.8) + 32) + occupantData["bruteLoss"] = H.getBruteLoss() + occupantData["oxyLoss"] = H.getOxyLoss() + occupantData["toxLoss"] = H.getToxLoss() + occupantData["fireLoss"] = H.getFireLoss() - occupantData["hasBorer"] = H.has_brain_worms() + occupantData["radLoss"] = H.radiation + occupantData["cloneLoss"] = H.getCloneLoss() + occupantData["brainLoss"] = H.getBrainLoss() + occupantData["paralysis"] = H.paralysis + occupantData["paralysisSeconds"] = round(H.paralysis / 4) + occupantData["bodyTempC"] = H.bodytemperature-T0C + occupantData["bodyTempF"] = (((H.bodytemperature-T0C) * 1.8) + 32) - var/bloodData[0] - bloodData["hasBlood"] = 0 - if(ishuman(H) && H.vessel && !(H.species && H.species.flags & NO_BLOOD)) - var/blood_type = H.get_blood_name() - var/blood_volume = round(H.vessel.get_reagent_amount(blood_type)) - bloodData["hasBlood"] = 1 - bloodData["volume"] = blood_volume - bloodData["percent"] = round(((blood_volume / BLOOD_VOLUME_NORMAL)*100)) - bloodData["pulse"] = H.get_pulse(GETPULSE_TOOL) - bloodData["bloodLevel"] = blood_volume - bloodData["bloodMax"] = H.max_blood - occupantData["blood"] = bloodData + occupantData["hasBorer"] = H.has_brain_worms() - var/implantData[0] - for(var/obj/item/weapon/implant/I in H) - if(I.implanted && is_type_in_list(I, known_implants)) - var/implantSubData[0] - implantSubData["name"] = sanitize(I.name) - implantData.Add(list(implantSubData)) - occupantData["implant"] = implantData - occupantData["implant_len"] = implantData.len + var/bloodData[0] + bloodData["hasBlood"] = 0 + if(ishuman(H) && H.vessel && !(H.species && H.species.flags & NO_BLOOD)) + var/blood_type = H.get_blood_name() + var/blood_volume = round(H.vessel.get_reagent_amount(blood_type)) + bloodData["hasBlood"] = 1 + bloodData["volume"] = blood_volume + bloodData["percent"] = round(((blood_volume / BLOOD_VOLUME_NORMAL)*100)) + bloodData["pulse"] = H.get_pulse(GETPULSE_TOOL) + bloodData["bloodLevel"] = blood_volume + bloodData["bloodMax"] = H.max_blood + occupantData["blood"] = bloodData - var/extOrganData[0] - for(var/obj/item/organ/external/E in H.organs) - var/organData[0] - organData["name"] = E.name - organData["open"] = E.open - organData["germ_level"] = E.germ_level - organData["bruteLoss"] = E.brute_dam - organData["fireLoss"] = E.burn_dam - organData["totalLoss"] = E.brute_dam + E.burn_dam - organData["maxHealth"] = E.max_damage - organData["bruised"] = E.min_bruised_damage - organData["broken"] = E.min_broken_damage + var/implantData[0] + for(var/obj/item/weapon/implant/I in H) + if(I.implanted && is_type_in_list(I, known_implants)) + var/implantSubData[0] + implantSubData["name"] = sanitize(I.name) + implantData.Add(list(implantSubData)) + occupantData["implant"] = implantData + occupantData["implant_len"] = implantData.len - var/shrapnelData[0] - for(var/obj/I in E.implants) - var/shrapnelSubData[0] - shrapnelSubData["name"] = I.name + var/extOrganData[0] + for(var/obj/item/organ/external/E in H.organs) + var/organData[0] + organData["name"] = E.name + organData["open"] = E.open + organData["germ_level"] = E.germ_level + organData["bruteLoss"] = E.brute_dam + organData["fireLoss"] = E.burn_dam + organData["totalLoss"] = E.brute_dam + E.burn_dam + organData["maxHealth"] = E.max_damage + organData["bruised"] = E.min_bruised_damage + organData["broken"] = E.min_broken_damage - shrapnelData.Add(list(shrapnelSubData)) + var/shrapnelData[0] + for(var/obj/I in E.implants) + var/shrapnelSubData[0] + shrapnelSubData["name"] = I.name - organData["shrapnel"] = shrapnelData - organData["shrapnel_len"] = shrapnelData.len + shrapnelData.Add(list(shrapnelSubData)) - var/organStatus[0] - if(E.status & ORGAN_DESTROYED) - organStatus["destroyed"] = 1 - if(E.status & ORGAN_BROKEN) - organStatus["broken"] = E.broken_description - if(E.status & ORGAN_ROBOT) - organStatus["robotic"] = 1 - if(E.status & ORGAN_SPLINTED) - organStatus["splinted"] = 1 - if(E.status & ORGAN_BLEEDING) - organStatus["bleeding"] = 1 - if(E.status & ORGAN_DEAD) - organStatus["dead"] = 1 + organData["shrapnel"] = shrapnelData + organData["shrapnel_len"] = shrapnelData.len - organData["status"] = organStatus + var/organStatus[0] + if(E.status & ORGAN_DESTROYED) + organStatus["destroyed"] = 1 + if(E.status & ORGAN_BROKEN) + organStatus["broken"] = E.broken_description + if(E.status & ORGAN_ROBOT) + organStatus["robotic"] = 1 + if(E.status & ORGAN_SPLINTED) + organStatus["splinted"] = 1 + if(E.status & ORGAN_BLEEDING) + organStatus["bleeding"] = 1 + if(E.status & ORGAN_DEAD) + organStatus["dead"] = 1 - if(istype(E, /obj/item/organ/external/chest) && H.is_lung_ruptured()) - organData["lungRuptured"] = 1 + organData["status"] = organStatus - for(var/datum/wound/W in E.wounds) - if(W.internal) - organData["internalBleeding"] = 1 - break + if(istype(E, /obj/item/organ/external/chest) && H.is_lung_ruptured()) + organData["lungRuptured"] = 1 - extOrganData.Add(list(organData)) + for(var/datum/wound/W in E.wounds) + if(W.internal) + organData["internalBleeding"] = 1 + break - occupantData["extOrgan"] = extOrganData + extOrganData.Add(list(organData)) - var/intOrganData[0] - for(var/obj/item/organ/internal/I in H.internal_organs) - var/organData[0] - organData["name"] = I.name - organData["desc"] = I.desc - organData["germ_level"] = I.germ_level - organData["damage"] = I.damage - organData["maxHealth"] = I.max_damage - organData["bruised"] = I.min_broken_damage - organData["broken"] = I.min_bruised_damage - organData["robotic"] = I.robotic - organData["dead"] = (I.status & ORGAN_DEAD) + occupantData["extOrgan"] = extOrganData - intOrganData.Add(list(organData)) + var/intOrganData[0] + for(var/obj/item/organ/internal/I in H.internal_organs) + var/organData[0] + organData["name"] = I.name + organData["desc"] = I.desc + organData["germ_level"] = I.germ_level + organData["damage"] = I.damage + organData["maxHealth"] = I.max_damage + organData["bruised"] = I.min_broken_damage + organData["broken"] = I.min_bruised_damage + organData["robotic"] = I.robotic + organData["dead"] = (I.status & ORGAN_DEAD) - occupantData["intOrgan"] = intOrganData + intOrganData.Add(list(organData)) - occupantData["blind"] = (H.disabilities & BLIND) - occupantData["nearsighted"] = (H.disabilities & NEARSIGHTED) + occupantData["intOrgan"] = intOrganData - data["occupant"] = occupantData - - ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open) - if(!ui) - ui = new(user, src, ui_key, "adv_med.tmpl", "Body Scanner", 690, 600) - ui.set_initial_data(data) - ui.open() - ui.set_auto_update(1) + occupantData["blind"] = (H.disabilities & BLIND) + occupantData["nearsighted"] = (H.disabilities & NEARSIGHTED) + data["occupant"] = occupantData + return data /obj/machinery/body_scanconsole/Topic(href, href_list) if(..()) diff --git a/code/game/machinery/alarm.dm b/code/game/machinery/alarm.dm index 5515eb7ab3a..79a423c70cf 100644 --- a/code/game/machinery/alarm.dm +++ b/code/game/machinery/alarm.dm @@ -696,8 +696,14 @@ data["danger"] = danger return data -/obj/machinery/alarm/proc/get_nano_data(mob/user, href_list) +/obj/machinery/alarm/ui_data(mob/user, datum/topic_state/state = default_state) var/data[0] + var/list/href_list = state.href_list() + + if(href_list) + data["remote_connection"] = href_list["remote_connection"] + data["remote_access"] = href_list["remote_access"] + data["name"] = sanitize(name) data["air"] = ui_air_status() data["alarmActivated"] = alarmActivated || danger_level == 2 @@ -807,22 +813,9 @@ return thresholds /obj/machinery/alarm/ui_interact(mob/user, ui_key = "main", datum/nanoui/ui = null, force_open = 1, var/master_ui = null, var/datum/topic_state/state = default_state) - var/list/href = state.href_list(user) - var/remote_connection = 0 - var/remote_access = 0 - if(href) - remote_connection = href["remote_connection"] // Remote connection means we're non-adjacent/connecting from another computer - remote_access = href["remote_access"] // Remote access means we also have the privilege to alter the air alarm. - - var/list/data = get_nano_data(user, href) - - data["remote_connection"] = remote_connection - data["remote_access"] = remote_access - - ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open) + ui = nanomanager.try_update_ui(user, src, ui_key, ui, force_open) if(!ui) ui = new(user, src, ui_key, "air_alarm.tmpl", name, 570, 410, state = state) - ui.set_initial_data(data) ui.open() ui.set_auto_update(1) diff --git a/code/game/machinery/atmoalter/canister.dm b/code/game/machinery/atmoalter/canister.dm index 7eb01d06988..a7d62d74b94 100644 --- a/code/game/machinery/atmoalter/canister.dm +++ b/code/game/machinery/atmoalter/canister.dm @@ -88,8 +88,8 @@ var/datum/canister_icons/canister_icon_container = new() "quart" = "none") oldcolor = new /list() decals = list("cold" = 0, "hot" = 0, "plasma" = 0) - colorcontainer = new /list(4) - possibledecals = new /list(3) + colorcontainer = list() + possibledecals = list() update_icon() /obj/machinery/portable_atmospherics/canister/proc/init_data_vars() @@ -123,7 +123,7 @@ var/datum/canister_icons/canister_icon_container = new() L.Add(list("anycolor" = 1)) colorcontainer[C] = L - possibledecals = new /list(3) + possibledecals = list() var/i var/list/L = canister_icon_container.possibledecals @@ -382,10 +382,23 @@ update_flag /obj/machinery/portable_atmospherics/canister/attack_hand(var/mob/user as mob) return src.ui_interact(user) -/obj/machinery/portable_atmospherics/canister/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1) +/obj/machinery/portable_atmospherics/canister/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1, var/datum/topic_state/state = physical_state) if(src.destroyed) return + // update the ui if it exists, returns null if no ui is passed/found + ui = nanomanager.try_update_ui(user, src, ui_key, ui, force_open) + if(!ui) + // 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, "canister.tmpl", "Canister", 480, 400, state = state) + // open the new ui window + ui.open() + // auto update every Master Controller tick + ui.set_auto_update(1) + + +/obj/machinery/portable_atmospherics/canister/ui_data(mob/user, datum/topic_state/state) init_data_vars() //set up var/colorcontainer and var/possibledecals // this is the data which will be sent to the ui @@ -394,8 +407,10 @@ update_flag data["menu"] = menu ? 1 : 0 data["canLabel"] = can_label ? 1 : 0 data["canister_color"] = canister_color - data["colorContainer"] = colorcontainer - data["possibleDecals"] = possibledecals + data["colorContainer"] = colorcontainer.Copy() + colorcontainer.Cut() + data["possibleDecals"] = possibledecals.Copy() + possibledecals.Cut() data["portConnected"] = connected_port ? 1 : 0 data["tankPressure"] = round(air_contents.return_pressure() ? air_contents.return_pressure() : 0) data["releasePressure"] = round(release_pressure ? release_pressure : 0) @@ -405,24 +420,9 @@ update_flag data["hasHoldingTank"] = holding ? 1 : 0 if(holding) - data["holdingTank"] = list("name" = holding.name, "tankPressure" = round(holding.air_contents.return_pressure())) - - // update the ui if it exists, returns null if no ui is passed/found - ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open) - if(!ui) - // 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, "canister.tmpl", "Canister", 480, 400, state = physical_state) - // 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() - // auto update every Master Controller tick - ui.set_auto_update(1) - - //Disregard these, avoid cluttering up the VV window - colorcontainer = new /list(4) - possibledecals = new /list(3) + data["holdingTank"] = list("name" = holding.name, "tankPressure" = round(holding.air_contents.return_pressure())) + + return data /obj/machinery/portable_atmospherics/canister/Topic(href, href_list) if(..()) diff --git a/code/game/machinery/atmoalter/pump.dm b/code/game/machinery/atmoalter/pump.dm index 9f716696591..8f7f6d72bb4 100644 --- a/code/game/machinery/atmoalter/pump.dm +++ b/code/game/machinery/atmoalter/pump.dm @@ -8,7 +8,7 @@ var/on = 0 var/direction_out = 0 //0 = siphoning, 1 = releasing var/target_pressure = 100 - + var/pressuremin = 0 var/pressuremax = 10 * ONE_ATMOSPHERE @@ -98,15 +98,27 @@ /obj/machinery/portable_atmospherics/pump/attack_ai(var/mob/user as mob) src.add_hiddenprint(user) return src.attack_hand(user) - + /obj/machinery/portable_atmospherics/pump/attack_ghost(var/mob/user as mob) return src.attack_hand(user) /obj/machinery/portable_atmospherics/pump/attack_hand(var/mob/user as mob) ui_interact(user) - -/obj/machinery/portable_atmospherics/pump/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null) - var/list/data[0] + +/obj/machinery/portable_atmospherics/pump/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1, var/datum/topic_state/state = physical_state) + // update the ui if it exists, returns null if no ui is passed/found + ui = nanomanager.try_update_ui(user, src, ui_key, ui, force_open) + if(!ui) + // 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, "portpump.tmpl", "Portable Pump", 480, 400, state = state) + // open the new ui window + ui.open() + // auto update every Master Controller tick + ui.set_auto_update(1) + +/obj/machinery/portable_atmospherics/pump/ui_data(mob/user, datum/topic_state/state = physical_state) + var/data[0] data["portConnected"] = connected_port ? 1 : 0 data["tankPressure"] = round(air_contents.return_pressure() > 0 ? air_contents.return_pressure() : 0) data["targetpressure"] = round(target_pressure) @@ -119,18 +131,7 @@ if(holding) data["holdingTank"] = list("name" = holding.name, "tankPressure" = round(holding.air_contents.return_pressure() > 0 ? holding.air_contents.return_pressure() : 0)) - // update the ui if it exists, returns null if no ui is passed/found - ui = nanomanager.try_update_ui(user, src, ui_key, ui, data) - if(!ui) - // 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, "portpump.tmpl", "Portable Pump", 480, 400, state = physical_state) - // 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() - // auto update every Master Controller tick - ui.set_auto_update(1) + return data /obj/machinery/portable_atmospherics/pump/Topic(href, href_list) if(..()) @@ -155,4 +156,3 @@ update_icon() src.add_fingerprint(usr) - \ No newline at end of file diff --git a/code/game/machinery/atmoalter/scrubber.dm b/code/game/machinery/atmoalter/scrubber.dm index 1fb0bdd1308..de5ac2dc49d 100644 --- a/code/game/machinery/atmoalter/scrubber.dm +++ b/code/game/machinery/atmoalter/scrubber.dm @@ -10,7 +10,7 @@ var/widenet = 0 //is this scrubber acting on the 3x3 area around it. volume = 750 - + var/minrate = 0//probably useless, but whatever var/maxrate = 10 * ONE_ATMOSPHERE @@ -52,7 +52,7 @@ if(istype(T)) for(var/turf/simulated/tile in T.GetAtmosAdjacentTurfs(alldir=1)) scrub(tile) - + /obj/machinery/portable_atmospherics/scrubber/proc/scrub(var/turf/simulated/tile) var/datum/gas_mixture/environment if(holding) @@ -108,7 +108,7 @@ /obj/machinery/portable_atmospherics/scrubber/attack_ai(var/mob/user as mob) src.add_hiddenprint(user) return src.attack_hand(user) - + /obj/machinery/portable_atmospherics/scrubber/attack_ghost(var/mob/user as mob) return src.attack_hand(user) @@ -116,8 +116,20 @@ ui_interact(user) return -/obj/machinery/portable_atmospherics/scrubber/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null) - var/list/data[0] +/obj/machinery/portable_atmospherics/scrubber/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1, var/datum/topic_state/state = physical_state) + // update the ui if it exists, returns null if no ui is passed/found + ui = nanomanager.try_update_ui(user, src, ui_key, ui, force_open) + if(!ui) + // 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, "portscrubber.tmpl", "Portable Scrubber", 480, 400, state = state) + // open the new ui window + ui.open() + // auto update every Master Controller tick + ui.set_auto_update(1) + +/obj/machinery/portable_atmospherics/scrubber/ui_data(mob/user, datum/topic_state/state = physical_state) + var/data[0] data["portConnected"] = connected_port ? 1 : 0 data["tankPressure"] = round(air_contents.return_pressure() > 0 ? air_contents.return_pressure() : 0) data["rate"] = round(volume_rate) @@ -129,18 +141,7 @@ if(holding) data["holdingTank"] = list("name" = holding.name, "tankPressure" = round(holding.air_contents.return_pressure() > 0 ? holding.air_contents.return_pressure() : 0)) - // update the ui if it exists, returns null if no ui is passed/found - ui = nanomanager.try_update_ui(user, src, ui_key, ui, data) - if(!ui) - // 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, "portscrubber.tmpl", "Portable Scrubber", 480, 400, state = physical_state) - // 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() - // auto update every Master Controller tick - ui.set_auto_update(1) + return data /obj/machinery/portable_atmospherics/scrubber/Topic(href, href_list) if(..()) @@ -160,7 +161,7 @@ volume_rate = Clamp(volume_rate+diff, minrate, maxrate) src.add_fingerprint(usr) - + /obj/machinery/portable_atmospherics/scrubber/huge name = "Huge Air Scrubber" icon_state = "scrubber:0" @@ -172,7 +173,7 @@ var/global/gid = 1 var/id = 0 var/stationary = 0 - + /obj/machinery/portable_atmospherics/scrubber/huge/New() ..() id = gid @@ -207,7 +208,7 @@ else if((istype(W, /obj/item/device/analyzer)) && get_dist(user, src) <= 1) atmosanalyzer_scan(air_contents, user) - + /obj/machinery/portable_atmospherics/scrubber/huge/stationary name = "Stationary Air Scrubber" - stationary = 1 \ No newline at end of file + stationary = 1 diff --git a/code/game/machinery/camera/camera.dm b/code/game/machinery/camera/camera.dm index 1270b782ecd..db616620244 100644 --- a/code/game/machinery/camera/camera.dm +++ b/code/game/machinery/camera/camera.dm @@ -92,7 +92,7 @@ for(var/mob/O in mob_list) if(O.client && O.client.eye == src) O.unset_machine() - O.reset_view(null) + O.reset_perspective(null) to_chat(O, "The screen bursts into static.") ..() @@ -279,7 +279,7 @@ for(var/mob/O in player_list) if(O.client && O.client.eye == src) O.unset_machine() - O.reset_view(null) + O.reset_perspective(null) to_chat(O, "The screen bursts into static.") /obj/machinery/camera/proc/triggerCameraAlarm(var/duration = 0) @@ -387,6 +387,20 @@ cam["z"] = 0 return cam +/obj/machinery/camera/get_remote_view_fullscreens(mob/user) + if(view_range == short_range) //unfocused + user.overlay_fullscreen("remote_view", /obj/screen/fullscreen/impaired, 2) + +/obj/machinery/camera/update_remote_sight(mob/living/user) + user.see_invisible = SEE_INVISIBLE_LIVING //can't see ghosts through cameras + if(isXRay()) + user.sight |= (SEE_TURFS|SEE_MOBS|SEE_OBJS) + user.see_in_dark = max(user.see_in_dark, 8) + else + user.sight = 0 + user.see_in_dark = 2 + return 1 + /obj/machinery/camera/portable //Cameras which are placed inside of things, such as helmets. var/turf/prev_turf diff --git a/code/game/machinery/cloning.dm b/code/game/machinery/cloning.dm index 0cc1e8a0afe..0e0eaaf6985 100644 --- a/code/game/machinery/cloning.dm +++ b/code/game/machinery/cloning.dm @@ -205,7 +205,7 @@ clonemind = locate(R.mind) if(!istype(clonemind)) //not a mind return 0 - if( clonemind.current && clonemind.current.stat != DEAD ) //mind is associated with a non-dead body + if(clonemind.current && clonemind.current.stat != DEAD) //mind is associated with a non-dead body return 0 if(clonemind.active) //somebody is using that mind if(ckey(clonemind.key) != R.ckey) @@ -229,12 +229,21 @@ spawn(30) eject_wait = 0 + if(!R.dna) + R.dna = new /datum/dna() + var/mob/living/carbon/human/H = new /mob/living/carbon/human(src, R.dna.species) occupant = H if(!R.dna.real_name) //to prevent null names - R.dna.real_name = "clone ([rand(0,999)])" - H.real_name = R.dna.real_name + R.dna.real_name = H.real_name + else + H.real_name = R.dna.real_name + + H.dna = R.dna.Clone() + + for(var/datum/language/L in R.languages) + H.add_language(L.name) //Get the clone body ready H.adjustCloneLoss(190) //new damage var so you can't eject a clone early then stab them to abuse the current damage system --NeoFite @@ -256,31 +265,23 @@ beginning to regenerate in a cloning pod. You will become conscious when it is complete."}) - if(!R.dna) - H.dna = new /datum/dna() - H.dna.real_name = H.real_name - H.dna.ready_dna(H) - else - H.dna = R.dna.Clone() + domutcheck(H, null, MUTCHK_FORCED) //Ensures species that get powers by the species proc handle_dna keep them + if(efficiency > 2 && efficiency < 5 && prob(25)) randmutb(H) if(efficiency > 5 && prob(20)) randmutg(H) if(efficiency < 3 && prob(50)) randmutb(H) + H.dna.UpdateSE() H.dna.UpdateUI() - H.set_species(R.dna.species) H.sync_organ_dna(1) // It's literally a fresh body as you can get, so all organs properly belong to it H.UpdateAppearance() - H.update_body() update_icon() - for(var/datum/language/L in R.languages) - H.add_language(L.name) - H.suiciding = 0 attempting = 0 return 1 diff --git a/code/game/machinery/computer/Operating.dm b/code/game/machinery/computer/Operating.dm index 08e3677b039..1c40370f56d 100644 --- a/code/game/machinery/computer/Operating.dm +++ b/code/game/machinery/computer/Operating.dm @@ -86,6 +86,13 @@ // onclose(user, "op") /obj/machinery/computer/operating/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1)//ui is mostly copy pasta from the sleeper ui + ui = nanomanager.try_update_ui(user, src, ui_key, ui, force_open) + if(!ui) + ui = new(user, src, ui_key, "op_computer.tmpl", "Patient Monitor", 650, 455) + ui.open() + ui.set_auto_update(1) + +/obj/machinery/computer/operating/ui_data(mob/user, datum/topic_state/state = default_state) var/data[0] var/mob/living/carbon/human/occupant = src.table.victim data["hasOccupant"] = occupant ? 1 : 0 @@ -156,15 +163,7 @@ data["healthAlarm"]=healthAlarm data["oxy"]=oxy - ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open) - if(!ui) - ui = new(user, src, ui_key, "op_computer.tmpl", "Patient Monitor", 650, 455) - ui.set_initial_data(data) - ui.open() - ui.set_auto_update(1) - - - + return data /obj/machinery/computer/operating/Topic(href, href_list) diff --git a/code/game/machinery/computer/aifixer.dm b/code/game/machinery/computer/aifixer.dm index 097efa2c75c..539edb24d65 100644 --- a/code/game/machinery/computer/aifixer.dm +++ b/code/game/machinery/computer/aifixer.dm @@ -33,6 +33,14 @@ to_chat(user, "You have been locked out from this console!") /obj/machinery/computer/aifixer/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1) + ui = nanomanager.try_update_ui(user, src, ui_key, ui, force_open) + + if(!ui) + ui = new(user, src, ui_key, "ai_fixer.tmpl", "AI System Integrity Restorer", 550, 500) + ui.open() + ui.set_auto_update(1) + +/obj/machinery/computer/aifixer/ui_data(mob/user, datum/topic_state/state) var/data[0] if(occupant) data["occupant"] = occupant.name @@ -49,13 +57,7 @@ data["laws"] = laws - ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open) - - if(!ui) - ui = new(user, src, ui_key, "ai_fixer.tmpl", "AI System Integrity Restorer", 550, 500) - ui.set_initial_data(data) - ui.open() - ui.set_auto_update(1) + return data /obj/machinery/computer/aifixer/Topic(href, href_list) if(..()) diff --git a/code/game/machinery/computer/atmos_alert.dm b/code/game/machinery/computer/atmos_alert.dm index cecf755b37d..ea53374970a 100644 --- a/code/game/machinery/computer/atmos_alert.dm +++ b/code/game/machinery/computer/atmos_alert.dm @@ -24,6 +24,13 @@ var/global/list/minor_air_alarms = list() ui_interact(user) /obj/machinery/computer/atmos_alert/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1) + ui = nanomanager.try_update_ui(user, src, ui_key, ui, force_open) + if(!ui) + ui = new(user, src, ui_key, "atmos_alert.tmpl", src.name, 500, 500) + ui.open() + ui.set_auto_update(1) + +/obj/machinery/computer/atmos_alert/ui_data(mob/user, datum/topic_state/state) var/data[0] var/major_alarms[0] var/minor_alarms[0] @@ -37,12 +44,7 @@ var/global/list/minor_air_alarms = list() data["priority_alarms"] = major_alarms data["minor_alarms"] = minor_alarms - ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open) - if(!ui) - ui = new(user, src, ui_key, "atmos_alert.tmpl", src.name, 500, 500) - ui.set_initial_data(data) - ui.open() - ui.set_auto_update(1) + return data /obj/machinery/computer/atmos_alert/update_icon() var/list/alarms = atmosphere_alarm.major_alarms() diff --git a/code/game/machinery/computer/camera.dm b/code/game/machinery/computer/camera.dm index 97a976ddc41..57718687660 100644 --- a/code/game/machinery/computer/camera.dm +++ b/code/game/machinery/computer/camera.dm @@ -45,7 +45,7 @@ /obj/machinery/computer/security/check_eye(var/mob/user as mob) if((get_dist(user, src) > 1 || !( user.canmove ) || user.blinded || !( current ) || !( current.status )) && (!istype(user, /mob/living/silicon))) return null - user.reset_view(current) + user.reset_perspective(current) return 1 // Network configuration @@ -70,6 +70,17 @@ if(user.stat) return + ui = nanomanager.try_update_ui(user, src, ui_key, ui, force_open) + if(!ui) + ui = new(user, src, ui_key, "sec_camera.tmpl", "Camera Console", 900, 800) + // adding a template with the key "mapContent" enables the map ui functionality + ui.add_template("mapContent", "sec_camera_map_content.tmpl") + // adding a template with the key "mapHeader" replaces the map header content + ui.add_template("mapHeader", "sec_camera_map_header.tmpl") + ui.open() + ui.set_auto_update(1) + +/obj/machinery/computer/security/ui_data(mob/user, datum/topic_state/state = default_state) var/data[0] data["current"] = null @@ -115,18 +126,7 @@ if(current) data["current"] = current.nano_structure() - ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open) - if(!ui) - ui = new(user, src, ui_key, "sec_camera.tmpl", "Camera Console", 900, 800) - - // adding a template with the key "mapContent" enables the map ui functionality - ui.add_template("mapContent", "sec_camera_map_content.tmpl") - // adding a template with the key "mapHeader" replaces the map header content - ui.add_template("mapHeader", "sec_camera_map_header.tmpl") - - ui.set_initial_data(data) - ui.open() - ui.set_auto_update(1) + return data /obj/machinery/computer/security/Topic(href, href_list) if(..()) @@ -138,10 +138,10 @@ var/obj/machinery/camera/C = locate(href_list["switchTo"]) in cameranet.cameras if(!C) return 1 - + if(!can_access_camera(C)) return 1 // No href exploits for you. - + switch_to_camera(usr, C) else if(href_list["reset"]) diff --git a/code/game/machinery/computer/camera_advanced.dm b/code/game/machinery/computer/camera_advanced.dm index ea3ba02ea1f..3d1df935cf8 100644 --- a/code/game/machinery/computer/camera_advanced.dm +++ b/code/game/machinery/computer/camera_advanced.dm @@ -41,61 +41,73 @@ return if(!iscarbon(user)) return - var/mob/living/carbon/L = user - - if(!current_user) - user.set_machine(src) - if(!eyeobj) - CreateEye() - GrantActions(user) - current_user = user - eyeobj.user = user - eyeobj.name = "Camera Eye ([user.name])" - L.remote_view = 1 - L.remote_control = eyeobj - L.client.perspective = EYE_PERSPECTIVE - if(!eyeobj.initialized) - for(var/obj/machinery/camera/C in cameranet.cameras) - if(!C.can_use()) - continue - if(C.network&networks) - eyeobj.setLoc(get_turf(C)) - break - eyeobj.initialized = 1 - else - eyeobj.setLoc(eyeobj.loc) - else + if(current_user) to_chat(user, "The console is already in use!") + return + + user.set_machine(src) + if(!eyeobj) + CreateEye() + if(!eyeobj.initialized) + var/camera_location + for(var/obj/machinery/camera/C in cameranet.cameras) + if(!C.can_use()) + continue + if(C.network&networks) + camera_location = get_turf(C) + break + if(camera_location) + eyeobj.initialized = 1 + give_eye_control(user) + eyeobj.setLoc(camera_location) + else + // An abberant case - silent failure is obnoxious + to_chat(user, "ERROR: No linked and active camera network found.") + user.unset_machine() + else + give_eye_control(user) + + +/obj/machinery/computer/camera_advanced/proc/give_eye_control(mob/user) + GrantActions(user) + current_user = user + eyeobj.eye_user = user + eyeobj.name = "Camera Eye ([user.name])" + // This should be able to be excised once the full view refactor rolls out + user.remote_view = 1 + user.remote_control = eyeobj + user.reset_perspective(eyeobj) + eyeobj.setLoc(eyeobj.loc) /mob/camera/aiEye/remote name = "Inactive Camera Eye" var/sprint = 10 var/cooldown = 0 var/acceleration = 1 - var/mob/living/carbon/human/user = null + var/mob/living/carbon/human/eye_user = null var/obj/machinery/computer/camera_advanced/origin var/initialized = 0 var/visible_icon = 0 var/image/user_image = null /mob/camera/aiEye/remote/GetViewerClient() - if(user) - return user.client + if(eye_user) + return eye_user.client return null /mob/camera/aiEye/remote/setLoc(T) - if(user) - if(!isturf(user.loc)) + if(eye_user) + if(!isturf(eye_user.loc)) return T = get_turf(T) loc = T cameranet.visibility(src) - if(user.client) + if(eye_user.client) if(visible_icon) - user.client.images -= user_image + eye_user.client.images -= user_image user_image = image(icon,loc,icon_state,FLY_LAYER) - user.client.images += user_image - user.client.eye = src + eye_user.client.images += user_image + eye_user.client.eye = src /mob/camera/aiEye/remote/relaymove(mob/user,direct) var/initial = initial(sprint) @@ -127,10 +139,9 @@ C.remote_view = 0 remote_eye.origin.current_user = null remote_eye.origin.jump_action.Remove(C) - remote_eye.user = null + remote_eye.eye_user = null + C.reset_perspective(null) if(C.client) - C.client.perspective = MOB_PERSPECTIVE - C.client.eye = src C.client.images -= remote_eye.user_image for(var/datum/camerachunk/chunk in remote_eye.visibleCameraChunks) C.client.images -= chunk.obscured diff --git a/code/game/machinery/computer/card.dm b/code/game/machinery/computer/card.dm index 7e78232de4d..a33d3aa02eb 100644 --- a/code/game/machinery/computer/card.dm +++ b/code/game/machinery/computer/card.dm @@ -173,9 +173,15 @@ var/time_last_changed_position = 0 ui_interact(user) -/obj/machinery/computer/card/ui_interact(mob/user, ui_key="main", var/datum/nanoui/ui = null, var/force_open = 1) +/obj/machinery/computer/card/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1) user.set_machine(src) + ui = nanomanager.try_update_ui(user, src, ui_key, ui, force_open) + if(!ui) + ui = new(user, src, ui_key, "identification_computer.tmpl", src.name, 775, 700) + ui.open() + +/obj/machinery/computer/card/ui_data(mob/user, datum/topic_state/state = default_state) var/data[0] data["src"] = UID() data["station_name"] = station_name() @@ -242,11 +248,7 @@ var/time_last_changed_position = 0 data["regions"] = regions - ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open) - if(!ui) - ui = new(user, src, ui_key, "identification_computer.tmpl", src.name, 775, 700) - ui.set_initial_data(data) - ui.open() + return data /obj/machinery/computer/card/Topic(href, href_list) if(..()) diff --git a/code/game/machinery/computer/cloning.dm b/code/game/machinery/computer/cloning.dm index 4afe9ba3cff..847f20a3f23 100644 --- a/code/game/machinery/computer/cloning.dm +++ b/code/game/machinery/computer/cloning.dm @@ -120,6 +120,14 @@ /obj/machinery/computer/cloning/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1) if(stat & (NOPOWER|BROKEN)) return + + // Set up the Nano UI + ui = nanomanager.try_update_ui(user, src, ui_key, ui, force_open) + if(!ui) + ui = new(user, src, ui_key, "cloning_console.tmpl", "Cloning Console UI", 640, 520) + ui.open() + +/obj/machinery/computer/cloning/ui_data(mob/user, datum/topic_state/state = default_state) var/data[0] data["menu"] = src.menu data["scanner"] = sanitize("[src.scanner]") @@ -175,12 +183,7 @@ else data["podready"] = 0 - // Set up the Nano UI - ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open) - if(!ui) - ui = new(user, src, ui_key, "cloning_console.tmpl", "Cloning Console UI", 640, 520) - ui.set_initial_data(data) - ui.open() + return data /obj/machinery/computer/cloning/Topic(href, href_list) if(..()) diff --git a/code/game/machinery/computer/communications.dm b/code/game/machinery/computer/communications.dm index 291824c8c30..7420aaaa24a 100644 --- a/code/game/machinery/computer/communications.dm +++ b/code/game/machinery/computer/communications.dm @@ -69,14 +69,14 @@ var/list/access = usr.get_access() if(allowed(usr)) authenticated = COMM_AUTHENTICATION_MIN - + if(access_captain in access) authenticated = COMM_AUTHENTICATION_MAX var/mob/living/carbon/human/H = usr var/obj/item/weapon/card/id = H.get_idcard(TRUE) if(istype(id)) crew_announcement.announcer = GetNameAndAssignmentFromId(id) - + nanomanager.update_uis(src) return @@ -313,7 +313,16 @@ ui_interact(user) /obj/machinery/computer/communications/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null) - // this is the data which will be sent to the ui + // update the ui if it exists, returns null if no ui is passed/found + ui = nanomanager.try_update_ui(user, src, ui_key, ui) + if(!ui) + // 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, "comm_console.tmpl", "Communications Console", 400, 500) + // open the new ui window + ui.open() + +/obj/machinery/computer/communications/ui_data(mob/user, datum/topic_state/state = default_state) var/data[0] data["is_ai"] = isAI(user)||isrobot(user) data["menu_state"] = data["is_ai"] ? ai_menu_state : menu_state @@ -377,16 +386,8 @@ else data["dock_request"] = 0 - // update the ui if it exists, returns null if no ui is passed/found - ui = nanomanager.try_update_ui(user, src, ui_key, ui, data) - if(!ui) - // 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, "comm_console.tmpl", "Communications Console", 400, 500) - // 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() + return data + /obj/machinery/computer/communications/proc/setCurrentMessage(var/mob/user,var/value) if(isAI(user) || isrobot(user)) diff --git a/code/game/machinery/computer/pod_tracking_console.dm b/code/game/machinery/computer/pod_tracking_console.dm index cf16c34e04d..8664d786a24 100644 --- a/code/game/machinery/computer/pod_tracking_console.dm +++ b/code/game/machinery/computer/pod_tracking_console.dm @@ -14,6 +14,13 @@ ui_interact(user) /obj/machinery/computer/podtracker/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1) + ui = nanomanager.try_update_ui(user, src, ui_key, ui, force_open) + if(!ui) + ui = new(user, src, ui_key, "pod_tracking.tmpl", "Pod Tracking Console", 400, 500) + ui.open() + ui.set_auto_update(1) + +/obj/machinery/computer/podtracker/ui_data(mob/user, datum/topic_state/state = default_state) var/data[0] var/list/pods[0] for(var/obj/item/device/spacepod_equipment/misc/tracker/TR in world) @@ -33,14 +40,7 @@ pods.Add(list(list("pod" = "\ref[my_pod]", "name" = podname) + chairs + list("x" = my_pod.x, "y" = my_pod.y, "z" = my_pod.z))) data["pods"] = pods - - ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open) - - if(!ui) - ui = new(user, src, ui_key, "pod_tracking.tmpl", "Pod Tracking Console", 400, 500) - ui.set_initial_data(data) - ui.open() - ui.set_auto_update(1) + return data /obj/machinery/computer/podtracker/Topic(href, href_list) if(..()) diff --git a/code/game/machinery/computer/robot.dm b/code/game/machinery/computer/robot.dm index 160fbeb9827..6f7e3391457 100644 --- a/code/game/machinery/computer/robot.dm +++ b/code/game/machinery/computer/robot.dm @@ -35,6 +35,13 @@ return 0 /obj/machinery/computer/robotics/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1) + ui = nanomanager.try_update_ui(user, src, ui_key, ui, force_open) + if(!ui) + ui = new(user, src, ui_key, "robot_control.tmpl", "Robotic Control Console", 400, 500) + ui.open() + ui.set_auto_update(1) + +/obj/machinery/computer/robotics/ui_data(mob/user, datum/topic_state/state = default_state) var/data[0] var/list/robots = get_cyborgs(user) if(robots.len) @@ -43,14 +50,7 @@ // Also applies for cyborgs. Hides the manual self-destruct button. data["is_ai"] = issilicon(user) data["allowed"] = is_authenticated(user) - - - ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open) - if(!ui) - ui = new(user, src, ui_key, "robot_control.tmpl", "Robotic Control Console", 400, 500) - ui.set_initial_data(data) - ui.open() - ui.set_auto_update(1) + return data /obj/machinery/computer/robotics/Topic(href, href_list) if(..()) @@ -242,4 +242,4 @@ return for(var/mob/living/silicon/robot/R in mob_list) if(R.name == name) - return R \ No newline at end of file + return R diff --git a/code/game/machinery/cryo.dm b/code/game/machinery/cryo.dm index 99ff973ca76..f42650a8e86 100644 --- a/code/game/machinery/cryo.dm +++ b/code/game/machinery/cryo.dm @@ -122,7 +122,7 @@ ..() if(autoeject) if(occupant) - if(occupant.health >= 100) + if(!occupant.has_organic_damage()) on = 0 go_out() playsound(src.loc, 'sound/machines/ding.ogg', 50, 1) @@ -179,7 +179,18 @@ * @return nothing */ /obj/machinery/atmospherics/unary/cryo_cell/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1) - // this is the data which will be sent to the ui + // update the ui if it exists, returns null if no ui is passed/found + ui = nanomanager.try_update_ui(user, src, ui_key, ui, force_open) + if(!ui) + // 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, "cryo.tmpl", "Cryo Cell Control System", 520, 420) + // open the new ui window + ui.open() + // auto update every Master Controller tick + ui.set_auto_update(1) + +/obj/machinery/atmospherics/unary/cryo_cell/ui_data(mob/user, datum/topic_state/state = default_state) var/data[0] data["isOperating"] = on data["hasOccupant"] = occupant ? 1 : 0 @@ -206,13 +217,6 @@ data["cellTemperatureStatus"] = "average" data["isBeakerLoaded"] = beaker ? 1 : 0 - /* // Removing beaker contents list from front-end, replacing with a total remaining volume - var beakerContents[0] - if(beaker && beaker.reagents && beaker.reagents.reagent_list.len) - for(var/datum/reagent/R in beaker.reagents.reagent_list) - beakerContents.Add(list(list("name" = R.name, "volume" = R.volume))) // list in a list because Byond merges the first list... - data["beakerContents"] = beakerContents - */ data["beakerLabel"] = null data["beakerVolume"] = 0 if(beaker) @@ -222,19 +226,7 @@ data["beakerVolume"] += R.volume data["autoeject"] = autoeject - - // update the ui if it exists, returns null if no ui is passed/found - ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open) - if(!ui) - // 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, "cryo.tmpl", "Cryo Cell Control System", 520, 420) - // 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() - // auto update every Master Controller tick - ui.set_auto_update(1) + return data /obj/machinery/atmospherics/unary/cryo_cell/Topic(href, href_list) if(usr == occupant) @@ -406,9 +398,6 @@ /obj/machinery/atmospherics/unary/cryo_cell/proc/go_out() if(!occupant) return - if(occupant.client) - occupant.client.eye = occupant.client.mob - occupant.client.perspective = MOB_PERSPECTIVE occupant.forceMove(get_step(loc, SOUTH)) //this doesn't account for walls or anything, but i don't forsee that being a problem. if(occupant.bodytemperature < 261 && occupant.bodytemperature >= 70) //Patch by Aranclanos to stop people from taking burn damage after being ejected occupant.bodytemperature = 261 @@ -431,9 +420,6 @@ if(!node) to_chat(usr, "\red The cell is not correctly connected to its pipe network!") return - if(M.client) - M.client.perspective = EYE_PERSPECTIVE - M.client.eye = src M.stop_pulling() M.forceMove(src) if(M.health > -100 && (M.health < 0 || M.sleeping)) @@ -494,3 +480,9 @@ /datum/data/function/proc/display() return + +/obj/machinery/atmospherics/components/unary/cryo_cell/get_remote_view_fullscreens(mob/user) + user.overlay_fullscreen("remote_view", /obj/screen/fullscreen/impaired, 1) + +/obj/machinery/atmospherics/components/unary/cryo_cell/update_remote_sight(mob/living/user) + return //we don't see the pipe network while inside cryo. diff --git a/code/game/machinery/cryopod.dm b/code/game/machinery/cryopod.dm index 4c462b5a05c..e48a5f44b32 100644 --- a/code/game/machinery/cryopod.dm +++ b/code/game/machinery/cryopod.dm @@ -442,11 +442,7 @@ to_chat(user, "\The [src] is in use.") return - M.loc = src - - if(M.client) - M.client.perspective = EYE_PERSPECTIVE - M.client.eye = src + M.forceMove(src) time_till_despawn = initial(time_till_despawn) / willing @@ -540,12 +536,8 @@ if(src.occupant) to_chat(user, "\The [src] is in use.") return - L.loc = src + L.forceMove(src) time_till_despawn = initial(time_till_despawn) / willing - - if(L.client) - L.client.perspective = EYE_PERSPECTIVE - L.client.eye = src else to_chat(user, "You stop [L == user ? "climbing into the cryo pod." : "putting [L] into the cryo pod."]") return @@ -637,9 +629,7 @@ return usr.stop_pulling() - usr.client.perspective = EYE_PERSPECTIVE - usr.client.eye = src - usr.loc = src + usr.forceMove(src) src.occupant = usr time_till_despawn = initial(time_till_despawn) / willing_time_divisor @@ -662,11 +652,7 @@ if(!occupant) return - if(occupant.client) - occupant.client.eye = src.occupant.client.mob - occupant.client.perspective = MOB_PERSPECTIVE - - occupant.loc = get_turf(src) + occupant.forceMove(get_turf(src)) occupant = null if(orient_right) diff --git a/code/game/machinery/doors/airlock.dm b/code/game/machinery/doors/airlock.dm index e27a44180fa..fe21020af5d 100644 --- a/code/game/machinery/doors/airlock.dm +++ b/code/game/machinery/doors/airlock.dm @@ -560,6 +560,13 @@ About the new airlock wires panel: ui_interact(user) /obj/machinery/door/airlock/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1) + ui = nanomanager.try_update_ui(user, src, ui_key, ui, force_open) + if(!ui) + ui = new(user, src, ui_key, "door_control.tmpl", "Door Controls - [src]", 600, 375) + ui.open() + ui.set_auto_update(1) + +/obj/machinery/door/airlock/ui_data(mob/user, datum/topic_state/state = default_state) var/data[0] data["main_power_loss"] = round(main_power_lost_until > 0 ? max(main_power_lost_until - world.time, 0) / 10 : main_power_lost_until, 1) @@ -568,22 +575,16 @@ About the new airlock wires panel: data["open"] = !density var/commands[0] - commands[++commands.len] = list("name" = "IdScan", "command"= "idscan", "active" = !aiDisabledIdScanner, "enabled" = "Enabled", "disabled" = "Disable", "danger" = 0, "act" = 1) - commands[++commands.len] = list("name" = "Bolts", "command"= "bolts", "active" = !locked, "enabled" = "Raised", "disabled" = "Dropped", "danger" = 0, "act" = 0) - commands[++commands.len] = list("name" = "Bolt Lights", "command"= "lights", "active" = lights, "enabled" = "Enabled", "disabled" = "Disable", "danger" = 0, "act" = 1) - commands[++commands.len] = list("name" = "Safeties", "command"= "safeties", "active" = safe, "enabled" = "Nominal", "disabled" = "Overridden", "danger" = 1, "act" = 0) - commands[++commands.len] = list("name" = "Timing", "command"= "timing", "active" = normalspeed, "enabled" = "Nominal", "disabled" = "Overridden", "danger" = 1, "act" = 0) - commands[++commands.len] = list("name" = "Door State", "command"= "open", "active" = density, "enabled" = "Closed", "disabled" = "Opened", "danger" = 0, "act" = 0) - commands[++commands.len] = list("name" = "Emergency Access", "command"= "emergency", "active" = !emergency, "enabled" = "Disabled", "disabled" = "Enabled", "danger" = 0, "act" = 0) + commands[++commands.len] = list("name" = "IdScan", "command"= "idscan", "active" = !aiDisabledIdScanner,"enabled" = "Enabled", "disabled" = "Disable", "danger" = 0, "act" = 1) + commands[++commands.len] = list("name" = "Bolts", "command"= "bolts", "active" = !locked, "enabled" = "Raised", "disabled" = "Dropped", "danger" = 0, "act" = 0) + commands[++commands.len] = list("name" = "Bolt Lights", "command"= "lights", "active" = lights, "enabled" = "Enabled", "disabled" = "Disable", "danger" = 0, "act" = 1) + commands[++commands.len] = list("name" = "Safeties", "command"= "safeties", "active" = safe, "enabled" = "Nominal", "disabled" = "Overridden", "danger" = 1, "act" = 0) + commands[++commands.len] = list("name" = "Timing", "command"= "timing", "active" = normalspeed, "enabled" = "Nominal", "disabled" = "Overridden", "danger" = 1, "act" = 0) + commands[++commands.len] = list("name" = "Door State", "command"= "open", "active" = density, "enabled" = "Closed", "disabled" = "Opened", "danger" = 0, "act" = 0) + commands[++commands.len] = list("name" = "Emergency Access","command"= "emergency", "active" = !emergency, "enabled" = "Disabled", "disabled" = "Enabled", "danger" = 0, "act" = 0) data["commands"] = commands - - ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open) - if(!ui) - ui = new(user, src, ui_key, "door_control.tmpl", "Door Controls - [src]", 600, 375) - ui.set_initial_data(data) - ui.open() - ui.set_auto_update(1) + return data /obj/machinery/door/airlock/proc/hack(mob/user as mob) if(src.aiHacking==0) diff --git a/code/game/machinery/embedded_controller/airlock_controllers.dm b/code/game/machinery/embedded_controller/airlock_controllers.dm index 2b336859127..d9be59bde59 100644 --- a/code/game/machinery/embedded_controller/airlock_controllers.dm +++ b/code/game/machinery/embedded_controller/airlock_controllers.dm @@ -21,6 +21,13 @@ name = "Advanced Airlock Controller" /obj/machinery/embedded_controller/radio/airlock/advanced_airlock_controller/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1) + ui = nanomanager.try_update_ui(user, src, ui_key, ui, force_open) + if(!ui) + ui = new(user, src, ui_key, "advanced_airlock_console.tmpl", name, 470, 290) + ui.open() + ui.set_auto_update(1) + +/obj/machinery/embedded_controller/radio/airlock/advanced_airlock_controller/ui_data(mob/user, datum/topic_state/state = default_state) var/data[0] data = list( @@ -32,16 +39,7 @@ "secure" = program.memory["secure"] ) - ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open) - - if(!ui) - ui = new(user, src, ui_key, "advanced_airlock_console.tmpl", name, 470, 290) - - ui.set_initial_data(data) - - ui.open() - - ui.set_auto_update(1) + return data /obj/machinery/embedded_controller/radio/airlock/advanced_airlock_controller/Topic(href, href_list) if(..()) @@ -79,6 +77,13 @@ tag_secure = 1 /obj/machinery/embedded_controller/radio/airlock/airlock_controller/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1) + ui = nanomanager.try_update_ui(user, src, ui_key, ui, force_open) + if(!ui) + ui = new(user, src, ui_key, "simple_airlock_console.tmpl", name, 470, 290) + ui.open() + ui.set_auto_update(1) + +/obj/machinery/embedded_controller/radio/airlock/airlock_controller/ui_data(mob/user, datum/topic_state/state = default_state) var/data[0] data = list( @@ -88,16 +93,7 @@ "processing" = program.memory["processing"], ) - ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open) - - if(!ui) - ui = new(user, src, ui_key, "simple_airlock_console.tmpl", name, 470, 290) - - ui.set_initial_data(data) - - ui.open() - - ui.set_auto_update(1) + return data /obj/machinery/embedded_controller/radio/airlock/airlock_controller/Topic(href, href_list) if(..()) @@ -144,6 +140,13 @@ icon_state = "access_control_off" /obj/machinery/embedded_controller/radio/airlock/access_controller/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1) + ui = nanomanager.try_update_ui(user, src, ui_key, ui, force_open) + if(!ui) + ui = new(user, src, ui_key, "door_access_console.tmpl", name, 330, 220) + ui.open() + ui.set_auto_update(1) + +/obj/machinery/embedded_controller/radio/airlock/access_controller/ui_data(mob/user, datum/topic_state/state = default_state) var/data[0] data = list( @@ -152,16 +155,7 @@ "processing" = program.memory["processing"] ) - ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open) - - if(!ui) - ui = new(user, src, ui_key, "door_access_console.tmpl", name, 330, 220) - - ui.set_initial_data(data) - - ui.open() - - ui.set_auto_update(1) + return data /obj/machinery/embedded_controller/radio/airlock/access_controller/Topic(href, href_list) if(..()) @@ -186,4 +180,4 @@ if(clean) program.receive_user_command(href_list["command"]) - return 1 \ No newline at end of file + return 1 diff --git a/code/game/machinery/firealarm.dm b/code/game/machinery/firealarm.dm index fcf9d56b355..b1f7d33244d 100644 --- a/code/game/machinery/firealarm.dm +++ b/code/game/machinery/firealarm.dm @@ -174,6 +174,13 @@ FIRE ALARM ui_interact(user) /obj/machinery/firealarm/ui_interact(mob/user, ui_key = "main", datum/nanoui/ui = null, force_open = 1, var/master_ui = null, var/datum/topic_state/state = default_state) + ui = nanomanager.try_update_ui(user, src, ui_key, ui, force_open) + if(!ui) + ui = new(user, src, ui_key, "firealarm.tmpl", name, 400, 400, state = state) + ui.open() + ui.set_auto_update(1) + +/obj/machinery/firealarm/ui_data(mob/user, datum/topic_state/state = default_state) var/data[0] var/area/A = get_area(src) @@ -186,16 +193,7 @@ FIRE ALARM var/minute = round(time / 60) data["time_left"] = "[minute ? "[minute]:" : ""][add_zero(num2text(second), 2)]" - - ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open) - if(!ui) - ui = new(user, src, ui_key, "firealarm.tmpl", name, 400, 400, state = state) - ui.set_initial_data(data) - ui.open() - ui.set_auto_update(1) - - - + return data /obj/machinery/firealarm/Topic(href, href_list) if(..()) diff --git a/code/game/machinery/poolcontroller.dm b/code/game/machinery/poolcontroller.dm index 452408ccdaa..80f5e8be5d7 100644 --- a/code/game/machinery/poolcontroller.dm +++ b/code/game/machinery/poolcontroller.dm @@ -130,18 +130,19 @@ /obj/machinery/poolcontroller/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1) + ui = nanomanager.try_update_ui(user, src, ui_key, ui, force_open) + if(!ui) + ui = new(user, src, ui_key, "poolcontroller.tmpl", "Pool Controller Interface", 520, 410) + ui.open() + +/obj/machinery/poolcontroller/ui_data(mob/user, datum/topic_state/state = default_state) var/data[0] data["currentTemp"] = temperature data["emagged"] = emagged data["TempColor"] = temperaturecolor - ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open) - if(!ui) - ui = new(user, src, ui_key, "poolcontroller.tmpl", "Pool Controller Interface", 520, 410) - ui.set_initial_data(data) - ui.open() - + return data /obj/machinery/poolcontroller/Topic(href, href_list) diff --git a/code/game/machinery/portable_tag_turret.dm b/code/game/machinery/portable_tag_turret.dm index deafad7f9b7..de78d46178f 100644 --- a/code/game/machinery/portable_tag_turret.dm +++ b/code/game/machinery/portable_tag_turret.dm @@ -43,18 +43,19 @@ iconholder = 1 /obj/machinery/porta_turret/tag/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1) + ui = nanomanager.try_update_ui(user, src, ui_key, ui, force_open) + if(!ui) + ui = new(user, src, ui_key, "turret_control.tmpl", "Turret Controls", 500, 300) + ui.open() + ui.set_auto_update(1) + +/obj/machinery/porta_turret/tag/ui_data(mob/user, datum/topic_state/state = default_state) var/data[0] data["access"] = !isLocked(user) data["locked"] = locked data["enabled"] = enabled data["is_lethal"] = 0 - - ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open) - if(!ui) - ui = new(user, src, ui_key, "turret_control.tmpl", "Turret Controls", 500, 300) - ui.set_initial_data(data) - ui.open() - ui.set_auto_update(1) + return data /obj/machinery/porta_turret/tag/update_icon() if(!anchored) @@ -121,4 +122,4 @@ if(istype(H.belt, target_weapon)) return TURRET_SECONDARY_TARGET - return TURRET_NOT_TARGET \ No newline at end of file + return TURRET_NOT_TARGET diff --git a/code/game/machinery/portable_turret.dm b/code/game/machinery/portable_turret.dm index 83f2dfef93f..a6eb360f45d 100644 --- a/code/game/machinery/portable_turret.dm +++ b/code/game/machinery/portable_turret.dm @@ -194,6 +194,13 @@ var/list/turret_icons ui_interact(user) /obj/machinery/porta_turret/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1) + ui = nanomanager.try_update_ui(user, src, ui_key, ui, force_open) + if(!ui) + ui = new(user, src, ui_key, "turret_control.tmpl", "Turret Controls", 500, 320) + ui.open() + ui.set_auto_update(1) + +/obj/machinery/porta_turret/ui_data(mob/user, datum/topic_state/state = default_state) var/data[0] data["access"] = !isLocked(user) data["screen"] = screen @@ -224,13 +231,7 @@ var/list/turret_icons active = (access in req_access) accesses[++accesses.len] = list("name" = name, "active" = active, "number" = access) data["accesses"] = accesses - - ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open) - if(!ui) - ui = new(user, src, ui_key, "turret_control.tmpl", "Turret Controls", 500, 320) - ui.set_initial_data(data) - ui.open() - ui.set_auto_update(1) + return data /obj/machinery/porta_turret/proc/HasController() var/area/A = get_area(src) diff --git a/code/game/machinery/programmable_unloader.dm b/code/game/machinery/programmable_unloader.dm index 3bed121322b..e41dfd2f79f 100644 --- a/code/game/machinery/programmable_unloader.dm +++ b/code/game/machinery/programmable_unloader.dm @@ -297,10 +297,8 @@ O.loc = loc for(var/mob/M in contents) M.loc = loc - if(M.client) - M.client.eye = M.client.mob - M.client.perspective = MOB_PERSPECTIVE - to_chat(M, "\blue The machine turns off, and you fall out.") + M.reset_perspective(null) + to_chat(M, "The machine turns off, and you fall out.") return diff --git a/code/game/machinery/rechargestation.dm b/code/game/machinery/rechargestation.dm index 342b24fa055..ac88d755561 100644 --- a/code/game/machinery/rechargestation.dm +++ b/code/game/machinery/rechargestation.dm @@ -166,17 +166,12 @@ H.updatehealth() /obj/machinery/recharge_station/proc/go_out() - if(!( src.occupant )) + if(!occupant) return - //for(var/obj/O in src) - // O.loc = src.loc - if(src.occupant.client) - src.occupant.client.eye = src.occupant.client.mob - src.occupant.client.perspective = MOB_PERSPECTIVE - src.occupant.loc = src.loc - src.occupant = null + occupant.forceMove(loc) + occupant = null build_icon() - src.use_power = 1 + use_power = 1 return /obj/machinery/recharge_station/proc/restock_modules() @@ -300,9 +295,6 @@ return user.stop_pulling() - if(user && user.client) - user.client.perspective = EYE_PERSPECTIVE - user.client.eye = src user.forceMove(src) occupant = user diff --git a/code/game/machinery/requests_console.dm b/code/game/machinery/requests_console.dm index 7bf9b661a24..9de1806852f 100644 --- a/code/game/machinery/requests_console.dm +++ b/code/game/machinery/requests_console.dm @@ -109,6 +109,13 @@ var/list/obj/machinery/requests_console/allConsoles = list() ui_interact(user) /obj/machinery/requests_console/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1) + ui = nanomanager.try_update_ui(user, src, ui_key, ui, force_open) + if(!ui) + ui = new(user, src, ui_key, "request_console.tmpl", "[department] Request Console", 520, 410) + ui.open() + ui.set_auto_update(1) + +/obj/machinery/requests_console/ui_data(mob/user, datum/topic_state/state = default_state) var/data[0] data["department"] = department @@ -129,12 +136,7 @@ var/list/obj/machinery/requests_console/allConsoles = list() data["msgVerified"] = msgVerified data["announceAuth"] = announceAuth - ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open) - if(!ui) - ui = new(user, src, ui_key, "request_console.tmpl", "[department] Request Console", 520, 410) - ui.set_initial_data(data) - ui.open() - ui.set_auto_update(1) + return data /obj/machinery/requests_console/Topic(href, href_list) if(..()) diff --git a/code/game/machinery/slotmachine.dm b/code/game/machinery/slotmachine.dm index 9705ef9dedd..c72e987cd92 100644 --- a/code/game/machinery/slotmachine.dm +++ b/code/game/machinery/slotmachine.dm @@ -22,6 +22,13 @@ ui_interact(user) /obj/machinery/slot_machine/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1) + ui = nanomanager.try_update_ui(user, src, ui_key, ui, force_open) + if(!ui) + ui = new(user, src, ui_key, "slotmachine.tmpl", name, 350, 200) + ui.open() + ui.set_auto_update(1) + +/obj/machinery/slot_machine/ui_data(mob/user, datum/topic_state/state = default_state) var/data[0] data["working"] = working @@ -30,12 +37,7 @@ data["result"] = result data["resultlvl"] = resultlvl - ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open) - if(!ui) - ui = new(user, src, ui_key, "slotmachine.tmpl", name, 350, 200) - ui.set_initial_data(data) - ui.open() - ui.set_auto_update(1) + return data /obj/machinery/slot_machine/Topic(href, href_list) add_fingerprint(usr) @@ -112,4 +114,4 @@ T.amount = "[amt]" T.date = current_date_string T.time = worldtime2text() - account.transaction_log.Add(T) \ No newline at end of file + account.transaction_log.Add(T) diff --git a/code/game/machinery/suit_storage_unit.dm b/code/game/machinery/suit_storage_unit.dm index d48a21709c0..b50fc3566d8 100644 --- a/code/game/machinery/suit_storage_unit.dm +++ b/code/game/machinery/suit_storage_unit.dm @@ -430,27 +430,21 @@ /obj/machinery/suit_storage_unit/proc/eject_occupant(mob/user as mob) - if(src.islocked) + if(islocked) return - if(!src.OCCUPANT) + if(!OCCUPANT) return -// for(var/obj/O in src) -// O.loc = src.loc - if(src.OCCUPANT.client) - if(user != OCCUPANT) - to_chat(OCCUPANT, "The machine kicks you out!") - if(user.loc != src.loc) - to_chat(OCCUPANT, "You leave the not-so-cozy confines of the SSU.") - - src.OCCUPANT.client.eye = src.OCCUPANT.client.mob - src.OCCUPANT.client.perspective = MOB_PERSPECTIVE - src.OCCUPANT.loc = src.loc - src.OCCUPANT = null - if(!src.isopen) - src.isopen = 1 - src.update_icon() + if(user != OCCUPANT) + to_chat(OCCUPANT, "The machine kicks you out!") + if(user.loc != loc) + to_chat(OCCUPANT, "You leave the not-so-cozy confines of the SSU.") + OCCUPANT.forceMove(loc) + OCCUPANT = null + if(!isopen) + isopen = 1 + update_icon() return @@ -487,9 +481,7 @@ visible_message("[usr] starts squeezing into the suit storage unit!") if(do_after(usr, 10, target = usr)) usr.stop_pulling() - usr.client.perspective = EYE_PERSPECTIVE - usr.client.eye = src - usr.loc = src + usr.forceMove(src) // usr.metabslow = 1 src.OCCUPANT = usr src.isopen = 0 //Close the thing after the guy gets inside @@ -532,10 +524,7 @@ if(do_after(user, 20, target = G:affecting)) if(!G || !G.affecting) return //derpcheck var/mob/M = G.affecting - if(M.client) - M.client.perspective = EYE_PERSPECTIVE - M.client.eye = src - M.loc = src + M.forceMove(src) src.OCCUPANT = M src.isopen = 0 //close ittt @@ -690,10 +679,7 @@ if(do_after(user, 20, target = G:affecting)) if(!G || !G.affecting) return var/mob/M = G.affecting - if(M.client) - M.client.perspective = EYE_PERSPECTIVE - M.client.eye = src - M.loc = src + M.forceMove(src) src.occupant = M src.add_fingerprint(user) @@ -999,16 +985,12 @@ if(!occupant) return - if(occupant.client) - occupant.client.eye = occupant.client.mob - occupant.client.perspective = MOB_PERSPECTIVE - - occupant.loc = get_turf(occupant) + occupant.forceMove(loc) occupant = null add_fingerprint(usr) - src.updateUsrDialog() - src.update_icon() + updateUsrDialog() + update_icon() return /* diff --git a/code/game/machinery/teleporter.dm b/code/game/machinery/teleporter.dm index 369cb0fc708..0fec852c2f5 100644 --- a/code/game/machinery/teleporter.dm +++ b/code/game/machinery/teleporter.dm @@ -11,7 +11,6 @@ var/calibrating var/turf/target //Used for one-time-use teleport cards (such as clown planet coordinates.) //Setting this to 1 will set src.locked to null after a player enters the portal and will not allow hand-teles to open portals to that location. - var/data[0] /obj/machinery/computer/teleporter/New() src.id = "[rand(1000, 9999)]" @@ -67,11 +66,17 @@ ui_interact(user) /obj/machinery/computer/teleporter/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1) - if(..()) - return if(stat & (NOPOWER|BROKEN)) return + // Set up the Nano UI + ui = nanomanager.try_update_ui(user, src, ui_key, ui, force_open) + if(!ui) + ui = new(user, src, ui_key, "teleporter_console.tmpl", "Teleporter Console UI", 400, 400) + ui.open() + +/obj/machinery/computer/teleporter/ui_data(mob/user, datum/topic_state/state = default_state) + var/data[0] data["powerstation"] = power_station if(power_station) data["teleporterhub"] = power_station.teleporter_hub @@ -86,13 +91,7 @@ data["target"] = (!target) ? "None" : sanitize(targetarea.name) data["calibrating"] = calibrating data["locked"] = locked - - // Set up the Nano UI - ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open) - if(!ui) - ui = new(user, src, ui_key, "teleporter_console.tmpl", "Teleporter Console UI", 400, 400) - ui.set_initial_data(data) - ui.open() + return data /obj/machinery/computer/teleporter/Topic(href, href_list) if(..()) diff --git a/code/game/machinery/turret_control.dm b/code/game/machinery/turret_control.dm index d27df18523a..eda38ee6120 100644 --- a/code/game/machinery/turret_control.dm +++ b/code/game/machinery/turret_control.dm @@ -119,6 +119,13 @@ ui_interact(user) /obj/machinery/turretid/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1) + ui = nanomanager.try_update_ui(user, src, ui_key, ui, force_open) + if(!ui) + ui = new(user, src, ui_key, "turret_control.tmpl", "Turret Controls", 500, 300) + ui.open() + ui.set_auto_update(1) + +/obj/machinery/turretid/ui_data(mob/user, datum/topic_state/state = default_state) var/data[0] data["access"] = !isLocked(user) data["locked"] = locked @@ -136,12 +143,7 @@ settings[++settings.len] = list("category" = "Check Misc. Lifeforms", "setting" = "check_anomalies", "value" = check_anomalies) data["settings"] = settings - ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open) - if(!ui) - ui = new(user, src, ui_key, "turret_control.tmpl", "Turret Controls", 500, 300) - ui.set_initial_data(data) - ui.open() - ui.set_auto_update(1) + return data /obj/machinery/turretid/Topic(href, href_list, var/nowindow = 0) if(..()) diff --git a/code/game/machinery/vending.dm b/code/game/machinery/vending.dm index 4199bf72d68..ed6a23998c4 100644 --- a/code/game/machinery/vending.dm +++ b/code/game/machinery/vending.dm @@ -411,6 +411,12 @@ /obj/machinery/vending/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1) user.set_machine(src) + ui = nanomanager.try_update_ui(user, src, ui_key, ui, force_open) + if(!ui) + ui = new(user, src, ui_key, "vending_machine.tmpl", src.name, 440, 600) + ui.open() + +/obj/machinery/vending/ui_data(mob/user, datum/topic_state/state = default_state) var/list/data = list() if(currently_vending) data["mode"] = 1 @@ -446,12 +452,7 @@ data["speaker"] = src.shut_up ? 0 : 1 else data["panel"] = 0 - - ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open) - if(!ui) - ui = new(user, src, ui_key, "vending_machine.tmpl", src.name, 440, 600) - ui.set_initial_data(data) - ui.open() + return data /obj/machinery/vending/Topic(href, href_list) if(..()) diff --git a/code/game/mecha/equipment/mecha_equipment.dm b/code/game/mecha/equipment/mecha_equipment.dm index 12303c7767d..c60a560d19b 100644 --- a/code/game/mecha/equipment/mecha_equipment.dm +++ b/code/game/mecha/equipment/mecha_equipment.dm @@ -33,6 +33,7 @@ /obj/item/mecha_parts/mecha_equipment/Destroy()//missiles detonating, teleporter creating singularity? if(chassis) + detach(chassis) chassis.equipment -= src listclearnulls(chassis.equipment) if(chassis.selected == src) diff --git a/code/game/mecha/equipment/tools/mining_tools.dm b/code/game/mecha/equipment/tools/mining_tools.dm index 4f7211282c9..6146e326023 100644 --- a/code/game/mecha/equipment/tools/mining_tools.dm +++ b/code/game/mecha/equipment/tools/mining_tools.dm @@ -115,12 +115,22 @@ equip_cooldown = 30 var/scanning = 0 -/obj/item/mecha_parts/mecha_equipment/mining_scanner/New() +/obj/item/mecha_parts/mecha_equipment/mining_scanner/attach(obj/mecha/M) + . = ..() processing_objects.Add(src) + M.occupant_sight_flags |= SEE_TURFS + if(M.occupant) + M.occupant.update_sight() + +/obj/item/mecha_parts/mecha_equipment/mining_scanner/detach() + chassis.occupant_sight_flags &= ~SEE_TURFS + processing_objects.Remove(src) + if(chassis.occupant) + chassis.occupant.update_sight() + return ..() /obj/item/mecha_parts/mecha_equipment/mining_scanner/process() if(!loc) - processing_objects.Remove(src) qdel(src) if(scanning) return diff --git a/code/game/mecha/mech_bay.dm b/code/game/mecha/mech_bay.dm index f60a37be397..ea8a06961cc 100644 --- a/code/game/mecha/mech_bay.dm +++ b/code/game/mecha/mech_bay.dm @@ -145,7 +145,18 @@ ui_interact(user) /obj/machinery/computer/mech_bay_power_console/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1) - var/list/data = list() + ui = nanomanager.try_update_ui(user, src, ui_key, ui, force_open) + if(!ui) + // 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, "mech_bay_console.tmpl", "Mech Bay Control Console", 500, 325) + // open the new ui window + ui.open() + // auto update every Master Controller tick + ui.set_auto_update(1) + +/obj/machinery/computer/mech_bay_power_console/ui_data(mob/user, datum/topic_state/state = default_state) + var/data[0] if(!recharge_port) reconnect() if(recharge_port && !qdeleted(recharge_port)) @@ -160,20 +171,10 @@ data["mecha_charge_percentage"] = isnull(recharge_port.recharging_mecha) ? 0 : round(recharge_port.recharging_mecha.cell.percent()) else data["has_mech"] = 0 - ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open) - if(!ui) - // 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, "mech_bay_console.tmpl", "Mech Bay Control Console", 500, 325) - // 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() - // auto update every Master Controller tick - ui.set_auto_update(1) + return data /obj/machinery/computer/mech_bay_power_console/initialize() reconnect() update_icon() - return ..() \ No newline at end of file + return ..() diff --git a/code/game/mecha/mecha.dm b/code/game/mecha/mecha.dm index c8f93bc74ce..12dafd891e9 100644 --- a/code/game/mecha/mecha.dm +++ b/code/game/mecha/mecha.dm @@ -65,6 +65,7 @@ var/max_equip = 3 var/datum/events/events var/turf/crashing = null + var/occupant_sight_flags = 0 var/stepsound = 'sound/mecha/mechstep.ogg' @@ -563,7 +564,9 @@ dam_coeff = B.damage_coeff break - if(prob(deflect_chance * deflection) && (Proj.damage_type == BRUTE || Proj.damage_type == BURN)) + if(Proj.damage_type != BRUTE && Proj.damage_type != BURN) + visible_message("[src]'s armour is undamaged by [Proj]!") + else if(prob(deflect_chance * deflection)) visible_message("[src]'s armour deflects [Proj]!") else visible_message("[src] is hit by [Proj].") @@ -1126,7 +1129,7 @@ occupant = H H.stop_pulling() H.forceMove(src) - H.reset_view(src) + H.reset_perspective(src) add_fingerprint(H) //GrantActions(H, human_occupant=1) forceMove(loc) @@ -1175,13 +1178,9 @@ to_chat(user, "\the [mmi_as_oc] is stuck to your hand, you cannot put it in \the [src]") return 0 var/mob/brainmob = mmi_as_oc.brainmob - brainmob.reset_view(src) - /* - brainmob.client.eye = src - brainmob.client.perspective = EYE_PERSPECTIVE - */ + brainmob.reset_perspective(src) occupant = brainmob - brainmob.loc = src //should allow relaymove + brainmob.forceMove(src) //should allow relaymove brainmob.canmove = 1 mmi_as_oc.loc = src mmi_as_oc.mecha = src @@ -1264,7 +1263,7 @@ var/obj/item/device/mmi/mmi = mob_container if(mmi.brainmob) L.loc = mmi - L.reset_view() + L.reset_perspective() mmi.mecha = null mmi.update_icon() L.canmove = 0 @@ -1438,3 +1437,8 @@ /obj/mecha/speech_bubble(var/bubble_state = "",var/bubble_loc = src, var/list/bubble_recipients = list()) flick_overlay(image('icons/mob/talk.dmi', bubble_loc, bubble_state,MOB_LAYER+1), bubble_recipients, 30) + +/obj/mecha/update_remote_sight(mob/living/user) + if(occupant_sight_flags) + if(user == occupant) + user.sight |= occupant_sight_flags diff --git a/code/game/mecha/mecha_control_console.dm b/code/game/mecha/mecha_control_console.dm index 39cda37a167..6838aae1b29 100644 --- a/code/game/mecha/mecha_control_console.dm +++ b/code/game/mecha/mecha_control_console.dm @@ -17,6 +17,13 @@ ui_interact(user) /obj/machinery/computer/mecha/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1) + ui = nanomanager.try_update_ui(user, src, ui_key, ui, force_open) + if(!ui) + ui = new(user, src, ui_key, "exosuit_control.tmpl", "Exosuit Control Console", 420, 500) + ui.open() + ui.set_auto_update(1) + +/obj/machinery/computer/mecha/ui_data(mob/user, datum/topic_state/state = default_state) var/data[0] data["screen"] = screen if(screen == 0) @@ -28,14 +35,7 @@ data["mechas"] = mechas if(screen == 1) data["log"] = stored_data - - ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open) - - if(!ui) - ui = new(user, src, ui_key, "exosuit_control.tmpl", "Exosuit Control Console", 420, 500) - ui.set_initial_data(data) - ui.open() - ui.set_auto_update(1) + return data /obj/machinery/computer/mecha/Topic(href, href_list) if(..()) diff --git a/code/game/objects/buckling.dm b/code/game/objects/buckling.dm index 4c61393d9f7..0297a372dff 100644 --- a/code/game/objects/buckling.dm +++ b/code/game/objects/buckling.dm @@ -61,8 +61,8 @@ M.adjust_fire_stacks(1) M.IgniteMob() -/atom/movable/proc/unbuckle_mob() - if(buckled_mob && buckled_mob.buckled == src && buckled_mob.can_unbuckle(usr)) +/atom/movable/proc/unbuckle_mob(force = FALSE) + if(buckled_mob && buckled_mob.buckled == src && (buckled_mob.can_unbuckle(usr) || force)) . = buckled_mob buckled_mob.buckled = null buckled_mob.anchored = initial(buckled_mob.anchored) @@ -72,7 +72,6 @@ post_buckle_mob(.) - //Handle any extras after buckling/unbuckling //Called on buckle_mob() and unbuckle_mob() /atom/movable/proc/post_buckle_mob(mob/living/M) diff --git a/code/game/objects/effects/aliens.dm b/code/game/objects/effects/aliens.dm index 3c1a16787c0..106c451ca09 100644 --- a/code/game/objects/effects/aliens.dm +++ b/code/game/objects/effects/aliens.dm @@ -79,7 +79,8 @@ /obj/structure/alien/resin/bullet_act(obj/item/projectile/Proj) - health -= Proj.damage + if(Proj.damage_type == BRUTE || Proj.damage_type == BURN) + health -= Proj.damage ..() healthcheck() diff --git a/code/game/objects/effects/overlays.dm b/code/game/objects/effects/overlays.dm index 62760324f76..7e49136d3cf 100644 --- a/code/game/objects/effects/overlays.dm +++ b/code/game/objects/effects/overlays.dm @@ -97,3 +97,17 @@ icon = 'icons/effects/effects.dmi' icon_state = "admin" layer = 4.1 + +/obj/effect/overlay/wall_rot + name = "Wallrot" + desc = "Ick..." + icon = 'icons/effects/wallrot.dmi' + anchored = 1 + density = 1 + layer = 5 + mouse_opacity = 0 + +/obj/effect/overlay/wall_rot/New() + ..() + pixel_x += rand(-10, 10) + pixel_y += rand(-10, 10) \ No newline at end of file diff --git a/code/game/objects/items/devices/aicard.dm b/code/game/objects/items/devices/aicard.dm index d4668b3a69e..ab897d80ec0 100644 --- a/code/game/objects/items/devices/aicard.dm +++ b/code/game/objects/items/devices/aicard.dm @@ -41,6 +41,14 @@ /obj/item/device/aicard/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1, var/datum/topic_state/state = inventory_state) + ui = nanomanager.try_update_ui(user, src, ui_key, ui, force_open) + if(!ui) + ui = new(user, src, ui_key, "aicard.tmpl", "[name]", 600, 400, state = state) + ui.open() + ui.set_auto_update(1) + + +/obj/item/device/aicard/ui_data(mob/user, datum/topic_state/state = inventory_state) var/data[0] var/mob/living/silicon/ai/AI = locate() in src @@ -59,12 +67,7 @@ data["laws"] = laws data["has_laws"] = laws.len - ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open) - if(!ui) - ui = new(user, src, ui_key, "aicard.tmpl", "[name]", 600, 400, state = state) - ui.set_initial_data(data) - ui.open() - ui.set_auto_update(1) + return data /obj/item/device/aicard/Topic(href, href_list, nowindow, state) diff --git a/code/game/objects/items/devices/camera_bug.dm b/code/game/objects/items/devices/camera_bug.dm index b0e04a5ae77..af745b97f1f 100644 --- a/code/game/objects/items/devices/camera_bug.dm +++ b/code/game/objects/items/devices/camera_bug.dm @@ -56,7 +56,7 @@ /obj/item/device/camera_bug/check_eye(var/mob/user as mob) if(user.stat || loc != user || !user.canmove || !user.has_vision() || !current) - user.reset_view(null) + user.reset_perspective(null) user.unset_machine() return null @@ -64,7 +64,7 @@ if(T.z != current.z || !current.can_use()) to_chat(user, "[src] has lost the signal.") current = null - user.reset_view(null) + user.reset_perspective(null) user.unset_machine() return null @@ -184,7 +184,7 @@ /obj/item/device/camera_bug/Topic(var/href,var/list/href_list) if(usr != loc) usr.unset_machine() - usr.reset_view(null) + usr.reset_perspective(null) usr << browse(null, "window=camerabug") return usr.set_machine(src) @@ -195,7 +195,7 @@ if(C) track_mode = BUGMODE_MONITOR current = C - usr.reset_view(null) + usr.reset_perspective(null) interact() if("track" in href_list) var/atom/A = locate(href_list["track"]) @@ -214,7 +214,7 @@ interact() return if("close" in href_list) - usr.reset_view(null) + usr.reset_perspective(null) usr.unset_machine() current = null return // I do not <- I do not remember what I was going to write in this comment -Sayu, sometime later @@ -231,16 +231,16 @@ current = C spawn(6) if(src.check_eye(usr)) - usr.reset_view(C) + usr.reset_perspective(C) interact() else usr.unset_machine() - usr.reset_view(null) + usr.reset_perspective(null) usr << browse(null, "window=camerabug") return else usr.unset_machine() - usr.reset_view(null) + usr.reset_perspective(null) interact() diff --git a/code/game/objects/items/devices/chameleonproj.dm b/code/game/objects/items/devices/chameleonproj.dm index 41bfeb4d8f6..d3f13c284c1 100644 --- a/code/game/objects/items/devices/chameleonproj.dm +++ b/code/game/objects/items/devices/chameleonproj.dm @@ -83,7 +83,7 @@ A.loc = active_dummy.loc if(ismob(A)) var/mob/M = A - M.reset_view(null) + M.reset_perspective(null) /obj/effect/dummy/chameleon name = "" diff --git a/code/game/objects/items/devices/guitar.dm b/code/game/objects/items/devices/guitar.dm index b95cea0aae3..73831d1f468 100644 --- a/code/game/objects/items/devices/guitar.dm +++ b/code/game/objects/items/devices/guitar.dm @@ -33,6 +33,9 @@ song.ui_interact(user, ui_key, ui, force_open) +/obj/item/device/guitar/ui_data(mob/user, datum/topic_state/state = default_state) + return song.ui_data(user, state) + /obj/item/device/guitar/Topic(href, href_list) song.Topic(href, href_list) diff --git a/code/game/objects/items/devices/radio/electropack.dm b/code/game/objects/items/devices/radio/electropack.dm index e37b267799b..51859fd27ac 100644 --- a/code/game/objects/items/devices/radio/electropack.dm +++ b/code/game/objects/items/devices/radio/electropack.dm @@ -99,15 +99,17 @@ /obj/item/device/radio/electropack/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1) + ui = nanomanager.try_update_ui(user, src, ui_key, ui, force_open) + if(!ui) + ui = new(user, src, ui_key, "radio_electro.tmpl", "[name]", 400, 500) + ui.open() + ui.set_auto_update(1) + +/obj/item/device/radio/electropack/ui_data(mob/user, datum/topic_state/state = default_state) var/data[0] data["power"] = on data["freq"] = format_frequency(frequency) data["code"] = code - ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open) - if(!ui) - ui = new(user, src, ui_key, "radio_electro.tmpl", "[name]", 400, 500) - ui.set_initial_data(data) - ui.open() - ui.set_auto_update(1) \ No newline at end of file + return data diff --git a/code/game/objects/items/devices/radio/radio.dm b/code/game/objects/items/devices/radio/radio.dm index 74a32ebfe19..6078f855b61 100644 --- a/code/game/objects/items/devices/radio/radio.dm +++ b/code/game/objects/items/devices/radio/radio.dm @@ -108,6 +108,13 @@ var/global/list/default_medbay_channels = list( return ui_interact(user) /obj/item/device/radio/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1) + ui = nanomanager.try_update_ui(user, src, ui_key, ui, force_open) + if(!ui) + ui = new(user, src, ui_key, "radio_basic.tmpl", "[name]", 400, 550) + ui.open() + ui.set_auto_update(1) + +/obj/item/device/radio/ui_data(mob/user, datum/topic_state/state = default_state) var/data[0] data["mic_status"] = broadcasting @@ -126,12 +133,7 @@ var/global/list/default_medbay_channels = list( if(syndie) data["useSyndMode"] = 1 - ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open) - if(!ui) - ui = new(user, src, ui_key, "radio_basic.tmpl", "[name]", 400, 550) - ui.set_initial_data(data) - ui.open() - ui.set_auto_update(1) + return data /obj/item/device/radio/proc/list_channels(var/mob/user) @@ -749,6 +751,13 @@ var/global/list/default_medbay_channels = list( . = ..() /obj/item/device/radio/borg/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1) + ui = nanomanager.try_update_ui(user, src, ui_key, ui, force_open) + if(!ui) + ui = new(user, src, ui_key, "radio_basic.tmpl", "[name]", 430, 500) + ui.open() + ui.set_auto_update(1) + +/obj/item/device/radio/borg/ui_data(mob/user, datum/topic_state/state = default_state) var/data[0] data["mic_status"] = broadcasting @@ -769,12 +778,7 @@ var/global/list/default_medbay_channels = list( data["has_subspace"] = 1 data["subspace"] = subspace_transmission - ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open) - if(!ui) - ui = new(user, src, ui_key, "radio_basic.tmpl", "[name]", 430, 500) - ui.set_initial_data(data) - ui.open() - ui.set_auto_update(1) + return data /obj/item/device/radio/proc/config(op) if(radio_controller) diff --git a/code/game/objects/items/devices/transfer_valve.dm b/code/game/objects/items/devices/transfer_valve.dm index 9cd39c7a7d9..84b397780dc 100644 --- a/code/game/objects/items/devices/transfer_valve.dm +++ b/code/game/objects/items/devices/transfer_valve.dm @@ -90,26 +90,26 @@ ui_interact(user) /obj/item/device/transfer_valve/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1) + // update the ui if it exists, returns null if no ui is passed/found + ui = nanomanager.try_update_ui(user, src, ui_key, ui, force_open) + if(!ui) + // 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, "transfer_valve.tmpl", "Tank Transfer Valve", 460, 280) + // open the new ui window + ui.open() + // auto update every Master Controller tick + //ui.set_auto_update(1) - // this is the data which will be sent to the ui +/obj/item/device/transfer_valve/ui_data(mob/user, datum/topic_state/state = default_state) var/data[0] + data["attachmentOne"] = tank_one ? tank_one.name : null data["attachmentTwo"] = tank_two ? tank_two.name : null data["valveAttachment"] = attached_device ? attached_device.name : null data["valveOpen"] = valve_open ? 1 : 0 - // update the ui if it exists, returns null if no ui is passed/found - ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open) - if(!ui) - // 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, "transfer_valve.tmpl", "Tank Transfer Valve", 460, 280) - // 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() - // auto update every Master Controller tick - //ui.set_auto_update(1) + return data /obj/item/device/transfer_valve/Topic(href, href_list) ..() @@ -219,4 +219,4 @@ // this doesn't do anything but the timer etc. expects it to be here // eventually maybe have it update icon to show state (timer, prox etc.) like old bombs /obj/item/device/transfer_valve/proc/c_state() - return \ No newline at end of file + return diff --git a/code/game/objects/items/devices/uplinks.dm b/code/game/objects/items/devices/uplinks.dm index b019e2a9d95..d29e5e5ede4 100644 --- a/code/game/objects/items/devices/uplinks.dm +++ b/code/game/objects/items/devices/uplinks.dm @@ -187,8 +187,18 @@ var/list/world_uplinks = list() /* NANO UI FOR UPLINK WOOP WOOP */ -/obj/item/device/uplink/hidden/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1) +/obj/item/device/uplink/hidden/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1, var/datum/topic_state/state = inventory_state) var/title = "Remote Uplink" + // update the ui if it exists, returns null if no ui is passed/found + ui = nanomanager.try_update_ui(user, src, ui_key, ui, force_open) + if(!ui) + // 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, "uplink.tmpl", title, 700, 600, state = state) + // open the new ui window + ui.open() + +/obj/item/device/uplink/hidden/ui_data(mob/user, datum/topic_state/state = inventory_state) var/data[0] data["welcome"] = welcome @@ -200,17 +210,7 @@ var/list/world_uplinks = list() data["nano_items"] = nanoui_items data += nanoui_data - // update the ui if it exists, returns null if no ui is passed/found - ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open) - if(!ui) - // 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, "uplink.tmpl", title, 700, 600, state = inventory_state) - // 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() - + return data // Interaction code. Gathers a list of items purchasable from the paren't uplink and displays it. It also adds a lock button. /obj/item/device/uplink/hidden/interact(mob/user) diff --git a/code/game/objects/items/devices/violin.dm b/code/game/objects/items/devices/violin.dm index 7a3d304309d..7802e832fde 100644 --- a/code/game/objects/items/devices/violin.dm +++ b/code/game/objects/items/devices/violin.dm @@ -38,5 +38,8 @@ song.ui_interact(user, ui_key, ui, force_open) +/obj/item/device/violin/ui_data(mob/user, datum/topic_state/state = default_state) + return song.ui_data(user, state) + /obj/item/device/violin/Topic(href, href_list) song.Topic(href, href_list) diff --git a/code/game/objects/items/weapons/RCD.dm b/code/game/objects/items/weapons/RCD.dm index 8eb92562b7f..0a503aa7cb9 100644 --- a/code/game/objects/items/weapons/RCD.dm +++ b/code/game/objects/items/weapons/RCD.dm @@ -83,7 +83,14 @@ RCD ui_interact(user) /obj/item/weapon/rcd/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1, var/datum/topic_state/state = inventory_state) - var/list/data = list() + ui = nanomanager.try_update_ui(user, src, ui_key, ui, force_open) + if(!ui) + ui = new(user, src, ui_key, "rcd.tmpl", "[name]", 400, 400, state = state) + ui.open() + ui.set_auto_update(1) + +/obj/item/weapon/rcd/ui_data(mob/user, datum/topic_state/state = inventory_state) + var/data[0] data["mode"] = mode data["door_type"] = door_type data["menu"] = menu @@ -100,12 +107,7 @@ RCD data["door_accesses"] = door_accesses_list - ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open) - if(!ui) - ui = new(user, src, ui_key, "rcd.tmpl", "[name]", 400, 400, state = state) - ui.set_initial_data(data) - ui.open() - ui.set_auto_update(1) + return data /obj/item/weapon/rcd/Topic(href, href_list, nowindow, state) if(..()) diff --git a/code/game/objects/items/weapons/caution.dm b/code/game/objects/items/weapons/caution.dm index 7b8af53e388..6e57028472e 100644 --- a/code/game/objects/items/weapons/caution.dm +++ b/code/game/objects/items/weapons/caution.dm @@ -58,4 +58,4 @@ if(l && !(l.status & ORGAN_DESTROYED)) l.status |= ORGAN_DESTROYED if(r && !(r.status & ORGAN_DESTROYED)) - r.status |= ORGAN_DESTROYED \ No newline at end of file + r.status |= ORGAN_DESTROYED diff --git a/code/game/objects/items/weapons/gift_wrappaper.dm b/code/game/objects/items/weapons/gift_wrappaper.dm index 6dcbef385b0..d503ca04a8f 100644 --- a/code/game/objects/items/weapons/gift_wrappaper.dm +++ b/code/game/objects/items/weapons/gift_wrappaper.dm @@ -55,9 +55,7 @@ for(var/mob/M in src) //Should only be one but whatever. M.loc = src.loc - if(M.client) - M.client.eye = M.client.mob - M.client.perspective = MOB_PERSPECTIVE + M.reset_perspective(null) qdel(src) diff --git a/code/game/objects/items/weapons/implants/implantchair.dm b/code/game/objects/items/weapons/implants/implantchair.dm index a464e5914ef..141f9b14f89 100644 --- a/code/game/objects/items/weapons/implants/implantchair.dm +++ b/code/game/objects/items/weapons/implants/implantchair.dm @@ -94,10 +94,7 @@ return if(M == occupant) // so that the guy inside can't eject himself -Agouri return - if(src.occupant.client) - src.occupant.client.eye = src.occupant.client.mob - src.occupant.client.perspective = MOB_PERSPECTIVE - src.occupant.loc = src.loc + occupant.forceMove(loc) if(injecting) implant(src.occupant) injecting = 0 @@ -113,11 +110,8 @@ if(src.occupant) to_chat(usr, "The [src.name] is already occupied!") return - if(M.client) - M.client.perspective = EYE_PERSPECTIVE - M.client.eye = src M.stop_pulling() - M.loc = src + M.forceMove(src) src.occupant = M src.add_fingerprint(usr) icon_state = "implantchair_on" diff --git a/code/game/objects/items/weapons/tanks/tanks.dm b/code/game/objects/items/weapons/tanks/tanks.dm index ae28bd61d17..5dbcc68ab2b 100644 --- a/code/game/objects/items/weapons/tanks/tanks.dm +++ b/code/game/objects/items/weapons/tanks/tanks.dm @@ -80,11 +80,11 @@ /obj/item/weapon/tank/examine(mob/user) if(!..(user, 0)) return - + var/obj/icon = src if(istype(loc, /obj/item/assembly)) icon = loc - + if(!in_range(src, user)) if(icon == src) to_chat(user, "It's \a [bicon(icon)][src]! If you want any more information you'll need to get closer.") @@ -141,14 +141,24 @@ ui_interact(user) /obj/item/weapon/tank/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1) + // update the ui if it exists, returns null if no ui is passed/found + ui = nanomanager.try_update_ui(user, src, ui_key, ui, force_open) + if(!ui) + // 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, "tanks.tmpl", "Tank", 500, 300) + // open the new ui window + ui.open() + // auto update every Master Controller tick + ui.set_auto_update(1) +/obj/item/weapon/tank/ui_data(mob/user, datum/topic_state/state = default_state) var/using_internal - if(istype(loc,/mob/living/carbon)) - var/mob/living/carbon/location = loc - if(location.internal==src) + if(iscarbon(loc)) + var/mob/living/carbon/C = loc + if(C.internal == src) using_internal = 1 - // this is the data which will be sent to the ui var/data[0] data["tankPressure"] = round(air_contents.return_pressure() ? air_contents.return_pressure() : 0) data["releasePressure"] = round(distribute_pressure ? distribute_pressure : 0) @@ -170,18 +180,7 @@ if(H.head && (H.head.flags & AIRTIGHT)) data["maskConnected"] = 1 - // update the ui if it exists, returns null if no ui is passed/found - ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open) - if(!ui) - // 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, "tanks.tmpl", "Tank", 500, 300) - // 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() - // auto update every Master Controller tick - ui.set_auto_update(1) + return data /obj/item/weapon/tank/Topic(href, href_list) if(..()) diff --git a/code/game/objects/structures/crates_lockers/closets.dm b/code/game/objects/structures/crates_lockers/closets.dm index ed0092cf60d..26908f69180 100644 --- a/code/game/objects/structures/crates_lockers/closets.dm +++ b/code/game/objects/structures/crates_lockers/closets.dm @@ -58,13 +58,11 @@ for(var/mob/M in src) moveMob(M, loc) - if(M.client) - M.client.eye = M.client.mob - M.client.perspective = MOB_PERSPECTIVE /obj/structure/closet/proc/moveMob(var/mob/M, var/atom/destination) loc.Exited(M) M.loc = destination + M.reset_perspective(destination) if(isturf(loc)) loc.Entered(M, src, ignoreRest = 1) else @@ -122,10 +120,6 @@ if(M.buckled) continue - if(M.client) - M.client.perspective = EYE_PERSPECTIVE - M.client.eye = src - moveMob(M, src) itemcount++ @@ -428,3 +422,7 @@ ..() visible_message("[src] is blown apart by the bolt of electricity!", "You hear a metallic screeching sound.") qdel(src) + +/obj/structure/closet/get_remote_view_fullscreens(mob/user) + if(user.stat == DEAD || !(user.sight & (SEEOBJS|SEEMOBS))) + user.overlay_fullscreen("remote_view", /obj/screen/fullscreen/impaired, 1) diff --git a/code/game/objects/structures/crates_lockers/closets/statue.dm b/code/game/objects/structures/crates_lockers/closets/statue.dm index 3f49d3e3bde..c330ad11a01 100644 --- a/code/game/objects/structures/crates_lockers/closets/statue.dm +++ b/code/game/objects/structures/crates_lockers/closets/statue.dm @@ -18,10 +18,7 @@ if(L.buckled) L.buckled = 0 L.anchored = 0 - if(L.client) - L.client.perspective = EYE_PERSPECTIVE - L.client.eye = src - L.loc = src + L.forceMove(src) L.disabilities += MUTE health = L.health + 100 //stoning damaged mobs will result in easier to shatter statues intialTox = L.getToxLoss() @@ -76,12 +73,9 @@ O.loc = src.loc for(var/mob/living/M in src) - M.loc = src.loc + M.forceMove(loc) M.disabilities -= MUTE M.take_overall_damage((M.health - health - 100),0) //any new damage the statue incurred is transfered to the mob - if(M.client) - M.client.eye = M.client.mob - M.client.perspective = MOB_PERSPECTIVE /obj/structure/closet/statue/open() @@ -164,4 +158,4 @@ obj/structure/statue/angel icon_state = "angelseen" obj/structure/statue/corgi - icon_state = "corgi" \ No newline at end of file + icon_state = "corgi" diff --git a/code/game/objects/structures/morgue.dm b/code/game/objects/structures/morgue.dm index 90122f2280b..68bd915ac77 100644 --- a/code/game/objects/structures/morgue.dm +++ b/code/game/objects/structures/morgue.dm @@ -154,6 +154,10 @@ src.attack_hand(CM) +/obj/structure/morgue/get_remote_view_fullscreens(mob/user) + if(user.stat == DEAD || !(user.sight & (SEEOBJS|SEEMOBS))) + user.overlay_fullscreen("remote_view", /obj/screen/fullscreen/impaired, 2) + /* * Morgue tray */ @@ -393,6 +397,10 @@ to_chat(CM, "You attempt to slide yourself out of \the [src]...") src.attack_hand(CM) +/obj/structure/crematorium/get_remote_view_fullscreens(mob/user) + if(user.stat == DEAD || !(user.sight & (SEEOBJS|SEEMOBS))) + user.overlay_fullscreen("remote_view", /obj/screen/fullscreen/impaired, 2) + /* * Crematorium tray */ diff --git a/code/game/objects/structures/musician.dm b/code/game/objects/structures/musician.dm index 563f9c5faa9..c28ebe05c55 100644 --- a/code/game/objects/structures/musician.dm +++ b/code/game/objects/structures/musician.dm @@ -113,6 +113,16 @@ repeat = 0 /datum/song/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1) + if(!instrumentObj) + return + + ui = nanomanager.try_update_ui(user, instrumentObj, ui_key, ui, force_open) + if(!ui) + ui = new(user, instrumentObj, ui_key, "song.tmpl", instrumentObj.name, 700, 500) + ui.open() + ui.set_auto_update(1) + +/datum/song/ui_data(mob/user, datum/topic_state/state = default_state) var/data[0] data["lines"] = lines @@ -125,15 +135,7 @@ data["minTempo"] = world.tick_lag data["maxTempo"] = 600 - if(!instrumentObj) - return - - ui = nanomanager.try_update_ui(user, instrumentObj, ui_key, ui, data, force_open) - if(!ui) - ui = new(user, instrumentObj, ui_key, "song.tmpl", instrumentObj.name, 700, 500) - ui.set_initial_data(data) - ui.open() - ui.set_auto_update(1) + return data /datum/song/Topic(href, href_list) if(!in_range(instrumentObj, usr) || (issilicon(usr) && instrumentObj.loc != usr) || !isliving(usr) || !usr.canmove || usr.restrained()) @@ -294,6 +296,9 @@ song.ui_interact(user, ui_key, ui, force_open) +/obj/structure/piano/ui_data(mob/user, datum/topic_state/state = default_state) + return song.ui_data(user, state) + /obj/structure/piano/Topic(href, href_list) song.Topic(href, href_list) diff --git a/code/game/objects/structures/transit_tubes/transit_tube_pod.dm b/code/game/objects/structures/transit_tubes/transit_tube_pod.dm index eabfcba148b..fda770705d0 100644 --- a/code/game/objects/structures/transit_tubes/transit_tube_pod.dm +++ b/code/game/objects/structures/transit_tubes/transit_tube_pod.dm @@ -147,7 +147,7 @@ if(!(locate(/obj/structure/transit_tube) in loc)) mob.loc = loc mob.client.Move(get_step(loc, direction), direction) - mob.reset_view(null) + mob.reset_perspective(null) //if(moving && istype(loc, /turf/space)) // Todo: If you get out of a moving pod in space, you should move as well. @@ -161,7 +161,7 @@ if(station.icon_state == "open") mob.loc = loc mob.client.Move(get_step(loc, direction), direction) - mob.reset_view(null) + mob.reset_perspective(null) else station.open_animation() diff --git a/code/game/turfs/simulated/walls.dm b/code/game/turfs/simulated/walls.dm index d1fb0326466..cb7cd8be813 100644 --- a/code/game/turfs/simulated/walls.dm +++ b/code/game/turfs/simulated/walls.dm @@ -23,7 +23,7 @@ var/hardness = 40 //lower numbers are harder. Used to determine the probability of a hulk smashing through. var/engraving, engraving_quality //engraving on the wall - + var/sheet_type = /obj/item/stack/sheet/metal var/obj/item/stack/sheet/builtin_sheet = null @@ -39,16 +39,14 @@ /turf/simulated/wall/New() ..() - builtin_sheet = new sheet_type - + builtin_sheet = new sheet_type + /turf/simulated/wall/BeforeChange() - for(var/obj/effect/E in src) - // such quality code - if(E.name == "Wallrot") - qdel(E) + for(var/obj/effect/overlay/wall_rot/WR in src) + qdel(WR) . = ..() - + //Appearance /turf/simulated/wall/examine(mob/user) . = ..(user) @@ -139,7 +137,7 @@ O.loc = src ChangeTurf(/turf/simulated/floor/plating) - + /turf/simulated/wall/proc/break_wall() builtin_sheet.amount = 2 builtin_sheet.loc = src @@ -187,21 +185,12 @@ var/number_rots = rand(2,3) for(var/i=0, iYou burn away the fungi with \the [WT].") playsound(src, 'sound/items/Welder.ogg', 10, 1) - for(var/obj/effect/E in src) if(E.name == "Wallrot") - qdel(E) + for(var/obj/effect/overlay/wall_rot/WR in src) + qdel(WR) rotting = 0 return else if(!is_sharp(W) && W.force >= 10 || W.force >= 20) diff --git a/code/game/turfs/simulated/walls_reinforced.dm b/code/game/turfs/simulated/walls_reinforced.dm index 1dbda894c52..49cfa1ace0f 100644 --- a/code/game/turfs/simulated/walls_reinforced.dm +++ b/code/game/turfs/simulated/walls_reinforced.dm @@ -29,8 +29,8 @@ if( WT.remove_fuel(0,user) ) to_chat(user, "You burn away the fungi with \the [WT].") playsound(src, 'sound/items/Welder.ogg', 10, 1) - for(var/obj/effect/E in src) if(E.name == "Wallrot") - qdel(E) + for(var/obj/effect/overlay/wall_rot/WR in src) + qdel(WR) rotting = 0 return else if(!is_sharp(W) && W.force >= 10 || W.force >= 20) diff --git a/code/modules/admin/admin.dm b/code/modules/admin/admin.dm index eb32af7802d..72de785456e 100644 --- a/code/modules/admin/admin.dm +++ b/code/modules/admin/admin.dm @@ -539,9 +539,9 @@ var/global/nologevent = 0 world.Reboot("Initiated by [usr.client.holder.fakekey ? "Admin" : usr.key].", "end_error", "admin reboot - by [usr.key] [usr.client.holder.fakekey ? "(stealth)" : ""]", delay) /datum/admins/proc/announce() - set category = "Special Verbs" + set category = "Admin" set name = "Announce" - set desc="Announce your desires to the world" + set desc = "Announce your desires to the world" if(!check_rights(R_ADMIN)) return diff --git a/code/modules/admin/admin_verbs.dm b/code/modules/admin/admin_verbs.dm index fda1382d4df..ba46a995ffd 100644 --- a/code/modules/admin/admin_verbs.dm +++ b/code/modules/admin/admin_verbs.dm @@ -534,7 +534,7 @@ var/list/admin_verbs_snpc = list( #undef AUTOBANTIME /client/proc/drop_bomb() // Some admin dickery that can probably be done better -- TLE - set category = "Special Verbs" + set category = "Event" set name = "Drop Bomb" set desc = "Cause an explosion of varying strength at your location." diff --git a/code/modules/admin/buildmode.dm b/code/modules/admin/buildmode.dm index 87721320af5..72461ed6ae1 100644 --- a/code/modules/admin/buildmode.dm +++ b/code/modules/admin/buildmode.dm @@ -396,7 +396,8 @@ /proc/togglebuildmode(mob/M as mob in player_list) set name = "Toggle Build Mode" - set category = "Special Verbs" + set category = "Event" + if(M.client) if(istype(M.client.click_intercept,/datum/click_intercept/buildmode)) var/datum/click_intercept/buildmode/B = M.client.click_intercept @@ -404,7 +405,7 @@ log_admin("[key_name(usr)] has left build mode.") else new/datum/click_intercept/buildmode(M.client) - message_admins("[key_name(usr)] has entered build mode.") + message_admins("[key_name_admin(usr)] has entered build mode.") log_admin("[key_name(usr)] has entered build mode.") /datum/click_intercept/buildmode/InterceptClickOn(user,params,atom/object) //Click Intercept diff --git a/code/modules/admin/topic.dm b/code/modules/admin/topic.dm index 237acd8ed7e..3b8e33d04f8 100644 --- a/code/modules/admin/topic.dm +++ b/code/modules/admin/topic.dm @@ -2235,14 +2235,6 @@ qdel(O) for(var/obj/structure/grille/O in world) qdel(O) -/* for(var/obj/machinery/vehicle/pod/O in world) - for(var/mob/M in src) - M.loc = src.loc - if(M.client) - M.client.perspective = MOB_PERSPECTIVE - M.client.eye = M - qdel(O) - ok = 1*/ if("monkey") feedback_inc("admin_secrets_fun_used",1) feedback_add_details("admin_secrets_fun_used","M") diff --git a/code/modules/admin/verbs/adminsay.dm b/code/modules/admin/verbs/adminsay.dm index 67130872222..7c7569e5907 100644 --- a/code/modules/admin/verbs/adminsay.dm +++ b/code/modules/admin/verbs/adminsay.dm @@ -1,5 +1,5 @@ /client/proc/cmd_admin_say(msg as text) - set category = "Special Verbs" + set category = "Admin" set name = "Asay" //Gave this shit a shorter name so you only have to time out "asay" rather than "admin say" to use it --NeoFite set hidden = 1 if(!check_rights(R_ADMIN)) return @@ -17,7 +17,7 @@ feedback_add_details("admin_verb","M") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! /client/proc/cmd_mentor_say(msg as text) - set category = "Special Verbs" + set category = "Admin" set name = "Msay" set hidden = 1 diff --git a/code/modules/admin/verbs/deadsay.dm b/code/modules/admin/verbs/deadsay.dm index 690cac87536..3874e26e9de 100644 --- a/code/modules/admin/verbs/deadsay.dm +++ b/code/modules/admin/verbs/deadsay.dm @@ -1,5 +1,5 @@ /client/proc/dsay(msg as text) - set category = "Special Verbs" + set category = "Admin" set name = "Dsay" //Gave this shit a shorter name so you only have to time out "dsay" rather than "dead say" to use it --NeoFite set hidden = 1 diff --git a/code/modules/admin/verbs/freeze.dm b/code/modules/admin/verbs/freeze.dm index 920b24297ad..6ebd6b1256a 100644 --- a/code/modules/admin/verbs/freeze.dm +++ b/code/modules/admin/verbs/freeze.dm @@ -7,13 +7,15 @@ //////////////////////////////////////////////////////////////////////////////// var/global/list/frozen_mob_list = list() /client/proc/freeze(var/mob/living/M as mob in mob_list) - set category = "Special Verbs" + set category = "Admin" set name = "Freeze" - if(!holder) - to_chat(src, "Error: Freeze: Only administrators may use this command.") + + if(!check_rights(R_ADMIN)) return - if(!istype(M)) return - if(!check_rights(R_ADMIN)) return + + if(!istype(M)) + return + if(M in frozen_mob_list) M.admin_unFreeze(src) else @@ -83,14 +85,15 @@ var/global/list/frozen_mob_list = list() //////////////////////////Freeze Mech /client/proc/freezemecha(var/obj/mecha/O as obj in mechas_list) - set category = "Special Verbs" + set category = "Admin" set name = "Freeze Mech" - if(!holder) - to_chat(src, "Only administrators may use this command.") - return + + if(!check_rights(R_ADMIN)) + return + var/obj/mecha/M = O if(!istype(M,/obj/mecha)) - to_chat(src, "This can only be used on Mechs!") + to_chat(src, "This can only be used on mechs!") return else if(usr) diff --git a/code/modules/admin/verbs/infiltratorteam_syndicate.dm b/code/modules/admin/verbs/infiltratorteam_syndicate.dm index e49a2f72939..86a899ab847 100644 --- a/code/modules/admin/verbs/infiltratorteam_syndicate.dm +++ b/code/modules/admin/verbs/infiltratorteam_syndicate.dm @@ -21,8 +21,8 @@ var/global/sent_syndicate_infiltration_team = 0 var/pick_manually = 0 if(alert("Pick the team members manually? If you select yes, you pick from ghosts. If you select no, ghosts get offered the chance to join.",,"Yes","No")=="Yes") pick_manually = 1 - var/list/teamsizeoptions = list(1,2,3,4,5) - var/teamsize = input(src, "How many team members, not counting the team leader?") as null|anything in teamsizeoptions + var/list/teamsizeoptions = list(2,3,4,5,6) + var/teamsize = input(src, "How many team members, including the team leader?") as null|anything in teamsizeoptions if(!(teamsize in teamsizeoptions)) alert("Invalid team size specified. Aborting.") return @@ -102,11 +102,11 @@ var/global/sent_syndicate_infiltration_team = 0 to_chat(new_syndicate_infiltrator, "As team leader, it is up to you to organize your team! Give the job to someone else if you can't handle it. Only your ID opens the exit door.") else to_chat(new_syndicate_infiltrator, "Your team leader is: [team_leader]. They are in charge!") - teamsize-- + teamsize-- to_chat(new_syndicate_infiltrator, "You have more helpful information stored in your Notes.") new_syndicate_infiltrator.mind.store_memory("Mission: [input] ") new_syndicate_infiltrator.mind.store_memory("Team Leader: [team_leader] ") - new_syndicate_infiltrator.mind.store_memory("Starting Equipment:
- Chameleon Jumpsuit ((right click to Change Color))
- Agent ID card ((disguise as another job))
- Uplink Implant ((top left of screen))
- Dust Implant ((destroys your body on death))
- Combat Gloves ((insulated, disguised as black gloves))
- Anything bought with your uplink implant") + new_syndicate_infiltrator.mind.store_memory("Starting Equipment:
- Syndicate Headset ((.h for your radio))
- Chameleon Jumpsuit ((right click to Change Color))
- Agent ID card ((disguise as another job))
- Uplink Implant ((top left of screen))
- Dust Implant ((destroys your body on death))
- Combat Gloves ((insulated, disguised as black gloves))
- Anything bought with your uplink implant") var/datum/atom_hud/antag/opshud = huds[ANTAG_HUD_OPS] opshud.join_hud(new_syndicate_infiltrator.mind.current) ticker.mode.set_antag_hud(new_syndicate_infiltrator.mind.current, "hudoperative") @@ -145,8 +145,7 @@ var/global/sent_syndicate_infiltration_team = 0 var/datum/preferences/A = new() //Randomize appearance A.real_name = syndicate_infiltrator_name A.copy_to(new_syndicate_infiltrator) - - new_syndicate_infiltrator.dna.ready_dna(new_syndicate_infiltrator) //Creates DNA. + new_syndicate_infiltrator.dna.ready_dna(new_syndicate_infiltrator) //Creates mind stuff. new_syndicate_infiltrator.mind_initialize() @@ -154,7 +153,6 @@ var/global/sent_syndicate_infiltration_team = 0 new_syndicate_infiltrator.mind.special_role = "Syndicate Infiltrator" ticker.mode.traitors |= new_syndicate_infiltrator.mind //Adds them to extra antag list new_syndicate_infiltrator.equip_syndicate_infiltrator(syndicate_leader_selected, uplink_tc, is_mgmt) - qdel(spawn_location) return new_syndicate_infiltrator // --------------------------------------------------------------------------------------------------------- @@ -180,9 +178,6 @@ var/global/sent_syndicate_infiltration_team = 0 U.hidden_uplink.uses = 500 else U.hidden_uplink.uses = num_tc - // Storage - //var/obj/item/weapon/implant/storage/T = new /obj/item/weapon/implant/storage(src) - //T.implant(src) // Dust var/obj/item/weapon/implant/dust/D = new /obj/item/weapon/implant/dust(src) D.implant(src) @@ -196,7 +191,7 @@ var/global/sent_syndicate_infiltration_team = 0 // Other gear equip_to_slot_or_del(new /obj/item/clothing/shoes/syndigaloshes(src), slot_shoes) - var/obj/item/weapon/card/id/syndicate/W = new(src) //Untrackable by AI + var/obj/item/weapon/card/id/syndicate/W = new(src) if (flag_mgmt) W.icon_state = "commander" else diff --git a/code/modules/admin/verbs/randomverbs.dm b/code/modules/admin/verbs/randomverbs.dm index b776eb9a649..79ee34fb635 100644 --- a/code/modules/admin/verbs/randomverbs.dm +++ b/code/modules/admin/verbs/randomverbs.dm @@ -139,7 +139,7 @@ feedback_add_details("admin_verb","DIRN") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! /client/proc/cmd_admin_godmode(mob/M as mob in mob_list) - set category = "Special Verbs" + set category = "Admin" set name = "Godmode" if(!check_rights(R_ADMIN)) @@ -287,7 +287,7 @@ Works kind of like entering the game with a new character. Character receives a Traitors and the like can also be revived with the previous role mostly intact. /N */ /client/proc/respawn_character() - set category = "Special Verbs" + set category = "Event" set name = "Respawn Character" set desc = "Respawn a person that has been gibbed/dusted/killed. They must be a ghost for this to work and preferably should not have a body to go back into." @@ -520,7 +520,7 @@ Traitors and the like can also be revived with the previous role mostly intact. feedback_add_details("admin_verb","IONC") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! /client/proc/cmd_admin_rejuvenate(mob/living/M as mob in mob_list) - set category = "Special Verbs" + set category = "Event" set name = "Rejuvenate" if(!check_rights(R_REJUVINATE)) @@ -659,7 +659,7 @@ Traitors and the like can also be revived with the previous role mostly intact. return /client/proc/cmd_admin_emp(atom/O as obj|mob|turf in view()) - set category = "Special Verbs" + set category = "Event" set name = "EM Pulse" if(!check_rights(R_DEBUG|R_EVENT)) @@ -682,7 +682,7 @@ Traitors and the like can also be revived with the previous role mostly intact. return /client/proc/cmd_admin_gib(mob/M as mob in mob_list) - set category = "Special Verbs" + set category = "Admin" set name = "Gib" if(!check_rights(R_ADMIN|R_EVENT)) @@ -722,7 +722,7 @@ Traitors and the like can also be revived with the previous role mostly intact. feedback_add_details("admin_verb","GIBS") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! /client/proc/cmd_admin_check_contents(mob/living/M as mob in mob_list) - set category = "Special Verbs" + set category = "Admin" set name = "Check Contents" if(!check_rights(R_ADMIN)) @@ -734,7 +734,7 @@ Traitors and the like can also be revived with the previous role mostly intact. feedback_add_details("admin_verb","CC") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! /client/proc/toggle_view_range() - set category = "Special Verbs" + set category = "Admin" set name = "Change View Range" set desc = "switches between 1x and custom views" @@ -806,7 +806,7 @@ Traitors and the like can also be revived with the previous role mostly intact. message_admins("[key_name_admin(usr)] has [shuttle_master.emergencyNoEscape ? "denied" : "allowed"] the shuttle to be called.") /client/proc/cmd_admin_attack_log(mob/M as mob in mob_list) - set category = "Special Verbs" + set category = "Admin" set name = "Attack Log" if(!check_rights(R_ADMIN)) @@ -875,7 +875,7 @@ Traitors and the like can also be revived with the previous role mostly intact. set name = "Reset Telecomms Scripts" set desc = "Blanks all telecomms scripts from all telecomms servers" - if(!check_rights(R_ADMIN, 1, src)) + if(!check_rights(R_ADMIN)) return var/confirm = alert(src, "You sure you want to blank all NTSL scripts?", "Confirm", "Yes", "No") diff --git a/code/modules/awaymissions/bluespaceartillery.dm b/code/modules/awaymissions/bluespaceartillery.dm index 00263352325..9eb71904de5 100644 --- a/code/modules/awaymissions/bluespaceartillery.dm +++ b/code/modules/awaymissions/bluespaceartillery.dm @@ -7,18 +7,26 @@ var/last_fire = 0 var/reload_cooldown = 180 // 3 minute cooldown var/area/targetarea - + light_color = LIGHT_COLOR_LIGHTBLUE /obj/machinery/computer/artillerycontrol/attack_ai(user as mob) to_chat(user, "Access denied.") return - + /obj/machinery/computer/artillerycontrol/attack_hand(user as mob) ui_interact(user) - + /obj/machinery/computer/artillerycontrol/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1) + ui = nanomanager.try_update_ui(user, src, ui_key, ui, force_open) + if(!ui) + ui = new(user, src, ui_key, "bluespace_artillery.tmpl", "Bluespace Control", 400, 260) + ui.open() + ui.set_auto_update(1) + +/obj/machinery/computer/artillerycontrol/ui_data(mob/user, datum/topic_state/state = default_state) var/data[0] + var/time_to_wait = round(reload_cooldown - ((world.time / 10) - last_fire), 1) var/mins = round(time_to_wait / 60) var/seconds = time_to_wait - (60*mins) @@ -30,32 +38,26 @@ else data["target"] = "No Lock" - ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open) + return data - if(!ui) - ui = new(user, src, ui_key, "bluespace_artillery.tmpl", "Bluespace Control", 400, 260) - ui.set_initial_data(data) - ui.open() - ui.set_auto_update(1) - /obj/machinery/computer/artillerycontrol/Topic(href, href_list) if(..()) return 1 - - if(href_list["area"]) + + if(href_list["area"]) var/A A = input("Select the target area.", "Select Area", A) in ghostteleportlocs|null var/area/thearea = ghostteleportlocs[A] if(..() || !istype(thearea)) return - + targetarea = thearea - + if(href_list["fire"]) var/delta = (world.time / 10) - last_fire if(reload_cooldown > delta) return 1 - + command_announcement.Announce("Bluespace artillery fire detected. Brace for impact.") message_admins("[key_name_admin(usr)] has launched an artillery strike.", 1) var/list/L = list() @@ -64,7 +66,7 @@ var/loc = pick(L) explosion(loc,2,5,11) last_fire = world.time / 10 - + nanomanager.update_uis(src) /obj/structure/artilleryplaceholder diff --git a/code/modules/client/preference/preferences.dm b/code/modules/client/preference/preferences.dm index 6414cdde907..c049852e3be 100644 --- a/code/modules/client/preference/preferences.dm +++ b/code/modules/client/preference/preferences.dm @@ -213,15 +213,14 @@ var/global/list/special_role_times = list( //minimum age (in days) for accounts /datum/preferences/New(client/C) b_type = pick(4;"O-", 36;"O+", 3;"A-", 28;"A+", 1;"B-", 20;"B+", 1;"AB-", 5;"AB+") + max_gear_slots = config.max_loadout_points if(istype(C)) if(!IsGuestKey(C.key)) unlock_content = C.IsByondMember() if(unlock_content) max_save_slots = MAX_SAVE_SLOTS_MEMBER - - max_gear_slots = config.max_loadout_points - if(C.donator_level >= DONATOR_LEVEL_ONE) - max_gear_slots += 5 + if(C.donator_level >= DONATOR_LEVEL_ONE) + max_gear_slots += 5 var/loaded_preferences_successfully = load_preferences(C) if(loaded_preferences_successfully) @@ -2099,37 +2098,6 @@ var/global/list/special_role_times = list( //minimum age (in days) for accounts I.robotize() character.dna.b_type = b_type - if(disabilities & DISABILITY_FLAG_FAT && character.species.flags & CAN_BE_FAT) - character.dna.SetSEState(FATBLOCK,1,1) - character.mutations += FAT - character.mutations += OBESITY - character.overeatduration = 600 - - if(disabilities & DISABILITY_FLAG_NEARSIGHTED) - character.dna.SetSEState(GLASSESBLOCK,1,1) - character.disabilities|=NEARSIGHTED - - if(disabilities & DISABILITY_FLAG_EPILEPTIC) - character.dna.SetSEState(EPILEPSYBLOCK,1,1) - character.disabilities|=EPILEPSY - - if(disabilities & DISABILITY_FLAG_DEAF) - character.dna.SetSEState(DEAFBLOCK,1,1) - character.disabilities|=DEAF - - if(disabilities & DISABILITY_FLAG_BLIND) - character.dna.SetSEState(BLINDBLOCK,1,1) - character.disabilities|=BLIND - - if(disabilities & DISABILITY_FLAG_MUTE) - character.dna.SetSEState(MUTEBLOCK,1,1) - character.disabilities |= MUTE - - S.handle_dna(character) - - if(character.dna.dirtySE) - character.dna.UpdateSE() - domutcheck(character) // Wheelchair necessary? var/obj/item/organ/external/l_foot = character.get_organ("l_foot") @@ -2170,6 +2138,38 @@ var/global/list/special_role_times = list( //minimum age (in days) for accounts character.change_eye_color(r_eyes, g_eyes, b_eyes) + if(disabilities & DISABILITY_FLAG_FAT && character.species.flags & CAN_BE_FAT) + character.dna.SetSEState(FATBLOCK,1,1) + character.mutations += FAT + character.mutations += OBESITY + character.overeatduration = 600 + + if(disabilities & DISABILITY_FLAG_NEARSIGHTED) + character.dna.SetSEState(GLASSESBLOCK,1,1) + character.disabilities |= NEARSIGHTED + + if(disabilities & DISABILITY_FLAG_EPILEPTIC) + character.dna.SetSEState(EPILEPSYBLOCK,1,1) + character.disabilities |= EPILEPSY + + if(disabilities & DISABILITY_FLAG_DEAF) + character.dna.SetSEState(DEAFBLOCK,1,1) + character.disabilities |= DEAF + + if(disabilities & DISABILITY_FLAG_BLIND) + character.dna.SetSEState(BLINDBLOCK,1,1) + character.disabilities |= BLIND + + if(disabilities & DISABILITY_FLAG_MUTE) + character.dna.SetSEState(MUTEBLOCK,1,1) + character.disabilities |= MUTE + + S.handle_dna(character) + + if(character.dna.dirtySE) + character.dna.UpdateSE() + domutcheck(character, null, MUTCHK_FORCED) + character.dna.ready_dna(character, flatten_SE = 0) character.sync_organ_dna(assimilate=1) character.UpdateAppearance() diff --git a/code/modules/clothing/clothing.dm b/code/modules/clothing/clothing.dm index e2acbed5f66..ab5f8832ab3 100644 --- a/code/modules/clothing/clothing.dm +++ b/code/modules/clothing/clothing.dm @@ -148,11 +148,15 @@ flags = GLASSESCOVERSEYES slot_flags = SLOT_EYES materials = list(MAT_GLASS = 250) - var/emagged = 0 var/vision_flags = 0 - var/darkness_view = 0//Base human is 2 - var/invisa_view = 0 + var/darkness_view = 0 //Base human is 2 + var/invis_view = SEE_INVISIBLE_LIVING + var/invis_override = 0 + + var/emagged = 0 var/color_view = null//overrides client.color while worn + var/prescription = 0 + var/prescription_upgradable = 0 strip_delay = 20 // but seperated to allow items to protect but not impair vision, like space helmets put_on_delay = 25 burn_state = FIRE_PROOF @@ -275,8 +279,8 @@ BLIND // can't see anything var/blockTracking // Do we block AI tracking? var/HUDType = null var/darkness_view = 0 + var/helmet_goggles_invis_view = 0 var/vision_flags = 0 - var/see_darkness = 1 var/can_toggle = null //Mask @@ -343,6 +347,7 @@ BLIND // can't see anything src.loc = user user.wear_mask = null user.put_in_hands(src) + H.wear_mask_update(src, toggle_off = mask_adjusted) usr.update_inv_wear_mask() usr.update_inv_head() for(var/X in actions) @@ -707,4 +712,3 @@ BLIND // can't see anything for(var/obj/item/clothing/accessory/A in accessories) A.emp_act(severity) ..() - diff --git a/code/modules/clothing/glasses/glasses.dm b/code/modules/clothing/glasses/glasses.dm index 4ae3e230762..f8ff3ea4ecc 100644 --- a/code/modules/clothing/glasses/glasses.dm +++ b/code/modules/clothing/glasses/glasses.dm @@ -1,16 +1,3 @@ -/obj/item/clothing/glasses - name = "glasses" - icon = 'icons/obj/clothing/glasses.dmi' - //w_class = 2 - //flags = GLASSESCOVERSEYES - //slot_flags = SLOT_EYES - //var/vision_flags = 0 - //var/darkness_view = 0//Base human is 2 - //var/invisa_view = 0 - var/prescription = 0 - var/prescription_upgradable = 0 - var/see_darkness = 1 - /obj/item/clothing/glasses/New() . = ..() if(prescription_upgradable && prescription) @@ -50,8 +37,8 @@ item_state = "glasses" origin_tech = "magnets=2;engineering=2" vision_flags = SEE_TURFS + invis_view = SEE_INVISIBLE_MINIMUM //don't render darkness while wearing these prescription_upgradable = 1 - see_darkness = 0 //don't render darkness while wearing mesons species_fit = list("Vox") sprite_sheets = list( "Vox" = 'icons/mob/species/vox/eyes.dmi', @@ -113,7 +100,7 @@ icon_state = "nvpurple" item_state = "glasses" darkness_view = 8 - see_darkness = 0 + invis_view = SEE_INVISIBLE_MINIMUM //don't render darkness while wearing these /obj/item/clothing/glasses/janitor name = "Janitorial Goggles" @@ -132,7 +119,7 @@ item_state = "glasses" origin_tech = "magnets=2" darkness_view = 8 - see_darkness = 0 + invis_view = SEE_INVISIBLE_MINIMUM //don't render darkness while wearing these species_fit = list("Vox") sprite_sheets = list( "Vox" = 'icons/mob/species/vox/eyes.dmi', @@ -360,7 +347,9 @@ to_chat(usr, "You push the [src] up out of your face.") flash_protect = 0 tint = 0 - usr.update_inv_glasses() + var/mob/living/carbon/user = usr + user.update_inv_glasses() + user.update_tint() for(var/X in actions) var/datum/action/A = X @@ -399,7 +388,6 @@ item_state = "glasses" origin_tech = "magnets=3" vision_flags = SEE_MOBS - invisa_view = 2 flash_protect = -1 species_fit = list("Vox") sprite_sheets = list( diff --git a/code/modules/clothing/glasses/hud.dm b/code/modules/clothing/glasses/hud.dm index e290ba5308d..18d9b26361f 100644 --- a/code/modules/clothing/glasses/hud.dm +++ b/code/modules/clothing/glasses/hud.dm @@ -47,7 +47,7 @@ icon_state = "healthhudnight" item_state = "glasses" darkness_view = 8 - see_darkness = 0 + invis_view = SEE_INVISIBLE_MINIMUM //don't render darkness while wearing these prescription_upgradable = 0 /obj/item/clothing/glasses/hud/diagnostic @@ -66,7 +66,7 @@ icon_state = "diagnostichudnight" item_state = "glasses" darkness_view = 8 - see_darkness = 0 + invis_view = SEE_INVISIBLE_MINIMUM //don't render darkness while wearing these prescription_upgradable = 0 /obj/item/clothing/glasses/hud/security @@ -95,14 +95,13 @@ icon_state = "jensenshades" item_state = "jensenshades" vision_flags = SEE_MOBS - invisa_view = 2 /obj/item/clothing/glasses/hud/security/night name = "\improper Night Vision Security HUD" desc = "An advanced heads-up display which provides id data and vision in complete darkness." icon_state = "securityhudnight" darkness_view = 8 - see_darkness = 0 + invis_view = SEE_INVISIBLE_MINIMUM //don't render darkness while wearing these prescription_upgradable = 0 /obj/item/clothing/glasses/hud/security/sunglasses @@ -133,5 +132,5 @@ icon_state = "hydroponichudnight" item_state = "glasses" darkness_view = 8 - see_darkness = 0 + invis_view = SEE_INVISIBLE_MINIMUM //don't render darkness while wearing these prescription_upgradable = 0 \ No newline at end of file diff --git a/code/modules/clothing/head/helmet.dm b/code/modules/clothing/head/helmet.dm index f31a6434001..bb47a6e9094 100644 --- a/code/modules/clothing/head/helmet.dm +++ b/code/modules/clothing/head/helmet.dm @@ -63,7 +63,7 @@ name = "night-vision helmet" desc = "A helmet with a built-in pair of night vision goggles." icon_state = "helmetNVG" - see_darkness = 0 + helmet_goggles_invis_view = SEE_INVISIBLE_MINIMUM //don't render darkness while wearing these /obj/item/clothing/head/helmet/alt name = "bulletproof helmet" diff --git a/code/modules/clothing/head/misc_special.dm b/code/modules/clothing/head/misc_special.dm index eb04efcc380..67e4f697eff 100644 --- a/code/modules/clothing/head/misc_special.dm +++ b/code/modules/clothing/head/misc_special.dm @@ -67,6 +67,8 @@ to_chat(usr, "You push the [src] up out of your face.") flash_protect = 0 tint = 0 + var/mob/living/carbon/C = usr + C.update_tint() usr.update_inv_head() //so our mob-overlays update for(var/X in actions) diff --git a/code/modules/clothing/spacesuits/miscellaneous.dm b/code/modules/clothing/spacesuits/miscellaneous.dm index 1c7deb94970..4d7e1011686 100644 --- a/code/modules/clothing/spacesuits/miscellaneous.dm +++ b/code/modules/clothing/spacesuits/miscellaneous.dm @@ -48,7 +48,7 @@ max_heat_protection_temperature = FIRE_IMMUNITY_HELM_MAX_TEMP_PROTECT unacidable = 1 vision_flags = SEE_MOBS - see_darkness = 0 + helmet_goggles_invis_view = SEE_INVISIBLE_MINIMUM //don't render darkness while wearing these HUDType = MEDHUD strip_delay = 130 diff --git a/code/modules/clothing/spacesuits/rig/rig.dm b/code/modules/clothing/spacesuits/rig/rig.dm index 085e57eb25b..7e5dfcad115 100644 --- a/code/modules/clothing/spacesuits/rig/rig.dm +++ b/code/modules/clothing/spacesuits/rig/rig.dm @@ -504,11 +504,18 @@ cell.use(cost*10) return 1 -/obj/item/weapon/rig/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1, var/nano_state = inventory_state) +/obj/item/weapon/rig/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1, var/datum/topic_state/state = inventory_state) if(!user) return - var/list/data = list() + ui = nanomanager.try_update_ui(user, src, ui_key, ui, force_open) + if(!ui) + ui = new(user, src, ui_key, ((src.loc != user) ? ai_interface_path : interface_path), interface_title, 480, 550, state = state) + ui.open() + ui.set_auto_update(1) + +/obj/item/weapon/rig/ui_data(mob/user, datum/topic_state/state = inventory_state) + var/data[0] data["primarysystem"] = null if(selected_module) @@ -575,12 +582,7 @@ if(module_list.len) data["modules"] = module_list - ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open) - if(!ui) - ui = new(user, src, ui_key, ((src.loc != user) ? ai_interface_path : interface_path), interface_title, 480, 550, state = nano_state) - ui.set_initial_data(data) - ui.open() - ui.set_auto_update(1) + return data /obj/item/weapon/rig/update_icon(var/update_mob_icon) diff --git a/code/modules/computer3/bios.dm b/code/modules/computer3/bios.dm index 564156540d3..e8f1b1f8c4c 100644 --- a/code/modules/computer3/bios.dm +++ b/code/modules/computer3/bios.dm @@ -77,7 +77,7 @@ user.unset_machine() return null - user.reset_view(S.current) + user.reset_perspective(S.current) return 1 /* diff --git a/code/modules/computer3/computers/camera.dm b/code/modules/computer3/computers/camera.dm index 52001231647..76fdc4d3d2d 100644 --- a/code/modules/computer3/computers/camera.dm +++ b/code/modules/computer3/computers/camera.dm @@ -237,7 +237,7 @@ computer.update_icon() for(var/mob/living/L in viewers(1)) if(!istype(L,/mob/living/silicon/ai) && L.machine == src) - L.reset_view(null) + L.reset_perspective(null) Reset() @@ -245,7 +245,7 @@ current = null for(var/mob/living/L in viewers(1)) if(!istype(L,/mob/living/silicon/ai) && L.machine == src) - L.reset_view(null) + L.reset_perspective(null) interact() if(!interactable()) @@ -265,7 +265,7 @@ return if(computer.camnet.verify_machine(current)) - usr.reset_view(current) + usr.reset_perspective(current) if(world.time - last_camera_refresh > 50 || !camera_list) last_camera_refresh = world.time @@ -302,13 +302,13 @@ var/obj/machinery/camera/C = locate(href_list["show"]) if(istype(C) && C.status) current = C - usr.reset_view(C) + usr.reset_perspective(C) interact() return if("keyselect" in href_list) current = null - usr.reset_view(null) + usr.reset_perspective(null) key = input(usr,"Select a camera network key:", "Key Select", null) as null|anything in computer.list_files(/datum/file/camnet_key) camera_list = null update_icon() diff --git a/code/modules/computer3/computers/medical.dm b/code/modules/computer3/computers/medical.dm index 1931f183077..c54b4867d7e 100644 --- a/code/modules/computer3/computers/medical.dm +++ b/code/modules/computer3/computers/medical.dm @@ -45,7 +45,6 @@ if(!computer.cardslot) computer.Crash(MISSING_PERIPHERAL) return - usr.set_machine(src) scan = computer.cardslot.reader if(!interactable()) return diff --git a/code/modules/computer3/computers/security.dm b/code/modules/computer3/computers/security.dm index 249e49c6bce..c3c05c11d19 100644 --- a/code/modules/computer3/computers/security.dm +++ b/code/modules/computer3/computers/security.dm @@ -48,7 +48,6 @@ if(!computer.cardslot) computer.Crash(MISSING_PERIPHERAL) return - usr.set_machine(src) scan = computer.cardslot.reader if(computer.cardslot.dualslot) diff --git a/code/modules/computer3/computers/station_alert.dm b/code/modules/computer3/computers/station_alert.dm index d782cad7636..82c57cc7ee5 100644 --- a/code/modules/computer3/computers/station_alert.dm +++ b/code/modules/computer3/computers/station_alert.dm @@ -11,7 +11,6 @@ var/alarms = list("Fire"=list(), "Atmosphere"=list(), "Power"=list()) interact(mob/user) - usr.set_machine(src) if(!interactable()) return var/dat = "Current Station Alerts\n" diff --git a/code/modules/crafting/recipes.dm b/code/modules/crafting/recipes.dm index 6f946146aa4..288dcfcd9c5 100644 --- a/code/modules/crafting/recipes.dm +++ b/code/modules/crafting/recipes.dm @@ -71,12 +71,11 @@ /obj/item/clothing/suit/armor/vest = 1, /obj/item/robot_parts/l_leg = 1, /obj/item/robot_parts/r_leg = 1, - /obj/item/stack/sheet/metal = 5, - /obj/item/stack/cable_coil = 5, + /obj/item/stack/sheet/metal = 1, + /obj/item/stack/cable_coil = 1, /obj/item/weapon/gun/energy/gun/advtaser = 1, /obj/item/weapon/stock_parts/cell = 1, - /obj/item/device/assembly/prox_sensor = 1, - /obj/item/robot_parts/r_arm = 1) + /obj/item/device/assembly/prox_sensor = 1) tools = list(/obj/item/weapon/weldingtool, /obj/item/weapon/screwdriver) time = 60 category = CAT_ROBOT diff --git a/code/modules/economy/Accounts_DB.dm b/code/modules/economy/Accounts_DB.dm index 5a3a5814a70..1b238acea6e 100644 --- a/code/modules/economy/Accounts_DB.dm +++ b/code/modules/economy/Accounts_DB.dm @@ -76,10 +76,16 @@ /obj/machinery/computer/account_database/attack_hand(mob/user as mob) ui_interact(user) -/obj/machinery/computer/account_database/ui_interact(mob/user, ui_key="main", var/datum/nanoui/ui = null, var/force_open = 1) +/obj/machinery/computer/account_database/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1) user.set_machine(src) + ui = nanomanager.try_update_ui(user, src, ui_key, ui, force_open) + if(!ui) + ui = new(user, src, ui_key, "accounts_terminal.tmpl", src.name, 400, 640) + ui.open() +/obj/machinery/computer/account_database/ui_data(mob/user, datum/topic_state/state = default_state) var/data[0] + data["src"] = UID() data["id_inserted"] = !!held_card data["id_card"] = held_card ? text("[held_card.registered_name], [held_card.assignment]") : "-----" @@ -122,11 +128,7 @@ if(accounts.len > 0) data["accounts"] = accounts - ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open) - if(!ui) - ui = new(user, src, ui_key, "accounts_terminal.tmpl", src.name, 400, 640) - ui.set_initial_data(data) - ui.open() + return data /obj/machinery/computer/account_database/Topic(href, href_list) if(..()) diff --git a/code/modules/food_and_drinks/kitchen_machinery/smartfridge.dm b/code/modules/food_and_drinks/kitchen_machinery/smartfridge.dm index 2446b74ad22..4c487d05afb 100644 --- a/code/modules/food_and_drinks/kitchen_machinery/smartfridge.dm +++ b/code/modules/food_and_drinks/kitchen_machinery/smartfridge.dm @@ -317,7 +317,14 @@ /obj/machinery/smartfridge/ui_interact(mob/user, ui_key = "main", datum/nanoui/ui = null, force_open = 1) user.set_machine(src) + ui = nanomanager.try_update_ui(user, src, ui_key, ui, force_open) + if(!ui) + ui = new(user, src, ui_key, "smartfridge.tmpl", name, 400, 500) + ui.open() + +/obj/machinery/smartfridge/ui_data(mob/user, datum/topic_state/state = default_state) var/data[0] + data["contents"] = null data["electrified"] = seconds_electrified > 0 data["shoot_inventory"] = shoot_inventory @@ -334,11 +341,7 @@ if(items.len > 0) data["contents"] = items - ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open) - if(!ui) - ui = new(user, src, ui_key, "smartfridge.tmpl", name, 400, 500) - ui.set_initial_data(data) - ui.open() + return data /obj/machinery/smartfridge/Topic(href, href_list) if(..()) return 0 @@ -410,4 +413,4 @@ to_chat(usr, "Access denied.") nanomanager.update_uis(src) return 0 - return ..() \ No newline at end of file + return ..() diff --git a/code/modules/hydroponics/seed_machines.dm b/code/modules/hydroponics/seed_machines.dm index 42323841094..c50503d7aa5 100644 --- a/code/modules/hydroponics/seed_machines.dm +++ b/code/modules/hydroponics/seed_machines.dm @@ -157,11 +157,17 @@ degrade_upper = 70 - (tier * 10) //Tier 1: 60, Tier 4: 30 /obj/machinery/botany/extractor/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1) - if(!user) return - var/list/data = list() + ui = nanomanager.try_update_ui(user, src, ui_key, ui, force_open) + if(!ui) + ui = new(user, src, ui_key, "botany_isolator.tmpl", "Lysis-isolation Centrifuge UI", 470, 450) + ui.open() + ui.set_auto_update(1) + +/obj/machinery/botany/extractor/ui_data(mob/user, datum/topic_state/state = default_state) + var/data[0] var/list/geneMasks[0] for(var/gene_tag in plant_controller.gene_tag_list) @@ -190,12 +196,7 @@ data["hasGenetics"] = 0 data["sourceName"] = 0 - ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open) - if(!ui) - ui = new(user, src, ui_key, "botany_isolator.tmpl", "Lysis-isolation Centrifuge UI", 470, 450) - ui.set_initial_data(data) - ui.open() - ui.set_auto_update(1) + return data /obj/machinery/botany/Topic(href, href_list) @@ -308,11 +309,17 @@ degrade_upper = 11 - tier //Tier 1: 10, Tier 4: 6 /obj/machinery/botany/editor/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1) - if(!user) return - var/list/data = list() + ui = nanomanager.try_update_ui(user, src, ui_key, ui, force_open) + if(!ui) + ui = new(user, src, ui_key, "botany_editor.tmpl", "Bioballistic Delivery UI", 470, 450) + ui.open() + ui.set_auto_update(1) + +/obj/machinery/botany/editor/ui_data(mob/user, datum/topic_state/state = default_state) + var/data[0] data["activity"] = active @@ -340,12 +347,7 @@ else data["loaded"] = 0 - ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open) - if(!ui) - ui = new(user, src, ui_key, "botany_editor.tmpl", "Bioballistic Delivery UI", 470, 450) - ui.set_initial_data(data) - ui.open() - ui.set_auto_update(1) + return data /obj/machinery/botany/editor/Topic(href, href_list) diff --git a/code/modules/karma/karma.dm b/code/modules/karma/karma.dm index e8c047c98bc..bdd73533c82 100644 --- a/code/modules/karma/karma.dm +++ b/code/modules/karma/karma.dm @@ -84,7 +84,7 @@ var/list/karma_spenders = list() /mob/verb/spend_karma_list() set name = "Award Karma" set desc = "Let the gods know whether someone's been nice. Can only be used once per round." - set category = "Special Verbs" + set category = "OOC" if(!can_give_karma()) return @@ -113,7 +113,7 @@ var/list/karma_spenders = list() /mob/verb/spend_karma(var/mob/M) set name = "Award Karma to Player" set desc = "Let the gods know whether someone's been nice. Can only be used once per round." - set category = "Special Verbs" + set category = "OOC" if(!M) to_chat(usr, "Please right click a mob to award karma directly, or use the 'Award Karma' verb to select a player from the player listing.") @@ -144,8 +144,8 @@ var/list/karma_spenders = list() /client/verb/check_karma() set name = "Check Karma" - set category = "Special Verbs" set desc = "Reports how much karma you have accrued." + set category = "OOC" var/currentkarma=verify_karma() to_chat(usr, {"
You have [currentkarma] available."}) diff --git a/code/modules/mining/equipment_locker.dm b/code/modules/mining/equipment_locker.dm index 56f71c94cb9..fb98f3a8c15 100644 --- a/code/modules/mining/equipment_locker.dm +++ b/code/modules/mining/equipment_locker.dm @@ -105,34 +105,30 @@ i++ /obj/machinery/mineral/ore_redemption/attackby(var/obj/item/weapon/W, var/mob/user, params) - if(!powered()) - return - if(istype(W,/obj/item/weapon/card/id)) - var/obj/item/weapon/card/id/I = usr.get_active_hand() - if(istype(I) && !istype(inserted_id)) - if(!user.drop_item()) - return - I.loc = src - inserted_id = I - interact(user) - return - if(default_deconstruction_screwdriver(user, "ore_redemption-open", "ore_redemption", W)) updateUsrDialog() return - if(exchange_parts(user, W)) return - if(panel_open) if(istype(W, /obj/item/weapon/crowbar)) empty_content() default_deconstruction_crowbar(W) return - if(default_unfasten_wrench(user, W)) return - + if(istype(W,/obj/item/weapon/card/id)) + if(!powered()) + return + else + var/obj/item/weapon/card/id/I = usr.get_active_hand() + if(istype(I) && !istype(inserted_id)) + if(!user.drop_item()) + return + I.forceMove(src) + inserted_id = I + interact(user) + return ..() /obj/machinery/mineral/ore_redemption/proc/SmeltMineral(var/obj/item/weapon/ore/O) @@ -437,18 +433,6 @@ return /obj/machinery/mineral/equipment_vendor/attackby(obj/item/I as obj, mob/user as mob, params) - if(istype(I, /obj/item/weapon/mining_voucher)) - RedeemVoucher(I, user) - return - if(istype(I,/obj/item/weapon/card/id)) - var/obj/item/weapon/card/id/C = usr.get_active_hand() - if(istype(C) && !istype(inserted_id)) - if(!usr.drop_item()) - return - C.loc = src - inserted_id = C - interact(user) - return if(default_deconstruction_screwdriver(user, "mining-open", "mining", I)) updateUsrDialog() return @@ -456,6 +440,24 @@ if(istype(I, /obj/item/weapon/crowbar)) default_deconstruction_crowbar(I) return 1 + if(istype(I, /obj/item/weapon/mining_voucher)) + if(!powered()) + return + else + RedeemVoucher(I, user) + return + if(istype(I,/obj/item/weapon/card/id)) + if(!powered()) + return + else + var/obj/item/weapon/card/id/C = usr.get_active_hand() + if(istype(C) && !istype(inserted_id)) + if(!usr.drop_item()) + return + C.forceMove(src) + inserted_id = C + interact(user) + return ..() /obj/machinery/mineral/equipment_vendor/proc/RedeemVoucher(obj/item/weapon/mining_voucher/voucher, mob/redeemer) diff --git a/code/modules/mining/mine_items.dm b/code/modules/mining/mine_items.dm index 9e4f7289532..83e794b9d20 100644 --- a/code/modules/mining/mine_items.dm +++ b/code/modules/mining/mine_items.dm @@ -251,9 +251,6 @@ /obj/item/device/mobcapsule/proc/dump_contents(mob/user) if(captured) captured.forceMove(get_turf(src)) - if(captured.client) - captured.client.eye = captured.client.mob - captured.client.perspective = MOB_PERSPECTIVE captured = null /obj/item/device/mobcapsule/attack_self(mob/user) @@ -530,4 +527,4 @@ if(do_after(user, 20, target = src)) new /obj/item/stack/rods(loc) qdel(src) - return ..() \ No newline at end of file + return ..() diff --git a/code/modules/mob/holder.dm b/code/modules/mob/holder.dm index ed867cd5178..d23df61e993 100644 --- a/code/modules/mob/holder.dm +++ b/code/modules/mob/holder.dm @@ -22,7 +22,7 @@ var/atom/movable/mob_container mob_container = M mob_container.forceMove(get_turf(src)) - M.reset_view() + M.reset_perspective() qdel(src) diff --git a/code/modules/mob/living/carbon/alien/humanoid/alien_powers.dm b/code/modules/mob/living/carbon/alien/humanoid/alien_powers.dm index 28439ab0ff2..4292f101eb5 100644 --- a/code/modules/mob/living/carbon/alien/humanoid/alien_powers.dm +++ b/code/modules/mob/living/carbon/alien/humanoid/alien_powers.dm @@ -125,6 +125,7 @@ Doesn't work on other aliens/AI.*/ A.xo = U.x - T.x A.fire() A.newtonian_move(get_dir(U, T)) + newtonian_move(get_dir(U, T)) return /mob/living/carbon/alien/humanoid/proc/resin() // -- TLE diff --git a/code/modules/mob/living/carbon/alien/humanoid/login.dm b/code/modules/mob/living/carbon/alien/humanoid/login.dm deleted file mode 100644 index 914371a969d..00000000000 --- a/code/modules/mob/living/carbon/alien/humanoid/login.dm +++ /dev/null @@ -1,6 +0,0 @@ -/mob/living/carbon/alien/humanoid/Login() - ..() - if(!isturf(loc)) - client.eye = loc - client.perspective = EYE_PERSPECTIVE - return diff --git a/code/modules/mob/living/carbon/alien/life.dm b/code/modules/mob/living/carbon/alien/life.dm index cf602694233..80585fad863 100644 --- a/code/modules/mob/living/carbon/alien/life.dm +++ b/code/modules/mob/living/carbon/alien/life.dm @@ -31,21 +31,31 @@ return 1 /mob/living/carbon/alien/update_sight() - if(stat == DEAD || (XRAY in mutations)) - sight |= SEE_TURFS - sight |= SEE_MOBS - sight |= SEE_OBJS + if(!client) + return + if(stat == DEAD) + grant_death_vision() + return + + sight = SEE_MOBS + if(nightvision) see_in_dark = 8 + see_invisible = SEE_INVISIBLE_MINIMUM + else + see_in_dark = 4 see_invisible = SEE_INVISIBLE_LEVEL_TWO - else if(stat != DEAD) - sight |= SEE_MOBS - sight &= ~SEE_TURFS - sight &= ~SEE_OBJS - if(nightvision) - see_in_dark = 8 - see_invisible = SEE_INVISIBLE_MINIMUM - else if(!nightvision) - see_in_dark = 4 - see_invisible = 45 - if(see_override) - see_invisible = see_override + + if(client.eye != src) + var/atom/A = client.eye + if(A.update_remote_sight(src)) //returns 1 if we override all other sight updates. + return + + for(var/obj/item/organ/internal/cyberimp/eyes/E in internal_organs) + sight |= E.vision_flags + if(E.dark_view) + see_in_dark = max(see_in_dark, E.dark_view) + if(E.see_invisible) + see_invisible = min(see_invisible, E.see_invisible) + + if(see_override) + see_invisible = see_override diff --git a/code/modules/mob/living/carbon/brain/life.dm b/code/modules/mob/living/carbon/brain/life.dm index 74d096d9518..e61f8750901 100644 --- a/code/modules/mob/living/carbon/brain/life.dm +++ b/code/modules/mob/living/carbon/brain/life.dm @@ -62,22 +62,5 @@ . = 1 -/mob/living/carbon/brain/handle_vision() - ..() - - if(stat == 2 || (XRAY in src.mutations)) - sight |= SEE_TURFS - sight |= SEE_MOBS - sight |= SEE_OBJS - see_in_dark = 8 - see_invisible = SEE_INVISIBLE_LEVEL_TWO - else if(stat != 2) - sight &= ~SEE_TURFS - sight &= ~SEE_MOBS - sight &= ~SEE_OBJS - see_in_dark = 2 - see_invisible = SEE_INVISIBLE_LIVING - handle_hud_icons_health() - /mob/living/carbon/brain/breathe() return diff --git a/code/modules/mob/living/carbon/carbon.dm b/code/modules/mob/living/carbon/carbon.dm index f62df2ab76b..a26b5e967af 100644 --- a/code/modules/mob/living/carbon/carbon.dm +++ b/code/modules/mob/living/carbon/carbon.dm @@ -537,6 +537,7 @@ var/list/ventcrawl_machinery = list(/obj/machinery/atmospherics/unary/vent_pump, thrown_thing = throwable_mob var/turf/start_T = get_turf(loc) //Get the start and target tile for the descriptors var/turf/end_T = get_turf(target) + throwable_mob.forceMove(start_T) if(start_T && end_T) var/start_T_descriptor = "tile at [start_T.x], [start_T.y], [start_T.z] in area [get_area(start_T)]" var/end_T_descriptor = "tile at [end_T.x], [end_T.y], [end_T.z] in area [get_area(end_T)]" @@ -1038,3 +1039,49 @@ so that different stomachs can handle things in different ways VB*/ /mob/living/carbon/proc/update_internals_hud_icon(internal_state = 0) if(hud_used && hud_used.internals) hud_used.internals.icon_state = "internal[internal_state]" + +//to recalculate and update the mob's total tint from tinted equipment it's wearing. +/mob/living/carbon/proc/update_tint() + if(!tinted_weldhelh) + return + var/tinttotal = get_total_tint() + if(tinttotal >= TINT_BLIND) + overlay_fullscreen("tint", /obj/screen/fullscreen/blind) + else if(tinttotal >= TINT_IMPAIR) + overlay_fullscreen("tint", /obj/screen/fullscreen/impaired, 2) + else + clear_fullscreen("tint", 0) + +/mob/living/carbon/proc/get_total_tint() + . = 0 + if(istype(head, /obj/item/clothing/head)) + var/obj/item/clothing/head/HT = head + . += HT.tint + if(wear_mask) + . += wear_mask.tint + +/mob/living/carbon/human/get_total_tint() + . = ..() + if(glasses) + var/obj/item/clothing/glasses/G = glasses + . += G.tint + + +//handle stuff to update when a mob equips/unequips a mask. +/mob/living/proc/wear_mask_update(obj/item/clothing/C, toggle_off = 1) + update_inv_wear_mask() + +/mob/living/carbon/wear_mask_update(obj/item/clothing/C, toggle_off = 1) + if(C.tint || initial(C.tint)) + update_tint() + update_inv_wear_mask() + +//handle stuff to update when a mob equips/unequips a headgear. +/mob/living/carbon/proc/head_update(obj/item/I, forced) + if(istype(I, /obj/item/clothing)) + var/obj/item/clothing/C = I + if(C.tint || initial(C.tint)) + update_tint() + if(I.flags_inv & HIDEMASK || forced) + update_inv_wear_mask() + update_inv_head() diff --git a/code/modules/mob/living/carbon/human/appearance.dm b/code/modules/mob/living/carbon/human/appearance.dm index eb58d39ea7c..ad1ab28c435 100644 --- a/code/modules/mob/living/carbon/human/appearance.dm +++ b/code/modules/mob/living/carbon/human/appearance.dm @@ -43,6 +43,7 @@ H.h_style = hair_style update_hair() + update_inv_glasses() return 1 /mob/living/carbon/human/proc/change_facial_hair(var/facial_hair_style) diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index 170673d2395..cd0e9d751c9 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -49,9 +49,6 @@ dna.real_name = real_name sync_organ_dna(1) - if(species) - species.handle_dna(src) - UpdateAppearance() /mob/living/carbon/human/OpenCraftingMenu() @@ -724,6 +721,17 @@ if(istype(id)) return id + + +/mob/living/carbon/human/update_sight() + if(!client) + return + if(stat == DEAD) + grant_death_vision() + return + + species.update_sight(src) + //Removed the horrible safety parameter. It was only being used by ninja code anyways. //Now checks siemens_coefficient of the affected area by default /mob/living/carbon/human/electrocute_act(shock_damage, obj/source, siemens_coeff = 1, safety = 0, override = 0, tesla_shock = 0) @@ -1594,6 +1602,7 @@ dna.real_name = real_name species.handle_post_spawn(src) + species.handle_dna(src) //Give them whatever special dna business they got. spawn(0) overlays.Cut() diff --git a/code/modules/mob/living/carbon/human/human_organs.dm b/code/modules/mob/living/carbon/human/human_organs.dm index 50f1e7cd342..2f07fdacd07 100644 --- a/code/modules/mob/living/carbon/human/human_organs.dm +++ b/code/modules/mob/living/carbon/human/human_organs.dm @@ -201,3 +201,12 @@ I use this to standardize shadowling dethrall code return null var/obj/item/organ/internal/O = get_int_organ(organ_name) return O.parent_organ + +/mob/living/carbon/human/has_organic_damage() + var/odmg = 0 + for(var/obj/item/organ/external/O in organs) + if(O.status & ORGAN_ROBOT) + odmg += O.brute_dam + odmg += O.burn_dam + return (health < (100 - odmg)) + diff --git a/code/modules/mob/living/carbon/human/inventory.dm b/code/modules/mob/living/carbon/human/inventory.dm index 88b81dcef4a..4e90d763e9e 100644 --- a/code/modules/mob/living/carbon/human/inventory.dm +++ b/code/modules/mob/living/carbon/human/inventory.dm @@ -111,6 +111,13 @@ update_inv_gloves() else if(I == glasses) glasses = null + var/obj/item/clothing/glasses/G = I + if(G.tint) + update_tint() + if(G.prescription) + clear_fullscreen("nearsighted") + if(G.vision_flags || G.darkness_view || G.invis_override || G.invis_view) + update_sight() update_inv_glasses() else if(I == head) head = null @@ -118,6 +125,12 @@ update_hair() //rebuild hair update_fhair() update_head_accessory() + // Bandanas and paper hats go on the head but are not head clothing + if(istype(I,/obj/item/clothing/head)) + var/obj/item/clothing/head/hat = I + if(hat.vision_flags || hat.darkness_view || hat.helmet_goggles_invis_view) + update_sight() + head_update(I) update_inv_head() else if(I == r_ear) r_ear = null @@ -140,6 +153,7 @@ if(internal) internal = null update_internals_hud_icon(0) + wear_mask_update(I, toggle_off = FALSE) sec_hud_set_ID() update_inv_wear_mask() else if(I == wear_id) @@ -203,6 +217,7 @@ update_head_accessory(redraw_mob) if(hud_list.len) sec_hud_set_ID() + wear_mask_update(W, toggle_off = TRUE) update_inv_wear_mask(redraw_mob) if(slot_handcuffed) handcuffed = W @@ -247,6 +262,14 @@ update_inv_ears(redraw_mob) if(slot_glasses) glasses = W + var/obj/item/clothing/glasses/G = W + if(G.tint) + update_tint() + if(G.prescription) + if(disabilities & NEARSIGHTED) + overlay_fullscreen("nearsighted", /obj/screen/fullscreen/impaired, 1) + if(G.vision_flags || G.darkness_view || G.invis_override || G.invis_view) + update_sight() update_inv_glasses(redraw_mob) if(slot_gloves) gloves = W @@ -257,6 +280,12 @@ update_hair(redraw_mob) //rebuild hair update_fhair(redraw_mob) update_head_accessory(redraw_mob) + // paper + bandanas + if(istype(W, /obj/item/clothing/head)) + var/obj/item/clothing/head/hat = W + if(hat.vision_flags || hat.darkness_view || hat.helmet_goggles_invis_view) + update_sight() + head_update(W) update_inv_head(redraw_mob) if(slot_shoes) shoes = W diff --git a/code/modules/mob/living/carbon/human/life.dm b/code/modules/mob/living/carbon/human/life.dm index cfeb6e88faa..052d528df0b 100644 --- a/code/modules/mob/living/carbon/human/life.dm +++ b/code/modules/mob/living/carbon/human/life.dm @@ -1,8 +1,5 @@ //This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:32 -#define TINT_IMPAIR 2 //Threshold of tint level to apply weld mask overlay -#define TINT_BLIND 3 //Threshold of tint level to obscure vision fully - /mob/living/carbon/human var/pressure_alert = 0 @@ -12,11 +9,9 @@ var/exposedtimenow = 0 var/firstexposed = 0 var/heartbeat = 0 - var/tinttotal = 0 // Total level of visually impairing items /mob/living/carbon/human/Life() fire_alert = 0 //Reset this here, because both breathe() and handle_environment() have a chance to set it. - tinttotal = tintcheck() //here as both hud updates and status updates call it life_tick++ in_stasis = 0 @@ -899,7 +894,7 @@ /mob/living/carbon/human/handle_vision() if(machine) - if(!machine.check_eye(src)) reset_view(null) + if(!machine.check_eye(src)) reset_perspective(null) else var/isRemoteObserve = 0 if((REMOTE_VIEW in mutations) && remoteview_target) @@ -924,7 +919,7 @@ if(!isRemoteObserve && client && !client.adminobs) remoteview_target = null - reset_view(null) + reset_perspective(null) species.handle_vision(src) diff --git a/code/modules/mob/living/carbon/human/species/species.dm b/code/modules/mob/living/carbon/human/species/species.dm index 2af29aefe72..cfd925fd14f 100644 --- a/code/modules/mob/living/carbon/human/species/species.dm +++ b/code/modules/mob/living/carbon/human/species/species.dm @@ -46,6 +46,7 @@ var/siemens_coeff = 1 //base electrocution coefficient + var/invis_sight = SEE_INVISIBLE_LIVING var/darksight = 2 var/hazard_high_pressure = HAZARD_HIGH_PRESSURE // Dangerously high pressure. var/warning_high_pressure = WARNING_HIGH_PRESSURE // High pressure warning. @@ -470,118 +471,7 @@ return 0 /datum/species/proc/handle_vision(mob/living/carbon/human/H) - if(H.stat == DEAD) - H.sight |= (SEE_TURFS|SEE_MOBS|SEE_OBJS) - H.see_in_dark = 8 - if(!H.druggy) - H.see_invisible = SEE_INVISIBLE_LEVEL_TWO - return - - H.sight &= ~(SEE_TURFS|SEE_MOBS|SEE_OBJS) - - H.see_in_dark = darksight //set their variables to default, modify them later - H.see_invisible = SEE_INVISIBLE_LIVING - - if(H.mind && H.mind.vampire) - if(H.mind.vampire.get_ability(/datum/vampire_passive/full)) - H.sight |= SEE_TURFS|SEE_MOBS|SEE_OBJS - H.see_in_dark = 8 - H.see_invisible = SEE_INVISIBLE_MINIMUM - else if(H.mind.vampire.get_ability(/datum/vampire_passive/vision)) - H.sight |= SEE_MOBS - - - if(XRAY in H.mutations) - H.sight |= SEE_TURFS|SEE_MOBS|SEE_OBJS - H.see_in_dark = 8 - - H.see_invisible = SEE_INVISIBLE_MINIMUM - - - if(H.seer == 1) - var/obj/effect/rune/R = locate() in H.loc - if(R && R.word1 == cultwords["see"] && R.word2 == cultwords["hell"] && R.word3 == cultwords["join"]) - H.see_invisible = SEE_INVISIBLE_OBSERVER - else - H.see_invisible = SEE_INVISIBLE_LIVING - H.seer = 0 - - //This checks how much the mob's eyewear impairs their vision - if(H.tinttotal >= TINT_IMPAIR) - if(tinted_weldhelh) - H.overlay_fullscreen("tint", /obj/screen/fullscreen/impaired, 2) - if(H.tinttotal >= TINT_BLIND) - H.EyeBlind(1) - else - H.clear_fullscreen("tint") - - var/minimum_darkness_view = INFINITY - if(H.glasses) - if(istype(H.glasses, /obj/item/clothing/glasses)) - var/obj/item/clothing/glasses/G = H.glasses - H.sight |= G.vision_flags - - if(G.darkness_view) - H.see_in_dark = G.darkness_view - minimum_darkness_view = G.darkness_view - - if(!G.see_darkness) - H.see_invisible = SEE_INVISIBLE_MINIMUM - - if(H.head) - if(istype(H.head, /obj/item/clothing/head)) - var/obj/item/clothing/head/hat = H.head - H.sight |= hat.vision_flags - - if(hat.darkness_view && hat.darkness_view < minimum_darkness_view) // Pick the lowest of the two darkness_views between the glasses and helmet. - H.see_in_dark = hat.darkness_view - - if(!hat.see_darkness) - H.see_invisible = SEE_INVISIBLE_MINIMUM - - //switch(hat.HUDType) - // if(SECHUD) - // process_sec_hud(H,1) - // if(MEDHUD) - // process_med_hud(H,1) - // if(ANTAGHUD) - // process_antag_hud(H) - - if(istype(H.back, /obj/item/weapon/rig)) ///ahhhg so snowflakey - var/obj/item/weapon/rig/rig = H.back - if(rig.visor) - if(!rig.helmet || (H.head && rig.helmet == H.head)) - if(rig.visor && rig.visor.vision && rig.visor.active && rig.visor.vision.glasses) - var/obj/item/clothing/glasses/G = rig.visor.vision.glasses - if(istype(G)) - H.see_in_dark = (G.darkness_view ? G.darkness_view : darksight) // Otherwise we keep our darkness view with togglable nightvision. - if(G.vision_flags) // MESONS - H.sight |= G.vision_flags - - if(!G.see_darkness) - H.see_invisible = SEE_INVISIBLE_MINIMUM - - //switch(G.HUDType) - // if(SECHUD) - // process_sec_hud(H,1) - // if(MEDHUD) - // process_med_hud(H,1) - // if(ANTAGHUD) - // process_antag_hud(H) - - if(H.vision_type) - H.see_in_dark = max(H.see_in_dark, H.vision_type.see_in_dark, darksight) - H.see_invisible = H.vision_type.see_invisible - if(H.vision_type.light_sensitive) - H.weakeyes = 1 - H.sight |= H.vision_type.sight_flags - - if(H.see_override) //Override all - H.see_invisible = H.see_override - - if(!H.client) - return 1 - + // Right now this just handles blind, blurry, and similar states if(H.blinded || H.eye_blind) H.overlay_fullscreen("blind", /obj/screen/fullscreen/blind) H.throw_alert("blind", /obj/screen/alert/blind) @@ -684,3 +574,92 @@ It'll return null if the organ doesn't correspond, so include null checks when u if(!(organ_slot in has_organ)) return null return has_organ[organ_slot] + + +/datum/species/proc/update_sight(mob/living/carbon/human/H) + H.sight = initial(H.sight) + H.see_in_dark = darksight + H.see_invisible = invis_sight + + if(H.client.eye != H) + var/atom/A = H.client.eye + if(A.update_remote_sight(H)) //returns 1 if we override all other sight updates. + return + + if(H.mind && H.mind.vampire) + if(H.mind.vampire.get_ability(/datum/vampire_passive/full)) + H.sight |= SEE_TURFS|SEE_MOBS|SEE_OBJS + H.see_in_dark = 8 + H.see_invisible = SEE_INVISIBLE_MINIMUM + else if(H.mind.vampire.get_ability(/datum/vampire_passive/vision)) + H.sight |= SEE_MOBS + + for(var/obj/item/organ/internal/cyberimp/eyes/E in H.internal_organs) + H.sight |= E.vision_flags + if(E.dark_view) + H.see_in_dark = E.dark_view + if(E.see_invisible) + H.see_invisible = min(H.see_invisible, E.see_invisible) + + + if(H.seer == 1) + var/obj/effect/rune/R = locate() in H.loc + if(R && R.word1 == cultwords["see"] && R.word2 == cultwords["hell"] && R.word3 == cultwords["join"]) + H.see_invisible = SEE_INVISIBLE_OBSERVER + else + H.see_invisible = SEE_INVISIBLE_LIVING + H.seer = 0 + + var/lesser_darkview_bonus = INFINITY + // my glasses, I can't see without my glasses + if(H.glasses) + var/obj/item/clothing/glasses/G = H.glasses + H.sight |= G.vision_flags + lesser_darkview_bonus = G.darkness_view + if(G.invis_override) + H.see_invisible = G.invis_override + else + H.see_invisible = min(G.invis_view, H.see_invisible) + + // better living through hat trading + if(H.head) + if(istype(H.head, /obj/item/clothing/head)) + var/obj/item/clothing/head/hat = H.head + H.sight |= hat.vision_flags + + if(hat.darkness_view) // Pick the lowest of the two darkness_views between the glasses and helmet. + lesser_darkview_bonus = min(hat.darkness_view,lesser_darkview_bonus) + + if(hat.helmet_goggles_invis_view) + H.see_invisible = min(hat.helmet_goggles_invis_view, H.see_invisible) + + if(istype(H.back, /obj/item/weapon/rig)) ///aghhh so snowflakey + var/obj/item/weapon/rig/rig = H.back + if(rig.visor) + if(!rig.helmet || (H.head && rig.helmet == H.head)) + if(rig.visor && rig.visor.vision && rig.visor.active && rig.visor.vision.glasses) + var/obj/item/clothing/glasses/G = rig.visor.vision.glasses + if(istype(G)) + H.see_in_dark = (G.darkness_view ? G.darkness_view : darksight) // Otherwise we keep our darkness view with togglable nightvision. + if(G.vision_flags) // MESONS + H.sight |= G.vision_flags + + H.see_invisible = min(G.invis_view, H.see_invisible) + + if(lesser_darkview_bonus != INFINITY) + H.see_in_dark = max(lesser_darkview_bonus, H.see_in_dark) + + if(H.vision_type) + H.see_in_dark = max(H.see_in_dark, H.vision_type.see_in_dark, darksight) + H.see_invisible = H.vision_type.see_invisible + if(H.vision_type.light_sensitive) + H.weakeyes = 1 + H.sight |= H.vision_type.sight_flags + + if(XRAY in H.mutations) + H.sight |= (SEE_TURFS|SEE_MOBS|SEE_OBJS) + H.see_in_dark = max(H.see_in_dark, 8) + H.see_invisible = SEE_INVISIBLE_MINIMUM + + if(H.see_override) //Override all + H.see_invisible = H.see_override diff --git a/code/modules/mob/living/carbon/human/update_icons.dm b/code/modules/mob/living/carbon/human/update_icons.dm index 037e5234d27..48555229aad 100644 --- a/code/modules/mob/living/carbon/human/update_icons.dm +++ b/code/modules/mob/living/carbon/human/update_icons.dm @@ -395,6 +395,7 @@ var/global/list/damage_icon_parts = list() /mob/living/carbon/human/proc/update_head_accessory(var/update_icons=1) //Reset our head accessory overlays_standing[HEAD_ACCESSORY_LAYER] = null + overlays_standing[HEAD_ACC_OVER_LAYER] = null var/obj/item/organ/external/head/head_organ = get_organ("head") if(!head_organ || head_organ.is_stump() || (head_organ.status & ORGAN_DESTROYED) ) @@ -408,9 +409,8 @@ var/global/list/damage_icon_parts = list() //base icons var/icon/head_accessory_standing = new /icon('icons/mob/body_accessory.dmi',"accessory_none_s") - if(head_organ.ha_style && (head_organ.species.bodyflags & HAS_HEAD_ACCESSORY)) - var/datum/sprite_accessory/head_accessory_style = head_accessory_styles_list[head_organ.ha_style] + var/datum/sprite_accessory/head_accessory/head_accessory_style = head_accessory_styles_list[head_organ.ha_style] if(head_accessory_style && head_accessory_style.species_allowed) if(head_organ.species.name in head_accessory_style.species_allowed) var/icon/head_accessory_s = new/icon("icon" = head_accessory_style.icon, "icon_state" = "[head_accessory_style.icon_state]_s") @@ -418,11 +418,14 @@ var/global/list/damage_icon_parts = list() head_accessory_s.Blend(rgb(head_organ.r_headacc, head_organ.g_headacc, head_organ.b_headacc), ICON_ADD) head_accessory_standing = head_accessory_s //head_accessory_standing.Blend(head_accessory_s, ICON_OVERLAY) //Having it this way preserves animations. Useful for animated antennae. + + if(head_accessory_style.over_hair) //Select which layer to use based on the properties of the head accessory style. + overlays_standing[HEAD_ACC_OVER_LAYER] = image(head_accessory_standing) + else + overlays_standing[HEAD_ACCESSORY_LAYER] = image(head_accessory_standing) else //warning("Invalid ha_style for [species.name]: [ha_style]") - overlays_standing[HEAD_ACCESSORY_LAYER] = image(head_accessory_standing) - if(update_icons) update_icons() @@ -446,7 +449,7 @@ var/global/list/damage_icon_parts = list() //var/icon/debrained_s = new /icon("icon"='icons/mob/human_face.dmi', "icon_state" = "debrained_s") if(head_organ.h_style && !(head && (head.flags & BLOCKHEADHAIR) && !(isSynthetic()))) - var/datum/sprite_accessory/hair_style = hair_styles_list[head_organ.h_style] + var/datum/sprite_accessory/hair/hair_style = hair_styles_list[head_organ.h_style] //if(!src.get_int_organ(/obj/item/organ/internal/brain) && src.get_species() != "Machine" )//make it obvious we have NO BRAIN // hair_standing.Blend(debrained_s, ICON_OVERLAY) if(hair_style && hair_style.species_allowed) @@ -477,7 +480,8 @@ var/global/list/damage_icon_parts = list() //FACIAL HAIR OVERLAY /mob/living/carbon/human/proc/update_fhair(var/update_icons=1) //Reset our facial hair - overlays_standing[FHAIR_LAYER] = null + overlays_standing[FHAIR_LAYER] = null + overlays_standing[FHAIR_OVER_LAYER] = null var/obj/item/organ/external/head/head_organ = get_organ("head") if(!head_organ || head_organ.is_stump() || (head_organ.status & ORGAN_DESTROYED)) @@ -493,7 +497,7 @@ var/global/list/damage_icon_parts = list() var/icon/face_standing = new /icon('icons/mob/human_face.dmi',"bald_s") if(head_organ.f_style) - var/datum/sprite_accessory/facial_hair_style = facial_hair_styles_list[head_organ.f_style] + var/datum/sprite_accessory/facial_hair/facial_hair_style = facial_hair_styles_list[head_organ.f_style] if(facial_hair_style && facial_hair_style.species_allowed) if((head_organ.species.name in facial_hair_style.species_allowed) || (head_organ.species.flags & ALL_RPARTS)) //If the head's species is in the list of allowed species for the hairstyle, or the head's species is one flagged to have bodies comprised wholly of cybernetics... var/icon/facial_s = new/icon("icon" = facial_hair_style.icon, "icon_state" = "[facial_hair_style.icon_state]_s") @@ -509,11 +513,14 @@ var/global/list/damage_icon_parts = list() facial_s.Blend(facial_secondary_s, ICON_OVERLAY) face_standing.Blend(facial_s, ICON_OVERLAY) + + if(facial_hair_style.over_hair) //Select which layer to use based on the properties of the facial hair style. + overlays_standing[FHAIR_OVER_LAYER] = image(face_standing) + else + overlays_standing[FHAIR_LAYER] = image(face_standing) else //warning("Invalid f_style for [species.name]: [f_style]") - overlays_standing[FHAIR_LAYER] = image(face_standing) - if(update_icons) update_icons() /mob/living/carbon/human/update_mutations(var/update_icons=1) @@ -736,6 +743,8 @@ var/global/list/damage_icon_parts = list() /mob/living/carbon/human/update_inv_glasses(var/update_icons=1) + overlays_standing[GLASSES_LAYER] = null + overlays_standing[GLASSES_OVER_LAYER] = null if(client && hud_used) var/obj/screen/inventory/inv = hud_used.inv_slots[slot_glasses] @@ -743,20 +752,26 @@ var/global/list/damage_icon_parts = list() inv.update_icon() if(glasses) + var/image/new_glasses + var/obj/item/organ/external/head/head_organ = get_organ("head") if(client && hud_used && hud_used.hud_shown) if(hud_used.inventory_shown) //if the inventory is open ... glasses.screen_loc = ui_glasses //...draw the item in the inventory screen client.screen += glasses //Either way, add the item to the HUD if(glasses.icon_override) - overlays_standing[GLASSES_LAYER] = image("icon" = glasses.icon_override, "icon_state" = "[glasses.icon_state]") - else if(glasses.sprite_sheets && glasses.sprite_sheets[species.name]) - overlays_standing[GLASSES_LAYER]= image("icon" = glasses.sprite_sheets[species.name], "icon_state" = "[glasses.icon_state]") + new_glasses = image("icon" = glasses.icon_override, "icon_state" = "[glasses.icon_state]") + else if(glasses.sprite_sheets && glasses.sprite_sheets[head_organ.species.name]) + new_glasses = image("icon" = glasses.sprite_sheets[head_organ.species.name], "icon_state" = "[glasses.icon_state]") else - overlays_standing[GLASSES_LAYER]= image("icon" = 'icons/mob/eyes.dmi', "icon_state" = "[glasses.icon_state]") + new_glasses = image("icon" = 'icons/mob/eyes.dmi', "icon_state" = "[glasses.icon_state]") + + var/datum/sprite_accessory/hair/hair_style = hair_styles_list[head_organ.h_style] + if(hair_style && hair_style.glasses_over) //Select which layer to use based on the properties of the hair style. Hair styles with hair that don't overhang the arms of the glasses should have glasses_over set to a positive value. + overlays_standing[GLASSES_OVER_LAYER] = new_glasses + else + overlays_standing[GLASSES_LAYER] = new_glasses - else - overlays_standing[GLASSES_LAYER] = null if(update_icons) update_icons() /mob/living/carbon/human/update_inv_ears(var/update_icons=1) diff --git a/code/modules/mob/living/carbon/life.dm b/code/modules/mob/living/carbon/life.dm index 5e0841168e0..91661304144 100644 --- a/code/modules/mob/living/carbon/life.dm +++ b/code/modules/mob/living/carbon/life.dm @@ -409,27 +409,33 @@ return 1 /mob/living/carbon/update_sight() + if(!client) + return if(stat == DEAD) - sight |= SEE_TURFS - sight |= SEE_MOBS - sight |= SEE_OBJS - see_in_dark = 8 - see_invisible = SEE_INVISIBLE_LEVEL_TWO - else - sight &= ~(SEE_TURFS|SEE_MOBS|SEE_OBJS) - if(XRAY in mutations) - sight |= SEE_TURFS - sight |= SEE_MOBS - sight |= SEE_OBJS - see_in_dark = 8 - see_invisible = SEE_INVISIBLE_LEVEL_TWO + grant_death_vision() + return - else - see_in_dark = 2 - see_invisible = SEE_INVISIBLE_LIVING + see_invisible = initial(see_invisible) + see_in_dark = initial(see_in_dark) + sight = initial(sight) - if(see_override) - see_invisible = see_override + if(XRAY in mutations) + grant_xray_vision() + + if(client.eye != src) + var/atom/A = client.eye + if(A.update_remote_sight(src)) //returns 1 if we override all other sight updates. + return + + for(var/obj/item/organ/internal/cyberimp/eyes/E in internal_organs) + sight |= E.vision_flags + if(E.dark_view) + see_in_dark = max(see_in_dark,E.dark_view) + if(E.see_invisible) + see_invisible = min(see_invisible, E.see_invisible) + + if(see_override) + see_invisible = see_override /mob/living/carbon/handle_hud_icons() diff --git a/code/modules/mob/living/life.dm b/code/modules/mob/living/life.dm index e7222caa910..5deb73d219f 100644 --- a/code/modules/mob/living/life.dm +++ b/code/modules/mob/living/life.dm @@ -230,14 +230,32 @@ if(machine) if(!machine.check_eye(src)) - reset_view(null) + reset_perspective(null) else if(!remote_view && !client.adminobs) - reset_view(null) + reset_perspective(null) /mob/living/proc/update_sight() return +// Gives a mob the vision of being dead +/mob/living/proc/grant_death_vision() + sight |= SEE_TURFS + sight |= SEE_MOBS + sight |= SEE_OBJS + see_in_dark = 8 + see_invisible = SEE_INVISIBLE_OBSERVER + +// See through walls, dark, etc. +// basically the same as death vision except you can't +// see ghosts +/mob/living/proc/grant_xray_vision() + sight |= SEE_TURFS + sight |= SEE_MOBS + sight |= SEE_OBJS + see_in_dark = 8 + see_invisible = SEE_INVISIBLE_LEVEL_TWO + /mob/living/proc/handle_hud_icons() handle_hud_icons_health() return diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm index 6be18445b44..62102a2f662 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -287,6 +287,10 @@ adjustFireLoss(burn) src.updatehealth() +/mob/living/proc/has_organic_damage() + return (maxHealth - health) + + /mob/living/proc/restore_all_organs() return diff --git a/code/modules/mob/living/silicon/ai/ai.dm b/code/modules/mob/living/silicon/ai/ai.dm index 95f9362684b..00a141f60f8 100644 --- a/code/modules/mob/living/silicon/ai/ai.dm +++ b/code/modules/mob/living/silicon/ai/ai.dm @@ -42,6 +42,8 @@ var/list/ai_verbs_default = list( density = 1 status_flags = CANSTUN|CANPARALYSE|CANPUSH mob_size = MOB_SIZE_LARGE + sight = SEE_TURFS | SEE_MOBS | SEE_OBJS + see_in_dark = 8 can_strip = 0 var/list/network = list("SS13","Telecomms","Research Outpost","Mining Outpost") var/obj/machinery/camera/current = null @@ -427,7 +429,7 @@ var/list/ai_verbs_default = list( /mob/living/silicon/ai/check_eye(var/mob/user as mob) if(!current) return null - user.reset_view(current) + user.reset_perspective(current) return 1 /mob/living/silicon/ai/blob_act() @@ -606,15 +608,18 @@ var/list/ai_verbs_default = list( adjustBruteLoss(damage) updatehealth() -/mob/living/silicon/ai/reset_view(atom/A) - if(current) - current.set_light(0) - if(istype(A,/obj/machinery/camera)) +/mob/living/silicon/ai/reset_perspective(atom/A) + if(camera_light_on) + light_cameras() + if(istype(A, /obj/machinery/camera)) current = A - ..() - if(istype(A,/obj/machinery/camera)) - if(camera_light_on) A.set_light(AI_CAMERA_LUMINOSITY) - else A.set_light(0) + + . = ..() + if(.) + if(!A && isturf(loc) && eyeobj) + client.eye = eyeobj + client.perspective = MOB_PERSPECTIVE + eyeobj.get_remote_view_fullscreens(src) /mob/living/silicon/ai/proc/botcall() set category = "AI Commands" @@ -1163,4 +1168,4 @@ var/list/ai_verbs_default = list( to_chat(src, "You are also capable of hacking APCs, which grants you more points to spend on your Malfunction powers. The drawback is that a hacked APC will give you away if spotted by the crew. Hacking an APC takes 60 seconds.") view_core() //A BYOND bug requires you to be viewing your core before your verbs update verbs += /mob/living/silicon/ai/proc/choose_modules - malf_picker = new /datum/module_picker \ No newline at end of file + malf_picker = new /datum/module_picker diff --git a/code/modules/mob/living/silicon/ai/life.dm b/code/modules/mob/living/silicon/ai/life.dm index 6599c31c5ce..fe0924880f2 100644 --- a/code/modules/mob/living/silicon/ai/life.dm +++ b/code/modules/mob/living/silicon/ai/life.dm @@ -1,3 +1,8 @@ +#define POWER_RESTORATION_OFF 0 +#define POWER_RESTORATION_START 1 +#define POWER_RESTORATION_SEARCH_APC 2 +#define POWER_RESTORATION_APC_FOUND 3 + /mob/living/silicon/ai/Life() //doesn't call parent because it's a horrible mess if(stat == DEAD) @@ -6,7 +11,7 @@ var/turf/T = get_turf(src) if(stat != CONSCIOUS) //ai's fucked cameraFollow = null - reset_view(null) + reset_perspective(null) unset_machine() updatehealth() @@ -16,11 +21,16 @@ death() return 0 - if(malfhack) - if(malfhack.aidisabled) - to_chat(src, "ERROR: APC access disabled, hack attempt canceled.") - malfhacking = 0 - malfhack = null + if(!eyeobj || qdeleted(eyeobj) || !eyeobj.loc) + view_core() + + if(machine) + machine.check_eye(src) + + if(malfhack && malfhack.aidisabled) + to_chat(src, "ERROR: APC access disabled, hack attempt canceled.") + malfhacking = 0 + malfhack = null if(aiRestorePowerRoutine) adjustOxyLoss(1) @@ -29,22 +39,9 @@ handle_stunned() - var/is_blind = 0 //THIS WAS JUST FUCKING 'blind' WHICH CONFLICTED WITH A NORMAL VARIABLE var/area/my_area = get_area(src) - if(istype(my_area)) - if(!my_area.power_equip && !is_type_in_list(loc, list(/obj/item, /obj/mecha))) - is_blind = 1 //HOW THE FUCK DID THAT EVEN COMPILE JESUS CHRIST - if(!is_blind) - sight |= SEE_TURFS - sight |= SEE_MOBS - sight |= SEE_OBJS - - see_in_dark = 8 - see_invisible = SEE_INVISIBLE_LEVEL_TWO - - if(see_override) - see_invisible = see_override + if(!lacks_power()) if(aiRestorePowerRoutine == 2) to_chat(src, "Alert cancelled. Power has been restored without our assistance.") @@ -57,18 +54,12 @@ else - sight &= ~SEE_TURFS - sight &= ~SEE_MOBS - sight &= ~SEE_OBJS - overlay_fullscreen("blind", /obj/screen/fullscreen/blind) - see_in_dark = 0 - see_invisible = SEE_INVISIBLE_LIVING - - if(((!my_area.power_equip) || istype(T, /turf/space)) && !is_type_in_list(loc, list(/obj/item, /obj/mecha))) + if(lacks_power()) if(!aiRestorePowerRoutine) aiRestorePowerRoutine = 1 + update_sight() to_chat(src, "You have lost power!") if(!is_special_character(src)) set_zeroth_law("") @@ -78,7 +69,7 @@ sleep(50) my_area = get_area(src) T = get_turf(src) - if(my_area && my_area.power_equip && !istype(T, /turf/space)) + if(!lacks_power()) to_chat(src, "Alert cancelled. Power has been restored without our assistance.") aiRestorePowerRoutine = 0 return @@ -115,12 +106,11 @@ aiRestorePowerRoutine = 2 return - if(my_area.power_equip) - if(!istype(T, /turf/space)) - to_chat(src, "Alert cancelled. Power has been restored without our assistance.") - aiRestorePowerRoutine = 0 - clear_fullscreen("blind") - return + if(!lacks_power()) + to_chat(src, "Alert cancelled. Power has been restored without our assistance.") + aiRestorePowerRoutine = 0 + clear_fullscreen("blind") + return switch(PRP) if(1) @@ -170,4 +160,17 @@ if(client) var/client/C = client for(var/mob/living/carbon/human/H in view(eyeobj, 14)) - C.images += H.hud_list[NATIONS_HUD] \ No newline at end of file + C.images += H.hud_list[NATIONS_HUD] + +/mob/living/silicon/ai/update_sight() + see_invisible = initial(see_invisible) + see_in_dark = initial(see_in_dark) + sight = initial(sight) + if(aiRestorePowerRoutine) + sight = sight&~SEE_TURFS + sight = sight&~SEE_MOBS + sight = sight&~SEE_OBJS + see_in_dark = 0 + + if(see_override) + see_invisible = see_override diff --git a/code/modules/mob/living/silicon/ai/logout.dm b/code/modules/mob/living/silicon/ai/logout.dm index acc6220bc46..00945ad84b7 100644 --- a/code/modules/mob/living/silicon/ai/logout.dm +++ b/code/modules/mob/living/silicon/ai/logout.dm @@ -2,9 +2,5 @@ ..() for(var/obj/machinery/ai_status_display/O in world) //change status O.mode = 0 - if(!isturf(loc)) - if(client) - client.eye = loc - client.perspective = EYE_PERSPECTIVE src.view_core() - return \ No newline at end of file + return diff --git a/code/modules/mob/living/silicon/pai/pai.dm b/code/modules/mob/living/silicon/pai/pai.dm index 7979ad150b4..43249060652 100644 --- a/code/modules/mob/living/silicon/pai/pai.dm +++ b/code/modules/mob/living/silicon/pai/pai.dm @@ -137,7 +137,7 @@ /mob/living/silicon/pai/check_eye(var/mob/user as mob) if(!src.current) return null - user.reset_view(src.current) + user.reset_perspective(src.current) return 1 /mob/living/silicon/pai/blob_act() @@ -261,7 +261,7 @@ usr:cameraFollow = null if(!C) src.unset_machine() - src.reset_view(null) + src.reset_perspective(null) return 0 if(stat == 2 || !C.status || !(src.network in C.network)) return 0 @@ -269,7 +269,7 @@ src.set_machine(src) src:current = C - src.reset_view(C) + src.reset_perspective(C) return 1 /mob/living/silicon/pai/verb/reset_record_view() @@ -288,7 +288,7 @@ /mob/living/silicon/pai/cancel_camera() set category = "pAI Commands" set name = "Cancel Camera View" - src.reset_view(null) + src.reset_perspective(null) src.unset_machine() src:cameraFollow = null @@ -297,7 +297,7 @@ /mob/living/silicon/pai/proc/pai_network_change() set category = "pAI Commands" set name = "Change Camera Network" - src.reset_view(null) + src.reset_perspective(null) src.unset_machine() src:cameraFollow = null var/cameralist[0] @@ -363,9 +363,6 @@ var/obj/item/device/pda/holder = card.loc holder.pai = null - if(client) - client.perspective = EYE_PERSPECTIVE - client.eye = src forceMove(get_turf(card)) card.forceMove(src) @@ -487,9 +484,7 @@ visible_message("[src] neatly folds inwards, compacting down to a rectangular card.", "You neatly fold inwards, compacting down to a rectangular card.") stop_pulling() - if(client) - client.perspective = EYE_PERSPECTIVE - client.eye = card + reset_perspective(card) // If we are being held, handle removing our holder from their inv. var/obj/item/weapon/holder/H = loc diff --git a/code/modules/mob/living/silicon/pai/software.dm b/code/modules/mob/living/silicon/pai/software.dm index 539832d9c08..ed5ba8ce49a 100644 --- a/code/modules/mob/living/silicon/pai/software.dm +++ b/code/modules/mob/living/silicon/pai/software.dm @@ -37,19 +37,23 @@ var/global/list/default_pai_software = list() ui_interact(src) -/mob/living/silicon/pai/ui_interact(mob/user, ui_key = "main", datum/nanoui/ui = null, force_open = 1) - if(user != src) - if(ui) ui.set_status(STATUS_CLOSE, 0) - return - +/mob/living/silicon/pai/ui_interact(mob/user, ui_key = "main", datum/nanoui/ui = null, force_open = 1, datum/topic_state/state = self_state) if(ui_key != "main") var/datum/pai_software/S = software[ui_key] if(S && !S.toggle) S.on_ui_interact(src, ui, force_open) else - if(ui) ui.set_status(STATUS_CLOSE, 0) + if(ui) + ui.set_status(STATUS_CLOSE, 0) return + ui = nanomanager.try_update_ui(user, src, ui_key, ui, force_open) + if(!ui) + ui = new(user, src, ui_key, "pai_interface.tmpl", "pAI Software Interface", 450, 600, state = state) + ui.open() + ui.set_auto_update(1) + +/mob/living/silicon/pai/ui_data(mob/user, datum/topic_state/state = self_state) var/data[0] // Software we have bought @@ -84,12 +88,7 @@ var/global/list/default_pai_software = list() data["emotions"] = emotions data["current_emotion"] = card.current_emotion - ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open) - if(!ui) - ui = new(user, src, ui_key, "pai_interface.tmpl", "pAI Software Interface", 450, 600) - ui.set_initial_data(data) - ui.open() - ui.set_auto_update(1) + return data /mob/living/silicon/pai/Topic(href, href_list) if(..()) @@ -122,4 +121,4 @@ var/global/list/default_pai_software = list() var/img = text2num(href_list["image"]) if(1 <= img && img <= 9) card.setEmotion(img) - return 1 \ No newline at end of file + return 1 diff --git a/code/modules/mob/living/silicon/robot/inventory.dm b/code/modules/mob/living/silicon/robot/inventory.dm index d843203ebc3..4e05ff4a402 100644 --- a/code/modules/mob/living/silicon/robot/inventory.dm +++ b/code/modules/mob/living/silicon/robot/inventory.dm @@ -17,6 +17,7 @@ if(istype(O,/obj/item/borg/sight)) var/obj/item/borg/sight/S = O sight_mode &= ~S.sight_mode + update_sight() if(client) client.screen -= O @@ -52,6 +53,7 @@ if((cell.charge * 100 / cell.maxcharge) < B.powerneeded) to_chat(src, "Not enough power to activate [B.name]!") return + var/activated_thingy = null if(!module_state_1) O.mouse_opacity = initial(O.mouse_opacity) module_state_1 = O @@ -59,8 +61,7 @@ O.plane = HUD_PLANE O.screen_loc = inv1.screen_loc contents += O - if(istype(module_state_1,/obj/item/borg/sight)) - sight_mode |= module_state_1:sight_mode + activated_thingy = O else if(!module_state_2) O.mouse_opacity = initial(O.mouse_opacity) module_state_2 = O @@ -68,8 +69,7 @@ O.plane = HUD_PLANE O.screen_loc = inv2.screen_loc contents += O - if(istype(module_state_2,/obj/item/borg/sight)) - sight_mode |= module_state_2:sight_mode + activated_thingy = O else if(!module_state_3) O.mouse_opacity = initial(O.mouse_opacity) module_state_3 = O @@ -77,11 +77,12 @@ O.plane = HUD_PLANE O.screen_loc = inv3.screen_loc contents += O - if(istype(module_state_3,/obj/item/borg/sight)) - sight_mode |= module_state_3:sight_mode + activated_thingy = O else to_chat(src, "You need to disable a module first!") - src.update_icons() + if(istype(activated_thingy,/obj/item/borg/sight)) + update_sight() + update_icons() /mob/living/silicon/robot/proc/uneq_active() uneq_module(module_active) diff --git a/code/modules/mob/living/silicon/robot/life.dm b/code/modules/mob/living/silicon/robot/life.dm index ca480d987f8..afa2d0667c4 100644 --- a/code/modules/mob/living/silicon/robot/life.dm +++ b/code/modules/mob/living/silicon/robot/life.dm @@ -120,32 +120,38 @@ return 1 /mob/living/silicon/robot/update_sight() - if(stat == DEAD || sight_mode & BORGXRAY) + if(!client) + return + if(stat == DEAD) + grant_death_vision() + return + + see_invisible = initial(see_invisible) + see_in_dark = initial(see_in_dark) + sight = initial(sight) + + if(client.eye != src) + var/atom/A = client.eye + if(A.update_remote_sight(src)) //returns 1 if we override all other sight updates. + return + + if(sight_mode & BORGMESON) sight |= SEE_TURFS + see_invisible = min(see_invisible, SEE_INVISIBLE_MINIMUM) + see_in_dark = 1 + + if(sight_mode & BORGXRAY) + sight |= (SEE_TURFS|SEE_MOBS|SEE_OBJS) + see_invisible = SEE_INVISIBLE_LIVING + see_in_dark = 8 + + if(sight_mode & BORGTHERM) sight |= SEE_MOBS - sight |= SEE_OBJS + see_invisible = min(see_invisible, SEE_INVISIBLE_LIVING) see_in_dark = 8 - see_invisible = SEE_INVISIBLE_LEVEL_TWO - else - see_in_dark = 8 - if(sight_mode & BORGMESON && sight_mode & BORGTHERM) - sight |= SEE_TURFS - sight |= SEE_MOBS - see_invisible = SEE_INVISIBLE_MINIMUM - else if(sight_mode & BORGMESON) - sight |= SEE_TURFS - see_invisible = SEE_INVISIBLE_MINIMUM - see_in_dark = 1 - else if(sight_mode & BORGTHERM) - sight |= SEE_MOBS - see_invisible = SEE_INVISIBLE_LEVEL_TWO - else if(stat != DEAD) - sight &= ~SEE_MOBS - sight &= ~SEE_TURFS - sight &= ~SEE_OBJS - see_invisible = SEE_INVISIBLE_LEVEL_TWO - if(see_override) - see_invisible = see_override + + if(see_override) + see_invisible = see_override /mob/living/silicon/robot/handle_hud_icons() update_items() diff --git a/code/modules/mob/living/silicon/robot/robot.dm b/code/modules/mob/living/silicon/robot/robot.dm index 335ecbcd1f6..02d3401c080 100644 --- a/code/modules/mob/living/silicon/robot/robot.dm +++ b/code/modules/mob/living/silicon/robot/robot.dm @@ -84,7 +84,7 @@ var/list/robot_verbs_default = list( var/ionpulse = 0 // Jetpack-like effect. var/ionpulse_on = 0 // Jetpack-like effect. var/datum/effect/system/ion_trail_follow/ion_trail // Ionpulse effect. - + var/datum/action/item_action/toggle_research_scanner/scanner = null /mob/living/silicon/robot/New(loc,var/syndie = 0,var/unfinished = 0, var/alien = 0) @@ -960,11 +960,11 @@ var/list/robot_verbs_default = list( /mob/living/silicon/robot/proc/allowed(obj/item/I) var/obj/dummy = new /obj(null) // Create a dummy object to check access on as to avoid having to snowflake check_access on every mob dummy.req_access = req_access - + if(dummy.check_access(I)) qdel(dummy) return 1 - + qdel(dummy) return 0 @@ -1456,3 +1456,15 @@ var/list/robot_verbs_default = list( disable_component("comms", 160) if(2) disable_component("comms", 60) +/mob/living/silicon/robot/rejuvenate() + ..() + var/brute = 1000 + var/burn = 1000 + var/list/datum/robot_component/borked_parts = get_damaged_components(brute,burn,1) + for(var/datum/robot_component/borked_part in borked_parts) + brute = borked_part.brute_damage + burn = borked_part.electronics_damage + borked_part.installed = 1 + borked_part.wrapped = new borked_part.external_type + borked_part.heal_damage(brute,burn) + borked_part.install() \ No newline at end of file diff --git a/code/modules/mob/living/simple_animal/bot/medbot.dm b/code/modules/mob/living/simple_animal/bot/medbot.dm index 92fe2c761bc..4eafbf50065 100644 --- a/code/modules/mob/living/simple_animal/bot/medbot.dm +++ b/code/modules/mob/living/simple_animal/bot/medbot.dm @@ -26,6 +26,7 @@ var/mob/living/carbon/oldpatient = null var/oldloc = null var/last_found = 0 + var/last_warning = 0 var/last_newpatient_speak = 0 //Don't spam the "HEY I'M COMING" messages var/injection_amount = 15 //How much reagent do we inject at a time? var/heal_threshold = 10 //Start healing when they have this much damage in a category @@ -253,6 +254,12 @@ oldpatient = user /mob/living/simple_animal/bot/medbot/process_scan(mob/living/carbon/human/H) + if(buckled) + if((last_warning + 300) < world.time) + speak("Movement restrained! Unit on standby!") + playsound(loc, 'sound/machines/buzz-two.ogg', 50, 0) + last_warning = world.time + return if(H.stat == 2) return @@ -368,6 +375,9 @@ if(declare_crit && C.health <= 0) //Critical condition! Call for help! declare(C) + if(!C.has_organic_damage()) + return 0 + //If they're injured, we're using a beaker, and don't have one of our WONDERCHEMS. if((reagent_glass) && (use_beaker) && ((C.getBruteLoss() >= heal_threshold) || (C.getToxLoss() >= heal_threshold) || (C.getToxLoss() >= heal_threshold) || (C.getOxyLoss() >= (heal_threshold + 15)))) for(var/datum/reagent/R in reagent_glass.reagents.reagent_list) diff --git a/code/modules/mob/living/simple_animal/bot/mulebot.dm b/code/modules/mob/living/simple_animal/bot/mulebot.dm index 9fcc921a4c9..17adfa19c54 100644 --- a/code/modules/mob/living/simple_animal/bot/mulebot.dm +++ b/code/modules/mob/living/simple_animal/bot/mulebot.dm @@ -393,9 +393,8 @@ passenger = M load = M can_buckle = FALSE - if(M.client) - M.client.perspective = EYE_PERSPECTIVE - M.client.eye = src + // Not sure why this is done + reset_perspective(src) return TRUE return FALSE @@ -423,9 +422,7 @@ if(ismob(load)) var/mob/M = load - if(M.client) - M.client.perspective = MOB_PERSPECTIVE - M.client.eye = M + M.reset_perspective(null) unbuckle_mob() if(load) @@ -452,9 +449,7 @@ AM.pixel_y = initial(AM.pixel_y) if(ismob(AM)) var/mob/M = AM - if(M.client) - M.client.perspective = MOB_PERSPECTIVE - M.client.eye = M + M.reset_perspective(null) /mob/living/simple_animal/bot/mulebot/call_bot() ..() diff --git a/code/modules/mob/living/simple_animal/simple_animal.dm b/code/modules/mob/living/simple_animal/simple_animal.dm index cc5b319c84f..24ad47a16cb 100644 --- a/code/modules/mob/living/simple_animal/simple_animal.dm +++ b/code/modules/mob/living/simple_animal/simple_animal.dm @@ -706,6 +706,22 @@ /mob/living/simple_animal/proc/sentience_act() //Called when a simple animal gains sentience via gold slime potion return +/mob/living/simple_animal/update_sight() + if(!client) + return + if(stat == DEAD) + grant_death_vision() + return + + see_invisible = initial(see_invisible) + see_in_dark = initial(see_in_dark) + sight = initial(sight) + + if(client.eye != src) + var/atom/A = client.eye + if(A.update_remote_sight(src)) //returns 1 if we override all other sight updates. + return + /mob/living/simple_animal/SetEarDamage() return diff --git a/code/modules/mob/login.dm b/code/modules/mob/login.dm index fcf53fd3cba..8cc51882ebf 100644 --- a/code/modules/mob/login.dm +++ b/code/modules/mob/login.dm @@ -43,12 +43,7 @@ sight |= SEE_SELF ..() - if(loc && !isturf(loc)) - client.eye = loc - client.perspective = EYE_PERSPECTIVE - else - client.eye = src - client.perspective = MOB_PERSPECTIVE + reset_perspective(loc) if(ckey in deadmins) diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm index 6415d077cf0..ddb4d2beb60 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -487,7 +487,8 @@ var/list/slot_equipment_priority = list( \ return 0 //Unsupported slot //END HUMAN -/mob/proc/reset_view(atom/A) +// If you're looking for `reset_perspective`, that's a synonym for this proc. +/mob/proc/reset_perspective(atom/A) if(client) if(istype(A, /atom/movable)) client.perspective = EYE_PERSPECTIVE @@ -499,8 +500,33 @@ var/list/slot_equipment_priority = list( \ else client.perspective = EYE_PERSPECTIVE client.eye = loc - return + return 1 +/mob/living/reset_perspective(atom/A) + . = ..() + if(.) + // Above check means the mob has a client + update_sight() + if(client.eye != src) + var/atom/AT = client.eye + AT.get_remote_view_fullscreens(src) + else + clear_fullscreen("remote_view", 0) + update_pipe_vision() + +/mob/dead/reset_perspective(atom/A) + if(client) + if(ismob(client.eye) && (client.eye != src)) + // Note to self: Use `client.eye` for ghost following in place + // of periodic ghost updates + var/mob/target = client.eye + target.following_mobs -= src + . = ..() + if(.) + // Allows sharing HUDs with ghosts + if(hud_used) + client.screen = list() + hud_used.show_hud(hud_used.hud_version) /mob/proc/show_inv(mob/user) user.set_machine(src) @@ -793,7 +819,7 @@ var/list/slot_equipment_priority = list( \ /mob/verb/cancel_camera() set name = "Cancel Camera View" set category = "OOC" - reset_view(null) + reset_perspective(null) unset_machine() if(istype(src, /mob/living)) if(src:cameraFollow) diff --git a/code/modules/mob/mob_movement.dm b/code/modules/mob/mob_movement.dm index d434ab633f7..d99fc342c2b 100644 --- a/code/modules/mob/mob_movement.dm +++ b/code/modules/mob/mob_movement.dm @@ -148,7 +148,7 @@ view = world.view //Reset the view winset(src, "mapwindow.map", "icon-size=[src.reset_stretch]") viewingCanvas = 0 - mob.reset_view() + mob.reset_perspective() if(mob.hud_used) mob.hud_used.show_hud(HUD_STYLE_STANDARD) diff --git a/code/modules/mob/new_player/sprite_accessories.dm b/code/modules/mob/new_player/sprite_accessories.dm index 0e8f3456335..2e40b49db36 100644 --- a/code/modules/mob/new_player/sprite_accessories.dm +++ b/code/modules/mob/new_player/sprite_accessories.dm @@ -65,19 +65,23 @@ /datum/sprite_accessory/hair icon = 'icons/mob/human_face.dmi' // default icon for all hairs + var/glasses_over //Hair styles with hair that don't overhang the arms of glasses should have glasses_over set to a positive value. /datum/sprite_accessory/hair/bald name = "Bald" icon_state = "bald" species_allowed = list("Human", "Unathi", "Vox", "Diona", "Kidan", "Grey", "Plasmaman", "Skeleton", "Vulpkanin", "Tajaran") + glasses_over = 1 /datum/sprite_accessory/hair/short name = "Short Hair" // try to capatilize the names please~ icon_state = "hair_a" // you do not need to define _s or _l sub-states, game automatically does this for you + glasses_over = 1 /datum/sprite_accessory/hair/cut name = "Cut Hair" icon_state = "hair_c" + glasses_over = 1 /datum/sprite_accessory/hair/long name = "Shoulder-length Hair" @@ -123,6 +127,7 @@ name = "Ponytail male" icon_state = "hair_ponytailm" gender = MALE + glasses_over = 1 /datum/sprite_accessory/hair/ponytail2 name = "Ponytail female" @@ -132,16 +137,19 @@ /datum/sprite_accessory/hair/ponytail3 name = "Ponytail alt" icon_state = "hair_ponytail3" + glasses_over = 1 /datum/sprite_accessory/hair/sideponytail name = "Side Ponytail" icon_state = "hair_stail" gender = FEMALE + glasses_over = 1 /datum/sprite_accessory/hair/highponytail name = "High Ponytail" icon_state = "hair_highponytail" gender = FEMALE + glasses_over = 1 /datum/sprite_accessory/hair/wisp name = "Wisp" @@ -157,11 +165,13 @@ icon_state = "hair_pompadour" gender = MALE species_allowed = list("Human", "Slime People", "Unathi") + glasses_over = 1 /datum/sprite_accessory/hair/quiff name = "Quiff" icon_state = "hair_quiff" gender = MALE + glasses_over = 1 /datum/sprite_accessory/hair/bedhead name = "Bedhead" @@ -197,6 +207,7 @@ name = "Bowl" icon_state = "hair_bowlcut" gender = MALE + glasses_over = 1 /datum/sprite_accessory/hair/braid2 name = "Long Braid" @@ -219,20 +230,24 @@ icon_state = "hair_buzzcut" gender = MALE species_allowed = list("Human", "Slime People", "Unathi") + glasses_over = 1 /datum/sprite_accessory/hair/crew name = "Crewcut" icon_state = "hair_crewcut" gender = MALE + glasses_over = 1 /datum/sprite_accessory/hair/combover name = "Combover" icon_state = "hair_combover" gender = MALE + glasses_over = 1 /datum/sprite_accessory/hair/devillock name = "Devil Lock" icon_state = "hair_devilock" + glasses_over = 1 /datum/sprite_accessory/hair/dreadlocks name = "Dreadlocks" @@ -249,6 +264,7 @@ /datum/sprite_accessory/hair/afro2 name = "Afro 2" icon_state = "hair_afro2" + glasses_over = 1 /datum/sprite_accessory/hair/afro_large name = "Big Afro" @@ -259,6 +275,7 @@ name = "Flat Top" icon_state = "hair_sergeant" gender = MALE + glasses_over = 1 /datum/sprite_accessory/hair/emo name = "Emo" @@ -276,31 +293,37 @@ name = "Hitop" icon_state = "hair_hitop" gender = MALE + glasses_over = 1 /datum/sprite_accessory/hair/mohawk name = "Mohawk" icon_state = "hair_d" species_allowed = list("Human", "Slime People", "Unathi") + glasses_over = 1 /datum/sprite_accessory/hair/jensen name = "Adam Jensen Hair" icon_state = "hair_jensen" gender = MALE + glasses_over = 1 /datum/sprite_accessory/hair/cia name = "CIA" icon_state = "hair_cia" gender = MALE + glasses_over = 1 /datum/sprite_accessory/hair/mulder name = "Mulder" icon_state = "hair_mulder" gender = MALE + glasses_over = 1 /datum/sprite_accessory/hair/gelled name = "Gelled Back" icon_state = "hair_gelled" gender = FEMALE + glasses_over = 1 /datum/sprite_accessory/hair/gentle name = "Gentle" @@ -311,6 +334,7 @@ name = "Spiky" icon_state = "hair_spikey" species_allowed = list("Human", "Slime People", "Unathi") + glasses_over = 1 /datum/sprite_accessory/hair/kusanagi name = "Kusanagi Hair" @@ -320,6 +344,7 @@ name = "Pigtails" icon_state = "hair_kagami" gender = FEMALE + glasses_over = 1 /datum/sprite_accessory/hair/himecut name = "Hime Cut" @@ -335,6 +360,7 @@ name = "Odango" icon_state = "hair_odango" gender = FEMALE + glasses_over = 1 /datum/sprite_accessory/hair/ombre name = "Ombre" @@ -349,11 +375,13 @@ /datum/sprite_accessory/hair/skinhead name = "Skinhead" icon_state = "hair_skinhead" + glasses_over = 1 /datum/sprite_accessory/hair/balding name = "Balding Hair" icon_state = "hair_e" gender = MALE // turnoff! + glasses_over = 1 /datum/sprite_accessory/hair/longemo name = "Long Emo" @@ -385,6 +413,7 @@ name = "Unshaven Mohawk" icon_state = "hair_unshavenmohawk" gender = MALE + glasses_over = 1 /datum/sprite_accessory/hair/drills name = "Twincurls" @@ -401,6 +430,7 @@ /datum/sprite_accessory/hair/ipc species_allowed = list("Machine") + glasses_over = 1 /datum/sprite_accessory/hair/ipc/ipc_screen_pink name = "Pink IPC Screen" @@ -547,6 +577,7 @@ /datum/sprite_accessory/hair/unathi species_allowed = list("Unathi") + glasses_over = 1 /datum/sprite_accessory/hair/unathi/una_horns name = "Unathi Horns" @@ -593,6 +624,7 @@ /datum/sprite_accessory/hair/tajara species_allowed = list("Tajaran") + glasses_over = 1 /datum/sprite_accessory/hair/tajara/taj_hair_clean name = "Tajara Clean" @@ -601,11 +633,13 @@ /datum/sprite_accessory/hair/tajara/taj_hair_bangs name = "Tajara Bangs" icon_state = "hair_bangs" + glasses_over = null /datum/sprite_accessory/hair/tajara/taj_hair_braid name = "Tajara Braid" icon_state = "hair_tbraid" secondary_theme = "beads" + glasses_over = null /datum/sprite_accessory/hair/tajara/taj_hair_shaggy name = "Tajara Shaggy" @@ -642,22 +676,27 @@ /datum/sprite_accessory/hair/tajara/taj_hair_curls name = "Tajara Curly" icon_state = "hair_curly" + glasses_over = null /datum/sprite_accessory/hair/tajara/taj_hair_retro name = "Tajaran Ladies' Retro" icon_state = "hair_ladies_retro" + glasses_over = null /datum/sprite_accessory/hair/tajara/taj_hair_victory name = "Tajara Victory Curls" icon_state = "hair_victory" + glasses_over = null /datum/sprite_accessory/hair/tajara/taj_hair_bob name = "Tajara Bob" icon_state = "hair_tbob" + glasses_over = null /datum/sprite_accessory/hair/tajara/taj_hair_fingercurl name = "Tajara Finger Curls" icon_state = "hair_fingerwave" + glasses_over = null /datum/sprite_accessory/hair/vulpkanin species_allowed = list("Vulpkanin") @@ -694,6 +733,7 @@ /datum/sprite_accessory/hair/vulpkanin/vulp_hair_bun name = "Bun" icon_state = "bun" + glasses_over = 1 /datum/sprite_accessory/hair/vulpkanin/vulp_hair_jagged name = "Jagged" @@ -706,6 +746,7 @@ /datum/sprite_accessory/hair/vulpkanin/vulp_hair_hawk name = "Hawk" icon_state = "hawk" + glasses_over = 1 /datum/sprite_accessory/hair/vulpkanin/vulp_hair_anita name = "Anita" @@ -718,6 +759,7 @@ /datum/sprite_accessory/hair/vulpkanin/vulp_hair_spike name = "Spike" icon_state = "spike" + glasses_over = 1 /datum/sprite_accessory/hair/vulpkanin/vulp_hair_braided name = "Braided" @@ -726,6 +768,7 @@ /datum/sprite_accessory/hair/vox species_allowed = list("Vox") + glasses_over = 1 /datum/sprite_accessory/hair/vox/vox_quills_short name = "Short Vox Quills" @@ -787,6 +830,7 @@ /datum/sprite_accessory/hair/wryn species_allowed = list("Wryn") + glasses_over = 1 /datum/sprite_accessory/hair/wryn/wry_antennae_default name = "Antennae" @@ -794,6 +838,7 @@ /datum/sprite_accessory/hair/nucleation species_allowed = list("Nucleation") + glasses_over = 1 /datum/sprite_accessory/hair/nucleation/nuc_crystals name = "Nucleation Crystals" @@ -835,6 +880,7 @@ /datum/sprite_accessory/facial_hair icon = 'icons/mob/human_face.dmi' gender = MALE // barf (unless you're a dorf, dorfs dig chix /w beards :P) + var/over_hair /datum/sprite_accessory/facial_hair/shaved name = "Shaved" @@ -1024,6 +1070,7 @@ /datum/sprite_accessory/facial_hair/unathi species_allowed = list("Unathi") gender = NEUTER + over_hair = 1 /datum/sprite_accessory/facial_hair/unathi/una_spines_long name = "Long Spines" @@ -1594,6 +1641,7 @@ icon = 'icons/mob/body_accessory.dmi' species_allowed = list("Unathi", "Vulpkanin", "Tajaran", "Machine") icon_state = "accessory_none" + var/over_hair /datum/sprite_accessory/head_accessory/none name = "None" @@ -1602,6 +1650,7 @@ /datum/sprite_accessory/head_accessory/unathi species_allowed = list("Unathi") + over_hair = 1 /datum/sprite_accessory/head_accessory/unathi/simple name = "Simple" @@ -1701,6 +1750,7 @@ /datum/sprite_accessory/head_accessory/ipc species_allowed = list("Machine") + over_hair = 1 /datum/sprite_accessory/head_accessory/ipc/ipc_antennae name = "Antennae" diff --git a/code/modules/nano/modules/alarm_monitor.dm b/code/modules/nano/modules/alarm_monitor.dm index b6a8a70780d..cf90b61bf29 100644 --- a/code/modules/nano/modules/alarm_monitor.dm +++ b/code/modules/nano/modules/alarm_monitor.dm @@ -56,6 +56,13 @@ return 1 /datum/nano_module/alarm_monitor/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1, var/datum/topic_state/state = default_state) + ui = nanomanager.try_update_ui(user, src, ui_key, ui, force_open) + if(!ui) + ui = new(user, src, ui_key, "alarm_monitor.tmpl", "Alarm Monitoring Console", 800, 800, state = state) + ui.open() + ui.set_auto_update(1) + +/datum/nano_module/alarm_monitor/ui_data(mob/user, datum/topic_state/state = default_state) var/data[0] var/categories[0] @@ -80,9 +87,4 @@ "lost_sources" = lost_sources.len ? sanitize(english_list(lost_sources, nothing_text = "", and_text = ", ")) : "")) data["categories"] = categories - ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open) - if(!ui) - ui = new(user, src, ui_key, "alarm_monitor.tmpl", "Alarm Monitoring Console", 800, 800, state = state) - ui.set_initial_data(data) - ui.open() - ui.set_auto_update(1) + return data diff --git a/code/modules/nano/modules/atmos_control.dm b/code/modules/nano/modules/atmos_control.dm index e43585243ae..ee776ba4467 100644 --- a/code/modules/nano/modules/atmos_control.dm +++ b/code/modules/nano/modules/atmos_control.dm @@ -29,20 +29,21 @@ alarm.ui_interact(usr, master_ui = ui_ref, state = TS) /datum/nano_module/atmos_control/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1, var/master_ui = null, var/datum/topic_state/state = default_state) - var/data[0] - data["alarms"] = air_alarm_repository.air_alarm_data(monitored_alarms) - - ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open) + ui = nanomanager.try_update_ui(user, src, ui_key, ui, force_open) if(!ui) ui = new(user, src, ui_key, "atmos_control.tmpl", src.name, 900, 800, state = state) ui.add_template("mapContent", "atmos_control_map_content.tmpl") ui.add_template("mapHeader", "atmos_control_map_header.tmpl") ui.set_show_map(1) - ui.set_initial_data(data) ui.open() ui.set_auto_update(1) ui_ref = ui +/datum/nano_module/atmos_control/ui_data(mob/user, datum/topic_state/state = default_state) + var/data[0] + data["alarms"] = air_alarm_repository.air_alarm_data(monitored_alarms) + return data + /datum/nano_module/atmos_control/proc/generate_state(air_alarm) var/datum/topic_state/air_alarm/state = new() state.atmos_control = src diff --git a/code/modules/nano/modules/crew_monitor.dm b/code/modules/nano/modules/crew_monitor.dm index ce89f59947b..c5f8f6ecfb8 100644 --- a/code/modules/nano/modules/crew_monitor.dm +++ b/code/modules/nano/modules/crew_monitor.dm @@ -17,14 +17,7 @@ return 1 /datum/nano_module/crew_monitor/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1, var/datum/topic_state/state = default_state) - - var/data[0] - var/turf/T = get_turf(nano_host()) - - data["isAI"] = isAI(user) - data["crewmembers"] = crew_repository.health_data(T) - - ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open) + ui = nanomanager.try_update_ui(user, src, ui_key, ui, force_open) if(!ui) ui = new(user, src, ui_key, "crew_monitor.tmpl", "Crew Monitoring Computer", 900, 800) @@ -33,8 +26,16 @@ // adding a template with the key "mapHeader" replaces the map header content ui.add_template("mapHeader", "crew_monitor_map_header.tmpl") - ui.set_initial_data(data) ui.open() // should make the UI auto-update; doesn't seem to? ui.set_auto_update(1) + +/datum/nano_module/crew_monitor/ui_data(mob/user, datum/topic_state/state = default_state) + var/data[0] + var/turf/T = get_turf(nano_host()) + + data["isAI"] = isAI(user) + data["crewmembers"] = crew_repository.health_data(T) + + return data diff --git a/code/modules/nano/modules/human_appearance.dm b/code/modules/nano/modules/human_appearance.dm index 21c14077886..8bc9058db37 100644 --- a/code/modules/nano/modules/human_appearance.dm +++ b/code/modules/nano/modules/human_appearance.dm @@ -211,6 +211,13 @@ return 0 /datum/nano_module/appearance_changer/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1, var/datum/topic_state/state = default_state) + ui = nanomanager.try_update_ui(user, src, ui_key, ui, force_open) + if(!ui) + ui = new(user, src, ui_key, "appearance_changer.tmpl", "[src]", 800, 450, state = state) + ui.open() + ui.set_auto_update(1) + +/datum/nano_module/appearance_changer/ui_data(mob/user, datum/topic_state/state = default_state) generate_data(check_whitelist, whitelist, blacklist) var/data[0] @@ -302,12 +309,8 @@ data["change_head_marking_color"] = can_change_markings("head") data["change_body_marking_color"] = can_change_markings("body") data["change_tail_marking_color"] = can_change_markings("tail") - ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open) - if(!ui) - ui = new(user, src, ui_key, "appearance_changer.tmpl", "[src]", 800, 450, state = state) - ui.set_initial_data(data) - ui.open() - ui.set_auto_update(1) + + return data /datum/nano_module/appearance_changer/proc/update_dna() if(owner && (flags & APPEARANCE_UPDATE_DNA)) diff --git a/code/modules/nano/modules/law_manager.dm b/code/modules/nano/modules/law_manager.dm index 9f10759dbe5..0d79f719677 100644 --- a/code/modules/nano/modules/law_manager.dm +++ b/code/modules/nano/modules/law_manager.dm @@ -148,6 +148,13 @@ return 0 /datum/nano_module/law_manager/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1, var/datum/topic_state/state = default_state) + ui = nanomanager.try_update_ui(user, src, ui_key, ui, force_open) + if(!ui) + ui = new(user, src, ui_key, "law_manager.tmpl", sanitize("[src] - [owner.name]"), 800, is_malf(user) ? 600 : 400, state = state) + ui.open() + ui.set_auto_update(1) + +/datum/nano_module/law_manager/ui_data(mob/user, datum/topic_state/state = default_state) var/data[0] owner.lawsync() @@ -176,12 +183,7 @@ data["channels"] = channels data["law_sets"] = package_multiple_laws(data["isAdmin"] ? admin_laws : player_laws) - ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open) - if(!ui) - ui = new(user, src, ui_key, "law_manager.tmpl", sanitize("[src] - [owner.name]"), 800, is_malf(user) ? 600 : 400, state = state) - ui.set_initial_data(data) - ui.open() - ui.set_auto_update(1) + return data /datum/nano_module/law_manager/proc/package_laws(var/list/data, var/field, var/list/datum/ai_law/laws) var/packaged_laws[0] diff --git a/code/modules/nano/modules/power_monitor.dm b/code/modules/nano/modules/power_monitor.dm index 9b9ccc8a060..1ebe6e99c9f 100644 --- a/code/modules/nano/modules/power_monitor.dm +++ b/code/modules/nano/modules/power_monitor.dm @@ -12,6 +12,13 @@ powermonitor = nano_host() /datum/nano_module/power_monitor/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1, var/datum/topic_state/state = default_state) + ui = nanomanager.try_update_ui(user, src, ui_key, ui, force_open) + if(!ui) + ui = new(user, src, ui_key, "power_monitor.tmpl", "Power Monitoring Console", 800, 700, state = state) + ui.open() + ui.set_auto_update(1) + +/datum/nano_module/power_monitor/ui_data(mob/user, datum/topic_state/state = default_state) var/data[0] data["powermonitor"] = powermonitor @@ -28,12 +35,7 @@ data["powerdemand"] = powermonitor.powernet.load data["apcs"] = apc_repository.apc_data(powermonitor) - ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open) - if(!ui) - ui = new(user, src, ui_key, "power_monitor.tmpl", "Power Monitoring Console", 800, 700, state = state) - ui.set_initial_data(data) - ui.open() - ui.set_auto_update(1) + return data /datum/nano_module/power_monitor/Topic(href, href_list) if(..()) diff --git a/code/modules/nano/nanoexternal.dm b/code/modules/nano/nanoexternal.dm index c463f895158..288a9df2255 100644 --- a/code/modules/nano/nanoexternal.dm +++ b/code/modules/nano/nanoexternal.dm @@ -28,7 +28,7 @@ /** * The ui_interact proc is used to open and update Nano UIs * If ui_interact is not used then the UI will not update correctly - * ui_interact is currently defined for /atom/movable + * ui_interact is currently defined for /datum * * @param user /mob The mob who is interacting with this ui * @param ui_key string A string key to use for this ui. Allows for multiple unique uis on one obj/mob (defaut value "main") @@ -40,5 +40,16 @@ /datum/proc/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1, var/datum/nano_ui/master_ui = null, var/datum/topic_state/state = default_state) return +/** + * The ui_data proc is used to get data for the interface + * + * @param user /mob The mob who is viewing this ui + * @param state /datum/topic_state Current topic state of the UI + * + * @return list() + */ +/datum/proc/ui_data(mob/user, datum/topic_state/state = default_state) + return list() + // Used by the Nano UI Manager (/datum/nanomanager) to track UIs opened by this mob /mob/var/list/open_uis = list() diff --git a/code/modules/nano/nanomanager.dm b/code/modules/nano/nanomanager.dm index 355397ef6cf..2d0fe09c887 100644 --- a/code/modules/nano/nanomanager.dm +++ b/code/modules/nano/nanomanager.dm @@ -10,7 +10,7 @@ * Get an open /nanoui ui for the current user, src_object and ui_key and try to update it with data * * @param user /mob The mob who opened/owns the ui - * @param src_object /obj|/mob The obj or mob which the ui belongs to + * @param src_object /datum The datum which the ui belongs to * @param ui_key string A string key used for the ui * @param ui /datum/nanoui An existing instance of the ui (can be null) * @param data list The data to be passed to the ui, if it exists @@ -18,19 +18,17 @@ * * @return /nanoui Returns the found ui, for null if none exists */ -/datum/nanomanager/proc/try_update_ui(var/mob/user, src_object, ui_key, var/datum/nanoui/ui, data, var/force_open = 0) +/datum/nanomanager/proc/try_update_ui(var/mob/user, var/datum/src_object, ui_key, var/datum/nanoui/ui, var/force_open = 0) if(isnull(ui)) // no ui has been passed, so we'll search for one - { ui = get_open_ui(user, src_object, ui_key) - } + if(!isnull(ui)) - // The UI is already open + var/data = src_object.ui_data(user, ui.state) // Get data from src_object. if(!force_open) ui.push_data(data) - return ui else - //testing("nanomanager/try_update_ui mob [user.name] [src_object:name] [ui_key] [force_open] - forcing opening of ui") - ui.close() + ui.reinitialize(null, data) + return ui return null /** @@ -227,4 +225,4 @@ oldMob.open_uis.Cut() - return 1 // success \ No newline at end of file + return 1 // success diff --git a/code/modules/nano/nanoui.dm b/code/modules/nano/nanoui.dm index cd381a786de..be5ad871a36 100644 --- a/code/modules/nano/nanoui.dm +++ b/code/modules/nano/nanoui.dm @@ -46,7 +46,7 @@ nanoui is used to open and update nano browser uis // the map z level to display var/map_z_level = 1 // initial data, containing the full data structure, must be sent to the ui (the data structure cannot be extended later on) - var/list/initial_data[0] + var/list/initial_data = null // Initialize as null for proper ! usage in initial set up // set to 1 to update the ui automatically every master_controller tick var/is_auto_updating = 0 // the current status/visibility of the ui @@ -405,19 +405,34 @@ nanoui is used to open and update nano browser uis /datum/nanoui/proc/open() if(!user.client) return + var/window_size = "" if(width && height) window_size = "size=[width]x[height];" + update_status(0) if(status == STATUS_CLOSE) return + if(!initial_data) + set_initial_data(src_object.ui_data(user, state)) // Get the UI data. + user << browse(get_html(), "window=[window_id];[window_size][window_options]") winset(user, "mapwindow.map", "focus=true") // return keyboard focus to map on_close_winset() //onclose(user, window_id) nanomanager.ui_opened(src) +/** + * Reinitialize the UI with + */ +/datum/nanoui/proc/reinitialize(template, list/data) + if(template) + add_template("main", template) + if(data) + set_initial_data(data) + open() + /** * Close this UI * diff --git a/code/modules/paperwork/faxmachine.dm b/code/modules/paperwork/faxmachine.dm index 9aff6687f6e..27a671590db 100644 --- a/code/modules/paperwork/faxmachine.dm +++ b/code/modules/paperwork/faxmachine.dm @@ -57,7 +57,14 @@ var/list/alldepartments = list() to_chat(user, "You swipe the card through [src], but nothing happens.") /obj/machinery/photocopier/faxmachine/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1) + ui = nanomanager.try_update_ui(user, src, ui_key, ui, force_open) + if(!ui) + ui = new(user, src, ui_key, "faxmachine.tmpl", "Fax Machine UI", 540, 450) + ui.open() + +/obj/machinery/photocopier/faxmachine/ui_data(mob/user, datum/topic_state/state = default_state) var/data[0] + if(scan) data["scan_name"] = scan.name else @@ -82,11 +89,7 @@ var/list/alldepartments = list() else data["respectcooldown"] = 0 - ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open) - if(!ui) - ui = new(user, src, ui_key, "faxmachine.tmpl", "Fax Machine UI", 540, 450) - ui.set_initial_data(data) - ui.open() + return data /obj/machinery/photocopier/faxmachine/Topic(href, href_list) if(..()) @@ -128,7 +131,7 @@ var/list/alldepartments = list() var/list/combineddepartments = alldepartments if(long_range_enabled) combineddepartments += admin_departments - + if(emagged) combineddepartments += hidden_admin_departments diff --git a/code/modules/pda/PDA.dm b/code/modules/pda/PDA.dm index fafa27a24f7..ed7c380c426 100755 --- a/code/modules/pda/PDA.dm +++ b/code/modules/pda/PDA.dm @@ -99,7 +99,7 @@ var/global/list/obj/item/device/pda/PDAs = list() if((!istype(over_object, /obj/screen)) && can_use()) return attack_self(M) -/obj/item/device/pda/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1) +/obj/item/device/pda/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1, var/datum/topic_state/state = inventory_state) ui_tick++ var/datum/nanoui/old_ui = nanomanager.get_open_ui(user, src, "main") var/auto_update = 1 @@ -115,8 +115,22 @@ var/global/list/obj/item/device/pda/PDAs = list() var/title = "Personal Data Assistant" - var/data[0] // This is the data that will be sent to the PDA + // update the ui if it exists, returns null if no ui is passed/found + ui = nanomanager.try_update_ui(user, src, ui_key, ui, force_open) + if(!ui) + // 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, 630, 600, state = state) + ui.set_state_key("pda") + // open the new ui window + ui.open() + + // auto update every Master Controller tick + ui.set_auto_update(auto_update) + +/obj/item/device/pda/ui_data(mob/user, datum/topic_state/state = inventory_state) + var/data[0] data["owner"] = owner // Who is your daddy... data["ownjob"] = ownjob // ...and what does he do? @@ -164,21 +178,7 @@ var/global/list/obj/item/device/pda/PDAs = list() "template" = current_app.template, "has_back" = current_app.has_back) - // update the ui if it exists, returns null if no ui is passed/found - ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open) - if(!ui) - // 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, 630, 600, state = inventory_state) - ui.set_state_key("pda") - - // 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() - - // auto update every Master Controller tick - ui.set_auto_update(auto_update) + return data /obj/item/device/pda/attack_self(mob/user as mob) user.set_machine(src) diff --git a/code/modules/power/apc.dm b/code/modules/power/apc.dm index b8ee00a9a5d..c91127d7f54 100644 --- a/code/modules/power/apc.dm +++ b/code/modules/power/apc.dm @@ -778,63 +778,64 @@ if(!user) return - var/list/data = list( - "locked" = is_locked(user), - "isOperating" = operating, - "externalPower" = main_status, - "powerCellStatus" = cell ? cell.percent() : null, - "chargeMode" = chargemode, - "chargingStatus" = charging, - "totalLoad" = round(lastused_equip + lastused_light + lastused_environ), - "coverLocked" = coverlocked, - "siliconUser" = istype(user, /mob/living/silicon), - "malfStatus" = get_malf_status(user), - - "powerChannels" = list( - list( - "title" = "Equipment", - "powerLoad" = round(lastused_equip), - "status" = equipment, - "topicParams" = list( - "auto" = list("eqp" = 3), - "on" = list("eqp" = 2), - "off" = list("eqp" = 1) - ) - ), - list( - "title" = "Lighting", - "powerLoad" = round(lastused_light), - "status" = lighting, - "topicParams" = list( - "auto" = list("lgt" = 3), - "on" = list("lgt" = 2), - "off" = list("lgt" = 1) - ) - ), - list( - "title" = "Environment", - "powerLoad" = round(lastused_environ), - "status" = environ, - "topicParams" = list( - "auto" = list("env" = 3), - "on" = list("env" = 2), - "off" = list("env" = 1) - ) - ) - ) - ) - // update the ui if it exists, returns null if no ui is passed/found - ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open) + ui = nanomanager.try_update_ui(user, src, ui_key, ui, force_open) if(!ui) // the ui does not exist, so we'll create a new one - ui = new(user, src, ui_key, "apc.tmpl", "[area.name] - APC", 510, data["siliconUser"] ? 535 : 460) - // When the UI is first opened this is the data it will use - ui.set_initial_data(data) + ui = new(user, src, ui_key, "apc.tmpl", "[area.name] - APC", 510, issilicon(user) ? 535 : 460) ui.open() // Auto update every Master Controller tick ui.set_auto_update(1) +/obj/machinery/power/apc/ui_data(mob/user, datum/topic_state/state = default_state) + var/data[0] + data["locked"] = is_locked(user) + data["isOperating"] = operating + data["externalPower"] = main_status + data["powerCellStatus"] = cell ? cell.percent() : null + data["chargeMode"] = chargemode + data["chargingStatus"] = charging + data["totalLoad"] = round(lastused_equip + lastused_light + lastused_environ) + data["coverLocked"] = coverlocked + data["siliconUser"] = istype(user, /mob/living/silicon) + data["malfStatus"] = get_malf_status(user) + + var/powerChannels[0] + powerChannels[++powerChannels.len] = list( + "title" = "Equipment", + "powerLoad" = round(lastused_equip), + "status" = equipment, + "topicParams" = list( + "auto" = list("eqp" = 3), + "on" = list("eqp" = 2), + "off" = list("eqp" = 1) + ) + ) + powerChannels[++powerChannels.len] = list( + "title" = "Lighting", + "powerLoad" = round(lastused_light), + "status" = lighting, + "topicParams" = list( + "auto" = list("lgt" = 3), + "on" = list("lgt" = 2), + "off" = list("lgt" = 1) + ) + ) + powerChannels[++powerChannels.len] = list( + "title" = "Environment", + "powerLoad" = round(lastused_environ), + "status" = environ, + "topicParams" = list( + "auto" = list("env" = 3), + "on" = list("env" = 2), + "off" = list("env" = 1) + ) + ) + + data["powerChannels"] = powerChannels + + return data + /obj/machinery/power/apc/proc/report() return "[area.name] : [equipment]/[lighting]/[environ] ([lastused_equip+lastused_light+lastused_environ]) : [cell? cell.percent() : "N/C"] ([charging])" diff --git a/code/modules/power/port_gen.dm b/code/modules/power/port_gen.dm index fdb9fe34ae1..4a35e57764c 100644 --- a/code/modules/power/port_gen.dm +++ b/code/modules/power/port_gen.dm @@ -321,7 +321,15 @@ if(IsBroken()) return + ui = nanomanager.try_update_ui(user, src, ui_key, ui, force_open) + if(!ui) + ui = new(user, src, ui_key, "pacman.tmpl", src.name, 500, 560) + ui.open() + ui.set_auto_update(1) + +/obj/machinery/power/port_gen/pacman/ui_data(mob/user, datum/topic_state/state = default_state) var/data[0] + data["active"] = active if(istype(user, /mob/living/silicon/ai)) data["is_ai"] = 1 @@ -329,6 +337,7 @@ data["is_ai"] = 1 else data["is_ai"] = 0 + data["output_set"] = power_output data["output_max"] = max_power_output data["output_safe"] = max_safe_output @@ -342,12 +351,7 @@ data["fuel_usage"] = active ? round((power_output / time_per_sheet) * 1000) : 0 data["fuel_type"] = sheet_name - ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open) - if(!ui) - ui = new(user, src, ui_key, "pacman.tmpl", src.name, 500, 560) - ui.set_initial_data(data) - ui.open() - ui.set_auto_update(1) + return data /obj/machinery/power/port_gen/pacman/Topic(href, href_list) if(..()) diff --git a/code/modules/power/smes.dm b/code/modules/power/smes.dm index 4af4ccaeee4..62557e85384 100644 --- a/code/modules/power/smes.dm +++ b/code/modules/power/smes.dm @@ -363,8 +363,21 @@ if(stat & BROKEN) return - // this is the data which will be sent to the ui + + // update the ui if it exists, returns null if no ui is passed/found + ui = nanomanager.try_update_ui(user, src, ui_key, ui, force_open) + if(!ui) + // 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, "smes.tmpl", "SMES Power Storage Unit", 540, 380) + // open the new ui window + ui.open() + // auto update every Master Controller tick + ui.set_auto_update(1) + +/obj/machinery/power/smes/ui_data(mob/user, datum/topic_state/state = default_state) var/data[0] + data["nameTag"] = name_tag data["storedCapacity"] = round(100.0*charge/capacity, 0.1) data["charging"] = inputting @@ -383,18 +396,7 @@ else data["outputting"] = 0 // smes is not outputting - // update the ui if it exists, returns null if no ui is passed/found - ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open) - if(!ui) - // 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, "smes.tmpl", "SMES Power Storage Unit", 540, 380) - // 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() - // auto update every Master Controller tick - ui.set_auto_update(1) + return data /obj/machinery/power/smes/Topic(href, href_list) if(..()) diff --git a/code/modules/power/solar.dm b/code/modules/power/solar.dm index a6a54c75feb..98d899cdbca 100644 --- a/code/modules/power/solar.dm +++ b/code/modules/power/solar.dm @@ -389,8 +389,14 @@ ui_interact(user) /obj/machinery/power/solar_control/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1) + ui = nanomanager.try_update_ui(user, src, ui_key, ui, force_open) + if(!ui) + ui = new(user, src, ui_key, "solar_control.tmpl", name, 490, 420) + ui.open() + ui.set_auto_update(1) - var/data = list() +/obj/machinery/power/solar_control/ui_data(mob/user, datum/topic_state/state = default_state) + var/data[0] data["generated"] = round(lastgen) data["angle"] = cdir @@ -403,12 +409,7 @@ data["connected_panels"] = connected_panels.len data["connected_tracker"] = (connected_tracker ? 1 : 0) - ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open) - if(!ui) - ui = new(user, src, ui_key, "solar_control.tmpl", name, 490, 420) - ui.set_initial_data(data) - ui.open() - ui.set_auto_update(1) + return data /obj/machinery/power/solar_control/attackby(I as obj, user as mob, params) if(istype(I, /obj/item/weapon/screwdriver)) @@ -535,4 +536,4 @@ /obj/item/weapon/paper/solar name = "paper- 'Going green! Setup your own solar array instructions.'" - info = "

Welcome

At greencorps we love the environment, and space. With this package you are able to help mother nature and produce energy without any usage of fossil fuel or plasma! Singularity energy is dangerous while solar energy is safe, which is why it's better. Now here is how you setup your own solar array.

You can make a solar panel by wrenching the solar assembly onto a cable node. Adding a glass panel, reinforced or regular glass will do, will finish the construction of your solar panel. It is that easy!

Now after setting up 19 more of these solar panels you will want to create a solar tracker to keep track of our mother nature's gift, the sun. These are the same steps as before except you insert the tracker equipment circuit into the assembly before performing the final step of adding the glass. You now have a tracker! Now the last step is to add a computer to calculate the sun's movements and to send commands to the solar panels to change direction with the sun. Setting up the solar computer is the same as setting up any computer, so you should have no trouble in doing that. You do need to put a wire node under the computer, and the wire needs to be connected to the tracker.

Congratulations, you should have a working solar array. If you are having trouble, here are some tips. Make sure all solar equipment are on a cable node, even the computer. You can always deconstruct your creations if you make a mistake.

That's all to it, be safe, be green!

" \ No newline at end of file + info = "

Welcome

At greencorps we love the environment, and space. With this package you are able to help mother nature and produce energy without any usage of fossil fuel or plasma! Singularity energy is dangerous while solar energy is safe, which is why it's better. Now here is how you setup your own solar array.

You can make a solar panel by wrenching the solar assembly onto a cable node. Adding a glass panel, reinforced or regular glass will do, will finish the construction of your solar panel. It is that easy!

Now after setting up 19 more of these solar panels you will want to create a solar tracker to keep track of our mother nature's gift, the sun. These are the same steps as before except you insert the tracker equipment circuit into the assembly before performing the final step of adding the glass. You now have a tracker! Now the last step is to add a computer to calculate the sun's movements and to send commands to the solar panels to change direction with the sun. Setting up the solar computer is the same as setting up any computer, so you should have no trouble in doing that. You do need to put a wire node under the computer, and the wire needs to be connected to the tracker.

Congratulations, you should have a working solar array. If you are having trouble, here are some tips. Make sure all solar equipment are on a cable node, even the computer. You can always deconstruct your creations if you make a mistake.

That's all to it, be safe, be green!

" diff --git a/code/modules/power/supermatter/supermatter.dm b/code/modules/power/supermatter/supermatter.dm index 420733f7c76..e0be4e3c0a0 100644 --- a/code/modules/power/supermatter/supermatter.dm +++ b/code/modules/power/supermatter/supermatter.dm @@ -259,6 +259,13 @@ // This is purely informational UI that may be accessed by AIs or robots /obj/machinery/power/supermatter_shard/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1) + ui = nanomanager.try_update_ui(user, src, ui_key, ui, force_open) + if(!ui) + ui = new(user, src, ui_key, "supermatter_crystal.tmpl", "Supermatter Crystal", 500, 300) + ui.open() + ui.set_auto_update(1) + +/obj/machinery/power/supermatter_shard/ui_data(mob/user, datum/topic_state/state = default_state) var/data[0] data["integrity_percentage"] = round(get_integrity()) @@ -277,12 +284,7 @@ else data["detonating"] = 0 - ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open) - if(!ui) - ui = new(user, src, ui_key, "supermatter_crystal.tmpl", "Supermatter Crystal", 500, 300) - ui.set_initial_data(data) - ui.open() - ui.set_auto_update(1) + return data /obj/machinery/power/supermatter_shard/proc/transfer_energy() for(var/obj/machinery/power/rad_collector/R in rad_collectors) diff --git a/code/modules/reagents/chemistry/machinery/chem_dispenser.dm b/code/modules/reagents/chemistry/machinery/chem_dispenser.dm index 5103f246a27..acbdc19b659 100644 --- a/code/modules/reagents/chemistry/machinery/chem_dispenser.dm +++ b/code/modules/reagents/chemistry/machinery/chem_dispenser.dm @@ -107,22 +107,30 @@ * * @return nothing */ - /obj/machinery/chem_dispenser/ui_interact(mob/user, ui_key = "main", datum/nanoui/ui = null, force_open = 1) if(broken_requirements.len) to_chat(user, "[src] is broken. [broken_requirements[broken_requirements[1]]]") return + // update the ui if it exists, returns null if no ui is passed/found + ui = nanomanager.try_update_ui(user, src, ui_key, ui, force_open) + if(!ui) + // 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, "chem_dispenser.tmpl", ui_title, 390, 655) + // open the new ui window + ui.open() - // this is the data which will be sent to the ui +/obj/machinery/chem_dispenser/ui_data(mob/user, datum/topic_state/state = default_state) var/data[0] + data["amount"] = amount data["energy"] = round(energy) data["maxEnergy"] = round(max_energy) data["isBeakerLoaded"] = beaker ? 1 : 0 - var beakerContents[0] - var beakerCurrentVolume = 0 + var/beakerContents[0] + var/beakerCurrentVolume = 0 if(beaker && beaker.reagents && beaker.reagents.reagent_list.len) for(var/datum/reagent/R in beaker.reagents.reagent_list) beakerContents.Add(list(list("name" = R.name, "id"=R.id, "volume" = R.volume))) // list in a list because Byond merges the first list... @@ -136,23 +144,14 @@ data["beakerCurrentVolume"] = null data["beakerMaxVolume"] = null - var chemicals[0] + var/chemicals[0] for(var/re in dispensable_reagents) var/datum/reagent/temp = chemical_reagents_list[re] if(temp) chemicals.Add(list(list("title" = temp.name, "id" = temp.id, "commands" = list("dispense" = temp.id)))) // list in a list because Byond merges the first list... data["chemicals"] = chemicals - // update the ui if it exists, returns null if no ui is passed/found - ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open) - if(!ui) - // 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, "chem_dispenser.tmpl", ui_title, 390, 655) - // 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() + return data /obj/machinery/chem_dispenser/Topic(href, href_list) if(..()) diff --git a/code/modules/reagents/chemistry/machinery/chem_heater.dm b/code/modules/reagents/chemistry/machinery/chem_heater.dm index 28d1f4c2afa..bd32fcee6cd 100644 --- a/code/modules/reagents/chemistry/machinery/chem_heater.dm +++ b/code/modules/reagents/chemistry/machinery/chem_heater.dm @@ -130,7 +130,15 @@ if(user.stat || user.restrained()) return + // update the ui if it exists, returns null if no ui is passed/found + ui = nanomanager.try_update_ui(user, src, ui_key, ui) + if(!ui) + ui = new(user, src, ui_key, "chem_heater.tmpl", "ChemHeater", 350, 270) + ui.open() + +/obj/machinery/chem_heater/ui_data(mob/user, datum/topic_state/state = default_state) var/data[0] + data["targetTemp"] = desired_temp data["isActive"] = on data["isBeakerLoaded"] = beaker ? 1 : 0 @@ -140,15 +148,10 @@ data["beakerMaxVolume"] = beaker ? beaker.volume : null //copy-pasted from chem dispenser - var beakerContents[0] + var/beakerContents[0] if(beaker) for(var/datum/reagent/R in beaker.reagents.reagent_list) beakerContents.Add(list(list("name" = R.name, "volume" = R.volume))) // list in a list because Byond merges the first list... data["beakerContents"] = beakerContents - // update the ui if it exists, returns null if no ui is passed/found - ui = nanomanager.try_update_ui(user, src, ui_key, ui, data) - if(!ui) - ui = new(user, src, ui_key, "chem_heater.tmpl", "ChemHeater", 350, 270) - ui.set_initial_data(data) - ui.open() \ No newline at end of file + return data \ No newline at end of file diff --git a/code/modules/reagents/chemistry/machinery/chem_master.dm b/code/modules/reagents/chemistry/machinery/chem_master.dm index b6b0de6e0a0..3ef20cff9b3 100644 --- a/code/modules/reagents/chemistry/machinery/chem_master.dm +++ b/code/modules/reagents/chemistry/machinery/chem_master.dm @@ -319,12 +319,17 @@ ui_interact(user) return -/obj/machinery/chem_master/ui_interact(mob/user, ui_key="main", datum/nanoui/ui = null, force_open = 1) - +/obj/machinery/chem_master/ui_interact(mob/user, ui_key = "main", datum/nanoui/ui = null, force_open = 1) var/datum/asset/chem_master/assets = get_asset_datum(/datum/asset/chem_master) assets.send(user) - var/data = list() + ui = nanomanager.try_update_ui(user, src, ui_key, ui, force_open) + if(!ui) + ui = new(user, src, ui_key, "chem_master.tmpl", name, 575, 400) + ui.open() + +/obj/machinery/chem_master/ui_data(mob/user, datum/topic_state/state = default_state) + var/data[0] data["condi"] = condi data["loaded_pill_bottle"] = (loaded_pill_bottle ? 1 : 0) @@ -347,11 +352,7 @@ data["bottlesprite"] = bottlesprite data["mode"] = mode - ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open) - if(!ui) - ui = new(user, src, ui_key, "chem_master.tmpl", name, 575, 400) - ui.set_initial_data(data) - ui.open() + return data /obj/machinery/chem_master/proc/isgoodnumber(num) if(isnum(num)) diff --git a/code/modules/reagents/chemistry/reagents/toxins.dm b/code/modules/reagents/chemistry/reagents/toxins.dm index 3b59ff8e0b7..411e6a7bae5 100644 --- a/code/modules/reagents/chemistry/reagents/toxins.dm +++ b/code/modules/reagents/chemistry/reagents/toxins.dm @@ -913,11 +913,9 @@ /datum/reagent/atrazine/reaction_turf(turf/simulated/wall/W, volume) // Clear off wallrot fungi if(istype(W) && W.rotting) + for(var/obj/effect/overlay/wall_rot/WR in W) + qdel(WR) W.rotting = 0 - for(var/obj/effect/overlay/O in W) - if(O.name == "Wallrot") // This is so awful - qdel(O) - W.visible_message("The fungi are completely dissolved by the solution!") /datum/reagent/atrazine/reaction_obj(obj/O, volume) diff --git a/code/modules/recycling/disposal.dm b/code/modules/recycling/disposal.dm index 232d2a9b3c5..feb350d4d91 100644 --- a/code/modules/recycling/disposal.dm +++ b/code/modules/recycling/disposal.dm @@ -128,10 +128,7 @@ for(var/mob/V in viewers(usr)) V.show_message("[usr] starts putting [GM.name] into the disposal.", 3) if(do_after(usr, 20, target = GM)) - if(GM.client) - GM.client.perspective = EYE_PERSPECTIVE - GM.client.eye = src - GM.loc = src + GM.forceMove(src) for(var/mob/C in viewers(src)) C.show_message("\red [GM.name] has been placed in the [src] by [user].", 3) qdel(G) @@ -189,10 +186,7 @@ msg_admin_attack("[key_name_admin(user)] placed [key_name_admin(target)] in a disposals unit") else return - if(target.client) - target.client.perspective = EYE_PERSPECTIVE - target.client.eye = src - target.loc = src + target.forceMove(src) for(var/mob/C in viewers(src)) if(C == user) @@ -215,14 +209,8 @@ // leave the disposal /obj/machinery/disposal/proc/go_out(mob/user) - - if(user.client) - user.client.eye = user.client.mob - user.client.perspective = MOB_PERSPECTIVE - user.loc = src.loc + user.forceMove(loc) update() - return - // ai as human but can't flush /obj/machinery/disposal/attack_ai(mob/user as mob) @@ -253,6 +241,13 @@ return /obj/machinery/disposal/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1) + ui = nanomanager.try_update_ui(user, src, ui_key, ui, force_open) + if(!ui) + ui = new(user, src, ui_key, "disposal_bin.tmpl", "Waste Disposal Unit", 395, 250) + ui.open() + ui.set_auto_update(1) + +/obj/machinery/disposal/ui_data(mob/user, datum/topic_state/state = default_state) var/data[0] var/pressure = Clamp(100* air_contents.return_pressure() / (SEND_PRESSURE), 0, 100) @@ -271,13 +266,7 @@ data["pumpstatus"] = "Idle" data["pressure"] = pressure_round - ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open) - - if(!ui) - ui = new(user, src, ui_key, "disposal_bin.tmpl", "Waste Disposal Unit", 395, 250) - ui.set_initial_data(data) - ui.open() - ui.set_auto_update(1) + return data /obj/machinery/disposal/Topic(href, href_list) if(usr.loc == src) @@ -488,6 +477,10 @@ if(current_size >= STAGE_FIVE) qdel(src) +/obj/machinery/disposal/get_remote_view_fullscreens(mob/user) + if(user.stat == DEAD || !(user.sight & (SEEOBJS|SEEMOBS))) + user.overlay_fullscreen("remote_view", /obj/screen/fullscreen/impaired, 2) + // virtual disposal object // travels through pipes in lieu of actual items // contents will be items flushed by the disposal @@ -1355,11 +1348,7 @@ // check if mob has client, if so restore client view on eject /mob/pipe_eject(var/direction) - if(src.client) - src.client.perspective = MOB_PERSPECTIVE - src.client.eye = src - - return + reset_perspective(null) /obj/effect/decal/cleanable/blood/gibs/pipe_eject(var/direction) var/list/dirs diff --git a/code/modules/research/rdconsole.dm b/code/modules/research/rdconsole.dm index 84fc3573bae..a39c6485fc7 100644 --- a/code/modules/research/rdconsole.dm +++ b/code/modules/research/rdconsole.dm @@ -647,7 +647,13 @@ won't update every console in existence) but it's more of a hassle to do. Also, /obj/machinery/computer/rdconsole/ui_interact(mob/user, ui_key="main", var/datum/nanoui/ui = null, var/force_open = 1) user.set_machine(src) - var/data = list() + ui = nanomanager.try_update_ui(user, src, ui_key, ui, force_open) + if(!ui) + ui = new(user, src, ui_key, "r_n_d.tmpl", src.name, 800, 550) + ui.open() + +/obj/machinery/computer/rdconsole/ui_data(mob/user, datum/topic_state/state = default_state) + var/data[0] files.RefreshResearch() @@ -857,11 +863,7 @@ won't update every console in existence) but it's more of a hassle to do. Also, loaded_chemical["volume"] = R.volume loaded_chemical["id"] = R.id - ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open) - if(!ui) - ui = new(user, src, ui_key, "r_n_d.tmpl", src.name, 800, 550) - ui.set_initial_data(data) - ui.open() + return data //helper proc that guarantees the wait message will not freeze the UI /obj/machinery/computer/rdconsole/proc/add_wait_message(message, delay) diff --git a/code/modules/research/xenoarchaeology/machinery/geosample_scanner.dm b/code/modules/research/xenoarchaeology/machinery/geosample_scanner.dm index 8bb917d3df4..c231912484b 100644 --- a/code/modules/research/xenoarchaeology/machinery/geosample_scanner.dm +++ b/code/modules/research/xenoarchaeology/machinery/geosample_scanner.dm @@ -112,11 +112,21 @@ coolant_purity = total_purity / fresh_coolant /obj/machinery/radiocarbon_spectrometer/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1) - if(user.stat) return - // this is the data which will be sent to the ui + // update the ui if it exists, returns null if no ui is passed/found + ui = nanomanager.try_update_ui(user, src, ui_key, ui, force_open) + if(!ui) + // 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, "geoscanner.tmpl", "High Res Radiocarbon Spectrometer", 900, 825) + // open the new ui window + ui.open() + // auto update every Master Controller tick + ui.set_auto_update(1) + +/obj/machinery/radiocarbon_spectrometer/ui_data(mob/user, datum/topic_state/state = default_state) var/data[0] data["scanned_item"] = (scanned_item ? scanned_item.name : "") data["scanned_item_desc"] = (scanned_item ? (scanned_item.desc ? scanned_item.desc : "No information on record.") : "") @@ -141,19 +151,7 @@ data["radiation"] = round(radiation) data["t_left_radspike"] = round(t_left_radspike) data["rad_shield_on"] = rad_shield - - // update the ui if it exists, returns null if no ui is passed/found - ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open) - if(!ui) - // 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, "geoscanner.tmpl", "High Res Radiocarbon Spectrometer", 900, 825) - // 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() - // auto update every Master Controller tick - ui.set_auto_update(1) + return data /obj/machinery/radiocarbon_spectrometer/process() if(scanning) diff --git a/code/modules/research/xenobiology/xenobio_camera.dm b/code/modules/research/xenobiology/xenobio_camera.dm index 4eb8d06ceb3..7b27642722b 100644 --- a/code/modules/research/xenobiology/xenobio_camera.dm +++ b/code/modules/research/xenobiology/xenobio_camera.dm @@ -76,7 +76,7 @@ origin.feed_slime_action.Remove(C) origin.monkey_recycle_action.Remove(C) //All of this stuff below could probably be a proc for all advanced cameras, only the action removal needs to be camera specific - remote_eye.user = null + remote_eye.eye_user = null if(C.client) C.client.perspective = MOB_PERSPECTIVE C.client.eye = src @@ -164,4 +164,4 @@ if(issmall(M) && M.stat) M.visible_message("[M] vanishes as they are reclaimed for recycling!") X.monkeys += 0.2 - qdel(M) \ No newline at end of file + qdel(M) diff --git a/code/modules/security_levels/keycard authentication.dm b/code/modules/security_levels/keycard authentication.dm index 8ff0ed6eb64..f2d36842504 100644 --- a/code/modules/security_levels/keycard authentication.dm +++ b/code/modules/security_levels/keycard authentication.dm @@ -3,7 +3,7 @@ desc = "This device is used to trigger station functions, which require more than one ID card to authenticate." icon = 'icons/obj/monitors.dmi' icon_state = "auth_off" - + var/active = 0 //This gets set to 1 on all devices except the one where the initial request was made. var/event = "" var/screen = 1 @@ -15,13 +15,13 @@ var/mob/event_triggered_by var/mob/event_confirmed_by var/ert_reason = "Reason for ERT" - + anchored = 1 use_power = 1 idle_power_usage = 2 active_power_usage = 6 power_channel = ENVIRON - + req_access = list(access_keycard_auth) /obj/machinery/keycard_auth/attack_ai(mob/user as mob) @@ -54,7 +54,7 @@ icon_state = "auth_off" else stat |= NOPOWER - + /obj/machinery/keycard_auth/attack_ghost(mob/user) ui_interact(user) @@ -70,25 +70,26 @@ user.set_machine(src) + ui = nanomanager.try_update_ui(user, src, ui_key, ui, force_open) + if(!ui) + ui = new(user, src, ui_key, "keycard_auth.tmpl", "Keycard Authentication Device UI", 540, 320) + ui.open() + +/obj/machinery/keycard_auth/ui_data(mob/user, datum/topic_state/state = default_state) var/data[0] data["screen"] = screen data["event"] = event data["ertreason"] = ert_reason - - ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open) - if(!ui) - ui = new(user, src, ui_key, "keycard_auth.tmpl", "Keycard Authentication Device UI", 540, 320) - ui.set_initial_data(data) - ui.open() + return data /obj/machinery/keycard_auth/Topic(href, href_list) if(..()) return 1 - + if(busy) to_chat(usr, "This device is busy.") return - + if(href_list["triggerevent"]) event = href_list["triggerevent"] screen = 2 diff --git a/code/modules/shuttle/supply.dm b/code/modules/shuttle/supply.dm index 05240d477f3..474cbd91915 100644 --- a/code/modules/shuttle/supply.dm +++ b/code/modules/shuttle/supply.dm @@ -425,6 +425,12 @@ ui_interact(user) /obj/machinery/computer/ordercomp/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null) + ui = nanomanager.try_update_ui(user, src, ui_key, ui) + if(!ui) + ui = new(user, src, ui_key, "order_console.tmpl", name, ORDER_SCREEN_WIDTH, ORDER_SCREEN_HEIGHT) + ui.open() + +/obj/machinery/computer/ordercomp/ui_data(mob/user, datum/topic_state/state = default_state) var/data[0] data["last_viewed_group"] = last_viewed_group @@ -474,11 +480,7 @@ data["at_station"] = shuttle_master.supply.getDockedId() == "supply_home" data["timeleft"] = shuttle_master.supply.timeLeft(600) - ui = nanomanager.try_update_ui(user, src, ui_key, ui, data) - if(!ui) - ui = new(user, src, ui_key, "order_console.tmpl", name, ORDER_SCREEN_WIDTH, ORDER_SCREEN_HEIGHT) - ui.set_initial_data(data) - ui.open() + return data /obj/machinery/computer/ordercomp/Topic(href, href_list) if(..()) @@ -572,7 +574,12 @@ return /obj/machinery/computer/supplycomp/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null) - // data to send to ui + ui = nanomanager.try_update_ui(user, src, ui_key, ui) + if(!ui) + ui = new(user, src, ui_key, "supply_console.tmpl", name, SUPPLY_SCREEN_WIDTH, SUPPLY_SCREEN_HEIGHT) + ui.open() + +/obj/machinery/computer/supplycomp/ui_data(mob/user, datum/topic_state/state = default_state) var/data[0] data["last_viewed_group"] = last_viewed_group @@ -622,12 +629,7 @@ data["at_station"] = shuttle_master.supply.getDockedId() == "supply_home" data["timeleft"] = shuttle_master.supply.timeLeft(600) data["can_launch"] = !shuttle_master.supply.canMove() - - ui = nanomanager.try_update_ui(user, src, ui_key, ui, data) - if(!ui) - ui = new(user, src, ui_key, "supply_console.tmpl", name, SUPPLY_SCREEN_WIDTH, SUPPLY_SCREEN_HEIGHT) - ui.set_initial_data(data) - ui.open() + return data /obj/machinery/computer/supplycomp/proc/is_authorized(user) if(allowed(user)) diff --git a/code/modules/spacepods/equipment.dm b/code/modules/spacepods/equipment.dm index 55342fad0e6..427a6db798a 100644 --- a/code/modules/spacepods/equipment.dm +++ b/code/modules/spacepods/equipment.dm @@ -8,7 +8,9 @@ to_chat(usr, "Missing equipment or weapons.") my_atom.verbs -= text2path("[type]/proc/fire_weapons") return - my_atom.battery.use(shot_cost) + if(!my_atom.battery.use(shot_cost)) + to_chat(usr, "Insufficient charge to fire the weapons") + return var/olddir for(var/i = 0; i < shots_per; i++) if(olddir != my_atom.dir) diff --git a/code/modules/surgery/organs/augments_eyes.dm b/code/modules/surgery/organs/augments_eyes.dm index 407a6b02777..1c66bd2c31b 100644 --- a/code/modules/surgery/organs/augments_eyes.dm +++ b/code/modules/surgery/organs/augments_eyes.dm @@ -8,6 +8,8 @@ w_class = 1 var/vision_flags = 0 + var/dark_view = 0 + var/see_invisible = 0 var/list/eye_colour = list(0,0,0) var/list/old_eye_colour = list(0,0,0) var/flash_protect = 0 @@ -18,15 +20,11 @@ ..() if(aug_message && !special) to_chat(owner, "[aug_message]") - M.sight |= vision_flags + M.update_sight() /obj/item/organ/internal/cyberimp/eyes/remove(var/mob/living/carbon/M, var/special = 0) . = ..() - M.sight ^= vision_flags - -/obj/item/organ/internal/cyberimp/eyes/on_life() - ..() - owner.sight |= vision_flags + M.update_sight() /obj/item/organ/internal/cyberimp/eyes/emp_act(severity) if(!owner) @@ -46,6 +44,8 @@ implant_color = "#000000" origin_tech = "materials=6;programming=4;biotech=6;magnets=5" vision_flags = SEE_MOBS | SEE_OBJS | SEE_TURFS + dark_view = 8 + see_invisible = SEE_INVISIBLE_MINIMUM /obj/item/organ/internal/cyberimp/eyes/thermals name = "Thermals implant" diff --git a/code/modules/surgery/organs_internal.dm b/code/modules/surgery/organs_internal.dm index 1d1ef048f65..f86cf41bcd0 100644 --- a/code/modules/surgery/organs_internal.dm +++ b/code/modules/surgery/organs_internal.dm @@ -62,18 +62,6 @@ can_infect = 1 blood_level = 1 -/datum/surgery_step/internal/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool,datum/surgery/surgery) - - if(!hasorgans(target)) - return 0 - - var/obj/item/organ/external/affected = target.get_organ(target_zone) - if(affected) - return 1 - - return 0 - - /datum/surgery_step/internal/manipulate_organs name = "manipulate organs" @@ -92,15 +80,13 @@ allowed_tools = allowed_tools + implements_extract + implements_mend + implements_finsh - - -/datum/surgery_step/internal/manipulate_organs/begin_step(mob/living/user, mob/living/carbon/target, target_zone, obj/item/tool,datum/surgery/surgery) - +/datum/surgery_step/internal/manipulate_organs/begin_step(mob/living/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery) I = null var/mob/living/carbon/human/H - if(istype(target,/mob/living/carbon/human)) + if(ishuman(target)) H = target affected = H.get_organ(target_zone) + if(is_int_organ(tool)) current_type = "insert" I = tool @@ -115,6 +101,7 @@ if(target.get_int_organ(I)) to_chat(user, " \The [target] already has [I].") return -1 + if(affected) user.visible_message("[user] starts transplanting \the [tool] into [target]'s [affected.name].", \ "You start transplanting \the [tool] into [target]'s [affected.name].") @@ -135,30 +122,33 @@ var/msg = "[user] starts pulling [target]'s skin back into place with \the [tool]." var/self_msg = "You start pulling [target]'s skin back into place with \the [tool]." user.visible_message(msg, self_msg) - if(affected) + + if(H && affected) H.custom_pain("Something hurts horribly in your [affected.name]!",1) + else if(implement_type in implements_extract) current_type = "extract" var/list/organs = target.get_organs_zone(target_zone) if(!organs.len) to_chat(user, "There are no removeable organs in [target]'s [parse_zone(target_zone)]!") return -1 - else - for(var/obj/item/organ/internal/O in organs) - O.on_find(user) - organs -= O - organs[O.name] = O - I = input("Remove which organ?", "Surgery", null, null) as null|anything in organs - if(I && user && target && user.Adjacent(target) && user.get_active_hand() == tool) - I = organs[I] - if(!I) return -1 - user.visible_message("[user] starts to separate [target]'s [I] with \the [tool].", \ - "You start to separate [target]'s [I] with \the [tool] for removal." ) - if(affected) - H.custom_pain("The pain in your [affected.name] is living hell!",1) - else + for(var/obj/item/organ/internal/O in organs) + O.on_find(user) + organs -= O + organs[O.name] = O + + I = input("Remove which organ?", "Surgery", null, null) as null|anything in organs + if(I && user && target && user.Adjacent(target) && user.get_active_hand() == tool) + I = organs[I] + if(!I) return -1 + user.visible_message("[user] starts to separate [target]'s [I] with \the [tool].", \ + "You start to separate [target]'s [I] with \the [tool] for removal." ) + if(H && affected) + H.custom_pain("The pain in your [affected.name] is living hell!",1) + else + return -1 else if(implement_type in implements_mend) current_type = "mend" @@ -173,6 +163,7 @@ if(!hasorgans(target)) to_chat(user, "They do not have organs to mend!") return + for(var/obj/item/organ/internal/I in affected.internal_organs) if(I && I.damage > 0) if(I.robotic < 2 && !istype (tool, /obj/item/stack/nanopaste)) @@ -186,14 +177,17 @@ else to_chat(user, "[I] does not appear to be damaged.") - H.custom_pain("The pain in your [affected.name] is living hell!",1) + + if(affected) + H.custom_pain("The pain in your [affected.name] is living hell!", 1) else if(istype(tool, /obj/item/weapon/reagent_containers/food/snacks/organ)) to_chat(user, "[tool] was biten by someone! It's too damaged to use!") return -1 + ..() -/datum/surgery_step/internal/manipulate_organs/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool,datum/surgery/surgery) +/datum/surgery_step/internal/manipulate_organs/end_step(mob/living/user, mob/living/carbon/target, target_zone, obj/item/tool,datum/surgery/surgery) if(current_type == "mend") var/tool_name = "\the [tool]" if(istype(tool, /obj/item/stack/medical/bruise_pack/advanced)) @@ -205,6 +199,7 @@ if(!hasorgans(target)) return + for(var/obj/item/organ/internal/I in affected.internal_organs) if(I) I.surgeryize() @@ -217,7 +212,7 @@ user.visible_message(" [user] treats damage to [target]'s [I.name] with [tool_name].", \ " You treat damage to [target]'s [I.name] with [tool_name]." ) I.damage = 0 - //return 1 + else if(current_type == "insert") I = tool user.drop_item() @@ -228,16 +223,17 @@ return 0 if(affected) - user.visible_message(" [user] has transplanted \the [tool] into [target]'s [affected.name].", \ + user.visible_message(" [user] has transplanted \the [tool] into [target]'s [affected.name].", " You have transplanted \the [tool] into [target]'s [affected.name].") else - user.visible_message(" [user] has transplanted \the [tool] into [target]'s [affected.name].", \ + user.visible_message(" [user] has transplanted \the [tool] into [target]'s [parse_zone(target_zone)].", " You have transplanted \the [tool] into [target]'s [parse_zone(target_zone)].") + I.status &= ~ORGAN_CUT_AWAY else if(current_type == "extract") if(I && I.owner == target) - user.visible_message(" [user] has separated and extracts [target]'s [I] with \the [tool]." , \ + user.visible_message(" [user] has separated and extracts [target]'s [I] with \the [tool].", " You have separated and extracted [target]'s [I] with \the [tool].") add_logs(user, target, "surgically removed [I.name] from", addition="INTENT: [uppertext(user.a_intent)]") @@ -251,9 +247,9 @@ else user.visible_message("[user] can't seem to extract anything from [target]'s [parse_zone(target_zone)]!", "You can't extract anything from [target]'s [parse_zone(target_zone)]!") - else if(current_type == "finish") - if(affected.encased) + else if(current_type == "finish") + if(affected && affected.encased) var/msg = " [user] bends [target]'s [affected.encased] back into place with \the [tool]." var/self_msg = " You bend [target]'s [affected.encased] back into place with \the [tool]." user.visible_message(msg, self_msg) @@ -268,13 +264,14 @@ return 0 -/datum/surgery_step/internal/manipulate_organs/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool,datum/surgery/surgery) +/datum/surgery_step/internal/manipulate_organs/fail_step(mob/living/user, mob/living/carbon/target, target_zone, obj/item/tool,datum/surgery/surgery) if(current_type == "mend") if(!hasorgans(target)) return user.visible_message(" [user]'s hand slips, getting mess and tearing the inside of [target]'s [affected.name] with \the [tool]!", \ " Your hand slips, getting mess and tearing the inside of [target]'s [affected.name] with \the [tool]!") + var/dam_amt = 2 if(istype(tool, /obj/item/stack/medical/bruise_pack/advanced)) @@ -290,27 +287,33 @@ I.take_damage(dam_amt,0) return 0 - else if(current_type == "insert") + else if(current_type == "insert") user.visible_message(" [user]'s hand slips, damaging \the [tool]!", \ " Your hand slips, damaging \the [tool]!") var/obj/item/organ/internal/I = tool - if(istype(I) &&!(I.tough)) + if(istype(I) && !I.tough) I.take_damage(rand(3,5),0) + return 0 else if(current_type == "extract") if(I && I.owner == target) - user.visible_message(" [user]'s hand slips, damaging [target]'s [affected.name] with \the [tool]!", \ - " Your hand slips, damaging [target]'s [affected.name] with \the [tool]!") - affected.createwound(BRUISE, 20) + if(affected) + user.visible_message(" [user]'s hand slips, damaging [target]'s [affected.name] with \the [tool]!", \ + " Your hand slips, damaging [target]'s [affected.name] with \the [tool]!") + affected.createwound(BRUISE, 20) + else + user.visible_message(" [user]'s hand slips, damaging [target]'s [parse_zone(target_zone)] with \the [tool]!", \ + " Your hand slips, damaging [target]'s [parse_zone(target_zone)] with \the [tool]!") else user.visible_message("[user] can't seem to extract anything from [target]'s [parse_zone(target_zone)]!", "You can't extract anything from [target]'s [parse_zone(target_zone)]!") return 0 + else if(current_type == "finish") - if(affected.encased) + if(affected && affected.encased) var/msg = " [user]'s hand slips, bending [target]'s [affected.encased] the wrong way!" var/self_msg = " Your hand slips, bending [target]'s [affected.encased] the wrong way!" user.visible_message(msg, self_msg) @@ -319,7 +322,8 @@ var/msg = " [user]'s hand slips, tearing the skin!" var/self_msg = " Your hand slips, tearing skin!" user.visible_message(msg, self_msg) - affected.createwound(BRUISE, 20) + if(affected) + affected.createwound(BRUISE, 20) return 0 diff --git a/html/changelog.html b/html/changelog.html index aaecde3bc11..ff4c9b90660 100644 --- a/html/changelog.html +++ b/html/changelog.html @@ -55,6 +55,87 @@ -->
+

23 December 2016

+

Crazylemon64 updated:

+ +

Fox McCloud updated:

+ +

KasparoVy updated:

+ +

Markolie updated:

+ + +

20 December 2016

+

TullyBurnalot updated:

+ + +

14 December 2016

+

Fox McCloud updated:

+ + +

13 December 2016

+

TullyBurnalot updated:

+ + +

12 December 2016

+

Kyep updated:

+ +

TullyBurnalot updated:

+ + +

09 December 2016

+

KasparoVy updated:

+ + +

08 December 2016

+

Kyep updated:

+ + +

07 December 2016

+

Markolie updated:

+ +

TullyBurnalot updated:

+ +

06 December 2016

Markolie updated: