Super Mario 64 Source
A Super Mario 64 decompilation, brought to you by a bunch of clever folks.
Data Structures | Functions | Variables
goomba.inc.c File Reference

Data Structures

struct  GoombaProperties
 Properties that vary based on goomba size. More...
 

Functions

void bhv_goomba_triplet_spawner_update (void)
 Update function for goomba triplet spawner. More...
 
void bhv_goomba_init (void)
 Initialization function for goomba. More...
 
static void goomba_begin_jump (void)
 Enter the jump action and set initial y velocity. More...
 
static void mark_goomba_as_dead (void)
 If spawned by a triplet spawner, mark the flag in the spawner to indicate that this goomba died. More...
 
static void goomba_act_walk (void)
 Walk around randomly occasionally jumping. More...
 
static void goomba_act_attacked_mario (void)
 This action occurs when either the goomba attacks mario normally, or mario attacks a huge goomba with an attack that doesn't kill it. More...
 
static void goomba_act_jump (void)
 Move until landing, and rotate toward target yaw. More...
 
void huge_goomba_weakly_attacked (void)
 Attack handler for when mario attacks a huge goomba with an attack that doesn't kill it. More...
 
void bhv_goomba_update (void)
 Update function for goomba. More...
 

Variables

static struct ObjectHitbox sGoombaHitbox
 Behavior for bhvGoomba and bhvGoombaTripletSpawner, Goombas can either be spawned individually, or spawned by a triplet spawner. More...
 
static struct GoombaProperties sGoombaProperties []
 Properties for regular, huge, and tiny goombas. More...
 
static u8 sGoombaAttackHandlers [][6]
 Attack handlers for goombas. More...
 

Function Documentation

◆ bhv_goomba_init()

void bhv_goomba_init ( void  )

Initialization function for goomba.

◆ bhv_goomba_triplet_spawner_update()

void bhv_goomba_triplet_spawner_update ( void  )

Update function for goomba triplet spawner.

◆ bhv_goomba_update()

void bhv_goomba_update ( void  )

Update function for goomba.

Bug:
Weak attacks on huge goombas in a triplet mark them as dead even if they're not.

◆ goomba_act_attacked_mario()

static void goomba_act_attacked_mario ( void  )
static

This action occurs when either the goomba attacks mario normally, or mario attacks a huge goomba with an attack that doesn't kill it.

This can happen even when the goomba is already in the air. It's

◆ goomba_act_jump()

static void goomba_act_jump ( void  )
static

Move until landing, and rotate toward target yaw.

If we move outside the goomba's drawing radius the frame it enters the

◆ goomba_act_walk()

static void goomba_act_walk ( void  )
static

Walk around randomly occasionally jumping.

If mario comes within range, chase him.

By strategically hitting a wall, steep slope, or another goomba, we can

It seems theoretically possible to get 2-3 goombas to repeatedly touch

◆ goomba_begin_jump()

static void goomba_begin_jump ( void  )
static

Enter the jump action and set initial y velocity.

◆ huge_goomba_weakly_attacked()

void huge_goomba_weakly_attacked ( void  )

Attack handler for when mario attacks a huge goomba with an attack that doesn't kill it.

From the goomba's perspective, this is the same as the goomba attacking mario.

◆ mark_goomba_as_dead()

static void mark_goomba_as_dead ( void  )
static

If spawned by a triplet spawner, mark the flag in the spawner to indicate that this goomba died.

This prevents it from spawning again when mario leaves and comes back.

Variable Documentation

◆ sGoombaAttackHandlers

u8 sGoombaAttackHandlers[][6]
static
Initial value:

Attack handlers for goombas.

◆ sGoombaHitbox

struct ObjectHitbox sGoombaHitbox
static
Initial value:
= {
0,
1,
0,
1,
72,
50,
42,
40,
}
#define INTERACT_BOUNCE_TOP
Definition: interaction.h:21

Behavior for bhvGoomba and bhvGoombaTripletSpawner, Goombas can either be spawned individually, or spawned by a triplet spawner.

The triplet spawner comes before its spawned goombas in processing order. Hitbox for goomba.

◆ sGoombaProperties

struct GoombaProperties sGoombaProperties[]
static
Initial value:
= {
{ 1.5f, SOUND_OBJECT_ENEMYDEATHHIGH, 4000, 1 },
{ 3.5f, SOUND_OBJECT_ENEMYDEATHLOW, 4000, 2 },
{ 0.5f, SOUND_OBJECT_ENEMYDEATHHIGH, 1500, 0 },
}
#define SOUND_OBJECT_ENEMYDEATHHIGH
Definition: audio_defines.h:527
#define SOUND_OBJECT_ENEMYDEATHLOW
Definition: audio_defines.h:528

Properties for regular, huge, and tiny goombas.