source:
advance-wars/src/com/medievaltech/unit/Soldier.java@
41c11dd
Last change on this file since 41c11dd was 41c11dd, checked in by , 13 years ago | |
---|---|
|
|
File size: 1.2 KB |
Rev | Line | |
---|---|---|
[113d7cf] | 1 | package com.medievaltech.unit; |
[a0f5455] | 2 | |
3 | import java.util.List; | |
4 | ||
5 | import android.graphics.Point; | |
6 | ||
[41c11dd] | 7 | import com.medievaltech.advancewars.Player; |
8 | import com.medievaltech.advancewars.Static; | |
9 | import com.medievaltech.advancewars.Tile; | |
[fea4b77] | 10 | import com.medievaltech.advancewars.Enum.*; |
11 | ||
[a0f5455] | 12 | public class Soldier extends Unit{ |
[c3ad11c] | 13 | public Soldier(Player p) |
[78d3c6f] | 14 | { |
[1a1e8c7] | 15 | super(p); |
[ebaddd9] | 16 | |
[b23048f] | 17 | move = 3; |
[78d3c6f] | 18 | |
[fea4b77] | 19 | type = UnitType.LAND; |
[78d3c6f] | 20 | minAttackRange = 1; |
21 | maxAttackRange = 1; | |
[1a1e8c7] | 22 | } |
23 | ||
[a0f5455] | 24 | @Override |
[a79ce1b] | 25 | public void move(Point point) { |
[a0f5455] | 26 | // TODO Auto-generated method stub |
[a79ce1b] | 27 | |
[a0f5455] | 28 | } |
29 | ||
30 | @Override | |
[a79ce1b] | 31 | public void attack(Point point) { |
[41c11dd] | 32 | Tile t = Static.map.getTile(point); |
33 | ||
34 | if(t.currentUnit == null && t.currentBuilding != null) { | |
35 | t.currentBuilding.currentHealth -= this.currentHealth; | |
36 | ||
37 | if(t.currentBuilding.currentHealth <= 0) { | |
38 | t.currentBuilding.owner = this.owner; | |
39 | t.currentBuilding.currentHealth = t.currentBuilding.maxHealth; | |
40 | } | |
41 | } | |
[a0f5455] | 42 | } |
43 | ||
44 | @Override | |
[ebaddd9] | 45 | public List<Point> getMovementRange() { |
46 | return super.getMovementRange(); | |
[a0f5455] | 47 | } |
48 | ||
49 | @Override | |
50 | public void die() | |
51 | { | |
52 | ||
53 | } | |
54 | ||
55 | @Override | |
56 | public List<Point> getAttackRange() { | |
57 | // TODO Auto-generated method stub | |
58 | return null; | |
59 | } | |
60 | ||
61 | ||
62 | } |
Note:
See TracBrowser
for help on using the repository browser.