public static void PlayDestroyedSound(CreepType creepType) { if (creepType == CreepType.Cloth) { PlayDestroyedSound(GameSounds.CreepDestroyedCloth); } if (creepType == CreepType.Glass) { PlayDestroyedSound(GameSounds.CreepDestroyedGlass); } if (creepType == CreepType.Iron) { PlayDestroyedSound(GameSounds.CreepDestroyedIron); } if (creepType == CreepType.Paper) { PlayDestroyedSound(GameSounds.CreepDestroyedPaper); } if (creepType == CreepType.Plastic) { PlayDestroyedSound(GameSounds.CreepDestroyedPlastic); } if (creepType == CreepType.Sand) { PlayDestroyedSound(GameSounds.CreepDestroyedSand); } if (creepType == CreepType.Wood) { PlayDestroyedSound(GameSounds.CreepDestroyedWood); } }
public Unit(int x, int y, Owner owner, CreepType creepType, int health) { Location = new Location(x, y, 0); Owner = owner; CreepType = creepType; Health = health; }
public static void SpawnCreepInGame(this GameLevel gameLevel, CreepType type) { var path = gameLevel.GetPathForCreep().ToList(); var creep = gameLevel.CreateAndShowCreep(type, path[0], path[path.Count - 1]); foreach (var position in path) creep.Path.Add(new Vector2D(position.X, position.Y)); }
public override CreepData Get(CreepType type) { foreach (CreepData d in agentData.Where(d => (CreepType)d.Type == type)) return d; var newCreepData = DefaultCreepPropertiesForTesting.GetDefaultCreepData(type); creepData.Add(newCreepData); return newCreepData; }
public Creep(CreepType type, Vector3D position, float rotationZ = 0.0f) : base(position, rotationZ) { Type = type; CreateStats(type, ContentLoader.Load <CreepPropertiesXml>(Xml.CreepProperties.ToString())); SetupCreepHealthBar(); SetupCreepIcons(); InitializeModel(); }
public Creep(CreepType type, Vector3D position, float rotationZ = 0.0f) : base(position, rotationZ) { Type = type; CreateStats(type, ContentLoader.Load<CreepPropertiesXml>(Xml.CreepProperties.ToString())); SetupCreepHealthBar(); SetupCreepIcons(); InitializeModel(); }
public static void SpawnCreepInGame(this GameLevel gameLevel, CreepType type) { var path = gameLevel.GetPathForCreep().ToList(); var creep = gameLevel.CreateAndShowCreep(type, path[0], path[path.Count - 1]); foreach (var position in path) { creep.Path.Add(new Vector2D(position.X, position.Y)); } }
public void nextWave() { if (currentCreepType == CreepType.Basic) { currentCreepType = CreepType.Fast; } else { currentCreepType = CreepType.Basic; } }
public override CreepData Get(CreepType type) { foreach (CreepData d in agentData.Where(d => (CreepType)d.Type == type)) { return(d); } var newCreepData = DefaultCreepPropertiesForTesting.GetDefaultCreepData(type); creepData.Add(newCreepData); return(newCreepData); }
private static Creep CreateAndShowCreep(this GameLevel gameLevel, CreepType type, Vector2D spawnPoint, Vector2D finalTarget) { var creep = new Creep(type, spawnPoint) { FinalTarget = finalTarget }; creep.RenderModel(); creep.IsDead += () => { gameLevel.EarnGold((int)creep.GetStatValue("Gold")); gameLevel.DeadCreepCount++; gameLevel.CheckChapterCompletion(); }; creep.ReachedExit += gameLevel.ReduceOneLife; return creep; }
public void SpawnCreep(CreepType type, int id, Vector2 position, Vector2 velocity) { if (creepList[id] != null) { RemoveCreep(id); } switch (type) { case CreepType.Scroot: creepList[id] = new SYScroot(id, position, velocity, this); break; } }
private void CreateStats(CreepType type, CreepPropertiesXml properties) { CreepData creepData = properties.Get(type); Name = creepData.Name; CreateStat("Hp", creepData.MaxHp); CreateStat("Speed", creepData.Speed); CreateStat("Resistance", creepData.Resistance); CreateStat("Gold", creepData.GoldReward); if (Player.Current != null) ApplyBuff(new BuffEffect(Player.Current.Avatar.GetType().Name + "GoldMultiplier")); State = new CreepState(); foreach (var modifier in creepData.TypeDamageModifier) State.SetVulnerabilityWithValue(modifier.Key, modifier.Value); }
public void ChangeCreepType(CreepType newType, float percentage) { if (Model != null) { Model.Dispose(); //ncrunch: no coverage } Type = newType; var properties = ContentLoader.Load <CreepPropertiesXml>(Xml.CreepProperties.ToString()); CreepData creepData = properties.Get(newType); Name = creepData.Name; RestartStatsAndState(percentage, creepData); RenderModel(); }
public string Build(SiteType siteType, CreepType unitType) { string command = "WAIT"; if (GetClosestEmptySite() == null) { return(command); } command = "BUILD " + GetClosestEmptySite().Id; switch (siteType) { case SiteType.Barrack: command += " BARRACKS"; break; case SiteType.Tower: command += " TOWER"; break; case SiteType.Mine: command += " MINE"; break; } if (siteType == SiteType.Barrack) { switch (unitType) { case CreepType.Knight: command += "-KNIGHT"; break; case CreepType.Archer: command += "-ARCHER"; break; case CreepType.Giant: command += "-GIANT"; break; default: break; } } return(command); }
public static void PlayDestroyedSound(CreepType creepType) { if (creepType == CreepType.Cloth) PlayDestroyedSound(GameSounds.CreepDestroyedCloth); if (creepType == CreepType.Glass) PlayDestroyedSound(GameSounds.CreepDestroyedGlass); if (creepType == CreepType.Iron) PlayDestroyedSound(GameSounds.CreepDestroyedIron); if (creepType == CreepType.Paper) PlayDestroyedSound(GameSounds.CreepDestroyedPaper); if (creepType == CreepType.Plastic) PlayDestroyedSound(GameSounds.CreepDestroyedPlastic); if (creepType == CreepType.Sand) PlayDestroyedSound(GameSounds.CreepDestroyedSand); if (creepType == CreepType.Wood) PlayDestroyedSound(GameSounds.CreepDestroyedWood); }
CreepData GetCreepData(CreepType creepType) { if (creepDatas == null) { return(null); } foreach (var data in creepDatas) { if (data.Type == creepType) { return(data); } } return(null); }
public void Update(int type, int owner, int canTrain, int creepType) { Owner = owner == -1 ? SiteOwner.None : owner == 0 ? SiteOwner.Friendly : SiteOwner.Enemy; CanTrain = canTrain == 0; switch (type) { case -1: Type = SiteType.None; break; case 0: Type = SiteType.Mine; break; case 1: Type = SiteType.Tower; break; case 2: Type = SiteType.Barrack; break; } switch (creepType) { case -1: CreepType = CreepType.None; break; case 0: CreepType = CreepType.Knight; Upkeep = 80; break; case 1: CreepType = CreepType.Archer; Upkeep = 100; break; case 2: CreepType = CreepType.Giant; Upkeep = 140; break; } }
private static Creep CreateAndShowCreep(this GameLevel gameLevel, CreepType type, Vector2D spawnPoint, Vector2D finalTarget) { var creep = new Creep(type, spawnPoint) { FinalTarget = finalTarget }; creep.RenderModel(); creep.IsDead += () => { gameLevel.EarnGold((int)creep.GetStatValue("Gold")); gameLevel.DeadCreepCount++; gameLevel.CheckChapterCompletion(); }; creep.ReachedExit += gameLevel.ReduceOneLife; return(creep); }
private void SpawnCreep(MazeNode node, CreepType creepType) { node.HasACreep = true; Vector3 position = mapGenerator.GetScaled(node.Rect.position); if (creepType == CreepType.Melee) { Meleeer meleeCreep = Instantiate(meleeCreepPrefab, transform); meleeCreep.transform.position = position; node.Room.NumberOfMeleeCreeps += 1; } else if (creepType == CreepType.Ranged) { Ranger rangeCreep = Instantiate(rangeCreepPrefab, transform); rangeCreep.transform.position = position; node.Room.NumberOfRangedCreeps += 1; } }
public static GameObject createCreep(CreepType type) { GameObject prefab = null; switch (type) { case CreepType.Basic: prefab = BASIC_CREEP_PREFAB; break; case CreepType.Fast: prefab = FAST_CREEP_PREFAB; break; } GameObject creep = Object.Instantiate(prefab, Vector3.zero, Quaternion.identity) as GameObject; return(creep); }
private void CreateStats(CreepType type, CreepPropertiesXml properties) { CreepData creepData = properties.Get(type); Name = creepData.Name; CreateStat("Hp", creepData.MaxHp); CreateStat("Speed", creepData.Speed); CreateStat("Resistance", creepData.Resistance); CreateStat("Gold", creepData.GoldReward); if (Player.Current != null) { ApplyBuff(new BuffEffect(Player.Current.Avatar.GetType().Name + "GoldMultiplier")); } State = new CreepState(); foreach (var modifier in creepData.TypeDamageModifier) { State.SetVulnerabilityWithValue(modifier.Key, modifier.Value); } }
public static CreepData GetDefaultCreepData(CreepType type) { switch (type) { case CreepType.Cloth: defaultCreepData = new CreepData(type, CreepModels.CreepCottonMummyHigh.ToString(), 100, 1.0f, 10.0f, 13, DamageModifierValuesForClothCreep()); break; case CreepType.Glass: defaultCreepData = new CreepData(type, CreepModels.CreepGlassHigh.ToString(), 70, 1.3f, 15.0f, 18, DamageModifierValuesForGlassCreep()); break; case CreepType.Iron: defaultCreepData = new CreepData(type, CreepModels.CreepMetalTAxeHigh.ToString(), 120, 0.7f, 20.0f, 25, DamageModifierValuesForIronCreep()); break; case CreepType.Paper: defaultCreepData = new CreepData(type, CreepModels.CreepPaperPaperplaneHigh.ToString(), 90, 1.5f, 8.0f, 10, DamageModifierValuesForPaperCreep()); break; case CreepType.Plastic: defaultCreepData = new CreepData(type, CreepModels.CreepPlasticBottledogHigh.ToString(), 100, 1.0f, 15.0f, 14, DamageModifierValuesForPlasticCreep()); break; case CreepType.Sand: defaultCreepData = new CreepData(type, CreepModels.CreepSandSandyHigh.ToString(), 130, 0.8f, 7.0f, 16, DamageModifierValuesForSandCreep()); break; case CreepType.Wood: defaultCreepData = new CreepData(type, CreepModels.CreepWoodScarecrowHigh.ToString(), 60, 0.9f, 17.0f, 15, DamageModifierValuesForWoodCreep()); break; } return defaultCreepData; }
public static CreepData GetDefaultCreepData(CreepType type) { switch (type) { case CreepType.Cloth: defaultCreepData = new CreepData(type, CreepModels.CreepCottonMummyHigh.ToString(), 100, 1.0f, 10.0f, 13, DamageModifierValuesForClothCreep()); break; case CreepType.Glass: defaultCreepData = new CreepData(type, CreepModels.CreepGlassHigh.ToString(), 70, 1.3f, 15.0f, 18, DamageModifierValuesForGlassCreep()); break; case CreepType.Iron: defaultCreepData = new CreepData(type, CreepModels.CreepMetalTAxeHigh.ToString(), 120, 0.7f, 20.0f, 25, DamageModifierValuesForIronCreep()); break; case CreepType.Paper: defaultCreepData = new CreepData(type, CreepModels.CreepPaperPaperplaneHigh.ToString(), 90, 1.5f, 8.0f, 10, DamageModifierValuesForPaperCreep()); break; case CreepType.Plastic: defaultCreepData = new CreepData(type, CreepModels.CreepPlasticBottledogHigh.ToString(), 100, 1.0f, 15.0f, 14, DamageModifierValuesForPlasticCreep()); break; case CreepType.Sand: defaultCreepData = new CreepData(type, CreepModels.CreepSandSandyHigh.ToString(), 130, 0.8f, 7.0f, 16, DamageModifierValuesForSandCreep()); break; case CreepType.Wood: defaultCreepData = new CreepData(type, CreepModels.CreepWoodScarecrowHigh.ToString(), 60, 0.9f, 17.0f, 15, DamageModifierValuesForWoodCreep()); break; } return(defaultCreepData); }
private void SpawnCreeps(int spawnThisMany, CreepType creepType) { if (spawnThisMany <= 0) { return; } List <MazeRoom> normalRooms = mapGenerator.Rooms.FindAll(room => !room.IsStart && !room.HasBoss); while (normalRooms.Count > 0) { if (spawnThisMany <= 0) { break; } int roomIndex = Random.Range(0, normalRooms.Count); MazeRoom room = normalRooms[roomIndex]; normalRooms.RemoveAt(roomIndex); List <MazeNode> nodes = mapGenerator.GetEmptyRoomNodes(room); while (nodes.Count > 0) { if (spawnThisMany <= 0) { break; } int nodeIndex = Random.Range(0, nodes.Count); MazeNode chosenNode = nodes[nodeIndex]; nodes.RemoveAt(nodeIndex); if (!chosenNode.HasACreep) { bool canSpawnMeleeCreeps = creepType == CreepType.Melee && room.NumberOfMeleeCreeps < depthConfig.MaxMeleeCreepsPerRoom; bool canSpawnRangedCreeps = creepType == CreepType.Ranged && room.NumberOfRangedCreeps < depthConfig.MaxRangedCreepsPerRoom; if (canSpawnMeleeCreeps || canSpawnRangedCreeps) { SpawnCreep(chosenNode, creepType); spawnThisMany -= 1; } } } } }
public virtual void SpawnCreep(CreepType type) { this.SpawnCreepInGame(type); }
public CreepData(CreepType type, string name, float maxHp, float speed, float resistance, int goldReward, Dictionary <TowerType, float> typeDamageModifier) : this(name, maxHp, speed, resistance, goldReward, typeDamageModifier) { Type = type; }
private static Creep CreateCreepOfType(CreepType type, Vector3D position) { return new Creep(type, position); }
public void ChangeCreepType(CreepType newType, float percentage) { if (Model != null) Model.Dispose(); //ncrunch: no coverage Type = newType; var properties = ContentLoader.Load<CreepPropertiesXml>(Xml.CreepProperties.ToString()); CreepData creepData = properties.Get(newType); Name = creepData.Name; RestartStatsAndState(percentage, creepData); RenderModel(); }
public BuildItem(SiteType site, CreepType creep) { BuildType = site; ProductionType = creep; }
public virtual CreepData Get(CreepType type) { return null; }
public void PlayClothCreepDestroyedSound(CreepType type) { CreepDyingSoundSelector.PlayDestroyedSound(type); }
public WaveManager() { waveInProgress = false; currentCreepType = CreepType.Basic; creepContainer = GameObject.Find("Creeps"); }
public virtual CreepData Get(CreepType type) { return(null); }
public CreepData(CreepType type, string name, float maxHp, float speed, float resistance, int goldReward, Dictionary<TowerType, float> typeDamageModifier) : this(name, maxHp, speed, resistance, goldReward, typeDamageModifier) { Type = type; }
private static Creep CreateCreepOfType(CreepType type, Vector3D position) { return(new Creep(type, position)); }