本文整理匯總了C#中Terraria.Player.CountBuffs方法的典型用法代碼示例。如果您正苦於以下問題:C# Player.CountBuffs方法的具體用法?C# Player.CountBuffs怎麽用?C# Player.CountBuffs使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Terraria.Player
的用法示例。
在下文中一共展示了Player.CountBuffs方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: OnPlayerQuickBuff
public bool OnPlayerQuickBuff(Player player)
{
if (player.noItems) return true;
if (player.chest != -1)
{
int num2 = 0;
for (int i = 0; i < 40; i++)
{
Chest chest;
if (player.chest > -1)
{
chest = Main.chest[player.chest];
}
else if (player.chest == -2)
{
chest = player.bank;
}
else
{
chest = player.bank2;
}
if (player.CountBuffs() == 22) return true;
if (chest.item[i].stack > 0 && chest.item[i].type > 0 && chest.item[i].buffType > 0 && !chest.item[i].summon && chest.item[i].buffType != 90)
{
int num3 = chest.item[i].buffType;
bool flag = true;
for (int j = 0; j < 22; j++)
{
if (num3 == 27 && (player.buffType[j] == num3 || player.buffType[j] == 101 || player.buffType[j] == 102))
{
flag = false;
break;
}
if (player.buffType[j] == num3)
{
flag = false;
break;
}
if (Main.meleeBuff[num3] && Main.meleeBuff[player.buffType[j]])
{
flag = false;
break;
}
}
if (Main.lightPet[chest.item[i].buffType] || Main.vanityPet[chest.item[i].buffType])
{
for (int k = 0; k < 22; k++)
{
if (Main.lightPet[player.buffType[k]] && Main.lightPet[chest.item[i].buffType])
{
flag = false;
}
if (Main.vanityPet[player.buffType[k]] && Main.vanityPet[chest.item[i].buffType])
{
flag = false;
}
}
}
if (chest.item[i].mana > 0 && flag)
{
if (player.statMana >= (int)((float)chest.item[i].mana * player.manaCost))
{
player.manaRegenDelay = (int)player.maxRegenDelay;
player.statMana -= (int)((float)chest.item[i].mana * player.manaCost);
}
else
{
flag = false;
}
}
if (player.whoAmI == Main.myPlayer && chest.item[i].type == 603 && !Main.cEd)
{
flag = false;
}
if (num3 == 27)
{
num3 = Main.rand.Next(3);
if (num3 == 0)
{
num3 = 27;
}
if (num3 == 1)
{
num3 = 101;
}
if (num3 == 2)
{
num3 = 102;
}
}
if (flag)
{
num2 = chest.item[i].useSound;
int num4 = chest.item[i].buffTime;
if (num4 == 0)
{
num4 = 3600;
}
player.AddBuff(num3, num4, true);
//.........這裏部分代碼省略.........