battle 4 up to SetMoveEffect

This commit is contained in:
DizzyEggg 2017-09-20 12:56:45 +02:00
parent b4875d82d5
commit 28da80e19a
10 changed files with 410 additions and 1034 deletions

View File

@ -6510,7 +6510,7 @@ _0803A0AE:
ldr r0, [r0, 0xC] ldr r0, [r0, 0xC]
adds r0, 0x20 adds r0, 0x20
strb r2, [r0] strb r2, [r0]
ldr r5, =gUnknown_0202432C ldr r5, =gPauseCounterBattle
ldr r6, =gBattleMoveDamage ldr r6, =gBattleMoveDamage
ldr r7, =gUnknown_020243FC ldr r7, =gUnknown_020243FC
ldr r0, =gUnknown_03005D54 ldr r0, =gUnknown_03005D54
@ -14058,14 +14058,14 @@ _0803E480:
cmp r0, 0x1F cmp r0, 0x1F
bne _0803E4CE bne _0803E4CE
adds r0, r2, 0 adds r0, r2, 0
bl sub_8048728 bl BankGetTurnOrder
lsls r0, 24 lsls r0, 24
lsrs r0, 24 lsrs r0, 24
ldr r3, [sp] ldr r3, [sp]
cmp r0, r3 cmp r0, r3
bcs _0803E4CE bcs _0803E4CE
ldrb r0, [r4] ldrb r0, [r4]
bl sub_8048728 bl BankGetTurnOrder
lsls r0, 24 lsls r0, 24
lsrs r0, 24 lsrs r0, 24
str r0, [sp] str r0, [sp]

File diff suppressed because it is too large Load Diff

View File

@ -2687,8 +2687,8 @@ _08033C88:
.pool .pool
thumb_func_end dp01_build_cmdbuf_x10_TODO thumb_func_end dp01_build_cmdbuf_x10_TODO
thumb_func_start dp01_build_cmdbuf_x11_TODO thumb_func_start EmitPrintStringPlayerOnly
dp01_build_cmdbuf_x11_TODO: @ 8033CFC EmitPrintStringPlayerOnly: @ 8033CFC
push {r4-r7,lr} push {r4-r7,lr}
mov r7, r10 mov r7, r10
mov r6, r9 mov r6, r9
@ -2784,7 +2784,7 @@ _08033D7C:
pop {r0} pop {r0}
bx r0 bx r0
.pool .pool
thumb_func_end dp01_build_cmdbuf_x11_TODO thumb_func_end EmitPrintStringPlayerOnly
thumb_func_start dp01_build_cmdbuf_x12_a_bb thumb_func_start dp01_build_cmdbuf_x12_a_bb
dp01_build_cmdbuf_x12_a_bb: @ 8033DE4 dp01_build_cmdbuf_x12_a_bb: @ 8033DE4
@ -3467,8 +3467,8 @@ dp01_build_cmdbuf_x2A_2A_2A_2A: @ 80342B4
.pool .pool
thumb_func_end dp01_build_cmdbuf_x2A_2A_2A_2A thumb_func_end dp01_build_cmdbuf_x2A_2A_2A_2A
thumb_func_start dp01_build_cmdbuf_x2B_aa_0 thumb_func_start EmitEffectivenessSound
dp01_build_cmdbuf_x2B_aa_0: @ 80342D4 EmitEffectivenessSound: @ 80342D4
push {r4,lr} push {r4,lr}
lsls r0, 24 lsls r0, 24
lsrs r0, 24 lsrs r0, 24
@ -3489,7 +3489,7 @@ dp01_build_cmdbuf_x2B_aa_0: @ 80342D4
pop {r0} pop {r0}
bx r0 bx r0
.pool .pool
thumb_func_end dp01_build_cmdbuf_x2B_aa_0 thumb_func_end EmitEffectivenessSound
thumb_func_start sub_8034300 thumb_func_start sub_8034300
sub_8034300: @ 8034300 sub_8034300: @ 8034300

