Commit c3c0118f authored by POLYMER's avatar POLYMER

fix

parent 00b58a9c
...@@ -66,7 +66,8 @@ function cm.op(e,tp,eg,ep,ev,re,r,rp) ...@@ -66,7 +66,8 @@ function cm.op(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,0,m) Duel.Hint(HINT_CARD,0,m)
end end
end end
if not require and Duel.LoadScript then if not require and dofile then function require(str) return dofile(str..".lua") end end
--[[if not require and Duel.LoadScript then
function require(str) function require(str)
local name=str local name=str
for word in string.gmatch(str,"%w+") do for word in string.gmatch(str,"%w+") do
...@@ -75,4 +76,4 @@ if not require and Duel.LoadScript then ...@@ -75,4 +76,4 @@ if not require and Duel.LoadScript then
Duel.LoadScript(name..".lua") Duel.LoadScript(name..".lua")
return true return true
end end
end end--]]
\ No newline at end of file \ No newline at end of file
...@@ -33,19 +33,18 @@ function cm.initial_effect(c) ...@@ -33,19 +33,18 @@ function cm.initial_effect(c)
local e1=_Effect.CreateEffect(c) local e1=_Effect.CreateEffect(c)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
function read111(tab) function readtab(tab)
for k,v in pairs(tab) do for k,v in pairs(tab) do
Debug.Message(k) Debug.Message(k)
local sel=Duel.SelectOption(0,aux.Stringid(m,0),aux.Stringid(m,1),aux.Stringid(m,2)) local sel=Duel.SelectOption(0,aux.Stringid(m,0),aux.Stringid(m,1),aux.Stringid(m,2))
if sel==0 and aux.GetValueType(v)=="table" then if sel==0 and aux.GetValueType(v)=="table" then
read111(v) readtab(v)
end end
if sel==2 then return end if sel==2 then return end
end end
end end
function cm.op(e,tp,eg,ep,ev,re,r,rp) function cm.op(e,tp,eg,ep,ev,re,r,rp)
--readtab(package.loaded)
read111(package.loaded)
_Duel.Hint(HINT_CARD,0,m) _Duel.Hint(HINT_CARD,0,m)
_Duel.Hint(HINT_MUSIC,0,aux.Stringid(m,1)) _Duel.Hint(HINT_MUSIC,0,aux.Stringid(m,1))
local ct0=_Duel.GetMatchingGroupCount(_Card.IsCode,0,0xff,0,nil,m) local ct0=_Duel.GetMatchingGroupCount(_Card.IsCode,0,0xff,0,nil,m)
......
--他人格 ~怠惰~ --他人格 ~怠惰~
local cm,m=GetID() local cm,m=GetID()
if not pcall(function() require("expansions/script/c130006111") end) then require("script/c130006111") end --lib
AlterEgo=AlterEgo or {}
ae=AlterEgo
function ae.initial(c)
--pendulum summon
aux.EnablePendulumAttribute(c)
--atk&def
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EFFECT_SET_ATTACK)
e1:SetValue(ae.value)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_SET_DEFENSE)
c:RegisterEffect(e2)
--redirect
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_LEAVE_FIELD_REDIRECT)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e3:SetCondition(ae.recon)
e3:SetValue(LOCATION_DECKBOT)
c:RegisterEffect(e3)
--replace
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e4:SetCode(EVENT_DESTROYED)
e4:SetCondition(ae.repcon)
e4:SetOperation(ae.repop)
c:RegisterEffect(e4)
--spsummon
local e5=Effect.CreateEffect(c)
e5:SetCategory(CATEGORY_SPECIAL_SUMMON)
e5:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e5:SetCode(EVENT_DESTROYED)
e5:SetCountLimit(1,c:GetOriginalCode()+1000)
e5:SetProperty(EFFECT_FLAG_DELAY)
e5:SetTarget(ae.sptg)
e5:SetOperation(ae.spop)
c:RegisterEffect(e5)
--ptos
local e6=Effect.CreateEffect(c)
e6:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e6:SetCode(EVENT_FREE_CHAIN)
e6:SetRange(LOCATION_PZONE)
e6:SetCondition(ae.ptoscon)
e6:SetOperation(ae.ptosop)
c:RegisterEffect(e6)
end
function ae.value(e,c)
return Duel.GetMatchingGroupCount(ae.filter,c:GetControler(),LOCATION_ONFIELD,0,nil)*1000
end
function ae.filter(c)
local com=_G["c"..c:GetCode()]
return com and com.AlterEgo and c:IsFaceup()
end
function ae.cfilter(c)
local com=_G["c"..c:GetCode()]
return com and com.AlterEgo
end
function ae.recon(e)
return e:GetHandler():IsLocation(LOCATION_SZONE) and not e:GetHandler():IsLocation(LOCATION_PZONE)
end
function ae.repcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetPreviousLocation()==LOCATION_MZONE
end
function ae.repop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tp=c:GetPreviousControler()
local num=0
if Duel.CheckLocation(tp,LOCATION_PZONE,0) then num=num+1 end
if Duel.CheckLocation(tp,LOCATION_PZONE,1) then num=num+1 end
if (num==0 or not Duel.MoveToField(c,tp,tp,LOCATION_PZONE,POS_FACEUP,true)) and not (c:IsLocation(LOCATION_DECK) and c:IsControler(c:GetOwner())) then
Duel.SendtoDeck(c,nil,1,REASON_EFFECT)
end
end
function ae.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsLocation(LOCATION_EXTRA) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.GetLocationCountFromEx(tp,tp,nil,c)>0 end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
end
function ae.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
end
function ae.ptoscon(e,tp,eg,ep,ev,re,r,rp)
return (Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2) and Duel.GetCurrentChain()==0 and Duel.GetLocationCount(tp,LOCATION_SZONE)>0
end
function ae.ptosop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.MoveToField(c,tp,tp,LOCATION_SZONE,POS_FACEUP,true) then
local e1=Effect.CreateEffect(c)
e1:SetCode(EFFECT_CHANGE_TYPE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET)
e1:SetValue(TYPE_SPELL+TYPE_CONTINUOUS)
c:RegisterEffect(e1)
c:RegisterFlagEffect(c:GetOriginalCode(),RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(130006111,1))
end
end
--
cm.AlterEgo=true cm.AlterEgo=true
function cm.initial_effect(c) function cm.initial_effect(c)
ae.initial(c) ae.initial(c)
......
--他人格 ~贪食~ --他人格 ~贪食~
local cm,m=GetID() local cm,m=GetID()
if not pcall(function() require("expansions/script/c130006111") end) then require("script/c130006111") end --lib
AlterEgo=AlterEgo or {}
ae=AlterEgo
function ae.initial(c)
--pendulum summon
aux.EnablePendulumAttribute(c)
--atk&def
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EFFECT_SET_ATTACK)
e1:SetValue(ae.value)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_SET_DEFENSE)
c:RegisterEffect(e2)
--redirect
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_LEAVE_FIELD_REDIRECT)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e3:SetCondition(ae.recon)
e3:SetValue(LOCATION_DECKBOT)
c:RegisterEffect(e3)
--replace
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e4:SetCode(EVENT_DESTROYED)
e4:SetCondition(ae.repcon)
e4:SetOperation(ae.repop)
c:RegisterEffect(e4)
--spsummon
local e5=Effect.CreateEffect(c)
e5:SetCategory(CATEGORY_SPECIAL_SUMMON)
e5:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e5:SetCode(EVENT_DESTROYED)
e5:SetCountLimit(1,c:GetOriginalCode()+1000)
e5:SetProperty(EFFECT_FLAG_DELAY)
e5:SetTarget(ae.sptg)
e5:SetOperation(ae.spop)
c:RegisterEffect(e5)
--ptos
local e6=Effect.CreateEffect(c)
e6:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e6:SetCode(EVENT_FREE_CHAIN)
e6:SetRange(LOCATION_PZONE)
e6:SetCondition(ae.ptoscon)
e6:SetOperation(ae.ptosop)
c:RegisterEffect(e6)
end
function ae.value(e,c)
return Duel.GetMatchingGroupCount(ae.filter,c:GetControler(),LOCATION_ONFIELD,0,nil)*1000
end
function ae.filter(c)
local com=_G["c"..c:GetCode()]
return com and com.AlterEgo and c:IsFaceup()
end
function ae.cfilter(c)
local com=_G["c"..c:GetCode()]
return com and com.AlterEgo
end
function ae.recon(e)
return e:GetHandler():IsLocation(LOCATION_SZONE) and not e:GetHandler():IsLocation(LOCATION_PZONE)
end
function ae.repcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetPreviousLocation()==LOCATION_MZONE
end
function ae.repop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tp=c:GetPreviousControler()
local num=0
if Duel.CheckLocation(tp,LOCATION_PZONE,0) then num=num+1 end
if Duel.CheckLocation(tp,LOCATION_PZONE,1) then num=num+1 end
if (num==0 or not Duel.MoveToField(c,tp,tp,LOCATION_PZONE,POS_FACEUP,true)) and not (c:IsLocation(LOCATION_DECK) and c:IsControler(c:GetOwner())) then
Duel.SendtoDeck(c,nil,1,REASON_EFFECT)
end
end
function ae.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsLocation(LOCATION_EXTRA) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.GetLocationCountFromEx(tp,tp,nil,c)>0 end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
end
function ae.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
end
function ae.ptoscon(e,tp,eg,ep,ev,re,r,rp)
return (Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2) and Duel.GetCurrentChain()==0 and Duel.GetLocationCount(tp,LOCATION_SZONE)>0
end
function ae.ptosop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.MoveToField(c,tp,tp,LOCATION_SZONE,POS_FACEUP,true) then
local e1=Effect.CreateEffect(c)
e1:SetCode(EFFECT_CHANGE_TYPE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET)
e1:SetValue(TYPE_SPELL+TYPE_CONTINUOUS)
c:RegisterEffect(e1)
c:RegisterFlagEffect(c:GetOriginalCode(),RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(130006111,1))
end
end
--
cm.AlterEgo=true cm.AlterEgo=true
function cm.initial_effect(c) function cm.initial_effect(c)
ae.initial(c) ae.initial(c)
......
--他人格 ~色欲~ --他人格 ~色欲~
local cm,m=GetID() local cm,m=GetID()
if not pcall(function() require("expansions/script/c130006111") end) then require("script/c130006111") end --lib
AlterEgo=AlterEgo or {}
ae=AlterEgo
function ae.initial(c)
--pendulum summon
aux.EnablePendulumAttribute(c)
--atk&def
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EFFECT_SET_ATTACK)
e1:SetValue(ae.value)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_SET_DEFENSE)
c:RegisterEffect(e2)
--redirect
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_LEAVE_FIELD_REDIRECT)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e3:SetCondition(ae.recon)
e3:SetValue(LOCATION_DECKBOT)
c:RegisterEffect(e3)
--replace
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e4:SetCode(EVENT_DESTROYED)
e4:SetCondition(ae.repcon)
e4:SetOperation(ae.repop)
c:RegisterEffect(e4)
--spsummon
local e5=Effect.CreateEffect(c)
e5:SetCategory(CATEGORY_SPECIAL_SUMMON)
e5:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e5:SetCode(EVENT_DESTROYED)
e5:SetCountLimit(1,c:GetOriginalCode()+1000)
e5:SetProperty(EFFECT_FLAG_DELAY)
e5:SetTarget(ae.sptg)
e5:SetOperation(ae.spop)
c:RegisterEffect(e5)
--ptos
local e6=Effect.CreateEffect(c)
e6:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e6:SetCode(EVENT_FREE_CHAIN)
e6:SetRange(LOCATION_PZONE)
e6:SetCondition(ae.ptoscon)
e6:SetOperation(ae.ptosop)
c:RegisterEffect(e6)
end
function ae.value(e,c)
return Duel.GetMatchingGroupCount(ae.filter,c:GetControler(),LOCATION_ONFIELD,0,nil)*1000
end
function ae.filter(c)
local com=_G["c"..c:GetCode()]
return com and com.AlterEgo and c:IsFaceup()
end
function ae.cfilter(c)
local com=_G["c"..c:GetCode()]
return com and com.AlterEgo
end
function ae.recon(e)
return e:GetHandler():IsLocation(LOCATION_SZONE) and not e:GetHandler():IsLocation(LOCATION_PZONE)
end
function ae.repcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetPreviousLocation()==LOCATION_MZONE
end
function ae.repop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tp=c:GetPreviousControler()
local num=0
if Duel.CheckLocation(tp,LOCATION_PZONE,0) then num=num+1 end
if Duel.CheckLocation(tp,LOCATION_PZONE,1) then num=num+1 end
if (num==0 or not Duel.MoveToField(c,tp,tp,LOCATION_PZONE,POS_FACEUP,true)) and not (c:IsLocation(LOCATION_DECK) and c:IsControler(c:GetOwner())) then
Duel.SendtoDeck(c,nil,1,REASON_EFFECT)
end
end
function ae.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsLocation(LOCATION_EXTRA) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.GetLocationCountFromEx(tp,tp,nil,c)>0 end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
end
function ae.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
end
function ae.ptoscon(e,tp,eg,ep,ev,re,r,rp)
return (Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2) and Duel.GetCurrentChain()==0 and Duel.GetLocationCount(tp,LOCATION_SZONE)>0
end
function ae.ptosop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.MoveToField(c,tp,tp,LOCATION_SZONE,POS_FACEUP,true) then
local e1=Effect.CreateEffect(c)
e1:SetCode(EFFECT_CHANGE_TYPE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET)
e1:SetValue(TYPE_SPELL+TYPE_CONTINUOUS)
c:RegisterEffect(e1)
c:RegisterFlagEffect(c:GetOriginalCode(),RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(130006111,1))
end
end
--
cm.AlterEgo=true cm.AlterEgo=true
function cm.initial_effect(c) function cm.initial_effect(c)
ae.initial(c) ae.initial(c)
......
--他人格 ~愤怒~ --他人格 ~愤怒~
local cm,m=GetID() local cm,m=GetID()
if not pcall(function() require("expansions/script/c130006111") end) then require("script/c130006111") end --lib
AlterEgo=AlterEgo or {}
ae=AlterEgo
function ae.initial(c)
--pendulum summon
aux.EnablePendulumAttribute(c)
--atk&def
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EFFECT_SET_ATTACK)
e1:SetValue(ae.value)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_SET_DEFENSE)
c:RegisterEffect(e2)
--redirect
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_LEAVE_FIELD_REDIRECT)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e3:SetCondition(ae.recon)
e3:SetValue(LOCATION_DECKBOT)
c:RegisterEffect(e3)
--replace
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e4:SetCode(EVENT_DESTROYED)
e4:SetCondition(ae.repcon)
e4:SetOperation(ae.repop)
c:RegisterEffect(e4)
--spsummon
local e5=Effect.CreateEffect(c)
e5:SetCategory(CATEGORY_SPECIAL_SUMMON)
e5:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e5:SetCode(EVENT_DESTROYED)
e5:SetCountLimit(1,c:GetOriginalCode()+1000)
e5:SetProperty(EFFECT_FLAG_DELAY)
e5:SetTarget(ae.sptg)
e5:SetOperation(ae.spop)
c:RegisterEffect(e5)
--ptos
local e6=Effect.CreateEffect(c)
e6:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e6:SetCode(EVENT_FREE_CHAIN)
e6:SetRange(LOCATION_PZONE)
e6:SetCondition(ae.ptoscon)
e6:SetOperation(ae.ptosop)
c:RegisterEffect(e6)
end
function ae.value(e,c)
return Duel.GetMatchingGroupCount(ae.filter,c:GetControler(),LOCATION_ONFIELD,0,nil)*1000
end
function ae.filter(c)
local com=_G["c"..c:GetCode()]
return com and com.AlterEgo and c:IsFaceup()
end
function ae.cfilter(c)
local com=_G["c"..c:GetCode()]
return com and com.AlterEgo
end
function ae.recon(e)
return e:GetHandler():IsLocation(LOCATION_SZONE) and not e:GetHandler():IsLocation(LOCATION_PZONE)
end
function ae.repcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetPreviousLocation()==LOCATION_MZONE
end
function ae.repop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tp=c:GetPreviousControler()
local num=0
if Duel.CheckLocation(tp,LOCATION_PZONE,0) then num=num+1 end
if Duel.CheckLocation(tp,LOCATION_PZONE,1) then num=num+1 end
if (num==0 or not Duel.MoveToField(c,tp,tp,LOCATION_PZONE,POS_FACEUP,true)) and not (c:IsLocation(LOCATION_DECK) and c:IsControler(c:GetOwner())) then
Duel.SendtoDeck(c,nil,1,REASON_EFFECT)
end
end
function ae.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsLocation(LOCATION_EXTRA) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.GetLocationCountFromEx(tp,tp,nil,c)>0 end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
end
function ae.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
end
function ae.ptoscon(e,tp,eg,ep,ev,re,r,rp)
return (Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2) and Duel.GetCurrentChain()==0 and Duel.GetLocationCount(tp,LOCATION_SZONE)>0
end
function ae.ptosop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.MoveToField(c,tp,tp,LOCATION_SZONE,POS_FACEUP,true) then
local e1=Effect.CreateEffect(c)
e1:SetCode(EFFECT_CHANGE_TYPE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET)
e1:SetValue(TYPE_SPELL+TYPE_CONTINUOUS)
c:RegisterEffect(e1)
c:RegisterFlagEffect(c:GetOriginalCode(),RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(130006111,1))
end
end
--
cm.AlterEgo=true cm.AlterEgo=true
function cm.initial_effect(c) function cm.initial_effect(c)
ae.initial(c) ae.initial(c)
......
--他人格 ~嫉妒~ --他人格 ~嫉妒~
local cm,m=GetID() local cm,m=GetID()
if not pcall(function() require("expansions/script/c130006111") end) then require("script/c130006111") end --lib
AlterEgo=AlterEgo or {}
ae=AlterEgo
function ae.initial(c)
--pendulum summon
aux.EnablePendulumAttribute(c)
--atk&def
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EFFECT_SET_ATTACK)
e1:SetValue(ae.value)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_SET_DEFENSE)
c:RegisterEffect(e2)
--redirect
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_LEAVE_FIELD_REDIRECT)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e3:SetCondition(ae.recon)
e3:SetValue(LOCATION_DECKBOT)
c:RegisterEffect(e3)
--replace
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e4:SetCode(EVENT_DESTROYED)
e4:SetCondition(ae.repcon)
e4:SetOperation(ae.repop)
c:RegisterEffect(e4)
--spsummon
local e5=Effect.CreateEffect(c)
e5:SetCategory(CATEGORY_SPECIAL_SUMMON)
e5:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e5:SetCode(EVENT_DESTROYED)
e5:SetCountLimit(1,c:GetOriginalCode()+1000)
e5:SetProperty(EFFECT_FLAG_DELAY)
e5:SetTarget(ae.sptg)
e5:SetOperation(ae.spop)
c:RegisterEffect(e5)
--ptos
local e6=Effect.CreateEffect(c)
e6:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e6:SetCode(EVENT_FREE_CHAIN)
e6:SetRange(LOCATION_PZONE)
e6:SetCondition(ae.ptoscon)
e6:SetOperation(ae.ptosop)
c:RegisterEffect(e6)
end
function ae.value(e,c)
return Duel.GetMatchingGroupCount(ae.filter,c:GetControler(),LOCATION_ONFIELD,0,nil)*1000
end
function ae.filter(c)
local com=_G["c"..c:GetCode()]
return com and com.AlterEgo and c:IsFaceup()
end
function ae.cfilter(c)
local com=_G["c"..c:GetCode()]
return com and com.AlterEgo
end
function ae.recon(e)
return e:GetHandler():IsLocation(LOCATION_SZONE) and not e:GetHandler():IsLocation(LOCATION_PZONE)
end
function ae.repcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetPreviousLocation()==LOCATION_MZONE
end
function ae.repop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tp=c:GetPreviousControler()
local num=0
if Duel.CheckLocation(tp,LOCATION_PZONE,0) then num=num+1 end
if Duel.CheckLocation(tp,LOCATION_PZONE,1) then num=num+1 end
if (num==0 or not Duel.MoveToField(c,tp,tp,LOCATION_PZONE,POS_FACEUP,true)) and not (c:IsLocation(LOCATION_DECK) and c:IsControler(c:GetOwner())) then
Duel.SendtoDeck(c,nil,1,REASON_EFFECT)
end
end
function ae.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsLocation(LOCATION_EXTRA) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.GetLocationCountFromEx(tp,tp,nil,c)>0 end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
end
function ae.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
end
function ae.ptoscon(e,tp,eg,ep,ev,re,r,rp)
return (Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2) and Duel.GetCurrentChain()==0 and Duel.GetLocationCount(tp,LOCATION_SZONE)>0
end
function ae.ptosop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.MoveToField(c,tp,tp,LOCATION_SZONE,POS_FACEUP,true) then
local e1=Effect.CreateEffect(c)
e1:SetCode(EFFECT_CHANGE_TYPE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET)
e1:SetValue(TYPE_SPELL+TYPE_CONTINUOUS)
c:RegisterEffect(e1)
c:RegisterFlagEffect(c:GetOriginalCode(),RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(130006111,1))
end
end
--
cm.AlterEgo=true cm.AlterEgo=true
function cm.initial_effect(c) function cm.initial_effect(c)
ae.initial(c) ae.initial(c)
......
--他人格 ~物欲~ --他人格 ~物欲~
local cm,m=GetID() local cm,m=GetID()
if not pcall(function() require("expansions/script/c130006111") end) then require("script/c130006111") end --lib
AlterEgo=AlterEgo or {}
ae=AlterEgo
function ae.initial(c)
--pendulum summon
aux.EnablePendulumAttribute(c)
--atk&def
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EFFECT_SET_ATTACK)
e1:SetValue(ae.value)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_SET_DEFENSE)
c:RegisterEffect(e2)
--redirect
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_LEAVE_FIELD_REDIRECT)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e3:SetCondition(ae.recon)
e3:SetValue(LOCATION_DECKBOT)
c:RegisterEffect(e3)
--replace
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e4:SetCode(EVENT_DESTROYED)
e4:SetCondition(ae.repcon)
e4:SetOperation(ae.repop)
c:RegisterEffect(e4)
--spsummon
local e5=Effect.CreateEffect(c)
e5:SetCategory(CATEGORY_SPECIAL_SUMMON)
e5:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e5:SetCode(EVENT_DESTROYED)
e5:SetCountLimit(1,c:GetOriginalCode()+1000)
e5:SetProperty(EFFECT_FLAG_DELAY)
e5:SetTarget(ae.sptg)
e5:SetOperation(ae.spop)
c:RegisterEffect(e5)
--ptos
local e6=Effect.CreateEffect(c)
e6:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e6:SetCode(EVENT_FREE_CHAIN)
e6:SetRange(LOCATION_PZONE)
e6:SetCondition(ae.ptoscon)
e6:SetOperation(ae.ptosop)
c:RegisterEffect(e6)
end
function ae.value(e,c)
return Duel.GetMatchingGroupCount(ae.filter,c:GetControler(),LOCATION_ONFIELD,0,nil)*1000
end
function ae.filter(c)
local com=_G["c"..c:GetCode()]
return com and com.AlterEgo and c:IsFaceup()
end
function ae.cfilter(c)
local com=_G["c"..c:GetCode()]
return com and com.AlterEgo
end
function ae.recon(e)
return e:GetHandler():IsLocation(LOCATION_SZONE) and not e:GetHandler():IsLocation(LOCATION_PZONE)
end
function ae.repcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetPreviousLocation()==LOCATION_MZONE
end
function ae.repop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tp=c:GetPreviousControler()
local num=0
if Duel.CheckLocation(tp,LOCATION_PZONE,0) then num=num+1 end
if Duel.CheckLocation(tp,LOCATION_PZONE,1) then num=num+1 end
if (num==0 or not Duel.MoveToField(c,tp,tp,LOCATION_PZONE,POS_FACEUP,true)) and not (c:IsLocation(LOCATION_DECK) and c:IsControler(c:GetOwner())) then
Duel.SendtoDeck(c,nil,1,REASON_EFFECT)
end
end
function ae.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsLocation(LOCATION_EXTRA) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.GetLocationCountFromEx(tp,tp,nil,c)>0 end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
end
function ae.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
end
function ae.ptoscon(e,tp,eg,ep,ev,re,r,rp)
return (Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2) and Duel.GetCurrentChain()==0 and Duel.GetLocationCount(tp,LOCATION_SZONE)>0
end
function ae.ptosop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.MoveToField(c,tp,tp,LOCATION_SZONE,POS_FACEUP,true) then
local e1=Effect.CreateEffect(c)
e1:SetCode(EFFECT_CHANGE_TYPE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET)
e1:SetValue(TYPE_SPELL+TYPE_CONTINUOUS)
c:RegisterEffect(e1)
c:RegisterFlagEffect(c:GetOriginalCode(),RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(130006111,1))
end
end
--
cm.AlterEgo=true cm.AlterEgo=true
function cm.initial_effect(c) function cm.initial_effect(c)
ae.initial(c) ae.initial(c)
......
--他人格 ~高慢~ --他人格 ~高慢~
local cm,m=GetID() local cm,m=GetID()
if not pcall(function() require("expansions/script/c130006111") end) then require("script/c130006111") end --lib
AlterEgo=AlterEgo or {}
ae=AlterEgo
function ae.initial(c)
--pendulum summon
aux.EnablePendulumAttribute(c)
--atk&def
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EFFECT_SET_ATTACK)
e1:SetValue(ae.value)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_SET_DEFENSE)
c:RegisterEffect(e2)
--redirect
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_LEAVE_FIELD_REDIRECT)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e3:SetCondition(ae.recon)
e3:SetValue(LOCATION_DECKBOT)
c:RegisterEffect(e3)
--replace
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e4:SetCode(EVENT_DESTROYED)
e4:SetCondition(ae.repcon)
e4:SetOperation(ae.repop)
c:RegisterEffect(e4)
--spsummon
local e5=Effect.CreateEffect(c)
e5:SetCategory(CATEGORY_SPECIAL_SUMMON)
e5:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e5:SetCode(EVENT_DESTROYED)
e5:SetCountLimit(1,c:GetOriginalCode()+1000)
e5:SetProperty(EFFECT_FLAG_DELAY)
e5:SetTarget(ae.sptg)
e5:SetOperation(ae.spop)
c:RegisterEffect(e5)
--ptos
local e6=Effect.CreateEffect(c)
e6:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e6:SetCode(EVENT_FREE_CHAIN)
e6:SetRange(LOCATION_PZONE)
e6:SetCondition(ae.ptoscon)
e6:SetOperation(ae.ptosop)
c:RegisterEffect(e6)
end
function ae.value(e,c)
return Duel.GetMatchingGroupCount(ae.filter,c:GetControler(),LOCATION_ONFIELD,0,nil)*1000
end
function ae.filter(c)
local com=_G["c"..c:GetCode()]
return com and com.AlterEgo and c:IsFaceup()
end
function ae.cfilter(c)
local com=_G["c"..c:GetCode()]
return com and com.AlterEgo
end
function ae.recon(e)
return e:GetHandler():IsLocation(LOCATION_SZONE) and not e:GetHandler():IsLocation(LOCATION_PZONE)
end
function ae.repcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetPreviousLocation()==LOCATION_MZONE
end
function ae.repop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tp=c:GetPreviousControler()
local num=0
if Duel.CheckLocation(tp,LOCATION_PZONE,0) then num=num+1 end
if Duel.CheckLocation(tp,LOCATION_PZONE,1) then num=num+1 end
if (num==0 or not Duel.MoveToField(c,tp,tp,LOCATION_PZONE,POS_FACEUP,true)) and not (c:IsLocation(LOCATION_DECK) and c:IsControler(c:GetOwner())) then
Duel.SendtoDeck(c,nil,1,REASON_EFFECT)
end
end
function ae.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsLocation(LOCATION_EXTRA) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.GetLocationCountFromEx(tp,tp,nil,c)>0 end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
end
function ae.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
end
function ae.ptoscon(e,tp,eg,ep,ev,re,r,rp)
return (Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2) and Duel.GetCurrentChain()==0 and Duel.GetLocationCount(tp,LOCATION_SZONE)>0
end
function ae.ptosop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.MoveToField(c,tp,tp,LOCATION_SZONE,POS_FACEUP,true) then
local e1=Effect.CreateEffect(c)
e1:SetCode(EFFECT_CHANGE_TYPE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET)
e1:SetValue(TYPE_SPELL+TYPE_CONTINUOUS)
c:RegisterEffect(e1)
c:RegisterFlagEffect(c:GetOriginalCode(),RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(130006111,1))
end
end
--
cm.AlterEgo=true cm.AlterEgo=true
function cm.initial_effect(c) function cm.initial_effect(c)
ae.initial(c) ae.initial(c)
......
--罪恶的根源 --罪恶的根源
local cm,m=GetID() local cm,m=GetID()
if not pcall(function() require("expansions/script/c130006111") end) then require("script/c130006111") end --lib
AlterEgo=AlterEgo or {}
ae=AlterEgo
function ae.initial(c)
--pendulum summon
aux.EnablePendulumAttribute(c)
--atk&def
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EFFECT_SET_ATTACK)
e1:SetValue(ae.value)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_SET_DEFENSE)
c:RegisterEffect(e2)
--redirect
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_LEAVE_FIELD_REDIRECT)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e3:SetCondition(ae.recon)
e3:SetValue(LOCATION_DECKBOT)
c:RegisterEffect(e3)
--replace
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e4:SetCode(EVENT_DESTROYED)
e4:SetCondition(ae.repcon)
e4:SetOperation(ae.repop)
c:RegisterEffect(e4)
--spsummon
local e5=Effect.CreateEffect(c)
e5:SetCategory(CATEGORY_SPECIAL_SUMMON)
e5:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e5:SetCode(EVENT_DESTROYED)
e5:SetCountLimit(1,c:GetOriginalCode()+1000)
e5:SetProperty(EFFECT_FLAG_DELAY)
e5:SetTarget(ae.sptg)
e5:SetOperation(ae.spop)
c:RegisterEffect(e5)
--ptos
local e6=Effect.CreateEffect(c)
e6:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e6:SetCode(EVENT_FREE_CHAIN)
e6:SetRange(LOCATION_PZONE)
e6:SetCondition(ae.ptoscon)
e6:SetOperation(ae.ptosop)
c:RegisterEffect(e6)
end
function ae.value(e,c)
return Duel.GetMatchingGroupCount(ae.filter,c:GetControler(),LOCATION_ONFIELD,0,nil)*1000
end
function ae.filter(c)
local com=_G["c"..c:GetCode()]
return com and com.AlterEgo and c:IsFaceup()
end
function ae.cfilter(c)
local com=_G["c"..c:GetCode()]
return com and com.AlterEgo
end
function ae.recon(e)
return e:GetHandler():IsLocation(LOCATION_SZONE) and not e:GetHandler():IsLocation(LOCATION_PZONE)
end
function ae.repcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetPreviousLocation()==LOCATION_MZONE
end
function ae.repop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tp=c:GetPreviousControler()
local num=0
if Duel.CheckLocation(tp,LOCATION_PZONE,0) then num=num+1 end
if Duel.CheckLocation(tp,LOCATION_PZONE,1) then num=num+1 end
if (num==0 or not Duel.MoveToField(c,tp,tp,LOCATION_PZONE,POS_FACEUP,true)) and not (c:IsLocation(LOCATION_DECK) and c:IsControler(c:GetOwner())) then
Duel.SendtoDeck(c,nil,1,REASON_EFFECT)
end
end
function ae.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsLocation(LOCATION_EXTRA) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.GetLocationCountFromEx(tp,tp,nil,c)>0 end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
end
function ae.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
end
function ae.ptoscon(e,tp,eg,ep,ev,re,r,rp)
return (Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2) and Duel.GetCurrentChain()==0 and Duel.GetLocationCount(tp,LOCATION_SZONE)>0
end
function ae.ptosop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.MoveToField(c,tp,tp,LOCATION_SZONE,POS_FACEUP,true) then
local e1=Effect.CreateEffect(c)
e1:SetCode(EFFECT_CHANGE_TYPE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET)
e1:SetValue(TYPE_SPELL+TYPE_CONTINUOUS)
c:RegisterEffect(e1)
c:RegisterFlagEffect(c:GetOriginalCode(),RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(130006111,1))
end
end
--
function cm.initial_effect(c) function cm.initial_effect(c)
--link summon --link summon
c:EnableReviveLimit() c:EnableReviveLimit()
......
--埃瓦格里乌斯之教示 --埃瓦格里乌斯之教示
local cm,m=GetID() local cm,m=GetID()
if not pcall(function() require("expansions/script/c130006111") end) then require("script/c130006111") end --lib
AlterEgo=AlterEgo or {}
ae=AlterEgo
function ae.initial(c)
--pendulum summon
aux.EnablePendulumAttribute(c)
--atk&def
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EFFECT_SET_ATTACK)
e1:SetValue(ae.value)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_SET_DEFENSE)
c:RegisterEffect(e2)
--redirect
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_LEAVE_FIELD_REDIRECT)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e3:SetCondition(ae.recon)
e3:SetValue(LOCATION_DECKBOT)
c:RegisterEffect(e3)
--replace
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e4:SetCode(EVENT_DESTROYED)
e4:SetCondition(ae.repcon)
e4:SetOperation(ae.repop)
c:RegisterEffect(e4)
--spsummon
local e5=Effect.CreateEffect(c)
e5:SetCategory(CATEGORY_SPECIAL_SUMMON)
e5:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e5:SetCode(EVENT_DESTROYED)
e5:SetCountLimit(1,c:GetOriginalCode()+1000)
e5:SetProperty(EFFECT_FLAG_DELAY)
e5:SetTarget(ae.sptg)
e5:SetOperation(ae.spop)
c:RegisterEffect(e5)
--ptos
local e6=Effect.CreateEffect(c)
e6:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e6:SetCode(EVENT_FREE_CHAIN)
e6:SetRange(LOCATION_PZONE)
e6:SetCondition(ae.ptoscon)
e6:SetOperation(ae.ptosop)
c:RegisterEffect(e6)
end
function ae.value(e,c)
return Duel.GetMatchingGroupCount(ae.filter,c:GetControler(),LOCATION_ONFIELD,0,nil)*1000
end
function ae.filter(c)
local com=_G["c"..c:GetCode()]
return com and com.AlterEgo and c:IsFaceup()
end
function ae.cfilter(c)
local com=_G["c"..c:GetCode()]
return com and com.AlterEgo
end
function ae.recon(e)
return e:GetHandler():IsLocation(LOCATION_SZONE) and not e:GetHandler():IsLocation(LOCATION_PZONE)
end
function ae.repcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetPreviousLocation()==LOCATION_MZONE
end
function ae.repop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tp=c:GetPreviousControler()
local num=0
if Duel.CheckLocation(tp,LOCATION_PZONE,0) then num=num+1 end
if Duel.CheckLocation(tp,LOCATION_PZONE,1) then num=num+1 end
if (num==0 or not Duel.MoveToField(c,tp,tp,LOCATION_PZONE,POS_FACEUP,true)) and not (c:IsLocation(LOCATION_DECK) and c:IsControler(c:GetOwner())) then
Duel.SendtoDeck(c,nil,1,REASON_EFFECT)
end
end
function ae.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsLocation(LOCATION_EXTRA) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.GetLocationCountFromEx(tp,tp,nil,c)>0 end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
end
function ae.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
end
function ae.ptoscon(e,tp,eg,ep,ev,re,r,rp)
return (Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2) and Duel.GetCurrentChain()==0 and Duel.GetLocationCount(tp,LOCATION_SZONE)>0
end
function ae.ptosop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.MoveToField(c,tp,tp,LOCATION_SZONE,POS_FACEUP,true) then
local e1=Effect.CreateEffect(c)
e1:SetCode(EFFECT_CHANGE_TYPE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET)
e1:SetValue(TYPE_SPELL+TYPE_CONTINUOUS)
c:RegisterEffect(e1)
c:RegisterFlagEffect(c:GetOriginalCode(),RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(130006111,1))
end
end
--
function cm.initial_effect(c) function cm.initial_effect(c)
--search --search
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
......
--宾斯费尔德之遗作 --宾斯费尔德之遗作
local cm,m=GetID() local cm,m=GetID()
if not pcall(function() require("expansions/script/c130006111") end) then require("script/c130006111") end --lib
AlterEgo=AlterEgo or {}
ae=AlterEgo
function ae.initial(c)
--pendulum summon
aux.EnablePendulumAttribute(c)
--atk&def
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EFFECT_SET_ATTACK)
e1:SetValue(ae.value)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_SET_DEFENSE)
c:RegisterEffect(e2)
--redirect
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_LEAVE_FIELD_REDIRECT)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e3:SetCondition(ae.recon)
e3:SetValue(LOCATION_DECKBOT)
c:RegisterEffect(e3)
--replace
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e4:SetCode(EVENT_DESTROYED)
e4:SetCondition(ae.repcon)
e4:SetOperation(ae.repop)
c:RegisterEffect(e4)
--spsummon
local e5=Effect.CreateEffect(c)
e5:SetCategory(CATEGORY_SPECIAL_SUMMON)
e5:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e5:SetCode(EVENT_DESTROYED)
e5:SetCountLimit(1,c:GetOriginalCode()+1000)
e5:SetProperty(EFFECT_FLAG_DELAY)
e5:SetTarget(ae.sptg)
e5:SetOperation(ae.spop)
c:RegisterEffect(e5)
--ptos
local e6=Effect.CreateEffect(c)
e6:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e6:SetCode(EVENT_FREE_CHAIN)
e6:SetRange(LOCATION_PZONE)
e6:SetCondition(ae.ptoscon)
e6:SetOperation(ae.ptosop)
c:RegisterEffect(e6)
end
function ae.value(e,c)
return Duel.GetMatchingGroupCount(ae.filter,c:GetControler(),LOCATION_ONFIELD,0,nil)*1000
end
function ae.filter(c)
local com=_G["c"..c:GetCode()]
return com and com.AlterEgo and c:IsFaceup()
end
function ae.cfilter(c)
local com=_G["c"..c:GetCode()]
return com and com.AlterEgo
end
function ae.recon(e)
return e:GetHandler():IsLocation(LOCATION_SZONE) and not e:GetHandler():IsLocation(LOCATION_PZONE)
end
function ae.repcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetPreviousLocation()==LOCATION_MZONE
end
function ae.repop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tp=c:GetPreviousControler()
local num=0
if Duel.CheckLocation(tp,LOCATION_PZONE,0) then num=num+1 end
if Duel.CheckLocation(tp,LOCATION_PZONE,1) then num=num+1 end
if (num==0 or not Duel.MoveToField(c,tp,tp,LOCATION_PZONE,POS_FACEUP,true)) and not (c:IsLocation(LOCATION_DECK) and c:IsControler(c:GetOwner())) then
Duel.SendtoDeck(c,nil,1,REASON_EFFECT)
end
end
function ae.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsLocation(LOCATION_EXTRA) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.GetLocationCountFromEx(tp,tp,nil,c)>0 end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
end
function ae.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
end
function ae.ptoscon(e,tp,eg,ep,ev,re,r,rp)
return (Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2) and Duel.GetCurrentChain()==0 and Duel.GetLocationCount(tp,LOCATION_SZONE)>0
end
function ae.ptosop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.MoveToField(c,tp,tp,LOCATION_SZONE,POS_FACEUP,true) then
local e1=Effect.CreateEffect(c)
e1:SetCode(EFFECT_CHANGE_TYPE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET)
e1:SetValue(TYPE_SPELL+TYPE_CONTINUOUS)
c:RegisterEffect(e1)
c:RegisterFlagEffect(c:GetOriginalCode(),RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(130006111,1))
end
end
--
function cm.initial_effect(c) function cm.initial_effect(c)
--activate --activate
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
......
--阿利吉耶里之七冠 --阿利吉耶里之七冠
local cm,m=GetID() local cm,m=GetID()
if not pcall(function() require("expansions/script/c130006111") end) then require("script/c130006111") end --lib
AlterEgo=AlterEgo or {}
ae=AlterEgo
function ae.initial(c)
--pendulum summon
aux.EnablePendulumAttribute(c)
--atk&def
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EFFECT_SET_ATTACK)
e1:SetValue(ae.value)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_SET_DEFENSE)
c:RegisterEffect(e2)
--redirect
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_LEAVE_FIELD_REDIRECT)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e3:SetCondition(ae.recon)
e3:SetValue(LOCATION_DECKBOT)
c:RegisterEffect(e3)
--replace
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e4:SetCode(EVENT_DESTROYED)
e4:SetCondition(ae.repcon)
e4:SetOperation(ae.repop)
c:RegisterEffect(e4)
--spsummon
local e5=Effect.CreateEffect(c)
e5:SetCategory(CATEGORY_SPECIAL_SUMMON)
e5:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e5:SetCode(EVENT_DESTROYED)
e5:SetCountLimit(1,c:GetOriginalCode()+1000)
e5:SetProperty(EFFECT_FLAG_DELAY)
e5:SetTarget(ae.sptg)
e5:SetOperation(ae.spop)
c:RegisterEffect(e5)
--ptos
local e6=Effect.CreateEffect(c)
e6:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e6:SetCode(EVENT_FREE_CHAIN)
e6:SetRange(LOCATION_PZONE)
e6:SetCondition(ae.ptoscon)
e6:SetOperation(ae.ptosop)
c:RegisterEffect(e6)
end
function ae.value(e,c)
return Duel.GetMatchingGroupCount(ae.filter,c:GetControler(),LOCATION_ONFIELD,0,nil)*1000
end
function ae.filter(c)
local com=_G["c"..c:GetCode()]
return com and com.AlterEgo and c:IsFaceup()
end
function ae.cfilter(c)
local com=_G["c"..c:GetCode()]
return com and com.AlterEgo
end
function ae.recon(e)
return e:GetHandler():IsLocation(LOCATION_SZONE) and not e:GetHandler():IsLocation(LOCATION_PZONE)
end
function ae.repcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetPreviousLocation()==LOCATION_MZONE
end
function ae.repop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tp=c:GetPreviousControler()
local num=0
if Duel.CheckLocation(tp,LOCATION_PZONE,0) then num=num+1 end
if Duel.CheckLocation(tp,LOCATION_PZONE,1) then num=num+1 end
if (num==0 or not Duel.MoveToField(c,tp,tp,LOCATION_PZONE,POS_FACEUP,true)) and not (c:IsLocation(LOCATION_DECK) and c:IsControler(c:GetOwner())) then
Duel.SendtoDeck(c,nil,1,REASON_EFFECT)
end
end
function ae.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsLocation(LOCATION_EXTRA) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.GetLocationCountFromEx(tp,tp,nil,c)>0 end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
end
function ae.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
end
function ae.ptoscon(e,tp,eg,ep,ev,re,r,rp)
return (Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2) and Duel.GetCurrentChain()==0 and Duel.GetLocationCount(tp,LOCATION_SZONE)>0
end
function ae.ptosop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.MoveToField(c,tp,tp,LOCATION_SZONE,POS_FACEUP,true) then
local e1=Effect.CreateEffect(c)
e1:SetCode(EFFECT_CHANGE_TYPE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET)
e1:SetValue(TYPE_SPELL+TYPE_CONTINUOUS)
c:RegisterEffect(e1)
c:RegisterFlagEffect(c:GetOriginalCode(),RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(130006111,1))
end
end
--
function cm.initial_effect(c) function cm.initial_effect(c)
--Activate --Activate
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
......
...@@ -12,14 +12,12 @@ function cm.AllGlobalCheck(c) ...@@ -12,14 +12,12 @@ function cm.AllGlobalCheck(c)
alle1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE) alle1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
alle1:SetTarget(cm.PeacechoToDeckTarget1) alle1:SetTarget(cm.PeacechoToDeckTarget1)
alle1:SetValue(function(e,c) return false end) alle1:SetValue(function(e,c) return false end)
--Duel.RegisterEffect(alle1,0)
local alle2=Effect.CreateEffect(c) local alle2=Effect.CreateEffect(c)
alle2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) alle2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
alle2:SetCode(EFFECT_SEND_REPLACE) alle2:SetCode(EFFECT_SEND_REPLACE)
alle2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE) alle2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
alle2:SetTarget(cm.PeacechoToDeckTarget2) alle2:SetTarget(cm.PeacechoToDeckTarget2)
alle2:SetValue(function(e,c) return c:GetFlagEffect(53707099)>0 end) alle2:SetValue(function(e,c) return c:GetFlagEffect(53707099)>0 end)
--Duel.RegisterEffect(alle2,0)
cm[0]=Duel.GetDecktopGroup cm[0]=Duel.GetDecktopGroup
Duel.GetDecktopGroup=function(tp,ct) Duel.GetDecktopGroup=function(tp,ct)
Duel.RegisterFlagEffect(tp,53707000,RESET_CHAIN,0,0) Duel.RegisterFlagEffect(tp,53707000,RESET_CHAIN,0,0)
...@@ -31,11 +29,6 @@ function cm.AllGlobalCheck(c) ...@@ -31,11 +29,6 @@ function cm.AllGlobalCheck(c)
Duel.DisableShuffleCheck() Duel.DisableShuffleCheck()
Duel.SendtoGrave(g,reason) Duel.SendtoGrave(g,reason)
end end
--cm[2]=Card.ReverseInDeck
--Card.ReverseInDeck=function(card)
--card:RegisterFlagEffect(53707050,RESET_EVENT+0x53c0000,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(53702500,2))
--return cm[2](card)
--end
local alle5=Effect.CreateEffect(c) local alle5=Effect.CreateEffect(c)
alle5:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) alle5:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
alle5:SetCode(EFFECT_SEND_REPLACE) alle5:SetCode(EFFECT_SEND_REPLACE)
...@@ -105,17 +98,6 @@ function cm.UpConfirm(tp) ...@@ -105,17 +98,6 @@ function cm.UpConfirm(tp)
end end
function cm.Peacecho(c,typ) function cm.Peacecho(c,typ)
Duel.EnableGlobalFlag(GLOBALFLAG_DECK_REVERSE_CHECK) Duel.EnableGlobalFlag(GLOBALFLAG_DECK_REVERSE_CHECK)
local e1=Effect.CreateEffect(c)
e1:SetCode(EFFECT_SEND_REPLACE)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(0xff)
e1:SetTarget(cm.RePeacechotg1)
e1:SetOperation(cm.RePeacechoop)
--c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetTarget(cm.RePeacechotg2)
--c:RegisterEffect(e2)
if typ==TYPE_MONSTER then if typ==TYPE_MONSTER then
local e4=Effect.CreateEffect(c) local e4=Effect.CreateEffect(c)
e4:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_DRAW) e4:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_DRAW)
...@@ -264,36 +246,6 @@ function cm.Peacechofieldcostop(e,tp,eg,ep,ev,re,r,rp) ...@@ -264,36 +246,6 @@ function cm.Peacechofieldcostop(e,tp,eg,ep,ev,re,r,rp)
Duel.SendtoDeck(e:GetHandler(),nil,1,REASON_RULE) Duel.SendtoDeck(e:GetHandler(),nil,1,REASON_RULE)
e:GetHandler():ReverseInDeck() e:GetHandler():ReverseInDeck()
end end
function cm.RePeacechotg1(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return not c:IsLocation(LOCATION_DECK) and c:GetDestination()==LOCATION_GRAVE and not c:IsHasEffect(EFFECT_TO_GRAVE_REDIRECT) and c:IsAbleToDeck() end
return true
end
function cm.RePeacechotg2(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsLocation(LOCATION_DECK) and c:GetDestination()==LOCATION_GRAVE and not c:IsHasEffect(EFFECT_TO_GRAVE_REDIRECT) and Duel.GetFieldGroup(tp,LOCATION_DECK,0):GetMinGroup(Card.GetSequence):GetFirst()~=c end
return true
end
function cm.RePeacechoop(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if c:IsFacedown() then Duel.ConfirmCards(1-tp,c) end
Duel.Hint(HINT_CARD,0,c:GetOriginalCode())
if c:IsLocation(LOCATION_DECK) then
if Duel.GetFlagEffect(tp,53707000)==0 then Duel.ShuffleDeck(tp) end
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EVENT_CHAIN_SOLVED)
e3:SetOperation(cm.RePeacechorst)
e3:SetLabelObject(e)
Duel.RegisterEffect(e3,tp)
Duel.MoveSequence(c,1)
else Duel.SendtoDeck(c,nil,1,REASON_RULE) end
c:ReverseInDeck()
end
function cm.RePeacechorst(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.ResetFlagEffect(tp,53707000)
e:Reset()
end
function cm.PeacechoRepFilter(c) function cm.PeacechoRepFilter(c)
return c:GetDestination()==LOCATION_GRAVE and c:IsOriginalSetCard(0x3537) and not c:IsHasEffect(EFFECT_TO_GRAVE_REDIRECT) and c:GetOriginalType()&TYPE_PENDULUM+TYPE_LINK==0 and c:IsAbleToDeck() return c:GetDestination()==LOCATION_GRAVE and c:IsOriginalSetCard(0x3537) and not c:IsHasEffect(EFFECT_TO_GRAVE_REDIRECT) and c:GetOriginalType()&TYPE_PENDULUM+TYPE_LINK==0 and c:IsAbleToDeck()
end end
...@@ -484,28 +436,6 @@ function cm.Fanippetrsop(e,tp,eg,ep,ev,re,r,rp) ...@@ -484,28 +436,6 @@ function cm.Fanippetrsop(e,tp,eg,ep,ev,re,r,rp)
rc:CancelToGrave(false) rc:CancelToGrave(false)
end end
end end
function cm.FanippetTrapSPCondition(e,tp,eg,ep,ev,re,r,rp)
return rp==1-tp or ep==1-tp or re:GetHandler():IsCode(53716006)
end
function cm.FanippetTrapSPCost(code)
return
function(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.GetFlagEffect(tp,code)==0 and not c:IsLocation(LOCATION_ONFIELD) end
Duel.RegisterFlagEffect(tp,code,RESET_CHAIN,0,1)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EVENT_CHAIN_SOLVING)
e3:SetOperation(cm.Fanippetready)
e3:SetLabelObject(c)
Duel.RegisterEffect(e3,tp)
end
end
function cm.Fanippetready(e,tp)
e:GetLabelObject():SetStatus(STATUS_EFFECT_ENABLED,true)
e:Reset()
end
--
function cm.ALCYakuNew(c,code,cf,loc,t) function cm.ALCYakuNew(c,code,cf,loc,t)
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_FUSION_SUMMON) e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_FUSION_SUMMON)
...@@ -833,304 +763,9 @@ function cm.NALCTac(code,cf,t) ...@@ -833,304 +763,9 @@ function cm.NALCTac(code,cf,t)
end end
end end
end end
function cm.ALCYaku(c,code,num,loc,atk,def,rac,att)
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_STANDBY_PHASE+TIMING_END_PHASE)
if c:GetOriginalCode()~=53713007 then e1:SetCost(cm.ALCYakuActCost(code,num,loc)) else e1:SetCost(cm.ALCYakuActCost2) end
e1:SetTarget(cm.ALCYakuActTarget(code,atk,def,rac,att))
e1:SetOperation(cm.ALCYakuActivate(code,atk,def,rac,att))
c:RegisterEffect(e1)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_TRAP_ACT_IN_SET_TURN)
e3:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
e3:SetCondition(cm.ALCYakuActCondition)
c:RegisterEffect(e3)
end
function cm.ALCYakuCheck(e,tp,eg,ep,ev,re,r,rp)
if not re then return end
for tc in aux.Next(eg) do
tc:RegisterFlagEffect(53713000,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1)
end
end
function cm.ALCYakuActCost(code,num,loc)
return
function(e,tp,eg,ep,ev,re,r,rp,chk)
local ct=Duel.GetFieldGroupCount(tp,0,loc)
if chk==0 then return ct>0 end
local ac=1
if ct>1 then
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(code,1))
ac=Duel.AnnounceLevel(tp,1,math.min(ct,num))
end
local g=Duel.GetFieldGroup(1-tp,loc,0):RandomSelect(tp,ac)
Duel.ConfirmCards(tp,g)
if loc==LOCATION_HAND then Duel.ShuffleHand(1-tp) end
if loc==LOCATION_DECK then Duel.ShuffleDeck(1-tp) end
local list={}
for tc in aux.Next(g) do
table.insert(list,tc:GetCode())
end
e:SetLabel(table.unpack(list))
end
end
function cm.ALCYakuActCost2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroupCount(1-tp,LOCATION_ONFIELD,0)>0 end
local g1=Duel.GetMatchingGroup(Card.IsFaceup,tp,0,LOCATION_ONFIELD,nil)
local g2=Duel.GetMatchingGroup(Card.IsFacedown,tp,0,LOCATION_ONFIELD,nil)
if #g1<1 or (#g2>0 and Duel.SelectYesNo(tp,aux.Stringid(53713007,1))) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEDOWN)
local cg=g2:Select(tp,1,1,nil)
g1:Merge(cg)
end
Duel.ConfirmCards(tp,g1)
local list={}
for tc in aux.Next(g1) do
table.insert(list,tc:GetCode())
end
e:SetLabel(table.unpack(list))
end
function cm.ALCYakuActTarget(code,atk,def,rac,att)
return
function(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and
Duel.IsPlayerCanSpecialSummonMonster(tp,code,0x1535,TYPES_NORMAL_TRAP_MONSTER,atk,def,4,rac,att) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
end
function cm.ALCYakuFusionFilter1(c,e)
return bit.band(c:GetOriginalType(),TYPE_TRAP)~=0 and c:IsType(TYPE_MONSTER) and not c:IsImmuneToEffect(e)
end
function cm.ALCYakuFusionFilter2(c,e,tp,m,f,chkf)
return c:IsType(TYPE_FUSION) and (not f or f(c))
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false) and c:CheckFusionMaterial(m,nil,chkf)
end
function cm.ALCYakuActivate(code,atk,def,rac,att)
return
function(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) or c:IsFacedown() then return end
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0
or not Duel.IsPlayerCanSpecialSummonMonster(tp,code,0x1535,TYPES_NORMAL_TRAP_MONSTER,atk,def,4,rac,att) then return end
local list={e:GetLabel()}
local ct=1
if #list>1 then
Duel.Hint(24,tp,aux.Stringid(53702600,2))
ct=Duel.AnnounceLevel(tp,1,#list)
end
c:AddMonsterAttribute(TYPE_EFFECT+TYPE_TRAP)
if Duel.SpecialSummon(c,SUMMON_VALUE_SELF,tp,tp,true,false,POS_FACEUP)~=0 then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EFFECT_CHANGE_CODE)
e1:SetValue(list[ct])
e1:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TOFIELD-RESET_LEAVE)
c:RegisterEffect(e1)
local mg1=Duel.GetFusionMaterial(tp):Filter(Card.IsOnField,nil):Filter(cm.ALCYakuFusionFilter1,nil,e)
local sg1=Duel.GetMatchingGroup(cm.ALCYakuFusionFilter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg1,nil,chkf)
local mg2=nil
local sg2=nil
local ce=Duel.GetChainMaterial(tp)
if ce~=nil then
local fgroup=ce:GetTarget()
mg2=fgroup(ce,e,tp)
local mf=ce:GetValue()
sg2=Duel.GetMatchingGroup(cm.ALCYakuFusionFilter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg2,mf,chkf)
end
if (sg1:GetCount()>0 or (sg2~=nil and sg2:GetCount()>0)) and Duel.SelectYesNo(tp,aux.Stringid(code,0)) then
Duel.BreakEffect()
local sg=sg1:Clone()
if sg2 then sg:Merge(sg2) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tg=sg:Select(tp,1,1,nil)
local tc=tg:GetFirst()
if sg1:IsContains(tc) and (sg2==nil or not sg2:IsContains(tc) or not Duel.SelectYesNo(tp,ce:GetDescription())) then
local mat1=Duel.SelectFusionMaterial(tp,tc,mg1,nil,chkf)
tc:SetMaterial(mat1)
Duel.SendtoGrave(mat1,REASON_EFFECT+REASON_MATERIAL+REASON_FUSION)
Duel.BreakEffect()
Duel.SpecialSummon(tc,SUMMON_TYPE_FUSION,tp,tp,false,false,POS_FACEUP)
else
local mat2=Duel.SelectFusionMaterial(tp,tc,mg2,nil,chkf)
local fop=ce:GetOperation()
fop(ce,e,tp,tc,mat2)
end
tc:CompleteProcedure()
end
end
end
end
function cm.ALCYakuActCondition(e) function cm.ALCYakuActCondition(e)
return e:GetHandler():GetFlagEffect(53713000)>0 return e:GetHandler():GetFlagEffect(53713000)>0
end end
--
function cm.ALCIppa(c,code,num)
c:EnableReviveLimit()
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetCode(EFFECT_SPSUMMON_COST)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_SINGLE_RANGE)
e0:SetRange(0xff)
e0:SetCost(cm.ALCTFCost(num))
e0:SetOperation(cm.ALCTFOperation(num))
c:RegisterEffect(e0)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_FUSION_MATERIAL)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCondition(cm.ALCFusionCondition)
e1:SetOperation(cm.ALCFusionOperation)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(code,0))
e2:SetCategory(CATEGORY_NEGATE+CATEGORY_TOGRAVE)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_CHAINING)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(2,code)
e2:SetCondition(cm.ALCDisCondition)
e2:SetTarget(cm.ALCDisTarget)
e2:SetOperation(cm.ALCDisOperation(code))
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetDescription(aux.Stringid(code,1))
e3:SetCategory(CATEGORY_TODECK)
e3:SetTarget(cm.ALCSetTarget)
e3:SetOperation(cm.ALCSetOperation)
c:RegisterEffect(e3)
end
function cm.ALCTFFilter(c)
return bit.band(c:GetOriginalType(),TYPE_TRAP)~=0 and c:IsType(TYPE_MONSTER) and not c:IsForbidden()
end
function cm.ALCFSelect(g,e,tp)
return Duel.GetLocationCountFromEx(tp,tp,g,e:GetHandler())
end
function cm.ALCTFCost(num)
return
function(e,c,tp,st)
if bit.band(st,SUMMON_TYPE_FUSION)==SUMMON_TYPE_FUSION then
e:SetLabel(1)
local cg=Duel.GetMatchingGroup(cm.ALCTFFilter,tp,LOCATION_MZONE,0,nil)
return cg:CheckSubGroup(cm.ALCFSelect,num,num,e,tp) and Duel.GetLocationCount(tp,LOCATION_SZONE)>1 and Duel.GetLocationCountFromEx(tp,tp,nil,c)>0
else
e:SetLabel(0)
return true
end
end
end
function cm.ALCTFOperation(num)
return
function(e,tp,eg,ep,ev,re,r,rp)
if e:GetLabel()==0 then return true end
e:SetLabel(0)
local g=Duel.GetMatchingGroup(cm.ALCTFFilter,tp,LOCATION_MZONE,0,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOFIELD)
local fg=g:SelectSubGroup(tp,cm.ALCFSelect,false,num,num,e,tp)
Duel.HintSelection(fg)
for tc in aux.Next(fg) do
Duel.MoveToField(tc,tp,tp,LOCATION_SZONE,POS_FACEUP,true)
end
end
end
function cm.ALCFusionCondition(e,g,gc,chkfnf)
if g==nil then return true end
if gc then return false end
local c=e:GetHandler()
local tp=c:GetControler()
if aux.FCheckAdditional and not aux.FCheckAdditional(tp,Group.CreateGroup(),c) then return false end
local chkf=(chkfnf & 0xff)
return chkf==PLAYER_NONE or Duel.GetLocationCountFromEx(chkf)>-1
end
function cm.ALCFusionOperation(e,tp,eg,ep,ev,re,r,rp,gc,chkf)
Duel.SetFusionMaterial(Group.CreateGroup())
end
function cm.ALCDisCondition(e,tp,eg,ep,ev,re,r,rp)
return rp==1-tp and not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) and Duel.IsChainNegatable(ev)
end
function cm.ALCRealSetFilter(c,code)
return c:IsFaceup() and c:IsCode(code) and (c:IsSSetable(true) or c:IsCanTurnSet())
end
function cm.ALCDisTarget(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.ALCRealSetFilter,tp,LOCATION_ONFIELD,0,1,nil,eg:GetFirst():GetCode()) end
Duel.SetOperationInfo(0,CATEGORY_TODECK,e:GetHandler(),1,0,0)
Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0)
end
function cm.ALCDisOperation(code)
return
function(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
local g=Duel.SelectMatchingCard(tp,cm.ALCRealSetFilter,tp,LOCATION_ONFIELD,0,1,1,nil,eg:GetFirst():GetCode())
if #g>0 then
Duel.HintSelection(g)
local tc=g:GetFirst()
tc:CancelToGrave()
Duel.ChangePosition(tc,POS_FACEDOWN)
if tc:IsType(TYPE_SPELL+TYPE_TRAP) then Duel.RaiseEvent(tc,EVENT_SSET,e,REASON_EFFECT,tp,tp,0) end
if code==53713002 then
local g2=Duel.GetMatchingGroup(Card.IsAbleToGrave,tp,0,LOCATION_HAND,nil)
if Duel.NegateActivation(ev) and #g2>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local sg=g2:RandomSelect(tp,1)
Duel.SendtoGrave(sg,REASON_EFFECT)
end
end
if code==53713004 then
local rg=Duel.GetDecktopGroup(1-tp,5)
if Duel.NegateActivation(ev) and rg:FilterCount(Card.IsAbleToRemove,nil)==5 then
Duel.DisableShuffleCheck()
Duel.Remove(rg,POS_FACEUP,REASON_EFFECT)
end
end
if code==53713008 then
local rg=Duel.GetMatchingGroup(Card.IsAbleToRemove,tp,0,LOCATION_GRAVE,nil)
if Duel.NegateActivation(ev) and #rg>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local rg=Duel.SelectMatchingCard(tp,Card.IsAbleToRemove,tp,0,LOCATION_GRAVE,1,3,nil)
Duel.Remove(rg,POS_FACEUP,REASON_EFFECT)
end
end
if code==53713009 then
local g2=Duel.GetMatchingGroup(Card.IsAbleToGrave,tp,0,LOCATION_ONFIELD,nil)
if Duel.NegateActivation(ev) and #g2>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local sg=g2:Select(tp,1,1,nil)
Duel.HintSelection(sg)
Duel.SendtoGrave(sg,REASON_EFFECT)
end
end
end
end
end
function cm.ALCSetFilter(c)
return c:IsFaceup() and c:IsType(TYPE_CONTINUOUS) and c:IsType(TYPE_TRAP) and c:IsSSetable(true)
end
function cm.ALCSetTarget(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.ALCSetFilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TODECK,e:GetHandler(),1,0,0)
end
function cm.ALCSetOperation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) or c:IsFacedown() then return end
Duel.SendtoDeck(c,nil,2,REASON_EFFECT)
if c:IsLocation(LOCATION_EXTRA) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
local g=Duel.SelectMatchingCard(tp,cm.ALCSetFilter,tp,LOCATION_ONFIELD,0,1,2,nil)
if #g>0 then
Duel.HintSelection(g)
for tc in aux.Next(g) do
tc:CancelToGrave()
Duel.ChangePosition(tc,POS_FACEDOWN)
Duel.RaiseEvent(tc,EVENT_SSET,e,REASON_EFFECT,tp,tp,0)
end
end
end
end
--
function cm.HTFSynchoro(c,lab,code) function cm.HTFSynchoro(c,lab,code)
if lab==0 then aux.EnablePendulumAttribute(c,false) end if lab==0 then aux.EnablePendulumAttribute(c,false) end
c:EnableReviveLimit() c:EnableReviveLimit()
...@@ -1628,37 +1263,6 @@ function cm.OSReturnOperation(e,tp,eg,ep,ev,re,r,rp) ...@@ -1628,37 +1263,6 @@ function cm.OSReturnOperation(e,tp,eg,ep,ev,re,r,rp)
end end
-- --
function cm.SorisonFish(c) function cm.SorisonFish(c)
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetCode(EFFECT_SYNCHRO_MATERIAL_CUSTOM)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e0:SetTarget(cm.Sorisonsyntg)
e0:SetValue(1)
e0:SetOperation(cm.Sorisonsynop)
local e01=Effect.CreateEffect(c)
e01:SetType(EFFECT_TYPE_SINGLE)
e01:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e01:SetCode(EFFECT_HAND_SYNCHRO)
e01:SetTarget(cm.Sorisonhsyntg)
local e02=Effect.CreateEffect(c)
e02:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_GRANT)
e02:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e02:SetRange(LOCATION_HAND)
e02:SetTargetRange(LOCATION_MZONE,0)
--e02:SetCondition(cm.SorisonhsCondition)
e02:SetTarget(cm.SorisonhsTarget)
e02:SetLabelObject(e0)
--c:RegisterEffect(e02)
local e03=e02:Clone()
e03:SetLabelObject(e01)
--c:RegisterEffect(e03)
--local e04=Effect.CreateEffect(c)
--e04:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
--e04:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
--e04:SetCode(EVENT_ADJUST)
--e04:SetRange(LOCATION_HAND)
--e04:SetOperation(cm.SorisonAntiRepeat)
--c:RegisterEffect(e04)
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_PHASE_START+PHASE_DRAW) e1:SetCode(EVENT_PHASE_START+PHASE_DRAW)
...@@ -1790,22 +1394,6 @@ end ...@@ -1790,22 +1394,6 @@ end
function cm.Sorisonhsyntg(e,c) function cm.Sorisonhsyntg(e,c)
return c:IsHasEffect(53721000) return c:IsHasEffect(53721000)
end end
function cm.SorisonhsCondition(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetFlagEffect(53721049)>0
end
function cm.SorisonhsTarget(e,c)
return c:IsType(TYPE_TUNER)
end
function cm.SorisonAntiRepeatf(c)
return c:IsOriginalSetCard(0xa531) and not c:IsType(TYPE_TUNER) and c:GetFlagEffect(53721049)>0
end
function cm.SorisonAntiRepeat(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetMatchingGroup(cm.SorisonAntiRepeatf,tp,LOCATION_HAND,0,c)
if #g==0 then
c:RegisterFlagEffect(53721049,RESET_EVENT+RESETS_STANDARD,0,0)
end
end
function cm.SorisonTGCondition(e,tp,eg,ep,ev,re,r,rp) function cm.SorisonTGCondition(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsReason(REASON_COST) and re:IsActivated() and re:IsActiveType(TYPE_MONSTER) return e:GetHandler():IsReason(REASON_COST) and re:IsActivated() and re:IsActiveType(TYPE_MONSTER)
and re:GetHandler():IsAttribute(ATTRIBUTE_WATER) and re:GetHandler():IsAttribute(ATTRIBUTE_WATER)
...@@ -2234,91 +1822,22 @@ function cm.Breakcount(e,tp,eg,ep,ev,re,r,rp) ...@@ -2234,91 +1822,22 @@ function cm.Breakcount(e,tp,eg,ep,ev,re,r,rp)
if not Duel.IsPlayerAffectedByEffect(tp,EFFECT_CANNOT_SPECIAL_SUMMON) then c53799250.sp=true end if not Duel.IsPlayerAffectedByEffect(tp,EFFECT_CANNOT_SPECIAL_SUMMON) then c53799250.sp=true end
if not Duel.IsPlayerAffectedByEffect(tp,EFFECT_CANNOT_ACTIVATE) then c53799250.ac=true end if not Duel.IsPlayerAffectedByEffect(tp,EFFECT_CANNOT_ACTIVATE) then c53799250.ac=true end
end end
function cm.DesertedHartrazLink(c,marker) function cm.EnableExtraDeckSummonCountLimit()
local e0=Effect.CreateEffect(c) if cm.ExtraDeckSummonCountLimit~=nil then return end
e0:SetDescription(1163) cm.ExtraDeckSummonCountLimit={}
e0:SetType(EFFECT_TYPE_FIELD) cm.ExtraDeckSummonCountLimit[0]=1
e0:SetCode(EFFECT_SPSUMMON_PROC_G) cm.ExtraDeckSummonCountLimit[1]=1
e0:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_IGNORE_IMMUNE) local ge1=Effect.GlobalEffect()
e0:SetRange(LOCATION_EXTRA) ge1:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e0:SetCondition(cm.Hartrazlkcon) ge1:SetCode(EVENT_PHASE_START+PHASE_DRAW)
e0:SetOperation(cm.Hartrazlkop(marker)) ge1:SetOperation(cm.ExtraDeckSummonCountLimitReset)
e0:SetValue(SUMMON_TYPE_LINK) Duel.RegisterEffect(ge1,0)
c:RegisterEffect(e0)
end
function cm.Hartrazlkfilter(c,lc,tp)
return c:IsFaceup() and c:IsLinkRace(RACE_PYRO) and c:IsCanBeLinkMaterial(lc)
end
function cm.Hartrazlvfilter(c)
if c:IsType(TYPE_LINK) and c:GetLink()>1 then return 1+0x10000*c:GetLink() else return 1 end
end
function cm.Hartrazlcheck(tp,sg,lc,minc,ct)
return ct>=minc and sg:CheckWithSumEqual(cm.Hartrazlvfilter,lc:GetLink(),ct,ct)
end
function cm.Hartrazlkcheck(c,tp,sg,mg,lc,ct,minc,maxc)
sg:AddCard(c)
ct=ct+1
local res=cm.Hartrazlcheck(tp,sg,lc,minc,ct) or (ct<maxc and mg:IsExists(cm.Hartrazlkcheck,1,sg,tp,sg,mg,lc,ct,minc,maxc))
sg:RemoveCard(c)
ct=ct-1
return res
end end
function cm.Hartrazlkcon(e,c,og) function cm.ExtraDeckSummonCountLimitReset()
if c==nil then return true end cm.ExtraDeckSummonCountLimit[0]=1
local tp=c:GetControler() cm.ExtraDeckSummonCountLimit[1]=1
local mg=Duel.GetMatchingGroup(cm.Hartrazlkfilter,tp,LOCATION_MZONE,0,nil,c,tp)
local sg=Group.CreateGroup()
for i,pe in ipairs({Duel.IsPlayerAffectedByEffect(tp,EFFECT_MUST_BE_LMATERIAL)}) do
local pc=pe:GetHandler()
if not mg:IsContains(pc) then return false end
sg:AddCard(pc)
end
local ct=sg:GetCount()
local minc=1
local maxc=1
if ct>maxc then return false end
return Duel.GetLocationCount(tp,LOCATION_SZONE)>0 and cm.Hartrazlcheck(tp,sg,c,minc,ct) or mg:IsExists(cm.Hartrazlkcheck,1,nil,tp,sg,mg,c,ct,minc,maxc)
end end
function cm.Hartrazlkop(marker) function cm.LinkMonstertoSpell(c,marker)
return
function(e,tp,eg,ep,ev,re,r,rp,c,sg,og)
local mg=Duel.GetMatchingGroup(cm.Hartrazlkfilter,tp,LOCATION_MZONE,0,nil,c,tp)
local sg2=Group.CreateGroup()
for i,pe in ipairs({Duel.IsPlayerAffectedByEffect(tp,EFFECT_MUST_BE_LMATERIAL)}) do sg2:AddCard(pe:GetHandler()) end
local ct=sg2:GetCount()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_LMATERIAL)
sg2:Select(tp,ct,ct,nil)
local minc=1
local maxc=1
for i=ct,maxc-1 do
local cg=mg:Filter(cm.Hartrazlkcheck,sg2,tp,sg2,mg,c,i,minc,maxc)
if cg:GetCount()==0 then break end
local minct=1
if cm.Hartrazlcheck(tp,sg2,c,minc,i) then
if not Duel.SelectYesNo(tp,aux.Stringid(m,0)) then break end
minct=0
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_LMATERIAL)
local g=cg:Select(tp,minct,1,nil)
if g:GetCount()==0 then break end
sg2:Merge(g)
end
Duel.SendtoGrave(sg2,REASON_MATERIAL+REASON_LINK)
sg2:KeepAlive()
local self=Group.FromCards(c)
self:KeepAlive()
cm[100]=sg2
cm[101]=e
cm[102]=self
local e3=Effect.CreateEffect(e:GetHandler())
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EVENT_MOVE)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCondition(cm.adjustcon2)
e3:SetOperation(cm.adjustop2)
Duel.RegisterEffect(e3,tp)
c:SetMaterial(sg2)
Duel.MoveToField(c,tp,tp,LOCATION_SZONE,POS_FACEUP,true)
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CHANGE_TYPE) e1:SetCode(EFFECT_CHANGE_TYPE)
...@@ -2334,247 +1853,29 @@ function cm.Hartrazlkop(marker) ...@@ -2334,247 +1853,29 @@ function cm.Hartrazlkop(marker)
e2:SetValue(marker) e2:SetValue(marker)
e2:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET) e2:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET)
c:RegisterEffect(e2) c:RegisterEffect(e2)
c:CompleteProcedure()
c:RegisterFlagEffect(53729000,0,0,0)
Duel.RaiseEvent(e:GetHandler(),EVENT_ADJUST,nil,0,PLAYER_NONE,PLAYER_NONE,0)
end
end
function cm.adjustcon2(e,tp,eg,ep,ev,re,r,rp)
return cm[102]:GetFirst():GetFlagEffect(53729000)>0
end
function cm.adjustop2(e,tp,eg,ep,ev,re,r,rp)
Debug.Message(#cm[100])
local sc=cm[102]:GetFirst()
Debug.Message(sc:GetCode())
if sc:IsCanBeSpecialSummoned(e,0,tp,false,false) then return end
Duel.RaiseEvent(cm[100],EVENT_BE_MATERIAL,cm[101],REASON_SYNCHRO,tp,tp,0)
for tc in aux.Next(cm[100]) do
Duel.RaiseSingleEvent(tc,EVENT_BE_MATERIAL,cm[101],REASON_SYNCHRO,tp,tp,0)
end
end end
function cm.ORsideLink(c,f,min,max,gf,code) function cm.CyberNSwitch(c)
c:EnableReviveLimit() if Duel.GetFlagEffect(0,53727000)>0 then return end
Duel.RegisterFlagEffect(0,53727000,0,0,0)
Duel.Hint(HINT_OPSELECTED,0,aux.Stringid(53702500,8))
Duel.Hint(HINT_OPSELECTED,1,aux.Stringid(53702500,8))
Duel.SelectYesNo(0,aux.Stringid(53702600,1))
Duel.SelectYesNo(1,aux.Stringid(53702600,1))
if Duel.GetFlagEffect(0,53727097)==0 and not Duel.SelectYesNo(0,aux.Stringid(53702500,13)) then Duel.RegisterFlagEffect(0,53727097,0,0,0) end
if Duel.GetFlagEffect(1,53727097)==0 and not Duel.SelectYesNo(1,aux.Stringid(53702500,13)) then Duel.RegisterFlagEffect(1,53727097,0,0,0) end
if Duel.GetFlagEffect(0,53727097)>0 then
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetDescription(1166) e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetType(EFFECT_TYPE_FIELD) e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCode(EFFECT_SPSUMMON_PROC) e1:SetOperation(cm.CyberNCheck)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) Duel.RegisterEffect(e1,0)
e1:SetRange(LOCATION_EXTRA)
if max==nil then max=c:GetLink() end
e1:SetCondition(cm.LinkCondition(f,min,max,gf,code))
e1:SetTarget(cm.LinkTarget(f,min,max,gf))
e1:SetOperation(cm.LinkOperation(f,min,max,gf))
e1:SetValue(SUMMON_TYPE_LINK)
c:RegisterEffect(e1)
end
function cm.LConditionFilter(c,f,lc,e)
return (c:IsFaceup() or not c:IsOnField() or e:IsHasProperty(EFFECT_FLAG_SET_AVAILABLE))
and c:IsCanBeLinkMaterial(lc) and (not f or f(c))
end
function cm.LExtraFilter(c,f,lc,tp)
if c:IsLocation(LOCATION_ONFIELD) and not c:IsFaceup() then return false end
if not c:IsCanBeLinkMaterial(lc) or f and not f(c) then return false end
local le={c:IsHasEffect(EFFECT_EXTRA_LINK_MATERIAL,tp)}
for _,te in pairs(le) do
local tf=te:GetValue()
local related,valid=tf(te,lc,nil,c,tp)
if related then return true end
end end
return false if Duel.GetFlagEffect(0,53727097)>0 then
end local e2=Effect.CreateEffect(c)
function cm.GetLinkCount(c) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
if c:IsType(TYPE_LINK) and c:GetLink()>1 then e2:SetCode(EVENT_FREE_CHAIN)
return 1+0x10000*c:GetLink() e2:SetOperation(cm.CyberNCheck)
else return 1 end Duel.RegisterEffect(e2,1)
end
function cm.GetLinkMaterials(tp,f,lc,e)
local mg=Duel.GetMatchingGroup(cm.LConditionFilter,tp,LOCATION_MZONE,0,nil,f,lc,e)
local mg2=Duel.GetMatchingGroup(cm.LExtraFilter,tp,LOCATION_HAND+LOCATION_SZONE,LOCATION_ONFIELD,nil,f,lc,tp)
if mg2:GetCount()>0 then mg:Merge(mg2) end
return mg
end
function cm.LCheckOtherMaterial(c,mg,lc,tp)
local le={c:IsHasEffect(EFFECT_EXTRA_LINK_MATERIAL,tp)}
local res1=false
local res2=true
for _,te in pairs(le) do
local f=te:GetValue()
local related,valid=f(te,lc,mg,c,tp)
if related then res2=false end
if related and valid then res1=true end
end
return res1 or res2
end
function cm.LUncompatibilityFilter(c,sg,lc,tp)
local mg=sg:Filter(aux.TRUE,c)
return not cm.LCheckOtherMaterial(c,mg,lc,tp)
end
function cm.LCheckGoal(sg,tp,lc,gf,lmat)
return sg:CheckWithSumEqual(cm.GetLinkCount,lc:GetLink(),#sg,#sg)
and Duel.GetLocationCountFromEx(tp,tp,sg,lc)>0 and (not gf or gf(sg))
and not sg:IsExists(cm.LUncompatibilityFilter,1,nil,sg,lc,tp)
and (not lmat or sg:IsContains(lmat))
end
function cm.LExtraMaterialCount(mg,lc,tp)
for tc in aux.Next(mg) do
local le={tc:IsHasEffect(EFFECT_EXTRA_LINK_MATERIAL,tp)}
for _,te in pairs(le) do
local sg=mg:Filter(aux.TRUE,tc)
local f=te:GetValue()
local related,valid=f(te,lc,sg,tc,tp)
if related and valid then
te:UseCountLimit(tp)
end
end
end
end
function cm.LinkCondition(f,minc,maxc,gf,code)
return function(e,c,og,lmat,min,max)
if c==nil then return true end
if c:IsType(TYPE_PENDULUM) and c:IsFaceup() then return false end
if c:GetOriginalCode()~=code then return false end
local minc=minc
local maxc=maxc
if min then
if min>minc then minc=min end
if max<maxc then maxc=max end
if minc>maxc then return false end
end
local tp=c:GetControler()
local mg=nil
if og then
mg=og:Filter(aux.LConditionFilter,nil,f,c,e)
else
mg=aux.GetLinkMaterials(tp,f,c,e)
end
if lmat~=nil then
if not aux.LConditionFilter(lmat,f,c,e) then return false end
mg:AddCard(lmat)
end
local fg=Duel.GetMustMaterial(tp,EFFECT_MUST_BE_LMATERIAL)
if fg:IsExists(aux.MustMaterialCounterFilter,1,nil,mg) then return false end
Duel.SetSelectedCard(fg)
return mg:CheckSubGroup(aux.LCheckGoal,minc,maxc,tp,c,gf,lmat)
end
end
function cm.LinkTarget(f,minc,maxc,gf)
return function(e,tp,eg,ep,ev,re,r,rp,chk,c,og,lmat,min,max)
local minc=minc
local maxc=maxc
if min then
if min>minc then minc=min end
if max<maxc then maxc=max end
if minc>maxc then return false end
end
local mg=nil
if og then
mg=og:Filter(cm.LConditionFilter,nil,f,c,e)
else
mg=cm.GetLinkMaterials(tp,f,c,e)
end
if lmat~=nil then
if not cm.LConditionFilter(lmat,f,c,e) then return false end
mg:AddCard(lmat)
end
local fg=Duel.GetMustMaterial(tp,EFFECT_MUST_BE_LMATERIAL)
Duel.SetSelectedCard(fg)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_LMATERIAL)
local cancel=Duel.IsSummonCancelable()
local sg=mg:SelectSubGroup(tp,cm.LCheckGoal,cancel,minc,maxc,tp,c,gf,lmat)
if sg then
sg:KeepAlive()
e:SetLabelObject(sg)
return true
else return false end
end
end
function cm.LinkOperation(f,minc,maxc,gf)
return function(e,tp,eg,ep,ev,re,r,rp,c,og,lmat,min,max)
local g=e:GetLabelObject()
c:SetMaterial(g)
cm.LExtraMaterialCount(g,c,tp)
Duel.SendtoGrave(g,REASON_MATERIAL+REASON_LINK)
g:DeleteGroup()
end
end
function cm.EnableExtraDeckSummonCountLimit()
if cm.ExtraDeckSummonCountLimit~=nil then return end
cm.ExtraDeckSummonCountLimit={}
cm.ExtraDeckSummonCountLimit[0]=1
cm.ExtraDeckSummonCountLimit[1]=1
local ge1=Effect.GlobalEffect()
ge1:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
ge1:SetCode(EVENT_PHASE_START+PHASE_DRAW)
ge1:SetOperation(cm.ExtraDeckSummonCountLimitReset)
Duel.RegisterEffect(ge1,0)
end
function cm.ExtraDeckSummonCountLimitReset()
cm.ExtraDeckSummonCountLimit[0]=1
cm.ExtraDeckSummonCountLimit[1]=1
end
function cm.HartrazCheck(c)
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetCode(EFFECT_SPSUMMON_COST)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_SINGLE_RANGE)
e0:SetRange(0xff)
e0:SetCost(cm.Hztfcost)
e0:SetOperation(cm.Hztfop)
--c:RegisterEffect(e0)
end
function cm.Hztfcost(e,c,tp,st)
if bit.band(st,SUMMON_TYPE_LINK)==SUMMON_TYPE_LINK then
e:SetLabel(1)
local cg=Duel.GetMatchingGroup(cm.ALCTFFilter,tp,LOCATION_MZONE,0,nil)
return Duel.GetLocationCount(tp,LOCATION_SZONE)>0
else
e:SetLabel(0)
return true
end
end
function cm.Hztfop(e,tp,eg,ep,ev,re,r,rp)
if e:GetLabel()==0 then return true end
e:SetLabel(0)
end
function cm.LinkMonstertoSpell(c,marker)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CHANGE_TYPE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET)
e1:SetValue(TYPE_SPELL)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetRange(LOCATION_SZONE)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetCode(EFFECT_LINK_SPELL_KOISHI)
e2:SetValue(marker)
e2:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET)
c:RegisterEffect(e2)
end
function cm.CyberNSwitch(c)
if Duel.GetFlagEffect(0,53727000)>0 then return end
Duel.RegisterFlagEffect(0,53727000,0,0,0)
Duel.Hint(HINT_OPSELECTED,0,aux.Stringid(53702500,8))
Duel.Hint(HINT_OPSELECTED,1,aux.Stringid(53702500,8))
Duel.SelectYesNo(0,aux.Stringid(53702600,1))
Duel.SelectYesNo(1,aux.Stringid(53702600,1))
if Duel.GetFlagEffect(0,53727097)==0 and not Duel.SelectYesNo(0,aux.Stringid(53702500,13)) then Duel.RegisterFlagEffect(0,53727097,0,0,0) end
if Duel.GetFlagEffect(1,53727097)==0 and not Duel.SelectYesNo(1,aux.Stringid(53702500,13)) then Duel.RegisterFlagEffect(1,53727097,0,0,0) end
if Duel.GetFlagEffect(0,53727097)>0 then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetOperation(cm.CyberNCheck)
Duel.RegisterEffect(e1,0)
end
if Duel.GetFlagEffect(0,53727097)>0 then
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetOperation(cm.CyberNCheck)
Duel.RegisterEffect(e2,1)
end end
end end
function cm.CyberNCheck(e,tp,eg,ep,ev,re,r,rp) function cm.CyberNCheck(e,tp,eg,ep,ev,re,r,rp)
...@@ -2821,10 +2122,6 @@ function cm.AllEffectRstop(e,tp,eg,ep,ev,re,r,rp) ...@@ -2821,10 +2122,6 @@ function cm.AllEffectRstop(e,tp,eg,ep,ev,re,r,rp)
end end
reg(sc,se,bool) reg(sc,se,bool)
end end
--[[AD_Avoid_RegisterEffect=Duel.RegisterEffect
Duel.RegisterEffect=function(...)
return
end--]]
for tc in aux.Next(g) do for tc in aux.Next(g) do
if tc.initial_effect then if tc.initial_effect then
local ini=cm.initial_effect local ini=cm.initial_effect
...@@ -2938,55 +2235,6 @@ function cm.rest(c,scat,styp,spro,scod,sct,scon,scos,stg,sop) ...@@ -2938,55 +2235,6 @@ function cm.rest(c,scat,styp,spro,scod,sct,scon,scos,stg,sop)
c:RegisterEffect(e1) c:RegisterEffect(e1)
return e1 return e1
end end
function cm.bettertrg(c,scod,code)
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_CHAINING)
ge1:SetOperation(cm.btcount(code))
Duel.RegisterEffect(ge1,0)
local ge2=Effect.CreateEffect(c)
ge2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge2:SetCode(EVENT_CHAIN_END)
ge2:SetOperation(cm.btreset(code))
Duel.RegisterEffect(ge2,0)
local ge3=Effect.CreateEffect(c)
ge3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge3:SetCode(scod)
ge3:SetOperation(cm.bteg(code))
Duel.RegisterEffect(ge3,0)
end
function cm.btcount(code)
return
function(e,tp,eg,ep,ev,re,r,rp)
_G["c"..code].chain=true
end
end
function cm.bteg(code)
return
function(e,tp,eg,ep,ev,re,r,rp)
local class=_G["c"..code]
if class.chain==true then
local g=Group.CreateGroup()
if class[0] then g=class[0] end
g:Merge(eg)
g:KeepAlive()
class[0]=g
end
if class.chain==false then
Duel.RaiseEvent(eg,EVENT_CUSTOM+code,re,r,rp,ep,ev)
end
end
end
function cm.btreset(code)
return
function(e,tp,eg,ep,ev,re,r,rp)
local class=_G["c"..code]
class.chain=false
if not class[0] then return end
Duel.RaiseEvent(class[0],EVENT_CUSTOM+code,re,r,rp,ep,ev)
class[0]=nil
end
end
function cm.RinnaZone(tp,cg) function cm.RinnaZone(tp,cg)
local fdzone=0 local fdzone=0
for cc in aux.Next(cg) do for cc in aux.Next(cg) do
...@@ -3107,333 +2355,6 @@ function cm.ReturnLock(e,tp,eg,ep,ev,re,r,rp) ...@@ -3107,333 +2355,6 @@ function cm.ReturnLock(e,tp,eg,ep,ev,re,r,rp)
e:Reset() e:Reset()
end end
end end
function cm.OjamaAdjust()--Deserted
f1=Duel.RegisterEffect
Duel.RegisterEffect=function(e,p)
if e:GetCode()==EFFECT_DISABLE_FIELD then
local pro,pro2=e:GetProperty()
pro=pro|EFFECT_FLAG_PLAYER_TARGET
e:SetProperty(pro,pro2)
e:SetTargetRange(1,1)
end
f1(e,p)
end
f2=Card.RegisterEffect
Card.RegisterEffect=function(sc,e,bool)
if e:GetCode()==EFFECT_DISABLE_FIELD then
local op,range,con=e:GetOperation(),e:GetRange(),e:GetCondition()
if op then
local res=false
local xe={Duel.IsPlayerAffectedByEffect(0,53734099)}
local t={}
for _,i in ipairs(xe) do table.insert(t,i:GetLabelObject()) end
if not cm.IsInTable(e,t) then res=true end
if not Duel.IsPlayerAffectedByEffect(0,53734099) or res then
local ex2=Effect.CreateEffect(sc)
ex2:SetType(EFFECT_TYPE_FIELD)
ex2:SetCode(53734099)
ex2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
ex2:SetTargetRange(1,1)
ex2:SetLabelObject(e)
if range then ex2:SetRange(range) end
if con then ex2:SetCondition(con) end
ex2:SetOperation(op)
Duel.RegisterEffect(ex2,0)
end
local ex=Effect.CreateEffect(sc)
ex:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ex:SetCode(EVENT_ADJUST)
ex:SetRange(range)
ex:SetLabelObject(e)
ex:SetOperation(cm.OjamaAdjustop)
f2(sc,ex)
e:SetOperation(nil)
else
local pro,pro2=e:GetProperty()
pro=pro|EFFECT_FLAG_PLAYER_TARGET
e:SetProperty(pro,pro2)
e:SetTargetRange(1,1)
end
end
f2(sc,e,bool)
end
end
function cm.OjamaAdjustop(e,tp,eg,ep,ev,re,r,rp)--Deserted
local c=e:GetHandler()
if c:GetFlagEffect(m)>0 then return end
c:RegisterFlagEffect(m,RESET_EVENT+RESETS_STANDARD+RESET_OVERLAY,0,0)
local te=e:GetLabelObject()
local con,range,op=0,0,0
local xe={Duel.IsPlayerAffectedByEffect(0,53734099)}
local t={}
for _,i in ipairs(xe) do
if te==i:GetLabelObject() then
if i:GetCondition() then con=i:GetCondition() end
if i:GetRange() then range=i:GetRange() end
op=i:GetOperation()
end
end
local val=op(e,tp)
if tp==1 then val=((val&0xffff)<<16)|((val>>16)&0xffff) end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_DISABLE_FIELD)
if range~=0 then e1:SetRange(range) else e1:SetRange(LOCATION_MZONE) end
if con~=0 then e1:SetCondition(con) end
e1:SetValue(val)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_OVERLAY)
c:RegisterEffect(e1)
end
function cm.GCSpirit(c,gc)
c:EnableReviveLimit()
local e0=Effect.CreateEffect(c)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetCode(EFFECT_SPSUMMON_CONDITION)
e0:SetValue(aux.FALSE)
c:RegisterEffect(e0)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(53702600,5))
e1:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_EXTRA)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCountLimit(1,c:GetOriginalCode())
e1:SetCondition(cm.GCSpiritcon)
e1:SetOperation(cm.GCSpiritop(gc))
c:RegisterEffect(e1)
end
function cm.GCSpiritfil(c)
return c:IsType(TYPE_SPIRIT) and c:IsLevelAbove(5) and not c:IsPublic()
end
function cm.GCSpiritcon(e,tp)
Duel.DisableActionCheck(true)
local dc=Duel.CreateToken(tp,e:GetHandler():GetOriginalCode()+50)
Duel.DisableActionCheck(false)
local ph=Duel.GetCurrentPhase()
return dc:GetActivateEffect():IsActivatable(tp) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsPlayerCanSpecialSummonMonster(tp,53735000,0,TYPES_TOKEN_MONSTER,0,0,1,RACE_FIEND,ATTRIBUTE_LIGHT) and Duel.IsExistingMatchingCard(cm.GCSpiritfil,tp,LOCATION_HAND,0,1,nil) and Duel.GetTurnPlayer()==tp and (ph==PHASE_MAIN1 or ph==PHASE_MAIN2)
end
function cm.GCSpiritop(gc)
return
function(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local token=Duel.CreateToken(tp,53735000)
Duel.SpecialSummon(token,0,tp,tp,false,false,POS_FACEUP)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM)
local cg=Duel.SelectMatchingCard(tp,cm.GCSpiritfil,tp,LOCATION_HAND,0,1,1,nil)
Duel.ConfirmCards(1-tp,cg)
local pc=cg:GetFirst()
local ep=Effect.CreateEffect(c)
ep:SetDescription(aux.Stringid(c:GetOriginalCode(),0))
ep:SetType(EFFECT_TYPE_SINGLE)
ep:SetCode(EFFECT_PUBLIC)
ep:SetProperty(EFFECT_FLAG_CLIENT_HINT)
ep:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
pc:RegisterEffect(ep)
pc:RegisterFlagEffect(53735000,RESET_EVENT+0xff0000+RESET_PHASE+PHASE_END,0,1)
Duel.MoveToField(c,tp,tp,LOCATION_SZONE,POS_FACEUP,true)
local et=Effect.CreateEffect(c)
et:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
et:SetRange(LOCATION_SZONE)
et:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
et:SetLabelObject(pc)
et:SetCode(EVENT_CUSTOM+c:GetOriginalCode())
et:SetCost(cm.GCSpiritcost)
et:SetOperation(cm.GCSpiritac(gc))
et:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET)
c:RegisterEffect(et)
c:CreateEffectRelation(et)
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetCode(EFFECT_CHANGE_TYPE)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e0:SetValue(0x20002)
e0:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET)
c:RegisterEffect(e0,true)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetCode(EVENT_CHAIN_NEGATED)
e1:SetCountLimit(1)
e1:SetLabelObject(et)
e1:SetCondition(function(e,tp,eg,ep,ev,re,r,rp) return re==te end)
e1:SetOperation(cm.GCSpiritreset1)
e1:SetReset(RESET_CHAIN)
Duel.RegisterEffect(e1,tp)
Duel.Readjust()
Duel.RaiseSingleEvent(c,EVENT_CUSTOM+c:GetOriginalCode(),re,r,rp,ep,ev)
end
end
function cm.GCSpiritreset1(e,tp,eg,ep,ev,re,r,rp)
local rc=re:GetHandler()
if rc:IsRelateToEffect(re) then
rc:CancelToGrave(false)
end
end
function cm.GCSpiritcost(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return true end
e:SetType(EFFECT_TYPE_ACTIVATE)
local c=e:GetHandler()
c:SetStatus(STATUS_EFFECT_ENABLED,false)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_REMAIN_FIELD)
e1:SetProperty(EFFECT_FLAG_OATH+EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_CHAIN)
c:RegisterEffect(e1)
end
function cm.GCSpiritac(gc)
return
function(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_FIELD)
e0:SetRange(LOCATION_SZONE)
e0:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e0:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e0:SetTargetRange(1,0)
e0:SetTarget(function(e,c,sump,sumtype,sumpos,targetp)return c:IsLocation(LOCATION_EXTRA)end)
e0:SetReset(RESET_EVENT+RESETS_STANDARD)
c:RegisterEffect(e0)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetLabelObject(e:GetLabelObject())
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetCondition(cm.GCSpiritregcon1)
e1:SetOperation(cm.GCSpiritregop1(gc))
Duel.RegisterEffect(e1,tp)
local ex=e1:Clone()
ex:SetCode(EVENT_MSET)
ex:SetCondition(cm.GCSpiritregconx)
c:RegisterEffect(ex)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_SUMMON_NEGATED)
e2:SetOperation(cm.GCSpiritreset2)
e2:SetLabelObject(e1)
e2:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e2,tp)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EVENT_CUSTOM+c:GetOriginalCode())
e3:SetOperation(cm.GCSpiritreset2)
e3:SetLabelObject(e2)
e3:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e3,tp)
c:SetStatus(STATUS_EFFECT_ENABLED,true)
e:Reset()
end
end
function cm.GCSpiritregcon1(e,tp,eg,ep,ev,re,r,rp)
local tc,pc=eg:GetFirst(),e:GetLabelObject()
return pc and tc==pc and tc:GetFlagEffect(53735000)>0 and tc:IsPreviousLocation(LOCATION_HAND) and tc:IsPreviousPosition(POS_FACEUP) and tc:IsSummonType(SUMMON_TYPE_ADVANCE)
end
function cm.GCSpiritregconx(e,tp,eg,ep,ev,re,r,rp)
local tc,pc=eg:GetFirst(),e:GetLabelObject()
return pc and tc==pc and tc:GetFlagEffect(53735000)>0 and tc:IsPreviousLocation(LOCATION_HAND) and tc:IsPreviousPosition(POS_FACEUP) and tc:GetMaterialCount()~=0
end
function cm.GCSpiritregop1(gc)
return
function(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
Duel.RaiseEvent(eg,EVENT_CUSTOM+c:GetOriginalCode(),re,r,rp,ep,ev)
local ec=eg:GetFirst()
ec:ResetFlagEffect(53735000)
ec:RegisterFlagEffect(53735000,RESET_EVENT+0x14c0000,0,0)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_TO_HAND)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetRange(LOCATION_SZONE)
e1:SetLabelObject(ec)
e1:SetCondition(cm.GCSpiritregcon2)
e1:SetOperation(cm.GCSpiritregop2(gc))
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
c:RegisterEffect(e1)
e:Reset()
end
end
function cm.GCSpiritregfil(c,tc)
return c:IsPreviousLocation(LOCATION_MZONE) and (c:IsSummonType(SUMMON_TYPE_ADVANCE) or c:GetMaterialCount()~=0) and c:IsType(TYPE_SPIRIT) and c:GetFlagEffect(53735000)>0
end
function cm.GCSpiritregcon2(e,tp,eg,ep,ev,re,r,rp)
return e:GetLabelObject() and eg:IsExists(cm.GCSpiritregfil,1,nil,e:GetLabelObject())
end
function cm.GCSpiritregop2(gc)
return
function(e,tp,eg,ep,ev,re,r,rp)
eg:GetFirst():ResetFlagEffect(53735000)
local c=e:GetHandler()
local e1=gc(c)
--e1:SetDescription(aux.Stringid(53702600,4))
--e1:SetProperty(EFFECT_FLAG_CLIENT_HINT)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
c:RegisterFlagEffect(0,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,0,0,aux.Stringid(53702600,4))
e:Reset()
end
end
function cm.GCSpiritreset2(e,tp,eg,ep,ev,re,r,rp)
if e:GetLabelObject() then e:GetLabelObject():Reset() end
e:Reset()
end
function cm.GCSpiritN(c)
c:EnableReviveLimit()
local e0=Effect.CreateEffect(c)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetCode(EFFECT_SPSUMMON_CONDITION)
e0:SetValue(aux.FALSE)
c:RegisterEffect(e0)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(53702600,5))
e1:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_EXTRA)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCountLimit(1,c:GetOriginalCode())
e1:SetCondition(cm.GCSpiritNcon)
e1:SetOperation(cm.GCSpiritNop)
c:RegisterEffect(e1)
end
function cm.GCSpiritNcon(e,tp)
Duel.DisableActionCheck(true)
local dc=Duel.CreateToken(tp,e:GetHandler():GetOriginalCode()+50)
Duel.DisableActionCheck(false)
local ph=Duel.GetCurrentPhase()
return dc:GetActivateEffect():IsActivatable(tp) and Duel.GetTurnPlayer()==tp and (ph==PHASE_MAIN1 or ph==PHASE_MAIN2)
end
function cm.GCSpiritNop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
Duel.MoveToField(c,tp,tp,LOCATION_SZONE,POS_FACEUP,true)
local dc=Duel.CreateToken(tp,c:GetOriginalCode()+50)
local et=dc:GetActivateEffect()
et:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
et:SetRange(LOCATION_SZONE)
et:SetCode(c:GetOriginalCode())
et:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET)
c:RegisterEffect(et)
c:CreateEffectRelation(et)
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetCode(EFFECT_CHANGE_TYPE)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e0:SetValue(TYPE_SPELL)
e0:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET)
c:RegisterEffect(e0,true)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetCode(EVENT_CHAIN_NEGATED)
e1:SetCountLimit(1)
e1:SetLabelObject(et)
e1:SetCondition(function(e,tp,eg,ep,ev,re,r,rp) return re==te end)
e1:SetOperation(cm.GCSpiritreset1)
e1:SetReset(RESET_CHAIN)
Duel.RegisterEffect(e1,tp)
Duel.Readjust()
Duel.RaiseSingleEvent(c,c:GetOriginalCode(),re,r,rp,ep,ev)
end
function cm.NecroceanSynchro(c) function cm.NecroceanSynchro(c)
c:EnableReviveLimit() c:EnableReviveLimit()
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
...@@ -3667,40 +2588,6 @@ function cm.NecroceanSLevel(e,tp,eg,ep,ev,re,r,rp) ...@@ -3667,40 +2588,6 @@ function cm.NecroceanSLevel(e,tp,eg,ep,ev,re,r,rp)
return true return true
end end
end end
--[[function cm.Necroceansyncon(f1,f2,f3,f4,minc,maxc,gc,check,wild_check)
return function(e,c,smat,mg1,min,max)
if c==nil then return true end
if c:IsType(TYPE_PENDULUM) and c:IsFaceup() then return false end
local minc=minc
local maxc=maxc
if min then
if min>minc then minc=min end
if max<maxc then maxc=max end
if minc>maxc then return false end
end
local tp=c:GetControler()
local mg
local mgchk=false
if mg1 then
mg=mg1
mgchk=true
else
mg=aux.GetSynMaterials(tp,c,e,check)
end
if smat~=nil then mg:AddCard(smat) end
return mg:IsExists(cm.NecroceanSynMixFilter1,1,nil,f1,f2,f3,f4,minc,maxc,c,mg,smat,gc,mgchk)
end
end
function cm.Necroceansyncon2(...)--deserted
local f1=aux.GetSynMaterials
local f2=aux.SynMixFilter1
aux.GetSynMaterials=cm.NecroceanGetSynMaterials
aux.SynMixFilter1=cm.NecroceanSynMixFilter1
local res=aux.SynMixCondition(aux.Tuner(nil),aux.NonTuner(nil),nil,nil,0,99,nil)(...)
aux.GetSynMaterials=f1
aux.SynMixFilter1=f2
return res
end--]]
function cm.Necroceansyntg(f1,f2,f3,f4,minc,maxc,gc) function cm.Necroceansyntg(f1,f2,f3,f4,minc,maxc,gc)
return function(e,tp,eg,ep,ev,re,r,rp,chk,c,smat,mg1,min,max) return function(e,tp,eg,ep,ev,re,r,rp,chk,c,smat,mg1,min,max)
local minc=minc local minc=minc
...@@ -3769,34 +2656,6 @@ function cm.Necroceansyntg(f1,f2,f3,f4,minc,maxc,gc) ...@@ -3769,34 +2656,6 @@ function cm.Necroceansyntg(f1,f2,f3,f4,minc,maxc,gc)
return res return res
end end
end end
--[[function cm.Necroceansyntg2(...)-
local f1=aux.GetSynMaterials
local f2=aux.SynMixFilter1
local f3=aux.SynMixFilter2
local f4=aux.SynMixFilter3
local f5=aux.SynMixFilter4
local f6=aux.SynMixCheck
local f7=aux.SynMixCheckRecursive
local f8=aux.SynMixCheckGoal
aux.GetSynMaterials=cm.NecroceanGetSynMaterials
aux.SynMixFilter1=cm.NecroceanSynMixFilter1
aux.SynMixFilter2=cm.NecroceanSynMixFilter2
aux.SynMixFilter3=cm.NecroceanSynMixFilter3
aux.SynMixFilter4=cm.NecroceanSynMixFilter4
aux.SynMixCheck=cm.NecroceanSynMixCheck
aux.SynMixCheckRecursive=cm.NecroceanSynMixCheckRecursive
aux.SynMixCheckGoal=cm.NecroceanSynMixCheckGoal
local res=aux.SynMixTarget(aux.Tuner(nil),aux.NonTuner(nil),nil,nil,0,99,nil)(...)
aux.GetSynMaterials=f1
aux.SynMixFilter1=f2
aux.SynMixFilter2=f3
aux.SynMixFilter3=f4
aux.SynMixFilter4=f5
aux.SynMixCheck=f6
aux.SynMixCheckRecursive=f7
aux.SynMixCheckGoal=f8
return res
end--]]
function cm.Necroceansynop(f1,f2,f3,f4,minct,maxc,gc) function cm.Necroceansynop(f1,f2,f3,f4,minct,maxc,gc)
return function(e,tp,eg,ep,ev,re,r,rp,c,smat,mg,min,max) return function(e,tp,eg,ep,ev,re,r,rp,c,smat,mg,min,max)
local g=e:GetLabelObject() local g=e:GetLabelObject()
...@@ -3822,182 +2681,6 @@ function cm.Necroceansynop(f1,f2,f3,f4,minct,maxc,gc) ...@@ -3822,182 +2681,6 @@ function cm.Necroceansynop(f1,f2,f3,f4,minct,maxc,gc)
end end
end end
end end
--[[function cm.Necroceansfilter(c,syncard,e,tp,check,wild_check)
if not wild_check then
if c:IsHasEffect(EFFECT_CANNOT_REMOVE) then return false end
local re1={Duel.IsPlayerAffectedByEffect(tp,EFFECT_CANNOT_REMOVE)}
local res=true
for _,v1 in ipairs(re1) do
local tg=v1:GetTarget()
if not tg or tg(v1,c,tp,REASON_MATERIAL+REASON_SYNCHRO,e) then res=false end
end
if not res then return false end
end
local flag=c:IsLevel(0)
if c:IsControler(tp) and flag and not check then return false end
if not wild_check then
local re2={c:IsHasEffect(EFFECT_CANNOT_BE_SYNCHRO_MATERIAL)}
for _,v2 in ipairs(re2) do
local val=v2:GetValue()
if aux.GetValueType(val)=="number" then flag=false elseif val(v2,c) then flag=false end
end
end
return c:IsCanBeSynchroMaterial(syncard) or flag
end
function cm.NecroceanGetSynMaterials(tp,syncard,e,check,wild_check)
local mg=Duel.GetMatchingGroup(aux.SynMaterialFilter,tp,LOCATION_MZONE,LOCATION_MZONE,nil,syncard)
if mg:IsExists(Card.GetHandSynchro,1,nil) then
local mg2=Duel.GetMatchingGroup(Card.IsCanBeSynchroMaterial,tp,LOCATION_HAND,0,nil,syncard)
if mg2:GetCount()>0 then mg:Merge(mg2) end
end
local mg3=Duel.GetMatchingGroup(Card.IsType,tp,LOCATION_GRAVE,0,nil,TYPE_MONSTER)
if not mg3:IsExists(aux.NOT(Card.IsType),1,nil,TYPE_TUNER) then
local exg=Duel.GetMatchingGroup(cm.Necroceansfilter,tp,LOCATION_GRAVE,LOCATION_GRAVE,nil,syncard,e,tp,check,wild_check)
if exg:GetCount()>0 then mg:Merge(exg) end
end
return mg
end
function cm.NecroceanSynMixFilter1(c,f1,f2,f3,f4,minc,maxc,syncard,mg,smat,gc,mgchk)
return (not f1 or f1(c,syncard)) and mg:IsExists(cm.NecroceanSynMixFilter2,1,c,f2,f3,f4,minc,maxc,syncard,mg,smat,c,gc,mgchk)
end
function cm.NecroceanSynMixFilter2(c,f2,f3,f4,minc,maxc,syncard,mg,smat,c1,gc,mgchk)
if f2 then
return f2(c,syncard,c1)
and (mg:IsExists(cm.NecroceanSynMixFilter3,1,Group.FromCards(c1,c),f3,f4,minc,maxc,syncard,mg,smat,c1,c,gc,mgchk)
or minc==0 and cm.NecroceanSynMixFilter4(c,nil,1,1,syncard,mg,smat,c1,nil,nil,gc,mgchk))
else
return mg:IsExists(cm.NecroceanSynMixFilter4,1,c1,f4,minc,maxc,syncard,mg,smat,c1,nil,nil,gc,mgchk)
end
end
function cm.NecroceanSynMixFilter3(c,f3,f4,minc,maxc,syncard,mg,smat,c1,c2,gc,mgchk)
if f3 then
return f3(c,syncard,c1,c2)
and (mg:IsExists(cm.NecroceanSynMixFilter4,1,Group.FromCards(c1,c2,c),f4,minc,maxc,syncard,mg,smat,c1,c2,c,gc,mgchk)
or minc==0 and cm.NecroceanSynMixFilter4(c,nil,1,1,syncard,mg,smat,c1,c2,nil,gc,mgchk))
else
return mg:IsExists(cm.NecroceanSynMixFilter4,1,Group.FromCards(c1,c2),f4,minc,maxc,syncard,mg,smat,c1,c2,nil,gc,mgchk)
end
end
function cm.NecroceanSynMixFilter4(c,f4,minc,maxc,syncard,mg1,smat,c1,c2,c3,gc,mgchk)
if f4 and not f4(c,syncard,c1,c2,c3) then return false end
local sg=Group.FromCards(c1,c)
sg:AddCard(c1)
if c2 then sg:AddCard(c2) end
if c3 then sg:AddCard(c3) end
local mg=mg1:Clone()
if f4 then
mg=mg:Filter(f4,sg,syncard)
else
mg:Sub(sg)
end
return cm.NecroceanSynMixCheck(mg,sg,minc-1,maxc-1,syncard,smat,gc,mgchk)
end
function cm.NecroceanSynMixCheck(mg,sg1,minc,maxc,syncard,smat,gc,mgchk)
local tp=syncard:GetControler()
local sg=Group.CreateGroup()
if minc<=0 and cm.NecroceanSynMixCheckGoal(tp,sg1,0,0,syncard,sg,smat,gc,mgchk) then return true end
if maxc==0 then return false end
return mg:IsExists(cm.NecroceanSynMixCheckRecursive,1,nil,tp,sg,mg,0,minc,maxc,syncard,sg1,smat,gc,mgchk)
end
function cm.NecroceanSynMixCheckRecursive(c,tp,sg,mg,ct,minc,maxc,syncard,sg1,smat,gc,mgchk)
sg:AddCard(c)
ct=ct+1
local res=cm.NecroceanSynMixCheckGoal(tp,sg,minc,ct,syncard,sg1,smat,gc,mgchk)
or (ct<maxc and mg:IsExists(cm.NecroceanSynMixCheckRecursive,1,sg,tp,sg,mg,ct,minc,maxc,syncard,sg1,smat,gc,mgchk))
sg:RemoveCard(c)
ct=ct-1
return res
end
function cm.NecroceanGetSynchroLevel(c,syncard,wild_check)
local slv=c:GetSynchroLevel(syncard)
if c:IsLocation(LOCATION_GRAVE) and c:IsLevel(0) then slv=1 end
return slv
end
function cm.NecroceanGetSynchroLevelFlowerCardian(c,syncard)
local slv=2
--if c:IsSynchroType(TYPE_SPELL+TYPE_TRAP) and c:IsLocation(LOCATION_GRAVE) then slv=1 end
return slv
end
function cm.NecroceanSynMixCheckGoal(tp,sg,minc,ct,syncard,sg1,smat,gc,mgchk)
if ct<minc then return false end
local g=sg:Clone()
g:Merge(sg1)
if Duel.GetLocationCountFromEx(tp,tp,g,syncard)<=0 then return false end
if gc and not gc(g) then return false end
if smat and not g:IsContains(smat) then return false end
if not Auxiliary.MustMaterialCheck(g,tp,EFFECT_MUST_BE_SMATERIAL) then return false end
local hg=g:Filter(Card.IsLocation,nil,LOCATION_HAND)
local hct=hg:GetCount()
if hct>0 and not mgchk then
local found=false
for c in aux.Next(g) do
local he,hf,hmin,hmax=c:GetHandSynchro()
if he then
found=true
if hf and hg:IsExists(aux.SynLimitFilter,1,c,hf,he,syncard) then return false end
if (hmin and hct<hmin) or (hmax and hct>hmax) then return false end
end
end
if not found then return false end
end
for c in aux.Next(g) do
local le,lf,lloc,lmin,lmax=c:GetTunerLimit()
if le then
local lct=g:GetCount()-1
if lloc then
local llct=g:FilterCount(Card.IsLocation,c,lloc)
if llct~=lct then return false end
end
if lf and g:IsExists(aux.SynLimitFilter,1,c,lf,le,syncard) then return false end
if (lmin and lct<lmin) or (lmax and lct>lmax) then return false end
end
end
return true
end--]]
--[[function cm.NecroceanSynchro(c)
c:EnableReviveLimit()
aux.AddSynchroMixProcedure(c,aux.Tuner(nil),aux.NonTuner(nil),nil,nil,0,99)
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e5:SetCode(EVENT_PHASE_START+PHASE_DRAW)
e5:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_CANNOT_DISABLE)
e5:SetRange(0xff)
e5:SetOperation(cm.NecroceanSLevel)
e5:SetCountLimit(1,EFFECT_COUNT_CODE_DUEL+53752000)
c:RegisterEffect(e5)
end
function cm.NecroceanSLevel(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetFlagEffect(0,53752000)>0 then return end
Duel.RegisterFlagEffect(0,53752000,0,0,0)
func1=Card.IsCanBeSynchroMaterial
Card.IsCanBeSynchroMaterial=function(tc,sc,...)
if tc:IsLocation(LOCATION_GRAVE) and sc and sc.NecroceanSyn and sc.GuyWildCard then
if sc and tc:IsLocation(LOCATION_MZONE) and tc:GetControler()~=sc:GetControler() and not tc:IsHasEffect(EFFECT_SYNCHRO_MATERIAL) then return false end
return true
else
return func1(tc,sc,...)
end
end
func2=Card.GetSynchroLevel
Card.GetSynchroLevel=function(tc,sc)
if sc and sc.NecroceanSyn and sc.GuyWildCard and tc:IsLocation(LOCATION_GRAVE) and tc:IsLevel(0) then
return 1
else
return func2(tc,sc)
end
end
func3=aux.GetSynMaterials
aux.GetSynMaterials=function(tp,sc)
local exg=Group.CreateGroup()
if sc and sc.NecroceanSyn and sc.GuyWildCard then
local mg3=Duel.GetMatchingGroup(Card.IsType,tp,LOCATION_GRAVE,0,nil,TYPE_MONSTER)
if not mg3:IsExists(aux.NOT(Card.IsType),1,nil,TYPE_TUNER) then
exg=Duel.GetMatchingGroup(Card.IsCanBeSynchroMaterial,tp,LOCATION_GRAVE,LOCATION_GRAVE,nil,sc)
end
end
return Group.__add(func3(tp,sc),exg)
end
end--]]
function Intersection(t1, t2) function Intersection(t1, t2)
local ret = {} local ret = {}
for k, v1 in pairs(t1) do for k, v1 in pairs(t1) do
...@@ -4028,13 +2711,6 @@ function cm.MultiDual(c) ...@@ -4028,13 +2711,6 @@ function cm.MultiDual(c)
e2:SetOperation(cm.MultiDualCheck) e2:SetOperation(cm.MultiDualCheck)
e2:SetCountLimit(1,EFFECT_COUNT_CODE_DUEL+53753000) e2:SetCountLimit(1,EFFECT_COUNT_CODE_DUEL+53753000)
c:RegisterEffect(e2) c:RegisterEffect(e2)
--[[local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_SUMMON_COST)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_SINGLE_RANGE)
e3:SetRange(LOCATION_MZONE)
e3:SetOperation(cm.MultiDualReset)
c:RegisterEffect(e3)--]]
local e4=Effect.CreateEffect(c) local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE) e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetCode(EFFECT_MULTI_SUMMONABLE) e4:SetCode(EFFECT_MULTI_SUMMONABLE)
...@@ -4516,13 +3192,6 @@ function cm.TentuScout(c) ...@@ -4516,13 +3192,6 @@ function cm.TentuScout(c)
e1:SetCode(EFFECT_SPSUMMON_CONDITION) e1:SetCode(EFFECT_SPSUMMON_CONDITION)
e1:SetValue(aux.FALSE) e1:SetValue(aux.FALSE)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--[[local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_TRIBUTE_LIMIT)
e2:SetValue(function(e,c)
return (not c:IsAttribute(e:GetHandler():GetAttribute()) and not c:IsType(TYPE_SPIRIT)) or (c:IsFacedown() and c:IsControler(1-e:GetHandlerPlayer()))
end)
c:RegisterEffect(e2)--]]
local e3=Effect.CreateEffect(c) local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE) e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE) e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
......
...@@ -62,7 +62,7 @@ function c71401013.op2(e,tp,eg,ep,ev,re,r,rp) ...@@ -62,7 +62,7 @@ function c71401013.op2(e,tp,eg,ep,ev,re,r,rp)
end end
local dg=Duel.GetDecktopGroup(tp,5) local dg=Duel.GetDecktopGroup(tp,5)
if Duel.IsExistingMatchingCard(c71401013.filter2,tp,LOCATION_ONFIELD,0,1,nil) and dg:FilterCount(Card.IsAbleToRemove,nil,tp,POS_FACEDOWN)==5 and Duel.SelectYesNo(tp,aux.Stringid(71401013,1)) then if Duel.IsExistingMatchingCard(c71401013.filter2,tp,LOCATION_ONFIELD,0,1,nil) and dg:FilterCount(Card.IsAbleToRemove,nil,tp,POS_FACEDOWN)==5 and Duel.SelectYesNo(tp,aux.Stringid(71401013,1)) then
Duel.Remove(dg,POS_FACEDOWN,REASON_EFFECT) Duel.Remove(dg,POS_FACEUP,REASON_EFFECT)
end end
end end
end end
\ No newline at end of file
...@@ -109,6 +109,7 @@ function c71401016.tg3(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -109,6 +109,7 @@ function c71401016.tg3(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.IsExistingMatchingCard(c71401016.filter3,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,nil,e,tp) Duel.IsExistingMatchingCard(c71401016.filter3,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,nil,e,tp)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,LOCATION_EXTRA,0,1,nil,tp,POS_FACEDOWN) and Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,LOCATION_EXTRA,0,1,nil,tp,POS_FACEDOWN)
end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,tp,LOCATION_EXTRA) Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,tp,LOCATION_EXTRA)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE+LOCATION_REMOVED) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE+LOCATION_REMOVED)
end end
......
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