Skip to content

Commit

Permalink
Merge pull request #46 from Futuremappermydud/master
Browse files Browse the repository at this point in the history
ReBeat Support
  • Loading branch information
NSGolova authored Sep 5, 2024
2 parents b9b112a + 258cf4d commit 50ba4af
Showing 1 changed file with 27 additions and 2 deletions.
29 changes: 27 additions & 2 deletions src/Enhancers/MapEnhancer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
#include "GlobalNamespace/BeatmapCharacteristicSO.hpp"
#include "GlobalNamespace/BeatmapLevel.hpp"

#include "conditional-dependencies/shared/main.hpp"

#include <regex>
#include <sstream>

Expand Down Expand Up @@ -31,11 +33,28 @@ void MapEnhancer::Enhance(Replay &replay)
vector<string> MapEnhancer::Modifiers() const {
vector<string> result;

static auto reBeatEnabledFunc = CondDeps::Find<bool>("rebeat", "GetEnabled");
static auto reBeatSameColorFunc = CondDeps::Find<bool>("rebeat", "GetSameColor");
static auto reBeatEasyFunc = CondDeps::Find<bool>("rebeat", "GetEasyMode");
static auto reBeatOneHpFunc = CondDeps::Find<bool>("rebeat", "GetOneHP");

bool reBeatEnabled = reBeatEnabledFunc.has_value() && reBeatEnabledFunc.value()();
bool reBeatSameColor = reBeatSameColorFunc.has_value() && reBeatSameColorFunc.value()();
bool reBeatEasy = reBeatEasyFunc.has_value() && reBeatEasyFunc.value()();
bool reBeatOneHp = reBeatOneHpFunc.has_value() && reBeatOneHpFunc.value();

if (gameplayModifiers->disappearingArrows) { result.emplace_back("DA"); }
if (gameplayModifiers->songSpeed == GameplayModifiers::SongSpeed::Faster) { result.emplace_back("FS"); }
if (gameplayModifiers->songSpeed == GameplayModifiers::SongSpeed::Slower) { result.emplace_back("SS"); }
if (gameplayModifiers->songSpeed == GameplayModifiers::SongSpeed::SuperFast) { result.emplace_back("SF"); }
if (gameplayModifiers->ghostNotes) { result.emplace_back("GN"); }
if (reBeatEnabled) {
static auto reBeatHiddenFunc = CondDeps::Find<bool>("rebeat", "GetHidden");
if (reBeatHiddenFunc.has_value() && reBeatHiddenFunc.value()()) {
result.emplace_back("HD");
}
} else if (gameplayModifiers->ghostNotes) {
result.emplace_back("GN");
}
if (gameplayModifiers->noArrows) { result.emplace_back("NA"); }
if (gameplayModifiers->noBombs) { result.emplace_back("NB"); }
if (gameplayModifiers->noFailOn0Energy && energy == 0) { result.emplace_back("NF"); }
Expand All @@ -45,7 +64,13 @@ vector<string> MapEnhancer::Modifiers() const {
if (gameplayModifiers->smallCubes) { result.emplace_back("SC"); }
if (gameplayModifiers->failOnSaberClash) { result.emplace_back("CS"); }
if (gameplayModifiers->instaFail) { result.emplace_back("IF"); }
if (gameplayModifiers->energyType == GameplayModifiers::EnergyType::Battery) { result.emplace_back("BE"); }
if (gameplayModifiers->energyType == GameplayModifiers::EnergyType::Battery && !reBeatEnabled) { result.emplace_back("BE"); }

// ReBeat Modifier Support

if (reBeatEnabled && reBeatSameColor) { result.emplace_back("SMC"); }
if (reBeatEnabled && reBeatEasy) { result.emplace_back("EZ"); }
if (reBeatEnabled && reBeatOneHp) { result.emplace_back("OHP"); }

return result;
}
Expand Down

0 comments on commit 50ba4af

Please sign in to comment.