Merge branch 'unstable' of github.com:sm64ex-coop-dev/sm64ex-coop into unstable

This commit is contained in:
MysterD 2022-03-19 00:59:06 -07:00
commit db1c2dd758
6 changed files with 94 additions and 36 deletions

View file

@ -1045,6 +1045,12 @@ endif
#all: $(ROM) #all: $(ROM)
all: $(EXE) all: $(EXE)
ifeq ($(WINDOWS_BUILD),1)
exemap: $(EXE)
$(V)$(OBJDUMP) -t $(EXE) > $(BUILD_DIR)/coop.map
all: exemap
endif
ifeq ($(COMPARE),1) ifeq ($(COMPARE),1)
@$(PRINT) "$(GREEN)Checking if ROM matches.. $(NO_COL)\n" @$(PRINT) "$(GREEN)Checking if ROM matches.. $(NO_COL)\n"
@$(SHA1SUM) --quiet -c $(TARGET).sha1 && $(PRINT) "$(TARGET): $(GREEN)OK$(NO_COL)\n" || ($(PRINT) "$(YELLOW)Building the ROM file has succeeded, but does not match the original ROM.\nThis is expected, and not an error, if you are making modifications.\nTo silence this message, use 'make COMPARE=0.' $(NO_COL)\n" && false) @$(SHA1SUM) --quiet -c $(TARGET).sha1 && $(PRINT) "$(TARGET): $(GREEN)OK$(NO_COL)\n" || ($(PRINT) "$(YELLOW)Building the ROM file has succeeded, but does not match the original ROM.\nThis is expected, and not an error, if you are making modifications.\nTo silence this message, use 'make COMPARE=0.' $(NO_COL)\n" && false)

View file

@ -0,0 +1,12 @@
-- name: Instant Clip
-- description: Press L trigger, profit!
function mario_update(m)
if (m.controller.buttonDown & L_TRIG) ~= 0 then -- If L pressed
set_mario_action(m, ACT_WALKING, 0) --set mario to walking so his vel is used
m.forwardVel = 400 --set Velocity to clip speed
end
end
-- hooks --
hook_event(HOOK_MARIO_UPDATE, mario_update)

View file

@ -0,0 +1,10 @@
-- name: MoonJump
-- description: Hold the A button to Moonjump
function mario_update(m)
if (m.controller.buttonDown & A_BUTTON) ~= 0 then --If the A button is pressed
m.vel.y = 25 --Set Y velocity to 25
end
end
-- hooks --
hook_event(HOOK_MARIO_UPDATE, mario_update)

View file

@ -41,13 +41,10 @@ All of this is a holdover from when there were only two players. It was a reason
<br /> <br />
## Example Lua mods ## Example Lua mods (small)
- [Extended Moveset](../../mods/extended-moveset.lua)
- [Character Movesets](../../mods/character-movesets.lua)
- [Low Gravity](../../mods/low-gravity.lua) - [Low Gravity](../../mods/low-gravity.lua)
- [Faster Swimming](../../mods/faster-swimming.lua) - [Faster Swimming](../../mods/faster-swimming.lua)
- [Hide and Seek Gamemode](../../mods/hide-and-seek.lua) - [Mario Run](../../mods/Mario-Run.lua)
- [Football (soccer) Gamemode](../../mods/football.lua)
- [HUD Rendering](examples/hud.lua) - [HUD Rendering](examples/hud.lua)
- [Object Spawning](examples/spawn-stuff.lua) - [Object Spawning](examples/spawn-stuff.lua)
- [Custom Ball Behavior](examples/behavior-ball.lua) - [Custom Ball Behavior](examples/behavior-ball.lua)
@ -56,3 +53,11 @@ All of this is a holdover from when there were only two players. It was a reason
- [Behavior with Surface Collisions](examples/behavior-surface-collisions.lua) - [Behavior with Surface Collisions](examples/behavior-surface-collisions.lua)
- [Custom Box Model](examples/custom-box-model) - [Custom Box Model](examples/custom-box-model)
- [Custom Player Model](examples/koopa-player-model) - [Custom Player Model](examples/koopa-player-model)
- [Moonjump](examples/Moonjump.lua)
- [Instant Clip](examples/Instant_Clip.lua)
## Example Lua mods (large)
- [Extended Moveset](../../mods/extended-moveset.lua)
- [Character Movesets](../../mods/character-movesets.lua)
- [Hide and Seek Gamemode](../../mods/hide-and-seek.lua)
- [Football (soccer) Gamemode](../../mods/football.lua)

