[Fix} Small Crowd Control fixes (#2061)

This commit is contained in:
aMannus 2022-12-06 06:28:50 +01:00 committed by GitHub
parent 1a9898b918
commit d3bfc102fe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 2 deletions

View File

@ -458,7 +458,7 @@ CrowdControl::EffectResult CrowdControl::ExecuteEffect(std::string effectId, uin
if (dryRun == 0) CMD_EXECUTE(fmt::format("defense_modifier {}", value));
return EffectResult::Success;
} else if (effectId == EFFECT_DAMAGE) {
if ((gSaveContext.healthCapacity - 0x10) <= 0) {
if ((gSaveContext.health - (16 * value)) <= 0) {
return EffectResult::Failure;
}
@ -482,6 +482,14 @@ bool CrowdControl::SpawnEnemy(std::string effectId) {
if (effectId == EFFECT_SPAWN_WALLMASTER) {
enemyId = 17;
} else if (effectId == EFFECT_SPAWN_ARWING) {
// Don't allow Arwings in certain areas because they cause issues.
// Locations: King dodongo room, Morpha room, Twinrova room, Ganondorf room, Fishing pond, Ganon's room
// TODO: Swap this to disabling the option in CC options menu instead.
if (gPlayState->sceneNum == SCENE_DDAN_BOSS || gPlayState->sceneNum == SCENE_MIZUSIN_BS ||
gPlayState->sceneNum == SCENE_JYASINBOSS || gPlayState->sceneNum == SCENE_GANON_BOSS ||
gPlayState->sceneNum == SCENE_TURIBORI || gPlayState->sceneNum == SCENE_GANON_DEMO) {
return 0;
}
enemyId = 315;
enemyParams = 1;
posYOffset = 100;

View File

@ -1631,7 +1631,7 @@ namespace GameMenuBar {
ImGui::PopStyleColor(1);
#ifdef ENABLE_CROWD_CONTROL
UIWidgets::PaddedEnhancementCheckbox("Crowd Control", "gCrowdControl", true, false);
UIWidgets::Tooltip("Requires a full SoH restart to take effect!\n\nEnables CrowdControl. Will attempt to connect to the local Crowd Control server.");
UIWidgets::Tooltip("Will attempt to connect to the Crowd Control server. Check out crowdcontrol.live for more information.");
if (CVar_GetS32("gCrowdControl", 0)) {
CrowdControl::Instance->Enable();