Changes to drones and z-macros (#7068)

Turns the z-level restriction procs into macros
Changes z-level restrictions to use the macros
Use contact_levels for announcements (instead of player_levels)
Restricts the teleporter to station_levels instead of player_levels
Restricts AI tracking to station_levels instead of player_levels
Mechs only get tracking beacons if they are on station_levels (instead of player_levels)
Construction Drones gib if they enter a station level
Mining Drones gib if they leave the station levels
Removes the mining equipment vendor from the scrapheap
This commit is contained in:
Werner
2019-11-06 18:55:14 +01:00
committed by GitHub
parent daf29bf016
commit 9c2f225718
46 changed files with 138 additions and 75 deletions
@@ -12,7 +12,7 @@
for(var/mob/living/carbon/human/H in mob_list)
var/turf/T = get_turf(H)
var/security = 0
if((T && T in current_map.admin_levels) || prisonwarped.Find(H))
if((T && isAdminLevel(T.z)) || prisonwarped.Find(H))
//don't warp them if they aren't ready or are already there
continue
H.Paralyse(5)
@@ -30,7 +30,7 @@
step_rand(W)
var/area/A = get_area(M)
if(A.requires_power && !A.always_unpowered && A.power_light && (A.z in current_map.player_levels))
if(A.requires_power && !A.always_unpowered && A.power_light && isPlayerLevel(A.z))
affected_areas |= get_area(M)
affected_mobs |= user
+1 -1
View File
@@ -17,7 +17,7 @@
var/inactive_on_main_station = 0
for(var/zone/zone in SSair.zones)
var/turf/simulated/turf = locate() in zone.contents
if(turf && turf.z in current_map.station_levels)
if(turf && isStationLevel(turf.z))
if(zone.needs_update)
active_on_main_station++
else
+1 -1
View File
@@ -18,7 +18,7 @@
if(!(origin && source))
return
if (!(origin.z in current_map.station_levels))
if(isNotStationLevel(origin.z))
return
origin = origin.get_alarm_origin()
@@ -129,7 +129,7 @@
to_chat(H, "<span class='warning'>You cannot teleport into solid walls.</span>")
return FALSE
if(T.z in current_map.admin_levels)
if(isAdminLevel(T.z))
to_chat(H, "<span class='warning'>You cannot use your teleporter on this Z-level.</span>")
return FALSE
+1 -1
View File
@@ -46,4 +46,4 @@
/datum/event/apc_damage/proc/is_valid_apc(var/obj/machinery/power/apc/apc)
var/turf/T = get_turf(apc)
return !apc.is_critical && !apc.emagged && T && (T.z in current_map.player_levels)
return !apc.is_critical && !apc.emagged && T && isStationLevel(T.z)
+1 -1
View File
@@ -35,4 +35,4 @@
/datum/event/camera_damage/proc/is_valid_camera(var/obj/machinery/camera/C)
// Only return a functional camera, not installed in a silicon, and that exists somewhere players have access
var/turf/T = get_turf(C)
return T && C.can_use() && !istype(C.loc, /mob/living/silicon) && (T.z in current_map.player_levels)
return T && C.can_use() && !istype(C.loc, /mob/living/silicon) && isStationLevel(T.z)
+1 -1
View File
@@ -36,7 +36,7 @@
var/area/A = get_area(C)
if(!A)
continue
if(!(A.z in current_map.station_levels))
if(isNotStationLevel(A.z))
continue
if(A.flags & RAD_SHIELDED)
continue
+1 -1
View File
@@ -18,7 +18,7 @@
/datum/event/spider_infestation/start()
var/list/vents = list()
for(var/obj/machinery/atmospherics/unary/vent_pump/temp_vent in SSmachinery.processing_machines)
if(!temp_vent.welded && temp_vent.network && temp_vent.loc.z in current_map.station_levels)
if(!temp_vent.welded && temp_vent.network && isStationLevel(temp_vent.loc.z))
if(temp_vent.network.normal_members.len > 50)
vents += temp_vent
+1 -1
View File
@@ -39,7 +39,7 @@
for(var/obj/machinery/atmospherics/unary/vent_scrubber/temp_vent in SSmachinery.processing_machines)
if(!temp_vent)
continue
if(temp_vent.z in current_map.station_levels)//STATION ZLEVEL
if(isStationLevel(temp_vent.z))
if(temp_vent.network && temp_vent.network.normal_members.len > 20)
vents += temp_vent
if(!vents.len)
+1 -1
View File
@@ -43,7 +43,7 @@ datum/event/viral_infection/start()
for(var/mob/living/carbon/human/H in player_list)
if(H.mind && H.stat != DEAD && H.is_client_active(5) && !player_is_antag(H.mind))
var/turf/T = get_turf(H)
if(T.z in current_map.station_levels)
if(isStationLevel(T.z))
candidates += H
if(!candidates.len) return
candidates = shuffle(candidates)
+1 -1
View File
@@ -671,7 +671,7 @@
for(var/obj/item/device/radio/beacon/B in teleportbeacons)
var/turf/T = get_turf(B)
if(T.z in current_map.station_levels)
if(isStationLevel(T.z))
destinations += B
return destinations
+11 -1
View File
@@ -9,7 +9,6 @@
req_access = list(access_mining, access_robotics)
idcard_type = /obj/item/weapon/card/id/minedrone
speed = -1
range_limit = 0
var/health_upgrade
var/ranged_upgrade
var/melee_upgrade
@@ -154,6 +153,17 @@
visible_message("\icon[src] <span class = 'notice'>The [usr] pings, \"[P.name] ready for review\", and happily disgorges a small printout.</span>", range = 2)
playsound(src.loc, 'sound/machines/ping.ogg', 50, 0)
/mob/living/silicon/robot/drone/mining/process_level_restrictions()
//Abort if they should not get blown
if (lockcharge || scrambledcodes || emagged)
return
//Check if they are not on a station level -> abort
var/turf/T = get_turf(src)
if (!T || isStationLevel(T.z))
return
to_chat(src,"WARNING: Removal from NanoTrasen property detected. Anti-Theft mode activated.")
gib()
/**********************Minebot Upgrades**********************/
/obj/item/device/mine_bot_ugprade
@@ -60,7 +60,6 @@
var/obj/item/hat
var/hat_x_offset = 0
var/hat_y_offset = -13
var/range_limit = 1
var/hacked = FALSE
holder_type = /obj/item/weapon/holder/drone
@@ -107,7 +106,6 @@
can_pull_size = 5
can_pull_mobs = MOB_PULL_SAME
holder_type = /obj/item/weapon/holder/drone/heavy
range_limit = 0
/mob/living/silicon/robot/drone/Initialize()
. = ..()
@@ -282,6 +280,12 @@
//DRONE LIFE/DEATH
/mob/living/silicon/robot/drone/process_level_restrictions()
var/turf/T = get_turf(src)
var/area/A = get_area(T)
if((!T || !(A in the_station_areas)) && src.stat != DEAD)
to_chat(src,"WARNING: Removal from NanoTrasen property detected. Anti-Theft mode activated.")
gib()
return
return
//For some goddamn reason robots have this hardcoded. Redefining it for our fragile friends here.
@@ -297,11 +301,7 @@
//Standard robots use config for crit, which is somewhat excessive for these guys.
//Drones killed by damage will gib.
/mob/living/silicon/robot/drone/handle_regular_status_updates()
var/turf/T = get_turf(src)
var/area/A = get_area(T)
if((!T || health <= -maxHealth || (range_limit && !(A in the_station_areas))) && src.stat != DEAD)
timeofdeath = world.time
death() //Possibly redundant, having trouble making death() cooperate.
if(health <= -maxHealth && src.stat != DEAD)
gib()
return
..()
@@ -413,6 +413,17 @@
real_name = "construction drone ([rand(100,999)])"
name = real_name
/mob/living/silicon/robot/drone/construction/process_level_restrictions()
//Abort if they should not get blown
if (lockcharge || scrambledcodes || emagged)
return
//Check if they are not on station level -> abort
var/turf/T = get_turf(src)
if (!T || isNotStationLevel(T.z))
return
to_chat(src,"WARNING: Lost contact with controller. Anti-Theft mode activated.")
gib()
/proc/too_many_active_drones()
var/drones = 0
for(var/mob/living/silicon/robot/drone/D in mob_list)
@@ -28,9 +28,9 @@
dat += "<B>Maintenance Units</B><BR>"
for(var/mob/living/silicon/robot/drone/D in silicon_mob_list)
if(src.z in current_map.station_levels && !(D.z in current_map.station_levels)) //If the console is on a station level, then list all drones on the station levels
if(isStationLevel(src.z) && isNotStationLevel(D.z)) //If the console is on a station level, then list all drones on the station levels
continue
else if (!(src.z in current_map.station_levels) && src.z != D.z) //If the console is not on the station, only list drones on the current level
else if (isNotStationLevel(src.z) && src.z != D.z) //If the console is not on the station, only list drones on the current level
continue
dat += "<BR>[D.real_name] ([D.stat == 2 ? "<font color='red'>INACTIVE</FONT>" : "<font color='green'>ACTIVE</FONT>"])"
dat += "<font dize = 9><BR>Cell charge: [D.cell.charge]/[D.cell.maxcharge]."
@@ -339,7 +339,7 @@
return
//Check if they are on a player level -> abort
var/turf/T = get_turf(src)
if (!T || (T.z in current_map.player_levels))
if (!T || isStationLevel(T.z))
return
//If they are on centcom -> abort
if (istype(get_area(src), /area/centcom) || istype(get_area(src), /area/shuttle/escape) || istype(get_area(src), /area/shuttle/arrival))
@@ -77,7 +77,7 @@ var/global/ntnet_card_uid = 1
if(holder2)
var/turf/T = get_turf(holder2)
if((T && istype(T)) && T.z in current_map.station_levels)
if((T && istype(T)) && isStationLevel(T.z))
// Computer is on station. Low/High signal depending on what type of network card you have
if(long_range)
return 2
+1 -1
View File
@@ -40,7 +40,7 @@
// Prevents the AI from using Topic on admin levels (by for example viewing through the court/thunderdome cameras)
// unless it's on the same level as the object it's interacting with.
var/turf/T = get_turf(src_object)
if(!T || !(z == T.z || (T.z in current_map.player_levels)))
if(!T || !(z == T.z || isStationLevel(T.z)))
return STATUS_CLOSE
// If an object is in view then we can interact with it
+1 -1
View File
@@ -108,7 +108,7 @@
if (start_with_cell && !no_emergency)
cell = new /obj/item/weapon/cell/device/emergency_light(src)
if (mapload && loc && !(z in current_map.admin_levels))
if (mapload && loc && isNotAdminLevel(z))
switch(fitting)
if("tube")
if(prob(2))
+1 -1
View File
@@ -436,7 +436,7 @@
failure_timer = max(failure_timer, duration)
/obj/machinery/power/smes/proc/ion_act()
if(src.z in current_map.station_levels)
if(isStationLevel(src.z))
if(prob(1)) //explosion
for(var/mob/M in viewers(src))
M.show_message("<span class='warning'>The [src.name] is making strange noises!</span>", 3, "<span class='warning'>You hear sizzling electronics.</span>", 2)
@@ -696,7 +696,7 @@
P.name = "wormhole"
var/list/pick_turfs = list()
for(var/turf/simulated/floor/exit in turfs)
if(exit.z in current_map.station_levels)
if(isStationLevel(exit.z))
pick_turfs += exit
P.target = pick(pick_turfs)
QDEL_IN(P, rand(150,300))
@@ -55,7 +55,7 @@
var/newlevel = get_security_level()
for(var/obj/machinery/firealarm/FA in SSmachinery.processing_machines)
if(FA.z in current_map.contact_levels)
if(isContactLevel(FA.z))
FA.set_security_level(newlevel)
+1 -1
View File
@@ -204,7 +204,7 @@ var/list/spells = typesof(/spell) //needed for the badmin verb for now
if(!user_turf)
to_chat(user, "<span class='warning'>You cannot cast spells in null space!</span>")
if(spell_flags & Z2NOCAST && (user_turf.z in current_map.admin_levels)) //Certain spells are not allowed on the centcomm zlevel
if(spell_flags & Z2NOCAST && isAdminLevel(user_turf.z)) //Certain spells are not allowed on the centcomm zlevel
return 0
if(spell_flags & CONSTRUCT_CHECK)
+2 -2
View File
@@ -247,9 +247,9 @@
telefail()
temp_msg = "ERROR!<BR>Elevation is less than 1 or greater than 90."
return
if(!(z_co in current_map.player_levels))
if(isNotStationLevel(z_co))
telefail()
temp_msg = "ERROR! Sector is invalid! Valid sectors are [english_list(current_map.player_levels)]."
temp_msg = "ERROR! Sector is invalid! Valid sectors are [english_list(current_map.station_levels)]."
return
if(teles_left > 0)
doteleport(user)