Commit b64391c8 authored by mercury233's avatar mercury233

update scripts

parent 7cf9f703
--黒魔術の秘儀
--Scripted by mallu11
function c100423004.initial_effect(c)
--activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e1:SetCountLimit(1,100423004+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(c100423004.target)
e1:SetOperation(c100423004.activate)
c:RegisterEffect(e1)
end
c100423004.card_code_list={46986414,38033121}
function c100423004.filter1(c,e)
return not c:IsImmuneToEffect(e)
end
function c100423004.filter2(c,e,tp,m,f,gc,chkf)
return c:IsType(TYPE_FUSION) and (not f or f(c)) and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false)
and c:CheckFusionMaterial(m,gc,chkf)
end
function c100423004.target(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local g=nil
local tc=nil
local chkf=tp
local mg1=Duel.GetFusionMaterial(tp)
local mg2=nil
g=mg1:Filter(Card.IsCode,nil,46986414,38033121)
local res1=false
gc=g:GetFirst()
while gc do
res1=res1 or Duel.IsExistingMatchingCard(c100423004.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg1,nil,gc,chkf)
gc=g:GetNext()
end
if not res1 then
local ce=Duel.GetChainMaterial(tp)
if ce~=nil then
local fgroup=ce:GetTarget()
local mg3=fgroup(ce,e,tp)
local mf=ce:GetValue()
g=mg3:Filter(Card.IsCode,nil,46986414,38033121)
gc=g:GetFirst()
while gc do
res1=res1 or Duel.IsExistingMatchingCard(c100423004.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg3,mf,gc,chkf)
gc=g:GetNext()
end
end
end
local mg=Duel.GetRitualMaterial(tp)
local sg=nil
g=mg:Filter(Card.IsCode,nil,46986414,38033121)
local res2=false
gc=g:GetFirst()
while gc do
res2=res2 or Duel.IsExistingMatchingCard(aux.RitualUltimateFilter,tp,LOCATION_HAND,0,1,nil,aux.TRUE,e,tp,mg,sg,Card.GetLevel,"Greater",gc)
gc=g:GetNext()
end
if chk==0 then
return res1 or res2
end
local s=0
if res1 and not res2 then
s=Duel.SelectOption(tp,aux.Stringid(100423004,0))
end
if not res1 and res2 then
s=Duel.SelectOption(tp,aux.Stringid(100423004,1))+1
end
if res1 and res2 then
s=Duel.SelectOption(tp,aux.Stringid(100423004,0),aux.Stringid(100423004,1))
end
e:SetLabel(s)
if s==0 then
local cat=e:GetCategory()
e:SetCategory(bit.bor(cat,CATEGORY_FUSION_SUMMON))
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
if s==1 then
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
end
end
function c100423004.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=nil
local gc=nil
if e:GetLabel()==0 then
local chkf=tp
local mg1=Duel.GetFusionMaterial(tp):Filter(c100423004.filter1,nil,e)
local mg2=nil
g=mg1:Filter(Card.IsCode,nil,46986414,38033121)
gc=g:GetFirst()
local sg1=Group.CreateGroup()
while gc do
sg1:Merge(Duel.GetMatchingGroup(c100423004.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg1,nil,gc,chkf))
if not Duel.IsExistingMatchingCard(c100423004.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg1,nil,gc,chkf) then
mg1:RemoveCard(gc)
end
gc=g:GetNext()
end
local mg3=nil
local sg2=nil
local ce=Duel.GetChainMaterial(tp)
if ce~=nil then
local fgroup=ce:GetTarget()
mg3=fgroup(ce,e,tp)
local mf=ce:GetValue()
g=mg3:Filter(Card.IsCode,nil,46986414,38033121)
gc=g:GetFirst()
local sg2=Group.CreateGroup()
while gc do
sg2:Merge(Duel.GetMatchingGroup(c100423004.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg3,mf,gc,chkf))
if not Duel.IsExistingMatchingCard(c100423004.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg3,nil,gc,chkf) then
mg3:RemoveCard(gc)
end
gc=g:GetNext()
end
end
if sg1:GetCount()>0 or (sg2~=nil and sg2:GetCount()>0) then
local sg=sg1:Clone()
if sg2 then sg:Merge(sg2) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tg=sg:Select(tp,1,1,nil)
local tc=tg:GetFirst()
if sg1:IsContains(tc) and (sg2==nil or not sg2:IsContains(tc) or not Duel.SelectYesNo(tp,ce:GetDescription())) then
g=mg1:Filter(Card.IsCode,nil,46986414,38033121)
gc=g:GetFirst()
local pg=Group.CreateGroup()
while gc do
if tc:CheckFusionMaterial(mg1,gc,chkf) then
pg:AddCard(gc)
end
gc=g:GetNext()
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FMATERIAL)
g=pg:Select(tp,1,1,nil)
Duel.SetSelectedCard(g:GetFirst())
local mat1=Duel.SelectFusionMaterial(tp,tc,mg1,nil,chkf)
tc:SetMaterial(mat1)
Duel.SendtoGrave(mat1,REASON_EFFECT+REASON_MATERIAL+REASON_FUSION)
Duel.BreakEffect()
Duel.SpecialSummon(tc,SUMMON_TYPE_FUSION,tp,tp,false,false,POS_FACEUP)
else
g=mg3:Filter(Card.IsCode,nil,46986414,38033121)
gc=g:GetFirst()
local pg=nil
while gc do
if tc:CheckFusionMaterial(mg3,gc,chkf) then
pg:AddCard(gc)
end
gc=g:GetNext()
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FMATERIAL)
g=pg:Select(tp,1,1,nil)
Duel.SetSelectedCard(g:GetFirst())
local mat2=Duel.SelectFusionMaterial(tp,tc,mg3,nil,chkf)
local fop=ce:GetOperation()
fop(ce,e,tp,tc,mat2)
end
tc:CompleteProcedure()
end
end
if e:GetLabel()==1 then
local mg=Duel.GetRitualMaterial(tp)
local sg=nil
g=mg:Filter(Card.IsCode,nil,46986414,38033121)
local sg1=Group.CreateGroup()
gc=g:GetFirst()
while gc do
sg1:Merge(Duel.GetMatchingGroup(aux.RitualUltimateFilter,tp,LOCATION_HAND,0,nil,aux.TRUE,e,tp,mg,sg,Card.GetLevel,"Greater",gc))
if not Duel.IsExistingMatchingCard(aux.RitualUltimateFilter,tp,LOCATION_HAND,0,1,nil,aux.TRUE,e,tp,mg,sg,Card.GetLevel,"Greater",gc) then
mg:RemoveCard(gc)
end
gc=g:GetNext()
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tg=sg1:Select(tp,1,1,nil)
local tc=tg:GetFirst()
if tc then
mg=mg:Filter(Card.IsCanBeRitualMaterial,tc,tc)
if sg then
mg:Merge(sg)
end
if tc.mat_filter then
mg=mg:Filter(tc.mat_filter,tc,tp)
else
mg:RemoveCard(tc)
end
g=mg:Filter(Card.IsCode,nil,46986414,38033121)
gc=g:Select(tp,1,1,nil):GetFirst()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
Duel.SetSelectedCard(gc)
aux.GCheckAdditional=aux.RitualCheckAdditional(tc,tc:GetLevel(),"Greater")
local mat=mg:SelectSubGroup(tp,aux.RitualCheck,false,1,tc:GetLevel(),tp,tc,tc:GetLevel(),"Greater")
aux.GCheckAdditional=nil
if not mat or mat:GetCount()==0 then return end
tc:SetMaterial(mat)
Duel.ReleaseRitualMaterial(mat)
Duel.BreakEffect()
Duel.SpecialSummon(tc,SUMMON_TYPE_RITUAL,tp,tp,false,true,POS_FACEUP)
tc:CompleteProcedure()
end
end
end
--ジェネレーション・ネクスト
--Scripted by mallu11
function c100423014.initial_effect(c)
--activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND+CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e1:SetCountLimit(1,100423014+EFFECT_COUNT_CODE_OATH)
e1:SetCondition(c100423014.condition)
e1:SetTarget(c100423014.target)
e1:SetOperation(c100423014.activate)
c:RegisterEffect(e1)
end
function c100423014.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetLP(tp)<Duel.GetLP(1-tp)
end
function c100423014.thfilter(c)
return (c:IsSetCard(0x3008) or c:IsSetCard(0xa4) or c:IsSetCard(0x1f)) and c:IsAttackBelow(math.abs(Duel.GetLP(0)-Duel.GetLP(1))) and c:IsAbleToHand()
end
function c100423014.spfilter(c,e,tp)
return (c:IsSetCard(0x3008) or c:IsSetCard(0xa4) or c:IsSetCard(0x1f)) and c:IsAttackBelow(math.abs(Duel.GetLP(0)-Duel.GetLP(1))) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c100423014.cfilter(c,e,tp)
return (c:IsSetCard(0x3008) or c:IsSetCard(0xa4) or c:IsSetCard(0x1f)) and c:IsAttackBelow(math.abs(Duel.GetLP(0)-Duel.GetLP(1))) and (c:IsAbleToHand() or c:IsCanBeSpecialSummoned(e,0,tp,false,false))
end
function c100423014.target(e,tp,eg,ep,ev,re,r,rp,chk)
local loc=LOCATION_DECK+LOCATION_GRAVE
if chk==0 then return Duel.IsExistingMatchingCard(c100423014.thfilter,tp,loc,0,1,nil) or (Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(c100423014.spfilter,tp,loc,0,1,nil,e,tp)) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,loc)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,loc)
end
function c100423014.activate(e,tp,eg,ep,ev,re,r,rp)
local loc=LOCATION_DECK+LOCATION_GRAVE
local g=nil
local s=0
local flag=0
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SELECT)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then
g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c100423014.thfilter),tp,loc,0,1,1,nil)
if g:GetCount()>0 then
local tc=g:GetFirst()
e:SetLabelObject(tc)
s=Duel.SelectOption(tp,1190)
end
else
g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c100423014.cfilter),tp,loc,0,1,1,nil,e,tp)
if g:GetCount()>0 then
local tc=g:GetFirst()
e:SetLabelObject(tc)
local b1=tc:IsAbleToHand()
local b2=tc:IsCanBeSpecialSummoned(e,0,tp,false,false)
if b1 and not b2 then
s=Duel.SelectOption(tp,1190)
end
if not b1 and b2 then
s=Duel.SelectOption(tp,1152)+1
end
if b1 and b2 then
s=Duel.SelectOption(tp,1190,1152)
end
end
end
local tc=e:GetLabelObject()
if s==0 then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tc)
if tc:IsLocation(LOCATION_HAND) then
flag=1
end
end
if s==1 then
flag=Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
end
if flag~=0 then
local gc=e:GetLabelObject()
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(1,0)
e1:SetValue(c100423014.aclimit)
e1:SetLabel(gc:GetCode())
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
end
function c100423014.aclimit(e,re,tp)
return re:GetHandler():IsCode(e:GetLabel())
end
--シンクロ・チェイス
--Scripted by mallu11
function c100423026.initial_effect(c)
--activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--spsummon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(100423026,0))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY)
e2:SetRange(LOCATION_SZONE)
e2:SetCountLimit(1,100423026)
e2:SetCondition(c100423026.spcon)
e2:SetTarget(c100423026.sptg)
e2:SetOperation(c100423026.spop)
c:RegisterEffect(e2)
--can not chain
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EVENT_CHAINING)
e3:SetRange(LOCATION_SZONE)
e3:SetCondition(c100423026.ccon)
e3:SetOperation(c100423026.ccop)
c:RegisterEffect(e3)
end
function c100423026.cfilter(c)
return c:IsSummonType(SUMMON_TYPE_SYNCHRO) and c:IsType(TYPE_SYNCHRO) and (c:IsSetCard(0x66) or c:IsSetCard(0x1017) or c:IsSetCard(0xa3))
end
function c100423026.spfilter(c,e,tp)
return c:IsLocation(LOCATION_GRAVE) and c:IsControler(tp) and c:IsCanBeEffectTarget(e) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE)
end
function c100423026.spcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c100423026.cfilter,1,nil) and rp==tp
end
function c100423026.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local mg=eg:Filter(c100423026.cfilter,nil):GetFirst():GetMaterial()
if chkc then return mg:IsContains(chkc) and c100423026.spfilter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and mg:IsExists(c100423026.spfilter,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=mg:FilterSelect(tp,c100423026.spfilter,1,1,nil,e,tp)
Duel.SetTargetCard(g)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function c100423026.spop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP_DEFENSE)
end
end
function c100423026.ccon(e,tp,eg,ep,ev,re,r,rp)
local tc=re:GetHandler()
return re:GetHandlerPlayer()==tp and tc:IsType(TYPE_SYNCHRO) and (tc:IsSetCard(0x66) or tc:IsSetCard(0x1017) or tc:IsSetCard(0xa3))
end
function c100423026.ccop(e,tp,eg,ep,ev,re,r,rp)
Duel.SetChainLimit(c100423026.chainlm)
end
function c100423026.chainlm(e,rp,tp)
return tp==rp
end
--ズバババンチョー-GC
--Scripted
function c100423035.initial_effect(c)
--spsummon1
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(100423035,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,100423035)
e1:SetCondition(c100423035.spcon1)
e1:SetTarget(c100423035.sptg1)
e1:SetOperation(c100423035.spop1)
c:RegisterEffect(e1)
--spsummon2
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(100423035,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,100423135)
e2:SetTarget(c100423035.sptg2)
e2:SetOperation(c100423035.spop2)
c:RegisterEffect(e2)
end
function c100423035.cfilter(c)
return c:IsFaceup() and (c:IsSetCard(0x8f) or c:IsSetCard(0x54)) and not c:IsCode(100423035)
end
function c100423035.spcon1(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetMatchingGroupCount(c100423035.cfilter,tp,LOCATION_MZONE,0,nil)>0
end
function c100423035.sptg1(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
end
function c100423035.spop1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
end
function c100423035.spfilter(c,e,tp)
return (c:IsSetCard(0x59) or c:IsSetCard(0x82)) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c100423035.sptg2(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c100423035.spfilter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingTarget(c100423035.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c100423035.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function c100423035.spop2(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(1,0)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetTarget(c100423035.splimit)
Duel.RegisterEffect(e1,tp)
end
function c100423035.splimit(e,c)
return not c:IsType(TYPE_XYZ) and c:IsLocation(LOCATION_EXTRA)
end
--EMポップアップ
--Scripted by mallu11
function c100423047.initial_effect(c)
--activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DRAW+CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,100423047+EFFECT_COUNT_CODE_OATH)
e1:SetCost(c100423047.cost)
e1:SetTarget(c100423047.target)
e1:SetOperation(c100423047.activate)
c:RegisterEffect(e1)
end
function c100423047.cfilter(c,e,tp,lsc,rsc)
local lv=c:GetLevel()
return (c:IsSetCard(0x9f) or (c:IsSetCard(0x98) and c:IsType(TYPE_PENDULUM)) or c:IsSetCard(0x99)) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and lv>lsc and lv<rsc
end
function c100423047.fselect(g)
if g:GetClassCount(Card.GetCode)==g:GetCount() then
Duel.SetSelectedCard(g)
return true
else return false end
end
function c100423047.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local h=Duel.GetMatchingGroupCount(Card.IsAbleToGraveAsCost,tp,LOCATION_HAND,0,nil)
if e:GetHandler():IsLocation(LOCATION_HAND) then h=h-1 end
if chk==0 then return h>0 end
local gc=1
if Duel.IsPlayerCanDraw(tp,2) then gc=2 end
if Duel.IsPlayerCanDraw(tp,3) then gc=3 end
local g=Duel.GetMatchingGroup(Card.IsAbleToGraveAsCost,tp,LOCATION_HAND,0,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local sg=g:Select(tp,1,gc,nil)
e:SetLabel(Duel.SendtoGrave(sg,REASON_COST))
end
function c100423047.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDraw(tp,1) end
local ct=e:GetLabel()
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(ct)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,ct)
end
function c100423047.activate(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
local ct=Duel.Draw(p,d,REASON_EFFECT)
local mz=Duel.GetLocationCount(tp,LOCATION_MZONE)
local flag=0
if ct>0 and mz>0 and Duel.GetFieldCard(tp,LOCATION_PZONE,0) and Duel.GetFieldCard(tp,LOCATION_PZONE,1) then
local lsc=Duel.GetFieldCard(tp,LOCATION_PZONE,0):GetLeftScale()
local rsc=Duel.GetFieldCard(tp,LOCATION_PZONE,1):GetRightScale()
if lsc>rsc then lsc,rsc=rsc,lsc end
if Duel.IsExistingMatchingCard(c100423047.cfilter,tp,LOCATION_HAND,0,1,nil,e,tp,lsc,rsc) and Duel.SelectYesNo(tp,aux.Stringid(100423047,0)) then
Duel.BreakEffect()
local count=math.min(ct,mz)
local g=Duel.GetMatchingGroup(c100423047.cfilter,tp,LOCATION_HAND,0,nil,e,tp,lsc,rsc)
local sg=g:SelectSubGroup(tp,c100423047.fselect,false,1,count,tp)
flag=Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP)
end
end
if flag==0 then
local h=Duel.GetFieldGroupCount(tp,LOCATION_HAND,0)
Duel.SetLP(tp,Duel.GetLP(tp)-h*1000)
end
end
......@@ -22,6 +22,7 @@ function c101010081.initial_effect(c)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_PHASE+PHASE_END)
e3:SetRange(LOCATION_GRAVE)
e3:SetCountLimit(1,101010081)
e3:SetCondition(c101010081.spcon)
e3:SetTarget(c101010081.sptg)
e3:SetOperation(c101010081.spop)
......
--クロノダイバー・タイムレコーダー
--Scripted by mallu11
function c101011018.initial_effect(c)
--battle damage
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(101011018,0))
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_MZONE)
e1:SetHintTiming(0,TIMING_BATTLE_START+TIMING_ATTACK)
e1:SetCountLimit(1,101011018)
e1:SetCondition(c101011018.bdcon)
e1:SetCost(c101011018.bdcost)
e1:SetOperation(c101011018.bdop)
c:RegisterEffect(e1)
--spsummon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(101011018,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_LEAVE_FIELD)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,101011118)
e2:SetCondition(c101011018.spcon)
e2:SetTarget(c101011018.sptg)
e2:SetOperation(c101011018.spop)
c:RegisterEffect(e2)
end
function c101011018.bdcon(e,tp,eg,ep,ev,re,r,rp)
return (Duel.GetCurrentPhase()>=PHASE_BATTLE_START and Duel.GetCurrentPhase()<=PHASE_BATTLE) and Duel.GetTurnPlayer()==1-tp
end
function c101011018.bdcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsReleasable() end
Duel.Release(e:GetHandler(),REASON_COST)
end
function c101011018.bdop(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_REFLECT_BATTLE_DAMAGE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(1,0)
e1:SetValue(c101011018.damcon)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function c101011018.damcon(e,c)
local tp=e:GetHandlerPlayer()
if Duel.GetFlagEffect(tp,101011018)==0 and Duel.GetAttacker():IsControler(1-tp) then
Duel.RegisterFlagEffect(tp,101011018,RESET_PHASE+PHASE_END,0,1)
return true
else
return false
end
end
function c101011018.cfilter(c,tp)
return c:IsPreviousPosition(POS_FACEUP) and c:GetPreviousControler()==tp and c:IsReason(REASON_EFFECT) and bit.band(c:GetPreviousTypeOnField(),TYPE_XYZ)~=0 and c:IsPreviousLocation(LOCATION_MZONE)
end
function c101011018.spcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c101011018.cfilter,1,nil,tp)
end
function c101011018.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function c101011018.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)~=0 then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EFFECT_LEAVE_FIELD_REDIRECT)
e1:SetValue(LOCATION_REMOVED)
e1:SetReset(RESET_EVENT+RESETS_REDIRECT)
c:RegisterEffect(e1,true)
end
end
--楽天禍カルクラグラ
--Scripted by mallu11
function c101011025.initial_effect(c)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(101011025,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOGRAVE)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_DESTROYED)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,101011025)
e1:SetCondition(c101011025.spcon)
e1:SetTarget(c101011025.sptg)
e1:SetOperation(c101011025.spop)
c:RegisterEffect(e1)
end
function c101011025.cfilter(c,tp,rp)
return c:GetPreviousControler()==tp and c:IsPreviousLocation(LOCATION_MZONE)
and c:IsPreviousPosition(POS_FACEUP) and bit.band(c:GetPreviousAttributeOnField(),ATTRIBUTE_EARTH)~=0
and (c:IsReason(REASON_BATTLE) or c:IsReason(REASON_EFFECT) and c:GetReasonPlayer()==1-tp)
end
function c101011025.spcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c101011025.cfilter,1,nil,tp)
end
function c101011025.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function c101011025.tgfilter(c)
return c:IsType(TYPE_MONSTER) and c:IsAbleToGrave()
end
function c101011025.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
local g=Duel.GetMatchingGroup(c101011025.tgfilter,tp,LOCATION_DECK,0,nil)
if Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)~=0
and g:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(101011025,1)) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local sg=g:Select(tp,1,1,nil)
Duel.SendtoGrave(sg,REASON_EFFECT)
end
end
--ジャック・ア・ボーラン
--Scripted by mallu11
function c101011026.initial_effect(c)
--spsummon1
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(101011026,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,101011026)
e1:SetCost(c101011026.spcost1)
e1:SetTarget(c101011026.sptg1)
e1:SetOperation(c101011026.spop1)
c:RegisterEffect(e1)
--spsummon2
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(101011026,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_REMOVE)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetRange(LOCATION_MZONE)
e2:SetHintTiming(TIMINGS_CHECK_MONSTER+TIMING_MAIN_END)
e2:SetCountLimit(1,101011126)
e2:SetCondition(c101011026.spcon2)
e2:SetTarget(c101011026.sptg2)
e2:SetOperation(c101011026.spop2)
c:RegisterEffect(e2)
end
function c101011026.spfilter1(c)
return c:IsRace(RACE_ZOMBIE) and c:IsDiscardable()
end
function c101011026.spcost1(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.IsExistingMatchingCard(c101011026.spfilter1,tp,LOCATION_HAND,0,1,c) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISCARD)
local g=Duel.SelectMatchingCard(tp,c101011026.spfilter1,tp,LOCATION_HAND,0,1,1,c)
Duel.SendtoGrave(g,REASON_COST+REASON_DISCARD)
end
function c101011026.sptg1(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
end
function c101011026.spop1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
end
function c101011026.spfilter2(c,e,tp)
return c:IsRace(RACE_ZOMBIE) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c101011026.spcon2(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==1-tp and (Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2)
end
function c101011026.sptg2(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local c=e:GetHandler()
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and c101011026.spfilter2(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingTarget(c101011026.spfilter2,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,nil,e,tp) and c:IsAbleToRemove() end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c101011026.spfilter2,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,c,1,0,0)
end
function c101011026.spop2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)~=0 then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_LEAVE_FIELD_REDIRECT)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_REDIRECT)
e1:SetValue(LOCATION_REMOVED)
tc:RegisterEffect(e1,true)
if c:IsFaceup() and c:IsRelateToEffect(e) and c:IsAbleToRemove() then
Duel.BreakEffect()
if Duel.Remove(c,POS_FACEUP,REASON_EFFECT+REASON_TEMPORARY)~=0 then
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_PHASE+PHASE_END)
e2:SetReset(RESET_PHASE+PHASE_END)
e2:SetLabelObject(tc)
e2:SetCountLimit(1)
e2:SetOperation(c101011026.retop)
Duel.RegisterEffect(e2,tp)
end
end
end
end
function c101011026.retop(e,tp,eg,ep,ev,re,r,rp)
Duel.ReturnToField(e:GetHandler())
end
--イビルセラ・ルテア
--Scripted by mallu11
function c101011027.initial_effect(c)
--battle indes
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetValue(c101011027.indcon)
c:RegisterEffect(e1)
--cannot be target
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e2:SetRange(LOCATION_MZONE)
e2:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e2:SetTargetRange(LOCATION_SZONE,0)
e2:SetTarget(c101011027.tgtg)
e2:SetValue(aux.tgoval)
c:RegisterEffect(e2)
end
function c101011027.indcon(e,c)
return Duel.IsExistingMatchingCard(aux.TRUE,e:GetHandlerPlayer(),LOCATION_MZONE,0,1,e:GetHandler())
end
function c101011027.tgtg(e,c)
return c:IsFaceup()
end
--執愛のウヴァループ
--Scripted by mallu11
function c101011028.initial_effect(c)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(101011028,0))
e1:SetCategory(CATEGORY_REMOVE+CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,101011028)
e1:SetTarget(c101011028.sptg)
e1:SetOperation(c101011028.spop)
c:RegisterEffect(e1)
--to hand
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(101011028,1))
e2:SetCategory(CATEGORY_REMOVE+CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,101011128)
e2:SetTarget(c101011028.thtg)
e2:SetOperation(c101011028.thop)
c:RegisterEffect(e2)
end
function c101011028.spfilter(c,tp)
return c:IsType(TYPE_SYNCHRO) and c:IsAbleToRemove() and Duel.GetMZoneCount(tp,c)>0 and c:IsFaceup()
end
function c101011028.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local c=e:GetHandler()
if chkc then return chkc:IsLocation(LOCATION_MZONE+LOCATION_GRAVE) and chkc:IsControler(tp) and c101011028.spfilter(chkc,tp) end
if chk==0 then return Duel.IsExistingTarget(c101011028.spfilter,tp,LOCATION_MZONE+LOCATION_GRAVE,0,1,nil,tp) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectTarget(tp,c101011028.spfilter,tp,LOCATION_MZONE+LOCATION_GRAVE,0,1,1,nil,tp)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
end
function c101011028.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 tc:IsLocation(LOCATION_REMOVED) and c:IsRelateToEffect(e) then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
end
function c101011028.thfilter(c)
return c:IsType(TYPE_SYNCHRO) and c:IsAbleToRemove() and c:IsFaceup()
end
function c101011028.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local c=e:GetHandler()
if chkc then return chkc:IsLocation(LOCATION_MZONE+LOCATION_GRAVE) and chkc:IsControler(tp) and c101011028.thfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c101011028.thfilter,tp,LOCATION_MZONE+LOCATION_GRAVE,0,1,c) and c:IsAbleToHand() end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectTarget(tp,c101011028.thfilter,tp,LOCATION_MZONE+LOCATION_GRAVE,0,1,1,c)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,c,1,0,0)
end
function c101011028.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 tc:IsLocation(LOCATION_REMOVED) and c:IsRelateToEffect(e) then
Duel.SendtoHand(c,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,c)
end
end
--達磨落師
--Scripted by mallu11
function c101011029.initial_effect(c)
--atk 0
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(101011029,0))
e1:SetCategory(CATEGORY_ATKCHANGE)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP)
e1:SetRange(LOCATION_MZONE)
e1:SetHintTiming(0,TIMING_ATTACK+TIMING_DAMAGE_STEP)
e1:SetCountLimit(1,101011029)
e1:SetCondition(c101011029.atkcon)
e1:SetCost(c101011029.atkcost)
e1:SetTarget(c101011029.atktg)
e1:SetOperation(c101011029.atkop)
c:RegisterEffect(e1)
--remove overlay replace
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(101011029,1))
e2:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_OVERLAY_REMOVE_REPLACE)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,101011129)
e2:SetCondition(c101011029.rcon)
e2:SetOperation(c101011029.rop)
c:RegisterEffect(e2)
end
function c101011029.cfilter(c)
return c:IsFaceup() and c:GetAttack()>0
end
function c101011029.atkcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase()~=PHASE_DAMAGE or not Duel.IsDamageCalculated()
end
function c101011029.atkcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckRemoveOverlayCard(tp,1,0,1,REASON_COST) end
Duel.RemoveOverlayCard(tp,1,0,1,1,REASON_COST)
end
function c101011029.atktg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and c101011029.cfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c101011029.cfilter,tp,0,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_OPPO)
Duel.SelectTarget(tp,c101011029.cfilter,tp,0,LOCATION_MZONE,1,1,nil)
end
function c101011029.atkop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsFaceup() and tc:GetAttack()>0 then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK_FINAL)
e1:SetValue(0)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
end
end
function c101011029.rcon(e,tp,eg,ep,ev,re,r,rp)
return aux.exccon(e) and bit.band(r,REASON_COST)~=0 and re:IsHasType(0x7e0) and re:IsActiveType(TYPE_XYZ)
and re:GetHandler():GetOverlayCount()>=ev-1 and e:GetHandler():IsAbleToRemoveAsCost() and ep==e:GetOwnerPlayer()
end
function c101011029.rop(e,tp,eg,ep,ev,re,r,rp)
return Duel.Remove(e:GetHandler(),POS_FACEUP,REASON_COST)
end
--トランシケーダ
--Scripted by mallu11
function c101011030.initial_effect(c)
--spsummon token
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(101011030,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOKEN)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCountLimit(1,101011030)
e1:SetTarget(c101011030.sptg)
e1:SetOperation(c101011030.spop)
c:RegisterEffect(e1)
end
function c101011030.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsPlayerCanSpecialSummonMonster(tp,101011130,0,0x4011,0,0,3,RACE_INSECT,ATTRIBUTE_EARTH) end
Duel.SetOperationInfo(0,CATEGORY_TOKEN,nil,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,0,0)
end
function c101011030.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsPlayerCanSpecialSummonMonster(tp,101011130,0,0x4011,0,0,3,RACE_INSECT,ATTRIBUTE_EARTH) then
local token=Duel.CreateToken(tp,101011130)
Duel.SpecialSummonStep(token,0,tp,tp,false,false,POS_FACEUP)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetRange(LOCATION_MZONE)
e1:SetAbsoluteRange(tp,1,0)
e1:SetTarget(c101011030.splimit)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
token:RegisterEffect(e1,true)
Duel.SpecialSummonComplete()
end
end
function c101011030.splimit(e,c)
return not c:IsRace(RACE_INSECT) and c:IsLocation(LOCATION_EXTRA)
end
--チューン・ナイト
--Scripted by mallu11
function c101011031.initial_effect(c)
--turner
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(101011031,0))
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetTarget(c101011031.tntg)
e1:SetOperation(c101011031.tnop)
c:RegisterEffect(e1)
--equip
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(101011031,1))
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetCategory(CATEGORY_EQUIP)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE)
e2:SetTarget(c101011031.eqtg)
e2:SetOperation(c101011031.eqop)
c:RegisterEffect(e2)
--unequip
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(101011031,2))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_SZONE)
e3:SetTarget(c101011031.sptg)
e3:SetOperation(c101011031.spop)
c:RegisterEffect(e3)
--destroy sub
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_EQUIP)
e4:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e4:SetCode(EFFECT_DESTROY_SUBSTITUTE)
e4:SetValue(c101011031.repval)
c:RegisterEffect(e4)
--eqlimit
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_SINGLE)
e5:SetCode(EFFECT_EQUIP_LIMIT)
e5:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e5:SetValue(c101011031.eqlimit)
c:RegisterEffect(e5)
end
function c101011031.tntg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsFaceup() and c:IsLevelAbove(1) and not c:IsType(TYPE_TUNER) and c:IsRelateToEffect(e) end
end
function c101011031.tnop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsFaceup() and c:IsRelateToEffect(e) and c:IsLevelAbove(1) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_ADD_TYPE)
e1:SetValue(TYPE_TUNER)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
c:RegisterEffect(e1)
end
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_SPSUMMON)
e2:SetCondition(c101011031.regcon)
e2:SetOperation(c101011031.regop)
e2:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e2,tp)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e3:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e3:SetTargetRange(1,0)
e3:SetCondition(c101011031.spcon)
e3:SetValue(c101011031.splimit)
e3:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e3,tp)
end
function c101011031.cfilter(c)
return c:GetSummonLocation()==LOCATION_EXTRA
end
function c101011031.regcon(e,tp,eg,ep,ev,re,r,rp)
return ep==tp and eg:IsExists(c101011031.cfilter,1,nil)
end
function c101011031.regop(e,tp,eg,ep,ev,re,r,rp)
Duel.RegisterFlagEffect(tp,101011031,RESET_PHASE+PHASE_END,0,1)
end
function c101011031.spcon(e)
local tp=e:GetHandlerPlayer()
return Duel.GetFlagEffect(tp,101011031)>0
end
function c101011031.splimit(e,c)
return c:IsLocation(LOCATION_EXTRA)
end
function c101011031.filter(c)
local ct1,ct2=c:GetUnionCount()
return c:IsFaceup() and ct2==0
end
function c101011031.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local c=e:GetHandler()
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c101011031.filter(chkc) end
if chk==0 then return e:GetHandler():GetFlagEffect(101011031)==0 and Duel.GetLocationCount(tp,LOCATION_SZONE)>0
and Duel.IsExistingTarget(c101011031.filter,tp,LOCATION_MZONE,0,1,c) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
local g=Duel.SelectTarget(tp,c101011031.filter,tp,LOCATION_MZONE,0,1,1,c)
Duel.SetOperationInfo(0,CATEGORY_EQUIP,g,1,0,0)
c:RegisterFlagEffect(c101011031,RESET_EVENT+0x7e0000+RESET_PHASE+PHASE_END,0,1)
end
function c101011031.eqop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if not c:IsRelateToEffect(e) or c:IsFacedown() then return end
if not tc:IsRelateToEffect(e) or not c101011031.filter(tc) then
Duel.SendtoGrave(c,REASON_EFFECT)
return
end
if not Duel.Equip(tp,c,tc,false) then return end
aux.SetUnionState(c)
end
function c101011031.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:GetFlagEffect(101011031)==0 and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,true,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
c:RegisterFlagEffect(101011031,RESET_EVENT+0x7e0000+RESET_PHASE+PHASE_END,0,1)
end
function c101011031.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
Duel.SpecialSummon(c,0,tp,tp,true,false,POS_FACEUP)
end
function c101011031.repval(e,re,r,rp)
return bit.band(r,REASON_BATTLE)~=0 or bit.band(r,REASON_EFFECT)~=0
end
function c101011031.eqlimit(e,c)
return e:GetHandler():GetEquipTarget()==c
end
--バトル・サバイバー
--Scripted by mallu11
function c101011032.initial_effect(c)
--to hand
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(101011032,0))
e1:SetCategory(CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_PHASE+PHASE_BATTLE)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,101011032)
e1:SetTarget(c101011032.thtg)
e1:SetOperation(c101011032.thop)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_TO_GRAVE)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetRange(LOCATION_MZONE)
e2:SetCondition(c101011032.regcon)
e2:SetOperation(c101011032.regop)
c:RegisterEffect(e2)
end
function c101011032.regcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase()>=PHASE_BATTLE_START and Duel.GetCurrentPhase()<=PHASE_BATTLE
end
function c101011032.regop(e,tp,eg,ep,ev,re,r,rp)
if eg:IsExists(Card.IsControler,1,nil,tp) then
local g=eg:Filter(Card.IsControler,nil,tp)
local tc=g:GetFirst()
while tc do
tc:RegisterFlagEffect(101011032,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_BATTLE,0,1)
tc=g:GetNext()
end
end
end
function c101011032.thfilter(c)
return c:GetFlagEffect(101011032)~=0 and c:IsAbleToHand() and not c:IsCode(101011032)
end
function c101011032.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c101011032.thfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_GRAVE)
end
function c101011032.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c101011032.thfilter),tp,LOCATION_GRAVE,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
--テイ・キューピット
--Scripted by mallu11
function c101011033.initial_effect(c)
--immune
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_IMMUNE_EFFECT)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetValue(c101011033.immval)
c:RegisterEffect(e1)
--level up
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(101011033,0))
e2:SetCategory(CATEGORY_LVCHANGE)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,101011033)
e2:SetCost(c101011033.lvcost)
e2:SetOperation(c101011033.lvop)
c:RegisterEffect(e2)
end
function c101011033.immval(e,te)
return te:IsActiveType(TYPE_MONSTER) and te:IsActivated() and (not (e:GetHandler():GetLevel()>=te:GetOwner():GetLevel()) or te:GetOwner():GetLevel()==0)
end
function c101011033.lvcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToRemoveAsCost,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.GetMatchingGroup(Card.IsAbleToRemoveAsCost,tp,LOCATION_GRAVE,0,nil)
local sg=g:Select(tp,1,3,nil)
e:SetLabel(Duel.Remove(sg,POS_FACEUP,REASON_COST))
end
function c101011033.lvop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local ct=e:GetLabel()
if c:IsFaceup() and c:IsRelateToEffect(e) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_LEVEL)
e1:SetValue(ct)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
c:RegisterEffect(e1)
end
end
--クロシープ
--Scripted by mallu11
function c101011047.initial_effect(c)
c:EnableReviveLimit()
aux.AddLinkProcedure(c,nil,2,2,c101011047.lcheck)
--activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,101011047)
e1:SetCondition(c101011047.condition)
e1:SetTarget(c101011047.target)
e1:SetOperation(c101011047.activate)
c:RegisterEffect(e1)
end
function c101011047.lcheck(g,lc)
return g:GetClassCount(Card.GetLinkCode)==g:GetCount()
end
function c101011047.cfilter(c,lg)
return lg:IsContains(c)
end
function c101011047.spfilter(c,e,tp)
return c:IsLevelBelow(4) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c101011047.condition(e,tp,eg,ep,ev,re,r,rp)
local lg=e:GetHandler():GetLinkedGroup()
return eg:IsExists(c101011047.cfilter,1,nil,lg)
end
function c101011047.target(e,tp,eg,ep,ev,re,r,rp,chk)
local lg=e:GetHandler():GetLinkedGroup()
local b1=Duel.IsPlayerCanDraw(tp,2) and lg:IsExists(Card.IsType,1,nil,TYPE_RITUAL)
local b2=Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(c101011047.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) and lg:IsExists(Card.IsType,1,nil,TYPE_FUSION)
local b3=Duel.IsExistingMatchingCard(Card.IsFaceup,tp,LOCATION_MZONE,0,1,nil) and lg:IsExists(Card.IsType,1,nil,TYPE_SYNCHRO)
local b4=Duel.IsExistingMatchingCard(Card.IsFaceup,tp,0,LOCATION_MZONE,1,nil) and lg:IsExists(Card.IsType,1,nil,TYPE_XYZ)
if chk==0 then return b1 or b2 or b3 or b4 end
if b1 then
local cat=e:GetCategory()
e:SetCategory(bit.bor(cat,CATEGORY_DRAW+CATEGORY_HANDES))
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(2)
end
if b2 then
local cat=e:GetCategory()
e:SetCategory(bit.bor(cat,CATEGORY_SPECIAL_SUMMON))
end
if b3 or b4 then
local cat=e:GetCategory()
e:SetCategory(bit.bor(cat,CATEGORY_ATKCHANGE))
end
end
function c101011047.activate(e,tp,eg,ep,ev,re,r,rp)
local lg=e:GetHandler():GetLinkedGroup()
local b1=Duel.IsPlayerCanDraw(tp,2) and lg:IsExists(Card.IsType,1,nil,TYPE_RITUAL)
local b2=Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(aux.NecroValleyFilter(c101011047.spfilter),tp,LOCATION_GRAVE,0,1,nil,e,tp) and lg:IsExists(Card.IsType,1,nil,TYPE_FUSION)
local b3=Duel.IsExistingMatchingCard(Card.IsFaceup,tp,LOCATION_MZONE,0,1,nil) and lg:IsExists(Card.IsType,1,nil,TYPE_SYNCHRO)
local b4=Duel.IsExistingMatchingCard(Card.IsFaceup,tp,0,LOCATION_MZONE,1,nil) and lg:IsExists(Card.IsType,1,nil,TYPE_XYZ)
local res=0
if b1 then
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
res=Duel.Draw(p,d,REASON_EFFECT)
if res==2 then
Duel.ShuffleHand(p)
Duel.BreakEffect()
local g=Duel.GetFieldGroup(tp,LOCATION_HAND,0)
local sg=g:Select(p,2,2,nil)
Duel.SendtoGrave(sg,REASON_DISCARD+REASON_EFFECT)
end
end
if b2 then
if res~=0 then Duel.BreakEffect() end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c101011047.spfilter),tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
res=Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
if b3 then
if res~=0 then Duel.BreakEffect() end
local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_MZONE,0,nil)
local tc=g:GetFirst()
while tc do
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(700)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
res=res+1
tc=g:GetNext()
end
end
if b4 then
if res~=0 then Duel.BreakEffect() end
local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,0,LOCATION_MZONE,nil)
local tc=g:GetFirst()
while tc do
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(-700)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
tc=g:GetNext()
end
end
end
--グラビティ・コントローラー
--Scripted by mallu11
function c101011049.initial_effect(c)
c:EnableReviveLimit()
aux.AddLinkProcedure(c,c101011049.mfilter,1,1)
--cannot link material
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_CANNOT_BE_LINK_MATERIAL)
e1:SetValue(c101011049.lmlimit)
c:RegisterEffect(e1)
--battle indes
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetRange(LOCATION_MZONE)
e2:SetValue(c101011049.indes)
c:RegisterEffect(e2)
--to deck
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(101011049,0))
e3:SetCategory(CATEGORY_TODECK)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_BATTLE_START)
e3:SetRange(LOCATION_MZONE)
e3:SetCondition(c101011049.tdcon)
e3:SetTarget(c101011049.tdtg)
e3:SetOperation(c101011049.tdop)
c:RegisterEffect(e3)
end
function c101011049.mfilter(c)
return not c:IsType(TYPE_LINK) and c:GetSequence()>4
end
function c101011049.lmlimit(e)
local c=e:GetHandler()
return c:IsSummonType(SUMMON_TYPE_LINK) and c:GetTurnID()==Duel.GetTurnCount()
end
function c101011049.indes(e,c)
return e:GetHandler():GetSequence()>4 and c:GetSequence()<=4
end
function c101011049.tdcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=c:GetBattleTarget()
e:SetLabelObject(tc)
return tc:IsControler(1-tp) and tc:GetSequence()>4
end
function c101011049.tdtg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local tc=e:GetLabelObject()
if chk==0 then return tc and c:IsAbleToDeck() and tc:IsAbleToDeck() end
local g=Group.CreateGroup()
g:AddCard(c)
g:AddCard(tc)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,2,0,0)
end
function c101011049.tdop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=e:GetLabelObject()
local g=Group.CreateGroup()
if c:IsRelateToBattle() then
g:AddCard(c)
end
if tc and tc:IsRelateToBattle() and tc:IsControler(1-tp) then
g:AddCard(tc)
end
if g:GetCount()>0 then
Duel.SendtoDeck(g,nil,2,REASON_EFFECT)
end
end
--閃刀術式-シザーズクロス
--Scripted by mallu11
function c101011062.initial_effect(c)
--activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCondition(c101011062.condition)
e1:SetTarget(c101011062.target)
e1:SetOperation(c101011062.activate)
c:RegisterEffect(e1)
end
function c101011062.cfilter(c)
return c:GetSequence()<5
end
function c101011062.thfilter(c)
return c:IsSetCard(0x1115) and c:IsLevel(4) and c:IsAbleToHand()
end
function c101011062.condition(e,tp,eg,ep,ev,re,r,rp)
return not Duel.IsExistingMatchingCard(c101011062.cfilter,tp,LOCATION_MZONE,0,1,nil)
end
function c101011062.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c101011062.thfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c101011062.thfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectTarget(tp,c101011062.thfilter,tp,LOCATION_GRAVE,0,1,1,nil)
if Duel.GetMatchingGroupCount(Card.IsType,tp,LOCATION_GRAVE,0,nil,TYPE_SPELL)>=3 then
e:SetCategory(CATEGORY_TOHAND+CATEGORY_SPECIAL_SUMMON)
end
end
function c101011062.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
if Duel.GetMatchingGroupCount(Card.IsType,tp,LOCATION_GRAVE,0,nil,TYPE_SPELL)>=3
and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and tc:IsCanBeSpecialSummoned(e,0,tp,false,false)
and Duel.SelectOption(tp,1190,1152)==1 then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
else
Duel.SendtoHand(tc,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tc)
end
end
end
--使い捨て学習装置
--Scripted by mallu11
function c101011065.initial_effect(c)
--activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_EQUIP)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetTarget(c101011065.target)
e1:SetOperation(c101011065.operation)
c:RegisterEffect(e1)
--atk up
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_EQUIP)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetValue(c101011065.atkval)
c:RegisterEffect(e2)
--set
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e3:SetCode(EVENT_TO_GRAVE)
e3:SetCondition(c101011065.regcon)
e3:SetOperation(c101011065.regop)
c:RegisterEffect(e3)
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(101011065,0))
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e4:SetCode(EVENT_PHASE+PHASE_END)
e4:SetRange(LOCATION_GRAVE)
e4:SetCountLimit(1,101011065)
e4:SetCondition(c101011065.setcon)
e4:SetTarget(c101011065.settg)
e4:SetOperation(c101011065.setop)
c:RegisterEffect(e4)
--equip limit
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_SINGLE)
e5:SetCode(EFFECT_EQUIP_LIMIT)
e5:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e5:SetValue(1)
c:RegisterEffect(e5)
end
function c101011065.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsFaceup() end
if chk==0 then return Duel.IsExistingTarget(Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
Duel.SelectTarget(tp,Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_EQUIP,e:GetHandler(),1,0,0)
end
function c101011065.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if e:GetHandler():IsRelateToEffect(e) and tc:IsRelateToEffect(e) and tc:IsFaceup() then
Duel.Equip(tp,e:GetHandler(),tc)
end
end
function c101011065.atkval(e,c)
return Duel.GetMatchingGroupCount(Card.IsType,e:GetHandler():GetControler(),LOCATION_GRAVE,0,nil,TYPE_MONSTER)*200
end
function c101011065.regcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPreviousLocation(LOCATION_ONFIELD)
end
function c101011065.regop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
c:RegisterFlagEffect(101011065,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1)
end
function c101011065.setcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetFlagEffect(101011065)>0
end
function c101011065.settg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0 and c:IsSSetable() end
end
function c101011065.setop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
local flag=Duel.SSet(tp,c)
Duel.ConfirmCards(1-tp,c)
if flag~=0 then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_LEAVE_FIELD_REDIRECT)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_REDIRECT)
e1:SetValue(LOCATION_REMOVED)
c:RegisterEffect(e1,true)
end
end
end
--脆刃の剣
--Scripted by mallu1
function c101011068.initial_effect(c)
c:SetUniqueOnField(1,0,101011068)
--activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_EQUIP)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetTarget(c101011068.target)
e1:SetOperation(c101011068.operation)
c:RegisterEffect(e1)
--atk up
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_EQUIP)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetValue(2000)
c:RegisterEffect(e2)
--damage
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EVENT_PRE_BATTLE_DAMAGE)
e3:SetRange(LOCATION_SZONE)
e3:SetCondition(c101011068.damcon)
e3:SetOperation(c101011068.damop)
c:RegisterEffect(e3)
--to grave
local e4=Effect.CreateEffect(c)
e4:SetCategory(CATEGORY_TOGRAVE)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e4:SetCode(EVENT_DAMAGE)
e4:SetRange(LOCATION_SZONE)
e4:SetCondition(c101011068.tgcon)
e4:SetTarget(c101011068.tgtg)
e4:SetOperation(c101011068.tgop)
c:RegisterEffect(e4)
--equip limit
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_SINGLE)
e5:SetCode(EFFECT_EQUIP_LIMIT)
e5:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e5:SetValue(1)
c:RegisterEffect(e5)
end
function c101011068.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsFaceup() end
if chk==0 then return Duel.IsExistingTarget(Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
Duel.SelectTarget(tp,Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_EQUIP,e:GetHandler(),1,0,0)
end
function c101011068.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if e:GetHandler():IsRelateToEffect(e) and tc:IsRelateToEffect(e) and tc:IsFaceup() then
Duel.Equip(tp,e:GetHandler(),tc)
end
end
function c101011068.damcon(e,tp,eg,ep,ev,re,r,rp)
local ec=e:GetHandler():GetEquipTarget()
return Duel.GetAttacker()==ec or Duel.GetAttackTarget()==ec
end
function c101011068.damop(e,tp,eg,ep,ev,re,r,rp)
Duel.ChangeBattleDamage(ep,ev,false)
Duel.ChangeBattleDamage(1-ep,ev,false)
end
function c101011068.tgcon(e,tp,eg,ep,ev,re,r,rp)
return ep==tp and bit.band(r,REASON_BATTLE)~=0 and ev>=2000
end
function c101011068.tgtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,e:GetHandler(),1,0,0)
end
function c101011068.tgop(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsRelateToEffect(e) then
Duel.SendtoGrave(e:GetHandler(),REASON_EFFECT)
end
end
--幻魔の肖像
--Scripted by mallu11
function c101011079.initial_effect(c)
--activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e1:SetCountLimit(1,101011079+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(c101011079.target)
e1:SetOperation(c101011079.activate)
c:RegisterEffect(e1)
end
function c101011079.cfilter1(c,e,tp)
return c:IsFaceup() and Duel.IsExistingMatchingCard(c101011079.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp,c:GetCode())
end
function c101011079.cfilter2(c,e,tp)
return c:IsFaceup() and Duel.IsExistingMatchingCard(c101011079.spfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp,c:GetCode())
end
function c101011079.cfilter(c,e,tp)
return c:IsFaceup() and Duel.IsExistingMatchingCard(c101011079.spfilter,tp,LOCATION_DECK+LOCATION_EXTRA,0,1,nil,e,tp,c:GetCode())
end
function c101011079.spfilter(c,e,tp,code)
return c:IsCode(code) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c101011079.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local mz=Duel.GetLocationCount(tp,LOCATION_MZONE)
local ez=Duel.GetLocationCountFromEx(tp)
local b1=Duel.IsExistingTarget(c101011079.cfilter1,tp,0,LOCATION_MZONE,1,nil,e,tp) and mz>0
local b2=Duel.IsExistingTarget(c101011079.cfilter2,tp,0,LOCATION_MZONE,1,nil,e,tp) and ez>0
if chkc then return chkc:IsLocation(LOCATION_MZONE) and c:IsControler(1-tp) and c101011079.cfilter(chkc,e,tp) end
if chk==0 then return b1 or b2 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_OPPO)
local g=Duel.SelectTarget(tp,c101011079.cfilter,tp,0,LOCATION_MZONE,1,1,nil,e,tp)
local tc=g:GetFirst()
local d1=Duel.IsExistingMatchingCard(c101011079.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp,tc:GetCode())
local d2=Duel.IsExistingMatchingCard(c101011079.spfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp,tc:GetCode())
if d1 and not d2 then
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
if not d1 and d2 then
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
if bit.band(tc:GetType(),TYPE_FUSION+TYPE_SYNCHRO+TYPE_XYZ+TYPE_LINK+TYPE_PENDULUM)==TYPE_PENDULUM then
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK+LOCATION_EXTRA)
end
end
function c101011079.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
local mz=Duel.GetLocationCount(tp,LOCATION_MZONE)
local ez=Duel.GetLocationCountFromEx(tp)
if tc:IsFaceup() and tc:IsRelateToEffect(e) then
local code=tc:GetCode()
local d1=Duel.IsExistingMatchingCard(c101011079.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp,code)
local d2=Duel.IsExistingMatchingCard(c101011079.spfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp,code)
if (bit.band(tc:GetType(),TYPE_FUSION+TYPE_SYNCHRO+TYPE_XYZ+TYPE_LINK+TYPE_PENDULUM)==TYPE_PENDULUM
and ((d1 and mz>0) or (d2 and ez>0))) or (d1 and not d2 and mz>0) or (not d1 and d2 and ez>0) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.GetMatchingGroup(c101011079.spfilter,tp,LOCATION_DECK+LOCATION_EXTRA,0,nil,e,tp,code)
if mz<=0 then
g=g:Filter(Card.IsLocation,nil,LOCATION_EXTRA)
end
if ez<=0 then
g=g:Filter(Card.IsLocation,nil,LOCATION_DECK)
end
local sg=g:Select(tp,1,1,nil)
local sc=sg:GetFirst()
if sc and Duel.SpecialSummon(sc,0,tp,tp,false,false,POS_FACEUP)~=0 then
sc:RegisterFlagEffect(101011079,RESET_EVENT+RESETS_STANDARD,0,1)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetCountLimit(1)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetLabel(Duel.GetTurnCount()+1)
e1:SetLabelObject(sc)
e1:SetCondition(c101011079.tdcon)
e1:SetOperation(c101011079.tdop)
Duel.RegisterEffect(e1,tp)
end
end
end
if e:IsHasType(EFFECT_TYPE_ACTIVATE) then
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetTargetRange(1,0)
e2:SetTarget(c101011079.splimit)
e2:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e2,tp)
end
end
function c101011079.tdcon(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject()
if tc:GetFlagEffect(101011079)~=0 then
return Duel.GetTurnCount()==e:GetLabel()
else
e:Reset()
return false
end
end
function c101011079.tdop(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject()
Duel.SendtoDeck(tc,nil,2,REASON_EFFECT)
end
function c101011079.splimit(e,c)
return c:IsLocation(LOCATION_DECK) or c:IsLocation(LOCATION_EXTRA)
end
--ヘッド・ジャッジング
--Scripted by mallu11
function c101011080.initial_effect(c)
--activate
local e0=Effect.CreateEffect(c)
e0:SetDescription(aux.Stringid(101011080,0))
e0:SetType(EFFECT_TYPE_ACTIVATE)
e0:SetCode(EVENT_FREE_CHAIN)
e0:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e0:SetCondition(c101011080.condition)
c:RegisterEffect(e0)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(101011080,1))
e1:SetCategory(CATEGORY_COIN+CATEGORY_NEGATE+CATEGORY_CONTROL)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_CHAINING)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
e1:SetCountLimit(1,101011080)
e1:SetCondition(c101011080.negcon)
e1:SetTarget(c101011080.negtg)
e1:SetOperation(c101011080.negop)
c:RegisterEffect(e1)
--negate
local e2=e1:Clone()
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetRange(LOCATION_SZONE)
c:RegisterEffect(e2)
end
c101011080.toss_coin=true
function c101011080.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase()~=PHASE_DAMAGE and Duel.GetCurrentPhase()~=PHASE_DAMAGE_CAL
end
function c101011080.negcon(e,tp,eg,ep,ev,re,r,rp)
return re:GetHandler():IsOnField() and re:GetHandler():IsRelateToEffect(re) and re:IsActiveType(TYPE_MONSTER)
and Duel.IsChainNegatable(ev) and re:GetHandler():IsControlerCanBeChanged()
end
function c101011080.negtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local p=re:GetHandlerPlayer()
Duel.SetOperationInfo(0,CATEGORY_COIN,nil,0,p,1)
Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_CONTROL,eg,1,0,0)
end
function c101011080.negop(e,tp,eg,ep,ev,re,r,rp)
local p=re:GetHandlerPlayer()
Duel.Hint(HINT_SELECTMSG,p,HINTMSG_COIN)
local coin=Duel.AnnounceCoin(p)
local res=Duel.TossCoin(p,1)
if coin==res and Duel.NegateActivation(ev) and re:GetHandler():IsRelateToEffect(re) then
Duel.GetControl(re:GetHandler(),1-p)
end
end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment