Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
93 changes: 93 additions & 0 deletions docs/game/bases/d_wm_csvdata.dox
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
/*!
@class dCsvData_c
@details
## Overview
This class reads the CSV files located in @p WorldMap/RouteInfo.arc, which describe the structure of the world map -
how the nodes (points) are connected, which course unlocks which other course, and which world map enemies are present.

## Point data layout
Each line in the point CSV file contains a number of fields, separated by commas.
If no more non-empty fields are present, the line may be terminated early with a carriage return and newline character.

The fields are as follows:
<table>
<thead>
<tr>
<th>Field</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>Line number</td>
<td>A sequential number starting from 1 for each line in the file, ignored by the game.</td>
</tr>
<tr>
<td>Point name</td>
<td>The name of the point.</td>
</tr>
<tr>
<td>Point types</td>
<td>A comma-separated list of the point's properties. See PointFlag_e.</td>
</tr>
<tr>
<td>Open point names (Regular exit)</td>
<td>A comma-separated list of point names which are unlocked when the player completes the course at this point.</td>
</tr>
<tr>
<td>Open route names (Regular exit)</td>
<td>A comma-separated list of route names which are unlocked when the player completes the course at this point.</td>
</tr>
<tr>
<td>Flag data (Regular exit)</td>
<td>
Seems to never be used in the vanilla world maps, but is referenced in:
<ul>
<li>ReadFlagData()</li>
<li>GetRouteAnimNum()</li>
<li>GetRouteAnimName()</li>
</ul>
</td>
</tr>
<tr>
<td>Open point names (Secret exit)</td>
<td>A comma-separated list of point names which are unlocked when the player completes the secret exit of the course at this point.</td>
</tr>
<tr>
<td>Open route names (Secret exit)</td>
<td>A comma-separated list of route names which are unlocked when the player completes the secret exit of the course at this point.</td>
</tr>
<tr>
<td>Flag data (Secret exit)</td>
<td>See the regular exit version of this.</td>
</tr>
</tbody>
</table>

## Route data layout
Each line in the route CSV file contains a number of fields, separated by commas.

Comment thread
RootCubed marked this conversation as resolved.
Resolved
The fields are as follows:
<table>
<thead>
<tr>
<th>Field</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>Route name</td>
<td>The name of the route, in the format @p Rxxxxyyyy, where @p xxxx and @p yyyy denote the two connected points.</td>
</tr>
<tr>
<td>Route action type</td>
<td>The route type. This determines the animation of the player when they traverse the route. See ActionType_e.</td>
</tr>
<tr>
<td>Route flags</td>
<td>A comma-separated list of flags for the route. Only used in World 5 for the moving vines.</td>
</tr>
</tbody>
</table>
*/
4 changes: 2 additions & 2 deletions include/constants/game_constants.h
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,8 @@ enum STAGE_e {
STAGE_ENEMY_2,
STAGE_ENEMY_3,
STAGE_CANNON,
STAGE_UNK37,
STAGE_DOOMSHIP,
STAGE_TRSHIP,
STAGE_AIRSHIP,
STAGE_START_KINOKO_HOUSE, ///< The toad house on the starting node of each world.
STAGE_TITLE,
STAGE_PEACH_CASTLE,
Expand Down
57 changes: 57 additions & 0 deletions include/constants/sjis_constants.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,60 @@

// [Translation: Heap for dynamic link control (dDyl::cCc_frmHeap)]
#define DYL_FRM_HEAP_NAME "ダイナミックリンク制御用ヒープ(dDyl::cCc_frmHeap)"

// [Translation: Road]
#define CSV_ACTION_ROAD "道"

// [Translation: Sand]
#define CSV_ACTION_SAND "砂"

// [Translation: Wood]
#define CSV_ACTION_WOOD "木"

// [Translation: Jump]
#define CSV_ACTION_JUMP "ジャンプ"

// [Translation: Ladder]
#define CSV_ACTION_LADDER "はしご"

// [Translation: Vine]
#define CSV_ACTION_VINE "ツタ"

// [Translation: Slope]
#define CSV_ACTION_SLOPE "坂"

// [Translation: Icey slope]
#define CSV_ACTION_ICE_SLOPE "氷坂"

// [Translation: Switch block]
#define CSV_ACTION_SWITCH_BLOCK "スイッチブロック"

// [Translation: Quicksand]
#define CSV_ACTION_QUICKSAND "流砂"

// [Translation: Snow]
#define CSV_ACTION_SNOW "雪"

// [Translation: Ice]
#define CSV_ACTION_ICE "氷"

// [Translation: Cloud]
#define CSV_ACTION_CLOUD "雲"

// [Translation: Water]
#define CSV_ACTION_WATER "水"

// [Translation: Right ladder]
#define CSV_ACTION_RIGHT_LADDER "はしご右"

// [Translation: Left ladder]
#define CSV_ACTION_LEFT_LADDER "はしご左"

// [Translation: Rock ladder]
#define CSV_ACTION_ROCK_LADDER "はしご岩"

// [Translation: Rope ladder]
#define CSV_ACTION_ROPE_LADDER "はしご縄"

// [Translation: Dirt]
#define CSV_ACTION_DIRT "土"
57 changes: 30 additions & 27 deletions include/game/bases/d_a_bullet.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
#include <game/bases/d_actor_state.hpp>
#include <game/bases/d_heap_allocator.hpp>

/// @brief The base class for various projectile actors.
/// @statetable
/// @ingroup bases
class daBullet_c : public dActorState_c {
public:
/// @unofficial
Expand All @@ -14,8 +17,8 @@ class daBullet_c : public dActorState_c {
HIT_YOSHI_BULLET
};

daBullet_c();
virtual ~daBullet_c() {}
daBullet_c(); ///< @copydoc dActor_c::dActor_c
virtual ~daBullet_c() {} ///< @copydoc dActor_c::~dActor_c

virtual int create();
virtual int preExecute();
Expand All @@ -37,16 +40,16 @@ class daBullet_c : public dActorState_c {
STATE_VIRTUAL_FUNC_DECLARE(daBullet_c, HitShell);
STATE_VIRTUAL_FUNC_DECLARE(daBullet_c, HitYoshiBullet);

virtual void createMdl();
virtual void removeMdl();
virtual void initialize();
virtual void createMdl(); ///< Creates the model for the bullet.
virtual void removeMdl(); ///< Removes the model for the bullet.
virtual void initialize(); ///< Subclass-specific initialization logic for the bullet.

virtual void setSpitOutMove(dActor_c *eatingActor);
virtual void setDeadMove(const mVec3_c &speed, short angle);
virtual void cullingProc();
virtual void setSpitOutMove(dActor_c *eatingActor); ///< Handles the bullet being spat out by Yoshi.
virtual void setDeadMove(const mVec3_c &speed, short angle); ///< Sets the movement parameters for the bullet after it has been hit.
virtual void cullingProc(); ///< Culls the bullet if needed.

virtual bool hitProc_Star(dCc_c *other);
virtual bool hitProc_Shell(dCc_c *other);
virtual bool hitProc_Star(dCc_c *other); ///< Handles the bullet being hit by a player or Yoshi with a star.
virtual bool hitProc_Shell(dCc_c *other); ///< Handles the bullet being hit by a shell.
virtual bool hitProc_YoshiBullet(dCc_c *other);
virtual bool hitProc_Reflect(dCc_c *other);

Expand All @@ -55,25 +58,25 @@ class daBullet_c : public dActorState_c {
virtual void moveSE();
virtual void deadRoll();

void allocate();
void allocate(); ///< Creates the allocator and load the model.

bool checkPlayerDamage(dCc_c *self, dCc_c *other);
bool checkYoshiDamage(dCc_c *self, dCc_c *other);
bool checkPlayerDamage(dCc_c *self, dCc_c *other); ///< Returns whether a player with a star is touching the bullet.
bool checkYoshiDamage(dCc_c *self, dCc_c *other); ///< Returns whether a Yoshi with a star is touching the bullet.

bool splashProc();
void setDamage_Player(dActor_c *actor);
bool splashProc(); ///< Checks if the bullet has hit water and creates a splash effect if so.
void setDamage_Player(dActor_c *actor); ///< Triggers damage to a player that touched the bullet.

static void collisionCallback(dCc_c *self, dCc_c *other);
static void revengeCallback(dCc_c *self, dCc_c *other);
static void collisionCallback(dCc_c *self, dCc_c *other); ///< Regular collision callback for the bullet.
static void revengeCallback(dCc_c *self, dCc_c *other); ///< Collision callback for when the bullet was spat back out by Yoshi.

private:
dHeapAllocator_c mAllocator;
BOOL mHasSplashed;
int mDeadMoveDirection;
int mHitType;
mAng3_c mDeadRollDelta;

static const float smc_DEAD_FALL_GRAVITY;
static const float smc_DEAD_FALL_YMAXSPEED;
static const float smc_DIR_PRM[];
};
dHeapAllocator_c mAllocator; ///< The allocator.
BOOL mHasSplashed; ///< Whether the bullet has splashed in water yet.
int mHitMoveDirection; ///< The direction to travel after the bullet has been hit.
HitType_e mHitType; ///< The type of hit that the bullet has received.
mAng3_c mHitRollDelta; ///< The rotation delta to apply to the bullet each frame after it has been hit.

static const float smc_DEAD_FALL_GRAVITY; ///< The gravity to apply to a falling bullet.
static const float smc_DEAD_FALL_YMAXSPEED; ///< The maximum falling speed of a bullet.
static const float smc_DIR_PRM[]; ///< The unit direction values for left and right movement of the bullet.
};
2 changes: 1 addition & 1 deletion include/game/bases/d_a_wm_map.hpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#pragma once

#include <game/bases/d_wm_connect.hpp>
#include <game/bases/d_wm_csv_data.hpp>
#include <game/bases/d_wm_csvdata.hpp>
#include <game/bases/d_wm_demo_actor.hpp>
#include <game/bases/d_heap_allocator.hpp>
#include <game/bases/d_wm_map_model.hpp>
Expand Down
10 changes: 10 additions & 0 deletions include/game/bases/d_res_mng.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,21 @@ class dResMng_c {
return mRes.getRes(arcName, resPath);
}

/// @copydoc dRes_c::getRes(const char *, const char*, unsigned long *) const
nw4r::g3d::ResFile getRes(const char *arcName, const char *resPath, unsigned long *fileSize) const {
return mRes.getRes(arcName, resPath, fileSize);
}

/// @copydoc dRes_c::getResSilently(const char *, const char*) const
nw4r::g3d::ResFile getResSilently(const char *arcName, const char *resPath) const {
return mRes.getResSilently(arcName, resPath);
}

/// @copydoc dRes_c::getResSilently(const char *, const char*, unsigned long *) const
nw4r::g3d::ResFile getResSilently(const char *arcName, const char *resPath, unsigned long *fileSize) const {
return mRes.getResSilently(arcName, resPath, fileSize);
}

/// @copydoc dRes_c::syncAllRes()
bool syncAllRes() {
return mRes.syncAllRes();
Expand Down
21 changes: 0 additions & 21 deletions include/game/bases/d_wm_csv_data.hpp

This file was deleted.

Loading
Loading