Files
Bubberstation/code/modules/projectiles/projectile/bullets/dart_syringe.dm
MrMelbert 93ec5a72f7 A comprehensive refactor / cleanup of bullet_hit and on_hit to cut out a single bad species / mob proc (#79024)
## About The Pull Request

- Refactored `bullet_act`. Adds `should_call_parent` and refactors
associated children to support that.
   - Fixes silicons sparking off when hit by disabler fire. 
- Desnowflakes firing range target integrity and cleans up its
bullet-hole code a bit.
- Cleans up changeling tentacle code a fair bit and fixes it not taking
off throw mode if you fail to catch something.
   - The Sleeping Carp deflection is now signalized 
- Nightmare projectile dodging is now signalized and sourced from the
Nightmare's brain rather than species
- Refactored how cardboard cutouts get knocked over to be less
snowflaked / use integrity
- Also adds projectile `on_hit` `should_call_parent` and cleans up a bit
of that, particularly their arguments.
- On hit arguments were passed wrong this entire time, it's a good thing
nothing relied on that.

## Why It's Good For The Game

This is cringe. 


1863eb2cd8/code/modules/mob/living/carbon/human/_species.dm (L1430-L1442)

Bullets should overall act more consistent across mob types and objects.

## Changelog

🆑 Melbert
fix: Silicons don't spark when shot by disablers
fix: Changelings who fail to catch something with a tencacle will have
throw mode disabled automatically
fix: Fixes occasions where you can reflect with Sleeping Carp when you
shouldn't be able to
fix: Fixes some projectiles causing like 20x less eye blur than they
should be
refactor: Refactored bullet-mob interactions
refactor: Nightmare "shadow dodge" projectile ability is now sourced
from their brain
/🆑
2023-10-18 23:08:13 -06:00

51 lines
1.7 KiB
Plaintext

/obj/projectile/bullet/dart
name = "dart"
icon_state = "cbbolt"
damage = 6
embedding = null
shrapnel_type = null
var/inject_flags = null
/obj/projectile/bullet/dart/Initialize(mapload)
. = ..()
create_reagents(50, NO_REACT)
/obj/projectile/bullet/dart/on_hit(atom/target, blocked = 0, pierce_hit)
if(iscarbon(target))
var/mob/living/carbon/M = target
if(blocked != 100) // not completely blocked
if(M.can_inject(target_zone = def_zone, injection_flags = inject_flags)) // Pass the hit zone to see if it can inject by whether it hit the head or the body.
..()
reagents.trans_to(M, reagents.total_volume, methods = INJECT)
return BULLET_ACT_HIT
else
blocked = 100
target.visible_message(span_danger("\The [src] is deflected!"), \
span_userdanger("You are protected against \the [src]!"))
..(target, blocked)
reagents.flags &= ~(NO_REACT)
reagents.handle_reactions()
return BULLET_ACT_HIT
/obj/projectile/bullet/dart/metalfoam/Initialize(mapload)
. = ..()
reagents.add_reagent(/datum/reagent/aluminium, 15)
reagents.add_reagent(/datum/reagent/foaming_agent, 5)
reagents.add_reagent(/datum/reagent/toxin/acid/fluacid, 5)
/obj/projectile/bullet/dart/syringe
name = "syringe"
icon_state = "syringeproj"
/obj/projectile/bullet/dart/syringe/Initialize(mapload)
. = ..()
// This prevents the Ody from being used as a combat mech spamming RDX/Teslium syringes all over the place.
// Other syringe guns are loaded manually with pre-filled syringes which will react chems themselves.
// The traitor chem dartgun uses /obj/projectile/bullet/dart/piercing, so this does not impact it.
reagents.flags &= ~NO_REACT
/obj/projectile/bullet/dart/piercing
inject_flags = INJECT_CHECK_PENETRATE_THICK