add eerie spell, surging strikes, jungle healing

This commit is contained in:
Evan 2021-01-28 10:51:00 -07:00
parent 345987c9f9
commit dd51edd881
8 changed files with 167 additions and 41 deletions

View File

@ -1765,6 +1765,21 @@
.4byte \ptr .4byte \ptr
.endm .endm
.macro eeriespellppreduce ptr:req
various BS_TARGET, VARIOUS_EERIE_SPELL_PP_REDUCE
.4byte \ptr
.endm
.macro jumpifteamhealthy battler:req, ptr:req
various \battler, VARIOUS_JUMP_IF_TEAM_HEALTHY
.4byte \ptr
.endm
.macro tryhealquarterhealth battler:req, ptr:req
various \battler, VARIOUS_TRY_HEAL_QUARTER_HP
.4byte \ptr
.endm
@ helpful macros @ helpful macros
.macro setstatchanger stat:req, stages:req, down:req .macro setstatchanger stat:req, stages:req, down:req
setbyte sSTATCHANGER \stat | \stages << 3 | \down << 7 setbyte sSTATCHANGER \stat | \stages << 3 | \down << 7

View File

@ -14022,7 +14022,7 @@ Move_SCORCHING_SANDS::
end @to do: end @to do:
Move_JUNGLE_HEALING:: Move_JUNGLE_HEALING::
end @to do: goto Move_AROMATHERAPY
Move_WICKED_BLOW:: Move_WICKED_BLOW::
end @to do: end @to do:

View File

@ -365,6 +365,40 @@ gBattleScriptsForMoveEffects:: @ 82D86A8
.4byte BattleScript_EffectFairyLock .4byte BattleScript_EffectFairyLock
.4byte BattleScript_EffectAllySwitch .4byte BattleScript_EffectAllySwitch
.4byte BattleScript_EffectSleepHit .4byte BattleScript_EffectSleepHit
.4byte BattleScript_EffectEerieSpell
.4byte BattleScript_EffectJungleHealing
BattleScript_EffectJungleHealing:
attackcanceler
attackstring
ppreduce
jumpifteamhealthy BS_ATTACKER, BattleScript_ButItFailed
attackanimation
waitanimation
copybyte gBattlerTarget, gBattlerAttacker
setbyte gBattleCommunication, 0
JungleHealing_RestoreTargetHealth:
copybyte gBattlerAttacker, gBattlerTarget
tryhealquarterhealth BS_TARGET, JungleHealing_TryCureStatus
orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE
healthbarupdate BS_TARGET
datahpupdate BS_TARGET
printstring STRINGID_PKMNREGAINEDHEALTH
waitmessage 0x40
JungleHealing_TryCureStatus:
jumpifstatus BS_TARGET, STATUS1_ANY, BattleScript_JungleHealingCureStatus
goto JungleHealingTryRestoreAlly
BattleScript_JungleHealingCureStatus:
curestatus BS_TARGET
updatestatusicon BS_TARGET
printstring STRINGID_PKMNSTATUSNORMAL
waitmessage 0x40
JungleHealingTryRestoreAlly:
jumpifbyte CMP_NOT_EQUAL, gBattleCommunication, 0x0, BattleScript_MoveEnd
addbyte gBattleCommunication, 1
jumpifnoally BS_TARGET, BattleScript_MoveEnd
setallytonexttarget JungleHealing_RestoreTargetHealth
goto BattleScript_MoveEnd
BattleScript_EffectSleepHit: BattleScript_EffectSleepHit:
setmoveeffect MOVE_EFFECT_SLEEP setmoveeffect MOVE_EFFECT_SLEEP
@ -3441,6 +3475,32 @@ BattleScript_EffectDestinyBond::
waitmessage 0x40 waitmessage 0x40
goto BattleScript_MoveEnd goto BattleScript_MoveEnd
BattleScript_EffectEerieSpell::
attackcanceler
attackstring
ppreduce
accuracycheck BattleScript_ButItFailed, ACC_CURR_MOVE
attackstring
ppreduce
critcalc
damagecalc
adjustdamage
attackanimation
waitanimation
effectivenesssound
hitanimation BS_TARGET
waitstate
healthbarupdate BS_TARGET
datahpupdate BS_TARGET
critmessage
waitmessage 0x40
resultmessage
waitmessage 0x40
tryfaintmon BS_TARGET, FALSE, NULL
eeriespellppreduce BattleScript_MoveEnd
printstring STRINGID_PKMNREDUCEDPP
goto BattleScript_MoveEnd
BattleScript_EffectSpite:: BattleScript_EffectSpite::
attackcanceler attackcanceler
attackstring attackstring
@ -3491,7 +3551,13 @@ BattleScript_TripleKickLoop::
BattleScript_DoTripleKickAttack:: BattleScript_DoTripleKickAttack::
accuracycheck BattleScript_TripleKickNoMoreHits, ACC_CURR_MOVE accuracycheck BattleScript_TripleKickNoMoreHits, ACC_CURR_MOVE
movevaluescleanup movevaluescleanup
addbyte sTRIPLE_KICK_POWER, 10 jumpifmove MOVE_SURGING_STRIKES, EffectTripleKick_DoDmgCalcs @ no power boost each hit
jumpifmove MOVE_TRIPLE_AXEL, EffectTripleKick_TripleAxelBoost @ triple axel gets +20 power
addbyte sTRIPLE_KICK_POWER, 10 @ triple kick gets +10 power
goto EffectTripleKick_DoDmgCalcs
EffectTripleKick_TripleAxelBoost:
addbyte sTRIPLE_KICK_POWER, 20
EffectTripleKick_DoDmgCalcs:
addbyte sMULTIHIT_STRING + 4, 0x1 addbyte sMULTIHIT_STRING + 4, 0x1
critcalc critcalc
damagecalc damagecalc

