More Battle config (#352)

* Binding move turns.

* Binding damage.

* Incineratable Gems.

* Flash Fire while frozen.

* Sleep turns.

* Synchronized natures %

* Confusion self damage chance.

* Fixed confused self-damage check
This commit is contained in:
Eduardo Alvaro Quezada D'Ottone 2020-04-23 03:01:28 -04:00 committed by GitHub
parent 40ce053ce1
commit d529ac3b60
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 18 additions and 10 deletions

View File

@ -62,6 +62,8 @@
#define B_BURN_DAMAGE GEN_6 // In Gen7+, burn damage is 1/16th of max HP instead of 1/8th. #define B_BURN_DAMAGE GEN_6 // In Gen7+, burn damage is 1/16th of max HP instead of 1/8th.
#define B_PARALYSIS_SPEED GEN_6 // In Gen7+, speed is decreased by 50% instead of 75%. #define B_PARALYSIS_SPEED GEN_6 // In Gen7+, speed is decreased by 50% instead of 75%.
#define B_TERRAIN_TYPE_BOOST GEN_6 // In Gen8+, speed is boosted by 30% instead of 50%. #define B_TERRAIN_TYPE_BOOST GEN_6 // In Gen8+, speed is boosted by 30% instead of 50%.
#define B_BINDING_DAMAGE GEN_6 // In Gen6+, binding damage is 1/8 of max HP instead of 1/16. (With Binding Band, 1/6 and 1/8 respectively.)
#define B_CONFUSION_SELF_DMG_CHANCE GEN_6 // In Gen7+, confusion has a 33.3% of self-damage, instead of 50%.
// Move settings // Move settings
#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_FELL_STINGER_STAT_RAISE GEN_6 // In Gen7+, it raises Atk by 3 stages instead of 2 if it causes the target to faint.
@ -69,6 +71,8 @@
#define B_TOXIC_NEVER_MISS GEN_6 // In Gen6+, if Toxic is used by a Poison type, it will never miss. #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_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_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_INCINERATE_GEMS GEN_6 // In Gen6+, Incinerate can destroy Gems.
// Ability settings // 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_POP_UP GEN_6 // In Gen5+, the Pokémon abilities are displayed in a pop-up, when they activate in battle.
@ -77,8 +81,11 @@
#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. #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.
#define B_GHOSTS_ESCAPE GEN_6 // In Gen6+, ghosts can escape even when blocked by abilities such as Shadow Tag. #define B_GHOSTS_ESCAPE GEN_6 // In Gen6+, ghosts can escape even when blocked by abilities such as Shadow Tag.
#define B_MOODY_ACC_EVASION GEN_6 // In Gen8+, Moody CANNOT raise Accuray and Evasion any more. #define B_MOODY_ACC_EVASION GEN_6 // In Gen8+, Moody CANNOT raise Accuray and Evasion any more.
#define B_FLASH_FIRE_FROZEN GEN_6 // In Gen5+, Flash Fire can trigger even when frozen, when it couldn't before.
#define B_SYNCHRONIZE_NATURE GEN_6 // In Gen8+, if the Pokémon with Synchronize is leading the party, it's 100% guaranteed that wild Pokémon will have the same ability, as opposed to 50% previously.
// Other // Other
#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_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_SLEEP_TURNS GEN_6 // In Gen5+, sleep lasts for 1-3 turns instead of 2-5 turns.
#endif // GUARD_CONSTANTS_BATTLE_CONFIG_H #endif // GUARD_CONSTANTS_BATTLE_CONFIG_H

View File

@ -2442,7 +2442,7 @@ void SetMoveEffect(bool32 primary, u32 certain)
BattleScriptPush(gBattlescriptCurrInstr + 1); BattleScriptPush(gBattlescriptCurrInstr + 1);
if (sStatusFlagsForMoveEffects[gBattleScripting.moveEffect] == STATUS1_SLEEP) if (sStatusFlagsForMoveEffects[gBattleScripting.moveEffect] == STATUS1_SLEEP)
gBattleMons[gEffectBattler].status1 |= ((Random() & 3) + 2); gBattleMons[gEffectBattler].status1 |= (B_SLEEP_TURNS >= GEN_5) ? ((Random() & 2) + 1) : ((Random() & 3) + 2);
else else
gBattleMons[gEffectBattler].status1 |= sStatusFlagsForMoveEffects[gBattleScripting.moveEffect]; gBattleMons[gEffectBattler].status1 |= sStatusFlagsForMoveEffects[gBattleScripting.moveEffect];
@ -2588,9 +2588,9 @@ void SetMoveEffect(bool32 primary, u32 certain)
{ {
gBattleMons[gEffectBattler].status2 |= STATUS2_WRAPPED; gBattleMons[gEffectBattler].status2 |= STATUS2_WRAPPED;
if (GetBattlerHoldEffect(gBattlerAttacker, TRUE) == HOLD_EFFECT_GRIP_CLAW) if (GetBattlerHoldEffect(gBattlerAttacker, TRUE) == HOLD_EFFECT_GRIP_CLAW)
gDisableStructs[gEffectBattler].wrapTurns = 7; gDisableStructs[gEffectBattler].wrapTurns = (B_BINDING_TURNS >= GEN_5) ? 7 : 5;
else else
gDisableStructs[gEffectBattler].wrapTurns = ((Random() % 2) + 4); gDisableStructs[gEffectBattler].wrapTurns = (B_BINDING_TURNS >= GEN_5) ? ((Random() % 2) + 4) : ((Random() % 4) + 2);
gBattleStruct->wrappedMove[gEffectBattler] = gCurrentMove; gBattleStruct->wrappedMove[gEffectBattler] = gCurrentMove;
gBattleStruct->wrappedBy[gEffectBattler] = gBattlerAttacker; gBattleStruct->wrappedBy[gEffectBattler] = gBattlerAttacker;
@ -3011,7 +3011,7 @@ void SetMoveEffect(bool32 primary, u32 certain)
gBattlescriptCurrInstr++; gBattlescriptCurrInstr++;
break; break;
case MOVE_EFFECT_INCINERATE: case MOVE_EFFECT_INCINERATE:
if (GetBattlerHoldEffect(gEffectBattler, FALSE) == HOLD_EFFECT_GEMS if ((B_INCINERATE_GEMS >= GEN_6 && GetBattlerHoldEffect(gEffectBattler, FALSE) == HOLD_EFFECT_GEMS)
|| (gBattleMons[gEffectBattler].item >= FIRST_BERRY_INDEX && gBattleMons[gEffectBattler].item <= LAST_BERRY_INDEX)) || (gBattleMons[gEffectBattler].item >= FIRST_BERRY_INDEX && gBattleMons[gEffectBattler].item <= LAST_BERRY_INDEX))
{ {
gLastUsedItem = gBattleMons[gEffectBattler].item; gLastUsedItem = gBattleMons[gEffectBattler].item;

View File

@ -1612,9 +1612,9 @@ u8 DoBattlerEndTurnEffects(void)
PREPARE_MOVE_BUFFER(gBattleTextBuff1, gBattleStruct->wrappedMove[gActiveBattler]); PREPARE_MOVE_BUFFER(gBattleTextBuff1, gBattleStruct->wrappedMove[gActiveBattler]);
gBattlescriptCurrInstr = BattleScript_WrapTurnDmg; gBattlescriptCurrInstr = BattleScript_WrapTurnDmg;
if (GetBattlerHoldEffect(gBattleStruct->wrappedBy[gActiveBattler], TRUE) == HOLD_EFFECT_BINDING_BAND) if (GetBattlerHoldEffect(gBattleStruct->wrappedBy[gActiveBattler], TRUE) == HOLD_EFFECT_BINDING_BAND)
gBattleMoveDamage = gBattleMons[gActiveBattler].maxHP / 8; gBattleMoveDamage = gBattleMons[gActiveBattler].maxHP / (B_BINDING_DAMAGE >= GEN_6) ? 6 : 8;
else else
gBattleMoveDamage = gBattleMons[gActiveBattler].maxHP / 16; gBattleMoveDamage = gBattleMons[gActiveBattler].maxHP / (B_BINDING_DAMAGE >= GEN_6) ? 8 : 16;
if (gBattleMoveDamage == 0) if (gBattleMoveDamage == 0)
gBattleMoveDamage = 1; gBattleMoveDamage = 1;
@ -2310,7 +2310,7 @@ u8 AtkCanceller_UnableToUseMove(void)
gBattleMons[gBattlerAttacker].status2--; gBattleMons[gBattlerAttacker].status2--;
if (gBattleMons[gBattlerAttacker].status2 & STATUS2_CONFUSION) if (gBattleMons[gBattlerAttacker].status2 & STATUS2_CONFUSION)
{ {
if (Random() & 1) if (Random() % ((B_CONFUSION_SELF_DMG_CHANCE >= GEN_7) ? 3 : 2 == 0))
{ {
gBattleCommunication[MULTISTRING_CHOOSER] = 0; gBattleCommunication[MULTISTRING_CHOOSER] = 0;
BattleScriptPushCursor(); BattleScriptPushCursor();
@ -3319,7 +3319,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u8 ability, u8 special, u16 moveA
effect = 2, statId = STAT_ATK; effect = 2, statId = STAT_ATK;
break; break;
case ABILITY_FLASH_FIRE: case ABILITY_FLASH_FIRE:
if (moveType == TYPE_FIRE && !(gBattleMons[battler].status1 & STATUS1_FREEZE)) if (moveType == TYPE_FIRE && !((gBattleMons[battler].status1 & STATUS1_FREEZE) && B_FLASH_FIRE_FROZEN <= GEN_4))
{ {
if (!(gBattleResources->flags->flags[battler] & RESOURCE_FLAG_FLASH_FIRE)) if (!(gBattleResources->flags->flags[battler] & RESOURCE_FLAG_FLASH_FIRE))
{ {

View File

@ -18,6 +18,7 @@
#include "battle_pike.h" #include "battle_pike.h"
#include "battle_pyramid.h" #include "battle_pyramid.h"
#include "constants/abilities.h" #include "constants/abilities.h"
#include "constants/battle_config.h"
#include "constants/game_stat.h" #include "constants/game_stat.h"
#include "constants/items.h" #include "constants/items.h"
#include "constants/layouts.h" #include "constants/layouts.h"
@ -336,7 +337,7 @@ static u8 PickWildMonNature(void)
// check synchronize for a pokemon with the same ability // check synchronize for a pokemon with the same ability
if (!GetMonData(&gPlayerParty[0], MON_DATA_SANITY_IS_EGG) if (!GetMonData(&gPlayerParty[0], MON_DATA_SANITY_IS_EGG)
&& GetMonAbility(&gPlayerParty[0]) == ABILITY_SYNCHRONIZE && GetMonAbility(&gPlayerParty[0]) == ABILITY_SYNCHRONIZE
&& Random() % 2 == 0) && ((B_SYNCHRONIZE_NATURE >= GEN_8) || Random() % 2 == 0))
{ {
return GetMonData(&gPlayerParty[0], MON_DATA_PERSONALITY) % 25; return GetMonData(&gPlayerParty[0], MON_DATA_PERSONALITY) % 25;
} }