using System;
namespace Oxide.Plugins
{
public class XMLuckyValueAPI
{
/*
* XMLuckyValue API 文档
* 作者: 熊猫君www.rustsb.com
* 版本: 1.0.2
*/
#region API Methods
/*
* 获取玩家的幸运值
*
* @param userId - 玩家的Steam ID (字符串格式)
* @return 玩家的幸运值数量
*
* 示例:
* int luckyValue = XMLuckyValue?.Call<int>("GetLuckyValue", player.UserIDString);
*/
private int GetLuckyValue(string userId) { return 0; }
/*
* 增加玩家的幸运值
*
* @param userId - 玩家的Steam ID (字符串格式)
* @param amount - 要增加的幸运值数量
*
* 示例:
* XMLuckyValue?.Call("AddLuckyValue", player.UserIDString, 10);
*/
private void AddLuckyValue(string userId, int amount) { }
/*
* 扣除玩家的幸运值
*
* @param userId - 玩家的Steam ID (字符串格式)
* @param amount - 要扣除的幸运值数量
*
* 示例:
* XMLuckyValue?.Call("DeductLuckyValue", player.UserIDString, 5);
*/
private void DeductLuckyValue(string userId, int amount) { }
/*
* 添加UI显示项到幸运值界面
*
* @param title - 显示的标题
* @param subtitle - 显示的副标题
* @param requiredValue - 需要达到的幸运值
* @param pluginName - 添加此UI项的插件名称
*
* 示例:
* XMLuckyValue?.Call("AddUIItem", "抽奖奖励", "达到10点幸运值可抽奖", 10, Name);
*/
private void AddUIItem(string title, string subtitle, int requiredValue, string pluginName) { }
/*
* 移除指定插件添加的所有UI显示项
*
* @param pluginName - 插件名称
*
* 示例:
* XMLuckyValue?.Call("RemoveUIItems", Name);
*/
private void RemoveUIItems(string pluginName) { }
#endregion
#region Hooks
/*
* 当玩家幸运值改变时触发
*
/*
*/
param player - 玩家对象
param oldValue - 改变前的幸运值
param newValue - 改变后的幸运值
/*
*/
*
* Hook示例:
* void OnLuckyValueChanged(BasePlayer player, int oldValue, int newValue)
* {
* Puts($"玩家 {player.displayName} 的幸运值从 {oldValue} 变为 {newValue}");
* }
*/
/*
* 当玩家幸运值增加时触发
*
/*
*/
param player - 玩家对象
param amount - 增加的数量
/*
*/
*
* Hook示例:
* void OnLuckyValueAdded(BasePlayer player, int amount)
* {
* Puts($"玩家 {player.displayName} 增加了 {amount} 点幸运值");
* }
*/
/*
* 当玩家幸运值扣除时触发
*
/*
*/
param player - 玩家对象
param amount - 扣除的数量
/*
*/
*
* Hook示例:
* void OnLuckyValueDeducted(BasePlayer player, int amount)
* {
* Puts($"玩家 {player.displayName} 扣除了 {amount} 点幸运值");
* }
*/
#endregion
#region 使用示例
/*
* 插件引用声明:
* [PluginReference]
* private Plugin XMLuckyValue;
*
* 完整使用示例:
*
* // 获取幸运值
* int luckyValue = XMLuckyValue?.Call<int>("GetLuckyValue", player.UserIDString) ?? 0;
*
* // 增加幸运值
* XMLuckyValue?.Call("AddLuckyValue", player.UserIDString, 10);
*
* // 扣除幸运值
* XMLuckyValue?.Call("DeductLuckyValue", player.UserIDString, 5);
*
* // 添加UI显示项
* XMLuckyValue?.Call("AddUIItem", "抽奖奖励", "达到10点幸运值可抽奖", 10, Name);
*
* // 移除UI显示项
* XMLuckyValue?.Call("RemoveUIItems", Name);
*
* // Hook示例
* void OnLuckyValueChanged(BasePlayer player, int oldValue, int newValue)
* {
* Puts($"玩家 {player.displayName} 的幸运值从 {oldValue} 变为 {newValue}");
* }
*/
#endregion
}
}