merge with be

This commit is contained in:
Evan 2020-12-14 09:09:51 -07:00
commit e70e2bcd65
19 changed files with 133 additions and 37 deletions

View File

@ -1755,6 +1755,10 @@
various \battler, VARIOUS_JUMP_IF_ABSENT
.4byte \ptr
.endm
.macro destroyabilitypopup
various BS_ABILITY_BATTLER, VARIOUS_DESTROY_ABILITY_POPUP
.endm
.macro setzeffect
various BS_ATTACKER, VARIOUS_SET_Z_EFFECT

View File

@ -3,6 +3,7 @@
#include "constants/rgb.h"
#include "constants/songs.h"
#include "constants/moves.h"
#include "constants/pokemon.h"
.include "asm/macros.inc"
.include "asm/macros/battle_anim_script.inc"
.include "constants/constants.inc"
@ -852,6 +853,7 @@ gBattleAnims_General::
.4byte General_IllusionOff
.4byte General_FormChange
.4byte General_SlideOffScreen
.4byte General_RestoreBg
.4byte General_ZMoveActivate
.align 2
@ -6782,10 +6784,10 @@ Move_SEARING_SHOT:
Move_TECHNO_BLAST:
launchtask AnimTask_TechnoBlast 0x5 0x0
jumpargeq 0x0, 10, TechnoBlastFire
jumpargeq 0x0, 11, TechnoBlastWater
jumpargeq 0x0, 13, TechnoBlastElectric
jumpargeq 0x0, 15, TechnoBlastIce
jumpargeq 0x0, TYPE_FIRE, TechnoBlastFire
jumpargeq 0x0, TYPE_WATER, TechnoBlastWater
jumpargeq 0x0, TYPE_ELECTRIC, TechnoBlastElectric
jumpargeq 0x0, TYPE_ICE, TechnoBlastIce
TechnoBlastNormal:
loadspritegfx ANIM_TAG_CIRCLE_OF_LIGHT @charge animation
loadspritegfx ANIM_TAG_ORBS @circles
@ -6921,7 +6923,7 @@ TechnoBlastElectric:
launchtemplate gTechnoBlastYellowSparkTemplate 0x84 0x7 0xa 0x0 0x10 0x1e 0x0 0x28 0x0
launchtemplate gTechnoBlastYellowSparkTemplate 0x84 0x7 0xa 0x0 0x10 0x1e 0x40 0x28 0x1
launchtemplate gTechnoBlastYellowSparkTemplate 0x84 0x7 0xa 0x0 0x10 0x1e 0x80 0x28 0x0
launchtemplate gTechnoBlastYellowSparkTemplate 0x84 0x7 0xa 0x0 0x10 0x1e SOUND_PAN_ATTACKER 0x28 0x2
launchtemplate gTechnoBlastYellowSparkTemplate 0x84 0x7 0xa 0x0 0x10 0x1e 0x0 0x28 0x2
launchtemplate gTechnoBlastYellowSparkTemplate 0x84 0x7 0xa 0x0 0x8 0x1e 0x20 0x28 0x0
launchtemplate gTechnoBlastYellowSparkTemplate 0x84 0x7 0xa 0x0 0x8 0x1e 0x60 0x28 0x1
launchtemplate gTechnoBlastYellowSparkTemplate 0x84 0x7 0xa 0x0 0x8 0x1e 0xa0 0x28 0x0
@ -6930,20 +6932,20 @@ TechnoBlastElectric:
playsewithpan SE_M_EMBER, SOUND_PAN_ATTACKER
launchtask AnimTask_ShakeMon2 0x2 0x5 0x1 0x4 0x0 0x5 0x1
launchtemplate gTechnoBlastYellowSmokeTemplate 0x82, 0x4, 0x8 0x8 0x1 0x0
launchtemplate gElectricitySpriteTemplate 0x82, 0x4, 0x5 0x0 0x5 0x0, ANIM_TARGET
launchtemplate gElectricitySpriteTemplate 0x82, 0x4, 0xfffb 0xa 0x5 0x1, ANIM_TARGET
launchtemplate gElectricitySpriteTemplate 0x82, 0x4, 0x5 0x0 0x5 0x0
launchtemplate gElectricitySpriteTemplate 0x82, 0x4, 0xfffb 0xa 0x5 0x1
delay 0x2
launchtemplate gTechnoBlastYellowSmokeTemplate 0x82, 0x4, 0xfff8 0xfff8 0x1 0x0
launchtemplate gElectricitySpriteTemplate 0x82, 0x4, 0xf 0x14 0x5 0x2, ANIM_TARGET
launchtemplate gElectricitySpriteTemplate 0x82, 0x4, 0xfff1 0xfff6 0x5 0x0, ANIM_TARGET
launchtemplate gElectricitySpriteTemplate 0x82, 0x4, 0xf 0x14 0x5 0x2
launchtemplate gElectricitySpriteTemplate 0x82, 0x4, 0xfff1 0xfff6 0x5 0x0
delay 0x2
launchtemplate gTechnoBlastYellowSmokeTemplate 0x82, 0x4, 0x8 0xfff8 0x1 0x0
launchtemplate gElectricitySpriteTemplate 0x82, 0x4, 0x19 0x0 0x5 0x1, ANIM_TARGET
launchtemplate gElectricitySpriteTemplate 0x82, 0x4, 0xfff8 0x8 0x5 0x2, ANIM_TARGET
launchtemplate gElectricitySpriteTemplate 0x82, 0x4, 0x19 0x0 0x5 0x1
launchtemplate gElectricitySpriteTemplate 0x82, 0x4, 0xfff8 0x8 0x5 0x2
delay 0x2
launchtemplate gTechnoBlastYellowSmokeTemplate 0x82, 0x4, 0xfff8 0x8 0x1 0x0
launchtemplate gElectricitySpriteTemplate 0x82, 0x4, 0x2 0xfff8 0x5 0x0, ANIM_TARGET
launchtemplate gElectricitySpriteTemplate 0x82, 0x4, 0xffec 0xf 0x5 0x1, ANIM_TARGET
launchtemplate gElectricitySpriteTemplate 0x82, 0x4, 0x2 0xfff8 0x5 0x0
launchtemplate gElectricitySpriteTemplate 0x82, 0x4, 0xffec 0xf 0x5 0x1
waitforvisualfinish
launchtask AnimTask_BlendBattleAnimPal 0xa 0x5 ANIM_PAL_BG 0x1 0xC 0x0 0x0
waitforvisualfinish
@ -7055,7 +7057,7 @@ TechnoBlastWater:
launchtemplate gTechnoBlastBlueSparkTemplate 0x84 0x7 0xa 0x0 0x10 0x1e 0x0 0x28 0x0
launchtemplate gTechnoBlastBlueSparkTemplate 0x84 0x7 0xa 0x0 0x10 0x1e 0x40 0x28 0x1
launchtemplate gTechnoBlastBlueSparkTemplate 0x84 0x7 0xa 0x0 0x10 0x1e 0x80 0x28 0x0
launchtemplate gTechnoBlastBlueSparkTemplate 0x84 0x7 0xa 0x0 0x10 0x1e SOUND_PAN_ATTACKER 0x28 0x2
launchtemplate gTechnoBlastBlueSparkTemplate 0x84 0x7 0xa 0x0 0x10 0x1e 0x0 0x28 0x2
launchtemplate gTechnoBlastBlueSparkTemplate 0x84 0x7 0xa 0x0 0x8 0x1e 0x20 0x28 0x0
launchtemplate gTechnoBlastBlueSparkTemplate 0x84 0x7 0xa 0x0 0x8 0x1e 0x60 0x28 0x1
launchtemplate gTechnoBlastBlueSparkTemplate 0x84 0x7 0xa 0x0 0x8 0x1e 0xa0 0x28 0x0
@ -7108,7 +7110,7 @@ TechnoBlastFire:
launchtemplate gTechnoBlastRedSparkTemplate 0x84 0x7 0xa 0x0 0x10 0x1e 0x0 0x28 0x0
launchtemplate gTechnoBlastRedSparkTemplate 0x84 0x7 0xa 0x0 0x10 0x1e 0x40 0x28 0x1
launchtemplate gTechnoBlastRedSparkTemplate 0x84 0x7 0xa 0x0 0x10 0x1e 0x80 0x28 0x0
launchtemplate gTechnoBlastRedSparkTemplate 0x84 0x7 0xa 0x0 0x10 0x1e SOUND_PAN_ATTACKER 0x28 0x2
launchtemplate gTechnoBlastRedSparkTemplate 0x84 0x7 0xa 0x0 0x10 0x1e 0x0 0x28 0x2
launchtemplate gTechnoBlastRedSparkTemplate 0x84 0x7 0xa 0x0 0x8 0x1e 0x20 0x28 0x0
launchtemplate gTechnoBlastRedSparkTemplate 0x84 0x7 0xa 0x0 0x8 0x1e 0x60 0x28 0x1
launchtemplate gTechnoBlastRedSparkTemplate 0x84 0x7 0xa 0x0 0x8 0x1e 0xa0 0x28 0x0
@ -7117,13 +7119,13 @@ TechnoBlastFire:
playsewithpan SE_M_EMBER, SOUND_PAN_ATTACKER
launchtask AnimTask_ShakeMon2 0x2 0x5 0x1 0x4 0x0 0x5 0x1
launchtemplate gTechnoBlastRedSmokeTemplate 0x82, 0x4, 0x8 0x8 0x1 0x0
launchtemplate gFireSpreadSpriteTemplate 0x81 0x5 0x0 0xa SOUND_PAN_ATTACKER 0xb0 0x28
launchtemplate gFireSpreadSpriteTemplate 0x81 0x5 0x0 0xa 0xff40 0xf0 0x28
launchtemplate gFireSpreadSpriteTemplate 0x81 0x5 0x0 0xa SOUND_PAN_ATTACKER 0xff60 0x28
launchtemplate gFireSpreadSpriteTemplate 0x81 0x5 0x0 0xa 0xff40 0xff90 0x28
launchtemplate gFireSpreadSpriteTemplate 0x81 0x5 0x0 0xa 0xa0 0x30 0x28
launchtemplate gFireSpreadSpriteTemplate 0x81 0x5 0x0 0xa 0xff20 0xffe0 0x28
launchtemplate gFireSpreadSpriteTemplate 0x81 0x5 0x0 0xa 0x70 0xff80 0x28
createsprite gFireSpreadSpriteTemplate, ANIM_TARGET, 1, 0, 10, 192, 176, 40
createsprite gFireSpreadSpriteTemplate, ANIM_TARGET, 1, 0, 10, -192, 240, 40
createsprite gFireSpreadSpriteTemplate, ANIM_TARGET, 1, 0, 10, 192, -160, 40
createsprite gFireSpreadSpriteTemplate, ANIM_TARGET, 1, 0, 10, -192, -112, 40
createsprite gFireSpreadSpriteTemplate, ANIM_TARGET, 1, 0, 10, 160, 48, 40
createsprite gFireSpreadSpriteTemplate, ANIM_TARGET, 1, 0, 10, -224, -32, 40
createsprite gFireSpreadSpriteTemplate, ANIM_TARGET, 1, 0, 10, 112, -128, 40
delay 0x2
launchtemplate gTechnoBlastRedSmokeTemplate 0x82, 0x4, 0xfff8 0xfff8 0x1 0x0
delay 0x2
@ -7192,7 +7194,7 @@ TechnoBlastIce:
launchtemplate gTechnoBlastIceSparkTemplate 0x84 0x7 0xa 0x0 0x10 0x1e 0x0 0x28 0x0
launchtemplate gTechnoBlastIceSparkTemplate 0x84 0x7 0xa 0x0 0x10 0x1e 0x40 0x28 0x1
launchtemplate gTechnoBlastIceSparkTemplate 0x84 0x7 0xa 0x0 0x10 0x1e 0x80 0x28 0x0
launchtemplate gTechnoBlastIceSparkTemplate 0x84 0x7 0xa 0x0 0x10 0x1e SOUND_PAN_ATTACKER 0x28 0x2
launchtemplate gTechnoBlastIceSparkTemplate 0x84 0x7 0xa 0x0 0x10 0x1e 0x0 0x28 0x2
launchtemplate gTechnoBlastIceSparkTemplate 0x84 0x7 0xa 0x0 0x8 0x1e 0x20 0x28 0x0
launchtemplate gTechnoBlastIceSparkTemplate 0x84 0x7 0xa 0x0 0x8 0x1e 0x60 0x28 0x1
launchtemplate gTechnoBlastIceSparkTemplate 0x84 0x7 0xa 0x0 0x8 0x1e 0xa0 0x28 0x0
@ -8491,6 +8493,8 @@ Move_GRASSY_TERRAIN::
delay 4
createvisualtask AnimTask_BlendBattleAnimPal, 10, ANIM_PAL_BG, 3, 4, 0, RGB(31, 24, 31)
waitforvisualfinish
restorebg
waitbgfadein
end
Move_MISTY_TERRAIN::
@ -8529,6 +8533,8 @@ Move_MISTY_TERRAIN::
delay 4
createvisualtask AnimTask_BlendBattleAnimPal, 10, ANIM_PAL_BG, 3, 7, 0, RGB(31, 24, 31)
waitforvisualfinish
restorebg
waitbgfadein
end
Move_ELECTRIFY::
@ -9412,6 +9418,8 @@ Move_ELECTRIC_TERRAIN::
delay 2
createvisualtask AnimTask_BlendBattleAnimPal, 10, ANIM_PAL_BG, 3, 4, 0, RGB(28, 28, 0)
waitforvisualfinish
restorebg
waitbgfadein
end
Move_DAZZLING_GLEAM::
@ -9489,6 +9497,7 @@ Move_BABY_DOLL_EYES::
loadspritegfx ANIM_TAG_PINK_CLOUD
loadspritegfx ANIM_TAG_OPENING_EYE @eye
setalpha 8, 8
monbg ANIM_DEF_PARTNER
launchtask AnimTask_BlendBattleAnimPal 0xa 0x5 ANIM_PAL_BG 0x0 0x0 0xA 0x7FFF
waitforvisualfinish
launchtemplate gOpeningEyeSpriteTemplate 0x5 0x4 0x0 0x0 0x1 0x0
@ -9501,6 +9510,7 @@ Move_BABY_DOLL_EYES::
launchtask AnimTask_ShakeMon2 0x2 0x5 0x3 0x1 0x0 0x9 0x1
launchtask AnimTask_BlendBattleAnimPal 0xa 0x5 ANIM_PAL_BG 0x0 0xA 0x0 0x7FFF
waitforvisualfinish
clearmonbg ANIM_DEF_PARTNER
blendoff
end
@ -11065,6 +11075,8 @@ Move_PSYCHIC_TERRAIN::
delay 4
createvisualtask AnimTask_BlendBattleAnimPal, 10, ANIM_PAL_BG, 3, 4, 0, RGB(27, 0, 13)
waitforvisualfinish
restorebg
waitbgfadein
end
Move_LUNGE::
@ -24358,6 +24370,11 @@ General_TerrainElectric:
General_TerrainPsychic:
end
General_RestoreBg:
restorebg
waitbgfadein
end
General_ZMoveActivate:
loadspritegfx ANIM_TAG_FOCUS_ENERGY @focus energy
loadspritegfx ANIM_TAG_Z_MOVE_SYMBOL @Z-Move Symbol
@ -30114,4 +30131,3 @@ SoulStealingSevenStarStrikeExplosion:
launchtemplate gSoulStealExplosionSpriteTemplate 0x83 0x4 0x10 0x10 ANIM_TARGET 0x1
delay 0x6
return

