Destiny Knot

This commit is contained in:
DizzyEggg 2020-04-22 14:40:44 +02:00
parent e2524bed49
commit d56aaf7c0b
7 changed files with 42 additions and 1 deletions

View File

@ -1736,6 +1736,11 @@
.4byte \ptr
.endm
.macro infatuatewithbattler battler1:req, battler2:req
various \battler1, VARIOUS_INFATUATE_WITH_BATTLER
.byte \battler2
.endm
@ helpful macros
.macro setstatchanger stat:req, stages:req, down:req
setbyte sSTATCHANGER \stat | \stages << 3 | \down << 7

View File

@ -3724,6 +3724,30 @@ BattleScript_FuryCutterHit:
jumpifmovehadnoeffect BattleScript_FuryCutterHit
adjustdamage
goto BattleScript_HitFromAtkAnimation
BattleScript_TryDestinyKnotTarget:
jumpifnoholdeffect BS_ATTACKER, HOLD_EFFECT_DESTINY_KNOT, BattleScript_TryDestinyKnotTargetRet
infatuatewithbattler BS_TARGET, BS_ATTACKER
playanimation BS_ATTACKER, B_ANIM_HELD_ITEM_EFFECT, NULL
waitanimation
status2animation BS_TARGET, STATUS2_INFATUATION
waitanimation
printstring STRINGID_DESTINYKNOTACTIVATES
waitmessage 0x40
BattleScript_TryDestinyKnotTargetRet:
return
BattleScript_TryDestinyKnotAttacker:
jumpifnoholdeffect BS_TARGET, HOLD_EFFECT_DESTINY_KNOT, BattleScript_TryDestinyKnotAttackerRet
infatuatewithbattler BS_ATTACKER, BS_TARGET
playanimation BS_TARGET, B_ANIM_HELD_ITEM_EFFECT, NULL
waitanimation
status2animation BS_ATTACKER, STATUS2_INFATUATION
waitanimation
printstring STRINGID_DESTINYKNOTACTIVATES
waitmessage 0x40
BattleScript_TryDestinyKnotAttackerRet:
return
BattleScript_EffectAttract::
attackcanceler
@ -3736,6 +3760,7 @@ BattleScript_EffectAttract::
waitanimation
printstring STRINGID_PKMNFELLINLOVE
waitmessage 0x40
call BattleScript_TryDestinyKnotAttacker
goto BattleScript_MoveEnd
BattleScript_EffectPresent::
@ -7077,6 +7102,7 @@ BattleScript_CuteCharmActivates::
status2animation BS_ATTACKER, STATUS2_INFATUATION
printstring STRINGID_PKMNSXINFATUATEDY
waitmessage 0x40
call BattleScript_TryDestinyKnotTarget
return
BattleScript_AbilityStatusEffect::

View File

@ -158,6 +158,7 @@
#define VARIOUS_JUMP_IF_NO_ALLY 95
#define VARIOUS_HANDLE_TYPE_IMMUNITY 96
#define VARIOUS_JUMP_IF_NO_HOLD_EFFECT 97
#define VARIOUS_INFATUATE_WITH_BATTLER 98
// Cmd_manipulatedamage
#define DMG_CHANGE_SIGN 0

View File

@ -547,7 +547,8 @@
#define STRINGID_RECEIVERABILITYTAKEOVER 543
#define STRINGID_PKNMABSORBINGPOWER 544
#define STRINGID_NOONEWILLBEABLETORUNAWAY 545
#define STRINGID_DESTINYKNOTACTIVATES 546
#define BATTLESTRINGS_COUNT 546
#define BATTLESTRINGS_COUNT 547
#endif // GUARD_CONSTANTS_BATTLE_STRING_IDS_H

View File

@ -668,9 +668,11 @@ static const u8 sText_HealerCure[] = _("{B_ATK_NAME_WITH_PREFIX}'s {B_LAST_ABILI
static const u8 sText_ReceiverAbilityTakeOver[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX}'s {B_SCR_ACTIVE_ABILITY}\nwas taken over!");
static const u8 sText_PkmnAbsorbingPower[] = _("{B_ATK_NAME_WITH_PREFIX} is absorbing power!");
static const u8 sText_NoOneWillBeAbleToRun[] = _("No one will be able to run away\nduring the next turn!");
static const u8 sText_DestinyKnotActivates[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX} fell in love\nfrom the {B_LAST_ITEM}!");
const u8 *const gBattleStringsTable[BATTLESTRINGS_COUNT] =
{
[STRINGID_DESTINYKNOTACTIVATES - 12] = sText_DestinyKnotActivates,
[STRINGID_NOONEWILLBEABLETORUNAWAY - 12] = sText_NoOneWillBeAbleToRun,
[STRINGID_PKNMABSORBINGPOWER - 12] = sText_PkmnAbsorbingPower,
[STRINGID_RECEIVERABILITYTAKEOVER - 12] = sText_ReceiverAbilityTakeOver,

View File

@ -6851,6 +6851,11 @@ static void Cmd_various(void)
else
gBattlescriptCurrInstr += 7;
return;
case VARIOUS_INFATUATE_WITH_BATTLER:
gBattleScripting.battler = gActiveBattler;
gBattleMons[gActiveBattler].status2 |= STATUS2_INFATUATED_WITH(GetBattlerForBattleScript(gBattlescriptCurrInstr[3]));
gBattlescriptCurrInstr += 4;
return;
case VARIOUS_TRY_FAIRY_LOCK:
if (gFieldStatuses & STATUS_FIELD_FAIRY_LOCK)
{

View File

@ -326,6 +326,7 @@ u8 GetBattlerForBattleScript(u8 caseId)
break;
case BS_ABILITY_BATTLER:
ret = gBattlerAbility;
break;
}
return ret;
}