コード例 #1
0
ファイル: ZU.cs プロジェクト: genveir/RunicMagic
        public override EvalResult Eval(RunePhrase sn)
        {
            var arg = sn._children?.First();

            if (arg == null)
            {
                return(EvalResult.Fail());
            }
            var argtype = arg._rune.ResultType();

            if (argtype == RuneType.Effect)
            {
                return(arg.Eval());
            }
            if (argtype == RuneType.Reference)
            {
                // TODO: for now we use BEH, which points to ITargetable.
                // other runes could refer by different means, for example:
                // ZU WATHIJDOET, referring to the spell cast by your target
                Inscription?target = null;
                this.caster.Target?.ReferenceWhenTargeted.TryPickT2(out target, out _);
                if (target == null)
                {
                    return(EvalResult.Fail());
                }
                return(target.InscribedSpell.Eval());
            }
            return(EvalResult.Fail());
        }
コード例 #2
0
        public override EvalResult Eval(RunePhrase sn)
        {
            var player = this.caster;

            return(EvalResult.Succeed(player.Target));
        }
コード例 #3
0
ファイル: DEBUG.cs プロジェクト: genveir/RunicMagic
        public override EvalResult Eval(RunePhrase sn)
        {
            var player = this.caster;

            return(EvalResult.SucceedWithAction(() => player.Location.Echo($"{player.Description.ShortDesc} Debug!")));
        }