mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2024-11-16 11:37:40 +01:00
Fixed Speed Swap's effect
This commit is contained in:
parent
90dd59c039
commit
4c9446ed0a
@ -2000,6 +2000,11 @@
|
|||||||
.4byte \ptr
|
.4byte \ptr
|
||||||
.endm
|
.endm
|
||||||
|
|
||||||
|
.macro swapstats stat:req
|
||||||
|
various BS_ATTACKER, VARIOUS_SWAP_STATS
|
||||||
|
.byte \stat
|
||||||
|
.endm
|
||||||
|
|
||||||
@ helpful macros
|
@ helpful macros
|
||||||
.macro setstatchanger stat:req, stages:req, down:req
|
.macro setstatchanger stat:req, stages:req, down:req
|
||||||
setbyte sSTATCHANGER, \stat | \stages << 3 | \down << 7
|
setbyte sSTATCHANGER, \stat | \stages << 3 | \down << 7
|
||||||
|
@ -2732,10 +2732,10 @@ BattleScript_EffectSpeedSwap:
|
|||||||
attackstring
|
attackstring
|
||||||
ppreduce
|
ppreduce
|
||||||
accuracycheck BattleScript_ButItFailed, NO_ACC_CALC_CHECK_LOCK_ON
|
accuracycheck BattleScript_ButItFailed, NO_ACC_CALC_CHECK_LOCK_ON
|
||||||
swapstatstages STAT_SPEED
|
swapstats STAT_SPEED
|
||||||
attackanimation
|
attackanimation
|
||||||
waitanimation
|
waitanimation
|
||||||
printstring STRINGID_PKMNSWITCHEDSTATCHANGES
|
printstring STRINGID_ATTACKERSWITCHEDSTATWITHTARGET
|
||||||
waitmessage B_WAIT_TIME_LONG
|
waitmessage B_WAIT_TIME_LONG
|
||||||
goto BattleScript_MoveEnd
|
goto BattleScript_MoveEnd
|
||||||
|
|
||||||
|
@ -246,6 +246,7 @@
|
|||||||
#define VARIOUS_CAN_TELEPORT 155
|
#define VARIOUS_CAN_TELEPORT 155
|
||||||
#define VARIOUS_GET_BATTLER_SIDE 156
|
#define VARIOUS_GET_BATTLER_SIDE 156
|
||||||
#define VARIOUS_CHECK_PARENTAL_BOND_COUNTER 157
|
#define VARIOUS_CHECK_PARENTAL_BOND_COUNTER 157
|
||||||
|
#define VARIOUS_SWAP_STATS 158
|
||||||
|
|
||||||
// Cmd_manipulatedamage
|
// Cmd_manipulatedamage
|
||||||
#define DMG_CHANGE_SIGN 0
|
#define DMG_CHANGE_SIGN 0
|
||||||
|
@ -631,8 +631,9 @@
|
|||||||
#define STRINGID_ATTACKERMELTEDTHEICE 629
|
#define STRINGID_ATTACKERMELTEDTHEICE 629
|
||||||
#define STRINGID_TARGETTOUGHEDITOUT 630
|
#define STRINGID_TARGETTOUGHEDITOUT 630
|
||||||
#define STRINGID_ATTACKERLOSTELECTRICTYPE 631
|
#define STRINGID_ATTACKERLOSTELECTRICTYPE 631
|
||||||
|
#define STRINGID_ATTACKERSWITCHEDSTATWITHTARGET 632
|
||||||
|
|
||||||
#define BATTLESTRINGS_COUNT 632
|
#define BATTLESTRINGS_COUNT 633
|
||||||
|
|
||||||
// This is the string id that gBattleStringsTable starts with.
|
// This is the string id that gBattleStringsTable starts with.
|
||||||
// String ids before this (e.g. STRINGID_INTROMSG) are not in the table,
|
// String ids before this (e.g. STRINGID_INTROMSG) are not in the table,
|
||||||
|
@ -760,9 +760,11 @@ static const u8 sText_AttackerHealedItsBurn[] = _("{B_ATK_NAME_WITH_PREFIX} heal
|
|||||||
static const u8 sText_AttackerMeltedTheIce[] = _("{B_ATK_NAME_WITH_PREFIX} melted the ice with\nits fiery determination!");
|
static const u8 sText_AttackerMeltedTheIce[] = _("{B_ATK_NAME_WITH_PREFIX} melted the ice with\nits fiery determination!");
|
||||||
static const u8 sText_TargetToughedItOut[] = _("{B_DEF_NAME_WITH_PREFIX} toughed it out\nto show you its best side!");
|
static const u8 sText_TargetToughedItOut[] = _("{B_DEF_NAME_WITH_PREFIX} toughed it out\nto show you its best side!");
|
||||||
static const u8 sText_AttackerLostElectricType[] = _("{B_ATK_NAME_WITH_PREFIX} used up all\nof its electricity!");
|
static const u8 sText_AttackerLostElectricType[] = _("{B_ATK_NAME_WITH_PREFIX} used up all\nof its electricity!");
|
||||||
|
static const u8 sText_AttackerSwitchedStatWithTarget[] = _("{B_ATK_NAME_WITH_PREFIX} switched {B_BUFF1}\nwith its target!");
|
||||||
|
|
||||||
const u8 *const gBattleStringsTable[BATTLESTRINGS_COUNT] =
|
const u8 *const gBattleStringsTable[BATTLESTRINGS_COUNT] =
|
||||||
{
|
{
|
||||||
|
[STRINGID_ATTACKERSWITCHEDSTATWITHTARGET - BATTLESTRINGS_TABLE_START] = sText_AttackerSwitchedStatWithTarget,
|
||||||
[STRINGID_TARGETTOUGHEDITOUT - BATTLESTRINGS_TABLE_START] = sText_TargetToughedItOut,
|
[STRINGID_TARGETTOUGHEDITOUT - BATTLESTRINGS_TABLE_START] = sText_TargetToughedItOut,
|
||||||
[STRINGID_ATTACKERMELTEDTHEICE - BATTLESTRINGS_TABLE_START] = sText_AttackerMeltedTheIce,
|
[STRINGID_ATTACKERMELTEDTHEICE - BATTLESTRINGS_TABLE_START] = sText_AttackerMeltedTheIce,
|
||||||
[STRINGID_ATTACKERHEALEDITSBURN - BATTLESTRINGS_TABLE_START] = sText_AttackerHealedItsBurn,
|
[STRINGID_ATTACKERHEALEDITSBURN - BATTLESTRINGS_TABLE_START] = sText_AttackerHealedItsBurn,
|
||||||
|
@ -10073,6 +10073,42 @@ static void Cmd_various(void)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case VARIOUS_SWAP_STATS:
|
||||||
|
{
|
||||||
|
u8 statId = T1_READ_8(gBattlescriptCurrInstr + 3);
|
||||||
|
u16 temp;
|
||||||
|
|
||||||
|
switch (statId)
|
||||||
|
{
|
||||||
|
case STAT_HP:
|
||||||
|
SWAP(gBattleMons[gBattlerAttacker].hp, gBattleMons[gBattlerTarget].hp, temp);
|
||||||
|
PREPARE_STAT_BUFFER(gBattleTextBuff1, statId);
|
||||||
|
break;
|
||||||
|
case STAT_ATK:
|
||||||
|
SWAP(gBattleMons[gBattlerAttacker].attack, gBattleMons[gBattlerTarget].attack, temp);
|
||||||
|
PREPARE_STAT_BUFFER(gBattleTextBuff1, statId);
|
||||||
|
break;
|
||||||
|
case STAT_DEF:
|
||||||
|
SWAP(gBattleMons[gBattlerAttacker].defense, gBattleMons[gBattlerTarget].defense, temp);
|
||||||
|
PREPARE_STAT_BUFFER(gBattleTextBuff1, statId);
|
||||||
|
break;
|
||||||
|
case STAT_SPEED:
|
||||||
|
SWAP(gBattleMons[gBattlerAttacker].speed, gBattleMons[gBattlerTarget].speed, temp);
|
||||||
|
PREPARE_STAT_BUFFER(gBattleTextBuff1, statId);
|
||||||
|
break;
|
||||||
|
case STAT_SPATK:
|
||||||
|
SWAP(gBattleMons[gBattlerAttacker].spAttack, gBattleMons[gBattlerTarget].spAttack, temp);
|
||||||
|
PREPARE_STAT_BUFFER(gBattleTextBuff1, statId);
|
||||||
|
break;
|
||||||
|
case STAT_SPDEF:
|
||||||
|
SWAP(gBattleMons[gBattlerAttacker].spDefense, gBattleMons[gBattlerTarget].spDefense, temp);
|
||||||
|
PREPARE_STAT_BUFFER(gBattleTextBuff1, statId);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
} // End of switch (gBattlescriptCurrInstr[2])
|
} // End of switch (gBattlescriptCurrInstr[2])
|
||||||
|
|
||||||
gBattlescriptCurrInstr += 3;
|
gBattlescriptCurrInstr += 3;
|
||||||
|
Loading…
Reference in New Issue
Block a user