Commit bb4595e5 authored by Nemo Ma's avatar Nemo Ma

fix

parent 87add88b
...@@ -60,9 +60,7 @@ function cm.adjustop(e,tp,eg,ep,ev,re,r,rp) ...@@ -60,9 +60,7 @@ function cm.adjustop(e,tp,eg,ep,ev,re,r,rp)
local rg=Duel.GetMatchingGroup(cm.rfilter,tp,LOCATION_HAND,0,nil) local rg=Duel.GetMatchingGroup(cm.rfilter,tp,LOCATION_HAND,0,nil)
if #rg>0 and Duel.Remove(rg,POS_FACEDOWN,REASON_EFFECT)>0 then if #rg>0 and Duel.Remove(rg,POS_FACEDOWN,REASON_EFFECT)>0 then
local og=Duel.GetOperatedGroup():Filter(Card.IsLocation,nil,LOCATION_REMOVED) local og=Duel.GetOperatedGroup():Filter(Card.IsLocation,nil,LOCATION_REMOVED)
for tc in aux.Next(og) do og:ForEach(Card.RegisterFlagEffect,11451771,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(11451771,2))
og:ForEach(Card.RegisterFlagEffect,11451771,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(11451771,2))
end
og:KeepAlive() og:KeepAlive()
local e1=Effect.CreateEffect(e:GetHandler()) local e1=Effect.CreateEffect(e:GetHandler())
e1:SetDescription(aux.Stringid(11451771,3)) e1:SetDescription(aux.Stringid(11451771,3))
...@@ -191,7 +189,7 @@ function cm.filter6(c) ...@@ -191,7 +189,7 @@ function cm.filter6(c)
end end
function cm.retcon(e,tp,eg,ep,ev,re,r,rp) function cm.retcon(e,tp,eg,ep,ev,re,r,rp)
local g=e:GetLabelObject() local g=e:GetLabelObject()
if not g:IsExists(cm.filter6,1,nil) then if g and not g:IsExists(cm.filter6,1,nil) then
g:DeleteGroup() g:DeleteGroup()
e:Reset() e:Reset()
return false return false
......
...@@ -81,9 +81,7 @@ function cm.adjustop(e,tp,eg,ep,ev,re,r,rp) ...@@ -81,9 +81,7 @@ function cm.adjustop(e,tp,eg,ep,ev,re,r,rp)
local rg=Duel.GetMatchingGroup(cm.rfilter,tp,LOCATION_HAND,0,nil) local rg=Duel.GetMatchingGroup(cm.rfilter,tp,LOCATION_HAND,0,nil)
if #rg>0 and Duel.Remove(rg,POS_FACEDOWN,REASON_EFFECT)>0 then if #rg>0 and Duel.Remove(rg,POS_FACEDOWN,REASON_EFFECT)>0 then
local og=Duel.GetOperatedGroup():Filter(Card.IsLocation,nil,LOCATION_REMOVED) local og=Duel.GetOperatedGroup():Filter(Card.IsLocation,nil,LOCATION_REMOVED)
for tc in aux.Next(og) do og:ForEach(Card.RegisterFlagEffect,11451771,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(11451771,2))
og:ForEach(Card.RegisterFlagEffect,11451771,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(11451771,2))
end
og:KeepAlive() og:KeepAlive()
local e1=Effect.CreateEffect(e:GetHandler()) local e1=Effect.CreateEffect(e:GetHandler())
e1:SetDescription(aux.Stringid(11451771,3)) e1:SetDescription(aux.Stringid(11451771,3))
...@@ -189,7 +187,7 @@ function cm.filter6(c) ...@@ -189,7 +187,7 @@ function cm.filter6(c)
end end
function cm.retcon(e,tp,eg,ep,ev,re,r,rp) function cm.retcon(e,tp,eg,ep,ev,re,r,rp)
local g=e:GetLabelObject() local g=e:GetLabelObject()
if not g:IsExists(cm.filter6,1,nil) then if g and not g:IsExists(cm.filter6,1,nil) then
g:DeleteGroup() g:DeleteGroup()
e:Reset() e:Reset()
return false return false
......
...@@ -52,9 +52,7 @@ function cm.adjustop(e,tp,eg,ep,ev,re,r,rp) ...@@ -52,9 +52,7 @@ function cm.adjustop(e,tp,eg,ep,ev,re,r,rp)
local rg=Duel.GetMatchingGroup(cm.rfilter,tp,LOCATION_HAND,0,nil) local rg=Duel.GetMatchingGroup(cm.rfilter,tp,LOCATION_HAND,0,nil)
if #rg>0 and Duel.Remove(rg,POS_FACEDOWN,REASON_EFFECT)>0 then if #rg>0 and Duel.Remove(rg,POS_FACEDOWN,REASON_EFFECT)>0 then
local og=Duel.GetOperatedGroup():Filter(Card.IsLocation,nil,LOCATION_REMOVED) local og=Duel.GetOperatedGroup():Filter(Card.IsLocation,nil,LOCATION_REMOVED)
for tc in aux.Next(og) do og:ForEach(Card.RegisterFlagEffect,11451771,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(11451771,2))
og:ForEach(Card.RegisterFlagEffect,11451771,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(11451771,2))
end
og:KeepAlive() og:KeepAlive()
local e1=Effect.CreateEffect(e:GetHandler()) local e1=Effect.CreateEffect(e:GetHandler())
e1:SetDescription(aux.Stringid(11451771,3)) e1:SetDescription(aux.Stringid(11451771,3))
...@@ -179,7 +177,7 @@ function cm.filter6(c) ...@@ -179,7 +177,7 @@ function cm.filter6(c)
end end
function cm.retcon(e,tp,eg,ep,ev,re,r,rp) function cm.retcon(e,tp,eg,ep,ev,re,r,rp)
local g=e:GetLabelObject() local g=e:GetLabelObject()
if not g:IsExists(cm.filter6,1,nil) then if g and not g:IsExists(cm.filter6,1,nil) then
g:DeleteGroup() g:DeleteGroup()
e:Reset() e:Reset()
return false return false
......
...@@ -74,9 +74,7 @@ function cm.adjustop(e,tp,eg,ep,ev,re,r,rp) ...@@ -74,9 +74,7 @@ function cm.adjustop(e,tp,eg,ep,ev,re,r,rp)
local rg=Duel.GetMatchingGroup(cm.rfilter,tp,LOCATION_HAND,0,nil) local rg=Duel.GetMatchingGroup(cm.rfilter,tp,LOCATION_HAND,0,nil)
if #rg>0 and Duel.Remove(rg,POS_FACEDOWN,REASON_EFFECT)>0 then if #rg>0 and Duel.Remove(rg,POS_FACEDOWN,REASON_EFFECT)>0 then
local og=Duel.GetOperatedGroup():Filter(Card.IsLocation,nil,LOCATION_REMOVED) local og=Duel.GetOperatedGroup():Filter(Card.IsLocation,nil,LOCATION_REMOVED)
for tc in aux.Next(og) do og:ForEach(Card.RegisterFlagEffect,11451771,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(11451771,2))
og:ForEach(Card.RegisterFlagEffect,11451771,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(11451771,2))
end
og:KeepAlive() og:KeepAlive()
local e1=Effect.CreateEffect(e:GetHandler()) local e1=Effect.CreateEffect(e:GetHandler())
e1:SetDescription(aux.Stringid(11451771,3)) e1:SetDescription(aux.Stringid(11451771,3))
...@@ -253,7 +251,7 @@ function cm.filter6(c) ...@@ -253,7 +251,7 @@ function cm.filter6(c)
end end
function cm.retcon(e,tp,eg,ep,ev,re,r,rp) function cm.retcon(e,tp,eg,ep,ev,re,r,rp)
local g=e:GetLabelObject() local g=e:GetLabelObject()
if not g:IsExists(cm.filter6,1,nil) then if g and not g:IsExists(cm.filter6,1,nil) then
g:DeleteGroup() g:DeleteGroup()
e:Reset() e:Reset()
return false return false
......
...@@ -60,9 +60,7 @@ function cm.adjustop(e,tp,eg,ep,ev,re,r,rp) ...@@ -60,9 +60,7 @@ function cm.adjustop(e,tp,eg,ep,ev,re,r,rp)
local rg=Duel.GetMatchingGroup(cm.rfilter,tp,LOCATION_HAND,0,nil) local rg=Duel.GetMatchingGroup(cm.rfilter,tp,LOCATION_HAND,0,nil)
if #rg>0 and Duel.Remove(rg,POS_FACEDOWN,REASON_EFFECT)>0 then if #rg>0 and Duel.Remove(rg,POS_FACEDOWN,REASON_EFFECT)>0 then
local og=Duel.GetOperatedGroup():Filter(Card.IsLocation,nil,LOCATION_REMOVED) local og=Duel.GetOperatedGroup():Filter(Card.IsLocation,nil,LOCATION_REMOVED)
for tc in aux.Next(og) do og:ForEach(Card.RegisterFlagEffect,11451771,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(11451771,2))
og:ForEach(Card.RegisterFlagEffect,11451771,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(11451771,2))
end
og:KeepAlive() og:KeepAlive()
local e1=Effect.CreateEffect(e:GetHandler()) local e1=Effect.CreateEffect(e:GetHandler())
e1:SetDescription(aux.Stringid(11451771,3)) e1:SetDescription(aux.Stringid(11451771,3))
...@@ -183,7 +181,7 @@ function cm.filter6(c) ...@@ -183,7 +181,7 @@ function cm.filter6(c)
end end
function cm.retcon(e,tp,eg,ep,ev,re,r,rp) function cm.retcon(e,tp,eg,ep,ev,re,r,rp)
local g=e:GetLabelObject() local g=e:GetLabelObject()
if not g:IsExists(cm.filter6,1,nil) then if g and not g:IsExists(cm.filter6,1,nil) then
g:DeleteGroup() g:DeleteGroup()
e:Reset() e:Reset()
return false return false
......
...@@ -74,9 +74,7 @@ function cm.adjustop(e,tp,eg,ep,ev,re,r,rp) ...@@ -74,9 +74,7 @@ function cm.adjustop(e,tp,eg,ep,ev,re,r,rp)
local rg=Duel.GetMatchingGroup(cm.rfilter,tp,LOCATION_HAND,0,nil) local rg=Duel.GetMatchingGroup(cm.rfilter,tp,LOCATION_HAND,0,nil)
if #rg>0 and Duel.Remove(rg,POS_FACEDOWN,REASON_EFFECT)>0 then if #rg>0 and Duel.Remove(rg,POS_FACEDOWN,REASON_EFFECT)>0 then
local og=Duel.GetOperatedGroup():Filter(Card.IsLocation,nil,LOCATION_REMOVED) local og=Duel.GetOperatedGroup():Filter(Card.IsLocation,nil,LOCATION_REMOVED)
for tc in aux.Next(og) do og:ForEach(Card.RegisterFlagEffect,11451771,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(11451771,2))
og:ForEach(Card.RegisterFlagEffect,11451771,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(11451771,2))
end
og:KeepAlive() og:KeepAlive()
local e1=Effect.CreateEffect(e:GetHandler()) local e1=Effect.CreateEffect(e:GetHandler())
e1:SetDescription(aux.Stringid(11451771,3)) e1:SetDescription(aux.Stringid(11451771,3))
...@@ -229,7 +227,7 @@ function cm.retop(e,tp,eg,ep,ev,re,r,rp) ...@@ -229,7 +227,7 @@ function cm.retop(e,tp,eg,ep,ev,re,r,rp)
end end
function cm.retcon2(e,tp,eg,ep,ev,re,r,rp) function cm.retcon2(e,tp,eg,ep,ev,re,r,rp)
local g=e:GetLabelObject() local g=e:GetLabelObject()
if not g:IsExists(cm.filter7,1,nil) then if g and not g:IsExists(cm.filter7,1,nil) then
g:DeleteGroup() g:DeleteGroup()
e:Reset() e:Reset()
return false return false
......
...@@ -60,9 +60,7 @@ function cm.adjustop(e,tp,eg,ep,ev,re,r,rp) ...@@ -60,9 +60,7 @@ function cm.adjustop(e,tp,eg,ep,ev,re,r,rp)
local rg=Duel.GetMatchingGroup(cm.rfilter,tp,LOCATION_HAND,0,nil) local rg=Duel.GetMatchingGroup(cm.rfilter,tp,LOCATION_HAND,0,nil)
if #rg>0 and Duel.Remove(rg,POS_FACEDOWN,REASON_EFFECT)>0 then if #rg>0 and Duel.Remove(rg,POS_FACEDOWN,REASON_EFFECT)>0 then
local og=Duel.GetOperatedGroup():Filter(Card.IsLocation,nil,LOCATION_REMOVED) local og=Duel.GetOperatedGroup():Filter(Card.IsLocation,nil,LOCATION_REMOVED)
for tc in aux.Next(og) do og:ForEach(Card.RegisterFlagEffect,11451771,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(11451771,2))
og:ForEach(Card.RegisterFlagEffect,11451771,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(11451771,2))
end
og:KeepAlive() og:KeepAlive()
local e1=Effect.CreateEffect(e:GetHandler()) local e1=Effect.CreateEffect(e:GetHandler())
e1:SetDescription(aux.Stringid(11451771,3)) e1:SetDescription(aux.Stringid(11451771,3))
...@@ -162,7 +160,7 @@ function cm.filter6(c) ...@@ -162,7 +160,7 @@ function cm.filter6(c)
end end
function cm.retcon(e,tp,eg,ep,ev,re,r,rp) function cm.retcon(e,tp,eg,ep,ev,re,r,rp)
local g=e:GetLabelObject() local g=e:GetLabelObject()
if not g:IsExists(cm.filter6,1,nil) then if g and not g:IsExists(cm.filter6,1,nil) then
g:DeleteGroup() g:DeleteGroup()
e:Reset() e:Reset()
return false return false
......
...@@ -64,9 +64,7 @@ function cm.adjustop(e,tp,eg,ep,ev,re,r,rp) ...@@ -64,9 +64,7 @@ function cm.adjustop(e,tp,eg,ep,ev,re,r,rp)
local rg=Duel.GetMatchingGroup(cm.rfilter,tp,LOCATION_HAND,0,nil) local rg=Duel.GetMatchingGroup(cm.rfilter,tp,LOCATION_HAND,0,nil)
if #rg>0 and Duel.Remove(rg,POS_FACEDOWN,REASON_EFFECT)>0 then if #rg>0 and Duel.Remove(rg,POS_FACEDOWN,REASON_EFFECT)>0 then
local og=Duel.GetOperatedGroup():Filter(Card.IsLocation,nil,LOCATION_REMOVED) local og=Duel.GetOperatedGroup():Filter(Card.IsLocation,nil,LOCATION_REMOVED)
for tc in aux.Next(og) do og:ForEach(Card.RegisterFlagEffect,11451771,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(11451771,2))
og:ForEach(Card.RegisterFlagEffect,11451771,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(11451771,2))
end
og:KeepAlive() og:KeepAlive()
local e1=Effect.CreateEffect(e:GetHandler()) local e1=Effect.CreateEffect(e:GetHandler())
e1:SetDescription(aux.Stringid(11451771,3)) e1:SetDescription(aux.Stringid(11451771,3))
...@@ -170,7 +168,7 @@ function cm.filter6(c) ...@@ -170,7 +168,7 @@ function cm.filter6(c)
end end
function cm.retcon(e,tp,eg,ep,ev,re,r,rp) function cm.retcon(e,tp,eg,ep,ev,re,r,rp)
local g=e:GetLabelObject() local g=e:GetLabelObject()
if not g:IsExists(cm.filter6,1,nil) then if g and not g:IsExists(cm.filter6,1,nil) then
g:DeleteGroup() g:DeleteGroup()
e:Reset() e:Reset()
return false return false
......
...@@ -78,7 +78,7 @@ function cm.actarget2(e,te,tp) ...@@ -78,7 +78,7 @@ function cm.actarget2(e,te,tp)
return not cm[te] return not cm[te]
end end
function cm.costop2(e,tp,eg,ep,ev,re,r,rp) function cm.costop2(e,tp,eg,ep,ev,re,r,rp)
if cm[0] then return end if cm[0] or cm[te] then return end
local c=e:GetHandler() local c=e:GetHandler()
local te=e:GetLabelObject() local te=e:GetLabelObject()
local tg=te:GetTarget() or aux.TRUE local tg=te:GetTarget() or aux.TRUE
...@@ -86,13 +86,16 @@ function cm.costop2(e,tp,eg,ep,ev,re,r,rp) ...@@ -86,13 +86,16 @@ function cm.costop2(e,tp,eg,ep,ev,re,r,rp)
if chkc then return tg(e,tp,eg,ep,ev,re,r,rp,0,1) end if chkc then return tg(e,tp,eg,ep,ev,re,r,rp,0,1) end
if chk==0 then return tg(e,tp,eg,ep,ev,re,r,rp,0) end if chk==0 then return tg(e,tp,eg,ep,ev,re,r,rp,0) end
tg(e,tp,eg,ep,ev,re,r,rp,1) tg(e,tp,eg,ep,ev,re,r,rp,1)
local extg=Duel.GetMatchingGroup(Card.IsHasEffect,tp,LOCATION_HAND+LOCATION_SZONE,0,nil,m) local exc=nil
if e:IsHasType(EFFECT_TYPE_ACTIVATE) then exc=e:GetHandler() end
local extg=Duel.GetMatchingGroup(Card.IsHasEffect,tp,LOCATION_HAND+LOCATION_SZONE,0,exc,m)
if #extg>0 and Duel.SelectYesNo(tp,aux.Stringid(m,2)) then if #extg>0 and Duel.SelectYesNo(tp,aux.Stringid(m,2)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=extg:Select(tp,1,#extg,nil) local g=extg:Select(tp,1,#extg,nil)
if #g>0 and Duel.SendtoGrave(g,REASON_COST)>0 then if #g>0 and Duel.SendtoGrave(g,REASON_COST)>0 then
Duel.Hint(HINT_CARD,0,m) Duel.Hint(HINT_CARD,0,m)
g:ForEach(Card.RegisterFlagEffect,m,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(11451779,3)) g:ForEach(Card.RegisterFlagEffect,m,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(11451779,3))
if g:IsContains(e:GetHandler()) then e:GetHandler():CreateEffectRelation(e) end
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD) e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_INACTIVATE) e1:SetCode(EFFECT_CANNOT_INACTIVATE)
...@@ -138,8 +141,8 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -138,8 +141,8 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_DECK,0,1,nil,tp) end if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_DECK,0,1,nil,tp) end
end end
function cm.activate(e,tp,eg,ep,ev,re,r,rp) function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local g1=Duel.GetMatchingGroup(cm.filter1,tp,LOCATION_DECK,0,1,nil) local g1=Duel.GetMatchingGroup(cm.filter1,tp,LOCATION_DECK,0,nil)
local g2=Duel.GetMatchingGroup(cm.filter2,tp,LOCATION_DECK,0,1,nil,tp) local g2=Duel.GetMatchingGroup(cm.filter2,tp,LOCATION_DECK,0,nil,tp)
if not e:GetHandler():IsRelateToEffect(e) then return end if not e:GetHandler():IsRelateToEffect(e) then return end
local th=false local th=false
if #g1>0 and (#g2==0 or Duel.SelectOption(tp,aux.Stringid(11451779,0),aux.Stringid(11451779,1))==0) then if #g1>0 and (#g2==0 or Duel.SelectOption(tp,aux.Stringid(11451779,0),aux.Stringid(11451779,1))==0) then
......
...@@ -83,7 +83,7 @@ function cm.actarget2(e,te,tp) ...@@ -83,7 +83,7 @@ function cm.actarget2(e,te,tp)
return not cm[te] return not cm[te]
end end
function cm.costop2(e,tp,eg,ep,ev,re,r,rp) function cm.costop2(e,tp,eg,ep,ev,re,r,rp)
if cm[0] then return end if cm[0] or cm[te] then return end
local c=e:GetHandler() local c=e:GetHandler()
local te=e:GetLabelObject() local te=e:GetLabelObject()
local tg=te:GetTarget() or aux.TRUE local tg=te:GetTarget() or aux.TRUE
...@@ -91,13 +91,16 @@ function cm.costop2(e,tp,eg,ep,ev,re,r,rp) ...@@ -91,13 +91,16 @@ function cm.costop2(e,tp,eg,ep,ev,re,r,rp)
if chkc then return tg(e,tp,eg,ep,ev,re,r,rp,0,1) end if chkc then return tg(e,tp,eg,ep,ev,re,r,rp,0,1) end
if chk==0 then return tg(e,tp,eg,ep,ev,re,r,rp,0) end if chk==0 then return tg(e,tp,eg,ep,ev,re,r,rp,0) end
tg(e,tp,eg,ep,ev,re,r,rp,1) tg(e,tp,eg,ep,ev,re,r,rp,1)
local extg=Duel.GetMatchingGroup(Card.IsHasEffect,tp,LOCATION_HAND+LOCATION_SZONE,0,nil,m) local exc=nil
if e:IsHasType(EFFECT_TYPE_ACTIVATE) then exc=e:GetHandler() end
local extg=Duel.GetMatchingGroup(Card.IsHasEffect,tp,LOCATION_HAND+LOCATION_SZONE,0,exc,m)
if #extg>0 and Duel.SelectYesNo(tp,aux.Stringid(m,2)) then if #extg>0 and Duel.SelectYesNo(tp,aux.Stringid(m,2)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=extg:Select(tp,1,#extg,nil) local g=extg:Select(tp,1,#extg,nil)
if #g>0 and Duel.SendtoGrave(g,REASON_COST)>0 then if #g>0 and Duel.SendtoGrave(g,REASON_COST)>0 then
Duel.Hint(HINT_CARD,0,m) Duel.Hint(HINT_CARD,0,m)
g:ForEach(Card.RegisterFlagEffect,m,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(11451779,3)) g:ForEach(Card.RegisterFlagEffect,m,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(11451779,3))
if g:IsContains(e:GetHandler()) then e:GetHandler():CreateEffectRelation(e) end
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_CHAIN_END) e1:SetCode(EVENT_CHAIN_END)
...@@ -133,7 +136,7 @@ function cm.filter1(c) ...@@ -133,7 +136,7 @@ function cm.filter1(c)
return c:IsRace(RACE_WARRIOR) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand() return c:IsRace(RACE_WARRIOR) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
end end
function cm.filter2(c,tp) function cm.filter2(c,tp)
return c:IsCode(m+1) and c:GetActivateEffect():IsActivatable(tp) return c:IsCode(m+1) --and c:GetActivateEffect():IsActivatable(tp)
end end
function cm.condition(e,tp,eg,ep,ev,re,r,rp) function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.CheckEvent(EVENT_ATTACK_ANNOUNCE) and Duel.GetCurrentChain()==0 and e:GetHandler():GetFlagEffect(m)>0 return Duel.CheckEvent(EVENT_ATTACK_ANNOUNCE) and Duel.GetCurrentChain()==0 and e:GetHandler():GetFlagEffect(m)>0
...@@ -145,10 +148,9 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -145,10 +148,9 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_DECK,0,1,nil,tp) end if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_DECK,0,1,nil,tp) end
end end
function cm.activate(e,tp,eg,ep,ev,re,r,rp) function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local g1=Duel.GetMatchingGroup(cm.filter1,tp,LOCATION_DECK,0,1,nil) local g1=Duel.GetMatchingGroup(cm.filter1,tp,LOCATION_DECK,0,nil)
local g2=Duel.GetMatchingGroup(cm.filter2,tp,LOCATION_DECK,0,1,nil,tp) local g2=Duel.GetMatchingGroup(cm.filter2,tp,LOCATION_DECK,0,nil,tp)
if not e:GetHandler():IsRelateToEffect(e) then return end if not e:GetHandler():IsRelateToEffect(e) then return end
local th=false
if #g1>0 and (#g2==0 or Duel.SelectOption(tp,aux.Stringid(11451779,0),aux.Stringid(11451779,1))==0) then if #g1>0 and (#g2==0 or Duel.SelectOption(tp,aux.Stringid(11451779,0),aux.Stringid(11451779,1))==0) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,cm.filter1,tp,LOCATION_DECK,0,1,1,nil) local g=Duel.SelectMatchingCard(tp,cm.filter1,tp,LOCATION_DECK,0,1,1,nil)
......
...@@ -83,7 +83,7 @@ function cm.actarget2(e,te,tp) ...@@ -83,7 +83,7 @@ function cm.actarget2(e,te,tp)
return not cm[te] return not cm[te]
end end
function cm.costop2(e,tp,eg,ep,ev,re,r,rp) function cm.costop2(e,tp,eg,ep,ev,re,r,rp)
if cm[0] then return end if cm[0] or cm[te] then return end
local c=e:GetHandler() local c=e:GetHandler()
local te=e:GetLabelObject() local te=e:GetLabelObject()
local tg=te:GetTarget() or aux.TRUE local tg=te:GetTarget() or aux.TRUE
...@@ -91,13 +91,16 @@ function cm.costop2(e,tp,eg,ep,ev,re,r,rp) ...@@ -91,13 +91,16 @@ function cm.costop2(e,tp,eg,ep,ev,re,r,rp)
if chkc then return tg(e,tp,eg,ep,ev,re,r,rp,0,1) end if chkc then return tg(e,tp,eg,ep,ev,re,r,rp,0,1) end
if chk==0 then return tg(e,tp,eg,ep,ev,re,r,rp,0) end if chk==0 then return tg(e,tp,eg,ep,ev,re,r,rp,0) end
tg(e,tp,eg,ep,ev,re,r,rp,1) tg(e,tp,eg,ep,ev,re,r,rp,1)
local extg=Duel.GetMatchingGroup(Card.IsHasEffect,tp,LOCATION_HAND+LOCATION_SZONE,0,nil,m) local exc=nil
if e:IsHasType(EFFECT_TYPE_ACTIVATE) then exc=e:GetHandler() end
local extg=Duel.GetMatchingGroup(Card.IsHasEffect,tp,LOCATION_HAND+LOCATION_SZONE,0,exc,m)
if #extg>0 and Duel.SelectYesNo(tp,aux.Stringid(m,2)) then if #extg>0 and Duel.SelectYesNo(tp,aux.Stringid(m,2)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=extg:Select(tp,1,#extg,nil) local g=extg:Select(tp,1,#extg,nil)
if #g>0 and Duel.SendtoGrave(g,REASON_COST)>0 then if #g>0 and Duel.SendtoGrave(g,REASON_COST)>0 then
Duel.Hint(HINT_CARD,0,m) Duel.Hint(HINT_CARD,0,m)
g:ForEach(Card.RegisterFlagEffect,m,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(11451779,3)) g:ForEach(Card.RegisterFlagEffect,m,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(11451779,3))
if g:IsContains(e:GetHandler()) then e:GetHandler():CreateEffectRelation(e) end
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_CHAIN_SOLVING) e1:SetCode(EVENT_CHAIN_SOLVING)
...@@ -134,7 +137,7 @@ function cm.filter1(c) ...@@ -134,7 +137,7 @@ function cm.filter1(c)
return c:IsRace(RACE_WARRIOR) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand() return c:IsRace(RACE_WARRIOR) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
end end
function cm.filter2(c,tp) function cm.filter2(c,tp)
return c:IsCode(m+1) and c:GetActivateEffect():IsActivatable(tp) return c:IsCode(m+1) --and c:GetActivateEffect():IsActivatable(tp)
end end
function cm.condition(e,tp,eg,ep,ev,re,r,rp) function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.CheckEvent(EVENT_ATTACK_ANNOUNCE) and Duel.GetCurrentChain()==0 and e:GetHandler():GetFlagEffect(m)>0 return Duel.CheckEvent(EVENT_ATTACK_ANNOUNCE) and Duel.GetCurrentChain()==0 and e:GetHandler():GetFlagEffect(m)>0
...@@ -149,10 +152,9 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -149,10 +152,9 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_DECK,0,1,nil,tp) end if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_DECK,0,1,nil,tp) end
end end
function cm.activate(e,tp,eg,ep,ev,re,r,rp) function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local g1=Duel.GetMatchingGroup(cm.filter1,tp,LOCATION_DECK,0,1,nil) local g1=Duel.GetMatchingGroup(cm.filter1,tp,LOCATION_DECK,0,nil)
local g2=Duel.GetMatchingGroup(cm.filter2,tp,LOCATION_DECK,0,1,nil,tp) local g2=Duel.GetMatchingGroup(cm.filter2,tp,LOCATION_DECK,0,nil,tp)
if not e:GetHandler():IsRelateToEffect(e) then return end if not e:GetHandler():IsRelateToEffect(e) then return end
local th=false
if #g1>0 and (#g2==0 or Duel.SelectOption(tp,aux.Stringid(11451779,0),aux.Stringid(11451779,1))==0) then if #g1>0 and (#g2==0 or Duel.SelectOption(tp,aux.Stringid(11451779,0),aux.Stringid(11451779,1))==0) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,cm.filter1,tp,LOCATION_DECK,0,1,1,nil) local g=Duel.SelectMatchingCard(tp,cm.filter1,tp,LOCATION_DECK,0,1,1,nil)
......
...@@ -126,7 +126,7 @@ function cm.actarget2(e,te,tp) ...@@ -126,7 +126,7 @@ function cm.actarget2(e,te,tp)
return not cm[te] return not cm[te]
end end
function cm.costop2(e,tp,eg,ep,ev,re,r,rp) function cm.costop2(e,tp,eg,ep,ev,re,r,rp)
if cm[0] then return end if cm[0] or cm[te] then return end
local c=e:GetHandler() local c=e:GetHandler()
local te=e:GetLabelObject() local te=e:GetLabelObject()
local tg=te:GetTarget() or aux.TRUE local tg=te:GetTarget() or aux.TRUE
...@@ -134,13 +134,16 @@ function cm.costop2(e,tp,eg,ep,ev,re,r,rp) ...@@ -134,13 +134,16 @@ function cm.costop2(e,tp,eg,ep,ev,re,r,rp)
if chkc then return tg(e,tp,eg,ep,ev,re,r,rp,0,1) end if chkc then return tg(e,tp,eg,ep,ev,re,r,rp,0,1) end
if chk==0 then return tg(e,tp,eg,ep,ev,re,r,rp,0) end if chk==0 then return tg(e,tp,eg,ep,ev,re,r,rp,0) end
tg(e,tp,eg,ep,ev,re,r,rp,1) tg(e,tp,eg,ep,ev,re,r,rp,1)
local extg=Duel.GetMatchingGroup(Card.IsHasEffect,tp,LOCATION_HAND+LOCATION_SZONE,0,nil,m) local exc=nil
if e:IsHasType(EFFECT_TYPE_ACTIVATE) then exc=e:GetHandler() end
local extg=Duel.GetMatchingGroup(Card.IsHasEffect,tp,LOCATION_HAND+LOCATION_SZONE,0,exc,m)
if #extg>0 and Duel.SelectYesNo(tp,aux.Stringid(m,2)) then if #extg>0 and Duel.SelectYesNo(tp,aux.Stringid(m,2)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=extg:Select(tp,1,#extg,nil) local g=extg:Select(tp,1,#extg,nil)
if #g>0 and Duel.SendtoGrave(g,REASON_COST)>0 then if #g>0 and Duel.SendtoGrave(g,REASON_COST)>0 then
Duel.Hint(HINT_CARD,0,m) Duel.Hint(HINT_CARD,0,m)
g:ForEach(Card.RegisterFlagEffect,m,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(11451779,3)) g:ForEach(Card.RegisterFlagEffect,m,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(11451779,3))
if g:IsContains(e:GetHandler()) then e:GetHandler():CreateEffectRelation(e) end
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD) e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_IMMUNE_EFFECT) e2:SetCode(EFFECT_IMMUNE_EFFECT)
...@@ -194,7 +197,7 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -194,7 +197,7 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.filter1,tp,LOCATION_DECK,0,1,nil) or Duel.IsExistingMatchingCard(Card.IsAbleToHand,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(cm.filter1,tp,LOCATION_DECK,0,1,nil) or Duel.IsExistingMatchingCard(Card.IsAbleToHand,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end
end end
function cm.activate(e,tp,eg,ep,ev,re,r,rp) function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local g1=Duel.GetMatchingGroup(cm.filter1,tp,LOCATION_DECK,0,1,nil) local g1=Duel.GetMatchingGroup(cm.filter1,tp,LOCATION_DECK,0,nil)
local g2=Duel.GetMatchingGroup(Card.IsAbleToHand,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil) local g2=Duel.GetMatchingGroup(Card.IsAbleToHand,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
if not e:GetHandler():IsRelateToEffect(e) then return end if not e:GetHandler():IsRelateToEffect(e) then return end
if #g1>0 and (#g2==0 or Duel.SelectOption(tp,aux.Stringid(11451779,0),aux.Stringid(11451779,1))==0) then if #g1>0 and (#g2==0 or Duel.SelectOption(tp,aux.Stringid(11451779,0),aux.Stringid(11451779,1))==0) 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