feat(mosstank): add VTank-style automation PoC
This commit is contained in:
parent
f6fe0f2a4f
commit
4e6e9bc9d9
212 changed files with 49462 additions and 416 deletions
64
src/AcDream.Plugin.Abstractions/EquipmentAutomation.cs
Normal file
64
src/AcDream.Plugin.Abstractions/EquipmentAutomation.cs
Normal file
|
|
@ -0,0 +1,64 @@
|
|||
namespace AcDream.Plugin.Abstractions;
|
||||
|
||||
/// <summary>One owned item that can participate in VTank equipment policy.</summary>
|
||||
public readonly record struct PluginEquipmentItem(
|
||||
uint ObjectId,
|
||||
string Name,
|
||||
uint ItemType,
|
||||
uint ValidLocations,
|
||||
uint EquippedLocation,
|
||||
uint ContainerObjectId,
|
||||
uint WielderObjectId,
|
||||
byte CombatUse,
|
||||
int DamageType,
|
||||
int WeaponSkill,
|
||||
int Damage,
|
||||
double DamageVariance)
|
||||
{
|
||||
public bool IsEquipped => EquippedLocation != 0u;
|
||||
/// <summary>Retail AMMO_TYPE bit from PublicWeenieDesc.</summary>
|
||||
public uint AmmoType { get; init; }
|
||||
public int StackSize { get; init; } = 1;
|
||||
public int WeaponType { get; init; }
|
||||
}
|
||||
|
||||
public enum PluginEquipmentCommandStatus
|
||||
{
|
||||
Unavailable = 0,
|
||||
InvalidItem,
|
||||
Busy,
|
||||
AlreadyEquipped,
|
||||
Started,
|
||||
Refused,
|
||||
}
|
||||
|
||||
public readonly record struct PluginEquipmentCommandResult(
|
||||
PluginEquipmentCommandStatus Status,
|
||||
string? Notice = null)
|
||||
{
|
||||
public bool Accepted => Status is
|
||||
PluginEquipmentCommandStatus.AlreadyEquipped
|
||||
or PluginEquipmentCommandStatus.Started;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Borrowed inventory equipment view and one request through the client's
|
||||
/// canonical confirmed AutoWield transaction.
|
||||
/// </summary>
|
||||
public interface IEquipmentAutomation
|
||||
{
|
||||
bool IsAvailable => false;
|
||||
bool IsBusy => false;
|
||||
|
||||
IReadOnlyList<PluginEquipmentItem> CaptureOwnedEquipment() =>
|
||||
Array.Empty<PluginEquipmentItem>();
|
||||
|
||||
/// <param name="requestedLocation">
|
||||
/// Zero asks retail AutoWield to choose; otherwise this is the exact
|
||||
/// retail INVENTORY_LOC bit requested by a profile.
|
||||
/// </param>
|
||||
PluginEquipmentCommandResult Equip(
|
||||
uint objectId,
|
||||
uint requestedLocation = 0u) =>
|
||||
new(PluginEquipmentCommandStatus.Unavailable);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue