-
-
Notifications
You must be signed in to change notification settings - Fork 452
/
emote.dm
126 lines (115 loc) · 4.27 KB
/
emote.dm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
///How confused a carbon must be before they will vomit
#define BEYBLADE_PUKE_THRESHOLD 30
///How must nutrition is lost when a carbon pukes
#define BEYBLADE_PUKE_NUTRIENT_LOSS 60
///How often a carbon becomes penalized
#define BEYBLADE_DIZZINESS_PROBABILITY 20
///How long the screenshake lasts
#define BEYBLADE_DIZZINESS_DURATION 20
///How much confusion a carbon gets every time they are penalized
#define BEYBLADE_CONFUSION_INCREMENT 10
///A max for how much confusion a carbon will be for beyblading
#define BEYBLADE_CONFUSION_LIMIT 40
//The code execution of the emote datum is located at code/datums/emotes.dm
/mob/proc/emote(act, m_type = null, message = null, intentional = FALSE, is_keybind = FALSE)
act = lowertext(act)
var/param = message
var/custom_param = findchar(act, " ")
if(custom_param)
param = copytext(act, custom_param + length(act[custom_param]))
act = copytext(act, 1, custom_param)
var/list/key_emotes = GLOB.emote_list[act]
if(!length(key_emotes))
if(intentional)
to_chat(src, span_notice("'[act]' emote does not exist. Say *help for a list."))
return FALSE
var/silenced = FALSE
for(var/datum/emote/P in key_emotes)
if(!P.check_cooldown(src, intentional, is_keybind=is_keybind))
silenced = TRUE
continue
if(P.run_emote(src, param, m_type, intentional))
SEND_SIGNAL(src, COMSIG_MOB_EMOTE, P, act, m_type, message, intentional)
SEND_SIGNAL(src, COMSIG_MOB_EMOTED(P.key))
return TRUE
if(intentional && !silenced)
to_chat(src, span_notice("Unusable emote '[act]'. Say *help for a list."))
return FALSE
/datum/emote/flip
key = "flip"
key_third_person = "flips"
hands_use_check = TRUE
mob_type_allowed_typecache = list(/mob/living, /mob/dead/observer)
mob_type_ignore_stat_typecache = list(/mob/dead/observer)
cooldown = 0 SECONDS
/datum/emote/flip/run_emote(mob/user, params , type_override, intentional)
. = ..()
if(.)
user.SpinAnimation(7,1)
/datum/emote/flip/check_cooldown(mob/user, intentional, update=TRUE, is_keybind = FALSE)
. = ..()
if (!is_keybind)
return
if(!can_run_emote(user, intentional=intentional))
return
if(!.)
if(isliving(user)) // Spammers get punished!
var/mob/living/flippy_mcgee = user
if(prob(40))
flippy_mcgee.Knockdown(1 SECONDS)
flippy_mcgee.visible_message(
span_notice("[flippy_mcgee] attempts to do a flip and falls over, what a doofus!"),
span_notice("You attempt to do a flip while still off balance from the last flip and fall down!")
)
if(prob(75))
flippy_mcgee.adjustBruteLoss(1)
else
flippy_mcgee.visible_message(
span_notice("[flippy_mcgee] stumbles a bit after their flip."),
span_notice("You stumble a bit from still being off balance from your last flip.")
)
return
/datum/emote/spin
key = "spin"
key_third_person = "spins"
hands_use_check = TRUE
mob_type_allowed_typecache = list(/mob/living, /mob/dead/observer)
mob_type_ignore_stat_typecache = list(/mob/dead/observer)
cooldown = 0 SECONDS
/datum/emote/spin/run_emote(mob/user, params ,type_override, intentional)
. = ..()
if(.)
if(iscyborg(user) && user.has_buckled_mobs())
var/mob/living/silicon/robot/R = user
var/datum/component/riding/riding_datum = R.GetComponent(/datum/component/riding)
if(riding_datum)
for(var/mob/M in R.buckled_mobs)
riding_datum.force_dismount(M)
else
R.unbuckle_all_mobs()
else
//we want to hold off on doing the spin if they are a cyborg and have someone buckled to them
user.spin(20,1)
/datum/emote/spin/check_cooldown(mob/living/carbon/user, intentional, update=TRUE, is_keybind = FALSE)
. = ..()
if(!.)
return
if (!is_keybind)
return
if(!can_run_emote(user, intentional=intentional))
return
if(!iscarbon(user))
return
if(user.get_timed_status_effect_duration(/datum/status_effect/confusion) > BEYBLADE_PUKE_THRESHOLD)
user.vomit(BEYBLADE_PUKE_NUTRIENT_LOSS, distance = 0)
return
if(prob(BEYBLADE_DIZZINESS_PROBABILITY))
to_chat(user, span_warning("You feel woozy from spinning."))
user.set_dizzy_if_lower(BEYBLADE_DIZZINESS_DURATION)
user.adjust_confusion_up_to(BEYBLADE_CONFUSION_INCREMENT, BEYBLADE_CONFUSION_LIMIT)
#undef BEYBLADE_PUKE_THRESHOLD
#undef BEYBLADE_PUKE_NUTRIENT_LOSS
#undef BEYBLADE_DIZZINESS_PROBABILITY
#undef BEYBLADE_DIZZINESS_DURATION
#undef BEYBLADE_CONFUSION_INCREMENT
#undef BEYBLADE_CONFUSION_LIMIT