[DNM][DNM][WIP] Projectile backend code port and update
Ports#54924, #65061, #59804 from /tg. adds auxiliary code from /tg to make code work.
This commit is contained in:
+31
-3
@@ -9,6 +9,9 @@
|
||||
plane = GAME_PLANE
|
||||
appearance_flags = TILE_BOUND
|
||||
|
||||
/// pass_flags that we are. If any of this matches a pass_flag on a moving thing, by default, we let them through.
|
||||
var/pass_flags_self = NONE
|
||||
|
||||
var/level = 2
|
||||
///If non-null, overrides a/an/some in all cases
|
||||
var/article
|
||||
@@ -269,12 +272,27 @@
|
||||
return FALSE
|
||||
if((P.flag in list("bullet", "bomb")) && P.ricochet_incidence_leeway)
|
||||
if((a_incidence_s < 90 && a_incidence_s < 90 - P.ricochet_incidence_leeway) || (a_incidence_s > 270 && a_incidence_s -270 > P.ricochet_incidence_leeway))
|
||||
return
|
||||
return FALSE
|
||||
var/new_angle_s = SIMPLIFY_DEGREES(face_angle + incidence_s)
|
||||
P.setAngle(new_angle_s)
|
||||
return TRUE
|
||||
|
||||
/atom/proc/CanPass(atom/movable/mover, turf/target)
|
||||
SHOULD_CALL_PARENT(TRUE)
|
||||
if(mover.movement_type & PHASING)
|
||||
return TRUE
|
||||
. = CanAllowThrough(mover, target)
|
||||
// This is cheaper than calling the proc every time since most things dont override CanPassThrough
|
||||
if(!mover.generic_canpass)
|
||||
return mover.CanPassThrough(src, target, .)
|
||||
|
||||
/// Returns true or false to allow the mover to move through src
|
||||
/atom/proc/CanAllowThrough(atom/movable/mover, turf/target)
|
||||
SHOULD_CALL_PARENT(TRUE)
|
||||
if(mover.pass_flags & pass_flags_self)
|
||||
return TRUE
|
||||
if(mover.throwing && (pass_flags_self & LETPASSTHROW))
|
||||
return TRUE
|
||||
return !density
|
||||
|
||||
/**
|
||||
@@ -445,9 +463,19 @@
|
||||
wires.emp_pulse(severity)
|
||||
return protection // Pass the protection value collected here upwards
|
||||
|
||||
/atom/proc/bullet_act(obj/item/projectile/P, def_zone)
|
||||
/**
|
||||
* React to a hit by a projectile object
|
||||
*
|
||||
* Default behaviour is to send the [COMSIG_ATOM_BULLET_ACT] and then call [on_hit][/obj/item/projectile/proc/on_hit] on the projectile
|
||||
*
|
||||
* @params
|
||||
* P - projectile
|
||||
* def_zone - zone hit
|
||||
* piercing_hit - is this hit piercing or normal?
|
||||
*/
|
||||
/atom/proc/bullet_act(obj/item/projectile/P, def_zone, piercing_hit = FALSE)
|
||||
SEND_SIGNAL(src, COMSIG_ATOM_BULLET_ACT, P, def_zone)
|
||||
. = P.on_hit(src, 0, def_zone)
|
||||
. = P.on_hit(src, 0, def_zone, piercing_hit)
|
||||
|
||||
//used on altdisarm() for special interactions between the shoved victim (target) and the src, with user being the one shoving the target on it.
|
||||
// IMPORTANT: if you wish to add a new own shove_act() to a certain object, remember to add SHOVABLE_ONTO to its obj_flags bitfied var first.
|
||||
|
||||
@@ -25,7 +25,10 @@
|
||||
var/inertia_moving = 0
|
||||
var/inertia_next_move = 0
|
||||
var/inertia_move_delay = 5
|
||||
var/pass_flags = 0
|
||||
/// Things we can pass through while moving. If any of this matches the thing we're trying to pass's [pass_flags_self], then we can pass through.
|
||||
var/pass_flags = NONE
|
||||
/// If false makes CanPass call CanPassThrough on this type instead of using default behaviour
|
||||
var/generic_canpass = TRUE
|
||||
var/moving_diagonally = 0 //0: not doing a diagonal move. 1 and 2: doing the first/second step of the diagonal move
|
||||
var/atom/movable/moving_from_pull //attempt to resume grab after moving instead of before.
|
||||
var/list/acted_explosions //for explosion dodging
|
||||
@@ -473,10 +476,15 @@
|
||||
/atom/movable/proc/move_crushed(atom/movable/pusher, force = MOVE_FORCE_DEFAULT, direction)
|
||||
return FALSE
|
||||
|
||||
/atom/movable/CanPass(atom/movable/mover, turf/target)
|
||||
/atom/movable/CanAllowThrough(atom/movable/mover, turf/target)
|
||||
. = ..()
|
||||
if(mover in buckled_mobs)
|
||||
return TRUE
|
||||
return ..()
|
||||
|
||||
/// Returns true or false to allow src to move through the blocker, mover has final say
|
||||
/atom/movable/proc/CanPassThrough(atom/blocker, turf/target, blocker_opinion)
|
||||
SHOULD_CALL_PARENT(TRUE)
|
||||
return blocker_opinion
|
||||
|
||||
/// called when this atom is removed from a storage item, which is passed on as S. The loc variable is already set to the new destination before this is called.
|
||||
/atom/movable/proc/on_exit_storage(datum/component/storage/concrete/S) // rename S to master_storage
|
||||
|
||||
@@ -90,6 +90,7 @@ Class Procs:
|
||||
verb_say = "beeps"
|
||||
verb_yell = "blares"
|
||||
pressure_resistance = 15
|
||||
pass_flags_self = PASSMACHINE
|
||||
max_integrity = 200
|
||||
layer = BELOW_OBJ_LAYER //keeps shit coming out of the machine from ending up underneath it.
|
||||
flags_1 = DEFAULT_RICOCHET_1
|
||||
|
||||
@@ -37,22 +37,19 @@
|
||||
else
|
||||
return ..()
|
||||
|
||||
/obj/structure/barricade/CanPass(atom/movable/mover, turf/target)//So bullets will fly over and stuff.
|
||||
/obj/structure/barricade/CanAllowThrough(atom/movable/mover, turf/target)//So bullets will fly over and stuff.
|
||||
. = ..()
|
||||
if(locate(/obj/structure/barricade) in get_turf(mover))
|
||||
return 1
|
||||
return TRUE
|
||||
else if(istype(mover, /obj/item/projectile))
|
||||
if(!anchored)
|
||||
return 1
|
||||
return TRUE
|
||||
var/obj/item/projectile/proj = mover
|
||||
if(proj.firer && Adjacent(proj.firer))
|
||||
return 1
|
||||
return TRUE
|
||||
if(prob(proj_pass_rate))
|
||||
return 1
|
||||
return 0
|
||||
else
|
||||
return !density
|
||||
|
||||
|
||||
return TRUE
|
||||
return FALSE
|
||||
|
||||
/////BARRICADE TYPES///////
|
||||
|
||||
@@ -79,7 +76,6 @@
|
||||
return
|
||||
return ..()
|
||||
|
||||
|
||||
/obj/structure/barricade/wooden/crude
|
||||
name = "crude plank barricade"
|
||||
desc = "This space is blocked off by a crude assortment of planks."
|
||||
@@ -96,7 +92,6 @@
|
||||
/obj/structure/barricade/wooden/make_debris()
|
||||
new /obj/item/stack/sheet/mineral/wood(get_turf(src), drop_amount)
|
||||
|
||||
|
||||
/obj/structure/barricade/sandbags
|
||||
name = "sandbags"
|
||||
desc = "Bags of sand. Self explanatory."
|
||||
@@ -104,13 +99,12 @@
|
||||
icon_state = "sandbags"
|
||||
max_integrity = 280
|
||||
proj_pass_rate = 20
|
||||
pass_flags = LETPASSTHROW
|
||||
pass_flags_self = LETPASSTHROW
|
||||
bar_material = SAND
|
||||
climbable = TRUE
|
||||
smooth = SMOOTH_TRUE
|
||||
canSmoothWith = list(/obj/structure/barricade/sandbags, /turf/closed/wall, /turf/closed/wall/r_wall, /obj/structure/falsewall, /obj/structure/falsewall/reinforced, /turf/closed/wall/rust, /turf/closed/wall/r_wall/rust, /obj/structure/barricade/security)
|
||||
|
||||
|
||||
/obj/structure/barricade/security
|
||||
name = "security barrier"
|
||||
desc = "A deployable barrier. Provides good cover in fire fights."
|
||||
@@ -125,7 +119,6 @@
|
||||
var/deploy_time = 40
|
||||
var/deploy_message = TRUE
|
||||
|
||||
|
||||
/obj/structure/barricade/security/Initialize()
|
||||
. = ..()
|
||||
addtimer(CALLBACK(src, .proc/deploy), deploy_time)
|
||||
@@ -137,7 +130,6 @@
|
||||
if(deploy_message)
|
||||
visible_message("<span class='warning'>[src] deploys!</span>")
|
||||
|
||||
|
||||
/obj/item/grenade/barrier
|
||||
name = "barrier grenade"
|
||||
desc = "Instant cover."
|
||||
@@ -194,7 +186,6 @@
|
||||
/obj/item/grenade/barrier/ui_action_click(mob/user)
|
||||
toggle_mode(user)
|
||||
|
||||
|
||||
#undef SINGLE
|
||||
#undef VERTICAL
|
||||
#undef HORIZONTAL
|
||||
|
||||
@@ -127,10 +127,12 @@
|
||||
. = ..()
|
||||
move_update_air(T)
|
||||
|
||||
/obj/machinery/door/CanPass(atom/movable/mover, turf/target)
|
||||
/obj/machinery/door/CanAllowThrough(atom/movable/mover, turf/target)
|
||||
. = ..()
|
||||
|
||||
// Snowflake handling for PASSGLASS.
|
||||
if(istype(mover) && (mover.pass_flags & PASSGLASS))
|
||||
return !opacity
|
||||
return !density
|
||||
|
||||
/obj/machinery/door/proc/bumpopen(mob/user)
|
||||
if(operating)
|
||||
|
||||
@@ -347,21 +347,15 @@
|
||||
return 0 // not big enough to matter
|
||||
return start_point.air.return_pressure() < 20 ? -1 : 1
|
||||
|
||||
/obj/machinery/door/firedoor/border_only/CanPass(atom/movable/mover, turf/target)
|
||||
if(istype(mover) && (mover.pass_flags & PASSGLASS))
|
||||
return TRUE
|
||||
if(get_dir(loc, target) == dir) //Make sure looking at appropriate border
|
||||
return !density
|
||||
else
|
||||
/obj/machinery/door/firedoor/border_only/CanAllowThrough(atom/movable/mover, turf/target)
|
||||
. = ..()
|
||||
if(!(get_dir(loc, target) == dir)) //Make sure looking at appropriate border
|
||||
return TRUE
|
||||
|
||||
/obj/machinery/door/firedoor/border_only/CheckExit(atom/movable/mover as mob|obj, turf/target)
|
||||
if(istype(mover) && (mover.pass_flags & PASSGLASS))
|
||||
return TRUE
|
||||
if(get_dir(loc, target) == dir)
|
||||
return !density
|
||||
else
|
||||
return TRUE
|
||||
return TRUE
|
||||
|
||||
/obj/machinery/door/firedoor/border_only/CanAtmosPass(turf/T)
|
||||
if(get_dir(loc, T) == dir)
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
armor = list("melee" = 20, "bullet" = 50, "laser" = 50, "energy" = 50, "bomb" = 10, "bio" = 100, "rad" = 100, "fire" = 70, "acid" = 100)
|
||||
visible = FALSE
|
||||
flags_1 = ON_BORDER_1|DEFAULT_RICOCHET_1
|
||||
pass_flags_self = PASSGLASS
|
||||
opacity = 0
|
||||
CanAtmosPass = ATMOS_PASS_PROC
|
||||
interaction_flags_machine = INTERACT_MACHINE_WIRES_IF_OPEN | INTERACT_MACHINE_ALLOW_SILICON | INTERACT_MACHINE_OPEN_SILICON | INTERACT_MACHINE_REQUIRES_SILICON | INTERACT_MACHINE_OPEN
|
||||
@@ -103,11 +104,12 @@
|
||||
do_animate("deny")
|
||||
return
|
||||
|
||||
/obj/machinery/door/window/CanPass(atom/movable/mover, turf/target)
|
||||
if(istype(mover) && (mover.pass_flags & PASSGLASS))
|
||||
return 1
|
||||
/obj/machinery/door/window/CanAllowThrough(atom/movable/mover, turf/target)
|
||||
. = ..()
|
||||
if(.)
|
||||
return
|
||||
if(get_dir(loc, target) == dir) //Make sure looking at appropriate border
|
||||
return !density
|
||||
return
|
||||
if(istype(mover, /obj/structure/window))
|
||||
var/obj/structure/window/W = mover
|
||||
if(!valid_window_location(loc, W.ini_dir))
|
||||
@@ -119,7 +121,7 @@
|
||||
else if(istype(mover, /obj/machinery/door/window) && !valid_window_location(loc, mover.dir))
|
||||
return FALSE
|
||||
else
|
||||
return 1
|
||||
return TRUE
|
||||
|
||||
/obj/machinery/door/window/CanAtmosPass(turf/T)
|
||||
if(get_dir(loc, T) == dir)
|
||||
@@ -131,13 +133,12 @@
|
||||
/obj/machinery/door/window/CanAStarPass(obj/item/card/id/ID, to_dir)
|
||||
return !density || (dir != to_dir) || (check_access(ID) && hasPower())
|
||||
|
||||
/obj/machinery/door/window/CheckExit(atom/movable/mover as mob|obj, turf/target)
|
||||
if(istype(mover) && (mover.pass_flags & PASSGLASS))
|
||||
return 1
|
||||
/obj/machinery/door/window/CheckExit(atom/movable/mover, turf/target)
|
||||
if((pass_flags_self & mover.pass_flags)) || ((pass_flags_self & LETPASSTHROW) && mover.throwing))
|
||||
return TRUE
|
||||
if(get_dir(loc, target) == dir)
|
||||
return !density
|
||||
else
|
||||
return 1
|
||||
return TRUE
|
||||
|
||||
/obj/machinery/door/window/open(forced=0)
|
||||
if (src.operating == 1) //doors can still open when emag-disabled
|
||||
|
||||
@@ -87,7 +87,7 @@
|
||||
is_powered = FALSE
|
||||
icon_state = icon_name + "[is_powered]" + "[(blood ? "bld" : "")]" // add the blood tag at the end
|
||||
|
||||
/obj/machinery/recycler/CanPass(atom/movable/AM)
|
||||
/obj/machinery/recycler/CanAllowThrough(atom/movable/AM)
|
||||
. = ..()
|
||||
if(!anchored)
|
||||
return
|
||||
|
||||
@@ -454,11 +454,10 @@
|
||||
if(gen_secondary) //using power may cause us to be destroyed
|
||||
gen_secondary.use_stored_power(drain_amount*0.5)
|
||||
|
||||
/obj/machinery/shieldwall/CanPass(atom/movable/mover, turf/target)
|
||||
/obj/machinery/shieldwall/CanAllowThrough(atom/movable/mover, turf/target)
|
||||
. = ..()
|
||||
if(istype(mover) && (mover.pass_flags & PASSGLASS))
|
||||
return prob(20)
|
||||
else
|
||||
if(istype(mover, /obj/item/projectile))
|
||||
return prob(10)
|
||||
else
|
||||
return !density
|
||||
|
||||
@@ -57,14 +57,14 @@
|
||||
AM.forceMove(drop_location())
|
||||
do_transform(AM)
|
||||
|
||||
/obj/machinery/transformer/CanPass(atom/movable/mover, turf/target)
|
||||
/obj/machinery/transformer/CanAllowThrough(atom/movable/mover, turf/target)
|
||||
. = ..()
|
||||
// Allows items to go through,
|
||||
// to stop them from blocking the conveyor belt.
|
||||
if(!ishuman(mover))
|
||||
var/dir = get_dir(src, mover)
|
||||
if(dir == EAST)
|
||||
return ..()
|
||||
return 0
|
||||
if(get_dir(src, mover) == EAST)
|
||||
return
|
||||
return FALSE
|
||||
|
||||
/obj/machinery/transformer/process()
|
||||
if(cooldown && (cooldown_timer <= world.time))
|
||||
|
||||
@@ -291,9 +291,6 @@
|
||||
to_chat(user, "<span class='warning'>You hit [src] but bounce off it!</span>")
|
||||
playsound(src.loc, 'sound/weapons/tap.ogg', 100, 1)
|
||||
|
||||
/obj/structure/foamedmetal/CanPass(atom/movable/mover, turf/target)
|
||||
return !density
|
||||
|
||||
/obj/structure/foamedmetal/iron
|
||||
max_integrity = 50
|
||||
icon_state = "ironfoam"
|
||||
@@ -306,6 +303,7 @@
|
||||
icon_state = "atmos_resin"
|
||||
alpha = 120
|
||||
max_integrity = 10
|
||||
pass_flags_self = PASSGLASS
|
||||
|
||||
/obj/structure/foamedmetal/resin/Initialize()
|
||||
. = ..()
|
||||
@@ -336,14 +334,6 @@
|
||||
for(var/obj/item/Item in O)
|
||||
Item.extinguish()
|
||||
|
||||
/obj/structure/foamedmetal/resin/CanPass(atom/movable/mover, turf/target)
|
||||
if(istype(mover) && (mover.pass_flags & PASSGLASS))
|
||||
return TRUE
|
||||
. = ..()
|
||||
|
||||
/obj/structure/foamedmetal/resin/BlockThermalConductivity()
|
||||
return TRUE
|
||||
|
||||
#undef ALUMINUM_FOAM
|
||||
#undef IRON_FOAM
|
||||
#undef RESIN_FOAM
|
||||
|
||||
@@ -133,13 +133,11 @@
|
||||
M.emote("cough")
|
||||
return 1
|
||||
|
||||
/obj/effect/particle_effect/smoke/bad/CanPass(atom/movable/mover, turf/target)
|
||||
if(istype(mover, /obj/item/projectile/beam))
|
||||
var/obj/item/projectile/beam/B = mover
|
||||
/obj/effect/particle_effect/smoke/bad/Crossed(atom/movable/AM, oldloc)
|
||||
. = ..()
|
||||
if(istype(AM, /obj/projectile/beam))
|
||||
var/obj/projectile/beam/B = AM
|
||||
B.damage = (B.damage/2)
|
||||
return 1
|
||||
|
||||
|
||||
|
||||
/datum/effect_system/smoke_spread/bad
|
||||
effect_type = /obj/effect/particle_effect/smoke/bad
|
||||
|
||||
@@ -36,7 +36,8 @@
|
||||
icon_state = "stickyweb2"
|
||||
. = ..()
|
||||
|
||||
/obj/structure/spider/stickyweb/CanPass(atom/movable/mover, turf/target)
|
||||
/obj/structure/spider/stickyweb/CanAllowThrough(atom/movable/mover, turf/target)
|
||||
. = ..()
|
||||
if (genetic)
|
||||
return
|
||||
if(istype(mover, /mob/living/simple_animal/hostile/poison/giant_spider))
|
||||
@@ -49,7 +50,6 @@
|
||||
return FALSE
|
||||
else if(istype(mover, /obj/item/projectile))
|
||||
return prob(30)
|
||||
return TRUE
|
||||
|
||||
/obj/structure/spider/stickyweb/genetic //for the spider genes in genetics
|
||||
genetic = TRUE
|
||||
|
||||
@@ -92,9 +92,9 @@
|
||||
if(prob(I.force))
|
||||
push_over()
|
||||
|
||||
/obj/item/cardboard_cutout/bullet_act(obj/item/projectile/P)
|
||||
/obj/item/cardboard_cutout/bullet_act(obj/item/projectile/P, def_zone, piercing_hit = FALSE)
|
||||
if(istype(P, /obj/item/projectile/bullet/reusable))
|
||||
P.on_hit(src, 0)
|
||||
P.on_hit(src, 0, piercing_hit)
|
||||
visible_message("<span class='danger'>[src] has been hit by [P]!</span>")
|
||||
playsound(src, 'sound/weapons/slice.ogg', 50, 1)
|
||||
if(prob(P.damage))
|
||||
|
||||
@@ -84,6 +84,7 @@
|
||||
layer = ABOVE_ALL_MOB_LAYER
|
||||
anchored = TRUE
|
||||
density = TRUE
|
||||
pass_flags_self = PASSGLASS
|
||||
mouse_opacity = MOUSE_OPACITY_OPAQUE
|
||||
resistance_flags = INDESTRUCTIBLE
|
||||
CanAtmosPass = ATMOS_PASS_DENSITY
|
||||
@@ -101,11 +102,6 @@
|
||||
generator = null
|
||||
return ..()
|
||||
|
||||
/obj/structure/projected_forcefield/CanPass(atom/movable/mover, turf/target)
|
||||
if(istype(mover) && (mover.pass_flags & PASSGLASS))
|
||||
return 1
|
||||
return !density
|
||||
|
||||
/obj/structure/projected_forcefield/play_attack_sound(damage_amount, damage_type = BRUTE, damage_flag = 0)
|
||||
playsound(loc, 'sound/weapons/egloves.ogg', 80, 1)
|
||||
|
||||
|
||||
@@ -238,7 +238,11 @@
|
||||
/obj/get_dumping_location(datum/component/storage/source,mob/user)
|
||||
return get_turf(src)
|
||||
|
||||
/obj/proc/CanAStarPass()
|
||||
/obj/proc/CanAStarPass(ID, dir, caller)
|
||||
if(ismovable(caller))
|
||||
var/atom/movable/AM = caller
|
||||
if(AM.pass_flags & pass_flags_self)
|
||||
return TRUE
|
||||
. = !density
|
||||
|
||||
/obj/proc/check_uplink_validity()
|
||||
|
||||
@@ -10,9 +10,11 @@
|
||||
var/broken = 0 //similar to machinery's stat BROKEN
|
||||
layer = BELOW_OBJ_LAYER
|
||||
//ricochets on structures commented out for now because there's a lot of structures that /shouldnt/ be ricocheting and those need to be reviewed first
|
||||
//With the addition of [pass_flags_self] the ricocheting of structures /shouldnt/ happen by default thus the existing code could be uncommented out - Solaris-Shade
|
||||
//flags_1 = DEFAULT_RICOCHET_1
|
||||
//flags_ricochet = RICOCHET_HARD
|
||||
//ricochet_chance_mod = 0.5
|
||||
pass_flags_self = PASSSTRUCTURE
|
||||
|
||||
/obj/structure/Initialize()
|
||||
if (!armor)
|
||||
@@ -114,4 +116,4 @@
|
||||
return "<span class='warning'>It's falling apart!</span>"
|
||||
|
||||
/obj/structure/rust_heretic_act()
|
||||
take_damage(500, BRUTE, "melee", 1)
|
||||
take_damage(500, BRUTE, "melee", 1)
|
||||
|
||||
@@ -97,11 +97,6 @@
|
||||
/obj/structure/alien/resin/attack_paw(mob/user)
|
||||
return attack_hand(user)
|
||||
|
||||
|
||||
/obj/structure/alien/resin/CanPass(atom/movable/mover, turf/target)
|
||||
return !density
|
||||
|
||||
|
||||
/*
|
||||
* Weeds
|
||||
*/
|
||||
|
||||
@@ -110,10 +110,10 @@
|
||||
if(HAS_TRAIT(user, TRAIT_SKITTISH))
|
||||
. += "<span class='notice'>If you bump into [p_them()] while running, you will jump inside.</span>"
|
||||
|
||||
/obj/structure/closet/CanPass(atom/movable/mover, turf/target)
|
||||
/obj/structure/closet/CanAllowThrough(atom/movable/mover, turf/target)
|
||||
. = ..()
|
||||
if(wall_mounted)
|
||||
return TRUE
|
||||
return !density
|
||||
|
||||
/obj/structure/closet/proc/can_open(mob/living/user, force = FALSE)
|
||||
if(force)
|
||||
|
||||
@@ -26,15 +26,15 @@
|
||||
// AddElement(/datum/element/climbable, climb_time = crate_climb_time, climb_stun = 0)
|
||||
update_icon()
|
||||
|
||||
/obj/structure/closet/crate/CanPass(atom/movable/mover, turf/target)
|
||||
/obj/structure/closet/crate/CanAllowThrough(atom/movable/mover, turf/target)
|
||||
. = ..()
|
||||
if(!istype(mover, /obj/structure/closet))
|
||||
var/obj/structure/closet/crate/locatedcrate = locate(/obj/structure/closet/crate) in get_turf(mover)
|
||||
if(locatedcrate) //you can walk on it like tables, if you're not in an open crate trying to move to a closed crate
|
||||
if(opened) //if we're open, allow entering regardless of located crate openness
|
||||
return 1
|
||||
return TRUE
|
||||
if(!locatedcrate.opened) //otherwise, if the located crate is closed, allow entering
|
||||
return 1
|
||||
return !density
|
||||
return TRUE
|
||||
|
||||
/obj/structure/closet/crate/update_icon_state()
|
||||
icon_state = "[initial(icon_state)][opened ? "open" : ""]"
|
||||
|
||||
@@ -296,14 +296,10 @@
|
||||
qdel(src)
|
||||
return TRUE
|
||||
|
||||
/obj/structure/girder/CanPass(atom/movable/mover, turf/target)
|
||||
if(istype(mover) && (mover.pass_flags & PASSGRILLE))
|
||||
/obj/structure/girder/CanAllowThrough(atom/movable/mover, turf/target)
|
||||
. = ..()
|
||||
if((mover.pass_flags & PASSGRILLE) || istype(mover, /obj/projectile))
|
||||
return prob(girderpasschance)
|
||||
else
|
||||
if(istype(mover, /obj/item/projectile))
|
||||
return prob(girderpasschance)
|
||||
else
|
||||
return 0
|
||||
|
||||
/obj/structure/girder/CanAStarPass(ID, dir, caller)
|
||||
. = !density
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
icon_state = "grille"
|
||||
density = TRUE
|
||||
anchored = TRUE
|
||||
pass_flags_self = PASSGRILLE
|
||||
flags_1 = CONDUCT_1
|
||||
pressure_resistance = 5*ONE_ATMOSPHERE
|
||||
layer = BELOW_OBJ_LAYER
|
||||
@@ -124,14 +125,10 @@
|
||||
if(!shock(user, 70))
|
||||
take_damage(20, BRUTE, "melee", 1)
|
||||
|
||||
/obj/structure/grille/CanPass(atom/movable/mover, turf/target)
|
||||
if(istype(mover) && (mover.pass_flags & PASSGRILLE))
|
||||
return TRUE
|
||||
else
|
||||
if(istype(mover, /obj/item/projectile) && density)
|
||||
return prob(30)
|
||||
else
|
||||
return !density
|
||||
/obj/structure/grille/CanAllowThrough(atom/movable/mover, turf/target)
|
||||
. = ..()
|
||||
if(!. && istype(mover, /obj/projectile))
|
||||
return prob(30)
|
||||
|
||||
/obj/structure/grille/CanAStarPass(ID, dir, caller)
|
||||
. = !density
|
||||
|
||||
@@ -51,20 +51,19 @@
|
||||
name = "holo barrier"
|
||||
desc = "A short holographic barrier which can only be passed by walking."
|
||||
icon_state = "holosign_sec"
|
||||
pass_flags = LETPASSTHROW
|
||||
pass_flags_self = PASSTABLE | PASSGRILLE | PASSGLASS | LETPASSTHROW
|
||||
density = TRUE
|
||||
max_integrity = 20
|
||||
var/allow_walk = 1 //can we pass through it on walk intent
|
||||
|
||||
/obj/structure/holosign/barrier/CanPass(atom/movable/mover, turf/target)
|
||||
if(!density)
|
||||
return 1
|
||||
if(mover.pass_flags & (PASSGLASS|PASSTABLE|PASSGRILLE))
|
||||
return 1
|
||||
/obj/structure/holosign/barrier/CanAllowThrough(atom/movable/mover, turf/target)
|
||||
. = ..()
|
||||
if(.)
|
||||
return
|
||||
if(iscarbon(mover))
|
||||
var/mob/living/carbon/C = mover
|
||||
if(allow_walk && C.m_intent == MOVE_INTENT_WALK)
|
||||
return 1
|
||||
return TRUE
|
||||
|
||||
/obj/structure/holosign/barrier/engineering
|
||||
icon_state = "holosign_engi"
|
||||
@@ -149,22 +148,27 @@
|
||||
. = ..()
|
||||
. += "<span class='notice'>The biometric scanners are <b>[force_allaccess ? "off" : "on"]</b>.</span>"
|
||||
|
||||
/obj/structure/holosign/barrier/medical/CanPass(atom/movable/mover, turf/target)
|
||||
icon_state = "holo_medical"
|
||||
/obj/structure/holosign/barrier/medical/CanAllowThrough(atom/movable/mover, turf/target)
|
||||
. = ..()
|
||||
if(force_allaccess)
|
||||
return TRUE
|
||||
if(ishuman(mover))
|
||||
var/mob/living/carbon/human/sickboi = mover
|
||||
var/threat = sickboi.check_virus()
|
||||
switch(threat)
|
||||
if(DISEASE_SEVERITY_MINOR, DISEASE_SEVERITY_MEDIUM, DISEASE_SEVERITY_HARMFUL, DISEASE_SEVERITY_DANGEROUS, DISEASE_SEVERITY_BIOHAZARD)
|
||||
if(buzzcd < world.time)
|
||||
playsound(get_turf(src),'sound/machines/buzz-sigh.ogg',65,1,4)
|
||||
buzzcd = (world.time + 60)
|
||||
icon_state = "holo_medical-deny"
|
||||
return FALSE
|
||||
else
|
||||
return TRUE //nice or benign diseases!
|
||||
|
||||
return CheckHuman(mover)
|
||||
|
||||
/obj/structure/holosign/barrier/medical/Bumped(atom/movable/AM)
|
||||
. = ..()
|
||||
icon_state = "holo_medical"
|
||||
if(ishuman(AM) && !CheckHuman(AM))
|
||||
if(buzzcd < world.time)
|
||||
playsound(get_turf(src),'sound/machines/buzz-sigh.ogg',65,TRUE,4)
|
||||
buzzcd = (world.time + 60)
|
||||
icon_state = "holo_medical-deny"
|
||||
|
||||
/obj/structure/holosign/barrier/medical/proc/CheckHuman(mob/living/carbon/human/sickboi)
|
||||
var/threat = sickboi.check_virus()
|
||||
if(get_disease_severity_value(threat) > get_disease_severity_value(DISEASE_SEVERITY_MINOR))
|
||||
return FALSE
|
||||
return TRUE
|
||||
|
||||
/obj/structure/holosign/barrier/medical/on_attack_hand(mob/living/user, act_intent = user.a_intent, unarmed_attack_flags)
|
||||
|
||||
@@ -53,10 +53,10 @@
|
||||
/obj/structure/mineral_door/on_attack_hand(mob/user, act_intent = user.a_intent, unarmed_attack_flags)
|
||||
return TryToSwitchState(user)
|
||||
|
||||
/obj/structure/mineral_door/CanPass(atom/movable/mover, turf/target)
|
||||
/obj/structure/mineral_door/CanAllowThrough(atom/movable/mover, turf/target)
|
||||
. = ..()
|
||||
if(istype(mover, /obj/effect/beam))
|
||||
return !opacity
|
||||
return !density
|
||||
|
||||
/obj/structure/mineral_door/proc/TryToSwitchState(atom/user)
|
||||
if(isSwitchingStates)
|
||||
|
||||
@@ -306,7 +306,7 @@ GLOBAL_LIST_EMPTY(crematoriums)
|
||||
layer = TRAY_LAYER
|
||||
var/obj/structure/bodycontainer/connected = null
|
||||
anchored = TRUE
|
||||
pass_flags = LETPASSTHROW
|
||||
pass_flags_self = LETPASSTHROW
|
||||
max_integrity = 350
|
||||
|
||||
/obj/structure/tray/Destroy()
|
||||
@@ -362,17 +362,11 @@ GLOBAL_LIST_EMPTY(crematoriums)
|
||||
name = "morgue tray"
|
||||
desc = "Apply corpse before closing."
|
||||
icon_state = "morguet"
|
||||
pass_flags_self = PASSTABLE
|
||||
|
||||
/obj/structure/tray/m_tray/CanPass(atom/movable/mover, turf/target)
|
||||
if(istype(mover) && (mover.pass_flags & PASSTABLE))
|
||||
return 1
|
||||
/obj/structure/tray/m_tray/CanAllowThrough(atom/movable/mover, turf/target)
|
||||
. = ..()
|
||||
if(.)
|
||||
return
|
||||
if(locate(/obj/structure/table) in get_turf(mover))
|
||||
return 1
|
||||
else
|
||||
return 0
|
||||
|
||||
/obj/structure/tray/m_tray/CanAStarPass(ID, dir, caller)
|
||||
. = !density
|
||||
if(ismovable(caller))
|
||||
var/atom/movable/mover = caller
|
||||
. = . || (mover.pass_flags & PASSTABLE)
|
||||
return TRUE
|
||||
|
||||
@@ -69,7 +69,9 @@
|
||||
return CanAStarPass(ID, to_dir, M.pulling)
|
||||
return 1 //diseases, stings, etc can pass
|
||||
|
||||
/obj/structure/plasticflaps/CanPass(atom/movable/A, turf/T)
|
||||
/obj/structure/plasticflaps/CanAllowThrough(atom/movable/A, turf/T)
|
||||
. = ..()
|
||||
|
||||
if(istype(A) && (A.pass_flags & PASSGLASS))
|
||||
return prob(60)
|
||||
|
||||
@@ -93,7 +95,6 @@
|
||||
return 1
|
||||
if(!M.lying && !(SEND_SIGNAL(M, COMSIG_CHECK_VENTCRAWL)) && M.mob_size != MOB_SIZE_TINY) //If your not laying down, or a ventcrawler or a small creature, no pass.
|
||||
return 0
|
||||
return ..()
|
||||
|
||||
/obj/structure/plasticflaps/deconstruct(disassembled = TRUE)
|
||||
if(!(flags_1 & NODECONSTRUCT_1))
|
||||
|
||||
@@ -78,7 +78,7 @@
|
||||
/obj/structure/railing/CheckExit(atom/movable/mover, turf/target)
|
||||
..()
|
||||
if(get_dir(loc, target) & dir)
|
||||
var/checking = UNSTOPPABLE | FLYING | FLOATING
|
||||
var/checking = PHASING | FLYING | FLOATING
|
||||
return !density || mover.throwing || mover.movement_type & checking || mover.move_force >= MOVE_FORCE_EXTREMELY_STRONG
|
||||
return TRUE
|
||||
|
||||
|
||||
@@ -19,10 +19,10 @@
|
||||
icon_state = "table"
|
||||
density = TRUE
|
||||
anchored = TRUE
|
||||
pass_flags_self = PASSTABLE | LETPASSTHROW
|
||||
layer = TABLE_LAYER
|
||||
climbable = TRUE
|
||||
obj_flags = CAN_BE_HIT|SHOVABLE_ONTO
|
||||
pass_flags = LETPASSTHROW //You can throw objects over this, despite it's density.")
|
||||
attack_hand_speed = CLICK_CD_MELEE
|
||||
attack_hand_is_action = TRUE
|
||||
var/frame = /obj/structure/table_frame
|
||||
@@ -99,15 +99,14 @@
|
||||
/obj/structure/table/attack_tk()
|
||||
return FALSE
|
||||
|
||||
/obj/structure/table/CanPass(atom/movable/mover, turf/target)
|
||||
if(istype(mover) && (mover.pass_flags & PASSTABLE))
|
||||
return 1
|
||||
/obj/structure/table/CanAllowThrough(atom/movable/mover, turf/target)
|
||||
. = ..()
|
||||
if(.)
|
||||
return
|
||||
if(mover.throwing)
|
||||
return 1
|
||||
return TRUE
|
||||
if(locate(/obj/structure/table) in get_turf(mover))
|
||||
return 1
|
||||
else
|
||||
return !density
|
||||
return TRUE
|
||||
|
||||
/obj/structure/table/CanAStarPass(ID, dir, caller)
|
||||
. = !density
|
||||
@@ -685,7 +684,7 @@
|
||||
layer = TABLE_LAYER
|
||||
density = TRUE
|
||||
anchored = TRUE
|
||||
pass_flags = LETPASSTHROW //You can throw objects over this, despite it's density.
|
||||
pass_flags_self = LETPASSTHROW //You can throw objects over this, despite it's density.
|
||||
max_integrity = 20
|
||||
attack_hand_speed = CLICK_CD_MELEE
|
||||
attack_hand_is_action = TRUE
|
||||
@@ -702,12 +701,6 @@
|
||||
else
|
||||
return 0
|
||||
|
||||
/obj/structure/rack/CanAStarPass(ID, dir, caller)
|
||||
. = !density
|
||||
if(ismovable(caller))
|
||||
var/atom/movable/mover = caller
|
||||
. = . || (mover.pass_flags & PASSTABLE)
|
||||
|
||||
/obj/structure/rack/MouseDrop_T(obj/O, mob/user)
|
||||
. = ..()
|
||||
if ((!( istype(O, /obj/item) ) || user.get_active_held_item() != O))
|
||||
|
||||
@@ -8,17 +8,13 @@
|
||||
layer = LOW_ITEM_LAYER
|
||||
anchored = TRUE
|
||||
climbable = 1
|
||||
pass_flags_self = PASSGLASS
|
||||
var/tube_construction = /obj/structure/c_transit_tube
|
||||
var/list/tube_dirs //list of directions this tube section can connect to.
|
||||
var/exit_delay = 1
|
||||
var/enter_delay = 0
|
||||
var/const/time_to_unwrench = 2 SECONDS
|
||||
|
||||
/obj/structure/transit_tube/CanPass(atom/movable/mover, turf/target)
|
||||
if(istype(mover) && (mover.pass_flags & PASSGLASS))
|
||||
return 1
|
||||
return !density
|
||||
|
||||
/obj/structure/transit_tube/New(loc, newdirection)
|
||||
..(loc)
|
||||
if(newdirection)
|
||||
|
||||
@@ -50,11 +50,10 @@
|
||||
/obj/structure/windoor_assembly/update_icon_state()
|
||||
icon_state = "[facing]_[secure ? "secure_" : ""]windoor_assembly[state]"
|
||||
|
||||
/obj/structure/windoor_assembly/CanPass(atom/movable/mover, turf/target)
|
||||
if(istype(mover) && (mover.pass_flags & PASSGLASS))
|
||||
return 1
|
||||
/obj/structure/windoor_assembly/CanAllowThrough(atom/movable/mover, turf/target)
|
||||
. = ..()
|
||||
if(get_dir(loc, target) == dir) //Make sure looking at appropriate border
|
||||
return !density
|
||||
return
|
||||
if(istype(mover, /obj/structure/window))
|
||||
var/obj/structure/window/W = mover
|
||||
if(!valid_window_location(loc, W.ini_dir))
|
||||
@@ -65,7 +64,6 @@
|
||||
return FALSE
|
||||
else if(istype(mover, /obj/machinery/door/window) && !valid_window_location(loc, mover.dir))
|
||||
return FALSE
|
||||
return 1
|
||||
|
||||
/obj/structure/windoor_assembly/CanAtmosPass(turf/T)
|
||||
if(get_dir(loc, T) == dir)
|
||||
@@ -73,13 +71,13 @@
|
||||
else
|
||||
return 1
|
||||
|
||||
/obj/structure/windoor_assembly/CheckExit(atom/movable/mover as mob|obj, turf/target)
|
||||
if(istype(mover) && (mover.pass_flags & PASSGLASS))
|
||||
return 1
|
||||
/obj/structure/windoor_assembly/CheckExit(atom/movable/mover, turf/target)
|
||||
if(mover.pass_flags & pass_flags_self)
|
||||
return TRUE
|
||||
if(get_dir(loc, target) == dir)
|
||||
return !density
|
||||
else
|
||||
return 1
|
||||
return TRUE
|
||||
|
||||
|
||||
/obj/structure/windoor_assembly/attackby(obj/item/W, mob/user, params)
|
||||
|
||||
@@ -18,6 +18,7 @@ GLOBAL_LIST_EMPTY(electrochromatic_window_lookup)
|
||||
pressure_resistance = 4*ONE_ATMOSPHERE
|
||||
anchored = TRUE //initially is 0 for tile smoothing
|
||||
max_integrity = 25
|
||||
pass_flags_self = PASSGLASS
|
||||
var/ini_dir = null
|
||||
var/state = WINDOW_OUT_OF_FRAME
|
||||
var/reinf = FALSE
|
||||
@@ -90,13 +91,13 @@ GLOBAL_LIST_EMPTY(electrochromatic_window_lookup)
|
||||
. = ..()
|
||||
if(direct)
|
||||
setDir(direct)
|
||||
|
||||
|
||||
if(extra_reinforced && anchored)
|
||||
state = PRWINDOW_SECURE
|
||||
|
||||
else if(reinf && anchored)
|
||||
state = WINDOW_SCREWED_TO_FRAME
|
||||
|
||||
|
||||
|
||||
if(mapload && electrochromatic_id && electrochromatic_id[1] == "!")
|
||||
electrochromatic_id = SSmapping.get_obfuscated_id(electrochromatic_id)
|
||||
@@ -159,13 +160,15 @@ GLOBAL_LIST_EMPTY(electrochromatic_window_lookup)
|
||||
else
|
||||
..(FULLTILE_WINDOW_DIR)
|
||||
|
||||
/obj/structure/window/CanPass(atom/movable/mover, turf/target)
|
||||
if(istype(mover) && (mover.pass_flags & PASSGLASS))
|
||||
return 1
|
||||
/obj/structure/window/CanAllowThrough(atom/movable/mover, turf/target)
|
||||
. = ..()
|
||||
if(.)
|
||||
return
|
||||
if(dir == FULLTILE_WINDOW_DIR)
|
||||
return 0 //full tile window, you can't move into it!
|
||||
if(get_dir(loc, target) == dir)
|
||||
return !density
|
||||
var/attempted_dir = get_dir(loc, target)
|
||||
if(attempted_dir == dir)
|
||||
return
|
||||
if(istype(mover, /obj/structure/window))
|
||||
var/obj/structure/window/W = mover
|
||||
if(!valid_window_location(loc, W.ini_dir))
|
||||
@@ -176,7 +179,8 @@ GLOBAL_LIST_EMPTY(electrochromatic_window_lookup)
|
||||
return FALSE
|
||||
else if(istype(mover, /obj/machinery/door/window) && !valid_window_location(loc, mover.dir))
|
||||
return FALSE
|
||||
return 1
|
||||
else if(attempted_dir != dir)
|
||||
return TRUE
|
||||
|
||||
/obj/structure/window/CheckExit(atom/movable/O, turf/target)
|
||||
if(istype(O) && (O.pass_flags & PASSGLASS))
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
blocks_air = 1
|
||||
rad_flags = RAD_PROTECT_CONTENTS | RAD_NO_CONTAMINATE
|
||||
rad_insulation = RAD_MEDIUM_INSULATION
|
||||
pass_flags_self = PASSCLOSEDTURF
|
||||
wave_explosion_block = 10
|
||||
wave_explosion_multiply = 0.75
|
||||
/// How much we block yelling
|
||||
@@ -23,11 +24,6 @@
|
||||
/turf/closed/get_smooth_underlay_icon(mutable_appearance/underlay_appearance, turf/asking_turf, adjacency_dir)
|
||||
return FALSE
|
||||
|
||||
/turf/closed/CanPass(atom/movable/mover, turf/target)
|
||||
if(istype(mover) && (mover.pass_flags & PASSCLOSEDTURF))
|
||||
return TRUE
|
||||
return ..()
|
||||
|
||||
/turf/closed/indestructible
|
||||
name = "wall"
|
||||
icon = 'icons/turf/walls.dmi'
|
||||
|
||||
@@ -77,9 +77,6 @@
|
||||
else
|
||||
to_chat(user, "<span class='warning'>The plating is going to need some support! Place metal rods first.</span>")
|
||||
|
||||
/turf/open/chasm/CanPass(atom/movable/mover, turf/target)
|
||||
return 1
|
||||
|
||||
// Chasms for Lavaland, with planetary atmos and lava glow
|
||||
/turf/open/chasm/lavaland
|
||||
initial_gas_mix = LAVALAND_DEFAULT_ATMOS
|
||||
|
||||
+4
-19
@@ -225,16 +225,6 @@ GLOBAL_LIST_EMPTY(station_turfs)
|
||||
|
||||
return FALSE
|
||||
|
||||
/turf/CanPass(atom/movable/mover, turf/target)
|
||||
if(!target)
|
||||
return FALSE
|
||||
|
||||
if(istype(mover)) // turf/Enter(...) will perform more advanced checks
|
||||
return !density
|
||||
|
||||
stack_trace("Non movable passed to turf CanPass : [mover]")
|
||||
return FALSE
|
||||
|
||||
//There's a lot of QDELETED() calls here if someone can figure out how to optimize this but not runtime when something gets deleted by a Bump/CanPass/Cross call, lemme know or go ahead and fix this mess - kevinz000
|
||||
/turf/Enter(atom/movable/mover, atom/oldloc)
|
||||
// Do not call ..()
|
||||
@@ -243,7 +233,7 @@ GLOBAL_LIST_EMPTY(station_turfs)
|
||||
// Here's hoping it doesn't stay like this for years before we finish conversion to step_
|
||||
var/atom/firstbump
|
||||
var/canPassSelf = CanPass(mover, src)
|
||||
if(canPassSelf || (mover.movement_type & UNSTOPPABLE))
|
||||
if(canPassSelf || (mover.movement_type & PHASING))
|
||||
for(var/i in contents)
|
||||
if(QDELETED(mover))
|
||||
return FALSE //We were deleted, do not attempt to proceed with movement.
|
||||
@@ -253,7 +243,7 @@ GLOBAL_LIST_EMPTY(station_turfs)
|
||||
if(!thing.Cross(mover))
|
||||
if(QDELETED(mover)) //Mover deleted from Cross/CanPass, do not proceed.
|
||||
return FALSE
|
||||
if((mover.movement_type & UNSTOPPABLE))
|
||||
if((mover.movement_type & PHASING))
|
||||
mover.Bump(thing)
|
||||
continue
|
||||
else
|
||||
@@ -265,7 +255,7 @@ GLOBAL_LIST_EMPTY(station_turfs)
|
||||
firstbump = src
|
||||
if(firstbump)
|
||||
mover.Bump(firstbump)
|
||||
return (mover.movement_type & UNSTOPPABLE)
|
||||
return (mover.movement_type & PHASING)
|
||||
return TRUE
|
||||
|
||||
/turf/Exit(atom/movable/mover, atom/newloc)
|
||||
@@ -279,7 +269,7 @@ GLOBAL_LIST_EMPTY(station_turfs)
|
||||
if(!thing.Uncross(mover, newloc))
|
||||
if(thing.flags_1 & ON_BORDER_1)
|
||||
mover.Bump(thing)
|
||||
if(!(mover.movement_type & UNSTOPPABLE))
|
||||
if(!(mover.movement_type & PHASING))
|
||||
return FALSE
|
||||
if(QDELETED(mover))
|
||||
return FALSE //We were deleted.
|
||||
@@ -621,11 +611,6 @@ GLOBAL_LIST_EMPTY(station_turfs)
|
||||
/turf/proc/Melt()
|
||||
return ScrapeAway(flags = CHANGETURF_INHERIT_AIR)
|
||||
|
||||
/turf/bullet_act(obj/item/projectile/P)
|
||||
. = ..()
|
||||
if(. != BULLET_ACT_FORCE_PIERCE)
|
||||
. = BULLET_ACT_TURF
|
||||
|
||||
/turf/proc/get_yelling_resistance(power)
|
||||
. = 0
|
||||
// don't bother checking fulltile, we don't need accuracy
|
||||
|
||||
Reference in New Issue
Block a user