Commit 542e3616 authored by Nemo Ma's avatar Nemo Ma

0717 Update

Add author cards 011, 714, 132
parent ddc339af
No preview for this file type
--辉光之针的魔法少女
function c1146016.initial_effect(c)
--
c:EnableReviveLimit()
aux.AddFusionProcFun2(c,c1146016.FusFilter1,c1146016.FusFilter2,false)
aux.AddContactFusionProcedure(c,Card.IsReleasable,LOCATION_MZONE,0,Duel.Release,REASON_COST+REASON_FUSION+REASON_MATERIAL)
--
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_SPSUMMON_CONDITION)
e1:SetValue(c1146016.splimit)
c:RegisterEffect(e1)
--
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(1146016,0))
e2:SetCategory(CATEGORY_ATKCHANGE+CATEGORY_DESTROY)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetRange(LOCATION_MZONE)
e2:SetCondition(c1146016.con2)
e2:SetOperation(c1146016.op2)
c:RegisterEffect(e2)
--
if not c1146016.global_check then
c1146016.global_check=true
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e3:SetCode(EVENT_LEVEL_UP)
e3:SetLabelObject(c)
e3:SetOperation(c1146016.op3)
local e4=Effect.GlobalEffect()
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_GRANT)
e4:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e4:SetTarget(function (e,c) return c:IsFaceup() end)
e4:SetLabelObject(e3)
Duel.RegisterEffect(e4,0)
end
--
local e5=Effect.CreateEffect(c)
e5:SetCategory(CATEGORY_SPECIAL_SUMMON)
e5:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e5:SetProperty(EFFECT_FLAG_DELAY)
e5:SetCode(EVENT_CUSTOM+1146016)
e5:SetRange(LOCATION_GRAVE)
e5:SetCountLimit(1,1146016)
e5:SetTarget(c1146016.tg5)
e5:SetOperation(c1146016.op5)
c:RegisterEffect(e5)
--
end
--
function c1146016.FusFilter1(c)
return c:IsRace(RACE_FIEND)
end
function c1146016.FusFilter2(c)
return c:IsRace(RACE_SPELLCASTER)
end
--
function c1146016.splimit(e,se,sp,st)
local c=e:GetHandler()
return not c:IsLocation(LOCATION_EXTRA) or aux.fuslimit(e,se,sp,st)
end
--
function c1146016.con2(e,tp,eg,ep,ev,re,r,rp)
local b1=eg and eg:IsExists(aux.TRUE,1,e:GetHandler())
local b2=(Duel.GetCurrentPhase()~=PHASE_DAMAGE or not Duel.IsDamageCalculated())
return b1 and b2
end
--
function c1146016.op2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local mg=Duel.GetMatchingGroup(Card.IsFaceup,tp,0,LOCATION_MZONE,nil)
if mg:GetCount()<1 then return end
local tc=mg:GetFirst()
while tc do
local e2_1=Effect.CreateEffect(c)
e2_1:SetType(EFFECT_TYPE_SINGLE)
e2_1:SetCode(EFFECT_UPDATE_ATTACK)
e2_1:SetReset(RESET_EVENT+RESETS_STANDARD)
e2_1:SetValue(-1200)
tc:RegisterEffect(e2_1)
tc=mg:GetNext()
end
Duel.BreakEffect()
local dg=mg:Filter(Card.IsAttack,nil,0)
if dg:GetCount()<1 then return end
Duel.Destroy(dg,REASON_EFFECT)
end
--
function c1146016.op3(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetLabelObject()
Duel.RaiseEvent(c,EVENT_CUSTOM+1146016,re,r,rp,ep,ev)
end
--
function c1146016.tg5(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.GetMZoneCount(tp)>0
and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
end
--
function c1146016.op5(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.GetMZoneCount(tp)<1 then return end
if not c:IsRelateToEffect(e) then return end
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
--
--元始飞球·绿
local m=13254031
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:SetCategory(CATEGORY_DRAW+CATEGORY_HANDES)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e1:SetTarget(cm.target)
e1:SetOperation(cm.operation)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,1))
e2:SetCategory(CATEGORY_TODECK+CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_MZONE)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetCountLimit(1)
e2:SetCost(cm.cost1)
e2:SetTarget(cm.target1)
e2:SetOperation(cm.operation1)
c:RegisterEffect(e2)
elements={"tama_elements",{{13254031,1}}}
cm[c]=elements
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroupCount(tp,LOCATION_HAND,0)>0 and Duel.IsPlayerCanDraw(tp,1) end
Duel.SetOperationInfo(0,CATEGORY_HANDES,nil,0,tp,1)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local ct=Duel.DiscardHand(tp,aux.TRUE,1,2,REASON_EFFECT+REASON_DISCARD)
Duel.BreakEffect()
Duel.Draw(tp,ct,REASON_EFFECT)
end
function cm.elementsFilter(c)
return c:IsAbleToDeckAsCost() and tama.tamas_isExistElement(c,13254031)
end
function cm.cost1(e,tp,eg,ep,ev,re,r,rp,chk)
--[[
local el={{13254031,2}}
local mg=tama.tamas_checkGroupElements(Duel.GetFieldGroup(tp,LOCATION_GRAVE,0),el)
local sg=Group.CreateGroup()
if chk==0 then
--return mg:CheckWithSumGreater(tama.tamas_getElementCount,2,13254031)
return mg:GetCount()>0 and mg:IsExists(tama.tamas_selectElementsForAbove,1,nil,mg,sg,el)
end
while mg:IsExists(tama.tamas_selectElementsForAbove,1,sg,mg,sg,el) do
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=mg:FilterSelect(tp,tama.tamas_selectElementsForAbove,1,1,sg,mg,sg,el)
el=tama.tamas_decreaseElements(el,tama.tamas_getElements(g:GetFirst()))
sg:Merge(g)
end
Duel.SendtoDeck(sg,nil,2,REASON_COST)]]
local el={{13254031,2}}
local mg=tama.tamas_checkGroupElements(Duel.GetFieldGroup(tp,LOCATION_GRAVE,0),el)
local sg=Group.CreateGroup()
if chk==0 then
--return mg:CheckWithSumGreater(tama.tamas_getElementCount,2,13254031)
return mg:GetCount()>0 and mg:IsExists(tama.tamas_selectElementsForAbove,1,nil,mg,sg,el)
end
local sg,elements=tama.tamas_selectAllSelectForAbove(mg,el,tp)
Duel.SendtoDeck(sg,nil,2,REASON_COST)
--Debug.Message(elements[1][1].."+"..elements[1][2])
end
function cm.target1(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(1-tp) and chkc:IsOnField() and chkc:IsAbleToHand() end
if chk==0 then return Duel.IsExistingTarget(Card.IsAbleToHand,tp,0,LOCATION_ONFIELD,2,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local sg=Duel.SelectTarget(tp,Card.IsAbleToHand,tp,0,LOCATION_ONFIELD,2,2,nil)
--local g=Duel.GetMatchingGroup(Card.IsAbleToHand,tp,0,LOCATION_ONFIELD,nil)
--Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,2,0,0)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,sg,2,0,0)
Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,0,1-tp,2)
end
function cm.operation1(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
if g:FilterCount(Card.IsRelateToEffect,nil,e)~=2 then return end
if Duel.SendtoHand(g,nil,REASON_EFFECT)==2 then
local g1=Duel.GetFieldGroup(tp,0,LOCATION_HAND)
if g1:GetCount()<2 then return end
local sg=g:RandomSelect(tp,2)
Duel.SendtoDeck(sg,nil,2,REASON_EFFECT)
end
end
--元始飞球·金
local m=13254032
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:SetCategory(CATEGORY_TOGRAVE+CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e1:SetTarget(cm.target)
e1:SetOperation(cm.operation)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,1))
e2:SetCategory(CATEGORY_TODECK)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_MZONE)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetCountLimit(1)
e2:SetCost(cm.cost1)
e2:SetTarget(cm.target1)
e2:SetOperation(cm.operation1)
c:RegisterEffect(e2)
elements={"tama_elements",{{13254032,1}}}
cm[c]=elements
end
function cm.spfilter(c,e,tp)
return c:IsSetCard(0x356) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEDOWN_DEFENSE)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if ft<-1 then return false end
local loc=LOCATION_ONFIELD
if ft==0 then loc=LOCATION_MZONE end
return Duel.IsExistingMatchingCard(nil,tp,loc,0,1,nil)
and Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_ONFIELD)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function cm.filter(c,ft)
return ft>0 or c:IsLocation(LOCATION_MZONE)
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local ft1=Duel.GetLocationCount(tp,LOCATION_MZONE)
if ft1<-1 then return false end
local ft=ft1
if ft1<=1 then
ft1=Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)
ft1=ft1+ft
end
if ft1<0 then return end
if ft1>2 then ft1=2 end
if Duel.IsPlayerAffectedByEffect(tp,59822133) then ft1=1 end
local i=1
local sg=Group.CreateGroup()
while i<=ft1 do
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g1=Duel.SelectMatchingCard(tp,cm.filter,tp,LOCATION_ONFIELD,0,1,1,nil,ft)
if g1:GetFirst():IsLocation(LOCATION_ONFIELD) then
ft=ft-1
end
sg:Merge(g1)
i=i+1
end
local ct=Duel.SendtoGrave(sg,REASON_EFFECT)
if ct>0 and ct<=Duel.GetLocationCount(tp,LOCATION_MZONE) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,cm.spfilter,tp,LOCATION_DECK,0,ct,ct,nil,e,tp)
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEDOWN_DEFENSE)
end
end
function cm.cost1(e,tp,eg,ep,ev,re,r,rp,chk)
local el={{13254032,2}}
local mg=tama.tamas_checkGroupElements(Duel.GetFieldGroup(tp,LOCATION_GRAVE,0),el)
local sg=Group.CreateGroup()
if chk==0 then
return mg:GetCount()>0 and mg:IsExists(tama.tamas_selectElementsForAbove,1,nil,mg,sg,el)
end
local sg=tama.tamas_selectAllSelectForAbove(mg,el,tp)
Duel.SendtoDeck(sg,nil,2,REASON_COST)
end
function cm.setfilter(c,e,tp)
return (c:IsType(TYPE_MONSTER) and Duel.GetMZoneCount(tp)>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEDOWN_DEFENSE) and (not rc:IsLocation(LOCATION_EXTRA) or Duel.GetLocationCountFromEx(tp)>0))
or ((rc:IsType(TYPE_FIELD) or Duel.GetLocationCount(tp,LOCATION_SZONE)>0) and rc:IsSSetable())
end
function cm.setfilter1(c,e,tp)
return not c:IsType(TYPE_MONSTER) and ((tc:IsType(TYPE_FIELD) or Duel.GetLocationCount(tp,LOCATION_SZONE)>0) and tc:IsSSetable())
end
function cm.target1(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(1-tp) and chkc:IsLocation(LOCATION_GRAVE) and cm.setfilter(chkc) end
if chk==0 then return
(not Duel.IsExistingMatchingCard(cm.setfilter1,tp,0,LOCATION_GRAVE,1,nil,e,tp) or Duel.IsPlayerAffectedByEffect(tp,59822133))
and Duel.IsExistingTarget(cm.setfilter,tp,0,LOCATION_GRAVE,2,nil,e,tp)
end
local ft=2
if Duel.IsPlayerAffectedByEffect(tp,59822133) then
ft=1
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
Duel.SelectTarget(tp,cm.setfilter1,tp,LOCATION_GRAVE,0,1,1,nil)
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
local g=Duel.SelectTarget(tp,cm.setfilter,tp,LOCATION_GRAVE,0,ft,ft,nil)
local sg=g:Filter(Card.IsType,nil,TYPE_MONSTER)
local cat=e:GetCategory()
if sg:GetCount()>0 then
e:SetCategory(bit.bor(cat,CATEGORY_SPECIAL_SUMMON))
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,sg,sg:GetCount(),0,0)
else
e:SetCategory(bit.band(cat,bit.bnot(CATEGORY_SPECIAL_SUMMON)))
end
Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,2,1-tp,LOCATION_ONFIELD)
end
function cm.operation1(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
if g:FilterCount(Card.IsRelateToEffect,nil,e)~=2 or
(g:IsExists(Card.IsType,2,nil,TYPE_MONSTER) and Duel.IsPlayerAffectedByEffect(tp,59822133)) then return end
local tc=g:GetFirst()
local ct=0
while tc do
if tc:IsType(TYPE_MONSTER) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and (not tc:IsLocation(LOCATION_EXTRA) or Duel.GetLocationCountFromEx(tp)>0)
and tc:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEDOWN_DEFENSE) then
Duel.BreakEffect()
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEDOWN_DEFENSE)
Duel.ConfirmCards(1-tp,tc)
ct=ct+1
elseif (tc:IsType(TYPE_FIELD) or Duel.GetLocationCount(tp,LOCATION_SZONE)>0)
and tc:IsSSetable() then
Duel.BreakEffect()
Duel.SSet(tp,tc)
Duel.ConfirmCards(1-tp,tc)
ct=ct+1
end
tc=g:GetNext()
end
local sg=Duel.GetMatchingGroup(Card.IsAbleToDeck,tp,0,LOCATION_ONFIELD,nil)
if ct==2 and sg:GetCount()>=2 then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local sg1=sg:Select(tp,2,2,nil)
Duel.SendtoDeck(sg1,nil,2,REASON_EFFECT)
end
end
--元始飞球·蓝
local m=13254033
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:SetCategory(CATEGORY_TOGRAVE+CATEGORY_REMOVE)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e1:SetTarget(cm.target)
e1:SetOperation(cm.operation)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,1))
e2:SetCategory(CATEGORY_REMOVE+CATEGORY_TODECK)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_MZONE)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetCountLimit(1)
e2:SetCost(cm.cost1)
e2:SetTarget(cm.target1)
e2:SetOperation(cm.operation1)
c:RegisterEffect(e2)
elements={"tama_elements",{{13254033,1}}}
cm[c]=elements
end
function cm.rmfilter(c)
return c:IsSetCard(0x356) and c:IsType(TYPE_MONSTER) and c:IsAbleToRemove()
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroupCount(tp,LOCATION_REMOVED,0)>0 and Duel.IsExistingMatchingCard(cm.rmfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_REMOVED)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,tp,LOCATION_DECK)
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetFieldGroup(tp,LOCATION_REMOVED,0)
if g:GetCount()<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g1=g:Select(tp,1,2,nil)
local ct=Duel.SendtoGrave(g1,REASON_EFFECT)
if ct>0 and Duel.IsExistingMatchingCard(cm.rmfilter,tp,LOCATION_DECK,0,ct,nil) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local sg=Duel.SelectMatchingCard(tp,cm.rmfilter,tp,LOCATION_DECK,0,ct,ct,nil)
Duel.Remove(sg,POS_FACEUP,REASON_EFFECT)
end
end
function cm.cost1(e,tp,eg,ep,ev,re,r,rp,chk)
local el={{13254033,2}}
local mg=tama.tamas_checkGroupElements(Duel.GetFieldGroup(tp,LOCATION_GRAVE,0),el)
local sg=Group.CreateGroup()
if chk==0 then
return mg:GetCount()>0 and mg:IsExists(tama.tamas_selectElementsForAbove,1,nil,mg,sg,el)
end
local sg=tama.tamas_selectAllSelectForAbove(mg,el,tp)
Duel.SendtoDeck(sg,nil,2,REASON_COST)
end
function cm.rmfilter1(c)
return c:IsFaceup() and c:IsAbleToRemove()
end
function cm.target1(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(1-tp) and chkc:IsLocation(LOCATION_EXTRA) and cm.rmfilter1(chkc) end
if chk==0 then return Duel.IsExistingTarget(cm.rmfilter1,tp,0,LOCATION_EXTRA,2,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local sg=Duel.SelectTarget(tp,cm.rmfilter1,tp,0,LOCATION_EXTRA,2,2,nil)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,sg,2,0,0)
Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,2,1-tp,LOCATION_ONFIELD)
end
function cm.operation1(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
if g:FilterCount(Card.IsRelateToEffect,nil,e)~=2 then return end
if Duel.Remove(g,POS_FACEUP,REASON_EFFECT)==2 then
local sg=Duel.GetMatchingGroup(Card.IsAbleToDeck,tp,0,LOCATION_REMOVED,nil)
if sg:GetCount()>=2 then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local sg1=sg:Select(tp,2,2,nil)
Duel.SendtoDeck(sg1,nil,2,REASON_EFFECT)
end
end
end
--元始飞球·红
local m=13254034
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:SetCategory(CATEGORY_TOGRAVE+CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e1:SetTarget(cm.target)
e1:SetOperation(cm.operation)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,1))
e2:SetCategory(CATEGORY_DESTROY)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_MZONE)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetCountLimit(1)
e2:SetCost(cm.cost1)
e2:SetTarget(cm.target1)
e2:SetOperation(cm.operation1)
c:RegisterEffect(e2)
elements={"tama_elements",{{13254034,1}}}
cm[c]=elements
end
function cm.desfilter(c)
return c:IsFaceup() and c:IsDestructable()
end
function cm.tgfilter(c)
return c:IsSetCard(0x356) and c:IsType(TYPE_MONSTER) and c:IsAbleToGrave()
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.desfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) and Duel.IsExistingMatchingCard(cm.tgfilter,tp,LOCATION_DECK,0,2,nil) end
local g=Duel.GetMatchingGroup(cm.desfilter,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
local tg=g:GetMinGroup(Card.GetAttack)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,tg,1,0,0)
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(cm.desfilter,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
local ct=0
if g:GetCount()>0 then
local tg=g:GetMinGroup(Card.GetAttack)
if tg:GetCount()>1 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local sg=tg:Select(tp,1,1,nil)
Duel.HintSelection(sg)
local tc=sg:GetFirst()
local atk=tc:IsFaceup() and tc:GetAttack() or 0
ct=Duel.Destroy(sg,REASON_EFFECT)
else
local tc=tg:GetFirst()
local atk=tc:IsFaceup() and tc:GetAttack() or 0
ct=Duel.Destroy(tg,REASON_EFFECT)
end
end
if ct>0 and Duel.IsExistingMatchingCard(cm.tgfilter,tp,LOCATION_DECK,0,2,nil) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local sg=Duel.SelectMatchingCard(tp,cm.tgfilter,tp,LOCATION_DECK,0,2,2,nil)
Duel.SendtoGrave(sg,REASON_EFFECT)
end
end
function cm.cost1(e,tp,eg,ep,ev,re,r,rp,chk)
local el={{13254034,2}}
local mg=tama.tamas_checkGroupElements(Duel.GetFieldGroup(tp,LOCATION_GRAVE,0),el)
local sg=Group.CreateGroup()
if chk==0 then
return mg:GetCount()>0 and mg:IsExists(tama.tamas_selectElementsForAbove,1,nil,mg,sg,el)
end
local sg=tama.tamas_selectAllSelectForAbove(mg,el,tp)
Duel.SendtoDeck(sg,nil,2,REASON_COST)
end
function cm.target1(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(1-tp) and chkc:IsOnField() and Card.IsFaceup(chkc) end
if chk==0 then return Duel.IsExistingTarget(Card.IsFaceup,tp,0,LOCATION_ONFIELD,2,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local sg=Duel.SelectTarget(tp,Card.IsFaceup,tp,0,LOCATION_ONFIELD,2,2,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,sg,2,0,0)
end
function cm.operation1(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
if g:FilterCount(Card.IsRelateToEffect,nil,e)~=2 then return end
Duel.Destroy(g,REASON_EFFECT)
end
--元始飞球·白
local m=13254035
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_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e1:SetOperation(cm.operation)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,1))
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1)
e2:SetCost(cm.cost1)
e2:SetOperation(cm.operation1)
c:RegisterEffect(e2)
elements={"tama_elements",{{13254035,1}}}
cm[c]=elements
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_IMMUNE_EFFECT)
e3:SetTargetRange(LOCATION_MZONE,0)
e3:SetTarget(aux.TargetBoolFunction(Card.IsSetCard,0x356))
e3:SetValue(cm.efilter)
e3:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e3,tp)
end
function cm.cost1(e,tp,eg,ep,ev,re,r,rp,chk)
local el={{13254035,2}}
local mg=tama.tamas_checkGroupElements(Duel.GetFieldGroup(tp,LOCATION_GRAVE,0),el)
local sg=Group.CreateGroup()
if chk==0 then
return mg:GetCount()>0 and mg:IsExists(tama.tamas_selectElementsForAbove,1,nil,mg,sg,el)
end
local sg=tama.tamas_selectAllSelectForAbove(mg,el,tp)
Duel.SendtoDeck(sg,nil,2,REASON_COST)
end
function cm.operation1(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetFieldGroup(p,0,LOCATION_ONFIELD+LOCATION_HAND)
if g:GetCount()>0 then
Duel.ConfirmCards(tp,g)
Duel.ShuffleHand(1-tp)
end
local e11=Effect.CreateEffect(e:GetHandler())
e11:SetType(EFFECT_TYPE_FIELD)
e11:SetCode(EFFECT_PUBLIC)
e11:SetTargetRange(LOCATION_HAND,0)
e11:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e11,1-tp)
local e12=Effect.CreateEffect(e:GetHandler())
e12:SetType(EFFECT_TYPE_FIELD)
e12:SetCode(EFFECT_CANNOT_SSET)
e12:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e12:SetTargetRange(1,0)
e12:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e12,1-tp)
local e13=e12:Clone()
e13:SetCode(EFFECT_CANNOT_MSET)
Duel.RegisterEffect(e13,1-tp)
end
--元始飞球·黑
local m=13254036
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_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e1:SetOperation(cm.operation)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,1))
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1)
e2:SetCost(cm.cost1)
e2:SetOperation(cm.operation1)
c:RegisterEffect(e2)
elements={"tama_elements",{{13254036,1}}}
cm[c]=elements
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e3:SetCode(EFFECT_CANNOT_ACTIVATE)
e3:SetTargetRange(0,1)
e3:SetValue(cm.aclimit)
e3:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e3,tp)
end
function cm.aclimit(e,re,tp)
local loc=re:GetHandler():GetLocation()
return (loc==LOCATION_GRAVE or loc==LOCATION_HAND or (loc==LOCATION_ONFIELD and re:GetHandler():IsFacedown())) and not re:GetHandler():IsImmuneToEffect(e)
end
function cm.cost1(e,tp,eg,ep,ev,re,r,rp,chk)
local el={{13254036,2}}
local mg=tama.tamas_checkGroupElements(Duel.GetFieldGroup(tp,LOCATION_GRAVE,0),el)
local sg=Group.CreateGroup()
if chk==0 then
return mg:GetCount()>0 and mg:IsExists(tama.tamas_selectElementsForAbove,1,nil,mg,sg,el)
end
local sg=tama.tamas_selectAllSelectForAbove(mg,el,tp)
Duel.SendtoDeck(sg,nil,2,REASON_COST)
end
function cm.operation1(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(Card.IsCanTurnSet,tp,0,LOCATION_MZONE,nil)
if g:GetCount()>0 then
Duel.ChangePosition(g,POS_FACEDOWN_DEFENSE)
end
local sg=Duel.GetMatchingGroup(Card.IsCanTurnSet,tp,0,LOCATION_ONFIELD,nil)
local tc=sg:GetFirst()
while tc do
Duel.ChangePosition(tc,POS_FACEDOWN)
Duel.RaiseEvent(tc,EVENT_SSET,e,REASON_EFFECT,tp,tp,0)
tc=sg:GetNext()
end
end
--元始飞球·元始
local m=13254037
local cm=_G["c"..m]
xpcall(function() require("expansions/script/tama") end,function() require("script/tama") end)
function cm.initial_effect(c)
c:EnableReviveLimit()
--spsummon condition
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_SPSUMMON_CONDITION)
c:RegisterEffect(e1)
--special summon rule
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_SPSUMMON_PROC)
e2:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e2:SetRange(LOCATION_EXTRA)
e2:SetCondition(cm.sprcon)
e2:SetOperation(cm.sprop)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,0))
e3:SetCategory(CATEGORY_SUMMON)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1,m)
e3:SetTarget(cm.smtg)
e3:SetOperation(cm.smop)
c:RegisterEffect(e3)
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(m,1))
e4:SetType(EFFECT_TYPE_QUICK_O)
e4:SetCode(EVENT_FREE_CHAIN)
e4:SetRange(LOCATION_MZONE)
e4:SetCountLimit(1)
e4:SetCost(cm.cost)
e4:SetTarget(cm.remtg)
e4:SetOperation(cm.remop)
c:RegisterEffect(e4)
elements={"tama_sub_elements",{{13254031,1},{13254032,1},{13254033,1},{13254034,1},{13254035,1},{13254036,1}}}
cm[c]=elements
end
function cm.spfilter(c)
return c:IsSetCard(0x3356) and c:IsCanBeFusionMaterial() and c:IsAbleToGraveAsCost() and not c:IsCode(m) and c:IsType(TYPE_MONSTER)
end
function cm.fselect(c,tp,mg,sg)
sg:AddCard(c)
local res=false
if sg:GetCount()<1 then
res=mg:IsExists(cm.fselect,1,sg,tp,mg,sg)
else
res=Duel.GetLocationCountFromEx(tp,tp,sg)>0
end
sg:RemoveCard(c)
return res
end
function cm.sprcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
local mg=Duel.GetMatchingGroup(cm.spfilter,tp,LOCATION_ONFIELD,0,nil)
local sg=Group.CreateGroup()
return mg:IsExists(cm.fselect,1,nil,tp,mg,sg)
end
function cm.sprop(e,tp,eg,ep,ev,re,r,rp,c)
local mg=Duel.GetMatchingGroup(cm.spfilter,tp,LOCATION_ONFIELD,0,nil)
local sg=Group.CreateGroup()
while sg:GetCount()<1 do
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=mg:FilterSelect(tp,cm.fselect,1,1,sg,tp,mg,sg)
sg:Merge(g)
end
local cg=sg:Filter(Card.IsFacedown,nil)
if cg:GetCount()>0 then
Duel.ConfirmCards(1-tp,cg)
end
Duel.SendtoGrave(sg,REASON_COST)
end
function cm.smfilter(c)
return c:IsSetCard(0x3356) and c:IsSummonable(true,nil)
end
function cm.smtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(cm.smfilter,tp,LOCATION_HAND,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_SUMMON,nil,1,0,0)
end
function cm.smop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SUMMON)
local g=Duel.SelectMatchingCard(tp,cm.smfilter,tp,LOCATION_HAND,0,1,1,nil)
local tc=g:GetFirst()
if tc then
Duel.Summon(tp,tc,true,nil)
end
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local el={{13254031,1},{13254031,2},{13254033,1},{13254034,1},{13254035,1},{13254036,1}}
local mg=tama.tamas_checkGroupElements(Duel.GetFieldGroup(tp,LOCATION_GRAVE,0),el)
local sg=Group.CreateGroup()
if chk==0 then
return mg:GetCount()>0 and mg:IsExists(tama.tamas_selectElementsForAbove,1,nil,mg,sg,el)
end
local sg=tama.tamas_selectAllSelectForAbove(mg,el,tp)
Duel.SendtoDeck(sg,nil,2,REASON_COST)
end
function cm.remtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,0,LOCATION_HAND+LOCATION_DECK+LOCATION_EXTRA,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,0,LOCATION_HAND+LOCATION_DECK+LOCATION_EXTRA)
end
function cm.remop(e,tp,eg,ep,ev,re,r,rp)
local g1=Duel.GetMatchingGroup(Card.IsAbleToRemove,tp,0,LOCATION_HAND,nil)
local g2=Duel.GetMatchingGroup(Card.IsAbleToRemove,tp,0,LOCATION_DECK,nil)
local g3=Duel.GetMatchingGroup(Card.IsAbleToRemove,tp,0,LOCATION_EXTRA,nil)
local sg=Group.CreateGroup()
if g1:GetCount()>0 and ((g2:GetCount()==0 and g3:GetCount()==0) or Duel.SelectYesNo(tp,aux.Stringid(m,2))) then
Duel.ConfirmCards(tp,g1)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local sg1=g1:Select(tp,1,1,nil)
Duel.HintSelection(sg1)
sg:Merge(sg1)
end
if g2:GetCount()>0 and ((sg:GetCount()==0 and g3:GetCount()==0) or Duel.SelectYesNo(tp,aux.Stringid(m,3))) then
Duel.ConfirmCards(tp,g2)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local sg2=g2:Select(tp,1,1,nil)
Duel.HintSelection(sg2)
sg:Merge(sg2)
end
if g3:GetCount()>0 and (sg:GetCount()==0 or Duel.SelectYesNo(tp,aux.Stringid(m,4))) then
Duel.ConfirmCards(tp,g3)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local sg3=g3:Select(tp,1,1,nil)
sg:Merge(sg3)
end
Duel.Remove(sg,POS_FACEDOWN,REASON_EFFECT)
end
--元素飞球之雨
local m=13254038
local cm=_G["c"..m]
xpcall(function() require("expansions/script/tama") end,function() require("script/tama") end)
function cm.initial_effect(c)
--discard deck
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_DECKDES,CATEGORY_DRAW)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetRange(LOCATION_SZONE)
e1:SetCountLimit(1)
e1:SetTarget(cm.distg)
e1:SetOperation(cm.disop)
c:RegisterEffect(e1)
end
function cm.distg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDiscardDeck(tp,3) end
end
function cm.filter(c)
return c:IsSetCard(0x356) and c:IsType(TYPE_MONSTER)
end
function cm.filter1(c)
return c:IsSetCard(0x356) and c:IsType(TYPE_MONSTER) and c:IsAbleToGrave()
end
function cm.filter2(c)
return c:IsSetCard(0x356) and c:IsType(TYPE_MONSTER) and c:IsAbleToDeck()
end
function cm.disop(e,tp,eg,ep,ev,re,r,rp)
if not Duel.IsPlayerCanDiscardDeck(tp,3) then return end
Duel.ConfirmDecktop(tp,3)
local g=Duel.GetDecktopGroup(tp,3)
local sg=g:Filter(cm.filter,nil)
if sg:GetCount()<=0 then return end
Duel.DisableShuffleCheck()
Duel.SendtoGrave(g,REASON_EFFECT+REASON_REVEAL)
local sg1=Duel.GetOperatedGroup()
local sg2=sg1:Clone()
if sg1:GetCount()>0 then
if sg1:GetSum(tama.tamas_getElements,13254033)>0 and Duel.IsPlayerCanDiscardDeck(tp,2) then
Duel.BreakEffect()
Duel.ShuffleDeck(tp)
Duel.DiscardDeck(tp,2,REASON_EFFECT)
sg2:Merge(Duel.GetOperatedGroup())
end
if sg1:GetSum(tama.tamas_getElements,13254031)>0 and Duel.IsPlayerCanDraw(tp,1) then
Duel.BreakEffect()
Duel.Draw(tp,1,REASON_EFFECT)
Duel.ShuffleHand(tp)
Duel.DiscardHand(tp,aux.TRUE,1,1,REASON_EFFECT+REASON_DISCARD)
sg2:Merge(Duel.GetOperatedGroup())
end
if sg1:GetSum(tama.tamas_getElements,13254036)>0 and sg2:IsExists(cm.filter2,1,nil) then
local sg3=sg2:Filter(cm.filter2,nil)
local ct=sg3:GetCount()
Duel.BreakEffect()
Duel.SendtoDeck(sg3,tp,2,REASON_EFFECT)
Duel.ShuffleDeck(tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local sg4=Duel.SelectMatchingCard(tp,cm.filter1,tp,LOCATION_DECK,0,ct,ct,nil)
Duel.SendtoGrave(sg4,REASON_EFFECT)
end
end
end
--元始飞球秘术·乱流
local m=13254039
local cm=_G["c"..m]
xpcall(function() require("expansions/script/tama") end,function() require("script/tama") end)
function cm.initial_effect(c)
--inferno
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_DESTROY+CATEGORY_DRAW)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCost(cm.cost)
e1:SetTarget(cm.target)
e1:SetOperation(cm.operation)
c:RegisterEffect(e1)
--typhoon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,1))
e2:SetCategory(CATEGORY_REMOVE+CATEGORY_DRAW)
e2:SetType(EFFECT_TYPE_ACTIVATE)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetCost(cm.cost1)
e2:SetTarget(cm.target1)
e2:SetOperation(cm.operation1)
c:RegisterEffect(e2)
--goldrush
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,2))
e3:SetCategory(CATEGORY_DRAW)
e3:SetType(EFFECT_TYPE_ACTIVATE)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetCost(cm.cost2)
e3:SetTarget(cm.target2)
e3:SetOperation(cm.operation2)
c:RegisterEffect(e3)
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local el={{13254031,2},{13254034,1}}
local mg=tama.tamas_checkGroupElements(Duel.GetFieldGroup(tp,LOCATION_GRAVE,0),el)
local sg=Group.CreateGroup()
if chk==0 then
return mg:GetCount()>0 and mg:IsExists(tama.tamas_selectElementsForAbove,1,nil,mg,sg,el)
end
local sg=tama.tamas_selectAllSelectForAbove(mg,el,tp)
Duel.SendtoDeck(sg,nil,2,REASON_COST)
e:SetLabel(sg:GetCount())
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and chkc:IsControler(1-tp) end
if chk==0 then return Duel.IsExistingTarget(aux.TRUE,tp,0,LOCATION_ONFIELD,1,nil) and Duel.IsPlayerCanDraw(tp,1) end
local ct=e:GetLabel()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local eg=Duel.SelectTarget(tp,aux.TRUE,tp,0,LOCATION_ONFIELD,1,ct,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,eg:GetCount(),0,0)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,eg:GetCount())
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local tg=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
local rg=tg:Filter(Card.IsRelateToEffect,nil,e)
if rg:GetCount()>0 then
local ct=Duel.Destroy(rg,REASON_EFFECT)
Duel.Draw(tp,ct,REASON_EFFECT)
end
end
function cm.cost1(e,tp,eg,ep,ev,re,r,rp,chk)
local el={{13254031,2},{13254033,1}}
local mg=tama.tamas_checkGroupElements(Duel.GetFieldGroup(tp,LOCATION_GRAVE,0),el)
local sg=Group.CreateGroup()
if chk==0 then
return mg:GetCount()>0 and mg:IsExists(tama.tamas_selectElementsForAbove,1,nil,mg,sg,el)
end
local sg=tama.tamas_selectAllSelectForAbove(mg,el,tp)
Duel.SendtoDeck(sg,nil,2,REASON_COST)
e:SetLabel(sg:GetCount())
end
function cm.target1(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and chkc:IsControler(1-tp) end
if chk==0 then return Duel.IsExistingTarget(Card.IsAbleToRemove,tp,0,LOCATION_GRAVE,1,nil) and Duel.IsPlayerCanDraw(tp,1) end
local ct=e:GetLabel()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local eg=Duel.SelectTarget(tp,Card.IsAbleToRemove,tp,0,LOCATION_GRAVE,1,ct,nil)
Duel.SetOperationInfo(0,HINTMSG_REMOVE,eg,eg:GetCount(),0,0)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,eg:GetCount())
end
function cm.operation1(e,tp,eg,ep,ev,re,r,rp)
local tg=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
local rg=tg:Filter(Card.IsRelateToEffect,nil,e)
if rg:GetCount()>0 then
local ct=Duel.Remove(rg,REASON_EFFECT)
Duel.Draw(tp,ct,REASON_EFFECT)
end
end
function cm.cost2(e,tp,eg,ep,ev,re,r,rp,chk)
local el={{13254031,2},{13254032,2}}
local mg=tama.tamas_checkGroupElements(Duel.GetFieldGroup(tp,LOCATION_GRAVE,0),el)
local sg=Group.CreateGroup()
if chk==0 then
return mg:GetCount()>0 and mg:IsExists(tama.tamas_selectElementsForAbove,1,nil,mg,sg,el)
end
local sg=tama.tamas_selectAllSelectForAbove(mg,el,tp)
Duel.SendtoDeck(sg,nil,2,REASON_COST)
end
function cm.target2(e,tp,eg,ep,ev,re,r,rp,chk)
local ht=Duel.GetFieldGroupCount(tp,LOCATION_HAND,0)
local ht1=Duel.GetFieldGroupCount(tp,0,LOCATION_HAND)
if chk==0 then return Duel.IsPlayerCanDraw(tp) and ht<ht1 end
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,ht1-ht)
end
function cm.operation2(e,tp,eg,ep,ev,re,r,rp)
local ht=Duel.GetFieldGroupCount(p,LOCATION_HAND,0)
local ht1=Duel.GetFieldGroupCount(tp,0,LOCATION_HAND)
if ht<ht1 then
Duel.Draw(p,ht1-ht,REASON_EFFECT)
end
end
--元始飞球秘术·爆震
local m=13254040
local cm=_G["c"..m]
xpcall(function() require("expansions/script/tama") end,function() require("script/tama") end)
function cm.initial_effect(c)
--blast
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_TODECK)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCost(cm.cost)
e1:SetTarget(cm.target)
e1:SetOperation(cm.operation)
c:RegisterEffect(e1)
--tornado
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,1))
e2:SetCategory(CATEGORY_DESTROY)
e2:SetType(EFFECT_TYPE_ACTIVATE)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetCost(cm.cost1)
e2:SetTarget(cm.target1)
e2:SetOperation(cm.operation1)
c:RegisterEffect(e2)
--flow
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,2))
e3:SetCategory(CATEGORY_DRAW+CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_ACTIVATE)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetCost(cm.cost2)
e3:SetOperation(cm.operation2)
c:RegisterEffect(e3)
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local el={{13254032,2},{13254031,1}}
local mg=tama.tamas_checkGroupElements(Duel.GetFieldGroup(tp,LOCATION_GRAVE,0),el)
local sg=Group.CreateGroup()
if chk==0 then
return mg:GetCount()>0 and mg:IsExists(tama.tamas_selectElementsForAbove,1,nil,mg,sg,el)
end
local sg=tama.tamas_selectAllSelectForAbove(mg,el,tp)
Duel.SendtoDeck(sg,nil,2,REASON_COST)
e:SetLabel(sg:GetCount())
end
function cm.filter(c)
return c:IsAbleToDeck() and c:IsFacedown()
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,0,LOCATION_ONFIELD,1,nil) end
local sg=Duel.GetMatchingGroup(cm.filter,tp,0,LOCATION_ONFIELD,nil)
Duel.SetOperationInfo(0,CATEGORY_TODECK,sg,sg:GetCount(),0,0)
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local sg=Duel.GetMatchingGroup(cm.filter,tp,0,LOCATION_ONFIELD,nil)
Duel.SendtoDeck(sg,tp,2,REASON_EFFECT)
end
function cm.cost1(e,tp,eg,ep,ev,re,r,rp,chk)
local el={{13254032,2},{13254034,1}}
local mg=tama.tamas_checkGroupElements(Duel.GetFieldGroup(tp,LOCATION_GRAVE,0),el)
local sg=Group.CreateGroup()
if chk==0 then
return mg:GetCount()>0 and mg:IsExists(tama.tamas_selectElementsForAbove,1,nil,mg,sg,el)
end
local sg=tama.tamas_selectAllSelectForAbove(mg,el,tp)
Duel.SendtoDeck(sg,nil,2,REASON_COST)
e:SetLabel(sg:GetCount())
end
function cm.target1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(nil,tp,0,LOCATION_ONFIELD,1,nil) end
end
function cm.operation1(e,tp,eg,ep,ev,re,r,rp)
local sg=Duel.GetFieldGroup(tp,0,LOCATION_ONFIELD)
if sg:GetCount()==0 then return end
local g=Group.CreateGroup()
if Duel.SelectYesNo(tp,aux.Stringid(m,3)) then
local tc=sg:GetFirst()
while tc do
local dg=Group.CreateGroup()
dg:AddCard(tc)
Duel.HintSelection(dg)
local d1=Duel.TossDice(tp,1)
if d1<=3 then
g:AddCard(tc)
end
tc=sg:GetNext()
end
else
while sg:GetCount()>0 do
local dg=sg:Select(tp,1,1,nil)
Duel.HintSelection(dg)
sg:Sub(dg)
local d1=Duel.TossDice(tp,1)
if d1<=3 then
g:Merge(dg)
end
end
end
if g:GetCount()>0 then
Duel.Destroy(g,REASON_EFFECT)
end
end
function cm.cost2(e,tp,eg,ep,ev,re,r,rp,chk)
local el={{13254032,2},{13254033,1}}
local mg=tama.tamas_checkGroupElements(Duel.GetFieldGroup(tp,LOCATION_GRAVE,0),el)
local sg=Group.CreateGroup()
if chk==0 then
return mg:GetCount()>0 and mg:IsExists(tama.tamas_selectElementsForAbove,1,nil,mg,sg,el)
end
local sg=tama.tamas_selectAllSelectForAbove(mg,el,tp)
Duel.SendtoDeck(sg,nil,2,REASON_COST)
e:SetLabel(sg:GetCount())
end
function cm.filter2(c,e,tp)
return c:IsFaceup() and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function cm.target2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.filter2,tp,LOCATION_REMOVED,0,1,nil,e,tp)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsPlayerCanDraw(tp,1) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_REMOVED)
end
function cm.operation2(e,tp,eg,ep,ev,re,r,rp)
Duel.Draw(tp,1,REASON_EFFECT)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,cm.filter2,tp,LOCATION_REMOVED,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
--元始飞球秘术·飓风
local m=13254041
local cm=_G["c"..m]
xpcall(function() require("expansions/script/tama") end,function() require("script/tama") end)
function cm.initial_effect(c)
--hurricane
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_REMOVE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCost(cm.cost)
e1:SetTarget(cm.target)
e1:SetOperation(cm.operation)
c:RegisterEffect(e1)
--steam
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,1))
e2:SetType(EFFECT_TYPE_ACTIVATE)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetCost(cm.cost1)
e2:SetOperation(cm.operation1)
c:RegisterEffect(e2)
--sandstorm
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,2))
e3:SetCategory(CATEGORY_DESTROY)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetType(EFFECT_TYPE_ACTIVATE)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetCost(cm.cost2)
e3:SetTarget(cm.target2)
e3:SetOperation(cm.operation2)
c:RegisterEffect(e3)
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local el={{13254033,2},{13254031,1}}
local mg=tama.tamas_checkGroupElements(Duel.GetFieldGroup(tp,LOCATION_GRAVE,0),el)
local sg=Group.CreateGroup()
if chk==0 then
return mg:GetCount()>0 and mg:IsExists(tama.tamas_selectElementsForAbove,1,nil,mg,sg,el)
end
local sg=tama.tamas_selectAllSelectForAbove(mg,el,tp)
Duel.SendtoDeck(sg,nil,2,REASON_COST)
e:SetLabel(sg:GetCount())
end
function cm.filter(c)
return c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsAbleToRemove()
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and chkc:IsControler(1-tp) end
if chk==0 then return Duel.IsExistingTarget(cm.filter,tp,0,LOCATION_ONFIELD,1,nil) end
local ct=e:GetLabel()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local eg=Duel.SelectTarget(tp,cm.filter,tp,0,LOCATION_ONFIELD,1,ct,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,eg:GetCount(),0,0)
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local tg=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
local rg=tg:Filter(Card.IsRelateToEffect,nil,e)
if rg:GetCount()>0 then
ct=Duel.Remove(rg,POS_FACEUP,REASON_EFFECT)
end
end
function cm.cost1(e,tp,eg,ep,ev,re,r,rp,chk)
local el={{13254033,1},{13254034,1}}
local mg=tama.tamas_checkGroupElements(Duel.GetFieldGroup(tp,LOCATION_GRAVE,0),el)
local sg=Group.CreateGroup()
if chk==0 then
return mg:GetCount()>0 and mg:IsExists(tama.tamas_selectElementsForAbove,1,nil,mg,sg,el)
end
local sg=tama.tamas_selectAllSelectForAbove(mg,el,tp)
Duel.SendtoDeck(sg,nil,2,REASON_COST)
end
function cm.operation1(e,tp,eg,ep,ev,re,r,rp)
--cannot be battle target
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_SELECT_BATTLE_TARGET)
e1:SetTargetRange(LOCATION_MZONE,0)
e1:SetValue(1)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
--cannot be effect target
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e2:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e2:SetTargetRange(LOCATION_MZONE,0)
e2:SetValue(1)
e2:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e2,tp)
end
function cm.cost2(e,tp,eg,ep,ev,re,r,rp,chk)
local el={{13254033,3},{13254032,2}}
local mg=tama.tamas_checkGroupElements(Duel.GetFieldGroup(tp,LOCATION_GRAVE,0),el)
local sg=Group.CreateGroup()
if chk==0 then
return mg:GetCount()>0 and mg:IsExists(tama.tamas_selectElementsForAbove,1,nil,mg,sg,el)
end
local sg=tama.tamas_selectAllSelectForAbove(mg,el,tp)
Duel.SendtoDeck(sg,nil,2,REASON_COST)
end
function cm.filter3(c)
return c:IsType(TYPE_SPELL+TYPE_TRAP)
end
function cm.setfilter3(c)
return c:IsType(TYPE_TRAP) and c:IsSSetable()
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and chkc:IsControler(1-tp) and cm.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(cm.filter,tp,0,LOCATION_ONFIELD,1,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,cm.filter,tp,0,LOCATION_ONFIELD,1,1,e:GetHandler())
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc and tc:IsRelateToEffect(e) and Duel.Destroy(tc,REASON_EFFECT)~=0 and Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>=5 and Duel.GetLocationCount(tp,LOCATION_SZONE)>0 and Duel.SelectYesNo(tp,aux.Stringid(cm,3)) then
Duel.BreakEffect()
Duel.ConfirmDecktop(tp,5)
local g=Duel.GetDecktopGroup(tp,5)
g:Merge(Duel.GetFieldGroup(tp,LOCATION_HAND,0))
g:Merge(Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_REMOVED,0,nil))
local g1=g:Filter(cm.setfilter3,nil)
if g1:GetCount()>0 then
local ct=Duel.GetLocationCount(tp,LOCATION_SZONE)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
local sg=g1:Select(tp,1,ct,nil)
Duel.DisableShuffleCheck()
Duel.SSet(tp,sg:GetFirst())
end
end
end
--元始飞球秘术·崩炎
local m=13254042
local cm=_G["c"..m]
xpcall(function() require("expansions/script/tama") end,function() require("script/tama") end)
function cm.initial_effect(c)
--flame
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCost(cm.cost)
e1:SetTarget(cm.target)
e1:SetOperation(cm.operation)
c:RegisterEffect(e1)
--goddamn
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,1))
e2:SetCategory(CATEGORY_TODECK)
e2:SetType(EFFECT_TYPE_ACTIVATE)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetCost(cm.cost1)
e2:SetTarget(cm.target1)
e2:SetOperation(cm.operation1)
c:RegisterEffect(e2)
--magma
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,2))
e3:SetCategory(CATEGORY_DESTROY)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetType(EFFECT_TYPE_ACTIVATE)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetCost(cm.cost2)
e3:SetTarget(cm.target2)
e3:SetOperation(cm.operation2)
c:RegisterEffect(e3)
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local el={{13254034,2},{13254031,1}}
local mg=tama.tamas_checkGroupElements(Duel.GetFieldGroup(tp,LOCATION_GRAVE,0),el)
local sg=Group.CreateGroup()
if chk==0 then
return mg:GetCount()>0 and mg:IsExists(tama.tamas_selectElementsForAbove,1,nil,mg,sg,el)
end
local sg=tama.tamas_selectAllSelectForAbove(mg,el,tp)
Duel.SendtoDeck(sg,nil,2,REASON_COST)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(aux.TRUE,tp,0,LOCATION_MZONE,1,nil) end
local sg=Duel.GetMatchingGroup(aux.TRUE,tp,0,LOCATION_MZONE,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,sg,sg:GetCount(),0,0)
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local sg=Duel.GetMatchingGroup(cm.filter,tp,0,LOCATION_MZONE,nil)
Duel.Destroy(sg,REASON_EFFECT)
end
function cm.cost1(e,tp,eg,ep,ev,re,r,rp,chk)
local el={{13254034,3},{13254033,2}}
local mg=tama.tamas_checkGroupElements(Duel.GetFieldGroup(tp,LOCATION_GRAVE,0),el)
local sg=Group.CreateGroup()
if chk==0 then
return mg:GetCount()>0 and mg:IsExists(tama.tamas_selectElementsForAbove,1,nil,mg,sg,el)
end
local sg=tama.tamas_selectAllSelectForAbove(mg,el,tp)
Duel.SendtoDeck(sg,nil,2,REASON_COST)
e:SetLabel(sg:GetCount())
end
function cm.filter1(c)
return c:IsAbleToDeck() and (not c:IsLocation(LOCATION_EXTRA) or c:IsFaceup())
end
function cm.target1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.filter1,tp,0,LOCATION_GRAVE+LOCATION_REMOVED+LOCATION_EXTRA,1,nil) end
local sg=Duel.GetMatchingGroup(cm.filter1,tp,0,LOCATION_GRAVE+LOCATION_REMOVED+LOCATION_EXTRA,nil)
Duel.SetOperationInfo(0,CATEGORY_TODECK,sg,sg:GetCount(),0,0)
end
function cm.operation1(e,tp,eg,ep,ev,re,r,rp)
local sg=Duel.GetMatchingGroup(cm.filter1,tp,0,LOCATION_GRAVE+LOCATION_REMOVED+LOCATION_EXTRA,nil)
Duel.SendtoDeck(sg,tp,2,REASON_EFFECT)
end
function cm.cost2(e,tp,eg,ep,ev,re,r,rp,chk)
local el={{13254034,2},{13254032,1}}
local mg=tama.tamas_checkGroupElements(Duel.GetFieldGroup(tp,LOCATION_GRAVE,0),el)
local sg=Group.CreateGroup()
if chk==0 then
return mg:GetCount()>0 and mg:IsExists(tama.tamas_selectElementsForAbove,1,nil,mg,sg,el)
end
local sg=tama.tamas_selectAllSelectForAbove(mg,el,tp)
Duel.SendtoDeck(sg,nil,2,REASON_COST)
end
function cm.operation2(e,tp,eg,ep,ev,re,r,rp)
--attack up
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetTargetRange(LOCATION_MZONE,0)
e1:SetValue(2000)
e1:SetTarget(aux.TargetBoolFunction(Card.IsLevelBelow,1))
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
--元始飞球秘术·耀光
local m=13254043
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_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCost(cm.cost)
e1:SetOperation(cm.operation)
c:RegisterEffect(e1)
--steam
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,1))
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetRange(LOCATION_GRAVE)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetCost(cm.cost1)
e2:SetOperation(cm.operation1)
c:RegisterEffect(e2)
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local el={{13254035,1}}
local mg=tama.tamas_checkGroupElements(Duel.GetFieldGroup(tp,LOCATION_GRAVE,0),el)
local sg=Group.CreateGroup()
if chk==0 then
return mg:GetCount()>0 and mg:IsExists(tama.tamas_selectElementsForAbove,1,nil,mg,sg,el)
end
local sg=tama.tamas_selectAllSelectForAbove(mg,el,tp)
Duel.SendtoDeck(sg,nil,2,REASON_COST)
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_IMMUNE_EFFECT)
e3:SetTargetRange(LOCATION_ONFIELD,0)
e3:SetTarget(aux.TargetBoolFunction(Card.IsSetCard,0x356))
e3:SetValue(cm.efilter)
e3:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e3,tp)
end
function cm.efilter(e,re)
return e:GetOwnerPlayer()~=re:GetOwnerPlayer()
end
function cm.cost1(e,tp,eg,ep,ev,re,r,rp,chk)
local el={{13254035,2}}
local mg=tama.tamas_checkGroupElements(Duel.GetFieldGroup(tp,LOCATION_GRAVE,0),el)
local sg=Group.CreateGroup()
if chk==0 then
return mg:GetCount()>0 and mg:IsExists(tama.tamas_selectElementsForAbove,1,nil,mg,sg,el) and e:GetHandler():IsAbleToRemoveAsCost()
end
Duel.Remove(e:GetHandler(),POS_FACEUP,REASON_COST)
local sg=tama.tamas_selectAllSelectForAbove(mg,el,tp)
Duel.SendtoDeck(sg,nil,2,REASON_COST)
end
function cm.operation1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_IMMUNE_EFFECT)
e3:SetTargetRange(LOCATION_ONFIELD,0)
e3:SetTarget(aux.TargetBoolFunction(Card.IsSetCard,0x356))
e3:SetValue(cm.efilter)
e3:SetReset(RESET_EVENT+EVENT_CHAIN_END)
Duel.RegisterEffect(e3,tp)
end
--元始飞球秘术·帷幕
local m=13254044
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_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCost(cm.cost)
e1:SetOperation(cm.operation)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,1))
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetRange(LOCATION_GRAVE)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetCost(cm.cost1)
e2:SetOperation(cm.operation1)
c:RegisterEffect(e2)
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local el={{13254036,1}}
local mg=tama.tamas_checkGroupElements(Duel.GetFieldGroup(tp,LOCATION_GRAVE,0),el)
local sg=Group.CreateGroup()
if chk==0 then
return mg:GetCount()>0 and mg:IsExists(tama.tamas_selectElementsForAbove,1,nil,mg,sg,el)
end
local sg=tama.tamas_selectAllSelectForAbove(mg,el,tp)
Duel.SendtoDeck(sg,nil,2,REASON_COST)
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_IMMUNE_EFFECT)
e3:SetTargetRange(LOCATION_ONFIELD,0)
e3:SetTarget(aux.TargetBoolFunction(Card.IsSetCard,0x356))
e3:SetValue(cm.efilter)
e3:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e3,tp)
end
function cm.efilter(e,re)
return e:GetOwnerPlayer()~=re:GetOwnerPlayer()
end
function cm.cost1(e,tp,eg,ep,ev,re,r,rp,chk)
local el={{13254036,2}}
local mg=tama.tamas_checkGroupElements(Duel.GetFieldGroup(tp,LOCATION_GRAVE,0),el)
local sg=Group.CreateGroup()
if chk==0 then
return mg:GetCount()>0 and mg:IsExists(tama.tamas_selectElementsForAbove,1,nil,mg,sg,el) and e:GetHandler():IsAbleToRemoveAsCost()
end
Duel.Remove(e:GetHandler(),POS_FACEUP,REASON_COST)
local sg=tama.tamas_selectAllSelectForAbove(mg,el,tp)
Duel.SendtoDeck(sg,nil,2,REASON_COST)
end
function cm.operation1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
--actlimit
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EVENT_CHAINING)
e3:SetOperation(cm.chainop)
e3:SetReset(RESET_EVENT+EVENT_CHAIN_END)
Duel.RegisterEffect(e3,tp)
end
function cm.chainop(e,tp,eg,ep,ev,re,r,rp)
if re:GetHandler():IsSetCard(0x356) then
Duel.SetChainLimit(
function (e,tp,fp)
return tp==fp
end
)
end
end
--元始飞球秘术·活化
local m=13254045
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()
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,0))
e2:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND+CATEGORY_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_FZONE)
e2:SetCountLimit(1,m)
e2:SetCost(cm.cost)
e2:SetTarget(cm.target)
e2:SetOperation(cm.operation)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,1))
e3:SetCategory(CATEGORY_DRAW)
e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_FZONE)
e3:SetCountLimit(1)
e3:SetCost(cm.cost1)
e3:SetTarget(cm.target1)
e3:SetOperation(cm.operation1)
c:RegisterEffect(e3)
end
function cm.tdfilter(c)
return c:IsType(TYPE_MONSTER) and c:IsAbleToDeckAsCost() and Duel.IsExistingMatchingCard(cm.tdfilter,tp,0,LOCATION_DECK,1,nil,c)
end
function cm.thfilter(c,tc)
return c:IsSetCard(0x3356) and c:IsType(TYPE_MONSTER) and tama.tamas_checkElementsEmpty(tama.tamas_getElements(c) and tama.tamas_checkCardElementsGreater(tc,c) and c:IsAbleToHand()
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.tdfilter,tp,LOCATION_GRAVE,0,1,nil) end
local sg=Duel.SelectMatchingCard(tp,cm.tdfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.SendtoDeck(sg,nil,2,REASON_COST)
e:SetLabelObject(sg:GetFirst())
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
if not e:GetLabelObject() or not e:GetHandler():IsRelateToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,cm.thfilter,tp,LOCATION_DECK,0,1,1,nil,e:GetLabelObject())
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
if Duel.SelectYesNo(aux.Stringid(m,2)) then
Duel.BreakEffect()
Duel.Summon(tp,g:GetFirst(),true,nil)
end
end
end
function cm.tdfilter1(c)
return c:IsSetCard(0x3356) and c:IsAbleToDeckAsCost()
end
function cm.cost1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.tdfilter1,tp,LOCATION_HAND,0,2,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectMatchingCard(tp,cm.tdfilter1,tp,LOCATION_HAND,0,1,2,nil)
Duel.SendtoDeck(g,nil,2,REASON_COST)
end
function cm.target1(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 cm.operation1(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Draw(p,d,REASON_EFFECT)
end
--梦见
yume=yume or {}
yume.temp_card_field=yume.temp_card_field or {}
if c71400001 then
function c71400001.initial_effect(c)
--Activate(nofield)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(71400001,1))
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCondition(yume.nonYumeCon)
e1:SetTarget(yume.YumeFieldCheckTarget(0,1))
e1:SetCost(c71400001.cost)
e1:SetOperation(c71400001.activate1)
e1:SetCountLimit(1,71400001+EFFECT_COUNT_CODE_OATH)
c:RegisterEffect(e1)
--Activate(field)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(71400001,2))
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e2:SetType(EFFECT_TYPE_ACTIVATE)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetCondition(yume.YumeCon)
e2:SetTarget(c71400001.target2)
e2:SetCost(c71400001.cost)
e2:SetOperation(c71400001.activate2)
e2:SetCountLimit(1,71400001+EFFECT_COUNT_CODE_OATH)
c:RegisterEffect(e2)
end
function c71400001.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckLPCost(tp,500) end
Duel.PayLPCost(tp,500)
end
function c71400001.activate1(e,tp,eg,ep,ev,re,r,rp)
yume.FieldActivation(tp,nil,1)
end
function c71400001.activate2(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c71400001.filter2,tp,LOCATION_DECK,0,1,1,nil,tp)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
function c71400001.filter1(c,tp)
return c:IsType(TYPE_FIELD) and c:GetActivateEffect():IsActivatable(tp,true) and c:IsSetCard(0xb714)
end
function c71400001.filter2(c,tp)
return c:IsSetCard(0x714) and c:IsAbleToHand() and not c:IsCode(71400001)
end
function c71400001.target2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c71400001.filter2,tp,LOCATION_DECK,0,1,nil,tp) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
end
--global part
table=require("table")
function yume.AddYumeSummonLimit(c,ssm)
--1=special summon monster, 0=non special summon monster
ssm=ssm or 0
local el1=Effect.CreateEffect(c)
el1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
el1:SetType(EFFECT_TYPE_SINGLE)
el1:SetCode(EFFECT_SPSUMMON_CONDITION)
el1:SetValue(yume.YumeCheck)
c:RegisterEffect(el1)
if ssm==0 then
local el2=Effect.CreateEffect(c)
el2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
el2:SetType(EFFECT_TYPE_SINGLE)
el2:SetCode(EFFECT_CANNOT_MSET)
el2:SetCondition(yume.YumeCheck2)
c:RegisterEffect(el2)
local el3=el2:Clone()
el3:SetCode(EFFECT_CANNOT_SUMMON)
c:RegisterEffect(el3)
end
end
function yume.GetValueType(v)
local t=type(v)
if t=="userdata" then
local mt=getmetatable(v)
if mt==Group then return "Group"
elseif mt==Effect then return "Effect"
else return "Card" end
else return t end
end
function yume.YumeCheckFilter(c)
return c:IsFaceup() and c:IsSetCard(0x3714)
end
function yume.IsYumeFieldOnField(tp)
return Duel.IsExistingMatchingCard(yume.YumeCheckFilter,tp,LOCATION_FZONE,0,1,nil)
end
--[[
Yume SpSummon Check
v in effect = spsummon condition value(return true = can summon)
v in card = material filter gen(return true = can summon)
--]]
function yume.YumeCheck(v,se,sp)
local t=yume.GetValueType(v)
if t=="Effect" then
return yume.IsYumeFieldOnField(sp)
elseif t=="Card" then
return function(c) return yume.IsYumeFieldOnField(v:GetControler()) end
end
end
--[[
Yume Summon/Set Check
return true = cannot summon
--]]
function yume.YumeCheck2(e)
return not yume.IsYumeFieldOnField(e:GetHandler():GetControler())
end
--Yume Condition
function yume.YumeCon(e,tp,eg,ep,ev,re,r,rp)
if not tp then tp=e:GetHandlerPlayer() end
return yume.IsYumeFieldOnField(tp)
end
--Yume Condition for lethal weapons
function yume.YumeLethalCon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==tp and yume.YumeCon(e,tp,eg,ep,ev,re,r,rp)
end
function yume.nonYumeCon(e,tp,eg,ep,ev,re,r,rp)
if not tp then tp=e:GetHandlerPlayer() end
return not yume.IsYumeFieldOnField(tp)
end
--ft=field type, 0-All Yume 1-Visionary Yume 2-Erosive Yume
--loc=location
function yume.AddYumeFieldGlobal(c,id,ft)
ft=ft or 0
if not id then return end
yume.temp_card_field[c]=yume.temp_card_field[c] or {}
yume.temp_card_field[c].id=id
yume.temp_card_field[c].ft=ft
--Activate
local eac=Effect.CreateEffect(c)
eac:SetType(EFFECT_TYPE_ACTIVATE)
eac:SetCode(EVENT_FREE_CHAIN)
eac:SetCountLimit(1,id+EFFECT_COUNT_CODE_OATH)
--eac:SetCost(yume.FieldActCostForNow)
c:RegisterEffect(eac)
--self limitation
local esl=Effect.CreateEffect(c)
esl:SetDescription(aux.Stringid(71400001,1))
esl:SetType(EFFECT_TYPE_QUICK_F)
esl:SetCode(EVENT_CHAINING)
esl:SetRange(LOCATION_FZONE)
esl:SetCondition(yume.YumeFieldLimitCon)
esl:SetOperation(yume.YumeFieldLimitOp)
c:RegisterEffect(esl)
--field activation
local efa=Effect.CreateEffect(c)
efa:SetDescription(aux.Stringid(71400001,2))
efa:SetCategory(EFFECT_TYPE_ACTIVATE)
efa:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
efa:SetCode(EVENT_LEAVE_FIELD)
efa:SetRange(LOCATION_FZONE)
efa:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
efa:SetCondition(yume.FieldActivationCon)
efa:SetOperation(yume.FieldActivationOp)
c:RegisterEffect(efa)
end
function yume.FieldActCostForNow(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local num=yume.temp_card_field[c].id
if chk==0 then return Duel.GetFlagEffect(tp,num)==0 end
end
--Against Yume
function yume.YumeFieldLimitCon(e,tp,eg,ep,ev,re,r,rp)
local ec=re:GetHandler()
local loc=Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_LOCATION)
return re:IsActiveType(TYPE_MONSTER) and rp==tp and (not ec:IsSetCard(0x714) and (ec:IsLocation(loc) or loc&LOCATION_ONFIELD==0) or not (ec:IsPreviousSetCard(0x714) or ec:IsLocation(loc)) and loc&LOCATION_ONFIELD~=0)
end
function yume.YumeFieldLimitOp(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetTarget(aux.TargetBoolFunction(Card.IsSetCard,0x714))
e1:SetTargetRange(1,0)
Duel.RegisterEffect(e1,tp)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetCode(EFFECT_CANNOT_SUMMON)
e2:SetReset(RESET_PHASE+PHASE_END)
e2:SetTarget(aux.TargetBoolFunction(Card.IsSetCard,0x714))
e2:SetTargetRange(1,0)
Duel.RegisterEffect(e2,tp)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e3:SetCode(EFFECT_CANNOT_MSET)
e3:SetReset(RESET_PHASE+PHASE_END)
e3:SetTarget(aux.TargetBoolFunction(Card.IsSetCard,0x714))
e3:SetTargetRange(1,0)
Duel.RegisterEffect(e3,tp)
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD)
e4:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e4:SetCode(EFFECT_CANNOT_ACTIVATE)
e4:SetReset(RESET_PHASE+PHASE_END)
e4:SetValue(yume.YumeFieldActivationLimit)
e4:SetTargetRange(1,0)
Duel.RegisterEffect(e4,tp)
end
function yume.YumeFieldActivationLimit(e,re,tp)
local c=re:GetHandler()
return c:IsSetCard(0x714) and not c:IsImmuneToEffect(e)
end
--Field Activation
function yume.YumeFieldCheck(tp,num,ft,loc)
ft=ft or 0
num=num or 0
loc=loc or LOCATION_DECK
return Duel.IsExistingMatchingCard(yume.FieldActivationFilter,tp,loc,0,1,nil,tp,num,ft)
end
function yume.YumeFieldCheckTarget(num,ft,loc)
return function(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return yume.YumeFieldCheck(tp,num,ft,loc) end
end
end
function yume.FieldActivation(tp,num,ft,loc)
ft=ft or 0
num=num or 0
loc=loc or LOCATION_DECK
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(71400001,3))
local tc=Duel.SelectMatchingCard(tp,yume.FieldActivationFilter,tp,loc,0,1,1,nil,tp,num,ft):GetFirst()
if tc then
local fc=Duel.GetFieldCard(tp,LOCATION_SZONE,5)
if fc then
Duel.SendtoGrave(fc,REASON_RULE)
Duel.BreakEffect()
end
Duel.MoveToField(tc,tp,tp,LOCATION_SZONE,POS_FACEUP,true)
local te=tc:GetActivateEffect()
te:UseCountLimit(tp,1,true)
local tep=tc:GetControler()
local cost=te:GetCost()
if cost then cost(te,tep,eg,ep,ev,re,r,rp,1) end
local id=yume.temp_card_field[tc].id or 0
--Duel.RegisterFlagEffect(tp,id,RESET_PHASE+PHASE_END,0,1)
Duel.RaiseEvent(tc,4179255,te,0,tp,tp,Duel.GetCurrentChain())
return tc
end
end
function yume.FieldActivationFilter(c,tp,num,ft)
local flag=c:IsType(TYPE_FIELD) and c:GetActivateEffect():IsActivatable(tp,true,true) and not c:IsCode(num)
if ft==0 then return flag and c:IsSetCard(0x3714)
elseif ft==1 then return flag and c:IsSetCard(0xb714)
elseif ft==2 then return flag and c:IsSetCard(0x7714)
end
end
function yume.FieldActivationCon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsReason(REASON_EFFECT) and not c:IsLocation(LOCATION_DECK)
and c:IsPreviousPosition(POS_FACEUP)
end
function yume.FieldActivationOp(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local num=yume.temp_card_field[c].id
local ft=yume.temp_card_field[c].ft
yume.FieldActivation(tp,num,ft,LOCATION_DECK+LOCATION_HAND)
end
--uniquify the same name
function yume.UniquifyCardName(g)
local tc=g:GetFirst()
while tc do
g:Remove(Card.IsCode,tc,tc:GetCode())
tc=g:GetNext()
end
end
\ No newline at end of file
--冰雪中的梦之旅者
function c71400002.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,71400002)
e1:SetCondition(c71400002.condition1)
c:RegisterEffect(e1)
--attribute
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetRange(LOCATION_MZONE)
e2:SetTargetRange(LOCATION_GRAVE+LOCATION_MZONE,0)
e2:SetCode(EFFECT_CHANGE_ATTRIBUTE)
e2:SetValue(ATTRIBUTE_WATER)
c:RegisterEffect(e2)
--to deck
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(71400002,0))
e3:SetCategory(CATEGORY_TODECK)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetHintTiming(TIMING_DAMAGE_STEP,TIMING_DAMAGE_STEP+TIMING_TOGRAVE)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetRange(LOCATION_MZONE)
e3:SetTarget(c71400002.target3)
e3:SetOperation(c71400002.operation3)
e3:SetCountLimit(1)
c:RegisterEffect(e3)
end
function c71400002.filter1(c)
return c:IsSetCard(0x714) and c:IsFaceup()
end
function c71400002.filter3(c)
return c:IsAbleToDeck() and c:IsType(TYPE_MONSTER) and c:IsAttribute(ATTRIBUTE_WATER)
end
function c71400002.condition1(e,c)
if c==nil then return true end
local tp=c:GetControler()
return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.GetFieldGroupCount(tp,LOCATION_ONFIELD,LOCATION_ONFIELD)>0
and Duel.IsExistingMatchingCard(c71400002.filter1,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil)
end
function c71400002.target3(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 c71400002.filter3(chkc) and chkc~=c end
if chk==0 then return Duel.IsExistingTarget(c71400002.filter3,tp,LOCATION_MZONE+LOCATION_GRAVE,LOCATION_MZONE+LOCATION_GRAVE,1,c) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectTarget(tp,c71400002.filter3,tp,LOCATION_MZONE+LOCATION_GRAVE,LOCATION_MZONE+LOCATION_GRAVE,1,1,c)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,1,0,LOCATION_MZONE+LOCATION_GRAVE)
end
function c71400002.operation3(e,tp,eg,ep,ev,re,r,rp,chk)
local tc=Duel.GetFirstTarget()
local c=e:GetHandler()
if tc:IsRelateToEffect(e) and Duel.SendtoDeck(tc,nil,2,REASON_EFFECT)>0 and c:IsRelateToEffect(e) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetReset(RESET_EVENT+0x1ff0000)
e1:SetValue(500)
c:RegisterEffect(e1)
end
end
\ No newline at end of file
--梦之公寓的圆盘人
xpcall(function() require("expansions/script/c71400001") end,function() require("script/c71400001") end)
function c71400004.initial_effect(c)
--summon limit
yume.AddYumeSummonLimit(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetRange(LOCATION_HAND)
e1:SetCondition(c71400004.condition1)
c:RegisterEffect(e1)
--search
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(71400004,0))
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_BE_MATERIAL)
e2:SetCountLimit(1,71400004)
e2:SetCondition(c71400004.condition2)
e2:SetTarget(c71400004.target2)
e2:SetOperation(c71400004.operation2)
c:RegisterEffect(e2)
end
function c71400004.filter1(c)
return c:IsSetCard(0x714) and c:IsFaceup() and c:IsType(TYPE_TUNER)
end
function c71400004.condition1(e,c)
if c==nil then return true end
local tp=c:GetControler()
return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)>0
and Duel.IsExistingMatchingCard(c71400004.filter1,tp,LOCATION_MZONE,0,1,nil) and yume.YumeCheck(c)
end
function c71400004.filter2(c)
return c:IsSetCard(0xe714) and c:IsAbleToHand()
end
function c71400004.condition2(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsLocation(LOCATION_GRAVE) and r==REASON_SYNCHRO
end
function c71400004.target2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c71400004.filter2,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c71400004.operation2(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c71400004.filter2,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
\ No newline at end of file
--梦之钢琴师
xpcall(function() require("expansions/script/c71400001") end,function() require("script/c71400001") end)
function c71400005.initial_effect(c)
--summon limit
yume.AddYumeSummonLimit(c)
--summon success
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(71400005,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetTarget(c71400005.target1)
e1:SetCountLimit(1,71400005)
e1:SetOperation(c71400005.operation1)
c:RegisterEffect(e1)
--synchro effect
local e2=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(71400005,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_MZONE)
e2:SetHintTiming(0,TIMING_BATTLE_START+TIMING_BATTLE_END)
e2:SetCountLimit(1)
e2:SetCondition(c71400005.condition2)
e2:SetTarget(c71400005.target2)
e2:SetOperation(c71400005.operation2)
c:RegisterEffect(e2)
end
function c71400005.filter1(c,e,sp)
return c:IsSetCard(0x714) and c:IsCanBeSpecialSummoned(e,0,sp,false,false)
end
function c71400005.target1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c71400005.filter1,tp,LOCATION_DECK,0,1,nil,e,tp)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function c71400005.operation1(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c71400005.filter1,tp,LOCATION_DECK,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP_DEFENSE)
end
end
function c71400005.condition2(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetTurnPlayer()==tp then return false end
local ph=Duel.GetCurrentPhase()
return ph==PHASE_MAIN1 or (ph>=PHASE_BATTLE_START and ph<=PHASE_BATTLE) or ph==PHASE_MAIN2
end
function c71400005.filter2(c)
return c:IsSetCard(0x714)
end
function c71400005.synfilter(c,mg)
return c:IsSetCard(0x714) and c:IsSynchroSummonable(nil,mg)
end
function c71400005.target2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local mg=Duel.GetMatchingGroup(c71400005.filter2,tp,LOCATION_MZONE,0,nil)
return Duel.IsExistingMatchingCard(c71400005.synfilter,tp,LOCATION_EXTRA,0,1,nil,mg)
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function c71400005.operation2(e,tp,eg,ep,ev,re,r,rp)
local mg=Duel.GetMatchingGroup(c71400005.filter2,tp,LOCATION_MZONE,0,nil)
local g=Duel.GetMatchingGroup(c71400005.synfilter,tp,LOCATION_EXTRA,0,nil,mg)
if g:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=g:Select(tp,1,1,nil)
Duel.SynchroSummon(tp,sg:GetFirst(),nil,mg)
end
end
\ No newline at end of file
--梦医院的梦之患者
xpcall(function() require("expansions/script/c71400001") end,function() require("script/c71400001") end)
function c71400006.initial_effect(c)
--summon limit
yume.AddYumeSummonLimit(c)
--summon success
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(71400006,0))
e1:SetCountLimit(1,71400006)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_REMOVE)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetTarget(c71400006.target1)
e1:SetOperation(c71400006.operation1)
c:RegisterEffect(e1)
local e1a=e1:Clone()
e1a:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e1a)
--self des
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(71400006,1))
e2:SetCategory(CATEGORY_DESTROY)
e2:SetType(EFFECT_TYPE_QUICK_F)
e2:SetRange(LOCATION_MZONE)
e2:SetCode(EVENT_BECOME_TARGET)
e2:SetCondition(c71400006.con2)
e2:SetTarget(c71400006.target2)
e2:SetOperation(c71400006.operation2)
c:RegisterEffect(e2)
local e2a=e2:Clone()
e2a:SetDescription(aux.Stringid(71400006,1))
e2a:SetCode(EVENT_BE_BATTLE_TARGET)
c:RegisterEffect(e2a)
end
function c71400006.filter1(c,e,tp)
return c:IsLevelBelow(4) and c:IsSetCard(0x714) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c71400006.target1(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c71400006.filter1(chkc,e,tp) end
if chk==0 then return Duel.IsExistingTarget(c71400006.filter1,tp,LOCATION_GRAVE,0,1,nil,e,tp) and Duel.IsExistingMatchingCard(aux.TRUE,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c71400006.filter1,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,tp,LOCATION_GRAVE)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,1,0,LOCATION_MZONE)
end
function c71400006.operation1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP_DEFENSE) then
Duel.SpecialSummonComplete()
local dg=Duel.GetMatchingGroup(Card.IsAbleToRemove,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
if dg:GetCount()>0 then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,Card.IsAbleToRemove,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
Duel.HintSelection(g)
Duel.Remove(g:GetFirst(),POS_FACEUP,REASON_EFFECT)
end
end
end
function c71400006.con2(e,tp,eg,ep,ev,re,r,rp)
return eg:IsContains(e:GetHandler())
end
function c71400006.target2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_DESTROY,e:GetHandler(),1,0,0)
end
function c71400006.operation2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.Destroy(c,REASON_EFFECT)
end
end
\ No newline at end of file
--梦之镇的路标
xpcall(function() require("expansions/script/c71400001") end,function() require("script/c71400001") end)
function c71400007.initial_effect(c)
--summon limit
yume.AddYumeSummonLimit(c)
--summon success
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetDescription(aux.Stringid(71400007,0))
e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetCountLimit(1,71400007)
e1:SetTarget(c71400007.tg1)
e1:SetOperation(c71400007.op1)
c:RegisterEffect(e1)
local e1a=e1:Clone()
e1a:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e1a)
--gy banish
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetDescription(aux.Stringid(71400007,1))
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,71500007)
e2:SetCost(c71400007.cost)
e2:SetTarget(c71400007.target)
e2:SetOperation(c71400007.operation)
c:RegisterEffect(e2)
end
function c71400007.tg1(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 Card.IsLinkState(chkc) and chkc~=c end
if chk==0 then return Duel.IsExistingTarget(Card.IsLinkState,tp,LOCATION_MZONE,0,1,c) and Duel.GetLocationCount(tp,LOCATION_MZONE,tp,LOCATION_REASON_CONTROL)>0 end
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(71400007,2))
Duel.SelectTarget(tp,Card.IsLinkState,tp,LOCATION_MZONE,0,1,1,c)
end
function c71400007.op1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if not tc:IsRelateToEffect(e) or tc:IsControler(1-tp) or tc:IsImmuneToEffect(e) or Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOZONE)
local s=Duel.SelectDisableField(tp,1,LOCATION_MZONE,0,0)
local nseq=math.log(s,2)
Duel.MoveSequence(tc,nseq)
end
function c71400007.filter(c,e,tp,zone)
return c:IsSetCard(0x714) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP,tp,zone)
end
function c71400007.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToRemoveAsCost() end
Duel.Remove(e:GetHandler(),POS_FACEUP,REASON_COST)
end
function c71400007.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local zone=Duel.GetLinkedZone(tp)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_GRAVE) and c71400007.filter(chkc,e,tp,zone) end
if chk==0 then return zone~=0
and Duel.IsExistingTarget(c71400007.filter,tp,LOCATION_GRAVE,0,1,e:GetHandler(),e,tp,zone) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tg=Duel.SelectTarget(tp,c71400007.filter,tp,LOCATION_GRAVE,0,1,1,e:GetHandler(),e,tp,zone)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,tg,1,0,0)
end
function c71400007.operation(e,tp,eg,ep,ev,re,r,rp)
local zone=Duel.GetLinkedZone(tp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and zone~=0 then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP,zone)
end
end
\ No newline at end of file
--梦之书中的三足怪物
xpcall(function() require("expansions/script/c71400001") end,function() require("script/c71400001") end)
function c71400008.initial_effect(c)
--xyz summon
aux.AddXyzProcedure(c,yume.YumeCheck(c),4,3)
c:EnableReviveLimit()
--summon limit
yume.AddYumeSummonLimit(c,1)
--nuke
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(71400008,0))
e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_QUICK_F)
e1:SetCode(EVENT_CHAINING)
e1:SetRange(LOCATION_MZONE)
e1:SetCondition(c71400008.condition)
e1:SetCost(c71400008.cost)
e1:SetTarget(c71400008.target)
e1:SetOperation(c71400008.operation)
c:RegisterEffect(e1)
end
function c71400008.condition(e,tp,eg,ep,ev,re,r,rp)
return rp~=tp
end
function c71400008.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST)
end
function c71400008.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local g=Duel.GetMatchingGroup(aux.TRUE,tp,0,LOCATION_ONFIELD,e:GetHandler())
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),1-tp,0)
end
function c71400008.operation(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(aux.TRUE,tp,0,LOCATION_ONFIELD,e:GetHandler())
if Duel.Destroy(g,REASON_EFFECT)>0 then
Duel.BreakEffect()
Duel.SetLP(tp,Duel.GetLP(tp)-1500)
end
end
\ No newline at end of file
--梦之书中的公式证明图表
xpcall(function() require("expansions/script/c71400001") end,function() require("script/c71400001") end)
function c71400009.initial_effect(c)
--xyz summon
aux.AddXyzProcedure(c,yume.YumeCheck(c),4,2)
c:EnableReviveLimit()
--summon limit
yume.AddYumeSummonLimit(c,1)
--destroy
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DESTROY+CATEGORY_REMOVE)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_LEAVE_FIELD)
e1:SetDescription(aux.Stringid(71400009,0))
e1:SetCondition(c71400009.condition)
e1:SetTarget(c71400009.target)
e1:SetOperation(c71400009.operation)
c:RegisterEffect(e1)
end
function c71400009.condition(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local ct=c:GetOverlayCount()
e:SetLabel(ct)
return c:IsPreviousPosition(POS_FACEUP) and not c:IsLocation(LOCATION_DECK)
end
function c71400009.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_DESTROY,nil,0,1-tp,LOCATION_ONFIELD+LOCATION_HAND)
end
function c71400009.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectMatchingCard(tp,aux.TRUE,tp,LOCATION_HAND,0,1,1,nil)
if g:GetCount()==0 then return end
if Duel.Destroy(g,REASON_EFFECT)~=0 then
local mcount=e:GetLabel()
if not mcount or mcount<=0 or not Duel.IsExistingMatchingCard(aux.TRUE,tp,0,LOCATION_ONFIELD,mcount,nil) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local sg=Duel.SelectMatchingCard(tp,aux.TRUE,tp,0,LOCATION_ONFIELD,mcount,mcount,nil)
Duel.HintSelection(sg)
if Duel.Destroy(sg,REASON_EFFECT)>0 then
Duel.BreakEffect()
Duel.SetLP(tp,Duel.GetLP(tp)-1000)
end
end
end
\ No newline at end of file
--梦之书中的脑女
xpcall(function() require("expansions/script/c71400001") end,function() require("script/c71400001") end)
function c71400010.initial_effect(c)
--xyz summon
aux.AddXyzProcedure(c,yume.YumeCheck(c),4,2)
c:EnableReviveLimit()
--summon limit
yume.AddYumeSummonLimit(c,1)
--get all
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_CONTROL)
e1:SetDescription(aux.Stringid(71400010,0))
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetCountLimit(1,71400010)
e1:SetRange(LOCATION_MZONE)
e1:SetCost(c71400010.cost)
e1:SetTarget(c71400010.target1)
e1:SetOperation(c71400010.operation1)
c:RegisterEffect(e1)
--lose one
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_CONTROL)
e2:SetDescription(aux.Stringid(71400010,1))
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e2:SetCode(EVENT_LEAVE_FIELD)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetTarget(c71400010.target2)
e2:SetOperation(c71400010.operation2)
e2:SetCondition(c71400010.condition2)
c:RegisterEffect(e2)
end
function c71400010.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) and Duel.GetCurrentPhase()~=PHASE_MAIN2 end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_BP)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
e1:SetTargetRange(1,0)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST)
end
function c71400010.filter1(c)
return c:IsFaceup() and c:IsAbleToChangeControler()
end
function c71400010.target1(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE,1-tp,LOCATION_REASON_CONTROL)
if chk==0 then return Duel.IsExistingMatchingCard(c71400010.filter1,tp,0,LOCATION_MZONE,1,nil) and ft>0 end
local g=Duel.GetMatchingGroup(c71400010.filter1,tp,0,LOCATION_MZONE,c)
Duel.SetOperationInfo(0,CATEGORY_CONTROL,g,g:GetCount(),1-tp,LOCATION_MZONE)
end
function c71400010.operation1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE,1-tp,LOCATION_REASON_CONTROL)
local g=Duel.GetMatchingGroup(c71400010.filter1,tp,0,LOCATION_MZONE,c)
local ct=g:GetCount()
if ct>ft then ct=ft end
if ct<1 then return end
if ct<g:GetCount() then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONTROL)
g=g:Select(tp,ct,ct,nil)
end
Duel.GetControl(g,tp)
local og=Duel.GetOperatedGroup()
if og:GetCount()<1 then return end
local tc=og:GetFirst()
local atk=0
while tc do
local tatk=tc:GetAttack()
if tatk>0 then atk=atk+tatk end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_ADD_SETCODE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetValue(0x714)
e1:SetReset(RESET_EVENT+0x1fe0000)
tc:RegisterEffect(e1,true)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e2:SetCode(EFFECT_CANNOT_BE_LINK_MATERIAL)
e2:SetValue(1)
e2:SetReset(RESET_EVENT+0x1fe0000)
tc:RegisterEffect(e2,true)
tc=og:GetNext()
end
Duel.BreakEffect()
Duel.SetLP(tp,Duel.GetLP(tp)-atk/2)
end
function c71400010.condition2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsPreviousPosition(POS_FACEUP) and not c:IsLocation(LOCATION_DECK)
end
function c71400010.target2(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:GetLocation()==LOCATION_MZONE and chkc:GetControler()==tp and chkc:IsControlerCanBeChanged() end
if chk==0 then return Duel.IsExistingTarget(Card.IsControlerCanBeChanged,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONTROL)
local g=Duel.SelectTarget(tp,Card.IsControlerCanBeChanged,tp,LOCATION_MZONE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_CONTROL,g,1,tp,LOCATION_MZONE)
end
function c71400010.operation2(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.GetControl(tc,1-tp)
end
end
\ No newline at end of file
--梦之书的管理员
xpcall(function() require("expansions/script/c71400001") end,function() require("script/c71400001") end)
function c71400011.initial_effect(c)
--xyz summon
aux.AddXyzProcedure(c,yume.YumeCheck(c),4,2)
c:EnableReviveLimit()
--summon limit
yume.AddYumeSummonLimit(c,1)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(71400011,0))
e1:SetCountLimit(1,71400011)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCost(c71400011.cost)
e1:SetTarget(c71400011.target1)
e1:SetOperation(c71400011.operation1)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
c:RegisterEffect(e1)
--fly away
local e2a=Effect.CreateEffect(c)
e2a:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2a:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2a:SetCode(EVENT_CHAINING)
e2a:SetRange(LOCATION_MZONE+LOCATION_GRAVE)
e2a:SetOperation(aux.chainreg)
c:RegisterEffect(e2a)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(71400011,1))
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e2:SetCode(EVENT_CHAIN_SOLVED)
e2:SetRange(LOCATION_MZONE+LOCATION_GRAVE)
e2:SetCondition(c71400011.condition2)
e2:SetTarget(c71400011.target2)
e2:SetOperation(c71400011.operation2)
c:RegisterEffect(e2)
end
function c71400011.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST)
end
function c71400011.filter1(c)
return c:IsSetCard(0x714)
end
function c71400011.xyzfilter(c,e,tp)
return c:IsSetCard(0x3715) and c:IsType(TYPE_XYZ) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c71400011.target1(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return Duel.GetLocationCountFromEx(tp)>0
and Duel.IsExistingTarget(c71400011.filter1,tp,LOCATION_GRAVE,0,1,nil) and Duel.IsExistingMatchingCard(c71400011.xyzfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL)
local g1=Duel.SelectTarget(tp,c71400011.filter1,tp,LOCATION_GRAVE,0,1,2,nil)
Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,g1,g1:GetCount(),tp,LOCATION_GRAVE)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function c71400011.operation1(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCountFromEx(tp)<=0 then return end
local g=Duel.GetMatchingGroup(c71400011.xyzfilter,tp,LOCATION_EXTRA,0,nil,e,tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=g:Select(tp,1,1,nil)
local sc=sg:GetFirst()
if sc then
Duel.SpecialSummon(sc,0,tp,tp,false,false,POS_FACEUP)
local mg=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(Card.IsRelateToEffect,nil,e)
if mg:GetCount()>0 then
Duel.Overlay(sc,mg)
end
end
end
function c71400011.filter2(c)
return c:IsSetCard(0xb714) and c:IsType(TYPE_FIELD) and c:IsAbleToHand()
end
function c71400011.condition2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local rc=re:GetHandler()
return rc:IsCode(71400026) and c:GetFlagEffect(1)>0 and re:IsHasType(EFFECT_TYPE_ACTIVATE)
end
function c71400011.target2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK+LOCATION_GRAVE)
end
function c71400011.operation2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and bit.band(c:GetOriginalType(),0x802040)~=0 and Duel.SendtoDeck(c,nil,0,REASON_EFFECT)~=0 and c:IsLocation(LOCATION_EXTRA) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c71400011.filter2,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
end
\ No newline at end of file
--梦之迷宫的剧面人
xpcall(function() require("expansions/script/c71400001") end,function() require("script/c71400001") end)
function c71400012.initial_effect(c)
--synchro summon
aux.AddSynchroProcedure(c,yume.YumeCheck(c),aux.NonTuner(yume.YumeCheck(c)),1)
c:EnableReviveLimit()
--summon limit
yume.AddYumeSummonLimit(c,1)
--cannot be target
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetValue(aux.tgoval)
c:RegisterEffect(e1)
--banish
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(71400012,0))
e2:SetCategory(CATEGORY_REMOVE+CATEGORY_DAMAGE)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e2:SetCode(EVENT_BATTLE_START)
e2:SetTarget(c71400012.target)
e2:SetOperation(c71400012.operation)
c:RegisterEffect(e2)
end
function c71400012.target(e,tp,eg,ep,ev,re,r,rp,chk)
local tc=e:GetHandler():GetBattleTarget()
if chk==0 then return tc and tc:IsControler(1-tp) and tc:IsAbleToRemove() and not tc:IsType(TYPE_TOKEN) end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,tc,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,2000)
end
function c71400012.operation(e,tp,eg,ep,ev,re,r,rp)
if Duel.Damage(1-tp,2000,REASON_EFFECT)~=0 then
local tc=e:GetHandler():GetBattleTarget()
if tc:IsRelateToBattle() then
Duel.Remove(tc,POS_FACEDOWN,REASON_EFFECT)
end
end
end
\ No newline at end of file
--梦坠
function c71400013.initial_effect(c)
--Activate(nofield)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(71400013,1))
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCategory(CATEGORY_TOGRAVE)
e1:SetCondition(c71400013.condition1)
e1:SetTarget(c71400013.target1)
e1:SetCost(c71400013.cost)
e1:SetOperation(c71400013.operation1)
e1:SetCountLimit(1,71400013+EFFECT_COUNT_CODE_OATH)
c:RegisterEffect(e1)
--Activate(field)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(71400013,2))
e2:SetCategory(CATEGORY_TOGRAVE)
e2:SetType(EFFECT_TYPE_ACTIVATE)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetCondition(c71400013.condition2)
e2:SetTarget(c71400013.target2)
e2:SetCost(c71400013.cost)
e2:SetOperation(c71400013.operation2)
e2:SetCountLimit(1,71400013+EFFECT_COUNT_CODE_OATH)
c:RegisterEffect(e2)
end
function c71400013.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckLPCost(tp,500) end
Duel.PayLPCost(tp,500)
end
function c71400013.condition1(e,tp,eg,ep,ev,re,r,rp)
tc=Duel.GetFieldCard(tp,LOCATION_SZONE,5)
return tc==nil or tc:IsFacedown() or not tc:IsSetCard(0x3714)
end
function c71400013.condition2(e,tp,eg,ep,ev,re,r,rp)
tc=Duel.GetFieldCard(tp,LOCATION_SZONE,5)
return tc and tc:IsFaceup() and tc:IsSetCard(0x3714)
end
function c71400013.filter1(c,tp)
return c:IsType(TYPE_FIELD) and c:GetActivateEffect():IsActivatable(tp,true) and c:IsSetCard(0xb714)
end
function c71400013.filter1a(c)
return c:IsFaceup() and c:IsAbleToGrave()
end
function c71400013.filter2(c)
return c:IsSetCard(0x714) and c:IsType(TYPE_MONSTER) and c:IsAbleToGrave()
end
function c71400013.operation1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=yume.FieldActivation(tp,nil,1)
local dg=Duel.GetMatchingGroup(c71400013.filter1a,tp,0,LOCATION_ONFIELD,nil)
if tc and dg:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(71400013,3)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local des=dg:Select(tp,1,1,nil)
Duel.HintSelection(des)
Duel.BreakEffect()
Duel.SendtoGrave(des,REASON_EFFECT)
end
local el1=Effect.CreateEffect(c)
el1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
el1:SetType(EFFECT_TYPE_FIELD)
el1:SetCode(EFFECT_CANNOT_SUMMON)
el1:SetTarget(c71400013.sumlimit)
el1:SetTargetRange(1,0)
el1:SetReset(RESET_PHASE+PHASE_END,2)
c:RegisterEffect(el1,tp)
local el2=el1:Clone()
el2:SetCode(EFFECT_CANNOT_MSET)
c:RegisterEffect(el2)
local el3=el1:Clone()
el3:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
c:RegisterEffect(el3)
end
function c71400013.operation2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c71400013.filter2,tp,LOCATION_HAND+LOCATION_ONFIELD,0,2,2,nil)
if g:GetCount()>0 then
Duel.SendtoGrave(g,nil,REASON_EFFECT)
local og=Duel.GetOperatedGroup()
if og:GetCount()==2 then
Duel.BreakEffect()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_CHAIN_SOLVING)
e1:SetCondition(c71400013.discon)
e1:SetOperation(c71400013.disop)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
end
local el1=Effect.CreateEffect(c)
el1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
el1:SetType(EFFECT_TYPE_FIELD)
el1:SetCode(EFFECT_CANNOT_SUMMON)
el1:SetTarget(c71400013.sumlimit)
el1:SetTargetRange(1,0)
el1:SetReset(RESET_PHASE+PHASE_END,2)
c:RegisterEffect(el1,tp)
local el2=el1:Clone()
el2:SetCode(EFFECT_CANNOT_MSET)
c:RegisterEffect(el2)
local el3=el1:Clone()
el3:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
c:RegisterEffect(el3)
end
function c71400013.discon(e,tp,eg,ep,ev,re,r,rp)
return re:IsActiveType(TYPE_MONSTER) and rp==1-tp
end
function c71400013.disop(e,tp,eg,ep,ev,re,r,rp)
Duel.NegateEffect(ev)
end
function c71400013.sumlimit(e,c)
return not c:IsSetCard(0x714)
end
function c71400013.target1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return yume.YumeFieldCheck(tp,0,1) end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,0,1-tp,LOCATION_ONFIELD)
end
function c71400013.target2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c71400013.filter2,tp,LOCATION_HAND+LOCATION_ONFIELD,0,2,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,2,tp,LOCATION_HAND+LOCATION_ONFIELD)
end
\ No newline at end of file
--妄想梦境-梦幻图书馆
xpcall(function() require("expansions/script/c71400001") end,function() require("script/c71400001") end)
function c71400014.initial_effect(c)
--Activate
--See AddYumeFieldGlobal
--special summon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(71400014,0))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_MAIN_END)
e2:SetCountLimit(1)
e2:SetCondition(c71400014.condition2)
e2:SetRange(LOCATION_FZONE)
e2:SetTarget(c71400014.target2)
e2:SetOperation(c71400014.operation2)
c:RegisterEffect(e2)
--draw
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(71400014,1))
e3:SetCategory(CATEGORY_TOGRAVE)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
e3:SetRange(LOCATION_FZONE)
e3:SetCountLimit(1)
e3:SetCondition(c71400014.condition3)
e3:SetTarget(c71400014.target3)
e3:SetOperation(c71400014.operation3)
c:RegisterEffect(e3)
--self limitation & field activation
yume.AddYumeFieldGlobal(c,71400014,1)
end
function c71400014.operation2(e,tp,eg,ep,ev,re,r,rp)
local cnt=Duel.GetLocationCount(tp,LOCATION_MZONE)
if cnt<=0 or not e:GetHandler():IsRelateToEffect(e) then return end
if Duel.IsPlayerAffectedByEffect(tp,59822133) then cnt=1 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c71400014.filter2,tp,LOCATION_HAND,0,1,cnt,nil,e,tp)
if g:GetCount()==0 then return end
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
local xyzg=Duel.GetMatchingGroup(c71400014.xyzfilter,tp,LOCATION_EXTRA,0,nil)
if xyzg:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(71400014,2)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local xyz=xyzg:Select(tp,1,1,nil):GetFirst()
Duel.BreakEffect()
Duel.XyzSummon(tp,xyz,nil)
end
end
function c71400014.filter2(c,e,tp)
return c:IsSetCard(0x714) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c71400014.target2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c71400014.filter2,tp,LOCATION_HAND,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,0,tp,LOCATION_HAND)
end
function c71400014.condition2(e,tp,eg,ep,ev,re,r,rp)
local ph=Duel.GetCurrentPhase()
return ph==PHASE_MAIN1 or ph==PHASE_MAIN2
end
function c71400014.xyztg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local mg=Duel.GetMatchingGroup(c71400014.xyzfilter,tp,LOCATION_MZONE,0,nil)
return Duel.IsExistingMatchingCard(c71400014.xyz2filter,tp,LOCATION_EXTRA,0,1,nil,mg)
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
--Select Xyz Monsters
function c71400014.xyzfilter(c)
return c:IsSetCard(0x715) and c:IsXyzSummonable(nil)
end
function c71400014.filter3(c)
return c:IsSetCard(0x714) and c:IsSummonType(SUMMON_TYPE_XYZ)
end
function c71400014.condition3(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c71400014.filter3,1,nil)
end
function c71400014.target3(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
--[[
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(1)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,1,tp,1)
--]]
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,1-tp,LOCATION_ONFIELD)
end
function c71400014.operation3(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
--local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
--Duel.Draw(p,d,REASON_EFFECT)
local g=Duel.GetMatchingGroup(Card.IsAbleToGrave,tp,0,LOCATION_ONFIELD,nil)
if g:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
g=g:Select(tp,1,1,nil)
Duel.HintSelection(g)
Duel.SendtoGrave(g:GetFirst(),REASON_EFFECT)
end
end
\ No newline at end of file
--妄想梦境-梦湖回廊
xpcall(function() require("expansions/script/c71400001") end,function() require("script/c71400001") end)
function c71400015.initial_effect(c)
--Activate
--See AddYumeFieldGlobal
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(71400015,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_FZONE)
e1:SetCountLimit(1)
e1:SetCost(c71400015.cost)
e1:SetTarget(c71400015.target1)
e1:SetOperation(c71400015.operation1)
c:RegisterEffect(e1)
--Recover
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(71400015,1))
e2:SetCategory(CATEGORY_RECOVER)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_FZONE)
e2:SetCountLimit(1)
e2:SetTarget(c71400015.target2)
e2:SetOperation(c71400015.operation2)
c:RegisterEffect(e2)
--self limitation & field activation
yume.AddYumeFieldGlobal(c,71400015,1)
end
function c71400015.cost(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_DISCARD+REASON_COST,nil)
end
function c71400015.filter1(c,e,tp)
return c:IsSetCard(0x714) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c71400015.target1(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c71400015.filter1(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c71400015.filter1,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c71400015.filter1,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,tp,LOCATION_GRAVE)
end
function c71400015.operation1(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
if 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_CANNOT_ATTACK)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
Duel.SpecialSummonComplete()
end
end
end
function c71400015.target2(e,tp,eg,ep,ev,re,r,rp,chk)
local mcount=Duel.GetMatchingGroupCount(Card.IsType,tp,0,LOCATION_GRAVE,nil,TYPE_MONSTER)
if chk==0 then return mcount>0 end
Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,mcount*500)
end
function c71400015.operation2(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local mcount=Duel.GetMatchingGroupCount(Card.IsType,tp,0,LOCATION_GRAVE,nil,TYPE_MONSTER)
if mcount>0 then
local val=Duel.Recover(tp,mcount*500,REASON_EFFECT)
end
end
\ No newline at end of file
--妄想梦境-空中庭园
xpcall(function() require("expansions/script/c71400001") end,function() require("script/c71400001") end)
function c71400016.initial_effect(c)
--Activate
--See AddYumeFieldGlobal
--to hand
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(71400016,0))
e1:SetCategory(CATEGORY_DESTROY+CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_FZONE)
e1:SetCountLimit(1)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetTarget(c71400016.target)
e1:SetOperation(c71400016.operation)
c:RegisterEffect(e1)
--self limitation & field activation
yume.AddYumeFieldGlobal(c,71400016,1)
end
function c71400016.filter(c)
return c:IsSetCard(0x714) and c:IsAbleToHand()
end
function c71400016.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c71400016.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c71400016.filter,tp,LOCATION_GRAVE,0,1,nil) and Duel.IsExistingMatchingCard(nil,tp,LOCATION_ONFIELD,0,1,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectTarget(tp,c71400016.filter,tp,LOCATION_GRAVE,0,1,1,nil)
local mg=Duel.GetMatchingGroup(nil,tp,LOCATION_ONFIELD,0,e:GetHandler())
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,tp,LOCATION_GRAVE)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,mg,1,tp,LOCATION_ONFIELD)
end
function c71400016.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectMatchingCard(tp,nil,tp,LOCATION_ONFIELD,0,1,1,c)
if g:GetCount()>0 and tc:IsRelateToEffect(e) and Duel.Destroy(g,REASON_EFFECT)~=0 and Duel.SendtoHand(tc,nil,REASON_EFFECT)~=0 then
Duel.ConfirmCards(1-tp,tc)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EFFECT_CANNOT_ACTIVATE)
e1:SetTargetRange(1,0)
e1:SetValue(c71400016.aclimit)
e1:SetLabelObject(tc)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
end
function c71400016.aclimit(e,re,tp)
local tc=e:GetLabelObject()
return re:GetHandler():IsCode(tc:GetCode()) and not re:GetHandler():IsImmuneToEffect(e)
end
\ No newline at end of file
--妄想梦境-门的世界
xpcall(function() require("expansions/script/c71400001") end,function() require("script/c71400001") end)
function c71400017.initial_effect(c)
--Activate
--See AddYumeFieldGlobal
--search
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(71400017,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_FZONE)
e1:SetCountLimit(1)
e1:SetTarget(c71400017.tg1)
e1:SetOperation(c71400017.op1)
c:RegisterEffect(e1)
--banish
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(71400017,1))
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e2:SetCountLimit(1,71400017+EFFECT_COUNT_CODE_DUEL)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_GRAVE)
e2:SetTarget(c71400017.tg2)
e2:SetCost(c71400017.cost)
e2:SetOperation(c71400017.op2)
c:RegisterEffect(e2)
--self limitation & field activation
yume.AddYumeFieldGlobal(c,71400017,1)
end
function c71400017.filter1(c)
return c:IsSetCard(0xa714) and c:IsType(TYPE_FIELD) and not c:IsCode(71400017) and c:IsAbleToHand()
end
function c71400017.tg1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c71400017.filter1,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,0,tp,LOCATION_DECK)
end
function c71400017.op1(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local g=Duel.GetMatchingGroup(c71400017.filter1,tp,LOCATION_DECK,0,nil)
if g:GetCount()<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local sg1=g:Select(tp,1,1,nil)
--[[
g:Remove(Card.IsCode,nil,sg1:GetFirst():GetCode())
if g:GetCount()>0 and Duel.SelectYesNo(tp,210) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local sg2=g:Select(tp,1,1,nil)
sg1:Merge(sg2)
end
--]]
Duel.SendtoHand(sg1,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,sg1)
end
function c71400017.filter2(c)
return c:IsCode(71400020) and c:IsAbleToHand()
end
function c71400017.filter2c(c)
return c:IsSetCard(0xe714) and c:IsAbleToRemoveAsCost()
end
function c71400017.tg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c71400017.filter2,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c71400017.cost(e,tp,eg,ep,ev,re,r,rp,chk)
c=e:GetHandler()
local g=Duel.GetMatchingGroup(c71400017.filter2c,tp,LOCATION_GRAVE,0,nil)
if chk==0 then return c:IsAbleToRemoveAsCost() and g:GetClassCount(Card.GetCode)>4 end
local rg=Group.CreateGroup()
for i=1,5 do
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local sc=g:Select(tp,1,1,nil):GetFirst()
rg:AddCard(sc)
g:Remove(Card.IsCode,nil,sc:GetCode())
end
rg:AddCard(c)
Duel.Remove(rg,POS_FACEUP,REASON_COST)
end
function c71400017.op2(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c71400017.filter2,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
\ No newline at end of file
--妄想梦物-电锯
xpcall(function() require("expansions/script/c71400001") end,function() require("script/c71400001") end)
function c71400018.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetHintTiming(TIMING_DRAW_PHASE+TIMING_END_PHASE+TIMING_EQUIP,0)
e1:SetCountLimit(1,71400018+EFFECT_COUNT_CODE_OATH)
e1:SetDescription(aux.Stringid(71400018,0))
e1:SetTarget(c71400018.target)
e1:SetCost(c71400018.cost)
e1:SetCondition(yume.YumeLethalCon)
e1:SetOperation(c71400018.operation)
c:RegisterEffect(e1)
end
function c71400018.filter(c)
return c:IsType(TYPE_SPELL+TYPE_TRAP)
end
function c71400018.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckLPCost(tp,500) end
Duel.PayLPCost(tp,500)
end
function c71400018.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and c71400018.filter(chkc) and chkc~=e:GetHandler() end
if chk==0 then return Duel.IsExistingTarget(c71400018.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,c71400018.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,e:GetHandler())
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
if e:IsHasType(EFFECT_TYPE_ACTIVATE) then
Duel.SetChainLimit(c71400018.limit(g:GetFirst()))
end
end
function c71400018.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.Destroy(tc,REASON_EFFECT)
end
if c:IsRelateToEffect(e) and c:IsCanTurnSet() then
Duel.BreakEffect()
c:CancelToGrave()
Duel.ChangePosition(c,POS_FACEDOWN)
Duel.RaiseEvent(c,EVENT_SSET,e,REASON_EFFECT,tp,tp,0)
end
end
function c71400018.limit(c)
return function (e,lp,tp)
return e:GetHandler()~=c
end
end
\ No newline at end of file
--妄想梦物-魔女
function c71400019.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:SetCountLimit(1,71400019+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(c71400019.target)
e1:SetCondition(c71400019.condition)
e1:SetOperation(c71400019.operation)
c:RegisterEffect(e1)
end
function c71400019.filter(c,e,tp)
return c:IsSetCard(0x714) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c71400019.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c71400019.filter,tp,LOCATION_DECK+LOCATION_HAND,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK+LOCATION_HAND)
end
function c71400019.condition(e,tp,eg,ep,ev,re,r,rp)
tc=Duel.GetFieldCard(tp,LOCATION_SZONE,5)
return tc and tc:IsFaceup() and tc:IsSetCard(0x3714)
end
function c71400019.operation(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c71400019.filter,tp,LOCATION_DECK+LOCATION_HAND,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
\ No newline at end of file
--梦终
function c71400020.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCategory(CATEGORY_REMOVE+CATEGORY_SPECIAL_SUMMON)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CANNOT_NEGATE)
e1:SetCondition(c71400020.condition)
e1:SetTarget(c71400020.target)
e1:SetOperation(c71400020.operation)
e1:SetCountLimit(1,71400020+EFFECT_COUNT_CODE_DUEL+EFFECT_COUNT_CODE_OATH)
c:RegisterEffect(e1)
end
function c71400020.filter1(c)
return c:IsSetCard(0x714)
end
function c71400020.filter2(c,tp)
return c:IsType(TYPE_FIELD) and c:GetActivateEffect():IsActivatable(tp,true)
end
function c71400020.filter3(c,e,tp)
return c:IsSetCard(0x714) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c71400020.condition(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c71400020.filter1,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,nil)
local ct=g:GetClassCount(Card.GetCode)
return ct>12
end
function c71400020.target(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(Card.IsAbleToRemove,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,e:GetHandler(),tp)
if chk==0 then return Duel.IsExistingMatchingCard(c71400020.filter2,tp,LOCATION_DECK+LOCATION_GRAVE+LOCATION_HAND,0,1,nil,tp) and g:GetCount()>0 end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,0,tp,0)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,g:GetCount(),0,0)
if e:IsHasType(EFFECT_TYPE_ACTIVATE) then
Duel.SetChainLimit(aux.FALSE)
end
end
function c71400020.operation(e,tp,eg,ep,ev,re,r,rp)
local fg=Duel.GetMatchingGroup(Card.IsAbleToRemove,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,e:GetHandler(),tp)
if Duel.Remove(fg,POS_FACEUP,REASON_EFFECT)<=0 then return end
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(71400020,1))
local tc=Duel.SelectMatchingCard(tp,c71400020.filter2,tp,LOCATION_DECK+LOCATION_GRAVE+LOCATION_HAND,0,1,1,nil,tp):GetFirst()
if tc then
local fc=Duel.GetFieldCard(tp,LOCATION_SZONE,5)
if fc then
Duel.SendtoGrave(fc,REASON_RULE)
Duel.BreakEffect()
end
local flag=Duel.MoveToField(tc,tp,tp,LOCATION_SZONE,POS_FACEUP,true)
local te=tc:GetActivateEffect()
local tep=tc:GetControler()
local cost=te:GetCost()
if cost then cost(te,tep,eg,ep,ev,re,r,rp,1) end
Duel.RaiseEvent(tc,4179255,te,0,tp,tp,Duel.GetCurrentChain())
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if ft<=0 then return end
if Duel.IsPlayerAffectedByEffect(tp,59822133) then ft=1 end
if tc:IsSetCard(0x3714) and flag and Duel.IsExistingMatchingCard(c71400020.filter3,tp,LOCATION_DECK+LOCATION_GRAVE+LOCATION_HAND,0,1,nil,e,tp) and Duel.SelectYesNo(tp,aux.Stringid(71400020,0)) then
Duel.BreakEffect()
local g=Duel.SelectMatchingCard(tp,c71400020.filter3,tp,LOCATION_DECK+LOCATION_GRAVE+LOCATION_HAND,0,ft,ft,nil,e,tp)
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
end
\ No newline at end of file
--妄想梦物-菜刀
xpcall(function() require("expansions/script/c71400001") end,function() require("script/c71400001") end)
function c71400021.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetHintTiming(TIMING_DRAW_PHASE+TIMING_END_PHASE+TIMING_SPSUMMON+TIMING_SUMMON,0)
e1:SetCountLimit(1,71400021+EFFECT_COUNT_CODE_OATH)
e1:SetDescription(aux.Stringid(71400021,0))
e1:SetTarget(c71400021.target)
e1:SetCost(c71400021.cost)
e1:SetCondition(yume.YumeLethalCon)
e1:SetOperation(c71400021.operation)
c:RegisterEffect(e1)
end
function c71400021.filter(c)
return c:IsType(TYPE_MONSTER)
end
function c71400021.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckLPCost(tp,500) end
Duel.PayLPCost(tp,500)
end
function c71400021.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and c71400021.filter(chkc) and chkc~=e:GetHandler() end
if chk==0 then return Duel.IsExistingTarget(c71400021.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,c71400021.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
if e:IsHasType(EFFECT_TYPE_ACTIVATE) then
Duel.SetChainLimit(c71400021.limit(g:GetFirst()))
end
end
function c71400021.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.Destroy(tc,REASON_EFFECT)
end
if c:IsRelateToEffect(e) and c:IsCanTurnSet() then
Duel.BreakEffect()
c:CancelToGrave()
Duel.ChangePosition(c,POS_FACEDOWN)
Duel.RaiseEvent(c,EVENT_SSET,e,REASON_EFFECT,tp,tp,0)
end
end
function c71400021.limit(c)
return function (e,lp,tp)
return e:GetHandler()~=c
end
end
\ No newline at end of file
--梦之眼药商人
xpcall(function() require("expansions/script/c71400001") end,function() require("script/c71400001") end)
function c71400022.initial_effect(c)
--link summon
aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsLinkType,TYPE_EFFECT),2,2,yume.YumeCheck(c))
c:EnableReviveLimit()
--summon limit
yume.AddYumeSummonLimit(c,1)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(71400022,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCountLimit(1,71400022)
e1:SetCondition(c71400022.con1)
e1:SetTarget(c71400022.target)
e1:SetCost(c71400022.cost)
e1:SetOperation(c71400022.op1)
c:RegisterEffect(e1)
--disable spsummon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(71400022,1))
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e2:SetCode(EVENT_TO_GRAVE)
e2:SetCondition(c71400022.con2)
e2:SetOperation(c71400022.op2)
c:RegisterEffect(e2)
end
function c71400022.filter1c(c)
return c:IsSetCard(0x714) and c:IsType(TYPE_MONSTER) and c:IsAbleToGraveAsCost()
end
function c71400022.filter1(c,e,tp)
return c:IsSetCard(0x714) and c:IsType(TYPE_MONSTER) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c71400022.con1(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_LINK)
end
function c71400022.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c71400022.filter1c,tp,LOCATION_DECK,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c71400022.filter1c,tp,LOCATION_DECK,0,1,1,nil)
Duel.SendtoGrave(g,REASON_COST)
end
function c71400022.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c71400022.filter1,tp,LOCATION_HAND,0,1,nil,e,tp) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
end
function c71400022.op1(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c71400022.filter1,tp,LOCATION_HAND,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
function c71400022.con2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsReason(REASON_DESTROY) and rp==1-tp
end
function c71400022.op2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local e1=Effect.CreateEffect(c)
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,2)
Duel.RegisterEffect(e1,1-tp)
end
\ No newline at end of file
--梦染
xpcall(function() require("expansions/script/c71400001") end,function() require("script/c71400001") end)
function c71400023.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(71400023,0))
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,71400023+EFFECT_COUNT_CODE_OATH)
e1:SetHintTiming(0,0x1f0)
e1:SetTarget(yume.YumeFieldCheckTarget())
e1:SetOperation(c71400023.op1)
c:RegisterEffect(e1)
--ac in hand
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetCode(EFFECT_TRAP_ACT_IN_HAND)
e0:SetCondition(yume.nonYumeCon)
c:RegisterEffect(e0)
--banish
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(71400023,1))
e2:SetCategory(CATEGORY_BANISH)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetRange(LOCATION_GRAVE)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetHintTiming(0,TIMING_SUMMON+TIMING_SPSUMMON+TIMING_END_PHASE)
e2:SetCondition(aux.exccon)
e2:SetCost(aux.bfgcost)
e2:SetTarget(c71400023.tg2)
e2:SetOperation(c71400023.op2)
c:RegisterEffect(e2)
end
function c71400023.filter1(c,tp)
return c:IsType(TYPE_FIELD) and c:GetActivateEffect():IsActivatable(tp,true) and c:IsSetCard(0x3714)
end
function c71400023.op1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=yume.FieldActivation(tp)
if tc then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_SSET)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetRange(LOCATION_FZONE)
e1:SetTargetRange(1,1)
e1:SetTarget(c71400023.setlimit)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1,true)
--[[
local e2=e1:Clone()
e2:SetCode(EFFECT_CANNOT_MSET)
tc:RegisterEffect(e2,true)
local e3=e1:Clone()
e3:SetCode(EFFECT_CANNOT_TURN_SET)
tc:RegisterEffect(e3,true)
local e4=e1:Clone()
e4:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e4:SetTarget(c71400023.sumlimit)
tc:RegisterEffect(e4,true)
--]]
tc:RegisterFlagEffect(0,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(71400023,2))
end
end
function c71400023.setlimit(e,c)
return not c:IsLocation(LOCATION_HAND)
end
--[[
function c71400023.sumlimit(e,c,sump,sumtype,sumpos,targetp)
return bit.band(sumpos,POS_FACEDOWN)>0
end
--]]
function c71400023.tg2(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_ONFIELD) and chkc:IsAbleToRemove() end
if chk==0 then return Duel.IsExistingTarget(aux.TRUE,tp,LOCATION_ONFIELD,0,1,nil)
and Duel.IsExistingTarget(Card.IsAbleToRemove,tp,0,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_BANISH)
local g1=Duel.SelectTarget(tp,Card.IsAbleToRemove,tp,LOCATION_ONFIELD,0,1,1,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_BANISH)
local g2=Duel.SelectTarget(tp,Card.IsAbleToRemove,tp,0,LOCATION_ONFIELD,1,1,nil)
g1:Merge(g2)
Duel.SetOperationInfo(0,CATEGORY_BANISH,g1,2,0,0)
end
function c71400023.op2(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
local sg=g:Filter(Card.IsRelateToEffect,nil,e)
if sg:GetCount()==2 then
Duel.Remove(sg,POS_FACEUP,REASON_EFFECT)
end
end
\ No newline at end of file
--梦蚀
xpcall(function() require("expansions/script/c71400001") end,function() require("script/c71400001") end)
function c71400025.initial_effect(c)
--activate from hand
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetCode(EFFECT_QP_ACT_IN_NTPHAND)
e0:SetCondition(yume.nonYumeCon)
c:RegisterEffect(e0)
--Activate(nofield)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(71400025,0))
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCondition(yume.nonYumeCon)
e1:SetTarget(yume.YumeFieldCheckTarget(0,2))
e1:SetCost(c71400025.cost1)
e1:SetOperation(c71400025.op1)
e1:SetCountLimit(1,71400025+EFFECT_COUNT_CODE_OATH)
c:RegisterEffect(e1)
--Activate(field)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(71400025,1))
e2:SetCondition(yume.YumeCon)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_ACTIVATE)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetCountLimit(1,71400025+EFFECT_COUNT_CODE_OATH)
e2:SetCost(c71400025.cost2)
e2:SetTarget(c71400025.tg2)
e2:SetOperation(c71400025.op2)
c:RegisterEffect(e2)
Duel.AddCustomActivityCounter(71400025,ACTIVITY_SPSUMMON,c71400025.counterfilter)
end
function c71400025.counterfilter(c)
return c:GetSummonLocation()~=LOCATION_EXTRA or c:IsType(TYPE_LINK)
end
function c71400025.cost1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckLPCost(tp,800) end
Duel.PayLPCost(tp,800)
end
function c71400025.op1(e,tp,eg,ep,ev,re,r,rp)
yume.FieldActivation(tp,nil,2)
end
function c71400025.filter2(c)
return c:IsType(TYPE_LINK)
end
function c71400025.filter2a(c,e,tp)
return c:IsSetCard(0x714) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c71400025.cost2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetCustomActivityCount(71400025,tp,ACTIVITY_SPSUMMON)==0 and Duel.CheckLPCost(tp,800) end
Duel.PayLPCost(tp,800)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetTargetRange(1,0)
e1:SetTarget(c71400025.splimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function c71400025.splimit(e,c,sump,sumtype,sumpos,targetp,se)
return not (c:IsType(TYPE_LINK)) and c:IsLocation(LOCATION_EXTRA)
end
function c71400025.tg2(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsType(TYPE_LINK) and chkc:IsLocation(LOCATION_MZONE) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c71400025.filter2,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil)
and Duel.IsExistingMatchingCard(c71400025.filter2a,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,c71400025.filter2,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE+LOCATION_REMOVED)
end
function c71400025.op2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
local ft=math.min(Duel.GetLocationCount(tp,LOCATION_MZONE),tc:GetLink())
if ft<=0 then return end
if Duel.IsPlayerAffectedByEffect(tp,59822133) then ft=1 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c71400025.filter2a),tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,ft,nil,e,tp)
if sg:GetCount()>0 then
local sc=sg:GetFirst()
local fid=c:GetFieldID()
while sc do
if Duel.SpecialSummonStep(sc,0,tp,tp,false,false,POS_FACEUP) then
sc:RegisterFlagEffect(71400025,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1,fid)
end
sc=sg:GetNext()
end
Duel.SpecialSummonComplete()
sg:KeepAlive()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetCountLimit(1)
e1:SetCondition(c71400025.rmcon)
e1:SetOperation(c71400025.rmop)
e1:SetLabel(fid)
e1:SetLabelObject(sg)
Duel.RegisterEffect(e1,tp)
end
end
function c71400025.rmfilter(c,fid)
return c:GetFlagEffectLabel(71400025)==fid
end
function c71400025.rmcon(e,tp,eg,ep,ev,re,r,rp)
local g=e:GetLabelObject()
if not g:IsExists(c71400025.rmfilter,1,nil,e:GetLabel()) then
g:DeleteGroup()
e:Reset()
return false
else return true end
end
function c71400025.rmop(e,tp,eg,ep,ev,re,r,rp)
local g=e:GetLabelObject()
local tg=g:Filter(c71400025.rmfilter,nil,e:GetLabel())
Duel.Remove(tg,POS_FACEUP,REASON_EFFECT)
end
\ No newline at end of file
--妄想梦物-黑电话
xpcall(function() require("expansions/script/c71400001") end,function() require("script/c71400001") end)
function c71400026.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(71400026,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCondition(yume.YumeCon)
e1:SetTarget(c71400026.tg1)
e1:SetOperation(c71400026.op1)
c:RegisterEffect(e1)
--search
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(71400026,1))
e2:SetCountLimit(1,71400026)
e2:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_GRAVE)
e2:SetCondition(c71400026.mixedYumeCon)
e2:SetCost(c71400026.cost)
e2:SetTarget(c71400026.tg2)
e2:SetOperation(c71400026.op2)
c:RegisterEffect(e2)
end
function c71400026.filter1(c,e,tp)
return c:IsSetCard(0x714) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c71400026.tg1(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:GetLocation()==LOCATION_GRAVE and chkc:GetControler()==tp and c71400026.filter1(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c71400026.filter1,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c71400026.filter1,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function c71400026.op1(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
end
function c71400026.filter2c(c,e,tp)
return c:IsSetCard(0x714) and c:IsAbleToRemoveAsCost()
end
function c71400026.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsAbleToRemoveAsCost()
and Duel.IsExistingMatchingCard(c71400026.filter2c,tp,LOCATION_GRAVE,0,1,c) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,c71400026.filter2c,tp,LOCATION_GRAVE,0,1,1,c)
g:AddCard(c)
Duel.Remove(g,POS_FACEUP,REASON_COST)
end
function c71400026.mixedYumeCon(e,tp,eg,ep,ev,re,r,rp)
return yume.YumeCon(e,tp,eg,ep,ev,re,r,rp) and aux.exccon(e,tp,eg,ep,ev,re,r,rp)
end
function c71400026.filter2(c)
return c:IsSetCard(0xe714) and not c:IsCode(71400026) and c:IsAbleToHand()
end
function c71400026.tg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c71400026.filter2,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c71400026.op2(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c71400026.filter2,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
\ No newline at end of file
--梦路脑坏
xpcall(function() require("expansions/script/c71400001") end,function() require("script/c71400001") end)
function c71400027.initial_effect(c)
--sp summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(71400027,0))
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetHintTiming(0,0x1f0)
e1:SetCost(c71400027.cost1)
e1:SetTarget(c71400027.tg1)
e1:SetOperation(c71400027.op1)
c:RegisterEffect(e1)
--ac in hand
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetCode(EFFECT_TRAP_ACT_IN_HAND)
e0:SetCondition(yume.nonYumeCon)
c:RegisterEffect(e0)
--draw
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(71400027,1))
e2:SetCategory(CATEGORY_DRAW+CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetRange(LOCATION_GRAVE)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetCost(aux.bfgcost)
e2:SetTarget(c71400027.tg2)
e2:SetOperation(c71400027.op2)
c:RegisterEffect(e2)
end
function c71400027.cost1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckLPCost(tp,2000) end
Duel.PayLPCost(tp,2000)
end
function c71400027.filter1(c)
return c:IsPosition(POS_FACEUP_ATTACK) and not c:IsType(TYPE_TOKEN) and c:GetSummonLocation()==LOCATION_EXTRA and c:IsAbleToChangeControler()
end
function c71400027.xyzfilter(c,e,tp)
return c:IsSetCard(0x3715) and c:IsCanBeSpecialSummoned(e,0,tp,true,false)
end
function c71400027.tg1(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and c71400027.filter1(chkc) end
if chk==0 then return Duel.IsExistingTarget(c71400027.filter1,tp,0,LOCATION_MZONE,2,nil) and Duel.GetLocationCountFromEx(tp)>0 and Duel.IsExistingMatchingCard(c71400027.xyzfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
Duel.SelectTarget(tp,c71400027.filter1,tp,0,LOCATION_MZONE,2,2,nil)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function c71400027.op1(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCountFromEx(tp)<1 then return end
local c=e:GetHandler()
local xyzg=Duel.GetMatchingGroup(c71400027.xyzfilter,tp,LOCATION_EXTRA,0,nil,e,tp)
local sg=xyzg:Select(tp,1,1,nil)
local sc=sg:GetFirst()
Debug.ShowHint(1)
if sc and Duel.SpecialSummonStep(sc,0,tp,tp,true,false,POS_FACEUP) then
local fid=c:GetFieldID()
sc:RegisterFlagEffect(71400027,RESET_EVENT+RESETS_STANDARD,0,1,fid)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetCountLimit(1)
e1:SetLabel(fid)
e1:SetLabelObject(sc)
e1:SetCondition(c71400027.tdcon)
e1:SetOperation(c71400027.tdop)
Duel.RegisterEffect(e1,tp)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_SET_ATTACK_FINAL)
e2:SetValue(0)
e2:SetReset(RESET_EVENT+0x1fe0000)
sc:RegisterEffect(e2,true)
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(Card.IsRelateToEffect,nil,e)
if g:GetCount()==2 then
local tc=g:GetFirst()
while tc do
local og=tc:GetOverlayGroup()
if og:GetCount()>0 then
Duel.SendtoGrave(og,REASON_RULE)
end
tc=g:GetNext()
end
Duel.Overlay(sc,g)
end
Duel.SpecialSummonComplete()
end
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e3:SetCode(EFFECT_CANNOT_ACTIVATE)
e3:SetTargetRange(1,0)
e3:SetTarget(c71400027.aclimit)
Duel.RegisterEffect(e3,tp)
end
function c71400027.aclimit(e,re,tp)
return not re:GetHandler():IsSetCard(0x714) and re:IsActiveType(TYPE_MONSTER) and not re:GetHandler():IsImmuneToEffect(e)
end
function c71400027.tdcon(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject()
if tc:GetFlagEffectLabel(71400027)==e:GetLabel() then
return true
else
e:Reset()
return false
end
end
function c71400027.tdop(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject()
Duel.SendtoDeck(tc,nil,2,REASON_EFFECT)
end
function c71400027.tg2(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_FZONE) and chkc:IsControler(tp) and c71400027.filter2(chkc) end
if chk==0 then return Duel.IsExistingTarget(c71400027.filter2,tp,LOCATION_FZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectTarget(tp,c71400027.filter2,tp,LOCATION_FZONE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0)
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(1)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end
function c71400027.filter2(c)
return c:IsFaceup() and c:IsSetCard(0xb714) and c:IsType(TYPE_FIELD) and c:IsAbleToHand()
end
function c71400027.op2(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc and tc:IsRelateToEffect(e) and Duel.SendtoHand(tc,nil,REASON_EFFECT)==1 then
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Draw(p,d,REASON_EFFECT)
end
end
\ No newline at end of file
--锈蚀的梦之怪物
xpcall(function() require("expansions/script/c71400001") end,function() require("script/c71400001") end)
function c71400028.initial_effect(c)
--link summon
aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsLinkType,TYPE_EFFECT),2,99,yume.YumeCheck(c))
c:EnableReviveLimit()
--summon limit
yume.AddYumeSummonLimit(c,1)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(71400028,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCountLimit(1,71400028)
e1:SetTarget(c71400028.tg1)
e1:SetOperation(c71400028.op1)
c:RegisterEffect(e1)
--setcode
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetRange(LOCATION_MZONE)
e2:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e2:SetTarget(c71400028.tg2)
e2:SetCode(EFFECT_ADD_SETCODE)
e2:SetValue(0x714)
c:RegisterEffect(e2)
--corrupt
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(71400028,1))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e3:SetCode(EVENT_DESTROYED)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCondition(c71400028.con3)
e3:SetTarget(c71400028.tg3)
e3:SetOperation(c71400028.op3)
c:RegisterEffect(e3)
end
function c71400028.filter1(c,e,tp,zone)
return c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP,tp,zone)
end
function c71400028.tg1(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local zone=e:GetHandler():GetLinkedZone(tp)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:GetControler()==1-tp and c71400028.filter1(chkc,e,tp) end
if chk==0 then return zone~=0 and Duel.IsExistingTarget(c71400028.filter1,tp,0,LOCATION_GRAVE,1,nil,e,tp,zone) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c71400028.filter1,tp,0,LOCATION_GRAVE,1,1,nil,e,tp,zone)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function c71400028.op1(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
local zone=e:GetHandler():GetLinkedZone(tp)
if tc:IsRelateToEffect(e) then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP,zone)
end
end
function c71400028.tg2(e,c)
return e:GetHandler():GetLinkedGroup():IsContains(c) and c:IsFaceup()
end
function c71400028.con3(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return r&REASON_EFFECT+REASON_BATTLE~=0
end
function c71400028.filter3(c,e,tp)
return c:IsCode(71400030) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c71400028.tg3(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCountFromEx(tp)>0 end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function c71400028.op3(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCountFromEx(tp)==0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c71400028.filter3,tp,LOCATION_EXTRA,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
\ No newline at end of file
--梦之方块间的围巾少女
xpcall(function() require("expansions/script/c71400001") end,function() require("script/c71400001") end)
function c71400029.initial_effect(c)
--summon limit
yume.AddYumeSummonLimit(c)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(71400029,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_GRAVE)
e1:SetCountLimit(1,71400029)
e1:SetTarget(c71400029.tg1)
e1:SetCondition(c71400029.con1)
e1:SetOperation(c71400029.op1)
c:RegisterEffect(e1)
--to hand
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(71400029,1))
e2:SetCategory(CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_SUMMON_SUCCESS)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e2:SetTarget(c71400029.tg2)
e2:SetOperation(c71400029.op2)
c:RegisterEffect(e2)
local e2a=e2:Clone()
e2a:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e2a)
Duel.AddCustomActivityCounter(71400029,ACTIVITY_CHAIN,c71400029.chainfilter)
end
function c71400029.chainfilter(re,tp,cid)
return not re:GetHandler():IsSetCard(0xa714)
end
function c71400029.con1(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCustomActivityCount(71400029,tp,ACTIVITY_CHAIN)>0
end
function c71400029.tg1(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 c71400029.op1(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
end
function c71400029.filter2(c)
return c:IsType(TYPE_FIELD) and c:IsSetCard(0xb714) and c:IsAbleToHand()
end
function c71400029.tg2(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c71400029.filter2(chkc) end
if chk==0 then return Duel.IsExistingTarget(c71400029.filter2,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectTarget(tp,c71400029.filter2,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0)
end
function c71400029.op2(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tc)
end
end
\ No newline at end of file
--腐坏的梦之怪物
xpcall(function() require("expansions/script/c71400001") end,function() require("script/c71400001") end)
function c71400030.initial_effect(c)
--link summon
aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsLinkType,TYPE_EFFECT),3,3,yume.YumeCheck(c))
c:EnableReviveLimit()
--summon limit
yume.AddYumeSummonLimit(c,1)
--indes
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e1:SetValue(1)
c:RegisterEffect(e1)
local e1a=e1:Clone()
e1a:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
c:RegisterEffect(e1a)
--[[
local e1b=e1:Clone()
e1b:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
c:RegisterEffect(e1b)
--]]
--negate spsummon
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_DISABLE_SUMMON+CATEGORY_REMOVE)
e2:SetType(EFFECT_TYPE_QUICK_F)
e2:SetCode(EVENT_SPSUMMON)
e2:SetRange(LOCATION_MZONE)
e2:SetDescription(aux.Stringid(71400030,0))
e2:SetCondition(c71400030.condition)
e2:SetCost(c71400030.cost)
e2:SetTarget(c71400030.target)
e2:SetOperation(c71400030.operation)
c:RegisterEffect(e2)
end
function c71400030.filter2(c)
return c:IsPreviousLocation(LOCATION_HAND+LOCATION_GRAVE+LOCATION_DECK) and c:IsAbleToRemove()
end
function c71400030.cfilter2(c,g)
return g:IsContains(c)
end
function c71400030.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentChain()==0 and eg:IsExists(c71400030.filter2,1,nil)
end
function c71400030.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local lg=c:GetLinkedGroup()
if chk==0 then return Duel.IsExistingMatchingCard(c71400030.cfilter2,tp,LOCATION_ONFIELD,0,1,nil,lg) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,c71400030.cfilter2,tp,LOCATION_ONFIELD,0,1,1,nil,lg)
Duel.Remove(g,POS_FACEUP,REASON_COST)
end
function c71400030.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local g=eg:Filter(c71400030.filter2,nil)
Duel.SetOperationInfo(0,CATEGORY_DISABLE_SUMMON,g,g:GetCount(),0,0)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,g:GetCount(),0,0)
end
function c71400030.operation(e,tp,eg,ep,ev,re,r,rp)
local g=eg:Filter(c71400030.filter2,nil)
if g:GetCount()>0 then
Duel.NegateSummon(g)
Duel.Remove(g,POS_FACEUP,REASON_EFFECT)
local og=Duel.GetOperatedGroup()
if og:GetCount()>0 then
Duel.BreakEffect()
local tc=og:GetFirst()
local atk=0
while tc do
local tatk=tc:GetTextAttack()
if tatk>0 then atk=atk+tatk end
tc=og:GetNext()
end
Duel.SetLP(tp,Duel.GetLP(tp)-atk)
end
end
end
\ No newline at end of file
--梦日记
function c71400031.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(c71400031.tg)
e1:SetOperation(c71400031.op)
e1:SetCountLimit(1,71400031+EFFECT_COUNT_CODE_OATH)
c:RegisterEffect(e1)
end
function c71400031.filter(c)
return c:IsSetCard(0x714) and c:GetReason() & REASON_DESTROY~=0 and not c:IsCode(71400031) and c:IsAbleToHand()
end
function c71400031.tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c71400031.filter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.GetMatchingGroup(c71400031.filter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,g:GetCount(),0,0)
end
function c71400031.op(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c71400031.filter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.SendtoHand(g,nil,REASON_EFFECT)
local og=Duel.GetOperatedGroup()
local ct=og:FilterCount(Card.IsLocation,nil,LOCATION_HAND)
Duel.SetLP(tp,Duel.GetLP(tp)-ct*500)
end
\ No newline at end of file
--蚀异梦物-铁管
xpcall(function() require("expansions/script/c71400001") end,function() require("script/c71400001") end)
function c71400033.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_REMOVE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetHintTiming(TIMING_DRAW_PHASE+TIMING_END_PHASE+TIMING_TOGRAVE,0)
e1:SetCountLimit(1,71400033+EFFECT_COUNT_CODE_OATH)
e1:SetDescription(aux.Stringid(71400033,0))
e1:SetTarget(c71400033.target)
e1:SetCost(c71400033.cost)
e1:SetCondition(yume.YumeLethalCon)
e1:SetOperation(c71400033.operation)
c:RegisterEffect(e1)
end
function c71400033.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckLPCost(tp,500) end
Duel.PayLPCost(tp,500)
end
function c71400033.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsAbleToRemove() and chkc~=e:GetHandler() end
if chk==0 then return Duel.IsExistingTarget(Card.IsAbleToRemove,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectTarget(tp,Card.IsAbleToRemove,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,1,0,0)
if e:IsHasType(EFFECT_TYPE_ACTIVATE) then
Duel.SetChainLimit(c71400033.limit(g:GetFirst()))
end
end
function c71400033.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.Remove(tc,POS_FACEUP,REASON_EFFECT)
end
if c:IsRelateToEffect(e) and c:IsCanTurnSet() then
Duel.BreakEffect()
c:CancelToGrave()
Duel.ChangePosition(c,POS_FACEDOWN)
Duel.RaiseEvent(c,EVENT_SSET,e,REASON_EFFECT,tp,tp,0)
end
end
function c71400033.limit(c)
return function (e,lp,tp)
return e:GetHandler()~=c
end
end
\ No newline at end of file
--蚀异梦境-里梦足迹
xpcall(function() require("expansions/script/c71400001") end,function() require("script/c71400001") end)
function c71400034.initial_effect(c)
--Activate
--See AddYumeFieldGlobal
--todeck
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_CHAINING)
e1:SetRange(LOCATION_FZONE)
e1:SetCountLimit(1)
e1:SetCost(c71400034.cost1)
e1:SetCondition(c71400034.con1)
e1:SetTarget(c71400034.tg1)
e1:SetOperation(c71400034.op1)
c:RegisterEffect(e1)
--self limitation & field activation
yume.AddYumeFieldGlobal(c,71400034,2)
end
function c71400034.cost1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c71400034.filter1c,tp,LOCATION_HAND,0,1,nil) end
Duel.DiscardHand(tp,c71400034.filter1c,1,1,REASON_COST+REASON_DISCARD,nil)
end
function c71400034.filter1c(c)
return c:IsSetCard(0x7714) and c:IsType(TYPE_FIELD) and c:IsDiscardable()
end
function c71400034.con1(e,tp,eg,ep,ev,re,r,rp)
return re:GetHandler():IsOnField() and re:GetHandler():IsRelateToEffect(re) and (re:IsActiveType(TYPE_MONSTER)
or (re:IsActiveType(TYPE_SPELL+TYPE_TRAP) and not re:IsHasType(EFFECT_TYPE_ACTIVATE)))
end
function c71400034.filter1(c)
return c:IsSetCard(0x716) and c:IsType(TYPE_LINK) and c:IsFaceup()
end
function c71400034.tg1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return re:GetHandler():IsDestructable() end
if Duel.IsExistingMatchingCard(c71400034.filter1,tp,LOCATION_ONFIELD,0,1,nil) then
Duel.SetOperationInfo(0,CATEGORY_TODECK+CATEGORY_REMOVE,eg,1,0,0)
else
Duel.SetOperationInfo(0,CATEGORY_TODECK,eg,1,0,0)
end
end
function c71400034.op1(e,tp,eg,ep,ev,re,r,rp)
if not (e:GetHandler():IsRelateToEffect(e) and re:GetHandler():IsRelateToEffect(re)) then return end
if Duel.SendtoDeck(eg,nil,2,REASON_EFFECT)==1 then
local g=Duel.GetMatchingGroup(aux.TRUE,tp,0,LOCATION_ONFIELD,nil)
if Duel.IsExistingMatchingCard(c71400034.filter1,tp,LOCATION_ONFIELD,0,1,nil) and g:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(71400034,1)) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local sg=g:Select(tp,1,1,nil)
Duel.HintSelection(sg)
Duel.Remove(sg,POS_FACEUP,REASON_EFFECT)
end
end
end
\ No newline at end of file
--梦行
xpcall(function() require("expansions/script/c71400001") end,function() require("script/c71400001") end)
function c71400035.initial_effect(c)
--activate from hand
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetCode(EFFECT_QP_ACT_IN_NTPHAND)
e0:SetCondition(yume.nonYumeCon)
c:RegisterEffect(e0)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCategory(CATEGORY_TOGRAVE+CATEGORY_DISABLE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetOperation(c71400035.op1)
e1:SetTarget(c71400035.tg1)
e1:SetTarget(yume.YumeFieldCheckTarget())
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER)
c:RegisterEffect(e1)
end
function c71400035.filter1(c)
return c:IsSetCard(0xc714) and c:IsAbleToGrave()
end
function c71400035.tg1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c71400035.filter1,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK)
end
function c71400035.op1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if yume.YumeFieldCheck(tp) and Duel.SelectYesNo(tp,aux.Stringid(71400035,1)) then
yume.FieldActivation(tp)
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c71400035.filter1,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 and Duel.SendtoGrave(g,REASON_EFFECT)==1 and Duel.GetFieldGroupCount(tp,0,LOCATION_ONFIELD)>Duel.GetFieldGroupCount(tp,LOCATION_ONFIELD,0) then
Duel.BreakEffect()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_DISABLE)
e1:SetTargetRange(LOCATION_ONFIELD,LOCATION_ONFIELD)
e1:SetTarget(c71400035.tg1a)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetLabel(c:GetSequence())
Duel.RegisterEffect(e1,tp)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_CHAIN_SOLVING)
e2:SetOperation(c71400035.op1a)
e2:SetReset(RESET_PHASE+PHASE_END)
e2:SetLabel(c:GetSequence())
Duel.RegisterEffect(e2,tp)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_DISABLE_TRAPMONSTER)
e3:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e3:SetTarget(c71400035.tg1a)
e3:SetReset(RESET_PHASE+PHASE_END)
e3:SetLabel(c:GetSequence())
Duel.RegisterEffect(e3,tp)
end
if not e:IsHasType(EFFECT_TYPE_ACTIVATE) then return end
local rct=1
if Duel.GetTurnPlayer()~=tp then rct=2 end
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD)
e4:SetCode(EFFECT_CANNOT_ACTIVATE)
e4:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e4:SetValue(c71400035.aclimit)
e4:SetTargetRange(1,0)
e4:SetReset(RESET_PHASE+PHASE_END+RESET_OPPO_TURN,rct)
Duel.RegisterEffect(e4,tp)
end
function c71400035.aclimit(e,re,rp)
local rc=re:GetHandler()
return re:IsHasType(EFFECT_TYPE_ACTIVATE) and not rc:IsSetCard(0x714) and not rc:IsImmuneToEffect(e)
end
function c71400035.tg1a(e,c)
local seq=e:GetLabel()
local p=c:GetControler()
local tp=e:GetHandlerPlayer()
return not c:IsSetCard(0x714)
and ((p==tp and c:GetSequence()==seq) or (p==1-tp and c:GetSequence()==4-seq))
end
function c71400035.op1a(e,tp,eg,ep,ev,re,r,rp)
local tseq=e:GetLabel()
local ec=re:GetHandler()
local loc,seq=Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_LOCATION,CHAININFO_TRIGGERING_SEQUENCE)
seq=aux.MZoneSequence(seq)
if ((rp==tp and seq==tseq) or (rp==1-tp and seq==4-tseq)) and (not ec:IsSetCard(0x714) and (ec:IsLocation(loc) or loc&LOCATION_ONFIELD==0) or not (ec:IsPreviousSetCard(0x714) or ec:IsLocation(loc)) and loc&LOCATION_ONFIELD~=0) then
Duel.NegateEffect(ev)
end
end
\ No newline at end of file
--幻异梦物-狼
xpcall(function() require("expansions/script/c71400001") end,function() require("script/c71400001") end)
function c71400036.initial_effect(c)
--summon limit
yume.AddYumeSummonLimit(c)
--to hand
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(71400036,0))
e1:SetCategory(CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCountLimit(1,71400036)
e1:SetRange(LOCATION_MZONE)
e1:SetTarget(c71400036.tg1)
e1:SetOperation(c71400036.op1)
c:RegisterEffect(e1)
end
function c71400036.tg1(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local c=e:GetHandler()
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsAbleToHand() and chkc~=c end
if chk==0 then return Duel.IsExistingTarget(Card.IsAbleToHand,tp,LOCATION_MZONE,LOCATION_MZONE,1,c) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local g=Duel.SelectTarget(tp,Card.IsAbleToHand,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,c)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0)
end
function c71400036.op1(e,tp,eg,ep,ev,re,r,rp,chk)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
end
end
\ No newline at end of file
--幻异梦境-昭和胡同
xpcall(function() require("expansions/script/c71400001") end,function() require("script/c71400001") end)
function c71400037.initial_effect(c)
--Activate
--See AddYumeFieldGlobal
--self limitation & field activation
yume.AddYumeFieldGlobal(c,71400037,1)
--immune
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_IMMUNE_EFFECT)
e1:SetRange(LOCATION_FZONE)
e1:SetTargetRange(LOCATION_MZONE,0)
e1:SetTarget(c71400037.tg1)
e1:SetValue(c71400037.filter1)
c:RegisterEffect(e1)
end
function c71400037.tg1(e,c)
return c:IsSetCard(0x714)
end
function c71400037.filter1(e,te,c)
local tc=te:GetHandler()
local tseq=tc:GetSequence()
if tc:GetControler()~=c:GetControler() then tseq=tseq+16 end
if tc:IsLocation(LOCATION_SZONE) then tseq=tseq+8 end
local zone=c:GetColumnZone(LOCATION_ONFIELD)
return zone and bit.extract(zone,tseq)~=0
end
\ No newline at end of file
--锖
function c71400038.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CANNOT_NEGATE)
e1:SetCondition(c71400038.condition)
e1:SetTarget(c71400038.target)
e1:SetOperation(c71400038.activate)
e1:SetDescription(aux.Stringid(71400038,0))
e1:SetCountLimit(1,71400038+EFFECT_COUNT_CODE_DUEL+EFFECT_COUNT_CODE_OATH)
e1:SetCost(c71400038.cost)
c:RegisterEffect(e1)
end
function c71400038.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetLP(tp)<=3000
end
function c71400038.filterc(c)
return c:IsSetCard(0xd714) and c:IsAbleToRemoveAsCost()
end
function c71400038.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c71400038.filterc,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,c71400038.filterc,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.Remove(g,POS_FACEUP,REASON_COST)
end
function c71400038.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
if e:IsHasType(EFFECT_TYPE_ACTIVATE) then
Duel.SetChainLimit(aux.FALSE)
end
end
function c71400038.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PRE_BATTLE_DAMAGE)
e1:SetCondition(c71400038.con1)
e1:SetOperation(c71400038.op1)
Duel.RegisterEffect(e1,tp)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetCode(EFFECT_CANNOT_ACTIVATE)
e2:SetTargetRange(1,0)
e2:SetValue(c71400038.aclimit2)
Duel.RegisterEffect(e2,tp)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e3:SetTargetRange(LOCATION_MZONE,0)
e3:SetTarget(c71400038.tg3)
e3:SetValue(aux.indoval)
Duel.RegisterEffect(e3,tp)
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD)
e4:SetCode(EFFECT_CANNOT_INACTIVATE)
e4:SetValue(c71400038.filter4)
Duel.RegisterEffect(e4,tp)
local e4a=e1:Clone()
e4a:SetCode(EFFECT_CANNOT_DISEFFECT)
Duel.RegisterEffect(e4a,tp)
end
function c71400038.con1(e,tp,eg,ep,ev,re,r,rp)
return ep==tp
end
function c71400038.op1(e,tp,eg,ep,ev,re,r,rp)
Duel.ChangeBattleDamage(ep,ev*2)
end
function c71400038.aclimit2(e,re,rp)
local rc=re:GetHandler()
return rc:IsSetCard(0xd714) and not rc:IsImmuneToEffect(e)
end
function c71400038.tg3(e,c)
return c:IsSetCard(0x714)
end
function c71400038.filter4(e,ct)
local p=e:GetHandlerPlayer()
local te,tp,loc=Duel.GetChainInfo(ct,CHAININFO_TRIGGERING_EFFECT,CHAININFO_TRIGGERING_PLAYER,CHAININFO_TRIGGERING_LOCATION)
local tc=te:GetHandler()
return p==tp and not (not ec:IsSetCard(0x714) and (ec:IsLocation(loc) or loc&LOCATION_ONFIELD==0) or not (ec:IsPreviousSetCard(0x714) or ec:IsLocation(loc)) and loc&LOCATION_ONFIELD~=0)
end
\ No newline at end of file
--异梦粉红小丑
xpcall(function() require("expansions/script/c71400001") end,function() require("script/c71400001") end)
function c71400039.initial_effect(c)
c:EnableReviveLimit()
--cannot special summon
local e0=Effect.CreateEffect(c)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetCode(EFFECT_SPSUMMON_CONDITION)
c:RegisterEffect(e0)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(71400039,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_REMOVE)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetRange(LOCATION_HAND)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCondition(yume.YumeCon)
e1:SetCountLimit(1,71400039)
e1:SetTarget(c71400039.tg1)
e1:SetOperation(c71400039.op1)
c:RegisterEffect(e1)
--indes
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetRange(LOCATION_MZONE)
e2:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e2:SetValue(1)
c:RegisterEffect(e2)
local e2a=e2:Clone()
e2a:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
c:RegisterEffect(e2a)
end
function c71400039.filter1(c,tp)
return c:IsLocation(LOCATION_MZONE) and c:IsAbleToRemove()
end
function c71400039.tg1(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,true) and eg:IsExists(c71400039.filter1,1,nil) end
Duel.SetTargetCard(eg)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)Duel.SetOperationInfo(0,CATEGORY_REMOVE,eg,1,0,0)
end
function c71400039.filter1a(c,e)
return c:IsRelateToEffect(e) and c:IsLocation(LOCATION_MZONE)
end
function c71400039.op1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and Duel.SpecialSummon(c,0,tp,tp,true,true,POS_FACEUP)~=0 then
c:CompleteProcedure()
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
Duel.Remove(g,POS_FACEUP,REASON_EFFECT)
end
end
\ No newline at end of file
--异梦笑颜兄妹
xpcall(function() require("expansions/script/c71400001") end,function() require("script/c71400001") end)
function c71400040.initial_effect(c)
c:SetUniqueOnField(1,0,71400040)
--link summon
aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsLinkType,TYPE_EFFECT),2,2,yume.YumeCheck(c))
c:EnableReviveLimit()
--summon limit
yume.AddYumeSummonLimit(c,1)
--indes
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetRange(LOCATION_MZONE)
e2:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e2:SetValue(1)
c:RegisterEffect(e2)
local e2a=e2:Clone()
e2a:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
c:RegisterEffect(e2a)
--cannot be target
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_CANNOT_BE_BATTLE_TARGET)
e3:SetRange(LOCATION_MZONE)
e3:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e3:SetTarget(c71400040.tg3)
e3:SetValue(1)
c:RegisterEffect(e3)
local e3a=e3:Clone()
e3a:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e3a:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
c:RegisterEffect(e3a)
end
function c71400040.tg3(e,c)
return e:GetHandler():GetLinkedGroup():IsContains(c) and c:IsSetCard(0x714)
end
\ No newline at end of file
--蚀异梦境-梦医院
xpcall(function() require("expansions/script/c71400001") end,function() require("script/c71400001") end)
function c71400041.initial_effect(c)
--Activate
--See AddYumeFieldGlobal
--self limitation & field activation
yume.AddYumeFieldGlobal(c,71400041,2)
--to grave
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOGRAVE)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_SSET+TIMING_BATTLE_START+TIMING_MAIN_END)
e1:SetRange(LOCATION_FZONE)
e1:SetTarget(c71400041.tg1)
e1:SetDescription(aux.Stringid(71400041,0))
e1:SetCost(c71400041.cost1)
e1:SetCondition(c71400041.con1)
e1:SetOperation(c71400041.op1)
c:RegisterEffect(e1)
end
function c71400041.con1(e,tp,eg,ep,ev,re,r,rp)
local ph=Duel.GetCurrentPhase()
return Duel.GetTurnPlayer()~=tp and (ph==PHASE_MAIN1 or (ph>=PHASE_BATTLE_START and ph<=PHASE_BATTLE) or ph==PHASE_MAIN2)
end
function c71400041.filter1c(c)
return c:IsSetCard(0x714) and c:IsType(TYPE_LINK) and c:IsLinkState() and c:IsAbleToRemoveAsCost()
end
function c71400041.cost1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c71400041.filter1c,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local tc=Duel.SelectMatchingCard(tp,c71400041.filter1c,tp,LOCATION_MZONE,0,1,1,nil):GetFirst()
if Duel.Remove(tc,POS_FACEUP,REASON_COST+REASON_TEMPORARY)~=0 then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetDescription(aux.Stringid(71400041,1))
e1:SetLabelObject(tc)
e1:SetCountLimit(1)
e1:SetOperation(c71400041.retop)
Duel.RegisterEffect(e1,tp)
end
end
function c71400041.retop(e,tp,eg,ep,ev,re,r,rp)
Duel.ReturnToField(e:GetLabelObject())
end
function c71400041.tg1(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_ONFIELD) and chkc:IsAbleToGrave() end
if chk==0 then return Duel.IsExistingTarget(Card.IsAbleToGrave,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectTarget(tp,Card.IsAbleToGrave,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,g,g:GetCount(),0,0)
end
function c71400041.filter1(c,cid)
return c:IsAbleToGrave() and c:IsCode(cid)
end
function c71400041.op1(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SendtoGrave(tc,REASON_EFFECT)
if tc:IsLocation(LOCATION_GRAVE) then
local p=tc:GetControler()
local g=Duel.GetMatchingGroup(c71400041.filter1,p,LOCATION_DECK+LOCATION_HAND,0,nil,tc:GetCode())
if g:GetCount()>0 then
Duel.BreakEffect()
Duel.SendtoGrave(g,REASON_EFFECT)
g=g:Filter(Card.IsLocation,nil,LOCATION_GRAVE)
end
g:AddCard(tc)
local lc=g:GetFirst()
while lc do
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EFFECT_CANNOT_ACTIVATE)
e1:SetTargetRange(1,0)
e1:SetValue(c71400041.aclimit)
e1:SetLabel(lc:GetCode())
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,p)
lc=g:GetNext()
end
end
end
end
function c71400041.aclimit(e,re,tp)
return re:GetHandler():IsCode(e:GetLabel())
end
\ No newline at end of file
--异梦之书的小管理员
xpcall(function() require("expansions/script/c71400001") end,function() require("script/c71400001") end)
function c71400042.initial_effect(c)
--summon limit
yume.AddYumeSummonLimit(c)
--cannot attack
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetOperation(c71400042.atklimit)
c:RegisterEffect(e1)
local e1a=e1:Clone()
e1a:SetCode(EVENT_FLIP_SUMMON_SUCCESS)
c:RegisterEffect(e1a)
local e1b=e1:Clone()
e1b:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e1b)
--direct attack
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DIRECT_ATTACK)
e2:SetCondition(c71400042.dircon)
c:RegisterEffect(e2)
--special summon
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(71400042,0))
e3:SetCountLimit(1)
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetRange(LOCATION_MZONE)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetCost(c71400042.cost3)
e3:SetTarget(c71400042.tg3)
e3:SetOperation(c71400042.op3)
e3:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
c:RegisterEffect(e3)
--transform
local e4a=Effect.CreateEffect(c)
e4a:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e4a:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e4a:SetCode(EVENT_CHAINING)
e4a:SetRange(LOCATION_MZONE+LOCATION_GRAVE)
e4a:SetOperation(aux.chainreg)
c:RegisterEffect(e4a)
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(71400042,1))
e4:SetCategory(CATEGORY_SPECIAL_SUMMON)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e4:SetCode(EVENT_CHAIN_SOLVED)
e4:SetRange(LOCATION_MZONE+LOCATION_GRAVE)
e4:SetCondition(c71400042.con4)
e4:SetTarget(c71400042.tg4)
e4:SetOperation(c71400042.op4)
c:RegisterEffect(e4)
end
function c71400042.atklimit(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_ATTACK)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
e:GetHandler():RegisterEffect(e1)
end
function c71400042.cfilter1(c)
return c:IsFaceup() and c:IsCode(15259703)
end
function c71400042.cfilter2(c)
return c:IsFaceup() and c:IsType(TYPE_TOON)
end
function c71400042.dircon(e)
local tp=e:GetHandlerPlayer()
return Duel.IsExistingMatchingCard(c71400042.cfilter1,tp,LOCATION_ONFIELD,0,1,nil)
and not Duel.IsExistingMatchingCard(c71400042.cfilter2,tp,0,LOCATION_MZONE,1,nil)
end
function c71400042.filter3(c)
local flag=false
if c:IsLocation(LOCATION_HAND) then flag=c:IsSetCard(0x714)
else flag=c:IsSetCard(0x714) and c:IsType(TYPE_XYZ) end
return flag and c:IsAbleToRemoveAsCost()
end
function c71400042.xyzfilter(c,e,tp)
return c:IsSetCard(0x3715) and c:IsType(TYPE_XYZ) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c71400042.cost3(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.IsExistingMatchingCard(c71400042.filter3,tp,LOCATION_HAND+LOCATION_GRAVE,0,2,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,c71400042.filter3,tp,LOCATION_HAND+LOCATION_GRAVE,0,2,2,nil)
Duel.Remove(g,POS_FACEUP,REASON_COST)
e:SetTargetCard(g)
end
function c71400042.tg3(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCountFromEx(tp)>0 and Duel.IsExistingMatchingCard(c71400042.xyzfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function c71400042.op3(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCountFromEx(tp)<=0 then return end
local g=Duel.GetMatchingGroup(c71400042.xyzfilter,tp,LOCATION_EXTRA,0,nil,e,tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=g:Select(tp,1,1,nil)
local sc=sg:GetFirst()
if sc then
Duel.SpecialSummon(sc,0,tp,tp,false,false,POS_FACEUP)
local mg=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(Card.IsRelateToEffect,nil,e)
if mg:GetCount()>0 then
Duel.Overlay(sc,mg)
end
end
end
function c71400042.filter4(c,e,tp)
return c:IsCode(71400011) and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_XYZ,tp,false,false)
end
function c71400042.con4(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local rc=re:GetHandler()
return rc:IsCode(71400026) and c:GetFlagEffect(1)>0 and re:IsHasType(EFFECT_TYPE_ACTIVATE)
end
function c71400042.tg4(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
local c=e:GetHandler()
if c:IsLocation(LOCATION_GRAVE) then Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,c,1,tp,LOCATION_GRAVE) end
end
function c71400042.op4(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.GetLocationCountFromEx(tp,tp,c)<=0 or not aux.MustMaterialCheck(nil,tp,EFFECT_MUST_BE_XMATERIAL) then return end
if c:IsFacedown() or not c:IsRelateToEffect(e) or c:IsControler(1-tp) or c:IsImmuneToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c71400042.filter4,tp,LOCATION_EXTRA,0,1,1,nil,e,tp)
local sc=g:GetFirst()
if sc and Duel.SpecialSummon(sc,SUMMON_TYPE_XYZ,tp,tp,false,false,POS_FACEUP)==1 then
sc:CompleteProcedure()
if c:IsRelateToEffect(e) then
Duel.Overlay(sc,c)
end
end
end
\ No newline at end of file
--异梦之海的潜水员
xpcall(function() require("expansions/script/c71400001") end,function() require("script/c71400001") end)
function c71400043.initial_effect(c)
c:SetSPSummonOnce(71400043)
--link summon
aux.AddLinkProcedure(c,c71400043.matfilter,1,1,yume.YumeCheck(c))
c:EnableReviveLimit()
--summon limit
yume.AddYumeSummonLimit(c,1)
--tohand
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(71400043,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCountLimit(1,71400043+EFFECT_COUNT_CODE_DUEL)
e1:SetCondition(c71400043.con1)
e1:SetTarget(c71400043.tg1)
e1:SetOperation(c71400043.op1)
c:RegisterEffect(e1)
--field
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(71400043,1))
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1)
e2:SetCondition(c32912040.con2)
e2:SetOperation(c32912040.op2)
c:RegisterEffect(e2)
--tohand
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(71400043,2))
e3:SetCategory(CATEGORY_TODECK+CATEGORY_TOHAND+CATEGORY_SEARCH)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_TO_GRAVE)
e3:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_PLAYER_TARGET)
e3:SetTarget(c71400043.tg3)
e3:SetOperation(c71400043.op3)
c:RegisterEffect(e3)
end
function c71400043.matfilter(c)
return c:IsLinkType(TYPE_EFFECT) and not c:IsLinkType(TYPE_LINK)
end
function c71400043.con1(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_LINK)
end
function c71400043.filter1(c)
return c:IsSetCard(0x7714) and c:IsAbleToHand()
end
function c71400043.tg1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c71400043.thfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK+LOCATION_GRAVE)
end
function c71400043.op1(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c71400043.filter1,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
function c71400043.filter2(c)
return c:GetSummonLocation()==LOCATION_EXTRA
end
function c71400043.filter2a(c)
return c:IsFaceup() and c:IsType(TYPE_LINK)
end
function c71400043.con2(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c71400043.filter2,tp,LOCATION_MZONE,0,nil)
return Duel.GetTurnPlayer()~=tp and g:GetCount()>0 and g:FilterCount(c71400043.filter2a,nil)==g:GetCount()
end
function c71400025.op2(e,tp,eg,ep,ev,re,r,rp)
yume.FieldActivation(tp,nil,2)
end
function c71400043.filter3a(c)
return c:IsSetCard(0x5714) and c:IsAbleToDeck() and not c:IsPublic()
end
function c71400043.filter3(c)
return c:IsSetCard(0x714) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
end
function c71400043.tg3(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c71400043.filter3,tp,LOCATION_DECK,0,1,nil) and Duel.IsExistingMatchingCard(c71400043.filter3a,tp,LOCATION_HAND,0,1,nil) end
Duel.SetTargetPlayer(tp)
Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,1,tp,LOCATION_HAND)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c71400043.op3(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectMatchingCard(tp,c71400043.filter3a,tp,LOCATION_HAND,0,1,1,nil)
if g:GetCount()>0 then
Duel.ConfirmCards(1-tp,g)
if Duel.SendtoDeck(g,nil,2,REASON_EFFECT)>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g2=Duel.SelectMatchingCard(tp,c71400043.filter3,tp,LOCATION_DECK,0,1,1,nil)
if g2:GetCount()>0 then
Duel.BreakEffect()
Duel.SendtoHand(g2,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g2)
end
end
end
end
\ No newline at end of file
--幻异梦物-猫
xpcall(function() require("expansions/script/c71400001") end,function() require("script/c71400001") end)
function c71400044.initial_effect(c)
--summon limit
yume.AddYumeSummonLimit(c)
--tohand
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(71400044,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e1:SetTarget(c71400044.tg1)
e1:SetOperation(c71400044.op1)
c:RegisterEffect(e1)
end
function c71400044.filter1(c)
return c:IsSetCard(0x714) and c:IsType(TYPE_MONSTER) and not c:IsCode(71400044) and c:IsAbleToHand()
end
function c71400044.tg1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c71400044.filter1,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c71400044.op1(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c71400044.filter1,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
local c=e:GetHandler()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_DAMAGE)
e1:SetOperation(c71400044.regop)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetLabel(0)
Duel.RegisterEffect(e1,tp)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_PHASE+PHASE_END)
e2:SetCountLimit(1)
e2:SetCondition(c71400044.damcon)
e2:SetOperation(c71400044.damop)
e2:SetReset(RESET_PHASE+PHASE_END)
e2:SetLabelObject(e1)
Duel.RegisterEffect(e2,tp)
end
end
function c71400044.regop(e,tp,eg,ep,ev,re,r,rp)
if e:GetLabel()~=1 and ep~=tp and (eg and eg:GetFirst():IsControler(tp) or re and re:GetHandlerPlayer()==tp) then
e:SetLabel(1)
end
end
function c71400044.damcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetLabelObject():GetLabel()==0
end
function c71400044.damop(e,tp,eg,ep,ev,re,r,rp)
Duel.SetLP(tp,Duel.GetLP(tp)-1000)
end
\ No newline at end of file
--黑白的异梦少女 Monoko
xpcall(function() require("expansions/script/c71400001") end,function() require("script/c71400001") end)
function c71400045.initial_effect(c)
--synchro summon
aux.AddSynchroProcedure(c,yume.YumeCheck(c),aux.NonTuner(yume.YumeCheck(c)),1)
c:EnableReviveLimit()
--summon limit
yume.AddYumeSummonLimit(c,1)
--act limit
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EFFECT_CANNOT_ACTIVATE)
e1:SetRange(LOCATION_MZONE)
e1:SetTargetRange(0,1)
e1:SetValue(c71400045.aclimit)
c:RegisterEffect(e1)
--multi attack
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_EXTRA_ATTACK)
e2:SetValue(4)
e2:SetCondition(c71400045.con2)
c:RegisterEffect(e2)
Duel.AddCustomActivityCounter(71400045,ACTIVITY_CHAIN,c71400045.chainfilter)
--pos
local e2a=Effect.CreateEffect(c)
e2a:SetDescription(aux.Stringid(71400045,0))
e2a:SetCategory(CATEGORY_POSITION)
e2a:SetType(EFFECT_TYPE_TRIGGER_F+EFFECT_TYPE_FIELD)
e2a:SetCode(EVENT_PHASE+PHASE_BATTLE)
e2a:SetRange(LOCATION_MZONE)
e2a:SetCountLimit(1)
e2a:SetCondition(c71400045.con2a)
e2a:SetOperation(c71400045.op2a)
c:RegisterEffect(e2a)
end
function c71400045.chainfilter(re,tp,cid)
return not (re:GetHandler():IsCode(71400047) and re:IsHasType(EFFECT_TYPE_ACTIVATE))
end
function c71400045.aclimit(e,re,tp)
return not re:IsHasType(EFFECT_TYPE_ACTIVATE) and re:IsActiveType(TYPE_SPELL+TYPE_TRAP) and not re:GetHandler():IsImmuneToEffect(e)
end
function c71400045.con2(e)
return Duel.GetCustomActivityCount(71400045,e:GetHandlerPlayer(),ACTIVITY_CHAIN)>0
end
function c71400045.con2a(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c71400045.con2(e) and c:IsAttackPos() and c:GetBattledGroupCount()>0
end
function c71400045.op2a(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsAttackPos() then
Duel.ChangePosition(c,POS_FACEUP_DEFENSE)
end
end
\ No newline at end of file
--黑白的异梦少女 Monoe
xpcall(function() require("expansions/script/c71400001") end,function() require("script/c71400001") end)
function c71400046.initial_effect(c)
--synchro summon
aux.AddSynchroProcedure(c,yume.YumeCheck(c),aux.NonTuner(yume.YumeCheck(c)),1)
c:EnableReviveLimit()
--summon limit
yume.AddYumeSummonLimit(c,1)
--destroy
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(71400046,0))
e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e1:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCondition(c71400046.con1)
e1:SetTarget(c71400046.tg1)
e1:SetOperation(c71400046.op1)
c:RegisterEffect(e1)
--self banish
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(71400046,1))
e2:SetCategory(CATEGORY_REMOVE)
e2:SetType(EFFECT_TYPE_QUICK_F)
e2:SetRange(LOCATION_MZONE)
e2:SetCode(EVENT_BECOME_TARGET)
e2:SetCondition(c71400046.con2)
e2:SetTarget(c71400046.tg2)
e2:SetOperation(c71400046.op2)
c:RegisterEffect(e2)
local e2a=e2:Clone()
e2a:SetDescription(aux.Stringid(71400046,1))
e2a:SetCode(EVENT_BE_BATTLE_TARGET)
c:RegisterEffect(e2a)
end
function c71400046.con1(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_SYNCHRO)
end
function c71400046.tg1(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local c=e:GetHandler()
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc~=c end
if chk==0 then return Duel.IsExistingTarget(aux.TRUE,tp,LOCATION_MZONE,LOCATION_MZONE,1,c) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,aux.TRUE,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,c)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,g:GetCount(),0,0)
end
function c71400046.op1(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.Destroy(tc,REASON_EFFECT)
end
end
function c71400046.con2(e,tp,eg,ep,ev,re,r,rp)
return eg:IsContains(e:GetHandler())
end
function c71400046.tg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,e:GetHandler(),1,0,0)
end
function c71400046.op2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and Duel.Remove(c,0,REASON_EFFECT+REASON_TEMPORARY)~=0 then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetLabelObject(c)
e1:SetCountLimit(1)
e1:SetOperation(c71400046.retop)
Duel.RegisterEffect(e1,tp)
end
end
function c71400046.retop(e,tp,eg,ep,ev,re,r,rp)
Duel.ReturnToField(e:GetLabelObject())
end
\ No newline at end of file
--幻异梦物-信号灯
xpcall(function() require("expansions/script/c71400001") end,function() require("script/c71400001") end)
function c71400047.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetDescription(aux.Stringid(71400047,0))
e1:SetCondition(c71400047.con1)
e1:SetOperation(c71400047.op1)
c:RegisterEffect(e1)
end
function c71400047.con1(e,tp,eg,ep,ev,re,r,rp)
return yume.YumeCon(e,tp) and Duel.GetCurrentPhase()==PHASE_STANDBY and Duel.IsAbleToEnterBP()
end
function c71400047.op1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_ATTACK)
e1:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e1:SetTarget(c71400047.atktarget)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
if not (Duel.IsAbleToEnterBP() or (Duel.GetCurrentPhase()>=PHASE_BATTLE_START and Duel.GetCurrentPhase()<=PHASE_BATTLE)) then return end
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_BP_TWICE)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetTargetRange(1,0)
e2:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e2,tp)
end
function c71400047.atktarget(e,c)
return not (c:IsType(TYPE_SYNCHRO) and c:IsSetCard(0x714))
end
\ No newline at end of file
--黑白的异梦小少女 Monoko
xpcall(function() require("expansions/script/c71400001") end,function() require("script/c71400001") end)
function c71400048.initial_effect(c)
--summon limit
yume.AddYumeSummonLimit(c)
--cannot attack
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetOperation(c71400048.atklimit)
c:RegisterEffect(e1)
local e1a=e1:Clone()
e1a:SetCode(EVENT_FLIP_SUMMON_SUCCESS)
c:RegisterEffect(e1a)
local e1b=e1:Clone()
e1b:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e1b)
--direct attack
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DIRECT_ATTACK)
e2:SetCondition(c71400048.dircon)
c:RegisterEffect(e2)
--multi attack
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e3:SetRange(LOCATION_MZONE)
e3:SetCode(EFFECT_EXTRA_ATTACK_MONSTER)
e3:SetValue(4)
c:RegisterEffect(e3)
--transform
local e4a=Effect.CreateEffect(c)
e4a:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e4a:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e4a:SetCode(EVENT_CHAINING)
e4a:SetRange(LOCATION_MZONE+LOCATION_GRAVE)
e4a:SetOperation(aux.chainreg)
c:RegisterEffect(e4a)
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(71400048,0))
e4:SetCategory(CATEGORY_SPECIAL_SUMMON)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e4:SetCode(EVENT_CHAIN_SOLVED)
e4:SetRange(LOCATION_MZONE)
e4:SetCondition(c71400048.con4)
e4:SetTarget(c71400048.tg4)
e4:SetOperation(c71400048.op4)
c:RegisterEffect(e4)
--transform
local e4b=Effect.CreateEffect(c)
e4b:SetDescription(aux.Stringid(71400048,0))
e4b:SetCategory(CATEGORY_SPECIAL_SUMMON)
e4b:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e4b:SetCountLimit(1)
e4b:SetCode(EVENT_PHASE+PHASE_BATTLE_START)
e4b:SetRange(LOCATION_MZONE)
e4b:SetCondition(c71400048.con4b)
e4b:SetTarget(c71400048.tg4)
e4b:SetOperation(c71400048.op4)
c:RegisterEffect(e4b)
Duel.AddCustomActivityCounter(71400048,ACTIVITY_CHAIN,c71400048.chainfilter)
end
function c71400048.cfilter1(c)
return c:IsFaceup() and c:IsCode(15259703)
end
function c71400048.cfilter2(c)
return c:IsFaceup() and c:IsType(TYPE_TOON)
end
function c71400048.dircon(e)
local tp=e:GetHandlerPlayer()
return Duel.IsExistingMatchingCard(c71400048.cfilter1,tp,LOCATION_ONFIELD,0,1,nil)
and not Duel.IsExistingMatchingCard(c71400048.cfilter2,tp,0,LOCATION_MZONE,1,nil)
end
function c71400048.filter4(c,e,tp)
return c:IsCode(71400045) and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_SYNCHRO,tp,false,false)
end
function c71400048.con4(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local rc=re:GetHandler()
return rc:IsCode(71400047) and c:GetFlagEffect(1)>0 and re:IsHasType(EFFECT_TYPE_ACTIVATE)
end
function c71400048.tg4(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function c71400048.chainfilter(re,tp,cid)
return not (re:GetHandler():IsCode(71400047) and re:IsHasType(EFFECT_TYPE_ACTIVATE))
end
function c71400048.con4b(e)
return Duel.GetCustomActivityCount(71400048,e:GetHandlerPlayer(),ACTIVITY_CHAIN)>0
end
function c71400048.op4(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) or Duel.SendtoGrave(c,REASON_EFFECT)==0 then return end
if Duel.GetLocationCountFromEx(tp,tp,c)<=0 or not aux.MustMaterialCheck(nil,tp,EFFECT_MUST_BE_SMATERIAL) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c71400048.filter4,tp,LOCATION_EXTRA,0,1,1,nil,e,tp)
local tc=g:GetFirst()
if tc then
Duel.SpecialSummon(tc,SUMMON_TYPE_SYNCHRO,tp,tp,false,false,POS_FACEUP)
tc:CompleteProcedure()
end
end
\ No newline at end of file
--幻异梦境-黑白世界
xpcall(function() require("expansions/script/c71400001") end,function() require("script/c71400001") end)
function c71400049.initial_effect(c)
--Activate
--See AddYumeFieldGlobal
--self limitation & field activation
yume.AddYumeFieldGlobal(c,71400049,1)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(71400049,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_MAIN_END)
e1:SetCountLimit(1)
e1:SetCondition(c71400049.con1)
e1:SetRange(LOCATION_FZONE)
e1:SetTarget(c71400049.tg1)
e1:SetOperation(c71400049.op1)
c:RegisterEffect(e1)
--special summon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(71400049,1))
e2:SetCategory(CATEGORY_TOGRAVE+CATEGORY_SEARCH+CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetRange(LOCATION_FZONE)
e2:SetCountLimit(1)
e2:SetCondition(c71400049.con2)
e2:SetTarget(c71400049.tg2)
e2:SetOperation(c71400049.op2)
c:RegisterEffect(e2)
end
function c71400049.op1(e,tp,eg,ep,ev,re,r,rp)
local cnt=Duel.GetLocationCount(tp,LOCATION_MZONE)
if cnt<=0 or not e:GetHandler():IsRelateToEffect(e) then return end
if Duel.IsPlayerAffectedByEffect(tp,59822133) then cnt=1 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c71400049.filter1,tp,LOCATION_HAND,0,1,cnt,nil,e,tp)
if g:GetCount()==0 then return end
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
local syng=Duel.GetMatchingGroup(c71400049.synfilter,tp,LOCATION_EXTRA,0,nil)
if syng:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(71400049,2)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local syn=syng:Select(tp,1,1,nil):GetFirst()
Duel.SynchroSummon(tp,syn,nil)
end
end
function c71400049.filter1(c,e,tp)
return c:IsSetCard(0x714) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c71400049.tg1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c71400049.filter1,tp,LOCATION_HAND,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,0,tp,0)
end
function c71400049.con1(e,tp,eg,ep,ev,re,r,rp)
local ph=Duel.GetCurrentPhase()
return ph==PHASE_MAIN1 or ph==PHASE_MAIN2
end
--Select Synchro Monsters
function c71400049.synfilter(c)
return c:IsSetCard(0x717) and c:IsSpecialSummonable(SUMMON_TYPE_SYNCHRO)
end
--Synchro Summon Filter
function c71400049.synfilter2(c)
return c:IsSetCard(0x714) and c:IsSummonType(SUMMON_TYPE_SYNCHRO)
end
function c71400049.con2(e,tp,eg,ep,ev,re,r,rp)
local ct=eg:FilterCount(c71400049.synfilter2,nil)
if ct>0 then e:SetLabel(ct) end
return ct>0
end
function c71400049.tg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE)
end
function c71400049.op2(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local ct=e:GetLabel() or 0
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
local g=Duel.GetMatchingGroup(c71400049.filter1,tp,LOCATION_GRAVE,0,nil,e,tp)
ct=math.min(ct,ft,g:GetCount())
if ct<1 then return end
if Duel.IsPlayerAffectedByEffect(tp,59822133) then ct=1 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=g:Select(tp,1,ct,nil)
Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP)
end
\ No newline at end of file
--黑白的异梦引导
xpcall(function() require("expansions/script/c71400001") end,function() require("script/c71400001") end)
function c71400050.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(c71400050.tg1)
e1:SetCondition(yume.YumeCon)
e1:SetOperation(c71400050.op1)
e1:SetDescription(aux.Stringid(71400050,0))
e1:SetCountLimit(1,71400050)
c:RegisterEffect(e1)
--destroy replace
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EFFECT_DESTROY_REPLACE)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,71500050)
e2:SetCondition(yume.YumeCon)
e2:SetTarget(c71400050.tg2)
e2:SetValue(c71400050.repval)
e2:SetOperation(c71400050.op2)
c:RegisterEffect(e2)
end
function c71400050.filter1(c)
return c:IsSetCard(0x717) and c:IsAbleToHand()
end
function c71400050.filter1a(c)
return c:IsSetCard(0x714) and c:IsType(TYPE_TUNER) and c:IsAbleToHand()
end
function c71400050.tg1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c71400050.filter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c71400050.op1(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c71400050.filter1,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 and Duel.SendtoHand(g,nil,REASON_EFFECT)~=0 then
Duel.ConfirmCards(1-tp,g)
local thg=Duel.GetMatchingGroup(c71400050.filter1a,tp,LOCATION_GRAVE,0,nil)
if thg:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(71400050,1)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local sc=thg:Select(tp,1,1,nil):GetFirst()
Duel.SendtoHand(sc,nil,REASON_EFFECT)
end
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:SetTarget(c71400050.splimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function c71400050.splimit(e,c)
return not c:IsType(TYPE_SYNCHRO) and c:IsLocation(LOCATION_EXTRA)
end
function c71400050.filter2(c,tp)
return c:IsFaceup() and c:IsSetCard(0x714)
and c:IsOnField() and c:IsControler(tp) and c:IsReason(REASON_EFFECT+REASON_BATTLE) and not c:IsReason(REASON_REPLACE)
end
function c71400050.tg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToRemove() and eg:IsExists(c71400050.filter2,1,nil,tp) end
return Duel.SelectEffectYesNo(tp,e:GetHandler(),96)
end
function c71400050.repval(e,c)
return c71400050.filter2(c,e:GetHandlerPlayer())
end
function c71400050.op2(e,tp,eg,ep,ev,re,r,rp)
Duel.Remove(e:GetHandler(),POS_FACEUP,REASON_EFFECT)
end
\ No newline at end of file
--黑白的异梦协奏
xpcall(function() require("expansions/script/c71400001") end,function() require("script/c71400001") end)
function c71400051.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_REMOVE+CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(c71400051.tg1)
e1:SetOperation(c71400051.op1)
e1:SetCondition(c71400051.con1)
e1:SetDescription(aux.Stringid(71400051,0))
e1:SetCountLimit(1,71400051)
c:RegisterEffect(e1)
--destroy
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(71400051,1))
e2:SetCategory(CATEGORY_DESTROY)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_CHAIN_NEGATED)
e2:SetRange(LOCATION_GRAVE)
e1:SetCountLimit(1,71500051)
e2:SetCondition(c71400051.con2)
e2:SetCost(aux.bfgcost)
e2:SetTarget(c71400051.tg2)
e2:SetOperation(c71400051.op2)
c:RegisterEffect(e2)
end
function c71400051.tunerfilter(c)
return c:IsType(TYPE_TUNER) and c:IsSetCard(0x714) and c:IsAbleToRemove()
end
function c71400051.nontunerfilter(c)
return not c:IsType(TYPE_TUNER) and c:IsSetCard(0x714) and c:IsAbleToRemove()
end
function c71400051.fieldsynfilter(c)
return c:IsSetCard(0x717) and c:IsType(TYPE_SYNCHRO) and c:IsFaceup()
end
function c71400051.con1(e,tp,eg,ep,ev,re,r,rp)
return yume.YumeCon(e,tp) and Duel.IsExistingMatchingCard(c71400051.fieldsynfilter,tp,LOCATION_MZONE,0,1,nil)
end
function c71400051.tg1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c71400051.tunerfilter,tp,LOCATION_DECK,0,1,nil) and Duel.IsExistingMatchingCard(c71400051.nontunerfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,2,tp,LOCATION_DECK)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function c71400051.extrasynfilter(c,e,tp)
return c:IsSetCard(0x714) and c:IsType(TYPE_SYNCHRO) and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_SYNCHRO,tp,false,true)
end
function c71400051.op1(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g1=Duel.GetMatchingGroup(c71400051.tunerfilter,tp,LOCATION_DECK,0,nil)
local g2=Duel.GetMatchingGroup(c71400051.nontunerfilter,tp,LOCATION_DECK,0,nil)
if g1:GetCount()==0 or g2:GetCount()==0 then return end
local sg1=g1:Select(tp,1,1,nil)
local sg2=g2:Select(tp,1,2,nil)
sg1:Merge(sg2)
local rc=sg1:GetFirst()
local lv=0
while rc do
lv=lv+rc:GetLevel()
rc=g:GetNext()
end
Duel.Remove(sg1,POS_FACEUP,REASON_EFFECT)
local syng=Duel.GetMatchingGroup(c71400051.extrasynfilter,tp,LOCATION_EXTRA,0,nil,e,tp)
yume.UniquifyCardName(syng)
local ft=Duel.GetLocationCountFromEx(tp)
if ft<1 or not aux.MustMaterialCheck(nil,tp,EFFECT_MUST_BE_SMATERIAL) then return end
if Duel.IsPlayerAffectedByEffect(tp,59822133) then ft=1 end
if syng:CheckWithSumEqual(Card.GetLevel,lv,1,ft) and Duel.SelectYesNo(tp,aux.Stringid(71400051,2)) then
Duel.BreakEffect()
tg=syng:SelectWithSumEqual(tp,Card.GetLevel,lv,1,ft)
local tc=tg:GetFirst()
while tc do
Duel.SpecialSummonStep(tc,SUMMON_TYPE_SYNCHRO,tp,tp,false,true,POS_FACEUP)
tc:CompleteProcedure()
tc=tg:GetNext()
end
end
end
function c71400051.con2(e,tp,eg,ep,ev,re,r,rp)
local de,dp=Duel.GetChainInfo(ev,CHAININFO_DISABLE_REASON,CHAININFO_DISABLE_PLAYER)
return yume.YumeCon(e,tp) and de and dp~=tp and re:GetHandler():IsSetCard(0x714) and rp==tp
end
function c71400051.tg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsSetCard,tp,LOCATION_GRAVE,0,1,e:GetHandler(),0x717) and Duel.IsExistingMatchingCard(aux.TRUE,tp,0,LOCATION_ONFIELD,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_DESTROY,nil,1,1-tp,LOCATION_ONFIELD)
end
function c71400051.op2(e,tp,eg,ep,ev,re,r,rp)
local ct=Duel.GetMatchingGroupCount(Card.IsSetCard,tp,LOCATION_GRAVE,0,1,nil,0x717)
local g=Duel.GetMatchingGroup(aux.TRUE,tp,0,LOCATION_ONFIELD,nil)
if ct>0 and g:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local dg=g:Select(tp,1,ct,nil)
Duel.HintSelection(dg)
Duel.Destroy(dg,REASON_EFFECT)
end
end
\ No newline at end of file
--蚀异梦物-机械
xpcall(function() require("expansions/script/c71400001") end,function() require("script/c71400001") end)
function c71400052.initial_effect(c)
--summon limit
yume.AddYumeSummonLimit(c)
--draw
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(71400052,0))
e1:SetCategory(CATEGORY_DRAW)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_MZONE)
e1:SetCost(c71400052.cost1)
e1:SetTarget(c71400052.tg1)
e1:SetOperation(c71400052.op1)
c:RegisterEffect(e1)
--Equip
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(71400052,1))
e2:SetCategory(CATEGORY_EQUIP)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetRange(LOCATION_MZONE)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetCountLimit(1)
e2:SetCondition(c71400052.con2)
e2:SetTarget(c71400052.tg2)
e2:SetOperation(c71400052.op2)
c:RegisterEffect(e2)
--atk
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_UPDATE_ATTACK)
e3:SetRange(LOCATION_MZONE)
e3:SetTargetRange(LOCATION_MZONE,0)
e3:SetTarget(aux.TargetBoolFunction(Card.IsSetCard,0x714))
e3:SetValue(c71400052.atkval)
c:RegisterEffect(e3)
--def
local e3a=e3:Clone()
e3a:SetCode(EFFECT_UPDATE_DEFENSE)
e3a:SetValue(c71400052.defval)
c:RegisterEffect(e3a)
end
function c71400052.cost1(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 c71400052.tg1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(1)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end
function c71400052.op1(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Draw(p,d,REASON_EFFECT)
end
function c71400052.filter2(c,ec)
return c:IsFaceup() and c:IsType(TYPE_LINK) and c:GetLinkedGroup():IsContains(ec)
end
function c71400052.can_equip_monster(c)
return true
end
function c71400052.con2(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local g=Duel.GetMatchingGroup(c71400052.filter2,0,LOCATION_MZONE,LOCATION_MZONE,nil,c)
return Duel.GetTurnPlayer()~=tp and g:GetCount()>1 and c71400052.can_equip_monster(c)
end
function c71400052.tg2(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and chkc:IsAbleToChangeControler() end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0
and Duel.IsExistingTarget(Card.IsAbleToChangeControler,tp,0,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
local g=Duel.SelectTarget(tp,Card.IsAbleToChangeControler,tp,0,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_EQUIP,g,1,0,0)
end
function c71400052.eqlimit(e,c)
return e:GetOwner()==c
end
function c71400052.equip_monster(c,tp,tc)
if not Duel.Equip(tp,tc,c,false) then return end
--Add Equip limit
tc:RegisterFlagEffect(71400052,RESET_EVENT+RESETS_STANDARD,0,0)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_OWNER_RELATE)
e1:SetCode(EFFECT_EQUIP_LIMIT)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
e1:SetValue(c71400052.eqlimit)
tc:RegisterEffect(e1)
end
function c71400052.op2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsType(TYPE_MONSTER) and tc:IsControler(1-tp) then
if c:IsFaceup() and c:IsRelateToEffect(e) then
c71400052.equip_monster(c,tp,tc)
else Duel.SendtoGrave(tc,REASON_RULE) end
end
end
function c71400052.atkval(e,c)
local atk=0
local g=c:GetEquipGroup()
local tc=g:GetFirst()
while tc do
if tc:GetFlagEffect(71400052)~=0 and tc:IsFaceup() and tc:GetAttack()>=0 then
atk=atk+tc:GetAttack()
end
tc=g:GetNext()
end
return atk
end
function c71400052.defval(e,c)
local def=0
local g=c:GetEquipGroup()
local tc=g:GetFirst()
while tc do
if tc:GetFlagEffect(71400052)~=0 and tc:IsFaceup() and tc:GetDefense()>=0 then
def=def+tc:GetDefense()
end
tc=g:GetNext()
end
return def
end
\ No newline at end of file
--做梦之少年
c71404864.YumeCost=c71404864.YumeCost or 0
function c71404864.initial_effect(c)
--pendulum summon
aux.EnablePendulumAttribute(c,true)
--selfdes
local ep1=Effect.CreateEffect(c)
ep1:SetDescription(aux.Stringid(71404864,2))
ep1:SetType(EFFECT_TYPE_IGNITION)
ep1:SetCategory(CATEGORY_TOGRAVE+CATEGORY_DESTROY)
ep1:SetRange(LOCATION_PZONE)
ep1:SetCountLimit(1,71504865)
ep1:SetTarget(c71404864.tgp1)
ep1:SetCost(c71404864.costp1)
ep1:SetOperation(c71404864.opp1)
c:RegisterEffect(ep1)
Duel.AddCustomActivityCounter(71404864,ACTIVITY_NORMALSUMMON,c71404864.counterfilter)
Duel.AddCustomActivityCounter(71404864,ACTIVITY_SPSUMMON,c71404864.counterfilter)
--revive limit
c:EnableReviveLimit()
--cannot special summon
local e0=Effect.CreateEffect(c)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetCode(EFFECT_SPSUMMON_CONDITION)
--e0:SetValue(aux.FALSE)
c:RegisterEffect(e0)
--self special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(71404864,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_EXTRA+LOCATION_GRAVE)
e1:SetCountLimit(1,71404864)
e1:SetCost(c71404864.cost1)
e1:SetTarget(c71404864.tg1)
e1:SetOperation(c71404864.op1)
c:RegisterEffect(e1)
--special summon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(71404864,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,71504864)
e2:SetCost(c71404864.cost2)
e2:SetCondition(c71404864.con2)
e2:SetTarget(c71404864.tg2)
e2:SetOperation(c71404864.op2)
c:RegisterEffect(e2)
--atk up
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_UPDATE_ATTACK)
e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e3:SetRange(LOCATION_MZONE)
e3:SetValue(c71404864.atkval)
c:RegisterEffect(e3)
end
function c71404864.counterfilter(c)
return c:IsSetCard(0x714)
end
function c71404864.filterp1(c)
return c:IsSetCard(0x714) and c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsAbleToGrave()
end
function c71404864.costp1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetCustomActivityCount(71404864,tp,ACTIVITY_SUMMON)==0
and Duel.GetCustomActivityCount(71404864,tp,ACTIVITY_SPSUMMON)==0 end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetTargetRange(1,0)
e1:SetTarget(c71404864.splimit)
Duel.RegisterEffect(e1,tp)
local e2=e1:Clone()
e2:SetCode(EFFECT_CANNOT_SUMMON)
Duel.RegisterEffect(e2,tp)
local e3=e1:Clone()
e3:SetCode(EFFECT_CANNOT_MSET)
Duel.RegisterEffect(e3,tp)
end
function c71404864.splimit(e,c)
return not c:IsSetCard(0x714)
end
function c71404864.tgp1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c71404864.filterp1,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,e:GetHandler(),1,0,0)
end
function c71404864.opp1(e,tp,eg,ep,ev,re,r,rp,chk)
if not e:GetHandler():IsRelateToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c71404864.filterp1,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 and Duel.SendtoGrave(g,REASON_EFFECT)>0 then
Duel.BreakEffect()
Duel.Destroy(e:GetHandler(),REASON_EFFECT)
end
end
function c71404864.cost1(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetFieldGroup(tp,LOCATION_ONFIELD+LOCATION_HAND,0)
if chk==0 then
local rg=g:Filter(function(c) return c:IsReleasable() or c:IsLocation(LOCATION_HAND) and c:IsType(TYPE_SPELL+TYPE_TRAP) end,nil)
return g:GetCount()==rg:GetCount() and g:GetCount()>0
end
Duel.Release(g,REASON_COST)
end
function c71404864.tg1(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return (c:IsLocation(LOCATION_EXTRA) and Duel.GetLocationCountFromEx(tp)>0 or c:IsLocation(LOCATION_GRAVE) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0)
and c:IsCanBeSpecialSummoned(e,0,tp,true,true) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
end
function c71404864.op1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and Duel.SpecialSummonStep(c,0,tp,tp,true,true,POS_FACEUP) then
c:CompleteProcedure()
c:RegisterFlagEffect(71404864,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(71404864,3))
Duel.SpecialSummonComplete()
local fid=c:GetFieldID()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EFFECT_CANNOT_ACTIVATE)
e1:SetTargetRange(1,0)
e1:SetValue(c71404864.aclimit)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetLabel(fid)
Duel.RegisterEffect(e1,tp)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_CANNOT_DIRECT_ATTACK)
e2:SetTargetRange(LOCATION_MZONE,0)
e2:SetTarget(c71404864.atklimit)
e2:SetReset(RESET_PHASE+PHASE_END)
e2:SetLabel(fid)
Duel.RegisterEffect(e2,tp)
end
end
function c71404864.atklimit(e,c)
return e:GetLabel()~=c:GetFieldID()
end
function c71404864.aclimit(e,re,tp)
local tc=re:GetHandler()
return e:GetLabel()~=tc:GetFieldID() and re:IsActiveType(TYPE_MONSTER) and not tc:IsImmuneToEffect(e)
end
function c71404864.con2(e)
local c=e:GetHandler()
return c:GetFlagEffect(71404864)~=0
end
function c71404864.cost2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local lpcost=math.floor(Duel.GetLP(tp)/2)
Duel.PayLPCost(tp,lpcost)
c71404864.YumeCost=c71404864.YumeCost+lpcost
end
function c71404864.filter2(c,e,sp)
return c:IsType(TYPE_MONSTER) and c:IsSetCard(0x714) and not c:IsCode(71404864) and c:IsCanBeSpecialSummoned(e,0,sp,true,false)
end
function c71404864.tg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local loc=0
if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then loc=loc+LOCATION_DECK end
if Duel.GetLocationCountFromEx(tp)>0 then loc=loc+LOCATION_EXTRA end
return loc~=0 and Duel.IsExistingMatchingCard(c71404864.filter2,tp,loc,0,1,nil,e,tp)
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK+LOCATION_EXTRA)
end
function c71404864.op2(e,tp,eg,ep,ev,re,r,rp)
local loc=0
if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then loc=loc+LOCATION_DECK end
if Duel.GetLocationCountFromEx(tp)>0 then loc=loc+LOCATION_EXTRA end
if loc==0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c71404864.filter2,tp,loc,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,true,false,POS_FACEUP)
end
end
function c71404864.atkval(e,c)
return c71404864.YumeCost
end
\ No newline at end of file
tama=tama or {}
--[[To use this, have to add
xpcall(function() require("expansions/script/c" + "code") end,function() require("script/c" + "code") end) ]]
tama.loaded_metatable_list=tama.loaded_metatable_list or {}
function tama.load_metatable(code)
local m1=_G["c"..code]
if m1 then return m1 end
local m2=tama.loaded_metatable_list[code]
if m2 then return m2 end
_G["c"..code]={}
if pcall(function() dofile("expansions/script/c"..code..".lua") end) or pcall(function() dofile("script/c"..code..".lua") end) then
local mt=_G["c"..code]
_G["c"..code]=nil
if mt then
tama.loaded_metatable_list[code]=mt
return mt
end
else
_G["c"..code]=nil
end
end
function tama.is_series(c,series,v,f,...)
local codet=nil
if type(c)=="number" then
codet={c}
elseif type(c)=="table" then
codet=c
elseif type(c)=="userdata" then
local f=f or Card.GetCode
codet={f(c)}
end
local ncodet={...}
for i,code in pairs(codet) do
for i,ncode in pairs(ncodet) do
if code==ncode then return true end
end
local mt=tama.LoadMetatable(code)
if mt and mt["is_series_with_"..series] and (not v or mt["is_series_with_"..series]==v) then return true end
end
return false
end
function tama.DeepCopy( obj )
local InTable = {};
local function Func(obj)
if type(obj) ~= "table" then --判断表中是否有表
return obj;
end
local NewTable = {}; --定义一个新表
InTable[obj] = NewTable; --若表中有表,则先把表给InTable,再用NewTable去接收内嵌的表
for k,v in pairs(obj) do --把旧表的key和Value赋给新表
NewTable[Func(k)] = Func(v);
end
return setmetatable(NewTable, getmetatable(obj))--赋值元表
end
return Func(obj) --若表中有表,则把内嵌的表也复制了
end
function tama.cosmicFighters_optionFilter(c)
return c:IsFaceup() and c:IsCode(93130022)
end
function tama.cosmicFighters_getOptions(c)
local og=c:GetCardTarget()
local g=og:Filter(tama.optionFilter,nil)
return g
end
function tama.cosmicFighters_getFormation(c)
local og=tama.cosmicFighters_getOptions(c)
og:AddCard(c)
return og
end
function tama.cosmicFighters_isInFormation(c)
local og=tama.cosmicFighters_getFormation(c)
return og:IsContains(c)
end
--[[some of tamas have alchemical elements.If want to use, add
local elements={elements code}
eflist={"tama_elements",elements}
c+code[c]=eflist
]]
function tama.tamas_isExistElement(c,code)
local elements=tama.tamas_getElements(c)
local subElements=tama.tamas_getSubElements(c)
local i=1
if #elements~=0 then
while elements[i] do
if elements[i][1]==code then return true end
i=i+1
end
end
local i=1
if #subElements~=0 then
while subElements[i] do
if subElements[i][1]==code then return true end
i=i+1
end
end
return false
end
function tama.tamas_isExistElements(c,codes)
local elements=tama.tamas_getElements(c)
local subElements=tama.tamas_getSubElements(c)
local i,j=1,1
if #elements~=0 and codes~=nil then
while elements[i] do
while codes[j] do
if elements[i][1]==codes[j] then return true end
j=j+1
end
i=i+1
end
end
local i,j=1,1
if #subElements~=0 and codes~=nil then
while subElements[i] do
while codes[j] do
if subElements[i][1]==codes[j] then return true end
j=j+1
end
i=i+1
end
end
return false
end
function tama.tamas_getElementCount(c,code)
local elements=tama.tamas_getElements(c)
local subElements=tama.tamas_getSubElements(c)
local i=1
local count=0
if #elements~=0 then
while elements[i] do
if elements[i][1]==code then count=count+elements[i][2] end
i=i+1
end
end
i=1
if #subElements~=0 then
while subElements[i] do
if subElements[i][1]==code then count=count+subElements[i][2] end
i=i+1
end
end
return count
end
function tama.tamas_getElements(c)
local mt=tama.load_metatable(c:GetOriginalCode())
--local mt=getmetatable(c)
if mt==nil or type(mt[c])~="table" then return {} end
local eflist=mt[c]
local i=1
while eflist[i] do
if eflist[i]=="tama_elements" then
i=i+1
return eflist[i]
end
i=i+1
end
return {}
end
function tama.tamas_getSubElements(c)
local mt=tama.load_metatable(c:GetOriginalCode())
if mt==nil or type(mt[c])~="table" then return {} end
local eflist=mt[c]
local i=1
while eflist[i] do
if eflist[i]=="tama_sub_elements" then
i=i+1
return eflist[i]
end
i=i+1
end
return {}
end
function tama.tamas_decreaseElements(codes,reduce)
local i=1
local toReduce=tama.DeepCopy(codes)
while toReduce[i] do
local j=1
while reduce[j] do
if toReduce[i][1]==reduce[j][1] then
toReduce[i][2]=toReduce[i][2]-reduce[j][2]
end
j=j+1
end
i=i+1
end
return toReduce
end
function tama.tamas_increaseElements(codes,add)
local toAdd=tama.DeepCopy(codes)
if #toAdd>0 then
local i=1
while toAdd[i] do
local j=1
while add[j] do
if toAdd[i][1]==add[j][1] then
toAdd[i][2]=toAdd[i][2]+add[j][2]
end
j=j+1
end
i=i+1
end
else
local i=1
while add[i] do
table.insert(toAdd,add[i])
--toAdd[i]=add[i]
i=i+1
end
end
return toAdd
end
function tama.tamas_checkElementsForLess(codes,check)
local i=1
local less=false
local banned=false
while codes[i] do
local j=1
while check[j] do
if codes[i][1]==check[j][1] and codes[i][2]>check[j][2] then
banned=true
elseif codes[i][1]==check[j][1] then
less=true
end
j=j+1
end
i=i+1
end
return less and not banned
end
--[[if A={{A,2},{B,2}},B={{A,2}},return true
if A={{A,2},{B,2}},B={{A,2},{B,2}},return true
if A={{A,2},{B,2}},B={{A,2},{C,2}},return true
if A={{A,2},{B,2}},B={{C,2}},return false]]
function tama.tamas_checkElements(codes,check)
local i=1
local accept=false
while codes[i] do
local j=1
while check[j] do
if codes[i][1]==check[j][1] then
accept=true
end
j=j+1
end
i=i+1
end
return accept
end
--[[if A={{A,2},{B,2}},B={{A,2}},return true
if A={{A,2},{B,2}},B={{A,2},{B,2}},return true
if A={{A,2},{B,2}},B={{A,2},{C,2}},return false
if A={{A,2},{B,2}},B={{C,2}},return false]]
function tama.tamas_checkContainElements(codes,check)
local i=1
local contain=false
while check[i] do
local j=1
local accept=false
while codes[j] do
if not check[i][1]==codes[j][1] then
accept=true
end
j=j+1
end
contain=accept
if not contain then return contain end
i=i+1
end
return contain
end
function tama.tamas_checkElementsEmpty(codes)
local i=1
local empty=true
while codes[i] do
if codes[i][2]>0 then
empty=false
end
i=i+1
end
return empty
end
function tama.tamas_checkGroupElementsForLess(g,codes)
local sg=Group.CreateGroup()
local tc=g:GetFirst()
while tc do
local elements=tama.tamas_getElements(tc)
local subElements=tama.tamas_getSubElements(tc)
if tama.tamas_checkElementsForLess(elements,codes) or tama.tamas_checkElementsForLess(subElements,codes) then
sg:AddCard(tc)
end
tc=g:GetNext()
end
return sg
end
function tama.tamas_checkGroupElements(g,codes)
local sg=Group.CreateGroup()
local tc=g:GetFirst()
while tc do
local elements=tama.tamas_getElements(tc)
local subElements=tama.tamas_getSubElements(tc)
if tama.tamas_checkElements(elements,codes) or tama.tamas_checkElements(subElements,codes) then
sg:AddCard(tc)
end
tc=g:GetNext()
end
return sg
end
--target:2A,2B,2C,storage:(A+B)*3,(A+C)*3,(B+C)*2,C*2,final:(A+B)+(A+C)+(B+C) or (A+B)*2+C*2
function tama.tamas_selectElementsForEqual(c,mg,sg,codes)
local targetCodes=tama.DeepCopy(codes)
sg:AddCard(c)
local res=false
local subElements=tama.tamas_getSubElements(c)
local elements=tama.tamas_getElements(c)
local i=1
if #subElements~=0 then
while subElements[i] and not res do
local reduceElements=tama.tamas_increaseElements(elements,{subElements[i]})
if tama.tamas_checkElementsForLess(reduceElements,targetCodes) then
local targetCodes1=tama.tamas_decreaseElements(targetCodes,reduceElements)
if tama.tamas_checkElementsEmpty(targetCodes1) then
res=true
else
res=mg:IsExists(tama.tamas_selectElementsForEqual,1,sg,mg,sg,targetCodes1)
end
end
i=i+1
end
else
if tama.tamas_checkElementsForLess(elements,targetCodes) then
local targetCodes1=tama.tamas_decreaseElements(targetCodes,elements)
if tama.tamas_checkElementsEmpty(targetCodes1) then
res=true
else
res=mg:IsExists(tama.tamas_selectElementsForEqual,1,sg,mg,sg,targetCodes1)
end
end
end
sg:RemoveCard(c)
return res
end
--target:2A,2B,storage:(A+B)*2,3A*1,3B*1,final:(A+B)*2 or 3A+3B
function tama.tamas_selectElementsForAbove(c,mg,sg,codes)
local targetCodes=tama.DeepCopy(codes)
sg:AddCard(c)
local res=false
local subElements=tama.tamas_getSubElements(c)
local elements=tama.tamas_getElements(c)
local i=1
if #subElements~=0 then
while subElements[i] and not res do
local reduceElements=tama.tamas_increaseElements(elements,{subElements[i]})
if tama.tamas_checkElements(reduceElements,targetCodes) then
local targetCodes1=tama.tamas_decreaseElements(targetCodes,reduceElements)
if tama.tamas_checkElementsEmpty(targetCodes1) then
res=true
else
res=mg:IsExists(tama.tamas_selectElementsForAbove,1,sg,mg,sg,targetCodes1)
end
end
i=i+1
end
else
if tama.tamas_checkElements(elements,targetCodes) then
local targetCodes1=tama.tamas_decreaseElements(targetCodes,elements)
if tama.tamas_checkElementsEmpty(targetCodes1) then
res=true
else
res=mg:IsExists(tama.tamas_selectElementsForAbove,1,sg,mg,sg,targetCodes1)
end
end
end
sg:RemoveCard(c)
return res
end
function tama.tamas_groupHasGroup(g1,g2)
local has=true
if g2:GetCount()==0 then return true end
local tc=g2:GetFirst()
while tc do
if not g1:IsContains(tc) then
has=false
break
end
tc=g2:GetNext()
end
return has
end
--t{{group.elements}...}
function tama.tamas_addElementsGroupToTable(t,g,reduceElements)
--reduce group size
local i=1
local added=false
while t[i] do
if tama.tamas_groupHasGroup(g,t[i][1]) then
added=true
end
i=i+1
end
if not added then
i=1
while t[i] do
if tama.tamas_groupHasGroup(t[i][1],g) then
table.remove(t,i)
i=i-1
end
i=i+1
end
local addUp=tama.DeepCopy(reduceElements)
table.insert(t,{g:Clone(),addUp})
end
end
function tama.tamas_elementsSelectFilterForEqual(c,mg,sg,codes,allSelect,selectedElements)
local targetCodes=tama.DeepCopy(codes)
local selectedElements1=tama.DeepCopy(selectedElements)
if c~=nil then
sg:AddCard(c)
mg:RemoveCard(c)
local subElements=tama.tamas_getSubElements(c)
local elements=tama.tamas_getElements(c)
if #subElements~=0 then
local i=1
while subElements[i] do
local reduceElements=tama.tamas_increaseElements(elements,{subElements[i]})
if tama.tamas_checkElementsForLess(reduceElements,targetCodes) then
local selectedElements2=tama.tamas_increaseElements(selectedElements1,reduceElements)
local targetCodes1=tama.tamas_decreaseElements(targetCodes,reduceElements)
if tama.tamas_checkElementsEmpty(targetCodes1) then
tama.tamas_addElementsGroupToTable(allSelect,sg,selectedElements2)
else
local tc=mg:GetFirst()
while tc do
tama.tamas_elementsSelectFilterForEqual(tc,mg:Clone(),sg,targetCodes1,allSelect,selectedElements2)
tc=mg:GetNext()
end
end
end
i=i+1
end
else
if tama.tamas_checkElementsForLess(elements,targetCodes) then
local selectedElements2=tama.tamas_increaseElements(selectedElements1,elements)
local targetCodes1=tama.tamas_decreaseElements(targetCodes,elements)
if tama.tamas_checkElementsEmpty(targetCodes1) then
tama.tamas_addElementsGroupToTable(allSelect,sg,selectedElements2)
else
local tc=mg:GetFirst()
while tc do
tama.tamas_elementsSelectFilterForEqual(tc,mg:Clone(),sg,targetCodes1,allSelect,selectedElements2)
tc=mg:GetNext()
end
end
end
end
elseif mg:GetCount()>0 then
local tc=mg:GetFirst()
while tc do
tama.tamas_elementsSelectFilterForEqual(tc,mg:Clone(),sg,targetCodes,allSelect,selectedElements1)
tc=mg:GetNext()
end
end
if c~=nil then sg:RemoveCard(c) end
return #allSelect>0
end
function tama.tamas_getAllSelectForEqual(mg,codes)
local targetCodes=tama.DeepCopy(codes)
local allSelect={}
local tc=mg:GetFirst()
local sg=Group.CreateGroup()
tama.tamas_elementsSelectFilterForEqual(nil,mg:Clone(),sg,codes,allSelect,{})
return allSelect
end
function tama.tamas_selectAllSelectForEqual(mg,codes,tp)
local allSelect=tama.tamas_getAllSelectForEqual(mg,codes)
local sg=Group.CreateGroup()
local elements={}
while true do
local i=1
local sg1=Group.CreateGroup()
while allSelect[i] and allSelect[i][1] do
if tama.tamas_groupHasGroup(allSelect[i][1],sg) then
sg1:Merge(allSelect[i][1])
end
i=i+1
end
--Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=sg1:Select(tp,1,1,sg)
if g:GetCount()>0 then
sg:Merge(g)
else
local j=1
while allSelect[j] do
if tama.tamas_groupHasGroup(allSelect[j][1],sg) then
elements=allSelect[j][2]
end
j=j+1
end break
end
end
return sg,elements
end
function tama.tamas_elementsSelectFilterForAbove(c,mg,sg,codes,allSelect,selectedElements)
local targetCodes=tama.DeepCopy(codes)
local selectedElements1=tama.DeepCopy(selectedElements)
if c~=nil then
--sg添加穷举到的卡
sg:AddCard(c)
mg:RemoveCard(c)
--获取元素,来减少目标元素,如果目标元素清空则选项组添加sg
local subElements=tama.tamas_getSubElements(c)
local elements=tama.tamas_getElements(c)
if #subElements~=0 then
local i=1
while subElements[i] do
local reduceElements=tama.tamas_increaseElements(elements,{subElements[i]})
if tama.tamas_checkElements(reduceElements,targetCodes) then
local selectedElements2=tama.tamas_increaseElements(selectedElements1,reduceElements)
local targetCodes1=tama.tamas_decreaseElements(targetCodes,reduceElements)
if tama.tamas_checkElementsEmpty(targetCodes1) then
tama.tamas_addElementsGroupToTable(allSelect,sg,selectedElements2)
else
local tc=mg:GetFirst()
while tc do
tama.tamas_elementsSelectFilterForAbove(tc,mg:Clone(),sg,targetCodes1,allSelect,selectedElements2)
tc=mg:GetNext()
end
end
end
i=i+1
end
else
if tama.tamas_checkElements(elements,targetCodes) then
local selectedElements2=tama.tamas_increaseElements(selectedElements1,elements)
local targetCodes1=tama.tamas_decreaseElements(targetCodes,elements)
if tama.tamas_checkElementsEmpty(targetCodes1) then
tama.tamas_addElementsGroupToTable(allSelect,sg,selectedElements2)
else
local tc=mg:GetFirst()
while tc do
tama.tamas_elementsSelectFilterForAbove(tc,mg:Clone(),sg,targetCodes1,allSelect,selectedElements2)
tc=mg:GetNext()
end
end
end
end
elseif mg:GetCount()>0 then
local tc=mg:GetFirst()
while tc do
tama.tamas_elementsSelectFilterForAbove(tc,mg:Clone(),sg,targetCodes,allSelect,selectedElements1)
tc=mg:GetNext()
end
end
if c~=nil then sg:RemoveCard(c) end
return #allSelect>0
end
function tama.tamas_getAllSelectForAbove(mg,codes)
local targetCodes=tama.DeepCopy(codes)
local allSelect={}
local tc=mg:GetFirst()
local sg=Group.CreateGroup()
tama.tamas_elementsSelectFilterForAbove(nil,mg:Clone(),sg,codes,allSelect,{})
return allSelect
end
function tama.tamas_selectAllSelectForAbove(mg,codes,tp)
local allSelect=tama.tamas_getAllSelectForAbove(mg,codes)
local sg=Group.CreateGroup()
local elements={}
while true do
local i=1
local sg1=Group.CreateGroup()
while allSelect[i] and allSelect[i][1] do
if tama.tamas_groupHasGroup(allSelect[i][1],sg) then
sg1:Merge(allSelect[i][1])
end
i=i+1
end
--Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=sg1:Select(tp,1,1,sg)
if g:GetCount()>0 then
sg:Merge(g)
else
local j=1
while allSelect[j] do
if tama.tamas_groupHasGroup(allSelect[j][1],sg) then
elements=allSelect[j][2]
end
j=j+1
end break
end
end
return sg,elements
end
--[[if elements A={{a,2}{b,2}}, B={{a,2}{b,2}}, A<=B
if elements A={{a,2}{b,2}}, B={{a,2}}, A>B
if elements A={{a,2}{b,2}}, B={{a,2}{b,1}}, A<=B
if elements A={{a,2}{b,2}}, B={{a,2}{c,2}}, A<=B
]]
function tama.tamas_checkElementsGreater(codes,subCodes,targetCodes)
local i=0
local greater=false
repeat
i=i+1
local elements=tama.DeepCopy(codes)
if subCodes[i] then
elements=tama.tamas_increaseElements(elements,{subCodes[i]})
end
elements=tama.tamas_decreaseElements(elements,targetCodes)
if tama.tamas_checkContainElements(elements,targetCodes) and not tama.tamas_checkElementsEmpty(elements) then
greater=true
end
until (not subCodes[i] or greater)
return greater
end
function tama.tamas_checkCardElementsGreater(card,targetCard)
local codes=tama.tamas_getElements(card)
local subCodes=tama.tamas_getSubElements(card)
local targetCodes=tama.tamas_getElements(targetCard)
return tama.tamas_checkElementsGreater(codes,subCodes,targetCodes)
end
function tama.tamas_getFormation(c)
local og=tama.cosmicFighters_getOptions(c)
og:AddCard(c)
return og
end
function tama.tamas_isInFormation(c)
local og=tama.cosmicFighters_getFormation(c)
return og:IsContains(c)
end
......@@ -32,4 +32,28 @@
!counter 0x144b 虚空指示物(Void Counter
!setname 0x144d 残星倩影(Starspirit
\ No newline at end of file
!setname 0x144d 残星倩影(Starspirit
#少年 714 0x710-0x71f Sonic_714
!setname 0x714 异梦
!setname 0x3714 异梦境
!setname 0xc714 异梦物
!setname 0xa714 幻异梦
!setname 0x5714 蚀异梦
!setname 0xb714 幻异梦境
!setname 0xe714 幻异梦物
!setname 0x7714 蚀异梦境
!setname 0xd714 蚀异梦物
!setname 0x715 异梦之书
!setname 0x3715 异梦之书中
!setname 0x716 异梦怪物
!setname 0x717 黑白的异梦
#Viola 011 0xe10-0xe1f
#飞球 132 0x350~0x35f 阿飞很开心
!setname 0x356 飞球
!setname 0x3356 元始飞球
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment