Example #1
0
            public async Task remove(string type, [Remainder, Summary("Resistance name")] string resistance)
            {
                type = type.ToLower().Trim();
                CharacterNode old = findCharacter(Context.User);

                if (old == null)
                {
                    await Context.User.SendMessageAsync("You do not have an active character.");

                    return;
                }
                if (type != "res" && type != "resistance" && type != "vul" && type != "vulnerability" && type != "imm" && type != "immune")
                {
                    await Context.User.SendMessageAsync(type + " is not a valid type. Please enter resistance, vulnerability, immune, or res, vul, or imm.");

                    return;
                }
                int index = old.damageTypes(resistance);

                if (index == -1)
                {
                    await Context.User.SendMessageAsync("Please enter a valid damage type.");

                    return;
                }
                if (type == "res" || type == "resistance")
                {
                    old.removeResistance(resistance);
                }
                else if (type == "vul" || type == "vulnerability")
                {
                    old.removeVulnerability(resistance);
                }
                else if (type == "imm" || type == "immune")
                {
                    old.removeImmunity(resistance);
                }
                await Context.User.SendMessageAsync("I removed the " + type + " for you, if you had it originally.");
            }