punish v6.8.18.0
This commit is contained in:
commit
e786325cda
322 changed files with 554232 additions and 0 deletions
|
@ -0,0 +1,67 @@
|
|||
using System;
|
||||
using Dalamud.Game.ClientState.Objects.Enums;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Questionable.Functions;
|
||||
using Questionable.Model;
|
||||
using Questionable.Model.Common;
|
||||
using Questionable.Model.Questing;
|
||||
|
||||
namespace Questionable.Controller.Steps.Interactions;
|
||||
|
||||
internal static class Aetheryte
|
||||
{
|
||||
internal sealed class Factory : SimpleTaskFactory
|
||||
{
|
||||
public override ITask? CreateTask(Quest quest, QuestSequence sequence, QuestStep step)
|
||||
{
|
||||
if (step.InteractionType != EInteractionType.AttuneAetheryte)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
ArgumentNullException.ThrowIfNull(step.Aetheryte, "step.Aetheryte");
|
||||
return new Attune(step.Aetheryte.Value);
|
||||
}
|
||||
}
|
||||
|
||||
internal sealed record Attune(EAetheryteLocation AetheryteLocation) : ITask
|
||||
{
|
||||
public bool ShouldRedoOnInterrupt()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return $"AttuneAetheryte({AetheryteLocation})";
|
||||
}
|
||||
}
|
||||
|
||||
internal sealed class DoAttune(AetheryteFunctions aetheryteFunctions, GameFunctions gameFunctions, ILogger<DoAttune> logger) : TaskExecutor<Attune>()
|
||||
{
|
||||
protected override bool Start()
|
||||
{
|
||||
if (!aetheryteFunctions.IsAetheryteUnlocked(base.Task.AetheryteLocation))
|
||||
{
|
||||
logger.LogInformation("Attuning to aetheryte {Aetheryte}", base.Task.AetheryteLocation);
|
||||
base.ProgressContext = InteractionProgressContext.FromActionUseOrDefault(() => gameFunctions.InteractWith((uint)base.Task.AetheryteLocation, ObjectKind.Aetheryte));
|
||||
return true;
|
||||
}
|
||||
logger.LogInformation("Already attuned to aetheryte {Aetheryte}", base.Task.AetheryteLocation);
|
||||
return false;
|
||||
}
|
||||
|
||||
public override ETaskResult Update()
|
||||
{
|
||||
if (!aetheryteFunctions.IsAetheryteUnlocked(base.Task.AetheryteLocation))
|
||||
{
|
||||
return ETaskResult.StillRunning;
|
||||
}
|
||||
return ETaskResult.TaskComplete;
|
||||
}
|
||||
|
||||
public override bool ShouldInterruptOnDamage()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue