mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-08-24 05:23:22 +01:00
SSthrowing (#19421)
Ported SSThrowing from TG, to handle throwings. Updated movement system to the latest iteration, made it a datum as per latest iteration. Updated pass/hit handling of atoms, introduced pass_flag_self to determine what atoms allow to pass. Moved procs and defines around to make them more organized.
This commit is contained in:
@@ -27,10 +27,10 @@
|
||||
//float over to our destination, if we have one
|
||||
destination = dest_turf
|
||||
if(destination)
|
||||
SSmove_manager.move_to(src, destination, priority = MOVEMENT_SPACE_PRIORITY)
|
||||
GLOB.move_manager.move_to(src, destination, priority = MOVEMENT_SPACE_PRIORITY)
|
||||
|
||||
/obj/effect/effect/smoke/chem/Destroy()
|
||||
SSmove_manager.stop_looping(src)
|
||||
GLOB.move_manager.stop_looping(src)
|
||||
return ..()
|
||||
|
||||
/obj/effect/effect/smoke/chem/Move()
|
||||
|
||||
@@ -238,4 +238,4 @@
|
||||
/obj/structure/foamedmetal/CanPass(atom/movable/mover, turf/target, height=1.5, air_group = 0)
|
||||
if(air_group)
|
||||
return 0
|
||||
return !density
|
||||
return ..()
|
||||
|
||||
@@ -230,7 +230,7 @@
|
||||
var/list/nearby = oview(5, src)
|
||||
if(nearby.len)
|
||||
var/target_atom = pick(nearby)
|
||||
SSmove_manager.move_to(src, target_atom, 0, 5)
|
||||
GLOB.move_manager.move_to(src, target_atom, 0, 5)
|
||||
if(prob(25))
|
||||
src.visible_message(SPAN_NOTICE("\The [src] skitters[pick(" away"," around","")]."))
|
||||
else if(prob(5))
|
||||
@@ -238,7 +238,7 @@
|
||||
for(var/obj/machinery/atmospherics/unary/vent_pump/v in view(7,src))
|
||||
if(!v.welded)
|
||||
entry_vent = v
|
||||
SSmove_manager.move_to(src, entry_vent, 0, 5)
|
||||
GLOB.move_manager.move_to(src, entry_vent, 0, 5)
|
||||
break
|
||||
|
||||
if(isturf(loc) && amount_grown >= 100)
|
||||
@@ -275,7 +275,7 @@
|
||||
visible_message(SPAN_WARNING("\The [user] tries to stomp on \the [src], but misses!"))
|
||||
var/list/nearby = oview(2, src)
|
||||
if(length(nearby))
|
||||
SSmove_manager.move_to(src, pick(nearby), 0, 2)
|
||||
GLOB.move_manager.move_to(src, pick(nearby), 0, 2)
|
||||
return
|
||||
visible_message(SPAN_WARNING("\The [user] stomps \the [src] dead!"))
|
||||
die()
|
||||
|
||||
@@ -400,7 +400,7 @@
|
||||
src.pickup(user)
|
||||
if(S)
|
||||
S.remove_from_storage(src)
|
||||
src.throwing = 0
|
||||
QDEL_NULL(throwing)
|
||||
if (src.loc == user)
|
||||
if(!user.prepare_for_slotmove(src))
|
||||
return
|
||||
@@ -449,7 +449,7 @@
|
||||
else
|
||||
return 0
|
||||
|
||||
/obj/item/throw_impact(atom/hit_atom)
|
||||
/obj/item/throw_impact(atom/hit_atom, datum/thrownthing/throwingdatum)
|
||||
if(isliving(hit_atom)) //Living mobs handle hit sounds differently.
|
||||
var/mob/living/L = hit_atom
|
||||
if(L.in_throw_mode)
|
||||
|
||||
@@ -984,8 +984,9 @@ CIGARETTE PACKETS ARE IN FANCY.DM
|
||||
else
|
||||
..()
|
||||
|
||||
/obj/item/flame/lighter/throw_impact(mob/living/carbon/M as mob)
|
||||
/obj/item/flame/lighter/throw_impact(atom/hit_atom)
|
||||
. = ..()
|
||||
var/mob/living/carbon/M = hit_atom
|
||||
if(istype(M) && lit && M.IgniteMob())
|
||||
M.visible_message(SPAN_DANGER("\The [M] is ignited by \the [src]!"))
|
||||
|
||||
|
||||
@@ -309,7 +309,7 @@
|
||||
update_icon()
|
||||
src.shatter()
|
||||
|
||||
/obj/item/material/twohanded/spear/throw_impact(atom/target)
|
||||
/obj/item/material/twohanded/spear/throw_impact(atom/hit_atom)
|
||||
. = ..()
|
||||
if(!.) //not caught
|
||||
if(explosive)
|
||||
|
||||
@@ -6,6 +6,7 @@ var/list/tape_roll_applications = list()
|
||||
icon = 'icons/obj/policetape.dmi'
|
||||
icon_state = "tape"
|
||||
w_class = ITEMSIZE_SMALL
|
||||
pass_flags_self = PASSTABLE
|
||||
var/static/list/hazard_overlays
|
||||
var/turf/start
|
||||
var/turf/end
|
||||
|
||||
@@ -104,7 +104,7 @@
|
||||
return TRUE
|
||||
|
||||
/obj/structure/barricade/CheckExit(atom/movable/O as mob|obj, target as turf)
|
||||
if(istype(O) && O.checkpass(PASSTABLE))
|
||||
if(istype(O) && O.pass_flags & PASSTABLE)
|
||||
return TRUE
|
||||
if (get_dir(loc, target) == dir)
|
||||
return !density
|
||||
|
||||
@@ -11,6 +11,7 @@ GLOBAL_LIST_EMPTY(total_active_bonfires)
|
||||
density = FALSE
|
||||
light_color = LIGHT_COLOR_FIRE
|
||||
build_amt = 20
|
||||
pass_flags_self = PASSTABLE | LETPASSTHROW
|
||||
var/fuel = 2000
|
||||
var/max_fuel = 2000
|
||||
var/on_fire = FALSE
|
||||
@@ -344,6 +345,7 @@ GLOBAL_LIST_EMPTY(total_active_bonfires)
|
||||
safe = TRUE
|
||||
density = TRUE
|
||||
burn_out = FALSE
|
||||
pass_flags_self = PASSTABLE
|
||||
|
||||
/obj/structure/bonfire/fireplace/New(var/newloc, var/material_name)
|
||||
..()
|
||||
@@ -373,8 +375,6 @@ GLOBAL_LIST_EMPTY(total_active_bonfires)
|
||||
AddOverlays("fireplace_glow")
|
||||
|
||||
/obj/structure/bonfire/fireplace/CanPass(atom/movable/mover, turf/target, height=0, air_group=0)
|
||||
if(!istype(mover) || mover.checkpass(PASSTABLE))
|
||||
return TRUE
|
||||
if(get_dir(loc, target) == NORTH)
|
||||
return !density
|
||||
return TRUE
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
density = TRUE
|
||||
build_amt = 2
|
||||
slowdown = 5
|
||||
pass_flags_self = PASSTRACE
|
||||
|
||||
var/icon_door = null
|
||||
/// Override to have open overlay use icon different to its base's
|
||||
@@ -139,9 +140,7 @@
|
||||
|
||||
/obj/structure/closet/CanPass(atom/movable/mover, turf/target, height=0, air_group=0)
|
||||
if(air_group || (height==0 || wall_mounted)) return 1
|
||||
if(istype(mover) && mover.checkpass(PASSTRACE))
|
||||
return 1
|
||||
return (!density)
|
||||
return ..()
|
||||
|
||||
/obj/structure/closet/proc/can_open()
|
||||
if(welded || locked)
|
||||
|
||||
@@ -20,6 +20,8 @@
|
||||
door_anim_time = 3
|
||||
door_anim_angle = 140
|
||||
door_hinge = 3.5
|
||||
pass_flags_self = PASSSTRUCTURE | LETPASSTHROW
|
||||
|
||||
var/tablestatus = 0
|
||||
|
||||
var/azimuth_angle_2 = 180 //in this context the azimuth angle for over 90 degree
|
||||
@@ -96,7 +98,7 @@
|
||||
if (istype(mover,/obj/item/projectile))
|
||||
// Crates on a table always block shots, otherwise they only occasionally do so.
|
||||
return tablestatus == ABOVE_TABLE ? FALSE : (prob(15) ? FALSE : TRUE)
|
||||
else if(istype(mover) && mover.checkpass(PASSTABLE) && tablestatus == ABOVE_TABLE)
|
||||
else if((istype(mover) && (mover.pass_flags & PASSTABLE)) && tablestatus == ABOVE_TABLE)
|
||||
return TRUE
|
||||
return ..()
|
||||
|
||||
|
||||
@@ -50,7 +50,7 @@
|
||||
return TRUE
|
||||
if(istype(mover, /obj/structure/closet/crate))
|
||||
return TRUE
|
||||
if(istype(mover) && mover.checkpass(PASSTABLE))
|
||||
if(istype(mover) && mover.pass_flags & PASSTABLE)
|
||||
return TRUE
|
||||
if(locate(/obj/structure/window_frame) in get_turf(mover))
|
||||
return TRUE
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
layer = BELOW_OBJ_LAYER
|
||||
w_class = ITEMSIZE_HUGE
|
||||
obj_flags = OBJ_FLAG_MOVES_UNSUPPORTED
|
||||
pass_flags_self = PASSTABLE
|
||||
var/state = 0
|
||||
var/health = 200
|
||||
var/cover = 50 //how much cover the girder provides against projectiles.
|
||||
@@ -380,7 +381,4 @@
|
||||
return 1
|
||||
else
|
||||
return 0
|
||||
else if(mover.checkpass(PASSTABLE))
|
||||
//Animals can run under them, lots of empty space
|
||||
return 1
|
||||
return ..()
|
||||
|
||||
@@ -78,6 +78,6 @@
|
||||
/obj/structure/gore/CanPass(atom/movable/mover, turf/target, height=0, air_group=0)
|
||||
if(air_group)
|
||||
return FALSE
|
||||
if(istype(mover) && mover.checkpass(PASSGLASS))
|
||||
if(istype(mover) && mover.pass_flags & PASSGLASS)
|
||||
return !opacity
|
||||
return !density
|
||||
|
||||
@@ -102,7 +102,7 @@
|
||||
|
||||
/obj/structure/grille/CanPass(atom/movable/mover, turf/target, height=0, air_group=0)
|
||||
if(air_group || (height==0)) return 1
|
||||
if(istype(mover) && mover.checkpass(PASSGRILLE))
|
||||
if(istype(mover) && mover.pass_flags & PASSGRILLE)
|
||||
return 1
|
||||
else
|
||||
if(istype(mover, /obj/item/projectile))
|
||||
|
||||
@@ -422,7 +422,7 @@
|
||||
|
||||
/obj/structure/janitorialcart/CanPass(atom/movable/mover, turf/target, height=0, air_group=0)
|
||||
if(air_group || (height==0)) return 1
|
||||
if(istype(mover) && mover.checkpass(PASSTABLE))
|
||||
if(istype(mover) && mover.pass_flags & PASSTABLE)
|
||||
return 1
|
||||
if(istype(mover, /mob/living) && mover == pulling)
|
||||
return 1
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
desc = "A spike for collecting meat from animals."
|
||||
density = 1
|
||||
anchored = 1
|
||||
pass_flags_self = PASSTABLE
|
||||
var/meat = 0
|
||||
var/occupied
|
||||
var/meat_type
|
||||
@@ -72,7 +73,4 @@
|
||||
return 1
|
||||
else
|
||||
return 0
|
||||
else if(mover.checkpass(PASSTABLE))
|
||||
//Animals can run under them, lots of empty space
|
||||
return 1
|
||||
return ..()
|
||||
|
||||
@@ -57,7 +57,7 @@
|
||||
return FALSE
|
||||
|
||||
/obj/structure/plasticflaps/CanPass(atom/A, turf/T)
|
||||
if(istype(A) && A.checkpass(PASSGLASS))
|
||||
if(istype(A) && A.pass_flags & PASSGLASS)
|
||||
return prob(60)
|
||||
|
||||
var/obj/structure/bed/B = A
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
climbable = TRUE
|
||||
layer = OBJ_LAYER
|
||||
anchored = FALSE
|
||||
pass_flags_self = LETPASSTHROW|PASSSTRUCTURE
|
||||
|
||||
atom_flags = ATOM_FLAG_CHECKS_BORDER
|
||||
obj_flags = OBJ_FLAG_ROTATABLE|OBJ_FLAG_MOVES_UNSUPPORTED
|
||||
@@ -89,7 +90,7 @@
|
||||
/obj/structure/railing/CanPass(atom/movable/mover, turf/target, height=0, air_group=0)
|
||||
if(istype(mover,/obj/item/projectile))
|
||||
return TRUE
|
||||
if(!istype(mover) || mover.checkpass(PASSRAILING))
|
||||
if(!istype(mover) || mover.pass_flags & PASSRAILING)
|
||||
return TRUE
|
||||
if(mover.throwing)
|
||||
return TRUE
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
buckle_dir = SOUTH
|
||||
buckle_lying = 1
|
||||
build_amt = 2
|
||||
pass_flags_self = PASSTABLE
|
||||
var/material/padding_material
|
||||
|
||||
var/base_icon = "bed"
|
||||
@@ -127,10 +128,7 @@
|
||||
buckled.forceMove(dest)
|
||||
|
||||
/obj/structure/bed/CanPass(atom/movable/mover, turf/target, height=0, air_group=0)
|
||||
if(istype(mover) && mover.checkpass(PASSTABLE))
|
||||
return 1
|
||||
else
|
||||
return ..()
|
||||
return ..()
|
||||
|
||||
/obj/structure/bed/ex_act(severity)
|
||||
switch(severity)
|
||||
|
||||
@@ -265,7 +265,7 @@
|
||||
/obj/structure/rod_railing/CanPass(atom/movable/mover, turf/target, height=0, air_group=0)
|
||||
if(istype(mover,/obj/item/projectile))
|
||||
return TRUE
|
||||
if(!istype(mover) || mover.checkpass(PASSRAILING))
|
||||
if(!istype(mover) || mover.pass_flags & PASSRAILING)
|
||||
return TRUE
|
||||
if(mover.throwing)
|
||||
return TRUE
|
||||
@@ -317,7 +317,7 @@
|
||||
/obj/structure/road_barrier/CanPass(atom/movable/mover, turf/target, height=0, air_group=0)
|
||||
if(istype(mover,/obj/item/projectile))
|
||||
return TRUE
|
||||
if(!istype(mover) || mover.checkpass(PASSRAILING))
|
||||
if(!istype(mover) || mover.pass_flags & PASSRAILING)
|
||||
return TRUE
|
||||
if(mover.throwing)
|
||||
return TRUE
|
||||
@@ -356,7 +356,7 @@
|
||||
return prob(35)
|
||||
if(isliving(mover))
|
||||
return FALSE
|
||||
if(istype(mover) && mover.checkpass(PASSTABLE))
|
||||
if(istype(mover) && mover.pass_flags & PASSTABLE)
|
||||
return TRUE
|
||||
return FALSE
|
||||
|
||||
@@ -382,7 +382,7 @@
|
||||
/obj/structure/rope_railing/CanPass(atom/movable/mover, turf/target, height=0, air_group=0)
|
||||
if(istype(mover,/obj/item/projectile))
|
||||
return TRUE
|
||||
if(!istype(mover) || mover.checkpass(PASSRAILING))
|
||||
if(!istype(mover) || mover.pass_flags & PASSRAILING)
|
||||
return TRUE
|
||||
if(mover.throwing)
|
||||
return TRUE
|
||||
|
||||
@@ -49,7 +49,7 @@
|
||||
icon_state = "[facing]_[secure]windoor_assembly[state]"
|
||||
|
||||
/obj/structure/windoor_assembly/CanPass(atom/movable/mover, turf/target, height=0, air_group=0)
|
||||
if(istype(mover) && mover.checkpass(PASSGLASS))
|
||||
if(istype(mover) && mover.pass_flags & PASSGLASS)
|
||||
return 1
|
||||
if(get_dir(loc, target) == dir) //Make sure looking at appropriate border
|
||||
if(air_group) return 0
|
||||
@@ -58,7 +58,7 @@
|
||||
return 1
|
||||
|
||||
/obj/structure/windoor_assembly/CheckExit(atom/movable/mover as mob|obj, turf/target as turf)
|
||||
if(istype(mover) && mover.checkpass(PASSGLASS))
|
||||
if(istype(mover) && mover.pass_flags & PASSGLASS)
|
||||
return 1
|
||||
if(get_dir(loc, target) == dir)
|
||||
return !density
|
||||
|
||||
@@ -167,7 +167,7 @@
|
||||
return (dir == SOUTHWEST || dir == SOUTHEAST || dir == NORTHWEST || dir == NORTHEAST)
|
||||
|
||||
/obj/structure/window/CanPass(atom/movable/mover, turf/target, height=0, air_group=0)
|
||||
if(istype(mover) && mover.checkpass(PASSGLASS))
|
||||
if(istype(mover) && mover.pass_flags & PASSGLASS)
|
||||
return 1
|
||||
if(is_full_window())
|
||||
return !density //full tile window, you can't move into it if it's solid!
|
||||
@@ -177,7 +177,7 @@
|
||||
return 1
|
||||
|
||||
/obj/structure/window/CheckExit(atom/movable/O, turf/target)
|
||||
if(istype(O) && O.checkpass(PASSGLASS))
|
||||
if(istype(O) && O.pass_flags & PASSGLASS)
|
||||
return 1
|
||||
if(get_dir(O.loc, target) == dir)
|
||||
return 0
|
||||
|
||||
Reference in New Issue
Block a user