Skip to content

Commit

Permalink
Don't spam
Browse files Browse the repository at this point in the history
  • Loading branch information
ThatLing committed Dec 29, 2022
1 parent d0e4c46 commit b2353a4
Showing 1 changed file with 65 additions and 1 deletion.
66 changes: 65 additions & 1 deletion code/modules/mob/emote.dm
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
///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)
Expand Down Expand Up @@ -39,6 +52,30 @@
if(.)
user.SpinAnimation(7,1)

/datum/emote/flip/check_cooldown(mob/user, intentional, update=TRUE, is_keybind = FALSE)
. = ..()
if(!.)
return
if (!is_keybind)
return
if(!can_run_emote(user, intentional=intentional))
return
if(isliving(user))
var/mob/living/flippy_mcgee = user
if(prob(20))
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(50))
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.")
)

/datum/emote/spin
key = "spin"
key_third_person = "spins"
Expand All @@ -47,7 +84,7 @@
mob_type_ignore_stat_typecache = list(/mob/dead/observer)
cooldown = 0 SECONDS

/datum/emote/spin/run_emote(mob/user, params , type_override, intentional)
/datum/emote/spin/run_emote(mob/user, params ,type_override, intentional)
. = ..()
if(.)
if(iscyborg(user) && user.has_buckled_mobs())
Expand All @@ -61,3 +98,30 @@
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
var/current_confusion = user.confused
if(current_confusion > BEYBLADE_PUKE_THRESHOLD)
user.vomit(BEYBLADE_PUKE_NUTRIENT_LOSS, distance = 0)
return
if(prob(BEYBLADE_DIZZINESS_PROBABILITY))
to_chat(user, "<span class='warning'>You feel woozy from spinning.</span>")
user.Dizzy(BEYBLADE_DIZZINESS_DURATION)
if(current_confusion < BEYBLADE_CONFUSION_LIMIT)
user.confused += BEYBLADE_CONFUSION_INCREMENT

#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

0 comments on commit b2353a4

Please sign in to comment.