Exemplo n.º 1
0
            protected virtual AbilityResourceImpactData[] ComputeResourcesImpacts(IAbilityContainer container)
            {
                if (HasStats == false)
                {
                    return(container.Ability.Main.BaseResourcesImpacts);
                }

                AbilityResourceImpactData[] impacts = new AbilityResourceImpactData[container.Ability.Main.BaseResourcesImpacts.Length];

                for (int i = 0; i < impacts.Length; i++)
                {
                    impacts[i] = new AbilityResourceImpactData(
                        container.Ability.Main.BaseResourcesImpacts[i].ResourceType,
                        Stats.EvaluateAbilitiesResourcesStat(
                            container.Ability.Main.BaseResourcesImpacts[i].ResourceType,
                            container.Ability.Main.BaseResourcesImpacts[i].ResourceChange));
                }

                if (container is EntityEquipable eq)
                {
                    eq.EquippedAbility.ApplyResourcesInfluencesOnImpacts(impacts);
                }

                return(impacts);
            }
Exemplo n.º 2
0
        public void FillResourceChange(EntityBeingResourceType resource, float change)
        {
            AbilityResourceImpactData data = null;

            for (int i = 0; i < _resourcesChanges.Count; i++)
            {
                if (_resourcesChanges[i].ResourceType == resource)
                {
                    data = _resourcesChanges[i];
                }
            }
            if (data == null)
            {
                _resourcesChanges.Add(new AbilityResourceImpactData(resource, change));
            }
            else
            {
                data.SetResourceChange(change);
            }

            _resourceChangesFilled = true;
        }