dnd5e-engine 0.7.0__tar.gz → 0.8.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (273) hide show
  1. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/CHANGELOG.md +91 -0
  2. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/PKG-INFO +2 -2
  3. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/pyproject.toml +6 -5
  4. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/src/dnd5e_engine/__init__.py +2 -0
  5. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/src/dnd5e_engine/activities/__init__.py +1 -1
  6. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/src/dnd5e_engine/activities/apply.py +24 -17
  7. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/src/dnd5e_engine/activities/attack.py +47 -11
  8. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/src/dnd5e_engine/activities/build_context.py +14 -11
  9. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/src/dnd5e_engine/activities/cast.py +4 -6
  10. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/src/dnd5e_engine/activities/check.py +15 -20
  11. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/src/dnd5e_engine/activities/context.py +32 -32
  12. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/src/dnd5e_engine/activities/damage.py +2 -3
  13. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/src/dnd5e_engine/activities/dice.py +8 -12
  14. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/src/dnd5e_engine/activities/heal.py +3 -5
  15. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/src/dnd5e_engine/activities/mastery.py +11 -2
  16. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/src/dnd5e_engine/activities/save.py +7 -12
  17. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/src/dnd5e_engine/activities/save_primitive.py +13 -17
  18. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/src/dnd5e_engine/events.py +20 -1
  19. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/src/dnd5e_engine/orchestrator.py +612 -140
  20. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/src/dnd5e_engine/outcome.py +21 -0
  21. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/src/dnd5e_engine/spatial.py +114 -3
  22. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/src/dnd5e_engine/specs.py +14 -1
  23. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/src/dnd5e_engine/testing.py +26 -0
  24. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/src/dnd5e_engine/views.py +21 -2
  25. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/tests/activities/test_attack_advantage_live.py +1 -1
  26. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/tests/activities/test_build_context.py +5 -5
  27. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/tests/activities/test_damage_count_marker_scaling.py +2 -2
  28. dnd5e_engine-0.8.0/tests/activities/test_knock_out_resolver.py +325 -0
  29. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/tests/activities/test_monster_action_ranking.py +1 -1
  30. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/tests/activities/test_monster_actions.py +1 -1
  31. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/tests/e2e/test_c03_effect_modes.py +2 -2
  32. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/tests/e2e/test_c16_spatial_targeting.py +6 -5
  33. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/tests/e2e/test_c18_monster_economy.py +5 -5
  34. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/tests/e2e/test_c19_character_derivation.py +3 -3
  35. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/tests/e2e/test_c20_class_features.py +19 -20
  36. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/tests/e2e/test_c21_summons.py +6 -6
  37. dnd5e_engine-0.8.0/tests/e2e/test_c31_sides_targets_knockout.py +216 -0
  38. dnd5e_engine-0.8.0/tests/fixtures/payloads_0_7_0.json +417 -0
  39. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/tests/test_action_economy_attacks.py +5 -6
  40. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/tests/test_active_effect_schema.py +1 -1
  41. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/tests/test_apply_changes_to_check.py +1 -1
  42. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/tests/test_build_context_abilities.py +6 -6
  43. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/tests/test_build_party_c19.py +1 -1
  44. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/tests/test_c16_orchestrator.py +39 -6
  45. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/tests/test_c16b_vision.py +4 -4
  46. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/tests/test_c17_slots.py +4 -4
  47. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/tests/test_c18_monster_economy_units.py +17 -17
  48. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/tests/test_c21_roster_primitives.py +1 -1
  49. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/tests/test_capability_matrix.py +26 -6
  50. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/tests/test_combat_bucket_keys.py +8 -8
  51. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/tests/test_combat_flag_advantage.py +4 -5
  52. dnd5e_engine-0.8.0/tests/test_combat_sides.py +268 -0
  53. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/tests/test_concentration_repeat_save_identity.py +1 -1
  54. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/tests/test_docstrings_are_host_agnostic.py +30 -27
  55. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/tests/test_dodge_help_hide.py +1 -1
  56. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/tests/test_duration_tick_at_turn_end.py +10 -13
  57. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/tests/test_effects_builder_internals.py +0 -3
  58. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/tests/test_enchantment_sidecar_projection.py +11 -12
  59. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/tests/test_end_combat_snapshot.py +1 -1
  60. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/tests/test_expire_clears_active_conditions.py +6 -8
  61. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/tests/test_get_actor_active_effects.py +1 -1
  62. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/tests/test_grapple_shove_stand_up.py +1 -1
  63. dnd5e_engine-0.8.0/tests/test_item_cast_areas.py +232 -0
  64. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/tests/test_iter11_fixes.py +3 -3
  65. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/tests/test_iter13_fixes.py +4 -4
  66. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/tests/test_iter5_fixes.py +4 -5
  67. dnd5e_engine-0.8.0/tests/test_knock_out.py +914 -0
  68. dnd5e_engine-0.8.0/tests/test_live_view_deaths.py +264 -0
  69. dnd5e_engine-0.8.0/tests/test_monster_closing_walk.py +384 -0
  70. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/tests/test_monster_legacy_swing.py +2 -2
  71. dnd5e_engine-0.8.0/tests/test_monster_target_override.py +271 -0
  72. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/tests/test_opportunity_attack_context.py +1 -1
  73. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/tests/test_orchestrator_gating_typed.py +1 -1
  74. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/tests/test_orchestrator_grid_combat.py +8 -11
  75. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/tests/test_orchestrator_item_charges.py +4 -4
  76. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/tests/test_orchestrator_monster_typed.py +11 -15
  77. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/tests/test_orchestrator_pc_resolution_typed.py +6 -6
  78. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/tests/test_phase6_public_surface.py +3 -3
  79. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/tests/test_public_api_surface.py +9 -0
  80. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/tests/test_resolve_check.py +2 -2
  81. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/tests/test_resolve_check_flag_advantage.py +4 -5
  82. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/tests/test_resolve_check_specific_buckets.py +4 -5
  83. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/tests/test_rest.py +1 -1
  84. dnd5e_engine-0.8.0/tests/test_rng_factory_seam.py +137 -0
  85. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/tests/test_smoke.py +1 -1
  86. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/tests/test_spellcasting.py +3 -3
  87. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/tests/test_start_combat_active_effects.py +1 -1
  88. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/tests/test_start_combat_seeds_lifecycle.py +5 -5
  89. dnd5e_engine-0.8.0/tests/test_stored_payload_compat.py +91 -0
  90. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/tests/test_types_smoke.py +2 -3
  91. dnd5e_engine-0.8.0/tests/test_wall_index.py +261 -0
  92. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/tests/test_weapon_masteries_c15.py +4 -4
  93. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/.gitignore +0 -0
  94. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/LICENSE +0 -0
  95. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/Makefile +0 -0
  96. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/NOTICE +0 -0
  97. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/README.md +0 -0
  98. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/scripts/_smoke_grid_combat.py +0 -0
  99. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/scripts/smoke_clean_install.sh +0 -0
  100. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/src/dnd5e_engine/activities/actor_stats.py +0 -0
  101. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/src/dnd5e_engine/activities/conjuration.py +0 -0
  102. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/src/dnd5e_engine/activities/d20.py +0 -0
  103. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/src/dnd5e_engine/activities/effects.py +0 -0
  104. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/src/dnd5e_engine/activities/forced_movement.py +0 -0
  105. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/src/dnd5e_engine/activities/formula.py +0 -0
  106. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/src/dnd5e_engine/activities/monster_actions.py +0 -0
  107. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/src/dnd5e_engine/activities/passive_stats.py +0 -0
  108. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/src/dnd5e_engine/activities/resolver.py +0 -0
  109. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/src/dnd5e_engine/activities/scale.py +0 -0
  110. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/src/dnd5e_engine/areas.py +0 -0
  111. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/src/dnd5e_engine/build_party.py +0 -0
  112. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/src/dnd5e_engine/build_spec.py +0 -0
  113. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/src/dnd5e_engine/check.py +0 -0
  114. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/src/dnd5e_engine/death_saves.py +0 -0
  115. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/src/dnd5e_engine/lib_loader.py +0 -0
  116. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/src/dnd5e_engine/py.typed +0 -0
  117. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/src/dnd5e_engine/rest.py +0 -0
  118. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/src/dnd5e_engine/results.py +0 -0
  119. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/src/dnd5e_engine/rules/__init__.py +0 -0
  120. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/src/dnd5e_engine/rules/character.py +0 -0
  121. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/src/dnd5e_engine/rules/choices.py +0 -0
  122. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/src/dnd5e_engine/rules/conditions.py +0 -0
  123. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/src/dnd5e_engine/rules/dice.py +0 -0
  124. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/src/dnd5e_engine/rules/effects.py +0 -0
  125. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/src/dnd5e_engine/rules/skills.py +0 -0
  126. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/src/dnd5e_engine/rules/uses.py +0 -0
  127. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/src/dnd5e_engine/spellcasting.py +0 -0
  128. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/src/dnd5e_engine/turn_lifecycle.py +0 -0
  129. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/src/dnd5e_engine/types/__init__.py +0 -0
  130. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/src/dnd5e_engine/types/combat.py +0 -0
  131. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/src/dnd5e_engine/types/conditions.py +0 -0
  132. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/src/dnd5e_engine/types/effects.py +0 -0
  133. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/tests/__init__.py +0 -0
  134. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/tests/activities/__init__.py +0 -0
  135. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/tests/activities/test_actor_stats.py +0 -0
  136. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/tests/activities/test_apply_damage_magical.py +0 -0
  137. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/tests/activities/test_attack_condition_rows.py +0 -0
  138. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/tests/activities/test_attack_opportunity_flag.py +0 -0
  139. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/tests/activities/test_attack_unseen.py +0 -0
  140. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/tests/activities/test_c18_trait_consumers.py +0 -0
  141. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/tests/activities/test_cast_level_override.py +0 -0
  142. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/tests/activities/test_condition_immunity.py +0 -0
  143. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/tests/activities/test_conjuration_routing.py +0 -0
  144. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/tests/activities/test_d20.py +0 -0
  145. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/tests/activities/test_feat_riders.py +0 -0
  146. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/tests/activities/test_multiattack_fidelity.py +0 -0
  147. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/tests/activities/test_multiattack_opaque_ids.py +0 -0
  148. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/tests/activities/test_resolve_check_activity.py +0 -0
  149. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/tests/activities/test_save_dc_and_damage_exprs.py +0 -0
  150. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/tests/activities/test_save_ignore_cover.py +0 -0
  151. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/tests/activities/test_save_magic_resistance.py +0 -0
  152. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/tests/activities/test_save_primitive.py +0 -0
  153. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/tests/activities/test_summon_registry.py +0 -0
  154. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/tests/activities/test_weapon_mastery.py +0 -0
  155. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/tests/c20_support.py +0 -0
  156. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/tests/c21_support.py +0 -0
  157. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/tests/conftest.py +0 -0
  158. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/tests/e2e/__init__.py +0 -0
  159. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/tests/e2e/harness.py +0 -0
  160. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/tests/e2e/test_c00_harness_sanity.py +0 -0
  161. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/tests/e2e/test_c01_dataset_fixes.py +0 -0
  162. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/tests/e2e/test_c02_small_mechanics.py +0 -0
  163. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/tests/e2e/test_c04_caster_plumbing.py +0 -0
  164. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/tests/e2e/test_c05_spatial.py +0 -0
  165. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/tests/e2e/test_c06_reactions.py +0 -0
  166. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/tests/e2e/test_c07_sneak_and_repertoire.py +0 -0
  167. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/tests/e2e/test_c08_passive_projection.py +0 -0
  168. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/tests/e2e/test_c09_rest.py +0 -0
  169. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/tests/e2e/test_c10_monster_behavior.py +0 -0
  170. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/tests/e2e/test_c11_item_charges.py +0 -0
  171. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/tests/e2e/test_c12_conditions.py +0 -0
  172. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/tests/e2e/test_c13_concentration.py +0 -0
  173. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/tests/e2e/test_c14_action_economy.py +0 -0
  174. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/tests/e2e/test_c15_attack_rules.py +0 -0
  175. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/tests/e2e/test_c17_slots_and_rests.py +0 -0
  176. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/tests/e2e/test_c22_dataset.py +0 -0
  177. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/tests/e2e/test_c24_grid_reactions.py +0 -0
  178. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/tests/e2e/test_c26_area_targeting.py +0 -0
  179. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/tests/e2e/test_c27_monster_senses_conditions.py +0 -0
  180. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/tests/e2e/test_c28_feats.py +0 -0
  181. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/tests/test_active_effect_resistance_fold.py +0 -0
  182. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/tests/test_active_effect_statuses_order.py +0 -0
  183. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/tests/test_apply_modifiers.py +0 -0
  184. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/tests/test_areas.py +0 -0
  185. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/tests/test_attack_classification.py +0 -0
  186. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/tests/test_attack_range_tiers.py +0 -0
  187. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/tests/test_build_party.py +0 -0
  188. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/tests/test_build_party_initiative.py +0 -0
  189. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/tests/test_build_party_passives.py +0 -0
  190. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/tests/test_build_spec_multiclass.py +0 -0
  191. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/tests/test_c16_spatial.py +0 -0
  192. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/tests/test_c20_action_surge.py +0 -0
  193. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/tests/test_c20_bardic_inspiration.py +0 -0
  194. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/tests/test_c20_cunning_action.py +0 -0
  195. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/tests/test_c20_feature_uses.py +0 -0
  196. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/tests/test_c20_fighting_styles.py +0 -0
  197. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/tests/test_c20_multiclass_live.py +0 -0
  198. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/tests/test_c20_rage.py +0 -0
  199. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/tests/test_c20_unarmed_and_monk.py +0 -0
  200. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/tests/test_c21_concentration_anchor.py +0 -0
  201. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/tests/test_c21_magic_weapon.py +0 -0
  202. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/tests/test_c21_polymorph.py +0 -0
  203. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/tests/test_c21_roster_events.py +0 -0
  204. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/tests/test_c21_spiritual_weapon.py +0 -0
  205. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/tests/test_c21_stat_block_commands.py +0 -0
  206. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/tests/test_c21_summon_allegiance.py +0 -0
  207. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/tests/test_c21_summon_dragon.py +0 -0
  208. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/tests/test_c21_summon_turns.py +0 -0
  209. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/tests/test_c21_surface.py +0 -0
  210. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/tests/test_c21_transform_core.py +0 -0
  211. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/tests/test_c21_wild_shape.py +0 -0
  212. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/tests/test_c25_zone_graph_removal.py +0 -0
  213. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/tests/test_c26_monster_areas.py +0 -0
  214. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/tests/test_c26_pc_areas.py +0 -0
  215. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/tests/test_c27_condition_clauses.py +0 -0
  216. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/tests/test_c27_template_senses.py +0 -0
  217. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/tests/test_c28_feat_build.py +0 -0
  218. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/tests/test_c28_feats_in_combat.py +0 -0
  219. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/tests/test_c28_magic_initiate_combat.py +0 -0
  220. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/tests/test_concentration_check_event.py +0 -0
  221. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/tests/test_concentration_drop_effect_name.py +0 -0
  222. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/tests/test_concentration_lifecycle_drops.py +0 -0
  223. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/tests/test_concentration_save_modifier.py +0 -0
  224. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/tests/test_concentration_timed_expiry.py +0 -0
  225. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/tests/test_cover_bonus_sidecar.py +0 -0
  226. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/tests/test_coverage_backfill_death_saves.py +0 -0
  227. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/tests/test_coverage_backfill_seam_errors.py +0 -0
  228. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/tests/test_death_saves_exhaustion.py +0 -0
  229. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/tests/test_derive_sheet.py +0 -0
  230. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/tests/test_determinism_contract.py +0 -0
  231. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/tests/test_effect_timed_expiry.py +0 -0
  232. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/tests/test_end_combat_retention.py +0 -0
  233. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/tests/test_feature_save_dc_no_spell_override.py +0 -0
  234. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/tests/test_flee_stance.py +0 -0
  235. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/tests/test_gen2_has_no_gen1_imports.py +0 -0
  236. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/tests/test_grid_opportunity_attacks.py +0 -0
  237. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/tests/test_grid_topology.py +0 -0
  238. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/tests/test_incapacitated_by_effect.py +0 -0
  239. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/tests/test_initiative_rolling.py +0 -0
  240. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/tests/test_lib_loader.py +0 -0
  241. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/tests/test_lib_loader_configure.py +0 -0
  242. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/tests/test_live_combat_view.py +0 -0
  243. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/tests/test_loading_property.py +0 -0
  244. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/tests/test_monster_dash.py +0 -0
  245. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/tests/test_monster_flee_retreat.py +0 -0
  246. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/tests/test_opportunity_attack_primitive.py +0 -0
  247. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/tests/test_orchestrator_condition_gates.py +0 -0
  248. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/tests/test_orchestrator_hydration_proficiencies.py +0 -0
  249. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/tests/test_orchestrator_move_mark_typed.py +0 -0
  250. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/tests/test_orchestrator_trait_hydration.py +0 -0
  251. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/tests/test_party_member_reach_ft.py +0 -0
  252. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/tests/test_passive_stats.py +0 -0
  253. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/tests/test_rage_second_wind_e2e.py +0 -0
  254. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/tests/test_reaction_queue.py +0 -0
  255. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/tests/test_repeat_save_runs_once_per_turn.py +0 -0
  256. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/tests/test_resolve_check_c19.py +0 -0
  257. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/tests/test_rules_character.py +0 -0
  258. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/tests/test_rules_choices.py +0 -0
  259. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/tests/test_rules_combat_data_and_skills.py +0 -0
  260. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/tests/test_rules_conditions.py +0 -0
  261. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/tests/test_rules_dice_equipment_spells.py +0 -0
  262. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/tests/test_rules_effects_and_gambits.py +0 -0
  263. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/tests/test_rules_smoke.py +0 -0
  264. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/tests/test_rules_uses.py +0 -0
  265. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/tests/test_save_cover_hydration.py +0 -0
  266. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/tests/test_scale_resolver.py +0 -0
  267. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/tests/test_sneak_attack_resolver.py +0 -0
  268. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/tests/test_spatial_distance.py +0 -0
  269. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/tests/test_turn_lifecycle.py +0 -0
  270. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/tests/test_use_feature_intent.py +0 -0
  271. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/tests/test_versatile_and_attribution.py +0 -0
  272. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/tests/test_weapon_damage_bonus_sidecar.py +0 -0
  273. {dnd5e_engine-0.7.0 → dnd5e_engine-0.8.0}/tests/test_weapon_proficiency.py +0 -0
