mirror of
https://github.com/VOREStation/VOREStation.git
synced 2026-07-15 00:54:16 +01:00
Crossbow strings no longer magically pull back by themselves
This commit is contained in:
@@ -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].","<span class='notice'>You begin to draw back the string of [src].</span>")
|
||||
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].","<span class='warning'>You stop drawing back and relax the string of [src].</span>")
|
||||
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]!","<span class='notice'>You continue drawing back the string of [src]!</span>")
|
||||
|
||||
/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)
|
||||
|
||||
Reference in New Issue
Block a user