Commit 007a2a05 authored by Tachibana's avatar Tachibana

ndyd

parent 4992b815
No preview for this file type
--星眼 --星眼
XY=XY or {} XY=XY or {}
XY.loaded_metatable_list={} XY.loaded_metatable_list={}
local cm=XY
function XY.load_metatable(code)
local m1=_G["c"..code]
if m1 then return m1 end
local m2=XY.loaded_metatable_list[code]
if m2 then return m2 end
_G["c"..code]={}
if pcall(function() dofile("expansions/script/c"..code..".lua") end) or pcall(function() dofile("script/c"..code..".lua") end) then
local mt=_G["c"..code]
_G["c"..code]=nil
if mt then
XY.loaded_metatable_list[code]=mt
return mt
end
else
_G["c"..code]=nil
end
end
------ ------
function XY.REZS(c) function XY.REZS(c)
if c:IsSetCard(0x5349) and not (c:GetCode()==33403501) then if c:IsSetCard(0x5349) and not (c:GetCode()==33403501) then
...@@ -298,6 +280,7 @@ if c:IsType(TYPE_QUICKPLAY) then ...@@ -298,6 +280,7 @@ if c:IsType(TYPE_QUICKPLAY) then
e2:SetCountLimit(1,cd+EFFECT_COUNT_CODE_OATH) e2:SetCountLimit(1,cd+EFFECT_COUNT_CODE_OATH)
e2:SetCondition(XY.maganechcon) e2:SetCondition(XY.maganechcon)
e2:SetCost(XY.maganechcost) e2:SetCost(XY.maganechcost)
e2:SetTarget(XY.maganetg)
e2:SetOperation(XY.maganechop) e2:SetOperation(XY.maganechop)
e2:SetLabel(cd) e2:SetLabel(cd)
c:RegisterEffect(e2) c:RegisterEffect(e2)
...@@ -322,7 +305,30 @@ function XY.maganechcost(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -322,7 +305,30 @@ function XY.maganechcost(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM)
local g1=Duel.SelectMatchingCard(tp,XY.maganecostfilter1,tp,LOCATION_HAND,0,1,1,e:GetHandler()) local g1=Duel.SelectMatchingCard(tp,XY.maganecostfilter1,tp,LOCATION_HAND,0,1,1,e:GetHandler())
local tc=g1:GetFirst() local tc=g1:GetFirst()
Duel.ConfirmCards(1-tp,tc) Duel.ConfirmCards(1-tp,tc)
end
function XY.maganetg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return true end
if cd==33403521 then
e:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH+CATEGORY_DRAW)
elseif cd==33403522 then
e:SetCategory(CATEGORY_TOHAND+CATEGORY_DAMAGE+CATEGORY_TOGRAVE)
elseif cd==33403523 then
e:SetCategory(CATEGORY_DRAW+CATEGORY_DAMAGE+CATEGORY_TOGRAVE+CATEGORY_SPECIAL_SUMMON)
elseif cd==33403524 then
e:SetCategory(CATEGORY_DRAW+CATEGORY_TOGRAVE+CATEGORY_TOHAND)
elseif cd==33403525 then
e:SetCategory(CATEGORY_CONTROL+CATEGORY_DAMAGE+CATEGORY_RECOVER)
elseif cd==33403526 then
e:SetCategory(CATEGORY_DISABLE+CATEGORY_DRAW)
elseif cd==33403527 then
e:SetCategory(CATEGORY_TOHAND)
elseif cd==33403528 then
e:SetCategory(CATEGORY_TOHAND+CATEGORY_SPECIAL_SUMMON+CATEGORY_ATKCHANGE+CATEGORY_DEFCHANGE)
elseif cd==33403529 then
e:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH+CATEGORY_DRAW)
end
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
end end
function XY.maganechop(e,tp,eg,ep,ev,re,r,rp) function XY.maganechop(e,tp,eg,ep,ev,re,r,rp)
local cd=e:GetLabel() local cd=e:GetLabel()
......
...@@ -32,6 +32,7 @@ function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -32,6 +32,7 @@ function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,cm.cfilter,tp,LOCATION_DECK,0,1,1,nil) local g=Duel.SelectMatchingCard(tp,cm.cfilter,tp,LOCATION_DECK,0,1,1,nil)
Duel.SendtoGrave(g,REASON_COST) Duel.SendtoGrave(g,REASON_COST)
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
end end
function cm.filter(c) function cm.filter(c)
return c:IsCode(33403520) and c:IsAbleToHand() return c:IsCode(33403520) and c:IsAbleToHand()
......
...@@ -26,6 +26,7 @@ function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -26,6 +26,7 @@ function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local g1=Duel.SelectMatchingCard(tp,cm.costfilter1,tp,LOCATION_HAND,0,1,1,e:GetHandler()) local g1=Duel.SelectMatchingCard(tp,cm.costfilter1,tp,LOCATION_HAND,0,1,1,e:GetHandler())
local tc=g1:GetFirst() local tc=g1:GetFirst()
Duel.ConfirmCards(1-tp,tc) Duel.ConfirmCards(1-tp,tc)
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
end end
function cm.filter(c) function cm.filter(c)
return c:IsCode(33403520) and c:IsAbleToHand() return c:IsCode(33403520) and c:IsAbleToHand()
......
...@@ -26,6 +26,7 @@ function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -26,6 +26,7 @@ function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local g1=Duel.SelectMatchingCard(tp,cm.costfilter1,tp,LOCATION_HAND,0,1,1,e:GetHandler()) local g1=Duel.SelectMatchingCard(tp,cm.costfilter1,tp,LOCATION_HAND,0,1,1,e:GetHandler())
local tc=g1:GetFirst() local tc=g1:GetFirst()
Duel.ConfirmCards(1-tp,tc) Duel.ConfirmCards(1-tp,tc)
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
end end
function cm.filter(c) function cm.filter(c)
return c:IsCode(33403520) and c:IsAbleToHand() return c:IsCode(33403520) and c:IsAbleToHand()
......
...@@ -26,6 +26,7 @@ function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -26,6 +26,7 @@ function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local g1=Duel.SelectMatchingCard(tp,cm.costfilter1,tp,LOCATION_HAND,0,1,1,e:GetHandler()) local g1=Duel.SelectMatchingCard(tp,cm.costfilter1,tp,LOCATION_HAND,0,1,1,e:GetHandler())
local tc=g1:GetFirst() local tc=g1:GetFirst()
Duel.ConfirmCards(1-tp,tc) Duel.ConfirmCards(1-tp,tc)
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
end end
function cm.filter(c,tp) function cm.filter(c,tp)
return (c:IsSetCard(0x6349) or c:IsCode(33403520) or c:GetOwner()==1-tp) and c:IsAbleToGrave() return (c:IsSetCard(0x6349) or c:IsCode(33403520) or c:GetOwner()==1-tp) and c:IsAbleToGrave()
......
...@@ -26,6 +26,7 @@ function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -26,6 +26,7 @@ function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local g1=Duel.SelectMatchingCard(tp,cm.costfilter1,tp,LOCATION_HAND,0,1,1,e:GetHandler()) local g1=Duel.SelectMatchingCard(tp,cm.costfilter1,tp,LOCATION_HAND,0,1,1,e:GetHandler())
local tc=g1:GetFirst() local tc=g1:GetFirst()
Duel.ConfirmCards(1-tp,tc) Duel.ConfirmCards(1-tp,tc)
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
end end
function cm.filter(c,tp) function cm.filter(c,tp)
return c:GetOwner()==1-tp return c:GetOwner()==1-tp
......
...@@ -26,6 +26,7 @@ function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -26,6 +26,7 @@ function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local g1=Duel.SelectMatchingCard(tp,cm.costfilter1,tp,LOCATION_HAND,0,1,1,e:GetHandler()) local g1=Duel.SelectMatchingCard(tp,cm.costfilter1,tp,LOCATION_HAND,0,1,1,e:GetHandler())
local tc=g1:GetFirst() local tc=g1:GetFirst()
Duel.ConfirmCards(1-tp,tc) Duel.ConfirmCards(1-tp,tc)
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
end end
function cm.tgfilter(c) function cm.tgfilter(c)
return (c:IsSetCard(0x6349) or c:IsCode(33403520)) and c:IsAbleToGrave() return (c:IsSetCard(0x6349) or c:IsCode(33403520)) and c:IsAbleToGrave()
......
...@@ -26,6 +26,7 @@ function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -26,6 +26,7 @@ function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local g1=Duel.SelectMatchingCard(tp,cm.costfilter1,tp,LOCATION_HAND,0,1,1,e:GetHandler()) local g1=Duel.SelectMatchingCard(tp,cm.costfilter1,tp,LOCATION_HAND,0,1,1,e:GetHandler())
local tc=g1:GetFirst() local tc=g1:GetFirst()
Duel.ConfirmCards(1-tp,tc) Duel.ConfirmCards(1-tp,tc)
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
end end
function cm.tgfilter(c) function cm.tgfilter(c)
return (c:IsSetCard(0x6349) or c:IsCode(33403520)) and c:IsAbleToGrave() return (c:IsSetCard(0x6349) or c:IsCode(33403520)) and c:IsAbleToGrave()
......
...@@ -32,6 +32,7 @@ function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -32,6 +32,7 @@ function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,cm.cfilter,tp,LOCATION_DECK,0,1,1,nil) local g=Duel.SelectMatchingCard(tp,cm.cfilter,tp,LOCATION_DECK,0,1,1,nil)
Duel.SendtoGrave(g,REASON_COST) Duel.SendtoGrave(g,REASON_COST)
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
end end
function cm.filter(c) function cm.filter(c)
return c:IsCode(33403520) and c:IsFaceup() return c:IsCode(33403520) and c:IsFaceup()
...@@ -56,7 +57,7 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -56,7 +57,7 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE+EFFECT_FLAG_CANNOT_DISABLE) e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE+EFFECT_FLAG_CANNOT_DISABLE)
e1:SetValue(atk) e1:SetValue(atk)
e1:SetReset(RESET_EVENT+RESETS_STANDARD) e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1) tc:RegisterEffect(e1)
end end
if def>0 then if def>0 then
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
...@@ -65,7 +66,7 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -65,7 +66,7 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE+EFFECT_FLAG_CANNOT_DISABLE) e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE+EFFECT_FLAG_CANNOT_DISABLE)
e1:SetValue(def) e1:SetValue(def)
e1:SetReset(RESET_EVENT+RESETS_STANDARD) e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1) tc:RegisterEffect(e1)
end end
local ss=Duel.GetMatchingGroup(nil,tp,LOCATION_MZONE,0,nil):GetCount() local ss=Duel.GetMatchingGroup(nil,tp,LOCATION_MZONE,0,nil):GetCount()
local e1=Effect.CreateEffect(e:GetHandler()) local e1=Effect.CreateEffect(e:GetHandler())
......
...@@ -26,6 +26,7 @@ function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -26,6 +26,7 @@ function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local g1=Duel.SelectMatchingCard(tp,cm.costfilter1,tp,LOCATION_HAND,0,1,1,e:GetHandler()) local g1=Duel.SelectMatchingCard(tp,cm.costfilter1,tp,LOCATION_HAND,0,1,1,e:GetHandler())
local tc=g1:GetFirst() local tc=g1:GetFirst()
Duel.ConfirmCards(1-tp,tc) Duel.ConfirmCards(1-tp,tc)
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
end end
function cm.filter1(c) function cm.filter1(c)
return (c:IsSetCard(0x6349) or c:IsCode(33403520)) and c:IsAbleToHand() return (c:IsSetCard(0x6349) or c:IsCode(33403520)) and c:IsAbleToHand()
...@@ -64,6 +65,6 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -64,6 +65,6 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.ShuffleHand(tp) Duel.ShuffleHand(tp)
Duel.SortDecktop(tp,1-tp,3) Duel.SortDecktop(tp,1-tp,3)
else Duel.SortDecktop(tp,1-tp,4) else Duel.SortDecktop(tp,1-tp,4)
end end
end end
end end
...@@ -23,6 +23,7 @@ function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -23,6 +23,7 @@ function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local g1=Duel.SelectMatchingCard(tp,cm.costfilter1,tp,LOCATION_HAND,0,1,1,e:GetHandler()) local g1=Duel.SelectMatchingCard(tp,cm.costfilter1,tp,LOCATION_HAND,0,1,1,e:GetHandler())
local tc=g1:GetFirst() local tc=g1:GetFirst()
Duel.ConfirmCards(1-tp,tc) Duel.ConfirmCards(1-tp,tc)
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
end end
function cm.activate(e,tp,eg,ep,ev,re,r,rp) function cm.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.RegisterFlagEffect(tp,m,RESET_EVENT+RESET_PHASE+PHASE_END,0,0) Duel.RegisterFlagEffect(tp,m,RESET_EVENT+RESET_PHASE+PHASE_END,0,0)
......
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