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

Gen. 9 Move Effects, 2nd batch #2870

Merged
Merged
Show file tree
Hide file tree
Changes from 16 commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
1595a66
Implemented Triple Arrows' effect
LOuroboros Dec 14, 2022
05a34ed
Implemented Infernal Parade's effect
LOuroboros Dec 14, 2022
d2a221e
Corrected Lunar Blessing's data
LOuroboros Dec 14, 2022
8ae57dc
Implemented Take Heart's effect
LOuroboros Dec 14, 2022
000077f
Implemented Axe Kick's effect
LOuroboros Dec 15, 2022
ed9e860
Post cherrypick corrections and improvements
LOuroboros Mar 26, 2023
5bde987
Completed Take Heart's effect
LOuroboros Mar 29, 2023
977a55b
Merge branch 'upcoming' of https://github.com/rh-hideout/pokeemerald-…
LOuroboros Mar 29, 2023
8c4396d
Gen9 move tests batch2
AlexOn1ine Mar 29, 2023
a59ecf8
Merge pull request #21 from AlexOn1ine/gen9_move_tests_batch2
LOuroboros Mar 29, 2023
318b1ce
Added empty line at the end of test/move_effect_triple_arrows.c
LOuroboros Apr 2, 2023
7d49954
Updates
LOuroboros Apr 15, 2023
43a5aa0
Corrections
LOuroboros Apr 16, 2023
28ce87f
Merge branch 'upcoming' of https://github.com/rh-hideout/pokeemerald-…
LOuroboros Apr 18, 2023
2043380
Oopsie
LOuroboros Apr 18, 2023
787c0a1
Updated Triple Arrows' tests
LOuroboros Apr 18, 2023
b09ab5a
Updated Triple Arrows' effect's code and tests yet again
LOuroboros Apr 19, 2023
313f522
Merge branch 'upcoming' of https://github.com/rh-hideout/pokeemerald-…
LOuroboros Jun 13, 2023
5fbfc11
'Triple Arrows [the move] makeS the foe'... etc
LOuroboros Jun 13, 2023
eb26039
Adjusted Triple Arrows' checks
LOuroboros Jun 13, 2023
3a23207
Applied Alex's corrections to Triple Arrows' tests
LOuroboros Jun 13, 2023
81bb299
Updated Axe Kick's battle script
LOuroboros Jun 13, 2023
9896f20
Applied fixes and corrections (Jun 2023)
LOuroboros Jun 14, 2023
9984a9e
Update src/data/battle_moves.h
LOuroboros Jun 15, 2023
48c04f9
Split Refresh's and Take Heart's effects in AI_CheckViability
LOuroboros Jun 19, 2023
2bf8850
More corrections
LOuroboros Jun 19, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
91 changes: 91 additions & 0 deletions data/battle_scripts_1.s
Original file line number Diff line number Diff line change
Expand Up @@ -424,6 +424,83 @@ gBattleScriptsForMoveEffects::
.4byte BattleScript_EffectDireClaw @ EFFECT_DIRE_CLAW
.4byte BattleScript_EffectBarbBarrage @ EFFECT_BARB_BARRAGE
.4byte BattleScript_EffectRevivalBlessing @ EFFECT_REVIVAL_BLESSING
.4byte BattleScript_EffectTripleArrows @ EFFECT_TRIPLE_ARROWS
.4byte BattleScript_EffectInfernalParade @ EFFECT_INFERNAL_PARADE
.4byte BattleScript_EffectTakeHeart @ EFFECT_TAKE_HEART
.4byte BattleScript_EffectAxeKick @ EFFECT_AXE_KICK

