Skip to content

Commit ccb279b

Browse files
authored
Update "Soldier Revolt"
- Was missing check for being the triggering player's main phase - Send and destroy should happen simultaneously - other minor script polishing
1 parent 31089de commit ccb279b

File tree

1 file changed

+16
-12
lines changed

1 file changed

+16
-12
lines changed

unofficial/c511001897.lua

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,10 @@ function s.initial_effect(c)
1414
e1:SetOperation(s.activate)
1515
c:RegisterEffect(e1)
1616
end
17-
s.listed_names={79853073,67532912,75559356}
17+
s.listed_names={79853073,67532912,75559356} --"Cipher Soldier", "Science Soldier", "Cyber Soldier of Dark World"
1818
function s.condition(e,tp,eg,ep,ev,re,r,rp)
19-
return Duel.IsExistingMatchingCard(aux.FaceupFilter(Card.IsCode,79853073),tp,LOCATION_ONFIELD,0,1,nil)
19+
return Duel.IsTurnPlayer(tp) and Duel.IsMainPhase()
20+
and Duel.IsExistingMatchingCard(aux.FaceupFilter(Card.IsCode,79853073),tp,LOCATION_ONFIELD,0,1,nil)
2021
and Duel.IsExistingMatchingCard(aux.FaceupFilter(Card.IsCode,67532912),tp,LOCATION_ONFIELD,0,1,nil)
2122
and Duel.IsExistingMatchingCard(aux.FaceupFilter(Card.IsCode,75559356),tp,LOCATION_ONFIELD,0,1,nil)
2223
end
@@ -32,16 +33,19 @@ function s.cost(e,tp,eg,ep,ev,re,r,rp,chk)
3233
Duel.RegisterEffect(e1,tp)
3334
end
3435
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
35-
if chk==0 then return Duel.IsExistingMatchingCard(nil,tp,0,LOCATION_HAND,1,nil)
36-
and Duel.IsExistingMatchingCard(nil,tp,0,LOCATION_ONFIELD,1,nil) end
37-
local tg=Duel.GetFieldGroup(tp,0,LOCATION_HAND)
38-
local dg=Duel.GetFieldGroup(tp,0,LOCATION_ONFIELD)
39-
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,tg,#tg,0,0)
40-
Duel.SetOperationInfo(0,CATEGORY_DESTROY,dg,#dg,0,0)
36+
local desg=Duel.GetFieldGroup(tp,0,LOCATION_ONFIELD)
37+
if chk==0 then return #desg>0 or Duel.IsExistingMatchingCard(Card.IsAbleToGrave,tp,0,LOCATION_HAND,1,nil) end
38+
local hg=Duel.GetMatchingGroup(Card.IsAbleToGrave,tp,0,LOCATION_HAND,nil)
39+
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,hg,#hg,tp,0)
40+
Duel.SetOperationInfo(0,CATEGORY_DESTROY,desg,#desg,tp,0)
4141
end
4242
function s.activate(e,tp,eg,ep,ev,re,r,rp)
43-
local tg=Duel.GetFieldGroup(tp,0,LOCATION_HAND)
44-
if Duel.SendtoGrave(tg,REASON_EFFECT)>0 and tg:FilterCount(Card.IsLocation,nil,LOCATION_GRAVE)>0 then
45-
Duel.Destroy(Duel.GetFieldGroup(tp,0,LOCATION_ONFIELD),REASON_EFFECT)
43+
local hg=Duel.GetMatchingGroup(Card.IsAbleToGrave,tp,0,LOCATION_HAND,nil)
44+
if #hg>0 then
45+
Duel.SendtoGrave(hg,REASON_EFFECT)
4646
end
47-
end
47+
local desg=Duel.GetFieldGroup(tp,0,LOCATION_ONFIELD)
48+
if #desg>0 then
49+
Duel.Destroy(desg,REASON_EFFECT)
50+
end
51+
end

0 commit comments

Comments
 (0)