Skip to content

Commit 38c21e5

Browse files
committed
Update Mitsurugi Ritual to the new definition of Duel.ReleaseRitualMaterial
1 parent ac48530 commit 38c21e5

1 file changed

Lines changed: 11 additions & 12 deletions

File tree

official/c81560239.lua

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -20,25 +20,26 @@ end
2020
function s.extragroup(e,tp,eg,ep,ev,re,r,rp,chk)
2121
return Duel.GetMatchingGroup(s.deckmatfilter,tp,LOCATION_DECK,0,nil)
2222
end
23+
function s.extraop(mat,e,tp,eg,ep,ev,re,r,rp,tc)
24+
Duel.ReleaseRitualMaterial(mat,true)
25+
end
2326
function s.tributelimit(e,tp,g,sc)
2427
return #g<=2,#g>2
2528
end
29+
local ritual_params1={lvtype=RITPROC_EQUAL,filter=aux.FilterBoolFunction(Card.IsRace,RACE_REPTILE),location=LOCATION_DECK,matfilter=aux.FilterBoolFunction(Card.IsRace,RACE_REPTILE)}
30+
local ritual_params2={lvtype=RITPROC_EQUAL,filter=aux.FilterBoolFunction(Card.IsRace,RACE_REPTILE),matfilter=aux.FilterBoolFunction(Card.IsRace,RACE_REPTILE),extrafil=s.extragroup,extraop=s.extraop,forcedselection=s.tributelimit}
2631
function s.effcost(e,tp,eg,ep,ev,re,r,rp,chk)
2732
e:SetLabel(-100)
28-
local params1={lvtype=RITPROC_EQUAL,filter=aux.FilterBoolFunction(Card.IsRace,RACE_REPTILE),location=LOCATION_DECK,matfilter=aux.FilterBoolFunction(Card.IsRace,RACE_REPTILE)}
29-
local params2={lvtype=RITPROC_EQUAL,filter=aux.FilterBoolFunction(Card.IsRace,RACE_REPTILE),matfilter=aux.FilterBoolFunction(Card.IsRace,RACE_REPTILE),extrafil=s.extragroup,forcedselection=s.tributelimit}
30-
local b1=not Duel.HasFlagEffect(tp,id) and Ritual.Target(params1)(e,tp,eg,ep,ev,re,r,rp,0)
31-
local b2=not Duel.HasFlagEffect(tp,id+1) and Ritual.Target(params2)(e,tp,eg,ep,ev,re,r,rp,0)
33+
local b1=not Duel.HasFlagEffect(tp,id) and Ritual.Target(ritual_params1)(e,tp,eg,ep,ev,re,r,rp,0)
34+
local b2=not Duel.HasFlagEffect(tp,id+1) and Ritual.Target(ritual_params2)(e,tp,eg,ep,ev,re,r,rp,0)
3235
if chk==0 then return b1 or b2 end
3336
end
3437
function s.efftg(e,tp,eg,ep,ev,re,r,rp,chk)
3538
local cost_skip=e:GetLabel()~=-100
36-
local params1={lvtype=RITPROC_EQUAL,filter=aux.FilterBoolFunction(Card.IsRace,RACE_REPTILE),location=LOCATION_DECK,matfilter=aux.FilterBoolFunction(Card.IsRace,RACE_REPTILE)}
37-
local params2={lvtype=RITPROC_EQUAL,filter=aux.FilterBoolFunction(Card.IsRace,RACE_REPTILE),matfilter=aux.FilterBoolFunction(Card.IsRace,RACE_REPTILE),extrafil=s.extragroup,forcedselection=s.tributelimit}
3839
local b1=(cost_skip or not Duel.HasFlagEffect(tp,id))
39-
and Ritual.Target(params1)(e,tp,eg,ep,ev,re,r,rp,0)
40+
and Ritual.Target(ritual_params1)(e,tp,eg,ep,ev,re,r,rp,0)
4041
local b2=(cost_skip or not Duel.HasFlagEffect(tp,id+1))
41-
and Ritual.Target(params2)(e,tp,eg,ep,ev,re,r,rp,0)
42+
and Ritual.Target(ritual_params2)(e,tp,eg,ep,ev,re,r,rp,0)
4243
if chk==0 then e:SetLabel(0) return b1 or b2 end
4344
local op=Duel.SelectEffect(tp,
4445
{b1,aux.Stringid(id,1)},
@@ -57,10 +58,8 @@ end
5758
function s.effop(e,tp,eg,ep,ev,re,r,rp)
5859
local op=e:GetLabel()
5960
if op==1 then
60-
local params1={lvtype=RITPROC_EQUAL,filter=aux.FilterBoolFunction(Card.IsRace,RACE_REPTILE),location=LOCATION_DECK,matfilter=aux.FilterBoolFunction(Card.IsRace,RACE_REPTILE)}
61-
Ritual.Operation(params1)(e,tp,eg,ep,ev,re,r,rp)
61+
Ritual.Operation(ritual_params1)(e,tp,eg,ep,ev,re,r,rp)
6262
elseif op==2 then
63-
local params2={lvtype=RITPROC_EQUAL,filter=aux.FilterBoolFunction(Card.IsRace,RACE_REPTILE),matfilter=aux.FilterBoolFunction(Card.IsRace,RACE_REPTILE),extrafil=s.extragroup,forcedselection=s.tributelimit}
64-
Ritual.Operation(params2)(e,tp,eg,ep,ev,re,r,rp)
63+
Ritual.Operation(ritual_params2)(e,tp,eg,ep,ev,re,r,rp)
6564
end
6665
end

0 commit comments

Comments
 (0)