BattleScript_EffectAxeKick::
LOuroboros marked this conversation as resolved.
Show resolved Hide resolved
attackcanceler
accuracycheck BattleScript_AxeKickMissedDoDamage, ACC_CURR_MOVE
typecalc
jumpifhalfword CMP_COMMON_BITS, gMoveResultFlags, MOVE_RESULT_DOESNT_AFFECT_FOE, BattleScript_AxeKickMissedDoDamage
goto BattleScript_AxeKickHitFromAtkString
BattleScript_AxeKickMissedDoDamage::
jumpifability BS_ATTACKER, ABILITY_MAGIC_GUARD, BattleScript_PrintMoveMissed
attackstring
ppreduce
pause B_WAIT_TIME_LONG
resultmessage
waitmessage B_WAIT_TIME_LONG
printstring STRINGID_PKMNCRASHED
waitmessage B_WAIT_TIME_LONG
damagecalc
typecalc
adjustdamage
manipulatedamage DMG_RECOIL_FROM_MISS
bichalfword gMoveResultFlags, MOVE_RESULT_MISSED | MOVE_RESULT_DOESNT_AFFECT_FOE
orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_IGNORE_DISGUISE
healthbarupdate BS_ATTACKER
datahpupdate BS_ATTACKER
tryfaintmon BS_ATTACKER
orhalfword gMoveResultFlags, MOVE_RESULT_MISSED | MOVE_RESULT_DOESNT_AFFECT_FOE
goto BattleScript_MoveEnd

BattleScript_AxeKickHitFromAtkString:
attackstring
ppreduce
critcalc
damagecalc
adjustdamage
attackanimation
waitanimation
effectivenesssound
hitanimation BS_TARGET
waitstate
healthbarupdate BS_TARGET
datahpupdate BS_TARGET
critmessage
waitmessage B_WAIT_TIME_LONG
resultmessage
waitmessage B_WAIT_TIME_LONG
setmoveeffect MOVE_EFFECT_CONFUSION
seteffectwithchance
tryfaintmon BS_TARGET
moveendall
end

BattleScript_EffectTakeHeart::
LOuroboros marked this conversation as resolved.
Show resolved Hide resolved
attackcanceler
attackstring
ppreduce
cureifburnedparalysedorpoisoned BattleScript_EffectTakeHeart_TryToRaiseStats
attackanimation
waitanimation
updatestatusicon BS_ATTACKER
printstring STRINGID_PKMNSTATUSNORMAL
waitmessage B_WAIT_TIME_LONG
jumpifstat BS_ATTACKER, CMP_LESS_THAN, STAT_SPATK, MAX_STAT_STAGE, BattleScript_CalmMindStatRaise
jumpifstat BS_ATTACKER, CMP_LESS_THAN, STAT_SPDEF, MAX_STAT_STAGE, BattleScript_CalmMindStatRaise
goto BattleScript_CantRaiseMultipleStats

BattleScript_EffectTakeHeart_TryToRaiseStats:

Choose a reason for hiding this comment

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

This isn't needed. Jump directly to Calm Mind after the ppreduce.

jumpifstat BS_ATTACKER, CMP_LESS_THAN, STAT_SPATK, MAX_STAT_STAGE, BattleScript_CalmMindDoMoveAnim
jumpifstat BS_ATTACKER, CMP_LESS_THAN, STAT_SPDEF, MAX_STAT_STAGE, BattleScript_CalmMindDoMoveAnim
goto BattleScript_CantRaiseMultipleStats

BattleScript_EffectTripleArrows::
setmoveeffect MOVE_EFFECT_TRIPLE_ARROWS
goto BattleScript_EffectHit

BattleScript_EffectRevivalBlessing::
attackcanceler
Expand Down Expand Up @@ -1470,6 +1547,18 @@ BattleScript_DoubleShockRemoveType::
waitmessage B_WAIT_TIME_LONG
return

BattleScript_DefDown::
modifybattlerstatstage BS_TARGET, STAT_DEF, DECREASE, 1, BattleScript_DefDown_Ret, ANIM_ON
BattleScript_DefDown_Ret:
return

BattleScript_ReduceDefenseAndFlinch::

Choose a reason for hiding this comment

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

This battle script isn't in use anymore.

