mirror of
https://github.com/babalae/better-genshin-impact.git
synced 2026-05-17 09:26:50 +08:00
* 修改调度器任务和部分独立任务失去焦点时,强制切换回游戏窗口,如果用常规的方式无法激活窗口,则第10次会尝试最小化所有窗口后激活游戏。 * 去除未引入的类引用 * 修正战斗结束后,大概率打开队伍界面的问题 * 修复有些电脑上因未知原因,战斗0秒打断 * 把失焦激活放入了设置-通用设置-其他设置中,默认关闭。暂停恢复时,重置移动的起始时间,防止因暂停而导致超时放弃任务。 * 在调度器里面的任务之前,增加月卡处理,解决4点如果未进入任务会卡住的问题。增加了日志分析小怪详细。解决日志分析兜底结束日期不生效的问题。 * 在设置=》其他设置中 增加调度器任务传送过程中自动领取探索奖励功能配置。 * 调整自动派遣后恢复原任务的逻辑 * 自动领取派遣奖励时,跳过异常,防止整个配置组任务被打断。 * 把打开大地图方法从TpTask中抽出为公共方法,自动领取派遣代码调整到了调度器中。 * 去除了未使用的引用 * 暂停恢复逻辑增加恢复中条件和非空判断 * 增加了临时暂停自动拾取的逻辑(RunnerContext.AutoPickTriggerStopCount 为0时不限制,大于0时停止,多次暂停会累加该值,每次恢复-1),支持嵌套情况的暂停,在自动派遣(和结束后5秒)或暂停调度器任务时,同时暂停自动拾取功能。 * 调整暂停拾取方法 * 调整个日志输出 * 路径追踪复苏时,暂停拾取
79 lines
3.0 KiB
C#
79 lines
3.0 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
|
|
namespace BetterGenshinImpact.GameTask.LogParse
|
|
{
|
|
public class MoraStatistics
|
|
{
|
|
public string Name;
|
|
public DateTime Date;
|
|
public DateTime? StatisticsStart;
|
|
public DateTime? StatisticsEnd;
|
|
public List<ActionItem> ActionItems { get; set; } = new List<ActionItem>();
|
|
public MoraStatistics GetFilterMoraStatistics(Func<ActionItem, bool> predicate)
|
|
{
|
|
MoraStatistics moraStatistics = new MoraStatistics();
|
|
moraStatistics.ActionItems.AddRange(ActionItems.Where(predicate));
|
|
return moraStatistics;
|
|
}
|
|
|
|
public List<ActionItem> MonsterActionItems => ActionItems.Where(item => item.ActionId == 37).ToList();
|
|
|
|
public List<ActionItem> EliteMonsterActionItems =>
|
|
MonsterActionItems.Where(item => (item.Num >= 200)).ToList();
|
|
|
|
public List<ActionItem> SmallMonsterActionItems =>
|
|
MonsterActionItems.Except(EliteMonsterActionItems).ToList();
|
|
public string EmergencyBonus
|
|
{
|
|
get
|
|
{
|
|
var ls = ActionItems.Where(item => item.ActionId == 28).ToList();
|
|
var count = ls.Count();
|
|
if (count == 0)
|
|
{
|
|
return "";
|
|
}
|
|
|
|
return ls.Sum(item=>item.Num)+(count>=10?"":$"({count}/10)");
|
|
}
|
|
}
|
|
|
|
|
|
public string LastEliteTime => EliteMonsterActionItems.MaxBy(item => item?.Time)?.Time ?? null;
|
|
public string LastSmallTime => SmallMonsterActionItems.MaxBy(item => item?.Time)?.Time ?? null;
|
|
|
|
public string EliteDetails => string.Join(", ", EliteMonsterActionItems
|
|
.GroupBy(item => item.Num).OrderBy(item => item.Key) // 按 Num 属性分组
|
|
.Select(group => $"{group.Key}*{group.Count()}"));
|
|
|
|
public int EliteStatistics => EliteMonsterActionItems?.Count ?? 0;
|
|
|
|
//游戏里的上限计算
|
|
public int EliteGameStatistics => EliteMonsterActionItems.Sum(item =>
|
|
{
|
|
if (item?.Num >= 3000)
|
|
{
|
|
return 3;
|
|
}
|
|
|
|
if (item.Num >= 1200)
|
|
{
|
|
return 2;
|
|
}
|
|
|
|
return 1;
|
|
});
|
|
|
|
public int EliteMora => EliteMonsterActionItems?.Sum(item => item.Num) ?? 0;
|
|
public int SmallMonsterStatistics => SmallMonsterActionItems?.Count ?? 0;
|
|
public int SmallMonsterMora => SmallMonsterActionItems?.Sum(item => item.Num) ?? 0;
|
|
public string SmallMonsterDetails => string.Join(", ", SmallMonsterActionItems
|
|
.GroupBy(item => item.Num/10).OrderBy(item => item.Key) // 按 Num 属性分组
|
|
.Select(group => $"{group.Key}*{group.Count()}"));
|
|
public int TotalMoraKillingMonstersMora => MonsterActionItems.Sum(item => item.Num);
|
|
public int OtherMora => ActionItems.Except(MonsterActionItems).Sum(item => item.Num);
|
|
public int AllMora => ActionItems.Sum(item => item.Num);
|
|
}
|
|
} |