diff options
author | ElectroDeoxys <ElectroDeoxys@gmail.com> | 2020-05-11 10:16:23 +0100 |
---|---|---|
committer | ElectroDeoxys <ElectroDeoxys@gmail.com> | 2020-12-16 00:18:20 +0000 |
commit | a45b7780623fcc8b1d5af8863f07786a8f74a9e6 (patch) | |
tree | 21636ef0e295701337d008d53d60db1238af0b32 /src | |
parent | c11acb74b4bc7decf962b191fbb08d6b72e515aa (diff) |
NidoranF attacks
Diffstat (limited to 'src')
-rw-r--r-- | src/data/cards.asm | 16 | ||||
-rw-r--r-- | src/data/effect_commands.asm | 44 | ||||
-rw-r--r-- | src/engine/effect_functions.asm | 203 | ||||
-rw-r--r-- | src/text/text10.asm | 2 | ||||
-rw-r--r-- | src/text/text2.asm | 6 | ||||
-rw-r--r-- | src/text/text_offsets.asm | 8 |
6 files changed, 221 insertions, 58 deletions
diff --git a/src/data/cards.asm b/src/data/cards.asm index e601f98..dca875a 100644 --- a/src/data/cards.asm +++ b/src/data/cards.asm @@ -858,12 +858,12 @@ NidoranFCard: ; 31134 (c:5134) ; move 1 energy GRASS, 1 ; energies - tx FurySweepesName ; name + tx FurySwipesName ; name tx TripleAttackX10Description ; description dw NONE ; description (cont) db 10 ; damage db DAMAGE_X ; category - dw NidoranFFurySweepesEffectCommands ; effect commands + dw NidoranFFurySwipesEffectCommands ; effect commands db NONE ; flags 1 db NONE ; flags 2 db NONE ; flags 3 @@ -3320,12 +3320,12 @@ PsyduckCard: ; 31d64 (c:5d64) ; move 2 energy WATER, 1 ; energies - tx FurySweepesName ; name + tx FurySwipesName ; name tx TripleAttackX10Description ; description dw NONE ; description (cont) db 10 ; damage db DAMAGE_X ; category - dw PsyduckFurySweepesEffectCommands ; effect commands + dw PsyduckFurySwipesEffectCommands ; effect commands db NONE ; flags 1 db NONE ; flags 2 db NONE ; flags 3 @@ -5972,12 +5972,12 @@ SandslashCard: ; 32a98 (c:6a98) ; move 2 energy FIGHTING, 2 ; energies - tx FurySweepesName ; name + tx FurySwipesName ; name tx TripleAttackX20Description ; description dw NONE ; description (cont) db 20 ; damage db DAMAGE_X ; category - dw SandslashFurySweepesEffectCommands ; effect commands + dw SandslashFurySwipesEffectCommands ; effect commands db NONE ; flags 1 db NONE ; flags 2 db NONE ; flags 3 @@ -6162,12 +6162,12 @@ PrimeapeCard: ; 32b9c (c:6b9c) ; move 1 energy FIGHTING, 2 ; energies - tx FurySweepesName ; name + tx FurySwipesName ; name tx TripleAttackX20Description ; description dw NONE ; description (cont) db 20 ; damage db DAMAGE_X ; category - dw PrimeapeFurySweepesEffectCommands ; effect commands + dw PrimeapeFurySwipesEffectCommands ; effect commands db NONE ; flags 1 db NONE ; flags 2 db NONE ; flags 3 diff --git a/src/data/effect_commands.asm b/src/data/effect_commands.asm index 952e895..bcf6636 100644 --- a/src/data/effect_commands.asm +++ b/src/data/effect_commands.asm @@ -59,9 +59,9 @@ WeepinbellPoisonPowderEffectCommands: VictreebelLureEffectCommands: dbw EFFECTCMDTYPE_INITIAL_EFFECT_1, VictreebelLure_CheckBenchPokemon - dbw EFFECTCMDTYPE_AFTER_DAMAGE, VictreebelLure_SwitchDefendingPokemon - dbw EFFECTCMDTYPE_REQUIRE_SELECTION, VictreebelLure_PlayerSelect - dbw EFFECTCMDTYPE_UNKNOWN_08, VictreebelLure_AISelect + dbw EFFECTCMDTYPE_AFTER_DAMAGE, VictreebelLure_SwitchEffect + dbw EFFECTCMDTYPE_REQUIRE_SELECTION, VictreebelLure_PlayerSelectEffect + dbw EFFECTCMDTYPE_UNKNOWN_08, VictreebelLure_AISelectEffect db $00 VictreebelAcidEffectCommands: @@ -154,17 +154,17 @@ OddishStunSporeEffectCommands: db $00 OddishSproutEffectCommands: - dbw EFFECTCMDTYPE_INITIAL_EFFECT_1, SproutEffect_CheckDeckAndPlayArea - dbw EFFECTCMDTYPE_AFTER_DAMAGE, SproutEffect_PutInPlayArea - dbw EFFECTCMDTYPE_REQUIRE_SELECTION, SproutEffect_SelectFromDeck - dbw EFFECTCMDTYPE_UNKNOWN_08, SproutEffect_AISelect + dbw EFFECTCMDTYPE_INITIAL_EFFECT_1, Sprout_CheckDeckAndPlayArea + dbw EFFECTCMDTYPE_AFTER_DAMAGE, Sprout_PutInPlayAreaEffect + dbw EFFECTCMDTYPE_REQUIRE_SELECTION, Sprout_PlayerSelectEffect + dbw EFFECTCMDTYPE_UNKNOWN_08, Sprout_AISelectEffect db $00 ExeggutorTeleportEffectCommands: - dbw EFFECTCMDTYPE_INITIAL_EFFECT_1, TeleportEffect_CheckBench - dbw EFFECTCMDTYPE_AFTER_DAMAGE, TeleportEffect_SwitchEffect - dbw EFFECTCMDTYPE_REQUIRE_SELECTION, TeleportEffect_PlayerSelect - dbw EFFECTCMDTYPE_UNKNOWN_08, TeleportEffect_AISelect + dbw EFFECTCMDTYPE_INITIAL_EFFECT_1, Teleport_CheckBench + dbw EFFECTCMDTYPE_AFTER_DAMAGE, Teleport_SwitchEffect + dbw EFFECTCMDTYPE_REQUIRE_SELECTION, Teleport_PlayerSelectEffect + dbw EFFECTCMDTYPE_UNKNOWN_08, Teleport_AISelectEffect db $00 ExeggutorBigEggsplosionEffectCommands: @@ -184,19 +184,19 @@ NidokingToxicEffectCommands: db $00 NidoqueenBoyfriendsEffectCommands: - dbw EFFECTCMDTYPE_BEFORE_DAMAGE, $4998 + dbw EFFECTCMDTYPE_BEFORE_DAMAGE, BoyfriendsEffect db $00 -NidoranFFurySweepesEffectCommands: - dbw EFFECTCMDTYPE_BEFORE_DAMAGE, $49c6 - dbw EFFECTCMDTYPE_AI, $49be +NidoranFFurySwipesEffectCommands: + dbw EFFECTCMDTYPE_BEFORE_DAMAGE, NidoranFFurySwipes_MultiplierEffect + dbw EFFECTCMDTYPE_AI, NidoranFFurySwipes_AIEffect db $00 NidoranFCallForFamilyEffectCommands: - dbw EFFECTCMDTYPE_INITIAL_EFFECT_1, $49db - dbw EFFECTCMDTYPE_AFTER_DAMAGE, $4a6e - dbw EFFECTCMDTYPE_REQUIRE_SELECTION, $49eb - dbw EFFECTCMDTYPE_UNKNOWN_08, $4a55 + dbw EFFECTCMDTYPE_INITIAL_EFFECT_1, NidoranFCallForFamily_CheckDeckAndPlayArea + dbw EFFECTCMDTYPE_AFTER_DAMAGE, NidoranFCallForFamily_PutInPlayAreaEffect + dbw EFFECTCMDTYPE_REQUIRE_SELECTION, NidoranFCallForFamily_PlayerSelectEffect + dbw EFFECTCMDTYPE_UNKNOWN_08, NidoranFCallForFamily_AISelectEffect db $00 NidoranMHornHazardEffectCommands: @@ -395,7 +395,7 @@ PsyduckHeadacheEffectCommands: dbw EFFECTCMDTYPE_BEFORE_DAMAGE, $500e db $00 -PsyduckFurySweepesEffectCommands: +PsyduckFurySwipesEffectCommands: dbw EFFECTCMDTYPE_BEFORE_DAMAGE, $501e dbw EFFECTCMDTYPE_AI, $5016 db $00 @@ -894,7 +894,7 @@ OnixHardenEffectCommands: dbw EFFECTCMDTYPE_BEFORE_DAMAGE, $6075 db $00 -PrimeapeFurySweepesEffectCommands: +PrimeapeFurySwipesEffectCommands: dbw EFFECTCMDTYPE_BEFORE_DAMAGE, $6083 dbw EFFECTCMDTYPE_AI, $607b db $00 @@ -974,7 +974,7 @@ SandshrewSandAttackEffectCommands: dbw EFFECTCMDTYPE_BEFORE_DAMAGE, $626b db $00 -SandslashFurySweepesEffectCommands: +SandslashFurySwipesEffectCommands: dbw EFFECTCMDTYPE_BEFORE_DAMAGE, $6279 dbw EFFECTCMDTYPE_AI, $6271 db $00 diff --git a/src/engine/effect_functions.asm b/src/engine/effect_functions.asm index 5426f29..8075a71 100644 --- a/src/engine/effect_functions.asm +++ b/src/engine/effect_functions.asm @@ -191,11 +191,11 @@ Func_2c0e9: ; 2c0e9 (b:40e9) ld [hl], a ret -; Sets some flags for AI use -; [wDamage] <- a -; [wAIMinDamage] <- d -; [wAIMaxDamage] <- e -Func_2c0fb: ; 2c0fb (b:40fb) +; Stores information about the attack damage for AI purposes +; [wDamage] <- a (average amount of damage) +; [wAIMinDamage] <- d (minimum) +; [wAIMaxDamage] <- e (maximum) +StoreAIDamageInfo: ; 2c0fb (b:40fb) ld [wDamage], a xor a ld [wDamage + 1], a @@ -704,7 +704,8 @@ AIFindBenchWithLowestHP: ; 2c564 (b:4564) SpitPoison_AIEffect: ; 2c6f0 (b:46f0) ld a, 5 lb de, 0, 10 - jp Func_2c0fb + jp StoreAIDamageInfo +; 0x2c6f8 ; If heads, defending Pokemon becomes poisoned SpitPoison_Poison50PercentEffect: ; 2c6f8 (b:46f8) @@ -773,7 +774,7 @@ VictreebelLure_CheckBenchPokemon: ; 2c740 (b:4740) ret ; 0x2c74b -VictreebelLure_PlayerSelect: ; 2c74b (b:474b) +VictreebelLure_PlayerSelectEffect: ; 2c74b (b:474b) ldtx hl, SelectPkmnOnBenchToSwitchWithActiveText call DrawWideTextBox_WaitForInput call SwapTurn @@ -787,13 +788,13 @@ VictreebelLure_PlayerSelect: ; 2c74b (b:474b) ret ; 0x2c764 -VictreebelLure_AISelect: ; 2c764 (b:4764) +VictreebelLure_AISelectEffect: ; 2c764 (b:4764) call AIFindBenchWithLowestHP ldh [hTemp_ffa0], a ret ; 0x2c76a -VictreebelLure_SwitchDefendingPokemon: ; 2c76a (b:476a) +VictreebelLure_SwitchEffect: ; 2c76a (b:476a) call SwapTurn ldh a, [hTemp_ffa0] ld e, a @@ -889,7 +890,8 @@ ZubatLeechLifeEffect: ; 2c7e3 (b:47e3) Twineedle_AIEffect: ; 2c7ed (b:47ed) ld a, 30 lb de, 0, 60 - jp Func_2c0fb + jp StoreAIDamageInfo +; 0x2c7f5 ; Flip 2 coins; deal 30x number of heads Twineedle_MultiplierEffect: ; 2c7f5 (b:47f5) @@ -949,7 +951,7 @@ MetapodStiffenEffect: ; 2c836 (b:4836) ; returns carry if no cards in Deck or if ; Play Area is full already. -SproutEffect_CheckDeckAndPlayArea: ; 2c84a (b:484a) +Sprout_CheckDeckAndPlayArea: ; 2c84a (b:484a) call CheckIfDeckIsEmpty ret c ; return if no cards in deck ld a, DUELVARS_NUMBER_OF_POKEMON_IN_PLAY_AREA @@ -960,7 +962,7 @@ SproutEffect_CheckDeckAndPlayArea: ; 2c84a (b:484a) ret ; 0x2c85a -SproutEffect_SelectFromDeck: ; 2c85a (b:485a) +Sprout_PlayerSelectEffect: ; 2c85a (b:485a) ld a, $ff ldh [hTemp_ffa0], a @@ -1023,7 +1025,7 @@ SproutEffect_SelectFromDeck: ; 2c85a (b:485a) ret ; 0x2c8b7 -SproutEffect_AISelect: ; 2c8b7 (b:48b7) +Sprout_AISelectEffect: ; 2c8b7 (b:48b7) call CreateDeckCardList ld hl, wDuelTempList .loop_deck @@ -1038,7 +1040,7 @@ SproutEffect_AISelect: ; 2c8b7 (b:48b7) ret ; Oddish found ; 0x2c8cc -SproutEffect_PutInPlayArea: ; 2c8cc (b:48cc) +Sprout_PutInPlayAreaEffect: ; 2c8cc (b:48cc) ldh a, [hTemp_ffa0] cp $ff jr z, .shuffle @@ -1057,7 +1059,7 @@ SproutEffect_PutInPlayArea: ; 2c8cc (b:48cc) ; 0x2c8ec ; returns carry if no Pokemon on Bench -TeleportEffect_CheckBench: ; 2c8ec (b:48ec) +Teleport_CheckBench: ; 2c8ec (b:48ec) ld a, DUELVARS_NUMBER_OF_POKEMON_IN_PLAY_AREA call GetTurnDuelistVariable ldtx hl, ThereAreNoPokemonOnBenchText @@ -1065,7 +1067,7 @@ TeleportEffect_CheckBench: ; 2c8ec (b:48ec) ret ; 0x2c8f7 -TeleportEffect_PlayerSelect: ; 2c8f7 (b:48f7) +Teleport_PlayerSelectEffect: ; 2c8f7 (b:48f7) ldtx hl, SelectPkmnOnBenchToSwitchWithActiveText call DrawWideTextBox_WaitForInput bank1call HasAlivePokemonInBench @@ -1079,7 +1081,7 @@ TeleportEffect_PlayerSelect: ; 2c8f7 (b:48f7) ret ; 0x2c90f -TeleportEffect_AISelect: ; 2c90f (b:490f) +Teleport_AISelectEffect: ; 2c90f (b:490f) ld a, DUELVARS_NUMBER_OF_POKEMON_IN_PLAY_AREA call GetTurnDuelistVariable call Random @@ -1087,7 +1089,7 @@ TeleportEffect_AISelect: ; 2c90f (b:490f) ret ; 0x2c91a -TeleportEffect_SwitchEffect: ; 2c91a (b:491a) +Teleport_SwitchEffect: ; 2c91a (b:491a) ldh a, [hTemp_ffa0] ld e, a call SwapArenaWithBenchPokemon @@ -1145,7 +1147,8 @@ SetDamageToATimes20: ; 2c958 (b:4958) Thrash_AIEffect: ; 2c96b (b:496b) ld a, 35 lb de, 30, 40 - jp Func_2c0fb + jp StoreAIDamageInfo +; 0x2c973 ; If heads 10 more damage; if tails, 10 damage to itself Thrash_ModifierEffect: ; 2c973 (b:4973) @@ -1176,7 +1179,167 @@ Toxic_DoublePoisonEffect: ; 2c994 (b:4994) ret ; 0x2c998 - INCROM $2c998, $2cbfb +BoyfriendsEffect: ; 2c998 (b:4998) + ld a, DUELVARS_ARENA_CARD + call GetTurnDuelistVariable + ld c, PLAY_AREA_ARENA +.loop + ld a, [hl] + cp $ff + jr z, .done + call GetCardIDFromDeckIndex + ld a, e + cp NIDOKING + jr nz, .next + ld a, d + cp $00 ; why check d? Card IDs are only 1 byte long + jr nz, .next + inc c +.next + inc hl + jr .loop +.done +; c holds number of Nidoking found in Play Area + ld a, c + add a + call ATimes10 + call AddToDamage ; adds 2 * 10 * c + ret +; 0x2c9be + +NidoranFFurySwipes_AIEffect: ; 2c9be (b:49be) + ld a, 15 + lb de, 0, 30 + jp StoreAIDamageInfo +; 0x2c9c6 + +NidoranFFurySwipes_MultiplierEffect: ; 2c9c6 (b:49c6) + ld hl, 10 + call LoadTxRam3 + ldtx de, DamageCheckIfHeadsXDamageText + ld a, 3 + call TossCoinATimes_BankB + call ATimes10 + call StoreDamageInfo + ret +; 0x2c9db + +NidoranFCallForFamily_CheckDeckAndPlayArea: ; 2c9db (b:49db) + call CheckIfDeckIsEmpty + ret c ; return if no cards in deck + ld a, DUELVARS_NUMBER_OF_POKEMON_IN_PLAY_AREA + call GetTurnDuelistVariable + ldtx hl, NoSpaceOnTheBenchText + cp MAX_PLAY_AREA_POKEMON + ccf + ret +; 0x2c9eb + +NidoranFCallForFamily_PlayerSelectEffect: ; 2c9eb (b:49eb) + ld a, $ff + ldh [hTemp_ffa0], a + + call CreateDeckCardList + ldtx hl, ChooseNidoranFromDeckText + ldtx bc, NidoranMNidoranFText + lb de, SEARCHEFFECT_NIDORAN, $00 + call LookForCardInDeck + ret c + +; draw Deck list interface and print text + bank1call Func_5591 + ldtx hl, ChooseNidoranText + ldtx de, DuelistDeckText + bank1call SetCardListHeaderText + +.loop + bank1call DisplayCardList + jr c, .pressed_b + call GetCardIDFromDeckIndex + ld bc, NIDORANF + call CompareDEtoBC + jr z, .selected_nidoran + ld bc, NIDORANM + call CompareDEtoBC + jr nz, .loop ; .play_sfx would be more appropriate here + +.selected_nidoran + ldh a, [hTempCardIndex_ff98] + ldh [hTemp_ffa0], a + or a + ret + +.play_sfx + ; play SFX and loop back + call Func_3794 + jr .loop + +.pressed_b +; figure if Player can exit the screen without selecting, +; that is, if the Deck has no NidoranF or NidoranM card. + ld a, DUELVARS_CARD_LOCATIONS + call GetTurnDuelistVariable +.loop_b_press + ld a, [hl] + cp CARD_LOCATION_DECK + jr nz, .next + ld a, l + call GetCardIDFromDeckIndex + ld bc, NIDORANF + call CompareDEtoBC + jr z, .play_sfx ; found, go back to top loop + ld bc, NIDORANM + jr z, .play_sfx ; found, go back to top loop +.next + inc l + ld a, l + cp DECK_SIZE + jr c, .loop_b_press + +; no Nidoran in Deck, can safely exit screen + ld a, $ff + ldh [hTemp_ffa0], a + or a + ret +; 0x2ca55 + +NidoranFCallForFamily_AISelectEffect: ; 2ca55 (b:4a55) + call CreateDeckCardList + ld hl, wDuelTempList +.loop_deck + ld a, [hli] + ldh [hTemp_ffa0], a + cp $ff + ret z ; none found + call GetCardIDFromDeckIndex + ld a, e + cp NIDORANF + jr z, .found + cp NIDORANM + jr nz, .loop_deck +.found + ret +; 0x2ca6e + +NidoranFCallForFamily_PutInPlayAreaEffect: ; 2ca6e (b:4a6e) + ldh a, [hTemp_ffa0] + cp $ff + jr z, .shuffle + call SearchCardInDeckAndAddToHand + call AddCardToHand + call PutHandPokemonCardInPlayArea + call CheckIfTurnDuelistIsPlayer + jr c, .shuffle + ; display card on screen + ldh a, [hTemp_ffa0] + ldtx hl, PlacedOnTheBenchText + bank1call DisplayCardDetailScreen +.shuffle + call Func_2c0bd + ret +; 0x2ca8e + + INCROM $2ca8e, $2cbfb Func_2cbfb: ; 2cbfb (b:4bfb) ldh a, [hAIEnergyTransPlayAreaLocation] diff --git a/src/text/text10.asm b/src/text/text10.asm index 057820f..49fb302 100644 --- a/src/text/text10.asm +++ b/src/text/text10.asm @@ -85,7 +85,7 @@ NidoranFName: ; 582e5 (16:42e5) text "Nidoran♀" done -FurySweepesName: ; 582ef (16:42ef) +FurySwipesName: ; 582ef (16:42ef) text "Fury Swipes" done diff --git a/src/text/text2.asm b/src/text/text2.asm index b9ffa9b..bea4094 100644 --- a/src/text/text2.asm +++ b/src/text/text2.asm @@ -260,12 +260,12 @@ Text0129: ; 38a14 (e:4a14) line "Energy card." done -Text012a: ; 38a31 (e:4a31) +ChooseNidoranFromDeckText: ; 38a31 (e:4a31) text "Choose a Nidoran♀ or a" line "Nidoran♂ from the Deck." done -Text012b: ; 38a61 (e:4a61) +ChooseNidoranText: ; 38a61 (e:4a61) text "Choose a Nidoran♀" line "or a Nidoran♂." done @@ -425,7 +425,7 @@ Text013e: ; 3928c (e:528c) line " Yours Opponent's" done -Text013f: ; 392c9 (e:52c9) +NidoranMNidoranFText: ; 392c9 (e:52c9) text "Nidoran♂ Nidoran♀" done diff --git a/src/text/text_offsets.asm b/src/text/text_offsets.asm index bc9d545..5cc70d0 100644 --- a/src/text/text_offsets.asm +++ b/src/text/text_offsets.asm @@ -299,8 +299,8 @@ TextOffsets:: ; 34000 (d:4000) textpointer ChooseAnOddishText ; 0x0127 textpointer Text0128 ; 0x0128 textpointer Text0129 ; 0x0129 - textpointer Text012a ; 0x012a - textpointer Text012b ; 0x012b + textpointer ChooseNidoranFromDeckText ; 0x012a + textpointer ChooseNidoranText ; 0x012b textpointer Text012c ; 0x012c textpointer Text012d ; 0x012d textpointer Text012e ; 0x012e @@ -320,7 +320,7 @@ TextOffsets:: ; 34000 (d:4000) textpointer WouldYouLikeToCheckTheDeckText ; 0x013c textpointer Text013d ; 0x013d textpointer Text013e ; 0x013e - textpointer Text013f ; 0x013f + textpointer NidoranMNidoranFText ; 0x013f textpointer OddishText ; 0x0140 textpointer Text0141 ; 0x0141 textpointer Text0142 ; 0x0142 @@ -2124,7 +2124,7 @@ TextOffsets:: ; 34000 (d:4000) textpointer CobraName ; 0x0848 textpointer ArbokDescription ; 0x0849 textpointer NidoranFName ; 0x084a - textpointer FurySweepesName ; 0x084b + textpointer FurySwipesName ; 0x084b textpointer TripleAttackX10Description ; 0x084c textpointer CallForFamilyName ; 0x084d textpointer NidoranFsCallForFamilyDescription ; 0x084e |