View File

@ -351,5 +351,7 @@
#define EFFECT_FAIRY_LOCK 345 #define EFFECT_FAIRY_LOCK 345
#define EFFECT_ALLY_SWITCH 346 #define EFFECT_ALLY_SWITCH 346
#define EFFECT_SLEEP_HIT 347 // Relic Song #define EFFECT_SLEEP_HIT 347 // Relic Song
#define EFFECT_EERIE_SPELL 348
#define EFFECT_JUNGLE_HEALING 349
#endif // GUARD_CONSTANTS_BATTLE_MOVE_EFFECTS_H #endif // GUARD_CONSTANTS_BATTLE_MOVE_EFFECTS_H

View File

@ -168,6 +168,9 @@
#define VARIOUS_JUMP_IF_ABSENT 101 #define VARIOUS_JUMP_IF_ABSENT 101
#define VARIOUS_DESTROY_ABILITY_POPUP 102 #define VARIOUS_DESTROY_ABILITY_POPUP 102
#define VARIOUS_TOTEM_BOOST 103 #define VARIOUS_TOTEM_BOOST 103
#define VARIOUS_EERIE_SPELL_PP_REDUCE 104
#define VARIOUS_JUMP_IF_TEAM_HEALTHY 105
#define VARIOUS_TRY_HEAL_QUARTER_HP 106
// Cmd_manipulatedamage // Cmd_manipulatedamage
#define DMG_CHANGE_SIGN 0 #define DMG_CHANGE_SIGN 0

View File

