本文整理汇总了C#中MCPink.Player.HandleDeath方法的典型用法代码示例。如果您正苦于以下问题:C# Player.HandleDeath方法的具体用法?C# Player.HandleDeath怎么用?C# Player.HandleDeath使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MCPink.Player
的用法示例。
在下文中一共展示了Player.HandleDeath方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Use
public override void Use(Player p, string message)
{
if (message == "") { Help(p); return; }
Player who; string killMsg; int killMethod = 0;
if (message.IndexOf(' ') == -1)
{
who = Player.Find(message);
killMsg = " was killed by " + p.color + p.name;
}
else
{
who = Player.Find(message.Split(' ')[0]);
message = message.Substring(message.IndexOf(' ') + 1);
if (message.IndexOf(' ') == -1)
{
if (message.ToLower() == "explode")
{
killMsg = " was exploded by " + p.color + p.name;
killMethod = 1;
}
else
{
killMsg = " " + message;
}
}
else
{
if (message.Split(' ')[0].ToLower() == "explode")
{
killMethod = 1;
message = message.Substring(message.IndexOf(' ') + 1);
}
killMsg = " " + message;
}
}
if (who == null)
{
p.HandleDeath(Block.rock, " killed itself in its confusion");
Player.SendMessage(p, "Could not find player");
return;
}
if (who.group.Permission > p.group.Permission)
{
p.HandleDeath(Block.rock, " was killed by " + who.color + who.name);
Player.SendMessage(p, "Cannot kill someone of higher rank");
return;
}
if (killMethod == 1)
who.HandleDeath(Block.rock, killMsg, true);
else
who.HandleDeath(Block.rock, killMsg);
}