Plungers and Some Recipe Restoration

This commit is contained in:
Captain277
2022-02-17 19:20:21 -08:00
parent 8d2b6087a0
commit 09cfe7fe8f
16 changed files with 183 additions and 4 deletions

View File

@@ -1,12 +1,20 @@
//Note: So I tried to make it so arrows can shatter on impact, but the code doesn't like that, and ignores the drop chance entirely. Slate this for review.
/obj/item/projectile/bullet/reusable
name = "reusable bullet"
desc = "How do you even reuse a bullet?"
var/ammo_type = /obj/item/ammo_casing/arrow
var/dropped = FALSE
//var/fragile = FALSE
//var/durable = FALSE
//var/shattered = 0
//var/broken_type = null
/obj/item/projectile/bullet/reusable/on_hit(atom/target, blocked = FALSE)
. = ..()
handle_drop()
//handle_shatter()
/obj/item/projectile/bullet/reusable/on_range()
handle_drop()
@@ -17,6 +25,33 @@
var/turf/T = get_turf(src)
new ammo_type(T)
dropped = TRUE
/*
else
var/turf/T = get_turf(src)
new broken_type(T)
dropped = TRUE
/obj/item/projectile/bullet/reusable/proc/handle_shatter()
if(fragile)
switch(rand(1,100))
if(1 to 50)
src.shattered = 1
if(31 to 100)
return
if(durable)
switch(rand(1,100))
if(1 to 5)
src.shattered = 1
if(6 to 100)
return
else
switch(rand(1,100))
if(1 to 25)
src.shattered = 1
if(16 to 100)
return
return
*/
//Arrows
/obj/item/projectile/bullet/reusable/arrow
@@ -25,6 +60,7 @@
damage = 15
icon_state = "arrow"
ammo_type = /obj/item/ammo_casing/arrow/wood
//broken_type = /obj/item/trash/broken_arrow
/obj/item/projectile/bullet/reusable/arrow/ash
name = "ashen arrow"
@@ -44,3 +80,20 @@
desc = "Bronze tipped arrow."
armor_penetration = 30
ammo_type = /obj/item/ammo_casing/arrow/bronze
//Plunger
/obj/item/projectile/bullet/reusable/plunger
name = "plunger"
desc = "It's a plunger, for plunging."
damage = 15
icon_state = "plunger"
ammo_type = /obj/item/ammo_casing/arrow/plunger
/obj/item/projectile/bullet/reusable/plunger/on_hit(atom/hit_atom)
. = ..()
var/mob/living/carbon/H = hit_atom
var/obj/item/plunger/P
if(!H.wear_mask)
H.equip_to_slot_if_possible(P, SLOT_MASK)
else
handle_drop()