Commit ac2871ba authored by POLYMER's avatar POLYMER

fix

parent c92fd63c
......@@ -32,6 +32,11 @@ function cm.initial_effect(c)
e2:SetTarget(cm.actarget)
e2:SetOperation(cm.costop)
c:RegisterEffect(e2)
local e4=e3:Clone()
e4:SetType(EFFECT_TYPE_QUICK_O)
e4:SetCondition(cm.condition2)
e4:SetCost(cm.cost2)
c:RegisterEffect(e4)
--type
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_SINGLE)
......@@ -59,15 +64,39 @@ function cm.initial_effect(c)
end
end
end
local KOISHI_CHECK=false
if Card.SetCardData then KOISHI_CHECK=true end
function cm.valcheck(e,c)
local g=c:GetMaterial()
if #g>0 then e:SetLabel(g:GetClassCount(Card.GetCode)) end
end
function cm.condition2(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetLocationCount(tp,LOCATION_SZONE)<=0
end
function cm.cost2(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then
local res=true
if KOISHI_CHECK and cm[tp] then
res=cm[tp]:GetActivateEffect():IsActivatable(tp,true)
else
res=(c:CheckActivateEffect(false,false,false)~=nil)
end
return res
end
end
function cm.filter(c)
return c.traveler_saga and c:IsAbleToDeckAsCost()
end
function cm.fselect(g)
return g:IsExists(Card.IsLocation,1,nil,LOCATION_SZONE)
end
function cm.costchk(e,te,tp)
return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_ONFIELD+LOCATION_GRAVE,0,3,nil)
local g=Duel.GetMatchingGroup(cm.filter,tp,LOCATION_ONFIELD+LOCATION_GRAVE,0,nil)
if te:IsHasType(EFFECT_TYPE_ACTIVATE) then
return #g>=3
end
return #g>=3 and g:IsExists(Card.IsLocation,1,nil,LOCATION_SZONE)
end
function cm.actarget(e,te,tp)
e:SetLabelObject(te)
......@@ -76,7 +105,12 @@ end
function cm.costop(e,tp,eg,ep,ev,re,r,rp)
local te=e:GetLabelObject()
local c=e:GetHandler()
local g=Duel.SelectMatchingCard(tp,cm.filter,tp,LOCATION_ONFIELD+LOCATION_GRAVE,0,3,3,nil)
local g=Duel.GetMatchingGroup(cm.filter,tp,LOCATION_ONFIELD+LOCATION_GRAVE,0,nil)
if te:IsHasType(EFFECT_TYPE_ACTIVATE) then
g=g:Select(tp,3,3,nil)
else
g=g:SelectSubGroup(tp,cm.fselect,false,3,3)
end
local cg=g:Filter(Card.IsFacedown,nil)
if #cg>0 then Duel.ConfirmCards(1-c:GetControler(),cg) end
c:SetMaterial(g)
......@@ -85,12 +119,19 @@ function cm.costop(e,tp,eg,ep,ev,re,r,rp)
Duel.MoveToField(c,tp,tp,LOCATION_SZONE,POS_FACEUP,false)
cm.activate_sequence[te]=c:GetSequence()
e:GetHandler():CreateEffectRelation(te)
local c=e:GetHandler()
local ev0=Duel.GetCurrentChain()+1
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetCode(EVENT_CHAIN_SOLVING)
if te:IsHasType(EFFECT_TYPE_QUICK_O) then
c:CancelToGrave(false)
local te2=te:Clone()
e:SetLabelObject(te2)
te:SetType(26)
c:RegisterEffect(te2,true)
e1:SetLabel(1)
end
e1:SetCountLimit(1)
e1:SetCondition(function(e,tp,eg,ep,ev,re,r,rp) return ev==ev0 end)
e1:SetOperation(cm.rsop)
......@@ -108,6 +149,7 @@ function cm.rsop(e,tp,eg,ep,ev,re,r,rp)
if e:GetCode()==EVENT_CHAIN_NEGATED and rc:IsRelateToEffect(re) and not (rc:IsOnField() and rc:IsFacedown()) then
rc:SetStatus(STATUS_ACTIVATE_DISABLED,true)
end
if e:GetLabel()>0 then re:Reset() end
end
function cm.spfilter(c,e,tp)
return c:IsCode(11451406) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
......
......@@ -46,6 +46,7 @@ function cm.initial_effect(c)
c:RegisterEffect(e5)
if not cm.global_check then
cm.global_check=true
cm.activate_sequence={}
local ge0=Effect.CreateEffect(c)
ge0:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_CANNOT_DISABLE)
ge0:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
......@@ -54,7 +55,6 @@ function cm.initial_effect(c)
Duel.RegisterEffect(ge0,0)
local _GetActivateLocation=Effect.GetActivateLocation
local _GetActivateSequence=Effect.GetActivateSequence
local _GetChainInfo=Duel.GetChainInfo
function Effect.GetActivateLocation(e)
if e:GetDescription()==aux.Stringid(m,0) then
return LOCATION_SZONE
......@@ -67,26 +67,6 @@ function cm.initial_effect(c)
end
return _GetActivateSequence(e)
end
function Duel.GetChainInfo(ev,...)
local ext_params={...}
if #ext_params==0 then return _GetChainInfo(ev,...) end
local re=_GetChainInfo(ev,CHAININFO_TRIGGERING_EFFECT)
if aux.GetValueType(re)=="Effect" then
local rc=re:GetHandler()
if re:GetDescription()==aux.Stringid(m,0) then
local res={}
for _,ci in ipairs(ext_params) do
if ci==CHAININFO_TYPE or ci==CHAININFO_EXTTYPE then
res[#res+1]=TYPE_SPELL
else
res[#res+1]=_GetChainInfo(ev,ci)
end
end
return table.unpack(res)
end
end
return _GetChainInfo(ev,...)
end
end
end
local KOISHI_CHECK=false
......@@ -196,8 +176,8 @@ function cm.geop(e,tp,eg,ep,ev,re,r,rp)
cm[0]=Duel.CreateToken(0,m)
cm[1]=Duel.CreateToken(1,m)
if KOISHI_CHECK then
cm[0]:SetCardData(CARDDATA_TYPE,TYPE_TRAP)
cm[1]:SetCardData(CARDDATA_TYPE,TYPE_TRAP)
cm[0]:SetCardData(CARDDATA_TYPE,TYPE_QUICKPLAY+TYPE_SPELL)
cm[1]:SetCardData(CARDDATA_TYPE,TYPE_QUICKPLAY+TYPE_SPELL)
end
e:Reset()
end
\ No newline at end of file
......@@ -2,6 +2,7 @@
local cm,m=GetID()
function cm.initial_effect(c)
aux.AddCodeList(c,11451599)
local e0=aux.AddThisCardInGraveAlreadyCheck(c)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
......@@ -26,6 +27,7 @@ function cm.initial_effect(c)
e2:SetCode(EVENT_SUMMON_SUCCESS)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetRange(LOCATION_GRAVE)
e2:SetLabelObject(e0)
e2:SetCondition(cm.adcon2)
e2:SetTarget(cm.adtg2)
e2:SetOperation(cm.adop2)
......@@ -34,7 +36,8 @@ function cm.initial_effect(c)
e5:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e5)
end
function cm.filter(c,tp)
function cm.filter(c,tp,se)
if not (se==nil or c:GetReasonEffect()~=se) then return false end
return c:IsControler(tp)
end
function cm.adcon(e,tp,eg,ep,ev,re,r,rp)
......@@ -72,7 +75,8 @@ function cm.adop(e,tp,eg,ep,ev,re,r,rp)
end
end
function cm.adcon2(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(cm.filter,1,nil,tp)
local se=e:GetLabelObject():GetLabelObject()
return eg:IsExists(cm.filter,1,nil,tp,se)
end
function cm.mfilter(c)
return c:GetLevel()>0 and (c:IsAbleToDeck() or c:IsAbleToHand()) --and c:IsReason(REASON_RELEASE)
......
--潜汐击龙“青翔”
local cm,m=GetID()
function cm.initial_effect(c)
--check
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e0:SetCode(EVENT_REMOVE)
e0:SetCondition(aux.ThisCardInGraveAlreadyCheckReg)
c:RegisterEffect(e0)
--search
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,1))
......@@ -23,6 +29,7 @@ function cm.initial_effect(c)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetRange(LOCATION_HAND+LOCATION_REMOVED)
e2:SetLabelObject(e0)
e2:SetCondition(cm.spcon)
e2:SetTarget(cm.sptg)
e2:SetOperation(cm.spop)
......@@ -71,11 +78,13 @@ function cm.thop(e,tp,eg,ep,ev,re,r,rp)
end
end
end
function cm.spfilter(c,tp)
function cm.spfilter(c,se)
if not (se==nil or c:GetReasonEffect()~=se) then return false end
return c:IsFaceup() and c:IsSetCard(0x9977)
end
function cm.spcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(cm.spfilter,1,nil)
local se=e:GetLabelObject():GetLabelObject()
return eg:IsExists(cm.spfilter,1,nil,se)
end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
......@@ -110,6 +119,7 @@ function cm.spop(e,tp,eg,ep,ev,re,r,rp)
e1:SetOperation(cm.retop)
Duel.RegisterEffect(e1,tp)
if c:IsRelateToEffect(e) then
Duel.BreakEffect()
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
end
......
--怒汐击龙“朱炎”
local cm,m=GetID()
function cm.initial_effect(c)
--check
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e0:SetCode(EVENT_REMOVE)
e0:SetCondition(aux.ThisCardInGraveAlreadyCheckReg)
c:RegisterEffect(e0)
--resp
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,1))
......@@ -24,6 +30,7 @@ function cm.initial_effect(c)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET)
e2:SetRange(LOCATION_HAND+LOCATION_REMOVED)
e2:SetLabelObject(e0)
e2:SetCondition(cm.spcon)
e2:SetTarget(cm.sptg)
e2:SetOperation(cm.spop)
......@@ -55,17 +62,20 @@ function cm.thop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.Remove(tc,POS_FACEUP,REASON_EFFECT)~=0 and c:IsRelateToEffect(e) then
Duel.BreakEffect()
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
end
function cm.refilter(c)
return c:IsFaceup() and c:IsAbleToRemove()
end
function cm.spfilter(c,tp)
function cm.spfilter(c,se)
if not (se==nil or c:GetReasonEffect()~=se) then return false end
return c:IsFaceup() and c:IsSetCard(0x9977)
end
function cm.spcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(cm.spfilter,1,nil)
local se=e:GetLabelObject():GetLabelObject()
return eg:IsExists(cm.spfilter,1,nil,se)
end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local c=e:GetHandler()
......@@ -87,6 +97,7 @@ function cm.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.Remove(tc,POS_FACEUP,REASON_EFFECT)~=0 and c:IsRelateToEffect(e) then
--Duel.BreakEffect()
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
end
\ No newline at end of file
--恐汐击龙“煌枪”
local cm,m=GetID()
function cm.initial_effect(c)
--check
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e0:SetCode(EVENT_REMOVE)
e0:SetCondition(aux.ThisCardInGraveAlreadyCheckReg)
c:RegisterEffect(e0)
--search
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,1))
......@@ -23,6 +29,7 @@ function cm.initial_effect(c)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetRange(LOCATION_HAND+LOCATION_REMOVED)
e2:SetLabelObject(e0)
e2:SetCondition(cm.spcon)
e2:SetTarget(cm.sptg)
e2:SetOperation(cm.spop)
......@@ -78,11 +85,13 @@ function cm.thop(e,tp,eg,ep,ev,re,r,rp)
end
end
end
function cm.spfilter(c,tp)
function cm.spfilter(c,se)
if not (se==nil or c:GetReasonEffect()~=se) then return false end
return c:IsFaceup() and c:IsSetCard(0x9977)
end
function cm.spcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(cm.spfilter,1,nil)
local se=e:GetLabelObject():GetLabelObject()
return eg:IsExists(cm.spfilter,1,nil,se)
end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
......@@ -104,6 +113,7 @@ function cm.spop(e,tp,eg,ep,ev,re,r,rp)
if #g>0 then
Duel.HintSelection(g)
if Duel.Remove(g,POS_FACEUP,REASON_EFFECT)>0 and c:IsRelateToEffect(e) then
Duel.BreakEffect()
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
end
......
--惊汐击龙“碧闪”
local cm,m=GetID()
function cm.initial_effect(c)
--check
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e0:SetCode(EVENT_REMOVE)
e0:SetCondition(aux.ThisCardInGraveAlreadyCheckReg)
c:RegisterEffect(e0)
--resp
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,1))
......@@ -24,6 +30,7 @@ function cm.initial_effect(c)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetRange(LOCATION_HAND+LOCATION_REMOVED)
e2:SetLabelObject(e0)
e2:SetCondition(cm.spcon)
e2:SetCost(cm.spcost)
e2:SetTarget(cm.sptg)
......@@ -56,14 +63,17 @@ function cm.thop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.Remove(tc,POS_FACEUP,REASON_EFFECT)~=0 and c:IsRelateToEffect(e) then
Duel.BreakEffect()
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
end
function cm.spfilter(c,tp)
function cm.spfilter(c,se)
if not (se==nil or c:GetReasonEffect()~=se) then return false end
return c:IsFaceup() and c:IsSetCard(0x9977)
end
function cm.spcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(cm.spfilter,1,nil)
local se=e:GetLabelObject():GetLabelObject()
return eg:IsExists(cm.spfilter,1,nil,se)
end
function cm.costfilter(c)
return c:IsAbleToRemoveAsCost()
......@@ -97,6 +107,7 @@ function cm.spop(e,tp,eg,ep,ev,re,r,rp)
if g:GetCount()>0 and Duel.SendtoHand(g,nil,REASON_EFFECT)>0 then
Duel.ConfirmCards(1-tp,g)
if c:IsRelateToEffect(e) then
--Duel.BreakEffect()
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
end
......
--天汐击龙“白凰”
local cm,m=GetID()
function cm.initial_effect(c)
--check
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e0:SetCode(EVENT_REMOVE)
e0:SetCondition(aux.ThisCardInGraveAlreadyCheckReg)
c:RegisterEffect(e0)
--search
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,1))
......@@ -23,6 +29,7 @@ function cm.initial_effect(c)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetRange(LOCATION_HAND+LOCATION_REMOVED)
e2:SetLabelObject(e0)
e2:SetCondition(cm.spcon)
e2:SetTarget(cm.sptg)
e2:SetOperation(cm.spop)
......@@ -71,11 +78,13 @@ function cm.thop(e,tp,eg,ep,ev,re,r,rp)
end
end
end
function cm.spfilter(c,tp)
function cm.spfilter(c,se)
if not (se==nil or c:GetReasonEffect()~=se) then return false end
return c:IsFaceup() and c:IsSetCard(0x9977)
end
function cm.spcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(cm.spfilter,1,nil)
local se=e:GetLabelObject():GetLabelObject()
return eg:IsExists(cm.spfilter,1,nil,se)
end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
......@@ -97,6 +106,7 @@ function cm.spop(e,tp,eg,ep,ev,re,r,rp)
if #g<=0 then return end
Duel.DisableShuffleCheck()
if Duel.Remove(g,POS_FACEUP,REASON_EFFECT)~=0 and c:IsRelateToEffect(e) then
Duel.BreakEffect()
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
end
\ No newline at end of file
--逆汐击龙“幽影”
local cm,m=GetID()
function cm.initial_effect(c)
--check
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e0:SetCode(EVENT_REMOVE)
e0:SetCondition(aux.ThisCardInGraveAlreadyCheckReg)
c:RegisterEffect(e0)
--resp
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,1))
......@@ -24,6 +30,7 @@ function cm.initial_effect(c)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetRange(LOCATION_HAND+LOCATION_REMOVED)
e2:SetLabelObject(e0)
e2:SetCondition(cm.spcon)
e2:SetCost(cm.spcost)
e2:SetTarget(cm.sptg)
......@@ -56,14 +63,17 @@ function cm.thop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.Remove(tc,POS_FACEUP,REASON_EFFECT)~=0 and c:IsRelateToEffect(e) then
Duel.BreakEffect()
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
end
function cm.spfilter(c,tp)
function cm.spfilter(c,se)
if not (se==nil or c:GetReasonEffect()~=se) then return false end
return c:IsFaceup() and c:IsSetCard(0x9977)
end
function cm.spcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(cm.spfilter,1,nil)
local se=e:GetLabelObject():GetLabelObject()
return eg:IsExists(cm.spfilter,1,nil,se)
end
function cm.costfilter(c)
return c:IsSetCard(0x9977) and c:IsAbleToRemoveAsCost()
......@@ -90,6 +100,7 @@ end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.Draw(tp,1,REASON_EFFECT)>0 and c:IsRelateToEffect(e) then
--Duel.BreakEffect()
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
end
\ No newline at end of file
--冻汐击龙“苍痕”
local cm,m=GetID()
function cm.initial_effect(c)
--xyz summon
--check
local e0=Effect.CreateEffect(c)
e0:SetDescription(1165)
e0:SetType(EFFECT_TYPE_FIELD)
e0:SetCode(EFFECT_SPSUMMON_PROC)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e0:SetRange(LOCATION_EXTRA)
e0:SetCondition(aux.XyzLevelFreeCondition(cm.mfilter,cm.xyzcheck,2,99))
e0:SetTarget(aux.XyzLevelFreeTarget(cm.mfilter,cm.xyzcheck,2,99))
e0:SetOperation(aux.XyzLevelFreeOperation(cm.mfilter,cm.xyzcheck,2,99))
e0:SetValue(SUMMON_TYPE_XYZ)
e0:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e0:SetCode(EVENT_REMOVE)
e0:SetCondition(aux.ThisCardInGraveAlreadyCheckReg)
c:RegisterEffect(e0)
--xyz summon
local e10=Effect.CreateEffect(c)
e10:SetDescription(1165)
e10:SetType(EFFECT_TYPE_FIELD)
e10:SetCode(EFFECT_SPSUMMON_PROC)
e10:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e10:SetRange(LOCATION_EXTRA)
e10:SetCondition(aux.XyzLevelFreeCondition(cm.mfilter,cm.xyzcheck,2,99))
e10:SetTarget(aux.XyzLevelFreeTarget(cm.mfilter,cm.xyzcheck,2,99))
e10:SetOperation(aux.XyzLevelFreeOperation(cm.mfilter,cm.xyzcheck,2,99))
e10:SetValue(SUMMON_TYPE_XYZ)
c:RegisterEffect(e10)
cm[c]=e10
c:EnableReviveLimit()
--effect1
local e1=Effect.CreateEffect(c)
......@@ -94,11 +101,13 @@ function cm.operation(e,tp,eg,ep,ev,re,r,rp)
if flag>0 then c:RemoveOverlayCard(tp,1,1,REASON_EFFECT) end
end
end
function cm.spfilter(c,tp)
function cm.spfilter(c,se)
if not (se==nil or c:GetReasonEffect()~=se) then return false end
return c:IsFaceup() and c:IsSetCard(0x9977)
end
function cm.spcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(cm.spfilter,1,nil)
local se=e:GetLabelObject():GetLabelObject()
return eg:IsExists(cm.spfilter,1,nil,se)
end
function cm.XyzLevelFreeGoal(g,tp,xyzc,gf)
return (not gf or gf(g)) and Duel.GetLocationCountFromEx(tp,tp,g,TYPE_XYZ)>0
......@@ -132,7 +141,7 @@ function cm.XyzLevelFreeCondition(f,gf,minct,maxct)
end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local te=e:GetLabelObject()
local te=c[c]
if chk==0 then return c:IsCanBeSpecialSummoned(te,SUMMON_TYPE_XYZ,tp,true,true) and cm.XyzLevelFreeCondition(cm.mfilter,cm.xyzcheck,2,99)(te,c,nil,2,99) and c:IsAbleToDeck() and c:GetFlagEffect(m-10)==0 end
c:RegisterFlagEffect(m-10,RESET_EVENT+RESETS_STANDARD+RESET_CHAIN,0,1)
Duel.SetOperationInfo(0,CATEGORY_TODECK,c,1,0,0)
......
--轰汐击龙“烈斩”
local cm,m=GetID()
function cm.initial_effect(c)
--xyz summon
--check
local e0=Effect.CreateEffect(c)
e0:SetDescription(1165)
e0:SetType(EFFECT_TYPE_FIELD)
e0:SetCode(EFFECT_SPSUMMON_PROC)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e0:SetRange(LOCATION_EXTRA)
e0:SetCondition(aux.XyzLevelFreeCondition(cm.mfilter,cm.xyzcheck,3,99))
e0:SetTarget(aux.XyzLevelFreeTarget(cm.mfilter,cm.xyzcheck,3,99))
e0:SetOperation(aux.XyzLevelFreeOperation(cm.mfilter,cm.xyzcheck,3,99))
e0:SetValue(SUMMON_TYPE_XYZ)
e0:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e0:SetCode(EVENT_REMOVE)
e0:SetCondition(aux.ThisCardInGraveAlreadyCheckReg)
c:RegisterEffect(e0)
--xyz summon
local e10=Effect.CreateEffect(c)
e10:SetDescription(1165)
e10:SetType(EFFECT_TYPE_FIELD)
e10:SetCode(EFFECT_SPSUMMON_PROC)
e10:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e10:SetRange(LOCATION_EXTRA)
e10:SetCondition(aux.XyzLevelFreeCondition(cm.mfilter,cm.xyzcheck,3,99))
e10:SetTarget(aux.XyzLevelFreeTarget(cm.mfilter,cm.xyzcheck,3,99))
e10:SetOperation(aux.XyzLevelFreeOperation(cm.mfilter,cm.xyzcheck,3,99))
e10:SetValue(SUMMON_TYPE_XYZ)
c:RegisterEffect(e10)
cm[c]=e10
c:EnableReviveLimit()
--effect1
local e1=Effect.CreateEffect(c)
......@@ -84,11 +91,13 @@ function cm.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.Remove(sg1+sg2+sg3,POS_FACEUP,REASON_EFFECT)
end
end
function cm.spfilter(c,tp)
function cm.spfilter(c,se)
if not (se==nil or c:GetReasonEffect()~=se) then return false end
return c:IsFaceup() and c:IsSetCard(0x9977)
end
function cm.spcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(cm.spfilter,1,nil)
local se=e:GetLabelObject():GetLabelObject()
return eg:IsExists(cm.spfilter,1,nil,se)
end
function cm.XyzLevelFreeGoal(g,tp,xyzc,gf)
return (not gf or gf(g)) and Duel.GetLocationCountFromEx(tp,tp,g,TYPE_XYZ)>0
......@@ -122,7 +131,7 @@ function cm.XyzLevelFreeCondition(f,gf,minct,maxct)
end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local te=e:GetLabelObject()
local te=c[c]
if chk==0 then return c:IsCanBeSpecialSummoned(te,SUMMON_TYPE_XYZ,tp,true,true) and cm.XyzLevelFreeCondition(cm.mfilter,cm.xyzcheck,3,99)(te,c,nil,3,99) and c:IsAbleToDeck() and c:GetFlagEffect(m-10)==0 end
c:RegisterFlagEffect(m-10,RESET_EVENT+RESETS_STANDARD+RESET_CHAIN,0,1)
Duel.SetOperationInfo(0,CATEGORY_TODECK,c,1,0,0)
......
--御汐击龙“玄威”
local cm,m=GetID()
function cm.initial_effect(c)
--xyz summon
--check
local e0=Effect.CreateEffect(c)
e0:SetDescription(1165)
e0:SetType(EFFECT_TYPE_FIELD)
e0:SetCode(EFFECT_SPSUMMON_PROC)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e0:SetRange(LOCATION_EXTRA)
e0:SetCondition(aux.XyzLevelFreeCondition(cm.mfilter,cm.xyzcheck,4,99))
e0:SetTarget(aux.XyzLevelFreeTarget(cm.mfilter,cm.xyzcheck,4,99))
e0:SetOperation(aux.XyzLevelFreeOperation(cm.mfilter,cm.xyzcheck,4,99))
e0:SetValue(SUMMON_TYPE_XYZ)
e0:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e0:SetCode(EVENT_REMOVE)
e0:SetCondition(aux.ThisCardInGraveAlreadyCheckReg)
c:RegisterEffect(e0)
--xyz summon
local e10=Effect.CreateEffect(c)
e10:SetDescription(1165)
e10:SetType(EFFECT_TYPE_FIELD)
e10:SetCode(EFFECT_SPSUMMON_PROC)
e10:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e10:SetRange(LOCATION_EXTRA)
e10:SetCondition(aux.XyzLevelFreeCondition(cm.mfilter,cm.xyzcheck,4,99))
e10:SetTarget(aux.XyzLevelFreeTarget(cm.mfilter,cm.xyzcheck,4,99))
e10:SetOperation(aux.XyzLevelFreeOperation(cm.mfilter,cm.xyzcheck,4,99))
e10:SetValue(SUMMON_TYPE_XYZ)
c:RegisterEffect(e10)
cm[c]=e10
c:EnableReviveLimit()
--effect1
local e1=Effect.CreateEffect(c)
......@@ -81,11 +88,13 @@ function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
c:RegisterFlagEffect(m-13,RESET_EVENT+RESETS_STANDARD,0,1,c:GetFieldID())
end
function cm.spfilter(c,tp)
function cm.spfilter(c,se)
if not (se==nil or c:GetReasonEffect()~=se) then return false end
return c:IsFaceup() and c:IsSetCard(0x9977)
end
function cm.spcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(cm.spfilter,1,nil)
local se=e:GetLabelObject():GetLabelObject()
return eg:IsExists(cm.spfilter,1,nil,se)
end
function cm.XyzLevelFreeGoal(g,tp,xyzc,gf)
return (not gf or gf(g)) and Duel.GetLocationCountFromEx(tp,tp,g,TYPE_XYZ)>0
......@@ -119,7 +128,7 @@ function cm.XyzLevelFreeCondition(f,gf,minct,maxct)
end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local te=e:GetLabelObject()
local te=c[c]
if chk==0 then return c:IsCanBeSpecialSummoned(te,SUMMON_TYPE_XYZ,tp,true,true) and cm.XyzLevelFreeCondition(cm.mfilter,cm.xyzcheck,4,99)(te,c,nil,4,99) and c:IsAbleToDeck() and c:GetFlagEffect(m-10)==0 end
c:RegisterFlagEffect(m-10,RESET_EVENT+RESETS_STANDARD+RESET_CHAIN,0,1)
Duel.SetOperationInfo(0,CATEGORY_TODECK,c,1,0,0)
......
--归汐击龙“禁律”
local cm,m=GetID()
function cm.initial_effect(c)
--xyz summon
--check
local e0=Effect.CreateEffect(c)
e0:SetDescription(1165)
e0:SetType(EFFECT_TYPE_FIELD)
e0:SetCode(EFFECT_SPSUMMON_PROC)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e0:SetRange(LOCATION_EXTRA)
e0:SetCondition(aux.XyzLevelFreeCondition(cm.mfilter,cm.lvcheck,2,99))
e0:SetTarget(aux.XyzLevelFreeTarget(cm.mfilter,cm.lvcheck,2,99))
e0:SetOperation(aux.XyzLevelFreeOperation(cm.mfilter,cm.lvcheck,2,99))
e0:SetValue(SUMMON_TYPE_XYZ)
e0:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e0:SetCode(EVENT_REMOVE)
e0:SetCondition(aux.ThisCardInGraveAlreadyCheckReg)
c:RegisterEffect(e0)
--xyz summon
local e10=Effect.CreateEffect(c)
e10:SetDescription(1165)
e10:SetType(EFFECT_TYPE_FIELD)
e10:SetCode(EFFECT_SPSUMMON_PROC)
e10:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e10:SetRange(LOCATION_EXTRA)
e10:SetCondition(aux.XyzLevelFreeCondition(cm.mfilter,cm.lvcheck,2,99))
e10:SetTarget(aux.XyzLevelFreeTarget(cm.mfilter,cm.lvcheck,2,99))
e10:SetOperation(aux.XyzLevelFreeOperation(cm.mfilter,cm.lvcheck,2,99))
e10:SetValue(SUMMON_TYPE_XYZ)
c:RegisterEffect(e10)
cm[c]=e10
c:EnableReviveLimit()
--effect1
local e1=Effect.CreateEffect(c)
......@@ -55,7 +62,7 @@ function cm.mfilter(c,xyzc)
return c:IsXyzType(TYPE_MONSTER) and (c:IsRank(9) or (c:IsXyzLevel(xyzc,9) and xyzc:GetFlagEffect(m-17)>0))
end
function cm.spfilter2(c,e,tp,mc)
return c:IsSetCard(0x9977) and c:IsType(TYPE_XYZ) and c:IsRank(9) and mc:IsCanBeXyzMaterial(c) and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_XYZ,tp,false,false) and Duel.GetLocationCountFromEx(tp,tp,mc,c)>0
return c:IsRace(RACE_DRAGON) and c:IsType(TYPE_XYZ) and c:IsRank(9) and mc:IsCanBeXyzMaterial(c) and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_XYZ,tp,false,false) and Duel.GetLocationCountFromEx(tp,tp,mc,c)>0
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return not eg:IsContains(e:GetHandler())
......@@ -85,11 +92,13 @@ function cm.operation(e,tp,eg,ep,ev,re,r,rp)
end
end
end
function cm.spfilter(c,tp)
return c:IsFaceup() and c:IsRace(RACE_DRAGON) --c:IsSetCard(0x9977)
function cm.spfilter(c,se)
if not (se==nil or c:GetReasonEffect()~=se) then return false end
return c:IsFaceup() and c:IsSetCard(0x9977)
end
function cm.spcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(cm.spfilter,1,nil)
local se=e:GetLabelObject():GetLabelObject()
return eg:IsExists(cm.spfilter,1,nil,se)
end
function cm.XyzLevelFreeGoal(g,tp,xyzc,gf)
return (not gf or gf(g)) and Duel.GetLocationCountFromEx(tp,tp,g,TYPE_XYZ)>0
......@@ -126,7 +135,7 @@ function cm.XyzLevelFreeCondition(f,gf,minct,maxct)
end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local te=e:GetLabelObject()
local te=c[c]
if chk==0 then
c:RegisterFlagEffect(m-17,0,0,1)
local res=(c:IsCanBeSpecialSummoned(te,SUMMON_TYPE_XYZ,tp,true,true) and cm.XyzLevelFreeCondition(cm.mfilter,cm.lvcheck,2,99)(te,c,nil,2,99) and c:IsAbleToDeck() and c:GetFlagEffect(m-16)==0)
......
--汐击龙的汐征
local cm,m=GetID()
function cm.initial_effect(c)
--check
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e0:SetCode(EVENT_REMOVE)
e0:SetCondition(aux.ThisCardInGraveAlreadyCheckReg)
c:RegisterEffect(e0)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,2))
......@@ -19,6 +25,7 @@ function cm.initial_effect(c)
e4:SetCode(EVENT_SPSUMMON_SUCCESS)
e4:SetProperty(EFFECT_FLAG_DELAY)
e4:SetRange(LOCATION_REMOVED)
e4:SetLabelObject(e0)
e4:SetCondition(cm.spcon)
e4:SetTarget(cm.sptg)
e4:SetOperation(cm.spop)
......@@ -40,20 +47,23 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
function cm.spfilter(c)
function cm.spfilter(c,se)
if not (se==nil or c:GetReasonEffect()~=se) then return false end
return c:IsFaceup() and c:IsSetCard(0x9977)
end
function cm.spcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(cm.spfilter,1,nil)
local se=e:GetLabelObject():GetLabelObject()
return eg:IsExists(cm.spfilter,1,nil,se)
end
function cm.tdfilter(c)
function cm.tdfilter(c,se)
if not (se==nil or c:GetReasonEffect()~=se) then return false end
return c:IsFaceup() and c:IsSetCard(0x9977) and c:IsAbleToDeck()
end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return eg:IsExists(cm.tdfilter,1,nil) and c:IsAbleToHand() and c:GetFlagEffect(m-10)==0 end
if chk==0 then return eg:IsExists(cm.tdfilter,1,nil,se) and c:IsAbleToHand() and c:GetFlagEffect(m-10)==0 end
c:RegisterFlagEffect(m-10,RESET_EVENT+RESETS_STANDARD+RESET_CHAIN,0,1)
local g=eg:Filter(cm.tdfilter,nil,tp)
local g=eg:Filter(cm.tdfilter,nil,se)
Duel.SetTargetCard(g)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,#g,0,0)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,c,1,0,0)
......
--汐击龙的汐驰
local cm,m=GetID()
function cm.initial_effect(c)
--check
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e0:SetCode(EVENT_REMOVE)
e0:SetCondition(aux.ThisCardInGraveAlreadyCheckReg)
c:RegisterEffect(e0)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,2))
......@@ -20,6 +26,7 @@ function cm.initial_effect(c)
e4:SetCode(EVENT_SPSUMMON_SUCCESS)
e4:SetProperty(EFFECT_FLAG_DELAY)
e4:SetRange(LOCATION_REMOVED)
e4:SetLabelObject(e0)
e4:SetCondition(cm.spcon)
e4:SetTarget(cm.sptg)
e4:SetOperation(cm.spop)
......@@ -87,11 +94,13 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Draw(p,d,REASON_EFFECT)
end
function cm.spfilter(c)
function cm.spfilter(c,se)
if not (se==nil or c:GetReasonEffect()~=se) then return false end
return c:IsFaceup() and c:IsSetCard(0x9977)
end
function cm.spcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(cm.spfilter,1,nil)
local se=e:GetLabelObject():GetLabelObject()
return eg:IsExists(cm.spfilter,1,nil,se)
end
function cm.spfilter2(c,e,tp)
return c:IsSetCard(0x9977) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
......
--汐击龙的汐引
local cm,m=GetID()
function cm.initial_effect(c)
--check
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e0:SetCode(EVENT_REMOVE)
e0:SetCondition(aux.ThisCardInGraveAlreadyCheckReg)
c:RegisterEffect(e0)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
......@@ -18,6 +24,7 @@ function cm.initial_effect(c)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetRange(LOCATION_REMOVED)
e2:SetLabelObject(e0)
e2:SetCondition(cm.spcon)
e2:SetTarget(cm.sptg)
e2:SetOperation(cm.spop)
......@@ -46,11 +53,13 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.ConfirmCards(1-tp,g)
end
end
function cm.spfilter(c)
function cm.spfilter(c,se)
if not (se==nil or c:GetReasonEffect()~=se) then return false end
return c:IsFaceup() and c:IsSetCard(0x9977)
end
function cm.spcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(cm.spfilter,1,nil)
local se=e:GetLabelObject():GetLabelObject()
return eg:IsExists(cm.spfilter,1,nil,se)
end
function cm.refilter(c)
return c:IsAbleToRemove() and c:IsSetCard(0x9977)
......
--汐击龙的汐刻
local cm,m=GetID()
function cm.initial_effect(c)
--check
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e0:SetCode(EVENT_REMOVE)
e0:SetCondition(aux.ThisCardInGraveAlreadyCheckReg)
c:RegisterEffect(e0)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
......@@ -17,6 +23,7 @@ function cm.initial_effect(c)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetRange(LOCATION_REMOVED)
e2:SetLabelObject(e0)
e2:SetCondition(cm.spcon)
e2:SetTarget(cm.sptg)
e2:SetOperation(cm.spop)
......@@ -46,20 +53,23 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp)
tc:RegisterEffect(e1)
end
end
function cm.spfilter(c)
function cm.spfilter(c,se)
if not (se==nil or c:GetReasonEffect()~=se) then return false end
return c:IsFaceup() and c:IsSetCard(0x9977)
end
function cm.spcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(cm.spfilter,1,nil)
local se=e:GetLabelObject():GetLabelObject()
return eg:IsExists(cm.spfilter,1,nil,se)
end
function cm.tdfilter(c)
function cm.tdfilter(c,se)
if not (se==nil or c:GetReasonEffect()~=se) then return false end
return c:IsFaceup() and c:IsSetCard(0x9977) and c:IsAbleToHand()
end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return eg:IsExists(cm.tdfilter,1,nil) and c:IsAbleToDeck() and c:GetFlagEffect(m-10)==0 end
if chk==0 then return eg:IsExists(cm.tdfilter,1,nil,se) and c:IsAbleToDeck() and c:GetFlagEffect(m-10)==0 end
c:RegisterFlagEffect(m-10,RESET_EVENT+RESETS_STANDARD+RESET_CHAIN,0,1)
local g=eg:Filter(cm.tdfilter,nil,tp)
local g=eg:Filter(cm.tdfilter,nil,se)
Duel.SetTargetCard(g)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,#g,0,0)
Duel.SetOperationInfo(0,CATEGORY_TODECK,c,1,0,0)
......
--汐击龙潭“霞语涧”
local cm,m=GetID()
function cm.initial_effect(c)
--check
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e0:SetCode(EVENT_REMOVE)
e0:SetCondition(aux.ThisCardInGraveAlreadyCheckReg)
c:RegisterEffect(e0)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
......@@ -30,6 +36,7 @@ function cm.initial_effect(c)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e4:SetCode(EVENT_SPSUMMON_SUCCESS)
e4:SetProperty(EFFECT_FLAG_DELAY)
e4:SetLabelObject(e0)
e4:SetRange(LOCATION_REMOVED)
e4:SetCondition(cm.spcon)
e4:SetTarget(cm.sptg)
......@@ -53,11 +60,13 @@ function cm.damop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,0,m)
Duel.Draw(tp,1,REASON_EFFECT)
end
function cm.spfilter(c)
function cm.spfilter(c,se)
if not (se==nil or c:GetReasonEffect()~=se) then return false end
return c:IsFaceup() and c:IsSetCard(0x9977)
end
function cm.spcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(cm.spfilter,1,nil)
local se=e:GetLabelObject():GetLabelObject()
return eg:IsExists(cm.spfilter,1,nil,se)
end
function cm.refilter(c)
return c:IsAbleToRemove() and c:IsSetCard(0x9977)
......
--汐击龙崖“鹰愁谷”
local cm,m=GetID()
function cm.initial_effect(c)
--check
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e0:SetCode(EVENT_REMOVE)
e0:SetCondition(aux.ThisCardInGraveAlreadyCheckReg)
c:RegisterEffect(e0)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
......@@ -31,6 +37,7 @@ function cm.initial_effect(c)
e4:SetCode(EVENT_SPSUMMON_SUCCESS)
e4:SetProperty(EFFECT_FLAG_DELAY)
e4:SetRange(LOCATION_REMOVED)
e4:SetLabelObject(e0)
e4:SetCondition(cm.spcon)
e4:SetTarget(cm.sptg)
e4:SetOperation(cm.spop)
......@@ -55,11 +62,13 @@ function cm.damop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.SelectMatchingCard(tp,nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
Duel.Destroy(g,REASON_EFFECT)
end
function cm.spfilter(c)
function cm.spfilter(c,se)
if not (se==nil or c:GetReasonEffect()~=se) then return false end
return c:IsFaceup() and c:IsSetCard(0x9977)
end
function cm.spcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(cm.spfilter,1,nil)
local se=e:GetLabelObject():GetLabelObject()
return eg:IsExists(cm.spfilter,1,nil,se)
end
function cm.refilter(c)
return c:IsAbleToRemove() and c:IsSetCard(0x9977) and c:IsFaceup()
......
--汐击龙的汐叹
local cm,m=GetID()
function cm.initial_effect(c)
--check
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e0:SetCode(EVENT_REMOVE)
e0:SetCondition(aux.ThisCardInGraveAlreadyCheckReg)
c:RegisterEffect(e0)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_REMOVE)
......@@ -37,6 +43,7 @@ function cm.initial_effect(c)
e5:SetCode(EVENT_SPSUMMON_SUCCESS)
e5:SetProperty(EFFECT_FLAG_DELAY)
e5:SetRange(LOCATION_REMOVED)
e5:SetLabelObject(e0)
e5:SetCondition(cm.spcon)
e5:SetTarget(cm.sptg)
e5:SetOperation(cm.spop)
......@@ -125,11 +132,13 @@ end
function cm.spfilter(c)
return c:IsFaceup() and c:IsSetCard(0x9977)
end
function cm.spcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(cm.spfilter,1,nil)
function cm.spfilter(c,se)
if not (se==nil or c:GetReasonEffect()~=se) then return false end
return c:IsFaceup() and c:IsSetCard(0x9977)
end
function cm.refilter(c)
return c:IsAbleToRemove() and c:IsSetCard(0x9977)
function cm.spcon(e,tp,eg,ep,ev,re,r,rp)
local se=e:GetLabelObject():GetLabelObject()
return eg:IsExists(cm.spfilter,1,nil,se)
end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
......
......@@ -2,6 +2,7 @@
local cm,m=GetID()
function cm.initial_effect(c)
aux.AddCodeList(c,11451599)
local e0=aux.AddThisCardInGraveAlreadyCheck(c)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
......@@ -26,6 +27,7 @@ function cm.initial_effect(c)
e2:SetCode(EVENT_SUMMON_SUCCESS)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetRange(LOCATION_GRAVE)
e2:SetLabelObject(e0)
e2:SetCondition(cm.adcon2)
e2:SetCost(cm.adcost2)
e2:SetTarget(cm.adtg2)
......@@ -35,7 +37,8 @@ function cm.initial_effect(c)
e5:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e5)
end
function cm.filter(c,tp)
function cm.filter(c,tp,se)
if not (se==nil or c:GetReasonEffect()~=se) then return false end
return c:IsControler(tp)
end
function cm.adcon(e,tp,eg,ep,ev,re,r,rp)
......@@ -85,7 +88,8 @@ function cm.adop(e,tp,eg,ep,ev,re,r,rp)
end
end
function cm.adcon2(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(cm.filter,1,nil,tp)
local se=e:GetLabelObject():GetLabelObject()
return eg:IsExists(cm.filter,1,nil,tp,se)
end
function cm.adcost2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,1,nil) end
......
--星汐击龙“绀夜”
local cm,m=GetID()
function cm.initial_effect(c)
--check
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e0:SetCode(EVENT_REMOVE)
e0:SetCondition(aux.ThisCardInGraveAlreadyCheckReg)
c:RegisterEffect(e0)
--search
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,1))
......@@ -22,6 +28,7 @@ function cm.initial_effect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetLabelObject(e0)
e2:SetRange(LOCATION_HAND+LOCATION_REMOVED)
e2:SetCondition(cm.spcon)
e2:SetTarget(cm.sptg)
......@@ -73,11 +80,13 @@ end
function cm.setfilter(c,e,tp)
return c:IsFaceup() and c:IsSetCard(0x9977) and ((c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEDOWN_DEFENSE) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0) or c:IsSSetable())
end
function cm.spfilter(c)
function cm.spfilter(c,se)
if not (se==nil or c:GetReasonEffect()~=se) then return false end
return c:IsFaceup() and c:IsSetCard(0x9977)
end
function cm.spcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(cm.spfilter,1,nil)
local se=e:GetLabelObject():GetLabelObject()
return eg:IsExists(cm.spfilter,1,nil,se)
end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
......@@ -103,6 +112,7 @@ function cm.spop(e,tp,eg,ep,ev,re,r,rp)
Duel.SSet(tp,tc)
end
if #Duel.GetOperatedGroup()>0 and c:IsRelateToEffect(e) then
--Duel.BreakEffect()
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
end
......
......@@ -3,7 +3,24 @@ SUMMON_TYPE_SPLIT=15000001
SUMMON_VALUE_SPLIT=0x15000001
EFFECT_EXTRA_SPLIT_SUMMON=15000002
EFFECT_CANNOT_BE_SPLIT_MATERIAL=15000003
--if not require and dofile then
-- function require(str)
-- require_list=require_list or {}
-- if not require_list[str] then
-- if string.find(str,"%.") then
-- require_list[str]=dofile(str)
-- else
-- require_list[str]=dofile(str..".lua")
-- end
-- end
-- return require_list[str]
-- end
--end
--if not pcall(function() require("expansions/script/c15000000") end) then require("script/c15000000") end
if Satl_Library_Switch then
return
end
Satl_Library_Switch=true
--为 卡 片 c添 加 裂 解 召 唤 手 续 ,mf为 裂 解 素 材 需 满 足 的 条 件
function Satl.AddSplitProcedure(c,mf)
if not Satl.PendulumChecklist then
......@@ -321,7 +338,7 @@ end
function Satl.GetHearogenehirpSolvingCount(e,tp)
local g=Group.CreateGroup()
local code=15005050
while code<15006000 do
while code<15005070 do
if Duel.GetFlagEffect(tp,code)~=0 then
local tg=Duel.GetMatchingGroup(Card.IsOriginalCodeRule,tp,0xff,0xff,nil,code)
local tc=tg:GetFirst()
......@@ -336,7 +353,7 @@ end
function Satl.AddHearogenehirpSolving(e,tp)
local code=15005050
local g=Group.CreateGroup()
while code<15006000 do
while code<15005070 do
if Duel.GetFlagEffect(tp,code)~=0 then
local tg=Duel.GetMatchingGroup(Card.IsOriginalCodeRule,tp,0xff,0xff,nil,code)
local tc=tg:GetFirst()
......@@ -350,7 +367,7 @@ function Satl.AddHearogenehirpSolving(e,tp)
g:Clear()
local list={}
local code=15005050
while code<15006000 do
while code<15005070 do
if Duel.GetFlagEffect(tp,code)~=0 then
local tg=Duel.GetMatchingGroup(Card.IsOriginalCodeRule,tp,0xff,0xff,nil,code)
local tc=tg:GetFirst()
......@@ -381,7 +398,7 @@ function Satl.AddHearogenehirpSolving(e,tp)
end
g:Clear()
local code=15005050
while code<15006000 do
while code<15005070 do
if Duel.GetFlagEffect(tp,code)~=0 then
local tg=Duel.GetMatchingGroup(Card.IsOriginalCodeRule,tp,0xff,0xff,nil,code)
local tc=tg:GetFirst()
......
......@@ -4567,3 +4567,390 @@ end
function cm.Tentuthop(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsRelateToEffect(e) then Duel.SendtoHand(e:GetHandler(),nil,REASON_EFFECT) end
end
function cm.ActivatedAsSpellorTrap(c,otyp)
local e1=Effect.CreateEffect(c)
--e1:SetDescription(aux.Stringid(m,0))
if otyp&TYPE_SPELL~=0 then e1:SetType(EFFECT_TYPE_IGNITION) elseif otyp&TYPE_TRAP~=0 then
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
end
e1:SetRange(LOCATION_HAND)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_CANNOT_DISABLE)
c:RegisterEffect(e1)
local e1_1=Effect.CreateEffect(c)
e1_1:SetType(EFFECT_TYPE_SINGLE)
e1_1:SetProperty(EFFECT_FLAG_SINGLE_RANGE+EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1_1:SetCode(53765098)
e1_1:SetRange(LOCATION_HAND)
e1_1:SetLabel(otyp)
e1_1:SetLabelObject(e1)
c:RegisterEffect(e1_1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_ADJUST)
e2:SetRange(LOCATION_HAND)
e2:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_CANNOT_DISABLE)
e2:SetLabelObject(e1)
e2:SetOperation(cm.AASTadjustop(otyp))
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_ACTIVATE_COST)
e3:SetRange(LOCATION_HAND)
e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e3:SetTargetRange(1,1)
e3:SetLabelObject(e1)
e3:SetTarget(cm.AASTactarget)
e3:SetCost(cm.AASTcostchk)
e3:SetOperation(cm.AASTcostop(otyp))
c:RegisterEffect(e3)
return e1,e1_1,e2,e3
end
function cm.AASTadjustop(otyp)
return
function(e,tp,eg,ep,ev,re,r,rp)
local te=e:GetLabelObject()
local c=te:GetHandler()
local xe={c:IsHasEffect(53765099)}
for _,v in pairs(xe) do v:Reset() end
local p=te:GetHandlerPlayer()
local pe={Duel.IsPlayerAffectedByEffect(p,EFFECT_CANNOT_ACTIVATE)}
local ae={Duel.IsPlayerAffectedByEffect(p,EFFECT_ACTIVATE_COST)}
local t1,t2={},{}
for _,v in pairs(pe) do
local val=v:GetValue()
if aux.GetValueType(val)=="number" or val(v,te,p) then
table.insert(t1,v)
table.insert(t2,1)
end
end
for _,v in pairs(ae) do
local cost=v:GetCost()
if not v:GetLabelObject() and cost and not cost(v,te,p) then
local tg=v:GetTarget()
if not tg or tg(v,te,p) then
table.insert(t1,v)
table.insert(t2,2)
end
end
end
local xe1=cm.AASTregi(c,te)
xe1:SetLabel(c:GetSequence(),otyp)
local t3,t4={},{}
for _,v in pairs(pe) do
local val=v:GetValue()
if aux.GetValueType(val)=="number" or val(v,te,p) then
table.insert(t3,v)
table.insert(t4,1)
end
end
for _,v in pairs(ae) do
local cost=v:GetCost()
if not v:GetLabelObject() and cost and not cost(v,te,p) then
local tg=v:GetTarget()
if not tg or tg(v,te,p) then
table.insert(t3,v)
table.insert(t4,2)
end
end
end
xe1:Reset()
local ret1,ret2={},{}
for k,v1 in pairs(t1) do
local equal=false
for _,v2 in pairs(t3) do
if v1==v2 then
equal=true
break
end
end
if not equal then
table.insert(ret1,v1)
table.insert(ret2,t2[k])
end
end
local ret3,ret4={},{}
for k,v1 in pairs(t3) do
local equal=false
for _,v2 in pairs(t1) do
if v1==v2 then
equal=true
break
end
end
if not equal then
table.insert(ret3,v1)
table.insert(ret4,t4[k])
end
end
for k,v in pairs(ret1) do
if ret2[k]==1 then
local val=v:GetValue()
if aux.GetValueType(val)=="number" then val=aux.TRUE end
if val(v,te,p) then
v:SetValue(cm.AASTchval(val,false,te))
end
end
if ret2[k]==2 then
local cost=v:GetCost()
if not v:GetLabelObject() and cost and not cost(v,te,p) then
local tg=v:GetTarget()
if not tg then
v:SetTarget(cm.AASTchtg(aux.TRUE,false,te))
elseif tg(v,te,p) then
v:SetTarget(cm.AASTchtg(tg,false,te))
end
end
end
end
local xe1=cm.AASTregi(c,te)
xe1:SetLabel(c:GetSequence(),otyp)
for k,v in pairs(ret3) do
if ret4[k]==1 then
local val=v:GetValue()
if aux.GetValueType(val)=="number" then val=aux.TRUE end
if val(v,te,p) then
v:SetValue(cm.AASTchval(val,true,te))
end
end
if ret4[k]==2 then
local cost=v:GetCost()
if not v:GetLabelObject() and cost and not cost(v,te,p) then
local tg=v:GetTarget()
if not tg then
v:SetTarget(cm.AASTchtg(aux.TRUE,true,te))
elseif tg(v,te,p) then
v:SetTarget(cm.AASTchtg(tg,true,te))
end
end
end
end
xe1:Reset()
end
end
function cm.AASTbchval(_val,te)
return function(e,re,...)
if re==te then return false end
return _val(e,re,...)
end
end
function cm.AASTchval(_val,res,te)
return function(e,re,...)
if re==te then return res end
return _val(e,re,...)
end
end
function cm.AASTchtg(_tg,res,te)
return function(e,re,...)
if re==te then return res end
return _tg(e,re,...)
end
end
function cm.AASTactarget(e,te,tp)
return te:GetHandler()==e:GetHandler() and te==e:GetLabelObject()
end
function cm.AASTcostchk(e,te,tp)
return Duel.GetLocationCount(tp,LOCATION_SZONE)>0
end
function cm.AASTcostop(otyp)
return
function(e,tp,eg,ep,ev,re,r,rp)
local te=e:GetLabelObject()
local c=te:GetHandler()
local xe1=cm.AASTregi(c,te)
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetCode(EFFECT_CHANGE_TYPE)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e0:SetValue(otyp)
c:RegisterEffect(e0,true)
Duel.MoveToField(c,tp,tp,LOCATION_SZONE,POS_FACEUP,false)
xe1:SetLabel(c:GetSequence()+1,otyp)
e0:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET)
c:CreateEffectRelation(te)
local ev0=Duel.GetCurrentChain()+1
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetCode(EVENT_CHAIN_SOLVING)
e1:SetCountLimit(1)
e1:SetCondition(function(e,tp,eg,ep,ev,re,r,rp)return ev==ev0 end)
e1:SetOperation(cm.AASTrsop)
e1:SetReset(RESET_CHAIN)
Duel.RegisterEffect(e1,tp)
local e2=e1:Clone()
e2:SetCode(EVENT_CHAIN_NEGATED)
Duel.RegisterEffect(e2,tp)
if not c:IsType(TYPE_CONTINUOUS+TYPE_EQUIP+TYPE_PENDULUM) then return end
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_REMAIN_FIELD)
e3:SetProperty(EFFECT_FLAG_OATH+EFFECT_FLAG_CANNOT_DISABLE)
e3:SetReset(RESET_CHAIN)
c:RegisterEffect(e3)
end
end
function cm.AASTrsop(e,tp,eg,ep,ev,re,r,rp)
local rc=re:GetHandler()
if e:GetCode()==EVENT_CHAIN_SOLVING and rc:IsRelateToEffect(re) then
rc:SetStatus(STATUS_EFFECT_ENABLED,true)
if not rc:IsType(TYPE_CONTINUOUS+TYPE_EQUIP+TYPE_PENDULUM) and not rc:IsHasEffect(EFFECT_REMAIN_FIELD) then rc:CancelToGrave(false) end
end
if e:GetCode()==EVENT_CHAIN_NEGATED and rc:IsRelateToEffect(re) and not (rc:IsOnField() and rc:IsFacedown()) then
rc:SetStatus(STATUS_ACTIVATE_DISABLED,true)
rc:CancelToGrave(false)
end
local xe={rc:IsHasEffect(53765099)}
for _,v in pairs(xe) do if v:GetLabelObject()==re then v:Reset() end end
end
function cm.AASTregi(c,e)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(53765099)
e1:SetLabelObject(e)
c:RegisterEffect(e1,true)
return e1
end
function cm.ActivatedAsSpellorTrapCheck(c)
if not AD_ActivatedAsSpellorTrap_Check then
AD_ActivatedAsSpellorTrap_Check=true
ADIMI_GetActivateEffect=Card.GetActivateEffect
Card.GetActivateEffect=function(ac)
local le={ADIMI_GetActivateEffect(ac)}
local xe={ac:IsHasEffect(53765098)}
local ae=nil
local typ=0
for _,v in pairs(xe) do ae=v:GetLabelObject() typ=v:GetLabel() end
if ae then
le={ae}
local xe1=cm.AASTregi(ac,ae)
xe1:SetLabel(ac:GetSequence(),typ)
end
return table.unpack(le)
end
ADIMI_IsType=Card.IsType
Card.IsType=function(rc,type)
local res=ADIMI_IsType(rc,type)
local xe={rc:IsHasEffect(53765099)}
local b=false
local seq,typ=0,0
for _,v in pairs(xe) do if rc==v:GetLabelObject():GetHandler() then b=true seq,typ=v:GetLabel() end end
if b and type&typ~=0 and rc:IsHasEffect(53765099) then return true else return res end
end
ADIMI_CGetType=Card.GetType
Card.GetType=function(rc)
local xe={rc:IsHasEffect(53765099)}
local b=false
local seq,typ=0,0
for _,v in pairs(xe) do if rc==v:GetLabelObject():GetHandler() then b=true seq,typ=v:GetLabel() end end
if b then return typ else return ADIMI_CGetType(rc) end
end
ADIMI_IsHasType=Effect.IsHasType
Effect.IsHasType=function(re,type)
local res=ADIMI_IsHasType(re,type)
local rc=re:GetHandler()
local xe={}
if rc then xe={rc:IsHasEffect(53765099)} end
local b=false
for _,v in pairs(xe) do if re==v:GetLabelObject() then b=true end end
if b then
if type&EFFECT_TYPE_ACTIVATE~=0 then return true else return false end
else return res end
end
ADIMI_EGetType=Effect.GetType
Effect.GetType=function(re)
local rc=re:GetHandler()
local xe={}
if rc then xe={rc:IsHasEffect(53765099)} end
local b=false
for _,v in pairs(xe) do if re==v:GetLabelObject() then b=true end end
if b then return EFFECT_TYPE_ACTIVATE else return ADIMI_EGetType(re) end
end
ADIMI_IsActiveType=Effect.IsActiveType
Effect.IsActiveType=function(re,type)
local res=ADIMI_IsActiveType(re,type)
local rc=re:GetHandler()
local xe={}
if rc then xe={rc:IsHasEffect(53765099)} end
local b=false
local seq,typ=0,0
for _,v in pairs(xe) do if re==v:GetLabelObject() then b=true seq,typ=v:GetLabel() end end
if b then
if type&typ~=0 then return true else return false end
else return res end
end
ADIMI_GetActiveType=Effect.GetActiveType
Effect.GetActiveType=function(re)
local rc=re:GetHandler()
local xe={}
if rc then xe={rc:IsHasEffect(53765099)} end
local b=false
local seq,typ=0,0
for _,v in pairs(xe) do if re==v:GetLabelObject() then b=true seq,typ=v:GetLabel() end end
if b then return typ else return ADIMI_GetActiveType(re) end
end
ADIMI_GetActivateLocation=Effect.GetActivateLocation
Effect.GetActivateLocation=function(re)
local rc=re:GetHandler()
local xe={}
if rc then xe={rc:IsHasEffect(53765099)} end
local b=false
for _,v in pairs(xe) do if re==v:GetLabelObject() then b=true end end
if b then return LOCATION_SZONE else return ADIMI_GetActivateLocation(re) end
end
ADIMI_GetActivateSequence=Effect.GetActivateSequence
Effect.GetActivateSequence=function(re)
local rc=re:GetHandler()
local xe={}
if rc then xe={rc:IsHasEffect(53765099)} end
local ls=0
local seq=ADIMI_GetActivateSequence(re)
for _,v in pairs(xe) do
if re==v:GetLabelObject() then
ls=v:GetLabel()
break
end
end
if ls>0 then return ls-1 else return seq end
end
ADIMI_GetChainInfo=Duel.GetChainInfo
Duel.GetChainInfo=function(chainc,...)
local re=ADIMI_GetChainInfo(chainc,CHAININFO_TRIGGERING_EFFECT)
local rc=re:GetHandler()
local xe={}
if rc then xe={rc:IsHasEffect(53765099)} end
local b=false
local ls,typ=0
for _,v in pairs(xe) do
if re==v:GetLabelObject() then
b=true
ls,typ=v:GetLabel()
break
end
end
local t={ADIMI_GetChainInfo(chainc,...)}
if b then
for k,info in ipairs({...}) do
if info==CHAININFO_TYPE then t[k]=typ end
if info==CHAININFO_EXTTYPE then t[k]=typ end
if info==CHAININFO_TRIGGERING_LOCATION then t[k]=LOCATION_SZONE end
if info==CHAININFO_TRIGGERING_SEQUENCE and ls>0 then t[k]=ls-1 end
if info==CHAININFO_TRIGGERING_POSITION then t[k]=POS_FACEUP end
end
end
return table.unpack(t)
end
ADIMI_ChangeChainOperation=Duel.ChangeChainOperation
Duel.ChangeChainOperation=function(chainc,...)
local re=Duel.GetChainInfo(chainc,CHAININFO_TRIGGERING_EFFECT)
local xe={}
if re and re:GetHandler() then xe={re:GetHandler():IsHasEffect(53765099)} end
local b=false
for _,v in pairs(xe) do if re==v:GetLabelObject() then b=true end end
if b then re:GetHandler():CancelToGrave(false) end
return ADIMI_ChangeChainOperation(chainc,...)
end
end
end
......@@ -8,12 +8,14 @@ function cm.initial_effect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_CUSTOM+m)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetRange(LOCATION_HAND+LOCATION_GRAVE)
e1:SetCondition(cm.con)
e1:SetCost(cm.cost)
e1:SetTarget(cm.tg)
c:RegisterEffect(e1)
SNNM.FanippetTrap(c,{e1})
local e2=e1:Clone()
e2:SetRange(LOCATION_GRAVE)
c:RegisterEffect(e2)
SNNM.FanippetTrap(c,{e2})
if not cm.global_check then
cm.global_check=true
local ge1=Effect.CreateEffect(c)
......
......@@ -8,12 +8,14 @@ function cm.initial_effect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_CUSTOM+m)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetRange(LOCATION_HAND+LOCATION_GRAVE)
e1:SetCondition(cm.con)
e1:SetCost(cm.cost)
e1:SetTarget(cm.tg)
c:RegisterEffect(e1)
SNNM.FanippetTrap(c,{e1})
local e2=e1:Clone()
e2:SetRange(LOCATION_GRAVE)
c:RegisterEffect(e2)
SNNM.FanippetTrap(c,{e2})
if not cm.global_check then
cm.global_check=true
local ge1=Effect.CreateEffect(c)
......
......@@ -8,12 +8,14 @@ function cm.initial_effect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetRange(LOCATION_HAND+LOCATION_GRAVE)
e1:SetCondition(cm.con)
e1:SetCost(cm.cost)
e1:SetTarget(cm.tg)
c:RegisterEffect(e1)
SNNM.FanippetTrap(c,{e1})
local e2=e1:Clone()
e2:SetRange(LOCATION_GRAVE)
c:RegisterEffect(e2)
SNNM.FanippetTrap(c,{e2})
end
function cm.cfilter(c)
return c:IsFaceup() and bit.band(c:GetType(),0x20004)==0x20004 and not c:IsRace(RACE_FIEND)
......
......@@ -8,12 +8,14 @@ function cm.initial_effect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_CHAINING)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetRange(LOCATION_HAND+LOCATION_GRAVE)
e1:SetCondition(cm.con)
e1:SetCost(cm.cost)
e1:SetTarget(cm.tg)
c:RegisterEffect(e1)
SNNM.FanippetTrap(c,{e1})
local e2=e1:Clone()
e2:SetRange(LOCATION_GRAVE)
c:RegisterEffect(e2)
SNNM.FanippetTrap(c,{e2})
end
function cm.con(e,tp,eg,ep,ev,re,r,rp,chk)
return ep~=tp and re:IsActiveType(TYPE_SPELL+TYPE_TRAP)
......
......@@ -8,7 +8,6 @@ function cm.initial_effect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_MSET)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetRange(LOCATION_HAND+LOCATION_GRAVE)
e1:SetCondition(cm.con)
e1:SetCost(cm.cost)
e1:SetTarget(cm.tg)
......@@ -24,7 +23,19 @@ function cm.initial_effect(c)
e4:SetCode(EVENT_SPSUMMON_SUCCESS)
e4:SetCondition(cm.con3)
c:RegisterEffect(e4)
SNNM.FanippetTrap(c,{e1,e2,e3,e4})
local e5=e1:Clone()
e5:SetRange(LOCATION_GRAVE)
c:RegisterEffect(e5)
local e6=e1:Clone()
e6:SetRange(LOCATION_GRAVE)
c:RegisterEffect(e6)
local e7=e1:Clone()
e7:SetRange(LOCATION_GRAVE)
c:RegisterEffect(e7)
local e8=e1:Clone()
e8:SetRange(LOCATION_GRAVE)
c:RegisterEffect(e8)
SNNM.FanippetTrap(c,{e5,e6,e7,e8})
end
function cm.con(e,tp,eg,ep,ev,re,r,rp,chk)
return rp~=tp
......
......@@ -8,12 +8,14 @@ function cm.initial_effect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetRange(LOCATION_HAND+LOCATION_GRAVE)
e1:SetCondition(cm.con)
e1:SetCost(cm.cost)
e1:SetTarget(cm.tg)
c:RegisterEffect(e1)
SNNM.FanippetTrap(c,{e1})
local e2=e1:Clone()
e2:SetRange(LOCATION_GRAVE)
c:RegisterEffect(e2)
SNNM.FanippetTrap(c,{e2})
end
function cm.cfilter(c,tp)
return c:IsSummonPlayer(tp) and c:IsSummonLocation(LOCATION_EXTRA)
......
......@@ -8,11 +8,13 @@ function cm.initial_effect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e1:SetRange(LOCATION_HAND+LOCATION_GRAVE)
e1:SetCountLimit(1,m+EFFECT_COUNT_CODE_OATH)
e1:SetCost(cm.cost)
e1:SetTarget(cm.tg)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetRange(LOCATION_GRAVE)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_TRAP_ACT_IN_HAND)
......@@ -23,7 +25,7 @@ function cm.initial_effect(c)
e4:SetRange(LOCATION_GRAVE)
e4:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e4:SetTargetRange(1,0)
e4:SetLabelObject(e1)
e4:SetLabelObject(e2)
e4:SetTarget(cm.GraveActCostTarget)
e4:SetOperation(SNNM.GraveActCostOp)
c:RegisterEffect(e4)
......
......@@ -8,11 +8,13 @@ function cm.initial_effect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e1:SetRange(LOCATION_HAND+LOCATION_GRAVE)
e1:SetCountLimit(1,m+EFFECT_COUNT_CODE_OATH)
e1:SetCost(cm.cost)
e1:SetTarget(cm.tg)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetRange(LOCATION_GRAVE)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_TRAP_ACT_IN_HAND)
......@@ -23,7 +25,7 @@ function cm.initial_effect(c)
e4:SetRange(LOCATION_GRAVE)
e4:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e4:SetTargetRange(1,0)
e4:SetLabelObject(e1)
e4:SetLabelObject(e2)
e4:SetTarget(cm.GraveActCostTarget)
e4:SetOperation(SNNM.GraveActCostOp)
c:RegisterEffect(e4)
......
local m=53716017
local cm=_G["c"..m]
cm.name="残滓离光 妄想天崖"
cm.Snnm_Ef_Rst=true
if not require and dofile then function require(str) return dofile(str..".lua") end end
if not pcall(function() require("expansions/script/c53702500") end) then require("script/c53702500") end
function cm.initial_effect(c)
--SNNM.AllEffectReset(c)
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(m,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_EXTRA)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e1:SetCountLimit(1,m)
e1:SetCost(cm.cost)
--e1:SetTarget(cm.tg)
--e1:SetOperation(cm.op)
c:RegisterEffect(e1)
cm.Lustruin=e1
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_ACTIVATE_COST)
e2:SetRange(LOCATION_EXTRA)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetTargetRange(1,1)
e2:SetLabelObject(e1)
e2:SetCondition(cm.accon)
e2:SetTarget(cm.actarget)
e2:SetOperation(cm.acop)
c:RegisterEffect(e2)
local ew=Effect.CreateEffect(c)
ew:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ew:SetCode(EVENT_PHASE_START+PHASE_DRAW)
ew:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_CANNOT_DISABLE)
ew:SetRange(0xff)
--ew:SetOperation(cm.down)
ew:SetCountLimit(1,EFFECT_COUNT_CODE_DUEL+m)
c:RegisterEffect(ew)
local ex=Effect.CreateEffect(c)
ex:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ex:SetCode(EVENT_ADJUST)
ex:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_CANNOT_DISABLE)
ex:SetRange(0xff)
ex:SetOperation(cm.reset)
c:RegisterEffect(ex)
end
......@@ -8,7 +8,6 @@ function cm.initial_effect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetRange(LOCATION_HAND+LOCATION_GRAVE)
e1:SetCondition(cm.con)
e1:SetCost(cm.cost)
e1:SetTarget(cm.tg)
......@@ -16,7 +15,13 @@ function cm.initial_effect(c)
local e2=e1:Clone()
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e2)
SNNM.FanippetTrap(c,{e1,e2})
local e3=e1:Clone()
e3:SetRange(LOCATION_GRAVE)
c:RegisterEffect(e3)
local e4=e2:Clone()
e4:SetRange(LOCATION_GRAVE)
c:RegisterEffect(e4)
SNNM.FanippetTrap(c,{e3,e4})
end
function cm.cfilter(c,tp)
return c:IsSummonPlayer(tp) and c:IsSummonLocation(LOCATION_HAND+LOCATION_GRAVE)
......
local m=53732002
local cm=_G["c"..m]
cm.name="测试区域2"
cm.Snnm_Ef_Rst=true
if not require and dofile then function require(str) return dofile(str..".lua") end end
if not pcall(function() require("expansions/script/c53702500") end) then require("script/c53702500") end
function cm.initial_effect(c)
SNNM.AllEffectReset(c)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,m)
e1:SetTarget(cm.tg)
e1:SetOperation(cm.op)
c:RegisterEffect(e1)
if not cm.Aozora_Check then
cm.Aozora_Check=true
cm[0]=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
cm[0](e,p)
end
cm[1]=Card.RegisterEffect
Card.RegisterEffect=function(c,e,bool)
if e:GetCode()==EFFECT_DISABLE_FIELD then
local op,range,con=e:GetOperation(),e:GetRange(),e:GetCondition()
if op then
local ex=Effect.CreateEffect(c)
ex:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ex:SetCode(EVENT_ADJUST)
ex:SetRange(range)
ex:SetOperation(cm.exop)
cm[1](c,ex)
cm[ex]={op,range,con}
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
cm[1](c,e,bool)
end
end
end
function cm.exop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:GetFlagEffect(m)>0 then return end
c:RegisterFlagEffect(m,RESET_EVENT+RESETS_STANDARD+RESET_OVERLAY,0,0)
local op,range,con=cm[e][1],cm[e][2],cm[e][3]
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)
e1:SetRange(range)
if con then e1:SetCondition(con) end
e1:SetValue(val)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_OVERLAY)
c:RegisterEffect(e1)
end
function cm.tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local zone=0
local ce={Duel.IsPlayerAffectedByEffect(tp,EFFECT_DISABLE_FIELD)}
for _,te in ipairs(ce) do
local con=te:GetCondition()
local val=te:GetValue()
if (not con or con(te)) then
if val then if aux.GetValueType(val)=="function" then zone=zone+val(te) else zone=zone+val end end
end
end
if tp==1 then zone=((zone&0xffff)<<16)|((zone>>16)&0xffff) end
return zone&0x1f>0
--return zone&0x4bb0f>0
end
end
function cm.op(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) or Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)==0 then return end
local zone=0
local ce={Duel.IsPlayerAffectedByEffect(tp,EFFECT_DISABLE_FIELD)}
for _,te in ipairs(ce) do
local con=te:GetCondition()
local val=te:GetValue()
if (not con or con(te)) then
if val then if aux.GetValueType(val)=="function" then zone=zone+val(te) else zone=zone+val end end
end
end
if tp==1 then zone=((zone&0xffff)<<16)|((zone>>16)&0xffff) end
if zone&0x1f==0 then return end
--if zone&0x4bb0f==0 then return end
local z=Duel.SelectField(tp,1,LOCATION_MZONE,0,(~zone)|0xe000e0)
--local z=Duel.SelectField(tp,1,LOCATION_MZONE,LOCATION_MZONE,(~zone)|0xe000e0)
Duel.Hint(HINT_ZONE,tp,z)
if tp==1 then z=((z&0xffff)<<16)|((z>>16)&0xffff) end
local ce={Duel.IsPlayerAffectedByEffect(tp,EFFECT_DISABLE_FIELD)}
for _,te in ipairs(ce) do
local val=te:GetValue()
if val then
if aux.GetValueType(val)=="function" then
cm[te]={val}
local zone=val(te)
val=zone
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_ADJUST)
e1:SetLabel(zone)
e1:SetLabelObject(te)
e1:SetOperation(cm.retop)
Duel.RegisterEffect(e1,tp)
end
if z&val~=0 then val=val-z end
te:SetValue(val)
end
end
end
function cm.retop(e,tp,eg,ep,ev,re,r,rp)
local zone,te=e:GetLabel(),e:GetLabelObject()
if not te then
e:Reset()
return
end
local val=cm[te][1]
local eval=val(te)
local res=true
local ce={Duel.IsPlayerAffectedByEffect(tp,EFFECT_DISABLE_FIELD)}
for _,ke in ipairs(ce) do
if ke==te then res=false end
end
if zone~=eval or res then
te:SetValue(val)
e:Reset()
end
end
local m=53733008
local cm=_G["c"..m]
cm.name="黄昏凝滞之园"
if not require and dofile then function require(str) return dofile(str..".lua") end end
if not pcall(function() require("expansions/script/c53702500") end) then require("script/c53702500") end
function cm.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOKEN)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_REMOVE)
e1:SetTarget(cm.tktg)
e1:SetOperation(cm.tkop)
c:RegisterEffect(e1)
if not cm.global_check then
cm.global_check=true
cm.flp=Duel.GetLP(0)
cm.slp=Duel.GetLP(1)
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_CHAINING)
ge1:SetOperation(cm.checkop)
Duel.RegisterEffect(ge1,0)
end
end
cm.toss_dice=true
function cm.checkop(e,tp,eg,ep,ev,re,r,rp)
local rc=re:GetHandler()
if rc:IsSetCard(0xa530) and rc:IsType(TYPE_TOKEN) then
Duel.RegisterFlagEffect(0,m+rc:GetCode(),0,0,0)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_CHAIN_NEGATED)
e1:SetLabel(rc:GetCode())
e1:SetLabelObject(re)
e1:SetOperation(cm.reset)
e1:SetReset(RESET_CHAIN)
Duel.RegisterEffect(e1,rp)
end
end
function cm.reset(e,tp,eg,ep,ev,re,r,rp)
local code=e:GetLabel()
local ct=Duel.GetFlagEffect(0,m+code)-1
Duel.ResetFlagEffect(0,m+code)
for i=1,ct do Duel.RegisterFlagEffect(0,m+code,0,0,0) end
end
function cm.tktg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsPlayerCanSpecialSummonMonster(tp,m+1,0,TYPES_TOKEN_MONSTER,0,0,1,RACE_FIEND,ATTRIBUTE_DARK) end
Duel.SetOperationInfo(0,CATEGORY_TOKEN,nil,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,0,0)
end
function cm.tkop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetFlagEffect(tp,m)~=0 then return end
Duel.Hint(HINT_MUSIC,0,aux.Stringid(m,3))
Duel.RegisterFlagEffect(tp,m,RESET_PHASE+PHASE_END,0,1)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 or not Duel.IsPlayerCanSpecialSummonMonster(tp,m+1,0,TYPES_TOKEN_MONSTER,0,0,1,RACE_FIEND,ATTRIBUTE_DARK) then return end
local fid=e:GetHandler():GetFieldID()
local token=Duel.CreateToken(tp,m+1)
Duel.SpecialSummon(token,0,tp,tp,false,false,POS_FACEUP)
token:RegisterFlagEffect(m,RESET_EVENT+RESETS_STANDARD,0,1,fid)
local c=e:GetHandler()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetCountLimit(1)
e1:SetLabel(fid)
e1:SetLabelObject(token)
e1:SetCondition(cm.descon)
e1:SetOperation(cm.desop)
Duel.RegisterEffect(e1,tp)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_CANNOT_INACTIVATE)
e2:SetLabel(3)
e2:SetValue(cm.effectfilter)
Duel.RegisterEffect(e2,tp)
local e3=e2:Clone()
e3:SetCode(EFFECT_CANNOT_DISEFFECT)
e3:SetLabel(4)
Duel.RegisterEffect(e3,tp)
e2:SetLabelObject(e3)
e3:SetLabelObject(token)
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e0:SetCode(EVENT_LEAVE_FIELD_P)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_IGNORE_IMMUNE)
e0:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET)
e0:SetLabelObject(e2)
e0:SetOperation(cm.chk)
token:RegisterEffect(e0,true)
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetCode(EFFECT_CANNOT_DISABLE)
e4:SetReset(RESET_EVENT+RESETS_STANDARD)
token:RegisterEffect(e4,true)
local e5=Effect.CreateEffect(c)
e5:SetDescription(aux.Stringid(m,1))
e5:SetCategory(CATEGORY_EQUIP)
e5:SetType(EFFECT_TYPE_IGNITION)
e5:SetCountLimit(3)
e5:SetRange(LOCATION_MZONE)
e5:SetTarget(cm.eqtg)
e5:SetOperation(cm.eqop)
e5:SetReset(RESET_EVENT+RESETS_STANDARD)
token:RegisterEffect(e5,true)
local e6=Effect.CreateEffect(c)
e6:SetType(EFFECT_TYPE_FIELD)
e6:SetCode(EFFECT_ACTIVATE_COST)
e6:SetRange(LOCATION_MZONE)
e6:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e6:SetTargetRange(1,1)
e6:SetLabelObject(e5)
--e6:SetCondition(cm.costcon)
e6:SetCost(cm.costchk)
e6:SetTarget(cm.costtg)
e6:SetOperation(cm.costop)
e6:SetReset(RESET_EVENT+RESETS_STANDARD)
token:RegisterEffect(e6,true)
local e7=Effect.CreateEffect(c)
e7:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e7:SetCode(EVENT_EQUIP)
e7:SetOperation(cm.count)
e7:SetReset(RESET_EVENT+RESETS_STANDARD)
token:RegisterEffect(e7,true)
local e8=Effect.CreateEffect(c)
e8:SetDescription(aux.Stringid(m,2))
e8:SetCategory(CATEGORY_TODECK+CATEGORY_DRAW)
e8:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e8:SetCode(EVENT_CHAINING)
e8:SetRange(LOCATION_MZONE)
e8:SetCondition(cm.tdcon)
e8:SetTarget(cm.tdtg)
e8:SetOperation(cm.tdop)
token:RegisterEffect(e8,true)
if not token:IsType(TYPE_EFFECT) then
local e9=Effect.CreateEffect(c)
e9:SetType(EFFECT_TYPE_SINGLE)
e9:SetCode(EFFECT_ADD_TYPE)
e9:SetValue(TYPE_EFFECT)
e9:SetReset(RESET_EVENT+RESETS_STANDARD)
token:RegisterEffect(e9,true)
end
Duel.Hint(HINT_MUSIC,0,aux.Stringid(m,3))
end
function cm.count(e,tp,eg,ep,ev,re,r,rp)
local g=eg:Filter(function(c,ec)return c:GetEquipTarget()==ec end,nil,e:GetHandler())
for tc in aux.Next(g) do e:GetHandler():RegisterFlagEffect(m+tc:GetCode(),RESET_EVENT+RESETS_STANDARD,0,0) end
end
function cm.descon(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject()
if tc:GetFlagEffectLabel(m)~=e:GetLabel() then
e:Reset()
return false
else return true end
end
function cm.desop(e,tp,eg,ep,ev,re,r,rp)
Duel.SendtoGrave(e:GetLabelObject(),REASON_EFFECT)
end
function cm.effectfilter(e,ct)
local te=Duel.GetChainInfo(ct,CHAININFO_TRIGGERING_EFFECT)
local tc
if e:GetLabel()==3 then tc=e:GetLabelObject():GetLabelObject() else tc=e:GetLabelObject() end
return tc and tc==te:GetHandler()
end
function cm.chk(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local e3=e:GetLabelObject()
local e4=e3:GetLabelObject()
local te=c:GetReasonEffect()
if c:GetFlagEffect(m)==0 or not te or not te:IsActivated() or te:GetHandler()~=c then
e3:Reset()
e4:Reset()
else
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e0:SetCode(EVENT_CHAIN_END)
e0:SetLabelObject(e3)
e0:SetOperation(cm.resetop)
Duel.RegisterEffect(e0,tp)
end
end
function cm.resetop(e,tp,eg,ep,ev,re,r,rp)
local e3=e:GetLabelObject()
local e4=e3:GetLabelObject()
e3:Reset()
e4:Reset()
e:Reset()
end
function cm.eqfilter(c,tc)
return c:IsSetCard(0xa530) and not c:IsForbidden()
end
function cm.eqtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0 and Duel.IsExistingMatchingCard(cm.eqfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_DICE,nil,0,tp,1)
Duel.SetOperationInfo(0,CATEGORY_EQUIP,nil,1,tp,LOCATION_DECK)
end
function cm.eqop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 or c:IsFacedown() or not c:IsRelateToEffect(e) then return end
local dc=Duel.TossDice(tp,1)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
local tc=g:SelectMatchingCard(tp,cm.eqfilter,tp,LOCATION_DECK,0,1,1,nil):GetFirst()
if tc then
if not Duel.Equip(tp,tc,c) then return end
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetCode(EFFECT_EQUIP_LIMIT)
e0:SetProperty(EFFECT_FLAG_COPY_INHERIT+EFFECT_FLAG_OWNER_RELATE)
e0:SetReset(RESET_EVENT+RESETS_STANDARD)
e0:SetValue(cm.eqlimit)
tc:RegisterEffect(e0)
if tc:GetOriginalLevel()==dc and c:GetFlagEffect(m+tc:GetCode())==0 then return end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetValue(RESET_TURN_SET)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e2)
end
end
function cm.eqlimit(e,c)
return e:GetOwner()==c
end
function cm.cfilter(c)
return c:IsSetCard(0xa530) and c:IsAbleToDeckAsCost() and c:IsFaceup()
end
function cm.costcon(e)
return Duel.IsExistingMatchingCard(cm.cfilter,0,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil)
end
function cm.costchk(e,te_or_c,tp)
return Duel.IsExistingMatchingCard(cm.cfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil)
end
function cm.costtg(e,te,tp)
return te==e:GetLabelObject()
end
function cm.costop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.GetMatchingGroup(cm.cfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
Duel.SendtoDeck(g,nil,2,REASON_COST)
end
function cm.tdcon(e,tp,eg,ep,ev,re,r,rp)
local rc=re:GetHandler()
return rc:IsSetCard(0xa530) and rc:IsType(TYPE_TOKEN)
end
function cm.tdfilter(c)
if c:IsLocation(LOCATION_EXTRA) and c:IsFacedown() then return false end
if c:IsLocation(LOCATION_DECK+LOCATION_EXTRA) and c:GetOwner()==c:GetControler() then return false end
return c:IsAbleToDeck()
end
function cm.tdtg(e,tp,eg,ep,ev,re,r,rp,chk)
local rc=re:GetHandler()
if chk==0 then return Duel.GetFlagEffect(0,m+rc:GetCode())==11 end
e:SetLabel(rc:GetCode())
local g=Duel.GetMatchingGroup(cm.tdfilter,tp,0x7f,0x7f,e:GetHandler())
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,g:GetCount(),0,0x7f)
end
function cm.tdop(e,tp,eg,ep,ev,re,r,rp)
local sg=Duel.GetMatchingGroup(cm.tdfilter,tp,0x7f,0x7f,nil)
if aux.NecroValleyNegateCheck(sg) then return end
Duel.SendtoDeck(sg,nil,2,REASON_EFFECT)
local g=Duel.GetOperatedGroup()
if #g==0 then return end
local cg=g:Filter(Card.IsLocation,nil,LOCATION_DECK)
if cg:IsExists(Card.IsControler,1,nil,tp) then Duel.ShuffleDeck(tp) end
if cg:IsExists(Card.IsControler,1,nil,1-tp) then Duel.ShuffleDeck(1-tp) end
Duel.Draw(tp,5,REASON_EFFECT)
Duel.Draw(1-tp,5,REASON_EFFECT)
Duel.SetLP(0,cm.flp)
Duel.SetLP(1,cm.slp)
Duel.RegisterFlagEffect(0,e:GetCode()+50,0,0,0)
end
local m=53735002
local cm=_G["c"..m]
cm.name="大祭柱 邪奴"
if not require and dofile then function require(str) return dofile(str..".lua") end end
if not pcall(function() require("expansions/script/c53702500") end) then require("script/c53702500") end
function cm.initial_effect(c)
SNNM.GCSpirit(c,cm.op)
end
function cm.op(c)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_CHAIN_SOLVING)
e1:SetRange(LOCATION_SZONE)
e1:SetCondition(cm.negcon)
e1:SetOperation(cm.negop)
c:RegisterEffect(e1)
return e1
end
function cm.negcon(e,tp,eg,ep,ev,re,r,rp)
return rp~=tp and Duel.IsChainDisablable(ev) and e:GetHandler():IsAbleToExtra()
end
function cm.negop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.SelectYesNo(tp,aux.Stringid(m,1)) then
Duel.Hint(HINT_CARD,0,m)
if Duel.SendtoDeck(c,nil,2,REASON_EFFECT)~=0 and c:IsLocation(LOCATION_EXTRA) then
if Duel.NegateEffect(ev) and re:GetHandler():IsRelateToEffect(re) then Duel.Destroy(re:GetHandler(),REASON_EFFECT) end
end
end
end
if not require and dofile then function require(str) return dofile(str..".lua") end end
if not pcall(function() require("expansions/script/c53702500") end) then require("script/c53702500") end
local m=53756002
local cm=_G["c"..m]
cm.name="临终的暮辞 望美"
function cm.initial_effect(c)
c:SetUniqueOnField(1,0,aux.FilterBoolFunction(Card.IsSetCard,0xa530),LOCATION_MZONE)
local e1=Effect.CreateEffect(c)
local e1,e1_1,e2,e3=SNNM.ActivatedAsSpellorTrap(c,0x20004)
e1:SetDescription(aux.Stringid(m,0))
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_HAND)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e1:SetTarget(cm.acsptg)
e1:SetOperation(cm.spop)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_ADJUST)
e2:SetRange(LOCATION_HAND)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetLabelObject(e1)
e2:SetOperation(cm.adjustop)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_ACTIVATE_COST)
e3:SetRange(LOCATION_HAND)
e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e3:SetLabelObject(e2)
e3:SetTargetRange(1,1)
e3:SetTarget(cm.actarget)
e3:SetCost(cm.costchk)
e3:SetOperation(cm.costop)
c:RegisterEffect(e3)
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetProperty(EFFECT_FLAG_SINGLE_RANGE+EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e4:SetCode(m)
e4:SetRange(LOCATION_HAND)
c:RegisterEffect(e4)
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e5:SetRange(LOCATION_MZONE)
......@@ -58,19 +30,6 @@ function cm.initial_effect(c)
c:RegisterEffect(e6)
if not cm.global_check then
cm.global_check=true
cm[0]=Card.IsOriginalCodeRule
Card.IsOriginalCodeRule=function(tc,...)
if tc:GetFlagEffect(m+66)>0 then return true end
return cm[0](tc,...)
end
cm[1]=Card.GetOriginalCodeRule
Card.GetOriginalCodeRule=function(tc)
if tc:GetFlagEffect(m+66)>0 then
return m
else
return cm[1](tc)
end
end
cm[2]=Duel.GetDecktopGroup
Duel.GetDecktopGroup=function(tp,ct)
Duel.RegisterFlagEffect(tp,m,RESET_CHAIN,0,0)
......@@ -83,6 +42,7 @@ function cm.initial_effect(c)
return Duel.SendtoGrave(g,reason)
end
end
SNNM.ActivatedAsSpellorTrapCheck(c)
end
GM_global_to_deck_check=true
function cm.acsptg(e,tp,eg,ep,ev,re,r,rp,chk)
......@@ -97,279 +57,6 @@ function cm.acsptg(e,tp,eg,ep,ev,re,r,rp,chk)
e:SetCategory(0)
end
end
function cm.actarget(e,te,tp)
return te:GetHandler()==e:GetHandler() and te==e:GetLabelObject():GetLabelObject()
end
function cm.costchk(e,te_or_c,tp)
local fdzone=0
for i=0,4 do if Duel.CheckLocation(tp,LOCATION_SZONE,i) then fdzone=fdzone|1<<i end end
if aux.GetValueType(te_or_c)=="Effect" and te_or_c:IsHasProperty(EFFECT_FLAG_LIMIT_ZONE) then
local zone=te_or_c:GetValue()
if aux.GetValueType(zone)=="function" then
zone=zone(te_or_c,tp)
end
fdzone=fdzone&zone
e:SetLabel(fdzone)
end
return fdzone>0
end
function cm.costop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local te=e:GetLabelObject():GetLabelObject()
local zone=e:GetLabel()
if zone==0 then Duel.MoveToField(c,tp,tp,LOCATION_SZONE,POS_FACEUP,false) else
local flag=Duel.SelectDisableField(tp,1,LOCATION_SZONE,0,~zone&0x1f00)
Duel.MoveToField(c,tp,tp,LOCATION_SZONE,POS_FACEUP,false,2^(math.log(flag,2)-8))
end
e:SetLabel(0)
c:CreateEffectRelation(te)
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetCode(EFFECT_CHANGE_TYPE)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e0:SetValue(0x20004)
e0:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET)
c:RegisterEffect(e0,true)
local te2=te:Clone()
c:RegisterEffect(te2,true)
e:GetLabelObject():SetLabelObject(te2)
te:SetType(EFFECT_TYPE_ACTIVATE)
local ev0=Duel.GetCurrentChain()+1
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetCode(EVENT_CHAIN_SOLVED)
e1:SetCountLimit(1)
e1:SetCondition(function(e,tp,eg,ep,ev,re,r,rp) return ev==ev0 end)
e1:SetOperation(cm.rsop)
e1:SetReset(RESET_CHAIN)
Duel.RegisterEffect(e1,tp)
local e2=e1:Clone()
e2:SetCode(EVENT_CHAIN_NEGATED)
Duel.RegisterEffect(e2,tp)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_REMAIN_FIELD)
e3:SetProperty(EFFECT_FLAG_OATH+EFFECT_FLAG_CANNOT_DISABLE)
e3:SetReset(RESET_CHAIN)
c:RegisterEffect(e3)
end
function cm.rsop(e,tp,eg,ep,ev,re,r,rp)
local rc=re:GetHandler()
if e:GetCode()==EVENT_CHAIN_SOLVED and rc:IsRelateToEffect(re) then
rc:SetStatus(STATUS_EFFECT_ENABLED,true)
end
if e:GetCode()==EVENT_CHAIN_NEGATED and rc:IsRelateToEffect(re) then
rc:SetStatus(STATUS_ACTIVATE_DISABLED,true)
rc:CancelToGrave(false)
end
re:Reset()
end
function cm.adjustop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local te=e:GetLabelObject()
local re1={c:IsHasEffect(EFFECT_CANNOT_TRIGGER)}
local re2={Duel.IsPlayerAffectedByEffect(tp,EFFECT_CANNOT_ACTIVATE)}
local re3={Duel.IsPlayerAffectedByEffect(tp,EFFECT_ACTIVATE_COST)}
local t1,t2={},{}
for _,te1 in pairs(re1) do
table.insert(t1,te1)
if te1:GetType()==EFFECT_TYPE_SINGLE then
table.insert(t2,1)
end
if te1:GetType()==EFFECT_TYPE_EQUIP then
table.insert(t2,2)
end
if te1:GetType()==EFFECT_TYPE_FIELD then
table.insert(t2,3)
end
end
for _,te2 in pairs(re2) do
local val=te2:GetValue()
if aux.GetValueType(val)=="number" or val(te2,te,tp) then
table.insert(t1,te2)
table.insert(t2,4)
end
end
for _,te3 in pairs(re3) do
if not te3:GetLabelObject() then
local cost=te3:GetCost()
if cost and not cost(te3,te,tp) then
local tg=te3:GetTarget()
if not tg or tg(te3,te,tp) then
table.insert(t1,te3)
table.insert(t2,5)
end
end
end
end
local dc=Duel.CreateToken(tp,1344018)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CHANGE_CODE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetValue(m)
dc:RegisterEffect(e1,true)
dc:RegisterFlagEffect(m+66,0,0,0)
local de=dc:GetActivateEffect()
local ae2={Duel.IsPlayerAffectedByEffect(tp,EFFECT_CANNOT_ACTIVATE)}
local ae3={Duel.IsPlayerAffectedByEffect(tp,EFFECT_ACTIVATE_COST)}
local t3,t4={},{}
for _,te2 in pairs(ae2) do
local val=te2:GetValue()
if aux.GetValueType(val)=="number" or val(te2,de,tp) then
table.insert(t3,te2)
table.insert(t4,4)
end
end
for _,te3 in pairs(ae3) do
if not te3:GetLabelObject() then
local cost=te3:GetCost()
if cost and not cost(te3,de,tp) then
local tg=te3:GetTarget()
if not tg or tg(te3,de,tp) then
table.insert(t3,te3)
table.insert(t4,5)
end
end
end
end
local ret1,ret2={},{}
for k,v1 in pairs(t1) do
local equal=false
for k,v2 in pairs(t3) do
if v1==v2 then
equal=true
break
end
end
if not equal then
table.insert(ret1,v1)
table.insert(ret2,t2[k])
end
end
local ret3,ret4={},{}
for k,v1 in pairs(t3) do
local equal=false
for k,v2 in pairs(t1) do
if v1==v2 then
equal=true
break
end
end
if not equal then
table.insert(ret3,v1)
table.insert(ret4,t4[k])
end
end
for k,v in pairs(ret1) do
if ret2[k]==1 then
local con=v:GetCondition()
if not con then con=aux.TRUE end
v:SetCondition(cm.chcon(con,false))
end
if ret2[k]==2 then
local con=v:GetCondition()
if not con then con=aux.TRUE end
v:SetCondition(cm.chcon2(con,false))
end
if ret2[k]==3 then
local tg=v:GetTarget()
if not tg then
v:SetTarget(cm.chtg(aux.TRUE,false))
elseif tg(v,c)==true then
v:SetTarget(cm.chtg(tg,false))
end
end
if ret2[k]==4 then
local val=v:GetValue()
if aux.GetValueType(val)=="number" then val=aux.TRUE end
if val(v,te,tp) then
v:SetValue(cm.chval(val,false))
end
end
if ret2[k]==5 then
if not v:GetLabelObject() then
local cost=v:GetCost()
if cost and not cost(v,te,tp) then
local tg=v:GetTarget()
if not tg then
v:SetTarget(cm.chtg2(aux.TRUE,false))
elseif tg(v,te,tp) then
v:SetTarget(cm.chtg2(tg,false))
end
end
end
end
end
for k,v in pairs(ret3) do
if ret4[k]==4 then
local val=v:GetValue()
if aux.GetValueType(val)=="number" then val=aux.TRUE end
if val(v,de,tp) then
v:SetValue(cm.chval(val,true))
end
end
if ret4[k]==5 then
if not v:GetLabelObject() then
local cost=v:GetCost()
if cost and not cost(v,de,tp) then
local tg=v:GetTarget()
if not tg then
v:SetTarget(cm.chtg2(aux.TRUE,true))
elseif tg(v,de,tp) then
v:SetTarget(cm.chtg2(tg,true))
end
end
end
end
end
end
function cm.chcon(_con,res)
return function(e,...)
local x=e:GetHandler()
if x:IsHasEffect(m) then return res end
return _con(e,...)
end
end
function cm.chcon2(_con,res)
return function(e,...)
local x=e:GetHandler():GetEquipTarget()
if x:IsHasEffect(m) then return res end
return _con(e,...)
end
end
function cm.chtg(_tg,res)
return function(e,c,...)
if c:IsHasEffect(m) then return res end
return _tg(e,c,...)
end
end
function cm.chval(_val,res)
return function(e,re,...)
local x=nil
if aux.GetValueType(re)=="Effect" then x=re:GetHandler() elseif aux.GetValueType(re)=="Card" then
local rc=Duel.CreateToken(tp,1344018)
local e1=Effect.CreateEffect(rc)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CHANGE_CODE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetValue(m)
rc:RegisterEffect(e1,true)
rc:RegisterFlagEffect(m+66,0,0,0)
re=rc:GetActivateEffect()
else return res end
if x and x:IsHasEffect(m) then return res end
return _val(e,re,...)
end
end
function cm.chtg2(_tg,res)
return function(e,te,...)
local x=te:GetHandler()
if x:IsHasEffect(m) then return res end
return _tg(e,te,...)
end
end
function cm.repcheck(c,p,loc)
local g=Duel.GetFieldGroup(p,loc,0)
if #g==0 then return true end
......
if not require and dofile then function require(str) return dofile(str..".lua") end end
if not pcall(function() require("expansions/script/c53702500") end) then require("script/c53702500") end
local m=53756003
local cm=_G["c"..m]
cm.name="最后的暮辞 真昼"
function cm.initial_effect(c)
c:SetUniqueOnField(1,0,aux.FilterBoolFunction(Card.IsSetCard,0xa530),LOCATION_MZONE)
local e1=Effect.CreateEffect(c)
local e1,e1_1,e2,e3=SNNM.ActivatedAsSpellorTrap(c,0x20004)
e1:SetDescription(aux.Stringid(m,0))
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_HAND)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e1:SetTarget(cm.acsptg)
e1:SetOperation(cm.spop)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_ADJUST)
e2:SetRange(LOCATION_HAND)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetLabelObject(e1)
e2:SetOperation(cm.adjustop)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_ACTIVATE_COST)
e3:SetRange(LOCATION_HAND)
e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e3:SetLabelObject(e2)
e3:SetTargetRange(1,1)
e3:SetTarget(cm.actarget)
e3:SetCost(cm.costchk)
e3:SetOperation(cm.costop)
c:RegisterEffect(e3)
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetProperty(EFFECT_FLAG_SINGLE_RANGE+EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e4:SetCode(m)
e4:SetRange(LOCATION_HAND)
c:RegisterEffect(e4)
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e5:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
......@@ -56,22 +28,7 @@ function cm.initial_effect(c)
e6:SetTarget(cm.sptg)
e6:SetOperation(cm.spop)
c:RegisterEffect(e6)
if not cm.global_check then
cm.global_check=true
cm[0]=Card.IsOriginalCodeRule
Card.IsOriginalCodeRule=function(tc,...)
if tc:GetFlagEffect(m+66)>0 then return true end
return cm[0](tc,...)
end
cm[1]=Card.GetOriginalCodeRule
Card.GetOriginalCodeRule=function(tc)
if tc:GetFlagEffect(m+66)>0 then
return m
else
return cm[1](tc)
end
end
end
SNNM.ActivatedAsSpellorTrapCheck(c)
end
function cm.acsptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
......@@ -84,279 +41,6 @@ function cm.acsptg(e,tp,eg,ep,ev,re,r,rp,chk)
e:SetCategory(0)
end
end
function cm.actarget(e,te,tp)
return te:GetHandler()==e:GetHandler() and te==e:GetLabelObject():GetLabelObject()
end
function cm.costchk(e,te_or_c,tp)
local fdzone=0
for i=0,4 do if Duel.CheckLocation(tp,LOCATION_SZONE,i) then fdzone=fdzone|1<<i end end
if aux.GetValueType(te_or_c)=="Effect" and te_or_c:IsHasProperty(EFFECT_FLAG_LIMIT_ZONE) then
local zone=te_or_c:GetValue()
if aux.GetValueType(c)=="function" then
zone=zone(te_or_c,tp)
end
fdzone=fdzone&zone
e:SetLabel(fdzone)
end
return fdzone>0
end
function cm.costop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local te=e:GetLabelObject():GetLabelObject()
local zone=e:GetLabel()
if zone==0 then Duel.MoveToField(c,tp,tp,LOCATION_SZONE,POS_FACEUP,false) else
local flag=Duel.SelectDisableField(tp,1,LOCATION_SZONE,0,~zone&0x1f00)
Duel.MoveToField(c,tp,tp,LOCATION_SZONE,POS_FACEUP,false,2^(math.log(flag,2)-8))
end
e:SetLabel(0)
c:CreateEffectRelation(te)
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetCode(EFFECT_CHANGE_TYPE)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e0:SetValue(0x20004)
e0:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET)
c:RegisterEffect(e0,true)
local te2=te:Clone()
c:RegisterEffect(te2,true)
e:GetLabelObject():SetLabelObject(te2)
te:SetType(EFFECT_TYPE_ACTIVATE)
local ev0=Duel.GetCurrentChain()+1
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetCode(EVENT_CHAIN_SOLVED)
e1:SetCountLimit(1)
e1:SetCondition(function(e,tp,eg,ep,ev,re,r,rp) return ev==ev0 end)
e1:SetOperation(cm.rsop)
e1:SetReset(RESET_CHAIN)
Duel.RegisterEffect(e1,tp)
local e2=e1:Clone()
e2:SetCode(EVENT_CHAIN_NEGATED)
Duel.RegisterEffect(e2,tp)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_REMAIN_FIELD)
e3:SetProperty(EFFECT_FLAG_OATH+EFFECT_FLAG_CANNOT_DISABLE)
e3:SetReset(RESET_CHAIN)
c:RegisterEffect(e3)
end
function cm.rsop(e,tp,eg,ep,ev,re,r,rp)
local rc=re:GetHandler()
if e:GetCode()==EVENT_CHAIN_SOLVED and rc:IsRelateToEffect(re) then
rc:SetStatus(STATUS_EFFECT_ENABLED,true)
end
if e:GetCode()==EVENT_CHAIN_NEGATED and rc:IsRelateToEffect(re) then
rc:SetStatus(STATUS_ACTIVATE_DISABLED,true)
rc:CancelToGrave(false)
end
re:Reset()
end
function cm.adjustop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local te=e:GetLabelObject()
local re1={c:IsHasEffect(EFFECT_CANNOT_TRIGGER)}
local re2={Duel.IsPlayerAffectedByEffect(tp,EFFECT_CANNOT_ACTIVATE)}
local re3={Duel.IsPlayerAffectedByEffect(tp,EFFECT_ACTIVATE_COST)}
local t1,t2={},{}
for _,te1 in pairs(re1) do
table.insert(t1,te1)
if te1:GetType()==EFFECT_TYPE_SINGLE then
table.insert(t2,1)
end
if te1:GetType()==EFFECT_TYPE_EQUIP then
table.insert(t2,2)
end
if te1:GetType()==EFFECT_TYPE_FIELD then
table.insert(t2,3)
end
end
for _,te2 in pairs(re2) do
local val=te2:GetValue()
if aux.GetValueType(val)=="number" or val(te2,te,tp) then
table.insert(t1,te2)
table.insert(t2,4)
end
end
for _,te3 in pairs(re3) do
if not te3:GetLabelObject() then
local cost=te3:GetCost()
if cost and not cost(te3,te,tp) then
local tg=te3:GetTarget()
if not tg or tg(te3,te,tp) then
table.insert(t1,te3)
table.insert(t2,5)
end
end
end
end
local dc=Duel.CreateToken(tp,1344018)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CHANGE_CODE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetValue(m)
dc:RegisterEffect(e1,true)
dc:RegisterFlagEffect(m+66,0,0,0)
local de=dc:GetActivateEffect()
local ae2={Duel.IsPlayerAffectedByEffect(tp,EFFECT_CANNOT_ACTIVATE)}
local ae3={Duel.IsPlayerAffectedByEffect(tp,EFFECT_ACTIVATE_COST)}
local t3,t4={},{}
for _,te2 in pairs(ae2) do
local val=te2:GetValue()
if aux.GetValueType(val)=="number" or val(te2,de,tp) then
table.insert(t3,te2)
table.insert(t4,4)
end
end
for _,te3 in pairs(ae3) do
if not te3:GetLabelObject() then
local cost=te3:GetCost()
if cost and not cost(te3,de,tp) then
local tg=te3:GetTarget()
if not tg or tg(te3,de,tp) then
table.insert(t3,te3)
table.insert(t4,5)
end
end
end
end
local ret1,ret2={},{}
for k,v1 in pairs(t1) do
local equal=false
for k,v2 in pairs(t3) do
if v1==v2 then
equal=true
break
end
end
if not equal then
table.insert(ret1,v1)
table.insert(ret2,t2[k])
end
end
local ret3,ret4={},{}
for k,v1 in pairs(t3) do
local equal=false
for k,v2 in pairs(t1) do
if v1==v2 then
equal=true
break
end
end
if not equal then
table.insert(ret3,v1)
table.insert(ret4,t4[k])
end
end
for k,v in pairs(ret1) do
if ret2[k]==1 then
local con=v:GetCondition()
if not con then con=aux.TRUE end
v:SetCondition(cm.chcon(con,false))
end
if ret2[k]==2 then
local con=v:GetCondition()
if not con then con=aux.TRUE end
v:SetCondition(cm.chcon2(con,false))
end
if ret2[k]==3 then
local tg=v:GetTarget()
if not tg then
v:SetTarget(cm.chtg(aux.TRUE,false))
elseif tg(v,c)==true then
v:SetTarget(cm.chtg(tg,false))
end
end
if ret2[k]==4 then
local val=v:GetValue()
if aux.GetValueType(val)=="number" then val=aux.TRUE end
if val(v,te,tp) then
v:SetValue(cm.chval(val,false))
end
end
if ret2[k]==5 then
if not v:GetLabelObject() then
local cost=v:GetCost()
if cost and not cost(v,te,tp) then
local tg=v:GetTarget()
if not tg then
v:SetTarget(cm.chtg2(aux.TRUE,false))
elseif tg(v,te,tp) then
v:SetTarget(cm.chtg2(tg,false))
end
end
end
end
end
for k,v in pairs(ret3) do
if ret4[k]==4 then
local val=v:GetValue()
if aux.GetValueType(val)=="number" then val=aux.TRUE end
if val(v,de,tp) then
v:SetValue(cm.chval(val,true))
end
end
if ret4[k]==5 then
if not v:GetLabelObject() then
local cost=v:GetCost()
if cost and not cost(v,de,tp) then
local tg=v:GetTarget()
if not tg then
v:SetTarget(cm.chtg2(aux.TRUE,true))
elseif tg(v,de,tp) then
v:SetTarget(cm.chtg2(tg,true))
end
end
end
end
end
end
function cm.chcon(_con,res)
return function(e,...)
local x=e:GetHandler()
if x:IsHasEffect(m) then return res end
return _con(e,...)
end
end
function cm.chcon2(_con,res)
return function(e,...)
local x=e:GetHandler():GetEquipTarget()
if x:IsHasEffect(m) then return res end
return _con(e,...)
end
end
function cm.chtg(_tg,res)
return function(e,c,...)
if c:IsHasEffect(m) then return res end
return _tg(e,c,...)
end
end
function cm.chval(_val,res)
return function(e,re,...)
local x=nil
if aux.GetValueType(re)=="Effect" then x=re:GetHandler() elseif aux.GetValueType(re)=="Card" then
local rc=Duel.CreateToken(tp,1344018)
local e1=Effect.CreateEffect(rc)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CHANGE_CODE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetValue(m)
rc:RegisterEffect(e1,true)
rc:RegisterFlagEffect(m+66,0,0,0)
re=rc:GetActivateEffect()
else return res end
if x and x:IsHasEffect(m) then return res end
return _val(e,re,...)
end
end
function cm.chtg2(_tg,res)
return function(e,te,...)
local x=te:GetHandler()
if x:IsHasEffect(m) then return res end
return _tg(e,te,...)
end
end
function cm.desop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetChainInfo(ev,CHAININFO_TARGET_CARDS)
if not g then return end
......
if not require and dofile then function require(str) return dofile(str..".lua") end end
if not pcall(function() require("expansions/script/c53702500") end) then require("script/c53702500") end
local m=53756004
local cm=_G["c"..m]
cm.name="期待的暮辞 御幸"
function cm.initial_effect(c)
c:SetUniqueOnField(1,0,aux.FilterBoolFunction(Card.IsSetCard,0xa530),LOCATION_MZONE)
local e1=Effect.CreateEffect(c)
local e1,e1_1,e2,e3=SNNM.ActivatedAsSpellorTrap(c,0x20004)
e1:SetDescription(aux.Stringid(m,0))
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_HAND)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e1:SetTarget(cm.acsptg)
e1:SetOperation(cm.spop)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_ADJUST)
e2:SetRange(LOCATION_HAND)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetLabelObject(e1)
e2:SetOperation(cm.adjustop)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_ACTIVATE_COST)
e3:SetRange(LOCATION_HAND)
e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e3:SetLabelObject(e2)
e3:SetTargetRange(1,1)
e3:SetTarget(cm.actarget)
e3:SetCost(cm.costchk)
e3:SetOperation(cm.costop)
c:RegisterEffect(e3)
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetProperty(EFFECT_FLAG_SINGLE_RANGE+EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e4:SetCode(m)
e4:SetRange(LOCATION_HAND)
c:RegisterEffect(e4)
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e5:SetCode(EVENT_ADJUST)
......@@ -54,22 +26,7 @@ function cm.initial_effect(c)
e6:SetTarget(cm.sptg)
e6:SetOperation(cm.spop)
c:RegisterEffect(e6)
if not cm.global_check then
cm.global_check=true
cm[0]=Card.IsOriginalCodeRule
Card.IsOriginalCodeRule=function(tc,...)
if tc:GetFlagEffect(m+66)>0 then return true end
return cm[0](tc,...)
end
cm[1]=Card.GetOriginalCodeRule
Card.GetOriginalCodeRule=function(tc)
if tc:GetFlagEffect(m+66)>0 then
return m
else
return cm[1](tc)
end
end
end
SNNM.ActivatedAsSpellorTrapCheck(c)
end
function cm.acsptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
......@@ -82,279 +39,6 @@ function cm.acsptg(e,tp,eg,ep,ev,re,r,rp,chk)
e:SetCategory(0)
end
end
function cm.actarget(e,te,tp)
return te:GetHandler()==e:GetHandler() and te==e:GetLabelObject():GetLabelObject()
end
function cm.costchk(e,te_or_c,tp)
local fdzone=0
for i=0,4 do if Duel.CheckLocation(tp,LOCATION_SZONE,i) then fdzone=fdzone|1<<i end end
if aux.GetValueType(te_or_c)=="Effect" and te_or_c:IsHasProperty(EFFECT_FLAG_LIMIT_ZONE) then
local zone=te_or_c:GetValue()
if aux.GetValueType(c)=="function" then
zone=zone(te_or_c,tp)
end
fdzone=fdzone&zone
e:SetLabel(fdzone)
end
return fdzone>0
end
function cm.costop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local te=e:GetLabelObject():GetLabelObject()
local zone=e:GetLabel()
if zone==0 then Duel.MoveToField(c,tp,tp,LOCATION_SZONE,POS_FACEUP,false) else
local flag=Duel.SelectDisableField(tp,1,LOCATION_SZONE,0,~zone&0x1f00)
Duel.MoveToField(c,tp,tp,LOCATION_SZONE,POS_FACEUP,false,2^(math.log(flag,2)-8))
end
e:SetLabel(0)
c:CreateEffectRelation(te)
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetCode(EFFECT_CHANGE_TYPE)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e0:SetValue(0x20004)
e0:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET)
c:RegisterEffect(e0,true)
local te2=te:Clone()
c:RegisterEffect(te2,true)
e:GetLabelObject():SetLabelObject(te2)
te:SetType(EFFECT_TYPE_ACTIVATE)
local ev0=Duel.GetCurrentChain()+1
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetCode(EVENT_CHAIN_SOLVED)
e1:SetCountLimit(1)
e1:SetCondition(function(e,tp,eg,ep,ev,re,r,rp) return ev==ev0 end)
e1:SetOperation(cm.rsop)
e1:SetReset(RESET_CHAIN)
Duel.RegisterEffect(e1,tp)
local e2=e1:Clone()
e2:SetCode(EVENT_CHAIN_NEGATED)
Duel.RegisterEffect(e2,tp)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_REMAIN_FIELD)
e3:SetProperty(EFFECT_FLAG_OATH+EFFECT_FLAG_CANNOT_DISABLE)
e3:SetReset(RESET_CHAIN)
c:RegisterEffect(e3)
end
function cm.rsop(e,tp,eg,ep,ev,re,r,rp)
local rc=re:GetHandler()
if e:GetCode()==EVENT_CHAIN_SOLVED and rc:IsRelateToEffect(re) then
rc:SetStatus(STATUS_EFFECT_ENABLED,true)
end
if e:GetCode()==EVENT_CHAIN_NEGATED and rc:IsRelateToEffect(re) then
rc:SetStatus(STATUS_ACTIVATE_DISABLED,true)
rc:CancelToGrave(false)
end
re:Reset()
end
function cm.adjustop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local te=e:GetLabelObject()
local re1={c:IsHasEffect(EFFECT_CANNOT_TRIGGER)}
local re2={Duel.IsPlayerAffectedByEffect(tp,EFFECT_CANNOT_ACTIVATE)}
local re3={Duel.IsPlayerAffectedByEffect(tp,EFFECT_ACTIVATE_COST)}
local t1,t2={},{}
for _,te1 in pairs(re1) do
table.insert(t1,te1)
if te1:GetType()==EFFECT_TYPE_SINGLE then
table.insert(t2,1)
end
if te1:GetType()==EFFECT_TYPE_EQUIP then
table.insert(t2,2)
end
if te1:GetType()==EFFECT_TYPE_FIELD then
table.insert(t2,3)
end
end
for _,te2 in pairs(re2) do
local val=te2:GetValue()
if aux.GetValueType(val)=="number" or val(te2,te,tp) then
table.insert(t1,te2)
table.insert(t2,4)
end
end
for _,te3 in pairs(re3) do
if not te3:GetLabelObject() then
local cost=te3:GetCost()
if cost and not cost(te3,te,tp) then
local tg=te3:GetTarget()
if not tg or tg(te3,te,tp) then
table.insert(t1,te3)
table.insert(t2,5)
end
end
end
end
local dc=Duel.CreateToken(tp,1344018)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CHANGE_CODE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetValue(m)
dc:RegisterEffect(e1,true)
dc:RegisterFlagEffect(m+66,0,0,0)
local de=dc:GetActivateEffect()
local ae2={Duel.IsPlayerAffectedByEffect(tp,EFFECT_CANNOT_ACTIVATE)}
local ae3={Duel.IsPlayerAffectedByEffect(tp,EFFECT_ACTIVATE_COST)}
local t3,t4={},{}
for _,te2 in pairs(ae2) do
local val=te2:GetValue()
if aux.GetValueType(val)=="number" or val(te2,de,tp) then
table.insert(t3,te2)
table.insert(t4,4)
end
end
for _,te3 in pairs(ae3) do
if not te3:GetLabelObject() then
local cost=te3:GetCost()
if cost and not cost(te3,de,tp) then
local tg=te3:GetTarget()
if not tg or tg(te3,de,tp) then
table.insert(t3,te3)
table.insert(t4,5)
end
end
end
end
local ret1,ret2={},{}
for k,v1 in pairs(t1) do
local equal=false
for k,v2 in pairs(t3) do
if v1==v2 then
equal=true
break
end
end
if not equal then
table.insert(ret1,v1)
table.insert(ret2,t2[k])
end
end
local ret3,ret4={},{}
for k,v1 in pairs(t3) do
local equal=false
for k,v2 in pairs(t1) do
if v1==v2 then
equal=true
break
end
end
if not equal then
table.insert(ret3,v1)
table.insert(ret4,t4[k])
end
end
for k,v in pairs(ret1) do
if ret2[k]==1 then
local con=v:GetCondition()
if not con then con=aux.TRUE end
v:SetCondition(cm.chcon(con,false))
end
if ret2[k]==2 then
local con=v:GetCondition()
if not con then con=aux.TRUE end
v:SetCondition(cm.chcon2(con,false))
end
if ret2[k]==3 then
local tg=v:GetTarget()
if not tg then
v:SetTarget(cm.chtg(aux.TRUE,false))
elseif tg(v,c)==true then
v:SetTarget(cm.chtg(tg,false))
end
end
if ret2[k]==4 then
local val=v:GetValue()
if aux.GetValueType(val)=="number" then val=aux.TRUE end
if val(v,te,tp) then
v:SetValue(cm.chval(val,false))
end
end
if ret2[k]==5 then
if not v:GetLabelObject() then
local cost=v:GetCost()
if cost and not cost(v,te,tp) then
local tg=v:GetTarget()
if not tg then
v:SetTarget(cm.chtg2(aux.TRUE,false))
elseif tg(v,te,tp) then
v:SetTarget(cm.chtg2(tg,false))
end
end
end
end
end
for k,v in pairs(ret3) do
if ret4[k]==4 then
local val=v:GetValue()
if aux.GetValueType(val)=="number" then val=aux.TRUE end
if val(v,de,tp) then
v:SetValue(cm.chval(val,true))
end
end
if ret4[k]==5 then
if not v:GetLabelObject() then
local cost=v:GetCost()
if cost and not cost(v,de,tp) then
local tg=v:GetTarget()
if not tg then
v:SetTarget(cm.chtg2(aux.TRUE,true))
elseif tg(v,de,tp) then
v:SetTarget(cm.chtg2(tg,true))
end
end
end
end
end
end
function cm.chcon(_con,res)
return function(e,...)
local x=e:GetHandler()
if x:IsHasEffect(m) then return res end
return _con(e,...)
end
end
function cm.chcon2(_con,res)
return function(e,...)
local x=e:GetHandler():GetEquipTarget()
if x:IsHasEffect(m) then return res end
return _con(e,...)
end
end
function cm.chtg(_tg,res)
return function(e,c,...)
if c:IsHasEffect(m) then return res end
return _tg(e,c,...)
end
end
function cm.chval(_val,res)
return function(e,re,...)
local x=nil
if aux.GetValueType(re)=="Effect" then x=re:GetHandler() elseif aux.GetValueType(re)=="Card" then
local rc=Duel.CreateToken(tp,1344018)
local e1=Effect.CreateEffect(rc)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CHANGE_CODE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetValue(m)
rc:RegisterEffect(e1,true)
rc:RegisterFlagEffect(m+66,0,0,0)
re=rc:GetActivateEffect()
else return res end
if x and x:IsHasEffect(m) then return res end
return _val(e,re,...)
end
end
function cm.chtg2(_tg,res)
return function(e,te,...)
local x=te:GetHandler()
if x:IsHasEffect(m) then return res end
return _tg(e,te,...)
end
end
function cm.negcon(e,tp,eg,ep,ev,re,r,rp)
return (Duel.CheckEvent(EVENT_ATTACK_ANNOUNCE) or Duel.GetCurrentPhase()==PHASE_BATTLE_STEP) and Duel.GetFlagEffect(0,m)==0
end
......
if not require and dofile then function require(str) return dofile(str..".lua") end end
if not pcall(function() require("expansions/script/c53702500") end) then require("script/c53702500") end
local m=53756005
local cm=_G["c"..m]
cm.name="愿闻的暮辞 羽由"
function cm.initial_effect(c)
c:SetUniqueOnField(1,0,aux.FilterBoolFunction(Card.IsSetCard,0xa530),LOCATION_MZONE)
local e1=Effect.CreateEffect(c)
local e1,e1_1,e2,e3=SNNM.ActivatedAsSpellorTrap(c,0x20004)
e1:SetDescription(aux.Stringid(m,0))
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_HAND)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e1:SetTarget(cm.acsptg)
e1:SetOperation(cm.spop)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_ADJUST)
e2:SetRange(LOCATION_HAND)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetLabelObject(e1)
e2:SetOperation(cm.adjustop)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_ACTIVATE_COST)
e3:SetRange(LOCATION_HAND)
e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e3:SetLabelObject(e2)
e3:SetTargetRange(1,1)
e3:SetTarget(cm.actarget)
e3:SetCost(cm.costchk)
e3:SetOperation(cm.costop)
c:RegisterEffect(e3)
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetProperty(EFFECT_FLAG_SINGLE_RANGE+EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e4:SetCode(m)
e4:SetRange(LOCATION_HAND)
c:RegisterEffect(e4)
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e5:SetCode(EVENT_CHAIN_SOLVED)
......@@ -55,22 +27,7 @@ function cm.initial_effect(c)
e6:SetTarget(cm.sptg)
e6:SetOperation(cm.spop)
c:RegisterEffect(e6)
if not cm.global_check then
cm.global_check=true
cm[0]=Card.IsOriginalCodeRule
Card.IsOriginalCodeRule=function(tc,...)
if tc:GetFlagEffect(m+66)>0 then return true end
return cm[0](tc,...)
end
cm[1]=Card.GetOriginalCodeRule
Card.GetOriginalCodeRule=function(tc)
if tc:GetFlagEffect(m+66)>0 then
return m
else
return cm[1](tc)
end
end
end
SNNM.ActivatedAsSpellorTrapCheck(c)
end
function cm.acsptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
......@@ -84,279 +41,6 @@ function cm.acsptg(e,tp,eg,ep,ev,re,r,rp,chk)
e:SetCategory(0)
end
end
function cm.actarget(e,te,tp)
return te:GetHandler()==e:GetHandler() and te==e:GetLabelObject():GetLabelObject()
end
function cm.costchk(e,te_or_c,tp)
local fdzone=0
for i=0,4 do if Duel.CheckLocation(tp,LOCATION_SZONE,i) then fdzone=fdzone|1<<i end end
if aux.GetValueType(te_or_c)=="Effect" and te_or_c:IsHasProperty(EFFECT_FLAG_LIMIT_ZONE) then
local zone=te_or_c:GetValue()
if aux.GetValueType(c)=="function" then
zone=zone(te_or_c,tp)
end
fdzone=fdzone&zone
e:SetLabel(fdzone)
end
return fdzone>0
end
function cm.costop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local te=e:GetLabelObject():GetLabelObject()
local zone=e:GetLabel()
if zone==0 then Duel.MoveToField(c,tp,tp,LOCATION_SZONE,POS_FACEUP,false) else
local flag=Duel.SelectDisableField(tp,1,LOCATION_SZONE,0,~zone&0x1f00)
Duel.MoveToField(c,tp,tp,LOCATION_SZONE,POS_FACEUP,false,2^(math.log(flag,2)-8))
end
e:SetLabel(0)
c:CreateEffectRelation(te)
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetCode(EFFECT_CHANGE_TYPE)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e0:SetValue(0x20004)
e0:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET)
c:RegisterEffect(e0,true)
local te2=te:Clone()
c:RegisterEffect(te2,true)
e:GetLabelObject():SetLabelObject(te2)
te:SetType(EFFECT_TYPE_ACTIVATE)
local ev0=Duel.GetCurrentChain()+1
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetCode(EVENT_CHAIN_SOLVED)
e1:SetCountLimit(1)
e1:SetCondition(function(e,tp,eg,ep,ev,re,r,rp) return ev==ev0 end)
e1:SetOperation(cm.rsop)
e1:SetReset(RESET_CHAIN)
Duel.RegisterEffect(e1,tp)
local e2=e1:Clone()
e2:SetCode(EVENT_CHAIN_NEGATED)
Duel.RegisterEffect(e2,tp)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_REMAIN_FIELD)
e3:SetProperty(EFFECT_FLAG_OATH+EFFECT_FLAG_CANNOT_DISABLE)
e3:SetReset(RESET_CHAIN)
c:RegisterEffect(e3)
end
function cm.rsop(e,tp,eg,ep,ev,re,r,rp)
local rc=re:GetHandler()
if e:GetCode()==EVENT_CHAIN_SOLVED and rc:IsRelateToEffect(re) then
rc:SetStatus(STATUS_EFFECT_ENABLED,true)
end
if e:GetCode()==EVENT_CHAIN_NEGATED and rc:IsRelateToEffect(re) then
rc:SetStatus(STATUS_ACTIVATE_DISABLED,true)
rc:CancelToGrave(false)
end
re:Reset()
end
function cm.adjustop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local te=e:GetLabelObject()
local re1={c:IsHasEffect(EFFECT_CANNOT_TRIGGER)}
local re2={Duel.IsPlayerAffectedByEffect(tp,EFFECT_CANNOT_ACTIVATE)}
local re3={Duel.IsPlayerAffectedByEffect(tp,EFFECT_ACTIVATE_COST)}
local t1,t2={},{}
for _,te1 in pairs(re1) do
table.insert(t1,te1)
if te1:GetType()==EFFECT_TYPE_SINGLE then
table.insert(t2,1)
end
if te1:GetType()==EFFECT_TYPE_EQUIP then
table.insert(t2,2)
end
if te1:GetType()==EFFECT_TYPE_FIELD then
table.insert(t2,3)
end
end
for _,te2 in pairs(re2) do
local val=te2:GetValue()
if aux.GetValueType(val)=="number" or val(te2,te,tp) then
table.insert(t1,te2)
table.insert(t2,4)
end
end
for _,te3 in pairs(re3) do
if not te3:GetLabelObject() then
local cost=te3:GetCost()
if cost and not cost(te3,te,tp) then
local tg=te3:GetTarget()
if not tg or tg(te3,te,tp) then
table.insert(t1,te3)
table.insert(t2,5)
end
end
end
end
local dc=Duel.CreateToken(tp,1344018)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CHANGE_CODE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetValue(m)
dc:RegisterEffect(e1,true)
dc:RegisterFlagEffect(m+66,0,0,0)
local de=dc:GetActivateEffect()
local ae2={Duel.IsPlayerAffectedByEffect(tp,EFFECT_CANNOT_ACTIVATE)}
local ae3={Duel.IsPlayerAffectedByEffect(tp,EFFECT_ACTIVATE_COST)}
local t3,t4={},{}
for _,te2 in pairs(ae2) do
local val=te2:GetValue()
if aux.GetValueType(val)=="number" or val(te2,de,tp) then
table.insert(t3,te2)
table.insert(t4,4)
end
end
for _,te3 in pairs(ae3) do
if not te3:GetLabelObject() then
local cost=te3:GetCost()
if cost and not cost(te3,de,tp) then
local tg=te3:GetTarget()
if not tg or tg(te3,de,tp) then
table.insert(t3,te3)
table.insert(t4,5)
end
end
end
end
local ret1,ret2={},{}
for k,v1 in pairs(t1) do
local equal=false
for k,v2 in pairs(t3) do
if v1==v2 then
equal=true
break
end
end
if not equal then
table.insert(ret1,v1)
table.insert(ret2,t2[k])
end
end
local ret3,ret4={},{}
for k,v1 in pairs(t3) do
local equal=false
for k,v2 in pairs(t1) do
if v1==v2 then
equal=true
break
end
end
if not equal then
table.insert(ret3,v1)
table.insert(ret4,t4[k])
end
end
for k,v in pairs(ret1) do
if ret2[k]==1 then
local con=v:GetCondition()
if not con then con=aux.TRUE end
v:SetCondition(cm.chcon(con,false))
end
if ret2[k]==2 then
local con=v:GetCondition()
if not con then con=aux.TRUE end
v:SetCondition(cm.chcon2(con,false))
end
if ret2[k]==3 then
local tg=v:GetTarget()
if not tg then
v:SetTarget(cm.chtg(aux.TRUE,false))
elseif tg(v,c)==true then
v:SetTarget(cm.chtg(tg,false))
end
end
if ret2[k]==4 then
local val=v:GetValue()
if aux.GetValueType(val)=="number" then val=aux.TRUE end
if val(v,te,tp) then
v:SetValue(cm.chval(val,false))
end
end
if ret2[k]==5 then
if not v:GetLabelObject() then
local cost=v:GetCost()
if cost and not cost(v,te,tp) then
local tg=v:GetTarget()
if not tg then
v:SetTarget(cm.chtg2(aux.TRUE,false))
elseif tg(v,te,tp) then
v:SetTarget(cm.chtg2(tg,false))
end
end
end
end
end
for k,v in pairs(ret3) do
if ret4[k]==4 then
local val=v:GetValue()
if aux.GetValueType(val)=="number" then val=aux.TRUE end
if val(v,de,tp) then
v:SetValue(cm.chval(val,true))
end
end
if ret4[k]==5 then
if not v:GetLabelObject() then
local cost=v:GetCost()
if cost and not cost(v,de,tp) then
local tg=v:GetTarget()
if not tg then
v:SetTarget(cm.chtg2(aux.TRUE,true))
elseif tg(v,de,tp) then
v:SetTarget(cm.chtg2(tg,true))
end
end
end
end
end
end
function cm.chcon(_con,res)
return function(e,...)
local x=e:GetHandler()
if x:IsHasEffect(m) then return res end
return _con(e,...)
end
end
function cm.chcon2(_con,res)
return function(e,...)
local x=e:GetHandler():GetEquipTarget()
if x:IsHasEffect(m) then return res end
return _con(e,...)
end
end
function cm.chtg(_tg,res)
return function(e,c,...)
if c:IsHasEffect(m) then return res end
return _tg(e,c,...)
end
end
function cm.chval(_val,res)
return function(e,re,...)
local x=nil
if aux.GetValueType(re)=="Effect" then x=re:GetHandler() elseif aux.GetValueType(re)=="Card" then
local rc=Duel.CreateToken(tp,1344018)
local e1=Effect.CreateEffect(rc)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CHANGE_CODE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetValue(m)
rc:RegisterEffect(e1,true)
rc:RegisterFlagEffect(m+66,0,0,0)
re=rc:GetActivateEffect()
else return res end
if x and x:IsHasEffect(m) then return res end
return _val(e,re,...)
end
end
function cm.chtg2(_tg,res)
return function(e,te,...)
local x=te:GetHandler()
if x:IsHasEffect(m) then return res end
return _tg(e,te,...)
end
end
function cm.disop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local rc=re:GetHandler()
......
if not require and dofile then function require(str) return dofile(str..".lua") end end
if not pcall(function() require("expansions/script/c53702500") end) then require("script/c53702500") end
local m=53765001
local cm=_G["c"..m]
cm.name="枷狱最高检察官 审判"
cm.AD_Ht=true
function cm.initial_effect(c)
SNNM.AllEffectReset(c)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_HAND)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_CANNOT_DISABLE)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
c:RegisterEffect(e1)
local e1_1=Effect.CreateEffect(c)
e1_1:SetType(EFFECT_TYPE_SINGLE)
e1_1:SetProperty(EFFECT_FLAG_SINGLE_RANGE+EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1_1:SetCode(53765098)
e1_1:SetRange(LOCATION_HAND)
e1_1:SetLabelObject(e1)
c:RegisterEffect(e1_1,true)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_ADJUST)
e2:SetRange(LOCATION_HAND)
e2:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_CANNOT_DISABLE)
e2:SetLabelObject(e1)
e2:SetOperation(cm.adjustop)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_ACTIVATE_COST)
e3:SetRange(LOCATION_HAND)
e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e3:SetTargetRange(1,1)
e3:SetLabelObject(e1)
e3:SetTarget(cm.actarget)
e3:SetCost(cm.costchk)
e3:SetOperation(cm.costop)
c:RegisterEffect(e3)
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetProperty(EFFECT_FLAG_SINGLE_RANGE+EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e4:SetCode(53765000)
e4:SetRange(LOCATION_SZONE)
c:RegisterEffect(e4)
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_FIELD)
e5:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e5:SetCode(53765000)
e5:SetRange(LOCATION_SZONE)
e5:SetTargetRange(1,0)
c:RegisterEffect(e5)
if not AD_Helltaker_Check then
AD_Helltaker_Check=true
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_ADJUST)
ge1:SetOperation(cm.mvop)
Duel.RegisterEffect(ge1,0)
local ge2=ge1:Clone()
Duel.RegisterEffect(ge2,1)
cm[1]=Card.GetActivateEffect
Card.GetActivateEffect=function(ac)
local le={cm[1](ac)}
local xe={ac:IsHasEffect(53765098)}
local ae=nil
for _,v in pairs(xe) do ae=v:GetLabelObject() end
if ae then
le={ae}
local xe1=cm.regi(ac,ae)
end
return table.unpack(le)
end
cm[2]=Card.IsType
Card.IsType=function(rc,type)
local res=cm[2](rc,type)
if type&(TYPE_TRAP+TYPE_CONTINUOUS)~=0 and rc:IsHasEffect(53765099) then return true else return res end
end
cm[3]=Card.GetType
Card.GetType=function(rc)
if rc:IsHasEffect(53765099) then return TYPE_TRAP+TYPE_CONTINUOUS else return cm[3](rc) end
end
cm[4]=Effect.IsHasType
Effect.IsHasType=function(re,type)
local res=cm[4](re,type)
local rc=re:GetHandler()
local xe={rc:IsHasEffect(53765099)}
local b=false
for _,v in pairs(xe) do if re==v:GetLabelObject() then b=true end end
if b then
if type&EFFECT_TYPE_ACTIVATE~=0 then return true else return false end
else return res end
end
cm[5]=Effect.GetType
Effect.GetType=function(re)
local rc=re:GetHandler()
local xe={rc:IsHasEffect(53765099)}
local b=false
for _,v in pairs(xe) do if re==v:GetLabelObject() then b=true end end
if b then return EFFECT_TYPE_ACTIVATE else return cm[5](re) end
end
cm[6]=Effect.IsActiveType
Effect.IsActiveType=function(re,type)
local res=cm[6](re,type)
local rc=re:GetHandler()
local xe={rc:IsHasEffect(53765099)}
local b=false
for _,v in pairs(xe) do if re==v:GetLabelObject() then b=true end end
if b then
if type&(TYPE_TRAP+TYPE_CONTINUOUS)~=0 then return true else return false end
else return res end
end
cm[7]=Effect.GetActiveType
Effect.GetActiveType=function(re)
local rc=re:GetHandler()
local xe={rc:IsHasEffect(53765099)}
local b=false
for _,v in pairs(xe) do if re==v:GetLabelObject() then b=true end end
if b then return 0x20004 else return cm[7](re) end
end
cm[8]=Duel.MoveToField
Duel.MoveToField=function(sc,mp,tp,dest,pos,bool,zone)
local czone=zone or 0xff
if ad_ht_fr then czone=ad_ht_fr end
return cm[8](sc,mp,tp,dest,pos,bool,czone)
end
cm[9]=Duel.GetLocationCount
Duel.GetLocationCount=function(tp,loc,...)
local ct=cm[9](tp,loc,...)
if ad_ht_zc then ct=ct+ad_ht_zc end
return ct
end
cm[10]=Effect.IsActivatable
Effect.IsActivatable=function(re,tp,...)
local res=cm[10](re,tp,...)
if cm[9](tp,LOCATION_SZONE)<1 and ad_ht_ac_ignz then
local b=true
local pe={Duel.IsPlayerAffectedByEffect(tp,EFFECT_CANNOT_ACTIVATE)}
for _,v in pairs(pe) do
local val=v:GetValue()
if aux.GetValueType(val)=="number" or val(v,re,tp) then b=false end
end
return b
else return res end
end
end
end
function cm.adjustop(e,tp,eg,ep,ev,re,r,rp)
local te=e:GetLabelObject()
local c=te:GetHandler()
local xe={c:IsHasEffect(53765099)}
for _,v in pairs(xe) do v:Reset() end
local p=te:GetHandlerPlayer()
local pe={Duel.IsPlayerAffectedByEffect(p,EFFECT_CANNOT_ACTIVATE)}
local ae={Duel.IsPlayerAffectedByEffect(p,EFFECT_ACTIVATE_COST)}
local t1,t2={},{}
for _,v in pairs(pe) do
local val=v:GetValue()
if aux.GetValueType(val)=="number" or val(v,te,p) then
table.insert(t1,v)
table.insert(t2,1)
end
end
for _,v in pairs(ae) do
local cost=v:GetCost()
if not v:GetLabelObject() and cost and not cost(v,te,p) then
local tg=v:GetTarget()
if not tg or tg(v,te,p) then
table.insert(t1,v)
table.insert(t2,2)
end
end
end
local xe1=cm.regi(c,te)
local t3,t4={},{}
for _,v in pairs(pe) do
local val=v:GetValue()
if aux.GetValueType(val)=="number" or val(v,te,p) then
table.insert(t3,v)
table.insert(t4,1)
end
end
for _,v in pairs(ae) do
local cost=v:GetCost()
if not v:GetLabelObject() and cost and not cost(v,te,p) then
local tg=v:GetTarget()
if not tg or tg(v,te,p) then
table.insert(t3,v)
table.insert(t4,2)
end
end
end
xe1:Reset()
local ret1,ret2={},{}
for k,v1 in pairs(t1) do
local equal=false
for _,v2 in pairs(t3) do
if v1==v2 then
equal=true
break
end
end
if not equal then
table.insert(ret1,v1)
table.insert(ret2,t2[k])
end
end
local ret3,ret4={},{}
for k,v1 in pairs(t3) do
local equal=false
for _,v2 in pairs(t1) do
if v1==v2 then
equal=true
break
end
end
if not equal then
table.insert(ret3,v1)
table.insert(ret4,t4[k])
end
end
for k,v in pairs(ret1) do
if ret2[k]==1 then
local val=v:GetValue()
if aux.GetValueType(val)=="number" then val=aux.TRUE end
if val(v,te,p) then
v:SetValue(cm.chval(val,false,te))
end
end
if ret2[k]==2 then
local cost=v:GetCost()
if not v:GetLabelObject() and cost and not cost(v,te,p) then
local tg=v:GetTarget()
if not tg then
v:SetTarget(cm.chtg(aux.TRUE,false,te))
elseif tg(v,te,p) then
v:SetTarget(cm.chtg(tg,false,te))
end
end
end
end
local xe1=cm.regi(c,te)
for k,v in pairs(ret3) do
if ret4[k]==1 then
local val=v:GetValue()
if aux.GetValueType(val)=="number" then val=aux.TRUE end
if val(v,te,p) then
v:SetValue(cm.chval(val,true,te))
end
end
if ret4[k]==2 then
local cost=v:GetCost()
if not v:GetLabelObject() and cost and not cost(v,te,p) then
local tg=v:GetTarget()
if not tg then
v:SetTarget(cm.chtg(aux.TRUE,true,te))
elseif tg(v,te,p) then
v:SetTarget(cm.chtg(tg,true,te))
end
end
end
end
xe1:Reset()
end
function cm.bchval(_val,te)
return function(e,re,...)
--[[local b=false
local le={Duel.IsPlayerAffectedByEffect(0,53765099)}
for _,v in pairs(le) do if re==v:GetLabelObject() then b=true end end
if b then return false end--]]
if re==te then return false end
return _val(e,re,...)
end
end
function cm.chval(_val,res,te)
return function(e,re,...)
if re==te then return res end
return _val(e,re,...)
end
end
function cm.chtg(_tg,res,te)
return function(e,re,...)
if re==te then return res end
return _tg(e,re,...)
end
end
function cm.actarget(e,te,tp)
return te:GetHandler()==e:GetHandler() and te==e:GetLabelObject()
end
function cm.costchk(e,te,tp)
return Duel.GetLocationCount(tp,LOCATION_SZONE)>0
end
function cm.costop(e,tp,eg,ep,ev,re,r,rp)
local te=e:GetLabelObject()
local c=te:GetHandler()
local xe1=cm.regi(c,te)
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetCode(EFFECT_CHANGE_TYPE)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e0:SetValue(0x20004)
c:RegisterEffect(e0,true)
Duel.MoveToField(c,tp,tp,LOCATION_SZONE,POS_FACEUP,false)
e0:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET)
c:CreateEffectRelation(te)
local ev0=Duel.GetCurrentChain()+1
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetCode(EVENT_CHAIN_SOLVING)
e1:SetCountLimit(1)
e1:SetCondition(function(e,tp,eg,ep,ev,re,r,rp)return ev==ev0 end)
e1:SetOperation(cm.rsop)
e1:SetReset(RESET_CHAIN)
Duel.RegisterEffect(e1,tp)
local e2=e1:Clone()
e2:SetCode(EVENT_CHAIN_NEGATED)
Duel.RegisterEffect(e2,tp)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_REMAIN_FIELD)
e3:SetProperty(EFFECT_FLAG_OATH+EFFECT_FLAG_CANNOT_DISABLE)
e3:SetReset(RESET_CHAIN)
c:RegisterEffect(e3)
end
function cm.rsop(e,tp,eg,ep,ev,re,r,rp)
local rc=re:GetHandler()
if e:GetCode()==EVENT_CHAIN_SOLVING and rc:IsRelateToEffect(re) then
rc:SetStatus(STATUS_EFFECT_ENABLED,true)
end
if e:GetCode()==EVENT_CHAIN_NEGATED and rc:IsRelateToEffect(re) then
rc:SetStatus(STATUS_ACTIVATE_DISABLED,true)
rc:CancelToGrave(false)
end
local xe={rc:IsHasEffect(53765099)}
for _,v in pairs(xe) do if v:GetLabelObject()==re then v:Reset() end end
end
function cm.mvop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(nil,tp,0xff,0,nil)
for c in aux.Next(g) do
local rse={c:IsHasEffect(53765050)}
for _,v in pairs(rse) do
if v:GetLabelObject():GetLabelObject() then v:GetLabelObject():GetLabelObject():Reset() end
if v:GetLabelObject() then v:GetLabelObject():Reset() end
v:Reset()
end
end
if not Duel.IsPlayerAffectedByEffect(tp,53765000) then return end
g=Duel.GetMatchingGroup(function(c)return c:GetActivateEffect() and not c:GetActivateEffect():IsActiveType(TYPE_FIELD)end,tp,LOCATION_HAND,0,nil)
for c in aux.Next(g) do
local le={c:GetActivateEffect()}
for _,te in pairs(le) do
if te:GetRange()==0x10a or te:GetRange()==0x2 then
--if not te:GetDescription() then te:SetDescription(aux.Stringid(m,1)) end
local e1=te:Clone()
e1:SetDescription(aux.Stringid(m,1))
if te:GetCode()==EVENT_FREE_CHAIN then
if te:IsActiveType(TYPE_TRAP+TYPE_QUICKPLAY) then e1:SetType(EFFECT_TYPE_QUICK_O) else e1:SetType(EFFECT_TYPE_IGNITION) end
elseif te:GetCode()==EVENT_CHAINING then e1:SetType(EFFECT_TYPE_QUICK_O) elseif te:GetCode() then e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) end
e1:SetRange(LOCATION_HAND)
local pro,pro2=te:GetProperty()
e1:SetProperty(pro|EFFECT_FLAG_UNCOPYABLE,pro2)
c:RegisterEffect(e1,true)
local pe={Duel.IsPlayerAffectedByEffect(tp,EFFECT_CANNOT_ACTIVATE)}
for _,v in pairs(pe) do
local val=v:GetValue()
if aux.GetValueType(val)=="number" then val=aux.TRUE end
v:SetValue(cm.bchval(val,e1))
end
local zone=0xff
if te:IsActiveType(TYPE_PENDULUM) then zone=0x11 end
if te:IsHasProperty(EFFECT_FLAG_LIMIT_ZONE) then
zone=te:GetValue()
if aux.GetValueType(zone)=="function" then zone=zone(te,tp,eg,ep,ev,re,r,rp) end
end
local fcheck=false
local fe={Duel.IsPlayerAffectedByEffect(0,53765050)}
for _,v in pairs(fe) do
local ae=v:GetLabelObject()
if ae:GetLabelObject() and ae:GetLabelObject()==te and ae:GetCode() and ae:GetCode()==EFFECT_ACTIVATE_COST and ae:GetRange()&LOCATION_HAND~=0 then
fcheck=true
local e2=ae:Clone()
e2:SetLabelObject(e1)
--e2:SetLabel(zone)
e2:SetTarget(cm.actarget)
local cost=ae:GetCost()
if not cost then cost=aux.TRUE end
e2:SetCost(cm.faccost(cost,te,zone))
local op=ae:GetOperation()
e2:SetOperation(cm.fcostop(op,zone))
c:RegisterEffect(e2,true)
local ex=Effect.CreateEffect(c)
ex:SetType(EFFECT_TYPE_SINGLE)
ex:SetCode(53765050)
ex:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
ex:SetLabelObject(e2)
c:RegisterEffect(ex,true)
--[[if c.AD_Ht then
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e4:SetCode(EVENT_ADJUST)
e4:SetRange(LOCATION_HAND)
e4:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_CANNOT_DISABLE)
e4:SetLabelObject(e1)
e4:SetOperation(cm.adjustop)
c:RegisterEffect(e4,true)
local ex2=Effect.CreateEffect(c)
ex2:SetType(EFFECT_TYPE_SINGLE)
ex2:SetCode(53765050)
ex2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
ex2:SetLabelObject(e4)
c:RegisterEffect(ex2,true)
end--]]
end
end
if not fcheck then
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_ACTIVATE_COST)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_CANNOT_DISABLE)
e2:SetRange(LOCATION_HAND)
e2:SetTargetRange(1,0)
e2:SetLabelObject(e1)
--e2:SetLabel(zone)
e2:SetTarget(cm.actarget)
e2:SetCost(cm.faccost(aux.TRUE,te,zone))
e2:SetOperation(cm.fcostop(cm.mvcostop,zone))
c:RegisterEffect(e2,true)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(53765050)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e3:SetLabelObject(e2)
c:RegisterEffect(e3,true)
end
end
end
end
end
function cm.faccost(_cost,fe,zone)
return function(e,te,tp)
ad_ht_zc=1
ad_ht_ac_ignz=true
if not fe:IsActivatable(tp) then
ad_ht_zc=nil
ad_ht_ac_ignz=nil
return false
end
ad_ht_ac_ignz=nil
local c=e:GetHandler()
local xe={c:IsHasEffect(53765099)}
for _,v in pairs(xe) do v:Reset() end
if c:IsType(TYPE_QUICKPLAY) and Duel.GetTurnPlayer()~=tp and not c:IsHasEffect(EFFECT_QP_ACT_IN_NTPHAND) then return false end
if c:IsType(TYPE_TRAP) and not c:IsHasEffect(EFFECT_TRAP_ACT_IN_HAND) then return false end
if not c:CheckUniqueOnField(tp) then return false end
if not Duel.IsExistingMatchingCard(cm.mvfilter,tp,LOCATION_SZONE,0,1,nil,e,tp,zone) then
ad_ht_zc=nil
return false
end
local res=false
if _cost(e,te,tp) then res=true end
ad_ht_zc=nil
return res
end
end
function cm.fcostop(_op,zone)
return function(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(m,2))
local tc=Duel.SelectMatchingCard(tp,cm.mvfilter,tp,LOCATION_SZONE,0,1,1,nil,e,tp,zone):GetFirst()
local seq=tc:GetSequence()
if seq>0 and Duel.CheckLocation(tp,LOCATION_SZONE,seq-1) then Duel.MoveSequence(tc,seq-1) else Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP,1<<seq) end
ad_ht_fr=1<<seq
_op(e,tp,teg,tep,tev,tre,tr,trp)
ad_ht_fr=nil
end
end
function cm.mvfilter(c,e,tp,zone)
local seq=c:GetSequence()
return c:IsHasEffect(53765000) and ((seq>0 and Duel.CheckLocation(tp,LOCATION_SZONE,seq-1)) or c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP,tp,1<<seq)) and (1<<seq)&zone~=0
end
function cm.mvcostchk(e,te,tp)
local c=e:GetHandler()
local xe={c:IsHasEffect(53765099)}
for _,v in pairs(xe) do v:Reset() end
if c:IsType(TYPE_QUICKPLAY) and Duel.GetTurnPlayer()~=tp and not c:IsHasEffect(EFFECT_QP_ACT_IN_NTPHAND) then return false end
if c:IsType(TYPE_TRAP) and not c:IsHasEffect(EFFECT_TRAP_ACT_IN_HAND) then return false end
if not c:CheckUniqueOnField(tp) then return false end
return Duel.IsExistingMatchingCard(cm.mvfilter,tp,LOCATION_SZONE,0,1,nil,e,tp,e:GetLabel())
end
function cm.smvcostop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(m,2))
local tc=Duel.SelectMatchingCard(tp,cm.mvfilter,tp,LOCATION_SZONE,0,1,1,nil,e,tp,e:GetLabel()):GetFirst()
local seq=tc:GetSequence()
if seq>0 and Duel.CheckLocation(tp,LOCATION_SZONE,seq-1) then Duel.MoveSequence(tc,seq-1) else Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP,1<<seq) end
ad_ht_fr=1<<seq
end
function cm.mvcostop(e,tp,eg,ep,ev,re,r,rp)
--cm.smvcostop(e,tp,eg,ep,ev,re,r,rp)
local te=e:GetLabelObject()
local c=te:GetHandler()
te:SetType(EFFECT_TYPE_ACTIVATE)
Duel.MoveToField(c,tp,tp,LOCATION_SZONE,POS_FACEUP,false)
c:CreateEffectRelation(te)
local ev0=Duel.GetCurrentChain()+1
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetCode(EVENT_CHAIN_SOLVING)
e1:SetCountLimit(1)
e1:SetCondition(function(e,tp,eg,ep,ev,re,r,rp)return ev==ev0 end)
e1:SetOperation(cm.mvrsop)
e1:SetReset(RESET_CHAIN)
Duel.RegisterEffect(e1,tp)
local e2=e1:Clone()
e2:SetCode(EVENT_CHAIN_NEGATED)
Duel.RegisterEffect(e2,tp)
ad_ht_fr=nil
end
function cm.mvrsop(e,tp,eg,ep,ev,re,r,rp)
local rc=re:GetHandler()
if e:GetCode()==EVENT_CHAIN_SOLVING and rc:IsRelateToEffect(re) then
rc:SetStatus(STATUS_EFFECT_ENABLED,true)
if not rc:IsType(TYPE_CONTINUOUS+TYPE_EQUIP+TYPE_PENDULUM) and not rc:IsHasEffect(EFFECT_REMAIN_FIELD) then rc:CancelToGrave(false) end
end
if e:GetCode()==EVENT_CHAIN_NEGATED and rc:IsRelateToEffect(re) then
rc:SetStatus(STATUS_ACTIVATE_DISABLED,true)
rc:CancelToGrave(false)
end
if re then re:Reset() end
end
function cm.regi(c,e)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(53765099)
e1:SetLabelObject(e)
c:RegisterEffect(e1,true)
return e1
end
if not require and dofile then function require(str) return dofile(str..".lua") end end
if not pcall(function() require("expansions/script/c53702500") end) then require("script/c53702500") end
local m=53765003
local cm=_G["c"..m]
cm.name="枷狱三重身 刻耳柏洛斯"
function cm.initial_effect(c)
cm.AD_Ht=true
function cm.initial_effect(c)
SNNM.AllEffectReset(c)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_HAND)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_CANNOT_DISABLE)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
c:RegisterEffect(e1)
local e1_1=Effect.CreateEffect(c)
e1_1:SetType(EFFECT_TYPE_SINGLE)
e1_1:SetProperty(EFFECT_FLAG_SINGLE_RANGE+EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1_1:SetCode(53765098)
e1_1:SetRange(LOCATION_HAND)
e1_1:SetLabelObject(e1)
c:RegisterEffect(e1_1,true)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_ADJUST)
e2:SetRange(LOCATION_HAND)
e2:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_CANNOT_DISABLE)
e2:SetLabelObject(e1)
e2:SetOperation(cm.adjustop)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_ACTIVATE_COST)
e3:SetRange(LOCATION_HAND)
e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e3:SetTargetRange(1,1)
e3:SetLabelObject(e1)
e3:SetTarget(cm.actarget)
e3:SetCost(cm.costchk)
e3:SetOperation(cm.costop)
c:RegisterEffect(e3)
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetProperty(EFFECT_FLAG_SINGLE_RANGE+EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e4:SetCode(53765000)
e4:SetRange(LOCATION_SZONE)
c:RegisterEffect(e4)
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_FIELD)
e5:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e5:SetCode(53765000)
e5:SetRange(LOCATION_SZONE)
e5:SetTargetRange(1,0)
c:RegisterEffect(e5)
local e6=Effect.CreateEffect(c)
e6:SetDescription(aux.Stringid(m,0))
e6:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e6:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e6:SetCode(EVENT_SUMMON_SUCCESS)
e6:SetTarget(cm.thtg)
e6:SetOperation(cm.thop)
c:RegisterEffect(e6)
local e7=e6:Clone()
e7:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e7)
local ex=Effect.CreateEffect(c)
ex:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
ex:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
ex:SetCode(EVENT_MOVE)
ex:SetOperation(cm.mvhint)
c:RegisterEffect(ex)
if not AD_Helltaker_Check then
AD_Helltaker_Check=true
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_ADJUST)
ge1:SetOperation(cm.mvop)
Duel.RegisterEffect(ge1,0)
local ge2=ge1:Clone()
Duel.RegisterEffect(ge2,1)
cm[1]=Card.GetActivateEffect
Card.GetActivateEffect=function(ac)
local le={cm[1](ac)}
local xe={ac:IsHasEffect(53765098)}
local ae=nil
for _,v in pairs(xe) do ae=v:GetLabelObject() end
if ae then
le={ae}
local xe1=cm.regi(ac,ae)
end
return table.unpack(le)
end
cm[2]=Card.IsType
Card.IsType=function(rc,type)
local res=cm[2](rc,type)
if type&(TYPE_TRAP+TYPE_CONTINUOUS)~=0 and rc:IsHasEffect(53765099) then return true else return res end
end
cm[3]=Card.GetType
Card.GetType=function(rc)
if rc:IsHasEffect(53765099) then return TYPE_TRAP+TYPE_CONTINUOUS else return cm[3](rc) end
end
cm[4]=Effect.IsHasType
Effect.IsHasType=function(re,type)
local res=cm[4](re,type)
local rc=re:GetHandler()
local xe={}
if rc then xe={rc:IsHasEffect(53765099)} end
local b=false
for _,v in pairs(xe) do if re==v:GetLabelObject() then b=true end end
if b then
if type&EFFECT_TYPE_ACTIVATE~=0 then return true else return false end
else return res end
end
cm[5]=Effect.GetType
Effect.GetType=function(re)
local rc=re:GetHandler()
local xe={}
if rc then xe={rc:IsHasEffect(53765099)} end
local b=false
for _,v in pairs(xe) do if re==v:GetLabelObject() then b=true end end
if b then return EFFECT_TYPE_ACTIVATE else return cm[5](re) end
end
cm[6]=Effect.IsActiveType
Effect.IsActiveType=function(re,type)
local res=cm[6](re,type)
local rc=re:GetHandler()
local xe={}
if rc then xe={rc:IsHasEffect(53765099)} end
local b=false
for _,v in pairs(xe) do if re==v:GetLabelObject() then b=true end end
if b then
if type&(TYPE_TRAP+TYPE_CONTINUOUS)~=0 then return true else return false end
else return res end
end
cm[7]=Effect.GetActiveType
Effect.GetActiveType=function(re)
local rc=re:GetHandler()
local xe={}
if rc then xe={rc:IsHasEffect(53765099)} end
local b=false
for _,v in pairs(xe) do if re==v:GetLabelObject() then b=true end end
if b then return 0x20004 else return cm[7](re) end
end
cm[8]=Duel.MoveToField
Duel.MoveToField=function(sc,mp,tp,dest,pos,bool,zone)
local czone=zone or 0xff
if ad_ht_fr then czone=ad_ht_fr end
return cm[8](sc,mp,tp,dest,pos,bool,czone)
end
cm[9]=Duel.GetLocationCount
Duel.GetLocationCount=function(tp,loc,...)
local ct=cm[9](tp,loc,...)
if ad_ht_zc then ct=ct+ad_ht_zc end
return ct
end
cm[10]=Effect.GetActivateLocation
Effect.GetActivateLocation=function(re)
local rc=re:GetHandler()
local xe={}
if rc then xe={rc:IsHasEffect(53765099)} end
local b=false
for _,v in pairs(xe) do if re==v:GetLabelObject() then b=true end end
if b then return LOCATION_SZONE else return cm[10](re) end
end
cm[11]=Effect.GetActivateSequence
Effect.GetActivateSequence=function(re)
local rc=re:GetHandler()
local xe={}
if rc then xe={rc:IsHasEffect(53765099)} end
local ls=0
local seq=cm[11](re)
for _,v in pairs(xe) do
if re==v:GetLabelObject() then
ls=v:GetLabel()
break
end
end
if ls>0 then return ls-1 else return seq end
end
cm[12]=Duel.GetChainInfo
Duel.GetChainInfo=function(chainc,...)
local re=cm[12](chainc,CHAININFO_TRIGGERING_EFFECT)
local rc=re:GetHandler()
local xe={}
if rc then xe={rc:IsHasEffect(53765099)} end
local b=false
local ls=0
for _,v in pairs(xe) do
if re==v:GetLabelObject() then
b=true
ls=v:GetLabel()
break
end
end
local t={cm[12](chainc,...)}
if b then
for k,info in ipairs({...}) do
if info==CHAININFO_TYPE then t[k]=0x20004 end
if info==CHAININFO_EXTTYPE then t[k]=0x20004 end
if info==CHAININFO_TRIGGERING_LOCATION then t[k]=LOCATION_SZONE end
if info==CHAININFO_TRIGGERING_SEQUENCE and ls>0 then t[k]=ls-1 end
if info==CHAININFO_TRIGGERING_POSITION then t[k]=POS_FACEUP end
end
end
return table.unpack(t)
end
end
end
function cm.adjustop(e,tp,eg,ep,ev,re,r,rp)
local te=e:GetLabelObject()
local c=te:GetHandler()
local xe={c:IsHasEffect(53765099)}
for _,v in pairs(xe) do v:Reset() end
local p=te:GetHandlerPlayer()
local pe={Duel.IsPlayerAffectedByEffect(p,EFFECT_CANNOT_ACTIVATE)}
local ae={Duel.IsPlayerAffectedByEffect(p,EFFECT_ACTIVATE_COST)}
local t1,t2={},{}
for _,v in pairs(pe) do
local val=v:GetValue()
if aux.GetValueType(val)=="number" or val(v,te,p) then
table.insert(t1,v)
table.insert(t2,1)
end
end
for _,v in pairs(ae) do
local cost=v:GetCost()
if not v:GetLabelObject() and cost and not cost(v,te,p) then
local tg=v:GetTarget()
if not tg or tg(v,te,p) then
table.insert(t1,v)
table.insert(t2,2)
end
end
end
local xe1=cm.regi(c,te)
local t3,t4={},{}
for _,v in pairs(pe) do
local val=v:GetValue()
if aux.GetValueType(val)=="number" or val(v,te,p) then
table.insert(t3,v)
table.insert(t4,1)
end
end
for _,v in pairs(ae) do
local cost=v:GetCost()
if not v:GetLabelObject() and cost and not cost(v,te,p) then
local tg=v:GetTarget()
if not tg or tg(v,te,p) then
table.insert(t3,v)
table.insert(t4,2)
end
end
end
xe1:Reset()
local ret1,ret2={},{}
for k,v1 in pairs(t1) do
local equal=false
for _,v2 in pairs(t3) do
if v1==v2 then
equal=true
break
end
end
if not equal then
table.insert(ret1,v1)
table.insert(ret2,t2[k])
end
end
local ret3,ret4={},{}
for k,v1 in pairs(t3) do
local equal=false
for _,v2 in pairs(t1) do
if v1==v2 then
equal=true
break
end
end
if not equal then
table.insert(ret3,v1)
table.insert(ret4,t4[k])
end
end
for k,v in pairs(ret1) do
if ret2[k]==1 then
local val=v:GetValue()
if aux.GetValueType(val)=="number" then val=aux.TRUE end
if val(v,te,p) then
v:SetValue(cm.chval(val,false,te))
end
end
if ret2[k]==2 then
local cost=v:GetCost()
if not v:GetLabelObject() and cost and not cost(v,te,p) then
local tg=v:GetTarget()
if not tg then
v:SetTarget(cm.chtg(aux.TRUE,false,te))
elseif tg(v,te,p) then
v:SetTarget(cm.chtg(tg,false,te))
end
end
end
end
local xe1=cm.regi(c,te)
for k,v in pairs(ret3) do
if ret4[k]==1 then
local val=v:GetValue()
if aux.GetValueType(val)=="number" then val=aux.TRUE end
if val(v,te,p) then
v:SetValue(cm.chval(val,true,te))
end
end
if ret4[k]==2 then
local cost=v:GetCost()
if not v:GetLabelObject() and cost and not cost(v,te,p) then
local tg=v:GetTarget()
if not tg then
v:SetTarget(cm.chtg(aux.TRUE,true,te))
elseif tg(v,te,p) then
v:SetTarget(cm.chtg(tg,true,te))
end
end
end
end
xe1:Reset()
end
function cm.bchval(_val,te)
return function(e,re,...)
if re==te then return false end
return _val(e,re,...)
end
end
function cm.chval(_val,res,te)
return function(e,re,...)
if re==te then return res end
return _val(e,re,...)
end
end
function cm.chtg(_tg,res,te)
return function(e,re,...)
if re==te then return res end
return _tg(e,re,...)
end
end
function cm.actarget(e,te,tp)
return te:GetHandler()==e:GetHandler() and te==e:GetLabelObject()
end
function cm.costchk(e,te,tp)
return Duel.GetLocationCount(tp,LOCATION_SZONE)>0
end
function cm.costop(e,tp,eg,ep,ev,re,r,rp)
local te=e:GetLabelObject()
local c=te:GetHandler()
local xe1=cm.regi(c,te)
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetCode(EFFECT_CHANGE_TYPE)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e0:SetValue(0x20004)
c:RegisterEffect(e0,true)
Duel.MoveToField(c,tp,tp,LOCATION_SZONE,POS_FACEUP,false)
e0:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET)
c:CreateEffectRelation(te)
local ev0=Duel.GetCurrentChain()+1
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetCode(EVENT_CHAIN_SOLVING)
e1:SetCountLimit(1)
e1:SetCondition(function(e,tp,eg,ep,ev,re,r,rp)return ev==ev0 end)
e1:SetOperation(cm.rsop)
e1:SetReset(RESET_CHAIN)
Duel.RegisterEffect(e1,tp)
local e2=e1:Clone()
e2:SetCode(EVENT_CHAIN_NEGATED)
Duel.RegisterEffect(e2,tp)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_REMAIN_FIELD)
e3:SetProperty(EFFECT_FLAG_OATH+EFFECT_FLAG_CANNOT_DISABLE)
e3:SetReset(RESET_CHAIN)
c:RegisterEffect(e3)
end
function cm.rsop(e,tp,eg,ep,ev,re,r,rp)
local rc=re:GetHandler()
if e:GetCode()==EVENT_CHAIN_SOLVING and rc:IsRelateToEffect(re) then
rc:SetStatus(STATUS_EFFECT_ENABLED,true)
end
if e:GetCode()==EVENT_CHAIN_NEGATED and rc:IsRelateToEffect(re) then
rc:SetStatus(STATUS_ACTIVATE_DISABLED,true)
rc:CancelToGrave(false)
end
local xe={rc:IsHasEffect(53765099)}
for _,v in pairs(xe) do if v:GetLabelObject()==re then v:Reset() end end
end
function cm.mvop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(nil,tp,0xff,0,nil)
for c in aux.Next(g) do
local rse={c:IsHasEffect(53765050)}
for _,v in pairs(rse) do
if v:GetLabelObject():GetLabelObject() then v:GetLabelObject():GetLabelObject():Reset() end
if v:GetLabelObject() then v:GetLabelObject():Reset() end
v:Reset()
end
end
if not Duel.IsPlayerAffectedByEffect(tp,53765000) then return end
g=Duel.GetMatchingGroup(function(c)return c:GetActivateEffect() and not c:GetActivateEffect():IsActiveType(TYPE_FIELD)end,tp,LOCATION_HAND,0,nil)
for c in aux.Next(g) do
local le={c:GetActivateEffect()}
for _,te in pairs(le) do
if te:GetRange()==0x10a or te:GetRange()==0xa or te:GetRange()==0x2 then
local e1=te:Clone()
e1:SetDescription(aux.Stringid(m,1))
if te:GetCode()==EVENT_FREE_CHAIN then
if te:IsActiveType(TYPE_TRAP+TYPE_QUICKPLAY) then e1:SetType(EFFECT_TYPE_QUICK_O) else e1:SetType(EFFECT_TYPE_IGNITION) end
elseif te:GetCode()==EVENT_CHAINING then e1:SetType(EFFECT_TYPE_QUICK_O) elseif te:GetCode() then e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) end
e1:SetRange(LOCATION_HAND)
local pro,pro2=te:GetProperty()
e1:SetProperty(pro|EFFECT_FLAG_UNCOPYABLE,pro2)
c:RegisterEffect(e1,true)
local pe={Duel.IsPlayerAffectedByEffect(tp,EFFECT_CANNOT_ACTIVATE)}
for _,v in pairs(pe) do
local val=v:GetValue()
if aux.GetValueType(val)=="number" then val=aux.TRUE end
v:SetValue(cm.bchval(val,e1))
end
local zone=0xff
if te:IsActiveType(TYPE_PENDULUM) then zone=0x11 end
if te:IsHasProperty(EFFECT_FLAG_LIMIT_ZONE) then
zone=te:GetValue()
if aux.GetValueType(zone)=="function" then zone=zone(te,tp,eg,ep,ev,re,r,rp) end
end
local fcheck=false
local fe={Duel.IsPlayerAffectedByEffect(0,53765050)}
for _,v in pairs(fe) do
local ae=v:GetLabelObject()
if ae:GetLabelObject() and ae:GetLabelObject()==te and ae:GetCode() and ae:GetCode()==EFFECT_ACTIVATE_COST and ae:GetRange()&LOCATION_HAND~=0 then
fcheck=true
local e2=ae:Clone()
e2:SetLabelObject(e1)
e2:SetTarget(cm.actarget)
local cost=ae:GetCost()
if not cost then cost=aux.TRUE end
e2:SetCost(cm.faccost(cost,te,zone))
local op=ae:GetOperation()
e2:SetOperation(cm.fcostop(op,zone))
c:RegisterEffect(e2,true)
local ex=Effect.CreateEffect(c)
ex:SetType(EFFECT_TYPE_SINGLE)
ex:SetCode(53765050)
ex:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
ex:SetLabelObject(e2)
c:RegisterEffect(ex,true)
end
end
if not fcheck then
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_ACTIVATE_COST)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_CANNOT_DISABLE)
e2:SetRange(LOCATION_HAND)
e2:SetTargetRange(1,0)
e2:SetTarget(cm.actarget)
e2:SetCost(cm.faccost(aux.TRUE,te,zone))
e2:SetOperation(cm.fcostop(cm.mvcostop,zone))
e2:SetLabelObject(e1)
c:RegisterEffect(e2,true)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(53765050)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e3:SetLabelObject(e2)
c:RegisterEffect(e3,true)
end
end
end
end
end
function cm.faccost(_cost,fe,zone)
return function(e,te,tp)
ad_ht_zc=1
ad_ht_ac_ignz=true
if not fe:IsActivatable(tp) then
ad_ht_zc=nil
ad_ht_ac_ignz=nil
return false
end
ad_ht_ac_ignz=nil
local c=e:GetHandler()
local xe={c:IsHasEffect(53765099)}
for _,v in pairs(xe) do v:Reset() end
if c:IsType(TYPE_QUICKPLAY) and Duel.GetTurnPlayer()~=tp and not c:IsHasEffect(EFFECT_QP_ACT_IN_NTPHAND) then return false end
if c:IsType(TYPE_TRAP) and not c:IsHasEffect(EFFECT_TRAP_ACT_IN_HAND) then return false end
if not c:CheckUniqueOnField(tp) then return false end
if not Duel.IsExistingMatchingCard(cm.mvfilter,tp,LOCATION_SZONE,0,1,nil,e,tp,zone) then
ad_ht_zc=nil
return false
end
local res=false
if _cost(e,te,tp) then res=true end
ad_ht_zc=nil
return res
end
end
function cm.fcostop(_op,zone)
return function(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(m,2))
local tc=Duel.SelectMatchingCard(tp,cm.mvfilter,tp,LOCATION_SZONE,0,1,1,nil,e,tp,zone):GetFirst()
local seq=tc:GetSequence()
if seq>0 and Duel.CheckLocation(tp,LOCATION_SZONE,seq-1) then Duel.MoveSequence(tc,seq-1) else Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP,1<<seq) end
ad_ht_fr=1<<seq
_op(e,tp,teg,tep,tev,tre,tr,trp)
ad_ht_fr=nil
end
end
function cm.mvfilter(c,e,tp,zone)
local seq=c:GetSequence()
return c:IsHasEffect(53765000) and ((seq>0 and Duel.CheckLocation(tp,LOCATION_SZONE,seq-1)) or c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP,tp,1<<seq)) and (1<<seq)&zone~=0
end
function cm.mvcostop(e,tp,eg,ep,ev,re,r,rp)
local te=e:GetLabelObject()
local c=te:GetHandler()
local xe1=cm.regi(c,te)
Duel.MoveToField(c,tp,tp,LOCATION_SZONE,POS_FACEUP,false)
c:CreateEffectRelation(te)
local ev0=Duel.GetCurrentChain()+1
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetCode(EVENT_CHAIN_SOLVING)
e1:SetCountLimit(1)
e1:SetCondition(function(e,tp,eg,ep,ev,re,r,rp)return ev==ev0 end)
e1:SetOperation(cm.mvrsop)
e1:SetReset(RESET_CHAIN)
Duel.RegisterEffect(e1,tp)
local e2=e1:Clone()
e2:SetCode(EVENT_CHAIN_NEGATED)
Duel.RegisterEffect(e2,tp)
ad_ht_fr=nil
end
function cm.mvrsop(e,tp,eg,ep,ev,re,r,rp)
local rc=re:GetHandler()
local xe={rc:IsHasEffect(53765099)}
for _,v in pairs(xe) do v:Reset() end
if e:GetCode()==EVENT_CHAIN_SOLVING and rc:IsRelateToEffect(re) then
rc:SetStatus(STATUS_EFFECT_ENABLED,true)
if not rc:IsType(TYPE_CONTINUOUS+TYPE_EQUIP+TYPE_PENDULUM) and not rc:IsHasEffect(EFFECT_REMAIN_FIELD) then rc:CancelToGrave(false) end
end
if e:GetCode()==EVENT_CHAIN_NEGATED and rc:IsRelateToEffect(re) then
rc:SetStatus(STATUS_ACTIVATE_DISABLED,true)
rc:CancelToGrave(false)
end
if re then re:Reset() end
end
function cm.regi(c,e)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(53765099)
e1:SetLabelObject(e)
c:RegisterEffect(e1,true)
return e1
end
function cm.mvhint(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not (c:IsLocation(LOCATION_SZONE) and c:IsPreviousLocation(LOCATION_SZONE) and (c:GetPreviousSequence()~=c:GetSequence() or c:GetPreviousControler()~=c:GetControler())) then return end
local flag=c:GetFlagEffectLabel(m+50)
if flag then
flag=flag+1
c:ResetFlagEffect(m+50)
c:RegisterFlagEffect(m+50,RESET_EVENT+0x7e0000,EFFECT_FLAG_CLIENT_HINT,1,flag,aux.Stringid(53765000,flag-1))
else c:RegisterFlagEffect(m+50,RESET_EVENT+0x7e0000,EFFECT_FLAG_CLIENT_HINT,1,1,aux.Stringid(53765000,0)) end
end
function cm.filter(c)
return c:IsCode(m) and c:IsAbleToHand()
end
function cm.fselect(g,ct)
return g:FilterCount(Card.IsLocation,nil,LOCATION_GRAVE)<=ct
end
function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local ct=e:GetHandler():GetFlagEffectLabel(m+50) or 0
local g=Duel.GetMatchingGroup(cm.filter,tp,LOCATION_DECK+LOCATION_GRAVE,0,nil)
if chk==0 then return g:CheckSubGroup(cm.fselect,1,2,ct) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK+LOCATION_GRAVE)
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
local ct=e:GetHandler():GetFlagEffectLabel(m+50) or 0
local g=Duel.GetMatchingGroup(cm.filter,tp,LOCATION_DECK+LOCATION_GRAVE,0,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local sg=g:SelectSubGroup(tp,cm.fselect,false,1,2,ct)
if sg then
Duel.SendtoHand(sg,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,sg)
end
end
......@@ -6,40 +6,8 @@ cm.name="枷狱首席执行官 路西法"
cm.AD_Ht=true
function cm.initial_effect(c)
SNNM.AllEffectReset(c)
local e1=Effect.CreateEffect(c)
local e1,e1_1,e2,e3=SNNM.ActivatedAsSpellorTrap(c,0x20004)
e1:SetDescription(aux.Stringid(m,0))
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_HAND)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_CANNOT_DISABLE)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
c:RegisterEffect(e1)
local e1_1=Effect.CreateEffect(c)
e1_1:SetType(EFFECT_TYPE_SINGLE)
e1_1:SetProperty(EFFECT_FLAG_SINGLE_RANGE+EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1_1:SetCode(53765098)
e1_1:SetRange(LOCATION_HAND)
e1_1:SetLabelObject(e1)
c:RegisterEffect(e1_1,true)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_ADJUST)
e2:SetRange(LOCATION_HAND)
e2:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_CANNOT_DISABLE)
e2:SetLabelObject(e1)
e2:SetOperation(cm.adjustop)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_ACTIVATE_COST)
e3:SetRange(LOCATION_HAND)
e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e3:SetTargetRange(1,1)
e3:SetLabelObject(e1)
e3:SetTarget(cm.actarget)
e3:SetCost(cm.costchk)
e3:SetOperation(cm.costop)
c:RegisterEffect(e3)
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetProperty(EFFECT_FLAG_SINGLE_RANGE+EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
......@@ -194,6 +162,7 @@ function cm.initial_effect(c)
return cm[21](rc,...)
end
end
SNNM.ActivatedAsSpellorTrapCheck(c)
if not AD_Helltaker_Check then
AD_Helltaker_Check=true
local ge1=Effect.CreateEffect(c)
......@@ -203,69 +172,6 @@ function cm.initial_effect(c)
Duel.RegisterEffect(ge1,0)
local ge2=ge1:Clone()
Duel.RegisterEffect(ge2,1)
cm[1]=Card.GetActivateEffect
Card.GetActivateEffect=function(ac)
local le={cm[1](ac)}
local xe={ac:IsHasEffect(53765098)}
local ae=nil
for _,v in pairs(xe) do ae=v:GetLabelObject() end
if ae then
le={ae}
local xe1=cm.regi(ac,ae)
end
return table.unpack(le)
end
cm[2]=Card.IsType
Card.IsType=function(rc,type)
local res=cm[2](rc,type)
if type&(TYPE_TRAP+TYPE_CONTINUOUS)~=0 and rc:IsHasEffect(53765099) then return true else return res end
end
cm[3]=Card.GetType
Card.GetType=function(rc)
if rc:IsHasEffect(53765099) then return TYPE_TRAP+TYPE_CONTINUOUS else return cm[3](rc) end
end
cm[4]=Effect.IsHasType
Effect.IsHasType=function(re,type)
local res=cm[4](re,type)
local rc=re:GetHandler()
local xe={}
if rc then xe={rc:IsHasEffect(53765099)} end
local b=false
for _,v in pairs(xe) do if re==v:GetLabelObject() then b=true end end
if b then
if type&EFFECT_TYPE_ACTIVATE~=0 then return true else return false end
else return res end
end
cm[5]=Effect.GetType
Effect.GetType=function(re)
local rc=re:GetHandler()
local xe={}
if rc then xe={rc:IsHasEffect(53765099)} end
local b=false
for _,v in pairs(xe) do if re==v:GetLabelObject() then b=true end end
if b then return EFFECT_TYPE_ACTIVATE else return cm[5](re) end
end
cm[6]=Effect.IsActiveType
Effect.IsActiveType=function(re,type)
local res=cm[6](re,type)
local rc=re:GetHandler()
local xe={}
if rc then xe={rc:IsHasEffect(53765099)} end
local b=false
for _,v in pairs(xe) do if re==v:GetLabelObject() then b=true end end
if b then
if type&(TYPE_TRAP+TYPE_CONTINUOUS)~=0 then return true else return false end
else return res end
end
cm[7]=Effect.GetActiveType
Effect.GetActiveType=function(re)
local rc=re:GetHandler()
local xe={}
if rc then xe={rc:IsHasEffect(53765099)} end
local b=false
for _,v in pairs(xe) do if re==v:GetLabelObject() then b=true end end
if b then return 0x20004 else return cm[7](re) end
end
cm[8]=Duel.MoveToField
Duel.MoveToField=function(sc,mp,tp,dest,pos,bool,zone)
local czone=zone or 0xff
......@@ -278,246 +184,11 @@ function cm.initial_effect(c)
if ad_ht_zc then ct=ct+ad_ht_zc end
return ct
end
cm[10]=Effect.GetActivateLocation
Effect.GetActivateLocation=function(re)
local rc=re:GetHandler()
local xe={}
if rc then xe={rc:IsHasEffect(53765099)} end
local b=false
for _,v in pairs(xe) do if re==v:GetLabelObject() then b=true end end
if b then return LOCATION_SZONE else return cm[10](re) end
end
cm[11]=Effect.GetActivateSequence
Effect.GetActivateSequence=function(re)
local rc=re:GetHandler()
local xe={}
if rc then xe={rc:IsHasEffect(53765099)} end
local ls=0
local seq=cm[11](re)
for _,v in pairs(xe) do
if re==v:GetLabelObject() then
ls=v:GetLabel()
break
end
end
if ls>0 then return ls-1 else return seq end
end
cm[12]=Duel.GetChainInfo
Duel.GetChainInfo=function(chainc,...)
local re=cm[12](chainc,CHAININFO_TRIGGERING_EFFECT)
local rc=re:GetHandler()
local xe={}
if rc then xe={rc:IsHasEffect(53765099)} end
local b=false
local ls=0
for _,v in pairs(xe) do
if re==v:GetLabelObject() then
b=true
ls=v:GetLabel()
break
end
end
local t={cm[12](chainc,...)}
if b then
for k,info in ipairs({...}) do
if info==CHAININFO_TYPE then t[k]=0x20004 end
if info==CHAININFO_EXTTYPE then t[k]=0x20004 end
if info==CHAININFO_TRIGGERING_LOCATION then t[k]=LOCATION_SZONE end
if info==CHAININFO_TRIGGERING_SEQUENCE and ls>0 then t[k]=ls-1 end
if info==CHAININFO_TRIGGERING_POSITION then t[k]=POS_FACEUP end
end
end
return table.unpack(t)
end
end
end
function cm.adjustop(e,tp,eg,ep,ev,re,r,rp)
local te=e:GetLabelObject()
local c=te:GetHandler()
local xe={c:IsHasEffect(53765099)}
for _,v in pairs(xe) do v:Reset() end
local p=te:GetHandlerPlayer()
local pe={Duel.IsPlayerAffectedByEffect(p,EFFECT_CANNOT_ACTIVATE)}
local ae={Duel.IsPlayerAffectedByEffect(p,EFFECT_ACTIVATE_COST)}
local t1,t2={},{}
for _,v in pairs(pe) do
local val=v:GetValue()
if aux.GetValueType(val)=="number" or val(v,te,p) then
table.insert(t1,v)
table.insert(t2,1)
end
end
for _,v in pairs(ae) do
local cost=v:GetCost()
if not v:GetLabelObject() and cost and not cost(v,te,p) then
local tg=v:GetTarget()
if not tg or tg(v,te,p) then
table.insert(t1,v)
table.insert(t2,2)
end
end
end
local xe1=cm.regi(c,te)
local t3,t4={},{}
for _,v in pairs(pe) do
local val=v:GetValue()
if aux.GetValueType(val)=="number" or val(v,te,p) then
table.insert(t3,v)
table.insert(t4,1)
end
end
for _,v in pairs(ae) do
local cost=v:GetCost()
if not v:GetLabelObject() and cost and not cost(v,te,p) then
local tg=v:GetTarget()
if not tg or tg(v,te,p) then
table.insert(t3,v)
table.insert(t4,2)
end
end
end
xe1:Reset()
local ret1,ret2={},{}
for k,v1 in pairs(t1) do
local equal=false
for _,v2 in pairs(t3) do
if v1==v2 then
equal=true
break
end
end
if not equal then
table.insert(ret1,v1)
table.insert(ret2,t2[k])
end
end
local ret3,ret4={},{}
for k,v1 in pairs(t3) do
local equal=false
for _,v2 in pairs(t1) do
if v1==v2 then
equal=true
break
end
end
if not equal then
table.insert(ret3,v1)
table.insert(ret4,t4[k])
end
end
for k,v in pairs(ret1) do
if ret2[k]==1 then
local val=v:GetValue()
if aux.GetValueType(val)=="number" then val=aux.TRUE end
if val(v,te,p) then
v:SetValue(cm.chval(val,false,te))
end
end
if ret2[k]==2 then
local cost=v:GetCost()
if not v:GetLabelObject() and cost and not cost(v,te,p) then
local tg=v:GetTarget()
if not tg then
v:SetTarget(cm.chtg(aux.TRUE,false,te))
elseif tg(v,te,p) then
v:SetTarget(cm.chtg(tg,false,te))
end
end
end
end
local xe1=cm.regi(c,te)
for k,v in pairs(ret3) do
if ret4[k]==1 then
local val=v:GetValue()
if aux.GetValueType(val)=="number" then val=aux.TRUE end
if val(v,te,p) then
v:SetValue(cm.chval(val,true,te))
end
end
if ret4[k]==2 then
local cost=v:GetCost()
if not v:GetLabelObject() and cost and not cost(v,te,p) then
local tg=v:GetTarget()
if not tg then
v:SetTarget(cm.chtg(aux.TRUE,true,te))
elseif tg(v,te,p) then
v:SetTarget(cm.chtg(tg,true,te))
end
end
end
end
xe1:Reset()
end
function cm.bchval(_val,te)
return function(e,re,...)
if re==te then return false end
return _val(e,re,...)
end
end
function cm.chval(_val,res,te)
return function(e,re,...)
if re==te then return res end
return _val(e,re,...)
end
end
function cm.chtg(_tg,res,te)
return function(e,re,...)
if re==te then return res end
return _tg(e,re,...)
end
end
function cm.actarget(e,te,tp)
return te:GetHandler()==e:GetHandler() and te==e:GetLabelObject()
end
function cm.costchk(e,te,tp)
return Duel.GetLocationCount(tp,LOCATION_SZONE)>0
end
function cm.costop(e,tp,eg,ep,ev,re,r,rp)
local te=e:GetLabelObject()
local c=te:GetHandler()
local xe1=cm.regi(c,te)
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetCode(EFFECT_CHANGE_TYPE)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e0:SetValue(0x20004)
c:RegisterEffect(e0,true)
Duel.MoveToField(c,tp,tp,LOCATION_SZONE,POS_FACEUP,false)
xe1:SetLabel(c:GetSequence()+1)
e0:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET)
c:CreateEffectRelation(te)
local ev0=Duel.GetCurrentChain()+1
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetCode(EVENT_CHAIN_SOLVING)
e1:SetCountLimit(1)
e1:SetCondition(function(e,tp,eg,ep,ev,re,r,rp)return ev==ev0 end)
e1:SetOperation(cm.rsop)
e1:SetReset(RESET_CHAIN)
Duel.RegisterEffect(e1,tp)
local e2=e1:Clone()
e2:SetCode(EVENT_CHAIN_NEGATED)
Duel.RegisterEffect(e2,tp)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_REMAIN_FIELD)
e3:SetProperty(EFFECT_FLAG_OATH+EFFECT_FLAG_CANNOT_DISABLE)
e3:SetReset(RESET_CHAIN)
c:RegisterEffect(e3)
end
function cm.rsop(e,tp,eg,ep,ev,re,r,rp)
local rc=re:GetHandler()
if e:GetCode()==EVENT_CHAIN_SOLVING and rc:IsRelateToEffect(re) then
rc:SetStatus(STATUS_EFFECT_ENABLED,true)
end
if e:GetCode()==EVENT_CHAIN_NEGATED and rc:IsRelateToEffect(re) and not (rc:IsOnField() and rc:IsFacedown()) then
rc:SetStatus(STATUS_ACTIVATE_DISABLED,true)
rc:CancelToGrave(false)
end
local xe={rc:IsHasEffect(53765099)}
for _,v in pairs(xe) do if v:GetLabelObject()==re then v:Reset() end end
end
function cm.mvop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(nil,tp,0xff,0,nil)
for c in aux.Next(g) do
......@@ -657,9 +328,10 @@ end
function cm.mvcostop(e,tp,eg,ep,ev,re,r,rp)
local te=e:GetLabelObject()
local c=te:GetHandler()
local xe1=cm.regi(c,te)
local typ=c:GetType()
local xe1=SNNM.AASTregi(c,te)
Duel.MoveToField(c,tp,tp,LOCATION_SZONE,POS_FACEUP,false)
xe1:SetLabel(c:GetSequence()+1)
xe1:SetLabel(c:GetSequence()+1,typ)
c:CreateEffectRelation(te)
local ev0=Duel.GetCurrentChain()+1
local e1=Effect.CreateEffect(c)
......@@ -690,15 +362,6 @@ function cm.mvrsop(e,tp,eg,ep,ev,re,r,rp)
end
if re then re:Reset() end
end
function cm.regi(c,e)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(53765099)
e1:SetLabelObject(e)
c:RegisterEffect(e1,true)
return e1
end
function cm.mvhint(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not (c:IsLocation(LOCATION_SZONE) and c:IsPreviousLocation(LOCATION_SZONE) and (c:GetPreviousSequence()~=c:GetSequence() or c:GetPreviousControler()~=c:GetControler())) then return end
......
......@@ -6,40 +6,8 @@ cm.name="枷狱最高检察官 审判"
cm.AD_Ht=true
function cm.initial_effect(c)
SNNM.AllEffectReset(c)
local e1=Effect.CreateEffect(c)
local e1,e1_1,e2,e3=SNNM.ActivatedAsSpellorTrap(c,0x20004)
e1:SetDescription(aux.Stringid(m,0))
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_HAND)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_CANNOT_DISABLE)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
c:RegisterEffect(e1)
local e1_1=Effect.CreateEffect(c)
e1_1:SetType(EFFECT_TYPE_SINGLE)
e1_1:SetProperty(EFFECT_FLAG_SINGLE_RANGE+EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1_1:SetCode(53765098)
e1_1:SetRange(LOCATION_HAND)
e1_1:SetLabelObject(e1)
c:RegisterEffect(e1_1,true)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_ADJUST)
e2:SetRange(LOCATION_HAND)
e2:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_CANNOT_DISABLE)
e2:SetLabelObject(e1)
e2:SetOperation(cm.adjustop)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_ACTIVATE_COST)
e3:SetRange(LOCATION_HAND)
e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e3:SetTargetRange(1,1)
e3:SetLabelObject(e1)
e3:SetTarget(cm.actarget)
e3:SetCost(cm.costchk)
e3:SetOperation(cm.costop)
c:RegisterEffect(e3)
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetProperty(EFFECT_FLAG_SINGLE_RANGE+EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
......@@ -85,6 +53,7 @@ function cm.initial_effect(c)
ge3:SetOperation(cm.mvcount)
Duel.RegisterEffect(ge3,0)
end
SNNM.ActivatedAsSpellorTrapCheck(c)
if not AD_Helltaker_Check then
AD_Helltaker_Check=true
local ge1=Effect.CreateEffect(c)
......@@ -94,69 +63,6 @@ function cm.initial_effect(c)
Duel.RegisterEffect(ge1,0)
local ge2=ge1:Clone()
Duel.RegisterEffect(ge2,1)
cm[1]=Card.GetActivateEffect
Card.GetActivateEffect=function(ac)
local le={cm[1](ac)}
local xe={ac:IsHasEffect(53765098)}
local ae=nil
for _,v in pairs(xe) do ae=v:GetLabelObject() end
if ae then
le={ae}
local xe1=cm.regi(ac,ae)
end
return table.unpack(le)
end
cm[2]=Card.IsType
Card.IsType=function(rc,type)
local res=cm[2](rc,type)
if type&(TYPE_TRAP+TYPE_CONTINUOUS)~=0 and rc:IsHasEffect(53765099) then return true else return res end
end
cm[3]=Card.GetType
Card.GetType=function(rc)
if rc:IsHasEffect(53765099) then return TYPE_TRAP+TYPE_CONTINUOUS else return cm[3](rc) end
end
cm[4]=Effect.IsHasType
Effect.IsHasType=function(re,type)
local res=cm[4](re,type)
local rc=re:GetHandler()
local xe={}
if rc then xe={rc:IsHasEffect(53765099)} end
local b=false
for _,v in pairs(xe) do if re==v:GetLabelObject() then b=true end end
if b then
if type&EFFECT_TYPE_ACTIVATE~=0 then return true else return false end
else return res end
end
cm[5]=Effect.GetType
Effect.GetType=function(re)
local rc=re:GetHandler()
local xe={}
if rc then xe={rc:IsHasEffect(53765099)} end
local b=false
for _,v in pairs(xe) do if re==v:GetLabelObject() then b=true end end
if b then return EFFECT_TYPE_ACTIVATE else return cm[5](re) end
end
cm[6]=Effect.IsActiveType
Effect.IsActiveType=function(re,type)
local res=cm[6](re,type)
local rc=re:GetHandler()
local xe={}
if rc then xe={rc:IsHasEffect(53765099)} end
local b=false
for _,v in pairs(xe) do if re==v:GetLabelObject() then b=true end end
if b then
if type&(TYPE_TRAP+TYPE_CONTINUOUS)~=0 then return true else return false end
else return res end
end
cm[7]=Effect.GetActiveType
Effect.GetActiveType=function(re)
local rc=re:GetHandler()
local xe={}
if rc then xe={rc:IsHasEffect(53765099)} end
local b=false
for _,v in pairs(xe) do if re==v:GetLabelObject() then b=true end end
if b then return 0x20004 else return cm[7](re) end
end
cm[8]=Duel.MoveToField
Duel.MoveToField=function(sc,mp,tp,dest,pos,bool,zone)
local czone=zone or 0xff
......@@ -169,246 +75,11 @@ function cm.initial_effect(c)
if ad_ht_zc then ct=ct+ad_ht_zc end
return ct
end
cm[10]=Effect.GetActivateLocation
Effect.GetActivateLocation=function(re)
local rc=re:GetHandler()
local xe={}
if rc then xe={rc:IsHasEffect(53765099)} end
local b=false
for _,v in pairs(xe) do if re==v:GetLabelObject() then b=true end end
if b then return LOCATION_SZONE else return cm[10](re) end
end
cm[11]=Effect.GetActivateSequence
Effect.GetActivateSequence=function(re)
local rc=re:GetHandler()
local xe={}
if rc then xe={rc:IsHasEffect(53765099)} end
local ls=0
local seq=cm[11](re)
for _,v in pairs(xe) do
if re==v:GetLabelObject() then
ls=v:GetLabel()
break
end
end
if ls>0 then return ls-1 else return seq end
end
cm[12]=Duel.GetChainInfo
Duel.GetChainInfo=function(chainc,...)
local re=cm[12](chainc,CHAININFO_TRIGGERING_EFFECT)
local rc=re:GetHandler()
local xe={}
if rc then xe={rc:IsHasEffect(53765099)} end
local b=false
local ls=0
for _,v in pairs(xe) do
if re==v:GetLabelObject() then
b=true
ls=v:GetLabel()
break
end
end
local t={cm[12](chainc,...)}
if b then
for k,info in ipairs({...}) do
if info==CHAININFO_TYPE then t[k]=0x20004 end
if info==CHAININFO_EXTTYPE then t[k]=0x20004 end
if info==CHAININFO_TRIGGERING_LOCATION then t[k]=LOCATION_SZONE end
if info==CHAININFO_TRIGGERING_SEQUENCE and ls>0 then t[k]=ls-1 end
if info==CHAININFO_TRIGGERING_POSITION then t[k]=POS_FACEUP end
end
end
return table.unpack(t)
end
end
end
function cm.adjustop(e,tp,eg,ep,ev,re,r,rp)
local te=e:GetLabelObject()
local c=te:GetHandler()
local xe={c:IsHasEffect(53765099)}
for _,v in pairs(xe) do v:Reset() end
local p=te:GetHandlerPlayer()
local pe={Duel.IsPlayerAffectedByEffect(p,EFFECT_CANNOT_ACTIVATE)}
local ae={Duel.IsPlayerAffectedByEffect(p,EFFECT_ACTIVATE_COST)}
local t1,t2={},{}
for _,v in pairs(pe) do
local val=v:GetValue()
if aux.GetValueType(val)=="number" or val(v,te,p) then
table.insert(t1,v)
table.insert(t2,1)
end
end
for _,v in pairs(ae) do
local cost=v:GetCost()
if not v:GetLabelObject() and cost and not cost(v,te,p) then
local tg=v:GetTarget()
if not tg or tg(v,te,p) then
table.insert(t1,v)
table.insert(t2,2)
end
end
end
local xe1=cm.regi(c,te)
local t3,t4={},{}
for _,v in pairs(pe) do
local val=v:GetValue()
if aux.GetValueType(val)=="number" or val(v,te,p) then
table.insert(t3,v)
table.insert(t4,1)
end
end
for _,v in pairs(ae) do
local cost=v:GetCost()
if not v:GetLabelObject() and cost and not cost(v,te,p) then
local tg=v:GetTarget()
if not tg or tg(v,te,p) then
table.insert(t3,v)
table.insert(t4,2)
end
end
end
xe1:Reset()
local ret1,ret2={},{}
for k,v1 in pairs(t1) do
local equal=false
for _,v2 in pairs(t3) do
if v1==v2 then
equal=true
break
end
end
if not equal then
table.insert(ret1,v1)
table.insert(ret2,t2[k])
end
end
local ret3,ret4={},{}
for k,v1 in pairs(t3) do
local equal=false
for _,v2 in pairs(t1) do
if v1==v2 then
equal=true
break
end
end
if not equal then
table.insert(ret3,v1)
table.insert(ret4,t4[k])
end
end
for k,v in pairs(ret1) do
if ret2[k]==1 then
local val=v:GetValue()
if aux.GetValueType(val)=="number" then val=aux.TRUE end
if val(v,te,p) then
v:SetValue(cm.chval(val,false,te))
end
end
if ret2[k]==2 then
local cost=v:GetCost()
if not v:GetLabelObject() and cost and not cost(v,te,p) then
local tg=v:GetTarget()
if not tg then
v:SetTarget(cm.chtg(aux.TRUE,false,te))
elseif tg(v,te,p) then
v:SetTarget(cm.chtg(tg,false,te))
end
end
end
end
local xe1=cm.regi(c,te)
for k,v in pairs(ret3) do
if ret4[k]==1 then
local val=v:GetValue()
if aux.GetValueType(val)=="number" then val=aux.TRUE end
if val(v,te,p) then
v:SetValue(cm.chval(val,true,te))
end
end
if ret4[k]==2 then
local cost=v:GetCost()
if not v:GetLabelObject() and cost and not cost(v,te,p) then
local tg=v:GetTarget()
if not tg then
v:SetTarget(cm.chtg(aux.TRUE,true,te))
elseif tg(v,te,p) then
v:SetTarget(cm.chtg(tg,true,te))
end
end
end
end
xe1:Reset()
end
function cm.bchval(_val,te)
return function(e,re,...)
if re==te then return false end
return _val(e,re,...)
end
end
function cm.chval(_val,res,te)
return function(e,re,...)
if re==te then return res end
return _val(e,re,...)
end
end
function cm.chtg(_tg,res,te)
return function(e,re,...)
if re==te then return res end
return _tg(e,re,...)
end
end
function cm.actarget(e,te,tp)
return te:GetHandler()==e:GetHandler() and te==e:GetLabelObject()
end
function cm.costchk(e,te,tp)
return Duel.GetLocationCount(tp,LOCATION_SZONE)>0
end
function cm.costop(e,tp,eg,ep,ev,re,r,rp)
local te=e:GetLabelObject()
local c=te:GetHandler()
local xe1=cm.regi(c,te)
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetCode(EFFECT_CHANGE_TYPE)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e0:SetValue(0x20004)
c:RegisterEffect(e0,true)
Duel.MoveToField(c,tp,tp,LOCATION_SZONE,POS_FACEUP,false)
xe1:SetLabel(c:GetSequence()+1)
e0:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET)
c:CreateEffectRelation(te)
local ev0=Duel.GetCurrentChain()+1
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetCode(EVENT_CHAIN_SOLVING)
e1:SetCountLimit(1)
e1:SetCondition(function(e,tp,eg,ep,ev,re,r,rp)return ev==ev0 end)
e1:SetOperation(cm.rsop)
e1:SetReset(RESET_CHAIN)
Duel.RegisterEffect(e1,tp)
local e2=e1:Clone()
e2:SetCode(EVENT_CHAIN_NEGATED)
Duel.RegisterEffect(e2,tp)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_REMAIN_FIELD)
e3:SetProperty(EFFECT_FLAG_OATH+EFFECT_FLAG_CANNOT_DISABLE)
e3:SetReset(RESET_CHAIN)
c:RegisterEffect(e3)
end
function cm.rsop(e,tp,eg,ep,ev,re,r,rp)
local rc=re:GetHandler()
if e:GetCode()==EVENT_CHAIN_SOLVING and rc:IsRelateToEffect(re) then
rc:SetStatus(STATUS_EFFECT_ENABLED,true)
end
if e:GetCode()==EVENT_CHAIN_NEGATED and rc:IsRelateToEffect(re) and not (rc:IsOnField() and rc:IsFacedown()) then
rc:SetStatus(STATUS_ACTIVATE_DISABLED,true)
rc:CancelToGrave(false)
end
local xe={rc:IsHasEffect(53765099)}
for _,v in pairs(xe) do if v:GetLabelObject()==re then v:Reset() end end
end
function cm.mvop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(nil,tp,0xff,0,nil)
for c in aux.Next(g) do
......@@ -425,7 +96,6 @@ function cm.mvop(e,tp,eg,ep,ev,re,r,rp)
local le={c:GetActivateEffect()}
for _,te in pairs(le) do
if te:GetRange()==0x10a or te:GetRange()==0x2 then
--if not te:GetDescription() then te:SetDescription(aux.Stringid(m,1)) end
local e1=te:Clone()
e1:SetDescription(aux.Stringid(m,1))
if te:GetCode()==EVENT_FREE_CHAIN then
......@@ -455,7 +125,6 @@ function cm.mvop(e,tp,eg,ep,ev,re,r,rp)
fcheck=true
local e2=ae:Clone()
e2:SetLabelObject(e1)
--e2:SetLabel(zone)
e2:SetTarget(cm.actarget)
local cost=ae:GetCost()
if not cost then cost=aux.TRUE end
......@@ -469,22 +138,6 @@ function cm.mvop(e,tp,eg,ep,ev,re,r,rp)
ex:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
ex:SetLabelObject(e2)
c:RegisterEffect(ex,true)
--[[if c.AD_Ht then
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e4:SetCode(EVENT_ADJUST)
e4:SetRange(LOCATION_HAND)
e4:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_CANNOT_DISABLE)
e4:SetLabelObject(e1)
e4:SetOperation(cm.adjustop)
c:RegisterEffect(e4,true)
local ex2=Effect.CreateEffect(c)
ex2:SetType(EFFECT_TYPE_SINGLE)
ex2:SetCode(53765050)
ex2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
ex2:SetLabelObject(e4)
c:RegisterEffect(ex2,true)
end--]]
end
end
if not fcheck then
......@@ -494,7 +147,6 @@ function cm.mvop(e,tp,eg,ep,ev,re,r,rp)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_CANNOT_DISABLE)
e2:SetRange(LOCATION_HAND)
e2:SetTargetRange(1,0)
--e2:SetLabel(zone)
e2:SetTarget(cm.actarget)
e2:SetCost(cm.faccost(aux.TRUE,te,zone))
e2:SetOperation(cm.fcostop(cm.mvcostop,zone))
......@@ -564,29 +216,13 @@ function cm.mvfilter(c,e,tp,zone)
local seq=c:GetSequence()
return c:IsHasEffect(53765000) and ((seq>0 and Duel.CheckLocation(tp,LOCATION_SZONE,seq-1)) or c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP,tp,1<<seq)) and (1<<seq)&zone~=0
end
--[[function cm.mvcostchk(e,te,tp)
local c=e:GetHandler()
local xe={c:IsHasEffect(53765099)}
for _,v in pairs(xe) do v:Reset() end
if c:IsType(TYPE_QUICKPLAY) and Duel.GetTurnPlayer()~=tp and not c:IsHasEffect(EFFECT_QP_ACT_IN_NTPHAND) then return false end
if c:IsType(TYPE_TRAP) and not c:IsHasEffect(EFFECT_TRAP_ACT_IN_HAND) then return false end
if not c:CheckUniqueOnField(tp) then return false end
return Duel.IsExistingMatchingCard(cm.mvfilter,tp,LOCATION_SZONE,0,1,nil,e,tp,e:GetLabel())
end
function cm.smvcostop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(m,2))
local tc=Duel.SelectMatchingCard(tp,cm.mvfilter,tp,LOCATION_SZONE,0,1,1,nil,e,tp,e:GetLabel()):GetFirst()
local seq=tc:GetSequence()
if seq>0 and Duel.CheckLocation(tp,LOCATION_SZONE,seq-1) then Duel.MoveSequence(tc,seq-1) else Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP,1<<seq) end
ad_ht_fr=1<<seq
end--]]
function cm.mvcostop(e,tp,eg,ep,ev,re,r,rp)
--cm.smvcostop(e,tp,eg,ep,ev,re,r,rp)
local te=e:GetLabelObject()
local c=te:GetHandler()
local xe1=cm.regi(c,te)
local typ=c:GetType()
local xe1=SNNM.AASTregi(c,te)
Duel.MoveToField(c,tp,tp,LOCATION_SZONE,POS_FACEUP,false)
xe1:SetLabel(c:GetSequence()+1)
xe1:SetLabel(c:GetSequence()+1,typ)
c:CreateEffectRelation(te)
local ev0=Duel.GetCurrentChain()+1
local e1=Effect.CreateEffect(c)
......@@ -617,15 +253,6 @@ function cm.mvrsop(e,tp,eg,ep,ev,re,r,rp)
end
if re then re:Reset() end
end
function cm.regi(c,e)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(53765099)
e1:SetLabelObject(e)
c:RegisterEffect(e1,true)
return e1
end
function cm.mvctfilter(c)
return c:IsLocation(LOCATION_SZONE) and c:IsPreviousLocation(LOCATION_SZONE) and (c:GetPreviousSequence()~=c:GetSequence() or c:GetPreviousControler()~=c:GetControler())
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