Beispiel #1
0
        private static void BuffAllCreepsToDropMoreGold()
        {
            var creeps = EntitiesRunner.Current.GetEntitiesOfType <Creep>();
            var payday = new BuffEffect("PiggyBankPayDayGoldMultiplier");

            foreach (var creep in creeps)
            {
                creep.ApplyBuff(payday);
            }
        }
Beispiel #2
0
        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));
        }
Beispiel #3
0
        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);
        }
Beispiel #4
0
 public void RemoveBuff(BuffEffect effect)
 {
     buffMultipliers /= effect.Multiplier;
     buffAdditions   -= effect.Addition;
 }
Beispiel #5
0
 public void ApplyBuff(BuffEffect effect)
 {
     buffMultipliers *= effect.Multiplier;
     buffAdditions   += effect.Addition;
 }