modifybattlerstatstage BS_TARGET, STAT_DEF, DECREASE, 1, BattleScript_DefDown_Ret, ANIM_ON
jumpifability BS_TARGET, ABILITY_INNER_FOCUS, BattleScript_FlinchPrevention
LOuroboros marked this conversation as resolved.
Show resolved Hide resolved
setmoveeffect MOVE_EFFECT_FLINCH
seteffectprimary
goto BattleScript_MoveEnd
LOuroboros marked this conversation as resolved.
Show resolved Hide resolved

BattleScript_EffectPurify:
attackcanceler
attackstring
Expand Down Expand Up @@ -3460,6 +3549,7 @@ BattleScript_AbsorbHealBlock::
tryfaintmon BS_TARGET
goto BattleScript_MoveEnd

BattleScript_EffectInfernalParade::
BattleScript_EffectBurnHit::
setmoveeffect MOVE_EFFECT_BURN
goto BattleScript_EffectHit
Expand Down Expand Up @@ -6320,6 +6410,7 @@ BattleScript_EffectCalmMind::
BattleScript_CalmMindDoMoveAnim::
attackanimation
waitanimation
BattleScript_CalmMindStatRaise::
setbyte sSTAT_ANIM_PLAYED, FALSE
playstatchangeanimation BS_ATTACKER, BIT_SPATK | BIT_SPDEF, 0
setstatchanger STAT_SPATK, 1, FALSE
Expand Down
2 changes: 2 additions & 0 deletions include/battle_scripts.h
Original file line number Diff line number Diff line change
Expand Up @@ -461,6 +461,8 @@ extern const u8 BattleScript_CouldntFullyProtect[];
extern const u8 BattleScript_MoveEffectStockpileWoreOff[];
extern const u8 BattleScript_StealthRockActivates[];
extern const u8 BattleScript_SpikesActivates[];
extern const u8 BattleScript_DefDown[];
extern const u8 BattleScript_ReduceDefenseAndFlinch[];

// zmoves
extern const u8 BattleScript_ZMoveActivateDamaging[];
Expand Down
3 changes: 2 additions & 1 deletion include/constants/battle.h
Original file line number Diff line number Diff line change
Expand Up @@ -376,8 +376,9 @@
#define MOVE_EFFECT_DIRE_CLAW 74
#define MOVE_EFFECT_STEALTH_ROCK 75
#define MOVE_EFFECT_SPIKES 76
#define MOVE_EFFECT_TRIPLE_ARROWS 77

#define NUM_MOVE_EFFECTS 77
#define NUM_MOVE_EFFECTS 78

#define MOVE_EFFECT_AFFECTS_USER 0x4000
#define MOVE_EFFECT_CERTAIN 0x8000
Expand Down
6 changes: 5 additions & 1 deletion include/constants/battle_move_effects.h
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,11 @@
#define EFFECT_DIRE_CLAW 399
#define EFFECT_BARB_BARRAGE 400
#define EFFECT_REVIVAL_BLESSING 401
#define EFFECT_TRIPLE_ARROWS 402
#define EFFECT_INFERNAL_PARADE 403
#define EFFECT_TAKE_HEART 404
#define EFFECT_AXE_KICK 405

#define NUM_BATTLE_MOVE_EFFECTS 402
#define NUM_BATTLE_MOVE_EFFECTS 406

#endif // GUARD_CONSTANTS_BATTLE_MOVE_EFFECTS_H
2 changes: 2 additions & 0 deletions include/random.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ enum RandomTag
RNG_STATIC,
RNG_STENCH,
RNG_TRI_ATTACK,
RNG_TRIPLE_ARROWS_DEFENSE_DOWN,
RNG_TRIPLE_ARROWS_FLINCH,
};

