Exemple #1
0
        public void TestCreepState()
        {
            var state = new CreepState();

            state.SetVulnerabilityWithValue(TowerType.Ice, 1000f);
            Assert.AreEqual(Vulnerability.Sudden, state.GetVulnerability(TowerType.Ice));
        }
Exemple #2
0
		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);
		}
Exemple #3
0
        protected override void RestartStatsAndState(float percentage, AgentData data)
        {
            var creepData = (CreepData)data;

            Stats.Clear();
            CreateStat("Hp", creepData.MaxHp);
            var amountToSubtract = (1 - percentage) * creepData.MaxHp;

            AdjustStat(new StatAdjustment("Hp", "", -amountToSubtract));
            CreateStat("Speed", creepData.Speed);
            CreateStat("Resistance", creepData.Resistance);
            CreateStat("Gold", creepData.GoldReward);
            State = new CreepState();
            foreach (var modifier in creepData.TypeDamageModifier)
            {
                State.SetVulnerabilityWithValue(modifier.Key, modifier.Value);
            }
        }
Exemple #4
0
        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);
            }
        }
Exemple #5
0
		protected override void RestartStatsAndState(float percentage, AgentData data)
		{
			var creepData = (CreepData)data;
			Stats.Clear();
			CreateStat("Hp", creepData.MaxHp);
			var amountToSubtract = (1 - percentage) * creepData.MaxHp;
			AdjustStat(new StatAdjustment("Hp", "", -amountToSubtract));
			CreateStat("Speed", creepData.Speed);
			CreateStat("Resistance", creepData.Resistance);
			CreateStat("Gold", creepData.GoldReward);
			State = new CreepState();
			foreach (var modifier in creepData.TypeDamageModifier)
				State.SetVulnerabilityWithValue(modifier.Key, modifier.Value);
		}
		public void TestCreepState()
		{
			var state = new CreepState();
			state.SetVulnerabilityWithValue(TowerType.Ice, 1000f);
			Assert.AreEqual(Vulnerability.Sudden, state.GetVulnerability(TowerType.Ice));
		}