Applied more review fixes

This commit is contained in:
Nephrite 2024-01-12 03:02:48 +09:00
parent 3c93f97166
commit a76e3c70ba
24 changed files with 120 additions and 72 deletions

View file

@ -55,7 +55,7 @@ gBattleScriptsForMoveEffects::
.4byte BattleScript_EffectOHKO @ EFFECT_OHKO
.4byte BattleScript_EffectHit @ EFFECT_FUSION_COMBO
.4byte BattleScript_EffectSuperFang @ EFFECT_SUPER_FANG
.4byte BattleScript_EffectArgFixedDamage @ EFFECT_ARG_FIXED_DAMAGE
.4byte BattleScript_EffectFixedDamageArg @ EFFECT_FIXED_DAMAGE_ARG
.4byte BattleScript_EffectHealBlock @ EFFECT_HEAL_BLOCK
.4byte BattleScript_EffectRecoilIfMiss @ EFFECT_RECOIL_IF_MISS
.4byte BattleScript_EffectMist @ EFFECT_MIST
@ -1430,17 +1430,20 @@ BattleScript_FailIfNotArgType:
goto BattleScript_HitFromCritCalc
BattleScript_RemoveFireType::
losetype BS_ATTACKER, TYPE_FIRE
printstring STRINGID_ATTACKERLOSTFIRETYPE
waitmessage B_WAIT_TIME_LONG
return
BattleScript_RemoveElectricType::
losetype BS_ATTACKER, TYPE_ELECTRIC
printstring STRINGID_ATTACKERLOSTELECTRICTYPE
waitmessage B_WAIT_TIME_LONG
return
BattleScript_RemoveGenericType::
printstring STRINGID_ATTACKERLOSTITSTYPE
waitmessage B_WAIT_TIME_LONG
return
BattleScript_DefDown::
modifybattlerstatstage BS_TARGET, STAT_DEF, DECREASE, 1, BattleScript_DefDown_Ret, ANIM_ON
BattleScript_DefDown_Ret:
@ -4816,7 +4819,7 @@ BattleScript_EffectBatonPass::
switchineffects BS_ATTACKER
goto BattleScript_MoveEnd
BattleScript_EffectArgFixedDamage::
BattleScript_EffectFixedDamageArg::
attackcanceler
accuracycheck BattleScript_PrintMoveMissed, ACC_CURR_MOVE
attackstring

View file

@ -523,6 +523,7 @@ extern const u8 BattleScript_EffectRaiseCritAlliesAnim[];
extern const u8 BattleScript_EffectHealOneSixthAllies[];
extern const u8 BattleScript_EffectCureStatusAllies[];
extern const u8 BattleScript_EffectRecycleBerriesAllies[];
extern const u8 BattleScript_RemoveGenericType[];
// dynamax and max raids
extern const u8 BattleScript_DynamaxBegins[];

View file

@ -247,5 +247,6 @@ bool32 MoveEffectIsGuaranteed(u32 battler, u32 battlerAbility, const struct Addi
u8 GetBattlerType(u32 battler, u8 typeIndex);
bool8 CanMonParticipateInSkyBattle(struct Pokemon *mon);
bool8 IsMonBannedFromSkyBattles(u16 species);
void RemoveBattlerType(u32 battler, u8 type);
#endif // GUARD_BATTLE_UTIL_H

View file

@ -34,7 +34,7 @@
#define EFFECT_OHKO 30
#define EFFECT_FUSION_COMBO 31
#define EFFECT_SUPER_FANG 32
#define EFFECT_ARG_FIXED_DAMAGE 33
#define EFFECT_FIXED_DAMAGE_ARG 33
#define EFFECT_HEAL_BLOCK 34
#define EFFECT_RECOIL_IF_MISS 35
#define EFFECT_MIST 36

View file

@ -699,8 +699,9 @@
#define STRINGID_HOSPITALITYRESTORATION 697
#define STRINGID_ELECTROSHOCKCHARGING 698
#define STRINGID_ITEMWASUSEDUP 699
#define STRINGID_ATTACKERLOSTITSTYPE 700
#define BATTLESTRINGS_COUNT 700
#define BATTLESTRINGS_COUNT 701
// This is the string id that gBattleStringsTable starts with.
// String ids before this (e.g. STRINGID_INTROMSG) are not in the table,

View file

@ -451,8 +451,9 @@ struct BattleMove
u16 accuracy:7;
u16 recoil:7;
u16 criticalHitStage:2;
u8 padding:6; // coming soon...
u8 numAdditionalEffects:2; // limited to 3 - don't want to get too crazy
u8 pp;
u8 secondaryEffectChance;
u16 target;
s8 priority;
@ -507,9 +508,8 @@ struct BattleMove
u32 parentalBondBanned:1;
u32 skyBattleBanned:1;
u32 sketchBanned:1;
u32 numAdditionalEffects:2; // limited to 3 - don't want to get too crazy
u16 argument;
u32 argument; // also coming soon
// primary/secondary effects
const struct AdditionalEffect *additionalEffects;

View file

@ -1639,7 +1639,7 @@ static s32 AI_CheckBadMove(u32 battlerAtk, u32 battlerDef, u32 move, s32 score)
}
break;
case EFFECT_PRESENT:
case EFFECT_ARG_FIXED_DAMAGE:
case EFFECT_FIXED_DAMAGE_ARG:
case EFFECT_FOCUS_PUNCH:
// AI_CBM_HighRiskForDamage
if (aiData->abilities[battlerDef] == ABILITY_WONDER_GUARD && effectiveness < AI_EFFECTIVENESS_x2)

View file

