Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleaned up Trainer Slides, added automated Trainer Slide tests, add new Enemy Critical Hit Slide #6018

Open
wants to merge 56 commits into
base: upcoming
Choose a base branch
from

Conversation

pkmnsnfrn
Copy link
Collaborator

@pkmnsnfrn pkmnsnfrn commented Jan 13, 2025

Description

  • Consolidated trainerSlideFirstCriticalHitMsgState, trainerSlideFirstSuperEffectiveHitMsgState, trainerSlideFirstSTABMoveMsgState, trainerSlidePlayerMonUnaffectedMsgState, trainerSlideHalfHpMsgDone, trainerSlideMegaEvolutionMsgDone, trainerSlideZMoveMsgDone, trainerSlideBeforeFirstTurnMsgDone, trainerSlideDynamaxMsgDone, and trainerSlideLowHpMsgDone into slideMessageStatus.
  • Moved trainer slide logic out of src/battle_message.c and into its own file, trainer_slide.c.
  • Rewrote the functions that control if a specific Trainer Slide should be played.
  • Renamed members of the TrainerSlideType enum to be more clear.
  • Simplied trainer slide calls in src/battle_script_commands.c and src/battle_util.c.
  • Created tests for all existing trainer slides.
  • Added new slide for when enemy lands their first critical hit.
  • Added documentation on adding new trainer slides.

Images

Gif of two automated tests for Trainer Slides running

People who collaborated with me in this PR

@AlexOn1ine, @hedara90, @AsparagusEduardo, @mrgriffin

Feature(s) this PR does NOT handle:

#5565

Things to note in the release changelog:

  • If users created new entries in sTrainerSlides, they will need to be ported to the new system.

Discord contact info

pkmnsnfrn

There is a discussion thread: https://discord.com/channels/419213663107416084/1325604832337465426

Moved trainer slide check conditions to their own functions
Made each trainer a member of the trainerSlides struct
Removed iterating over the entire struct
…STABMoveTrainerSlide

Fixed bug where STAB Trainer Slide was being set too eagerly
IsTrainerSlidePlayed
InitalizeTrainerSlide
MarkTrainerSlideAsPlayed
Moved ShoudldRun from header to main file
Deleted DebugPrintFlippedBits
Added sShouldRunTrainerSlideFunctions Table
Added checking for frontier trainers in DOesTrainerHaveSLideMessage
Created SetTrainerSlideMessage
Changed all aruguments for ShouldRun functions to be unified
Created SetTrainerSlideParamters
Removed switch statement from ShouldDoTrainerSlide and replaced with function table
Added first working test
include/trainer_slide.h Outdated Show resolved Hide resolved
src/trainer_slide.c Outdated Show resolved Hide resolved
@pkmnsnfrn pkmnsnfrn added type: documentation Improvements or additions to documentation category: battle-mechanic Pertains to battle mechanics type: cleanup category: battle-tests Related to the automated test environment type: refactor type: big feature A feature with big diffs and / or high impact / subjectivity / pervasiveness labels Jan 13, 2025
@pkmnsnfrn pkmnsnfrn marked this pull request as ready for review January 15, 2025 05:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category: battle-mechanic Pertains to battle mechanics category: battle-tests Related to the automated test environment type: big feature A feature with big diffs and / or high impact / subjectivity / pervasiveness type: cleanup type: documentation Improvements or additions to documentation type: refactor
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants