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


C# NPC.AddBuff方法代碼示例

本文整理匯總了C#中Terraria.NPC.AddBuff方法的典型用法代碼示例。如果您正苦於以下問題:C# NPC.AddBuff方法的具體用法?C# NPC.AddBuff怎麽用?C# NPC.AddBuff使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Terraria.NPC的用法示例。


在下文中一共展示了NPC.AddBuff方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: OnHitNPC

 public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit)
 {
     target.AddBuff(BuffID.OnFire, 10);
     target.AddBuff(BuffID.Electrified, 3);
     target.AddBuff(BuffID.Venom, 5);
     target.AddBuff(BuffID.CursedInferno, 4);
 }
開發者ID:MountainDrew8,項目名稱:CalamityMod,代碼行數:7,代碼來源:CataclysmicTerrorBlade.cs

示例2: OnHitNPC

 public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit)
 {
     target.AddBuff(BuffID.CursedInferno, 3);
     target.AddBuff(BuffID.Frostburn, 2);
     target.AddBuff(BuffID.Frozen, 1);
     target.AddBuff(BuffID.Chilled, 20);
     target.AddBuff(BuffID.OnFire, 10);
 }
開發者ID:MountainDrew8,項目名稱:CalamityMod,代碼行數:8,代碼來源:Terratomere.cs

示例3: OnHitNPC

 public override void OnHitNPC(NPC target, int damage, float knockback, bool crit)
 {
     if (Main.rand.Next(8) == 0)
     {
         target.AddBuff(BuffID.CursedInferno, 200, true);
         target.AddBuff(BuffID.OnFire, 200, true);
         target.AddBuff(BuffID.Frostburn, 200, true);
     }
 }
開發者ID:ColinAV516,項目名稱:Spirit-Mod,代碼行數:9,代碼來源:GeodeStaveProjectile.cs

示例4: OnHitNPC

 public override void OnHitNPC(Player player, NPC target, int damage, float knockBack, bool crit)
 {
     if (player.altFunctionUse == 2)
     {
         target.AddBuff(BuffID.Ichor, 60);
     }
     else
     {
         target.AddBuff(BuffID.OnFire, 60);
     }
 }
開發者ID:bluemagic123,項目名稱:tModLoader,代碼行數:11,代碼來源:ExampleDualUseWeapon.cs

示例5: OnHitNPC

		public override void OnHitNPC(NPC target, int damage, float knockback, bool crit)
		{
			if (Main.rand.Next(2) == 0)
			{
				target.AddBuff(mod.BuffType("EtherealFlames"), 300);
			}
		}
開發者ID:DrakoGlyph,項目名稱:tModLoader,代碼行數:7,代碼來源:Wisp.cs

示例6: OnHitNPC

        public override void OnHitNPC(NPC target, int damage, float knockback, bool crit)
        {
            if (Main.rand.Next(10) == 0) // 10% chance to inflict slow on an enemy.
                target.AddBuff(BuffID.Slow, 5);

            base.OnHitNPC(target, damage, knockback, crit);
        }
開發者ID:Eldrazi,項目名稱:Gyrolite,代碼行數:7,代碼來源:Streambolt.cs

示例7: OnHitNPC

 public override void OnHitNPC(NPC target, int damage, float knockback, bool crit)
 {
     if (Main.rand.Next(8) == 0)
     {
         target.AddBuff(BuffID.Confused, 240, true);
     }
 }
開發者ID:ColinAV516,項目名稱:Spirit-Mod,代碼行數:7,代碼來源:TaoP.cs

示例8: OnHitNPC

 public override void OnHitNPC(NPC target, int damage, float knockback, bool crit)
 {
     if (Main.rand.Next(25) == 0)
     {
         target.AddBuff(BuffID.BrokenArmor, 200, true);
     }
 }
開發者ID:ColinAV516,項目名稱:Spirit-Mod,代碼行數:7,代碼來源:IronShurikenProjectile.cs

示例9: OnHitNPC

 public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit)
 {
     if(Main.rand.Next(2) == 0)
     {
         target.AddBuff(BuffID.OnFire, 500);
     }
 }
開發者ID:rpetit3-fun,項目名稱:terraria-plus-one,代碼行數:7,代碼來源:FieryGreatswordPlusOne.cs

示例10: OnHitNPC

 public override void OnHitNPC(NPC target, int damage, float knockback, bool crit)
 {
     if (Main.rand.Next(0) == 0)
     {
         target.AddBuff(mod.BuffType("ElectrifiedV2"), 540, true);
     }
 }
開發者ID:ColinAV516,項目名稱:Spirit-Mod,代碼行數:7,代碼來源:TeslaSpikeProjectile.cs

示例11: OnHitNPC

 public override void OnHitNPC(NPC target, int damage, float knockback, bool crit)
 {
     switch ((int)projectile.ai[0])
     {
         case 1:
             target.AddBuff(BuffID.OnFire, 300); // 5 second debuff
             break;
         case 2:
             target.AddBuff(BuffID.Frostburn, 300); // 5 second debuff
             break;
         case 3:
             target.AddBuff(BuffID.CursedInferno, 300); // 5 second debuff
             break;
     }
     base.OnHitNPC(target, damage, knockback, crit);
 }
開發者ID:Eldrazi,項目名稱:Gyrolite,代碼行數:16,代碼來源:AjiwrenchMinion.cs

示例12: OnHitByNPC

 public virtual void OnHitByNPC(NPC npc, int damage, bool crit)
 {
     if (Main.rand.Next(4) == 0)
     {
         npc.AddBuff(BuffID.ShadowFlame, 200, true);
     }
 }
開發者ID:ColinAV516,項目名稱:Spirit-Mod,代碼行數:7,代碼來源:DuskHood.cs

示例13: DamageNPC

        /// <summary>
        /// When an <see cref="NPC" /> is damaged by the <see cref="Projectile" />.
        /// </summary>
        /// <param name="n">The <see cref="NPC" /> that got damaged.</param>
        /// <param name="dir">In which direction the <see cref="NPC"/> got hit.</param>
        /// <param name="dmg">The damage dealt to the <see cref="NPC" />.</param>
        /// <param name="kb">The knockback the <see cref="NPC" /> wil receive.</param>
        /// <param name="crit">Wether it was a critical hit or not.</param>
        /// <param name="cMult">The damage multiplier of a critical hit.</param>
        public override void DamageNPC(NPC n, int dir, ref int dmg, ref float kb, ref bool crit, ref float cMult)
        {
            base.DamageNPC(n, dir, ref dmg, ref kb, ref crit, ref cMult);

            if (Main.rand.Next(3) == 0)
                n.AddBuff(20, 300);
        }
開發者ID:RainbowDashGaming,項目名稱:Terraria-Avalon-MODIFIED,代碼行數:16,代碼來源:Sporalash+Ball.cs

示例14: OnHitNPC

		public override void OnHitNPC(NPC target, int damage, float knockback, bool crit)
		{
			if (Main.rand.Next(10) == 0)
			{
				target.AddBuff(BuffID.OnFire, 180, false);
			}
		}
開發者ID:DrakoGlyph,項目名稱:tModLoader,代碼行數:7,代碼來源:MoltenDrill.cs

示例15: OnHitNPC

 public override void OnHitNPC(NPC target, int damage, float knockback, bool crit)
 {
     if (Main.rand.Next(2) == 0)
     {
         target.AddBuff(BuffID.CursedInferno, 60, false);
     }
 }
開發者ID:ColinAV516,項目名稱:Spirit-Mod,代碼行數:7,代碼來源:PestilantShurikenProjectile.cs


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