Commit 39b14fef authored by wyykak's avatar wyykak

merge 1.999zd

parent 3f1dcf9d
Pipeline #8140 failed with stage
in 10 seconds
No preview for this file type
...@@ -160,6 +160,8 @@ ...@@ -160,6 +160,8 @@
!setname 0x317 幽曲 !setname 0x317 幽曲
!setname 0x334 谢库丽特 !setname 0x334 谢库丽特
!setname 0x338 幽幽子 !setname 0x338 幽幽子
!setname 0x372 遗存
!setname 0x379 嫦娥
!setname 0x381 !setname 0x381
!setname 0x382 厄符 !setname 0x382 厄符
!setname 0x383 创符 !setname 0x383 创符
...@@ -265,7 +267,6 @@ ...@@ -265,7 +267,6 @@
!setname 0x403 黄金拼图 !setname 0x403 黄金拼图
!setname 0x378 飞落之羽 !setname 0x378 飞落之羽
!setname 0x372 遗存
!setname 0xaa2 慧音 !setname 0xaa2 慧音
!setname 0xbad 茧墨阿座化 !setname 0xbad 茧墨阿座化
!setname 0xcaa 时椿之景 !setname 0xcaa 时椿之景
......
No preview for this file type
...@@ -57,7 +57,7 @@ ...@@ -57,7 +57,7 @@
22200161 0 --无颜者 22200161 0 --无颜者
--呆卡 --呆卡
74561020 2 --女神天子 74561020 2 --女神天子
74561011 1 --暴风文 74561011 2 --暴风文
74561017 1 --盲目的贤者✿格洛丽亚 74561017 1 --盲目的贤者✿格洛丽亚
--金卡 --金卡
86379706 0 --精神✿操作 86379706 0 --精神✿操作
......
...@@ -38,7 +38,7 @@ function cCardno.initial_effect(c) ...@@ -38,7 +38,7 @@ function cCardno.initial_effect(c)
e4:SetCountLimit(1) e4:SetCountLimit(1)
e4:SetTarget(cCardno.tdtg) e4:SetTarget(cCardno.tdtg)
e4:SetOperation(cCardno.tdop) e4:SetOperation(cCardno.tdop)
c:RegisterEffect(e4) --c:RegisterEffect(e4)
end end
--to deck --to deck
function cCardno.tdfilter(c) function cCardno.tdfilter(c)
......
...@@ -113,7 +113,7 @@ function cCardno.arop(e,tp,eg,ep,ev,re,r,rp) ...@@ -113,7 +113,7 @@ function cCardno.arop(e,tp,eg,ep,ev,re,r,rp)
end end
--weapon --weapon
function cCardno.wpfilter1(c,e,tp) function cCardno.wpfilter1(c,e,tp)
return c:IsAbleToGraveAsCost() and c:IsSetCard(0x6208) and Duel.IsExistingMatchingCard(cCardno.wpfilter2,tp,LOCATION_GRAVE,0,1,nil,e,tp,c:GetLevel()) return c:IsAbleToGraveAsCost() and c:IsSetCard(0x6208) and Duel.IsExistingMatchingCard(cCardno.wpfilter2,tp,LOCATION_GRAVE,0,1,nil,e,tp,c:GetLevel()) and c:IsLevelBelow(10)
end end
function cCardno.wpfilter2(c,e,tp,lv) function cCardno.wpfilter2(c,e,tp,lv)
return c:IsCanBeSpecialSummoned(e,0,tp,false,false) and c:IsLevelBelow(4) return c:IsCanBeSpecialSummoned(e,0,tp,false,false) and c:IsLevelBelow(4)
......
...@@ -10,11 +10,10 @@ function cCardno.initial_effect(c) ...@@ -10,11 +10,10 @@ function cCardno.initial_effect(c)
--Chain --Chain
local e3=Effect.CreateEffect(c) local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(Cardno,0)) e3:SetDescription(aux.Stringid(Cardno,0))
e3:SetCategory(CATEGORY_DAMAGE|CATEGORY_DISABLE)
e3:SetType(EFFECT_TYPE_QUICK_O) e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_CHAINING) e3:SetCode(EVENT_CHAINING)
e3:SetRange(LOCATION_MZONE) e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1) e3:SetCountLimit(1,Cardno)
e3:SetCondition(cCardno.condition_chain) e3:SetCondition(cCardno.condition_chain)
e3:SetCost(cCardno.cost_chain) e3:SetCost(cCardno.cost_chain)
e3:SetTarget(cCardno.target_chain) e3:SetTarget(cCardno.target_chain)
...@@ -73,43 +72,17 @@ end ...@@ -73,43 +72,17 @@ end
function cCardno.target_chain(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function cCardno.target_chain(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return true end if chkc then return true end
if chk==0 then return true end if chk==0 then return true end
local tc=e:GetHandler()
local e1=Effect.CreateEffect(tc)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_CHAINING)
e1:SetOperation(cCardno.op_chain_damage)
e1:SetReset(RESET_CHAIN)
Duel.RegisterEffect(e1,tp)
e:SetLabelObject(e1)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,e:GetHandler(),0,0,0)
end
function cCardno.op_chain_damage(e,tp,eg,ep,ev,re,r,rp)
local ct=Duel.GetCurrentChain()
e:SetLabel(ct)
end end
function cCardno.operation_chain(e,tp,eg,ep,ev,re,r,rp) function cCardno.operation_chain(e,tp,eg,ep,ev,re,r,rp)
if e:GetLabelObject() then
local ct=e:GetLabelObject():GetLabel()
if ct>0 then
Duel.Damage(1-tp,ct*200,REASON_EFFECT)
end
e:GetLabelObject():Reset()
end
local cc = Duel.GetCurrentChain()
for i=1,Duel.GetCurrentChain()-1 do for i=1,Duel.GetCurrentChain()-1 do
local te=Duel.GetChainInfo(i,CHAININFO_TRIGGERING_EFFECT) local te=Duel.GetChainInfo(i,CHAININFO_TRIGGERING_EFFECT)
if te:GetHandlerPlayer()~=tp then if te:GetHandlerPlayer()~=tp then
if cc>=5 then Duel.ChangeChainOperation(i,cCardno.repop)
Duel.ChangeChainOperation(i,cCardno.repop)
else
Duel.NegateEffect(i)
end
end end
end end
end end
function cCardno.repop(e,tp,eg,ep,ev,re,r,rp) function cCardno.repop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
--local p=c:GetControler()
local g=Duel.GetFieldGroup(tp,LOCATION_HAND,0) local g=Duel.GetFieldGroup(tp,LOCATION_HAND,0)
if not c:IsLocation(LOCATION_HAND) then g:AddCard(c) end if not c:IsLocation(LOCATION_HAND) then g:AddCard(c) end
local num = Duel.SendtoDeck(g,nil,2,REASON_EFFECT) local num = Duel.SendtoDeck(g,nil,2,REASON_EFFECT)
......
--Null✿Existence-X
require "expansions/script/nef/darksyn"
local Cardno=74561041
local cCardno=_G["c"..Cardno]
function cCardno.initial_effect(c)
--dark synchro summon
c:EnableReviveLimit()
DS.AddDarkSynchroProcedure(c,nil,nil,nil)
--cannot xyz
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_BE_XYZ_MATERIAL)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetRange(LOCATION_MZONE)
e1:SetValue(1)
c:RegisterEffect(e1)
--cannot synchro
local e2=e1:Clone()
e2:SetCode(EFFECT_CANNOT_BE_SYNCHRO_MATERIAL)
c:RegisterEffect(e2)
--Chain
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(Cardno,0))
e3:SetCategory(CATEGORY_DAMAGE)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_CHAINING)
e3:SetRange(LOCATION_MZONE)
e3:SetCondition(cCardno.condition_chain)
e3:SetCost(cCardno.cost_chain)
e3:SetTarget(cCardno.target_chain)
e3:SetOperation(cCardno.operation_chain)
c:RegisterEffect(e3)
--damage
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e4:SetCode(EVENT_TO_HAND)
e4:SetRange(LOCATION_MZONE)
e4:SetCondition(cCardno.damcon)
e4:SetOperation(cCardno.damop)
c:RegisterEffect(e4)
--atk def
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_SINGLE)
e5:SetCode(EFFECT_SET_ATTACK)
e5:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e5:SetRange(LOCATION_MZONE)
e5:SetValue(cCardno.atkval)
c:RegisterEffect(e5)
local e6=e5:Clone()
e6:SetCode(EFFECT_SET_DEFENSE)
e6:SetValue(cCardno.defval)
end
--atk def
function cCardno.atkval(e,c)
local tp=e:GetHandler()
local num=Duel.GetFieldGroupCount(tp,0,LOCATION_HAND)
return num*700
end
function cCardno.defval(e,c)
local tp=e:GetHandler()
local num=Duel.GetFieldGroupCount(tp,LOCATION_HAND,0)
return num*700
end
--damage
function cCardno.damcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(Card.IsControler,1,nil,1-tp)
end
function cCardno.damop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,0,Cardno)
local ct=eg:FilterCount(Card.IsControler,nil,1-tp)
Duel.Damage(1-tp,ct*400,REASON_EFFECT)
end
--Chain
function cCardno.condition_chain(ce,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentChain()>=4
end
function cCardno.cost_chain(e,tp,eg,ep,ev,re,r,rp,chk)
local tc=e:GetHandler()
if chk==0 then return tc:GetFlagEffect(Cardno) < 1 end
tc:RegisterFlagEffect(Cardno,RESET_CHAIN,0,1)
end
function cCardno.target_chain(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return true end
if chk==0 then return true end
local tc=e:GetHandler()
local e1=Effect.CreateEffect(tc)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_CHAINING)
e1:SetOperation(cCardno.op_chain_damage)
e1:SetReset(RESET_CHAIN)
Duel.RegisterEffect(e1,tp)
e:SetLabelObject(e1)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,e:GetHandler(),0,0,0)
end
function cCardno.op_chain_damage(e,tp,eg,ep,ev,re,r,rp)
local ct=Duel.GetCurrentChain()
e:SetLabel(ct)
end
function cCardno.operation_chain(e,tp,eg,ep,ev,re,r,rp)
if e:GetLabelObject() then
local ct=e:GetLabelObject():GetLabel()
if ct>0 then
Duel.Damage(1-tp,ct*100,REASON_EFFECT)
end
e:GetLabelObject():Reset()
end
for i=1,Duel.GetCurrentChain()-1 do
local te=Duel.GetChainInfo(i,CHAININFO_TRIGGERING_EFFECT)
if te:GetHandlerPlayer()~=tp then
Duel.ChangeChainOperation(i,cCardno.repop)
end
end
end
function cCardno.repop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
Duel.SendtoDeck(c,nil,2,REASON_EFFECT)
Duel.ShuffleDeck(c:GetControler())
Duel.Draw(tp,1,REASON_EFFECT)
end
...@@ -31,8 +31,8 @@ function c74563005.initial_effect(c) ...@@ -31,8 +31,8 @@ function c74563005.initial_effect(c)
c:RegisterEffect(e3) c:RegisterEffect(e3)
end end
function c74563005.setcost(e,tp,eg,ep,ev,re,r,rp,chk) function c74563005.setcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsCanRemoveCounter(tp,1,1,0x128a,1,REASON_COST) end if chk==0 then return Duel.IsCanRemoveCounter(tp,1,1,0x128a,4,REASON_COST) end
Duel.RemoveCounter(tp,1,1,0x128a,1,REASON_COST) Duel.RemoveCounter(tp,1,1,0x128a,4,REASON_COST)
end end
function c74563005.target(e,tp,eg,ep,ev,re,r,rp,chk) function c74563005.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
......
...@@ -96,18 +96,18 @@ function c74563008.rmtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) ...@@ -96,18 +96,18 @@ function c74563008.rmtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local tg=1 local tg=1
if Duel.IsExistingMatchingCard(c74563008.filters,tp,LOCATION_MZONE,0,1,nil) then if Duel.IsExistingMatchingCard(c74563008.filters,tp,LOCATION_MZONE,0,1,nil) then
tg=2 tg=2
if chkc then return chkc:IsLocation(LOCATION_MZONE+LOCATION_GRAVE) and chkc:IsControler(1-tp) and c74563008.spfilter2(chkc,e,tp) and c:IsAbleToRemove() end if chkc then return chkc:IsLocation(LOCATION_MZONE+LOCATION_GRAVE) and chkc:IsControler(1-tp) and c:IsAbleToRemove() end
if chk==0 then return Duel.IsExistingTarget(c74563008.cfilter,tp,0,LOCATION_MZONE+LOCATION_GRAVE,1,nil) and c:IsAbleToRemove() end if chk==0 then return Duel.IsExistingTarget(c74563008.cfilter,tp,0,LOCATION_MZONE+LOCATION_GRAVE,1,nil) and c:IsAbleToRemove() end
else else
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and c74563008.spfilter2(chkc,e,tp) and c:IsAbleToRemove() end if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(1-tp) and c:IsAbleToRemove() end
if chk==0 then return Duel.IsExistingTarget(c74563008.cfilter,tp,0,LOCATION_MZONE,1,nil) and c:IsAbleToRemove() end if chk==0 then return Duel.IsExistingTarget(c74563008.cfilter,tp,0,LOCATION_GRAVE,1,nil) and c:IsAbleToRemove() end
end end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
if Duel.IsExistingMatchingCard(c74563008.filters,tp,LOCATION_MZONE,0,1,nil) then if Duel.IsExistingMatchingCard(c74563008.filters,tp,LOCATION_MZONE,0,1,nil) then
local g=Duel.SelectTarget(tp,c74563008.cfilter,tp,0,LOCATION_MZONE+LOCATION_GRAVE,1,tg,nil) local g=Duel.SelectTarget(tp,c74563008.cfilter,tp,0,LOCATION_MZONE+LOCATION_GRAVE,1,tg,nil)
Duel.SetChainLimit(c74563008.chlimit) Duel.SetChainLimit(c74563008.chlimit)
else else
local g=Duel.SelectTarget(tp,c74563008.cfilter,tp,0,LOCATION_MZONE,1,tg,nil) local g=Duel.SelectTarget(tp,c74563008.cfilter,tp,0,LOCATION_GRAVE,1,tg,nil)
end end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,tg,0,0) Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,tg,0,0)
end end
......
--圣杖月兔妖
function c74563021.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(74563021,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetCountLimit(1,74563021)
e1:SetCost(c74563021.spcost)
e1:SetTarget(c74563021.sptg)
e1:SetOperation(c74563021.spop)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e2)
--mgmg
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(74563021,1))
e3:SetCategory(CATEGORY_ATKCHANGE)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_REMOVED+LOCATION_HAND)
e3:SetCost(c74563021.cost)
e3:SetTarget(c74563021.atktg)
e3:SetOperation(c74563021.atkop)
c:RegisterEffect(e3)
end
c74563021.DescSetName=0x258
function c74563021.spcost(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 c74563021.filter(c)
return c:IsSetCard(0x46) and c:IsType(TYPE_SPELL) and c:IsAbleToHand()
end
function c74563021.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c74563021.filter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c74563021.spop(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c74563021.filter,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
function c74563021.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsAbleToDeckAsCost() end
Duel.SendtoDeck(c,nil,0,REASON_COST)
end
function c74563021.atktg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
end
function c74563021.atkop(e,tp,eg,ep,ev,re,r,rp)
--half atk
local e4=Effect.CreateEffect(e:GetHandler())
e4:SetType(EFFECT_TYPE_FIELD)
e4:SetCode(EFFECT_SET_ATTACK_FINAL)
e4:SetRange(LOCATION_MZONE)
e4:SetProperty(EFFECT_FLAG_DELAY)
e4:SetTargetRange(0,LOCATION_MZONE)
e4:SetCondition(c74563021.condition)
e4:SetTarget(c74563021.atktg)
e4:SetValue(c74563021.atkval)
e4:SetReset(RESET_PHASE+PHASE_END,2)
Duel.RegisterEffect(e4,tp)
local e5=e4:Clone()
e5:SetCode(EFFECT_SET_DEFENSE_FINAL)
e5:SetValue(c74563021.defval)
Duel.RegisterEffect(e5,tp)
end
function c74563021.cfilter(c)
return c:IsFaceup() and c:IsSetCard(0x258)
end
function c74563021.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c74563021.cfilter,tp,LOCATION_MZONE,0,1,nil)
end
function c74563021.atktg(e,c)
return c~=e:GetHandler()
end
function c74563021.atkval(e,c)
return math.ceil(c:GetAttack()/2)
end
function c74563021.defval(e,c)
return math.ceil(c:GetDefense()/2)
end
\ No newline at end of file
--奔月融合
function c74563022.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_FUSION_SUMMON+CATEGORY_DECKDES)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(c74563022.target)
e1:SetOperation(c74563022.activate)
c:RegisterEffect(e1)
local e12=e1:Clone()
e12:SetType(EFFECT_TYPE_IGNITION)
e12:SetRange(LOCATION_GRAVE)
e12:SetCondition(aux.exccon)
e12:SetCost(aux.bfgcost)
c:RegisterEffect(e12)
end
c74563022.DescSetName=0x258
function c74563022.filter1(c,e)
return not c:IsImmuneToEffect(e)
end
function c74563022.filter2(c,e,tp,m,f,chkf)
return c:IsType(TYPE_FUSION) and (c:IsSetCard(0x258) or c:IsSetCard(0x379)) and (not f or f(c))
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false) and c:CheckFusionMaterial(m,nil,chkf)
end
function c74563022.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDiscardDeck(tp,1) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function c74563022.activate(e,tp,eg,ep,ev,re,r,rp)
local counter=0
if not Duel.IsPlayerCanDiscardDeck(tp,1) then return end
Duel.ConfirmDecktop(tp,1)
local g=Duel.GetDecktopGroup(tp,1)
local tf=g:GetFirst()
if (tf:IsSetCard(0x258) or tf:IsSetCard(0x379)) and tf:IsType(TYPE_MONSTER) and tf:IsCanBeFusionMaterial() and tf:IsAbleToGrave() then
counter=1
end
local chkf=tp
local mg1=Duel.GetFusionMaterial(tp):Filter(c74563022.filter1,nil,e)
if counter==1 then
mg1:AddCard(tf)
end
local sg1=Duel.GetMatchingGroup(c74563022.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg1,nil,chkf)
local mg2=nil
local sg2=nil
local ce=Duel.GetChainMaterial(tp)
if ce~=nil then
local fgroup=ce:GetTarget()
mg2=fgroup(ce,e,tp)
local mf=ce:GetValue()
sg2=Duel.GetMatchingGroup(c74563022.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg2,mf,chkf)
end
if (sg1:GetCount()>0 or (sg2~=nil and sg2:GetCount()>0)) and Duel.SelectYesNo(tp,aux.Stringid(74563022,0)) then
Duel.BreakEffect()
local sg=sg1:Clone()
if sg2 then sg:Merge(sg2) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tg=sg:Select(tp,1,1,nil)
local tc=tg:GetFirst()
if sg1:IsContains(tc) and (sg2==nil or not sg2:IsContains(tc) or not Duel.SelectYesNo(tp,ce:GetDescription())) then
local mat1=Duel.SelectFusionMaterial(tp,tc,mg1,nil,chkf)
tc:SetMaterial(mat1)
Duel.SendtoGrave(mat1,REASON_EFFECT+REASON_MATERIAL+REASON_FUSION)
Duel.BreakEffect()
Duel.SpecialSummon(tc,SUMMON_TYPE_FUSION,tp,tp,false,false,POS_FACEUP)
else
local mat2=Duel.SelectFusionMaterial(tp,tc,mg2,nil,chkf)
local fop=ce:GetOperation()
fop(ce,e,tp,tc,mat2)
end
tc:CompleteProcedure()
if tf:IsLocation(LOCATION_DECK) then
Duel.DisableShuffleCheck()
Duel.SendtoGrave(tf,REASON_EFFECT+REASON_REVEAL)
end
else
Duel.DisableShuffleCheck()
Duel.SendtoGrave(tf,REASON_EFFECT+REASON_REVEAL)
end
end
\ No newline at end of file
--红魔的契约主从✿帕秋莉&小恶魔
function c74563023.initial_effect(c)
--fusion material
c:EnableReviveLimit()
aux.AddFusionProcFun2(c,aux.FilterBoolFunction(Card.IsSetCard,0x111),aux.FilterBoolFunction(Card.IsSetCard,0x811),true)
--mgmg
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_ATKCHANGE)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
e3:SetCondition(c74563023.recon)
e3:SetTarget(c74563023.atktg)
e3:SetOperation(c74563023.atkop)
c:RegisterEffect(e3)
--spsummon1
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(74563023,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,74563023)
e1:SetHintTiming(0,TIMING_MAIN_END)
e1:SetCost(c74563023.spcost1)
e1:SetTarget(c74563023.sptg1)
e1:SetOperation(c74563023.spop1)
c:RegisterEffect(e1)
end
function c74563023.recon(e, c)
return e:GetHandler():GetSummonType() == SUMMON_TYPE_FUSION
end
function c74563023.atktg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
end
function c74563023.atkop(e,tp,eg,ep,ev,re,r,rp)
--half atk
local e4=Effect.CreateEffect(e:GetHandler())
e4:SetType(EFFECT_TYPE_FIELD)
e4:SetCode(EFFECT_SET_ATTACK_FINAL)
e4:SetRange(LOCATION_MZONE)
e4:SetProperty(EFFECT_FLAG_DELAY)
e4:SetTargetRange(0,LOCATION_MZONE)
e4:SetCondition(c74563023.condition)
e4:SetTarget(c74563023.atktg)
e4:SetValue(c74563023.atkval)
e4:SetReset(RESET_PHASE+PHASE_END,2)
Duel.RegisterEffect(e4,tp)
local e5=e4:Clone()
e5:SetCode(EFFECT_SET_DEFENSE_FINAL)
e5:SetValue(c74563023.defval)
Duel.RegisterEffect(e5,tp)
end
function c74563023.cfilter(c)
return c:IsFaceup() and c:IsSetCard(0x177) and c:IsType(TYPE_SPELL)
end
function c74563023.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c74563023.cfilter,tp,LOCATION_ONFIELD,0,1,nil)
end
function c74563023.atktg(e,c)
return c~=e:GetHandler()
end
function c74563023.atkval(e,c)
return math.ceil(c:GetAttack()/2)
end
function c74563023.defval(e,c)
return math.ceil(c:GetDefense()/2)
end
function c74563023.drfilter(c)
return c:IsType(TYPE_SPELL) and c:IsAbleToGraveAsCost()
end
function c74563023.spfilter1(c,e,tp,mg)
return c:IsType(TYPE_SYNCHRO) and (c:IsSetCard(0x111) or c:IsSetCard(0x811))
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_SYNCHRO,tp,false,false) and Duel.GetLocationCountFromEx(tp,tp,mg,c)>0
end
function c74563023.spcost1(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsAbleToGraveAsCost() and Duel.IsExistingMatchingCard(c74563023.drfilter,tp,LOCATION_HAND+LOCATION_ONFIELD,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c74563023.drfilter,tp,LOCATION_HAND+LOCATION_ONFIELD,0,1,1,nil)
g:AddCard(c)
Duel.SendtoGrave(g,REASON_COST)
end
function c74563023.sptg1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return aux.MustMaterialCheck(nil,tp,EFFECT_MUST_BE_SMATERIAL) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function c74563023.spop1(e,tp,eg,ep,ev,re,r,rp)
if not aux.MustMaterialCheck(nil,tp,EFFECT_MUST_BE_SMATERIAL) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c74563023.spfilter1,tp,LOCATION_EXTRA,0,1,1,nil,e,tp,nil)
local tc=g:GetFirst()
if tc and Duel.SpecialSummon(tc,SUMMON_TYPE_SYNCHRO,tp,tp,false,false,POS_FACEUP)~=0 then
tc:CompleteProcedure()
end
end
\ No newline at end of file
--红梦之魔女❀雾雨魔理沙
function c78900101.initial_effect(c)
--fusion material
c:EnableReviveLimit()
aux.AddFusionProcCodeFun(c,11004,aux.FilterBoolFunction(Card.IsRace,RACE_SPELLCASTER),1,true,true)
--special summon rule
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_FIELD)
e0:SetCode(EFFECT_SPSUMMON_PROC)
e0:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e0:SetRange(LOCATION_EXTRA)
e0:SetValue(SUMMON_TYPE_FUSION)
e0:SetCondition(c78900101.spcon)
e0:SetOperation(c78900101.spop)
c:RegisterEffect(e0)
--equip
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(78900101,1))
e1:SetCategory(CATEGORY_EQUIP)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCondition(c78900101.con1)
e1:SetTarget(c78900101.tg1)
e1:SetOperation(c78900101.op1)
c:RegisterEffect(e1)
--SSet=
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1)
e2:SetCost(c78900101.cost2)
e2:SetTarget(c78900101.tg2)
e2:SetOperation(c78900101.op2)
c:RegisterEffect(e2)
--indes
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e3:SetRange(LOCATION_MZONE)
e3:SetCode(EFFECT_INDESTRUCTABLE_COUNT)
e3:SetCountLimit(1)
e3:SetValue(c78900101.indct)
c:RegisterEffect(e2)
end
function c78900101.IsJuXing(c)
local m=_G["c"..c:GetCode()]
return m and m.named_with_JuXing
end
function c78900101.matfilter(c)
return c:IsSetCard(0x200) and c:IsType(TYPE_MONSTER) and c:IsAbleToRemoveAsCost() and c:IsCanBeFusionMaterial()
end
function c78900101.spcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
local g1=Duel.GetMatchingGroup(c78900101.matfilter,tp,LOCATION_MZONE,0,nil)
local g2=Duel.GetMatchingGroup(c78900101.matfilter,tp,LOCATION_HAND,0,nil)
local g3=Duel.GetMatchingGroup(c78900101.matfilter,tp,LOCATION_GRAVE,0,nil)
return g1:GetCount()>0 and g2:GetCount()>0 and g3:GetCount()>0 and Duel.IsPlayerCanRemove(tp)
end
function c78900101.spop(e,tp,eg,ep,ev,re,r,rp,c)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local tc1=Duel.SelectMatchingCard(tp,c78900101.matfilter,tp,LOCATION_MZONE,0,1,1,nil):GetFirst()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local tc2=Duel.SelectMatchingCard(tp,c78900101.matfilter,tp,LOCATION_HAND,0,1,1,nil):GetFirst()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local tc3=Duel.SelectMatchingCard(tp,c78900101.matfilter,tp,LOCATION_GRAVE,0,1,1,nil):GetFirst()
local g=Group.FromCards(tc1,tc2,tc3)
c:SetMaterial(g)
Duel.Remove(g,POS_FACEUP,REASON_COST+REASON_MATERIAL+REASON_FUSION)
end
function c78900101.con1(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_FUSION)
end
function c78900101.filter(c,e,tp)
return c:IsLocation(LOCATION_ONFIELD+LOCATION_GRAVE) and c:IsCanBeEffectTarget(e) and not c:IsForbidden()
end
function c78900101.tg1(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return c78900101.filter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0 and Duel.IsExistingMatchingCard(c78900101.filter,tp,0,LOCATION_ONFIELD+LOCATION_GRAVE,1,nil,e,tp) end
local g=Duel.GetMatchingGroup(c78900101.filter,tp,0,LOCATION_ONFIELD+LOCATION_GRAVE,nil,e,tp)
local tc=nil
if g:GetCount()>1 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
tc=g:Select(tp,1,1,nil):GetFirst()
else
tc=g:GetFirst()
end
Duel.SetTargetCard(tc)
if tc:IsLocation(LOCATION_GRAVE) then
Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,tc,1,0,0)
end
end
function c78900101.op1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if c:IsRelateToEffect(e) and c:IsFaceup() and tc:IsRelateToEffect(e) then
if not Duel.Equip(tp,tc,c,false) then return end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_EQUIP_LIMIT)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
e1:SetValue(c78900101.eqlimit)
tc:RegisterEffect(e1)
end
end
function c78900101.eqlimit(e,c)
return e:GetOwner()==c
end
function c78900101.costfilter(c)
return c:IsType(TYPE_SPELL) and c:IsAbleToGraveAsCost() and (c:IsFaceup() or c:IsLocation(LOCATION_HAND))
end
function c78900101.cost2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c78900101.costfilter,tp,LOCATION_HAND+LOCATION_ONFIELD,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c78900101.costfilter,tp,LOCATION_HAND+LOCATION_ONFIELD,0,1,1,nil)
Duel.SendtoGrave(g,REASON_COST)
end
function c78900101.filter2(c,ignore)
return c78900101.IsJuXing(c) and c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsSSetable(ignore)
end
function c78900101.tg2(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return Duel.IsExistingMatchingCard(c78900101.filter2,tp,LOCATION_DECK,0,1,nil,false) end
end
function c78900101.op2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
local g=Duel.SelectMatchingCard(tp,c78900101.filter2,tp,LOCATION_DECK,0,1,1,nil,false)
local tc=g:GetFirst()
if tc and Duel.SSet(tp,tc)~=0 and tc:IsType(TYPE_TRAP) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_TRAP_ACT_IN_SET_TURN)
e1:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
end
end
function c78900101.indct(e,re,r,rp)
return bit.band(r,REASON_BATTLE+REASON_EFFECT)~=0
end
--巨星『鲸鱼座ο米拉』
function c78901001.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DRAW+CATEGORY_SEARCH+CATEGORY_TOHAND+CATEGORY_REMOVE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,78901001+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(c78901001.target)
e1:SetOperation(c78901001.activate)
c:RegisterEffect(e1)
--buff
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(78901001,2))
e2:SetCategory(CATEGORY_ATKCHANGE)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_TO_GRAVE)
e2:SetCountLimit(1,78901002)
e2:SetTarget(c78901001.tg)
e2:SetOperation(c78901001.op)
c:RegisterEffect(e2)
end
c78901001.named_with_JuXing=1
function c78901001.IsJuXing(c)
local m=_G["c"..c:GetCode()]
return m and m.named_with_JuXing
end
function c78901001.filter(c)
return c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsAbleToHand() and c78901001.IsJuXing(c)
end
function c78901001.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,LOCATION_HAND,0,1,nil) and (Duel.IsExistingMatchingCard(c78901001.filter,tp,LOCATION_DECK,0,1,nil) or Duel.IsPlayerCanDraw(tp,1)) end
e:SetLabel(0)
local ct1=Duel.GetFieldGroupCount(tp,LOCATION_ONFIELD,0)
local ct2=Duel.GetFieldGroupCount(tp,0,LOCATION_ONFIELD)
if ct1<ct2 then
e:SetCategory(CATEGORY_DRAW+CATEGORY_SEARCH+CATEGORY_TOHAND+CATEGORY_REMOVE+CATEGORY_DESTROY)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,nil,1,0,0)
e:SetLabel(1)
else
e:SetCategory(CATEGORY_DRAW+CATEGORY_SEARCH+CATEGORY_TOHAND+CATEGORY_REMOVE)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,0,0)
e:SetLabel(0)
end
end
function c78901001.activate(e,tp,eg,ep,ev,re,r,rp)
local a=0
if e:GetLabel()>0 then
a=1
else
a=0
end
local g=Duel.GetMatchingGroup(Card.IsAbleToRemove,tp,LOCATION_HAND,0,nil)
if g:GetCount()<1 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local tc=g:Select(tp,1,1,nil):GetFirst()
if Duel.Remove(tc,POS_FACEUP,REASON_EFFECT)>0 then
local b1=Duel.IsExistingMatchingCard(c78901001.filter,tp,LOCATION_DECK,0,1,nil)
local b2=Duel.IsPlayerCanDraw(tp,1)
local off=1
local ops={}
local opval={}
if not (b1 or b2) then return end
if b1 then
ops[off]=aux.Stringid(78901001,0)
opval[off-1]=1
off=off+1
end
if b2 then
ops[off]=aux.Stringid(78901001,1)
opval[off-1]=2
off=off+1
end
local op=Duel.SelectOption(tp,table.unpack(ops))
local sel=opval[op]
e:SetLabel(sel)
if sel==1 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local tg=Duel.SelectMatchingCard(tp,c78901001.filter,tp,LOCATION_DECK,0,1,1,nil)
Duel.SendtoHand(tg,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tg)
elseif sel==2 then
Duel.Draw(tp,1,REASON_EFFECT)
end
if a==1 and Duel.GetFieldGroupCount(tp,0,LOCATION_ONFIELD)>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESREPLACE)
local dg=Duel.SelectMatchingCard(tp,aux.TRUE,tp,0,LOCATION_ONFIELD,1,1,nil)
Duel.Destroy(dg,REASON_EFFECT)
end
end
end
function c78901001.tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
end
function c78901001.op(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_UPDATE_ATTACK)
e1:SetTargetRange(LOCATION_MZONE,0)
e1:SetTarget(aux.TargetBoolFunction(Card.IsSetCard,0x200))
e1:SetValue(500)
e1:SetReset(RESET_PHASE+PHASE_END,2)
Duel.RegisterEffect(e1,tp)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_UPDATE_DEFENSE)
e2:SetTargetRange(LOCATION_MZONE,0)
e2:SetTarget(aux.TargetBoolFunction(Card.IsSetCard,0x200))
e2:SetValue(500)
e2:SetReset(RESET_PHASE+PHASE_END,2)
Duel.RegisterEffect(e2,tp)
end
\ No newline at end of file
--巨星『金牛座α毕宿五』
function c78902001.initial_effect(c)
--buff
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,78902001+EFFECT_COUNT_CODE_OATH)
e1:SetOperation(c78902001.operation)
c:RegisterEffect(e1)
--Remove
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(78902001,2))
e2:SetCategory(CATEGORY_REMOVE)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_TO_GRAVE)
e2:SetCost(c78902001.cost)
e2:SetTarget(c78902001.tg)
e2:SetOperation(c78902001.op)
c:RegisterEffect(e2)
end
c78902001.named_with_JuXing=1
function c78902001.IsJuXing(c)
local m=_G["c"..c:GetCode()]
return m and m.named_with_JuXing
end
function c78902001.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EFFECT)
local op=Duel.SelectOption(tp,aux.Stringid(78902001,0),aux.Stringid(78902001,1))
e:SetLabel(op)
if op==0 then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e1:SetTargetRange(LOCATION_MZONE,0)
e1:SetValue(1)
e1:SetTarget(aux.TargetBoolFunction(Card.IsSetCard,0x200))
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
else
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:SetTarget(aux.TargetBoolFunction(Card.IsSetCard,0x200))
e2:SetValue(aux.tgoval)
e2:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e2,tp)
end
end
function c78902001.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_COST+REASON_DISCARD)
end
function c78902001.tg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,0,LOCATION_ONFIELD+LOCATION_GRAVE,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,0,1,1-tp,LOCATION_GRAVE+LOCATION_ONFIELD)
end
function c78902001.op(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(Card.IsAbleToRemove,tp,0,LOCATION_ONFIELD+LOCATION_GRAVE,nil)
if g:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local tc=g:Select(tp,1,1,nil):GetFirst()
Duel.Remove(tc,POS_FACEUP,REASON_EFFECT)
end
end
...@@ -47,7 +47,9 @@ function M.operation(e,tp,eg,ep,ev,re,r,rp) ...@@ -47,7 +47,9 @@ function M.operation(e,tp,eg,ep,ev,re,r,rp)
and Duel.IsExistingMatchingCard(M.filter, tp, LOCATION_EXTRA, 0, 1, nil, e, tp, Group.FromCards(rc, c)) then and Duel.IsExistingMatchingCard(M.filter, tp, LOCATION_EXTRA, 0, 1, nil, e, tp, Group.FromCards(rc, c)) then
local g = Duel.SelectMatchingCard(tp, M.filter, tp, LOCATION_EXTRA, 0, 1, 1, nil, e, tp, Group.FromCards(rc, c)) local g = Duel.SelectMatchingCard(tp, M.filter, tp, LOCATION_EXTRA, 0, 1, 1, nil, e, tp, Group.FromCards(rc, c))
Duel.SendtoDeck(mg, nil, 2, REASON_EFFECT+REASON_MATERIAL+REASON_FUSION) Duel.SendtoDeck(mg, nil, 2, REASON_EFFECT+REASON_MATERIAL+REASON_FUSION)
Duel.BreakEffect()
Duel.SpecialSummon(g, SUMMON_TYPE_FUSION, tp, tp, false, false, POS_FACEUP) Duel.SpecialSummon(g, SUMMON_TYPE_FUSION, tp, tp, false, false, POS_FACEUP)
g:GetFirst():CompleteProcedure()
end end
end end
......
...@@ -57,7 +57,7 @@ end ...@@ -57,7 +57,7 @@ end
function M.sptg(e,tp,eg,ep,ev,re,r,rp,chk) function M.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if not e:GetHandler():IsOnField() then return false end if not e:GetHandler():IsOnField() then return false end
if not eg or eg:GetCount()==0 then return false end if not eg or eg:GetCount()==0 then return false end
if chk==0 then if chk == 0 then
local g = eg:Filter(M.spfliter, nil, tp) local g = eg:Filter(M.spfliter, nil, tp)
if g:GetCount() == 1 then if g:GetCount() == 1 then
local chkf = Duel.GetLocationCountFromEx(tp, tp, g:GetFirst(), TYPE_FUSION) > 0 and PLAYER_NONE or tp local chkf = Duel.GetLocationCountFromEx(tp, tp, g:GetFirst(), TYPE_FUSION) > 0 and PLAYER_NONE or tp
...@@ -82,11 +82,13 @@ function M.spop(e,tp,eg,ep,ev,re,r,rp) ...@@ -82,11 +82,13 @@ function M.spop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_FMATERIAL) Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_FMATERIAL)
local mg = Duel.SelectMatchingCard(tp, M.matfilter, tp, LOCATION_DECK+LOCATION_HAND+LOCATION_MZONE, 0, 1, 1, nil, mc, fc, chkf) local mg = Duel.SelectMatchingCard(tp, M.matfilter, tp, LOCATION_DECK+LOCATION_HAND+LOCATION_MZONE, 0, 1, 1, nil, mc, fc, chkf)
mg:Merge(g) mg:Merge(g)
fc:SetMaterial(mg) fc:SetMaterial(mg)
Duel.SendtoGrave(mg, REASON_EFFECT+REASON_MATERIAL+REASON_FUSION) Duel.SendtoGrave(mg, REASON_EFFECT+REASON_MATERIAL+REASON_FUSION)
Duel.BreakEffect()
Duel.SpecialSummon(fc, SUMMON_TYPE_FUSION, tp, tp, false, false, POS_FACEUP) Duel.SpecialSummon(fc, SUMMON_TYPE_FUSION, tp, tp, false, false, POS_FACEUP)
fc:CompleteProcedure()
end end
end end
......
...@@ -192,7 +192,7 @@ function M.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) ...@@ -192,7 +192,7 @@ function M.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
end end
function M.thfilter(c) function M.thfilter(c)
return c:IsAbleToHand() and c:IsSetCard(0x522) return c:IsAbleToHand() and (c:IsSetCard(0x522) or c:GetCode() == 24235)
end end
function M.thop(e,tp,eg,ep,ev,re,r,rp) function M.thop(e,tp,eg,ep,ev,re,r,rp)
......
--孤火花✿濑笈叶
local M = c999015
local Mid = 999015
function M.initial_effect(c)
-- fusion material
c:EnableReviveLimit()
aux.AddFusionProcFun2(c, aux.FilterBoolFunction(Card.IsFusionSetCard, 0xaa6), aux.FilterBoolFunction(Card.IsFusionSetCard, 0x137), true)
M.addEff1(c)
M.addCommonEff(c)
end
function M.addEff1(c)
local function costfilter(c, tp)
return c:IsType(TYPE_MONSTER)
end
local function target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk == 0 then return Duel.CheckReleaseGroupEx(tp, costfilter, 1, nil, tp) end
local g = Duel.SelectReleaseGroupEx(tp, costfilter, 1, 1, nil, tp)
Duel.Release(g, REASON_COST)
local atk = g:GetFirst():GetAttack()
e:SetLabel(atk)
Duel.SetOperationInfo(0, CATEGORY_RECOVER, nil, 0, tp, atk)
end
local function filter(c,e,tp)
return (c:IsRace(RACE_PLANT) or c:IsRace(RACE_WINDBEAST)) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
local function operation(e,tp,eg,ep,ev,re,r,rp)
local atk = e:GetLabel()
Duel.Recover(tp, atk, REASON_EFFECT)
local op = {
[1] = function()
Duel.Damage(tp, atk/2, REASON_EFFECT)
Duel.Damage(1-tp, atk/2, REASON_EFFECT)
end,
[2] = function()
Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_SPSUMMON)
local g = Duel.SelectMatchingCard(tp, filter, tp, LOCATION_GRAVE+LOCATION_DECK, 0, 1, 1, nil, e, tp)
if g:GetCount() > 0 then
Duel.SpecialSummon(g, 0, tp, tp, false, false, POS_FACEUP)
end
end,
}
local t = {}
table.insert(t, {desc = aux.Stringid(Mid, 0), op = op[1]})
if Duel.GetLocationCount(tp, LOCATION_MZONE) > 0
and Duel.IsExistingMatchingCard(filter, tp, LOCATION_GRAVE+LOCATION_DECK, 0, 1, nil, e, tp) then
table.insert(t, {desc = aux.Stringid(Mid, 1), op = op[2]})
end
local opt = Duel.SelectOption(tp, Nef.unpackOneMember(t, "desc")) + 1
t[opt].op()
end
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_RECOVER)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1, Mid*10+1)
e1:SetTarget(target)
e1:SetOperation(operation)
c:RegisterEffect(e1)
end
function M.addCommonEff(c)
local function thfilter(c)
return c:IsAbleToHand() and (c:IsSetCard(0x137) or c:GetCode() == 24235)
end
local function thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk == 0 then return Duel.IsExistingMatchingCard(thfilter, tp, LOCATION_GRAVE+LOCATION_DECK, 0, 1, nil) end
Duel.SetOperationInfo(0, CATEGORY_TOHAND, nil, 1, 0, 0)
end
local function thop(e,tp,eg,ep,ev,re,r,rp)
if not Duel.IsExistingMatchingCard(thfilter, tp, LOCATION_GRAVE+LOCATION_DECK, 0, 1, nil) then return end
local g = Duel.SelectMatchingCard(tp, thfilter, tp, LOCATION_GRAVE+LOCATION_DECK, 0, 1, 1, nil)
if g:GetCount() > 0 then
Duel.SendtoHand(g, nil, REASON_EFFECT)
Duel.ConfirmCards(1-tp, g)
end
end
local function thcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPreviousPosition(POS_FACEUP) and e:GetHandler():IsPreviousLocation(LOCATION_ONFIELD)
end
local function repop(e,tp,eg,ep,ev,re,r,rp)
local c = e:GetHandler()
local e1 = Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(Mid, 2))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetCountLimit(1)
e1:SetTarget(thtg)
e1:SetOperation(thop)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1, tp)
end
local e2 = Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_TODECK)
e2:SetDescription(aux.Stringid(Mid, 2))
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e2:SetCode(EVENT_TO_GRAVE)
e2:SetCountLimit(1, Mid*10+2)
e2:SetCondition(thcon)
e2:SetOperation(repop)
c:RegisterEffect(e2)
local e3 = e2:Clone()
e3:SetCode(EVENT_REMOVE)
c:RegisterEffect(e3)
local e4 = e2:Clone()
e4:SetCode(EVENT_TO_DECK)
c:RegisterEffect(e4)
end
\ No newline at end of file
--剑兰✿濑笈叶
local M = c999016
local Mid = 999016
function M.initial_effect(c)
-- fusion material
c:EnableReviveLimit()
aux.AddFusionProcFun2(c, aux.FilterBoolFunction(Card.IsFusionSetCard, 0xaa6), aux.FilterBoolFunction(Card.IsFusionSetCard, 0x713), true)
M.addEff1(c)
M.addEff2(c)
M.addCommonEff(c)
end
function M.addEff1(c)
local function con(e,tp,eg,ep,ev,re,r,rp)
return ep == tp
end
local function tg(e,tp,eg,ep,ev,re,r,rp,chk)
if bit.band(r, REASON_BATTLE) ~= 0 then
-- battle damage
if chk == 0 then return Duel.GetLocationCount(tp, LOCATION_MZONE) > 0
and Duel.IsPlayerCanSpecialSummonMonster(tp,20047,0,0x4011,0,800,1,RACE_ZOMBIE,ATTRIBUTE_WIND) end
Duel.SetOperationInfo(0, CATEGORY_TOKEN, nil, 1, 0, 0)
Duel.SetOperationInfo(0, CATEGORY_SPECIAL_SUMMON, nil, 1, 0, 0)
e:SetLabel(1)
else
-- effect damage
if chk == 0 then return true end
Duel.SetTargetPlayer(1-tp)
Duel.SetTargetParam(ev)
Duel.SetOperationInfo(0, CATEGORY_DAMAGE, nil, 0, 1-tp, ev)
e:SetLabel(2)
end
end
local function op(e,tp,eg,ep,ev,re,r,rp)
if e:GetLabel() == 2 then
local p, d = Duel.GetChainInfo(0, CHAININFO_TARGET_PLAYER, CHAININFO_TARGET_PARAM)
Duel.Damage(p, d, REASON_EFFECT)
else
if not Duel.IsPlayerCanSpecialSummonMonster(tp,20047,0,0x4011,0,800,1,RACE_ZOMBIE,ATTRIBUTE_WIND) then return end
local token = Duel.CreateToken(tp, 20047)
Duel.SpecialSummon(token, 0, tp, tp, false, false, POS_FACEUP)
end
end
local e1 = Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1, Mid * 10 + 1)
e1:SetCode(EVENT_DAMAGE)
e1:SetCondition(con)
e1:SetTarget(tg)
e1:SetOperation(op)
c:RegisterEffect(e1)
end
function M.addEff2(c)
local function tg(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)
and (c:IsLocation(LOCATION_GRAVE) or c:IsLocation(LOCATION_REMOVED))
end
Duel.SetOperationInfo(0, CATEGORY_SPECIAL_SUMMON, c, 1, 0, 0)
end
local function op(e,tp,eg,ep,ev,re,r,rp)
local c = e:GetHandler()
if c:IsRelateToEffect(e) and (c:IsLocation(LOCATION_GRAVE) or c:IsLocation(LOCATION_REMOVED)) then
if Duel.SpecialSummon(c, 0, tp, tp, false, false, POS_FACEUP) > 0 then
local e1 = Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_LEAVE_FIELD_REDIRECT)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_REDIRECT)
e1:SetValue(LOCATION_DECKSHF)
c:RegisterEffect(e1, true)
end
end
end
local e2 = Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_REMOVE)
e2:SetRange(LOCATION_GRAVE+LOCATION_REMOVED)
e2:SetCountLimit(1, Mid * 10 + 2)
e2:SetTarget(tg)
e2:SetOperation(op)
c:RegisterEffect(e2)
end
function M.addCommonEff(c)
local function thfilter(c)
return c:IsAbleToHand() and (c:IsSetCard(0x713) or c:GetCode() == 24235)
end
local function thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk == 0 then return Duel.IsExistingMatchingCard(thfilter, tp, LOCATION_GRAVE+LOCATION_DECK, 0, 1, nil) end
Duel.SetOperationInfo(0, CATEGORY_TOHAND, nil, 1, 0, 0)
end
local function thop(e,tp,eg,ep,ev,re,r,rp)
if not Duel.IsExistingMatchingCard(thfilter, tp, LOCATION_GRAVE+LOCATION_DECK, 0, 1, nil) then return end
local g = Duel.SelectMatchingCard(tp, thfilter, tp, LOCATION_GRAVE+LOCATION_DECK, 0, 1, 1, nil)
if g:GetCount() > 0 then
Duel.SendtoHand(g, nil, REASON_EFFECT)
Duel.ConfirmCards(1-tp, g)
end
end
local function thcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPreviousPosition(POS_FACEUP) and e:GetHandler():IsPreviousLocation(LOCATION_ONFIELD)
end
local function repop(e,tp,eg,ep,ev,re,r,rp)
local c = e:GetHandler()
local e1 = Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(Mid, 2))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetCountLimit(1)
e1:SetTarget(thtg)
e1:SetOperation(thop)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1, tp)
end
local e2 = Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_TODECK)
e2:SetDescription(aux.Stringid(Mid, 2))
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e2:SetCode(EVENT_TO_GRAVE)
e2:SetCountLimit(1, Mid*10+3)
e2:SetCondition(thcon)
e2:SetOperation(repop)
c:RegisterEffect(e2)
local e3 = e2:Clone()
e3:SetCode(EVENT_REMOVE)
c:RegisterEffect(e3)
local e4 = e2:Clone()
e4:SetCode(EVENT_TO_DECK)
c:RegisterEffect(e4)
end
\ No newline at end of file
--绿叶之主✿濑笈叶
local M = c999017
local Mid = 999017
function M.initial_effect(c)
-- fusion material
c:EnableReviveLimit()
aux.AddFusionProcFun2(c, aux.FilterBoolFunction(Card.IsFusionSetCard, 0xaa6), aux.FilterBoolFunction(Card.IsFusionSetCard, 0x3208), true)
M.addEff1(c)
M.addEff2(c)
M.addCommonEff(c)
end
function M.addEff1(c)
local function filter(c, tp)
return c:IsLocation(LOCATION_MZONE) and c:IsFaceup()
and c:IsType(TYPE_FUSION) and c:IsSetCard(0xaa6) and c:GetSummonPlayer() == tp
end
local function thfilter(c)
return c:IsAbleToHand() and c:IsSetCard(0xaa6)
end
local function target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk == 0 then
return eg:FilterCount(filter, nil, tp) > 0
and Duel.IsExistingMatchingCard(thfilter, tp, LOCATION_DECK, 0, 1, nil)
end
end
local function operation(e,tp,eg,ep,ev,re,r,rp,chk)
if not Duel.IsExistingMatchingCard(thfilter, tp, LOCATION_DECK, 0, 1, nil) then return end
local g = Duel.SelectMatchingCard(tp, thfilter, 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
local e = Effect.CreateEffect(c)
e:SetCategory(CATEGORY_TOHAND)
e:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e:SetDescription(aux.Stringid(Mid, 0))
e:SetCode(EVENT_SPSUMMON_SUCCESS)
e:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e:SetRange(LOCATION_MZONE)
e:SetCountLimit(1, Mid*10+1)
e:SetTarget(target)
e:SetOperation(operation)
c:RegisterEffect(e)
end
function M.addEff2(c)
local function discardFilter(c)
return c:IsDiscardable() and c:IsType(TYPE_SPELL)
end
local function cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk == 0 then return Duel.IsExistingMatchingCard(discardFilter, tp, LOCATION_HAND, 0, 1, nil) end
Duel.DiscardHand(tp, discardFilter, 1, 1, REASON_COST+REASON_DISCARD, nil)
end
local function tg(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) and c:IsLocation(LOCATION_GRAVE)
end
Duel.SetOperationInfo(0, CATEGORY_SPECIAL_SUMMON, c, 1, 0, 0)
end
local function op(e,tp,eg,ep,ev,re,r,rp,chk)
local c = e:GetHandler()
if c:IsRelateToEffect(e) and c:IsLocation(LOCATION_GRAVE) then
if Duel.SpecialSummon(c, 0, tp, tp, false, false, POS_FACEUP) > 0 then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_TRIGGER)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
c:RegisterEffect(e1)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_SET_ATTACK)
e3:SetValue(4000)
e3:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
c:RegisterEffect(e3)
end
end
end
local e1 = Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetDescription(aux.Stringid(Mid, 1))
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_GRAVE)
e1:SetCountLimit(1, Mid*10+2)
e1:SetCost(cost)
e1:SetTarget(tg)
e1:SetOperation(op)
c:RegisterEffect(e1)
end
function M.addCommonEff(c)
local function thfilter(c)
return c:IsAbleToHand() and (c:IsSetCard(0x3028) or c:GetCode() == 24235)
end
local function thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk == 0 then return Duel.IsExistingMatchingCard(thfilter, tp, LOCATION_GRAVE+LOCATION_DECK, 0, 1, nil) end
Duel.SetOperationInfo(0, CATEGORY_TOHAND, nil, 1, 0, 0)
end
local function thop(e,tp,eg,ep,ev,re,r,rp)
if not Duel.IsExistingMatchingCard(thfilter, tp, LOCATION_GRAVE+LOCATION_DECK, 0, 1, nil) then return end
local g = Duel.SelectMatchingCard(tp, thfilter, tp, LOCATION_GRAVE+LOCATION_DECK, 0, 1, 1, nil)
if g:GetCount() > 0 then
Duel.SendtoHand(g, nil, REASON_EFFECT)
Duel.ConfirmCards(1-tp, g)
end
end
local function thcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPreviousPosition(POS_FACEUP) and e:GetHandler():IsPreviousLocation(LOCATION_ONFIELD)
end
local function repop(e,tp,eg,ep,ev,re,r,rp)
local c = e:GetHandler()
local e1 = Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(Mid, 2))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetCountLimit(1)
e1:SetTarget(thtg)
e1:SetOperation(thop)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1, tp)
end
local e2 = Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_TODECK)
e2:SetDescription(aux.Stringid(Mid, 2))
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e2:SetCode(EVENT_TO_GRAVE)
e2:SetCountLimit(1, Mid*10+3)
e2:SetCondition(thcon)
e2:SetOperation(repop)
c:RegisterEffect(e2)
local e3 = e2:Clone()
e3:SetCode(EVENT_REMOVE)
c:RegisterEffect(e3)
local e4 = e2:Clone()
e4:SetCode(EVENT_TO_DECK)
c:RegisterEffect(e4)
end
\ No newline at end of file
--遮雨荷✿濑笈叶
local M = c999018
local Mid = 999018
function M.initial_effect(c)
-- fusion material
c:EnableReviveLimit()
aux.AddFusionProcFun2(c, aux.FilterBoolFunction(Card.IsFusionSetCard, 0xaa6), aux.FilterBoolFunction(Card.IsFusionSetCard, 0x229), true)
M.addEff1(c)
M.addEff2(c)
M.addCommonEff(c)
end
function M.addEff1(c)
function filter(c, tp)
return c:IsPreviousLocation(LOCATION_HAND) and c:IsType(TYPE_MONSTER) and c:GetPreviousControler() == tp
end
local function cond(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(filter, 1, nil, tp)
end
local function target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk == 0 then return e:GetHandler():GetFlagEffect(Mid) < 1 and Duel.IsPlayerCanDraw(tp, 1) end
Duel.SetOperationInfo(0, CATEGORY_DRAW, nil, 1, 0, 0)
c:RegisterFlagEffect(Mid, RESET_EVENT+0x1fe0000, 0, 1)
end
local function operation(e,tp,eg,ep,ev,re,r,rp)
Duel.Draw(tp, 1, REASON_EFFECT)
if bit.band(r, REASON_FUSION) == REASON_FUSION then
Duel.Draw(tp, 1, REASON_EFFECT)
end
end
local e2 = Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(Mid, 0))
e2:SetCategory(CATEGORY_DRAW)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_TO_GRAVE)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1, Mid*10+1)
e2:SetCondition(cond)
e2:SetTarget(target)
e2:SetOperation(operation)
c:RegisterEffect(e2)
local e3 = e2:Clone()
e3:SetCode(EVENT_REMOVE)
c:RegisterEffect(e3)
local e4 = e2:Clone()
e4:SetCode(EVENT_TO_DECK)
c:RegisterEffect(e4)
end
function M.addEff2(c)
local function tg(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)
and c:IsLocation(LOCATION_GRAVE)
end
Duel.SetOperationInfo(0, CATEGORY_SPECIAL_SUMMON, c, 1, 0, 0)
end
local function op(e,tp,eg,ep,ev,re,r,rp)
local c = e:GetHandler()
if c:IsRelateToEffect(e) and c:IsLocation(LOCATION_GRAVE) then
if Duel.SpecialSummon(c, 0, tp, tp, false, false, POS_FACEUP) > 0 then
local e1 = Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_LEAVE_FIELD_REDIRECT)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_REDIRECT)
e1:SetValue(LOCATION_DECKSHF)
c:RegisterEffect(e1, true)
end
end
end
local e2 = Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(Mid, 1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_MSET)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1, Mid * 10 + 2)
e2:SetTarget(tg)
e2:SetOperation(op)
c:RegisterEffect(e2)
end
function M.addCommonEff(c)
local function thfilter(c)
return c:IsAbleToHand() and (c:IsSetCard(0x229) or c:GetCode() == 24235)
end
local function thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk == 0 then return Duel.IsExistingMatchingCard(thfilter, tp, LOCATION_GRAVE+LOCATION_DECK, 0, 1, nil) end
Duel.SetOperationInfo(0, CATEGORY_TOHAND, nil, 1, 0, 0)
end
local function thop(e,tp,eg,ep,ev,re,r,rp)
if not Duel.IsExistingMatchingCard(thfilter, tp, LOCATION_GRAVE+LOCATION_DECK, 0, 1, nil) then return end
local g = Duel.SelectMatchingCard(tp, thfilter, tp, LOCATION_GRAVE+LOCATION_DECK, 0, 1, 1, nil)
if g:GetCount() > 0 then
Duel.SendtoHand(g, nil, REASON_EFFECT)
Duel.ConfirmCards(1-tp, g)
end
end
local function thcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPreviousPosition(POS_FACEUP) and e:GetHandler():IsPreviousLocation(LOCATION_ONFIELD)
end
local function repop(e,tp,eg,ep,ev,re,r,rp)
local c = e:GetHandler()
local e1 = Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(Mid, 2))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetCountLimit(1)
e1:SetTarget(thtg)
e1:SetOperation(thop)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1, tp)
end
local e2 = Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_TODECK)
e2:SetDescription(aux.Stringid(Mid, 2))
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e2:SetCode(EVENT_TO_GRAVE)
e2:SetCountLimit(1, Mid*10+3)
e2:SetCondition(thcon)
e2:SetOperation(repop)
c:RegisterEffect(e2)
local e3 = e2:Clone()
e3:SetCode(EVENT_REMOVE)
c:RegisterEffect(e3)
local e4 = e2:Clone()
e4:SetCode(EVENT_TO_DECK)
c:RegisterEffect(e4)
end
\ No newline at end of file
--地底蔷薇✿濑笈叶
local M = c999019
local Mid = 999019
function M.initial_effect(c)
-- fusion material
c:EnableReviveLimit()
aux.AddFusionProcFun2(c, aux.FilterBoolFunction(Card.IsFusionSetCard, 0xaa6), aux.FilterBoolFunction(Card.IsFusionSetCard, 0x514a), true)
M.addEff1(c)
M.addEff2(c)
M.addCommonEff(c)
end
function M.addEff1(c)
local function filter(c, e, tp, mg)
local chkf = Duel.GetLocationCountFromEx(tp, tp, mg, c) > 0 and PLAYER_NONE or tp
return c:IsType(TYPE_FUSION) and c:IsCanBeSpecialSummoned(e, SUMMON_TYPE_FUSION, tp, false, false)
and c:CheckFusionMaterial(mg, e:GetHandler(), chkf)
end
local function tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk == 0 then
return Duel.IsExistingMatchingCard(Card.IsType, tp, LOCATION_DECK, 0, 1, nil, TYPE_MONSTER)
end
end
local function op(e,tp,eg,ep,ev,re,r,rp)
local sg = Duel.GetMatchingGroup(Card.IsType, tp, LOCATION_DECK, 0, nil, TYPE_MONSTER)
if sg:GetCount() > 0 then
local mc = sg:RandomSelect(tp, 1)
Duel.ConfirmCards(1-tp, mc)
Duel.ConfirmCards(tp, mc)
local c = e:GetHandler()
local mg = Group.FromCards(mc, c)
local fg = Duel.GetMatchingGroup(filter, tp, LOCATION_EXTRA, 0, nil, e, tp, mg)
if fg:GetCount() > 0 and Duel.SelectYesNo(tp, aux.Stringid(Mid, 3)) then
Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_SPSUMMON)
local fc = fg:Select(tp, 1, 1, nil):GetFirst()
fc:SetMaterial(mg)
Duel.SendtoGrave(mg, REASON_EFFECT+REASON_MATERIAL+REASON_FUSION)
Duel.BreakEffect()
Duel.SpecialSummon(fc, SUMMON_TYPE_FUSION, tp, tp, false, false, POS_FACEUP)
fc:CompleteProcedure()
else
Duel.SendtoGrave(mc, REASON_EFFECT)
end
end
end
local e1 = Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetDescription(aux.Stringid(Mid, 0))
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1, Mid*10+1)
e1:SetTarget(tg)
e1:SetOperation(op)
c:RegisterEffect(e1)
end
function M.addEff2(c)
local function costfilter(c)
return c:IsAbleToGraveAsCost() and c:IsSetCard(0xaa6)
and bit.band(c:GetSummonType(), SUMMON_TYPE_SPECIAL) == SUMMON_TYPE_SPECIAL
end
local function cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk == 0 then return Duel.IsExistingMatchingCard(costfilter, tp, LOCATION_MZONE, 0, 1, e:GetHandler()) end
local sg = Duel.SelectMatchingCard(tp, costfilter, tp, LOCATION_MZONE, 0, 1, 1, e:GetHandler())
Duel.SendtoGrave(sg, REASON_COST)
end
local function tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk == 0 then
return Duel.GetLocationCount(tp, LOCATION_MZONE) > 0 and e:GetHandler():IsCanBeSpecialSummoned(e, 0, tp, false, false)
end
Duel.SetOperationInfo(0, CATEGORY_SPECIAL_SUMMON, e:GetHandler(), 1, tp, LOCATION_EXTRA)
end
local function op(e,tp,eg,ep,ev,re,r,rp)
local c = e:GetHandler()
if c:IsRelateToEffect(e) and c:IsLocation(LOCATION_EXTRA) then
Duel.SpecialSummon(c, 0, tp, tp, false, false,POS_FACEUP)
end
end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetDescription(aux.Stringid(Mid, 1))
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_EXTRA)
e1:SetCountLimit(1, Mid*10+2)
e1:SetCost(cost)
e1:SetTarget(tg)
e1:SetOperation(op)
c:RegisterEffect(e1)
end
function M.addCommonEff(c)
local function thfilter(c)
return c:IsAbleToHand() and (c:IsSetCard(0x514a) or c:GetCode() == 24235)
end
local function thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk == 0 then return Duel.IsExistingMatchingCard(thfilter, tp, LOCATION_GRAVE+LOCATION_DECK, 0, 1, nil) end
Duel.SetOperationInfo(0, CATEGORY_TOHAND, nil, 1, 0, 0)
end
local function thop(e,tp,eg,ep,ev,re,r,rp)
if not Duel.IsExistingMatchingCard(thfilter, tp, LOCATION_GRAVE+LOCATION_DECK, 0, 1, nil) then return end
local g = Duel.SelectMatchingCard(tp, thfilter, tp, LOCATION_GRAVE+LOCATION_DECK, 0, 1, 1, nil)
if g:GetCount() > 0 then
Duel.SendtoHand(g, nil, REASON_EFFECT)
Duel.ConfirmCards(1-tp, g)
end
end
local function thcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPreviousPosition(POS_FACEUP) and e:GetHandler():IsPreviousLocation(LOCATION_ONFIELD)
end
local function repop(e,tp,eg,ep,ev,re,r,rp)
local c = e:GetHandler()
local e1 = Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(Mid, 2))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetCountLimit(1)
e1:SetTarget(thtg)
e1:SetOperation(thop)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1, tp)
end
local e2 = Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_TODECK)
e2:SetDescription(aux.Stringid(Mid, 2))
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e2:SetCode(EVENT_TO_GRAVE)
e2:SetCountLimit(1, Mid*10+3)
e2:SetCondition(thcon)
e2:SetOperation(repop)
c:RegisterEffect(e2)
local e3 = e2:Clone()
e3:SetCode(EVENT_REMOVE)
c:RegisterEffect(e3)
local e4 = e2:Clone()
e4:SetCode(EVENT_TO_DECK)
c:RegisterEffect(e4)
end
\ No newline at end of file
--圣诞型植物妖怪 濑笈叶
local M = c999020
local Mid = 999020
function M.initial_effect(c)
local e1 = Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(Mid, 0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetCountLimit(1, Mid)
e1:SetRange(LOCATION_GRAVE)
e1:SetTarget(M.target)
e1:SetOperation(M.operation)
c:RegisterEffect(e1)
end
function M.filter(c)
return c:IsFaceup() and c:IsLevelAbove(6) and c:IsType(TYPE_FUSION)
end
function M.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and M.filter(chkc) end
local c = e:GetHandler()
if chk == 0 then return Duel.IsExistingTarget(M.filter, tp, LOCATION_MZONE, 0, 1, nil)
and Duel.GetLocationCount(tp, LOCATION_MZONE) > 0 and c:IsCanBeSpecialSummoned(e, 0, tp, false, false) end
Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_TARGET)
Duel.SelectTarget(tp, M.filter, tp, LOCATION_MZONE, 0, 1, 1, nil)
Duel.SetOperationInfo(0, CATEGORY_SPECIAL_SUMMON, c, 1, 0, 0)
end
function M.operation(e,tp,eg,ep,ev,re,r,rp)
local tc = Duel.GetFirstTarget()
if tc:IsFacedown() or not tc:IsRelateToEffect(e) or tc:IsImmuneToEffect(e) or tc:GetLevel() < 6 then return end
local c = e:GetHandler()
local e1 = Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_LEVEL)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
e1:SetValue(-2)
tc:RegisterEffect(e1)
if c:IsRelateToEffect(e) then
Duel.SpecialSummon(c, 0, tp, tp, false, false, POS_FACEUP)
local atk = tc:GetAttack()
Duel.Recover(tp, atk/2, REASON_EFFECT)
Duel.Recover(1-tp, atk/2, REASON_EFFECT)
end
end
...@@ -31,7 +31,7 @@ function M.tgfilter(c) ...@@ -31,7 +31,7 @@ function M.tgfilter(c)
end end
function M.thfilter(c) function M.thfilter(c)
return c:IsSetCard(0x46) and not c:IsCode(24235) and not c:IsCode(Mid) and c:IsAbleToHand() return c:IsSetCard(0x46) and not c:IsCode(24235) and not c:IsCode(999111) and c:IsAbleToHand()
end end
function M.target(e,tp,eg,ep,ev,re,r,rp,chk) function M.target(e,tp,eg,ep,ev,re,r,rp,chk)
...@@ -73,11 +73,8 @@ function M.chain_target(e, te, tp) ...@@ -73,11 +73,8 @@ function M.chain_target(e, te, tp)
if not te then return end if not te then return end
local c = te:GetHandler() local c = te:GetHandler()
if not c then return end if not c then return end
if c:IsCode(24235) then
return Duel.GetMatchingGroup(M.filter, tp, LOCATION_MZONE+LOCATION_GRAVE+LOCATION_HAND+LOCATION_DECK, 0, nil, te) return c:IsCode(24235) and Duel.GetMatchingGroup(M.filter, tp, LOCATION_MZONE+LOCATION_GRAVE+LOCATION_HAND+LOCATION_DECK, 0, nil, te)
else
return Group.CreateGroup()
end
end end
function M.chain_operation(e,te,tp,tc,mat,sumtype) function M.chain_operation(e,te,tp,tc,mat,sumtype)
......
...@@ -89,6 +89,7 @@ function c999310.operation(e,tp,eg,ep,ev,re,r,rp) ...@@ -89,6 +89,7 @@ function c999310.operation(e,tp,eg,ep,ev,re,r,rp)
if Duel.SendtoGrave(g1,REASON_EFFECT+REASON_MATERIAL+REASON_FUSION) > 1 then if Duel.SendtoGrave(g1,REASON_EFFECT+REASON_MATERIAL+REASON_FUSION) > 1 then
tc:SetMaterial(g1) tc:SetMaterial(g1)
Duel.SpecialSummon(tc,SUMMON_TYPE_FUSION,tp,tp,false,false,POS_FACEUP) Duel.SpecialSummon(tc,SUMMON_TYPE_FUSION,tp,tp,false,false,POS_FACEUP)
tc:CompleteProcedure()
end end
end end
end end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment