public void PerformBuff()
		{
			var effect = new BuffEffect("TestHpBuff");
			var interaction = new Interaction(tower, creep, adjustment, effect);
			interaction.Apply();
			Assert.AreEqual(204.0f, creep.GetStatValue("Hp"));
		}
Exemple #2
0
		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 Constructor()
		{
			var effect = new BuffEffect("TestHpBuff");
			var interaction = new Interaction(tower, creep, adjustment, effect);
			Assert.AreEqual(tower, interaction.Source);
			Assert.AreEqual(creep, interaction.Target);
		}
		public void SettingsConstructor()
		{
			var goldBuff = new BuffEffect("TestGoldBuff");
			Assert.AreEqual("Gold", goldBuff.Attribute);
			Assert.AreEqual(2.0f, goldBuff.Multiplier);
			Assert.AreEqual(-3.0f, goldBuff.Addition);
			Assert.AreEqual(5.0f, goldBuff.Duration);
		}
Exemple #5
0
		public void Constructor()
		{
			var stat = new Stat(100.0f);
			var effect = new BuffEffect("TestGoldBuff");
			var buff = new Buff(stat, effect);
			Assert.AreEqual(stat, buff.Stat);
			Assert.AreEqual(effect, buff.Effect);
			Assert.AreEqual(0, buff.Elapsed);
		}
Exemple #6
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));
		}
Exemple #7
0
		public void Properties()
		{
			var stat = new Stat(100.0f);
			const float Elapsed = 4.0f;
			var effect = new BuffEffect("TestGoldBuff");
			var buff = new Buff(new Stat(0.0f), new BuffEffect("TestHpBuff"))
			{
				Stat = stat,
				Effect = effect,
				Elapsed = Elapsed
			};
			Assert.AreEqual(stat, buff.Stat);
			Assert.AreEqual(effect, buff.Effect);
			Assert.AreEqual(Elapsed, buff.Elapsed);
		}
		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);
		}
Exemple #9
0
 public void RemoveBuff(BuffEffect effect)
 {
     buffMultipliers /= effect.Multiplier;
     buffAdditions   -= effect.Addition;
 }
Exemple #10
0
 public void ApplyBuff(BuffEffect effect)
 {
     buffMultipliers *= effect.Multiplier;
     buffAdditions   += effect.Addition;
 }
Exemple #11
0
		public void RemoveBuff(BuffEffect effect)
		{
			buffMultipliers /= effect.Multiplier;
			buffAdditions -= effect.Addition;
		}
Exemple #12
0
		public void ApplyBuff(BuffEffect effect)
		{
			buffMultipliers *= effect.Multiplier;
			buffAdditions += effect.Addition;
		}