本文整理汇总了C#中CardEffect类的典型用法代码示例。如果您正苦于以下问题:C# CardEffect类的具体用法?C# CardEffect怎么用?C# CardEffect使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
CardEffect类属于命名空间,在下文中一共展示了CardEffect类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: UseCardEffect
/// <summary>
/// First Effect: Draw 2 cards
/// Second Effect: Restore 5 Health
/// </summary>
/// <param name="cardEffect">The card effect to use</param>
/// <param name="target">The target of the heal</param>
public void UseCardEffect(CardEffect cardEffect, IDamageableEntity target = null)
{
if (cardEffect == CardEffect.FIRST)
{
// Draw cards
this.Owner.DrawCards(DRAW_COUNT);
}
else if (cardEffect == CardEffect.SECOND)
{
// Heal
if (target == null)
{
throw new InvalidOperationException("Needs to have a target!");
}
bool shouldAbort;
GameEventManager.Healing(this.Owner, target, HEAL_AMOUNT, out shouldAbort);
if (!shouldAbort)
{
target.TakeHealing(HEAL_AMOUNT);
}
}
else
{
throw new InvalidOperationException("You must choose a card effect to play it!");
}
}
示例2: Activate
public override void Activate(IDamageableEntity target = null, CardEffect cardEffect = CardEffect.NONE)
{
int totalSpellDamage = MAX_SPELL_POWER + this.BonusSpellPower;
GameEngine.GameState.CurrentPlayer.TakeDamage(totalSpellDamage);
GameEngine.GameState.WaitingPlayer.TakeDamage(totalSpellDamage);
GameEngine.GameState.CurrentPlayerPlayZone.Where(card => card != null).ToList().ForEach(card => ((IDamageableEntity)card).TakeDamage(totalSpellDamage));
GameEngine.GameState.WaitingPlayerPlayZone.Where(card => card != null).ToList().ForEach(card => ((IDamageableEntity)card).TakeDamage(totalSpellDamage));
}
示例3: Activate
public override void Activate(IDamageableEntity target = null, CardEffect cardEffect = CardEffect.NONE)
{
if (target == null)
{
throw new ArgumentNullException("Fireball must be cast with target in mind");
}
// Deal damage to the target
var damageToDeal = MAX_SPELL_POWER + this.BonusSpellPower;
target.TakeDamage(damageToDeal);
}
示例4: UseCardEffect
public void UseCardEffect(CardEffect cardEffect, IDamageableEntity target = null)
{
if (cardEffect == CardEffect.FIRST)
{
this.TakeBuff(ATTACK_BUFF, 0);
}
else if (cardEffect == CardEffect.SECOND)
{
this.TakeBuff(0, HEALTH_BUFF);
this.ApplyStatusEffects(MinionStatusEffects.TAUNT);
}
else
{
throw new InvalidOperationException("You must choose a card effect to play!");
}
}
示例5: Activate
public override void Activate(IDamageableEntity target = null, CardEffect cardEffect = CardEffect.NONE)
{
throw new NotImplementedException();
}
示例6: Activate
public override void Activate(IDamageableEntity target = null, CardEffect cardEffect = CardEffect.NONE)
{
this.Owner.Mana = Math.Min(this.Owner.Mana + 1, Constants.MAX_MANA_CAPACITY);
}
示例7: Activate
/// <summary>
/// Activates the spell card with an optional target
/// </summary>
/// <param name="target">The target for the spell card if applicable</param>
/// <param name="cardEffect">The card effect to use</param>
public abstract void Activate(IDamageableEntity target = null, CardEffect cardEffect = CardEffect.NONE);
示例8: Activate
public override void Activate(IDamageableEntity target = null, CardEffect cardEffect = CardEffect.NONE)
{
GameEngine.GameState.WaitingPlayerPlayZone.ForEach(minion => this.HealTarget((BaseMinion)minion, MAX_SPELL_POWER));
GameEngine.GameState.CurrentPlayerPlayZone.ForEach(minion => this.HealTarget((BaseMinion)minion, MAX_SPELL_POWER));
}