Remove NPC utility macros
Signed-off-by: Gabriel Ravier <gabravier@gmail.com>
This commit is contained in:
parent
c68923fdd5
commit
cc4de5e44c
2 changed files with 11 additions and 21 deletions
|
@ -573,9 +573,17 @@ void ActBossChar_Frog(void)
|
|||
break;
|
||||
}
|
||||
|
||||
NPC_DO_GRAVITY(boss, 0x40, 0x5FF);
|
||||
NPC_UPDATE_POSITIONS_WITH_VELOCITIES(boss);
|
||||
NPC_SET_RECT_FROM_LEFT_RIGHT(boss, rcLeft, rcRight);
|
||||
boss->ym += 0x40;
|
||||
if (boss->ym > 0x5FF)
|
||||
boss->ym = 0x5FF;
|
||||
|
||||
boss->x += boss->xm;
|
||||
boss->y += boss->ym;
|
||||
|
||||
if (boss->direct == DIR_LEFT)
|
||||
boss->rect = rcLeft[boss->ani_no];
|
||||
else
|
||||
boss->rect = rcRight[boss->ani_no];
|
||||
|
||||
ActBossChar02_01();
|
||||
ActBossChar02_02();
|
||||
|
|
18
src/NpChar.h
18
src/NpChar.h
|
@ -7,24 +7,6 @@
|
|||
|
||||
#define NPC_MAX 0x200
|
||||
|
||||
#define NPC_CAP_Y_VELOCITY(npc, maxYVel) \
|
||||
if (npc->ym > (maxYVel)) \
|
||||
npc->ym = (maxYVel)
|
||||
|
||||
#define NPC_DO_GRAVITY(npc, ymAdd, maxYVel) \
|
||||
npc->ym += ymAdd; \
|
||||
NPC_CAP_Y_VELOCITY(npc, maxYVel)
|
||||
|
||||
#define NPC_UPDATE_POSITIONS_WITH_VELOCITIES(npc) \
|
||||
npc->x += npc->xm; \
|
||||
npc->y += npc->ym
|
||||
|
||||
#define NPC_SET_RECT_FROM_LEFT_RIGHT(npc, rcLeft, rcRight) \
|
||||
if (npc->direct == DIR_LEFT) \
|
||||
npc->rect = rcLeft[npc->ani_no]; \
|
||||
else \
|
||||
npc->rect = rcRight[npc->ani_no]
|
||||
|
||||
enum NPCCond
|
||||
{
|
||||
NPCCOND_DAMAGE_BOSS = 0x10, // (gBoss npc exclusive) When set, damage the main boss
|
||||
|
|
Loading…
Add table
Reference in a new issue