Metabolism refactor (#4395)

* metabolism -> respirator, add reageanteffect and reagenteffectcondition, start on metabolizercomp/system

* move LiverBehavior metabolism logic to Metabolizer

* minor tweaks and update all YAML

* how about actually taking conditions into account

* off by one

* removals

* reviews
This commit is contained in:
mirrorcult
2021-07-31 04:50:32 -07:00
committed by GitHub
parent dc18997bf8
commit 8aa4f998de
36 changed files with 572 additions and 558 deletions

View File

@@ -50,18 +50,30 @@
compatibility: Biological
- type: entity
id: OrganHumanHeart
id: OrganHumanTongue
parent: BaseHumanOrgan
name: heart
description: "I feel bad for the heartless bastard who lost this."
name: tongue
description: "A fleshy muscle mostly used for lying."
components:
- type: Sprite
state: heart-on
state: tongue
- type: Mechanism
size: 1
compatibility: Biological
- type: entity
id: OrganHumanAppendix
parent: BaseHumanOrgan
name: appendix
components:
- type: Sprite
layers:
- state: appendix
- state: appendix-inflamed
visible: false
- type: Mechanism
size: 1
compatibility: Biological
behaviors:
- !type:HeartBehavior {}
- type: entity
id: OrganHumanEars
@@ -91,6 +103,92 @@
behaviors:
- !type:LungBehavior {}
- type: entity
id: OrganHumanHeart
parent: BaseHumanOrgan
name: heart
description: "I feel bad for the heartless bastard who lost this."
components:
- type: Sprite
state: heart-on
- type: Mechanism
size: 1
compatibility: Biological
behaviors:
- !type:HeartBehavior {}
# The heart 'metabolizes' medicines and poisons that aren't filtered out by other organs.
# This is done because these chemicals need to have some effect even if they aren't being filtered out of your body.
# You're technically 'immune to poison' without a heart, but.. uhh, you'll have bigger problems on your hands.
- type: Metabolizer
metabolisms:
Dylovene:
effects:
- !type:HealthChange
damageClass: Toxin
healthChange: -1
Arithrazine:
effects:
- !type:HealthChange
damageClass: Toxin
healthChange: -1
- !type:HealthChange
damageClass: Brute
healthChange: 0.5
Bicaridine:
effects:
- !type:HealthChange
damageClass: Brute
healthChange: -2
Dermaline:
effects:
- !type:HealthChange
damageClass: Burn
healthChange: -3
Dexalin:
effects:
- !type:HealthChange
damageClass: Airloss
healthChange: -1
DexalinPlus:
effects:
- !type:HealthChange
damageClass: Airloss
healthChange: -3
Kelotane:
effects:
- !type:HealthChange
damageClass: Burn
healthChange: -1
Synaptizine:
effects:
- !type:HealthChange
damageClass: Toxin
healthChange: 0.5
HeartbreakerToxin:
effects:
- !type:HealthChange
damageClass: Airloss
healthChange: 4
Lexorin:
effects:
- !type:HealthChange
damageClass: Airloss
healthChange: 7
Omnizine:
effects:
- !type:HealthChange
healthChange: -2
damageClass: Burn
- !type:HealthChange
healthChange: -2
damageClass: Toxin
- !type:HealthChange
healthChange: -2
damageClass: Airloss
- !type:HealthChange
healthChange: -2
damageClass: Brute
- type: entity
id: OrganHumanStomach
parent: BaseHumanOrgan
@@ -108,6 +206,93 @@
digestionDelay: 20
- type: SolutionContainer
maxVol: 250
# The stomach metabolizes stuff like foods and drinks.
# TODO: Have it work off of the ent's solution container, and move this
# to intestines instead.
- type: Metabolizer # Release me from this hell called 1 reagent for every drink
# TODO please make every drink their own base thing
metabolisms:
Flour:
effects:
- !type:SatiateHunger
JuiceApple:
effects:
- !type:SatiateThirst
JuiceBerry:
effects:
- !type:SatiateThirst
JuiceBanana:
effects:
- !type:SatiateThirst
JuiceCarrot:
effects:
- !type:SatiateThirst
JuiceLime:
effects:
- !type:SatiateThirst
JuiceLemon:
effects:
- !type:SatiateThirst
JuiceGrape:
effects:
- !type:SatiateThirst
JuiceOrange:
effects:
- !type:SatiateThirst
JuiceTomato:
effects:
- !type:SatiateThirst
JuiceBerryPoison:
effects:
- !type:SatiateThirst
- !type:HealthChange
damageClass: Toxin
healthChange: 1
JuiceWatermelon:
effects:
- !type:SatiateThirst
JuicePineapple:
effects:
- !type:SatiateThirst
Nutriment:
effects:
- !type:SatiateHunger
Water:
effects:
- !type:SatiateThirst
hydrationFactor: 2
Coffee:
effects:
- !type:SatiateThirst
Tea:
effects:
- !type:SatiateThirst
Milk:
effects:
- !type:SatiateThirst
SpoiledMilk:
effects:
- !type:SatiateThirst
hydrationFactor: -2
MilkSoy:
effects:
- !type:SatiateThirst
hydrationFactor: 2 # soyboys stay winning
MilkOat:
effects:
- !type:SatiateThirst
hydrationFactor: 2 # oatboys stay winning
Cola:
effects:
- !type:SatiateThirst
hydrationFactor: 0.5 # sodaboys stay losing
ThirteenLoko:
effects:
- !type:SatiateThirst
hydrationFactor: 2
- !type:HealthChange
damageClass: Toxin
healthChange: 1
- type: entity
id: OrganHumanLiver
@@ -120,12 +305,17 @@
- type: Mechanism
size: 1
compatibility: Biological
behaviors:
- !type:LiverBehavior
alcoholLethality: 0.005
alcoholExponent: 1.6
toxinTolerance: 3
toxinLethality: 0.01
- type: Metabolizer # The liver metabolizes certain chemicals only, like alcohol.
metabolisms: # TODO add the rest of alcohol
CreamyDelight:
effects:
- !type:SatiateThirst
Lean:
effects:
- !type:SatiateThirst
LeanShine: # who added this?
effects:
- !type:SatiateThirst
- type: entity
id: OrganHumanKidneys
@@ -141,28 +331,4 @@
size: 1
compatibility: Biological
- type: entity
id: OrganHumanTongue
parent: BaseHumanOrgan
name: tongue
description: "A fleshy muscle mostly used for lying."
components:
- type: Sprite
state: tongue
- type: Mechanism
size: 1
compatibility: Biological
- type: entity
id: OrganHumanAppendix
parent: BaseHumanOrgan
name: appendix
components:
- type: Sprite
layers:
- state: appendix
- state: appendix-inflamed
visible: false
- type: Mechanism
size: 1
compatibility: Biological

View File

@@ -67,7 +67,7 @@
currentTemperature: 310.15
specificHeat: 42
tempDamageCoefficient: 0.1
- type: Metabolism
- type: Respirator
metabolismHeat: 5000
radiatedHeat: 400
implicitHeatRegulation: 5000

View File

@@ -38,7 +38,7 @@
0: !type:NormalMobState {}
150: !type:CriticalMobState {}
200: !type:DeadMobState {}
- type: Metabolism
- type: Respirator
- type: UnarmedCombat
range: 1.5
arcwidth: 0

View File

@@ -167,7 +167,7 @@
preset: HumanPreset
- type: Damageable
damageContainer: biologicalDamageContainer
- type: Metabolism
- type: Respirator
metabolismHeat: 5000
radiatedHeat: 400
implicitHeatRegulation: 5000

View File

@@ -84,7 +84,7 @@
- type: Body
template: HumanoidTemplate
preset: VoxPreset
- type: Metabolism
- type: Respirator
needsGases:
Nitrogen: 0.00060763888
producesGases:

View File

@@ -183,9 +183,6 @@
desc: A combination of cream, wine and moonshine. Why would you do this?
physicalDesc: foul
color: "#a6969a"
metabolism:
- !type:DefaultDrink
rate: 1
- type: reagent
id: Lean
@@ -193,9 +190,6 @@
desc: Turn up for days.
physicalDesc: bubbly
color: "#9400D3"
metabolism:
- !type:DefaultDrink
rate: 1
- type: reagent
id: LeanShine
@@ -203,8 +197,3 @@
desc: Lean mixed with moonshine. Turn up for months.
physicalDesc: bubbly
color: "#9d5fb8"
metabolism:
- !type:DefaultDrink
rate: 1

View File

@@ -4,9 +4,6 @@
desc: A drink made from brewed coffee beans. Contains a moderate amount of caffeine.
physicalDesc: aromatic
color: "#664300"
metabolism:
- !type:DefaultDrink
rate: 1
- type: reagent
id: Tea
@@ -14,9 +11,6 @@
desc: A drink made by boiling leaves of the tea tree, Camellia sinensis.
physicalDesc: aromatic
color: "#8a5a3a"
metabolism:
- !type:DefaultDrink
rate: 1
- type: reagent
id: Cream
@@ -24,9 +18,6 @@
desc: The fatty, still liquid part of milk. Why don't you mix this with sum scotch, eh?
physicalDesc: creamy
color: "#DFD7AF"
metabolism:
- !type:DefaultDrink
rate: 1
- type: reagent
id: Milk
@@ -34,9 +25,6 @@
desc: An opaque white liquid produced by the mammary glands of mammals.
physicalDesc: opaque
color: "#DFDFDF"
metabolism:
- !type:DefaultDrink
rate: 1
plantMetabolism:
- !type:AdjustNutrition
amount: 0.1
@@ -49,9 +37,6 @@
desc: This milk has gone rancid.
physicalDesc: putrid
color: "#faffba"
metabolism:
- !type:DefaultDrink
rate: 1
- type: reagent
id: MilkSoy
@@ -59,9 +44,6 @@
desc: Surprisingly tasty.
physicalDesc: refreshing
color: "#302000"
metabolism:
- !type:DefaultDrink
rate: 1
- type: reagent
id: MilkOat
@@ -69,6 +51,3 @@
desc: Surprisingly tasty.
physicalDesc: refreshing
color: "#302000"
metabolism:
- !type:DefaultDrink
rate: 1

View File

@@ -4,9 +4,6 @@
desc: It's a little piece of Eden.
physicalDesc: crisp
color: "#FDAD01"
metabolism:
- !type:DefaultDrink
rate: 1
- type: reagent
id: JuiceBerry
@@ -14,9 +11,6 @@
desc: A delicious blend of several different kinds of berries.
physicalDesc: sweet
color: "#660099"
metabolism:
- !type:DefaultDrink
rate: 1
- type: reagent
id: JuiceBanana
@@ -24,9 +18,6 @@
desc: The raw essence of a banana. HONK.
physicalDesc: crisp
color: "#FFE777"
metabolism:
- !type:DefaultDrink
rate: 1
#TODO: port on_mob_life: restore eyesight
#if(..())
@@ -45,9 +36,6 @@
desc: It's like a carrot, but less crunchy.
physicalDesc: crisp
color: "#FF8820"
metabolism:
- !type:DefaultDrink
rate: 1
- type: reagent
id: JuiceLime
@@ -55,9 +43,6 @@
desc: The sweet-sour juice of limes.
physicalDesc: citric
color: "#99bb43"
metabolism:
- !type:DefaultDrink
rate: 1
- type: reagent
id: JuiceLemon
@@ -65,9 +50,6 @@
desc: This juice is VERY sour.
physicalDesc: citric
color: "#fff690"
metabolism:
- !type:DefaultDrink
rate: 1
- type: reagent
id: JuiceGrape
@@ -75,9 +57,6 @@
desc: Freshly squeezed juice from red grapes. Quite sweet.
physicalDesc: crisp
color: "#512284"
metabolism:
- !type:DefaultDrink
rate: 1
# /datum/reagent/drink/orangejuice/on_mob_life(var/mob/living/M)
@@ -93,9 +72,6 @@
desc: Both delicious AND rich in Vitamin C. What more do you need?
physicalDesc: citric
color: "#E78108"
metabolism:
- !type:DefaultDrink
rate: 1
- type: reagent
id: JuiceTomato
@@ -103,9 +79,6 @@
desc: Tomatoes made into juice. What a waste of good tomatoes, huh?
physicalDesc: saucey
color: "#731008"
metabolism:
- !type:DefaultDrink
rate: 1
# /datum/reagent/drink/poisonberryjuice/on_mob_life(var/mob/living/M)
@@ -120,9 +93,6 @@
desc: A surprisingly tasty juice blended from various kinds of very deadly and toxic berries.
physicalDesc: aromatic #maybe should be 'sickly'?
color: "#6600CC"
metabolism:
- !type:DefaultDrink
rate: 1
- type: reagent
id: JuiceWatermelon
@@ -130,9 +100,6 @@
desc: The delicious juice of a watermelon.
physicalDesc: sweet
color: "#EF3520"
metabolism:
- !type:DefaultDrink
rate: 1
- type: reagent
id: JuicePineapple
@@ -140,9 +107,6 @@
desc: The delicious juice of a pineapple.
physicalDesc: tropical
color: yellow
metabolism:
- !type:DefaultDrink
rate: 1
# - type: reagent
# id: PotatoJuice
@@ -150,6 +114,3 @@
# desc: Juice of the potato. Bleh.
# physicalDesc: starchy
# color: "#302000"
# metabolism:
# - !type:DefaultDrink
# rate: 1

View File

@@ -4,9 +4,6 @@
desc: A sweet, carbonated soft drink. Caffeine free.
physicalDesc: fizzy
color: "#422912"
metabolism:
- !type:DefaultDrink
rate: 1
plantMetabolism:
- !type:AdjustNutrition
amount: 0.1
@@ -21,12 +18,6 @@
desc: A highly processed liquid substance barely-passing intergalatic health standarts for a soft drink.
physicalDesc: fizzy
color: "#deb928"
metabolism:
- !type:DefaultDrink
rate: 1
- !type:HealthChangeMetabolism
healthChange: 2
damageClass: Toxin
plantMetabolism:
- !type:AdjustNutrition
amount: 0.1

View File

@@ -4,9 +4,6 @@
desc: The sweetness of a thousand sugars but none of the calories.
# physicalDesc:
color: aquamarine
metabolism:
- !type:DefaultFood
rate: 1
- type: reagent
id: BbqSauce
@@ -14,9 +11,6 @@
desc: Hand wipes not included.
physicalDesc: Gloopy.
color: darkred
metabolism:
- !type:DefaultFood
rate: 1
- type: reagent
id: Cornoil
@@ -24,9 +18,6 @@
desc: Corn oil, A delicious oil used in cooking. Made from corn.
# physicalDesc:
color: yellow
metabolism:
- !type:DefaultFood
rate: 1
- type: reagent
id: Frostoil
@@ -34,9 +25,6 @@
desc: Leaves the tongue numb in its passage.
# physicalDesc:
color: skyblue
metabolism:
- !type:DefaultFood
rate: 1
- type: reagent
id: HorseradishSauce
@@ -44,9 +32,6 @@
desc: Smelly horseradish sauce.
physicalDesc: Overpowering.
color: gray
metabolism:
- !type:DefaultFood
rate: 1
- type: reagent
id: Hotsauce
@@ -54,9 +39,6 @@
desc: Burns so good.
# physicalDesc:
color: red
metabolism:
- !type:DefaultFood
rate: 1
- type: reagent
id: Ketchup
@@ -64,9 +46,6 @@
desc: Made from pureed tomatoes and flavored with spices.
# physicalDesc:
color: red
metabolism:
- !type:DefaultFood
rate: 1
- type: reagent
id: Soysauce
@@ -74,6 +53,3 @@
desc: A salty soy-based flavoring.
# physicalDesc:
color: saddlebrown
metabolism:
- !type:DefaultFood
rate: 1

View File

@@ -4,9 +4,6 @@
desc: Used for baking.
physicalDesc: powdery
color: white
metabolism:
- !type:DefaultFood
rate: 1
- type: reagent
id: Oats
@@ -14,18 +11,12 @@
desc: Used for a variety of tasty purposes.
physicalDesc: coarse
color: tan
metabolism:
- !type:DefaultFood
rate: 1
- type: reagent
id: Enzyme
name: universal enzyme
desc: Used in cooking various dishes.
color: "#009900"
metabolism:
- !type:DefaultFood
rate: 1
- type: reagent
id: Egg
@@ -33,9 +24,6 @@
desc: Used for baking.
physicalDesc: mucus-like
color: white
metabolism:
- !type:DefaultFood
rate: 1
- type: reagent
id: Sugar
@@ -43,9 +31,6 @@
desc: Tasty spacey sugar!
physicalDesc:
color: white
metabolism:
- !type:DefaultFood
rate: 1
- type: reagent
id: Salt
@@ -53,9 +38,6 @@
desc: Salt. From space oceans, presumably.
physicalDesc: Coarse.
color: white
metabolism:
- !type:DefaultFood
rate: 1
- type: reagent
id: Blackpepper
@@ -63,33 +45,21 @@
desc: Often used to flavor food or make people sneeze.
physicalDesc: Grainy.
color: black
metabolism:
- !type:DefaultFood
rate: 1
- type: reagent
id: Vinegar
name: vinegar
desc: Often used to flavor food.
color: tan
metabolism:
- !type:DefaultFood
rate: 1
- type: reagent
id: Rice
name: rice
desc: Hard, small white grains.
color: white
metabolism:
- !type:DefaultFood
rate: 1
- type: reagent
id: OilOlive
name: olive oil
desc: Viscous and fragrant.
color: olive
metabolism:
- !type:DefaultFood
rate: 1

View File

@@ -89,9 +89,6 @@
desc: All the vitamins, minerals, and carbohydrates the body needs in pure form.
physicalDesc: opaque
color: "#664330"
metabolism:
- !type:DefaultFood
rate: 1
plantMetabolism:
- !type:AdjustNutrition
amount: 1
@@ -180,7 +177,7 @@
amount: 10
- !type:AdjustHealth
amount: -5
- type: reagent
id: SulfuricAcid
name: sulfuric acid
@@ -218,9 +215,6 @@
color: "#c0e0ff20"
boilingPoint: 100.0
meltingPoint: 0.0
metabolism:
- !type:DefaultDrink
rate: 1
tileReactions:
- !type:ExtinguishTileReaction {}
- !type:SpillIfPuddlePresentTileReaction {}
@@ -234,7 +228,7 @@
desc: Used by chefs to cook.
physicalDesc: oily
color: "#b67823"
boilingPoint: 300.0
boilingPoint: 300.0
meltingPoint: -16.0
tileReactions:
- !type:FlammableTileReaction {}

View File

@@ -18,10 +18,6 @@
desc: A broad-spectrum anti-toxin, which treats toxin damage in the blood stream. Overdosing will cause vomiting, dizzyness and pain.
physicalDesc: translucent
color: "#3a1d8a"
metabolism:
- !type:HealthChangeMetabolism
healthChange: -1
damageClass: Toxin
plantMetabolism:
- !type:AdjustToxins
amount: -10
@@ -34,13 +30,6 @@
desc: A slightly unstable medication used for the most extreme any serious case of radiation poisoning. Lowers radiation level at over twice the rate Hyronalin does and will heal toxin damage at the same time. Deals very minor brute damage to the patient over time, but the patient's body will typically out-regenerate it easily.
physicalDesc: cloudy
color: "#bd5902"
metabolism:
- !type:HealthChangeMetabolism
healthChange: -1
damageClass: Toxin #I think you need multiple of these components for different types of damage so I'll maybe change it to work better in the future
- !type:HealthChangeMetabolism
healthChange: 0.5
damageClass: Brute
- type: reagent
id: Bicaridine
@@ -48,10 +37,6 @@
desc: An analgesic which is highly effective at treating brute damage. It is useful for stabilizing people who have been severely beaten, as well as treating less life-threatening injuries. In the case of bleeding (internal or external), bicaridine will slow down the bleeding heavily. If the dosage exceeds the overdose limit, it'll stop it outright.
physicalDesc: opaque
color: "#ffaa00"
metabolism:
- !type:HealthChangeMetabolism
healthChange: -2
damageClass: Brute
- type: reagent
id: Cryoxadone
@@ -90,10 +75,6 @@
desc: An advanced chemical that is more effective at treating burn damage than Kelotane.
physicalDesc: translucent
color: "#215263"
metabolism:
- !type:HealthChangeMetabolism
healthChange: -3
damageClass: Burn
- type: reagent
id: Dexalin
@@ -101,21 +82,13 @@
desc: Used for treating oxygen deprivation. In most cases where it is likely to be needed, the strength of Dexalin Plus will probably be more useful (Results in 1 unit instead of 2).
physicalDesc: opaque
color: "#0041a8"
metabolism:
- !type:HealthChangeMetabolism
healthChange: -1
damageClass: Airloss #this may be asphyxiation
- type: reagent
id: DexalinPlus
name: dexalin plus
desc: Used in treatment of extreme cases of oxygen deprivation. Even a single unit immediately counters all oxygen loss, which is hugely useful in many circumstances. Any dose beyond this will continue to counter oxygen loss until it is metabolized, essentially removing the need to breathe.
physicalDesc: cloudy
color: "#4da0bd"
metabolism:
- !type:HealthChangeMetabolism
healthChange: -3
damageClass: Airloss
- type: reagent
id: Ethylredoxrazine
@@ -165,10 +138,6 @@
desc: Treats burn damage and prevents infection.
physicalDesc: strong-smelling
color: "#bf3d19"
metabolism:
- !type:HealthChangeMetabolism
healthChange: -1
damageClass: Burn
- type: reagent
id: Leporazine
@@ -201,7 +170,7 @@
- type: reagent
id: Paroxetine
name: paroxetine
desc: Prevents hallucination, but has a 10% chance of causing intense hallucinations.
desc: Prevents hallucination, but has a 10% chance of causing intense hallucinations.
physicalDesc: acrid
color: "#fffbad"
@@ -225,11 +194,6 @@
desc: Toxic, but treats hallucinations, drowsiness & halves the duration of paralysis, stuns and knockdowns. It is metabolized very slowly. One unit is enough to treat hallucinations; two units is deadly.
physicalDesc: pungent
color: "#d49a2f"
metabolism:
- !type:HealthChangeMetabolism
healthChange: 0.67
damageClass: Toxin
rate: 0.2
- type: reagent
id: Tramadol
@@ -289,10 +253,6 @@
plantMetabolism:
- !type:AdjustToxins
amount: 10
metabolism:
- !type:HealthChangeMetabolism
healthChange: 1
damageClass: Airloss
- type: reagent
id: Impedrezene
@@ -307,10 +267,6 @@
desc: Temporarily stops respiration and causes tissue damage. Large doses are fatal, and will cause people to pass out very quickly. Dexalin and Dexalin Plus will both remove it, however.
physicalDesc: pungent
color: "#6b0007"
metabolism:
- !type:HealthChangeMetabolism
healthChange: 7
damageClass: Airloss
- type: reagent
id: Lipozine
@@ -356,24 +312,10 @@
desc: Pure THC oil, extracted from the leaves of the cannabis plant. Much stronger than in it's natural form and can be used to numb chronic pain in patients.
physicalDesc: skunky
color: "#DAA520"
- type: reagent
id: Omnizine
name: Omnizine
desc: A soothing milky liquid with an iridescent gleam. A well known conspiracy theory says that it's origins remain a mystery because knowing the secrets of its production would render most commercial pharmaceuticals obsolete.
physicalDesc: soothing
color: "#fcf7f9"
metabolism:
- !type:HealthChangeMetabolism
healthChange: -2
damageClass: Burn
- !type:HealthChangeMetabolism
healthChange: -2
damageClass: Toxin
- !type:HealthChangeMetabolism
healthChange: -2
damageClass: Airloss
- !type:HealthChangeMetabolism
healthChange: -2
damageClass: Brute