24
mods/Mario-Run.lua Normal file
View file

@ -0,0 +1,24 @@
-- name: Mario RUN!
-- description: Mario Is contantly runing
Threshold = 50 --set Threshold to 50
function mario_update(m)
--Prevent mario from ideling
if m.action == ACT_IDLE then --If idle
set_mario_action(m, ACT_WALKING, 0) --Make Mario walk
end
--Crouching doesnt apply vel so prevent that
if m.action == ACT_CROUCHING then --If crouching
set_mario_action(m, ACT_WALKING, 0) --Make Mario walk
end
--Speed floor
if (m.forwardVel > 0-Threshold) and (m.forwardVel < Threshold) then --If Mario isn't moveing fast enough
m.forwardVel = Threshold --set forwards velocity to whatevet the threashold is set to
end
end
-- hooks --
hook_event(HOOK_MARIO_UPDATE, mario_update)

View file

@ -19,42 +19,43 @@ void bhv_treasure_chest_top_loop(void) {
struct Object* sp34 = o->parentObj->parentObj; struct Object* sp34 = o->parentObj->parentObj;
switch (o->oAction) { switch (o->oAction) {
case 0: case 0:
if (o->parentObj->oAction == 1) if (o->parentObj->oAction == 1) {
o->oAction = 1; o->oAction = 1;
break;
case 1:
if (o->oTimer == 0) {
if (sp34->oTreasureChestUnkFC == 0) {
spawn_object_relative(0, 0, -80, 120, o, MODEL_BUBBLE, bhvWaterAirBubble);
play_sound(SOUND_GENERAL_CLAM_SHELL1, o->header.gfx.cameraToObject);
} }
else { break;
play_sound(SOUND_GENERAL_OPEN_CHEST, o->header.gfx.cameraToObject);
case 1:
if (o->oTimer == 0) {
if (sp34->oTreasureChestUnkFC == 0) {
spawn_object_relative(0, 0, -80, 120, o, MODEL_BUBBLE, bhvWaterAirBubble);
play_sound(SOUND_GENERAL_CLAM_SHELL1, o->header.gfx.cameraToObject);
} else {
play_sound(SOUND_GENERAL_OPEN_CHEST, o->header.gfx.cameraToObject);
}
} }
}
o->oFaceAnglePitch += -0x200; o->oFaceAnglePitch += -0x200;
if (o->oFaceAnglePitch < -0x4000) { if (o->oFaceAnglePitch < -0x4000) {
o->oFaceAnglePitch = -0x4000; o->oFaceAnglePitch = -0x4000;
o->oAction++; o->oAction++;
if (o->parentObj->oBehParams2ndByte != 4) if (o->parentObj->oBehParams2ndByte != 4)
spawn_orange_number(o->parentObj->oBehParams2ndByte, 0, -40, 0); spawn_orange_number(o->parentObj->oBehParams2ndByte, 0, -40, 0);
} }
break; break;
case 2: case 2:
if (o->parentObj->oAction == 0) if (o->parentObj->oAction == 0) {
o->oAction = 3; o->oAction = 3;
break; }
break;
case 3: case 3:
o->oFaceAnglePitch += 0x800; o->oFaceAnglePitch += 0x800;
if (o->oFaceAnglePitch > 0) { if (o->oFaceAnglePitch > 0) {
o->oFaceAnglePitch = 0; o->oFaceAnglePitch = 0;
o->oAction = 0; o->oAction = 0;
} }
} }
} }