Combat tactics

This commit is contained in:
gamer147
2026-04-04 12:27:35 -04:00
parent 595e389033
commit 68d1406632
22 changed files with 1094 additions and 33 deletions

View File

@@ -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

View File

@@ -0,0 +1 @@
uid://danory6304bl6

View 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

View File

@@ -0,0 +1 @@
uid://k8xmyrygnrcl

View File

@@ -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

View 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

View File

@@ -0,0 +1 @@
uid://b67rtbb5gixus

View 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

View File

@@ -0,0 +1 @@
uid://5cr4kl14gvd7

View 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

View File

@@ -0,0 +1 @@
uid://dq74qh01wi7sy

View File

@@ -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

View File

@@ -0,0 +1 @@
uid://6jxhvwrkiq6f

View File

@@ -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

View File

@@ -0,0 +1 @@
uid://7locjqufdkgj