This commit is contained in:
Cooliokid956 2026-06-17 21:54:04 -05:00
parent edb8d68f02
commit 9f748cbe76
14 changed files with 54 additions and 81 deletions

View file

@ -5204,15 +5204,6 @@ BOBOMB_ACT_LAVA_DEATH = 100
--- @type integer
BOBOMB_ACT_DEATH_PLANE_DEATH = 101
COIN_TYPE_NONE = 0 --- @type CoinTypes
COIN_TYPE_YELLOW = 1 --- @type CoinTypes
COIN_TYPE_BLUE = 2 --- @type CoinTypes
--- @alias CoinTypes
--- | `COIN_TYPE_NONE`
--- | `COIN_TYPE_YELLOW`
--- | `COIN_TYPE_BLUE`
--- @type integer
HIDDEN_BLUE_COIN_ACT_INACTIVE = 0

View file

@ -9841,29 +9841,29 @@ end
--- @param obj Object
--- @param numCoins integer
--- @param baseYVel number
--- @param sp30 number
--- @param coinBehavior Pointer_BehaviorScript
--- @param posJitter integer
--- @param model integer
--- Spawns loot coins from an object using the specified behavior, jitter, and model
function obj_spawn_loot_coins(obj, numCoins, baseYVel, coinBehavior, posJitter, model)
function obj_spawn_loot_coins(obj, numCoins, sp30, coinBehavior, posJitter, model)
-- ...
end
--- @param obj Object
--- @param numCoins integer
--- @param baseYVel number
--- @param sp28 number
--- @param posJitter integer
--- Spawns blue loot coins from an object
function obj_spawn_loot_blue_coins(obj, numCoins, baseYVel, posJitter)
function obj_spawn_loot_blue_coins(obj, numCoins, sp28, posJitter)
-- ...
end
--- @param obj Object
--- @param numCoins integer
--- @param baseYVel number
--- @param sp28 number
--- Spawns yellow loot coins from an object
function obj_spawn_loot_yellow_coins(obj, numCoins, baseYVel)
function obj_spawn_loot_yellow_coins(obj, numCoins, sp28)
-- ...
end
@ -10251,10 +10251,10 @@ function cur_obj_set_hitbox_and_die_if_attacked(hitbox, deathSound, noLootCoins)
-- ...
end
--- @param mistSize number
--- @param coinType integer
--- @param sp18 number
--- @param sp1C integer
--- Explodes the current object, spawns particles, and optionally spawns coins
function obj_explode_and_spawn_coins(mistSize, coinType)
function obj_explode_and_spawn_coins(sp18, sp1C)
-- ...
end

View file

@ -1580,7 +1580,7 @@
--- @field public oCloudFwooshMovementRadius integer
--- @field public oCoinUnkF4 integer
--- @field public oCoinUnkF8 integer
--- @field public oCoinBaseYVel number
--- @field public oCoinUnk110 number
--- @field public oCoinUnk1B0 integer
--- @field public oCollisionParticleUnkF4 number
--- @field public oControllablePlatformUnkF8 integer

View file

