本文整理匯總了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);
}
示例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);
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
示例12: OnHitByNPC
public virtual void OnHitByNPC(NPC npc, int damage, bool crit)
{
if (Main.rand.Next(4) == 0)
{
npc.AddBuff(BuffID.ShadowFlame, 200, true);
}
}
示例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);
}
示例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);
}
}
示例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);
}
}