Commit e328cadf authored by TanakaKotoha's avatar TanakaKotoha

fix lua and cdb

parent 5974f81a
No preview for this file type
......@@ -42,7 +42,7 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(cm.atkfilter,tp,LOCATION_MZONE,0,nil)
local ac=g:GetFirst()
while ac do
local e3=Effect.CreateEffect(c)
local e3=Effect.CreateEffect(e:GetHandler())
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_UPDATE_ATTACK)
e3:SetReset(RESET_EVENT+RESETS_STANDARD)
......
......@@ -4,17 +4,28 @@ local cm=_G["c"..m]
function cm.initial_effect(c)
--pendulum summon
aux.EnablePendulumAttribute(c)
--search
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(17060920,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_PZONE)
e1:SetCountLimit(1)
e1:SetCost(cm.thcost)
e1:SetTarget(cm.thtg)
e1:SetOperation(cm.thop)
c:RegisterEffect(e1)
--scale
local e0=Effect.CreateEffect(c)
e0:SetDescription(aux.Stringid(m,0))
e0:SetCategory(CATEGORY_TOHAND+CATEGORY_SPECIAL_SUMMON)
e0:SetType(EFFECT_TYPE_IGNITION)
e0:SetRange(LOCATION_HAND+LOCATION_GRAVE)
e0:SetProperty(EFFECT_FLAG_CARD_TARGET)
e0:SetCountLimit(1,m)
e0:SetTarget(cm.sptg)
e0:SetOperation(cm.spop)
c:RegisterEffect(e0)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(17060920,1))
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_HAND+LOCATION_GRAVE)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetCountLimit(1,17060920)
e2:SetTarget(cm.sptg)
e2:SetOperation(cm.spop)
c:RegisterEffect(e2)
end
cm.is_named_with_Million_Arthur=1
cm.is_named_with_Symphony=1
......@@ -26,15 +37,35 @@ function cm.IsSymphony(c)
local m=_G["c"..c:GetCode()]
return m and m.is_named_with_Symphony
end
function cm.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,1,e:GetHandler()) end
Duel.DiscardHand(tp,Card.IsDiscardable,1,1,REASON_COST+REASON_DISCARD)
end
function cm.thfilter(c)
return cm.IsSymphony(c) and c:IsAbleToHand()
return c:IsSetCard(0x17f3) and c:IsAbleToHand()
end
function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,cm.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
function cm.thfilter1(c)
return c:IsAbleToHand()
end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_PZONE) and chkc:IsControler(tp) and cm.thfilter(chkc) and chkc~=e:GetHandler() end
if chk==0 then return Duel.IsExistingTarget(cm.thfilter,tp,LOCATION_PZONE,0,1,nil)
if chkc then return chkc:IsLocation(LOCATION_PZONE) and chkc:IsControler(tp) and cm.thfilter1(chkc) and chkc~=e:GetHandler() end
if chk==0 then return Duel.IsExistingTarget(cm.thfilter1,tp,LOCATION_PZONE,0,1,nil)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectTarget(tp,cm.thfilter,tp,LOCATION_PZONE,0,1,1,nil)
local g=Duel.SelectTarget(tp,cm.thfilter1,tp,LOCATION_PZONE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
......
......@@ -6,17 +6,17 @@ function cm.initial_effect(c)
aux.EnablePendulumAttribute(c)
--to hand
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetDescription(aux.Stringid(17060921,0))
e1:SetCategory(CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_PZONE)
e1:SetCountLimit(1,m)
e1:SetCountLimit(1,17060921)
e1:SetTarget(cm.thtg)
e1:SetOperation(cm.thop)
c:RegisterEffect(e1)
--scale
local e0=Effect.CreateEffect(c)
e0:SetDescription(aux.Stringid(m,1))
e0:SetDescription(aux.Stringid(17060921,1))
e0:SetType(EFFECT_TYPE_IGNITION)
e0:SetRange(LOCATION_MZONE)
e0:SetProperty(EFFECT_FLAG_CARD_TARGET)
......@@ -34,15 +34,8 @@ function cm.IsSymphony(c)
local m=_G["c"..c:GetCode()]
return m and m.is_named_with_Symphony
end
function iCount(name,tp,m,id)
return ((name=="get" or name=="set")
and {(name=="get"
and {tonumber(((Duel.GetFlagEffect(tp,m)==nil) and {0} or {Duel.GetFlagEffect(tp,m)})[1])}
or { Debug.Message("","请使用Duel.RegisterFlagEffect(tp,m,RESET_PHASE+PHASE_END,0,1)") })[1]}
or {(bit.band(iCount("get",tp,m,id),math.pow(2,id-1))==0 and {true} or {false})[1]})[1]
end
function cm.thfilter(c)
return c:IsFaceup() and cm.IsSymphony(c) and c:IsType(TYPE_PENDULUM) and not c:IsCode(17060921) and c:IsAbleToHand()
return c:IsFaceup() and (c:IsSetCard(0x17f3) or c:IsSetCard(0x7f0)) and c:IsType(TYPE_PENDULUM) and c:IsAbleToHand()
end
function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.thfilter,tp,LOCATION_EXTRA,0,1,nil) end
......@@ -65,16 +58,16 @@ function cm.spfilter2(c,e,tp)
end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_PZONE) and chkc:IsControler(tp) and cm.thfilter1(chkc) and chkc~=e:GetHandler() end
if chk==0 then return iCount(0,tp,m,1) and Duel.IsExistingTarget(cm.thfilter1,tp,LOCATION_PZONE,0,1,nil)
if chk==0 then return Duel.GetFlagEffect(tp,17060921)==0 and Duel.IsExistingTarget(cm.thfilter1,tp,LOCATION_PZONE,0,1,nil)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectTarget(tp,cm.thfilter1,tp,LOCATION_PZONE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,1,0,0)
Duel.RegisterFlagEffect(tp,m,RESET_PHASE+PHASE_END,0,1)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0)
Duel.RegisterFlagEffect(tp,17060921,RESET_PHASE+PHASE_END,0,1)
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.SendtoDeck(tc,nil,2,REASON_EFFECT)~=0 and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
if tc:IsRelateToEffect(e) and Duel.SendtoHand(tc,nil,REASON_EFFECT)~=0 and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(cm.spfilter2,tp,LOCATION_HAND,0,1,nil,e,tp) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,cm.spfilter2,tp,LOCATION_HAND,0,1,1,nil,e,tp)
......
......@@ -60,7 +60,7 @@ function c65050139.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local efg=eg:Filter(c65050139.spconf1,nil,tp)
local efc=efg:GetFirst()
if chk==0 then
local mg1=Duel.GetMatchingGroup(c65050139.esrifil,tp,LOCATION_GRAVE,0,e:GetHandler())
local mg1=Duel.GetMatchingGroup(c65050139.esrifil,tp,LOCATION_GRAVE,0,efc)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
return c65050139.filter(efc,e,tp,mg1,ft) and e:GetHandler():GetFlagEffect(65050139)==0
end
......@@ -71,7 +71,7 @@ function c65050139.spop(e,tp,eg,ep,ev,re,r,rp)
local efg=eg:Filter(c65050139.spconf1,nil,tp)
local efc=efg:GetFirst()
if not efc:IsLocation(LOCATION_GRAVE) then return end
local mg1=Duel.GetMatchingGroup(c65050139.esrifil,tp,LOCATION_GRAVE,0,nil)
local mg1=Duel.GetMatchingGroup(c65050139.esrifil,tp,LOCATION_GRAVE,0,efc)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if c65050139.filter(efc,e,tp,mg1,ft) then
local mg=mg1
......
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