Skip to content

Commit f2cb887

Browse files
committed
Script updates
- Replace some values used by cards that declared card types with their corresponding constants - Allow "SPYGAL Misty" to select its targets in any cancelable order
1 parent 0cc0328 commit f2cb887

2 files changed

Lines changed: 18 additions & 17 deletions

File tree

official/c54719828.lua

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22
--Number 16: Shock Master
33
local s,id=GetID()
44
function s.initial_effect(c)
5-
--xyz summon
6-
Xyz.AddProcedure(c,nil,4,3)
75
c:EnableReviveLimit()
8-
--act limit
6+
--Xyz Summon Procedure: 3 Level 4 monsters
7+
Xyz.AddProcedure(c,nil,4,3)
8+
--Players cannot activate cards with the declared type
99
local e1=Effect.CreateEffect(c)
1010
e1:SetDescription(aux.Stringid(id,0))
1111
e1:SetType(EFFECT_TYPE_IGNITION)
12-
e1:SetCountLimit(1)
1312
e1:SetRange(LOCATION_MZONE)
13+
e1:SetCountLimit(1)
1414
e1:SetCost(Cost.DetachFromSelf(1))
1515
e1:SetTarget(s.target)
1616
e1:SetOperation(s.operation)
@@ -20,7 +20,7 @@ s.xyz_number=16
2020
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
2121
if chk==0 then return true end
2222
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(id,1))
23-
e:SetLabel(Duel.SelectOption(tp,70,71,72))
23+
e:SetLabel(Duel.SelectOption(tp,DECLTYPE_MONSTER,DECLTYPE_SPELL,DECLTYPE_TRAP))
2424
end
2525
function s.operation(e,tp,eg,ep,ev,re,r,rp)
2626
local c=e:GetHandler()
@@ -50,4 +50,4 @@ function s.aclimit2(e,re,tp)
5050
end
5151
function s.aclimit3(e,re,tp)
5252
return re:IsHasType(EFFECT_TYPE_ACTIVATE) and re:IsTrapEffect()
53-
end
53+
end

official/c94096018.lua

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ function s.drtg(e,tp,eg,ep,ev,re,r,rp,chk)
3434
if chk==0 then return Duel.IsPlayerCanDraw(tp,1)
3535
and Duel.GetFieldGroupCount(tp,0,LOCATION_DECK)>0 end
3636
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CARDTYPE)
37-
e:SetLabel(Duel.SelectOption(tp,70,71,72))
37+
e:SetLabel(Duel.SelectOption(tp,DECLTYPE_MONSTER,DECLTYPE_SPELL,DECLTYPE_TRAP))
3838
Duel.SetTargetPlayer(tp)
3939
Duel.SetTargetParam(1)
4040
end
@@ -49,19 +49,20 @@ function s.drop(e,tp,eg,ep,ev,re,r,rp)
4949
Duel.Draw(p,d,REASON_EFFECT)
5050
end
5151
end
52-
function s.thfilter(c)
53-
return c:IsFaceup() and c:IsCode(41091257) and c:IsAbleToHand()
52+
function s.thfilter(c,e,tp)
53+
return (c:IsControler(1-tp) or (c:IsCode(41091257) and c:IsFaceup()))
54+
and c:IsAbleToHand() and c:IsCanBeEffectTarget(e)
55+
end
56+
function s.rescon(sg,e,tp,mg)
57+
return sg:FilterCount(Card.GetControler,nil)==#sg
5458
end
5559
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
5660
if chkc then return false end
57-
if chk==0 then return Duel.IsExistingTarget(s.thfilter,tp,LOCATION_MZONE,0,1,nil)
58-
and Duel.IsExistingTarget(Card.IsAbleToHand,tp,0,LOCATION_MZONE,1,nil) end
59-
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
60-
local g1=Duel.SelectTarget(tp,s.thfilter,tp,LOCATION_MZONE,0,1,1,nil)
61-
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
62-
local g2=Duel.SelectTarget(tp,Card.IsAbleToHand,tp,0,LOCATION_MZONE,1,1,nil)
63-
g1:Merge(g2)
64-
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g1,2,0,0)
61+
local g=Duel.GetMatchingGroup(s.thfilter,tp,LOCATION_MZONE,LOCATION_MZONE,nil,e,tp)
62+
if chk==0 then return #g>=2 and aux.SelectUnselectGroup(g,e,tp,2,2,s.rescon,0) end
63+
local rg=aux.SelectUnselectGroup(g,e,tp,2,2,s.rescon,1,tp,HINTMSG_TARGET)
64+
Duel.SetTargetCard(rg)
65+
Duel.SetOperationInfo(0,CATEGORY_TOHAND,rg,#rg,0,0)
6566
end
6667
function s.thop(e,tp,eg,ep,ev,re,r,rp)
6768
local g=Duel.GetTargetCards(e)

0 commit comments

Comments
 (0)