mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2024-12-26 11:44:17 +01:00
Document a bit of atk47
This commit is contained in:
parent
68145cd002
commit
9febcd3a0a
@ -623,8 +623,8 @@ _080AA186:
|
||||
bx r0
|
||||
thumb_func_end sub_80AA124
|
||||
|
||||
thumb_func_start sub_80AA18C
|
||||
sub_80AA18C: @ 80AA18C
|
||||
thumb_func_start AnimTask_StatsChange
|
||||
AnimTask_StatsChange: @ 80AA18C
|
||||
push {r4,r5,lr}
|
||||
lsls r0, 24
|
||||
lsrs r4, r0, 24
|
||||
@ -853,7 +853,7 @@ _080AA352:
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_80AA18C
|
||||
thumb_func_end AnimTask_StatsChange
|
||||
|
||||
thumb_func_start LaunchStatusAnimation
|
||||
LaunchStatusAnimation: @ 80AA364
|
||||
|
@ -10484,7 +10484,7 @@ AnimScript_82D7ECA:
|
||||
end
|
||||
|
||||
Anim_StatChange:
|
||||
createvisualtask sub_80AA18C, 0x5
|
||||
createvisualtask AnimTask_StatsChange, 0x5
|
||||
waitforvisualfinish
|
||||
end
|
||||
|
||||
|
@ -568,10 +568,11 @@ struct BattleStruct
|
||||
}
|
||||
|
||||
#define GET_STAT_BUFF_ID(n)((n & 0xF)) // first four bits 0x1, 0x2, 0x4, 0x8
|
||||
#define GET_STAT_BUFF_VALUE2(n)((n & 0xF0))
|
||||
#define GET_STAT_BUFF_VALUE(n)(((n >> 4) & 7)) // 0x10, 0x20, 0x40
|
||||
#define STAT_BUFF_NEGATIVE 0x80 // 0x80, the sign bit
|
||||
|
||||
#define SET_STAT_BUFF_VALUE(n)(((s8)(((s8)(n) << 4)) & 0xF0))
|
||||
#define SET_STAT_BUFF_VALUE(n)((((n) << 4) & 0xF0))
|
||||
|
||||
#define SET_STATCHANGER(statId, stage, goesDown)(gBattleScripting.statChanger = (statId) + (stage << 4) + (goesDown << 7))
|
||||
|
||||
|
@ -4378,22 +4378,22 @@ static void atk46_playanimation2(void) // animation Id is stored in the first po
|
||||
static void atk47_setgraphicalstatchangevalues(void)
|
||||
{
|
||||
u8 value = 0;
|
||||
switch (gBattleScripting.statChanger & 0xF0)
|
||||
switch (GET_STAT_BUFF_VALUE2(gBattleScripting.statChanger))
|
||||
{
|
||||
case 0x10: // +1
|
||||
case SET_STAT_BUFF_VALUE(1): // +1
|
||||
value = 0xF;
|
||||
break;
|
||||
case 0x20: // +2
|
||||
case SET_STAT_BUFF_VALUE(2): // +2
|
||||
value = 0x27;
|
||||
break;
|
||||
case 0x90: // -1
|
||||
case SET_STAT_BUFF_VALUE(1) | STAT_BUFF_NEGATIVE: // -1
|
||||
value = 0x16;
|
||||
break;
|
||||
case 0xA0: // -2
|
||||
case SET_STAT_BUFF_VALUE(2) | STAT_BUFF_NEGATIVE: // -2
|
||||
value = 0x2E;
|
||||
break;
|
||||
}
|
||||
gBattleScripting.animArg1 = (gBattleScripting.statChanger & 0xF) + value - 1;
|
||||
gBattleScripting.animArg1 = GET_STAT_BUFF_ID(gBattleScripting.statChanger) + value - 1;
|
||||
gBattleScripting.animArg2 = 0;
|
||||
gBattlescriptCurrInstr++;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user