Terraria.Player.HasBuff C# (CSharp) Method

HasBuff() public method

public HasBuff ( int type ) : int
type int
return int
        public int HasBuff(int type)
        {
            if (this.buffImmune[type])
                return -1;
            for (int index = 0; index < 22; ++index)
            {
                if (this.buffTime[index] >= 1 && this.buffType[index] == type)
                    return index;
            }
            return -1;
        }

Usage Example

Ejemplo n.º 1
5
        public override bool UseItem(Player player)
        {
            if (player.altFunctionUse == 2)
            {
                if (player.HasBuff(mod.BuffType("UnPowered")) >= 0)
                {

                }
                else
                {
                    player.AddBuff(mod.BuffType("PowerUnleash"), 1800);
                    player.AddBuff(mod.BuffType("UnPowered"), 7200);
                }
            }

            return true;
        }
All Usage Examples Of Terraria.Player::HasBuff
Player