private static void BuffAllCreepsToDropMoreGold() { var creeps = EntitiesRunner.Current.GetEntitiesOfType <Creep>(); var payday = new BuffEffect("PiggyBankPayDayGoldMultiplier"); foreach (var creep in creeps) { creep.ApplyBuff(payday); } }
public void ApplyBuff(BuffEffect effect) { if (effect.Attribute == null) { return; } Stat buffedStat; if (!Stats.TryGetValue(effect.Attribute, out buffedStat)) { return; } buffedStat.ApplyBuff(effect); buffs.Add(new Buff(buffedStat, effect)); }
private static void SetUnreacheableTile(this GameLevel level, Vector2D position, TowerType type) { var pathfinding = level.GetPathFinding(); var index = (int)(position.X + position.Y * level.Size.Width); level.MapData[index] = LevelTileType.Blocked; pathfinding.SetUnreachableAndUpdate(index); var towerProperties = ContentLoader.Load <TowerPropertiesXml>(Xml.TowerProperties.ToString()); var buff = new BuffEffect(Player.Current.Avatar.GetType().Name + "RangeMultiplier"); var range = towerProperties.Get(type).Range; range *= buff.Multiplier > 0.0f ? buff.Multiplier : 1.0f; pathfinding.UpdateWeightInAdjacentNodes(position, (int)range, 100); }
public void RemoveBuff(BuffEffect effect) { buffMultipliers /= effect.Multiplier; buffAdditions -= effect.Addition; }
public void ApplyBuff(BuffEffect effect) { buffMultipliers *= effect.Multiplier; buffAdditions += effect.Addition; }