View File

@ -596,7 +596,7 @@ gUnknown_085CC23E:: @ 85CC23E
gUnknown_085CC270:: @ 85CC270 gUnknown_085CC270:: @ 85CC270
.incbin "baserom.gba", 0x5cc270, 0x5c4 .incbin "baserom.gba", 0x5cc270, 0x5c4
gUnknown_085CC834:: @ 85CC834 gMissStringIds:: @ 85CC834
.incbin "baserom.gba", 0x5cc834, 0x14e .incbin "baserom.gba", 0x5cc834, 0x14e
gUnknown_085CC982:: @ 85CC982 gUnknown_085CC982:: @ 85CC982

View File

@ -246,10 +246,10 @@ BattleScript_MagicCoatBounce:: @ 82DB194
BattleScript_SnatchedMove:: @ 82DB1AC BattleScript_SnatchedMove:: @ 82DB1AC
.incbin "baserom.gba", 0x2db1ac, 0x1b .incbin "baserom.gba", 0x2db1ac, 0x1b
gUnknown_082DB1C7:: @ 82DB1C7 BattleScript_EnduredMsg:: @ 82DB1C7
.incbin "baserom.gba", 0x2db1c7, 0x7 .incbin "baserom.gba", 0x2db1c7, 0x7
gUnknown_082DB1CE:: @ 82DB1CE BattleScript_OneHitKOMsg:: @ 82DB1CE
.incbin "baserom.gba", 0x2db1ce, 0x7 .incbin "baserom.gba", 0x2db1ce, 0x7
gUnknown_082DB1D5:: @ 82DB1D5 gUnknown_082DB1D5:: @ 82DB1D5
@ -450,7 +450,7 @@ gUnknown_082DB6D9:: @ 82DB6D9
gUnknown_082DB6F0:: @ 82DB6F0 gUnknown_082DB6F0:: @ 82DB6F0
.incbin "baserom.gba", 0x2db6f0, 0xb .incbin "baserom.gba", 0x2db6f0, 0xb
gUnknown_082DB6FB:: @ 82DB6FB BattleScript_SubstituteFade:: @ 82DB6FB
.incbin "baserom.gba", 0x2db6fb, 0xb .incbin "baserom.gba", 0x2db6fb, 0xb
BattleScript_BerryCurePrlzEnd2:: @ 82DB706 BattleScript_BerryCurePrlzEnd2:: @ 82DB706
@ -516,7 +516,7 @@ BattleScript_ItemHealHP_Ret:: @ 82DB7F7
gUnknown_082DB812:: @ 82DB812 gUnknown_082DB812:: @ 82DB812
.incbin "baserom.gba", 0x2db812, 0x4 .incbin "baserom.gba", 0x2db812, 0x4
gUnknown_082DB816:: @ 82DB816 BattleScript_HangedOnMsg:: @ 82DB816
.incbin "baserom.gba", 0x2db816, 0xe .incbin "baserom.gba", 0x2db816, 0xe
BattleScript_BerryConfuseHealEnd2:: @ 82DB824 BattleScript_BerryConfuseHealEnd2:: @ 82DB824

View File

@ -729,6 +729,7 @@ u8 IsPokeDisobedient(void);
void AI_CalcDmg(u8 bankAtk, u8 bankDef); void AI_CalcDmg(u8 bankAtk, u8 bankDef);
u8 TypeCalc(u16 move, u8 bankAtk, u8 bankDef); u8 TypeCalc(u16 move, u8 bankAtk, u8 bankDef);
u8 AI_TypeCalc(u16 move, u16 species, u8 ability); u8 AI_TypeCalc(u16 move, u16 species, u8 ability);
u8 BankGetTurnOrder(u8 bank);
// rom_80A5C6C // rom_80A5C6C
u8 GetBankSide(u8 bank); u8 GetBankSide(u8 bank);

View File