@ -1711,7 +1711,8 @@ s32 CalcCritChanceStage(u8 battlerAtk, u8 battlerDef, u32 move, bool32 recordAbi
} }
else if (gStatuses3[battlerAtk] & STATUS3_LASER_FOCUS else if (gStatuses3[battlerAtk] & STATUS3_LASER_FOCUS
|| gBattleMoves[move].effect == EFFECT_ALWAYS_CRIT || gBattleMoves[move].effect == EFFECT_ALWAYS_CRIT
|| (abilityAtk == ABILITY_MERCILESS && gBattleMons[battlerDef].status1 & STATUS1_PSN_ANY)) || (abilityAtk == ABILITY_MERCILESS && gBattleMons[battlerDef].status1 & STATUS1_PSN_ANY)
|| move == MOVE_SURGING_STRIKES)
{ {
critChance = -2; critChance = -2;
} }
@ -8333,6 +8334,79 @@ static void Cmd_various(void)
gBattlescriptCurrInstr += 7; // exit if loop failed (failsafe) gBattlescriptCurrInstr += 7; // exit if loop failed (failsafe)
} }
return; return;
case VARIOUS_EERIE_SPELL_PP_REDUCE:
if (gLastMoves[gActiveBattler] != 0 && gLastMoves[gActiveBattler] != 0xFFFF)
{
s32 i;
for (i = 0; i < MAX_MON_MOVES; i++)
{
if (gLastMoves[gActiveBattler] == gBattleMons[gActiveBattler].moves[i])
break;
}
if (i != MAX_MON_MOVES && gBattleMons[gActiveBattler].pp[i] != 0)
{
s32 ppToDeduct = 3;
if (gBattleMons[gActiveBattler].pp[i] < ppToDeduct)
ppToDeduct = gBattleMons[gActiveBattler].pp[i];
PREPARE_MOVE_BUFFER(gBattleTextBuff1, gLastMoves[gActiveBattler])
ConvertIntToDecimalStringN(gBattleTextBuff2, ppToDeduct, STR_CONV_MODE_LEFT_ALIGN, 1);
PREPARE_BYTE_NUMBER_BUFFER(gBattleTextBuff2, 1, ppToDeduct)
gBattleMons[gActiveBattler].pp[i] -= ppToDeduct;
if (!(gDisableStructs[gActiveBattler].mimickedMoves & gBitTable[i])
&& !(gBattleMons[gActiveBattler].status2 & STATUS2_TRANSFORMED))
{
BtlController_EmitSetMonData(0, REQUEST_PPMOVE1_BATTLE + i, 0, 1, &gBattleMons[gActiveBattler].pp[i]);
MarkBattlerForControllerExec(gActiveBattler);
}
if (gBattleMons[gActiveBattler].pp[i] == 0)
CancelMultiTurnMoves(gActiveBattler);
gBattlescriptCurrInstr += 7; // continue
}
else
{
gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 3); // cant reduce pp
}
}
else
{
gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 3); // cant reduce pp
}
return;
case VARIOUS_JUMP_IF_TEAM_HEALTHY:
if ((gBattleTypeFlags & BATTLE_TYPE_DOUBLE) && IsBattlerAlive(BATTLE_PARTNER(gActiveBattler)))
{
u8 partner = BATTLE_PARTNER(gActiveBattler);
if ((gBattleMons[gActiveBattler].hp == gBattleMons[gActiveBattler].maxHP && !(gBattleMons[gActiveBattler].status1 & STATUS1_ANY))
&& (gBattleMons[partner].hp == gBattleMons[partner].maxHP && !(gBattleMons[partner].status1 & STATUS1_ANY)))
gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 3); // fail
else
gBattlescriptCurrInstr += 7;
}
else // single battle
{
if (gBattleMons[gActiveBattler].hp == gBattleMons[gActiveBattler].maxHP && !(gBattleMons[gActiveBattler].status1 & STATUS1_ANY))
gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 3); // fail
else
gBattlescriptCurrInstr += 7;
}
return;
case VARIOUS_TRY_HEAL_QUARTER_HP:
gBattleMoveDamage = gBattleMons[gActiveBattler].maxHP / 4;
if (gBattleMoveDamage == 0)
gBattleMoveDamage = 1;
gBattleMoveDamage *= -1;
if (gBattleMons[gActiveBattler].hp == gBattleMons[gActiveBattler].maxHP)
gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 3); // fail
else
gBattlescriptCurrInstr += 7; // can heal
return;
} }
gBattlescriptCurrInstr += 3; gBattlescriptCurrInstr += 3;

View File

