Altering Deal Chance Example⚓︎
There are four callbacks that allow us to manipulate devil and angel chances.
MC_PRE_DEVIL_APPLY_ITEMS is run when most items that effect deal chance modify the calculation. It's called before the stage penalty is applied. If a deal has spawned anywhere on the previous two floors, the game decays the resulting deal chance by a stage penalty of either 25% or 50%, depending on how many deals have been taken.
It's important to note that even though they game displays a value of ~33% or ~66% for the 25% and 50% values respectively, devil chance is not clamped to a value between 0 and 1, and "100%" chance without items generally means a value of around ~133%.
Return a float
to modify the chance in this step of the calculation.
MC_PRE_DEVIL_APPLY_STAGE_PENALTY allows you to return false
to bypass the stage penalty.
MC_PRE_DEVIL_APPLY_SPECIAL_ITEMS is where the game applies modifications that bypass the stage penalty, for items such as Goat Head and Eucharist. Return a float
to modify the chance in this step of the calculation.
MC_POST_DEVIL_CALCULATE is called after the deal chance has been calculated. You can return a float
here to override the calculated chance.
The following example mod adds an item that will randomize the deal chance on MC_PRE_DEVIL_APPLY_SPECIAL_ITEMS while in an uncleared boss room, and keeps that chance applied after the room is cleared.
Code⚓︎
You can download the full mod and its assets by clicking here.
Video Demonstration
Example
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
|