Feature idea: card replenishing that takes more than one turn
Thynix opened this issue ยท 4 comments
In making balance changes, it'd be nice to be able to have a little more nuance to whether a card is replenishable:
For example, if I were to make fireball replenishable, but found it to be overpowered, I could reduce its AoE, but it'd be nice to have the option of putting a wait of a few turns between replenishments. That way it would still be a guaranteed part of the kit, but without turning sorcerer into a fireball machine gun.
After taking a look at the game code for this:
There's a IsReplenishing
flag (in Inventory.cs
for anyone curious), that controls whether a card should be replenished the next turn or not. It's a boolean (yes/no), so there's no built-in way to adjust the number of rounds it takes to replenish a card.
However, we might be able to write a rule that keeps track of all replenishable cards, and overrides only triggers the appropriate Inventory.RestoreReplenishables()
method when some specified number of turns have elapsed.
Just some preliminary findings for anyone that might want to attempt it - I may not be able to visit this for at least a week.
Resolved by #319
Thinking about this one a little, I've had a couple of different ideas that might be viable...
It looks as both IsReplenishable and IsReplenishing are being handled as binary operations on the flags
integer. IsReplenishable is the lowest bit, and IsReplenishing is bit 1. Only the lower two bits of this flags
int ever seem to be getting used, so we could potentially use a few of the unsed bits to hold extra state. We'd have to patch both TryAddAbilityToInventory
to set some extra bits and IsReplenishing
to handle a countdown, but we wouldn't have to store any extra information outside of the existing inventory structure. (Is it even possible to patch Inventory.cs with an extra TryAddAbilityToInventory method that would handle more than a bool for IsReplenishing?)
My second idea was that we could use one of the EffectStates to prevent replenishing (in the same way as happens for Sneak). For example, casting a fireball could leave you weakened for 1 round afterwards, and then replenishing could be disabled during Weakend state by patching RestoreReplenishables. This has the disadvantage that the same rule would apply to all players, so anyone who was weakened wouldn't get their items replenished - Could make for an iteresting gameplay dynamic though.
Great findings @jimconner, piggybacking on flags
is super clever!
The second idea seems like it has potential to be a very interesting rule/ruleset. Feels like a "disarm" feature.