#define RandomWeighted(tag, ...) \
Expand Down
33 changes: 31 additions & 2 deletions src/battle_ai_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -2632,6 +2632,23 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score)
&& AI_WhoStrikesFirst(battlerAtk, battlerDef, move) == AI_IS_SLOWER)
score -= 10;
break;
case EFFECT_JUNGLE_HEALING:
if (AtMaxHp(battlerAtk)
&& AtMaxHp(BATTLE_PARTNER(battlerAtk))
&& !(gBattleMons[battlerAtk].status1 & STATUS1_ANY)
&& !(gBattleMons[BATTLE_PARTNER(battlerAtk)].status1 & STATUS1_ANY))
score -= 10;
else if (AI_DATA->hpPercents[battlerAtk] >= 90 || AI_DATA->hpPercents[BATTLE_PARTNER(battlerAtk)] >= 90)
Copy link

@Skeli789 Skeli789 Jun 13, 2023

Choose a reason for hiding this comment

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

And what if either the attacker or partner has a status condition? It would be better if that was checked for as well. Take for instance both the attacker and partner are at full HP but are paralyzed. The AI would choose not to use Jungle Healing because of the current logic.

Copy link
Collaborator

Choose a reason for hiding this comment

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

That's what

             && !(gBattleMons[battlerAtk].status1 & STATUS1_ANY)
             && !(gBattleMons[BATTLE_PARTNER(battlerAtk)].status1 & STATUS1_ANY))

is for. if they're both at max health AND both it and its partner have no status condition, reduce 10 from the score.

Choose a reason for hiding this comment

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

Here's how it reads currently. If both the attacker and partner are all full health and neither the attacker nor the partner have a status condition, do score - 10. So far so good. But I'm commenting on the next block that is entered if either mon isn't at full health or either mon has a status condition. This second block is saying that if either mon has more than 90% of their HP remaining, do score - 10.

So take for instance another case. Attacker is at 1 HP remaining while the partner is at full health. The AI_DATA->hpPercents[BATTLE_PARTNER(battlerAtk)] >= 90 condition will evaluate to TRUE causing score - 9. This is clearly not what's wanted.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Ah, gotcha, I misread it. An && would be needed for the HP percent, but it's not checking status in the second block. Do you think that's ok?

score -= 9; //No point in healing, but should at least do it if nothing better
break;
case EFFECT_TAKE_HEART:
LOuroboros marked this conversation as resolved.
Show resolved Hide resolved
if ((!(gBattleMons[battlerAtk].status1 & STATUS1_ANY)
|| PartnerMoveIs(BATTLE_PARTNER(battlerAtk), AI_DATA->partnerMove, MOVE_JUNGLE_HEALING)
|| PartnerMoveIs(BATTLE_PARTNER(battlerAtk), AI_DATA->partnerMove, MOVE_HEAL_BELL)
|| PartnerMoveIs(BATTLE_PARTNER(battlerAtk), AI_DATA->partnerMove, MOVE_AROMATHERAPY))
&& !BattlerStatCanRise(battlerAtk, AI_DATA->abilities[battlerAtk], STAT_SPATK)
&& !BattlerStatCanRise(battlerAtk, AI_DATA->abilities[battlerAtk], STAT_SPDEF))
break;
case EFFECT_PLACEHOLDER:
return 0; // cannot even select
} // move effect checks
Expand Down Expand Up @@ -3744,7 +3761,7 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score)
case EFFECT_WISH:
case EFFECT_HEAL_BELL:
if (ShouldUseWishAromatherapy(battlerAtk, battlerDef, move))
score += 7;
score += 3;
break;
case EFFECT_THIEF:
{
Expand Down Expand Up @@ -4379,7 +4396,10 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score)
score++;
break;
case EFFECT_REFRESH:
if (gBattleMons[battlerAtk].status1 & STATUS1_ANY)
case EFFECT_TAKE_HEART:
LOuroboros marked this conversation as resolved.
Show resolved Hide resolved
if (gBattleMons[battlerAtk].status1 & STATUS1_ANY
|| BattlerStatCanRise(battlerAtk, AI_DATA->abilities[battlerAtk], STAT_SPATK)
LOuroboros marked this conversation as resolved.
Show resolved Hide resolved
|| BattlerStatCanRise(battlerAtk, AI_DATA->abilities[battlerAtk], STAT_SPDEF))
score += 2;
break;
case EFFECT_PSYCHO_SHIFT:
Expand Down Expand Up @@ -4829,6 +4849,15 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score)
//break;
//case EFFECT_SKY_DROP
//break;
case EFFECT_JUNGLE_HEALING:
if (ShouldRecover(battlerAtk, battlerDef, move, 25)
|| ShouldRecover(battlerAtk, BATTLE_PARTNER(battlerDef), move, 25)
|| ShouldRecover(BATTLE_PARTNER(battlerAtk), battlerDef, move, 25)
|| ShouldRecover(BATTLE_PARTNER(battlerAtk), BATTLE_PARTNER(battlerDef), move, 25)
LOuroboros marked this conversation as resolved.
Show resolved Hide resolved
|| gBattleMons[battlerAtk].status1 & STATUS1_ANY
|| gBattleMons[BATTLE_PARTNER(battlerAtk)].status1 & STATUS1_ANY)
score += 3;
break;
} // move effect checks

