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

Functions

void bhv_chain_chomp_chain_part_update (void)
 Update function for chain chomp part / pivot. More...
 
static void chain_chomp_act_uninitialized (void)
 When mario gets close enough, allocate chain segments and spawn their objects. More...
 
static void chain_chomp_update_chain_segments (void)
 Apply gravity to each chain part, and cap its distance to the previous part as well as from the pivot. More...
 
static void chain_chomp_restore_normal_chain_lengths (void)
 Lunging increases the maximum distance from the pivot and changes the maximum distance between chain parts. More...
 
static void chain_chomp_sub_act_turn (void)
 Turn toward mario. More...
 
static void chain_chomp_sub_act_lunge (void)
 
static void chain_chomp_released_trigger_cutscene (void)
 Fall to the ground and interrupt mario into a cutscene action. More...
 
static void chain_chomp_released_lunge_around (void)
 Lunge 4 times, each time moving toward mario +/- 0x2000 angular units. More...
 
static void chain_chomp_released_break_gate (void)
 Continue lunging until a wall collision occurs. More...
 
static void chain_chomp_released_jump_away (void)
 Wait until the chain chomp lands. More...
 
static void chain_chomp_released_end_cutscene (void)
 Release mario and transition to the unload chain action. More...
 
static void chain_chomp_act_move (void)
 All chain chomp movement behavior, including the cutscene after being released. More...
 
static void chain_chomp_act_unload_chain (void)
 Hide and free the chain chomp segments. More...
 
void bhv_chain_chomp_update (void)
 Update function for chain chomp. More...
 
void bhv_wooden_post_update (void)
 Update function for wooden post. More...
 
void bhv_chain_chomp_gate_init (void)
 Init function for chain chomp gate. More...
 
void bhv_chain_chomp_gate_update (void)
 Update function for chain chomp gate. More...
 

Variables

static struct ObjectHitbox sChainChompHitbox
 Behavior for bhvChainChomp, bhvChainChompChainPart, bhvWoodenPost, and bhvChainChompGate. More...
 

Function Documentation

◆ bhv_chain_chomp_chain_part_update()

void bhv_chain_chomp_chain_part_update ( void  )

Update function for chain chomp part / pivot.

◆ bhv_chain_chomp_gate_init()

void bhv_chain_chomp_gate_init ( void  )

Init function for chain chomp gate.

◆ bhv_chain_chomp_gate_update()

void bhv_chain_chomp_gate_update ( void  )

Update function for chain chomp gate.

◆ bhv_chain_chomp_update()

void bhv_chain_chomp_update ( void  )

Update function for chain chomp.

◆ bhv_wooden_post_update()

void bhv_wooden_post_update ( void  )

Update function for wooden post.

◆ chain_chomp_act_move()

static void chain_chomp_act_move ( void  )
static

All chain chomp movement behavior, including the cutscene after being released.

◆ chain_chomp_act_uninitialized()

static void chain_chomp_act_uninitialized ( void  )
static

When mario gets close enough, allocate chain segments and spawn their objects.

◆ chain_chomp_act_unload_chain()

static void chain_chomp_act_unload_chain ( void  )
static

Hide and free the chain chomp segments.

The chain objects will unload themselves when they see that the chain chomp is in this action.

◆ chain_chomp_released_break_gate()

static void chain_chomp_released_break_gate ( void  )
static

Continue lunging until a wall collision occurs.

Mark the gate as destroyed, wait for the chain chomp to land, and then begin a jump toward the final target, x=3288, z=-1770.

The wall may not be the gate If the chain chomp gets stuck, it may never hit a wall, resulting

◆ chain_chomp_released_end_cutscene()

static void chain_chomp_released_end_cutscene ( void  )
static

Release mario and transition to the unload chain action.

◆ chain_chomp_released_jump_away()

static void chain_chomp_released_jump_away ( void  )
static

Wait until the chain chomp lands.

◆ chain_chomp_released_lunge_around()

static void chain_chomp_released_lunge_around ( void  )
static

Lunge 4 times, each time moving toward mario +/- 0x2000 angular units.

Finally, begin a lunge toward x=1450, z=562 (near the gate).

◆ chain_chomp_released_trigger_cutscene()

static void chain_chomp_released_trigger_cutscene ( void  )
static

Fall to the ground and interrupt mario into a cutscene action.

Can delay this if we get into a cutscene-unfriendly action after the

◆ chain_chomp_restore_normal_chain_lengths()

static void chain_chomp_restore_normal_chain_lengths ( void  )
static

Lunging increases the maximum distance from the pivot and changes the maximum distance between chain parts.

Restore these values to normal.

◆ chain_chomp_sub_act_lunge()

static void chain_chomp_sub_act_lunge ( void  )
static

◆ chain_chomp_sub_act_turn()

static void chain_chomp_sub_act_turn ( void  )
static

Turn toward mario.

Wait a bit and then enter the lunging sub-action.

◆ chain_chomp_update_chain_segments()

static void chain_chomp_update_chain_segments ( void  )
static

Apply gravity to each chain part, and cap its distance to the previous part as well as from the pivot.

Variable Documentation

◆ sChainChompHitbox

struct ObjectHitbox sChainChompHitbox
static
Initial value:
= {
0,
3,
1,
0,
80,
160,
80,
160,
}
#define INTERACT_MR_BLIZZARD
Definition: interaction.h:27

Behavior for bhvChainChomp, bhvChainChompChainPart, bhvWoodenPost, and bhvChainChompGate.

bhvChainChomp spawns its bhvWoodenPost in its behavior script. It spawns 5 chain parts. Part 0 is the "pivot", which is positioned at the wooden post while the chomp is chained up. Parts 1-4 are the other parts, starting from the chain chomp and moving toward the pivot. Processing order is bhvWoodenPost, bhvChainChompGate, bhvChainChomp, bhvChainChompChainPart. The chain parts are processed starting at the post and ending at the chomp. Hitbox for chain chomp.