Commit f064b2fd authored by Nemo Ma's avatar Nemo Ma

fix

parent b7823ae6
......@@ -155,12 +155,29 @@ function cm.pspop(e,tp,eg,ep,ev,re,r,rp)
if not g then return end
Duel.HintSelection(Group.FromCards(lpz))
Duel.HintSelection(Group.FromCards(rpz))
for tc in aux.Next(g) do
--[[for tc in aux.Next(g) do
local bool=aux.PendulumSummonableBool(tc)
Duel.SpecialSummonStep(tc,SUMMON_TYPE_PENDULUM,tp,tp,bool,bool,POS_FACEUP)
end
Duel.SpecialSummonComplete()
for tc in aux.Next(g) do tc:CompleteProcedure() end
for tc in aux.Next(g) do tc:CompleteProcedure() end--]]
local tc=g:GetFirst()
if not tc.pendulum_rule then
local e1=Effect.CreateEffect(tc)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetRange(LOCATION_HAND+LOCATION_EXTRA)
e1:SetLabel(1)
e1:SetCondition(function(e) return e:GetLabel()==1 end)
e1:SetTarget(function(e) e:SetLabel(0) return true end)
e1:SetValue(SUMMON_TYPE_PENDULUM)
tc:RegisterEffect(e1,true)
_G["c"..tc:GetOriginalCode()].pendulum_rule=e1
else
tc.pendulum_rule:SetLabel(1)
end
Duel.SpecialSummonRule(tp,tc,SUMMON_TYPE_PENDULUM)
end
function cm.spcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
......
......@@ -155,12 +155,23 @@ function cm.pspop(e,tp,eg,ep,ev,re,r,rp)
if not g then return end
Duel.HintSelection(Group.FromCards(lpz))
Duel.HintSelection(Group.FromCards(rpz))
for tc in aux.Next(g) do
local bool=aux.PendulumSummonableBool(tc)
Duel.SpecialSummonStep(tc,SUMMON_TYPE_PENDULUM,tp,tp,bool,bool,POS_FACEUP)
local tc=g:GetFirst()
if not tc.pendulum_rule then
local e1=Effect.CreateEffect(tc)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetRange(LOCATION_HAND+LOCATION_EXTRA)
e1:SetLabel(1)
e1:SetCondition(function(e) return e:GetLabel()==1 end)
e1:SetTarget(function(e) e:SetLabel(0) return true end)
e1:SetValue(SUMMON_TYPE_PENDULUM)
tc:RegisterEffect(e1,true)
_G["c"..tc:GetOriginalCode()].pendulum_rule=e1
else
tc.pendulum_rule:SetLabel(1)
end
Duel.SpecialSummonComplete()
for tc in aux.Next(g) do tc:CompleteProcedure() end
Duel.SpecialSummonRule(tp,tc,SUMMON_TYPE_PENDULUM)
end
function cm.spcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
......
......@@ -156,12 +156,23 @@ function cm.pspop(e,tp,eg,ep,ev,re,r,rp)
if not g then return end
Duel.HintSelection(Group.FromCards(lpz))
Duel.HintSelection(Group.FromCards(rpz))
for tc in aux.Next(g) do
local bool=aux.PendulumSummonableBool(tc)
Duel.SpecialSummonStep(tc,SUMMON_TYPE_PENDULUM,tp,tp,bool,bool,POS_FACEUP)
local tc=g:GetFirst()
if not tc.pendulum_rule then
local e1=Effect.CreateEffect(tc)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetRange(LOCATION_HAND+LOCATION_EXTRA)
e1:SetLabel(1)
e1:SetCondition(function(e) return e:GetLabel()==1 end)
e1:SetTarget(function(e) e:SetLabel(0) return true end)
e1:SetValue(SUMMON_TYPE_PENDULUM)
tc:RegisterEffect(e1,true)
_G["c"..tc:GetOriginalCode()].pendulum_rule=e1
else
tc.pendulum_rule:SetLabel(1)
end
Duel.SpecialSummonComplete()
for tc in aux.Next(g) do tc:CompleteProcedure() end
Duel.SpecialSummonRule(tp,tc,SUMMON_TYPE_PENDULUM)
end
function cm.spcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
......
......@@ -155,12 +155,23 @@ function cm.pspop(e,tp,eg,ep,ev,re,r,rp)
if not g then return end
Duel.HintSelection(Group.FromCards(lpz))
Duel.HintSelection(Group.FromCards(rpz))
for tc in aux.Next(g) do
local bool=aux.PendulumSummonableBool(tc)
Duel.SpecialSummonStep(tc,SUMMON_TYPE_PENDULUM,tp,tp,bool,bool,POS_FACEUP)
local tc=g:GetFirst()
if not tc.pendulum_rule then
local e1=Effect.CreateEffect(tc)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetRange(LOCATION_HAND+LOCATION_EXTRA)
e1:SetLabel(1)
e1:SetCondition(function(e) return e:GetLabel()==1 end)
e1:SetTarget(function(e) e:SetLabel(0) return true end)
e1:SetValue(SUMMON_TYPE_PENDULUM)
tc:RegisterEffect(e1,true)
_G["c"..tc:GetOriginalCode()].pendulum_rule=e1
else
tc.pendulum_rule:SetLabel(1)
end
Duel.SpecialSummonComplete()
for tc in aux.Next(g) do tc:CompleteProcedure() end
Duel.SpecialSummonRule(tp,tc,SUMMON_TYPE_PENDULUM)
end
function cm.spcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
......
......@@ -154,12 +154,23 @@ function cm.pspop(e,tp,eg,ep,ev,re,r,rp)
if not g then return end
Duel.HintSelection(Group.FromCards(lpz))
Duel.HintSelection(Group.FromCards(rpz))
for tc in aux.Next(g) do
local bool=aux.PendulumSummonableBool(tc)
Duel.SpecialSummonStep(tc,SUMMON_TYPE_PENDULUM,tp,tp,bool,bool,POS_FACEUP)
local tc=g:GetFirst()
if not tc.pendulum_rule then
local e1=Effect.CreateEffect(tc)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetRange(LOCATION_HAND+LOCATION_EXTRA)
e1:SetLabel(1)
e1:SetCondition(function(e) return e:GetLabel()==1 end)
e1:SetTarget(function(e) e:SetLabel(0) return true end)
e1:SetValue(SUMMON_TYPE_PENDULUM)
tc:RegisterEffect(e1,true)
_G["c"..tc:GetOriginalCode()].pendulum_rule=e1
else
tc.pendulum_rule:SetLabel(1)
end
Duel.SpecialSummonComplete()
for tc in aux.Next(g) do tc:CompleteProcedure() end
Duel.SpecialSummonRule(tp,tc,SUMMON_TYPE_PENDULUM)
end
function cm.regcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
......
......@@ -154,12 +154,23 @@ function cm.pspop(e,tp,eg,ep,ev,re,r,rp)
if not g then return end
Duel.HintSelection(Group.FromCards(lpz))
Duel.HintSelection(Group.FromCards(rpz))
for tc in aux.Next(g) do
local bool=aux.PendulumSummonableBool(tc)
Duel.SpecialSummonStep(tc,SUMMON_TYPE_PENDULUM,tp,tp,bool,bool,POS_FACEUP)
local tc=g:GetFirst()
if not tc.pendulum_rule then
local e1=Effect.CreateEffect(tc)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetRange(LOCATION_HAND+LOCATION_EXTRA)
e1:SetLabel(1)
e1:SetCondition(function(e) return e:GetLabel()==1 end)
e1:SetTarget(function(e) e:SetLabel(0) return true end)
e1:SetValue(SUMMON_TYPE_PENDULUM)
tc:RegisterEffect(e1,true)
_G["c"..tc:GetOriginalCode()].pendulum_rule=e1
else
tc.pendulum_rule:SetLabel(1)
end
Duel.SpecialSummonComplete()
for tc in aux.Next(g) do tc:CompleteProcedure() end
Duel.SpecialSummonRule(tp,tc,SUMMON_TYPE_PENDULUM)
end
function cm.regcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
......
......@@ -228,10 +228,21 @@ function cm.pspop(e,tp,eg,ep,ev,re,r,rp)
if not g then return end
Duel.HintSelection(Group.FromCards(lpz))
Duel.HintSelection(Group.FromCards(rpz))
for tc in aux.Next(g) do
local bool=aux.PendulumSummonableBool(tc)
Duel.SpecialSummonStep(tc,SUMMON_TYPE_PENDULUM,tp,tp,bool,bool,POS_FACEUP)
local tc=g:GetFirst()
if not tc.pendulum_rule then
local e1=Effect.CreateEffect(tc)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetRange(LOCATION_HAND+LOCATION_EXTRA)
e1:SetLabel(1)
e1:SetCondition(function(e) return e:GetLabel()==1 end)
e1:SetTarget(function(e) e:SetLabel(0) return true end)
e1:SetValue(SUMMON_TYPE_PENDULUM)
tc:RegisterEffect(e1,true)
_G["c"..tc:GetOriginalCode()].pendulum_rule=e1
else
tc.pendulum_rule:SetLabel(1)
end
Duel.SpecialSummonComplete()
for tc in aux.Next(g) do tc:CompleteProcedure() end
Duel.SpecialSummonRule(tp,tc,SUMMON_TYPE_PENDULUM)
end
\ No newline at end of file
......@@ -21,7 +21,7 @@ function cm.thfilter(c,e,tp,sc)
return c:IsSetCard(0x5f31) and (sc:IsCode(table.unpack(class.name_beyond_Non_Vemoisit)) or sc:IsCode(c:GetCode())) and (b1 or b2) and c:IsType(TYPE_MONSTER)
end
function cm.rmfilter(c,e,tp)
return c:IsAbleToRemoveAsCost() and Duel.IsExistingMatchingCard(cm.thfilter,tp,LOCATION_DECK,0,1,nil,e,tp,c)
return c:IsAbleToRemoveAsCost() and Duel.IsExistingMatchingCard(cm.thfilter,tp,LOCATION_DECK,0,1,c,e,tp,c)
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.rmfilter,tp,LOCATION_DECK+LOCATION_EXTRA,0,1,nil,e,tp) end
......
......@@ -96,14 +96,14 @@ end
function cm.sp2con(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2
end
function cm.thfilter(c)
return c:IsSetCard(0x5f31) and c:IsAbleToHand()
function cm.th2filter(c)
return c:IsSetCard(0x5f31) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
end
function cm.sp2filter(c,e,tp)
return c:IsSetCard(0x5f31) and c.NonVemoisit_type and c.NonVemoisit_type=="Former" and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function cm.sp2tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.thfilter,tp,LOCATION_GRAVE,0,1,nil) and Duel.IsExistingMatchingCard(aux.TRUE,tp,LOCATION_ONFIELD,0,1,nil) end
if chk==0 then return Duel.IsExistingMatchingCard(cm.th2filter,tp,LOCATION_GRAVE,0,1,nil) and Duel.IsExistingMatchingCard(aux.TRUE,tp,LOCATION_ONFIELD,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_GRAVE)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,nil,1,tp,LOCATION_ONFIELD)
end
......@@ -115,7 +115,7 @@ function cm.sp2op(e,tp,eg,ep,ev,re,r,rp)
local d2g=Duel.GetOperatedGroup()
cg:Merge(d2g)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local rg=Duel.SelectMatchingCard(tp,cm.thfilter,tp,LOCATION_GRAVE,0,1,1,nil)
local rg=Duel.SelectMatchingCard(tp,cm.th2filter,tp,LOCATION_GRAVE,0,1,1,nil)
if #rg~=0 and Duel.SendtoHand(rg,nil,REASON_EFFECT)~=0 then
local r2g=Duel.GetOperatedGroup()
cg:Merge(r2g)
......
......@@ -49,6 +49,8 @@
!setname 0xc460 键★等(K.E.Y Etc.)
!counter 0x1460 光玉(Light Orb
!counter 0x46c 生命值指示物
!counter 0x46d 重负指示物
!counter 0x46e 天堂指示物
!counter 0x46f 明星指示物
#cm.named_with_NewVenture 内置字段:踏破新世界
......
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