diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml new file mode 100644 index 0000000000..244976ea1e --- /dev/null +++ b/.github/workflows/docs.yml @@ -0,0 +1,37 @@ +name: Docs +on: + push: + branches: + - master + +jobs: + deploy: + runs-on: ubuntu-latest + permissions: + contents: write + pages: write + id-token: write + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Install latest mdbook + run: | + tag=$(curl 'https://api.github.com/repos/rust-lang/mdbook/releases/latest' | jq -r '.tag_name') + url="https://github.com/rust-lang/mdbook/releases/download/${tag}/mdbook-${tag}-x86_64-unknown-linux-gnu.tar.gz" + mkdir mdbook + curl -sSL $url | tar -xz --directory=./mdbook + echo `pwd`/mdbook >> $GITHUB_PATH + - name: Build Book + run: | + cd docs + mdbook build + - name: Setup Pages + uses: actions/configure-pages@v4 + - name: Upload artifact + uses: actions/upload-pages-artifact@v3 + with: + path: 'docs/book' + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 diff --git a/INSTALL.md b/INSTALL.md index 3f2de7ca5f..fe8ea2e391 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -215,9 +215,9 @@ Note that in msys2, Copy is Ctrl+Insert and Paste is Shift+Insert. To install Python on msys2, simply run the following commands: - ```bash - pacman -S mingw-w64-x86_64-python3 - ``` +```bash +pacman -S mingw-w64-x86_64-python3 +``` Python is now installed. @@ -592,7 +592,8 @@ Note that this is not necessary for a non-modern (agbcc) build since those are b
Deprecated; installing agbcc is optional since 1.7.0. -2. Install agbcc into pokeemerald-expansion. The commands to run depend on certain conditions. **You should only follow one of the listed instructions**: + +1. Install agbcc into pokeemerald-expansion. The commands to run depend on certain conditions. **You should only follow one of the listed instructions**: - If agbcc has **not been built before** in the folder where you chose to store pokeemerald Expansion, run the following commands to build and install it into pokeemerald-expansion: ```bash @@ -621,18 +622,20 @@ Note that this is not necessary for a non-modern (agbcc) build since those are b
Note... - > If building agbcc or pokeemerald results in an error, try deleting the agbcc folder and re-installing agbcc as if it has not been built before. + > If building agbcc or pokeemerald results in an error, try deleting the agbcc folder and re-installing agbcc as if it has not been built before.
-3. Once agbcc is installed, change directory back to the base directory where pokeemerald-expansion and agbcc are stored: +2. Once agbcc is installed, change directory back to the base directory where pokeemerald-expansion and agbcc are stored: ```bash cd .. ``` - -4. To compile with agbcc: - ```make agbcc``` +3. To compile with agbcc: + + ```bash + make agbcc + ```
diff --git a/Makefile b/Makefile index fffc03dfc6..cf11e3a255 100644 --- a/Makefile +++ b/Makefile @@ -86,10 +86,13 @@ ELF = $(ROM:.gba=.elf) MAP = $(ROM:.gba=.map) SYM = $(ROM:.gba=.sym) +TEST_OBJ_DIR_NAME_MODERN := build/modern-test +TEST_OBJ_DIR_NAME_AGBCC := build/test + ifeq ($(MODERN),0) -TEST_OBJ_DIR_NAME := build/test +TEST_OBJ_DIR_NAME := $(TEST_OBJ_DIR_NAME_AGBCC) else -TEST_OBJ_DIR_NAME := build/modern-test +TEST_OBJ_DIR_NAME := $(TEST_OBJ_DIR_NAME_MODERN) endif TESTELF = $(ROM:.gba=-test.elf) HEADLESSELF = $(ROM:.gba=-test-headless.elf) @@ -310,7 +313,9 @@ tidymodern: tidycheck: rm -f $(TESTELF) $(HEADLESSELF) - rm -rf $(TEST_OBJ_DIR_NAME) + rm -rf $(TEST_OBJ_DIR_NAME_MODERN) + rm -rf $(TEST_OBJ_DIR_NAME_AGBCC) + ifneq ($(MODERN),0) $(C_BUILDDIR)/berry_crush.o: override CFLAGS += -Wno-address-of-packed-member diff --git a/README.md b/README.md index c567cd72d0..18b497a212 100644 --- a/README.md +++ b/README.md @@ -14,11 +14,11 @@ Based off RHH's pokeemerald-expansion v1.8.0 https://github.com/rh-hideout/pokee ## What features are included? - ***IMPORTANT*❗❗ Read through these to learn what features you can toggle**: - - [Battle configurations](include/config/battle.h) - - [Pokémon configurations](include/config/pokemon.h) - - [Item configurations](include/config/item.h) - - [Overworld configurations](include/config/overworld.h) - - [Debug configurations](include/config/debug.h) + - [Battle configurations](https://github.com/rh-hideout/pokeemerald-expansion/blob/master/include/config/battle.h) + - [Pokémon configurations](https://github.com/rh-hideout/pokeemerald-expansion/blob/master/include/config/pokemon.h) + - [Item configurations](https://github.com/rh-hideout/pokeemerald-expansion/blob/master/include/config/item.h) + - [Overworld configurations](https://github.com/rh-hideout/pokeemerald-expansion/blob/master/include/config/overworld.h) + - [Debug configurations](https://github.com/rh-hideout/pokeemerald-expansion/blob/master/include/config/debug.h) - ***Upgraded battle engine.*** - Gen5+ damage calculation. - 2v2 Wild battles support. @@ -62,7 +62,7 @@ Based off RHH's pokeemerald-expansion v1.8.0 https://github.com/rh-hideout/pokee - Recalculating stats at the end of every battle. - Level 100 Pokémon can earn EVs. - Inverse battle support. - - TONS of other features listed [here](include/config/battle.h). + - TONS of other features listed [here](https://github.com/rh-hideout/pokeemerald-expansion/blob/master/include/config/battle.h). - ***Full Trainer customization*** - Nickname, EVs, IVs, moves, ability, ball, friendship, nature, gender, shininess. - Custom tag battle support (teaming up an NPC in a double battle). @@ -94,7 +94,7 @@ Based off RHH's pokeemerald-expansion v1.8.0 https://github.com/rh-hideout/pokee - All gender differences. - Custom female icons for female Hippopotas Hippowdon, Pikachu and Wobbufett - 3 Perfect IVs on Legendaries, Mythicals and Ultra Beasts. -- ***Customizable form change tables. Full list of methods [here](include/constants/form_change_types.h).*** +- ***Customizable form change tables. Full list of methods [here](https://github.com/rh-hideout/pokeemerald-expansion/blob/master/include/constants/form_change_types.h).*** - Item holding (eg. Giratina/Arceus) - Item using (eg. Oricorio) - Time of day option for Shaymin @@ -115,7 +115,7 @@ Based off RHH's pokeemerald-expansion v1.8.0 https://github.com/rh-hideout/pokee - Egg Move Transfer, including Mirror Herb (configurable). - Nature inheriting 100% of the time with Everstone (configurable) - Gen6+ Ability inheriting (configurable). -- ***Items from newer Generations. Full list [here](include/constants/items.h).*** +- ***Items from newer Generations. Full list [here](https://github.com/rh-hideout/pokeemerald-expansion/blob/master/include/constants/items.h).*** - ***Gen 6+ Exp. Share*** (configurable) - Berserk Gene - Most battle items from Gen 4+ diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index 291344eabc..32049c38b9 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -1819,6 +1819,7 @@ BattleScript_EffectHitSwitchTarget:: tryfaintmon BS_TARGET jumpiffainted BS_TARGET, TRUE, BattleScript_MoveEnd jumpifability BS_TARGET, ABILITY_SUCTION_CUPS, BattleScript_AbilityPreventsPhasingOut + jumpifability BS_TARGET, ABILITY_GUARD_DOG, BattleScript_MoveEnd jumpifstatus3 BS_TARGET, STATUS3_ROOTED, BattleScript_PrintMonIsRooted jumpiftargetdynamaxed BattleScript_HitSwitchTargetDynamaxed tryhitswitchtarget BattleScript_MoveEnd @@ -2765,12 +2766,11 @@ BattleScript_EffectHealBlock:: BattleScript_EffectHitEscape:: call BattleScript_EffectHit_Ret jumpifmovehadnoeffect BattleScript_MoveEnd - jumpifability BS_TARGET, ABILITY_GUARD_DOG, BattleScript_MoveEnd tryfaintmon BS_TARGET moveendto MOVEEND_ATTACKER_VISIBLE moveendfrom MOVEEND_TARGET_VISIBLE jumpifbattleend BattleScript_HitEscapeEnd - jumpifbyte CMP_NOT_EQUAL gBattleOutcome 0, BattleScript_HitEscapeEnd + jumpifbyte CMP_NOT_EQUAL, gBattleOutcome, 0, BattleScript_HitEscapeEnd jumpifemergencyexited BS_TARGET, BattleScript_HitEscapeEnd goto BattleScript_MoveSwitch BattleScript_HitEscapeEnd: diff --git a/docs/.gitignore b/docs/.gitignore new file mode 100644 index 0000000000..7585238efe --- /dev/null +++ b/docs/.gitignore @@ -0,0 +1 @@ +book diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md new file mode 100644 index 0000000000..bdde652d31 --- /dev/null +++ b/docs/CHANGELOG.md @@ -0,0 +1 @@ +{{#include ../CHANGELOG.md}} diff --git a/docs/INSTALL.md b/docs/INSTALL.md new file mode 100644 index 0000000000..610fee2cc1 --- /dev/null +++ b/docs/INSTALL.md @@ -0,0 +1 @@ +{{#include ../INSTALL.md}} diff --git a/docs/README.md b/docs/README.md new file mode 100644 index 0000000000..dae3167208 --- /dev/null +++ b/docs/README.md @@ -0,0 +1 @@ +{{#include ../README.md}} diff --git a/docs/SUMMARY.md b/docs/SUMMARY.md new file mode 100644 index 0000000000..8e19e46c60 --- /dev/null +++ b/docs/SUMMARY.md @@ -0,0 +1,52 @@ +# Summary + +- [README](./README.md) +- [Installation](./INSTALL.md) + - [Setting up WSL1 (Legacy Portion)](./legacy_WSL1_INSTALL.md) +- [Changelog](./CHANGELOG.md) + - [1.8.x]() + - [Version 1.8.4](changelogs/1.8.x/1.8.4.md) + - [Version 1.8.3](changelogs/1.8.x/1.8.3.md) + - [Version 1.8.2](changelogs/1.8.x/1.8.2.md) + - [Version 1.8.1](changelogs/1.8.x/1.8.1.md) + - [Version 1.8.0](changelogs/1.8.x/1.8.0.md) + + - [1.7.x]() + - [Version 1.7.4](changelogs/1.7.x/1.7.4.md) + - [Version 1.7.3](changelogs/1.7.x/1.7.3.md) + - [Version 1.7.2](changelogs/1.7.x/1.7.2.md) + - [Version 1.7.1](changelogs/1.7.x/1.7.1.md) + - [Version 1.7.0](changelogs/1.7.x/1.7.0.md) + + - [1.6.x]() + - [Version 1.6.2](changelogs/1.6.x/1.6.2.md) + - [Version 1.6.1](changelogs/1.6.x/1.6.1.md) + - [Version 1.6.0](changelogs/1.6.x/1.6.0.md) + + - [1.5.x]() + - [Version 1.5.3](changelogs/1.5.x/1.5.3.md) + - [Version 1.5.2](changelogs/1.5.x/1.5.2.md) + - [Version 1.5.1](changelogs/1.5.x/1.5.1.md) + - [Version 1.5.0](changelogs/1.5.x/1.5.0.md) + + - [1.4.x]() + - [Version 1.4.3](changelogs/1.4.x/1.4.3.md) + - [Version 1.4.2](changelogs/1.4.x/1.4.2.md) + - [Version 1.4.1](changelogs/1.4.x/1.4.1.md) + - [Version 1.4.0](changelogs/1.4.x/1.4.0.md) + + - [1.3.x]() + - [Version 1.3.0](changelogs/1.3.x/1.3.0.md) + + - [1.2.x]() + - [Version 1.2.0](changelogs/1.2.x/1.2.0.md) + + - [1.1.x]() + - [Version 1.1.1](changelogs/1.1.x/1.1.1.md) + - [Version 1.1.0](changelogs/1.1.x/1.1.0.md) + + - [1.0.x]() + - [Version 1.0.0](changelogs/1.0.x/1.0.0.md) + + - [Pre-1.0.x]() + - [Version 0.9.0](changelogs/0.9.x/0.9.0.md) diff --git a/docs/book.toml b/docs/book.toml new file mode 100644 index 0000000000..3282d8c8e7 --- /dev/null +++ b/docs/book.toml @@ -0,0 +1,14 @@ +[book] +language = "en" +multilingual = false +src = "." +title = "pokeemerald-expansion" + +[output.html] +git-repository-url = "https://github.com/rh-hideout/pokeemerald-expansion" +edit-url-template = "https://github.com/rh-hideout/pokeemerald-expansion/edit/master/docs/{path}" +site-url = "/pokeemerald-expansion/" + +[preprocessor.fix_links] +command = "python3 fix_links.py" +after = [ "links" ] diff --git a/docs/fix_links.py b/docs/fix_links.py new file mode 100644 index 0000000000..6e2eaec485 --- /dev/null +++ b/docs/fix_links.py @@ -0,0 +1,51 @@ +# workarounds to avoid changing current directory structure +# autolink logic based on https://github.com/zopieux/py-gfm/blob/fd7b33ed138d240d24dfb659acff7d4ce3f43745/gfm/autolink.py + +import json +import sys +import re + +URL_RE = re.compile( + r"(```(?s:.)+?```|`.+?`|<.+?>)|" + r"\b((?:(?i:ftp|https?)://|(?i:www)\d{0,3}[.])(?:[^\s()<>]+|" + r"\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()" + r"<>]+\)))*\)|[^\s`!()\[\]{};:" + r"'" + r'".,<>?«»“”‘’*]))' +) +PROTOCOL_RE = re.compile(r"^(?i:ftp|https?)://") + +ANCHOR_RE = re.compile(r"(\]\((?:[^)#]+\.md)?#)([^)]+\))") + +def handle_url(m): + code = m.group(1) + if code: + return code + href = m.group(2) + if not PROTOCOL_RE.match(href): + href = "http://%s" % href + return f'<{href}>' + +def handle_anchor(m): + page = m.group(1) + anchor = m.group(2) + return page + anchor.lower() + +def proc_items(items): + for item in items: + if 'Chapter' in item: + s = item['Chapter']['content'] + s = s.replace('](README.md)', '](./)') + s = s.replace('](/INSTALL.md', '](INSTALL.md') + s = s.replace('](docs/', '](') + s = URL_RE.sub(handle_url, s) + item['Chapter']['content'] = ANCHOR_RE.sub(handle_anchor, s) + proc_items(item['Chapter']['sub_items']) + +if __name__ == '__main__': + if len(sys.argv) > 1: + if sys.argv[1] == "supports": + sys.exit(0) + + context, book = json.load(sys.stdin) + proc_items(book['sections']) + + print(json.dumps(book)) diff --git a/docs/legacy_WSL1_INSTALL.md b/docs/legacy_WSL1_INSTALL.md index 7d40960f3b..bdef4d116b 100644 --- a/docs/legacy_WSL1_INSTALL.md +++ b/docs/legacy_WSL1_INSTALL.md @@ -38,4 +38,4 @@ source /etc/profile.d/devkit-env.sh ``` -Proceed to [Choosing where to store pokeemerald (WSL1) of the current INSTALL.md](/INSTALL.md#choosing-where-to-store-pokeemerald-WSL1). +Proceed to [Choosing where to store pokeemerald (WSL1) of the current INSTALL.md](/INSTALL.md#choosing-where-to-store-pokeemerald-expansion-WSL1). diff --git a/graphics/pokemon/okidogi/back.png b/graphics/pokemon/okidogi/back.png index 5a1e7fb523..4d4772eba0 100644 Binary files a/graphics/pokemon/okidogi/back.png and b/graphics/pokemon/okidogi/back.png differ diff --git a/graphics/pokemon/okidogi/front.png b/graphics/pokemon/okidogi/front.png index a6b0a62f0e..8ee3db7a09 100644 Binary files a/graphics/pokemon/okidogi/front.png and b/graphics/pokemon/okidogi/front.png differ diff --git a/graphics/pokemon/okidogi/normal.pal b/graphics/pokemon/okidogi/normal.pal index 9f256a4a5b..180476ed11 100644 --- a/graphics/pokemon/okidogi/normal.pal +++ b/graphics/pokemon/okidogi/normal.pal @@ -1,18 +1,17 @@ JASC-PAL 0100 -15 -152 208 160 -16 16 16 -90 33 73 -45 45 45 -78 73 71 -202 103 162 -146 57 119 -26 29 28 -121 167 58 -84 117 53 -184 140 7 -254 208 27 -249 249 249 +14 +153 211 165 +28 28 28 29 57 21 +45 45 45 +84 117 53 +90 33 73 +78 73 71 +146 57 119 +121 167 58 +254 208 27 +205 80 156 153 157 166 +16 16 16 +249 249 249 diff --git a/graphics/pokemon/okidogi/shiny.pal b/graphics/pokemon/okidogi/shiny.pal index d239ae218f..e860329bf8 100644 --- a/graphics/pokemon/okidogi/shiny.pal +++ b/graphics/pokemon/okidogi/shiny.pal @@ -1,18 +1,17 @@ JASC-PAL 0100 -15 -152 208 160 -16 16 16 -90 33 73 -140 49 12 -207 71 17 -202 103 162 -146 57 119 -26 29 28 -121 167 58 -84 117 53 -184 140 7 -254 208 27 -249 249 249 +14 +153 211 165 +122 50 46 29 57 21 +188 99 61 +84 117 53 +90 33 73 +254 153 96 +146 57 119 +121 167 58 +254 208 27 +205 80 156 153 157 166 +16 16 16 +249 249 249 diff --git a/graphics/pokemon/pawmi/back.png b/graphics/pokemon/pawmi/back.png index c5d59e6677..2e4fd1aa05 100644 Binary files a/graphics/pokemon/pawmi/back.png and b/graphics/pokemon/pawmi/back.png differ diff --git a/graphics/pokemon/pawmi/front.png b/graphics/pokemon/pawmi/front.png index 265a9c7173..5fdef077d5 100644 Binary files a/graphics/pokemon/pawmi/front.png and b/graphics/pokemon/pawmi/front.png differ diff --git a/graphics/pokemon/pawmi/normal.pal b/graphics/pokemon/pawmi/normal.pal index 822fa530da..4d3858d79f 100644 --- a/graphics/pokemon/pawmi/normal.pal +++ b/graphics/pokemon/pawmi/normal.pal @@ -1,19 +1,18 @@ JASC-PAL 0100 -16 -153 210 164 -150 79 14 -243 156 78 +15 +153 211 165 96 51 23 +52 52 65 +19 121 123 +150 79 14 126 114 71 -194 89 3 +211 97 3 +235 120 35 +255 205 32 +189 162 115 +243 156 78 +16 16 16 189 162 115 244 226 188 -15 15 15 -235 120 35 -46 116 82 -211 97 3 -52 52 65 252 252 252 -197 164 98 -255 205 32 diff --git a/graphics/pokemon/pawmi/shiny.pal b/graphics/pokemon/pawmi/shiny.pal index 02d4ae6d00..4a32c00443 100644 --- a/graphics/pokemon/pawmi/shiny.pal +++ b/graphics/pokemon/pawmi/shiny.pal @@ -1,19 +1,18 @@ JASC-PAL 0100 -16 -153 210 164 -220 58 50 -255 155 172 -96 51 23 -139 83 58 -194 89 3 -228 167 137 -244 226 188 -15 15 15 -255 119 147 -46 116 82 -237 82 82 +15 +153 211 165 +101 29 39 52 52 65 -252 252 252 -221 177 74 +19 121 123 +165 46 63 +173 124 103 +214 79 87 +242 112 116 255 205 32 +197 164 98 +251 142 158 +16 16 16 +222 194 165 +252 235 186 +252 252 252 diff --git a/graphics/pokemon/pawmo/back.png b/graphics/pokemon/pawmo/back.png index 42d151758a..348b8fa8da 100644 Binary files a/graphics/pokemon/pawmo/back.png and b/graphics/pokemon/pawmo/back.png differ diff --git a/graphics/pokemon/pawmo/front.png b/graphics/pokemon/pawmo/front.png index 9a01396050..a92b86a880 100644 Binary files a/graphics/pokemon/pawmo/front.png and b/graphics/pokemon/pawmo/front.png differ diff --git a/graphics/pokemon/pawmo/normal.pal b/graphics/pokemon/pawmo/normal.pal index 8a6a2121c5..dd35ba4e06 100644 --- a/graphics/pokemon/pawmo/normal.pal +++ b/graphics/pokemon/pawmo/normal.pal @@ -1,18 +1,17 @@ JASC-PAL 0100 -15 -152 208 160 -136 64 0 -0 0 0 -240 184 72 -16 104 96 -232 152 0 -0 160 144 -176 112 8 -248 232 184 -216 192 160 -88 64 48 -255 255 255 -240 208 56 -168 64 32 -232 72 56 +14 +153 211 165 +111 75 49 +52 52 65 +19 121 123 +141 100 71 +189 130 64 +213 154 79 +214 177 67 +255 216 80 +255 192 96 +202 180 142 +16 16 16 +255 237 192 +255 250 254 diff --git a/graphics/pokemon/pawmo/shiny.pal b/graphics/pokemon/pawmo/shiny.pal index 3022ea1e04..bae5fb5173 100644 --- a/graphics/pokemon/pawmo/shiny.pal +++ b/graphics/pokemon/pawmo/shiny.pal @@ -1,18 +1,17 @@ JASC-PAL 0100 -15 -152 208 160 -136 64 0 -0 0 0 -245 158 128 -16 104 96 -242 112 116 -0 186 182 -214 79 87 -248 232 184 -216 192 160 -88 64 48 -255 255 255 -240 208 56 -168 64 32 -232 72 56 +14 +153 211 165 +132 66 101 +52 52 65 +19 121 123 +173 124 103 +192 105 142 +217 138 162 +214 177 67 +255 216 80 +251 164 179 +222 194 165 +16 16 16 +255 237 192 +255 250 254 diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index 6e55da104d..40038aa951 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -1875,7 +1875,7 @@ s32 CalcCritChanceStageArgs(u32 battlerAtk, u32 battlerDef, u32 move, bool32 rec critChance = -1; } else if (gStatuses3[battlerAtk] & STATUS3_LASER_FOCUS - || gMovesInfo[gCurrentMove].alwaysCriticalHit + || gMovesInfo[move].alwaysCriticalHit || (abilityAtk == ABILITY_MERCILESS && gBattleMons[battlerDef].status1 & STATUS1_PSN_ANY)) { critChance = -2; @@ -1884,7 +1884,7 @@ s32 CalcCritChanceStageArgs(u32 battlerAtk, u32 battlerDef, u32 move, bool32 rec { critChance = 2 * ((gBattleMons[battlerAtk].status2 & STATUS2_FOCUS_ENERGY) != 0) + 1 * ((gBattleMons[battlerAtk].status2 & STATUS2_DRAGON_CHEER) != 0) - + gMovesInfo[gCurrentMove].criticalHitStage + + gMovesInfo[move].criticalHitStage + (holdEffectAtk == HOLD_EFFECT_SCOPE_LENS) + 2 * (holdEffectAtk == HOLD_EFFECT_LUCKY_PUNCH && gBattleMons[battlerAtk].species == SPECIES_CHANSEY) + 2 * BENEFITS_FROM_LEEK(battlerAtk, holdEffectAtk) @@ -3305,7 +3305,10 @@ void SetMoveEffect(bool32 primary, bool32 certain) case MOVE_EFFECT_SP_DEF_MINUS_1: case MOVE_EFFECT_ACC_MINUS_1: case MOVE_EFFECT_EVS_MINUS_1: - flags = affectsUser; + if (affectsUser == MOVE_EFFECT_AFFECTS_USER) + flags = MOVE_EFFECT_AFFECTS_USER | MOVE_EFFECT_CERTAIN; + else + flags = 0; if (mirrorArmorReflected) flags |= (STAT_CHANGE_ALLOW_PTR * !affectsUser); else @@ -3355,7 +3358,10 @@ void SetMoveEffect(bool32 primary, bool32 certain) case MOVE_EFFECT_SP_DEF_MINUS_2: case MOVE_EFFECT_ACC_MINUS_2: case MOVE_EFFECT_EVS_MINUS_2: - flags = affectsUser; + if (affectsUser == MOVE_EFFECT_AFFECTS_USER) + flags = MOVE_EFFECT_AFFECTS_USER | MOVE_EFFECT_CERTAIN; + else + flags = 0; if (mirrorArmorReflected && !affectsUser) flags |= STAT_CHANGE_ALLOW_PTR; if (ChangeStatBuffs(SET_STAT_BUFF_VALUE(2) | STAT_BUFF_NEGATIVE, diff --git a/src/data/pokemon/species_info/gen_9_families.h b/src/data/pokemon/species_info/gen_9_families.h index 971971f8da..912496c210 100644 --- a/src/data/pokemon/species_info/gen_9_families.h +++ b/src/data/pokemon/species_info/gen_9_families.h @@ -906,7 +906,7 @@ const struct SpeciesInfo gSpeciesInfoGen9[] = //.frontAnimId = ANIM_V_SQUISH_AND_BOUNCE, .backPic = gMonBackPic_Pawmi, .backPicSize = MON_COORDS_SIZE(64, 64), - .backPicYOffset = 0, + .backPicYOffset = 7, //.backAnimId = BACK_ANIM_NONE, .palette = gMonPalette_Pawmi, .shinyPalette = gMonShinyPalette_Pawmi, @@ -960,7 +960,7 @@ const struct SpeciesInfo gSpeciesInfoGen9[] = //.frontAnimId = ANIM_V_SQUISH_AND_BOUNCE, .backPic = gMonBackPic_Pawmo, .backPicSize = MON_COORDS_SIZE(64, 64), - .backPicYOffset = 4, + .backPicYOffset = 6, //.backAnimId = BACK_ANIM_NONE, .palette = gMonPalette_Pawmo, .shinyPalette = gMonShinyPalette_Pawmo, @@ -6172,12 +6172,12 @@ const struct SpeciesInfo gSpeciesInfoGen9[] = .trainerOffset = 0, .frontPic = gMonFrontPic_Okidogi, .frontPicSize = MON_COORDS_SIZE(64, 64), - .frontPicYOffset = 1, + .frontPicYOffset = 2, .frontAnimFrames = sAnims_Okidogi, //.frontAnimId = ANIM_V_SQUISH_AND_BOUNCE, .backPic = gMonBackPic_Okidogi, .backPicSize = MON_COORDS_SIZE(64, 64), - .backPicYOffset = 16, + .backPicYOffset = 12, //.backAnimId = BACK_ANIM_NONE, .palette = gMonPalette_Okidogi, .shinyPalette = gMonShinyPalette_Okidogi, diff --git a/src/daycare.c b/src/daycare.c index 8af8367400..02bd889b94 100644 --- a/src/daycare.c +++ b/src/daycare.c @@ -695,7 +695,7 @@ static void InheritPokeball(struct Pokemon *egg, struct BoxPokemon *father, stru if (P_BALL_INHERITING >= GEN_7) { - if (fatherSpecies == motherSpecies) + if (GET_BASE_SPECIES_ID(fatherSpecies) == GET_BASE_SPECIES_ID(motherSpecies)) inheritBall = (Random() % 2 == 0 ? motherBall : fatherBall); else if (motherSpecies != SPECIES_DITTO) inheritBall = motherBall; @@ -986,7 +986,8 @@ static u16 DetermineEggSpeciesAndParentSlots(struct DayCare *daycare, u8 *parent { u16 i; u16 species[DAYCARE_MON_COUNT]; - u16 eggSpecies; + u16 eggSpecies, parentSpecies; + bool8 hasMotherEverstone, hasFatherEverstone; for (i = 0; i < DAYCARE_MON_COUNT; i++) { @@ -1003,7 +1004,18 @@ static u16 DetermineEggSpeciesAndParentSlots(struct DayCare *daycare, u8 *parent } } - eggSpecies = GetEggSpecies(species[parentSlots[0]]); + hasMotherEverstone = ItemId_GetHoldEffect(GetBoxMonData(&daycare->mons[0].mon, MON_DATA_HELD_ITEM)) == HOLD_EFFECT_PREVENT_EVOLVE; + hasFatherEverstone = ItemId_GetHoldEffect(GetBoxMonData(&daycare->mons[1].mon, MON_DATA_HELD_ITEM)) == HOLD_EFFECT_PREVENT_EVOLVE; + + if (hasMotherEverstone) + parentSpecies = species[parentSlots[0]]; + else if (hasFatherEverstone && GET_BASE_SPECIES_ID(GetEggSpecies(species[parentSlots[0]])) == GET_BASE_SPECIES_ID(GetEggSpecies(species[parentSlots[1]]))) + parentSpecies = species[parentSlots[1]]; + else + parentSpecies = GET_BASE_SPECIES_ID(GetEggSpecies(species[parentSlots[0]])); + + eggSpecies = GetEggSpecies(parentSpecies); + if (eggSpecies == SPECIES_NIDORAN_F && daycare->offspringPersonality & EGG_GENDER_MALE) eggSpecies = SPECIES_NIDORAN_M; else if (eggSpecies == SPECIES_ILLUMISE && daycare->offspringPersonality & EGG_GENDER_MALE) diff --git a/src/egg_hatch.c b/src/egg_hatch.c index beb6ba40c4..88f2b329e9 100644 --- a/src/egg_hatch.c +++ b/src/egg_hatch.c @@ -314,7 +314,7 @@ static void CreateHatchedMon(struct Pokemon *egg, struct Pokemon *temp) { u16 species; u32 personality, pokerus; - u8 i, friendship, language, gameMet, markings, isModernFatefulEncounter; + u8 i, friendship, language, gameMet, markings, isModernFatefulEncounter, ball; u16 moves[MAX_MON_MOVES]; u32 ivs[NUM_STATS]; @@ -334,6 +334,7 @@ static void CreateHatchedMon(struct Pokemon *egg, struct Pokemon *temp) markings = GetMonData(egg, MON_DATA_MARKINGS); pokerus = GetMonData(egg, MON_DATA_POKERUS); isModernFatefulEncounter = GetMonData(egg, MON_DATA_MODERN_FATEFUL_ENCOUNTER); + ball = GetMonData(egg, MON_DATA_POKEBALL); CreateMon(temp, species, EGG_HATCH_LEVEL, USE_RANDOM_IVS, TRUE, personality, OT_ID_PLAYER_ID, 0); @@ -352,6 +353,7 @@ static void CreateHatchedMon(struct Pokemon *egg, struct Pokemon *temp) SetMonData(temp, MON_DATA_FRIENDSHIP, &friendship); SetMonData(temp, MON_DATA_POKERUS, &pokerus); SetMonData(temp, MON_DATA_MODERN_FATEFUL_ENCOUNTER, &isModernFatefulEncounter); + SetMonData(temp, MON_DATA_POKEBALL, &ball); *egg = *temp; } diff --git a/src/item_use.c b/src/item_use.c index 824b308524..502612a184 100644 --- a/src/item_use.c +++ b/src/item_use.c @@ -1041,14 +1041,10 @@ static void ItemUseOnFieldCB_EscapeRope(u8 taskId) { Overworld_ResetStateAfterDigEscRope(); if (I_KEY_ESCAPE_ROPE < GEN_8) - { - RemoveUsedItem(); - } - else - { - CopyItemName(gSpecialVar_ItemId, gStringVar2); - StringExpandPlaceholders(gStringVar4, gText_PlayerUsedVar2); - } + RemoveBagItem(gSpecialVar_ItemId, 1); + + CopyItemName(gSpecialVar_ItemId, gStringVar2); + StringExpandPlaceholders(gStringVar4, gText_PlayerUsedVar2); gTasks[taskId].data[0] = 0; DisplayItemMessageOnField(taskId, gStringVar4, Task_UseDigEscapeRopeOnField); } @@ -1422,7 +1418,9 @@ void Task_UseHoneyOnField(u8 taskId) static void ItemUseOnFieldCB_Honey(u8 taskId) { Overworld_ResetStateAfterDigEscRope(); - RemoveUsedItem(); + RemoveBagItem(gSpecialVar_ItemId, 1); + CopyItemName(gSpecialVar_ItemId, gStringVar2); + StringExpandPlaceholders(gStringVar4, gText_PlayerUsedVar2); gTasks[taskId].data[0] = 0; DisplayItemMessageOnField(taskId, gStringVar4, Task_UseHoneyOnField); } diff --git a/test/species.c b/test/species.c index 986fdbb14f..3755f97f5c 100644 --- a/test/species.c +++ b/test/species.c @@ -7,6 +7,7 @@ TEST("Form species ID tables are shared between all forms") u32 i; u32 species = SPECIES_NONE; const u16 *formSpeciesIdTable; + for (i = 0; i < NUM_SPECIES; i++) { if (gSpeciesInfo[i].formSpeciesIdTable) @@ -29,6 +30,7 @@ TEST("Form change tables contain only forms in the form species ID table") u32 species = SPECIES_NONE; const struct FormChange *formChangeTable; const u16 *formSpeciesIdTable; + for (i = 0; i < NUM_SPECIES; i++) { if (gSpeciesInfo[i].formChangeTable) @@ -61,6 +63,7 @@ TEST("Form change targets have the appropriate species flags") u32 i; u32 species = SPECIES_NONE; const struct FormChange *formChangeTable; + for (i = 0; i < NUM_SPECIES; i++) { if (gSpeciesInfo[i].formChangeTable) diff --git a/test/test_runner.c b/test/test_runner.c index 27fa623836..c1a5d33b41 100644 --- a/test/test_runner.c +++ b/test/test_runner.c @@ -670,7 +670,11 @@ static s32 MgbaVPrintf_(const char *fmt, va_list va) /* Entry point for the Debugging and Control System. Handles illegal * instructions, which are typically caused by branching to an invalid * address. */ +#if MODERN __attribute__((naked, section(".dacs"), target("arm"))) +#else +__attribute__((naked, section(".dacs"))) +#endif void DACSEntry(void) { asm(".arm\n\