Using the Compulsion system

Compulsions are essentially a multi-phased approach to an addiction. You get to have small character buffs for giving into the compulsion, but if you do so too often it will turn into a full addiction.

Here is an example of what a compulsion looks like:

:: maid compulsion [compulsion]
{
(if:$character's "side effects" contains "maid")[
    (unless:($has_ap_mod:"compulsive cleaner mod"))[
        (set:$action_point_mods to it + (a:(dm:
            "name","compulsive cleaner mod",
            "title","Compulsive Cleaner",
            "description","As a compulsive cleaner, you find doing chores oddly satisfying. Complete chores regularly, and you'll get an XP bonus.",
            "good message","You feel accomplished after tidying up! Your XP gain will be increased for a while.",
            "addiction message","You are starting to *need* the satisfaction of a clean environment... if you don't clean regularly, your XP gain will decrease.",
            "bad message","You're feeling anxious about the messy state of things... your XP gain has decreased until you complete some cleaning.",
            "normal wear off","It's been a while since you've done a thorough cleaning...",
            "type","xp",
            "removal criteria","Remove the Live-In Maid side effect if you want to remove this compulsion.",
            "addiction threshold",10,
            "times triggered",0,
            "cooldown",7,
            "lower cooldown",5,
            "cooldown floor",3,
            "last day",-1
        )))
    ]
](else:)[
    (set:$action_point_mods to it - (find:_mod where _mod's name is "compulsive cleaner mod",...$action_point_mods))
]
}
Namename (more like an id) that will exist in $action_points_mods, when checking if you have the compulsion
TitleWhat shows up under compulsions (more of a name)
DescriptionGeneral description to go with the title on the Compulsions screen
Good MessageThe displayed message when you give in, can tell the player what they’re being rewarded with here.
Addiction MessageThe displayed message if it’s become an addiction, and you give in. You can warn the players what the penalty is IF they don’t continue to give in.
Bad MessageThe displayed message when the penalty is applied
Normal Wear OffThe displayed message when you meet the removal criteria
Typecan be either “slot”, “regen”, or “xp” – which gives you an AP slot, bonus AP regen, or XP
Removal CriteriaText explanation for how to remove the compulsion
Addiction Thresholdhow many times you do the thing before it becomes an addiction
Times Triggeredgets initialized as 0, but counts up as you give in. Used for the addiction threshold
Cooldownhow often you need to do it (In days, I think?)
Lower Cooldownhow long before the cooldown decreases
Cooldown Floorthe lowest it can go
Last Daygets initialized as -1. The next time you give in, it gets recorded as the day number.

Once you have it set up, then you would set up a trigger for the completing the compulsion event.

<!-- Used when chores are finished -->
(if:($has_ap_mod:"compulsive cleaner mod"))[(display:"action point mod trigger")]