Skip to content

Commit

Permalink
Coaching, Shell Side Arm, Curious Medicine
Browse files Browse the repository at this point in the history
* A few updated animations from Skeli's dev branch: Jungle Healing, Infernal Parade, Coaching
* Implemented Coaching and Shell Side Arm from Skeli's dev branch (with reference to greenphx9's branch for implementation)
* Curious Medicine ability from Skeli's dev branch
* Implemented Frontier streaks from Skeli's branch
* Implemented trade mons being listed as "Met in Trade". Might undo this later because I love funny hatch locations
* Day/Night BGM for Pokemon Centers and Pokemarts implemented; if you're using my code you probably need to scrape that out :P
  • Loading branch information
evanonline committed Aug 20, 2022
1 parent f5bef58 commit 7409b15
Show file tree
Hide file tree
Showing 27 changed files with 343 additions and 79 deletions.
4 changes: 4 additions & 0 deletions anim_defines.s
Original file line number Diff line number Diff line change
Expand Up @@ -462,6 +462,7 @@
.equ AnimTask_TraceMonBlended, 0x80bab99
.equ AnimTask_SmokescreenImpact, 0x80de34d
.equ AnimTask_AttackerPunchWithTrace, 0x8077031
.equ AnimTask_StatusClearedEffect, 0x80e2085

@launchtemplate

Expand Down Expand Up @@ -523,6 +524,9 @@
.equ Template_FallingRock, 0x83e73b4
.equ Template_BlackSmoke, 0x83fee18
.equ Template_GustToTarget, 0x83e6b1c
.equ Template_IngrainRoot, 0x83e2dc4
.equ Template_IngrainOrb, 0x83e2e04
.equ Template_WillOWispFire, 0x83e5ee4

.equ SpriteCB_AnimSpriteOnMonPos, 0x8075D9D
.equ Callback_TranslateAnimSpriteToTargetMonLocation, 0x8075DF5
Expand Down
57 changes: 47 additions & 10 deletions assembly/battle_scripts/general_attack_battle_scripts.s
Original file line number Diff line number Diff line change
Expand Up @@ -3699,6 +3699,7 @@ BS_175_Taunt:
.global BS_176_HelpingHand
BS_176_HelpingHand:
attackcanceler
jumpifmove MOVE_COACHING BS_Coaching
attackstringnoprotean
ppreduce
sethelpinghand FAILED
Expand All @@ -3709,6 +3710,46 @@ BS_176_HelpingHand:
waitmessage DELAY_1SECOND
goto BS_MOVE_END

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

BS_Coaching:
jumpifbyte NOTANDS BATTLE_TYPE BATTLE_DOUBLE FAILED_PRE
callasm SetTargetPartner
jumpiffainted BANK_TARGET FAILED_PRE
jumpifspecialstatusflag BANK_TARGET STATUS3_SEMI_INVULNERABLE 0x0 FAILED_PRE
attackstring
ppreduce
jumpifstat BANK_TARGET LESSTHAN STAT_ATK STAT_MAX Coaching_Atk
jumpifstat BANK_TARGET EQUALS STAT_DEF STAT_MAX BattleScript_CantRaiseMultipleTargetStats

Coaching_Atk:
attackanimation
waitanimation
setbyte STAT_ANIM_PLAYED 0x0
playstatchangeanimation BANK_TARGET, STAT_ANIM_ATK | STAT_ANIM_DEF, STAT_ANIM_UP | STAT_ANIM_IGNORE_ABILITIES
setstatchanger STAT_ATK | INCREASE_1
statbuffchange STAT_TARGET | STAT_BS_PTR | STAT_CERTAIN Coaching_Def
jumpifbyte EQUALS MULTISTRING_CHOOSER 0x2 Coaching_Def
printfromtable gStatUpStringIds
waitmessage DELAY_1SECOND

Coaching_Def:
setstatchanger STAT_DEF | INCREASE_1
statbuffchange STAT_TARGET | STAT_BS_PTR | STAT_CERTAIN BS_MOVE_END
jumpifbyte EQUALS MULTISTRING_CHOOSER 0x2 BS_MOVE_END
printfromtable gStatUpStringIds
waitmessage DELAY_1SECOND
goto BS_MOVE_END

BattleScript_CantRaiseMultipleTargetStats:
pause DELAY_HALFSECOND
orbyte OUTCOME OUTCOME_FAILED
swapattackerwithtarget @;So the proper string is shown
printstring 25 @;STRINGID_STATSWONTINCREASE2
waitmessage DELAY_1SECOND
swapattackerwithtarget
goto BS_MOVE_END

