mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 10:12:45 +00:00
Most mobs can emote now.
Also added CSS to say, so that you can tell apart "say" and "me say"
This commit is contained in:
@@ -1061,6 +1061,7 @@
|
||||
#include "code\modules\mining\ores_coins.dm"
|
||||
#include "code\modules\mining\satchel_ore_boxdm.dm"
|
||||
#include "code\modules\mob\death.dm"
|
||||
#include "code\modules\mob\emote.dm"
|
||||
#include "code\modules\mob\inventory.dm"
|
||||
#include "code\modules\mob\login.dm"
|
||||
#include "code\modules\mob\logout.dm"
|
||||
|
||||
@@ -32,19 +32,13 @@ mob/proc/custom_emote(var/m_type=1,var/message = null)
|
||||
continue
|
||||
if(findtext(message," snores.")) //Because we have so many sleeping people.
|
||||
break
|
||||
if(M.stat == 2 && M.client.ghost_sight && !(M in viewers(src,null)))
|
||||
if(M.stat == 2 && (M.client.prefs.toggles & CHAT_GHOSTSIGHT) && !(M in viewers(src,null)))
|
||||
M.show_message(message)
|
||||
|
||||
|
||||
if (m_type & 1)
|
||||
for (var/mob/O in viewers(src, null))
|
||||
if(istype(O,/mob/living/carbon/human))
|
||||
for(var/mob/living/parasite/P in O:parasites)
|
||||
P.show_message(message, m_type)
|
||||
O.show_message(message, m_type)
|
||||
else if (m_type & 2)
|
||||
for (var/mob/O in hearers(src.loc, null))
|
||||
if(istype(O,/mob/living/carbon/human))
|
||||
for(var/mob/living/parasite/P in O:parasites)
|
||||
P.show_message(message, m_type)
|
||||
O.show_message(message, m_type)
|
||||
|
||||
@@ -53,27 +53,17 @@
|
||||
var/input = copytext(sanitize(input("Choose an emote to display.") as text|null),1,MAX_MESSAGE_LEN)
|
||||
if (!input)
|
||||
return
|
||||
if(copytext(input,1,5) == "says")
|
||||
src << "\red Invalid emote."
|
||||
return
|
||||
else if(copytext(input,1,9) == "exclaims")
|
||||
src << "\red Invalid emote."
|
||||
return
|
||||
else if(copytext(input,1,5) == "asks")
|
||||
src << "\red Invalid emote."
|
||||
return
|
||||
else
|
||||
var/input2 = input("Is this a visible or hearable emote?") in list("Visible","Hearable")
|
||||
if (input2 == "Visible")
|
||||
m_type = 1
|
||||
else if (input2 == "Hearable")
|
||||
if (src.miming)
|
||||
return
|
||||
m_type = 2
|
||||
else
|
||||
alert("Unable to use this emote, must be either hearable or visible.")
|
||||
var/input2 = input("Is this a visible or hearable emote?") in list("Visible","Hearable")
|
||||
if (input2 == "Visible")
|
||||
m_type = 1
|
||||
else if (input2 == "Hearable")
|
||||
if (src.miming)
|
||||
return
|
||||
message = "<B>[src]</B> [input]"
|
||||
m_type = 2
|
||||
else
|
||||
alert("Unable to use this emote, must be either hearable or visible.")
|
||||
return
|
||||
message = "<B>[src]</B> [input]"
|
||||
|
||||
if ("me")
|
||||
if(silent)
|
||||
@@ -88,17 +78,7 @@
|
||||
return
|
||||
if(!(message))
|
||||
return
|
||||
if(copytext(message,1,5) == "says")
|
||||
src << "\red Invalid emote."
|
||||
return
|
||||
else if(copytext(message,1,9) == "exclaims")
|
||||
src << "\red Invalid emote."
|
||||
return
|
||||
else if(copytext(message,1,5) == "asks")
|
||||
src << "\red Invalid emote."
|
||||
return
|
||||
else
|
||||
message = "<B>[src]</B> [message]"
|
||||
message = "<B>[src]</B> [message]"
|
||||
|
||||
if ("salute")
|
||||
if (!src.buckled)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/mob/living/carbon/slime/emote(var/act)
|
||||
/mob/living/carbon/slime/emote(var/act, var/type, var/desc)
|
||||
|
||||
|
||||
if (findtext(act, "-", 1, null))
|
||||
@@ -13,6 +13,10 @@
|
||||
var/message
|
||||
|
||||
switch(act)
|
||||
if ("me")
|
||||
return custom_emote(m_type, desc)
|
||||
if ("custom")
|
||||
return custom_emote(m_type, desc)
|
||||
if("moan")
|
||||
message = "<B>The [src.name]</B> moans."
|
||||
m_type = 2
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/mob/living/carbon/monkey/emote(var/act)
|
||||
/mob/living/carbon/monkey/emote(var/act, var/type, var/desc)
|
||||
|
||||
var/param = null
|
||||
if (findtext(act, "-", 1, null))
|
||||
@@ -14,6 +14,12 @@
|
||||
var/message
|
||||
|
||||
switch(act)
|
||||
if ("me")
|
||||
return custom_emote(m_type, desc)
|
||||
|
||||
if ("custom")
|
||||
return custom_emote(m_type, desc)
|
||||
|
||||
if("sign")
|
||||
if (!src.restrained())
|
||||
message = text("<B>The monkey</B> signs[].", (text2num(param) ? text(" the number []", text2num(param)) : null))
|
||||
|
||||
@@ -9,6 +9,12 @@
|
||||
act = copytext(act,1,length(act))
|
||||
|
||||
switch(act)
|
||||
if ("me")
|
||||
return custom_emote(m_type, message)
|
||||
|
||||
if ("custom")
|
||||
return custom_emote(m_type, message)
|
||||
|
||||
if ("salute")
|
||||
if (!src.buckled)
|
||||
var/M = null
|
||||
@@ -56,20 +62,6 @@
|
||||
message = "<B>[src]</B> flaps his wings ANGRILY!"
|
||||
m_type = 2
|
||||
|
||||
if ("custom")
|
||||
var/input = copytext(sanitize(input("Choose an emote to display.") as text|null),1,MAX_MESSAGE_LEN)
|
||||
if (!input)
|
||||
return
|
||||
var/input2 = input("Is this a visible or hearable emote?") in list("Visible","Hearable")
|
||||
if (input2 == "Visible")
|
||||
m_type = 1
|
||||
else if (input2 == "Hearable")
|
||||
m_type = 2
|
||||
else
|
||||
alert("Unable to use this emote, must be either hearable or visible.")
|
||||
return
|
||||
message = "<B>[src]</B> [input]"
|
||||
|
||||
if ("me")
|
||||
if (src.client)
|
||||
if(client.prefs.muted & MUTE_IC)
|
||||
|
||||
@@ -226,14 +226,8 @@
|
||||
|
||||
/mob/living/simple_animal/emote(var/act, var/type, var/desc)
|
||||
if(act)
|
||||
if(act == "scream") act = "makes a loud and pained whimper" //ugly hack to stop animals screaming when crushed :P
|
||||
if(act == "me") //Allow me-emotes.
|
||||
act = desc
|
||||
if( findtext(act,".",lentext(act)) == 0 && findtext(act,"!",lentext(act)) == 0 && findtext(act,"?",lentext(act)) == 0 )
|
||||
act = addtext(act,".") //Makes sure all emotes end with a period.
|
||||
for (var/mob/O in viewers(src, null))
|
||||
O.show_message("<B>[src]</B> [act]")
|
||||
|
||||
if(act == "scream") act = "whimper" //ugly hack to stop animals screaming when crushed :P
|
||||
..(act, type, desc)
|
||||
|
||||
/mob/living/simple_animal/attack_animal(mob/living/simple_animal/M as mob)
|
||||
if(M.melee_damage_upper == 0)
|
||||
|
||||
@@ -75,31 +75,32 @@
|
||||
//tcomms code is still runtiming somewhere here
|
||||
var/ending = copytext(text, length(text))
|
||||
if (is_speaking_soghun)
|
||||
return "hisses, \"<span class='soghun'>[text]</span>\"";
|
||||
return "<span class='say_quote'>hisses</span>, \"<span class='soghun'>[text]</span>\"";
|
||||
if (is_speaking_skrell)
|
||||
return "warbles, \"<span class='skrell'>[text]</span>\"";
|
||||
return "<span class='say_quote'>warbles</span>, \"<span class='skrell'>[text]</span>\"";
|
||||
if (is_speaking_tajaran)
|
||||
return "mrowls, \"<span class='tajaran'>[text]</span>\"";
|
||||
return "<span class='say_quote'>mrowls</span>, \"<span class='tajaran'>[text]</span>\"";
|
||||
//Needs Virus2
|
||||
// if (src.disease_symptoms & DISEASE_HOARSE)
|
||||
// return "rasps, \"[text]\"";
|
||||
if (src.stuttering)
|
||||
return "stammers, \"[text]\"";
|
||||
return "<span class='say_quote'>stammers</span>, \"[text]\"";
|
||||
if (src.slurring)
|
||||
return "slurrs, \"[text]\"";
|
||||
return "<span class='say_quote'>slurrs</span>, \"[text]\"";
|
||||
if(isliving(src))
|
||||
var/mob/living/L = src
|
||||
if (L.getBrainLoss() >= 60)
|
||||
return "gibbers, \"[text]\"";
|
||||
return "<span class='say_quote'>gibbers</span>, \"[text]\"";
|
||||
if (ending == "?")
|
||||
return "asks, \"[text]\"";
|
||||
return "<span class='say_quote'>asks</span>, \"[text]\"";
|
||||
if (ending == "!")
|
||||
return "exclaims, \"[text]\"";
|
||||
return "<span class='say_quote'>exclaims</span>, \"[text]\"";
|
||||
|
||||
return "says, \"[text]\"";
|
||||
return "<span class='say_quote'>says</span>, \"[text]\"";
|
||||
|
||||
/mob/proc/emote(var/act)
|
||||
return
|
||||
/mob/proc/emote(var/act, var/type, var/message)
|
||||
if(act == "me")
|
||||
return custom_emote(type, message)
|
||||
|
||||
/mob/proc/get_ear()
|
||||
// returns an atom representing a location on the map from which this
|
||||
|
||||
@@ -55,6 +55,7 @@ h1.alert, h2.alert {color: #000000;}
|
||||
.tajaran {color: #803B56;}
|
||||
.skrell {color: #00CED1;}
|
||||
.soghun {color: #228B22;}
|
||||
.say_quote {font-family: Georgia, Verdana, sans-serif;}
|
||||
|
||||
.interface {color: #330033;}
|
||||
</style>"}
|
||||
|
||||
Reference in New Issue
Block a user