本文整理匯總了C#中Terraria_Server.NPC.AddBuff方法的典型用法代碼示例。如果您正苦於以下問題:C# NPC.AddBuff方法的具體用法?C# NPC.AddBuff怎麽用?C# NPC.AddBuff使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Terraria_Server.NPC
的用法示例。
在下文中一共展示了NPC.AddBuff方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: StatusNPC
/// <summary>
/// Add buff to npc
/// </summary>
/// <param name="type">Tyep of buff</param>
/// <param name="npc">NPC to add to</param>
public void StatusNPC(int type, NPC npc)
{
switch (type)
{
case 121:
if (Main.rand.Next(2) == 0)
npc.AddBuff(24, 180, false);
return;
case 122:
if (Main.rand.Next(10) == 0)
npc.AddBuff(24, 180, false);
return;
case 190:
if (Main.rand.Next(4) == 0)
npc.AddBuff(20, 420, false);
return;
case 217:
if(Main.rand.Next(5) == 0)
npc.AddBuff(24, 180, false);
return;
}
}
示例2: StatusNPC
public void StatusNPC(NPC npc)
{
switch (this.type)
{
case ProjectileType.ARROW_FIRE:
if (Main.rand.Next(3) == 0)
npc.AddBuff(24, 180, false);
break;
case ProjectileType.BALL_OF_FIRE:
if (Main.rand.Next(2) == 0)
npc.AddBuff(24, 300, false);
break;
case ProjectileType.FLAMARANG:
if (Main.rand.Next(5) == 0)
npc.AddBuff(24, 180, false);
break;
case ProjectileType.FLAMELASH:
if (Main.rand.Next(2) == 0)
npc.AddBuff(24, 240, false);
break;
case ProjectileType.SUNFURY:
if (Main.rand.Next(4) == 0)
npc.AddBuff(24, 180, false);
break;
case ProjectileType.CHAKRUM_THORN:
if (Main.rand.Next(5) == 0)
npc.AddBuff(20, 420, false);
break;
case ProjectileType.KNIFE_POISONED:
if (Main.rand.Next(2) == 0)
npc.AddBuff(20, 600, false);
break;
}
}
示例3: StatusNPC
public void StatusNPC(NPC npc)
{
switch (this.type)
{
case ProjectileType.N2_FIRE_ARROW:
if (Main.rand.Next(3) == 0)
npc.AddBuff(24, 180, false);
break;
case ProjectileType.N15_BALL_OF_FIRE:
if (Main.rand.Next(2) == 0)
npc.AddBuff(24, 300, false);
break;
case ProjectileType.N19_FLAMARANG:
if (Main.rand.Next(5) == 0)
npc.AddBuff(24, 180, false);
break;
case ProjectileType.N34_FLAMELASH:
if (Main.rand.Next(2) == 0)
npc.AddBuff(24, 240, false);
break;
case ProjectileType.N35_SUNFURY:
if (Main.rand.Next(4) == 0)
npc.AddBuff(24, 180, false);
break;
case ProjectileType.N33_THORN_CHAKRUM:
if (Main.rand.Next(5) == 0)
npc.AddBuff(20, 420, false);
break;
case ProjectileType.N54_POISONED_KNIFE:
if (Main.rand.Next(2) == 0)
npc.AddBuff(20, 600, false);
break;
case ProjectileType.N63_THE_DAO_OF_POW:
if (Main.rand.Next(2) == 0)
npc.AddBuff(31, 120, false);
break;
case ProjectileType.N85_FLAMES:
if (Main.rand.Next(2) == 0)
npc.AddBuff(24, 1200, false);
break;
case ProjectileType.N95_CURSED_FLAME:
if (Main.rand.Next(2) == 0)
npc.AddBuff(39, 420, false);
break;
case ProjectileType.N103_CURSED_ARROW:
if (Main.rand.Next(2) == 0)
npc.AddBuff(39, 420, false);
break;
case ProjectileType.N104_CURSED_BULLET:
if (Main.rand.Next(2) == 0)
npc.AddBuff(39, 420, false);
break;
case ProjectileType.N98_POISON_DART:
if (Main.rand.Next(2) == 0)
npc.AddBuff(20, 600, false);
break;
}
}
示例4: StatusNPC
/// <summary>
/// Add buff to npc
/// </summary>
/// <param name="type">Tyep of buff</param>
/// <param name="npc">NPC to add to</param>
public void StatusNPC(int type, NPC npc)
{
if (type == 121)
{
if (Main.rand.Next(2) == 0)
{
npc.AddBuff(24, 180, false);
return;
}
}
else
{
if (type == 122)
{
if (Main.rand.Next(10) == 0)
{
npc.AddBuff(24, 180, false);
return;
}
}
else
{
if (type == 190)
{
if (Main.rand.Next(4) == 0)
{
npc.AddBuff(20, 420, false);
return;
}
}
else
{
if (type == 217 && Main.rand.Next(5) == 0)
{
npc.AddBuff(24, 180, false);
}
}
}
}
}