Treatments and prices
This is the full list of what the API gives you. Text in brackets at the end of a note is extra detail for experienced modders, and you can skip it on a first read. OC is Open Sewer Coins and RM is Real Money (see the glossary).
Medical list, check, buy and hear about treatments
Call Treatments() to see what the doctor sells and CanTreat(kind) to check one. Treat(kind) buys it, and Treated tells you about each purchase.
public static class Medical
{
public static bool IsAvailable { get; }
public static List<MedicalTreatmentInfo> Treatments();
public static bool CanTreat(MedicalTreatment kind);
public static bool Treat(MedicalTreatment kind);
public static event Action<MedicalTreatedArgs> Treated;
}
| Method | Returns | What it does |
|---|---|---|
Treatments() | List<MedicalTreatmentInfo> | The treatments the doctors in the scene sell. |
CanTreat(kind) | bool | true when the doctor’s screen is open, it is offered, and the player can pay. |
Treat(kind) | bool | Buys the treatment for the player. true when it was bought. |
| Property | Type | What it means |
|---|---|---|
IsAvailable | bool | false when the Treated event could not be set up. |
| Event | Gives you | When it fires |
|---|---|---|
Treated | MedicalTreatedArgs | A treatment was bought. |
MedicalTreatmentInfo one treatment and its price
Treatments() gives you one of these for each treatment the doctor sells. Price and Available tell you what it costs and whether the doctor offers it now. (It is built from the game’s MedicalTreatments slots.)
public sealed class MedicalTreatmentInfo
{
public MedicalTreatment Kind { get; }
public int Price { get; }
public MoneyCurrency Currency { get; }
public bool Available { get; }
}
| Property | Type | What it means |
|---|---|---|
Kind | MedicalTreatment | Which treatment it is. |
Price | int | What it costs, in Currency. |
Currency | MoneyCurrency | OC (Open Sewer Coins) or RM (Real Money). |
Available | bool | true when the doctor offers it right now. |
MedicalTreatment the treatments the doctor sells
Treat and CanTreat take one of these, and MedicalTreatmentInfo.Kind gives you one. The table below says what each value does for the player.
public enum MedicalTreatment
{
PrescriptionShroomSubstitute,
Fungicide,
PrescriptionFungicide,
GrowthsRemovalBasic,
DangerousExperimentalTreatment,
Antidepressants,
PrescriptionAntidepressants,
RubberDuck,
PhysicalPainkillers,
PhysicalPrescriptionPainkillers,
AdhesiveBandages,
Bandages,
HealWounds,
RadiationPainkillers,
RadiationPrescriptionPainkillers,
IodinePills
}
| Value | Meaning |
|---|---|
PrescriptionShroomSubstitute | Gives the item “Mushroom Substitute Prescription” (id 15810). |
Fungicide | Gives the item “Fungicide” (id 15020). |
PrescriptionFungicide | Gives the item “Fungicide Prescription” (id 15040). |
GrowthsRemovalBasic | Hurts the player and lowers the SMV progression and its rate. |
DangerousExperimentalTreatment | Hurts the player more and lowers the SMV progression and its rate by more. |
Antidepressants | Gives the item “Antidepressants” (id 140020). |
PrescriptionAntidepressants | Gives the item “Antidepressants Prescription” (id 12852). |
RubberDuck | Gives the item “Rubber Duck” (id 11). |
PhysicalPainkillers | Gives the item “Painkillers” (id 140010). |
PhysicalPrescriptionPainkillers | Gives the item “Painkillers Prescription” (id 12851). |
AdhesiveBandages | Gives the item “Adhesive Bandages” (id 12670). |
Bandages | Gives the item “Bandage” (id 10940). |
HealWounds | Sets the player’s health to 100 and bleeding to 0. |
RadiationPainkillers | Gives the item “Painkillers” (id 140010). |
RadiationPrescriptionPainkillers | Gives the item “Painkillers Prescription” (id 12851). |
IodinePills | Gives the item “Iodine Pills” (id 15360). |
MedicalTreatedArgs what Treated tells you
Treated gives you one of these when a treatment is bought. Kind says which one, and Price and Currency say what it cost.
public sealed class MedicalTreatedArgs
{
public MedicalTreatment Kind { get; }
public int Price { get; }
public MoneyCurrency Currency { get; }
}
| Property | Type | What it means |
|---|---|---|
Kind | MedicalTreatment | Which treatment was bought. |
Price | int | What it cost. |
Currency | MoneyCurrency | The currency it was paid in. |
Things to know
- The list of treatments is fixed, and new ones are only ever added at the end. The numbers behind the names will not change between versions.
Treatments()lists every treatment that a doctor in the scene sells, whether or not the doctor offers it right now.Availabletells you which ones the doctor’s screen shows at the moment. The list is empty when no doctor is loaded. If the scene has more than one doctor, you get each treatment once, from the first doctor that sells it. (Availableis the result of the game’sGetAvailableTreatments()for that treatment’s selection (the object holding one group of treatments), which is the list the doctor’s menu shows. The framework finds the doctors withSceneIds.Active<Doctor>().)CanTreatistrueonly when the doctor’s screen is open and the player can buy that treatment. It needs three things: the treatment belongs to the doctor whose screen is open, the doctor offers it, and the player has at leastPriceinCurrency. It isfalseon the main menu, in any other menu, and with no menu open. (it requiresGameUIController.IsMenuVisible, the Doctor panel as the current panel, aDoctorController.currentDoctor, an activeDoctorPanel, and theBlackCanvas,InventoryandPlayerStatsinstances.)Treatbuys the treatment the same way the doctor’s buy button does. The game charges the price, plays the sound, and gives the item or applies the effect. Your mod never takes the money itself. It returnstruewhen the treatment was bought. (it callsDoctorPanelSelection.BuyTreatment(Treatment), which charges throughMoney.Buy.)Treatedfires every time a treatment is bought, including when the player buys one with the doctor’s own button. It fires after the purchase went through. It does not fire if the purchase failed. (it is raised after the game’sBuyTreatmentreturnstrue, from a postfix on theBuyTreatmentof the five treatment classes, not fromTreat.)- Reading the list can update the price of healing wounds. The game works out that price when it builds its list of offered treatments, and
Treatments()andCanTreatbuild that list too, as the doctor’s screen does. (GetAvailableTreatmentson the physical health selection sets theHealWoundsprice.) - Conditions and survival values are on other pages. The conditions the player has are on the Conditions page. Addictions, mood and radiation values are read with
Survival. (Conditions.All, andSurvival.Getfor mood, radiation and fungal progression.)
Limits
TreatchecksCanTreatfirst. If the doctor’s screen is closed, the treatment is not offered, or the player can’t pay, it returnsfalse, takes no money and shows no “not enough money” popup. It also returnsfalsewhile a save is loading or being written.Treatneeds the doctor’s screen to be open because the game was written for it. Healing wounds fades the screen and closes the menu, and it can set off the examination bed. With no menu open that would run in the middle of play, and on the main menu it would fail after the money was taken. Opening and closing the doctor’s screen is not part of this API, because it is user interface. (theHealWoundsbranch ofBuyTreatmentcallsBlackCanvas.StartFadeInAndOutwithcloseMenu: trueand can fire the examination bed’s relays.BlackCanvas.instanceis null on the main menu.DoctorController.ShowMenu(Doctor)opens the menu throughGameUIController.)- Heal wounds closes the menu and may set off the examination bed. When the bed is loaded and the player is hurt, the screen fades while the bed does its own actions. This is the same as when the player uses the game’s button. What those actions do has not been checked. (the relays are the bed’s
teleportRelayandendRelay.) - The money is taken first, so a failure afterwards can cost the player money. If the sound or the item step fails after the payment, the money is gone,
TreatreturnsfalseandTreateddoes not fire. - A treatment that gives an item is still paid for when the inventory is full. The game then gives nothing, but still counts the purchase as done, and so does the doctor’s own button.
Treatdoes not check for free space in the inventory. (the game callsInventory.AddItemDialogue, which gives nothing when the inventory is full, andBuyTreatmentstill returnstrue.) IsAvailabletells you whetherTreatedworks. It isfalsewhen the framework could not set up the event.Treatments,CanTreatandTreatstill work.- Buying by the doctor’s info panel is not part of this API. That button charges the price of the current selection and records the purchase in the menu state, so it depends on what the menu has selected. (
DoctorPanel.OnBuyButtonPressedchargescurrentSelection.price.)