Picket signs now animate the user and display a runechat emote. (#53100) (#477)

Co-authored-by: uomo <51800976+uomo91@users.noreply.github.com>
This commit is contained in:
SkyratBot
2020-08-23 20:57:50 +02:00
committed by GitHub
co-authored by uomo
parent 6552a2f5ab
commit ad688f08c2
+22 -8
View File
@@ -9,7 +9,7 @@
resistance_flags = FLAMMABLE
var/label = ""
var/last_wave = 0
COOLDOWN_DECLARE(picket_sign_cooldown)
/obj/item/picket_sign/cyborg
name = "metallic nano-sign"
@@ -35,13 +35,27 @@
return ..()
/obj/item/picket_sign/attack_self(mob/living/carbon/human/user)
if( last_wave + 20 < world.time )
last_wave = world.time
if(label)
user.visible_message("<span class='warning'>[user] waves around \the \"[label]\" sign.</span>")
else
user.visible_message("<span class='warning'>[user] waves around blank sign.</span>")
user.changeNext_move(CLICK_CD_MELEE)
if(!COOLDOWN_FINISHED(src, picket_sign_cooldown))
return
COOLDOWN_START(src, picket_sign_cooldown, 5 SECONDS)
if(label)
user.manual_emote("waves around \the \"[label]\" sign.")
else
user.manual_emote("waves around a blank sign.")
var/direction = prob(50) ? -1 : 1
if(NSCOMPONENT(user.dir)) //So signs are waved horizontally relative to what way the player waving it is facing.
animate(user, pixel_x = user.pixel_x + (1 * direction), time = 1, easing = SINE_EASING)
animate(pixel_x = user.pixel_x - (2 * direction), time = 1, easing = SINE_EASING)
animate(pixel_x = user.pixel_x + (2 * direction), time = 1, easing = SINE_EASING)
animate(pixel_x = user.pixel_x - (2 * direction), time = 1, easing = SINE_EASING)
animate(pixel_x = user.pixel_x + (1 * direction), time = 1, easing = SINE_EASING)
else
animate(user, pixel_y = user.pixel_y + (1 * direction), time = 1, easing = SINE_EASING)
animate(pixel_y = user.pixel_y - (2 * direction), time = 1, easing = SINE_EASING)
animate(pixel_y = user.pixel_y + (2 * direction), time = 1, easing = SINE_EASING)
animate(pixel_y = user.pixel_y - (2 * direction), time = 1, easing = SINE_EASING)
animate(pixel_y = user.pixel_y + (1 * direction), time = 1, easing = SINE_EASING)
user.changeNext_move(CLICK_CD_MELEE)
/datum/crafting_recipe/picket_sign
name = "Picket Sign"