perf: 肉鸽投资模式进入第二层拓展为投资模式启用购物、招募 (#8620)

perf: 肉鸽投资模式`进入第二层`拓展为`投资模式启用购物、招募`
This commit is contained in:
status102
2024-03-23 14:33:00 +08:00
committed by GitHub
12 changed files with 37 additions and 20 deletions

View File

@@ -144,14 +144,24 @@ bool asst::RoguelikeTask::set_params(const json::value& params)
if (mode == RoguelikeMode::Investment) {
m_debug_plugin_ptr->set_enable(false);
// 战斗后奖励只拿钱
Task.set_task_base(theme + "@Roguelike@DropsFlag", theme + "@Roguelike@DropsFlag_mode1");
bool investment_with_more_score = params.get("investment_with_more_score", false);
if (!params.contains("investment_with_more_score") && params.contains("investment_enter_second_floor")) {
investment_with_more_score = params.get("investment_enter_second_floor", true);
Log.warn("================ DEPRECATED ================");
Log.warn("`investment_enter_second_floor` has been deprecated since v5.2.1; Please use 'investment_with_more_score'");
Log.warn("================ DEPRECATED ================");
}
m_roguelike_config_ptr->set_invest_with_more_score(investment_with_more_score);
// 刷源石锭模式是否进入第二层
if (params.get("investment_enter_second_floor", true)) {
if (investment_with_more_score) {
// 战斗后奖励默认
Task.set_task_base(theme + "@Roguelike@DropsFlag", theme + "@Roguelike@DropsFlag_default");
m_roguelike_task_ptr->set_times_limit("StageTraderInvestCancel", INT_MAX);
m_roguelike_task_ptr->set_times_limit("StageTraderLeaveConfirm", 0, ProcessTask::TimesLimitType::Post);
}
else {
// 战斗后奖励只拿钱
Task.set_task_base(theme + "@Roguelike@DropsFlag", theme + "@Roguelike@DropsFlag_mode1");
m_roguelike_task_ptr->set_times_limit("StageTraderInvestCancel", 0);
m_roguelike_task_ptr->set_times_limit("StageTraderLeaveConfirm", INT_MAX);
}

View File

@@ -67,6 +67,8 @@ namespace asst
int get_invest_maximum() const { return m_invest_maximum; }
void set_invest_stop_when_full(bool value) { m_invest_stop_when_full = value; }
bool get_invest_stop_when_full() const { return m_invest_stop_when_full; }
void set_invest_with_more_score(bool value) { m_invest_with_more_score = value; }
bool get_invest_with_more_score() const { return m_invest_with_more_score; }
private:
std::string m_theme; // 主题
@@ -80,6 +82,7 @@ namespace asst
std::vector<std::string> m_start_foldartal_list; // 需要凹的板子
int m_invest_maximum = 0; // 投资次数上限
bool m_invest_stop_when_full = false; // 存款满了就停止
bool m_invest_with_more_score = false; // 投资时招募、购物刷分
/* 以下为每次重置 */
public:

View File

@@ -22,7 +22,7 @@ bool asst::RoguelikeShoppingTaskPlugin::verify(AsstMsg msg, const json::value& d
}
if (details.get("details", "task", "").ends_with("Roguelike@TraderRandomShopping")) {
return m_config->get_mode() != RoguelikeMode::Investment;
return m_config->get_mode() != RoguelikeMode::Investment || m_config->get_invest_with_more_score();
}
else {
return false;

View File

@@ -2045,7 +2045,7 @@ namespace MaaWpfGui.Main
/// </param>
/// <param name="starts">开始探索次数。</param>
/// <param name="investmentEnabled">是否投资源石锭</param>
/// <param name="investmentEnterSecondFloor">是否进入第二层</param>
/// <param name="investmentWithMoreScore">投资时候刷更多分</param>
/// <param name="invests">投资源石锭次数。</param>
/// <param name="stopWhenFull">投资满了自动停止任务。</param>
/// <param name="squad"><paramref name="squad"/> TODO.</param>
@@ -2062,7 +2062,7 @@ namespace MaaWpfGui.Main
/// <param name="theme">肉鸽主题["Phantom", "Mizuki", "Sami"]</param>
/// <param name="refreshTraderWithDice">是否用骰子刷新商店购买特殊商品,目前支持水月肉鸽的指路鳞</param>
/// <returns>是否成功。</returns>
public bool AsstAppendRoguelike(int mode, int starts, bool investmentEnabled, bool investmentEnterSecondFloor, int invests, bool stopWhenFull,
public bool AsstAppendRoguelike(int mode, int starts, bool investmentEnabled, bool investmentWithMoreScore, int invests, bool stopWhenFull,
string squad, string roles, string coreChar, bool startWithEliteTwo, bool onlyStartWithEliteTwo, bool roguelike3FirstFloorFoldartal,
string roguelike3StartFloorFoldartal, bool roguelike3NewSquad2StartingFoldartal, string roguelike3NewSquad2StartingFoldartals,
bool useSupport, bool enableNonFriendSupport, string theme, bool refreshTraderWithDice)
@@ -2078,7 +2078,7 @@ namespace MaaWpfGui.Main
if (mode == 1 || investmentEnabled)
{
taskParams["investment_enabled"] = true;
taskParams["investment_enter_second_floor"] = investmentEnterSecondFloor;
taskParams["investment_with_more_score"] = investmentWithMoreScore;
taskParams["investments_count"] = invests;
taskParams["stop_when_investment_full"] = stopWhenFull;
}

View File

@@ -261,7 +261,7 @@
<system:String x:Key="GoldTimesLimit">Stops after investing N times</system:String>
<system:String x:Key="StopOnGoldLimit">Stops when invested coins reach limit</system:String>
<system:String x:Key="InvestmentEnabled">Invest coins</system:String>
<system:String x:Key="InvestmentEnterSecondFloor">Enter 2nd floor after investing</system:String>
<system:String x:Key="InvestmentWithMoreScore">Investment mode enables shopping, recruiting</system:String>
<system:String x:Key="RefreshTraderWithDice">Refresh Rogue Trader with Dice</system:String>
<system:String x:Key="PenguinId">Penguin Report ID (Number part only)</system:String>
<system:String x:Key="EnablePenguin">Report Penguin</system:String>

View File

@@ -261,7 +261,7 @@
<system:String x:Key="GoldTimesLimit">N回投資した後に停止する</system:String>
<system:String x:Key="StopOnGoldLimit">源石錐が上限に達した後に停止する</system:String>
<system:String x:Key="InvestmentEnabled">源石錐を投資する</system:String>
<system:String x:Key="InvestmentEnterSecondFloor">投資後に階層2へ</system:String>
<system:String x:Key="InvestmentWithMoreScore">投資モードではショッピングや人材募集が可能</system:String>
<system:String x:Key="RefreshTraderWithDice">ダイスで品揃えを更新する</system:String>
<system:String x:Key="PenguinId">Penguin-StatsのレポートのIDデジタル部分のみ</system:String>
<system:String x:Key="EnablePenguin">Penguin-Statsの報告</system:String>

View File

@@ -261,7 +261,7 @@
<system:String x:Key="GoldTimesLimit">N번 투자 후 작업 중지</system:String>
<system:String x:Key="StopOnGoldLimit">오리지늄각뿔이 한계 도달 시 중지</system:String>
<system:String x:Key="InvestmentEnabled">오리지늄각뿔 투자</system:String>
<system:String x:Key="InvestmentEnterSecondFloor">투자 후 2층 진입</system:String>
<system:String x:Key="InvestmentWithMoreScore">투자 모드에서는 쇼핑, 채용이 가능합니다.</system:String>
<system:String x:Key="RefreshTraderWithDice">상점 새로고침</system:String>
<system:String x:Key="PenguinId">Penguin-Stats 보고 ID (숫자만)</system:String>
<system:String x:Key="EnablePenguin">Penguin-Stats 보고</system:String>

View File

@@ -261,7 +261,7 @@
<system:String x:Key="GoldTimesLimit">投资 N 个源石锭后停止任务</system:String>
<system:String x:Key="StopOnGoldLimit">储备源石锭达到上限时停止</system:String>
<system:String x:Key="InvestmentEnabled">投资源石锭</system:String>
<system:String x:Key="InvestmentEnterSecondFloor">投资后进入第二层</system:String>
<system:String x:Key="InvestmentWithMoreScore">投资模式启用购物、招募</system:String>
<system:String x:Key="RefreshTraderWithDice">刷新商店(指路鳞)</system:String>
<system:String x:Key="PenguinId">企鹅物流汇报ID仅数字部分</system:String>
<system:String x:Key="EnablePenguin">上报企鹅物流</system:String>

View File

@@ -261,7 +261,7 @@
<system:String x:Key="GoldTimesLimit">投資 N 個源石錠後停止任務</system:String>
<system:String x:Key="StopOnGoldLimit">源石錠達到上限停止</system:String>
<system:String x:Key="InvestmentEnabled">投資源石錠</system:String>
<system:String x:Key="InvestmentEnterSecondFloor">投資後進入第二層</system:String>
<system:String x:Key="InvestmentWithMoreScore">投資模式啟用購物、招募</system:String>
<system:String x:Key="RefreshTraderWithDice">刷新商店(指路鱗)</system:String>
<system:String x:Key="PenguinId">企鵝物流匯報 ID僅數字部分</system:String>
<system:String x:Key="EnablePenguin">上報企鵝物流</system:String>

View File

@@ -2063,17 +2063,17 @@ namespace MaaWpfGui.ViewModels.UI
}
}
private string _roguelikeInvestmentEnterSecondFloor = ConfigurationHelper.GetValue(ConfigurationKeys.RoguelikeInvestmentEnterSecondFloor, true.ToString());
private string _roguelikeInvestmentWithMoreScore = ConfigurationHelper.GetValue(ConfigurationKeys.RoguelikeInvestmentEnterSecondFloor, true.ToString());
/// <summary>
/// Gets or sets a value indicating whether investment is enabled.
/// </summary>
public bool RoguelikeInvestmentEnterSecondFloor
public bool RoguelikeInvestmentWithMoreScore
{
get => bool.Parse(_roguelikeInvestmentEnterSecondFloor);
get => bool.Parse(_roguelikeInvestmentWithMoreScore);
set
{
SetAndNotify(ref _roguelikeInvestmentEnterSecondFloor, value.ToString());
SetAndNotify(ref _roguelikeInvestmentWithMoreScore, value.ToString());
ConfigurationHelper.SetValue(ConfigurationKeys.RoguelikeInvestmentEnterSecondFloor, value.ToString());
}
}

View File

@@ -1392,7 +1392,7 @@ namespace MaaWpfGui.ViewModels.UI
return Instances.AsstProxy.AsstAppendRoguelike(
mode, Instances.SettingsViewModel.RoguelikeStartsCount,
Instances.SettingsViewModel.RoguelikeInvestmentEnabled, Instances.SettingsViewModel.RoguelikeInvestmentEnterSecondFloor, Instances.SettingsViewModel.RoguelikeInvestsCount, Instances.SettingsViewModel.RoguelikeStopWhenInvestmentFull,
Instances.SettingsViewModel.RoguelikeInvestmentEnabled, Instances.SettingsViewModel.RoguelikeInvestmentWithMoreScore, Instances.SettingsViewModel.RoguelikeInvestsCount, Instances.SettingsViewModel.RoguelikeStopWhenInvestmentFull,
Instances.SettingsViewModel.RoguelikeSquad, Instances.SettingsViewModel.RoguelikeRoles, DataHelper.GetCharacterByNameOrAlias(Instances.SettingsViewModel.RoguelikeCoreChar)?.Name ?? Instances.SettingsViewModel.RoguelikeCoreChar,
Instances.SettingsViewModel.RoguelikeStartWithEliteTwo, Instances.SettingsViewModel.RoguelikeOnlyStartWithEliteTwo,
Instances.SettingsViewModel.Roguelike3FirstFloorFoldartal, Instances.SettingsViewModel.Roguelike3StartFloorFoldartal,

View File

@@ -92,9 +92,13 @@
</CheckBox>
<CheckBox
Margin="0,10"
Content="{DynamicResource InvestmentEnterSecondFloor}"
IsChecked="{Binding RoguelikeInvestmentEnterSecondFloor}"
Visibility="{c:Binding 'RoguelikeMode == &quot;1&quot;'}" />
IsChecked="{Binding RoguelikeInvestmentWithMoreScore}"
Visibility="{c:Binding 'RoguelikeMode == &quot;1&quot;'}" >
<TextBlock
Block.TextAlignment="Left"
Text="{DynamicResource InvestmentWithMoreScore}"
TextWrapping="Wrap" />
</CheckBox>
<CheckBox
Margin="0,10"
IsChecked="{Binding RoguelikeStopWhenInvestmentFull}"