Skip to content

Commit

Permalink
Core: ClassConfiguration: Separate BaseActions
Browse files Browse the repository at this point in the history
Readme: Update and tidy up doc
  • Loading branch information
Xian55 committed Nov 23, 2023
1 parent da103bc commit 1d76d40
Show file tree
Hide file tree
Showing 23 changed files with 271 additions and 213 deletions.
132 changes: 6 additions & 126 deletions Core/ClassConfig/ClassConfiguration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -79,135 +79,15 @@ public sealed partial class ClassConfiguration
public KeyAction[] GatherFindKeyConfig { get; set; } = Array.Empty<KeyAction>();
public string[] GatherFindKeys { get; init; } = Array.Empty<string>();

public KeyAction Jump { get; } = new();
public string JumpKey { get; init; } = "Spacebar";

public KeyAction Interact { get; } = new();
public string InteractKey { get; init; } = "I";

public KeyAction InteractMouseOver { get; } = new();
public string InteractMouseOverKey { get; init; } = "J";

public KeyAction Approach { get; } = new();
public KeyAction AutoAttack { get; } = new();

public KeyAction TargetLastTarget { get; } = new();
public string TargetLastTargetKey { get; init; } = "G";

public KeyAction StandUp { get; } = new();
public string StandUpKey { get; init; } = "X";

public KeyAction ClearTarget { get; } = new();
public string ClearTargetKey { get; init; } = "Insert";

public KeyAction StopAttack { get; } = new();
public string StopAttackKey { get; init; } = "Delete";

public KeyAction TargetNearestTarget { get; } = new();
public string TargetNearestTargetKey { get; init; } = "Tab";

public KeyAction TargetTargetOfTarget { get; } = new();
public string TargetTargetOfTargetKey { get; init; } = "F";
public KeyAction TargetPet { get; } = new();
public string TargetPetKey { get; init; } = "Multiply";

public KeyAction PetAttack { get; } = new();
public string PetAttackKey { get; init; } = "Subtract";

public KeyAction TargetFocus { get; } = new();
public string TargetFocusKey { get; init; } = "PageUp";

public KeyAction FollowTarget { get; } = new();
public string FollowTargetKey { get; init; } = "PageDown";

public KeyAction Mount { get; } = new();
public string MountKey { get; init; } = "O";

public ConsoleKey ForwardKey { get; init; } = ConsoleKey.UpArrow; // 38
public ConsoleKey BackwardKey { get; init; } = ConsoleKey.DownArrow; // 40
public ConsoleKey TurnLeftKey { get; init; } = ConsoleKey.LeftArrow; // 37
public ConsoleKey TurnRightKey { get; init; } = ConsoleKey.RightArrow; // 39
public ConsoleKey ForwardKey { get; init; } = ConsoleKey.UpArrow;
public ConsoleKey BackwardKey { get; init; } = ConsoleKey.DownArrow;
public ConsoleKey TurnLeftKey { get; init; } = ConsoleKey.LeftArrow;
public ConsoleKey TurnRightKey { get; init; } = ConsoleKey.RightArrow;

