Пример #1
0
		private static void SetPaperCreepWetState(Creep creep)
		{
			StateChanger.MakeCreepWet(creep);
			StateChanger.MakeCreepImmuneToType(creep, TowerType.Slice);
			StateChanger.MakeCreepImmuneToType(creep, TowerType.Impact);
			StateChanger.MakeCreepNormalToType(creep, TowerType.Ice);
		}
Пример #2
0
		private static void SetClothCreepWetState(Creep creep)
		{
			StateChanger.MakeCreepWet(creep);
			StateChanger.MakeCreepHardBoiledToType(creep, TowerType.Impact);
			StateChanger.MakeCreepWeakToType(creep, TowerType.Ice);
			StateChanger.MakeCreepNormalToType(creep, TowerType.Slice);
		}
Пример #3
0
		public void DisplayCreepWalkingViaPathfinding()
		{
			var creep = new Creep(CreepType.Cloth, gameLevel.SpawnPoints[0]);
			var path =
				gameLevel.GetPath(gameLevel.SpawnPoints[0], gameLevel.GoalPoints[0]).GetListOfCoordinates();
			creep.Path = path.Select(element => element + Vector2D.Half).ToList();
		}
		private static void ComeBackToNormal(Creep creep)
		{
			creep.State.Burn = false;
			creep.State.Melt = false;
			creep.State.Enfeeble = false;
			StateChanger.MakeCreepSlowImmune(creep);
		}
Пример #5
0
		private static void SetAffectedByImpact(Creep creep)
		{
			StateChanger.MakeCreepLimitedSlow(creep);
			if (!creep.State.Frozen)
				return;
			StateChanger.CheckChanceForSudden(creep);
		}
		private static void SetAffectedByIce(Creep creep)
		{
			if (!creep.State.Burn)
				return;
			ComeBackToNormal(creep);
			StateChanger.MakeCreepResistantToType(creep, TowerType.Ice);
		}
Пример #7
0
		public void DrawingCreepCreatesCreepModel()
		{
			var creep = new Creep(CreepType.Cloth, Vector3D.Zero);
			creep.RenderModel();
			Assert.AreEqual(1, EntitiesRunner.Current.GetEntitiesOfType<Model>().Count);
			Assert.AreEqual(1, EntitiesRunner.Current.GetEntitiesOfType<Creep>().Count);
		}
Пример #8
0
		public void SetUp()
		{
			new Player();
			tower = new Tower(TowerType.Fire, Vector3D.Zero);
			creep = new Creep(CreepType.Cloth, Vector3D.Zero);
			adjustment = new StatAdjustment("TestAdjustment");
		}
Пример #9
0
		private static void SetWoodCreepWetState(Creep creep)
		{
			StateChanger.MakeCreepWet(creep);
			StateChanger.MakeCreepWeakToType(creep, TowerType.Slice);
			StateChanger.MakeCreepWeakToType(creep, TowerType.Impact);
			StateChanger.MakeCreepWeakToType(creep, TowerType.Ice);
		}
Пример #10
0
		public static void MakeCreepSlowImmune(Creep creep)
		{
			creep.State.SlowImmune = true;
			creep.State.SlowImmuneTimer = 0;
			creep.State.Slow = false;
			creep.StateIcon.Material = creep.EmptyMaterial;
		}
Пример #11
0
		public static void ChangeStatesIfGlassCreep(TowerType damageType, Creep creep)
		{
			if (damageType == TowerType.Fire)
				SetAffectedByFire(creep);
			else if (damageType == TowerType.Impact)
				SetAffectedByImpact(creep);
		}
		private static void SetAffectedByWater(Creep creep)
		{
			if (!creep.State.Burn)
				return;
			ComeBackToNormal(creep);
			StateChanger.MakeCreepHardBoiledToType(creep, TowerType.Water);
		}
Пример #13
0
		public void TestMeltState()
		{
			var creep = new Creep(CreepType.Cloth, Vector2D.Zero);
			var state = new CreepState();
			state.Melt = true;
			state.UpdateStateAndTimers(creep);
			Assert.IsTrue(state.Melt);
		}
Пример #14
0
		public void SetUp()
		{
			creep = new Creep(CreepType.Cloth, Vector2D.Zero)
			{
				Path = new List<Vector2D> { new Vector2D(1, 0), new Vector2D(2, 0) },
				FinalTarget = new Vector2D(2, 0)
			};
		}
Пример #15
0
		public void PerformBigFireworkAttack()
		{
			var creepOutsideRange = new Creep(CreepType.Paper, new Vector2D(4, 4));
			var creepInsideRange = new Creep(CreepType.Paper, new Vector2D(2, 2));
			player.Avatar.PerformAttack(AvatarAttack.PenguinBigFirework, new Vector2D(1, 1));
			Assert.AreEqual(1, creepOutsideRange.GetStatPercentage("Hp"));
			Assert.Less(creepInsideRange.GetStatPercentage("Hp"), 1);
		}
