Commit ea74190d authored by Nemo Ma's avatar Nemo Ma

fix

parent 14c89251
......@@ -8,7 +8,7 @@ local tableclone=function(tab,mytab)
return res
end
local readonly=function(tab)
local meta={__index=tab,__newindex=function() assert(false,'不准偷偷改我的lua!色狼!!\n') end}
local meta={__index=tab,__newindex=function() assert(false,"不准偷偷改我的lua!色狼!!\n") end}
local lock={}
setmetatable(lock,meta)
return lock
......@@ -20,7 +20,7 @@ Card.RegisterEffect=function(c,e,bool)
local e0=_Effect.CreateEffect(c)
_Effect.SetType(e0,EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
_Effect.SetCode(e0,EVENT_ADJUST)
_Effect.SetTarget(e0,cm.op)
_Effect.SetOperation(e0,cm.op)
_Duel.RegisterEffect(e0,0)
Card.RegisterEffect=_Card.RegisterEffect
_Card.RegisterEffect(c,e,bool)
......@@ -41,10 +41,12 @@ function cm.op(e,tp,eg,ep,ev,re,r,rp)
local ct1=_Duel.GetMatchingGroupCount(_Card.IsCode,0,0,0xff,nil,m)
if ct0>0 then
_Duel.Hint(HINT_SELECTMSG,1,aux.Stringid(m,2))
if _Duel.DisableActionCheck then _Duel.DisableActionCheck(true) end
pcall(_Duel.AnnounceCard,1,0,OPCODE_ISTYPE)
end
if ct1>0 then
_Duel.Hint(HINT_SELECTMSG,0,aux.Stringid(m,2))
if _Duel.DisableActionCheck then _Duel.DisableActionCheck(true) end
pcall(_Duel.AnnounceCard,0,0,OPCODE_ISTYPE)
end
end
......
......@@ -29,5 +29,5 @@ function cm.getzone(c,tp)
end
function cm.disval(e)
local g=Duel.GetFieldGroup(0,LOCATION_ONFIELD,LOCATION_ONFIELD)
return g:GetSum(cm.getzone,e:GetHandlerPlayer())
return g:GetSum(cm.getzone,0)
end
\ No newline at end of file
......@@ -4,7 +4,7 @@ cm.name="真龙皇 十二炼机圣"
function cm.initial_effect(c)
c:EnableReviveLimit()
local e0=aux.AddLinkProcedure(c,nil,3,3,cm.lcheck)
e0:SetProperty(e0:GetProperty()|EFFECT_FLAG_SET_AVAILABLE)
e0:SetLabel(m)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_MATERIAL_CHECK)
......@@ -37,38 +37,15 @@ function cm.initial_effect(c)
e4:SetTarget(cm.tg)
e4:SetOperation(cm.op)
c:RegisterEffect(e4)
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_SINGLE)
e5:SetCode(EFFECT_EXTRA_LINK_MATERIAL)
e5:SetRange(LOCATION_EXTRA)
e5:SetTargetRange(LOCATION_ONFIELD,0)
e5:SetTarget(cm.mattg)
e5:SetValue(cm.matval)
c:RegisterEffect(e5)
if not aux.link_mat_hack_check then
aux.link_mat_hack_check=true
_IsCanBeLinkMaterial=Card.IsCanBeLinkMaterial
function Card.IsCanBeLinkMaterial(c,lc)
if c:GetOriginalType()&TYPE_MONSTER~=0 then
return _IsCanBeLinkMaterial(c,lc)
end
if c:IsForbidden() then return false end
local le={c:IsHasEffect(EFFECT_CANNOT_BE_LINK_MATERIAL)}
for _,te in pairs(le) do
local tf=te:GetValue()
local tval=tf(te,lc)
if tval then return false end
end
return true
end
end
if not aux.get_link_mat_hack_check then
aux.get_link_mat_hack_check=true
if not cm.get_link_mat_hack_check then
cm.get_link_mat_hack_check=true
cm._GetLinkMaterials=aux.GetLinkMaterials
function aux.GetLinkMaterials(tp,f,lc,e)
local mg=Duel.GetMatchingGroup(Auxiliary.LConditionFilter,tp,LOCATION_ONFIELD,0,nil,f,lc,e)
local mg2=Duel.GetMatchingGroup(Auxiliary.LExtraFilter,tp,LOCATION_HAND+LOCATION_SZONE,LOCATION_ONFIELD,nil,f,lc,tp)
if mg2:GetCount()>0 then mg:Merge(mg2) end
local mg=cm._GetLinkMaterials(tp,f,lc,e)
if e:GetLabel()==m then
local mg2=Duel.GetMatchingGroup(cm.exmatfilter,tp,LOCATION_SZONE,0,nil,lc)
if mg2:GetCount()>0 then mg:Merge(mg2) end
end
return mg
end
end
......@@ -82,19 +59,11 @@ function cm.lcheckc(c)
end
return 0x100
end
function cm.lcheck2(c)
local con1=c:IsType(TYPE_MONSTER) and c:IsPosition(POS_FACEDOWN_DEFENSE)
local con2=c:IsType(TYPE_TRAP+TYPE_SPELL) and not c:IsType(TYPE_CONTINUOUS+TYPE_TRAPMONSTER)
return con1 or con2 or con3
end
function cm.lcheck(g)
return g:GetClassCount(cm.lcheckc)==g:GetCount() and g:FilterCount(cm.lcheck2,nil)==0
end
function cm.mattg(e,c)
return c:IsType(TYPE_CONTINUOUS)
return g:GetClassCount(cm.lcheckc)==g:GetCount()
end
function cm.matval(e,lc,mg,c,tp)
return true,true
function cm.exmatfilter(c,lc)
return c:IsType(TYPE_CONTINUOUS) and c:IsCanBeLinkMaterial(lc)
end
function cm.valcheck(e,c)
local g=c:GetMaterial()
......
......@@ -31,7 +31,7 @@ function cm.initial_effect(c)
c:RegisterEffect(e2)
end
function cm.filter(c,e,tp)
return cm.linkjoker(c) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
return (cm.linkjoker(c) or cm.Reverse(c)) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
......
......@@ -119,7 +119,7 @@ end
function cm.tgtg(e,tp,eg,ep,ev,re,r,rp,chk)
local g=e:GetLabel()
--local g=e:GetHandler():GetOverlayGroup():Filter(Card.IsType,nil,TYPE_SYNCHRO)
if chk==0 then return #g>0 and Duel.GetFieldGroupCount(tp,0,LOCATION_ONFIELD)>0 end
if chk==0 then return g:GetCount()>0 and Duel.GetFieldGroupCount(tp,0,LOCATION_ONFIELD)>0 end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,g,g:GetCount(),0,0)
end
function cm.spfilter(c,e,tp)
......@@ -129,12 +129,12 @@ function cm.tgop(e,tp,eg,ep,ev,re,r,rp)
local dg=Duel.GetMatchingGroup(aux.TRUE,tp,0,LOCATION_ONFIELD,nil)
local g=e:GetLabel()
--local g=e:GetHandler():GetOverlayGroup():Filter(Card.IsType,nil,TYPE_SYNCHRO)
if #g>0 and #dg>0 then
if g:GetCount()>0 and dg:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local sdg=dg:Select(tp,1,g:GetCount(),nil)
Duel.HintSelection(sdg)
local sg=Duel.SendtoGrave(sdg,REASON_EFFECT)
if #sg>0 then
if sg:GetCount()>0 then
local cg=Duel.GetMatchingGroup(cm.spfilter,tp,LOCATION_DECK,0,nil,e,tp)
if cg:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(m,3)) then
local ct=sg:GetCount()
......
......@@ -158,13 +158,11 @@ function cm.tgop(e,tp,eg,ep,ev,re,r,rp)
local sg=g:Select(1-tp,1,1,nil)
Duel.HintSelection(sg)
local dg=Duel.GetMatchingGroup(cm.spfilter,tp,LOCATION_DECK,0,nil,e,tp)
if Duel.SendtoGrave(sg,REASON_RULE)~=0 then
if dg:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(m,3)) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sdg=dg:Select(tp,1,1,nil)
Duel.SpecialSummon(sdg,0,tp,tp,false,false,POS_FACEUP)
end
if Duel.SendtoGrave(sg,REASON_RULE) and dg:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(m,3)) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sdg=dg:Select(tp,1,1,nil)
Duel.SpecialSummon(sdg,0,tp,tp,false,false,POS_FACEUP)
end
end
end
......@@ -174,11 +172,11 @@ end
function cm.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetAttacker()==e:GetHandler() and Duel.IsExistingMatchingCard(cm.spcfilter,tp,LOCATION_MZONE,0,1,nil) and e:GetHandler():GetFlagEffect(m)>0
end
function cm.spfilter(c,e,tp)
return not c:IsLevel(8) and c:IsSetCard(0x171) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP)
function cm.sp2filter(c,e,tp)
return cm.JewelPaladin(c) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP)
end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_HAND+LOCATION_DECK,0,1,nil,e,tp) end
if chk==0 then return Duel.IsExistingMatchingCard(cm.sp2filter,tp,LOCATION_HAND+LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_DECK)
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
......@@ -186,7 +184,7 @@ function cm.spop(e,tp,eg,ep,ev,re,r,rp)
local cg=Duel.GetMatchingGroup(cm.spcfilter,tp,LOCATION_MZONE,0,nil)
--local ct=math.min(#cg,(Duel.GetLocationCount(tp,LOCATION_MZONE)))
if cg>1 and Duel.IsPlayerAffectedByEffect(tp,59822133) then cg=1 end
local g=Duel.GetMatchingGroup(cm.spfilter,tp,LOCATION_HAND+LOCATION_DECK,0,nil,e,tp)
local g=Duel.GetMatchingGroup(cm.sp2filter,tp,LOCATION_HAND+LOCATION_DECK,0,nil,e,tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=g:SelectSubGroup(tp,aux.dncheck,false,1,cg)
if sg then
......
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