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

Functions

static struct Objectlink_objects_with_behavior (void *behavior)
 Link all objects with the given behavior using parentObj. More...
 
static struct Objectmonty_mole_select_available_hole (f32 minDistToMario)
 Select a random hole that is within minDistToMario and 1500 of mario, and whose cooldown is zero. More...
 
void bhv_monty_mole_hole_update (void)
 Update function for bhvMontyMoleHole. More...
 
static void monty_mole_spawn_dirt_particles (s8 offsetY, s8 velYBase)
 Spawn dirt particles when rising out of the ground. More...
 
void bhv_monty_mole_init (void)
 Init function for bhvMontyMole. More...
 
static void monty_mole_act_select_hole (void)
 Search for an available hole. More...
 
static void monty_mole_act_rise_from_hole (void)
 Move upward until high enough, then enter the spawn rock action. More...
 
static void monty_mole_act_spawn_rock (void)
 If mario is close enough, then spawn a rock and enter the throw rock action. More...
 
static void monty_mole_act_begin_jump_into_hole (void)
 Wait until mario is relatively close, then set vely to 40 and enter the jump into hole action. More...
 
static void monty_mole_act_throw_rock (void)
 Throw the held rock, then enter the begin jump into hole action. More...
 
static void monty_mole_act_jump_into_hole (void)
 Tilt downward and wait until close to landing, then enter the hide action. More...
 
static void monty_mole_hide_in_hole (void)
 Become intangible and enter the select hole action. More...
 
static void monty_mole_act_hide (void)
 Wait to land on the floor, then hide. More...
 
static void monty_mole_act_jump_out_of_hole (void)
 Jump upward and then fall back down. More...
 
void bhv_monty_mole_update (void)
 Update function for bhvMontyMole. More...
 
static void monty_mole_rock_act_held (void)
 Wait for monty mole to throw the rock, then enter the move action. More...
 
static void monty_mole_rock_act_move (void)
 Move, then despawn after hitting the ground or water. More...
 
void bhv_monty_mole_rock_update (void)
 Update function for bhvMontyMoleRock. More...
 

Variables

static struct SpawnParticlesInfo sMontyMoleRiseFromGroundParticles
 Behavior for bhvMontyMole, bhvMontyMoleHole, and bhvMontyMoleRock. More...
 
static struct ObjectHitbox sMontyMoleHitbox
 Hitbox for monty mole. More...
 
static struct ObjectHitbox sMontyMoleRockHitbox
 Hitbox for monty mole rock. More...
 
static struct SpawnParticlesInfo sMontyMoleRockBreakParticles
 The particles that spawn when a monty mole rock breaks. More...
 
struct ObjectsMontyMoleHoleList
 The first hole in the list of monty mole holes. More...
 
s32 sMontyMoleKillStreak
 The number of nearby monty moles that have been killed in a row. More...
 
f32 sMontyMoleLastKilledPosX
 The position of the last killed monty mole, used for determining whether the next killed monty mole is nearby. More...
 
f32 sMontyMoleLastKilledPosY
 
f32 sMontyMoleLastKilledPosZ
 

Function Documentation

◆ bhv_monty_mole_hole_update()

void bhv_monty_mole_hole_update ( void  )

Update function for bhvMontyMoleHole.

◆ bhv_monty_mole_init()

void bhv_monty_mole_init ( void  )

Init function for bhvMontyMole.

◆ bhv_monty_mole_rock_update()

void bhv_monty_mole_rock_update ( void  )

Update function for bhvMontyMoleRock.

Since we can prevent them from despawning using partial updates, we

◆ bhv_monty_mole_update()

void bhv_monty_mole_update ( void  )

Update function for bhvMontyMole.

The two farthest holes on the bottom level of TTM are more than

No overflow check

◆ link_objects_with_behavior()

static struct Object* link_objects_with_behavior ( void behavior)
static

Link all objects with the given behavior using parentObj.

The result is a singly linked list in reverse processing order. Return the start of this list.

◆ monty_mole_act_begin_jump_into_hole()

static void monty_mole_act_begin_jump_into_hole ( void  )
static

Wait until mario is relatively close, then set vely to 40 and enter the jump into hole action.

◆ monty_mole_act_hide()

static void monty_mole_act_hide ( void  )
static

Wait to land on the floor, then hide.

