public override void Run(ConvergeEffectContext context) { foreach (ConvergeObject victim in victims.GetList(context)) { victim.destroyed = true; } }
public override void Run(ConvergeEffectContext context) { foreach (ConvergeObject player in affected.GetList(context)) { player.controller.SkipMana(); } }
public override void Run(ConvergeEffectContext context) { foreach (ConvergeObject subject in subjects.GetList(context)) { subject.tapped = true; } }
public override void Run(ConvergeEffectContext context) { foreach (ConvergeObject subject in subjects.GetList(context)) { subject.WithdrawAttack(); } }
public override void Run(ConvergeEffectContext context) { foreach (ConvergeObject subject in subjects.GetList(context)) { subject.AddEffect(new ConvergeEffect_GainTriggered(abilitySpec, subject, context.source, duration)); } }
public override void Run(ConvergeEffectContext context) { foreach (ConvergeObject patient in patients.GetList(context)) { patient.tapped = false; } }
public override List <ConvergeObject> GetList(ConvergeEffectContext context) { List <ConvergeObject> result = Game1.inPlayList.ToList(); Filter(result, context); return(result); }
public override void Run(ConvergeEffectContext context) { foreach (ConvergeObject victim in victims.GetList(context)) { victim.MoveZone(victim.owner.GetZone(ConvergeZoneId.DiscardPile)); } }
public override void Run(ConvergeEffectContext context) { foreach (ConvergeCommand command in commands) { command.Run(context); } }
public override void Run(ConvergeEffectContext context) { int amountValue = amount.GetValue(context); foreach (ConvergeObject subject in subjects.GetList(context)) { subject.controller.GainLife(amountValue); } }
public override void Run(ConvergeEffectContext context) { int amountValue = amount.GetValue(context); foreach (ConvergeObject patient in patients.GetList(context)) { patient.Heal(amountValue); } }
public override void Run(ConvergeEffectContext context) { int power = powerAmount.GetValue(context); int toughness = toughnessAmount.GetValue(context); foreach (ConvergeObject patient in patients.GetList(context)) { patient.AddEffect(new ConvergeEffect_Upgrade(power, toughness, keywords, context.source, new_art, duration)); } }
public override int GetValue(ConvergeEffectContext context) { int total = 0; foreach (ConvergeObject obj in select.GetList(context)) { total += obj.toughness; } return(total); }
public override bool Test(ConvergeObject subject, ConvergeEffectContext context) { foreach (ConvergeSelector select in cases) { if (!select.Test(subject, context)) { return(false); } } return(true); }
public bool CanTarget(ConvergeObject target, ConvergePlayer you) { if (original.actionTarget == null) { return(false); } ConvergeEffectContext context = new ConvergeEffectContext(this, you); return(original.actionTarget.Test(target, context)); }
public override void Run(ConvergeEffectContext context) { foreach (ConvergeObject player in players.GetList(context)) { ConvergeZone spawnZone = player.controller.GetZone(zoneId); ConvergeObject newSpawned = new ConvergeObject(cardSpec, spawnZone); if (spawnZone.inPlay && newSpawned.cardType.HasFlag(ConvergeCardType.Unit)) { newSpawned.tapped = true; } } }
public override void Run(ConvergeEffectContext context) { List <ConvergeObject> sourcesList = sources.GetList(context); foreach (ConvergeObject victim in victims.GetList(context)) { foreach (ConvergeObject source in sourcesList) { source.Fight(victim, false); } } }
public void DoAttackEffect(ConvergeObject target, ConvergePlayer you) { if (!CanTarget(target, you)) { return; } ConvergeEffectContext context = new ConvergeEffectContext(source, you, this); context.target = target; attackEffect.Run(context); }
public override List <ConvergeObject> GetList(ConvergeEffectContext context) { List <ConvergeObject> players = whose.GetList(context); List <ConvergeObject> result = new List <ConvergeObject>(); foreach (ConvergeObject player in players) { result.AddRange(player.controller.GetZone(zoneId).contents); } Filter(result, context); return(result); }
public override bool Test(ConvergeObject subject, ConvergeEffectContext context) { context.subject = subject; foreach (ConvergeObject potentialController in controller.GetList(context)) { if (potentialController.controller == subject.controller) { return(true); } } return(false); }
public override void Run(ConvergeEffectContext context) { List <ConvergeObject> sourcesList = sources.GetList(context); int amountValue = amount.GetValue(context); foreach (ConvergeObject victim in victims.GetList(context)) { foreach (ConvergeObject source in sourcesList) { source.DealDamage(victim, amountValue, false); } } }
public void CheckTrigger(TriggerData triggerData) { ConvergeEffectContext context = new ConvergeEffectContext(source, source.controller); context.trigger = triggerData; if (spec.triggerPlayer.Test(triggerData.player.homeBase, context) && spec.triggerSubject.Test(triggerData.subject, context) && spec.triggerTarget.Test(triggerData.target, context) && spec.condition.Test(null, context)) { spec.effect.Run(context); } }
public void Activate(ConvergePlayer you) { if (hasTarget) { return; } if (you.TryPayCost(manacost) && source.TryPayAltCost(altCost)) { timesUsed++; ConvergeEffectContext context = new ConvergeEffectContext(source, you, this); effect.Run(context); } }
public virtual void Filter(List <ConvergeObject> list, ConvergeEffectContext context) { for (int Idx = 0; Idx < list.Count();) { if (!Test(list[Idx], context)) { list.RemoveAt(Idx); } else { ++Idx; } } }
public override void Run(ConvergeEffectContext context) { List <ConvergeObject> newControllerList = newControllerSelector.GetList(context); if (newControllerList.Count == 0) { return; } ConvergePlayer newController = newControllerList[0].controller; foreach (ConvergeObject victim in victims.GetList(context)) { victim.AddEffect(new ConvergeEffect_Control(newController, context.source, duration)); } }
public override bool Test(ConvergeObject subject, ConvergeEffectContext context) { if ((subject.zone.zoneId & ConvergeZoneId.Play) == 0) { return(false); } foreach (ConvergeSelector select in filters) { if (!select.Test(subject, context)) { return(false); } } return(true); }
public override bool Test(ConvergeObject subject, ConvergeEffectContext context) { // TO DO: at some point we're going to be sad this isn't checking the zone correctly if (subject.zone.zoneId != zoneId)// || !whose.Test(subject.zone.owner.homeBase, context)) { return(false); } foreach (ConvergeSelector select in filters) { if (!select.Test(subject, context)) { return(false); } } return(true); }
public void ActivateOn(ConvergeObject target, ConvergePlayer you) { if (!hasTarget) { return; } if (!CanTarget(target, you)) { return; } if (you.TryPayCost(manacost) && source.TryPayAltCost(altCost)) { timesUsed++; ConvergeEffectContext context = new ConvergeEffectContext(source, you, this); context.target = target; effect.Run(context); } }
public void PlayOn(ConvergeObject target, ConvergePlayer you) { if (zone.zoneId == ConvergeZoneId.Hand && (cardType.HasFlag(ConvergeCardType.Action) || cardType.HasFlag(ConvergeCardType.Augment)) && CanTarget(target, you) ) { if (you.TryPayCost(cost)) { if (TriggerSystem.HasTriggers(ConvergeTriggerType.PlayCard)) { TriggerSystem.CheckTriggers(ConvergeTriggerType.PlayCard, new TriggerData(you, this, target, 0)); } ConvergeEffectContext context = new ConvergeEffectContext(this, you); context.target = target; original.actionEffect.Run(context); MoveZone(owner.discardPile); } } }
public override bool Test(ConvergeObject subject, ConvergeEffectContext context) { context.subject = subject; int aValue = a.GetValue(context); int bValue = b.GetValue(context); switch (comparison) { case ConvergeComparison.equal: return(aValue == bValue); case ConvergeComparison.notEqual: return(aValue != bValue); case ConvergeComparison.greater: return(aValue > bValue); case ConvergeComparison.less: return(aValue < bValue); case ConvergeComparison.greaterOrEqual: return(aValue >= bValue); case ConvergeComparison.lessOrEqual: return(aValue <= bValue); default: throw new NotImplementedException(); } }