[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:
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user