punish v6.8.18.0
This commit is contained in:
commit
060278c1b7
317 changed files with 554155 additions and 0 deletions
|
@ -0,0 +1,68 @@
|
|||
using System.Linq;
|
||||
using Dalamud.Plugin.Services;
|
||||
using FFXIVClientStructs.FFXIV.Client.UI.Misc;
|
||||
using LLib.GameData;
|
||||
using Questionable.Controller.Steps.Common;
|
||||
using Questionable.Data;
|
||||
using Questionable.Model;
|
||||
using Questionable.Model.Questing;
|
||||
|
||||
namespace Questionable.Controller.Steps.Shared;
|
||||
|
||||
internal static class SwitchClassJob
|
||||
{
|
||||
internal sealed class Factory(ClassJobUtils classJobUtils) : SimpleTaskFactory()
|
||||
{
|
||||
public override ITask? CreateTask(Quest quest, QuestSequence sequence, QuestStep step)
|
||||
{
|
||||
if (step.InteractionType != EInteractionType.SwitchClass)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
return new Task(classJobUtils.AsIndividualJobs(step.TargetClass, quest.Id).Single());
|
||||
}
|
||||
}
|
||||
|
||||
internal sealed record Task(EClassJob ClassJob) : ITask
|
||||
{
|
||||
public override string ToString()
|
||||
{
|
||||
return $"SwitchJob({ClassJob})";
|
||||
}
|
||||
}
|
||||
|
||||
internal sealed class SwitchClassJobExecutor(IClientState clientState) : AbstractDelayedTaskExecutor<Task>()
|
||||
{
|
||||
protected unsafe override bool StartInternal()
|
||||
{
|
||||
if (clientState.LocalPlayer.ClassJob.RowId == (uint)base.Task.ClassJob)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
RaptureGearsetModule* ptr = RaptureGearsetModule.Instance();
|
||||
if (ptr != null)
|
||||
{
|
||||
for (int i = 0; i < 100; i++)
|
||||
{
|
||||
RaptureGearsetModule.GearsetEntry* gearset = ptr->GetGearset(i);
|
||||
if (gearset->ClassJob == (byte)base.Task.ClassJob)
|
||||
{
|
||||
ptr->EquipGearset(gearset->Id, 0);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
throw new TaskException($"No gearset found for {base.Task.ClassJob}");
|
||||
}
|
||||
|
||||
protected override ETaskResult UpdateInternal()
|
||||
{
|
||||
return ETaskResult.TaskComplete;
|
||||
}
|
||||
|
||||
public override bool ShouldInterruptOnDamage()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue