summaryrefslogtreecommitdiffstats
path: root/Unit.gd
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2020-07-11 00:07:56 +0200
committerJérémy Zurcher <jeremy@asynk.ch>2020-07-11 00:07:56 +0200
commit7fca7e65985deb24d51041d30fb8ea6ed2bd8571 (patch)
tree1c0b918d97b9122a9e1b091654bc5b441609e7c0 /Unit.gd
parent35b1995824bbc3e35ed2488e4034cc6b47c2bc76 (diff)
downloadgodot-hexgrid-7fca7e65985deb24d51041d30fb8ea6ed2bd8571.zip
godot-hexgrid-7fca7e65985deb24d51041d30fb8ea6ed2bd8571.tar.gz
properly implement road march
Diffstat (limited to 'Unit.gd')
-rw-r--r--Unit.gd9
1 files changed, 4 insertions, 5 deletions
diff --git a/Unit.gd b/Unit.gd
index 2de5ed6..cda26c8 100644
--- a/Unit.gd
+++ b/Unit.gd
@@ -4,11 +4,10 @@ extends Piece
class_name Unit, "res://godot/Piece.png"
func get_mp() -> int:
- return 3
+ return 2
func road_march_bonus() -> int:
- return 3
+ return 2
-func move_cost(src : Tile, dst : Tile, a : int) -> int:
- print("from %d %d -> %d %d : %d" % [src.coords.x,src.coords.y,dst.coords.x,dst.coords.y,a])
- return dst.cost()
+func move_cost(src : Tile, dst : Tile, o : int) -> int:
+ return (1 if (src.has_road(o) and dst.type != 3) else dst.cost())