Ejemplo n.º 1
0
        public void AddStatus(Status status)
        {
            List <Status> existingStatus = statusContainer.GetStatusListByType(status.statusType);

            int count = existingStatus.Count;

            if (existingStatus.Count > 0)
            {
                for (int i = 0; i < count; i++)
                {
                    if (StackStatus(status, existingStatus[i], status.SourceAbility) == true)
                    {
                        return;
                    }
                }
            }

            statusContainer.AddStatus(status);
        }
Ejemplo n.º 2
0
        public void AddStatus(Status status, EffectStatus sourceEffect, SpecialAbility sourceAbility)
        {
            List <Status> existingStatus = statusContainer.GetStatusListByType(status.statusType);

            int count = existingStatus.Count;

            if (existingStatus.Count > 0)
            {
                for (int i = 0; i < count; i++)
                {
                    if (existingStatus[i].IsFromSameSource(sourceAbility))
                    {
                        switch (sourceEffect.stackMethod)
                        {
                        case Constants.StatusStackingMethod.None:
                            existingStatus[i].RefreshDuration();
                            return;

                        case Constants.StatusStackingMethod.LimitedStacks:
                            if (existingStatus[i].StackCount < existingStatus[i].maxStack)
                            {
                                existingStatus[i].Stack();
                            }
                            else
                            {
                                existingStatus[i].RefreshDuration();
                            }
                            return;


                        case Constants.StatusStackingMethod.StacksWithOtherAbilities:
                            existingStatus[i].RefreshDuration();
                            return;
                        }
                    }
                }
            }

            statusContainer.AddStatus(status);
        }
Ejemplo n.º 3
0
        public void AddStatus(Status status)
        {
            List <Status> existingStatus = statusContainer.GetStatusListByType(status.statusType);

            int count = existingStatus.Count;

            //Debug.Log(count + " existing status found of type " + status.statusType);

            if (existingStatus.Count > 0)
            {
                for (int i = 0; i < count; i++)
                {
                    if (StackStatus(status, existingStatus[i], status.SourceAbility) == true)
                    {
                        //Debug.Log("StatusManager: Stacking a status from " + status.SourceEffect.effectName + " on " + status.SourceAbility.abilityName);
                        return;
                    }
                }
            }

            //Debug.Log("StatusManager: Adding another status to the list from " + status.SourceEffect.effectName + " on " + status.SourceAbility.abilityName);
            statusContainer.AddStatus(status);
            status.FirstApply();
        }