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

Removed gFlingTable from comments and added .flingEffects to src/data/moves_info.h for ai use (and future use?) #6131

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

ShadowzLmao2
Copy link

@ShadowzLmao2 ShadowzLmao2 commented Jan 28, 2025

Description

It removes the commented out gFlingTable and instead adds .flingEffect into the moves_info.c file. It gets used by the AI and soon to be used to find the effect of a flung item (to be done)

Images

Shown in #6130 for code, may be slightly outdated

Issue(s) that this PR fixes

Completes the TODO section of the AI that uses Fling

People who collaborated with me in this PR

Do I mention reviewers? Also hopefully someone to finish this

Feature(s) this PR does NOT handle:

Completing the AI that uses Fling. This only allows people to be able to use fling in the AI and in other places.

Things to note in the release changelog:

  • New items with fling effects must be given the .flingEffect = MOVE_EFFECT_... in the src/data/moves_info.c file, and for now also need it in the code that uses fling

Discord contact info

ShadowzLmao#3643

@AsparagusEduardo
Copy link
Collaborator

Can you also make it so that the actual effect also reads from this new field instead of just the AI?

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.

Fill in the PR body.

include/constants/battle.h Show resolved Hide resolved
@@ -4271,27 +4274,29 @@ static u32 AI_CalcMoveEffectScore(u32 battlerAtk, u32 battlerDef, u32 move)
ADJUST_SCORE(DECENT_EFFECT);
break;
case EFFECT_FLING:
/* TODO
switch (gFlingTable[aiData->items[battlerAtk]].effect)
u8 effect = gItemsInfo[gBattleMons[battlerAtk].item].flingEffect;
Copy link
Collaborator

Choose a reason for hiding this comment

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

"Label followed by a declaration" will fail to compile on some compilers.

src/battle_ai_util.c Outdated Show resolved Hide resolved
if (!CanBeFrozen(battlerDef, TRUE)
|| MoveBlockedBySubstitute(move, battlerAtk, battlerDef))
ADJUST_SCORE(-10);
case MOVE_EFFECT_FLINCH:
Copy link
Collaborator

Choose a reason for hiding this comment

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

This should be filled in, other flinching effects already have score adjustments.

@ShadowzLmao2
Copy link
Author

I didn't intend to include the truant stuff, but the ai stuff i didn't want to add anything into, i just uncommented everything that was there and fixed the burn code to compile for me. also i dont know how i missed that i skipped 88

@ShadowzLmao2
Copy link
Author

ShadowzLmao2 commented Jan 29, 2025

Can you also make it so that the actual effect also reads from this new field instead of just the AI?

I might be able to, but I would be better leaving that to someone else. I'll see what I can do. Where would I make changes though?

@ShadowzLmao2
Copy link
Author

I figured out why 88 was skipped in the include file. My branch has Rapid spin still in there, so when i copy pasted onto a fresh branch I didn't realize it wasnt there

@AsparagusEduardo
Copy link
Collaborator

@AsparagusEduardo
Copy link
Collaborator

I might be able to, but I would be better leaving that to someone else. I'll see what I can do. Where would I make changes though?

I would not accept it on this state, as you're adding unusable move effects. Search for Fling on the repo to see shere you need to do thr changes

@ShadowzLmao2
Copy link
Author

@ShadowzLmao2
Copy link
Author

ShadowzLmao2 commented Jan 29, 2025

I added actualy fuctionality for the .flingEffect
I don't do anything with macros, so idk whats wrong

I might be able to, but I would be better leaving that to someone else. I'll see what I can do. Where would I make changes though?

I would not accept it on this state, as you're adding unusable move effects. Search for Fling on the repo to see shere you need to do thr changes

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