mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2025-01-26 21:33:53 +01:00
Reflect Type and SOAK
This commit is contained in:
parent
e259000dc3
commit
4cb1e880da
@ -1459,6 +1459,21 @@
|
||||
.4byte \ptr
|
||||
.endm
|
||||
|
||||
.macro tryelectrify ptr
|
||||
various BS_ATTACKER, VARIOUS_TRY_ELECTRIFY
|
||||
.4byte \ptr
|
||||
.endm
|
||||
|
||||
.macro tryreflecttype ptr
|
||||
various BS_ATTACKER, VARIOUS_TRY_REFLECT_TYPE
|
||||
.4byte \ptr
|
||||
.endm
|
||||
|
||||
.macro trysoak ptr
|
||||
various BS_ATTACKER, VARIOUS_TRY_SOAK
|
||||
.4byte \ptr
|
||||
.endm
|
||||
|
||||
@ helpful macros
|
||||
.macro setstatchanger stat, stages, down
|
||||
setbyte sSTATCHANGER \stat | \stages << 4 | \down << 7
|
||||
|
@ -294,6 +294,49 @@ gBattleScriptsForMoveEffects:: @ 82D86A8
|
||||
.4byte BattleScript_EffectSpeedUpHit
|
||||
.4byte BattleScript_EffectQuiverDance
|
||||
.4byte BattleScript_EffectCoil
|
||||
.4byte BattleScript_EffectElectrify
|
||||
.4byte BattleScript_EffectScald
|
||||
.4byte BattleScript_EffectReflectType
|
||||
.4byte BattleScript_EffectSoak
|
||||
|
||||
BattleScript_EffectSoak:
|
||||
attackcanceler
|
||||
accuracycheck BattleScript_PrintMoveMissed, ACC_CURR_MOVE
|
||||
attackstring
|
||||
ppreduce
|
||||
jumpifability BS_TARGET, ABILITY_MULTITYPE, BattleScript_ButItFailed
|
||||
jumpifability BS_TARGET, ABILITY_RKS_SYSTEM, BattleScript_ButItFailed
|
||||
jumpifsubstituteblocks BattleScript_ButItFailed
|
||||
attackanimation
|
||||
waitanimation
|
||||
trysoak BattleScript_ButItFailed
|
||||
printstring STRINGID_TRANSFORMEDINTOWATERTYPE
|
||||
waitmessage 0x40
|
||||
goto BattleScript_MoveEnd
|
||||
|
||||
BattleScript_EffectReflectType:
|
||||
attackcanceler
|
||||
accuracycheck BattleScript_PrintMoveMissed, ACC_CURR_MOVE
|
||||
attackstring
|
||||
ppreduce
|
||||
tryreflecttype BattleScript_ButItFailed
|
||||
attackanimation
|
||||
waitanimation
|
||||
printstring STRINGID_REFLECTTARGETSTYPE
|
||||
waitmessage 0x40
|
||||
goto BattleScript_MoveEnd
|
||||
|
||||
BattleScript_EffectElectrify:
|
||||
attackcanceler
|
||||
accuracycheck BattleScript_PrintMoveMissed, ACC_CURR_MOVE
|
||||
attackstring
|
||||
ppreduce
|
||||
tryelectrify BattleScript_ButItFailed
|
||||
attackanimation
|
||||
waitanimation
|
||||
printstring STRINGID_TARGETELECTRIFIED
|
||||
waitmessage 0x40
|
||||
goto BattleScript_MoveEnd
|
||||
|
||||
BattleScript_EffectCoil:
|
||||
attackcanceler
|
||||
@ -1056,6 +1099,7 @@ BattleScript_AbsorbTryFainting::
|
||||
|
||||
BattleScript_EffectBurnHit::
|
||||
BattleScript_EffectBlazeKick::
|
||||
BattleScript_EffectScald:
|
||||
setmoveeffect MOVE_EFFECT_BURN
|
||||
goto BattleScript_EffectHit
|
||||
|
||||
|
@ -283,5 +283,9 @@
|
||||
#define EFFECT_SPEED_UP_HIT 277
|
||||
#define EFFECT_QUIVER_DANCE 278
|
||||
#define EFFECT_COIL 279
|
||||
#define EFFECT_ELECTRIFY 280
|
||||
#define EFFECT_SCALD 281
|
||||
#define EFFECT_REFLECT_TYPE 282
|
||||
#define EFFECT_SOAK 283
|
||||
|
||||
#endif // GUARD_CONSTANTS_BATTLE_MOVE_EFFECTS_H
|
||||
|
@ -94,6 +94,9 @@
|
||||
#define VARIOUS_SET_TERRAIN 45
|
||||
#define VARIOUS_TRY_ME_FIRST 46
|
||||
#define VARIOUS_JUMP_IF_BATTLE_END 47
|
||||
#define VARIOUS_TRY_ELECTRIFY 48
|
||||
#define VARIOUS_TRY_REFLECT_TYPE 49
|
||||
#define VARIOUS_TRY_SOAK 50
|
||||
|
||||
// atk80, dmg manipulation
|
||||
#define ATK80_DMG_CHANGE_SIGN 0
|
||||
|
@ -501,6 +501,7 @@
|
||||
#define STRINGID_TERRAINBECOMESGRASSY 498
|
||||
#define STRINGID_TERRAINBECOMESELECTRIC 499
|
||||
#define STRINGID_TERRAINBECOMESPSYCHIC 500
|
||||
#define STRINGID_TARGETELECTRIFIED 501
|
||||
|
||||
#define BATTLESTRINGS_COUNT 516
|
||||
|
||||
|
@ -452,5 +452,7 @@
|
||||
#define SPECIES_PALKIA 0
|
||||
#define SPECIES_GIRATINA 0
|
||||
#define SPECIES_CHERRIM 0
|
||||
#define SPECIES_ARCEUS 0
|
||||
#define SPECIES_SILVALLY 0
|
||||
|
||||
#endif // GUARD_CONSTANTS_SPECIES_H
|
||||
|
@ -5848,7 +5848,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_GEN6] =
|
||||
.split = SPLIT_SPECIAL,
|
||||
},
|
||||
{ // MOVE_SOAK
|
||||
.effect = EFFECT_PLACEHOLDER, // Needs a custom move effect
|
||||
.effect = EFFECT_SOAK,
|
||||
.power = 0,
|
||||
.type = TYPE_WATER,
|
||||
.accuracy = 100,
|
||||
@ -6040,7 +6040,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_GEN6] =
|
||||
.split = SPLIT_STATUS,
|
||||
},
|
||||
{ // MOVE_SCALD
|
||||
.effect = EFFECT_PLACEHOLDER, // Needs a custom move effect (30% burn + always thaws ice even if it misses)
|
||||
.effect = EFFECT_SCALD,
|
||||
.power = 80,
|
||||
.type = TYPE_WATER,
|
||||
.accuracy = 100,
|
||||
@ -6160,7 +6160,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_GEN6] =
|
||||
.split = SPLIT_PHYSICAL,
|
||||
},
|
||||
{ // MOVE_REFLECT_TYPE
|
||||
.effect = EFFECT_PLACEHOLDER, // Needs a custom move effect
|
||||
.effect = EFFECT_REFLECT_TYPE,
|
||||
.power = 0,
|
||||
.type = TYPE_NORMAL,
|
||||
.accuracy = 0,
|
||||
@ -6990,7 +6990,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_GEN6] =
|
||||
.split = SPLIT_STATUS,
|
||||
},
|
||||
{ // MOVE_ELECTRIFY
|
||||
.effect = EFFECT_PLACEHOLDER, // Needs a custom move effect
|
||||
.effect = EFFECT_ELECTRIFY,
|
||||
.power = 0,
|
||||
.type = TYPE_ELECTRIC,
|
||||
.accuracy = 0,
|
||||
|
@ -641,6 +641,7 @@ static const u8 sText_TerrainBecomesMisty[] = _("");
|
||||
static const u8 sText_TerrainBecomesGrassy[] = _("");
|
||||
static const u8 sText_TerrainBecomesElectric[] = _("");
|
||||
static const u8 sText_TerrainBecomesPsychic[] = _("");
|
||||
static const u8 sText_TargetElectrified[] = _("");
|
||||
|
||||
// New selection strings, they must end with "\p".
|
||||
// Use {B_LAST_ITEM} and {B_CURRENT_MOVE}.
|
||||
@ -1140,6 +1141,7 @@ const u8 *const gBattleStringsTable[BATTLESTRINGS_COUNT] =
|
||||
sText_TerrainBecomesGrassy,
|
||||
sText_TerrainBecomesElectric,
|
||||
sText_TerrainBecomesPsychic,
|
||||
sText_TargetElectrified,
|
||||
};
|
||||
|
||||
const u16 gTerrainStringIds[] =
|
||||
|
@ -4039,7 +4039,7 @@ static void atk49_moveend(void)
|
||||
if (gBattleMons[gBattlerTarget].status1 & STATUS1_FREEZE
|
||||
&& gBattleMons[gBattlerTarget].hp != 0 && gBattlerAttacker != gBattlerTarget
|
||||
&& gSpecialStatuses[gBattlerTarget].specialDmg
|
||||
&& !(gMoveResultFlags & MOVE_RESULT_NO_EFFECT) && moveType == TYPE_FIRE)
|
||||
&& !(gMoveResultFlags & MOVE_RESULT_NO_EFFECT) && (moveType == TYPE_FIRE || gBattleMoves[gCurrentMove].effect == EFFECT_SCALD))
|
||||
{
|
||||
gBattleMons[gBattlerTarget].status1 &= ~(STATUS1_FREEZE);
|
||||
gActiveBattler = gBattlerTarget;
|
||||
@ -6519,6 +6519,56 @@ static void atk76_various(void)
|
||||
else
|
||||
gBattlescriptCurrInstr += 7;
|
||||
return;
|
||||
case VARIOUS_TRY_ELECTRIFY:
|
||||
if (GetBattlerTurnOrderNum(gBattlerAttacker) > GetBattlerTurnOrderNum(gBattlerTarget))
|
||||
{
|
||||
gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 3);
|
||||
}
|
||||
else
|
||||
{
|
||||
gStatuses3[gBattlerTarget] |= STATUS3_ELECTRIFIED;
|
||||
gBattlescriptCurrInstr += 7;
|
||||
}
|
||||
return;
|
||||
case VARIOUS_TRY_REFLECT_TYPE:
|
||||
if (gBattleMons[gBattlerTarget].species == SPECIES_ARCEUS || gBattleMons[gBattlerTarget].species == SPECIES_SILVALLY)
|
||||
{
|
||||
gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 3);
|
||||
}
|
||||
else if (gBattleMons[gBattlerTarget].type1 == TYPE_MYSTERY && gBattleMons[gBattlerTarget].type2 != TYPE_MYSTERY)
|
||||
{
|
||||
gBattleMons[gBattlerAttacker].type1 = gBattleMons[gBattlerTarget].type2;
|
||||
gBattleMons[gBattlerAttacker].type2 = gBattleMons[gBattlerTarget].type2;
|
||||
gBattlescriptCurrInstr += 7;
|
||||
}
|
||||
else if (gBattleMons[gBattlerTarget].type1 != TYPE_MYSTERY && gBattleMons[gBattlerTarget].type2 == TYPE_MYSTERY)
|
||||
{
|
||||
gBattleMons[gBattlerAttacker].type1 = gBattleMons[gBattlerTarget].type1;
|
||||
gBattleMons[gBattlerAttacker].type2 = gBattleMons[gBattlerTarget].type1;
|
||||
gBattlescriptCurrInstr += 7;
|
||||
}
|
||||
else if (gBattleMons[gBattlerTarget].type1 == TYPE_MYSTERY && gBattleMons[gBattlerTarget].type2 == TYPE_MYSTERY)
|
||||
{
|
||||
gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 3);
|
||||
}
|
||||
else
|
||||
{
|
||||
gBattleMons[gBattlerAttacker].type1 = gBattleMons[gBattlerTarget].type1;
|
||||
gBattleMons[gBattlerAttacker].type2 = gBattleMons[gBattlerTarget].type2;
|
||||
gBattlescriptCurrInstr += 7;
|
||||
}
|
||||
return;
|
||||
case VARIOUS_TRY_SOAK:
|
||||
if (gBattleMons[gBattlerTarget].type1 == TYPE_WATER && gBattleMons[gBattlerTarget].type2 == TYPE_WATER)
|
||||
{
|
||||
gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 3);
|
||||
}
|
||||
else
|
||||
{
|
||||
SET_BATTLER_TYPE(gBattlerTarget, TYPE_WATER);
|
||||
gBattlescriptCurrInstr += 7;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
gBattlescriptCurrInstr += 3;
|
||||
|
Loading…
x
Reference in New Issue
Block a user