diff --git a/hyperstation/code/mobs/dancer.dm b/hyperstation/code/mobs/dancer.dm new file mode 100644 index 00000000..7085f37d --- /dev/null +++ b/hyperstation/code/mobs/dancer.dm @@ -0,0 +1,56 @@ +/mob/living/dancercaptain + name = "Captain Beats" + desc = "A captain cursed to dance for all eternity!" + icon = 'hyperstation/icons/mobs/dancer/captain.dmi' + icon_state = "idle" + var/danceaction = 1 + var/lastaction = 0 //when the last action was! + var/actiontime = 4 + var/list/dancefloor_turfs + var/list/dancefloor_turfs_types + var/dancefloor_exists = FALSE + +/mob/living/dancercaptain/Move(atom/newloc, direct) + + if(!danceaction) + if(!(world.time > lastaction)) + return // no move for you! + + animate(src, pixel_x, pixel_y = pixel_y + 10, time = 0.7, 0) + . = ..() + danceaction = 0 //you did your move + lastaction = world.time+actiontime //next action time + sleep(1) + animate(src, pixel_x, pixel_y = pixel_y - 10, time = 0.7, 0) + sleep(1) + + LAZYINITLIST(dancefloor_turfs) + LAZYINITLIST(dancefloor_turfs_types) + + if(dancefloor_exists) //remove the old one! + dancefloor_exists = FALSE + for(var/i in 1 to dancefloor_turfs.len) + var/turf/T = dancefloor_turfs[i] + T.ChangeTurf(dancefloor_turfs_types[i]) + var/list/funky_turfs = RANGE_TURFS(2, src) + + + dancefloor_exists = TRUE + var/i = 1 + dancefloor_turfs.len = funky_turfs.len + dancefloor_turfs_types.len = funky_turfs.len + for(var/t in funky_turfs) + if(!(istype(t, /turf/closed))) //dont change walls + var/turf/T = t + dancefloor_turfs[i] = T + dancefloor_turfs_types[i] = T.type + T.ChangeTurf((i % 2 == 0) ? /turf/open/floor/light/colour_cycle/dancefloor_a : /turf/open/floor/light/colour_cycle/dancefloor_b) + i++ + + +/mob/living/dancercaptain/Initialize() + . = ..() + + lastaction = round(world.time) //round to the nearest second! to keep in beat! + +/mob/living/dancercaptain/proc/mtimer() \ No newline at end of file diff --git a/hyperstation/icons/mobs/dancer/captain.dmi b/hyperstation/icons/mobs/dancer/captain.dmi new file mode 100644 index 00000000..9814eb93 Binary files /dev/null and b/hyperstation/icons/mobs/dancer/captain.dmi differ diff --git a/tgstation.dme b/tgstation.dme index 63f3f9ed..c946b47d 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -3042,6 +3042,7 @@ #include "hyperstation\code\gamemode\traitor_thief.dm" #include "hyperstation\code\gamemode\werewolf\werewolf.dm" #include "hyperstation\code\mobs\carrion.dm" +#include "hyperstation\code\mobs\dancer.dm" #include "hyperstation\code\mobs\hugbot.dm" #include "hyperstation\code\mobs\mimic.dm" #include "hyperstation\code\mobs\werewolf.dm"