/// <summary> /// Update the observable collections /// </summary> public void UpdateInventoryCategories() { Soldiers.Clear(); SeigeWeapons.Clear(); Treasures.Clear(); Buffs.Clear(); foreach (var gameItemQuantity in _inventory) { if (gameItemQuantity.GameItem is Soldier) { Soldiers.Add(gameItemQuantity); } if (gameItemQuantity.GameItem is SeigeWeapon) { SeigeWeapons.Add(gameItemQuantity); } if (gameItemQuantity.GameItem is Treasure) { Treasures.Add(gameItemQuantity); } if (gameItemQuantity.GameItem is Buff) { Buffs.Add(gameItemQuantity); } } }
/// <summary> /// Update the observable collections /// </summary> public void UpdateInventoryCategories() { Treasures.Clear(); Gems.Clear(); ArmorSet.Clear(); Buffs.Clear(); foreach (var gameItemQuantity in _inventory) { if (gameItemQuantity.GameItem is Treasure) { Treasures.Add(gameItemQuantity); } if (gameItemQuantity.GameItem is Gem) { Gems.Add(gameItemQuantity); } if (gameItemQuantity.GameItem is ArmorSet) { ArmorSet.Add(gameItemQuantity); } if (gameItemQuantity.GameItem is Buff) { Buffs.Add(gameItemQuantity); } } }
public void ApplyAuraJson(JToken json, bool buffs) { if (buffs) { lock (Buffs) { Buffs.Clear(); foreach (var auraJson in json.Children()) { var aura = new WoWAura(); aura.ApplyJson(auraJson); Buffs.Add(aura); } } } else { lock (Debuffs) { Debuffs.Clear(); foreach (var auraJson in json.Children()) { var aura = new WoWAura(); aura.ApplyJson(auraJson); Debuffs.Add(aura); } } } }
public void Despawn() { info.gameObject.SetActive(false); despawnTime -= Time.deltaTime; if (despawnTime <= 0) { Buffs.Clear(); this.gameObject.SetActive(false); } }
public void UseFountain() { CurrentHealth = MaxHealth; Team = new List <Entity> { this }; Buffs.Clear(); // TODO apply artifact buffs for (int i = Deck.Hand.Count - 1; i >= 0; i--) { Deck.Discard(Deck.Hand[i]); } Deck.Draws.AddRange(Deck.Discards); Deck.Shuffle(Deck.Draws); Deck.Discards = new List <Card>(); Deck.DrawCard(); Deck.DrawCard(); Deck.DrawCard(); }
public void Read(BinaryStreamReader reader) { var count = reader.ReadInt32(); Buffs.Clear(); for (var i = 0; i < count; i++) { var name = reader.ReadString(); var categoryAndId = (Buff.CategoryAndID)reader.ReadInt32(); var mode = (AttributeBuffMode)reader.ReadInt32(); var value = reader.ReadInt32(); Buffs.Add(new AttributeBuffWrapper { Name = name, AttributeID = Buff.AttributeIDFromBuffCategoryAndID(categoryAndId), Category = Buff.CategoryFromBuffCategoryAndID(categoryAndId), Mode = mode, Value = value, }); } }
protected override void Handle(BuffClearAll args) { App.QueueOnMainThread(() => Buffs.Clear()); }
public void ReadFormationUnitData(BinaryReader br) { IsHero = br.ReadBoolean(); Rank = br.ReadInt32(); Team = (Team)br.ReadInt32(); int statusCount = br.ReadInt32(); Character.InitializeBasicStatuses(Statuses); for (int i = 0; i < statusCount; i++) { var savedStatusType = (StatusType)br.ReadInt32(); Statuses[savedStatusType].ReadStatusData(br); } if (IsHero) { RosterId = br.ReadInt32(); CurrentMode = br.ReadString(); } else { IsCorpse = br.ReadBoolean(); OriginalClass = br.ReadString(); Class = br.ReadString(); Name = br.ReadString(); CurrentHp = br.ReadSingle(); int buffEntryCount = br.ReadInt32(); Buffs.Clear(); for (int i = 0; i < buffEntryCount; i++) { BuffSourceType buffSourceType = (BuffSourceType)br.ReadInt32(); if (buffSourceType == BuffSourceType.Adventure) { BuffInfo newBuffInfo = new BuffInfo((BuffDurationType)br.ReadInt32(), buffSourceType); newBuffInfo.OverridenValue = br.ReadSingle(); newBuffInfo.Duration = br.ReadInt32(); string buffId = br.ReadString(); if (buffId == "") { newBuffInfo.Buff = new Buff() { Id = "", ModifierValue = br.ReadSingle(), Type = (BuffType)br.ReadInt32(), AttributeType = (AttributeType)br.ReadInt32(), RuleType = (BuffRule)br.ReadInt32(), }; } else { newBuffInfo.Buff = DarkestDungeonManager.Data.Buffs[buffId]; } Buffs.Add(newBuffInfo); } } } CombatInfo = new FormationUnitInfo(); CombatInfo.ReadCombatInfoData(br); }