mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2025-01-13 23:23:43 +01:00
Techno Blast and Autotomize
This commit is contained in:
parent
9474254e4d
commit
db44a7e25a
@ -1491,6 +1491,11 @@
|
||||
.4byte \ptr
|
||||
.endm
|
||||
|
||||
.macro tryautonomize battler ptr
|
||||
various \battler, VARIOUS_TRY_AUTONOMIZE
|
||||
.4byte \ptr
|
||||
.endm
|
||||
|
||||
@ helpful macros
|
||||
.macro setstatchanger stat, stages, down
|
||||
setbyte sSTATCHANGER \stat | \stages << 4 | \down << 7
|
||||
|
@ -313,6 +313,34 @@ gBattleScriptsForMoveEffects:: @ 82D86A8
|
||||
.4byte BattleScript_EffectClearSmog
|
||||
.4byte BattleScript_EffectHitSwitchTarget
|
||||
.4byte BattleScript_EffectFinalGambit
|
||||
.4byte BattleScript_EffectTechnoBlast
|
||||
.4byte BattleScript_EffectJudgment
|
||||
.4byte BattleScript_EffectAutonomize
|
||||
|
||||
BattleScript_EffectAutonomize:
|
||||
setstatchanger STAT_SPEED, 2, FALSE
|
||||
attackcanceler
|
||||
attackstring
|
||||
ppreduce
|
||||
statbuffchange MOVE_EFFECT_AFFECTS_USER | 0x1, BattleScript_AutonomizeWeightLoss
|
||||
jumpifbyte CMP_NOT_EQUAL, cMULTISTRING_CHOOSER, 0x2, BattleScript_AutonomizeAttackAnim
|
||||
pause 0x20
|
||||
goto BattleScript_AutonomizePrintString
|
||||
BattleScript_AutonomizeAttackAnim::
|
||||
attackanimation
|
||||
waitanimation
|
||||
BattleScript_AutonomizeDoAnim::
|
||||
setgraphicalstatchangevalues
|
||||
playanimation BS_ATTACKER, B_ANIM_STATS_CHANGE, sB_ANIM_ARG1
|
||||
BattleScript_AutonomizePrintString::
|
||||
printfromtable gStatUpStringIds
|
||||
waitmessage 0x40
|
||||
BattleScript_AutonomizeWeightLoss::
|
||||
jumpifmovehadnoeffect BattleScript_MoveEnd
|
||||
tryautonomize BS_ATTACKER, BattleScript_MoveEnd
|
||||
printstring STRINGID_BECAMENIMBLE
|
||||
waitmessage 0x40
|
||||
goto BattleScript_MoveEnd
|
||||
|
||||
BattleScript_EffectFinalGambit:
|
||||
attackcanceler
|
||||
@ -1267,6 +1295,8 @@ BattleScript_EffectWeatherBall:
|
||||
BattleScript_EffectHiddenPower:
|
||||
BattleScript_EffectFreezeDry:
|
||||
BattleScript_EffectTwoTypedMove:
|
||||
BattleScript_EffectTechnoBlast:
|
||||
BattleScript_EffectJudgment:
|
||||
jumpifnotmove MOVE_SURF, BattleScript_HitFromAtkCanceler
|
||||
jumpifnostatus3 BS_TARGET, STATUS3_UNDERWATER, BattleScript_HitFromAtkCanceler
|
||||
orword gHitMarker, HITMARKER_IGNORE_UNDERWATER
|
||||
|
@ -302,5 +302,8 @@
|
||||
#define EFFECT_CLEAR_SMOG 296
|
||||
#define EFFECT_HIT_SWITCH_TARGET 297
|
||||
#define EFFECT_FINAL_GAMBIT 298
|
||||
#define EFFECT_TECHNO_BLAST 299
|
||||
#define EFFECT_JUDGMENT 300
|
||||
#define EFFECT_AUTONOMIZE 301
|
||||
|
||||
#endif // GUARD_CONSTANTS_BATTLE_MOVE_EFFECTS_H
|
||||
|
@ -104,6 +104,7 @@
|
||||
#define VARIOUS_TRY_LAST_RESORT 52
|
||||
#define VARIOUS_ARGUMENT_STATUS_EFFECT 53
|
||||
#define VARIOUS_TRY_HIT_SWITCH_TARGET 54
|
||||
#define VARIOUS_TRY_AUTONOMIZE 55
|
||||
|
||||
// atk80, dmg manipulation
|
||||
#define ATK80_DMG_CHANGE_SIGN 0
|
||||
|
@ -107,6 +107,7 @@
|
||||
#define HOLD_EFFECT_EVIOLITE 117
|
||||
#define HOLD_EFFECT_ASSAULT_VEST 118
|
||||
#define HOLD_EFFECT_BINDING_BAND 119
|
||||
#define HOLD_EFFECT_DRIVE 120
|
||||
|
||||
// Gen6 hold effects
|
||||
#define HOLD_EFFECT_FAIRY_POWER 130
|
||||
|
@ -5376,6 +5376,15 @@ void SetTypeBeforeUsingMove(u16 move, u8 battlerAtk)
|
||||
gBattleStruct->dynamicMoveType++;
|
||||
gBattleStruct->dynamicMoveType |= 0xC0;
|
||||
}
|
||||
else if (gBattleMoves[move].effect == EFFECT_TECHNO_BLAST)
|
||||
{
|
||||
if (GetBattlerHoldEffect(battlerAtk, TRUE) == HOLD_EFFECT_DRIVE)
|
||||
gBattleStruct->dynamicMoveType = ItemId_GetSecondaryId(gBattleMons[battlerAtk].item) | 0x80;
|
||||
}
|
||||
else if (gBattleMoves[move].effect == EFFECT_JUDGMENT)
|
||||
{
|
||||
// TODO:
|
||||
}
|
||||
|
||||
attackerAbility = GetBattlerAbility(battlerAtk);
|
||||
GET_MOVE_TYPE(move, moveType);
|
||||
@ -5387,6 +5396,7 @@ void SetTypeBeforeUsingMove(u16 move, u8 battlerAtk)
|
||||
else if (gBattleMoves[move].type == TYPE_NORMAL
|
||||
&& gBattleMoves[move].effect != EFFECT_HIDDEN_POWER
|
||||
&& gBattleMoves[move].effect != EFFECT_WEATHER_BALL
|
||||
&& gBattleMoves[move].effect != EFFECT_JUDGMENT
|
||||
&& ((attackerAbility == ABILITY_PIXILATE && (ateType = TYPE_FAIRY))
|
||||
|| (attackerAbility == ABILITY_REFRIGERATE && (ateType = TYPE_ICE))
|
||||
|| (attackerAbility == ABILITY_AERILATE && (ateType = TYPE_FLYING))
|
||||
|
@ -6735,6 +6735,17 @@ static void atk76_various(void)
|
||||
gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 3);
|
||||
}
|
||||
return;
|
||||
case VARIOUS_TRY_AUTONOMIZE:
|
||||
if (GetBattlerWeight(gActiveBattler) > 1)
|
||||
{
|
||||
gDisableStructs[gActiveBattler].autonomizeCount++;
|
||||
gBattlescriptCurrInstr += 7;
|
||||
}
|
||||
else
|
||||
{
|
||||
gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 3);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
gBattlescriptCurrInstr += 3;
|
||||
|
@ -4475,6 +4475,7 @@ u8 GetBattleMonMoveSlot(struct BattlePokemon *battleMon, u16 move)
|
||||
|
||||
u32 GetBattlerWeight(u8 battlerId)
|
||||
{
|
||||
u32 i;
|
||||
u32 weight = GetPokedexHeightWeight(SpeciesToNationalPokedexNum(gBattleMons[battlerId].species), 1);
|
||||
u32 ability = GetBattlerAbility(battlerId);
|
||||
u32 holdEffect = GetBattlerHoldEffect(battlerId, TRUE);
|
||||
@ -4487,8 +4488,18 @@ u32 GetBattlerWeight(u8 battlerId)
|
||||
if (holdEffect == HOLD_EFFECT_FLOAT_STONE)
|
||||
weight /= 2;
|
||||
|
||||
if (gDisableStructs[battlerId].autonomizeCount)
|
||||
weight -= 1000 * gDisableStructs[battlerId].autonomizeCount;
|
||||
for (i = 0; i < gDisableStructs[battlerId].autonomizeCount; i++)
|
||||
{
|
||||
if (weight > 1000)
|
||||
{
|
||||
weight -= 1000;
|
||||
}
|
||||
else if (weight <= 1000)
|
||||
{
|
||||
weight = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (weight == 0)
|
||||
weight = 1;
|
||||
|
@ -5397,7 +5397,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] =
|
||||
.split = SPLIT_SPECIAL,
|
||||
},
|
||||
{ // MOVE_JUDGMENT
|
||||
.effect = EFFECT_PLACEHOLDER, // Needs a custom move effect
|
||||
.effect = EFFECT_JUDGMENT,
|
||||
.power = 100,
|
||||
.type = TYPE_NORMAL,
|
||||
.accuracy = 100,
|
||||
@ -5709,7 +5709,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] =
|
||||
.split = SPLIT_SPECIAL,
|
||||
},
|
||||
{ // MOVE_AUTOTOMIZE
|
||||
.effect = EFFECT_PLACEHOLDER, // Needs a custom move effect (raises the user's Speed stat by two stages BUT also decreases the user's weight by 100kg)
|
||||
.effect = EFFECT_AUTONOMIZE,
|
||||
.power = 0,
|
||||
.type = TYPE_STEEL,
|
||||
.accuracy = 0,
|
||||
@ -6561,7 +6561,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] =
|
||||
.split = SPLIT_SPECIAL,
|
||||
},
|
||||
{ // MOVE_TECHNO_BLAST
|
||||
.effect = EFFECT_PLACEHOLDER, // Needs a custom move effect
|
||||
.effect = EFFECT_TECHNO_BLAST,
|
||||
.power = 120,
|
||||
.type = TYPE_NORMAL,
|
||||
.accuracy = 100,
|
||||
|
Loading…
x
Reference in New Issue
Block a user