游戏可以运行

This commit is contained in:
2026-05-24 12:34:49 +08:00
parent 0670598bf4
commit 34ce39930c
12 changed files with 94 additions and 31 deletions

View File

@@ -79,12 +79,17 @@ class Battlefield:
def resolve_attack(self, attacker, defender):
dead = []
owner = self._get_unit_owner(attacker)
if owner:
attack_cost = owner.get_attack_cost(attacker)
if owner.provisions < attack_cost:
return dead
owner.provisions -= attack_cost
atk = attacker.get_effective_attack()
if "siege" in attacker.abilities and defender == "capital":
atk *= 2
owner = self._get_unit_owner(attacker)
if (owner and owner.faction_id == "han"
and attacker.unit_type == "archer" and defender == "capital"):
atk += 1