@ -511,7 +511,7 @@ s32 AI_CalcDamage(u32 move, u32 battlerAtk, u32 battlerDef, u8 *typeEffectivenes
case EFFECT_PSYWAVE:
dmg = gBattleMons[battlerAtk].level * (aiData->abilities[battlerAtk] == ABILITY_PARENTAL_BOND ? 2 : 1);
break;
case EFFECT_ARG_FIXED_DAMAGE:
case EFFECT_FIXED_DAMAGE_ARG:
dmg = gBattleMoves[move].argument * (aiData->abilities[battlerAtk] == ABILITY_PARENTAL_BOND ? 2 : 1);
break;
case EFFECT_MULTI_HIT:

View file

@ -436,7 +436,7 @@ static u8 GetMaxPowerTier(u16 move)
case EFFECT_TERRAIN_PULSE:
case EFFECT_PUNISHMENT:
case EFFECT_TRUMP_CARD:
case EFFECT_ARG_FIXED_DAMAGE:
case EFFECT_FIXED_DAMAGE_ARG:
case EFFECT_SPIT_UP:
case EFFECT_NATURAL_GIFT:
case EFFECT_MIRROR_COAT:

View file

@ -836,6 +836,7 @@ static const u8 sText_TheSwampDisappeared[] = _("The swamp around {B_ATK_TEAM2}\
static const u8 sText_HospitalityRestoration[] = _("The {B_ATK_PARTNER_NAME} drank down all\nthe matcha that Sinistcha made!");
static const u8 sText_ElectroShockCharging[] = _("{B_ATK_NAME_WITH_PREFIX} absorbed\nelectricity!");
static const u8 sText_ItemWasUsedUp[] = _("The {B_LAST_ITEM}\nwas used up...");
static const u8 sText_AttackerLostItsType[] = _("{B_ATK_NAME_WITH_PREFIX} lost\nits {B_BUFF1} type!");
const u8 *const gBattleStringsTable[BATTLESTRINGS_COUNT] =
{
@ -1527,6 +1528,7 @@ const u8 *const gBattleStringsTable[BATTLESTRINGS_COUNT] =
[STRINGID_TEAMGAINEDEXP - BATTLESTRINGS_TABLE_START] = sText_TeamGainedEXP,
[STRINGID_TARGETCOVEREDINSTICKYCANDYSYRUP - BATTLESTRINGS_TABLE_START] = sText_TargetCoveredInStickyCandySyrup,
[STRINGID_ITEMWASUSEDUP - BATTLESTRINGS_TABLE_START] = sText_ItemWasUsedUp,
[STRINGID_ATTACKERLOSTITSTYPE - BATTLESTRINGS_TABLE_START] = sText_AttackerLostItsType,
};
const u16 gTrainerUsedItemStringIds[] =

View file

@ -2753,6 +2753,17 @@ void StealTargetItem(u8 battlerStealer, u8 battlerItem)
return; \
}
// For a future update...
// #define INCREMENT_RETURN_ON_PARENTAL_BOND_1ST_HIT \
// { \
// if (gSpecialStatuses[gBattlerAttacker].parentalBondState == PARENTAL_BOND_1ST_HIT \
// && gBattleMons[gEffectBattler].hp != 0) \
// { \
// gBattlescriptCurrInstr++; \
// return; \
// } \
// }
void SetMoveEffect(bool32 primary, bool32 certain)
{
s32 i, affectsUser = 0;
@ -3652,15 +3663,17 @@ void SetMoveEffect(bool32 primary, bool32 certain)
BattleScriptPush(gBattlescriptCurrInstr + 1);
switch (gBattleMoves[gCurrentMove].argument)
{
case TYPE_FIRE:
case TYPE_FIRE: // Burn Up
gBattlescriptCurrInstr = BattleScript_RemoveFireType;
break;
case TYPE_ELECTRIC:
case TYPE_ELECTRIC: // Electro Shot
gBattlescriptCurrInstr = BattleScript_RemoveElectricType;
break;
default: // to do - add a generic case
default:
gBattlescriptCurrInstr = BattleScript_RemoveGenericType;
break;
}
RemoveBattlerType(gEffectBattler, gBattleMoves[gCurrentMove].argument);
break;
case MOVE_EFFECT_ROUND:
TryUpdateRoundTurnOrder(); // If another Pokémon uses Round before the user this turn, the user will use Round directly after it
@ -9694,11 +9707,7 @@ static void Cmd_various(void)
case VARIOUS_LOSE_TYPE:
{
VARIOUS_ARGS(u8 type);
for (i = 0; i < 3; i++)
{
if (*(u8 *)(&gBattleMons[battler].type1 + i) == cmd->type)
*(u8 *)(&gBattleMons[battler].type1 + i) = TYPE_MYSTERY;
}
RemoveBattlerType(battler, cmd->type);
gBattlescriptCurrInstr = cmd->nextInstr;
return;
}

View file

@ -190,7 +190,7 @@ static const u16 sPoints_MoveEffect[NUM_BATTLE_MOVE_EFFECTS] =
[EFFECT_MAGNITUDE] = 1,
[EFFECT_BATON_PASS] = 7,
[EFFECT_PURSUIT] = 2,
[EFFECT_ARG_FIXED_DAMAGE] = 1,
[EFFECT_FIXED_DAMAGE_ARG] = 1,
[EFFECT_MORNING_SUN] = 4,
[EFFECT_SYNTHESIS] = 4,
[EFFECT_MOONLIGHT] = 4,

View file

@ -11073,3 +11073,13 @@ u8 GetBattlerType(u32 battler, u8 typeIndex)
return types[typeIndex];
}
void RemoveBattlerType(u32 battler, u8 type)
{
u32 i;
for (i = 0; i < 3; i++)
{
if (*(u8 *)(&gBattleMons[battler].type1 + i) == type)
*(u8 *)(&gBattleMons[battler].type1 + i) = TYPE_MYSTERY;
}
}

View file

@ -810,7 +810,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_DYNAMAX] =
[MOVE_SONIC_BOOM] =
{
.effect = EFFECT_ARG_FIXED_DAMAGE,
.effect = EFFECT_FIXED_DAMAGE_ARG,
.power = 1,
.type = TYPE_NORMAL,
.accuracy = 90,
@ -1382,7 +1382,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_DYNAMAX] =
[MOVE_DRAGON_RAGE] =
{
.effect = EFFECT_ARG_FIXED_DAMAGE,
.effect = EFFECT_FIXED_DAMAGE_ARG,
.power = 1,
.type = TYPE_DRAGON,
.accuracy = 100,

View file

@ -55,7 +55,6 @@ AI_SINGLE_BATTLE_TEST("AI sees increased base power of Wake Up Slap")
PARAMETRIZE { status1 = STATUS1_NONE; expectedMove = MOVE_BODY_SLAM; }
PARAMETRIZE { status1 = STATUS1_SLEEP; expectedMove = MOVE_WAKE_UP_SLAP; }
PARAMETRIZE { status1 = STATUS1_SLEEP; expectedMove = MOVE_WAKE_UP_SLAP; }
GIVEN {
ASSUME(B_UPDATED_MOVE_DATA >= GEN_6);
@ -82,6 +81,7 @@ AI_SINGLE_BATTLE_TEST("AI sees increased base power of Grav Apple")
GIVEN {
ASSUME(gBattleMoves[MOVE_GRAV_APPLE].effect == EFFECT_GRAV_APPLE);
ASSUME(gBattleMoves[MOVE_GRAV_APPLE].power == gBattleMoves[MOVE_DRUM_BEATING].power);
ASSUME(MoveHasMoveEffect(MOVE_DRUM_BEATING, MOVE_EFFECT_SPD_MINUS_1) == TRUE);
AI_FLAGS(AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_CHECK_VIABILITY | AI_FLAG_TRY_TO_FAINT);
PLAYER(SPECIES_WOBBUFFET) { HP(81); Speed(20); }

View file

@ -4,7 +4,7 @@
ASSUMPTIONS
{
ASSUME(gItems[ITEM_LIECHI_BERRY].holdEffect == HOLD_EFFECT_ATTACK_UP);
ASSUME(gBattleMoves[MOVE_DRAGON_RAGE].effect == EFFECT_ARG_FIXED_DAMAGE);
ASSUME(gBattleMoves[MOVE_DRAGON_RAGE].effect == EFFECT_FIXED_DAMAGE_ARG);
ASSUME(gBattleMoves[MOVE_DRAGON_RAGE].argument == 40);
}

View file

@ -4,7 +4,7 @@
ASSUMPTIONS
{
ASSUME(gItems[ITEM_LANSAT_BERRY].holdEffect == HOLD_EFFECT_CRITICAL_UP);
ASSUME(gBattleMoves[MOVE_DRAGON_RAGE].effect == EFFECT_ARG_FIXED_DAMAGE);
ASSUME(gBattleMoves[MOVE_DRAGON_RAGE].effect == EFFECT_FIXED_DAMAGE_ARG);
ASSUME(gBattleMoves[MOVE_DRAGON_RAGE].argument == 40);
}

View file

@ -4,7 +4,7 @@
ASSUMPTIONS
{
ASSUME(gItems[ITEM_GANLON_BERRY].holdEffect == HOLD_EFFECT_DEFENSE_UP);
ASSUME(gBattleMoves[MOVE_DRAGON_RAGE].effect == EFFECT_ARG_FIXED_DAMAGE);
ASSUME(gBattleMoves[MOVE_DRAGON_RAGE].effect == EFFECT_FIXED_DAMAGE_ARG);
ASSUME(gBattleMoves[MOVE_DRAGON_RAGE].argument == 40);
}

View file

@ -4,7 +4,7 @@
ASSUMPTIONS
{
ASSUME(gItems[ITEM_MICLE_BERRY].holdEffect == HOLD_EFFECT_MICLE_BERRY);
ASSUME(gBattleMoves[MOVE_DRAGON_RAGE].effect == EFFECT_ARG_FIXED_DAMAGE);
ASSUME(gBattleMoves[MOVE_DRAGON_RAGE].effect == EFFECT_FIXED_DAMAGE_ARG);
ASSUME(gBattleMoves[MOVE_DRAGON_RAGE].argument == 40);
}

View file

@ -4,7 +4,7 @@
ASSUMPTIONS
{
ASSUME(gItems[ITEM_PETAYA_BERRY].holdEffect == HOLD_EFFECT_SP_ATTACK_UP);
ASSUME(gBattleMoves[MOVE_DRAGON_RAGE].effect == EFFECT_ARG_FIXED_DAMAGE);
ASSUME(gBattleMoves[MOVE_DRAGON_RAGE].effect == EFFECT_FIXED_DAMAGE_ARG);
ASSUME(gBattleMoves[MOVE_DRAGON_RAGE].argument == 40);
}

View file

@ -4,7 +4,7 @@
ASSUMPTIONS
{
ASSUME(gItems[ITEM_APICOT_BERRY].holdEffect == HOLD_EFFECT_SP_DEFENSE_UP);
ASSUME(gBattleMoves[MOVE_DRAGON_RAGE].effect == EFFECT_ARG_FIXED_DAMAGE);
ASSUME(gBattleMoves[MOVE_DRAGON_RAGE].effect == EFFECT_FIXED_DAMAGE_ARG);
ASSUME(gBattleMoves[MOVE_DRAGON_RAGE].argument == 40);
}

View file

@ -4,7 +4,7 @@
ASSUMPTIONS
{
ASSUME(gItems[ITEM_SALAC_BERRY].holdEffect == HOLD_EFFECT_SPEED_UP);
ASSUME(gBattleMoves[MOVE_DRAGON_RAGE].effect == EFFECT_ARG_FIXED_DAMAGE);
ASSUME(gBattleMoves[MOVE_DRAGON_RAGE].effect == EFFECT_FIXED_DAMAGE_ARG);
ASSUME(gBattleMoves[MOVE_DRAGON_RAGE].argument == 40);
}

View file

@ -48,4 +48,4 @@ SINGLE_BATTLE_TEST("Aura Wheel changes type depending on Morpeko's form")
HP_BAR(opponent);
MESSAGE("It's super effective!");
}
}
}

