mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2024-12-26 03:34:15 +01:00
Gen 8 moves initial commit
Full credit to Nunuchu42 and cfmnephrite for this code.
This commit is contained in:
parent
b615bc6dcd
commit
28e78cb6c4
@ -1878,6 +1878,36 @@
|
||||
.4byte \ptr
|
||||
.endm
|
||||
|
||||
.macro trynoretreat battler:req, ptr:req
|
||||
various \battler, VARIOUS_TRY_NO_RETREAT
|
||||
.4byte \ptr
|
||||
.endm
|
||||
|
||||
.macro trytarshot battler:req, ptr:req
|
||||
various \battler, VARIOUS_TRY_TAR_SHOT
|
||||
.4byte \ptr
|
||||
.endm
|
||||
|
||||
.macro trynextdart ptr:req
|
||||
various BS_ATTACKER, VARIOUS_TRY_NEXT_DART
|
||||
.4byte \ptr
|
||||
.endm
|
||||
|
||||
.macro checkpoltergeist battler:req, ptr:req
|
||||
various \battler, VARIOUS_CHECK_POLTERGEIST
|
||||
.4byte \ptr
|
||||
.endm
|
||||
|
||||
.macro setoctolock battler:req, ptr:req
|
||||
various \battler, VARIOUS_SET_OCTOLOCK
|
||||
.4byte \ptr
|
||||
.endm
|
||||
|
||||
.macro cutonethirdhpraisestats ptr:req
|
||||
various BS_ATTACKER, VARIOUS_CUT_1_3_HP_RAISE_STATS
|
||||
.4byte \ptr
|
||||
.endm
|
||||
|
||||
@ helpful macros
|
||||
.macro setstatchanger stat:req, stages:req, down:req
|
||||
setbyte sSTATCHANGER \stat | \stages << 3 | \down << 7
|
||||
|
@ -392,6 +392,115 @@ gBattleScriptsForMoveEffects::
|
||||
.4byte BattleScript_EffectSparklySwirl @ EFFECT_SPARKLY_SWIRL
|
||||
.4byte BattleScript_EffectPlasmaFists @ EFFECT_PLASMA_FISTS
|
||||
.4byte BattleScript_EffectHyperspaceFury @ EFFECT_HYPERSPACE_FURY
|
||||
.4byte BattleScript_EffectJawLock @ EFFECT_JAW_LOCK
|
||||
.4byte BattleScript_EffectNoRetreat @ EFFECT_NO_RETREAT
|
||||
.4byte BattleScript_EffectTarShot @ EFFECT_TAR_SHOT
|
||||
.4byte BattleScript_EffectPoltergeist @ EFFECT_POLTERGEIST
|
||||
.4byte BattleScript_EffectOctolock @ EFFECT_OCTOLOCK
|
||||
.4byte BattleScript_EffectClangorousSoul @ EFFECT_CLANGOROUS_SOUL
|
||||
.4byte BattleScript_EffectHit @ EFFECT_BOLT_BEAK
|
||||
|
||||
BattleScript_EffectClangorousSoul:
|
||||
attackcanceler
|
||||
attackstring
|
||||
ppreduce
|
||||
cutonethirdhpraisestats BattleScript_ButItFailed
|
||||
orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE
|
||||
attackanimation
|
||||
waitanimation
|
||||
healthbarupdate BS_ATTACKER
|
||||
datahpupdate BS_ATTACKER
|
||||
call BattleScript_AllStatsUp
|
||||
goto BattleScript_MoveEnd
|
||||
|
||||
BattleScript_EffectOctolock:
|
||||
attackcanceler
|
||||
jumpifsubstituteblocks BattleScript_ButItFailedAtkStringPpReduce
|
||||
accuracycheck BattleScript_PrintMoveMissed, ACC_CURR_MOVE
|
||||
attackstring
|
||||
ppreduce
|
||||
setoctolock BS_TARGET, BattleScript_ButItFailed
|
||||
attackanimation
|
||||
waitanimation
|
||||
printstring STRINGID_CANTESCAPEBECAUSEOFCURRENTMOVE
|
||||
waitmessage 0x40
|
||||
goto BattleScript_MoveEnd
|
||||
|
||||
BattleScript_OctolockEndTurn::
|
||||
playanimation BS_ATTACKER, B_ANIM_TURN_TRAP, 0
|
||||
jumpifstat BS_TARGET, CMP_GREATER_THAN, STAT_DEF, MIN_STAT_STAGE, BattleScript_OctolockLowerDef
|
||||
jumpifstat BS_TARGET, CMP_GREATER_THAN, STAT_SPDEF, MIN_STAT_STAGE, BattleScript_OctolockTryLowerSpDef
|
||||
goto BattleScript_OctolockEnd2
|
||||
BattleScript_OctolockLowerDef:
|
||||
playstatchangeanimation BS_ATTACKER, BIT_SPATK | BIT_SPDEF, STAT_CHANGE_NEGATIVE
|
||||
jumpifability BS_TARGET, ABILITY_BIG_PECKS, BattleScript_OctolockTryLowerSpDef
|
||||
setstatchanger STAT_DEF, 1, TRUE
|
||||
statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_BUFF_ALLOW_PTR, BattleScript_OctolockTryLowerSpDef
|
||||
jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, 0x2, BattleScript_OctolockTryLowerSpDef
|
||||
printfromtable gStatUpStringIds
|
||||
waitmessage 0x40
|
||||
BattleScript_OctolockTryLowerSpDef::
|
||||
setstatchanger STAT_SPDEF, 1, TRUE
|
||||
statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_BUFF_ALLOW_PTR, BattleScript_OctolockEnd2
|
||||
jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, 0x2, BattleScript_OctolockEnd2
|
||||
printfromtable gStatUpStringIds
|
||||
waitmessage 0x40
|
||||
BattleScript_OctolockEnd2::
|
||||
end2
|
||||
|
||||
BattleScript_EffectPoltergeist:
|
||||
attackcanceler
|
||||
attackstring
|
||||
ppreduce
|
||||
checkpoltergeist BS_TARGET, BattleScript_ButItFailed
|
||||
printstring STRINGID_ABOUTTOUSEPOLTERGEIST
|
||||
waitmessage 0x40
|
||||
goto BattleScript_HitFromCritCalc
|
||||
|
||||
BattleScript_EffectTarShot:
|
||||
attackcanceler
|
||||
jumpifsubstituteblocks BattleScript_ButItFailedAtkStringPpReduce
|
||||
accuracycheck BattleScript_PrintMoveMissed, ACC_CURR_MOVE
|
||||
attackstring
|
||||
ppreduce
|
||||
setstatchanger STAT_SPEED, 1, TRUE
|
||||
attackanimation
|
||||
waitanimation
|
||||
statbuffchange STAT_BUFF_ALLOW_PTR, BattleScript_TryTarShot
|
||||
setgraphicalstatchangevalues
|
||||
playanimation BS_TARGET, B_ANIM_STATS_CHANGE, sB_ANIM_ARG1
|
||||
printfromtable gStatDownStringIds
|
||||
waitmessage 0x40
|
||||
BattleScript_TryTarShot:
|
||||
trytarshot BS_TARGET, BattleScript_MoveEnd
|
||||
printstring STRINGID_PKMNBECAMEWEAKERTOFIRE
|
||||
waitmessage 0x40
|
||||
goto BattleScript_MoveEnd
|
||||
|
||||
BattleScript_EffectNoRetreat:
|
||||
attackcanceler
|
||||
accuracycheck BattleScript_PrintMoveMissed, ACC_CURR_MOVE
|
||||
attackstring
|
||||
ppreduce
|
||||
trynoretreat BS_TARGET, BattleScript_ButItFailed
|
||||
attackanimation
|
||||
waitanimation
|
||||
call BattleScript_AllStatsUp
|
||||
jumpifstatus2 BS_TARGET, STATUS2_ESCAPE_PREVENTION, BattleScript_MoveEnd
|
||||
setmoveeffect MOVE_EFFECT_PREVENT_ESCAPE
|
||||
seteffectprimary
|
||||
printstring STRINGID_CANTESCAPEDUETOUSEDMOVE
|
||||
waitmessage 0x40
|
||||
goto BattleScript_MoveEnd
|
||||
|
||||
BattleScript_EffectJawLock:
|
||||
setmoveeffect MOVE_EFFECT_TRAP_BOTH | MOVE_EFFECT_CERTAIN
|
||||
goto BattleScript_EffectHit
|
||||
|
||||
BattleScript_BothCanNoLongerEscape::
|
||||
printstring STRINGID_BOTHCANNOLONGERESCAPE
|
||||
waitmessage 0x40
|
||||
return
|
||||
|
||||
BattleScript_EffectHyperspaceFury:
|
||||
jumpifspecies BS_ATTACKER, SPECIES_TREECKO, BattleScript_EffectHyperspaceFuryUnbound
|
||||
@ -1707,7 +1816,7 @@ BattleScript_EffectSoak:
|
||||
attackanimation
|
||||
waitanimation
|
||||
trysoak BattleScript_ButItFailed
|
||||
printstring STRINGID_TRANSFORMEDINTOWATERTYPE
|
||||
printstring STRINGID_TARGETCHANGEDTYPE
|
||||
waitmessage B_WAIT_TIME_LONG
|
||||
goto BattleScript_MoveEnd
|
||||
|
||||
|
@ -112,6 +112,9 @@ struct DisableStruct
|
||||
u8 throatChopTimer;
|
||||
u8 usedMoves:4;
|
||||
u8 wrapTurns;
|
||||
u8 noRetreat:1;
|
||||
u8 tarShot:1;
|
||||
u8 octolock:1;
|
||||
};
|
||||
|
||||
struct ProtectStruct
|
||||
|
@ -407,5 +407,7 @@ extern const u8 BattleScript_WanderingSpiritActivates[];
|
||||
extern const u8 BattleScript_MirrorArmorReflect[];
|
||||
extern const u8 BattleScript_GooeyActivates[];
|
||||
extern const u8 BattleScript_PastelVeilActivates[];
|
||||
extern const u8 BattleScript_BothCanNoLongerEscape[];
|
||||
extern const u8 BattleScript_OctolockEndTurn[];
|
||||
|
||||
#endif // GUARD_BATTLE_SCRIPTS_H
|
||||
|
@ -357,7 +357,8 @@
|
||||
#define MOVE_EFFECT_INCINERATE 0x44
|
||||
#define MOVE_EFFECT_BUG_BITE 0x45
|
||||
#define MOVE_EFFECT_RECOIL_HP_25 0x46
|
||||
#define NUM_MOVE_EFFECTS 0x47
|
||||
#define MOVE_EFFECT_TRAP_BOTH 0x47
|
||||
#define NUM_MOVE_EFFECTS 0x48
|
||||
|
||||
#define MOVE_EFFECT_AFFECTS_USER 0x4000
|
||||
#define MOVE_EFFECT_CERTAIN 0x8000
|
||||
|
@ -375,7 +375,14 @@
|
||||
#define EFFECT_SPARKLY_SWIRL 369
|
||||
#define EFFECT_PLASMA_FISTS 370
|
||||
#define EFFECT_HYPERSPACE_FURY 371
|
||||
#define EFFECT_JAW_LOCK 372
|
||||
#define EFFECT_NO_RETREAT 373
|
||||
#define EFFECT_TAR_SHOT 374
|
||||
#define EFFECT_POLTERGEIST 375
|
||||
#define EFFECT_OCTOLOCK 376
|
||||
#define EFFECT_CLANGOROUS_SOUL 377
|
||||
#define EFFECT_BOLT_BEAK 378
|
||||
|
||||
#define NUM_BATTLE_MOVE_EFFECTS 372
|
||||
#define NUM_BATTLE_MOVE_EFFECTS 379
|
||||
|
||||
#endif // GUARD_CONSTANTS_BATTLE_MOVE_EFFECTS_H
|
||||
|
@ -198,6 +198,11 @@
|
||||
#define VARIOUS_JUMP_IF_WEATHER_AFFECTED 125
|
||||
#define VARIOUS_JUMP_IF_LEAF_GUARD_PROTECTED 126
|
||||
#define VARIOUS_SET_ATTACKER_STICKY_WEB_USER 127
|
||||
#define VARIOUS_TRY_NO_RETREAT 128
|
||||
#define VARIOUS_TRY_TAR_SHOT 129
|
||||
#define VARIOUS_CHECK_POLTERGEIST 130
|
||||
#define VARIOUS_SET_OCTOLOCK 131
|
||||
#define VARIOUS_CUT_1_3_HP_RAISE_STATS 132
|
||||
|
||||
// Cmd_manipulatedamage
|
||||
#define DMG_CHANGE_SIGN 0
|
||||
|
@ -420,7 +420,7 @@
|
||||
#define STRINGID_HURLEDINTOTHEAIR 416
|
||||
#define STRINGID_HELDITEMSLOSEEFFECTS 417
|
||||
#define STRINGID_FELLSTRAIGHTDOWN 418
|
||||
#define STRINGID_TRANSFORMEDINTOWATERTYPE 419
|
||||
#define STRINGID_TARGETCHANGEDTYPE 419
|
||||
#define STRINGID_PKMNACQUIREDSIMPLE 420
|
||||
#define STRINGID_EMPTYSTRING5 421
|
||||
#define STRINGID_KINDOFFER 422
|
||||
@ -601,8 +601,13 @@
|
||||
#define STRINGID_SWAPPEDABILITIES 598
|
||||
#define STRINGID_PASTELVEILPROTECTED 599
|
||||
#define STRINGID_PASTELVEILENTERS 600
|
||||
#define STRINGID_BOTHCANNOLONGERESCAPE 601
|
||||
#define STRINGID_CANTESCAPEDUETOUSEDMOVE 602
|
||||
#define STRINGID_PKMNBECAMEWEAKERTOFIRE 603
|
||||
#define STRINGID_ABOUTTOUSEPOLTERGEIST 604
|
||||
#define STRINGID_CANTESCAPEBECAUSEOFCURRENTMOVE 605
|
||||
|
||||
#define BATTLESTRINGS_COUNT 601
|
||||
#define BATTLESTRINGS_COUNT 606
|
||||
|
||||
// The below IDs are all indexes into battle message tables,
|
||||
// used to determine which of a set of messages to print.
|
||||
|
@ -549,7 +549,7 @@ static const u8 sText_BecameNimble[] =_("{B_ATK_NAME_WITH_PREFIX} became nimble!
|
||||
static const u8 sText_HurledIntoTheAir[] =_("{B_DEF_NAME_WITH_PREFIX} was hurled\ninto the air!");
|
||||
static const u8 sText_HeldItemsLoseEffects[] =_("It created a bizarre area in which\nPokémon's held items lose their effects!");
|
||||
static const u8 sText_FellStraightDown[] =_("{B_DEF_NAME_WITH_PREFIX} fell\nstraight down!");
|
||||
static const u8 sText_TransformedIntoWaterType[] =_("{B_DEF_NAME_WITH_PREFIX} transformed\ninto the water type!");
|
||||
static const u8 sText_TargetChangedType[] =_("{B_DEF_NAME_WITH_PREFIX} transformed\ninto the {B_BUFF1} type!");
|
||||
static const u8 sText_PkmnAcquiredSimple[] =_("{B_DEF_NAME_WITH_PREFIX} acquired\nSimple!");
|
||||
static const u8 sText_KindOffer[] =_("{B_DEF_NAME_WITH_PREFIX}\ntook the kind offer!");
|
||||
static const u8 sText_ResetsTargetsStatLevels[] =_("{B_DEF_NAME_WITH_PREFIX}'s stat changes\nwere removed!");
|
||||
@ -727,6 +727,11 @@ static const u8 sText_AbilityAllowsOnlyMove[] = _("{B_ATK_ABILITY} allows the\nu
|
||||
static const u8 sText_SwappedAbilities[] = _("{B_DEF_NAME_WITH_PREFIX} swapped Abilities\nwith its target!");
|
||||
static const u8 sText_PastelVeilProtected[] = _("{B_DEF_NAME_WITH_PREFIX} is protected\nby a pastel veil!");
|
||||
static const u8 sText_PastelVeilEnters[] = _("{B_DEF_NAME_WITH_PREFIX} was cured\nof its poisoning!");
|
||||
static const u8 sText_BothCanNoLongerEscape[] = _("Neither POKéMON can run away!");
|
||||
static const u8 sText_CantEscapeDueToUsedMove[] = _("{B_ATK_NAME_WITH_PREFIX} can no longer escape\nbecause it used {B_CURRENT_MOVE}!");
|
||||
static const u8 sText_PkmnBecameWeakerToFire[] = _("{B_DEF_NAME_WITH_PREFIX} became\nweaker to fire!");
|
||||
static const u8 sText_PkmnAboutToBeAttackedByItsItem[] = _("{B_DEF_NAME_WITH_PREFIX} is about\nto be attacked by its {B_BUFF1}!");
|
||||
static const u8 sText_CantEscapeBecauseOfCurrentMove[] = _("{B_DEF_NAME_WITH_PREFIX} can no longer escape\nbecause of {B_CURRENT_MOVE}!");
|
||||
|
||||
const u8 *const gBattleStringsTable[BATTLESTRINGS_COUNT] =
|
||||
{
|
||||
@ -1208,7 +1213,7 @@ const u8 *const gBattleStringsTable[BATTLESTRINGS_COUNT] =
|
||||
[STRINGID_HURLEDINTOTHEAIR - 12] = sText_HurledIntoTheAir,
|
||||
[STRINGID_HELDITEMSLOSEEFFECTS - 12] = sText_HeldItemsLoseEffects,
|
||||
[STRINGID_FELLSTRAIGHTDOWN - 12] = sText_FellStraightDown,
|
||||
[STRINGID_TRANSFORMEDINTOWATERTYPE - 12] = sText_TransformedIntoWaterType,
|
||||
[STRINGID_TARGETCHANGEDTYPE - 12] = sText_TargetChangedType,
|
||||
[STRINGID_PKMNACQUIREDSIMPLE - 12] = sText_PkmnAcquiredSimple,
|
||||
[STRINGID_EMPTYSTRING5 - 12] = sText_EmptyString4,
|
||||
[STRINGID_KINDOFFER - 12] = sText_KindOffer,
|
||||
@ -1318,6 +1323,11 @@ const u8 *const gBattleStringsTable[BATTLESTRINGS_COUNT] =
|
||||
[STRINGID_AURABREAKENTERS - 12] = sText_AuraBreakActivates,
|
||||
[STRINGID_COMATOSEENTERS - 12] = sText_ComatoseActivates,
|
||||
[STRINGID_SCREENCLEANERENTERS - 12] = sText_ScreenCleanerActivates,
|
||||
[STRINGID_BOTHCANNOLONGERESCAPE - 12] = sText_BothCanNoLongerEscape,
|
||||
[STRINGID_CANTESCAPEDUETOUSEDMOVE - 12] = sText_CantEscapeDueToUsedMove,
|
||||
[STRINGID_PKMNBECAMEWEAKERTOFIRE - 12] = sText_PkmnBecameWeakerToFire,
|
||||
[STRINGID_ABOUTTOUSEPOLTERGEIST - 12] = sText_PkmnAboutToBeAttackedByItsItem,
|
||||
[STRINGID_CANTESCAPEBECAUSEOFCURRENTMOVE - 12] = sText_CantEscapeBecauseOfCurrentMove,
|
||||
};
|
||||
|
||||
const u16 gMentalHerbCureStringIds[] =
|
||||
|
@ -3399,6 +3399,21 @@ void SetMoveEffect(bool32 primary, u32 certain)
|
||||
gBattlescriptCurrInstr = BattleScript_MoveEffectBugBite;
|
||||
}
|
||||
break;
|
||||
case MOVE_EFFECT_TRAP_BOTH:
|
||||
if (!(gBattleMons[gBattlerTarget].status2 & STATUS2_ESCAPE_PREVENTION) && !(gBattleMons[gBattlerAttacker].status2 & STATUS2_ESCAPE_PREVENTION))
|
||||
{
|
||||
BattleScriptPush(gBattlescriptCurrInstr + 1);
|
||||
gBattlescriptCurrInstr = BattleScript_BothCanNoLongerEscape;
|
||||
}
|
||||
if (!gBattleMons[gBattlerTarget].status2 & STATUS2_ESCAPE_PREVENTION)
|
||||
gDisableStructs[gBattlerTarget].battlerPreventingEscape = gBattlerAttacker;
|
||||
|
||||
if (!(gBattleMons[gBattlerAttacker].status2 & STATUS2_ESCAPE_PREVENTION))
|
||||
gDisableStructs[gBattlerAttacker].battlerPreventingEscape = gBattlerTarget;
|
||||
|
||||
gBattleMons[gBattlerTarget].status2 |= STATUS2_ESCAPE_PREVENTION;
|
||||
gBattleMons[gBattlerAttacker].status2 |= STATUS2_ESCAPE_PREVENTION;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -8154,13 +8169,15 @@ static void Cmd_various(void)
|
||||
}
|
||||
return;
|
||||
case VARIOUS_TRY_SOAK:
|
||||
if (gBattleMons[gBattlerTarget].type1 == TYPE_WATER && gBattleMons[gBattlerTarget].type2 == TYPE_WATER)
|
||||
if (gBattleMons[gBattlerTarget].type1 == gBattleMoves[gCurrentMove].type
|
||||
&& gBattleMons[gBattlerTarget].type2 == gBattleMoves[gCurrentMove].type)
|
||||
{
|
||||
gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 3);
|
||||
}
|
||||
else
|
||||
{
|
||||
SET_BATTLER_TYPE(gBattlerTarget, TYPE_WATER);
|
||||
SET_BATTLER_TYPE(gBattlerTarget, gBattleMoves[gCurrentMove].type);
|
||||
PREPARE_TYPE_BUFFER(gBattleTextBuff1, gBattleMoves[gCurrentMove].type);
|
||||
gBattlescriptCurrInstr += 7;
|
||||
}
|
||||
return;
|
||||
@ -9017,6 +9034,79 @@ static void Cmd_various(void)
|
||||
if (gBattleStruct->stickyWebUser != 0xFF)
|
||||
gBattlerAttacker = gBattleStruct->stickyWebUser;
|
||||
break;
|
||||
case VARIOUS_CUT_1_3_HP_RAISE_STATS:
|
||||
{
|
||||
bool8 atLeastOneStatBoosted = FALSE;
|
||||
bool8 hasContrary = (GetBattlerAbility(gBattlerAttacker) == ABILITY_CONTRARY);
|
||||
u16 hpFraction = min(1, gBattleMons[gBattlerAttacker].maxHP / 3);
|
||||
|
||||
for (i = 1; i < NUM_STATS; i++)
|
||||
{
|
||||
if (!(gBattleMons[gBattlerAttacker].statStages[i] == MAX_STAT_STAGE
|
||||
|| (hasContrary && gBattleMons[gBattlerAttacker].statStages[i] == MIN_STAT_STAGE)))
|
||||
{
|
||||
atLeastOneStatBoosted = TRUE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (atLeastOneStatBoosted && gBattleMons[gBattlerAttacker].hp > hpFraction)
|
||||
{
|
||||
gBattleMoveDamage = hpFraction;
|
||||
gBattlescriptCurrInstr += 7;
|
||||
}
|
||||
else
|
||||
{
|
||||
gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 3);
|
||||
}
|
||||
}
|
||||
return;
|
||||
case VARIOUS_SET_OCTOLOCK:
|
||||
if (gDisableStructs[gActiveBattler].octolock)
|
||||
{
|
||||
gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 3);
|
||||
}
|
||||
else
|
||||
{
|
||||
gDisableStructs[gActiveBattler].octolock = 1;
|
||||
gBattleMons[gActiveBattler].status2 |= STATUS2_ESCAPE_PREVENTION;
|
||||
gDisableStructs[gActiveBattler].battlerPreventingEscape = gBattlerAttacker;
|
||||
gBattlescriptCurrInstr += 7;
|
||||
}
|
||||
return;
|
||||
case VARIOUS_CHECK_POLTERGEIST:
|
||||
if (gBattleMons[gActiveBattler].item == ITEM_NONE
|
||||
|| gFieldStatuses & STATUS_FIELD_MAGIC_ROOM
|
||||
|| GetBattlerAbility(gActiveBattler) == ABILITY_KLUTZ)
|
||||
{
|
||||
gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 3);
|
||||
}
|
||||
else
|
||||
{
|
||||
PREPARE_ITEM_BUFFER(gBattleTextBuff1, gBattleMons[gActiveBattler].item);
|
||||
gBattlescriptCurrInstr += 7;
|
||||
}
|
||||
return;
|
||||
case VARIOUS_TRY_NO_RETREAT:
|
||||
if (gDisableStructs[gActiveBattler].noRetreat)
|
||||
gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 3);
|
||||
else
|
||||
{
|
||||
if (!(gBattleMons[gActiveBattler].status2 & STATUS2_ESCAPE_PREVENTION))
|
||||
gDisableStructs[gActiveBattler].noRetreat = 1;
|
||||
gBattlescriptCurrInstr += 7;
|
||||
}
|
||||
return;
|
||||
case VARIOUS_TRY_TAR_SHOT:
|
||||
if (gDisableStructs[gActiveBattler].tarShot)
|
||||
{
|
||||
gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 3);
|
||||
}
|
||||
else
|
||||
{
|
||||
gDisableStructs[gActiveBattler].tarShot = 1;
|
||||
gBattlescriptCurrInstr += 7;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
gBattlescriptCurrInstr += 3;
|
||||
|
@ -2382,6 +2382,7 @@ enum
|
||||
ENDTURN_NIGHTMARES,
|
||||
ENDTURN_CURSE,
|
||||
ENDTURN_WRAP,
|
||||
ENDTURN_OCTOLOCK,
|
||||
ENDTURN_UPROAR,
|
||||
ENDTURN_THRASH,
|
||||
ENDTURN_FLINCH,
|
||||
@ -2652,6 +2653,18 @@ u8 DoBattlerEndTurnEffects(void)
|
||||
}
|
||||
gBattleStruct->turnEffectsTracker++;
|
||||
break;
|
||||
case ENDTURN_OCTOLOCK:
|
||||
if (gDisableStructs[gActiveBattler].octolock
|
||||
&& !(GetBattlerAbility(gActiveBattler) == ABILITY_CLEAR_BODY
|
||||
|| GetBattlerAbility(gActiveBattler) == ABILITY_FULL_METAL_BODY
|
||||
|| GetBattlerAbility(gActiveBattler) == ABILITY_WHITE_SMOKE))
|
||||
{
|
||||
gBattlerTarget = gActiveBattler;
|
||||
BattleScriptExecute(BattleScript_OctolockEndTurn);
|
||||
effect++;
|
||||
}
|
||||
gBattleStruct->turnEffectsTracker++;
|
||||
break;
|
||||
case ENDTURN_UPROAR: // uproar
|
||||
if (gBattleMons[gActiveBattler].status2 & STATUS2_UPROAR)
|
||||
{
|
||||
@ -7731,6 +7744,10 @@ static u16 CalcMoveBasePower(u16 move, u8 battlerAtk, u8 battlerDef)
|
||||
&& (gDisableStructs[battlerDef].isFirstTurn != 2 || B_PAYBACK_SWITCH_BOOST < GEN_5))
|
||||
basePower *= 2;
|
||||
break;
|
||||
case EFFECT_BOLT_BEAK:
|
||||
if (GetBattlerTurnOrderNum(battlerAtk) < GetBattlerTurnOrderNum(battlerDef))
|
||||
basePower *= 2;
|
||||
break;
|
||||
case EFFECT_ROUND:
|
||||
if (gChosenMoveByBattler[BATTLE_PARTNER(battlerAtk)] == MOVE_ROUND && !(gAbsentBattlerFlags & gBitTable[BATTLE_PARTNER(battlerAtk)]))
|
||||
basePower *= 2;
|
||||
@ -8741,6 +8758,8 @@ u16 CalcTypeEffectivenessMultiplier(u16 move, u8 moveType, u8 battlerAtk, u8 bat
|
||||
modifier = CalcTypeEffectivenessMultiplierInternal(move, moveType, battlerAtk, battlerDef, recordAbilities, modifier);
|
||||
if (gBattleMoves[move].effect == EFFECT_TWO_TYPED_MOVE)
|
||||
modifier = CalcTypeEffectivenessMultiplierInternal(move, gBattleMoves[move].argument, battlerAtk, battlerDef, recordAbilities, modifier);
|
||||
else if (moveType == TYPE_FIRE && gDisableStructs[battlerDef].tarShot)
|
||||
modifier = CalcTypeEffectivenessMultiplierInternal(move, moveType, battlerAtk, battlerDef, recordAbilities, UQ_4_12(2.0));
|
||||
}
|
||||
|
||||
if (recordAbilities)
|
||||
|
@ -10771,7 +10771,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] =
|
||||
|
||||
[MOVE_JAW_LOCK] =
|
||||
{
|
||||
.effect = EFFECT_MEAN_LOOK,
|
||||
.effect = EFFECT_JAW_LOCK,
|
||||
.power = 80,
|
||||
.type = TYPE_DARK,
|
||||
.accuracy = 100,
|
||||
@ -10799,7 +10799,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] =
|
||||
|
||||
[MOVE_NO_RETREAT] =
|
||||
{
|
||||
.effect = EFFECT_PLACEHOLDER, //TODO
|
||||
.effect = EFFECT_NO_RETREAT,
|
||||
.power = 0,
|
||||
.type = TYPE_FIGHTING,
|
||||
.accuracy = 0,
|
||||
@ -10827,7 +10827,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] =
|
||||
|
||||
[MOVE_MAGIC_POWDER] =
|
||||
{
|
||||
.effect = EFFECT_THIRD_TYPE,
|
||||
.effect = EFFECT_SOAK,
|
||||
.power = 0,
|
||||
.type = TYPE_PSYCHIC,
|
||||
.accuracy = 100,
|
||||
@ -10870,7 +10870,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] =
|
||||
|
||||
[MOVE_OCTOLOCK] =
|
||||
{
|
||||
.effect = EFFECT_MEAN_LOOK,
|
||||
.effect = EFFECT_OCTOLOCK,
|
||||
.power = 0,
|
||||
.type = TYPE_FIGHTING,
|
||||
.accuracy = 100,
|
||||
@ -10884,7 +10884,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] =
|
||||
|
||||
[MOVE_BOLT_BEAK] =
|
||||
{
|
||||
.effect = EFFECT_PLACEHOLDER, //TODO
|
||||
.effect = EFFECT_BOLT_BEAK,
|
||||
.power = 85,
|
||||
.type = TYPE_ELECTRIC,
|
||||
.accuracy = 100,
|
||||
@ -10898,7 +10898,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] =
|
||||
|
||||
[MOVE_FISHIOUS_REND] =
|
||||
{
|
||||
.effect = EFFECT_PLACEHOLDER, //TODO. same as bolt beak
|
||||
.effect = EFFECT_BOLT_BEAK,
|
||||
.power = 85,
|
||||
.type = TYPE_WATER,
|
||||
.accuracy = 100,
|
||||
@ -10926,7 +10926,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] =
|
||||
|
||||
[MOVE_CLANGOROUS_SOUL] =
|
||||
{
|
||||
.effect = EFFECT_PLACEHOLDER, //TODO
|
||||
.effect = EFFECT_CLANGOROUS_SOUL,
|
||||
.power = 0,
|
||||
.type = TYPE_DRAGON,
|
||||
.accuracy = 100,
|
||||
@ -11402,7 +11402,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] =
|
||||
|
||||
[MOVE_POLTERGEIST] =
|
||||
{
|
||||
.effect = EFFECT_PLACEHOLDER, //TODO
|
||||
.effect = EFFECT_POLTERGEIST,
|
||||
.power = 110,
|
||||
.type = TYPE_GHOST,
|
||||
.accuracy = 90,
|
||||
|
Loading…
Reference in New Issue
Block a user