Skip to content

Commit

Permalink
Tweaking to skeletal tails and icons.
Browse files Browse the repository at this point in the history
  • Loading branch information
MistakeNot4892 authored and comma committed Jun 22, 2024
1 parent db65720 commit ff918ce
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 7 deletions.
22 changes: 15 additions & 7 deletions code/modules/mob/living/human/update_icons.dm
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ Please contact me on #coderbus IRC. ~Carn x
// We are somehow updating with no torso, or a torso with no bodytype (probably gibbing). No point continuing.
if(!root_bodytype)
return

var/matrix/M = matrix()
if(current_posture?.prone && (root_bodytype.prone_overlay_offset[1] || root_bodytype.prone_overlay_offset[2]))
M.Translate(root_bodytype.prone_overlay_offset[1], root_bodytype.prone_overlay_offset[2])
Expand Down Expand Up @@ -412,6 +412,14 @@ Please contact me on #coderbus IRC. ~Carn x
return

var/tail_state = tail_organ.get_tail()
if(tail_organ.limb_flags & ORGAN_FLAG_SKELETAL)
if(!tail_organ.bodytype?.skeletal_icon)
return
var/tail_cache_key = "[tail_state][tail_organ.bodytype.skeletal_icon]_skeletal"
if(!global.tail_icon_cache[tail_cache_key])
global.tail_icon_cache[tail_cache_key] = icon(tail_organ.bodytype.skeletal_icon, tail_state)
return global.tail_icon_cache[tail_cache_key]

var/tail_icon = tail_organ.get_tail_icon()
if(!tail_state || !tail_icon)
return // No tail data!
Expand Down Expand Up @@ -451,7 +459,7 @@ Please contact me on #coderbus IRC. ~Carn x

/mob/living/human/proc/set_tail_state(var/t_state)
var/obj/item/organ/external/tail/tail_organ = get_organ(BP_TAIL, /obj/item/organ/external/tail)
if(!tail_organ)
if(!tail_organ || (tail_organ.limb_flags & ORGAN_FLAG_SKELETAL))
return null
var/image/tail_overlay = get_current_tail_image()
if(tail_overlay && check_state_in_icon(tail_overlay.icon, t_state))
Expand All @@ -465,7 +473,7 @@ Please contact me on #coderbus IRC. ~Carn x

/mob/living/human/proc/animate_tail_once(var/update_icons=1)
var/obj/item/organ/external/tail/tail_organ = get_organ(BP_TAIL, /obj/item/organ/external/tail)
if(!tail_organ)
if(!tail_organ || (tail_organ.limb_flags & ORGAN_FLAG_SKELETAL))
return
var/t_state = "[tail_organ.get_tail()]_once"

Expand All @@ -486,7 +494,7 @@ Please contact me on #coderbus IRC. ~Carn x

/mob/living/human/proc/animate_tail_start(var/update_icons=1)
var/obj/item/organ/external/tail/tail_organ = get_organ(BP_TAIL, /obj/item/organ/external/tail)
if(!tail_organ)
if(!tail_organ || (tail_organ.limb_flags & ORGAN_FLAG_SKELETAL))
return
var/tail_states = tail_organ.get_tail_states()
if(tail_states)
Expand All @@ -496,7 +504,7 @@ Please contact me on #coderbus IRC. ~Carn x

/mob/living/human/proc/animate_tail_fast(var/update_icons=1)
var/obj/item/organ/external/tail/tail_organ = get_organ(BP_TAIL, /obj/item/organ/external/tail)
if(!tail_organ)
if(!tail_organ || (tail_organ.limb_flags & ORGAN_FLAG_SKELETAL))
return
var/tail_states = tail_organ.get_tail_states()
if(tail_states)
Expand All @@ -506,7 +514,7 @@ Please contact me on #coderbus IRC. ~Carn x

/mob/living/human/proc/animate_tail_reset(var/update_icons=1)
var/obj/item/organ/external/tail/tail_organ = get_organ(BP_TAIL, /obj/item/organ/external/tail)
if(!tail_organ)
if(!tail_organ || (tail_organ.limb_flags & ORGAN_FLAG_SKELETAL))
return
var/tail_states = tail_organ.get_tail_states(src)
if(stat != DEAD && tail_states)
Expand All @@ -519,7 +527,7 @@ Please contact me on #coderbus IRC. ~Carn x

/mob/living/human/proc/animate_tail_stop(var/update_icons=1)
var/obj/item/organ/external/tail/tail_organ = get_organ(BP_TAIL, /obj/item/organ/external/tail)
if(!tail_organ)
if(!tail_organ || (tail_organ.limb_flags & ORGAN_FLAG_SKELETAL))
return
set_tail_state("[tail_organ.get_tail()]_static")

Expand Down
4 changes: 4 additions & 0 deletions code/modules/organs/external/tail.dm
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@
/// How many random tail states are available for animations.
var/tail_states = 1

/obj/item/organ/external/tail/skeletonize()
. = ..()
owner?.update_tail_showing()

/obj/item/organ/external/tail/do_uninstall(in_place, detach, ignore_children, update_icon)
var/mob/living/human/H = owner
if(!(. = ..()))
Expand Down
Binary file modified mods/species/drakes/icons/skeleton.dmi
Binary file not shown.

0 comments on commit ff918ce

Please sign in to comment.