Skip to content

Commit

Permalink
Merge pull request #139 from Controllerdestiny/main
Browse files Browse the repository at this point in the history
更新: Economics.RPG 添加/level reset 指令
  • Loading branch information
Controllerdestiny authored May 20, 2024
2 parents c115f91 + 04529fd commit 4f8f5f5
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 4 deletions.
15 changes: 15 additions & 0 deletions Economics.RPG/Command.cs
Original file line number Diff line number Diff line change
Expand Up @@ -88,4 +88,19 @@ public void ResetLevel(CommandArgs args)
if (RPG.Config.ResetKick)
args.Player.Disconnect("你因重置等级被踢出!");
}

[CommandMap("level", "economics.rpg.admin")]
public void Level(CommandArgs args)
{
if (args.Parameters.Count == 1 && args.Parameters[0].ToLower() == "reset")
{
RPG.PlayerLevelManager.RemoveAll();
args.Player.SendSuccessMessage("玩家等级信息重置成功!");
}
else
{
args.Player.SendErrorMessage("语法错误,正确语法:");
args.Player.SendErrorMessage("/level reset");
}
}
}
7 changes: 6 additions & 1 deletion Economics.RPG/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@
## 更新日志

```
暂无
V1.0.0.1
- 增加显示信息
- 添加/level reset指令
- 添加自定义消息玩家组
- 添加RPG聊天渐变色
```

## 指令
Expand All @@ -16,6 +20,7 @@
| -------------- | :-----------------: | :------: |
| /rank [职业名] | economics.rpg.rank | 升级 |
| /重置等级 | economics.rpg.reset | 重置职业 |
| /level reset | economics.rpg.admin | 重置 |

## 配置

Expand Down
4 changes: 3 additions & 1 deletion EconomicsAPI/Economics.cs
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,9 @@ private void OnKillMe(object? sender, GetDataHandlers.KillMeEventArgs e)
{
if (Setting.DeathDropRate >= 0)
{

var drop = CurrencyManager.GetUserCurrency(e.Player.Name) * Setting.DeathDropRate;
CurrencyManager.DelUserCurrency(e.Player.Name, Convert.ToInt64(drop));
e.Player.SendErrorMessage($"你因死亡掉落{drop:F0}{Setting.CurrencyName}!");
}
}

Expand Down
34 changes: 32 additions & 2 deletions EconomicsAPI/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,12 @@
## 更新日志

```
暂无
V2.0.0.0
- 添加扩展函数
- 添加显示消息API
- 添加渐变色消息API
- 自定义渐变色消息颜色
- 修复死亡掉落货币
```

## 指令
Expand All @@ -29,7 +34,32 @@
"显示收益": true,
"禁用雕像": false,
"死亡掉落率": 0.0,
"查询提示": "[c/FFA500:你当前拥有{0}{1}个]"
"显示信息": true,
"显示信息左移": 60,
"显示信息下移": 0,
"查询提示": "[c/FFA500:你当前拥有{0}{1}个]",
"渐变颜色": [
"[c/00ffbf:{0}]",
"[c/1aecb8:{0}]",
"[c/33d9b1:{0}]",
"[c/80a09c:{0}]",
"[c/998c95:{0}]",
"[c/b3798e:{0}]",
"[c/cc6687:{0}]",
"[c/e65380:{0}]",
"[c/ff4079:{0}]",
"[c/ed4086:{0}]",
"[c/db4094:{0}]",
"[c/9440c9:{0}]",
"[c/8240d7:{0}]",
"[c/7040e4:{0}]",
"[c/5e40f2:{0}]",
"[c/944eaa:{0}]",
"[c/b75680:{0}]",
"[c/db5d55:{0}]",
"[c/ed6040:{0}]",
"[c/ff642b:{0}]"
]
}
```
## 反馈
Expand Down

0 comments on commit 4f8f5f5

Please sign in to comment.