DCDecomp
A decompilation of Dark Cloud for the PlayStation 2
Loading...
Searching...
No Matches
CFish Class Reference

#include <fish.hpp>

Public Member Functions

 CFish ()
 
int FindFood ()
 
int EatFood ()
 
int BiteHook ()
 
int LeaveFood ()
 
int LeaveHook ()
 
void SetCPoly (CCPoly *polys, int count)
 
void Step ()
 
void Draw ()
 
void SetFoodPos (int kind, float *position, float radius)
 
void SetAngleMode ()
 
void SetBattleMode ()
 
void SetScale ()
 
int GetFP ()
 
void SetMotion (int motion_no, int flags)
 
void SetPosition (float *position)
 
void GetPosition (float *position)
 
void SetRotation (float *rotation)
 
void GetRotation (float *rotation)
 
void SetReference (CFrame *reference)
 
void DeleteReference ()
 
void Initialize ()
 

Public Attributes

s32 fish_kind
 
FishInfo info
 
FishMoveMode move_mode
 
FishAction action
 
s32 move_timer
 
s32 action_timer
 
s32 use_angle_model
 
float size
 
float angle_model_scale
 
float model_scale
 
s32 unk_6c
 
s32 unk_70
 
float target_yaw
 
s32 unk_78
 
s32 unk_7c
 
float target_speed
 
float speed
 
s32 food_kind
 
float food_radius
 
sceVu0FVECTOR food_position
 
CCharacter model
 
CCharacter angle_model
 
CCPoly * collision_polys
 
s32 collision_poly_count
 
u8 unk_2408 [8]
 

Detailed Description

Simulates and draws one fish in normal and angling forms.

Definition at line 57 of file fish.hpp.

Constructor & Destructor Documentation

◆ CFish()

CFish::CFish ( )

Constructs both character forms and resets the fish.

Mangled name:
__ct__5CFishFv
Address:
0x1A8DC0
Size:
0x184

Definition at line 279 of file fishing.cpp.

Member Function Documentation

◆ FindFood()

int CFish::FindFood ( )

Tests whether the fish notices the current bait.

Definition at line 60 of file fish.cpp.

◆ EatFood()

int CFish::EatFood ( )

Tests whether the fish eats the bait it has reached.

Definition at line 80 of file fish.cpp.

◆ BiteHook()

int CFish::BiteHook ( )

Tests whether the fish takes the hook it has reached.

Definition at line 96 of file fish.cpp.

◆ LeaveFood()

int CFish::LeaveFood ( )

Tests whether the fish abandons the bait.

Definition at line 112 of file fish.cpp.

◆ LeaveHook()

int CFish::LeaveHook ( )

Tests whether the fish abandons the hook.

Definition at line 120 of file fish.cpp.

◆ SetCPoly()

void CFish::SetCPoly ( CCPoly *  polys,
int  count 
)

Sets the collision polygons that constrain the fish.

Definition at line 128 of file fish.cpp.

◆ Step()

void CFish::Step ( )

Advances movement, interaction, animation, and collision.

Definition at line 133 of file fish.cpp.

◆ Draw()

void CFish::Draw ( )

Draws the active character form.

Definition at line 326 of file fish.cpp.

◆ SetFoodPos()

void CFish::SetFoodPos ( int  kind,
float *  position,
float  radius 
)

Sets the bait kind, position, and attraction radius.

Definition at line 338 of file fish.cpp.

◆ SetAngleMode()

void CFish::SetAngleMode ( )

Puts the fish in the static angling-display mode.

Definition at line 344 of file fish.cpp.

◆ SetBattleMode()

void CFish::SetBattleMode ( )

Puts the fish in the hooked battle mode.

Definition at line 350 of file fish.cpp.

◆ SetScale()

void CFish::SetScale ( )

Generates the fish size and the scales of both models.

Definition at line 355 of file fish.cpp.

◆ GetFP()

int CFish::GetFP ( )

Calculates the fishing points awarded for this fish.

Definition at line 377 of file fish.cpp.

◆ SetMotion()

void CFish::SetMotion ( int  motion_no,
int  flags 
)

Selects the motion played by both character forms.

Definition at line 389 of file fish.cpp.