@ -11306,7 +11306,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] =
[MOVE_TRIPLE_AXEL] = [MOVE_TRIPLE_AXEL] =
{ {
.effect = EFFECT_TRIPLE_KICK, //TODO: Increase damage by 20 instead of 10 .effect = EFFECT_TRIPLE_KICK,
.power = 20, .power = 20,
.type = TYPE_ICE, .type = TYPE_ICE,
.accuracy = 90, .accuracy = 90,
@ -11348,7 +11348,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] =
[MOVE_JUNGLE_HEALING] = [MOVE_JUNGLE_HEALING] =
{ {
.effect = EFFECT_PLACEHOLDER, //TODO .effect = EFFECT_JUNGLE_HEALING,
.power = 0, .power = 0,
.type = TYPE_GRASS, .type = TYPE_GRASS,
.accuracy = 0, .accuracy = 0,
@ -11375,7 +11375,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] =
[MOVE_SURGING_STRIKES] = [MOVE_SURGING_STRIKES] =
{ {
.effect = EFFECT_PLACEHOLDER, //TODO (Multi hit + Always Crit) .effect = EFFECT_TRIPLE_KICK,
.power = 25, .power = 25,
.type = TYPE_WATER, .type = TYPE_WATER,
.accuracy = 100, .accuracy = 100,
@ -11487,7 +11487,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] =
[MOVE_EERIE_SPELL] = [MOVE_EERIE_SPELL] =
{ {
.effect = EFFECT_HIT, // To do. It's a copy of Spite that inflicts damage and reduced the target's last move's PP by 3 instead of 4. .effect = EFFECT_EERIE_SPELL,
.power = 80, .power = 80,
.type = TYPE_PSYCHIC, .type = TYPE_PSYCHIC,
.accuracy = 100, .accuracy = 100,

View File

@ -1630,23 +1630,7 @@ static const struct LevelUpMove sDodrioLevelUpLearnset[] = {
}; };
static const struct LevelUpMove sSeelLevelUpLearnset[] = { static const struct LevelUpMove sSeelLevelUpLearnset[] = {
LEVEL_UP_MOVE( 1, MOVE_HEADBUTT),
LEVEL_UP_MOVE( 3, MOVE_GROWL), LEVEL_UP_MOVE( 3, MOVE_GROWL),
LEVEL_UP_MOVE( 7, MOVE_WATER_SPORT),
LEVEL_UP_MOVE(11, MOVE_ICY_WIND),
LEVEL_UP_MOVE(13, MOVE_ENCORE),
LEVEL_UP_MOVE(17, MOVE_ICE_SHARD),
LEVEL_UP_MOVE(21, MOVE_REST),
LEVEL_UP_MOVE(23, MOVE_AQUA_RING),
LEVEL_UP_MOVE(27, MOVE_AURORA_BEAM),
LEVEL_UP_MOVE(31, MOVE_AQUA_JET),
LEVEL_UP_MOVE(33, MOVE_BRINE),
LEVEL_UP_MOVE(37, MOVE_TAKE_DOWN),
LEVEL_UP_MOVE(41, MOVE_DIVE),
LEVEL_UP_MOVE(43, MOVE_AQUA_TAIL),
LEVEL_UP_MOVE(47, MOVE_ICE_BEAM),
LEVEL_UP_MOVE(51, MOVE_SAFEGUARD),
LEVEL_UP_MOVE(53, MOVE_HAIL),
LEVEL_UP_END LEVEL_UP_END
}; };
@ -2355,25 +2339,7 @@ static const struct LevelUpMove sSeakingLevelUpLearnset[] = {
}; };
static const struct LevelUpMove sStaryuLevelUpLearnset[] = { static const struct LevelUpMove sStaryuLevelUpLearnset[] = {
LEVEL_UP_MOVE( 1, MOVE_TACKLE),
LEVEL_UP_MOVE( 1, MOVE_HARDEN), LEVEL_UP_MOVE( 1, MOVE_HARDEN),
LEVEL_UP_MOVE( 4, MOVE_WATER_GUN),
LEVEL_UP_MOVE( 7, MOVE_RAPID_SPIN),
LEVEL_UP_MOVE(10, MOVE_RECOVER),
LEVEL_UP_MOVE(13, MOVE_PSYWAVE),
LEVEL_UP_MOVE(16, MOVE_SWIFT),
LEVEL_UP_MOVE(18, MOVE_BUBBLE_BEAM),
LEVEL_UP_MOVE(22, MOVE_CAMOUFLAGE),
LEVEL_UP_MOVE(24, MOVE_GYRO_BALL),
LEVEL_UP_MOVE(28, MOVE_BRINE),
LEVEL_UP_MOVE(31, MOVE_MINIMIZE),
LEVEL_UP_MOVE(35, MOVE_REFLECT_TYPE),
LEVEL_UP_MOVE(37, MOVE_POWER_GEM),
LEVEL_UP_MOVE(40, MOVE_CONFUSE_RAY),
LEVEL_UP_MOVE(42, MOVE_PSYCHIC),
LEVEL_UP_MOVE(46, MOVE_LIGHT_SCREEN),
LEVEL_UP_MOVE(49, MOVE_COSMIC_POWER),
LEVEL_UP_MOVE(53, MOVE_HYDRO_PUMP),
LEVEL_UP_END LEVEL_UP_END
}; };