@ -1132,7 +1132,7 @@ s64 DynOS_Bhv_ParseBehaviorScriptConstants(const String &_Arg, bool *found) {
/* Coin */
bhv_constant(oCoinUnkF4);
bhv_constant(oCoinUnkF8);
bhv_constant(oCoinBaseYVel);
bhv_constant(oCoinUnk110);
#ifndef VERSION_JP
bhv_constant(oCoinUnk1B0);
#endif

View file

@ -79,7 +79,6 @@
- [obj_behaviors.c](#obj_behaviorsc)
- [obj_behaviors_2.h](#obj_behaviors_2h)
- [object_constants.h](#object_constantsh)
- [enum CoinTypes](#enum-CoinTypes)
- [object_list_processor.h](#object_list_processorh)
- [enum ObjectList](#enum-ObjectList)
- [os_cont.h](#os_conth)
@ -2491,13 +2490,6 @@
- BOBOMB_ACT_EXPLODE
- BOBOMB_ACT_LAVA_DEATH
- BOBOMB_ACT_DEATH_PLANE_DEATH
### [enum CoinTypes](#CoinTypes)
| Identifier | Value |
| :--------- | :---- |
| COIN_TYPE_NONE | 0 |
| COIN_TYPE_YELLOW | 1 |
| COIN_TYPE_BLUE | 2 |
- HIDDEN_BLUE_COIN_ACT_INACTIVE
- HIDDEN_BLUE_COIN_ACT_WAITING
- HIDDEN_BLUE_COIN_ACT_ACTIVE

View file

@ -3024,14 +3024,14 @@ Sets the current object's hurtbox radius and height
Spawns loot coins from an object using the specified behavior, jitter, and model
### Lua Example
`obj_spawn_loot_coins(obj, numCoins, baseYVel, coinBehavior, posJitter, model)`
`obj_spawn_loot_coins(obj, numCoins, sp30, coinBehavior, posJitter, model)`
### Parameters
| Field | Type |
| ----- | ---- |
| obj | [Object](structs.md#Object) |
| numCoins | `integer` |
| baseYVel | `number` |
| sp30 | `number` |
| coinBehavior | `Pointer` <`BehaviorScript`> |
| posJitter | `integer` |
| model | `integer` |
@ -3040,7 +3040,7 @@ Spawns loot coins from an object using the specified behavior, jitter, and model
- None
### C Prototype
`void obj_spawn_loot_coins(struct Object *obj, s32 numCoins, f32 baseYVel, const BehaviorScript *coinBehavior, s16 posJitter, s16 model);`
`void obj_spawn_loot_coins(struct Object *obj, s32 numCoins, f32 sp30, const BehaviorScript *coinBehavior, s16 posJitter, s16 model);`
[:arrow_up_small:](#)
@ -3052,21 +3052,21 @@ Spawns loot coins from an object using the specified behavior, jitter, and model
Spawns blue loot coins from an object
### Lua Example
`obj_spawn_loot_blue_coins(obj, numCoins, baseYVel, posJitter)`
`obj_spawn_loot_blue_coins(obj, numCoins, sp28, posJitter)`
### Parameters
| Field | Type |
| ----- | ---- |
| obj | [Object](structs.md#Object) |
| numCoins | `integer` |
| baseYVel | `number` |
| sp28 | `number` |
| posJitter | `integer` |
### Returns
- None
### C Prototype
`void obj_spawn_loot_blue_coins(struct Object *obj, s32 numCoins, f32 baseYVel, s16 posJitter);`
`void obj_spawn_loot_blue_coins(struct Object *obj, s32 numCoins, f32 sp28, s16 posJitter);`
[:arrow_up_small:](#)
@ -3078,20 +3078,20 @@ Spawns blue loot coins from an object
Spawns yellow loot coins from an object
### Lua Example
`obj_spawn_loot_yellow_coins(obj, numCoins, baseYVel)`
`obj_spawn_loot_yellow_coins(obj, numCoins, sp28)`
### Parameters
| Field | Type |
| ----- | ---- |
| obj | [Object](structs.md#Object) |
| numCoins | `integer` |
| baseYVel | `number` |
| sp28 | `number` |
### Returns
- None
### C Prototype
`void obj_spawn_loot_yellow_coins(struct Object *obj, s32 numCoins, f32 baseYVel);`
`void obj_spawn_loot_yellow_coins(struct Object *obj, s32 numCoins, f32 sp28);`
[:arrow_up_small:](#)
@ -4459,19 +4459,19 @@ Gives the current object a hitbox and kills it if attacked, with optional loot s
Explodes the current object, spawns particles, and optionally spawns coins
### Lua Example
`obj_explode_and_spawn_coins(mistSize, coinType)`
`obj_explode_and_spawn_coins(sp18, sp1C)`
### Parameters
| Field | Type |
| ----- | ---- |
| mistSize | `number` |
| coinType | `integer` |
| sp18 | `number` |
| sp1C | `integer` |
### Returns
- None
### C Prototype
`void obj_explode_and_spawn_coins(f32 mistSize, s32 coinType);`
`void obj_explode_and_spawn_coins(f32 sp18, s32 sp1C);`
[:arrow_up_small:](#)

View file

@ -2189,7 +2189,7 @@
| oCloudFwooshMovementRadius | `integer` | |
| oCoinUnkF4 | `integer` | |
| oCoinUnkF8 | `integer` | |
| oCoinBaseYVel | `number` | |
| oCoinUnk110 | `number` | |
| oCoinUnk1B0 | `integer` | |
| oCollisionParticleUnkF4 | `number` | |
| oControllablePlatformUnkF8 | `integer` | |

View file

@ -146,13 +146,6 @@
#define BOBOMB_ACT_LAVA_DEATH 100
#define BOBOMB_ACT_DEATH_PLANE_DEATH 101
/* Coin Type */
enum CoinTypes { // coinType
COIN_TYPE_NONE,
COIN_TYPE_YELLOW,
COIN_TYPE_BLUE
};
/* Hidden Blue Coin */
/* oAction */
#define HIDDEN_BLUE_COIN_ACT_INACTIVE 0

View file

@ -398,11 +398,11 @@
#define /*0x1AC*/ oCloudFwooshMovementRadius OBJECT_FIELD_S16(0x49, 0)
/* Coin */
#define /*0x0F4*/ oCoinUnkF4 OBJECT_FIELD_S32(0x1B)
#define /*0x0F8*/ oCoinUnkF8 OBJECT_FIELD_S32(0x1C)
#define /*0x110*/ oCoinBaseYVel OBJECT_FIELD_F32(0x22)
#define /*0x0F4*/ oCoinUnkF4 OBJECT_FIELD_S32(0x1B)
#define /*0x0F8*/ oCoinUnkF8 OBJECT_FIELD_S32(0x1C)
#define /*0x110*/ oCoinUnk110 OBJECT_FIELD_F32(0x22)
#ifndef VERSION_JP
#define /*0x1B0*/ oCoinUnk1B0 OBJECT_FIELD_S32(0x4A)
#define /*0x1B0*/ oCoinUnk1B0 OBJECT_FIELD_S32(0x4A)
#endif
/* Collision Particle */

View file

@ -50,7 +50,7 @@ void bhv_temp_coin_loop(void) {
void bhv_coin_init(void) {
rng_position_init(o->oPosX, o->oPosY, o->oPosZ);
o->oVelY = random_float() * 10.0f + 30 + o->oCoinBaseYVel;
o->oVelY = random_float() * 10.0f + 30 + o->oCoinUnk110;
o->oForwardVel = random_float() * 10.0f;
o->oMoveAngleYaw = random_u16();
rng_position_finish();

View file

@ -2104,7 +2104,7 @@ void cur_obj_set_hurtbox_radius_and_height(f32 radius, f32 height) {
}
/* |description|Spawns loot coins from an object using the specified behavior, jitter, and model|descriptionEnd| */
void obj_spawn_loot_coins(struct Object *obj, s32 numCoins, f32 baseYVel, const BehaviorScript *coinBehavior, s16 posJitter, s16 model) {
void obj_spawn_loot_coins(struct Object *obj, s32 numCoins, f32 sp30, const BehaviorScript *coinBehavior, s16 posJitter, s16 model) {
if (obj == NULL) { return; }
s32 i;
f32 spawnHeight;
@ -2127,18 +2127,18 @@ void obj_spawn_loot_coins(struct Object *obj, s32 numCoins, f32 baseYVel, const
if (coin == NULL) { return; }
obj_translate_xz_random(coin, posJitter);
coin->oPosY = spawnHeight;
coin->oCoinBaseYVel = baseYVel;
coin->oCoinUnk110 = sp30;
}
}
/* |description|Spawns blue loot coins from an object|descriptionEnd| */
void obj_spawn_loot_blue_coins(struct Object *obj, s32 numCoins, f32 baseYVel, s16 posJitter) {
obj_spawn_loot_coins(obj, numCoins, baseYVel, bhvBlueCoinJumping, posJitter, MODEL_BLUE_COIN);
void obj_spawn_loot_blue_coins(struct Object *obj, s32 numCoins, f32 sp28, s16 posJitter) {
obj_spawn_loot_coins(obj, numCoins, sp28, bhvBlueCoinJumping, posJitter, MODEL_BLUE_COIN);
}
/* |description|Spawns yellow loot coins from an object|descriptionEnd| */
void obj_spawn_loot_yellow_coins(struct Object *obj, s32 numCoins, f32 baseYVel) {
obj_spawn_loot_coins(obj, numCoins, baseYVel, bhvSingleCoinGetsSpawned, 0, MODEL_YELLOW_COIN);
void obj_spawn_loot_yellow_coins(struct Object *obj, s32 numCoins, f32 sp28) {
obj_spawn_loot_coins(obj, numCoins, sp28, bhvSingleCoinGetsSpawned, 0, MODEL_YELLOW_COIN);
}
/* |description|Spawns a yellow coin at Mario's position and decrements the current object's loot count|descriptionEnd| */
@ -3169,15 +3169,15 @@ s32 cur_obj_set_hitbox_and_die_if_attacked(struct ObjectHitbox *hitbox, s32 deat
}
/* |description|Explodes the current object, spawns particles, and optionally spawns coins|descriptionEnd| */
void obj_explode_and_spawn_coins(f32 mistSize, s32 coinType) {
void obj_explode_and_spawn_coins(f32 sp18, s32 sp1C) {
if (!o) { return; }
spawn_mist_particles_variable(0, 0, mistSize);
spawn_mist_particles_variable(0, 0, sp18);
spawn_triangle_break_particles(30, 138, 3.0f, 4);
obj_mark_for_deletion(o);
if (coinType == COIN_TYPE_YELLOW) {
if (sp1C == 1) {
obj_spawn_loot_yellow_coins(o, o->oNumLootCoins, 20.0f);
} else if (coinType == COIN_TYPE_BLUE) {
} else if (sp1C == 2) {
obj_spawn_loot_blue_coins(o, o->oNumLootCoins, 20.0f, 150);
}
}

View file

@ -1802,7 +1802,7 @@ static struct LuaObjectField sObjectFields[LUA_OBJECT_FIELD_COUNT] = {
{ "oCloudCenterY", LVT_F32, offsetof(struct Object, oCloudCenterY), false, LOT_NONE },
{ "oCloudFwooshMovementRadius", LVT_S16, offsetof(struct Object, oCloudFwooshMovementRadius), false, LOT_NONE },
{ "oCloudGrowSpeed", LVT_F32, offsetof(struct Object, oCloudGrowSpeed), false, LOT_NONE },
{ "oCoinBaseYVel", LVT_F32, offsetof(struct Object, oCoinBaseYVel), false, LOT_NONE },
{ "oCoinUnk110", LVT_F32, offsetof(struct Object, oCoinUnk110), false, LOT_NONE },
#ifndef VERSION_JP
{ "oCoinUnk1B0", LVT_S32, offsetof(struct Object, oCoinUnk1B0), false, LOT_NONE },
#endif

View file

@ -2505,9 +2505,6 @@ const char gSmluaConstants[] = ""
"BOBOMB_ACT_EXPLODE=3\n"
"BOBOMB_ACT_LAVA_DEATH=100\n"
"BOBOMB_ACT_DEATH_PLANE_DEATH=101\n"
"COIN_TYPE_NONE=0\n"
"COIN_TYPE_YELLOW=1\n"
"COIN_TYPE_BLUE=2\n"
"HIDDEN_BLUE_COIN_ACT_INACTIVE=0\n"
"HIDDEN_BLUE_COIN_ACT_WAITING=1\n"
"HIDDEN_BLUE_COIN_ACT_ACTIVE=2\n"

View file

@ -28010,7 +28010,7 @@ int smlua_func_obj_spawn_loot_coins(lua_State* L) {
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "obj_spawn_loot_coins"); return 0; }
s32 numCoins = smlua_to_integer(L, 2);
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "obj_spawn_loot_coins"); return 0; }
f32 baseYVel = smlua_to_number(L, 3);
f32 sp30 = smlua_to_number(L, 3);
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "obj_spawn_loot_coins"); return 0; }
BehaviorScript * coinBehavior = (BehaviorScript *)smlua_to_cpointer(L, 4, LVT_BEHAVIORSCRIPT_P);
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 4, "obj_spawn_loot_coins"); return 0; }
@ -28019,8 +28019,8 @@ int smlua_func_obj_spawn_loot_coins(lua_State* L) {
s16 model = smlua_to_integer(L, 6);
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 6, "obj_spawn_loot_coins"); return 0; }
extern void obj_spawn_loot_coins(struct Object *obj, s32 numCoins, f32 baseYVel, const BehaviorScript *coinBehavior, s16 posJitter, s16 model);
obj_spawn_loot_coins(obj, numCoins, baseYVel, coinBehavior, posJitter, model);
extern void obj_spawn_loot_coins(struct Object *obj, s32 numCoins, f32 sp30, const BehaviorScript *coinBehavior, s16 posJitter, s16 model);
obj_spawn_loot_coins(obj, numCoins, sp30, coinBehavior, posJitter, model);
return 1;
}
@ -28038,13 +28038,13 @@ int smlua_func_obj_spawn_loot_blue_coins(lua_State* L) {
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "obj_spawn_loot_blue_coins"); return 0; }
s32 numCoins = smlua_to_integer(L, 2);
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "obj_spawn_loot_blue_coins"); return 0; }
f32 baseYVel = smlua_to_number(L, 3);
f32 sp28 = smlua_to_number(L, 3);
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "obj_spawn_loot_blue_coins"); return 0; }
s16 posJitter = smlua_to_integer(L, 4);
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 4, "obj_spawn_loot_blue_coins"); return 0; }
extern void obj_spawn_loot_blue_coins(struct Object *obj, s32 numCoins, f32 baseYVel, s16 posJitter);
obj_spawn_loot_blue_coins(obj, numCoins, baseYVel, posJitter);
extern void obj_spawn_loot_blue_coins(struct Object *obj, s32 numCoins, f32 sp28, s16 posJitter);
obj_spawn_loot_blue_coins(obj, numCoins, sp28, posJitter);
return 1;
}
@ -28062,11 +28062,11 @@ int smlua_func_obj_spawn_loot_yellow_coins(lua_State* L) {
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "obj_spawn_loot_yellow_coins"); return 0; }
s32 numCoins = smlua_to_integer(L, 2);
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "obj_spawn_loot_yellow_coins"); return 0; }
f32 baseYVel = smlua_to_number(L, 3);
f32 sp28 = smlua_to_number(L, 3);
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "obj_spawn_loot_yellow_coins"); return 0; }
extern void obj_spawn_loot_yellow_coins(struct Object *obj, s32 numCoins, f32 baseYVel);
obj_spawn_loot_yellow_coins(obj, numCoins, baseYVel);
extern void obj_spawn_loot_yellow_coins(struct Object *obj, s32 numCoins, f32 sp28);
obj_spawn_loot_yellow_coins(obj, numCoins, sp28);
return 1;
}
@ -29162,13 +29162,13 @@ int smlua_func_obj_explode_and_spawn_coins(lua_State* L) {
return 0;
}
f32 mistSize = smlua_to_number(L, 1);
f32 sp18 = smlua_to_number(L, 1);
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "obj_explode_and_spawn_coins"); return 0; }
s32 coinType = smlua_to_integer(L, 2);
s32 sp1C = smlua_to_integer(L, 2);
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "obj_explode_and_spawn_coins"); return 0; }
extern void obj_explode_and_spawn_coins(f32 mistSize, s32 coinType);
obj_explode_and_spawn_coins(mistSize, coinType);
extern void obj_explode_and_spawn_coins(f32 sp18, s32 sp1C);
obj_explode_and_spawn_coins(sp18, sp1C);
return 1;
}