punish v6.8.18.0
This commit is contained in:
commit
060278c1b7
317 changed files with 554155 additions and 0 deletions
|
@ -0,0 +1,58 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Questionable.Controller.Steps.Common;
|
||||
using Questionable.Functions;
|
||||
using Questionable.Model;
|
||||
using Questionable.Model.Questing;
|
||||
|
||||
namespace Questionable.Controller.Steps.Interactions;
|
||||
|
||||
internal static class Say
|
||||
{
|
||||
internal sealed class Factory(ExcelFunctions excelFunctions) : ITaskFactory
|
||||
{
|
||||
public IEnumerable<ITask> CreateAllTasks(Quest quest, QuestSequence sequence, QuestStep step)
|
||||
{
|
||||
EInteractionType interactionType = step.InteractionType;
|
||||
if ((uint)(interactionType - 28) <= 1u)
|
||||
{
|
||||
if (step.ChatMessage == null)
|
||||
{
|
||||
return Array.Empty<ITask>();
|
||||
}
|
||||
}
|
||||
else if (step.InteractionType != EInteractionType.Say)
|
||||
{
|
||||
return Array.Empty<ITask>();
|
||||
}
|
||||
ArgumentNullException.ThrowIfNull(step.ChatMessage, "step.ChatMessage");
|
||||
string? text = excelFunctions.GetDialogueText(quest, step.ChatMessage.ExcelSheet, step.ChatMessage.Key, isRegex: false).GetString();
|
||||
ArgumentNullException.ThrowIfNull(text, "excelString");
|
||||
Mount.UnmountTask unmountTask = new Mount.UnmountTask();
|
||||
Task task = new Task(text);
|
||||
return new global::_003C_003Ez__ReadOnlyArray<ITask>(new ITask[2] { unmountTask, task });
|
||||
}
|
||||
}
|
||||
|
||||
internal sealed record Task(string ChatMessage) : ITask
|
||||
{
|
||||
public override string ToString()
|
||||
{
|
||||
return "Say(" + ChatMessage + ")";
|
||||
}
|
||||
}
|
||||
|
||||
internal sealed class UseChat(ChatFunctions chatFunctions) : AbstractDelayedTaskExecutor<Task>()
|
||||
{
|
||||
protected override bool StartInternal()
|
||||
{
|
||||
chatFunctions.ExecuteCommand("/say " + base.Task.ChatMessage);
|
||||
return true;
|
||||
}
|
||||
|
||||
public override bool ShouldInterruptOnDamage()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue