Skip to content

Commit 007408c

Browse files
authored
fix "Gunkan Suship Shirauo"
- was not able to place "Gunkan Suship Shari" to the top of the Deck if the only copies of Shari are already in the Deck, due to the recent change in Card.IsAbleToDeck (ce95c9c) - modernized script
1 parent 5ef2b19 commit 007408c

File tree

1 file changed

+35
-44
lines changed

1 file changed

+35
-44
lines changed

official/c78362751.lua

Lines changed: 35 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,86 +1,77 @@
11
--しらうおの軍貫
22
--Gunkan Suship Shirauo
33
--Logical Nonsense
4-
--Substitute ID
54
local s,id=GetID()
65
function s.initial_effect(c)
7-
--Special summon itself from hand
6+
--If you control a "Gunkan Suship Shari", or an Xyz Monster that has "Gunkan Suship Shari" as material: You can Special Summon this card from your hand
87
local e1=Effect.CreateEffect(c)
98
e1:SetDescription(aux.Stringid(id,0))
109
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
1110
e1:SetType(EFFECT_TYPE_IGNITION)
1211
e1:SetRange(LOCATION_HAND)
1312
e1:SetCountLimit(1,id)
14-
e1:SetCondition(s.spcon)
15-
e1:SetTarget(s.sptg)
16-
e1:SetOperation(s.spop)
13+
e1:SetCondition(s.selfspcon)
14+
e1:SetTarget(s.selfsptg)
15+
e1:SetOperation(s.selfspop)
1716
c:RegisterEffect(e1)
18-
--Special summon 1 "Suship" monster from hand
17+
--During your Main Phase: You can Special Summon 1 "Gunkan" monster from your hand, except "Gunkan Suship Shirauo", then you can take any number of "Gunkan Suship Shari" from your Deck or GY and place them on top of your Deck in any order
1918
local e2=Effect.CreateEffect(c)
2019
e2:SetDescription(aux.Stringid(id,1))
2120
e2:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TODECK)
2221
e2:SetType(EFFECT_TYPE_IGNITION)
2322
e2:SetRange(LOCATION_MZONE)
2423
e2:SetCountLimit(1,{id,1})
25-
e2:SetTarget(s.sstg)
26-
e2:SetOperation(s.ssop)
24+
e2:SetTarget(s.sptg)
25+
e2:SetOperation(s.spop)
2726
c:RegisterEffect(e2)
2827
end
29-
--Lists "Gunkan" archetype
3028
s.listed_series={SET_GUNKAN}
31-
--Specifically lists itself and "Gunkan Suship Shari"
3229
s.listed_names={id,CARD_SUSHIP_SHARI}
33-
--Check for a "Gunkan Suship Shari" you control (in MZ or as overlay material)
34-
function s.xyzfilter(c)
35-
return c:IsFaceup() and (c:IsCode(CARD_SUSHIP_SHARI) or (c:GetOverlayCount()>0 and c:GetOverlayGroup():IsExists(Card.IsCode,1,nil,CARD_SUSHIP_SHARI)))
30+
function s.selfspconfilter(c)
31+
return c:IsFaceup() and (c:IsCode(CARD_SUSHIP_SHARI) or c:GetOverlayGroup():IsExists(Card.IsCode,1,nil,CARD_SUSHIP_SHARI))
3632
end
37-
function s.spcon(e,tp,eg,ep,ev,re,r,rp)
38-
return Duel.IsExistingMatchingCard(s.xyzfilter,tp,LOCATION_MZONE,0,1,nil)
33+
function s.selfspcon(e,tp,eg,ep,ev,re,r,rp)
34+
return Duel.IsExistingMatchingCard(s.selfspconfilter,tp,LOCATION_MZONE,0,1,nil)
3935
end
40-
--Activation legality
41-
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
36+
function s.selfsptg(e,tp,eg,ep,ev,re,r,rp,chk)
4237
local c=e:GetHandler()
4338
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end
4439
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
4540
end
46-
--Special summon itself from hand
47-
function s.spop(e,tp,eg,ep,ev,re,r,rp)
41+
function s.selfspop(e,tp,eg,ep,ev,re,r,rp)
4842
local c=e:GetHandler()
49-
if not c:IsRelateToEffect(e) then return end
50-
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
43+
if c:IsRelateToEffect(e) then
44+
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
45+
end
5146
end
52-
--Check for a "Gunkan" monster, except "Gunkan Suship Shirauo"
53-
function s.ssfilter(c,e,tp)
47+
function s.spfilter(c,e,tp)
5448
return c:IsSetCard(SET_GUNKAN) and not c:IsCode(id) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
5549
end
56-
--Activation legality
57-
function s.sstg(e,tp,eg,ep,ev,re,r,rp,chk)
50+
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
5851
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
59-
and Duel.IsExistingMatchingCard(s.ssfilter,tp,LOCATION_HAND,0,1,nil,e,tp) end
52+
and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_HAND,0,1,nil,e,tp) end
6053
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
6154
Duel.SetPossibleOperationInfo(0,CATEGORY_TODECK,nil,1,tp,LOCATION_GRAVE)
6255
end
63-
--Check for "Gunkan Sushup Shari"
6456
function s.tdfilter(c)
65-
return c:IsCode(CARD_SUSHIP_SHARI) and c:IsAbleToDeck()
57+
return c:IsCode(CARD_SUSHIP_SHARI) and (c:IsLocation(LOCATION_DECK) or c:IsAbleToDeck())
6658
end
67-
--Special summon 1 "Gunkan" monster from hand, except "Gunkan Suship Shirauo"
68-
function s.ssop(e,tp,eg,ep,ev,re,r,rp)
59+
function s.spop(e,tp,eg,ep,ev,re,r,rp)
6960
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
7061
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
71-
local g=Duel.SelectMatchingCard(tp,s.ssfilter,tp,LOCATION_HAND,0,1,1,nil,e,tp)
72-
if #g>0 and Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)>0 then
73-
local sg=Duel.GetMatchingGroup(aux.NecroValleyFilter(s.tdfilter),tp,LOCATION_DECK|LOCATION_GRAVE,0,nil)
74-
if #sg>0 and Duel.SelectYesNo(tp,aux.Stringid(id,2)) then
75-
--Move any number of "Gunkan Suship Shari" from deck/GY to top of deck
76-
Duel.BreakEffect()
77-
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
78-
local tg=sg:Select(tp,1,#sg,nil)
79-
Duel.HintSelection(tg)
80-
Duel.SendtoDeck(tg,nil,SEQ_DECKTOP,REASON_EFFECT)
81-
Duel.MoveToDeckTop(tg)
82-
if #tg<=1 then return end
83-
Duel.SortDecktop(tp,tp,#tg)
62+
local g=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_HAND,0,1,1,nil,e,tp)
63+
if #g==0 or Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)==0 then return end
64+
local dg=Duel.GetMatchingGroup(aux.NecroValleyFilter(s.tdfilter),tp,LOCATION_DECK|LOCATION_GRAVE,0,nil)
65+
if #dg==0 or not Duel.SelectYesNo(tp,aux.Stringid(id,2)) then return end
66+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
67+
local sg=dg:Select(tp,1,#dg,nil)
68+
if #sg>0 then
69+
Duel.BreakEffect()
70+
Duel.HintSelection(sg)
71+
Duel.SendtoDeck(sg,nil,SEQ_DECKTOP,REASON_EFFECT)
72+
Duel.MoveToDeckTop(sg)
73+
if #sg>1 then
74+
Duel.SortDecktop(tp,tp,#sg)
8475
end
8576
end
86-
end
77+
end

0 commit comments

Comments
 (0)