return score;
Expand Down
1 change: 1 addition & 0 deletions src/battle_ai_util.c
Original file line number Diff line number Diff line change
Expand Up @@ -2029,6 +2029,7 @@ bool32 IsHealingMoveEffect(u16 effect)
case EFFECT_HEALING_WISH:
case EFFECT_HEAL_PULSE:
case EFFECT_REST:
case EFFECT_JUNGLE_HEALING:
return TRUE;
default:
return FALSE;
Expand Down
1 change: 1 addition & 0 deletions src/battle_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -4756,6 +4756,7 @@ s8 GetMovePriority(u32 battlerId, u16 move)
case EFFECT_SOFTBOILED:
case EFFECT_ABSORB:
case EFFECT_ROOST:
case EFFECT_JUNGLE_HEALING:
priority += 3;
break;
}
Expand Down
47 changes: 47 additions & 0 deletions src/battle_script_commands.c
Original file line number Diff line number Diff line change
Expand Up @@ -3801,6 +3801,53 @@ void SetMoveEffect(bool32 primary, u32 certain)
gBattlescriptCurrInstr = BattleScript_SpikesActivates;
}
break;
case MOVE_EFFECT_TRIPLE_ARROWS:
LOuroboros marked this conversation as resolved.
Show resolved Hide resolved
{
u8 randomLowerDefenseChance;
u8 randomFlinchChance;

if (GetBattlerAbility(gBattlerAttacker) == ABILITY_SERENE_GRACE)
LOuroboros marked this conversation as resolved.
Show resolved Hide resolved
{
randomLowerDefenseChance = RandomPercentage(RNG_TRIPLE_ARROWS_DEFENSE_DOWN, 100);
randomFlinchChance = RandomPercentage(RNG_TRIPLE_ARROWS_FLINCH, 60);
LOuroboros marked this conversation as resolved.
Show resolved Hide resolved
}
else
{
randomLowerDefenseChance = RandomPercentage(RNG_TRIPLE_ARROWS_DEFENSE_DOWN, 50);
randomFlinchChance = RandomPercentage(RNG_TRIPLE_ARROWS_FLINCH, 30);
}

if (randomLowerDefenseChance && randomFlinchChance)
{
BattleScriptPush(gBattlescriptCurrInstr + 1);
gBattlescriptCurrInstr = BattleScript_ReduceDefenseAndFlinch;
}
else
{
if (randomLowerDefenseChance)
{
BattleScriptPush(gBattlescriptCurrInstr + 1);
gBattlescriptCurrInstr = BattleScript_DefDown;
}
else if (randomFlinchChance)
{
if (battlerAbility == ABILITY_INNER_FOCUS)
{
gLastUsedAbility = ABILITY_INNER_FOCUS;
gBattlerAbility = gEffectBattler;
RecordAbilityBattle(gEffectBattler, ABILITY_INNER_FOCUS);
gBattlescriptCurrInstr = BattleScript_FlinchPrevention;
LOuroboros marked this conversation as resolved.
Show resolved Hide resolved
}
else
{
if (GetBattlerTurnOrderNum(gEffectBattler) > gCurrentTurnActionNumber)
gBattleMons[gEffectBattler].status2 |= sStatusFlagsForMoveEffects[MOVE_EFFECT_FLINCH];
gBattlescriptCurrInstr++;
}
}
}
}
break;

Choose a reason for hiding this comment

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

This whole section is still incredibly hacky with a lot of duplicate code. Even if it works, it would be best if cleaned up.

Copy link
Collaborator Author

@LOuroboros LOuroboros Apr 18, 2023

Choose a reason for hiding this comment

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

I didn't keep it like that because it worked, but because I couldn't come up with something better and that worked.

I've been staring really hard and scratching my peanut sized brain some more, and I think this is a nice improvement and it still seems to work. Probably the farthest I can personally go.

https://diffy.org/diff/9f85000bb97c8

EDIT: Ignore the double semicolon in the call at Cmd_seteffectwithchance. Fixed.

Choose a reason for hiding this comment

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

I don't think you're giving yourself enough credit 🙂
Take it slow, and take a break if you need to. I'm sure after enough time you'll be able to figure it out! Hacky code can often lead to unwanted bugs down the line. It's better to take it slow and write something that if modified in the future will stay bug-free.

Choose a reason for hiding this comment

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

I stand by my earlier statement, this section has still not been fixed.

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, that's why I haven't resolved the conversation.

Still, I can't do more than I did here, so we're at an impasse.

Choose a reason for hiding this comment

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

Just do

u8 randomLowerDefenseChance = RandomPercentage(RNG_TRIPLE_ARROWS_DEFENSE_DOWN, GetMoveSecondaryEffectChance(gBattlerAttacker, 50));
u8 randomFlinchChance = RandomPercentage(RNG_TRIPLE_ARROWS_FLINCH, GetMoveSecondaryEffectChance(gBattlerAttacker, 30));

if (randomFlinchChance
&& battlerAbility != ABILITY_INNER_FOCUS
&& GetBattlerTurnOrderNum(gEffectBattler) > gCurrentTurnActionNumber)
{
    gBattleMons[gEffectBattler].status2 |= sStatusFlagsForMoveEffects[MOVE_EFFECT_FLINCH];
}

if (randomLowerDefenseChance)
{
    BattleScriptPush(gBattlescriptCurrInstr + 1);
    gBattlescriptCurrInstr = BattleScript_DefDown;
}
else
    gBattlescriptCurrInstr++;

