private PlayerAttack GetAttack(Square pSquare) { string description = $"{Unit.Name} Old Earth Artillery at {pSquare}"; PlayerAttack attack = new PlayerAttack(Unit, pSquare, description); Direction d = Unit.Location.GetDirectionTowards(pSquare); Square other = pSquare.GetSquareTowards(d); Unit first = pSquare.Unit; Unit second = other?.Unit; if (first != null) { attack.AddAction(new UnitDamage(first, DamageType.Direct, 2)); } attack.AddAction(new SquareDamage(pSquare)); if (second != null) { attack.AddAction(new UnitDamage(second, DamageType.Direct, 2)); } if (other != null) { attack.AddAction(new SquareDamage(other)); } return(attack); }
private PlayerAttack GetAttack(Square pSquare) { string description = $"{Unit.Name} Cluster Artillery at {pSquare}"; PlayerAttack attack = new PlayerAttack(Unit, pSquare, description); Unit target; Square other; int damage = Upgrades["BonusDamage"].Purchased ? 2 : 1; foreach (Direction d in Directions.GetDirections()) { other = pSquare.GetSquareTowards(d); if (other != null) { target = other.Unit; if (target != null) { attack.AddAction(new UnitDamage(target, DamageType.Direct, damage)); if (target.IsForceMovable) { attack.AddAction(new UnitPush(target, d)); } } attack.AddAction(new SquareDamage(other)); } } return(attack); }
private PlayerAttack GetInitialAttack(Square pTarget, Direction pDirection) { string description = $"{this.Name} webs and prepares to attack at {pTarget}"; PlayerAttack attack = new PlayerAttack(this, pTarget, description); if (pTarget.Unit != null) { attack.AddAction(new UnitApplyWeb(this, pTarget.Unit)); } attack.AddAction(new EnemyQueueAttack(new EnemyAttack(this, pDirection, 1))); return(attack); }
private PlayerAttack GetInitialAttack(Square pTarget, Direction pDirection) { string description = $"{this.Name} prepares to attack at {pTarget}"; PlayerAttack attack = new PlayerAttack(this, pTarget, description); attack.AddAction(new EnemyQueueAttack(new EnemyAttack(this, pDirection, -1))); return(attack); }
public override PlayerAttack GetFinalAttack(Direction pDirection, int pDistance) { Square target = Location.GetSquareTowards(pDirection, pDistance); if (target == null) { return(null); } string description = $"{this.Name} hits towards {target}"; PlayerAttack attack = new PlayerAttack(this, target, description); if (target.Unit != null) { attack.AddAction(new UnitDamage(target.Unit, DamageType.DirectEnemy, 1)); } attack.AddAction(new SquareDamage(target)); return(attack); }
private PlayerAttack GetAttack(Square pSquare) { string description = $"{Unit.Name} Grav Well at {pSquare}"; PlayerAttack attack = new PlayerAttack(Unit, pSquare, description); Direction direction = pSquare.GetDirectionTowards(Unit.Location); attack.AddAction(new UnitPush(pSquare.Unit, direction)); return(attack); }
private PlayerAttack GetAttack(Direction pDirection) { Square square = Unit.Location; Square target = square.GetSquareTowards(pDirection); Unit unit = target.Unit; Square destination = square.GetSquareTowards(Directions.OppositeDirection(pDirection)); string description = $"{Unit.Name} Vice Fist {pDirection}"; PlayerAttack attack = new PlayerAttack(Unit, target, description); attack.AddAction(new UnitMove(unit, destination)); if (Upgrades["AlliesImmune"].Purchased && unit.Team == Unit.Team) { return(attack); } int damage = Upgrades["BonusDamage"].Purchased ? 3 : 1; attack.AddAction(new UnitDamage(unit, DamageType.Direct, damage)); attack.AddAction(new SquareDamage(destination)); return(attack); }