@ -5,6 +5,8 @@
void EmitSetAttributes(u8 bufferId, u8 request, u8 c, u8 bytes, void *data); void EmitSetAttributes(u8 bufferId, u8 request, u8 c, u8 bytes, void *data);
void EmitMoveAnimation(u8 bufferId, u16 move, u8 turnOfMove, u16 movePower, s32 dmg, u8 friendship, struct DisableStruct* disableStructPtr, u8 multihit); void EmitMoveAnimation(u8 bufferId, u16 move, u8 turnOfMove, u16 movePower, s32 dmg, u8 friendship, struct DisableStruct* disableStructPtr, u8 multihit);
void EmitHealthBarUpdate(u8 bufferId, u16 hpValue); void EmitHealthBarUpdate(u8 bufferId, u16 hpValue);
void EmitEffectivenessSound(u8 bufferId, u16 songId);
void EmitPrintStringPlayerOnly(u8 bufferId, u16 stringId);
void MarkBufferBankForExecution(u8 bank); void MarkBufferBankForExecution(u8 bank);

View File

@ -15,8 +15,8 @@ enum
/*0x09*/ SE_KAIDAN, /*0x09*/ SE_KAIDAN,
/*0x0A*/ SE_DANSA, /*0x0A*/ SE_DANSA,
/*0x0B*/ SE_JITENSYA, /*0x0B*/ SE_JITENSYA,
/*0x0C*/ SE_KOUKA_L, /*0x0C*/ SE_KOUKA_L, // Goggle told me Kouka means 'effectiveness' which makes sense, because
/*0x0D*/ SE_KOUKA_M, /*0x0D*/ SE_KOUKA_M, // those three sounds play whenever you use a move
/*0x0E*/ SE_KOUKA_H, /*0x0E*/ SE_KOUKA_H,
/*0x0F*/ SE_BOWA2, /*0x0F*/ SE_BOWA2,
/*0x10*/ SE_POKE_DEAD, /*0x10*/ SE_POKE_DEAD,

View File

