[MIRROR] Bibles, Lighters, and Cowboy Hats can block bullets [MDB IGNORE] (#22282)

* Bibles, Lighters, and Cowboy Hats can block bullets (#76521)

## About The Pull Request

If you are wearing a bible or lighter in your suit slot, or a cowboy hat
on your head, there is a small (2%) chance that bullets (only bullets,
not lasers) will hit them instead of you.
This destroys lighters, removes the storage capacity of the bible, or
sends the hat flying off your head.

The Bounty Hunter's cowboy hat has a significantly higher chance to
intercept bullets.

## Why It's Good For The Game

Adds some fun flavour to these items.

## Changelog

🆑
add: A bible or lighter in your suit slot, or cowboy hat on your head
will occasionally intercept a bullet.
/🆑

* Bibles, Lighters, and Cowboy Hats can block bullets

---------

Co-authored-by: Jacquerel <hnevard@gmail.com>
Co-authored-by: Bloop <vinylspiders@gmail.com>
This commit is contained in:
SkyratBot
2023-07-11 23:59:06 -04:00
committed by GitHub
co-authored by Jacquerel Bloop
parent 08ddf2a09e
commit 4a779bb4b6
9 changed files with 137 additions and 2 deletions
+15
View File
@@ -740,8 +740,23 @@ CIGARETTE PACKETS ARE IN FANCY.DM
. = ..()
if(!overlay_state)
overlay_state = pick(overlay_list)
AddComponent(\
/datum/component/bullet_intercepting,\
block_chance = 0.5,\
active_slots = ITEM_SLOT_SUITSTORE,\
on_intercepted = CALLBACK(src, PROC_REF(on_intercepted_bullet)),\
)
update_appearance()
/// Destroy the lighter when it's shot by a bullet
/obj/item/lighter/proc/on_intercepted_bullet(mob/living/victim, obj/projectile/bullet)
victim.visible_message(span_warning("\The [bullet] shatters on [victim]'s lighter!"))
playsound(victim, get_sfx(SFX_RICOCHET), 100, TRUE)
new /obj/effect/decal/cleanable/oil(get_turf(src))
do_sparks(1, TRUE, src)
victim.dropItemToGround(src, force = TRUE, silent = TRUE)
qdel(src)
/obj/item/lighter/cyborg_unequip(mob/user)
if(!lit)
return