◆ SetPosition()

void CFish::SetPosition ( float *  position)

Sets the position of both character forms.

Definition at line 398 of file fish.cpp.

◆ GetPosition()

void CFish::GetPosition ( float *  position)

Gets the position of the angling character form.

Definition at line 403 of file fish.cpp.

◆ SetRotation()

void CFish::SetRotation ( float *  rotation)

Sets the rotation of both character forms.

Definition at line 405 of file fish.cpp.

◆ GetRotation()

void CFish::GetRotation ( float *  rotation)

Gets the rotation of the angling character form.

Definition at line 410 of file fish.cpp.

◆ SetReference()

void CFish::SetReference ( CFrame *  reference)

Attaches both character frames to a reference frame.

Definition at line 412 of file fish.cpp.

◆ DeleteReference()

void CFish::DeleteReference ( )

Detaches both character frames from their reference frames.

Definition at line 422 of file fish.cpp.

◆ Initialize()

void CFish::Initialize ( )

Resets the fish's runtime state and both character forms.

Definition at line 432 of file fish.cpp.

Member Data Documentation

◆ fish_kind

s32 CFish::fish_kind

Index of the loaded fish kind, or -1 when unused.

Definition at line 59 of file fish.hpp.

◆ info

FishInfo CFish::info

Fixed attributes copied from the fish-kind table.

Definition at line 60 of file fish.hpp.

◆ move_mode

FishMoveMode CFish::move_mode

Current autonomous movement behaviour.

Definition at line 61 of file fish.hpp.

◆ action

FishAction CFish::action

Current bait or hook interaction.

Definition at line 62 of file fish.hpp.

◆ move_timer

s32 CFish::move_timer

Steps remaining before choosing another movement.

Definition at line 63 of file fish.hpp.

◆ action_timer

s32 CFish::action_timer

Steps remaining before updating the interaction.

Definition at line 64 of file fish.hpp.

◆ use_angle_model

s32 CFish::use_angle_model

Nonzero while the angling character form is active.

Definition at line 65 of file fish.hpp.

◆ size

float CFish::size

Generated size of this fish.

Definition at line 66 of file fish.hpp.

◆ angle_model_scale

float CFish::angle_model_scale

Scale applied to the angling character form.

Definition at line 67 of file fish.hpp.

◆ model_scale

float CFish::model_scale

Scale applied to the normal character form.

Definition at line 68 of file fish.hpp.

◆ unk_6c

s32 CFish::unk_6c

Definition at line 69 of file fish.hpp.

◆ unk_70

s32 CFish::unk_70

Definition at line 70 of file fish.hpp.

◆ target_yaw

float CFish::target_yaw

Yaw toward which the fish turns.

Definition at line 71 of file fish.hpp.

◆ unk_78

s32 CFish::unk_78

Definition at line 72 of file fish.hpp.

◆ unk_7c

s32 CFish::unk_7c

Definition at line 73 of file fish.hpp.

◆ target_speed

float CFish::target_speed

Forward speed toward which the fish accelerates.

Definition at line 74 of file fish.hpp.

◆ speed

float CFish::speed

Current forward speed.

Definition at line 75 of file fish.hpp.

◆ food_kind

s32 CFish::food_kind

Kind of bait currently presented, or -1 for none.

Definition at line 76 of file fish.hpp.

◆ food_radius

float CFish::food_radius

Radius within which the fish notices the bait.

Definition at line 77 of file fish.hpp.

◆ food_position

sceVu0FVECTOR CFish::food_position

World position of the current bait or hook.

Definition at line 78 of file fish.hpp.

◆ model

CCharacter CFish::model

Character used for normal swimming.

Definition at line 79 of file fish.hpp.

◆ angle_model

CCharacter CFish::angle_model

Character used for angling and battle.

Definition at line 80 of file fish.hpp.

◆ collision_polys

CCPoly* CFish::collision_polys

Polygons that constrain fish movement.

Definition at line 81 of file fish.hpp.

◆ collision_poly_count

s32 CFish::collision_poly_count

Number of collision polygons.

Definition at line 82 of file fish.hpp.

◆ unk_2408

u8 CFish::unk_2408[8]

Definition at line 83 of file fish.hpp.