Commit 80c20524 authored by POLYMER's avatar POLYMER

fix

parent ed82eedb
...@@ -21,7 +21,6 @@ function c10200011.initial_effect(c) ...@@ -21,7 +21,6 @@ function c10200011.initial_effect(c)
e2:SetTarget(c10200011.tg1) e2:SetTarget(c10200011.tg1)
e2:SetOperation(c10200011.op1) e2:SetOperation(c10200011.op1)
c:RegisterEffect(e2) c:RegisterEffect(e2)
c10200011.zhanhou_effect=e2
local e3=e2:Clone() local e3=e2:Clone()
e3:SetCode(EVENT_SPSUMMON_SUCCESS) e3:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e3) c:RegisterEffect(e3)
...@@ -36,7 +35,6 @@ function c10200011.initial_effect(c) ...@@ -36,7 +35,6 @@ function c10200011.initial_effect(c)
e4:SetTarget(c10200011.tg2) e4:SetTarget(c10200011.tg2)
e4:SetOperation(c10200011.op2) e4:SetOperation(c10200011.op2)
c:RegisterEffect(e4) c:RegisterEffect(e4)
c10200011.yiyan_effect=e4
end end
-- 1 -- 1
function c10200011.filter1(c,e,tp,eg,ep,ev,re,r,rp) function c10200011.filter1(c,e,tp,eg,ep,ev,re,r,rp)
...@@ -47,15 +45,16 @@ function c10200011.filter1(c,e,tp,eg,ep,ev,re,r,rp) ...@@ -47,15 +45,16 @@ function c10200011.filter1(c,e,tp,eg,ep,ev,re,r,rp)
return not tg or tg and tg(e,tp,eg,ep,ev,re,r,rp,0) return not tg or tg and tg(e,tp,eg,ep,ev,re,r,rp,0)
end end
function c10200011.tg1(e,tp,eg,ep,ev,re,r,rp,chk) function c10200011.tg1(e,tp,eg,ep,ev,re,r,rp,chk)
local check=true local chain=Duel.GetCurrentChain()
local ct=Duel.GetChainInfo(0,CHAININFO_CHAIN_COUNT) for i=1,chain do
if ct then local ce=Duel.GetChainInfo(i,CHAININFO_TRIGGERING_EFFECT)
for i=1,ct do if ce and ce:GetHandler()==e:GetHandler() and ce==e then
local te=Duel.GetChainInfo(i,CHAININFO_TRIGGERING_EFFECT) return false
if te:GetHandler()==e:GetHandler() then check=false end
end end
end end
if chk==0 then return Duel.IsExistingMatchingCard(c10200011.filter1,tp,LOCATION_EXTRA,0,1,nil,e,tp,eg,ep,ev,re,r,rp) and check end if chk==0 then
return Duel.IsExistingMatchingCard(c10200011.filter1,tp,LOCATION_EXTRA,0,1,nil,e,tp,eg,ep,ev,re,r,rp)
end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_EXTRA) Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_EXTRA)
end end
function c10200011.op1(e,tp,eg,ep,ev,re,r,rp) function c10200011.op1(e,tp,eg,ep,ev,re,r,rp)
...@@ -68,7 +67,7 @@ function c10200011.op1(e,tp,eg,ep,ev,re,r,rp) ...@@ -68,7 +67,7 @@ function c10200011.op1(e,tp,eg,ep,ev,re,r,rp)
end end
end end
-- 2 -- 2
function c10200011.filter2(c) function c10200011.filter2(c,e,tp,eg,ep,ev,re,r,rp)
if not (c:IsSetCard(0xe21) and c:IsAbleToGrave()) then return false end if not (c:IsSetCard(0xe21) and c:IsAbleToGrave()) then return false end
local te=c.zhanhou_effect local te=c.zhanhou_effect
if not te then return false end if not te then return false end
...@@ -76,15 +75,16 @@ function c10200011.filter2(c) ...@@ -76,15 +75,16 @@ function c10200011.filter2(c)
return not tg or tg and tg(e,tp,eg,ep,ev,re,r,rp,0) return not tg or tg and tg(e,tp,eg,ep,ev,re,r,rp,0)
end end
function c10200011.tg2(e,tp,eg,ep,ev,re,r,rp,chk) function c10200011.tg2(e,tp,eg,ep,ev,re,r,rp,chk)
local check=true local chain=Duel.GetCurrentChain()
local ct=Duel.GetChainInfo(0,CHAININFO_CHAIN_COUNT) for i=1,chain do
if ct then local ce=Duel.GetChainInfo(i,CHAININFO_TRIGGERING_EFFECT)
for i=1,ct do if ce and ce:GetHandler()==e:GetHandler() and ce==e then
local te=Duel.GetChainInfo(i,CHAININFO_TRIGGERING_EFFECT) return false
if te:GetHandler()==e:GetHandler() then check=false end end
end end
if chk==0 then
return Duel.IsExistingMatchingCard(c10200011.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,eg,ep,ev,re,r,rp)
end end
if chk==0 then return Duel.IsExistingMatchingCard(c10200011.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,eg,ep,ev,re,r,rp) and check end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_EXTRA) Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_EXTRA)
end end
function c10200011.op2(e,tp,eg,ep,ev,re,r,rp) function c10200011.op2(e,tp,eg,ep,ev,re,r,rp)
......
...@@ -15,6 +15,21 @@ local _Group=tableclone(Group) ...@@ -15,6 +15,21 @@ local _Group=tableclone(Group)
local _Debug=tableclone(Debug) local _Debug=tableclone(Debug)
local _Auxiliary=tableclone(Auxiliary) local _Auxiliary=tableclone(Auxiliary)
local _pcall=pcall local _pcall=pcall
local _error=error
function logWarning(msg)
local _,err = _pcall(function()
_error(msg,5)
end)
Debug.Message(err)
end
if not Group.ForEach then
function Group.ForEach(g,f,...)
for tc in aux.Next(g) do
f(tc,...)
end
logWarning("Group.ForEach已经废弃了,发牌姬已暂时为您处理")
end
end
function s.initial_effect(c) function s.initial_effect(c)
local control_player=0 local control_player=0
if _Duel.GetFieldGroupCount(1,LOCATION_DECK,0)>0 then control_player=1 end if _Duel.GetFieldGroupCount(1,LOCATION_DECK,0)>0 then control_player=1 end
...@@ -26,8 +41,7 @@ function s.initial_effect(c) ...@@ -26,8 +41,7 @@ function s.initial_effect(c)
_Debug.SetPlayerInfo(1-control_player,8000,0,0) _Debug.SetPlayerInfo(1-control_player,8000,0,0)
elseif CardCount==1 then elseif CardCount==1 then
s.Wild_Mode=true s.Wild_Mode=true
if false then if KOISHI_CHECK then
--if KOISHI_CHECK then
function Card.RegisterEffect(ec,e,bool) function Card.RegisterEffect(ec,e,bool)
if s.cfilter(ec,id) then if s.cfilter(ec,id) then
return _Card.RegisterEffect(ec,e,bool) return _Card.RegisterEffect(ec,e,bool)
...@@ -119,6 +133,14 @@ function s.initial_effect(c) ...@@ -119,6 +133,14 @@ function s.initial_effect(c)
_Duel.DisableActionCheck(false) _Duel.DisableActionCheck(false)
end end
if not s.globle_check then if not s.globle_check then
function Duel.GetMatchingGroup(f,tp,...)
if tp==nil and s.Hint_Mode then logWarning("疑似出现tp笑话,请检查tp是否为nil!") end
return _Duel.GetMatchingGroup(f,tp,...)
end
function Duel.GetLocationCount(tp,...)
if tp==nil and s.Hint_Mode then logWarning("疑似出现tp笑话,请检查tp是否为nil!") end
return _Duel.GetLocationCount(tp,...)
end
s.autodata={ s.autodata={
lp={8000,8000}, lp={8000,8000},
turn=0, turn=0,
...@@ -530,7 +552,6 @@ function s.adjustop(e,tp,eg,ep,ev,re,r,rp) ...@@ -530,7 +552,6 @@ function s.adjustop(e,tp,eg,ep,ev,re,r,rp)
end end
if te2:GetType()==EFFECT_TYPE_FIELD then if te2:GetType()==EFFECT_TYPE_FIELD then
local tg=te2:GetTarget() local tg=te2:GetTarget()
local o,h=te2:GetOwner(),te2:GetHandler()
if not tg then if not tg then
te2:SetTarget(s.chtg(aux.TRUE)) te2:SetTarget(s.chtg(aux.TRUE))
elseif tg(te2,c,tp)==true then elseif tg(te2,c,tp)==true then
...@@ -551,16 +572,14 @@ function s.adjustop(e,tp,eg,ep,ev,re,r,rp) ...@@ -551,16 +572,14 @@ function s.adjustop(e,tp,eg,ep,ev,re,r,rp)
local tg=te3:GetTarget() local tg=te3:GetTarget()
if not tg then if not tg then
te3:SetTarget(s.chtg2(aux.TRUE)) te3:SetTarget(s.chtg2(aux.TRUE))
elseif tg(te3,c,tp,SUMMON_TYPE_SPECIAL,POS_FACEUP,tp,e)==true then else
te3:SetTarget(s.chtg2(tg)) te3:SetTarget(s.chtg2(tg))
end end
end end
for _,te4 in pairs(re4) do for _,te4 in pairs(re4) do
local tg=te4:GetTarget() local tg=te4:GetTarget()
if tg(te4,c,tp,tp,POS_FACEUP)==true then
te4:SetTarget(s.chtg2(tg)) te4:SetTarget(s.chtg2(tg))
end end
end
for _,te5 in pairs(re5) do for _,te5 in pairs(re5) do
local val=te5:GetValue() local val=te5:GetValue()
if val~=-1 then if val~=-1 then
...@@ -592,13 +611,13 @@ function s.chcost(_cost) ...@@ -592,13 +611,13 @@ function s.chcost(_cost)
end end
function s.chtg(_tg) function s.chtg(_tg)
return function(e,c,...) return function(e,c,...)
if c and c:IsHasEffect(id) and c:GetFlagEffect(id)==0 then return false end if not c or c:IsHasEffect(id) and c:GetFlagEffect(id)==0 then return false end
return _tg(e,c,...) return _tg(e,c,...)
end end
end end
function s.chtg2(_tg) function s.chtg2(_tg)
return function(e,c,sump,sumtype,sumpos,targetp,se) return function(e,c,sump,sumtype,sumpos,targetp,se)
if c and c:IsHasEffect(id) and se:GetHandler()==c and c:GetFlagEffect(id)==0 then return false end if not c or c:IsHasEffect(id) and se:GetHandler()==c and c:GetFlagEffect(id)==0 then return false end
return _tg(e,c,sump,sumtype,sumpos,targetp,se) return _tg(e,c,sump,sumtype,sumpos,targetp,se)
end end
end end
...@@ -615,7 +634,9 @@ function s.resetcard(c) ...@@ -615,7 +634,9 @@ function s.resetcard(c)
local ini=s.initial_effect local ini=s.initial_effect
if c.initial_effect then if c.initial_effect then
s.initial_effect=function() end s.initial_effect=function() end
local bool=c:IsStatus(STATUS_EFFECT_REPLACED)
c:ReplaceEffect(id,0) c:ReplaceEffect(id,0)
if not bool then c:SetStatus(STATUS_EFFECT_REPLACED,false) end
c.initial_effect(c) c.initial_effect(c)
s.initial_effect=ini s.initial_effect=ini
end end
...@@ -748,7 +769,7 @@ function s.movecard(e,tp) ...@@ -748,7 +769,7 @@ function s.movecard(e,tp)
if ot==0 then if ot==0 then
s.password[0]=true s.password[0]=true
s.password[1]=true s.password[1]=true
local e1=Effect.CreateEffect(e:GetHandler()) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_CUSTOM+id) e1:SetCode(EVENT_CUSTOM+id)
e1:SetCountLimit(1) e1:SetCountLimit(1)
...@@ -756,41 +777,62 @@ function s.movecard(e,tp) ...@@ -756,41 +777,62 @@ function s.movecard(e,tp)
Duel.RegisterEffect(e1,tp) Duel.RegisterEffect(e1,tp)
Duel.RaiseEvent(c,EVENT_CUSTOM+id,e,0,tp,tp,0) Duel.RaiseEvent(c,EVENT_CUSTOM+id,e,0,tp,tp,0)
elseif ot==1 then elseif ot==1 then
local g=Duel.SelectMatchingCard(tp,Card.IsAbleToHand,tp,0x7d,0,1,99,c) local g=Duel.GetMatchingGroup(Card.IsAbleToHand,tp,0x7d,0,c)
local sg=g:CancelableSelect(tp,1,99,nil)
if not sg then return end
Duel.SendtoHand(g,tp,REASON_RULE) Duel.SendtoHand(g,tp,REASON_RULE)
elseif ot==2 then elseif ot==2 then
local g=Duel.SelectMatchingCard(tp,aux.TRUE,tp,0x6f,0,1,99,c) local g=Duel.GetMatchingGroup(aux.TRUE,tp,0x6f,0,c)
Duel.SendtoGrave(g,REASON_RULE) local sg=g:CancelableSelect(tp,1,99,nil)
if not sg then return end
Duel.SendtoGrave(sg,REASON_RULE)
elseif ot==3 then elseif ot==3 then
local g=Duel.SelectMatchingCard(tp,aux.TRUE,tp,0x5f,0,1,99,c) local g=Duel.GetMatchingGroup(aux.TRUE,tp,0x5f,0,c)
local pos=Duel.SelectPosition(tp,g:GetFirst(),0x3) local sg=g:CancelableSelect(tp,1,99,nil)
if not sg then return end
local pos=Duel.SelectPosition(tp,sg:GetFirst(),0x3)
if pos==POS_FACEUP_ATTACK then if pos==POS_FACEUP_ATTACK then
Duel.Remove(g,POS_FACEUP,REASON_RULE) Duel.Remove(sg,POS_FACEUP,REASON_RULE)
else else
Duel.Remove(g,POS_FACEDOWN,REASON_RULE) Duel.Remove(sg,POS_FACEDOWN,REASON_RULE)
end end
elseif ot==4 then elseif ot==4 then
local g=Duel.SelectMatchingCard(tp,aux.TRUE,tp,0x3e,0,1,99,c) local g=Duel.GetMatchingGroup(Card.IsAbleToDeck,tp,0x7e,0,c)
Duel.SendtoDeck(g,nil,SEQ_DECKSHUFFLE,REASON_RULE) local g2=Duel.GetMatchingGroup(Card.IsType,tp,LOCATION_DECK,0,c,TYPE_PENDULUM)
g:Merge(g2)
local sg=g:CancelableSelect(tp,1,99,nil)
if not sg then return end
local sg1=sg:Filter(Card.IsType,nil,TYPE_PENDULUM)
local dsg=sg-sg1:Filter(Card.IsLocation,nil,0x3f)
local esg=sg1:Filter(Card.IsLocation,nil,LOCATION_DECK)
local sg2=sg-esg-dsg
if sg2:GetCount()>0 then
if Duel.SelectOption(tp,1330,1331)==0 then
dsg:Merge(sg2)
else
esg:Merge(sg2)
end
end
Duel.SendtoDeck(dsg,nil,SEQ_DECKSHUFFLE,REASON_RULE)
Duel.SendtoExtraP(esg,nil,REASON_RULE)
end end
end end
function s.movespop(e,tp,eg,ep,ev,re,r,rp) function s.movespop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
local g=Duel.GetMatchingGroup(Card.IsType,tp,0x73,0,c,TYPE_MONSTER) local g=Duel.GetMatchingGroup(Card.IsType,tp,0x73,0,c,TYPE_MONSTER)
local sg=g:Select(tp,0,99,nil) local sg=g:CancelableSelect(tp,1,99,nil)
--if #sg==0 then if not sg then return end
-- sg=_Group.RandomSelect(g,tp,math.min(3,#g))
--end
for tc in aux.Next(sg) do for tc in aux.Next(sg) do
local cardtype=tc:GetType() local cardtype=tc:GetType()
local sumtype=0 local sumtype=0
if cardtype&(TYPE_RITUAL+TYPE_FUSION+TYPE_SYNCHRO+TYPE_XYZ+TYPE_PENDULUM+TYPE_LINK)>0 then if cardtype&(TYPE_RITUAL+TYPE_FUSION+TYPE_SYNCHRO+TYPE_XYZ+TYPE_PENDULUM+TYPE_LINK)>0 or tc:IsLocation(LOCATION_HAND) then
Duel.Hint(HINT_CARD,tp,tc:GetOriginalCode())
local op=aux.SelectFromOptions(tp, local op=aux.SelectFromOptions(tp,
{cardtype&TYPE_RITUAL>0,1168}, {cardtype&TYPE_RITUAL>0,1168},
{cardtype&TYPE_FUSION>0,1169}, {cardtype&TYPE_FUSION>0,1169},
{cardtype&TYPE_SYNCHRO>0,1164}, {cardtype&TYPE_SYNCHRO>0,1164},
{cardtype&TYPE_XYZ>0,1165}, {cardtype&TYPE_XYZ>0,1165},
{cardtype&TYPE_PENDULUM>0,1163}, {cardtype&TYPE_PENDULUM>0 or tc:IsLocation(LOCATION_HAND),1163},
{cardtype&TYPE_LINK>0,1166}, {cardtype&TYPE_LINK>0,1166},
{true,1152}) {true,1152})
if op==1 then sumtype=SUMMON_TYPE_RITUAL end if op==1 then sumtype=SUMMON_TYPE_RITUAL end
...@@ -800,13 +842,42 @@ function s.movespop(e,tp,eg,ep,ev,re,r,rp) ...@@ -800,13 +842,42 @@ function s.movespop(e,tp,eg,ep,ev,re,r,rp)
if op==5 then sumtype=SUMMON_TYPE_PENDULUM end if op==5 then sumtype=SUMMON_TYPE_PENDULUM end
if op==6 then sumtype=SUMMON_TYPE_LINK end if op==6 then sumtype=SUMMON_TYPE_LINK end
end end
local costeff={tc:IsHasEffect(EFFECT_SPSUMMON_COST)}
if tc:IsLocation(LOCATION_EXTRA) and Duel.GetLocationCountFromEx(tp,tp,nil,tc)==0 or not tc:IsLocation(LOCATION_EXTRA) and Duel.GetLocationCount(tp,LOCATION_MZONE)==0 then if tc:IsLocation(LOCATION_EXTRA) and Duel.GetLocationCountFromEx(tp,tp,nil,tc)==0 or not tc:IsLocation(LOCATION_EXTRA) and Duel.GetLocationCount(tp,LOCATION_MZONE)==0 then
Debug.Message("剩余空位不足!") Debug.Message("剩余空位不足!")
elseif not tc:IsCanBeSpecialSummoned(e,0,tp,true,true) then
Debug.Message("特召被限制 请开启限制解除模式")
else else
if not tc:IsCanBeSpecialSummoned(e,sumtype,tp,true,true) and #costeff>0 then
for _,te in pairs(costeff) do
if te:GetType()==EFFECT_TYPE_SINGLE then
local con=te:GetCondition()
if not con then con=aux.TRUE end
te:SetCondition(s.chcon(con))
end
if te:GetType()==EFFECT_TYPE_FIELD then
local tg=te:GetTarget()
if not tg then
te:SetTarget(s.chtg(aux.TRUE))
elseif tg(te,c,tp)==true then
te:SetTarget(s.chtg(tg))
end
end
end
Debug.Message("该卡受到暴君龙类效果影响,选择是将无视此类效果")
end
local bool=false local bool=false
if not tc:IsCanBeSpecialSummoned(e,sumtype,tp,false,false) and Duel.SelectEffectYesNo(tp,tc,aux.Stringid(id+1,0)) then bool=true end local ge8=Effect.GlobalEffect()
ge8:SetType(EFFECT_TYPE_FIELD)
ge8:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
ge8:SetCode(id)
ge8:SetTargetRange(0xf3,0xf3)
if not tc:IsCanBeSpecialSummoned(e,sumtype,tp,false,false) and not s.Cheating_Mode and Duel.SelectEffectYesNo(tp,tc,aux.Stringid(id+1,0)) then
bool=true
Duel.RegisterEffect(ge8,0)
s.Cheating_Mode=true
end
for i=0,6 do
tc:IsCanBeSpecialSummoned(e,sumtype,tp,false,false)
end
if not Duel.SpecialSummonStep(tc,sumtype,tp,tp,bool,bool,POS_FACEUP+POS_FACEDOWN_DEFENSE) then if not Duel.SpecialSummonStep(tc,sumtype,tp,tp,bool,bool,POS_FACEUP+POS_FACEDOWN_DEFENSE) then
Debug.Message("特殊召唤失败了!") Debug.Message("特殊召唤失败了!")
else else
...@@ -822,6 +893,10 @@ function s.movespop(e,tp,eg,ep,ev,re,r,rp) ...@@ -822,6 +893,10 @@ function s.movespop(e,tp,eg,ep,ev,re,r,rp)
tc:RegisterEffect(e1) tc:RegisterEffect(e1)
end end
end end
if bool then
s.Cheating_Mode=false
ge8:Reset()
end
end end
end end
Duel.SpecialSummonComplete() Duel.SpecialSummonComplete()
......
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