wavelength 1.0.0
Loading...
Searching...
No Matches
Ship Class Reference

Ship of one player, which rides the tracks of the tunnel and fires beams at the gems. More...

#include <ship.h>

Classes

struct  BeamData
 One beam a ship fired. More...

Public Types

enum  ArmColor {
  kArmColorStartLow = 0 , kArmColorStartHigh = 1 , kArmColorEndLow = 2 , kArmColorEndHigh = 3 ,
  kNumArmColors = 4
}
 The colours of the particles of an arm, indexing mArmColors. More...
enum  Flag { kFlagAttacking = 1 , kFlagBumped = 2 , kFlagBumpReverse = 4 }
 The bits of mFlags. More...

Public Member Functions

 Ship (const char *pszColor, int nPlayer)
 Build the ship of a player from the scene objects of its colour.
 ~Ship ()
 Destroy the ship, the views it created, and every object the ships share.
void SetMultiplier (int nMultiplier)
 Give the ship its leader material while the streak multiplier is above 1.
void Reset ()
 Return the ship to its state at the start of a song.
void SetEnergy (float fEnergy, int nZone, float fZoneFraction)
 Colour the arms for the zone of the energy, or make them sputter when it runs out.
void Fire (int nSlot, signed char nTrack, bool bHit)
 Fire the ship at a gem.
void SetTrack (int nTrack, int nTrackType, int nInstrument)
 Move the ship to a track, which ends its beams.
void SetShown (bool bShown)
 Show or hide the ship.
void SetHidden (bool bHidden)
 Hide the ship regardless of SetShown(), or stop hiding it, and end its beams.
void SetOverride (const float(*pXfm)[kTransformRowFloatCount], float fBlend)
 Blend the ship towards a fixed transform, or stop blending.
void StartBump (bool bVictim, int nTrack)
 Start the move of the ship of a bump.
void Poll (float fTicks, float fTimeDelta)
 Place the ship on the tracks and advance its effects.
void UpdateTransform ()
 Place the ship for the intro and the outro of the play field.
void DrawTrack ()
 Draw the ship on its track and record where it lies on the screen.
void DrawEffects ()
 Draw the trodes, the arms, and the attack of a bumper.
void DrawArrow ()
 Draw the arrow at the edge of the screen that points at a ship off the screen.
void ScaleArms (float fScale)
 Scale the arms and the trodes.
void ScaleArm (int nArm, float fScale)
 Scale one arm and its trode.
RndView * GetView () const
RndLine * GetScratchRibbon () const
unsigned char GetFlags () const
float GetBumpStart () const
void SetArrowAspect (float fAspect)
 Set the slope of the edge arrow.
void SetSpread (float fSpread)
 Set how far apart the ships of a shared screen fly.

Static Public Member Functions

static void LoadConfig (DataArray *pConfig, DataArray *pDefaults, bool bReload)
 Read the configuration every ship shares, and pass it on to the beam pools that exist.
static void DrawShared ()
 Draw the environment every ship shares.
static RndTransAnim * GetWinFlyOff ()
static RndView * GetBeamView ()

Static Public Attributes

static constexpr int kNumArms = 3
 The number of arms, one for each gem button.
static constexpr int kNumMultiOffsets = 2
 The two configured offsets of a ship of a game of several players.
static constexpr int kNumBeamEnds = 2
 The two ends of a beam, 0 at the ship and 1 at the gem.

Detailed Description

Ship of one player, which rides the tracks of the tunnel and fires beams at the gems.

The RTTI of its nested BeamData type names the class. The class is not polymorphic, and the object is 0x260 bytes. The three arms of the ship hold the trodes that fire at the three gem buttons, and each arm's particle system also records the colours of one zone of the energy meter.

Member Enumeration Documentation

◆ ArmColor

The colours of the particles of an arm, indexing mArmColors.

Enumerator
kArmColorStartLow 

The low end of the start colour.

kArmColorStartHigh 

The high end of the start colour.

kArmColorEndLow 

The low end of the end colour.

kArmColorEndHigh 

The high end of the end colour.

kNumArmColors 

The number of colours.

◆ Flag

enum Ship::Flag

The bits of mFlags.

