private void MakePlayer(IPlayer player, PlayerCommandType CommandType) { var faceDirection = player.GetWorldPosition().X > GetHoldPosition(false).X ? PlayerCommandFaceDirection.Right : PlayerCommandFaceDirection.Left; player.SetInputEnabled(false); // some command like Stagger not working without this line player.AddCommand(new PlayerCommand(PlayerCommandType.FaceAt, faceDirection)); ScriptHelper.Timeout(() => player.AddCommand(new PlayerCommand(CommandType)), 2); }
public static void ExecuteSingleCommand(IPlayer player, PlayerCommandType commandType, uint delay = 10, PlayerCommandFaceDirection facingDirection = PlayerCommandFaceDirection.None) { player.SetInputEnabled(false); // some commands like Stagger not working without this line player.AddCommand(new PlayerCommand(PlayerCommandType.FaceAt, facingDirection)); Timeout(() => { player.AddCommand(new PlayerCommand(commandType, facingDirection)); if (delay == 0) { return; } Timeout(() => { player.ClearCommandQueue(); player.SetInputEnabled(true); }, delay); }, 2); }
protected PlayerCommandDto(PlayerCommandType type) { Type = type; }