/// <summary> /// 使用这张卡牌 /// </summary> /// <param name="user">发起玩家</param> /// <param name="target">目标玩家</param> /// <returns>获取用于等待使用结束的 Task 对象</returns> public override Task UseCard(SimpleGamePlayer user, SimpleGamePlayer target, CancellationToken token) { AnnounceSpecialCardUsed(user); target.Purify(); return(Task.CompletedTask); }
public override Task UseCard(SimpleGamePlayer user, SimpleGamePlayer target, CancellationToken token) { AnnounceSpecialCardUsed(user); target.HealthPoint += HealingPoint; target.PlayerHost.WriteMessage($"您的生命值恢复了 {HealingPoint} 点,目前生命值 {target.HealthPoint} 。"); return(Task.CompletedTask); }
public override Task UseCard(SimpleGamePlayer user, SimpleGamePlayer target, CancellationToken token) { foreach (var player in user.Game.Players.Where(item => item != user)) { player.DealCards(); user.PlayerHost.WriteMessage("{0} HP:{1,-3}{2} 卡牌:{3}", player.PlayerName, player.HealthPoint, player.Effects, string.Join(", ", player.Cards.Select(item => item.Name))); } return(Task.CompletedTask); }
public AttackEvent(SimpleGamePlayer user, SimpleGamePlayer target, Element element, int point) { InitiatePlayer = user; RecipientPlayer = target; Element = element; AttackPoint = point; Game = user.Game; }
public override Task UseCard(SimpleGamePlayer user, SimpleGamePlayer target, CancellationToken token) { if (Element == null) { throw new InvalidOperationException(); } target.SetEffect(new CurseEffect(Element)); AnnounceSpecialCardUsed(user); return(Task.CompletedTask); }
public override Task UseCard(SimpleGamePlayer user, SimpleGamePlayer target, CancellationToken token) { if (Element == null) { throw new InvalidOperationException(); } if (target.Curse(user, new CurseEffect(Element)) == false) { user.PlayerHost.WriteWarningMessage($"你完成了诅咒的所有工作,但是,它似乎没有奏效。"); } AnnounceSpecialCardUsed(user); return(Task.CompletedTask); }
public override Task UseCard(SimpleGamePlayer user, SimpleGamePlayer target, CancellationToken token) { if (Element == Element.水) { target.Purify(false); } var effect = new ShieldEffect(Element); target.SetEffect(effect); AnnounceSpecialCardUsed(user); target.PlayerHost.WriteMessage($"您使用了{effect.Name},{effect.Description}"); return(Task.CompletedTask); }
public abstract Task UseCard(SimpleGamePlayer user, SimpleGamePlayer target, CancellationToken token);
internal override bool AvailablesWithElement(SimpleGamePlayer player) { return(base.Availables(player)); }
public override bool Availables(SimpleGamePlayer player) { return(false); }
/// <summary> /// 重写 Availables 方法,第一回合不能出攻击牌 /// </summary> /// <param name="player">当前玩家对象</param> /// <returns>卡牌是否可用</returns> public override bool Availables(SimpleGamePlayer player) { return(base.Availables(player) && player.Game.Rounds > 1); }
public async override Task UseCard(SimpleGamePlayer user, SimpleGamePlayer target, CancellationToken token) { var attackEvent = new AttackEvent(user, target, Element, Point); await user.Game.SendGameEvent(attackEvent); }
/// <summary> /// 使用卡牌 /// </summary> /// <param name="user">发起交换的玩家</param> /// <param name="target">要交换的目标玩家</param> /// <param name="token">取消标识</param> /// <returns>用于等待的 Task 对象</returns> public override Task UseCard(SimpleGamePlayer user, SimpleGamePlayer target, CancellationToken token) { user.ExchangeCards(target); return(Task.CompletedTask); }
/// <summary> /// 重写 Availables 方法,只有存在可以附着属性的卡牌的时候才可用属性牌 /// </summary> /// <param name="player">使用卡牌的玩家</param> /// <returns></returns> public override bool Availables(SimpleGamePlayer player) { return(base.Availables(player) && player.Cards.OfType <ElementAttachmentCard>().Any()); }
public override async Task UseCard(SimpleGamePlayer user, SimpleGamePlayer target, CancellationToken token) { await target.StealCardBy(user, token); }