From 68bfe1705dee83e797de53c1c2c013fdbe90df5e Mon Sep 17 00:00:00 2001 From: JaredWeakStrike <96694163+JaredWeakStrike@users.noreply.github.com> Date: Thu, 18 May 2023 09:28:35 -0400 Subject: [PATCH] KH2: AntipointReset (#1815) --- KH2Client.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/KH2Client.py b/KH2Client.py index bdb7a8b54a41..1134932dc26c 100644 --- a/KH2Client.py +++ b/KH2Client.py @@ -433,7 +433,8 @@ async def give_item(self, item, ItemType="ServerItems"): if len(self.kh2seedsave["AmountInvo"][ItemType]["Ability"][itemname]) < \ self.AbilityQuantityDict[itemname]: if itemname in self.sora_ability_set: - self.kh2seedsave["AmountInvo"][ItemType]["Ability"][itemname].append(self.kh2seedsave["SoraInvo"][abilityInvoType]) + self.kh2seedsave["AmountInvo"][ItemType]["Ability"][itemname].append( + self.kh2seedsave["SoraInvo"][abilityInvoType]) self.kh2seedsave["SoraInvo"][abilityInvoType] -= TwilightZone elif itemname in self.donald_ability_set: self.kh2seedsave["AmountInvo"][ItemType]["Ability"][itemname].append( @@ -686,6 +687,10 @@ async def verifyItems(self): self.kh2.read_bytes(self.kh2.base_address + self.Save + itemData.memaddr, 1), "big") if (int.from_bytes(self.kh2.read_bytes(self.kh2.base_address + self.Save + itemData.memaddr, 1), "big") & 0x1 << itemData.bitmask) == 0: + # when getting a form anti points should be reset to 0 but bit-shift doesn't trigger the game. + if itemName in {"Valor Form", "Wisdom Form", "Limit Form", "Master Form", "Final Form"}: + self.kh2.write_bytes(self.kh2.base_address + self.Save + 0x3410, + (0).to_bytes(1, 'big'), 1) self.kh2.write_bytes(self.kh2.base_address + self.Save + itemData.memaddr, (itemMemory | 0x01 << itemData.bitmask).to_bytes(1, 'big'), 1)