View File

@ -5426,21 +5426,25 @@ BattleScript_MagicRoomEnds::
BattleScript_ElectricTerrainEnds::
printstring STRINGID_ELECTRICTERRAINENDS
waitmessage 0x40
playanimation BS_ATTACKER, B_ANIM_RESTORE_BG, NULL
end2
BattleScript_MistyTerrainEnds::
printstring STRINGID_MISTYTERRAINENDS
waitmessage 0x40
playanimation BS_ATTACKER, B_ANIM_RESTORE_BG, NULL
end2
BattleScript_GrassyTerrainEnds::
printstring STRINGID_GRASSYTERRAINENDS
waitmessage 0x40
playanimation BS_ATTACKER, B_ANIM_RESTORE_BG, NULL
end2
BattleScript_PsychicTerrainEnds::
printstring STRINGID_PSYCHICTERRAINENDS
waitmessage 0x40
playanimation BS_ATTACKER, B_ANIM_RESTORE_BG, NULL
end2
BattleScript_MudSportEnds::

View File

@ -539,6 +539,7 @@ struct BattleStruct
u8 savedBattlerTarget;
bool8 ateBoost[MAX_BATTLERS_COUNT];
u8 activeAbilityPopUps; // as bits for each battler
u8 abilityPopUpSpriteIds[MAX_BATTLERS_COUNT][2]; // two per battler
bool8 throwingPokeBall;
struct MegaEvolutionData mega;
struct ZMoveData zmove;
@ -631,6 +632,7 @@ struct BattleScripting
u16 moveEffect;
u16 multihitMoveEffect;
u8 illusionNickHack; // To properly display nick in STRINGID_ENEMYABOUTTOSWITCHPKMN.
bool8 fixedPopup; // force ability popup to stick until manually called back
};
// rom_80A5C6C

