mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2024-11-16 19:47:35 +01:00
Shore Up
This commit is contained in:
parent
093eca07b3
commit
7178ea6b46
@ -1066,6 +1066,7 @@ AI_CheckViability:
|
||||
if_effect EFFECT_MORNING_SUN, AI_CV_HealWeather
|
||||
if_effect EFFECT_SYNTHESIS, AI_CV_HealWeather
|
||||
if_effect EFFECT_MOONLIGHT, AI_CV_HealWeather
|
||||
if_effect EFFECT_SHORE_UP, AI_CV_Heal
|
||||
if_effect EFFECT_RAIN_DANCE, AI_CV_RainDance
|
||||
if_effect EFFECT_SUNNY_DAY, AI_CV_SunnyDay
|
||||
if_effect EFFECT_BELLY_DRUM, AI_CV_BellyDrum
|
||||
@ -3721,7 +3722,7 @@ AI_HPAware:
|
||||
|
||||
AI_HPAware_UserHasHighHP:
|
||||
get_considered_move_effect
|
||||
if_in_bytes AI_HPAware_DiscouragedEffectsWhenHighHP, AI_HPAware_TryToDiscourage
|
||||
if_in_hwords AI_HPAware_DiscouragedEffectsWhenHighHP, AI_HPAware_TryToDiscourage
|
||||
goto AI_HPAware_ConsiderTarget
|
||||
|
||||
AI_HPAware_UserHasMediumHP:
|
||||
@ -3758,21 +3759,22 @@ AI_HPAware_End:
|
||||
end
|
||||
|
||||
AI_HPAware_DiscouragedEffectsWhenHighHP: @ 82DE21F
|
||||
.byte EFFECT_EXPLOSION
|
||||
.byte EFFECT_RESTORE_HP
|
||||
.byte EFFECT_REST
|
||||
.byte EFFECT_DESTINY_BOND
|
||||
.byte EFFECT_FLAIL
|
||||
.byte EFFECT_ENDURE
|
||||
.byte EFFECT_MORNING_SUN
|
||||
.byte EFFECT_SYNTHESIS
|
||||
.byte EFFECT_MOONLIGHT
|
||||
.byte EFFECT_SOFTBOILED
|
||||
.byte EFFECT_ROOST
|
||||
.byte EFFECT_MEMENTO
|
||||
.byte EFFECT_GRUDGE
|
||||
.byte EFFECT_OVERHEAT
|
||||
.byte -1
|
||||
.2byte EFFECT_EXPLOSION
|
||||
.2byte EFFECT_RESTORE_HP
|
||||
.2byte EFFECT_REST
|
||||
.2byte EFFECT_DESTINY_BOND
|
||||
.2byte EFFECT_FLAIL
|
||||
.2byte EFFECT_ENDURE
|
||||
.2byte EFFECT_MORNING_SUN
|
||||
.2byte EFFECT_SYNTHESIS
|
||||
.2byte EFFECT_MOONLIGHT
|
||||
.2byte EFFECT_SHORE_UP
|
||||
.2byte EFFECT_SOFTBOILED
|
||||
.2byte EFFECT_ROOST
|
||||
.2byte EFFECT_MEMENTO
|
||||
.2byte EFFECT_GRUDGE
|
||||
.2byte EFFECT_OVERHEAT
|
||||
.2byte -1
|
||||
|
||||
AI_HPAware_DiscouragedEffectsWhenMediumHP: @ 82DE22D
|
||||
.byte EFFECT_EXPLOSION
|
||||
|
@ -359,6 +359,7 @@ gBattleScriptsForMoveEffects:: @ 82D86A8
|
||||
.4byte BattleScript_EffectMindBlown
|
||||
.4byte BattleScript_EffectPurify
|
||||
.4byte BattleScript_EffectBurnUp
|
||||
.4byte BattleScript_EffectShoreUp
|
||||
|
||||
BattleScript_EffectBurnUp:
|
||||
attackcanceler
|
||||
@ -3734,6 +3735,7 @@ BattleScript_EffectSonicboom::
|
||||
BattleScript_EffectMorningSun::
|
||||
BattleScript_EffectSynthesis::
|
||||
BattleScript_EffectMoonlight::
|
||||
BattleScript_EffectShoreUp::
|
||||
attackcanceler
|
||||
attackstring
|
||||
ppreduce
|
||||
|
@ -347,5 +347,6 @@
|
||||
#define EFFECT_MIND_BLOWN 341
|
||||
#define EFFECT_PURIFY 342
|
||||
#define EFFECT_BURN_UP 343
|
||||
#define EFFECT_SHORE_UP 344
|
||||
|
||||
#endif // GUARD_CONSTANTS_BATTLE_MOVE_EFFECTS_H
|
||||
|
@ -10201,15 +10201,24 @@ static void Cmd_setdefensecurlbit(void)
|
||||
static void Cmd_recoverbasedonsunlight(void)
|
||||
{
|
||||
gBattlerTarget = gBattlerAttacker;
|
||||
|
||||
if (gBattleMons[gBattlerAttacker].hp != gBattleMons[gBattlerAttacker].maxHP)
|
||||
{
|
||||
if (gBattleWeather == 0 || !WEATHER_HAS_EFFECT)
|
||||
gBattleMoveDamage = gBattleMons[gBattlerAttacker].maxHP / 2;
|
||||
else if (gBattleWeather & WEATHER_SUN_ANY)
|
||||
gBattleMoveDamage = 20 * gBattleMons[gBattlerAttacker].maxHP / 30;
|
||||
else // not sunny weather
|
||||
gBattleMoveDamage = gBattleMons[gBattlerAttacker].maxHP / 4;
|
||||
if (gCurrentMove == MOVE_SHORE_UP)
|
||||
{
|
||||
if (WEATHER_HAS_EFFECT && gBattleWeather & WEATHER_SANDSTORM_ANY)
|
||||
gBattleMoveDamage = 20 * gBattleMons[gBattlerAttacker].maxHP / 30;
|
||||
else
|
||||
gBattleMoveDamage = gBattleMons[gBattlerAttacker].maxHP / 2;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!(gBattleWeather & WEATHER_ANY) || !WEATHER_HAS_EFFECT)
|
||||
gBattleMoveDamage = gBattleMons[gBattlerAttacker].maxHP / 2;
|
||||
else if (gBattleWeather & WEATHER_SUN_ANY)
|
||||
gBattleMoveDamage = 20 * gBattleMons[gBattlerAttacker].maxHP / 30;
|
||||
else // not sunny weather
|
||||
gBattleMoveDamage = gBattleMons[gBattlerAttacker].maxHP / 4;
|
||||
}
|
||||
|
||||
if (gBattleMoveDamage == 0)
|
||||
gBattleMoveDamage = 1;
|
||||
|
@ -8731,7 +8731,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] =
|
||||
|
||||
[MOVE_SHORE_UP] =
|
||||
{
|
||||
.effect = EFFECT_PLACEHOLDER,
|
||||
.effect = EFFECT_SHORE_UP,
|
||||
.power = 0,
|
||||
.type = TYPE_GROUND,
|
||||
.accuracy = 0,
|
||||
|
Loading…
Reference in New Issue
Block a user