Commit 9a5925c7 authored by Tachibana's avatar Tachibana

E

parent 2c2cbb79
Pipeline #15461 passed with stages
in 30 minutes and 19 seconds
No preview for this file type
--亲卫队长 玉三郎
function c10070016.initial_effect(c)
--synchro summon
aux.AddSynchroProcedure(c,nil,aux.NonTuner(Card.IsSetCard,0x502),1)
c:EnableReviveLimit()
--SpecialSummon deck
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(10070016,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCondition(c10070016.spdcon)
e1:SetTarget(c10070016.spdtg)
e1:SetOperation(c10070016.spdop)
c:RegisterEffect(e1)
--SpecialSummon gave
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_GRAVE)
e2:SetCost(aux.bfgcost)
e2:SetTarget(c10070016.spgtg)
e2:SetOperation(c10070016.spgop)
c:RegisterEffect(e2)
end
function c10070016.spdcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_SYNCHRO)
end
function c10070016.spdfilter(c,e,tp)
return c:IsSetCard(0x501) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c10070016.spdtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c10070016.spdfilter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function c10070016.spdop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c10070016.spdfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
e:SetLabelObject(g:GetFirst())
local lv=e:GetLabelObject():GetLevel()
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_LEVEL)
if e:GetLabel()==0 then
e1:SetValue(-lv)
end
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE)
c:RegisterEffect(e1)
end
end
function c10070016.spgfilter(c,e,tp)
return c:IsSetCard(0x501) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c10070016.spgtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c10070016.spgfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE)
end
function c10070016.spgop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c10070016.spgfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
if g:GetCount()>0 then local tc=g:GetFirst()
if tc and Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e2)
end
end
Duel.SpecialSummonComplete()
end
end
\ No newline at end of file
--快乐的夏天 千代
c10070107.dfc_front_side=10070107
c10070107.dfc_back_side=10070108
function c10070107.initial_effect(c)
--link summon
c:EnableReviveLimit()
aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsLinkType,TYPE_EFFECT),3,4,c10070107.lcheck)
--changecode
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetCode(EFFECT_CHANGE_CODE)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e0:SetValue(10070100)
e0:SetRange(LOCATION_MZONE)
e0:SetCondition(c10070107.condition)
c:RegisterEffect(e0)
--Remove
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_REMOVE)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCountLimit(1,10070107)
e1:SetCondition(c10070107.rmcon)
e1:SetTarget(c10070107.rmtg)
e1:SetOperation(c10070107.rmop)
c:RegisterEffect(e1)
--xiao shou
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(10070107,0))
e2:SetCategory(CATEGORY_REMOVE)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,10070207)
e2:SetCondition(c10070107.con1)
e2:SetTarget(c10070107.xstg)
e2:SetOperation(c10070107.xsop)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCondition(c10070107.con2)
e3:SetCost(c10070107.xscost)
c:RegisterEffect(e3)
--battle indes
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e4:SetRange(LOCATION_MZONE)
e4:SetCode(EFFECT_INDESTRUCTABLE_COUNT)
e4:SetCountLimit(1)
e4:SetValue(c10070107.valcon)
c:RegisterEffect(e4)
--henshin
local e5=Effect.CreateEffect(c)
e5:SetDescription(aux.Stringid(10070107,1))
e5:SetCategory(CATEGORY_REMOVE)
e5:SetType(EFFECT_TYPE_IGNITION)
e5:SetRange(LOCATION_MZONE)
e5:SetOperation(c10070107.hsop)
c:RegisterEffect(e5)
end
function c10070107.lcheck(g)
return g:IsExists(Card.IsLinkSetCard,1,nil,0x500)
end
--code
function c10070107.condition(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsFaceup() and c:IsLocation(LOCATION_MZONE)
end
--remove
function c10070107.rmcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_LINK)
end
function c10070107.rmtg(e,tp,eg,ep,ev,re,r,rp,chk)
local ct=4
local tg=Duel.GetDecktopGroup(1-tp,ct)
if chk==0 then return ct>0
and tg:FilterCount(Card.IsAbleToRemove,nil,tp,POS_FACEDOWN)==ct end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,ct,1-tp,LOCATION_DECK)
end
function c10070107.rmop(e,tp,eg,ep,ev,re,r,rp)
local tg=Duel.GetDecktopGroup(1-tp,4)
Duel.DisableShuffleCheck()
Duel.Remove(tg,POS_FACEDOWN,REASON_EFFECT)
end
--xiao shou
function c10070107.con1(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsPlayerAffectedByEffect(tp,10070022)
end
function c10070107.con2(e,tp,eg,ep,ev,re,r,rp)
return not Duel.IsPlayerAffectedByEffect(tp,10070022)
end
function c10070107.xscost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,1,nil) end
Duel.DiscardHand(tp,Card.IsDiscardable,1,1,REASON_COST+REASON_DISCARD)
end
function c10070107.xstg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,0,LOCATION_HAND,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,tp,LOCATION_HAND)
end
function c10070107.xsop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(Card.IsAbleToRemove,tp,0,LOCATION_HAND,nil)
if g:GetCount()>0 then
local sg=g:RandomSelect(tp,1)
Duel.Remove(sg,POS_FACEDOWN,REASON_EFFECT)
end
end
--indes
function c10070107.valcon(e,re,r,rp)
return bit.band(r,REASON_BATTLE+REASON_EFFECT)~=0
end
--henshin
function c10070107.hsop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tcode=c.dfc_back_side
c:SetEntityCode(tcode,true)
c:ReplaceEffect(tcode,0,0)
end
\ No newline at end of file
--元气满满的猫娘 千代
c10070108.dfc_front_side=10070107
c10070108.dfc_back_side=10070108
function c10070108.initial_effect(c)
c:EnableReviveLimit()
--changecode
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetCode(EFFECT_CHANGE_CODE)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e0:SetValue(10070100)
e0:SetRange(LOCATION_MZONE)
e0:SetCondition(c10070108.condition)
c:RegisterEffect(e0)
--negate
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(10070108,0))
e2:SetCategory(CATEGORY_NEGATE+CATEGORY_DESTROY)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_CHAINING)
e2:SetCountLimit(1,10070208)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
e2:SetRange(LOCATION_MZONE)
e2:SetCondition(c10070108.discon)
e2:SetTarget(c10070108.distg)
e2:SetOperation(c10070108.disop)
c:RegisterEffect(e2)
--Remove
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(10070108,1))
e3:SetCategory(CATEGORY_REMOVE)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetProperty(EFFECT_FLAG_NO_TURN_RESET)
e3:SetCountLimit(1,10070108)
e3:SetHintTiming(0,TIMING_END_PHASE)
e3:SetRange(LOCATION_MZONE)
e3:SetTarget(c10070108.rmtg)
e3:SetOperation(c10070108.rmop)
c:RegisterEffect(e3)
end
--SpecialSummon rule
function c10070108.sprfilter(c)
return c:IsFaceup() and c:IsOriginalCodeRule(10070007)
end
function c10070108.sprcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
local g=Duel.GetMatchingGroup(c10070108.sprfilter,tp,LOCATION_MZONE,0,nil)
return g:IsExists(c10070108.sprfilter,1,nil)
end
function c10070108.sprop(e,tp,eg,ep,ev,re,r,rp,c)
local g=Duel.GetMatchingGroup(c10070108.sprfilter,tp,LOCATION_MZONE,0,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_OPERATECARD)
local g1=g:FilterSelect(tp,c10070108.sprfilter,1,1,nil)
local mc=g1:GetFirst()
Duel.Overlay(e:GetHandler(),mc)
end
--code
function c10070108.condition(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsFaceup() and c:IsLocation(LOCATION_MZONE)
end
--NegateActivation
function c10070108.discon(e,tp,eg,ep,ev,re,r,rp)
return not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) and Duel.IsChainNegatable(ev)
end
function c10070108.spfilter(c,e,tp,ec)
return c:IsCode(10070007) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.GetMZoneCount(tp)>0
end
function c10070108.distg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0)
if re:GetHandler():IsDestructable() and re:GetHandler():IsRelateToEffect(re) then
Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,1,0,0)
end
end
function c10070108.disop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.NegateActivation(ev) and re:GetHandler():IsRelateToEffect(re) then
Duel.Destroy(eg,REASON_EFFECT)
end
local tcode=c.dfc_front_side
c:SetEntityCode(tcode,true)
c:ReplaceEffect(tcode,0,0)
end
--remove
function c10070108.rmtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,0,LOCATION_GRAVE,1,nil) end
end
function c10070108.rmop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,Card.IsAbleToRemove,tp,0,LOCATION_GRAVE,1,1,nil)
if g:GetCount()>0 then
Duel.Remove(g,POS_FACEDOWN,REASON_EFFECT)
end
end
\ No newline at end of file
--灵摆手续
local m=12029085
local cm=_G["c"..m]
Duel.LoadScript("c12000000.lua")
function cm.initial_effect(c)
--pendulum summon
aux.EnablePendulumAttribute(c,true)
--P Summon
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_PZONE)
e2:SetCountLimit(1,m)
e2:SetCondition(cm.pcon)
e2:SetTarget(cm.ptg)
e2:SetOperation(cm.ptop)
c:RegisterEffect(e2)
--only me
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e3:SetCode(m)
e3:SetRange(LOCATION_MZONE)
c:RegisterEffect(e3)
--P
local e4=Effect.CreateEffect(c)
e4:SetCategory(CATEGORY_SPECIAL_SUMMON)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e4:SetRange(LOCATION_PZONE)
e4:SetCode(EVENT_CUSTOM+m)
e4:SetProperty(EFFECT_FLAG_DELAY)
e4:SetOperation(cm.pop)
c:RegisterEffect(e4)
end
function cm.sumfilter(c)
return c:IsType(TYPE_PENDULUM) and c:IsFaceup()
end
function cm.PConditionFilter(c,e,tp,lscale,rscale,eset)
local lv=0
if c.pendulum_level then
lv=c.pendulum_level
else
lv=c:GetLevel()
end
local bool=Auxiliary.PendulumSummonableBool(c)
return (c:IsLocation(LOCATION_HAND) or (c:IsFaceup() and c:IsType(TYPE_PENDULUM)))
and lv>lscale and lv<rscale and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_PENDULUM,tp,bool,bool)
and not c:IsForbidden()
and (PENDULUM_CHECKLIST&(0x1<<tp)==0 or Auxiliary.PConditionExtraFilter(c,e,tp,lscale,rscale,eset))
end
function cm.pcon(e,tp,eg,ep,ev,re,r,rp)
if not PENDULUM_CHECKLIST then
PENDULUM_CHECKLIST=0
local ge1=Effect.GlobalEffect()
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_PHASE_START+PHASE_DRAW)
ge1:SetOperation(Auxiliary.PendulumReset)
Duel.RegisterEffect(ge1,0)
end
local eset={Duel.IsPlayerAffectedByEffect(tp,EFFECT_EXTRA_PENDULUM_SUMMON)}
local pg=Duel.GetMatchingGroup(nil,tp,LOCATION_PZONE,0,nil)
if pg:GetCount()~=2 then return false end
local cc=pg:GetFirst()
local lscale=cc:GetLeftScale()
local dc=pg:GetNext()
local rscale=dc:GetRightScale()
if lscale>rscale then
lscale=dc:GetRightScale()
rscale=cc:GetLeftScale()
end
if (lscale==rscale or lscale==rscale-1 or lscale==rscale+1) then return false end
local loc=0
local sc=Duel.GetMatchingGroup(cm.sumfilter,tp,LOCATION_EXTRA,0,nil):GetFirst()
if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then loc=loc+LOCATION_HAND end
if sc and Duel.GetLocationCountFromEx(tp,tp,nil,sc)>0 then loc=loc+LOCATION_EXTRA end
if loc==0 then return false end
local g=nil
if og then
g=og:Filter(Card.IsLocation,nil,loc)
else
g=Duel.GetFieldGroup(tp,loc,0)
end
return g:IsExists(cm.PConditionFilter,1,nil,e,tp,lscale,rscale,eset)
end
function cm.ptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local eset={Duel.IsPlayerAffectedByEffect(tp,EFFECT_EXTRA_PENDULUM_SUMMON)}
local pg=Duel.GetMatchingGroup(nil,tp,LOCATION_PZONE,0,nil)
if pg:GetCount()~=2 then return false end
local cc=pg:GetFirst()
local lscale=cc:GetLeftScale()
local dc=pg:GetNext()
local rscale=dc:GetRightScale()
if lscale>rscale then
lscale=dc:GetRightScale()
rscale=cc:GetLeftScale()
end
local loc=0
local sc=Duel.GetMatchingGroup(cm.sumfilter,tp,LOCATION_EXTRA,0,nil):GetFirst()
if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then loc=loc+LOCATION_HAND end
if sc and Duel.GetLocationCountFromEx(tp,tp,nil,sc)>0 then loc=loc+LOCATION_EXTRA end
local g=nil
if og then
g=og:Filter(Card.IsLocation,nil,loc)
else
g=Duel.GetFieldGroup(tp,loc,0)
end
local yg=g:Filter(cm.PConditionFilter,nil,e,tp,lscale,rscale,eset)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,yg,yg:GetCount(),tp,0)
end
function cm.ptop(e,tp,eg,ep,ev,re,r,rp)
Duel.RaiseEvent(e:GetHandler(),EVENT_CUSTOM+m,re,r,rp,ep,ev)
end
function cm.pop(e,tp,eg,ep,ev,re,r,rp,sg,og)
if not PENDULUM_CHECKLIST then
PENDULUM_CHECKLIST=0
local ge1=Effect.GlobalEffect()
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_PHASE_START+PHASE_DRAW)
ge1:SetOperation(Auxiliary.PendulumReset)
Duel.RegisterEffect(ge1,0)
end
local pg=Duel.GetMatchingGroup(nil,tp,LOCATION_PZONE,0,nil)
if pg:GetCount()~=2 then return end
local cc=pg:GetFirst()
local lscale=cc:GetLeftScale()
local dc=pg:GetNext()
local rscale=dc:GetRightScale()
if lscale>rscale then
lscale=dc:GetRightScale()
rscale=cc:GetLeftScale()
end
if (lscale==rscale or lscale==rscale-1 or lscale==rscale+1) then return end
local eset={Duel.IsPlayerAffectedByEffect(tp,EFFECT_EXTRA_PENDULUM_SUMMON)}
local tg=nil
local loc=0
local sc=Duel.GetMatchingGroup(cm.sumfilter,tp,LOCATION_EXTRA,0,nil):GetFirst()
local ft1=Duel.GetLocationCount(tp,LOCATION_MZONE)
local ft2=0
if sc then
ft2=Duel.GetLocationCountFromEx(tp,tp,nil,sc)
end
local ft=Duel.GetUsableMZoneCount(tp)
local ect=99
if c29724053 and Duel.IsPlayerAffectedByEffect(tp,29724053) then
ect=c29724053[tp]
end
if ect and ect<ft2 then ft2=ect end
if Duel.IsPlayerAffectedByEffect(tp,59822133) then
if ft1>0 then ft1=1 end
if ft2>0 then ft2=1 end
ft=1
end
if ft1>0 then loc=loc|LOCATION_HAND end
if ft2>0 then loc=loc|LOCATION_EXTRA end
if og then
tg=og:Filter(Card.IsLocation,nil,loc):Filter(cm.PConditionFilter,nil,e,tp,lscale,rscale,eset)
else
tg=Duel.GetMatchingGroup(cm.PConditionFilter,tp,loc,0,nil,e,tp,lscale,rscale,eset)
end
local ce=nil
local b1=PENDULUM_CHECKLIST&(0x1<<tp)==0
local b2=#eset>0
if b1 and b2 then
local options={1163}
for _,te in ipairs(eset) do
table.insert(options,te:GetDescription())
end
local op=Duel.SelectOption(tp,table.unpack(options))
if op>0 then
ce=eset[op]
end
elseif b2 and not b1 then
local options={}
for _,te in ipairs(eset) do
table.insert(options,te:GetDescription())
end
local op=Duel.SelectOption(tp,table.unpack(options))
ce=eset[op+1]
end
if ce then
tg=tg:Filter(aux.PConditionExtraFilterSpecific,nil,e,tp,lscale,rscale,ce)
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
Auxiliary.GCheckAdditional=Auxiliary.PendOperationCheck(ft1,ft2,ft)
local g=tg:SelectSubGroup(tp,aux.TRUE,true,1,math.min(#tg,ft))
Auxiliary.GCheckAdditional=nil
if not g then return end
if ce then
Duel.Hint(HINT_CARD,0,ce:GetOwner():GetOriginalCode())
ce:Reset()
end
local lpz=Duel.GetFieldCard(tp,LOCATION_PZONE,0)
local rpz=Duel.GetFieldCard(tp,LOCATION_PZONE,1)
Duel.HintSelection(Group.FromCards(lpz))
Duel.HintSelection(Group.FromCards(rpz))
local spg=Group.CreateGroup()
for tc in aux.Next(g) do
local bool=aux.PendulumSummonableBool(tc)
if Duel.SpecialSummonStep(tc,SUMMON_TYPE_PENDULUM,tp,tp,bool,bool,POS_FACEUP) then spg:AddCard(tc) end
end
Duel.SpecialSummonComplete()
for tc in aux.Next(g) do tc:CompleteProcedure() end
if spg:GetCount()~=0 then
Duel.RaiseEvent(e:GetHandler(),EVENT_CUSTOM+m+100,re,r,rp,ep,ev)
end
end
\ No newline at end of file
--Tama & Amarillo
local m=13255411
local cm=_G["c"..m]
xpcall(function() require("expansions/script/tama") end,function() require("script/tama") end)
function cm.initial_effect(c)
--cannot special summon
local e1=Effect.CreateEffect(c)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SPSUMMON_CONDITION)
e1:SetValue(aux.FALSE)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,0))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_HAND)
e2:SetCost(cm.spcost)
e2:SetTarget(cm.sptg)
e2:SetOperation(cm.spop)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,1))
e3:SetCategory(CATEGORY_ATKCHANGE)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1)
e3:SetCost(cm.cost)
e3:SetOperation(cm.operation)
c:RegisterEffect(e3)
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetCode(EFFECT_CHANGE_BATTLE_DAMAGE)
e4:SetCondition(cm.damcon)
e4:SetValue(aux.ChangeBattleDamage(1,DOUBLE_DAMAGE))
c:RegisterEffect(e4)
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_SINGLE)
e5:SetCode(EFFECT_PIERCE)
c:RegisterEffect(e5)
elements={{"tama_elements",{{TAMA_ELEMENT_WIND,1},{TAMA_ELEMENT_ENERGY,1},{TAMA_ELEMENT_LIFE,1}}}}
cm[c]=elements
end
function cm.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local ct=math.floor(Duel.GetLP(tp)/2)
Duel.PayLPCost(tp,ct)
e:SetLabel(ct)
end
function cm.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,true,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 or not c:IsRelateToEffect(e) then return end
if Duel.SpecialSummon(c,0,tp,tp,true,false,POS_FACEUP)~=0 then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(e:GetLabel())
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE)
c:RegisterEffect(e1)
c:CompleteProcedure()
end
end
function cm.rfilter(c)
return c:IsAbleToGraveAsCost() and c:IsType(TYPE_MONSTER)
end
function cm.rfilter1(c,code)
return code==0 or c:IsCode(code)
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.rfilter,tp,LOCATION_DECK+LOCATION_HAND+LOCATION_MZONE,0,1,nil) end
local code=0
local g1=Duel.GetMatchingGroup(cm.rfilter,tp,LOCATION_MZONE,0,e:GetHandler())
local g2=Duel.GetMatchingGroup(cm.rfilter,tp,LOCATION_HAND,0,nil)
local g3=Duel.GetMatchingGroup(cm.rfilter,tp,LOCATION_DECK,0,nil)
local sg=Group.CreateGroup()
if g1:GetCount()>0 and g1:IsExists(cm.rfilter1,1,nil,code) and ((g2:GetCount()==0 and g3:GetCount()==0) or Duel.SelectYesNo(tp,aux.Stringid(m,2))) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local sg1=g1:FilterSelect(tp,cm.rfilter1,1,1,nil,code)
if code==0 then code=sg1:GetFirst():GetCode() end
Duel.HintSelection(sg1)
sg:Merge(sg1)
end
if g2:GetCount()>0 and g2:IsExists(cm.rfilter1,1,nil,code) and ((sg:GetCount()==0 and g3:GetCount()==0) or Duel.SelectYesNo(tp,aux.Stringid(m,3))) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local sg2=g2:FilterSelect(tp,cm.rfilter1,1,1,nil,code)
if code==0 then code=sg1:GetFirst():GetCode() end
Duel.HintSelection(sg2)
sg:Merge(sg2)
end
if g3:GetCount()>0 and g3:IsExists(cm.rfilter1,1,nil,code) and (sg:GetCount()==0 or Duel.SelectYesNo(tp,aux.Stringid(m,4))) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local sg3=g3:FilterSelect(tp,cm.rfilter1,1,1,nil,code)
Duel.HintSelection(sg3)
sg:Merge(sg3)
end
local ct=Duel.SendtoGrave(sg,REASON_COST)
local atk=0
local def=0
if ct>0 then
atk=sg:GetFirst():GetTextAttack()
def=sg:GetFirst():GetTextDefense()
end
e:SetLabel(ct,atk,def)
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,0,LOCATION_MZONE,nil)
local ct,atk,def=e:GetLabel()
if g:GetCount()==0 then return end
local sc=g:GetFirst()
while sc do
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
e1:SetValue(-atk)
sc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_UPDATE_DEFENSE)
e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
e2:SetValue(-def)
sc:RegisterEffect(e2)
sc=g:GetNext()
end
if c:IsRelateToEffect(e) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_EXTRA_ATTACK)
e1:SetValue(ct)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
c:RegisterEffect(e1)
end
end
function cm.damcon(e)
return e:GetHandler():GetBattleTarget()~=nil
end
--伪宇宙战争机器-日珥龙
local m=13257251
local cm=_G["c"..m]
xpcall(function() require("expansions/script/tama") end,function() require("script/tama") end)
function cm.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e1:SetRange(LOCATION_HAND)
e1:SetCondition(cm.spcon)
c:RegisterEffect(e1)
--damage
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,0))
e2:SetCategory(CATEGORY_DAMAGE)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetCode(EVENT_PHASE+PHASE_END)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1)
e2:SetCondition(cm.damcon)
e2:SetTarget(cm.damtg)
e2:SetOperation(cm.damop)
c:RegisterEffect(e2)
--special summon
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,1))
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCode(EVENT_DESTROYED)
e3:SetCondition(cm.condition)
e3:SetTarget(cm.target)
e3:SetOperation(cm.operation)
c:RegisterEffect(e3)
end
function cm.spcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
return Duel.IsExistingMatchingCard(Card.IsFaceup,tp,LOCATION_FZONE,LOCATION_FZONE,1,nil)
end
function cm.damcon(e,tp,eg,ep,ev,re,r,rp)
return tp==Duel.GetTurnPlayer()
end
function cm.damtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetTargetPlayer(1-tp)
Duel.SetTargetParam(500)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,500)
end
function cm.damop(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Damage(p,d,REASON_EFFECT)
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return bit.band(r,REASON_EFFECT+REASON_BATTLE)~=0
end
function cm.spfilter(c,e,tp)
return c:IsCode(m) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
local t1=Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_HAND+LOCATION_GRAVE+LOCATION_DECK,0,1,nil,e,tp)
local t2=Duel.GetMatchingGroup(aux.TRUE,tp,0,LOCATION_ONFIELD,nil)>0
if chk==0 then return t1 or t2 end
local op=0
local m={}
local n={}
local ct=1
if t1 then m[ct]=aux.Stringid(m,2) n[ct]=1 ct=ct+1 end
if t2 then m[ct]=aux.Stringid(m,3) n[ct]=2 ct=ct+1 end
local sp=Duel.SelectOption(tp,table.unpack(m))
op=n[sp+1]
e:SetLabel(op)
if op==1 then
e:SetCategory(CATEGORY_SPECIAL_SUMMON)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_GRAVE+LOCATION_DECK)
elseif op==2 then
e:SetCategory(CATEGORY_DESTROY)
local g=Duel.GetMatchingGroup(aux.TRUE,tp,0,LOCATION_ONFIELD,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if e:GetLabel()==1 then
local ct=3
if Duel.IsPlayerAffectedByEffect(tp,59822133) then ct=1 end
ct=math.min(ct,(Duel.GetLocationCount(tp,LOCATION_MZONE)))
if ct<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cm.spfilter),tp,LOCATION_HAND+LOCATION_GRAVE+LOCATION_DECK,0,1,ct,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummonStep(t1,0,tp,tp,false,false,POS_FACEUP)
for tc in aux.Next(g) do
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK)
e1:SetValue(1500)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1,true)
local e2=e1:Clone()
e2:SetCode(EFFECT_SET_DEFENSE)
e2:SetValue(1000)
tc:RegisterEffect(e2,true)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_LEAVE_FIELD_REDIRECT)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e3:SetReset(RESET_EVENT+RESETS_REDIRECT)
e3:SetValue(LOCATION_REMOVED)
tc:RegisterEffect(e3,true)
end
Duel.SpecialSummonComplete()
end
elseif e:GetLabel()==2 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectMatchingCard(tp,aux.TRUE,tp,0,LOCATION_ONFIELD,1,3,nil)
if g:GetCount()>0 then
Duel.HintSelection(g)
Duel.Destroy(g,REASON_EFFECT)
end
end
end
--伪宇宙战争机器-胃酸龙
local m=13257252
local cm=_G["c"..m]
xpcall(function() require("expansions/script/tama") end,function() require("script/tama") end)
function cm.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e1:SetRange(LOCATION_HAND)
e1:SetCondition(cm.spcon)
c:RegisterEffect(e1)
--damage
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,0))
e2:SetCategory(CATEGORY_DAMAGE)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetCode(EVENT_PHASE+PHASE_END)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1)
e2:SetCondition(cm.damcon)
e2:SetTarget(cm.damtg)
e2:SetOperation(cm.damop)
c:RegisterEffect(e2)
--destroy
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,1))
e3:SetCategory(CATEGORY_DESTROY+CATEGORY_TOHAND)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1,m)
e3:SetTarget(cm.destg)
e3:SetOperation(cm.desop)
c:RegisterEffect(e3)
end
function cm.spcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
return Duel.IsExistingMatchingCard(Card.IsFaceup,tp,LOCATION_FZONE,LOCATION_FZONE,1,nil)
end
function cm.damcon(e,tp,eg,ep,ev,re,r,rp)
return tp==Duel.GetTurnPlayer()
end
function cm.damtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetTargetPlayer(1-tp)
Duel.SetTargetParam(500)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,500)
end
function cm.damop(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Damage(p,d,REASON_EFFECT)
end
function cm.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and chkc:IsFaceup() end
if chk==0 then return Duel.IsExistingTarget(Card.IsFaceup,tp,LOCATION_MZONE,0,1,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,Card.IsFaceup,tp,LOCATION_MZONE,0,1,1,e:GetHandler())
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function cm.desop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.Destroy(tc,REASON_EFFECT)~=0 then
local g=Duel.GetMatchingGroup(Card.IsAbleToHand,tp,LOCATION_ONFIELD,0,nil)
if g:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(m,2)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local sg=g:Select(tp,1,1,nil)
if sg:GetCount()>0 then
Duel.HintSelection(sg)
Duel.SendtoHand(sg,nil,REASON_EFFECT)
end
end
end
end
--伪宇宙战争机器-不死之炎鸟
local m=13257253
local cm=_G["c"..m]
xpcall(function() require("expansions/script/tama") end,function() require("script/tama") end)
function cm.initial_effect(c)
--summon with no tribute
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SUMMON_PROC)
e1:SetCondition(cm.ntcon)
c:RegisterEffect(e1)
--change level
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_SUMMON_COST)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetOperation(cm.lvop)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,1))
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCode(EVENT_DESTROYED)
e3:SetCondition(cm.condition)
e3:SetTarget(cm.target)
e3:SetOperation(cm.operation)
c:RegisterEffect(e3)
--recover
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(m,2))
e4:SetCategory(CATEGORY_RECOVER)
e4:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e4:SetCode(EVENT_BATTLE_DAMAGE)
e4:SetCondition(cm.reccon)
e4:SetTarget(cm.rectg)
e4:SetOperation(cm.recop)
c:RegisterEffect(e4)
end
function cm.lvcon(e)
return e:GetHandler():GetMaterialCount()==0
end
function cm.lvop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_BASE_ATTACK)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetCondition(cm.lvcon)
e1:SetValue(1200)
e1:SetReset(RESET_EVENT+0xff0000)
c:RegisterEffect(e1)
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return bit.band(r,REASON_EFFECT+REASON_BATTLE)~=0
end
function cm.filter(c)
return c:IsSetCard(0x353) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_DECK,0,2,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,2,tp,LOCATION_DECK)
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local sg=Duel.GetMatchingGroup(cm.filter,tp,LOCATION_DECK,0,nil)
if sg:GetCount()<2 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=sg:Select(tp,2,2,nil)
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
function cm.reccon(e,tp,eg,ep,ev,re,r,rp)
return ep~=tp
end
function cm.rectg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(ev)
Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,ev)
end
function cm.recop(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Recover(p,d,REASON_EFFECT)
end
--伪宇宙战争机器-巨脑怪
local m=13257254
local cm=_G["c"..m]
xpcall(function() require("expansions/script/tama") end,function() require("script/tama") end)
function cm.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1)
e1:SetCondition(cm.condition)
e1:SetTarget(cm.target)
e1:SetOperation(cm.operation)
c:RegisterEffect(e1)
--disable
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetRange(LOCATION_MZONE)
e2:SetCode(EFFECT_DISABLE)
e2:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e2:SetTarget(cm.distg)
c:RegisterEffect(e2)
--draw
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,1))
e3:SetCategory(CATEGORY_TODECK+CATEGORY_DRAW)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1)
e3:SetCost(cm.drcost)
e3:SetTarget(cm.drtg)
e3:SetOperation(cm.drop)
c:RegisterEffect(e3)
local e12=Effect.CreateEffect(c)
e12:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e12:SetCode(EVENT_SUMMON_SUCCESS)
e12:SetOperation(cm.bgmop)
c:RegisterEffect(e12)
local e13=e12:Clone()
e13:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e13)
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)==0
end
function cm.target(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 cm.operation(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsRelateToEffect(e) then
Duel.SpecialSummon(e:GetHandler(),0,tp,tp,false,false,POS_FACEUP)
end
end
function cm.distg(e,c)
return c:IsAttribute(ATTRIBUTE_LIGHT) and c:IsType(TYPE_EFFECT)
end
function cm.filter(c)
return c:IsSetCard(0x353) and c:IsType(TYPE_MONSTER) and c:IsAbleToDeck()
end
function cm.drcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():GetAttackAnnouncedCount()==0 end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_OATH)
e1:SetCode(EFFECT_CANNOT_ATTACK_ANNOUNCE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
e:GetHandler():RegisterEffect(e1)
end
function cm.drtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and cm.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(cm.filter,tp,LOCATION_GRAVE,0,3,nil) and Duel.IsPlayerCanDraw(tp,1) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectTarget(tp,cm.filter,tp,LOCATION_GRAVE,0,3,3,nil)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,3,0,0)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end
function cm.drop(e,tp,eg,ep,ev,re,r,rp)
local tg=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
if not tg or tg:FilterCount(Card.IsRelateToEffect,nil,e)~=3 then return end
Duel.SendtoDeck(tg,nil,0,REASON_EFFECT)
local g=Duel.GetOperatedGroup()
if g:IsExists(Card.IsLocation,1,nil,LOCATION_DECK) then Duel.ShuffleDeck(tp) end
local ct=g:FilterCount(Card.IsLocation,nil,LOCATION_DECK+LOCATION_EXTRA)
if ct==3 then
Duel.BreakEffect()
Duel.Draw(tp,1,REASON_EFFECT)
end
end
function cm.bgmop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_MUSIC,0,aux.Stringid(m,4))
end
--解放的少女·萝夏
local s,id,o=GetID()
function c17033080.initial_effect(c)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(2)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetTarget(s.sptg)
e1:SetOperation(s.spop)
c:RegisterEffect(e1)
--recover
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetRange(LOCATION_MZONE)
e2:SetCode(EVENT_MOVE)
e2:SetOperation(s.recop)
c:RegisterEffect(e2)
--
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EVENT_BE_MATERIAL)
e3:SetProperty(EFFECT_FLAG_EVENT_PLAYER)
e3:SetCondition(s.immcon)
e3:SetOperation(s.immop)
c:RegisterEffect(e3)
end
function s.cfilter(c,mc)
return c:IsCode(mc:GetCode()) and c:IsFaceup()
end
function s.spfilter(c,e,tp)
return c:IsType(TYPE_TUNER) and c:IsRace(RACE_PSYCHO) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE)
and not Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_MZONE,0,1,nil,c)
end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(s.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)
end
function s.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<1 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_HAND+LOCATION_DECK,0,1,1,nil,e,tp)
if g:GetCount()>0 then
if g:GetFirst():GetCode()==17033090 then Duel.RegisterFlagEffect(tp,17033080,RESET_PHASE+PHASE_END,EFFECT_FLAG_OATH,1) end
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP_DEFENSE)
end
end
function s.sdfilter1(c,tp)
return c:IsControler(tp) and c:IsPreviousLocation(LOCATION_DECK)
end
function s.sdfilter2(c,tp)
return c:IsControler(tp) and c:IsLocation(LOCATION_DECK)
end
function s.recop(e,tp,eg,ep,ev,re,r,rp)
local ct=Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)
local et1=eg:FilterCount(s.sdfilter1,nil,tp)
local et2=eg:FilterCount(s.sdfilter2,nil,tp)
if et1==0 and et2==0 then return end
local at=ct
if et1>0 then at=at+et1 end
if et2>0 then at=at-et2 end
if ct%2==0 and at%2~=0 then
Duel.Hint(HINT_CARD,0,17033080)
Duel.Hint(HINT_SOUND,0,aux.Stringid(17033080,5))
Duel.Recover(tp,600,REASON_EFFECT)
end
end
function s.immcon(e,tp,eg,ep,ev,re,r,rp)
return r==REASON_SYNCHRO and Duel.GetFlagEffect(tp,17033080)>0
end
function s.immop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local rc=c:GetReasonCard()
--recover
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(17033080,6))
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetProperty(EFFECT_FLAG_CLIENT_HINT+EFFECT_FLAG_DELAY)
e2:SetRange(LOCATION_MZONE)
e2:SetCode(EVENT_MOVE)
e2:SetOperation(s.recop)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
rc:RegisterEffect(e2,true)
end
\ No newline at end of file
--勇气的少年·卡西姆
local s,id,o=GetID()
function c17033090.initial_effect(c)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(1105)
e1:SetCategory(CATEGORY_TODECK)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetTarget(s.tdtg)
e1:SetOperation(s.tdop)
c:RegisterEffect(e1)
--damage
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetRange(LOCATION_MZONE)
e2:SetCode(EVENT_MOVE)
e2:SetOperation(s.recop)
c:RegisterEffect(e2)
--
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EVENT_BE_MATERIAL)
e3:SetProperty(EFFECT_FLAG_EVENT_PLAYER)
e3:SetCondition(s.immcon)
e3:SetOperation(s.immop)
c:RegisterEffect(e3)
--code
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e4:SetCode(EVENT_SPSUMMON_SUCCESS)
e4:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e4:SetOperation(s.regop1)
c:RegisterEffect(e4)
--search
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e5:SetCode(EVENT_LEAVE_FIELD_P)
e5:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e5:SetOperation(s.regop2)
c:RegisterEffect(e5)
end
function s.tdtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToDeck,tp,LOCATION_HAND,0,1,e:GetHandler()) end
Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,1,tp,LOCATION_HAND)
end
function s.tdop(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectMatchingCard(tp,Card.IsAbleToDeck,tp,LOCATION_HAND,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoDeck(g,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetCategory(CATEGORY_DRAW+CATEGORY_HANDES)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetCountLimit(1)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetOperation(s.drop)
Duel.RegisterEffect(e1,tp)
end
end
function s.drop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,0,17033090)
Duel.Draw(tp,1,REASON_EFFECT)
Duel.ShuffleHand(tp)
end
function s.sdfilter1(c,tp)
return c:IsControler(tp) and c:IsPreviousLocation(LOCATION_DECK)
end
function s.sdfilter2(c,tp)
return c:IsControler(tp) and c:IsLocation(LOCATION_DECK)
end
function s.recop(e,tp,eg,ep,ev,re,r,rp)
local ct=Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)
local et1=eg:FilterCount(s.sdfilter1,nil,tp)
local et2=eg:FilterCount(s.sdfilter2,nil,tp)
if et1==0 and et2==0 then return end
local at=ct
if et1>0 then at=at+et1 end
if et2>0 then at=at-et2 end
if ct%2==0 and at%2~=0 then
Duel.Hint(HINT_CARD,0,17033090)
Duel.Hint(HINT_SOUND,0,aux.Stringid(17033090,5))
Duel.Damage(1-tp,400,REASON_EFFECT)
end
end
function s.regop1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if re:GetHandler():IsCode(17033080) then
e:GetHandler():RegisterFlagEffect(17033090,RESET_PHASE+PHASE_END,0,1)
end
end
function s.regop2(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():GetFlagEffect(17033090)>0 then
e:GetHandler():RegisterFlagEffect(17033091,RESET_EVENT+RESET_TOFIELD+RESET_PHASE+PHASE_END,0,1)
end
end
function s.immcon(e,tp,eg,ep,ev,re,r,rp)
return r==REASON_SYNCHRO and e:GetHandler():GetFlagEffect(17033091)>0
end
function s.immop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local rc=c:GetReasonCard()
--recover
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(17033090,6))
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetProperty(EFFECT_FLAG_CLIENT_HINT+EFFECT_FLAG_DELAY)
e2:SetRange(LOCATION_MZONE)
e2:SetCode(EVENT_MOVE)
e2:SetOperation(s.recop)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
rc:RegisterEffect(e2,true)
end
\ No newline at end of file
--机构翼少女·萝夏
local s,id,o=GetID()
function c17033100.initial_effect(c)
--to hand
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetTarget(s.target)
e1:SetOperation(s.activate)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e2)
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
local ct=Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)
local b1=ct%2~=0 and Duel.IsPlayerCanDraw(tp,1)
local b2=ct%2==0
if chk==0 then return true end
if b1 then
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local ct=Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)
if ct%2~=0 and Duel.IsPlayerCanDraw(tp,1) then
Duel.Draw(tp,1,REASON_EFFECT)
else
--synchro level
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_SYNCHRO_LEVEL)
e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e3:SetRange(LOCATION_MZONE)
e3:SetValue(s.slevel)
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_GRANT)
e4:SetTargetRange(LOCATION_MZONE,0)
e4:SetLabelObject(e3)
e4:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e4,tp)
end
end
function s.slevel(e,c)
local lv=aux.GetCappedLevel(e:GetHandler())
return (6<<16)+lv
end
--小白兔 Δ
if not pcall(function() require("expansions/script/c31300100") end) then require("script/c31300100") end
local m,cm = rscf.DefineCard(31300016)
function cm.initial_effect(c)
local e1 = rsef.FTO(c,EVENT_TO_HAND,"dr",{1,m},"dr","ptg",
cm.drcon,cm.drcost,rsop.target(1,"dr"),cm.drop)
local e2= rsef.QO(c,EVENT_CHAINING,"sp",{1,m + 100},"sp",nil,
LOCATION_GRAVE,cm.spscon,nil,
rsop.target(rscf.spfilter2(),"sp"),cm.spsop)
end
function cm.drcon(e,tp,eg)
return eg:IsExists(cm.cfilter,1,e:GetHandler())
end
function cm.cfilter(c)
return c:IsType(TYPE_TUNER) and not c:IsPublic()
end
function cm.drcost(e,tp,eg,ep,ev,re,r,rp,chk)
local c = e:GetHandler()
local cg = eg:Filter(cm.cfilter,c)
if chk == 0 then return not c:IsPublic() and #cg > 0 end
cg:AddCard(c)
for tc in aux.Next(cg) do
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_PUBLIC)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
end
end
function cm.drop(e,tp)
local p,d = Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Draw(p,d,REASON_EFFECT)
end
function cm.spscon(e,tp,eg,ep,ev,re,r,rp,chk)
local loc , ap = Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_LOCATION,CHAININFO_TRIGGERING_PLAYER)
return re:IsHasCategory(CATEGORY_SPECIAL_SUMMON) and ap == tp and loc & (LOCATION_HAND+LOCATION_ONFIELD) ~= 0
end
function cm.spsop(e,tp)
local c = rscf.GetSelf(e)
if not c or Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP) <=0 then return end
c:RegisterFlagEffect(m,rsrst.std,0,1)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_CHAIN_END)
e1:SetCondition(cm.tdcon2)
e1:SetOperation(cm.tdop2)
e1:SetLabelObject(c)
Duel.RegisterEffect(e1,tp)
end
\ No newline at end of file
--小白兔 Δ
if not pcall(function() require("expansions/script/c31300100") end) then require("script/c31300100") end
local m,cm = rscf.DefineCard(31300016)
function cm.initial_effect(c)
local e1 = rsef.FTO(c,EVENT_TO_HAND,"dr",{1,m},"dr","ptg",
cm.drcon,cm.drcost,rsop.target(1,"dr"),cm.drop)
local e2= rsef.QO(c,EVENT_CHAINING,"sp",{1,m + 100},"sp",nil,
LOCATION_GRAVE,cm.spscon,nil,
rsop.target(rscf.spfilter2(),"sp"),cm.spsop)
end
function cm.drcon(e,tp,eg)
return eg:IsExists(cm.cfilter,1,e:GetHandler())
end
function cm.cfilter(c)
return c:IsType(TYPE_TUNER) and not c:IsPublic()
end
function cm.drcost(e,tp,eg,ep,ev,re,r,rp,chk)
local c = e:GetHandler()
local cg = eg:Filter(cm.cfilter,c)
if chk == 0 then return not c:IsPublic() and #cg > 0 end
cg:AddCard(c)
for tc in aux.Next(cg) do
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_PUBLIC)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
end
end
function cm.drop(e,tp)
local p,d = Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Draw(p,d,REASON_EFFECT)
end
function cm.spscon(e,tp,eg,ep,ev,re,r,rp,chk)
local loc , ap = Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_LOCATION,CHAININFO_TRIGGERING_PLAYER)
return re:IsHasCategory(CATEGORY_SPECIAL_SUMMON) and ap == tp and loc & (LOCATION_HAND+LOCATION_ONFIELD) ~= 0
end
function cm.spsop(e,tp)
local c = rscf.GetSelf(e)
if not c or Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP) <=0 then return end
c:RegisterFlagEffect(m,rsrst.std,0,1)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_CHAIN_END)
e1:SetCondition(cm.tdcon2)
e1:SetOperation(cm.tdop2)
e1:SetLabelObject(c)
Duel.RegisterEffect(e1,tp)
end
\ No newline at end of file
--小白兔 Δ
if not pcall(function() require("expansions/script/c31300100") end) then require("script/c31300100") end
local m,cm = rscf.DefineCard(31300016)
function cm.initial_effect(c)
local e1 = rsef.FTO(c,EVENT_TO_HAND,"dr",{1,m},"dr","ptg",
cm.drcon,cm.drcost,rsop.target(1,"dr"),cm.drop)
local e2= rsef.QO(c,EVENT_CHAINING,"sp",{1,m + 100},"sp",nil,
LOCATION_GRAVE,cm.spscon,nil,
rsop.target(rscf.spfilter2(),"sp"),cm.spsop)
end
function cm.drcon(e,tp,eg)
return eg:IsExists(cm.cfilter,1,e:GetHandler())
end
function cm.cfilter(c)
return c:IsType(TYPE_TUNER) and not c:IsPublic()
end
function cm.drcost(e,tp,eg,ep,ev,re,r,rp,chk)
local c = e:GetHandler()
local cg = eg:Filter(cm.cfilter,c)
if chk == 0 then return not c:IsPublic() and #cg > 0 end
cg:AddCard(c)
for tc in aux.Next(cg) do
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_PUBLIC)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
end
end
function cm.drop(e,tp)
local p,d = Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Draw(p,d,REASON_EFFECT)
end
function cm.spscon(e,tp,eg,ep,ev,re,r,rp,chk)
local loc , ap = Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_LOCATION,CHAININFO_TRIGGERING_PLAYER)
return re:IsHasCategory(CATEGORY_SPECIAL_SUMMON) and ap == tp and loc & (LOCATION_HAND+LOCATION_ONFIELD) ~= 0
end
function cm.spsop(e,tp)
local c = rscf.GetSelf(e)
if not c or Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP) <=0 then return end
c:RegisterFlagEffect(m,rsrst.std,0,1)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_CHAIN_END)
e1:SetCondition(cm.tdcon2)
e1:SetOperation(cm.tdop2)
e1:SetLabelObject(c)
Duel.RegisterEffect(e1,tp)
end
\ No newline at end of file
--小白兔 Δ
if not pcall(function() require("expansions/script/c31300100") end) then require("script/c31300100") end
local m,cm = rscf.DefineCard(31300016)
function cm.initial_effect(c)
local e1 = rsef.FTO(c,EVENT_TO_HAND,"dr",{1,m},"dr","ptg",
cm.drcon,cm.drcost,rsop.target(1,"dr"),cm.drop)
local e2= rsef.QO(c,EVENT_CHAINING,"sp",{1,m + 100},"sp",nil,
LOCATION_GRAVE,cm.spscon,nil,
rsop.target(rscf.spfilter2(),"sp"),cm.spsop)
end
function cm.drcon(e,tp,eg)
return eg:IsExists(cm.cfilter,1,e:GetHandler())
end
function cm.cfilter(c)
return c:IsType(TYPE_TUNER) and not c:IsPublic()
end
function cm.drcost(e,tp,eg,ep,ev,re,r,rp,chk)
local c = e:GetHandler()
local cg = eg:Filter(cm.cfilter,c)
if chk == 0 then return not c:IsPublic() and #cg > 0 end
cg:AddCard(c)
for tc in aux.Next(cg) do
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_PUBLIC)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
end
end
function cm.drop(e,tp)
local p,d = Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Draw(p,d,REASON_EFFECT)
end
function cm.spscon(e,tp,eg,ep,ev,re,r,rp,chk)
local loc , ap = Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_LOCATION,CHAININFO_TRIGGERING_PLAYER)
return re:IsHasCategory(CATEGORY_SPECIAL_SUMMON) and ap == tp and loc & (LOCATION_HAND+LOCATION_ONFIELD) ~= 0
end
function cm.spsop(e,tp)
local c = rscf.GetSelf(e)
if not c or Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP) <=0 then return end
c:RegisterFlagEffect(m,rsrst.std,0,1)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_CHAIN_END)
e1:SetCondition(cm.tdcon2)
e1:SetOperation(cm.tdop2)
e1:SetLabelObject(c)
Duel.RegisterEffect(e1,tp)
end
\ No newline at end of file
--动物朋友 我的朋友
function c33700087.initial_effect(c)
--Activate
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_ACTIVATE)
e0:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e0)
--self destroy
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EFFECT_SELF_TOGRAVE)
e1:SetCondition(c33700087.con)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_DISABLE)
e2:SetType(EFFECT_TYPE_QUICK_F)
e2:SetCode(EVENT_BECOME_TARGET)
e2:SetRange(LOCATION_SZONE)
e2:SetCost(c33700087.cost)
e2:SetCondition(c33700087.dcon)
e2:SetTarget(c33700087.dtg)
e2:SetOperation(c33700087.dop)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_QUICK_F)
e3:SetCode(EVENT_BE_BATTLE_TARGET)
e3:SetRange(LOCATION_SZONE)
e3:SetCondition(c33700087.atcon)
e3:SetTarget(c33700087.attg)
e3:SetOperation(c33700087.atop)
c:RegisterEffect(e3)
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e4:SetCode(EVENT_ATTACK_ANNOUNCE)
e4:SetRange(LOCATION_SZONE)
e4:SetCondition(c33700087.condition)
e4:SetCost(c33700087.cost2)
e4:SetTarget(c33700087.target)
e4:SetOperation(c33700087.activate)
c:RegisterEffect(e4)
end
c33700087.card_code_list={33700056}
function c33700087.con(e)
local g=Duel.GetMatchingGroup(nil,e:GetHandlerPlayer(),LOCATION_GRAVE,0,nil)
return g:GetClassCount(Card.GetCode)<g:GetCount()
end
function c33700087.tgfilter(c,tp)
return c:IsLocation(LOCATION_MZONE+LOCATION_GRAVE) and c:IsControler(tp) and c:IsSetCard(0x442) and c:IsType(TYPE_MONSTER)
end
function c33700087.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckLPCost(tp,1000) end
Duel.PayLPCost(tp,1000)
end
function c33700087.dcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c33700087.tgfilter,1,nil,tp) and rp==1-tp
end
function c33700087.dtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_DISABLE,eg,1,0,0)
end
function c33700087.dop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
Duel.NegateEffect(ev)
end
function c33700087.atcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c33700087.tgfilter,1,nil,tp)
end
function c33700087.attg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return not Duel.GetAttacker():IsHasEffect(EFFECT_CANNOT_DIRECT_ATTACK) end
e:SetLabel(1)
end
function c33700087.atop(e,tp,eg,ep,ev,re,r,rp)
if e:GetLabel()==0 or not e:GetHandler():IsRelateToEffect(e) then return end
Duel.ChangeAttackTarget(nil)
end
function c33700087.condition(e,tp,eg,ep,ev,re,r,rp)
local at=Duel.GetAttacker()
return at:GetControler()==1-tp and Duel.GetAttackTarget()==nil
end
function c33700087.cost2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c33700087.filter,tp,LOCATION_GRAVE,0,1,nil) end
local g=Duel.SelectMatchingCard(tp,c33700087.filter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.SendtoDeck(g,nil,2,REASON_COST)
end
function c33700087.target(e,tp,eg,ep,ev,re,r,rp,chk)
local at=Duel.GetAttacker()
if chk==0 then return at:IsOnField() and at:GetAttack()>=Duel.GetLP(tp) end
end
function c33700087.filter(c)
return c:IsSetCard(0x442) and c:IsType(TYPE_MONSTER) and c:IsAbleToDeckAsCost()
end
function c33700087.activate(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
Duel.NegateAttack()
end
\ No newline at end of file
--破碎世界 纷争
function c6160605.initial_effect(c)
--to hand
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(6160605,0))
e1:SetCategory(CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_ACTIONS)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCountLimit(1,81055000)
e1:SetTarget(c81055000.thtg1)
e1:SetOperation(c81055000.thop1)
c:RegisterEffect(e1)
end
--聚集的新星战士
local m=77000500
local cm=_G["c"..m]
function cm.initial_effect(c)
aux.AddMaterialCodeList(c,63977008)
--synchro summon
aux.AddSynchroProcedure(c,cm.tfilter,aux.NonTuner(Card.IsSynchroType,TYPE_SYNCHRO),1)
c:EnableReviveLimit()
--Effect 1
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_ATKCHANGE)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCondition(cm.con)
e1:SetTarget(cm.tg)
e1:SetOperation(cm.op)
c:RegisterEffect(e1)
--Effect 2 code
aux.EnableChangeCode(c,60800381,LOCATION_MZONE+LOCATION_GRAVE)
--Effect 3
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e3:SetCode(EFFECT_CANNOT_ACTIVATE)
e3:SetRange(LOCATION_MZONE)
e3:SetTargetRange(0,1)
e3:SetCondition(cm.actcon)
e3:SetValue(cm.aclimit)
e3:SetValue(1)
c:RegisterEffect(e3)
--Effect 4
local e13=Effect.CreateEffect(c)
e13:SetDescription(aux.Stringid(m,0))
e13:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e13:SetType(EFFECT_TYPE_IGNITION)
e13:SetRange(LOCATION_MZONE)
e13:SetCountLimit(1,m)
e13:SetTarget(cm.target)
e13:SetOperation(cm.operation)
c:RegisterEffect(e13)
end
--synchro summon
cm.material_setcode=0x1017
function cm.tfilter(c)
return c:IsCode(63977008) or c:IsHasEffect(20932152)
end
--Effect 1
function cm.con(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_SYNCHRO)
end
function cm.tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetChainLimit(cm.chainlm)
end
function cm.chainlm(e,ep,tp)
return tp==ep
end
function cm.filter(c)
return (c:IsLocation(LOCATION_GRAVE) or c:IsFaceup())
and c:IsLevelBelow(4)
and c:GetAttack()>0
end
function cm.op(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetMatchingGroup(cm.filter,tp,LOCATION_MZONE+LOCATION_GRAVE,0,nil)
if g:GetCount()>0 and c:IsFaceup() and c:IsRelateToEffect(e) then
local atk=0
local tc=g:GetFirst()
while tc do
atk=atk+tc:GetAttack()
tc=g:GetNext()
end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(atk)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE)
c:RegisterEffect(e1)
end
end
--Effect 2
--Effect 3
function cm.actfilter(c,tp)
return c:IsFaceup()
end
function cm.actcon(e)
local tp=e:GetHandlerPlayer()
local a=Duel.GetAttacker()
local d=Duel.GetAttackTarget()
return (a and cm.actfilter(a,tp)) or (d and cm.actfilter(d,tp))
end
function cm.aclimit(e,re,tp)
local rc=re:GetHandler()
return re:IsActiveType(TYPE_MONSTER)
and rc:IsRace(RACE_DRAGON)
and rc:IsAttribute(ATTRIBUTE_DARK)
and rc:IsType(TYPE_SYNCHRO)
end
--Effect 4
function cm.tohfilter(c)
return c:IsAbleToHand()
and (c:IsSetCard(0x66) and c:IsLevelBelow(3))
or c:IsCode(8529136)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.tohfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,cm.tohfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
--Effect 5
---[[函数
function function_name( ... )
local c = 1
-- return
end
--集合
t={7,5,4,6,"hello",qwe=123}
print(t[5])
print(t.qwe)
table.insert(t,789)
print(t[6])
--]]
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