mirror of https://github.com/pret/pokeemerald.git
Updated How to add a new ability (markdown)
parent
5fc4c2e7d0
commit
435a568098
|
@ -139,29 +139,9 @@ Edit [include/constants/battle.h](../blob/master/include/constants/battle.h):
|
|||
We've defined a bit for permanent hail, so we need to ensure that existing references to hail are correctly updated. Edit [src/battle_script_commands.c](../blob/master/src/battle_script_commands.c):
|
||||
|
||||
```diff
|
||||
static void Cmd_weatherdamage(void)
|
||||
{
|
||||
...
|
||||
- if (gBattleWeather & WEATHER_HAIL)
|
||||
+ if (gBattleWeather & WEATHER_HAIL_ANY)
|
||||
{
|
||||
if (!IS_BATTLER_OF_TYPE(gBattlerAttacker, TYPE_ICE)
|
||||
&& !(gStatuses3[gBattlerAttacker] & STATUS3_UNDERGROUND)
|
||||
&& !(gStatuses3[gBattlerAttacker] & STATUS3_UNDERWATER))
|
||||
{
|
||||
gBattleMoveDamage = gBattleMons[gBattlerAttacker].maxHP / 16;
|
||||
if (gBattleMoveDamage == 0)
|
||||
gBattleMoveDamage = 1;
|
||||
}
|
||||
...
|
||||
}
|
||||
|
||||
...
|
||||
|
||||
static void Cmd_sethail(void)
|
||||
{
|
||||
- if (gBattleWeather & WEATHER_HAIL)
|
||||
+ if (gBattleWeather & WEATHER_HAIL_ANY)
|
||||
if (gBattleWeather & WEATHER_HAIL_ANY)
|
||||
{
|
||||
gMoveResultFlags |= MOVE_RESULT_MISSED;
|
||||
gBattleCommunication[MULTISTRING_CHOOSER] = 2;
|
||||
|
@ -210,20 +190,6 @@ u8 DoFieldEndTurnEffects(void)
|
|||
}
|
||||
```
|
||||
|
||||
And [src/pokemon.c](../blob/master/src/pokemon.c):
|
||||
|
||||
```diff
|
||||
s32 CalculateBaseDamage(struct BattlePokemon *attacker, struct BattlePokemon *defender, u32 move, u16 sideStatus, u16 powerOverride, u8 typeOverride, u8 battlerIdAtk, u8 battlerIdDef)
|
||||
{
|
||||
...
|
||||
// any weather except sun weakens solar beam
|
||||
- if ((gBattleWeather & (WEATHER_RAIN_ANY | WEATHER_SANDSTORM_ANY | WEATHER_HAIL)) && gCurrentMove == MOVE_SOLAR_BEAM)
|
||||
+ if ((gBattleWeather & (WEATHER_RAIN_ANY | WEATHER_SANDSTORM_ANY | WEATHER_HAIL_ANY)) && gCurrentMove == MOVE_SOLAR_BEAM)
|
||||
damage /= 2;
|
||||
...
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
### ii. Add a new battle script
|
||||
|
||||
|
|
Loading…
Reference in New Issue