comment goomba_npc movement

This commit is contained in:
Alex Bates 2020-10-20 08:14:07 +01:00
parent 056fbac32c
commit 26f0cee254
No known key found for this signature in database
GPG Key ID: 5E11C2DB78877706
2 changed files with 18 additions and 2 deletions

View File

@ -121,6 +121,9 @@ typedef struct StatDrop {
#define ANIMATION(sprite, palette, anim) (sprite << 16) + (palette << 8) + anim #define ANIMATION(sprite, palette, anim) (sprite << 16) + (palette << 8) + anim
#define OVERRIDE_MOVEMENT_SPEED(speed) (speed * 32767)
#define NO_OVERRIDE_MOVEMENT_SPEED OVERRIDE_MOVEMENT_SPEED(-1)
typedef struct StaticNPC { typedef struct StaticNPC {
/* 0x000 */ NpcId id; /* 0x000 */ NpcId id;
/* 0x004 */ NpcSettings* settings; /* 0x004 */ NpcSettings* settings;
@ -137,7 +140,7 @@ typedef struct StaticNPC {
/* 0x0DA */ s16 minCoinBonus; /* 0x0DA */ s16 minCoinBonus;
/* 0x0DC */ s16 maxCoinBonus; /* 0x0DC */ s16 maxCoinBonus;
/* 0x0DE */ char unk_DE[2]; /* 0x0DE */ char unk_DE[2];
/* 0x0E0 */ s32 movement[48]; /* 0x0E0 */ s32 movement[48]; // TODO: type
/* 0x1A0 */ s32 animations[16]; /* 0x1A0 */ s32 animations[16];
/* 0x1E0 */ char unk_1E0[8]; /* 0x1E0 */ char unk_1E0[8];
/* 0x1E8 */ UNK_PTR extraAnimations; /* 0x1E8 */ UNK_PTR extraAnimations;

View File

@ -169,7 +169,20 @@ static StaticNpc goomba_npc = {
.itemDrops = { { ItemId_MUSHROOM, 10 } }, .itemDrops = { { ItemId_MUSHROOM, 10 } },
.heartDrops = GENEROUS_WHEN_LOW_HEART_DROPS(2), .heartDrops = GENEROUS_WHEN_LOW_HEART_DROPS(2),
.flowerDrops = GENEROUS_WHEN_LOW_FLOWER_DROPS(2), .flowerDrops = GENEROUS_WHEN_LOW_FLOWER_DROPS(2),
.movement = { 0xFFFFFFDF, 0x0, 0x1E, 0x28, 0x14, 0xFFFF8001, 0x1, 0xC8, 0x0, 0x0, 0x190, 0x3C, 0x1, 0x1 }, .movement = {
// Wander
/* center x, y, z */ -33, 0, 30,
/* size x, z */ 40, 20,
/* speed */ NO_OVERRIDE_MOVEMENT_SPEED,
/* box? */ TRUE,
// Detect
/* center x, y, z */ 200, 0, 0,
/* size x, z */ 400, 60,
/* box? */ TRUE,
/* flying? */ TRUE,
},
.animations = { .animations = {
ANIMATION(SpriteId_GOOMBA, 0, 1), ANIMATION(SpriteId_GOOMBA, 0, 1),
ANIMATION(SpriteId_GOOMBA, 0, 2), ANIMATION(SpriteId_GOOMBA, 0, 2),