예제 #1
0
        public static AssignedFeature From(string featureName, Character player)
        {
            int     parenIndex = featureName.IndexOf("(");
            Feature feature;

            string[] arguments = null;
            if (parenIndex >= 0)
            {
                string featureStrippedName = featureName.EverythingBefore("(");
                feature = AllFeatures.Get(featureStrippedName);
                string argumentStr = featureName.EverythingAfter("(");
                parenIndex = featureName.IndexOf(")");
                if (parenIndex >= 0)
                {
                    argumentStr = argumentStr.EverythingBefore(")");
                }

                arguments = argumentStr.Split(',');
            }
            else
            {
                feature = AllFeatures.Get(featureName);
            }

            return(From(feature, arguments, player));
        }
예제 #2
0
        public override object Evaluate(List <string> args, ExpressionEvaluator evaluator, Character player, Creature target, CastedSpell spell)
        {
            ExpectingArguments(args, 1);
            Feature feature = AllFeatures.Get(args[0]);

            if (feature != null)
            {
                feature.Activate("", player);
            }

            return(null);
        }
예제 #3
0
        public override object Evaluate(List <string> args, ExpressionEvaluator evaluator, Creature player, Target target, CastedSpell spell, DiceStoppedRollingData dice = null)
        {
            ExpectingArguments(args, 1);
            Feature feature = AllFeatures.Get(args[0]);

            if (feature != null)
            {
                feature.Activate("", player, true);
            }

            return(null);
        }
예제 #4
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();
 }
        public override object Evaluate(List <string> args, ExpressionEvaluator evaluator, Creature player, Target target, CastedSpell spell, RollResults dice = null)
        {
            ExpectingArguments(args, 1);
            string featureName = args[0];

            if (featureName.StartsWith("\""))
            {
                featureName = Expressions.GetStr(featureName);
            }
            Feature feature = AllFeatures.Get(featureName);

            if (feature != null)
            {
                feature.Deactivate("", player);
            }

            return(null);
        }
 public override bool Handles(string tokenName, Creature player, CastedSpell castedSpell = null)
 {
     feature = AllFeatures.Get(tokenName);
     return(feature != null);
 }