I noticed that the in-battle display of an opponent's stamina always shows "Her stamina is at 100%" (with sufficient perception). Turns out the recent refactor to use "Pools" missed a few spots that still refer to the old stamina, arousal, and mojo member variables, which aren't connected to the new Pool meters.
The attached diff fixes the in-battle stamina report and probably fixes a few other minor regressions from a handful of outdated references.
How does SilverBard like to receive patches/pull requests?
Edit: Hard mode is also broken. It relies on cloning the entire Combat class in order to simulate each move. Character.pools is a HashMap, which implements shallow clone, so the underlying meters aren't cloned; the cloned character shares stamina etc. meters with the actual character. As a result, all of the NPC's "simulated" moves actually affect the player, and if there are enough available moves this basically stun-locks the player. This can be fixed easily enough, but there is still something wrong that causes an intermittent softlock--the message screen just goes blank under circumstances that I haven't been able to pin down.
Here is the appropriate code to deep-clone the pools in Character::clone():
The attached diff fixes the in-battle stamina report and probably fixes a few other minor regressions from a handful of outdated references.
How does SilverBard like to receive patches/pull requests?
Edit: Hard mode is also broken. It relies on cloning the entire Combat class in order to simulate each move. Character.pools is a HashMap, which implements shallow clone, so the underlying meters aren't cloned; the cloned character shares stamina etc. meters with the actual character. As a result, all of the NPC's "simulated" moves actually affect the player, and if there are enough available moves this basically stun-locks the player. This can be fixed easily enough, but there is still something wrong that causes an intermittent softlock--the message screen just goes blank under circumstances that I haven't been able to pin down.
Here is the appropriate code to deep-clone the pools in Character::clone():
Java:
HashMap<Pool, Meter> map = new HashMap<>();
for (HashMap.Entry<Pool, Meter> e : pools.entrySet()) {
if (map.put(e.getKey(), e.getValue().clone()) != null) {
throw new IllegalStateException("Duplicate key");
}
}
c.pools = map;
Last edited: