本文整理匯總了C#中fCraft.Player.Kill方法的典型用法代碼示例。如果您正苦於以下問題:C# Player.Kill方法的具體用法?C# Player.Kill怎麽用?C# Player.Kill使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類fCraft.Player
的用法示例。
在下文中一共展示了Player.Kill方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: HitPlayer
public void HitPlayer(World world, Player hitted, Player by)
{
if (by == null)
{
if (MineField.Failed != null && !MineField.Failed.Contains(hitted))
{
hitted.Kill(world, String.Format("{0}&S was torn to pieces and lost the game!", hitted.ClassyName));
if (MineField.PlayerBlowUpCheck(hitted))
{
hitted.Message("&WYou lost the game! You are now unable to win.");
}
return;
}
else return;
}
hitted.Kill(world, String.Format("{0}&S was torn to pieces by {1}", hitted.ClassyName, hitted.ClassyName==by.ClassyName?"theirself":by.ClassyName));
}
示例2: HitPlayer
public void HitPlayer(World world, Vector3I pos, Player hitted, Player by, ref int restDistance, IList<BlockUpdate> updates)
{
hitted.Kill(world, String.Format("{0}&S was torn to pieces by {1}", hitted.ClassyName, hitted.ClassyName == by.ClassyName ? "theirself" : by.ClassyName));
updates.Add(new BlockUpdate(null, pos, Block.TNT));
world.AddPhysicsTask(new TNTTask(world, pos, by, false, true), 0);
restDistance = 0;
}
示例3: HitPlayer
public void HitPlayer(World world, Vector3I pos, Player hitted, Player by, ref int restDistance, IList<BlockUpdate> updates)
{
hitted.Kill(world, String.Format("{0}&S was shot by {1}", hitted.ClassyName, hitted.ClassyName == by.ClassyName ? "theirself" : by.ClassyName));
updates.Add(new BlockUpdate(null, pos, Block.Air));
restDistance = 0;
}
示例4: HitPlayer
public void HitPlayer(World world, Vector3I pos, Player hitted, Player by, ref int restDistance, IList<BlockUpdate> updates)
{
if ((hitted.Info.isOnBlueTeam && by.Info.isOnBlueTeam) || (hitted.Info.isOnRedTeam && by.Info.isOnRedTeam))
{
by.Message("{0} is on your team!", hitted.ClassyName);
}
else
{
hitted.Kill(world, String.Format("{0}&S was shot by {1}", hitted.ClassyName, hitted.ClassyName == by.ClassyName ? "theirself" : by.ClassyName));
updates.Add(new BlockUpdate(null, pos, Block.Air));
restDistance = 0;
if (TeamDeathMatch.isOn)
{
if (hitted.Info.isPlayingTD && hitted.Info.isOnBlueTeam && by.Info.isPlayingTD) //if the player is playing TD and on blue team, +1 for Red Team Score
{
TeamDeathMatch.redScore++;
hitted.Info.gameDeaths++;
hitted.Info.totalDeathsTDM++;
by.Info.gameKills++;
by.Info.totalKillsTDM++;
}
if (hitted.Info.isPlayingTD && hitted.Info.isOnRedTeam && by.Info.isPlayingTD) //if the player is playing TD and on blue team, +1 for Red Team Score
{
TeamDeathMatch.blueScore++;
hitted.Info.gameDeaths++; //counts the individual players deaths
hitted.Info.totalDeathsTDM++; //tallies total TDM deaths (never gets reset)
by.Info.gameKills++; //counts the individual players amount of kills
by.Info.totalKillsTDM++; //tallies total TDM kills
}
}
}
}