Commit graph

65 commits

Author SHA1 Message Date
Alex
42c43a3f8f
Adds Commander and Order Up (#5246)
* Adds Commander

* review points

* new line

* correction

* regression / double targeting still broken

* fix wrong target order

* transform fixes

* haze test

* fixes, tests

* bring back wrongly removed else if case

* Eject Pack / Button test + fix

* red card fix

* test fixes

* Fixes Tatsu being hit by multi hit move

* change transform check

* fix test + revert change

* Fix Tatsugiri attacking after freed up from Dozo in the same turn

* Dragon Darts tests

* fix test

* review comments

* assumtion in wrong file

* Order Up test fixes

---------

Co-authored-by: hedara90 <90hedara@gmail.com>
2024-09-29 22:45:50 +02:00
AgustinGDLV
9797640dff
Gimmick Refactor (#4449)
* consolidated gimmick checks, triggers, communication, and activation; updated test runner

* fixed improper use of .usableGimmick

* cleaning up battle_dynamax.c, changing function args to u32s

* fixed '#ifdef TESTING' causing errors

* updated z-moves to use gimmick interface, pared down redundancies; no AI/tests

* added support for z-moves in tests, consolidated gimmick fields

* removed ShouldUseMaxMove and .usingMaxMove

* renamed TryChangeZIndicator, updated z move display

* added several z-move tests and fixed various z-move interactions; fixed z-move category calc

* fixed useless battler arg in GetTypeBasedZMove

* added basic test check for bad Z-Move or Mega usage

* reworked test runner gimmick functionality; added support for Ultra Burst + Z-Move to test Light That Burns the Sky

* fixed gimmick test logic; fixed damage category override

* fixed mega rayquaza test fail

* consolidated gimmick indicator logic; added graphics to gGimmicksInfo

* removed TeraData struct

* reimplemented AI logic for Z-Moves; no changes

* updated Z-Move and Ultra Burst trigger gfx

* added testrunner check for multiple gimmick use

* fixed duplicate z-move call in test

* reorganized data/graphics/gimmicks.h

* added signature Z-Move ability tests; implemented Guardian of Alola

* fixed bad test update

* fixed Thousand Arrows not affecting Tera Flying; clean-up

* fixed -ate tests

* fixed tera tests

* fixed tera tests really

* fixed last batch of tests

* fixed -ate mega test again

* code review

* code review pt.2

* tweaked CanTera again

* dynamax flag only required for player
2024-06-22 22:25:40 +02:00
Eduardo Quezada
64f82cdd5f Merge branch '_RHH/master' into _RHH/upcoming
# Conflicts:
#	src/battle_ai_util.c
#	src/battle_util.c
2024-06-11 08:12:03 -04:00
sneed
1ca4676c4c fix ai crit calculations 2024-06-09 23:09:34 +03:00
Frank DeBlasio
849bd0c8bb
Consolidate natures (#4562)
* Added NatureInfo struct

* Added back animation variants to struct

* Added PokeBlock animations to struct

* Added Battle Palace info to struct

* Added nature girl messages to struct

* Reordered gNaturesInfo to match struct order

* Refactored nature stat table

* Fixed battle dome nature calculation

* Fixed neutral nature values

* Fixed bracket layout
2024-05-19 10:14:31 +02:00
kittenchilly
d58e6517f8
Add abilities Tera Shift, Tera Shell, and Teraform Zero (#4418)
* Add abilities Tera Shift, Tera Shell, and Teraform Zero

* Address reviews

* Tests and misc cleanup

* Fix alignments

* Update battle_script_commands.c

* New tests and fix behavior

* Address more reviews

* Update battle_util.c
2024-04-27 19:52:31 +02:00
Alex
c740c4ba19
Disguise fixes + gen8 hp loss config (#4360)
* Disguise fixes + gen8 hp loss config

* fix battler arg

* Update test/battle/ability/disguise.c

---------

Co-authored-by: Bassoonian <iasperbassoonian@gmail.com>
2024-04-07 00:07:55 +02: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
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
Nephrite
e34373effc Renamed seteffectwithchance to setadditionaleffects
Function no longer has ability to apply effects from moveEffect - for that, seteffectprimary or secondary is now recommended. Removed EFFECT_RAMPAGE, updated a few tests
2023-12-30 20:29:09 +09:00
Nephrite
7c38056da7 Review fixes
Added more move effect considerations to AI; redid way it calculates secondaryEffectChance; misc fixes
2023-12-29 12:04:42 +09:00
psf
493478e94b
Added support for XY's Sky Battles (#2950)
* Original implementation from Phlayne

* Moved Sky Battle Flag / Var into a config

* Optimized existing code and fixed existing bugs

Added error message for when sky battle var and flag are not set
Merged CanDoSkyBattle and PrepareSkyBattle into one special

* Added compatibility for Gen7+

* Commented out Volt Crash from banned moves

* Cleaned up debug scripts from testing

* Fixed bug where player did not white out even if they had no healthy Pokémon and only an egg
Zeroed out both Sky Battle configs

* Removed extra include from src/field_specials.c
Removed extra line break in src/battle_script_commands.c

* Added FLAG_DISABLED_IN_SKY_BATTLE
Added FLAG_DISABLED_IN_SKY_BATTLE to appropriate moves

* Changed DoesSkyBattleCancelCurrentMove to look at move flags

* Fixed alignment and spacing in battle_moves.h

* Added FLAG_DISABLED_IN_SKY_BATTLE to Sticky Web

* Added FLAG_DISABLED_IN_SKY_BATTLE to Steel Roller

* Disabled the ability to change Battle Terrain when Sky Battle is happening
Stopped Ceaseless Edge from spawning Spikes when Sky Battle is happening
Added B_SKY_BATTLE_STRICT_MECHANICS config

* Fixed bug with SKY_BATTLE_STRICT_MECHANICS where conditions were not consistently being applied

* Add rulesVariants to the BattleStruct
Added skyBattle check in AllocateBattleResources

* Replaced B_FLAG_SKY_BATTLE checks with rulesVariants.skyBattle checks

* Fixed debug script

* Reverted include/config/battle.h

* Fixed spacing and placement of functions

* Fixed debug script omission
Fixed bug where Spikes did not set from Ceaseless Edge and Stone Axe

* Added FLAG_DISABLED_IN_SKY_BATTLE to Psychic Terrain

* Addressed DizzyEgg PR feedback

* Forgot a file in last commit

* Addressed feedback from DizzyEggg

* Address Lunos' PR feedback

* Update specials.inc

Added an empty line at the end of data/specials.inc

* Fixed spacing

* Apply suggestions from code review

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

* Updated skyBattleBanned and HandleBattleVariantEndParty to use correct names

* Removed STRICT_MOVES and STRICT_MECHANICS

* Fixed minor spacing issues with merge

* Merged in upcoming

* Implemented feedback from Jasper
5da6117d1b

---------

Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com>
2023-11-26 16:59:44 +01:00
kittenchilly
9f1dbeeead
Pickup Table Refactor (#3351) 2023-09-28 17:41:42 -03:00
DizzyEggg
bb9501449c final ai optimizations 2023-09-14 11:05:00 +02:00
DizzyEggg
5ea66f3c0c more optimizations 2023-09-14 00:07:41 +02:00
DizzyEggg
406209f738 score to s32 2023-09-13 09:27:49 +02:00
DizzyEggg
44bd830d2a optimize dmg calc and ai dmg calc to reduce lag 2023-09-12 23:20:09 +02:00
AgustinGDLV
86242c1c70
MOVE_REVIVAL_BLESSING Effect (#2883)
* implemented Revival Blessing
2023-04-12 01:14:25 +01:00
DizzyEggg
e055456b7e
Fix Protean / Libero when AI calculates Damage (#2714)
* Fix Protean / Libero when AI calculates Damage

* fix ai changing types when calculating dmg
2023-03-07 09:34:26 +01:00
DizzyEggg
03915524c5 Fix switch-in abilities activating on empty field 2023-02-20 12:42:06 +01:00
LOuroboros
a328088122 Implemented Protosynthesis' effect
Also turned GetHighestStatId into a global function since Protosynthesis' effect uses it.
2022-12-06 05:23:29 -03:00
Eduardo Quezada
afcc1178b2 Merge remote-tracking branch 'pret/master' into MergedBranchUltimate
# Conflicts:
#	data/battle_ai_scripts.s
#	data/battle_scripts_1.s
#	include/battle_controllers.h
#	include/battle_script_commands.h
#	include/battle_util.h
#	include/constants/battle_script_commands.h
#	include/constants/global.h
#	include/decompress.h
#	src/battle_anim_effects_1.c
#	src/battle_anim_normal.c
#	src/battle_anim_poison.c
#	src/battle_anim_water.c
#	src/battle_arena.c
#	src/battle_controller_link_opponent.c
#	src/battle_controller_link_partner.c
#	src/battle_controller_opponent.c
#	src/battle_controller_player.c
#	src/battle_controller_player_partner.c
#	src/battle_controller_recorded_opponent.c
#	src/battle_controller_recorded_player.c
#	src/battle_controller_safari.c
#	src/battle_controller_wally.c
#	src/battle_gfx_sfx_util.c
#	src/battle_interface.c
#	src/battle_main.c
#	src/battle_message.c
#	src/battle_script_commands.c
#	src/battle_util.c
#	src/berry.c
#	src/data/trainers.h
#	src/decompress.c
#	src/field_effect.c
#	src/hall_of_fame.c
#	src/overworld.c
#	src/pokeball.c
#	src/pokemon.c
#	src/pokemon_icon.c
#	src/pokemon_storage_system.c
#	src/scrcmd.c
2022-08-22 20:30:45 -04:00
DizzyEggg
c991131b75 Change language stuff based on the french decomp 2022-08-04 11:53:16 +02:00
ghoulslash
c694e0cb90 merge w be 2022-06-05 08:22:24 -04:00
ultima-soul
86089ce935 Merge branch 'master' of github.com:pret/pokeemerald into battle_engine_sync 2022-02-28 22:13:14 -08:00
ghoulslash
035b2332af cache ai damage, effectiveness calcs 2022-01-13 11:28:27 -05:00
GriffinR
aadab8b016 Move pokemon and easy chat constants to global, misc clean-up 2021-12-28 18:07:41 -05:00
ultima-soul
3ed51d6d91 Merge branch 'master' of github.com:pret/pokeemerald into battle_engine_sync 2021-11-21 10:40:26 -08:00
Eduardo Quezada D'Ottone
ae8de0f07a Merge branch 'BattleEngine' into BE_TerrainMoves
# Conflicts:
#	data/battle_scripts_1.s
#	include/constants/battle_move_effects.h
#	src/battle_util.c
2021-11-06 10:44:05 -03:00
ghoulslash
1f176242aa add missing func definition 2021-10-15 16:06:50 -04:00
GriffinR
def6cc8158 Label battle script macro arguments 2021-10-13 17:44:04 -04:00
GriffinR
d8e65fc4b6 More battle doc, add battle window ids 2021-10-09 03:01:10 -04:00
Eduardo Quezada D'Ottone
5019615be1 Refactored Secret Power move effect into a function 2021-10-04 21:28:15 -03:00
sbird
0ee13418dc [ai] use expected value move dmg calculation 2021-09-22 13:15:43 +02:00
ghoulslash
d218322b2c merge with be 2021-08-12 01:26:13 -04:00
ghoulslash
a595b213b4 merge with be 2021-03-28 17:29:22 -06:00
Evan
f4d4cf262e fix screen cleaner, curious medicine, as one 2021-02-02 09:00:07 -07:00
Evan
4c1e8f2f2e add curious medicine 2021-01-05 20:02:11 -07:00
Evan
ac332d5e98 check bad move 2020-12-13 15:02:21 -07:00
Evan
34dd11448b sticky barb transfer + pickpocket combo, fix CanBattlerGetOrLoseItem 2020-12-09 10:28:18 -07:00
DizzyEggg
0066640a1e Merge with master 2020-07-27 14:51:39 +02:00
GriffinR
aba42513d3 Clean up some battle scr cmd data 2020-07-18 18:10:15 -04:00
Eduardo Alvaro Quezada D'Ottone
8d848997c9
Battle Configs: The Revenge (#363)
* Turns for Uproar

* Chances for the amount of hits with multi-hit moves.

* Electric type mon's immunity to paralysis

* (Hi) Jump Kick to always do 1/2 of maxHP when crashing

* Turns for Disable.

* Minimized mons can always be hit by moves like Stomp

* Grass types immune to powder and spore moves.

* Psywave's damage formula

* Fixed random usage.
2020-05-28 10:38:27 +02:00
Eduardo Alvaro Quezada D'Ottone
c5a6acc7db
Corrosion (#306)
* Status move poisoning for Steel and Poison types.

* Can poison itself with Toxic Orb.

* Secondary effect poisoning now working.

* Created a function that checks if abilities can bypass type immunities.

* Created macro to handle typeimmunity

* Applied review changes.

* Applied review requests.

* Left more readable version of HOLD_EFFECT_TOXIC_ORB.
2020-04-21 15:59:19 +02:00
DizzyEggg
3dfd19b3e2 AI Weather moves tweaks 2020-04-20 13:00:04 +02:00
DizzyEggg
dd17360ab0 Zen Mode and Shields Down 2020-04-19 21:18:39 +02:00
DizzyEggg
093eca07b3 Volt Switch UTurn anim fix when cant switch out 2020-04-18 18:04:20 +02:00
Eduardo Alvaro Quezada D'Ottone
33e8e20118
Disguise ability (#258)
* Protection from attacks.

* Changes form when Busting Disguise.

* Ability changing moves set to fail.

- Simple Beam and Worry Seed now fail if the target has Disguise.
- Role Play and Skill Swap now fail if either the attacker or the target have Disguise.

* Disguise no longer triggers when transformed.

* Mimikyu reverts to Disguised

* No longer blocks from entry hazards and weather.

* Applied review changes

* Oops, new line

* yeah
2020-02-08 19:29:51 +01:00
ultima-soul
029ab67ff4 Implement Leaf Guard. 2019-12-16 00:29:20 -08:00
DizzyEggg
143cb7ad35 Updated switch mechanics 2019-08-22 15:57:33 +02:00