Ejemplo n.º 1
0
		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"));
		}
Ejemplo n.º 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);
		}
Ejemplo n.º 3
0
		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);
		}
Ejemplo n.º 4
0
		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);
		}
Ejemplo n.º 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);
		}
Ejemplo n.º 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));
		}
Ejemplo n.º 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);
		}
Ejemplo n.º 8
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);
		}
Ejemplo n.º 9
0
 public void RemoveBuff(BuffEffect effect)
 {
     buffMultipliers /= effect.Multiplier;
     buffAdditions   -= effect.Addition;
 }
Ejemplo n.º 10
0
 public void ApplyBuff(BuffEffect effect)
 {
     buffMultipliers *= effect.Multiplier;
     buffAdditions   += effect.Addition;
 }
Ejemplo n.º 11
0
		public void RemoveBuff(BuffEffect effect)
		{
			buffMultipliers /= effect.Multiplier;
			buffAdditions -= effect.Addition;
		}
Ejemplo n.º 12
0
		public void ApplyBuff(BuffEffect effect)
		{
			buffMultipliers *= effect.Multiplier;
			buffAdditions += effect.Addition;
		}