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 B_ENEMY_THROW_BALLS, B_PLAYER_THROW_BALLS_SOUND, and B_ENEMY_THROW_BALLS_SOUND #4953

Merged
merged 10 commits into from
Jul 14, 2024

Conversation

pkmnsnfrn
Copy link
Collaborator

@pkmnsnfrn pkmnsnfrn commented Jul 12, 2024

Description

Gif of May throwing in a ball

  • Added B_ENEMY_THROW_BALLS, a config that allows enemy Trainers to throw balls into battle.
  • Added B_ENEMY_THROW_BALLS_SOUND / B_PLAYER_THROW_BALLS_SOUND, configs that plays the ball throw sound when a Trainer throws a ball.
  • Refactored SpriteCB_PlayerMonSendOut_1 into SpriteCB_MonSendOut_1 to support both sides of battle.

Usage

B_OPPONENT_THROW_BALLS

>= GEN_6

Enemy Trainers throw their Poké Balls into battle.

< GEN_6

Enemy Trainers drop their Poké Balls into battle. Vanilla behavior.

B_PLAYER_THROW_BALLS_SOUND

>= GEN_5

SE_BALL_THROW is played when Trainers on the player's side throw Poké Balls into battle.

B_ENEMY_THROW_BALLS_SOUND

>= GEN_5

SE_BALL_THROW is played when Trainers on the enemy's side throw Poké Balls into battle.

< GEN_5

No sound is placed played Trainers throw Poké Balls into battle.

Testing

Clean Branch

You can recreate this branch by applying a patch or pulling the repo. From a clean version of expansion's upcoming, you can either:

Patch

wget https://files.catbox.moe/ezgna2.patch -O enemyThrowBall.patch ; git apply enemyThrowBall.patch ; rm enemyThrowBall.patch

Repo

git remote add psf-expansion https://github.com/PokemonSanFran/pokeemerald-expansion/ ; git pull psf-expansion enemyThrowBall

Manual Tests

After replicating the branch, to recreate my testing environment, you can either directly download the debug script and config file, or manually create the changes.

Download

B_ENEMY_THROW_BALLS B_ENEMY_THROW_BALLS_SOUND B_PLAYER_THROW_BALLS_SOUND Command
GEN_9 GEN_9 GEN_9 wget https://files.catbox.moe/81j8ot.h -O include/config/battle.h && wget https://files.catbox.moe/8ow6wi.inc -O data/scripts/debug.inc
GEN_9 GEN_9 GEN_3 wget https://files.catbox.moe/19p0qw.h -O include/config/battle.h && wget https://files.catbox.moe/8ow6wi.inc -O data/scripts/debug.inc
GEN_9 GEN_3 GEN_9 wget https://files.catbox.moe/j4z74g.h -O include/config/battle.h && wget https://files.catbox.moe/8ow6wi.inc -O data/scripts/debug.inc
GEN_3 GEN_9 GEN_9 wget https://files.catbox.moe/pkw2yj.h -O include/config/battle.h && wget https://files.catbox.moe/8ow6wi.inc -O data/scripts/debug.inc
GEN_3 GEN_3 GEN_9 wget https://files.catbox.moe/95xidm.h -O include/config/battle.h && wget https://files.catbox.moe/8ow6wi.inc -O data/scripts/debug.inc
GEN_3 GEN_9 GEN_3 wget https://files.catbox.moe/bdmxjc.h -O include/config/battle.h && wget https://files.catbox.moe/8ow6wi.inc -O data/scripts/debug.inc
GEN_9 GEN_3 GEN_3 wget https://files.catbox.moe/axqlw9.h -O include/config/battle.h && wget https://files.catbox.moe/8ow6wi.inc -O data/scripts/debug.inc
GEN_3 GEN_3 GEN_3 wget https://files.catbox.moe/sltx84.h -O include/config/battle.h && wget https://files.catbox.moe/8ow6wi.inc -O data/scripts/debug.inc

Manual Testing

  • Change B_ENEMY_THROW_BALLS, B_ENEMY_THROW_BALLS_SOUND and B_PLAYER_THROW_BALLS_SOUND to their desired value in include/config/battle.h
  • Change data/scripts/debug.inc to match the one provided
  • Compile the game
  • Start a new save
  • Run Debug Script 1
  • Run Debug Script 2
  • Run Debug Script 3

Verified Scenarios

All videos show the player:

  • Run Debug Script 1
  • Run Debug Script 2
  • Complete a double battle
  • Run Debug Script 3
  • Compelte a single battle

