tg moved projectiles out of /item, added '/item' back
This commit is contained in:
@@ -135,8 +135,8 @@
|
||||
|
||||
/obj/effect/particle_effect/smoke/bad/Crossed(atom/movable/AM, oldloc)
|
||||
. = ..()
|
||||
if(istype(AM, /obj/projectile/beam))
|
||||
var/obj/projectile/beam/B = AM
|
||||
if(istype(AM, /obj/item/projectile/beam))
|
||||
var/obj/item/projectile/beam/B = AM
|
||||
B.damage = (B.damage/2)
|
||||
|
||||
/datum/effect_system/smoke_spread/bad
|
||||
|
||||
@@ -298,7 +298,7 @@
|
||||
|
||||
/obj/structure/girder/CanAllowThrough(atom/movable/mover, turf/target)
|
||||
. = ..()
|
||||
if((mover.pass_flags & PASSGRILLE) || istype(mover, /obj/projectile))
|
||||
if((mover.pass_flags & PASSGRILLE) || istype(mover, /obj/item/projectile))
|
||||
return prob(girderpasschance)
|
||||
|
||||
/obj/structure/girder/CanAStarPass(ID, dir, caller)
|
||||
|
||||
@@ -127,7 +127,7 @@
|
||||
|
||||
/obj/structure/grille/CanAllowThrough(atom/movable/mover, turf/target)
|
||||
. = ..()
|
||||
if(!. && istype(mover, /obj/projectile))
|
||||
if(!. && istype(mover, /obj/item/projectile))
|
||||
return prob(30)
|
||||
|
||||
/obj/structure/grille/CanAStarPass(ID, dir, caller)
|
||||
|
||||
@@ -490,7 +490,7 @@
|
||||
if(!QDELETED(target))
|
||||
handle_impact(target)
|
||||
|
||||
/obj/projectile/beam/beam_rifle/on_hit(atom/target, blocked = FALSE, piercing_hit = FALSE)
|
||||
/obj/item/projectile/beam/beam_rifle/on_hit(atom/target, blocked = FALSE, piercing_hit = FALSE)
|
||||
handle_hit(target, piercing_hit)
|
||||
. = ..()
|
||||
|
||||
@@ -522,9 +522,9 @@
|
||||
hitscan_light_intensity = 0
|
||||
hitscan_light_color_override = "#99ff99"
|
||||
|
||||
/obj/projectile/beam/beam_rifle/hitscan/aiming_beam/prehit_pierce(atom/target)
|
||||
/obj/item/projectile/beam/beam_rifle/hitscan/aiming_beam/prehit_pierce(atom/target)
|
||||
return PROJECTILE_DELETE_WITHOUT_HITTING
|
||||
|
||||
/obj/projectile/beam/beam_rifle/hitscan/aiming_beam/on_hit()
|
||||
/obj/item/projectile/beam/beam_rifle/hitscan/aiming_beam/on_hit()
|
||||
qdel(src)
|
||||
return BULLET_ACT_BLOCK
|
||||
|
||||
@@ -369,7 +369,7 @@
|
||||
* Furthermore, this proc shouldn't check can_hit_target - this should only be called if can hit target is already checked.
|
||||
* Also, we select_target to find what to process_hit first.
|
||||
*/
|
||||
/obj/projectile/proc/Impact(atom/A)
|
||||
/obj/item/projectile/proc/Impact(atom/A)
|
||||
if(!trajectory)
|
||||
qdel(src)
|
||||
return FALSE
|
||||
@@ -467,7 +467,7 @@
|
||||
* 4. Turf
|
||||
* 5. Nothing
|
||||
*/
|
||||
/obj/projectile/proc/select_target(turf/T, atom/target)
|
||||
/obj/item/projectile/proc/select_target(turf/T, atom/target)
|
||||
// 1. original
|
||||
if(can_hit_target(original, TRUE, FALSE))
|
||||
return original
|
||||
@@ -499,7 +499,7 @@
|
||||
|
||||
//Returns true if the target atom is on our current turf and above the right layer
|
||||
//If direct target is true it's the originally clicked target.
|
||||
/obj/projectile/proc/can_hit_target(atom/target, direct_target = FALSE, ignore_loc = FALSE)
|
||||
/obj/item/projectile/proc/can_hit_target(atom/target, direct_target = FALSE, ignore_loc = FALSE)
|
||||
if(QDELETED(target) || impacted[target])
|
||||
return FALSE
|
||||
if(!ignore_loc && (loc != target.loc))
|
||||
@@ -538,7 +538,7 @@
|
||||
* In impact there's more code for selecting WHAT to hit
|
||||
* So this proc is more of checking if we should hit something at all BY having an atom cross us.
|
||||
*/
|
||||
/obj/projectile/proc/scan_crossed_hit(atom/movable/A)
|
||||
/obj/item/projectile/proc/scan_crossed_hit(atom/movable/A)
|
||||
if(can_hit_target(A, direct_target = (A == original)))
|
||||
Impact(A)
|
||||
|
||||
@@ -547,7 +547,7 @@
|
||||
*
|
||||
* This proc is a little high in overhead but allows us to not snowflake CanPass in living and other things.
|
||||
*/
|
||||
/obj/projectile/proc/scan_moved_turf()
|
||||
/obj/item/projectile/proc/scan_moved_turf()
|
||||
// Optimally, we scan: mobs --> objs --> turf for impact
|
||||
// but, overhead is a thing and 2 for loops every time it moves is a no-go.
|
||||
// realistically, since we already do select_target in impact, we can not do that
|
||||
@@ -566,7 +566,7 @@
|
||||
/**
|
||||
* Projectile crossed: When something enters a projectile's tile, make sure the projectile hits it if it should be hitting it.
|
||||
*/
|
||||
/obj/projectile/Crossed(atom/movable/AM)
|
||||
/obj/item/projectile/Crossed(atom/movable/AM)
|
||||
. = ..()
|
||||
scan_crossed_hit(AM)
|
||||
|
||||
@@ -574,7 +574,7 @@
|
||||
* Projectile can pass through
|
||||
* Used to not even attempt to Bump() or fail to Cross() anything we already hit.
|
||||
*/
|
||||
/obj/projectile/CanPassThrough(atom/blocker, turf/target, blocker_opinion)
|
||||
/obj/item/projectile/CanPassThrough(atom/blocker, turf/target, blocker_opinion)
|
||||
return impacted[blocker]? TRUE : ..()
|
||||
|
||||
/**
|
||||
@@ -586,7 +586,7 @@
|
||||
* Scan turf we're now in for anything we can/should hit. This is useful for hitting non dense objects the user
|
||||
* directly clicks on, as well as for PHASING projectiles to be able to hit things at all as they don't ever Bump().
|
||||
*/
|
||||
/obj/projectile/Moved(atom/OldLoc, Dir)
|
||||
/obj/item/projectile/Moved(atom/OldLoc, Dir)
|
||||
. = ..()
|
||||
if(!fired)
|
||||
return
|
||||
@@ -601,7 +601,7 @@
|
||||
* NOT meant to be a pure proc, since this replaces prehit() which was used to do things.
|
||||
* Return PROJECTILE_DELETE_WITHOUT_HITTING to delete projectile without hitting at all!
|
||||
*/
|
||||
/obj/projectile/proc/prehit_pierce(atom/A)
|
||||
/obj/item/projectile/proc/prehit_pierce(atom/A)
|
||||
if(projectile_phasing & A.pass_flags_self)
|
||||
return PROJECTILE_PIERCE_PHASE
|
||||
if(projectile_piercing & A.pass_flags_self)
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
arm = starting.Beam(src, icon_state = "curse[handedness]", time = INFINITY, maxdistance = INFINITY, beam_type=/obj/effect/ebeam/curse_arm)
|
||||
..()
|
||||
|
||||
/obj/projectile/curse_hand/prehit_pierce(atom/target)
|
||||
/obj/item/projectile/curse_hand/prehit_pierce(atom/target)
|
||||
return (target == original)? PROJECTILE_PIERCE_NONE : PROJECTILE_PIERCE_PHASE
|
||||
|
||||
/obj/item/projectile/curse_hand/Destroy()
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/datum/unit_test/projectile_movetypes/Run()
|
||||
for(var/path in typesof(/obj/item/projectile))
|
||||
var/obj/projectile/projectile = path
|
||||
var/obj/item/projectile/projectile = path
|
||||
if(initial(projectile.movement_type) & PHASING)
|
||||
Fail("[path] has default movement type PHASING. Piercing projectiles should be done using the projectile piercing system, not movement_types!")
|
||||
|
||||
Reference in New Issue
Block a user