Merge pull request #12604 from VOREStation/upstream-merge-8431

[MIRROR] Allergen CE Conversion
This commit is contained in:
Casey
2022-04-17 18:40:34 -04:00
committed by GitHub
9 changed files with 56 additions and 37 deletions

View File

@@ -36,6 +36,7 @@
#define CE_SPEEDBOOST "gofast" // Hyperzine
#define CE_SLOWDOWN "goslow" // Slowdown
#define CE_ANTACID "nopuke" // Don't puke.
#define CE_ALLERGEN "allergyreaction" // Self explanatory
#define REAGENTS_PER_SHEET 20

View File

@@ -40,14 +40,16 @@
#define ALLERGEN_STIMULANT 0x1000 // Stimulants are what makes the Tajaran heart go ruh roh - not just coffee!
// Allergen reactions
#define AG_TOX_DMG 0x1 // the classic
#define AG_OXY_DMG 0x2 // intense airway reactions
#define AG_EMOTE 0x4 // general emote reactions based on affect type
#define AG_PAIN 0x8 // short-lived hurt
#define AG_WEAKEN 0x10 // too weak to move, oof
#define AG_BLURRY 0x20 // blurred vision!
#define AG_SLEEPY 0x40 // fatigue/exhaustion
#define AG_CONFUSE 0x80 // disorientation - VOREStation addition
#define AG_PHYS_DMG 0x1 // brute
#define AG_BURN_DMG 0x2 // burns
#define AG_TOX_DMG 0x4 // the classic
#define AG_OXY_DMG 0x8 // intense airway reactions
#define AG_EMOTE 0x10 // general emote reactions based on affect type
#define AG_PAIN 0x20 // short-lived hurt
#define AG_WEAKEN 0x40 // too weak to move, oof
#define AG_BLURRY 0x80 // blurred vision!
#define AG_SLEEPY 0x100 // fatigue/exhaustion
#define AG_CONFUSE 0x200 // disorientation
// Species spawn flags
#define SPECIES_IS_WHITELISTED 0x1 // Must be whitelisted to play.

View File

@@ -430,6 +430,10 @@
else
chem_effects[effect] = magnitude
/mob/living/carbon/proc/remove_chemical_effect(var/effect, var/magnitude)
if(effect in chem_effects)
chem_effects[effect] = magnitude ? max(0,chem_effects[effect]-magnitude) : 0
/mob/living/carbon/get_default_language()
if(default_language)
if(can_speak(default_language))

View File

@@ -84,6 +84,8 @@
handle_shock()
handle_pain()
handle_allergens()
handle_medical_side_effects()
@@ -638,6 +640,35 @@
breath.update_values()
return 1
/mob/living/carbon/human/proc/handle_allergens()
if(chem_effects[CE_ALLERGEN])
//first, multiply the basic species-level value by our allergen effect rating, so consuming multiple seperate allergen typess simultaneously hurts more
var/damage_severity = species.allergen_damage_severity * chem_effects[CE_ALLERGEN]
var/disable_severity = species.allergen_disable_severity * chem_effects[CE_ALLERGEN]
if(species.allergen_reaction & AG_PHYS_DMG)
adjustBruteLoss(damage_severity)
if(species.allergen_reaction & AG_BURN_DMG)
adjustFireLoss(damage_severity)
if(species.allergen_reaction & AG_TOX_DMG)
adjustToxLoss(damage_severity)
if(species.allergen_reaction & AG_OXY_DMG)
adjustOxyLoss(damage_severity)
if(prob(disable_severity/2))
emote(pick("cough","gasp","choke"))
if(species.allergen_reaction & AG_EMOTE)
if(prob(disable_severity/2))
emote(pick("pale","shiver","twitch"))
if(species.allergen_reaction & AG_PAIN)
adjustHalLoss(disable_severity)
if(species.allergen_reaction & AG_WEAKEN)
Weaken(disable_severity)
if(species.allergen_reaction & AG_BLURRY)
eye_blurry = max(eye_blurry, disable_severity)
if(species.allergen_reaction & AG_SLEEPY)
drowsyness = max(drowsyness, disable_severity)
if(species.allergen_reaction & AG_CONFUSE)
Confuse(disable_severity/4)
/mob/living/carbon/human/handle_environment(datum/gas_mixture/environment)
if(!environment)
return

View File

@@ -53,9 +53,9 @@
var/taste_sensitivity = TASTE_NORMAL // How sensitive the species is to minute tastes.
var/allergens = null // Things that will make this species very sick
var/allergen_reaction = AG_TOX_DMG|AG_OXY_DMG|AG_EMOTE|AG_PAIN|AG_BLURRY|AG_CONFUSE // What type of reactions will you have? These the 'main' options and are intended to approximate anaphylactic shock at high doses. VOREStation Edit'd.
var/allergen_damage_severity = 4 // How bad are reactions to the allergen? Touch with extreme caution. VOREStation Edit'd.
var/allergen_disable_severity = 4 // Whilst this determines how long nonlethal effects last and how common emotes are. VOREStation Edit'd.
var/allergen_reaction = AG_TOX_DMG|AG_OXY_DMG|AG_EMOTE|AG_PAIN|AG_BLURRY|AG_CONFUSE // What type of reactions will you have? These the 'main' options and are intended to approximate anaphylactic shock at high doses.
var/allergen_damage_severity = 2.5 // How bad are reactions to the allergen? Touch with extreme caution.
var/allergen_disable_severity = 10 // Whilst this determines how long nonlethal effects last and how common emotes are.
var/min_age = 17
var/max_age = 70