public void Initialise(IServiceProvider sp, string? overridePathFile)
{
Jump.Key = JumpKey;
Jump.Name = nameof(Jump);
Jump.BaseAction = true;

TargetLastTarget.Key = TargetLastTargetKey;
TargetLastTarget.Name = nameof(TargetLastTarget);
TargetLastTarget.Cooldown = 0;
TargetLastTarget.BaseAction = true;

StandUp.Key = StandUpKey;
StandUp.Name = nameof(StandUp);
StandUp.Cooldown = 0;
StandUp.BaseAction = true;

ClearTarget.Key = ClearTargetKey;
ClearTarget.Name = nameof(ClearTarget);
ClearTarget.Cooldown = 0;
ClearTarget.BaseAction = true;

StopAttack.Key = StopAttackKey;
StopAttack.Name = nameof(StopAttack);
StopAttack.PressDuration = 20;
StopAttack.BaseAction = true;

TargetNearestTarget.Key = TargetNearestTargetKey;
TargetNearestTarget.Name = nameof(TargetNearestTarget);
TargetNearestTarget.BaseAction = true;

TargetPet.Key = TargetPetKey;
TargetPet.Name = nameof(TargetPet);
TargetPet.Cooldown = 0;
TargetPet.BaseAction = true;

TargetTargetOfTarget.Key = TargetTargetOfTargetKey;
TargetTargetOfTarget.Name = nameof(TargetTargetOfTarget);
TargetTargetOfTarget.Cooldown = 0;
TargetTargetOfTarget.BaseAction = true;

TargetFocus.Key = TargetFocusKey;
TargetFocus.Name = nameof(TargetFocus);
TargetFocus.Cooldown = 0;
TargetFocus.BaseAction = true;

FollowTarget.Key = FollowTargetKey;
FollowTarget.Name = nameof(FollowTarget);
FollowTarget.Cooldown = 0;
FollowTarget.BaseAction = true;

PetAttack.Key = PetAttackKey;
PetAttack.Name = nameof(PetAttack);
PetAttack.PressDuration = 10;
PetAttack.BaseAction = true;

Mount.Key = MountKey;
Mount.Name = nameof(Mount);
Mount.BaseAction = true;
Mount.Cooldown = 6000;

Interact.Key = InteractKey;
Interact.Name = nameof(Interact);
Interact.Cooldown = 0;
Interact.PressDuration = 30;
Interact.BaseAction = true;

InteractMouseOver.Key = InteractMouseOverKey;
InteractMouseOver.Name = nameof(InteractMouseOver);
InteractMouseOver.Cooldown = 0;
InteractMouseOver.PressDuration = 10;
InteractMouseOver.BaseAction = true;

Approach.Key = InteractKey;
Approach.Name = nameof(Approach);
Approach.PressDuration = 10;
Approach.BaseAction = true;

AutoAttack.Key = InteractKey;
AutoAttack.Name = nameof(AutoAttack);
AutoAttack.BaseAction = true;
Approach.Key = Interact.Key;
AutoAttack.Key = Interact.Key;

RequirementFactory factory = new(sp, this);

Expand Down
131 changes: 131 additions & 0 deletions Core/ClassConfig/ClassConfigurationBaseActions.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
namespace Core;

public sealed partial class ClassConfiguration
{
public KeyAction Jump { get; } = new()
{
Name = nameof(Jump),
Key = "Spacebar",
BaseAction = true
};

public KeyAction Interact { get; } = new()
{
Key = "I",
Name = nameof(Interact),
Cooldown = 0,
PressDuration = 30,
BaseAction = true
};

public KeyAction InteractMouseOver { get; } = new()
{
Key = "J",
Name = nameof(InteractMouseOver),
Cooldown = 0,
PressDuration = 10,
BaseAction = true
};

public KeyAction Approach { get; } = new()
{
Key = "I", // Interact.Key
Name = nameof(Approach),
PressDuration = 10,
BaseAction = true
};

public KeyAction AutoAttack { get; } = new()
{
Key = "I", // Interact.Key
Name = nameof(AutoAttack),
BaseAction = true
};

public KeyAction TargetLastTarget { get; } = new()
{
Key = "G",
Name = nameof(TargetLastTarget),
Cooldown = 0,
BaseAction = true
};

public KeyAction StandUp { get; } = new()
{
Key = "X",
Name = nameof(StandUp),
Cooldown = 0,
BaseAction = true,
};

public KeyAction ClearTarget { get; } = new()
{
Key = "Insert",
Name = nameof(ClearTarget),
Cooldown = 0,
BaseAction = true,
};

public KeyAction StopAttack { get; } = new()
{
Key = "Delete",
Name = nameof(StopAttack),
PressDuration = 20,
BaseAction = true,
};

public KeyAction TargetNearestTarget { get; } = new()
{
Key = "Tab",
Name = nameof(TargetNearestTarget),
BaseAction = true,
};

public KeyAction TargetTargetOfTarget { get; } = new()
{
Key = "F",
Name = nameof(TargetTargetOfTarget),
Cooldown = 0,
BaseAction = true,
};

public KeyAction TargetPet { get; } = new()
{
Key = "Multiply",
Name = nameof(TargetPet),
Cooldown = 0,
BaseAction = true,
};

public KeyAction PetAttack { get; } = new()
{
Key = "Subtract",
Name = nameof(PetAttack),
PressDuration = 10,
BaseAction = true,
};

public KeyAction TargetFocus { get; } = new()
{
Key = "PageUp",
Name = nameof(TargetFocus),
Cooldown = 0,
BaseAction = true,
};

public KeyAction FollowTarget { get; } = new()
{
Key = "PageDown",
Name = nameof(FollowTarget),
Cooldown = 0,
BaseAction = true,
};

public KeyAction Mount { get; } = new()
{
Key = "O",
Name = nameof(Mount),
BaseAction = true,
Cooldown = 6000,
};
}
2 changes: 1 addition & 1 deletion Json/class/DeathKnight_70_Unholy.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"PathFilename": "_pack\\70-80\\Borean Tundra\\67-72_Borean Tundra_South Warsong Hold_Rhinos.json",
"PathReduceSteps": true,
"PathThereAndBack": false,
"MountKey": "N0",
"Mount": { "Key": "N0"},
"IntVariables": {
"MIN_HP_FOOD%": 40,
"MIN_RUNE_TO_DUMP": 40,
Expand Down
2 changes: 1 addition & 1 deletion Json/class/DeathKnight_80_Frost.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"PathFilename": "_pack\\40-50\\The Hinterlands\\41-42 wolves.json", // todo update profile
"PathReduceSteps": true,
"PathThereAndBack": false,
"MountKey": "N0",
"Mount": { "Key": "N0"},
"IntVariables": {
"MIN_HP_FOOD%": 40,
"MIN_RUNE_TO_DUMP": 40,
Expand Down
2 changes: 1 addition & 1 deletion Json/class/DeathKnight_80_Unholy.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"PathFilename": "_pack\\70-80\\Zul'Drak\\76-80_Zul'Drak_Heb'Valok_spiders.json",
"PathReduceSteps": true,
"PathThereAndBack": false,
"MountKey": "N0",
"Mount": { "Key": "N0"},
"IntVariables": {
"MIN_HP_FOOD%": 40,
"MIN_RUNE_TO_DUMP": 40,
Expand Down
27 changes: 26 additions & 1 deletion Json/class/Druid_80_moonkin_assist.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"Mode": "AssistFocus",
"Loot": true,
"Skin": true,
"MountKey": "N0",
"Mount": {"Key":"N0"},
"PathFilename": "_pack\\60-70\\Terokkar Forest\\62-64.json",
"PathThereAndBack": false,
"PathReduceSteps": true,
Expand All @@ -19,6 +19,10 @@
"USE_TRINKET_1": 1,
"USE_TRINKET_2": 1
},
"Jump":
{
"PressDuration": 200
},
"Form": {
"Sequence": [
{
Expand Down Expand Up @@ -264,5 +268,26 @@
"Requirement": "Mana% < 40 && DrinkCount > 0"
}
]
},
"NPC": {
"Sequence": [
{
"Name": "Repair",
"Key": "C",
"Requirement": "Durability% < 35",
"PathFilename": "Terokkar Forest_2023_09_04_16_46_24.json",
"Cost": 6
},
{
"Name": "Sell",
"Key": "C",
"Requirements": [
"BagFull",
"BagGreyItem"
],
"PathFilename": "Terokkar Forest_2023_09_04_16_46_24.json",
"Cost": 6
}
]
}
}
2 changes: 1 addition & 1 deletion Json/class/Hunter_62.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"PathThereAndBack": true,
"PathReduceSteps": true,
"NPCMaxLevels_Above": 3,
"MountKey": "N0",
"Mount": { "Key": "N0"},
"PathFilename": "60_Hellfire Peninsula_Ravager.json",
"Pull": {
"Sequence": [
Expand Down
2 changes: 1 addition & 1 deletion Json/class/Hunter_66.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"PathThereAndBack": true,
"PathReduceSteps": true,
"NPCMaxLevels_Above": 2,
"MountKey": "N0",
"Mount": { "Key": "N0"},
"PathFilename": "_pack\\60-70\\Blade's Edge Mountains\\Dragon.json",
"IntVariables": {
"MIN_MANA_VIPER%": 40,
Expand Down
Loading

0 comments on commit 1d76d40

Please sign in to comment.