summaryrefslogtreecommitdiffstats
path: root/Unit.gd
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2020-07-10 14:01:43 +0200
committerJérémy Zurcher <jeremy@asynk.ch>2020-07-10 14:01:43 +0200
commited517bbfd0e10abd9bc571131188061a7221d103 (patch)
tree1c2d4e6b68f785d1f9be8af3ac30c18ea8f234ad /Unit.gd
parent560b2702f1dfe2836c7127dbae7f7d3b515510c6 (diff)
downloadgodot-hexgrid-ed517bbfd0e10abd9bc571131188061a7221d103.zip
godot-hexgrid-ed517bbfd0e10abd9bc571131188061a7221d103.tar.gz
implement possible_moves()
Diffstat (limited to 'Unit.gd')
-rw-r--r--Unit.gd14
1 files changed, 14 insertions, 0 deletions
diff --git a/Unit.gd b/Unit.gd
new file mode 100644
index 0000000..2de5ed6
--- /dev/null
+++ b/Unit.gd
@@ -0,0 +1,14 @@
+#warning-ignore-all:unused_argument
+extends Piece
+
+class_name Unit, "res://godot/Piece.png"
+
+func get_mp() -> int:
+ return 3
+
+func road_march_bonus() -> int:
+ return 3
+
+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()