Пример #16
0
		public static void MakeCreepDelayed(Creep creep)
		{
			if(creep.State.Delayed)
				return;
			creep.State.Delayed = true;
			creep.State.DelayedTimer = 0;
			creep.TimeIcon.Material = ContentLoader.Load<Material>(CreepStates.SlowMat.ToString());
		}
Пример #17
0
		private static void SetAffectedByIce(Creep creep)
		{
			if (creep.State.Wet)
				StateChanger.MakeCreepFrozen(creep);
			creep.State.Burst = false;
			creep.State.Burn = false;
			creep.State.Fast = false;
		}
Пример #18
0
		public static void MakeCreepUnfreezable(Creep creep)
		{
			creep.State.Unfreezable = true;
			creep.State.UnfreezableTimer = 0;
			creep.State.Frozen = false;
			creep.State.Paralysed = false;
			creep.StateIcon.Material = creep.EmptyMaterial;
		}
Пример #19
0
		public void TriggeringPiggyBankPayDayMakesCreepsDropMoreGold()
		{
			var creep = new Creep(CreepType.Cloth, new Vector2D(0.5f, 1.5f));
			var gold = creep.GetStatValue("Gold");
			pig.PerformAttack(AvatarAttack.PiggyBankPayDay, Vector2D.Unused);
			AdvanceTimeAndUpdateEntities(4.9f);
			Assert.AreEqual(1.5f, creep.GetStatValue("Gold") / gold);
		}
Пример #20
0
		public void PiggyBankPayDayBuffLasts5Seconds()
		{
			var creep = new Creep(CreepType.Cloth, new Vector2D(0.5f, 1.5f));
			var gold = creep.GetStatValue("Gold");
			pig.PerformAttack(AvatarAttack.PiggyBankPayDay, Vector2D.Unused);
			AdvanceTimeAndUpdateEntities(5.1f);
			Assert.GreaterOrEqual(creep.GetStatValue("Gold"), gold);
		}
Пример #21
0
		public void PerformAuraCannonAttack()
		{
			var creepOutsideRange = new Creep(CreepType.Paper, new Vector2D(1, 4));
			var creepInsideRange = new Creep(CreepType.Paper, new Vector2D(2, 2));
			player.Avatar.PerformAttack(AvatarAttack.DragonAuraCannon, new Vector2D(1, 2));
			Assert.AreEqual(0.933f, creepOutsideRange.GetStatPercentage("Hp"), 0.001f);
			Assert.Less(creepInsideRange.GetStatPercentage("Hp"), 1);
			AdvanceTimeAndUpdateEntities(1.05f);
		}
Пример #22
0
		public void PerformBreathOfFireAttack()
		{
			var creepOutsideRange = new Creep(CreepType.Paper, new Vector2D(3, 3));
			var creepInsideRange = new Creep(CreepType.Paper, new Vector2D(2, 2));
			player.Avatar.PerformAttack(AvatarAttack.DragonBreathOfFire, new Vector2D(1, 1));
			Assert.AreEqual(1, creepOutsideRange.GetStatPercentage("Hp"));
			AdvanceTimeAndUpdateEntities(Dragon.BreathOfFireTimeTillImpact + 0.15f);
			Assert.Less(creepInsideRange.GetStatPercentage("Hp"), 1);
		}
Пример #23
0
		private static void SetAffectedByWater(Creep creep)
		{
			StateChanger.MakeCreepRust(creep);
			if (!creep.State.Melt)
				return;
			StateChanger.MakeCreepVulnerableToType(creep, TowerType.Water);
			StateChanger.MakeCreepHardBoiledToType(creep, TowerType.Slice);
			StateChanger.MakeCreepResistantToType(creep, TowerType.Impact);
		}
Пример #24
0
		private static void ChangeStartStatesIfWoodCreep(Creep creep)
		{
			creep.State.SetVulnerabilitiesToNormal();
			StateChanger.MakeCreepHardBoiledToType(creep, TowerType.Impact);
			StateChanger.MakeCreepWeakToType(creep, TowerType.Slice);
			StateChanger.MakeCreepWeakToType(creep, TowerType.Fire);
			StateChanger.MakeCreepWeakToType(creep, TowerType.Acid);
			StateChanger.MakeCreepWeakToType(creep, TowerType.Ice);
			StateChanger.MakeCreepImmuneToType(creep, TowerType.Water);
		}
Пример #25
0
		public void PerformCarpetBombingAttack()
		{
			new Level(new Size(5, 5));
			Randomizer.Use(new FixedRandom(new[] { 0.1f, 0.2f, 0.1f, 0.2f, 0.1f, 0.2f, 0.3f }));
			var missedCreep = new Creep(CreepType.Paper, new Vector2D(4, 4));
			var hitCreep = new Creep(CreepType.Paper, new Vector2D(0, 1));
			player.Avatar.PerformAttack(AvatarAttack.PenguinCarpetBombing, Vector2D.Unused);
			Assert.AreEqual(1, missedCreep.GetStatPercentage("Hp"));
			Assert.Less(hitCreep.GetStatPercentage("Hp"), 1);
		}
