diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2020-07-19 21:48:21 +0200 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2020-07-19 21:48:21 +0200 |
commit | dc4c8275bf7fe7b22783b5ed366e3eb9c0b83a5b (patch) | |
tree | d8304166c647f39b564d078bf085bb31a45bc21b /Hex.gd | |
parent | fcfcddfdae168cd42491210528ff51f476b4dfb8 (diff) | |
download | godot-hexgrid-dc4c8275bf7fe7b22783b5ed366e3eb9c0b83a5b.zip godot-hexgrid-dc4c8275bf7fe7b22783b5ed366e3eb9c0b83a5b.tar.gz |
implement range Of Influence
Diffstat (limited to 'Hex.gd')
-rw-r--r-- | Hex.gd | 14 |
1 files changed, 13 insertions, 1 deletions
@@ -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: |