Esempio n. 1
0
 ///<summary> Checks if DestructionInfo has a matching DestroyCondition and any matching tags. </summary>
 public void CheckTagsMatch(EnvironTagList tagList, DestroyCondition destroyCondition)
 {
     if (condition == destroyCondition && tagList.MatchingTags(searchTags))
     {
         destroy = true;
     }
 }
        ///<summary> Checks targetEO DestructionInfo on matching DestroyConditions, adds effect to targetEO's Effects list. </summary>
        private void CheckAndAdd(EnvironOutput effect, EnvironObject targetEO, DestroyCondition destructCondition)
        {
            if (targetEO.destruction)
            {
                targetEO.destruction.CheckTagsMatch(tags, destructCondition);
                if (effect.damageI)
                {
                    targetEO.destruction.CheckDamageMatch(effect.damageI.ID);
                }
            }

            targetEO.effects.Add(effect, targetEO, this);
        }
Esempio n. 3
0
        public void Init(DestroyCondition condition, object parameter)
        {
            if (ManualTime)
            {
                _condition = DestroyCondition.Time;
                Destroy(gameObject, Time);
                return;
            }

            if (condition == DestroyCondition.Time)
            {
                Destroy(gameObject, (float)parameter);
                return;
            }

            _condition   = condition;
            _parameter   = parameter;
            _initialised = true;
        }
        ///<summary> Adds On_Enter Outputs as an Effect to the TargetEO, as well as Effects with allowTransmission. </summary>
        private void OnEnter(TransferCondition enterTC, DestroyCondition enterDSC, EnvironObject targetEO)
        {
            if (targetEO == null)
            {
                return;
            }

            foreach (EnvironOutput effect in output)
            {
                if (effect.transferCondition == enterTC)
                {
                    CheckAndAdd(effect, targetEO, enterDSC);
                }
            }

            foreach (EnvironOutput tEffect in effects.inputList)
            {
                if (tEffect.allowTransmission && tEffect.transferCondition == enterTC)
                {
                    CheckAndAdd(tEffect, targetEO, enterDSC);
                }
            }
        }
        ///<summary> Adds On_Exit Outputs as an Effect to the TargetEO, as well as Effects with allowTransmission. Also flags Effects meeting the On_Exit TerminalCondition for removal. </summary>
        private void OnExit(TransferCondition exitTC, TerminalCondition terminalCondition, DestroyCondition exitDSC, EnvironObject targetEO)
        {
            if (targetEO == null)
            {
                return;
            }

            foreach (EnvironOutput effect in effects.inputList)
            {
                if (effect.allowTransmission && effect.transferCondition == exitTC)
                {
                    CheckAndAdd(effect, targetEO, exitDSC);
                }
            }

            foreach (EnvironOutput eOut in output)
            {
                if (eOut.transferCondition == exitTC)
                {
                    CheckAndAdd(eOut, targetEO, exitDSC);
                }

                if (eOut.endOnCondition == terminalCondition)
                {
                    targetEO.effects.FlagForRemoval(eOut);
                }
            }
        }
Esempio n. 6
0
 public void Init(DestroyCondition condition, IRPGController controller, object parameter)
 {
     _controller = controller;
     Init(condition, parameter);
 }