public async Task Skill(string skillName, IUser user) { DBUser dbUser = DBFuncs.FindDBUser(Context.User); DBUser target = DBFuncs.FindDBUser(user); DBSkill skill = DBFuncs.GetSkill(skillName); if (target.Location == Context.Channel.Id) { if (DBFuncs.HasSkill(skill, Context.User)) { if (dbUser.Energy >= skill.EnergyCost && !dbUser.Charging) { int power = skill.Power * Convert.ToInt32(DBFuncs.GetAttribute("POWER_LVL", Context.User)); await Context.Channel.SendMessageAsync($"{Context.User.Username} uses {skill.Name} on {user.Username} with a power of {power}"); dbUser.Charging = true; Timer timer = new Timer(await target.Hurt(Context.Channel, power), null, skill.Charge * 1000, Timeout.Infinite); } } else { await Context.Channel.SendMessageAsync("You do not have this skill!"); } } else { await Context.Channel.SendMessageAsync("That person is not here."); } }
public async void UseSkill(DBSkill skill, DBUser user) { int power = skill.Power * Power_Level; await Place.SendMessageAsync($"{Name} uses {skill.Name} on {user.User.Username} with a power of {power}"); Target.Charging = true; Timer timer = new Timer(await user.Hurt(Place, power), null, skill.Charge * 1000, Timeout.Infinite); }
public async Task Attack(IUser user) { DBUser attacker = DBFuncs.FindDBUser(Context.User); DBUser target = DBFuncs.FindDBUser(user); if (target.Location == Context.Channel.Id) { await Context.Channel.SendMessageAsync($"{Context.User.Mention} attacks {user.Mention} with a power of {DBFuncs.GetPowerLVL(Context.User)}."); await target.Hurt(Context.Channel, DBFuncs.GetPowerLVL(Context.User)); } else { await Context.Channel.SendMessageAsync("That person is not here."); } }