Skip to content

Commit

Permalink
arrows can be converted (#24449)
Browse files Browse the repository at this point in the history
* arrows can be converted

* Update modular_skyrat/modules/reagent_forging/code/forge_weapons.dm

Co-authored-by: Bloop <[email protected]>

---------

Co-authored-by: Bloop <[email protected]>
  • Loading branch information
2 people authored and FFMirrorBot committed Oct 20, 2023
1 parent dc68835 commit b11d07d
Showing 1 changed file with 20 additions and 13 deletions.
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

0 comments on commit b11d07d

Please sign in to comment.