Replace delayed_response Procs with TriggeredAbility subclasses#535
Open
radar wants to merge 3 commits into
Open
Replace delayed_response Procs with TriggeredAbility subclasses#535radar wants to merge 3 commits into
radar wants to merge 3 commits into
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
delayed_response/trigger_delayed_responseProc-based event system fromPermanentandCard(improvement add 20 new vanilla cards #6 in docs/event-handling-improvements.md)MassacreGirl's "whenever a creature dies this turn" effect is now aCreatureDiedDebuff < TriggeredAbilityregistered viaevent_handlers, withshould_perform?checking the turn the ETB firedBasriKet's -2 loyalty ability trigger is now aPreliminaryAttackersHandler < TriggeredAbilityregistered viaevent_handlers, withshould_perform?checking the turn the ability resolvedbasri_ket_spec.rbto assert on the newcard.minus2_active_turnstate rather than the removeddelayed_responsesarrayTest plan
bundle exec rspec spec/cards/massacre_girl_spec.rb spec/cards/basri_ket_spec.rb— all pass🤖 Generated with Claude Code