Module change and reset animations for borgs (#3210)

* Added robot module reset and change animation

* changed some procs to more appropriate ones

* removed unnecesary sleep()

* readded intialize proc for_temp_visual
This commit is contained in:
Heroman3003
2018-03-16 20:35:08 -04:00
committed by Aronai Sieyes
parent 961f2934c4
commit 1aef94ae0e
7 changed files with 95 additions and 0 deletions
@@ -267,6 +267,7 @@
return
var/module_type = robot_modules[modtype]
transform_with_anim() //VOREStation edit: sprite animation
new module_type(src)
hands.icon_state = lowertext(modtype)
@@ -970,6 +971,12 @@
icontype = module_sprites[1]
else
icontype = input("Select an icon! [triesleft ? "You have [triesleft] more chance\s." : "This is your last try."]", "Robot Icon", icontype, null) in module_sprites
if(notransform) //VOREStation edit start: sprite animation
to_chat(src, "Your current transformation has not finished yet!")
choose_icon(icon_selection_tries, module_sprites)
return
else
transform_with_anim() //VOREStation edit end: sprite animation
icon_state = module_sprites[icontype]
updateicon()
@@ -0,0 +1,22 @@
/mob/living/silicon/robot/proc/transform_with_anim()
INVOKE_ASYNC(src, .proc/do_transform_animation)
/mob/living/silicon/robot/proc/do_transform_animation()
notransform = TRUE
dir = SOUTH
var/obj/effect/temp_visual/decoy/fading/fivesecond/ANM = new /obj/effect/temp_visual/decoy/fading/fivesecond(loc, src)
ANM.layer = layer - 0.01
new /obj/effect/temp_visual/small_smoke(loc)
alpha = 0
animate(src, alpha = 255, time = 50)
var/prev_lockcharge = lockcharge
SetLockdown(1)
anchored = TRUE
sleep(2)
for(var/i in 1 to 6)
playsound(src, pick('sound/items/drill_use.ogg', 'sound/items/jaws_cut.ogg', 'sound/items/jaws_pry.ogg', 'sound/items/Welder.ogg', 'sound/items/Wirecutter.ogg', 'sound/items/Crowbar.ogg', 'sound/items/Ratchet.ogg'), 80, 1, -1)
sleep(8)
if(!prev_lockcharge)
SetLockdown(0)
anchored = FALSE
notransform = FALSE
@@ -7,6 +7,7 @@
var/leap_at
var/dogborg = FALSE //Dogborg special features (overlays etc.)
var/wideborg = FALSE //When the borg simply doesn't use standard 32p size.
var/notransform
var/original_icon = 'icons/mob/robots.dmi'
var/ui_style_vr = FALSE //Do we use our hud icons?
var/vr_icons = list(