Give space dragon ability to make it's sprite small (#65311)

About The Pull Request

Allows space dragon to replace it's sprite with a carp sprite like the xeno queen can turn it's sprite into a drone.

This means only the dragon sees itself as small. Others still see it as giant.
Why It's Good For The Game

The space dragon sprite is pretty big, so you can't attack stuff directly north of you. This solves that.
Changelog

cl
qol: space dragon can now make it's sprite smaller
/cl
This commit is contained in:
ivanmixo
2022-04-01 09:58:50 +13:00
committed by GitHub
parent 82164a265d
commit 4598a40ee8
2 changed files with 16 additions and 3 deletions
+7 -3
View File
@@ -867,7 +867,7 @@
//Small sprites
/datum/action/small_sprite
name = "Toggle Giant Sprite"
desc = "Others will always see you as giant"
desc = "Others will always see you as giant."
icon_icon = 'icons/mob/actions/actions_xeno.dmi'
button_icon_state = "smallqueen"
background_icon_state = "bg_alien"
@@ -881,8 +881,6 @@
/datum/action/small_sprite/megafauna
icon_icon = 'icons/mob/actions/actions_xeno.dmi'
button_icon_state = "smallqueen"
background_icon_state = "bg_alien"
small_icon = 'icons/mob/lavaland/lavaland_monsters.dmi'
/datum/action/small_sprite/megafauna/drake
@@ -902,6 +900,12 @@
small_icon_state = "arachnid_mini"
background_icon_state = "bg_demon"
/datum/action/small_sprite/space_dragon
small_icon = 'icons/mob/carp.dmi'
small_icon_state = "carp"
icon_icon = 'icons/mob/carp.dmi'
button_icon_state = "carp"
/datum/action/small_sprite/Trigger(trigger_flags)
..()
if(!small)
@@ -91,6 +91,8 @@
var/objective_complete = FALSE
/// The innate ability to summon rifts
var/datum/action/innate/summon_rift/rift
/// The ability to make your sprite smaller
var/datum/action/small_sprite/space_dragon/small_sprite
/// The color of the space dragon.
var/chosen_color
/// Minimum devastation damage dealt coefficient based on max health
@@ -106,6 +108,9 @@
ADD_TRAIT(src, TRAIT_HEALS_FROM_CARP_RIFTS, INNATE_TRAIT)
rift = new
rift.Grant(src)
small_sprite = new
small_sprite.Grant(src)
RegisterSignal(small_sprite, COMSIG_ACTION_TRIGGER, .proc/add_dragon_overlay)
/mob/living/simple_animal/hostile/space_dragon/Login()
. = ..()
@@ -201,10 +206,12 @@
destroy_rifts()
..()
add_dragon_overlay()
UnregisterSignal(small_sprite, COMSIG_ACTION_TRIGGER)
/mob/living/simple_animal/hostile/space_dragon/revive(full_heal, admin_revive)
. = ..()
add_dragon_overlay()
RegisterSignal(small_sprite, COMSIG_ACTION_TRIGGER, .proc/add_dragon_overlay)
/mob/living/simple_animal/hostile/space_dragon/wabbajack_act(mob/living/new_mob)
empty_contents()
@@ -252,6 +259,8 @@
*/
/mob/living/simple_animal/hostile/space_dragon/proc/add_dragon_overlay()
cut_overlays()
if(!small_sprite.small)
return
if(stat == DEAD)
var/mutable_appearance/overlay = mutable_appearance(icon, "overlay_dead")
overlay.appearance_flags = RESET_COLOR