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

Add in-battle shadows underneath all enemy battlers #5178

Merged
merged 11 commits into from
Sep 10, 2024

Conversation

lhearachel
Copy link

@lhearachel lhearachel commented Aug 15, 2024

This adds a configurable option to display blob-shadows underneath all enemy battlers.

Description

These changes add new data-fields to the SpeciesInfo struct defining where to position the shadow and what size blob-shadow to draw. All species through Generation 9 are updated with new values. The sprite visualizer has also been updated to support previewing changes to this data for a given species.

All changes to the code controlling how shadow sprites are constructed are masked behind B_ENEMY_MON_SHADOW_STYLE.

Images

shadow preview
shadow data editor
trainer intro
wild intro

Feature(s) this PR does NOT handle:

  1. Enemy battlers that are fainting have their shadow disabled due to a branch in SpriteCB_EnemyShadow; the routine IsBattlerSpritePresent will return FALSE before the battler's fainting animation begins, causing the shadow to be hidden during the fainting cry.
  2. Pokemon that are the target of any animation (including the catching animation) will have their shadow disabled during the ball-throw animation. This is due to gAnimScriptActive being set to TRUE during the Sprite callback.

Discord contact info

lhea

@AlexOn1ine AlexOn1ine added the new-feature Adds a feature label Aug 17, 2024
@hedara90
Copy link
Collaborator

The build fails for me if I try to compile the rom with B_ENEMY_MON_SHADOW_STYLE set to GEN_3.
error: 'struct BattleHealthboxInfo' has no member named 'shadowSpriteIdLeft'; did you mean 'shadowSpriteId'
Getting 8 of those errors.

@lhearachel
Copy link
Author

The build fails for me if I try to compile the rom with B_ENEMY_MON_SHADOW_STYLE set to GEN_3.

Fixed those errors, albeit in a bit of an ugly fashion. I think it would be good to revisit how the sprites themselves are laid out to lessen the preproc reliance (maybe always use left and have right be an extra sprite for gen4?), but I'm not certain on the approach.

Copy link
Collaborator

@hedara90 hedara90 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looked at all shadows.
Found some that I think are just oversights.
More that are personal opinions.
Other than that I think it looks good. But the code this touches isn't my strongest area. Couldn't find anything obviously broken.

src/data/pokemon/species_info/gen_2_families.h Outdated Show resolved Hide resolved
src/data/pokemon/species_info/gen_3_families.h Outdated Show resolved Hide resolved
src/data/pokemon/species_info/gen_5_families.h Outdated Show resolved Hide resolved
src/data/pokemon/species_info/gen_5_families.h Outdated Show resolved Hide resolved
src/data/pokemon/species_info/gen_8_families.h Outdated Show resolved Hide resolved
src/data/pokemon/species_info/gen_8_families.h Outdated Show resolved Hide resolved
@hedara90
Copy link
Collaborator

With B_ENEMY_MON_SHADOW_STYLE set to GEN_3, if the first pokemon to be sent out by an enemy trainer has a shadow under GEN_3 rules, the shadow is present before the pokemon is sent out.

shadow.mp4

@hedara90 hedara90 self-assigned this Sep 2, 2024
@AlexOn1ine
Copy link
Collaborator

I remember that this pr went from using preprocs to normal if conditions. The answer is probably buried somewhere here but why was it reverted to using the preproc again?

Copy link
Collaborator

@hedara90 hedara90 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All functionality seems to be in order now.
Everything I've tested works with both Gen 3 and later gen settings.
The only thing is some whitespace changes.

src/battle_controller_recorded_opponent.c Show resolved Hide resolved
src/battle_controller_recorded_opponent.c Show resolved Hide resolved
src/battle_controller_recorded_opponent.c Outdated Show resolved Hide resolved
src/battle_controller_recorded_opponent.c Show resolved Hide resolved
src/battle_gfx_sfx_util.c Outdated Show resolved Hide resolved
src/battle_gfx_sfx_util.c Outdated Show resolved Hide resolved
src/battle_gfx_sfx_util.c Outdated Show resolved Hide resolved
src/pokemon_sprite_visualizer.c Outdated Show resolved Hide resolved
@lhearachel lhearachel marked this pull request as ready for review September 9, 2024 18:00
@hedara90 hedara90 merged commit b478881 into rh-hideout:upcoming Sep 10, 2024
1 check passed
@AsparagusEduardo AsparagusEduardo added the category: battle-mechanic Pertains to battle mechanics label Dec 1, 2024
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 new-feature Adds a feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants