public override int MockOnPlay(MockUnit mo, HexEvaluator he) { if(mo.CurrentHealth < mo.MaxHealth) { if(mo.MaxHealth - mo.CurrentHealth < 5) { mo.CurrentHealth = mo.MaxHealth; } else { mo.CurrentHealth += 5; } } return mo.Value(he); }
public int MockAttack(MockUnit target, HexEvaluator he) { int oldValue = Value (he); int oldTargetValue = target.Value (he); int dmgTaken = target.Buffs.Exists (b => b is DeathTouchBuff) ? int.MaxValue : target.Attack; if(Buffs.Exists(b => b is RangedBuff)) { Buffs.RemoveAll(b => b is ForceFieldBuff); dmgTaken = 0; } int dmgInflicted = Buffs.Exists(b => b is ForceFieldBuff) ? 0 : Buffs.Exists(b => b is DeathTouchBuff) ? int.MaxValue : Attack; if(target.Buffs.Exists(b => b is RangedBuff)) { target.Buffs.RemoveAll(b => b is ForceFieldBuff); dmgInflicted = 0; } if(dmgTaken > CurrentHealth) { // I die if(dmgInflicted > target.CurrentHealth) { // Target dies return 10 * (oldValue - oldTargetValue); } else { // Target survives return 10 * (dmgInflicted - oldValue); } } else { // I survive if(dmgInflicted > target.CurrentHealth) { // Target dies return 10 * (oldTargetValue - (oldValue - Value(he)) - // Change in my value (he(target.Hex) - he(Hex)) - // Change in value of hex dmgTaken); // Damage taken; } else { // Target survives return 10 * ((oldTargetValue - target.Value (he)) + // Change in target value (from buffs etc) dmgInflicted - // Damage taken by target (oldValue - Value(he)) - // Change in my value (he(Hex) - he(target.Hex)) - // Change in value of hex dmgTaken); // Damage taken } } }
int SpellOnHexValue(SpellCard sCard, Hex hex) { if(hex.Unit != null) { MockUnit mo = new MockUnit(hex.Unit); int originValue = mo.Value(CalculateHexValue); int newValue = sCard.MockOnPlay(mo, CalculateHexValue); if(mo.Team == player.Team) { return ((originValue - newValue) * -1); } else { return ((originValue - newValue)); } } return -1; }
public override int MockOnPlay(MockUnit mo, HexEvaluator he) { mo.Movement = 1; return mo.Value(he); }
public override int MockOnPlay(MockUnit mo, HexEvaluator he) { mo.CurrentHealth -= 3; return mo.Value (he); }
public override int MockOnPlay(MockUnit mo, HexEvaluator he) { int draw = mo.Buffs.Count * 3; mo.Buffs = new List<UnitBuff>(); return mo.Value(he) - draw; }