Commit c666e0a6 authored by POLYMER's avatar POLYMER

fix

parent 27fe8aa8
......@@ -81,7 +81,7 @@ function cm.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.RegisterEffect(e3,tp)
end
function cm.condition2(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(cm.filter3,1,nil,1-tp) and not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED)
return eg:IsExists(cm.filter3,1,nil,1-tp) and not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) and not eg:IsContains(e:GetHandler())
end
function cm.target2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.filter2,tp,LOCATION_DECK,0,1,nil) and Duel.IsExistingMatchingCard(cm.filter4,tp,LOCATION_DECK,0,1,nil) end
......
......@@ -95,7 +95,8 @@ function cm.check(e,tp,eg,ep,ev,re,r,rp)
end--]]
end
function cm.spcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(Card.IsPreviousLocation,1,nil,LOCATION_MZONE)
local c=e:GetHandler()
return eg:IsExists(Card.IsPreviousLocation,1,nil,LOCATION_MZONE) and (not eg:IsContains(c) or c:IsLocation(LOCATION_HAND))
end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
......
......@@ -111,6 +111,7 @@ function cm.xyzcon(e,tp,eg,ep,ev,re,r,rp)
return cm[0]==1 and cm[1]==2 and e:GetHandler():IsXyzSummonable(mg)
end
function cm.xyzop(e,tp,eg,ep,ev,re,r,rp)
if cm[0]==0 then return end
local c=e:GetHandler()
local te=e:GetLabelObject()
local mg=Duel.GetMatchingGroup(cm.filter3,tp,LOCATION_HAND+LOCATION_MZONE,0,nil)
......@@ -118,7 +119,8 @@ function cm.xyzop(e,tp,eg,ep,ev,re,r,rp)
if Duel.SelectYesNo(tp,aux.Stringid(m,2)) then
te:GetTarget()(te,tp,eg,ep,ev,re,r,rp,1,c,mg,2,2)
te:GetOperation()(te,tp,eg,ep,ev,re,r,rp,c,mg,2,2)
Duel.SpecialSummon(c,SUMMON_TYPE_XYZ,tp,tp,true,false,POS_FACEUP)
Duel.SpecialSummon(c,SUMMON_TYPE_XYZ,tp,tp,true,true,POS_FACEUP)
c:CompleteProcedure()
if mg:IsExists(Card.IsLocation,1,nil,LOCATION_OVERLAY) then Duel.ShuffleHand(tp) end
--Duel.XyzSummon(tp,e:GetHandler(),mg,2,2)
end
......@@ -224,8 +226,10 @@ function cm.leave2(e,tp,eg,ep,ev,re,r,rp)
if ft<=0 then return end
if Duel.IsPlayerAffectedByEffect(tp,59822133) then ft=1 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=tg:Select(tp,ft,ft,nil)
if #g>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
if #tg>ft then
tg=tg:Select(tp,ft,ft,nil)
end
if #tg>0 then
Duel.SpecialSummon(tg,0,tp,tp,false,false,POS_FACEUP)
end
end
\ No newline at end of file
......@@ -58,9 +58,9 @@ function s.cfilter(c)
return c:IsFaceup() and c:IsSetCard(0xa77) and c:IsType(TYPE_LINK)
end
function s.discon(e,tp,eg,ep,ev,re,r,rp)
local ct=Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)
local ct=Duel.GetMatchingGroupCount(Card.IsFaceup,tp,LOCATION_MZONE,0,nil)
if ct~=Duel.GetMatchingGroupCount(s.cfilter,tp,LOCATION_MZONE,0,nil) then return false end
return rp==1-tp and Duel.IsChainNegatable(ev) and re:IsActiveType(TYPE_MONSTER)
return rp==1-tp and Duel.IsChainNegatable(ev) and re:IsHasType(EFFECT_TYPE_ACTIVATE)
end
function s.distg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
......
......@@ -65,7 +65,7 @@ function s.cfilter(c)
return c:IsFaceup() and c:IsSetCard(0xa77) and c:IsType(TYPE_LINK)
end
function s.discon(e,tp,eg,ep,ev,re,r,rp)
local ct=Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)
local ct=Duel.GetMatchingGroupCount(Card.IsFaceup,tp,LOCATION_MZONE,0,nil)
if ct~=Duel.GetMatchingGroupCount(s.cfilter,tp,LOCATION_MZONE,0,nil) then return false end
return rp==1-tp and Duel.IsChainNegatable(ev) and re:IsHasType(EFFECT_TYPE_ACTIVATE)
end
......
local m=53796005
local cm=_G["c"..m]
cm.name="狐假虎威·回天"
cm.Snnm_Ef_Rst=true
if not require and dofile then function require(str) return dofile(str..".lua") end end
if not pcall(function() require("expansions/script/c53702500") end) then require("script/c53702500") end
function cm.initial_effect(c)
SNNM.AllEffectReset(c)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetType(EFFECT_TYPE_QUICK_O)
......@@ -22,5 +20,48 @@ function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SendtoGrave(e:GetHandler(),REASON_COST+REASON_DISCARD)
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetFlagEffect(0,m)>0 then return end
Duel.RegisterFlagEffect(0,m,RESET_PHASE+PHASE_END,0,1)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EFFECT_CANNOT_ACTIVATE)
e1:SetTargetRange(1,1)
e1:SetValue(cm.aclimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_ADJUST)
e1:SetOperation(cm.op)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function cm.aclimit(e,re,tp)
return re:GetCode()==1100 or re:GetCode()==1101 or re:GetCode()==1102
end
function cm.op(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(function(c)return c:GetFlagEffect(m)==0 end,0,0xff,0xff,nil)
if #g==0 then return end
local cp={}
local f=Card.RegisterEffect
Card.RegisterEffect=function(tc,te,bool)
if te:GetType()&0x9==0x9 and (te:GetCode()==1100 or te:GetCode()==1101 or te:GetCode()==1102) then table.insert(cp,te:Clone()) end
return f(tc,te,bool)
end
for tc in aux.Next(g) do
tc:RegisterFlagEffect(m,RESET_PHASE+PHASE_END,0,1)
Duel.CreateToken(tc:GetOwner(),tc:GetOriginalCode())
local op={}
for _,v in pairs(cp) do
if not SNNM.IsInTable(v:GetOperation(),op) then
v:SetCode(EVENT_LEAVE_FIELD)
v:SetReset(RESET_PHASE+PHASE_END)
f(tc,v,true)
table.insert(op,v:GetOperation())
end
end
cp={}
end
Card.RegisterEffect=f
end
......@@ -31,15 +31,12 @@ function cm.initial_effect(c)
Duel.SpecialSummon=function(tg,...)
tg=Group.__add(tg,tg)
local g=Duel.GetMatchingGroup(Card.IsHasEffect,0,LOCATION_EXTRA,LOCATION_EXTRA,nil,m)
local cg=tg:Filter(function(c)return c:GetFlagEffect(m)>0 and not c:IsType(TYPE_TOKEN)end,nil)
if #g>0 and #cg>0 then
if #g>0 and tg:IsExists(function(c)return c:GetFlagEffect(m)>0 and not c:IsType(TYPE_TOKEN)end,1,nil) then
local sg=g:RandomSelect(0,1)
Duel.ConfirmCards(0,sg)
Duel.ConfirmCards(1,sg)
tg:Sub(cg)
end
tg:ForEach(Card.ResetFlagEffect,m)
return cm[3](tg,...)
return 0
else return cm[3](tg,...) end
end
cm[4]=Duel.SpecialSummonStep
Duel.SpecialSummonStep=function(sc,...)
......@@ -49,10 +46,7 @@ function cm.initial_effect(c)
Duel.ConfirmCards(0,sg)
Duel.ConfirmCards(1,sg)
return false
else
sc:ResetFlagEffect(m)
return cm[4](sc,...)
end
else return cm[4](sc,...) end
end
cm[5]=Duel.SendtoDeck
Duel.SendtoDeck=function(tg,...)
......@@ -112,6 +106,7 @@ function cm.initial_effect(c)
cm[10]=Duel.Overlay
Duel.Overlay=function(sc,tg)
local g=Duel.GetMatchingGroup(Card.IsHasEffect,0,LOCATION_EXTRA,LOCATION_EXTRA,nil,m)
tg=Group.__add(tg,tg)
if #g>0 and tg:IsExists(function(c)return c:GetFlagEffect(m)>0 end,1,nil) then
local sg=g:RandomSelect(0,1)
Duel.ConfirmCards(0,sg)
......
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