Merge pull request #150 from AsparagusEduardo/PR-MoreBattleConfigs
More Battle Config options
This commit is contained in:
commit
34729ce99c
@ -1,61 +1,69 @@
|
||||
#ifndef GUARD_CONSTANTS_BATTLE_CONFIG_H
|
||||
#define GUARD_CONSTANTS_BATTLE_CONFIG_H
|
||||
|
||||
// Species with peculiar battle effects. Remove them if they're properly placed in constant/species.h
|
||||
#define SPECIES_DIALGA 0
|
||||
#define SPECIES_PALKIA 0
|
||||
#define SPECIES_GIRATINA 0
|
||||
#define SPECIES_CHERRIM 0
|
||||
#define SPECIES_ARCEUS 0
|
||||
#define SPECIES_SILVALLY 0
|
||||
#define SPECIES_GENESECT 0
|
||||
#define SPECIES_AEGISLASH 0
|
||||
#define SPECIES_AEGISLASH_BLADE 10000
|
||||
#define SPECIES_MIMIKYU 0
|
||||
#define SPECIES_MIMIKYU_BUSTED 10001
|
||||
#define SPECIES_DARMANITAN 0
|
||||
#define SPECIES_DARMANITAN_ZEN 10002
|
||||
#define SPECIES_MINIOR_CORE 0
|
||||
#define SPECIES_MINIOR 10003
|
||||
#define SPECIES_WISHIWASHI 0
|
||||
#define SPECIES_WISHIWASHI_SCHOOL 10004
|
||||
#define SPECIES_ZYGARDE 0 // 50%
|
||||
#define SPECIES_ZYGARDE_10 10005 // 10 %
|
||||
#define SPECIES_ZYGARDE_COMPLETE 10006 // 100 %
|
||||
#define BATTLE_ENGINE
|
||||
|
||||
// Items with peculiar battle effects. Remove them if they're properly placed in constant/items.h
|
||||
#define ITEM_GRISEOUS_ORB 0
|
||||
#define ITEM_OCCA_BERRY 204
|
||||
#define ITEM_PASSHO_BERRY 205
|
||||
#define ITEM_WACAN_BERRY 206
|
||||
#define ITEM_RINDO_BERRY 207
|
||||
#define ITEM_YACHE_BERRY 208
|
||||
#define ITEM_CHOPLE_BERRY 177
|
||||
#define ITEM_KEBIA_BERRY 178
|
||||
#define ITEM_SHUCA_BERRY 179
|
||||
#define ITEM_COBA_BERRY 180
|
||||
#define ITEM_PAYAPA_BERRY 181
|
||||
#define ITEM_TANGA_BERRY 182
|
||||
#define ITEM_CHARTI_BERRY 183
|
||||
#define ITEM_KASIB_BERRY 184
|
||||
#define ITEM_HABAN_BERRY 185
|
||||
#define ITEM_COLBUR_BERRY 186
|
||||
#define ITEM_BABIRI_BERRY 187
|
||||
#define ITEM_CHILAN_BERRY 188
|
||||
#define ITEM_ROSELI_BERRY 189
|
||||
#define ITEM_MICLE_BERRY 197
|
||||
#define ITEM_CUSTAP_BERRY 199
|
||||
#define ITEM_JABOCA_BERRY 200
|
||||
#define ITEM_ROWAP_BERRY 201
|
||||
#define ITEM_KEE_BERRY 202
|
||||
#define ITEM_MARANGA_BERRY 203
|
||||
// Species with peculiar battle effects.
|
||||
#ifndef POKEMON_EXPANSION
|
||||
#define SPECIES_DIALGA 0
|
||||
#define SPECIES_PALKIA 0
|
||||
#define SPECIES_GIRATINA 0
|
||||
#define SPECIES_CHERRIM 0
|
||||
#define SPECIES_ARCEUS 0
|
||||
#define SPECIES_SILVALLY 0
|
||||
#define SPECIES_GENESECT 0
|
||||
#define SPECIES_AEGISLASH 0
|
||||
#define SPECIES_AEGISLASH_BLADE 10000
|
||||
#define SPECIES_MIMIKYU 0
|
||||
#define SPECIES_MIMIKYU_BUSTED 10001
|
||||
#define SPECIES_DARMANITAN 0
|
||||
#define SPECIES_DARMANITAN_ZEN 10002
|
||||
#define SPECIES_MINIOR_CORE 0
|
||||
#define SPECIES_MINIOR 10003
|
||||
#define SPECIES_WISHIWASHI 0
|
||||
#define SPECIES_WISHIWASHI_SCHOOL 10004
|
||||
#define SPECIES_ZYGARDE 0 // 50%
|
||||
#define SPECIES_ZYGARDE_10 10005 // 10 %
|
||||
#define SPECIES_ZYGARDE_COMPLETE 10006 // 100 %
|
||||
#endif
|
||||
|
||||
#define GEN_3 0
|
||||
#define GEN_4 1
|
||||
#define GEN_5 2
|
||||
#define GEN_6 3
|
||||
#define GEN_7 4
|
||||
#define GEN_8 5
|
||||
// Items with peculiar battle effects.
|
||||
#ifndef ITEM_EXPANSION
|
||||
#define ITEM_CHOPLE_BERRY 177
|
||||
#define ITEM_KEBIA_BERRY 178
|
||||
#define ITEM_SHUCA_BERRY 179
|
||||
#define ITEM_COBA_BERRY 180
|
||||
#define ITEM_PAYAPA_BERRY 181
|
||||
#define ITEM_TANGA_BERRY 182
|
||||
#define ITEM_CHARTI_BERRY 183
|
||||
#define ITEM_KASIB_BERRY 184
|
||||
#define ITEM_HABAN_BERRY 185
|
||||
#define ITEM_COLBUR_BERRY 186
|
||||
#define ITEM_BABIRI_BERRY 187
|
||||
#define ITEM_CHILAN_BERRY 188
|
||||
#define ITEM_ROSELI_BERRY 189
|
||||
#define ITEM_MICLE_BERRY 197
|
||||
#define ITEM_CUSTAP_BERRY 199
|
||||
#define ITEM_JABOCA_BERRY 200
|
||||
#define ITEM_ROWAP_BERRY 201
|
||||
#define ITEM_KEE_BERRY 202
|
||||
#define ITEM_MARANGA_BERRY 203
|
||||
#define ITEM_OCCA_BERRY 204
|
||||
#define ITEM_PASSHO_BERRY 205
|
||||
#define ITEM_WACAN_BERRY 206
|
||||
#define ITEM_RINDO_BERRY 207
|
||||
#define ITEM_YACHE_BERRY 208
|
||||
#define ITEM_GRISEOUS_ORB 369
|
||||
#endif
|
||||
|
||||
#ifndef GEN_3
|
||||
#define GEN_3 0
|
||||
#define GEN_4 1
|
||||
#define GEN_5 2
|
||||
#define GEN_6 3
|
||||
#define GEN_7 4
|
||||
#define GEN_8 5
|
||||
#endif
|
||||
|
||||
// Calculation settings
|
||||
#define B_CRIT_CHANCE GEN_6 // Chances of a critical hit landing. See CalcCritChanceStage.
|
||||
@ -72,21 +80,24 @@
|
||||
#define B_PSYWAVE_DMG GEN_6 // Psywave's damage formula. See Cmd_psywavedamageeffect.
|
||||
#define B_BADGE_BOOST GEN_6 // In Gen4+, Gym Badges no longer boost a Pokémon's stats
|
||||
|
||||
// Move settings
|
||||
// Move data settings
|
||||
#define B_UPDATED_MOVE_DATA GEN_7 // Updates move data in gBattleMoves, including Power, Accuracy, PP, stat changes, targets, chances of secondary effects, etc.
|
||||
#define B_FELL_STINGER_STAT_RAISE GEN_6 // In Gen7+, it raises Atk by 3 stages instead of 2 if it causes the target to faint.
|
||||
#define B_KINGS_SHIELD_LOWER_ATK GEN_6 // In Gen7+, it lowers Atk by 1 stage instead of 2 of oponents that hit it.
|
||||
#define B_SPEED_BUFFING_RAPID_SPIN GEN_8 // In Gen8, Rapid Spin raises the user's Speed by 1 stage.
|
||||
#define B_WATER_SHURIKEN_SPLIT GEN_8 // In Gen7, Water Shuriken was changed from Physical to Special.
|
||||
|
||||
// Other move settings
|
||||
#define B_SOUND_SUBSTITUTE GEN_6 // In Gen6+, sound moves bypass Substitute.
|
||||
#define B_TOXIC_NEVER_MISS GEN_6 // In Gen6+, if Toxic is used by a Poison type, it will never miss.
|
||||
#define B_PAYBACK_SWITCH_BOOST GEN_6 // In Gen5+, if the opponent switches out, Payback's damage will no longer be doubled.
|
||||
#define B_KINGS_SHIELD_LOWER_ATK GEN_6 // In Gen7+, it lowers Atk by 1 stage instead of 2 of oponents that hit it.
|
||||
#define B_BINDING_TURNS GEN_6 // In Gen5+, binding moves last for 4-5 turns instead of 2-5 turns. (With Grip Claw, 7 and 5 turns respectively.)
|
||||
#define B_UPROAR_TURNS GEN_6 // In Gen5+, Uproar lasts for 3 turns instead of 2-5 turns.
|
||||
#define B_DISABLE_TURNS GEN_6 // Disable's turns. See Cmd_disablelastusedattack.
|
||||
#define B_INCINERATE_GEMS GEN_6 // In Gen6+, Incinerate can destroy Gems.
|
||||
#define B_MINIMIZE_DMG_ACC GEN_6 // In Gen6+, moves that causes double damage to minimized Pokémon will also skip accuracy checks.
|
||||
#define B_SPEED_BUFFING_RAPID_SPIN GEN_8 // In Gen8, Rapid Spin raises the user's Speed by 1 stage.
|
||||
|
||||
// Ability settings
|
||||
#define B_ABILITY_POP_UP GEN_6 // In Gen5+, the Pokémon abilities are displayed in a pop-up, when they activate in battle.
|
||||
#define B_ABILITY_WEATHER GEN_6 // In Gen5+, weather caused by abilities lasts the same amount of turns as induced from a move. Before, they lasted till the battle's end or weather change by a move.
|
||||
#define B_GALE_WINGS GEN_6 // In Gen7+ requires full HP to trigger.
|
||||
#define B_STANCE_CHANGE_FAIL GEN_7 // In Gen7+, Aegislash's form change does not happen, if the Pokémon cannot use a move, because of confusion, paralysis, etc. In gen6, the form change occurs despite not being able to move.
|
||||
@ -99,29 +110,36 @@
|
||||
#define B_HP_BERRIES GEN_6 // In Gen4+, berries which restore hp activate immediately after hp drops to half. In gen3, the effect occurs at the end of the turn.
|
||||
#define B_BERRIES_INSTANT GEN_6 // In Gen4+, most berries activate on battle start/switch-in if applicable. In gen3, they only activate either at the move end or turn end.
|
||||
|
||||
// Other
|
||||
#define B_FLAG_INVERSE_BATTLE 0 // If this flag is set, the battle's type effectiveness are inversed. For example, fire is super effective against water. 0 disables the feature.
|
||||
// Flag settings. Replace the 0s with defined flags to be able to toggle the following features using those flags.
|
||||
#define B_FLAG_INVERSE_BATTLE 0 // If the flag is set, the battle's type effectiveness are inversed. For example, fire is super effective against water.
|
||||
#define B_FLAG_FORCE_DOUBLE_WILD 0 // If the flag is set, all land and surfing wild battles will be double battles.
|
||||
|
||||
// Interface settings
|
||||
#define B_ABILITY_POP_UP TRUE // In Gen5+, the Pokémon abilities are displayed in a pop-up, when they activate in battle.
|
||||
#define B_FAST_INTRO TRUE // If set to TRUE, battle intro texts print at the same time as animation of a Pokémon, as opposing to waiting for the animation to end.
|
||||
#define B_SHOW_TARGETS TRUE // If set to TRUE, all available targets, for moves hitting 2 or 3 Pokémon, will be shown before selecting a move.
|
||||
|
||||
// Other
|
||||
#define B_DOUBLE_WILD_CHANCE 0 // % chance of encountering two Pokémon in a Wild Encounter.
|
||||
#define B_SLEEP_TURNS GEN_6 // In Gen5+, sleep lasts for 1-3 turns instead of 2-5 turns.
|
||||
#define B_PARALYZE_ELECTRIC GEN_6 // In Gen6+, Electric type Pokémon can't be paralyzed.
|
||||
#define B_POWDER_GRASS GEN_6 // In Gen6+, Grass type Pokémon are immune to powder and spore moves.
|
||||
|
||||
// Animation Settings
|
||||
#define NEW_SWORD_PARTICLE TRUE // update swords dance particle
|
||||
#define NEW_LEECH_SEED_PARTICLE TRUE //update leech seed's animation particle
|
||||
#define NEW_HORN_ATTACK_PARTICLE TRUE //update horn attack's horn
|
||||
#define NEW_LEAF_PARTICLE TRUE // update leaf particle
|
||||
#define NEW_EMBER_PARTICLES TRUE //updates ember fire particle
|
||||
#define NEW_MEAN_LOOK_PARTICLE TRUE //update mean look eye
|
||||
#define NEW_TEETH_PARTICLE TRUE //update bite/crunch teeth particle
|
||||
#define NEW_HANDS_FEET_PARTICLE TRUE //update chop/kick/punch particles
|
||||
#define NEW_SPIKES_PARTICLE TRUE //update spikes particle
|
||||
#define NEW_FLY_BUBBLE_PARTICLE TRUE //update fly 'bubble' particle
|
||||
#define NEW_CURSE_NAIL_PARTICLE TRUE //updates curse nail
|
||||
#define NEW_BATON_PASS_BALL_PARTICLE TRUE //update baton pass pokeball sprite
|
||||
#define NEW_MORNING_SUN_STAR_PARTICLE TRUE //updates morning sun star particles
|
||||
#define NEW_IMPACT_PALETTE TRUE //updates the basic 'hit' particle
|
||||
#define NEW_SURF_PARTICLE_PALETTE TRUE //updates the surf wave palette
|
||||
#define B_NEW_SWORD_PARTICLE TRUE // update swords dance particle
|
||||
#define B_NEW_LEECH_SEED_PARTICLE TRUE //update leech seed's animation particle
|
||||
#define B_NEW_HORN_ATTACK_PARTICLE TRUE //update horn attack's horn
|
||||
#define B_NEW_LEAF_PARTICLE TRUE // update leaf particle
|
||||
#define B_NEW_EMBER_PARTICLES TRUE //updates ember fire particle
|
||||
#define B_NEW_MEAN_LOOK_PARTICLE TRUE //update mean look eye
|
||||
#define B_NEW_TEETH_PARTICLE TRUE //update bite/crunch teeth particle
|
||||
#define B_NEW_HANDS_FEET_PARTICLE TRUE //update chop/kick/punch particles
|
||||
#define B_NEW_SPIKES_PARTICLE TRUE //update spikes particle
|
||||
#define B_NEW_FLY_BUBBLE_PARTICLE TRUE //update fly 'bubble' particle
|
||||
#define B_NEW_CURSE_NAIL_PARTICLE TRUE //updates curse nail
|
||||
#define B_NEW_BATON_PASS_BALL_PARTICLE TRUE //update baton pass pokeball sprite
|
||||
#define B_NEW_MORNING_SUN_STAR_PARTICLE TRUE //updates morning sun star particles
|
||||
#define B_NEW_IMPACT_PALETTE TRUE //updates the basic 'hit' particle
|
||||
#define B_NEW_SURF_PARTICLE_PALETTE TRUE //updates the surf wave palette
|
||||
|
||||
#endif // GUARD_CONSTANTS_BATTLE_CONFIG_H
|
||||
|
||||
@ -204,6 +204,7 @@ struct BaseStats
|
||||
u8 noFlip : 1;
|
||||
};
|
||||
|
||||
#include "constants/battle_config.h"
|
||||
struct BattleMove
|
||||
{
|
||||
u16 effect;
|
||||
|
||||
@ -40,5 +40,6 @@ void FishingWildEncounter(u8 rod);
|
||||
u16 GetLocalWildMon(bool8 *isWaterMon);
|
||||
u16 GetLocalWaterMon(void);
|
||||
bool8 UpdateRepelCounter(void);
|
||||
bool8 TryDoDoubleWildBattle(void);
|
||||
|
||||
#endif // GUARD_WILD_ENCOUNTER_H
|
||||
|
||||
@ -2956,7 +2956,7 @@ void CreateAbilityPopUp(u8 battlerId, u32 ability, bool32 isDoubleBattle)
|
||||
const s16 (*coords)[2];
|
||||
u8 spriteId1, spriteId2, battlerPosition, taskId;
|
||||
|
||||
if (B_ABILITY_POP_UP < GEN_5)
|
||||
if (!B_ABILITY_POP_UP)
|
||||
return;
|
||||
|
||||
if (!gBattleStruct->activeAbilityPopUps)
|
||||
|
||||
@ -4828,14 +4828,14 @@ static void Cmd_moveend(void)
|
||||
BattleScriptPushCursor();
|
||||
if (gBattleTypeFlags & BATTLE_TYPE_TRAINER || GetBattlerSide(i) == B_SIDE_PLAYER)
|
||||
{
|
||||
if (B_ABILITY_POP_UP >= GEN_6)
|
||||
if (B_ABILITY_POP_UP)
|
||||
gBattlescriptCurrInstr = BattleScript_EmergencyExit;
|
||||
else
|
||||
gBattlescriptCurrInstr = BattleScript_EmergencyExitNoPopUp;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (B_ABILITY_POP_UP >= GEN_6)
|
||||
if (B_ABILITY_POP_UP)
|
||||
gBattlescriptCurrInstr = BattleScript_EmergencyExitWild;
|
||||
else
|
||||
gBattlescriptCurrInstr = BattleScript_EmergencyExitWildNoPopUp;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -610,7 +610,7 @@ bool8 StandardWildEncounter(u16 currMetaTileBehavior, u16 previousMetaTileBehavi
|
||||
// try a regular wild land encounter
|
||||
if (TryGenerateWildMon(gWildMonHeaders[headerId].landMonsInfo, WILD_AREA_LAND, WILD_CHECK_REPEL | WILD_CHECK_KEEN_EYE) == TRUE)
|
||||
{
|
||||
if (USE_BATTLE_DEBUG && !GetSafariZoneFlag() && GetMonsStateToDoubles() == PLAYER_HAS_TWO_USABLE_MONS)
|
||||
if (TryDoDoubleWildBattle())
|
||||
{
|
||||
struct Pokemon mon1 = gEnemyParty[0];
|
||||
TryGenerateWildMon(gWildMonHeaders[headerId].landMonsInfo, WILD_AREA_LAND, WILD_CHECK_KEEN_EYE);
|
||||
@ -652,7 +652,17 @@ bool8 StandardWildEncounter(u16 currMetaTileBehavior, u16 previousMetaTileBehavi
|
||||
{
|
||||
if (TryGenerateWildMon(gWildMonHeaders[headerId].waterMonsInfo, WILD_AREA_WATER, WILD_CHECK_REPEL | WILD_CHECK_KEEN_EYE) == TRUE)
|
||||
{
|
||||
BattleSetup_StartWildBattle();
|
||||
if (TryDoDoubleWildBattle())
|
||||
{
|
||||
struct Pokemon mon1 = gEnemyParty[0];
|
||||
TryGenerateWildMon(gWildMonHeaders[headerId].waterMonsInfo, WILD_AREA_WATER, WILD_CHECK_KEEN_EYE);
|
||||
gEnemyParty[1] = mon1;
|
||||
BattleSetup_StartDoubleWildBattle();
|
||||
}
|
||||
else
|
||||
{
|
||||
BattleSetup_StartWildBattle();
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@ -957,3 +967,16 @@ static void ApplyCleanseTagEncounterRateMod(u32 *encRate)
|
||||
if (GetMonData(&gPlayerParty[0], MON_DATA_HELD_ITEM) == ITEM_CLEANSE_TAG)
|
||||
*encRate = *encRate * 2 / 3;
|
||||
}
|
||||
|
||||
bool8 TryDoDoubleWildBattle(void)
|
||||
{
|
||||
if (GetSafariZoneFlag() || GetMonsStateToDoubles() != PLAYER_HAS_TWO_USABLE_MONS)
|
||||
return FALSE;
|
||||
else if (B_FLAG_FORCE_DOUBLE_WILD != 0 && FlagGet(B_FLAG_FORCE_DOUBLE_WILD))
|
||||
return TRUE;
|
||||
#if B_DOUBLE_WILD_CHANCE != 0
|
||||
else if ((Random() % 100) + 1 < B_DOUBLE_WILD_CHANCE)
|
||||
return TRUE;
|
||||
#endif
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user