@;@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

.global BS_177_Trick
Expand Down Expand Up @@ -5476,34 +5517,30 @@ BS_244_Teatime:

.global BS_245_Decorate
BS_245_Decorate:
attackcanceler
attackstring
ppreduce

jumpifspecialstatusflag EQUALS STATUS3_SEMI_INVULNERABLE 0x0 FAILED
jumpifspecialstatusflag BANK_TARGET STATUS3_SEMI_INVULNERABLE 0x0 FAILED
jumpiffainted BANK_TARGET FAILED
jumpifprotectedbycraftyshield BANK_TARGET FAILED

attackstring
ppreduce
jumpifstat BANK_TARGET LESSTHAN STAT_ATK STAT_MAX Decorate_Atk
jumpifstat BANK_TARGET EQUALS STAT_SPATK STAT_MAX 0x81D85E7
jumpifstat BANK_TARGET EQUALS STAT_SPATK STAT_MAX BattleScript_CantRaiseMultipleTargetStats

Decorate_Atk:
attackanimation
waitanimation
setbyte STAT_ANIM_PLAYED 0x0
playstatchangeanimation BANK_TARGET, STAT_ANIM_ATK | STAT_ANIM_SPATK, STAT_ANIM_UP | STAT_ANIM_IGNORE_ABILITIES
setstatchanger STAT_ATK | INCREASE_2
statbuffchange STAT_TARGET | STAT_BS_PTR | STAT_CERTAIN Decorate_SpAtk
jumpifbyte EQUALS MULTISTRING_CHOOSER 0x2 CalmMind_SpDef
printfromtable 0x83FE57C
jumpifbyte EQUALS MULTISTRING_CHOOSER 0x2 Decorate_SpAtk
printfromtable gStatUpStringIds
waitmessage DELAY_1SECOND

Decorate_SpAtk:
setstatchanger STAT_SPATK | INCREASE_2
statbuffchange STAT_TARGET | STAT_BS_PTR | STAT_CERTAIN BS_MOVE_END
jumpifbyte EQUALS MULTISTRING_CHOOSER 0x2 BS_MOVE_END
printfromtable 0x83FE57C
printfromtable gStatUpStringIds
waitmessage DELAY_1SECOND
goto BS_MOVE_END

Expand Down
120 changes: 86 additions & 34 deletions assembly/data/attack_anim_table.s
Original file line number Diff line number Diff line change
Expand Up @@ -17370,10 +17370,17 @@ ANIM_CORROSIVE_GAS:

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
.pool
@Credits to Skeli
ANIM_COACHING:
goto 0x81cba5f @MOVE_HELPINGHAND
playsound2 0xA0 SOUND_PAN_ATTACKER
launchtask AnimTask_splash_down 0x2 0x2 bank_attacker 0x1
waitanimation
playsound2 0xA0 SOUND_PAN_TARGET
launchtask AnimTask_pal_fade_complex 0x2 0x6 PAL_DEF 0x1 0x2 0x0 0xA 0x1E5D @;Orange
launchtask AnimTask_splash_down 0x2 0x2 bank_target 0x1
waitanimation
endanimation

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
.pool
@Credits to greenphx9
Expand Down Expand Up @@ -17545,8 +17552,42 @@ ANIM_SCORCHING_SANDS:

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
.pool
@Credits to Skeli
ANIM_JUNGLE_HEALING:
goto 0x81d1d17
loadparticle ANIM_TAG_ROOTS
loadparticle ANIM_TAG_ORBS
loadparticle ANIM_TAG_SPARKLE_2
loadBG1 BG_SNUGGLE_FOREVER
waitbgfadeout
launchtemplate Template_IngrainRoot TEMPLATE_ATTACKER | 2, 0x5 0x10 0x1a 0xffff 0x2 0x96
playsound2 0x94 SOUND_PAN_ATTACKER
pause 0xa
launchtemplate Template_IngrainRoot TEMPLATE_ATTACKER | 2, 0x5 0xffe0 0x14 0x1 0x1 0x8c
playsound2 0x94 SOUND_PAN_ATTACKER
pause 0xa
launchtemplate Template_IngrainRoot TEMPLATE_ATTACKER | 2, 0x5 0x20 0x16 0x1 0x0 0x82
playsound2 0x94 SOUND_PAN_ATTACKER
pause 0xa
launchtemplate Template_IngrainRoot TEMPLATE_ATTACKER | 2, 0x5 0xfff0 0x19 0xffff 0x3 0x78
playsound2 0x94 SOUND_PAN_ATTACKER
pause 0x28
launchtemplate Template_IngrainOrb TEMPLATE_ATTACKER | 3, 0x5 0x20 0x1a 0xffff 0x3 0x1e
pause 0x5
playsound2 0x77 SOUND_PAN_ATTACKER
pause 0x5
launchtemplate Template_IngrainOrb TEMPLATE_ATTACKER | 3, 0x5 0xffd0 0x14 0x1 0x2 0x1e
playsound2 0x77 SOUND_PAN_ATTACKER
pause 0x5
playsound2 0x77 SOUND_PAN_ATTACKER
pause 0x5
launchtemplate Template_IngrainOrb TEMPLATE_ATTACKER | 3, 0x5 0x30 0x1a 0xfffe 0x3 0x12
playsound2 0x77 SOUND_PAN_ATTACKER
pause 0xa
playsound2 0xe8 0xc0
launchtask AnimTask_StatusClearedEffect 0x2 0x1 0x1
waitanimation
loaddefaultbg
waitbgfadein
endanimation

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Expand Down Expand Up @@ -18002,43 +18043,54 @@ ANIM_DIRE_CLAW:

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
.pool
@Credits to Skeli
ANIM_INFERNAL_PARADE:
loadparticle ANIM_TAG_SPARKLE_4
loadparticle ANIM_TAG_SMALL_EMBER
loadparticle ANIM_TAG_PURPLE_FLAME
launchtask AnimTask_BlendParticle 0x5 0x5 ANIM_TAG_SMALL_EMBER 0x2 0xA 0xA 0x7D3d @;Pinkish purple
call SET_PSYCHIC_BG
launchtask 0x80B3419 0x2 0x0
loadparticle ANIM_TAG_WISP_FIRE
pokespritetoBG bank_target
leftbankBG_over_partnerBG bank_target
soundcomplex 0x7b SOUND_PAN_ATTACKER 0x7 0xA
call FLAMETHROWER_FIRE
call FLAMETHROWER_FIRE
launchtask AnimTask_PurpleFlamesOnTarget 0x3 0x0
call FLAMETHROWER_FIRE
call FLAMETHROWER_FIRE
call FLAMETHROWER_FIRE
launchtask AnimTask_pal_fade_complex 0x2 0x6 PAL_DEF 0x2 0x2 0x0 0xc 0x43D
launchtask AnimTask_move_bank_2 0x2 0x5 bank_target 0x4 0x0 0x32 0x1
call FLAMETHROWER_FIRE
call FLAMETHROWER_FIRE
call FLAMETHROWER_FIRE
call FLAMETHROWER_FIRE
call FLAMETHROWER_FIRE
call FLAMETHROWER_FIRE
call FLAMETHROWER_FIRE
call FLAMETHROWER_FIRE
call FLAMETHROWER_FIRE
call FLAMETHROWER_FIRE
call FLAMETHROWER_FIRE
call FLAMETHROWER_FIRE
call FLAMETHROWER_FIRE
call FLAMETHROWER_FIRE
leftopponentbankBG_over_partnerBG bank_target
loadBG1 BG_GHOST
playsound2 0xb6 0xc0
waitbgfadein
launchtemplate INFERNAL_FIRE TEMPLATE_TARGET | 2, 0x3, -30, 10, 20 @;Bottom left
pause 0x3
launchtemplate INFERNAL_FIRE TEMPLATE_TARGET | 2, 0x3, 30, -30, -20 @;Top right
pause 0x3
launchtemplate INFERNAL_FIRE TEMPLATE_TARGET | 2, 0x3, 30, 10, 20 @;Bottom right
pause 0x3
launchtask AnimTask_move_bank 0x2 0x5 bank_target 0x0 0x3 0x32 0x1
call CREATE_INFERNAL_FLAMES
call CREATE_INFERNAL_FLAMES
call CREATE_INFERNAL_FLAMES
call CREATE_INFERNAL_FLAMES
playsound2 0x8a SOUND_PAN_TARGET
launchtemplate Template_WillOWispFire TEMPLATE_TARGET | 2, 0x1 0x0
launchtemplate Template_WillOWispFire TEMPLATE_TARGET | 2, 0x1 0x2a
launchtemplate Template_WillOWispFire TEMPLATE_TARGET | 2, 0x1 0x54
launchtemplate Template_WillOWispFire TEMPLATE_TARGET | 2, 0x1 0x7e
launchtemplate Template_WillOWispFire TEMPLATE_TARGET | 2, 0x1 0xa8
launchtemplate Template_WillOWispFire TEMPLATE_TARGET | 2, 0x1 0xd2
waitanimation
pokespritefromBG side_target
call UNSET_SCROLLING_BG
pause 0xC
loaddefaultbg
waitbgfadein
pokespritefrombg bank_target
endanimation

