From e6ef25b701c445e7fa360b5db77f5d48f0b3d5e3 Mon Sep 17 00:00:00 2001 From: Sheila Aman Date: Tue, 8 Jun 2021 15:46:51 -0500 Subject: [PATCH] Ensure innates are available for Waddle Rebalance. --- src/exdeath.cc | 24 ++++++++++++++++-------- src/exdeath.hh | 1 + src/randodata.hh | 4 ++++ 3 files changed, 21 insertions(+), 8 deletions(-) diff --git a/src/exdeath.cc b/src/exdeath.cc index 58012ed..0155276 100644 --- a/src/exdeath.cc +++ b/src/exdeath.cc @@ -222,6 +222,7 @@ void Exdeath::initConfig(void) { chkPortraits->setChecked(_cfg->value("main/portraits", false).toBool()); chkSound->setChecked(_cfg->value("main/sound_restore", false).toBool()); + innates_enabled = _cfg->value("innate/enabled", true).toBool(); chkPassages->setChecked(_cfg->value("innate/passages", false).toBool()); chkPitfalls->setChecked(_cfg->value("innate/pitfalls", false).toBool()); chkLiteStep->setChecked(_cfg->value("innate/litestep", false).toBool()); @@ -236,14 +237,26 @@ void Exdeath::initConfig(void) { void Exdeath::selMode_index(int idx) { bool random_ok = false; bool unlock_ok = false; + bool innate_ok = false; + if (idx < 2) { unlock_ok = true; + innate_ok = true; } if (idx == 0) { random_ok = true; } + chkRandom->setEnabled(random_ok); + chkUnlock->setEnabled(unlock_ok); + + chkPassages->setEnabled(innate_ok); + chkPitfalls->setEnabled(innate_ok); + chkLiteStep->setEnabled(innate_ok); + chkDash->setEnabled(innate_ok); + chkLearning->setEnabled(innate_ok); + innates_enabled = innate_ok; } void Exdeath::btnSave_clicked(bool trigger) { @@ -254,6 +267,7 @@ void Exdeath::btnSave_clicked(bool trigger) { _cfg->setValue("main/portraits", chkPortraits->isChecked()); _cfg->setValue("main/sound_restore", chkSound->isChecked()); + _cfg->setValue("innate/enabled", innates_enabled); _cfg->setValue("innate/passages", chkPassages->isChecked()); _cfg->setValue("innate/pitfalls", chkPitfalls->isChecked()); _cfg->setValue("innate/litestep", chkLiteStep->isChecked()); @@ -319,7 +333,7 @@ void Exdeath::btnApply_clicked(bool trigger) { if (idx == 0) { idx = dist(rand); } - if ((idx == 1) && ((mode > 2) && (mode < 5))) { + if ((idx == 1) && (mode > 1)) { error->showMessage("You can't set a custom NED with this mode; it'll break."); return; } @@ -358,7 +372,7 @@ void Exdeath::btnApply_clicked(bool trigger) { } } - bool global_innates = (chkPassages->isChecked() || chkPitfalls->isChecked() || chkLiteStep->isChecked() || chkDash->isChecked() || chkLearning->isChecked()); + bool global_innates = innates_enabled && (chkPassages->isChecked() || chkPitfalls->isChecked() || chkLiteStep->isChecked() || chkDash->isChecked() || chkLearning->isChecked()); if (chkRandom->isChecked() && chkRandom->isEnabled()) { Randomizer *rando = new Randomizer(rand); QFile *pfile = new QFile(output + ".ips"); @@ -414,12 +428,6 @@ void Exdeath::applyPatch(QFile *file, QIODevice *data) { } void Exdeath::applyInnates(QFile *file) { unsigned char base = 0; - int mode = selMode->currentIndex(); - - if (mode > 1) { - error->showMessage("You must use Base or Unlocked Jobs to use these options."); - return; - } if (chkPassages->isChecked()) base |= Job::Passages; if (chkPitfalls->isChecked()) base |= Job::Pitfalls; diff --git a/src/exdeath.hh b/src/exdeath.hh index 2bd0b61..d84ca0a 100644 --- a/src/exdeath.hh +++ b/src/exdeath.hh @@ -73,6 +73,7 @@ private: QCheckBox *chkLiteStep; QCheckBox *chkDash; QCheckBox *chkLearning; + bool innates_enabled; // Multipliers QGroupBox *grpMulti; diff --git a/src/randodata.hh b/src/randodata.hh index 8b8f183..c6c8380 100644 --- a/src/randodata.hh +++ b/src/randodata.hh @@ -1,5 +1,7 @@ #pragma once +#include + enum Skill { // Action skills Guard = 0x06, @@ -117,3 +119,5 @@ const int tier3_jobs[] = {0, 3, 4, 5, 7, 8, 15}; const int job_tier[] = { 3, 2, 2, 3, 3, 3, 0, 3, 3, 1, 1, 1, 1, 2, 2, 2, 1, 1, 1, 2 }; + +extern const QMap *JobsList;