mirror of
https://github.com/coop-deluxe/sm64coopdx.git
synced 2025-10-30 08:01:01 +00:00
Merge pull request #90 from djoslin0/unstable
Merge unstable to coop branch
This commit is contained in:
commit
c10ef56ba9
106 changed files with 1793 additions and 754 deletions
6
.gitignore
vendored
6
.gitignore
vendored
|
|
@ -85,4 +85,8 @@ sm64config.txt
|
|||
build-windows-visual-studio/.vs
|
||||
|
||||
# misc
|
||||
todo.txt
|
||||
todo.txt
|
||||
|
||||
# luigi sounds
|
||||
sound/samples/sfx_custom_luigi*/*.aiff
|
||||
|
||||
|
|
|
|||
491
3p.patch
491
3p.patch
|
|
@ -1,491 +0,0 @@
|
|||
diff --git a/build-windows-visual-studio/sm64ex.vcxproj b/build-windows-visual-studio/sm64ex.vcxproj
|
||||
index c5052b8..db836c3 100644
|
||||
--- a/build-windows-visual-studio/sm64ex.vcxproj
|
||||
+++ b/build-windows-visual-studio/sm64ex.vcxproj
|
||||
@@ -3973,6 +3973,7 @@
|
||||
<ClCompile Include="..\src\pc\network\packets\packet_keep_alive.c" />
|
||||
<ClCompile Include="..\src\pc\network\packets\packet_leaving.c" />
|
||||
<ClCompile Include="..\src\pc\network\packets\packet_level_warp.c" />
|
||||
+ <ClCompile Include="..\src\pc\network\packets\packet_network_players.c" />
|
||||
<ClCompile Include="..\src\pc\network\packets\packet_object.c" />
|
||||
<ClCompile Include="..\src\pc\network\packets\packet_player.c" />
|
||||
<ClCompile Include="..\src\pc\network\packets\packet_read_write.c" />
|
||||
diff --git a/build-windows-visual-studio/sm64ex.vcxproj.filters b/build-windows-visual-studio/sm64ex.vcxproj.filters
|
||||
index b33547f..26133b0 100644
|
||||
--- a/build-windows-visual-studio/sm64ex.vcxproj.filters
|
||||
+++ b/build-windows-visual-studio/sm64ex.vcxproj.filters
|
||||
@@ -15078,6 +15078,9 @@
|
||||
<ClCompile Include="..\src\game\rng_position.c">
|
||||
<Filter>Source Files\src\game</Filter>
|
||||
</ClCompile>
|
||||
+ <ClCompile Include="..\src\pc\network\packets\packet_network_players.c">
|
||||
+ <Filter>Source Files\src\pc\network\packets</Filter>
|
||||
+ </ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\actors\common0.h">
|
||||
diff --git a/proto-3.sh b/proto-3.sh
|
||||
new file mode 100644
|
||||
index 0000000..8f7a1bb
|
||||
--- /dev/null
|
||||
+++ b/proto-3.sh
|
||||
@@ -0,0 +1,41 @@
|
||||
+set -e
|
||||
+if [ $# -eq 0 ]; then
|
||||
+ make BETTERCAMERA=1 NODRAWINGDISTANCE=1 DEBUG=1 IMMEDIATELOAD=1 DEVELOPMENT=1 STRICT=1 -j
|
||||
+else
|
||||
+ make BETTERCAMERA=1 NODRAWINGDISTANCE=1 DEBUG=1 IMMEDIATELOAD=1 DEVELOPMENT=1 -j
|
||||
+fi
|
||||
+
|
||||
+# find file
|
||||
+FILE=./build/us_pc/sm64.us.f3dex2e.exe
|
||||
+if [ ! -f "$FILE" ]; then
|
||||
+ FILE=./build/us_pc/sm64.us.f3dex2e
|
||||
+fi
|
||||
+
|
||||
+# no debug, discord
|
||||
+#$FILE --discord 2 --configfile sm64config_server.txt &
|
||||
+#$FILE --discord 1 --configfile sm64config_client.txt &
|
||||
+#exit
|
||||
+
|
||||
+# no debug, direct
|
||||
+#$FILE --server 27015 --configfile sm64config_server.txt &
|
||||
+#$FILE --client 127.0.0.1 27015 --configfile sm64config_client.txt &
|
||||
+#exit
|
||||
+
|
||||
+# debug on server
|
||||
+#$FILE --client 127.0.0.1 27015 --configfile sm64config_client.txt &
|
||||
+#winpty cgdb $FILE -ex 'break debug_breakpoint_here' -ex 'run --server 27015 --configfile sm64config_server.txt' -ex 'quit'
|
||||
+#exit
|
||||
+
|
||||
+###################
|
||||
+# debug on client #
|
||||
+###################
|
||||
+
|
||||
+$FILE --server 27015 --configfile sm64config_p1.txt &
|
||||
+ $FILE --client 127.0.0.1 27015 --configfile sm64config_p2.txt &
|
||||
+
|
||||
+# debug if cgdb exists
|
||||
+if ! [ -x "$(command -v cgdb)" ]; then
|
||||
+ $FILE --client 127.0.0.1 27015 --configfile sm64config_p3.txt &
|
||||
+else
|
||||
+ winpty cgdb $FILE -ex 'break debug_breakpoint_here' -ex 'run --client 127.0.0.1 27015 --configfile sm64config_p3.txt' -ex 'quit'
|
||||
+fi
|
||||
diff --git a/src/engine/level_script.c b/src/engine/level_script.c
|
||||
index 7e181da..a7471b7 100644
|
||||
--- a/src/engine/level_script.c
|
||||
+++ b/src/engine/level_script.c
|
||||
@@ -664,15 +664,24 @@ static void level_cmd_unload_area(void) {
|
||||
}
|
||||
|
||||
static void level_cmd_set_mario_start_pos(void) {
|
||||
+ s8 areaIndex = CMD_GET(u8, 2);
|
||||
+#if IS_64_BIT
|
||||
+ s16 x = CMD_GET(s16, 6);
|
||||
+ s16 y = CMD_GET(s16, 8);
|
||||
+ s16 z = CMD_GET(s16, 10);
|
||||
+#else
|
||||
+ Vec3s pos = CMD_GET(Vec3s, 6);
|
||||
+#endif
|
||||
+ s16 angle = CMD_GET(s16, 4);
|
||||
for (int i = 0; i < MAX_PLAYERS; i++) {
|
||||
- gPlayerSpawnInfos[i].areaIndex = CMD_GET(u8, 2);
|
||||
-
|
||||
- #if IS_64_BIT
|
||||
- vec3s_set(gPlayerSpawnInfos[i].startPos, CMD_GET(s16, 6), CMD_GET(s16, 8), CMD_GET(s16, 10));
|
||||
- #else
|
||||
- vec3s_copy(gPlayerSpawnInfos[i].startPos, CMD_GET(Vec3s, 6));
|
||||
- #endif
|
||||
- vec3s_set(gPlayerSpawnInfos[i].startAngle, 0, CMD_GET(s16, 4) * 0x8000 / 180, 0);
|
||||
+ gPlayerSpawnInfos[i].areaIndex = areaIndex;
|
||||
+
|
||||
+#if IS_64_BIT
|
||||
+ vec3s_set(gPlayerSpawnInfos[i].startPos, x, y, z);
|
||||
+#else
|
||||
+ vec3s_copy(gPlayerSpawnInfos[i].startPos, pos);
|
||||
+#endif
|
||||
+ vec3s_set(gPlayerSpawnInfos[i].startAngle, 0, angle * 0x8000 / 180, 0);
|
||||
}
|
||||
sCurrentCmd = CMD_NEXT;
|
||||
}
|
||||
diff --git a/src/game/behavior_actions.c b/src/game/behavior_actions.c
|
||||
index 61fc8b9..0e5d070 100644
|
||||
--- a/src/game/behavior_actions.c
|
||||
+++ b/src/game/behavior_actions.c
|
||||
@@ -176,7 +176,7 @@ Gfx *geo_move_mario_part_from_parent(s32 run, UNUSED struct GraphNode *node, Mat
|
||||
|
||||
if (run == TRUE) {
|
||||
sp1C = (struct Object *) gCurGraphNodeObject;
|
||||
- if (sp1C == gMarioObject && sp1C->prevObj != NULL) {
|
||||
+ if (sp1C->behavior == bhvMario && sp1C->prevObj != NULL) {
|
||||
create_transformation_from_matrices(sp20, mtx, *gCurGraphNodeCamera->matrixPtr);
|
||||
obj_update_pos_from_parent_transformation(sp20, sp1C->prevObj);
|
||||
obj_set_gfx_pos_from_pos(sp1C->prevObj);
|
||||
diff --git a/src/game/mario.c b/src/game/mario.c
|
||||
index 09e2a09..9d6d3e7 100644
|
||||
--- a/src/game/mario.c
|
||||
+++ b/src/game/mario.c
|
||||
@@ -2124,11 +2124,7 @@ static void init_single_mario(struct MarioState* m) {
|
||||
|
||||
// set mario/luigi model
|
||||
// two-player hack
|
||||
- if (isLocal) {
|
||||
- m->marioObj->header.gfx.sharedChild = gLoadedGraphNodes[(gNetworkType == NT_SERVER) ? MODEL_MARIO : MODEL_LUIGI];
|
||||
- } else {
|
||||
- m->marioObj->header.gfx.sharedChild = gLoadedGraphNodes[(gNetworkType == NT_CLIENT) ? MODEL_MARIO : MODEL_LUIGI];
|
||||
- }
|
||||
+ m->marioObj->header.gfx.sharedChild = gLoadedGraphNodes[(gNetworkPlayers[0].globalIndex == 1) ? MODEL_LUIGI : MODEL_MARIO];
|
||||
}
|
||||
|
||||
void init_mario(void) {
|
||||
diff --git a/src/game/mario_actions_moving.c b/src/game/mario_actions_moving.c
|
||||
index 67d97a2..54b533d 100644
|
||||
--- a/src/game/mario_actions_moving.c
|
||||
+++ b/src/game/mario_actions_moving.c
|
||||
@@ -61,7 +61,7 @@ struct LandingAction sBackflipLandAction = {
|
||||
4, 0, ACT_FREEFALL, ACT_BACKFLIP_LAND_STOP, ACT_BACKFLIP, ACT_FREEFALL, ACT_BEGIN_SLIDING,
|
||||
};
|
||||
|
||||
-Mat4 sFloorAlignMatrix[2];
|
||||
+Mat4 sFloorAlignMatrix[MAX_PLAYERS];
|
||||
|
||||
s16 tilt_body_running(struct MarioState *m) {
|
||||
s16 pitch = find_floor_slope(m, 0);
|
||||
diff --git a/src/game/mario_misc.c b/src/game/mario_misc.c
|
||||
index 0c915c3..43f81eb 100644
|
||||
--- a/src/game/mario_misc.c
|
||||
+++ b/src/game/mario_misc.c
|
||||
@@ -418,7 +418,6 @@ Gfx* geo_mario_tilt_torso(s32 callContext, struct GraphNode* node, Mat4* mtx) {
|
||||
rotNode->rotation[0] = bodyState->torsoAngle[1];
|
||||
rotNode->rotation[1] = bodyState->torsoAngle[2];
|
||||
rotNode->rotation[2] = bodyState->torsoAngle[0];
|
||||
-
|
||||
// update torso position in bodyState
|
||||
get_pos_from_transform_mtx(bodyState->torsoPos, *curTransform, *gCurGraphNodeCamera->matrixPtr);
|
||||
}
|
||||
@@ -491,17 +490,18 @@ Gfx* geo_switch_mario_hand(s32 callContext, struct GraphNode* node, UNUSED Mat4*
|
||||
*/
|
||||
Gfx* geo_mario_hand_foot_scaler(s32 callContext, struct GraphNode* node, Mat4* mtx) {
|
||||
Mat4 * curTransform = mtx;
|
||||
- static s16 sMarioAttackAnimCounter = 0;
|
||||
+ static s16 sMarioAttackAnimCounter[MAX_PLAYERS] = { 0 };
|
||||
struct GraphNodeGenerated* asGenerated = (struct GraphNodeGenerated*) node;
|
||||
struct GraphNodeScale* scaleNode = (struct GraphNodeScale*) node->next;
|
||||
+ u8 index = geo_get_processing_object_index();
|
||||
struct MarioBodyState* bodyState = geo_get_body_state();
|
||||
|
||||
if (callContext == GEO_CONTEXT_RENDER) {
|
||||
scaleNode->scale = 1.0f;
|
||||
if (asGenerated->parameter == bodyState->punchState >> 6) {
|
||||
- if (sMarioAttackAnimCounter != gAreaUpdateCounter && (bodyState->punchState & 0x3F) > 0) {
|
||||
+ if (sMarioAttackAnimCounter[index] != gAreaUpdateCounter && (bodyState->punchState & 0x3F) > 0) {
|
||||
bodyState->punchState -= 1;
|
||||
- sMarioAttackAnimCounter = gAreaUpdateCounter;
|
||||
+ sMarioAttackAnimCounter[index] = gAreaUpdateCounter;
|
||||
}
|
||||
scaleNode->scale =
|
||||
gMarioAttackScaleAnimation[asGenerated->parameter * 6 + (bodyState->punchState & 0x3F)]
|
||||
@@ -510,7 +510,7 @@ Gfx* geo_mario_hand_foot_scaler(s32 callContext, struct GraphNode* node, Mat4* m
|
||||
// update hand/foot position in bodyState
|
||||
get_pos_from_transform_mtx(bodyState->handFootPos[(asGenerated->parameter & 0x03)],
|
||||
*curTransform,
|
||||
- *gCurGraphNodeCamera->matrixPtr);
|
||||
+ *gCurGraphNodeCamera->matrixPtr);
|
||||
|
||||
}
|
||||
return NULL;
|
||||
diff --git a/src/game/object_list_processor.c b/src/game/object_list_processor.c
|
||||
index d0bb984..1b3c33f 100644
|
||||
--- a/src/game/object_list_processor.c
|
||||
+++ b/src/game/object_list_processor.c
|
||||
@@ -516,7 +516,9 @@ void spawn_objects_from_info(UNUSED s32 unused, struct SpawnInfo *spawnInfo) {
|
||||
u16 playerIndex = (spawnInfo->behaviorArg & ~(1 << 31));
|
||||
object->oBehParams = playerIndex + 1;
|
||||
gMarioObjects[playerIndex] = object;
|
||||
- if (playerIndex == 0) { gMarioObject = object; }
|
||||
+ if (playerIndex == 0) {
|
||||
+ gMarioObject = object;
|
||||
+ }
|
||||
geo_make_first_child(&object->header.gfx.node);
|
||||
}
|
||||
|
||||
diff --git a/src/game/rendering_graph_node.c b/src/game/rendering_graph_node.c
|
||||
index a511ac5..ed7f13e 100644
|
||||
--- a/src/game/rendering_graph_node.c
|
||||
+++ b/src/game/rendering_graph_node.c
|
||||
@@ -1068,6 +1068,7 @@ static void interpolate_matrix(Mat4 result, Mat4 a, Mat4 b) {
|
||||
* Process an object node.
|
||||
*/
|
||||
static void geo_process_object(struct Object *node) {
|
||||
+ struct Object* lastProcessingObject = gCurGraphNodeProcessingObject;
|
||||
gCurGraphNodeProcessingObject = node;
|
||||
Mat4 mtxf;
|
||||
s32 hasAnimation = (node->header.gfx.node.flags & GRAPH_RENDER_HAS_ANIMATION) != 0;
|
||||
@@ -1192,7 +1193,7 @@ static void geo_process_object(struct Object *node) {
|
||||
node->header.gfx.throwMatrix = NULL;
|
||||
node->header.gfx.throwMatrixInterpolated = NULL;
|
||||
}
|
||||
- gCurGraphNodeProcessingObject = NULL;
|
||||
+ gCurGraphNodeProcessingObject = lastProcessingObject;
|
||||
}
|
||||
|
||||
/**
|
||||
diff --git a/src/pc/network/discord/discord.c b/src/pc/network/discord/discord.c
|
||||
index 7c30fc0..06a333f 100644
|
||||
--- a/src/pc/network/discord/discord.c
|
||||
+++ b/src/pc/network/discord/discord.c
|
||||
@@ -121,10 +121,11 @@ static void ns_discord_shutdown(void) {
|
||||
}
|
||||
|
||||
struct NetworkSystem gNetworkSystemDiscord = {
|
||||
- .initialize = ns_discord_initialize,
|
||||
- .save_id = ns_discord_save_id,
|
||||
- .clear_id = ns_discord_clear_id,
|
||||
- .update = ns_discord_update,
|
||||
- .send = ns_discord_network_send,
|
||||
- .shutdown = ns_discord_shutdown,
|
||||
+ .initialize = ns_discord_initialize,
|
||||
+ .save_id = ns_discord_save_id,
|
||||
+ .clear_id = ns_discord_clear_id,
|
||||
+ .update = ns_discord_update,
|
||||
+ .send = ns_discord_network_send,
|
||||
+ .shutdown = ns_discord_shutdown,
|
||||
+ .canBroadcast = true,
|
||||
};
|
||||
diff --git a/src/pc/network/network.h b/src/pc/network/network.h
|
||||
index de287b2..5318630 100644
|
||||
--- a/src/pc/network/network.h
|
||||
+++ b/src/pc/network/network.h
|
||||
@@ -38,6 +38,7 @@ struct NetworkSystem {
|
||||
void (*update)(void);
|
||||
int (*send)(u8 localIndex, u8* data, u16 dataLength);
|
||||
void (*shutdown)(void);
|
||||
+ bool canBroadcast;
|
||||
};
|
||||
|
||||
struct SyncObject {
|
||||
diff --git a/src/pc/network/network_player.c b/src/pc/network/network_player.c
|
||||
index 4dc4442..2734d50 100644
|
||||
--- a/src/pc/network/network_player.c
|
||||
+++ b/src/pc/network/network_player.c
|
||||
@@ -103,7 +103,7 @@ u8 network_player_connected(enum NetworkPlayerType type, u8 globalIndex) {
|
||||
gNetworkSystem->save_id(i);
|
||||
if (type == NPT_SERVER) { gNetworkPlayerServer = np; }
|
||||
else { chat_add_message("player connected", CMT_SYSTEM); }
|
||||
- LOG_INFO("player connected, local %d, global %d", i, globalIndex);
|
||||
+ LOG_INFO("player connected, local %d, global %d", i, np->globalIndex);
|
||||
extern s16 sCurrPlayMode;
|
||||
if (gNetworkType == NT_SERVER && sCurrPlayMode == PLAY_MODE_SYNC_LEVEL) {
|
||||
network_send_level_warp_repeat();
|
||||
diff --git a/src/pc/network/packets/packet.c b/src/pc/network/packets/packet.c
|
||||
index 1dc9b0b..1ad776c 100644
|
||||
--- a/src/pc/network/packets/packet.c
|
||||
+++ b/src/pc/network/packets/packet.c
|
||||
@@ -39,6 +39,7 @@ void packet_receive(struct Packet* p) {
|
||||
case PACKET_LEAVING: network_receive_leaving(p); break;
|
||||
case PACKET_SAVE_FILE: network_receive_save_file(p); break;
|
||||
case PACKET_INSTANT_WARP: network_receive_instant_warp(p); break;
|
||||
+ case PACKET_NETWORK_PLAYERS: network_receive_network_players(p); break;
|
||||
///
|
||||
case PACKET_CUSTOM: network_receive_custom(p); break;
|
||||
default: LOG_ERROR("received unknown packet: %d", p->buffer[0]);
|
||||
diff --git a/src/pc/network/packets/packet.h b/src/pc/network/packets/packet.h
|
||||
index 5d91805..126afd5 100644
|
||||
--- a/src/pc/network/packets/packet.h
|
||||
+++ b/src/pc/network/packets/packet.h
|
||||
@@ -31,6 +31,7 @@ enum PacketType {
|
||||
PACKET_LEAVING,
|
||||
PACKET_SAVE_FILE,
|
||||
PACKET_INSTANT_WARP,
|
||||
+ PACKET_NETWORK_PLAYERS,
|
||||
///
|
||||
PACKET_CUSTOM = 255,
|
||||
};
|
||||
@@ -159,4 +160,8 @@ void network_receive_save_file(struct Packet* p);
|
||||
void network_send_instant_warp(void);
|
||||
void network_receive_instant_warp(struct Packet* p);
|
||||
|
||||
+// packet_network_players.c
|
||||
+void network_send_network_players(void);
|
||||
+void network_receive_network_players(struct Packet* p);
|
||||
+
|
||||
#endif
|
||||
diff --git a/src/pc/network/packets/packet_join.c b/src/pc/network/packets/packet_join.c
|
||||
index bc9da5b..a51ce6a 100644
|
||||
--- a/src/pc/network/packets/packet_join.c
|
||||
+++ b/src/pc/network/packets/packet_join.c
|
||||
@@ -75,8 +75,9 @@ void network_send_join(struct Packet* joinRequestPacket) {
|
||||
}
|
||||
|
||||
network_send_to(joinRequestPacket->localIndex , &p);
|
||||
-
|
||||
LOG_INFO("sending join packet");
|
||||
+
|
||||
+ network_send_network_players();
|
||||
}
|
||||
|
||||
void network_receive_join(struct Packet* p) {
|
||||
diff --git a/src/pc/network/packets/packet_network_players.c b/src/pc/network/packets/packet_network_players.c
|
||||
new file mode 100644
|
||||
index 0000000..eb599fb
|
||||
--- /dev/null
|
||||
+++ b/src/pc/network/packets/packet_network_players.c
|
||||
@@ -0,0 +1,55 @@
|
||||
+#include <stdio.h>
|
||||
+#include "../network.h"
|
||||
+#include "object_fields.h"
|
||||
+#include "behavior_data.h"
|
||||
+#include "src/game/behavior_actions.h"
|
||||
+#include "pc/debuglog.h"
|
||||
+
|
||||
+static void network_send_to_network_players(u8 sendToLocalIndex) {
|
||||
+ assert(gNetworkType == NT_SERVER);
|
||||
+ assert(sendToLocalIndex != 0);
|
||||
+
|
||||
+ u8 connectedCount = network_player_connected_count();
|
||||
+
|
||||
+ struct Packet p;
|
||||
+ packet_init(&p, PACKET_NETWORK_PLAYERS, true, false);
|
||||
+ packet_write(&p, &connectedCount, sizeof(u8));
|
||||
+ for (int i = 1; i < MAX_PLAYERS; i++) {
|
||||
+ if (!gNetworkPlayers[i].connected) { continue; }
|
||||
+ u8 npType = gNetworkPlayers[i].type;
|
||||
+ if (npType == NPT_LOCAL) { npType = NPT_SERVER; }
|
||||
+ else if (i == sendToLocalIndex) { npType = NPT_LOCAL; }
|
||||
+ packet_write(&p, &npType, sizeof(u8));
|
||||
+ packet_write(&p, &gNetworkPlayers[i].globalIndex, sizeof(u8));
|
||||
+ LOG_INFO("send network player [%d == %d]", gNetworkPlayers[i].globalIndex, npType);
|
||||
+ }
|
||||
+
|
||||
+ network_send_to(sendToLocalIndex, &p);
|
||||
+ LOG_INFO("sent list of %d network players to %d", connectedCount, sendToLocalIndex);
|
||||
+}
|
||||
+
|
||||
+void network_send_network_players(void) {
|
||||
+ assert(gNetworkType == NT_SERVER);
|
||||
+ LOG_INFO("sending list of network players to all");
|
||||
+ for (int i = 1; i < MAX_PLAYERS; i++) {
|
||||
+ if (!gNetworkPlayers[i].connected) { continue; }
|
||||
+ network_send_to_network_players(i);
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+void network_receive_network_players(struct Packet* p) {
|
||||
+ LOG_INFO("receiving list of network players");
|
||||
+ if (gNetworkType != NT_CLIENT) {
|
||||
+ LOG_ERROR("received list of clients as a non-client");
|
||||
+ return;
|
||||
+ }
|
||||
+ u8 connectedCount = 0;
|
||||
+ packet_read(p, &connectedCount, sizeof(u8));
|
||||
+ for (int i = 0; i < connectedCount; i++) {
|
||||
+ u8 npType, globalIndex;
|
||||
+ packet_read(p, &npType, sizeof(u8));
|
||||
+ packet_read(p, &globalIndex, sizeof(u8));
|
||||
+ network_player_connected(npType, globalIndex);
|
||||
+ LOG_INFO("received network player [%d == %d]", globalIndex, npType);
|
||||
+ }
|
||||
+}
|
||||
\ No newline at end of file
|
||||
diff --git a/src/pc/network/packets/packet_player.c b/src/pc/network/packets/packet_player.c
|
||||
index 8a117ea..90dfea9 100644
|
||||
--- a/src/pc/network/packets/packet_player.c
|
||||
+++ b/src/pc/network/packets/packet_player.c
|
||||
@@ -154,26 +154,33 @@ static void write_packet_data(struct PacketPlayerData* data, struct MarioState*
|
||||
*platformSyncID = data->platformSyncID;
|
||||
}
|
||||
|
||||
-void network_send_player(void) {
|
||||
- if (gMarioStates[0].marioObj == NULL) { return; }
|
||||
+void network_send_player(u8 localIndex) {
|
||||
+ if (gMarioStates[localIndex].marioObj == NULL) { return; }
|
||||
|
||||
struct PacketPlayerData data = { 0 };
|
||||
- read_packet_data(&data, &gMarioStates[0]);
|
||||
+ read_packet_data(&data, &gMarioStates[localIndex]);
|
||||
|
||||
struct Packet p;
|
||||
packet_init(&p, PACKET_PLAYER, false, false);
|
||||
+ packet_write(&p, &gNetworkPlayers[localIndex].globalIndex, sizeof(u8));
|
||||
packet_write(&p, &data, sizeof(struct PacketPlayerData));
|
||||
+ // two-player hack: should be network_send_to_all_except()
|
||||
network_send(&p);
|
||||
}
|
||||
|
||||
void network_receive_player(struct Packet* p) {
|
||||
- struct MarioState* m = &gMarioStates[1];
|
||||
+ u8 globalIndex = 0;
|
||||
+ packet_read(p, &globalIndex, sizeof(u8));
|
||||
+ struct NetworkPlayer* np = network_player_from_global_index(globalIndex);
|
||||
+ if (np == NULL || np->localIndex == UNKNOWN_LOCAL_INDEX || !np->connected) { return; }
|
||||
+
|
||||
+ struct MarioState* m = &gMarioStates[np->localIndex];
|
||||
if (m == NULL || m->marioObj == NULL) { return; }
|
||||
|
||||
// save previous state
|
||||
struct PacketPlayerData oldData = { 0 };
|
||||
read_packet_data(&oldData, m);
|
||||
- u16 playerIndex = m->playerIndex;
|
||||
+ u16 playerIndex = np->localIndex;
|
||||
u32 oldBehParams = m->marioObj->oBehParams;
|
||||
|
||||
// load mario information from packet
|
||||
@@ -187,14 +194,10 @@ void network_receive_player(struct Packet* p) {
|
||||
|
||||
// check player level/area
|
||||
u8 levelAreaMismatch = TRUE;
|
||||
- if (p->localIndex != UNKNOWN_LOCAL_INDEX) {
|
||||
- struct NetworkPlayer* np = &gNetworkPlayers[p->localIndex];
|
||||
- np->currLevelNum = data.currLevelNum;
|
||||
- np->currAreaIndex = data.currAreaIndex;
|
||||
- levelAreaMismatch = (data.currLevelNum != gCurrLevelNum || data.currAreaIndex != gCurrAreaIndex);
|
||||
- if (levelAreaMismatch) { np->fadeOpacity = 0; }
|
||||
- }
|
||||
- if (levelAreaMismatch) { return; }
|
||||
+ np->currLevelNum = data.currLevelNum;
|
||||
+ np->currAreaIndex = data.currAreaIndex;
|
||||
+ levelAreaMismatch = (data.currLevelNum != gCurrLevelNum || data.currAreaIndex != gCurrAreaIndex);
|
||||
+ if (levelAreaMismatch) { np->fadeOpacity = 0; return; }
|
||||
|
||||
// apply data from packet to mario state
|
||||
u8 heldSyncID = 0;
|
||||
@@ -301,8 +304,16 @@ void network_receive_player(struct Packet* p) {
|
||||
if (m->action != oldData.action) {
|
||||
m->actionTimer = 0;
|
||||
}
|
||||
+
|
||||
+ // set model
|
||||
+ m->marioObj->header.gfx.sharedChild = gLoadedGraphNodes[(np->globalIndex == 1) ? MODEL_LUIGI : MODEL_MARIO];
|
||||
+
|
||||
+ // broadcast player packet
|
||||
+ if (gNetworkType == NT_SERVER && !gNetworkSystem->canBroadcast) {
|
||||
+ network_send_player(globalIndex);
|
||||
+ }
|
||||
}
|
||||
|
||||
void network_update_player(void) {
|
||||
- network_send_player();
|
||||
+ network_send_player(0);
|
||||
}
|
||||
diff --git a/src/pc/network/socket/socket.c b/src/pc/network/socket/socket.c
|
||||
index 6ede2e9..6f81165 100644
|
||||
--- a/src/pc/network/socket/socket.c
|
||||
+++ b/src/pc/network/socket/socket.c
|
||||
@@ -138,10 +138,11 @@ static void ns_socket_shutdown(void) {
|
||||
}
|
||||
|
||||
struct NetworkSystem gNetworkSystemSocket = {
|
||||
- .initialize = ns_socket_initialize,
|
||||
- .save_id = ns_socket_save_id,
|
||||
- .clear_id = ns_socket_clear_id,
|
||||
- .update = ns_socket_update,
|
||||
- .send = ns_socket_send,
|
||||
- .shutdown = ns_socket_shutdown,
|
||||
+ .initialize = ns_socket_initialize,
|
||||
+ .save_id = ns_socket_save_id,
|
||||
+ .clear_id = ns_socket_clear_id,
|
||||
+ .update = ns_socket_update,
|
||||
+ .send = ns_socket_send,
|
||||
+ .shutdown = ns_socket_shutdown,
|
||||
+ .canBroadcast = false,
|
||||
};
|
||||
20
Makefile
20
Makefile
|
|
@ -41,7 +41,7 @@ BETTERCAMERA ?= 1
|
|||
# Enable no drawing distance by default
|
||||
NODRAWINGDISTANCE ?= 1
|
||||
# Disable texture fixes by default (helps with them purists)
|
||||
TEXTURE_FIX ?= 0
|
||||
TEXTURE_FIX ?= 1
|
||||
# Enable extended options menu by default
|
||||
EXT_OPTIONS_MENU ?= 1
|
||||
# Disable text-based save-files by default
|
||||
|
|
@ -136,19 +136,22 @@ endif
|
|||
# Release (version) flag defs
|
||||
|
||||
ifeq ($(VERSION),jp)
|
||||
VERSION_DEF := VERSION_JP
|
||||
//VERSION_DEF := VERSION_JP
|
||||
$(error JP ROM is incompatible with sm64ex-coop at this time)
|
||||
else
|
||||
ifeq ($(VERSION),us)
|
||||
VERSION_DEF := VERSION_US
|
||||
else
|
||||
ifeq ($(VERSION),eu)
|
||||
VERSION_DEF := VERSION_EU
|
||||
//VERSION_DEF := VERSION_EU
|
||||
$(error EU ROM is incompatible with sm64ex-coop at this time)
|
||||
else
|
||||
ifeq ($(VERSION),sh)
|
||||
$(warning Building SH is experimental and is prone to breaking. Try at your own risk.)
|
||||
VERSION_DEF := VERSION_SH
|
||||
//$(warning Building SH is experimental and is prone to breaking. Try at your own risk.)
|
||||
//VERSION_DEF := VERSION_SH
|
||||
# TODO: GET RID OF THIS!!! We should mandate assets for Shindou like EU but we dont have the addresses extracted yet so we'll just pretend you have everything extracted for now.
|
||||
NOEXTRACT := 1
|
||||
//NOEXTRACT := 1
|
||||
$(error Shindou ROM is incompatible with sm64ex-coop at this time)
|
||||
else
|
||||
$(error unknown version "$(VERSION)")
|
||||
endif
|
||||
|
|
@ -259,6 +262,11 @@ ifeq ($(DUMMY),FAIL)
|
|||
endif
|
||||
endif
|
||||
|
||||
# Copy missing luigi sounds from mario sound banks
|
||||
$(shell mkdir -p sound/samples/sfx_custom_luigi sound/samples/sfx_custom_luigi_peach )
|
||||
$(shell cp -n sound/samples/sfx_mario/*.aiff sound/samples/sfx_custom_luigi/ )
|
||||
$(shell cp -n sound/samples/sfx_mario_peach/*.aiff sound/samples/sfx_custom_luigi_peach/ )
|
||||
|
||||
# Make tools if out of date
|
||||
DUMMY != make -C tools >&2 || echo FAIL
|
||||
ifeq ($(DUMMY),FAIL)
|
||||
|
|
|
|||
|
|
@ -54,6 +54,9 @@ UNUSED static const u64 binid_11 = 11;
|
|||
#include "mario_cap/model.inc.c"
|
||||
UNUSED static const u64 binid_12 = 12;
|
||||
|
||||
// luigi_cap
|
||||
#include "luigi_cap/model.inc.c"
|
||||
|
||||
#include "power_meter/model.inc.c"
|
||||
UNUSED static const u64 binid_13 = 13;
|
||||
|
||||
|
|
@ -82,4 +85,4 @@ UNUSED static const u64 binid_20 = 20;
|
|||
UNUSED static const u64 binid_21 = 21;
|
||||
|
||||
#include "tree/model.inc.c"
|
||||
UNUSED static const u64 binid_22 = 22;
|
||||
UNUSED static const u64 binid_22 = 22;
|
||||
|
|
@ -172,6 +172,27 @@ extern const Gfx mario_cap_seg3_dl_03023108[];
|
|||
extern const Gfx mario_cap_seg3_dl_03023160[];
|
||||
extern const Gfx mario_cap_seg3_dl_03023298[];
|
||||
|
||||
// luigi_cap
|
||||
|
||||
extern const GeoLayout luigis_cap_geo[];
|
||||
//extern const GeoLayout luigis_metal_cap_geo[];
|
||||
//extern const GeoLayout luigis_wing_cap_geo[];
|
||||
//extern const GeoLayout luigis_winged_metal_cap_geo[];
|
||||
extern const Gfx luigi_cap_seg3_dl_03022B30[];
|
||||
extern const Gfx luigi_cap_seg3_dl_03022B68[];
|
||||
extern const Gfx luigi_cap_seg3_dl_03022CC8[];
|
||||
extern const Gfx luigi_cap_seg3_dl_03022D10[];
|
||||
extern const Gfx luigi_cap_seg3_dl_03022E78[];
|
||||
extern const Gfx luigi_cap_seg3_dl_03022EA8[];
|
||||
extern const Gfx luigi_cap_seg3_dl_03022ED8[];
|
||||
extern const Gfx luigi_cap_seg3_dl_03022F20[];
|
||||
extern const Gfx luigi_cap_seg3_dl_03022F48[];
|
||||
extern const Gfx luigi_cap_seg3_dl_03022FF8[];
|
||||
extern const Gfx luigi_cap_seg3_dl_030230B0[];
|
||||
extern const Gfx luigi_cap_seg3_dl_03023108[];
|
||||
extern const Gfx luigi_cap_seg3_dl_03023160[];
|
||||
extern const Gfx luigi_cap_seg3_dl_03023298[];
|
||||
|
||||
// mist
|
||||
extern const GeoLayout mist_geo[];
|
||||
extern const GeoLayout white_puff_geo[];
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@
|
|||
#include "blue_fish/geo.inc.c"
|
||||
#include "leaves/geo.inc.c"
|
||||
#include "mario_cap/geo.inc.c"
|
||||
#include "luigi_cap/geo.inc.c" // custom luigi_cap
|
||||
#include "number/geo.inc.c"
|
||||
#include "mushroom_1up/geo.inc.c"
|
||||
#include "star/geo.inc.c"
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ const GeoLayout klepto_geo[] = {
|
|||
GEO_ANIMATED_PART(LAYER_OPAQUE, 0, 0, 0, NULL),
|
||||
GEO_ANIMATED_PART(LAYER_OPAQUE, 0, 0, 0, NULL),
|
||||
GEO_OPEN_NODE(),
|
||||
GEO_SWITCH_CASE(4, geo_switch_anim_state),
|
||||
GEO_SWITCH_CASE(5, geo_switch_anim_state),
|
||||
GEO_OPEN_NODE(),
|
||||
GEO_NODE_START(),
|
||||
GEO_NODE_START(),
|
||||
|
|
@ -53,6 +53,14 @@ const GeoLayout klepto_geo[] = {
|
|||
GEO_TRANSLATE_ROTATE_WITH_DL(LAYER_OPAQUE, 0, 100, 0, 180, 270, 0, transparent_star_seg3_dl_0302C620),
|
||||
GEO_CLOSE_NODE(),
|
||||
GEO_CLOSE_NODE(),
|
||||
GEO_NODE_START(),
|
||||
GEO_OPEN_NODE(),
|
||||
GEO_SCALE(0x00, 16384),
|
||||
GEO_OPEN_NODE(),
|
||||
GEO_ASM(0, geo_offset_klepto_held_object),
|
||||
GEO_TRANSLATE_ROTATE_WITH_DL(LAYER_OPAQUE, 0, 100, 0, 180, 270, 0, luigi_cap_seg3_dl_03022F48),
|
||||
GEO_CLOSE_NODE(),
|
||||
GEO_CLOSE_NODE(),
|
||||
GEO_CLOSE_NODE(),
|
||||
GEO_CLOSE_NODE(),
|
||||
GEO_CLOSE_NODE(),
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ const GeoLayout ukiki_geo[] = {
|
|||
GEO_OPEN_NODE(),
|
||||
GEO_ANIMATED_PART(LAYER_OPAQUE, 0, 99, -11, NULL),
|
||||
GEO_OPEN_NODE(),
|
||||
GEO_SWITCH_CASE(4, geo_switch_anim_state),
|
||||
GEO_SWITCH_CASE(5, geo_switch_anim_state),
|
||||
GEO_OPEN_NODE(),
|
||||
GEO_NODE_START(),
|
||||
GEO_OPEN_NODE(),
|
||||
|
|
@ -32,6 +32,13 @@ const GeoLayout ukiki_geo[] = {
|
|||
GEO_TRANSLATE_ROTATE_WITH_DL(LAYER_OPAQUE, 100, 0, 0, -90, -90, 0, mario_cap_seg3_dl_03022F48),
|
||||
GEO_CLOSE_NODE(),
|
||||
GEO_CLOSE_NODE(),
|
||||
GEO_NODE_START(),
|
||||
GEO_OPEN_NODE(),
|
||||
GEO_ANIMATED_PART(LAYER_OPAQUE, 0, 0, 0, ukiki_seg5_dl_0500B2E8),
|
||||
GEO_OPEN_NODE(),
|
||||
GEO_TRANSLATE_ROTATE_WITH_DL(LAYER_OPAQUE, 100, 0, 0, -90, -90, 0, luigi_cap_seg3_dl_03022F48),
|
||||
GEO_CLOSE_NODE(),
|
||||
GEO_CLOSE_NODE(),
|
||||
GEO_CLOSE_NODE(),
|
||||
GEO_CLOSE_NODE(),
|
||||
GEO_ANIMATED_PART(LAYER_OPAQUE, 71, 69, -9, NULL),
|
||||
|
|
|
|||
|
|
@ -4327,6 +4327,7 @@
|
|||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\include\behavior_table.h" />
|
||||
<ClInclude Include="..\include\luigi_audio_defines.h" />
|
||||
<ClInclude Include="..\src\game\characters.h" />
|
||||
<ClInclude Include="..\src\game\chat.h" />
|
||||
<ClInclude Include="..\src\game\rng_position.h" />
|
||||
|
|
@ -4334,6 +4335,7 @@
|
|||
<ClInclude Include="..\src\menu\custom_menu_system.h" />
|
||||
<ClInclude Include="..\src\pc\controller\controller_keyboard_debug.h" />
|
||||
<ClInclude Include="..\src\pc\debuglog.h" />
|
||||
<ClInclude Include="..\src\pc\network\branch.h" />
|
||||
<ClInclude Include="..\src\pc\network\discord\activity.h" />
|
||||
<ClInclude Include="..\src\pc\network\discord\discord.h" />
|
||||
<ClInclude Include="..\src\pc\network\discord\discord_game_sdk.h" />
|
||||
|
|
|
|||
|
|
@ -16051,5 +16051,11 @@
|
|||
<ClInclude Include="..\src\game\characters.h">
|
||||
<Filter>Header Files\src\game</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\src\pc\network\branch.h">
|
||||
<Filter>Header Files\src\pc\network</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\include\luigi_audio_defines.h">
|
||||
<Filter>Header Files\include</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
|
@ -1 +1,2 @@
|
|||
#!/bin/bash
|
||||
make BETTERCAMERA=1 NODRAWINGDISTANCE=1 DEBUG=1 IMMEDIATELOAD=1 DEVELOPMENT=1 STRICT=1 && winpty cgdb ./build/us_pc/sm64.us.f3dex2e.exe -ex 'break debug_breakpoint_here' -ex 'run' -ex 'quit'
|
||||
|
|
@ -1 +1,2 @@
|
|||
#!/bin/bash
|
||||
make BETTERCAMERA=1 NODRAWINGDISTANCE=1 DEBUG=1 IMMEDIATELOAD=1 DEVELOPMENT=1 STRICT=1 && winpty cgdb ./build/us_pc/sm64.us.f3dex2e.exe -ex 'break debug_breakpoint_here'
|
||||
18
developer/discord.sh
Normal file
18
developer/discord.sh
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
#!/bin/bash
|
||||
set -e
|
||||
if [ $# -eq 0 ]; then
|
||||
make BETTERCAMERA=1 NODRAWINGDISTANCE=1 DEBUG=1 IMMEDIATELOAD=1 DEVELOPMENT=1 STRICT=1 -j
|
||||
else
|
||||
make BETTERCAMERA=1 NODRAWINGDISTANCE=1 DEBUG=1 IMMEDIATELOAD=1 DEVELOPMENT=1 -j
|
||||
fi
|
||||
|
||||
# find file
|
||||
FILE=./build/us_pc/sm64.us.f3dex2e.exe
|
||||
if [ ! -f "$FILE" ]; then
|
||||
FILE=./build/us_pc/sm64.us.f3dex2e
|
||||
fi
|
||||
|
||||
# no debug, discord
|
||||
$FILE --discord 2 --configfile sm64config_server.txt &
|
||||
$FILE --discord 1 --configfile sm64config_client.txt &
|
||||
exit
|
||||
|
|
@ -1,3 +1,4 @@
|
|||
#!/bin/bash
|
||||
set -e
|
||||
if [ $# -eq 0 ]; then
|
||||
make BETTERCAMERA=1 NODRAWINGDISTANCE=1 DEBUG=1 IMMEDIATELOAD=1 DEVELOPMENT=1 STRICT=1 -j
|
||||
|
|
@ -30,11 +31,11 @@ fi
|
|||
# debug on client #
|
||||
###################
|
||||
|
||||
$FILE --server 27015 --configfile sm64config_server.txt &
|
||||
$FILE --server 27015 --configfile sm64config_server.txt &
|
||||
|
||||
# debug if cgdb exists
|
||||
if ! [ -x "$(command -v cgdb)" ]; then
|
||||
$FILE --client 127.0.0.1 27015 --configfile sm64config_client.txt &
|
||||
$FILE --client 127.0.0.1 27015 --configfile sm64config_client.txt &
|
||||
else
|
||||
winpty cgdb $FILE -ex 'break debug_breakpoint_here' -ex 'run --client 127.0.0.1 27015 --configfile sm64config_client.txt' -ex 'quit'
|
||||
fi
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
#!/bin/bash
|
||||
set -e
|
||||
if [ $# -eq 0 ]; then
|
||||
make BETTERCAMERA=1 NODRAWINGDISTANCE=1 DEBUG=1 IMMEDIATELOAD=1 DEVELOPMENT=1 STRICT=1 -j
|
||||
|
|
|
|||
|
|
@ -11,6 +11,8 @@
|
|||
#define SOUND_ARG_LOAD(bank, playFlags, soundID, priority, flags2) (((u32) (bank) << 28) | \
|
||||
((u32) (playFlags) << 24) | ((u32) (soundID) << 16) | ((u32) (priority) << 8) | \
|
||||
((u32) (flags2) << 4) | SOUND_STATUS_STARTING)
|
||||
|
||||
#include "luigi_audio_defines.h"
|
||||
|
||||
#define SOUNDARGS_MASK_BANK 0xF0000000
|
||||
#define SOUNDARGS_MASK_SOUNDID 0x00FF0000
|
||||
|
|
|
|||
57
include/luigi_audio_defines.h
Normal file
57
include/luigi_audio_defines.h
Normal file
|
|
@ -0,0 +1,57 @@
|
|||
#ifndef LUIGI_AUDIO_DEFINES_H
|
||||
#define LUIGI_AUDIO_DEFINES_H
|
||||
|
||||
/* Mario Sound Effects */
|
||||
// A random number 0-2 is added to the sound ID before playing, producing Yah/Wah/Hoo
|
||||
#define SOUND_LUIGI_YAH_WAH_HOO SOUND_ARG_LOAD(0x0A, 4, 0x00, 0x80, 8)
|
||||
#define SOUND_LUIGI_HOOHOO SOUND_ARG_LOAD(0x0A, 4, 0x03, 0x80, 8)
|
||||
#define SOUND_LUIGI_YAHOO SOUND_ARG_LOAD(0x0A, 4, 0x04, 0x80, 8)
|
||||
#define SOUND_LUIGI_UH SOUND_ARG_LOAD(0x0A, 4, 0x05, 0x80, 8)
|
||||
#define SOUND_LUIGI_HRMM SOUND_ARG_LOAD(0x0A, 4, 0x06, 0x80, 8)
|
||||
#define SOUND_LUIGI_WAH2 SOUND_ARG_LOAD(0x0A, 4, 0x07, 0x80, 8)
|
||||
#define SOUND_LUIGI_WHOA SOUND_ARG_LOAD(0x0A, 4, 0x08, 0xC0, 8)
|
||||
#define SOUND_LUIGI_EEUH SOUND_ARG_LOAD(0x0A, 4, 0x09, 0x80, 8)
|
||||
#define SOUND_LUIGI_ATTACKED SOUND_ARG_LOAD(0x0A, 4, 0x0A, 0xFF, 8)
|
||||
#define SOUND_LUIGI_OOOF SOUND_ARG_LOAD(0x0A, 4, 0x0B, 0x80, 8)
|
||||
#define SOUND_LUIGI_OOOF2 SOUND_ARG_LOAD(0x0A, 4, 0x0B, 0xD0, 8)
|
||||
#define SOUND_LUIGI_HERE_WE_GO SOUND_ARG_LOAD(0x0A, 4, 0x0C, 0x80, 8)
|
||||
#define SOUND_LUIGI_YAWNING SOUND_ARG_LOAD(0x0A, 4, 0x0D, 0x80, 8)
|
||||
#define SOUND_LUIGI_SNORING1 SOUND_ARG_LOAD(0x0A, 4, 0x0E, 0x80, 8)
|
||||
#define SOUND_LUIGI_SNORING2 SOUND_ARG_LOAD(0x0A, 4, 0x0F, 0x80, 8)
|
||||
#define SOUND_LUIGI_WAAAOOOW SOUND_ARG_LOAD(0x0A, 4, 0x10, 0xC0, 8)
|
||||
#define SOUND_LUIGI_HAHA SOUND_ARG_LOAD(0x0A, 4, 0x11, 0x80, 8)
|
||||
#define SOUND_LUIGI_HAHA_2 SOUND_ARG_LOAD(0x0A, 4, 0x11, 0xF0, 8)
|
||||
#define SOUND_LUIGI_UH2 SOUND_ARG_LOAD(0x0A, 4, 0x13, 0xD0, 8)
|
||||
#define SOUND_LUIGI_UH2_2 SOUND_ARG_LOAD(0x0A, 4, 0x13, 0x80, 8)
|
||||
#define SOUND_LUIGI_ON_FIRE SOUND_ARG_LOAD(0x0A, 4, 0x14, 0xA0, 8)
|
||||
#define SOUND_LUIGI_DYING SOUND_ARG_LOAD(0x0A, 4, 0x15, 0xFF, 8)
|
||||
#define SOUND_LUIGI_PANTING_COLD SOUND_ARG_LOAD(0x0A, 4, 0x16, 0x80, 8)
|
||||
|
||||
// A random number 0-2 is added to the sound ID before playing
|
||||
#define SOUND_LUIGI_PANTING SOUND_ARG_LOAD(0x0A, 4, 0x18, 0x80, 8)
|
||||
|
||||
#define SOUND_LUIGI_COUGHING1 SOUND_ARG_LOAD(0x0A, 4, 0x1B, 0x80, 8)
|
||||
#define SOUND_LUIGI_COUGHING2 SOUND_ARG_LOAD(0x0A, 4, 0x1C, 0x80, 8)
|
||||
#define SOUND_LUIGI_COUGHING3 SOUND_ARG_LOAD(0x0A, 4, 0x1D, 0x80, 8)
|
||||
#define SOUND_LUIGI_PUNCH_YAH SOUND_ARG_LOAD(0x0A, 4, 0x1E, 0x80, 8)
|
||||
#define SOUND_LUIGI_PUNCH_HOO SOUND_ARG_LOAD(0x0A, 4, 0x1F, 0x80, 8)
|
||||
#define SOUND_LUIGI_MAMA_MIA SOUND_ARG_LOAD(0x0A, 4, 0x20, 0x80, 8)
|
||||
//#define SOUND_LUIGI_OKEY_DOKEY 0x2021
|
||||
#define SOUND_LUIGI_GROUND_POUND_WAH SOUND_ARG_LOAD(0x0A, 4, 0x22, 0x80, 8)
|
||||
#define SOUND_LUIGI_DROWNING SOUND_ARG_LOAD(0x0A, 4, 0x23, 0xF0, 8)
|
||||
#define SOUND_LUIGI_PUNCH_WAH SOUND_ARG_LOAD(0x0A, 4, 0x24, 0x80, 8)
|
||||
|
||||
// A random number 0-4 is added to the sound ID before playing, producing one of
|
||||
// Yahoo! (60% chance), Waha! (20%), or Yippee! (20%).
|
||||
#define SOUND_LUIGI_YAHOO_WAHA_YIPPEE SOUND_ARG_LOAD(0x0A, 4, 0x2B, 0x80, 8)
|
||||
|
||||
#define SOUND_LUIGI_DOH SOUND_ARG_LOAD(0x0A, 4, 0x30, 0x80, 8)
|
||||
#define SOUND_LUIGI_GAME_OVER SOUND_ARG_LOAD(0x0A, 4, 0x31, 0xFF, 8)
|
||||
#define SOUND_LUIGI_HELLO SOUND_ARG_LOAD(0x0A, 4, 0x32, 0xFF, 8)
|
||||
#define SOUND_LUIGI_PRESS_START_TO_PLAY SOUND_ARG_LOAD(0x0A, 4, 0x33, 0xFF, 0xA)
|
||||
#define SOUND_LUIGI_TWIRL_BOUNCE SOUND_ARG_LOAD(0x0A, 4, 0x34, 0x80, 8)
|
||||
#define SOUND_LUIGI_SNORING3 SOUND_ARG_LOAD(0x0A, 4, 0x35, 0xFF, 8)
|
||||
#define SOUND_LUIGI_SO_LONGA_BOWSER SOUND_ARG_LOAD(0x0A, 4, 0x36, 0x80, 8)
|
||||
#define SOUND_LUIGI_IMA_TIRED SOUND_ARG_LOAD(0x0A, 4, 0x37, 0x80, 8)
|
||||
|
||||
#endif // LUIGI_AUDIO_DEFINES_H
|
||||
|
|
@ -25,7 +25,11 @@
|
|||
|
||||
#define MODEL_MARIO 0x01 // mario_geo
|
||||
#define MODEL_LUIGI 0xE2 // luigi_geo
|
||||
#define MODEL_BUBBLE_PLAYER 0xE4 // water_bomb_geo
|
||||
#define MODEL_BUBBLE_PLAYER 0xE3 // water_bomb_geo
|
||||
|
||||
/* Additional custom models */
|
||||
|
||||
#define MODEL_LUIGIS_CAP 0xE4 // luigis_cap_geo
|
||||
|
||||
/* Various static level geometry, the geo layout differs but terrain object presets treat them the same.*/
|
||||
|
||||
|
|
|
|||
|
|
@ -660,9 +660,11 @@
|
|||
#define UKIKI_ANIM_HELD 12
|
||||
|
||||
/* oAnimState */
|
||||
#define UKIKI_ANIM_STATE_DEFAULT 0
|
||||
#define UKIKI_ANIM_STATE_EYE_CLOSED 1
|
||||
#define UKIKI_ANIM_STATE_HAT_ON 2
|
||||
#define UKIKI_ANIM_STATE_DEFAULT 0
|
||||
#define UKIKI_ANIM_STATE_EYE_CLOSED 1 // unused
|
||||
#define UKIKI_ANIM_STATE_HAT_ON 2
|
||||
#define UKIKI_ANIM_STATE_UNUSED 3 // unused, HAT_ON+EYE_CLOSED
|
||||
#define UKIKI_ANIM_STATE_HAT_ON_LUIGI 4
|
||||
|
||||
/* oUkikiHasHat */
|
||||
#define UKIKI_HAT_ON 1
|
||||
|
|
@ -883,6 +885,7 @@
|
|||
#define KLEPTO_ANIM_STATE_HOLDING_NOTHING 0
|
||||
#define KLEPTO_ANIM_STATE_HOLDING_CAP 1
|
||||
#define KLEPTO_ANIM_STATE_HOLDING_STAR 2
|
||||
#define KLEPTO_ANIM_STATE_HOLDING_CAP_LUIGI 4
|
||||
|
||||
/* Bird */
|
||||
/* oAction */
|
||||
|
|
|
|||
665
include/seq_luigi.inc
Normal file
665
include/seq_luigi.inc
Normal file
|
|
@ -0,0 +1,665 @@
|
|||
.channel10:
|
||||
chan_largenoteson
|
||||
chan_setinstr 0
|
||||
chan_setpanmix 127
|
||||
chan_setnotepriority 14
|
||||
chan_setval 0
|
||||
chan_iowriteval 5
|
||||
chan_stereoheadseteffects 1
|
||||
chan_setdyntable .channel10_table
|
||||
chan_jump .main_loop_luigi
|
||||
|
||||
.main_loop_luigi:
|
||||
chan_delay1
|
||||
chan_ioreadval 0
|
||||
chan_bltz .main_loop_luigi
|
||||
.start_playing_luigi:
|
||||
chan_freelayer 0
|
||||
chan_freelayer 1
|
||||
chan_freelayer 2
|
||||
chan_setval 0
|
||||
chan_iowriteval 5
|
||||
chan_ioreadval 4
|
||||
chan_dyncall
|
||||
|
||||
|
||||
.poll_luigi:
|
||||
chan_delay1
|
||||
chan_ioreadval 0
|
||||
chan_bltz .skip_luigi
|
||||
chan_beqz .force_stop_luigi
|
||||
chan_jump .start_playing_luigi
|
||||
.skip_luigi:
|
||||
chan_testlayerfinished 0
|
||||
chan_beqz .poll_luigi
|
||||
chan_jump .main_loop_luigi
|
||||
.force_stop_luigi:
|
||||
chan_freelayer 0
|
||||
chan_freelayer 1
|
||||
chan_freelayer 2
|
||||
chan_jump .main_loop_luigi
|
||||
|
||||
.channel10_table:
|
||||
sound_ref .sound_luigi_jump_yah
|
||||
sound_ref .sound_luigi_jump_wah
|
||||
sound_ref .sound_luigi_jump_hoo
|
||||
sound_ref .sound_luigi_hoohoo
|
||||
sound_ref .sound_luigi_yahoo
|
||||
sound_ref .sound_luigi_uh
|
||||
sound_ref .sound_luigi_hrmm
|
||||
sound_ref .sound_luigi_wah2
|
||||
sound_ref .sound_luigi_whoa
|
||||
sound_ref .sound_luigi_eeuh
|
||||
sound_ref .sound_luigi_attacked
|
||||
sound_ref .sound_luigi_ooof
|
||||
sound_ref .sound_luigi_here_we_go
|
||||
sound_ref .sound_luigi_yawning
|
||||
sound_ref .sound_luigi_snoring1
|
||||
sound_ref .sound_luigi_snoring2
|
||||
sound_ref .sound_luigi_waaaooow
|
||||
sound_ref .sound_luigi_haha
|
||||
sound_ref .sound_luigi_panting1
|
||||
sound_ref .sound_luigi_uh2
|
||||
sound_ref .sound_luigi_on_fire
|
||||
sound_ref .sound_luigi_dying
|
||||
sound_ref .sound_luigi_panting_cold
|
||||
sound_ref .sound_luigi_coughing3
|
||||
sound_ref .sound_luigi_panting1
|
||||
sound_ref .sound_luigi_panting2
|
||||
sound_ref .sound_luigi_panting3
|
||||
sound_ref .sound_luigi_coughing1
|
||||
sound_ref .sound_luigi_coughing2
|
||||
sound_ref .sound_luigi_coughing3
|
||||
sound_ref .sound_luigi_punch_yah
|
||||
sound_ref .sound_luigi_punch_hoo
|
||||
sound_ref .sound_luigi_mama_mia
|
||||
sound_ref .sound_luigi_okey_dokey
|
||||
sound_ref .sound_luigi_ground_pound_wah
|
||||
sound_ref .sound_luigi_drowning
|
||||
sound_ref .sound_luigi_punch_wah
|
||||
sound_ref .sound_luigi_uh
|
||||
sound_ref .sound_luigi_hrmm
|
||||
sound_ref .sound_luigi_wah2
|
||||
.ifdef VERSION_JP
|
||||
sound_ref .sound_luigi_jump_hoo
|
||||
sound_ref .sound_luigi_jump_hoo
|
||||
sound_ref .sound_luigi_jump_hoo
|
||||
sound_ref .sound_luigi_jump_hoo
|
||||
sound_ref .sound_luigi_jump_hoo
|
||||
sound_ref .sound_luigi_jump_hoo
|
||||
sound_ref .sound_luigi_jump_hoo
|
||||
sound_ref .sound_luigi_jump_hoo
|
||||
sound_ref .sound_luigi_jump_hoo
|
||||
sound_ref .sound_luigi_jump_hoo
|
||||
sound_ref .sound_luigi_jump_hoo
|
||||
sound_ref .sound_luigi_jump_hoo
|
||||
sound_ref .sound_luigi_jump_hoo
|
||||
sound_ref .sound_luigi_jump_hoo
|
||||
sound_ref .sound_luigi_jump_hoo
|
||||
sound_ref .sound_luigi_jump_hoo
|
||||
.else
|
||||
sound_ref .sound_peach_dear_luigi
|
||||
sound_ref .sound_luigi_jump_hoo
|
||||
sound_ref .sound_luigi_jump_hoo
|
||||
sound_ref .sound_luigi_yahoo
|
||||
sound_ref .sound_luigi_yahoo
|
||||
sound_ref .sound_luigi_yahoo
|
||||
sound_ref .sound_luigi_waha
|
||||
sound_ref .sound_luigi_yippee
|
||||
sound_ref .sound_luigi_doh
|
||||
sound_ref .sound_luigi_game_over
|
||||
sound_ref .sound_luigi_hello
|
||||
sound_ref .sound_luigi_press_start_to_play
|
||||
sound_ref .sound_luigi_twirl_bounce
|
||||
sound_ref .sound_luigi_snoring3
|
||||
sound_ref .sound_luigi_so_longa_bowser
|
||||
sound_ref .sound_luigi_ima_tired
|
||||
.endif
|
||||
|
||||
.sound_luigi_jump_hoo:
|
||||
chan_setbank 11
|
||||
chan_setinstr 0
|
||||
chan_setlayer 0, .layer_luigi_C3C
|
||||
chan_end
|
||||
|
||||
.layer_luigi_C3C:
|
||||
.ifdef VERSION_EU
|
||||
layer_transpose 2
|
||||
.endif
|
||||
layer_portamento 0x82, 41, 127
|
||||
layer_note1 37, 0x14, 127
|
||||
layer_end
|
||||
|
||||
.sound_luigi_jump_wah:
|
||||
chan_setbank 11
|
||||
chan_setinstr 1
|
||||
chan_setlayer 0, .layer_luigi_C4C
|
||||
chan_end
|
||||
|
||||
.layer_luigi_C4C:
|
||||
layer_transpose 254
|
||||
.layer_luigi_C4E:
|
||||
layer_note1 38, 0x18, 127
|
||||
layer_end
|
||||
|
||||
.sound_luigi_jump_yah:
|
||||
chan_setbank 12
|
||||
chan_setinstr 9
|
||||
chan_setlayer 0, .layer_luigi_C5A
|
||||
chan_end
|
||||
|
||||
.layer_luigi_C5A:
|
||||
layer_transpose 254
|
||||
.layer_luigi_C5C:
|
||||
layer_portamento 0x82, 39, 200
|
||||
layer_note1 38, 0x24, 120
|
||||
layer_end
|
||||
|
||||
.sound_luigi_hoohoo:
|
||||
chan_setbank 12
|
||||
chan_setinstr 1
|
||||
chan_setlayer 0, .layer_luigi_C6C
|
||||
chan_end
|
||||
|
||||
.layer_luigi_C6C:
|
||||
.ifdef VERSION_EU
|
||||
layer_transpose 1
|
||||
.endif
|
||||
layer_portamento 0x82, 44, 200
|
||||
layer_note1 39, 0x30, 127
|
||||
layer_end
|
||||
|
||||
.sound_luigi_yahoo:
|
||||
chan_setbank 11
|
||||
chan_setinstr 4
|
||||
chan_setlayer 0, .layer_luigi_C7C
|
||||
chan_end
|
||||
|
||||
.layer_luigi_C7C:
|
||||
layer_transpose 254
|
||||
layer_somethingon
|
||||
layer_portamento 0x85, 39, 255
|
||||
layer_note1 42, 0x1e, 110
|
||||
layer_note1 39, 0x41, 110
|
||||
layer_end
|
||||
|
||||
.sound_luigi_uh:
|
||||
chan_setbank 11
|
||||
chan_setinstr 5
|
||||
chan_setlayer 0, .layer_luigi_C92
|
||||
chan_end
|
||||
|
||||
.layer_luigi_C92:
|
||||
layer_transpose 254
|
||||
layer_portamento 0x81, 41, 255
|
||||
layer_note1 38, 0x2b, 115
|
||||
layer_end
|
||||
|
||||
.sound_luigi_hrmm:
|
||||
chan_setbank 11
|
||||
chan_setinstr 6
|
||||
chan_setlayer 0, .layer_luigi_CA4
|
||||
chan_end
|
||||
|
||||
.layer_luigi_CA4:
|
||||
layer_transpose 254
|
||||
layer_note1 44, 0x1e, 110
|
||||
layer_end
|
||||
|
||||
.sound_luigi_wah2:
|
||||
chan_setbank 11
|
||||
chan_setinstr 7
|
||||
chan_setlayer 0, .layer_luigi_CB2
|
||||
chan_end
|
||||
|
||||
.layer_luigi_CB2:
|
||||
layer_transpose 253
|
||||
layer_note1 39, 0x1c, 127
|
||||
layer_end
|
||||
|
||||
.sound_luigi_whoa:
|
||||
chan_setbank 11
|
||||
chan_setinstr 8
|
||||
chan_setlayer 0, .layer_luigi_CC0
|
||||
chan_end
|
||||
|
||||
.layer_luigi_CC0:
|
||||
layer_transpose 254
|
||||
layer_note1 40, 0x30, 110
|
||||
layer_end
|
||||
|
||||
.sound_luigi_eeuh:
|
||||
chan_setbank 11
|
||||
chan_setinstr 9
|
||||
chan_setlayer 0, .layer_luigi_CCE
|
||||
chan_end
|
||||
|
||||
.layer_luigi_CCE:
|
||||
layer_transpose 254
|
||||
layer_note1 40, 0x44, 105
|
||||
layer_end
|
||||
|
||||
.sound_luigi_attacked:
|
||||
chan_setbank 11
|
||||
chan_setinstr 10
|
||||
chan_setlayer 0, .layer_luigi_CDC
|
||||
chan_end
|
||||
|
||||
.layer_luigi_CDC:
|
||||
layer_transpose 254
|
||||
layer_note1 41, 0x30, 120
|
||||
layer_end
|
||||
|
||||
.sound_luigi_ooof:
|
||||
chan_setbank 11
|
||||
chan_setinstr 11
|
||||
chan_setlayer 0, .layer_luigi_CEA
|
||||
chan_end
|
||||
|
||||
.layer_luigi_CEA:
|
||||
layer_transpose 254
|
||||
layer_note1 38, 0x30, 127
|
||||
layer_end
|
||||
|
||||
.sound_luigi_here_we_go:
|
||||
chan_setbank 11
|
||||
chan_setinstr 12
|
||||
chan_setlayer 0, .layer_luigi_CF8
|
||||
chan_end
|
||||
|
||||
.layer_luigi_CF8:
|
||||
layer_portamento 0x81, 38, 200
|
||||
layer_note1 41, 0x85, 127
|
||||
layer_end
|
||||
|
||||
.sound_luigi_yawning:
|
||||
chan_setbank 11
|
||||
chan_setinstr 13
|
||||
chan_setlayer 0, .layer_luigi_D09
|
||||
chan_end
|
||||
|
||||
.layer_luigi_D09:
|
||||
layer_transpose 254
|
||||
layer_note1 39, 0x7f, 105
|
||||
layer_end
|
||||
|
||||
.sound_luigi_snoring1:
|
||||
chan_setbank 11
|
||||
chan_setinstr 14
|
||||
chan_setlayer 0, .layer_luigi_D17
|
||||
chan_end
|
||||
|
||||
.layer_luigi_D17:
|
||||
layer_transpose 254
|
||||
layer_note1 39, 0x60, 64
|
||||
layer_end
|
||||
|
||||
.sound_luigi_snoring2:
|
||||
chan_setbank 11
|
||||
chan_setinstr 15
|
||||
chan_setlayer 0, .layer_luigi_D25
|
||||
chan_end
|
||||
|
||||
.layer_luigi_D25:
|
||||
layer_transpose 254
|
||||
layer_note1 39, 0x5c, 52
|
||||
layer_end
|
||||
|
||||
.sound_luigi_waaaooow:
|
||||
chan_setbank 12
|
||||
chan_setinstr 0
|
||||
chan_setlayer 0, .layer_luigi_D33
|
||||
chan_end
|
||||
|
||||
.layer_luigi_D33:
|
||||
layer_transpose 254
|
||||
layer_note1 39, 0xaa, 127
|
||||
layer_end
|
||||
|
||||
.sound_luigi_haha:
|
||||
chan_setbank 11
|
||||
chan_setinstr 3
|
||||
chan_setlayer 0, .layer_luigi_D42
|
||||
chan_end
|
||||
|
||||
.layer_luigi_D42:
|
||||
layer_transpose 255
|
||||
layer_note1 39, 0x4d, 120
|
||||
layer_end
|
||||
|
||||
.sound_luigi_uh2:
|
||||
chan_setbank 12
|
||||
chan_setinstr 6
|
||||
chan_setlayer 0, .layer_luigi_D50
|
||||
chan_end
|
||||
|
||||
.layer_luigi_D50:
|
||||
layer_transpose 254
|
||||
layer_note1 43, 0x1e, 105
|
||||
layer_end
|
||||
|
||||
.sound_luigi_on_fire:
|
||||
chan_setbank 12
|
||||
chan_setinstr 5
|
||||
chan_setlayer 0, .layer_luigi_D5E
|
||||
chan_end
|
||||
|
||||
.layer_luigi_D5E:
|
||||
layer_transpose 254
|
||||
layer_note1 39, 0xc8, 127
|
||||
layer_end
|
||||
|
||||
.sound_luigi_dying:
|
||||
chan_setbank 12
|
||||
chan_setinstr 4
|
||||
chan_setlayer 0, .layer_luigi_D6D
|
||||
chan_end
|
||||
|
||||
.layer_luigi_D6D:
|
||||
layer_transpose 254
|
||||
layer_note1 39, 0x8c, 110
|
||||
layer_end
|
||||
|
||||
.sound_luigi_panting_cold:
|
||||
chan_setbank 12
|
||||
chan_setinstr 2
|
||||
chan_setlayer 0, .layer_luigi_D7C
|
||||
chan_end
|
||||
|
||||
.layer_luigi_D7C:
|
||||
layer_transpose 254
|
||||
layer_portamento 0x82, 35, 255
|
||||
layer_note1 38, 0x30, 127
|
||||
layer_end
|
||||
|
||||
.sound_luigi_panting1:
|
||||
chan_setbank 12
|
||||
chan_setinstr 2
|
||||
chan_setlayer 0, .layer_luigi_D8E
|
||||
chan_end
|
||||
|
||||
.layer_luigi_D8E:
|
||||
layer_transpose 254
|
||||
layer_note1 39, 0x3c, 100
|
||||
layer_end
|
||||
|
||||
.sound_luigi_panting2:
|
||||
chan_setbank 12
|
||||
chan_setinstr 2
|
||||
chan_setlayer 0, .layer_luigi_D9C
|
||||
chan_end
|
||||
|
||||
.layer_luigi_D9C:
|
||||
layer_transpose 254
|
||||
layer_delay 0x4
|
||||
layer_note1 38, 0x3c, 100
|
||||
layer_end
|
||||
|
||||
.sound_luigi_panting3:
|
||||
chan_setbank 12
|
||||
chan_setinstr 2
|
||||
chan_setlayer 0, .layer_luigi_DAC
|
||||
chan_end
|
||||
|
||||
.layer_luigi_DAC:
|
||||
layer_transpose 254
|
||||
layer_delay 0x8
|
||||
layer_note1 40, 0x3c, 100
|
||||
layer_end
|
||||
|
||||
.sound_luigi_coughing1:
|
||||
chan_setbank 12
|
||||
chan_setinstr 7
|
||||
chan_setlayer 0, .layer_luigi_DBC
|
||||
chan_end
|
||||
|
||||
.layer_luigi_DBC:
|
||||
layer_transpose 254
|
||||
layer_note1 39, 0x10, 115
|
||||
layer_end
|
||||
|
||||
.sound_luigi_coughing2:
|
||||
chan_setbank 12
|
||||
chan_setinstr 7
|
||||
chan_setlayer 0, .layer_luigi_DCA
|
||||
chan_end
|
||||
|
||||
.layer_luigi_DCA:
|
||||
layer_transpose 254
|
||||
layer_portamento 0x81, 38, 255
|
||||
layer_note1 41, 0x18, 115
|
||||
layer_end
|
||||
|
||||
.sound_luigi_coughing3:
|
||||
chan_setbank 12
|
||||
chan_setinstr 7
|
||||
chan_setlayer 0, .layer_luigi_DDC
|
||||
chan_end
|
||||
|
||||
.layer_luigi_DDC:
|
||||
layer_transpose 254
|
||||
layer_somethingon
|
||||
layer_portamento 0x85, 38, 255
|
||||
layer_note1 41, 0xc, 115
|
||||
layer_note1 35, 0x12, 115
|
||||
layer_end
|
||||
|
||||
.sound_luigi_punch_yah:
|
||||
chan_setbank 12
|
||||
chan_setinstr 9
|
||||
chan_setlayer 0, .layer_luigi_DFE
|
||||
chan_setval 1
|
||||
chan_call .delay
|
||||
chan_setbank 0
|
||||
chan_setinstr 0
|
||||
chan_setlayer 1, .layer_luigi_538
|
||||
chan_end
|
||||
|
||||
.layer_luigi_538:
|
||||
layer_portamento 0x81, 46, 255
|
||||
layer_note1 31, 0xf, 100
|
||||
layer_end
|
||||
|
||||
.layer_luigi_DFE:
|
||||
layer_transpose 254
|
||||
layer_jump .layer_luigi_C5C
|
||||
|
||||
.sound_luigi_punch_hoo:
|
||||
chan_setbank 12
|
||||
chan_setinstr 10
|
||||
chan_setlayer 0, .layer_luigi_E17
|
||||
chan_setval 1
|
||||
chan_call .delay
|
||||
chan_setbank 0
|
||||
chan_setinstr 0
|
||||
chan_setlayer 1, .layer_luigi_548
|
||||
chan_end
|
||||
|
||||
.layer_luigi_548:
|
||||
layer_note1 39, 0x12, 100
|
||||
layer_end
|
||||
|
||||
.layer_luigi_E17:
|
||||
layer_transpose 254
|
||||
layer_portamento 0x81, 42, 255
|
||||
layer_note1 38, 0x30, 115
|
||||
layer_end
|
||||
|
||||
.sound_luigi_mama_mia:
|
||||
chan_setbank 12
|
||||
chan_setinstr 11
|
||||
chan_setlayer 0, .layer_luigi_E29
|
||||
chan_end
|
||||
|
||||
.layer_luigi_E29:
|
||||
layer_portamento 0x81, 38, 255
|
||||
layer_note1 36, 0x8c, 115
|
||||
layer_end
|
||||
|
||||
.sound_luigi_okey_dokey:
|
||||
chan_setbank 12
|
||||
chan_setinstr 12
|
||||
chan_setlayer 0, .layer_luigi_E3A
|
||||
chan_end
|
||||
|
||||
.layer_luigi_E3A:
|
||||
layer_note1 39, 0x60, 115
|
||||
layer_end
|
||||
|
||||
.sound_luigi_ground_pound_wah:
|
||||
chan_jump .sound_luigi_wah2
|
||||
|
||||
.sound_luigi_drowning:
|
||||
chan_setbank 12
|
||||
chan_setinstr 13
|
||||
chan_setlayer 0, .layer_luigi_E49
|
||||
chan_end
|
||||
|
||||
.layer_luigi_E49:
|
||||
layer_note1 38, 0x91, 127
|
||||
layer_end
|
||||
|
||||
.sound_luigi_punch_wah:
|
||||
chan_setbank 11
|
||||
chan_setinstr 1
|
||||
chan_setlayer 0, .layer_luigi_E62
|
||||
chan_setval 1
|
||||
chan_call .delay
|
||||
chan_setbank 0
|
||||
chan_setinstr 0
|
||||
chan_setlayer 1, .layer_luigi_536
|
||||
chan_end
|
||||
|
||||
.layer_luigi_536:
|
||||
layer_transpose 1
|
||||
|
||||
.layer_luigi_E62:
|
||||
layer_transpose 255
|
||||
layer_jump .layer_luigi_C4E
|
||||
|
||||
.ifndef VERSION_JP
|
||||
.sound_peach_dear_luigi:
|
||||
chan_setbank 12
|
||||
chan_setinstr 15
|
||||
chan_setlayer 0, .layer_luigi_E6F
|
||||
chan_end
|
||||
|
||||
.layer_luigi_E6F:
|
||||
layer_note1 39, 0x2bc, 127
|
||||
layer_end
|
||||
|
||||
.sound_luigi_waha:
|
||||
chan_setbank 11
|
||||
chan_setinstr 24
|
||||
chan_setlayer 0, .layer_luigi_E7C
|
||||
chan_end
|
||||
|
||||
.layer_luigi_E7C:
|
||||
layer_note1 39, 0x5a, 127
|
||||
layer_end
|
||||
|
||||
.sound_luigi_yippee:
|
||||
chan_setbank 11
|
||||
chan_setinstr 25
|
||||
chan_setlayer 0, .layer_luigi_E88
|
||||
chan_end
|
||||
|
||||
.layer_luigi_E88:
|
||||
layer_note1 39, 0x5a, 97
|
||||
layer_end
|
||||
|
||||
.sound_luigi_doh:
|
||||
chan_setbank 11
|
||||
chan_setinstr 16
|
||||
chan_setlayer 0, .layer_luigi_E94
|
||||
chan_end
|
||||
|
||||
.layer_luigi_E94:
|
||||
layer_note1 41, 0x46, 127
|
||||
layer_end
|
||||
|
||||
.sound_luigi_game_over:
|
||||
chan_setbank 11
|
||||
chan_setinstr 17
|
||||
chan_setlayer 0, .layer_luigi_EA0
|
||||
chan_end
|
||||
|
||||
.layer_luigi_EA0:
|
||||
layer_note1 39, 0x55, 110
|
||||
layer_end
|
||||
|
||||
.sound_luigi_hello:
|
||||
chan_setbank 11
|
||||
chan_setinstr 18
|
||||
chan_setlayer 0, .layer_luigi_EAC
|
||||
chan_end
|
||||
|
||||
.layer_luigi_EAC:
|
||||
layer_note1 39, 0x46, 127
|
||||
layer_end
|
||||
|
||||
.sound_luigi_press_start_to_play:
|
||||
chan_setbank 11
|
||||
chan_setinstr 19
|
||||
chan_setlayer 0, .layer_luigi_EB8
|
||||
chan_end
|
||||
|
||||
.layer_luigi_EB8:
|
||||
layer_note1 39, 0x12c, 127
|
||||
layer_end
|
||||
|
||||
.sound_luigi_twirl_bounce:
|
||||
chan_setbank 11
|
||||
chan_setinstr 20
|
||||
chan_setlayer 0, .layer_luigi_EC5
|
||||
chan_end
|
||||
|
||||
.layer_luigi_EC5:
|
||||
layer_note1 39, 0x30, 127
|
||||
layer_end
|
||||
|
||||
.sound_luigi_snoring3:
|
||||
chan_setbank 11
|
||||
chan_setlayer 0, .layer_luigi_ECF
|
||||
chan_end
|
||||
|
||||
.layer_luigi_ECF:
|
||||
layer_delay 0x4e
|
||||
.layer_luigi_ED1:
|
||||
layer_loop 50
|
||||
layer_call .layer_luigi_fn_EE1
|
||||
layer_loopend
|
||||
layer_setinstr 21
|
||||
layer_note1 39, 0x44c, 127
|
||||
layer_jump .layer_luigi_ED1
|
||||
layer_end
|
||||
|
||||
.layer_luigi_fn_EE1:
|
||||
layer_setinstr 21
|
||||
layer_note1 37, 0x53, 127
|
||||
layer_setinstr 15
|
||||
layer_note1 37, 0x4e, 64
|
||||
layer_end
|
||||
|
||||
.sound_luigi_so_longa_bowser:
|
||||
chan_setbank 11
|
||||
chan_setinstr 22
|
||||
chan_setlayer 0, .layer_luigi_EF7
|
||||
chan_setlayer 1, .layer_luigi_EF7
|
||||
chan_end
|
||||
|
||||
.layer_luigi_EF7:
|
||||
layer_portamento 0x82, 42, 200
|
||||
layer_note1 39, 0xc8, 110
|
||||
layer_end
|
||||
|
||||
.sound_luigi_ima_tired:
|
||||
chan_setbank 11
|
||||
chan_setinstr 23
|
||||
chan_setlayer 0, .layer_luigi_F08
|
||||
chan_end
|
||||
|
||||
.layer_luigi_F08:
|
||||
layer_note1 39, 0x96, 110
|
||||
layer_end
|
||||
.endif
|
||||
|
|
@ -149,6 +149,8 @@
|
|||
#define TEXT_OPT_CHEAT8 _("Huge Mario")
|
||||
#define TEXT_OPT_CHEAT9 _("Tiny Mario")
|
||||
|
||||
#define TEXT_OPT_LUIGISND _("Luigi Sounds")
|
||||
|
||||
#endif // VERSION
|
||||
|
||||
#endif // TEXT_OPTIONS_STRINGS_H
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@
|
|||
#include <ultra64.h>
|
||||
#include "macros.h"
|
||||
#include "src/game/characters.h"
|
||||
#include "pc/network/version.h"
|
||||
|
||||
// Certain functions are marked as having return values, but do not
|
||||
// actually return a value. This causes undefined behavior, which we'd rather
|
||||
|
|
@ -390,7 +391,7 @@ struct MarioState
|
|||
// NOTE: this defines the maximum number of players...
|
||||
// HOWEVER, simply increasing this to 3 will not magically work
|
||||
// many things will have to be overhauled!
|
||||
#ifdef DEVELOPMENT
|
||||
#ifdef UNSTABLE_BRANCH
|
||||
#define MAX_PLAYERS 4
|
||||
#else
|
||||
#define MAX_PLAYERS 2
|
||||
|
|
|
|||
|
|
@ -66,7 +66,7 @@ const LevelScript level_main_scripts_entry[] = {
|
|||
LOAD_RAW( /*seg*/ 0x13, _behaviorSegmentRomStart, _behaviorSegmentRomEnd),
|
||||
ALLOC_LEVEL_POOL(),
|
||||
LOAD_MODEL_FROM_GEO(MODEL_MARIO, mario_geo),
|
||||
LOAD_MODEL_FROM_GEO(MODEL_LUIGI, luigi_geo),
|
||||
LOAD_MODEL_FROM_GEO(MODEL_LUIGI, luigi_geo), // custom luigi
|
||||
LOAD_MODEL_FROM_GEO(MODEL_BUBBLE_PLAYER, water_bomb_geo),
|
||||
LOAD_MODEL_FROM_GEO(MODEL_SMOKE, smoke_geo),
|
||||
LOAD_MODEL_FROM_GEO(MODEL_SPARKLES, sparkles_geo),
|
||||
|
|
@ -104,6 +104,7 @@ const LevelScript level_main_scripts_entry[] = {
|
|||
LOAD_MODEL_FROM_GEO(MODEL_MARIOS_WING_CAP, marios_wing_cap_geo),
|
||||
LOAD_MODEL_FROM_GEO(MODEL_MARIOS_CAP, marios_cap_geo),
|
||||
LOAD_MODEL_FROM_GEO(MODEL_MARIOS_CAP, marios_cap_geo), // repeated
|
||||
LOAD_MODEL_FROM_GEO(MODEL_LUIGIS_CAP, luigis_cap_geo), // custom luigi_cap
|
||||
LOAD_MODEL_FROM_GEO(MODEL_BOWSER_KEY_CUTSCENE, bowser_key_cutscene_geo),
|
||||
LOAD_MODEL_FROM_GEO(MODEL_BOWSER_KEY, bowser_key_geo),
|
||||
LOAD_MODEL_FROM_GEO(MODEL_RED_FLAME_SHADOW, red_flame_shadow_geo),
|
||||
|
|
|
|||
BIN
sound/samples/sfx_custom_luigi/00.aiff
Normal file
BIN
sound/samples/sfx_custom_luigi/00.aiff
Normal file
Binary file not shown.
BIN
sound/samples/sfx_custom_luigi/01.aiff
Normal file
BIN
sound/samples/sfx_custom_luigi/01.aiff
Normal file
Binary file not shown.
BIN
sound/samples/sfx_custom_luigi/02.aiff
Normal file
BIN
sound/samples/sfx_custom_luigi/02.aiff
Normal file
Binary file not shown.
BIN
sound/samples/sfx_custom_luigi/03.aiff
Normal file
BIN
sound/samples/sfx_custom_luigi/03.aiff
Normal file
Binary file not shown.
BIN
sound/samples/sfx_custom_luigi/04.aiff
Normal file
BIN
sound/samples/sfx_custom_luigi/04.aiff
Normal file
Binary file not shown.
BIN
sound/samples/sfx_custom_luigi/05.aiff
Normal file
BIN
sound/samples/sfx_custom_luigi/05.aiff
Normal file
Binary file not shown.
BIN
sound/samples/sfx_custom_luigi/06.aiff
Normal file
BIN
sound/samples/sfx_custom_luigi/06.aiff
Normal file
Binary file not shown.
BIN
sound/samples/sfx_custom_luigi/07.aiff
Normal file
BIN
sound/samples/sfx_custom_luigi/07.aiff
Normal file
Binary file not shown.
BIN
sound/samples/sfx_custom_luigi/08.aiff
Normal file
BIN
sound/samples/sfx_custom_luigi/08.aiff
Normal file
Binary file not shown.
BIN
sound/samples/sfx_custom_luigi/09.aiff
Normal file
BIN
sound/samples/sfx_custom_luigi/09.aiff
Normal file
Binary file not shown.
BIN
sound/samples/sfx_custom_luigi/0A.aiff
Normal file
BIN
sound/samples/sfx_custom_luigi/0A.aiff
Normal file
Binary file not shown.
BIN
sound/samples/sfx_custom_luigi/0B.aiff
Normal file
BIN
sound/samples/sfx_custom_luigi/0B.aiff
Normal file
Binary file not shown.
BIN
sound/samples/sfx_custom_luigi/0C.aiff
Normal file
BIN
sound/samples/sfx_custom_luigi/0C.aiff
Normal file
Binary file not shown.
BIN
sound/samples/sfx_custom_luigi/10.aiff
Normal file
BIN
sound/samples/sfx_custom_luigi/10.aiff
Normal file
Binary file not shown.
BIN
sound/samples/sfx_custom_luigi/14.aiff
Normal file
BIN
sound/samples/sfx_custom_luigi/14.aiff
Normal file
Binary file not shown.
BIN
sound/samples/sfx_custom_luigi/16.aiff
Normal file
BIN
sound/samples/sfx_custom_luigi/16.aiff
Normal file
Binary file not shown.
BIN
sound/samples/sfx_custom_luigi/18.aiff
Normal file
BIN
sound/samples/sfx_custom_luigi/18.aiff
Normal file
Binary file not shown.
BIN
sound/samples/sfx_custom_luigi/19.aiff
Normal file
BIN
sound/samples/sfx_custom_luigi/19.aiff
Normal file
Binary file not shown.
BIN
sound/samples/sfx_custom_luigi/1A.aiff
Normal file
BIN
sound/samples/sfx_custom_luigi/1A.aiff
Normal file
Binary file not shown.
BIN
sound/samples/sfx_custom_luigi_peach/00.aiff
Normal file
BIN
sound/samples/sfx_custom_luigi_peach/00.aiff
Normal file
Binary file not shown.
BIN
sound/samples/sfx_custom_luigi_peach/01.aiff
Normal file
BIN
sound/samples/sfx_custom_luigi_peach/01.aiff
Normal file
Binary file not shown.
BIN
sound/samples/sfx_custom_luigi_peach/02.aiff
Normal file
BIN
sound/samples/sfx_custom_luigi_peach/02.aiff
Normal file
Binary file not shown.
BIN
sound/samples/sfx_custom_luigi_peach/03.aiff
Normal file
BIN
sound/samples/sfx_custom_luigi_peach/03.aiff
Normal file
Binary file not shown.
BIN
sound/samples/sfx_custom_luigi_peach/04.aiff
Normal file
BIN
sound/samples/sfx_custom_luigi_peach/04.aiff
Normal file
Binary file not shown.
BIN
sound/samples/sfx_custom_luigi_peach/05.aiff
Normal file
BIN
sound/samples/sfx_custom_luigi_peach/05.aiff
Normal file
Binary file not shown.
BIN
sound/samples/sfx_custom_luigi_peach/08.aiff
Normal file
BIN
sound/samples/sfx_custom_luigi_peach/08.aiff
Normal file
Binary file not shown.
BIN
sound/samples/sfx_custom_luigi_peach/09.aiff
Normal file
BIN
sound/samples/sfx_custom_luigi_peach/09.aiff
Normal file
Binary file not shown.
BIN
sound/samples/sfx_custom_luigi_peach/0A.aiff
Normal file
BIN
sound/samples/sfx_custom_luigi_peach/0A.aiff
Normal file
Binary file not shown.
BIN
sound/samples/sfx_custom_luigi_peach/0C.aiff
Normal file
BIN
sound/samples/sfx_custom_luigi_peach/0C.aiff
Normal file
Binary file not shown.
BIN
sound/samples/sfx_custom_luigi_peach/0D.aiff
Normal file
BIN
sound/samples/sfx_custom_luigi_peach/0D.aiff
Normal file
Binary file not shown.
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"comment": "This file lists all sequences together with the sound banks they use. If a sequence uses multiple banks, the first bank will be used by default, and it can switch between them using the chan_setbank command; e.g. chan_setbank 0 will switch to the first bank in the given list.",
|
||||
"00_sound_player": ["00", "01_terrain", "02_water", "03", "04", "05", "06", "07", "08_mario", "09", "0A_mario_peach"],
|
||||
"00_sound_player": ["00", "01_terrain", "02_water", "03", "04", "05", "06", "07", "08_mario", "09", "0A_mario_peach", "26_custom_luigi", "27_custom_luigi_peach"],
|
||||
"01_cutscene_collect_star": ["22"],
|
||||
"02_menu_title_screen": ["11"],
|
||||
"03_level_grass": ["22"],
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ seq_setmutebhv 0x60
|
|||
seq_setmutescale 0
|
||||
seq_setvol 127
|
||||
seq_settempo 120
|
||||
seq_initchannels 0x3ff
|
||||
seq_initchannels 0x7ff
|
||||
seq_startchannel 0, .channel0
|
||||
seq_startchannel 1, .channel1
|
||||
seq_startchannel 2, .channel2
|
||||
|
|
@ -18,10 +18,13 @@ seq_startchannel 6, .channel6
|
|||
seq_startchannel 7, .channel7
|
||||
seq_startchannel 8, .channel38
|
||||
seq_startchannel 9, .channel59
|
||||
seq_startchannel 10, .channel10
|
||||
.seq_loop:
|
||||
seq_delay 20000
|
||||
seq_jump .seq_loop
|
||||
|
||||
.include "seq_luigi.inc"
|
||||
|
||||
.channel0:
|
||||
chan_largenoteson
|
||||
chan_setinstr 0
|
||||
|
|
|
|||
189
sound/sound_banks/26_custom_luigi.json
Normal file
189
sound/sound_banks/26_custom_luigi.json
Normal file
|
|
@ -0,0 +1,189 @@
|
|||
{
|
||||
"date": "1996-02-14",
|
||||
"sample_bank": "sfx_custom_luigi",
|
||||
"envelopes": {
|
||||
"envelope0": [
|
||||
[2, 32700],
|
||||
[1, 32700],
|
||||
[32700, 29430],
|
||||
"hang"
|
||||
]
|
||||
},
|
||||
"instruments": {
|
||||
"inst0": {
|
||||
"release_rate": 208,
|
||||
"envelope": "envelope0",
|
||||
"sound": "00"
|
||||
},
|
||||
"inst1": {
|
||||
"release_rate": 208,
|
||||
"envelope": "envelope0",
|
||||
"sound": "01"
|
||||
},
|
||||
"inst2": {
|
||||
"release_rate": 208,
|
||||
"envelope": "envelope0",
|
||||
"sound": "02"
|
||||
},
|
||||
"inst3": {
|
||||
"release_rate": 208,
|
||||
"envelope": "envelope0",
|
||||
"sound": "03"
|
||||
},
|
||||
"inst4": {
|
||||
"release_rate": 208,
|
||||
"envelope": "envelope0",
|
||||
"sound": "04"
|
||||
},
|
||||
"inst5": {
|
||||
"release_rate": 208,
|
||||
"envelope": "envelope0",
|
||||
"sound": "05"
|
||||
},
|
||||
"inst6": {
|
||||
"release_rate": 208,
|
||||
"envelope": "envelope0",
|
||||
"sound": "06"
|
||||
},
|
||||
"inst7": {
|
||||
"release_rate": 208,
|
||||
"envelope": "envelope0",
|
||||
"sound": "07"
|
||||
},
|
||||
"inst8": {
|
||||
"release_rate": 208,
|
||||
"envelope": "envelope0",
|
||||
"sound": "08"
|
||||
},
|
||||
"inst9": {
|
||||
"release_rate": 208,
|
||||
"envelope": "envelope0",
|
||||
"sound": "09"
|
||||
},
|
||||
"inst10": {
|
||||
"release_rate": 208,
|
||||
"envelope": "envelope0",
|
||||
"sound": "0A"
|
||||
},
|
||||
"inst11": {
|
||||
"release_rate": 208,
|
||||
"envelope": "envelope0",
|
||||
"sound": "0B"
|
||||
},
|
||||
"inst12": {
|
||||
"release_rate": 208,
|
||||
"envelope": "envelope0",
|
||||
"sound": "0C"
|
||||
},
|
||||
"inst13": {
|
||||
"release_rate": 208,
|
||||
"envelope": "envelope0",
|
||||
"sound": "0D"
|
||||
},
|
||||
"inst14": {
|
||||
"release_rate": 208,
|
||||
"envelope": "envelope0",
|
||||
"sound": "0E"
|
||||
},
|
||||
"inst15": {
|
||||
"release_rate": 208,
|
||||
"envelope": "envelope0",
|
||||
"sound": "0F"
|
||||
},
|
||||
"inst16": {
|
||||
"ifdef": ["VERSION_US", "VERSION_EU"],
|
||||
"release_rate": 208,
|
||||
"envelope": "envelope0",
|
||||
"sound": "10"
|
||||
},
|
||||
"inst17": {
|
||||
"ifdef": ["VERSION_US", "VERSION_EU"],
|
||||
"release_rate": 208,
|
||||
"envelope": "envelope0",
|
||||
"sound": "11"
|
||||
},
|
||||
"inst18": {
|
||||
"ifdef": ["VERSION_US", "VERSION_EU"],
|
||||
"release_rate": 208,
|
||||
"envelope": "envelope0",
|
||||
"sound": "12"
|
||||
},
|
||||
"inst19": {
|
||||
"ifdef": ["VERSION_US", "VERSION_EU"],
|
||||
"release_rate": 208,
|
||||
"envelope": "envelope0",
|
||||
"sound": "13"
|
||||
},
|
||||
"inst20": {
|
||||
"ifdef": ["VERSION_US", "VERSION_EU"],
|
||||
"release_rate": 208,
|
||||
"envelope": "envelope0",
|
||||
"sound": "14"
|
||||
},
|
||||
"inst21": {
|
||||
"ifdef": ["VERSION_US", "VERSION_EU"],
|
||||
"release_rate": 208,
|
||||
"envelope": "envelope0",
|
||||
"sound": "15"
|
||||
},
|
||||
"inst22": {
|
||||
"ifdef": ["VERSION_US", "VERSION_EU"],
|
||||
"release_rate": 208,
|
||||
"envelope": "envelope0",
|
||||
"sound": "16"
|
||||
},
|
||||
"inst23": {
|
||||
"ifdef": ["VERSION_US", "VERSION_EU"],
|
||||
"release_rate": 208,
|
||||
"envelope": "envelope0",
|
||||
"sound": "17"
|
||||
},
|
||||
"inst24": {
|
||||
"ifdef": ["VERSION_US", "VERSION_EU"],
|
||||
"release_rate": 208,
|
||||
"envelope": "envelope0",
|
||||
"sound": "18"
|
||||
},
|
||||
"inst25": {
|
||||
"ifdef": ["VERSION_US", "VERSION_EU"],
|
||||
"release_rate": 208,
|
||||
"envelope": "envelope0",
|
||||
"sound": "19"
|
||||
},
|
||||
"inst26": {
|
||||
"ifdef": ["VERSION_US", "VERSION_EU"],
|
||||
"release_rate": 208,
|
||||
"envelope": "envelope0",
|
||||
"sound": "1A"
|
||||
}
|
||||
},
|
||||
"instrument_list": [
|
||||
"inst0",
|
||||
"inst1",
|
||||
"inst2",
|
||||
"inst3",
|
||||
"inst4",
|
||||
"inst5",
|
||||
"inst6",
|
||||
"inst7",
|
||||
"inst8",
|
||||
"inst9",
|
||||
"inst10",
|
||||
"inst11",
|
||||
"inst12",
|
||||
"inst13",
|
||||
"inst14",
|
||||
"inst15",
|
||||
"inst16",
|
||||
"inst17",
|
||||
"inst18",
|
||||
"inst19",
|
||||
"inst20",
|
||||
"inst21",
|
||||
"inst22",
|
||||
"inst23",
|
||||
"inst24",
|
||||
"inst25",
|
||||
"inst26"
|
||||
]
|
||||
}
|
||||
164
sound/sound_banks/27_custom_luigi_peach.json
Normal file
164
sound/sound_banks/27_custom_luigi_peach.json
Normal file
|
|
@ -0,0 +1,164 @@
|
|||
{
|
||||
"date": "1996-02-14",
|
||||
"sample_bank": "sfx_custom_luigi_peach",
|
||||
"envelopes": {
|
||||
"envelope0": [
|
||||
[2, 32700],
|
||||
[1, 32700],
|
||||
[32700, 29430],
|
||||
"hang"
|
||||
]
|
||||
},
|
||||
"instruments": {
|
||||
"inst0": {
|
||||
"release_rate": 208,
|
||||
"envelope": "envelope0",
|
||||
"sound": "00"
|
||||
},
|
||||
"inst1": {
|
||||
"release_rate": 208,
|
||||
"envelope": "envelope0",
|
||||
"sound": "01"
|
||||
},
|
||||
"inst2": {
|
||||
"release_rate": 208,
|
||||
"envelope": "envelope0",
|
||||
"sound": "02"
|
||||
},
|
||||
"inst3": {
|
||||
"release_rate": 208,
|
||||
"envelope": "envelope0",
|
||||
"sound": "03"
|
||||
},
|
||||
"inst4": {
|
||||
"release_rate": 208,
|
||||
"envelope": "envelope0",
|
||||
"sound": "04"
|
||||
},
|
||||
"inst5": {
|
||||
"release_rate": 208,
|
||||
"envelope": "envelope0",
|
||||
"sound": "05"
|
||||
},
|
||||
"inst6": {
|
||||
"release_rate": 208,
|
||||
"envelope": "envelope0",
|
||||
"sound": "06"
|
||||
},
|
||||
"inst7": {
|
||||
"release_rate": 208,
|
||||
"envelope": "envelope0",
|
||||
"sound": "07"
|
||||
},
|
||||
"inst8": {
|
||||
"release_rate": 208,
|
||||
"envelope": "envelope0",
|
||||
"sound": "08"
|
||||
},
|
||||
"inst9": {
|
||||
"release_rate": 208,
|
||||
"envelope": "envelope0",
|
||||
"sound": "09"
|
||||
},
|
||||
"inst10": {
|
||||
"release_rate": 208,
|
||||
"envelope": "envelope0",
|
||||
"sound": "0A"
|
||||
},
|
||||
"inst11": {
|
||||
"release_rate": 208,
|
||||
"envelope": "envelope0",
|
||||
"sound": "0B"
|
||||
},
|
||||
"inst12": {
|
||||
"release_rate": 208,
|
||||
"envelope": "envelope0",
|
||||
"sound": "0C"
|
||||
},
|
||||
"inst13": {
|
||||
"release_rate": 208,
|
||||
"envelope": "envelope0",
|
||||
"sound": "0D"
|
||||
},
|
||||
"inst14": {
|
||||
"ifdef": ["VERSION_US", "VERSION_EU"],
|
||||
"release_rate": 208,
|
||||
"envelope": "envelope0",
|
||||
"sound": "0E"
|
||||
},
|
||||
"inst15": {
|
||||
"ifdef": ["VERSION_US", "VERSION_EU"],
|
||||
"release_rate": 208,
|
||||
"envelope": "envelope0",
|
||||
"sound": "0F"
|
||||
},
|
||||
"inst16": {
|
||||
"ifdef": ["VERSION_US", "VERSION_EU"],
|
||||
"release_rate": 208,
|
||||
"envelope": "envelope0",
|
||||
"sound": "10"
|
||||
},
|
||||
"inst17": {
|
||||
"ifdef": ["VERSION_US", "VERSION_EU"],
|
||||
"release_rate": 208,
|
||||
"envelope": "envelope0",
|
||||
"sound": "11"
|
||||
},
|
||||
"inst18": {
|
||||
"ifdef": ["VERSION_US", "VERSION_EU"],
|
||||
"release_rate": 208,
|
||||
"envelope": "envelope0",
|
||||
"sound": "12"
|
||||
},
|
||||
"inst19": {
|
||||
"ifdef": ["VERSION_US", "VERSION_EU"],
|
||||
"release_rate": 208,
|
||||
"envelope": "envelope0",
|
||||
"sound": "13"
|
||||
},
|
||||
"inst20": {
|
||||
"ifdef": ["VERSION_US", "VERSION_EU"],
|
||||
"release_rate": 208,
|
||||
"envelope": "envelope0",
|
||||
"sound": "14"
|
||||
},
|
||||
"inst21": {
|
||||
"ifdef": ["VERSION_US", "VERSION_EU"],
|
||||
"release_rate": 208,
|
||||
"envelope": "envelope0",
|
||||
"sound": "15"
|
||||
},
|
||||
"inst22": {
|
||||
"ifdef": ["VERSION_US", "VERSION_EU"],
|
||||
"release_rate": 208,
|
||||
"envelope": "envelope0",
|
||||
"sound": "16"
|
||||
}
|
||||
},
|
||||
"instrument_list": [
|
||||
"inst0",
|
||||
"inst1",
|
||||
"inst2",
|
||||
null,
|
||||
"inst3",
|
||||
"inst4",
|
||||
"inst5",
|
||||
"inst6",
|
||||
"inst7",
|
||||
"inst8",
|
||||
"inst9",
|
||||
"inst10",
|
||||
"inst11",
|
||||
"inst12",
|
||||
"inst13",
|
||||
"inst14",
|
||||
"inst15",
|
||||
"inst16",
|
||||
"inst17",
|
||||
"inst18",
|
||||
"inst19",
|
||||
"inst20",
|
||||
"inst21",
|
||||
"inst22"
|
||||
]
|
||||
}
|
||||
|
|
@ -60,24 +60,24 @@ struct AudioSessionSettings gAudioSessionPresets[18] = {
|
|||
{ 32000, 16, 1, 0x0A00, 0x47FF, 0x7FFF, 0x3F00, 0x6200, 0x4400, 0x2A80 },
|
||||
{ 32000, 20, 1, 0x0800, 0x37FF, 0x7FFF, 0x3300, 0x5500, 0x4000, 0x1B00 },
|
||||
#else
|
||||
{ 32000, 16, 1, 0x0C00, 0x2FFF, 0x7FFF, 0x3A00, 0x6D00, 0x4400, 0x2A00 },
|
||||
{ 32000, 16, 1, 0x0A00, 0x47FF, 0x7FFF, 0x3A00, 0x6D00, 0x4400, 0x2A00 },
|
||||
{ 32000, 16, 1, 0x1000, 0x2FFF, 0x7FFF, 0x3A00, 0x6D00, 0x4400, 0x2A00 },
|
||||
{ 32000, 16, 1, 0x0E00, 0x3FFF, 0x7FFF, 0x3A00, 0x6D00, 0x4400, 0x2A00 },
|
||||
{ 32000, 16, 1, 0x0C00, 0x4FFF, 0x7FFF, 0x3A00, 0x6D00, 0x4400, 0x2A00 },
|
||||
{ 32000, 16, 1, 0x0C00, 0x2FFF, 0x7FFF, 0x4000, 0x6E00, 0x3F00, 0x2A00 },
|
||||
{ 32000, 16, 1, 0x0A00, 0x47FF, 0x7FFF, 0x4100, 0x6E00, 0x4400, 0x2A80 },
|
||||
{ 32000, 20, 1, 0x0800, 0x37FF, 0x7FFF, 0x34C0, 0x6280, 0x4000, 0x1B00 },
|
||||
{ 32000, 16, 1, 0x0C00, 0x2FFF, 0x7FFF, 0x7400, 0x7400, 0x7400, 0x7400 },
|
||||
{ 32000, 16, 1, 0x0A00, 0x47FF, 0x7FFF, 0x7400, 0x7400, 0x7400, 0x7400 },
|
||||
{ 32000, 16, 1, 0x1000, 0x2FFF, 0x7FFF, 0x7400, 0x7400, 0x7400, 0x7400 },
|
||||
{ 32000, 16, 1, 0x0E00, 0x3FFF, 0x7FFF, 0x7400, 0x7400, 0x7400, 0x7400 },
|
||||
{ 32000, 16, 1, 0x0C00, 0x4FFF, 0x7FFF, 0x7400, 0x7400, 0x7400, 0x7400 },
|
||||
{ 32000, 16, 1, 0x0C00, 0x2FFF, 0x7FFF, 0x7400, 0x7400, 0x7400, 0x7400 },
|
||||
{ 32000, 16, 1, 0x0A00, 0x47FF, 0x7FFF, 0x7400, 0x7400, 0x7400, 0x7400 },
|
||||
{ 32000, 20, 1, 0x0800, 0x37FF, 0x7FFF, 0x7400, 0x7400, 0x7400, 0x7400 },
|
||||
#endif
|
||||
{ 27000, 16, 1, 0x0800, 0x2FFF, 0x7FFF, 0x2500, 0x5500, 0x7400, 0x2400 },
|
||||
{ 27000, 16, 1, 0x0800, 0x3FFF, 0x7FFF, 0x2500, 0x5500, 0x7400, 0x2400 },
|
||||
{ 27000, 16, 1, 0x1000, 0x2FFF, 0x7FFF, 0x2500, 0x5500, 0x7400, 0x2400 },
|
||||
{ 27000, 16, 1, 0x1000, 0x3FFF, 0x7FFF, 0x2500, 0x5500, 0x7400, 0x2400 },
|
||||
{ 27000, 16, 1, 0x0C00, 0x4FFF, 0x7FFF, 0x2500, 0x5500, 0x7400, 0x2400 },
|
||||
{ 32000, 14, 1, 0x0800, 0x2FFF, 0x7FFF, 0x2500, 0x5500, 0x7400, 0x2400 },
|
||||
{ 32000, 12, 1, 0x0800, 0x2FFF, 0x7FFF, 0x2500, 0x5500, 0x7400, 0x2400 },
|
||||
{ 32000, 10, 1, 0x0800, 0x2FFF, 0x7FFF, 0x2500, 0x5500, 0x7400, 0x2400 },
|
||||
{ 32000, 8, 1, 0x0800, 0x2FFF, 0x7FFF, 0x2500, 0x5500, 0x7400, 0x2400 },
|
||||
{ 27000, 16, 1, 0x0800, 0x2FFF, 0x7FFF, 0x7400, 0x7400, 0x7400, 0x7400 },
|
||||
{ 27000, 16, 1, 0x0800, 0x3FFF, 0x7FFF, 0x7400, 0x7400, 0x7400, 0x7400 },
|
||||
{ 27000, 16, 1, 0x1000, 0x2FFF, 0x7FFF, 0x7400, 0x7400, 0x7400, 0x7400 },
|
||||
{ 27000, 16, 1, 0x1000, 0x3FFF, 0x7FFF, 0x7400, 0x7400, 0x7400, 0x7400 },
|
||||
{ 27000, 16, 1, 0x0C00, 0x4FFF, 0x7FFF, 0x7400, 0x7400, 0x7400, 0x7400 },
|
||||
{ 32000, 14, 1, 0x0800, 0x2FFF, 0x7FFF, 0x7400, 0x7400, 0x7400, 0x7400 },
|
||||
{ 32000, 12, 1, 0x0800, 0x2FFF, 0x7FFF, 0x7400, 0x7400, 0x7400, 0x7400 },
|
||||
{ 32000, 10, 1, 0x0800, 0x2FFF, 0x7FFF, 0x7400, 0x7400, 0x7400, 0x7400 },
|
||||
{ 32000, 8, 1, 0x0800, 0x2FFF, 0x7FFF, 0x7400, 0x7400, 0x7400, 0x7400 },
|
||||
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }
|
||||
};
|
||||
#endif
|
||||
|
|
@ -377,15 +377,15 @@ s16 *gWaveSamples[4] = { sSawtoothWave, sTriangleWave, sSineWave, sSquareWave };
|
|||
|
||||
#ifdef VERSION_EU
|
||||
u8 euUnknownData_8030194c[4] = { 0x40, 0x20, 0x10, 0x08 };
|
||||
u16 gHeadsetPanQuantization[0x10] = {
|
||||
0x40, 0x40, 0x30, 0x30, 0x20, 0x20, 0x10, 0, 0, 0,
|
||||
u16 gHeadsetPanQuantization[0x11] = {
|
||||
0x40, 0x40, 0x30, 0x30, 0x20, 0x20, 0x10, 0, 0, 0, 0x30,
|
||||
};
|
||||
s32 euUnknownData_80301950[32] = { //maybe envelope of some kind?
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 500, 0, 0, 0, 500, 0, 0, 0, 500, 0, 0, 0, 500, 0, 0,
|
||||
};
|
||||
#else
|
||||
u16 gHeadsetPanQuantization[10] = { 0x40, 0x30, 0x20, 0x10, 0, 0, 0, 0, 0, 0 };
|
||||
u16 gHeadsetPanQuantization[11] = { 0x40, 0x30, 0x20, 0x10, 0, 0, 0, 0, 0, 0, 0x20 };
|
||||
#endif
|
||||
|
||||
// Linearly interpolated between
|
||||
|
|
|
|||
|
|
@ -41,12 +41,12 @@ extern s16 *gWaveSamples[4];
|
|||
|
||||
#ifdef VERSION_EU
|
||||
extern u8 euUnknownData_8030194c[4];
|
||||
extern u16 gHeadsetPanQuantization[0x10];
|
||||
extern u16 gHeadsetPanQuantization[0x11];
|
||||
extern s32 euUnknownData_80301950[32];
|
||||
extern struct NoteSubEu gZeroNoteSub;
|
||||
extern struct NoteSubEu gDefaultNoteSub;
|
||||
#else
|
||||
extern u16 gHeadsetPanQuantization[10];
|
||||
extern u16 gHeadsetPanQuantization[11];
|
||||
#endif
|
||||
extern f32 gHeadsetPanVolume[128];
|
||||
extern f32 gStereoPanVolume[128];
|
||||
|
|
|
|||
|
|
@ -153,7 +153,7 @@ u8 audioString118__[] = "";
|
|||
// N.B. sound banks are different from the audio banks referred to in other
|
||||
// files. We should really fix our naming to be less ambiguous...
|
||||
#define MAX_BG_MUSIC_QUEUE_SIZE 6
|
||||
#define SOUND_BANK_COUNT 10
|
||||
#define SOUND_BANK_COUNT 11
|
||||
#define MAX_CHANNELS_PER_SOUND 1
|
||||
|
||||
#define SEQUENCE_NONE 0xFF
|
||||
|
|
@ -448,10 +448,10 @@ STATIC_ASSERT(ARRAY_COUNT(sBackgroundMusicDefaultVolume) == SEQ_COUNT,
|
|||
|
||||
u8 sPlayer0CurSeqId = SEQUENCE_NONE;
|
||||
u8 sMusicDynamicDelay = 0;
|
||||
u8 D_803320A4[SOUND_BANK_COUNT] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; // pointers to head of list
|
||||
u8 D_803320B0[SOUND_BANK_COUNT] = { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 }; // pointers to head of list
|
||||
u8 D_803320BC[SOUND_BANK_COUNT] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; // only used for debugging
|
||||
u8 sMaxChannelsForSoundBank[SOUND_BANK_COUNT] = { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 };
|
||||
u8 D_803320A4[SOUND_BANK_COUNT] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; // pointers to head of list
|
||||
u8 D_803320B0[SOUND_BANK_COUNT] = { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 }; // pointers to head of list
|
||||
u8 D_803320BC[SOUND_BANK_COUNT] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; // only used for debugging
|
||||
u8 sMaxChannelsForSoundBank[SOUND_BANK_COUNT] = { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 };
|
||||
|
||||
// Banks 2 and 7 both grew from 0x30 sounds to 0x40 in size in US.
|
||||
#ifdef VERSION_JP
|
||||
|
|
@ -460,7 +460,7 @@ u8 sMaxChannelsForSoundBank[SOUND_BANK_COUNT] = { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 }
|
|||
#define BANK27_SIZE 0x40
|
||||
#endif
|
||||
u8 sNumSoundsPerBank[SOUND_BANK_COUNT] = {
|
||||
0x70, 0x30, BANK27_SIZE, 0x80, 0x20, 0x80, 0x20, BANK27_SIZE, 0x80, 0x80,
|
||||
0x70, 0x30, BANK27_SIZE, 0x80, 0x20, 0x80, 0x20, BANK27_SIZE, 0x80, 0x80, BANK27_SIZE
|
||||
};
|
||||
#undef BANK27_SIZE
|
||||
|
||||
|
|
@ -1296,6 +1296,7 @@ void update_game_sound(void) {
|
|||
break;
|
||||
case 0:
|
||||
case 2:
|
||||
case 10: // custom luigi audio bank 10
|
||||
#ifdef VERSION_EU
|
||||
func_802ad770(0x05020000 | ((channelIndex & 0xff) << 8),
|
||||
get_sound_reverb(bankIndex, index, channelIndex));
|
||||
|
|
|
|||
|
|
@ -19,8 +19,8 @@
|
|||
#endif
|
||||
#endif
|
||||
|
||||
#define LAYERS_MAX 4
|
||||
#define CHANNELS_MAX 16
|
||||
#define LAYERS_MAX 8
|
||||
#define CHANNELS_MAX 32
|
||||
|
||||
#define NO_LAYER ((struct SequenceChannelLayer *)(-1))
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
#include "internal.h"
|
||||
|
||||
#define AUDIO_FRAME_DMA_QUEUE_SIZE 0x40
|
||||
#define AUDIO_FRAME_DMA_QUEUE_SIZE 0x80
|
||||
|
||||
#define PRELOAD_BANKS 2
|
||||
#define PRELOAD_SEQUENCE 1
|
||||
|
|
|
|||
|
|
@ -456,3 +456,15 @@ void render_game(void) {
|
|||
D_8032CE74 = NULL;
|
||||
D_8032CE78 = 0;
|
||||
}
|
||||
|
||||
void get_area_minimum_y(u8* hasMinY, f32* minY) {
|
||||
switch (gCurrCourseNum) {
|
||||
case COURSE_WF: *hasMinY = TRUE; *minY = 8; break;
|
||||
case COURSE_CCM: *hasMinY = TRUE; *minY = (gCurrAreaIndex == 2) ? -5856 : -5068; break;
|
||||
case COURSE_PSS: *hasMinY = TRUE; *minY = -4600; break;
|
||||
case COURSE_BITDW: *hasMinY = TRUE; *minY = -3416; break;
|
||||
case COURSE_TTM: *hasMinY = (gCurrAreaIndex == 1) ? TRUE : FALSE; *minY = -6000; break;
|
||||
case COURSE_RR: *hasMinY = TRUE; *minY = -4790; break;
|
||||
case COURSE_BITS: *hasMinY = TRUE; *minY = -5065; break;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -163,4 +163,6 @@ void play_transition(s16 transType, s16 time, u8 red, u8 green, u8 blue);
|
|||
void play_transition_after_delay(s16 transType, s16 time, u8 red, u8 green, u8 blue, s16 delay);
|
||||
void render_game(void);
|
||||
|
||||
void get_area_minimum_y(u8* hasMinY, f32* minY);
|
||||
|
||||
#endif // AREA_H
|
||||
|
|
|
|||
|
|
@ -9,7 +9,9 @@ void bub_spawner_act_0(void) {
|
|||
s32 i;
|
||||
s32 sp18 = o->oBirdChirpChirpUnkF4;
|
||||
#ifndef NODRAWINGDISTANCE
|
||||
if (o->oDistanceToMario < 1500.0f) {
|
||||
struct Object* player = nearest_player_to_object(o);
|
||||
int distanceToPlayer = dist_between_objects(o, player);
|
||||
if (distanceToPlayer < 1500.0f) {
|
||||
#endif
|
||||
for (i = 0; i < sp18; i++)
|
||||
spawn_object(o, MODEL_BUB, bhvBub);
|
||||
|
|
@ -60,6 +62,7 @@ void bub_act_0(void) {
|
|||
void bub_act_1(void) {
|
||||
struct Object* player = nearest_player_to_object(o);
|
||||
int distanceToPlayer = dist_between_objects(o, player);
|
||||
int angleToPlayer = obj_angle_to_object(o, player);
|
||||
f32 dy;
|
||||
if (o->oTimer == 0) {
|
||||
o->oForwardVel = random_float() * 2 + 2;
|
||||
|
|
@ -79,9 +82,9 @@ void bub_act_1(void) {
|
|||
o->oPosY = o->oPosY - 1.0f;
|
||||
}
|
||||
if (800.0f < cur_obj_lateral_dist_from_mario_to_home())
|
||||
o->oAngleToMario = cur_obj_angle_to_home();
|
||||
cur_obj_rotate_yaw_toward(o->oAngleToMario, 0x100);
|
||||
if (o->oDistanceToMario < 200.0f)
|
||||
angleToPlayer = cur_obj_angle_to_home();
|
||||
cur_obj_rotate_yaw_toward(angleToPlayer, 0x100);
|
||||
if (distanceToPlayer < 200.0f)
|
||||
if (distanceToPlayer < 0.5)
|
||||
o->oAction = 2;
|
||||
if (o->oInteractStatus & INT_STATUS_INTERACTED)
|
||||
|
|
@ -90,6 +93,7 @@ void bub_act_1(void) {
|
|||
|
||||
void bub_act_2(void) {
|
||||
struct Object* player = nearest_player_to_object(o);
|
||||
int distanceToPlayer = dist_between_objects(o, player);
|
||||
int angleToPlayer = obj_angle_to_object(o, player);
|
||||
f32 dy;
|
||||
if (o->oTimer < 20) {
|
||||
|
|
@ -117,7 +121,7 @@ void bub_act_2(void) {
|
|||
if (cur_obj_lateral_dist_from_mario_to_home() > 800.0f)
|
||||
angleToPlayer = cur_obj_angle_to_home();
|
||||
cur_obj_rotate_yaw_toward(angleToPlayer + 0x8000, 0x400);
|
||||
if (o->oTimer > 200 && o->oDistanceToMario > 600.0f)
|
||||
if (o->oTimer > 200 && distanceToPlayer > 600.0f)
|
||||
o->oAction = 1;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -145,9 +145,9 @@ static void cloud_act_main(void) {
|
|||
} else if (o->oBehParams2ndByte != CLOUD_BP_FWOOSH) {
|
||||
// This code should never run, since a lakitu cloud should always have
|
||||
// a parent
|
||||
if (o->oDistanceToMario > 1500.0f) {
|
||||
/*if (o->oDistanceToMario > 1500.0f) {
|
||||
o->oAction = CLOUD_ACT_UNLOAD;
|
||||
}
|
||||
}*/
|
||||
} else {
|
||||
cloud_fwoosh_update();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -96,11 +96,12 @@ void bhv_klepto_init(void) {
|
|||
o->oKleptoStartPosY = o->oPosY;
|
||||
o->oKleptoStartPosZ = o->oPosZ;
|
||||
|
||||
if (save_file_get_flags() & SAVE_FLAG_CAP_ON_KLEPTO) {
|
||||
o->oAnimState = KLEPTO_ANIM_STATE_HOLDING_CAP;
|
||||
} else {
|
||||
// skip hat save flags
|
||||
//if (save_file_get_flags() & SAVE_FLAG_CAP_ON_KLEPTO) {
|
||||
// o->oAnimState = KLEPTO_ANIM_STATE_HOLDING_CAP;
|
||||
//} else {
|
||||
o->oAction = KLEPTO_ACT_WAIT_FOR_MARIO;
|
||||
}
|
||||
//}
|
||||
}
|
||||
|
||||
struct SyncObject* so = network_init_object(o, 4000.0f);
|
||||
|
|
@ -290,7 +291,7 @@ static void klepto_act_dive_at_mario(void) {
|
|||
&& !(marioState->action & (ACT_FLAG_SHORT_HITBOX | ACT_FLAG_BUTT_OR_STOMACH_SLIDE))
|
||||
&& distanceToPlayer < 200.0f && dy > 50.0f && dy < 90.0f) {
|
||||
if (network_owns_object(o) && mario_lose_cap_to_enemy(marioState, 1)) {
|
||||
o->oAnimState = KLEPTO_ANIM_STATE_HOLDING_CAP;
|
||||
o->oAnimState = marioState->character->capKleptoAnimState;
|
||||
network_send_object(o);
|
||||
}
|
||||
}
|
||||
|
|
@ -413,12 +414,22 @@ void bhv_klepto_update(void) {
|
|||
if (obj_handle_attacks(&sKleptoHitbox, o->oAction, sKleptoAttackHandlers)) {
|
||||
cur_obj_play_sound_2(SOUND_OBJ_KLEPTO2);
|
||||
|
||||
if (network_owns_object(o) && o->oAnimState == KLEPTO_ANIM_STATE_HOLDING_CAP) {
|
||||
u8 kleptoHoldingCap = FALSE;
|
||||
u32 capModel = MODEL_MARIOS_CAP;
|
||||
for (int i = 0; i < CT_MAX; i++) {
|
||||
if (o->oAnimState == gCharacters[i].capKleptoAnimState) {
|
||||
kleptoHoldingCap = TRUE;
|
||||
capModel = gCharacters[i].capModelId;
|
||||
}
|
||||
}
|
||||
|
||||
if (network_owns_object(o) && kleptoHoldingCap) {
|
||||
save_file_clear_flags(SAVE_FLAG_CAP_ON_KLEPTO);
|
||||
struct Object* cap = spawn_object(o, MODEL_MARIOS_CAP, bhvNormalCap);
|
||||
|
||||
struct Object* cap = spawn_object(o, capModel, bhvNormalCap);
|
||||
|
||||
struct Object* spawn_objects[] = { cap };
|
||||
u32 models[] = { MODEL_MARIOS_CAP };
|
||||
u32 models[] = { capModel };
|
||||
network_send_spawn_objects(spawn_objects, models, 1);
|
||||
|
||||
} else if (o->oAnimState == KLEPTO_ANIM_STATE_HOLDING_STAR) {
|
||||
|
|
|
|||
|
|
@ -371,6 +371,10 @@ static void koopa_shelled_update(void) {
|
|||
* action.
|
||||
*/
|
||||
static void koopa_unshelled_act_run(void) {
|
||||
struct Object* player = nearest_player_to_object(o);
|
||||
int distanceToPlayer = dist_between_objects(o, player);
|
||||
int angleToPlayer = obj_angle_to_object(o, player);
|
||||
|
||||
f32 distToShell = 99999.0f;
|
||||
struct Object *shell;
|
||||
|
||||
|
|
@ -380,9 +384,6 @@ static void koopa_unshelled_act_run(void) {
|
|||
if (o->oKoopaTurningAwayFromWall) {
|
||||
o->oKoopaTurningAwayFromWall = obj_resolve_collisions_and_turn(o->oKoopaTargetYaw, 0x600);
|
||||
} else {
|
||||
struct Object* player = nearest_player_to_object(o);
|
||||
int distanceToPlayer = dist_between_objects(o, player);
|
||||
int angleToPlayer = obj_angle_to_object(o, player);
|
||||
|
||||
// If far from home, then turn toward home
|
||||
if (distanceToPlayer >= 25000.0f) {
|
||||
|
|
@ -413,7 +414,7 @@ static void koopa_unshelled_act_run(void) {
|
|||
cur_obj_rotate_yaw_toward(o->oKoopaTargetYaw, 0x600);
|
||||
} else {
|
||||
// otherwise continue running from mario
|
||||
cur_obj_rotate_yaw_toward(o->oAngleToMario + 0x8000, 0x600);
|
||||
cur_obj_rotate_yaw_toward(angleToPlayer + 0x8000, 0x600);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -215,8 +215,11 @@ static void monty_mole_act_select_hole(void) {
|
|||
o->oPosY = o->oFloorHeight = o->oMontyMoleCurrentHole->oPosY;
|
||||
o->oPosZ = o->oMontyMoleCurrentHole->oPosZ;
|
||||
|
||||
struct Object* holePlayer = nearest_player_to_object(o->oMontyMoleCurrentHole);
|
||||
int angleToHolePlayer = obj_angle_to_object(o->oMontyMoleCurrentHole, holePlayer);
|
||||
|
||||
o->oFaceAnglePitch = 0;
|
||||
o->oMoveAngleYaw = o->oMontyMoleCurrentHole->oAngleToMario;
|
||||
o->oMoveAngleYaw = angleToHolePlayer;
|
||||
|
||||
struct Object* player = nearest_player_to_object(o);
|
||||
int distanceToPlayer = dist_between_objects(o, player);
|
||||
|
|
|
|||
|
|
@ -149,10 +149,13 @@ void bhv_blue_coin_sliding_jumping_init(void) {
|
|||
}
|
||||
|
||||
void blue_coin_sliding_away_from_mario(void) {
|
||||
struct Object* player = nearest_player_to_object(o);
|
||||
int angleToPlayer = obj_angle_to_object(o, player);
|
||||
|
||||
s16 collisionFlags;
|
||||
|
||||
o->oForwardVel = 15.0;
|
||||
o->oMoveAngleYaw = o->oAngleToMario + 0x8000;
|
||||
o->oMoveAngleYaw = angleToPlayer + 0x8000;
|
||||
|
||||
if (coin_step(&collisionFlags) != 0)
|
||||
o->oVelY += 18.0f;
|
||||
|
|
|
|||
|
|
@ -39,6 +39,9 @@ void bhv_piranha_plant_bubble_loop(void) {
|
|||
|
||||
cur_obj_set_pos_relative(parent, 0, 72.0f, 180.0f);
|
||||
|
||||
struct Object* parentPlayer = nearest_player_to_object(parent);
|
||||
int distanceToParentPlayer = dist_between_objects(parent, parentPlayer);
|
||||
|
||||
switch (o->oAction) {
|
||||
case PIRANHA_PLANT_BUBBLE_ACT_IDLE:
|
||||
cur_obj_disable_rendering();
|
||||
|
|
@ -50,7 +53,7 @@ void bhv_piranha_plant_bubble_loop(void) {
|
|||
break;
|
||||
|
||||
case PIRANHA_PLANT_BUBBLE_ACT_GROW_SHRINK_LOOP:
|
||||
if (parent->oDistanceToMario < parent->oDrawingDistance) {
|
||||
if (distanceToParentPlayer < parent->oDrawingDistance) {
|
||||
cur_obj_enable_rendering();
|
||||
|
||||
if (parent->oAction == PIRANHA_PLANT_ACT_SLEEPING) {
|
||||
|
|
|
|||
|
|
@ -96,6 +96,19 @@ static void racing_penguin_act_race(void) {
|
|||
f32 targetSpeed;
|
||||
f32 minSpeed;
|
||||
|
||||
// prevent segfault / error state
|
||||
if (o->oPathedStartWaypoint == NULL) {
|
||||
struct Object* child;
|
||||
child = cur_obj_nearest_object_with_behavior(bhvPenguinRaceFinishLine);
|
||||
child->parentObj = o;
|
||||
|
||||
child = cur_obj_nearest_object_with_behavior(bhvPenguinRaceShortcutCheck);
|
||||
child->parentObj = o;
|
||||
|
||||
o->oPathedStartWaypoint = o->oPathedPrevWaypoint = segmented_to_virtual(ccm_seg7_trajectory_penguin_race);
|
||||
o->oPathedPrevWaypointFlags = 0;
|
||||
}
|
||||
|
||||
if (cur_obj_follow_path(0) == PATH_REACHED_END) {
|
||||
o->oRacingPenguinReachedBottom = TRUE;
|
||||
o->oAction = RACING_PENGUIN_ACT_FINISH_RACE;
|
||||
|
|
|
|||
|
|
@ -61,11 +61,11 @@ void bhv_scuttlebug_loop(void) {
|
|||
case 1:
|
||||
o->oForwardVel = 5.0f;
|
||||
if (cur_obj_lateral_dist_from_obj_to_home(player) > 1000.0f)
|
||||
o->oAngleToMario = angleToPlayer;
|
||||
angleToPlayer = angleToPlayer;
|
||||
else {
|
||||
if (o->oScuttlebugUnkF8 == 0) {
|
||||
o->oScuttlebugUnkFC = 0;
|
||||
o->oAngleToMario = obj_angle_to_object(o, player);
|
||||
angleToPlayer = obj_angle_to_object(o, player);
|
||||
if (abs_angle_diff(angleToPlayer, o->oMoveAngleYaw) < 0x800) {
|
||||
o->oScuttlebugUnkF8 = 1;
|
||||
o->oVelY = 20.0f;
|
||||
|
|
@ -84,11 +84,11 @@ void bhv_scuttlebug_loop(void) {
|
|||
break;
|
||||
case 2:
|
||||
o->oForwardVel = 5.0f;
|
||||
if ((s16) o->oMoveAngleYaw == (s16) o->oAngleToMario)
|
||||
if ((s16) o->oMoveAngleYaw == (s16)angleToPlayer)
|
||||
o->oSubAction = 1;
|
||||
if (o->oPosY - o->oHomeY < -200.0f)
|
||||
obj_mark_for_deletion(o);
|
||||
cur_obj_rotate_yaw_toward(o->oAngleToMario, 0x400);
|
||||
cur_obj_rotate_yaw_toward(angleToPlayer, 0x400);
|
||||
break;
|
||||
case 3:
|
||||
o->oFlags &= ~8;
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ void bhv_bowser_shock_wave_loop(void) {
|
|||
sp20 = o->oBowserShockWaveUnkF4 * D_8032F420[3];
|
||||
if ((sp2C < o->oDistanceToMario && o->oDistanceToMario < sp28)
|
||||
|| (sp24 < o->oDistanceToMario && o->oDistanceToMario < sp20))
|
||||
gMarioObject->oInteractStatus |=
|
||||
gMarioStates[0].marioObj->oInteractStatus |=
|
||||
0x10; // This is interact_coin, but the name sounds wrong in this behiavor
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -30,9 +30,9 @@ void bhv_spindrift_loop(void) {
|
|||
case 0:
|
||||
approach_forward_vel(&o->oForwardVel, 4.0f, 1.0f);
|
||||
if (cur_obj_lateral_dist_from_mario_to_home() > 1000.0f)
|
||||
o->oAngleToMario = cur_obj_angle_to_home();
|
||||
angleToPlayer = cur_obj_angle_to_home();
|
||||
else if (distanceToPlayer > 300.0f)
|
||||
o->oAngleToMario = angleToPlayer;
|
||||
angleToPlayer = angleToPlayer;
|
||||
cur_obj_rotate_yaw_toward(angleToPlayer, 0x400);
|
||||
break;
|
||||
case 1:
|
||||
|
|
|
|||
|
|
@ -638,12 +638,13 @@ void hat_ukiki_held_loop(void) {
|
|||
* Initializatation for ukiki, determines if it has Mario's hat.
|
||||
*/
|
||||
void bhv_ukiki_init(void) {
|
||||
if (o->oBehParams2ndByte == UKIKI_HAT) {
|
||||
if (save_file_get_flags() & SAVE_FLAG_CAP_ON_UKIKI) {
|
||||
o->oUkikiTextState = UKIKI_TEXT_HAS_HAT;
|
||||
o->oUkikiHasHat |= UKIKI_HAT_ON;
|
||||
}
|
||||
}
|
||||
// skip hat save flags
|
||||
//if (o->oBehParams2ndByte == UKIKI_HAT) {
|
||||
// if (save_file_get_flags() & SAVE_FLAG_CAP_ON_UKIKI) {
|
||||
// o->oUkikiTextState = UKIKI_TEXT_HAS_HAT;
|
||||
// o->oUkikiHasHat |= UKIKI_HAT_ON;
|
||||
// }
|
||||
//}
|
||||
|
||||
network_init_object(o, 4000.0f);
|
||||
network_init_object_field(o, &o->oUkikiTauntCounter);
|
||||
|
|
@ -684,7 +685,13 @@ void bhv_ukiki_loop(void) {
|
|||
}
|
||||
|
||||
if (o->oUkikiHasHat & UKIKI_HAT_ON) {
|
||||
o->oAnimState = UKIKI_ANIM_STATE_HAT_ON;
|
||||
for (int i = 0; i < MAX_PLAYERS; i++) {
|
||||
if (!is_player_active(&gMarioStates[i])) { continue; }
|
||||
if (!does_mario_have_hat(&gMarioStates[i])) {
|
||||
o->oAnimState = gMarioStates[i].character->capUkikiAnimState;
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
o->oAnimState = UKIKI_ANIM_STATE_DEFAULT;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -108,6 +108,7 @@ void bhv_wiggler_body_part_update(void) {
|
|||
if (o->parentObj->oAction == WIGGLER_ACT_SHRINK) {
|
||||
cur_obj_become_intangible();
|
||||
} else {
|
||||
cur_obj_become_tangible();
|
||||
obj_check_attacks(&sWigglerBodyPartHitbox, o->oAction);
|
||||
}
|
||||
}
|
||||
|
|
@ -235,7 +236,7 @@ static void wiggler_act_walk(void) {
|
|||
|
||||
// If Mario is positioned below the wiggler, assume he entered through the
|
||||
// lower cave entrance, so don't display text.
|
||||
if (player->oPosY < o->oPosY || (should_start_or_continue_dialog(marioState, o) && cur_obj_update_dialog_with_cutscene(marioState, 2, 0, CUTSCENE_DIALOG, DIALOG_150, wiggler_act_walk_continue_dialog) != 0)) {
|
||||
if (player->oPosY < o->oPosY || (cur_obj_update_dialog_with_cutscene(&gMarioStates[0], 2, 0, CUTSCENE_DIALOG, DIALOG_150, wiggler_act_walk_continue_dialog) != 0)) {
|
||||
o->oWigglerTextStatus = WIGGLER_TEXT_STATUS_COMPLETED_DIALOG;
|
||||
network_send_object_reliability(o, TRUE);
|
||||
}
|
||||
|
|
@ -280,6 +281,7 @@ static void wiggler_act_walk(void) {
|
|||
obj_face_pitch_approach(0, 0x320);
|
||||
|
||||
// For the first two seconds of walking, stay invulnerable
|
||||
cur_obj_become_tangible();
|
||||
if (o->oTimer < 60) {
|
||||
obj_check_attacks(&sWigglerHitbox, o->oAction);
|
||||
} else if (obj_handle_attacks(&sWigglerHitbox, o->oAction, sWigglerAttackHandlers)) {
|
||||
|
|
@ -415,11 +417,13 @@ u8 bhv_wiggler_ignore_if_true(void) {
|
|||
}
|
||||
|
||||
static Vec3f wigglerPrePos = { 0 };
|
||||
static u8 wigglerCompletedDialog = FALSE;
|
||||
|
||||
void bhv_wiggler_on_received_pre(u8 localIndex) {
|
||||
wigglerPrePos[0] = o->oPosX;
|
||||
wigglerPrePos[1] = o->oPosY;
|
||||
wigglerPrePos[2] = o->oPosZ;
|
||||
wigglerCompletedDialog = (o->oWigglerTextStatus == WIGGLER_TEXT_STATUS_COMPLETED_DIALOG);
|
||||
}
|
||||
|
||||
void bhv_wiggler_on_received_post(u8 localIndex) {
|
||||
|
|
@ -432,6 +436,9 @@ void bhv_wiggler_on_received_post(u8 localIndex) {
|
|||
o->oWigglerSegments[i].posY += posDiff[1];
|
||||
o->oWigglerSegments[i].posZ += posDiff[2];
|
||||
}
|
||||
if (wigglerCompletedDialog) {
|
||||
o->oWigglerTextStatus = WIGGLER_TEXT_STATUS_COMPLETED_DIALOG;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -562,6 +562,14 @@ static void newcam_set_pan(void) {
|
|||
newcam_pan_z = newcam_pan_z*(min(newcam_distance/newcam_distance_target,1));
|
||||
}
|
||||
|
||||
static void newcam_level_bounds() {
|
||||
u8 hasMinY = FALSE;
|
||||
f32 minY = 0;
|
||||
get_area_minimum_y(&hasMinY, &minY);
|
||||
if (!hasMinY) { return; }
|
||||
newcam_pos[1] = MAX(newcam_pos[1], minY);
|
||||
}
|
||||
|
||||
static void newcam_position_cam(void) {
|
||||
f32 floorY = 0;
|
||||
f32 floorY2 = 0;
|
||||
|
|
@ -595,6 +603,7 @@ static void newcam_position_cam(void) {
|
|||
if (newcam_modeflags & NC_FLAG_FOCUSZ)
|
||||
newcam_lookat[2] = newcam_pos_target[2]-newcam_pan_z;
|
||||
|
||||
newcam_level_bounds();
|
||||
if (newcam_modeflags & NC_FLAG_COLLISION) {
|
||||
newcam_collision();
|
||||
newcam_bounding_box();
|
||||
|
|
|
|||
|
|
@ -1,16 +1,119 @@
|
|||
#include "types.h"
|
||||
#include "characters.h"
|
||||
#include "hud.h"
|
||||
#include "model_ids.h"
|
||||
#include "object_constants.h"
|
||||
#include "audio_defines.h"
|
||||
#include "luigi_audio_defines.h"
|
||||
#include "pc/configfile.h"
|
||||
|
||||
struct Character gCharacters[CT_MAX] = {
|
||||
[CT_MARIO] = {
|
||||
.hudHead = ',',
|
||||
.cameraHudHead = GLYPH_CAM_MARIO_HEAD,
|
||||
.modelId = MODEL_MARIO,
|
||||
.capModelId = MODEL_MARIOS_CAP,
|
||||
.capKleptoAnimState = KLEPTO_ANIM_STATE_HOLDING_CAP,
|
||||
.capUkikiAnimState = UKIKI_ANIM_STATE_HAT_ON,
|
||||
// sounds
|
||||
.soundYahWahHoo = SOUND_MARIO_YAH_WAH_HOO,
|
||||
.soundHoohoo = SOUND_MARIO_HOOHOO,
|
||||
.soundYahoo = SOUND_MARIO_YAHOO,
|
||||
.soundUh = SOUND_MARIO_UH,
|
||||
.soundHrmm = SOUND_MARIO_HRMM,
|
||||
.soundWah2 = SOUND_MARIO_WAH2,
|
||||
.soundWhoa = SOUND_MARIO_WHOA,
|
||||
.soundEeuh = SOUND_MARIO_EEUH,
|
||||
.soundAttacked = SOUND_MARIO_ATTACKED,
|
||||
.soundOoof = SOUND_MARIO_OOOF,
|
||||
.soundOoof2 = SOUND_MARIO_OOOF2,
|
||||
.soundHereWeGo = SOUND_MARIO_HERE_WE_GO,
|
||||
.soundYawning = SOUND_MARIO_YAWNING,
|
||||
.soundSnoring1 = SOUND_MARIO_SNORING1,
|
||||
.soundSnoring2 = SOUND_MARIO_SNORING2,
|
||||
.soundWaaaooow = SOUND_MARIO_WAAAOOOW,
|
||||
.soundHaha = SOUND_MARIO_HAHA,
|
||||
.soundHaha_2 = SOUND_MARIO_HAHA_2,
|
||||
.soundUh2 = SOUND_MARIO_UH2,
|
||||
.soundUh2_2 = SOUND_MARIO_UH2_2,
|
||||
.soundOnFire = SOUND_MARIO_ON_FIRE,
|
||||
.soundDying = SOUND_MARIO_DYING,
|
||||
.soundPantingCold = SOUND_MARIO_PANTING_COLD,
|
||||
.soundPanting = SOUND_MARIO_PANTING,
|
||||
.soundCoughing1 = SOUND_MARIO_COUGHING1,
|
||||
.soundCoughing2 = SOUND_MARIO_COUGHING2,
|
||||
.soundCoughing3 = SOUND_MARIO_COUGHING3,
|
||||
.soundPunchYah = SOUND_MARIO_PUNCH_YAH,
|
||||
.soundPunchHoo = SOUND_MARIO_PUNCH_HOO,
|
||||
.soundMamaMia = SOUND_MARIO_MAMA_MIA,
|
||||
.soundGroundPoundWah = SOUND_MARIO_GROUND_POUND_WAH,
|
||||
.soundDrowning = SOUND_MARIO_DROWNING,
|
||||
.soundPunchWah = SOUND_MARIO_PUNCH_WAH,
|
||||
.soundYahooWahaYippee = SOUND_MARIO_YAHOO_WAHA_YIPPEE,
|
||||
.soundDoh = SOUND_MARIO_DOH,
|
||||
.soundGameOver = SOUND_MARIO_GAME_OVER,
|
||||
.soundHello = SOUND_MARIO_HELLO,
|
||||
.soundPressStartToPlay = SOUND_MARIO_PRESS_START_TO_PLAY,
|
||||
.soundTwirlBounce = SOUND_MARIO_TWIRL_BOUNCE,
|
||||
.soundSnoring3 = SOUND_MARIO_SNORING3,
|
||||
.soundSoLongaBowser = SOUND_MARIO_SO_LONGA_BOWSER,
|
||||
.soundImaTired = SOUND_MARIO_IMA_TIRED,
|
||||
},
|
||||
|
||||
[CT_LUIGI] = {
|
||||
.hudHead = '.',
|
||||
.cameraHudHead = GLYPH_CAM_LUIGI_HEAD,
|
||||
.modelId = MODEL_LUIGI,
|
||||
.capModelId = MODEL_LUIGIS_CAP,
|
||||
.capKleptoAnimState = KLEPTO_ANIM_STATE_HOLDING_CAP_LUIGI,
|
||||
.capUkikiAnimState = UKIKI_ANIM_STATE_HAT_ON_LUIGI,
|
||||
// sounds
|
||||
.soundYahWahHoo = SOUND_LUIGI_YAH_WAH_HOO,
|
||||
.soundHoohoo = SOUND_LUIGI_HOOHOO,
|
||||
.soundYahoo = SOUND_LUIGI_YAHOO,
|
||||
.soundUh = SOUND_LUIGI_UH,
|
||||
.soundHrmm = SOUND_LUIGI_HRMM,
|
||||
.soundWah2 = SOUND_LUIGI_WAH2,
|
||||
.soundWhoa = SOUND_LUIGI_WHOA,
|
||||
.soundEeuh = SOUND_LUIGI_EEUH,
|
||||
.soundAttacked = SOUND_LUIGI_ATTACKED,
|
||||
.soundOoof = SOUND_LUIGI_OOOF,
|
||||
.soundOoof2 = SOUND_LUIGI_OOOF2,
|
||||
.soundHereWeGo = SOUND_LUIGI_HERE_WE_GO,
|
||||
.soundYawning = SOUND_LUIGI_YAWNING,
|
||||
.soundSnoring1 = SOUND_LUIGI_SNORING1,
|
||||
.soundSnoring2 = SOUND_LUIGI_SNORING2,
|
||||
.soundWaaaooow = SOUND_LUIGI_WAAAOOOW,
|
||||
.soundHaha = SOUND_LUIGI_HAHA,
|
||||
.soundHaha_2 = SOUND_LUIGI_HAHA_2,
|
||||
.soundUh2 = SOUND_LUIGI_UH2,
|
||||
.soundUh2_2 = SOUND_LUIGI_UH2_2,
|
||||
.soundOnFire = SOUND_LUIGI_ON_FIRE,
|
||||
.soundDying = SOUND_LUIGI_DYING,
|
||||
.soundPantingCold = SOUND_LUIGI_PANTING_COLD,
|
||||
.soundPanting = SOUND_LUIGI_PANTING,
|
||||
.soundCoughing1 = SOUND_LUIGI_COUGHING1,
|
||||
.soundCoughing2 = SOUND_LUIGI_COUGHING2,
|
||||
.soundCoughing3 = SOUND_LUIGI_COUGHING3,
|
||||
.soundPunchYah = SOUND_LUIGI_PUNCH_YAH,
|
||||
.soundPunchHoo = SOUND_LUIGI_PUNCH_HOO,
|
||||
.soundMamaMia = SOUND_LUIGI_MAMA_MIA,
|
||||
.soundGroundPoundWah = SOUND_LUIGI_GROUND_POUND_WAH,
|
||||
.soundDrowning = SOUND_LUIGI_DROWNING,
|
||||
.soundPunchWah = SOUND_LUIGI_PUNCH_WAH,
|
||||
.soundYahooWahaYippee = SOUND_LUIGI_YAHOO_WAHA_YIPPEE,
|
||||
.soundDoh = SOUND_LUIGI_DOH,
|
||||
.soundGameOver = SOUND_LUIGI_GAME_OVER,
|
||||
.soundHello = SOUND_LUIGI_HELLO,
|
||||
.soundPressStartToPlay = SOUND_LUIGI_PRESS_START_TO_PLAY,
|
||||
.soundTwirlBounce = SOUND_LUIGI_TWIRL_BOUNCE,
|
||||
.soundSnoring3 = SOUND_LUIGI_SNORING3,
|
||||
.soundSoLongaBowser = SOUND_LUIGI_SO_LONGA_BOWSER,
|
||||
.soundImaTired = SOUND_LUIGI_IMA_TIRED,
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
struct Character* get_character_sound(struct MarioState* m) {
|
||||
if (m == NULL || m->character == NULL) { return &gCharacters[CT_MARIO]; }
|
||||
return configLuigiSounds ? m->character : &gCharacters[CT_MARIO];
|
||||
}
|
||||
|
|
@ -15,8 +15,55 @@ struct Character {
|
|||
char hudHead;
|
||||
u32 cameraHudHead;
|
||||
u32 modelId;
|
||||
u32 capModelId;
|
||||
s32 capKleptoAnimState;
|
||||
s32 capUkikiAnimState;
|
||||
// sounds
|
||||
s32 soundYahWahHoo;
|
||||
s32 soundHoohoo;
|
||||
s32 soundYahoo;
|
||||
s32 soundUh;
|
||||
s32 soundHrmm;
|
||||
s32 soundWah2;
|
||||
s32 soundWhoa;
|
||||
s32 soundEeuh;
|
||||
s32 soundAttacked;
|
||||
s32 soundOoof;
|
||||
s32 soundOoof2;
|
||||
s32 soundHereWeGo;
|
||||
s32 soundYawning;
|
||||
s32 soundSnoring1;
|
||||
s32 soundSnoring2;
|
||||
s32 soundWaaaooow;
|
||||
s32 soundHaha;
|
||||
s32 soundHaha_2;
|
||||
s32 soundUh2;
|
||||
s32 soundUh2_2;
|
||||
s32 soundOnFire;
|
||||
s32 soundDying;
|
||||
s32 soundPantingCold;
|
||||
s32 soundPanting;
|
||||
s32 soundCoughing1;
|
||||
s32 soundCoughing2;
|
||||
s32 soundCoughing3;
|
||||
s32 soundPunchYah;
|
||||
s32 soundPunchHoo;
|
||||
s32 soundMamaMia;
|
||||
s32 soundGroundPoundWah;
|
||||
s32 soundDrowning;
|
||||
s32 soundPunchWah;
|
||||
s32 soundYahooWahaYippee;
|
||||
s32 soundDoh;
|
||||
s32 soundGameOver;
|
||||
s32 soundHello;
|
||||
s32 soundPressStartToPlay;
|
||||
s32 soundTwirlBounce;
|
||||
s32 soundSnoring3;
|
||||
s32 soundSoLongaBowser;
|
||||
s32 soundImaTired;
|
||||
};
|
||||
|
||||
struct MarioState;
|
||||
extern struct Character gCharacters[];
|
||||
struct Character* get_character_sound(struct MarioState* m);
|
||||
|
||||
#endif // CHARACTERS_H
|
||||
|
|
|
|||
|
|
@ -28,7 +28,12 @@
|
|||
|
||||
// FIXME: I'm not sure all of these variables belong in this file, but I don't
|
||||
// know of a good way to split them
|
||||
|
||||
#ifdef UNSTABLE_BRANCH
|
||||
struct Controller gControllers[MAX_PLAYERS];
|
||||
#else
|
||||
struct Controller gControllers[3];
|
||||
#endif
|
||||
struct SPTask *gGfxSPTask;
|
||||
Gfx *gDisplayListHead;
|
||||
u8 *gGfxPoolEnd;
|
||||
|
|
|
|||
|
|
@ -22,7 +22,11 @@ struct DemoInput
|
|||
u8 buttonMask;
|
||||
};
|
||||
|
||||
#ifdef UNSTABLE_BRANCH
|
||||
extern struct Controller gControllers[MAX_PLAYERS];
|
||||
#else
|
||||
extern struct Controller gControllers[3];
|
||||
#endif
|
||||
extern OSContStatus gControllerStatuses[4];
|
||||
extern OSContPad gControllerPads[4];
|
||||
extern OSMesgQueue gGameVblankQueue;
|
||||
|
|
|
|||
|
|
@ -25,6 +25,7 @@
|
|||
#include "sound_init.h"
|
||||
#include "thread6.h"
|
||||
|
||||
#include "pc/configfile.h"
|
||||
#include "pc/network/network.h"
|
||||
|
||||
#define INT_GROUND_POUND_OR_TWIRL (1 << 0) // 0x01
|
||||
|
|
@ -380,6 +381,7 @@ u32 does_mario_have_hat(struct MarioState *m) {
|
|||
}
|
||||
|
||||
void mario_blow_off_cap(struct MarioState *m, f32 capSpeed) {
|
||||
if (m->playerIndex != 0) { return; }
|
||||
struct Object *capObject;
|
||||
|
||||
if (does_mario_have_hat(m)) {
|
||||
|
|
@ -387,7 +389,8 @@ void mario_blow_off_cap(struct MarioState *m, f32 capSpeed) {
|
|||
|
||||
m->flags &= ~(MARIO_NORMAL_CAP | MARIO_CAP_ON_HEAD);
|
||||
|
||||
capObject = spawn_object(m->marioObj, MODEL_MARIOS_CAP, bhvNormalCap);
|
||||
u8 capModel = m->character->capModelId;
|
||||
capObject = spawn_object(m->marioObj, capModel, bhvNormalCap);
|
||||
|
||||
capObject->oPosY += (m->action & ACT_FLAG_SHORT_HITBOX) ? 120.0f : 180.0f;
|
||||
capObject->oForwardVel = capSpeed;
|
||||
|
|
@ -396,6 +399,13 @@ void mario_blow_off_cap(struct MarioState *m, f32 capSpeed) {
|
|||
if (m->forwardVel < 0.0f) {
|
||||
capObject->oMoveAngleYaw = (s16)(capObject->oMoveAngleYaw + 0x8000);
|
||||
}
|
||||
|
||||
// set as it's own parent so we can spawn it over the network
|
||||
capObject->parentObj = capObject;
|
||||
|
||||
struct Object* spawn_objects[] = { capObject };
|
||||
u32 models[] = { capModel };
|
||||
network_send_spawn_objects(spawn_objects, models, 1);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -787,7 +797,7 @@ u32 take_damage_and_knock_back(struct MarioState *m, struct Object *o) {
|
|||
}
|
||||
|
||||
if (o->oDamageOrCoinValue > 0) {
|
||||
play_sound(SOUND_MARIO_ATTACKED, m->marioObj->header.gfx.cameraToObject);
|
||||
play_sound(get_character_sound(m)->soundAttacked, m->marioObj->header.gfx.cameraToObject);
|
||||
}
|
||||
|
||||
update_mario_sound_and_camera(m);
|
||||
|
|
@ -1373,7 +1383,7 @@ u32 interact_tornado(struct MarioState *m, UNUSED u32 interactType, struct Objec
|
|||
marioObj->oMarioTornadoYawVel = 0x400;
|
||||
marioObj->oMarioTornadoPosY = m->pos[1] - o->oPosY;
|
||||
|
||||
play_sound(SOUND_MARIO_WAAAOOOW, m->marioObj->header.gfx.cameraToObject);
|
||||
play_sound(get_character_sound(m)->soundWaaaooow, m->marioObj->header.gfx.cameraToObject);
|
||||
queue_rumble_data_mario(m, 30, 60);
|
||||
|
||||
return set_mario_action(m, ACT_TORNADO_TWIRLING, m->action == ACT_TWIRLING);
|
||||
|
|
@ -1395,7 +1405,7 @@ u32 interact_whirlpool(struct MarioState *m, UNUSED u32 interactType, struct Obj
|
|||
|
||||
marioObj->oMarioWhirlpoolPosY = m->pos[1] - o->oPosY;
|
||||
|
||||
play_sound(SOUND_MARIO_WAAAOOOW, m->marioObj->header.gfx.cameraToObject);
|
||||
play_sound(get_character_sound(m)->soundWaaaooow, m->marioObj->header.gfx.cameraToObject);
|
||||
queue_rumble_data_mario(m, 30, 60);
|
||||
|
||||
return set_mario_action(m, ACT_CAUGHT_IN_WHIRLPOOL, 0);
|
||||
|
|
@ -1418,7 +1428,7 @@ u32 interact_strong_wind(struct MarioState *m, UNUSED u32 interactType, struct O
|
|||
m->forwardVel = -24.0f;
|
||||
m->vel[1] = 12.0f;
|
||||
|
||||
play_sound(SOUND_MARIO_WAAAOOOW, m->marioObj->header.gfx.cameraToObject);
|
||||
play_sound(get_character_sound(m)->soundWaaaooow, m->marioObj->header.gfx.cameraToObject);
|
||||
update_mario_sound_and_camera(m);
|
||||
return set_mario_action(m, ACT_GETTING_BLOWN, 0);
|
||||
}
|
||||
|
|
@ -1442,7 +1452,7 @@ u32 interact_flame(struct MarioState *m, UNUSED u32 interactType, struct Object
|
|||
} else {
|
||||
m->marioObj->oMarioBurnTimer = 0;
|
||||
update_mario_sound_and_camera(m);
|
||||
play_sound(SOUND_MARIO_ON_FIRE, m->marioObj->header.gfx.cameraToObject);
|
||||
play_sound(get_character_sound(m)->soundOnFire, m->marioObj->header.gfx.cameraToObject);
|
||||
|
||||
if ((m->action & ACT_FLAG_AIR) && m->vel[1] <= 0.0f) {
|
||||
burningAction = ACT_BURNING_FALL;
|
||||
|
|
@ -1465,7 +1475,7 @@ u32 interact_snufit_bullet(struct MarioState *m, UNUSED u32 interactType, struct
|
|||
m->interactObj = o;
|
||||
take_damage_from_interact_object(m);
|
||||
|
||||
play_sound(SOUND_MARIO_ATTACKED, m->marioObj->header.gfx.cameraToObject);
|
||||
play_sound(get_character_sound(m)->soundAttacked, m->marioObj->header.gfx.cameraToObject);
|
||||
update_mario_sound_and_camera(m);
|
||||
|
||||
return drop_and_set_mario_action(m, determine_knockback_action(m, o->oDamageOrCoinValue),
|
||||
|
|
@ -1526,7 +1536,7 @@ u32 interact_bully(struct MarioState *m, UNUSED u32 interactType, struct Object
|
|||
m->invincTimer = 2;
|
||||
|
||||
update_mario_sound_and_camera(m);
|
||||
play_sound(SOUND_MARIO_EEUH, m->marioObj->header.gfx.cameraToObject);
|
||||
play_sound(get_character_sound(m)->soundEeuh, m->marioObj->header.gfx.cameraToObject);
|
||||
play_sound(SOUND_OBJ_BULLY_METAL, m->marioObj->header.gfx.cameraToObject);
|
||||
|
||||
push_mario_out_of_object(m, o, 5.0f);
|
||||
|
|
@ -1548,7 +1558,7 @@ u32 interact_shock(struct MarioState *m, UNUSED u32 interactType, struct Object
|
|||
m->interactObj = o;
|
||||
|
||||
take_damage_from_interact_object(m);
|
||||
play_sound(SOUND_MARIO_ATTACKED, m->marioObj->header.gfx.cameraToObject);
|
||||
play_sound(get_character_sound(m)->soundAttacked, m->marioObj->header.gfx.cameraToObject);
|
||||
queue_rumble_data_mario(m, 70, 60);
|
||||
|
||||
if (m->action & (ACT_FLAG_SWIMMING | ACT_FLAG_METAL_WATER)) {
|
||||
|
|
@ -1608,7 +1618,7 @@ u32 interact_hit_from_below(struct MarioState *m, UNUSED u32 interactType, struc
|
|||
bounce_off_object(m, o, 80.0f);
|
||||
reset_mario_pitch(m);
|
||||
#ifndef VERSION_JP
|
||||
play_sound(SOUND_MARIO_TWIRL_BOUNCE, m->marioObj->header.gfx.cameraToObject);
|
||||
play_sound(get_character_sound(m)->soundTwirlBounce, m->marioObj->header.gfx.cameraToObject);
|
||||
#endif
|
||||
return drop_and_set_mario_action(m, ACT_TWIRLING, 0);
|
||||
} else {
|
||||
|
|
@ -1643,7 +1653,7 @@ u32 interact_bounce_top(struct MarioState *m, UNUSED u32 interactType, struct Ob
|
|||
bounce_off_object(m, o, 80.0f);
|
||||
reset_mario_pitch(m);
|
||||
#ifndef VERSION_JP
|
||||
play_sound(SOUND_MARIO_TWIRL_BOUNCE, m->marioObj->header.gfx.cameraToObject);
|
||||
play_sound(get_character_sound(m)->soundTwirlBounce, m->marioObj->header.gfx.cameraToObject);
|
||||
#endif
|
||||
return drop_and_set_mario_action(m, ACT_TWIRLING, 0);
|
||||
} else {
|
||||
|
|
@ -1761,7 +1771,7 @@ u32 check_object_grab_mario(struct MarioState *m, UNUSED u32 interactType, struc
|
|||
m->usedObj = o;
|
||||
|
||||
update_mario_sound_and_camera(m);
|
||||
play_sound(SOUND_MARIO_OOOF, m->marioObj->header.gfx.cameraToObject);
|
||||
play_sound(get_character_sound(m)->soundOoof, m->marioObj->header.gfx.cameraToObject);
|
||||
queue_rumble_data_mario(m, 5, 80);
|
||||
return set_mario_action(m, ACT_GRABBED, 0);
|
||||
}
|
||||
|
|
@ -1891,7 +1901,7 @@ u32 interact_cap(struct MarioState *m, UNUSED u32 interactType, struct Object *o
|
|||
}
|
||||
|
||||
play_sound(SOUND_MENU_STAR_SOUND, m->marioObj->header.gfx.cameraToObject);
|
||||
play_sound(SOUND_MARIO_HERE_WE_GO, m->marioObj->header.gfx.cameraToObject);
|
||||
play_sound(get_character_sound(m)->soundHereWeGo, m->marioObj->header.gfx.cameraToObject);
|
||||
|
||||
if (capMusic != 0) {
|
||||
play_cap_music(capMusic);
|
||||
|
|
@ -2107,7 +2117,7 @@ void check_death_barrier(struct MarioState *m) {
|
|||
return;
|
||||
}
|
||||
if (level_trigger_warp(m, WARP_OP_WARP_FLOOR) == 20 && !(m->flags & MARIO_UNKNOWN_18)) {
|
||||
play_sound(SOUND_MARIO_WAAAOOOW, m->marioObj->header.gfx.cameraToObject);
|
||||
play_sound(get_character_sound(m)->soundWaaaooow, m->marioObj->header.gfx.cameraToObject);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1356,7 +1356,7 @@ s32 init_level(void) {
|
|||
if (gMarioState->action != ACT_UNINITIALIZED) {
|
||||
if (save_file_exists(gCurrSaveFileNum - 1)) {
|
||||
set_mario_action(gMarioState, ACT_IDLE, 0);
|
||||
} else if (gCLIOpts.SkipIntro == 0 && configSkipIntro == 0) {
|
||||
} else if (gCLIOpts.SkipIntro == 0 && configSkipIntro == 0 && gServerSettings.skipIntro == 0) {
|
||||
set_mario_action(gMarioState, ACT_INTRO_CUTSCENE, 0);
|
||||
val4 = 1;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -266,11 +266,11 @@ void play_mario_jump_sound(struct MarioState *m) {
|
|||
if (!(m->flags & MARIO_MARIO_SOUND_PLAYED)) {
|
||||
#ifndef VERSION_JP
|
||||
if (m->action == ACT_TRIPLE_JUMP) {
|
||||
play_sound(SOUND_MARIO_YAHOO_WAHA_YIPPEE + ((gAudioRandom % 5) << 16),
|
||||
play_sound((get_character_sound(m)->soundYahooWahaYippee) + ((gAudioRandom % 5) << 16),
|
||||
m->marioObj->header.gfx.cameraToObject);
|
||||
} else {
|
||||
#endif
|
||||
play_sound(SOUND_MARIO_YAH_WAH_HOO + ((gAudioRandom % 3) << 16),
|
||||
play_sound((get_character_sound(m)->soundYahWahHoo) + ((gAudioRandom % 3) << 16),
|
||||
m->marioObj->header.gfx.cameraToObject);
|
||||
#ifndef VERSION_JP
|
||||
}
|
||||
|
|
@ -307,7 +307,7 @@ void play_sound_and_spawn_particles(struct MarioState *m, u32 soundBits, u32 wav
|
|||
}
|
||||
|
||||
if ((m->flags & MARIO_METAL_CAP) || soundBits == SOUND_ACTION_UNSTUCK_FROM_GROUND
|
||||
|| soundBits == SOUND_MARIO_PUNCH_HOO) {
|
||||
|| soundBits == SOUND_MARIO_PUNCH_HOO || soundBits == SOUND_LUIGI_PUNCH_HOO) {
|
||||
play_sound(soundBits, m->marioObj->header.gfx.cameraToObject);
|
||||
} else {
|
||||
play_sound(m->terrainSoundAddend + soundBits, m->marioObj->header.gfx.cameraToObject);
|
||||
|
|
@ -391,6 +391,9 @@ void mario_set_bubbled(struct MarioState* m) {
|
|||
set_mario_action(m, ACT_BUBBLED, 0);
|
||||
if (m->numLives != -1) {
|
||||
m->numLives--;
|
||||
if (gServerSettings.shareLives) {
|
||||
network_send_death();
|
||||
}
|
||||
}
|
||||
m->healCounter = 0;
|
||||
m->hurtCounter = 31;
|
||||
|
|
@ -1906,10 +1909,10 @@ s32 execute_mario_action(UNUSED struct Object *o) {
|
|||
|
||||
// HACK: mute snoring even when we skip the waking up action
|
||||
if (gMarioState->isSnoring && gMarioState->action != ACT_SLEEPING) {
|
||||
func_803205E8(SOUND_MARIO_SNORING1, gMarioState->marioObj->header.gfx.cameraToObject);
|
||||
func_803205E8(SOUND_MARIO_SNORING2, gMarioState->marioObj->header.gfx.cameraToObject);
|
||||
func_803205E8(get_character_sound(gMarioState)->soundSnoring1, gMarioState->marioObj->header.gfx.cameraToObject);
|
||||
func_803205E8(get_character_sound(gMarioState)->soundSnoring2, gMarioState->marioObj->header.gfx.cameraToObject);
|
||||
#ifndef VERSION_JP
|
||||
func_803205E8(SOUND_MARIO_SNORING3, gMarioState->marioObj->header.gfx.cameraToObject);
|
||||
func_803205E8(get_character_sound(gMarioState)->soundSnoring3, gMarioState->marioObj->header.gfx.cameraToObject);
|
||||
#endif
|
||||
gMarioState->isSnoring = FALSE;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,6 +19,8 @@
|
|||
#endif
|
||||
#include "behavior_table.h"
|
||||
#include "object_helpers.h"
|
||||
#include "pc/configfile.h"
|
||||
#include "pc/network/network.h"
|
||||
|
||||
void play_flip_sounds(struct MarioState *m, s16 frame1, s16 frame2, s16 frame3) {
|
||||
s32 animFrame = m->marioObj->header.gfx.unk38.animFrame;
|
||||
|
|
@ -32,7 +34,7 @@ void play_far_fall_sound(struct MarioState *m) {
|
|||
if (!(action & ACT_FLAG_INVULNERABLE) && action != ACT_TWIRLING && action != ACT_FLYING
|
||||
&& !(m->flags & MARIO_UNKNOWN_18)) {
|
||||
if (m->peakHeight - m->pos[1] > 1150.0f) {
|
||||
play_sound(SOUND_MARIO_WAAAOOOW, m->marioObj->header.gfx.cameraToObject);
|
||||
play_sound(get_character_sound(m)->soundWaaaooow, m->marioObj->header.gfx.cameraToObject);
|
||||
m->flags |= MARIO_UNKNOWN_18;
|
||||
}
|
||||
}
|
||||
|
|
@ -41,9 +43,9 @@ void play_far_fall_sound(struct MarioState *m) {
|
|||
#ifndef VERSION_JP
|
||||
void play_knockback_sound(struct MarioState *m) {
|
||||
if (m->actionArg == 0 && (m->forwardVel <= -28.0f || m->forwardVel >= 28.0f)) {
|
||||
play_sound_if_no_flag(m, SOUND_MARIO_DOH, MARIO_MARIO_SOUND_PLAYED);
|
||||
play_sound_if_no_flag(m, get_character_sound(m)->soundDoh, MARIO_MARIO_SOUND_PLAYED);
|
||||
} else {
|
||||
play_sound_if_no_flag(m, SOUND_MARIO_UH, MARIO_MARIO_SOUND_PLAYED);
|
||||
play_sound_if_no_flag(m, get_character_sound(m)->soundUh, MARIO_MARIO_SOUND_PLAYED);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
|
@ -59,7 +61,7 @@ s32 lava_boost_on_wall(struct MarioState *m) {
|
|||
m->hurtCounter += (m->flags & MARIO_CAP_ON_HEAD) ? 12 : 18;
|
||||
}
|
||||
|
||||
play_sound(SOUND_MARIO_ON_FIRE, m->marioObj->header.gfx.cameraToObject);
|
||||
play_sound(get_character_sound(m)->soundOnFire, m->marioObj->header.gfx.cameraToObject);
|
||||
update_mario_sound_and_camera(m);
|
||||
return drop_and_set_mario_action(m, ACT_LAVA_BOOST, 1);
|
||||
}
|
||||
|
|
@ -88,7 +90,7 @@ s32 check_fall_damage(struct MarioState *m, u32 hardFallAction) {
|
|||
m->hurtCounter += (m->flags & MARIO_CAP_ON_HEAD) ? 16 : 24;
|
||||
queue_rumble_data_mario(m, 5, 80);
|
||||
if (m->playerIndex == 0) { set_camera_shake_from_hit(SHAKE_FALL_DAMAGE); }
|
||||
play_sound(SOUND_MARIO_ATTACKED, m->marioObj->header.gfx.cameraToObject);
|
||||
play_sound(get_character_sound(m)->soundAttacked, m->marioObj->header.gfx.cameraToObject);
|
||||
return drop_and_set_mario_action(m, hardFallAction, 4);
|
||||
} else if (fallHeight > damageHeight && !mario_floor_is_slippery(m)) {
|
||||
m->hurtCounter += (m->flags & MARIO_CAP_ON_HEAD) ? 8 : 12;
|
||||
|
|
@ -96,7 +98,7 @@ s32 check_fall_damage(struct MarioState *m, u32 hardFallAction) {
|
|||
|
||||
queue_rumble_data_mario(m, 5, 80);
|
||||
if (m->playerIndex == 0) { set_camera_shake_from_hit(SHAKE_FALL_DAMAGE); }
|
||||
play_sound(SOUND_MARIO_ATTACKED, m->marioObj->header.gfx.cameraToObject);
|
||||
play_sound(get_character_sound(m)->soundAttacked, m->marioObj->header.gfx.cameraToObject);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -130,9 +132,9 @@ s32 should_get_stuck_in_ground(struct MarioState *m) {
|
|||
s32 check_fall_damage_or_get_stuck(struct MarioState *m, u32 hardFallAction) {
|
||||
if (should_get_stuck_in_ground(m)) {
|
||||
#ifdef VERSION_JP
|
||||
play_sound(SOUND_MARIO_OOOF, m->marioObj->header.gfx.cameraToObject);
|
||||
play_sound(get_character_sound(m)->soundOoof, m->marioObj->header.gfx.cameraToObject);
|
||||
#else
|
||||
play_sound(SOUND_MARIO_OOOF2, m->marioObj->header.gfx.cameraToObject);
|
||||
play_sound(get_character_sound(m)->soundOoof2, m->marioObj->header.gfx.cameraToObject);
|
||||
#endif
|
||||
m->particleFlags |= PARTICLE_MIST_CIRCLE;
|
||||
drop_and_set_mario_action(m, ACT_FEET_STUCK_IN_GROUND, 0);
|
||||
|
|
@ -471,7 +473,7 @@ s32 act_double_jump(struct MarioState *m) {
|
|||
return set_mario_action(m, ACT_GROUND_POUND, 0);
|
||||
}
|
||||
|
||||
play_mario_sound(m, SOUND_ACTION_TERRAIN_JUMP, SOUND_MARIO_HOOHOO);
|
||||
play_mario_sound(m, SOUND_ACTION_TERRAIN_JUMP, get_character_sound(m)->soundHoohoo);
|
||||
common_air_action_step(m, ACT_DOUBLE_JUMP_LAND, animation,
|
||||
AIR_STEP_CHECK_LEDGE_GRAB | AIR_STEP_CHECK_HANG);
|
||||
return FALSE;
|
||||
|
|
@ -493,7 +495,7 @@ s32 act_triple_jump(struct MarioState *m) {
|
|||
#ifndef VERSION_JP
|
||||
play_mario_sound(m, SOUND_ACTION_TERRAIN_JUMP, 0);
|
||||
#else
|
||||
play_mario_sound(m, SOUND_ACTION_TERRAIN_JUMP, SOUND_MARIO_YAHOO);
|
||||
play_mario_sound(m, SOUND_ACTION_TERRAIN_JUMP, get_character_sound(m)->soundYahoo);
|
||||
#endif
|
||||
|
||||
common_air_action_step(m, ACT_TRIPLE_JUMP_LAND, MARIO_ANIM_TRIPLE_JUMP, 0);
|
||||
|
|
@ -509,7 +511,7 @@ s32 act_backflip(struct MarioState *m) {
|
|||
return set_mario_action(m, ACT_GROUND_POUND, 0);
|
||||
}
|
||||
|
||||
play_mario_sound(m, SOUND_ACTION_TERRAIN_JUMP, SOUND_MARIO_YAH_WAH_HOO);
|
||||
play_mario_sound(m, SOUND_ACTION_TERRAIN_JUMP, get_character_sound(m)->soundYahWahHoo);
|
||||
common_air_action_step(m, ACT_BACKFLIP_LAND, MARIO_ANIM_BACKFLIP, 0);
|
||||
|
||||
if (m->action == ACT_BACKFLIP_LAND) {
|
||||
|
|
@ -634,10 +636,10 @@ s32 act_long_jump(struct MarioState *m) {
|
|||
animation = MARIO_ANIM_SLOW_LONGJUMP;
|
||||
}
|
||||
|
||||
play_mario_sound(m, SOUND_ACTION_TERRAIN_JUMP, SOUND_MARIO_YAHOO);
|
||||
play_mario_sound(m, SOUND_ACTION_TERRAIN_JUMP, get_character_sound(m)->soundYahoo);
|
||||
|
||||
if (m->floor->type == SURFACE_VERTICAL_WIND && m->actionState == 0) {
|
||||
play_sound(SOUND_MARIO_HERE_WE_GO, m->marioObj->header.gfx.cameraToObject);
|
||||
play_sound(get_character_sound(m)->soundHereWeGo, m->marioObj->header.gfx.cameraToObject);
|
||||
m->actionState = 1;
|
||||
}
|
||||
|
||||
|
|
@ -717,7 +719,7 @@ s32 act_twirling(struct MarioState *m) {
|
|||
|
||||
s32 act_dive(struct MarioState *m) {
|
||||
if (m->actionArg == 0) {
|
||||
play_mario_sound(m, SOUND_ACTION_THROW, SOUND_MARIO_HOOHOO);
|
||||
play_mario_sound(m, SOUND_ACTION_THROW, get_character_sound(m)->soundHoohoo);
|
||||
} else {
|
||||
play_mario_sound(m, SOUND_ACTION_TERRAIN_JUMP, 0);
|
||||
}
|
||||
|
|
@ -750,9 +752,9 @@ s32 act_dive(struct MarioState *m) {
|
|||
if (should_get_stuck_in_ground(m) && m->faceAngle[0] == -0x2AAA) {
|
||||
queue_rumble_data_mario(m, 5, 80);
|
||||
#ifdef VERSION_JP
|
||||
play_sound(SOUND_MARIO_OOOF, m->marioObj->header.gfx.cameraToObject);
|
||||
play_sound(get_character_sound(m)->soundOoof, m->marioObj->header.gfx.cameraToObject);
|
||||
#else
|
||||
play_sound(SOUND_MARIO_OOOF2, m->marioObj->header.gfx.cameraToObject);
|
||||
play_sound(get_character_sound(m)->soundOoof2, m->marioObj->header.gfx.cameraToObject);
|
||||
#endif
|
||||
m->particleFlags |= PARTICLE_MIST_CIRCLE;
|
||||
drop_and_set_mario_action(m, ACT_HEAD_STUCK_IN_GROUND, 0);
|
||||
|
|
@ -791,7 +793,7 @@ s32 act_air_throw(struct MarioState *m) {
|
|||
mario_throw_held_object(m);
|
||||
}
|
||||
|
||||
play_sound_if_no_flag(m, SOUND_MARIO_WAH2, MARIO_MARIO_SOUND_PLAYED);
|
||||
play_sound_if_no_flag(m, get_character_sound(m)->soundWah2, MARIO_MARIO_SOUND_PLAYED);
|
||||
set_mario_animation(m, MARIO_ANIM_THROW_LIGHT_OBJECT);
|
||||
update_air_without_turn(m);
|
||||
|
||||
|
|
@ -935,7 +937,7 @@ s32 act_ground_pound(struct MarioState *m) {
|
|||
|
||||
m->actionTimer++;
|
||||
if (m->actionTimer >= m->marioObj->header.gfx.unk38.curAnim->unk08 + 4) {
|
||||
play_sound(SOUND_MARIO_GROUND_POUND_WAH, m->marioObj->header.gfx.cameraToObject);
|
||||
play_sound(get_character_sound(m)->soundGroundPoundWah, m->marioObj->header.gfx.cameraToObject);
|
||||
m->actionState = 1;
|
||||
}
|
||||
} else {
|
||||
|
|
@ -946,9 +948,9 @@ s32 act_ground_pound(struct MarioState *m) {
|
|||
if (should_get_stuck_in_ground(m)) {
|
||||
queue_rumble_data_mario(m, 5, 80);
|
||||
#ifdef VERSION_JP
|
||||
play_sound(SOUND_MARIO_OOOF, m->marioObj->header.gfx.cameraToObject);
|
||||
play_sound(get_character_sound(m)->soundOoof, m->marioObj->header.gfx.cameraToObject);
|
||||
#else
|
||||
play_sound(SOUND_MARIO_OOOF2, m->marioObj->header.gfx.cameraToObject);
|
||||
play_sound(get_character_sound(m)->soundOoof2, m->marioObj->header.gfx.cameraToObject);
|
||||
#endif
|
||||
m->particleFlags |= PARTICLE_MIST_CIRCLE;
|
||||
set_mario_action(m, ACT_BUTT_STUCK_IN_GROUND, 0);
|
||||
|
|
@ -1160,7 +1162,7 @@ s32 act_backward_air_kb(struct MarioState *m) {
|
|||
#ifndef VERSION_JP
|
||||
play_knockback_sound(m);
|
||||
#else
|
||||
play_sound_if_no_flag(m, SOUND_MARIO_UH, MARIO_MARIO_SOUND_PLAYED);
|
||||
play_sound_if_no_flag(m, get_character_sound(m)->soundUh, MARIO_MARIO_SOUND_PLAYED);
|
||||
#endif
|
||||
common_air_knockback_step(m, ACT_BACKWARD_GROUND_KB, ACT_HARD_BACKWARD_GROUND_KB, 0x0002, -16.0f);
|
||||
return FALSE;
|
||||
|
|
@ -1174,7 +1176,7 @@ s32 act_forward_air_kb(struct MarioState *m) {
|
|||
#ifndef VERSION_JP
|
||||
play_knockback_sound(m);
|
||||
#else
|
||||
play_sound_if_no_flag(m, SOUND_MARIO_UH, MARIO_MARIO_SOUND_PLAYED);
|
||||
play_sound_if_no_flag(m, get_character_sound(m)->soundUh, MARIO_MARIO_SOUND_PLAYED);
|
||||
#endif
|
||||
common_air_knockback_step(m, ACT_FORWARD_GROUND_KB, ACT_HARD_FORWARD_GROUND_KB, 0x002D, 16.0f);
|
||||
return FALSE;
|
||||
|
|
@ -1184,7 +1186,7 @@ s32 act_hard_backward_air_kb(struct MarioState *m) {
|
|||
#ifndef VERSION_JP
|
||||
play_knockback_sound(m);
|
||||
#else
|
||||
play_sound_if_no_flag(m, SOUND_MARIO_UH, MARIO_MARIO_SOUND_PLAYED);
|
||||
play_sound_if_no_flag(m, get_character_sound(m)->soundUh, MARIO_MARIO_SOUND_PLAYED);
|
||||
#endif
|
||||
common_air_knockback_step(m, ACT_HARD_BACKWARD_GROUND_KB, ACT_HARD_BACKWARD_GROUND_KB, 0x0002,
|
||||
-16.0f);
|
||||
|
|
@ -1195,7 +1197,7 @@ s32 act_hard_forward_air_kb(struct MarioState *m) {
|
|||
#ifndef VERSION_JP
|
||||
play_knockback_sound(m);
|
||||
#else
|
||||
play_sound_if_no_flag(m, SOUND_MARIO_UH, MARIO_MARIO_SOUND_PLAYED);
|
||||
play_sound_if_no_flag(m, get_character_sound(m)->soundUh, MARIO_MARIO_SOUND_PLAYED);
|
||||
#endif
|
||||
common_air_knockback_step(m, ACT_HARD_FORWARD_GROUND_KB, ACT_HARD_FORWARD_GROUND_KB, 0x002D, 16.0f);
|
||||
return FALSE;
|
||||
|
|
@ -1209,7 +1211,7 @@ s32 act_thrown_backward(struct MarioState *m) {
|
|||
landAction = ACT_BACKWARD_GROUND_KB;
|
||||
}
|
||||
|
||||
play_sound_if_no_flag(m, SOUND_MARIO_WAAAOOOW, MARIO_MARIO_SOUND_PLAYED);
|
||||
play_sound_if_no_flag(m, get_character_sound(m)->soundWaaaooow, MARIO_MARIO_SOUND_PLAYED);
|
||||
|
||||
common_air_knockback_step(m, landAction, ACT_HARD_BACKWARD_GROUND_KB, 0x0002, m->forwardVel);
|
||||
|
||||
|
|
@ -1227,7 +1229,7 @@ s32 act_thrown_forward(struct MarioState *m) {
|
|||
landAction = ACT_FORWARD_GROUND_KB;
|
||||
}
|
||||
|
||||
play_sound_if_no_flag(m, SOUND_MARIO_WAAAOOOW, MARIO_MARIO_SOUND_PLAYED);
|
||||
play_sound_if_no_flag(m, get_character_sound(m)->soundWaaaooow, MARIO_MARIO_SOUND_PLAYED);
|
||||
|
||||
if (common_air_knockback_step(m, landAction, ACT_HARD_FORWARD_GROUND_KB, 0x002D, m->forwardVel)
|
||||
== AIR_STEP_NONE) {
|
||||
|
|
@ -1251,7 +1253,7 @@ s32 act_soft_bonk(struct MarioState *m) {
|
|||
#ifndef VERSION_JP
|
||||
play_knockback_sound(m);
|
||||
#else
|
||||
play_sound_if_no_flag(m, SOUND_MARIO_UH, MARIO_MARIO_SOUND_PLAYED);
|
||||
play_sound_if_no_flag(m, get_character_sound(m)->soundUh, MARIO_MARIO_SOUND_PLAYED);
|
||||
#endif
|
||||
|
||||
common_air_knockback_step(m, ACT_FREEFALL_LAND, ACT_HARD_BACKWARD_GROUND_KB, 0x0056, m->forwardVel);
|
||||
|
|
@ -1281,7 +1283,7 @@ s32 act_getting_blown(struct MarioState *m) {
|
|||
|
||||
mario_set_forward_vel(m, m->forwardVel);
|
||||
#ifdef VERSION_JP
|
||||
play_sound_if_no_flag(m, SOUND_MARIO_UH, MARIO_MARIO_SOUND_PLAYED);
|
||||
play_sound_if_no_flag(m, get_character_sound(m)->soundUh, MARIO_MARIO_SOUND_PLAYED);
|
||||
#endif
|
||||
set_mario_animation(m, MARIO_ANIM_BACKWARD_AIR_KB);
|
||||
|
||||
|
|
@ -1510,10 +1512,10 @@ s32 act_hold_butt_slide_air(struct MarioState *m) {
|
|||
|
||||
s32 act_lava_boost(struct MarioState *m) {
|
||||
if (!(m->flags & MARIO_MARIO_SOUND_PLAYED)) {
|
||||
play_sound_if_no_flag(m, SOUND_MARIO_ON_FIRE, MARIO_MARIO_SOUND_PLAYED);
|
||||
play_sound_if_no_flag(m, get_character_sound(m)->soundOnFire, MARIO_MARIO_SOUND_PLAYED);
|
||||
queue_rumble_data_mario(m, 5, 80);
|
||||
}
|
||||
play_sound_if_no_flag(m, SOUND_MARIO_ON_FIRE, MARIO_MARIO_SOUND_PLAYED);
|
||||
play_sound_if_no_flag(m, get_character_sound(m)->soundOnFire, MARIO_MARIO_SOUND_PLAYED);
|
||||
|
||||
if (!(m->input & INPUT_NONZERO_ANALOG)) {
|
||||
m->forwardVel = approach_f32(m->forwardVel, 0.0f, 0.35f, 0.35f);
|
||||
|
|
@ -1529,7 +1531,7 @@ s32 act_lava_boost(struct MarioState *m) {
|
|||
m->hurtCounter += (m->flags & MARIO_CAP_ON_HEAD) ? 12 : 18;
|
||||
}
|
||||
m->vel[1] = 84.0f;
|
||||
play_sound(SOUND_MARIO_ON_FIRE, m->marioObj->header.gfx.cameraToObject);
|
||||
play_sound(get_character_sound(m)->soundOnFire, m->marioObj->header.gfx.cameraToObject);
|
||||
queue_rumble_data_mario(m, 5, 80);
|
||||
} else {
|
||||
play_mario_heavy_landing_sound(m, SOUND_ACTION_TERRAIN_BODY_HIT_GROUND);
|
||||
|
|
@ -1579,7 +1581,7 @@ s32 act_lava_boost(struct MarioState *m) {
|
|||
|
||||
s32 act_slide_kick(struct MarioState *m) {
|
||||
if (m->actionTimer == 0) {
|
||||
play_mario_sound(m, SOUND_ACTION_TERRAIN_JUMP, SOUND_MARIO_HOOHOO);
|
||||
play_mario_sound(m, SOUND_ACTION_TERRAIN_JUMP, get_character_sound(m)->soundHoohoo);
|
||||
set_mario_animation(m, MARIO_ANIM_SLIDE_KICK);
|
||||
}
|
||||
|
||||
|
|
@ -1632,7 +1634,7 @@ s32 act_jump_kick(struct MarioState *m) {
|
|||
s32 animFrame;
|
||||
|
||||
if (m->actionState == 0) {
|
||||
play_sound_if_no_flag(m, SOUND_MARIO_PUNCH_HOO, MARIO_ACTION_SOUND_PLAYED);
|
||||
play_sound_if_no_flag(m, get_character_sound(m)->soundPunchHoo, MARIO_ACTION_SOUND_PLAYED);
|
||||
m->marioObj->header.gfx.unk38.animID = -1;
|
||||
set_mario_animation(m, MARIO_ANIM_AIR_KICK);
|
||||
m->actionState = 1;
|
||||
|
|
@ -1673,7 +1675,7 @@ s32 act_shot_from_cannon(struct MarioState *m) {
|
|||
|
||||
mario_set_forward_vel(m, m->forwardVel);
|
||||
|
||||
play_sound_if_no_flag(m, SOUND_MARIO_YAHOO, MARIO_MARIO_SOUND_PLAYED);
|
||||
play_sound_if_no_flag(m, get_character_sound(m)->soundYahoo, MARIO_MARIO_SOUND_PLAYED);
|
||||
|
||||
switch (perform_air_step(m, 0)) {
|
||||
case AIR_STEP_NONE:
|
||||
|
|
@ -1920,7 +1922,7 @@ s32 act_flying(struct MarioState *m) {
|
|||
if (startPitch <= 0 && m->faceAngle[0] > 0 && m->forwardVel >= 48.0f) {
|
||||
play_sound(SOUND_ACTION_FLYING_FAST, m->marioObj->header.gfx.cameraToObject);
|
||||
#ifndef VERSION_JP
|
||||
play_sound(SOUND_MARIO_YAHOO_WAHA_YIPPEE + ((gAudioRandom % 5) << 16),
|
||||
play_sound((get_character_sound(m)->soundYahooWahaYippee) + ((gAudioRandom % 5) << 16),
|
||||
m->marioObj->header.gfx.cameraToObject);
|
||||
#endif
|
||||
queue_rumble_data_mario(m, 50, 40);
|
||||
|
|
@ -1944,7 +1946,7 @@ s32 act_riding_hoot(struct MarioState *m) {
|
|||
m->usedObj->oInteractStatus = 0;
|
||||
m->usedObj->oHootMarioReleaseTime = gGlobalTimer;
|
||||
|
||||
play_sound_if_no_flag(m, SOUND_MARIO_UH, MARIO_MARIO_SOUND_PLAYED);
|
||||
play_sound_if_no_flag(m, get_character_sound(m)->soundUh, MARIO_MARIO_SOUND_PLAYED);
|
||||
queue_rumble_data_mario(m, 4, 40);
|
||||
return set_mario_action(m, ACT_FREEFALL, 0);
|
||||
}
|
||||
|
|
@ -2001,7 +2003,7 @@ s32 act_flying_triple_jump(struct MarioState *m) {
|
|||
}
|
||||
#endif
|
||||
|
||||
play_mario_sound(m, SOUND_ACTION_TERRAIN_JUMP, SOUND_MARIO_YAHOO);
|
||||
play_mario_sound(m, SOUND_ACTION_TERRAIN_JUMP, get_character_sound(m)->soundYahoo);
|
||||
if (m->actionState == 0) {
|
||||
set_mario_animation(m, MARIO_ANIM_TRIPLE_JUMP_FLY);
|
||||
|
||||
|
|
@ -2079,7 +2081,7 @@ s32 act_vertical_wind(struct MarioState *m) {
|
|||
s16 intendedDYaw = m->intendedYaw - m->faceAngle[1];
|
||||
f32 intendedMag = m->intendedMag / 32.0f;
|
||||
|
||||
play_sound_if_no_flag(m, SOUND_MARIO_HERE_WE_GO, MARIO_MARIO_SOUND_PLAYED);
|
||||
play_sound_if_no_flag(m, get_character_sound(m)->soundHereWeGo, MARIO_MARIO_SOUND_PLAYED);
|
||||
if (m->actionState == 0) {
|
||||
set_mario_animation(m, MARIO_ANIM_FORWARD_SPINNING_FLIP);
|
||||
if (m->marioObj->header.gfx.unk38.animFrame == 1) {
|
||||
|
|
@ -2120,7 +2122,7 @@ s32 act_special_triple_jump(struct MarioState *m) {
|
|||
return set_mario_action(m, ACT_GROUND_POUND, 0);
|
||||
}
|
||||
|
||||
play_mario_sound(m, SOUND_ACTION_TERRAIN_JUMP, SOUND_MARIO_YAHOO);
|
||||
play_mario_sound(m, SOUND_ACTION_TERRAIN_JUMP, get_character_sound(m)->soundYahoo);
|
||||
|
||||
update_air_without_turn(m);
|
||||
|
||||
|
|
|
|||
|
|
@ -20,6 +20,8 @@
|
|||
#include "obj_behaviors.h"
|
||||
#include "level_update.h"
|
||||
#include "mario_step.h"
|
||||
#include "pc/configfile.h"
|
||||
#include "pc/network/network.h"
|
||||
|
||||
#define POLE_NONE 0
|
||||
#define POLE_TOUCHED_FLOOR 1
|
||||
|
|
@ -234,7 +236,7 @@ s32 act_climbing_pole(struct MarioState *m) {
|
|||
|
||||
s32 act_grab_pole_slow(struct MarioState *m) {
|
||||
if (m->usedObj == NULL) { m->usedObj = cur_obj_find_nearest_pole(); }
|
||||
play_sound_if_no_flag(m, SOUND_MARIO_WHOA, MARIO_MARIO_SOUND_PLAYED);
|
||||
play_sound_if_no_flag(m, get_character_sound(m)->soundWhoa, MARIO_MARIO_SOUND_PLAYED);
|
||||
|
||||
if (set_pole_position(m, 0.0f) == POLE_NONE) {
|
||||
set_mario_animation(m, MARIO_ANIM_GRAB_POLE_SHORT);
|
||||
|
|
@ -251,7 +253,7 @@ s32 act_grab_pole_fast(struct MarioState *m) {
|
|||
struct Object *marioObj = m->marioObj;
|
||||
if (m->usedObj == NULL) { m->usedObj = cur_obj_find_nearest_pole(); }
|
||||
|
||||
play_sound_if_no_flag(m, SOUND_MARIO_WHOA, MARIO_MARIO_SOUND_PLAYED);
|
||||
play_sound_if_no_flag(m, get_character_sound(m)->soundWhoa, MARIO_MARIO_SOUND_PLAYED);
|
||||
m->faceAngle[1] += marioObj->oMarioPoleYawVel;
|
||||
marioObj->oMarioPoleYawVel = marioObj->oMarioPoleYawVel * 8 / 10;
|
||||
|
||||
|
|
@ -597,7 +599,7 @@ s32 act_ledge_grab(struct MarioState *m) {
|
|||
}
|
||||
|
||||
if (m->actionArg == 0) {
|
||||
play_sound_if_no_flag(m, SOUND_MARIO_WHOA, MARIO_MARIO_SOUND_PLAYED);
|
||||
play_sound_if_no_flag(m, get_character_sound(m)->soundWhoa, MARIO_MARIO_SOUND_PLAYED);
|
||||
}
|
||||
|
||||
stop_and_set_height_to_floor(m);
|
||||
|
|
@ -619,7 +621,7 @@ s32 act_ledge_climb_slow(struct MarioState *m) {
|
|||
}
|
||||
|
||||
if (m->actionTimer == 10) {
|
||||
play_sound_if_no_flag(m, SOUND_MARIO_EEUH, MARIO_MARIO_SOUND_PLAYED);
|
||||
play_sound_if_no_flag(m, get_character_sound(m)->soundEeuh, MARIO_MARIO_SOUND_PLAYED);
|
||||
}
|
||||
|
||||
update_ledge_climb(m, MARIO_ANIM_SLOW_LEDGE_GRAB, ACT_IDLE);
|
||||
|
|
@ -637,7 +639,7 @@ s32 act_ledge_climb_down(struct MarioState *m) {
|
|||
return let_go_of_ledge(m);
|
||||
}
|
||||
|
||||
play_sound_if_no_flag(m, SOUND_MARIO_WHOA, MARIO_MARIO_SOUND_PLAYED);
|
||||
play_sound_if_no_flag(m, get_character_sound(m)->soundWhoa, MARIO_MARIO_SOUND_PLAYED);
|
||||
|
||||
update_ledge_climb(m, MARIO_ANIM_CLIMB_DOWN_LEDGE, ACT_LEDGE_GRAB);
|
||||
m->actionArg = 1;
|
||||
|
|
@ -650,7 +652,7 @@ s32 act_ledge_climb_fast(struct MarioState *m) {
|
|||
return let_go_of_ledge(m);
|
||||
}
|
||||
|
||||
play_sound_if_no_flag(m, SOUND_MARIO_UH2, MARIO_MARIO_SOUND_PLAYED);
|
||||
play_sound_if_no_flag(m, get_character_sound(m)->soundUh2, MARIO_MARIO_SOUND_PLAYED);
|
||||
|
||||
update_ledge_climb(m, MARIO_ANIM_FAST_LEDGE_GRAB, ACT_IDLE);
|
||||
|
||||
|
|
@ -925,6 +927,7 @@ s32 act_bubbled(struct MarioState* m) {
|
|||
if (m->playerIndex == 0) {
|
||||
u8 allInBubble = TRUE;
|
||||
for (int i = 0; i < MAX_PLAYERS; i++) {
|
||||
if (!is_player_active(&gMarioStates[i])) { continue; }
|
||||
if (gMarioStates[i].action != ACT_BUBBLED && gMarioStates[i].health >= 0x100) {
|
||||
allInBubble = FALSE;
|
||||
break;
|
||||
|
|
@ -966,6 +969,15 @@ s32 act_bubbled(struct MarioState* m) {
|
|||
m->vel[i] = (oldVel[i] * 0.9f + m->vel[i] * 0.1f);
|
||||
}
|
||||
|
||||
// enforce minimum y for the level
|
||||
u8 hasMinY = FALSE;
|
||||
f32 minY = 0;
|
||||
get_area_minimum_y(&hasMinY, &minY);
|
||||
if (hasMinY && m->pos[1] < minY) {
|
||||
m->vel[1] = MAX(0, m->vel[1]);
|
||||
m->pos[1] += 25;
|
||||
}
|
||||
|
||||
// move player
|
||||
switch (perform_air_step(m, 0)) {
|
||||
case AIR_STEP_LANDED:
|
||||
|
|
|
|||
|
|
@ -31,6 +31,7 @@
|
|||
#include "obj_behaviors.h"
|
||||
#include "../../include/libc/stdlib.h"
|
||||
#include "pc/pc_main.h"
|
||||
#include "pc/configfile.h"
|
||||
#include "pc/network/network.h"
|
||||
|
||||
// TODO: put this elsewhere
|
||||
|
|
@ -674,7 +675,7 @@ void general_star_dance_handler(struct MarioState *m, s32 isInWater) {
|
|||
break;
|
||||
|
||||
case 42:
|
||||
play_sound(SOUND_MARIO_HERE_WE_GO, m->marioObj->header.gfx.cameraToObject);
|
||||
play_sound(get_character_sound(m)->soundHereWeGo, m->marioObj->header.gfx.cameraToObject);
|
||||
break;
|
||||
|
||||
case 80:
|
||||
|
|
@ -769,7 +770,7 @@ s32 act_standing_death(struct MarioState *m) {
|
|||
return set_mario_action(m, ACT_SUFFOCATION, 0);
|
||||
}
|
||||
|
||||
play_sound_if_no_flag(m, SOUND_MARIO_DYING, MARIO_ACTION_SOUND_PLAYED);
|
||||
play_sound_if_no_flag(m, get_character_sound(m)->soundDying, MARIO_ACTION_SOUND_PLAYED);
|
||||
common_death_handler(m, MARIO_ANIM_DYING_FALL_OVER, 80);
|
||||
if (m->marioObj->header.gfx.unk38.animFrame == 77) {
|
||||
play_mario_landing_sound(m, SOUND_ACTION_TERRAIN_BODY_HIT_GROUND);
|
||||
|
|
@ -778,19 +779,19 @@ s32 act_standing_death(struct MarioState *m) {
|
|||
}
|
||||
|
||||
s32 act_electrocution(struct MarioState *m) {
|
||||
play_sound_if_no_flag(m, SOUND_MARIO_DYING, MARIO_ACTION_SOUND_PLAYED);
|
||||
play_sound_if_no_flag(m, get_character_sound(m)->soundDying, MARIO_ACTION_SOUND_PLAYED);
|
||||
common_death_handler(m, MARIO_ANIM_ELECTROCUTION, 43);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
s32 act_suffocation(struct MarioState *m) {
|
||||
play_sound_if_no_flag(m, SOUND_MARIO_DYING, MARIO_ACTION_SOUND_PLAYED);
|
||||
play_sound_if_no_flag(m, get_character_sound(m)->soundDying, MARIO_ACTION_SOUND_PLAYED);
|
||||
common_death_handler(m, MARIO_ANIM_SUFFOCATING, 86);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
s32 act_death_on_back(struct MarioState *m) {
|
||||
play_sound_if_no_flag(m, SOUND_MARIO_DYING, MARIO_ACTION_SOUND_PLAYED);
|
||||
play_sound_if_no_flag(m, get_character_sound(m)->soundDying, MARIO_ACTION_SOUND_PLAYED);
|
||||
if (common_death_handler(m, MARIO_ANIM_DYING_ON_BACK, 54) == 40) {
|
||||
play_mario_heavy_landing_sound(m, SOUND_ACTION_TERRAIN_BODY_HIT_GROUND);
|
||||
}
|
||||
|
|
@ -798,7 +799,7 @@ s32 act_death_on_back(struct MarioState *m) {
|
|||
}
|
||||
|
||||
s32 act_death_on_stomach(struct MarioState *m) {
|
||||
play_sound_if_no_flag(m, SOUND_MARIO_DYING, MARIO_ACTION_SOUND_PLAYED);
|
||||
play_sound_if_no_flag(m, get_character_sound(m)->soundDying, MARIO_ACTION_SOUND_PLAYED);
|
||||
if (common_death_handler(m, MARIO_ANIM_DYING_ON_STOMACH, 37) == 37) {
|
||||
play_mario_heavy_landing_sound(m, SOUND_ACTION_TERRAIN_BODY_HIT_GROUND);
|
||||
}
|
||||
|
|
@ -813,7 +814,7 @@ s32 act_quicksand_death(struct MarioState *m) {
|
|||
}
|
||||
if (m->actionState == 1) {
|
||||
if (m->quicksandDepth >= 100.0f) {
|
||||
play_sound_if_no_flag(m, SOUND_MARIO_WAAAOOOW, MARIO_ACTION_SOUND_PLAYED);
|
||||
play_sound_if_no_flag(m, get_character_sound(m)->soundWaaaooow, MARIO_ACTION_SOUND_PLAYED);
|
||||
}
|
||||
if ((m->quicksandDepth += 5.0f) >= 180.0f) {
|
||||
//level_trigger_warp(m, WARP_OP_DEATH);
|
||||
|
|
@ -827,7 +828,7 @@ s32 act_quicksand_death(struct MarioState *m) {
|
|||
}
|
||||
|
||||
s32 act_eaten_by_bubba(struct MarioState *m) {
|
||||
play_sound_if_no_flag(m, SOUND_MARIO_DYING, MARIO_ACTION_SOUND_PLAYED);
|
||||
play_sound_if_no_flag(m, get_character_sound(m)->soundDying, MARIO_ACTION_SOUND_PLAYED);
|
||||
set_mario_animation(m, MARIO_ANIM_A_POSE);
|
||||
//m->marioObj->header.gfx.node.flags &= ~GRAPH_RENDER_ACTIVE;
|
||||
if (m != &gMarioStates[0]) {
|
||||
|
|
@ -1092,7 +1093,7 @@ s32 act_emerge_from_pipe(struct MarioState *m) {
|
|||
|
||||
marioObj->header.gfx.node.flags |= GRAPH_RENDER_ACTIVE;
|
||||
|
||||
play_sound_if_no_flag(m, SOUND_MARIO_YAHOO, MARIO_MARIO_SOUND_PLAYED);
|
||||
play_sound_if_no_flag(m, get_character_sound(m)->soundYahoo, MARIO_MARIO_SOUND_PLAYED);
|
||||
|
||||
if (gCurrLevelNum == LEVEL_THI) {
|
||||
if (gCurrAreaIndex == 2) {
|
||||
|
|
@ -1275,9 +1276,9 @@ s32 act_death_exit(struct MarioState *m) {
|
|||
if (15 < m->actionTimer++
|
||||
&& launch_mario_until_land(m, ACT_DEATH_EXIT_LAND, MARIO_ANIM_GENERAL_FALL, -32.0f)) {
|
||||
#ifdef VERSION_JP
|
||||
play_sound(SOUND_MARIO_OOOF, m->marioObj->header.gfx.cameraToObject);
|
||||
play_sound(get_character_sound(m)->soundOoof, m->marioObj->header.gfx.cameraToObject);
|
||||
#else
|
||||
play_sound(SOUND_MARIO_OOOF2, m->marioObj->header.gfx.cameraToObject);
|
||||
play_sound(get_character_sound(m)->soundOoof2, m->marioObj->header.gfx.cameraToObject);
|
||||
#endif
|
||||
queue_rumble_data_mario(m, 5, 80);
|
||||
//m->numLives--;
|
||||
|
|
@ -1292,9 +1293,9 @@ s32 act_death_exit(struct MarioState *m) {
|
|||
s32 act_unused_death_exit(struct MarioState *m) {
|
||||
if (launch_mario_until_land(m, ACT_FREEFALL_LAND_STOP, MARIO_ANIM_GENERAL_FALL, 0.0f)) {
|
||||
#ifdef VERSION_JP
|
||||
play_sound(SOUND_MARIO_OOOF, m->marioObj->header.gfx.cameraToObject);
|
||||
play_sound(get_character_sound(m)->soundOoof, m->marioObj->header.gfx.cameraToObject);
|
||||
#else
|
||||
play_sound(SOUND_MARIO_OOOF2, m->marioObj->header.gfx.cameraToObject);
|
||||
play_sound(get_character_sound(m)->soundOoof2, m->marioObj->header.gfx.cameraToObject);
|
||||
#endif
|
||||
//m->numLives--;
|
||||
// restore 7.75 units of health
|
||||
|
|
@ -1308,9 +1309,9 @@ s32 act_unused_death_exit(struct MarioState *m) {
|
|||
s32 act_falling_death_exit(struct MarioState *m) {
|
||||
if (launch_mario_until_land(m, ACT_DEATH_EXIT_LAND, MARIO_ANIM_GENERAL_FALL, 0.0f)) {
|
||||
#ifdef VERSION_JP
|
||||
play_sound(SOUND_MARIO_OOOF, m->marioObj->header.gfx.cameraToObject);
|
||||
play_sound(get_character_sound(m)->soundOoof, m->marioObj->header.gfx.cameraToObject);
|
||||
#else
|
||||
play_sound(SOUND_MARIO_OOOF2, m->marioObj->header.gfx.cameraToObject);
|
||||
play_sound(get_character_sound(m)->soundOoof2, m->marioObj->header.gfx.cameraToObject);
|
||||
#endif
|
||||
queue_rumble_data_mario(m, 5, 80);
|
||||
//m->numLives--;
|
||||
|
|
@ -1326,7 +1327,7 @@ s32 act_falling_death_exit(struct MarioState *m) {
|
|||
s32 act_special_exit_airborne(struct MarioState *m) {
|
||||
struct Object *marioObj = m->marioObj;
|
||||
|
||||
play_sound_if_no_flag(m, SOUND_MARIO_YAHOO, MARIO_MARIO_SOUND_PLAYED);
|
||||
play_sound_if_no_flag(m, get_character_sound(m)->soundYahoo, MARIO_MARIO_SOUND_PLAYED);
|
||||
|
||||
if (m->actionTimer++ < 11) {
|
||||
marioObj->header.gfx.node.flags &= ~GRAPH_RENDER_ACTIVE;
|
||||
|
|
@ -1574,7 +1575,7 @@ s32 act_teleport_fade_in(struct MarioState *m) {
|
|||
}
|
||||
|
||||
s32 act_shocked(struct MarioState *m) {
|
||||
play_sound_if_no_flag(m, SOUND_MARIO_WAAAOOOW, MARIO_ACTION_SOUND_PLAYED);
|
||||
play_sound_if_no_flag(m, get_character_sound(m)->soundWaaaooow, MARIO_ACTION_SOUND_PLAYED);
|
||||
play_sound(SOUND_MOVING_SHOCKED, m->marioObj->header.gfx.cameraToObject);
|
||||
if (m->playerIndex == 0) { set_camera_shake_from_hit(SHAKE_SHOCK); }
|
||||
|
||||
|
|
@ -1636,7 +1637,7 @@ s32 act_squished(struct MarioState *m) {
|
|||
if (!(m->flags & MARIO_METAL_CAP) && m->invincTimer == 0) {
|
||||
// cap on: 3 units; cap off: 4.5 units
|
||||
m->hurtCounter += m->flags & MARIO_CAP_ON_HEAD ? 12 : 18;
|
||||
play_sound_if_no_flag(m, SOUND_MARIO_ATTACKED, MARIO_MARIO_SOUND_PLAYED);
|
||||
play_sound_if_no_flag(m, get_character_sound(m)->soundAttacked, MARIO_MARIO_SOUND_PLAYED);
|
||||
}
|
||||
|
||||
// Both of the 1.8's are really floats, but one of them has to
|
||||
|
|
@ -1858,9 +1859,9 @@ static void intro_cutscene_jump_out_of_pipe(struct MarioState *m) {
|
|||
#ifdef VERSION_EU
|
||||
// For some reason these calls were swapped.
|
||||
play_sound_if_no_flag(m, SOUND_ACTION_HIT_3, MARIO_ACTION_SOUND_PLAYED);
|
||||
play_sound_if_no_flag(m, SOUND_MARIO_YAHOO, MARIO_MARIO_SOUND_PLAYED);
|
||||
play_sound_if_no_flag(m, get_character_sound(m)->soundYahoo, MARIO_MARIO_SOUND_PLAYED);
|
||||
#else
|
||||
play_sound_if_no_flag(m, SOUND_MARIO_YAHOO, MARIO_MARIO_SOUND_PLAYED);
|
||||
play_sound_if_no_flag(m, get_character_sound(m)->soundYahoo, MARIO_MARIO_SOUND_PLAYED);
|
||||
#ifndef VERSION_JP
|
||||
play_sound_if_no_flag(m, SOUND_ACTION_HIT_3, MARIO_ACTION_SOUND_PLAYED);
|
||||
#endif
|
||||
|
|
@ -1872,7 +1873,7 @@ static void intro_cutscene_jump_out_of_pipe(struct MarioState *m) {
|
|||
sound_banks_enable(2, 0x0330);
|
||||
play_mario_landing_sound(m, SOUND_ACTION_TERRAIN_LANDING);
|
||||
#ifndef VERSION_JP
|
||||
play_sound(SOUND_MARIO_HAHA, m->marioObj->header.gfx.cameraToObject);
|
||||
play_sound(get_character_sound(m)->soundHaha, m->marioObj->header.gfx.cameraToObject);
|
||||
#endif
|
||||
advance_cutscene_step(m);
|
||||
}
|
||||
|
|
@ -2010,16 +2011,16 @@ static s32 jumbo_star_cutscene_taking_off(struct MarioState *m) {
|
|||
|
||||
switch (animFrame) {
|
||||
case 3:
|
||||
play_sound(SOUND_MARIO_YAH_WAH_HOO + (gAudioRandom % 3 << 16),
|
||||
play_sound((get_character_sound(m)->soundYahWahHoo) + (gAudioRandom % 3 << 16),
|
||||
m->marioObj->header.gfx.cameraToObject);
|
||||
break;
|
||||
|
||||
case 28:
|
||||
play_sound(SOUND_MARIO_HOOHOO, m->marioObj->header.gfx.cameraToObject);
|
||||
play_sound(get_character_sound(m)->soundHoohoo, m->marioObj->header.gfx.cameraToObject);
|
||||
break;
|
||||
|
||||
case 60:
|
||||
play_sound(SOUND_MARIO_YAHOO, m->marioObj->header.gfx.cameraToObject);
|
||||
play_sound(get_character_sound(m)->soundYahoo, m->marioObj->header.gfx.cameraToObject);
|
||||
break;
|
||||
}
|
||||
m->particleFlags |= PARTICLE_SPARKLES;
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@
|
|||
#include "thread6.h"
|
||||
#include "pc/configfile.h"
|
||||
#include "pc/cheats.h"
|
||||
#include "pc/network/network.h"
|
||||
|
||||
struct LandingAction {
|
||||
s16 numFrames;
|
||||
|
|
@ -1386,7 +1387,7 @@ void common_slide_action(struct MarioState *m, u32 endAction, u32 airAction, s32
|
|||
case GROUND_STEP_LEFT_GROUND:
|
||||
set_mario_action(m, airAction, 0);
|
||||
if (m->forwardVel < -50.0f || 50.0f < m->forwardVel) {
|
||||
play_sound(SOUND_MARIO_HOOHOO, m->marioObj->header.gfx.cameraToObject);
|
||||
play_sound(get_character_sound(m)->soundHoohoo, m->marioObj->header.gfx.cameraToObject);
|
||||
}
|
||||
break;
|
||||
|
||||
|
|
@ -1606,12 +1607,12 @@ s32 common_ground_knockback_action(struct MarioState *m, s32 animation, s32 arg2
|
|||
}
|
||||
|
||||
if (arg4 > 0) {
|
||||
play_sound_if_no_flag(m, SOUND_MARIO_ATTACKED, MARIO_MARIO_SOUND_PLAYED);
|
||||
play_sound_if_no_flag(m, get_character_sound(m)->soundAttacked, MARIO_MARIO_SOUND_PLAYED);
|
||||
} else {
|
||||
#ifdef VERSION_JP
|
||||
play_sound_if_no_flag(m, SOUND_MARIO_OOOF, MARIO_MARIO_SOUND_PLAYED);
|
||||
play_sound_if_no_flag(m, get_character_sound(m)->soundOoof, MARIO_MARIO_SOUND_PLAYED);
|
||||
#else
|
||||
play_sound_if_no_flag(m, SOUND_MARIO_OOOF2, MARIO_MARIO_SOUND_PLAYED);
|
||||
play_sound_if_no_flag(m, get_character_sound(m)->soundOoof2, MARIO_MARIO_SOUND_PLAYED);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
@ -1662,7 +1663,7 @@ s32 act_hard_backward_ground_kb(struct MarioState *m) {
|
|||
|
||||
#ifndef VERSION_JP
|
||||
if (val04 == 0x36 && m->prevAction == ACT_SPECIAL_DEATH_EXIT) {
|
||||
play_sound(SOUND_MARIO_MAMA_MIA, m->marioObj->header.gfx.cameraToObject);
|
||||
play_sound(get_character_sound(m)->soundMamaMia, m->marioObj->header.gfx.cameraToObject);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
@ -1719,7 +1720,7 @@ s32 act_death_exit_land(struct MarioState *m) {
|
|||
val04 = set_mario_animation(m, MARIO_ANIM_FALL_OVER_BACKWARDS);
|
||||
|
||||
if (val04 == 0x36) {
|
||||
play_sound(SOUND_MARIO_MAMA_MIA, m->marioObj->header.gfx.cameraToObject);
|
||||
play_sound(get_character_sound(m)->soundMamaMia, m->marioObj->header.gfx.cameraToObject);
|
||||
}
|
||||
if (val04 == 0x44) {
|
||||
play_mario_landing_sound(m, SOUND_ACTION_TERRAIN_LANDING);
|
||||
|
|
@ -1874,7 +1875,7 @@ s32 act_long_jump_land(struct MarioState *m) {
|
|||
}
|
||||
|
||||
if (!(m->input & INPUT_NONZERO_ANALOG)) {
|
||||
play_sound_if_no_flag(m, SOUND_MARIO_UH2_2, MARIO_MARIO_SOUND_PLAYED);
|
||||
play_sound_if_no_flag(m, get_character_sound(m)->soundUh2_2, MARIO_MARIO_SOUND_PLAYED);
|
||||
}
|
||||
|
||||
common_landing_action(m,
|
||||
|
|
@ -1900,7 +1901,7 @@ s32 act_triple_jump_land(struct MarioState *m) {
|
|||
}
|
||||
|
||||
if (!(m->input & INPUT_NONZERO_ANALOG)) {
|
||||
play_sound_if_no_flag(m, SOUND_MARIO_HAHA, MARIO_MARIO_SOUND_PLAYED);
|
||||
play_sound_if_no_flag(m, get_character_sound(m)->soundHaha, MARIO_MARIO_SOUND_PLAYED);
|
||||
}
|
||||
|
||||
common_landing_action(m, MARIO_ANIM_TRIPLE_JUMP_LAND, ACT_FREEFALL);
|
||||
|
|
@ -1917,7 +1918,7 @@ s32 act_backflip_land(struct MarioState *m) {
|
|||
}
|
||||
|
||||
if (!(m->input & INPUT_NONZERO_ANALOG)) {
|
||||
play_sound_if_no_flag(m, SOUND_MARIO_HAHA, MARIO_MARIO_SOUND_PLAYED);
|
||||
play_sound_if_no_flag(m, get_character_sound(m)->soundHaha, MARIO_MARIO_SOUND_PLAYED);
|
||||
}
|
||||
|
||||
common_landing_action(m, MARIO_ANIM_TRIPLE_JUMP_LAND, ACT_FREEFALL);
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@
|
|||
#include "engine/math_util.h"
|
||||
#include "thread6.h"
|
||||
#include "behavior_data.h"
|
||||
#include "pc/configfile.h"
|
||||
#include "pc/network/network.h"
|
||||
#include "object_helpers.h"
|
||||
|
||||
|
|
@ -40,7 +41,7 @@ s32 mario_update_punch_sequence(struct MarioState *m) {
|
|||
|
||||
switch (m->actionArg) {
|
||||
case 0:
|
||||
play_sound(SOUND_MARIO_PUNCH_YAH, m->marioObj->header.gfx.cameraToObject);
|
||||
play_sound(get_character_sound(m)->soundPunchYah, m->marioObj->header.gfx.cameraToObject);
|
||||
// Fall-through:
|
||||
case 1:
|
||||
set_mario_animation(m, MARIO_ANIM_FIRST_PUNCH);
|
||||
|
|
@ -80,7 +81,7 @@ s32 mario_update_punch_sequence(struct MarioState *m) {
|
|||
break;
|
||||
|
||||
case 3:
|
||||
play_sound(SOUND_MARIO_PUNCH_WAH, m->marioObj->header.gfx.cameraToObject);
|
||||
play_sound(get_character_sound(m)->soundPunchYah, m->marioObj->header.gfx.cameraToObject);
|
||||
// Fall-through:
|
||||
case 4:
|
||||
set_mario_animation(m, MARIO_ANIM_SECOND_PUNCH);
|
||||
|
|
@ -115,7 +116,7 @@ s32 mario_update_punch_sequence(struct MarioState *m) {
|
|||
break;
|
||||
|
||||
case 6:
|
||||
play_mario_action_sound(m, SOUND_MARIO_PUNCH_HOO, 1);
|
||||
play_mario_action_sound(m, get_character_sound(m)->soundPunchHoo, 1);
|
||||
animFrame = set_mario_animation(m, MARIO_ANIM_GROUND_KICK);
|
||||
if (animFrame == 0) {
|
||||
m->marioBodyState->punchState = (2 << 6) | 6;
|
||||
|
|
@ -131,7 +132,7 @@ s32 mario_update_punch_sequence(struct MarioState *m) {
|
|||
break;
|
||||
|
||||
case 9:
|
||||
play_mario_action_sound(m, SOUND_MARIO_PUNCH_HOO, 1);
|
||||
play_mario_action_sound(m, get_character_sound(m)->soundPunchHoo, 1);
|
||||
set_mario_animation(m, MARIO_ANIM_BREAKDANCE);
|
||||
animFrame = m->marioObj->header.gfx.unk38.animFrame;
|
||||
|
||||
|
|
@ -191,7 +192,7 @@ s32 act_picking_up(struct MarioState *m) {
|
|||
// slot (cloning via fake object).
|
||||
mario_grab_used_object(m);
|
||||
if (m->heldObj != NULL) {
|
||||
play_sound_if_no_flag(m, SOUND_MARIO_HRMM, MARIO_MARIO_SOUND_PLAYED);
|
||||
play_sound_if_no_flag(m, get_character_sound(m)->soundHrmm, MARIO_MARIO_SOUND_PLAYED);
|
||||
m->actionState = 1;
|
||||
} else {
|
||||
set_mario_action(m, ACT_IDLE, 0);
|
||||
|
|
@ -271,7 +272,7 @@ s32 act_throwing(struct MarioState *m) {
|
|||
|
||||
if (++m->actionTimer == 7) {
|
||||
mario_throw_held_object(m);
|
||||
play_sound_if_no_flag(m, SOUND_MARIO_WAH2, MARIO_MARIO_SOUND_PLAYED);
|
||||
play_sound_if_no_flag(m, get_character_sound(m)->soundWah2, MARIO_MARIO_SOUND_PLAYED);
|
||||
play_sound_if_no_flag(m, SOUND_ACTION_THROW, MARIO_ACTION_SOUND_PLAYED);
|
||||
queue_rumble_data_mario(m, 3, 50);
|
||||
}
|
||||
|
|
@ -291,7 +292,7 @@ s32 act_heavy_throw(struct MarioState *m) {
|
|||
|
||||
if (++m->actionTimer == 13) {
|
||||
mario_drop_held_object(m);
|
||||
play_sound_if_no_flag(m, SOUND_MARIO_WAH2, MARIO_MARIO_SOUND_PLAYED);
|
||||
play_sound_if_no_flag(m, get_character_sound(m)->soundWah2, MARIO_MARIO_SOUND_PLAYED);
|
||||
play_sound_if_no_flag(m, SOUND_ACTION_THROW, MARIO_ACTION_SOUND_PLAYED);
|
||||
queue_rumble_data_mario(m, 3, 50);
|
||||
}
|
||||
|
|
@ -328,7 +329,7 @@ s32 act_picking_up_bowser(struct MarioState *m) {
|
|||
mario_grab_used_object(m);
|
||||
if (m->heldObj != NULL) {
|
||||
queue_rumble_data_mario(m, 5, 80);
|
||||
play_sound(SOUND_MARIO_HRMM, m->marioObj->header.gfx.cameraToObject);
|
||||
play_sound(get_character_sound(m)->soundHrmm, m->marioObj->header.gfx.cameraToObject);
|
||||
if (m->playerIndex == 0) {
|
||||
network_send_object(m->heldObj);
|
||||
} else {
|
||||
|
|
@ -357,7 +358,7 @@ s32 act_holding_bowser(struct MarioState *m) {
|
|||
mario_grab_used_object(m);
|
||||
if (m->heldObj != NULL) {
|
||||
queue_rumble_data_mario(m, 5, 80);
|
||||
play_sound(SOUND_MARIO_HRMM, m->marioObj->header.gfx.cameraToObject);
|
||||
play_sound(get_character_sound(m)->soundHrmm, m->marioObj->header.gfx.cameraToObject);
|
||||
} else {
|
||||
set_mario_action(m, ACT_IDLE, 0);
|
||||
return FALSE;
|
||||
|
|
@ -370,12 +371,12 @@ s32 act_holding_bowser(struct MarioState *m) {
|
|||
if (m->playerIndex == 0 && m->input & INPUT_B_PRESSED) {
|
||||
#ifndef VERSION_JP
|
||||
if (m->angleVel[1] <= -0xE00 || m->angleVel[1] >= 0xE00) {
|
||||
play_sound(SOUND_MARIO_SO_LONGA_BOWSER, m->marioObj->header.gfx.cameraToObject);
|
||||
play_sound(get_character_sound(m)->soundSoLongaBowser, m->marioObj->header.gfx.cameraToObject);
|
||||
} else {
|
||||
play_sound(SOUND_MARIO_HERE_WE_GO, m->marioObj->header.gfx.cameraToObject);
|
||||
play_sound(get_character_sound(m)->soundHereWeGo, m->marioObj->header.gfx.cameraToObject);
|
||||
}
|
||||
#else
|
||||
play_sound(SOUND_MARIO_HERE_WE_GO, m->marioObj->header.gfx.cameraToObject);
|
||||
play_sound(get_character_sound(m)->soundHereWeGo, m->marioObj->header.gfx.cameraToObject);
|
||||
#endif
|
||||
return set_mario_action(m, ACT_RELEASING_BOWSER, 0);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,6 +17,8 @@
|
|||
#include "sound_init.h"
|
||||
#include "surface_terrains.h"
|
||||
#include "thread6.h"
|
||||
#include "pc/configfile.h"
|
||||
#include "pc/network/network.h"
|
||||
|
||||
s32 check_common_idle_cancels(struct MarioState *m) {
|
||||
mario_drop_held_object(m);
|
||||
|
|
@ -243,18 +245,18 @@ s32 act_start_sleeping(struct MarioState *m) {
|
|||
#ifndef VERSION_JP
|
||||
if (m->actionState == 2) {
|
||||
if (sp24 == -1) {
|
||||
play_sound(SOUND_MARIO_YAWNING, m->marioObj->header.gfx.cameraToObject);
|
||||
play_sound(get_character_sound(m)->soundYawning, m->marioObj->header.gfx.cameraToObject);
|
||||
}
|
||||
}
|
||||
|
||||
if (m->actionState == 1) {
|
||||
if (sp24 == -1) {
|
||||
play_sound(SOUND_MARIO_IMA_TIRED, m->marioObj->header.gfx.cameraToObject);
|
||||
play_sound(get_character_sound(m)->soundImaTired, m->marioObj->header.gfx.cameraToObject);
|
||||
}
|
||||
}
|
||||
#else
|
||||
if (m->actionState == 2) {
|
||||
play_sound_if_no_flag(m, SOUND_MARIO_YAWNING, MARIO_MARIO_SOUND_PLAYED);
|
||||
play_sound_if_no_flag(m, get_character_sound(m)->soundYawning, MARIO_MARIO_SOUND_PLAYED);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
@ -289,12 +291,12 @@ s32 act_sleeping(struct MarioState *m) {
|
|||
}
|
||||
|
||||
if (sp24 == 2) {
|
||||
play_sound(SOUND_MARIO_SNORING1, m->marioObj->header.gfx.cameraToObject);
|
||||
play_sound(get_character_sound(m)->soundSnoring1, m->marioObj->header.gfx.cameraToObject);
|
||||
m->isSnoring = TRUE;
|
||||
}
|
||||
|
||||
if (sp24 == 20) {
|
||||
play_sound(SOUND_MARIO_SNORING2, m->marioObj->header.gfx.cameraToObject);
|
||||
play_sound(get_character_sound(m)->soundSnoring2, m->marioObj->header.gfx.cameraToObject);
|
||||
m->isSnoring = TRUE;
|
||||
}
|
||||
|
||||
|
|
@ -319,16 +321,16 @@ s32 act_sleeping(struct MarioState *m) {
|
|||
case 2: {
|
||||
sp24 = set_mario_animation(m, MARIO_ANIM_SLEEP_LYING);
|
||||
#ifndef VERSION_JP
|
||||
play_sound_if_no_flag(m, SOUND_MARIO_SNORING3, MARIO_ACTION_SOUND_PLAYED);
|
||||
play_sound_if_no_flag(m, get_character_sound(m)->soundSnoring3, MARIO_ACTION_SOUND_PLAYED);
|
||||
m->isSnoring = TRUE;
|
||||
#else
|
||||
if (sp24 == 2) {
|
||||
play_sound(SOUND_MARIO_SNORING2, m->marioObj->header.gfx.cameraToObject);
|
||||
play_sound(get_character_sound(m)->soundSnoring2, m->marioObj->header.gfx.cameraToObject);
|
||||
m->isSnoring = TRUE;
|
||||
}
|
||||
|
||||
if (sp24 == 25) {
|
||||
play_sound(SOUND_MARIO_SNORING1, m->marioObj->header.gfx.cameraToObject);
|
||||
play_sound(get_character_sound(m)->soundSnoring1, m->marioObj->header.gfx.cameraToObject);
|
||||
m->isSnoring = TRUE;
|
||||
}
|
||||
#endif
|
||||
|
|
@ -340,10 +342,10 @@ s32 act_sleeping(struct MarioState *m) {
|
|||
|
||||
s32 act_waking_up(struct MarioState *m) {
|
||||
if (!m->actionTimer) {
|
||||
func_803205E8(SOUND_MARIO_SNORING1, m->marioObj->header.gfx.cameraToObject);
|
||||
func_803205E8(SOUND_MARIO_SNORING2, m->marioObj->header.gfx.cameraToObject);
|
||||
func_803205E8(get_character_sound(m)->soundSnoring1, m->marioObj->header.gfx.cameraToObject);
|
||||
func_803205E8(get_character_sound(m)->soundSnoring2, m->marioObj->header.gfx.cameraToObject);
|
||||
#ifndef VERSION_JP
|
||||
func_803205E8(SOUND_MARIO_SNORING3, m->marioObj->header.gfx.cameraToObject);
|
||||
func_803205E8(get_character_sound(m)->soundSnoring3, m->marioObj->header.gfx.cameraToObject);
|
||||
#endif
|
||||
if (m->playerIndex == 0) {
|
||||
raise_background_noise(2);
|
||||
|
|
@ -400,7 +402,7 @@ s32 act_shivering(struct MarioState *m) {
|
|||
sp24 = set_mario_animation(m, MARIO_ANIM_SHIVERING_WARMING_HAND);
|
||||
if (sp24 == 0x31) {
|
||||
m->particleFlags |= PARTICLE_BREATH;
|
||||
play_sound(SOUND_MARIO_PANTING_COLD, m->marioObj->header.gfx.cameraToObject);
|
||||
play_sound(get_character_sound(m)->soundPantingCold, m->marioObj->header.gfx.cameraToObject);
|
||||
}
|
||||
if (sp24 == 7 || sp24 == 0x51) {
|
||||
play_sound(SOUND_ACTION_CLAP_HANDS_COLD, m->marioObj->header.gfx.cameraToObject);
|
||||
|
|
@ -438,15 +440,15 @@ s32 act_coughing(struct MarioState *m) {
|
|||
stationary_ground_step(m);
|
||||
sp1C = set_mario_animation(m, MARIO_ANIM_COUGHING);
|
||||
if (sp1C == 0x19 || sp1C == 0x23) {
|
||||
play_sound(SOUND_MARIO_COUGHING3, m->marioObj->header.gfx.cameraToObject);
|
||||
play_sound(get_character_sound(m)->soundCoughing3, m->marioObj->header.gfx.cameraToObject);
|
||||
}
|
||||
|
||||
if (sp1C == 0x32 || sp1C == 0x3A) {
|
||||
play_sound(SOUND_MARIO_COUGHING2, m->marioObj->header.gfx.cameraToObject);
|
||||
play_sound(get_character_sound(m)->soundCoughing2, m->marioObj->header.gfx.cameraToObject);
|
||||
}
|
||||
|
||||
if (sp1C == 0x47 || sp1C == 0x50) {
|
||||
play_sound(SOUND_MARIO_COUGHING1, m->marioObj->header.gfx.cameraToObject);
|
||||
play_sound(get_character_sound(m)->soundCoughing1, m->marioObj->header.gfx.cameraToObject);
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
|
@ -593,7 +595,7 @@ s32 act_panting(struct MarioState *m) {
|
|||
}
|
||||
|
||||
if (set_mario_animation(m, MARIO_ANIM_WALK_PANTING) == 1) {
|
||||
play_sound(SOUND_MARIO_PANTING + ((gAudioRandom % 3U) << 0x10),
|
||||
play_sound(get_character_sound(m)->soundPanting + ((gAudioRandom % 3U) << 0x10),
|
||||
m->marioObj->header.gfx.cameraToObject);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -16,6 +16,8 @@
|
|||
#include "behavior_data.h"
|
||||
#include "level_table.h"
|
||||
#include "thread6.h"
|
||||
#include "pc/configfile.h"
|
||||
#include "pc/network/network.h"
|
||||
|
||||
#define MIN_SWIM_STRENGTH 160
|
||||
#define MIN_SWIM_SPEED 16.0f
|
||||
|
|
@ -888,7 +890,7 @@ static s32 act_forward_water_kb(struct MarioState *m) {
|
|||
}
|
||||
|
||||
static s32 act_water_shocked(struct MarioState *m) {
|
||||
play_sound_if_no_flag(m, SOUND_MARIO_WAAAOOOW, MARIO_ACTION_SOUND_PLAYED);
|
||||
play_sound_if_no_flag(m, get_character_sound(m)->soundWaaaooow, MARIO_ACTION_SOUND_PLAYED);
|
||||
play_sound(SOUND_MOVING_SHOCKED, m->marioObj->header.gfx.cameraToObject);
|
||||
if (m->playerIndex == 0) { set_camera_shake_from_hit(SHAKE_SHOCK); }
|
||||
|
||||
|
|
@ -928,7 +930,7 @@ static s32 act_drowning(struct MarioState *m) {
|
|||
break;
|
||||
}
|
||||
|
||||
play_sound_if_no_flag(m, SOUND_MARIO_DROWNING, MARIO_ACTION_SOUND_PLAYED);
|
||||
play_sound_if_no_flag(m, get_character_sound(m)->soundDrowning, MARIO_ACTION_SOUND_PLAYED);
|
||||
stationary_slow_down(m);
|
||||
perform_water_step(m);
|
||||
|
||||
|
|
@ -976,7 +978,7 @@ static s32 act_water_plunge(struct MarioState *m) {
|
|||
if (m->actionState == 0) {
|
||||
play_sound(SOUND_ACTION_UNKNOWN430, m->marioObj->header.gfx.cameraToObject);
|
||||
if (m->peakHeight - m->pos[1] > 1150.0f) {
|
||||
play_sound(SOUND_MARIO_HAHA_2, m->marioObj->header.gfx.cameraToObject);
|
||||
play_sound(get_character_sound(m)->soundHaha_2, m->marioObj->header.gfx.cameraToObject);
|
||||
}
|
||||
|
||||
m->particleFlags |= PARTICLE_WATER_SPLASH;
|
||||
|
|
|
|||
|
|
@ -90,6 +90,7 @@ static const u8 optsAudioStr[][32] = {
|
|||
{ TEXT_OPT_MUSVOLUME },
|
||||
{ TEXT_OPT_SFXVOLUME },
|
||||
{ TEXT_OPT_ENVVOLUME },
|
||||
{ TEXT_OPT_LUIGISND },
|
||||
};
|
||||
|
||||
static const u8 optsCheatsStr[][64] = {
|
||||
|
|
@ -271,6 +272,7 @@ static struct Option optsAudio[] = {
|
|||
DEF_OPT_SCROLL( optsAudioStr[1], &configMusicVolume, 0, MAX_VOLUME, 1),
|
||||
DEF_OPT_SCROLL( optsAudioStr[2], &configSfxVolume, 0, MAX_VOLUME, 1),
|
||||
DEF_OPT_SCROLL( optsAudioStr[3], &configEnvVolume, 0, MAX_VOLUME, 1),
|
||||
DEF_OPT_TOGGLE( optsAudioStr[4], &configLuigiSounds ),
|
||||
};
|
||||
|
||||
static struct Option optsCheats[] = {
|
||||
|
|
|
|||
|
|
@ -19,13 +19,17 @@
|
|||
#include "audio/external.h"
|
||||
#include "config.h"
|
||||
#include "pc/network/version.h"
|
||||
#include "pc/network/discord/discord.h"
|
||||
|
||||
#ifdef DISCORD_SDK
|
||||
#include "pc/network/discord/discord.h"
|
||||
#endif
|
||||
|
||||
#define MAIN_MENU_HEADER_TEXT "SM64 COOP"
|
||||
|
||||
char sConnectionJoinError[128] = { 0 };
|
||||
char gConnectionText[128] = { 0 };
|
||||
struct CustomMenu* sConnectMenu = NULL;
|
||||
|
||||
u8 gOpenConnectMenu = FALSE;
|
||||
s8 sGotoGame = 0;
|
||||
|
||||
|
|
@ -42,9 +46,9 @@ static void menu_main_draw_strings(void) {
|
|||
|
||||
static void host_menu_draw_strings(void) {
|
||||
#ifdef DISCORD_SDK
|
||||
#define HOST_MENU_MAX_ITEMS 4
|
||||
#define HOST_MENU_MAX_ITEMS 6
|
||||
#else
|
||||
#define HOST_MENU_MAX_ITEMS 3
|
||||
#define HOST_MENU_MAX_ITEMS 5
|
||||
#endif
|
||||
|
||||
// set up server setting strings
|
||||
|
|
@ -66,30 +70,36 @@ static void host_menu_draw_strings(void) {
|
|||
|
||||
buttonText[2] = configStayInLevelAfterStar ? "Stay in level after star." : "Leave level after star.";
|
||||
|
||||
buttonText[3] = configSkipIntro ? "Skip intro cutscene." : "Play intro cutscene.";
|
||||
|
||||
buttonText[4] = configShareLives ? "Share lives." : "Lives are not shared.";
|
||||
|
||||
#ifdef DISCORD_SDK
|
||||
buttonText[3] = (configNetworkSystem == 0) ? "Host through Discord." : "Host direct connection.";
|
||||
buttonText[5] = (configNetworkSystem == 0) ? "Host through Discord." : "Host direct connection.";
|
||||
#endif
|
||||
|
||||
// display server setting strings
|
||||
for (int i = 0; i < HOST_MENU_MAX_ITEMS; i++) {
|
||||
print_generic_ascii_string(95, 158 + -35 * i, buttonText[i]);
|
||||
print_generic_ascii_string(95, 173 + -29 * i, buttonText[i]);
|
||||
}
|
||||
|
||||
// display direct connection warning
|
||||
if (configNetworkSystem != 0) {
|
||||
print_generic_ascii_string(0, 30, "For direct connections -");
|
||||
f32 red = (f32)fabs(sin(gGlobalTimer / 20.0f));
|
||||
gDPSetEnvColor(gDisplayListHead++, 222, 222 * red, 222 * red, gMenuStringAlpha);
|
||||
char warning[128];
|
||||
snprintf(warning, 127, "You must forward port '%d' in your router or use Hamachi.", configHostPort);
|
||||
print_generic_ascii_string(0, 15, warning);
|
||||
} else if ((configNetworkSystem == 0) && gDiscordFailed) {
|
||||
snprintf(warning, 127, "Port forward '%d' in network router settings or use Hamachi.", configHostPort);
|
||||
print_generic_ascii_string(0, 5, warning);
|
||||
}
|
||||
#ifdef DISCORD_SDK
|
||||
else if ((configNetworkSystem == 0) && gDiscordFailed) {
|
||||
f32 red = (f32)fabs(sin(gGlobalTimer / 20.0f));
|
||||
gDPSetEnvColor(gDisplayListHead++, 222, 222 * red, 222 * red, gMenuStringAlpha);
|
||||
char warning[128];
|
||||
snprintf(warning, 127, "Discord failed to initialize.");
|
||||
print_generic_ascii_string(0, 15, warning);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
static void host_menu_do_host(void) {
|
||||
|
|
@ -134,6 +144,14 @@ static void host_menu_setting_stay_in_level(void) {
|
|||
configStayInLevelAfterStar = (configStayInLevelAfterStar == 0) ? 1 : 0;
|
||||
}
|
||||
|
||||
static void host_menu_setting_skip_intro(void) {
|
||||
configSkipIntro = (configSkipIntro == 1) ? 0 : 1;
|
||||
}
|
||||
|
||||
static void host_menu_setting_share_lives(void) {
|
||||
configShareLives = (configShareLives == 0) ? 1 : 0;
|
||||
}
|
||||
|
||||
#ifdef DISCORD_SDK
|
||||
static void join_menu_draw_strings(void) {
|
||||
print_generic_ascii_string(30, 155, "Accept a Discord game invite in order to join.");
|
||||
|
|
@ -217,7 +235,7 @@ static void connect_menu_on_click(void) {
|
|||
|
||||
// fill in our last attempt
|
||||
if (configJoinPort == 0 || configJoinPort > 65535) { configJoinPort = DEFAULT_PORT; }
|
||||
|
||||
|
||||
// only print custom port
|
||||
if (configJoinPort == DEFAULT_PORT) {
|
||||
sprintf(gTextInput, "%s", configJoinIp);
|
||||
|
|
@ -243,35 +261,41 @@ void custom_menu_init(struct CustomMenu* head) {
|
|||
head->draw_strings = menu_main_draw_strings;
|
||||
|
||||
// create sub menus and buttons
|
||||
struct CustomMenu* hostMenu = custom_menu_create(head, "HOST", -266, 0);
|
||||
struct CustomMenu* hostMenu = custom_menu_create(head, "HOST", -266, 0, gButtonScale.large);
|
||||
hostMenu->headerY = 30;
|
||||
hostMenu->draw_strings = host_menu_draw_strings;
|
||||
custom_menu_create_button(hostMenu, "CANCEL", 700, -400 + (250 * 3), SOUND_MENU_CAMERA_ZOOM_OUT, custom_menu_close);
|
||||
custom_menu_create_button(hostMenu, "HOST", 700, -400, SOUND_MENU_CAMERA_ZOOM_IN, host_menu_do_host);
|
||||
custom_menu_create_button(hostMenu, "", -700, -400 + (250 * 3), SOUND_ACTION_BONK, host_menu_setting_interaction);
|
||||
custom_menu_create_button(hostMenu, "", -700, -400 + (250 * 2), SOUND_ACTION_BONK, host_menu_setting_knockback);
|
||||
custom_menu_create_button(hostMenu, "", -700, -400 + (250 * 1), SOUND_ACTION_BONK, host_menu_setting_stay_in_level);
|
||||
custom_menu_create_button(hostMenu, "CANCEL", 700, -196 + (210 * 3), gButtonScale.large, SOUND_MENU_CAMERA_ZOOM_OUT, custom_menu_close);
|
||||
custom_menu_create_button(hostMenu, "HOST", 700, -220, gButtonScale.large, SOUND_MENU_CAMERA_ZOOM_IN, host_menu_do_host);
|
||||
custom_menu_create_button(hostMenu, "", -700, -180 + (210 * 3), gButtonScale.medium, SOUND_ACTION_BONK, host_menu_setting_interaction);
|
||||
custom_menu_create_button(hostMenu, "", -700, -180 + (210 * 2), gButtonScale.medium, SOUND_ACTION_BONK, host_menu_setting_knockback);
|
||||
custom_menu_create_button(hostMenu, "", -700, -180 + (210 * 1), gButtonScale.medium, SOUND_ACTION_BONK, host_menu_setting_stay_in_level);
|
||||
custom_menu_create_button(hostMenu, "", -700, -180 + (210 * 0), gButtonScale.medium, SOUND_ACTION_BONK, host_menu_setting_skip_intro);
|
||||
custom_menu_create_button(hostMenu, "", -700, -180 + (210 * -1), gButtonScale.medium, SOUND_ACTION_BONK, host_menu_setting_share_lives);
|
||||
#ifdef DISCORD_SDK
|
||||
custom_menu_create_button(hostMenu, "", -700, -400 + (250 * 0), SOUND_ACTION_BONK, host_menu_setting_network_system);
|
||||
custom_menu_create_button(hostMenu, "", -700, -180 + (210 * -2), gButtonScale.medium, SOUND_ACTION_BONK, host_menu_setting_network_system);
|
||||
#endif
|
||||
|
||||
#ifdef DISCORD_SDK
|
||||
struct CustomMenu* joinMenu = custom_menu_create(head, "JOIN", 266, 0);
|
||||
custom_menu_create_button(joinMenu, "CANCEL", -266, -320, SOUND_MENU_CAMERA_ZOOM_OUT, custom_menu_close);
|
||||
struct CustomMenu* joinMenu = custom_menu_create(head, "JOIN", 266, 0, gButtonScale.large);
|
||||
custom_menu_create_button(joinMenu, "CANCEL", -266, -320, gButtonScale.large, SOUND_MENU_CAMERA_ZOOM_OUT, custom_menu_close);
|
||||
joinMenu->draw_strings = join_menu_draw_strings;
|
||||
struct CustomMenu* connectMenu = custom_menu_create(joinMenu, "CONNECT", 266, -320);
|
||||
struct CustomMenu* connectMenu = custom_menu_create(joinMenu, "CONNECT", 266, -320, gButtonScale.large);
|
||||
#else
|
||||
struct CustomMenu* connectMenu = custom_menu_create(head, "CONNECT", 266, 0);
|
||||
struct CustomMenu* connectMenu = custom_menu_create(head, "CONNECT", 266, 0, gButtonScale.large);
|
||||
#endif
|
||||
connectMenu->me->on_click = connect_menu_on_click;
|
||||
connectMenu->on_close = connect_menu_on_close;
|
||||
connectMenu->draw_strings = connect_menu_draw_strings;
|
||||
custom_menu_create_button(connectMenu, "CANCEL", 0, -400, SOUND_MENU_CAMERA_ZOOM_OUT, custom_menu_close);
|
||||
custom_menu_create_button(connectMenu, "CANCEL", 0, -400, gButtonScale.large, SOUND_MENU_CAMERA_ZOOM_OUT, custom_menu_close);
|
||||
sConnectMenu = connectMenu;
|
||||
}
|
||||
|
||||
void custom_menu_loop(void) {
|
||||
// we've received an event that makes us exit the menus
|
||||
if (sGotoGame) { sSelectedFileNum = sGotoGame; }
|
||||
if (sGotoGame) {
|
||||
sSelectedFileNum = sGotoGame;
|
||||
custom_menu_close_system();
|
||||
}
|
||||
|
||||
// force-start the load when command-line server hosting
|
||||
if (gNetworkType == NT_SERVER && sSelectedFileNum == 0) {
|
||||
|
|
|
|||
|
|
@ -20,6 +20,11 @@
|
|||
static struct CustomMenu* sHead = NULL;
|
||||
static struct CustomMenu* sCurrentMenu = NULL;
|
||||
static struct CustomMenu* sLastMenu = NULL;
|
||||
struct CustomMenuButtonScale gButtonScale = {
|
||||
.small = 0.08111111f,
|
||||
.medium = 0.09511111f,
|
||||
.large = 0.11111111f,
|
||||
};
|
||||
|
||||
u8 gMenuStringAlpha = 255;
|
||||
|
||||
|
|
@ -29,7 +34,7 @@ struct ErrorDialog {
|
|||
};
|
||||
static struct ErrorDialog* sErrorDialog = NULL;
|
||||
|
||||
struct CustomMenuButton* custom_menu_create_button(struct CustomMenu* parent, char* label, u16 x, u16 y, s32 clickSound, void (*on_click)(void)) {
|
||||
struct CustomMenuButton* custom_menu_create_button(struct CustomMenu* parent, char* label, u16 x, u16 y, f32 scale, s32 clickSound, void (*on_click)(void)) {
|
||||
struct CustomMenuButton* button = calloc(1, sizeof(struct CustomMenuButton));
|
||||
if (parent->buttons == NULL) {
|
||||
parent->buttons = button;
|
||||
|
|
@ -45,7 +50,8 @@ struct CustomMenuButton* custom_menu_create_button(struct CustomMenu* parent, ch
|
|||
button->clickSound = clickSound;
|
||||
|
||||
struct Object* obj = spawn_object_rel_with_rot(parent->me->object, MODEL_MAIN_MENU_MARIO_NEW_BUTTON, bhvMenuButton, x * -1, y, -1, 0, 0x8000, 0);
|
||||
obj->oMenuButtonScale = 0.11111111f;
|
||||
|
||||
obj->oMenuButtonScale = scale;
|
||||
obj->oFaceAngleRoll = 0;
|
||||
obj->oMenuButtonTimer = 0;
|
||||
obj->oMenuButtonOrigPosX = obj->oParentRelativePosX;
|
||||
|
|
@ -57,8 +63,8 @@ struct CustomMenuButton* custom_menu_create_button(struct CustomMenu* parent, ch
|
|||
return button;
|
||||
}
|
||||
|
||||
struct CustomMenu* custom_menu_create(struct CustomMenu* parent, char* label, u16 x, u16 y) {
|
||||
struct CustomMenuButton* button = custom_menu_create_button(parent, label, x, y, SOUND_MENU_CAMERA_ZOOM_IN, NULL);
|
||||
struct CustomMenu* custom_menu_create(struct CustomMenu* parent, char* label, u16 x, u16 y, f32 scale) {
|
||||
struct CustomMenuButton* button = custom_menu_create_button(parent, label, x, y, scale, SOUND_MENU_CAMERA_ZOOM_IN, NULL);
|
||||
struct CustomMenu* menu = calloc(1, sizeof(struct CustomMenu));
|
||||
menu->parent = parent;
|
||||
menu->depth = parent->depth + 1;
|
||||
|
|
@ -90,7 +96,7 @@ void custom_menu_system_init(void) {
|
|||
}
|
||||
|
||||
void custom_menu_destroy(void) {
|
||||
/* TODO: we should probably clean up all of this stuff */
|
||||
// TODO: clean up all of the calloc()'d memory
|
||||
}
|
||||
|
||||
void custom_menu_system_loop(void) {
|
||||
|
|
@ -183,13 +189,15 @@ void custom_menu_close_system(void) {
|
|||
static s32 cursor_inside_button(struct CustomMenuButton* button, f32 cursorX, f32 cursorY) {
|
||||
f32 x = button->object->oParentRelativePosX;
|
||||
f32 y = button->object->oParentRelativePosY;
|
||||
f32 scale = button->object->oMenuButtonScale;
|
||||
|
||||
x *= -0.137f;
|
||||
y *= 0.137f;
|
||||
|
||||
s16 maxX = x + 25.0f;
|
||||
s16 minX = x - 25.0f;
|
||||
s16 maxY = y + 21.0f;
|
||||
s16 minY = y - 21.0f;
|
||||
s16 maxX = x + scale * 185.0f;
|
||||
s16 minX = x - scale * 185.0f;
|
||||
s16 maxY = y + scale * 185.0f;
|
||||
s16 minY = y - scale * 101.0f;
|
||||
|
||||
return (cursorX < maxX && minX < cursorX && cursorY < maxY && minY < cursorY);
|
||||
}
|
||||
|
|
@ -236,7 +244,7 @@ void custom_menu_cursor_click(f32 cursorX, f32 cursorY) {
|
|||
}
|
||||
|
||||
if (didSomething) { break; }
|
||||
}
|
||||
}
|
||||
button = button->next;
|
||||
}
|
||||
}
|
||||
|
|
@ -254,7 +262,7 @@ void custom_menu_print_strings(void) {
|
|||
// figure out alpha
|
||||
struct Object* curObj = sCurrentMenu->me->object;
|
||||
struct Object* lastObj = (sLastMenu != NULL) ? sLastMenu->me->object : NULL;
|
||||
|
||||
|
||||
if (curObj != NULL && lastObj != NULL) {
|
||||
if (curObj->oMenuButtonState == MENU_BUTTON_STATE_FULLSCREEN && lastObj->oMenuButtonState != MENU_BUTTON_STATE_SHRINKING) {
|
||||
if (gMenuStringAlpha < 250) {
|
||||
|
|
@ -398,4 +406,4 @@ void custom_menu_error(char* message) {
|
|||
item = item->next;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -21,11 +21,18 @@ struct CustomMenu {
|
|||
void (*on_close)(void);
|
||||
};
|
||||
|
||||
struct CustomMenuButtonScale {
|
||||
f32 small;
|
||||
f32 medium;
|
||||
f32 large;
|
||||
};
|
||||
extern struct CustomMenuButtonScale gButtonScale;
|
||||
|
||||
extern u8 gMenuStringAlpha;
|
||||
|
||||
void custom_menu_system_init(void);
|
||||
struct CustomMenu* custom_menu_create(struct CustomMenu* parent, char* label, u16 x, u16 y);
|
||||
struct CustomMenuButton* custom_menu_create_button(struct CustomMenu* parent, char* label, u16 x, u16 y, s32 clickSound, void (*on_click)(void));
|
||||
struct CustomMenu* custom_menu_create(struct CustomMenu* parent, char* label, u16 x, u16 y, f32 scale);
|
||||
struct CustomMenuButton* custom_menu_create_button(struct CustomMenu* parent, char* label, u16 x, u16 y, f32 scale, s32 clickSound, void (*on_click)(void));
|
||||
|
||||
void custom_menu_system_loop(void);
|
||||
void custom_menu_print_strings(void);
|
||||
|
|
|
|||
|
|
@ -92,6 +92,7 @@ bool configCameraAnalog = true;
|
|||
bool configCameraMouse = false;
|
||||
#endif
|
||||
bool configSkipIntro = 0;
|
||||
bool configShareLives = 0;
|
||||
bool configHUD = true;
|
||||
#ifdef DISCORDRPC
|
||||
bool configDiscordRPC = true;
|
||||
|
|
@ -105,6 +106,7 @@ unsigned int configPlayerInteraction = 1;
|
|||
unsigned int configPlayerKnockbackStrength = 25;
|
||||
unsigned int configStayInLevelAfterStar = 0;
|
||||
unsigned int configNetworkSystem = 0;
|
||||
bool configLuigiSounds = true;
|
||||
|
||||
static const struct ConfigOption options[] = {
|
||||
{.name = "fullscreen", .type = CONFIG_TYPE_BOOL, .boolValue = &configWindow.fullscreen},
|
||||
|
|
@ -151,6 +153,7 @@ static const struct ConfigOption options[] = {
|
|||
{.name = "bettercam_degrade", .type = CONFIG_TYPE_UINT, .uintValue = &configCameraDegrade},
|
||||
#endif
|
||||
{.name = "skip_intro", .type = CONFIG_TYPE_BOOL, .boolValue = &configSkipIntro},
|
||||
{.name = "share_lives", .type = CONFIG_TYPE_BOOL, .boolValue = &configShareLives},
|
||||
#ifdef DISCORDRPC
|
||||
{.name = "discordrpc_enable", .type = CONFIG_TYPE_BOOL, .boolValue = &configDiscordRPC},
|
||||
#endif
|
||||
|
|
@ -163,6 +166,7 @@ static const struct ConfigOption options[] = {
|
|||
{.name = "coop_player_knockback_strength", .type = CONFIG_TYPE_UINT , .uintValue = &configPlayerKnockbackStrength},
|
||||
{.name = "coop_stay_in_level_after_star", .type = CONFIG_TYPE_UINT , .uintValue = &configStayInLevelAfterStar},
|
||||
{.name = "coop_network_system", .type = CONFIG_TYPE_UINT , .uintValue = &configNetworkSystem},
|
||||
{.name = "coop_luigi_sounds", .type = CONFIG_TYPE_BOOL , .boolValue = &configLuigiSounds},
|
||||
};
|
||||
|
||||
// Reads an entire line from a file (excluding the newline character) and returns an allocated string
|
||||
|
|
|
|||
|
|
@ -60,6 +60,7 @@ extern bool configCameraAnalog;
|
|||
#endif
|
||||
extern bool configHUD;
|
||||
extern bool configSkipIntro;
|
||||
extern bool configShareLives;
|
||||
#ifdef DISCORDRPC
|
||||
extern bool configDiscordRPC;
|
||||
#endif
|
||||
|
|
@ -71,6 +72,7 @@ extern unsigned int configPlayerInteraction;
|
|||
extern unsigned int configPlayerKnockbackStrength;
|
||||
extern unsigned int configStayInLevelAfterStar;
|
||||
extern unsigned int configNetworkSystem;
|
||||
extern bool configLuigiSounds;
|
||||
|
||||
void configfile_load(const char *filename);
|
||||
void configfile_save(const char *filename);
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
#include "discord_network.h"
|
||||
#include "pc/debuglog.h"
|
||||
#include "menu/custom_menu_system.h"
|
||||
#include "pc/network/version.h"
|
||||
|
||||
#if defined(_WIN32) || defined(_WIN64)
|
||||
#include <windows.h>
|
||||
|
|
@ -128,6 +129,14 @@ static bool ns_discord_initialize(enum NetworkType networkType) {
|
|||
#ifdef DEBUG
|
||||
set_instance_env_variable();
|
||||
#endif
|
||||
|
||||
#ifdef UNSTABLE_BRANCH
|
||||
if (networkType != NT_NONE) {
|
||||
// refuse to host on discord for unstable branch
|
||||
exit(1);
|
||||
}
|
||||
#endif
|
||||
|
||||
if (!gDiscordInitialized) {
|
||||
// set up discord params
|
||||
struct DiscordCreateParams params;
|
||||
|
|
@ -142,10 +151,6 @@ static bool ns_discord_initialize(enum NetworkType networkType) {
|
|||
int rc = DiscordCreate(DISCORD_VERSION, ¶ms, &app.core);
|
||||
gDiscordFailed = false;
|
||||
if (networkType != NT_NONE) {
|
||||
#ifdef UNSTABLE_BRANCH
|
||||
// refuse to host on discord for unstable branch
|
||||
exit(1);
|
||||
#endif
|
||||
DISCORD_REQUIRE(rc);
|
||||
} else if (rc) {
|
||||
LOG_ERROR("DiscordCreate failed: %d", rc);
|
||||
|
|
|
|||
|
|
@ -28,6 +28,8 @@ struct StringLinkedList gRegisteredMods = { 0 };
|
|||
struct ServerSettings gServerSettings = {
|
||||
.playerInteractions = PLAYER_INTERACTIONS_SOLID,
|
||||
.playerKnockbackStrength = 25,
|
||||
.skipIntro = 0,
|
||||
.shareLives = 0,
|
||||
};
|
||||
|
||||
void network_set_system(enum NetworkSystemType nsType) {
|
||||
|
|
@ -51,6 +53,8 @@ bool network_init(enum NetworkType inNetworkType) {
|
|||
gServerSettings.playerInteractions = configPlayerInteraction;
|
||||
gServerSettings.playerKnockbackStrength = configPlayerKnockbackStrength;
|
||||
gServerSettings.stayInLevelAfterStar = configStayInLevelAfterStar;
|
||||
gServerSettings.skipIntro = configSkipIntro;
|
||||
gServerSettings.shareLives = configShareLives;
|
||||
|
||||
// initialize the network system
|
||||
int rc = gNetworkSystem->initialize(inNetworkType);
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue