mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2024-12-27 20:24:18 +01:00
Topsy Turvy and Ion Deluge.
This commit is contained in:
parent
222ea7269d
commit
2218949d7c
@ -1440,6 +1440,10 @@
|
|||||||
.4byte \ptr
|
.4byte \ptr
|
||||||
.endm
|
.endm
|
||||||
|
|
||||||
|
.macro invertstatstages battler
|
||||||
|
various \battler, VARIOUS_INVERT_STAT_STAGES
|
||||||
|
.endm
|
||||||
|
|
||||||
@ helpful macros
|
@ helpful macros
|
||||||
.macro setstatchanger stat, stages, down
|
.macro setstatchanger stat, stages, down
|
||||||
setbyte sSTATCHANGER \stat | \stages << 4 | \down << 7
|
setbyte sSTATCHANGER \stat | \stages << 4 | \down << 7
|
||||||
|
@ -279,6 +279,41 @@ gBattleScriptsForMoveEffects:: @ 82D86A8
|
|||||||
.4byte BattleScript_EffectEntrainment
|
.4byte BattleScript_EffectEntrainment
|
||||||
.4byte BattleScript_EffectHealPulse
|
.4byte BattleScript_EffectHealPulse
|
||||||
.4byte BattleScript_EffectQuash
|
.4byte BattleScript_EffectQuash
|
||||||
|
.4byte BattleScript_EffectIonDeluge
|
||||||
|
.4byte BattleScript_EffectFreezeDry
|
||||||
|
.4byte BattleScript_EffectTopsyTurvy
|
||||||
|
|
||||||
|
BattleScript_EffectTopsyTurvy:
|
||||||
|
attackcanceler
|
||||||
|
attackstring
|
||||||
|
ppreduce
|
||||||
|
accuracycheck BattleScript_ButItFailed, NO_ACC_CALC_CHECK_LOCK_ON
|
||||||
|
jumpifstat BS_TARGET, CMP_NOT_EQUAL, STAT_ATK, 6, BattleScript_EffectTopsyTurvyWorks
|
||||||
|
jumpifstat BS_TARGET, CMP_NOT_EQUAL, STAT_DEF, 6, BattleScript_EffectTopsyTurvyWorks
|
||||||
|
jumpifstat BS_TARGET, CMP_NOT_EQUAL, STAT_SPATK, 6, BattleScript_EffectTopsyTurvyWorks
|
||||||
|
jumpifstat BS_TARGET, CMP_NOT_EQUAL, STAT_SPDEF, 6, BattleScript_EffectTopsyTurvyWorks
|
||||||
|
jumpifstat BS_TARGET, CMP_NOT_EQUAL, STAT_SPEED, 6, BattleScript_EffectTopsyTurvyWorks
|
||||||
|
jumpifstat BS_TARGET, CMP_NOT_EQUAL, STAT_ACC, 6, BattleScript_EffectTopsyTurvyWorks
|
||||||
|
jumpifstat BS_TARGET, CMP_EQUAL, STAT_EVASION, 6, BattleScript_ButItFailed
|
||||||
|
BattleScript_EffectTopsyTurvyWorks:
|
||||||
|
attackanimation
|
||||||
|
waitanimation
|
||||||
|
invertstatstages BS_TARGET
|
||||||
|
printstring STRINGID_TOPSYTURVYSWITCHEDSTATS
|
||||||
|
waitmessage 0x40
|
||||||
|
goto BattleScript_MoveEnd
|
||||||
|
|
||||||
|
BattleScript_EffectIonDeluge:
|
||||||
|
attackcanceler
|
||||||
|
accuracycheck BattleScript_PrintMoveMissed, ACC_CURR_MOVE
|
||||||
|
attackstring
|
||||||
|
ppreduce
|
||||||
|
orword gFieldStatuses, STATUS_FIELD_ION_DELUGE
|
||||||
|
attackanimation
|
||||||
|
waitanimation
|
||||||
|
printstring STRINGID_IONDELUGEON
|
||||||
|
waitmessage 0x40
|
||||||
|
goto BattleScript_MoveEnd
|
||||||
|
|
||||||
BattleScript_EffectQuash:
|
BattleScript_EffectQuash:
|
||||||
attackcanceler
|
attackcanceler
|
||||||
@ -740,6 +775,7 @@ BattleScript_EffectFoulPlay:
|
|||||||
BattleScript_EffectPsyshock:
|
BattleScript_EffectPsyshock:
|
||||||
BattleScript_EffectWeatherBall:
|
BattleScript_EffectWeatherBall:
|
||||||
BattleScript_EffectHiddenPower:
|
BattleScript_EffectHiddenPower:
|
||||||
|
BattleScript_EffectFreezeDry:
|
||||||
jumpifnotmove MOVE_SURF, BattleScript_HitFromAtkCanceler
|
jumpifnotmove MOVE_SURF, BattleScript_HitFromAtkCanceler
|
||||||
jumpifnostatus3 BS_TARGET, STATUS3_UNDERWATER, BattleScript_HitFromAtkCanceler
|
jumpifnostatus3 BS_TARGET, STATUS3_UNDERWATER, BattleScript_HitFromAtkCanceler
|
||||||
orword gHitMarker, HITMARKER_IGNORE_UNDERWATER
|
orword gHitMarker, HITMARKER_IGNORE_UNDERWATER
|
||||||
|
@ -268,5 +268,8 @@
|
|||||||
#define EFFECT_ENTRAINMENT 262
|
#define EFFECT_ENTRAINMENT 262
|
||||||
#define EFFECT_HEAL_PULSE 263
|
#define EFFECT_HEAL_PULSE 263
|
||||||
#define EFFECT_QUASH 264
|
#define EFFECT_QUASH 264
|
||||||
|
#define EFFECT_ION_DELUGE 265
|
||||||
|
#define EFFECT_FREEZE_DRY 266
|
||||||
|
#define EFFECT_TOPSY_TURVY 267
|
||||||
|
|
||||||
#endif // GUARD_CONSTANTS_BATTLE_MOVE_EFFECTS_H
|
#endif // GUARD_CONSTANTS_BATTLE_MOVE_EFFECTS_H
|
||||||
|
@ -90,6 +90,7 @@
|
|||||||
#define VARIOUS_SET_LAST_USED_ABILITY 41
|
#define VARIOUS_SET_LAST_USED_ABILITY 41
|
||||||
#define VARIOUS_TRY_HEAL_PULSE 42
|
#define VARIOUS_TRY_HEAL_PULSE 42
|
||||||
#define VARIOUS_TRY_QUASH 43
|
#define VARIOUS_TRY_QUASH 43
|
||||||
|
#define VARIOUS_INVERT_STAT_STAGES 44
|
||||||
|
|
||||||
// atk80, dmg manipulation
|
// atk80, dmg manipulation
|
||||||
#define ATK80_DMG_CHANGE_SIGN 0
|
#define ATK80_DMG_CHANGE_SIGN 0
|
||||||
|
@ -495,7 +495,9 @@
|
|||||||
#define STRINGID_PKMNBLEWAWAYTOXICSPIKES 492
|
#define STRINGID_PKMNBLEWAWAYTOXICSPIKES 492
|
||||||
#define STRINGID_PKMNBLEWAWAYSTICKYWEB 493
|
#define STRINGID_PKMNBLEWAWAYSTICKYWEB 493
|
||||||
#define STRINGID_PKMNBLEWAWAYSTEALTHROCK 494
|
#define STRINGID_PKMNBLEWAWAYSTEALTHROCK 494
|
||||||
|
#define STRINGID_IONDELUGEON 495
|
||||||
|
#define STRINGID_TOPSYTURVYSWITCHEDSTATS 496
|
||||||
|
|
||||||
#define BATTLESTRINGS_COUNT 506
|
#define BATTLESTRINGS_COUNT 516
|
||||||
|
|
||||||
#endif // GUARD_CONSTANTS_BATTLE_STRING_IDS_H
|
#endif // GUARD_CONSTANTS_BATTLE_STRING_IDS_H
|
||||||
|
@ -6832,7 +6832,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_GEN6] =
|
|||||||
.split = SPLIT_STATUS,
|
.split = SPLIT_STATUS,
|
||||||
},
|
},
|
||||||
{ // MOVE_ION_DELUGE
|
{ // MOVE_ION_DELUGE
|
||||||
.effect = EFFECT_PLACEHOLDER, // Needs a custom move effect
|
.effect = EFFECT_ION_DELUGE,
|
||||||
.power = 0,
|
.power = 0,
|
||||||
.type = TYPE_ELECTRIC,
|
.type = TYPE_ELECTRIC,
|
||||||
.accuracy = 0,
|
.accuracy = 0,
|
||||||
@ -6880,7 +6880,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_GEN6] =
|
|||||||
.split = SPLIT_PHYSICAL,
|
.split = SPLIT_PHYSICAL,
|
||||||
},
|
},
|
||||||
{ // MOVE_FREEZE_DRY
|
{ // MOVE_FREEZE_DRY
|
||||||
.effect = EFFECT_PLACEHOLDER, // Needs a custom move effect
|
.effect = EFFECT_FREEZE_DRY,
|
||||||
.power = 70,
|
.power = 70,
|
||||||
.type = TYPE_ICE,
|
.type = TYPE_ICE,
|
||||||
.accuracy = 100,
|
.accuracy = 100,
|
||||||
@ -6916,7 +6916,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_GEN6] =
|
|||||||
.split = SPLIT_STATUS,
|
.split = SPLIT_STATUS,
|
||||||
},
|
},
|
||||||
{ // MOVE_TOPSY_TURVY
|
{ // MOVE_TOPSY_TURVY
|
||||||
.effect = EFFECT_PLACEHOLDER, // Needs a custom move effect
|
.effect = EFFECT_TOPSY_TURVY,
|
||||||
.power = 0,
|
.power = 0,
|
||||||
.type = TYPE_DARK,
|
.type = TYPE_DARK,
|
||||||
.accuracy = 0,
|
.accuracy = 0,
|
||||||
|
@ -633,6 +633,8 @@ static const u8 sText_QuashSuccess[] = _("");
|
|||||||
static const u8 sText_PkmnBlewAwayToxicSpikes[] = _("{B_ATK_NAME_WITH_PREFIX} blew away\nTOXIC SPIKES!");
|
static const u8 sText_PkmnBlewAwayToxicSpikes[] = _("{B_ATK_NAME_WITH_PREFIX} blew away\nTOXIC SPIKES!");
|
||||||
static const u8 sText_PkmnBlewAwayStickyWeb[] = _("{B_ATK_NAME_WITH_PREFIX} blew away\nSTICKY WEB!");
|
static const u8 sText_PkmnBlewAwayStickyWeb[] = _("{B_ATK_NAME_WITH_PREFIX} blew away\nSTICKY WEB!");
|
||||||
static const u8 sText_PkmnBlewAwayStealthRock[] = _("{B_ATK_NAME_WITH_PREFIX} blew away\nSTEALTH ROCK!");
|
static const u8 sText_PkmnBlewAwayStealthRock[] = _("{B_ATK_NAME_WITH_PREFIX} blew away\nSTEALTH ROCK!");
|
||||||
|
static const u8 sText_IonDelugeOn[] = _("");
|
||||||
|
static const u8 sText_TopsyTurvySwitchedStats[] = _("");
|
||||||
|
|
||||||
// New selection strings, they must end with "\p".
|
// New selection strings, they must end with "\p".
|
||||||
// Use {B_LAST_ITEM} and {B_CURRENT_MOVE}.
|
// Use {B_LAST_ITEM} and {B_CURRENT_MOVE}.
|
||||||
@ -1126,6 +1128,8 @@ const u8 *const gBattleStringsTable[BATTLESTRINGS_COUNT] =
|
|||||||
sText_PkmnBlewAwayToxicSpikes,
|
sText_PkmnBlewAwayToxicSpikes,
|
||||||
sText_PkmnBlewAwayStickyWeb,
|
sText_PkmnBlewAwayStickyWeb,
|
||||||
sText_PkmnBlewAwayStealthRock,
|
sText_PkmnBlewAwayStealthRock,
|
||||||
|
sText_IonDelugeOn,
|
||||||
|
sText_TopsyTurvySwitchedStats,
|
||||||
};
|
};
|
||||||
|
|
||||||
const u16 gMagicCoatBounceStringIds[] =
|
const u16 gMagicCoatBounceStringIds[] =
|
||||||
|
@ -6430,6 +6430,15 @@ static void atk76_various(void)
|
|||||||
gBattlescriptCurrInstr += 7;
|
gBattlescriptCurrInstr += 7;
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
|
case VARIOUS_INVERT_STAT_STAGES:
|
||||||
|
for (i = 0; i < BATTLE_STATS_NO; i++)
|
||||||
|
{
|
||||||
|
if (gBattleMons[gActiveBattler].statStages[i] < 6) // Negative becomes positive.
|
||||||
|
gBattleMons[gActiveBattler].statStages[i] = 6 + (6 - gBattleMons[gActiveBattler].statStages[i]);
|
||||||
|
else if (gBattleMons[gActiveBattler].statStages[i] > 6) // Positive becomes negative.
|
||||||
|
gBattleMons[gActiveBattler].statStages[i] = 6 - (gBattleMons[gActiveBattler].statStages[i] - 6);
|
||||||
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
gBattlescriptCurrInstr += 3;
|
gBattlescriptCurrInstr += 3;
|
||||||
|
@ -848,6 +848,7 @@ enum
|
|||||||
ENDTURN_MISTY_TERRAIN,
|
ENDTURN_MISTY_TERRAIN,
|
||||||
ENDTURN_GRASSY_TERRAIN,
|
ENDTURN_GRASSY_TERRAIN,
|
||||||
ENDTURN_PSYCHIC_TERRAIN,
|
ENDTURN_PSYCHIC_TERRAIN,
|
||||||
|
ENDTURN_ION_DELUGE,
|
||||||
ENDTURN_FIELD_COUNT,
|
ENDTURN_FIELD_COUNT,
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -1257,6 +1258,10 @@ u8 DoFieldEndTurnEffects(void)
|
|||||||
}
|
}
|
||||||
gBattleStruct->turnCountersTracker++;
|
gBattleStruct->turnCountersTracker++;
|
||||||
break;
|
break;
|
||||||
|
case ENDTURN_ION_DELUGE:
|
||||||
|
gFieldStatuses &= ~(STATUS_FIELD_ION_DELUGE);
|
||||||
|
gBattleStruct->turnCountersTracker++;
|
||||||
|
break;
|
||||||
case ENDTURN_FIELD_COUNT:
|
case ENDTURN_FIELD_COUNT:
|
||||||
effect++;
|
effect++;
|
||||||
break;
|
break;
|
||||||
@ -5410,7 +5415,7 @@ static inline void MulByTypeEffectiveness(u16 *modifier, u16 move, u8 moveType,
|
|||||||
mod = UQ_4_12(1.0);
|
mod = UQ_4_12(1.0);
|
||||||
if (moveType == TYPE_PSYCHIC && defType == TYPE_DARK && gStatuses3[battlerDef] & STATUS3_MIRACLE_EYED)
|
if (moveType == TYPE_PSYCHIC && defType == TYPE_DARK && gStatuses3[battlerDef] & STATUS3_MIRACLE_EYED)
|
||||||
mod = UQ_4_12(1.0);
|
mod = UQ_4_12(1.0);
|
||||||
if (move == MOVE_FREEZE_DRY && defType == TYPE_WATER)
|
if (gBattleMoves[move].effect == EFFECT_FREEZE_DRY && defType == TYPE_WATER)
|
||||||
mod = UQ_4_12(2.0);
|
mod = UQ_4_12(2.0);
|
||||||
if (moveType == TYPE_GROUND && defType == TYPE_FLYING && IsBattlerGrounded(battlerDef))
|
if (moveType == TYPE_GROUND && defType == TYPE_FLYING && IsBattlerGrounded(battlerDef))
|
||||||
mod = UQ_4_12(1.0);
|
mod = UQ_4_12(1.0);
|
||||||
|
Loading…
Reference in New Issue
Block a user