mirror of
https://github.com/PolarisSS13/Polaris.git
synced 2025-12-17 05:31:53 +00:00
Starts work on unbreaking CanPass()
This commit is contained in:
@@ -1,6 +1,28 @@
|
|||||||
|
|
||||||
|
|
||||||
/atom/var/pressure_resistance = ONE_ATMOSPHERE
|
/atom/var/pressure_resistance = ONE_ATMOSPHERE
|
||||||
|
/atom/var/can_atmos_pass = ATMOS_PASS_YES
|
||||||
|
|
||||||
|
// Used to determine if airflow/zones can pass this atom.
|
||||||
|
/atom/proc/CanZASPass(turf/T, is_zone)
|
||||||
|
switch(can_atmos_pass)
|
||||||
|
if(ATMOS_PASS_PROC)
|
||||||
|
return ATMOS_PASS_YES
|
||||||
|
if(ATMOS_PASS_DENSITY)
|
||||||
|
return !density
|
||||||
|
else
|
||||||
|
return can_atmos_pass
|
||||||
|
// return (!density || is_zone)
|
||||||
|
|
||||||
|
/*
|
||||||
|
/atom/proc/CanAtmosPass(turf/T)
|
||||||
|
switch (CanAtmosPass)
|
||||||
|
if (ATMOS_PASS_PROC)
|
||||||
|
return ATMOS_PASS_YES
|
||||||
|
if (ATMOS_PASS_DENSITY)
|
||||||
|
return !density
|
||||||
|
else
|
||||||
|
return CanAtmosPass
|
||||||
|
|
||||||
/atom/proc/CanPass(atom/movable/mover, turf/target, height=1.5, air_group = 0)
|
/atom/proc/CanPass(atom/movable/mover, turf/target, height=1.5, air_group = 0)
|
||||||
//Purpose: Determines if the object (or airflow) can pass this atom.
|
//Purpose: Determines if the object (or airflow) can pass this atom.
|
||||||
@@ -9,13 +31,21 @@
|
|||||||
//Outputs: Boolean if can pass.
|
//Outputs: Boolean if can pass.
|
||||||
|
|
||||||
return (!density || !height || air_group)
|
return (!density || !height || air_group)
|
||||||
|
*/
|
||||||
|
// Used to see if objects can freely move past this atom.
|
||||||
|
// Airflow and ZAS zones now uses CanZASPass() instead.
|
||||||
|
/atom/proc/CanPass(atom/movable/mover, turf/target, height=1.5, air_group = 0)
|
||||||
|
return !density
|
||||||
|
|
||||||
|
/turf/can_atmos_pass = ATMOS_PASS_NO
|
||||||
|
|
||||||
/turf/CanPass(atom/movable/mover, turf/target, height=1.5,air_group=0)
|
/turf/CanPass(atom/movable/mover, turf/target, height=1.5,air_group=0)
|
||||||
if(!target) return 0
|
if(!target) return FALSE
|
||||||
|
|
||||||
if(istype(mover)) // turf/Enter(...) will perform more advanced checks
|
if(istype(mover)) // turf/Enter(...) will perform more advanced checks
|
||||||
return !density
|
return !density
|
||||||
|
|
||||||
|
/*
|
||||||
else // Now, doing more detailed checks for air movement and air group formation
|
else // Now, doing more detailed checks for air movement and air group formation
|
||||||
if(target.blocks_air||blocks_air)
|
if(target.blocks_air||blocks_air)
|
||||||
return 0
|
return 0
|
||||||
@@ -29,6 +59,19 @@
|
|||||||
return 0
|
return 0
|
||||||
|
|
||||||
return 1
|
return 1
|
||||||
|
*/
|
||||||
|
|
||||||
|
/turf/CanZASPass(turf/T, is_zone)
|
||||||
|
if(T.blocks_air || src.blocks_air)
|
||||||
|
return FALSE
|
||||||
|
for(var/obj/obstacle in src)
|
||||||
|
if(!obstacle.CanZASPass(T, is_zone))
|
||||||
|
return FALSE
|
||||||
|
if(T != src)
|
||||||
|
for(var/obj/obstacle in T)
|
||||||
|
if(!obstacle.CanZASPass(src, is_zone))
|
||||||
|
return FALSE
|
||||||
|
return TRUE
|
||||||
|
|
||||||
//Convenience function for atoms to update turfs they occupy
|
//Convenience function for atoms to update turfs they occupy
|
||||||
/atom/movable/proc/update_nearby_tiles(need_rebuild)
|
/atom/movable/proc/update_nearby_tiles(need_rebuild)
|
||||||
@@ -46,12 +89,18 @@
|
|||||||
// AIR_BLOCKED - Blocked
|
// AIR_BLOCKED - Blocked
|
||||||
// ZONE_BLOCKED - Not blocked, but zone boundaries will not cross.
|
// ZONE_BLOCKED - Not blocked, but zone boundaries will not cross.
|
||||||
// BLOCKED - Blocked, zone boundaries will not cross even if opened.
|
// BLOCKED - Blocked, zone boundaries will not cross even if opened.
|
||||||
|
/*
|
||||||
atom/proc/c_airblock(turf/other)
|
atom/proc/c_airblock(turf/other)
|
||||||
#ifdef ZASDBG
|
#ifdef ZASDBG
|
||||||
ASSERT(isturf(other))
|
ASSERT(isturf(other))
|
||||||
#endif
|
#endif
|
||||||
return (AIR_BLOCKED*!CanPass(null, other, 0, 0))|(ZONE_BLOCKED*!CanPass(null, other, 1.5, 1))
|
return (AIR_BLOCKED*!CanPass(null, other, 0, 0))|(ZONE_BLOCKED*!CanPass(null, other, 1.5, 1))
|
||||||
|
*/
|
||||||
|
atom/proc/c_airblock(turf/other)
|
||||||
|
#ifdef ZASDBG
|
||||||
|
ASSERT(isturf(other))
|
||||||
|
#endif
|
||||||
|
return (AIR_BLOCKED*!CanZASPass(other, FALSE))|(ZONE_BLOCKED*!CanZASPass(other, TRUE))
|
||||||
|
|
||||||
turf/c_airblock(turf/other)
|
turf/c_airblock(turf/other)
|
||||||
#ifdef ZASDBG
|
#ifdef ZASDBG
|
||||||
|
|||||||
@@ -92,4 +92,11 @@
|
|||||||
#define ATMOSTANK_OXYGEN 40000 // O2 is also important for airmix, but not as much as N2 as it's only 21% of it.
|
#define ATMOSTANK_OXYGEN 40000 // O2 is also important for airmix, but not as much as N2 as it's only 21% of it.
|
||||||
#define ATMOSTANK_CO2 25000 // CO2 and PH are not critically important for station, only for toxins and alternative coolants, no need to store a lot of those.
|
#define ATMOSTANK_CO2 25000 // CO2 and PH are not critically important for station, only for toxins and alternative coolants, no need to store a lot of those.
|
||||||
#define ATMOSTANK_PHORON 25000
|
#define ATMOSTANK_PHORON 25000
|
||||||
#define ATMOSTANK_NITROUSOXIDE 10000 // N2O doesn't have a real useful use, i guess it's on station just to allow refilling of sec's riot control canisters?
|
#define ATMOSTANK_NITROUSOXIDE 10000 // N2O doesn't have a real useful use, i guess it's on station just to allow refilling of sec's riot control canisters?
|
||||||
|
|
||||||
|
// Used for quickly making certain things allow airflow or not.
|
||||||
|
// More complicated, conditional abilities for airflow should use ATMOS_PASS_PROC and override CanZASPass().
|
||||||
|
#define ATMOS_PASS_YES 1
|
||||||
|
#define ATMOS_PASS_NO 0
|
||||||
|
#define ATMOS_PASS_PROC -1 // Asks CanZASPass()
|
||||||
|
#define ATMOS_PASS_DENSITY -2 // Just checks density.
|
||||||
@@ -48,13 +48,10 @@
|
|||||||
qdel(src)
|
qdel(src)
|
||||||
return
|
return
|
||||||
|
|
||||||
/obj/machinery/optable/CanPass(atom/movable/mover, turf/target, height=0, air_group=0)
|
/obj/machinery/optable/CanPass(atom/movable/mover, turf/target)
|
||||||
if(air_group || (height==0)) return 1
|
|
||||||
|
|
||||||
if(istype(mover) && mover.checkpass(PASSTABLE))
|
if(istype(mover) && mover.checkpass(PASSTABLE))
|
||||||
return 1
|
return TRUE
|
||||||
else
|
return FALSE
|
||||||
return 0
|
|
||||||
|
|
||||||
/obj/machinery/optable/MouseDrop_T(obj/O as obj, mob/user as mob)
|
/obj/machinery/optable/MouseDrop_T(obj/O as obj, mob/user as mob)
|
||||||
|
|
||||||
|
|||||||
@@ -750,7 +750,7 @@ About the new airlock wires panel:
|
|||||||
if (user)
|
if (user)
|
||||||
src.attack_ai(user)
|
src.attack_ai(user)
|
||||||
|
|
||||||
/obj/machinery/door/airlock/CanPass(atom/movable/mover, turf/target, height=0, air_group=0)
|
/obj/machinery/door/airlock/CanPass(atom/movable/mover, turf/target)
|
||||||
if (src.isElectrified())
|
if (src.isElectrified())
|
||||||
if (istype(mover, /obj/item))
|
if (istype(mover, /obj/item))
|
||||||
var/obj/item/i = mover
|
var/obj/item/i = mover
|
||||||
|
|||||||
@@ -259,12 +259,14 @@
|
|||||||
if(stat & BROKEN)
|
if(stat & BROKEN)
|
||||||
stat &= ~BROKEN
|
stat &= ~BROKEN
|
||||||
|
|
||||||
|
/*
|
||||||
/obj/machinery/door/blast/CanPass(atom/movable/mover, turf/target, height=0, air_group=0)
|
// This replicates the old functionality coded into CanPass() for this object, however it appeared to have made blast doors not airtight.
|
||||||
if(air_group) return 1
|
// If for some reason this is actually needed for something important, uncomment this.
|
||||||
|
/obj/machinery/door/blast/CanZASPass(turf/T, is_zone)
|
||||||
|
if(is_zone)
|
||||||
|
return TRUE
|
||||||
return ..()
|
return ..()
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
// SUBTYPE: Regular
|
// SUBTYPE: Regular
|
||||||
// Your classical blast door, found almost everywhere.
|
// Your classical blast door, found almost everywhere.
|
||||||
|
|||||||
@@ -9,6 +9,7 @@
|
|||||||
anchored = 1
|
anchored = 1
|
||||||
opacity = 1
|
opacity = 1
|
||||||
density = 1
|
density = 1
|
||||||
|
can_atmos_pass = ATMOS_PASS_DENSITY
|
||||||
layer = DOOR_OPEN_LAYER
|
layer = DOOR_OPEN_LAYER
|
||||||
var/open_layer = DOOR_OPEN_LAYER
|
var/open_layer = DOOR_OPEN_LAYER
|
||||||
var/closed_layer = DOOR_CLOSED_LAYER
|
var/closed_layer = DOOR_CLOSED_LAYER
|
||||||
@@ -135,13 +136,16 @@
|
|||||||
else
|
else
|
||||||
do_animate("deny")
|
do_animate("deny")
|
||||||
|
|
||||||
/obj/machinery/door/CanPass(atom/movable/mover, turf/target, height=0, air_group=0)
|
/obj/machinery/door/CanPass(atom/movable/mover, turf/target)
|
||||||
if(air_group) return !block_air_zones
|
|
||||||
if(istype(mover) && mover.checkpass(PASSGLASS))
|
if(istype(mover) && mover.checkpass(PASSGLASS))
|
||||||
return !opacity
|
return !opacity
|
||||||
return !density
|
return !density
|
||||||
|
/*
|
||||||
|
/obj/machinery/door/CanZASPass(turf/T, is_zone)
|
||||||
|
if(is_zone)
|
||||||
|
return !block_air_zones
|
||||||
|
return ..()
|
||||||
|
*/
|
||||||
/obj/machinery/door/proc/bumpopen(mob/user as mob)
|
/obj/machinery/door/proc/bumpopen(mob/user as mob)
|
||||||
if(operating) return
|
if(operating) return
|
||||||
if(user.last_airflow > world.time - vsc.airflow_delay) //Fakkit
|
if(user.last_airflow > world.time - vsc.airflow_delay) //Fakkit
|
||||||
|
|||||||
@@ -25,6 +25,7 @@
|
|||||||
density = 1
|
density = 1
|
||||||
anchored = 1
|
anchored = 1
|
||||||
opacity = 0
|
opacity = 0
|
||||||
|
can_atmos_pass = ATMOS_PASS_DENSITY
|
||||||
|
|
||||||
icon = 'icons/obj/inflatable.dmi'
|
icon = 'icons/obj/inflatable.dmi'
|
||||||
icon_state = "wall"
|
icon_state = "wall"
|
||||||
@@ -40,9 +41,6 @@
|
|||||||
update_nearby_tiles()
|
update_nearby_tiles()
|
||||||
return ..()
|
return ..()
|
||||||
|
|
||||||
/obj/structure/inflatable/CanPass(atom/movable/mover, turf/target, height=0, air_group=0)
|
|
||||||
return 0
|
|
||||||
|
|
||||||
/obj/structure/inflatable/bullet_act(var/obj/item/projectile/Proj)
|
/obj/structure/inflatable/bullet_act(var/obj/item/projectile/Proj)
|
||||||
var/proj_damage = Proj.get_structure_damage()
|
var/proj_damage = Proj.get_structure_damage()
|
||||||
if(!proj_damage) return
|
if(!proj_damage) return
|
||||||
@@ -168,9 +166,7 @@
|
|||||||
/obj/structure/inflatable/door/attack_hand(mob/user as mob)
|
/obj/structure/inflatable/door/attack_hand(mob/user as mob)
|
||||||
return TryToSwitchState(user)
|
return TryToSwitchState(user)
|
||||||
|
|
||||||
/obj/structure/inflatable/door/CanPass(atom/movable/mover, turf/target, height=0, air_group=0)
|
/obj/structure/inflatable/door/CanPass(atom/movable/mover, turf/target)
|
||||||
if(air_group)
|
|
||||||
return state
|
|
||||||
if(istype(mover, /obj/effect/beam))
|
if(istype(mover, /obj/effect/beam))
|
||||||
return !opacity
|
return !opacity
|
||||||
return !density
|
return !density
|
||||||
|
|||||||
@@ -47,20 +47,27 @@ var/list/blobs = list()
|
|||||||
set_light(0)
|
set_light(0)
|
||||||
|
|
||||||
/obj/structure/blob/CanPass(atom/movable/mover, turf/target, height=0, air_group=0)
|
/obj/structure/blob/CanPass(atom/movable/mover, turf/target, height=0, air_group=0)
|
||||||
|
world << "/obj/structure/blob/CanPass(mover=[mover], target=[target], height=[height], air_group=[air_group]) called on [src]."
|
||||||
if(air_group || (height==0))
|
if(air_group || (height==0))
|
||||||
|
world << "Returned true due to being air group or having height=0"
|
||||||
return TRUE
|
return TRUE
|
||||||
if(istype(mover) && mover.checkpass(PASSBLOB))
|
if(istype(mover) && mover.checkpass(PASSBLOB))
|
||||||
|
world << "Returned true due to having PASSBLOB."
|
||||||
return TRUE
|
return TRUE
|
||||||
else if(istype(mover, /mob/living))
|
else if(istype(mover, /mob/living))
|
||||||
var/mob/living/L = mover
|
var/mob/living/L = mover
|
||||||
if(L.faction == "blob")
|
if(L.faction == "blob")
|
||||||
|
world << "Returned true due to being in blob faction."
|
||||||
return TRUE
|
return TRUE
|
||||||
else if(istype(mover, /obj/item/projectile))
|
else if(istype(mover, /obj/item/projectile))
|
||||||
var/obj/item/projectile/P = mover
|
var/obj/item/projectile/P = mover
|
||||||
if(P.firer && P.firer.faction == "blob")
|
if(P.firer && P.firer.faction == "blob")
|
||||||
|
world << "Returned true due to being a projectile fired by someone in blob faction."
|
||||||
return TRUE
|
return TRUE
|
||||||
|
world << "Returned false due to being a projectile, with firer not in faction."
|
||||||
return FALSE
|
return FALSE
|
||||||
else
|
else
|
||||||
|
world << "Returned false."
|
||||||
return FALSE
|
return FALSE
|
||||||
// return ..()
|
// return ..()
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,4 @@
|
|||||||
/mob/CanPass(atom/movable/mover, turf/target, height, air_group)
|
/mob/CanPass(atom/movable/mover, turf/target, height, air_group)
|
||||||
if(air_group || (height == 0))
|
|
||||||
return TRUE
|
|
||||||
|
|
||||||
if(ismob(mover))
|
if(ismob(mover))
|
||||||
var/mob/moving_mob = mover
|
var/mob/moving_mob = mover
|
||||||
if ((other_mobs && moving_mob.other_mobs))
|
if ((other_mobs && moving_mob.other_mobs))
|
||||||
@@ -10,3 +7,6 @@
|
|||||||
var/obj/item/projectile/P = mover
|
var/obj/item/projectile/P = mover
|
||||||
return !P.can_hit_target(src, P.permutated, src == P.original, TRUE)
|
return !P.can_hit_target(src, P.permutated, src == P.original, TRUE)
|
||||||
return (!mover.density || !density || lying)
|
return (!mover.density || !density || lying)
|
||||||
|
|
||||||
|
/mob/CanZASPass(turf/T, is_zone)
|
||||||
|
return TRUE
|
||||||
@@ -2629,7 +2629,7 @@
|
|||||||
#include "code\ZAS\Zone.dm"
|
#include "code\ZAS\Zone.dm"
|
||||||
#include "interface\interface.dm"
|
#include "interface\interface.dm"
|
||||||
#include "interface\skin.dmf"
|
#include "interface\skin.dmf"
|
||||||
#include "maps\southern_cross\southern_cross.dm"
|
#include "maps\example\example.dm"
|
||||||
#include "maps\submaps\space_submaps\space.dm"
|
#include "maps\submaps\space_submaps\space.dm"
|
||||||
#include "maps\submaps\surface_submaps\mountains\mountains.dm"
|
#include "maps\submaps\surface_submaps\mountains\mountains.dm"
|
||||||
#include "maps\submaps\surface_submaps\mountains\mountains_areas.dm"
|
#include "maps\submaps\surface_submaps\mountains\mountains_areas.dm"
|
||||||
|
|||||||
Reference in New Issue
Block a user