Exemplo n.º 1
0
        /// <summary>
        ///Sets the effects of a feature.  Doing this will allow us to freely change mechanics without needing to
        /// make migrations
        /// </summary>
        /// <param name="instance">Instance of special feature to set.</param>
        public static void SetEffectsAndDescription(StatelessFeature instance)
        {
            switch (instance.type)
            {
            case SpecialFeatureType.SECOND_WIND:
                instance.applied = (Sheet character) => {
                    character.OnProduceBonusActions += AddSecondWindAction;
                    character.OnDidPerform          += (Action act) => {
                        if (act is SecondWind)
                        {
                            character.metaData.SetMetaValue("used_second_wind", true);
                        }
                    };

                    //Todo: Add something to reset this value on rest...
                };
                instance.unapplied = (Sheet character) => {
                    character.OnProduceBonusActions -= AddSecondWindAction;
                };
                instance.shortDescription = "The figher can recover lost hit points once per battle.";
                instance.description      = "Once per battle, the fighter can spend a bonus action to regain hit points equal to 1d10 + its level in the fighter class.";
                break;

            default:
                Debug.LogError(instance.type + " is not set up on the special feature effects table");
                break;
            }
        }
Exemplo n.º 2
0
        public override SerializedObject GetInstance()
        {
            StatelessFeature ret = new StatelessFeature(type);

            return(ret);
        }