private static void SetPaperCreepWetState(Creep creep) { StateChanger.MakeCreepWet(creep); StateChanger.MakeCreepImmuneToType(creep, TowerType.Slice); StateChanger.MakeCreepImmuneToType(creep, TowerType.Impact); StateChanger.MakeCreepNormalToType(creep, TowerType.Ice); }
private static void SetClothCreepWetState(Creep creep) { StateChanger.MakeCreepWet(creep); StateChanger.MakeCreepHardBoiledToType(creep, TowerType.Impact); StateChanger.MakeCreepWeakToType(creep, TowerType.Ice); StateChanger.MakeCreepNormalToType(creep, TowerType.Slice); }
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); }
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); }
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); }
public void SetUp() { new Player(); tower = new Tower(TowerType.Fire, Vector3D.Zero); creep = new Creep(CreepType.Cloth, Vector3D.Zero); adjustment = new StatAdjustment("TestAdjustment"); }
private static void SetWoodCreepWetState(Creep creep) { StateChanger.MakeCreepWet(creep); StateChanger.MakeCreepWeakToType(creep, TowerType.Slice); StateChanger.MakeCreepWeakToType(creep, TowerType.Impact); StateChanger.MakeCreepWeakToType(creep, TowerType.Ice); }
public static void MakeCreepSlowImmune(Creep creep) { creep.State.SlowImmune = true; creep.State.SlowImmuneTimer = 0; creep.State.Slow = false; creep.StateIcon.Material = creep.EmptyMaterial; }
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); }
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); }
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) }; }
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); }
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()); }
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; }
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; }
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); }
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); }
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); }
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); }
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); }
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); }
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); }
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); }
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); }
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); }
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); }
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); }
private static void SetAffectedByFire(Creep creep) { StateChanger.MakeCreepMelt(creep); }
public static void MakeCreepEnfeeble(Creep creep) { creep.State.Enfeeble = true; creep.State.EnfeebleTimer = 0; }
public static void MakeCreepHealing(Creep creep) { creep.State.Healing = true; }
public static void CheckChanceForSudden(Creep creep) { CheckChance(creep); }
private static void MakeCreepResistantToFire(Creep creep) { creep.State.Burst = false; creep.State.Burn = false; MakeCreepResistantToType(creep, TowerType.Fire); }
public static void MakeCreepNormalToType(Creep creep, TowerType type) { creep.State.SetVulnerability(type, Vulnerability.Normal); }
public static void MakeCreepHardBoiledToType(Creep creep, TowerType type) { creep.State.SetVulnerability(type, Vulnerability.HardBoiled); }
public static void MakeCreepParalysed(Creep creep) { creep.State.Paralysed = true; creep.State.ParalysedTimer = 0; }
public static void MakeCreepBurst(Creep creep) { creep.State.Burst = true; creep.State.BurstTimer = 0; creep.StateIcon.Material = ContentLoader.Load <Material>(CreepStates.BurningMat.ToString()); }
public static void MakeCreepResistantToType(Creep creep, TowerType type) { creep.State.SetVulnerability(type, Vulnerability.Resistant); }
public static void MakeCreepImmuneToType(Creep creep, TowerType type) { creep.State.SetVulnerability(type, Vulnerability.Immune); }
public static void MakeCreepWeakToType(Creep creep, TowerType type) { creep.State.SetVulnerability(type, Vulnerability.Weak); }
public static void MakeCreepFast(Creep creep) { creep.State.Fast = true; creep.State.FastTimer = 0; creep.TimeIcon.Material = creep.EmptyMaterial; }
private static void SetAffectedByImpact(Creep creep) { StateChanger.CheckChanceForShatter(creep); }