本文整理汇总了C#中TShockAPI.TSPlayer.SetBuff方法的典型用法代码示例。如果您正苦于以下问题:C# TSPlayer.SetBuff方法的具体用法?C# TSPlayer.SetBuff怎么用?C# TSPlayer.SetBuff使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TShockAPI.TSPlayer
的用法示例。
在下文中一共展示了TSPlayer.SetBuff方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Event
// Event for the effect. Parameter function vary based on the type. Who is 0 (User) and 1 (target)
public static void Event(VSPlayer User, TSPlayer Target, EffectTypes type, int Parameter, int Parameter2 = 0,
int Who = 1, States setstate = States.NONE)
{
if (type.Equals(EffectTypes.BUFF))
{
try
{
if (Who == 0)
User.TSPlayer.SetBuff(Parameter, Parameter2 * 60, false);
else
Target.SetBuff(Parameter, Parameter2 * 60, false);
}
catch (Exception)
{
Log.ConsoleError("[VSSystem] A command has returned an error at Effect parameter: Invalid buff ID");
}
}
else if (type.Equals(EffectTypes.HEALSELF))
{
if (Who == 0)
User.TSPlayer.Heal(Parameter);
else
Target.Heal(Parameter);
}
else if (type.Equals(EffectTypes.TICKLE))
{
if (Who == 0)
{
if (VSSystem.ItemCheck(TShock.Utils.GetItemByName("Hand Warmer")[0].netID, User.TSPlayer))
{
User.TSPlayer.DamagePlayer(10000);
User.TSPlayer.TPlayer.KillMe(10000, 0, true, " was tickled to death for having Hand Warmer.");
}
else
User.TSPlayer.SetBuff(47, Parameter * 60, false);
}
else
{
if (VSSystem.ItemCheck(TShock.Utils.GetItemByName("Hand Warmer")[0].netID, Target))
{
Target.DamagePlayer(10000);
Target.TPlayer.KillMe(10000, 0, true, " was tickled to death for having Hand Warmer.");
}
else
Target.SetBuff(47, Parameter * 60, false);
}
}
else if (type.Equals(EffectTypes.STATE) && setstate != States.NONE)
{
if (Who == 0)
User.SetState(setstate, Parameter);
else
VSSystem.VSPlayers[Target.UserID].SetState(setstate, Parameter);
}
}