mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2024-11-16 19:47:35 +01:00
Requested changes
Various bug fixes, syntax corrections etc.
This commit is contained in:
parent
e2599c2469
commit
e637714e1b
@ -445,7 +445,7 @@ BattleScript_EffectClangorousSoul:
|
||||
attackstring
|
||||
ppreduce
|
||||
cutonethirdhpraisestats BattleScript_ButItFailed
|
||||
orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_IGNORE_DISGUISE
|
||||
orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_SKIP_DMG_TRACK | HITMARKER_PASSIVE_DAMAGE | HITMARKER_IGNORE_DISGUISE
|
||||
attackanimation
|
||||
waitanimation
|
||||
healthbarupdate BS_ATTACKER
|
||||
@ -471,8 +471,8 @@ BattleScript_OctolockEndTurn::
|
||||
jumpifstat BS_TARGET, CMP_GREATER_THAN, STAT_SPDEF, MIN_STAT_STAGE, BattleScript_OctolockTryLowerSpDef
|
||||
goto BattleScript_OctolockEnd2
|
||||
BattleScript_OctolockLowerDef:
|
||||
playstatchangeanimation BS_ATTACKER, BIT_DEF | BIT_SPDEF, STAT_CHANGE_NEGATIVE
|
||||
jumpifability BS_TARGET, ABILITY_BIG_PECKS, BattleScript_OctolockTryLowerSpDef
|
||||
playstatchangeanimation BS_ATTACKER, BIT_DEF | BIT_SPDEF, STAT_CHANGE_NEGATIVE | MOVE_EFFECT_AFFECTS_USER
|
||||
setstatchanger STAT_DEF, 1, TRUE
|
||||
statbuffchange STAT_BUFF_ALLOW_PTR, BattleScript_OctolockTryLowerSpDef
|
||||
jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, B_MSG_STAT_WONT_DECREASE, BattleScript_OctolockTryLowerSpDef
|
||||
@ -480,7 +480,7 @@ BattleScript_OctolockLowerDef:
|
||||
waitmessage B_WAIT_TIME_LONG
|
||||
BattleScript_OctolockTryLowerSpDef:
|
||||
jumpifstat BS_TARGET, CMP_GREATER_THAN, STAT_DEF, MIN_STAT_STAGE, BattleScript_OctolockSkipSpDefAnim
|
||||
playstatchangeanimation BS_ATTACKER, BIT_SPDEF, STAT_CHANGE_NEGATIVE
|
||||
playstatchangeanimation BS_ATTACKER, BIT_SPDEF, STAT_CHANGE_NEGATIVE | MOVE_EFFECT_AFFECTS_USER
|
||||
BattleScript_OctolockSkipSpDefAnim:
|
||||
setstatchanger STAT_SPDEF, 1, TRUE
|
||||
statbuffchange STAT_BUFF_ALLOW_PTR, BattleScript_OctolockEnd2
|
||||
|
@ -9201,13 +9201,11 @@ static void Cmd_various(void)
|
||||
case VARIOUS_CUT_1_3_HP_RAISE_STATS:
|
||||
{
|
||||
bool8 atLeastOneStatBoosted = FALSE;
|
||||
bool8 hasContrary = (GetBattlerAbility(gBattlerAttacker) == ABILITY_CONTRARY);
|
||||
u16 hpFraction = max(1, gBattleMons[gBattlerAttacker].maxHP / 3);
|
||||
|
||||
for (i = 1; i < NUM_STATS; i++)
|
||||
{
|
||||
if (!(gBattleMons[gBattlerAttacker].statStages[i] == MAX_STAT_STAGE
|
||||
|| (hasContrary && gBattleMons[gBattlerAttacker].statStages[i] == MIN_STAT_STAGE)))
|
||||
if (CompareStat(gBattlerAttacker, i, MAX_STAT_STAGE, CMP_LESS_THAN))
|
||||
{
|
||||
atLeastOneStatBoosted = TRUE;
|
||||
break;
|
||||
@ -9231,7 +9229,7 @@ static void Cmd_various(void)
|
||||
}
|
||||
else
|
||||
{
|
||||
gDisableStructs[gActiveBattler].octolock = 1;
|
||||
gDisableStructs[gActiveBattler].octolock = TRUE;
|
||||
gBattleMons[gActiveBattler].status2 |= STATUS2_ESCAPE_PREVENTION;
|
||||
gDisableStructs[gActiveBattler].battlerPreventingEscape = gBattlerAttacker;
|
||||
gBattlescriptCurrInstr += 7;
|
||||
@ -9252,11 +9250,13 @@ static void Cmd_various(void)
|
||||
return;
|
||||
case VARIOUS_TRY_NO_RETREAT:
|
||||
if (gDisableStructs[gActiveBattler].noRetreat)
|
||||
{
|
||||
gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 3);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!(gBattleMons[gActiveBattler].status2 & STATUS2_ESCAPE_PREVENTION))
|
||||
gDisableStructs[gActiveBattler].noRetreat = 1;
|
||||
gDisableStructs[gActiveBattler].noRetreat = TRUE;
|
||||
gBattlescriptCurrInstr += 7;
|
||||
}
|
||||
return;
|
||||
@ -9267,18 +9267,17 @@ static void Cmd_various(void)
|
||||
}
|
||||
else
|
||||
{
|
||||
gDisableStructs[gActiveBattler].tarShot = 1;
|
||||
gDisableStructs[gActiveBattler].tarShot = TRUE;
|
||||
gBattlescriptCurrInstr += 7;
|
||||
}
|
||||
return;
|
||||
case VARIOUS_CAN_TAR_SHOT_WORK:
|
||||
// Tar Shot will fail if it's already been used on the target and its speed can't be lowered further
|
||||
if (gDisableStructs[gActiveBattler].tarShot
|
||||
&& (gBattleMons[gActiveBattler].statStages[STAT_SPEED] == MIN_STAT_STAGE
|
||||
|| (gBattleMons[gActiveBattler].statStages[STAT_SPEED] == MAX_STAT_STAGE && GetBattlerAbility(gActiveBattler) == ABILITY_CONTRARY)))
|
||||
gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 3);
|
||||
else
|
||||
if (!gDisableStructs[gActiveBattler].tarShot
|
||||
&& CompareStat(gActiveBattler, STAT_SPEED, MAX_STAT_STAGE, CMP_LESS_THAN))
|
||||
gBattlescriptCurrInstr += 7;
|
||||
else
|
||||
gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 3);
|
||||
return;
|
||||
case VARIOUS_TRY_TO_APPLY_MIMICRY:
|
||||
{
|
||||
|
@ -8774,6 +8774,8 @@ static void MulByTypeEffectiveness(u16 *modifier, u16 move, u8 moveType, u8 batt
|
||||
mod = UQ_4_12(2.0);
|
||||
if (moveType == TYPE_GROUND && defType == TYPE_FLYING && IsBattlerGrounded(battlerDef) && mod == UQ_4_12(0.0))
|
||||
mod = UQ_4_12(1.0);
|
||||
if (moveType == TYPE_FIRE && gDisableStructs[battlerDef].tarShot)
|
||||
mod = UQ_4_12(2.0);
|
||||
|
||||
if (gProtectStructs[battlerDef].kingsShielded && gBattleMoves[move].effect != EFFECT_FEINT)
|
||||
mod = UQ_4_12(1.0);
|
||||
@ -8867,8 +8869,6 @@ u16 CalcTypeEffectivenessMultiplier(u16 move, u8 moveType, u8 battlerAtk, u8 bat
|
||||
modifier = CalcTypeEffectivenessMultiplierInternal(move, moveType, battlerAtk, battlerDef, recordAbilities, modifier);
|
||||
if (gBattleMoves[move].effect == EFFECT_TWO_TYPED_MOVE)
|
||||
modifier = CalcTypeEffectivenessMultiplierInternal(move, gBattleMoves[move].argument, battlerAtk, battlerDef, recordAbilities, modifier);
|
||||
else if (moveType == TYPE_FIRE && gDisableStructs[battlerDef].tarShot)
|
||||
modifier = CalcTypeEffectivenessMultiplierInternal(move, moveType, battlerAtk, battlerDef, recordAbilities, UQ_4_12(2.0));
|
||||
}
|
||||
|
||||
if (recordAbilities)
|
||||
|
Loading…
Reference in New Issue
Block a user