public override object Evaluate(List <string> args, ExpressionEvaluator evaluator, Creature player, Target target, CastedSpell spell, DiceStoppedRollingData dice = null)
        {
            ExpectingArguments(args, 4);

            string tableName   = evaluator.Evaluate <string>(args[0]);
            string fieldLookup = evaluator.Evaluate <string>(args[1]);
            string matchColumn = evaluator.Evaluate <string>(args[2]);
            object matchValue  = evaluator.Evaluate(Expressions.Clean(args[3]));

            return(AllTables.GetData(tableName, fieldLookup, matchColumn, matchValue));
        }
Esempio n. 2
0
        public static int GetAvailableSpellSlots(string className, int level, int slotLevel)
        {
            object data = AllTables.GetData(className, SpellSlotLevelToFieldName(slotLevel), "Level", level);

            if (data == null)
            {
                return(0);
            }
            if (data is string dataStr)
            {
                if (int.TryParse(dataStr, out int result))
                {
                    return(result);
                }
            }

            if (data is int)
            {
                return((int)data);
            }

            return(0);
        }