Enumerator
kFlagAttacking 

The ship plays the attack of a bumper.

kFlagBumped 

The ship is knocked across the tracks by a bumper.

kFlagBumpReverse 

The knock moves towards a lower track.

Constructor & Destructor Documentation

◆ Ship()

Ship::Ship ( const char * pszColor,
int nPlayer )

Build the ship of a player from the scene objects of its colour.

The first ship also finds the scene objects every ship shares.

Parameters
pszColorThe colour of the player.
nPlayerThe player.
Ghidra address:
NTSC-U/C: 0x001c6b70
Ghidra address:
PAL: 0x001cf910

◆ ~Ship()

Ship::~Ship ( )

Destroy the ship, the views it created, and every object the ships share.

Ghidra address:
NTSC-U/C: 0x001c8090
Ghidra address:
PAL: 0x001d0e30

Member Function Documentation

◆ LoadConfig()

void Ship::LoadConfig ( DataArray * pConfig,
DataArray * pDefaults,
bool bReload )
static

Read the configuration every ship shares, and pass it on to the beam pools that exist.

Parameters
pConfigThe section of the kind of game.
pDefaultsThe gfx section.
bReloadWhether the configuration was read before.
Ghidra address:
NTSC-U/C: 0x001c6470
Ghidra address:
PAL: 0x001cf210

◆ SetMultiplier()

void Ship::SetMultiplier ( int nMultiplier)

Give the ship its leader material while the streak multiplier is above 1.

Parameters
nMultiplierThe multiplier.
Ghidra address:
NTSC-U/C: 0x001c82b0
Ghidra address:
PAL: 0x001d1050

◆ Reset()

void Ship::Reset ( )

Return the ship to its state at the start of a song.

Ghidra address:
NTSC-U/C: 0x001c82e8
Ghidra address:
PAL: 0x001d1088

◆ SetEnergy()

void Ship::SetEnergy ( float fEnergy,
int nZone,
float fZoneFraction )

Colour the arms for the zone of the energy, or make them sputter when it runs out.

Parameters
fEnergyThe energy, from 0 to 1.
nZoneThe zone of the energy.
fZoneFractionThe position of the energy within its zone. The ship does not read it.
Ghidra address:
NTSC-U/C: 0x001c8488
Ghidra address:
PAL: 0x001d1228

◆ Fire()

void Ship::Fire ( int nSlot,
signed char nTrack,
bool bHit )

Fire the ship at a gem.

Parameters
nSlotThe gem button.
nTrackThe track.
bHitWhether the gem was hit.
Ghidra address:
NTSC-U/C: 0x001c8d48
Ghidra address:
PAL: 0x001d1ae8

◆ SetTrack()

void Ship::SetTrack ( int nTrack,
int nTrackType,
int nInstrument )

Move the ship to a track, which ends its beams.

Parameters
nTrackThe track. The ship does not read it.
nTrackTypeThe type of the track. The ship does not read it.
nInstrumentThe instrument of the track. The ship does not read it.
Ghidra address:
NTSC-U/C: 0x001c8e58
Ghidra address:
PAL: 0x001d1bf8

◆ SetShown()

void Ship::SetShown ( bool bShown)

Show or hide the ship.

While the tutorial flight exists, the flight decides whether the ship shows.

Parameters
bShownWhether the ship is shown.
Ghidra address:
NTSC-U/C: 0x001c8e78
Ghidra address:
PAL: 0x001d1c18

◆ SetHidden()

void Ship::SetHidden ( bool bHidden)

Hide the ship regardless of SetShown(), or stop hiding it, and end its beams.

Parameters
bHiddenWhether the ship is hidden.
Ghidra address:
NTSC-U/C: 0x001c8ee8
Ghidra address:
PAL: 0x001d1c88

◆ SetOverride()

void Ship::SetOverride ( const float(*) pXfm[kTransformRowFloatCount],
float fBlend )

Blend the ship towards a fixed transform, or stop blending.

Parameters
pXfmThe transform, or null to stop.
fBlendThe blend, from 0 for the ship's own transform to 1 for pXfm.
Ghidra address:
NTSC-U/C: 0x001c8f50
Ghidra address:
PAL: 0x001d1cf0