View file

@ -201,26 +201,20 @@ SINGLE_BATTLE_TEST("Fling doesn't consume the item if pokemon is asleep/frozen/p
}
}
SINGLE_BATTLE_TEST("Fling applies special effects when throwing specific Items - but is blocked by Shield Dust")
SINGLE_BATTLE_TEST("Fling applies special effects when throwing specific Items")
{
u16 item, ability;
u16 item;
PARAMETRIZE {item = ITEM_FLAME_ORB; ability = ABILITY_TELEPATHY; }
PARAMETRIZE {item = ITEM_FLAME_ORB; ability = ABILITY_SHIELD_DUST; }
PARAMETRIZE {item = ITEM_LIGHT_BALL; ability = ABILITY_TELEPATHY; }
PARAMETRIZE {item = ITEM_LIGHT_BALL; ability = ABILITY_SHIELD_DUST; }
PARAMETRIZE {item = ITEM_POISON_BARB; ability = ABILITY_TELEPATHY; }
PARAMETRIZE {item = ITEM_POISON_BARB; ability = ABILITY_SHIELD_DUST; }
PARAMETRIZE {item = ITEM_TOXIC_ORB; ability = ABILITY_TELEPATHY; }
PARAMETRIZE {item = ITEM_TOXIC_ORB; ability = ABILITY_SHIELD_DUST; }
PARAMETRIZE {item = ITEM_RAZOR_FANG; ability = ABILITY_TELEPATHY; }
PARAMETRIZE {item = ITEM_RAZOR_FANG; ability = ABILITY_SHIELD_DUST; }
PARAMETRIZE {item = ITEM_KINGS_ROCK; ability = ABILITY_TELEPATHY; }
PARAMETRIZE {item = ITEM_KINGS_ROCK; ability = ABILITY_SHIELD_DUST; }
PARAMETRIZE {item = ITEM_FLAME_ORB; }
PARAMETRIZE {item = ITEM_LIGHT_BALL; }
PARAMETRIZE {item = ITEM_POISON_BARB; }
PARAMETRIZE {item = ITEM_TOXIC_ORB; }
PARAMETRIZE {item = ITEM_RAZOR_FANG; }
PARAMETRIZE {item = ITEM_KINGS_ROCK; }
GIVEN {
PLAYER(SPECIES_WOBBUFFET) { Item(item); }
OPPONENT(SPECIES_WOBBUFFET) { Ability(ability); }
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
TURN { MOVE(player, MOVE_FLING); }
} SCENE {
@ -230,12 +224,62 @@ SINGLE_BATTLE_TEST("Fling applies special effects when throwing specific Items -
switch (item)
{
case ITEM_FLAME_ORB:
if (ability != ABILITY_SHIELD_DUST)
{
MESSAGE("Foe Wobbuffet was burned!");
STATUS_ICON(opponent, STATUS1_BURN);
}
else
break;
case ITEM_LIGHT_BALL:
{
MESSAGE("Foe Wobbuffet is paralyzed! It may be unable to move!");
STATUS_ICON(opponent, STATUS1_PARALYSIS);
}
break;
case ITEM_POISON_BARB:
{
MESSAGE("Foe Wobbuffet was poisoned!");
STATUS_ICON(opponent, STATUS1_POISON);
}
break;
case ITEM_TOXIC_ORB:
{
MESSAGE("Foe Wobbuffet is badly poisoned!");
STATUS_ICON(opponent, STATUS1_TOXIC_POISON);
}
break;
case ITEM_RAZOR_FANG:
case ITEM_KINGS_ROCK:
{
MESSAGE("Foe Wobbuffet flinched!");
}
break;
}
}
}
SINGLE_BATTLE_TEST("Fling's effects are blocked by Shield Dust")
{
u16 item;
PARAMETRIZE {item = ITEM_FLAME_ORB; }
PARAMETRIZE {item = ITEM_LIGHT_BALL; }
PARAMETRIZE {item = ITEM_POISON_BARB; }
PARAMETRIZE {item = ITEM_TOXIC_ORB; }
PARAMETRIZE {item = ITEM_RAZOR_FANG; }
PARAMETRIZE {item = ITEM_KINGS_ROCK; }
GIVEN {
PLAYER(SPECIES_WOBBUFFET) { Item(item); }
OPPONENT(SPECIES_WOBBUFFET) { Ability(ABILITY_SHIELD_DUST); }
} WHEN {
TURN { MOVE(player, MOVE_FLING); }
} SCENE {
MESSAGE("Wobbuffet used Fling!");
ANIMATION(ANIM_TYPE_MOVE, MOVE_FLING, player);
HP_BAR(opponent);
switch (item)
{
case ITEM_FLAME_ORB:
{
NONE_OF {
MESSAGE("Foe Wobbuffet was burned!");
@ -245,12 +289,6 @@ SINGLE_BATTLE_TEST("Fling applies special effects when throwing specific Items -
}
break;
case ITEM_LIGHT_BALL:
if (ability != ABILITY_SHIELD_DUST)
{
MESSAGE("Foe Wobbuffet is paralyzed! It may be unable to move!");
STATUS_ICON(opponent, STATUS1_PARALYSIS);
}
else
{
NONE_OF {
MESSAGE("Foe Wobbuffet is paralyzed! It may be unable to move!");
@ -260,12 +298,6 @@ SINGLE_BATTLE_TEST("Fling applies special effects when throwing specific Items -
}
break;
case ITEM_POISON_BARB:
if (ability != ABILITY_SHIELD_DUST)
{
MESSAGE("Foe Wobbuffet was poisoned!");
STATUS_ICON(opponent, STATUS1_POISON);
}
else
{
NONE_OF {
MESSAGE("Foe Wobbuffet was poisoned!");
@ -275,12 +307,6 @@ SINGLE_BATTLE_TEST("Fling applies special effects when throwing specific Items -
}
break;
case ITEM_TOXIC_ORB:
if (ability != ABILITY_SHIELD_DUST)
{
MESSAGE("Foe Wobbuffet is badly poisoned!");
STATUS_ICON(opponent, STATUS1_TOXIC_POISON);
}
else
{
NONE_OF {
MESSAGE("Foe Wobbuffet is badly poisoned!");
@ -291,11 +317,6 @@ SINGLE_BATTLE_TEST("Fling applies special effects when throwing specific Items -
break;
case ITEM_RAZOR_FANG:
case ITEM_KINGS_ROCK:
if (ability != ABILITY_SHIELD_DUST)
{
MESSAGE("Foe Wobbuffet flinched!");
}
else
{
NONE_OF {
MESSAGE("Foe Wobbuffet flinched!");