Exemple #1
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 #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);
            }
        }