View File

@@ -251,7 +251,7 @@
desc = "This trait drastically reduces the effects of allergen reactions. If you don't have any allergens set, it does nothing. It does not apply to special reactions (such as unathi drowsiness from sugars)."
cost = 0
custom_only = FALSE
var_changes = list("allergen_damage_severity" = 2, "allergen_disable_severity" = 3)
var_changes = list("allergen_damage_severity" = 1.25, "allergen_disable_severity" = 5)
excludes = list(/datum/trait/neutral/allergen_increased_effect)
/datum/trait/neutral/allergen_increased_effect
@@ -259,7 +259,7 @@
desc = "This trait drastically increases the effects of allergen reactions, enough that even a small dose can be lethal. If you don't have any allergens set, it does nothing. It does not apply to special reactions (such as unathi drowsiness from sugars)."
cost = 0
custom_only = FALSE
var_changes = list("allergen_damage_severity" = 8, "allergen_disable_severity" = 6)
var_changes = list("allergen_damage_severity" = 5, "allergen_disable_severity" = 20)
excludes = list(/datum/trait/neutral/allergen_reduced_effect)
// Spicy Food Traits, from negative to positive.

View File

@@ -27,7 +27,7 @@
var/affects_robots = 0 // Does this chem process inside a Synth?
var/allergen_type // What potential allergens does this contain?
var/allergen_factor = 1 // If the potential allergens are mixed and low-volume, they're a bit less dangerous. Needed for drinks because they're a single reagent compared to food which contains multiple seperate reagents.
var/allergen_factor = 2 // If the potential allergens are mixed and low-volume, they're a bit less dangerous. Needed for drinks because they're a single reagent compared to food which contains multiple seperate reagents.
var/cup_icon_state = null
var/cup_name = null
@@ -171,27 +171,7 @@
if(overdose && (volume > overdose * M?.species.chemOD_threshold) && (active_metab.metabolism_class != CHEM_TOUCH && !can_overdose_touch))
overdose(M, alien, removed)
if(M.species.allergens & allergen_type) //uhoh, we can't handle this!
var/damage_severity = M.species.allergen_damage_severity*allergen_factor
var/disable_severity = M.species.allergen_disable_severity*allergen_factor
if(M.species.allergen_reaction & AG_TOX_DMG)
M.adjustToxLoss(damage_severity)
if(M.species.allergen_reaction & AG_OXY_DMG)
M.adjustOxyLoss(damage_severity*1.5) //VOREStation Edit
if(prob(2.5*disable_severity))
M.emote(pick("cough","gasp","choke"))
if(M.species.allergen_reaction & AG_EMOTE)
if(prob(2.5*disable_severity)) //this has a higher base chance, but not *too* high
M.emote(pick("pale","shiver","twitch"))
if(M.species.allergen_reaction & AG_PAIN)
M.adjustHalLoss(disable_severity*2) //VOREStation Edit
if(M.species.allergen_reaction & AG_WEAKEN)
M.Weaken(disable_severity)
if(M.species.allergen_reaction & AG_BLURRY)
M.eye_blurry = max(M.eye_blurry, disable_severity)
if(M.species.allergen_reaction & AG_SLEEPY)
M.drowsyness = max(M.drowsyness, disable_severity)
if(M.species.allergen_reaction & AG_CONFUSE) //VOREStation Addition
M.Confuse(disable_severity/4) //VOREStation Addition
M.add_chemical_effect(CE_ALLERGEN,allergen_factor)
remove_self(removed)
return

View File

@@ -104,7 +104,7 @@
glass_name = "ethanol"
glass_desc = "A well-known alcohol with a variety of applications."
allergen_factor = 0.5 //simulates mixed drinks containing less of the allergen, as they have only a single actual reagent unlike food
allergen_factor = 1 //simulates mixed drinks containing less of the allergen, as they have only a single actual reagent unlike food
/datum/reagent/ethanol/touch_mob(var/mob/living/L, var/amount)
..()

View File

@@ -3,7 +3,7 @@
/datum/reagent/inaprovaline
name = "Inaprovaline"
id = "inaprovaline"
description = "Inaprovaline is a synaptic stimulant and cardiostimulant. Commonly used to stabilize patients."
description = "Inaprovaline is a synaptic stimulant and cardiostimulant. Commonly used to stabilize patients. Also counteracts allergic reactions."
taste_description = "bitterness"
reagent_state = LIQUID
color = "#00BFFF"
@@ -15,6 +15,7 @@
if(alien != IS_DIONA)
M.add_chemical_effect(CE_STABLE, 15)
M.add_chemical_effect(CE_PAINKILLER, 10 * M.species.chem_strength_pain)
M.remove_chemical_effect(CE_ALLERGEN)
/datum/reagent/inaprovaline/topical
name = "Inaprovalaze"