Commit d946a8f0 authored by REIKAI's avatar REIKAI 💬

delete cards

parent 1d037883
No preview for this file type
if not pcall(function() require("expansions/script/c20099998") end) then require("script/c20099998") end
if fuef then return end
fuef = { } --"Effect function"
--------------------------------------------------------------------------"Effect function"
function fuef.Creat(owner,handler,...)
local e = fuef.Set(fucg.eff.CRE(fusf.GetCardTable(owner)[1]),...)
if handler then fuef.Register(e,handler) end
return e
end
function fuef.Clone(effect,handler,...)
local e = fuef.Set(fucg.eff.CLO(effect),...)
if handler then fuef.Register(e,handler) end
return e
end
function fuef.Set(e,...)
e = type(e) == "table" and e or { e }
local setlist = {...}
if #setlist == 0 then return table.unpack(e) end
if type(setlist[1]) ~= "table" then setlist = {setlist} end
for _,E in ipairs(e) do
for _,set in ipairs(setlist) do
local f = type(set[1]) == "string" and fucg.eff[set[1] ] or set[1]
table.remove(set,1)
f(E,table.unpack(set))
end
end
return e
end
function fuef.Register(e,handler)
handler = type(handler) == "table" and handler or { handler }
local Ignore = handler[2] or false
local Handler = type(handler[1]) == "number" and handler[1] or fusf.GetCardTable(handler[1])
for _,E in ipairs(type(e) == "table" and e or {e}) do
if type(Handler) == "number" then
Duel.RegisterEffect(E,Handler)
else
for _,C in ipairs(Handler) do
C:RegisterEffect(E,Ignore)
end
end
end
end
--------------------------------------------------------------------------"Effect_Base"
--Action Effect
function fuef.Act(typ,dis)
return function(c,rc,...)
local v, var = fusf.Value_Trans({...}), { }
for i,val in ipairs(fusf.CutDis("DES,CAT,COD,PRO,RAN,CTL,CON,COS,TG,OP,RES,LAB,OBJ",dis)) do
if val == "COD" then
var[#var + 1] = { val , fusf.NotNil(v[i]) and v[i] or "FC" }
elseif fusf.NotNil(v[i]) then
var[#var + 1] = { val , v[i] }
end
end
return fuef.Creat(c,rc,{"TYP",typ},table.unpack(var))
end
end
--NoAction Effect
function fuef.NoAct(typ,dis)
return function(c,rc,...)
local v, var = fusf.Value_Trans({...}), { }
for i,val in ipairs(fusf.CutDis("DES,COD,PRO,RAN,TRAN,VAL,CTL,CON,TG,OP,RES,LAB,OBJ",dis)) do
if fusf.NotNil(v[i]) then
var[#var + 1] = { val , v[i] }
end
end
return fuef.Creat(c,rc,{"TYP",typ},table.unpack(var))
end
end
fuef.B_A = fuef.Act(EFFECT_TYPE_ACTIVATE,"RAN")
fuef.A = function(c,rc,cod) return fuef.B_A(c,rc or c,",",cod) end
fuef.I = fuef.Act(EFFECT_TYPE_IGNITION,"")
fuef.QO = fuef.Act(EFFECT_TYPE_QUICK_O,"")
fuef.QF = fuef.Act(EFFECT_TYPE_QUICK_F,"")
fuef.FTO = fuef.Act(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O,"")
fuef.FTF = fuef.Act(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F,"")
fuef.STO = fuef.Act(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O,"RAN")
fuef.STF = fuef.Act(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F,"RAN")
fuef.S = fuef.NoAct(EFFECT_TYPE_SINGLE,"TRAN,TG")
fuef.SC = fuef.NoAct(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS,"RAN,TRAN,VAL,TG")
fuef.F = fuef.NoAct(EFFECT_TYPE_FIELD,"")
fuef.FC = fuef.NoAct(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS,"TRAN,VAL,TG")
fuef.FG = fuef.NoAct(EFFECT_TYPE_FIELD+EFFECT_TYPE_GRANT,"COD,PRO,VAL,CTL,TG,OP")
fuef.E = fuef.NoAct(EFFECT_TYPE_EQUIP,"DES,RAN,TRAN,CTL,TG,OP")
fuef.EC = fuef.NoAct(EFFECT_TYPE_EQUIP+EFFECT_TYPE_CONTINUOUS,"DES,PRO,RAN,TRAN,VAL,CTL")
\ No newline at end of file
--幻梦帝无亘龙
local cm,m,o=GetID()
function cm.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SPSUMMON_CONDITION)
e1:SetValue(aux.FALSE)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_HAND)
e2:SetCondition(cm.con2)
e2:SetOperation(cm.op2)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_IMMUNE_EFFECT)
e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e3:SetRange(LOCATION_MZONE)
e3:SetValue(cm.val3)
c:RegisterEffect(e3)
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e4:SetCode(EVENT_PHASE+PHASE_BATTLE_START)
e4:SetRange(LOCATION_MZONE)
e4:SetCountLimit(1)
e4:SetCondition(cm.con4)
e4:SetOperation(cm.op4)
c:RegisterEffect(e4)
end
--e2
function cm.con2(e,tp)
return (Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2) and e:GetHandler():IsSummonable(true,nil,1)
end
function cm.opf2(g,rc,minc,maxc)
return Duel.CheckTribute(rc,minc,maxc,g) and (g:GetCount()==minc or g:GetCount()==maxc)
end
function cm.op2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetTributeGroup(c)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
g=g:SelectSubGroup(tp,cm.opf2,true,1,#g,c,c:GetTributeRequirement())
if not g then return end
g:KeepAlive()
local e1=Effect.CreateEffect(c)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SUMMON_PROC)
e1:SetLabelObject(g)
e1:SetOperation(function (ce,ctp,ceg,cep,cev,cre,cr,crp,cc)
cc:SetMaterial(g)
Duel.Release(g,REASON_SUMMON+REASON_MATERIAL)
e1:Reset()
end)
e1:SetValue(SUMMON_TYPE_ADVANCE)
c:RegisterEffect(e1)
Duel.Summon(tp,c,true,e1,0)
end
--e3
function cm.val3(e,te)
return te:GetOwner():IsType(TYPE_MONSTER) and te:GetOwner():IsLevelBelow(5) and te:GetOwner():IsLevelAbove(1)
end
--e4
function cm.con4(e)
return Duel.GetTurnPlayer()==e:GetHandlerPlayer()
end
function cm.op4(e,tp,eg,ep,ev,re,r,rp)
local n=Duel.GetFieldGroupCount(tp,0,LOCATION_MZONE)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_EXTRA_ATTACK)
e1:SetValue(n-1)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_BATTLE)
e:GetHandler():RegisterEffect(e1)
end
\ No newline at end of file
--安宁茶具
function c20000051.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_RECOVER+CATEGORY_SUMMON+CATEGORY_TOGRAVE+CATEGORY_DRAW+CATEGORY_HANDES+CATEGORY_TODECK+CATEGORY_REMOVE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,20000051+EFFECT_COUNT_CODE_OATH)
e1:SetOperation(c20000051.op1)
c:RegisterEffect(e1)
if not c20000051.global_check then
c20000051.global_check=true
c20000051[0]=0
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_CHAINING)
ge1:SetCondition(c20000051.checkcon)
ge1:SetOperation(c20000051.checkop)
Duel.RegisterEffect(ge1,0)
end
end
function c20000051.checkcon(e,tp,eg,ep,ev,re,r,rp)
return re:GetHandler():GetOriginalCode()==20000051
end
function c20000051.checkop(e,tp,eg,ep,ev,re,r,rp)
c20000051[0] = c20000051[0] + 1
end
--
function c20000051.opg3(c)
return c:IsSummonable(true,nil)
end
function c20000051.op1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=c20000051[0]
if g==1 then
Duel.Recover(tp,1000,REASON_EFFECT)
Duel.BreakEffect()
c:CancelToGrave()
Duel.SendtoDeck(c,nil,2,REASON_EFFECT)
elseif g==2 then
Duel.SetLP(1-tp,Duel.GetLP(1-tp)-2500)
Duel.BreakEffect()
c:CancelToGrave()
Duel.SendtoDeck(c,nil,2,REASON_EFFECT)
elseif g==3 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SUMMON)
local g=Duel.SelectMatchingCard(tp,c20000051.g3,tp,LOCATION_HAND,0,1,1,nil)
local tc=g:GetFirst()
if tc then
Duel.Summon(tp,tc,true,nil,1)
end
Duel.BreakEffect()
c:CancelToGrave()
Duel.SendtoDeck(c,nil,2,REASON_EFFECT)
elseif g==4 then
local g=Duel.GetMatchingGroup(nil,1-tp,LOCATION_MZONE,0,nil)
Duel.Hint(HINT_SELECTMSG,1-tp,HINTMSG_TOGRAVE)
local sg=g:Select(1-tp,1,1,nil)
Duel.HintSelection(sg)
Duel.SendtoGrave(sg,REASON_RULE)
Duel.BreakEffect()
c:CancelToGrave()
Duel.SendtoDeck(c,nil,2,REASON_EFFECT)
elseif g==5 then
Duel.Draw(tp,1,REASON_EFFECT)
Duel.BreakEffect()
c:CancelToGrave()
Duel.SendtoDeck(c,nil,2,REASON_EFFECT)
elseif g==6 then
Duel.DiscardHand(1-tp,nil,1,1,REASON_EFFECT+REASON_DISCARD)
Duel.BreakEffect()
c:CancelToGrave()
Duel.SendtoDeck(c,nil,2,REASON_EFFECT)
elseif g==7 then
local g=Duel.GetMatchingGroup(nil,tp,LOCATION_GRAVE,0,nil)
Duel.SendtoDeck(g,tp,2,REASON_EFFECT)
Duel.BreakEffect()
c:CancelToGrave()
Duel.SendtoDeck(c,nil,2,REASON_EFFECT)
elseif g==8 then
local g=Duel.GetMatchingGroup(nil,tp,0,LOCATION_GRAVE,nil)
Duel.Remove(g,POS_FACEUP,REASON_EFFECT)
Duel.BreakEffect()
c:CancelToGrave()
Duel.SendtoDeck(c,nil,2,REASON_EFFECT)
elseif g==9 then
Duel.SetLP(tp,8000)
Duel.BreakEffect()
c:CancelToGrave()
Duel.SendtoDeck(c,nil,2,REASON_EFFECT)
else
Duel.SetLP(1-tp,0)
Duel.BreakEffect()
c:CancelToGrave()
Duel.SendtoDeck(c,nil,2,REASON_EFFECT)
end
end
\ No newline at end of file
--双重选择
function c20000052.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DICE+CATEGORY_DRAW)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(c20000052.target)
e1:SetOperation(c20000052.activate)
c:RegisterEffect(e1)
end
c20000052.toss_dice=true
function c20000052.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDraw(tp,2) end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(2)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,2)
end
function c20000052.activate(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
local c=e:GetHandler()
local dice1=Duel.TossDice(tp,1)
while dice1~=1 do
Duel.SetLP(tp,Duel.GetLP(tp)-2000)
dice1=Duel.TossDice(tp,1)
end
Duel.Draw(p,d,REASON_EFFECT)
end
--深幽茶
function c20000053.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_ACTIVATE_COST)
e2:SetRange(LOCATION_SZONE)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetTargetRange(1,1)
e2:SetCost(c20000053.costchk)
e2:SetOperation(c20000053.costop)
c:RegisterEffect(e2)
end
function c20000053.costchk(e,te_or_c,tp)
return Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>1
end
function c20000053.costop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetFieldGroup(tp,LOCATION_DECK,0)
if g:GetCount()==0 then return end
local tc=g:GetMinGroup(Card.GetSequence):GetFirst()
Duel.SendtoDeck(tc,1-tp,1,REASON_COST)
end
--星屑茶
function c20000054.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_ACTIVATE_COST)
e2:SetRange(LOCATION_SZONE)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetTargetRange(1,1)
e2:SetCost(c20000054.costchk)
e2:SetOperation(c20000054.costop)
c:RegisterEffect(e2)
end
function c20000054.costchk(e,te_or_c,tp)
return Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>1
end
function c20000054.costop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetFieldGroup(tp,LOCATION_DECK,0)
if g:GetCount()==0 then return end
local tc=g:GetMaxGroup(Card.GetSequence):GetFirst()
Duel.SendtoHand(tc,1-tp,REASON_COST)
end
--AT力场
function c20000055.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMING_END_PHASE)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e2:SetRange(LOCATION_SZONE)
e2:SetCode(EVENT_PRE_DAMAGE_CALCULATE)
e2:SetCondition(c20000055.con2)
e2:SetOperation(c20000055.op2)
c:RegisterEffect(e2)
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e4:SetCode(EVENT_DAMAGE)
e4:SetRange(LOCATION_SZONE)
e4:SetOperation(c20000055.op4)
c:RegisterEffect(e4)
end
--e2
function c20000055.con2(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetBattleDamage(tp)~=0
end
function c20000055.op2(e,tp,eg,ep,ev,re,r,rp,dp)
local dp=Duel.GetTurnPlayer()
if Duel.GetLP(dp)>Duel.GetBattleDamage(tp) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PRE_BATTLE_DAMAGE)
e1:SetOperation(c20000055.opop2)
Duel.RegisterEffect(e1,tp)
Duel.ChangeBattleDamage(tp,0)
end
end
function c20000055.opop2(e,tp,eg,ep,ev,re,r,rp)
Duel.ChangeBattleDamage(tp,0)
end
--e4
function c20000055.op4(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.Destroy(c,REASON_EFFECT)~0 then
Duel.SetLP(tp,Duel.GetLP(1-tp)-4000)
end
end
\ No newline at end of file
--疾速机械剑齿虎
function c20000056.initial_effect(c)
c:SetSPSummonOnce(20000056)
c:EnableCounterPermit(0xfd1)
c:SetCounterLimit(0xfd1,1)
c:EnableReviveLimit()
aux.AddFusionProcFunRep(c,c20000056.ff,2,true)
aux.AddContactFusionProcedure(c,Card.IsAbleToRemoveAsCost,LOCATION_ONFIELD,0,Duel.Remove,POS_FACEUP,REASON_COST)
--e1
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(20000056,0))
e1:SetCategory(CATEGORY_COUNTER)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCountLimit(1)
e1:SetRange(LOCATION_MZONE)
e1:SetCondition(function(e)
return e:GetHandler():GetCounter(0xfd1)==0
end)
e1:SetTarget(function(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_COUNTER,nil,1,0,0xfd1)
end)
e1:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
c:AddCounter(0xfd1,1)
end
end)
c:RegisterEffect(e1)
--e2
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(20000056,1))
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE)
e2:SetCost(function(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsCanRemoveCounter(tp,0xfd1,1,REASON_COST) end
e:GetHandler():RemoveCounter(tp,0xfd1,1,REASON_COST)
end)
e2:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e1:SetTargetRange(LOCATION_MZONE,0)
e1:SetRange(LOCATION_MZONE)
e1:SetTarget(function(e,c)
return c:IsRace(RACE_MACHINE) or c:IsAttribute(ATTRIBUTE_FIRE)
end)
e1:SetValue(1)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end)
c:RegisterEffect(e2)
--e3
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetRange(LOCATION_MZONE)
e3:SetTargetRange(LOCATION_MZONE,0)
e3:SetCode(EFFECT_UPDATE_ATTACK)
e3:SetCondition(function(e)
return e:GetHandler():GetCounter(0xfd1)>0
end)
e3:SetTarget(function(e,c)
local seq=c:GetSequence()
return c:IsType(TYPE_MONSTER) and c:IsAttribute(ATTRIBUTE_FIRE)
and seq<5 and ((e:GetHandler():GetSequence()-seq)==1 or (e:GetHandler():GetSequence()-seq)==0)
end)
e3:SetValue(c:GetAttack()/2)
c:RegisterEffect(e3)
end
function c20000056.ff(c)
return c:IsRace(RACE_MACHINE) or c:IsAttribute(ATTRIBUTE_FIRE)
end
\ No newline at end of file
--七夕の花嫁骑士
function c20000057.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TODECK+CATEGORY_DRAW)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_TO_HAND)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,20000057)
e1:SetCondition(function(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase()~=PHASE_DRAW
end)
e1:SetCost(function(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsDiscardable() end
Duel.SendtoGrave(c,REASON_COST+REASON_DISCARD)
end)
e1:SetTarget(function(e,tp,eg,ep,ev,re,r,rp,chk)
local g=eg:Filter(c20000057.tgf1,nil,tp)
if chk==0 then return g:GetCount()>0 end
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,g:GetCount(),0,0)
end)
e1:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
local g=eg:Filter(c20000057.tgf1,nil,tp)
if g:GetCount()>0 and Duel.SendtoDeck(g,nil,2,REASON_EFFECT)>=2 then
Duel.Draw(1-tp,1,REASON_EFFECT)
end
end)
c:RegisterEffect(e1)
end
function c20000057.tgf1(c,tp)
return c:IsControler(1-tp) and c:IsPreviousLocation(LOCATION_DECK)
end
\ No newline at end of file
--带恶人
function c20000058.initial_effect(c)
c:SetSPSummonOnce(20000058)
c:EnableReviveLimit()
aux.AddLinkProcedure(c,nil,1)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCondition(function(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_LINK)
end)
e1:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
--[[local g=Duel.GetMatchingGroup(nil,tp,0,LOCATION_DECK,nil)
local opt=0
if g:GetCount()==1 or g:GetCount()==0 then
opt=Duel.SelectOption(1-tp,aux.Stringid(20000058,1))+1
else
opt=Duel.SelectOption(1-tp,aux.Stringid(20000058,0),aux.Stringid(20000058,1))
end
if opt==1 then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EFFECT_SKIP_TURN)
e1:SetTargetRange(1,0)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
else]]
Duel.Draw(1-tp,2,REASON_EFFECT)
--end
Duel.BreakEffect()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CHANGE_DAMAGE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(0,1)
e1:SetValue(0)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end)
c:RegisterEffect(e1)
end
\ No newline at end of file
--彩绘轮转窗
function c20000059.initial_effect(c)
c:EnableCounterPermit(0xfd2)
c:EnableCounterPermit(0xfd3)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e2:SetCode(EVENT_CHAIN_SOLVING)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetRange(LOCATION_FZONE)
e2:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
local c=re:GetHandler()
if c~=e:GetHandler() and ep==tp then
e:GetHandler():AddCounter(0xfd2,1)
end
end)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
local c=re:GetHandler()
if c~=e:GetHandler() and ep~=tp then
e:GetHandler():AddCounter(0xfd3,1)
end
end)
c:RegisterEffect(e3)
local e4=Effect.CreateEffect(c)
e4:SetCategory(CATEGORY_DRAW)
e4:SetType(EFFECT_TYPE_IGNITION)
e4:SetRange(LOCATION_FZONE)
e4:SetProperty(EFFECT_FLAG_BOTH_SIDE+EFFECT_FLAG_PLAYER_TARGET)
e4:SetCountLimit(1,EFFECT_COUNT_CODE_SINGLE)
e4:SetCost(function(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsCanRemoveCounter(tp,0xfd2,1,REASON_COST) and e:GetHandler():IsCanRemoveCounter(tp,0xfd3,1,REASON_COST) end
e:GetHandler():RemoveCounter(tp,0xfd2,1,REASON_COST)
e:GetHandler():RemoveCounter(tp,0xfd3,1,REASON_COST)
end)
e4:SetTarget(function(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDraw(tp,1) end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(1)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
Duel.SetChainLimit(aux.FALSE)
end)
e4:SetOperation(function(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)
end)
c:RegisterEffect(e4)
end
--夹心猫
function c20000060.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH+CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(function(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c20000060.tgf1,tp,0,LOCATION_DECK,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,0,tp,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end)
e1:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_OPERATECARD)
local b1=Duel.SelectMatchingCard(tp,c20000060.tgf1,tp,LOCATION_DECK,0,1,1,nil,e,tp)
local op=1
if b1:GetCount()>0 then
local code=b1:GetFirst():GetOriginalCode()
Duel.Hint(HINT_CARD,1-tp,code)
Duel.Hint(HINT_CARD,1-tp,code)
Duel.Hint(HINT_CARD,1-tp,code)
Duel.Hint(HINT_CARD,1-tp,code)
Duel.Hint(HINT_CARD,1-tp,code)
Duel.Hint(HINT_CARD,1-tp,code)
Duel.Hint(HINT_CARD,1-tp,code)
Duel.Hint(HINT_CARD,1-tp,code)
Duel.Hint(HINT_CARD,1-tp,code)
Duel.Hint(HINT_CARD,1-tp,code)
end
if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then
op=Duel.SelectOption(1-tp,aux.Stringid(20000060,1),aux.Stringid(20000060,2))
else
op=Duel.SelectOption(1-tp,aux.Stringid(20000060,2))+1
end
if op==0 then
Duel.SpecialSummon(b1,0,tp,tp,false,false,POS_FACEUP)
else
Duel.SendtoHand(b1,tp,REASON_EFFECT)
end
end)
c:RegisterEffect(e1)
end
function c20000060.tgf1(c,e,tp)
return c:IsLevel(1) and c:IsRace(RACE_BEAST) and (c:IsAbleToHand() or c:IsCanBeSpecialSummoned(e,0,tp,false,false))
end
\ No newline at end of file
--溶解之恋
function c20000061.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_HANDES)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(function(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroupCount(tp,LOCATION_HAND,0)>2
and Duel.GetMatchingGroup(nil,tp,0,LOCATION_HAND,nil)~=0 end
Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,1,1-tp,0)
end)
e1:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
local hg=Duel.GetMatchingGroup(Card.IsAbleToDeck,tp,0,LOCATION_HAND,nil)
local b1=Duel.IsExistingMatchingCard(Card.IsAbleToDeck,tp,0,LOCATION_HAND,1,nil)
if Duel.DiscardHand(tp,nil,3,3,REASON_EFFECT+REASON_DISCARD)==3 and b1 then
sg=hg:RandomSelect(tp,1)
end
Duel.SendtoDeck(sg,nil,2,REASON_EFFECT)
end)
c:RegisterEffect(e1)
end
--柴刀的爱
function c20000062.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_ATKCHANGE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_BATTLE_DESTROYED)
e1:SetCondition(function(e,tp,eg,ep,ev,re,r,rp)
local tc=eg:Filter(c20000062.cfilter,nil,tp):GetFirst()
if not tc then return false end
return true
end)
e1:SetOperation(function(e,tp,eg,ep,ev,re,r,rp,chk)
local a=Duel.GetAttacker()
local d=Duel.GetAttackTarget()
if a:IsRelateToBattle() or d:IsRelateToBattle() then
if a:GetControler()==tp then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK_FINAL)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
e1:SetValue(a:GetAttack()*2)
a:RegisterEffect(e1)
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_EXTRA_ATTACK)
e2:SetValue(1)
e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
a:RegisterEffect(e2)
local e3=Effect.CreateEffect(e:GetHandler())
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EVENT_PHASE+PHASE_BATTLE)
e3:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e3:SetCountLimit(1)
e3:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
Duel.SendtoGrave(a,REASON_EFFECT)
end)
Duel.RegisterEffect(e3,tp)
else
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK_FINAL)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
e1:SetValue(d:GetAttack()*2)
d:RegisterEffect(e1)
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_EXTRA_ATTACK)
e2:SetValue(1)
e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
d:RegisterEffect(e2)
local e3=Effect.CreateEffect(e:GetHandler())
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EVENT_PHASE+PHASE_BATTLE)
e3:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e3:SetCountLimit(1)
e3:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
Duel.SendtoGrave(d,REASON_EFFECT)
end)
Duel.RegisterEffect(e3,tp)
end
end
end)
c:RegisterEffect(e1)
end
function c20000062.cfilter(c,tp)
return c:IsPreviousControler(1-tp)
end
\ No newline at end of file
--暗藏于心的恋意
function c20000063.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_ATKCHANGE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(TIMING_DAMAGE_STEP)
e1:SetCondition(function(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
local tg=g:GetMaxGroup(Card.GetAttack)
if g:GetCount()==0 then return false end
return Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)==1 and tg:IsExists(Card.IsControler,1,nil,1-tp) and aux.dscon
end)
e1:SetTarget(function(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) end
if chk==0 then return Duel.IsExistingTarget(nil,tp,LOCATION_MZONE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local g=Duel.SelectTarget(tp,nil,tp,LOCATION_MZONE,0,1,1,nil,e,tp)
end)
e1:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsFaceup() then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK_FINAL)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
e1:SetValue(tc:GetAttack()*3)
tc:RegisterEffect(e1)
local e3=Effect.CreateEffect(e:GetHandler())
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EVENT_BATTLE_DAMAGE)
e3:SetCondition(function(e,tp,eg,ep,ev,re,r,rp)
return ep~=tp and Duel.GetLP(1-tp)~=0
end)
e3:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
Duel.SetLP(tp,0)
end)
Duel.RegisterEffect(e3,tp)
end
end)
c:RegisterEffect(e1)
end
--诀别
function c20000064.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_RECOVER+CATEGORY_DRAW)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_BATTLE_DESTROYED)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCondition(function(e,tp,eg,ep,ev,re,r,rp)
local tc=eg:Filter(c20000064.cfilter,nil,tp):GetFirst()
if not tc then return false end
return true
end)
e1:SetCost(function(e,tp,eg,ep,ev,re,r,rp,chk)
local tc=eg:Filter(function(c)
return c:IsPreviousLocation(LOCATION_MZONE) and c:GetPreviousControler()==tp and c:IsLocation(LOCATION_GRAVE) and (c:IsReason(REASON_BATTLE) or rp==1-tp) and c:IsAbleToRemoveAsCost()
end,nil):GetFirst()
if chk==0 then return tc end
Duel.Remove(tc,POS_FACEUP,REASON_COST)
end)
e1:SetTarget(function(e,tp,eg,ep,ev,re,r,rp,chk,atk)
if chk==0 then return Duel.IsPlayerCanDraw(tp,1) end
local c=Duel.GetAttacker()
local atk=c:GetAttack()
if atk<0 then atk=0 end
e:SetLabel(atk)
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(atk)
Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,atk)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end)
e1:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
if Duel.Recover(p,d,REASON_EFFECT)~=0 then
Duel.Draw(tp,1,REASON_EFFECT)
end
end)
c:RegisterEffect(e1)
end
function c20000064.cfilter(c,tp)
return c:IsPreviousControler(tp)
end
\ No newline at end of file
--打完仗就回老家结婚
function c20000065.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_COUNTER)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCondition(function(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
if g:GetCount()==0 then return false end
return true
end)
e1:SetTarget(function(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
Duel.SetOperationInfo(0,CATEGORY_COUNTER,g,1,0,0)
end)
e1:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_COUNTER)
local g=Duel.SelectMatchingCard(tp,Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
local c=g:GetFirst()
if c:IsFaceup() then
c:AddCounter(0x1fd1,1)
c:AddCounter(0x1fd2,1)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_BATTLE_DESTROYING)
e1:SetCondition(function(e)
return e:GetHandler():GetCounter(0x1fd2)>0
end)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
e1:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
c:AddCounter(0x1fd1,1)
end)
c:RegisterEffect(e1)
end
end)
c:RegisterEffect(e1)
--e2
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_ADJUST)
e2:SetRange(LOCATION_SZONE)
e2:SetCondition(function(e,c)
return Duel.IsExistingMatchingCard(c20000065.count,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil)
end)
e2:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
Duel.SetLP(1-tp,0)
end)
c:RegisterEffect(e2)
--e3
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EVENT_LEAVE_FIELD)
e3:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
Duel.SetLP(tp,Duel.GetLP(tp)-3000)
end)
c:RegisterEffect(e3)
end
function c20000065.count(c)
return c:IsFaceup() and c:GetCounter(0x1fd1)>=20
end
\ No newline at end of file
--渡鸦的墓座
local m=20000066
local cm=_G["c"..m]
function cm.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOKEN+CATEGORY_TODECK)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_MAIN_END)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,m)
e1:SetCondition(function(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFlagEffect(1-tp,m)>=5 and (Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2)
end)
e1:SetTarget(function(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(Card.IsType,tp,LOCATION_ONFIELD+LOCATION_GRAVE,LOCATION_ONFIELD+LOCATION_GRAVE,nil,TYPE_SPELL+TYPE_TRAP)
if chk==0 then return g:GetCount()>0 and Duel.GetMZoneCount(tp,g)>0 and Duel.GetMZoneCount(1-tp,g,tp)>0
and Duel.IsPlayerCanSendtoDeck(tp) and Duel.IsPlayerCanSpecialSummonCount(tp,2) and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false)
and Duel.IsPlayerCanSpecialSummonMonster(tp,m+1,0,TYPES_TOKEN_MONSTER,g:GetCount()*700,g:GetCount()*700,11,RACE_WINDBEAST,ATTRIBUTE_WIND,POS_FACEUP,1-tp) end
Duel.SetOperationInfo(0,CATEGORY_TOKEN,nil,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),2,0,0)
end)
e1:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(Card.IsType,tp,LOCATION_ONFIELD+LOCATION_GRAVE,LOCATION_ONFIELD+LOCATION_GRAVE,nil,TYPE_SPELL+TYPE_TRAP)
if g:GetCount()>0 and Duel.SendtoDeck(g,nil,2,REASON_EFFECT)~=0 then
local og=Duel.GetOperatedGroup()
local c=e:GetHandler()
if c:IsRelateToEffect(e) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)>0 then
if og:GetCount()==0 then return end
local atk=og:GetCount()*700
local def=og:GetCount()*700
if Duel.GetLocationCount(1-tp,LOCATION_MZONE,tp)>0
and Duel.IsPlayerCanSpecialSummonMonster(tp,m+1,0,TYPES_TOKEN_MONSTER,atk,def,11,RACE_ROCK,ATTRIBUTE_LIGHT,POS_FACEUP,1-tp) then
Duel.BreakEffect()
local token=Duel.CreateToken(tp,m+1)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK)
e1:SetValue(atk)
e1:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TOFIELD)
token:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_SET_DEFENSE)
e2:SetValue(def)
e2:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TOFIELD)
token:RegisterEffect(e2)
Duel.SpecialSummon(token,0,tp,1-tp,false,false,POS_FACEUP)
end
end
end
end)
c:RegisterEffect(e1)
if not cm.global_check then
cm.global_check=true
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_CHAINING)
ge1:SetCondition(function(e,tp,eg,ep,ev,re,r,rp)
return re:IsActiveType(TYPE_SPELL+TYPE_TRAP)
end)
ge1:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
local tc=eg:GetFirst()
while tc do
Duel.RegisterFlagEffect(tc:GetSummonPlayer(),m,RESET_PHASE+PHASE_END,0,1)
tc=eg:GetNext()
end
end)
Duel.RegisterEffect(ge1,0)
end
end
\ No newline at end of file
--晨曦
function c20000068.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DRAW)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCondition(function(e,tp,eg,ep,ev,re,r,rp)
local t=Duel.GetFieldGroupCount(tp,0,LOCATION_HAND+LOCATION_ONFIELD)
local s=Duel.GetFieldGroupCount(tp,LOCATION_HAND+LOCATION_ONFIELD,0)
return t>s and not Duel.IsExistingMatchingCard(nil,tp,LOCATION_HAND,0,1,e:GetHandler())
end)
e1:SetTarget(function(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDraw(tp,2) end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(2)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,2)
end)
e1:SetOperation(function(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)
c:RegisterEffect(e1)
end
--诡秘黑核
function c20000069.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DRAW)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(function(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckLPCost(tp,2000) and Duel.IsPlayerCanDraw(tp,2) end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(2)
if Duel.GetLP(1-tp)>1000 then
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,2)
end
end)
e1:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
if Duel.PayLPCost(tp,2000)~=0 and Duel.IsChainDisablable(0) and Duel.CheckLPCost(1-tp,1000)
and Duel.SelectYesNo(1-tp,aux.Stringid(20000069,0)) then
Duel.PayLPCost(1-tp,1000)
Duel.NegateEffect(0)
return
end
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Draw(p,d,REASON_EFFECT)
end)
c:RegisterEffect(e1)
end
--同貌的裁决
function c20000070.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_REMOVE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,20000070)
e1:SetCondition(function(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFieldGroupCount(c:GetControler(),LOCATION_ONFIELD,0)==0
and Duel.GetFieldGroupCount(c:GetControler(),0,LOCATION_ONFIELD)>0
end)
e1:SetTarget(function(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanRemove(tp)
and Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>0
and Duel.GetFieldGroupCount(tp,0,LOCATION_DECK)>0 end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,1-tp,LOCATION_DECK)
end)
e1:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM)
local sg=Duel.SelectMatchingCard(tp,aux.TRUE,tp,LOCATION_DECK,0,1,1,nil)
if sg:GetCount()>0 then
Duel.ConfirmCards(1-tp,sg)
Duel.BreakEffect()
local g=Duel.GetFieldGroup(tp,0,LOCATION_DECK)
Duel.ConfirmCards(tp,g)
local tg=g:Filter(Card.IsCode,nil,sg:GetFirst():GetCode())
if tg:GetCount()>0 then
Duel.Remove(tg,POS_FACEUP,REASON_EFFECT)
end
Duel.ShuffleDeck(tp)
Duel.ShuffleDeck(1-tp)
end
end)
c:RegisterEffect(e1)
end
\ No newline at end of file
--艾爾緹絲 慈愛之核
function c20000117.initial_effect(c)
aux.AddCodeList(c,20000102)
c:EnableReviveLimit()
local e1=Effect.CreateEffect(c)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SPSUMMON_CONDITION)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_CHAINING)
e2:SetRange(LOCATION_MZONE)
e2:SetCondition(function(e,tp,eg,ep,ev,re,r,rp,chk)
return re:IsActiveType(TYPE_EFFECT) and re:GetHandler():IsType(TYPE_RITUAL) and ep~=tp
end)
e2:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
Duel.NegateEffect(ev)
end)
c:RegisterEffect(e2)
local e6=Effect.CreateEffect(c)
e6:SetType(EFFECT_TYPE_FIELD)
e6:SetRange(LOCATION_MZONE)
e6:SetTargetRange(0,0xff)
e6:SetTarget(c20000117.tg2)
e6:SetCode(EFFECT_DISABLE)
c:RegisterEffect(e6)
local e7=e6:Clone(c)
e7:SetCode(EFFECT_DISABLE_EFFECT)
c:RegisterEffect(e7)
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_QUICK_O)
e4:SetCode(EVENT_CHAINING)
e4:SetCountLimit(1,20000117)
e4:SetRange(LOCATION_MZONE)
e4:SetCondition(c20000117.con4)
e4:SetTarget(c20000117.tg4)
e4:SetOperation(c20000117.op4)
c:RegisterEffect(e4)
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_FIELD)
e5:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
e5:SetCode(EFFECT_INDESTRUCTABLE_COUNT)
e5:SetRange(LOCATION_MZONE)
e5:SetTargetRange(LOCATION_ONFIELD,0)
e5:SetValue(c20000117.val5)
c:RegisterEffect(e5)
end
--e2
function c20000117.tg2(e,c)
return c:IsType(TYPE_RITUAL)
end
--e4
function c20000117.con4(e,tp,eg,ep,ev,re,r,rp)
return re:IsActiveType(TYPE_TRAP) and not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED)
end
function c20000117.tg4(e,tp,eg,ep,ev,re,r,rp,chk)
local tc=eg
if chk==0 then return tc end
end
function c20000117.op4(e,tp,eg,ep,ev,re,r,rp)
local rc=re:GetHandler()
if rc:IsRelateToEffect(re) and Duel.Destroy(eg,REASON_EFFECT)~=0 and not rc:IsLocation(LOCATION_HAND+LOCATION_DECK)
and aux.NecroValleyFilter()(rc) then
if Duel.GetLocationCount(tp,LOCATION_SZONE)>0 and rc:IsSSetable() and Duel.SelectYesNo(tp,aux.Stringid(20000117,1)) then
Duel.BreakEffect()
Duel.SSet(tp,rc)
end
end
end
--e5
function c20000117.val5(e,re,r,rp)
if bit.band(r,REASON_BATTLE+REASON_EFFECT)~=0 then
return 1
else return 0 end
end
\ No newline at end of file
--艾爾緹絲 终局之城
function c20000118.initial_effect(c)
aux.AddCodeList(c,20000104)
c:EnableReviveLimit()
local e1=Effect.CreateEffect(c)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SPSUMMON_CONDITION)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetOperation(c20000118.op2)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EVENT_CHAIN_SOLVING)
e3:SetRange(LOCATION_MZONE)
e3:SetTargetRange(0xff,0xff)
e3:SetOperation(c20000118.op3)
c:RegisterEffect(e3)
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e4:SetCode(EVENT_DAMAGE)
e4:SetRange(LOCATION_MZONE)
e4:SetCountLimit(1,20000118)
e4:SetOperation(c20000118.op4)
c:RegisterEffect(e4)
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_FIELD)
e5:SetCode(EFFECT_CANNOT_DIRECT_ATTACK)
e5:SetRange(LOCATION_MZONE)
e5:SetTargetRange(LOCATION_MZONE,0)
e5:SetTarget(c20000118.tg5)
c:RegisterEffect(e5)
local e6=Effect.CreateEffect(c)
e6:SetType(EFFECT_TYPE_SINGLE)
e6:SetProperty(EFFECT_FLAG_SINGLE_RANGE+EFFECT_FLAG_CLIENT_HINT)
e6:SetRange(LOCATION_MZONE)
e6:SetCode(EFFECT_INDESTRUCTABLE_COUNT)
e6:SetCountLimit(3)
e6:SetValue(c20000118.val6)
c:RegisterEffect(e6)
end
--e2
function c20000118.op2(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(aux.TRUE,tp,0,LOCATION_ONFIELD,nil)
Duel.SendtoDeck(g,nil,2,REASON_EFFECT)
end
--e3
function c20000118.op3(e,tp,eg,ep,ev,re,r,rp)
Duel.NegateEffect(ev)
end
--e4
function c20000118.op4(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsFaceup() then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(ev)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
c:RegisterEffect(e1)
end
end
--e5
function c20000118.tg5(e,c)
return c~=e:GetHandler()
end
--e6
function c20000118.val6(e,re,r,rp)
return bit.band(r,REASON_BATTLE)~=0
end
--人工核心智能
function c20000119.initial_effect(c)
aux.AddCodeList(c,20000100)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(20000119,0))
e2:SetCategory(CATEGORY_TOGRAVE+CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetRange(LOCATION_SZONE)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetCountLimit(1,20000119)
e2:SetCost(c20000119.co2)
e2:SetTarget(c20000119.tg2)
e2:SetOperation(c20000119.op2)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(20000119,1))
e3:SetCategory(CATEGORY_TODECK+CATEGORY_DRAW)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetRange(LOCATION_SZONE)
e3:SetCost(c20000119.co3)
e3:SetTarget(c20000119.tg3)
e3:SetOperation(c20000119.op3)
c:RegisterEffect(e3)
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_QUICK_O)
e4:SetCode(EVENT_FREE_CHAIN)
e4:SetRange(LOCATION_GRAVE)
e4:SetCondition(aux.exccon)
e4:SetCost(aux.bfgcost)
e4:SetOperation(c20000119.op4)
c:RegisterEffect(e4)
end
--e2
function c20000119.cof2(c)
return c:IsAbleToGraveAsCost() and c:IsCode(20000100)
end
function c20000119.co2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c20000119.cof2,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c20000119.cof2,tp,LOCATION_MZONE,0,1,1,nil)
Duel.SendtoGrave(g,REASON_COST)
end
function c20000119.tgf2(c,e,tp)
return c:IsSetCard(0x9fd1) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c20000119.tg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c20000119.tgf2,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function c20000119.op2(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c20000119.tgf2,tp,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
end
--e3
function c20000119.co3(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToGraveAsCost() end
Duel.SendtoGrave(e:GetHandler(),REASON_COST)
end
function c20000119.tgf3(c)
return c:IsSetCard(0x9fd1) and c:IsAbleToDeck() and c:IsType(TYPE_MONSTER)
end
function c20000119.tg3(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c20000119.tgf3(chkc) end
if chk==0 then return Duel.IsPlayerCanDraw(tp,1)
and Duel.IsExistingTarget(c20000119.tgf3,tp,LOCATION_GRAVE,0,3,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectTarget(tp,c20000119.tgf3,tp,LOCATION_GRAVE,0,3,3,nil)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,g:GetCount(),0,0)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end
function c20000119.op3(e,tp,eg,ep,ev,re,r,rp)
local tg=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
if not tg or tg:FilterCount(Card.IsRelateToEffect,nil,e)~=3 then return end
Duel.SendtoDeck(tg,nil,0,REASON_EFFECT)
local g=Duel.GetOperatedGroup()
if g:IsExists(Card.IsLocation,1,nil,LOCATION_DECK) then Duel.ShuffleDeck(tp) end
local ct=g:FilterCount(Card.IsLocation,nil,LOCATION_DECK+LOCATION_EXTRA)
if ct==3 then
Duel.BreakEffect()
Duel.Draw(tp,1,REASON_EFFECT)
end
end
--e4
function c20000119.op4(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e1:SetTargetRange(LOCATION_MZONE,0)
e1:SetTarget(c20000119.optg4)
e1:SetValue(aux.tgoval)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
local e2=e1:Clone()
e2:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e2:SetValue(aux.indoval)
Duel.RegisterEffect(e2,tp)
end
function c20000119.optg4(e,c)
return c:IsSetCard(0x6fd1)
end
--艾爾緹絲的選擇
function c20000120.initial_effect(c)
aux.AddCodeList(c,20000100)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(20000120,0))
e2:SetCategory(CATEGORY_TOGRAVE+CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_SZONE)
e2:SetCountLimit(1,20000120)
e2:SetCost(c20000120.co2)
e2:SetTarget(c20000120.tg2)
e2:SetOperation(c20000120.op2)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(20000120,1))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOHAND)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetRange(LOCATION_SZONE)
e3:SetCost(c20000120.co3)
e3:SetTarget(c20000120.tg3)
e3:SetOperation(c20000120.op3)
c:RegisterEffect(e3)
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_QUICK_O)
e4:SetCode(EVENT_FREE_CHAIN)
e4:SetRange(LOCATION_GRAVE)
e4:SetCondition(aux.exccon)
e4:SetCost(aux.bfgcost)
e4:SetOperation(c20000120.op4)
c:RegisterEffect(e4)
end
--e2
function c20000120.cof2(c)
return c:IsAbleToGraveAsCost() and c:IsSetCard(0x9fd1)
end
function c20000120.co2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c20000120.cof2,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c20000120.cof2,tp,LOCATION_MZONE,0,1,1,nil)
Duel.SendtoGrave(g,REASON_COST)
end
function c20000120.tgf2(c,e,tp)
return c:IsSetCard(0x9fd1) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c20000120.tg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c20000120.tgf2,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function c20000120.op2(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c20000120.tgf2,tp,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
end
--e3
function c20000120.co3(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToGraveAsCost() end
Duel.SendtoGrave(e:GetHandler(),REASON_COST)
end
function c20000120.tgf31(c)
return c:IsAbleToHand() and c:IsSetCard(0x6fd1) and c:IsType(TYPE_MONSTER)
end
function c20000120.tgf32(c,e,tp)
return c:IsCanBeSpecialSummoned(e,0,tp,true,false) and c:IsSetCard(0x6fd1) and c:IsType(TYPE_MONSTER)
end
function c20000120.tg3(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) end
if chk==0 then return Duel.IsExistingTarget(c20000120.tgf31,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectTarget(tp,c20000120.tgf31,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0)
end
function c20000120.op3(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.SendtoHand(tc,tp,REASON_EFFECT)>0 and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then
local g=Duel.GetMatchingGroup(c20000120.tgf32,tp,LOCATION_HAND,0,nil,e,tp)
if g:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(20000120,2)) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=Duel.SelectMatchingCard(tp,c20000120.tgf32,tp,LOCATION_HAND,0,1,1,nil,e,tp)
Duel.SpecialSummon(sg,0,tp,tp,true,false,POS_FACEUP)
end
end
end
--e4
function c20000120.op4(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e1:SetTargetRange(LOCATION_MZONE,0)
e1:SetTarget(c20000120.optg4)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetValue(1)
Duel.RegisterEffect(e1,tp)
end
function c20000120.optg4(e,c)
return c:IsSetCard(0x6fd1)
end
\ No newline at end of file
--艾爾緹絲的合奏
function c20000121.initial_effect(c)
aux.AddCodeList(c,20000100)
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DRAW+CATEGORY_TOGRAVE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,20000121)
e1:SetCost(c20000121.co1)
e1:SetTarget(c20000121.tg1)
e1:SetOperation(c20000121.op1)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_GRAVE)
e1:SetCountLimit(1,20000121)
e2:SetCondition(aux.exccon)
e2:SetCost(aux.bfgcost)
e2:SetTarget(c20000121.tg2)
e2:SetOperation(c20000121.op2)
c:RegisterEffect(e2)
end
function c20000121.cof1(c)
return c:IsAbleToGraveAsCost() and c:IsCode(20000100)
end
function c20000121.co1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c20000121.cof1,tp,LOCATION_HAND+LOCATION_ONFIELD,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c20000121.cof1,tp,LOCATION_HAND+LOCATION_ONFIELD,0,1,1,nil)
Duel.SendtoGrave(g,REASON_COST)
end
function c20000121.tg1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDraw(tp,2) end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(2)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,2)
end
function c20000121.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
--e2
function c20000121.tgf21(c,tp)
return c:IsCode(20000102) and c:IsSSetable(true) and Duel.GetLocationCount(tp,LOCATION_SZONE)>0
end
function c20000121.tgf2(c,e,tp)
return c:IsSetCard(0x9fd1) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c20000121.tg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c20000121.tgf21,tp,LOCATION_GRAVE,0,1,nil,tp)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c20000121.tgf2,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,nil,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE)
end
function c20000121.op2(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c20000121.tgf2,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
if g:GetCount()>0 and Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)~=0 then
Duel.BreakEffect()
local g=Duel.GetMatchingGroup(aux.NecroValleyFilter(c20000121.tgf21),tp,LOCATION_GRAVE,0,nil)
if g:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(20000001,2)) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
local g3=Duel.SelectMatchingCard(tp,c20000121.tgf21,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
local sg=g3:GetFirst()
if sg and Duel.GetLocationCount(tp,LOCATION_SZONE)>0 then
Duel.SSet(tp,sg)
Duel.ConfirmCards(1-tp,sg)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
e1:SetCode(EFFECT_QP_ACT_IN_SET_TURN)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
sg:RegisterEffect(e1)
end
end
end
end
end
\ No newline at end of file
--艾爾緹絲的佯攻
local m=20000122
local cm=_G["c"..m]
function cm.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_CHAINING)
e1:SetCondition(function(e,tp,eg,ep,ev,re,r,rp)
return (re:IsActiveType(TYPE_MONSTER) or re:IsHasType(EFFECT_TYPE_ACTIVATE)) and Duel.IsChainNegatable(ev)
end)
e1:SetCost(function(e,tp,eg,ep,ev,re,r,rp,chk)
e:SetLabel(1)
return true
end)
e1:SetTarget(function(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
if e:GetLabel()~=1 then return false end
e:SetLabel(0)
return Duel.CheckReleaseGroupEx(tp,cm.cof1,1,nil,e,tp)
end
Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0)
local rg=Duel.SelectReleaseGroupEx(tp,cm.cof1,1,1,nil,e,tp)
e:SetLabel(rg:GetFirst():GetAttribute())
Duel.Release(rg,REASON_COST)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_EXTRA)
if re:GetHandler():IsDestructable() and re:GetHandler():IsRelateToEffect(re) then
Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,1,0,0)
end
end)
e1:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
Duel.NegateActivation(ev)
if re:GetHandler():IsRelateToEffect(re) then
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tc=Duel.SelectMatchingCard(tp,cm.cof12,tp,LOCATION_HAND+LOCATION_EXTRA,0,1,1,nil,e,tp,e:GetLabel()):GetFirst()
if tc and Duel.SpecialSummon(tc,0,tp,tp,true,false,POS_FACEUP)~=0 then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_TRIGGER)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
tc:RegisterFlagEffect(m,RESET_EVENT+RESETS_STANDARD,0,1)
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_PHASE+PHASE_END)
e2:SetCountLimit(1)
e2:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e2:SetLabelObject(tc)
e2:SetCondition(function(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject()
if tc:GetFlagEffect(m)~=0 then
return true
else
e:Reset()
return false
end
end)
e2:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject()
Duel.Destroy(tc,REASON_EFFECT)
end)
Duel.RegisterEffect(e2,tp)
end
end
end)
c:RegisterEffect(e1)
--e2
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP)
e2:SetCode(EVENT_LEAVE_FIELD)
e2:SetCondition(function(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(cm.cf4,1,nil,tp)
end)
e2:SetRange(LOCATION_GRAVE)
e2:SetCost(aux.bfgcost)
e2:SetTarget(function(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(cm.tf4,tp,LOCATION_GRAVE+LOCATION_HAND,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE+LOCATION_HAND)
end)
e2:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,cm.tf4,tp,LOCATION_GRAVE+LOCATION_HAND,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,true,false,POS_FACEUP_DEFENSE)
end
end)
c:RegisterEffect(e2)
end
--e1
function cm.cof1(c,e,tp)
return c:IsSetCard(0x6fd1) and Duel.GetMZoneCount(tp,c)>0 and (c:IsLevel(8) or c:IsRank(8))
and Duel.IsExistingMatchingCard(cm.cof12,tp,LOCATION_EXTRA+LOCATION_HAND,0,1,nil,e,tp,c:GetAttribute(),c)
end
function cm.cof12(c,e,tp,att,mc)
return c:IsSetCard(0x6fd1) and c:IsCanBeSpecialSummoned(e,0,tp,true,false) and c:GetAttribute()~=att
and Duel.GetLocationCountFromEx(tp,tp,mc,c)>0 and c:IsType(TYPE_MONSTER) and (c:IsLevel(8) or c:IsRank(8))
end
--e2
function cm.cf4(c,tp)
return c:IsPreviousLocation(LOCATION_MZONE) and c:IsPreviousControler(tp)
and c:IsPreviousPosition(POS_FACEUP) and c:IsSetCard(0x6fd1) and (c:IsLevel(8) or c:IsRank(8))
end
function cm.tf4(c,e,tp)
return c:IsSetCard(0x6fd1) and Duel.GetMZoneCount(tp,c)>0
and c:IsCanBeSpecialSummoned(e,0,tp,true,false) and c:IsType(TYPE_MONSTER)
end
\ No newline at end of file
--概念虚械 仁爱
if not pcall(function() require("expansions/script/c20000000") end) then require("script/c20000000") end
local cm,m,o=GetID()
fu_cim = fu_cim or {}
-------------------------------main effect
function fu_cim.XyzUnite(c)
c:EnableReviveLimit()
local e0=fuef.F(c,1165,EFFECT_SPSUMMON_PROC,"OE","E",nil,SUMMON_TYPE_XYZ,nil,fu_cim.XyzProccon,fu_cim.XyzProctg,aux.XyzLevelFreeOperation(),c)
local e1 = fuef.QO(c,{20000150,1},nil,nil,"TG","M",1,nil,fu_cim.RemoveXyz,fu_cim.GM_tg,fu_cim.GM_op,c)
local e2 = fuef.SC(c,nil,EVENT_MOVE,"DE",nil,fu_cim.GF_con,fu_cim.GF_op,c)
return e0,e1,e2
end
function fu_cim.RemoveXyz(e,tp,eg,ep,ev,re,r,rp,chk)
local g=fugf.GetFilter(tp,"M",{Card.IsSetCard,Card.CheckRemoveOverlayCard},{0xcfd1,{tp,1,REASON_COST}})
if chk==0 then return #g>0 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DEATTACHFROM)
g:Select(tp,1,1,nil):GetFirst():RemoveOverlayCard(tp,1,1,REASON_COST)
end
-------------------------------
function fu_cim.XyzProc_cardf(c,xyzc,tp)
if not aux.XyzLevelFreeFilter(c,xyzc) then return false end
return (Duel.GetFlagEffect(tp,20000167)>0 and c:IsControler(1-tp)) or (c:IsControler(tp) and not c:IsType(TYPE_LINK))
end
function fu_cim.XyzProc_groupf(g,xyzc,tp)
if Duel.GetLocationCountFromEx(tp,tp,g,xyzc)==0 or fugf.Filter(g,Card.IsControler,1-tp,nil,2) then return false end
if Duel.GetFlagEffect(tp,20000167)==0 and fugf.Filter(g,Card.IsControler,1-tp,nil,1) then return false end
if xyzc:GetRank()==12 and not (fugf.Filter(g,Card.IsType,TYPE_XYZ,nil,1) or fugf.Filter(g,Card.IsControler,1-tp,nil,1)) then return false end
local sg=fugf.Filter(g,Card.IsControler,tp)
return sg:GetSum(Card.GetRank) + sg:GetSum(Card.GetLevel) + (fugf.Filter(g,Card.IsControler,1-tp,nil,1) and 3 or 0) == xyzc:GetRank()
end
function fu_cim.XyzProccon(e,c,og,min,max)
if c==nil then return true end
local tp=c:GetControler()
local minc=2
local maxc=c:GetRank()==12 and 99 or 2
if min then
minc=math.max(2,min)
maxc=math.min(maxc,max)
end
if maxc<minc then return false end
local mg=fugf.GetFilter(tp,"M+M",fu_cim.XyzProc_cardf,{c,tp})
if og then mg=fugf.Filter(og,fu_cim.XyzProc_cardf,{c,tp}) end
og=Duel.GetMustMaterial(tp,EFFECT_MUST_BE_XMATERIAL)
if fugf.Filter(og,aux.MustMaterialCounterFilter,mg,nil,1) then return false end
Duel.SetSelectedCard(og)
Auxiliary.GCheckAdditional=Auxiliary.TuneMagicianCheckAdditionalX(EFFECT_TUNE_MAGICIAN_X)
local res=mg:CheckSubGroup(fu_cim.XyzProc_groupf,minc,maxc,c,tp)
Auxiliary.GCheckAdditional=nil
return res
end
function fu_cim.XyzProctg(e,tp,eg,ep,ev,re,r,rp,chk,c,og,min,max)
if og and not min then return true end
local minc=2
local maxc=c:GetRank()==12 and 99 or 2
if min then
minc=math.max(2,min)
maxc=math.min(maxc,max)
end
local mg=fugf.GetFilter(tp,"M+M",fu_cim.XyzProc_cardf,{c,tp})
if og then mg=fugf.Filter(og,fu_cim.XyzProc_cardf,{c,tp}) end
Duel.SetSelectedCard(Duel.GetMustMaterial(tp,EFFECT_MUST_BE_XMATERIAL))
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL)
Auxiliary.GCheckAdditional=Auxiliary.TuneMagicianCheckAdditionalX(EFFECT_TUNE_MAGICIAN_X)
mg=mg:SelectSubGroup(tp,fu_cim.XyzProc_groupf,Duel.IsSummonCancelable(),minc,maxc,c,tp)
Auxiliary.GCheckAdditional=nil
if not (mg and #mg>0) then return false end
if fugf.Filter(mg,Card.IsControler,1-tp,nil,1) then
Duel.Hint(HINT_CODE,tp,20000167)
Duel.ResetFlagEffect(tp,20000167)
end
mg:KeepAlive()
e:SetLabelObject(mg)
return true
end
function fu_cim.GM_tgf(c,e)
return c:IsCanOverlay() and c:IsType(TYPE_MONSTER) and c:IsCanBeEffectTarget(e)
end
function fu_cim.GM_tg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and fu_cim.GM_tgf(chkc,e) end
if chk==0 then return e:GetHandler():IsType(TYPE_XYZ) and fugf.GetFilter(tp,"G+G",fu_cim.GM_tgf,e,nil,1) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL)
fugf.SelectTg(tp,"G+G",fu_cim.GM_tgf,e,nil,1)
end
function fu_cim.GM_op(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if not (c:IsRelateToEffect(e) and tc:IsRelateToEffect(e) and not tc:IsImmuneToEffect(e) and c:IsType(TYPE_XYZ)) then return end
Duel.Overlay(c,tc)
end
function fu_cim.GF_con(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsReason(REASON_COST) and re:IsActivated() and re:IsActiveType(TYPE_XYZ) and c:IsPreviousLocation(LOCATION_OVERLAY)
end
function fu_cim.GF_op(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local op=re:GetOperation()
if not c.Add or not op then return end
re:SetOperation(fu_cim.GF_op1(op,c.Add))
end
function fu_cim.GF_op1(ori_op,add_op)
return function(e,tp,eg,ep,ev,re,r,rp)
e:SetOperation(ori_op)
ori_op(e,tp,eg,ep,ev,re,r,rp)
add_op(e,tp,eg,ep,ev,re,r,rp)
end
end
function fu_cim.BM_con(e,tp,eg,ep,ev,re,r,rp)
return r==REASON_XYZ and e:GetHandler():GetReasonCard():IsSetCard(0xcfd1)
end
function fu_cim.BM_op(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local rc=c:GetReasonCard()
if not c.Add then return end
c.Add(c,rc)
if rc:IsType(TYPE_EFFECT) then return end
local e2=fuef.S(e,nil,EFFECT_ADD_TYPE,nil,nil,TYPE_EFFECT,nil,nil,nil,{rc,true},RESET_EVENT+RESETS_STANDARD)
end
-------------------------------
if not cm then return end
function cm.initial_effect(c)
local e = {fu_cim.XyzUnite(c)}
end
function cm.Add(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not (c:IsRelateToEffect(e) and (c:GetAttack()/2)>0 and Duel.SelectYesNo(tp,aux.Stringid(m,0))) then return end
Duel.BreakEffect()
Duel.Hint(HINT_CODE,tp,m)
Duel.Recover(tp,c:GetAttack()/2,REASON_EFFECT)
end
\ No newline at end of file
--概念虚械 骄傲
if not pcall(function() require("expansions/script/c20000150") end) then require("script/c20000150") end
local cm,m,o=GetID()
function cm.initial_effect(c)
local e = {fu_cim.XyzUnite(c)}
end
function cm.Add(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=fugf.GetFilter(tp,"M+M",{Card.IsAttackBelow,Card.IsFaceup},c:GetAttack(),c)
if not (c:IsRelateToEffect(e) and not c:IsFacedown() and #g>0 and Duel.SelectYesNo(tp,aux.Stringid(m,0))) then return end
Duel.BreakEffect()
Duel.Hint(HINT_CODE,tp,m)
Duel.Destroy(g,REASON_EFFECT)
end
\ No newline at end of file
--概念虚械 欺瞒
if not pcall(function() require("expansions/script/c20000150") end) then require("script/c20000150") end
local cm,m,o=GetID()
function cm.initial_effect(c)
local e = {fu_cim.XyzUnite(c)}
end
function cm.Addf(c,e,tp,mc)
return c:IsType(TYPE_XYZ) and c:IsSetCard(0xcfd1) and mc:IsCanBeXyzMaterial(c)
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_XYZ,tp,false,false) and Duel.GetLocationCountFromEx(tp,tp,mc,c)>0
end
function cm.Add(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=fugf.GetFilter(tp,"E",cm.Addf,{e,tp,c})
if aux.MustMaterialCheck(c,tp,EFFECT_MUST_BE_XMATERIAL) and c:IsFaceup() and c:IsRelateToEffect(e) and c:IsControler(tp) and not c:IsImmuneToEffect(e)
and #g>0 and Duel.SelectYesNo(tp,aux.Stringid(m,0)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tc=g:Select(tp,1,1,nil):GetFirst()
if not tc then return end
Duel.BreakEffect()
Duel.Hint(HINT_CODE,tp,m)
g=c:GetOverlayGroup()
if #g~=0 then Duel.Overlay(tc,g) end
tc:SetMaterial(Group.FromCards(c))
Duel.Overlay(tc,Group.FromCards(c))
Duel.SpecialSummon(tc,SUMMON_TYPE_XYZ,tp,tp,false,false,POS_FACEUP)
tc:CompleteProcedure()
end
end
\ No newline at end of file
--概念虚械 愤怒
if not pcall(function() require("expansions/script/c20000150") end) then require("script/c20000150") end
local cm,m,o=GetID()
function cm.initial_effect(c)
local e = {fu_cim.XyzUnite(c)}
end
function cm.Add(e,tp,eg,ep,ev,re,r,rp)
local g=fugf.Get(tp,"MS+MS")
if #g<2 or not Duel.SelectYesNo(tp,aux.Stringid(m,0)) then return end
Duel.BreakEffect()
Duel.Hint(HINT_CODE,tp,m)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
g=g:Select(tp,1,1,e:GetHandler())
Duel.HintSelection(g)
local tc=g:GetFirst()
if Duel.Destroy(tc,REASON_EFFECT)==0 or not tc:IsType(TYPE_MONSTER) then return end
Duel.Damage(1-tp,tc:GetTextAttack()/2,REASON_EFFECT)
end
\ No newline at end of file
--概念虚械 跃升
if not pcall(function() require("expansions/script/c20000150") end) then require("script/c20000150") end
local cm,m,o=GetID()
function cm.initial_effect(c)
local e = {fu_cim.XyzUnite(c)}
end
function cm.Add(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not (c:IsRelateToEffect(e) and c:IsFaceup() and (c:GetAttack()/2)>0 and Duel.SelectYesNo(tp,aux.Stringid(m,0))) then return end
Duel.BreakEffect()
Duel.Hint(HINT_CODE,tp,m)
local atk=c:GetAttack()/2
local e1=fuef.S(c,nil,EFFECT_UPDATE_ATTACK,nil,nil,atk,nil,nil,nil,c,RESET_EVENT+RESETS_STANDARD)
end
\ No newline at end of file
--概念虚械 惊愕
if not pcall(function() require("expansions/script/c20000150") end) then require("script/c20000150") end
local cm,m,o=GetID()
function cm.initial_effect(c)
local e = {fu_cim.XyzUnite(c)}
end
function cm.Add(e,tp,eg,ep,ev,re,r,rp)
local g=fugf.GetFilter(tp,"+M",Card.IsFaceup)
if not (#g>0 and Duel.SelectYesNo(tp,aux.Stringid(m,0))) then return end
Duel.BreakEffect()
Duel.Hint(HINT_CODE,tp,m)
local dg=Group.CreateGroup()
for tc in aux.Next(g) do
local preatk=tc:GetAttack()
local e1=fuef.S(e,nil,EFFECT_UPDATE_ATTACK,nil,nil,-1000,nil,nil,nil,tc,RESET_EVENT+RESETS_STANDARD)
if preatk~=0 and tc:IsAttack(0) then dg:AddCard(tc) end
end
Duel.Destroy(dg,REASON_EFFECT)
end
\ No newline at end of file
--概念虚械 复苏
if not pcall(function() require("expansions/script/c20000150") end) then require("script/c20000150") end
local cm,m,o=GetID()
function cm.initial_effect(c)
local e = {fu_cim.XyzUnite(c)}
end
function cm.Addf(c,e,tp,code)
return c:IsSetCard(0xcfd1) and c:IsType(TYPE_XYZ) and c:IsCanBeSpecialSummoned(e,SUMMON_VALUE_MONSTER_REBORN,tp,false,false)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and not c:IsCode(code)
end
function cm.Add(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=fugf.GetFilter(tp,"G",cm.Addf,{e,tp,c:GetCode()})
if #g==0 or not Duel.SelectYesNo(tp,aux.Stringid(m,0)) then return end
Duel.BreakEffect()
Duel.Hint(HINT_CODE,tp,m)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
g=g:Select(tp,1,1,nil)
Duel.SpecialSummon(g,SUMMON_VALUE_MONSTER_REBORN,tp,tp,false,false,POS_FACEUP)
end
\ No newline at end of file
--概念虚械 辉煌
if not pcall(function() require("expansions/script/c20000150") end) then require("script/c20000150") end
local cm,m,o=GetID()
function cm.initial_effect(c)
local e = {fu_cim.XyzUnite(c)}
end
function cm.Add(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=fugf.GetFilter(tp,"E",{Card.IsSetCard,Card.IsType,Card.IsRankBelow,Card.IsCanOverlay},{0xcfd1,TYPE_XYZ,c:GetRank()})
if not (c:IsRelateToEffect(e) and c:IsFaceup() and c:IsType(TYPE_XYZ) and #g>0 and Duel.SelectYesNo(tp,aux.Stringid(m,0))) then return end
Duel.BreakEffect()
Duel.Hint(HINT_CODE,tp,m)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL)
g=g:Select(tp,1,1,e:GetHandler())
Duel.Overlay(c,g)
end
\ No newline at end of file
--概念虚械 执法
if not pcall(function() require("expansions/script/c20000150") end) then require("script/c20000150") end
local cm,m,o=GetID()
function cm.initial_effect(c)
local e = {fu_cim.XyzUnite(c)}
end
function cm.Add(e,tp,eg,ep,ev,re,r,rp)
local g=fugf.GetFilter(tp,"+MS",aux.NegateAnyFilter)
if #g==0 or not Duel.SelectYesNo(tp,aux.Stringid(m,0)) then return end
Duel.BreakEffect()
Duel.Hint(HINT_CODE,tp,m)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISABLE)
g=g:Select(tp,1,1,nil)
Duel.HintSelection(g)
Duel.NegateRelatedChain(g:GetFirst(),RESET_TURN_SET)
local e1=fuef.S(e,nil,EFFECT_DISABLE,EFFECT_FLAG_CANNOT_DISABLE,nil,nil,nil,nil,nil,g,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
local e2=fuef.S(e,nil,EFFECT_DISABLE_EFFECT,EFFECT_FLAG_CANNOT_DISABLE,nil,RESET_TURN_SET,nil,nil,nil,g,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
end
\ No newline at end of file
--概念虚械 正义
if not pcall(function() require("expansions/script/c20000150") end) then require("script/c20000150") end
local cm,m,o=GetID()
function cm.initial_effect(c)
local e = {fu_cim.XyzUnite(c)}
end
function cm.Add(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not (c:IsRelateToEffect(e) and c:IsFaceup() and Duel.SelectYesNo(tp,aux.Stringid(m,0))) then return end
Duel.BreakEffect()
Duel.Hint(HINT_CODE,tp,m)
local e1=fuef.F(c,nil,EFFECT_CANNOT_ACTIVATE,EFFECT_FLAG_PLAYER_TARGET,"M",{0,1},1,nil,cm.con1,nil,nil,c,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
local e2=fuef.SC(c,{m,0},EVENT_PRE_DAMAGE_CALCULATE,"HINT",nil,cm.con2,cm.op2,c,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
end
function cm.con1(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetAttacker()==e:GetHandler() or Duel.GetAttackTarget()==e:GetHandler()
end
function cm.con2(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetAttackTarget()
end
function cm.op2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetAttackTarget()
if tc==c then tc=Duel.GetAttacker() end
if not (tc:IsRelateToBattle() and tc:IsFaceup() and tc:IsControler(1-tp)) then return end
local val=tc:GetBaseAttack()>tc:GetBaseDefense() and tc:GetBaseDefense() or tc:GetBaseAttack()
local e1=fuef.S(c,nil,EFFECT_SET_ATTACK_FINAL,EFFECT_FLAG_SINGLE_RANGE+EFFECT_FLAG_IGNORE_IMMUNE,"M",val,nil,nil,nil,{tc,1},RESET_PHASE+PHASE_DAMAGE)
local e2=fuef.Clone(e1,{tc,1},"COD",EFFECT_SET_DEFENSE_FINAL)
end
\ No newline at end of file
--概念虚械 保护
if not pcall(function() require("expansions/script/c20000150") end) then require("script/c20000150") end
local cm,m,o=GetID()
function cm.initial_effect(c)
local e = {fu_cim.XyzUnite(c)}
end
function cm.Add(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not (c:IsRelateToEffect(e) and c:IsFaceup() and (c:GetAttack()/2)>0 and Duel.SelectYesNo(tp,aux.Stringid(m,0))) then return end
Duel.BreakEffect()
Duel.Hint(HINT_CODE,tp,m)
local e1=fuef.S(c,nil,EFFECT_INDESTRUCTABLE_BATTLE,nil,"M",1,nil,nil,nil,c,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
local e2=fuef.Clone(e1,c,{"DES",{m,0}},{"COD",EFFECT_INDESTRUCTABLE_EFFECT},{"PRO",EFFECT_FLAG_CLIENT_HINT})
end
\ No newline at end of file
--概念虚械 美德
if not pcall(function() require("expansions/script/c20000150") end) then require("script/c20000150") end
local cm,m,o=GetID()
function cm.initial_effect(c)
local e = {fu_cim.XyzUnite(c)}
end
function cm.Add(e,tp,eg,ep,ev,re,r,rp)
if not Duel.SelectYesNo(tp,aux.Stringid(m,0)) then return end
Duel.BreakEffect()
Duel.Hint(HINT_CODE,tp,m)
local e1=fuef.F(e,nil,EFFECT_CANNOT_INACTIVATE,nil,nil,nil,cm.val1,nil,nil,nil,nil,tp,RESET_PHASE+PHASE_END)
local e2=fuef.Clone(e1,tp,{"COD",EFFECT_CANNOT_DISEFFECT})
end
function cm.val1(e,ct)
local p=e:GetHandler():GetControler()
local te,tp,loc=Duel.GetChainInfo(ct,CHAININFO_TRIGGERING_EFFECT,CHAININFO_TRIGGERING_PLAYER,CHAININFO_TRIGGERING_LOCATION)
return p==tp and te:GetHandler():IsSetCard(0xcfd1) and bit.band(loc,LOCATION_ONFIELD)~=0
end
\ No newline at end of file
--虚构素体 A001
if not pcall(function() require("expansions/script/c20000150") end) then require("script/c20000150") end
local cm,m,o=GetID()
function cm.initial_effect(c)
local e1=fuef.SC(c,nil,EVENT_BE_MATERIAL,EFFECT_FLAG_EVENT_PLAYER,nil,fu_cim.BM_con,fu_cim.BM_op,c)
local e2=fuef.QO(c,"SP","SP",nil,"TG","M",m,nil,nil,cm.tg2,cm.op2,c)
end
--Add
function cm.Add(c,rc)
local e1=fuef.I(c,0,"TG","HINT","M",1,nil,fu_cim.RemoveXyz,cm.Add_tg1,cm.Add_op1,{rc,1},RESET_EVENT+RESETS_STANDARD)
end
function cm.Add_tg1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return fugf.GetFilter(tp,"E",Card.IsAbleToGrave,nil,nil,1) and e:GetHandler():IsRankAbove(4) end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_EXTRA)
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
end
function cm.Add_op1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsFacedown() or not c:IsRelateToEffect(e) or c:IsImmuneToEffect(e) or not c:IsRankAbove(4) then return end
local e1=fuef.S(c,nil,EFFECT_UPDATE_RANK,nil,nil,-3,nil,nil,nil,c,RESET_EVENT+RESETS_STANDARD+RESET_DISABLE)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local tc=fugf.SelectFilter(tp,"E",Card.IsAbleToGrave,nil,nil,1):GetFirst()
if tc then Duel.SendtoGrave(tc,REASON_EFFECT) end
end
--e2
function cm.tgf2(c,e,tp,mc)
local g=Group.FromCards(c,mc)
return c:IsLevel(3) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and aux.MustMaterialCheck(g,tp,EFFECT_MUST_BE_XMATERIAL)
and fugf.GetFilter(tp,"E",{Card.IsSetCard,Card.IsXyzSummonable},{0xcfd1,g},nil,1)
end
function cm.tg2(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local c=e:GetHandler()
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and cm.tgf2(chkc,e,tp,c) end
if chk==0 then return Duel.IsPlayerCanSpecialSummonCount(tp,2) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and fugf.GetFilter(tp,"G",{fucf.TgChk,cm.tgf2},{e,{e,tp,c}},nil,1) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=fugf.SelectTg(tp,"G",{fucf.TgChk,cm.tgf2},{e,{e,tp,c}},nil,1)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,2,tp,LOCATION_EXTRA)
end
function cm.op2(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
local tc=Duel.GetFirstTarget()
if not (tc:IsRelateToEffect(e) and Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP) and e:GetHandler():IsRelateToEffect(e)) then return end
Duel.AdjustAll()
local g=Group.FromCards(e:GetHandler(),tc)
if g:FilterCount(Card.IsLocation,nil,LOCATION_MZONE)<2 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
tc=fugf.SelectFilter(tp,"E",{Card.IsSetCard,Card.IsXyzSummonable},{0xcfd1,g},nil,1):GetFirst()
if not tc then return end
Duel.XyzSummon(tp,tc,g)
end
\ No newline at end of file
--虚构素体 B001
if not pcall(function() require("expansions/script/c20000150") end) then require("script/c20000150") end
local cm,m,o=GetID()
function cm.initial_effect(c)
local e1=fuef.SC(c,nil,EVENT_BE_MATERIAL,EFFECT_FLAG_EVENT_PLAYER,nil,fu_cim.BM_con,fu_cim.BM_op,c)
local e2=fuef.FTO(c,"SP","SP",EVENT_MOVE,"DE","HG",m,cm.con2,nil,cm.tg2,cm.op2,c)
end
--Add
function cm.Add(c,rc)
local e1=fuef.I(c,0,nil,{"TG","HINT"},"M",1,nil,fu_cim.RemoveXyz,cm.Add_tg1,cm.Add_op1,{rc,1},RESET_EVENT+RESETS_STANDARD)
end
function cm.Add_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:IsCanOverlay() and fucf.TgChk(chkc,e) and chkc:IsControler(1-tp) end
if chk==0 then return c:IsType(TYPE_XYZ) and fugf.GetFilter(tp,"+MS",{fucf.TgChk,Card.IsCanOverlay},e,nil,1) and c:IsRankAbove(4) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL)
fugf.SelectTg(tp,"+MS",{fucf.TgChk,Card.IsCanOverlay},e,nil,1)
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
end
function cm.Add_op1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if c:IsFacedown() or not c:IsRelateToEffect(e) or c:IsImmuneToEffect(e) or not c:IsRankAbove(4) then return end
local e1=fuef.S(c,nil,EFFECT_UPDATE_RANK,nil,nil,-3,nil,nil,nil,c,RESET_EVENT+RESETS_STANDARD+RESET_DISABLE)
if not (tc:IsRelateToEffect(e) and not tc:IsImmuneToEffect(e)) then return end
local og=tc:GetOverlayGroup()
if #og>0 then Duel.SendtoGrave(og,REASON_RULE) end
Duel.Overlay(c,Group.FromCards(tc))
end
--e2
function cm.con2(e,tp,eg,ep,ev,re,r,rp)
if not (re and re:IsActivated() and re:IsActiveType(TYPE_XYZ)) then return false end
return fugf.Filter(eg,{Card.IsReason,Card.IsPreviousLocation},{REASON_COST,LOCATION_OVERLAY},nil,1)
end
function cm.tg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function cm.op2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not (c:IsRelateToEffect(e) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)>0) then return end
local g=fugf.Get(tp,"E"):Filter(Card.IsXyzSummonable,nil,nil)
if not (#g>0 and Duel.SelectYesNo(tp,1165)) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
Duel.BreakEffect()
g=g:Select(tp,1,1,nil)
Duel.XyzSummon(tp,g:GetFirst(),nil)
end
\ No newline at end of file
--虚构素体 C001
if not pcall(function() require("expansions/script/c20000150") end) then require("script/c20000150") end
local cm,m,o=GetID()
function cm.initial_effect(c)
local e1=fuef.SC(c,nil,EVENT_BE_MATERIAL,EFFECT_FLAG_EVENT_PLAYER,nil,fu_cim.BM_con,fu_cim.BM_op,c)
local e2=fuef.FTO(c,"SP","SP",EVENT_SPSUMMON_SUCCESS,"DE","HG",m,cm.con2,nil,cm.tg2,cm.op2,c)
end
--Add
function cm.Add(c,rc)
local e1=fuef.I(c,0,CATEGORY_DRAW,"HINT","M",1,nil,fu_cim.RemoveXyz,cm.Add_tg1,cm.Add_op1,{rc,1},RESET_EVENT+RESETS_STANDARD)
end
function cm.Add_tg1(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsType(TYPE_XYZ) and Duel.IsPlayerCanDraw(tp,1) and c:IsRankAbove(4) end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(1)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
end
function cm.Add_op1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsFacedown() or not c:IsRelateToEffect(e) or c:IsImmuneToEffect(e) or not c:IsRankAbove(4) then return end
local e1=fuef.S(c,nil,EFFECT_UPDATE_RANK,nil,nil,-3,nil,nil,nil,c,RESET_EVENT+RESETS_STANDARD+RESET_DISABLE)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Draw(p,d,REASON_EFFECT)
end
--e2
function cm.con2(e,tp,eg,ep,ev,re,r,rp)
return fugf.Filter(eg,{Card.IsControler,Card.IsType,Card.IsFaceup},{tp,TYPE_XYZ},nil,1)
end
function cm.tg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function cm.opf2(c)
return c:IsXyzSummonable(nil)
end
function cm.op2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not (c:IsRelateToEffect(e) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)>0) then return end
local g=fugf.Get(tp,"E"):Filter(Card.IsXyzSummonable,nil,nil)
if not (#g>0 and Duel.SelectYesNo(tp,1165)) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
Duel.BreakEffect()
g=g:Select(tp,1,1,nil)
Duel.XyzSummon(tp,g:GetFirst(),nil)
end
\ No newline at end of file
--虚构素体 D001
if not pcall(function() require("expansions/script/c20000150") end) then require("script/c20000150") end
local cm,m,o=GetID()
function cm.initial_effect(c)
local e1=fuef.SC(c,nil,EVENT_BE_MATERIAL,EFFECT_FLAG_EVENT_PLAYER,nil,fu_cim.BM_con,fu_cim.BM_op,c)
local e2=fuef.I(c,"SP","SP",nil,"G",m,nil,cm.cos2,cm.tg2,cm.op2,c)
end
--Add
function cm.Add(c,rc)
local e1=fuef.I(c,0,"SP","HINT","M",1,nil,fu_cim.RemoveXyz,cm.Add_tg1,cm.Add_op1,{rc,1},RESET_EVENT+RESETS_STANDARD)
end
function cm.Add_tgf1(c,e,tp)
return c:IsLevel(3) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function cm.Add_tg1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsType(TYPE_XYZ) and e:GetHandler():IsRankAbove(4) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and fugf.GetFilter(tp,"HG",cm.Add_tgf1,{e,tp},nil,1) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_GRAVE)
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
end
function cm.Add_op1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsFacedown() or not c:IsRelateToEffect(e) or c:IsImmuneToEffect(e) or not c:IsRankAbove(4) then return end
local e1=fuef.S(c,nil,EFFECT_UPDATE_RANK,nil,nil,-3,nil,nil,nil,c,RESET_EVENT+RESETS_STANDARD+RESET_DISABLE)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=fugf.SelectFilter(tp,"HG",cm.Add_tgf1,{e,tp},nil,1)
if #g==0 then return end
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
--e2
function cm.cos2(e,tp,eg,ep,ev,re,r,rp,chk)
local g=fugf.GetFilter(tp,"E",{Card.IsSetCard,Card.IsType,Card.IsAbleToGraveAsCost},{0xcfd1,TYPE_XYZ})
if chk==0 then return #g>0 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
g=g:Select(tp,1,1,nil)
Duel.SendtoGrave(g,REASON_COST)
end
function cm.tg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function cm.op2(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
Duel.SpecialSummon(e:GetHandler(),0,tp,tp,false,false,POS_FACEUP)
end
--万念合一者
if not pcall(function() require("expansions/script/c20000150") end) then require("script/c20000150") end
local cm,m,o=GetID()
function cm.initial_effect(c)
c:EnableReviveLimit()
local e1=fuef.F(c,1165,EFFECT_SPSUMMON_PROC,"OE","E",nil,SUMMON_TYPE_XYZ,nil,fu_cim.XyzProccon,fu_cim.XyzProctg,aux.XyzLevelFreeOperation(),c)
local e2=fuef.S(c,nil,EFFECT_SPSUMMON_CONDITION,"OE",nil,aux.xyzlimit,nil,nil,nil,c)
local e3=fuef.QO(c,0,nil,nil,nil,"M",m,nil,cm.cos3,cm.tg3,cm.op3,c)
local e4=fuef.QF(c,1,nil,EVENT_MOVE,nil,"M",nil,cm.con4,nil,nil,cm.op4,c)
local e5=fuef.Creat(c,c,{"TYP",EFFECT_TYPE_XMATERIAL},{"COD",EFFECT_IMMUNE_EFFECT},{"CON",cm.con5},{"VAL",cm.val5})
end
--e3
function cm.cos3(e,tp,eg,ep,ev,re,r,rp,chk)
e:SetLabel(100)
if chk==0 then return true end
end
function cm.tg3(e,tp,eg,ep,ev,re,r,rp,chk)
local g=fugf.GetFilter(tp,"M",{Card.IsSetCard,Card.CheckRemoveOverlayCard},{0xcfd1,{tp,1,REASON_COST}})
if chk==0 then
if e:GetLabel()~=100 then return false end
e:SetLabel(0)
return #g>0
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DEATTACHFROM)
local tc=g:Select(tp,1,1,nil):GetFirst()
g=fugf.Get(tp,"MS+MS",Card.IsCanOverlay,nil,e:GetHandler())
local max=#g>tc:GetOverlayCount() and tc:GetOverlayCount() or #g
tc=tc:RemoveOverlayCard(tp,1,max,REASON_COST)
e:SetLabel(tc)
end
function cm.op3(e,tp,eg,ep,ev,re,r,rp)
local count=e:GetLabel()
local c=e:GetHandler()
local g=fugf.Get(tp,"MS+MS",Card.IsCanOverlay,nil,c)
if count>#g or not c:IsRelateToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL)
g=g:Select(tp,count,count,c)
Duel.HintSelection(g)
g=g:Filter(aux.NOT(Card.IsImmuneToEffect),nil,e)
for tc in aux.Next(g) do
local og=tc:GetOverlayGroup()
if #og>0 then Duel.SendtoGrave(og,REASON_RULE) end
end
Duel.Overlay(c,g)
end
--e4
function cm.con4(e,tp,eg,ep,ev,re,r,rp)
if not (re and re:IsActivated() and re:IsActiveType(TYPE_XYZ)) then return false end
return fugf.Filter(eg,{Card.IsReason,Card.IsPreviousLocation},{REASON_COST,LOCATION_OVERLAY},nil,1)
end
function cm.op4(e,tp,eg,ep,ev,re,r,rp)
local count=#fugf.Filter(eg,{Card.IsReason,Card.IsPreviousLocation},{REASON_COST,LOCATION_OVERLAY})
local g=fugf.GetFilter(tp,"G+G",Card.IsCanOverlay)
local c=e:GetHandler()
if c:IsFacedown() or not c:IsRelateToEffect(e) or c:IsImmuneToEffect(e) or not c:IsType(TYPE_XYZ) or count>#g then return end
g=g:Select(tp,count,count,nil)
Duel.Overlay(c,g)
end
--e5
function cm.con5(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSetCard(0xcfd1) and c:IsType(TYPE_XYZ)
end
function cm.val5(e,re,rp)
if e:GetHandlerPlayer()==re:GetHandlerPlayer() then return false end
if not re:IsHasProperty(EFFECT_FLAG_CARD_TARGET) then return true end
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
return not g:IsContains(e:GetHandler())
end
\ No newline at end of file
--一念万物
if not pcall(function() require("expansions/script/c20000150") end) then require("script/c20000150") end
local cm,m,o=GetID()
function cm.initial_effect(c)
local e1=fuef.B_A(c,nil,"SP",nil,"TG",m,nil,cm.cos1,cm.tg1,cm.op1,c)
local e2=fuef.I(c,nil,nil,nil,"G",m,nil,cm.cos2,nil,cm.op2,c)
Duel.AddCustomActivityCounter(m+1,ACTIVITY_SPSUMMON,cm.counterfilter)
end
function cm.counterfilter(c)
return not c:IsSummonLocation(LOCATION_EXTRA) or c:IsType(TYPE_XYZ)
end
--e1
function cm.cosf1(e,c,sump,sumtype,sumpos,targetp,se)
return c:IsLocation(LOCATION_EXTRA) and not c:IsType(TYPE_XYZ)
end
function cm.cos1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetCustomActivityCount(m+1,tp,ACTIVITY_SPSUMMON)==0 end
local e1=fuef.F(e,nil,EFFECT_CANNOT_SPECIAL_SUMMON,EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH,nil,{1,0},nil,nil,nil,cm.cosf1,nil,tp,RESET_PHASE+PHASE_END)
end
function cm.tgf1(c,e,tp)
return c:IsFaceup() and c:IsSetCard(0xcfd1) and c:IsType(TYPE_XYZ) and c:IsCanBeEffectTarget(e)
and c:GetOverlayGroup():Filter(Card.IsSetCard,nil,0xcfd1):IsExists(Card.IsCanBeSpecialSummoned,1,nil,e,0,tp,true,false,POS_FACEUP)
end
function cm.tg1(e,tp,eg,ep,ev,re,r,rp,chk)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) and cm.tgf1(chkc,e,tp) end
if chk==0 then return fugf.GetFilter(tp,"M",cm.tgf1,{e,tp},nil,1) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local c=fugf.SelectTg(tp,"M",cm.tgf1,{e,tp},nil,1):GetFirst()
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_OVERLAY)
end
function cm.op1(e,tp,eg,ep,ev,re,r,rp)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
local c=Duel.GetFirstTarget()
if not c:IsRelateToEffect(e) or ft==0 then return end
if Duel.IsPlayerAffectedByEffect(tp,59822133) then ft=1 end
local g=c:GetOverlayGroup():Filter(Card.IsSetCard,nil,0xcfd1):Filter(Card.IsCanBeSpecialSummoned,nil,e,0,tp,true,false,POS_FACEUP)
ft=ft<#g and ft or #g
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
g=g:Select(tp,ft,ft,nil)
if #g==0 then return end
local fid=e:GetHandler():GetFieldID()
for tc in aux.Next(g) do
Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP)
local e2=fuef.S(e,0,EFFECT_CANNOT_DIRECT_ATTACK,"HINT",nil,nil,nil,nil,nil,tc,RESET_EVENT+RESETS_STANDARD)
tc:RegisterFlagEffect(m,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1,fid)
end
Duel.SpecialSummonComplete()
g:AddCard(c)
g:KeepAlive()
local e1=fuef.FC(e,nil,EVENT_PHASE+PHASE_END,EFFECT_FLAG_IGNORE_IMMUNE,nil,1,cm.op1con1,cm.op1op1,tp,nil,fid,g)
end
function cm.op1conf1(c,fid,chk)
if chk then return not c:GetFlagEffectLabel(m) end
return c:GetFlagEffectLabel(m)==fid
end
function cm.op1con1(e,tp,eg,ep,ev,re,r,rp)
local g=e:GetLabelObject()
if not g:IsExists(cm.op1conf1,1,nil,e:GetLabel()) or not g:IsExists(cm.op1conf1,1,nil,e:GetLabel(),1) then
g:DeleteGroup()
e:Reset()
return false
else return true end
end
function cm.op1op1(e,tp,eg,ep,ev,re,r,rp)
local g=e:GetLabelObject()
local c=g:Filter(cm.op1conf1,nil,e:GetLabel(),1):GetFirst()
g=g:Filter(cm.op1conf1,nil,e:GetLabel())
for tc in aux.Next(g) do
local og=tc:GetOverlayGroup()
if #og>0 then Duel.SendtoGrave(og,REASON_RULE) end
end
Duel.Overlay(c,g)
end
--e2
function cm.cos2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return cm.cos1(e,tp,eg,ep,ev,re,r,rp,0) and aux.bfgcost(e,tp,eg,ep,ev,re,r,rp,0) end
cm.cos1(e,tp,eg,ep,ev,re,r,rp,chk)
aux.bfgcost(e,tp,eg,ep,ev,re,r,rp,chk)
end
function cm.op2(e,tp,eg,ep,ev,re,r,rp)
Duel.RegisterFlagEffect(tp,m,RESET_PHASE+PHASE_END,0,1)
end
\ No newline at end of file
--忍之箴言
local cm,m,o=GetID()
if not pcall(function() require("expansions/script/c20000000") end) then require("script/c20000000") end
fu_HC = fu_HC or {}
function fu_HC.glo(c)
aux.AddCodeList(c,20000175)
if fu_HC.chk then return end
fu_HC.chk = 0
local ge1 = fuef.FC(c,1,"",EVENT_CHAINING,",,",fu_HC.glo_con1,fu_HC.glo_op1(1))
local ge2 = fuef.Clone(ge1,1,{"COD","NEGA"},{"OP",fu_HC.glo_op1(-1)})
local ge3 = fuef.FC(c,1,"",EVENT_PHASE_START+PHASE_DRAW,",,,",fu_HC.glo_op1())
end
function fu_HC.IsAct()
return fu_HC.chk > 0
end
function fu_HC.glo_con1(e,tp,eg,ep,ev,re,r,rp)
return re:GetHandler():IsCode(20000175)
end
function fu_HC.glo_op1(n)
return function()
fu_HC.chk = n and fu_HC.chk + n or 0
end
end
if not cm then return end
--------------------------------------------------------
function cm.initial_effect(c)
local e1=fuef.B_A(c,c,",SH",EVENT_ATTACK_ANNOUNCE,",",cm.con1,cm.cos1,cm.tg1,cm.op1)
local e2=fuef.S(c,c,"",EFFECT_TRAP_ACT_IN_SET_TURN,"SET,,,",cm.con2)
end
--e1
function cm.con1(e,tp,eg,ep,ev,re,r,rp)
local g=e:GetHandler():GetColumnGroup()
if Duel.IsPlayerAffectedByEffect(tp,20000181) then
for tc in aux.Next(fugf.GetFilter(tp,"MS","IsPos+IsSet","FU,5fd1")) do
g=g+tc:GetColumnGroup()
end
end
return Duel.GetAttackTarget() and g:IsContains(Duel.GetAttackTarget()) or g:IsContains(Duel.GetAttacker())
end
function cm.cos1(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Group.FromCards(Duel.GetAttacker())
if Duel.IsPlayerAffectedByEffect(tp,20000182) and Duel.GetAttackTarget() and Duel.GetAttackTarget():IsControler(1-tp) then
g=g+Duel.GetAttackTarget()
end
if chk==0 then return fugf.Filter(g,"AbleTo","*R",1) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
if #g~=1 then g=g:Select(tp,1,1,nil) end
Duel.Remove(g,POS_FACEUP,REASON_COST)
end
function cm.tg1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return fugf.GetFilter(tp,"D","AbleTo+IsSet","H,5fd1",1) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function cm.op1(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=fugf.SelectFilter(tp,"D","AbleTo+IsSet","H,5fd1")
if #g>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
local c=e:GetHandler()
if not (c:IsRelateToEffect(e) and c:IsCanTurnSet()) then return end
Duel.BreakEffect()
c:CancelToGrave()
Duel.ChangePosition(c,POS_FACEDOWN)
Duel.RaiseEvent(c,EVENT_SSET,e,REASON_EFFECT,tp,tp,0)
end
--e2
function cm.con2(e)
return Duel.IsPlayerAffectedByEffect(e:GetHandlerPlayer(),20000180)
end
\ No newline at end of file
--忍瞬之圣沌 千手
local cm,m,o=GetID()
if not pcall(function() require("expansions/script/c20000175") end) then require("script/c20000175") end
function cm.initial_effect(c)
fu_HC.glo(c)
local e1 = fuef.B_A(c,c,",SP,,,,,",cm.tg1,cm.op1)
end
--e1
function cm.tg1(e,tp,eg,ep,ev,re,r,rp,chk)
local b = fu_HC.IsAct() and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
if chk==0 then return fugf.GetFilter(tp,"D","IsCod/IsSet+(IsTyp+IsSSetable)/(CanSp+%)",{b,"20000175,5fd1,S/T,",{e,0,tp}},1) end
end
function cm.op1(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_OPERATECARD)
local b = fu_HC.IsAct() and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
local g=fugf.SelectFilter(tp,"D","IsCod/IsSet+(IsTyp+IsSSetable)/(CanSp+%)",{b,"20000175,5fd1,S/T,",{e,0,tp}})
if #g==0 then return end
if fucf.IsTyp(g:GetFirst(),"S/T") then
Duel.SSet(tp,g)
else
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
\ No newline at end of file
--忍警之圣沌 鸣子
local cm,m,o=GetID()
if not pcall(function() require("expansions/script/c20000175") end) then require("script/c20000175") end
function cm.initial_effect(c)
fu_HC.glo(c)
local e1 = fuef.B_A(c,c,",,,,,,",cm.tg1,cm.op1)
end
--e1
function cm.tg1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return #fugf.Get(tp,"D")>2 end
end
function cm.op1(e,tp,eg,ep,ev,re,r,rp)
if #fugf.Get(tp,"D")<3 then return end
Duel.ConfirmDecktop(tp,3)
local g=fugf.Filter(Duel.GetDecktopGroup(tp,3),"IsTyp+IsSSetable","T")
if #g>0 and Duel.SelectYesNo(tp,1153) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
g=g:Select(tp,1,1,nil)
if Duel.SSet(tp,g)>0 and fu_HC.IsAct() 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)
g:GetFirst():RegisterEffect(e1)
end
end
Duel.ShuffleDeck(tp)
end
\ No newline at end of file
--忍缚之圣沌 圆月
local cm,m,o=GetID()
if not pcall(function() require("expansions/script/c20000175") end) then require("script/c20000175") end
function cm.initial_effect(c)
fu_HC.glo(c)
local e1 = fuef.B_A(c,c,",NEGE,,TG,,,",cm.tg1,cm.op1)
end
--e1
function cm.tg1(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return fucf.Filter("IsLoc+IsControler+TgChk+NegateMonsterFilter","M",tp,e) end
if chk==0 then return fugf.GetFilter(tp,"+M","TgChk+NegateMonsterFilter",e,1) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISABLE)
fugf.SelectTg(tp,"+M","TgChk+NegateMonsterFilter",e)
end
function cm.op1(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsFaceup() and tc:IsRelateToEffect(e) and tc:IsCanBeDisabledByEffect(e) then
Duel.NegateRelatedChain(tc,RESET_TURN_SET)
local e1=fuef.S(e,tc,"",EFFECT_DISABLE,",,,,,",RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
local e2=fuef.Clone(e1,tc,{"COD",EFFECT_DISABLE_EFFECT},{"VAL",RESET_TURN_SET})
local e3=fuef.Clone(e1,tc,{"COD",EFFECT_MUST_ATTACK})
local g=fugf.GetFilter(tp,"+S","IsPos","FD")
if fu_HC.IsAct() and #g>0 then
local e4=fuef.S(e,g,0,EFFECT_CANNOT_TRIGGER,"HINT,,,,,",{RESET_EVENT+0x17a0000+RESET_PHASE+PHASE_END,2})
end
end
end
\ No newline at end of file
--忍防之圣沌 八方
local cm,m,o=GetID()
if not pcall(function() require("expansions/script/c20000175") end) then require("script/c20000175") end
function cm.initial_effect(c)
fu_HC.glo(c)
local e1 = fuef.B_A(c,c,",,,,,,",cm.tg1,cm.op1)
end
--e1
function cm.tg1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return fugf.GetFilter(tp,"MS","IsTyp","S/T",1) end
end
function cm.op1(e,tp,eg,ep,ev,re,r,rp)
local g=fugf.GetFilter(tp,"MS","IsTyp","S/T")
local e1=fuef.S(e,{g,1},"",EFFECT_CANNOT_BE_EFFECT_TARGET,"SET,",aux.tgoval,",,",{RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,2})
local e2=fuef.Clone(e1,fugf.Filter(g,"~IsImmuneToEffect",e),{"COD",EFFECT_INDESTRUCTABLE_EFFECT},{"VAL",aux.indoval})
g=fugf.GetFilter(tp,"M","IsTyp+IsSet+IsPos","M,5fd1,FU")
if not fu_HC.IsAct() or #g==0 then return end
local e3=fuef.S(e,{g,1},"",EFFECT_CANNOT_BE_EFFECT_TARGET,",",aux.tgoval,",,",{RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,2})
local e4=fuef.Clone(e3,fugf.Filter(g,"~IsImmuneToEffect",e),{"COD",EFFECT_INDESTRUCTABLE_EFFECT},{"VAL",aux.indoval})
end
\ No newline at end of file
--圣沌忍者 曼怛罗
local cm,m,o=GetID()
if not pcall(function() require("expansions/script/c20000175") end) then require("script/c20000175") end
function cm.initial_effect(c)
fu_HC.glo(c)
local e1=fuef.FTO(c,c,"SP,SP",EVENT_CHAINING,"DE,H",m,cm.con1,"",cm.tg1,cm.op1)
local e2=fuef.F(c,c,"",m,"PTG,M,1+0")
end
--e1
function cm.con1(e,tp,eg,ep,ev,re,r,rp)
return re:IsHasType(EFFECT_TYPE_ACTIVATE) and re:IsActiveType(TYPE_TRAP)
end
function cm.tg1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and fucf.CanSp(e:GetHandler(),e,0,tp,false,false,POS_FACEUP_DEFENSE)
and fugf.GetFilter(tp,"D","IsCod/(IsSet+IsTyp+%)+IsSSetable",{fu_HC.IsAct,"20000175,5fd1,S/T"},1) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function cm.op1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) or Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP_DEFENSE)==0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
local g=fugf.SelectFilter(tp,"D","IsCod/(IsSet+IsTyp+%)+IsSSetable",{fu_HC.IsAct,"20000175,5fd1,S/T"})
if #g==0 then return end
Duel.SSet(tp,g)
end
\ No newline at end of file
--圣沌大忍者 空即是色
local cm,m,o=GetID()
if not pcall(function() require("expansions/script/c20000175") end) then require("script/c20000175") end
function cm.initial_effect(c)
fu_HC.glo(c)
local e1=fuef.FTF(c,c,1113,"ATK",EVENT_CHAINING,"DAM+CAL,M,",cm.con1,",",cm.op1)
local e2=fuef.F(c,c,"",m,"PTG,M,1+0")
end
--e1
function cm.con1(e,tp,eg,ep,ev,re,r,rp)
return re:IsHasType(EFFECT_TYPE_ACTIVATE) and re:GetHandler():IsCode(20000175)
end
function cm.op1(e,tp,eg,ep,ev,re,r,rp)
local g=fugf.GetFilter(tp,"M","IsTyp+IsSet+IsPos-IsImmuneToEffect",{"M,5fd1,FU",e})
if #g==0 then return end
local e1=fuef.S(e,g,"",EFFECT_UPDATE_ATTACK,",",200,",,",RESET_EVENT+RESETS_STANDARD)
end
\ No newline at end of file
--圣沌大忍者 波罗羯谛
local cm,m,o=GetID()
if not pcall(function() require("expansions/script/c20000175") end) then require("script/c20000175") end
function cm.initial_effect(c)
fu_HC.glo(c)
local e1=fuef.FTF(c,c,",",EVENT_PHASE+PHASE_BATTLE_START,",M",1,cm.con1,",",cm.op1)
local e2=fuef.F(c,c,"",m,"PTG,M,1+0")
end
--e1
function cm.con1(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==1-tp
end
function cm.op1(e,tp,eg,ep,ev,re,r,rp)
local g=fugf.Get(tp,"+M")
if #g>0 then
Duel.ChangePosition(g,POS_FACEUP_ATTACK)
end
local e1=fuef.F(e,tp,"",EFFECT_MUST_ATTACK,",,+M,,,,,",RESET_PHASE+PHASE_END)
end
\ No newline at end of file
--圣沌忍法 后门
local cm,m,o=GetID()
if not pcall(function() require("expansions/script/c20000175") end) then require("script/c20000175") end
function cm.initial_effect(c)
fu_HC.glo(c)
local e1=fuef.A(c)
local e2=fuef.FC(c,c,"",EVENT_CHAINING,",F,,",cm.op2)
local e3=fuef.FTO(c,c,",SP+GA",EVENT_CHAINING,"DE,F",m,cm.con3,"",cm.tg3,cm.op3)
end
--e2
function cm.op2(e,tp,eg,ep,ev,re,r,rp)
if not (re:GetHandler():GetType()==TYPE_TRAP and re:IsHasType(EFFECT_TYPE_ACTIVATE) and re:IsActiveType(TYPE_TRAP) and ep==tp) then return end
Duel.SetChainLimit(function(e,rp,tp)return tp==rp or not e:IsHasType(EFFECT_TYPE_ACTIVATE)end)
end
--e3
function cm.con3(e,tp,eg,ep,ev,re,r,rp)
return re:IsHasType(EFFECT_TYPE_ACTIVATE) and re:GetHandler():IsCode(20000175)
end
function cm.tg3(e,tp,eg,ep,ev,re,r,rp,chk)
local chk = function() return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 end
if chk==0 then return fugf.GetFilter(tp,"HG","(IsSet+%+CanSp)/(IsTyp+IsSSetable)",{chk,"5fd1,,%,T",{e,0,tp}},1) end
end
function cm.op3(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_OPERATECARD)
local chk = function() return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 end
local g=fugf.SelectFilter(tp,"HG","(IsSet+%+CanSp)/(IsTyp+IsSSetable)+GChk",{chk,"5fd1,,%,T",{e,0,tp}})
if #g==0 then return end
if fucf.IsTyp(g:GetFirst(),"T") then
Duel.SSet(tp,g)
else
Duel.SpecialSummon(g,0,tp,tp,false,false)
end
end
\ No newline at end of file
--红莲战士 莫特
local cm,m,o=GetID()
function cm.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetCost(cm.cos1)
e1:SetTarget(cm.tg1)
e1:SetOperation(cm.op1)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_FUSION_SUMMON)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_EQUIP)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCondition(cm.con2)
e2:SetTarget(cm.tg2)
e2:SetOperation(cm.op2)
c:RegisterEffect(e2)
end
--e1
function cm.cos1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,1,e:GetHandler()) end
Duel.DiscardHand(tp,Card.IsDiscardable,1,1,REASON_COST+REASON_DISCARD)
end
function cm.tg1f1(c)
return c:IsAbleToHand() and c:IsSetCard(0x3fd2)
end
function cm.tg1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.tg1f1,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function cm.op1(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,cm.tg1f1,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
--e2
function cm.con2(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase()&(PHASE_DAMAGE+PHASE_DAMAGE_CAL)==0
end
function cm.tg2f2(c,e,tp,g,tc,f)
if not (c:IsType(TYPE_FUSION) and (not f or f(c)) and c:IsSetCard(0x6fd2) and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false)) then return false end
local min,max=aux.GetMaterialListCount(c)
return g:CheckSubGroup(cm.gchk,min,max,tc,tp,c)
end
function cm.gchk(g,c,tp,fc)
return g:IsContains(c) and Duel.GetLocationCountFromEx(tp,tp,g,fc)>0 and g:IsExists(cm.cchk,1,nil,g,fc.fmatchk,1,Group.CreateGroup())
end
function cm.cchk(c,g,f,i,sg)
if type(f[i])=="number" and not (c:IsCode(f[i]) or (c:IsFusionSetCard(0x5fd2) and aux.IsCodeListed(c,f[i]))) then return false end
if type(f[i])~="number" and not (f[i])(c) then return false end
return #f==i or g:IsExists(cm.cchk,1,sg,g,f,i+1,sg+c)
end
function cm.tg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local g=Duel.GetMatchingGroup(Card.IsCanBeFusionMaterial,tp,LOCATION_ONFIELD,0,nil)
local res=Duel.IsExistingMatchingCard(cm.tg2f2,tp,LOCATION_EXTRA,0,1,nil,e,tp,g,e:GetHandler())
if Duel.IsExistingMatchingCard(cm.tg2f2,tp,LOCATION_EXTRA,0,1,nil,e,tp,g,e:GetHandler()) then return true end
local ce=Duel.GetChainMaterial(tp)
if not ce then return false end
g=ce:GetTarget()(ce,e,tp)
local mf=ce:GetValue()
return Duel.IsExistingMatchingCard(cm.tg2f2,tp,LOCATION_EXTRA,0,1,nil,e,tp,g,e:GetHandler(),mf)
end
Duel.Hint(24,0,aux.Stringid(m,0))
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function cm.op2(e,tp,eg,ep,ev,re,r,rp)
local mg1=Duel.GetMatchingGroup(Card.IsCanBeFusionMaterial,tp,LOCATION_ONFIELD,0,nil):Filter(aux.NOT(Card.IsImmuneToEffect),nil,e)
local sg1=Duel.GetMatchingGroup(cm.tg2f2,tp,LOCATION_EXTRA,0,nil,e,tp,mg1,e:GetHandler())
local mg2=Group.CreateGroup()
local sg2=Group.CreateGroup()
local ce=Duel.GetChainMaterial(tp)
if ce~=nil then
mg2=ce:GetTarget()(ce,e,tp)
local mf=ce:GetValue()
sg2=Duel.GetMatchingGroup(cm.tg2f2,tp,LOCATION_EXTRA,0,nil,e,tp,mg2,e:GetHandler(),mf)
end
if #(sg1+sg2)>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tc=(sg1+sg2):Select(tp,1,1,nil):GetFirst()
local min,max=aux.GetMaterialListCount(tc)
if sg1:IsContains(tc) and (not sg2:IsContains(tc) or not Duel.SelectYesNo(tp,ce:GetDescription())) then
local mat=mg1:SelectSubGroup(tp,cm.gchk,false,min,max,e:GetHandler(),tp,tc)
tc:SetMaterial(mat)
Duel.SendtoGrave(mat,REASON_EFFECT+REASON_MATERIAL+REASON_FUSION)
Duel.BreakEffect()
Duel.SpecialSummon(tc,SUMMON_TYPE_FUSION,tp,tp,false,false,POS_FACEUP)
else
local mat=mg2:SelectSubGroup(tp,cm.gchk,false,min,max,e:GetHandler(),tp,tc)
local fop=ce:GetOperation()
fop(ce,e,tp,tc,mat)
end
tc:CompleteProcedure()
end
end
\ No newline at end of file
--红莲龙律者 莫特
local cm,m,o=GetID()
function cm.initial_effect(c)
c:EnableReviveLimit()
aux.AddFusionProcMix(c,true,true,20000206,aux.FilterBoolFunction(Card.IsFusionSetCard,0x3fd2))
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_ATKCHANGE+CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_ATTACK_ANNOUNCE)
e1:SetCondition(cm.con1)
e1:SetTarget(cm.tg1)
e1:SetOperation(cm.op1)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e2:SetValue(1)
e2:SetCondition(cm.con2)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EFFECT_EXTRA_ATTACK)
c:RegisterEffect(e3)
end
cm.fmatchk={20000206,function(c) return c:IsFusionSetCard(0x3fd2) end}
--e1
function cm.con1(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetAttacker()==e:GetHandler()
end
function cm.tg1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local g=Duel.GetMatchingGroup(Card.IsType,tp,0,LOCATION_ONFIELD,nil,TYPE_SPELL+TYPE_TRAP)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function cm.op1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not (c:IsFaceup() and c:IsRelateToEffect(e)) then return end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(500)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE)
c:RegisterEffect(e1)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local tc=Duel.SelectMatchingCard(tp,Card.IsType,tp,0,LOCATION_ONFIELD,1,1,nil,TYPE_SPELL+TYPE_TRAP):GetFirst()
if tc then Duel.Destroy(tc,REASON_EFFECT) end
end
--e2
function cm.con2(e)
return e:GetHandler():GetEquipCount()>0
end
\ No newline at end of file
--红莲武士 爱菈
local cm,m,o=GetID()
function cm.initial_effect(c)
aux.AddCodeList(c,m)
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_ATTACK_ANNOUNCE)
e1:SetRange(LOCATION_HAND)
e1:SetCondition(cm.con1)
e1:SetTarget(cm.tg1)
e1:SetOperation(cm.op1)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_RELEASE+CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_BE_BATTLE_TARGET)
e2:SetRange(LOCATION_MZONE)
e2:SetCondition(cm.con2)
e2:SetTarget(cm.tg2)
e2:SetOperation(cm.op2(cm.op2ex))
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EVENT_CHAINING)
e3:SetCondition(cm.con3)
e3:SetOperation(cm.op2(cm.op3ex))
c:RegisterEffect(e3)
end
--e1
function cm.con1(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()~=tp
end
function cm.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 cm.op1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not (Duel.NegateAttack() and c:IsRelateToEffect(e)) then return end
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
--e2
function cm.con2(e,tp,eg,ep,ev,re,r,rp)
return eg:IsContains(e:GetHandler())
end
function cm.tg2f(c,e,tp)
return c:IsSetCard(0x6fd2) and c:IsLevel(5) and c:GetType()&0x81==0x81 and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_RITUAL,tp,false,true)
end
function cm.tg2(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsReleasableByEffect() and Duel.IsExistingMatchingCard(cm.tg2f,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function cm.op2(exop)
return function(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tc=Duel.SelectMatchingCard(tp,cm.tg2f,tp,LOCATION_DECK,0,1,1,nil,e,tp):GetFirst()
if not (c:IsRelateToEffect(e) and tc) then return end
tc:SetMaterial(Group.FromCards(c))
Duel.ReleaseRitualMaterial(Group.FromCards(c))
Duel.BreakEffect()
Duel.SpecialSummon(tc,SUMMON_TYPE_RITUAL,tp,tp,false,true,POS_FACEUP)
tc:CompleteProcedure()
exop(e,tp,eg,ep,ev,re,r,rp,c,tc)
end
end
function cm.op2ex(e,tp,eg,ep,ev,re,r,rp,c,tc)
if Duel.GetAttacker():IsImmuneToEffect(e) or not Duel.SelectYesNo(tp,aux.Stringid(m,1)) then return end
Duel.BreakEffect()
Duel.ChangeAttackTarget(tc)
end
--e3
function cm.con3(e,tp,eg,ep,ev,re,r,rp)
if not re:IsHasProperty(EFFECT_FLAG_CARD_TARGET) then return false end
local g=Duel.GetChainInfo(ev,CHAININFO_TARGET_CARDS)
if re:GetHandler():IsSetCard(0x5fd2) then Duel.Hint(24,0,aux.Stringid(m,0)) end
return g and g:IsContains(e:GetHandler())
end
function cm.op3ex(e,tp,eg,ep,ev,re,r,rp,c,tc)
local g=Duel.GetChainInfo(ev,CHAININFO_TARGET_CARDS)
if not (#g==1 and g:GetFirst()==c and Duel.CheckChainTarget(ev,tc) and Duel.SelectYesNo(tp,aux.Stringid(m,2))) then return end
Duel.BreakEffect()
Duel.ChangeTargetCard(ev,Group.FromCards(tc))
end
\ No newline at end of file
--红莲龙律者 爱菈
local cm,m,o=GetID()
function cm.initial_effect(c)
c:EnableReviveLimit()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetRange(LOCATION_MZONE)
e1:SetTargetRange(0,LOCATION_MZONE)
e1:SetCondition(cm.con1)
e1:SetValue(cm.val1)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_POSITION)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_ATTACK_ANNOUNCE)
e2:SetRange(LOCATION_MZONE)
e2:SetCondition(cm.con2)
e2:SetOperation(cm.op2)
c:RegisterEffect(e2)
end
--e1
function cm.con1(e)
return e:GetHandler():IsDefensePos()
end
function cm.val1(e,re,tp)
return re:GetHandler():IsDefensePos()
end
--e2
function cm.con2f(c,tp)
return c:IsControler(tp) and c:IsFaceup() and c:IsAttribute(ATTRIBUTE_FIRE)
end
function cm.con2(e,tp,eg,ep,ev,re,r,rp)
local c=Duel.GetAttacker()
local tc=Duel.GetAttackTarget()
return c and tc and (cm.con2f(c) or cm.con2f(tc))
end
function cm.op2(e,tp,eg,ep,ev,re,r,rp)
Duel.NegateAttack()
end
--荣耀红莲团
local cm,m,o=GetID()
function cm.initial_effect(c)
aux.AddCodeList(c,m)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetRange(LOCATION_FZONE)
e2:SetCountLimit(1)
e2:SetCondition(cm.con2(0x6fd2))
e2:SetCost(cm.cos2)
e2:SetTarget(cm.tg2)
e2:SetOperation(cm.op2)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e3:SetCode(EVENT_SUMMON_SUCCESS)
e3:SetCondition(cm.con2(0x3fd2))
e3:SetTarget(cm.tg3)
e3:SetOperation(cm.op3)
c:RegisterEffect(e3)
end
--e2
function cm.con2f(c,tp,setcode)
return c:IsFaceup() and c:IsSummonPlayer(tp) and c:IsSetCard(setcode)
end
function cm.con2(setcode)
return function(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(cm.con2f,1,nil,tp,setcode)
end
end
function cm.cos2(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 cm.tg2f(c)
return c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsSetCard(0x3fd2) and c:IsSSetable() and not c:IsCode(m)
end
function cm.tg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.tg2f,tp,LOCATION_DECK,0,1,nil) end
end
function cm.op2(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
local tc=Duel.SelectMatchingCard(tp,cm.tg2f,tp,LOCATION_DECK,0,1,1,nil):GetFirst()
if not tc then return end
Duel.SSet(tp,tc)
end
--e3
function cm.tg3f(c)
return c:IsSetCard(0x5fd2) and c:IsAbleToHand()
end
function cm.tg3(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.tg3f,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK+LOCATION_GRAVE)
end
function cm.op3(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local tc=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cm.tg3f),tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil,tp):GetFirst()
if not tc then return end
Duel.SendtoHand(tc,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tc)
end
\ No newline at end of file
--命定的龙心武装
local cm,m,o=GetID()
function cm.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,m+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(cm.tg1)
e1:SetOperation(cm.op1)
c:RegisterEffect(e1)
end
function cm.tg1f1(c,tp)
return Duel.IsExistingMatchingCard(cm.tg1f2,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil,c)
end
function cm.tg1f2(c,tc)
return c:IsSetCard(0x5fd2) and c:IsType(TYPE_EQUIP) and aux.IsCodeListed(tc,c:GetCode()) and c:IsAbleToHand()
end
function cm.tg1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.tg1f1,tp,LOCATION_EXTRA,0,1,nil,tp) end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_EXTRA)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK+LOCATION_GRAVE)
end
function cm.op1(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM)
local tc=Duel.SelectMatchingCard(tp,cm.tg1f1,tp,LOCATION_EXTRA,0,1,1,nil,tp):GetFirst()
if tc then
Duel.ConfirmCards(1-tp,tc)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
tc=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cm.tg1f2),tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil,tc):GetFirst()
if tc then
Duel.BreakEffect()
Duel.SendtoHand(tc,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tc)
end
end
if e:IsHasType(EFFECT_TYPE_ACTIVATE) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_DISEFFECT)
e1:SetTargetRange(LOCATION_ONFIELD,0)
e1:SetValue(cm.op1val1)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
end
function cm.op1val1(e,ct)
local te=Duel.GetChainInfo(ct,CHAININFO_TRIGGERING_EFFECT)
return te:GetHandler():IsSetCard(0x5fd2) or te:GetHandler():GetEquipGroup():IsExists(Card.IsSetCard,1,nil,0x5fd2)
end
\ No newline at end of file
--红莲团奥义 高天阳
local cm,m,o=GetID()
function cm.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_ATKCHANGE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCondition(aux.dscon)
e1:SetTarget(cm.tg1)
e1:SetOperation(cm.op1)
c:RegisterEffect(e1)
end
function cm.tg1f(c)
return c:IsFaceup() and c:IsRace(RACE_WARRIOR)
end
function cm.tg1(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and cm.tg1f(chkc) and chkc:IsControler(tp) end
if chk==0 then return Duel.IsExistingTarget(cm.tg1f,tp,LOCATION_MZONE,0,1,nil)
and Duel.IsExistingMatchingCard(Card.IsFaceup,tp,0,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local g=Duel.SelectTarget(tp,cm.tg1f,tp,LOCATION_MZONE,0,1,1,nil)
end
function cm.op1(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,0,LOCATION_MZONE,nil)
local tc=Duel.GetFirstTarget()
if not (tc:IsRelateToEffect(e) and tc:IsFaceup()) then return end
local atk=tc:GetAttack()
for sc in aux.Next(g) do
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(-atk)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
sc:RegisterEffect(e1)
end
if tc:IsType(TYPE_FUSION) or tc:IsType(TYPE_RITUAL) then
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
e2:SetValue(1)
tc:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
tc:RegisterEffect(e3)
end
if tc:GetEquipCount()>0 then
g=tc:GetEquipGroup()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM)
local sc=Duel.SelectMatchingCard(tp,cm.op1f,tp,LOCATION_EXTRA,0,1,1,nil,g):GetFirst()
if sc then
atk=sc:GetBaseAttack()
Duel.ConfirmCards(1-tp,sc)
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_SET_BASE_ATTACK)
e2:SetValue(atk)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_BATTLE)
tc:RegisterEffect(e2)
end
end
end
function cm.op1f(c,g)
for tc in aux.Next(g) do
if aux.IsCodeListed(tc,c:GetCode()) then return true end
end
return false
end
\ No newline at end of file
--红莲团奥义 月夜见
local cm,m,o=GetID()
function cm.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DRAW+CATEGORY_EQUIP)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_BE_BATTLE_TARGET)
e1:SetCondition(cm.con1)
e1:SetTarget(cm.tg1)
e1:SetOperation(cm.op1)
c:RegisterEffect(e1)
end
--e1
function cm.con1(e,tp,eg,ep,ev,re,r,rp)
local sc=Duel.GetAttackTarget()
return sc and sc:IsControler(tp)
end
function cm.tg1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetTargetCard(Duel.GetAttackTarget())
end
function cm.tg1f1(c,tp)
return Duel.IsExistingMatchingCard(cm.tg1f2,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil,tp,c)
end
function cm.tg1f2(c,tp,tc)
return c:IsSetCard(0x5fd2) and c:IsType(TYPE_EQUIP) and c:CheckEquipTarget(tc)
and c:CheckUniqueOnField(tp) and not c:IsForbidden()and aux.IsCodeListed(tc,c:GetCode())
end
function cm.op1(e,tp,eg,ep,ev,re,r,rp)
if not Duel.NegateAttack() then return end
local sc=Duel.GetFirstTarget()
if not sc:IsRelateToEffect(e) then return end
local atk=Duel.GetAttacker():GetAttack()
if sc:GetEquipCount()==0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM)
local tc=Duel.SelectMatchingCard(tp,cm.tg1f1,tp,LOCATION_EXTRA,0,1,1,nil,tp):GetFirst()
if not tc then return end
Duel.ConfirmCards(1-tp,tc)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
tc=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cm.tg1f2),tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil,tp,tc):GetFirst()
if tc then Duel.Equip(tp,tc,sc) end
else
Duel.Draw(tp,atk//1000,REASON_EFFECT)
end
end
\ No newline at end of file
--龙心武装 银河巨剑
local cm,m,o=GetID()
function cm.initial_effect(c)
aux.AddCodeList(c,20000206)
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetCode(EFFECT_EQUIP_LIMIT)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e0:SetValue(cm.eqf0)
c:RegisterEffect(e0)
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_EQUIP)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_CONTINUOUS_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(cm.tg1)
e1:SetOperation(cm.op1)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_EQUIP)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_BE_MATERIAL)
e2:SetCondition(cm.con2)
e2:SetTarget(cm.tg2)
e2:SetOperation(cm.op2)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_BATTLE_START)
e3:SetRange(LOCATION_SZONE)
e3:SetCondition(cm.con3)
e3:SetTarget(cm.tg3)
e3:SetOperation(cm.op3)
c:RegisterEffect(e3)
end
--e0
function cm.eqf0(e,c)
return c:IsRace(RACE_WARRIOR)
end
--e1
function cm.tgf1(c)
return c:IsRace(RACE_WARRIOR) and c:IsFaceup()
end
function cm.tg1(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and cm.tgf1(chkc) end
if chk==0 then return Duel.IsExistingTarget(cm.tgf1,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
Duel.SelectTarget(tp,cm.tgf1,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_EQUIP,e:GetHandler(),1,0,0)
end
function cm.op1(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if e:GetHandler():IsRelateToEffect(e) and tc:IsRelateToEffect(e) and tc:IsFaceup() then
Duel.Equip(tp,e:GetHandler(),tc)
end
end
--e2
function cm.con2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsPreviousLocation(LOCATION_ONFIELD) and c:IsLocation(LOCATION_GRAVE) and r==REASON_FUSION
end
function cm.tg2(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local rc=c:GetReasonCard()
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0 and cm.tgf1(rc) end
Duel.SetOperationInfo(0,CATEGORY_EQUIP,c,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,c,1,0,0)
end
function cm.op2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local rc=c:GetReasonCard()
if c:IsRelateToEffect(e) and rc:IsFaceup() then
Duel.Equip(tp,c,rc)
end
end
--e3
function cm.con3(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=e:GetHandler():GetEquipTarget()
local fid=c:GetFieldID()+tc:GetFieldID()
if tc:IsRelateToBattle() then
c:RegisterFlagEffect(m,RESET_EVENT+RESETS_STANDARD,0,1,fid)
end
return tc:IsRelateToBattle() and c:GetFlagEffect(m)==2 and c:GetFlagEffectLabel(m)==fid
end
function cm.tgf3(c,e,tp)
return c:IsCode(20000206) and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_XYZ,tp,false,false) and Duel.GetLocationCountFromEx(tp,tp,nil,c)>0
end
function cm.tg3(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.tgf3,tp,LOCATION_EXTRA,0,1,nil,e,tp) and e:GetHandler():IsCanOverlay() end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
if e:GetHandler():GetEquipTarget():IsSetCard(0x6fd2) then
Duel.Hint(24,0,aux.Stringid(m,0))
Duel.Hint(24,0,aux.Stringid(m,1))
end
end
function cm.op3(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tc=Duel.SelectMatchingCard(tp,cm.tgf3,tp,LOCATION_EXTRA,0,1,1,nil,e,tp,c):GetFirst()
if not tc then return end
if Duel.SpecialSummon(tc,SUMMON_TYPE_XYZ,tp,tp,false,false,POS_FACEUP)==0 then return end
tc:CompleteProcedure()
tc:RegisterFlagEffect(m,RESET_EVENT+RESETS_STANDARD,0,1)
if not c:IsRelateToEffect(e) then return end
Duel.Overlay(tc,Group.FromCards(c))
Duel.Hint(24,0,aux.Stringid(m,2))
mg=Duel.GetMatchingGroup(nil,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
if #mg==0 or not Duel.SelectYesNo(tp,1101) then return end
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
mg=mg:Select(tp,1,1,nil)
Duel.HintSelection(mg)
Duel.Destroy(mg,REASON_EFFECT)
end
\ No newline at end of file
--热血星龙 盖金迦
local cm,m,o=GetID()
function cm.initial_effect(c)
aux.AddCodeList(c,20000205)
aux.AddXyzProcedure(c,aux.FilterBoolFunction(Card.IsRace,RACE_DRAGON),8,3)
c:EnableReviveLimit()
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_ATKCHANGE)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCategory(CATEGORY_DESTROY)
e1:SetCode(EVENT_BATTLE_DESTROYING)
e1:SetProperty(EFFECT_FLAG_NO_TURN_RESET)
e1:SetCountLimit(1)
e1:SetCondition(cm.con1)
e1:SetTarget(cm.tg1)
e1:SetOperation(cm.op1)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH+CATEGORY_EQUIP)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_LEAVE_FIELD)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCondition(cm.con2)
e2:SetTarget(cm.tg2)
e2:SetOperation(cm.op2)
c:RegisterEffect(e2)
local ew=Effect.CreateEffect(c)
ew:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
ew:SetCode(EVENT_SPSUMMON_SUCCESS)
ew:SetCondition(cm.conw)
c:RegisterEffect(ew)
end
--e1
function cm.con1(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetFlagEffect(20000205)>0 and aux.bdocon(e,tp,eg,ep,ev,re,r,rp)
end
function cm.tg1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local bc=e:GetHandler():GetBattleTarget()
Duel.SetTargetCard(bc)
end
function cm.op1con(e)
return Duel.GetTurnCount()~=e:GetLabel()
end
function cm.op1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and c:IsFaceup() and c:IsRelateToEffect(e) then
local atk=tc:GetBaseAttack()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(atk)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_BP_TWICE)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetTargetRange(1,0)
if Duel.GetTurnPlayer()==tp and (Duel.GetCurrentPhase()>=PHASE_BATTLE_START and Duel.GetCurrentPhase()<=PHASE_BATTLE) then
e2:SetLabel(Duel.GetTurnCount())
e2:SetCondition(cm.op1con)
e2:SetReset(RESET_PHASE+PHASE_BATTLE+RESET_SELF_TURN,2)
else
e2:SetReset(RESET_PHASE+PHASE_BATTLE+RESET_SELF_TURN,1)
end
Duel.RegisterEffect(e2,tp)
end
end
--e2
function cm.con2(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPreviousLocation(LOCATION_MZONE)
end
function cm.tg2f2(c,ec)
return c:IsFaceup() and ec:CheckEquipTarget(c) and c:IsSetCard(0x6fd2)
end
function cm.tg2f1(c,tp)
if not c:IsCode(20000205) then return false end
return c:IsAbleToHand() or (Duel.IsExistingMatchingCard(cm.tg2f2,tp,LOCATION_MZONE,0,1,nil,c) and Duel.GetLocationCount(tp,LOCATION_SZONE)>0)
end
function cm.tg2(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return Duel.IsExistingMatchingCard(cm.tg2f1,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil,tp) end
end
function cm.op2(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_OPERATECARD)
local tc=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cm.tg2f1),tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil,tp):GetFirst()
if not tc then return end
local g=Duel.GetMatchingGroup(cm.tg2f2,tp,LOCATION_MZONE,0,nil,tc)
local res=#g>0 and Duel.GetLocationCount(tp,LOCATION_SZONE)>0
if c:IsAbleToHand() and (not res or Duel.SelectOption(tp,1190,1068)==1) then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tc)
else
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
g=g:Select(tp,1,1,nil)
Duel.Equip(tp,tc,g:GetFirst())
end
end
--ew
function cm.conw(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():GetFlagEffect(20000205)>0 then Duel.Hint(24,0,aux.Stringid(m,0)) end
return false
end
\ No newline at end of file
--龙心武装 热血剑
local cm,m,o=GetID()
function cm.initial_effect(c)
aux.AddCodeList(c,20000211)
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetCode(EFFECT_EQUIP_LIMIT)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e0:SetValue(cm.eqf0)
c:RegisterEffect(e0)
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_EQUIP)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_CONTINUOUS_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(cm.tg1)
e1:SetOperation(cm.op1)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_EQUIP)
e2:SetCode(EFFECT_DEFENSE_ATTACK)
e2:SetValue(1)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_ATTACK_DISABLED)
e3:SetRange(LOCATION_SZONE)
e3:SetTarget(cm.tg3)
e3:SetOperation(cm.op3)
c:RegisterEffect(e3)
end
--e0
function cm.eqf0(e,c)
return c:IsAttribute(ATTRIBUTE_FIRE)
end
--e1
function cm.tgf1(c)
return c:IsAttribute(ATTRIBUTE_FIRE) and c:IsFaceup()
end
function cm.tg1(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and cm.tgf1(chkc) end
if chk==0 then return Duel.IsExistingTarget(cm.tgf1,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
Duel.SelectTarget(tp,cm.tgf1,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_EQUIP,e:GetHandler(),1,0,0)
end
function cm.op1(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if e:GetHandler():IsRelateToEffect(e) and tc:IsRelateToEffect(e) and tc:IsFaceup() then
Duel.Equip(tp,e:GetHandler(),tc)
end
end
--e3
function cm.tgf3(c,e,tp)
return c:IsCode(20000211) and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false) and c:CheckFusionMaterial()
and Duel.GetLocationCountFromEx(tp,tp,nil,c)>0
end
function cm.tg3(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsReleasableByEffect() and aux.MustMaterialCheck(nil,tp,EFFECT_MUST_BE_FMATERIAL)
and Duel.IsExistingMatchingCard(cm.tgf3,tp,LOCATION_EXTRA,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function cm.op3(e,tp,eg,ep,ev,re,r,rp)
if Duel.Release(e:GetHandler(),REASON_EFFECT)~=1 then return end
if not aux.MustMaterialCheck(nil,tp,EFFECT_MUST_BE_FMATERIAL) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tc=Duel.SelectMatchingCard(tp,cm.tgf3,tp,LOCATION_EXTRA,0,1,1,nil,e,tp):GetFirst()
if not tc then return end
tc:SetMaterial(nil)
Duel.SpecialSummon(tc,SUMMON_TYPE_FUSION,tp,tp,false,false,POS_FACEUP)
tc:CompleteProcedure()
Duel.Hint(24,0,aux.Stringid(m,0))
tc:RegisterFlagEffect(m,RESET_EVENT+RESETS_STANDARD,0,1)
end
\ No newline at end of file
--热血龙 異角
local cm,m,o=GetID()
function cm.initial_effect(c)
c:EnableReviveLimit()
aux.AddCodeList(c,20000204)
aux.AddFusionProcFunRep(c,cm.fmat,2,true)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SET_POSITION)
e1:SetRange(LOCATION_MZONE)
e1:SetTargetRange(0,LOCATION_MZONE)
e1:SetTarget(cm.tg1)
e1:SetValue(POS_FACEUP_DEFENSE)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_BATTLE_DESTROYING)
e2:SetCondition(aux.bdocon)
e2:SetTarget(cm.tg2)
e2:SetOperation(cm.op2)
c:RegisterEffect(e2)
end
--fmat
function cm.fmat(c,fc,sub,mg,sg)
return not sg or (not sg:IsExists(Card.IsLevel,1,c,c:GetLevel()) and c:GetLevel()>0)
end
--e1
function cm.tg1(e,c)
return c:IsFaceup() and c:IsAttackBelow(e:GetHandler():GetAttack())
end
--e2
function cm.con2(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetFlagEffect(20000204)>0 and aux.bdocon(e,tp,eg,ep,ev,re,r,rp)
end
function cm.tg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsRelateToBattle() end
local bc=e:GetHandler():GetBattleTarget()
Duel.SetTargetCard(bc)
end
function cm.op2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if c:IsRelateToBattle() and c:IsFaceup() then
if tc:IsRelateToEffect(e) then
local def=math.ceil(tc:GetBaseDefense()/2)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_COPY_INHERIT)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(def)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE)
c:RegisterEffect(e1)
end
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_CANNOT_DIRECT_ATTACK)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_BATTLE)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_EXTRA_ATTACK)
e3:SetValue(1)
e3:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_BATTLE)
c:RegisterEffect(e3)
end
end
\ No newline at end of file
--应敌模块-Summon
local m=20000300
local cm=_G["c"..m]
fu=fu or {}
function fu.copy(c,code)
local tc=c
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e0:SetCode(EVENT_BE_MATERIAL)
e0:SetProperty(EFFECT_FLAG_EVENT_PLAYER)
e0:SetCondition(function(e,tp,eg,ep,ev,re,r,rp)
return r==REASON_XYZ
end)
e0:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
e:SetProperty(EFFECT_FLAG_EVENT_PLAYER+EFFECT_FLAG_IGNORE_IMMUNE)
local rc=e:GetHandler():GetReasonCard()
local code=e:GetLabel()
local cid=rc:CopyEffect(code,RESET_EVENT+RESETS_STANDARD,1)
local e1=Effect.CreateEffect(e:GetHandler() )
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
e1:SetCode(EFFECT_ADD_CODE)
e1:SetValue(code)
rc:RegisterEffect(e1,true)
rc:RegisterFlagEffect(0,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(code,1))
if not rc:IsType(TYPE_EFFECT) then
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_ADD_TYPE)
e2:SetValue(TYPE_EFFECT)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
rc:RegisterEffect(e2,true)
end
e:SetProperty(EFFECT_FLAG_EVENT_PLAYER)
end)
e0:SetLabel(code)
tc:RegisterEffect(e0)
return e0
end
function fu.give(c,code,cod,con,egf,cod1,cod2)
local tc=c
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(code,0))
e1:SetCategory(CATEGORY_REMOVE+CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetRange(LOCATION_HAND)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(cod)
e1:SetCountLimit(1,code)
e1:SetCondition(function(e,tp,eg,ep,ev,re,r,rp)
return con(e,tp,eg,ep,ev,re,r,rp)
end)
e1:SetTarget(function(e,tp,eg,ep,ev,re,r,rp,chk)
local g=eg:Filter(egf,nil,tp)
if chk==0 then return g:GetCount()>0 and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false)and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 end
Duel.SetTargetCard(eg)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,g:GetCount(),0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end)
e1:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
local g=eg:Filter(egf,nil,tp):Filter(Card.IsRelateToEffect,nil,e)
local tc=g:GetFirst()
while tc do
if tc:IsLocation(LOCATION_ONFIELD) then
tc:RegisterFlagEffect(code,RESET_PHASE+PHASE_END,0,1)
end
tc=g:GetNext()
end
if g:GetCount()>0 and Duel.Remove(g,POS_FACEDOWN,REASON_EFFECT+REASON_TEMPORARY)~=0 then
local tc=g:GetFirst()
while tc do
if tc:GetFlagEffect(code)~=0 then
tc:RegisterFlagEffect(code+1,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1)
else
tc:RegisterFlagEffect(code+2,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1)
end
local e1=Effect.CreateEffect(e:GetHandler())
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:SetLabelObject(tc)
e1:SetCondition(function(e,tp,eg,ep,ev,re,r,rp)
return e:GetLabelObject():GetFlagEffect(code+1)~=0 or e:GetLabelObject():GetFlagEffect(code+2)~=0
end)
e1:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
if e:GetLabelObject():GetFlagEffect(code+1)~=0 then
Duel.ReturnToField(e:GetLabelObject())
elseif e:GetLabelObject():GetFlagEffect(code+2)~=0 then
Duel.SendtoHand(e:GetLabelObject(),e:GetLabelObject():GetPreviousControler(),REASON_EFFECT)
end
end)
Duel.RegisterEffect(e1,tp)
tc=g:GetNext()
end
if e:GetHandler():IsRelateToEffect(e)and e:GetHandler():IsLocation(LOCATION_HAND)and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then
Duel.SpecialSummon(e:GetHandler(),0,tp,tp,false,false,POS_FACEUP)
end
end
end)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_GRANT)
e2:SetRange(LOCATION_MZONE)
e2:SetTargetRange(LOCATION_HAND,0)
e2:SetTarget(function(e,c)
return c:IsSetCard(0xfd3) and c:IsLocation(LOCATION_HAND) and c:IsType(TYPE_MONSTER)
end)
e2:SetLabelObject(e1)
tc:RegisterEffect(e2)
if cod1 then
local e3=e1:Clone()
e3:SetCode(cod1)
local e4=e2:Clone()
e4:SetLabelObject(e3)
tc:RegisterEffect(e4)
end
if cod2 then
local e3=e1:Clone()
e3:SetCode(cod2)
local e4=e2:Clone()
e4:SetLabelObject(e3)
tc:RegisterEffect(e4)
end
return e2
end
if not cm then return end
function cm.initial_effect(c)
local e0=fu.copy(c,m)
local e1=fu.give(c,m,EVENT_SUMMON_SUCCESS,function(e,tp,eg,ep,ev,re,r,rp)return true end,
function(c,tp)return c:GetSummonPlayer()==1-tp and c:IsAbleToRemove()and c:IsLocation(LOCATION_MZONE)end,EVENT_SPSUMMON_SUCCESS,EVENT_FLIP_SUMMON_SUCCESS)
end
\ No newline at end of file
--应敌模块-Set
local m=20000301
local cm=_G["c"..m]
if not pcall(function() require("expansions/script/c20000300") end) then require("script/c20000300") end
function cm.initial_effect(c)
local e0=fu.copy(c,m)
local e1=fu.give(c,m,EVENT_MSET,function(e,tp,eg,ep,ev,re,r,rp)return rp==1-tp end,
function(c,tp,e)return c:IsFacedown() and (not e or c:IsRelateToEffect(e))end,EVENT_SSET,0)
end
--应敌模组-突袭
local m=20000302
local cm=_G["c"..m]
if not pcall(function() require("expansions/script/c20000300") end) then require("script/c20000300") end
function cm.initial_effect(c)
local e0=fu.copy(c,m)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_REMOVE+CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetRange(LOCATION_HAND)
e1:SetCode(EVENT_ATTACK_ANNOUNCE)
e1:SetCountLimit(1,m)
e1:SetCondition(function(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetAttacker():IsControler(1-tp)
end)
e1:SetTarget(function(e,tp,eg,ep,ev,re,r,rp,chk)
local tc=Duel.GetAttacker()
if chk==0 then return e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false)and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,tc,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end)
e1:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetAttacker()
if tc:IsRelateToBattle() and tc:IsFaceup() and Duel.Remove(tc,POS_FACEDOWN,REASON_EFFECT+REASON_TEMPORARY)~=0 then
tc:RegisterFlagEffect(m,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1)
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:SetLabelObject(tc)
e1:SetCountLimit(1)
e1:SetCondition(function(e,tp,eg,ep,ev,re,r,rp)
return e:GetLabelObject():GetFlagEffect(m)~=0
end)
e1:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
Duel.ReturnToField(e:GetLabelObject())
end)
Duel.RegisterEffect(e1,tp)
if e:GetHandler():IsRelateToEffect(e)and e:GetHandler():IsLocation(LOCATION_HAND)and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then
Duel.SpecialSummon(e:GetHandler(),0,tp,tp,false,false,POS_FACEUP)
end
end
end)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_GRANT)
e2:SetRange(LOCATION_MZONE)
e2:SetTargetRange(LOCATION_HAND,0)
e2:SetTarget(function(e,c)
return c:IsSetCard(0xfd3) and c:IsLocation(LOCATION_HAND) and c:IsType(TYPE_MONSTER)
end)
e2:SetLabelObject(e1)
c:RegisterEffect(e2)
end
--应敌模组-狙击
local m=20000303
local cm=_G["c"..m]
if not pcall(function() require("expansions/script/c20000300") end) then require("script/c20000300") end
function cm.initial_effect(c)
local e0=fu.copy(c,m)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_REMOVE+CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetRange(LOCATION_HAND)
e1:SetCode(EVENT_CHAINING)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
e1:SetCountLimit(1,m)
e1:SetCondition(function(e,tp,eg,ep,ev,re,r,rp)
if rp==tp or e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) then return false end
if not re:IsHasProperty(EFFECT_FLAG_CARD_TARGET) then return false end
local tg=Duel.GetChainInfo(ev,CHAININFO_TARGET_CARDS)
return tg and tg:IsExists(function(c,tp)return c:IsOnField() and c:IsControler(tp)end,1,nil,tp) and Duel.IsChainNegatable(ev)
end)
e1:SetTarget(function(e,tp,eg,ep,ev,re,r,rp,chk)
local tc=re:GetHandler()
if chk==0 then return tc:IsRelateToEffect(re) and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false)and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,tc,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end)
e1:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
local tc=re:GetHandler()
if tc:IsStatus(STATUS_LEAVE_CONFIRMED) or tc:IsType(TYPE_EQUIP) then
x=1
else
x=0
end
if tc:IsRelateToEffect(re) and Duel.Remove(tc,POS_FACEDOWN,REASON_EFFECT+REASON_TEMPORARY)~=0 then
tc:RegisterFlagEffect(m,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1)
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:SetLabelObject(tc)
e1:SetLabel(x)
e1:SetCountLimit(1)
e1:SetCondition(function(e,tp,eg,ep,ev,re,r,rp)
return e:GetLabelObject():GetFlagEffect(m)~=0
end)
e1:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
Duel.ReturnToField(e:GetLabelObject())
if e:GetLabel()==1 then
Duel.SendtoGrave(e:GetLabelObject(),REASON_RULE)
end
end)
Duel.RegisterEffect(e1,tp)
if e:GetHandler():IsRelateToEffect(e)and e:GetHandler():IsLocation(LOCATION_HAND)and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then
Duel.SpecialSummon(e:GetHandler(),0,tp,tp,false,false,POS_FACEUP)
end
end
end)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_GRANT)
e2:SetRange(LOCATION_MZONE)
e2:SetTargetRange(LOCATION_HAND,0)
e2:SetTarget(function(e,c)
return c:IsSetCard(0xfd3) and c:IsLocation(LOCATION_HAND) and c:IsType(TYPE_MONSTER)
end)
e2:SetLabelObject(e1)
c:RegisterEffect(e2)
end
--应敌模块-Add
local m=20000304
local cm=_G["c"..m]
if not pcall(function() require("expansions/script/c20000300") end) then require("script/c20000300") end
function cm.initial_effect(c)
local e0=fu.copy(c,m)
local e1=fu.give(c,m,EVENT_TO_HAND,function(e,tp,eg,ep,ev,re,r,rp)return Duel.GetCurrentPhase()~=PHASE_DRAW end,
function(c,tp)return c:IsControler(1-tp) and c:IsPreviousLocation(LOCATION_DECK)end,0,0)
end
--支援模块-Summon
local m=20000305
local cm=_G["c"..m]
function cm.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_HAND)
e1:SetCondition(function(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==tp
end)
e1:SetCost(function(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return not e:GetHandler():IsPublic() end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_PUBLIC)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END+RESET_OPPO_TURN)
e:GetHandler():RegisterEffect(e1)
e:GetHandler():RegisterFlagEffect(0,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END+RESET_OPPO_TURN,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(m,2))
end)
e1:SetOperation(cm.cbd)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_BE_MATERIAL)
e2:SetProperty(EFFECT_FLAG_EVENT_PLAYER)
e2:SetCondition(function(e,tp,eg,ep,ev,re,r,rp)
return r==REASON_XYZ
end)
e2:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local rc=c:GetReasonCard()
local e1=Effect.CreateEffect(rc)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE+EFFECT_FLAG_CLIENT_HINT+EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetDescription(aux.Stringid(m,1))
e1:SetCode(EFFECT_CANNOT_DISABLE_SPSUMMON)
rc:RegisterEffect(e1,true)
local e2=Effect.CreateEffect(rc)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetDescription(aux.Stringid(m,0))
e2:SetRange(LOCATION_MZONE)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetCountLimit(1)
e2:SetOperation(cm.cbd)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
rc:RegisterEffect(e2,true)
if not rc:IsType(TYPE_EFFECT) then
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_ADD_TYPE)
e2:SetValue(TYPE_EFFECT)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
rc:RegisterEffect(e2,true)
end
end)
c:RegisterEffect(e2)
local e3=e1:Clone()
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCode(EVENT_TO_HAND)
e3:SetCondition(function(e,tp,eg,ep,ev,re,r,rp)
return not e:GetHandler():IsReason(REASON_DRAW)
end)
c:RegisterEffect(e3)
end
function cm.cbd(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_DISABLE_SPSUMMON)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetReset(RESET_PHASE+PHASE_END,2)
e1:SetTarget(aux.TargetBoolFunction(Card.IsSetCard,0xfd3))
Duel.RegisterEffect(e1,tp)
local e2=e1:Clone()
e2:SetCode(EFFECT_CANNOT_DISABLE_SUMMON)
Duel.RegisterEffect(e2,tp)
end
\ No newline at end of file
--支援模块-Set
local m=20000306
local cm=_G["c"..m]
function cm.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_HAND)
e1:SetCondition(function(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==tp
end)
e1:SetCost(function(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return not e:GetHandler():IsPublic() end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_PUBLIC)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END+RESET_OPPO_TURN)
e:GetHandler():RegisterEffect(e1)
e:GetHandler():RegisterFlagEffect(0,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END+RESET_OPPO_TURN,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(m,2))
end)
e1:SetOperation(cm.cbd)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_BE_MATERIAL)
e2:SetProperty(EFFECT_FLAG_EVENT_PLAYER)
e2:SetCondition(function(e,tp,eg,ep,ev,re,r,rp)
return r==REASON_XYZ
end)
e2:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local rc=c:GetReasonCard()
local e1=Effect.CreateEffect(rc)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE+EFFECT_FLAG_CLIENT_HINT)
e1:SetDescription(aux.Stringid(m,1))
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e1:SetValue(1)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
rc:RegisterEffect(e1,true)
local e2=Effect.CreateEffect(rc)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetDescription(aux.Stringid(m,0))
e2:SetRange(LOCATION_MZONE)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetCountLimit(1)
e2:SetOperation(cm.cbd)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
rc:RegisterEffect(e2,true)
if not rc:IsType(TYPE_EFFECT) then
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_ADD_TYPE)
e2:SetValue(TYPE_EFFECT)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
rc:RegisterEffect(e2,true)
end
end)
c:RegisterEffect(e2)
local e3=e1:Clone()
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCode(EVENT_TO_HAND)
e3:SetCondition(function(e,tp,eg,ep,ev,re,r,rp)
return not e:GetHandler():IsReason(REASON_DRAW)
end)
c:RegisterEffect(e3)
end
function cm.cbd(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e1:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
e1:SetTargetRange(LOCATION_ONFIELD,0)
e1:SetTarget(aux.TargetBoolFunction(Card.IsPosition,POS_FACEDOWN))
e1:SetReset(RESET_PHASE+PHASE_END,2)
e1:SetValue(1)
Duel.RegisterEffect(e1,tp)
end
\ No newline at end of file
--支援模组-突袭
local m=20000307
local cm=_G["c"..m]
function cm.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_HAND)
e1:SetCondition(function(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==tp
end)
e1:SetCost(function(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return not e:GetHandler():IsPublic() end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_PUBLIC)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END+RESET_OPPO_TURN)
e:GetHandler():RegisterEffect(e1)
e:GetHandler():RegisterFlagEffect(0,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END+RESET_OPPO_TURN,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(m,2))
end)
e1:SetOperation(cm.cbd)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_BE_MATERIAL)
e2:SetProperty(EFFECT_FLAG_EVENT_PLAYER)
e2:SetCondition(function(e,tp,eg,ep,ev,re,r,rp)
return r==REASON_XYZ
end)
e2:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local rc=c:GetReasonCard()
local e1=Effect.CreateEffect(rc)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE+EFFECT_FLAG_CLIENT_HINT)
e1:SetDescription(aux.Stringid(m,1))
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e1:SetValue(1)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
rc:RegisterEffect(e1,true)
local e2=Effect.CreateEffect(rc)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetDescription(aux.Stringid(m,0))
e2:SetRange(LOCATION_MZONE)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetCountLimit(1)
e2:SetOperation(cm.cbd)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
rc:RegisterEffect(e2,true)
if not rc:IsType(TYPE_EFFECT) then
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_ADD_TYPE)
e2:SetValue(TYPE_EFFECT)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
rc:RegisterEffect(e2,true)
end
end)
c:RegisterEffect(e2)
local e3=e1:Clone()
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCode(EVENT_TO_HAND)
e3:SetCondition(function(e,tp,eg,ep,ev,re,r,rp)
return not e:GetHandler():IsReason(REASON_DRAW)
end)
c:RegisterEffect(e3)
end
function cm.cbd(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e1:SetTargetRange(LOCATION_MZONE,0)
e1:SetTarget(aux.TargetBoolFunction(Card.IsSetCard,0xfd3))
e1:SetReset(RESET_PHASE+PHASE_END,2)
e1:SetValue(1)
Duel.RegisterEffect(e1,tp)
end
\ No newline at end of file
--支援模块-Target
local m=20000308
local cm=_G["c"..m]
function cm.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_HAND)
e1:SetCondition(function(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==tp
end)
e1:SetCost(function(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return not e:GetHandler():IsPublic() end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_PUBLIC)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END+RESET_OPPO_TURN)
e:GetHandler():RegisterEffect(e1)
e:GetHandler():RegisterFlagEffect(0,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END+RESET_OPPO_TURN,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(m,2))
end)
e1:SetOperation(cm.cbd)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_BE_MATERIAL)
e2:SetProperty(EFFECT_FLAG_EVENT_PLAYER)
e2:SetCondition(function(e,tp,eg,ep,ev,re,r,rp)
return r==REASON_XYZ
end)
e2:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local rc=c:GetReasonCard()
local e1=Effect.CreateEffect(rc)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE+EFFECT_FLAG_CLIENT_HINT)
e1:SetDescription(aux.Stringid(m,1))
e1:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e1:SetValue(1)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
rc:RegisterEffect(e1,true)
local e2=Effect.CreateEffect(rc)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetDescription(aux.Stringid(m,0))
e2:SetRange(LOCATION_MZONE)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetCountLimit(1)
e2:SetOperation(cm.cbd)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
rc:RegisterEffect(e2,true)
if not rc:IsType(TYPE_EFFECT) then
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_ADD_TYPE)
e2:SetValue(TYPE_EFFECT)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
rc:RegisterEffect(e2,true)
end
end)
c:RegisterEffect(e2)
local e3=e1:Clone()
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCode(EVENT_TO_HAND)
e3:SetCondition(function(e,tp,eg,ep,ev,re,r,rp)
return not e:GetHandler():IsReason(REASON_DRAW)
end)
c:RegisterEffect(e3)
end
function cm.cbd(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e1:SetTargetRange(LOCATION_ONFIELD,0)
e1:SetTarget(aux.TargetBoolFunction(Card.IsSetCard,0xfd3))
e1:SetReset(RESET_PHASE+PHASE_END,2)
e1:SetValue(1)
Duel.RegisterEffect(e1,tp)
end
\ No newline at end of file
--支援模块-Add
local m=20000309
local cm=_G["c"..m]
function cm.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_HAND)
e1:SetCondition(function(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==tp
end)
e1:SetCost(function(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return not e:GetHandler():IsPublic() end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_PUBLIC)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END+RESET_OPPO_TURN)
e:GetHandler():RegisterEffect(e1)
e:GetHandler():RegisterFlagEffect(0,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END+RESET_OPPO_TURN,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(m,2))
end)
e1:SetOperation(cm.cbd)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_BE_MATERIAL)
e2:SetProperty(EFFECT_FLAG_EVENT_PLAYER)
e2:SetCondition(function(e,tp,eg,ep,ev,re,r,rp)
return r==REASON_XYZ
end)
e2:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local rc=c:GetReasonCard()
local e1=Effect.CreateEffect(rc)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CLIENT_HINT)
e1:SetDescription(aux.Stringid(m,1))
e1:SetCode(EFFECT_SET_BASE_ATTACK)
e1:SetValue(rc:GetAttack()+1000)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
rc:RegisterEffect(e1,true)
local e2=e1:Clone()
e2:SetCode(EFFECT_SET_BASE_DEFENSE)
e2:SetValue(rc:GetDefense()+1000)
rc:RegisterEffect(e2,true)
local e2=Effect.CreateEffect(rc)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetDescription(aux.Stringid(m,0))
e2:SetRange(LOCATION_MZONE)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetCountLimit(1)
e2:SetOperation(cm.cbd)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
rc:RegisterEffect(e2,true)
if not rc:IsType(TYPE_EFFECT) then
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_ADD_TYPE)
e2:SetValue(TYPE_EFFECT)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
rc:RegisterEffect(e2,true)
end
end)
c:RegisterEffect(e2)
local e3=e1:Clone()
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCode(EVENT_TO_HAND)
e3:SetCondition(function(e,tp,eg,ep,ev,re,r,rp)
return not e:GetHandler():IsReason(REASON_DRAW)
end)
c:RegisterEffect(e3)
end
function cm.cbd(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetTargetRange(LOCATION_MZONE,0)
e1:SetTarget(aux.TargetBoolFunction(Card.IsSetCard,0xfd3))
e1:SetReset(RESET_PHASE+PHASE_END,2)
e1:SetValue(1000)
Duel.RegisterEffect(e1,tp)
local e2=e1:Clone()
e2:SetCode(EFFECT_UPDATE_DEFENSE)
Duel.RegisterEffect(e2,tp)
end
\ No newline at end of file
--模块导入
local m=20000310
local cm=_G["c"..m]
function cm.initial_effect(c)
aux.AddCodeList(c,m+1)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SEARCH+CATEGORY_DRAW+CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_QUICK_F)
e1:SetCode(EVENT_CHAINING)
e1:SetCountLimit(1,m)
e1:SetRange(LOCATION_SZONE)
e1:SetCondition(function(e,tp,eg,ep,ev,re,r,rp)
return re:IsActiveType(TYPE_MONSTER) and re:GetHandler():IsSetCard(0xfd3)
end)
e1:SetTarget(function(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)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,1,tp,0)
end)
e1:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
local b1=Duel.IsPlayerCanDraw(1)
local b2=Duel.IsExistingMatchingCard(function(c)return c:IsSetCard(0xfd3) and c:IsAbleToHand()end,tp,LOCATION_DECK,0,1,nil)
local op=0
if Duel.IsExistingMatchingCard(Card.IsCode,tp,LOCATION_GRAVE,0,1,nil,m+1)
and e:GetHandler():IsOnField() and Duel.SelectYesNo(tp,aux.Stringid(m,2)) then
local cc=Duel.Release(e:GetHandler(),REASON_EFFECT)
if cc==0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOFIELD)
local g=Duel.SelectMatchingCard(tp,Card.IsCode,tp,LOCATION_GRAVE,0,1,1,nil,m+1)
local tc=g:GetFirst()
if tc then
Duel.MoveToField(tc,tp,tp,LOCATION_SZONE,POS_FACEUP,true)
end
end
if b1 and b2 then op=Duel.SelectOption(tp,aux.Stringid(m,0),aux.Stringid(m,1))
elseif b1 then op=Duel.SelectOption(tp,aux.Stringid(m,0))
elseif b2 then op=Duel.SelectOption(tp,aux.Stringid(m,1))+1
else return end
if op==0 then
local a=Duel.Draw(tp,1,REASON_EFFECT)
else
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,function(c)return c:IsSetCard(0xfd3) and c:IsAbleToHand()end,tp,LOCATION_DECK,0,1,1,nil)
local a=Duel.SendtoHand(g,tp,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end)
c:RegisterEffect(e1)
end
--模块调适
local m=20000311
local cm=_G["c"..m]
function cm.initial_effect(c)
aux.AddCodeList(c,m+1)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_TODECK)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetCountLimit(1,m)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetRange(LOCATION_SZONE)
e2:SetCondition(function(e,tp,eg,ep,ev,re,r,rp,chk)
return eg:IsExists(function(c)return c:IsSetCard(0xfd3) and c:IsSummonPlayer(tp)end,1,nil)
end)
e2:SetTarget(function(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,1,1-tp,0)
end)
e2:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
local b1=Duel.IsExistingMatchingCard(function(c)return c:IsFacedown() and c:IsAbleToDeck()end,tp,LOCATION_REMOVED,LOCATION_REMOVED,1,nil)
local b2=Duel.IsExistingMatchingCard(Card.IsAbleToDeck,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,nil)
local op=0
if Duel.IsExistingMatchingCard(Card.IsCode,tp,LOCATION_GRAVE,0,1,nil,m+1)
and e:GetHandler():IsOnField() and Duel.SelectYesNo(tp,aux.Stringid(m,2)) then
local cc=Duel.Release(e:GetHandler(),REASON_EFFECT)
if cc==0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOFIELD)
local g=Duel.SelectMatchingCard(tp,Card.IsCode,tp,LOCATION_GRAVE,0,1,1,nil,m+1)
local tc=g:GetFirst()
if tc then
Duel.MoveToField(tc,tp,tp,LOCATION_SZONE,POS_FACEUP,true)
end
end
if b1 and b2 then op=Duel.SelectOption(tp,aux.Stringid(m,0),aux.Stringid(m,1))
elseif b1 then op=Duel.SelectOption(tp,aux.Stringid(m,0))
elseif b2 then op=Duel.SelectOption(tp,aux.Stringid(m,1))+1
else return end
if op==0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectMatchingCard(tp,function(c)return c:IsFacedown() and c:IsAbleToDeck()end,tp,LOCATION_REMOVED,LOCATION_REMOVED,1,1,nil)
local a=Duel.SendtoDeck(g,nil,2,REASON_EFFECT)
else
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectMatchingCard(tp,Card.IsAbleToDeck,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,1,nil)
local a=Duel.SendtoDeck(g,nil,2,REASON_EFFECT)
end
end)
c:RegisterEffect(e2)
end
--模块更新
local m=20000312
local cm=_G["c"..m]
function cm.initial_effect(c)
aux.AddCodeList(c,m-2)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_REMOVE+CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e2:SetCode(EVENT_CUSTOM+m)
e2:SetCountLimit(1,m)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetRange(LOCATION_SZONE)
e2:SetTarget(function(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)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,0,0)
end)
e2:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
local b1=Duel.GetFieldGroupCount(tp,0,LOCATION_DECK)>=2*ev
local g2=Duel.GetMatchingGroup(function(c)return c:IsXyzSummonable(nil)end,tp,LOCATION_EXTRA,0,nil)
local op=0
if Duel.IsExistingMatchingCard(Card.IsCode,tp,LOCATION_GRAVE,0,1,nil,m-2)
and e:GetHandler():IsOnField() and Duel.SelectYesNo(tp,aux.Stringid(m,2)) then
local cc=Duel.Release(e:GetHandler(),REASON_EFFECT)
if cc==0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOFIELD)
local g=Duel.SelectMatchingCard(tp,Card.IsCode,tp,LOCATION_GRAVE,0,1,1,nil,m-2)
local tc=g:GetFirst()
if tc then
Duel.MoveToField(tc,tp,tp,LOCATION_SZONE,POS_FACEUP,true)
end
end
if b1 and #g2>0 then op=Duel.SelectOption(tp,aux.Stringid(m,0),aux.Stringid(m,1))
elseif b1 then op=Duel.SelectOption(tp,aux.Stringid(m,0))
elseif #g2>0 then op=Duel.SelectOption(tp,aux.Stringid(m,1))+1
else return end
if op==0 then
local g=Duel.GetDecktopGroup(1-tp,2*ev)
local a=Duel.Remove(g,POS_FACEDOWN,REASON_EFFECT)
else
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tg=g2:Select(tp,1,1,nil)
Duel.XyzSummon(tp,tg:GetFirst(),nil)
end
end)
c:RegisterEffect(e2)
if not cm.global_check then
cm.global_check=true
local ge2=Effect.CreateEffect(c)
ge2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge2:SetCode(EVENT_TO_DECK)
ge2:SetCondition(function(e,tp,eg,ep,ev,re,r,rp,chk)
local g=eg:Filter(function(c,tp)return c:IsControler(1-tp) end,nil,tp)
e:SetLabel(g:GetCount())
return g:GetCount()>0
end)
ge2:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
Duel.RaiseEvent(eg,EVENT_CUSTOM+m,re,r,rp,ep,e:GetLabel())
end)
Duel.RegisterEffect(ge2,0)
end
end
\ No newline at end of file
--模块复制
local m=20000313
local cm=_G["c"..m]
function cm.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TODECK+CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(function(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(function(c)return c:IsSetCard(0xfd3)and c:IsFaceup()end,tp,LOCATION_MZONE,0,1,nil)
and Duel.IsPlayerCanSpecialSummonMonster(tp,m,0xfd3,0x21,1500,1500,4,RACE_MACHINE,ATTRIBUTE_EARTH) end
local g=Duel.GetMatchingGroup(function(c)return c:IsSetCard(0xfd3)and c:IsFaceup()end,tp,LOCATION_MZONE,0,nil)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,1,tp,LOCATION_MZONE)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end)
e1:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.SelectMatchingCard(tp,function(c)return c:IsSetCard(0xfd3)and c:IsFaceup()end,tp,LOCATION_MZONE,0,1,1,nil)
if g:GetCount()>0 then
local hc=Duel.SendtoHand(g,nil,REASON_EFFECT)
if hc==1 and c:IsRelateToEffect(e) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsPlayerCanSpecialSummonMonster(tp,m,0xfd3,0x21,1500,1500,4,RACE_MACHINE,ATTRIBUTE_EARTH) then
c:AddMonsterAttribute(TYPE_EFFECT)
Duel.SpecialSummon(c,SUMMON_VALUE_SELF,tp,tp,true,false,POS_FACEUP)
local tc=g:GetFirst()
local code=tc:GetOriginalCodeRule()
local cid=c:CopyEffect(code,RESET_EVENT+RESETS_STANDARD,1)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EFFECT_ADD_CODE)
e1:SetValue(code)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
c:RegisterEffect(e1)
end
end
end)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,m)
e2:SetCost(function(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToRemoveAsCost()
and Duel.IsExistingMatchingCard(function(c)return c:IsSetCard(0xfd3)and c:IsFaceup()and c:IsAbleToHandAsCost()end,tp,LOCATION_MZONE,0,1,nil) end
Duel.Remove(e:GetHandler(),POS_FACEUP,REASON_COST)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,function(c)return c:IsSetCard(0xfd3)and c:IsFaceup()and c:IsAbleToHandAsCost()end,tp,LOCATION_MZONE,0,1,1,nil)
Duel.SendtoHand(g,nil,REASON_COST)
end)
e2:SetTarget(function(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(function(c,e,tp)
return c:IsSetCard(0xfd3) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)end,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK+LOCATION_GRAVE)
end)
e2:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,function(c,e,tp)
return c:IsSetCard(0xfd3) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)end,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
end)
c:RegisterEffect(e2)
end
--模块量产
local m=20000314
local cm=_G["c"..m]
function cm.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_REMOVE+CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(function(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(function(c)return c:IsSetCard(0xfd3)and c:IsFaceup()end,tp,LOCATION_MZONE,0,1,nil)end
end)
e1:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.SelectMatchingCard(tp,function(c)return c:IsSetCard(0xfd3)and c:IsFaceup()end,tp,LOCATION_MZONE,0,1,1,nil)
if g:GetCount()>0 then
local tc=g:GetFirst()
if tc:IsFaceup()then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_IMMUNE_EFFECT)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetValue(function(e,re)
return e:GetOwnerPlayer()~=re:GetOwnerPlayer()
end)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,2)
e1:SetOwnerPlayer(tp)
tc:RegisterEffect(e1)
end
Duel.BreakEffect()
if tc:IsSetCard(0x3fd3)and Duel.IsExistingMatchingCard(function(c)return c:IsSetCard(0xfd3)and c:IsAbleToHand()end,tp,LOCATION_DECK,0,1,nil)
and Duel.GetFlagEffect(tp,m)==0 and Duel.SelectYesNo(tp,aux.Stringid(m,0))then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,function(c)return c:IsSetCard(0xfd3)and c:IsAbleToHand()end,tp,LOCATION_DECK,0,1,1,nil)
Duel.SendtoHand(g,tp,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
Duel.RegisterFlagEffect(tp,m,RESET_PHASE+PHASE_END,0,1)
end
if tc:IsSetCard(0x5fd3)and Duel.IsExistingMatchingCard(function(c)return c:IsSetCard(0xfd3)and c:IsAbleToHand()end,tp,LOCATION_GRAVE,0,1,nil)
and Duel.GetFlagEffect(tp,m+1)==0 and Duel.SelectYesNo(tp,aux.Stringid(m,1))then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,function(c)return c:IsSetCard(0xfd3)and c:IsAbleToHand()end,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.SendtoHand(g,tp,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
Duel.RegisterFlagEffect(tp,m+1,RESET_PHASE+PHASE_END,0,1)
end
if tc:IsSetCard(0x6fd3)and Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,nil)
and Duel.GetFlagEffect(tp,m+2)==0 and Duel.SelectYesNo(tp,aux.Stringid(m,2))then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,Card.IsAbleToRemove,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,3,nil)
Duel.HintSelection(g)
Duel.Remove(g,POS_FACEDOWN,REASON_EFFECT)
Duel.RegisterFlagEffect(tp,m+2,RESET_PHASE+PHASE_END,0,1)
end
end
end)
c:RegisterEffect(e1)
end
--联合模块-Combine
local m=20000315
local cm=_G["c"..m]
function cm.initial_effect(c)
aux.AddXyzProcedure(c,nil,4,3)
c:EnableReviveLimit()
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCountLimit(1,m)
e1:SetCondition(function(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_XYZ)
end)
e1:SetCost(function(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():GetOverlayGroup():GetCount()>0 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local sg=e:GetHandler():GetOverlayGroup():FilterSelect(tp,Card.IsAbleToHandAsCost,1,1,nil)
Duel.SendtoHand(sg,tp,REASON_COST)
Duel.ConfirmCards(1-tp,sg)
end)
e1:SetTarget(function(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0 and Duel.IsExistingMatchingCard(function(c,tp)
return c:IsSetCard(0xfd3) and c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsSSetable() end,tp,LOCATION_DECK,0,1,nil,tp) end
end)
e1:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
local g=Duel.SelectMatchingCard(tp,function(c,tp)return c:IsSetCard(0xfd3)and c:IsType(TYPE_SPELL+TYPE_TRAP)and c:IsSSetable()end,tp,LOCATION_DECK,0,1,1,nil,tp)
if g:GetCount()>0 then
Duel.SSet(tp,g:GetFirst())
end
end)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DESTROY_REPLACE)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1)
e2:SetTarget(function(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return not c:IsReason(REASON_REPLACE) and c:IsOnField() and c:IsFaceup()
and Duel.IsExistingMatchingCard(function(c)return c:IsSetCard(0xfd3) and c:IsType(TYPE_SPELL+TYPE_TRAP)end,tp,LOCATION_DECK,0,1,nil) end
if Duel.SelectEffectYesNo(tp,c,96) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESREPLACE)
local g=Duel.SelectMatchingCard(tp,function(c)return c:IsSetCard(0xfd3) and c:IsType(TYPE_SPELL+TYPE_TRAP)end,tp,LOCATION_DECK,0,1,1,nil)
Duel.SendtoGrave(g,REASON_EFFECT+REASON_REPLACE)
return true
else return false end
end)
c:RegisterEffect(e2)
end
--紧急模块嵌合
local m=20000316
local cm=_G["c"..m]
function cm.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TODECK+CATEGORY_TOHAND+CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCondition(function(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()~=tp
end)
e1:SetCost(function(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(function(c)
return c:IsSetCard(0xfd3)and c:IsPublic()and c:IsAbleToDeckAsCost()end,tp,LOCATION_HAND,0,1,nil)end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectMatchingCard(tp,function(c)
return c:IsSetCard(0xfd3)and c:IsPublic()and c:IsAbleToDeckAsCost()end,tp,LOCATION_HAND,0,1,1,nil)
Duel.HintSelection(g)
Duel.SendtoDeck(g,nil,2,REASON_EFFECT)
end)
e1:SetTarget(function(e,tp,eg,ep,ev,re,r,rp,chk)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if chk==0 then return Duel.IsExistingMatchingCard(cm.t1,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil,e,tp,ft)end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_GRAVE)
end)
e1:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
local b1=Duel.IsExistingMatchingCard(cm.t1,tp,LOCATION_DECK,0,1,nil,e,tp,ft)
local b2=Duel.IsExistingMatchingCard(cm.t2,tp,LOCATION_GRAVE,0,1,nil)
local op=0
if b1 and b2 then op=Duel.SelectOption(tp,aux.Stringid(m,0),aux.Stringid(m,1))
elseif b1 then op=Duel.SelectOption(tp,aux.Stringid(m,0))
elseif b2 then op=Duel.SelectOption(tp,aux.Stringid(m,1))+1
else return end
if op==0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,cm.t1,tp,LOCATION_DECK,0,1,1,nil,e,tp,ft)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
else
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,cm.t2,tp,LOCATION_GRAVE,0,1,2,nil)
Duel.SendtoHand(g,nil,REASON_EFFECT)
end
end)
c:RegisterEffect(e1)
end
function cm.t1(c,e,tp,ft)
return c:IsSetCard(0xfd3) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and ft>0
end
function cm.t2(c,e,tp,ft)
return c:IsSetCard(0xfd3)and c:IsAbleToHand()
end
\ No newline at end of file
--渊异术士 幻阵龙
local cm,m,o=GetID()
fu_Abyss = fu_Abyss or {}
function fu_Abyss.Hand_Be_Open(c,code,tg,op,cat)
local e=Effect.CreateEffect(c)
e:SetCategory(cat or CATEGORY_TOGRAVE)
e:SetType(EFFECT_TYPE_IGNITION)
e:SetRange(LOCATION_HAND)
e:SetCountLimit(1,code)
e:SetCost(fu_Abyss.HBO_cos(code))
e:SetTarget(tg)
e:SetOperation(op)
c:RegisterEffect(e)
return e
end
function fu_Abyss.Hand_Open(c,op)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_BATTLE_START)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1)
e1:SetCondition(fu_Abyss.HO_con)
e1:SetOperation(op)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetRange(LOCATION_HAND)
e2:SetCode(EFFECT_UPDATE_LEVEL)
e2:SetCondition(fu_Abyss.HO_con)
e2:SetTargetRange(LOCATION_GRAVE,0)
e2:SetTarget(fu_Abyss.HO_tg2)
e2:SetValue(-3)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e3:SetTargetRange(1,0)
e3:SetTarget(fu_Abyss.HO_tg3)
c:RegisterEffect(e3)
return e1,e2,e3
end
function fu_Abyss.HBO_cos(code)
return function(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return not e:GetHandler():IsPublic() end
Duel.ConfirmCards(1-tp,e:GetHandler())
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetDescription(66)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CLIENT_HINT)
e1:SetCode(EFFECT_PUBLIC)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END+RESET_OPPO_TURN)
e:GetHandler():RegisterEffect(e1)
Duel.Hint(24,0,aux.Stringid(code,0))
end
end
function fu_Abyss.HO_con(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPublic()
end
function fu_Abyss.HO_tg2(e,c)
return c:GetType()&0x81==0x81
end
function fu_Abyss.HO_tg3(e,c,sump,sumtype,sumpos,targetp,se)
return not c:IsLocation(LOCATION_GRAVE)
end
if not cm then return end
-----------------------------------------------------------------------------------
function cm.initial_effect(c)
cm.Hand_Be_Open = fu_Abyss.Hand_Be_Open(c,m,cm.tg1,cm.op1)
local e1 = {fu_Abyss.Hand_Open(c,cm.op2)}
end
--e1
function cm.tgf1(c)
return c:IsAbleToGrave() and c:GetType()&0x81==0x81 and c:IsRace(RACE_DRAGON)
end
function cm.tg1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.tgf1,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK)
end
function cm.op1(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,cm.tgf1,tp,LOCATION_DECK,0,1,1,nil)
if #g==0 then return end
Duel.SendtoGrave(g,REASON_EFFECT)
end
--e2
function cm.opf2(c,e)
return c:GetType()&0x81==0x81 and (not e or (not c:IsImmuneToEffect(e) and c:IsFaceup()))
end
function cm.op2(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,0,m)
local g=Duel.GetMatchingGroup(cm.opf2,tp,LOCATION_MZONE,0,nil,e):Filter(Card.IsRace,nil,RACE_DRAGON)
local v=Duel.GetMatchingGroup(cm.opf2,tp,LOCATION_MZONE+LOCATION_GRAVE,0,nil):GetMaxGroup(Card.GetBaseAttack)
if #g==0 or not v then return end
v=v:GetFirst():GetBaseAttack()
for tc in aux.Next(g) do
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_BASE_ATTACK)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_BATTLE)
e1:SetValue(v)
tc:RegisterEffect(e1)
end
end
\ No newline at end of file
--渊异术士 天舞龙
local cm,m,o=GetID()
if not pcall(function() require("expansions/script/c20000450") end) then require("script/c20000450") end
function cm.initial_effect(c)
cm.Hand_Be_Open = fu_Abyss.Hand_Be_Open(c,m,cm.tg1,cm.op1)
local e1 = {fu_Abyss.Hand_Open(c,cm.op2)}
end
--e1
function cm.tgf1(c)
return c:IsAbleToGrave() and c:GetType()&0x82==0x82
end
function cm.tg1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.tgf1,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK)
end
function cm.op1(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,cm.tgf1,tp,LOCATION_DECK,0,1,1,nil)
if #g==0 then return end
Duel.SendtoGrave(g,REASON_EFFECT)
end
--e2
function cm.opf2(c,e)
return e and (not c:IsImmuneToEffect(e) and c:IsFaceup()) or c:GetType()&0x81==0x81
end
function cm.op2(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,0,m)
local g=Duel.GetMatchingGroup(cm.opf2,tp,0,LOCATION_MZONE,nil,e)
if #g==0 then return end
local v=Duel.GetMatchingGroupCount(cm.opf2,tp,LOCATION_MZONE+LOCATION_GRAVE,0,nil)*(-300)
for tc in aux.Next(g) do
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_BATTLE)
e1:SetValue(v)
tc:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_UPDATE_DEFENSE)
tc:RegisterEffect(e2)
end
end
\ No newline at end of file
--渊异术士 月醒龙
local cm,m,o=GetID()
if not pcall(function() require("expansions/script/c20000450") end) then require("script/c20000450") end
function cm.initial_effect(c)
cm.Hand_Be_Open = fu_Abyss.Hand_Be_Open(c,m,cm.tg1,cm.op1,CATEGORY_TOHAND+CATEGORY_SEARCH)
local e1 = {fu_Abyss.Hand_Open(c,cm.op2)}
end
--e1
function cm.tgf1(c)
return c:IsAbleToHand() and c:GetType()&0x82==0x82
end
function cm.tg1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.tgf1,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function cm.op1(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,cm.tgf1,tp,LOCATION_DECK,0,1,1,nil)
if #g==0 then return end
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
--e2
function cm.opf2(c,e)
return c:GetType()&0x81==0x81 and c:IsRace(RACE_DRAGON) and not c:IsImmuneToEffect(e) and c:IsFaceup()
end
function cm.op2(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,0,m)
local g=Duel.GetMatchingGroup(cm.opf2,tp,LOCATION_MZONE,0,nil,e)
local v=Duel.GetMatchingGroupCount(Card.IsPublic,tp,LOCATION_HAND,0,nil)*300
if #g==0 or not v then return end
for tc in aux.Next(g) do
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_BATTLE)
e1:SetValue(v)
tc:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_UPDATE_DEFENSE)
tc:RegisterEffect(e2)
end
end
\ No newline at end of file
--渊异术士 刻蚀龙
local cm,m,o=GetID()
if not pcall(function() require("expansions/script/c20000450") end) then require("script/c20000450") end
function cm.initial_effect(c)
cm.Hand_Be_Open = fu_Abyss.Hand_Be_Open(c,m,cm.tg1,cm.op1,CATEGORY_TOHAND)
local e1 = {fu_Abyss.Hand_Open(c,cm.op2)}
end
--e1
function cm.tgf1(c)
return c:IsAbleToHand() and c:GetType()&0x82==0x82
end
function cm.tg1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.tgf1,tp,LOCATION_GRAVE,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_GRAVE)
end
function cm.op1(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,cm.tgf1,tp,LOCATION_GRAVE,0,1,1,nil)
if #g==0 then return end
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
--e2
function cm.opf2(c,e)
return c:GetType()&0x81==0x81 and (not e or (not c:IsImmuneToEffect(e) and c:IsFaceup()))
end
function cm.op2(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,0,m)
local g=Duel.GetMatchingGroup(cm.opf2,tp,LOCATION_MZONE,0,nil,e):Filter(Card.IsRace,nil,RACE_DRAGON)
local v=Duel.GetMatchingGroup(cm.opf2,tp,LOCATION_MZONE+LOCATION_GRAVE,0,nil):GetMaxGroup(Card.GetBaseDefense)
if #g==0 or not v then return end
v=v:GetFirst():GetBaseDefense()
for tc in aux.Next(g) do
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_BASE_DEFENSE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_BATTLE)
e1:SetValue(v)
tc:RegisterEffect(e1)
end
end
\ No newline at end of file
--渊异术士 冥凝
local cm,m,o=GetID()
if not pcall(function() require("expansions/script/c20000450") end) then require("script/c20000450") end
function cm.initial_effect(c)
cm.Hand_Be_Open = fu_Abyss.Hand_Be_Open(c,m,cm.tg1,cm.op1)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_RITUAL_LEVEL)
e1:SetValue(cm.val1)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetRange(LOCATION_HAND)
e2:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetCondition(fu_Abyss.HO_con)
e2:SetTargetRange(1,0)
e2:SetTarget(fu_Abyss.HO_tg3)
c:RegisterEffect(e2)
end
--e1
function cm.tgf1(c,e,tp,eg,ep,ev,re,r,rp)
if not (c:IsAbleToHand() and c:IsSetCard(0x9fd5) and c:IsType(TYPE_MONSTER) and c:IsRace(RACE_SPELLCASTER) and not c:IsCode(m)) then return end
local te=c.Hand_Be_Open
if not te then return false end
te=te:GetTarget()
return not te or te and te(e,tp,eg,ep,ev,re,r,rp,0)
end
function cm.tg1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.tgf1,tp,LOCATION_DECK,0,1,nil,e,tp,eg,ep,ev,re,r,rp) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function cm.op1(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local v=Duel.SelectMatchingCard(tp,cm.tgf1,tp,LOCATION_DECK,0,1,1,nil,e,tp,eg,ep,ev,re,r,rp):GetFirst()
if v and Duel.SendtoHand(v,nil,REASON_EFFECT)>0 and e:GetHandler():IsRelateToEffect(e) then
Duel.ConfirmCards(1-tp,v)
local lv=v:GetLevel()
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CHANGE_LEVEL)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetValue(lv)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
e:GetHandler():RegisterEffect(e1)
v=v.Hand_Be_Open:GetOperation()
if v then v(e,tp,eg,ep,ev,re,r,rp) end
end
end
--e2
function cm.val1(e,c)
local lv=aux.GetCappedLevel(e:GetHandler())
if c:IsRace(RACE_DRAGON) then
local clv=c:GetLevel()
return (lv<<16)+clv
else return lv end
end
\ No newline at end of file
--深渊异龙的觉醒
local cm,m,o=GetID()
function cm.initial_effect(c)
local e1=aux.AddRitualProcGreater2(c,cm.rf1,nil,nil,nil,nil,cm.op1)
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,m)
e2:SetCost(cm.cos2)
e2:SetTarget(cm.tg2)
e2:SetOperation(cm.op2)
c:RegisterEffect(e2)
end
--e1
function cm.rf1(c)
return c:IsType(TYPE_RITUAL) and c:IsRace(RACE_DRAGON)
end
function cm.op1(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(24,0,aux.Stringid(m,0))
end
--e2
function cm.cos2(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetFieldGroup(tp,LOCATION_HAND,0):Filter(Card.IsPublic,nil):Filter(Card.IsSetCard,nil,0x9fd5):Filter(Card.IsAbleToGraveAsCost,nil)
if chk==0 then return #g>0 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
g=g:Select(tp,1,1,nil)
Duel.SendtoGrave(g,REASON_COST)
end
function cm.tgf2(c,e,tp)
return c:GetType()&0x81==0x81 and c:IsCanBeSpecialSummoned(e,0,tp,false,true) and c:IsRace(RACE_DRAGON) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
end
function cm.tg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToHand() and Duel.IsExistingMatchingCard(cm.tgf2,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,e:GetHandler(),1,0,0)
end
function cm.op2(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 tc=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cm.tgf2),tp,LOCATION_GRAVE,0,1,1,nil,e,tp):GetFirst()
if tc and Duel.SpecialSummon(tc,0,tp,tp,false,true,POS_FACEUP)>0 then
if not e:GetHandler():IsRelateToEffect(e) then return end
Duel.BreakEffect()
Duel.SendtoHand(e:GetHandler(),nil,REASON_EFFECT)
end
end
--深渊异龙的导引
local cm,m,o=GetID()
function cm.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOGRAVE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,m+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(cm.tg1)
e1:SetOperation(cm.op1)
c:RegisterEffect(e1)
end
function cm.tgf1(c)
return c:IsAbleToGrave() and c:GetType()&0x81==0x81 and c:IsRace(RACE_DRAGON)
end
function cm.tg1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.tgf1,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK)
end
function cm.opf1(c)
return c:GetLevel()>0 and c:IsSetCard(0x9fd5) and c:IsAbleToDeck()
end
function cm.op1(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local tc=Duel.SelectMatchingCard(tp,cm.tgf1,tp,LOCATION_DECK,0,1,1,nil):GetFirst()
local g1=Duel.GetRitualMaterial(tp):Filter(Card.IsLocation,nil,LOCATION_HAND)
local g2=Duel.GetMatchingGroup(cm.opf1,tp,LOCATION_GRAVE,0,nil)
if tc and Duel.SendtoGrave(tc,REASON_EFFECT)>0 and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and aux.RitualUltimateFilter(tc,nil,e,tp,g1,g2,Card.GetLevel,"Greater") and Duel.SelectYesNo(tp,1168) then
if tc:IsHasEffect(EFFECT_NECRO_VALLEY) then return end
g2=Duel.GetMatchingGroup(aux.NecroValleyFilter(cm.opf1),tp,LOCATION_GRAVE,0,nil)
g1=(g1:Filter(Card.IsCanBeRitualMaterial,tc,tc)+g2):Filter(tc.mat_filter and tc.mat_filter or aux.TRUE,tc,tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
aux.GCheckAdditional=aux.RitualCheckAdditional(tc,tc:GetLevel(),"Greater")
g1=g1:SelectSubGroup(tp,aux.RitualCheck,false,1,tc:GetLevel(),tp,tc,tc:GetLevel(),"Greater")
aux.GCheckAdditional=nil
if not g1 or #g1==0 then return end
tc:SetMaterial(g1)
g2=g1:Filter(Card.IsLocation,nil,LOCATION_GRAVE):Filter(Card.IsSetCard,nil,0x9fd5)
g1:Sub(g2)
Duel.ReleaseRitualMaterial(g1)
Duel.SendtoDeck(g2,nil,SEQ_DECKSHUFFLE,REASON_EFFECT+REASON_MATERIAL+REASON_RITUAL)
Duel.BreakEffect()
Duel.SpecialSummon(tc,SUMMON_TYPE_RITUAL,tp,tp,false,true,POS_FACEUP)
tc:CompleteProcedure()
Duel.Hint(24,0,aux.Stringid(m,0))
end
end
--窥视渊异之龙皇
local cm,m,o=GetID()
function cm.initial_effect(c)
aux.AddCodeList(c,20000455)
c:EnableReviveLimit()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCondition(cm.con1)
e1:SetOperation(cm.op1)
c:RegisterEffect(e1)
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_DRAW+CATEGORY_TODECK)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e3:SetRange(LOCATION_GRAVE)
e3:SetCountLimit(1,m)
e3:SetTarget(cm.tg3)
e3:SetOperation(cm.op3)
c:RegisterEffect(e3)
end
--e1
function cm.con1(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_RITUAL)
end
function cm.op1(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(24,0,aux.Stringid(m,0))
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_ACTIVATE_COST)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(0,1)
e1:SetCost(cm.op1_cos)
e1:SetOperation(cm.op1_op)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(0x10000000+m)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetTargetRange(0,1)
Duel.RegisterEffect(e2,tp)
end
function cm.op1_cos(e,te_or_c,tp)
local ct=Duel.GetFlagEffect(tp,m)
local n=Duel.GetMatchingGroupCount(Card.IsPublic,tp,0,LOCATION_HAND,nil)
return Duel.CheckLPCost(tp,ct*n*500) or n==0
end
function cm.op1_op(e,tp,eg,ep,ev,re,r,rp)
local n=Duel.GetMatchingGroupCount(Card.IsPublic,tp,0,LOCATION_HAND,nil)
if n>0 then Duel.PayLPCost(tp,n*500) end
end
--e3
function cm.tg3(e,tp,eg,ep,ev,re,r,rp,chk)
local g = Duel.GetFieldGroup(tp,LOCATION_HAND,0):Filter(Card.IsPublic,nil):Filter(Card.IsAbleToDeck,nil)
if chk==0 then return #g>0 and Duel.IsPlayerCanDraw(tp,1) and e:GetHandler():IsAbleToDeck() end
Duel.SetTargetPlayer(tp)
g:AddCard(e:GetHandler())
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,#g,tp,LOCATION_HAND+LOCATION_GRAVE)
end
function cm.op3(e,tp,eg,ep,ev,re,r,rp)
local p=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER)
local g=Duel.GetFieldGroup(p,LOCATION_HAND,0):Filter(Card.IsPublic,nil):Filter(Card.IsAbleToDeck,nil)
if e:GetHandler():IsRelateToEffect(e) then g:AddCard(e:GetHandler()) end
if #g==0 then return end
Duel.SendtoDeck(g,nil,2,REASON_EFFECT)
Duel.Draw(p,#g,REASON_EFFECT)
end
\ No newline at end of file
--觉醒于渊异之龙皇
local cm,m,o=GetID()
function cm.initial_effect(c)
aux.AddCodeList(c,20000455)
c:EnableReviveLimit()
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e0:SetCode(EVENT_SPSUMMON_SUCCESS)
e0:SetCondition(cm.con0)
e0:SetOperation(cm.op0)
c:RegisterEffect(e0)
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:SetCondition(cm.con1)
e1:SetValue(cm.val1)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetRange(LOCATION_MZONE)
e2:SetCost(cm.cos2)
e2:SetTarget(cm.tg2)
e2:SetOperation(cm.op2)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_SEARCH+CATEGORY_TOHAND)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_GRAVE)
e3:SetCountLimit(1,m)
e3:SetCost(cm.cos3)
e3:SetTarget(cm.tg3)
e3:SetOperation(cm.op3)
c:RegisterEffect(e3)
end
--e0
function cm.con0(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPreviousLocation(LOCATION_GRAVE)
end
function cm.op0(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(24,0,aux.Stringid(m,0))
end
--e1
function cm.con1(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_RITUAL)
end
function cm.val1(e,re,tp)
return re:GetActivateLocation()==LOCATION_GRAVE
end
--e2
function cm.cos2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():GetFlagEffect(m)==0 end
end
function cm.tgf2(c)
return c:IsType(TYPE_EFFECT) and c:IsRace(RACE_DRAGON) and c:GetType()&0x81==0x81
end
function cm.tg2(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and cm.tgf2(chkc) end
if chk==0 then return Duel.IsExistingTarget(cm.tgf2,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_OPERATECARD)
Duel.SelectTarget(tp,cm.tgf2,tp,LOCATION_GRAVE,0,1,1,nil)
end
function cm.op2(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
local code=tc:GetOriginalCode()
local ba=tc:GetBaseAttack()
local bd=tc:GetBaseDefense()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END+RESET_OPPO_TURN)
e1:SetCode(EFFECT_CHANGE_CODE)
e1:SetValue(code)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetLabelObject(e1)
e2:SetCode(EFFECT_SET_BASE_ATTACK)
e2:SetValue(ba)
c:RegisterEffect(e2)
local e3=e1:Clone()
e3:SetLabelObject(e2)
e3:SetCode(EFFECT_SET_BASE_DEFENSE)
e3:SetValue(bd)
c:RegisterEffect(e3)
local cid=c:CopyEffect(code,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END+RESET_OPPO_TURN)
local e4=Effect.CreateEffect(c)
e4:SetDescription(1162)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e4:SetCode(EVENT_PHASE+PHASE_END)
e4:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e4:SetRange(LOCATION_MZONE)
e4:SetCountLimit(1)
e4:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END+RESET_OPPO_TURN)
e4:SetLabel(cid)
e4:SetLabelObject(e3)
e4:SetOperation(cm.op2_op4)
c:RegisterEffect(e4)
end
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_SINGLE)
e5:SetCode(EFFECT_CANNOT_TRIGGER)
e5:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
c:RegisterEffect(e5)
c:RegisterFlagEffect(m,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END+RESET_OPPO_TURN,0,1)
end
function cm.op2_op4(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetTurnPlayer()==tp then return end
local c=e:GetHandler()
local cid=e:GetLabel()
c:ResetEffect(cid,RESET_COPY)
c:ResetEffect(RESET_DISABLE,RESET_EVENT)
local e3=e:GetLabelObject()
local e2=e3:GetLabelObject()
local e1=e2:GetLabelObject()
e1:Reset()
e2:Reset()
e3:Reset()
e:Reset()
Duel.HintSelection(Group.FromCards(c))
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
end
--e3
function cm.cosf3(c,g)
return c:IsPublic() and c:IsLocation(LOCATION_HAND) and g:IsExists(Card.IsCode,1,nil,c:GetCode())
end
function cm.cos3(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetFieldGroup(tp,LOCATION_DECK,0):Filter(Card.IsAbleToHand,nil)
if chk==0 then return Duel.CheckReleaseGroupEx(tp,cm.cosf3,1,nil,g) end
g=Duel.SelectReleaseGroupEx(tp,cm.cosf3,1,1,nil,g)
Duel.Release(g,REASON_COST)
e:SetLabel(g:GetFirst():GetCode())
end
function cm.tg3(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function cm.op3(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local c=e:GetLabel()
if Duel.SpecialSummon(e:GetHandler(),0,tp,tp,false,false,POS_FACEUP_DEFENSE)==0 or not c then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
c=Duel.GetFieldGroup(tp,LOCATION_DECK,0):Filter(Card.IsAbleToHand,nil):FilterSelect(tp,Card.IsCode,1,1,nil,c):GetFirst()
if not c then return end
Duel.BreakEffect()
Duel.SendtoHand(c,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,c)
end
\ No newline at end of file
--龙刻魔导士 墨菲纱
local cm,m,o=GetID()
function cm.initial_effect(c)
aux.AddCodeList(c,m+1,m+2)
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,m)
e1:SetCost(cm.cos)
e1:SetTarget(cm.tg)
e1:SetOperation(cm.op)
c:RegisterEffect(e1)
end
function cm.cos(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetFieldGroup(tp,LOCATION_HAND,0):Filter(Card.IsAbleToGraveAsCost,e:GetHandler()):Filter(Card.IsPublic,nil)
if chk==0 then return e:GetHandler():IsAbleToGraveAsCost() and #g>0 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
g=g:Select(tp,1,1,nil)
g:AddCard(e:GetHandler())
Duel.SendtoGrave(g,REASON_COST)
Duel.Hint(24,0,aux.Stringid(m,0))
end
function cm.tgf(c,n)
return c:IsAbleToHand() and c:IsCode(m+n)
end
function cm.tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.tgf,tp,LOCATION_DECK,0,1,nil,1) and Duel.IsExistingMatchingCard(cm.tgf,tp,LOCATION_DECK,0,1,nil,2) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,2,tp,LOCATION_DECK)
end
function cm.op(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local v=Duel.SelectMatchingCard(tp,cm.tgf,tp,LOCATION_DECK,0,1,1,nil,1)+Duel.SelectMatchingCard(tp,cm.tgf,tp,LOCATION_DECK,0,1,1,nil,2)
if #v==2 and Duel.SendtoHand(v,nil,REASON_EFFECT)>0 then
Duel.ConfirmCards(1-tp,v)
end
end
\ No newline at end of file
--呼龙秘仪
local cm,m,o=GetID()
function cm.initial_effect(c)
aux.AddCodeList(c,m+1)
aux.AddRitualProcEqual2(c,aux.FilterBoolFunction(Card.IsRace,8192),18,aux.FilterBoolFunction(Card.IsRace,2),aux.FilterBoolFunction(Card.IsRace,2))
local e=Effect.CreateEffect(c)
e:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e:SetCode(EFFECT_DESTROY_REPLACE)
e:SetRange(LOCATION_GRAVE)
e:SetTarget(cm.tg)
e:SetValue(cm.val)
e:SetOperation(cm.op)
c:RegisterEffect(e)
end
function cm.tgf(c,tp)
return c:IsFaceup() and c:IsControler(tp) and c:IsLocation(LOCATION_MZONE) and c:IsCode(m+1)
and c:IsReason(REASON_EFFECT+REASON_BATTLE) and not c:IsReason(REASON_REPLACE)
end
function cm.tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToRemove() and eg:IsExists(cm.tgf,1,nil,tp) end
return Duel.SelectEffectYesNo(tp,e:GetHandler(),96)
end
function cm.val(e,c)
return cm.tgf(c,e:GetHandlerPlayer())
end
function cm.op(e,tp,eg,ep,ev,re,r,rp)
Duel.Remove(e:GetHandler(),POS_FACEUP,REASON_EFFECT)
end
\ No newline at end of file
--灼世之征服龙
local cm,m,o=GetID()
function cm.initial_effect(c)
aux.AddCodeList(c,m-1)
c:EnableReviveLimit()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_PIERCE)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_ATTACK_ALL)
e2:SetValue(1)
c:RegisterEffect(e2)
local e3=e1:Clone()
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e3:SetCode(EFFECT_SPSUMMON_CONDITION)
e3:SetValue(aux.ritlimit)
c:RegisterEffect(e3)
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e4:SetCode(EVENT_BATTLED)
e4:SetRange(LOCATION_MZONE)
e4:SetCondition(cm.con4)
e4:SetOperation(cm.op4)
c:RegisterEffect(e4)
end
function cm.con4(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_RITUAL)
end
function cm.op4(e,tp,eg,ep,ev,re,r,rp)
local a=Duel.GetAttacker()
local d=Duel.GetAttackTarget()
local p=e:GetHandler():GetControler()
if d==nil then return end
local tc=nil
if a:GetControler()==p and a:GetType()&0x81==0x81 and d:IsStatus(STATUS_BATTLE_DESTROYED) then tc=d
elseif d:GetControler()==p and d:GetType()&0x81==0x81 and a:IsStatus(STATUS_BATTLE_DESTROYED) then tc=a end
if not tc then return end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT+0x17a0000)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetReset(RESET_EVENT+0x17a0000)
tc:RegisterEffect(e2)
end
--堕魔像
local cm,m,o=GetID()
function cm.initial_effect(c)
--spsummon proc
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,m+EFFECT_COUNT_CODE_OATH)
e1:SetCondition(cm.con1)
e1:SetOperation(cm.op1)
c:RegisterEffect(e1)
--search
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,m)
e2:SetCondition(aux.exccon)
e2:SetCost(aux.bfgcost)
e2:SetTarget(cm.tg2)
e2:SetOperation(cm.op2)
c:RegisterEffect(e2)
end
--e1
function cm.conf1(c,ft)
return c:IsAbleToHandAsCost() and (c:IsLocation(LOCATION_MZONE) or (ft>0 and c:IsLocation(LOCATION_SZONE)))
end
function cm.con1(e,c)
if c==nil then return true end
local tp=c:GetControler()
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
return Duel.IsExistingMatchingCard(cm.conf1,tp,LOCATION_ONFIELD,0,1,nil,ft)
end
function cm.op1(e,tp,eg,ep,ev,re,r,rp,c)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local g=Duel.SelectMatchingCard(tp,cm.conf1,tp,LOCATION_ONFIELD,0,1,1,nil,ft)
Duel.SendtoHand(g,tp,REASON_COST)
end
--e2
function cm.tgf2(c)
return c:IsSetCard(0x3fd5) and c:IsSSetable() and c:IsType(TYPE_SPELL+TYPE_TRAP)
end
function cm.tg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.tgf2,tp,LOCATION_DECK,0,1,nil) end
end
function cm.op2(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
local g=Duel.SelectMatchingCard(tp,cm.tgf2,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SSet(tp,g)
end
end
\ No newline at end of file
--堕魔床
local cm,m,o=GetID()
function cm.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY)
e1:SetCountLimit(1,m)
e1:SetCost(cm.cos1)
e1:SetTarget(cm.tg1)
e1:SetOperation(cm.op1)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e2)
end
function cm.cos1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local g=Duel.SelectMatchingCard(tp,Card.IsAbleToHandAsCost,tp,LOCATION_ONFIELD,0,1,1,nil)
Duel.SendtoHand(g,tp,REASON_COST)
end
function cm.tgf1(c)
return c:IsSetCard(0x3fd5) and ((c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsSSetable())
or (c:IsType(TYPE_MONSTER) and c:IsAbleToHand()))
end
function cm.tg1(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and cm.tgf1(chkc) end
if chk==0 then return true end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_OPERATECARD)
local c=Duel.SelectTarget(tp,cm.tgf1,tp,LOCATION_GRAVE,0,1,1,nil):GetFirst()
if c and c:IsType(TYPE_MONSTER) then
Duel.SetOperationInfo(0,CATEGORY_TOHAND,c,1,tp,LOCATION_GRAVE)
end
end
function cm.op1(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc and tc:IsRelateToEffect(e) then
if tc:IsType(TYPE_MONSTER) then
Duel.SendtoHand(tc,tp,REASON_EFFECT)
else
Duel.SSet(tp,tc)
end
Duel.ConfirmCards(1-tp,tc)
end
end
\ No newline at end of file
--堕魔窗
local cm,m,o=GetID()
function cm.initial_effect(c)
--summon success
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DECKDES)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetCost(cm.cos1)
e1:SetTarget(cm.tg1)
e1:SetOperation(cm.op1)
c:RegisterEffect(e1)
--ig
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetCountLimit(1,m)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetRange(LOCATION_MZONE)
e2:SetTarget(cm.tg2)
e2:SetOperation(cm.op2)
c:RegisterEffect(e2)
end
--e1
function cm.cos1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local g=Duel.SelectMatchingCard(tp,Card.IsAbleToHandAsCost,tp,LOCATION_ONFIELD,0,1,1,nil)
Duel.SendtoHand(g,tp,REASON_COST)
end
function cm.tg1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_DECKDES,nil,0,tp,3)
end
function cm.op1(e,tp,eg,ep,ev,re,r,rp)
Duel.DiscardDeck(tp,3,REASON_EFFECT)
end
--e2
function cm.tgf2(c,e,tp)
return c:IsSetCard(0x3fd5) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and not c:IsType(TYPE_TUNER)
end
function cm.tg2(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(cm.tgf2,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,cm.tgf2,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function cm.op2(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)~=0 then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EFFECT_ADD_TYPE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
e1:SetValue(TYPE_TUNER)
tc:RegisterEffect(e1)
end
end
\ No newline at end of file
--堕魔铃
local cm,m,o=GetID()
function cm.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_QUICK_F)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetRange(LOCATION_GRAVE)
e1:SetCountLimit(1,m)
e1:SetCondition(cm.con1)
e1:SetTarget(cm.tg1)
e1:SetOperation(cm.op1)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_CHAINING)
e2:SetCondition(cm.con2)
c:RegisterEffect(e2)
end
--e1
function cm.con1(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(Card.IsRace,1,nil,RACE_FIEND)
end
function cm.tg1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function cm.op1(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsRelateToEffect(e) and Duel.SpecialSummon(e:GetHandler(),0,tp,tp,false,false,POS_FACEUP)~=0 then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EFFECT_LEAVE_FIELD_REDIRECT)
e1:SetValue(LOCATION_REMOVED)
e1:SetReset(RESET_EVENT+RESETS_REDIRECT)
e:GetHandler():RegisterEffect(e1,true)
end
end
--e2
function cm.con2(e,tp,eg,ep,ev,re,r,rp)
return re:IsActiveType(TYPE_MONSTER) and re:GetHandler():IsAttribute(ATTRIBUTE_DARK)
end
\ No newline at end of file
--堕魔镜
local cm,m,o=GetID()
function cm.initial_effect(c)
--summon success
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_ATKCHANGE)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetCost(cm.cos1)
e1:SetOperation(cm.op1)
c:RegisterEffect(e1)
--dr
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_DRAW)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_BATTLE_DESTROYING)
e2:SetCondition(aux.bdocon)
e2:SetTarget(cm.tg2)
e2:SetOperation(cm.op2)
c:RegisterEffect(e2)
end
--e1
function cm.cos1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local g=Duel.SelectMatchingCard(tp,Card.IsAbleToHandAsCost,tp,LOCATION_ONFIELD,0,1,1,nil)
Duel.SendtoHand(g,tp,REASON_COST)
end
function cm.op1(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsRelateToEffect(e) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(1000)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
e:GetHandler():RegisterEffect(e1)
end
end
--e2
function cm.tg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDraw(tp,1) end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(1)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end
function cm.op2(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
\ No newline at end of file
--堕魔通
local cm,m,o=GetID()
function cm.initial_effect(c)
--summon success
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetTarget(cm.tg1)
e1:SetOperation(cm.op1)
c:RegisterEffect(e1)
--discard deck
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_DECKDES)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e2:SetCode(EVENT_PHASE+PHASE_END)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1)
e2:SetCondition(cm.con2)
e2:SetTarget(cm.tg2)
e2:SetOperation(cm.op2)
c:RegisterEffect(e2)
end
--e1
function cm.tgf1(c)
return c:IsAbleToHand() and c:IsSetCard(0x3fd5) and c:IsType(TYPE_MONSTER)
end
function cm.tg1(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.op1(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,cm.tgf1,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
--e2
function cm.con2(e,tp,eg,ep,ev,re,r,rp)
return tp==Duel.GetTurnPlayer()
end
function cm.tg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_DECKDES,nil,0,tp,2)
end
function cm.op2(e,tp,eg,ep,ev,re,r,rp)
Duel.DiscardDeck(tp,2,REASON_EFFECT)
end
\ No newline at end of file
--堕魔烛
local cm,m,o=GetID()
function cm.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetTarget(cm.tg1)
e1:SetOperation(cm.op1)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e2)
--set
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_MZONE)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetCountLimit(1,m)
e3:SetTarget(cm.tg3)
e3:SetOperation(cm.op3)
c:RegisterEffect(e3)
end
--e1
function cm.tg1(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_ONFIELD)
end
function cm.op1(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local g=Duel.SelectMatchingCard(tp,Card.IsAbleToHand,tp,LOCATION_ONFIELD,0,1,1,nil)
if #g>0 then Duel.SendtoHand(g,tp,REASON_EFFECT) end
end
--e3
function cm.tgf3(c)
return c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsSetCard(0x3fd5) and c:IsSSetable()
end
function cm.tg3(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and cm.tgf3(chkc) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE,0)>0 and Duel.IsExistingTarget(cm.tgf3,tp,LOCATION_GRAVE,0,1,nil) end
local n=Duel.GetLocationCount(tp,LOCATION_SZONE,0)
n = n>2 and 2 or n
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
local g=Duel.SelectTarget(tp,cm.tgf3,tp,LOCATION_GRAVE,0,1,n,nil)
Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,g,#g,0,0)
end
function cm.op3(e,tp,eg,ep,ev,re,r,rp)
local tg=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(Card.IsRelateToEffect,nil,e)
if #tg>0 then
Duel.SSet(tp,tg)
end
end
\ No newline at end of file
--堕魔贝
local cm,m,o=GetID()
function cm.initial_effect(c)
--summon success
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DRAW)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetCost(cm.cos1)
e1:SetTarget(cm.tg1)
e1:SetOperation(cm.op1)
c:RegisterEffect(e1)
--discard deck
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_ATKCHANGE+CATEGORY_DECKDES)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_ATTACK_ANNOUNCE)
e2:SetCountLimit(1)
e2:SetTarget(cm.tg2)
e2:SetOperation(cm.op2)
c:RegisterEffect(e2)
end
--e1
function cm.cos1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local g=Duel.SelectMatchingCard(tp,Card.IsAbleToHandAsCost,tp,LOCATION_ONFIELD,0,1,1,nil)
Duel.SendtoHand(g,tp,REASON_COST)
end
function cm.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 cm.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
--e2
function cm.tg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDiscardDeck(tp,3) end
Duel.SetOperationInfo(0,CATEGORY_DECKDES,nil,0,tp,3)
end
function cm.op2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.DiscardDeck(tp,3,REASON_EFFECT) == 0 then return end
local n=Duel.GetOperatedGroup():FilterCount(Card.IsSetCard,nil,0x3fd5)
if c:IsFaceup() and c:IsRelateToEffect(e) and n>0 then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE+RESET_PHASE+PHASE_END)
e1:SetValue(n*500)
c:RegisterEffect(e1)
end
end
\ No newline at end of file
--堕魔士
local cm,m,o=GetID()
function cm.initial_effect(c)
--summon success
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetCost(cm.cos1)
e1:SetTarget(cm.tg1)
e1:SetOperation(cm.op1)
c:RegisterEffect(e1)
end
function cm.cos1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local g=Duel.SelectMatchingCard(tp,Card.IsAbleToHandAsCost,tp,LOCATION_ONFIELD,0,1,1,nil)
Duel.SendtoHand(g,tp,REASON_COST)
end
function cm.tgf1(c,e,tp)
return c:IsRace(RACE_FIEND) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function cm.tg1(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_HAND)
end
function cm.op1(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,cm.tgf1,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
end
\ No newline at end of file
--堕魔灯
local cm,m,o=GetID()
function cm.initial_effect(c)
aux.AddXyzProcedure(c,nil,3,2)
c:EnableReviveLimit()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCondition(cm.con1)
e1:SetTarget(cm.tg1)
e1:SetOperation(cm.op1)
c:RegisterEffect(e1)
end
function cm.con1(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_XYZ)
end
function cm.tgf1(c)
return c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsSetCard(0x3fd5) and c:IsSSetable()
end
function cm.tg1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.tgf1,tp,LOCATION_DECK,0,1,nil) end
end
function cm.op1(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.SelectMatchingCard(tp,cm.tgf1,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SSet(tp,g)
end
end
\ No newline at end of file
--堕魔刃
local cm,m,o=GetID()
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)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,1))
e2:SetType(EFFECT_TYPE_ACTIVATE)
e2:SetCode(EVENT_ATTACK_ANNOUNCE)
e2:SetCondition(cm.con2)
e2:SetCost(cm.cos2)
e2:SetOperation(cm.op2)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetRange(LOCATION_SZONE)
c:RegisterEffect(e3)
local e4=Effect.CreateEffect(c)
e4:SetCategory(CATEGORY_DESTROY)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e4:SetProperty(EFFECT_FLAG_DELAY)
e4:SetCode(EVENT_TO_HAND)
e4:SetCondition(cm.con4)
e4:SetCost(cm.cos4)
e4:SetTarget(cm.tg4)
e4:SetOperation(cm.op4)
c:RegisterEffect(e4)
end
--e2
function cm.con2(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetAttacker():IsControler(1-tp)
end
function cm.cos2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToHandAsCost() end
Duel.SendtoHand(e:GetHandler(),nil,REASON_COST)
end
function cm.op2(e,tp,eg,ep,ev,re,r,rp)
Duel.NegateAttack()
end
--e4
function cm.con4(e,tp,eg,ep,ev,re,r,rp)
return not e:GetHandler():IsReason(REASON_DRAW)
end
function cm.cos4(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsDiscardable() end
Duel.SendtoGrave(c,REASON_COST+REASON_DISCARD)
end
function cm.tg4(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(nil,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
local g=Duel.GetMatchingGroup(nil,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function cm.op4(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(nil,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
if #g>0 then
g = g:Select(tp,1,1,nil)
Duel.Destroy(g,REASON_EFFECT)
end
end
\ No newline at end of file
--堕魔针
local cm,m,o=GetID()
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)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,1))
e2:SetType(EFFECT_TYPE_ACTIVATE)
e2:SetCode(EVENT_ATTACK_ANNOUNCE)
e2:SetCondition(cm.con2)
e2:SetCost(cm.cos2)
e2:SetOperation(cm.op2)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetRange(LOCATION_SZONE)
c:RegisterEffect(e3)
local e4=Effect.CreateEffect(c)
e4:SetCategory(CATEGORY_ATKCHANGE)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e4:SetProperty(EFFECT_FLAG_DELAY)
e4:SetCode(EVENT_TO_HAND)
e4:SetCondition(cm.con4)
e4:SetCost(cm.cos4)
e4:SetTarget(cm.tg4)
e4:SetOperation(cm.op4)
c:RegisterEffect(e4)
end
--e2
function cm.con2(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetAttacker():IsControler(1-tp)
end
function cm.cos2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToHandAsCost() end
Duel.SendtoHand(e:GetHandler(),nil,REASON_COST)
end
function cm.op2(e,tp,eg,ep,ev,re,r,rp)
Duel.NegateAttack()
end
--e4
function cm.con4(e,tp,eg,ep,ev,re,r,rp)
return not e:GetHandler():IsReason(REASON_DRAW)
end
function cm.cos4(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsDiscardable() end
Duel.SendtoGrave(c,REASON_COST+REASON_DISCARD)
end
function cm.tg4(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(nil,tp,0,LOCATION_MZONE,1,nil) end
end
function cm.op4(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(nil,tp,0,LOCATION_MZONE,nil)
if #g>0 then
local tc = g:GetFirst()
while tc do
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(-1000)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
tc = g:GetNext()
end
end
end
\ No newline at end of file
--堕魔浴
local cm,m,o=GetID()
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)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,1))
e2:SetType(EFFECT_TYPE_ACTIVATE)
e2:SetCode(EVENT_ATTACK_ANNOUNCE)
e2:SetCondition(cm.con2)
e2:SetCost(cm.cos2)
e2:SetOperation(cm.op2)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetRange(LOCATION_SZONE)
c:RegisterEffect(e3)
local e4=Effect.CreateEffect(c)
e4:SetCategory(CATEGORY_DECKDES+CATEGORY_TOHAND)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e4:SetProperty(EFFECT_FLAG_DELAY)
e4:SetCode(EVENT_TO_HAND)
e4:SetCountLimit(1,m)
e4:SetCondition(cm.con4)
e4:SetCost(cm.cos4)
e4:SetTarget(cm.tg4)
e4:SetOperation(cm.op4)
c:RegisterEffect(e4)
end
--e2
function cm.con2(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetAttacker():IsControler(1-tp)
end
function cm.cos2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToHandAsCost() end
Duel.SendtoHand(e:GetHandler(),nil,REASON_COST)
end
function cm.op2(e,tp,eg,ep,ev,re,r,rp)
Duel.NegateAttack()
end
--e4
function cm.con4(e,tp,eg,ep,ev,re,r,rp)
return not e:GetHandler():IsReason(REASON_DRAW)
end
function cm.cos4(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsDiscardable() end
Duel.SendtoGrave(c,REASON_COST+REASON_DISCARD)
end
function cm.tg4(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDiscardDeck(tp,2) end
Duel.SetOperationInfo(0,CATEGORY_DECKDES,nil,0,tp,2)
end
function cm.opf4(c)
return c:IsAbleToHand() and c:IsSetCard(0x3fd5) and c:IsType(TYPE_MONSTER)
end
function cm.op4(e,tp,eg,ep,ev,re,r,rp)
if Duel.DiscardDeck(tp,2,REASON_EFFECT)~=0 and Duel.IsExistingMatchingCard(cm.opf4,tp,LOCATION_GRAVE,0,1,nil) and Duel.SelectYesNo(tp,aux.Stringid(m,2)) then
local c=Duel.SelectMatchingCard(tp,cm.opf4,tp,LOCATION_GRAVE,0,1,1,nil)
if c and Duel.SendtoHand(c,nil,REASON_EFFECT) then
Duel.ConfirmCards(1-tp,c)
end
end
end
\ No newline at end of file
--堕魔灵
local cm,m,o=GetID()
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)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,1))
e2:SetType(EFFECT_TYPE_ACTIVATE)
e2:SetCode(EVENT_ATTACK_ANNOUNCE)
e2:SetCondition(cm.con2)
e2:SetCost(cm.cos2)
e2:SetOperation(cm.op2)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetRange(LOCATION_SZONE)
c:RegisterEffect(e3)
local e4=Effect.CreateEffect(c)
e4:SetCategory(CATEGORY_SUMMON)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e4:SetProperty(EFFECT_FLAG_DELAY)
e4:SetCode(EVENT_TO_HAND)
e4:SetCountLimit(1,m)
e4:SetCondition(cm.con4)
e4:SetCost(cm.cos4)
e4:SetTarget(cm.tg4)
e4:SetOperation(cm.op4)
c:RegisterEffect(e4)
end
--e2
function cm.con2(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetAttacker():IsControler(1-tp)
end
function cm.cos2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToHandAsCost() end
Duel.SendtoHand(e:GetHandler(),nil,REASON_COST)
end
function cm.op2(e,tp,eg,ep,ev,re,r,rp)
Duel.NegateAttack()
end
--e4
function cm.con4(e,tp,eg,ep,ev,re,r,rp)
return not e:GetHandler():IsReason(REASON_DRAW)
end
function cm.cos4(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsDiscardable() end
Duel.SendtoGrave(c,REASON_COST+REASON_DISCARD)
end
function cm.tgf4(c)
return c:IsSetCard(0x3fd5) and c:IsSummonable(true,nil)
end
function cm.tg4(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.tgf4,tp,LOCATION_HAND,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_SUMMON,nil,1,0,0)
end
function cm.op4(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SUMMON)
local g=Duel.SelectMatchingCard(tp,cm.tgf4,tp,LOCATION_HAND,0,1,1,nil)
local tc=g:GetFirst()
if tc then
Duel.Summon(tp,tc,true,nil)
end
end
\ No newline at end of file
--堕魔融合
local cm,m,o=GetID()
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)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,1))
e2:SetType(EFFECT_TYPE_ACTIVATE)
e2:SetCode(EVENT_ATTACK_ANNOUNCE)
e2:SetCondition(cm.con2)
e2:SetCost(cm.cos2)
e2:SetOperation(cm.op2)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetRange(LOCATION_SZONE)
c:RegisterEffect(e3)
local e4=Effect.CreateEffect(c)
e4:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_FUSION_SUMMON)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e4:SetProperty(EFFECT_FLAG_DELAY)
e4:SetCode(EVENT_TO_HAND)
e4:SetCondition(cm.con4)
e4:SetCost(cm.cos4)
e4:SetTarget(cm.tg4)
e4:SetOperation(cm.op4)
c:RegisterEffect(e4)
end
--e2
function cm.con2(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetAttacker():IsControler(1-tp)
end
function cm.cos2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToHandAsCost() end
Duel.SendtoHand(e:GetHandler(),nil,REASON_COST)
end
function cm.op2(e,tp,eg,ep,ev,re,r,rp)
Duel.NegateAttack()
end
--e4
function cm.con4(e,tp,eg,ep,ev,re,r,rp)
return not e:GetHandler():IsReason(REASON_DRAW)
end
function cm.cos4(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsDiscardable() end
Duel.SendtoGrave(c,REASON_COST+REASON_DISCARD)
end
function cm.fusfilter1(c,e)
return not c:IsImmuneToEffect(e)
end
function cm.fusfilter2(c,e,tp,m,f,chkf)
return c:IsType(TYPE_FUSION) and c:IsAttribute(ATTRIBUTE_DARK) and (not f or f(c))
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false) and c:CheckFusionMaterial(m,nil,chkf)
end
function cm.tg4(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local chkf=tp
local mg1=Duel.GetFusionMaterial(tp)
local res=Duel.IsExistingMatchingCard(cm.fusfilter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg1,nil,chkf)
if not res then
local ce=Duel.GetChainMaterial(tp)
if ce~=nil then
local fgroup=ce:GetTarget()
local mg2=fgroup(ce,e,tp)
local mf=ce:GetValue()
res=Duel.IsExistingMatchingCard(cm.fusfilter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg2,mf,chkf)
end
end
return res
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function cm.op4(e,tp,eg,ep,ev,re,r,rp)
local chkf=tp
local mg1=Duel.GetFusionMaterial(tp):Filter(cm.fusfilter1,nil,e)
local sg1=Duel.GetMatchingGroup(cm.fusfilter2,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(cm.fusfilter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg2,mf,chkf)
end
if sg1:GetCount()>0 or (sg2~=nil and sg2:GetCount()>0) then
local sg=sg1:Clone()
if sg2 then sg:Merge(sg2) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tg=sg:Select(tp,1,1,nil)
local tc=tg:GetFirst()
if sg1:IsContains(tc) and (sg2==nil or not sg2:IsContains(tc) or not Duel.SelectYesNo(tp,ce:GetDescription())) then
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()
end
end
\ No newline at end of file
--来自黑暗的魔导具
local cm,m,o=GetID()
function cm.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DESTROY+CATEGORY_HANDES)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_ATTACK_ANNOUNCE)
e1:SetCondition(cm.con1)
e1:SetOperation(cm.op1)
c:RegisterEffect(e1)
end
function cm.con1(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetAttacker():IsControler(1-tp)
end
function cm.op1(e,tp,eg,ep,ev,re,r,rp)
local c = e:GetHandler()
if Duel.NegateAttack() then
Duel.BreakEffect()
if Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_ONFIELD,0,c):FilterCount(Card.IsSetCard,nil,0x3fd5)>1 and Duel.GetFieldGroupCount(tp,0,LOCATION_HAND)>0 then
Duel.DiscardHand(1-tp,nil,1,1,REASON_EFFECT+REASON_DISCARD,nil)
end
if Duel.IsExistingMatchingCard(nil,tp,LOCATION_MZONE,0,1,nil)
and Duel.IsExistingMatchingCard(nil,tp,0,LOCATION_MZONE,1,nil) and Duel.SelectYesNo(tp,aux.Stringid(m,0)) then
local g = Duel.SelectMatchingCard(tp,nil,tp,LOCATION_MZONE,0,1,1,nil)
local sg = Duel.SelectMatchingCard(tp,nil,tp,0,LOCATION_MZONE,1,1,nil)
g:Merge(sg)
Duel.Destroy(g,REASON_EFFECT)
end
end
end
\ No newline at end of file
--凶堕魔凰
local cm,m,o=GetID()
function cm.initial_effect(c)
c:EnableReviveLimit()
aux.AddFusionProcFunRep(c,cm.fuf,2,true)
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_ATKCHANGE)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCondition(cm.con1)
e1:SetOperation(cm.op1)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_EXTRA_ATTACK)
e2:SetValue(1)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EVENT_SUMMON_SUCCESS)
e3:SetRange(LOCATION_GRAVE)
e3:SetCondition(cm.con3)
e3:SetOperation(cm.op3)
c:RegisterEffect(e3)
local e4=e3:Clone()
e4:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e4)
end
--fu
function cm.fuf(c,fc,sub,mg,sg)
return c:IsFusionAttribute(ATTRIBUTE_DARK) and (not sg or sg:FilterCount(aux.TRUE,c)==0
or sg:IsExists(Card.IsRace,1,c,c:GetRace()))
end
--e1
function cm.con1(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_FUSION)
end
function cm.op1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,0,LOCATION_MZONE,nil)
local tc=g:GetFirst()
local dg=Group.CreateGroup()
while tc do
local preatk=tc:GetAttack()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
e1:SetValue(-2000)
tc:RegisterEffect(e1)
if preatk~=0 and tc:IsAttack(0) then dg:AddCard(tc) end
tc=g:GetNext()
end
Duel.Destroy(dg,REASON_EFFECT)
end
--e3
function cm.con3(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(Card.IsRace,1,nil,RACE_FIEND)
end
function cm.opf3(c)
return c:IsAbleToRemoveAsCost() and c:IsSetCard(0x3fd5,0xfd6)
end
function cm.op3(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(cm.opf3,tp,LOCATION_GRAVE,0,e:GetHandler())
if Duel.GetLocationCount(tp,LOCATION_MZONE,0)>0 and #g>3
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.SelectYesNo(tp,aux.Stringid(m,0)) then
Duel.Hint(HINT_CARD,0,m)
g = g:Select(tp,4,4,e:GetHandler())
Duel.Remove(g,POS_FACEUP,REASON_COST)
Duel.SpecialSummon(e:GetHandler(),0,tp,tp,false,false,POS_FACEUP)
end
end
--魔凰之堕魔士
local cm,m,o=GetID()
function cm.initial_effect(c)
aux.AddSynchroProcedure(c,nil,aux.NonTuner(nil),1)
c:EnableReviveLimit()
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOGRAVE)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCondition(cm.con1)
e1:SetTarget(cm.tg1)
e1:SetOperation(cm.op1)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetRange(LOCATION_MZONE)
e2:SetValue(cm.val2)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EFFECT_UPDATE_DEFENSE)
c:RegisterEffect(e3)
end
--e1
function cm.con1(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_SYNCHRO)
end
function cm.tgf1(c)
return c:IsSetCard(0x3fd5) and c:IsAbleToGrave()
end
function cm.tg1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.tgf1,tp,LOCATION_DECK,0,1,nil) end
end
function cm.op1(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,cm.tgf1,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoGrave(g,REASON_EFFECT)
end
end
--e2
function cm.val2(e,c)
return Duel.GetMatchingGroup(Card.IsSetCard,e:GetHandlerPlayer(),LOCATION_GRAVE,0,nil,0x3fd5):FilterCount(Card.IsFaceup,nil)*100
end
\ No newline at end of file
--堕魔盘
local cm,m,o=GetID()
function cm.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,m+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(cm.tg1)
e1:SetOperation(cm.op1)
c:RegisterEffect(e1)
end
function cm.tg1(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>=3 end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,0,LOCATION_DECK)
end
function cm.op1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
Duel.ConfirmDecktop(tp,3)
local g=Duel.GetDecktopGroup(tp,3)
g=g:Filter(Card.IsSetCard,nil,0x3fd5)
if #g>0 then
if g:FilterCount(Card.IsAbleToHand,nil)>0 and Duel.SelectYesNo(tp,aux.Stringid(m,0)) then
Duel.Hint(HINT_SELECTMSG,p,HINTMSG_ATOHAND)
local sg=g:FilterSelect(tp,Card.IsAbleToHand,1,1,nil)
Duel.SendtoHand(sg,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,sg)
Duel.ShuffleHand(tp)
end
if g:FilterCount(Card.IsType,nil,TYPE_MONSTER)>0 and Duel.IsExistingMatchingCard(nil,tp,LOCATION_ONFIELD,0,1,c) and Duel.SelectYesNo(tp,aux.Stringid(m,1)) then
Duel.Hint(HINT_SELECTMSG,p,HINTMSG_RTOHAND)
local sg=Duel.SelectMatchingCard(tp,nil,tp,LOCATION_ONFIELD,0,1,1,c)
Duel.SendtoHand(sg,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,sg)
Duel.ShuffleHand(tp)
end
Duel.ShuffleDeck(tp)
end
end
\ No newline at end of file
--堕魔食
local cm,m,o=GetID()
function cm.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOGRAVE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCountLimit(1,m+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(cm.tg1)
e1:SetOperation(cm.op1)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_RECOVER)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetRange(LOCATION_GRAVE)
e2:SetCost(aux.bfgcost)
e2:SetTarget(cm.tg2)
e2:SetOperation(cm.op2)
c:RegisterEffect(e2)
end
function cm.tgf1(c,tp)
return c:IsFaceup() and c:IsSetCard(0x3fd5) and (Duel.IsExistingMatchingCard(cm.opf1,tp,LOCATION_GRAVE,0,1,nil)
or (c:IsSSetable() and c:IsType(TYPE_SPELL+TYPE_TRAP)))
end
function cm.tg1(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_REMOVED) and chkc:IsControler(tp) and cm.tgf1(chkc,tp) end
if chk==0 then return Duel.IsExistingTarget(cm.tgf1,tp,LOCATION_REMOVED,0,1,nil,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectTarget(tp,cm.tgf1,tp,LOCATION_REMOVED,0,1,1,nil,tp)
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,g,1,0,0)
end
function cm.opf1(c)
return c:IsSetCard(0x3fd5) and c:IsSSetable() and c:IsType(TYPE_SPELL+TYPE_TRAP)
end
function cm.op1(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.SendtoGrave(tc,REASON_EFFECT+REASON_RETURN)~=0 and Duel.IsExistingMatchingCard(cm.opf1,tp,LOCATION_GRAVE,0,1,nil)
and Duel.SelectYesNo(tp,aux.Stringid(m,0)) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
local g=Duel.SelectMatchingCard(tp,cm.opf1,tp,LOCATION_GRAVE,0,1,1,nil)
if g:GetCount()>0 then
Duel.SSet(tp,g)
end
end
end
--e2
function cm.tg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(1000)
Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,1000)
end
function cm.op2(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Recover(p,d,REASON_EFFECT)
end
--堕魔锚
local cm,m,o=GetID()
function cm.initial_effect(c)
c:EnableCounterPermit(0xfd5)
c:SetCounterLimit(0xfd5,3)
c:SetUniqueOnField(1,0,m)
aux.AddCodeList(c,m)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e2:SetCode(EVENT_DISCARD)
e2:SetRange(LOCATION_SZONE)
e2:SetOperation(cm.op2)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_DESTROY_REPLACE)
e3:SetRange(LOCATION_SZONE)
e3:SetTarget(cm.tg3)
e3:SetValue(cm.val3)
e3:SetOperation(cm.op3)
c:RegisterEffect(e3)
end
--e2
function cm.op2(e,tp,eg,ep,ev,re,r,rp)
e:GetHandler():AddCounter(0xfd5,1)
end
--e3
function cm.tgf3(c,tp)
return c:IsFaceup() and c:IsSetCard(0x3fd5)
and c:IsOnField() and c:IsControler(tp) and c:IsReason(REASON_EFFECT+REASON_BATTLE) and not c:IsReason(REASON_REPLACE)
end
function cm.tg3(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return eg:IsExists(cm.tgf3,1,nil,tp) and c:GetCounter(0xfd5)>0 end
return Duel.SelectEffectYesNo(tp,c,96)
end
function cm.val3(e,c)
return cm.tgf3(c,e:GetHandlerPlayer())
end
function cm.op3(e,tp,eg,ep,ev,re,r,rp)
e:GetHandler():RemoveCounter(ep,0xfd5,1,REASON_EFFECT)
Duel.Hint(HINT_CARD,0,m)
end
--万蔑邪魔凰
local cm,m,o=GetID()
function cm.initial_effect(c)
c:EnableReviveLimit()
aux.AddFusionProcCodeFun(c,20000516,cm.fuf,1,true,true)
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetTarget(cm.tg1)
e1:SetOperation(cm.op1)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_EXTRA_ATTACK)
e2:SetValue(1)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EVENT_SUMMON_SUCCESS)
e3:SetRange(LOCATION_GRAVE)
e3:SetCondition(cm.con3)
e3:SetOperation(cm.op3)
c:RegisterEffect(e3)
local e4=e3:Clone()
e4:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e4)
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_FIELD)
e5:SetRange(LOCATION_MZONE)
e5:SetTargetRange(0,LOCATION_MZONE)
e5:SetTarget(cm.tg5)
e5:SetCode(EFFECT_DISABLE)
c:RegisterEffect(e5)
end
--fu
function cm.fuf(c,fc,sub,mg,sg)
return c:IsRace(RACE_FIEND)
end
--e1
function cm.tg1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local g=Duel.GetMatchingGroup(nil,tp,0,LOCATION_MZONE,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function cm.op1(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.SelectMatchingCard(tp,nil,tp,0,LOCATION_MZONE,1,1,nil)
Duel.Destroy(g,REASON_EFFECT)
end
--e3
function cm.con3(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(Card.IsRace,1,nil,RACE_FIEND)
end
function cm.opf3(c)
return c:IsAbleToRemoveAsCost() and c:IsSetCard(0x3fd5,0xfd6)
end
function cm.op3(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(cm.opf3,tp,LOCATION_GRAVE,0,e:GetHandler())
if Duel.GetLocationCount(tp,LOCATION_MZONE,0)>0 and #g>3
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.SelectYesNo(tp,aux.Stringid(m,0)) then
Duel.Hint(HINT_CARD,0,m)
g = g:Select(tp,4,4,e:GetHandler())
Duel.Remove(g,POS_FACEUP,REASON_COST)
Duel.SpecialSummon(e:GetHandler(),0,tp,tp,false,false,POS_FACEUP)
end
end
--e5
function cm.tg5(e,c)
return c:IsAttackPos()
end
\ No newline at end of file
--万杀狱邪魔凰
local cm,m,o=GetID()
cm.pendulum_level=1
function cm.initial_effect(c)
c:EnableReviveLimit()
aux.EnablePendulumAttribute(c,false)
aux.AddFusionProcFun2(c,aux.FilterBoolFunction(Card.IsFusionSetCard,0xfd6),aux.FilterBoolFunction(Card.IsFusionType,TYPE_FUSION),true)
--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)
e1:SetValue(cm.val1)
c:RegisterEffect(e1)
--disable field
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetRange(LOCATION_MZONE)
e2:SetCode(EFFECT_DISABLE_FIELD)
e2:SetValue(cm.val2)
c:RegisterEffect(e2)
--pendulum
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_TOHAND)
e3:SetDescription(aux.Stringid(m,2))
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_DESTROYED)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCondition(cm.con3)
e3:SetTarget(cm.tg3)
e3:SetOperation(cm.op3)
c:RegisterEffect(e3)
--Gate of Moonless Night Zetsu
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e4:SetCode(EVENT_PHASE+PHASE_END)
e4:SetRange(LOCATION_GRAVE+LOCATION_EXTRA)
e4:SetCountLimit(1)
e4:SetCondition(cm.con4)
e4:SetOperation(cm.op4)
c:RegisterEffect(e4)
--Destroy
local e5=Effect.CreateEffect(c)
e5:SetCategory(CATEGORY_DESTROY)
e5:SetType(EFFECT_TYPE_IGNITION)
e5:SetRange(LOCATION_PZONE)
e5:SetTarget(cm.tg5)
e5:SetOperation(cm.op5)
c:RegisterEffect(e5)
end
--e1
function cm.val1(e,se,sp,st)
return bit.band(st,SUMMON_TYPE_FUSION)==SUMMON_TYPE_FUSION or bit.band(st,SUMMON_TYPE_PENDULUM)==SUMMON_TYPE_PENDULUM or se:GetHandler():IsSetCard(0xfd6)
end
--e2
function cm.val2(e,c)
return 4369
end
--e3
function cm.con3(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsPreviousLocation(LOCATION_MZONE) and c:IsFaceup()
end
function cm.tgf3(c,tp)
return c:IsAbleToHand() and (Duel.CheckLocation(tp,LOCATION_PZONE,0) or Duel.CheckLocation(tp,LOCATION_PZONE,1)
or aux.SZoneSequence(c:GetSequence())==4 or aux.SZoneSequence(c:GetSequence())==0)
end
function cm.tg3(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.tgf3,tp,LOCATION_SZONE,0,1,nil,tp) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_SZONE)
end
function cm.op3(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) or Duel.GetLocationCount(tp,LOCATION_SZONE)<1 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local g=Duel.SelectMatchingCard(tp,cm.tgf3,tp,LOCATION_SZONE,0,1,1,nil,tp)
if g:GetCount()>0 and Duel.SendtoHand(g,nil,REASON_EFFECT)>0 then
Duel.MoveToField(c,tp,tp,LOCATION_PZONE,POS_FACEUP,true)
end
end
--e4
function cm.con4(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetMatchingGroup(Card.IsAbleToRemoveAsCost,tp,LOCATION_GRAVE,0,e:GetHandler())
return (c:IsLocation(LOCATION_GRAVE) and Duel.GetLocationCount(tp,LOCATION_MZONE,0)>0) or (c:IsFaceup() and Duel.GetLocationCountFromEx(tp,tp,nil,c)>0)
and #g>5 and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function cm.op4(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(Card.IsAbleToRemoveAsCost,tp,LOCATION_GRAVE,0,e:GetHandler())
if Duel.SelectYesNo(tp,aux.Stringid(m,0)) then
Duel.Hint(HINT_CARD,0,m)
g = g:Select(tp,6,6,e:GetHandler())
Duel.Remove(g,POS_FACEUP,REASON_COST)
Duel.SpecialSummon(e:GetHandler(),0,tp,tp,false,false,POS_FACEUP)
end
end
--e5
function cm.tg5(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local g=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
g:AddCard(e:GetHandler())
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0)
end
function cm.op5(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
g:AddCard(e:GetHandler())
Duel.Destroy(g,REASON_EFFECT)
end
\ No newline at end of file
--灭寂罪魔凰
local cm,m,o=GetID()
function cm.initial_effect(c)
aux.AddCodeList(c,20000516)
aux.AddXyzProcedure(c,nil,10,3)
c:EnableReviveLimit()
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,1))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_QUICK_F)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetCondition(cm.con1)
e1:SetTarget(cm.tg1)
e1:SetOperation(cm.op1)
c:RegisterEffect(e1)
--cannot target
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetRange(LOCATION_MZONE)
e2:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e2:SetValue(aux.tgoval)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_EXTRA_ATTACK)
e3:SetValue(1)
c:RegisterEffect(e3)
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(m,2))
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e4:SetCode(EVENT_ATTACK_ANNOUNCE)
e4:SetRange(LOCATION_MZONE)
e4:SetCondition(cm.con2)
e4:SetOperation(cm.op2)
c:RegisterEffect(e4)
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e5:SetCode(EVENT_SUMMON_SUCCESS)
e5:SetRange(LOCATION_GRAVE)
e5:SetCondition(cm.con5)
e5:SetOperation(cm.op5)
c:RegisterEffect(e5)
local e6=e5:Clone()
e6:SetCode(EVENT_CHAINING)
e6:SetCondition(cm.con6)
c:RegisterEffect(e6)
end
--e1
function cm.conf1(c,e,tp)
return c:IsControler(tp) and (not e or c:IsRelateToEffect(e))
end
function cm.con1(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetOverlayGroup():IsExists(Card.IsCode,1,nil,20000516) and eg:IsExists(cm.conf1,1,nil,nil,1-tp)
and not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED)
end
function cm.tg1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetTargetCard(eg)
end
function cm.op1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
local g=eg:Filter(cm.conf1,nil,e,1-tp)
local dg=Group.CreateGroup()
local tc=g:GetFirst()
while tc do
if tc:IsRelateToEffect(e) and not tc:IsImmuneToEffect(e) then
local og=tc:GetOverlayGroup()
if og:GetCount()>0 then
Duel.SendtoGrave(og,REASON_RULE)
end
dg:AddCard(tc)
end
tc=g:GetNext()
end
Duel.Overlay(c,dg)
end
--e4
function cm.con2(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()~=tp and Duel.GetAttackTarget()~=e:GetHandler()
end
function cm.op2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
local at=Duel.GetAttacker()
if at:IsAttackable() and not at:IsImmuneToEffect(e) then
Duel.CalculateDamage(at,c)
end
end
end
--e5
function cm.con5(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(Card.IsRace,1,nil,RACE_FIEND)
end
function cm.opf5(c)
return c:IsSetCard(0x3fd5,0xfd6)
end
function cm.op5(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(cm.opf5,tp,LOCATION_GRAVE,0,e:GetHandler())
if Duel.GetLocationCount(tp,LOCATION_MZONE,0)>0 and #g>3
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.SelectYesNo(tp,aux.Stringid(m,0)) then
Duel.Hint(HINT_CARD,0,m)
g = g:Select(tp,4,4,e:GetHandler())
if Duel.SpecialSummonStep(e:GetHandler(),0,tp,tp,false,false,POS_FACEUP) then
Duel.Overlay(e:GetHandler(),g)
Duel.SpecialSummonComplete()
end
end
end
--e6
function cm.con6(e,tp,eg,ep,ev,re,r,rp)
return re:IsActiveType(TYPE_SPELL)
end
\ No newline at end of file
--灭杀狱罪魔凰
local cm,m,o=GetID()
cm.pendulum_level=11
function cm.initial_effect(c)
aux.AddCodeList(c,20000523)
Auxiliary.AddXyzProcedureLevelFree(c,cm.xyzf,cm.xyzgf,3,3)
c:EnableReviveLimit()
aux.EnablePendulumAttribute(c,false)
--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)
e1:SetValue(cm.val1)
c:RegisterEffect(e1)
--disable
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetRange(LOCATION_MZONE)
e2:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e2:SetCondition(cm.con2)
e2:SetTarget(cm.tg2)
e2:SetCode(EFFECT_DISABLE)
c:RegisterEffect(e2)
--pendulum
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_TOHAND)
e3:SetDescription(aux.Stringid(m,2))
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_DESTROYED)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCondition(cm.con3)
e3:SetTarget(cm.tg3)
e3:SetOperation(cm.op3)
c:RegisterEffect(e3)
--Great Sin of Sin Moonless Night
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e4:SetCode(EVENT_PHASE+PHASE_END)
e4:SetRange(LOCATION_GRAVE+LOCATION_EXTRA)
e4:SetCountLimit(1)
e4:SetCondition(cm.con4)
e4:SetOperation(cm.op4)
c:RegisterEffect(e4)
--pendulum set
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_IGNITION)
e5:SetRange(LOCATION_PZONE)
e5:SetCountLimit(1)
e5:SetTarget(cm.tg5)
e5:SetOperation(cm.op5)
c:RegisterEffect(e5)
end
--xyz
function cm.xyzf(c,xyzc)
return c:IsSetCard(0xfd6)
end
function cm.xyzgf(g)
return g:IsExists(Card.IsType,1,nil,TYPE_XYZ)
end
--e1
function cm.val1(e,se,sp,st)
return bit.band(st,SUMMON_TYPE_XYZ)==SUMMON_TYPE_XYZ or bit.band(st,SUMMON_TYPE_PENDULUM)==SUMMON_TYPE_PENDULUM or se:GetHandler():IsSetCard(0xfd6)
end
--e2
function cm.con2(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetOverlayGroup():IsExists(Card.IsCode,1,nil,20000523) and not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED)
end
function cm.tg2(e,c)
if c:IsSetCard(0xfd6) then return end
return not Duel.IsExistingMatchingCard(Card.IsCode,c:GetControler(),LOCATION_GRAVE,0,1,nil,c:GetCode())
end
--e3
function cm.con3(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsPreviousLocation(LOCATION_MZONE) and c:IsFaceup()
end
function cm.tgf3(c,tp)
return c:IsAbleToHand() and (Duel.CheckLocation(tp,LOCATION_PZONE,0) or Duel.CheckLocation(tp,LOCATION_PZONE,1)
or aux.SZoneSequence(c:GetSequence())==4 or aux.SZoneSequence(c:GetSequence())==0)
end
function cm.tg3(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.tgf3,tp,LOCATION_SZONE,0,1,nil,tp) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_SZONE)
end
function cm.op3(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) or Duel.GetLocationCount(tp,LOCATION_SZONE)<1 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local g=Duel.SelectMatchingCard(tp,cm.tgf3,tp,LOCATION_SZONE,0,1,1,nil,tp)
if g:GetCount()>0 and Duel.SendtoHand(g,nil,REASON_EFFECT)>0 then
Duel.MoveToField(c,tp,tp,LOCATION_PZONE,POS_FACEUP,true)
end
end
--e4
function cm.con4(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetMatchingGroup(cm.opf4,tp,LOCATION_REMOVED,0,nil)
return (c:IsLocation(LOCATION_GRAVE) and Duel.GetLocationCount(tp,LOCATION_MZONE,0)>0) or (c:IsFaceup() and Duel.GetLocationCountFromEx(tp,tp,nil,c)>0)
and #g>5 and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function cm.opf4(c)
return c:IsSetCard(0x3fd5,0xfd6)
end
function cm.op4(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(cm.opf4,tp,LOCATION_REMOVED,0,nil)
if Duel.SelectYesNo(tp,aux.Stringid(m,0)) then
Duel.Hint(HINT_CARD,0,m)
g = g:Select(tp,6,6,e:GetHandler())
if Duel.SpecialSummonStep(e:GetHandler(),0,tp,tp,false,false,POS_FACEUP) then
Duel.Overlay(e:GetHandler(),g)
Duel.SpecialSummonComplete()
end
end
end
--e5
function cm.tgf5(c)
return c:IsType(TYPE_PENDULUM) and not c:IsForbidden() and (c:IsLocation(LOCATION_GRAVE) or c:IsFaceup())
end
function cm.tg5(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return (Duel.CheckLocation(tp,LOCATION_PZONE,0) or Duel.CheckLocation(tp,LOCATION_PZONE,1))
and Duel.IsExistingMatchingCard(cm.tgf5,tp,LOCATION_MZONE+LOCATION_GRAVE,0,1,nil) end
end
function cm.op5(e,tp,eg,ep,ev,re,r,rp)
if not Duel.CheckLocation(tp,LOCATION_PZONE,0) and not Duel.CheckLocation(tp,LOCATION_PZONE,1) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOFIELD)
local g=Duel.SelectMatchingCard(tp,cm.tgf5,tp,LOCATION_MZONE+LOCATION_GRAVE,0,1,1,nil)
if g:GetCount()>0 then
Duel.MoveToField(g:GetFirst(),tp,tp,LOCATION_PZONE,POS_FACEUP,true)
end
end
\ No newline at end of file
--堕魔药
local cm,m,o=GetID()
function cm.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_CHAINING)
e1:SetCondition(cm.con1)
e1:SetTarget(cm.tg1)
e1:SetOperation(cm.op1)
c:RegisterEffect(e1)
end
function cm.con1(e,tp,eg,ep,ev,re,r,rp)
local loc=Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_LOCATION)
return re:GetHandler():IsSetCard(0x3fd5) and re:IsActiveType(TYPE_TRAP) and loc==LOCATION_HAND
end
function cm.tgf1(c,e,tp)
return c:IsSetCard(0xfd6) and c:IsFaceup() and Duel.IsExistingMatchingCard(cm.tgff1,tp,LOCATION_EXTRA,0,1,nil,e,tp,c)
and aux.MustMaterialCheck(c,tp,EFFECT_MUST_BE_XMATERIAL)
end
function cm.tgff1(c,e,tp,mc)
if c:GetOriginalCode()==6165656 and not mc:IsCode(48995978) then return false end
return c:IsRankBelow(10) and c:IsSetCard(0x6fd6) and mc:IsCanBeXyzMaterial(c)
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_XYZ,tp,false,false) and Duel.GetLocationCountFromEx(tp,tp,mc,c)>0
end
function cm.tg1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.tgf1,tp,LOCATION_MZONE,0,1,nil,e,tp) end
end
function cm.op1(e,tp,eg,ep,ev,re,r,rp)
local g=Group.CreateGroup()
Duel.ChangeTargetCard(ev,g)
Duel.ChangeChainOperation(ev,cm.cop1)
end
function cm.cop1(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local tc=Duel.SelectMatchingCard(tp,cm.tgf1,tp,LOCATION_MZONE,0,1,1,nil,e,tp):GetFirst()
if tc:IsImmuneToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sc=Duel.SelectMatchingCard(tp,cm.tgff1,tp,LOCATION_EXTRA,0,1,1,nil,e,tp,tc):GetFirst()
if sc then
local mg=tc:GetOverlayGroup()
if mg:GetCount()~=0 then
Duel.Overlay(sc,mg)
end
sc:SetMaterial(Group.FromCards(tc))
Duel.Overlay(sc,Group.FromCards(tc))
Duel.SpecialSummon(sc,SUMMON_TYPE_XYZ,tp,tp,false,false,POS_FACEUP)
sc:CompleteProcedure()
end
end
\ No newline at end of file
--堕魔凰充能
local cm,m,o=GetID()
function cm.initial_effect(c)
aux.AddCodeList(c,20000516,m)
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND+CATEGORY_REMOVE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,m+EFFECT_COUNT_CODE_OATH)
e1:SetCondition(cm.con)
e1:SetTarget(cm.tg)
e1:SetOperation(cm.op)
c:RegisterEffect(e1)
end
function cm.conf(c)
return c:IsCode(20000516) and c:IsFaceup()
end
function cm.tgf1(c)
return c:IsAbleToRemove() and not c:IsPublic()
end
function cm.tgf2(c)
return (c:IsSetCard(0x3fd5) or c:IsSetCard(0xfd6)) and not c:IsCode(m) and c:IsAbleToHand()
end
function cm.tgf3(g)
return aux.dncheck(g) and g:IsExists(Card.IsSetCard,1,nil,0xfd6) and g:IsExists(Card.IsSetCard,1,nil,0x3fd5)
end
function cm.con(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(cm.conf,tp,LOCATION_MZONE,0,1,nil)
end
function cm.tg(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(cm.tgf2,tp,LOCATION_DECK,0,nil)
if chk==0 then return Duel.IsExistingMatchingCard(cm.tgf1,tp,LOCATION_HAND,0,1,nil) and g:CheckSubGroup(cm.tgf3,2,99) end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,tp,LOCATION_HAND)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,2,tp,LOCATION_DECK)
end
function cm.op(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,cm.tgf1,tp,LOCATION_HAND,0,1,1,nil)
Duel.ConfirmCards(1-tp,g)
if g:GetCount()==0 then return end
local sg=Duel.GetMatchingGroup(cm.tgf2,tp,LOCATION_DECK,0,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
sg=sg:SelectSubGroup(tp,cm.tgf3,false,2,2)
if sg and Duel.SendtoHand(sg,nil,REASON_EFFECT)~=0 then
Duel.ConfirmCards(1-tp,sg)
Duel.ShuffleDeck(tp)
Duel.BreakEffect()
Duel.Remove(g,POS_FACEUP,REASON_EFFECT)
end
end
--堕魔剂
local cm,m,o=GetID()
function cm.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_CHAINING)
e1:SetCondition(cm.con1)
e1:SetTarget(cm.tg1)
e1:SetOperation(cm.op1)
c:RegisterEffect(e1)
end
function cm.con1(e,tp,eg,ep,ev,re,r,rp)
local loc=Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_LOCATION)
return re:GetHandler():IsSetCard(0x3fd5) and re:IsActiveType(TYPE_TRAP) and loc==LOCATION_HAND
end
function cm.tgf1(c,e,tp)
return c:IsSetCard(0xfd6) and c:IsFaceup() and Duel.IsExistingMatchingCard(cm.tgff1,tp,LOCATION_EXTRA,0,1,nil,e,tp,c)
and c:IsReleasable()
end
function cm.tgff1(c,e,tp,mc)
return c:IsType(TYPE_FUSION) and c:IsLevelBelow(10) and c:IsSetCard(0x3fd6) and c:CheckFusionMaterial()
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false) and Duel.GetLocationCountFromEx(tp,tp,mc,c)>0
end
function cm.tg1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return aux.MustMaterialCheck(nil,tp,EFFECT_MUST_BE_FMATERIAL) and Duel.IsExistingMatchingCard(cm.tgf1,tp,LOCATION_MZONE,0,1,nil,e,tp) end
end
function cm.op1(e,tp,eg,ep,ev,re,r,rp)
local g=Group.CreateGroup()
Duel.ChangeTargetCard(ev,g)
Duel.ChangeChainOperation(ev,cm.cop1)
end
function cm.cop1(e,tp,eg,ep,ev,re,r,rp)
if not aux.MustMaterialCheck(nil,tp,EFFECT_MUST_BE_FMATERIAL) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local tc=Duel.SelectMatchingCard(tp,cm.tgf1,tp,LOCATION_MZONE,0,1,1,nil,e,tp):GetFirst()
if Duel.Release(tc,REASON_EFFECT)==0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sc=Duel.SelectMatchingCard(tp,cm.tgff1,tp,LOCATION_EXTRA,0,1,1,nil,e,tp,tc):GetFirst()
if not sc then return end
sc:SetMaterial(nil)
if Duel.SpecialSummon(sc,SUMMON_TYPE_FUSION,tp,tp,false,false,POS_FACEUP)~=0 then
sc:CompleteProcedure()
end
end
\ No newline at end of file
--魔凰之冠翼
local cm,m,o=GetID()
function cm.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(cm.tg1)
e1:SetOperation(cm.op1)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e2:SetCondition(aux.dscon)
e2:SetRange(LOCATION_GRAVE)
e2:SetCost(aux.bfgcost)
e2:SetTarget(cm.tg2)
e2:SetOperation(cm.op2)
c:RegisterEffect(e2)
end
function cm.tgf1(c)
return c:IsFaceup() and c:IsSetCard(0xfd6) and c:GetFlagEffect(m)==0
end
function cm.tg1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.tgf1,tp,LOCATION_MZONE,0,1,nil) end
end
function cm.op1(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_OPERATECARD)
local g=Duel.SelectMatchingCard(tp,cm.tgf1,tp,LOCATION_MZONE,0,1,1,nil)
local tc=g:GetFirst()
if tc then
Duel.HintSelection(g)
local e1=Effect.CreateEffect(tc)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_IMMUNE_EFFECT)
e1:SetValue(cm.op1val1)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(tc)
e2:SetCategory(CATEGORY_TOGRAVE)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_BATTLED)
e2:SetRange(LOCATION_MZONE)
e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
e2:SetCondition(cm.op1con2)
e2:SetTarget(cm.op1tg2)
e2:SetOperation(cm.op1op2)
tc:RegisterEffect(e2)
if not tc:IsType(TYPE_EFFECT) then
local e3=Effect.CreateEffect(e:GetHandler())
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_ADD_TYPE)
e3:SetValue(TYPE_EFFECT)
e3:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e3)
end
tc:RegisterFlagEffect(m,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(m,0))
end
end
function cm.op1val1(e,re)
return e:GetHandlerPlayer()~=re:GetOwnerPlayer()
end
function cm.op1con2(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetAttacker()==e:GetHandler()
end
function cm.op1tg2(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(Card.IsAbleToGrave,tp,0,LOCATION_MZONE,nil)
if chk==0 then return g:GetCount()>0 end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,g,g:GetCount(),0,0)
end
function cm.op1op2(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(Card.IsAbleToGrave,tp,0,LOCATION_MZONE,nil)
if g:GetCount()>0 then
Duel.SendtoGrave(g,REASON_EFFECT)
end
end
--e2
function cm.tgf2(c,tp)
return c:IsFaceup() and c:IsSetCard(0xfd6)
end
function cm.tg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.tgf2,tp,LOCATION_MZONE,0,1,nil) end
end
function cm.op2(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(cm.tgf2,tp,LOCATION_MZONE,0,nil)
local c=e:GetHandler()
local tc=g:GetFirst()
while tc do
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
e1:SetValue(1000)
tc:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_UPDATE_DEFENSE)
tc:RegisterEffect(e2)
tc=g:GetNext()
end
end
\ No newline at end of file
--深罪魔凰之旋临
local cm,m,o=GetID()
function cm.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCountLimit(1,m+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(cm.tg1)
e1:SetOperation(cm.op1)
c:RegisterEffect(e1)
end
function cm.tgf1(c,e,tp)
return c:IsSetCard(0xfd6) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE)
end
function cm.tgff1(c,e,tp,mc)
return c:IsSetCard(0x6fd6) and mc:IsCanBeXyzMaterial(c) and aux.IsCodeListed(c,mc:GetCode())
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_XYZ,tp,false,false) and Duel.GetLocationCountFromEx(tp,tp,mc,c)>0
end
function cm.tg1(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and cm.tgf1(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(cm.tgf1,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,cm.tgf1,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function cm.op1(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP_DEFENSE)~=0 and aux.MustMaterialCheck(tc,tp,EFFECT_MUST_BE_XMATERIAL)
and Duel.IsExistingMatchingCard(cm.tgff1,tp,LOCATION_EXTRA,0,1,nil,e,tp,tc) and Duel.SelectYesNo(tp,aux.Stringid(m,0)) then
local sc=Duel.SelectMatchingCard(tp,cm.tgff1,tp,LOCATION_EXTRA,0,1,1,nil,e,tp,tc):GetFirst()
if sc then
local mg=tc:GetOverlayGroup()
if mg:GetCount()~=0 then
Duel.Overlay(sc,mg)
end
sc:SetMaterial(Group.FromCards(tc))
Duel.Overlay(sc,Group.FromCards(tc))
Duel.SpecialSummon(sc,SUMMON_TYPE_XYZ,tp,tp,false,false,POS_FACEUP)
sc:CompleteProcedure()
end
end
end
\ No newline at end of file
--狂邪魔凰之交杀
local cm,m,o=GetID()
function cm.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_ATTACK_ANNOUNCE)
e1:SetCondition(cm.con1)
e1:SetCost(cm.cos1)
e1:SetTarget(cm.tg1)
e1:SetOperation(cm.op1)
c:RegisterEffect(e1)
end
function cm.con1(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetAttacker():IsControler(1-tp)
end
function cm.cosf1(c)
return c:IsSetCard(0xfd6) and c:IsType(TYPE_MONSTER)
end
function cm.cos1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroup(tp,cm.cosf1,1,nil) end
local tc=Duel.SelectReleaseGroup(tp,cm.cosf1,1,1,nil):GetFirst()
if Duel.Release(tc,REASON_COST)~=0 and tc:IsSetCard(0x3fd6) then e:SetLabel(1) end
end
function cm.tg1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local sg=Duel.GetMatchingGroup(aux.TRUE,tp,0,LOCATION_ONFIELD,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,sg,sg:GetCount(),0,0)
end
function cm.op1(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(aux.TRUE,tp,0,LOCATION_ONFIELD,nil)
Duel.Destroy(g,REASON_EFFECT)
local sg=Duel.GetOperatedGroup()
g:Sub(sg)
if e:GetLabel()==1 and #g>0 then
Duel.Remove(g,POS_FACEUP,REASON_EFFECT)
end
end
\ No newline at end of file
--万•杀•狱
local cm,m,o=GetID()
function cm.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCondition(cm.con1)
e1:SetOperation(cm.op1)
c:RegisterEffect(e1)
end
function cm.conf1(c)
return c:IsFaceup() and c:IsType(TYPE_MONSTER) and c:IsSetCard(0x5fd5)
end
function cm.con1(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(cm.conf1,tp,LOCATION_MZONE,0,1,nil)
end
function cm.op1(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_CHAINING)
e1:SetCondition(cm.op1con)
e1:SetOperation(cm.op1op)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function cm.op1con(e,tp,eg,ep,ev,re,r,rp)
return re:GetHandler():IsRelateToEffect(re) and re:IsActiveType(TYPE_MONSTER) and (re:GetHandler():IsOnField() or re:GetHandler():IsLocation(LOCATION_HAND))
end
function cm.op1op(e,tp,eg,ep,ev,re,r,rp)
Duel.Destroy(eg,REASON_EFFECT)
end
\ No newline at end of file
--罪•杀•狱
local cm,m,o=GetID()
function cm.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(cm.tg1)
e1:SetOperation(cm.op1)
c:RegisterEffect(e1)
end
function cm.tgf1(c)
return c:IsFaceup() and c:IsType(TYPE_MONSTER) and c:IsSetCard(0x5fd5)
end
function cm.tg1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.tgf1,tp,LOCATION_MZONE,0,1,nil) end
end
function cm.op1(e,tp,eg,ep,ev,re,r,rp)
local sg=Duel.GetMatchingGroup(cm.tgf1,tp,LOCATION_MZONE,0,nil)
local c=e:GetHandler()
local fid=c:GetFieldID()
local tc=sg:GetFirst()
while tc do
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_ATKCHANGE)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EVENT_PRE_DAMAGE_CALCULATE)
e1:SetCondition(cm.op1con1)
e1:SetCost(cm.op1cos1)
e1:SetOperation(cm.op1op1)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetRange(LOCATION_MZONE)
e2:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e2:SetValue(aux.tgoval)
tc:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e3:SetValue(aux.indoval)
tc:RegisterEffect(e3)
tc:RegisterFlagEffect(m,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,EFFECT_FLAG_CLIENT_HINT,1,fid,aux.Stringid(m,0))
tc=sg:GetNext()
end
sg:KeepAlive()
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e4:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e4:SetCode(EVENT_PHASE+PHASE_END)
e4:SetReset(RESET_PHASE+PHASE_END)
e4:SetCountLimit(1)
e4:SetLabel(fid)
e4:SetLabelObject(sg)
e4:SetCondition(cm.op1con4)
e4:SetOperation(cm.op1op4)
Duel.RegisterEffect(e4,tp)
end
function cm.op1con1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local bc=c:GetBattleTarget()
return bc and bc:GetAttack()>0
end
function cm.op1cos1(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:GetFlagEffect(m+1)==0 end
c:RegisterFlagEffect(m+1,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_DAMAGE_CAL,0,1)
end
function cm.op1op1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local bc=c:GetBattleTarget()
if c:IsRelateToBattle() and c:IsFaceup() and bc:IsRelateToBattle() and bc:IsFaceup() then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_DAMAGE_CAL)
e1:SetValue(bc:GetAttack())
c:RegisterEffect(e1)
end
end
function cm.op1conf4(c,fid)
return c:GetFlagEffectLabel(m)==fid
end
function cm.op1con4(e,tp,eg,ep,ev,re,r,rp)
local g=e:GetLabelObject()
if not g:IsExists(cm.op1conf4,1,nil,e:GetLabel()) then
g:DeleteGroup()
e:Reset()
return false
else return true end
end
function cm.op1op4(e,tp,eg,ep,ev,re,r,rp)
local g=e:GetLabelObject()
local dg=g:Filter(cm.op1conf4,nil,e:GetLabel())
g:DeleteGroup()
Duel.Destroy(dg,REASON_EFFECT)
end
--新世坏
local cm,m,o=GetID()
function cm.initial_effect(c)
c:EnableCounterPermit(0xfd6)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e2:SetRange(LOCATION_FZONE)
e2:SetCondition(cm.con2)
e2:SetOperation(cm.op2)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,0))
e3:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_FZONE)
e3:SetCountLimit(1,m)
e3:SetCost(cm.cos3)
e3:SetTarget(cm.tg3)
e3:SetOperation(cm.op3)
c:RegisterEffect(e3)
local e4=e3:Clone()
e4:SetDescription(aux.Stringid(m,1))
e4:SetTarget(cm.tg4)
c:RegisterEffect(e4)
end
--e2
function cm.conf2(c)
return c:IsSetCard(0xfd6,0x5fd5) and c:IsType(TYPE_MONSTER)
end
function cm.con2(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(cm.conf2,1,nil,0xfd6)
end
function cm.op2(e,tp,eg,ep,ev,re,r,rp)
eg=eg:Filter(Card.IsType,nil,TYPE_MONSTER)
local n=eg:FilterCount(Card.IsSetCard,nil,0xfd6)+3*eg:FilterCount(Card.IsSetCard,nil,0x5fd5)
e:GetHandler():AddCounter(0xfd6,n)
end
--e3
function cm.cos3(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsCanRemoveCounter(tp,0xfd6,5,REASON_COST) end
e:GetHandler():RemoveCounter(tp,0xfd6,5,REASON_COST)
end
function cm.tgf3(c)
return c:IsSetCard(0x5fd5) and c:IsAbleToHand()
end
function cm.tg3(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.tgf3,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
e:SetLabel(1)
end
function cm.op3(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Group.CreateGroup()
if e:GetLabel()==1 then
g=Duel.SelectMatchingCard(tp,cm.tgf3,tp,LOCATION_DECK,0,1,1,nil)
else
g=Duel.SelectMatchingCard(tp,cm.tgf4,tp,LOCATION_DECK,0,2,2,nil)
end
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
--e4
function cm.tgf4(c)
return c:IsSetCard(0xfd6) and c:IsAbleToHand()
end
function cm.tg4(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.tgf4,tp,LOCATION_DECK,0,2,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,2,tp,LOCATION_DECK)
end
\ No newline at end of file
--罪•罗•万•罚
local cm,m,o=GetID()
function cm.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_LEAVE_FIELD)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCountLimit(1,m+EFFECT_COUNT_CODE_OATH)
e1:SetCondition(cm.con1)
e1:SetTarget(cm.tg1)
e1:SetOperation(cm.op1)
c:RegisterEffect(e1)
--Great Sin of Sin Moonless Night
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_PHASE+PHASE_END)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1)
e2:SetCondition(cm.con2)
e2:SetOperation(cm.op2)
c:RegisterEffect(e2)
end
function cm.conf1(c,tp)
return c:IsPreviousLocation(LOCATION_MZONE) and c:IsSetCard(0x5fd5) and c:IsPreviousControler(tp)
end
function cm.con1(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(cm.conf1,1,nil,tp)
end
function cm.tg1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(aux.TRUE,tp,0,LOCATION_ONFIELD,1,nil) end
local sg=Duel.GetMatchingGroup(aux.TRUE,tp,0,LOCATION_ONFIELD,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,sg,sg:GetCount(),0,0)
end
function cm.op1(e,tp,eg,ep,ev,re,r,rp)
local sg=Duel.GetMatchingGroup(aux.TRUE,tp,0,LOCATION_ONFIELD,nil)
Duel.Destroy(sg,REASON_EFFECT)
end
--e2
function cm.con2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetMatchingGroup(Card.IsAbleToRemoveAsCost,tp,LOCATION_GRAVE,0,c)
return c:IsLocation(LOCATION_GRAVE) and Duel.GetLocationCount(tp,LOCATION_SZONE,0)>0 and #g>5 and c:IsSSetable()
end
function cm.op2(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(Card.IsAbleToRemoveAsCost,tp,LOCATION_GRAVE,0,e:GetHandler())
if Duel.SelectYesNo(tp,aux.Stringid(m,0)) then
Duel.Hint(HINT_CARD,0,m)
g = g:Select(tp,6,6,e:GetHandler())
Duel.Remove(g,POS_FACEUP,REASON_COST)
Duel.SSet(tp,e:GetHandler())
end
end
\ No newline at end of file
--新生基泽
local cm,m,o=GetID()
function cm.initial_effect(c)
aux.AddCodeList(c,m+1)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_DESTROYED)
e1:SetRange(LOCATION_HAND+LOCATION_GRAVE)
e1:SetCondition(cm.con1)
e1:SetOperation(cm.op1)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,1))
e2:SetCategory(CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_PREDRAW)
e2:SetRange(LOCATION_SZONE)
e2:SetCountLimit(1,m)
e2:SetCondition(cm.con2)
e2:SetTarget(cm.tg2)
e2:SetOperation(cm.op2)
c:RegisterEffect(e2)
end
--e1
function cm.conf1(c,tp)
return (c:IsReason(REASON_BATTLE) or c:IsReason(REASON_EFFECT)) and c:GetReasonPlayer()==1-tp
end
function cm.con1(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(cm.conf1,1,e:GetHandler(),tp) and Duel.GetLocationCount(tp,LOCATION_SZONE)>0
end
function cm.op1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not (c:IsRelateToEffect(e) and Duel.MoveToField(c,tp,tp,LOCATION_SZONE,POS_FACEUP,true)) then return false end
local e1=Effect.CreateEffect(c)
e1:SetCode(EFFECT_CHANGE_TYPE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET)
e1:SetValue(TYPE_SPELL+TYPE_CONTINUOUS)
c:RegisterEffect(e1)
c:RegisterFlagEffect(m,RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET,0,1)
end
--e2
function cm.con2(e,tp,eg,ep,ev,re,r,rp)
return tp==Duel.GetTurnPlayer() and e:GetHandler():GetFlagEffect(m)~=0
end
function cm.tg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToRemove() and Duel.IsExistingMatchingCard(Card.IsCode,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil,m+1) end
end
function cm.op2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and Duel.Remove(c,POS_FACEUP,REASON_EFFECT)>0 then
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(m,2))
local tc=Duel.SelectMatchingCard(tp,Card.IsCode,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil,m+1):GetFirst()
if tc then
if tc:IsLocation(LOCATION_DECK) then Duel.ShuffleDeck(tp) end
Duel.MoveSequence(tc,SEQ_DECKTOP)
Duel.ConfirmDecktop(tp,1)
end
end
end
--破坏启示录
local cm,m,o=GetID()
function cm.initial_effect(c)
aux.AddCodeList(c,m-1)
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCost(cm.cos1)
e1:SetTarget(cm.tg1)
e1:SetOperation(cm.op1)
c:RegisterEffect(e1)
end
function cm.cos1(e,tp,eg,ep,ev,re,r,rp,chk)
e:SetLabel(1)
return true
end
function cm.tgf2(c)
return c:IsCode(m-1) and c:IsAbleToGraveAsCost()
end
function cm.tgf1(c,e,tp)
return c:IsType(TYPE_MONSTER) and Duel.GetMZoneCount(tp,c)>0 and c:IsAbleToRemoveAsCost()
and Duel.IsExistingMatchingCard(cm.tgf11,tp,LOCATION_DECK,0,1,nil,e,tp,c:GetAttribute())
end
function cm.tgf11(c,e,tp,att)
return c:IsSetCard(0xcfd5) and c:IsAttribute(att) and c:IsCanBeSpecialSummoned(e,0,tp,true,false,POS_FACEUP)
end
function cm.tg1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
if e:GetLabel()~=1 then return false end
e:SetLabel(0)
return Duel.IsExistingMatchingCard(cm.tgf1,tp,LOCATION_MZONE,0,1,nil,e,tp)
and Duel.IsExistingMatchingCard(cm.tgf2,tp,LOCATION_SZONE,0,2,nil)
end
local g=Duel.SelectMatchingCard(tp,cm.tgf2,tp,LOCATION_SZONE,0,2,2,nil)
Duel.SendtoGrave(g,REASON_COST)
g=Duel.SelectMatchingCard(tp,cm.tgf1,tp,LOCATION_MZONE,0,1,1,nil,e,tp)
Duel.Remove(g,POS_FACEUP,REASON_COST)
e:SetLabel(g:GetFirst():GetAttribute())
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function cm.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 tc=Duel.SelectMatchingCard(tp,cm.tgf11,tp,LOCATION_DECK,0,1,1,nil,e,tp,e:GetLabel()):GetFirst()
if tc and Duel.SpecialSummon(tc,0,tp,tp,true,false,POS_FACEUP_ATTACK)>0 then
tc:CompleteProcedure()
end
end
\ No newline at end of file
--极天零序龙
local cm,m,o=GetID()
fu_zeroth = fu_zeroth or {}
function fu_zeroth.same(c,code,zero_eff)
aux.AddCodeList(c,m-1,m+6)
c:EnableReviveLimit()
local e1=Effect.CreateEffect(c)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SPSUMMON_CONDITION)
e1:SetValue(fu_zeroth.val1)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetOperation(fu_zeroth.op2(code,zero_eff))
c:RegisterEffect(e2)
local e3=zero_eff(c)
c:RegisterEffect(e3)
return e1,e2,e3
end
--e1
function fu_zeroth.val1(e,se,sp,st)
return se:GetHandler():IsCode(m-1,m+6)
end
--e2
function fu_zeroth.op2(code,zero_eff)
return function(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local e1=zero_eff(c)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_GRANT)
e2:SetTargetRange(0xff,0xff)
e2:SetTarget(fu_zeroth.op2tg2)
e2:SetLabelObject(e1)
Duel.RegisterEffect(e2,tp)
Duel.RegisterFlagEffect(tp,code,0,0,1)
end
end
function fu_zeroth.op2tg2(e,c)
return c:IsCode(20758)
end
if not cm then return end
function cm.initial_effect(c)
local e1={fu_zeroth.same(c,m,cm.Zeroth_Effect)}
end
--Zeroth_Effect
function cm.Zeroth_Effect(c)
local e=Effect.CreateEffect(c)
e:SetDescription(aux.Stringid(m,0))
e:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e:SetCode(EVENT_SPSUMMON_SUCCESS)
e:SetProperty(EFFECT_FLAG_DELAY)
e:SetTarget(cm.Zeroth_Effect_tg)
e:SetOperation(cm.Zeroth_Effect_op)
return e
end
function cm.Zeroth_Effect_tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.Hint(HINT_OPSELECTED,1-tp,aux.Stringid(m,0))
end
function cm.Zeroth_Effect_op(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_ACTIVATE)
e1:SetRange(LOCATION_MZONE)
e1:SetTargetRange(0,1)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE)
e1:SetValue(1)
e1:SetCondition(cm.Zeroth_Effect_opcon)
c:RegisterEffect(e1)
end
function cm.Zeroth_Effect_opcon(e)
return Duel.GetAttacker()==e:GetHandler() or Duel.GetAttackTarget()==e:GetHandler()
end
\ No newline at end of file
--终焉零序龙
local cm,m,o=GetID()
if not pcall(function() require("expansions/script/c20000552") end) then require("script/c20000552") end
function cm.initial_effect(c)
local e1={fu_zeroth.same(c,m,cm.Zeroth_Effect)}
end
--Zeroth_Effect
function cm.Zeroth_Effect(c)
local e=Effect.CreateEffect(c)
e:SetDescription(aux.Stringid(m,0))
e:SetCategory(CATEGORY_DISABLE)
e:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e:SetCode(EVENT_SPSUMMON_SUCCESS)
e:SetProperty(EFFECT_FLAG_DELAY)
e:SetTarget(cm.Zeroth_Effect_tg)
e:SetOperation(cm.Zeroth_Effect_op)
return e
end
function cm.Zeroth_Effect_tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local g=Duel.GetMatchingGroup(aux.NegateAnyFilter,tp,0,LOCATION_ONFIELD,nil)
Duel.SetOperationInfo(0,CATEGORY_DISABLE,g,g:GetCount(),0,0)
Duel.Hint(HINT_OPSELECTED,1-tp,aux.Stringid(m,0))
end
function cm.Zeroth_Effect_op(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(aux.NegateAnyFilter,tp,0,LOCATION_ONFIELD,nil)
local tc=g:GetFirst()
local c=e:GetHandler()
while tc do
Duel.NegateRelatedChain(tc,RESET_TURN_SET)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetValue(RESET_TURN_SET)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e2)
if tc:IsType(TYPE_TRAPMONSTER) then
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e3:SetCode(EFFECT_DISABLE_TRAPMONSTER)
e3:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e3)
end
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetCode(EFFECT_CANNOT_TRIGGER)
e4:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e4:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e4)
tc=g:GetNext()
end
end
\ No newline at end of file
--星葬零序龙
local cm,m,o=GetID()
if not pcall(function() require("expansions/script/c20000552") end) then require("script/c20000552") end
function cm.initial_effect(c)
local e1={fu_zeroth.same(c,m,cm.Zeroth_Effect)}
end
--Zeroth_Effect
function cm.Zeroth_Effect(c)
local e=Effect.CreateEffect(c)
e:SetDescription(aux.Stringid(m,0))
e:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e:SetCode(EVENT_SPSUMMON_SUCCESS)
e:SetProperty(EFFECT_FLAG_DELAY)
e:SetTarget(cm.Zeroth_Effect_tg)
e:SetOperation(cm.Zeroth_Effect_op)
return e
end
function cm.Zeroth_Effect_tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.Hint(HINT_OPSELECTED,1-tp,aux.Stringid(m,0))
end
function cm.Zeroth_Effect_op(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_SINGLE)
e1:SetCode(EFFECT_EXTRA_ATTACK)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE)
e1:SetValue(2)
c:RegisterEffect(e1)
end
\ No newline at end of file
--绝海零序龙
local cm,m,o=GetID()
if not pcall(function() require("expansions/script/c20000552") end) then require("script/c20000552") end
function cm.initial_effect(c)
local e1={fu_zeroth.same(c,m,cm.Zeroth_Effect)}
end
--Zeroth_Effect
function cm.Zeroth_Effect(c)
local e=Effect.CreateEffect(c)
e:SetDescription(aux.Stringid(m,0))
e:SetCategory(CATEGORY_DRAW)
e:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e:SetCode(EVENT_SPSUMMON_SUCCESS)
e:SetProperty(EFFECT_FLAG_DELAY)
e:SetTarget(cm.Zeroth_Effect_tg)
e:SetOperation(cm.Zeroth_Effect_op)
return e
end
function cm.Zeroth_Effect_tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local ht=Duel.GetFieldGroupCount(tp,LOCATION_HAND,0)
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(5-ht)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,5-ht)
Duel.Hint(HINT_OPSELECTED,1-tp,aux.Stringid(m,0))
end
function cm.Zeroth_Effect_op(e,tp,eg,ep,ev,re,r,rp)
local p=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER)
local ht=Duel.GetFieldGroupCount(p,LOCATION_HAND,0)
if ht<5 then
Duel.Draw(p,5-ht,REASON_EFFECT)
end
end
\ No newline at end of file
--狱炎零序龙
local cm,m,o=GetID()
if not pcall(function() require("expansions/script/c20000552") end) then require("script/c20000552") end
function cm.initial_effect(c)
local e1={fu_zeroth.same(c,m,cm.Zeroth_Effect)}
end
--Zeroth_Effect
function cm.Zeroth_Effect(c)
local e=Effect.CreateEffect(c)
e:SetDescription(aux.Stringid(m,0))
e:SetCategory(CATEGORY_DESTROY)
e:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e:SetCode(EVENT_SPSUMMON_SUCCESS)
e:SetProperty(EFFECT_FLAG_DELAY)
e:SetTarget(cm.Zeroth_Effect_tg)
e:SetOperation(cm.Zeroth_Effect_op)
return e
end
function cm.Zeroth_Effect_tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local sg=Duel.GetFieldGroup(tp,0,LOCATION_ONFIELD)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,sg,sg:GetCount(),0,0)
Duel.Hint(HINT_OPSELECTED,1-tp,aux.Stringid(m,0))
end
function cm.Zeroth_Effect_op(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local sg=Duel.GetFieldGroup(tp,0,LOCATION_ONFIELD)
local ct=Duel.Destroy(sg,REASON_EFFECT)
if ct>0 and c:IsFaceup() and c:IsRelateToEffect(e) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(ct*500)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE)
c:RegisterEffect(e1)
end
end
\ No newline at end of file
--死苑零序龙
local cm,m,o=GetID()
if not pcall(function() require("expansions/script/c20000552") end) then require("script/c20000552") end
function cm.initial_effect(c)
local e1={fu_zeroth.same(c,m,cm.Zeroth_Effect)}
end
--Zeroth_Effect
function cm.Zeroth_Effect(c)
local e=Effect.CreateEffect(c)
e:SetDescription(aux.Stringid(m,0))
e:SetCategory(CATEGORY_TODECK)
e:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e:SetCode(EVENT_SPSUMMON_SUCCESS)
e:SetProperty(EFFECT_FLAG_DELAY)
e:SetTarget(cm.Zeroth_Effect_tg)
e:SetOperation(cm.Zeroth_Effect_op)
return e
end
function cm.Zeroth_Effect_tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local sg=Duel.GetMatchingGroup(Card.IsAbleToDeck,tp,0,LOCATION_GRAVE,nil)
Duel.SetOperationInfo(0,CATEGORY_TODECK,sg,sg:GetCount(),0,0)
Duel.Hint(HINT_OPSELECTED,1-tp,aux.Stringid(m,0))
end
function cm.Zeroth_Effect_op(e,tp,eg,ep,ev,re,r,rp)
local sg=Duel.GetMatchingGroup(Card.IsAbleToDeck,tp,0,LOCATION_GRAVE,nil)
Duel.SendtoDeck(sg,nil,2,REASON_EFFECT)
end
\ No newline at end of file
--破坏龙神 基泽
local cm,m,o=GetID()
function cm.initial_effect(c)
c:EnableReviveLimit()
aux.AddFusionProcFunRep(c,aux.FilterBoolFunction(Card.IsRace,RACE_DRAGON),3,true)
--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)
e1:SetValue(aux.fuslimit)
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_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e2:SetRange(LOCATION_EXTRA)
e2:SetCondition(cm.con2)
e2:SetOperation(cm.op2)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e3:SetRange(LOCATION_MZONE)
e3:SetCode(EFFECT_SET_BASE_ATTACK)
e3:SetValue(cm.val3)
c:RegisterEffect(e3)
local e4=e3:Clone()
e4:SetCode(EFFECT_SET_BASE_DEFENSE)
c:RegisterEffect(e4)
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e5:SetCode(EVENT_SPSUMMON_SUCCESS)
e5:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e5:SetOperation(cm.op5)
c:RegisterEffect(e5)
end
--e2
function cm.conf21(c,fc)
return c:IsFusionSetCard(0xcfd5) and c:IsCanBeFusionMaterial(fc,SUMMON_TYPE_SPECIAL) and c:IsAbleToRemoveAsCost()
end
function cm.conf22(g)
return g:GetClassCount(Card.GetAttribute)==#g
end
function cm.con2(e,c)
if c==nil then return true end
local tp=c:GetControler()
local g=Duel.GetMatchingGroup(cm.conf21,tp,LOCATION_GRAVE,0,nil,c)
return g:CheckSubGroup(cm.conf22,6,6)
end
function cm.op2(e,tp,eg,ep,ev,re,r,rp,c)
local g=Duel.GetMatchingGroup(cm.conf21,tp,LOCATION_GRAVE,0,nil,c)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
g=g:SelectSubGroup(tp,cm.conf22,true,6,6,tp)
c:SetMaterial(g)
Duel.Remove(g,POS_FACEUP,REASON_COST)
g:DeleteGroup()
end
--e3
function cm.val3(e)
local n=0
for i=m-6,m-1,1 do
n=n+Duel.GetFlagEffect(0,i)+Duel.GetFlagEffect(1,i)
end
return n*700
end
--e4
function cm.op5(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e1:SetDescription(1104)
e1:SetCategory(CATEGORY_TOEXTRA+CATEGORY_SPECIAL_SUMMON)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetReset(RESET_EVENT+0x1ee0000+RESET_PHASE+PHASE_END)
e1:SetCondition(aux.SpiritReturnConditionForced)
e1:SetTarget(cm.op5tg)
e1:SetOperation(cm.op5op)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCondition(aux.SpiritReturnConditionOptional)
c:RegisterEffect(e2)
end
function cm.op5tgf(c,e,tp)
return c:IsSetCard(0xcfd5) and c:IsCanBeSpecialSummoned(e,0,tp,true,true) and c:IsFaceup()
end
function cm.op5tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
if e:IsHasType(EFFECT_TYPE_TRIGGER_F) then
return true
else
return Duel.GetMZoneCount(tp,e:GetHandler())>0 and Duel.IsExistingMatchingCard(cm.op5tgf,tp,LOCATION_REMOVED,0,1,nil,e,tp)
end
end
Duel.SetOperationInfo(0,CATEGORY_TOEXTRA,e:GetHandler(),1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,0,0)
end
function cm.op5op(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) or c:IsFacedown() then return end
Duel.SendtoDeck(c,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)
if c:IsLocation(LOCATION_EXTRA) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
c=Duel.SelectMatchingCard(tp,cm.op5tgf,tp,LOCATION_REMOVED,0,1,1,nil,e,tp):GetFirst()
if c and Duel.SpecialSummon(c,0,tp,tp,true,true,POS_FACEUP)>0 then
c:CompleteProcedure()
end
end
end
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment