public Buff AddBuffStack(BuffTypeVO buffType, ArmorType armorType, BuffVisualPriority visualPriority) { int num = this.FindBuff(buffType.BuffID); Buff buff; if (num < 0) { buff = new Buff(buffType, armorType, visualPriority); buff.AddStack(); this.Buffs.Add(buff); if (this.sleepState == BuffSleepState.Sleeping) { this.sleepState = BuffSleepState.Awake; } this.SendBuffEvent(EventId.AddedBuff, buff); } else { buff = this.Buffs[num]; if (buffType.Lvl > buff.BuffType.Lvl) { buff.UpgradeBuff(buffType); } buff.AddStack(); } this.OnBuffStackAdded(); return(buff); }
public void AddAppliedBuff(BuffTypeVO buffVO, BuffVisualPriority visualPriority) { int num = this.FindSpecialAttackBuff(buffVO.BuffID); Buff buff; if (num < 0) { buff = new Buff(buffVO, ArmorType.FlierVehicle, visualPriority); buff.AddStack(); this.SpecialAttackBuffs.Add(buff); return; } buff = this.SpecialAttackBuffs[num]; if (buffVO.Lvl > buff.BuffType.Lvl) { buff.UpgradeBuff(buffVO); } buff.AddStack(); }
public Buff AddBuffStack(BuffTypeVO buffType, ArmorType armorType, BuffVisualPriority visualPriority, SmartEntity originator) { int num = this.FindBuff(buffType.BuffID); Buff buff; if (num < 0) { buff = new Buff(buffType, armorType, visualPriority); buff.AddStack(); this.Buffs.Add(buff); if (this.sleepState == BuffSleepState.Sleeping) { this.sleepState = BuffSleepState.Awake; } if (!buff.BuffData.ContainsKey("originator")) { buff.BuffData.Add("originator", originator); } else { buff.BuffData["originator"] = originator; } this.SendBuffEvent(EventId.AddedBuff, buff); } else { buff = this.Buffs[num]; if (buffType.Lvl > buff.BuffType.Lvl) { buff.UpgradeBuff(buffType); } buff.BuffData["originator"] = originator; buff.AddStack(); } this.OnBuffStackAdded(); return(buff); }