Beispiel #1
0
        internal void TryApplyEachEffOfMain(int idx, SkEntity tar, SkRuntimeInfo skrt)
        {
            SkEffect eff = idx < _effMainEachTime.Length ? _effMainEachTime [idx] : _effMainEachTime [_effMainEachTime.Length - 1];

            if (eff != null)
            {
                eff.Apply(tar, skrt);
            }
        }
        public bool Exec(SkInst inst)
        {
            bool ret = false;

            SkRuntimeInfo.Current = inst;

            if (_cond.Tst(inst))
            {
                inst._forceMagnitude = _force;
                if (inst._target != null)
                {
                    if (_modsCaster != null)
                    {
                        _modsCaster.Exec(inst._caster.attribs, inst._caster.attribs, inst._target.attribs, inst._para as ISkAttribsModPara);
                    }
                    if (_modsTarget != null)
                    {
                        _modsTarget.Exec(inst._target.attribs, inst._caster.attribs, inst._target.attribs, inst._para as ISkAttribsModPara);
                    }
                    if (_force > 0.0f)
                    {
                        inst._forceDirection = inst.GetForceVec();
                    }
                    if (_effOnHitCaster != null)
                    {
                        _effOnHitCaster.Apply(inst._caster, inst);
                    }
                    if (_effOnHitTarget != null)
                    {
                        _effOnHitTarget.Apply(inst._target, inst);
                    }
                }
                else
                {
                    inst._tmpTar = null;
                    if (_effOnHitCaster != null)
                    {
                        _effOnHitCaster.Apply(inst._caster, inst);
                    }
                    if (_cond._retTars != null && _cond._retTars.Count > 0)
                    {
                        foreach (SkEntity target in _cond._retTars)
                        {
                            inst._tmpTar = target;
                            if (_modsCaster != null)
                            {
                                _modsCaster.Exec(inst._caster.attribs, inst._caster.attribs, target.attribs, inst._para as ISkAttribsModPara);
                            }
                            if (_modsTarget != null)
                            {
                                _modsTarget.Exec(target.attribs, inst._caster.attribs, target.attribs, inst._para as ISkAttribsModPara);
                            }
                            if (_effOnHitTarget != null)
                            {
                                if (_force > 0.0f)
                                {
                                    inst._forceDirection = inst.GetForceVec();
                                }
                                _effOnHitTarget.Apply(target, inst);
                            }
                        }
                    }
                    else
                    {
                        if (_modsCaster != null)
                        {
                            _modsCaster.Exec(inst._caster.attribs, inst._caster.attribs, null, inst._para as ISkAttribsModPara);
                        }
                    }
                }
                ret = true;
            }
            SkRuntimeInfo.Current = null;
            return(ret);
        }