Skip to content

Commit 42aaee2

Browse files
committed
"Gordian Schneider" fix
- fixed the logic for an early stop condition - fixed a bug with the evaluation of the condition to stop the selection of cards to be banished
1 parent 98407ea commit 42aaee2

File tree

1 file changed

+11
-12
lines changed

1 file changed

+11
-12
lines changed

pre-release/c101208066.lua

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -32,24 +32,23 @@ function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
3232
end
3333
function s.rescon(ct)
3434
return function(sg,e,tp,mg)
35-
local ct1=sg:FilterCount(Card.IsLocation,nil,LOCATION_HAND)
36-
local ct2=sg:FilterCount(Card.IsLocation,nil,LOCATION_EXTRA)
37-
if ct==1 then
38-
return ct1==ct or ct2//6==ct,ct1>0 and ct2>0
39-
end
40-
if ct2>0 then
41-
return ct2>=6 and ct2%6==0 and ct==ct1+(ct2//6)
42-
else
43-
return ct==ct1
44-
end
35+
local count=sg:FilterCount(Card.IsLocation,nil,LOCATION_HAND)
36+
local remaining=ct-count
37+
if remaining<0 then return false,true end
38+
local extracnt=sg:FilterCount(Card.IsLocation,nil,LOCATION_EXTRA)
39+
local extra_needed=remaining*6
40+
if extracnt>extra_needed then return false,true end
41+
return extracnt==extra_needed,extracnt>extra_needed
4542
end
4643
end
4744
function s.activate(e,tp,eg,ep,ev,re,r,rp)
4845
local tg=Duel.GetTargetCards(e)
4946
local ct=#tg
5047
if ct==0 then return end
51-
local rg=Duel.GetMatchingGroup(Card.IsAbleToRemove,tp,LOCATION_HAND|LOCATION_EXTRA,0,nil,tp,POS_FACEDOWN)
52-
if #rg<ct then return end
48+
local g1=Duel.GetMatchingGroup(Card.IsAbleToRemove,tp,LOCATION_HAND,0,nil,tp,POS_FACEDOWN)
49+
local g2=Duel.GetMatchingGroup(Card.IsAbleToRemove,tp,LOCATION_EXTRA,0,nil,tp,POS_FACEDOWN)
50+
if (#g1+#g2//6)<ct then return end
51+
local rg=g1+g2
5352
local sg=aux.SelectUnselectGroup(rg,e,tp,1,#rg,s.rescon(ct),1,tp,HINTMSG_REMOVE,s.rescon(ct),s.rescon(ct))
5453
if Duel.Remove(sg,POS_FACEDOWN,REASON_EFFECT)>0 then
5554
Duel.BreakEffect()

0 commit comments

Comments
 (0)