Success Chance - KonradHeinser/EBSGFramework GitHub Wiki
Multiple things in this use a special successChance node which handles the chance based aspect of that thing. For the purpose of making things easier for everyone, all of these successChance nodes have the same options within them. The comps that have successChance available point to this page to minimize the risk that I forget to update one of the many pages if anything is added to or changed in successChance.
These are the basic options:
- baseSuccessChance : Default (1) : Chance of the ability to succeed, with 1 being 100%
- successMessage : Optional. Message given if this comp succeeds and the caster is a player pawn. Messages can use {0} for the caster's name, and {1} for the target's name
- failureMessage : Optional. Message given if this comp fails and the caster is a player pawn. Messages can use {0} for the caster's name, and {1} for the target's name
- hediffsOnFail : A special list of items that adds hediffs to the caster and/or the target in the event of a failure (acts the same as hediffsToGive from Give Multiple Hediffs for those familiar with the comp), with these as the options in each li:
- hediffDef : Each desired hediff will require its own list item
- chance : Default (1) : The chance of the hediffDef actually applying
- successChance : A special item that dictates the chance of success. This takes the place of chance if added to the item (changing chance will no longer change the chance, and endOn checks the results of this), and if neither this nor chance are added to the item, the hediff is always added (assuming the psychic check passes)
- Yes, that link does just take you back to this page, because it's just this stuff. Honestly I recommend avoiding nesting successChance if possible to avoid potential weirdness, but in theory you can have hediffsOnFail do successChance related things of their own
- psychic : Default (False) : The hediff is only added to pawns which are not psychically deaf (in the stat sense, not the trait/gene sense)
- onlyBrain : Default (false) : Instead of applying to the entire body, it applies the hediff to the brain
- bodyParts : A list of body parts to apply the hediff to. Overrides onlyBrain
- applyToSelf : Default (false) : Applies this hediff to the caster, regardless of the selected target
- applyToTarget : Default (true) : Applies this hediff to the target. Usually no reason to set this to false due to the below node
- onlyApplyToSelf : Default (false) : Equivalent to setting applyToTarget to false, and applyToSelf to true, just does both in a single node
- skipExisting : Default (False) : If true and the pawn already has the hediff on all of the parts, then this hediff is skipped. If the hediff is only on some parts, the comp will still add the hediff to those parts
- replaceExisting : Default (False) : If true and the pawn already has the hediff, that hediff is removed and a new version of it is added
- severity : Default (1) : The severity to give, or add to the existing one if replaceExisting and skipExisting are false. If a range of values is given instead of a singular value, then a random number in that range is used for the severity. If this number is less than or equal to 0, the li is skipped unless replaceExisting is true, in which case the hediffDef is removed
These are the "caster" options, with caster referencing the ability user, the hediff haver, the gene carrier, etc:
- casterStatChance : StatDef of the caster that is checked to determine success chance. Normally the higher above 0 this is, the higher the chance of success
- casterStatEffect : Default (Multiply) : Dictates what the stat does to the chance. The options are Multiply, Divide, OneMinusMultiply, and OneMinusDivide, Add, and Subtract. The OneMinus options mean 1 - Stat Value
- casterSkills : A list of SkillDefs to get the sum of. All skill values are taken and added up, with disabled skills acting as a 0
- casterSkillCurve : A curve that assigns a value to the total of the skills, with the left number being the skill sum and the right being the effect
- casterSkillEffect : Default (Multiply) : Dictates what the skill effect does to the chance. The options are Multiply, Divide, OneMinusMultiply, and OneMinusDivide, Add, and Subtract. The OneMinus options mean 1 - Stat Value
These are the target options for when there is another thing affecting chance, usually the ability target:
- targetStatChance : StatDef of the target that is checked to determine success chance. Normally the higher above 0 this is, the lower the chance of success
- targetStatEffect : Default (Divide) : Dictates what the stat does to the chance. The options are Multiply, Divide, OneMinusMultiply, and OneMinusDivide, Add, and Subtract. The OneMinus options mean 1 - Stat Value
- targetSkills : A list of SkillDefs to get the sum of. All skill values are taken and added up, with disabled skills acting as a 0
- targetSkillCurve : A curve that assigns a value to the total of the skills, with the left number being the skill sum and the right being the effect
- targetSkillEffect : Default (Multiply) : Dictates what the skill effect does to the chance. The options are Multiply, Divide, OneMinusMultiply, and OneMinusDivide, Add, and Subtract. The OneMinus options mean 1 - Stat Value
Important Note : If multiple comps with successChance are used, the success for each individual one is handled separately. This can result in abilities that only partially fail, but also means that each success can use entirely different parameters if so desired.
For examples of most of the things in successChance, see Create Linked Hediffs examples