From bab04c669eb7f1c05c2c91e47f14f8916d1bd2c5 Mon Sep 17 00:00:00 2001 From: Tigercat2000 Date: Sat, 19 Sep 2015 08:47:53 -0700 Subject: [PATCH] Emote fixes, most of it's still insane --- code/modules/mob/living/say.dm | 15 +++++++++++++++ .../mob/living/simple_animal/friendly/diona.dm | 12 +++++++++++- .../mob/living/simple_animal/simple_animal.dm | 13 +++++++------ 3 files changed, 33 insertions(+), 7 deletions(-) diff --git a/code/modules/mob/living/say.dm b/code/modules/mob/living/say.dm index 3c79879dd07..c8e4af92e84 100644 --- a/code/modules/mob/living/say.dm +++ b/code/modules/mob/living/say.dm @@ -264,3 +264,18 @@ proc/get_radio_key_from_channel(var/channel) /mob/living/proc/GetVoice() return name + +/mob/living/emote(var/act, var/type, var/message) //emote code is terrible, this is so that anything that isn't + if(stat) return 0 //already snowflaked to shit can call the parent and handle emoting sanely + + if(..(act, type, message)) + return 1 + + if(act && type && message) //parent call + switch(type) + if(1) //Visible + visible_message(message) + return 1 + if(2) //Audible + audible_message(message) + return 1 \ No newline at end of file diff --git a/code/modules/mob/living/simple_animal/friendly/diona.dm b/code/modules/mob/living/simple_animal/friendly/diona.dm index 904a7b86659..990f63a359c 100644 --- a/code/modules/mob/living/simple_animal/friendly/diona.dm +++ b/code/modules/mob/living/simple_animal/friendly/diona.dm @@ -246,4 +246,14 @@ /mob/living/simple_animal/diona/put_in_active_hand(obj/item/W) src << "You don't have any hands!" - return \ No newline at end of file + return + +/mob/living/simple_animal/diona/emote(var/act, var/m_type=1, var/message = null) + if(stat) return + + switch(act) //IMPORTANT: Emotes MUST NOT CONFLICT anywhere along the chain. + if("chirp") + message = "\The [src] chirps!" + m_type = 2 //audible + + ..(act, m_type, message) \ No newline at end of file diff --git a/code/modules/mob/living/simple_animal/simple_animal.dm b/code/modules/mob/living/simple_animal/simple_animal.dm index d2931044be3..3764e74f6ff 100644 --- a/code/modules/mob/living/simple_animal/simple_animal.dm +++ b/code/modules/mob/living/simple_animal/simple_animal.dm @@ -257,14 +257,15 @@ adjustBruteLoss(20) return -/mob/living/simple_animal/emote(var/act,var/m_type=1,var/message = null) - if(stat) - return - switch(act) +/mob/living/simple_animal/emote(var/act, var/m_type=1, var/message = null) + if(stat) return + + switch(act) //IMPORTANT: Emotes MUST NOT CONFLICT anywhere along the chain. if("scream") - message = "The [src.name] whimpers." + message = "\The [src] whimpers." m_type = 2 - ..() + + ..(act, m_type, message) /mob/living/simple_animal/attack_animal(mob/living/simple_animal/M as mob) if(M.melee_damage_upper == 0)