summaryrefslogtreecommitdiffstats
path: root/addons/hexgrid/Piece.gd
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2021-08-28 11:07:19 +0200
committerJérémy Zurcher <jeremy@asynk.ch>2021-08-28 11:07:19 +0200
commit54311e2b4194ccad0d28b60a718da8cb01c89f80 (patch)
treea2a8d7be55566b26c00df04df872590cadbea60a /addons/hexgrid/Piece.gd
parent5dc80e37eb13931f3bdbacffaad5a945732e1209 (diff)
downloadgodot-hexgrid-54311e2b4194ccad0d28b60a718da8cb01c89f80.zip
godot-hexgrid-54311e2b4194ccad0d28b60a718da8cb01c89f80.tar.gz
set addons/hexgrid, closess #2
Diffstat (limited to 'addons/hexgrid/Piece.gd')
-rw-r--r--addons/hexgrid/Piece.gd35
1 files changed, 35 insertions, 0 deletions
diff --git a/addons/hexgrid/Piece.gd b/addons/hexgrid/Piece.gd
new file mode 100644
index 0000000..e84208f
--- /dev/null
+++ b/addons/hexgrid/Piece.gd
@@ -0,0 +1,35 @@
+#warning-ignore-all:unused_argument
+extends Node2D
+
+class_name Piece, "res://addons/hexgrid/Piece.png"
+
+# movement points
+func get_mp() -> int:
+ print("Piece#get_mp() must be overriden in a subclass")
+ return 0
+
+# movement point bonus if you start your movement on a road and follow it
+func road_march_bonus() -> int:
+ print("Piece#road_march_bonus() must be overriden in a subclass")
+ return 0
+
+# movement cost from a Tile to another adjacent Tile
+func move_cost(src : Tile, dst : Tile, orientation : int) -> int:
+ print("Piece#move_cost() must be overriden in a subclass")
+ return -1 # impracticable
+
+# are you allowed to move into that Tile as only move even if you don't have enough movement points
+func at_least_one_tile(dst : Tile) -> bool:
+ print("Piece#at_least_one_tile() must be overriden in a subclass")
+ return true
+
+# the maximum range of fire with a given category of weapon
+func max_range_of_fire(category : int, from : Tile) -> int:
+ print("Piece#max_range_of_fire() must be overriden in a subclass")
+ return 0
+
+# the projected volume of fire with a given category of weapon at a given distance,
+# out of a given Tile with a given orientation, into a given Tile with a given orientation
+func volume_of_fire(category : int, distance : int, src : Tile, src_o : int, dst : Tile, dst_o : int) -> int:
+ print("Piece#volume_of_fire() must be overriden in a subclass")
+ return -1 # out of range