@@ -7,6 +7,97 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [0.8.0]
11
+
12
+ Lockstep release with `dnd5e-srd-data` 0.8.0 and `nat20-bridge` 0.8.0. The
13
+ engine's floor rises to `dnd5e-srd-data>=0.8.0` (the dataset itself does not
14
+ change); `nat20-bridge` requires both at `>=0.8.0`.
15
+
16
+ An additive minor release: encounter members that fight on the party's side,
17
+ a host-chosen target on a monster's turn, SRD 5.2 knock-outs, item casts that
18
+ place their spell's area, a monster closing walk that honours occupancy, a
19
+ `move` that takes a detour, and a wall index for walled grids. Every new name
20
+ and field is defaulted, and a payload stored under 0.7.0 still validates. A
21
+ host that matches `CombatEvent` exhaustively handles the new `KnockedOut`;
22
+ `docs/migration/v0.7-to-v0.8.md` has every step and every moved seeded pin.
23
+
24
+ ### Added
25
+
26
+ - **`EncounterMemberSpec.side`** and **`Side`** (`dnd5e_engine.specs`) —
27
+ `"encounter"` (the default) or `"party"`: a party-side member joins
28
+ `party_ids`, fights the encounter side and is fought by it, and dies at 0
29
+ Hit Points as a monster does. `start_combat` raises `ValueError` unless at
30
+ least one member fights on the encounter side.
31
+ - **`advance_monster_turn(..., target_id=None)`** — the creature the acting
32
+ monster attacks or targets with a stat-block cast, legendary actions
33
+ included. An id outside the monster's own target pool, or any id on a
34
+ summon's turn, raises `IntentRejectedError("target_invalid")` before the
35
+ turn starts, with nothing rolled, spent or emitted.
36
+ - **`PlayerIntent.knock_out`** — SRD 5.2 Knocking Out a Creature: every melee
37
+ hit of the `attack` that would drop a creature to 0 Hit Points leaves it at
38
+ 1, Unconscious. Refused with the new `knock_out_not_melee` rejection reason,
39
+ before anything is spent, unless every attack the intent resolves is a
40
+ melee attack.
41
+ - **`KnockedOut`** and **`DamageApplied.knock_out`** (`dnd5e_engine.events`):
42
+ `KnockedOut(target_id, attacker_id)` joins the `CombatEvent` union.
43
+ - **`KnockOutRecord`** (top level) and **`CombatOutcome.knock_outs`** — the
44
+ creatures still knocked out when the combat ended, in knock-out order.
45
+ - **`LiveCombatView.knocked_out_ids`** and **`LiveCombatView.deaths`** — the
46
+ creatures knocked out now, and the deaths so far with their killers.
47
+ - **`ActivityResolutionContext.knock_out`** and **`knock_out_exempt_ids`**, the
48
+ same keywords on `build_activity_context`, `apply_damage(knock_out=...)` and
49
+ **`is_melee_attack`** (`dnd5e_engine.activities.attack`).
50
+ - **`dnd5e_engine.testing.rng_factory`** — a test-support context manager
51
+ that scripts or records every die a combat opened inside it draws,
52
+ Initiative included. Process-wide for the block; not for production code.
53
+ - **nat20-bridge**: `POST /v1/combat` takes `allies` (monster slugs seated on
54
+ the party's side); `/advance-monster` takes an optional
55
+ `{"target_id": ...}` body; an intent body takes `knock_out`; the view
56
+ reports `party_ids`, `encounter_ids`, `knocked_out_ids` and `deaths`; a
57
+ knock-out narrates as a line. `target_invalid` and `knock_out_not_melee`
58
+ answer 409.
59
+
60
+ ### Changed
61
+
62
+ - **A `move` takes a detour**: a move to an adjacent cell whose direct step
63
+ crosses a wall or cuts a blocked corner walks the shortest legal route
64
+ around, priced and provoking like any route. `MoveFailed(reason=
65
+ "blocked_path")` now means no route exists, and a detour that costs more
66
+ than the movement left is `insufficient_movement`.
67
+ - **The monster AI's closing walk honours occupancy**: it passes through
68
+ allies, never ends on another creature and never enters an enemy's cell,
69
+ stopping on a free cell in range with line of sight. It walks before it
70
+ Dashes, the Dash priced to the cell it stops on; with no reachable free cell
71
+ in range it walks as far as it can and stops on a free cell, and with no
72
+ route it stays put. A walk with no creature in the way is unchanged.
73
+ - **An item that casts a spell targets as that spell**: a `use_item` whose one
74
+ resolved activity is a `cast` places the spell's area (`AreaTargeted`) and
75
+ reads a scaling count (Magic Missile's darts) at the item's cast level; too
76
+ many `target_ids` is refused before any charge is spent. A spell with an
77
+ attack roll still places no area.
78
+ - **`DeathRecord.killer_id` names the creature that dealt the killing
79
+ damage**, whoever's turn it was: an opportunity attack's reactor, a
80
+ legendary action's monster, a summon, a construct's caster. It used to name
81
+ the creature whose turn it was. `Combatant.last_damaged_by` follows the same
82
+ source.
83
+ - **XP is divided among surviving characters only**, and a foe still knocked
84
+ out at the end is worth its XP, as a dead one is.
85
+ - **`ended_reason` counts a knocked-out creature as out of the fight**; a
86
+ standing party-side ally keeps the party in it, so a combat closed after
87
+ every character has died while an ally stands reads `forced` (or `flee`),
88
+ not `defeat_tpk`.
89
+ - **Wall segments are indexed by the cells they touch**: a step or sight test
90
+ reads only nearby walls, so its cost no longer grows with the wall count.
91
+ Every answer is unchanged.
92
+ - `end_combat` and `LiveCombatView.final_outcome` return a copy of the kept
93
+ outcome each time.
94
+
95
+ ### Fixed
96
+
97
+ - A character already Unconscious from an effect that drops to 0 Hit Points
98
+ emits the `Unconscious` dying marker, as any character at 0 Hit Points does,
99
+ and no longer wakes at 0 Hit Points when that effect ends.
100
+
10
101
  ## [0.7.0]
11
102
 
12
103
  Lockstep release with `dnd5e-srd-data` 0.7.0 and `nat20-bridge` 0.7.0. The
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: dnd5e-engine
3
- Version: 0.7.0
3
+ Version: 0.8.0
4
4
  Summary: Pure-Python D&D 5e SRD rules engine — combat, checks, effects. Host-agnostic, zero I/O.
5
5
  Author: Tapestria contributors
6
6
  License: MIT License
@@ -34,7 +34,7 @@ Classifier: Programming Language :: Python :: 3.13
34
34
  Classifier: Typing :: Typed
35
35
  Requires-Python: >=3.12
36
36
  Requires-Dist: d20>=1.1.2
37
- Requires-Dist: dnd5e-srd-data>=0.7.0
37
+ Requires-Dist: dnd5e-srd-data>=0.8.0
38
38
  Requires-Dist: pydantic>=2.10.0
39
39
  Provides-Extra: dev
40
40
  Requires-Dist: bandit>=1.8.0; extra == 'dev'
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "dnd5e-engine"
7
- version = "0.7.0"
7
+ version = "0.8.0"
8
8
  description = "Pure-Python D&D 5e SRD rules engine — combat, checks, effects. Host-agnostic, zero I/O."
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.12"
@@ -24,10 +24,11 @@ dependencies = [
24
24
  # lib_loader imports BundledAssetLoader at runtime; the typed-Activity
25
25
  # resolver reads the canonical corpus through it. The data lib's >=3.12
26
26
  # floor is why this package now also requires >=3.12 (see requires-python).
27
- # Lockstep floor: the engine reads Feat.repeatable and the canonical feat
28
- # slug in Background.starting_feat_slug, and its areas rely on the
29
- # corrected choice flags, counts and recharges, all new in srd-data 0.7.0.
30
- "dnd5e-srd-data>=0.7.0",
27
+ # Lockstep floor, raised at each minor: srd-data 0.8.0 changes no data,
28
+ # and the engine relies on everything new in 0.7.0 (Feat.repeatable, the
29
+ # canonical feat slug in Background.starting_feat_slug, the corrected area
30
+ # choice flags, counts and recharges).
31
+ "dnd5e-srd-data>=0.8.0",
31
32
  ]
32
33
 
33
34
  [project.optional-dependencies]
@@ -59,6 +59,7 @@ from dnd5e_engine.orchestrator import (
59
59
  from dnd5e_engine.outcome import (
60
60
  CombatOutcome,
61
61
  DeathRecord,
62
+ KnockOutRecord,
62
63
  LootDrop,
63
64
  )
64
65
  from dnd5e_engine.rest import (
@@ -109,6 +110,7 @@ __all__ = [
109
110
  "HitDicePool",
110
111
  "IntentRejectedError",
111
112
  "IntentType",
113
+ "KnockOutRecord",
112
114
  "LiveCombatView",
113
115
  "LootDrop",
114
116
  "PartyMemberSpec",
@@ -1,6 +1,6 @@
1
1
  """Typed Foundry Activity resolver.
2
2
 
3
- Parallel to the legacy ``effects/`` package: consumes the typed
3
+ Consumes the typed
4
4
  ``dnd5e_srd_data`` ``Activity`` discriminated union and emits the engine's
5
5
  existing ``CombatEvent`` union via an ``event_emitter`` callback.
6
6
  """
@@ -1,22 +1,18 @@
1
1
  """Damage application for the Activity resolver — partition by type, apply
2
2
  target-side vulnerability / resistance / immunity, emit ``DamageApplied``.
3
3
 
4
- MIRRORS, does not import from, ``effects/damage.py``:
5
-
6
- * Apply order is vulnerability ×2 → resistance //2 (integer floor) → immunity ⇒ 0,
7
- matching ``_apply_resistance`` (the legacy ``do_resistances`` order). An ``"all"``
8
- wildcard is honored in each list (SRD §Conditions/Petrified emits "all").
9
- * ``is_overkill`` mirrors ``effects/damage.py:192`` — ``final_amount >
10
- target.hp_current`` (strictly greater).
4
+ * Apply order is vulnerability ×2 → resistance //2 (integer floor) → immunity ⇒ 0
5
+ (``_apply_resistance``). An ``"all"`` wildcard is honored in each list
6
+ (SRD §Conditions/Petrified emits "all").
7
+ * ``is_overkill`` is ``final_amount > target.hp_current`` (strictly greater).
11
8
  * The ``DamageApplied`` event is emitted UNCONDITIONALLY after applying
12
- modifiers, exactly as ``effects/damage.py`` does: an immune type yields
13
- ``DamageApplied(amount=0)``, never a suppressed event.
9
+ modifiers: an immune type yields ``DamageApplied(amount=0)``, never a
10
+ suppressed event.
14
11
 
15
- Modifier sources differ from the effects path. ``effects/damage.py`` reads only
16
- the sidecar (``_read_passive_modifiers``); the Activity resolver MERGES the
17
- static ``Combatant`` lists (``damage_resistances`` / ``damage_immunities``) with
18
- the sidecar lists at ``ctx.passive_damage_modifiers[entity_id]``. Vulnerabilities
19
- have no static field on ``Combatant`` and come ONLY from the sidecar.
12
+ Modifier sources: the resolver MERGES the static ``Combatant`` lists
13
+ (``damage_resistances`` / ``damage_immunities``) with the sidecar lists at
14
+ ``ctx.passive_damage_modifiers[entity_id]``. Vulnerabilities have no static
15
+ field on ``Combatant`` and come ONLY from the sidecar.
20
16
 
21
17
  Unknown damage types (outside the SRD 13-type set) are logged with the
22
18
  ``damage_type_invalid`` marker and skipped — the rolled dict is keyed by free
@@ -43,7 +39,7 @@ if TYPE_CHECKING:
43
39
  _LOGGER = logging.getLogger(__name__)
44
40
 
45
41
  # SRD 5.1 §Damage Types — the closed 13-type set, sourced from the DamageType
46
- # Literal so the two never drift. Mirrors ``effects/damage.py:120``.
42
+ # Literal so the two never drift.
47
43
  _SRD_DAMAGE_TYPES: Final[frozenset[str]] = frozenset(get_args(DamageType))
48
44
 
49
45
  # C22 — the SRD Bludgeoning / Piercing / Slashing triple. A magical source
@@ -90,6 +86,7 @@ def apply_damage(
90
86
  magical: bool = False,
91
87
  source_id: str | None = None,
92
88
  is_crit: bool = False,
89
+ knock_out: bool = False,
93
90
  ) -> int:
94
91
  """Apply a per-damage-type rolled amount to ``target`` and emit one
95
92
  ``DamageApplied`` per valid type.
@@ -112,6 +109,11 @@ def apply_damage(
112
109
  straight into the emitted ``DamageApplied`` event(s); see
113
110
  ``DamageApplied.source_id`` / ``.is_crit`` for the source-id policy.
114
111
 
112
+ ``knock_out`` — SRD 5.2 Knocking Out a Creature: the attacker of a melee
113
+ attack chose to pull the blow. Stamped on every emitted ``DamageApplied``;
114
+ the orchestrator's fold leaves a creature it would have dropped at 1 Hit
115
+ Point, Unconscious.
116
+
115
117
  Returns the TOTAL final (post-modifier) amount actually dealt across every
116
118
  valid type — Vex: "hit a creature ... and deal damage to the
117
119
  creature" needs the AFTER-immunity total (a damage-immune target dealt 0
@@ -151,6 +153,10 @@ def apply_damage(
151
153
  and MonsterTraitMechanic.UNDEAD_FORTITUDE in target.trait_mechanics
152
154
  and srd_type != "radiant"
153
155
  and not is_crit
156
+ # A pulled blow reduces the creature to 1 Hit Point "instead" of
157
+ # 0, so the trait's trigger never happens and no die is drawn; a
158
+ # creature the blow cannot knock out still drops to 0.
159
+ and not (knock_out and target.entity_id not in ctx.knock_out_exempt_ids)
154
160
  ):
155
161
  dc = 5 + final_amount
156
162
  roll = roll_d20_test(ctx.rng, save_modifier(target, "con").total, AdvantageSources())
@@ -189,6 +195,7 @@ def apply_damage(
189
195
  is_overkill=is_overkill,
190
196
  source_id=source_id,
191
197
  is_crit=is_crit,
198
+ knock_out=knock_out,
192
199
  )
193
200
  )
194
201
  return total_dealt
@@ -201,9 +208,9 @@ def _apply_modifiers(
201
208
  immunities: set[str],
202
209
  vulnerabilities: set[str],
203
210
  ) -> int:
204
- """Apply vuln (×2) → resist (//2 floor) → immune (⇒0) in the legacy evaluator order.
211
+ """Apply vuln (×2) → resist (//2 floor) → immune (⇒0), in that order.
205
212
 
206
- Mirrors ``effects/damage.py:_apply_resistance``. The ``"all"`` wildcard is
213
+ The ``"all"`` wildcard is
207
214
  honored in each list (SRD §Conditions/Petrified resistance-to-all).
208
215
  """
209
216
  if damage_type in vulnerabilities or "all" in vulnerabilities:
@@ -8,8 +8,6 @@ Fire Bolt (a ranged spell attack, single ``1d10`` fire activity part, no base
8
8
  weapon), the Longsword (base ``1d8`` slashing, no activity parts), and the Mace
9
9
  of Smiting (+1 weapon, base ``1d6`` bludgeoning, ``damage.critical.bonus == "7"``).
10
10
 
11
- MIRRORS, does not import from, ``effects/attack.py`` + ``effects/damage.py``:
12
-
13
11
  * The natural-d20 roll goes through the single SRD 5.2 D20 Test primitive
14
12
  ``activities/d20.py::roll_d20_test``, honoring ``ctx.variables["force_d20"]``
15
13
  (the test seam, first target only) as ``forced_natural``. Advantage /
@@ -28,15 +26,14 @@ MIRRORS, does not import from, ``effects/attack.py`` + ``effects/damage.py``:
28
26
  below. Prone (distance-aware via ``ctx.target_distance_ft``) and Grappled (via
29
27
  ``ctx.attacker_grappler_id``) are live since C12; unseen / long-range sources
30
28
  are C15/C16b.
31
- * Hit / crit / miss mirrors ``effects/attack.py:_resolve_hit_outcome``: natural
29
+ * Hit / crit / miss: natural
32
30
  20 → auto crit+hit, natural 1 → auto miss, else ``total >= AC`` (SRD §Rolling
33
31
  1 or 20 / §Making an Attack). The crit threshold is ``attack.critical.threshold
34
32
  or 20``.
35
33
  * Crit dice doubling + the modifier-once rule run through
36
34
  ``dice.roll_damage_part(crit=...)`` (SRD §Critical Hits). The activity-level
37
35
  ``damage.critical.bonus`` is a flat formula added ONCE on a crit, assigned to
38
- the first resolved damage type, mirroring ``effects/damage.py`` /
39
- ``activities/damage.py``.
36
+ the first resolved damage type, as in ``activities/damage.py``.
40
37
 
41
38
  Attack-bonus model (Foundry-structural / SRD-2024 ground truth):
42
39
 
@@ -166,8 +163,7 @@ def resolve_attack(
166
163
 
167
164
  # SRD §Advantage and Disadvantage — the attacker's own
168
165
  # ``flags.advantage.attack`` / ``flags.disadvantage.attack`` override
169
- # changes (both present cancel to normal, the legacy evaluator
170
- # ``reconcile_adv``). These both feed the d20 mode below (F2b) and gate the
166
+ # changes (both present cancel to normal). These both feed the d20 mode below (F2b) and gate the
171
167
  # SRD §Sneak Attack trigger.
172
168
  attacker_has_advantage, attacker_has_disadvantage = attacker_advantage_flags(ctx)
173
169
  # SRD 5.2 Heavy — ability-score-invariant per attack (see docstring);
@@ -297,7 +293,13 @@ def resolve_attack(
297
293
  heavy_disadvantage=heavy_disadvantage,
298
294
  )
299
295
  else:
300
- apply_mastery_on_miss(weapon, ctx, target, governing_ability)
296
+ apply_mastery_on_miss(
297
+ weapon,
298
+ ctx,
299
+ target,
300
+ governing_ability,
301
+ knock_out=_pulls_blow(activity, ctx, weapon, target),
302
+ )
301
303
 
302
304
 
303
305
  def _resolve_cleave_chain(
@@ -624,7 +626,7 @@ def attacker_advantage_flags(ctx: ActivityResolutionContext) -> tuple[bool, bool
624
626
  has_advantage = True
625
627
  elif ch.key == "flags.disadvantage.attack":
626
628
  has_disadvantage = True
627
- # Both present cancel to normal (the legacy evaluator ``reconcile_adv``).
629
+ # Both present cancel to normal (SRD §Advantage and Disadvantage).
628
630
  if has_advantage and has_disadvantage:
629
631
  return False, False
630
632
  return has_advantage, has_disadvantage
@@ -779,6 +781,39 @@ def _attack_is_effectively_ranged(weapon: Weapon | None, distance_ft: int | None
779
781
  return distance_ft is not None and distance_ft > reach
780
782
 
781
783
 
784
+ def _pulls_blow(
785
+ activity: AttackActivity,
786
+ ctx: ActivityResolutionContext,
787
+ weapon: Weapon | None,
788
+ target: Combatant,
789
+ ) -> bool:
790
+ """SRD 5.2 Knocking Out a Creature: "When you would reduce a creature to 0
791
+ Hit Points with a melee attack, you can instead reduce the creature to 1
792
+ Hit Point." True when the attacker chose that (``ctx.knock_out``) and this
793
+ attack against ``target`` is a melee attack: a melee attack activity whose
794
+ weapon is not a ranged weapon and not a Thrown weapon thrown beyond its
795
+ reach (``_attack_is_effectively_ranged``)."""
796
+ return ctx.knock_out and is_melee_attack(
797
+ activity, weapon, ctx.target_distance_ft.get(target.entity_id)
798
+ )
799
+
800
+
801
+ def is_melee_attack(
802
+ activity: AttackActivity, weapon: Weapon | None, distance_ft: int | None
803
+ ) -> bool:
804
+ """Is this attack, at ``distance_ft`` from its target, a melee attack? A
805
+ melee attack activity whose weapon is not a ranged weapon and not a Thrown
806
+ weapon thrown beyond its reach. An activity that names no attack type (the
807
+ Javelin, several magic weapons) is classified by its weapon
808
+ (``_is_melee_weapon``); with no weapon either, it cannot be told apart
809
+ from a ranged attack and is not one. The orchestrator refuses a knock-out
810
+ choice before anything is spent unless every attack of the intent passes
811
+ this rule; a save-based rider after the hit is not pulled."""
812
+ attack_type = activity.attack.type.value
813
+ melee = _is_melee_weapon(weapon) if attack_type == "" else attack_type == "melee"
814
+ return melee and not _attack_is_effectively_ranged(weapon, distance_ft)
815
+
816
+
782
817
  def _weapon_heavy_disadvantage(weapon: Weapon | None, caster: Combatant) -> bool:
783
818
  """SRD 5.2 Heavy: "You have Disadvantage on attack rolls with a Heavy
784
819
  weapon if it's a Melee weapon and your Strength score isn't at least 13
@@ -970,8 +1005,8 @@ def _apply_on_hit_damage(
970
1005
 
971
1006
  Sets ``variables["in_crit"]`` for the duration of this target's damage rolls so
972
1007
  the shared dice helper doubles dice on a crit, then restores the prior value so
973
- the signal never leaks to a sibling target or a later caller (mirrors
974
- ``effects/attack.py:_recurse_hit`` push/pop discipline).
1008
+ the signal never leaks to a sibling target or a later caller (push/pop
1009
+ discipline).
975
1010
 
976
1011
  Returns the total (post-modifier) damage actually dealt to ``target``
977
1012
  (``apply_damage``'s return) — Vex needs this to gate its
@@ -1099,6 +1134,7 @@ def _apply_on_hit_damage(
1099
1134
  magical=(weapon is not None and weapon.magical) or ctx.base_spell_level is not None,
1100
1135
  source_id=_damage_source_id(activity, weapon, source_id_override),
1101
1136
  is_crit=is_crit,
1137
+ knock_out=_pulls_blow(activity, ctx, weapon, target),
1102
1138
  )
1103
1139
  finally:
1104
1140
  if is_crit:
@@ -82,7 +82,7 @@ def _save_dc(
82
82
  (``_monster_save_dc``); PC with no resolvable spellcasting ability
83
83
  (unknown class / a non-caster class / a non-cast_spell intent such as
84
84
  ``use_item``, which never sets ``spellcasting_ability``) ``8 + 2 + mod``
85
- (the legacy evaluator-era ``_spell_save_dc``, ``pb`` hardcoded to ``2``).
85
+ (``pb`` hardcoded to ``2``).
86
86
  """
87
87
  if caster.entity_type == "Monster":
88
88
  if spellcasting_ability:
@@ -246,17 +246,18 @@ def build_activity_context(
246
246
  weapon_enchantment_to_hit: int = 0,
247
247
  stat_block_magnitudes: StatBlockMagnitudes | None = None,
248
248
  is_opportunity_attack: bool = False,
249
+ knock_out: bool = False,
250
+ knock_out_exempt_ids: frozenset[str] = frozenset(),
249
251
  ) -> ActivityResolutionContext:
250
252
  """Adapt the caster + the pre-computed hydration sidecars into the typed
251
253
  ``ActivityResolutionContext`` the new resolver consumes.
252
254
 
253
- Caster magnitudes reproduce the OLD the legacy evaluator approximations (see module
254
- docstring). ``passive_damage_modifiers`` and ``save_modifiers`` are the two
255
- dicts the orchestrator's ``_build_hydration_payload`` already produces —
256
- passed IN so this builder stays pure (no orchestrator import, no I/O, no
257
- double-compute). The wide per-target ``save_modifiers[id]`` entry is reshaped
258
- into the four typed save-sidecar fields; absent fields default empty, leaving
259
- the golden corpus identical.
255
+ Caster magnitudes follow the approximations in the module docstring.
256
+ ``passive_damage_modifiers`` and ``save_modifiers`` are the two dicts the
257
+ orchestrator's ``_build_hydration_payload`` already produces — passed IN so this
258
+ builder stays pure (no orchestrator import, no I/O, no double-compute). The wide
259
+ per-target ``save_modifiers[id]`` entry is reshaped into the four typed save-sidecar
260
+ fields; absent fields default empty, leaving the golden corpus identical.
260
261
 
261
262
  ``scale_values`` / ``class_levels`` are the PRE-RESOLVED ``@scale.*`` /
262
263
  ``@classes.<class>.levels`` carriers. They are resolved by the orchestrator /
@@ -317,7 +318,7 @@ def build_activity_context(
317
318
  }
318
319
  caster_proficiency_bonus = proficiency_bonus(caster.character_level)
319
320
  else:
320
- # Monsters/NPCs have no per-ability sheet here: keep the legacy evaluator-era
321
+ # Monsters/NPCs have no per-ability sheet here: keep the
321
322
  # uniform fake (10 + 2*mod across all six abilities, PB 2) so the
322
323
  # dynamic governing-ability resolution in attack.py reproduces the old
323
324
  # uniform @mod for any ability it picks.
@@ -328,7 +329,7 @@ def build_activity_context(
328
329
  # ({ability:int}) plus the per-target sidecar keys (passive_save_bonus dice
329
330
  # string, passive_save_adv / _dis / _auto_fail UPPER-case ability lists).
330
331
  # Project EACH into its typed context field so the typed save path consumes
331
- # the full sidecar the OLD effects/save.py path did.
332
+ # the full sidecar.
332
333
  passive_save_modifiers: dict[str, dict[str, int]] = {}
333
334
  passive_save_bonus: dict[str, str] = {}
334
335
  # Per-attacker to-hit dice bonus (Bless +1d4 / Bane −1d4). The orchestrator
@@ -368,7 +369,7 @@ def build_activity_context(
368
369
  for entity_id, dmg_entry in passive_damage_modifiers.items():
369
370
  # ``passive_damage_modifiers`` is a WIDE dict: resistance/immunity/
370
371
  # vulnerability lists PLUS the signed-dice ``passive_to_hit_bonus`` STRING
371
- # the orchestrator projection wedges in (mirrors the OLD the legacy evaluator sidecar).
372
+ # the orchestrator projection wedges in.
372
373
  to_hit: object = dmg_entry.get("passive_to_hit_bonus")
373
374
  if isinstance(to_hit, str) and to_hit:
374
375
  passive_attack_bonus[entity_id] = to_hit
@@ -586,4 +587,6 @@ def build_activity_context(
586
587
  weapon_enchantment_to_hit=weapon_enchantment_to_hit,
587
588
  stat_block_magnitudes=stat_block_magnitudes,
588
589
  is_opportunity_attack=is_opportunity_attack,
590
+ knock_out=knock_out,
591
+ knock_out_exempt_ids=knock_out_exempt_ids,
589
592
  )
@@ -8,13 +8,11 @@ level, the referenced spell's base level / concentration flag / own
8
8
  ``resolve_activity`` for each activity on the referenced spell. ``cast`` emits
9
9
  NOTHING itself — the delegated child activities emit their own events.
10
10
 
11
- MIRRORS, does not import from, ``effects/spell.py`` (the legacy ``type:
12
- "spell"`` analogue). Reproduces its semantics with the typed lib shapes:
11
+ Semantics, over the typed lib shapes:
13
12
 
14
13
  * Spell-within-itself cycle guard FIRST (cheap, before the lookup): a ``uuid``
15
14
  already in ``ctx.parent_chain`` logs ``cast_spell_cycle`` and no-ops, never
16
- recursing infinitely (mirrors ``effects/spell.py``'s ``"spell" in parent_chain``
17
- guard).
15
+ recursing infinitely.
18
16
  * Spell lookup is a LOUD no-op on a miss — an unresolved ``uuid`` logs
19
17
  ``cast_spell_unresolved`` and returns rather than silently skipping.
20
18
  * Cast-level resolution: ``spell.level`` override when set, else the referenced
@@ -63,8 +61,8 @@ def resolve_cast(activity: CastActivity, ctx: ActivityResolutionContext) -> None
63
61
  if spell is None:
64
62
  _LOGGER.warning("cast_spell_unresolved uuid=%s", uuid)
65
63
  return
66
- # 3. Cast-level resolution + bounds (SRD §Casting a Spell at a Higher Level;
67
- # mirrors effects/spell.py's ``base_level <= cast_level <= 9`` invariant).
64
+ # 3. Cast-level resolution + bounds (SRD §Casting a Spell at a Higher Level:
65
+ # the ``base_level <= cast_level <= 9`` invariant).
68
66
  # A cantrip's base level is 0 (``0 <= 0 <= 9`` passes). An out-of-range
69
67
  # cast (e.g. a scroll forged at level 10, or below the spell's base) is a
70
68
  # LOUD no-op — never an absurd upcast (cure-wounds at level 10 → 20d8).
@@ -10,21 +10,17 @@ Unlike a ``save``, a check CAN carry no DC at all. A no-DC check is purely
10
10
  informational: the actor still rolls, ``CheckRolled`` is still emitted, but
11
11
  ``succeeded`` is ``None`` (no pass/fail comparison is made).
12
12
 
13
- MIRRORS, does not import from, ``effects/check.py``:
14
-
15
13
  * The ACTOR that rolls is the activity's first TARGET when one is present (an
16
- imposed check — escape the manacles, resist Banish to Maze), exactly as
17
- ``effects/check.py`` rolls for ``ctx.target_list[0]``. With no target the
18
- CASTER rolls (a self-check — a PC's own Stealth check). Contested checks (a
19
- second, opposed caster roll) are out of Piece-1-2 scope.
20
- * The skill→ability mapping mirrors ``effects/check.py:_SKILL_TO_ABILITY`` but is
21
- keyed by the Foundry 3-letter skill *codes* the canonical ``check.associated``
22
- field actually carries (``"ath"``, ``"slt"``, ``"inv"``, ...) rather than the
23
- the legacy evaluator long-form (``"athletics"``). Source: ``CONFIG.DND5E.skills`` in
24
- ``foundry/module/config.mjs``.
14
+ imposed check — escape the manacles, resist Banish to Maze), i.e.
15
+ ``ctx.target_list[0]``. With no target the CASTER rolls (a self-check — a
16
+ PC's own Stealth check). Contested checks (a second, opposed caster roll) are
17
+ not modelled here.
18
+ * The skill→ability mapping is keyed by the Foundry 3-letter skill *codes* the
19
+ canonical ``check.associated`` field actually carries (``"ath"``, ``"slt"``,
20
+ ``"inv"``, ...) rather than long-form names (``"athletics"``). Source:
21
+ ``CONFIG.DND5E.skills`` in ``foundry/module/config.mjs``.
25
22
  * The modifier is the RESOLVED integer off a per-actor sidecar
26
- (``ctx.check_modifiers``), mirroring ``effects/check.py:_read_check_modifiers``
27
- / ``_modifier_for_key`` — the skill mod when a skill is named (the 3-letter
23
+ (``ctx.check_modifiers``) — the skill mod when a skill is named (the 3-letter
28
24
  ``associated`` code mapped to the canonical SRD slug the sidecar is keyed by,
29
25
  via ``SKILL_CODE_TO_SLUG``), else the ability mod
30
26
  (``ability_mods[ability]``), else +0. ``Combatant`` carries no per-skill table,
@@ -38,8 +34,8 @@ MIRRORS, does not import from, ``effects/check.py``:
38
34
  empty.
39
35
 
40
36
  The d20 goes through the shared ``activities/d20.py::roll_d20_test`` primitive
41
- (F2c) and honors ``ctx.variables["force_check_d20"]`` — a NEW test seam (our own;
42
- ``effects/check.py`` relies on a seeded ``ctx.rng``). Condition-derived
37
+ (F2c) and honors ``ctx.variables["force_check_d20"]`` — a test seam over the
38
+ seeded ``ctx.rng``. Condition-derived
43
39
  disadvantage (SRD 5.2 §Frightened / §Poisoned / §Exhaustion) arrives on
44
40
  ``ctx.check_modifiers[actor]["disadvantage"]``. Riders fire AFTER
45
41
  the roll via the shared ``apply_activity_effects`` (``EffectApplied`` then
@@ -73,8 +69,7 @@ _ABILITIES: Final[frozenset[str]] = frozenset(get_args(Ability))
73
69
 
74
70
  # Foundry 3-letter skill code → governing SRD ability. Source: CONFIG.DND5E.skills
75
71
  # in foundry/module/config.mjs (each skill's ``ability`` field). The canonical
76
- # ``check.associated`` field carries these codes verbatim. Mirrors
77
- # ``effects/check.py:_SKILL_TO_ABILITY`` (which keys the legacy evaluator long-form names).
72
+ # ``check.associated`` field carries these codes verbatim.
78
73
  _SKILL_TO_ABILITY: Final[dict[str, Ability]] = {
79
74
  "acr": "dex",
80
75
  "ani": "wis",
@@ -103,8 +98,8 @@ _SKILL_TO_ABILITY: Final[dict[str, Ability]] = {
103
98
  # (``ctx.check_modifiers[actor]["skills"]``, keyed by the long-form slug) is
104
99
  # unchanged.
105
100
 
106
- # Test-determinism seam for the natural check d20 (our own code; effects/check.py
107
- # has none and relies on a seeded ctx.rng).
101
+ # Test-determinism seam for the natural check d20 (otherwise drawn from the
102
+ # seeded ctx.rng).
108
103
  FORCE_CHECK_D20: Final = "force_check_d20"
109
104
 
110
105
 
@@ -259,7 +254,7 @@ def _check_modifier(
259
254
  ) -> int:
260
255
  """The actor's resolved check modifier off ``ctx.check_modifiers``.
261
256
 
262
- Mirrors ``effects/check.py:_modifier_for_key`` — the skill mod takes
257
+ The skill mod takes
263
258
  precedence when a skill is named and present; else the ability mod
264
259
  (``ability_mods[ability]``); else +0. The sidecar shape is
265
260
  ``{entity_id: {"skills": {slug: mod}, "ability_mods": {ability: mod}}}``,