Bestow
This commit is contained in:
parent
65a48e16ee
commit
162c83fcff
@ -1445,6 +1445,11 @@
|
|||||||
.4byte \ptr
|
.4byte \ptr
|
||||||
.endm
|
.endm
|
||||||
|
|
||||||
|
.macro trybestow ptr
|
||||||
|
various BS_ATTACKER, VARIOUS_BESTOW
|
||||||
|
.4byte \ptr
|
||||||
|
.endm
|
||||||
|
|
||||||
.macro invertstatstages battler
|
.macro invertstatstages battler
|
||||||
various \battler, VARIOUS_INVERT_STAT_STAGES
|
various \battler, VARIOUS_INVERT_STAT_STAGES
|
||||||
.endm
|
.endm
|
||||||
|
|||||||
@ -325,6 +325,20 @@ gBattleScriptsForMoveEffects:: @ 82D86A8
|
|||||||
.4byte BattleScript_EffectPowerTrick
|
.4byte BattleScript_EffectPowerTrick
|
||||||
.4byte BattleScript_EffectFlameBurst
|
.4byte BattleScript_EffectFlameBurst
|
||||||
.4byte BattleScript_EffectAfterYou
|
.4byte BattleScript_EffectAfterYou
|
||||||
|
.4byte BattleScript_EffectBestow
|
||||||
|
|
||||||
|
BattleScript_EffectBestow:
|
||||||
|
attackcanceler
|
||||||
|
accuracycheck BattleScript_PrintMoveMissed, NO_ACC_CALC_CHECK_LOCK_ON
|
||||||
|
attackstring
|
||||||
|
ppreduce
|
||||||
|
jumpifsubstituteblocks BattleScript_ButItFailed
|
||||||
|
trybestow BattleScript_ButItFailed
|
||||||
|
attackanimation
|
||||||
|
waitanimation
|
||||||
|
printstring STRINGID_BESTOWITEMGIVING
|
||||||
|
waitmessage 0x40
|
||||||
|
goto BattleScript_MoveEnd
|
||||||
|
|
||||||
BattleScript_EffectAfterYou:
|
BattleScript_EffectAfterYou:
|
||||||
attackcanceler
|
attackcanceler
|
||||||
|
|||||||
@ -92,5 +92,6 @@ u16 GetMegaEvolutionSpecies(u16 preEvoSpecies, u16 heldItemId);
|
|||||||
bool32 CanMegaEvolve(u8 battlerId);
|
bool32 CanMegaEvolve(u8 battlerId);
|
||||||
void UndoMegaEvolution(u8 monId);
|
void UndoMegaEvolution(u8 monId);
|
||||||
bool32 DoBattlersShareType(u32 battler1, u32 battler2);
|
bool32 DoBattlersShareType(u32 battler1, u32 battler2);
|
||||||
|
bool32 CanBattlerGetOrLoseItem(u8 battlerId, u16 itemId);
|
||||||
|
|
||||||
#endif // GUARD_BATTLE_UTIL_H
|
#endif // GUARD_BATTLE_UTIL_H
|
||||||
|
|||||||
@ -314,5 +314,6 @@
|
|||||||
#define EFFECT_POWER_TRICK 308
|
#define EFFECT_POWER_TRICK 308
|
||||||
#define EFFECT_FLAME_BURST 309
|
#define EFFECT_FLAME_BURST 309
|
||||||
#define EFFECT_AFTER_YOU 310
|
#define EFFECT_AFTER_YOU 310
|
||||||
|
#define EFFECT_BESTOW 311
|
||||||
|
|
||||||
#endif // GUARD_CONSTANTS_BATTLE_MOVE_EFFECTS_H
|
#endif // GUARD_CONSTANTS_BATTLE_MOVE_EFFECTS_H
|
||||||
|
|||||||
@ -116,6 +116,7 @@
|
|||||||
#define VARIOUS_CURE_STATUS 62
|
#define VARIOUS_CURE_STATUS 62
|
||||||
#define VARIOUS_POWER_TRICK 63
|
#define VARIOUS_POWER_TRICK 63
|
||||||
#define VARIOUS_AFTER_YOU 64
|
#define VARIOUS_AFTER_YOU 64
|
||||||
|
#define VARIOUS_BESTOW 65
|
||||||
|
|
||||||
// atk80, dmg manipulation
|
// atk80, dmg manipulation
|
||||||
#define ATK80_DMG_CHANGE_SIGN 0
|
#define ATK80_DMG_CHANGE_SIGN 0
|
||||||
|
|||||||
@ -509,6 +509,7 @@
|
|||||||
#define STRINGID_INFESTATION 506
|
#define STRINGID_INFESTATION 506
|
||||||
#define STRINGID_NOEFFECTONTARGET 507
|
#define STRINGID_NOEFFECTONTARGET 507
|
||||||
#define STRINGID_BURSTINGFLAMESHIT 508
|
#define STRINGID_BURSTINGFLAMESHIT 508
|
||||||
|
#define STRINGID_BESTOWITEMGIVING 509
|
||||||
|
|
||||||
#define BATTLESTRINGS_COUNT 521
|
#define BATTLESTRINGS_COUNT 521
|
||||||
|
|
||||||
|
|||||||
@ -650,6 +650,7 @@ static const u8 sText_severely[] = _("severely ");
|
|||||||
static const u8 sText_Infestation[] = _("{B_DEF_NAME_WITH_PREFIX} has been afflicted\nwith an infestation by {B_ATK_NAME_WITH_PREFIX}!");
|
static const u8 sText_Infestation[] = _("{B_DEF_NAME_WITH_PREFIX} has been afflicted\nwith an infestation by {B_ATK_NAME_WITH_PREFIX}!");
|
||||||
static const u8 sText_NoEffectOnTarget[] = _("It had no effect\non {B_DEF_NAME_WITH_PREFIX}!");
|
static const u8 sText_NoEffectOnTarget[] = _("It had no effect\non {B_DEF_NAME_WITH_PREFIX}!");
|
||||||
static const u8 sText_BurstingFlames[] = _("The bursting flames\nhit {B_SCR_ACTIVE_NAME_WITH_PREFIX}!");
|
static const u8 sText_BurstingFlames[] = _("The bursting flames\nhit {B_SCR_ACTIVE_NAME_WITH_PREFIX}!");
|
||||||
|
static const u8 sText_BestowItemGiving[] = _("{B_DEF_NAME_WITH_PREFIX} received {B_LAST_ITEM}\nfrom {B_ATK_NAME_WITH_PREFIX}!");
|
||||||
|
|
||||||
const u8 *const gBattleStringsTable[BATTLESTRINGS_COUNT] =
|
const u8 *const gBattleStringsTable[BATTLESTRINGS_COUNT] =
|
||||||
{
|
{
|
||||||
@ -1151,6 +1152,7 @@ const u8 *const gBattleStringsTable[BATTLESTRINGS_COUNT] =
|
|||||||
sText_Infestation,
|
sText_Infestation,
|
||||||
sText_NoEffectOnTarget,
|
sText_NoEffectOnTarget,
|
||||||
sText_BurstingFlames,
|
sText_BurstingFlames,
|
||||||
|
sText_BestowItemGiving,
|
||||||
};
|
};
|
||||||
|
|
||||||
const u16 gTerrainStringIds[] =
|
const u16 gTerrainStringIds[] =
|
||||||
|
|||||||
@ -7010,6 +7010,31 @@ static void atk76_various(void)
|
|||||||
gBattlescriptCurrInstr += 7;
|
gBattlescriptCurrInstr += 7;
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
|
case VARIOUS_BESTOW:
|
||||||
|
if (gBattleMons[gBattlerAttacker].item == ITEM_NONE
|
||||||
|
|| gBattleMons[gBattlerTarget].item != ITEM_NONE
|
||||||
|
|| !CanBattlerGetOrLoseItem(gBattlerAttacker, gBattleMons[gBattlerAttacker].item)
|
||||||
|
|| !CanBattlerGetOrLoseItem(gBattlerTarget, gBattleMons[gBattlerAttacker].item))
|
||||||
|
{
|
||||||
|
gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 3);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
gLastUsedItem = gBattleMons[gBattlerAttacker].item;
|
||||||
|
|
||||||
|
gActiveBattler = gBattlerAttacker;
|
||||||
|
gBattleMons[gActiveBattler].item = ITEM_NONE;
|
||||||
|
BtlController_EmitSetMonData(0, REQUEST_HELDITEM_BATTLE, 0, 2, &gBattleMons[gActiveBattler].item);
|
||||||
|
MarkBattlerForControllerExec(gActiveBattler);
|
||||||
|
|
||||||
|
gActiveBattler = gBattlerTarget;
|
||||||
|
gBattleMons[gActiveBattler].item = gLastUsedItem;
|
||||||
|
BtlController_EmitSetMonData(0, REQUEST_HELDITEM_BATTLE, 0, 2, &gBattleMons[gActiveBattler].item);
|
||||||
|
MarkBattlerForControllerExec(gActiveBattler);
|
||||||
|
|
||||||
|
gBattlescriptCurrInstr += 7;
|
||||||
|
}
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
gBattlescriptCurrInstr += 3;
|
gBattlescriptCurrInstr += 3;
|
||||||
@ -9687,10 +9712,10 @@ static void atkD2_tryswapitems(void) // trick
|
|||||||
// can't swap if two pokemon don't have an item
|
// can't swap if two pokemon don't have an item
|
||||||
// or if either of them is an enigma berry or a mail
|
// or if either of them is an enigma berry or a mail
|
||||||
else if ((gBattleMons[gBattlerAttacker].item == 0 && gBattleMons[gBattlerTarget].item == 0)
|
else if ((gBattleMons[gBattlerAttacker].item == 0 && gBattleMons[gBattlerTarget].item == 0)
|
||||||
|| gBattleMons[gBattlerAttacker].item == ITEM_ENIGMA_BERRY
|
|| !CanBattlerGetOrLoseItem(gBattlerAttacker, gBattleMons[gBattlerAttacker].item)
|
||||||
|| gBattleMons[gBattlerTarget].item == ITEM_ENIGMA_BERRY
|
|| !CanBattlerGetOrLoseItem(gBattlerAttacker, gBattleMons[gBattlerTarget].item)
|
||||||
|| IS_ITEM_MAIL(gBattleMons[gBattlerAttacker].item)
|
|| !CanBattlerGetOrLoseItem(gBattlerTarget, gBattleMons[gBattlerTarget].item)
|
||||||
|| IS_ITEM_MAIL(gBattleMons[gBattlerTarget].item))
|
|| !CanBattlerGetOrLoseItem(gBattlerTarget, gBattleMons[gBattlerAttacker].item))
|
||||||
{
|
{
|
||||||
gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1);
|
gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -24,6 +24,7 @@
|
|||||||
#include "link.h"
|
#include "link.h"
|
||||||
#include "berry.h"
|
#include "berry.h"
|
||||||
#include "pokedex.h"
|
#include "pokedex.h"
|
||||||
|
#include "mail.h"
|
||||||
#include "constants/battle_config.h"
|
#include "constants/battle_config.h"
|
||||||
|
|
||||||
extern u8 weather_get_current(void);
|
extern u8 weather_get_current(void);
|
||||||
@ -5680,3 +5681,21 @@ bool32 DoBattlersShareType(u32 battler1, u32 battler2)
|
|||||||
else
|
else
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool32 CanBattlerGetOrLoseItem(u8 battlerId, u16 itemId)
|
||||||
|
{
|
||||||
|
u16 species = gBattleMons[battlerId].species;
|
||||||
|
|
||||||
|
if (IS_ITEM_MAIL(itemId))
|
||||||
|
return FALSE;
|
||||||
|
else if (itemId == ITEM_ENIGMA_BERRY)
|
||||||
|
return FALSE;
|
||||||
|
else if (species == SPECIES_KYOGRE && itemId == ITEM_BLUE_ORB)
|
||||||
|
return FALSE;
|
||||||
|
else if (species == SPECIES_GROUDON && itemId == ITEM_RED_ORB)
|
||||||
|
return FALSE;
|
||||||
|
else if (ItemId_GetHoldEffect(itemId) == HOLD_EFFECT_MEGA_STONE && GetMegaEvolutionSpecies(species, itemId) != SPECIES_NONE)
|
||||||
|
return FALSE;
|
||||||
|
else
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|||||||
@ -6201,7 +6201,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] =
|
|||||||
.split = SPLIT_SPECIAL,
|
.split = SPLIT_SPECIAL,
|
||||||
},
|
},
|
||||||
{ // MOVE_BESTOW
|
{ // MOVE_BESTOW
|
||||||
.effect = EFFECT_PLACEHOLDER, // Needs a custom move effect
|
.effect = EFFECT_BESTOW,
|
||||||
.power = 0,
|
.power = 0,
|
||||||
.type = TYPE_NORMAL,
|
.type = TYPE_NORMAL,
|
||||||
.accuracy = 0,
|
.accuracy = 0,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user