mirror of
https://github.com/pret/pokeheartgold.git
synced 2026-10-26 04:39:47 -05:00
Fix function name, more documentation
This commit is contained in:
@@ -126,11 +126,11 @@
|
||||
.public ov12_02252EC8
|
||||
.public ov12_02253068
|
||||
.public DamageDivide
|
||||
.public ov12_02253194
|
||||
.public TryAbilityOnEntry
|
||||
.public ov12_02253DA0
|
||||
.public CheckAbilityEffectOnHit
|
||||
.public CheckStatusHealAbility
|
||||
.public CheckNaturalCureOnSwitch
|
||||
.public CheckStatusHealSwitch
|
||||
.public ov12_02254580
|
||||
.public ov12_0225471C
|
||||
.public ov12_02254D80
|
||||
|
||||
@@ -95,7 +95,7 @@
|
||||
.public ov12_02252EC8
|
||||
.public ov12_02253068
|
||||
.public DamageDivide
|
||||
.public ov12_02253194
|
||||
.public TryAbilityOnEntry
|
||||
.public ov12_02253DA0
|
||||
.public CheckAbilityEffectOnHit
|
||||
.public CheckStatusHealAbility
|
||||
|
||||
@@ -12,69 +12,6 @@
|
||||
.public ov12_02251C74
|
||||
.public CheckMoveEffectOnField
|
||||
|
||||
thumb_func_start CheckNaturalCureOnSwitch
|
||||
CheckNaturalCureOnSwitch: ; 0x0225451C
|
||||
mov r0, #0
|
||||
cmp r1, #0x28
|
||||
bgt _0225453C
|
||||
bge _02254572
|
||||
cmp r1, #7
|
||||
bgt _0225452C
|
||||
beq _02254554
|
||||
bx lr
|
||||
_0225452C:
|
||||
cmp r1, #0x11
|
||||
bgt _0225457A
|
||||
cmp r1, #0xf
|
||||
blt _0225457A
|
||||
beq _0225455E
|
||||
cmp r1, #0x11
|
||||
beq _0225454A
|
||||
bx lr
|
||||
_0225453C:
|
||||
cmp r1, #0x29
|
||||
bgt _02254544
|
||||
beq _02254568
|
||||
bx lr
|
||||
_02254544:
|
||||
cmp r1, #0x48
|
||||
beq _0225455E
|
||||
bx lr
|
||||
_0225454A:
|
||||
ldr r1, _0225457C ; =0x00000F88
|
||||
tst r1, r2
|
||||
beq _0225457A
|
||||
mov r0, #1
|
||||
bx lr
|
||||
_02254554:
|
||||
mov r1, #0x40
|
||||
tst r1, r2
|
||||
beq _0225457A
|
||||
mov r0, #1
|
||||
bx lr
|
||||
_0225455E:
|
||||
mov r1, #7
|
||||
tst r1, r2
|
||||
beq _0225457A
|
||||
mov r0, #1
|
||||
bx lr
|
||||
_02254568:
|
||||
mov r1, #0x10
|
||||
tst r1, r2
|
||||
beq _0225457A
|
||||
mov r0, #1
|
||||
bx lr
|
||||
_02254572:
|
||||
mov r1, #0x20
|
||||
tst r1, r2
|
||||
beq _0225457A
|
||||
mov r0, #1
|
||||
_0225457A:
|
||||
bx lr
|
||||
.balign 4, 0
|
||||
_0225457C: .word 0x00000F88
|
||||
thumb_func_end CheckNaturalCureOnSwitch
|
||||
|
||||
thumb_func_start ov12_02254580
|
||||
ov12_02254580: ; 0x02254580
|
||||
push {r3, r4, r5, r6, r7, lr}
|
||||
|
||||
@@ -9026,7 +9026,7 @@ _0224CD2E:
|
||||
_0224CD42:
|
||||
add r0, r6, #0
|
||||
add r1, r4, #0
|
||||
bl ov12_02253194
|
||||
bl TryAbilityOnEntry
|
||||
add r2, r0, #0
|
||||
beq _0224CD62
|
||||
add r0, r4, #0
|
||||
@@ -9861,7 +9861,7 @@ _0224D39E:
|
||||
beq _0224D440
|
||||
add r0, r5, #0
|
||||
add r1, r4, #0
|
||||
bl ov12_02253194
|
||||
bl TryAbilityOnEntry
|
||||
add r2, r0, #0
|
||||
beq _0224D3D6
|
||||
add r0, r4, #0
|
||||
|
||||
@@ -69,10 +69,11 @@ int GetBattlerLearnedMoveCount(BattleSystem *bsys, BATTLECONTEXT *ctx, int battl
|
||||
int ov12_02252EC8(BATTLECONTEXT *ctx, int battlerIdAttacker, int battlerIdTarget);
|
||||
BOOL ov12_02253068(BattleSystem *bsys, BATTLECONTEXT *ctx, int battlerId);
|
||||
int DamageDivide(int num, int denom);
|
||||
int ov12_02253194(BattleSystem *bsys, BATTLECONTEXT *ctx);
|
||||
int TryAbilityOnEntry(BattleSystem *bsys, BATTLECONTEXT *ctx);
|
||||
int ov12_02253DA0(BattleSystem *bsys, BATTLECONTEXT *ctx, int battlerId);
|
||||
BOOL CheckAbilityEffectOnHit(BattleSystem *bsys, BATTLECONTEXT *ctx, int *script);
|
||||
BOOL CheckStatusHealAbility(BattleSystem *bsys, BATTLECONTEXT *ctx, int battlerId, int flag);
|
||||
BOOL CheckStatusHealSwitch(BATTLECONTEXT *ctx, int ability, int status);
|
||||
|
||||
//The following functions are static, but the rest of the file is still being worked on
|
||||
BOOL ov12_02251C74(BATTLECONTEXT *ctx, int battlerIdAttacker, int battlerIdTarget, int index);
|
||||
@@ -97,7 +98,6 @@ void CheckIgnorePressure(BATTLECONTEXT *ctx, int battlerIdA, int battlerIdB);
|
||||
u8 ov12_0225682C(BATTLECONTEXT *ctx, int a1);
|
||||
BOOL CheckItemEffectOnHit(BattleSystem *bsys, BATTLECONTEXT *ctx, int *itemWork);
|
||||
int BattleSystem_GetHeldItemDamageBoost(BATTLECONTEXT *ctx, int battlerId, int a2);
|
||||
BOOL CheckNaturalCureOnSwitch(BATTLECONTEXT *ctx, int ability, int status);
|
||||
int ov12_02253DA0(BattleSystem *bsys, BATTLECONTEXT *ctx, int battlerId);
|
||||
BOOL CheckItemEffectOnUTurn(BattleSystem *bsys, BATTLECONTEXT *ctx, int *work);
|
||||
u32 BattleSystem_GetBattleType(BattleSystem *bsys);
|
||||
|
||||
@@ -5660,7 +5660,7 @@ BOOL BtlCmd_TryNaturalCure(BattleSystem *bsys, BATTLECONTEXT *ctx) {
|
||||
Pokemon *mon = BattleSystem_GetPartyMon(bsys, battlerId, ctx->selectedMonIndex[battlerId]);
|
||||
int ability = GetMonData(mon, MON_DATA_ABILITY, NULL);
|
||||
int status = GetMonData(mon, MON_DATA_STATUS, NULL);
|
||||
if (ctx->battleMons[battlerId].ability != ABILITY_NATURAL_CURE && !CheckNaturalCureOnSwitch(ctx, ability, status)) {
|
||||
if (ctx->battleMons[battlerId].ability != ABILITY_NATURAL_CURE && !CheckStatusHealSwitch(ctx, ability, status)) {
|
||||
BattleScriptIncrementPointer(ctx, adrs);
|
||||
}
|
||||
} else {
|
||||
|
||||
@@ -78,7 +78,7 @@ void BattleControllerPlayer_TrainerMessage(BattleSystem *bsys, BATTLECONTEXT *ct
|
||||
|
||||
//static
|
||||
void BattleControllerPlayer_PokemonAppear(BattleSystem *bsys, BATTLECONTEXT *ctx) {
|
||||
int script = ov12_02253194(bsys, ctx);
|
||||
int script = TryAbilityOnEntry(bsys, ctx);
|
||||
|
||||
if (script) {
|
||||
ReadBattleScriptFromNarc(ctx, NARC_a_0_0_1, script);
|
||||
|
||||
@@ -3439,7 +3439,7 @@ int DamageDivide(int num, int denom) {
|
||||
return num;
|
||||
}
|
||||
|
||||
int ov12_02253194(BattleSystem *bsys, BATTLECONTEXT *ctx) {
|
||||
int TryAbilityOnEntry(BattleSystem *bsys, BATTLECONTEXT *ctx) {
|
||||
int i;
|
||||
int j;
|
||||
int script;
|
||||
@@ -4116,3 +4116,38 @@ BOOL CheckStatusHealAbility(BattleSystem *bsys, BATTLECONTEXT *ctx, int battlerI
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
BOOL CheckStatusHealSwitch(BATTLECONTEXT *ctx, int ability, int status) {
|
||||
BOOL ret = FALSE;
|
||||
|
||||
switch (ability) {
|
||||
case ABILITY_IMMUNITY:
|
||||
if (status & STATUS_POISON_ALL) {
|
||||
ret = TRUE;
|
||||
}
|
||||
break;
|
||||
case ABILITY_LIMBER:
|
||||
if (status & STATUS_PARALYSIS) {
|
||||
ret = TRUE;
|
||||
}
|
||||
break;
|
||||
case ABILITY_INSOMNIA:
|
||||
case ABILITY_VITAL_SPIRIT:
|
||||
if (status & STATUS_SLEEP) {
|
||||
ret = TRUE;
|
||||
}
|
||||
break;
|
||||
case ABILITY_WATER_VEIL:
|
||||
if (status & STATUS_BURN) {
|
||||
ret = TRUE;
|
||||
}
|
||||
break;
|
||||
case ABILITY_MAGMA_ARMOR:
|
||||
if (status & STATUS_FREEZE) {
|
||||
ret = TRUE;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user