diff --git a/maplestation.dme b/maplestation.dme index fbfb04555cd9..3b4bb3d072c9 100644 --- a/maplestation.dme +++ b/maplestation.dme @@ -5353,6 +5353,7 @@ #include "maplestation_modules\code\datums\greyscale\_greyscale_config.dm" #include "maplestation_modules\code\datums\id_trim\jobs.dm" #include "maplestation_modules\code\datums\keybinding\communication.dm" +#include "maplestation_modules\code\datums\mood_events\quirk_mood_events.dm" #include "maplestation_modules\code\datums\mood_events\reagent_mood_events.dm" #include "maplestation_modules\code\datums\pain\pain.dm" #include "maplestation_modules\code\datums\pain\pain_bodyparts.dm" diff --git a/maplestation_modules/code/__DEFINES/_module_defines.dm b/maplestation_modules/code/__DEFINES/_module_defines.dm index 7154e4b2982d..e858c754da97 100644 --- a/maplestation_modules/code/__DEFINES/_module_defines.dm +++ b/maplestation_modules/code/__DEFINES/_module_defines.dm @@ -40,3 +40,12 @@ /// Max loadout presets available #define MAX_LOADOUTS 5 + +/// How much "caffeine points" does 1 metabolization tick (0.2u) of a "weak" drink provide +#define CAFFEINE_POINTS_WEAK 0.1 + +/// How much "caffeine points" does 1 metabolization tick (0.2u) of coffee provide +#define CAFFEINE_POINTS_COFFEE 0.2 + +/// How much "caffeine points" does 1 metabolization tick (0.2u) of energy drinks provide +#define CAFFEINE_POINTS_ENERGY 0.8 //yes i know energy drinks actually have less caffeine than coffee IRL but this is the FUTURE diff --git a/maplestation_modules/code/__DEFINES/signals.dm b/maplestation_modules/code/__DEFINES/signals.dm index cd988f205f15..e465c2052a30 100644 --- a/maplestation_modules/code/__DEFINES/signals.dm +++ b/maplestation_modules/code/__DEFINES/signals.dm @@ -13,3 +13,6 @@ /// A carbon is being flashed - actually being blinded and taking (eye) damage #define COMSIG_CARBON_FLASH_ACT "carbon_flash_act" + +/// A carbon drank some caffeine. (signal, caffeine_content) +#define COMSIG_CARBON_DRINK_CAFFEINE "carbon_drink_caffeine" diff --git a/maplestation_modules/code/__DEFINES/traits.dm b/maplestation_modules/code/__DEFINES/traits.dm index 7ce39da55e85..d139829f4942 100644 --- a/maplestation_modules/code/__DEFINES/traits.dm +++ b/maplestation_modules/code/__DEFINES/traits.dm @@ -1,3 +1,5 @@ // --Adds the trait for the cardcollector quirk #define TRAIT_CARDCOLLECTOR "cardcollector" #define TRAIT_SHARPNESS_VULNERABLE "sharpnessvulnerable" +///Gives positive mood on drinking anything caffeinated, kinda generic so people can like coffee, tea, energy drinks, whatever. +#define TRAIT_CAFFEINE_LOVER "caffeine_lover" diff --git a/maplestation_modules/code/datums/mood_events/quirk_mood_events.dm b/maplestation_modules/code/datums/mood_events/quirk_mood_events.dm new file mode 100644 index 000000000000..f8aa63b91dc5 --- /dev/null +++ b/maplestation_modules/code/datums/mood_events/quirk_mood_events.dm @@ -0,0 +1,19 @@ +/datum/mood_event/no_coffee + description = "DON'T TALK TO ME, UNTIL I'VE HAD MY COFFEE!!" + mood_change = -8 + +/datum/mood_event/low_caffeine + description = "I'm feeling low on caffeine... I'm so tired..." + mood_change = -4 + +/datum/mood_event/high_caffeine + description = "That caffeine really helped me to be so energetic!" + mood_change = 2 + +/datum/mood_event/way_too_high_caffeine + description = "CAFFEINE IS MY GOD, AND I AM THE HUMAN INSTRUMENT OF ITS WILL!!!" + mood_change = 10 + +/datum/mood_event/caffeine_death + description = "OW GOD MY HEART IS BEATING REALLY FAST- AAAAND I THINK IT JUST STOPPED BEATING." + mood_change = -10 diff --git a/maplestation_modules/code/datums/mood_events/reagent_mood_events.dm b/maplestation_modules/code/datums/mood_events/reagent_mood_events.dm index e9262fd26e3a..a3b96cf3ef62 100644 --- a/maplestation_modules/code/datums/mood_events/reagent_mood_events.dm +++ b/maplestation_modules/code/datums/mood_events/reagent_mood_events.dm @@ -1,31 +1,46 @@ // Reagent moodlets /datum/mood_event/gojuice - description = "Feeling pumped but calm. I am the sniper bullet in flight, ready to cut through you.\n" + description = "Feeling pumped but calm. I am the sniper bullet in flight, ready to cut through you." mood_change = 3 /datum/mood_event/flake - description = "So good, so good.\n" + description = "So good, so good." mood_change = 20 /datum/mood_event/yayo - description = "Feeling pumped! Let's do this!\n" + description = "Feeling pumped! Let's do this!" mood_change = 20 /datum/mood_event/psychite_tea - description = "I drank some nice, calming psychite tea.\n" + description = "I drank some nice, calming psychite tea." mood_change = 8 /datum/mood_event/full_on_pilk - description = "I am now full on pilk! That was some amazing bubbly goodness!\n" + description = "I am now full on pilk! That was some amazing bubbly goodness!" mood_change = 7 timeout = 7 MINUTES /datum/mood_event/pegged - description = "OH YEAH, NOW I'M PEGGED!\n" //:uncannycat: + description = "OH YEAH, NOW I'M PEGGED!" //:uncannycat: mood_change = 8 timeout = 7 MINUTES +/datum/mood_event/coffee_lover + description = "That coffee was truly delectable!" + mood_change = 3 + timeout = 7 MINUTES + +/datum/mood_event/tea_lover + description = "That was a most wonderful spot of tea." + mood_change = 3 + timeout = 7 MINUTES + +/datum/mood_event/energy_lover + description = "That energy drink was the perfect mix to get you energized! Shame it only really tasted of chemicals." + mood_change = 0 + timeout = 12 MINUTES //lasts longer but you're not really happy + // Addiction moodlets /datum/mood_event/luciferium_light mood_change = -4 diff --git a/maplestation_modules/code/datums/quirks/neutral.dm b/maplestation_modules/code/datums/quirks/neutral.dm index 7c14930b0e6b..ba9be3c2022b 100644 --- a/maplestation_modules/code/datums/quirks/neutral.dm +++ b/maplestation_modules/code/datums/quirks/neutral.dm @@ -34,3 +34,89 @@ icon = FA_ICON_HEARTBEAT value = 0 mob_trait = TRAIT_CPR_CERTIFIED + +/datum/quirk/caffeinated + name = "Caffeinated" + desc = "You just can't imagine a day without some sort of caffeinated beverage. You're slightly weaker without caffeine, but slightly boosted with it." + icon = FA_ICON_COFFEE + value = 0 + mob_trait = TRAIT_CAFFEINE_LOVER //Might aswell love the drinks while we're at it + quirk_flags = QUIRK_HUMAN_ONLY|QUIRK_PROCESSES + gain_text = span_notice("You can't wait to start your day with a nice energizing drink!") + lose_text = span_danger("You realize excessive amounts of caffeine likely has detrimental effects on your cardiovascular system.") + medical_record_text = "Patient snatched the observation officer's coffee, drank it and then asked for seconds." + /// Did we drink literally anything caffeinated in the round? + var/caffeine_drank = FALSE + /// Are we going to fucking die? + var/caffeine_overdosed = FALSE + /// The current sprint length multiplier + var/sprint_length_multiplier = 1 + /// The current sprint regen multiplier + var/sprint_regen_multiplier = 1 + /// How much caffeine is currently in our system + var/caffeine_content = 0 + /// Decay rate on caffeine content, pretty much for varedits + var/caffeine_decay_rate = 0.05 + +/datum/quirk/caffeinated/add(client/client_source) + adjust_sprint_multipliers(0.33, 0.2) + RegisterSignals(quirk_holder, COMSIG_CARBON_DRINK_CAFFEINE, PROC_REF(drank_caffeine)) + quirk_holder.add_mood_event("caffeine", /datum/mood_event/no_coffee) + +/datum/quirk/caffeinated/process(seconds_per_tick) + if(HAS_TRAIT(quirk_holder, TRAIT_NOMETABOLISM)) + return + if(!caffeine_drank) + return + + if(caffeine_content > 0) + caffeine_content = max(caffeine_content - caffeine_decay_rate * seconds_per_tick, 0) + + if(caffeine_content >= 400 || caffeine_overdosed) //we're becoming downright godly at this point, also you have to either slam down >100 units of energy drinks back-to-back or >400 units of coffee. + adjust_sprint_multipliers(2, 4) + if(!caffeine_overdosed) + quirk_holder.add_mood_event("caffeine", /datum/mood_event/way_too_high_caffeine) + caffeine_overdosed = TRUE + addtimer(src, CALLBACK(PROC_REF(caffeine_overdose)), 4 MINUTES) //wuh oh + return + + if(caffeine_content > 4) + quirk_holder.add_mood_event("caffeine", /datum/mood_event/high_caffeine) + adjust_sprint_multipliers(1.25, 1.5) + return + + if(caffeine_content <= 4) + quirk_holder.add_mood_event("caffeine", /datum/mood_event/low_caffeine) + adjust_sprint_multipliers(0.75, 0.5) + return + + //We should've returned by now, if we didn't, that means caffeine_content is somehow not a number + CRASH("Someone has transcended spacetime and become so caffeinated that it's not even a number anymore.") + +/datum/quirk/caffeinated/proc/drank_caffeine(mob/living/carbon/source, beverage_caffeine_content) + if(!caffeine_drank) + caffeine_drank = TRUE + caffeine_content += beverage_caffeine_content + +/datum/quirk/caffeinated/proc/caffeine_overdose() + if(caffeine_overdosed) + quirk_holder.add_mood_event("caffeine", /datum/mood_event/caffeine_death) + var/mob/living/carbon/quirk_carbon = quirk_holder + if(quirk_carbon.can_heartattack() && !quirk_carbon.undergoing_cardiac_arrest()) + to_chat(quirk_carbon, span_userdanger("Your heart stops!")) + quirk_carbon.visible_message(span_danger("[quirk_carbon] grabs at their chest and collapses!"), ignored_mobs = quirk_carbon) + quirk_carbon.set_heartattack(TRUE) + caffeine_overdosed = FALSE + +/datum/quirk/caffeinated/proc/adjust_sprint_multipliers(new_sprint_length, new_sprint_regen) + if((new_sprint_length == sprint_length_multiplier) && (new_sprint_regen == sprint_regen_multiplier)) + return + var/mob/living/carbon/human/quirk_human = quirk_holder + //Reset to 1. + quirk_human.sprint_length_max /= sprint_length_multiplier + quirk_human.sprint_regen_per_second /= sprint_regen_multiplier + sprint_length_multiplier = new_sprint_length + sprint_regen_multiplier = new_sprint_regen + quirk_human.sprint_length_max *= new_sprint_length + quirk_human.sprint_regen_per_second *= new_sprint_regen + diff --git a/maplestation_modules/code/modules/clothing/suits/loadout_suits.dm b/maplestation_modules/code/modules/clothing/suits/loadout_suits.dm index e24c18727235..d9ea675bdb70 100644 --- a/maplestation_modules/code/modules/clothing/suits/loadout_suits.dm +++ b/maplestation_modules/code/modules/clothing/suits/loadout_suits.dm @@ -52,3 +52,4 @@ icon_state = "chesed_jacket" worn_icon = 'maplestation_modules/icons/mob/clothing/suit.dmi' blood_overlay_type = "armor" + clothing_traits = list(TRAIT_CAFFEINE_LOVER) diff --git a/maplestation_modules/code/modules/clothing/under/loadout_under.dm b/maplestation_modules/code/modules/clothing/under/loadout_under.dm index 6bef4c1f001c..e5ecd7c7a502 100644 --- a/maplestation_modules/code/modules/clothing/under/loadout_under.dm +++ b/maplestation_modules/code/modules/clothing/under/loadout_under.dm @@ -73,5 +73,5 @@ icon = 'maplestation_modules/icons/obj/clothing/under/ornithid_clothes.dmi' worn_icon = 'maplestation_modules/icons/mob/clothing/under/ornithid_clothes.dmi' icon_state = "chesed_suit" - + clothing_traits = list(TRAIT_CAFFEINE_LOVER) diff --git a/maplestation_modules/code/modules/reagents/chemistry/reagents/drink_reagents.dm b/maplestation_modules/code/modules/reagents/chemistry/reagents/drink_reagents.dm index bb560d8165ca..a73f34dde353 100644 --- a/maplestation_modules/code/modules/reagents/chemistry/reagents/drink_reagents.dm +++ b/maplestation_modules/code/modules/reagents/chemistry/reagents/drink_reagents.dm @@ -226,3 +226,121 @@ icon_state = "blood_wine" name = "Tiziran Blood Wine" desc = "A wine made from fermented blood originating from Tizira. Despite the name, the drink does not taste of blood." + +//the big chunk of caffeine-related additions + +//Weak-Level Caffeinated Drinks +/datum/reagent/consumable/ethanol/kahlua/on_mob_life(mob/living/carbon/affected_mob, seconds_per_tick, times_fired) + . = ..() + SEND_SIGNAL(affected_mob, COMSIG_CARBON_DRINK_CAFFEINE, CAFFEINE_POINTS_WEAK * seconds_per_tick) + if(HAS_TRAIT(affected_mob, TRAIT_CAFFEINE_LOVER)) + affected_mob.add_mood_event("caffeine_lover", /datum/mood_event/coffee_lover) + +/datum/reagent/consumable/ethanol/irishcoffee/on_mob_life(mob/living/carbon/affected_mob, seconds_per_tick, times_fired) + . = ..() + SEND_SIGNAL(affected_mob, COMSIG_CARBON_DRINK_CAFFEINE, CAFFEINE_POINTS_WEAK * seconds_per_tick) + if(HAS_TRAIT(affected_mob, TRAIT_CAFFEINE_LOVER)) + affected_mob.add_mood_event("caffeine_lover", /datum/mood_event/coffee_lover) + +/datum/reagent/consumable/pumpkin_latte/on_mob_life(mob/living/carbon/affected_mob, seconds_per_tick, times_fired) + . = ..() + SEND_SIGNAL(affected_mob, COMSIG_CARBON_DRINK_CAFFEINE, CAFFEINE_POINTS_WEAK * seconds_per_tick) //girl, you are OPPRESSING the coffee + if(HAS_TRAIT(affected_mob, TRAIT_CAFFEINE_LOVER)) + affected_mob.add_mood_event("caffeine_lover", /datum/mood_event/coffee_lover) + +/datum/reagent/medicine/painkiller/aspirin_para_coffee/on_mob_life(mob/living/carbon/affected_mob, seconds_per_tick, times_fired) + . = ..() + SEND_SIGNAL(affected_mob, COMSIG_CARBON_DRINK_CAFFEINE, CAFFEINE_POINTS_WEAK * seconds_per_tick) + +/datum/reagent/consumable/ethanol/bastion_bourbon/on_mob_life(mob/living/carbon/affected_mob, seconds_per_tick, times_fired) + . = ..() + SEND_SIGNAL(affected_mob, COMSIG_CARBON_DRINK_CAFFEINE, CAFFEINE_POINTS_WEAK * seconds_per_tick) + if(HAS_TRAIT(affected_mob, TRAIT_CAFFEINE_LOVER)) + affected_mob.add_mood_event("caffeine_lover", /datum/mood_event/tea_lover) + +/datum/reagent/consumable/tea/arnold_palmer/on_mob_life(mob/living/carbon/affected_mob, seconds_per_tick, times_fired) + . = ..() + SEND_SIGNAL(affected_mob, COMSIG_CARBON_DRINK_CAFFEINE, CAFFEINE_POINTS_WEAK * seconds_per_tick) + if(HAS_TRAIT(affected_mob, TRAIT_CAFFEINE_LOVER)) + affected_mob.add_mood_event("caffeine_lover", /datum/mood_event/tea_lover) + +//Coffee-Level Caffeinated Drinks + +/datum/reagent/consumable/coffee/on_mob_life(mob/living/carbon/affected_mob, seconds_per_tick, times_fired) + . = ..() + SEND_SIGNAL(affected_mob, COMSIG_CARBON_DRINK_CAFFEINE, CAFFEINE_POINTS_COFFEE * seconds_per_tick) + if(HAS_TRAIT(affected_mob, TRAIT_CAFFEINE_LOVER)) //we love coffee. + affected_mob.add_mood_event("caffeine_lover", /datum/mood_event/coffee_lover) + +/datum/reagent/consumable/ethanol/thirteenloko/on_mob_life(mob/living/carbon/affected_mob, seconds_per_tick, times_fired) + . = ..() + SEND_SIGNAL(affected_mob, COMSIG_CARBON_DRINK_CAFFEINE, CAFFEINE_POINTS_COFFEE * seconds_per_tick) + +/datum/reagent/consumable/icecoffee/on_mob_life(mob/living/carbon/affected_mob, seconds_per_tick, times_fired) + . = ..() + SEND_SIGNAL(affected_mob, COMSIG_CARBON_DRINK_CAFFEINE, CAFFEINE_POINTS_COFFEE * seconds_per_tick) + if(HAS_TRAIT(affected_mob, TRAIT_CAFFEINE_LOVER)) + affected_mob.add_mood_event("caffeine_lover", /datum/mood_event/coffee_lover) + +/datum/reagent/consumable/hot_ice_coffee/on_mob_life(mob/living/carbon/affected_mob, seconds_per_tick, times_fired) + . = ..() + SEND_SIGNAL(affected_mob, COMSIG_CARBON_DRINK_CAFFEINE, CAFFEINE_POINTS_COFFEE * seconds_per_tick) + if(HAS_TRAIT(affected_mob, TRAIT_CAFFEINE_LOVER)) + affected_mob.add_mood_event("caffeine_lover", /datum/mood_event/coffee_lover) + +/datum/reagent/consumable/soy_latte/on_mob_life(mob/living/carbon/affected_mob, seconds_per_tick, times_fired) + . = ..() + SEND_SIGNAL(affected_mob, COMSIG_CARBON_DRINK_CAFFEINE, CAFFEINE_POINTS_COFFEE * seconds_per_tick) + if(HAS_TRAIT(affected_mob, TRAIT_CAFFEINE_LOVER)) + affected_mob.add_mood_event("caffeine_lover", /datum/mood_event/coffee_lover) + +/datum/reagent/consumable/cafe_latte/on_mob_life(mob/living/carbon/affected_mob, seconds_per_tick, times_fired) + . = ..() + SEND_SIGNAL(affected_mob, COMSIG_CARBON_DRINK_CAFFEINE, CAFFEINE_POINTS_COFFEE * seconds_per_tick) + if(HAS_TRAIT(affected_mob, TRAIT_CAFFEINE_LOVER)) + affected_mob.add_mood_event("caffeine_lover", /datum/mood_event/coffee_lover) + +/datum/reagent/consumable/tea/on_mob_life(mob/living/carbon/affected_mob, seconds_per_tick, times_fired) + . = ..() + SEND_SIGNAL(affected_mob, COMSIG_CARBON_DRINK_CAFFEINE, CAFFEINE_POINTS_COFFEE * seconds_per_tick) + if(HAS_TRAIT(affected_mob, TRAIT_CAFFEINE_LOVER)) + affected_mob.add_mood_event("caffeine_lover", /datum/mood_event/tea_lover) + +/datum/reagent/consumable/icetea/on_mob_life(mob/living/carbon/affected_mob, seconds_per_tick, times_fired) + . = ..() + SEND_SIGNAL(affected_mob, COMSIG_CARBON_DRINK_CAFFEINE, CAFFEINE_POINTS_COFFEE * seconds_per_tick) + if(HAS_TRAIT(affected_mob, TRAIT_CAFFEINE_LOVER)) + affected_mob.add_mood_event("caffeine_lover", /datum/mood_event/tea_lover) + +/datum/reagent/consumable/green_tea/on_mob_life(mob/living/carbon/affected_mob, seconds_per_tick, times_fired) + . = ..() + SEND_SIGNAL(affected_mob, COMSIG_CARBON_DRINK_CAFFEINE, CAFFEINE_POINTS_COFFEE * seconds_per_tick) + if(HAS_TRAIT(affected_mob, TRAIT_CAFFEINE_LOVER)) + affected_mob.add_mood_event("caffeine_lover", /datum/mood_event/tea_lover) + +/datum/reagent/consumable/ice_greentea/on_mob_life(mob/living/carbon/affected_mob, seconds_per_tick, times_fired) + . = ..() + SEND_SIGNAL(affected_mob, COMSIG_CARBON_DRINK_CAFFEINE, CAFFEINE_POINTS_COFFEE * seconds_per_tick) + if(HAS_TRAIT(affected_mob, TRAIT_CAFFEINE_LOVER)) + affected_mob.add_mood_event("caffeine_lover", /datum/mood_event/tea_lover) + +//Energy-Level Caffeinated Drinks + +/datum/reagent/consumable/green_hill_tea/on_mob_life(mob/living/carbon/affected_mob, seconds_per_tick, times_fired) + . = ..() + SEND_SIGNAL(affected_mob, COMSIG_CARBON_DRINK_CAFFEINE, CAFFEINE_POINTS_ENERGY * seconds_per_tick) + if(HAS_TRAIT(affected_mob, TRAIT_CAFFEINE_LOVER)) + affected_mob.add_mood_event("caffeine_lover", /datum/mood_event/tea_lover) + +/datum/reagent/consumable/grey_bull/on_mob_life(mob/living/carbon/affected_mob, seconds_per_tick, times_fired) + . = ..() + SEND_SIGNAL(affected_mob, COMSIG_CARBON_DRINK_CAFFEINE, CAFFEINE_POINTS_ENERGY * seconds_per_tick) + if(HAS_TRAIT(affected_mob, TRAIT_CAFFEINE_LOVER)) + affected_mob.add_mood_event("caffeine_lover", /datum/mood_event/energy_lover) + +/datum/reagent/consumable/monkey_energy/on_mob_life(mob/living/carbon/affected_mob, seconds_per_tick, times_fired) + . = ..() + SEND_SIGNAL(affected_mob, COMSIG_CARBON_DRINK_CAFFEINE, CAFFEINE_POINTS_ENERGY * seconds_per_tick) + if(HAS_TRAIT(affected_mob, TRAIT_CAFFEINE_LOVER)) + affected_mob.add_mood_event("caffeine_lover", /datum/mood_event/energy_lover) +