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

Functions

void bhv_wiggler_body_part_update (void)
 Update function for bhvWigglerBodyPart. More...
 
static void wiggler_init_segments (void)
 Initialize the segment data and spawn the body part objects. More...
 
static void wiggler_update_segments (void)
 Update the tail to reflect changes in the head's yaw and pitch, and ensure that the distance between parts is exactly the intended distance. More...
 
static void wiggler_act_walk (void)
 Show text if necessary. More...
 
static void wiggler_act_jumped_on (void)
 Squish and unsquish, then show text and enter either the walking or shrinking action. More...
 
static void wiggler_act_knockback (void)
 Decelerate to a stop and then enter the walk action. More...
 
static void wiggler_act_shrink (void)
 Shrink, then spawn the star and enter the fall through floor action. More...
 
static void wiggler_act_fall_through_floor (void)
 Fall through floors until y < 1700, then enter the walking action. More...
 
void wiggler_jumped_on_attack_handler (void)
 Attack handler for when wiggler is jumped or ground pounded on. More...
 
void bhv_wiggler_update (void)
 Update function for bhvWiggler. More...
 

Variables

static struct ObjectHitbox sWigglerBodyPartHitbox
 Behavior for bhvWiggler and bhvWigglerBodyPart. More...
 
static struct ObjectHitbox sWigglerHitbox
 Hitbox for wiggler's head. More...
 
static u8 sWigglerAttackHandlers []
 Attack handler for wiggler while in the walking action. More...
 
static f32 sWigglerSpeeds [] = { 2.0f, 40.0f, 30.0f, 16.0f }
 Target speed while walking when wiggler has health 1, 2, 3, and 4. More...
 

Function Documentation

◆ bhv_wiggler_body_part_update()

void bhv_wiggler_body_part_update ( void  )

Update function for bhvWigglerBodyPart.

Set object position and angle based on wiggler segment data and avoid falling through the floor. Tangible if the wiggler is not in the shrinking action, but does nothing on attack.

Since position is recomputed each frame, tilting the wiggler up

◆ bhv_wiggler_update()

void bhv_wiggler_update ( void  )

Update function for bhvWiggler.

◆ wiggler_act_fall_through_floor()

static void wiggler_act_fall_through_floor ( void  )
static

Fall through floors until y < 1700, then enter the walking action.

◆ wiggler_act_jumped_on()

static void wiggler_act_jumped_on ( void  )
static

Squish and unsquish, then show text and enter either the walking or shrinking action.

◆ wiggler_act_knockback()

static void wiggler_act_knockback ( void  )
static

Decelerate to a stop and then enter the walk action.

◆ wiggler_act_shrink()

static void wiggler_act_shrink ( void  )
static

Shrink, then spawn the star and enter the fall through floor action.

◆ wiggler_act_walk()

static void wiggler_act_walk ( void  )
static

Show text if necessary.

Then walk toward mario if not at full health, and otherwise wander in random directions. If attacked by mario, enter either the jumped on or knockback action.

Every object's health is initially 2048, and wiggler's doesn't change

If the wiggler could self-intersect, or intersect a different

◆ wiggler_init_segments()

static void wiggler_init_segments ( void  )
static

Initialize the segment data and spawn the body part objects.

◆ wiggler_jumped_on_attack_handler()

void wiggler_jumped_on_attack_handler ( void  )

Attack handler for when wiggler is jumped or ground pounded on.

Stop and enter the jumped on action.

◆ wiggler_update_segments()

static void wiggler_update_segments ( void  )
static

Update the tail to reflect changes in the head's yaw and pitch, and ensure that the distance between parts is exactly the intended distance.

Since these positions are completely recomputed each frame, it is not possible for a body part to get stuck on geometry and separate from the rest of the body.

Variable Documentation

◆ sWigglerAttackHandlers

u8 sWigglerAttackHandlers[]
static
Initial value:
= {
}
#define ATTACK_HANDLER_SPECIAL_WIGGLER_JUMPED_ON
Definition: obj_behaviors_2.h:12
#define ATTACK_HANDLER_KNOCKBACK
Definition: obj_behaviors_2.h:8

Attack handler for wiggler while in the walking action.

◆ sWigglerBodyPartHitbox

struct ObjectHitbox sWigglerBodyPartHitbox
static
Initial value:
= {
0,
3,
99,
0,
20,
20,
20,
10,
}
#define INTERACT_BOUNCE_TOP
Definition: interaction.h:21

Behavior for bhvWiggler and bhvWigglerBodyPart.

The bhvWiggler object controls the wiggler's behavior, and physically manifests as the wiggler's head. The bhvWigglerBodyPart objects represent the 3 tail body parts, numbered 1 closest to the head, and 3 at the end of the tail. Processing order is bhvWiggler, then bhvWigglerBodyPart 1, 2, then 3. Hitbox for wiggler's non-head body parts.

◆ sWigglerHitbox

struct ObjectHitbox sWigglerHitbox
static
Initial value:
= {
0,
3,
4,
0,
60,
50,
30,
40,
}
#define INTERACT_BOUNCE_TOP
Definition: interaction.h:21

Hitbox for wiggler's head.

◆ sWigglerSpeeds

f32 sWigglerSpeeds[] = { 2.0f, 40.0f, 30.0f, 16.0f }
static

Target speed while walking when wiggler has health 1, 2, 3, and 4.