当前位置: 首页>>代码示例>>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;未经允许,请勿转载。