From 127bab5337adb74f8fb59b22250db1ed7f2ae1ff Mon Sep 17 00:00:00 2001 From: Miauw Date: Sun, 28 Sep 2014 20:49:14 +0200 Subject: [PATCH 1/2] Simple animal emotes work again. Fixed #4963 --- code/modules/mob/living/emote.dm | 2 +- .../mob/living/simple_animal/simple_animal.dm | 21 +++++++++---------- code/modules/mob/say.dm | 5 +---- 3 files changed, 12 insertions(+), 16 deletions(-) diff --git a/code/modules/mob/living/emote.dm b/code/modules/mob/living/emote.dm index 91e4fd3a7c2..38586236e9a 100644 --- a/code/modules/mob/living/emote.dm +++ b/code/modules/mob/living/emote.dm @@ -2,7 +2,7 @@ //Things like airguitar can be done without arms, and the flap thing makes so little sense it's a keeper. //Intended to be called by a higher up emote proc if the requested emote isn't in the custom emotes. -/mob/living/emote(var/act,var/m_type=1,var/message = null) +/mob/living/emote(var/act, var/m_type=1, var/message = null) var/param = null if (findtext(act, "-", 1, null)) diff --git a/code/modules/mob/living/simple_animal/simple_animal.dm b/code/modules/mob/living/simple_animal/simple_animal.dm index 8f1615f4aed..2481f81c155 100644 --- a/code/modules/mob/living/simple_animal/simple_animal.dm +++ b/code/modules/mob/living/simple_animal/simple_animal.dm @@ -134,23 +134,23 @@ else randomValue -= speak.len if(emote_see && randomValue <= emote_see.len) - emote(pick(emote_see),1) + emote("me", 1, pick(emote_see)) else - emote(pick(emote_hear),2) + emote("me", 2, pick(emote_see)) else say(pick(speak)) else if(!(emote_hear && emote_hear.len) && (emote_see && emote_see.len)) - emote(pick(emote_see),1) + emote("me", 1, pick(emote_see)) if((emote_hear && emote_hear.len) && !(emote_see && emote_see.len)) - emote(pick(emote_hear),2) + emote("me", 2, pick(emote_see)) if((emote_hear && emote_hear.len) && (emote_see && emote_see.len)) var/length = emote_hear.len + emote_see.len var/pick = rand(1,length) if(pick <= emote_see.len) - emote(pick(emote_see),1) + emote("me", 1, pick(emote_see)) else - emote(pick(emote_hear),2) + emote("me", 2, pick(emote_see)) //Atmos @@ -243,14 +243,13 @@ return "[emote], \"[text]\"" return "says, \"[text]\""; -/mob/living/simple_animal/emote(var/act) +/mob/living/simple_animal/emote(var/act, var/m_type=1, var/message = null) if(stat) return if(act == "scream") - act = "makes a loud and pained whimper" //ugly hack to stop animals screaming when crushed :P - visible_message("[src] [act].") - return - ..(act) + message = "makes a loud and pained whimper" //ugly hack to stop animals screaming when crushed :P + act = "me" + ..(act, m_type, message) /mob/living/simple_animal/attack_animal(mob/living/simple_animal/M as mob) if(M.melee_damage_upper == 0) diff --git a/code/modules/mob/say.dm b/code/modules/mob/say.dm index 5bf229f61d5..544522c7934 100644 --- a/code/modules/mob/say.dm +++ b/code/modules/mob/say.dm @@ -22,10 +22,7 @@ message = trim(copytext(sanitize(message), 1, MAX_MESSAGE_LEN)) - if(ishuman(src) || isrobot(src)) - usr.emote("me",1,message) - else - usr.emote(message) + usr.emote("me",1,message) /mob/proc/say_dead(var/message) var/name = src.real_name From 376715271bf175ee2602bfb0f0984cd475841ddd Mon Sep 17 00:00:00 2001 From: Miauw Date: Mon, 29 Sep 2014 18:58:24 +0200 Subject: [PATCH 2/2] emote code sucks --- code/modules/mob/living/simple_animal/constructs.dm | 4 ++-- .../modules/mob/living/simple_animal/friendly/cat.dm | 2 +- .../mob/living/simple_animal/friendly/corgi.dm | 12 ++++++------ .../modules/mob/living/simple_animal/friendly/pug.dm | 4 ++-- .../modules/mob/living/simple_animal/hostile/bear.dm | 2 +- .../modules/mob/living/simple_animal/hostile/carp.dm | 2 +- .../mob/living/simple_animal/hostile/faithless.dm | 2 +- .../mob/living/simple_animal/hostile/mimic.dm | 2 +- .../modules/mob/living/simple_animal/hostile/tree.dm | 2 +- code/modules/mob/living/simple_animal/parrot.dm | 6 +++--- .../mob/living/simple_animal/simple_animal.dm | 2 +- 11 files changed, 20 insertions(+), 20 deletions(-) diff --git a/code/modules/mob/living/simple_animal/constructs.dm b/code/modules/mob/living/simple_animal/constructs.dm index d1ce8e8fe59..d81c415a38c 100644 --- a/code/modules/mob/living/simple_animal/constructs.dm +++ b/code/modules/mob/living/simple_animal/constructs.dm @@ -90,10 +90,10 @@ /mob/living/simple_animal/construct/attack_animal(mob/living/simple_animal/M as mob) if(istype(M, /mob/living/simple_animal/construct/builder)) health += 5 - M.emote("mends some of \the [src]'s wounds.") + M.emote("me", 1, "mends some of \the [src]'s wounds.") else if(src != M) if(M.melee_damage_upper <= 0) - M.emote("[M.friendly] \the [src]") + M.emote("me", 1, "[M.friendly] \the [src]") else if(M.attack_sound) playsound(loc, M.attack_sound, 50, 1, 1) diff --git a/code/modules/mob/living/simple_animal/friendly/cat.dm b/code/modules/mob/living/simple_animal/friendly/cat.dm index 2748bbdf136..65ba9e98ff2 100644 --- a/code/modules/mob/living/simple_animal/friendly/cat.dm +++ b/code/modules/mob/living/simple_animal/friendly/cat.dm @@ -39,7 +39,7 @@ for(var/mob/living/simple_animal/mouse/M in view(1,src)) if(!M.stat) M.splat() - emote("splats \the [M]") + emote("me", 1, "splats \the [M]") movement_target = null stop_automated_movement = 0 break diff --git a/code/modules/mob/living/simple_animal/friendly/corgi.dm b/code/modules/mob/living/simple_animal/friendly/corgi.dm index 71ab8197d12..f3b591266b2 100644 --- a/code/modules/mob/living/simple_animal/friendly/corgi.dm +++ b/code/modules/mob/living/simple_animal/friendly/corgi.dm @@ -66,7 +66,7 @@ for (var/mob/M in viewers(src, null)) M.show_message("[user] gently taps [src] with [O].") if(health>0 && prob(15)) - emote("looks at [user] with [pick("an amused","an annoyed","a confused","a resentful", "a happy", "an excited")] expression") + emote("me", 1, "looks at [user] with [pick("an amused","an annoyed","a confused","a resentful", "a happy", "an excited")] expression") return ..() @@ -388,10 +388,10 @@ movement_target.attack_animal(src) else if(ishuman(movement_target.loc) ) if(prob(20)) - emote("stares at [movement_target.loc]'s [movement_target] with a sad puppy-face") + emote("me", 1, "stares at [movement_target.loc]'s [movement_target] with a sad puppy-face") if(prob(1)) - emote(pick("dances around","chases its tail")) + emote("me", 1, pick("dances around","chases its tail")) spawn(0) for(var/i in list(1,2,4,8,4,2,1,2,4,8,4,2,1,2,4,8,4,2)) dir = i @@ -512,7 +512,7 @@ if(!stat && !resting && !buckled) if(prob(1)) - emote(pick("dances around","chases her tail")) + emote("me", 1, pick("dances around","chases her tail")) spawn(0) for(var/i in list(1,2,4,8,4,2,1,2,4,8,4,2,1,2,4,8,4,2)) dir = i @@ -529,7 +529,7 @@ if(change > 0) if(M && stat != DEAD) // Added check to see if this mob (the corgi) is dead to fix issue 2454 flick_overlay(image('icons/mob/animal.dmi',src,"heart-ani2",MOB_LAYER+1), list(M.client), 20) - emote("yaps happily") + emote("me", 1, "yaps happily") else if(M && stat != DEAD) // Same check here, even though emote checks it as well (poor form to check it only in the help case) - emote("growls") \ No newline at end of file + emote("me", 1, "growls") \ No newline at end of file diff --git a/code/modules/mob/living/simple_animal/friendly/pug.dm b/code/modules/mob/living/simple_animal/friendly/pug.dm index 86c36adf2ff..68ac39967fe 100644 --- a/code/modules/mob/living/simple_animal/friendly/pug.dm +++ b/code/modules/mob/living/simple_animal/friendly/pug.dm @@ -1,4 +1,4 @@ -//Corgi +//Corgi //best comment 2014 /mob/living/simple_animal/pug name = "\improper pug" real_name = "pug" @@ -24,7 +24,7 @@ if(!stat && !resting && !buckled) if(prob(1)) - emote(pick("chases its tail")) + emote("me", 1, pick("chases its tail")) spawn(0) for(var/i in list(1,2,4,8,4,2,1,2,4,8,4,2,1,2,4,8,4,2)) dir = i diff --git a/code/modules/mob/living/simple_animal/hostile/bear.dm b/code/modules/mob/living/simple_animal/hostile/bear.dm index f5e190706ff..7953f92cdae 100644 --- a/code/modules/mob/living/simple_animal/hostile/bear.dm +++ b/code/modules/mob/living/simple_animal/hostile/bear.dm @@ -60,7 +60,7 @@ /mob/living/simple_animal/hostile/bear/FindTarget() . = ..() if(.) - emote("stares alertly at [.]") + emote("me", 1, "stares alertly at [.]") stance = HOSTILE_STANCE_ATTACK /mob/living/simple_animal/hostile/bear/LoseTarget() diff --git a/code/modules/mob/living/simple_animal/hostile/carp.dm b/code/modules/mob/living/simple_animal/hostile/carp.dm index 2d101454d4e..22fc082c8be 100644 --- a/code/modules/mob/living/simple_animal/hostile/carp.dm +++ b/code/modules/mob/living/simple_animal/hostile/carp.dm @@ -44,7 +44,7 @@ /mob/living/simple_animal/hostile/carp/FindTarget() . = ..() if(.) - emote("nashes at [.]") + emote("me", 1, "nashes at [.]") /mob/living/simple_animal/hostile/carp/AttackingTarget() . =..() diff --git a/code/modules/mob/living/simple_animal/hostile/faithless.dm b/code/modules/mob/living/simple_animal/hostile/faithless.dm index 093e609f358..136ab341041 100644 --- a/code/modules/mob/living/simple_animal/hostile/faithless.dm +++ b/code/modules/mob/living/simple_animal/hostile/faithless.dm @@ -37,7 +37,7 @@ /mob/living/simple_animal/hostile/faithless/FindTarget() . = ..() if(.) - emote("wails at [.]") + emote("me", 1, "wails at [.]") /mob/living/simple_animal/hostile/faithless/AttackingTarget() . =..() diff --git a/code/modules/mob/living/simple_animal/hostile/mimic.dm b/code/modules/mob/living/simple_animal/hostile/mimic.dm index d396347e213..2d8a8b18893 100644 --- a/code/modules/mob/living/simple_animal/hostile/mimic.dm +++ b/code/modules/mob/living/simple_animal/hostile/mimic.dm @@ -38,7 +38,7 @@ /mob/living/simple_animal/hostile/mimic/FindTarget() . = ..() if(.) - emote("growls at [.]") + emote("me", 1, "growls at [.]") /mob/living/simple_animal/hostile/mimic/Die() ..() diff --git a/code/modules/mob/living/simple_animal/hostile/tree.dm b/code/modules/mob/living/simple_animal/hostile/tree.dm index 7baa4d510c6..3737f0097d0 100644 --- a/code/modules/mob/living/simple_animal/hostile/tree.dm +++ b/code/modules/mob/living/simple_animal/hostile/tree.dm @@ -39,7 +39,7 @@ /mob/living/simple_animal/hostile/tree/FindTarget() . = ..() if(.) - emote("growls at [.]") + emote("me", 1, "growls at [.]") /mob/living/simple_animal/hostile/tree/AttackingTarget() . =..() diff --git a/code/modules/mob/living/simple_animal/parrot.dm b/code/modules/mob/living/simple_animal/parrot.dm index 89e4ea79938..5f21892adf4 100644 --- a/code/modules/mob/living/simple_animal/parrot.dm +++ b/code/modules/mob/living/simple_animal/parrot.dm @@ -419,7 +419,7 @@ //Search for item to steal parrot_interest = search_for_item() if(parrot_interest) - emote("looks in [parrot_interest]'s direction and takes flight") + emote("me", 1, "looks in [parrot_interest]'s direction and takes flight") parrot_state = PARROT_SWOOP | PARROT_STEAL icon_state = "parrot_fly" return @@ -441,7 +441,7 @@ if(AM) if(istype(AM, /obj/item) || isliving(AM)) //If stealable item parrot_interest = AM - emote("turns and flies towards [parrot_interest]") + emote("me", 1, "turns and flies towards [parrot_interest]") parrot_state = PARROT_SWOOP | PARROT_STEAL return else //Else it's a perch @@ -739,7 +739,7 @@ held_item = null if(health < maxHealth) adjustBruteLoss(-10) - emote("[src] eagerly downs the cracker") + emote("me", 1, "[src] eagerly downs the cracker") return 1 diff --git a/code/modules/mob/living/simple_animal/simple_animal.dm b/code/modules/mob/living/simple_animal/simple_animal.dm index 2481f81c155..c6a6d34d3c5 100644 --- a/code/modules/mob/living/simple_animal/simple_animal.dm +++ b/code/modules/mob/living/simple_animal/simple_animal.dm @@ -253,7 +253,7 @@ /mob/living/simple_animal/attack_animal(mob/living/simple_animal/M as mob) if(M.melee_damage_upper == 0) - M.emote("[M.friendly] [src]") + M.emote("me", 1, "[M.friendly] [src]") else if(M.attack_sound) playsound(loc, M.attack_sound, 50, 1, 1)