Fixed Make it Rain
To do: misc fixes here and there, maybe do Burn Up/Double Shock, Dragon Rage/SonicBoom...
This commit is contained in:
parent
77c722ea09
commit
417a02c95e
7 changed files with 53 additions and 56 deletions
|
@ -383,7 +383,6 @@ gBattleScriptsForMoveEffects::
|
||||||
.4byte BattleScript_EffectHit @ EFFECT_UNUSED_358
|
.4byte BattleScript_EffectHit @ EFFECT_UNUSED_358
|
||||||
.4byte BattleScript_EffectTakeHeart @ EFFECT_TAKE_HEART
|
.4byte BattleScript_EffectTakeHeart @ EFFECT_TAKE_HEART
|
||||||
.4byte BattleScript_EffectHit @ EFFECT_COLLISION_COURSE
|
.4byte BattleScript_EffectHit @ EFFECT_COLLISION_COURSE
|
||||||
.4byte BattleScript_EffectMakeItRain @ EFFECT_MAKE_IT_RAIN
|
|
||||||
.4byte BattleScript_EffectCorrosiveGas @ EFFECT_CORROSIVE_GAS
|
.4byte BattleScript_EffectCorrosiveGas @ EFFECT_CORROSIVE_GAS
|
||||||
.4byte BattleScript_EffectHit @ EFFECT_POPULATION_BOMB
|
.4byte BattleScript_EffectHit @ EFFECT_POPULATION_BOMB
|
||||||
.4byte BattleScript_EffectSaltCure @ EFFECT_SALT_CURE
|
.4byte BattleScript_EffectSaltCure @ EFFECT_SALT_CURE
|
||||||
|
@ -623,19 +622,6 @@ BattleScript_CorrosiveGasFail:
|
||||||
waitmessage B_WAIT_TIME_LONG
|
waitmessage B_WAIT_TIME_LONG
|
||||||
goto BattleScript_MoveEnd
|
goto BattleScript_MoveEnd
|
||||||
|
|
||||||
BattleScript_EffectMakeItRain:
|
|
||||||
jumpifbattletype BATTLE_TYPE_DOUBLE, BattleScript_MakeItRainDoubles
|
|
||||||
BattleScript_MakeItRainContinuous:
|
|
||||||
setmoveeffect MOVE_EFFECT_PAYDAY | MOVE_EFFECT_CERTAIN
|
|
||||||
call BattleScript_EffectHit_Ret
|
|
||||||
tryfaintmon BS_TARGET
|
|
||||||
setmoveeffect MOVE_EFFECT_SP_ATK_MINUS_1 | MOVE_EFFECT_AFFECTS_USER | MOVE_EFFECT_CERTAIN
|
|
||||||
seteffectprimary
|
|
||||||
goto BattleScript_MoveEnd
|
|
||||||
BattleScript_MakeItRainDoubles:
|
|
||||||
jumpifword CMP_NO_COMMON_BITS, gHitMarker, HITMARKER_NO_ATTACKSTRING | HITMARKER_NO_PPDEDUCT, BattleScript_NoMoveEffect
|
|
||||||
goto BattleScript_MakeItRainContinuous
|
|
||||||
|
|
||||||
BattleScript_EffectTakeHeart::
|
BattleScript_EffectTakeHeart::
|
||||||
attackcanceler
|
attackcanceler
|
||||||
attackstring
|
attackstring
|
||||||
|
|
|
@ -362,17 +362,16 @@
|
||||||
#define EFFECT_UNUSED_358 358
|
#define EFFECT_UNUSED_358 358
|
||||||
#define EFFECT_TAKE_HEART 359
|
#define EFFECT_TAKE_HEART 359
|
||||||
#define EFFECT_COLLISION_COURSE 360
|
#define EFFECT_COLLISION_COURSE 360
|
||||||
#define EFFECT_MAKE_IT_RAIN 361
|
#define EFFECT_CORROSIVE_GAS 361
|
||||||
#define EFFECT_CORROSIVE_GAS 362
|
#define EFFECT_POPULATION_BOMB 362
|
||||||
#define EFFECT_POPULATION_BOMB 363
|
#define EFFECT_SALT_CURE 363
|
||||||
#define EFFECT_SALT_CURE 364
|
#define EFFECT_CHILLY_RECEPTION 364
|
||||||
#define EFFECT_CHILLY_RECEPTION 365
|
#define EFFECT_MAX_MOVE 365
|
||||||
#define EFFECT_MAX_MOVE 366
|
#define EFFECT_GLAIVE_RUSH 366
|
||||||
#define EFFECT_GLAIVE_RUSH 367
|
#define EFFECT_RAGING_BULL 367
|
||||||
#define EFFECT_RAGING_BULL 368
|
#define EFFECT_RAGE_FIST 368
|
||||||
#define EFFECT_RAGE_FIST 369
|
#define EFFECT_DOODLE 369
|
||||||
#define EFFECT_DOODLE 370
|
|
||||||
|
|
||||||
#define NUM_BATTLE_MOVE_EFFECTS 371
|
#define NUM_BATTLE_MOVE_EFFECTS 370
|
||||||
|
|
||||||
#endif // GUARD_CONSTANTS_BATTLE_MOVE_EFFECTS_H
|
#endif // GUARD_CONSTANTS_BATTLE_MOVE_EFFECTS_H
|
||||||
|
|
|
@ -4216,10 +4216,6 @@ static s32 AI_CheckViability(u32 battlerAtk, u32 battlerDef, u32 move, s32 score
|
||||||
else
|
else
|
||||||
ADJUST_SCORE(1);
|
ADJUST_SCORE(1);
|
||||||
break;
|
break;
|
||||||
case EFFECT_MAKE_IT_RAIN:
|
|
||||||
if (aiData->abilities[battlerAtk] == ABILITY_CONTRARY)
|
|
||||||
ADJUST_SCORE(3);
|
|
||||||
break;
|
|
||||||
case EFFECT_MAGIC_COAT:
|
case EFFECT_MAGIC_COAT:
|
||||||
if (IS_MOVE_STATUS(predictedMove) && AI_GetBattlerMoveTargetType(battlerDef, predictedMove) & (MOVE_TARGET_SELECTED | MOVE_TARGET_OPPONENTS_FIELD | MOVE_TARGET_BOTH))
|
if (IS_MOVE_STATUS(predictedMove) && AI_GetBattlerMoveTargetType(battlerDef, predictedMove) & (MOVE_TARGET_SELECTED | MOVE_TARGET_OPPONENTS_FIELD | MOVE_TARGET_BOTH))
|
||||||
ADJUST_SCORE(3);
|
ADJUST_SCORE(3);
|
||||||
|
|
|
@ -960,7 +960,6 @@ static bool32 AI_IsMoveEffectInMinus(u32 battlerAtk, u32 battlerDef, u32 move, s
|
||||||
|
|
||||||
switch (gBattleMoves[move].effect)
|
switch (gBattleMoves[move].effect)
|
||||||
{
|
{
|
||||||
case EFFECT_MAKE_IT_RAIN:
|
|
||||||
case EFFECT_MIND_BLOWN:
|
case EFFECT_MIND_BLOWN:
|
||||||
case EFFECT_STEEL_BEAM:
|
case EFFECT_STEEL_BEAM:
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
|
@ -355,6 +355,7 @@ void ApplyExperienceMultipliers(s32 *expAmount, u8 expGetterMonId, u8 faintedBat
|
||||||
static void RemoveAllTerrains(void);
|
static void RemoveAllTerrains(void);
|
||||||
static bool8 CanAbilityPreventStatLoss(u16 abilityDef, bool8 isIntimidate);
|
static bool8 CanAbilityPreventStatLoss(u16 abilityDef, bool8 isIntimidate);
|
||||||
static bool8 CanBurnHitThaw(u16 move);
|
static bool8 CanBurnHitThaw(u16 move);
|
||||||
|
static u32 GetNextTarget(u32 moveTarget, bool32 excludeCurrent);
|
||||||
|
|
||||||
static void Cmd_attackcanceler(void);
|
static void Cmd_attackcanceler(void);
|
||||||
static void Cmd_accuracycheck(void);
|
static void Cmd_accuracycheck(void);
|
||||||
|
@ -3192,9 +3193,16 @@ void SetMoveEffect(bool32 primary, u32 certain)
|
||||||
if (payday > gPaydayMoney)
|
if (payday > gPaydayMoney)
|
||||||
gPaydayMoney = 0xFFFF;
|
gPaydayMoney = 0xFFFF;
|
||||||
|
|
||||||
|
// For a move that hits multiple targets (i.e. Make it Rain)
|
||||||
|
// we only want to print the message on the final hit
|
||||||
|
if (GetNextTarget(gBattleMoves[gCurrentMove].target, TRUE) == MAX_BATTLERS_COUNT)
|
||||||
|
{
|
||||||
BattleScriptPush(gBattlescriptCurrInstr + 1);
|
BattleScriptPush(gBattlescriptCurrInstr + 1);
|
||||||
gBattlescriptCurrInstr = BattleScript_MoveEffectPayDay;
|
gBattlescriptCurrInstr = BattleScript_MoveEffectPayDay;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
gBattlescriptCurrInstr++;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
gBattlescriptCurrInstr++;
|
gBattlescriptCurrInstr++;
|
||||||
|
@ -3718,12 +3726,17 @@ static void Cmd_seteffectwithchance(void)
|
||||||
gBattleScripting.moveEffect = 0;
|
gBattleScripting.moveEffect = 0;
|
||||||
}
|
}
|
||||||
else if (gBattleMoves[gCurrentMove].numAdditionalEffects > gBattleStruct->additionalEffectsCounter)
|
else if (gBattleMoves[gCurrentMove].numAdditionalEffects > gBattleStruct->additionalEffectsCounter)
|
||||||
|
{
|
||||||
|
const u8 *currentPtr = gBattlescriptCurrInstr;
|
||||||
|
// self-targeting move effects cannot occur multiple times per turn
|
||||||
|
// only occur on the last setmoveeffect when there are multiple targets
|
||||||
|
if (!(gBattleMoves[gCurrentMove].additionalEffects[gBattleStruct->additionalEffectsCounter].self
|
||||||
|
&& GetNextTarget(gBattleMoves[gCurrentMove].target, TRUE) != MAX_BATTLERS_COUNT))
|
||||||
{
|
{
|
||||||
u32 percentChance = CalcSecondaryEffectChance(
|
u32 percentChance = CalcSecondaryEffectChance(
|
||||||
gBattlerAttacker,
|
gBattlerAttacker,
|
||||||
&gBattleMoves[gCurrentMove].additionalEffects[gBattleStruct->additionalEffectsCounter]
|
&gBattleMoves[gCurrentMove].additionalEffects[gBattleStruct->additionalEffectsCounter]
|
||||||
);
|
);
|
||||||
const u8 *currentPtr = gBattlescriptCurrInstr;
|
|
||||||
|
|
||||||
// Activate effect if it's primary (chance == 0) or if RNGesus says so
|
// Activate effect if it's primary (chance == 0) or if RNGesus says so
|
||||||
if ((percentChance == 0) || RandomPercentage(RNG_SECONDARY_EFFECT + gBattleStruct->additionalEffectsCounter, percentChance))
|
if ((percentChance == 0) || RandomPercentage(RNG_SECONDARY_EFFECT + gBattleStruct->additionalEffectsCounter, percentChance))
|
||||||
|
@ -3736,19 +3749,18 @@ static void Cmd_seteffectwithchance(void)
|
||||||
MOVE_EFFECT_CERTAIN * (percentChance >= 100) // certain to happen
|
MOVE_EFFECT_CERTAIN * (percentChance >= 100) // certain to happen
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Move script along if we haven't jumped elsewhere
|
// Move script along if we haven't jumped elsewhere
|
||||||
if (gBattlescriptCurrInstr == currentPtr)
|
if (gBattlescriptCurrInstr == currentPtr)
|
||||||
gBattlescriptCurrInstr = cmd->nextInstr;
|
gBattlescriptCurrInstr = cmd->nextInstr;
|
||||||
|
|
||||||
// Call seteffectwithchance again in the case of a move with multiple effects
|
// Call seteffectwithchance again in the case of a move with multiple effects
|
||||||
if (gBattleMoves[gCurrentMove].numAdditionalEffects - 1 > gBattleStruct->additionalEffectsCounter)
|
|
||||||
{
|
|
||||||
gBattleStruct->additionalEffectsCounter++;
|
gBattleStruct->additionalEffectsCounter++;
|
||||||
|
if (gBattleMoves[gCurrentMove].numAdditionalEffects > gBattleStruct->additionalEffectsCounter)
|
||||||
gBattleScripting.moveEffect = MOVE_EFFECT_CONTINUE;
|
gBattleScripting.moveEffect = MOVE_EFFECT_CONTINUE;
|
||||||
}
|
|
||||||
else
|
else
|
||||||
gBattleScripting.moveEffect = 0;
|
gBattleScripting.moveEffect = gBattleStruct->additionalEffectsCounter = 0;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -5230,12 +5242,13 @@ static bool32 TryKnockOffBattleScript(u32 battlerDef)
|
||||||
&& gBattleMons[battler].hp != 0 \
|
&& gBattleMons[battler].hp != 0 \
|
||||||
&& gBattleMons[ally].hp != 0
|
&& gBattleMons[ally].hp != 0
|
||||||
|
|
||||||
static u32 GetNextTarget(u32 moveTarget)
|
static u32 GetNextTarget(u32 moveTarget, bool32 excludeCurrent)
|
||||||
{
|
{
|
||||||
u32 i;
|
u32 i;
|
||||||
for (i = 0; i < MAX_BATTLERS_COUNT; i++)
|
for (i = 0; i < MAX_BATTLERS_COUNT; i++)
|
||||||
{
|
{
|
||||||
if (i != gBattlerAttacker
|
if (i != gBattlerAttacker
|
||||||
|
&& !(excludeCurrent && i == gBattlerTarget)
|
||||||
&& IsBattlerAlive(i)
|
&& IsBattlerAlive(i)
|
||||||
&& !(gBattleStruct->targetsDone[gBattlerAttacker] & gBitTable[i])
|
&& !(gBattleStruct->targetsDone[gBattlerAttacker] & gBitTable[i])
|
||||||
&& (GetBattlerSide(i) != GetBattlerSide(gBattlerAttacker) || moveTarget == MOVE_TARGET_FOES_AND_ALLY))
|
&& (GetBattlerSide(i) != GetBattlerSide(gBattlerAttacker) || moveTarget == MOVE_TARGET_FOES_AND_ALLY))
|
||||||
|
@ -5769,7 +5782,7 @@ static void Cmd_moveend(void)
|
||||||
|| moveTarget == MOVE_TARGET_FOES_AND_ALLY)
|
|| moveTarget == MOVE_TARGET_FOES_AND_ALLY)
|
||||||
&& !(gHitMarker & HITMARKER_NO_ATTACKSTRING))
|
&& !(gHitMarker & HITMARKER_NO_ATTACKSTRING))
|
||||||
{
|
{
|
||||||
u32 nextTarget = GetNextTarget(moveTarget);
|
u32 nextTarget = GetNextTarget(moveTarget, FALSE);
|
||||||
gHitMarker |= HITMARKER_NO_PPDEDUCT;
|
gHitMarker |= HITMARKER_NO_PPDEDUCT;
|
||||||
|
|
||||||
if (nextTarget != MAX_BATTLERS_COUNT)
|
if (nextTarget != MAX_BATTLERS_COUNT)
|
||||||
|
@ -5790,7 +5803,7 @@ static void Cmd_moveend(void)
|
||||||
gBattleStruct->targetsDone[gBattlerAttacker] |= gBitTable[originalBounceTarget];
|
gBattleStruct->targetsDone[gBattlerAttacker] |= gBitTable[originalBounceTarget];
|
||||||
gBattleStruct->targetsDone[originalBounceTarget] = 0;
|
gBattleStruct->targetsDone[originalBounceTarget] = 0;
|
||||||
|
|
||||||
nextTarget = GetNextTarget(moveTarget);
|
nextTarget = GetNextTarget(moveTarget, FALSE);
|
||||||
if (nextTarget != MAX_BATTLERS_COUNT)
|
if (nextTarget != MAX_BATTLERS_COUNT)
|
||||||
{
|
{
|
||||||
// We found another target for the original move user.
|
// We found another target for the original move user.
|
||||||
|
|
|
@ -13167,7 +13167,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_DYNAMAX] =
|
||||||
|
|
||||||
[MOVE_MAKE_IT_RAIN] =
|
[MOVE_MAKE_IT_RAIN] =
|
||||||
{
|
{
|
||||||
.effect = EFFECT_MAKE_IT_RAIN,
|
.effect = EFFECT_HIT,
|
||||||
.power = 120,
|
.power = 120,
|
||||||
.type = TYPE_STEEL,
|
.type = TYPE_STEEL,
|
||||||
.accuracy = 100,
|
.accuracy = 100,
|
||||||
|
@ -13176,7 +13176,10 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_DYNAMAX] =
|
||||||
.priority = 0,
|
.priority = 0,
|
||||||
.category = BATTLE_CATEGORY_SPECIAL,
|
.category = BATTLE_CATEGORY_SPECIAL,
|
||||||
.metronomeBanned = TRUE,
|
.metronomeBanned = TRUE,
|
||||||
// additional effects handled in script due to weird behaviour in doubles
|
ADDITIONAL_EFFECTS(
|
||||||
|
PRIMARY_EFFECT(MOVE_EFFECT_PAYDAY),
|
||||||
|
PRIMARY_EFFECT_SELF(MOVE_EFFECT_SP_ATK_MINUS_1)
|
||||||
|
),
|
||||||
},
|
},
|
||||||
|
|
||||||
[MOVE_RUINATION] =
|
[MOVE_RUINATION] =
|
||||||
|
|
|
@ -3,7 +3,8 @@
|
||||||
|
|
||||||
ASSUMPTIONS
|
ASSUMPTIONS
|
||||||
{
|
{
|
||||||
ASSUME(gBattleMoves[MOVE_MAKE_IT_RAIN].effect == EFFECT_MAKE_IT_RAIN);
|
ASSUME(MoveHasMoveEffect(MOVE_MAKE_IT_RAIN, MOVE_EFFECT_PAYDAY, FALSE));
|
||||||
|
ASSUME(MoveHasMoveEffectSelf(MOVE_MAKE_IT_RAIN, MOVE_EFFECT_SP_ATK_MINUS_1));
|
||||||
}
|
}
|
||||||
|
|
||||||
SINGLE_BATTLE_TEST("Make It Rain lowers special attack by one stage")
|
SINGLE_BATTLE_TEST("Make It Rain lowers special attack by one stage")
|
||||||
|
|
Loading…
Reference in a new issue