Commit graph

14154 commits

Author SHA1 Message Date
tertu
c57b1548a0
Replace at least some shuffle algorithms with Shuffle (#3801)
Most of these are the poor-quality and slow "naive shuffle", but some might be better.
In any case, Shuffle is known good.
2023-12-28 09:58:35 +00:00
kittenchilly
4f61d44dfe
Add Treasure Factor to Nugget and Tiny Mushroom (#3836) 2023-12-28 00:02:51 +01:00
Bassoonian
88b0bd6394
Add gen9 item prices + configs (#3834)
* Add gen9 item prices + configs

* Adjust gen 1 PP item costs

---------

Co-authored-by: Alex <93446519+AlexOn1ine@users.noreply.github.com>
2023-12-27 22:48:56 +01:00
DizzyEggg
3e321d1172
fix ally switch dig issue (#3835) 2023-12-27 15:35:42 -05:00
Frank DeBlasio
f5e0b3df23
Changed SHINY_ODDS to FALSE in pokedex_plus_hgss.c (#3832) 2023-12-27 20:28:44 +01:00
Martin Griffin
3ad66028e9
Backwards-compatible BoxPokémon Refactor (#3438)
* Check progress in non-battle PARAMETRIZEd tests

* Overworld Script Tests

* Backward-compatible BoxPokemon Refactor

Reuses space that contains zeros to provide space for:
- HP/status in the box
- 12-character nicknames
- Up to 63 PokéBalls
- Shininess separate from PID
- Hidden Nature
- Hyper Training
- Dynamax Level
- Gigantamax Factor
- Terastallization Types
- Shadow

Implements:
- OW_PC_HEAL to switch between Gen7- and Gen8+ behavior
- Nature Mints
- Dynamax Candy
- Hyper Training commands (canhypertrain/hypertrain)
- Gigantamax Factor commands (hasgigantamaxfactor/togglegigantamaxfactor)
- Terastallization Type on the summary screen
- Prevents Gigantamax Factor Pokémon from evolving into a species without a Gigantamax form

* fixup! Backward-compatible BoxPokemon Refactor

* displaydexinfo fix from Jasper
2023-12-27 17:48:17 +01:00
ghoulslash
a9d6832908
Separate AI flags by battler position (#3003)
* ai flags by battlerId

* fix recoded battle saved ai flags

* update aiFlags check in OpponentHandleChoosePokemon

* add header for TRAINER_CUSTOM_PARTNER define

* initialize flags in BattleAI_SetupAIData

* fix usage of TRAINER_CUSTOM_PARTNER

* remove whitespace

---------

Co-authored-by: ghoulslash <pokevoyager0@gmail.com>
2023-12-27 13:54:37 +01:00
Alex
166a1a4e63
Adds ability Embody Aspect + minor fix to Hospitality (#3821)
* Adds ability Embody Aspect + minor fix to Hospitality

* comment out failing tests related to neutralizing gas

* fixes neutralizing gas bug

* leftover
2023-12-25 18:28:16 +01:00
Alex
1339256d5d
Adds Ability Hospitality (#3818)
* Adds Ability Hospitality

* fix agbcc
2023-12-25 01:43:57 +01:00
LOuroboros
58b03cb3bd
Implemented a CannotUseItemsInBattle function (#3524)
* Implemented a CannotUseItemsInBattle function
This fucntion is the result of merging CannotUseBagBattleItem and CannotUsePartyBattleItem. No reason to split the work between 2 functions when you can do it all with just 1.

Misc. Changes:
-Turned most of the if statements inside the function into "else if" statements for performance reasons.
-Refactored how the local variable "cannotUse" was used turning it into a bool.

* Made CannotUseItemsInBattle use a switch statement

Misc. Changes:
-Removed pointless parentheses from case EFFECT_ITEM_SET_FOCUS_ENERGY
-Removed pointless i loop variable from case EFFECT_ITEM_INCREASE_ALL_STATS and replaced a hardcoded 1 in its for loop.
-Turned the i loop variable declared at the top of the function into a u32 variable
-Removed pointless comments. The EFFECT_ITEM constants are readable enough to convey what sort of items they affect.

---------

Co-authored-by: Alex <93446519+AlexOn1ine@users.noreply.github.com>
2023-12-24 22:10:01 +01:00
Zimmermann Gyula
f700466e8d
Implement optional Gen1 type immunity logic. (#3627)
* Implement optional Gen1 type immunity logic.

* Add tests against Gen1 burn, freeze and paralysis.

* !fixup Expand tests with Gen1 paths.

* Fixup tests.

Remove superflous defines.
Explicitly ASSUME used move type and effect.

* Fix flipped definitions on Freezing Glare test.

---------

Co-authored-by: Bassoonian <iasperbassoonian@gmail.com>
2023-12-23 16:34:24 +01:00
Zimmermann Gyula
72615a7c35
Prevent infinite loop. (#3808)
Regression caused by fe1bad68b4
2023-12-23 12:29:12 +01:00
DizzyEggg
1a7166c2bb
Tests do not allow to use SEND_OUT if the chosen mon is fainted (#3752)
* Tests dont allow to send out pokemon with 0 hp

* remove test test

* handle in-game 0 hp sent out

---------

Co-authored-by: Bassoonian <iasperbassoonian@gmail.com>
2023-12-23 00:27:40 +01:00
tertu
fb28ce50ae
Optional high-quality RNG (#3780)
High-quality RNG, behind the HQ_RANDOM flag, enabled by default

Makes the shuffle test error a bit more tolerant
2023-12-22 17:39:15 +00:00
Alex
63316daf30
Adds missing Doodle tests and fix (#3800) 2023-12-22 18:25:23 +01:00
kittenchilly
505b8b63eb
Add Doodle + update ability banlists (#3609)
* Add Doodle

* Doodle test

* Oops

* Update battle_util.c

---------

Co-authored-by: Bassoonian <iasperbassoonian@gmail.com>
2023-12-22 16:45:55 +01:00
Alex
83e2f4bdf8
Adds ability Minds Eye + Tests (#3782)
* Implemented Mind's Eye with tests + Keen Eye tests

* AI test

* fix AI minds eye test

* Adds ability Minds Eye + Tests

* fix tests

---------

Co-authored-by: Eduardo Quezada <eduardo602002@gmail.com>
Co-authored-by: Bassoonian <iasperbassoonian@gmail.com>
2023-12-22 16:22:53 +01:00
Alex
566653aa63
Replace mons for gen9 abilities (#3740) 2023-12-22 15:05:35 +01:00
Bassoonian
f86648755a
Fix Mega Stone descriptions (#3797) 2023-12-22 14:11:02 +01:00
fakuzatsu
2af6d65893
added ability to set flags in tests (#3786) 2023-12-21 13:01:13 +00:00
DizzyEggg
698e69f2b3
add emitResult argument to ShouldSwitch AI functions (#3784) 2023-12-21 11:40:04 +01:00
Frank DeBlasio
5cdee87489
Refactor Trainer sprites (#3597)
* Added TrainerSprite struct with coordinates

* Added .frontPic to struct

* Added .palette to TrainerSprite struct

* Added .animation to the struct

* Added define for sprite size

* Condensed animations since they were all the same

* Improved TRAINER_SPRITE/PAL defines

* Simplified seemingly unused .y_offset and TRAINER_PIC_SIZE values

* Condensed TRAINER_SPRITE and TRAINER_PAL into TRAINER_PIC

* Renamed .size to .y_offset since that what it appears to actually be

* Moved y_offset into TRAINER_PIC

* Moved animation inside of TRAINER_PIC

* Added array number to preproc

* Removed trailing spaces

* Added sprite/palette files to preproc

* Revert adding sprites to preproc as it fails agbcc

This reverts commit dce57f8d1bfab70b4c6630a9c4e5b43495891459.

* Added backsprite struct

* Added animations to backsprite struct

* Changed TRAINER_PIC to TRAINER_SPRITE

* Added animation to backsprite preproc

* Added .backPic to struct

* Moved array number into backsprite preproc

* Removed definitions for trainer sprites

* Hardcoded sAnims_Trainer into struct since every sprite uses it

* Fixed TRAINER_SPRITE arguments
2023-12-20 23:14:33 +01:00
LOuroboros
5718d99f40
Used the COMPOUND_STRING macro to unify item descriptions and item data (#3432)
* Used the COMPOUND_STRING macro to unify item descriptions and item data

Misc. Changes:
-Corrected the Serious Mint's description.
-Moved the X_ITEM_STAGES and CONFUSE_BERRY_HEAL_FRACTION macros to the top of the file for consistency's sake.
-Corrected the Tapunium Z's description.

* Oops. I forgot to delete the old .description of the X Attack

* Removed definition of CONFUSE_BERRY_HEAL_FRACTION from include/constants/items.h

* Moved CONFUSE_BERRY_HEAL_FRACTION back to include/constants/items.h

* Unified item description strings where possible

---------

Co-authored-by: Bassoonian <iasperbassoonian@gmail.com>
2023-12-20 17:28:43 +01:00
Nephrite
1708c80200
Removed ALWAYS_CRIT, renamed critBoost (#3779)
Replaced ALWAYS_CRIT with an alwaysCriticalHit flag to account for the fact that in earlier generations, there is no crit stage at which crits are guaranteed. Renamed critBoost to criticalHitStage (at Edu's prompting). Reorder .criticalHitStage defines in battle_moves.h to be aligned with struct order.
2023-12-20 16:16:02 +01:00
DizzyEggg
6137db102e
Ally Switch (#3533)
* ally switch move animation

* Ally Switch anim done

* ally switch test and improve animation

* derp

* add ally switch known failing test for ally targeting moves

* moves which targetted ally fail after ally switch

* ally switch works like protect

---------

Co-authored-by: root <root@LAPTOP-3SNV7DEQ>
Co-authored-by: Alex <93446519+AlexOn1ine@users.noreply.github.com>
2023-12-20 15:26:28 +01:00
DizzyEggg
8d238c88b9
Follow -1, 1, 0 convention for comparision functions (#3777)
* change comparision functions to use -1, 1, 0

* m
2023-12-20 14:47:14 +01:00
Martin Griffin
50cbcebc81 Merge remote-tracking branch 'rhh/master' into upcoming 2023-12-20 12:56:35 +00:00
Alex
1e25b53433
Partner Battle refactor (#3592)
* Partner Battle refactor

* fix for steven id

* clean up

* Use trainer partner names for id

* removed testing leftover

* comment change

* more review changes

* fix compiling

* remove partener count

---------

Co-authored-by: Bassoonian <iasperbassoonian@gmail.com>
2023-12-20 12:38:28 +01:00
DizzyEggg
3b7782ed49
Clear BattleScripting struct at the battle start (#3776) 2023-12-20 10:48:52 +00:00
Alex
069769710b
Fixes Item Metronome damage (#3767)
Co-authored-by: Bassoonian <iasperbassoonian@gmail.com>
2023-12-20 11:24:12 +01:00
kittenchilly
bb94d302ae
Add Meteorite form change functionality (#3770)
Co-authored-by: Bassoonian <iasperbassoonian@gmail.com>
2023-12-20 10:33:08 +01:00
Eduardo Quezada D'Ottone
442620cf6b
Renamed Battle Move "Split" to the proper "Category" (#3774) 2023-12-20 10:08:26 +01:00
Martin Griffin
eee5be704c
Realign battleanim array with battlemove array. (#3769) 2023-12-19 18:24:24 +00:00
Martin Griffin
13a4bf5838 Merge remote-tracking branch 'rhh/master' into upcoming 2023-12-19 18:08:13 +00:00
Zimmermann Gyula
df447c48d3 Realign battleanim array with battlemove array. 2023-12-19 19:03:23 +01:00
Martin Griffin
982cc7539d
EXPECT_MUL_EQ thresholds are always at least ±1 (#3768) 2023-12-19 15:34:18 +00:00
kittenchilly
c16d85e497 EXPECT_MUL_EQ thresholds are always ±1 2023-12-19 09:21:18 -06:00
Nephrite
4a1a6c5625
Battlemove refactored (recoil, crit and Z moves) (#3575)
* Unified EFFECT_RECOIL

Combined EFFECT_RECOIL_25/33/50/33_STATUS into a single EFFECT; added an extra field to BattleMove 'secondaryData' that contains the franction of HP recoil; argument still holds status effect for Flare Blitz/Volt Tackle

* BattleMove struct change

Added critrate, recoil, multihit fields, made zMove into a union of effect/powerOverride for status/non-status moves respectively. Added new recoil field and zMove field to all moves. To-do: crit rate, multihit

* Critrate field added

Moves use a critRate field instead of a flag - obsoletes EFFECT_ALWAYS_CRIT

* Just a little define

Makes clear that critBoost = 3 means ALWAYS CRIT

* Added a proper recoil field

Just to make it unambiguous and flexible - can finally have a move with 69% recoil.

* Fixed AI damage calculation for multi-strike moves

* Fixes + removed unused effects

* Tests fixes

Two to fix: pass when run in isolation but not when the whole group is run, which is annoying...

* Minor fixes

* Minor tweaks

* Fixed move effects

* recoil tests

---------

Co-authored-by: Alex <alexthenotes@gmail.com>
2023-12-19 16:10:07 +01:00
DizzyEggg
e8e9d37640
Prankster tests + fixes (#3766)
* Prankster tests + partial fix

* Fix Prankster tests and some edge cases

---------

Co-authored-by: Alex <alexthenotes@gmail.com>
2023-12-19 11:17:31 +01:00
Eduardo Quezada
ce03d49d35 Forgot to disable EXPANSION_TAGGED_RELEASE 2023-12-18 16:27:12 -03:00
DizzyEggg
1ec0333432
Fix Ion Deluge interaction with VoltAbsorb/LightRod (#3764)
* Fix Ion Deluge interaction with VoltAbsorb/LightRod

* Use move target all battlers for ion deluge fix

* fix teatime failing

---------

Co-authored-by: Alex <93446519+AlexOn1ine@users.noreply.github.com>
2023-12-18 16:57:56 +01:00
DizzyEggg
59a159c338
Fix Ice Face ignoring move effects (#3755)
Co-authored-by: Alex <93446519+AlexOn1ine@users.noreply.github.com>
2023-12-18 16:02:07 +01:00
DizzyEggg
64f8635496
fix telekinesis not working (#3763)
* fix telekinesis not working

* typo

* remove one roost known failing

---------

Co-authored-by: Alex <93446519+AlexOn1ine@users.noreply.github.com>
2023-12-18 15:50:03 +01:00
DizzyEggg
e1d4bcc04e
fix frisk msg + tests (#3762) 2023-12-18 15:13:14 +01:00
Martin Griffin
74a6b8764c
overworld_ascending_frames to simplify overworld_frames (#3625)
Introduces relativeFrames which automates the process of using
overworld_frames with ascending frames.

Co-authored-by: Bassoonian <iasperbassoonian@gmail.com>
2023-12-18 13:47:15 +01:00
kaicardenas2
b65b6d8a80
Fix README (#3759) 2023-12-18 09:31:46 +01:00
Eduardo Quezada D'Ottone
c409ae4152
Version 1.7.0 (#3743) 2023-12-17 18:48:50 -03:00
Eduardo Quezada
1b586e78a3 Version 1.7.0 2023-12-17 18:18:54 -03:00
Eduardo Quezada
c505abd53d Merge branch 'RHH/master' into RHH/upcoming 2023-12-17 18:13:26 -03:00
DizzyEggg
e22ac51617
Fix Innards Out doing dmg after Gastro Acid / vs Magic Guard (#3758)
* gastro acid stays for fainted mons

* Innards Out does not damage Magic Guard Pokemon
2023-12-17 21:47:12 +01:00