Synchronoise and Smack Down

This commit is contained in:
DizzyEggg 2018-09-29 15:43:56 +02:00
parent 597299136f
commit ada76cbe4f
13 changed files with 100 additions and 9 deletions

View File

@ -1497,6 +1497,11 @@
.4byte \ptr
.endm
.macro jumpifcantusesynchronoise ptr
various BS_ATTACKER, VARIOUS_TRY_SYNCHRONOISE
.4byte \ptr
.endm
.macro trycopycat ptr
various BS_ATTACKER, VARIOUS_TRY_COPYCAT
.4byte \ptr

View File

@ -319,6 +319,59 @@ gBattleScriptsForMoveEffects:: @ 82D86A8
.4byte BattleScript_EffectCopycat
.4byte BattleScript_EffectDefog
.4byte BattleScript_EffectHitEnemyHealAlly
.4byte BattleScript_EffectSmackDown
.4byte BattleScript_EffectSynchronoise
BattleScript_EffectSynchronoise:
attackcanceler
attackstring
ppreduce
selectfirstvalidtarget
BattleScript_SynchronoiseLoop:
movevaluescleanup
jumpifcantusesynchronoise BattleScript_SynchronoiseNoEffect
accuracycheck BattleScript_SynchronoiseMissed, ACC_CURR_MOVE
critcalc
damagecalc
adjustdamage
attackanimation
waitanimation
effectivenesssound
hitanimation BS_TARGET
waitstate
healthbarupdate BS_TARGET
datahpupdate BS_TARGET
critmessage
waitmessage 0x40
resultmessage
waitmessage 0x40
printstring STRINGID_EMPTYSTRING3
waitmessage 0x1
tryfaintmon BS_TARGET, FALSE, NULL
BattleScript_SynchronoiseMoveTargetEnd:
setbyte sMOVEEND_STATE, 0x0
moveend 0x2, 0x10
jumpifnexttargetvalid BattleScript_SynchronoiseLoop
end
BattleScript_SynchronoiseMissed:
pause 0x20
resultmessage
waitmessage 0x40
goto BattleScript_SynchronoiseMoveTargetEnd
BattleScript_SynchronoiseNoEffect:
pause 0x20
printstring STRINGID_NOEFFECTONTARGET
waitmessage 0x40
goto BattleScript_SynchronoiseMoveTargetEnd
BattleScript_EffectSmackDown:
setmoveeffect MOVE_EFFECT_SMACK_DOWN
goto BattleScript_EffectHit
BattleScript_MoveEffectSmackDown::
printstring STRINGID_FELLSTRAIGHTDOWN
waitmessage 0x40
return
BattleScript_EffectHitEnemyHealAlly:
jumpiftargetally BattleScript_EffectHealPulse

View File

@ -278,5 +278,6 @@ extern const u8 BattleScript_EffectWithChance[];
extern const u8 BattleScript_MoveEffectClearSmog[];
extern const u8 BattleScript_ForceRandomSwitch[];
extern const u8 BattleScript_SideStatusWoreOffReturn[];
extern const u8 BattleScript_MoveEffectSmackDown[];
#endif // GUARD_BATTLE_SCRIPTS_H

View File

@ -91,5 +91,6 @@ s32 GetStealthHazardDamage(u8 hazardType, u8 battlerId);
u16 GetMegaEvolutionSpecies(u16 preEvoSpecies, u16 heldItemId);
bool32 CanMegaEvolve(u8 battlerId);
void UndoMegaEvolution(u8 monId);
bool32 DoBattlersShareType(u32 battler1, u32 battler2);
#endif // GUARD_BATTLE_UTIL_H

View File

@ -314,7 +314,7 @@
#define MOVE_EFFECT_RECOIL_50 0x39
#define MOVE_EFFECT_CLEAR_SMOG 0x3A
#define MOVE_EFFECT_SP_ATK_TWO_DOWN 0x3B
#define MOVE_EFFECT_NOTHING_3C 0x3C
#define MOVE_EFFECT_SMACK_DOWN 0x3C
#define MOVE_EFFECT_NOTHING_3D 0x3D
#define MOVE_EFFECT_NOTHING_3E 0x3E
#define MOVE_EFFECT_NOTHING_3F 0x3F

View File

@ -308,5 +308,7 @@
#define EFFECT_COPYCAT 302
#define EFFECT_DEFOG 303
#define EFFECT_HIT_ENEMY_HEAL_ALLY 304 // Pollen Puff
#define EFFECT_SMACK_DOWN 305
#define EFFECT_SYNCHRONOISE 306
#endif // GUARD_CONSTANTS_BATTLE_MOVE_EFFECTS_H

View File

@ -110,6 +110,7 @@
#define VARIOUS_ABILITY_POPUP 57
#define VARIOUS_DEFOG 58
#define VARIOUS_JUMP_IF_TARGET_ALLY 59
#define VARIOUS_TRY_SYNCHRONOISE 60
// atk80, dmg manipulation
#define ATK80_DMG_CHANGE_SIGN 0

View File

@ -507,6 +507,7 @@
#define STRINGID_DRASTICALLY 504
#define STRINGID_SEVERELY 505
#define STRINGID_INFESTATION 506
#define STRINGID_NOEFFECTONTARGET 507
#define BATTLESTRINGS_COUNT 519

View File

