From d6464e07d91d49e6b79c6b21768fcc086e862277 Mon Sep 17 00:00:00 2001 From: Florian Fischer Date: Mon, 25 Mar 2024 18:33:12 +0100 Subject: add death trigger to flyingDutchmenImpl --- go/game/cardImplementations.go | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'go/game/cardImplementations.go') diff --git a/go/game/cardImplementations.go b/go/game/cardImplementations.go index 80865c1c..f304ee1c 100644 --- a/go/game/cardImplementations.go +++ b/go/game/cardImplementations.go @@ -464,15 +464,23 @@ func (*dolphinImpl) fullActions(u *Unit) []*FullAction { return []*FullAction{a} } -type drownedSailorImpl struct { sailorImpl } +type drownedSailorImpl struct{ sailorImpl } func (*drownedSailorImpl) onDrop(sailor Permanent) { sailor.Controller().gameState.destroyPermanent(sailor) } -// TODO: implement death trigger -// TODO: implement hook for the containing permanent on pile -type flyingDutchmenImpl struct{ cardImplementation } +// TODO: implement hook for the containing permanent on pile to change AI +type flyingDutchmenImpl struct{ cardImplementationBase } + +func (*flyingDutchmenImpl) onETB(s *State, p Permanent) { + s.addTrigger(newEnemyDeathTrigger(p, func(s *State) { + sailor := NewCard("kraken/drowned_sailor") + if p.Tile().IsAvailableForCard(sailor) { + addPermanentToPile(p, NewUnit(sailor, nil, p.Controller())) + } + }, p.Card().getEffects()[1])) +} type frostPylonAoE struct{} -- cgit v1.2.3