summaryrefslogtreecommitdiffstats
path: root/Hex.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 /Hex.gd
parentfcfcddfdae168cd42491210528ff51f476b4dfb8 (diff)
downloadgodot-hexgrid-dc4c8275bf7fe7b22783b5ed366e3eb9c0b83a5b.zip
godot-hexgrid-dc4c8275bf7fe7b22783b5ed366e3eb9c0b83a5b.tar.gz
implement range Of Influence
Diffstat (limited to 'Hex.gd')
-rw-r--r--Hex.gd14
1 files changed, 13 insertions, 1 deletions
diff --git a/Hex.gd b/Hex.gd
index 1e343b7..77b867e 100644
--- a/Hex.gd
+++ b/Hex.gd
@@ -37,7 +37,19 @@ func height() -> int:
return 0
func elevation() -> int:
- if type == 2: return 2
+ if type == 2: return 3
+ return 0
+
+func range_modifier(category : int) -> int:
+ return (1 if type == 2 else 0)
+
+func attack_modifier(category : int, orientation : int) -> int:
+ return (2 if type == 1 else 0)
+
+func defense_value(category : int, orientation : int) -> int:
+ if type == 0: return 2
+ elif type == 1: return 1
+ elif type == 2: return 1
return 0
func block_los(from : Tile, to : Tile, d : float, dt : float) -> bool: