Removes some leftover debug messages.

Aflap is now a child of flap, each having a wing opening/closing timer, also improved the code there a bit.
Adds a stat_allowed var(all emotes are default to CONSCIOUS).
This commit is contained in:
Lzimann
2016-12-27 07:44:49 -02:00
parent d0fa89a452
commit 5a585fc124
3 changed files with 26 additions and 20 deletions
+2 -1
View File
@@ -18,6 +18,7 @@ var/global/list/emote_list = list()
var/muzzle_ignore = FALSE //Will only work if the emote is EMOTE_AUDIBLE
var/list/mob_type_allowed_typecache = list() //Types that are allowed to use that emote
var/list/mob_type_blacklist_typecache = list() //Types that are NOT allowed to use that emote
var/stat_allowed = CONSCIOUS
/datum/emote/New()
..()
@@ -79,7 +80,7 @@ var/global/list/emote_list = list()
/datum/emote/proc/can_run_emote(mob/user)
. = TRUE
if((user.stat && key != "deathgasp") || (user.status_flags & FAKEDEATH))
if(user.stat > stat_allowed || (user.status_flags & FAKEDEATH))
return FALSE
if(!is_type_in_typecache(user, mob_type_allowed_typecache))
return FALSE
@@ -78,10 +78,8 @@
. = ..()
var/mob/living/carbon/human/H = user
if(.)
world << ". if"
H.startTailWag()
else
world << "end"
H.endTailWag()
/datum/emote/living/carbon/human/wag/can_run_emote(mob/user)
@@ -105,11 +103,12 @@
/datum/emote/living/carbon/human/wing/run_emote(mob/user, params)
. = ..()
var/mob/living/carbon/human/H = user
if(findtext(select_message_type(user), "open"))
H.OpenWings()
else
H.CloseWings()
if(.)
var/mob/living/carbon/human/H = user
if(findtext(select_message_type(user), "open"))
H.OpenWings()
else
H.CloseWings()
/datum/emote/living/carbon/human/wing/select_message_type(mob/user)
. = ..()
@@ -155,7 +154,6 @@
update_body()
/mob/living/carbon/human/proc/OpenWings()
world << "open wings being called"
if(!dna || !dna.species)
return
if("wings" in dna.species.mutant_bodyparts)
@@ -164,7 +162,6 @@
update_body()
/mob/living/carbon/human/proc/CloseWings()
world << "close wings being called"
if(!dna || !dna.species)
return
if("wingsopen" in dna.species.mutant_bodyparts)
+18 -10
View File
@@ -18,11 +18,6 @@
mob_type_allowed_typecache = list(/mob/living)
mob_type_blacklist_typecache = list(/mob/living/simple_animal/slime, /mob/living/brain)
/datum/emote/living/aflap
key = "aflap"
message = "flaps their wings ANGRILY!"
restraint_check = TRUE
/datum/emote/living/blush
key = "blush"
key_third_person = "blushes"
@@ -65,7 +60,8 @@
/datum/emote/living/collapse/run_emote(mob/user, params)
. = ..()
user.Paralyse(2)
if(.)
user.Paralyse(2)
/datum/emote/living/cough
key = "cough"
@@ -113,14 +109,26 @@
key_third_person = "flaps"
message = "flaps their wings."
restraint_check = TRUE
var/wing_time = 20
/datum/emote/living/flap/run_emote(mob/user, params)
. = ..()
if(ishuman(user))
var/mob/living/carbon/human/H = user
if((H.dna.features["wings"] != "None") && !("wings" in H.dna.species.mutant_bodyparts))
H.OpenWings()
addtimer(H, "CloseWings", 20)
var/open = FALSE
if(H.dna.features["wings"] != "None")
if("wingsopen" in H.dna.species.mutant_bodyparts)
open = TRUE
H.CloseWings()
else
H.OpenWings()
addtimer(H, "[open ? "Open" : "Close"]Wings", wing_time)
/datum/emote/living/flap/aflap
key = "aflap"
key_third_person = "aflaps"
message = "flaps their wings ANGRILY!"
wing_time = 10
/datum/emote/living/flip
key = "flip"
@@ -128,7 +136,7 @@
/datum/emote/living/flip/run_emote(mob/user, params)
. = ..()
if(!user.restrained() || !user.sleeping)
if(!user.sleeping)
user.SpinAnimation(7,1)
/datum/emote/living/frown