Files
Paradise/code/modules/projectiles/guns/projectile/bow.dm
kyunkyunkyun 8821ab9a66 Updates a couple of /obj/item variables (#29829)
* compiles checkpoint

* fix some

* updatepaths

* fix

* rrr

* linters

* fiexs

* icon fixes

* plasmemes

* fix

* fix

* fix bit more

* fix

* well

* cleanup

* fix glasses layer

* conflict

* fuck gun code

* fixes

* fix

* fixes to energy guns

* review

* conflict

* support that 1 unathi pixel

* fix
2025-09-14 15:23:56 +00:00

95 lines
2.5 KiB
Plaintext

/obj/item/gun/projectile/bow
name = "bow"
desc = "A sturdy bow made out of wood and reinforced with iron."
icon_state = "bow_unloaded"
inhand_icon_state = "bow"
fire_sound = 'sound/weapons/grenadelaunch.ogg'
mag_type = /obj/item/ammo_box/magazine/internal/bow
flags = HANDSLOW
weapon_weight = WEAPON_HEAVY
var/draw_sound = 'sound/weapons/draw_bow.ogg'
var/ready_to_fire = 0
var/slowdown_when_ready = 2
/obj/item/gun/projectile/bow/update_icon_state()
if(magazine.ammo_count() && !ready_to_fire)
icon_state = "bow_loaded"
else if(ready_to_fire)
icon_state = "bow_firing"
slowdown = slowdown_when_ready
else
icon_state = initial(icon_state)
slowdown = initial(slowdown)
/obj/item/gun/projectile/bow/dropped(mob/user)
..()
if(magazine && magazine.ammo_count())
magazine.empty_magazine()
ready_to_fire = FALSE
update_icon()
/obj/item/gun/projectile/bow/attack_self__legacy__attackchain(mob/living/user)
if(!ready_to_fire && magazine.ammo_count())
ready_to_fire = TRUE
playsound(user, draw_sound, 100, 1)
update_icon()
else
ready_to_fire = FALSE
update_icon()
/obj/item/gun/projectile/bow/attackby__legacy__attackchain(obj/item/A, mob/user, params)
var/num_loaded = magazine.attackby__legacy__attackchain(A, user, params, 1)
if(num_loaded)
to_chat(user, "<span class='notice'>You ready \the [A] into \the [src].</span>")
update_icon()
chamber_round()
/obj/item/gun/projectile/bow/can_shoot()
. = ..()
if(!ready_to_fire)
return FALSE
/obj/item/gun/projectile/bow/shoot_with_empty_chamber(mob/living/user as mob|obj)
return
/obj/item/gun/projectile/bow/process_chamber(eject_casing = 0, empty_chamber = 1)
. = ..()
ready_to_fire = FALSE
update_icon()
// ammo
/obj/item/ammo_box/magazine/internal/bow
name = "bow internal magazine"
ammo_type = /obj/item/ammo_casing/caseless/arrow
caliber = "arrow"
max_ammo = 1
/obj/item/projectile/bullet/reusable/arrow
name = "arrow"
icon_state = "arrow"
ammo_type = /obj/item/ammo_casing/caseless/arrow
range = 10
damage = 25
/obj/item/ammo_casing/caseless/arrow
name = "arrow"
desc = "Stab, stab, stab."
icon_state = "arrow"
force = 10
projectile_type = /obj/item/projectile/bullet/reusable/arrow
muzzle_flash_effect = null
caliber = "arrow"
//quiver
/obj/item/storage/backpack/quiver
name = "quiver"
desc = "A quiver for holding arrows."
icon_state = "quiver"
storage_slots = 20
can_hold = list(/obj/item/ammo_casing/caseless/arrow)
/obj/item/storage/backpack/quiver/full/populate_contents()
for(var/i in 1 to storage_slots)
new /obj/item/ammo_casing/caseless/arrow(src)