Skip to content

Commit 680c03b

Browse files
committed
"True King Lithosagym, the Disaster" update
- improved the part of the effect when the player selects the cards to be banished to reduce the number of prompts
1 parent c025a2f commit 680c03b

File tree

1 file changed

+22
-50
lines changed

1 file changed

+22
-50
lines changed

official/c30539496.lua

Lines changed: 22 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
--真竜皇リトスアジムD
22
--True King Lithosagym, the Disaster
3+
local CARD_TRUE_KING_CALAMITIES=88581108
34
local s,id=GetID()
45
function s.initial_effect(c)
56
--Special summon itself from hand
@@ -31,67 +32,38 @@ end
3132
function s.locfilter(c,tp)
3233
return c:IsLocation(LOCATION_MZONE) and c:IsControler(tp)
3334
end
35+
function s.rescon(sg,e,tp,mg)
36+
return sg:IsExists(Card.IsAttribute,1,nil,ATTRIBUTE_EARTH) and Duel.GetMZoneCount(tp,sg)>0
37+
end
3438
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
3539
local c=e:GetHandler()
36-
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
37-
local loc=LOCATION_MZONE|LOCATION_HAND
38-
if ft<0 then loc=LOCATION_MZONE end
39-
local loc2=0
40-
if Duel.IsPlayerAffectedByEffect(tp,88581108) then loc2=LOCATION_MZONE end
41-
local g=Duel.GetMatchingGroup(s.desfilter,tp,loc,loc2,c)
40+
local opp_mzone=Duel.IsPlayerAffectedByEffect(tp,CARD_TRUE_KING_CALAMITIES) and LOCATION_MZONE or 0 --True King of All Calamities
41+
local g=Duel.GetMatchingGroup(s.desfilter,tp,LOCATION_MZONE|LOCATION_HAND,opp_mzone,c)
4242
if chk==0 then return c:IsCanBeSpecialSummoned(e,0,tp,false,false)
43-
and #g>=2 and g:IsExists(Card.IsAttribute,1,nil,ATTRIBUTE_EARTH)
44-
and (ft>0 or g:IsExists(s.locfilter,-ft+1,nil,tp)) end
43+
and #g>=2 and aux.SelectUnselectGroup(g,e,tp,2,2,s.rescon,0) end
4544
if (#g==2 and g:FilterCount(Card.IsLocation,nil,LOCATION_HAND)==1) or not g:IsExists(Card.IsLocation,1,nil,LOCATION_HAND) then
46-
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,2,0,0)
45+
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,2,tp,0)
4746
else
48-
Duel.SetOperationInfo(0,CATEGORY_DESTROY,nil,2,tp,loc)
47+
Duel.SetOperationInfo(0,CATEGORY_DESTROY,nil,2,tp,LOCATION_MZONE|LOCATION_HAND)
4948
end
50-
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
49+
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,tp,0)
5150
end
5251
function s.spop(e,tp,eg,ep,ev,re,r,rp)
5352
local c=e:GetHandler()
54-
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
55-
local loc=LOCATION_MZONE|LOCATION_HAND
56-
if ft<0 then loc=LOCATION_MZONE end
57-
local loc2=0
58-
if Duel.IsPlayerAffectedByEffect(tp,88581108) then loc2=LOCATION_MZONE end
59-
local g=Duel.GetMatchingGroup(s.desfilter,tp,loc,loc2,c)
53+
local opp_mzone=Duel.IsPlayerAffectedByEffect(tp,CARD_TRUE_KING_CALAMITIES) and LOCATION_MZONE or 0 --True King of All Calamities
54+
local g=Duel.GetMatchingGroup(s.desfilter,tp,LOCATION_MZONE|LOCATION_HAND,opp_mzone,c)
6055
if #g<2 or not g:IsExists(Card.IsAttribute,1,nil,ATTRIBUTE_EARTH) then return end
61-
local g1=nil local g2=nil
62-
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
63-
if ft<1 then
64-
g1=g:FilterSelect(tp,s.locfilter,1,1,nil,tp)
65-
else
66-
g1=g:Select(tp,1,1,nil)
67-
end
68-
g:RemoveCard(g1:GetFirst())
69-
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
70-
if g1:GetFirst():IsAttribute(ATTRIBUTE_EARTH) then
71-
g2=g:Select(tp,1,1,nil)
72-
else
73-
g2=g:FilterSelect(tp,Card.IsAttribute,1,1,nil,ATTRIBUTE_EARTH)
74-
end
75-
g1:Merge(g2)
76-
local rm=g1:IsExists(Card.IsAttribute,2,nil,ATTRIBUTE_EARTH)
77-
if Duel.Destroy(g1,REASON_EFFECT)==2 then
78-
if not c:IsRelateToEffect(e) then return end
79-
if Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)==0 then
80-
return
81-
end
56+
local dg=aux.SelectUnselectGroup(g,e,tp,2,2,s.rescon,1,tp,HINTMSG_DESTROY)
57+
if #dg<2 then return end
58+
local rmv_chk=dg:FilterCount(Card.IsAttribute,nil,ATTRIBUTE_EARTH)==2 and true or false
59+
if Duel.Destroy(dg,REASON_EFFECT)==2 and c:IsRelateToEffect(e) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)>0 and rmv_chk then
8260
local rg=Duel.GetMatchingGroup(Card.IsAbleToRemove,tp,0,LOCATION_EXTRA,nil)
83-
if rm and #rg>0 and Duel.SelectYesNo(tp,aux.Stringid(id,2)) then
61+
if rmv_chk and #rg>0 and Duel.SelectYesNo(tp,aux.Stringid(id,2)) then
8462
Duel.ConfirmCards(tp,rg)
85-
local tg=Group.CreateGroup()
86-
local i=3
87-
repeat
88-
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
89-
local tc=rg:Select(tp,1,1,nil):GetFirst()
90-
rg:Remove(Card.IsCode,nil,tc:GetCode())
91-
tg:AddCard(tc)
92-
i=i-1
93-
until i<1 or #rg==0 or not Duel.SelectYesNo(tp,aux.Stringid(id,3))
94-
Duel.Remove(tg,POS_FACEUP,REASON_EFFECT)
63+
local rmv_g=aux.SelectUnselectGroup(rg,e,tp,1,3,aux.dncheck,1,tp,HINTMSG_REMOVE)
64+
if #rmv_g>0 then
65+
Duel.Remove(rmv_g,POS_FACEUP,REASON_EFFECT)
66+
end
9567
Duel.ShuffleExtra(1-tp)
9668
end
9769
end
@@ -111,4 +83,4 @@ function s.spop2(e,tp,eg,ep,ev,re,r,rp)
11183
if #g>0 then
11284
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
11385
end
114-
end
86+
end

0 commit comments

Comments
 (0)