diff options
author | Ajarmar <axel.jarmar@gmail.com> | 2022-05-15 22:02:13 +0200 |
---|---|---|
committer | rafa_99 <raroma09@gmail.com> | 2022-05-16 22:52:12 +0100 |
commit | ae45e1a40a7ecef5f843e72a73349aa51642c458 (patch) | |
tree | f180929bebc89a9e473ffd63c336349923d44641 | |
parent | 0ee992391ea7b78f68132389735010391dba6a89 (diff) |
set status moves correctly in gen 1-3
4 files changed, 16 insertions, 0 deletions
diff --git a/src/com/sneed/pkrandom/constants/GlobalConstants.java b/src/com/sneed/pkrandom/constants/GlobalConstants.java index 4d3a594..1ac0b90 100644 --- a/src/com/sneed/pkrandom/constants/GlobalConstants.java +++ b/src/com/sneed/pkrandom/constants/GlobalConstants.java @@ -210,6 +210,13 @@ public class GlobalConstants { Abilities.shadowShield, Abilities.prismArmor, Abilities.libero, Abilities.stalwart ); + public static final List<Integer> noPowerNonStatusMoves = Arrays.asList( + Moves.guillotine, Moves.hornDrill, Moves.sonicBoom, Moves.lowKick, Moves.counter, Moves.seismicToss, + Moves.dragonRage, Moves.fissure, Moves.nightShade, Moves.bide, Moves.psywave, Moves.superFang, + Moves.flail, Moves.revenge, Moves.returnTheMoveNotTheKeyword, Moves.present, Moves.frustration, + Moves.magnitude, Moves.mirrorCoat, Moves.beatUp, Moves.spitUp, Moves.sheerCold + ); + public static final int MIN_DAMAGING_MOVE_POWER = 50; public static final int HIGHEST_POKEMON_GEN = 8; diff --git a/src/com/sneed/pkrandom/romhandlers/Gen1RomHandler.java b/src/com/sneed/pkrandom/romhandlers/Gen1RomHandler.java index 1e08a8b..4d7f243 100755 --- a/src/com/sneed/pkrandom/romhandlers/Gen1RomHandler.java +++ b/src/com/sneed/pkrandom/romhandlers/Gen1RomHandler.java @@ -450,6 +450,9 @@ public class Gen1RomHandler extends AbstractGBCRomHandler { moves[trueMoveIndex].pp = rom[movesOffset + (i - 1) * 6 + 5] & 0xFF;
moves[trueMoveIndex].type = idToType(rom[movesOffset + (i - 1) * 6 + 3] & 0xFF);
moves[trueMoveIndex].category = GBConstants.physicalTypes.contains(moves[trueMoveIndex].type) ? MoveCategory.PHYSICAL : MoveCategory.SPECIAL;
+ if (moves[trueMoveIndex].power == 0 && !GlobalConstants.noPowerNonStatusMoves.contains(trueMoveIndex)) {
+ moves[trueMoveIndex].category = MoveCategory.STATUS;
+ }
if (moves[trueMoveIndex].name.equals("Swift")) {
perfectAccuracy = (int)moves[trueMoveIndex].hitratio;
diff --git a/src/com/sneed/pkrandom/romhandlers/Gen2RomHandler.java b/src/com/sneed/pkrandom/romhandlers/Gen2RomHandler.java index 50daebd..a5f456d 100755 --- a/src/com/sneed/pkrandom/romhandlers/Gen2RomHandler.java +++ b/src/com/sneed/pkrandom/romhandlers/Gen2RomHandler.java @@ -412,6 +412,9 @@ public class Gen2RomHandler extends AbstractGBCRomHandler { moves[i].pp = rom[offs + (i - 1) * 7 + 5] & 0xFF;
moves[i].type = Gen2Constants.typeTable[rom[offs + (i - 1) * 7 + 3]];
moves[i].category = GBConstants.physicalTypes.contains(moves[i].type) ? MoveCategory.PHYSICAL : MoveCategory.SPECIAL;
+ if (moves[i].power == 0 && !GlobalConstants.noPowerNonStatusMoves.contains(i)) {
+ moves[i].category = MoveCategory.STATUS;
+ }
moves[i].secondaryEffectChance = ((rom[offs + (i - 1) * 7 + 6] & 0xFF)) / 255.0 * 100;
if (i == Moves.swift) {
diff --git a/src/com/sneed/pkrandom/romhandlers/Gen3RomHandler.java b/src/com/sneed/pkrandom/romhandlers/Gen3RomHandler.java index c5f7f35..f9160bd 100755 --- a/src/com/sneed/pkrandom/romhandlers/Gen3RomHandler.java +++ b/src/com/sneed/pkrandom/romhandlers/Gen3RomHandler.java @@ -826,6 +826,9 @@ public class Gen3RomHandler extends AbstractGBRomHandler { moves[i].type = Gen3Constants.typeTable[rom[offs + i * 0xC + 2]]; moves[i].target = rom[offs + i * 0xC + 6] & 0xFF; moves[i].category = GBConstants.physicalTypes.contains(moves[i].type) ? MoveCategory.PHYSICAL : MoveCategory.SPECIAL; + if (moves[i].power == 0 && !GlobalConstants.noPowerNonStatusMoves.contains(i)) { + moves[i].category = MoveCategory.STATUS; + } moves[i].priority = rom[offs + i * 0xC + 7]; moves[i].secondaryEffectChance = rom[offs + i * 0xC + 5] & 0xFF; int flags = rom[offs + i * 0xC + 8] & 0xFF; |