Commit ac35e32b authored by 聖園ミカ's avatar 聖園ミカ 🐟

1+1=3

parent 612eb29e
......@@ -18,7 +18,6 @@ function cm.initial_effect(c)
c:RegisterEffect(e0)
--to hand
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_TO_GRAVE)
e1:SetProperty(EFFECT_FLAG_DELAY)
......
......@@ -2,7 +2,7 @@
local m=30900707
local cm=_G["c"..m]
function cm.initial_effect(c)
aux.AddXyzProcedure(c,cm.mfilter,1,4)
aux.AddXyzProcedureLevelFree(c,cm.mfilter,nil,1,4)
c:EnableReviveLimit()
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,1))
......@@ -94,7 +94,7 @@ end
function cm.spfilter(c,e,tp,check)
return c:IsCanBeSpecialSummoned(e,0,tp,false,false) and (c:IsLevel(1) or (check and (c:IsRank(1) )))
end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
function cm.sptg1(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local check=Duel.GetFieldGroupCount(tp,0,LOCATION_MZONE)>0
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and cm.spfilter(chkc,e,tp,check) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
......@@ -103,7 +103,7 @@ function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local g=Duel.SelectTarget(tp,cm.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp,check)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
function cm.spop1(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and
......
......@@ -12,32 +12,31 @@ function cm.initial_effect(c)
e1:SetOperation(cm.operation)
c:RegisterEffect(e1)
end
function cm.spfilter(c,e,tp)
function cm.filter(c,e,tp)
return c:IsSetCard(0xc87) and c:IsLevel(1)
and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE) and c:IsCanBeEffectTarget(e)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end
local g=Duel.GetMatchingGroup(cm.spfilter,tp,LOCATION_GRAVE,0,nil,e,tp)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_GRAVE) and cm.filter(chkc,e,tp) end
if chk==0 then return not Duel.IsPlayerAffectedByEffect(tp,59822133)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>1
end
and Duel.IsExistingTarget(cm.filter,tp,LOCATION_GRAVE,0,2,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g1=g:SelectSubGroup(tp,aux.dlvcheck,false,2,2)
Duel.SetTargetCard(g1)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g1,2,0,0)
local g=Duel.SelectTarget(tp,cm.filter,tp,LOCATION_GRAVE,0,2,2,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,2,0,0)
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if ft<=0 then return end
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
local sg=g:Filter(Card.IsRelateToEffect,nil,e)
if sg:GetCount()>1 and Duel.IsPlayerAffectedByEffect(tp,59822133) then return end
if sg:GetCount()>ft then
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if sg:GetCount()==0 or ft<=0 or (sg:GetCount()>1 and Duel.IsPlayerAffectedByEffect(tp,59822133)) then return end
if ft<sg:GetCount() then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
sg=sg:Select(tp,ft,ft,nil)
sg=sg:FilterSelect(tp,cm.filter,ft,ft,nil,e,tp)
end
Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP_DEFENSE)
if sg:GetCount()>0 then
Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP_DEFENSE)
end
local dg=Duel.SelectMatchingCard(tp,aux.TRUE,tp,LOCATION_MZONE,0,1,1,nil)
Duel.Destroy(dg,REASON_EFFECT)
end
\ No newline at end of file
......@@ -53,7 +53,6 @@ function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return false
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return true end
local ng=Group.CreateGroup()
local dg=Group.CreateGroup()
......@@ -72,7 +71,6 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetOperationInfo(0,CATEGORY_TODECK,dg,dg:GetCount(),0,0)
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local dg=Group.CreateGroup()
for i=3,ev do
local te,tgp=Duel.GetChainInfo(i,CHAININFO_TRIGGERING_EFFECT,CHAININFO_TRIGGERING_PLAYER)
......
function Auxiliary.PreloadUds()
--require(lib) redirect
function require(str)
dofile(str..".lua")
--[[local len = string.len(str)
......@@ -15,4 +17,14 @@ function Auxiliary.PreloadUds()
end
]]--
end
--Group.ForEach redirect
function Group.ForEach(group,func,...)
if aux.GetValueType(group)=="Group" and group:GetCount()>0 then
local d_group=group:Clone()
for tc in aux.Next(d_group) do
func(tc,...)
end
end
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