Files
Bubberstation/code/modules/projectiles/ammunition/ballistic/foam.dm
SkyratBot 57af94957d [MIRROR] Different pen types have unique behavior when used in foam darts. [MDB IGNORE] (#25183)
* Different pen types have unique behavior when used in foam darts. (#79587)

## About The Pull Request

This PR makes the following changes:
- Refactors inserting items into foam darts into a component on items
that can be inserted into darts
- Adds the aforementioned component to pens
- Provides an inspection tip for how to modify a foam dart
- Gives different pen types specific behavior when used in a foam dart

Pens typically give a foam dart 5 brute and 50% embed chance (affected
by falloff). The following types of pens give the specified properties
(usually directly derived from the pen's stats and additional
functions):
- Red pen (and four-color pen set to red): Slightly faster dart
- Captain's fountain pen: Slightly faster dart, and 75% base embed
chance
- Sleepypen: Tries to inject its reagents into the hit mob, but doesn't
penetrate thick clothing like syringe guns do
- Energy Dagger: 35 brute, 100% base embed chance, and slightly faster
dart
- Survival Pen: Mines rocks on impact
- Fine Tip Pen (if someone somehow manages to get one): 100 bare wound
bonus and 9000 demolition modifier

## Why It's Good For The Game

Expands the emergent gameplay possibilities of using pens in foam darts.

While there are balance risks involved with traitors being able to buy
the equivalent of reusable 45u syringe shots and 35 brute bullets, you
are not likely to get your pen back once it hits its target, unless you
somehow have the recall spell and have bound the pen to it. There are
probably more TC-efficient ways to achieve comparable projectile
weaponry, but foam dart guns have an air of subtlety to them... at least
until your skin is pierced by a pointy writing implement that may also
be something more deadly. If maintainers still have balance concerns,
please let me know.

## Changelog

🆑
add: Certain types of pens now function like you expect they would when
inserted into a foam dart
qol: Examining a foam dart closely will show you how to modify it, or
what it is modified with
/🆑

* Different pen types have unique behavior when used in foam darts.

---------

Co-authored-by: Y0SH1M4S73R <legoboyo@earthlink.net>
2023-11-21 22:54:35 -05:00

60 lines
2.3 KiB
Plaintext

/obj/item/ammo_casing/foam_dart
name = "foam dart"
desc = "It's Donk or Don't! Ages 8 and up."
projectile_type = /obj/projectile/bullet/foam_dart
caliber = CALIBER_FOAM
icon = 'icons/obj/weapons/guns/toy.dmi'
icon_state = "foamdart"
base_icon_state = "foamdart"
custom_materials = list(/datum/material/iron = SMALL_MATERIAL_AMOUNT * 0.1125)
harmful = FALSE
var/modified = FALSE
var/static/list/insertable_items_hint = list(/obj/item/pen)
/obj/item/ammo_casing/foam_dart/Initialize(mapload)
. = ..()
AddElement(/datum/element/caseless, TRUE)
/obj/item/ammo_casing/foam_dart/update_icon_state()
. = ..()
if(modified)
icon_state = "[base_icon_state]_empty"
loaded_projectile?.icon_state = "[loaded_projectile.base_icon_state]_empty_proj"
return
icon_state = "[base_icon_state]"
loaded_projectile?.icon_state = "[loaded_projectile.base_icon_state]_proj"
/obj/item/ammo_casing/foam_dart/update_desc()
. = ..()
desc = "It's Donk or Don't! [modified ? "... Although, this one doesn't look too safe." : "Ages 8 and up."]"
/obj/item/ammo_casing/foam_dart/examine_more(mob/user)
. = ..()
if(!HAS_TRAIT(src, TRAIT_DART_HAS_INSERT))
var/list/type_initial_names = list()
for(var/type in insertable_items_hint)
var/obj/item/type_item = type
type_initial_names += "\a [initial(type_item.name)]"
. += span_notice("[modified ? "You can" : "If you removed the safety cap with a screwdriver, you could"] insert a small item\
[length(type_initial_names) ? ", such as [english_list(type_initial_names, and_text = "or ", final_comma_text = ", ")]" : ""].")
/obj/item/ammo_casing/foam_dart/attackby(obj/item/attacking_item, mob/user, params)
var/obj/projectile/bullet/foam_dart/dart = loaded_projectile
if (attacking_item.tool_behaviour == TOOL_SCREWDRIVER && !modified)
modified = TRUE
dart.modified = TRUE
dart.damage_type = BRUTE
to_chat(user, span_notice("You pop the safety cap off [src]."))
update_appearance()
else
return ..()
/obj/item/ammo_casing/foam_dart/riot
name = "riot foam dart"
desc = "Whose smart idea was it to use toys as crowd control? Ages 18 and up."
projectile_type = /obj/projectile/bullet/foam_dart/riot
icon_state = "foamdart_riot"
base_icon_state = "foamdart_riot"
custom_materials = list(/datum/material/iron = HALF_SHEET_MATERIAL_AMOUNT* 1.125)