-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
88 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
Content.Server/NPC/HTN/PrimitiveTasks/Operators/Math/SetStringOperator.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
using System.Threading; | ||
using System.Threading.Tasks; | ||
|
||
namespace Content.Server.NPC.HTN.PrimitiveTasks.Operators.Math; | ||
|
||
/// <summary> | ||
/// Set <see cref="SetBoolOperator.Value"/> to bool value for the | ||
/// specified <see cref="SetFloatOperator.TargetKey"/> in the <see cref="NPCBlackboard"/>. | ||
/// </summary> | ||
public sealed partial class SetStringOperator : HTNOperator | ||
{ | ||
[DataField(required: true), ViewVariables] | ||
public string TargetKey = string.Empty; | ||
|
||
[DataField(required: true), ViewVariables(VVAccess.ReadWrite)] | ||
public string Value = string.Empty; | ||
|
||
public override async Task<(bool Valid, Dictionary<string, object>? Effects)> Plan(NPCBlackboard blackboard, | ||
CancellationToken cancelToken) | ||
{ | ||
return ( | ||
true, | ||
new Dictionary<string, object> | ||
{ | ||
{ TargetKey, Value } | ||
} | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
using Robust.Shared.Prototypes; | ||
|
||
namespace Content.Server.Exodus.Actions; | ||
|
||
[Prototype("actionList")] | ||
public sealed partial class ActionListPrototype : ActionList, IPrototype | ||
{ | ||
[IdDataField] | ||
public string ID { get; private set; } = default!; | ||
} | ||
|
||
[Virtual] | ||
[DataDefinition] | ||
public partial class ActionList | ||
{ | ||
public bool AllAvaibleAbilities = false; | ||
public List<string> Actions = []; | ||
} |