コード例 #1
0
        void Start() {

            reduceEnergyDebuff = combatant.StatusEffectManager.AddEffect(new MovingReduceEnergy(combatant));

            if (target.transform.position.x < this.transform.position.x)
                combatant.DirectionFaced = "Left";
            else
                combatant.DirectionFaced = "Right";
        }
コード例 #2
0
        // Checks the effect that is to be applied. If this combatant is already affected by this type of status, we return that instance
        // of it from the collection. Otherwise, we return the status to be applied.
        private bool CheckForEffect(StatusEffect statusToApply, out StatusEffect status) {

            foreach(StatusEffect s in statusEffects) {
                if(s.GetType() == statusToApply.GetType()) {
                    status = s;
                    return true;
                }
            }

            status = null;
            return false;
        }
コード例 #3
0
        public StatusEffect AddEffect(StatusEffect statusToApply) {

            StatusEffect existingStatus = null;

            if(CheckForEffect(statusToApply, out existingStatus)) {
                existingStatus.Refresh();
            }
            else {
                statusEffects.Add(statusToApply);
            }

            Recalculate();

            if (existingStatus == null)
                return statusToApply;
            else
                return existingStatus;
        }
コード例 #4
0
        public StatusEffect AddEffect(StatusEffect statusToApply)
        {
            StatusEffect existingStatus = null;

            if (CheckForEffect(statusToApply, out existingStatus))
            {
                existingStatus.Refresh();
            }
            else
            {
                statusEffects.Add(statusToApply);
            }

            Recalculate();

            if (existingStatus == null)
            {
                return(statusToApply);
            }
            else
            {
                return(existingStatus);
            }
        }
コード例 #5
0
 public void RemoveEffect(StatusEffect effect)
 {
     statusEffects.Remove(effect);
     Recalculate();
 }
コード例 #6
0
        public void RemoveEffect(StatusEffect effect) {

            statusEffects.Remove(effect);
            Recalculate();
        }