Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 3 additions & 8 deletions .github/workflows/dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,22 +19,17 @@ jobs:
- name: Setup Dotnet
uses: actions/setup-dotnet@v4

- name: Setup NuGet
uses: NuGet/setup-nuget@v2

- name: Restore NuGet packages
run: nuget restore YongAnFrame.sln

- name: Restore dependencies
run: dotnet restore

- name: Build
run: dotnet build --no-restore
run: dotnet build --configuration Release

- name: Generate NuGet packages
run: nuget pack
run: dotnet pack

- name: Upload NuGet package
uses: actions/upload-artifact@v4
with:
name: nupkg
path: YongAnFrame.*.nupkg
8 changes: 1 addition & 7 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Simple workflow for deploying static content to GitHub Pages
name: Build and Publish Docfx Pages
name: Build and Publish Master Docfx Pages

on:
# Runs on pushes targeting the default branch
Expand Down Expand Up @@ -34,12 +34,6 @@ jobs:
- name: Dotnet Setup
uses: actions/setup-dotnet@v4

- name: Setup NuGet
uses: NuGet/setup-nuget@v2

- name: Restore NuGet packages
run: nuget restore YongAnFrame.sln

- run: dotnet tool update -g docfx
- run: docfx docs/docfx.json

Expand Down
11 changes: 3 additions & 8 deletions .github/workflows/master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,24 +18,19 @@ jobs:

- name: Setup Dotnet
uses: actions/setup-dotnet@v4

- name: Setup NuGet
uses: NuGet/setup-nuget@v2

- name: Restore NuGet packages
run: nuget restore YongAnFrame.sln

- name: Restore dependencies
run: dotnet restore

- name: Build
run: dotnet build --no-restore
run: dotnet build --configuration Release

- name: Generate NuGet packages
run: nuget pack
run: dotnet pack

- name: Upload NuGet package
uses: actions/upload-artifact@v4
with:
name: nupkg
path: YongAnFrame.*.nupkg

3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -360,5 +360,4 @@ MigrationBackup/
.ionide/

# Fody - auto-generated XML schema
FodyWeavers.xsd
/nuget.exe
FodyWeavers.xsd
27 changes: 22 additions & 5 deletions Commands/ExpCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,36 @@
using Exiled.API.Features;
using Exiled.Permissions.Extensions;
using System;
using System.Linq;
using YongAnFrame.Extensions;

