TALKON.cs 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. using System;
  2. namespace OpenVIII.Fields.Scripts.Instructions
  3. {
  4. internal sealed class TALKON : JsmInstruction
  5. {
  6. public TALKON()
  7. {
  8. }
  9. public TALKON(Int32 parameter, IStack<IJsmExpression> stack)
  10. : this()
  11. {
  12. }
  13. public override String ToString()
  14. {
  15. return $"{nameof(TALKON)}()";
  16. }
  17. public override void Format(ScriptWriter sw, IScriptFormatterContext formatterContext, IServices services)
  18. {
  19. sw.Format(formatterContext, services)
  20. .Property(nameof(FieldObject.Model))
  21. .Property(nameof(FieldObjectInteraction.IsTalkScriptActive))
  22. .Assign(true)
  23. .Comment(nameof(TALKON));
  24. }
  25. public override IAwaitable TestExecute(IServices services)
  26. {
  27. FieldObject currentObject = ServiceId.Field[services].Engine.CurrentObject;
  28. currentObject.Interaction.IsTalkScriptActive = true;
  29. return DummyAwaitable.Instance;
  30. }
  31. }
  32. }