mirror of
https://github.com/VOREStation/VOREStation.git
synced 2026-08-29 06:58:30 +01:00
Merge pull request #9200 from mwerezak/tail-swish
Tail swish animations, tail icon caching
This commit is contained in:
@@ -34,7 +34,8 @@
|
||||
handle_hud_list()
|
||||
|
||||
//Handle species-specific deaths.
|
||||
if(species) species.handle_death(src)
|
||||
species.handle_death(src)
|
||||
animate_tail_stop()
|
||||
|
||||
//Handle brain slugs.
|
||||
var/obj/item/organ/external/head = get_organ("head")
|
||||
|
||||
@@ -541,8 +541,24 @@
|
||||
message = "<B>[src]</B> makes a very loud noise."
|
||||
m_type = 2
|
||||
|
||||
if("swish")
|
||||
src.animate_tail_once()
|
||||
|
||||
if("wag", "sway")
|
||||
src.animate_tail_start()
|
||||
|
||||
if("qwag", "fastsway")
|
||||
src.animate_tail_fast()
|
||||
|
||||
if("swag", "stopsway")
|
||||
src.animate_tail_stop()
|
||||
|
||||
if ("help")
|
||||
src << "blink, blink_r, blush, bow-(none)/mob, burp, choke, chuckle, clap, collapse, cough,\ncry, custom, deathgasp, drool, eyebrow, frown, gasp, giggle, groan, grumble, handshake, hug-(none)/mob, glare-(none)/mob,\ngrin, laugh, look-(none)/mob, moan, mumble, nod, pale, point-atom, raise, salute, shake, shiver, shrug,\nsigh, signal-#1-10, smile, sneeze, sniff, snore, stare-(none)/mob, tremble, twitch, twitch_s, whimper,\nwink, yawn"
|
||||
src << {"blink, blink_r, blush, bow-(none)/mob, burp, choke, chuckle, clap, collapse, cough,
|
||||
cry, custom, deathgasp, drool, eyebrow, frown, gasp, giggle, groan, grumble, handshake, hug-(none)/mob, glare-(none)/mob,
|
||||
grin, laugh, look-(none)/mob, moan, mumble, nod, pale, point-atom, raise, salute, shake, shiver, shrug,
|
||||
sigh, signal-#1-10, smile, sneeze, sniff, snore, stare-(none)/mob, tremble, twitch, twitch_s, whimper,
|
||||
wink, yawn, swish, sway/wag, fastsway/qwag, stopsway/swag"}
|
||||
|
||||
else
|
||||
src << "\blue Unusable emote '[act]'. Say *help for a list."
|
||||
|
||||
@@ -992,6 +992,7 @@
|
||||
AdjustParalysis(-1)
|
||||
blinded = 1
|
||||
stat = UNCONSCIOUS
|
||||
animate_tail_reset()
|
||||
if(halloss > 0)
|
||||
adjustHalLoss(-3)
|
||||
else if(sleeping)
|
||||
@@ -1006,6 +1007,7 @@
|
||||
sleeping = max(sleeping-1, 0)
|
||||
blinded = 1
|
||||
stat = UNCONSCIOUS
|
||||
animate_tail_reset()
|
||||
if( prob(2) && health && !hal_crit )
|
||||
spawn(0)
|
||||
emote("snore")
|
||||
|
||||
@@ -23,7 +23,8 @@
|
||||
var/blood_color = "#A10808" // Red.
|
||||
var/flesh_color = "#FFC896" // Pink.
|
||||
var/base_color // Used by changelings. Should also be used for icon previes..
|
||||
var/tail // Name of tail image in species effects icon file.
|
||||
var/tail // Name of tail state in species effects icon file.
|
||||
var/tail_animation // If set, the icon to obtain tail animation states from.
|
||||
var/race_key = 0 // Used for mob icon cache string.
|
||||
var/icon/icon_template // Used for mob icon generation for non-32x32 species.
|
||||
var/is_small
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
deform = 'icons/mob/human_races/r_def_lizard.dmi'
|
||||
language = "Sinta'unathi"
|
||||
tail = "sogtail"
|
||||
tail_animation = 'icons/mob/species/unathi/tail.dmi'
|
||||
unarmed_types = list(/datum/unarmed_attack/stomp, /datum/unarmed_attack/kick, /datum/unarmed_attack/claws, /datum/unarmed_attack/bite/sharp)
|
||||
primitive_form = "Stok"
|
||||
darksight = 3
|
||||
@@ -70,6 +71,7 @@
|
||||
deform = 'icons/mob/human_races/r_def_tajaran.dmi'
|
||||
language = "Siik'tajr"
|
||||
tail = "tajtail"
|
||||
tail_animation = 'icons/mob/species/tajaran/tail.dmi'
|
||||
unarmed_types = list(/datum/unarmed_attack/stomp, /datum/unarmed_attack/kick, /datum/unarmed_attack/claws, /datum/unarmed_attack/bite/sharp)
|
||||
darksight = 8
|
||||
slowdown = -1
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
icon_key is [species.race_key][g][husk][fat][hulk][skeleton][s_tone]
|
||||
*/
|
||||
var/global/list/human_icon_cache = list()
|
||||
var/global/list/tail_icon_cache = list() //key is [species.race_key][r_skin][g_skin][b_skin]
|
||||
var/global/list/light_overlay_cache = list()
|
||||
|
||||
///////////////////////
|
||||
@@ -883,13 +884,81 @@ var/global/list/damage_icon_parts = list()
|
||||
/mob/living/carbon/human/proc/update_tail_showing(var/update_icons=1)
|
||||
overlays_standing[TAIL_LAYER] = null
|
||||
|
||||
if(species.tail)
|
||||
if(!wear_suit || !(wear_suit.flags_inv & HIDETAIL) && !istype(wear_suit, /obj/item/clothing/suit/space))
|
||||
var/icon/tail_s = new/icon("icon" = 'icons/effects/species.dmi', "icon_state" = "[species.tail]_s")
|
||||
tail_s.Blend(rgb(r_skin, g_skin, b_skin), ICON_ADD)
|
||||
if(species.tail && !(wear_suit && wear_suit.flags_inv & HIDETAIL))
|
||||
var/icon/tail_s = get_tail_icon()
|
||||
overlays_standing[TAIL_LAYER] = image(tail_s, icon_state = "[species.tail]_s")
|
||||
animate_tail_reset(0)
|
||||
|
||||
overlays_standing[TAIL_LAYER] = image(tail_s)
|
||||
if(update_icons)
|
||||
update_icons()
|
||||
|
||||
/mob/living/carbon/human/proc/get_tail_icon()
|
||||
var/icon_key = "[species.race_key][r_skin][g_skin][b_skin]"
|
||||
|
||||
var/icon/tail_icon = tail_icon_cache[icon_key]
|
||||
if(!tail_icon)
|
||||
|
||||
//generate a new one
|
||||
tail_icon = new/icon(icon = (species.tail_animation? species.tail_animation : 'icons/effects/species.dmi'))
|
||||
tail_icon.Blend(rgb(r_skin, g_skin, b_skin), ICON_ADD)
|
||||
|
||||
tail_icon_cache[icon_key] = tail_icon
|
||||
|
||||
return tail_icon
|
||||
|
||||
|
||||
/mob/living/carbon/human/proc/set_tail_state(var/t_state)
|
||||
var/image/tail_overlay = overlays_standing[TAIL_LAYER]
|
||||
|
||||
if(tail_overlay && species.tail_animation)
|
||||
tail_overlay.icon_state = t_state
|
||||
return tail_overlay
|
||||
return null
|
||||
|
||||
//Not really once, since BYOND can't do that.
|
||||
//Update this if the ability to flick() images or make looping animation start at the first frame is ever added.
|
||||
/mob/living/carbon/human/proc/animate_tail_once(var/update_icons=1)
|
||||
var/t_state = "[species.tail]_once"
|
||||
|
||||
var/image/tail_overlay = overlays_standing[TAIL_LAYER]
|
||||
if(tail_overlay && tail_overlay.icon_state == t_state)
|
||||
return //let the existing animation finish
|
||||
|
||||
tail_overlay = set_tail_state(t_state)
|
||||
if(tail_overlay)
|
||||
spawn(15)
|
||||
//check that the animation hasn't changed in the meantime
|
||||
if(overlays_standing[TAIL_LAYER] == tail_overlay && tail_overlay.icon_state == t_state)
|
||||
animate_tail_stop()
|
||||
|
||||
if(update_icons)
|
||||
update_icons()
|
||||
|
||||
/mob/living/carbon/human/proc/animate_tail_start(var/update_icons=1)
|
||||
set_tail_state("[species.tail]_slow[rand(0,9)]")
|
||||
|
||||
if(update_icons)
|
||||
update_icons()
|
||||
|
||||
/mob/living/carbon/human/proc/animate_tail_fast(var/update_icons=1)
|
||||
set_tail_state("[species.tail]_loop[rand(0,9)]")
|
||||
|
||||
if(update_icons)
|
||||
update_icons()
|
||||
|
||||
/mob/living/carbon/human/proc/animate_tail_reset(var/update_icons=1)
|
||||
if(stat != DEAD)
|
||||
set_tail_state("[species.tail]_idle[rand(0,9)]")
|
||||
else
|
||||
set_tail_state("[species.tail]_static")
|
||||
|
||||
|
||||
if(update_icons)
|
||||
update_icons()
|
||||
|
||||
/mob/living/carbon/human/proc/animate_tail_stop(var/update_icons=1)
|
||||
set_tail_state("[species.tail]_static")
|
||||
|
||||
if(update_icons)
|
||||
update_icons()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user