示例#1
0
        private static Debuff CreateDebuff(ulong id, string name, string tech, int value, int countdown)
        {
            var newDebuffs = new Debuff()
            {
                ID        = id,
                Name      = name,
                Tech      = tech,
                Value     = value,
                Countdown = countdown
            };

            debuffs.Add(newDebuffs);
            MainStorage.ChangeData("LatestDebuffId", id);
            SaveDebuffs();
            return(newDebuffs);
        }
示例#2
0
        public static async Task Burn(UserAccount user, Debuff burn)
        {
            UserAccounts.UserAccounts.DecreasingHealth(user, burn.Value);
            bool   loss   = false;
            bool   die    = false;
            Debuff target = new Debuff();

            foreach (var u in user.Debuffs)
            {
                if (u.Name.Equals("Burn"))
                {
                    target = u;
                    u.Countdown--;
                }
            }
            if (target == null)
            {
                return;
            }
            if (burn.Countdown <= 0)
            {
                user.Debuffs.Remove(burn);
                loss = !loss;
            }
            var realuser = GlobalVar.GuildSelect.GetUser(user.ID);

            if (user.HP <= 0)
            {
                die  = !die;
                loss = true;
            }
            UserAccounts.UserAccounts.SaveAccount();
            await GlobalVar.ChannelSelect.SendMessageAsync($"{realuser.Mention} get {target.Name}ED, HP become {user.HP}");

            if (die)
            {
                await GlobalVar.ChannelSelect.SendMessageAsync("YOU DIED!!");
            }
            if (loss)
            {
                await GlobalVar.ChannelSelect.SendMessageAsync($"{target.Name} HAS BEEN REMOVED");
            }
        }
示例#3
0
 public static async Task DecreaseDebuffCountDown(UserAccount user, Debuff debuff)
 {
     foreach (var u in user.Debuffs)
     {
         if (u == debuff)
         {
             u.Countdown--;
             if (u.Countdown == -1)
             {
                 return;
             }
             if (u.Countdown == 0)
             {
                 user.Debuffs.Remove(debuff);
                 await GlobalVar.ChannelSelect.SendMessageAsync($"{u.Name} HAS BEEN REMOVED");
             }
             UserAccounts.UserAccounts.SaveAccount();
             return;
         }
     }
 }