From f0a5f26032cf551dfd240d10d42c6c6ba515647f Mon Sep 17 00:00:00 2001 From: Aronai Sieyes Date: Thu, 15 Jul 2021 17:52:31 -0400 Subject: [PATCH] Add a couple bows --- .../modules/projectiles/guns/launcher/bows.dm | 123 ++++++++++++++++++ icons/obj/guns/projectile/bows.dmi | Bin 0 -> 4460 bytes 2 files changed, 123 insertions(+) create mode 100644 code/modules/projectiles/guns/launcher/bows.dm create mode 100644 icons/obj/guns/projectile/bows.dmi diff --git a/code/modules/projectiles/guns/launcher/bows.dm b/code/modules/projectiles/guns/launcher/bows.dm new file mode 100644 index 00000000000..3df5d1de498 --- /dev/null +++ b/code/modules/projectiles/guns/launcher/bows.dm @@ -0,0 +1,123 @@ +/obj/item/weapon/arrow/standard + name = "arrow" + desc = "It's got a tip for you - get the point?" + icon = 'icons/obj/guns/projectile/bows.dmi' + icon_state = "arrow" + item_state = "bolt" + throwforce = 8 + w_class = ITEMSIZE_NORMAL + sharp = 1 + edge = 0 + +/obj/item/weapon/arrow/energy + name = "hardlight arrow" + desc = "An arrow made out of energy! Classic?" + icon = 'icons/obj/guns/projectile/bows.dmi' + icon_state = "hardlight" + item_state = "bolt" + throwforce = 10 + w_class = ITEMSIZE_NORMAL + sharp = 0 + edge = 1 + +/obj/item/weapon/arrow/energy/throw_impact(atom/hit_atom) + . = ..() + qdel(src) + +/obj/item/weapon/gun/launcher/crossbow/bow + name = "shortbow" + desc = "A common shortbow, capable of firing arrows at high speed towards a target. Useful for hunting while keeping quiet." + icon = 'icons/obj/guns/projectile/bows.dmi' + icon_override = 'icons/obj/guns/projectile/bows.dmi' + icon_state = "bow" + item_state = "bow" + fire_sound = 'sound/weapons/punchmiss.ogg' // TODO: Decent THWOK noise. + fire_sound_text = "a solid thunk" + fire_delay = 25 + slot_flags = SLOT_BACK + tension = 3 + var/drawn = FALSE + +/obj/item/weapon/gun/launcher/crossbow/bow/proc/unload(mob/user) + var/obj/item/weapon/arrow/A = bolt + bolt = null + drawn = FALSE + A.forceMove(get_turf(user)) + user.put_in_hands(A) + +/obj/item/weapon/gun/launcher/crossbow/bow/consume_next_projectile(mob/user) + if(!drawn) + to_chat(user, "\The [src] is not drawn back!") + return null + return bolt + +/obj/item/weapon/gun/launcher/crossbow/bow/handle_post_fire(mob/user, atom/target) + bolt = null + drawn = FALSE + update_icon() + ..() + +/obj/item/weapon/gun/launcher/crossbow/bow/attack_self(mob/living/user) + if(bolt) + user.visible_message("[user] relaxes the tension on [src]'s string and removes [bolt].","You relax the tension on [src]'s string and remove [bolt].") + unload(user) + update_icon() + else + draw(user) + +/obj/item/weapon/gun/launcher/crossbow/bow/draw(var/mob/user) + if(!bolt) + to_chat(user, "You don't have anything nocked to [src].") + return + + if(user.restrained()) + return + + current_user = user + user.visible_message("[user] begins to draw back the string of [src].","You begin to draw back the string of [src].") + + if(do_after(user, 25, src, exclusive = TASK_ALL_EXCLUSIVE)) + drawn = TRUE + user.visible_message("[user] draws the string on [src] back fully!", "You draw the string on [src] back fully!") + else + user.visible_message("[user] stops drawing and relaxes the string of [src].","You stop drawing back and relax the string of [src].") + drawn = FALSE + update_icon() + +/obj/item/weapon/gun/launcher/crossbow/bow/attackby(obj/item/W as obj, mob/user) + if(!bolt && istype(W,/obj/item/weapon/arrow/standard)) + user.drop_from_inventory(W, src) + bolt = W + user.visible_message("[user] slides [bolt] into [src].","You slide [bolt] into [src].") + update_icon() + +/obj/item/weapon/gun/launcher/crossbow/bow/update_icon() + if(drawn) + icon_state = "[initial(icon_state)]_firing" + else if(bolt) + icon_state = "[initial(icon_state)]_loaded" + else + icon_state = "[initial(icon_state)]" + + + +/obj/item/weapon/gun/launcher/crossbow/bow/hardlight + name = "hardlight bow" + icon_state = "bow_hardlight" + item_state = "bow_hardlight" + desc = "An energy bow, capable of producing arrows from an internal power supply." + +/obj/item/weapon/gun/launcher/crossbow/bow/hardlight/unload(mob/user) + qdel_null(bolt) + +/obj/item/weapon/gun/launcher/crossbow/bow/hardlight/attack_self(mob/living/user) + if(drawn) + user.visible_message("[user] relaxes the tension on [src]'s string.","You relax the tension on [src]'s string.") + drawn = FALSE + update_icon() + else if(!bolt) + user.visible_message("[user] fabricates a new hardlight projectile with [src].","You fabricate a new hardlight projectile with [src].") + bolt = new /obj/item/weapon/arrow/energy(src) + update_icon() + else + draw(user) diff --git a/icons/obj/guns/projectile/bows.dmi b/icons/obj/guns/projectile/bows.dmi new file mode 100644 index 0000000000000000000000000000000000000000..3d3494bfd260cf8b3e9da1f7955691ea99e1680a GIT binary patch literal 4460 zcmbVQXEfa1xBlt9cOrTpH9`=EyrbpSNrI>mGD?UVi8f*ghKPtLF=mvB8Vo@Y28rH7 zl+j0v7QJR<{__8H*ShO|xgXBi>pW}iXFX@{v-er&Bv_akGSTzX0|3BeYy`2owCKNs zmilr=3_X&+G!4&fY=a=~fo=hwPl7!Cd;uUdCp{HQAEU$?x3(<9?1&kY4eGTL?a*`1 zD-_SB@a~luo7h=!(VCQ;77Tw%qKRV8Sj8U;H@(9#J`1`=Tg+lO$UWBf0=Drj>-r6R zm4Z&Oi>_|S(| zU+qsVWd*l^9RaeH2I;c=^GLk}y(VI%us-L={=7l}^f_I%_nCmTLtXGjuG~a$~*N}q^PZr66 zh26!klMR7u8#q8oOAC>gC*m{P$d&NTLxfFmX zxY8mTdEu|&^(UDi7h}3RUx|Qqc7mfCo?)K7Wu0RCuSztYZi2wDc|L&j+dA|}bq8Tn z0JMGc3&?|OWPs_McJ#;hHxn*(g%BuU!EUXwHdlW;l`at77r^rt?LKRYmBIZP^FOwR zm86}!ty^A8=~SH{K!1e-N*SNY?(dZ}Mh31~AIUDQu3j)OFcjad{L3!i1XgfmwdK;I zB&u@=xv&cZ{r&w5ukyZNt_2$A;2bvLkEiQgr|TYPW@YJFuq7UY=TgYXS7ED!w3Yb; z1|EflB~oO(9}g~gc3oFqGdX$t>(&;CJz)TV6#+i3ff68xm}%PXiya4tn=*J@+9|+5 z*4W0&_3rn$=4OA^wLFmb=c7x`=yV0OE{8<(Po&=UL^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