mirror of
https://github.com/babalae/better-genshin-impact.git
synced 2026-05-21 09:45:48 +08:00
@@ -18,6 +18,7 @@ public class ActionEnum(string code, string msg)
|
||||
public static readonly ActionEnum CombatScript = new("combat_script", "战斗策略脚本"); // 这个必须要 action_params 里面有脚本
|
||||
|
||||
public static readonly ActionEnum Mining = new("mining", "挖矿");
|
||||
public static readonly ActionEnum LogOutput = new("log_output", "输出日志");
|
||||
|
||||
// 还有要加入的其他动作
|
||||
// 滚轮F
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
using System;
|
||||
using BetterGenshinImpact.GameTask.AutoFight.Script;
|
||||
using BetterGenshinImpact.GameTask.AutoPathing.Model.Enum;
|
||||
using System.Diagnostics.Eventing.Reader;
|
||||
|
||||
namespace BetterGenshinImpact.GameTask.AutoPathing.Model;
|
||||
|
||||
@@ -22,6 +23,7 @@ public class WaypointForTrack : Waypoint
|
||||
/// 存在 combat_script 的 action 的话,这个值会存在
|
||||
/// </summary>
|
||||
public CombatScript? CombatScript { get; set; }
|
||||
public string? LogInfo { get; set; }
|
||||
|
||||
public WaypointForTrack(Waypoint waypoint)
|
||||
{
|
||||
@@ -40,5 +42,9 @@ public class WaypointForTrack : Waypoint
|
||||
{
|
||||
CombatScript = CombatScriptParser.ParseContext(str, false);
|
||||
}
|
||||
if (waypoint.Action == ActionEnum.LogOutput.Code && waypoint.ActionParams is not null)
|
||||
{
|
||||
LogInfo = waypoint.ActionParams;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -169,6 +169,10 @@ public class PathExecutor
|
||||
CurWaypoint = (waypoints.FindIndex(wps => wps == waypoint), waypoint);
|
||||
TryCloseSkipOtherOperations();
|
||||
await RecoverWhenLowHp(waypoint); // 低血量恢复
|
||||
if (waypoint.Action == ActionEnum.LogOutput.Code)
|
||||
{
|
||||
Logger.LogInformation(waypoint.LogInfo);
|
||||
}
|
||||
if (waypoint.Type == WaypointType.Teleport.Code)
|
||||
{
|
||||
await HandleTeleportWaypoint(waypoint);
|
||||
|
||||
Reference in New Issue
Block a user