@ -3183,8 +3183,8 @@ static void SpriteCb_AbilityPopUp(struct Sprite *sprite)
{
if (sprite->tIsMain && ++sprite->tFrames == 4)
PlaySE(SE_SELECT);
if ((!sprite->tRightToLeft && (sprite->pos1.x -= 3) <= sprite->tOriginalX)
|| (sprite->tRightToLeft && (sprite->pos1.x += 3) >= sprite->tOriginalX)
if ((!sprite->tRightToLeft && (sprite->pos1.x -= 4) <= sprite->tOriginalX)
|| (sprite->tRightToLeft && (sprite->pos1.x += 4) >= sprite->tOriginalX)
)
{
sprite->pos1.x = sprite->tOriginalX;
@ -3196,8 +3196,8 @@ static void SpriteCb_AbilityPopUp(struct Sprite *sprite)
{
if (sprite->tFrames == 0)
{
if ((!sprite->tRightToLeft && (sprite->pos1.x += 3) >= sprite->tOriginalX + ABILITY_POP_UP_POS_X_SLIDE)
||(sprite->tRightToLeft && (sprite->pos1.x -= 3) <= sprite->tOriginalX - ABILITY_POP_UP_POS_X_SLIDE)
if ((!sprite->tRightToLeft && (sprite->pos1.x += 4) >= sprite->tOriginalX + ABILITY_POP_UP_POS_X_SLIDE)
||(sprite->tRightToLeft && (sprite->pos1.x -= 4) <= sprite->tOriginalX - ABILITY_POP_UP_POS_X_SLIDE)
)
{
gBattleStruct->activeAbilityPopUps &= ~(gBitTable[sprite->tBattlerId]);

View File

@ -648,6 +648,7 @@ static const u8 sText_MegaEvoEvolved[] = _("{B_ATK_NAME_WITH_PREFIX} has Mega\nE
static const u8 sText_drastically[] = _("drastically ");
static const u8 sText_severely[] = _("severely ");
static const u8 sText_Infestation[] = _("{B_DEF_NAME_WITH_PREFIX} has been afflicted\nwith an infestation by {B_ATK_NAME_WITH_PREFIX}!");
static const u8 sText_NoEffectOnTarget[] = _("It had no effect\non {B_DEF_NAME_WITH_PREFIX}!");
const u8 *const gBattleStringsTable[BATTLESTRINGS_COUNT] =
{
@ -1147,6 +1148,7 @@ const u8 *const gBattleStringsTable[BATTLESTRINGS_COUNT] =
sText_drastically,
sText_severely,
sText_Infestation,
sText_NoEffectOnTarget,
};
const u16 gTerrainStringIds[] =

View File

@ -2702,6 +2702,15 @@ void SetMoveEffect(bool8 primary, u8 certain)
gBattlescriptCurrInstr = BattleScript_MoveEffectClearSmog;
}
break;
case MOVE_EFFECT_SMACK_DOWN:
if (!IsBattlerGrounded(gBattlerTarget))
{
gStatuses3[gBattlerTarget] |= STATUS3_SMACKED_DOWN;
gStatuses3[gBattlerTarget] &= ~(STATUS3_MAGNET_RISE | STATUS3_TELEKINESIS | STATUS3_ON_AIR);
BattleScriptPush(gBattlescriptCurrInstr + 1);
gBattlescriptCurrInstr = BattleScript_MoveEffectSmackDown;
}
break;
}
}
}
@ -6844,6 +6853,12 @@ static void atk76_various(void)
else
gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 3);
return;
case VARIOUS_TRY_SYNCHRONOISE:
if (!DoBattlersShareType(gBattlerAttacker, gBattlerTarget))
gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 3);
else
gBattlescriptCurrInstr += 7;
return;
}
gBattlescriptCurrInstr += 3;

View File

@ -5670,3 +5670,13 @@ void UndoMegaEvolution(u8 monId)
CalculateMonStats(&gPlayerParty[monId]);
}
}
bool32 DoBattlersShareType(u32 battler1, u32 battler2)
{
if (gBattleMons[battler1].type1 == gBattleMons[battler2].type1 || gBattleMons[battler1].type1 == gBattleMons[battler2].type2)
return TRUE;
else if (gBattleMons[battler1].type2 == gBattleMons[battler2].type1 || gBattleMons[battler1].type2 == gBattleMons[battler2].type2)
return TRUE;
else
return FALSE;
}

View File

@ -5757,12 +5757,12 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] =
.split = SPLIT_STATUS,
},
{ // MOVE_SMACK_DOWN
.effect = EFFECT_PLACEHOLDER, // Needs a custom move effect
.effect = EFFECT_SMACK_DOWN,
.power = 50,
.type = TYPE_ROCK,
.accuracy = 100,
.pp = 15,
.secondaryEffectChance = 0,
.secondaryEffectChance = 100,
.target = MOVE_TARGET_SELECTED,
.priority = 0,
.flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED,
@ -5829,7 +5829,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] =
.split = SPLIT_PHYSICAL,
},
{ // MOVE_SYNCHRONOISE
.effect = EFFECT_PLACEHOLDER, // Needs a custom move effect
.effect = EFFECT_SYNCHRONOISE,
.power = 120,
.type = TYPE_PSYCHIC,
.accuracy = 100,
@ -7416,7 +7416,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] =
.split = SPLIT_PHYSICAL,
},
{ // MOVE_LIGHT_OF_RUIN
.effect = EFFECT_PLACEHOLDER, // Needs a custom move effect (same as HEAD_SMASH)
.effect = EFFECT_RECOIL_50,
.power = 140,
.type = TYPE_FAIRY,
.accuracy = 90,