@ -14,6 +14,7 @@
#include "rng.h" #include "rng.h"
#include "battle_controllers.h" #include "battle_controllers.h"
#include "species.h" #include "species.h"
#include "songs.h"
// variables // variables
@ -58,7 +59,7 @@ extern u8 gStringBank;
extern u16 gDynamicBasePower; extern u16 gDynamicBasePower;
extern u16 gLastUsedItem; extern u16 gLastUsedItem;
extern u16 gBattleMovePower; extern u16 gBattleMovePower;
extern s32 gHP_dealt; extern s32 gHpDealt;
extern s32 gTakenDmg[BATTLE_BANKS_COUNT]; extern s32 gTakenDmg[BATTLE_BANKS_COUNT];
extern u8 gTakenDmgBanks[BATTLE_BANKS_COUNT]; extern u8 gTakenDmgBanks[BATTLE_BANKS_COUNT];
extern u8 gSentPokesToOpponent[2]; extern u8 gSentPokesToOpponent[2];
@ -75,7 +76,7 @@ extern u8 gCurrentMoveTurn;
extern u8 gBattleBufferB[4][0x200]; extern u8 gBattleBufferB[4][0x200];
extern const struct BattleMove gBattleMoves[]; extern const struct BattleMove gBattleMoves[];
extern const u16 gMissStrings[]; extern const u16 gMissStringIds[];
extern const u8 gTrainerMoney[]; extern const u8 gTrainerMoney[];
extern const u8 gTypeEffectiveness[]; extern const u8 gTypeEffectiveness[];
extern const struct BaseStats gBaseStats[]; extern const struct BaseStats gBaseStats[];
@ -1630,31 +1631,395 @@ void atk0A_waitanimation(void)
void atk0B_healthbarupdate(void) void atk0B_healthbarupdate(void)
{ {
register s16 healthValue asm("r1"); if (gBattleExecBuffer)
return;
if (!(gBattleMoveFlags & MOVESTATUS_NOEFFECT))
{
gActiveBank = GetBattleBank(BSScriptRead8(gBattlescriptCurrInstr + 1));
if (gBattleMons[gActiveBank].status2 & STATUS2_SUBSTITUTE && gDisableStructs[gActiveBank].substituteHP && !(gHitMarker & HITMARKER_IGNORE_SUBSTITUTE))
{
PrepareStringBattle(0x80, gActiveBank);
}
else
{
s16 healthValue;
s32 currDmg = gBattleMoveDamage;
s32 maxPossibleDmgValue = 10000; // not present in R/S, ensures that huge damage values don't change sign
if (currDmg <= maxPossibleDmgValue)
healthValue = currDmg;
else
healthValue = maxPossibleDmgValue;
EmitHealthBarUpdate(0, healthValue);
MarkBufferBankForExecution(gActiveBank);
if (GetBankSide(gActiveBank) == SIDE_PLAYER && gBattleMoveDamage > 0)
gBattleResults.unk5_0 = 1;
}
}
gBattlescriptCurrInstr += 2;
}
void atk0C_datahpupdate(void)
{
u32 moveType;
if (gBattleExecBuffer) if (gBattleExecBuffer)
return; return;
if (gBattleMoveFlags & MOVESTATUS_NOEFFECT)
goto END;
gActiveBank = GetBattleBank(BSScriptRead8(gBattlescriptCurrInstr + 1)); if (gBattleStruct->dynamicMoveType == 0)
moveType = gBattleMoves[gCurrentMove].type;
else if (!(gBattleStruct->dynamicMoveType & 0x40))
moveType = gBattleStruct->dynamicMoveType & 0x3F;
else
moveType = gBattleMoves[gCurrentMove].type;
if (gBattleMons[gActiveBank].status2 & STATUS2_SUBSTITUTE && gDisableStructs[gActiveBank].substituteHP && !(gHitMarker & HITMARKER_IGNORE_SUBSTITUTE)) if (!(gBattleMoveFlags & MOVESTATUS_NOEFFECT))
{ {
PrepareStringBattle(0x80, gActiveBank); gActiveBank = GetBattleBank(BSScriptRead8(gBattlescriptCurrInstr + 1));
goto END; if (gBattleMons[gActiveBank].status2 & STATUS2_SUBSTITUTE && gDisableStructs[gActiveBank].substituteHP && !(gHitMarker & HITMARKER_IGNORE_SUBSTITUTE))
{
if (gDisableStructs[gActiveBank].substituteHP >= gBattleMoveDamage)
{
if (gSpecialStatuses[gActiveBank].moveturnLostHP == 0)
gSpecialStatuses[gActiveBank].moveturnLostHP = gBattleMoveDamage;
gDisableStructs[gActiveBank].substituteHP -= gBattleMoveDamage;
gHpDealt = gBattleMoveDamage;
}
else
{
if (gSpecialStatuses[gActiveBank].moveturnLostHP == 0)
gSpecialStatuses[gActiveBank].moveturnLostHP = gDisableStructs[gActiveBank].substituteHP;
gHpDealt = gDisableStructs[gActiveBank].substituteHP;
gDisableStructs[gActiveBank].substituteHP = 0;
}
// check substitute fading
if (gDisableStructs[gActiveBank].substituteHP == 0)
{
gBattlescriptCurrInstr += 2;
b_movescr_stack_push_cursor();
gBattlescriptCurrInstr = BattleScript_SubstituteFade;
return;
}
}
else
{
gHitMarker &= ~(HITMARKER_IGNORE_SUBSTITUTE);
if (gBattleMoveDamage < 0) // hp goes up
{
gBattleMons[gActiveBank].hp -= gBattleMoveDamage;
if (gBattleMons[gActiveBank].hp > gBattleMons[gActiveBank].maxHP)
gBattleMons[gActiveBank].hp = gBattleMons[gActiveBank].maxHP;
}
else // hp goes down
{
if (gHitMarker & HITMARKER_x20)
{
gHitMarker &= ~(HITMARKER_x20);
}
else
{
gTakenDmg[gActiveBank] += gBattleMoveDamage;
if (BSScriptRead8(gBattlescriptCurrInstr + 1) == BS_GET_TARGET)
gTakenDmgBanks[gActiveBank] = gBankAttacker;
else
gTakenDmgBanks[gActiveBank] = gBankTarget;
}
if (gBattleMons[gActiveBank].hp > gBattleMoveDamage)
{
gBattleMons[gActiveBank].hp -= gBattleMoveDamage;
gHpDealt = gBattleMoveDamage;
}
else
{
gHpDealt = gBattleMons[gActiveBank].hp;
gBattleMons[gActiveBank].hp = 0;
}
if (!gSpecialStatuses[gActiveBank].moveturnLostHP && !(gHitMarker & HITMARKER_x100000))
gSpecialStatuses[gActiveBank].moveturnLostHP = gHpDealt;
if (moveType <= 8 && !(gHitMarker & HITMARKER_x100000) && gCurrentMove != MOVE_PAIN_SPLIT)
{
gProtectStructs[gActiveBank].physicalDmg = gHpDealt;
gSpecialStatuses[gActiveBank].moveturnLostHP_physical = gHpDealt;
if (BSScriptRead8(gBattlescriptCurrInstr + 1) == BS_GET_TARGET)
{
gProtectStructs[gActiveBank].physicalBank = gBankAttacker;
gSpecialStatuses[gActiveBank].moveturnPhysicalBank = gBankAttacker;
}
else
{
gProtectStructs[gActiveBank].physicalBank = gBankTarget;
gSpecialStatuses[gActiveBank].moveturnPhysicalBank = gBankTarget;
}
}
else if (moveType > 8 && !(gHitMarker & HITMARKER_x100000))
{
gProtectStructs[gActiveBank].specialDmg = gHpDealt;
gSpecialStatuses[gActiveBank].moveturnLostHP_special = gHpDealt;
if (BSScriptRead8(gBattlescriptCurrInstr + 1) == BS_GET_TARGET)
{
gProtectStructs[gActiveBank].specialBank = gBankAttacker;
gSpecialStatuses[gActiveBank].moveturnSpecialBank = gBankAttacker;
}
else
{
gProtectStructs[gActiveBank].specialBank = gBankTarget;
gSpecialStatuses[gActiveBank].moveturnSpecialBank = gBankTarget;
}
}
}
gHitMarker &= ~(HITMARKER_x100000);
EmitSetAttributes(0, REQUEST_HP_BATTLE, 0, 2, &gBattleMons[gActiveBank].hp);
MarkBufferBankForExecution(gActiveBank);
}
}
else
{
gActiveBank = GetBattleBank(BSScriptRead8(gBattlescriptCurrInstr + 1));
if (gSpecialStatuses[gActiveBank].moveturnLostHP == 0)
gSpecialStatuses[gActiveBank].moveturnLostHP = 0xFFFF;
}
gBattlescriptCurrInstr += 2;
}
void atk0D_critmessage(void)
{
if (gBattleExecBuffer == 0)
{
if (gCritMultiplier == 2 && !(gBattleMoveFlags & MOVESTATUS_NOEFFECT))
{
PrepareStringBattle(0xD9, gBankAttacker);
gBattleCommunication[MSG_DISPLAY] = 1;
}
gBattlescriptCurrInstr++;
}
}
void atk0E_effectiveness_sound(void)
{
if (gBattleExecBuffer)
return;
gActiveBank = gBankTarget;
if (!(gBattleMoveFlags & MOVESTATUS_MISSED))
{
switch (gBattleMoveFlags & (u8)(~(MOVESTATUS_MISSED)))
{
case MOVESTATUS_SUPEREFFECTIVE:
EmitEffectivenessSound(0, SE_KOUKA_H);
MarkBufferBankForExecution(gActiveBank);
break;
case MOVESTATUS_NOTVERYEFFECTIVE:
EmitEffectivenessSound(0, SE_KOUKA_L);
MarkBufferBankForExecution(gActiveBank);
break;
case MOVESTATUS_NOTAFFECTED:
case MOVESTATUS_FAILED:
// no sound
break;
case MOVESTATUS_ENDURED:
case MOVESTATUS_ONEHITKO:
case MOVESTATUS_HUNGON:
default:
if (gBattleMoveFlags & MOVESTATUS_SUPEREFFECTIVE)
{
EmitEffectivenessSound(0, SE_KOUKA_H);
MarkBufferBankForExecution(gActiveBank);
}
else if (gBattleMoveFlags & MOVESTATUS_NOTVERYEFFECTIVE)
{
EmitEffectivenessSound(0, SE_KOUKA_L);
MarkBufferBankForExecution(gActiveBank);
}
else if (!(gBattleMoveFlags & (MOVESTATUS_NOTAFFECTED | MOVESTATUS_FAILED)))
{
EmitEffectivenessSound(0, SE_KOUKA_M);
MarkBufferBankForExecution(gActiveBank);
}
break;
}
}
gBattlescriptCurrInstr++;
}
void atk0F_resultmessage(void)
{
u32 stringId = 0;
if (gBattleExecBuffer)
return;
if (gBattleMoveFlags & MOVESTATUS_MISSED && (!(gBattleMoveFlags & MOVESTATUS_NOTAFFECTED) || gBattleCommunication[6] > 2))
{
stringId = gMissStringIds[gBattleCommunication[6]];
gBattleCommunication[MSG_DISPLAY] = 1;
}
else
{
gBattleCommunication[MSG_DISPLAY] = 1;
switch (gBattleMoveFlags & (u8)(~(MOVESTATUS_MISSED)))
{
case MOVESTATUS_SUPEREFFECTIVE:
stringId = 0xDE;
break;
case MOVESTATUS_NOTVERYEFFECTIVE:
stringId = 0xDD;
break;
case MOVESTATUS_ONEHITKO:
stringId = 0xDA;
break;
case MOVESTATUS_ENDURED:
stringId = 0x99;
break;
case MOVESTATUS_FAILED:
stringId = 0xE5;
break;
case MOVESTATUS_NOTAFFECTED:
stringId = 0x1B;
break;
case MOVESTATUS_HUNGON:
gLastUsedItem = gBattleMons[gBankTarget].item;
gStringBank = gBankTarget;
gBattleMoveFlags &= ~(MOVESTATUS_ENDURED | MOVESTATUS_HUNGON);
b_movescr_stack_push_cursor();
gBattlescriptCurrInstr = BattleScript_HangedOnMsg;
return;
default:
if (gBattleMoveFlags & MOVESTATUS_NOTAFFECTED)
{
stringId = 0x1B;
}
else if (gBattleMoveFlags & MOVESTATUS_ONEHITKO)
{
gBattleMoveFlags &= ~(MOVESTATUS_ONEHITKO);
gBattleMoveFlags &= ~(MOVESTATUS_SUPEREFFECTIVE);
gBattleMoveFlags &= ~(MOVESTATUS_NOTVERYEFFECTIVE);
b_movescr_stack_push_cursor();
gBattlescriptCurrInstr = BattleScript_OneHitKOMsg;
return;
}
else if (gBattleMoveFlags & MOVESTATUS_ENDURED)
{
gBattleMoveFlags &= ~(MOVESTATUS_ENDURED | MOVESTATUS_HUNGON);
b_movescr_stack_push_cursor();
gBattlescriptCurrInstr = BattleScript_EnduredMsg;
return;
}
else if (gBattleMoveFlags & MOVESTATUS_HUNGON)
{
gLastUsedItem = gBattleMons[gBankTarget].item;
gStringBank = gBankTarget;
gBattleMoveFlags &= ~(MOVESTATUS_ENDURED | MOVESTATUS_HUNGON);
b_movescr_stack_push_cursor();
gBattlescriptCurrInstr = BattleScript_HangedOnMsg;
return;
}
else if (gBattleMoveFlags & MOVESTATUS_FAILED)
{
stringId = 0xE5;
}
else
{
gBattleCommunication[MSG_DISPLAY] = 0;
}
}
} }
healthValue = 10000; if (stringId)
if (healthValue <= gBattleMoveDamage) PrepareStringBattle(stringId, gBankAttacker);
healthValue = gBattleMoveDamage;
EmitHealthBarUpdate(0, healthValue); gBattlescriptCurrInstr++;
}
void atk10_printstring(void)
{
if (gBattleExecBuffer == 0)
{
u16 var = BS2ScriptRead16(gBattlescriptCurrInstr + 1);
PrepareStringBattle(var, gBankAttacker);
gBattlescriptCurrInstr += 3;
gBattleCommunication[MSG_DISPLAY] = 1;
}
}
void atk11_printstring_playeronly(void)
{
gActiveBank = gBankAttacker;
EmitPrintStringPlayerOnly(0, BS2ScriptRead16(gBattlescriptCurrInstr + 1));
MarkBufferBankForExecution(gActiveBank); MarkBufferBankForExecution(gActiveBank);
if (GetBankSide(gActiveBank) == SIDE_PLAYER && gBattleMoveDamage > 0) gBattlescriptCurrInstr += 3;
gBattleResults.unk5_0 = 1; gBattleCommunication[MSG_DISPLAY] = 1;
}
END:
gBattlescriptCurrInstr += 2; void atk12_waitmessage(void)
{
if (gBattleExecBuffer == 0)
{
if (!gBattleCommunication[MSG_DISPLAY])
{
gBattlescriptCurrInstr += 3;
}
else
{
u16 toWait = BS2ScriptRead16(gBattlescriptCurrInstr + 1);
if (++gPauseCounterBattle >= toWait)
{
gPauseCounterBattle = 0;
gBattlescriptCurrInstr += 3;
gBattleCommunication[MSG_DISPLAY] = 0;
}
}
}
}
void atk13_printfromtable(void)
{
if (gBattleExecBuffer == 0)
{
u16 *ptr = BSScriptReadPtr(gBattlescriptCurrInstr + 1);
ptr += gBattleCommunication[MULTISTRING_CHOOSER];
PrepareStringBattle(*(u16*)ptr, gBankAttacker);
gBattlescriptCurrInstr += 5;
gBattleCommunication[MSG_DISPLAY] = 1;
}
}
void atk14_printfromtable_playeronly(void)
{
if (gBattleExecBuffer == 0)
{
u16 *ptr = BSScriptReadPtr(gBattlescriptCurrInstr + 1);
ptr += gBattleCommunication[MULTISTRING_CHOOSER];
gActiveBank = gBankAttacker;
EmitPrintStringPlayerOnly(0, *(u16*)ptr);
MarkBufferBankForExecution(gActiveBank);
gBattlescriptCurrInstr += 5;
gBattleCommunication[MSG_DISPLAY] = 1;
}
}
u8 BankGetTurnOrder(u8 bank)
{
s32 i;
for (i = 0; i < gNoOfAllBanks; i++)
{
if (gTurnOrder[i] == bank)
break;
}
return i;
} }

View File

@ -343,7 +343,7 @@ gRandomMove: @ 20241EE
gBattleMoveDamage: @ 20241F0 gBattleMoveDamage: @ 20241F0
.space 0x4 .space 0x4
gUnknown_020241F4: @ 20241F4 gHpDealt: @ 20241F4
.space 0x4 .space 0x4
gTakenDmg: @ 20241F8 gTakenDmg: @ 20241F8
@ -442,7 +442,7 @@ gStatuses3: @ 20242AC
gDisableStructs: @ 20242BC gDisableStructs: @ 20242BC
.space 0x70 .space 0x70
gUnknown_0202432C: @ 202432C gPauseCounterBattle: @ 202432C
.space 0x2 .space 0x2
gUnknown_0202432E: @ 202432E gUnknown_0202432E: @ 202432E