summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRangi <remy.oukaour+rangi42@gmail.com>2018-07-22 11:53:12 -0400
committerRangi <remy.oukaour+rangi42@gmail.com>2018-07-22 11:53:12 -0400
commit8fe59b57fcef37b0a4484d37a8d449c1dbc32781 (patch)
treec4fa1bcdc272ac1f58420ceb74186e60264f8c0a
parent0f06a2eb7d88a01e7d8aeb06b0de1cb91991c039 (diff)
TYPE_MASK
-rw-r--r--Physical-Special-split.md32
1 files changed, 16 insertions, 16 deletions
diff --git a/Physical-Special-split.md b/Physical-Special-split.md
index d637128..678f83a 100644
--- a/Physical-Special-split.md
+++ b/Physical-Special-split.md
@@ -57,10 +57,10 @@ Edit [constants/type_constants.asm](../blob/master/constants/type_constants.asm)
const DARK
TYPES_END EQU const_value
+
-+MOVE_TYPE_MASK EQU %00111111
-+PHYSICAL EQU %01000000
-+SPECIAL EQU %10000000
-+STATUS EQU %11000000
++TYPE_MASK EQU %00111111
++PHYSICAL EQU %01000000
++SPECIAL EQU %10000000
++STATUS EQU %11000000
```
We're going to store each move's type and category in the same byte. This works well for two reasons:
@@ -119,11 +119,11 @@ Edit [engine/pokemon/types.asm](../blob/master/engine/pokemon/types.asm):
ld a, BANK(Moves)
call FarCopyBytes
ld a, [wStringBuffer1 + MOVE_TYPE]
-+ and MOVE_TYPE_MASK
++ and TYPE_MASK
pop hl
```
-This is the first of many times we'll have to add `and MOVE_TYPE_MASK` somewhere.
+This is the first of many times we'll have to add `and TYPE_MASK` somewhere.
## 4. Mask out the category in nine places in the battle engine
@@ -133,7 +133,7 @@ First, edit [engine/battle/effect_commands.asm](../blob/master/engine/battle/eff
```diff
ld a, BATTLE_VARS_MOVE_TYPE
call GetBattleVar
-+ and MOVE_TYPE_MASK
++ and TYPE_MASK
```
1. `BattleCommand_Stab` (actually, this usage calls `GetBattleVarAddr` instead of `GetBattleVar`)
@@ -149,7 +149,7 @@ Next, edit [engine/battle/move_effects/conversion.asm](../blob/master/engine/bat
```diff
ld hl, Moves + MOVE_TYPE
call GetMoveAttr
-+ and MOVE_TYPE_MASK
++ and TYPE_MASK
```
Edit [engine/battle/move_effects/conversion2.asm](../blob/master/engine/battle/move_effects/conversion2.asm):
@@ -157,11 +157,11 @@ Edit [engine/battle/move_effects/conversion2.asm](../blob/master/engine/battle/m
```diff
ld hl, Moves + MOVE_TYPE
call GetMoveAttr
-+ and MOVE_TYPE_MASK
++ and TYPE_MASK
...
ld a, BATTLE_VARS_MOVE_TYPE
call GetBattleVarAddr
-+ and MOVE_TYPE_MASK
++ and TYPE_MASK
```
And edit [engine/battle/move_effects/thunder.asm](../blob/master/engine/battle/move_effects/thunder.asm):
@@ -169,10 +169,10 @@ And edit [engine/battle/move_effects/thunder.asm](../blob/master/engine/battle/m
```diff
ld a, BATTLE_VARS_MOVE_TYPE
call GetBattleVarAddr
-+ and MOVE_TYPE_MASK
++ and TYPE_MASK
```
-That's nine additions of `and MOVE_TYPE_MASK` to mask out the category bits and leave only the type.
+That's nine additions of `and TYPE_MASK` to mask out the category bits and leave only the type.
## 5. Make Hidden Power special
@@ -205,12 +205,12 @@ Edit [engine/battle/ai/scoring.asm](../blob/master/engine/battle/ai/scoring.asm)
push de
push bc
ld a, [wEnemyMoveStruct + MOVE_TYPE]
-+ and MOVE_TYPE_MASK
++ and TYPE_MASK
ld d, a
...
call AIGetEnemyMove
ld a, [wEnemyMoveStruct + MOVE_TYPE]
-+ and MOVE_TYPE_MASK
++ and TYPE_MASK
cp d
```
@@ -272,7 +272,7 @@ This routine used to encourage the AI to use moves that raise its Special Defens
push hl
ld a, [wEnemyMoveStruct + MOVE_TYPE]
-+ and MOVE_TYPE_MASK
++ and TYPE_MASK
ld hl, wEnemyMonType1
predef CheckTypeMatchup
```
@@ -331,7 +331,7 @@ Create **engine/pokemon/categories.asm**:
+ call GetFarByte
+
+; Mask out the type
-+ and $ff ^ MOVE_TYPE_MASK
++ and $ff ^ TYPE_MASK
+; Shift the category bits into the range 0-2
+ rlc a
+ rlc a