Пример #26
0
		private static void DamageCreepAndSurroundingCreeps(Tower tower, Creep target, 
			List<Creep> creepsWithinRange)
		{
			if (tower.AttackType == AttackType.Circle)
				DoRadiusAttack(tower, creepsWithinRange);
			else if (tower.AttackType == AttackType.Cone)
				DoConeAttack(tower, target, creepsWithinRange);
			//else if (tower.AttackType == AttackType.DirectShot)
			//	target.ReceiveAttack(tower.Type, tower.Power);
		}
Пример #27
0
		public void TestFrozenState()
		{
			var creep = new Creep(CreepType.Cloth, Vector2D.Zero);
			var state = new CreepState();
			state.Frozen = true;
			state.UpdateStateAndTimers(creep);
			Assert.IsTrue(state.Frozen);
			state.Unfreezable = true;
			state.UpdateStateAndTimers(creep);
			Assert.IsTrue(state.Unfreezable);
		}
Пример #28
0
		public void TestSlowImmuneState()
		{
			var creep = new Creep(CreepType.Cloth, Vector2D.Zero);
			var state = new CreepState();
			state.Slow = true;
			state.UpdateStateAndTimers(creep);
			Assert.IsTrue(state.Slow);
			state.SlowImmune = true;
			state.UpdateStateAndTimers(creep);
			Assert.IsTrue(state.SlowImmune);
		}
Пример #29
0
		public static void ChangeStatesIfIronCreep(TowerType damageType, Creep creep)
		{
			if (damageType == TowerType.Fire)
				SetAffectedByFire(creep);
			else if (damageType == TowerType.Acid)
				SetAffectedByAcid(creep);
			else if (damageType == TowerType.Water)
				SetAffectedByWater(creep);
			else if (damageType == TowerType.Ice)
				SetAffectedByIce(creep);
		}
Пример #30
0
		public static void ChangeStatesIfSandCreep(TowerType damageType, Creep creep) 
		{
			if (damageType == TowerType.Impact)
				SetAffectedByImpact(creep);
			else if (damageType == TowerType.Water)
				SetAffectedByWater(creep);
			else if (damageType == TowerType.Ice)
				SetAffectedByIce(creep);
			else if (damageType == TowerType.Fire)
				SetAffectedByFire(creep);
		}
Пример #31
0
 private static void SetAffectedByFire(Creep creep)
 {
     StateChanger.MakeCreepMelt(creep);
 }
Пример #32
0
 public static void MakeCreepEnfeeble(Creep creep)
 {
     creep.State.Enfeeble      = true;
     creep.State.EnfeebleTimer = 0;
 }
Пример #33
0
 public static void MakeCreepHealing(Creep creep)
 {
     creep.State.Healing = true;
 }
Пример #34
0
 public static void CheckChanceForSudden(Creep creep)
 {
     CheckChance(creep);
 }
Пример #35
0
 private static void MakeCreepResistantToFire(Creep creep)
 {
     creep.State.Burst = false;
     creep.State.Burn  = false;
     MakeCreepResistantToType(creep, TowerType.Fire);
 }
Пример #36
0
 public static void MakeCreepNormalToType(Creep creep, TowerType type)
 {
     creep.State.SetVulnerability(type, Vulnerability.Normal);
 }
Пример #37
0
 public static void MakeCreepHardBoiledToType(Creep creep, TowerType type)
 {
     creep.State.SetVulnerability(type, Vulnerability.HardBoiled);
 }
Пример #38
0
 public static void MakeCreepParalysed(Creep creep)
 {
     creep.State.Paralysed      = true;
     creep.State.ParalysedTimer = 0;
 }
Пример #39
0
 public static void MakeCreepBurst(Creep creep)
 {
     creep.State.Burst        = true;
     creep.State.BurstTimer   = 0;
     creep.StateIcon.Material = ContentLoader.Load <Material>(CreepStates.BurningMat.ToString());
 }
Пример #40
0
 public static void MakeCreepResistantToType(Creep creep, TowerType type)
 {
     creep.State.SetVulnerability(type, Vulnerability.Resistant);
 }
Пример #41
0
 public static void MakeCreepImmuneToType(Creep creep, TowerType type)
 {
     creep.State.SetVulnerability(type, Vulnerability.Immune);
 }
Пример #42
0
 public static void MakeCreepWeakToType(Creep creep, TowerType type)
 {
     creep.State.SetVulnerability(type, Vulnerability.Weak);
 }
Пример #43
0
 public static void MakeCreepFast(Creep creep)
 {
     creep.State.Fast        = true;
     creep.State.FastTimer   = 0;
     creep.TimeIcon.Material = creep.EmptyMaterial;
 }
Пример #44
0
 private static void SetAffectedByImpact(Creep creep)
 {
     StateChanger.CheckChanceForShatter(creep);
 }