summaryrefslogtreecommitdiffstats
path: root/Piece.gd
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2020-07-19 21:48:21 +0200
committerJérémy Zurcher <jeremy@asynk.ch>2020-07-19 21:48:21 +0200
commitdc4c8275bf7fe7b22783b5ed366e3eb9c0b83a5b (patch)
treed8304166c647f39b564d078bf085bb31a45bc21b /Piece.gd
parentfcfcddfdae168cd42491210528ff51f476b4dfb8 (diff)
downloadgodot-hexgrid-dc4c8275bf7fe7b22783b5ed366e3eb9c0b83a5b.zip
godot-hexgrid-dc4c8275bf7fe7b22783b5ed366e3eb9c0b83a5b.tar.gz
implement range Of Influence
Diffstat (limited to 'Piece.gd')
-rw-r--r--Piece.gd11
1 files changed, 11 insertions, 0 deletions
diff --git a/Piece.gd b/Piece.gd
index 1a9e357..8725cc2 100644
--- a/Piece.gd
+++ b/Piece.gd
@@ -22,3 +22,14 @@ func move_cost(src : Tile, dst : Tile, orientation : int) -> int:
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