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));
        }
Exemplo n.º 2
0
 public static void Invalidate()
 {
     AllActionShortcuts.Invalidate();
     AllDieRollEffects.Invalidate();
     AllFeatures.Invalidate();
     AllFunctions.Invalidate();
     AllPlayers.Invalidate();
     AllProperties.Invalidate();
     AllSpellEffects.Invalidate();
     AllSpells.Invalidate();
     AllTables.Invalidate();
     AllTrailingEffects.Invalidate();
     AllWeaponEffects.Invalidate();
     AllWeapons.Invalidate();
 }
Exemplo n.º 3
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);
        }