Skip to content

Replace delayed_response Procs with TriggeredAbility subclasses#535

Open
radar wants to merge 3 commits into
masterfrom
pr14-replace-delayed-response
Open

Replace delayed_response Procs with TriggeredAbility subclasses#535
radar wants to merge 3 commits into
masterfrom
pr14-replace-delayed-response

Conversation

@radar

@radar radar commented Apr 24, 2026

Copy link
Copy Markdown
Owner

Summary

  • Removes the delayed_response/trigger_delayed_response Proc-based event system from Permanent and Card (improvement add 20 new vanilla cards #6 in docs/event-handling-improvements.md)
  • MassacreGirl's "whenever a creature dies this turn" effect is now a CreatureDiedDebuff < TriggeredAbility registered via event_handlers, with should_perform? checking the turn the ETB fired
  • BasriKet's -2 loyalty ability trigger is now a PreliminaryAttackersHandler < TriggeredAbility registered via event_handlers, with should_perform? checking the turn the ability resolved
  • Updates basri_ket_spec.rb to assert on the new card.minus2_active_turn state rather than the removed delayed_responses array

Test plan

  • bundle exec rspec spec/cards/massacre_girl_spec.rb spec/cards/basri_ket_spec.rb — all pass
  • Full suite: same 3 pre-existing failures on this branch (SanctumOfFruitfulHarvest ordering issue), no regressions introduced

🤖 Generated with Claude Code

radar and others added 3 commits April 24, 2026 10:04
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
MassacreGirl and BasriKet both used a parallel Proc-based event system
stored on the permanent. Both are now modelled as proper TriggeredAbility
subclasses registered via event_handlers, with turn-scoped conditions
checked in should_perform?. The delayed_response/trigger_delayed_response
mechanism and @delayed_responses state are removed from Permanent and Card.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The previous approach stored turn numbers in attr_accessors on the card
classes and checked them in should_perform?. This replaces that with a
general register_until_eot_handler mechanism on Permanent that mirrors
the existing until-eot keyword/protection/modifier patterns: handlers
are registered dynamically and cleared in cleanup!. Cards no longer
carry any turn-scoped state.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant