summaryrefslogtreecommitdiff
path: root/src/com/sneed/pkrandom/romhandlers
diff options
context:
space:
mode:
Diffstat (limited to 'src/com/sneed/pkrandom/romhandlers')
-rwxr-xr-xsrc/com/sneed/pkrandom/romhandlers/Gen1RomHandler.java21
-rwxr-xr-xsrc/com/sneed/pkrandom/romhandlers/Gen2RomHandler.java9
-rwxr-xr-xsrc/com/sneed/pkrandom/romhandlers/Gen3RomHandler.java13
-rwxr-xr-xsrc/com/sneed/pkrandom/romhandlers/Gen4RomHandler.java19
-rwxr-xr-xsrc/com/sneed/pkrandom/romhandlers/Gen5RomHandler.java8
-rw-r--r--src/com/sneed/pkrandom/romhandlers/Gen6RomHandler.java8
-rw-r--r--src/com/sneed/pkrandom/romhandlers/Gen7RomHandler.java8
7 files changed, 79 insertions, 7 deletions
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: