Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
b944f0b
loadless timer + segment timer stuff
eddynya Oct 19, 2023
03b8941
fixing segment timer after resetting
eddynya Oct 31, 2023
60848bd
somewhat fixed some issues with the timer missing frames
eddynya Oct 31, 2023
835c8d8
fixed the missing frames issue (kinda jank fix) for the loadless timer
eddynya Nov 5, 2023
bd51ae1
fixed segments not showing up when run ends
eddynya Nov 5, 2023
f9cfe63
added a story death counter
eddynya Nov 5, 2023
c78143f
fixed timer/death counter spacing + timer not on warning
eddynya Nov 6, 2023
d7ceef5
some code cleanup
eddynya Nov 7, 2023
94d1fe8
unified timer code, fixed spacing on old timers
eddynya Nov 7, 2023
261494c
make the loadless timer count during timeover
eddynya Nov 7, 2023
688050f
cut out parts of the timer
eddynya Nov 9, 2023
b14c1c4
adjusted timer + fixed death counter bug
eddynya Nov 10, 2023
e7f7c67
some cleanup
eddynya Nov 11, 2023
e8623d9
small fixes before tackling bigger issues
eddynya Nov 12, 2023
3286dfa
Delete storytimer.cppZone.Identifier
eddynya Nov 12, 2023
475cffe
small changes
eddynya Nov 13, 2023
eea3249
Merge branch 'master' of https://github.com/rehtropsmb/SMB2PracticeMod
Nov 14, 2023
80636e4
Merge branch 'master' of github.com:ComplexPlane/SMB2PracticeMod
Nov 14, 2023
2f1d3c7
updated names to match new ghidra header
eddynya Nov 14, 2023
4a69bcd
starting to rewrite segment timer code
eddynya Nov 14, 2023
19d253c
another approach
eddynya Nov 14, 2023
eca1c36
fixed some issues with the rewrite
eddynya Nov 15, 2023
b5eeeff
pre cleanup backup
Nov 16, 2023
cb66e06
clean up arc 2 part 1
eddynya Nov 16, 2023
9a38703
added count deaths on stage 1 toggle to deathcounter
eddynya Nov 18, 2023
290410a
optimized memory used by timer
eddynya Nov 18, 2023
066e8d0
pre merge commit
Nov 21, 2023
00df2a7
Update pref.cpp
eddynya Nov 21, 2023
01d4c8a
Merge branch 'master' of github.com:ComplexPlane/SMB2PracticeMod
eddynya Nov 22, 2023
e2f6eaa
fixed deathcounter bug
eddynya Nov 22, 2023
4cda08a
started addressing storytimer comments
eddynya Nov 22, 2023
9170ba3
small changes before bigger changes
eddynya Nov 28, 2023
a788754
backup before fixing bugs
eddynya Dec 23, 2023
47d96c1
removed unnecessary static variables in the TimerGroup struct
eddynya Dec 23, 2023
e192874
simplified code for the number of completed stages
eddynya Dec 23, 2023
bf4555a
removed the s_completed_stages_world array
eddynya Dec 23, 2023
91e4558
Delete storytimer.cppZone.Identifier
eddynya Dec 23, 2023
7b0cb90
removed unused variables
eddynya Dec 23, 2023
fd65cb3
rewrote end of run segment timer code using mkb::sprintf
eddynya Dec 28, 2023
6493439
fixed some end of run segment formatting
eddynya Dec 28, 2023
3f13d8b
fixed the w1 not showing issue
eddynya Dec 28, 2023
4e4ab77
improved code for stopping the segment timer
eddynya Dec 28, 2023
edb2f4c
clean up
eddynya Dec 29, 2023
7648a30
reverted draw_timer function to only draw one timer
eddynya Jan 1, 2024
058e037
debugging stuff
eddynya Jan 1, 2024
1f4a237
removed debugging variables/cleanup
eddynya Jan 1, 2024
f694f0e
Merge branch 'ComplexPlane:master' into master
eddynya Jan 8, 2024
9968535
update scripts
rehtropsmb Jan 8, 2024
941f805
minor things
eddynya Jan 25, 2024
67b8c3d
Merge branch 'master' of https://github.com/eddynya/SMB2PracticeMod
eddynya Jan 25, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/mods/cmseg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ void disp() {
color = draw::GOLD;
else
color = draw::WHITE;
timerdisp::draw_timer(static_cast<s32>(s_seg_time), "SEG:", 0, color, false);
timerdisp::draw_timer(380, 0, 44, "SEG:", static_cast<s32>(s_seg_time), false, draw::WHITE);
}
}