View File

@ -68,6 +68,7 @@ s16 KeepPanInRange(s16 a, int oldPan);
s16 CalculatePanIncrement(s16 sourcePan, s16 targetPan, s16 incrementPan);
void sub_80A4720(u16 a, u16 *b, u32 c, u8 d);
void sub_80A477C(bool8);
void LoadMoveBg(u16 bgId);
// battle_intro.c
void SetAnimBgAttribute(u8 bgId, u8 attributeId, u8 value);

View File

@ -9,5 +9,6 @@ void LoadBattleTextboxAndBackground(void);
void InitLinkBattleVsScreen(u8 taskId);
void DrawBattleEntryBackground(void);
bool8 LoadChosenBattleElement(u8 caseId);
void DrawTerrainTypeBattleBackground(void);
#endif // GUARD_BATTLE_BG_H

View File

@ -94,6 +94,7 @@ s32 MoveBattleBar(u8 battler, u8 healthboxSpriteId, u8 whichBar, u8 arg3);
u8 GetScaledHPFraction(s16 hp, s16 maxhp, u8 scale);
u8 GetHPBarLevel(s16 hp, s16 maxhp);
void CreateAbilityPopUp(u8 battlerId, u32 ability, bool32 isDoubleBattle);
void DestroyAbilityPopUp(u8 battlerId);
void HideTriggerSprites(void);
#endif // GUARD_BATTLE_INTERFACE_H