Note

These videos were tested when B_ENEMY_THROW_BALLS_SOUND and B_PLAYER_THROW_BALLS_SOUND were a single config. All of the combinations of B_ENEMY_THROW_BALLS_SOUND and B_ENEMY_THROW_BALLS have been tested, but did not get re-recorded.

B_OPPONENT_THROW_BALLS == GEN_3 && B_THROW_BALLS_SOUND == GEN_3

3_3.mp4

B_OPPONENT_THROW_BALLS == GEN_3 && B_THROW_BALLS_SOUND == GEN_9

3_9.mp4

B_OPPONENT_THROW_BALLS == GEN_9 && B_THROW_BALLS_SOUND == GEN_9

9_9.mp4

B_OPPONENT_THROW_BALLS == GEN_9 && B_THROW_BALLS_SOUND == GEN_3

9_3.mp4

People who collaborated with me in this PR

This feature was originally written by セケツ.

Features this PR does NOT handle:

n/a

Discord Contact Info

I am pkmnsnfrn on Discord.

src/pokeball.c Outdated Show resolved Hide resolved
src/pokeball.c Outdated Show resolved Hide resolved
src/pokeball.c Outdated Show resolved Hide resolved
@pkmnsnfrn
Copy link
Collaborator Author

f06f2b5

Updated patch file in testing section but did not re-test

Comment on lines 270 to 271
#define B_OPPONENT_THROW_BALLS GEN_LATEST // In GEN_6+, opposing Trainers throw PokéBalls into battle instead of just dropping them.
#define B_THROW_BALLS_SOUND GEN_LATEST // In GEN_5+, Trainers PokéBalls make a sound when thrown to send out a Pokémon.
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think it would make sense to connect B_OPPONENT_THROW_BALLS to B_OPPONENT_THROW_BALLS but not vice versa.
so

if  B_OPPONENT_THROW_BALLS is set to false, turn off `B_OPPONENT_THROW_BALLS`

but you would still be able to turn off sound individually.

To be completely honest I would combine both but I understand why you've made it this way.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

To be clear , you are saying

Throw sound doesn't work unless throw balls is on

If you are saying that, are you also implicitly saying

There is no sound effect for the player throwing their ball unless the enemy is throwing theirs

Or do you think I should split it up into

  • player throw sound
  • enemy throw
  • enemy throw sound (only possible when enemy throw is on)

Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm saying that there is a sound effect for the enemy if B_OPPONENT_THROW_BALLS is off which is a bit weird.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I understand that, but executing your suggestion has side effects that I'm trying to confirm are intended or an oversight.

Copy link
Collaborator

Choose a reason for hiding this comment

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

So the player should still have it's sound effect. To be honest this is something that would be more easily solved if we didn't config that at all. Maybe this is worth asking in the senate instead of writing questionable code.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I don't think there is anywhere near important enough to disturb the whole Senate, and I mostly agree with you anyways.

If somebody doesn't like it later, they're welcome to remove the config or merge them back into one - it wasn't hard or a lot of work.

e0ca421

@Bassoonian
Copy link
Collaborator

Current build fails on agbcc

@pkmnsnfrn
Copy link
Collaborator Author

Current build fails on agbcc

@AlexOn1ine why did you inline changes fail? I'll be honest i don't know anything about that change

@AlexOn1ine
Copy link
Collaborator

Current build fails on agbcc

@AlexOn1ine why did you inline changes fail? I'll be honest i don't know anything about that change

you haven't changed the declaration to inline. The compiler already tries to inline functions when it makes sense but if you add the keyword it is a strong indication that it should do it.

@pkmnsnfrn pkmnsnfrn changed the title Add B_OPPONENT_THROW_BALLS and B_THROW_BALLS_SOUND Add B_OPPONENT_THROW_BALLS, B_PLAYER_THROW_BALLS_SOUND, and B_OPPONENT_THROW_BALLS_SOUND Jul 14, 2024
@pkmnsnfrn pkmnsnfrn changed the title Add B_OPPONENT_THROW_BALLS, B_PLAYER_THROW_BALLS_SOUND, and B_OPPONENT_THROW_BALLS_SOUND Add B_ENEMY_THROW_BALLS, B_PLAYER_THROW_BALLS_SOUND, and B_ENEMY_THROW_BALLS_SOUND Jul 14, 2024
@AlexOn1ine AlexOn1ine merged commit 5c38532 into rh-hideout:upcoming Jul 14, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants