Skip to content
This repository was archived by the owner on Sep 8, 2022. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions code/__DEFINES/obj_flags.dm
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,9 @@
#define SNUG_FIT (1<<9) //! prevents hat throwing from knocking this hat off
#define EFFECT_HAT (1<<10) //! For hats with an effect that shouldn't get knocked off ie finfoil
#define SCAN_REAGENTS (1<<11) //! Allows helmets and glasses to scan reagents.
#define MASKEXTENDRANGE (1<<12) //! For masks, allows you to breathe from internals on adjecent tiles
#define NOTCONSUMABLE (1<<13) //! Moths cannot eat clothing with that flag
#define SCAN_BOOZEPOWER (1<<12) //! Allows helmets and glasses to scan reagents.
#define MASKEXTENDRANGE (1<<13) //! For masks, allows you to breathe from internals on adjecent tiles
#define NOTCONSUMABLE (1<<14) //! Moths cannot eat clothing with that flag

/// Flags for the organ_flags var on /obj/item/organ

Expand Down
13 changes: 13 additions & 0 deletions code/__DEFINES/traits.dm
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,19 @@ Remember to update _globalvars/traits.dm if you're adding/removing/renaming trai
#define TRAIT_NONECRODISEASE "nonecrodisease"
#define TRAIT_NICE_SHOT "nice_shot" //hnnnnnnnggggg..... you're pretty good....
#define TRAIT_ALWAYS_STUBS "always_stubs_toe" //you will always stub your toe on tables, even if you're wearing shoes
<<<<<<< HEAD
=======
#define TRAIT_NAIVE "naive" //All dead people will appear as sleeping.
#define TRAIT_DROPS_ITEMS_ON_DEATH "drops_items_on_death" //used for battle royale
#define TRAIT_DRINKSBLOOD "drinks_blood"
#define TRAIT_SOMMELIER "sommelier" // shows different booze power flavor texts
#define TRAIT_BARMASTER "bar_master" // always can identify reagents

// You can stare into the abyss, but it does not stare back.
// You're immune to the hallucination effect of the supermatter, either
// through force of will, or equipment.
#define TRAIT_MADNESS_IMMUNE "supermatter_madness_immune"
>>>>>>> cd0a8c0b5d... Beer goggles now can measure Booze power and expect tastes (#7320)

//non-mob traits
#define TRAIT_PARALYSIS "paralysis" //Used for limb-based paralysis, where replacing the limb will fix it
Expand Down
74 changes: 74 additions & 0 deletions code/__HELPERS/unsorted.dm
Original file line number Diff line number Diff line change
Expand Up @@ -1593,3 +1593,77 @@ config_setting should be one of the following:
if(-INFINITY to 0, 11 to INFINITY)
CRASH("Can't turn invalid directions!")
return turn(input_dir, 180)

/atom/proc/get_boozepower_text(booze_power, mob/living/L)
if(isnull(booze_power))
return

if(HAS_TRAIT(L, TRAIT_SOMMELIER)) // A trained sommelier will have different identifying flavour
// because of float values, you need to write like `0 to 10`, `10 to 20`
switch(booze_power)
if(-INFINITY to 1)
. = "For children"
if(300 to INFINITY)
. = pick("Shift wrecking hammering",
"Get new liver after consumption",
"Post-consumption support groups exist",
"Place in Molotov instead",
"To stumble and slur, the will of Bacchus")
if(100 to 100)
. = "For a real man"
// these values must be detected first.

if(100 to 300)
. = "Cheated the blessing"
if(90 to 100)
. = "Get to drunk tank"
if(80 to 90)
. = "Liver pickler"
if(70 to 80)
. = "Drunkard's Challenge"
if(60 to 70)
. = "Have Shotgun ready"
if(50 to 60)
. = "3 rounds till down"
if(40 to 50)
. = "Drunkard's fixers"
if(30 to 40)
. = "Stick arounds"
if(20 to 30)
. = "Flask fillers"
if(10 to 20)
. = "Tipsy stuff"
if(1 to 10)
. = "Lightweight's dream"
else
switch(booze_power)
if(-INFINITY to 1)
. = "Safe for work"
if(300 to INFINITY)
. = "Lethal"
if(100 to 300)
. = "Deadly"
if(90 to 100)
. = "Dangerous"
if(80 to 90)
. = "Extreme"
if(70 to 80)
. = "Challenging"
if(60 to 70)
. = "Stronger"
if(50 to 60)
. = "Strong"
if(40 to 50)
. = "Average"
if(30 to 40)
. = "Less than average"
if(20 to 30)
. = "Light"
if(10 to 20)
. = "Mild"
if(1 to 10)
. = "Delightfully mild"

if(!.)
. = "not measurable. Ask the space god for what's wrong with this drink."
CRASH("not valid booze power value is detected: [booze_power]")
1 change: 1 addition & 0 deletions code/_globalvars/bitfields.dm
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,7 @@ DEFINE_BITFIELD(clothing_flags, list(
"SNUG_FIT" = SNUG_FIT,
"EFFECT_HAT" = EFFECT_HAT,
"SCAN_REAGENTS" = SCAN_REAGENTS,
"SCAN_BOOZEPOWER" = SCAN_BOOZEPOWER,
))

DEFINE_BITFIELD(tesla_flags, list(
Expand Down
20 changes: 20 additions & 0 deletions code/game/atoms.dm
Original file line number Diff line number Diff line change
Expand Up @@ -552,6 +552,7 @@
if(reagents.flags & TRANSPARENT)
. += "It contains:"
if(length(reagents.reagent_list))
//-------- Reagent checks ---------
if(user.can_see_reagents()) //Show each individual reagent
for(var/datum/reagent/R in reagents.reagent_list)
. += "[R.volume] units of [R.name]"
Expand All @@ -560,6 +561,25 @@
for(var/datum/reagent/R in reagents.reagent_list)
total_volume += R.volume
. += "[total_volume] units of various reagents"
//-------- Beer goggles ---------
if(user.can_see_boozepower())
var/total_boozepower = 0
var/list/taste_list = list()

// calculates the total booze power from all 'ethanol' reagents
for(var/datum/reagent/consumable/ethanol/B in reagents.reagent_list)
total_boozepower += B.volume * max(B.boozepwr, 0) // minus booze power is reversed to light drinkers, but is actually 0 to normal drinkers.

// gets taste results from all reagents
for(var/datum/reagent/R in reagents.reagent_list)
if(istype(R, /datum/reagent/consumable/ethanol/fruit_wine) && !(user.stat == DEAD) && !(HAS_TRAIT(src, TRAIT_BARMASTER)) ) // taste of fruit wine is mysterious, but can be known by ghosts/some special bar master trait holders
taste_list += "<br/> - unexplored taste of the winery (from [R.name])"
else
taste_list += "<br/> - [R.taste_description] (from [R.name])"
if(reagents.total_volume)
. += "<span class='notice'>Booze Power: total [total_boozepower], average [round(total_boozepower/reagents.total_volume, 0.1)] ([get_boozepower_text(total_boozepower/reagents.total_volume, user)])</span>"
. += "<span class='notice'>It would taste like: [english_list(taste_list, comma_text="", and_text="")].</span>"
//-------------------------------
else
. += "Nothing."
else if(reagents.flags & AMOUNT_VISIBLE)
Expand Down
8 changes: 8 additions & 0 deletions code/modules/awaymissions/corpse.dm
Original file line number Diff line number Diff line change
Expand Up @@ -411,6 +411,14 @@
glasses = /obj/item/clothing/glasses/sunglasses/advanced/reagent
id = /obj/item/card/id

/datum/outfit/spacebartender/post_equip(mob/living/carbon/human/H, visualsOnly = FALSE)
..()

if(visualsOnly)
return

ADD_TRAIT(H, TRAIT_SOMMELIER, ROUNDSTART_TRAIT)

/obj/effect/mob_spawn/human/beach
outfit = /datum/outfit/beachbum

Expand Down
4 changes: 2 additions & 2 deletions code/modules/clothing/glasses/_glasses.dm
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@
/obj/item/clothing/glasses/sunglasses/advanced/reagent
name = "beer goggles"
desc = "A pair of sunglasses outfitted with apparatus to scan reagents, as well as providing an innate understanding of liquid viscosity while in motion. Has enhanced shielding which blocks flashes."
clothing_flags = SCAN_REAGENTS
clothing_flags = SCAN_REAGENTS | SCAN_BOOZEPOWER

/obj/item/clothing/glasses/sunglasses/advanced/reagent/equipped(mob/user, slot)
. = ..()
Expand Down Expand Up @@ -452,7 +452,7 @@
item_state = "godeye"
vision_flags = SEE_TURFS|SEE_MOBS|SEE_OBJS
darkness_view = 8
clothing_flags = SCAN_REAGENTS
clothing_flags = SCAN_REAGENTS | SCAN_BOOZEPOWER
lighting_alpha = LIGHTING_PLANE_ALPHA_MOSTLY_INVISIBLE
resistance_flags = LAVA_PROOF | FIRE_PROOF

Expand Down
2 changes: 1 addition & 1 deletion code/modules/clothing/glasses/hud.dm
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@
darkness_view = 8
flash_protect = 2
vision_correction = 1
clothing_flags = SCAN_REAGENTS
clothing_flags = SCAN_REAGENTS | SCAN_BOOZEPOWER
lighting_alpha = LIGHTING_PLANE_ALPHA_MOSTLY_INVISIBLE
hud_type = list(DATA_HUD_MEDICAL_ADVANCED, DATA_HUD_DIAGNOSTIC_ADVANCED, DATA_HUD_SECURITY_ADVANCED)
resistance_flags = INDESTRUCTIBLE
Expand Down
8 changes: 8 additions & 0 deletions code/modules/jobs/job_types/bartender.dm
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,11 @@
backpack_contents = list(/obj/item/storage/box/beanbag=1)
shoes = /obj/item/clothing/shoes/laceup


/datum/outfit/job/bartender/post_equip(mob/living/carbon/human/H, visualsOnly = FALSE)
..()

if(visualsOnly)
return

ADD_TRAIT(H, TRAIT_SOMMELIER, ROUNDSTART_TRAIT)
11 changes: 11 additions & 0 deletions code/modules/mob/living/carbon/human/human_helpers.dm
Original file line number Diff line number Diff line change
Expand Up @@ -191,3 +191,14 @@
return TRUE
if(isclothing(wear_mask) && (wear_mask.clothing_flags & SCAN_REAGENTS))
return TRUE

/mob/living/carbon/human/can_see_boozepower()
. = ..()
if(.)
return
if(isclothing(glasses) && (glasses.clothing_flags & SCAN_BOOZEPOWER))
return TRUE
if(isclothing(head) && (head.clothing_flags & SCAN_BOOZEPOWER))
return TRUE
if(isclothing(wear_mask) && (wear_mask.clothing_flags & SCAN_BOOZEPOWER))
return TRUE
17 changes: 16 additions & 1 deletion code/modules/mob/mob_helpers.dm
Original file line number Diff line number Diff line change
Expand Up @@ -613,4 +613,19 @@

//Can the mob see reagents inside of containers?
/mob/proc/can_see_reagents()
return stat == DEAD || has_unlimited_silicon_privilege //Dead guys and silicons can always see reagents
. = FALSE
if(stat == DEAD) // Dead guys and silicons can always see reagents
return TRUE
else if(has_unlimited_silicon_privilege)
return TRUE
else if(HAS_TRAIT(src, TRAIT_BARMASTER)) // If they're a bar master, they know what reagents are at a glance
return TRUE

/mob/proc/can_see_boozepower() // same rule above
. = FALSE
if(stat == DEAD)
return TRUE
else if(has_unlimited_silicon_privilege)
return TRUE
else if(HAS_TRAIT(src, TRAIT_BARMASTER))
return TRUE
5 changes: 5 additions & 0 deletions code/modules/shuttle/special.dm
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,9 @@
/mob/living/simple_animal/drone/snowflake/bardrone/Initialize()
. = ..()
access_card.access |= ACCESS_CENT_BAR
ADD_TRAIT(src, TRAIT_BARMASTER, ROUNDSTART_TRAIT)
ADD_TRAIT(src, TRAIT_SOMMELIER, ROUNDSTART_TRAIT)


/mob/living/simple_animal/hostile/alien/maid/barmaid
gold_core_spawnable = NO_SPAWN
Expand All @@ -168,6 +171,8 @@
access_card.access = C.get_access()
access_card.access |= ACCESS_CENT_BAR
ADD_TRAIT(access_card, TRAIT_NODROP, ABSTRACT_ITEM_TRAIT)
ADD_TRAIT(src, TRAIT_BARMASTER, ROUNDSTART_TRAIT)
ADD_TRAIT(src, TRAIT_SOMMELIER, ROUNDSTART_TRAIT)

/mob/living/simple_animal/hostile/alien/maid/barmaid/Destroy()
qdel(access_card)
Expand Down