If your tests fail because of this change, might be worth reworking those.

}
}
}
Expand Down
1 change: 1 addition & 0 deletions src/battle_util.c
Original file line number Diff line number Diff line change
Expand Up @@ -8547,6 +8547,7 @@ static u16 CalcMoveBasePower(u16 move, u8 battlerAtk, u8 battlerDef)
basePower = 120 * gBattleMons[battlerDef].hp / gBattleMons[battlerDef].maxHP;
break;
case EFFECT_HEX:
case EFFECT_INFERNAL_PARADE:
if (gBattleMons[battlerDef].status1 & STATUS1_ANY || GetBattlerAbility(battlerDef) == ABILITY_COMATOSE)
basePower *= 2;
break;
Expand Down
19 changes: 10 additions & 9 deletions src/data/battle_moves.h
Original file line number Diff line number Diff line change
Expand Up @@ -12726,29 +12726,30 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] =
{
#if B_UPDATED_MOVE_DATA >= GEN_9

Choose a reason for hiding this comment

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

...This move has only been in a main series game since Gen 9? Why is this needed? (PLA is not considered a main series game in the same sense as all of the other ones).

Copy link
Collaborator Author

@LOuroboros LOuroboros Jun 14, 2023

Choose a reason for hiding this comment

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

Well, Nintendo does seem to consider it a main game.

Regardless, as it's explained in some of the comments at include/config/battle.h, we're considering LA a Gen. 8 Game (so we can have a configuration like this one for Triple Arrows because adding sub-version labels like GEN_9_LA was rejected), and in PLA, Triple Arrows had a power of 50 and a base amount of PP of 15.

"Why is it [the config for Triple Arrows] needed?" It isn't. I highly doubt someone will want to make use of Triple Arrows' LA data which makes the move weaker, but I have to cover my bases. We have configurations for a lot of different things, and the different aspects of move data is one of them.

I'm just going with the flow, and for better or worse, the expansion wants to have configurations for every little thing possible.

Choose a reason for hiding this comment

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

it might be better in that case to invert the condition and make a special define for PLA moves (such as #ifdef PLA_MOVE_EFFECTS) since they don't belong to any gen. That way if someone wants the moves to do what they did in PLA, they'll get all moves that existed in PLA to do what they did.

Copy link
Collaborator

Choose a reason for hiding this comment

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

since they don't belong to any gen

PLA is Gen 8, but I get what you mean. Since we're not planning on adding PLA's combat mechanics, having the PLA data for these moves and not others is a bit redundant.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

How do you want me to proceed then, @AsparagusEduardo?

Should I just remove the move config for the PLA moves?

Copy link
Collaborator

Choose a reason for hiding this comment

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

I'd say so, yeah.

.power = 90,
.pp = 10,
#else
.power = 50,
.pp = 15,
#endif
.effect = EFFECT_PLACEHOLDER, // EFFECT_TRIPLE_ARROWS,
.effect = EFFECT_TRIPLE_ARROWS,
.type = TYPE_FIGHTING,
.accuracy = 100,
.pp = 15,
.secondaryEffectChance = 100,
LOuroboros marked this conversation as resolved.
Show resolved Hide resolved
.target = MOVE_TARGET_SELECTED,
.priority = 0,
.flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_SHEER_FORCE_BOOST,
.flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_SHEER_FORCE_BOOST | FLAG_HIGH_CRIT,

Choose a reason for hiding this comment

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

All moves that have a flinch chance are not affected by King's Rock.

.split = SPLIT_PHYSICAL,
.zMoveEffect = Z_EFFECT_NONE,
},

[MOVE_INFERNAL_PARADE] =
{
.effect = EFFECT_PLACEHOLDER, // EFFECT_INFERNAL_PARADE,
.effect = EFFECT_INFERNAL_PARADE,
.power = 60,
.type = TYPE_GHOST,
.accuracy = 100,
.pp = 15,
.secondaryEffectChance = 0,
.secondaryEffectChance = 30,
.target = MOVE_TARGET_SELECTED,
.priority = 0,
.flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_SHEER_FORCE_BOOST,
Expand Down Expand Up @@ -12834,7 +12835,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] =

[MOVE_LUNAR_BLESSING] =
{
.effect = EFFECT_PLACEHOLDER, // EFFECT_LUNAR_BLESSING,
.effect = EFFECT_JUNGLE_HEALING,
.power = 0,
.type = TYPE_PSYCHIC,
.accuracy = 0,
Expand All @@ -12849,7 +12850,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] =

[MOVE_TAKE_HEART] =
{
.effect = EFFECT_PLACEHOLDER, // EFFECT_TAKE_HEART,
.effect = EFFECT_TAKE_HEART,
.power = 0,
.type = TYPE_PSYCHIC,
.accuracy = 0,
Expand Down Expand Up @@ -12894,12 +12895,12 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] =

[MOVE_AXE_KICK] =
{
.effect = EFFECT_PLACEHOLDER, // EFFECT_RECOIL_IF_MISS + 30% chance to confuse
.effect = EFFECT_AXE_KICK,
.power = 120,
.type = TYPE_FIGHTING,
.accuracy = 90,
.pp = 10,
.secondaryEffectChance = 0,
.secondaryEffectChance = 30,
.target = MOVE_TARGET_SELECTED,
.priority = 0,
.flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_SHEER_FORCE_BOOST,
Expand Down
Loading