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(); }
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; }