Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

arrows can be converted #169

Merged
merged 1 commit into from
Oct 20, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 20 additions & 13 deletions modular_skyrat/modules/reagent_forging/code/forge_weapons.dm
Original file line number Diff line number Diff line change
Expand Up @@ -239,22 +239,29 @@
. = ..()
AddComponent(/datum/component/reagent_weapon)

/obj/item/ammo_casing/arrow/forged
desc = "An arrow made of wood, typically fired from a bow. It can be reinforced with sinew."
projectile_type = /obj/projectile/bullet/arrow/forged

/obj/item/ammo_casing/arrow/forged/attackby(obj/item/attacking_item, mob/user, params)
/obj/item/ammo_casing/arrow/attackby(obj/item/attacking_item, mob/user, params)
var/spawned_item
if(istype(attacking_item, /obj/item/stack/sheet/sinew))
var/obj/item/stack/stack_item = attacking_item
if(!stack_item.use(1))
return
new /obj/item/ammo_casing/arrow/ash(get_turf(src))
qdel(src)
spawned_item = /obj/item/ammo_casing/arrow/ash

if(istype(attacking_item, /obj/item/stack/sheet/bone))
spawned_item = /obj/item/ammo_casing/arrow/bone

if(istype(attacking_item, /obj/item/stack/tile/bronze))
spawned_item = /obj/item/ammo_casing/arrow/bronze

if(!spawned_item)
return ..()

var/obj/item/stack/stack_item = attacking_item
if(!stack_item.use(1))
return
return ..()

/obj/projectile/bullet/arrow/forged
projectile_type = /obj/item/ammo_casing/arrow/forged
var/obj/item/ammo_casing/arrow/converted_arrow = new spawned_item(get_turf(src))
transfer_fingerprints_to(converted_arrow)
remove_item_from_storage(user)
user.put_in_hands(converted_arrow)
qdel(src)

#define INCREASE_BLOCK_CHANGE 2

Expand Down
Loading