diff --git a/code/modules/projectiles/guns/projectile/crossbow.dm b/code/modules/projectiles/guns/projectile/crossbow.dm index f59fce1137..3d3e2f6d86 100644 --- a/code/modules/projectiles/guns/projectile/crossbow.dm +++ b/code/modules/projectiles/guns/projectile/crossbow.dm @@ -102,24 +102,31 @@ 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].") + user.visible_message("[user] begins to draw back the string of [src].","You begin to draw back the string of [src].") tension = 1 - spawn(25) increase_tension(user) //TODO: This needs to be changed to something less shit. + + while(bolt && tension && current_user == user) + if(!do_after(user, 25)) //crossbow strings don't just magically pull back on their own. + user.visible_message("[usr] stops drawing and relaxes the string of [src].","You stop drawing back and relax the string of [src].") + tension = 0 + icon_state = "crossbow" + return + + tension++ + icon_state = "crossbow-drawn" + + if(tension >= max_tension) + tension = max_tension + usr << "[src] clunks as you draw the string to its maximum tension!" + return + + user.visible_message("[usr] draws back the string of [src]!","You continue drawing back the string of [src]!") /obj/item/weapon/gun/launcher/crossbow/proc/increase_tension(var/mob/user as mob) if(!bolt || !tension || current_user != user) //Arrow has been fired, bow has been relaxed or user has changed. return - tension++ - icon_state = "crossbow-drawn" - - if(tension>=max_tension) - tension = max_tension - usr << "[src] clunks as you draw the string to its maximum tension!" - else - user.visible_message("[usr] draws back the string of [src]!","You continue drawing back the string of [src]!") - spawn(25) increase_tension(user) /obj/item/weapon/gun/launcher/crossbow/attackby(obj/item/W as obj, mob/user as mob) if(!bolt)