Commit 47469f16 authored by Tachibana's avatar Tachibana

ndyd

parent ffdceb30
......@@ -331,6 +331,8 @@ function XY.maganechop(e,tp,eg,ep,ev,re,r,rp)
ck=1
Duel.RegisterFlagEffect(tp,33423530,RESET_EVENT+RESET_PHASE+PHASE_END,0,0)
end
local gg=Duel.GetMatchingGroup(nil,tp,LOCATION_GRAVE,LOCATION_GRAVE,nil)
Duel.ConfirmCards(1-tp,gg)
if cd==33403521 then
if Duel.IsPlayerCanDraw(tp,1) and Duel.IsPlayerCanDraw(1-tp,1) and ((ck==1 and Duel.SelectYesNo(tp,aux.Stringid(cd,3))) or (ck==0 and Duel.SelectYesNo(1-tp,aux.Stringid(cd,3)))) then
local g=Group.CreateGroup()
......@@ -558,7 +560,7 @@ function XY.maganetgfilter2(c,tp)
return c:IsFacedown() and c:IsControler(1-tp)
end
function XY.maganeop2(e,tp,eg,ep,ev,re,r,rp)
if Duel.IsExistingMatchingCard(XY.maganesetfilter2,tp,LOCATION_GRAVE,0,1,nil) and Duel.SelectYesNo(1-tp,aux.Stringid(33403522,5)) then
if Duel.IsExistingMatchingCard(XY.maganesetfilter2,tp,LOCATION_GRAVE,0,1,nil) and Duel.SelectYesNo(tp,aux.Stringid(33403522,5)) then
local ss=Duel.GetLocationCount(tp,LOCATION_SZONE)
if ss>2 then ss=2 end
Duel.Hint(HINT_SELECTMSG,1-tp,HINTMSG_SET)
......@@ -602,7 +604,7 @@ function XY.maganeop3(e,tp,eg,ep,ev,re,r,rp)
local sg=Duel.GetMatchingGroup(Card.IsFaceup,tp,0,LOCATION_ONFIELD,aux.ExceptThisCard(e))
local ss=Duel.SendtoGrave(sg,REASON_EFFECT)
Duel.Damage(1-tp,ss*300,REASON_EFFECT)
if (Duel.IsExistingMatchingCard(Card.IsAbleToHand,tp,LOCATION_GRAVE,0,1,nil) or (Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(XY.maganespfilter3,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,nil,e,tp))) and Duel.SelectYesNo(1-tp,aux.Stringid(33403523,2)) then
if (Duel.IsExistingMatchingCard(Card.IsAbleToHand,tp,LOCATION_GRAVE,0,1,nil) or (Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(XY.maganespfilter3,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,nil,e,tp))) and Duel.SelectYesNo(tp,aux.Stringid(33403523,2)) then
if Duel.IsExistingMatchingCard(Card.IsAbleToHand,tp,LOCATION_GRAVE,0,1,nil) and (not (Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(XY.maganespfilter3,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,nil,e,tp)) or Duel.SelectOption(tp,aux.Stringid(33403523,4),aux.Stringid(33403523,5))==0) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,Card.IsAbleToHand,tp,LOCATION_GRAVE,0,1,1,nil)
......@@ -725,7 +727,7 @@ function XY.maganetrickop6(e,tp,eg,ep,ev,re,r,rp)
else
e0:SetReset(RESET_PHASE+PHASE_END+RESET_SELF_TURN,1)
end
Duel.RegisterEffect(e1,tp)
Duel.RegisterEffect(e0,tp)
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_CHANGE_DAMAGE)
......@@ -1042,6 +1044,53 @@ function XY.maganetrickop10(e,tp,eg,ep,ev,re,r,rp)
Duel.RegisterFlagEffect(tp,33413530,RESET_EVENT+RESET_PHASE+PHASE_END,0,0)
end
function XY.maganeop10(e,tp,eg,ep,ev,re,r,rp)
if Duel.IsExistingMatchingCard(XY.maganeckfilter10,tp,LOCATION_GRAVE,0,1,nil,tp) and Duel.SelectYesNo(tp,aux.Stringid(33403530,4)) then
local c=e:GetHandler()
local g=Duel.GetMatchingGroup(XY.maganeckfilter10,tp,LOCATION_GRAVE,0,nil,tp)
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(33403530,1))
local sg=g:SelectSubGroup(tp,aux.dncheck,false,1,2)
if sg:GetCount()>0 then
local tc=sg:GetFirst()
while tc do
if tc:IsCode(33403521) then
XY.maganere1(e,tp,eg,ep,ev,re,r,rp)
end
if tc:IsCode(33403522) then
XY.maganere2(e,tp,eg,ep,ev,re,r,rp)
end
if tc:IsCode(33403523) and Duel.IsExistingMatchingCard(Card.IsFaceup,tp,0,LOCATION_ONFIELD,1,nil) then
XY.maganere3(e,tp,eg,ep,ev,re,r,rp)
end
if tc:IsCode(33403524) and Duel.IsPlayerCanDraw(tp,3) then
XY.maganere4(e,tp,eg,ep,ev,re,r,rp)
end
if tc:IsCode(33403525) and (Duel.IsExistingMatchingCard(Card.IsAbleToChangeControler,tp,0,LOCATION_MZONE,1,nil) or Duel.GetLocationCount(1-tp,LOCATION_MZONE)==0) then
XY.maganere5(e,tp,eg,ep,ev,re,r,rp)
end
if tc:IsCode(33403526) and Duel.IsPlayerCanDraw(tp,1) then
XY.maganere6(e,tp,eg,ep,ev,re,r,rp)
end
if tc:IsCode(33403527) and Duel.IsExistingMatchingCard(XY.maganethfilter4,tp,LOCATION_GRAVE,0,1,nil) then
XY.maganere7(e,tp,eg,ep,ev,re,r,rp)
end
if tc:IsCode(33403528) then
XY.maganere8(e,tp,eg,ep,ev,re,r,rp)
end
cm1=Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)
cm2=Duel.GetFieldGroupCount(tp,0,LOCATION_DECK)
if tc:IsCode(33403529) and cm1>=4 and cm2>=4 and Duel.IsPlayerCanDraw(tp,1) then
XY.maganere9(e,tp,eg,ep,ev,re,r,rp)
end
if tc:IsCode(33403530) then
XY.maganere10(e,tp,eg,ep,ev,re,r,rp)
end
local tc=sg:GetNext()
end
end
end
end
function XY.maganere1(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,XY.maganethfilter1,tp,LOCATION_DECK+LOCATION_GRAVE,0,2,2,nil)
......@@ -1126,7 +1175,7 @@ function XY.maganere6(e,tp,eg,ep,ev,re,r,rp)
else
e0:SetReset(RESET_PHASE+PHASE_END+RESET_OPPO_TURN,1)
end
Duel.RegisterEffect(e1,tp)
Duel.RegisterEffect(e0,tp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_ACTIVATE)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment