Skip to content

Commit

Permalink
[MIRROR] rolls Heavy Sleeper into the new All Nighter quirk, which ca…
Browse files Browse the repository at this point in the history
…rries extra... baggage (#867)

* [MIRROR] rolls Heavy Sleeper into the new All Nighter quirk, which carries extra... baggage [MDB IGNORE] (#25298)

* Delete negative.dm

* no gifted for us

---------

Co-authored-by: SkyratBot <[email protected]>
Co-authored-by: wesoda25 <[email protected]>
Co-authored-by: Giz <[email protected]>
Co-authored-by: Iajret <[email protected]>
  • Loading branch information
5 people authored Nov 29, 2023
1 parent 489f917 commit bd894e5
Show file tree
Hide file tree
Showing 15 changed files with 288 additions and 156 deletions.
1 change: 1 addition & 0 deletions code/controllers/subsystem/processing/quirks.dm
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ GLOBAL_LIST_INIT_TYPED(quirk_blacklist, /list/datum/quirk, list(
list(/datum/quirk/no_guns, /datum/quirk/nonviolent),
list(/datum/quirk/spacer_born, /datum/quirk/oversized),
list(/datum/quirk/feline_aspect, /datum/quirk/item_quirk/canine, /datum/quirk/item_quirk/avian),
list(/datum/quirk/all_nighter, /datum/quirk/heavy_sleeper),
//SKYRAT EDIT ADDITION END
))

Expand Down
6 changes: 6 additions & 0 deletions code/datums/bodypart_overlays/simple_bodypart_overlay.dm
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,9 @@
/datum/bodypart_overlay/simple/creampie
icon_state = "creampie_human"
layers = EXTERNAL_FRONT

///bags drawn beneath the eyes
/datum/bodypart_overlay/simple/bags
icon_state = "bags"
draw_color = COLOR_WEBSAFE_DARK_GRAY
layers = EXTERNAL_ADJACENT
4 changes: 4 additions & 0 deletions code/datums/mood_events/generic_negative_events.dm
Original file line number Diff line number Diff line change
Expand Up @@ -444,3 +444,7 @@
description = "UNWORTHY, UNWORTHY, UNWORTHY!!!"
mood_change = -200
special_screen_obj = "mood_despair"

/datum/mood_event/all_nighter
description = "I didn't sleep at all last night. I'm exhausted."
mood_change = -5
115 changes: 115 additions & 0 deletions code/datums/quirks/negative_quirks/all_nighter.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
#define SLEEP_BANK_MULTIPLIER 10

/datum/quirk/all_nighter
name = "All Nighter"
desc = "You didn't get any sleep last night, and people can tell! You'll constantly be in a bad mood and will have a tendency to sleep longer. Stimulants or a nap might help, though."
icon = FA_ICON_BED
value = -4
mob_trait = TRAIT_HEAVY_SLEEPER
gain_text = span_danger("You feel exhausted.")
lose_text = span_notice("You feel well rested.")
medical_record_text = "Patient appears to be suffering from sleep deprivation."
hardcore_value = 2
quirk_flags = QUIRK_HUMAN_ONLY|QUIRK_CHANGES_APPEARANCE|QUIRK_MOODLET_BASED|QUIRK_PROCESSES

mail_goodies = list(
/obj/item/clothing/glasses/blindfold,
/obj/item/bedsheet/random,
/obj/item/clothing/under/misc/pj/red,
/obj/item/clothing/head/costume/nightcap/red,
/obj/item/clothing/under/misc/pj/blue,
/obj/item/clothing/head/costume/nightcap/blue,
/obj/item/pillow/random,
)

///a list of all the reagents which alleviate the negative moodlet
var/list/stimulants = list(
/datum/reagent/medicine/stimulants,
/datum/reagent/drug/methamphetamine,
/datum/reagent/drug/bath_salts,
/datum/reagent/drug/aranesp,
/datum/reagent/drug/pumpup,
/datum/reagent/drug/blastoff,
/datum/reagent/consumable/coffee,
/datum/reagent/consumable/tea
)
///essentially our "sleep bank". sleeping charges it up and its drained while awake
var/five_more_minutes = 0
///the overlay we put over the eyes
var/datum/bodypart_overlay/simple/bags/bodypart_overlay


///adds the corresponding moodlet and visual effects
/datum/quirk/all_nighter/add(client/client_source)
quirk_holder.add_mood_event("all_nighter", /datum/mood_event/all_nighter)
add_bags()

///removes the corresponding moodlet and visual effects
/datum/quirk/all_nighter/remove(client/client_source)
quirk_holder.clear_mood_event("all_nighter", /datum/mood_event/all_nighter)
remove_bags()

///adds the bag overlay
/datum/quirk/all_nighter/proc/add_bags(client/client_source)
var/mob/living/carbon/human/sleepy_head = quirk_holder
var/obj/item/bodypart/head/face = sleepy_head.get_bodypart(BODY_ZONE_HEAD)
bodypart_overlay = new() //creates our overlay
face.add_bodypart_overlay(bodypart_overlay)
sleepy_head.update_body_parts() //make sure to update icon

///removes the bag overlay
/datum/quirk/all_nighter/proc/remove_bags(client/client_source)
var/mob/living/carbon/human/sleepy_head = quirk_holder
var/obj/item/bodypart/head/face = sleepy_head.get_bodypart(BODY_ZONE_HEAD)
//our overlay is stored as a datum var, so referencing it is easy
face.remove_bodypart_overlay(bodypart_overlay)
QDEL_NULL(bodypart_overlay)
sleepy_head.update_body_parts()

/**
*Here we actively handle our moodlet & eye bags, adding/removing them as necessary
*
**Logic:
**Every second spent sleeping adds to the "sleep bank" with a multiplier of SLEEP_BANK_MULTIPLIER
**Every waking second drains the sleep bank until empty
**An empty sleep bank means you have bags beneath your eyes
**An empty sleep bank AND a lack of stimulants means you have the negative moodlet
*
**Variables:
**happy_camper - FALSE if we should have the negative moodlet
**beauty_sleep - FALSE if we should have bags
*/
/datum/quirk/all_nighter/process(seconds_per_tick)
var/happy_camper = TRUE
var/beauty_sleep = TRUE
var/stims_present = FALSE

if(quirk_holder.IsSleeping())
five_more_minutes += SLEEP_BANK_MULTIPLIER * seconds_per_tick
else if(five_more_minutes > 0)
five_more_minutes -= seconds_per_tick
else
beauty_sleep = FALSE //no sleep means eye bags

for(var/stimulant in stimulants)
if(quirk_holder.has_reagent(stimulant)) //checking for stims
stims_present = TRUE
break
if(!stims_present) //no stims and no sleep means an unhappy camper
happy_camper = FALSE

//adjusts the mood event accordingly
if(("all_nighter" in quirk_holder.mob_mood.mood_events) && happy_camper)
quirk_holder.clear_mood_event("all_nighter", /datum/mood_event/all_nighter)
if(!("all_nighter" in quirk_holder.mob_mood.mood_events) && !happy_camper)
quirk_holder.add_mood_event("all_nighter", /datum/mood_event/all_nighter)
to_chat(quirk_holder, span_danger("You start feeling tired again."))

//adjusts bag overlay accordingly
if(bodypart_overlay && beauty_sleep)
remove_bags()
if(!bodypart_overlay && !beauty_sleep)
add_bags()


#undef SLEEP_BANK_MULTIPLIER
Binary file modified icons/mob/human/species/misc/bodypart_overlay_simple.dmi
Binary file not shown.
101 changes: 0 additions & 101 deletions modular_skyrat/master_files/code/datums/quirks/negative.dm

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// This was using the same icon as heavy sleeper. The moon makes more sense for this one
/datum/quirk/all_nighter
icon = FA_ICON_CLOUD_MOON
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// Override of Blood Deficiency quirk for robotic/synthetic species.
// Does not appear in TGUI or the character preferences window.
/datum/quirk/blooddeficiency/synth
name = "Hydraulic Leak"
desc = "Your body's hydraulic fluids are leaking through their seals."
medical_record_text = "Patient requires regular treatment for hydraulic fluid loss."
icon = FA_ICON_GLASS_WATER_DROPLET
mail_goodies = list(/obj/item/reagent_containers/blood/oil)
// min_blood = BLOOD_VOLUME_BAD - 25; // TODO: Uncomment after TG PR #70563
hidden_quirk = TRUE

// If blooddeficiency is added to a synth, this detours to the blooddeficiency/synth quirk.
/datum/quirk/blooddeficiency/add_to_holder(mob/living/new_holder, quirk_transfer, client/client_source)
if(!issynthetic(new_holder) || type != /datum/quirk/blooddeficiency)
// Defer to TG blooddeficiency if the character isn't robotic.
return ..()

var/datum/quirk/blooddeficiency/synth/bd_synth = new
qdel(src)
return bd_synth.add_to_holder(new_holder, quirk_transfer)
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
// Re-labels TG brainproblems to be more generic. There never was a tumor anyways!
/datum/quirk/item_quirk/brainproblems
name = "Brain Degeneration"
desc = "You have a lethal condition in your brain that is slowly destroying it. Better bring some mannitol!"
medical_record_text = "Patient has a lethal condition in their brain that is slowly causing brain death."
icon = FA_ICON_BRAIN

// Override of Brain Tumor quirk for robotic/synthetic species with posibrains.
// Does not appear in TGUI or the character preferences window.
/datum/quirk/item_quirk/brainproblems/synth
name = "Positronic Cascade Anomaly"
desc = "Your positronic brain is slowly corrupting itself due to a cascading anomaly. Better bring some liquid solder!"
gain_text = "<span class='danger'>You feel glitchy.</span>"
lose_text = "<span class='notice'>You no longer feel glitchy.</span>"
medical_record_text = "Patient has a cascading anomaly in their brain that is slowly causing brain death."
icon = FA_ICON_BRAZILIAN_REAL_SIGN
mail_goodies = list(/obj/item/storage/pill_bottle/liquid_solder/braintumor)
hidden_quirk = TRUE

// If brainproblems is added to a synth, this detours to the brainproblems/synth quirk.
// TODO: Add more brain-specific detours when PR #16105 is merged
/datum/quirk/item_quirk/brainproblems/add_to_holder(mob/living/new_holder, quirk_transfer, client/client_source)
if(!issynthetic(new_holder) || type != /datum/quirk/item_quirk/brainproblems)
// Defer to TG brainproblems if the character isn't robotic.
return ..()

// TODO: Check brain type and detour to appropriate brainproblems quirk
var/datum/quirk/item_quirk/brainproblems/synth/bp_synth = new
qdel(src)
return bp_synth.add_to_holder(new_holder, quirk_transfer, client_source)

// Synthetics get liquid_solder with Brain Tumor instead of mannitol.
/datum/quirk/item_quirk/brainproblems/synth/add_unique(client/client_source)
give_item_to_holder(
/obj/item/storage/pill_bottle/liquid_solder/braintumor,
list(
LOCATION_LPOCKET = ITEM_SLOT_LPOCKET,
LOCATION_RPOCKET = ITEM_SLOT_RPOCKET,
LOCATION_BACKPACK = ITEM_SLOT_BACKPACK,
LOCATION_HANDS = ITEM_SLOT_HANDS,
),
flavour_text = "These will keep you alive until you can secure a supply of medication. Don't rely on them too much!",
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/datum/quirk/gifted
name = "Gifted"
desc = "You were born a bit lucky, intelligent, or something in between. You're able to do a little more."
icon = FA_ICON_DOVE
quirk_flags = QUIRK_HUMAN_ONLY|QUIRK_HIDE_FROM_SCAN
value = -6
mob_trait = TRAIT_GIFTED
gain_text = span_danger("You feel like you're just a little bit more flexible.")
lose_text = span_notice("You feel a little less flexible.")
medical_record_text = "Patient has a history of uncanny fortune."
hardcore_value = 0
hidden_quirk = TRUE // FF EDIT: ADDITION - Removing freebie points, staff decision
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// re-adds heavy sleeper
/datum/quirk/heavy_sleeper
name = "Heavy Sleeper"
desc = "You sleep like a rock! Whenever you're put to sleep or knocked unconscious, you take a little bit longer to wake up."
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/datum/quirk/equipping/nerve_staple
name = "Nerve Stapled"
desc = "You're a pacifist. Not because you want to be, but because of the device stapled into your eye."
value = -10 // pacifism = -8, losing eye slots = -2
gain_text = span_danger("You suddenly can't raise a hand to hurt others!")
lose_text = span_notice("You think you can defend yourself again.")
medical_record_text = "Patient is nerve stapled and is unable to harm others."
icon = FA_ICON_FACE_ANGRY
forced_items = list(/obj/item/clothing/glasses/nerve_staple = list(ITEM_SLOT_EYES))
/// The nerve staple attached to the quirk
var/obj/item/clothing/glasses/nerve_staple/staple

/datum/quirk/equipping/nerve_staple/on_equip_item(obj/item/equipped, successful)
if (!istype(equipped, /obj/item/clothing/glasses/nerve_staple))
return
staple = equipped

/datum/quirk/equipping/nerve_staple/remove()
. = ..()
if (!staple || staple != quirk_holder.get_item_by_slot(ITEM_SLOT_EYES))
return
to_chat(quirk_holder, span_warning("The nerve staple suddenly falls off your face and melts[istype(quirk_holder.loc, /turf/open/floor) ? " on the floor" : ""]!"))
qdel(staple)
Loading

0 comments on commit bd894e5

Please sign in to comment.