Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

beta2和万圣节 #21

Merged
merged 2 commits into from
Oct 25, 2024
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
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -360,4 +360,5 @@ MigrationBackup/
.ionide/

# Fody - auto-generated XML schema
FodyWeavers.xsd
FodyWeavers.xsd
/nuget.exe
2 changes: 1 addition & 1 deletion Commands/ExpCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ namespace BAPlugin.Command
[CommandHandler(typeof(RemoteAdminCommandHandler))]
public class ExpCommand : ICommand
{
public string Command => "experience";
public string Command => "pexperience";

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

Expand Down
62 changes: 55 additions & 7 deletions Players/CustomPlayer.cs
Original file line number Diff line number Diff line change
@@ -1,21 +1,69 @@
namespace YongAnFrame.Players
using YongAnFrame.Roles;

namespace YongAnFrame.Players
{
public abstract class CustomPlayer(FramePlayer player)
{
/// <summary>
/// 拥有该实例的框架玩家
/// </summary>
public FramePlayer FramePlayer { get; private set; } = player;
/// <summary>
/// 是否有效
/// </summary>
public bool IsInvalid => FramePlayer == null;
public float ExpMultiplier { get { return FramePlayer.ExpMultiplier; } set { FramePlayer.ExpMultiplier = value; } }
public ulong Exp { get { return FramePlayer.Exp; } set { FramePlayer.Exp = value; } }
public ulong Level { get { return FramePlayer.Level; } set { FramePlayer.Level = value; } }
/// <summary>
/// 实例拥有的自定义角色
/// </summary>
public CustomRolePlus CustomRolePlus => FramePlayer.CustomRolePlus;
/// <summary>
/// 提示系统管理器
/// </summary>
public HintManager HintManager => FramePlayer.HintManager;
public PlayerTitle UsingTitles { get { return FramePlayer.UsingTitles; } set { FramePlayer.UsingTitles = value; } }
public PlayerTitle UsingRankTitles { get { return FramePlayer.UsingRankTitles; } set { FramePlayer.UsingRankTitles = value; } }
/// <summary>
/// 正在使用的主要自定义算法
/// </summary>
public ICustomAlgorithm CustomAlgorithm { get => FramePlayer.CustomAlgorithm; set=> FramePlayer.CustomAlgorithm = value; }
/// <summary>
/// 玩家等级
/// </summary>
public ulong Level { get => FramePlayer.Level; set => FramePlayer.Level = value; }
/// <summary>
/// 玩家经验
/// </summary>
public ulong Exp { get => FramePlayer.Exp; set => FramePlayer.Exp = value; }
/// <summary>
/// 玩家经验倍率
/// </summary>
public float ExpMultiplier { get => FramePlayer.ExpMultiplier; set => FramePlayer.ExpMultiplier = value; }
/// <summary>
/// 玩家批准绕过DNT
/// </summary>
public bool IsBDNT { get => FramePlayer.IsBDNT; set => FramePlayer.IsBDNT = value; }
/// <summary>
/// 正在使用的名称称号
/// </summary>
public PlayerTitle UsingTitles { get => FramePlayer.UsingTitles; set => FramePlayer.UsingTitles = value; }

/// <summary>
/// 正在使用的排名称号
/// </summary>
public PlayerTitle UsingRankTitles { get => FramePlayer.UsingRankTitles; set => FramePlayer.UsingRankTitles = value; }

/// <summary>
/// 添加经验
/// </summary>
/// <param name="exp">数值</param>
/// <param name="name">原因</param>
public void AddExp(ulong exp, string name = "未知原因")
{
FramePlayer.AddExp(exp, name);
}

/// <summary>
/// 调用后该实例会立刻无效<br/>
/// 调用后该实例会立刻无效<br/>
/// 调用后该实例会立刻无效
/// </summary>
public virtual void Invalid()
{
FramePlayer = null;
Expand Down
5 changes: 5 additions & 0 deletions Players/FramePlayer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,11 @@ internal FramePlayer(Player player)
Events.Handlers.FramePlayer.OnFramePlayerCreated(new FramePlayerCreatedEventArgs(this));
}

/// <summary>
/// 添加经验
/// </summary>
/// <param name="exp">数值</param>
/// <param name="name">原因</param>
public void AddExp(ulong exp, string name = "未知原因")
{
float globalExpMultiplier = YongAnFramePlugin.Instance.Config.GlobalExpMultiplier;
Expand Down
2 changes: 1 addition & 1 deletion Players/HintManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
string[] text = new string[36];

int used = 0;
text[used] = $"YongAnFrame 1.0.0-Beta1";
text[used] = $"YongAnFrame 1.0.0-Beta2";

if (fPlayer.ExPlayer.DoNotTrack && !fPlayer.IsBDNT)
{
Expand Down Expand Up @@ -108,7 +108,7 @@
Timing.KillCoroutines(coroutine);
}

public class Text(string text, float duration, int size = 0)

Check warning on line 111 in Players/HintManager.cs

View workflow job for this annotation

GitHub Actions / build

Parameter 'size' is unread.

Check warning on line 111 in Players/HintManager.cs

View workflow job for this annotation

GitHub Actions / build

Parameter 'size' is unread.

Check warning on line 111 in Players/HintManager.cs

View workflow job for this annotation

GitHub Actions / build

Parameter 'size' is unread.

Check warning on line 111 in Players/HintManager.cs

View workflow job for this annotation

GitHub Actions / build

Parameter 'size' is unread.
{
public string Content { get; private set; } = text;
public float Duration { get; internal set; } = duration;
Expand Down
5 changes: 5 additions & 0 deletions Players/ICustomAlgorithm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
{
public interface ICustomAlgorithm
{
/// <summary>
/// 获取升级所需要的经验
/// </summary>
/// <param name="level"></param>
/// <returns></returns>
public ulong GetNeedUpLevel(ulong level);
}
}
4 changes: 2 additions & 2 deletions Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,5 @@
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
//通过使用 "*",如下所示:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.9")]
[assembly: AssemblyFileVersion("1.0.0.9")]
[assembly: AssemblyVersion("1.0.0.10")]
[assembly: AssemblyFileVersion("1.0.0.10")]
2 changes: 1 addition & 1 deletion Roles/Properties/SkillProperties.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
namespace YongAnFrame.Roles.Properties
{
public struct SkillProperties(string name, string statement, string description, float activeMaxTime, float burialMaxTime, ItemType useItem = ItemType.Coin)
public readonly struct SkillProperties(string name, string statement, string description, float activeMaxTime, float burialMaxTime, ItemType useItem = ItemType.Coin)
{
/// <summary>
/// 技能名称
Expand Down
1 change: 0 additions & 1 deletion YongAnFrame.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,6 @@
<None Include="README.md" />
<None Include="YongAnFrame.nuspec" />
</ItemGroup>
<ItemGroup />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PostBuildEvent>
Expand Down
6 changes: 4 additions & 2 deletions YongAnFrame.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,21 @@
<package >
<metadata>
<id>$id$</id>
<version>1.0.0-beta1</version>
<version>1.0.0-beta2</version>
<title>$title$</title>
<authors>$author$</authors>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<requireLicenseAcceptance>true</requireLicenseAcceptance>
<license type="expression">LGPL-2.1-only</license>
<!-- <icon>icon.png</icon> -->
<readme>docs\README.md</readme>
<projectUrl>https://github.com/YongAn404/YongAnFrame</projectUrl>
<description>$description$</description>
<releaseNotes>$version$</releaseNotes>
<copyright>$copyright$</copyright>
<tags>EXILED SCPSL</tags>
</metadata>
<files>
<file src="README.md" target="docs\" />
<file src="lib\net48\SCPSLAudioApi.dll" target="lib/net48/SCPSLAudioApi.dll" />
</files>
</package>
13 changes: 5 additions & 8 deletions YongAnTool.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,12 @@ public static FramePlayer ToFPlayer(this Player p)

public static RefreshTeamType ToRefreshTeamType(this SpawnableTeamType stp)
{
switch (stp)
return stp switch
{
case SpawnableTeamType.ChaosInsurgency:
return RefreshTeamType.CI;
case SpawnableTeamType.NineTailedFox:
return RefreshTeamType.MTF;
default:
return RefreshTeamType.Start;
}
SpawnableTeamType.ChaosInsurgency => RefreshTeamType.CI,
SpawnableTeamType.NineTailedFox => RefreshTeamType.MTF,
_ => RefreshTeamType.Start,
};
}
}
}
Binary file removed nuget.exe
Binary file not shown.