Commit 9f7778b8 authored by POLYMER's avatar POLYMER

fix

parent fe1d3c8d
No preview for this file type
...@@ -77,5 +77,5 @@ function c50213245.cfilter(c) ...@@ -77,5 +77,5 @@ function c50213245.cfilter(c)
return c:IsSetCard(0xcbf) and c:IsFaceup() return c:IsSetCard(0xcbf) and c:IsFaceup()
end end
function c50213245.handcon(e) function c50213245.handcon(e)
return Duel.IsExistingMatchingCard(c50213245.cfilter,tp,LOCATION_MZONE,0,1,nil) return Duel.IsExistingMatchingCard(c50213245.cfilter,e:GetOwnerPlayer(),LOCATION_MZONE,0,1,nil)
end end
\ No newline at end of file
...@@ -75,7 +75,7 @@ function c53700000.fselect(g,tp) ...@@ -75,7 +75,7 @@ function c53700000.fselect(g,tp)
return g:CheckWithSumGreater(Card.GetLevel,4) and aux.mzctcheckrel(g,tp) return g:CheckWithSumGreater(Card.GetLevel,4) and aux.mzctcheckrel(g,tp)
end end
function c53700000.skop(e,tp,eg,ep,ev,re,r,rp) function c53700000.skop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetReleaseGroup(tp):Filter(c53700000.rfilter,nil,tp) local g=Duel.GetReleaseGroup(tp,false,REASON_EFFECT):Filter(c53700000.rfilter,nil,tp)
if Duel.SendtoDeck(e:GetHandler(),nil,0,REASON_EFFECT) and g:CheckSubGroup(c53700000.fselect,1,g:GetCount(),tp) and Duel.IsPlayerCanSpecialSummonMonster(tp,53700001,0,0x4011,0,0,2,RACE_ZOMBIE,ATTRIBUTE_LIGHT) and Duel.SelectYesNo(tp,aux.Stringid(53700000,0)) then if Duel.SendtoDeck(e:GetHandler(),nil,0,REASON_EFFECT) and g:CheckSubGroup(c53700000.fselect,1,g:GetCount(),tp) and Duel.IsPlayerCanSpecialSummonMonster(tp,53700001,0,0x4011,0,0,2,RACE_ZOMBIE,ATTRIBUTE_LIGHT) and Duel.SelectYesNo(tp,aux.Stringid(53700000,0)) then
Duel.BreakEffect() Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
......
...@@ -35,8 +35,8 @@ function c53700005.spfilter(c,tp) ...@@ -35,8 +35,8 @@ function c53700005.spfilter(c,tp)
return c:IsCode(53700001) return c:IsCode(53700001)
end end
function c53700005.sumcost(e,tp,eg,ep,ev,re,r,rp,chk) function c53700005.sumcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroup(tp,c53700005.spfilter,1,nil,tp) end if chk==0 then return Duel.CheckReleaseGroup(REASON_COST,tp,c53700005.spfilter,1,nil,tp) end
local g=Duel.SelectReleaseGroup(tp,c53700005.spfilter,1,10,nil) local g=Duel.SelectReleaseGroup(REASON_COST,tp,c53700005.spfilter,1,10,nil)
local lv=g:GetSum(Card.GetLevel) local lv=g:GetSum(Card.GetLevel)
Duel.Release(g,REASON_COST) Duel.Release(g,REASON_COST)
e:SetLabel(lv) e:SetLabel(lv)
......
...@@ -57,8 +57,8 @@ function c53700006.cfilter(c,ft,tp) ...@@ -57,8 +57,8 @@ function c53700006.cfilter(c,ft,tp)
end end
function c53700006.spcost(e,tp,eg,ep,ev,re,r,rp,chk) function c53700006.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE) local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if chk==0 then return ft>-1 and Duel.CheckReleaseGroup(tp,c53700006.cfilter,1,nil,ft,tp) end if chk==0 then return ft>-1 and Duel.CheckReleaseGroup(REASON_COST,tp,c53700006.cfilter,1,nil,ft,tp) end
local g=Duel.SelectReleaseGroup(tp,c53700006.cfilter,1,1,nil,ft,tp) local g=Duel.SelectReleaseGroup(REASON_COST,tp,c53700006.cfilter,1,1,nil,ft,tp)
e:SetLabel(g:GetFirst():GetLevel()) e:SetLabel(g:GetFirst():GetLevel())
Duel.Release(g,REASON_COST) Duel.Release(g,REASON_COST)
end end
......
...@@ -43,7 +43,7 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -43,7 +43,7 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
if not tc:IsRelateToEffect(e) or tc:IsFacedown() then return end if not tc:IsRelateToEffect(e) or tc:IsFacedown() then return end
local ct1=Duel.GetMatchingGroupCount(cm.filter1,tp,LOCATION_MZONE,0,tc) local ct1=Duel.GetMatchingGroupCount(cm.filter1,tp,LOCATION_MZONE,0,tc)
local rg=Duel.SelectReleaseGroup(tp,Card.IsReleasableByEffect,1,ct1,tc) local rg=Duel.SelectReleaseGroup(REASON_EFFECT,tp,Card.IsReleasableByEffect,1,ct1,tc)
local lv=rg:GetSum(Card.GetLevel) local lv=rg:GetSum(Card.GetLevel)
local ct2=Duel.Release(rg,REASON_EFFECT) local ct2=Duel.Release(rg,REASON_EFFECT)
if ct2==0 or lv==0 then return end if ct2==0 or lv==0 then return end
......
...@@ -55,8 +55,8 @@ function c53701001.aclimit(e,re,tp) ...@@ -55,8 +55,8 @@ function c53701001.aclimit(e,re,tp)
return re:GetActivateLocation()==LOCATION_GRAVE return re:GetActivateLocation()==LOCATION_GRAVE
end end
function c53701001.immcost(e,tp,eg,ep,ev,re,r,rp,chk) function c53701001.immcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroup(tp,Card.IsSetCard,1,e:GetHandler(),0x3530) end if chk==0 then return Duel.CheckReleaseGroup(REASON_COST,tp,Card.IsSetCard,1,e:GetHandler(),0x3530) end
local g=Duel.SelectReleaseGroup(tp,Card.IsSetCard,1,1,e:GetHandler(),0x3530) local g=Duel.SelectReleaseGroup(REASON_COST,tp,Card.IsSetCard,1,1,e:GetHandler(),0x3530)
Duel.Release(g,REASON_COST) Duel.Release(g,REASON_COST)
end end
function c53701001.immop(e,tp,eg,ep,ev,re,r,rp) function c53701001.immop(e,tp,eg,ep,ev,re,r,rp)
......
...@@ -52,12 +52,12 @@ function c53701007.hspcon(e,c) ...@@ -52,12 +52,12 @@ function c53701007.hspcon(e,c)
if c==nil then return true end if c==nil then return true end
local tp=c:GetControler() local tp=c:GetControler()
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE) local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
return ft>-1 and Duel.CheckReleaseGroup(tp,c53701007.hspfilter,1,nil,ft,tp) return ft>-1 and Duel.CheckReleaseGroup(REASON_SPSUMMON,tp,c53701007.hspfilter,1,nil,ft,tp)
end end
function c53701007.hspop(e,tp,eg,ep,ev,re,r,rp,c) function c53701007.hspop(e,tp,eg,ep,ev,re,r,rp,c)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE) local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
local tc=Duel.SelectReleaseGroup(tp,c53701007.hspfilter,1,1,nil,ft,tp):GetFirst() local tc=Duel.SelectReleaseGroup(REASON_SPSUMMON,tp,c53701007.hspfilter,1,1,nil,ft,tp):GetFirst()
Duel.Release(tc,REASON_COST) Duel.Release(tc,REASON_SPSUMMON)
e:GetLabelObject():SetLabelObject(tc) e:GetLabelObject():SetLabelObject(tc)
end end
function c53701007.con(e,tp,eg,ep,ev,re,r,rp) function c53701007.con(e,tp,eg,ep,ev,re,r,rp)
......
...@@ -40,9 +40,9 @@ function cm.con(e,tp,eg,ep,ev,re,r,rp) ...@@ -40,9 +40,9 @@ function cm.con(e,tp,eg,ep,ev,re,r,rp)
end end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk) function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler() local c=e:GetHandler()
if chk==0 then return c:IsReleasable() and Duel.CheckReleaseGroup(tp,Card.IsSetCard,1,c,0x3530) end if chk==0 then return c:IsReleasable() and Duel.CheckReleaseGroup(REASON_COST,tp,Card.IsSetCard,1,c,0x3530) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local rg=Duel.SelectReleaseGroup(tp,Card.IsSetCard,1,1,c,0x3530) local rg=Duel.SelectReleaseGroup(REASON_COST,tp,Card.IsSetCard,1,1,c,0x3530)
rg:AddCard(c) rg:AddCard(c)
Duel.Release(rg,REASON_COST) Duel.Release(rg,REASON_COST)
end end
......
...@@ -29,8 +29,8 @@ function cm.condition(e,tp,eg,ep,ev,re,r,rp) ...@@ -29,8 +29,8 @@ function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return rp==1-tp and re:IsActiveType(TYPE_MONSTER) and not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) and Duel.IsChainNegatable(ev) and Duel.IsExistingMatchingCard(Card.IsCode,tp,0,LOCATION_GRAVE,1,nil,re:GetHandler():GetCode()) return rp==1-tp and re:IsActiveType(TYPE_MONSTER) and not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) and Duel.IsChainNegatable(ev) and Duel.IsExistingMatchingCard(Card.IsCode,tp,0,LOCATION_GRAVE,1,nil,re:GetHandler():GetCode())
end end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk) function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroup(tp,Card.IsRace,1,nil,RACE_MACHINE) end if chk==0 then return Duel.CheckReleaseGroup(REASON_COST,tp,Card.IsRace,1,nil,RACE_MACHINE) end
local g=Duel.SelectReleaseGroup(tp,Card.IsRace,1,1,nil,RACE_MACHINE) local g=Duel.SelectReleaseGroup(REASON_COST,tp,Card.IsRace,1,1,nil,RACE_MACHINE)
Duel.Release(g,REASON_COST) Duel.Release(g,REASON_COST)
end end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk) function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
......
...@@ -5234,7 +5234,7 @@ function cm.MultipleGroupCheck(c) ...@@ -5234,7 +5234,7 @@ function cm.MultipleGroupCheck(c)
return b return b
end end
ADIMI_SelectReleaseGroup=Duel.SelectReleaseGroup ADIMI_SelectReleaseGroup=Duel.SelectReleaseGroup
Duel.SelectReleaseGroup=function(p,f,min,max,ex,...) Duel.SelectReleaseGroup=function(r,p,f,min,max,ex,...)
local lab=Duel.GetFlagEffectLabel(0,53759000) local lab=Duel.GetFlagEffectLabel(0,53759000)
Duel.SetFlagEffectLabel(0,53759000,lab+1) Duel.SetFlagEffectLabel(0,53759000,lab+1)
local ly=0 local ly=0
...@@ -5248,7 +5248,7 @@ function cm.MultipleGroupCheck(c) ...@@ -5248,7 +5248,7 @@ function cm.MultipleGroupCheck(c)
cm["Card_Prophecy_L_Check_"..ly]=true cm["Card_Prophecy_L_Check_"..ly]=true
ADIMI_GetMatchingGroup(f,p,LOCATION_MZONE,LOCATION_MZONE,ex,...) ADIMI_GetMatchingGroup(f,p,LOCATION_MZONE,LOCATION_MZONE,ex,...)
cm["Card_Prophecy_L_Check_"..ly]=false cm["Card_Prophecy_L_Check_"..ly]=false
local b=ADIMI_SelectReleaseGroup(p,f,min,max,ex,...) local b=ADIMI_SelectReleaseGroup(r,p,f,min,max,ex,...)
cm["Card_Prophecy_Certain_SP_"..ly]=false cm["Card_Prophecy_Certain_SP_"..ly]=false
cm["Card_Prophecy_Certain_ACST_"..ly]=false cm["Card_Prophecy_Certain_ACST_"..ly]=false
cm["Card_Prophecy_Layer_"..ly]=false cm["Card_Prophecy_Layer_"..ly]=false
...@@ -5256,7 +5256,7 @@ function cm.MultipleGroupCheck(c) ...@@ -5256,7 +5256,7 @@ function cm.MultipleGroupCheck(c)
return b return b
end end
ADIMI_SelectReleaseGroupEx=Duel.SelectReleaseGroupEx ADIMI_SelectReleaseGroupEx=Duel.SelectReleaseGroupEx
Duel.SelectReleaseGroupEx=function(p,f,min,max,ex,...) Duel.SelectReleaseGroupEx=function(r,p,f,min,max,ex,...)
local lab=Duel.GetFlagEffectLabel(0,53759000) local lab=Duel.GetFlagEffectLabel(0,53759000)
Duel.SetFlagEffectLabel(0,53759000,lab+1) Duel.SetFlagEffectLabel(0,53759000,lab+1)
local ly=0 local ly=0
...@@ -5270,7 +5270,7 @@ function cm.MultipleGroupCheck(c) ...@@ -5270,7 +5270,7 @@ function cm.MultipleGroupCheck(c)
cm["Card_Prophecy_L_Check_"..ly]=true cm["Card_Prophecy_L_Check_"..ly]=true
ADIMI_GetMatchingGroup(f,p,LOCATION_MZONE+LOCATION_HAND,LOCATION_MZONE+LOCATION_HAND,ex,...) ADIMI_GetMatchingGroup(f,p,LOCATION_MZONE+LOCATION_HAND,LOCATION_MZONE+LOCATION_HAND,ex,...)
cm["Card_Prophecy_L_Check_"..ly]=false cm["Card_Prophecy_L_Check_"..ly]=false
local b=ADIMI_SelectReleaseGroupEx(p,f,min,max,ex,...) local b=ADIMI_SelectReleaseGroupEx(r,p,f,min,max,ex,...)
cm["Card_Prophecy_Certain_SP_"..ly]=false cm["Card_Prophecy_Certain_SP_"..ly]=false
cm["Card_Prophecy_Certain_ACST_"..ly]=false cm["Card_Prophecy_Certain_ACST_"..ly]=false
cm["Card_Prophecy_Layer_"..ly]=false cm["Card_Prophecy_Layer_"..ly]=false
...@@ -7127,3 +7127,58 @@ function cm.ATTSerieslockcon(n,att) ...@@ -7127,3 +7127,58 @@ function cm.ATTSerieslockcon(n,att)
return Duel.IsExistingMatchingCard(function(c,att)return c:IsFaceup() and c:IsAttribute(att)end,math.abs(e:GetHandlerPlayer()-n),LOCATION_MZONE,0,1,nil,att) return Duel.IsExistingMatchingCard(function(c,att)return c:IsFaceup() and c:IsAttribute(att)end,math.abs(e:GetHandlerPlayer()-n),LOCATION_MZONE,0,1,nil,att)
end end
end end
function cm.BlackLotus(c)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE_START+PHASE_DRAW)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_CANNOT_DISABLE)
e1:SetRange(0xff)
e1:SetOperation(cm.BlackLotusop)
e1:SetCountLimit(1)
c:RegisterEffect(e1)
end
function cm.BlackLotusop(e,tp,eg,ep,ev,re,r,rp)
e:Reset()
if not Party_time_random_seed then
local result=0
local g=Duel.GetDecktopGroup(0,5)
local tc=g:GetFirst()
while tc do
local code=tc:GetCode()
if code==90846359 then code=53799000 end
result=result+code
tc=g:GetNext()
end
local g=Duel.GetDecktopGroup(1,5)
local tc=g:GetFirst()
while tc do
local code=tc:GetCode()
if code==90846359 then code=53799000 end
result=result+code
tc=g:GetNext()
end
g:DeleteGroup()
Party_time_random_seed=result
function Party_time_roll(min,max)
if min==max then return min end
min=tonumber(min)
max=tonumber(max)
Party_time_random_seed=(Party_time_random_seed*16807)%2147484647
if min~=nil then
if max==nil then
local random_number=Party_time_random_seed/2147484647
return (random_number*min)
else
local random_number=Party_time_random_seed/2147484647
if random_number<min then
Party_time_random_seed=(Party_time_random_seed*16807)%2147484647
random_number=Party_time_random_seed/2147484647
end
return ((max-min)*random_number)+min
end
end
return Party_time_random_seed
end
for i=1,100 do Debug.Message(Party_time_roll(0,1.5)) end
end
end
...@@ -31,11 +31,11 @@ function cm.hspcon(e,c) ...@@ -31,11 +31,11 @@ function cm.hspcon(e,c)
if c==nil then return true end if c==nil then return true end
if c:IsLocation(LOCATION_DECK) and c:IsFacedown() then return end if c:IsLocation(LOCATION_DECK) and c:IsFacedown() then return end
local tp=c:GetControler() local tp=c:GetControler()
return Duel.CheckReleaseGroup(tp,cm.hspfilter,1,nil,tp) return Duel.CheckReleaseGroup(REASON_SPSUMMON,tp,cm.hspfilter,1,nil,tp)
end end
function cm.hspop(e,tp,eg,ep,ev,re,r,rp,c) function cm.hspop(e,tp,eg,ep,ev,re,r,rp,c)
local g=Duel.SelectReleaseGroup(tp,cm.hspfilter,1,1,nil,tp) local g=Duel.SelectReleaseGroup(REASON_SPSUMMON,tp,cm.hspfilter,1,1,nil,tp)
Duel.Release(g,REASON_COST) Duel.Release(g,REASON_SPSUMMON)
end end
function cm.effcon(e,tp,eg,ep,ev,re,r,rp) function cm.effcon(e,tp,eg,ep,ev,re,r,rp)
return r==REASON_SYNCHRO and e:GetHandler():GetReasonCard():IsRace(RACE_PLANT) return r==REASON_SYNCHRO and e:GetHandler():GetReasonCard():IsRace(RACE_PLANT)
......
...@@ -54,8 +54,8 @@ function cm.costfilter(c) ...@@ -54,8 +54,8 @@ function cm.costfilter(c)
return c:IsType(TYPE_XYZ) and c:IsRace(RACE_SPELLCASTER) return c:IsType(TYPE_XYZ) and c:IsRace(RACE_SPELLCASTER)
end end
function cm.discost(e,tp,eg,ep,ev,re,r,rp,chk) function cm.discost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroup(tp,cm.costfilter,1,nil) end if chk==0 then return Duel.CheckReleaseGroup(REASON_COST,tp,cm.costfilter,1,nil) end
local g=Duel.SelectReleaseGroup(tp,cm.costfilter,1,1,nil) local g=Duel.SelectReleaseGroup(REASON_COST,tp,cm.costfilter,1,1,nil)
Duel.Release(g,REASON_COST) Duel.Release(g,REASON_COST)
end end
function cm.distg(e,tp,eg,ep,ev,re,r,rp,chk) function cm.distg(e,tp,eg,ep,ev,re,r,rp,chk)
......
local m=53716051
local cm=_G["c"..m]
cm.name="残滓的匿国"
function cm.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--[[local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,0))
e2:SetCategory(CATEGORY_TOGRAVE+CATEGORY_DAMAGE)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetRange(LOCATION_SZONE)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_SSET+TIMING_END_PHASE)
e2:SetCountLimit(1)
e2:SetTarget(cm.tgtg)
e2:SetOperation(cm.tgop)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_ACTIVATE)
e3:SetRange(LOCATION_DECK)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetCost(cm.cost)
e3:SetTarget(cm.tg)
c:RegisterEffect(e3)
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD)
e4:SetCode(EFFECT_ACTIVATE_COST)
e4:SetRange(LOCATION_DECK)
e4:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e4:SetLabelObject(e3)
e4:SetTargetRange(1,1)
e4:SetTarget(cm.actarget)
e4:SetCost(cm.costchk)
e4:SetOperation(cm.costop)
c:RegisterEffect(e4)
end
function cm.tgtg(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(Card.IsAbleToGrave,tp,0,LOCATION_ONFIELD,nil)
if chk==0 then return #g>0 end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,g,1,0,0)
end
function cm.tgop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(Card.IsAbleToGrave,tp,0,LOCATION_ONFIELD,nil)
if #g>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local sg=g:Select(tp,1,1,nil)
Duel.HintSelection(sg)
if Duel.SendtoGrave(sg,REASON_EFFECT)>0 and sg:GetFirst():IsLocation(LOCATION_GRAVE) then Duel.Damage(1-tp,1000,REASON_EFFECT) end
end
end
function cm.cfilter(c,tp)
if not c:IsType(TYPE_TRAP+TYPE_SPELL) then return false end
local re={Duel.IsPlayerAffectedByEffect(tp,EFFECT_CANNOT_RELEASE)}
local flag=c:IsLocation(LOCATION_HAND)
for k,v in pairs(re) do
if c:IsLocation(LOCATION_HAND) and val(v,c,tp,tp) then flag=false end
end
return c:IsReleasable() or flag
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.cfilter,tp,LOCATION_HAND+LOCATION_ONFIELD,0,3,nil,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local g=Duel.SelectMatchingCard(tp,cm.cfilter,tp,LOCATION_HAND+LOCATION_ONFIELD,0,3,3,e:GetHandler(),tp)
Duel.Release(g,REASON_COST)
end
function cm.tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsLocation(LOCATION_DECK) end
end
function cm.actarget(e,te,tp)
return te:GetHandler()==e:GetHandler() and te==e: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()
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)
Scl.Place2Field(c,tp,tp,LOCATION_SZONE,POS_FACEUP,false,2^(math.log(flag,2)-8))
end
e:SetLabel(0)
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_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)
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--]]
end
local m=53716054
local cm=_G["c"..m]
cm.name="残滓、断片、处决"
function cm.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
end
local m=53716060
local cm=_G["c"..m]
cm.name="残滓的炉心"
function cm.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--[[local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_CHAIN_SOLVING)
e2:SetRange(LOCATION_SZONE)
e2:SetCondition(cm.negcon)
e2:SetOperation(cm.negop)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_ACTIVATE)
e3:SetRange(LOCATION_DECK)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetCost(cm.cost)
e3:SetTarget(cm.tg)
c:RegisterEffect(e3)
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD)
e4:SetCode(EFFECT_ACTIVATE_COST)
e4:SetRange(LOCATION_DECK)
e4:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e4:SetLabelObject(e3)
e4:SetTargetRange(1,1)
e4:SetTarget(cm.actarget)
e4:SetCost(cm.costchk)
e4:SetOperation(cm.costop)
c:RegisterEffect(e4)
end
function cm.negcon(e,tp,eg,ep,ev,re,r,rp)
return rp~=tp and re:IsActiveType(TYPE_MONSTER) and Duel.IsChainDisablable(ev) and c:GetFlagEffect(m)==0
end
function cm.negop(e,tp,eg,ep,ev,re,r,rp)
if Duel.SelectYesNo(tp,aux.Stringid(m,0)) then
Duel.Hint(HINT_CARD,0,m)
if Duel.NegateEffect(ev) then Duel.Damage(1-tp,1000,REASON_EFFECT) end
e:GetHandler():RegisterFlagEffect(m,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1)
end
end
function cm.cfilter(c,tp)
if not c:IsType(TYPE_TRAP+TYPE_SPELL) then return false end
local re={Duel.IsPlayerAffectedByEffect(tp,EFFECT_CANNOT_RELEASE)}
local flag=c:IsLocation(LOCATION_HAND)
for k,v in pairs(re) do
if c:IsLocation(LOCATION_HAND) and val(v,c,tp,tp) then flag=false end
end
return c:IsReleasable() or flag
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.cfilter,tp,LOCATION_HAND+LOCATION_ONFIELD,0,3,nil,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local g=Duel.SelectMatchingCard(tp,cm.cfilter,tp,LOCATION_HAND+LOCATION_ONFIELD,0,3,3,e:GetHandler(),tp)
Duel.Release(g,REASON_COST)
end
function cm.tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsLocation(LOCATION_DECK) end
end
function cm.actarget(e,te,tp)
return te:GetHandler()==e:GetHandler() and te==e: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()
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)
Scl.Place2Field(c,tp,tp,LOCATION_SZONE,POS_FACEUP,false,2^(math.log(flag,2)-8))
end
e:SetLabel(0)
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_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)
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--]]
end
local m=53716061
local cm=_G["c"..m]
cm.name="残滓的魔裔"
function cm.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--[[local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_CHAIN_SOLVING)
e2:SetRange(LOCATION_SZONE)
e2:SetCondition(cm.negcon)
e2:SetOperation(cm.negop)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_ACTIVATE)
e3:SetRange(LOCATION_DECK)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetCost(cm.cost)
e3:SetTarget(cm.tg)
c:RegisterEffect(e3)
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD)
e4:SetCode(EFFECT_ACTIVATE_COST)
e4:SetRange(LOCATION_DECK)
e4:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e4:SetLabelObject(e3)
e4:SetTargetRange(1,1)
e4:SetTarget(cm.actarget)
e4:SetCost(cm.costchk)
e4:SetOperation(cm.costop)
c:RegisterEffect(e4)
end
function cm.negcon(e,tp,eg,ep,ev,re,r,rp)
return rp~=tp and re:IsActiveType(TYPE_SPELL+TYPE_TRAP) and Duel.IsChainDisablable(ev) and not Duel.IsChainDisabled(ev) and e:GetHandler():GetFlagEffect(m)<=0
end
function cm.negop(e,tp,eg,ep,ev,re,r,rp)
if Duel.SelectYesNo(tp,aux.Stringid(m,0)) then
Duel.Hint(HINT_CARD,0,m)
if Duel.NegateEffect(ev) then Duel.Damage(1-tp,1000,REASON_EFFECT) end
e:GetHandler():RegisterFlagEffect(m,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1)
end
end
function cm.cfilter(c,tp)
if not c:IsType(TYPE_TRAP+TYPE_SPELL) then return false end
local re={Duel.IsPlayerAffectedByEffect(tp,EFFECT_CANNOT_RELEASE)}
local flag=c:IsLocation(LOCATION_HAND)
for k,v in pairs(re) do
if c:IsLocation(LOCATION_HAND) and val(v,c,tp,tp) then flag=false end
end
return c:IsReleasable() or flag
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.cfilter,tp,LOCATION_HAND+LOCATION_ONFIELD,0,3,nil,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local g=Duel.SelectMatchingCard(tp,cm.cfilter,tp,LOCATION_HAND+LOCATION_ONFIELD,0,3,3,e:GetHandler(),tp)
Duel.Release(g,REASON_COST)
end
function cm.tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsLocation(LOCATION_DECK) end
end
function cm.actarget(e,te,tp)
return te:GetHandler()==e:GetHandler() and te==e: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()
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)
Scl.Place2Field(c,tp,tp,LOCATION_SZONE,POS_FACEUP,false,2^(math.log(flag,2)-8))
end
e:SetLabel(0)
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_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)
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--]]
end
local m=53716063
local cm=_G["c"..m]
cm.name="残滓的牲都"
function cm.initial_effect(c)
c:SetUniqueOnField(1,0,m)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--[[local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_ACTIVATE)
e3:SetRange(LOCATION_DECK)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetCost(cm.cost)
e3:SetTarget(cm.tg)
c:RegisterEffect(e3)
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD)
e4:SetCode(EFFECT_ACTIVATE_COST)
e4:SetRange(LOCATION_DECK)
e4:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e4:SetLabelObject(e3)
e4:SetTargetRange(1,1)
e4:SetTarget(cm.actarget)
e4:SetCost(cm.costchk)
e4:SetOperation(cm.costop)
c:RegisterEffect(e4)
end
function cm.cfilter(c,tp)
if not c:IsType(TYPE_TRAP+TYPE_SPELL) then return false end
local re={Duel.IsPlayerAffectedByEffect(tp,EFFECT_CANNOT_RELEASE)}
local flag=c:IsLocation(LOCATION_HAND)
for k,v in pairs(re) do
if c:IsLocation(LOCATION_HAND) and val(v,c,tp,tp) then flag=false end
end
return c:IsReleasable() or flag
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.cfilter,tp,LOCATION_HAND+LOCATION_ONFIELD,0,1,nil,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local g=Duel.SelectMatchingCard(tp,cm.cfilter,tp,LOCATION_HAND+LOCATION_ONFIELD,0,1,1,e:GetHandler(),tp)
Duel.Release(g,REASON_COST)
end
function cm.tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsLocation(LOCATION_DECK) end
end
function cm.actarget(e,te,tp)
return te:GetHandler()==e:GetHandler() and te==e: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()
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)
Scl.Place2Field(c,tp,tp,LOCATION_SZONE,POS_FACEUP,false,2^(math.log(flag,2)-8))
end
e:SetLabel(0)
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_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)
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--]]
end
...@@ -64,8 +64,8 @@ function cm.costfilter(c,tp) ...@@ -64,8 +64,8 @@ function cm.costfilter(c,tp)
and Duel.GetMZoneCount(tp,c,tp)>0 and Duel.GetMZoneCount(tp,c,tp)>0
end end
function cm.spcost2(e,tp,eg,ep,ev,re,r,rp,chk) function cm.spcost2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroup(tp,cm.costfilter,1,nil,tp) end if chk==0 then return Duel.CheckReleaseGroup(REASON_COST,tp,cm.costfilter,1,nil,tp) end
local g=Duel.SelectReleaseGroup(tp,cm.costfilter,1,1,nil,tp) local g=Duel.SelectReleaseGroup(REASON_COST,tp,cm.costfilter,1,1,nil,tp)
Duel.Release(g,REASON_COST) Duel.Release(g,REASON_COST)
end end
function cm.filter(c,e,tp) function cm.filter(c,e,tp)
......
...@@ -34,9 +34,9 @@ function cm.hkcon(e,tp,eg,ep,ev,re,r,rp) ...@@ -34,9 +34,9 @@ function cm.hkcon(e,tp,eg,ep,ev,re,r,rp)
end end
function cm.hkcost(e,tp,eg,ep,ev,re,r,rp,chk) function cm.hkcost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler() local c=e:GetHandler()
if chk==0 then return c:IsReleasable() and Duel.CheckReleaseGroup(tp,nil,1,c) end if chk==0 then return c:IsReleasable() and Duel.CheckReleaseGroup(REASON_COST,tp,nil,1,c) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local rg=Duel.SelectReleaseGroup(tp,nil,1,1,c) local rg=Duel.SelectReleaseGroup(REASON_COST,tp,nil,1,1,c)
rg:AddCard(c) rg:AddCard(c)
Duel.Release(rg,REASON_COST) Duel.Release(rg,REASON_COST)
end end
......
...@@ -70,11 +70,11 @@ function cm.spcon(e,c) ...@@ -70,11 +70,11 @@ function cm.spcon(e,c)
local tp=c:GetControler() local tp=c:GetControler()
local att1=c:GetFlagEffectLabel(m) local att1=c:GetFlagEffectLabel(m)
local att2=c:GetFlagEffectLabel(m+50) local att2=c:GetFlagEffectLabel(m+50)
return Duel.CheckReleaseGroup(tp,cm.rfilter,1,nil,tp,c) and ((c:IsControler(c:GetOwner()) and att1 and att1&0x1f==0x1f) or (c:IsControler(1-c:GetOwner()) and att2 and att2&0x1f==0x1f)) return Duel.CheckReleaseGroup(REASON_SPSUMMON,tp,cm.rfilter,1,nil,tp,c) and ((c:IsControler(c:GetOwner()) and att1 and att1&0x1f==0x1f) or (c:IsControler(1-c:GetOwner()) and att2 and att2&0x1f==0x1f))
end end
function cm.spop(e,tp,eg,ep,ev,re,r,rp,c) function cm.spop(e,tp,eg,ep,ev,re,r,rp,c)
local g=Duel.SelectReleaseGroup(tp,cm.rfilter,1,1,nil,tp,c) local g=Duel.SelectReleaseGroup(REASON_SPSUMMON,tp,cm.rfilter,1,1,nil,tp,c)
Duel.Release(g,REASON_COST) Duel.Release(g,REASON_SPSUMMON)
end end
function cm.op(e,tp,eg,ep,ev,re,r,rp) function cm.op(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetFlagEffect(tp,m)>0 then return end if Duel.GetFlagEffect(tp,m)>0 then return end
......
...@@ -45,8 +45,8 @@ function cm.cfilter(c,tp) ...@@ -45,8 +45,8 @@ function cm.cfilter(c,tp)
return c:IsLinkState() and Duel.GetMZoneCount(tp,c)>0 return c:IsLinkState() and Duel.GetMZoneCount(tp,c)>0
end end
function cm.spcost(e,tp,eg,ep,ev,re,r,rp,chk) function cm.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroup(tp,cm.cfilter,1,nil,tp) end if chk==0 then return Duel.CheckReleaseGroup(REASON_COST,tp,cm.cfilter,1,nil,tp) end
local g=Duel.SelectReleaseGroup(tp,cm.cfilter,1,1,nil,tp) local g=Duel.SelectReleaseGroup(REASON_COST,tp,cm.cfilter,1,1,nil,tp)
Duel.Release(g,REASON_COST) Duel.Release(g,REASON_COST)
end end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk) function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
......
...@@ -98,11 +98,11 @@ end ...@@ -98,11 +98,11 @@ end
function cm.spcon(e,c) function cm.spcon(e,c)
if c==nil then return true end if c==nil then return true end
local tp=c:GetControler() local tp=c:GetControler()
return Duel.CheckReleaseGroup(tp,cm.rfilter,1,nil,tp,c) and Duel.GetTurnCount()>9 return Duel.CheckReleaseGroup(REASON_SPSUMMON,tp,cm.rfilter,1,nil,tp,c) and Duel.GetTurnCount()>9
end end
function cm.spop(e,tp,eg,ep,ev,re,r,rp,c) function cm.spop(e,tp,eg,ep,ev,re,r,rp,c)
local g=Duel.SelectReleaseGroup(tp,cm.rfilter,1,1,nil,tp,c) local g=Duel.SelectReleaseGroup(REASON_SPSUMMON,tp,cm.rfilter,1,1,nil,tp,c)
Duel.Release(g,REASON_COST) Duel.Release(g,REASON_SPSUMMON)
end end
function cm.imfilter(c) function cm.imfilter(c)
return c:IsFaceup() and c:GetFlagEffect(53729099)>0 and (c:GetFlagEffect(m)==0 or c:GetFlagEffectLabel(m)~=c:GetOriginalCode()) and (c:IsType(TYPE_SPELL+TYPE_TRAP) or (c:IsSetCard(0x5533) and c:IsType(TYPE_FUSION))) return c:IsFaceup() and c:GetFlagEffect(53729099)>0 and (c:GetFlagEffect(m)==0 or c:GetFlagEffectLabel(m)~=c:GetOriginalCode()) and (c:IsType(TYPE_SPELL+TYPE_TRAP) or (c:IsSetCard(0x5533) and c:IsType(TYPE_FUSION)))
......
...@@ -24,9 +24,9 @@ end ...@@ -24,9 +24,9 @@ end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk) function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler() local c=e:GetHandler()
local res=c:IsLocation(LOCATION_MZONE) local res=c:IsLocation(LOCATION_MZONE)
if chk==0 then return c:IsReleasable() and Duel.CheckReleaseGroup(tp,cm.cfilter,1,c,res) end if chk==0 then return c:IsReleasable() and Duel.CheckReleaseGroup(REASON_COST,tp,cm.cfilter,1,c,res) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local rg=Duel.SelectReleaseGroup(tp,cm.cfilter,1,1,c,res) local rg=Duel.SelectReleaseGroup(REASON_COST,tp,cm.cfilter,1,1,c,res)
rg:AddCard(c) rg:AddCard(c)
Duel.Release(rg,REASON_COST) Duel.Release(rg,REASON_COST)
end end
......
...@@ -132,8 +132,8 @@ function cm.costfilter(c,tp) ...@@ -132,8 +132,8 @@ function cm.costfilter(c,tp)
return c:IsType(TYPE_PENDULUM) and c:IsAttribute(ATTRIBUTE_DARK) and (c:IsControler(tp) or c:IsFaceup()) return c:IsType(TYPE_PENDULUM) and c:IsAttribute(ATTRIBUTE_DARK) and (c:IsControler(tp) or c:IsFaceup())
end end
function cm.discost(e,tp,eg,ep,ev,re,r,rp,chk) function cm.discost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroup(tp,cm.costfilter,1,nil,tp) end if chk==0 then return Duel.CheckReleaseGroup(REASON_COST,tp,cm.costfilter,1,nil,tp) end
local sg=Duel.SelectReleaseGroup(tp,cm.costfilter,1,1,nil,tp) local sg=Duel.SelectReleaseGroup(REASON_COST,tp,cm.costfilter,1,1,nil,tp)
Duel.Release(sg,REASON_COST) Duel.Release(sg,REASON_COST)
end end
function cm.distg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function cm.distg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
......
...@@ -66,13 +66,13 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -66,13 +66,13 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
local b1=not b and ft>0 local b1=not b and ft>0
local b2=b and ft==1 and st-ft>0 local b2=b and ft==1 and st-ft>0
local b3=b and ft==2 local b3=b and ft==2
local res=Duel.IsPlayerCanRelease(tp) local res=Duel.IsPlayerCanRelease(tp,nil,REASON_EFFECT)
if chk==0 then return (b1 or b2 or b3) and Duel.IsExistingMatchingCard(cm.penfilter,tp,LOCATION_DECK+LOCATION_EXTRA,0,1,nil,res) end if chk==0 then return (b1 or b2 or b3) and Duel.IsExistingMatchingCard(cm.penfilter,tp,LOCATION_DECK+LOCATION_EXTRA,0,1,nil,res) end
end end
function cm.activate(e,tp,eg,ep,ev,re,r,rp) function cm.activate(e,tp,eg,ep,ev,re,r,rp)
if not Duel.CheckLocation(tp,LOCATION_PZONE,0) and not Duel.CheckLocation(tp,LOCATION_PZONE,1) then return end if not Duel.CheckLocation(tp,LOCATION_PZONE,0) and not Duel.CheckLocation(tp,LOCATION_PZONE,1) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOFIELD) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOFIELD)
local res=Duel.IsPlayerCanRelease(tp) local res=Duel.IsPlayerCanRelease(tp,nil,REASON_EFFECT)
local tc=Duel.SelectMatchingCard(tp,cm.penfilter,tp,LOCATION_DECK+LOCATION_EXTRA,0,1,1,nil,res):GetFirst() local tc=Duel.SelectMatchingCard(tp,cm.penfilter,tp,LOCATION_DECK+LOCATION_EXTRA,0,1,1,nil,res):GetFirst()
if tc and Duel.MoveToField(tc,tp,tp,LOCATION_PZONE,POS_FACEUP,true) then if tc and Duel.MoveToField(tc,tp,tp,LOCATION_PZONE,POS_FACEUP,true) then
local e1=Effect.CreateEffect(e:GetHandler()) local e1=Effect.CreateEffect(e:GetHandler())
......
...@@ -48,11 +48,11 @@ function cm.spcon(e,c) ...@@ -48,11 +48,11 @@ function cm.spcon(e,c)
if c==nil then return true end if c==nil then return true end
if c:GetFlagEffect(53738000)==0 and c:IsLocation(LOCATION_GRAVE) then return false end if c:GetFlagEffect(53738000)==0 and c:IsLocation(LOCATION_GRAVE) then return false end
local tp=c:GetControler() local tp=c:GetControler()
local rg=Duel.GetReleaseGroup(tp):Filter(cm.rfilter,nil,tp) local rg=Duel.GetReleaseGroup(tp,false,REASON_SPSUMMON):Filter(cm.rfilter,nil,tp)
return rg:CheckSubGroup(aux.mzctcheckrel,4,#rg,tp) return rg:CheckSubGroup(aux.mzctcheckrel,4,#rg,tp)
end end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk,c) function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk,c)
local rg=Duel.GetReleaseGroup(tp):Filter(cm.rfilter,nil,tp) local rg=Duel.GetReleaseGroup(tp,false,REASON_SPSUMMON):Filter(cm.rfilter,nil,tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local sg=rg:SelectSubGroup(tp,aux.mzctcheckrel,true,4,#rg,tp) local sg=rg:SelectSubGroup(tp,aux.mzctcheckrel,true,4,#rg,tp)
if sg then if sg then
......
...@@ -43,11 +43,11 @@ function cm.spcon(e,c) ...@@ -43,11 +43,11 @@ function cm.spcon(e,c)
if c==nil then return true end if c==nil then return true end
if c:GetFlagEffect(53738000)==0 and c:IsLocation(LOCATION_GRAVE) then return false end if c:GetFlagEffect(53738000)==0 and c:IsLocation(LOCATION_GRAVE) then return false end
local tp=c:GetControler() local tp=c:GetControler()
local rg=Duel.GetReleaseGroup(tp):Filter(cm.rfilter,nil,tp) local rg=Duel.GetReleaseGroup(tp,false,REASON_SPSUMMON):Filter(cm.rfilter,nil,tp)
return rg:CheckSubGroup(aux.mzctcheckrel,3,3,tp) return rg:CheckSubGroup(aux.mzctcheckrel,3,3,tp)
end end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk,c) function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk,c)
local rg=Duel.GetReleaseGroup(tp):Filter(cm.rfilter,nil,tp) local rg=Duel.GetReleaseGroup(tp,false,REASON_SPSUMMON):Filter(cm.rfilter,nil,tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local sg=rg:SelectSubGroup(tp,aux.mzctcheckrel,true,3,3,tp) local sg=rg:SelectSubGroup(tp,aux.mzctcheckrel,true,3,3,tp)
if sg then if sg then
......
...@@ -44,11 +44,11 @@ function cm.spcon(e,c) ...@@ -44,11 +44,11 @@ function cm.spcon(e,c)
if c==nil then return true end if c==nil then return true end
if c:GetFlagEffect(53738000)==0 and c:IsLocation(LOCATION_GRAVE) then return false end if c:GetFlagEffect(53738000)==0 and c:IsLocation(LOCATION_GRAVE) then return false end
local tp=c:GetControler() local tp=c:GetControler()
local rg=Duel.GetReleaseGroup(tp):Filter(cm.rfilter,nil,tp) local rg=Duel.GetReleaseGroup(tp,false,REASON_SPSUMMON):Filter(cm.rfilter,nil,tp)
return rg:CheckSubGroup(aux.mzctcheckrel,2,#rg,tp) return rg:CheckSubGroup(aux.mzctcheckrel,2,#rg,tp)
end end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk,c) function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk,c)
local rg=Duel.GetReleaseGroup(tp):Filter(cm.rfilter,nil,tp) local rg=Duel.GetReleaseGroup(tp,false,REASON_SPSUMMON):Filter(cm.rfilter,nil,tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local sg=rg:SelectSubGroup(tp,aux.mzctcheckrel,true,2,#rg,tp) local sg=rg:SelectSubGroup(tp,aux.mzctcheckrel,true,2,#rg,tp)
if sg then if sg then
......
...@@ -37,8 +37,8 @@ function cm.initial_effect(c) ...@@ -37,8 +37,8 @@ function cm.initial_effect(c)
end end
function cm.actcost(e,tp,eg,ep,ev,re,r,rp,chk) function cm.actcost(e,tp,eg,ep,ev,re,r,rp,chk)
if not e:GetHandler():IsStatus(STATUS_SET_TURN) then return true end if not e:GetHandler():IsStatus(STATUS_SET_TURN) then return true end
if chk==0 then return Duel.CheckReleaseGroup(tp,Card.IsSetCard,2,nil,0x5532) end if chk==0 then return Duel.CheckReleaseGroup(REASON_COST,tp,Card.IsSetCard,2,nil,0x5532) end
local g=Duel.SelectReleaseGroup(tp,Card.IsSetCard,2,2,nil,0x5532) local g=Duel.SelectReleaseGroup(REASON_COST,tp,Card.IsSetCard,2,2,nil,0x5532)
Duel.Release(g,REASON_COST) Duel.Release(g,REASON_COST)
end end
function cm.acttg(e,tp,eg,ep,ev,re,r,rp,chk) function cm.acttg(e,tp,eg,ep,ev,re,r,rp,chk)
......
...@@ -21,8 +21,8 @@ function cm.initial_effect(c) ...@@ -21,8 +21,8 @@ function cm.initial_effect(c)
e3:SetOperation(cm.srop) e3:SetOperation(cm.srop)
end end
function cm.spcost(e,tp,eg,ep,ev,re,r,rp,chk) function cm.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroup(tp,Card.IsSummonType,1,nil,SUMMON_TYPE_NORMAL) end if chk==0 then return Duel.CheckReleaseGroup(REASON_COST,tp,Card.IsSummonType,1,nil,SUMMON_TYPE_NORMAL) end
local g=Duel.SelectReleaseGroup(tp,Card.IsSummonType,1,1,nil,SUMMON_TYPE_NORMAL) local g=Duel.SelectReleaseGroup(REASON_COST,tp,Card.IsSummonType,1,1,nil,SUMMON_TYPE_NORMAL)
Duel.Release(g,REASON_COST) Duel.Release(g,REASON_COST)
end end
function cm.spfilter(c,e,tp) function cm.spfilter(c,e,tp)
......
...@@ -45,9 +45,9 @@ function cm.tg(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -45,9 +45,9 @@ function cm.tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then if chk==0 then
if e:GetLabel()~=100 then return false end if e:GetLabel()~=100 then return false end
e:SetLabel(0) e:SetLabel(0)
return (Duel.IsPlayerCanDraw(tp,1) or Duel.IsExistingMatchingCard(Card.IsAbleToGrave,tp,0,LOCATION_ONFIELD,1,nil)) and Duel.CheckReleaseGroup(tp,cm.filter,1,nil,tp) return (Duel.IsPlayerCanDraw(tp,1) or Duel.IsExistingMatchingCard(Card.IsAbleToGrave,tp,0,LOCATION_ONFIELD,1,nil)) and Duel.CheckReleaseGroup(REASON_COST,tp,cm.filter,1,nil,tp)
end end
local rg=Duel.SelectReleaseGroup(tp,cm.filter,1,1,nil,tp) local rg=Duel.SelectReleaseGroup(REASON_COST,tp,cm.filter,1,1,nil,tp)
e:SetLabel(SNNM.multi_summon_count(rg)) e:SetLabel(SNNM.multi_summon_count(rg))
Duel.Release(rg,REASON_COST) Duel.Release(rg,REASON_COST)
end end
......
...@@ -45,7 +45,7 @@ function cm.immval(e,te) ...@@ -45,7 +45,7 @@ function cm.immval(e,te)
if not c:IsLocation(LOCATION_FZONE) then return false end if not c:IsLocation(LOCATION_FZONE) then return false end
local tp=c:GetControler() local tp=c:GetControler()
local eset={c:IsHasEffect(m+50)} local eset={c:IsHasEffect(m+50)}
local res=te:GetOwner()~=e:GetOwner() and Duel.CheckReleaseGroup(tp,nil,1,nil) local res=te:GetOwner()~=e:GetOwner() and Duel.CheckReleaseGroup(REASON_EFFECT,tp,nil,1,nil)
local ctns=false local ctns=false
if not te:IsHasType(EFFECT_TYPE_ACTIONS) then if not te:IsHasType(EFFECT_TYPE_ACTIONS) then
for _,se in pairs(eset) do for _,se in pairs(eset) do
...@@ -70,7 +70,7 @@ function cm.immval(e,te) ...@@ -70,7 +70,7 @@ function cm.immval(e,te)
end end
function cm.imcop(e,tp,eg,ep,ev,re,r,rp) function cm.imcop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,0,m) Duel.Hint(HINT_CARD,0,m)
local g=Duel.SelectReleaseGroup(tp,nil,1,1,nil) local g=Duel.SelectReleaseGroup(REASON_EFFECT,tp,nil,1,1,nil)
Duel.Release(g,REASON_EFFECT) Duel.Release(g,REASON_EFFECT)
e:Reset() e:Reset()
end end
......
...@@ -46,8 +46,8 @@ end ...@@ -46,8 +46,8 @@ end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk) function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
local b1=Duel.IsExistingMatchingCard(cm.thfilter,tp,LOCATION_DECK,0,1,nil) local b1=Duel.IsExistingMatchingCard(cm.thfilter,tp,LOCATION_DECK,0,1,nil)
local b2=Duel.GetFieldGroupCount(tp,LOCATION_HAND,0)>0 and Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp) local b2=Duel.GetFieldGroupCount(tp,LOCATION_HAND,0)>0 and Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp)
if chk==0 then return (b1 or b2) and Duel.CheckReleaseGroup(tp,cm.cfilter,1,nil,tp,b1) end if chk==0 then return (b1 or b2) and Duel.CheckReleaseGroup(REASON_COST,tp,cm.cfilter,1,nil,tp,b1) end
local g=Duel.SelectReleaseGroup(tp,cm.cfilter,1,1,nil,tp,b1) local g=Duel.SelectReleaseGroup(REASON_COST,tp,cm.cfilter,1,1,nil,tp,b1)
Duel.Release(g,REASON_COST) Duel.Release(g,REASON_COST)
local b3=b2 and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 local b3=b2 and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
local off=1 local off=1
......
...@@ -66,12 +66,12 @@ function cm.spfilter(c,e,tp) ...@@ -66,12 +66,12 @@ function cm.spfilter(c,e,tp)
return c:IsCode(m+1) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) return c:IsCode(m+1) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end end
function cm.target2(e,tp,eg,ep,ev,re,r,rp,chk) function cm.target2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroup(tp,cm.relfilter,1,nil,tp) and Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_HAND+LOCATION_DECK,0,1,nil,e,tp) end if chk==0 then return Duel.CheckReleaseGroup(REASON_EFFECT,tp,cm.relfilter,1,nil,tp) and Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_HAND+LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_DECK) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_DECK)
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription()) Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
end end
function cm.activate2(e,tp,eg,ep,ev,re,r,rp) function cm.activate2(e,tp,eg,ep,ev,re,r,rp)
local rg=Duel.SelectReleaseGroup(tp,cm.relfilter,1,1,nil,tp) local rg=Duel.SelectReleaseGroup(REASON_EFFECT,tp,cm.relfilter,1,1,nil,tp)
if rg:GetCount()==0 then return end if rg:GetCount()==0 then return end
if Duel.Release(rg,REASON_EFFECT)==0 then return end if Duel.Release(rg,REASON_EFFECT)==0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
......
...@@ -63,12 +63,12 @@ function cm.spfilter(c,e,tp) ...@@ -63,12 +63,12 @@ function cm.spfilter(c,e,tp)
return c:IsCode(m+1) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) return c:IsCode(m+1) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end end
function cm.target2(e,tp,eg,ep,ev,re,r,rp,chk) function cm.target2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroup(tp,cm.relfilter,1,nil,tp) and Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_HAND+LOCATION_DECK,0,1,nil,e,tp) end if chk==0 then return Duel.CheckReleaseGroup(REASON_EFFECT,tp,cm.relfilter,1,nil,tp) and Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_HAND+LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_DECK) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_DECK)
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription()) Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
end end
function cm.activate2(e,tp,eg,ep,ev,re,r,rp) function cm.activate2(e,tp,eg,ep,ev,re,r,rp)
local rg=Duel.SelectReleaseGroup(tp,cm.relfilter,1,1,nil,tp) local rg=Duel.SelectReleaseGroup(REASON_EFFECT,tp,cm.relfilter,1,1,nil,tp)
if rg:GetCount()==0 then return end if rg:GetCount()==0 then return end
if Duel.Release(rg,REASON_EFFECT)==0 then return end if Duel.Release(rg,REASON_EFFECT)==0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
......
...@@ -73,12 +73,12 @@ function cm.spfilter(c,e,tp) ...@@ -73,12 +73,12 @@ function cm.spfilter(c,e,tp)
return c:IsCode(m+1) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) return c:IsCode(m+1) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end end
function cm.target2(e,tp,eg,ep,ev,re,r,rp,chk) function cm.target2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroup(tp,cm.relfilter,1,nil,tp) and Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_HAND+LOCATION_DECK,0,1,nil,e,tp) end if chk==0 then return Duel.CheckReleaseGroup(REASON_EFFECT,tp,cm.relfilter,1,nil,tp) and Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_HAND+LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_DECK) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_DECK)
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription()) Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
end end
function cm.activate2(e,tp,eg,ep,ev,re,r,rp) function cm.activate2(e,tp,eg,ep,ev,re,r,rp)
local rg=Duel.SelectReleaseGroup(tp,cm.relfilter,1,1,nil,tp) local rg=Duel.SelectReleaseGroup(REASON_EFFECT,tp,cm.relfilter,1,1,nil,tp)
if rg:GetCount()==0 then return end if rg:GetCount()==0 then return end
if Duel.Release(rg,REASON_EFFECT)==0 then return end if Duel.Release(rg,REASON_EFFECT)==0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
......
...@@ -94,12 +94,12 @@ function cm.spfilter(c,e,tp) ...@@ -94,12 +94,12 @@ function cm.spfilter(c,e,tp)
return c:IsCode(m+8) and c:IsCanBeSpecialSummoned(e,0,tp,true,false) return c:IsCode(m+8) and c:IsCanBeSpecialSummoned(e,0,tp,true,false)
end end
function cm.target2(e,tp,eg,ep,ev,re,r,rp,chk) function cm.target2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroup(tp,cm.relfilter,1,nil,tp) and Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_HAND+LOCATION_DECK,0,1,nil,e,tp) end if chk==0 then return Duel.CheckReleaseGroup(REASON_EFFECT,tp,cm.relfilter,1,nil,tp) and Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_HAND+LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_DECK) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_DECK)
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription()) Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
end end
function cm.activate2(e,tp,eg,ep,ev,re,r,rp) function cm.activate2(e,tp,eg,ep,ev,re,r,rp)
local rg=Duel.SelectReleaseGroup(tp,cm.relfilter,1,1,nil,tp) local rg=Duel.SelectReleaseGroup(REASON_EFFECT,tp,cm.relfilter,1,1,nil,tp)
if rg:GetCount()==0 then return end if rg:GetCount()==0 then return end
if Duel.Release(rg,REASON_EFFECT)==0 then return end if Duel.Release(rg,REASON_EFFECT)==0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
......
...@@ -138,8 +138,8 @@ function cm.descon(e) ...@@ -138,8 +138,8 @@ function cm.descon(e)
return not (c:GetColumnGroup():IsContains(tc) and tc:IsRelateToCard(c)) or tc:IsFacedown() return not (c:GetColumnGroup():IsContains(tc) and tc:IsRelateToCard(c)) or tc:IsFacedown()
end end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk) function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroup(tp,Card.IsType,1,nil,TYPE_NORMAL) end if chk==0 then return Duel.CheckReleaseGroup(REASON_COST,tp,Card.IsType,1,nil,TYPE_NORMAL) end
local g=Duel.SelectReleaseGroup(tp,Card.IsType,1,1,nil,TYPE_NORMAL) local g=Duel.SelectReleaseGroup(REASON_COST,tp,Card.IsType,1,1,nil,TYPE_NORMAL)
Duel.Release(g,REASON_COST) Duel.Release(g,REASON_COST)
end end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function cm.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
......
...@@ -140,8 +140,8 @@ function cm.descon(e) ...@@ -140,8 +140,8 @@ function cm.descon(e)
return not (c:GetColumnGroup():IsContains(tc) and tc:IsRelateToCard(c)) or tc:IsFacedown() return not (c:GetColumnGroup():IsContains(tc) and tc:IsRelateToCard(c)) or tc:IsFacedown()
end end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk) function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroup(tp,Card.IsType,1,nil,TYPE_NORMAL) end if chk==0 then return Duel.CheckReleaseGroup(REASON_COST,tp,Card.IsType,1,nil,TYPE_NORMAL) end
local g=Duel.SelectReleaseGroup(tp,Card.IsType,1,1,nil,TYPE_NORMAL) local g=Duel.SelectReleaseGroup(REASON_COST,tp,Card.IsType,1,1,nil,TYPE_NORMAL)
Duel.Release(g,REASON_COST) Duel.Release(g,REASON_COST)
end end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function cm.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
......
...@@ -127,8 +127,8 @@ function cm.descon(e) ...@@ -127,8 +127,8 @@ function cm.descon(e)
return not (c:GetColumnGroup():IsContains(tc) and tc:IsRelateToCard(c)) or tc:IsFacedown() return not (c:GetColumnGroup():IsContains(tc) and tc:IsRelateToCard(c)) or tc:IsFacedown()
end end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk) function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroup(tp,Card.IsType,1,nil,TYPE_NORMAL) end if chk==0 then return Duel.CheckReleaseGroup(REASON_COST,tp,Card.IsType,1,nil,TYPE_NORMAL) end
local g=Duel.SelectReleaseGroup(tp,Card.IsType,1,1,nil,TYPE_NORMAL) local g=Duel.SelectReleaseGroup(REASON_COST,tp,Card.IsType,1,1,nil,TYPE_NORMAL)
Duel.Release(g,REASON_COST) Duel.Release(g,REASON_COST)
end end
function cm.cfilter(c) function cm.cfilter(c)
......
...@@ -138,8 +138,8 @@ function cm.descon(e) ...@@ -138,8 +138,8 @@ function cm.descon(e)
return not (c:GetColumnGroup():IsContains(tc) and tc:IsRelateToCard(c)) or tc:IsFacedown() return not (c:GetColumnGroup():IsContains(tc) and tc:IsRelateToCard(c)) or tc:IsFacedown()
end end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk) function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroup(tp,Card.IsType,1,nil,TYPE_NORMAL) end if chk==0 then return Duel.CheckReleaseGroup(REASON_COST,tp,Card.IsType,1,nil,TYPE_NORMAL) end
local g=Duel.SelectReleaseGroup(tp,Card.IsType,1,1,nil,TYPE_NORMAL) local g=Duel.SelectReleaseGroup(REASON_COST,tp,Card.IsType,1,1,nil,TYPE_NORMAL)
Duel.Release(g,REASON_COST) Duel.Release(g,REASON_COST)
end end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function cm.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
......
...@@ -116,8 +116,8 @@ function cm.descon(e) ...@@ -116,8 +116,8 @@ function cm.descon(e)
return not (c:GetColumnGroup():IsContains(tc) and tc:IsRelateToCard(c)) or tc:IsFacedown() return not (c:GetColumnGroup():IsContains(tc) and tc:IsRelateToCard(c)) or tc:IsFacedown()
end end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk) function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroup(tp,Card.IsType,1,nil,TYPE_NORMAL) end if chk==0 then return Duel.CheckReleaseGroup(REASON_COST,tp,Card.IsType,1,nil,TYPE_NORMAL) end
local g=Duel.SelectReleaseGroup(tp,Card.IsType,1,1,nil,TYPE_NORMAL) local g=Duel.SelectReleaseGroup(REASON_COST,tp,Card.IsType,1,1,nil,TYPE_NORMAL)
Duel.Release(g,REASON_COST) Duel.Release(g,REASON_COST)
end end
function cm.thfilter(c) function cm.thfilter(c)
......
...@@ -114,8 +114,8 @@ function cm.descon(e) ...@@ -114,8 +114,8 @@ function cm.descon(e)
return not (c:GetColumnGroup():IsContains(tc) and tc:IsRelateToCard(c)) or tc:IsFacedown() return not (c:GetColumnGroup():IsContains(tc) and tc:IsRelateToCard(c)) or tc:IsFacedown()
end end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk) function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroup(tp,Card.IsType,1,nil,TYPE_NORMAL) end if chk==0 then return Duel.CheckReleaseGroup(REASON_COST,tp,Card.IsType,1,nil,TYPE_NORMAL) end
local g=Duel.SelectReleaseGroup(tp,Card.IsType,1,1,nil,TYPE_NORMAL) local g=Duel.SelectReleaseGroup(REASON_COST,tp,Card.IsType,1,1,nil,TYPE_NORMAL)
Duel.Release(g,REASON_COST) Duel.Release(g,REASON_COST)
end end
function cm.cfilter(c) function cm.cfilter(c)
......
...@@ -78,7 +78,7 @@ function s.initial_effect(c) ...@@ -78,7 +78,7 @@ function s.initial_effect(c)
else return _SelectUnselect(cg,sg,sp,finish,cancel,...) end else return _SelectUnselect(cg,sg,sp,finish,cancel,...) end
end end
local originalDuelFunctions={} local originalDuelFunctions={}
local DuelFunctionsName={"SelectMatchingCard","SelectReleaseGroup","SelectReleaseGroupEx","SelectTarget","SelectTribute","SelectFusionMaterial","SelectSynchroMaterial","SelectTunerMaterial","SelectXyzMaterial"} local DuelFunctionsName={"SelectMatchingCard","SelectTarget","SelectTribute","SelectFusionMaterial","SelectSynchroMaterial","SelectTunerMaterial","SelectXyzMaterial"}
for _,funcName in ipairs(DuelFunctionsName) do for _,funcName in ipairs(DuelFunctionsName) do
originalDuelFunctions[funcName]=Duel[funcName] originalDuelFunctions[funcName]=Duel[funcName]
Duel[funcName]=function(sp,...) Duel[funcName]=function(sp,...)
...@@ -90,6 +90,19 @@ function s.initial_effect(c) ...@@ -90,6 +90,19 @@ function s.initial_effect(c)
else return originalDuelFunctions[funcName](sp,...) end else return originalDuelFunctions[funcName](sp,...) end
end end
end end
local originalDuelFunctions2={}
local DuelFunctionsName2={"SelectReleaseGroup","SelectReleaseGroupEx"}
for _,funcName in ipairs(DuelFunctionsName2) do
originalDuelFunctions2[funcName]=Duel[funcName]
Duel[funcName]=function(r,sp,...)
if Duel.IsPlayerAffectedByEffect(sp,id) and s.chain_solving then
local g=originalDuelFunctions2[funcName](r,sp,...)
local tg=Group.__add(g,g)
if tg:IsExists(f,1,nil) then table.insert(s.trigger,sp) end
return g
else return originalDuelFunctions2[funcName](r,sp,...) end
end
end
local originalGroupFunctions={} local originalGroupFunctions={}
local GroupFunctionsName={"FilterSelect","Select","RandomSelect","SelectWithSumEqual","SelectWithSumGreater",""} local GroupFunctionsName={"FilterSelect","Select","RandomSelect","SelectWithSumEqual","SelectWithSumGreater",""}
for _,funcName in ipairs(GroupFunctionsName) do for _,funcName in ipairs(GroupFunctionsName) do
......
...@@ -32,8 +32,8 @@ function cm.filter(c) ...@@ -32,8 +32,8 @@ function cm.filter(c)
return c:IsFaceup() and c:IsType(TYPE_RITUAL) and c:IsSummonType(SUMMON_TYPE_RITUAL) and c:GetFlagEffect(m)>0 return c:IsFaceup() and c:IsType(TYPE_RITUAL) and c:IsSummonType(SUMMON_TYPE_RITUAL) and c:GetFlagEffect(m)>0
end end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk) function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroup(tp,cm.filter,1,nil) end if chk==0 then return Duel.CheckReleaseGroup(REASON_COST,tp,cm.filter,1,nil) end
local g=Duel.SelectReleaseGroup(tp,cm.filter,1,1,nil) local g=Duel.SelectReleaseGroup(REASON_COST,tp,cm.filter,1,1,nil)
Duel.Release(g,REASON_COST) Duel.Release(g,REASON_COST)
end end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk) function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
......
...@@ -41,12 +41,12 @@ function cm.hspfilter(c,tp,sc) ...@@ -41,12 +41,12 @@ function cm.hspfilter(c,tp,sc)
end end
function cm.hspcon(e,c) function cm.hspcon(e,c)
if c==nil then return true end if c==nil then return true end
return Duel.CheckReleaseGroup(c:GetControler(),cm.hspfilter,1,nil,c:GetControler(),c) return Duel.CheckReleaseGroup(REASON_SPSUMMON,c:GetControler(),cm.hspfilter,1,nil,c:GetControler(),c)
end end
function cm.hspop(e,tp,eg,ep,ev,re,r,rp,c) function cm.hspop(e,tp,eg,ep,ev,re,r,rp,c)
local g=Duel.SelectReleaseGroup(tp,cm.hspfilter,1,1,nil,tp,c) local g=Duel.SelectReleaseGroup(REASON_SPSUMMON,tp,cm.hspfilter,1,1,nil,tp,c)
c:SetMaterial(g) c:SetMaterial(g)
Duel.Release(g,REASON_COST) Duel.Release(g,REASON_SPSUMMON)
end end
function cm.spfilter(c,e,tp) function cm.spfilter(c,e,tp)
return c:IsSetCard(0x304e,0x604e) and c:IsCanBeSpecialSummoned(e,SUMMON_VALUE_EVOLTILE,tp,false,false,POS_FACEUP+POS_FACEDOWN_DEFENSE) return c:IsSetCard(0x304e,0x604e) and c:IsCanBeSpecialSummoned(e,SUMMON_VALUE_EVOLTILE,tp,false,false,POS_FACEUP+POS_FACEDOWN_DEFENSE)
......
...@@ -42,12 +42,12 @@ end ...@@ -42,12 +42,12 @@ end
function cm.spccon(e,c) function cm.spccon(e,c)
if c==nil then return true end if c==nil then return true end
local tp=c:GetControler() local tp=c:GetControler()
return Duel.CheckReleaseGroup(tp,cm.cfilter,1,nil,tp) return Duel.CheckReleaseGroup(REASON_SPSUMMON,tp,cm.cfilter,1,nil,tp)
end end
function cm.spcop(e,tp,eg,ep,ev,re,r,rp,c) function cm.spcop(e,tp,eg,ep,ev,re,r,rp,c)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local g=Duel.SelectReleaseGroup(tp,cm.cfilter,1,1,nil,tp) local g=Duel.SelectReleaseGroup(REASON_SPSUMMON,tp,cm.cfilter,1,1,nil,tp)
Duel.Release(g,REASON_COST) Duel.Release(g,REASON_SPSUMMON)
end end
function cm.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function cm.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() end if chkc then return chkc:IsOnField() end
......
...@@ -45,8 +45,8 @@ function cm.rmop(e,tp,eg,ep,ev,re,r,rp) ...@@ -45,8 +45,8 @@ function cm.rmop(e,tp,eg,ep,ev,re,r,rp)
end end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk) function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler() local c=e:GetHandler()
if chk==0 then return Duel.CheckReleaseGroup(tp,Card.IsRace,1,c,RACE_ZOMBIE) end if chk==0 then return Duel.CheckReleaseGroup(REASON_COST,tp,Card.IsRace,1,c,RACE_ZOMBIE) end
local rg=Duel.SelectReleaseGroup(tp,Card.IsRace,1,1,c,RACE_ZOMBIE) local rg=Duel.SelectReleaseGroup(REASON_COST,tp,Card.IsRace,1,1,c,RACE_ZOMBIE)
Duel.Release(rg,REASON_COST) Duel.Release(rg,REASON_COST)
end end
function cm.tgfilter(c) function cm.tgfilter(c)
......
...@@ -46,8 +46,8 @@ function cm.desop(e,tp,eg,ep,ev,re,r,rp) ...@@ -46,8 +46,8 @@ function cm.desop(e,tp,eg,ep,ev,re,r,rp)
end end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk) function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler() local c=e:GetHandler()
if chk==0 then return Duel.CheckReleaseGroup(tp,Card.IsRace,1,c,RACE_ZOMBIE) end if chk==0 then return Duel.CheckReleaseGroup(REASON_COST,tp,Card.IsRace,1,c,RACE_ZOMBIE) end
local rg=Duel.SelectReleaseGroup(tp,Card.IsRace,1,1,c,RACE_ZOMBIE) local rg=Duel.SelectReleaseGroup(REASON_COST,tp,Card.IsRace,1,1,c,RACE_ZOMBIE)
Duel.Release(rg,REASON_COST) Duel.Release(rg,REASON_COST)
end end
function cm.srfilter(c) function cm.srfilter(c)
......
...@@ -44,8 +44,8 @@ function cm.cfilter(c) ...@@ -44,8 +44,8 @@ function cm.cfilter(c)
return not c:IsStatus(STATUS_BATTLE_DESTROYED) return not c:IsStatus(STATUS_BATTLE_DESTROYED)
end end
function cm.rmcost(e,tp,eg,ep,ev,re,r,rp,chk) function cm.rmcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroup(tp,cm.cfilter,1,e:GetHandler()) end if chk==0 then return Duel.CheckReleaseGroup(REASON_COST,tp,cm.cfilter,1,e:GetHandler()) end
local g=Duel.SelectReleaseGroup(tp,cm.cfilter,1,1,e:GetHandler()) local g=Duel.SelectReleaseGroup(REASON_COST,tp,cm.cfilter,1,1,e:GetHandler())
Duel.Release(g,REASON_COST) Duel.Release(g,REASON_COST)
end end
function cm.rmfilter(c) function cm.rmfilter(c)
......
...@@ -75,9 +75,9 @@ function cm.cfilter(c) ...@@ -75,9 +75,9 @@ function cm.cfilter(c)
return not c:IsStatus(STATUS_BATTLE_DESTROYED) return not c:IsStatus(STATUS_BATTLE_DESTROYED)
end end
function cm.rmcost(e,tp,eg,ep,ev,re,r,rp,chk) function cm.rmcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) and Duel.CheckReleaseGroup(tp,cm.cfilter,1,e:GetHandler()) end if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) and Duel.CheckReleaseGroup(REASON_COST,tp,cm.cfilter,1,e:GetHandler()) end
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST) e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST)
local g=Duel.SelectReleaseGroup(tp,cm.cfilter,1,1,e:GetHandler()) local g=Duel.SelectReleaseGroup(REASON_COST,tp,cm.cfilter,1,1,e:GetHandler())
Duel.Release(g,REASON_COST) Duel.Release(g,REASON_COST)
end end
function cm.rmtg(e,tp,eg,ep,ev,re,r,rp,chk) function cm.rmtg(e,tp,eg,ep,ev,re,r,rp,chk)
......
...@@ -83,12 +83,11 @@ function c9910646.xmop(e,tp,eg,ep,ev,re,r,rp) ...@@ -83,12 +83,11 @@ function c9910646.xmop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL)
local sg=g:Select(tp,ct,ct,nil) local sg=g:Select(tp,ct,ct,nil)
Duel.HintSelection(sg) Duel.HintSelection(sg)
local og=Group.CreateGroup()
for tc in aux.Next(sg) do for tc in aux.Next(sg) do
local og=tc:GetOverlayGroup() og:Merge(tc:GetOverlayGroup())
if og:GetCount()>0 then
Duel.SendtoGrave(og,REASON_RULE)
end
tc:CancelToGrave() tc:CancelToGrave()
Duel.Overlay(c,Group.FromCards(tc))
end end
if #og>0 then Duel.SendtoGrave(og,REASON_RULE) end
Duel.Overlay(c,sg)
end end
...@@ -12,4 +12,19 @@ function Auxiliary.PreloadUds() ...@@ -12,4 +12,19 @@ function Auxiliary.PreloadUds()
end end
return require_list[str] return require_list[str]
end end
local release_set={"CheckReleaseGroup","SelectReleaseGroup","CheckReleaseGroupEx","SelectReleaseGroupEx"}
for i,fname in pairs(release_set) do
local temp_f=Duel[fname]
Duel[fname]=function(...)
local params={...}
local old_minc=params[3]
local typ=type(old_minc)
if typ=="number" then return temp_f(REASON_COST,...) end
return temp_f(...)
end
end
if not Auxiliary.GetMustMaterialGroup then
Auxiliary.GetMustMaterialGroup=Duel.GetMustMaterial
end
--require("script/procedure.lua")
end end
\ No newline at end of file
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