Drug Addiction (Programming)
When you want a drug to be addictive, you can create a counterpart drug that handles the addiction. You'll want to use #5778, the generic addiction, as the parent for these types of drugs.
Basically, when a drug is addictive, it needs to be bound to another drug that gets ingested alongside the original drug. The drug and its addiction need to point to one another, via the following properties:
- drug.addiction
- addiction.drug
Once they are linked up, when you ingest an addictive drug (one that has a valid .addiction property), you will also ingest a dose of the addiction. The drug will be metabolized normally though the player's system, but the addiction won't metabolize until all of the real drug is metabolized first.
Both the drug and the addiction have active .skill_mods, so you have to be careful how you set them up when you have an addictive drug. What you will want to do is set the real drug's .skill_mods artificially high to compensate for the addiction drug's negative .skill_mods. For instance:
Drug Skill Mods | Addiction Skill Mods | Net Skill Mods |
---|---|---|
{{#116, 1.0}, {#117, 1.0}} | {{#116, -0.5}, {#117, -0.5}} | {{#116, 0.5}, {#117, 0.5}} |
Then, when the real drug metabolizes away, only the negative stat modifiers of the addiction are left in the player's system. These will erode away over time. You can control how quickly this happens with the addiction's .halflife property (see Drugs (Programming) for more info on .halflife).
You can also give your addictions interesting messages, the same way you set messages for any other drug. Most useful would probably be .recovery_msg and .effect_msg. Also remember that these properties can be lists of messages, and really should be, or you'll have a very boring addiction.