Expand Down
63 changes: 63 additions & 0 deletions src/mods/deathcounter.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
#include "mods/deathcounter.h"

#include "mkb/mkb.h"

#include "mods/freecam.h"
#include "mods/storytimer.h"
#include "mods/validate.h"
#include "systems/assembly.h"
#include "systems/pad.h"
#include "systems/pref.h"
#include "utils/draw.h"
#include "utils/patch.h"
#include "utils/timerdisp.h"

namespace deathcounter {

static bool s_can_die;
static u32 s_death_count;

void tick() {
// set the death count to 0 on the file select screen
if (mkb::scen_info.mode == 5) {
s_death_count = 0;
s_can_die = false;
}

// Don't increment the death counter on stage 1 if the setting is ticked
if (mkb::sub_mode == mkb::SMD_GAME_PLAY_MAIN && !validate::has_entered_goal()) {
if (pref::get(pref::BoolPref::CountFirstStageDeaths)) {
s_can_die = true;
} else if (!pref::get(pref::BoolPref::CountFirstStageDeaths) &&
storytimer::get_completed_stagecount() != 0) {
s_can_die = true;
}
} else if (validate::has_entered_goal()) {
s_can_die = false;
}

if (s_can_die &&
(mkb::sub_mode == mkb::SMD_GAME_READY_INIT || mkb::sub_mode == mkb::SMD_GAME_RINGOUT_INIT ||
mkb::sub_mode == mkb::SMD_GAME_TIMEOVER_INIT ||
mkb::sub_mode == mkb::SMD_GAME_SCENARIO_RETURN ||
mkb::sub_mode == mkb::SMD_GAME_INTR_SEL_INIT)) {
// you can die either by retrying after dropping in, falling out, timing over, stage
// selecting after dropping in (but before breaking the tape), or exiting game after
// dropping in (but before breaking the tape)
s_death_count += 1;
s_can_die = false; // once the death counter is incremented, set this to false so we only
// increment it by 1
}
}

void disp() {
if ((mkb::main_game_mode != mkb::STORY_MODE && mkb::sub_mode != mkb::SMD_AUTHOR_PLAY_INIT &&
mkb::sub_mode != mkb::SMD_AUTHOR_PLAY_MAIN) ||
freecam::should_hide_hud() || !pref::get(pref::BoolPref::ShowDeathCounter)) {
return;
}
draw::debug_text(18, 56, draw::WHITE, "Deaths: ");
draw::debug_text(98, 56, draw::WHITE, "%d", s_death_count);
}

} // namespace deathcounter
8 changes: 8 additions & 0 deletions src/mods/deathcounter.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#pragma once

namespace deathcounter {

void tick();
void disp();

} // namespace deathcounter
3 changes: 1 addition & 2 deletions src/mods/iw.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,6 @@ void disp() {
mkb::main_game_mode != mkb::STORY_MODE || !main::currently_playing_iw ||
freecam::should_hide_hud())
return;
timerdisp::draw_timer(static_cast<s32>(s_iw_time), "IW:", 0, draw::WHITE, false);
timerdisp::draw_timer(392, 0, 32, "IW:", static_cast<s32>(s_iw_time), false, draw::WHITE);
}

} // namespace iw
Loading