mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-25 22:19:30 +01:00
Setting a few things straight with embedding and caseless ammo. (#77450) ## About The Pull Request So, when I made the `caseless` and `projectile_drop` elements, I failed to take into account that bullets have an embedding variable sets, which led to a few projectiles being embeddable when they shouldn't. Beyond that, I wanted arrows and harpoons to be reusable yet embeddable, which lead me to change a couple lines on the `embed` element, since whoever made the element thought it was a good idea to add the unnecessary step of attaching a copy of it to the `payload_type` of a fired projectile before trying to embed it. Like, why? All that's going to do is cause the resulting item to become embeddable, which may be an issue for anything other than drop-deletable shrapnels. So yea, arrows and harpoons, and emagged lollipops will now embed properly. I've also deleted an unused, problematic subtype of quiver and arrow casing, and made the quiver storage use ## Why It's Good For The Game This will fix #77187. Perhaps buff harpoons and arrows a little but meh. ## Changelog 🆑 fix: Fixed fired foam darts, gumballs and (harmless) lollipops being embeddable. fix: Projectiles that should embed while being reusable will now do so correctly, actually embedding the reusable casing instead of a shrapnel. balance: Arrows are generally more likely to embed now, except for blazing ones, that kind of just blaze. qol: the quiver storage now uses numerical stacking (like botany and ore bags, or the RPED, for example). /🆑 Co-authored-by: Ghom <42542238+Ghommie@users.noreply.github.com>
This commit is contained in:
@@ -8,7 +8,7 @@
|
||||
argument_hash_start_idx = 2
|
||||
var/reusable = FALSE
|
||||
|
||||
/datum/element/caseless/Attach(datum/target, reusable)
|
||||
/datum/element/caseless/Attach(datum/target, reusable = FALSE)
|
||||
. = ..()
|
||||
if(!isammocasing(target))
|
||||
return ELEMENT_INCOMPATIBLE
|
||||
|
||||
@@ -131,8 +131,10 @@
|
||||
/**
|
||||
* checkEmbedProjectile() is what we get when a projectile with a defined shrapnel_type impacts a target.
|
||||
*
|
||||
* If we hit a valid target, we create the shrapnel_type object and immediately call tryEmbed() on it, targeting what we impacted. That will lead
|
||||
* it to call tryForceEmbed() on its own embed element (it's out of our hands here, our projectile is done), where it will run through all the checks it needs to.
|
||||
* If we hit a valid target, we create the shrapnel_type object and then forcefully try to embed it on its
|
||||
* behalf. DO NOT EVER add an embed element to the payload and let it do the rest.
|
||||
* That's awful, and it'll limit us to drop-deletable shrapnels in the worry of stuff like
|
||||
* arrows and harpoons being embeddable even when not let loose by their weapons.
|
||||
*/
|
||||
/datum/element/embed/proc/checkEmbedProjectile(obj/projectile/P, atom/movable/firer, atom/hit, angle, hit_zone)
|
||||
SIGNAL_HANDLER
|
||||
@@ -144,14 +146,13 @@
|
||||
var/obj/item/payload = new payload_type(get_turf(hit))
|
||||
if(istype(payload, /obj/item/shrapnel/bullet))
|
||||
payload.name = P.name
|
||||
payload.embedding = P.embedding
|
||||
payload.updateEmbedding()
|
||||
SEND_SIGNAL(P, COMSIG_PROJECTILE_ON_SPAWN_EMBEDDED, payload)
|
||||
var/mob/living/carbon/C = hit
|
||||
var/obj/item/bodypart/limb = C.get_bodypart(hit_zone)
|
||||
if(!limb)
|
||||
limb = C.get_bodypart()
|
||||
|
||||
payload.tryEmbed(limb) // at this point we've created our shrapnel baby and set them up to embed in the target, we can now die in peace as they handle their embed try on their own
|
||||
tryForceEmbed(payload, limb)
|
||||
Detach(P)
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user