diff --git a/asm/macros/battle_script.inc b/asm/macros/battle_script.inc index d6645f602..d5984c322 100644 --- a/asm/macros/battle_script.inc +++ b/asm/macros/battle_script.inc @@ -1566,6 +1566,10 @@ .macro trytrainerslidelastonmsg battler various \battler, VARIOUS_TRY_TRAINER_SLIDE_MSG_LAST_ON .endm + + .macro setauroraveil battler + various \battler, VARIOUS_SET_AURORA_VEIL + .endm @ helpful macros .macro setstatchanger stat, stages, down diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index 657cbf421..b00669846 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -331,6 +331,13 @@ gBattleScriptsForMoveEffects:: @ 82D86A8 .4byte BattleScript_EffectFlowerShield .4byte BattleScript_EffectHitPreventEscape .4byte BattleScript_EffectSpeedSwap + .4byte BattleScript_EffectDefenseUp2Hit + .4byte BattleScript_EffectRevelationDance + .4byte BattleScript_EffectAuroraVeil + +BattleScript_EffectDefenseUp2Hit: + setmoveeffect MOVE_EFFECT_DEF_PLUS_2 | MOVE_EFFECT_AFFECTS_USER + goto BattleScript_EffectHit BattleScript_EffectFlowerShield: attackcanceler @@ -1579,6 +1586,7 @@ BattleScript_EffectTwoTypedMove: BattleScript_EffectTechnoBlast: BattleScript_EffectJudgment: BattleScript_EffectFusionCombo: +BattleScript_EffectRevelationDance: jumpifnotmove MOVE_SURF, BattleScript_HitFromAtkCanceler jumpifnostatus3 BS_TARGET, STATUS3_UNDERWATER, BattleScript_HitFromAtkCanceler orword gHitMarker, HITMARKER_IGNORE_UNDERWATER @@ -2114,6 +2122,13 @@ BattleScript_ImmunityProtected:: BattleScript_EffectPayDay:: setmoveeffect MOVE_EFFECT_PAYDAY goto BattleScript_EffectHit + +BattleScript_EffectAuroraVeil: + attackcanceler + attackstring + ppreduce + setauroraveil BS_ATTACKER + goto BattleScript_PrintReflectLightScreenSafeguardString BattleScript_EffectLightScreen:: attackcanceler diff --git a/include/constants/battle_move_effects.h b/include/constants/battle_move_effects.h index 1524353d3..d8cf1e6ad 100644 --- a/include/constants/battle_move_effects.h +++ b/include/constants/battle_move_effects.h @@ -319,5 +319,8 @@ #define EFFECT_FLOWER_SHIELD 313 #define EFFECT_HIT_PREVENT_ESCAPE 314 #define EFFECT_SPEED_SWAP 315 +#define EFFECT_DEFENSE_UP2_HIT 316 +#define EFFECT_REVELATION_DANCE 317 +#define EFFECT_AURORA_VEIL 318 #endif // GUARD_CONSTANTS_BATTLE_MOVE_EFFECTS_H diff --git a/include/constants/battle_script_commands.h b/include/constants/battle_script_commands.h index 8d0117d67..1b9183cf4 100644 --- a/include/constants/battle_script_commands.h +++ b/include/constants/battle_script_commands.h @@ -123,6 +123,7 @@ #define VARIOUS_HANDLE_TRAINER_SLIDE_MSG 68 #define VARIOUS_TRY_TRAINER_SLIDE_MSG_FIRST_OFF 69 #define VARIOUS_TRY_TRAINER_SLIDE_MSG_LAST_ON 70 +#define VARIOUS_SET_AURORA_VEIL 71 // atk80, dmg manipulation #define ATK80_DMG_CHANGE_SIGN 0 diff --git a/src/battle_main.c b/src/battle_main.c index 3ffaad892..e0c7c3d1b 100644 --- a/src/battle_main.c +++ b/src/battle_main.c @@ -5422,6 +5422,13 @@ void SetTypeBeforeUsingMove(u16 move, u8 battlerAtk) { // TODO: } + else if (gBattleMoves[move].effect == EFFECT_REVELATION_DANCE) + { + if (gBattleMons[battlerAtk].type1 != TYPE_MYSTERY) + gBattleStruct->dynamicMoveType = gBattleMons[battlerAtk].type1 | 0x80; + else if (gBattleMons[battlerAtk].type2 != TYPE_MYSTERY) + gBattleStruct->dynamicMoveType = gBattleMons[battlerAtk].type2 | 0x80; + } attackerAbility = GetBattlerAbility(battlerAtk); GET_MOVE_TYPE(move, moveType); diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index d8bf50be1..cb95fb6fa 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -7109,6 +7109,27 @@ static void atk76_various(void) return; } break; + case VARIOUS_SET_AURORA_VEIL: + if (gSideStatuses[GET_BATTLER_SIDE(gActiveBattler)] & SIDE_STATUS_AURORA_VEIL) + { + gMoveResultFlags |= MOVE_RESULT_MISSED; + gBattleCommunication[MULTISTRING_CHOOSER] = 0; + } + else + { + gSideStatuses[GET_BATTLER_SIDE(gActiveBattler)] |= SIDE_STATUS_AURORA_VEIL; + if (GetBattlerHoldEffect(gActiveBattler, TRUE) == HOLD_EFFECT_LIGHT_CLAY) + gSideTimers[GET_BATTLER_SIDE(gActiveBattler)].auroraVeilTimer = 8; + else + gSideTimers[GET_BATTLER_SIDE(gActiveBattler)].auroraVeilTimer = 5; + gSideTimers[GET_BATTLER_SIDE(gActiveBattler)].auroraVeilBattlerId = gActiveBattler; + + if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE && CountAliveMonsInBattle(BATTLE_ALIVE_ATK_SIDE) == 2) + gBattleCommunication[MULTISTRING_CHOOSER] = 5; + else + gBattleCommunication[MULTISTRING_CHOOSER] = 5; + } + break; } gBattlescriptCurrInstr += 3; @@ -7331,7 +7352,10 @@ static void atk7E_setreflect(void) else { gSideStatuses[GET_BATTLER_SIDE(gBattlerAttacker)] |= SIDE_STATUS_REFLECT; - gSideTimers[GET_BATTLER_SIDE(gBattlerAttacker)].reflectTimer = 5; + if (GetBattlerHoldEffect(gBattlerAttacker, TRUE) == HOLD_EFFECT_LIGHT_CLAY) + gSideTimers[GET_BATTLER_SIDE(gBattlerAttacker)].reflectTimer = 8; + else + gSideTimers[GET_BATTLER_SIDE(gBattlerAttacker)].reflectTimer = 5; gSideTimers[GET_BATTLER_SIDE(gBattlerAttacker)].reflectBattlerId = gBattlerAttacker; if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE && CountAliveMonsInBattle(BATTLE_ALIVE_ATK_SIDE) == 2) @@ -8090,7 +8114,10 @@ static void atk92_setlightscreen(void) else { gSideStatuses[GET_BATTLER_SIDE(gBattlerAttacker)] |= SIDE_STATUS_LIGHTSCREEN; - gSideTimers[GET_BATTLER_SIDE(gBattlerAttacker)].lightscreenTimer = 5; + if (GetBattlerHoldEffect(gBattlerAttacker, TRUE) == HOLD_EFFECT_LIGHT_CLAY) + gSideTimers[GET_BATTLER_SIDE(gBattlerAttacker)].lightscreenTimer = 8; + else + gSideTimers[GET_BATTLER_SIDE(gBattlerAttacker)].lightscreenTimer = 5; gSideTimers[GET_BATTLER_SIDE(gBattlerAttacker)].lightscreenBattlerId = gBattlerAttacker; if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE && CountAliveMonsInBattle(BATTLE_ALIVE_ATK_SIDE) == 2) diff --git a/src/data/battle_moves.h b/src/data/battle_moves.h index 639e9c50b..936d2e76c 100644 --- a/src/data/battle_moves.h +++ b/src/data/battle_moves.h @@ -7106,7 +7106,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .split = SPLIT_STATUS, }, { // MOVE_DIAMOND_STORM - .effect = EFFECT_PLACEHOLDER, // Needs a custom move effect + .effect = EFFECT_DEFENSE_UP2_HIT, .power = 100, .type = TYPE_ROCK, .accuracy = 95, @@ -7383,7 +7383,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .argument = 75, // restores 75% HP instead of 50% HP }, { // MOVE_THOUSAND_ARROWS - .effect = EFFECT_PLACEHOLDER, // Needs a custom move effect + .effect = EFFECT_SMACK_DOWN, .power = 90, .type = TYPE_GROUND, .accuracy = 100, @@ -7455,7 +7455,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .split = SPLIT_PHYSICAL, }, { // MOVE_DRAGON_ASCENT - .effect = EFFECT_PLACEHOLDER, // Needs a custom move effect + .effect = EFFECT_CLOSE_COMBAT, .power = 120, .type = TYPE_FLYING, .accuracy = 100, @@ -7803,7 +7803,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .split = SPLIT_STATUS, }, { // MOVE_REVELATION_DANCE - .effect = EFFECT_PLACEHOLDER, + .effect = EFFECT_REVELATION_DANCE, .power = 90, .type = TYPE_NORMAL, .accuracy = 100, @@ -7812,7 +7812,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .target = MOVE_TARGET_SELECTED, .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, - .split = SPLIT_STATUS, + .split = SPLIT_SPECIAL, }, { // MOVE_CORE_ENFORCER .effect = EFFECT_PLACEHOLDER, @@ -7899,7 +7899,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .split = SPLIT_PHYSICAL, }, { // MOVE_AURORA_VEIL - .effect = EFFECT_PLACEHOLDER, + .effect = EFFECT_AURORA_VEIL, .power = 0, .type = TYPE_ICE, .accuracy = 0,