◆ monty_mole_act_jump_into_hole()

static void monty_mole_act_jump_into_hole ( void  )
static

Tilt downward and wait until close to landing, then enter the hide action.

◆ monty_mole_act_jump_out_of_hole()

static void monty_mole_act_jump_out_of_hole ( void  )
static

Jump upward and then fall back down.

Then enter the begin jump into hole action.

◆ monty_mole_act_rise_from_hole()

static void monty_mole_act_rise_from_hole ( void  )
static

Move upward until high enough, then enter the spawn rock action.

◆ monty_mole_act_select_hole()

static void monty_mole_act_select_hole ( void  )
static

Search for an available hole.

Once one is available, claim it and enter either the rise from hole or jump out of hole action.

◆ monty_mole_act_spawn_rock()

static void monty_mole_act_spawn_rock ( void  )
static

If mario is close enough, then spawn a rock and enter the throw rock action.

Otherwise, enter the begin jump into hole action.

◆ monty_mole_act_throw_rock()

static void monty_mole_act_throw_rock ( void  )
static

Throw the held rock, then enter the begin jump into hole action.

◆ monty_mole_hide_in_hole()

static void monty_mole_hide_in_hole ( void  )
static

Become intangible and enter the select hole action.

Even though the object becomes intangible here, it is still possible

◆ monty_mole_rock_act_held()

static void monty_mole_rock_act_held ( void  )
static

Wait for monty mole to throw the rock, then enter the move action.

◆ monty_mole_rock_act_move()

static void monty_mole_rock_act_move ( void  )
static

Move, then despawn after hitting the ground or water.

◆ monty_mole_select_available_hole()

static struct Object* monty_mole_select_available_hole ( f32  minDistToMario)
static

Select a random hole that is within minDistToMario and 1500 of mario, and whose cooldown is zero.

Return NULL if no hole is available.

◆ monty_mole_spawn_dirt_particles()

static void monty_mole_spawn_dirt_particles ( s8  offsetY,
s8  velYBase 
)
static

Spawn dirt particles when rising out of the ground.

Variable Documentation

◆ sMontyMoleHitbox

struct ObjectHitbox sMontyMoleHitbox
static
Initial value:
= {
0,
2,
-1,
0,
70,
50,
30,
40,
}
#define INTERACT_BOUNCE_TOP
Definition: interaction.h:21

Hitbox for monty mole.

◆ sMontyMoleHoleList

struct Object* sMontyMoleHoleList

The first hole in the list of monty mole holes.

The list is a singly linked list using the parentObj field.

◆ sMontyMoleKillStreak

s32 sMontyMoleKillStreak

The number of nearby monty moles that have been killed in a row.

◆ sMontyMoleLastKilledPosX

f32 sMontyMoleLastKilledPosX

The position of the last killed monty mole, used for determining whether the next killed monty mole is nearby.

◆ sMontyMoleLastKilledPosY

f32 sMontyMoleLastKilledPosY

◆ sMontyMoleLastKilledPosZ

f32 sMontyMoleLastKilledPosZ

◆ sMontyMoleRiseFromGroundParticles

struct SpawnParticlesInfo sMontyMoleRiseFromGroundParticles
static
Initial value:
= {
0,
3,
0,
4,
4,
10,
15,
-4,
0,
10.0f,
7.0f,
}
#define MODEL_SAND_DUST
Definition: model_ids.h:487

Behavior for bhvMontyMole, bhvMontyMoleHole, and bhvMontyMoleRock.

The monty mole holes are placed statically. The monty moles repeatedly search for an available hole to pop out of. The particles that pop out of the ground when a monty mole rises from a hole.

◆ sMontyMoleRockBreakParticles

struct SpawnParticlesInfo sMontyMoleRockBreakParticles
static
Initial value:
= {
0,
2,
10,
4,
4,
10,
15,
-4,
0,
8.0f,
4.0f,
}
#define MODEL_PEBBLE
Definition: model_ids.h:489

The particles that spawn when a monty mole rock breaks.

◆ sMontyMoleRockHitbox

struct ObjectHitbox sMontyMoleRockHitbox
static
Initial value:
= {
15,
1,
99,
0,
30,
15,
30,
15,
}
#define INTERACT_MR_BLIZZARD
Definition: interaction.h:27

Hitbox for monty mole rock.