Esempio n. 1
0
        public static void insert_character(character character)
        {
            var store = new DataStore("character.json");

            // Get employee collection
            store.GetCollection <character>().InsertOneAsync(character);

            store.Dispose();
        }
Esempio n. 2
0
        public object RollRangedDamage(character character, int optional_mod = 0)
        {
            int        modifier = 0;
            RollDamage rd       = new RollDamage();

            string title = character.name + "rolls damage";

            modifier += stat_mod.mod_from_stat_val((int)helpers.GetPropValue(character, this.Attribute.ToString().ToLower()));
            rd.DexMod = stat_mod.mod_from_stat_val((int)helpers.GetPropValue(character, this.Attribute.ToString().ToLower()));

            List <int> rolls = new List <int>();

            rolls          = Commands.roller.Roll(this.Damage);
            rd.Roll        = this.Damage;
            modifier      += rolls.Sum();
            modifier      += optional_mod;
            rd.OptionalMod = optional_mod;
            rd.Result      = modifier;
            rd.DiceResults = "(" + string.Join(", ", rolls) + ")";

            return(helpers.ObjToEmbed(rd, title));
        }