◆ StartBump()

void Ship::StartBump ( bool bVictim,
int nTrack )

Start the move of the ship of a bump.

Parameters
bVictimWhether the ship is the bumped one.
nTrackThe track the bumped ship moves to.
Ghidra address:
NTSC-U/C: 0x001c8f98
Ghidra address:
PAL: 0x001d1d38

◆ Poll()

void Ship::Poll ( float fTicks,
float fTimeDelta )

Place the ship on the tracks and advance its effects.

Parameters
fTicksThe ticks since the last poll. The ship does not read them.
fTimeDeltaThe time since the last poll.
Ghidra address:
NTSC-U/C: 0x001c9100
Ghidra address:
PAL: 0x001d1ea0

◆ UpdateTransform()

void Ship::UpdateTransform ( )

Place the ship for the intro and the outro of the play field.

Ghidra address:
NTSC-U/C: 0x001ca2f0
Ghidra address:
PAL: 0x001d3090

◆ DrawShared()

void Ship::DrawShared ( )
static

Draw the environment every ship shares.

Ghidra address:
NTSC-U/C: 0x001cab50
Ghidra address:
PAL: 0x001d38f0

◆ DrawTrack()

void Ship::DrawTrack ( )

Draw the ship on its track and record where it lies on the screen.

Ghidra address:
NTSC-U/C: 0x001cab78
Ghidra address:
PAL: 0x001d3918

◆ DrawEffects()

void Ship::DrawEffects ( )

Draw the trodes, the arms, and the attack of a bumper.

Ghidra address:
NTSC-U/C: 0x001cabf0
Ghidra address:
PAL: 0x001d3990

◆ DrawArrow()

void Ship::DrawArrow ( )

Draw the arrow at the edge of the screen that points at a ship off the screen.

Ghidra address:
NTSC-U/C: 0x001cad60
Ghidra address:
PAL: 0x001d3b00

◆ ScaleArms()

void Ship::ScaleArms ( float fScale)

Scale the arms and the trodes.

Parameters
fScaleThe scale, 1 for the configured size.
Ghidra address:
NTSC-U/C: 0x001c8750
Ghidra address:
PAL: 0x001d14f0

◆ ScaleArm()

void Ship::ScaleArm ( int nArm,
float fScale )

Scale one arm and its trode.

Parameters
nArmThe arm.
fScaleThe scale, 1 for the configured size.
Ghidra address:
NTSC-U/C: 0x001c8840
Ghidra address:
PAL: 0x001d15e0

◆ GetWinFlyOff()

RndTransAnim * Ship::GetWinFlyOff ( )
inlinestatic
Returns
ship win fly-off.tnm.

◆ GetBeamView()

RndView * Ship::GetBeamView ( )
inlinestatic
Returns
ship beam draw.view, the view the beams draw under.

◆ GetView()

RndView * Ship::GetView ( ) const
inline
Returns
ship_<c>.view.

◆ GetScratchRibbon()

RndLine * Ship::GetScratchRibbon ( ) const
inline
Returns
scratch ribbon_<c>.line.

◆ GetFlags()

unsigned char Ship::GetFlags ( ) const
inline
Returns
A combination of Flag.

◆ GetBumpStart()

float Ship::GetBumpStart ( ) const
inline
Returns
The time the knock started.

◆ SetArrowAspect()

void Ship::SetArrowAspect ( float fAspect)
inline

Set the slope of the edge arrow.

Parameters
fAspectThe slope, the activator scale.

◆ SetSpread()

void Ship::SetSpread ( float fSpread)
inline

Set how far apart the ships of a shared screen fly.

Parameters
fSpreadThe distance.

Member Data Documentation

◆ kNumArms

int Ship::kNumArms = 3
staticconstexpr

The number of arms, one for each gem button.

◆ kNumMultiOffsets

int Ship::kNumMultiOffsets = 2
staticconstexpr

The two configured offsets of a ship of a game of several players.

◆ kNumBeamEnds

int Ship::kNumBeamEnds = 2
staticconstexpr

The two ends of a beam, 0 at the ship and 1 at the gem.


The documentation for this class was generated from the following file: