Commit ea74190d authored by Nemo Ma's avatar Nemo Ma

fix

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