Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.List;
- class Artillery extends Player {
- public Artillery(int id) {
- super(id, 2,CharacterTypes.PLAYER, CharacterTypes.ARTILLERY, 5, 0.5);
- }
- private void dealSplashDamage(Battlefield battlefield, int x, int y) {
- List<int[]> adjacentFields = battlefield.getAdjacentFields(x, y);
- int splashDamage = this.damage - 2;
- for (int[] field : adjacentFields) {
- super.attack(battlefield, field[0], field[1], splashDamage);
- }
- }
- public boolean attack(Battlefield battlefield, int x, int y) {
- boolean result = false;
- result = super.attack(battlefield, x, y);
- this.dealSplashDamage(battlefield, x, y);
- return result;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement