Skip to content
This repository has been archived by the owner on Aug 28, 2024. It is now read-only.

Commit

Permalink
feat: remove the CommandType feature.
Browse files Browse the repository at this point in the history
  • Loading branch information
ArchiDog1998 committed Jan 14, 2023
1 parent 25d8262 commit 30da408
Show file tree
Hide file tree
Showing 82 changed files with 136 additions and 391 deletions.
2 changes: 1 addition & 1 deletion XIVAutoAction/Actions/BaseAction/BaseAction_ActionInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ public unsafe virtual bool ShouldUse(out IAction act, bool mustUse = false, bool
//如果是个法术需要咏唱,并且还在移动,也没有即刻相关的技能。
if (CastTime > 0 && MovingUpdater.IsMoving)
{
if (!player.HasStatus(true, CustomCombo<Enum>.Swiftcast.BuffsProvide))
if (!player.HasStatus(true, CustomCombo.Swiftcast.BuffsProvide))
{
return false;
}
Expand Down
2 changes: 1 addition & 1 deletion XIVAutoAction/Combos/Basic/ASTCombo_Base.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

namespace XIVAutoAttack.Combos.Basic;

internal abstract class ASTCombo_Base<TCmd> : CustomCombo<TCmd> where TCmd : Enum
internal abstract class ASTCombo_Base: CustomCombo.CustomCombo
{
private static ASTGauge JobGauge => Service.JobGauges.Get<ASTGauge>();

Expand Down
2 changes: 1 addition & 1 deletion XIVAutoAction/Combos/Basic/BLMCombo_Base.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

namespace XIVAutoAttack.Combos.Basic
{
internal abstract partial class BLMCombo_Base<TCmd> : CustomCombo<TCmd> where TCmd : Enum
internal abstract partial class BLMCombo_Base : CustomCombo.CustomCombo
{
private static BLMGauge JobGauge => Service.JobGauges.Get<BLMGauge>();

Expand Down
2 changes: 1 addition & 1 deletion XIVAutoAction/Combos/Basic/BLUCombo_Base.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ internal enum BLUID : byte
DPS,
}

internal abstract class BLUCombo_Base<TCmd> : CustomCombo<TCmd> where TCmd : Enum
internal abstract class BLUCombo_Base : CustomCombo.CustomCombo
{
internal enum BLUAttackType : byte
{
Expand Down
2 changes: 1 addition & 1 deletion XIVAutoAction/Combos/Basic/BRDCombo_Base.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

namespace XIVAutoAttack.Combos.Basic;

internal abstract class BRDCombo_Base<TCmd> : CustomCombo<TCmd> where TCmd : Enum
internal abstract class BRDCombo_Base : CustomCombo.CustomCombo
{
private static BRDGauge JobGauge => Service.JobGauges.Get<BRDGauge>();

Expand Down
2 changes: 1 addition & 1 deletion XIVAutoAction/Combos/Basic/DNCCombo_Base.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
using XIVAutoAttack.Helpers;

namespace XIVAutoAttack.Combos.Basic;
internal abstract class DNCCombo_Base<TCmd> : CustomCombo<TCmd> where TCmd : Enum
internal abstract class DNCCombo_Base : CustomCombo.CustomCombo
{
private static DNCGauge JobGauge => Service.JobGauges.Get<DNCGauge>();

Expand Down
2 changes: 1 addition & 1 deletion XIVAutoAction/Combos/Basic/DRGCombo_Base.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

namespace XIVAutoAttack.Combos.Basic;

internal abstract class DRGCombo_Base<TCmd> : CustomCombo<TCmd> where TCmd : Enum
internal abstract class DRGCombo_Base : CustomCombo.CustomCombo
{
private static DRGGauge JobGauge => Service.JobGauges.Get<DRGGauge>();

Expand Down
2 changes: 1 addition & 1 deletion XIVAutoAction/Combos/Basic/DRKCombo_Base.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
using XIVAutoAttack.Helpers;

namespace XIVAutoAttack.Combos.Basic;
internal abstract class DRKCombo_Base<TCmd> : CustomCombo<TCmd> where TCmd : Enum
internal abstract class DRKCombo_Base : CustomCombo.CustomCombo
{
private static DRKGauge JobGauge => Service.JobGauges.Get<DRKGauge>();
protected static ushort DarksideTimeRemaining => JobGauge.DarksideTimeRemaining;
Expand Down
2 changes: 1 addition & 1 deletion XIVAutoAction/Combos/Basic/GNBCombo_Base.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
namespace XIVAutoAttack.Combos.Basic;


internal abstract class GNBCombo_Base<TCmd> : CustomCombo<TCmd> where TCmd : Enum
internal abstract class GNBCombo_Base : CustomCombo.CustomCombo
{
private static GNBGauge JobGauge => Service.JobGauges.Get<GNBGauge>();

Expand Down
2 changes: 1 addition & 1 deletion XIVAutoAction/Combos/Basic/MCHCombo_Base.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

namespace XIVAutoAttack.Combos.Basic;

internal abstract class MCHCombo_Base<TCmd> : CustomCombo<TCmd> where TCmd : Enum
internal abstract class MCHCombo_Base : CustomCombo.CustomCombo
{
private static MCHGauge JobGauge => Service.JobGauges.Get<MCHGauge>();

Expand Down
2 changes: 1 addition & 1 deletion XIVAutoAction/Combos/Basic/MNKCombo_Base.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

namespace XIVAutoAttack.Combos.Basic;

internal abstract class MNKCombo_Base<TCmd> : CustomCombo<TCmd> where TCmd : Enum
internal abstract class MNKCombo_Base : CustomCombo.CustomCombo
{
private static MNKGauge JobGauge => Service.JobGauges.Get<MNKGauge>();

Expand Down
2 changes: 1 addition & 1 deletion XIVAutoAction/Combos/Basic/NINCombo_Base.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

namespace XIVAutoAttack.Combos.Basic;

internal abstract class NINCombo_Base<TCmd> : CustomCombo<TCmd> where TCmd : Enum
internal abstract class NINCombo_Base : CustomCombo.CustomCombo
{
private static NINGauge JobGauge => Service.JobGauges.Get<NINGauge>();

Expand Down
2 changes: 1 addition & 1 deletion XIVAutoAction/Combos/Basic/PLDCombo_Base.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

namespace XIVAutoAttack.Combos.Basic;

internal abstract class PLDCombo_Base<TCmd> : CustomCombo<TCmd> where TCmd : Enum
internal abstract class PLDCombo_Base : CustomCombo.CustomCombo
{
private static PLDGauge JobGauge => Service.JobGauges.Get<PLDGauge>();

Expand Down
2 changes: 1 addition & 1 deletion XIVAutoAction/Combos/Basic/RDMCombo_Base.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

namespace XIVAutoAttack.Combos.Basic;

internal abstract class RDMCombo_Base<TCmd> : CustomCombo<TCmd> where TCmd : Enum
internal abstract class RDMCombo_Base : CustomCombo.CustomCombo
{
private static RDMGauge JobGauge => Service.JobGauges.Get<RDMGauge>();

Expand Down
2 changes: 1 addition & 1 deletion XIVAutoAction/Combos/Basic/RPRCombo_Base.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

namespace XIVAutoAttack.Combos.Basic;

internal abstract class RPRCombo_Base<TCmd> : CustomCombo<TCmd> where TCmd : Enum
internal abstract class RPRCombo_Base : CustomCombo.CustomCombo
{
private static RPRGauge JobGauge => Service.JobGauges.Get<RPRGauge>();

Expand Down
2 changes: 1 addition & 1 deletion XIVAutoAction/Combos/Basic/SAMCombo_Base.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

namespace XIVAutoAttack.Combos.Basic;

internal abstract class SAMCombo_Base<TCmd> : CustomCombo<TCmd> where TCmd : Enum
internal abstract class SAMCombo_Base : CustomCombo.CustomCombo
{
private static SAMGauge JobGauge => Service.JobGauges.Get<SAMGauge>();

Expand Down
2 changes: 1 addition & 1 deletion XIVAutoAction/Combos/Basic/SCHCombo_Base.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

namespace XIVAutoAttack.Combos.Basic;

internal abstract class SCHCombo_Base<TCmd> : CustomCombo<TCmd> where TCmd : Enum
internal abstract class SCHCombo_Base : CustomCombo.CustomCombo
{
private static SCHGauge JobGauge => Service.JobGauges.Get<SCHGauge>();

Expand Down
2 changes: 1 addition & 1 deletion XIVAutoAction/Combos/Basic/SGECombo_Base.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

namespace XIVAutoAttack.Combos.Basic;

internal abstract class SGECombo_Base<TCmd> : CustomCombo<TCmd> where TCmd : Enum
internal abstract class SGECombo_Base : CustomCombo.CustomCombo
{
private static SGEGauge JobGauge => Service.JobGauges.Get<SGEGauge>();

Expand Down
2 changes: 1 addition & 1 deletion XIVAutoAction/Combos/Basic/SMNCombo_Base.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

namespace XIVAutoAttack.Combos.Basic;

internal abstract class SMNCombo_Base<TCmd> : CustomCombo<TCmd> where TCmd : Enum
internal abstract class SMNCombo_Base : CustomCombo.CustomCombo
{
private static SMNGauge JobGauge => Service.JobGauges.Get<SMNGauge>();

Expand Down
2 changes: 1 addition & 1 deletion XIVAutoAction/Combos/Basic/WARCombo_Base.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

namespace XIVAutoAttack.Combos.Basic;

internal abstract class WARCombo_Base<TCmd> : CustomCombo<TCmd> where TCmd : Enum
internal abstract class WARCombo_Base : CustomCombo.CustomCombo
{
private static WARGauge JobGauge => Service.JobGauges.Get<WARGauge>();

Expand Down
2 changes: 1 addition & 1 deletion XIVAutoAction/Combos/Basic/WHMCombo_Base.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

namespace XIVAutoAttack.Combos.Basic;

internal abstract class WHMCombo_Base<TCmd> : CustomCombo<TCmd> where TCmd : Enum
internal abstract class WHMCombo_Base : CustomCombo.CustomCombo
{
private static WHMGauge JobGauge => Service.JobGauges.Get<WHMGauge>();

Expand Down
2 changes: 1 addition & 1 deletion XIVAutoAction/Combos/CustomCombo/CustomCombo_Ability.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

namespace XIVAutoAttack.Combos.CustomCombo;

internal abstract partial class CustomCombo<TCmd> where TCmd : Enum
internal abstract partial class CustomCombo
{
private bool Ability(byte abilityRemain, IAction nextGCD, out IAction act, bool helpDefenseAOE, bool helpDefenseSingle)
{
Expand Down
2 changes: 1 addition & 1 deletion XIVAutoAction/Combos/CustomCombo/CustomCombo_Actions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

namespace XIVAutoAttack.Combos.CustomCombo
{
internal abstract partial class CustomCombo<TCmd> : ICustomCombo where TCmd : Enum
internal abstract partial class CustomCombo
{
internal class RoleAction : BaseAction
{
Expand Down
9 changes: 1 addition & 8 deletions XIVAutoAction/Combos/CustomCombo/CustomCombo_BasicInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

namespace XIVAutoAttack.Combos.CustomCombo
{
internal abstract partial class CustomCombo<TCmd> : ICustomCombo where TCmd : Enum
internal abstract partial class CustomCombo : ICustomCombo
{
public abstract ClassJobID[] JobIDs { get; }

Expand Down Expand Up @@ -65,13 +65,6 @@ public bool IsEnabled
}
}
}
public string Description => string.Join('\n', DescriptionDict.Select(pair => pair.Key.ToName() + " → " + pair.Value));

/// <summary>
/// 说明字典
/// </summary>
public virtual SortedList<DescType, string> DescriptionDict { get; } = new SortedList<DescType, string>();

/// <summary>
/// 有即刻相关Buff
/// </summary>
Expand Down
2 changes: 1 addition & 1 deletion XIVAutoAction/Combos/CustomCombo/CustomCombo_BreakItems.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

namespace XIVAutoAttack.Combos.CustomCombo
{
internal abstract partial class CustomCombo<TCmd> where TCmd : Enum
internal abstract partial class CustomCombo
{
private static readonly BaseItem
//刚力
Expand Down
2 changes: 1 addition & 1 deletion XIVAutoAction/Combos/CustomCombo/CustomCombo_GCD.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

namespace XIVAutoAttack.Combos.CustomCombo
{
internal abstract partial class CustomCombo<TCmd> where TCmd : Enum
internal abstract partial class CustomCombo
{
private IAction GCD(byte abilityRemain, bool helpDefenseAOE, bool helpDefenseSingle)
{
Expand Down
53 changes: 7 additions & 46 deletions XIVAutoAction/Combos/CustomCombo/CustomCombo_HelpInfo.cs
Original file line number Diff line number Diff line change
@@ -1,64 +1,25 @@
using System;
using System.Collections.Generic;
using System.Linq;

namespace XIVAutoAttack.Combos.CustomCombo
{
internal abstract partial class CustomCombo<TCmd> where TCmd : Enum
internal abstract partial class CustomCombo
{
protected TCmd LastCommand { get; private set; } = default(TCmd);

DateTime _lactCommandTime = DateTime.Now;
protected TimeSpan LastCommandElapsed => DateTime.Now - _lactCommandTime;

public Dictionary<string, string> CommandShow
{
get
{
var dict = new Dictionary<string, string>();
foreach (var pair in CommandDescription)
{
dict[pair.Key.ToString()] = pair.Value;
}
return dict;
}
}
public string Description => string.Join('\n', DescriptionDict.Select(pair => pair.Key.ToName() + " → " + pair.Value));

/// <summary>
/// 命令说明
/// Description about the actions.
/// </summary>
protected virtual SortedList<TCmd, string> CommandDescription { get; } = new SortedList<TCmd, string>();
public virtual SortedList<DescType, string> DescriptionDict { get; } = new SortedList<DescType, string>();

DateTime _lactCommandTime = DateTime.Now;
protected TimeSpan LastCommandElapsed => DateTime.Now - _lactCommandTime;

/// <summary>
/// 有什么是需要每一帧进行更新数据用的,放这里。如果有自定义字段,需要在此函数内全部更新一遍。
/// </summary>
private protected virtual void UpdateInfo() { }

/// <summary>
/// 如果有Override就一定要返回一点字符串!
/// </summary>
/// <param name="args"></param>
/// <returns></returns>
public string OnCommand(string args)
{
foreach (TCmd value in Enum.GetValues(typeof(TCmd)))
{
var name = Enum.GetName(typeof(TCmd), value);

if (string.IsNullOrEmpty(name)) continue;

if (name == args)
{
LastCommand = value;
_lactCommandTime = DateTime.Now;

if (!CommandDescription.TryGetValue(value, out var desc) || string.IsNullOrEmpty(desc))
desc = value.ToString();
return $"成功执行\"{desc}\"";
}
}

return string.Empty;
}
}
}
2 changes: 1 addition & 1 deletion XIVAutoAction/Combos/CustomCombo/CustomCombo_Invoke.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

namespace XIVAutoAttack.Combos.CustomCombo
{
internal abstract partial class CustomCombo<TCmd> where TCmd : Enum
internal abstract partial class CustomCombo
{
public bool TryInvoke(out IAction newAction)
{
Expand Down
2 changes: 1 addition & 1 deletion XIVAutoAction/Combos/CustomCombo/CustomCombo_OtherInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

namespace XIVAutoAttack.Combos.CustomCombo
{
internal abstract partial class CustomCombo<TCmd> where TCmd : Enum
internal abstract partial class CustomCombo
{
/// <summary>
/// 玩家
Expand Down
3 changes: 1 addition & 2 deletions XIVAutoAction/Combos/CustomCombo/ICustomCombo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ internal interface ICustomCombo : IEnableTexture
BattleChara MoveTarget { get; }

SortedList<DescType, string> DescriptionDict { get; }
Dictionary<string, string> CommandShow { get; }
IAction[] AllActions { get; }
PropertyInfo[] AllBools { get; }
PropertyInfo[] AllBytes { get; }
Expand All @@ -30,7 +29,7 @@ internal interface ICustomCombo : IEnableTexture
MethodInfo[] AllLast { get; }
MethodInfo[] AllOther { get; }
MethodInfo[] AllGCDs { get; }
string OnCommand(string args);

bool TryInvoke(out IAction newAction);
}
}
12 changes: 1 addition & 11 deletions XIVAutoAction/Combos/Healer/ASTCombos/ASTCombo_Default.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,12 @@

namespace XIVAutoAttack.Combos.Healer.ASTCombos;

internal sealed class ASTCombo_Default : ASTCombo_Base<CommandType>
internal sealed class ASTCombo_Default : ASTCombo_Base
{
public override string GameVersion => "6.28";

public override string Author => "汐ベMoon";

internal enum CommandType : byte
{
None,
}

protected override SortedList<CommandType, string> CommandDescription => new SortedList<CommandType, string>()
{
//{CommandType.None, "" }, //写好注释啊!用来提示用户的。
};

public override SortedList<DescType, string> DescriptionDict => new()
{
{DescType.HealArea, $"GCD: {AspectedHelios}, {Helios}\n 能力: {EarthlyStar}, {CrownPlay}, {CelestialOpposition}"},
Expand Down
Loading

0 comments on commit 30da408

Please sign in to comment.