mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2025-02-08 22:33:02 +01:00
Merge branch 'battle_engine_v2' of https://github.com/dizzyeggg/pokeemerald into battle_engine
This commit is contained in:
commit
4c231a5d47
@ -1863,4 +1863,10 @@
|
|||||||
jumpifability BS_TARGET, ABILITY_LEAF_GUARD, \jumpptr
|
jumpifability BS_TARGET, ABILITY_LEAF_GUARD, \jumpptr
|
||||||
1:
|
1:
|
||||||
.endm
|
.endm
|
||||||
|
|
||||||
|
.macro jumpifsafeguard jumpptr:req
|
||||||
|
jumpifability BS_ATTACKER, ABILITY_INFILTRATOR, 1f
|
||||||
|
jumpifsideaffecting BS_TARGET, SIDE_STATUS_SAFEGUARD, \jumpptr
|
||||||
|
1:
|
||||||
|
.endm
|
||||||
|
|
||||||
|
@ -907,7 +907,7 @@ BattleScript_EffectPsychoShift:
|
|||||||
goto BattleScript_ButItFailed
|
goto BattleScript_ButItFailed
|
||||||
BattleScript_EffectPsychoShiftCanWork:
|
BattleScript_EffectPsychoShiftCanWork:
|
||||||
jumpifstatus BS_TARGET, STATUS1_ANY, BattleScript_ButItFailed
|
jumpifstatus BS_TARGET, STATUS1_ANY, BattleScript_ButItFailed
|
||||||
jumpifsideaffecting BS_TARGET, SIDE_STATUS_SAFEGUARD, BattleScript_SafeguardProtected
|
jumpifsafeguard BattleScript_SafeguardProtected
|
||||||
trypsychoshift BattleScript_MoveEnd
|
trypsychoshift BattleScript_MoveEnd
|
||||||
attackanimation
|
attackanimation
|
||||||
waitanimation
|
waitanimation
|
||||||
@ -2132,7 +2132,7 @@ BattleScript_EffectSleep::
|
|||||||
jumpifshieldsdown BS_TARGET, BattleScript_LeafGuardProtects
|
jumpifshieldsdown BS_TARGET, BattleScript_LeafGuardProtects
|
||||||
jumpifstatus BS_TARGET, STATUS1_ANY, BattleScript_ButItFailed
|
jumpifstatus BS_TARGET, STATUS1_ANY, BattleScript_ButItFailed
|
||||||
accuracycheck BattleScript_ButItFailed, ACC_CURR_MOVE
|
accuracycheck BattleScript_ButItFailed, ACC_CURR_MOVE
|
||||||
jumpifsideaffecting BS_TARGET, SIDE_STATUS_SAFEGUARD, BattleScript_SafeguardProtected
|
jumpifsafeguard BattleScript_SafeguardProtected
|
||||||
attackanimation
|
attackanimation
|
||||||
waitanimation
|
waitanimation
|
||||||
setmoveeffect MOVE_EFFECT_SLEEP
|
setmoveeffect MOVE_EFFECT_SLEEP
|
||||||
@ -2653,7 +2653,7 @@ BattleScript_EffectToxic::
|
|||||||
jumpifstatus BS_TARGET, STATUS1_ANY, BattleScript_ButItFailed
|
jumpifstatus BS_TARGET, STATUS1_ANY, BattleScript_ButItFailed
|
||||||
trypoisontype BS_ATTACKER, BS_TARGET, BattleScript_NotAffected
|
trypoisontype BS_ATTACKER, BS_TARGET, BattleScript_NotAffected
|
||||||
accuracycheck BattleScript_ButItFailed, ACC_CURR_MOVE
|
accuracycheck BattleScript_ButItFailed, ACC_CURR_MOVE
|
||||||
jumpifsideaffecting BS_TARGET, SIDE_STATUS_SAFEGUARD, BattleScript_SafeguardProtected
|
jumpifsafeguard BattleScript_SafeguardProtected
|
||||||
attackanimation
|
attackanimation
|
||||||
waitanimation
|
waitanimation
|
||||||
setmoveeffect MOVE_EFFECT_TOXIC
|
setmoveeffect MOVE_EFFECT_TOXIC
|
||||||
@ -2856,7 +2856,7 @@ BattleScript_EffectConfuse:
|
|||||||
jumpifsubstituteblocks BattleScript_ButItFailed
|
jumpifsubstituteblocks BattleScript_ButItFailed
|
||||||
jumpifstatus2 BS_TARGET, STATUS2_CONFUSION, BattleScript_AlreadyConfused
|
jumpifstatus2 BS_TARGET, STATUS2_CONFUSION, BattleScript_AlreadyConfused
|
||||||
accuracycheck BattleScript_ButItFailed, ACC_CURR_MOVE
|
accuracycheck BattleScript_ButItFailed, ACC_CURR_MOVE
|
||||||
jumpifsideaffecting BS_TARGET, SIDE_STATUS_SAFEGUARD, BattleScript_SafeguardProtected
|
jumpifsafeguard BattleScript_SafeguardProtected
|
||||||
attackanimation
|
attackanimation
|
||||||
waitanimation
|
waitanimation
|
||||||
setmoveeffect MOVE_EFFECT_CONFUSION
|
setmoveeffect MOVE_EFFECT_CONFUSION
|
||||||
@ -2974,7 +2974,7 @@ BattleScript_EffectPoison::
|
|||||||
trypoisontype BS_ATTACKER, BS_TARGET, BattleScript_NotAffected
|
trypoisontype BS_ATTACKER, BS_TARGET, BattleScript_NotAffected
|
||||||
jumpifstatus BS_TARGET, STATUS1_ANY, BattleScript_ButItFailed
|
jumpifstatus BS_TARGET, STATUS1_ANY, BattleScript_ButItFailed
|
||||||
accuracycheck BattleScript_ButItFailed, ACC_CURR_MOVE
|
accuracycheck BattleScript_ButItFailed, ACC_CURR_MOVE
|
||||||
jumpifsideaffecting BS_TARGET, SIDE_STATUS_SAFEGUARD, BattleScript_SafeguardProtected
|
jumpifsafeguard BattleScript_SafeguardProtected
|
||||||
attackanimation
|
attackanimation
|
||||||
waitanimation
|
waitanimation
|
||||||
setmoveeffect MOVE_EFFECT_POISON
|
setmoveeffect MOVE_EFFECT_POISON
|
||||||
@ -2999,7 +2999,7 @@ BattleScript_EffectParalyze:
|
|||||||
jumpiftype BS_TARGET, TYPE_ELECTRIC, BattleScript_NotAffected
|
jumpiftype BS_TARGET, TYPE_ELECTRIC, BattleScript_NotAffected
|
||||||
jumpifstatus BS_TARGET, STATUS1_ANY, BattleScript_ButItFailed
|
jumpifstatus BS_TARGET, STATUS1_ANY, BattleScript_ButItFailed
|
||||||
accuracycheck BattleScript_ButItFailed, ACC_CURR_MOVE
|
accuracycheck BattleScript_ButItFailed, ACC_CURR_MOVE
|
||||||
jumpifsideaffecting BS_TARGET, SIDE_STATUS_SAFEGUARD, BattleScript_SafeguardProtected
|
jumpifsafeguard BattleScript_SafeguardProtected
|
||||||
bichalfword gMoveResultFlags, MOVE_RESULT_SUPER_EFFECTIVE | MOVE_RESULT_NOT_VERY_EFFECTIVE
|
bichalfword gMoveResultFlags, MOVE_RESULT_SUPER_EFFECTIVE | MOVE_RESULT_NOT_VERY_EFFECTIVE
|
||||||
attackanimation
|
attackanimation
|
||||||
waitanimation
|
waitanimation
|
||||||
@ -3707,7 +3707,7 @@ BattleScript_EffectSwagger::
|
|||||||
waitmessage 0x40
|
waitmessage 0x40
|
||||||
BattleScript_SwaggerTryConfuse:
|
BattleScript_SwaggerTryConfuse:
|
||||||
jumpifability BS_TARGET, ABILITY_OWN_TEMPO, BattleScript_OwnTempoPrevents
|
jumpifability BS_TARGET, ABILITY_OWN_TEMPO, BattleScript_OwnTempoPrevents
|
||||||
jumpifsideaffecting BS_TARGET, SIDE_STATUS_SAFEGUARD, BattleScript_SafeguardProtected
|
jumpifsafeguard BattleScript_SafeguardProtected
|
||||||
setmoveeffect MOVE_EFFECT_CONFUSION
|
setmoveeffect MOVE_EFFECT_CONFUSION
|
||||||
seteffectprimary
|
seteffectprimary
|
||||||
goto BattleScript_MoveEnd
|
goto BattleScript_MoveEnd
|
||||||
@ -4244,7 +4244,7 @@ BattleScript_EffectFlatter::
|
|||||||
waitmessage 0x40
|
waitmessage 0x40
|
||||||
BattleScript_FlatterTryConfuse::
|
BattleScript_FlatterTryConfuse::
|
||||||
jumpifability BS_TARGET, ABILITY_OWN_TEMPO, BattleScript_OwnTempoPrevents
|
jumpifability BS_TARGET, ABILITY_OWN_TEMPO, BattleScript_OwnTempoPrevents
|
||||||
jumpifsideaffecting BS_TARGET, SIDE_STATUS_SAFEGUARD, BattleScript_SafeguardProtected
|
jumpifsafeguard BattleScript_SafeguardProtected
|
||||||
setmoveeffect MOVE_EFFECT_CONFUSION
|
setmoveeffect MOVE_EFFECT_CONFUSION
|
||||||
seteffectprimary
|
seteffectprimary
|
||||||
goto BattleScript_MoveEnd
|
goto BattleScript_MoveEnd
|
||||||
@ -4263,7 +4263,7 @@ BattleScript_EffectWillOWisp::
|
|||||||
jumpifshieldsdown BS_TARGET, BattleScript_LeafGuardProtects
|
jumpifshieldsdown BS_TARGET, BattleScript_LeafGuardProtects
|
||||||
jumpifstatus BS_TARGET, STATUS1_ANY, BattleScript_ButItFailed
|
jumpifstatus BS_TARGET, STATUS1_ANY, BattleScript_ButItFailed
|
||||||
accuracycheck BattleScript_ButItFailed, ACC_CURR_MOVE
|
accuracycheck BattleScript_ButItFailed, ACC_CURR_MOVE
|
||||||
jumpifsideaffecting BS_TARGET, SIDE_STATUS_SAFEGUARD, BattleScript_SafeguardProtected
|
jumpifsafeguard BattleScript_SafeguardProtected
|
||||||
attackanimation
|
attackanimation
|
||||||
waitanimation
|
waitanimation
|
||||||
setmoveeffect MOVE_EFFECT_BURN
|
setmoveeffect MOVE_EFFECT_BURN
|
||||||
@ -4536,7 +4536,7 @@ BattleScript_EffectYawn::
|
|||||||
jumpifleafguard BattleScript_LeafGuardProtects
|
jumpifleafguard BattleScript_LeafGuardProtects
|
||||||
jumpifshieldsdown BS_TARGET, BattleScript_LeafGuardProtects
|
jumpifshieldsdown BS_TARGET, BattleScript_LeafGuardProtects
|
||||||
jumpifsubstituteblocks BattleScript_ButItFailed
|
jumpifsubstituteblocks BattleScript_ButItFailed
|
||||||
jumpifsideaffecting BS_TARGET, SIDE_STATUS_SAFEGUARD, BattleScript_SafeguardProtected
|
jumpifsafeguard BattleScript_SafeguardProtected
|
||||||
accuracycheck BattleScript_ButItFailed, NO_ACC_CALC_CHECK_LOCK_ON
|
accuracycheck BattleScript_ButItFailed, NO_ACC_CALC_CHECK_LOCK_ON
|
||||||
jumpifcantmakeasleep BattleScript_ButItFailed
|
jumpifcantmakeasleep BattleScript_ButItFailed
|
||||||
setyawn BattleScript_ButItFailed
|
setyawn BattleScript_ButItFailed
|
||||||
@ -4665,7 +4665,7 @@ BattleScript_TeeterDanceLoop::
|
|||||||
jumpifstatus2 BS_TARGET, STATUS2_CONFUSION, BattleScript_TeeterDanceAlreadyConfused
|
jumpifstatus2 BS_TARGET, STATUS2_CONFUSION, BattleScript_TeeterDanceAlreadyConfused
|
||||||
jumpifhasnohp BS_TARGET, BattleScript_TeeterDanceLoopIncrement
|
jumpifhasnohp BS_TARGET, BattleScript_TeeterDanceLoopIncrement
|
||||||
accuracycheck BattleScript_TeeterDanceMissed, ACC_CURR_MOVE
|
accuracycheck BattleScript_TeeterDanceMissed, ACC_CURR_MOVE
|
||||||
jumpifsideaffecting BS_TARGET, SIDE_STATUS_SAFEGUARD, BattleScript_TeeterDanceSafeguardProtected
|
jumpifsafeguard BattleScript_TeeterDanceSafeguardProtected
|
||||||
attackanimation
|
attackanimation
|
||||||
waitanimation
|
waitanimation
|
||||||
seteffectprimary
|
seteffectprimary
|
||||||
@ -4921,6 +4921,7 @@ BattleScript_GiveExp::
|
|||||||
end2
|
end2
|
||||||
|
|
||||||
BattleScript_HandleFaintedMon::
|
BattleScript_HandleFaintedMon::
|
||||||
|
setbyte sSHIFT_SWITCHED, 0x0
|
||||||
atk24 BattleScript_82DA8F6
|
atk24 BattleScript_82DA8F6
|
||||||
jumpifbyte CMP_NOT_EQUAL, gBattleOutcome, 0, BattleScript_FaintedMonEnd
|
jumpifbyte CMP_NOT_EQUAL, gBattleOutcome, 0, BattleScript_FaintedMonEnd
|
||||||
jumpifbattletype BATTLE_TYPE_TRAINER | BATTLE_TYPE_DOUBLE, BattleScript_FaintedMonTryChooseAnother
|
jumpifbattletype BATTLE_TYPE_TRAINER | BATTLE_TYPE_DOUBLE, BattleScript_FaintedMonTryChooseAnother
|
||||||
@ -4931,7 +4932,7 @@ BattleScript_HandleFaintedMon::
|
|||||||
jumpifbyte CMP_EQUAL, gBattleCommunication + 1, 0x0, BattleScript_FaintedMonTryChooseAnother
|
jumpifbyte CMP_EQUAL, gBattleCommunication + 1, 0x0, BattleScript_FaintedMonTryChooseAnother
|
||||||
jumpifplayerran BattleScript_FaintedMonEnd
|
jumpifplayerran BattleScript_FaintedMonEnd
|
||||||
printstring STRINGID_CANTESCAPE2
|
printstring STRINGID_CANTESCAPE2
|
||||||
BattleScript_FaintedMonTryChooseAnother::
|
BattleScript_FaintedMonTryChooseAnother:
|
||||||
openpartyscreen 0x3, BattleScript_FaintedMonEnd
|
openpartyscreen 0x3, BattleScript_FaintedMonEnd
|
||||||
switchhandleorder BS_FAINTED, 0x2
|
switchhandleorder BS_FAINTED, 0x2
|
||||||
jumpifnotbattletype BATTLE_TYPE_TRAINER, BattleScript_FaintedMonChooseAnother
|
jumpifnotbattletype BATTLE_TYPE_TRAINER, BattleScript_FaintedMonChooseAnother
|
||||||
@ -4966,9 +4967,8 @@ BattleScript_FaintedMonTryChooseAnother::
|
|||||||
hidepartystatussummary BS_ATTACKER
|
hidepartystatussummary BS_ATTACKER
|
||||||
switchinanim BS_ATTACKER, 0x0
|
switchinanim BS_ATTACKER, 0x0
|
||||||
waitstate
|
waitstate
|
||||||
switchineffects BS_ATTACKER
|
setbyte sSHIFT_SWITCHED, 0x1
|
||||||
resetsentmonsvalue
|
BattleScript_FaintedMonChooseAnother:
|
||||||
BattleScript_FaintedMonChooseAnother::
|
|
||||||
drawpartystatussummary BS_FAINTED
|
drawpartystatussummary BS_FAINTED
|
||||||
getswitchedmondata BS_FAINTED
|
getswitchedmondata BS_FAINTED
|
||||||
switchindataupdate BS_FAINTED
|
switchindataupdate BS_FAINTED
|
||||||
@ -4979,11 +4979,19 @@ BattleScript_FaintedMonChooseAnother::
|
|||||||
waitstate
|
waitstate
|
||||||
various7 BS_ATTACKER
|
various7 BS_ATTACKER
|
||||||
trytrainerslidelastonmsg BS_FAINTED
|
trytrainerslidelastonmsg BS_FAINTED
|
||||||
|
jumpifbytenotequal sSHIFT_SWITCHED, sZero, BattleScript_FaintedMonShiftSwitched
|
||||||
|
BattleScript_FaintedMonChooseAnotherEnd:
|
||||||
switchineffects BS_FAINTED
|
switchineffects BS_FAINTED
|
||||||
jumpifbattletype BATTLE_TYPE_DOUBLE, BattleScript_FaintedMonEnd
|
jumpifbattletype BATTLE_TYPE_DOUBLE, BattleScript_FaintedMonEnd
|
||||||
cancelallactions
|
cancelallactions
|
||||||
BattleScript_FaintedMonEnd::
|
BattleScript_FaintedMonEnd::
|
||||||
end2
|
end2
|
||||||
|
BattleScript_FaintedMonShiftSwitched:
|
||||||
|
copybyte sSAVED_BATTLER, gBattlerTarget
|
||||||
|
switchineffects BS_ATTACKER
|
||||||
|
resetsentmonsvalue
|
||||||
|
copybyte gBattlerTarget, sSAVED_BATTLER
|
||||||
|
goto BattleScript_FaintedMonChooseAnotherEnd
|
||||||
|
|
||||||
BattleScript_82DA8F6::
|
BattleScript_82DA8F6::
|
||||||
openpartyscreen 0x5, BattleScript_82DA8FC
|
openpartyscreen 0x5, BattleScript_82DA8FC
|
||||||
|
@ -594,7 +594,7 @@ struct BattleScripting
|
|||||||
u16 tripleKickPower;
|
u16 tripleKickPower;
|
||||||
u8 moveendState;
|
u8 moveendState;
|
||||||
u8 savedStatChanger; // For further use, if attempting to change stat two times(ex. Moody)
|
u8 savedStatChanger; // For further use, if attempting to change stat two times(ex. Moody)
|
||||||
u8 unused_16;
|
u8 shiftSwitched; // When the game tells you the next enemy's pokemon and you switch. Option for noobs but oh well.
|
||||||
u8 battler;
|
u8 battler;
|
||||||
u8 animTurn;
|
u8 animTurn;
|
||||||
u8 animTargetsHit;
|
u8 animTargetsHit;
|
||||||
|
@ -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
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
#define sTRIPLE_KICK_POWER gBattleScripting + 0x12
|
#define sTRIPLE_KICK_POWER gBattleScripting + 0x12
|
||||||
#define sMOVEEND_STATE gBattleScripting + 0x14
|
#define sMOVEEND_STATE gBattleScripting + 0x14
|
||||||
#define sSAVED_STAT_CHANGER gBattleScripting + 0x15
|
#define sSAVED_STAT_CHANGER gBattleScripting + 0x15
|
||||||
#define sUNUSED_16 gBattleScripting + 0x16
|
#define sSHIFT_SWITCHED gBattleScripting + 0x16
|
||||||
#define sBATTLER gBattleScripting + 0x17
|
#define sBATTLER gBattleScripting + 0x17
|
||||||
#define sB_ANIM_TURN gBattleScripting + 0x18
|
#define sB_ANIM_TURN gBattleScripting + 0x18
|
||||||
#define sB_ANIM_TARGETS_HIT gBattleScripting + 0x19
|
#define sB_ANIM_TARGETS_HIT gBattleScripting + 0x19
|
||||||
|
@ -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;
|
||||||
@ -7006,11 +7006,7 @@ static void Cmd_various(void)
|
|||||||
statId = (Random() % NUM_BATTLE_STATS) + 1;
|
statId = (Random() % NUM_BATTLE_STATS) + 1;
|
||||||
} while (!(bits & gBitTable[statId]));
|
} while (!(bits & gBitTable[statId]));
|
||||||
|
|
||||||
if (gBattleMons[gActiveBattler].statStages[statId] >= 11)
|
SET_STATCHANGER(statId, 2, FALSE);
|
||||||
SET_STATCHANGER(statId, 1, FALSE);
|
|
||||||
else
|
|
||||||
SET_STATCHANGER(statId, 2, FALSE);
|
|
||||||
|
|
||||||
gBattlescriptCurrInstr += 7;
|
gBattlescriptCurrInstr += 7;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -8539,7 +8535,8 @@ static u32 ChangeStatBuffs(s8 statValue, u32 statId, u32 flags, const u8 *BS_ptr
|
|||||||
if (statValue <= -1) // Stat decrease.
|
if (statValue <= -1) // Stat decrease.
|
||||||
{
|
{
|
||||||
if (gSideTimers[GET_BATTLER_SIDE(gActiveBattler)].mistTimer
|
if (gSideTimers[GET_BATTLER_SIDE(gActiveBattler)].mistTimer
|
||||||
&& !certain && gCurrentMove != MOVE_CURSE)
|
&& !certain && gCurrentMove != MOVE_CURSE
|
||||||
|
&& !(gActiveBattler == gBattlerTarget && GetBattlerAbility(gBattlerAttacker) == ABILITY_INFILTRATOR))
|
||||||
{
|
{
|
||||||
if (flags == STAT_BUFF_ALLOW_PTR)
|
if (flags == STAT_BUFF_ALLOW_PTR)
|
||||||
{
|
{
|
||||||
@ -8564,6 +8561,7 @@ static u32 ChangeStatBuffs(s8 statValue, u32 statId, u32 flags, const u8 *BS_ptr
|
|||||||
return STAT_CHANGE_DIDNT_WORK;
|
return STAT_CHANGE_DIDNT_WORK;
|
||||||
}
|
}
|
||||||
else if ((GetBattlerAbility(gActiveBattler) == ABILITY_CLEAR_BODY
|
else if ((GetBattlerAbility(gActiveBattler) == ABILITY_CLEAR_BODY
|
||||||
|
|| GetBattlerAbility(gActiveBattler) == ABILITY_FULL_METAL_BODY
|
||||||
|| GetBattlerAbility(gActiveBattler) == ABILITY_WHITE_SMOKE)
|
|| GetBattlerAbility(gActiveBattler) == ABILITY_WHITE_SMOKE)
|
||||||
&& !certain && gCurrentMove != MOVE_CURSE)
|
&& !certain && gCurrentMove != MOVE_CURSE)
|
||||||
{
|
{
|
||||||
|
@ -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))
|
||||||
{
|
{
|
||||||
|
@ -12,7 +12,7 @@ const struct ContestMove gContestMoves[MOVES_COUNT] =
|
|||||||
},
|
},
|
||||||
|
|
||||||
[MOVE_KARATE_CHOP] =
|
[MOVE_KARATE_CHOP] =
|
||||||
{
|
{
|
||||||
.effect = CONTEST_EFFECT_AFFECTED_BY_PREV_APPEAL,
|
.effect = CONTEST_EFFECT_AFFECTED_BY_PREV_APPEAL,
|
||||||
.contestCategory = CONTEST_CATEGORY_TOUGH,
|
.contestCategory = CONTEST_CATEGORY_TOUGH,
|
||||||
.comboStarterId = 0,
|
.comboStarterId = 0,
|
||||||
@ -5367,30 +5367,37 @@ const struct ContestMove gContestMoves[MOVES_COUNT] =
|
|||||||
.comboMoves = {0}
|
.comboMoves = {0}
|
||||||
},
|
},
|
||||||
|
|
||||||
// uncomment these after adding usum moves
|
[MOVE_MIND_BLOWN] =
|
||||||
//[MOVE_MIND_BLOWN] =
|
{
|
||||||
//{
|
.effect = CONTEST_EFFECT_USER_MORE_EASILY_STARTLED,
|
||||||
// .effect = CONTEST_EFFECT_USER_MORE_EASILY_STARTLED,
|
.contestCategory = CONTEST_CATEGORY_BEAUTY,
|
||||||
// .contestCategory = CONTEST_CATEGORY_BEAUTY,
|
.comboStarterId = 0,
|
||||||
// .comboStarterId = 0,
|
.comboMoves = {0}
|
||||||
// .comboMoves = {0}
|
},
|
||||||
//},
|
|
||||||
|
|
||||||
//[MOVE_PLASMA_FISTS] =
|
[MOVE_PLASMA_FISTS] =
|
||||||
//{
|
{
|
||||||
// .effect = CONTEST_EFFECT_WORSEN_CONDITION_OF_PREV_MONS,
|
.effect = CONTEST_EFFECT_WORSEN_CONDITION_OF_PREV_MONS,
|
||||||
// .contestCategory = CONTEST_CATEGORY_COOL,
|
.contestCategory = CONTEST_CATEGORY_COOL,
|
||||||
// .comboStarterId = 0,
|
.comboStarterId = 0,
|
||||||
// .comboMoves = {0}
|
.comboMoves = {0}
|
||||||
//},
|
},
|
||||||
|
|
||||||
//[MOVE_PHOTON_GEYSER] =
|
[MOVE_PHOTON_GEYSER] =
|
||||||
//{
|
{
|
||||||
// .effect = CONTEST_EFFECT_BETTER_IF_SAME_TYPE,
|
.effect = CONTEST_EFFECT_BETTER_IF_SAME_TYPE,
|
||||||
// .contestCategory = CONTEST_CATEGORY_SMART,
|
.contestCategory = CONTEST_CATEGORY_SMART,
|
||||||
// .comboStarterId = 0,
|
.comboStarterId = 0,
|
||||||
// .comboMoves = {0}
|
.comboMoves = {0}
|
||||||
//},
|
},
|
||||||
|
|
||||||
|
[MOVE_DOUBLE_IRON_BASH] =
|
||||||
|
{
|
||||||
|
.effect = CONTEST_EFFECT_REPETITION_NOT_BORING,
|
||||||
|
.contestCategory = CONTEST_CATEGORY_TOUGH,
|
||||||
|
.comboStarterId = 0,
|
||||||
|
.comboMoves = {0}
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
const struct ContestEffect gContestEffects[] =
|
const struct ContestEffect gContestEffects[] =
|
||||||
|
@ -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;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user