Combat tactics
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
# resources/resource_definitions/any_combat_tactic_range.gd
|
||||
class_name AnyCombatTacticRange extends CombatTacticRange
|
||||
|
||||
func is_valid_range(distance: int, unit: Unit) -> bool:
|
||||
return true
|
||||
@@ -0,0 +1 @@
|
||||
uid://danory6304bl6
|
||||
10
resources/resource_definitions/attack_combat_tactic.gd
Normal file
10
resources/resource_definitions/attack_combat_tactic.gd
Normal file
@@ -0,0 +1,10 @@
|
||||
class_name AttackCombatTactic extends CombatTactic
|
||||
|
||||
func get_offensive_stats(unit: Unit) -> Variant:
|
||||
return {"atk": unit.current_stats.phys_atk, "hit": unit.current_stats.hit}
|
||||
|
||||
func get_relevant_defense(unit: Unit) -> int:
|
||||
return unit.current_stats.phys_def
|
||||
|
||||
func deals_damage() -> bool:
|
||||
return true
|
||||
@@ -0,0 +1 @@
|
||||
uid://k8xmyrygnrcl
|
||||
@@ -9,6 +9,8 @@ class CombatantStats:
|
||||
var atk: int
|
||||
var def: int
|
||||
var spd: int
|
||||
var available_tactics: Array[CombatTactic] = []
|
||||
var selected_tactic: CombatTactic
|
||||
|
||||
var attacker: CombatantStats
|
||||
var defender: CombatantStats
|
||||
|
||||
13
resources/resource_definitions/combat_tactic.gd
Normal file
13
resources/resource_definitions/combat_tactic.gd
Normal file
@@ -0,0 +1,13 @@
|
||||
class_name CombatTactic extends Resource
|
||||
|
||||
@export var tactic_name: String = ""
|
||||
@export var tactic_range: CombatTacticRange
|
||||
|
||||
func get_offensive_stats(unit: Unit) -> Variant:
|
||||
return null
|
||||
|
||||
func get_relevant_defense(unit: Unit) -> int:
|
||||
return unit.current_stats.phys_def
|
||||
|
||||
func deals_damage() -> bool:
|
||||
return false
|
||||
1
resources/resource_definitions/combat_tactic.gd.uid
Normal file
1
resources/resource_definitions/combat_tactic.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://b67rtbb5gixus
|
||||
5
resources/resource_definitions/combat_tactic_range.gd
Normal file
5
resources/resource_definitions/combat_tactic_range.gd
Normal file
@@ -0,0 +1,5 @@
|
||||
# resources/resource_definitions/combat_tactic_range.gd
|
||||
class_name CombatTacticRange extends Resource
|
||||
|
||||
func is_valid_range(distance: int, unit: Unit) -> bool:
|
||||
return false
|
||||
@@ -0,0 +1 @@
|
||||
uid://5cr4kl14gvd7
|
||||
10
resources/resource_definitions/defend_combat_tactic.gd
Normal file
10
resources/resource_definitions/defend_combat_tactic.gd
Normal file
@@ -0,0 +1,10 @@
|
||||
class_name DefendCombatTactic extends CombatTactic
|
||||
|
||||
func get_offensive_stats(unit: Unit) -> Variant:
|
||||
return null
|
||||
|
||||
func get_relevant_defense(unit: Unit) -> int:
|
||||
return unit.current_stats.phys_def
|
||||
|
||||
func deals_damage() -> bool:
|
||||
return false
|
||||
@@ -0,0 +1 @@
|
||||
uid://dq74qh01wi7sy
|
||||
@@ -0,0 +1,7 @@
|
||||
# resources/resource_definitions/fixed_combat_tactic_range.gd
|
||||
class_name FixedCombatTacticRange extends CombatTacticRange
|
||||
|
||||
@export var tactic_range: int = 1
|
||||
|
||||
func is_valid_range(distance: int, unit: Unit) -> bool:
|
||||
return distance <= tactic_range
|
||||
@@ -0,0 +1 @@
|
||||
uid://6jxhvwrkiq6f
|
||||
@@ -0,0 +1,5 @@
|
||||
# resources/resource_definitions/unit_matching_combat_tactic_range.gd
|
||||
class_name UnitMatchingCombatTacticRange extends CombatTacticRange
|
||||
|
||||
func is_valid_range(distance: int, unit: Unit) -> bool:
|
||||
return distance <= unit.current_stats.atk_range
|
||||
@@ -0,0 +1 @@
|
||||
uid://7locjqufdkgj
|
||||
Reference in New Issue
Block a user