當前位置: 首頁>>代碼示例>>C#>>正文


C# Player.Kill方法代碼示例

本文整理匯總了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));
 }
開發者ID:727021,項目名稱:800craft,代碼行數:17,代碼來源:ExplodingPhysics.cs

示例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;
 }
開發者ID:EricKilla,項目名稱:LegendCraft,代碼行數:7,代碼來源:ParticleSystem.cs

示例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;
 }
開發者ID:727021,項目名稱:800craft,代碼行數:6,代碼來源:ParticleSystem.cs

示例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
             }
         }
     }
 }
開發者ID:venofox,項目名稱:AtomicCraft,代碼行數:32,代碼來源:ParticleSystem.cs


注:本文中的fCraft.Player.Kill方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。