示例#1
0
		public static void MakeCreepSlowImmune(Creep creep)
		{
			creep.State.SlowImmune = true;
			creep.State.SlowImmuneTimer = 0;
			creep.State.Slow = false;
			creep.StateIcon.Material = creep.EmptyMaterial;
		}
		private static void SetAffectedByIce(Creep creep)
		{
			if (!creep.State.Burn)
				return;
			ComeBackToNormal(creep);
			StateChanger.MakeCreepResistantToType(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);
		}
		private static void SetAffectedByWater(Creep creep)
		{
			if (!creep.State.Burn)
				return;
			ComeBackToNormal(creep);
			StateChanger.MakeCreepHardBoiledToType(creep, TowerType.Water);
		}
		private static void SetWoodCreepWetState(Creep creep)
		{
			StateChanger.MakeCreepWet(creep);
			StateChanger.MakeCreepWeakToType(creep, TowerType.Slice);
			StateChanger.MakeCreepWeakToType(creep, TowerType.Impact);
			StateChanger.MakeCreepWeakToType(creep, TowerType.Ice);
		}
		private static void ComeBackToNormal(Creep creep)
		{
			creep.State.Burn = false;
			creep.State.Melt = false;
			creep.State.Enfeeble = false;
			StateChanger.MakeCreepSlowImmune(creep);
		}
		private static void SetPaperCreepWetState(Creep creep)
		{
			StateChanger.MakeCreepWet(creep);
			StateChanger.MakeCreepImmuneToType(creep, TowerType.Slice);
			StateChanger.MakeCreepImmuneToType(creep, TowerType.Impact);
			StateChanger.MakeCreepNormalToType(creep, TowerType.Ice);
		}
		public static void ChangeStatesIfGlassCreep(TowerType damageType, Creep creep)
		{
			if (damageType == TowerType.Fire)
				SetAffectedByFire(creep);
			else if (damageType == TowerType.Impact)
				SetAffectedByImpact(creep);
		}
		private static void SetAffectedByImpact(Creep creep)
		{
			StateChanger.MakeCreepLimitedSlow(creep);
			if (!creep.State.Frozen)
				return;
			StateChanger.CheckChanceForSudden(creep);
		}
示例#10
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());
		}
示例#11
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;
		}
		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;
		}
		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 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 ChangeStatesIfWoodCreep(TowerType damageType, Creep creep)
		{
			if (damageType == TowerType.Fire)
				SetAffectedByFire(creep);
			else if (damageType == TowerType.Impact)
				SetAffectedByImpact(creep);
			else if (damageType == TowerType.Water)
				SetAffectedByWater(creep);
			else if (damageType == TowerType.Ice)
				SetAffectedByIce(creep);
		}
		private static void SetAffectedByIce(Creep creep)
		{
			if (creep.State.Wet)
				StateChanger.MakeCreepFrozen(creep);
			else if (creep.State.Burst)
			{
				creep.State.Burst = false;
				creep.State.Burn = false;
				creep.State.Fast = false;
				ChangeStartStatesIfWoodCreep(creep);
			}
		}
		private static void SetAffectedByFire(Creep creep)
		{
			if (creep.State.Wet)
				creep.State.Wet = false;
			else if (creep.State.Frozen)
			{
				creep.State.Frozen = false;
				StateChanger.MakeCreepUnfreezable(creep);
				StateChanger.MakeCreepWet(creep);
			}
			else
				TransformInGlassCreep(creep);
		}
		private static void SetAffectedByWater(Creep creep)
		{
			if (creep.State.Burst)
			{
				creep.State.Burst = false;
				creep.State.Fast = false;
				ChangeStartStatesIfWoodCreep(creep);
			}
			else
			{
				SetWoodCreepWetState(creep);
				StateChanger.MakeCreepHealing(creep);
			}
		}
示例#20
0
		public static void MakeCreepFrozen(Creep creep)
		{
			if (creep.State.Unfreezable)
				return;
			creep.State.Frozen = true;
			creep.State.FrozenTimer = 0;
			creep.StateIcon.Material = ContentLoader.Load<Material>(CreepStates.FrozenMat.ToString());
			MakeCreepParalysed(creep);
			MakeCreepResistantToType(creep, TowerType.Slice);
			creep.State.Wet = false;
			MakeCreepResistantToType(creep, TowerType.Water);
			MakeCreepVulnerableToType(creep, TowerType.Impact);
			creep.State.Burst = false;
			creep.State.Burn = false;
			MakeCreepImmuneToType(creep, TowerType.Fire);
		}
		private static void SetAffectedByFire(Creep creep)
		{
			if (creep.State.Wet)
			{
				creep.State.Wet = false;
				ChangeStartStatesIfWoodCreep(creep);
			}
			else if (creep.State.Frozen)
			{
				StateChanger.MakeCreepUnfreezable(creep);
				SetWoodCreepWetState(creep);
			}
			else
			{
				StateChanger.MakeCreepFast(creep);
				StateChanger.MakeCreepBurst(creep);
			}
		}
		public static void ChangeStatesIfClothCreep(TowerType damageType, Creep creep)
		{
			switch (damageType)
			{
			case TowerType.Ice:
				SetAffectedByIce(creep);
				break;
			case TowerType.Impact:
				SetAffectedByImpact(creep);
				break;
			case TowerType.Water:
				SetAffectedByWater(creep);
				break;
			case TowerType.Acid:
				SetAffectedByAcid(creep);
				break;
			case TowerType.Fire:
				SetAffectedByFire(creep);
				break;
			}
		}
		private static void SetAffectedByFire(Creep creep)
		{
			if (creep.State.Wet)
			{
				creep.State.Wet = false;
				ChangeStartStatesIfClothCreep(creep);
			}
			else if (creep.State.Frozen)
			{
				creep.State.Frozen = false;
				StateChanger.MakeCreepUnfreezable(creep);
				SetClothCreepWetState(creep);
			}
			else
			{
				if (creep.State.Slow)
					StateChanger.MakeCreepSlowImmune(creep);
				else
					StateChanger.MakeCreepFast(creep);
				StateChanger.MakeCreepBurst(creep);
			}
		}
		private static void SetAffectedByAcid(Creep creep)
		{
			StateChanger.MakeCreepMelt(creep);
		}
		private static void SetAffectedByImpact(Creep creep)
		{
			StateChanger.MakeCreepSlow(creep);
			StateChanger.MakeCreepEnfeeble(creep);
		}
		private static void SetAffectedByFire(Creep creep)
		{
			StateChanger.MakeCreepBurn(creep);
			StateChanger.MakeCreepMelt(creep);
		}
		private static void SetAffectedByAcid(Creep creep)
		{
			StateChanger.MakeCreepEnfeeble(creep);
		}
		private static void SetAffectedByWater(Creep creep)
		{
			if (creep.State.Fast)
				creep.State.Fast = false;
			SetClothCreepWetState(creep);
		}
示例#29
0
		public static void MakeCreepFast(Creep creep)
		{
			creep.State.Fast = true;
			creep.State.FastTimer = 0;
			creep.TimeIcon.Material = creep.EmptyMaterial;
		}
示例#30
0
		public static void MakeCreepWeakToType(Creep creep, TowerType type)
		{
			creep.State.SetVulnerability(type, Vulnerability.Weak);
		}