View File

@ -234,6 +234,8 @@
#define STATUS_FIELD_ION_DELUGE 0x400
#define STATUS_FIELD_FAIRY_LOCK 0x800
#define STATUS_TERRAIN_ANY (STATUS_FIELD_GRASSY_TERRAIN | STATUS_FIELD_MISTY_TERRAIN | STATUS_FIELD_ELECTRIC_TERRAIN | STATUS_FIELD_PSYCHIC_TERRAIN)
// Flags describing move's result
#define MOVE_RESULT_MISSED (1 << 0)
#define MOVE_RESULT_SUPER_EFFECTIVE (1 << 1)

View File

@ -525,7 +525,8 @@
#define B_ANIM_ILLUSION_OFF 0x1C
#define B_ANIM_FORM_CHANGE 0x1D
#define B_ANIM_SLIDE_OFFSCREEN 0x1E // for Emergency Exit
#define B_ANIM_ZMOVE_ACTIVATE 0x1F
#define B_ANIM_RESTORE_BG 0x1F // for Terrain Endings
#define B_ANIM_ZMOVE_ACTIVATE 0x20
// special animations table
#define B_ANIM_LVL_UP 0x0

View File

@ -144,11 +144,13 @@
#define B_DISABLE_TURNS GEN_6 // Disable's turns. See Cmd_disablelastusedattack.
#define B_INCINERATE_GEMS GEN_6 // In Gen6+, Incinerate can destroy Gems.
#define B_MINIMIZE_DMG_ACC GEN_6 // In Gen6+, moves that causes double damage to minimized Pokémon will also skip accuracy checks.
#define B_PP_REDUCED_BY_SPITE GEN_6 // In Gen4+, Spite reduces the foe's last move's PP by 4, instead of 2 to 5.
#define B_CAN_SPITE_FAIL GEN_6 // In Gen4+, Spite can no longer fail if the foe's last move only has 1 remaining PP.
// Ability settings
#define B_ABILITY_WEATHER GEN_6 // In Gen5+, weather caused by abilities lasts the same amount of turns as induced from a move. Before, they lasted till the battle's end or weather change by a move.
#define B_GALE_WINGS GEN_6 // In Gen7+ requires full HP to trigger.
#define B_STANCE_CHANGE_FAIL GEN_7 // In Gen7+, Aegislash's form change does not happen, if the Pokémon cannot use a move, because of confusion, paralysis, etc. In gen6, the form change occurs despite not being able to move.
#define B_STANCE_CHANGE_FAIL GEN_7 // In Gen7+, Stance Change fails if the Pokémon is unable to use a move because of confusion, paralysis, etc. In Gen6, it doesn't.
#define B_GHOSTS_ESCAPE GEN_6 // In Gen6+, ghosts can escape even when blocked by abilities such as Shadow Tag.
#define B_MOODY_ACC_EVASION GEN_6 // In Gen8+, Moody CANNOT raise Accuray and Evasion any more.
#define B_FLASH_FIRE_FROZEN GEN_6 // In Gen5+, Flash Fire can trigger even when frozen, when it couldn't before.
@ -199,5 +201,6 @@
#define B_NEW_SURF_PARTICLE_PALETTE TRUE // If set to TRUE, it updates Surf's wave palette.
#define HIDE_HEALTHBOXES_DURING_ANIMS TRUE //if TRUE, hides healthboxes during move animations
#define B_TERRAIN_BG_CHANGE TRUE // If TRUE, terrain moves permanently change the default battle background until the effect fades.
#endif // GUARD_CONSTANTS_BATTLE_CONFIG_H

