From 435a56809843bf1faa8ca8c6e0dcfbea3cd2866d Mon Sep 17 00:00:00 2001 From: Thomas Winwood Date: Wed, 20 Nov 2019 16:52:34 +0000 Subject: [PATCH] Updated How to add a new ability (markdown) --- How-to-add-a-new-ability.md | 36 +----------------------------------- 1 file changed, 1 insertion(+), 35 deletions(-) diff --git a/How-to-add-a-new-ability.md b/How-to-add-a-new-ability.md index a9c7965..a23c301 100644 --- a/How-to-add-a-new-ability.md +++ b/How-to-add-a-new-ability.md @@ -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