From 1aef94ae0ec03b0095fd45430c13af31a01fbe3a Mon Sep 17 00:00:00 2001 From: Heroman3003 <31296024+Heroman3003@users.noreply.github.com> Date: Sat, 17 Mar 2018 10:35:08 +1000 Subject: [PATCH] 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 --- .../temporary_visuials/miscellaneous.dm | 25 +++++++++++++ .../temporary_visuials/temproary_visual.dm | 36 +++++++++++++++++++ .../objects/items/robot/robot_upgrades.dm | 1 + .../modules/mob/living/silicon/robot/robot.dm | 7 ++++ .../silicon/robot/robot_animation_vr.dm | 22 ++++++++++++ .../mob/living/silicon/robot/robot_vr.dm | 1 + vorestation.dme | 3 ++ 7 files changed, 95 insertions(+) create mode 100644 code/game/objects/effects/temporary_visuials/miscellaneous.dm create mode 100644 code/game/objects/effects/temporary_visuials/temproary_visual.dm create mode 100644 code/modules/mob/living/silicon/robot/robot_animation_vr.dm diff --git a/code/game/objects/effects/temporary_visuials/miscellaneous.dm b/code/game/objects/effects/temporary_visuials/miscellaneous.dm new file mode 100644 index 00000000000..eba5ff59ad9 --- /dev/null +++ b/code/game/objects/effects/temporary_visuials/miscellaneous.dm @@ -0,0 +1,25 @@ +/obj/effect/temp_visual/decoy + desc = "It's a decoy!" + duration = 15 + +/obj/effect/temp_visual/decoy/initialize(mapload, atom/mimiced_atom, var/customappearance) + . = ..() + alpha = initial(alpha) + if(mimiced_atom) + name = mimiced_atom.name + appearance = mimiced_atom.appearance + set_dir(mimiced_atom.dir) + mouse_opacity = 0 + if(customappearance) + appearance = customappearance + +/obj/effect/temp_visual/decoy/fading/initialize(mapload, atom/mimiced_atom) + . = ..() + animate(src, alpha = 0, time = duration) + +/obj/effect/temp_visual/decoy/fading/fivesecond + duration = 50 + +/obj/effect/temp_visual/small_smoke + icon_state = "smoke" + duration = 50 \ No newline at end of file diff --git a/code/game/objects/effects/temporary_visuials/temproary_visual.dm b/code/game/objects/effects/temporary_visuials/temproary_visual.dm new file mode 100644 index 00000000000..9beda4cac30 --- /dev/null +++ b/code/game/objects/effects/temporary_visuials/temproary_visual.dm @@ -0,0 +1,36 @@ +//temporary visual effects +/obj/effect/temp_visual + icon = 'icons/effects/effects.dmi' + icon_state = "nothing" + anchored = TRUE + layer = ABOVE_MOB_LAYER + mouse_opacity = 0 + var/duration = 10 //in deciseconds + var/randomdir = TRUE + +/obj/effect/temp_visual/initialize() + . = ..() + if(randomdir) + set_dir(pick(global.cardinal)) + + spawn(duration) + qdel(src) + +/obj/effect/temp_visual/singularity_act() + return + +/obj/effect/temp_visual/singularity_pull() + return + +/obj/effect/temp_visual/ex_act() + return + +/* +/obj/effect/temp_visual/dir_setting + randomdir = FALSE + +/obj/effect/temp_visual/dir_setting/Initialize(mapload, set_dir) + if(set_dir) + setDir(set_dir) + . = ..() +*/ //More tg stuff that might be useful later diff --git a/code/game/objects/items/robot/robot_upgrades.dm b/code/game/objects/items/robot/robot_upgrades.dm index 63a2ea474e3..1211aa6fbac 100644 --- a/code/game/objects/items/robot/robot_upgrades.dm +++ b/code/game/objects/items/robot/robot_upgrades.dm @@ -26,6 +26,7 @@ /obj/item/borg/upgrade/reset/action(var/mob/living/silicon/robot/R) if(..()) return 0 + R.transform_with_anim() //VOREStation edit: sprite animation R.uneq_all() R.modtype = initial(R.modtype) R.hands.icon_state = initial(R.hands.icon_state) diff --git a/code/modules/mob/living/silicon/robot/robot.dm b/code/modules/mob/living/silicon/robot/robot.dm index 09f8b658a76..063398c139c 100644 --- a/code/modules/mob/living/silicon/robot/robot.dm +++ b/code/modules/mob/living/silicon/robot/robot.dm @@ -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() diff --git a/code/modules/mob/living/silicon/robot/robot_animation_vr.dm b/code/modules/mob/living/silicon/robot/robot_animation_vr.dm new file mode 100644 index 00000000000..f69b1049cd9 --- /dev/null +++ b/code/modules/mob/living/silicon/robot/robot_animation_vr.dm @@ -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 \ No newline at end of file diff --git a/code/modules/mob/living/silicon/robot/robot_vr.dm b/code/modules/mob/living/silicon/robot/robot_vr.dm index bcec8d6431c..b528bdfd47e 100644 --- a/code/modules/mob/living/silicon/robot/robot_vr.dm +++ b/code/modules/mob/living/silicon/robot/robot_vr.dm @@ -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( diff --git a/vorestation.dme b/vorestation.dme index d05a617ad08..ff9301cae68 100644 --- a/vorestation.dme +++ b/vorestation.dme @@ -904,6 +904,8 @@ #include "code\game\objects\effects\decals\posters\polarisposters.dm" #include "code\game\objects\effects\spawners\bombspawner.dm" #include "code\game\objects\effects\spawners\gibspawner.dm" +#include "code\game\objects\effects\temporary_visuials\miscellaneous.dm" +#include "code\game\objects\effects\temporary_visuials\temproary_visual.dm" #include "code\game\objects\items\antag_spawners.dm" #include "code\game\objects\items\apc_frame.dm" #include "code\game\objects\items\blueprints.dm" @@ -2082,6 +2084,7 @@ #include "code\modules\mob\living\silicon\robot\login.dm" #include "code\modules\mob\living\silicon\robot\photos.dm" #include "code\modules\mob\living\silicon\robot\robot.dm" +#include "code\modules\mob\living\silicon\robot\robot_animation_vr.dm" #include "code\modules\mob\living\silicon\robot\robot_damage.dm" #include "code\modules\mob\living\silicon\robot\robot_items.dm" #include "code\modules\mob\living\silicon\robot\robot_movement.dm"