diff --git a/code/__DEFINES/combat.dm b/code/__DEFINES/combat.dm
index bf2646d03e..cc1b474c49 100644
--- a/code/__DEFINES/combat.dm
+++ b/code/__DEFINES/combat.dm
@@ -197,3 +197,9 @@ GLOBAL_LIST_INIT(shove_disarming_types, typecacheof(list(
#define TOTAL_MASS_HAND_REPLACEMENT 5 //standard punching stamina cost. most hand replacements are huge items anyway.
#define TOTAL_MASS_MEDIEVAL_WEAPON 3.6 //very, very generic average sword/warpick/etc. weight in pounds.
#define TOTAL_MASS_TOY_SWORD 1.5
+
+//bullet_act() return values
+#define BULLET_ACT_HIT "HIT" //It's a successful hit, whatever that means in the context of the thing it's hitting.
+#define BULLET_ACT_BLOCK "BLOCK" //It's a blocked hit, whatever that means in the context of the thing it's hitting.
+#define BULLET_ACT_FORCE_PIERCE "PIERCE" //It pierces through the object regardless of the bullet being piercing by default.
+#define BULLET_ACT_TURF "TURF" //It hit us but it should hit something on the same turf too. Usually used for turfs.
\ No newline at end of file
diff --git a/code/__DEFINES/flags.dm b/code/__DEFINES/flags.dm
index 839b690b37..a7d2670747 100644
--- a/code/__DEFINES/flags.dm
+++ b/code/__DEFINES/flags.dm
@@ -60,6 +60,7 @@ GLOBAL_LIST_INIT(bitflags, list(1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 204
#define FLYING (1<<1)
#define VENTCRAWLING (1<<2)
#define FLOATING (1<<3)
+#define UNSTOPPABLE (1<<4) //When moving, will Bump()/Cross()/Uncross() everything, but won't be stopped.
//Fire and Acid stuff, for resistance_flags
#define LAVA_PROOF (1<<0)
diff --git a/code/_globalvars/bitfields.dm b/code/_globalvars/bitfields.dm
index 5d95a4eaae..c98faaa4fb 100644
--- a/code/_globalvars/bitfields.dm
+++ b/code/_globalvars/bitfields.dm
@@ -101,7 +101,10 @@ GLOBAL_LIST_INIT(bitfields, list(
),
"movement_type" = list(
"GROUND" = GROUND,
- "FLYING" = FLYING
+ "FLYING" = FLYING,
+ "VENTCRAWLING" = VENTCRAWLING,
+ "FLOATING" = FLOATING,
+ "UNSTOPPABLE" = UNSTOPPABLE
),
"resistance_flags" = list(
"LAVA_PROOF" = LAVA_PROOF,
diff --git a/code/game/machinery/turnstile.dm b/code/game/machinery/turnstile.dm
index 1fd78056d4..9bc5193bbb 100644
--- a/code/game/machinery/turnstile.dm
+++ b/code/game/machinery/turnstile.dm
@@ -19,7 +19,7 @@
return TRUE
/obj/machinery/turnstile/bullet_act(obj/item/projectile/P, def_zone)
- return -1 //Pass through!
+ return BULLET_ACT_FORCE_PIERCE //Pass through!
/obj/machinery/turnstile/proc/allowed_access(var/mob/B)
if(B.pulledby && ismob(B.pulledby))
diff --git a/code/game/objects/items/cardboard_cutouts.dm b/code/game/objects/items/cardboard_cutouts.dm
index f3ed99b132..2daf6f0c0b 100644
--- a/code/game/objects/items/cardboard_cutouts.dm
+++ b/code/game/objects/items/cardboard_cutouts.dm
@@ -74,6 +74,7 @@
playsound(src, 'sound/weapons/slice.ogg', 50, 1)
if(prob(P.damage))
push_over()
+ return BULLET_ACT_HIT
/obj/item/cardboard_cutout/proc/change_appearance(obj/item/toy/crayon/crayon, mob/living/user)
if(!crayon || !user)
diff --git a/code/game/objects/items/chrono_eraser.dm b/code/game/objects/items/chrono_eraser.dm
index 911a07c288..2dcb495701 100644
--- a/code/game/objects/items/chrono_eraser.dm
+++ b/code/game/objects/items/chrono_eraser.dm
@@ -242,7 +242,7 @@
if(Pgun && istype(Pgun))
Pgun.field_connect(src)
else
- return 0
+ return BULLET_ACT_HIT
/obj/effect/chrono_field/assume_air()
return 0
diff --git a/code/game/objects/items/devices/chameleonproj.dm b/code/game/objects/items/devices/chameleonproj.dm
index dffbb46cbb..c4ffa9f0ff 100644
--- a/code/game/objects/items/devices/chameleonproj.dm
+++ b/code/game/objects/items/devices/chameleonproj.dm
@@ -146,7 +146,7 @@
master.disrupt()
/obj/effect/dummy/chameleon/bullet_act()
- ..()
+ . = ..()
master.disrupt()
/obj/effect/dummy/chameleon/relaymove(mob/user, direction)
diff --git a/code/game/objects/items/latexballoon.dm b/code/game/objects/items/latexballoon.dm
index 11be6b88e9..ef5b7b6cba 100644
--- a/code/game/objects/items/latexballoon.dm
+++ b/code/game/objects/items/latexballoon.dm
@@ -40,8 +40,10 @@
if (prob(50))
qdel(src)
-/obj/item/latexballon/bullet_act()
- burst()
+/obj/item/latexballon/bullet_act(obj/item/projectile/P)
+ if(!P.nodamage)
+ burst()
+ return ..()
/obj/item/latexballon/temperature_expose(datum/gas_mixture/air, temperature, volume)
if(temperature > T0C+100)
diff --git a/code/game/objects/items/melee/misc.dm b/code/game/objects/items/melee/misc.dm
index 4242fb6c4b..fde14a85d9 100644
--- a/code/game/objects/items/melee/misc.dm
+++ b/code/game/objects/items/melee/misc.dm
@@ -358,7 +358,8 @@
/obj/item/melee/supermatter_sword/bullet_act(obj/item/projectile/P)
visible_message("[P] smacks into [src] and rapidly flashes to ash.",\
"You hear a loud crack as you are washed with a wave of heat.")
- consume_everything()
+ consume_everything(P)
+ return BULLET_ACT_HIT
/obj/item/melee/supermatter_sword/suicide_act(mob/user)
user.visible_message("[user] touches [src]'s blade. It looks like [user.p_theyre()] tired of waiting for the radiation to kill [user.p_them()]!")
diff --git a/code/game/objects/items/shooting_range.dm b/code/game/objects/items/shooting_range.dm
index 256e84973d..2f40604719 100644
--- a/code/game/objects/items/shooting_range.dm
+++ b/code/game/objects/items/shooting_range.dm
@@ -60,7 +60,7 @@
#define DECALTYPE_BULLET 2
/obj/item/target/clown/bullet_act(obj/item/projectile/P)
- ..()
+ . = ..()
playsound(src.loc, 'sound/items/bikehorn.ogg', 50, 1)
/obj/item/target/bullet_act(obj/item/projectile/P)
@@ -89,8 +89,8 @@
else
bullet_hole.icon_state = "dent"
add_overlay(bullet_hole)
- return
- return -1
+ return BULLET_ACT_HIT
+ return BULLET_ACT_FORCE_PIERCE
#undef DECALTYPE_SCORCH
#undef DECALTYPE_BULLET
diff --git a/code/game/objects/structures/holosign.dm b/code/game/objects/structures/holosign.dm
index 69ad9f1567..617f42ed29 100644
--- a/code/game/objects/structures/holosign.dm
+++ b/code/game/objects/structures/holosign.dm
@@ -106,6 +106,7 @@
take_damage(10, BRUTE, "melee", 1) //Tasers aren't harmful.
if(istype(P, /obj/item/projectile/beam/disabler))
take_damage(5, BRUTE, "melee", 1) //Disablers aren't harmful.
+ return BULLET_ACT_HIT
/obj/structure/holosign/barrier/medical
name = "\improper PENLITE holobarrier"
@@ -152,6 +153,7 @@
/obj/structure/holosign/barrier/cyborg/hacked/bullet_act(obj/item/projectile/P)
take_damage(P.damage, BRUTE, "melee", 1) //Yeah no this doesn't get projectile resistance.
+ return BULLET_ACT_HIT
/obj/structure/holosign/barrier/cyborg/hacked/proc/cooldown()
shockcd = FALSE
diff --git a/code/game/objects/structures/reflector.dm b/code/game/objects/structures/reflector.dm
index cde60e15c1..5cc2315352 100644
--- a/code/game/objects/structures/reflector.dm
+++ b/code/game/objects/structures/reflector.dm
@@ -64,15 +64,15 @@
var/ploc = get_turf(P)
if(!finished || !allowed_projectile_typecache[P.type] || !(P.dir in GLOB.cardinals))
return ..()
- if(auto_reflect(P, pdir, ploc, pangle) != -1)
+ if(auto_reflect(P, pdir, ploc, pangle) != BULLET_ACT_FORCE_PIERCE)
return ..()
- return -1
+ return BULLET_ACT_FORCE_PIERCE
/obj/structure/reflector/proc/auto_reflect(obj/item/projectile/P, pdir, turf/ploc, pangle)
P.ignore_source_check = TRUE
P.range = P.decayedRange
P.decayedRange = max(P.decayedRange--, 0)
- return -1
+ return BULLET_ACT_FORCE_PIERCE
/obj/structure/reflector/attackby(obj/item/W, mob/user, params)
if(admin)
diff --git a/code/game/objects/structures/statues.dm b/code/game/objects/structures/statues.dm
index 5e6b35ba4f..9a6b24b472 100644
--- a/code/game/objects/structures/statues.dm
+++ b/code/game/objects/structures/statues.dm
@@ -124,7 +124,7 @@
message_admins("Plasma statue ignited by [Proj]. No known firer, in [ADMIN_VERBOSEJMP(T)]")
log_game("Plasma statue ignited by [Proj] in [AREACOORD(T)]. No known firer.")
PlasmaBurn(2500)
- ..()
+ return ..()
/obj/structure/statue/plasma/attackby(obj/item/W, mob/user, params)
if(W.get_temperature() > 300 && !QDELETED(src))//If the temperature of the object is over 300, then ignite
diff --git a/code/game/objects/structures/target_stake.dm b/code/game/objects/structures/target_stake.dm
index b69b98ceaa..9dcfec43bf 100644
--- a/code/game/objects/structures/target_stake.dm
+++ b/code/game/objects/structures/target_stake.dm
@@ -71,6 +71,5 @@
/obj/structure/target_stake/bullet_act(obj/item/projectile/P)
if(pinned_target)
- pinned_target.bullet_act(P)
- else
- ..()
+ return pinned_target.bullet_act(P)
+ return ..()
diff --git a/code/game/turfs/simulated/wall/mineral_walls.dm b/code/game/turfs/simulated/wall/mineral_walls.dm
index 9962f72d4a..be46d124ea 100644
--- a/code/game/turfs/simulated/wall/mineral_walls.dm
+++ b/code/game/turfs/simulated/wall/mineral_walls.dm
@@ -120,7 +120,7 @@
PlasmaBurn(2500)
else if(istype(Proj, /obj/item/projectile/ion))
PlasmaBurn(500)
- ..()
+ return ..()
/turf/closed/wall/mineral/wood
diff --git a/code/game/turfs/turf.dm b/code/game/turfs/turf.dm
index e81b3d1062..d8434f986c 100755
--- a/code/game/turfs/turf.dm
+++ b/code/game/turfs/turf.dm
@@ -224,14 +224,20 @@
for(var/i in contents)
if(i == mover || i == mover.loc) // Multi tile objects and moving out of other objects
continue
+ if(QDELETED(mover))
+ break
var/atom/movable/thing = i
- if(thing.Cross(mover))
- continue
- if(!firstbump || ((thing.layer > firstbump.layer || thing.flags_1 & ON_BORDER_1) && !(firstbump.flags_1 & ON_BORDER_1)))
- firstbump = thing
+ if(!thing.Cross(mover))
+ if(CHECK_BITFIELD(mover.movement_type, UNSTOPPABLE))
+ mover.Bump(thing)
+ continue
+ else
+ if(!firstbump || ((thing.layer > firstbump.layer || thing.flags_1 & ON_BORDER_1) && !(firstbump.flags_1 & ON_BORDER_1)))
+ firstbump = thing
if(firstbump)
- mover.Bump(firstbump)
- return FALSE
+ if(!QDELETED(mover))
+ mover.Bump(firstbump)
+ return CHECK_BITFIELD(mover.movement_type, UNSTOPPABLE)
return TRUE
/turf/Exit(atom/movable/mover, atom/newloc)
@@ -239,13 +245,16 @@
if(!.)
return FALSE
for(var/i in contents)
+ if(QDELETED(mover))
+ break
if(i == mover)
continue
var/atom/movable/thing = i
if(!thing.Uncross(mover, newloc))
if(thing.flags_1 & ON_BORDER_1)
mover.Bump(thing)
- return FALSE
+ if(!CHECK_BITFIELD(mover.movement_type, UNSTOPPABLE))
+ return FALSE
/turf/Entered(atom/movable/AM)
..()
@@ -563,3 +572,8 @@
//Should return new turf
/turf/proc/Melt()
return ScrapeAway(flags = CHANGETURF_INHERIT_AIR)
+
+/turf/bullet_act(obj/item/projectile/P)
+ . = ..()
+ if(. != BULLET_ACT_FORCE_PIERCE)
+ . = BULLET_ACT_TURF
diff --git a/code/modules/antagonists/changeling/powers/mutations.dm b/code/modules/antagonists/changeling/powers/mutations.dm
index b2ab5caef8..49c34f4d1f 100644
--- a/code/modules/antagonists/changeling/powers/mutations.dm
+++ b/code/modules/antagonists/changeling/powers/mutations.dm
@@ -345,13 +345,13 @@
/obj/item/projectile/tentacle/on_hit(atom/target, blocked = FALSE)
var/mob/living/carbon/human/H = firer
if(blocked >= 100)
- return 0
+ return BULLET_ACT_BLOCK
if(isitem(target))
var/obj/item/I = target
if(!I.anchored)
to_chat(firer, "You pull [I] right into your grasp.")
H.put_in_hands(I) //Because throwing it is goofy as fuck and unreliable. If you land the tentacle despite the penalties to accuracy, you should have your reward.
- . = 1
+ . = BULLET_ACT_HIT
else if(isliving(target))
var/mob/living/L = target
@@ -366,7 +366,7 @@
if(INTENT_HELP)
C.visible_message("[L] is pulled by [H]'s tentacle!","A tentacle grabs you and pulls you towards [H]!")
C.throw_at(get_step_towards(H,C), 8, 2)
- return 1
+ return BULLET_ACT_HIT
if(INTENT_DISARM)
var/obj/item/I = C.get_active_held_item()
@@ -374,27 +374,27 @@
if(C.dropItemToGround(I))
C.visible_message("[I] is yanked off [C]'s hand by [src]!","A tentacle pulls [I] away from you!")
on_hit(I) //grab the item as if you had hit it directly with the tentacle
- return 1
+ return BULLET_ACT_HIT
else
to_chat(firer, "You can't seem to pry [I] off [C]'s hands!")
- return 0
+ return BULLET_ACT_BLOCK
else
to_chat(firer, "[C] has nothing in hand to disarm!")
- return 0
+ return BULLET_ACT_HIT
if(INTENT_GRAB)
C.visible_message("[L] is grabbed by [H]'s tentacle!","A tentacle grabs you and pulls you towards [H]!")
C.throw_at(get_step_towards(H,C), 8, 2, H, TRUE, TRUE, callback=CALLBACK(src, .proc/tentacle_grab, H, C))
- return 1
+ return BULLET_ACT_HIT
if(INTENT_HARM)
C.visible_message("[L] is thrown towards [H] by a tentacle!","A tentacle grabs you and throws you towards [H]!")
C.throw_at(get_step_towards(H,C), 8, 2, H, TRUE, TRUE, callback=CALLBACK(src, .proc/tentacle_stab, H, C))
- return 1
+ return BULLET_ACT_HIT
else
L.visible_message("[L] is pulled by [H]'s tentacle!","A tentacle grabs you and pulls you towards [H]!")
L.throw_at(get_step_towards(H,L), 8, 2)
- . = 1
+ . = BULLET_ACT_HIT
/obj/item/projectile/tentacle/Destroy()
qdel(chain)
diff --git a/code/modules/antagonists/clockcult/clock_helpers/slab_abilities.dm b/code/modules/antagonists/clockcult/clock_helpers/slab_abilities.dm
index 9f2ddfda47..ee1a1233d2 100644
--- a/code/modules/antagonists/clockcult/clock_helpers/slab_abilities.dm
+++ b/code/modules/antagonists/clockcult/clock_helpers/slab_abilities.dm
@@ -182,7 +182,7 @@
if(isliving(target))
var/mob/living/L = target
if(is_servant_of_ratvar(L) || L.stat || L.has_status_effect(STATUS_EFFECT_KINDLE))
- return
+ return BULLET_ACT_HIT
var/atom/O = L.anti_magic_check()
playsound(L, 'sound/magic/fireball.ogg', 50, TRUE, frequency = 1.25)
if(O)
diff --git a/code/modules/antagonists/clockcult/clock_mobs/clockwork_marauder.dm b/code/modules/antagonists/clockcult/clock_mobs/clockwork_marauder.dm
index 311f552467..6591343116 100644
--- a/code/modules/antagonists/clockcult/clock_mobs/clockwork_marauder.dm
+++ b/code/modules/antagonists/clockcult/clock_mobs/clockwork_marauder.dm
@@ -97,7 +97,7 @@
/mob/living/simple_animal/hostile/clockwork/marauder/bullet_act(obj/item/projectile/P)
if(deflect_projectile(P))
- return
+ return BULLET_ACT_BLOCK
return ..()
/mob/living/simple_animal/hostile/clockwork/marauder/proc/deflect_projectile(obj/item/projectile/P)
diff --git a/code/modules/antagonists/clockcult/clock_structures/reflector.dm b/code/modules/antagonists/clockcult/clock_structures/reflector.dm
index 34ad051d19..364409d39e 100644
--- a/code/modules/antagonists/clockcult/clock_structures/reflector.dm
+++ b/code/modules/antagonists/clockcult/clock_structures/reflector.dm
@@ -31,7 +31,7 @@
if(auto_reflect(P, P.dir, get_turf(P), P.Angle) != -1)
return ..()
- return -1
+ return BULLET_ACT_FORCE_PIERCE
/obj/structure/destructible/clockwork/reflector/proc/auto_reflect(obj/item/projectile/P, pdir, turf/ploc, pangle)
diff --git a/code/modules/hydroponics/hydroponics.dm b/code/modules/hydroponics/hydroponics.dm
index 5bc3fb0b60..2d0d2c5282 100644
--- a/code/modules/hydroponics/hydroponics.dm
+++ b/code/modules/hydroponics/hydroponics.dm
@@ -90,6 +90,7 @@
return ..()
if(istype(Proj , /obj/item/projectile/energy/floramut))
mutate()
+ return BULLET_ACT_HIT
else if(istype(Proj , /obj/item/projectile/energy/florayield))
return myseed.bullet_act(Proj)
else
diff --git a/code/modules/hydroponics/seeds.dm b/code/modules/hydroponics/seeds.dm
index 9a0085eb3d..c28ae3b4c5 100644
--- a/code/modules/hydroponics/seeds.dm
+++ b/code/modules/hydroponics/seeds.dm
@@ -145,6 +145,7 @@ obj/item/seeds/proc/is_gene_forbidden(typepath)
adjust_yield(1 * rating)
else if(prob(1/(yield * yield) * 100))//This formula gives you diminishing returns based on yield. 100% with 1 yield, decreasing to 25%, 11%, 6, 4, 2...
adjust_yield(1 * rating)
+ return BULLET_ACT_HIT
else
return ..()
diff --git a/code/modules/mining/ores_coins.dm b/code/modules/mining/ores_coins.dm
index 29a835ddde..1c83c70d95 100644
--- a/code/modules/mining/ores_coins.dm
+++ b/code/modules/mining/ores_coins.dm
@@ -250,7 +250,7 @@ GLOBAL_LIST_INIT(sand_recipes, list(\
/obj/item/twohanded/required/gibtonite/bullet_act(obj/item/projectile/P)
GibtoniteReaction(P.firer)
- ..()
+ return ..()
/obj/item/twohanded/required/gibtonite/ex_act()
GibtoniteReaction(null, 1)
diff --git a/code/modules/mob/living/bloodcrawl.dm b/code/modules/mob/living/bloodcrawl.dm
index 4ed539adc2..e8a9b50e98 100644
--- a/code/modules/mob/living/bloodcrawl.dm
+++ b/code/modules/mob/living/bloodcrawl.dm
@@ -14,7 +14,7 @@
/obj/effect/dummy/phased_mob/slaughter/ex_act()
return
/obj/effect/dummy/phased_mob/slaughter/bullet_act()
- return
+ return BULLET_ACT_FORCE_PIERCE
/obj/effect/dummy/phased_mob/slaughter/singularity_act()
return
diff --git a/code/modules/mob/living/carbon/human/human_defense.dm b/code/modules/mob/living/carbon/human/human_defense.dm
index c5d3ec18f9..2fc4cd8805 100644
--- a/code/modules/mob/living/carbon/human/human_defense.dm
+++ b/code/modules/mob/living/carbon/human/human_defense.dm
@@ -51,7 +51,7 @@
if(prob(mind.martial_art.dodge_chance))
var/dodgemessage = pick("dodges under the projectile!","dodges to the right of the projectile!","jumps over the projectile!")
visible_message("[src] [dodgemessage]", "You dodge the projectile!")
- return -1
+ return BULLET_ACT_BLOCK
if(mind.martial_art && !incapacitated(FALSE, TRUE) && mind.martial_art.can_use(src) && mind.martial_art.deflection_chance) //Some martial arts users can deflect projectiles!
if(prob(mind.martial_art.deflection_chance))
if(!lying && dna && !dna.check_mutation(HULK)) //But only if they're not lying down, and hulks can't do it
@@ -60,12 +60,10 @@
else
visible_message("[src] deflects the projectile!", "You deflect the projectile!")
playsound(src, pick('sound/weapons/bulletflyby.ogg', 'sound/weapons/bulletflyby2.ogg', 'sound/weapons/bulletflyby3.ogg'), 75, 1)
- if(!mind.martial_art.reroute_deflection)
- return FALSE
- else
+ if(mind.martial_art.reroute_deflection)
P.firer = src
P.setAngle(rand(0, 360))//SHING
- return FALSE
+ return BULLET_ACT_FORCE_PIERCE
return ..()
diff --git a/code/modules/mob/living/carbon/human/species.dm b/code/modules/mob/living/carbon/human/species.dm
index 7fc1d2a4b3..3357cc9ffe 100644
--- a/code/modules/mob/living/carbon/human/species.dm
+++ b/code/modules/mob/living/carbon/human/species.dm
@@ -1998,7 +1998,7 @@ GLOBAL_LIST_EMPTY(roundstart_race_names)
/datum/species/proc/bullet_act(obj/item/projectile/P, mob/living/carbon/human/H)
// called before a projectile hit
- return 0
+ return
/////////////
//BREATHING//
diff --git a/code/modules/mob/living/carbon/human/species_types/golems.dm b/code/modules/mob/living/carbon/human/species_types/golems.dm
index 3dad8449df..98c3f269dc 100644
--- a/code/modules/mob/living/carbon/human/species_types/golems.dm
+++ b/code/modules/mob/living/carbon/human/species_types/golems.dm
@@ -360,8 +360,8 @@
playsound(H, 'sound/effects/shovel_dig.ogg', 70, 1)
H.visible_message("The [P.name] sinks harmlessly in [H]'s sandy body!", \
"The [P.name] sinks harmlessly in [H]'s sandy body!")
- return 2
- return 0
+ return BULLET_ACT_BLOCK
+ return ..()
//Reflects lasers and resistant to burn damage, but very vulnerable to brute damage. Shatters on death.
/datum/species/golem/glass
@@ -397,8 +397,8 @@
var/turf/target = get_turf(P.starting)
// redirect the projectile
P.preparePixelProjectile(locate(CLAMP(target.x + new_x, 1, world.maxx), CLAMP(target.y + new_y, 1, world.maxy), H.z), H)
- return -1
- return 0
+ return BULLET_ACT_FORCE_PIERCE
+ return ..()
//Teleports when hit or when it wants to
/datum/species/golem/bluespace
diff --git a/code/modules/mob/living/carbon/human/species_types/shadowpeople.dm b/code/modules/mob/living/carbon/human/species_types/shadowpeople.dm
index fa2fd1c858..a0291631dc 100644
--- a/code/modules/mob/living/carbon/human/species_types/shadowpeople.dm
+++ b/code/modules/mob/living/carbon/human/species_types/shadowpeople.dm
@@ -60,8 +60,8 @@
if(light_amount < SHADOW_SPECIES_LIGHT_THRESHOLD)
H.visible_message("[H] dances in the shadows, evading [P]!")
playsound(T, "bullet_miss", 75, 1)
- return -1
- return 0
+ return BULLET_ACT_FORCE_PIERCE
+ return ..()
/datum/species/shadow/nightmare/check_roundstart_eligible()
return FALSE
diff --git a/code/modules/mob/living/carbon/monkey/combat.dm b/code/modules/mob/living/carbon/monkey/combat.dm
index 56ef4fe24a..6eb4868202 100644
--- a/code/modules/mob/living/carbon/monkey/combat.dm
+++ b/code/modules/mob/living/carbon/monkey/combat.dm
@@ -403,7 +403,7 @@
if((Proj.damage_type == BURN) || (Proj.damage_type == BRUTE))
if(!Proj.nodamage && Proj.damage < src.health && isliving(Proj.firer))
retaliate(Proj.firer)
- ..()
+ return ..()
/mob/living/carbon/monkey/hitby(atom/movable/AM, skipcatch = FALSE, hitpush = TRUE, blocked = FALSE)
if(istype(AM, /obj/item))
diff --git a/code/modules/mob/living/damage_procs.dm b/code/modules/mob/living/damage_procs.dm
index 45d9c80a35..abcb0589ae 100644
--- a/code/modules/mob/living/damage_procs.dm
+++ b/code/modules/mob/living/damage_procs.dm
@@ -110,7 +110,7 @@
/mob/living/proc/apply_effects(stun = 0, knockdown = 0, unconscious = 0, irradiate = 0, slur = 0, stutter = 0, eyeblur = 0, drowsy = 0, blocked = FALSE, stamina = 0, jitter = 0, kd_stamoverride, kd_stammax)
if(blocked >= 100)
- return 0
+ return BULLET_ACT_BLOCK
if(stun)
apply_effect(stun, EFFECT_STUN, blocked)
if(knockdown)
@@ -131,7 +131,7 @@
apply_damage(stamina, STAMINA, null, blocked)
if(jitter)
apply_effect(jitter, EFFECT_JITTER, blocked)
- return 1
+ return BULLET_ACT_HIT
/mob/living/proc/getBruteLoss()
diff --git a/code/modules/mob/living/living_defense.dm b/code/modules/mob/living/living_defense.dm
index 4c67922c18..fbb483fadb 100644
--- a/code/modules/mob/living/living_defense.dm
+++ b/code/modules/mob/living/living_defense.dm
@@ -34,7 +34,7 @@
return FALSE
/mob/living/proc/on_hit(obj/item/projectile/P)
- return
+ return BULLET_ACT_HIT
/mob/living/proc/check_shields(atom/AM, damage, attack_text = "the attack", attack_type = MELEE_ATTACK, armour_penetration = 0)
var/block_chance_modifier = round(damage / -3)
@@ -76,16 +76,16 @@
/mob/living/bullet_act(obj/item/projectile/P, def_zone)
if(P.original != src || P.firer != src) //try to block or reflect the bullet, can't do so when shooting oneself
if(reflect_bullet_check(P, def_zone))
- return -1 // complete projectile permutation
+ return BULLET_ACT_FORCE_PIERCE // complete projectile permutation
if(check_shields(P, P.damage, "the [P.name]", PROJECTILE_ATTACK, P.armour_penetration))
P.on_hit(src, 100, def_zone)
- return 2
+ return BULLET_ACT_BLOCK
var/armor = run_armor_check(def_zone, P.flag, null, null, P.armour_penetration, null)
if(!P.nodamage)
apply_damage(P.damage, P.damage_type, def_zone, armor)
if(P.dismemberment)
check_projectile_dismemberment(P, def_zone)
- return P.on_hit(src, armor)
+ return P.on_hit(src, armor) ? BULLET_ACT_HIT : BULLET_ACT_BLOCK
/mob/living/proc/check_projectile_dismemberment(obj/item/projectile/P, def_zone)
return 0
diff --git a/code/modules/mob/living/living_movement.dm b/code/modules/mob/living/living_movement.dm
index 93bb9d1f8d..e0ea6350d7 100644
--- a/code/modules/mob/living/living_movement.dm
+++ b/code/modules/mob/living/living_movement.dm
@@ -2,6 +2,21 @@
. = ..()
update_turf_movespeed(loc)
+/mob/living/CanPass(atom/movable/mover, turf/target)
+ if((mover.pass_flags & PASSMOB))
+ return TRUE
+ if(istype(mover, /obj/item/projectile))
+ var/obj/item/projectile/P = mover
+ return !P.can_hit_target(src, P.permutated, src == P.original, TRUE)
+ if(mover.throwing)
+ return (!density || lying)
+ if(buckled == mover)
+ return TRUE
+ if(ismob(mover))
+ if (mover in buckled_mobs)
+ return TRUE
+ return (!mover.density || !density || lying || (mover.throwing && mover.throwing.thrower == src && !ismob(mover)))
+
/mob/living/toggle_move_intent()
. = ..()
update_move_intent_slowdown()
diff --git a/code/modules/mob/living/silicon/ai/ai_defense.dm b/code/modules/mob/living/silicon/ai/ai_defense.dm
index 97d26f672a..2bcb3c9b5a 100644
--- a/code/modules/mob/living/silicon/ai/ai_defense.dm
+++ b/code/modules/mob/living/silicon/ai/ai_defense.dm
@@ -42,9 +42,8 @@
/mob/living/silicon/ai/bullet_act(obj/item/projectile/Proj)
- ..(Proj)
+ . = ..()
updatehealth()
- return 2
/mob/living/silicon/ai/flash_act(intensity = 1, override_blindness_check = 0, affect_silicon = 0)
return // no eyes, no flashing
diff --git a/code/modules/mob/living/silicon/pai/pai_defense.dm b/code/modules/mob/living/silicon/pai/pai_defense.dm
index c727e100d8..05b2bc77ba 100644
--- a/code/modules/mob/living/silicon/pai/pai_defense.dm
+++ b/code/modules/mob/living/silicon/pai/pai_defense.dm
@@ -55,7 +55,7 @@
if(P.stun)
fold_in(force = TRUE)
visible_message("The electrically-charged projectile disrupts [src]'s holomatrix, forcing [src] to fold in!")
- . = ..()
+ return ..()
/mob/living/silicon/pai/stripPanelUnequip(obj/item/what, mob/who, where) //prevents stripping
to_chat(src, "Your holochassis stutters and warps intensely as you attempt to interact with the object, forcing you to cease lest the field fail.")
diff --git a/code/modules/mob/living/silicon/robot/robot_defense.dm b/code/modules/mob/living/silicon/robot/robot_defense.dm
index 7e06c66eff..e7b252a248 100644
--- a/code/modules/mob/living/silicon/robot/robot_defense.dm
+++ b/code/modules/mob/living/silicon/robot/robot_defense.dm
@@ -184,8 +184,7 @@
adjustBruteLoss(30)
/mob/living/silicon/robot/bullet_act(obj/item/projectile/P, def_zone)
- ..()
+ . = ..()
updatehealth()
if(prob(75) && P.damage > 0)
spark_system.start()
- return 2
diff --git a/code/modules/mob/living/silicon/silicon_defense.dm b/code/modules/mob/living/silicon/silicon_defense.dm
index ca8ad25713..4cd8dd47e4 100644
--- a/code/modules/mob/living/silicon/silicon_defense.dm
+++ b/code/modules/mob/living/silicon/silicon_defense.dm
@@ -129,7 +129,7 @@
unbuckle_mob(M)
M.visible_message("[M] is knocked off of [src] by the [P]!")
P.on_hit(src)
- return 2
+ return BULLET_ACT_HIT
/mob/living/silicon/flash_act(intensity = 1, override_blindness_check = 0, affect_silicon = 0, visual = 0, type = /obj/screen/fullscreen/flash/static)
if(affect_silicon)
diff --git a/code/modules/mob/living/simple_animal/animal_defense.dm b/code/modules/mob/living/simple_animal/animal_defense.dm
index ad8dfc4900..f4feab8824 100644
--- a/code/modules/mob/living/simple_animal/animal_defense.dm
+++ b/code/modules/mob/living/simple_animal/animal_defense.dm
@@ -114,7 +114,7 @@
return
apply_damage(Proj.damage, Proj.damage_type)
Proj.on_hit(src)
- return 0
+ return BULLET_ACT_HIT
/mob/living/simple_animal/ex_act(severity, target, origin)
if(origin && istype(origin, /datum/spacevine_mutation) && isvineimmune(src))
diff --git a/code/modules/mob/living/simple_animal/bot/SuperBeepsky.dm b/code/modules/mob/living/simple_animal/bot/SuperBeepsky.dm
index 03afecc66f..a5d36b5ba9 100644
--- a/code/modules/mob/living/simple_animal/bot/SuperBeepsky.dm
+++ b/code/modules/mob/living/simple_animal/bot/SuperBeepsky.dm
@@ -21,7 +21,7 @@
/mob/living/simple_animal/bot/secbot/grievous/bullet_act(obj/item/projectile/P)
visible_message("[src] deflects [P] with its energy swords!")
playsound(src, 'sound/weapons/blade1.ogg', 50, TRUE)
- return FALSE
+ return BULLET_ACT_BLOCK
/mob/living/simple_animal/bot/secbot/grievous/Crossed(atom/movable/AM)
..()
diff --git a/code/modules/mob/living/simple_animal/bot/ed209bot.dm b/code/modules/mob/living/simple_animal/bot/ed209bot.dm
index 4715a1361a..4e479dc75b 100644
--- a/code/modules/mob/living/simple_animal/bot/ed209bot.dm
+++ b/code/modules/mob/living/simple_animal/bot/ed209bot.dm
@@ -210,7 +210,7 @@ Auto Patrol[]"},
if((Proj.damage_type == BURN) || (Proj.damage_type == BRUTE))
if(!Proj.nodamage && Proj.damage < src.health && ishuman(Proj.firer))
retaliate(Proj.firer)
- ..()
+ return ..()
/mob/living/simple_animal/bot/ed209/handle_automated_action()
if(!..())
@@ -510,11 +510,9 @@ Auto Patrol[]"},
spawn(100)
disabled = 0
icon_state = "[lasercolor]ed2091"
- return 1
- else
- ..(Proj)
- else
- ..(Proj)
+ return BULLET_ACT_HIT
+ return ..()
+ return ..()
/mob/living/simple_animal/bot/ed209/bluetag
lasercolor = "b"
diff --git a/code/modules/mob/living/simple_animal/bot/honkbot.dm b/code/modules/mob/living/simple_animal/bot/honkbot.dm
index 109c7b4636..af9e0a3873 100644
--- a/code/modules/mob/living/simple_animal/bot/honkbot.dm
+++ b/code/modules/mob/living/simple_animal/bot/honkbot.dm
@@ -139,7 +139,7 @@ Maintenance panel panel is [open ? "opened" : "closed"]"},
/mob/living/simple_animal/bot/honkbot/bullet_act(obj/item/projectile/Proj)
if((istype(Proj,/obj/item/projectile/beam)) || (istype(Proj,/obj/item/projectile/bullet) && (Proj.damage_type == BURN))||(Proj.damage_type == BRUTE) && (!Proj.nodamage && Proj.damage < health && ishuman(Proj.firer)))
retaliate(Proj.firer)
- ..()
+ return ..()
/mob/living/simple_animal/bot/honkbot/UnarmedAttack(atom/A)
if(!on)
diff --git a/code/modules/mob/living/simple_animal/bot/mulebot.dm b/code/modules/mob/living/simple_animal/bot/mulebot.dm
index 43963b4eef..eba5b51f47 100644
--- a/code/modules/mob/living/simple_animal/bot/mulebot.dm
+++ b/code/modules/mob/living/simple_animal/bot/mulebot.dm
@@ -152,7 +152,7 @@
/mob/living/simple_animal/bot/mulebot/bullet_act(obj/item/projectile/Proj)
. = ..()
- if(. && !QDELETED(src)) //Got hit and not blown up yet.
+ if(. == BULLET_ACT_HIT && !QDELETED(src)) //Got hit and not blown up yet.)
if(prob(50) && !isnull(load))
unload(0)
if(prob(25))
diff --git a/code/modules/mob/living/simple_animal/bot/secbot.dm b/code/modules/mob/living/simple_animal/bot/secbot.dm
index d4fc98ee9e..8d815b302d 100644
--- a/code/modules/mob/living/simple_animal/bot/secbot.dm
+++ b/code/modules/mob/living/simple_animal/bot/secbot.dm
@@ -205,7 +205,7 @@ Auto Patrol: []"},
if((Proj.damage_type == BURN) || (Proj.damage_type == BRUTE))
if(!Proj.nodamage && Proj.damage < src.health && ishuman(Proj.firer))
retaliate(Proj.firer)
- ..()
+ return ..()
/mob/living/simple_animal/bot/secbot/UnarmedAttack(atom/A)
diff --git a/code/modules/mob/living/simple_animal/constructs.dm b/code/modules/mob/living/simple_animal/constructs.dm
index 736524496f..ed9c94a534 100644
--- a/code/modules/mob/living/simple_animal/constructs.dm
+++ b/code/modules/mob/living/simple_animal/constructs.dm
@@ -167,9 +167,9 @@
new_angle_s -= 360
P.setAngle(new_angle_s)
- return -1 // complete projectile permutation
+ return BULLET_ACT_FORCE_PIERCE // complete projectile permutation
- return (..(P))
+ return ..()
diff --git a/code/modules/mob/living/simple_animal/hostile/megafauna/colossus.dm b/code/modules/mob/living/simple_animal/hostile/megafauna/colossus.dm
index c2c9f5a71f..1ad07b3203 100644
--- a/code/modules/mob/living/simple_animal/hostile/megafauna/colossus.dm
+++ b/code/modules/mob/living/simple_animal/hostile/megafauna/colossus.dm
@@ -117,7 +117,7 @@ Difficulty: Very Hard
var/random_y = rand(0, 72)
AT.pixel_y += random_y
- ..()
+ return ..()
/mob/living/simple_animal/hostile/megafauna/colossus/proc/enrage(mob/living/L)
if(ishuman(L))
@@ -395,7 +395,7 @@ Difficulty: Very Hard
..()
/obj/machinery/anomalous_crystal/bullet_act(obj/item/projectile/P, def_zone)
- ..()
+ . = ..()
if(istype(P, /obj/item/projectile/magic))
ActivationReaction(P.firer, ACTIVATE_MAGIC, P.damage_type)
return
diff --git a/code/modules/mob/living/simple_animal/hostile/mining_mobs/curse_blob.dm b/code/modules/mob/living/simple_animal/hostile/mining_mobs/curse_blob.dm
index 51919dad24..e4046138cd 100644
--- a/code/modules/mob/living/simple_animal/hostile/mining_mobs/curse_blob.dm
+++ b/code/modules/mob/living/simple_animal/hostile/mining_mobs/curse_blob.dm
@@ -98,7 +98,7 @@ IGNORE_PROC_IF_NOT_TARGET(attack_slime)
/mob/living/simple_animal/hostile/asteroid/curseblob/bullet_act(obj/item/projectile/Proj)
if(Proj.firer != set_target)
- return
+ return BULLET_ACT_FORCE_PIERCE
return ..()
/mob/living/simple_animal/hostile/asteroid/curseblob/attacked_by(obj/item/I, mob/living/L)
diff --git a/code/modules/mob/living/simple_animal/hostile/mining_mobs/goldgrub.dm b/code/modules/mob/living/simple_animal/hostile/mining_mobs/goldgrub.dm
index a2b342ab1b..c02f0c46c7 100644
--- a/code/modules/mob/living/simple_animal/hostile/mining_mobs/goldgrub.dm
+++ b/code/modules/mob/living/simple_animal/hostile/mining_mobs/goldgrub.dm
@@ -75,7 +75,7 @@
/mob/living/simple_animal/hostile/asteroid/goldgrub/bullet_act(obj/item/projectile/P)
visible_message("The [P.name] was repelled by [name]'s girth!")
- return
+ return BULLET_ACT_BLOCK
/mob/living/simple_animal/hostile/asteroid/goldgrub/adjustHealth(amount, updating_health = TRUE, forced = FALSE)
vision_range = 9
diff --git a/code/modules/mob/living/simple_animal/hostile/mining_mobs/mining_mobs.dm b/code/modules/mob/living/simple_animal/hostile/mining_mobs/mining_mobs.dm
index 03d2365016..f40e1c0093 100644
--- a/code/modules/mob/living/simple_animal/hostile/mining_mobs/mining_mobs.dm
+++ b/code/modules/mob/living/simple_animal/hostile/mining_mobs/mining_mobs.dm
@@ -43,7 +43,7 @@
if(P.damage < 30 && P.damage_type != BRUTE)
P.damage = (P.damage / 3)
visible_message("[P] has a reduced effect on [src]!")
- ..()
+ return ..()
/mob/living/simple_animal/hostile/asteroid/hitby(atom/movable/AM)//No floor tiling them to death, wiseguy
if(istype(AM, /obj/item))
diff --git a/code/modules/mob/living/simple_animal/hostile/mushroom.dm b/code/modules/mob/living/simple_animal/hostile/mushroom.dm
index 8727652103..991baee7d8 100644
--- a/code/modules/mob/living/simple_animal/hostile/mushroom.dm
+++ b/code/modules/mob/living/simple_animal/hostile/mushroom.dm
@@ -179,9 +179,10 @@
if(T.throwforce)
Bruise()
-/mob/living/simple_animal/hostile/mushroom/bullet_act()
- ..()
- Bruise()
+/mob/living/simple_animal/hostile/mushroom/bullet_act(obj/item/projectile/P)
+ . = ..()
+ if(!P.nodamage)
+ Bruise()
/mob/living/simple_animal/hostile/mushroom/harvest()
var/counter
diff --git a/code/modules/mob/living/simple_animal/hostile/syndicate.dm b/code/modules/mob/living/simple_animal/hostile/syndicate.dm
index 0faee34f85..96a75f6b4f 100644
--- a/code/modules/mob/living/simple_animal/hostile/syndicate.dm
+++ b/code/modules/mob/living/simple_animal/hostile/syndicate.dm
@@ -128,13 +128,10 @@
return ..()
/mob/living/simple_animal/hostile/syndicate/melee/bullet_act(obj/item/projectile/Proj)
- if(!Proj)
- return
if(prob(25))
return ..()
- else
- visible_message("[src] blocks [Proj] with its shield!")
- return 0
+ visible_message("[src] blocks [Proj] with its shield!")
+ return BULLET_ACT_BLOCK
/mob/living/simple_animal/hostile/syndicate/melee/sword/space
icon_state = "syndicate_space_sword"
diff --git a/code/modules/mob/living/simple_animal/parrot.dm b/code/modules/mob/living/simple_animal/parrot.dm
index 68d08aabd2..f6b29b95aa 100644
--- a/code/modules/mob/living/simple_animal/parrot.dm
+++ b/code/modules/mob/living/simple_animal/parrot.dm
@@ -337,7 +337,7 @@
//Bullets
/mob/living/simple_animal/parrot/bullet_act(obj/item/projectile/Proj)
- ..()
+ . = ..()
if(!stat && !client)
if(parrot_state == PARROT_PERCH)
parrot_sleep_dur = parrot_sleep_max //Reset it's sleep timer if it was perched
@@ -347,7 +347,6 @@
//parrot_been_shot += 5
icon_state = icon_living
drop_held_item(0)
- return
/*
diff --git a/code/modules/mob/living/simple_animal/slime/slime.dm b/code/modules/mob/living/simple_animal/slime/slime.dm
index 107a6eed38..63d776d6e4 100644
--- a/code/modules/mob/living/simple_animal/slime/slime.dm
+++ b/code/modules/mob/living/simple_animal/slime/slime.dm
@@ -220,15 +220,12 @@
return ..() //Heals them
/mob/living/simple_animal/slime/bullet_act(obj/item/projectile/Proj)
- if(!Proj)
- return
attacked += 10
if((Proj.damage_type == BURN))
adjustBruteLoss(-abs(Proj.damage)) //fire projectiles heals slimes.
Proj.on_hit(src)
- else
- ..(Proj)
- return 0
+ return BULLET_ACT_BLOCK
+ return ..()
/mob/living/simple_animal/slime/emp_act(severity)
. = ..()
diff --git a/code/modules/mob/mob_movement.dm b/code/modules/mob/mob_movement.dm
index f61d65146e..41aaaac1c9 100644
--- a/code/modules/mob/mob_movement.dm
+++ b/code/modules/mob/mob_movement.dm
@@ -1,15 +1,3 @@
-/mob/CanPass(atom/movable/mover, turf/target)
- if((mover.pass_flags & PASSMOB))
- return TRUE
- if(istype(mover, /obj/item/projectile) || mover.throwing)
- return (!density || lying)
- if(buckled == mover)
- return TRUE
- if(ismob(mover))
- if (mover in buckled_mobs)
- return TRUE
- return (!mover.density || !density || lying || (mover.throwing && mover.throwing.thrower == src && !ismob(mover)))
-
//DO NOT USE THIS UNLESS YOU ABSOLUTELY HAVE TO. THIS IS BEING PHASED OUT FOR THE MOVESPEED MODIFICATION SYSTEM.
//See mob_movespeed.dm
/mob/proc/movement_delay() //update /living/movement_delay() if you change this
diff --git a/code/modules/modular_computers/computers/machinery/modular_computer.dm b/code/modules/modular_computers/computers/machinery/modular_computer.dm
index a988003b67..39b2c45d99 100644
--- a/code/modules/modular_computers/computers/machinery/modular_computer.dm
+++ b/code/modules/modular_computers/computers/machinery/modular_computer.dm
@@ -158,4 +158,5 @@
// "Brute" damage mostly damages the casing.
/obj/machinery/modular_computer/bullet_act(obj/item/projectile/Proj)
if(cpu)
- cpu.bullet_act(Proj)
+ return cpu.bullet_act(Proj)
+ return ..()
diff --git a/code/modules/power/rtg.dm b/code/modules/power/rtg.dm
index 9dca8f3124..45d1c0fc00 100644
--- a/code/modules/power/rtg.dm
+++ b/code/modules/power/rtg.dm
@@ -74,7 +74,7 @@
addtimer(CALLBACK(GLOBAL_PROC, .proc/explosion, get_turf(src), 2, 3, 4, 8), 100) // Not a normal explosion.
/obj/machinery/power/rtg/abductor/bullet_act(obj/item/projectile/Proj)
- ..()
+ . = ..()
if(!going_kaboom && istype(Proj) && !Proj.nodamage && ((Proj.damage_type == BURN) || (Proj.damage_type == BRUTE)))
message_admins("[ADMIN_LOOKUPFLW(Proj.firer)] triggered an Abductor Core explosion at [AREACOORD(src)] via projectile.")
log_game("[key_name(Proj.firer)] triggered an Abductor Core explosion at [AREACOORD(src)] via projectile.")
diff --git a/code/modules/power/singularity/singularity.dm b/code/modules/power/singularity/singularity.dm
index d622336925..a14a6d76bc 100644
--- a/code/modules/power/singularity/singularity.dm
+++ b/code/modules/power/singularity/singularity.dm
@@ -113,7 +113,8 @@
/obj/singularity/bullet_act(obj/item/projectile/P)
- return 0 //Will there be an impact? Who knows. Will we see it? No.
+ qdel(P)
+ return BULLET_ACT_HIT //Will there be an impact? Who knows. Will we see it? No.
/obj/singularity/Bump(atom/A)
diff --git a/code/modules/power/supermatter/supermatter.dm b/code/modules/power/supermatter/supermatter.dm
index 68ffcb909a..ee93767a0c 100644
--- a/code/modules/power/supermatter/supermatter.dm
+++ b/code/modules/power/supermatter/supermatter.dm
@@ -521,7 +521,7 @@ GLOBAL_DATUM(main_supermatter_engine, /obj/machinery/power/supermatter_crystal)
has_been_powered = TRUE
else if(takes_damage)
damage += Proj.damage * config_bullet_energy
- return FALSE
+ return BULLET_ACT_HIT
/obj/machinery/power/supermatter_crystal/singularity_act()
var/gain = 100
diff --git a/code/modules/projectiles/guns/misc/beam_rifle.dm b/code/modules/projectiles/guns/misc/beam_rifle.dm
index 7aa85db246..c53e28ea29 100644
--- a/code/modules/projectiles/guns/misc/beam_rifle.dm
+++ b/code/modules/projectiles/guns/misc/beam_rifle.dm
@@ -569,4 +569,4 @@
/obj/item/projectile/beam/beam_rifle/hitscan/aiming_beam/on_hit()
qdel(src)
- return FALSE
+ return BULLET_ACT_HIT
diff --git a/code/modules/projectiles/guns/misc/blastcannon.dm b/code/modules/projectiles/guns/misc/blastcannon.dm
index 6c685ebe89..1c8d519ba8 100644
--- a/code/modules/projectiles/guns/misc/blastcannon.dm
+++ b/code/modules/projectiles/guns/misc/blastcannon.dm
@@ -114,7 +114,7 @@
icon_state = "blastwave"
damage = 0
nodamage = FALSE
- forcedodge = TRUE
+ movement_type = FLYING | UNSTOPPABLE
var/heavyr = 0
var/mediumr = 0
var/lightr = 0
diff --git a/code/modules/projectiles/projectile.dm b/code/modules/projectiles/projectile.dm
index 31eb34a4e1..cc778bcf05 100644
--- a/code/modules/projectiles/projectile.dm
+++ b/code/modules/projectiles/projectile.dm
@@ -11,15 +11,16 @@
item_flags = ABSTRACT
pass_flags = PASSTABLE
mouse_opacity = MOUSE_OPACITY_TRANSPARENT
+ movement_type = FLYING
hitsound = 'sound/weapons/pierce.ogg'
var/hitsound_wall = ""
resistance_flags = LAVA_PROOF | FIRE_PROOF | UNACIDABLE | ACID_PROOF
var/def_zone = "" //Aiming at
var/atom/movable/firer = null//Who shot it
- var/atom/fired_from = null // the atom that the projectile was fired from (gun, turret)
+ var/atom/fired_from = null // the atom that the projectile was fired from (gun, turret) var/suppressed = FALSE //Attack message
var/suppressed = FALSE //Attack message
- var/candink = FALSE //Can this projectile play the dink sound when hitting the head?
+ var/candink = FALSE //Can this projectile play the dink sound when hitting the head? var/yo = null
var/yo = null
var/xo = null
var/atom/original = null // the original target clicked
@@ -84,7 +85,8 @@
var/flag = "bullet" //Defines what armor to use when it hits things. Must be set to bullet, laser, energy,or bomb
var/projectile_type = /obj/item/projectile
var/range = 50 //This will de-increment every step. When 0, it will deletze the projectile.
- var/decayedRange
+ var/decayedRange //stores original range
+ var/reflect_range_decrease = 5 //amount of original range that falls off when reflecting, so it doesn't go forever
var/is_reflectable = FALSE // Can it be reflected or not?
//Effects
var/stun = 0
@@ -99,11 +101,12 @@
var/drowsy = 0
var/stamina = 0
var/jitter = 0
- var/forcedodge = 0 //to pass through everything
var/dismemberment = 0 //The higher the number, the greater the bonus to dismembering. 0 will not dismember at all.
var/impact_effect_type //what type of impact effect to show when hitting something
var/log_override = FALSE //is this type spammed enough to not log? (KAs)
+ var/temporary_unstoppable_movement = FALSE
+
/obj/item/projectile/Initialize()
. = ..()
permutated = list()
@@ -152,12 +155,12 @@
W.add_dent(WALL_DENT_SHOT, hitx, hity)
- return 0
+ return BULLET_ACT_HIT
if(!isliving(target))
if(impact_effect_type && !hitscan)
new impact_effect_type(target_loca, hitx, hity)
- return 0
+ return BULLET_ACT_HIT
var/mob/living/L = target
@@ -185,7 +188,6 @@
C.bleed(damage)
else
L.add_splatter_floor(target_loca)
-
else if(impact_effect_type && !hitscan)
new impact_effect_type(target_loca, hitx, hity)
@@ -235,24 +237,20 @@
beam_segments[beam_index] = null
/obj/item/projectile/Bump(atom/A)
+ var/turf/T = get_turf(A)
if(trajectory && check_ricochet(A) && check_ricochet_flag(A) && ricochets < ricochets_max)
var/datum/point/pcache = trajectory.copy_to()
ricochets++
if(A.handle_ricochet(src))
on_ricochet(A)
ignore_source_check = TRUE
- range = initial(range)
+ decayedRange = max(0, decayedRange - reflect_range_decrease)
+ range = decayedRange
if(hitscan)
store_hitscan_collision(pcache)
return TRUE
- if(firer && !ignore_source_check)
- if(A == firer || (A == firer.loc && ismecha(A))) //cannot shoot yourself or your mech
- trajectory_ignore_forcemove = TRUE
- forceMove(get_turf(A))
- trajectory_ignore_forcemove = FALSE
- return FALSE
- var/distance = get_dist(get_turf(A), starting) // Get the distance between the turf shot from and the mob we hit and use that for the calculations.
+ var/distance = get_dist(T, starting) // Get the distance between the turf shot from and the mob we hit and use that for the calculations.
def_zone = ran_zone(def_zone, max(100-(7*distance), 5)) //Lower accurancy/longer range tradeoff. 7 is a balanced number to use.
if(isturf(A) && hitsound_wall)
@@ -261,51 +259,66 @@
volume = 5
playsound(loc, hitsound_wall, volume, 1, -1)
- var/turf/target_turf = get_turf(A)
+ return process_hit(T, select_target(T, A))
- if(!prehit(A))
- if(forcedodge)
- trajectory_ignore_forcemove = TRUE
- forceMove(target_turf)
- trajectory_ignore_forcemove = FALSE
- return FALSE
+#define QDEL_SELF 1 //Delete if we're not UNSTOPPABLE flagged non-temporarily
+#define DO_NOT_QDEL 2 //Pass through.
+#define FORCE_QDEL 3 //Force deletion.
- var/permutation = A.bullet_act(src, def_zone) // searches for return value, could be deleted after run so check A isn't null
- if(permutation == -1 || forcedodge)// the bullet passes through a dense object!
- trajectory_ignore_forcemove = TRUE
- forceMove(target_turf)
- trajectory_ignore_forcemove = FALSE
- if(A)
- permutated.Add(A)
- return FALSE
- else
- var/atom/alt = select_target(A)
- if(alt)
- if(!prehit(alt))
- return FALSE
- alt.bullet_act(src, def_zone)
- qdel(src)
- return TRUE
+/obj/item/projectile/proc/process_hit(turf/T, atom/target, qdel_self, hit_something = FALSE) //probably needs to be reworked entirely when pixel movement is done.
+ if(QDELETED(src) || !T || !target) //We're done, nothing's left.
+ if((qdel_self == FORCE_QDEL) || ((qdel_self == QDEL_SELF) && !temporary_unstoppable_movement && !CHECK_BITFIELD(movement_type, UNSTOPPABLE)))
+ qdel(src)
+ return hit_something
+ permutated |= target //Make sure we're never hitting it again. If we ever run into weirdness with piercing projectiles needing to hit something multiple times.. well.. that's a to-do.
+ if(!prehit(target))
+ return process_hit(T, select_target(T), qdel_self, hit_something) //Hit whatever else we can since that didn't work.
+ var/result = target.bullet_act(src, def_zone)
+ if(result == BULLET_ACT_FORCE_PIERCE)
+ if(!CHECK_BITFIELD(movement_type, UNSTOPPABLE))
+ temporary_unstoppable_movement = TRUE
+ ENABLE_BITFIELD(movement_type, UNSTOPPABLE)
+ return process_hit(T, select_target(T), qdel_self, TRUE) //Hit whatever else we can since we're piercing through but we're still on the same tile.
+ else if(result == BULLET_ACT_TURF) //We hit the turf but instead we're going to also hit something else on it.
+ return process_hit(T, select_target(T), QDEL_SELF, TRUE)
+ else //Whether it hit or blocked, we're done!
+ qdel_self = QDEL_SELF
+ hit_something = TRUE
+ if((qdel_self == FORCE_QDEL) || ((qdel_self == QDEL_SELF) && !temporary_unstoppable_movement && !CHECK_BITFIELD(movement_type, UNSTOPPABLE)))
+ qdel(src)
+ return hit_something
-/obj/item/projectile/proc/select_target(atom/A) //Selects another target from a wall if we hit a wall.
- if(!A || !A.density || (A.flags_1 & ON_BORDER_1) || ismob(A) || A == original) //if we hit a dense non-border obj or dense turf then we also hit one of the mobs or machines/structures on that tile.
- return
- var/turf/T = get_turf(A)
- if(original in T)
+#undef QDEL_SELF
+#undef DO_NOT_QDEL
+#undef FORCE_QDEL
+
+/obj/item/projectile/proc/select_target(turf/T, atom/target) //Select a target from a turf.
+ if((original in T) && can_hit_target(original, permutated, TRUE, TRUE))
return original
- var/list/mob/possible_mobs = typecache_filter_list(T, GLOB.typecache_mob) - A
+ if(target && can_hit_target(target, permutated, target == original, TRUE))
+ return target
+ var/list/mob/living/possible_mobs = typecache_filter_list(T, GLOB.typecache_mob)
var/list/mob/mobs = list()
- for(var/i in possible_mobs)
- var/mob/M = i
- if(M.lying)
+ for(var/mob/living/M in possible_mobs)
+ if(!can_hit_target(M, permutated, M == original, TRUE))
continue
mobs += M
var/mob/M = safepick(mobs)
if(M)
return M.lowest_buckled_mob()
- var/obj/O = safepick(typecache_filter_list(T, GLOB.typecache_machine_or_structure) - A)
+ var/list/obj/possible_objs = typecache_filter_list(T, GLOB.typecache_machine_or_structure)
+ var/list/obj/objs = list()
+ for(var/obj/O in possible_objs)
+ if(!can_hit_target(O, permutated, O == original, TRUE))
+ continue
+ objs += O
+ var/obj/O = safepick(objs)
if(O)
return O
+ //Nothing else is here that we can hit, hit the turf if we haven't.
+ if(!(T in permutated) && can_hit_target(T, permutated, T == original, TRUE))
+ return T
+ //Returns null if nothing at all was found.
/obj/item/projectile/proc/check_ricochet()
if(prob(ricochet_chance))
@@ -332,7 +345,7 @@
var/turf/ending = return_predicted_turf_after_moves(moves, forced_angle)
return getline(current, ending)
-/obj/item/projectile/Process_Spacemove(var/movement_dir = 0)
+/obj/item/projectile/Process_Spacemove(movement_dir = 0)
return TRUE //Bullets don't drift in space
/obj/item/projectile/process()
@@ -360,8 +373,7 @@
/obj/item/projectile/proc/fire(angle, atom/direct_target)
if(fired_from)
- SEND_SIGNAL(fired_from, COMSIG_PROJECTILE_BEFORE_FIRE, src, original)
- //If no angle needs to resolve it from xo/yo!
+ SEND_SIGNAL(fired_from, COMSIG_PROJECTILE_BEFORE_FIRE, src, original) //If no angle needs to resolve it from xo/yo!
if(!log_override && firer && original)
log_combat(firer, original, "fired at", src, "from [get_area_name(src, TRUE)]")
if(direct_target)
@@ -498,8 +510,6 @@
else if(T != loc)
step_towards(src, T)
hitscan_last = loc
- if(can_hit_target(original, permutated))
- Bump(original)
if(!hitscanning && !forcemoved)
pixel_x = trajectory.return_px() - trajectory.mpx * trajectory_multiplier * SSprojectiles.global_iterations_per_move
pixel_y = trajectory.return_py() - trajectory.mpy * trajectory_multiplier * SSprojectiles.global_iterations_per_move
@@ -528,8 +538,28 @@
homing_offset_y = -homing_offset_y
//Returns true if the target atom is on our current turf and above the right layer
-/obj/item/projectile/proc/can_hit_target(atom/target, var/list/passthrough)
- return (target && ((target.layer >= PROJECTILE_HIT_THRESHHOLD_LAYER) || ismob(target)) && (loc == get_turf(target)) && (!(target in passthrough)))
+//If direct target is true it's the originally clicked target.
+/obj/item/projectile/proc/can_hit_target(atom/target, list/passthrough, direct_target = FALSE, ignore_loc = FALSE)
+ if(QDELETED(target))
+ return FALSE
+ if(!ignore_source_check && firer)
+ var/mob/M = firer
+ if((target == firer) || ((target == firer.loc) && ismecha(firer.loc)) || (target in firer.buckled_mobs) || (istype(M) && (M.buckled == target)))
+ return FALSE
+ if(!ignore_loc && (loc != target.loc))
+ return FALSE
+ if(target in passthrough)
+ return FALSE
+ if(target.density) //This thing blocks projectiles, hit it regardless of layer/mob stuns/etc.
+ return TRUE
+ if(!isliving(target))
+ if(target.layer < PROJECTILE_HIT_THRESHHOLD_LAYER)
+ return FALSE
+ else
+ var/mob/living/L = target
+ if(!direct_target && !L.density)
+ return FALSE
+ return TRUE
//Spread is FORCED!
/obj/item/projectile/proc/preparePixelProjectile(atom/target, atom/source, params, spread = 0)
@@ -591,9 +621,20 @@
return list(angle, p_x, p_y)
/obj/item/projectile/Crossed(atom/movable/AM) //A mob moving on a tile with a projectile is hit by it.
- ..()
- if(isliving(AM) && (AM.density || AM == original) && !(src.pass_flags & PASSMOB))
- Bump(AM)
+ . = ..()
+ if(isliving(AM) && !(pass_flags & PASSMOB))
+ var/mob/living/L = AM
+ if(can_hit_target(L, permutated, (AM == original)))
+ Bump(AM)
+
+/obj/item/projectile/Move(atom/newloc, dir = NONE)
+ . = ..()
+ if(.)
+ if(temporary_unstoppable_movement)
+ temporary_unstoppable_movement = FALSE
+ DISABLE_BITFIELD(movement_type, UNSTOPPABLE)
+ if(fired && can_hit_target(original, permutated, TRUE))
+ Bump(original)
/obj/item/projectile/Destroy()
if(hitscan)
diff --git a/code/modules/projectiles/projectile/beams.dm b/code/modules/projectiles/projectile/beams.dm
index d984217f8c..fd79a52906 100644
--- a/code/modules/projectiles/projectile/beams.dm
+++ b/code/modules/projectiles/projectile/beams.dm
@@ -107,8 +107,8 @@
/obj/item/projectile/beam/pulse/heavy/on_hit(atom/target, blocked = FALSE)
life -= 10
if(life > 0)
- . = -1
- ..()
+ . = BULLET_ACT_FORCE_PIERCE
+ return ..()
/obj/item/projectile/beam/emitter
name = "emitter beam"
@@ -207,4 +207,4 @@
. = ..()
if(isopenturf(target) || istype(target, /turf/closed/indestructible))//shrunk floors wouldnt do anything except look weird, i-walls shouldnt be bypassable
return
- target.AddComponent(/datum/component/shrink, shrink_time)
\ No newline at end of file
+ target.AddComponent(/datum/component/shrink, shrink_time)
diff --git a/code/modules/projectiles/projectile/bullets/dart_syringe.dm b/code/modules/projectiles/projectile/bullets/dart_syringe.dm
index 9d60f72de0..3f418df75b 100644
--- a/code/modules/projectiles/projectile/bullets/dart_syringe.dm
+++ b/code/modules/projectiles/projectile/bullets/dart_syringe.dm
@@ -15,7 +15,7 @@
if(M.can_inject(null, FALSE, def_zone, piercing)) // Pass the hit zone to see if it can inject by whether it hit the head or the body.
..()
if(skip == TRUE)
- return
+ return BULLET_ACT_HIT
reagents.reaction(M, INJECT)
reagents.trans_to(M, reagents.total_volume)
return TRUE
@@ -27,7 +27,7 @@
..(target, blocked)
DISABLE_BITFIELD(reagents.reagents_holder_flags, NO_REACT)
reagents.handle_reactions()
- return TRUE
+ return BULLET_ACT_HIT
/obj/item/projectile/bullet/dart/metalfoam/Initialize()
. = ..()
@@ -70,11 +70,11 @@
target.visible_message("\The [src] beeps!")
to_chat("You feel a tiny prick as a smartdart embeds itself in you with a beep.")
- return TRUE
+ return BULLET_ACT_HIT
else
blocked = 100
target.visible_message("\The [src] was deflected!", \
"You see a [src] bounce off you, booping sadly!")
target.visible_message("\The [src] fails to land on target!")
- return TRUE
+ return BULLET_ACT_BLOCK
diff --git a/code/modules/projectiles/projectile/bullets/dnainjector.dm b/code/modules/projectiles/projectile/bullets/dnainjector.dm
index 3bfe2add01..22e9d28ab6 100644
--- a/code/modules/projectiles/projectile/bullets/dnainjector.dm
+++ b/code/modules/projectiles/projectile/bullets/dnainjector.dm
@@ -12,7 +12,7 @@
if(M.can_inject(null, FALSE, def_zone, FALSE))
if(injector.inject(M, firer))
QDEL_NULL(injector)
- return TRUE
+ return BULLET_ACT_HIT
else
blocked = 100
target.visible_message("\The [src] was deflected!", \
diff --git a/code/modules/projectiles/projectile/bullets/grenade.dm b/code/modules/projectiles/projectile/bullets/grenade.dm
index 3e01f167f6..16305c233f 100644
--- a/code/modules/projectiles/projectile/bullets/grenade.dm
+++ b/code/modules/projectiles/projectile/bullets/grenade.dm
@@ -9,4 +9,4 @@
/obj/item/projectile/bullet/a40mm/on_hit(atom/target, blocked = FALSE)
..()
explosion(target, -1, 0, 2, 1, 0, flame_range = 3)
- return TRUE
+ return BULLET_ACT_HIT
diff --git a/code/modules/projectiles/projectile/bullets/shotgun.dm b/code/modules/projectiles/projectile/bullets/shotgun.dm
index ed9478e0ee..02ec167b80 100644
--- a/code/modules/projectiles/projectile/bullets/shotgun.dm
+++ b/code/modules/projectiles/projectile/bullets/shotgun.dm
@@ -53,7 +53,7 @@
/obj/item/projectile/bullet/shotgun_frag12/on_hit(atom/target, blocked = FALSE)
..()
explosion(target, -1, 0, 1)
- return TRUE
+ return BULLET_ACT_HIT
/obj/item/projectile/bullet/pellet
var/tile_dropoff = 0.75
diff --git a/code/modules/projectiles/projectile/bullets/sniper.dm b/code/modules/projectiles/projectile/bullets/sniper.dm
index 6519421284..bea5dbc140 100644
--- a/code/modules/projectiles/projectile/bullets/sniper.dm
+++ b/code/modules/projectiles/projectile/bullets/sniper.dm
@@ -34,7 +34,7 @@
icon_state = "gauss"
name = "penetrator round"
damage = 60
- forcedodge = TRUE
+ movement_type = FLYING | UNSTOPPABLE
dismemberment = 0 //It goes through you cleanly.
knockdown = 0
breakthings = FALSE
diff --git a/code/modules/projectiles/projectile/bullets/special.dm b/code/modules/projectiles/projectile/bullets/special.dm
index 0d3ed847d8..a0414d8a9c 100644
--- a/code/modules/projectiles/projectile/bullets/special.dm
+++ b/code/modules/projectiles/projectile/bullets/special.dm
@@ -3,7 +3,7 @@
/obj/item/projectile/bullet/honker
damage = 0
knockdown = 60
- forcedodge = TRUE
+ movement_type = FLYING | UNSTOPPABLE
nodamage = TRUE
candink = FALSE
hitsound = 'sound/items/bikehorn.ogg'
diff --git a/code/modules/projectiles/projectile/energy/net_snare.dm b/code/modules/projectiles/projectile/energy/net_snare.dm
index c8333a811c..22eaadb1e0 100644
--- a/code/modules/projectiles/projectile/energy/net_snare.dm
+++ b/code/modules/projectiles/projectile/energy/net_snare.dm
@@ -15,7 +15,7 @@
var/turf/Tloc = get_turf(target)
if(!locate(/obj/effect/nettingportal) in Tloc)
new /obj/effect/nettingportal(Tloc)
- ..()
+ return ..()
/obj/item/projectile/energy/net/on_range()
do_sparks(1, TRUE, src)
@@ -69,7 +69,7 @@
else if(iscarbon(target))
var/obj/item/restraints/legcuffs/beartrap/B = new /obj/item/restraints/legcuffs/beartrap/energy(get_turf(target))
B.Crossed(target)
- ..()
+ return ..()
/obj/item/projectile/energy/trap/on_range()
new /obj/item/restraints/legcuffs/beartrap/energy(loc)
@@ -91,7 +91,7 @@
var/obj/item/restraints/legcuffs/beartrap/B = new /obj/item/restraints/legcuffs/beartrap/energy/cyborg(get_turf(target))
B.Crossed(target)
QDEL_IN(src, 10)
- ..()
+ return ..()
/obj/item/projectile/energy/trap/cyborg/on_range()
do_sparks(1, TRUE, src)
diff --git a/code/modules/projectiles/projectile/magic.dm b/code/modules/projectiles/projectile/magic.dm
index 791db320a2..7608e5f4a8 100644
--- a/code/modules/projectiles/projectile/magic.dm
+++ b/code/modules/projectiles/projectile/magic.dm
@@ -17,7 +17,7 @@
var/mob/M = target
if(M.anti_magic_check())
M.visible_message("[src] vanishes on contact with [target]!")
- return
+ return BULLET_ACT_BLOCK
M.death(0)
/obj/item/projectile/magic/resurrection
@@ -31,10 +31,10 @@
. = ..()
if(isliving(target))
if(target.hellbound)
- return
+ return BULLET_ACT_BLOCK
if(target.anti_magic_check())
target.visible_message("[src] vanishes on contact with [target]!")
- return
+ return BULLET_ACT_BLOCK
if(iscarbon(target))
var/mob/living/carbon/C = target
C.regenerate_limbs()
@@ -60,7 +60,7 @@
var/mob/M = target
if(M.anti_magic_check())
M.visible_message("[src] fizzles on contact with [target]!")
- return
+ return BULLET_ACT_BLOCK
var/teleammount = 0
var/teleloc = target
if(!isturf(target))
@@ -116,7 +116,7 @@
if(M.anti_magic_check())
M.visible_message("[src] fizzles on contact with [M]!")
qdel(src)
- return
+ return BULLET_ACT_BLOCK
wabbajack(change)
qdel(src)
@@ -264,7 +264,7 @@
/obj/item/projectile/magic/animate/on_hit(atom/target, blocked = FALSE)
target.animate_atom_living(firer)
- ..()
+ . = ..()
/atom/proc/animate_atom_living(var/mob/living/owner = null)
if((isitem(src) || isstructure(src)) && !is_type_in_list(src, GLOB.protected_objects))
@@ -315,7 +315,7 @@
if(M.anti_magic_check())
M.visible_message("[src] vanishes on contact with [target]!")
qdel(src)
- return
+ return BULLET_ACT_BLOCK
. = ..()
/obj/item/projectile/magic/arcane_barrage
@@ -334,7 +334,7 @@
if(M.anti_magic_check())
M.visible_message("[src] vanishes on contact with [target]!")
qdel(src)
- return
+ return BULLET_ACT_BLOCK
. = ..()
@@ -460,7 +460,7 @@
if(M.anti_magic_check())
visible_message("[src] fizzles on contact with [target]!")
qdel(src)
- return
+ return BULLET_ACT_BLOCK
tesla_zap(src, tesla_range, tesla_power, tesla_flags)
qdel(src)
@@ -487,7 +487,7 @@
var/mob/living/M = target
if(M.anti_magic_check())
visible_message("[src] vanishes into smoke on contact with [target]!")
- return
+ return BULLET_ACT_BLOCK
M.take_overall_damage(0,10) //between this 10 burn, the 10 brute, the explosion brute, and the onfire burn, your at about 65 damage if you stop drop and roll immediately
var/turf/T = get_turf(target)
explosion(T, -1, exp_heavy, exp_light, exp_flash, 0, flame_range = exp_fire)
@@ -504,7 +504,7 @@
if(ismob(target))
var/mob/living/M = target
if(M.anti_magic_check())
- return
+ return BULLET_ACT_BLOCK
var/turf/T = get_turf(target)
for(var/i=0, i<50, i+=10)
addtimer(CALLBACK(GLOBAL_PROC, .proc/explosion, T, -1, exp_heavy, exp_light, exp_flash, FALSE, FALSE, exp_fire), i)
@@ -518,11 +518,11 @@
/obj/item/projectile/magic/nuclear/on_hit(target)
if(used)
- return
+ return BULLET_ACT_HIT
new/obj/effect/temp_visual/slugboom(get_turf(src))
if(ismob(target))
if(target == victim)
- return
+ return BULLET_ACT_FORCE_PIERCE
used = 1
visible_message("[victim] slams into [target] with explosive force!")
explosion(src, 2, 3, 4, -1, TRUE, FALSE, 5)
@@ -531,8 +531,9 @@
victim.take_overall_damage(30,30)
victim.Knockdown(60)
explosion(src, -1, -1, -1, -1, FALSE, FALSE, 5)
+ return BULLET_ACT_HIT
/obj/item/projectile/magic/nuclear/Destroy()
for(var/atom/movable/AM in contents)
AM.forceMove(get_turf(src))
- . = ..()
\ No newline at end of file
+ . = ..()
diff --git a/code/modules/projectiles/projectile/special/curse.dm b/code/modules/projectiles/projectile/special/curse.dm
index 0464f93cd3..062623689b 100644
--- a/code/modules/projectiles/projectile/special/curse.dm
+++ b/code/modules/projectiles/projectile/special/curse.dm
@@ -12,7 +12,7 @@
knockdown = 20
speed = 2
range = 16
- forcedodge = TRUE
+ movement_type = FLYING | UNSTOPPABLE
var/datum/beam/arm
var/handedness = 0
@@ -28,7 +28,7 @@
/obj/item/projectile/curse_hand/prehit(atom/target)
if(target == original)
- forcedodge = FALSE
+ DISABLE_BITFIELD(movement_type, UNSTOPPABLE)
else if(!isturf(target))
return FALSE
return ..()
@@ -37,7 +37,7 @@
if(arm)
arm.End()
arm = null
- if(forcedodge)
+ if(CHECK_BITFIELD(movement_type, UNSTOPPABLE))
playsound(src, 'sound/effects/curse3.ogg', 25, 1, -1)
var/turf/T = get_step(src, dir)
new/obj/effect/temp_visual/dir_setting/curse/hand(T, dir, handedness)
diff --git a/code/modules/projectiles/projectile/special/ion.dm b/code/modules/projectiles/projectile/special/ion.dm
index 231b4de021..ae0888d3df 100644
--- a/code/modules/projectiles/projectile/special/ion.dm
+++ b/code/modules/projectiles/projectile/special/ion.dm
@@ -6,15 +6,12 @@
nodamage = 1
flag = "energy"
impact_effect_type = /obj/effect/temp_visual/impact_effect/ion
+ var/emp_radius = 1
/obj/item/projectile/ion/on_hit(atom/target, blocked = FALSE)
..()
- empulse(target, 1, 1)
- return TRUE
+ empulse(target, emp_radius, emp_radius)
+ return BULLET_ACT_HIT
/obj/item/projectile/ion/weak
-
-/obj/item/projectile/ion/weak/on_hit(atom/target, blocked = FALSE)
- ..()
- empulse(target, 0, 0)
- return TRUE
+ emp_radius = 0
diff --git a/code/modules/projectiles/projectile/special/plasma.dm b/code/modules/projectiles/projectile/special/plasma.dm
index 3a9ce24674..33559fa92c 100644
--- a/code/modules/projectiles/projectile/special/plasma.dm
+++ b/code/modules/projectiles/projectile/special/plasma.dm
@@ -29,7 +29,7 @@
mine_range--
range++
if(range > 0)
- return -1
+ return BULLET_ACT_FORCE_PIERCE
/obj/item/projectile/plasma/adv
damage = 28
diff --git a/code/modules/projectiles/projectile/special/rocket.dm b/code/modules/projectiles/projectile/special/rocket.dm
index 03d85665d5..0cee20dd53 100644
--- a/code/modules/projectiles/projectile/special/rocket.dm
+++ b/code/modules/projectiles/projectile/special/rocket.dm
@@ -6,7 +6,7 @@
/obj/item/projectile/bullet/gyro/on_hit(atom/target, blocked = FALSE)
..()
explosion(target, -1, 0, 2)
- return TRUE
+ return BULLET_ACT_HIT
/obj/item/projectile/bullet/a84mm
name ="\improper HEDP rocket"
@@ -28,7 +28,7 @@
if(issilicon(target))
var/mob/living/silicon/S = target
S.take_overall_damage(anti_armour_damage*0.75, anti_armour_damage*0.25)
- return TRUE
+ return BULLET_ACT_HIT
/obj/item/projectile/bullet/a84mm_he
name ="\improper HE missile"
@@ -43,4 +43,4 @@
explosion(target, 0, 1, 2, 4)
else
explosion(target, 0, 0, 2, 4)
- return TRUE
\ No newline at end of file
+ return BULLET_ACT_HIT
\ No newline at end of file
diff --git a/code/modules/projectiles/projectile/special/wormhole.dm b/code/modules/projectiles/projectile/special/wormhole.dm
index 0832f0cc76..aaf9f542d3 100644
--- a/code/modules/projectiles/projectile/special/wormhole.dm
+++ b/code/modules/projectiles/projectile/special/wormhole.dm
@@ -25,5 +25,5 @@
/obj/item/projectile/beam/wormhole/on_hit(atom/target)
if(!gun)
qdel(src)
- return
+ return BULLET_ACT_BLOCK
gun.create_portal(src, get_turf(src))
diff --git a/code/modules/reagents/reagent_dispenser.dm b/code/modules/reagents/reagent_dispenser.dm
index 2e0c5b7619..1c87c1901c 100644
--- a/code/modules/reagents/reagent_dispenser.dm
+++ b/code/modules/reagents/reagent_dispenser.dm
@@ -125,7 +125,7 @@
boom()
/obj/structure/reagent_dispensers/fueltank/bullet_act(obj/item/projectile/P)
- ..()
+ . = ..()
if(!QDELETED(src)) //wasn't deleted by the projectile's effects.
if(!P.nodamage && ((P.damage_type == BURN) || (P.damage_type == BRUTE)))
var/boom_message = "[ADMIN_LOOKUPFLW(P.firer)] triggered a fueltank explosion via projectile."
diff --git a/code/modules/spells/spell_types/ethereal_jaunt.dm b/code/modules/spells/spell_types/ethereal_jaunt.dm
index 9d1274edef..a9d5f21abc 100644
--- a/code/modules/spells/spell_types/ethereal_jaunt.dm
+++ b/code/modules/spells/spell_types/ethereal_jaunt.dm
@@ -99,5 +99,6 @@
/obj/effect/dummy/phased_mob/spell_jaunt/ex_act(blah)
return
+
/obj/effect/dummy/phased_mob/spell_jaunt/bullet_act(blah)
- return
\ No newline at end of file
+ return BULLET_ACT_FORCE_PIERCE
\ No newline at end of file
diff --git a/code/modules/spells/spell_types/shadow_walk.dm b/code/modules/spells/spell_types/shadow_walk.dm
index 8dbb6d6532..b32c8c16c6 100644
--- a/code/modules/spells/spell_types/shadow_walk.dm
+++ b/code/modules/spells/spell_types/shadow_walk.dm
@@ -91,7 +91,7 @@
return
/obj/effect/dummy/phased_mob/shadow/bullet_act()
- return
+ return BULLET_ACT_FORCE_PIERCE
/obj/effect/dummy/phased_mob/shadow/singularity_act()
return
diff --git a/code/modules/vore/eating/voreitems.dm b/code/modules/vore/eating/voreitems.dm
index 05ab1e5f8b..4e6bdaa1e0 100644
--- a/code/modules/vore/eating/voreitems.dm
+++ b/code/modules/vore/eating/voreitems.dm
@@ -21,6 +21,7 @@
range = 2
/obj/item/projectile/sickshot/on_hit(var/atom/movable/target, var/blocked = 0)
+ . = ..()
if(iscarbon(target))
var/mob/living/carbon/H = target
if(prob(5))
@@ -28,7 +29,7 @@
H.release_vore_contents()
H.visible_message("[H] contracts strangely, spewing out contents on the floor!", \
"You spew out everything inside you on the floor!")
- return
+ return BULLET_ACT_HIT
////////////////////////// Anti-Noms Drugs //////////////////////////
diff --git a/code/modules/vore/resizing/sizegun_vr.dm b/code/modules/vore/resizing/sizegun_vr.dm
index 8295f32cfa..156b220df3 100644
--- a/code/modules/vore/resizing/sizegun_vr.dm
+++ b/code/modules/vore/resizing/sizegun_vr.dm
@@ -42,7 +42,8 @@
impact_type = /obj/effect/projectile/xray/impact
/obj/item/projectile/beam/shrinklaser/on_hit(var/atom/target, var/blocked = 0)
- if(istype(target, /mob/living))
+ . = ..()
+ if(isliving(target))
var/mob/living/M = target
switch(M.size_multiplier)
if(SIZESCALE_HUGE to INFINITY)
@@ -54,7 +55,7 @@
if((0 - INFINITY) to SIZESCALE_NORMAL)
M.sizescale(SIZESCALE_TINY)
M.update_transform()
- return 1
+ return BULLET_ACT_HIT
/obj/item/projectile/beam/growlaser
name = "growth beam"
@@ -68,7 +69,8 @@
impact_type = /obj/effect/projectile/laser_blue/impact
/obj/item/projectile/beam/growlaser/on_hit(var/atom/target, var/blocked = 0)
- if(istype(target, /mob/living))
+ . = ..()
+ if(isliving(target))
var/mob/living/M = target
switch(M.size_multiplier)
if(SIZESCALE_BIG to SIZESCALE_HUGE)
@@ -80,7 +82,7 @@
if((0 - INFINITY) to SIZESCALE_TINY)
M.sizescale(SIZESCALE_SMALL)
M.update_transform()
- return 1
+ return BULLET_ACT_HIT
*/
datum/design/sizeray
@@ -108,7 +110,8 @@ datum/design/sizeray
icon_state="laser"
/obj/item/projectile/sizeray/shrinkray/on_hit(var/atom/target, var/blocked = 0)
- if(istype(target, /mob/living))
+ . = ..()
+ if(isliving(target))
var/mob/living/M = target
switch(M.size_multiplier)
if(SIZESCALE_HUGE to INFINITY)
@@ -120,10 +123,11 @@ datum/design/sizeray
if((0 - INFINITY) to SIZESCALE_NORMAL)
M.sizescale(SIZESCALE_TINY)
M.update_transform()
- return 1
+ return BULLET_ACT_
/obj/item/projectile/sizeray/growthray/on_hit(var/atom/target, var/blocked = 0)
- if(istype(target, /mob/living))
+ . = ..()
+ if(isliving(target))
var/mob/living/M = target
switch(M.size_multiplier)
if(SIZESCALE_BIG to SIZESCALE_HUGE)
@@ -135,7 +139,7 @@ datum/design/sizeray
if((0 - INFINITY) to SIZESCALE_TINY)
M.sizescale(SIZESCALE_SMALL)
M.update_transform()
- return 1
+ return BULLET_ACT_HIT
/obj/item/ammo_casing/energy/laser/growthray
projectile_type = /obj/item/projectile/sizeray/growthray
diff --git a/modular_citadel/code/modules/projectiles/guns/ballistic/handguns.dm b/modular_citadel/code/modules/projectiles/guns/ballistic/handguns.dm
index 10ab3901d9..98d2efc4ea 100644
--- a/modular_citadel/code/modules/projectiles/guns/ballistic/handguns.dm
+++ b/modular_citadel/code/modules/projectiles/guns/ballistic/handguns.dm
@@ -66,6 +66,7 @@ obj/item/projectile/bullet/c10mm/soporific
knockdown = 0
/obj/item/projectile/bullet/c10mm/soporific/on_hit(atom/target, blocked = FALSE)
+ . = ..()
if((blocked != 100) && isliving(target))
var/mob/living/L = target
L.blur_eyes(6)
@@ -73,7 +74,6 @@ obj/item/projectile/bullet/c10mm/soporific
L.Sleeping(300)
else
L.adjustStaminaLoss(25)
- return 1
/obj/item/ammo_casing/c10mm/soporific
name = ".10mm soporific bullet casing"
diff --git a/modular_citadel/code/modules/projectiles/guns/ballistic/magweapon.dm b/modular_citadel/code/modules/projectiles/guns/ballistic/magweapon.dm
index 8ee00bef06..9779b47b15 100644
--- a/modular_citadel/code/modules/projectiles/guns/ballistic/magweapon.dm
+++ b/modular_citadel/code/modules/projectiles/guns/ballistic/magweapon.dm
@@ -355,7 +355,7 @@
damage = 10
armour_penetration = 10
stamina = 10
- forcedodge = TRUE
+ movement_type = FLYING | UNSTOPPABLE
range = 6
light_range = 1
light_color = LIGHT_COLOR_RED
@@ -363,14 +363,14 @@
/obj/item/projectile/bullet/mags/hyper/inferno
icon_state = "magjectile-large"
stamina = 0
- forcedodge = FALSE
+ movement_type = FLYING | UNSTOPPABLE
range = 25
light_range = 4
/obj/item/projectile/bullet/mags/hyper/inferno/on_hit(atom/target, blocked = FALSE)
..()
explosion(target, -1, 1, 2, 4, 5)
- return 1
+ return BULLET_ACT_HIT
///ammo casings///
@@ -436,7 +436,7 @@
icon = 'modular_citadel/icons/obj/guns/cit_guns.dmi'
icon_state = "magjectile-toy"
name = "lasertag magbolt"
- forcedodge = TRUE //for penetration memes
+ movement_type = FLYING | UNSTOPPABLE //for penetration memes
range = 5 //so it isn't super annoying
light_range = 2
light_color = LIGHT_COLOR_YELLOW
diff --git a/modular_citadel/code/modules/projectiles/guns/ballistic/spinfusor.dm b/modular_citadel/code/modules/projectiles/guns/ballistic/spinfusor.dm
index b70858c9af..9e965ec7a7 100644
--- a/modular_citadel/code/modules/projectiles/guns/ballistic/spinfusor.dm
+++ b/modular_citadel/code/modules/projectiles/guns/ballistic/spinfusor.dm
@@ -9,7 +9,7 @@
/obj/item/projectile/bullet/spinfusor/on_hit(atom/target, blocked = FALSE) //explosion to emulate the spinfusor's AOE
..()
explosion(target, -1, -1, 2, 0, -1)
- return 1
+ return BULLET_ACT_HIT
/obj/item/ammo_casing/caseless/spinfusor
name = "spinfusor disk"