Makes the station Z level into a list instead of a single define
This commit is contained in:
committed by
CitadelStationBot
parent
8ee6fdb76a
commit
d05fdb0eb0
@@ -40,7 +40,7 @@
|
||||
if(!GLOB.summon_spots.len)
|
||||
while(GLOB.summon_spots.len < SUMMON_POSSIBILITIES)
|
||||
var/area/summon = pick(GLOB.sortedAreas - GLOB.summon_spots)
|
||||
if(summon && (summon.z == ZLEVEL_STATION) && summon.valid_territory)
|
||||
if(summon && (summon.z in GLOB.station_z_levels) && summon.valid_territory)
|
||||
GLOB.summon_spots += summon
|
||||
SSticker.mode.cult_objectives += "eldergod"
|
||||
|
||||
|
||||
@@ -413,7 +413,7 @@
|
||||
AD.Refresh()
|
||||
|
||||
for(var/mob/living/carbon/human/H in shuffle(GLOB.living_mob_list))
|
||||
if(H.z != ZLEVEL_STATION)
|
||||
if(!(H.z in GLOB.station_z_levels))
|
||||
continue
|
||||
if(!H.HasDisease(D))
|
||||
H.ForceContractDisease(D)
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
<<<<<<< HEAD
|
||||
//wrapper
|
||||
/proc/do_teleport(ateleatom, adestination, aprecision=0, afteleport=1, aeffectin=null, aeffectout=null, asoundin=null, asoundout=null)
|
||||
var/datum/teleport/instant/science/D = new
|
||||
@@ -206,6 +207,216 @@
|
||||
continue
|
||||
|
||||
if(extended_safety_checks)
|
||||
=======
|
||||
//wrapper
|
||||
/proc/do_teleport(ateleatom, adestination, aprecision=0, afteleport=1, aeffectin=null, aeffectout=null, asoundin=null, asoundout=null)
|
||||
var/datum/teleport/instant/science/D = new
|
||||
if(D.start(arglist(args)))
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/datum/teleport
|
||||
var/atom/movable/teleatom //atom to teleport
|
||||
var/atom/destination //destination to teleport to
|
||||
var/precision = 0 //teleport precision
|
||||
var/datum/effect_system/effectin //effect to show right before teleportation
|
||||
var/datum/effect_system/effectout //effect to show right after teleportation
|
||||
var/soundin //soundfile to play before teleportation
|
||||
var/soundout //soundfile to play after teleportation
|
||||
var/force_teleport = 1 //if false, teleport will use Move() proc (dense objects will prevent teleportation)
|
||||
|
||||
/datum/teleport/proc/start(ateleatom, adestination, aprecision=0, afteleport=1, aeffectin=null, aeffectout=null, asoundin=null, asoundout=null)
|
||||
if(!initTeleport(arglist(args)))
|
||||
return 0
|
||||
return 1
|
||||
|
||||
/datum/teleport/proc/initTeleport(ateleatom,adestination,aprecision,afteleport,aeffectin,aeffectout,asoundin,asoundout)
|
||||
if(!setTeleatom(ateleatom))
|
||||
return 0
|
||||
if(!setDestination(adestination))
|
||||
return 0
|
||||
if(!setPrecision(aprecision))
|
||||
return 0
|
||||
setEffects(aeffectin,aeffectout)
|
||||
setForceTeleport(afteleport)
|
||||
setSounds(asoundin,asoundout)
|
||||
return 1
|
||||
|
||||
//must succeed
|
||||
/datum/teleport/proc/setPrecision(aprecision)
|
||||
if(isnum(aprecision))
|
||||
precision = aprecision
|
||||
return 1
|
||||
return 0
|
||||
|
||||
//must succeed
|
||||
/datum/teleport/proc/setDestination(atom/adestination)
|
||||
if(istype(adestination))
|
||||
destination = adestination
|
||||
return 1
|
||||
return 0
|
||||
|
||||
//must succeed in most cases
|
||||
/datum/teleport/proc/setTeleatom(atom/movable/ateleatom)
|
||||
if(istype(ateleatom, /obj/effect) && !istype(ateleatom, /obj/effect/dummy/chameleon))
|
||||
qdel(ateleatom)
|
||||
return 0
|
||||
if(istype(ateleatom))
|
||||
teleatom = ateleatom
|
||||
return 1
|
||||
return 0
|
||||
|
||||
//custom effects must be properly set up first for instant-type teleports
|
||||
//optional
|
||||
/datum/teleport/proc/setEffects(datum/effect_system/aeffectin=null,datum/effect_system/aeffectout=null)
|
||||
effectin = istype(aeffectin) ? aeffectin : null
|
||||
effectout = istype(aeffectout) ? aeffectout : null
|
||||
return 1
|
||||
|
||||
//optional
|
||||
/datum/teleport/proc/setForceTeleport(afteleport)
|
||||
force_teleport = afteleport
|
||||
return 1
|
||||
|
||||
//optional
|
||||
/datum/teleport/proc/setSounds(asoundin=null,asoundout=null)
|
||||
soundin = isfile(asoundin) ? asoundin : null
|
||||
soundout = isfile(asoundout) ? asoundout : null
|
||||
return 1
|
||||
|
||||
//placeholder
|
||||
/datum/teleport/proc/teleportChecks()
|
||||
return 1
|
||||
|
||||
/datum/teleport/proc/playSpecials(atom/location,datum/effect_system/effect,sound)
|
||||
if(location)
|
||||
if(effect)
|
||||
INVOKE_ASYNC(src, .proc/do_effect, location, effect)
|
||||
if(sound)
|
||||
INVOKE_ASYNC(src, .proc/do_sound, location, sound)
|
||||
|
||||
/datum/teleport/proc/do_effect(atom/location, datum/effect_system/effect)
|
||||
src = null
|
||||
effect.attach(location)
|
||||
effect.start()
|
||||
|
||||
/datum/teleport/proc/do_sound(atom/location, sound)
|
||||
src = null
|
||||
playsound(location, sound, 60, 1)
|
||||
|
||||
//do the monkey dance
|
||||
/datum/teleport/proc/doTeleport()
|
||||
|
||||
var/turf/destturf
|
||||
var/turf/curturf = get_turf(teleatom)
|
||||
destturf = get_teleport_turf(get_turf(destination), precision)
|
||||
|
||||
if(!destturf || !curturf || destturf.is_transition_turf())
|
||||
return 0
|
||||
|
||||
var/area/A = get_area(curturf)
|
||||
if(A.noteleport)
|
||||
return 0
|
||||
|
||||
playSpecials(curturf,effectin,soundin)
|
||||
if(force_teleport)
|
||||
teleatom.forceMove(destturf)
|
||||
if(ismegafauna(teleatom))
|
||||
message_admins("[teleatom] [ADMIN_FLW(teleatom)] has teleported from [ADMIN_COORDJMP(curturf)] to [ADMIN_COORDJMP(destturf)].")
|
||||
playSpecials(destturf,effectout,soundout)
|
||||
else
|
||||
if(teleatom.Move(destturf))
|
||||
playSpecials(destturf,effectout,soundout)
|
||||
if(ismegafauna(teleatom))
|
||||
message_admins("[teleatom] [ADMIN_FLW(teleatom)] has teleported from [ADMIN_COORDJMP(curturf)] to [ADMIN_COORDJMP(destturf)].")
|
||||
return 1
|
||||
|
||||
/datum/teleport/proc/teleport()
|
||||
if(teleportChecks())
|
||||
return doTeleport()
|
||||
return 0
|
||||
|
||||
/datum/teleport/instant //teleports when datum is created
|
||||
|
||||
start(ateleatom, adestination, aprecision=0, afteleport=1, aeffectin=null, aeffectout=null, asoundin=null, asoundout=null)
|
||||
if(..())
|
||||
if(teleport())
|
||||
return 1
|
||||
return 0
|
||||
|
||||
|
||||
/datum/teleport/instant/science
|
||||
|
||||
/datum/teleport/instant/science/setEffects(datum/effect_system/aeffectin,datum/effect_system/aeffectout)
|
||||
if(aeffectin==null || aeffectout==null)
|
||||
var/datum/effect_system/spark_spread/aeffect = new
|
||||
aeffect.set_up(5, 1, teleatom)
|
||||
effectin = effectin || aeffect
|
||||
effectout = effectout || aeffect
|
||||
return 1
|
||||
else
|
||||
return ..()
|
||||
|
||||
/datum/teleport/instant/science/setPrecision(aprecision)
|
||||
..()
|
||||
if(istype(teleatom, /obj/item/storage/backpack/holding))
|
||||
precision = rand(1,100)
|
||||
|
||||
var/list/bagholding = teleatom.search_contents_for(/obj/item/storage/backpack/holding)
|
||||
if(bagholding.len)
|
||||
precision = max(rand(1,100)*bagholding.len,100)
|
||||
if(isliving(teleatom))
|
||||
var/mob/living/MM = teleatom
|
||||
to_chat(MM, "<span class='warning'>The bluespace interface on your bag of holding interferes with the teleport!</span>")
|
||||
return 1
|
||||
|
||||
// Safe location finder
|
||||
|
||||
/proc/find_safe_turf(zlevel = ZLEVEL_STATION_PRIMARY, list/zlevels, extended_safety_checks = FALSE)
|
||||
if(!zlevels)
|
||||
zlevels = list(zlevel)
|
||||
var/cycles = 1000
|
||||
for(var/cycle in 1 to cycles)
|
||||
// DRUNK DIALLING WOOOOOOOOO
|
||||
var/x = rand(1, world.maxx)
|
||||
var/y = rand(1, world.maxy)
|
||||
var/z = pick(zlevels)
|
||||
var/random_location = locate(x,y,z)
|
||||
|
||||
if(!isfloorturf(random_location))
|
||||
continue
|
||||
var/turf/open/floor/F = random_location
|
||||
if(!F.air)
|
||||
continue
|
||||
|
||||
var/datum/gas_mixture/A = F.air
|
||||
var/list/A_gases = A.gases
|
||||
var/trace_gases
|
||||
for(var/id in A_gases)
|
||||
if(id in GLOB.hardcoded_gases)
|
||||
continue
|
||||
trace_gases = TRUE
|
||||
break
|
||||
|
||||
// Can most things breathe?
|
||||
if(trace_gases)
|
||||
continue
|
||||
if(!(A_gases["o2"] && A_gases["o2"][MOLES] >= 16))
|
||||
continue
|
||||
if(A_gases["plasma"])
|
||||
continue
|
||||
if(A_gases["co2"] && A_gases["co2"][MOLES] >= 10)
|
||||
continue
|
||||
|
||||
// Aim for goldilocks temperatures and pressure
|
||||
if((A.temperature <= 270) || (A.temperature >= 360))
|
||||
continue
|
||||
var/pressure = A.return_pressure()
|
||||
if((pressure <= 20) || (pressure >= 550))
|
||||
continue
|
||||
|
||||
if(extended_safety_checks)
|
||||
>>>>>>> 10a3238... Makes the station Z level into a list instead of a single define (#30297)
|
||||
if(istype(F, /turf/open/lava)) //chasms aren't /floor, and so are pre-filtered
|
||||
var/turf/open/lava/L = F
|
||||
if(!L.is_safe())
|
||||
|
||||
+1
-1
@@ -535,7 +535,7 @@
|
||||
if(I == src)
|
||||
continue
|
||||
var/mob/M = I
|
||||
if(M.z == ZLEVEL_STATION && !M.stat)
|
||||
if((M.z in GLOB.station_z_levels) && !M.stat)
|
||||
last_healthy_headrev = FALSE
|
||||
break
|
||||
text += "head | not mindshielded | <a href='?src=\ref[src];revolution=clear'>employee</a> | <b>[last_healthy_headrev ? "<font color='red'>LAST </font> " : ""]HEADREV</b> | <a href='?src=\ref[src];revolution=rev'>rev</a>"
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
var/area_type = /area/space //Types of area to affect
|
||||
var/list/impacted_areas = list() //Areas to be affected by the weather, calculated when the weather begins
|
||||
var/list/protected_areas = list()//Areas that are protected and excluded from the affected areas.
|
||||
var/target_z = ZLEVEL_STATION //The z-level to affect
|
||||
var/target_z = ZLEVEL_STATION_PRIMARY //The z-level to affect
|
||||
|
||||
var/overlay_layer = AREA_LAYER //Since it's above everything else, this is the layer used by default. TURF_LAYER is below mobs and walls if you need to use that.
|
||||
var/aesthetic = FALSE //If the weather has no purpose other than looks
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
area_type = /area
|
||||
protected_areas = list(/area/space)
|
||||
target_z = ZLEVEL_STATION
|
||||
target_z = ZLEVEL_STATION_PRIMARY
|
||||
|
||||
overlay_layer = ABOVE_OPEN_TURF_LAYER //Covers floors only
|
||||
immunity_type = "lava"
|
||||
@@ -48,7 +48,7 @@
|
||||
end_duration = 0
|
||||
|
||||
area_type = /area
|
||||
target_z = ZLEVEL_STATION
|
||||
target_z = ZLEVEL_STATION_PRIMARY
|
||||
|
||||
/datum/weather/advanced_darkness/update_areas()
|
||||
for(var/V in impacted_areas)
|
||||
@@ -142,7 +142,7 @@
|
||||
area_type = /area
|
||||
protected_areas = list(/area/maintenance, /area/ai_monitored/turret_protected/ai_upload, /area/ai_monitored/turret_protected/ai_upload_foyer,
|
||||
/area/ai_monitored/turret_protected/ai, /area/storage/emergency/starboard, /area/storage/emergency/port, /area/shuttle)
|
||||
target_z = ZLEVEL_STATION
|
||||
target_z = ZLEVEL_STATION_PRIMARY
|
||||
|
||||
immunity_type = "rad"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user