View File

@ -35,6 +35,7 @@
#define sMOVE_EFFECT gBattleScripting + 0x2E
#define sMULTIHIT_EFFECT gBattleScripting + 0x30
#define sILLUSION_NICK_HACK gBattleScripting + 0x32
#define sFIXED_ABILITY_POPUP gBattleScripting + 0x33
#define cMULTISTRING_CHOOSER gBattleCommunication + 5
@ -165,7 +166,8 @@
#define VARIOUS_SET_LAST_USED_ITEM 99
#define VARIOUS_PARALYZE_TYPE_IMMUNITY 100
#define VARIOUS_JUMP_IF_ABSENT 101
#define VARIOUS_SET_Z_EFFECT 102
#define VARIOUS_DESTROY_ABILITY_POPUP 102
#define VARIOUS_SET_Z_EFFECT 103
// Cmd_manipulatedamage
#define DMG_CHANGE_SIGN 0

View File

@ -88,7 +88,6 @@ static void Task_PanFromInitialToTarget(u8 taskId);
static void Task_LoopAndPlaySE(u8 taskId);
static void Task_WaitAndPlaySE(u8 taskId);
static void LoadDefaultBg(void);
static void LoadMoveBg(u16 bgId);
// ewram
EWRAM_DATA static const u8 *sBattleAnimScriptPtr = NULL;
@ -3177,7 +3176,7 @@ static void Task_FadeToBg(u8 taskId)
}
}
static void LoadMoveBg(u16 bgId)
void LoadMoveBg(u16 bgId)
{
if (IsContest())
{
@ -3205,6 +3204,10 @@ static void LoadDefaultBg(void)
{
if (IsContest())
LoadContestBgAfterMoveAnim();
#if B_TERRAIN_BG_CHANGE == TRUE
else if (gFieldStatuses & STATUS_TERRAIN_ANY)
DrawTerrainTypeBattleBackground();
#endif
else
DrawMainBattleBackground();
}

View File

@ -16,6 +16,7 @@
#include "battle_scripts.h"
#include "battle_controllers.h"
#include "constants/moves.h"
#include "constants/hold_effects.h"
//// function declarations
static void SpriteCB_SpriteToCentreOfSide(struct Sprite* sprite);
@ -7791,8 +7792,10 @@ void AnimTask_PurpleFlamesOnTarget(u8 taskId)
void AnimTask_TechnoBlast(u8 taskId)
{
//gBattleAnimArgs[0] = gItems[GetBattlerPartyData(gBattleAnimAttacker).item].holdEffectParam;
gBattleAnimArgs[0] = ItemId_GetHoldEffectParam(gBattleMons[gBattleAnimAttacker].item);
if (ItemId_GetHoldEffect(gBattleMons[gBattleAnimAttacker].item) == HOLD_EFFECT_DRIVE)
gBattleAnimArgs[0] = ItemId_GetSecondaryId(gBattleMons[gBattleAnimAttacker].item);
else
gBattleAnimArgs[0] = 0;
DestroyAnimVisualTask(taskId);
}

View File

@ -1,5 +1,6 @@
#include "global.h"
#include "battle.h"
#include "battle_anim.h"
#include "battle_bg.h"
#include "battle_main.h"
#include "battle_message.h"
@ -23,6 +24,7 @@
#include "constants/map_types.h"
#include "constants/songs.h"
#include "constants/trainers.h"
#include "constants/battle_anim.h"
struct BattleBackground
{
@ -863,7 +865,11 @@ void LoadBattleTextboxAndBackground(void)
CopyBgTilemapBufferToVram(0);
LoadCompressedPalette(gBattleTextboxPalette, 0, 0x40);
LoadBattleMenuWindowGfx();
DrawMainBattleBackground();
#if B_TERRAIN_BG_CHANGE == TRUE
DrawTerrainTypeBattleBackground();
#else
DrawMainBattleBackground();
#endif
}
static void DrawLinkBattleParticipantPokeballs(u8 taskId, u8 multiplayerId, u8 bgId, u8 destX, u8 destY)
@ -1413,3 +1419,26 @@ bool8 LoadChosenBattleElement(u8 caseId)
return ret;
}
void DrawTerrainTypeBattleBackground(void)
{
switch (gFieldStatuses & STATUS_TERRAIN_ANY)
{
case STATUS_FIELD_GRASSY_TERRAIN:
LoadMoveBg(BG_GRASSY_TERRAIN);
break;
case STATUS_FIELD_MISTY_TERRAIN:
LoadMoveBg(BG_MISTY_TERRAIN);
break;
case STATUS_FIELD_ELECTRIC_TERRAIN:
LoadMoveBg(BG_ELECTRIC_TERRAIN);
break;
case STATUS_FIELD_PSYCHIC_TERRAIN:
LoadMoveBg(BG_PSYCHIC_TERRAIN);
break;
default:
DrawMainBattleBackground();
break;
}
}

View File

@ -3069,6 +3069,9 @@ void CreateAbilityPopUp(u8 battlerId, u32 ability, bool32 isDoubleBattle)
gSprites[spriteId1].tRightToLeft = FALSE;
gSprites[spriteId2].tRightToLeft = FALSE;
}
gBattleStruct->abilityPopUpSpriteIds[gBattleAnimAttacker][0] = spriteId1;
gBattleStruct->abilityPopUpSpriteIds[gBattleAnimAttacker][1] = spriteId2;
taskId = CreateTask(Task_FreeAbilityPopUpGfx, 5);
gTasks[taskId].tSpriteId1 = spriteId1;
@ -3117,11 +3120,19 @@ static void SpriteCb_AbilityPopUp(struct Sprite *sprite)
}
else
{
sprite->tFrames--;
if (!gBattleScripting.fixedPopup)
sprite->tFrames--;
}
}
}
void DestroyAbilityPopUp(u8 battlerId)
{
gSprites[gBattleStruct->abilityPopUpSpriteIds[battlerId][0]].tFrames = 0;
gSprites[gBattleStruct->abilityPopUpSpriteIds[battlerId][1]].tFrames = 0;
gBattleScripting.fixedPopup = FALSE;
}
static void Task_FreeAbilityPopUpGfx(u8 taskId)
{
if (!gSprites[gTasks[taskId].tSpriteId1].inUse

View File

@ -3467,7 +3467,7 @@ void ExpandBattleTextBuffPlaceholders(const u8 *src, u8 *dst)
srcID += 2;
break;
case B_BUFF_ABILITY: // ability names
StringAppend(dst, gAbilityNames[src[srcID + 1]]);
StringAppend(dst, gAbilityNames[T1_READ_16(&src[srcID + 1])]);
srcID += 3;
break;
case B_BUFF_ITEM: // item name

View File

@ -6998,7 +6998,7 @@ static void HandleTerrainMove(u16 move)
}
else
{
gFieldStatuses &= ~(STATUS_FIELD_MISTY_TERRAIN | STATUS_FIELD_GRASSY_TERRAIN | STATUS_FIELD_ELECTRIC_TERRAIN | STATUS_FIELD_PSYCHIC_TERRAIN);
gFieldStatuses &= ~STATUS_TERRAIN_ANY;
gFieldStatuses |= statusFlag;
if (GetBattlerHoldEffect(gBattlerAttacker, TRUE) == HOLD_EFFECT_TERRAIN_EXTENDER)
*timer = 8;
@ -8346,6 +8346,9 @@ static void Cmd_various(void)
gBattlescriptCurrInstr += 7;
}
return;
case VARIOUS_DESTROY_ABILITY_POPUP:
DestroyAbilityPopUp(gActiveBattler);
break;
case VARIOUS_SET_Z_EFFECT:
SetZEffect(); //handles battle script jumping internally
return;
@ -10241,9 +10244,18 @@ static void Cmd_tryspiteppreduce(void)
break;
}
#if B_CAN_SPITE_FAIL <= GEN_3
if (i != MAX_MON_MOVES && gBattleMons[gBattlerTarget].pp[i] > 1)
#else
if (i != MAX_MON_MOVES && gBattleMons[gBattlerTarget].pp[i] != 0)
#endif
{
#if B_PP_REDUCED_BY_SPITE <= GEN_3
s32 ppToDeduct = (Random() & 3) + 2;
#else
s32 ppToDeduct = 4;
#endif
if (gBattleMons[gBattlerTarget].pp[i] < ppToDeduct)
ppToDeduct = gBattleMons[gBattlerTarget].pp[i];

View File

@ -45,7 +45,8 @@ void FreeBattleResources(void)
{
if (gBattleTypeFlags & BATTLE_TYPE_TRAINER_HILL)
FreeTrainerHillBattleStruct();
gFieldStatuses = 0;
if (gBattleResources != NULL)
{
FREE_AND_SET_NULL(gBattleStruct);

View File

@ -778,7 +778,7 @@ static const u8 sText_Sinister_Arrow_Raid[] = _("Sinister Arrow Raid");
static const u8 sText_Malicious_Moonsault[] = _("Malicious Moonsault");
static const u8 sText_Oceanic_Operetta[] = _("Oceanic Operetta");
static const u8 sText_Splintered_Stormshards[] = _("Splintered Stormshards");
static const u8 sText_Lets_Snuggle_Forever[] = _("Lets Snuggle Forever");
static const u8 sText_Lets_Snuggle_Forever[] = _("Let's Snuggle Forever");
static const u8 sText_Clangorous_Soulblaze[] = _("Clangorous Soulblaze");
static const u8 sText_Guardian_Of_Alola[] = _("Guardian Of Alola");
static const u8 sText_Searing_Sunraze_Smash[] = _("Searing Sunraze Smash");