diff options
Diffstat (limited to 'src')
15 files changed, 140 insertions, 54 deletions
diff --git a/src/com/sneed/pkrandom/constants/Gen1Constants.java b/src/com/sneed/pkrandom/constants/Gen1Constants.java index f0f8bd5..a84b622 100644 --- a/src/com/sneed/pkrandom/constants/Gen1Constants.java +++ b/src/com/sneed/pkrandom/constants/Gen1Constants.java @@ -67,13 +67,14 @@ public class Gen1Constants { public static final List<Integer> fieldMoves = Arrays.asList( Moves.cut, Moves.fly, Moves.surf, Moves.strength, Moves.flash, Moves.dig, Moves.teleport); - public static final int damagePoison20PercentEffect = 2, damageBurn10PercentEffect = 4, damageFreeze10PercentEffect = 5, - damageParalyze10PercentEffect = 6, noDamageAtkPlusOneEffect = 10, noDamageDefPlusOneEffect = 11, - noDamageSpecialPlusOneEffect = 13, noDamageEvasionPlusOneEffect = 15, noDamageAtkMinusOneEffect = 18, - noDamageDefMinusOneEffect = 19, noDamageSpeMinusOneEffect = 20, noDamageAccuracyMinusOneEffect = 22, - flinch10PercentEffect = 31, noDamageSleepEffect = 32, damagePoison40PercentEffect = 33, - damageBurn30PercentEffect = 34, damageFreeze30PercentEffect = 35, damageParalyze30PercentEffect = 36, - flinch30PercentEffect = 37, noDamageConfusionEffect = 49, noDamageAtkPlusTwoEffect = 50, + public static final int damagePoison20PercentEffect = 2, damageAbsorbEffect = 3, damageBurn10PercentEffect = 4, + damageFreeze10PercentEffect = 5, damageParalyze10PercentEffect = 6, dreamEaterEffect = 8, + noDamageAtkPlusOneEffect = 10, noDamageDefPlusOneEffect = 11, noDamageSpecialPlusOneEffect = 13, + noDamageEvasionPlusOneEffect = 15, noDamageAtkMinusOneEffect = 18, noDamageDefMinusOneEffect = 19, + noDamageSpeMinusOneEffect = 20, noDamageAccuracyMinusOneEffect = 22, flinch10PercentEffect = 31, + noDamageSleepEffect = 32, damagePoison40PercentEffect = 33, damageBurn30PercentEffect = 34, + damageFreeze30PercentEffect = 35, damageParalyze30PercentEffect = 36, flinch30PercentEffect = 37, + damageRecoilEffect = 48, noDamageConfusionEffect = 49, noDamageAtkPlusTwoEffect = 50, noDamageDefPlusTwoEffect = 51, noDamageSpePlusTwoEffect = 52, noDamageSpecialPlusTwoEffect = 53, noDamageDefMinusTwoEffect = 59, noDamagePoisonEffect = 66, noDamageParalyzeEffect = 67, damageAtkMinusOneEffect = 68, damageDefMinusOneEffect = 69, damageSpeMinusOneEffect = 70, diff --git a/src/com/sneed/pkrandom/constants/Gen2Constants.java b/src/com/sneed/pkrandom/constants/Gen2Constants.java index d06dc00..32ef9eb 100644 --- a/src/com/sneed/pkrandom/constants/Gen2Constants.java +++ b/src/com/sneed/pkrandom/constants/Gen2Constants.java @@ -72,11 +72,12 @@ public class Gen2Constants { public static final int mapGroupCount = 26, mapsInLastGroup = 11; - public static final int noDamageSleepEffect = 1, damagePoisonEffect = 2, damageBurnEffect = 4, damageFreezeEffect = 5, - damageParalyzeEffect = 6, noDamageAtkPlusOneEffect = 10, noDamageDefPlusOneEffect = 11, noDamageSpAtkPlusOneEffect = 13, - noDamageEvasionPlusOneEffect = 16, noDamageAtkMinusOneEffect = 18, noDamageDefMinusOneEffect = 19, - noDamageSpeMinusOneEffect = 20, noDamageAccuracyMinusOneEffect = 23, noDamageEvasionMinusOneEffect = 24, flinchEffect = 31, - toxicEffect = 33, noDamageConfusionEffect = 49, noDamageAtkPlusTwoEffect = 50, noDamageDefPlusTwoEffect = 51, + public static final int noDamageSleepEffect = 1, damagePoisonEffect = 2, damageAbsorbEffect = 3, damageBurnEffect = 4, + damageFreezeEffect = 5, damageParalyzeEffect = 6, dreamEaterEffect = 8, noDamageAtkPlusOneEffect = 10, + noDamageDefPlusOneEffect = 11, noDamageSpAtkPlusOneEffect = 13, noDamageEvasionPlusOneEffect = 16, + noDamageAtkMinusOneEffect = 18, noDamageDefMinusOneEffect = 19, noDamageSpeMinusOneEffect = 20, + noDamageAccuracyMinusOneEffect = 23, noDamageEvasionMinusOneEffect = 24, flinchEffect = 31, toxicEffect = 33, + damageRecoilEffect = 48, noDamageConfusionEffect = 49, noDamageAtkPlusTwoEffect = 50, noDamageDefPlusTwoEffect = 51, noDamageSpePlusTwoEffect = 52, noDamageSpDefPlusTwoEffect = 54, noDamageAtkMinusTwoEffect = 58, noDamageDefMinusTwoEffect = 59, noDamageSpeMinusTwoEffect = 60, noDamageSpDefMinusTwoEffect = 62, noDamagePoisonEffect = 66, noDamageParalyzeEffect = 67, damageAtkMinusOneEffect = 68, damageDefMinusOneEffect = 69, damageSpeMinusOneEffect = 70, diff --git a/src/com/sneed/pkrandom/constants/Gen3Constants.java b/src/com/sneed/pkrandom/constants/Gen3Constants.java index e405330..c15d2b9 100644 --- a/src/com/sneed/pkrandom/constants/Gen3Constants.java +++ b/src/com/sneed/pkrandom/constants/Gen3Constants.java @@ -185,22 +185,25 @@ public class Gen3Constants { public static final int frlgMapLabelsStart = 0x58; - public static final int noDamageSleepEffect = 1, damagePoisonEffect = 2, damageBurnEffect = 4, damageFreezeEffect = 5, - damageParalyzeEffect = 6, noDamageAtkPlusOneEffect = 10, noDamageDefPlusOneEffect = 11, noDamageSpAtkPlusOneEffect = 13, - noDamageEvasionPlusOneEffect = 16, noDamageAtkMinusOneEffect = 18, noDamageDefMinusOneEffect = 19, - noDamageSpeMinusOneEffect = 20, noDamageAccuracyMinusOneEffect = 23, noDamageEvasionMinusOneEffect = 24, - flinchEffect = 31, toxicEffect = 33, noDamageConfusionEffect = 49, noDamageAtkPlusTwoEffect = 50, - noDamageDefPlusTwoEffect = 51, noDamageSpePlusTwoEffect = 52, noDamageSpAtkPlusTwoEffect = 53, noDamageSpDefPlusTwoEffect = 54, - noDamageAtkMinusTwoEffect = 58, noDamageDefMinusTwoEffect = 59, noDamageSpeMinusTwoEffect = 60, noDamageSpDefMinusTwoEffect = 62, - noDamagePoisonEffect = 66, noDamageParalyzeEffect = 67, damageAtkMinusOneEffect = 68, damageDefMinusOneEffect = 69, + public static final int noDamageSleepEffect = 1, damagePoisonEffect = 2, damageAbsorbEffect = 3, damageBurnEffect = 4, + damageFreezeEffect = 5, damageParalyzeEffect = 6, dreamEaterEffect = 8, noDamageAtkPlusOneEffect = 10, + noDamageDefPlusOneEffect = 11, noDamageSpAtkPlusOneEffect = 13, noDamageEvasionPlusOneEffect = 16, + noDamageAtkMinusOneEffect = 18, noDamageDefMinusOneEffect = 19, noDamageSpeMinusOneEffect = 20, + noDamageAccuracyMinusOneEffect = 23, noDamageEvasionMinusOneEffect = 24, flinchEffect = 31, toxicEffect = 33, + damageRecoil25PercentEffect = 48, noDamageConfusionEffect = 49, noDamageAtkPlusTwoEffect = 50, + noDamageDefPlusTwoEffect = 51, noDamageSpePlusTwoEffect = 52, noDamageSpAtkPlusTwoEffect = 53, + noDamageSpDefPlusTwoEffect = 54, noDamageAtkMinusTwoEffect = 58, noDamageDefMinusTwoEffect = 59, + noDamageSpeMinusTwoEffect = 60, noDamageSpDefMinusTwoEffect = 62, noDamagePoisonEffect = 66, + noDamageParalyzeEffect = 67, damageAtkMinusOneEffect = 68, damageDefMinusOneEffect = 69, damageSpeMinusOneEffect = 70, damageSpAtkMinusOneEffect = 71, damageSpDefMinusOneEffect = 72, - damageAccuracyMinusOneEffect = 73, skyAttackEffect = 75, damageConfusionEffect = 76, twineedleEffect = 77, snoreEffect = 92, - minimizeEffect = 108, swaggerEffect = 118, damageBurnAndThawUserEffect = 125, damageUserDefPlusOneEffect = 138, - damageUserAtkPlusOneEffect = 139, damageUserAllPlusOneEffect = 140, twisterEffect = 146, flinchWithMinimizeBonusEffect = 150, - thunderEffect = 152, defenseCurlEffect = 156, fakeOutEffect = 158, flatterEffect = 166, noDamageBurnEffect = 167, - chargeEffect = 174, damageUserAtkAndDefMinusOneEffect = 182, teeterDanceEffect = 199, blazeKickEffect = 200, - poisonFangEffect = 202, damageUserSpAtkMinusTwoEffect = 204, noDamageAtkAndDefMinusOneEffect = 205, - noDamageDefAndSpDefPlusOneEffect = 206, noDamageAtkAndDefPlusOneEffect = 208, damagePoisonWithIncreasedCritEffect = 209, + damageAccuracyMinusOneEffect = 73, skyAttackEffect = 75, damageConfusionEffect = 76, twineedleEffect = 77, + snoreEffect = 92, minimizeEffect = 108, swaggerEffect = 118, damageBurnAndThawUserEffect = 125, + damageUserDefPlusOneEffect = 138, damageUserAtkPlusOneEffect = 139, damageUserAllPlusOneEffect = 140, + twisterEffect = 146, flinchWithMinimizeBonusEffect = 150, thunderEffect = 152, defenseCurlEffect = 156, fakeOutEffect = 158, + flatterEffect = 166, noDamageBurnEffect = 167, chargeEffect = 174, damageUserAtkAndDefMinusOneEffect = 182, + damageRecoil33PercentEffect = 198, teeterDanceEffect = 199, blazeKickEffect = 200, poisonFangEffect = 202, + damageUserSpAtkMinusTwoEffect = 204, noDamageAtkAndDefMinusOneEffect = 205, noDamageDefAndSpDefPlusOneEffect = 206, + noDamageAtkAndDefPlusOneEffect = 208, damagePoisonWithIncreasedCritEffect = 209, noDamageSpAtkAndSpDefPlusOneEffect = 211, noDamageAtkAndSpePlusOneEffect = 212; public static final List<Integer> rsRequiredFieldTMs = Arrays.asList(1, 2, 6, 7, 11, 18, 22, 23, diff --git a/src/com/sneed/pkrandom/constants/Gen4Constants.java b/src/com/sneed/pkrandom/constants/Gen4Constants.java index c45e2fa..3d6bcfb 100644 --- a/src/com/sneed/pkrandom/constants/Gen4Constants.java +++ b/src/com/sneed/pkrandom/constants/Gen4Constants.java @@ -681,26 +681,30 @@ public class Gen4Constants { } } - public static final int noDamageSleepEffect = 1, damagePoisonEffect = 2, damageBurnEffect = 4, damageFreezeEffect = 5, - damageParalyzeEffect = 6, noDamageAtkPlusOneEffect = 10, noDamageDefPlusOneEffect = 11, noDamageSpAtkPlusOneEffect = 13, - noDamageEvasionPlusOneEffect = 16, noDamageAtkMinusOneEffect = 18, noDamageDefMinusOneEffect = 19, - noDamageSpeMinusOneEffect = 20, noDamageAccuracyMinusOneEffect = 23, noDamageEvasionMinusOneEffect = 24, - flinchEffect = 31, toxicEffect = 33, noDamageConfusionEffect = 49, noDamageAtkPlusTwoEffect = 50, - noDamageDefPlusTwoEffect = 51, noDamageSpePlusTwoEffect = 52, noDamageSpAtkPlusTwoEffect = 53, noDamageSpDefPlusTwoEffect = 54, - noDamageAtkMinusTwoEffect = 58, noDamageDefMinusTwoEffect = 59, noDamageSpeMinusTwoEffect = 60, noDamageSpDefMinusTwoEffect = 62, - noDamagePoisonEffect = 66, noDamageParalyzeEffect = 67, damageAtkMinusOneEffect = 68, damageDefMinusOneEffect = 69, + public static final int noDamageSleepEffect = 1, damagePoisonEffect = 2, damageAbsorbEffect = 3, damageBurnEffect = 4, + damageFreezeEffect = 5, damageParalyzeEffect = 6, dreamEaterEffect = 8, noDamageAtkPlusOneEffect = 10, + noDamageDefPlusOneEffect = 11, noDamageSpAtkPlusOneEffect = 13, noDamageEvasionPlusOneEffect = 16, + noDamageAtkMinusOneEffect = 18, noDamageDefMinusOneEffect = 19, noDamageSpeMinusOneEffect = 20, + noDamageAccuracyMinusOneEffect = 23, noDamageEvasionMinusOneEffect = 24, flinchEffect = 31, toxicEffect = 33, + damageRecoil25PercentEffect = 48, noDamageConfusionEffect = 49, noDamageAtkPlusTwoEffect = 50, + noDamageDefPlusTwoEffect = 51, noDamageSpePlusTwoEffect = 52, noDamageSpAtkPlusTwoEffect = 53, + noDamageSpDefPlusTwoEffect = 54, noDamageAtkMinusTwoEffect = 58, noDamageDefMinusTwoEffect = 59, + noDamageSpeMinusTwoEffect = 60, noDamageSpDefMinusTwoEffect = 62, noDamagePoisonEffect = 66, + noDamageParalyzeEffect = 67, damageAtkMinusOneEffect = 68, damageDefMinusOneEffect = 69, damageSpeMinusOneEffect = 70, damageSpAtkMinusOneEffect = 71, damageSpDefMinusOneEffect = 72, - damageAccuracyMinusOneEffect = 73, skyAttackEffect = 75, damageConfusionEffect = 76, twineedleEffect = 77, snoreEffect = 92, - minimizeEffect = 108, swaggerEffect = 118, damageBurnAndThawUserEffect = 125, damageUserDefPlusOneEffect = 138, - damageUserAtkPlusOneEffect = 139, damageUserAllPlusOneEffect = 140, twisterEffect = 146, stompEffect = 150, - thunderEffect = 152, defenseCurlEffect = 156, fakeOutEffect = 158, flatterEffect = 166, noDamageBurnEffect = 167, - chargeEffect = 174, damageUserAtkAndDefMinusOneEffect = 182, teeterDanceEffect = 199, blazeKickEffect = 200, - poisonFangEffect = 202, damageUserSpAtkMinusTwoEffect = 204, noDamageAtkAndDefMinusOneEffect = 205, - noDamageDefAndSpDefPlusOneEffect = 206, noDamageAtkAndDefPlusOneEffect = 208, damagePoisonWithIncreasedCritEffect = 209, + damageAccuracyMinusOneEffect = 73, skyAttackEffect = 75, damageConfusionEffect = 76, twineedleEffect = 77, + snoreEffect = 92, minimizeEffect = 108, swaggerEffect = 118, damageBurnAndThawUserEffect = 125, + damageUserDefPlusOneEffect = 138, damageUserAtkPlusOneEffect = 139, damageUserAllPlusOneEffect = 140, + twisterEffect = 146, stompEffect = 150, thunderEffect = 152, defenseCurlEffect = 156, fakeOutEffect = 158, + flatterEffect = 166, noDamageBurnEffect = 167, chargeEffect = 174, damageUserAtkAndDefMinusOneEffect = 182, + damageRecoil33PercentEffect = 198, teeterDanceEffect = 199, blazeKickEffect = 200, poisonFangEffect = 202, + damageUserSpAtkMinusTwoEffect = 204, noDamageAtkAndDefMinusOneEffect = 205, noDamageDefAndSpDefPlusOneEffect = 206, + noDamageAtkAndDefPlusOneEffect = 208, damagePoisonWithIncreasedCritEffect = 209, noDamageSpAtkAndSpDefPlusOneEffect = 211, noDamageAtkAndSpePlusOneEffect = 212, damageUserSpeMinusOneEffect = 218, damageUserDefAndSpDefMinusOneEffect = 229, flareBlitzEffect = 253, blizzardEffect = 260, voltTackleEffect = 262, - bounceEffect = 263, noDamageSpAtkMinusTwoEffect = 265, chatterEffect = 267, damageSpDefMinusTwoEffect = 271, - fireFangEffect = 273, iceFangEffect = 274, thunderFangEffect = 275, damageUserSpAtkPlusOneEffect = 276; + bounceEffect = 263, noDamageSpAtkMinusTwoEffect = 265, chatterEffect = 267, damageRecoil50PercentEffect = 269, + damageSpDefMinusTwoEffect = 271, fireFangEffect = 273, iceFangEffect = 274, thunderFangEffect = 275, + damageUserSpAtkPlusOneEffect = 276; public static final List<Integer> dpRequiredFieldTMs = Arrays.asList(2, 3, 5, 9, 12, 19, 23, 28, 34, 39, 41, 43, 46, 47, 49, 50, 62, 69, 79, 80, 82, 84, 85, 87); diff --git a/src/com/sneed/pkrandom/constants/Gen5Constants.java b/src/com/sneed/pkrandom/constants/Gen5Constants.java index d9feeea..c17f295 100644 --- a/src/com/sneed/pkrandom/constants/Gen5Constants.java +++ b/src/com/sneed/pkrandom/constants/Gen5Constants.java @@ -157,7 +157,8 @@ public class Gen5Constants { }
public static final int noDamageStatusQuality = 1, noDamageStatChangeQuality = 2, damageStatusQuality = 4,
- noDamageStatusAndStatChangeQuality = 5, damageTargetDebuffQuality = 6, damageUserBuffQuality = 7;
+ noDamageStatusAndStatChangeQuality = 5, damageTargetDebuffQuality = 6, damageUserBuffQuality = 7,
+ damageAbsorbQuality = 8;
public static final Type[] typeTable = constructTypeTable();
diff --git a/src/com/sneed/pkrandom/constants/Gen6Constants.java b/src/com/sneed/pkrandom/constants/Gen6Constants.java index f53e619..f4b11bc 100644 --- a/src/com/sneed/pkrandom/constants/Gen6Constants.java +++ b/src/com/sneed/pkrandom/constants/Gen6Constants.java @@ -193,7 +193,8 @@ public class Gen6Constants { } public static final int noDamageStatusQuality = 1, noDamageStatChangeQuality = 2, damageStatusQuality = 4, - noDamageStatusAndStatChangeQuality = 5, damageTargetDebuffQuality = 6, damageUserBuffQuality = 7; + noDamageStatusAndStatChangeQuality = 5, damageTargetDebuffQuality = 6, damageUserBuffQuality = 7, + damageAbsorbQuality = 8; public static List<Integer> bannedMoves = Collections.singletonList(Moves.hyperspaceFury); diff --git a/src/com/sneed/pkrandom/constants/Gen7Constants.java b/src/com/sneed/pkrandom/constants/Gen7Constants.java index 195dbbc..ec6f80f 100644 --- a/src/com/sneed/pkrandom/constants/Gen7Constants.java +++ b/src/com/sneed/pkrandom/constants/Gen7Constants.java @@ -217,7 +217,8 @@ public class Gen7Constants { } public static final int noDamageStatusQuality = 1, noDamageStatChangeQuality = 2, damageStatusQuality = 4, - noDamageStatusAndStatChangeQuality = 5, damageTargetDebuffQuality = 6, damageUserBuffQuality = 7; + noDamageStatusAndStatChangeQuality = 5, damageTargetDebuffQuality = 6, damageUserBuffQuality = 7, + damageAbsorbQuality = 8; public static List<Integer> bannedMoves = Arrays.asList(Moves.darkVoid, Moves.hyperspaceFury); diff --git a/src/com/sneed/pkrandom/pokemon/Move.java b/src/com/sneed/pkrandom/pokemon/Move.java index bbae955..f87da77 100755 --- a/src/com/sneed/pkrandom/pokemon/Move.java +++ b/src/com/sneed/pkrandom/pokemon/Move.java @@ -44,6 +44,8 @@ public class Move { public StatusType statusType = StatusType.NONE; public double statusPercentChance; public double flinchPercentChance; + public int recoilPercent; + public int absorbPercent; public int effectIndex; public int target; public MoveCategory category; diff --git a/src/com/sneed/pkrandom/romhandlers/Gen1RomHandler.java b/src/com/sneed/pkrandom/romhandlers/Gen1RomHandler.java index 4d7f243..275bd82 100755 --- a/src/com/sneed/pkrandom/romhandlers/Gen1RomHandler.java +++ b/src/com/sneed/pkrandom/romhandlers/Gen1RomHandler.java @@ -467,10 +467,23 @@ public class Gen1RomHandler extends AbstractGBCRomHandler { loadStatChangesFromEffect(moves[trueMoveIndex]);
loadStatusFromEffect(moves[trueMoveIndex]);
- if (moves[i].effectIndex == Gen1Constants.flinch10PercentEffect) {
- moves[i].flinchPercentChance = 10.0;
- } else if (moves[i].effectIndex == Gen1Constants.flinch30PercentEffect) {
- moves[i].flinchPercentChance = 30.0;
+ switch (moves[i].effectIndex) {
+ case Gen1Constants.flinch10PercentEffect:
+ moves[i].flinchPercentChance = 10.0;
+ break;
+
+ case Gen1Constants.flinch30PercentEffect:
+ moves[i].flinchPercentChance = 30.0;
+ break;
+
+ case Gen1Constants.damageAbsorbEffect:
+ case Gen1Constants.dreamEaterEffect:
+ moves[i].absorbPercent = 50;
+ break;
+
+ case Gen1Constants.damageRecoilEffect:
+ moves[i].recoilPercent = 25;
+ break;
}
}
}
diff --git a/src/com/sneed/pkrandom/romhandlers/Gen2RomHandler.java b/src/com/sneed/pkrandom/romhandlers/Gen2RomHandler.java index a5f456d..746b98f 100755 --- a/src/com/sneed/pkrandom/romhandlers/Gen2RomHandler.java +++ b/src/com/sneed/pkrandom/romhandlers/Gen2RomHandler.java @@ -453,6 +453,15 @@ public class Gen2RomHandler extends AbstractGBCRomHandler { case Gen2Constants.stompEffect:
moves[i].flinchPercentChance = moves[i].secondaryEffectChance;
break;
+
+ case Gen2Constants.damageAbsorbEffect:
+ case Gen2Constants.dreamEaterEffect:
+ moves[i].absorbPercent = 50;
+ break;
+
+ case Gen2Constants.damageRecoilEffect:
+ moves[i].recoilPercent = 25;
+ break;
}
}
}
diff --git a/src/com/sneed/pkrandom/romhandlers/Gen3RomHandler.java b/src/com/sneed/pkrandom/romhandlers/Gen3RomHandler.java index f9160bd..8f3a645 100755 --- a/src/com/sneed/pkrandom/romhandlers/Gen3RomHandler.java +++ b/src/com/sneed/pkrandom/romhandlers/Gen3RomHandler.java @@ -847,6 +847,19 @@ public class Gen3RomHandler extends AbstractGBRomHandler { case Gen3Constants.fakeOutEffect: moves[i].flinchPercentChance = moves[i].secondaryEffectChance; break; + + case Gen3Constants.damageAbsorbEffect: + case Gen3Constants.dreamEaterEffect: + moves[i].absorbPercent = 50; + break; + + case Gen3Constants.damageRecoil25PercentEffect: + moves[i].recoilPercent = 25; + break; + + case Gen3Constants.damageRecoil33PercentEffect: + moves[i].recoilPercent = 33; + break; } if (GlobalConstants.normalMultihitMoves.contains(i)) { diff --git a/src/com/sneed/pkrandom/romhandlers/Gen4RomHandler.java b/src/com/sneed/pkrandom/romhandlers/Gen4RomHandler.java index db1246d..0422ab2 100755 --- a/src/com/sneed/pkrandom/romhandlers/Gen4RomHandler.java +++ b/src/com/sneed/pkrandom/romhandlers/Gen4RomHandler.java @@ -606,6 +606,25 @@ public class Gen4RomHandler extends AbstractDSRomHandler { case Gen4Constants.thunderFangEffect:
moves[i].flinchPercentChance = moves[i].secondaryEffectChance;
break;
+
+ case Gen4Constants.damageAbsorbEffect:
+ case Gen4Constants.dreamEaterEffect:
+ moves[i].absorbPercent = 50;
+ break;
+
+ case Gen4Constants.damageRecoil25PercentEffect:
+ moves[i].recoilPercent = 25;
+ break;
+
+ case Gen4Constants.damageRecoil33PercentEffect:
+ case Gen4Constants.flareBlitzEffect:
+ case Gen4Constants.voltTackleEffect:
+ moves[i].recoilPercent = 33;
+ break;
+
+ case Gen4Constants.damageRecoil50PercentEffect:
+ moves[i].recoilPercent = 50;
+ break;
}
}
} catch (IOException e) {
diff --git a/src/com/sneed/pkrandom/romhandlers/Gen5RomHandler.java b/src/com/sneed/pkrandom/romhandlers/Gen5RomHandler.java index 906e02d..023b861 100755 --- a/src/com/sneed/pkrandom/romhandlers/Gen5RomHandler.java +++ b/src/com/sneed/pkrandom/romhandlers/Gen5RomHandler.java @@ -561,6 +561,13 @@ public class Gen5RomHandler extends AbstractDSRomHandler { moves[i].priority = moveData[6];
int flags = FileFunctions.readFullInt(moveData, 32);
moves[i].makesContact = (flags & 1) != 0;
+ int qualities = moveData[1];
+ int recoilOrAbsorbPercent = moveData[18];
+ if (qualities == Gen5Constants.damageAbsorbQuality) {
+ moves[i].absorbPercent = recoilOrAbsorbPercent;
+ } else {
+ moves[i].recoilPercent = -recoilOrAbsorbPercent;
+ }
if (i == Moves.swift) {
perfectAccuracy = (int)moves[i].hitratio;
@@ -574,7 +581,6 @@ public class Gen5RomHandler extends AbstractDSRomHandler { moves[i].hitCount = 2.71; // this assumes the first hit lands
}
- int qualities = moveData[1];
switch (qualities) {
case Gen5Constants.noDamageStatChangeQuality:
case Gen5Constants.noDamageStatusAndStatChangeQuality:
diff --git a/src/com/sneed/pkrandom/romhandlers/Gen6RomHandler.java b/src/com/sneed/pkrandom/romhandlers/Gen6RomHandler.java index db9c399..b107b0a 100644 --- a/src/com/sneed/pkrandom/romhandlers/Gen6RomHandler.java +++ b/src/com/sneed/pkrandom/romhandlers/Gen6RomHandler.java @@ -612,6 +612,13 @@ public class Gen6RomHandler extends Abstract3DSRomHandler { moves[i].priority = moveData[6]; int flags = FileFunctions.readFullInt(moveData, 32); moves[i].makesContact = (flags & 1) != 0; + int qualities = moveData[1]; + int recoilOrAbsorbPercent = moveData[18]; + if (qualities == Gen6Constants.damageAbsorbQuality) { + moves[i].absorbPercent = recoilOrAbsorbPercent; + } else { + moves[i].recoilPercent = -recoilOrAbsorbPercent; + } if (i == Moves.swift) { perfectAccuracy = (int)moves[i].hitratio; @@ -625,7 +632,6 @@ public class Gen6RomHandler extends Abstract3DSRomHandler { moves[i].hitCount = 2.71; // this assumes the first hit lands } - int qualities = moveData[1]; switch (qualities) { case Gen6Constants.noDamageStatChangeQuality: case Gen6Constants.noDamageStatusAndStatChangeQuality: diff --git a/src/com/sneed/pkrandom/romhandlers/Gen7RomHandler.java b/src/com/sneed/pkrandom/romhandlers/Gen7RomHandler.java index e8e1271..1e2ed98 100644 --- a/src/com/sneed/pkrandom/romhandlers/Gen7RomHandler.java +++ b/src/com/sneed/pkrandom/romhandlers/Gen7RomHandler.java @@ -684,6 +684,13 @@ public class Gen7RomHandler extends Abstract3DSRomHandler { moves[i].priority = moveData[6]; int flags = FileFunctions.readFullInt(moveData, 36); moves[i].makesContact = (flags & 1) != 0; + int qualities = moveData[1]; + int recoilOrAbsorbPercent = moveData[18]; + if (qualities == Gen7Constants.damageAbsorbQuality) { + moves[i].absorbPercent = recoilOrAbsorbPercent; + } else { + moves[i].recoilPercent = -recoilOrAbsorbPercent; + } if (i == Moves.swift) { perfectAccuracy = (int)moves[i].hitratio; @@ -697,7 +704,6 @@ public class Gen7RomHandler extends Abstract3DSRomHandler { moves[i].hitCount = 2.71; // this assumes the first hit lands } - int qualities = moveData[1]; switch (qualities) { case Gen7Constants.noDamageStatChangeQuality: case Gen7Constants.noDamageStatusAndStatChangeQuality: |