示例#1
0
        public void OnBuffSetted(Buff buff, NebulaObject source)
        {
            if (source != null && noTarget && (nebulaObject.getItemType() != ItemType.Avatar))
            {
                if (BuffUtils.IsDebuff(buff.buffType))
                {
                    if (nebulaObject.IsBot())
                    {
                        var weap            = GetComponent <BaseWeapon>();
                        var character       = GetComponent <CharacterObject>();
                        var sourceCharacter = source.GetComponent <CharacterObject>();

                        if (weap != null && character != null && sourceCharacter != null)
                        {
                            var relation = character.RelationTo(sourceCharacter);

                            if (relation == FractionRelation.Enemy || relation == FractionRelation.Neutral)
                            {
                                SetTarget(source);
                            }
                        }
                    }
                }
            }
        }
示例#2
0
 public void ScaleDebuffInterval(float mult)
 {
     foreach (var bonusPair in bonuses)
     {
         if (BuffUtils.IsDebuff(bonusPair.Key))
         {
             bonusPair.Value.ScaleBuffInterval(mult);
         }
     }
 }
示例#3
0
 /// <summary>
 /// Complete block debuf action. Check if we has buff on block debuff and than remove this buff from list
 /// </summary>
 /// <param name="buff"></param>
 /// <returns></returns>
 private bool IsDebuffBlocked(Buff buff)
 {
     if (BuffUtils.IsDebuff(buff.buffType))
     {
         var bonus = GetBonus(BonusType.block_debuff);
         if (bonus != null && Mathf.NotEqual(bonus.value, 0.0f))
         {
             bonus.Clear();
             return(true);
         }
     }
     return(false);
 }
示例#4
0
        public ConcurrentBag <BuffInfo> GetAllDebuffInfo()
        {
            ConcurrentBag <BuffInfo> result = new ConcurrentBag <BuffInfo>();

            foreach (var pBonus in bonuses)
            {
                if (BuffUtils.IsDebuff(pBonus.Key))
                {
                    foreach (var pBuff in pBonus.Value.GetBuffInfoCollection())
                    {
                        result.Add(pBuff);
                    }
                }
            }
            return(result);
        }
示例#5
0
 private bool IsBuff(BonusType type)
 {
     return(!BuffUtils.IsDebuff(type));
 }