Closed Ericzklm closed 1 year ago
The Quark Drive issue seems to stem from the RaidState clone? abilityOn is true before the clone but false after. This only seems to be an issue when the turn 0 end state is passed to the turn 1 start state. Within the turn loop, an end state is being correctly propagated to the next turn's start state.
console.log(this.raidState.clone()); // fine
this._raidState = this.raidState.clone();
console.log(this._raidState); // not fine
I'm seeing this too. Bizarre. It doesn't seem that the clone()
method is mutating the original raid state. The issue only happens when setting the _raidState
of a turn:
console.log("original RaidState", this.raidState); // fine
const clonedRaidState = this.raidState.clone();
console.log("cloned RaidState", clonedRaidState); // fine
this._raidState = this.raidState.clone();
console.log("temporary RaidState", this._raidState); // not fine
I think this behavior might have to do with the way console.log
works. Logging might not be synchronous with execution, since the following ends up different. Changes that mutate an object later on in the code will still show up.
console.log("original RaidState", this.raidState); // fine
const clonedRaidState = this.raidState.clone();
console.log("cloned RaidState", clonedRaidState); // not fine, this time
this._raidState = clonedRaidState; // The same object as above
console.log("temporary RaidState", this._raidState); // not fine
Maybe this is because we're doing the calculation on a service worker, but I'm not sure.
Anyways, it seems the issue is probably more related to the QP specific parts of the code.
The issue was that we weren't setting the usedBoosterEnergy
flag at all of the checks for consumption of a Booster Energy.
It seems to me that the calc for Aster's strat is now accurate, after moving HH to the right spot. It's not a 100% guarantee, though, but that's fine for a 3-person strat:
+6 252+ Atk Quark Drive Tera ??? Iron Hands Helping Hand Atk Cheer Close Combat vs. -2 0 HP / 0 Def Tera Normal Rillaboom: 11588-13634 (97 - 114.2% of 35x hp boss) -- 81.3% chance to OHKO
Oh okay, I was going crazy over the clone implementation... I was confused why intimidate was carrying over from turn 0 but not the ability flags.
Also the solution for the ??? Tera isn't the most elegant, it just stops you from setting it to "???" but since Aster saved the strategy with "???" already populated, it still shows up.
I guess we could convert it to undefined
at the beginning of a RaidBattle, if we want to make sure it doesn't show up from old links (of which there will probably only be one)
https://theastrogoth.github.io/tera-raid-builder/#H4sIAAAAAAAAA7WVTW8aMRCG/4rlUyvtAVhoo1wiIJSQhkQN6QlxMLsDuOu1V/4gQRH/vTNmIVBFalUFsVhe2zPzvDNjeOULfsmzX85onnDPL6fTRsK1KIHPEprKvJ5kVno84iAzOhd2M1gsIPMOl6xRig41Ex4c2NE1eRJ2CT5OTeWl0Y5OtBK+tCZUuFqaNYz0wuB0bpwb7193frTxQK4zC7mMQSpTQLmDDFbTSvTkaroV+RS+wDGHBXFWIo55HKGOjqjAa314fi6V9BucSQ9lXEfntANriiDjqGANiuKCFU+bCmp4tycPystKSbBk9+KtGMfd2Szha375yjGnXxI+mdymbGSNZjdC52Qcn2ncv0hQwqOQOeuhR9x4lEqJuTEENbTCuQ2bBMwoT3RQKuG3mHLkjsZf0fjwmW33i2nzjwe3mg2Mc29sKVDQlF/bULIeCC/1EgN1M2vm+JIRQc/kGFMJIrgzz+y7zApMYtpBF1NkMs9+FY+Zch6so9boBVWwnxUqryEuEizl0BQBN0+k/wjCFuzayjXsfDhMLhtosEuqRjcXpdD+oK/VacXvv2u8uroigX1lHLA+IooICJg1RqpRCZ2bHqFidzzZoAvie7BCL4Ml7smmnEvjJC3fyQWwBzuPzCo/4Wu8Ef6dLxZxykfaeRsy/w5NSonzQP0+FsGtYjj+zUrQORti+ui1j41mPUOVovgophtQFbZDLBX6fMKyK3gHsI0lHd4/PA7YeBAhl7IQlm7hp3vDurub9XnfrzcI/J/9uuN6A5jVd6aTkLQ4bR84MW/1WposhHJQj7yUmqPt9mBAlHRREbGBbVrbYDlgN/BSvESLvU0nAu/Nj1oJrc8Xs3kU89AuqDw9W8R0fw7Nu96LrGD9FdCvW+uMOjtHUU9v7Tmz2z6Ketr46ZuHD4uKnYv/QagHJ22M0JlhO29/A3jqZzyCBwAA
Provided by Aster
Issues to be fixed: