Exemplo n.º 1
0
        public override object Evaluate(List <string> args, ExpressionEvaluator evaluator, Character player, Target target = null, CastedSpell spell = null, DiceStoppedRollingData dice = null)
        {
            ExpectingArguments(args, 2, 10);
            if (player != null)
            {
                if (target == null)
                {
                    target = Expressions.Get <Target>(args[0]);
                }

                string magicItemName = Expressions.GetStr(args[1]);

                object data1 = null;
                object data2 = null;
                object data3 = null;
                object data4 = null;
                object data5 = null;
                object data6 = null;
                object data7 = null;
                object data8 = null;

                if (args.Count > 2)
                {
                    data1 = Expressions.Get(args[2], player, target, spell);
                }
                if (args.Count > 3)
                {
                    data2 = Expressions.Get(args[3], player, target, spell);
                }
                if (args.Count > 4)
                {
                    data3 = Expressions.Get(args[4], player, target, spell);
                }
                if (args.Count > 5)
                {
                    data4 = Expressions.Get(args[5], player, target, spell);
                }
                if (args.Count > 6)
                {
                    data5 = Expressions.Get(args[6], player, target, spell);
                }
                if (args.Count > 7)
                {
                    data6 = Expressions.Get(args[7], player, target, spell);
                }
                if (args.Count > 8)
                {
                    data7 = Expressions.Get(args[8], player, target, spell);
                }
                if (args.Count > 9)
                {
                    data8 = Expressions.Get(args[9], player, target, spell);
                }


                //if (target == null)
                //	target = player.ActiveTarget;
                // TODO: consider passing in the spell name as well for unique id (if castedSpell is valid).
                player.GiveMagic(magicItemName, spell, target, data1, data2, data3, data4, data5, data6, data7, data8);
            }

            return(null);
        }