diff options
-rw-r--r-- | Add-a-new-Fairy-type.md | 112 | ||||
-rw-r--r-- | Allow-map-tiles-to-appear-above-sprites.md | 124 | ||||
-rw-r--r-- | Automatically-reuse-Repel.md | 122 | ||||
-rw-r--r-- | Colored-trainer-card-badges.md | 66 | ||||
-rw-r--r-- | Remove-the-25%-failure-chance-for-AI-status-moves.md | 26 |
5 files changed, 225 insertions, 225 deletions
diff --git a/Add-a-new-Fairy-type.md b/Add-a-new-Fairy-type.md index c29663c..dc00c31 100644 --- a/Add-a-new-Fairy-type.md +++ b/Add-a-new-Fairy-type.md @@ -19,17 +19,17 @@ Gen 2 was before the physical/special split, so the types after `SPECIAL` count Edit [constants/type_constants.asm](../blob/master/constants/type_constants.asm): ```diff -SPECIAL EQU const_value - const FIRE - const WATER - const GRASS - const ELECTRIC - const PSYCHIC - const ICE - const DRAGON - const DARK + SPECIAL EQU const_value + const FIRE + const WATER + const GRASS + const ELECTRIC + const PSYCHIC + const ICE + const DRAGON + const DARK + const FAIRY -TYPES_END EQU const_value + TYPES_END EQU const_value ``` (If you're using an old version of pokecrystal where the `EGG_FAIRY` egg group constant was still called `FAIRY`, you'll have to name the type something different, like `FAIRY_T` or `FAERIE`.) @@ -40,16 +40,16 @@ TYPES_END EQU const_value Edit [data/types/names.asm](../blob/master/data/types/names.asm): ```diff -TypeNames: ; 5097b -; entries correspond to types (see constants/type_constants.asm) - dw Normal - ... - dw Dark + TypeNames: ; 5097b + ; entries correspond to types (see constants/type_constants.asm) + dw Normal + ... + dw Dark + dw Fairy -Normal: db "NORMAL@" -... -Dark: db "DARK@" + Normal: db "NORMAL@" + ... + Dark: db "DARK@" +Fairy: db "FAIRY@" ``` @@ -59,11 +59,11 @@ Dark: db "DARK@" Edit [data/types/type_matchups.asm](../blob/master/data/types/type_matchups.asm): ```diff -TypeMatchups: ; 34bb1 - ; attacker, defender, *= - db NORMAL, ROCK, NOT_VERY_EFFECTIVE - db NORMAL, STEEL, NOT_VERY_EFFECTIVE - ... + TypeMatchups: ; 34bb1 + ; attacker, defender, *= + db NORMAL, ROCK, NOT_VERY_EFFECTIVE + db NORMAL, STEEL, NOT_VERY_EFFECTIVE + ... + db FIGHTING, FAIRY, NOT_VERY_EFFECTIVE + db POISON, FAIRY, SUPER_EFFECTIVE + db BUG, FAIRY, NOT_VERY_EFFECTIVE @@ -75,13 +75,13 @@ TypeMatchups: ; 34bb1 + db FAIRY, DARK, SUPER_EFFECTIVE + db FAIRY, STEEL, NOT_VERY_EFFECTIVE - db -2 ; end + db -2 ; end -; Foresight removes Ghost's immunities. - db NORMAL, GHOST, NO_EFFECT - db FIGHTING, GHOST, NO_EFFECT + ; Foresight removes Ghost's immunities. + db NORMAL, GHOST, NO_EFFECT + db FIGHTING, GHOST, NO_EFFECT - db -1 ; end (with Foresight) + db -1 ; end (with Foresight) ``` @@ -92,26 +92,26 @@ These tables are used for the Pokédex's type search feature. Edit [data/types/search_types.asm](../blob/master/data/types/search_types.asm): ```diff -PokedexTypeSearchConversionTable: ; 410f6 -; entries correspond with PokedexTypeSearchStrings (see data/types/search_strings.asm) - db NORMAL - ... - db STEEL + PokedexTypeSearchConversionTable: ; 410f6 + ; entries correspond with PokedexTypeSearchStrings (see data/types/search_strings.asm) + db NORMAL + ... + db STEEL + db FAIRY -; 41107 + ; 41107 ``` Edit [data/types/search_strings.asm](../blob/master/data/types/search_strings.asm): ```diff -PokedexTypeSearchStrings: ; 40fe4 -; entries correspond with PokedexTypeSearchConversionTable (see data/types/search_types.asm) - db " ---- @" - db " NORMAL @" - ... - db " STEEL @" + PokedexTypeSearchStrings: ; 40fe4 + ; entries correspond with PokedexTypeSearchConversionTable (see data/types/search_types.asm) + db " ---- @" + db " NORMAL @" + ... + db " STEEL @" + db " FAIRY @" -; 41086 + ; 41086 ``` @@ -150,33 +150,33 @@ At this point we're technically done: all the canon aspects of the Fairy type ar Edit [data/types/type_boost_items.asm](../blob/master/data/types/type_boost_items.asm): ```diff -TypeBoostItems: ; 35703 + TypeBoostItems: ; 35703 - db HELD_NORMAL_BOOST, NORMAL ; PINK_BOW/POLKADOT_BOW + db HELD_NORMAL_BOOST, NORMAL ; PINK_BOW - ... - db HELD_STEEL_BOOST, STEEL ; METAL_COAT + ... + db HELD_STEEL_BOOST, STEEL ; METAL_COAT + db HELD_FAIRY_BOOST, FAIRY ; POLKADOT_BOW - db -1 -; 35726 + db -1 + ; 35726 ``` But we still need to define `HELD_FAIRY_BOOST` and apply it to `POLKADOT_BOW`. So edit [constants/item_data_constants.asm](../blob/master/constants/item_data_constants.asm): ```diff -const_value set 50 - const HELD_NORMAL_BOOST - ... - const HELD_STEEL_BOOST + const_value set 50 + const HELD_NORMAL_BOOST + ... + const HELD_STEEL_BOOST + const HELD_FAIRY_BOOST ``` And [data/items/attributes.asm](../blob/master/data/items/attributes.asm): ```diff -ItemAttributes: ; 67c1 -; entries correspond to constants/item_constants.asm -... -; POLKADOT_BOW + ItemAttributes: ; 67c1 + ; entries correspond to constants/item_constants.asm + ... + ; POLKADOT_BOW - item_attribute 100, HELD_NORMAL_BOOST, 10, CANT_SELECT, ITEM, ITEMMENU_NOUSE, ITEMMENU_NOUSE + item_attribute 100, HELD_FAIRY_BOOST, 10, CANT_SELECT, ITEM, ITEMMENU_NOUSE, ITEMMENU_NOUSE ``` @@ -184,10 +184,10 @@ ItemAttributes: ; 67c1 And lastly, [data/items/descriptions.asm](../blob/master/data/items/descriptions.asm): ```diff -PolkadotBowDesc: + PolkadotBowDesc: - db "Powers up normal-" + db "Powers up fairy-" - next "type moves. (HOLD)@" + next "type moves. (HOLD)@" ``` *Now* we're done! diff --git a/Allow-map-tiles-to-appear-above-sprites.md b/Allow-map-tiles-to-appear-above-sprites.md index b190cf5..5217d6d 100644 --- a/Allow-map-tiles-to-appear-above-sprites.md +++ b/Allow-map-tiles-to-appear-above-sprites.md @@ -36,17 +36,17 @@ Every tile on the screen has an attribute byte. The lowest three bits define the Edit [constants/tileset_constants.asm](../blob/master/constants/tileset_constants.asm): ```diff -; bg palette values (see gfx/tilesets/*_palette_map.asm) -; TilesetBGPalette indexes (see gfx/tilesets/bg_tiles.pal) - const_def - const PAL_BG_GRAY ; 0 - const PAL_BG_RED ; 1 - const PAL_BG_GREEN ; 2 - const PAL_BG_WATER ; 3 - const PAL_BG_YELLOW ; 4 - const PAL_BG_BROWN ; 5 - const PAL_BG_ROOF ; 6 - const PAL_BG_TEXT ; 7 + ; bg palette values (see gfx/tilesets/*_palette_map.asm) + ; TilesetBGPalette indexes (see gfx/tilesets/bg_tiles.pal) + const_def + const PAL_BG_GRAY ; 0 + const PAL_BG_RED ; 1 + const PAL_BG_GREEN ; 2 + const PAL_BG_WATER ; 3 + const PAL_BG_YELLOW ; 4 + const PAL_BG_BROWN ; 5 + const PAL_BG_ROOF ; 6 + const PAL_BG_TEXT ; 7 +const_value set $80 + const PAL_BG_PRIORITY_GRAY ; 80 @@ -69,18 +69,18 @@ But we can't just start using colors like `PRIORITY_RED` in the tilesets' palett Edit [gfx/tilesets/palette_maps.asm](../blob/master/gfx/tilesets/palette_maps.asm): ```diff -tilepal: MACRO -; used in gfx/tilesets/*_palette_map.asm -; vram bank, pals -x = \1 << OAM_TILE_BANK + tilepal: MACRO + ; used in gfx/tilesets/*_palette_map.asm + ; vram bank, pals + x = \1 << OAM_TILE_BANK -rept (_NARG +- 1) / 2 +rept _NARG +- 1 - dn (x | PAL_BG_\3), (x | PAL_BG_\2) + db (x | PAL_BG_\2) - shift - shift -endr -ENDM + shift + endr + ENDM ``` @@ -93,8 +93,8 @@ Edit each \_palette\_map.asm file: ```diff -rept 16 +rept 32 - db $ff -endr + db $ff + endr ``` @@ -106,19 +106,19 @@ Now the tileset palette data will take up twice as much space—one byte per til -SECTION "bank13", ROMX +SECTION "Tileset Palettes", ROMX -INCLUDE "engine/map_palettes.asm" -INCLUDE "gfx/tilesets/palette_maps.asm" + INCLUDE "engine/map_palettes.asm" + INCLUDE "gfx/tilesets/palette_maps.asm" + + +SECTION "bank13", ROMX + -INCLUDE "data/collision_permissions.asm" -INCLUDE "engine/routines/emptyallsrambanks.asm" -INCLUDE "engine/routines/savemenu_copytilemapatonce.asm" -INCLUDE "engine/routines/checksave.asm" -INCLUDE "data/maps/scenes.asm" -INCLUDE "engine/routines/loadmappart.asm" -INCLUDE "engine/routines/phonering_copytilemapatonce.asm" + INCLUDE "data/collision_permissions.asm" + INCLUDE "engine/routines/emptyallsrambanks.asm" + INCLUDE "engine/routines/savemenu_copytilemapatonce.asm" + INCLUDE "engine/routines/checksave.asm" + INCLUDE "data/maps/scenes.asm" + INCLUDE "engine/routines/loadmappart.asm" + INCLUDE "engine/routines/phonering_copytilemapatonce.asm" ``` Since we don't specify a bank for "Tileset Palettes" in [pokecrystal.link](../blob/master/pokecrystal.link), rgblink will place it in any bank that has enough room. @@ -129,13 +129,13 @@ Since we don't specify a bank for "Tileset Palettes" in [pokecrystal.link](../bl Edit [engine/map_palettes.asm](../blob/master/engine/map_palettes.asm): ```diff -SwapTextboxPalettes:: ; 4c000 - hlcoord 0, 0 - decoord 0, 0, wAttrMap - ld b, SCREEN_HEIGHT -.loop - push bc - ld c, SCREEN_WIDTH + SwapTextboxPalettes:: ; 4c000 + hlcoord 0, 0 + decoord 0, 0, wAttrMap + ld b, SCREEN_HEIGHT + .loop + push bc + ld c, SCREEN_WIDTH + call GetBGMapTilePalettes -.innerloop - ld a, [hl] @@ -171,30 +171,30 @@ SwapTextboxPalettes:: ; 4c000 - inc de - dec c - jr nz, .innerloop - pop bc - dec b - jr nz, .loop - ret - -ScrollBGMapPalettes:: ; 4c03f - ld hl, wBGMapBuffer - ld de, wBGMapPalBuffer + pop bc + dec b + jr nz, .loop + ret + + ScrollBGMapPalettes:: ; 4c03f + ld hl, wBGMapBuffer + ld de, wBGMapPalBuffer + ; fallthrough +GetBGMapTilePalettes: -.loop - ld a, [hl] - push hl + .loop + ld a, [hl] + push hl - srl a - jr c, .UpperNybble - -; .LowerNybble - ld hl, wTilesetPalettes - add [hl] - ld l, a - ld a, [wTilesetPalettes + 1] - adc 0 - ld h, a - ld a, [hl] + ld hl, wTilesetPalettes + add [hl] + ld l, a + ld a, [wTilesetPalettes + 1] + adc 0 + ld h, a + ld a, [hl] - and $f - jr .next - @@ -210,14 +210,14 @@ ScrollBGMapPalettes:: ; 4c03f - and $f - -.next - pop hl - ld [de], a - res 7, [hl] - inc hl - inc de - dec c - jr nz, .loop - ret + pop hl + ld [de], a + res 7, [hl] + inc hl + inc de + dec c + jr nz, .loop + ret ``` Notice how `SwapTextboxPalettes` now reuses the loop it shares with `ScrollBGMapPalettes`, and then the whole decision of which nybble to read is no longer necessary because the whole byte defines one tile's attributes. diff --git a/Automatically-reuse-Repel.md b/Automatically-reuse-Repel.md index 05fecc1..716ef49 100644 --- a/Automatically-reuse-Repel.md +++ b/Automatically-reuse-Repel.md @@ -24,14 +24,14 @@ It's between the `wPlayerData` and `wPlayerDataEnd` labels. That means it's part We need to add a `wRepelType` byte that works the same way. It's just one byte since it stores the item ID. There's free space nearby, so let's use that: ```diff -wLuckyNumberShowFlag:: db ; dc9d + wLuckyNumberShowFlag:: db ; dc9d - ds 1 +wRepelType:: db -wLuckyIDNumber:: dw ; dc9f + wLuckyIDNumber:: dw ; dc9f -wRepelEffect:: db ; If a Repel is in use, it contains the nr of steps it's still active -wBikeStep:: dw -wKurtApricornQuantity:: db + wRepelEffect:: db ; If a Repel is in use, it contains the nr of steps it's still active + wBikeStep:: dw + wKurtApricornQuantity:: db ``` @@ -40,38 +40,38 @@ wKurtApricornQuantity:: db The file that defines item effects is, predictably, [engine/item_effects.asm](../blob/master/engine/item_effects.asm). It turns out that Repel, Super Repel, and Max Repel all use the same code, so we don't have to write anything three times. ```diff -SuperRepelEffect: ; f462 - ld b, 200 - jr UseRepel -; f466 - -MaxRepelEffect: ; f466 - ld b, 250 - jr UseRepel -; f466 - -RepelEffect: ; f46a - ld b, 100 -; f46c - -UseRepel: ; f46c - ld a, [wRepelEffect] - and a - ld hl, TextJump_RepelUsedEarlierIsStillInEffect - jp nz, PrintText - - ld a, b - ld [wRepelEffect], a + SuperRepelEffect: ; f462 + ld b, 200 + jr UseRepel + ; f466 + + MaxRepelEffect: ; f466 + ld b, 250 + jr UseRepel + ; f466 + + RepelEffect: ; f46a + ld b, 100 + ; f46c + + UseRepel: ; f46c + ld a, [wRepelEffect] + and a + ld hl, TextJump_RepelUsedEarlierIsStillInEffect + jp nz, PrintText + + ld a, b + ld [wRepelEffect], a + ld a, [wCurItem] + ld [wRepelType], a - jp UseItemText + jp UseItemText -TextJump_RepelUsedEarlierIsStillInEffect: ; 0xf47d - ; The REPEL used earlier is still in effect. - text_jump Text_RepelUsedEarlierIsStillInEffect - db "@" -; 0xf482 + TextJump_RepelUsedEarlierIsStillInEffect: ; 0xf47d + ; The REPEL used earlier is still in effect. + text_jump Text_RepelUsedEarlierIsStillInEffect + db "@" + ; 0xf482 ``` @@ -80,29 +80,29 @@ TextJump_RepelUsedEarlierIsStillInEffect: ; 0xf47d Edit [engine/events.asm](../blob/master/engine/events.asm): ```diff -DoRepelStep: ; 96bd7 - ld a, [wRepelEffect] - and a - ret z + DoRepelStep: ; 96bd7 + ld a, [wRepelEffect] + and a + ret z - dec a - ld [wRepelEffect], a - ret nz + dec a + ld [wRepelEffect], a + ret nz + ld a, [wRepelType] + ld [wCurItem], a + ld hl, wNumItems + call CheckItem - ld a, BANK(RepelWoreOffScript) - ld hl, RepelWoreOffScript + ld a, BANK(RepelWoreOffScript) + ld hl, RepelWoreOffScript + jr nc, .got_script + ld a, BANK(UseAnotherRepelScript) + ld hl, UseAnotherRepelScript +.got_script - call CallScript - scf - ret -; 96beb + call CallScript + scf + ret + ; 96beb ``` Note that `UseAnotherRepelScript` hasn't been defined yet, so we'll do that next. @@ -113,17 +113,17 @@ Note that `UseAnotherRepelScript` hasn't been defined yet, so we'll do that next Edit [engine/events/misc_scripts_2.asm](../blob/master/engine/events/misc_scripts_2.asm): ```diff -RepelWoreOffScript:: ; 0x13619 - opentext - writetext .text - waitbutton - closetext - end - -.text ; 0x13620 - ; REPEL's effect wore off. - text_jump UnknownText_0x1bd308 - db "@" + RepelWoreOffScript:: ; 0x13619 + opentext + writetext .text + waitbutton + closetext + end + + .text ; 0x13620 + ; REPEL's effect wore off. + text_jump UnknownText_0x1bd308 + db "@" +UseAnotherRepelScript:: + opentext @@ -148,10 +148,10 @@ Again, we have not yet defined `UseAnotherRepelText`, so let's finish up with th Edit [data/text/common_1.asm](../blob/master/data/text/common_1.asm): ```diff -UnknownText_0x1bd308:: - text "REPEL's effect" - line "wore off." - done + UnknownText_0x1bd308:: + text "REPEL's effect" + line "wore off." + done +UseAnotherRepelText:: + text "REPEL's effect" diff --git a/Colored-trainer-card-badges.md b/Colored-trainer-card-badges.md index b175e5b..f3df062 100644 --- a/Colored-trainer-card-badges.md +++ b/Colored-trainer-card-badges.md @@ -30,8 +30,8 @@ Create **gfx/trainer_card/badges.pal**: Edit [engine/cgb_layouts.asm](../blob/master/engine/cgb_layouts.asm): ```diff -_CGB_TrainerCard: ; 9289 - ... + _CGB_TrainerCard: ; 9289 + ... - ld a, PREDEFPAL_CGB_BADGE - call GetPredefPal - call LoadHLPaletteIntoDE @@ -39,11 +39,11 @@ _CGB_TrainerCard: ; 9289 + ld bc, 8 palettes + ld a, BANK(wOBPals1) + call FarCopyWRAM - - ... - ret -; 9373 - + + ... + ret + ; 9373 + +.BadgePalettes: +INCLUDE "gfx/trainer_card/badges.pal" ``` @@ -54,55 +54,55 @@ _CGB_TrainerCard: ; 9289 Edit [engine/trainer_card.asm](../blob/master/engine/trainer_card.asm): ```diff -TrainerCard_JohtoBadgesOAM: ; 254c9 -; Template OAM data for each badge on the trainer card. -; Format: - ; y, x, palette - ; cycle 1: face tile, in1 tile, in2 tile, in3 tile - ; cycle 2: face tile, in1 tile, in2 tile, in3 tile + TrainerCard_JohtoBadgesOAM: ; 254c9 + ; Template OAM data for each badge on the trainer card. + ; Format: + ; y, x, palette + ; cycle 1: face tile, in1 tile, in2 tile, in3 tile + ; cycle 2: face tile, in1 tile, in2 tile, in3 tile - dw wJohtoBadges + dw wJohtoBadges - ; Zephyrbadge - db $68, $18, 0 - db $00, $20, $24, $20 | (1 << 7) - db $00, $20, $24, $20 | (1 << 7) + ; Zephyrbadge + db $68, $18, 0 + db $00, $20, $24, $20 | (1 << 7) + db $00, $20, $24, $20 | (1 << 7) - ; Hivebadge + ; Hivebadge - db $68, $38, 0 + db $68, $38, 1 - ... + ... - ; Plainbadge + ; Plainbadge - db $68, $58, 0 + db $68, $58, 2 - ... + ... - ; Fogbadge + ; Fogbadge - db $68, $78, 0 + db $68, $78, 3 - ... + ... - ; Mineralbadge + ; Mineralbadge - db $80, $38, 0 + db $80, $38, 5 - ... + ... - ; Stormbadge + ; Stormbadge - db $80, $18, 0 + db $80, $18, 4 - ... + ... - ; Glacierbadge + ; Glacierbadge - db $80, $58, 0 + db $80, $58, 6 - ... + ... - ; Risingbadge - ; X-flips on alternate cycles. + ; Risingbadge + ; X-flips on alternate cycles. - db $80, $78, 0 + db $80, $78, 7 - ... + ... ``` diff --git a/Remove-the-25%-failure-chance-for-AI-status-moves.md b/Remove-the-25%-failure-chance-for-AI-status-moves.md index e044994..696f06c 100644 --- a/Remove-the-25%-failure-chance-for-AI-status-moves.md +++ b/Remove-the-25%-failure-chance-for-AI-status-moves.md @@ -12,15 +12,15 @@ When the AI uses stat-lowering or status-inflicting moves, like Screech or Sleep ## 1. `BattleCommand_StatDown` ```diff -; Sharply lower the stat if applicable. - ld a, [wLoweredStat] - and $f0 + ; Sharply lower the stat if applicable. + ld a, [wLoweredStat] + and $f0 - jr z, .ComputerMiss + jr z, .GotAmountToLower - dec b + dec b - jr nz, .ComputerMiss + jr nz, .GotAmountToLower - inc b + inc b -.ComputerMiss: -; Computer opponents have a 25% chance of failing. @@ -53,21 +53,21 @@ When the AI uses stat-lowering or status-inflicting moves, like Screech or Sleep -.DidntMiss: +.GotAmountToLower: - call CheckSubstituteOpp - jr nz, .Failed + call CheckSubstituteOpp + jr nz, .Failed - ... + ... ``` ## 2. `BattleCommand_SleepTarget` ```diff - ld hl, DidntAffect1Text + ld hl, DidntAffect1Text - call .CheckAIRandomFail - jr c, .fail - ... + ... -.CheckAIRandomFail: ; 35ece - ; Enemy turn @@ -123,14 +123,14 @@ When the AI uses stat-lowering or status-inflicting moves, like Screech or Sleep - jr c, .failed - -.dont_sample_failure - ... + ... ``` ## 4. `BattleCommand_Paralyze` ```diff -.no_item_protection + .no_item_protection - ld a, [hBattleTurn] - and a - jr z, .dont_sample_failure @@ -152,7 +152,7 @@ When the AI uses stat-lowering or status-inflicting moves, like Screech or Sleep - jr c, .failed - -.dont_sample_failure - ... + ... ``` That's it! Note that there is no `BattleCommand_Burn` or `BattleCommand_Freeze`. |