namespace YongAnFrame.Commands
{
/// <summary>
/// 玩家经验指令
/// </summary>
[CommandHandler(typeof(RemoteAdminCommandHandler))]
public class ExpCommand : ICommand
{
public string Command => "pexperience";

public string[] Aliases => ["pexp"];

/// <summary>
/// 主要指令名
/// </summary>
public string Command => "PlayerExp";
/// <summary>
/// 次要指令名
/// </summary>
public string[] Aliases => ["pexp","pe"];
/// <summary>
/// 指令描述
/// </summary>
public string Description => "用于经验的设置";

/// <summary>
/// 指令逻辑
/// </summary>
/// <param name="arguments">指令集</param>
/// <param name="sender">发送者</param>
/// <param name="response">原因</param>
/// <returns>是否运行成功</returns>
public bool Execute(ArraySegment<string> arguments, ICommandSender sender, out string response)
{
response = "NO";
Expand Down
23 changes: 12 additions & 11 deletions Commands/MessageCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@
using Exiled.Permissions.Extensions;
using System;
using System.Collections.Generic;
using YongAnFrame.Players;
using System.Runtime.ConstrainedExecution;
using YongAnFrame.Extensions;
using YongAnFrame.Features.Players;
using YongAnFrame.Features.UI.Enums;
using YongAnFrame.Features.UI.Texts;

namespace YongAnFrame.Commands
{
Expand All @@ -13,12 +17,13 @@ namespace YongAnFrame.Commands
[CommandHandler(typeof(RemoteAdminCommandHandler))]
public sealed class MessageCommand : ICommand
{
///<inheritdoc cref="ExpCommand.Command"/>
public string Command => "message";

public string[] Aliases => ["mes", "msg"];

///<inheritdoc cref="ExpCommand.Command"/>
public string[] Aliases => ["m", "msg"];
///<inheritdoc cref="ExpCommand.Aliases"/>
public string Description => "用于发送消息";

///<inheritdoc cref="ExpCommand.Execute"/>
public bool Execute(ArraySegment<string> arguments, ICommandSender sender, out string response)
{
List<FramePlayer> choicePlayer = [];
Expand Down Expand Up @@ -52,11 +57,7 @@ public bool Execute(ArraySegment<string> arguments, ICommandSender sender, out s

if (int.TryParse(idString, out int id))
{
FramePlayer yPlayer = FramePlayer.Get(id);
if (yPlayer != null)
{
choicePlayer.Add(yPlayer);
}
choicePlayer.Add(FramePlayer.Get(id));
}
break;
}
Expand All @@ -79,7 +80,7 @@ public bool Execute(ArraySegment<string> arguments, ICommandSender sender, out s

foreach (FramePlayer yPlayer in choicePlayer)
{
yPlayer.HintManager.MessageTexts.Add(new HintManager.Text($"[管理员发送]{arguments.Array[2]}", duration));
yPlayer.UI.MessageList.Add(new MessageText($"{arguments.Array[2]}", duration, MessageType.Admin));
}
response = "已成功运行";
return true;
Expand Down
26 changes: 16 additions & 10 deletions Commands/PlayerCommand.cs
Original file line number Diff line number Diff line change
@@ -1,33 +1,39 @@
using CommandSystem;
using Exiled.API.Features;
using System;
using YongAnFrame.Players;
using YongAnFrame.Extensions;
using YongAnFrame.Features.Players;

namespace YongAnFrame.Commands
{
/// <summary>
/// 框架玩家指令
/// </summary>
[CommandHandler(typeof(ClientCommandHandler))]
public class PlayerCommand : ICommand
{
public string Command => "hPlayer";

public string[] Aliases => ["hPlay", "hp", "h"];

///<inheritdoc cref="ExpCommand.Command"/>
public string Command => "FramePlayer";
///<inheritdoc cref="ExpCommand.Aliases"/>
public string[] Aliases => ["player", "fp" ,"p"];
///<inheritdoc cref="ExpCommand.Description"/>
public string Description => "用于管理自己的YongAnFrame用户";

///<inheritdoc cref="ExpCommand.Execute"/>
public bool Execute(ArraySegment<string> arguments, ICommandSender sender, out string response)
{
response = "NULL";
if (arguments.Count >= 1 && Player.TryGet(sender, out Player player))
{
FramePlayer fPlayer = FramePlayer.Get(player);
//FramePlayer fPlayer = player.ToFPlayer();
switch (arguments.Array[1])
{
case "BDNT":
fPlayer.HintManager.Clean();
fPlayer.ExPlayer.ShowHint($"<size=20>{YongAnFramePlugin.Instance.Translation.BypassDoNotTrack.Split('\n')}</size>", 10000f);
// 等待重置
//fPlayer.HintManager.Clean();
//fPlayer.ExPlayer.ShowHint($"<size=20>{YongAnFramePlugin.Instance.Translation.BypassDoNotTrack.Split('\n')}</size>", 10000f);
return true;
case "INFO":

return true;
}
}
Expand Down
46 changes: 33 additions & 13 deletions Commands/SkillCommand.cs
Original file line number Diff line number Diff line change
@@ -1,37 +1,57 @@
using CommandSystem;
using Exiled.API.Features;
using System;
using YongAnFrame.Players;
using YongAnFrame.Roles;
using YongAnFrame.Roles.Properties;
using YongAnFrame.Extensions;
using YongAnFrame.Features.Players;
using YongAnFrame.Features.Roles;
using YongAnFrame.Features.UI.Enums;
using YongAnFrame.Features.UI.Texts;

namespace YongAnFrame.Commands
{
/// <summary>
/// 未完成请勿乱用
/// 技能指令
/// </summary>
[CommandHandler(typeof(ClientCommandHandler))]
public sealed class SkillsCommand : ICommand
{
///<inheritdoc cref="ExpCommand.Command"/>
public string Command => "skills";

///<inheritdoc cref="ExpCommand.Aliases"/>
public string[] Aliases => ["sk"];

///<inheritdoc cref="ExpCommand.Description"/>
public string Description => "skills";

///<inheritdoc cref="ExpCommand.Execute"/>
public bool Execute(ArraySegment<string> arguments, ICommandSender sender, out string response)
{
response = "NO";

if (arguments.Count >= 1 && int.TryParse(arguments.Array[1], out int num) && Player.TryGet(sender, out Player player))
{
FramePlayer fPlayer = FramePlayer.Get(player);
if (fPlayer.CustomRolePlus != null && fPlayer.CustomRolePlus.Check(fPlayer, out CustomRolePlusProperties data))
FramePlayer fPlayer = player.ToFPlayer();

if (fPlayer.CustomRolePlus is not null && fPlayer.CustomRolePlus.Check(fPlayer, out CustomRolePlusData data))
{
SkillManager skillManager = data.SkillManagers[num];
skillManager.Run();
fPlayer.HintManager.MessageTexts.Add(new HintManager.Text($"技能[{skillManager.SkillProperties.Name}:{fPlayer.CustomRolePlus.GetType().GUID.ToString() + 10000}]已经发动,持续时间:{skillManager.SkillProperties.ActiveMaxTime}", skillManager.SkillProperties.ActiveMaxTime));
if (data.Skills == null)
{
response = "角色没有技能";
return false;
}

Skill skill = data.Skills[num];
if (skill.IsActive)
{
fPlayer.UI.MessageList.Add(new MessageText("技能正在持续", 5, MessageType.System));
}
else if (skill.IsBurial)
{
fPlayer.UI.MessageList.Add(new MessageText($"技能正在冷却(CD:{skill.BurialRemainingTime})", 5, MessageType.System));
}
else
{
skill.Run();
}

response = "OK";
return true;
}
Expand Down
Loading
Loading