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); } } } } } }
public void ScaleDebuffInterval(float mult) { foreach (var bonusPair in bonuses) { if (BuffUtils.IsDebuff(bonusPair.Key)) { bonusPair.Value.ScaleBuffInterval(mult); } } }
/// <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); }
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); }
private bool IsBuff(BonusType type) { return(!BuffUtils.IsDebuff(type)); }