Commit graph

5948 commits

Author SHA1 Message Date
Martin Griffin
311d732359
Save-compatible SaveBlock3 (#4112)
* SaveBlock3 in sector footers

* Update load_save.c

Since mgriffin is currently not available I took the liberty to edit the file. Hope it's fine.

* SaveBlock3 in debug menu (#3)

---------

Co-authored-by: DizzyEggg <jajkodizzy@wp.pl>
Co-authored-by: Alex <93446519+AlexOn1ine@users.noreply.github.com>
Co-authored-by: psf <77138753+pkmnsnfrn@users.noreply.github.com>
2024-02-10 18:14:36 +01:00
MartyKen
81fdfdd90b
PLA aux item sprites (#4160)
* PLA aux item sprites

* Sprite sharing
2024-02-10 18:08:09 +01:00
Eduardo Quezada D'Ottone
af95a09961
Last Respects effect + Fixed Supreme Overlord (#4151)
* Last Respects effect + Fixed Supreme Overlord

* Fixed ability pop-up happening when there's no fainted party members

* Fixed Supreme Overlord counting faints during the battle instead of fainted party

* Removed invalid test.

* Converted GetSupremeOverlordModifier to an inline function

* Created inline functions to obtain faint counters

* Fixed erroneous implemenation and tests
2024-02-10 10:58:41 +01:00
Eduardo Quezada
67f1772f1e Merge branch '_RHH/master' into _RHH/upcoming
# Conflicts:
#	src/battle_util.c
#	test/battle/item_effect/heal_and_cure_status.c
2024-02-09 17:02:56 -03:00
Eduardo Quezada D'Ottone
6da1be01a9
Added Indigo Disk cries (#4164) 2024-02-09 19:46:09 +01:00
Alex
e89f8e00ed
Fixes Hit Escape moves interaction with hold effects and switch in ab… (#4091)
* Fixes Hit Escape moves interaction with hold effects and switch in abilities

* leftover

* fix spelling

* fix desc.
2024-02-09 14:00:42 +01:00
ghoulslash
d2690278b0
Implement ghoul's save block branch (#4113)
Implement ghoul's save block branch
2024-02-08 10:54:15 -05:00
Bassoonian
5d5cc76a2c
Teachable learnset helper mechanics (#3856)
* Teachable learnset helper mechanics

* Rename folder and python script

* Some teachable learnset work

* Update PoryMoves file labels

* Add header and make custom json

* Include found moves in output file

* Update SV file to latest version

* Don't run if there are no jsons to be found

* Add Basculin duplication in json

* Add universal move support to

* Ignore and skip Mew

* Integrate tool in Makefile

* Condense Basculin learnsets

* Split Oinkologne for easier generation

* Add Deoxys' XD move tutor data

* Add missing Darumaka/Yamask Galarian SwSh TMs

* Add TID species to sv.json

* Update sv.json to The Indigo Disk data

* Add Python install instructions

* Fix Makefile

* Expand header with more information

* Add config to allow disabling the learnset helper

* Update include/config/pokemon.h

Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com>

* Don't crash if the config is missing

---------

Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com>
2024-02-08 11:32:48 -03:00
ghoulslash
4bfe6d3c6d
Merge branch 'upcoming' into ghoulsaveblock 2024-02-08 08:37:57 -05:00
MartyKen
51cbf92ed0
Lvl up learnsets by generation (#4049)
* Lvl up learnsets by generation

I think the title sums it up pretty nicely

* Update level_up_learnsets.h

forgot some newer pokemon

* divided the learnset file into generations

* Separated learnsets by generation

Separated the learnsets by generation, added a bit more documentation in the config file

* Update src/pokemon.c

Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com>

* Update include/config/pokemon.h

Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com>

---------

Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com>
2024-02-08 09:02:02 -03:00
LOuroboros
916e4814bd
Implemented Custom/Complex/Expanded GiveMon scripting command (#3924)
* Introducing an expanded givemon

* Added debug features to check a Pokémon's EV and IV

* Added a parameter to set a custom mon's gender

* Added a debug feature to clear the party

* Defined the EV/IV getters in gSpecials

* Added Gigantamax Factor toggle to givecustommon

* Updated Gigantamax Factor label in givecustommon macro

* Added tera type parameter to givecustommon

Misc. changes:
-Added a few harmless comments to CreateCustomMon for consistency reasons.

* Cleaned up the code inside CreateCustomMon a bit

Also updated the values assigned to the parameters of ScriptGiveCustomMon
This is temporary though. I'll probably end up turning them into 2byte parameters so they can be filled when the scripting command is called by using variables once I solve the bigger problem that the scripting command is currently facing.

* Foolproofed the Poké Ball check in CreateCustomMon

* Assigned a default gender to givecustommon
This solved the nasty issue by which the command wasn't working properly if you didn't fill in each parameter when calling givecustommon in a script.

* Reinforced the gender checks at CreateCustomMon

* Re-reinforced the gender checks at CreateCustomMon

* Compressed givecustommon and added tests

-Made givecustommon skip unspecified parameters.
-Added scripting variables support for every parameter.
-Added tests.

* Updated the default values of some ScriptGiveCustomMon parameters

* Replaced vanilla's givemon with givecustommon

Misc. Changes:
-Renamed CreateCustomMon to ScriptGiveMonParameterized.
 -The truth is that the function was never limited to creating the skeleton of a Pokémon like the actual CreateMon functions do, so that label was never correct. The function was always an expanded ScriptGiveMon.
-Moved the core functions to src/script_pokemon_util.c which is where they actually belong.
-Updated ScriptGiveMonParameterized a little to incorporateb changes that were applied to the original ScriptGiveMon, namely, Synchronize ability and form change handling.
-Introduced a new ScriptGiveMon to replace the original one.

* Corrected givecustommon tests

* Fixed the default IV values for the new givemon

* Updated DebugAction_Party_ClearParty for consistency with the other debug functions

* Updated the text strings used by the Check EV/IV debug features

---------

Co-authored-by: Martin Griffin <martinrgriffin@gmail.com>
Co-authored-by: Alex <93446519+AlexOn1ine@users.noreply.github.com>
2024-02-08 09:11:13 +01:00
Bassoonian
84686d15d8
Merge branch 'upcoming' into ghoulsaveblock 2024-02-06 23:36:46 +01:00
Frank DeBlasio
7f50c0b9c3
Simplify gTrainerSprites (#4140)
* Simplified y_offset equations

* Removed trainer pic animation from gTrainerSprites

* Used metaprogram to simplify trainer sprites without mugshots

* Incorporated comments

---------

Co-authored-by: Alex <93446519+AlexOn1ine@users.noreply.github.com>
2024-02-06 22:24:36 +01:00
Nephrite
f7ec44c2ea
Fixed Shield Dust, added tests (#4137)
* Fixed Shield Dust, added tests

Also fixed a duplicate macro caused by near-simultaneous PR merges (oops)

* Added KNOWN_FAILING Sparkling Aria test

---------

Co-authored-by: Alex <93446519+AlexOn1ine@users.noreply.github.com>
2024-02-06 09:19:37 +01:00
ghoulslash
c2c97d3c1c
GetBattleAnimMoveTargets fill absolute battler ids instead of relative anim ids (#4139)
Co-authored-by: ghoulslash <pokevoyager0@gmail.com>
Co-authored-by: DizzyEggg <jajkodizzy@wp.pl>
2024-02-06 09:05:26 +01:00
Eduardo Quezada
f89efad082 Merge branch '_RHH/master' into _RHH/upcoming 2024-02-05 17:52:34 -03:00
DizzyEggg
065c0ec588
Fairy Lock animation fix (#4111)
* Fairy Lock animation fix

* remove comment

* fairy lock anim hopefully works

---------

Co-authored-by: Alex <93446519+AlexOn1ine@users.noreply.github.com>
2024-02-04 23:23:03 +01:00
Nephrite
65c508d193
Secondary effects overhaul minor follow-up (#4062)
* settwoturnstring command

* Unified two-turn attacks and Meteor Beam

To do: Solar Beam

* Solar Beam

Also fixed various function, removed EFFECT_GUST (who knows why that exists?)

* Updated Solar Beam + tests

* Redid two turn move + animations logic

Removed pointless various function; to do: remove Skull Bash, fix AI test

* Removed now-pointless flag

* Removed Skull Bash

And temporarily commented out failing AI tests

* Removed Sky Uppercut effect

Not sure when or why this was ever necessary

* Removed BattleScript_EffectSemiInvulnerable

Now uses BattleScript_EffectTwoTurnsAttack. Kept the effect; used the argument field to determine which STATUS3 such moves should apply but added a function to jump over weather checks in BattleScript_EffectTwoTurnsAttack if the current move is semi-invulnerable (since the instant-fire weather check and STATUS3 use the same field)

* Applied review changes

* Replaced VARIOUS with callnative

Tried to fix test but couldn't :/ wtf is going on

* Fixed one AI test

Cant fix the other...

* Added KNOWN_FAILING to failing AI tests

Separated them out into their own test

* Optimised script, overhauled charge turn string setting

Condensed multiple confusing macros into one, jumpifweathercheckchargeeffects. Script now tweaked and trimmed, string ids for charge turns now added to argument along with status3 (thanks to compression macro) and instant-fire-weather for semi-invulnerable and two-turn moves respectively. Also introduced a savedStringId in gBattleScripting to make string selection work.

* Unified two turn move tests + minor corrections

* Added semi-invulnerable move tests

Set the Razor Wind test to known failing - something to do with its animation?

---------

Co-authored-by: Alex <93446519+AlexOn1ine@users.noreply.github.com>
2024-02-04 23:02:59 +01:00
Nephrite
7ae50ea507
Metaprogram (#3968)
* metaprogram.h

Created by Mr. Griffin. Removed non-relevant parts

* Added DEFAULT/DEFAULT_2 macros

Also added a demonstration in battle_main

* Removed GET_ARGS

* Expanded DEFAULT

Because why not?

* Added EXCEPT

Expands to everything but the first x arguments.

* Added BIT_INDEX (thanks to MGriffin) and COMPRESS_BIT macros

These let you compress a bit up to a word in size inside a single byte and uncompress at the same time. BIT_INDEX just tells you where the bit is.

* Updated HANDLE_EXPANDED_MOVE_NAME

---------

Co-authored-by: Martin Griffin <martinrgriffin@gmail.com>
2024-02-04 16:28:27 -03:00
LOuroboros
691b1879f8
Renamed VAR_TERRAIN to B_VAR_TERRAIN and added a var-based field terrain timer (#4132)
* Renamed VAR_TERRAIN and introduced a var-based field terrains timer

* Fixed sky battle configs alignment and syntax

* Added B_VAR_TERRAIN_TIMER handling to Overworld_ResetBattleFlagsAndVars

* Removed pointless edits to EndTurnTerrain

* Updated B_VAR_TERRAIN_TIMER's comment

* Updated the syntax of ABILITYEFFECT_SWITCH_IN_TERRAIN to comply with Agbcc

* Nuked pointless VarGet calls in the case ABILITYEFFECT_SWITCH_IN_TERRAIN of AbilityBattleEffects

* Reverted changes made to BS_SetRemoveTerrain
I shouldn't have touched it at all since it's not involved with B_VAR_TERRAIN functionality.

* Removed trailing spaces in the case ABILITYEFFECT_SWITCH_IN_TERRAIN of AbilityBattleEffects
2024-02-04 13:04:55 +01:00
DizzyEggg
85eea4869d
Fix move animation crashing on some emulators because of division by zero (#4121)
* fix flip turn div by zero

* fix incinerate move anim div by zero
2024-02-03 16:56:50 +01:00
Alex
ab2774f8c7
Adds Dragon Cheer (#4122)
* Adds Dragon Cheer

* fix assumptions

---------

Co-authored-by: ghoulslash <41651341+ghoulslash@users.noreply.github.com>
2024-02-03 08:00:41 -07:00
Bassoonian
adc3308d13 Actually multi battles seem to work fine too 2024-02-02 16:52:39 +01:00
Bassoonian
6c1a111c14 No questionnaires are actually broken 2024-02-02 16:45:58 +01:00
Bassoonian
06d04c1194 Merge branch 'upcoming' of https://github.com/rh-hideout/pokeemerald-expansion into ghoulsaveblock 2024-02-02 16:39:15 +01:00
Bassoonian
b8b7dd304b Add final config documentation 2024-02-02 16:38:33 +01:00
Bassoonian
6f668fb31d Add FREE_MYSTERY_GIFT 2024-02-02 16:31:19 +01:00
Bassoonian
4092d0283a Fix FREE_BATTLE_TOWER_E_READER 2024-02-02 15:58:27 +01:00
ghoulslash
83b9b95662
add supersweet syrup, unify single-use entry abilities to single field (#4115)
Co-authored-by: ghoulslash <pokevoyager0@gmail.com>
2024-02-02 15:44:14 +01:00
Bassoonian
db95a06ae0 Fix FREE_TRAINER_HILL 2024-02-02 15:24:46 +01:00
Bassoonian
dedba114be Fix FREE_LINK_BATTLE_RECORDS 2024-02-02 15:16:18 +01:00
Bassoonian
a1c17a1de7 Fix FREE_ENIGMA_BERRY 2024-02-02 15:01:50 +01:00
Bassoonian
cc57452695 Fix FREE_UNION_ROOM_CHAT 2024-02-02 14:57:40 +01:00
Bassoonian
24ed9e77ff Fix FREE_MATCH_CALL 2024-02-02 14:13:16 +01:00
Bassoonian
deb3e6a11d Add dependency #error 2024-02-02 13:47:53 +01:00
Bassoonian
27a65a5961 Fix FREE_RECORD_MIXING_HALL_RECORDS 2024-02-02 13:46:19 +01:00
Bassoonian
90be8436d9 Fix FREE_POKEMON_JUMP 2024-02-02 13:39:21 +01:00
Bassoonian
26a4c56843 Ensure FREE_EXTRA_SEEN_FLAGS works 2024-02-02 13:32:13 +01:00
Bassoonian
495ee6698c Clean up code 2024-02-02 13:13:27 +01:00
Bassoonian
acf5d8133a Convert ifndef configs to standard configs 2024-02-02 12:43:31 +01:00
Bassoonian
d1bb078919 Merge branch 'saveblock' of https://github.com/ghoulslash/pokeemerald into ghoulsaveblock 2024-02-02 11:27:48 +01:00
kaicardenas2
e828ae58a1
Non-Tagged Release (#4109) 2024-02-01 21:20:10 -03:00
Eduardo Quezada D'Ottone
2d24f96420
Version 1.7.3 (#4106)
* Version 1.7.3

* Latest changelog
2024-02-01 20:55:53 -03:00
Bassoonian
ccfebe5e05
Adds missing evolution methods (#4087)
* Add evolution tracker to BoxMon struct

* Add "use move 20 times, then lv up" evolution method

* Add recoil tracker

* Reduce to 9 bits

* Fix agbcc complaint

* Put MOVEEND_CLEAR_BITS at the end

* Remove battle argument from tryupdaterecoiltrackker

* Add null checks

* Fix upcoming merge

* Add requested formatting changes

* Condense evolution check into a single function for easier customisation later

* Incorporate review requests

* Update src/pokedex_plus_hgss.c

Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com>

---------

Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com>
2024-02-01 18:35:38 -03:00
Eduardo Quezada
09d12fb154 Merge branch '_RHH/master' into _RHH/upcoming
# Conflicts:
#	ld_script_modern.ld
#	src/battle_ai_switch_items.c
2024-02-01 12:52:31 -03:00
ZnogyroP
71b49a114f
Adds move Upper Hand (#4085)
* Remove non-existent tilesets from label comments and alphabetize

* Fixed braces style

* gbagfx bit depth upconversion fix

* jsonproc: filter out every non-alphanumeric character

* fix(linking): link gflib/malloc.c at top of EWRAM in ld_script_modern.ld

* Adds move Upper Hand

* Requested changes

- Tabs / spaces where proper
- HitFromAtkString -> HitFromAccCheck
- Actually compiles now lol
- Moved assumes into relevant tests
- Cleaned up the check for TryUpperHand

* Fixed || positioning

* Update upper_hand.c

* Revert "Merge remote-tracking branch 'upstream/master' into upper-hand"

This reverts commit b21275dfe9, reversing
changes made to 89b1ad1ea1.

* AI logic and conflicts solved

* Test fix

* Fix Sheer Force test

* Requested changes

* Requested changes

* Update battle_script_commands.c

---------

Co-authored-by: GriffinR <griffin.g.richards@gmail.com>
Co-authored-by: Eduardo Quezada <eduardo602002@gmail.com>
Co-authored-by: Sierraffinity <sierra@domoreaweso.me>
Co-authored-by: sbird <sbird@no.tld>
2024-02-01 12:23:58 +01:00
Alex
6d3fa525d5
Rename EFFECT_FAKE_OUT to EFFECT_FIRST_TURN_ONLY (#4081)
* Splits First Impression effect from Fake Out

* Fix test failing

* rename EFFECT_FAKE_OUT

* use moveeffect chance for fake out and priority field for first impression

* rename rest of fake out

* messed up merge

* remove useful comment

---------

Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com>
2024-01-31 09:32:58 -03:00
DizzyEggg
f5623595a0
Fix AI trying to switch into the same mon 2 times (#4098) 2024-01-30 16:14:33 +01:00
LOuroboros
a64e1c63c1
Move data unification (#3999)
* Made gBattleMoves handle the InGame name and description of battle moves
No more multiple arrays in separate, individual files.

Note:
-Keep an eye on Task_LearnedMove.

* Reintroduced move names

Misc:
-Fixed Trick-or-Treat and Light of Ruin's expanded names.
-Introduced a new field for Z-Move names, and a constant for their name length.
-Added a few TODOs to GetBattleMoveName.
-Updated GetMaxMoveName and GetZMoveName. There's no reason not to let GetBattleMoveName handle everything on its own.

* Updated GetBattleMoveName to handle Z-Move Names

Misc:
-Removed pointless TODO about MOVE_NAME_LENGTH.
 -The compiler doesn't allow to have a move name with a value higher than MOVE_NAME_LENGTH, therefore it's pointless to worry about it.

* Fixed a couple of expanded move names

* Removed zMoveName variable of struct BattleMove and extended the name variable's size

* Ditched no longer used MOVE_NAME_LENGTH constant

* Corrected the names of the max moves
I should have done this after updating the size of the name variable of the struct BattleMove, but I didn't think about it at all until Cancer Fairy indirectly gave me the idea.

* Fixed U-turn's name

* Brought back MOVE_NAME_LENGTH
I think it doesn't make sense to have a Z_MOVE_NAME_LENGTH because the length in question is used for all battle moves, not just the Z-Moves.

* Introduced a union for Move/Z-Move names in the struct BattleMove

* Fixed the union for gBattleMoves move names
Also updated GetBattleMoveName to properly handle Max Move names.
Also also renamed the "zMoveName" variable to "bigMoveName" which better reflects its purpose. Z-Move names weren't the only thing it covered, since it also handles Max Move names.

* Removed deprecated GetZMoveName and GetMaxMoveName

* Reintroduced mention to gMoveNames in sGFRomHeader

* Fixed move names and ported move descriptions

* Fused the struct ContestMove into the struct BattleMove

* Removed no longer used Z_MOVE_NAME_LENGTH constant

* Renamed the struct BattleMove's bigMoveName variable and introduced macros to prettify move names

* Reintroduced the contest parameters for Pokémon moves

* Renamed gBattleMoves to gMovesInfo
This is consistent with gSpeciesInfo, the array that contains most of the species data.

* Renamed the BattleMove struct to MovesInfo
This is consistent with the struct SpeciesInfo, which contains the variables used by the gSpeciesInfo array.

* Removed empty lines separating battle params from contest params in gMovesInfo

* Renamed MovesInfo to MoveInfo

* Added Cancer Fairy's HANDLE_EXPANDED_MOVE_NAME macro
Used to handle moves with expanded names in a more comfortable manner.
Also fixed Trick-or-Treat's expanded name.

* Renamed GetBattleMoveName to GetMoveName

* Added a comment pointing out that the shared move descriptions are shared move descriptions

* Re-aligned one of the escape characters of CHECK_MOVE_FLAG

* Renamed the battle_moves.h file to moves_info.h instead for consistency's sake

* Applied Eduardo's adjustments

* Using compound string for regular move names as well, saving 1180 bytes and making their use consistent
* Move description formatting

* Updated Pursuit test after merge

* Renamed the BATTLE_CATEGORY constants to DAMAGE_CATEGORY

---------

Co-authored-by: Nephrite <thechurchofcage@gmail.com>
Co-authored-by: Bassoonian <iasperbassoonian@gmail.com>
Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com>
2024-01-29 08:51:32 -03:00
Alex
199e863909
Adds move score defines + minor score clean up (#4075)
* Adds move score defines + minor score clean up

* fixes compiling, added comments + more replacements

* fix agbcc

* Update include/battle_ai_main.h

Co-authored-by: Bassoonian <iasperbassoonian@gmail.com>

---------

Co-authored-by: Bassoonian <iasperbassoonian@gmail.com>
2024-01-29 12:28:16 +01:00