Open StrangeWergon opened 3 years ago
P.S. I'm not sure, but the current functions for room chances don't seem to work:
- GetDevilRoomChance() - always return 1.35 for me
- GetAngelRoomChance() - always return 0.0 for me
- AddAngelRoomChance() - does nothing or sets 100% chance
A bit off topic, but it is worth mentioning that both GetAngelRoomChance() and AddAngelRoomChance() work as intended, the former returns a value between 0 and 1, being the angel room chance (or angel room chance / 100 I guess), and the latter actually adds the value properly, but the game is retarded and will only display 100.
This even happens ingame, if you use a a confessionary, or self sacrifice room, your angel deal chance after getting a You Feel Blessed message would display 100%, while in reality you only gained around 10% chance.
@AgentCucco, I have now double-checked, the values are indeed correct, but they work differently.
These are the statistics by floor:
We can see that GetDevilRoomChance() always returns the total chance (angel + devil), except for the first floor, which is bugged. GetAngelRoomChance() always returns 0.0, because this isn't a chance of the angel room spawn, but a bonus for the angel room spawn.
For example, on the fourth floor we have the following chances: Devil = 17%, Angel = 17% (50%/50%). Then we earn a "You Feel Blessed" message in the sacrifice room. Now GetAngelRoomChance() returns 0.15 (15% bonus) and new rooms chances are: Devil = 14.3%, Angel 19.4% (42.5%/57.5%).
It's terribly counterintuitive, but this is how it works now.
I think we need a callback like MC_EVALUATE_CACHE to make changes to chances without losing the current calculations the game is doing.
For example, we need to create an passive item that will add +7% to devil/angel/planetarium room spawn chance. Now we don't have an arsenal to change these values, but functions like SetDevilRoomChance() or SetPlanetariumRoomChance() isn't a solution to the problem. We need a way to participate in calculation process of this chances.
Possible solution: MC_ROOM_EVALUATE_CACHE - Called when a room chances must be re-evaluated.
And properties are similar to the Player stats. Something like:
P.S. I'm not sure, but the current functions for room chances don't seem to work:
Btw, why GetDevilRoomChance() is a method of Room class, but GetAngelRoomChance() is a method of Level class?