Skip to content

Commit

Permalink
Small Fragment visual update (#1746)
Browse files Browse the repository at this point in the history
* saving

* adds the actual particles and unroughens the animation a bit

* sprite update + temp changes for rebase

* adds fadeout, slightly changes the animation to not bob as much, also fixes linters

* fix animation hiccup

* reduces swaying
  • Loading branch information
TaculoTaculo authored Dec 20, 2023
1 parent f5b35f1 commit 8cebda6
Show file tree
Hide file tree
Showing 4 changed files with 88 additions and 2 deletions.
Binary file modified ModularTegustation/Teguicons/32x48.dmi
Binary file not shown.
Binary file modified ModularTegustation/Teguicons/tegu_effects.dmi
Binary file not shown.
36 changes: 36 additions & 0 deletions code/game/objects/effects/particles/particles.dm
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,34 @@
color_change = 1
drift = generator("vector", list(-0.1, -0.1), list(0.1, 0.1))

/particles/fragment_note
icon = 'ModularTegustation/Teguicons/tegu_effects.dmi'
icon_state = "fragment_note"
width = 96
height = 96
count = 30
spawning = 1
lifespan = 6
fade = 2
velocity = generator("circle", 10, 15)
friction = 0.25

/particles/fragment_song
icon = 'ModularTegustation/Teguicons/tegu_effects.dmi'
icon_state = list("fragment_song_small","fragment_song_medium","fragment_song_large")
width = 128
height = 128
count = 30
spawning = 2
lifespan = 12
fadein = 6
fade = 6
velocity = generator("circle", -5, 5, NORMAL_RAND)
rotation = generator("num", -120, 120)
spin = generator("num", -20, 20)
grow = list(0.2,0.2)
friction = 0.6

/* Particle emitter objects */

/obj/particle_emitter
Expand Down Expand Up @@ -156,3 +184,11 @@
/obj/particle_emitter/smoke/Initialize(mapload, time, _color)
. = ..()
filters = filter(type="blur", size=1.5)

/obj/particle_emitter/fragment_note
layer = MOB_LAYER+1
particles = new/particles/fragment_note

/obj/particle_emitter/fragment_song
layer = MOB_LAYER+1
particles = new/particles/fragment_song
54 changes: 52 additions & 2 deletions code/modules/mob/living/simple_animal/abnormality/teth/fragment.dm
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,14 @@
abnormality_origin = ABNORMALITY_ORIGIN_LOBOTOMY
var/song_cooldown
var/song_cooldown_time = 10 SECONDS
var/song_damage = 4 // Dealt 8 times
var/song_damage = 5 // Dealt 8 times
var/can_act = TRUE

//Visual/Animation Vars
var/obj/effect/fragment_legs/legs
var/obj/particle_emitter/fragment_note/particle_note
var/obj/particle_emitter/fragment_song/particle_song

//PLAYABLES ACTIONS
attack_action_types = list(/datum/action/cooldown/fragment_song)

Expand All @@ -64,6 +69,11 @@
fragment.song()
return TRUE

/mob/living/simple_animal/hostile/abnormality/fragment/Destroy()
QDEL_NULL(legs)
particle_note.fadeout()
particle_song.fadeout()
return ..()

/mob/living/simple_animal/hostile/abnormality/fragment/Move()
if(!can_act)
Expand All @@ -81,16 +91,46 @@
if(song_cooldown > world.time)
return
can_act = FALSE
flick("fragment_song_transition" , src)
SLEEP_CHECK_DEATH(5)

legs = new(get_turf(src))
icon_state = "fragment_song_head"
pixel_y = 5
particle_note = new(get_turf(src))
particle_note.pixel_y = 26
particle_song = new(get_turf(src))
particle_song.pixel_y = 26
playsound(get_turf(src), 'sound/abnormalities/fragment/sing.ogg', 50, 0, 4)
for(var/i = 1 to 8)
new /obj/effect/temp_visual/fragment_song(get_turf(src))
//Animation for bobbing the head left to right
switch(i)
if(1)
animate(src, transform = turn(matrix(), -30), time = 6, flags = SINE_EASING | EASE_OUT )
if(3)
animate(src, transform = turn(matrix(), 0), time = 6, flags = SINE_EASING | EASE_IN | EASE_OUT )
if(5)
animate(src, transform = turn(matrix(), 30), time = 6, flags = SINE_EASING | EASE_IN | EASE_OUT )
if(7)
animate(src, transform = turn(matrix(), 0), time = 6, flags = SINE_EASING | EASE_IN )
//Animation -END-

for(var/mob/living/L in view(8, src))
if(faction_check_mob(L, FALSE))
continue
if(L.stat == DEAD)
continue
L.apply_damage(song_damage, WHITE_DAMAGE, null, L.run_armor_check(null, WHITE_DAMAGE), spread_damage = TRUE)
SLEEP_CHECK_DEATH(3)

animate(src, pixel_y = 0, time = 0)
flick("fragment_song_transition" , src)
SLEEP_CHECK_DEATH(5)
icon_state = "fragment_breach"
pixel_y = 0
QDEL_NULL(legs)
particle_note.fadeout()
particle_song.fadeout()
can_act = TRUE
song_cooldown = world.time + song_cooldown_time

Expand Down Expand Up @@ -121,4 +161,14 @@
icon_state = "fragment_breach"
icon_living = icon_state

//Exists so the head can be animated separatedly from the legs when it sings
/obj/effect/fragment_legs
name = "Fragment of the Universe"
desc = "An abnormality taking form of a black ball covered by 'hearts' of different colors."
icon = 'ModularTegustation/Teguicons/32x48.dmi'
icon_state = "fragment_song_legs"
move_force = INFINITY
pull_force = INFINITY
mouse_opacity = MOUSE_OPACITY_TRANSPARENT

#undef FRAGMENT_SONG_COOLDOWN

0 comments on commit 8cebda6

Please sign in to comment.