chore(lint): restore green gate

This commit is contained in:
2026-09-04 22:55:49 +02:00
parent 31d62b39c2
commit 1893072b5d
9 changed files with 733 additions and 540 deletions
+7 -4
View File
@@ -2,6 +2,8 @@
from __future__ import annotations
from typing import Literal
from pf1e_simulator.abilities import (
ALERTNESS,
DODGE,
@@ -9,6 +11,7 @@ from pf1e_simulator.abilities import (
IRON_WILL,
LIGHTNING_REFLEXES,
POINT_BLANK_SHOT,
AbilitySpec,
weapon_focus,
)
from pf1e_simulator.combat import CombatantState, CombatEngine
@@ -30,16 +33,16 @@ from pf1e_simulator.rng import ScriptedRng
def _make_hero(
cid: str = "hero",
*,
features: list[object] | None = None,
features: list[AbilitySpec] | None = None,
weapon_name: str = "sword",
weapon_kind: str = "melee",
weapon_kind: Literal["melee", "ranged", "touch"] = "melee",
attack_bonus: int = 5,
damage_bonus: int = 2,
) -> Combatant:
attack = AttackSpec(
id=f"{cid}-w",
name=weapon_name,
kind=weapon_kind, # type: ignore[arg-type]
kind=weapon_kind,
attack_bonus=attack_bonus,
damage=[DamageComponent(formula=parse_dice("1d8"), types=["slashing"])],
damage_bonus=damage_bonus,
@@ -61,7 +64,7 @@ def _make_hero(
speed_land_ft=30,
saves=Saves(fort=5, ref=4, will=3),
attacks=[attack],
features=features or [], # type: ignore[arg-type]
features=features or [],
)
+4 -1
View File
@@ -8,6 +8,8 @@ from typing import TYPE_CHECKING
if TYPE_CHECKING:
from pathlib import Path
from pf1e_simulator.loaders.foundry import Json
from pf1e_simulator.abilities import (
DODGE,
IRON_WILL,
@@ -79,7 +81,8 @@ class TestResolveFeatures:
assert result[1] is DODGE
def test_filters_non_strings(self) -> None:
result = _resolve_features(["Iron Will", 42, None, True], 1) # type: ignore[list-item]
raw: list[Json] = ["Iron Will", 42, None, True]
result = _resolve_features(raw, 1)
assert len(result) == 1
def test_empty_list(self) -> None:
+3 -3
View File
@@ -2,7 +2,7 @@
from __future__ import annotations
from pf1e_simulator.abilities import POWER_ATTACK
from pf1e_simulator.abilities import POWER_ATTACK, AbilitySpec
from pf1e_simulator.combat import CombatantState, CombatEngine
from pf1e_simulator.dice import parse_dice
from pf1e_simulator.grid import Grid
@@ -24,7 +24,7 @@ def _make_fighter(
bab: int = 4,
attack_bonus: int = 5,
damage_bonus: int = 2,
features: list[object] | None = None,
features: list[AbilitySpec] | None = None,
) -> Combatant:
attack = AttackSpec(
id=f"{cid}-w",
@@ -50,7 +50,7 @@ def _make_fighter(
speed_land_ft=30,
saves=Saves(fort=6, ref=2, will=2),
attacks=[attack],
features=features or [], # type: ignore[arg-type]
features=features or [],
)
+2 -1
View File
@@ -407,7 +407,8 @@ class TestSpellDamageWithDr:
"dr": DamageReduction(amount=5, bypass=frozenset()),
})
# 2 save rolls (2 targets in area) + 6 damage dice
engine, c, t = _make_engine(caster, target_with_dr, [2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3])
queue = [2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3]
engine, c, t = _make_engine(caster, target_with_dr, queue)
hp_before = t.hp
engine._cast_spell(c, t, "Fireball")
# Save fails (2), 6d6 rolls all 3 = 18 damage, DR 5/- -> 13 damage