CREATE_INFERNAL_FLAMES:
launchtemplate INFERNAL_FIRE TEMPLATE_TARGET | 2, 0x3, -30, -30, -20 @;Top left
pause 0x3
launchtemplate INFERNAL_FIRE TEMPLATE_TARGET | 2, 0x3, -30, 10, 20 @;Bottom left
pause 0x3
launchtemplate INFERNAL_FIRE TEMPLATE_TARGET | 2, 0x3, 30, -30, -20 @;Top right
pause 0x3
launchtemplate INFERNAL_FIRE TEMPLATE_TARGET | 2, 0x3, 30, 10, 20 @;Bottom right
pause 0x3
return

.align 2
INFERNAL_FIRE: objtemplate ANIM_TAG_PURPLE_FLAME ANIM_TAG_PURPLE_FLAME OAM_DOUBLE_BLEND_16x32 0x83E76DC 0x0 gSpriteAffineAnimTable_Flutterby SpriteCB_MaxFlutterby

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
.pool
ANIM_CEASELESS_EDGE:
Expand Down
1 change: 1 addition & 0 deletions assembly/data/move_tables.s
Original file line number Diff line number Diff line change
Expand Up @@ -614,6 +614,7 @@ gSheerForceBoostedMoves:
.hword MOVE_SEEDFLARE
.hword MOVE_SHADOWBALL
.hword MOVE_SHADOWBONE
.hword MOVE_SHELLSIDEARM
.hword MOVE_SIGNALBEAM
.hword MOVE_SILVERWIND
.hword MOVE_SKITTERSMACK
Expand Down
15 changes: 15 additions & 0 deletions assembly/hooks/general_hooks.s
Original file line number Diff line number Diff line change
Expand Up @@ -1252,3 +1252,18 @@ AIXItemStringHook:
ldr r6, =0x81D99E4
ldr r0, =0x8016706 | 1
bx r0

.pool
@0x8137776 with r2
SummaryScreen_TradeMonMetLocationHook:
ldr r2, =GetMonData
bl bxr2
lsl r0, r0, #0x18
lsr r5, r0, #0x18
ldr r0, [r7]
add r0, r4 @Mon
mov r1, r5 @Met Location
bl TryReplaceSummaryScreenLocationWithFarAwayLocation
mov r5, r0
ldr r1, =0x8137780 | 1
bx r1
4 changes: 4 additions & 0 deletions battle_script_macros.s
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@
.equ BS_FLUSH_MESSAGE_BOX, 0x81D96A8
.equ BattleScript_AllStatsUp, 0x81D8D55

@String Tables
.equ gStatUpStringIds, 0x83FE57C
.equ gStatDownStringIds, 0x83FE588

@Banks
.equ BANK_TARGET, 0
.equ BANK_ATTACKER, 1
Expand Down
2 changes: 2 additions & 0 deletions hooks
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ BattleSetup_ConfigureTrainerBattle 8080228 1
SetTrainerFlags 80803FC 0
BattleSetup_StartTrainerBattle 8080464 0
SetUpTrainerEncounterMusic 8080628 0
GetLocationMusicNew 8055D6C 1
GetIntroSpeechOfApproachingTrainer 80806D8 0
GetTrainerCantBattleSpeech 8080734 0
DoPoisonFieldEffect 80A0618 0
Expand Down Expand Up @@ -416,6 +417,7 @@ FieldCB_RushInjuredPokemonToCenter 0807F5F0 0
## Summary Screen
CamomonsSummaryScreenHook 08136168 0
ChangeSummaryScreenMonSinglesDoubles 0813b20c 1
SummaryScreen_TradeMonMetLocationHook 08137776 2

## Hall of Fame Fix
CB2_DoHallOfFameScreen 080F1EFC 3
Expand Down
1 change: 1 addition & 0 deletions include/battle.h
Original file line number Diff line number Diff line change
Expand Up @@ -880,6 +880,7 @@ struct NewBattleStruct
u32 maxGoldrushMoney;
u16 itemBackup[PARTY_SIZE];
u8 hiddenHealthboxFlags[MAX_SPRITES / 8]; //~2017AD8
u8 shellSideArmSplit[MAX_BATTLERS_COUNT][MAX_BATTLERS_COUNT];

//Things for Spread Moves
s32 DamageTaken[MAX_BATTLERS_COUNT]; //~0x2017AC8
Expand Down
1 change: 1 addition & 0 deletions include/battle_controllers.h
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ struct ChooseMoveStruct
u8 moveResults[MAX_BATTLERS_COUNT][MAX_MON_MOVES];
u16 movePowers[MAX_MON_MOVES];
u16 moveAcc[MAX_MON_MOVES];
u8 moveSplit[MAX_MON_MOVES];
u8 monType3;
bool8 canMegaEvolve;
u8 megaVariance;
Expand Down
10 changes: 10 additions & 0 deletions include/constants/songs.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,19 @@
#define BGM_BATTLE_LEGENDARY_BIRDS 0x154
#define BGM_BATTLE_MEWTWO 0x155

#define BGM_BATTLE_RSE_E4 0x19D
#define BGM_BATTLE_SQUEETZ 0x1A0

#define BGM_VICTORY_WILD_POKE 0x137
#define BGM_VICTORY_GYM 0x138

#define BGM_POKEMONCENTER 0x12F
#define BGM_POKEMONCENTER_NIGHT 0x158
#define BGM_NETCENTER 0x148
#define BGM_POKEMART 0x1AE
#define BGM_POKEMART_NIGHT 0x15C
#define BGM_POKEMART_MORN 0x15E

#define BGM_RANDOM_BATTLE_MUSIC 0xFEFE

#define MUS_DUMMY 0
Expand Down
1 change: 1 addition & 0 deletions include/new/ability_battle_scripts.h
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ extern const u8 gText_ScreenCleanerActivate[];
extern const u8 gText_CuriousMedicineActivate[];
extern const u8 gText_NeutralizingGasActivate[];
extern const u8 gText_NeutralizingGasEnd[];
extern const u8 gText_CuriousMedicineActivate[];
extern const u8 ElectricTerrainSetString[];
extern const u8 GrassyTerrainSetString[];
extern const u8 MistyTerrainSetString[];
Expand Down
2 changes: 2 additions & 0 deletions include/new/battle_util.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ u8 ViableMonCountFromBank(u8 bank);
u8 ViableMonCountFromBankLoadPartyRange(u8 bank);
bool8 CheckContact(u16 move, u8 bank);
bool8 CheckContactByMon(u16 move, struct Pokemon* mon);
bool8 IsContactMove(u16 move, u8 bankAtk, u8 bankDef);
bool8 CheckHealingMove(u16 move);
bool8 CheckSoundMove(u16 move);
bool8 SheerForceCheck(void);
Expand Down Expand Up @@ -72,6 +73,7 @@ bool8 IsAffectedByPowderByDetails(u8 type1, u8 type2, u8 type3, u8 ability, u8 i
bool8 MoveIgnoresSubstitutes(u16 move, u8 atkAbility);
bool8 MoveBlockedBySubstitute(u16 move, u8 bankAtk, u8 bankDef);
bool8 MonMoveBlockedBySubstitute(u16 move, struct Pokemon* monAtk, u8 bankDef);
bool8 BypassesScreens(u8 ability);
bool8 IsMockBattle(void);
bool8 IsMoveAffectedByParentalBond(u16 move, u8 bankAtk);
u8 CalcMoveSplit(u8 bank, u16 move);
Expand Down
1 change: 1 addition & 0 deletions include/new/damage_calc.h
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ void PopulateDamageCalcStructWithBaseDefenderData(struct DamageCalc* data);
u16 CalcVisualBasePower(u8 bankAtk, u8 bankDef, u16 move, bool8 ignoreDef);
u16 TryGetAlternateSpeciesSize(u16 species, u8 type);
u8 CountAliveMonsInBattle(u8 caseId, u8 bankAtk, u8 bankDef);
void CalculateShellSideArmSplits(void);

u32 GetActualSpeciesWeight(u16 species, u8 ability, u8 itemEffect, u8 bank, bool8 checkNimble);
bool8 IsBankHoldingFocusSash(u8 bank);
Expand Down
1 change: 1 addition & 0 deletions include/new/overworld.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ void BattleSetup_StartTrainerBattle(void);
const u8* GetIntroSpeechOfApproachingTrainer(void);
const u8* GetTrainerCantBattleSpeech(void);
void SetUpTrainerEncounterMusic(void);
u16 GetLocationMusicNew(struct WarpData* warp);
void SetTrainerFlags(void);
bool8 TryStartStepCountScript(u16 metatileBehavior);
bool8 TryRunOnFrameMapScript(void);
Expand Down
Loading

0 comments on commit 7409b15

Please sign in to comment.