public bool TryPayUpkeep(GameState gameState) { if (gameState.CanPayCost(type.upkeep)) { gameState.PayCost(type.upkeep); return true; } else { return false; } }
public bool CheckAttacks(GameState gameState, int bonusDamage, MinionAnimationBatch attack, MinionAnimationBatch recover, MinionAnimationSequence animation) { if (deleted || (stats.attack+bonusDamage) <= 0 || !gameState.CanPayCost(mtype.attackCost)) return false; if (attack.HasAnimation(this)) return false; Point[] attackOffsets = gameState.getOffsetsForRange(stats.range); if ((stats.attack+bonusDamage) > 0) { foreach (Point p in attackOffsets) { if (CheckAttack(gameState, bonusDamage, new Point(position.X + p.X, position.Y + p.Y), attack, recover)) { return true; } } } return false; }