Commit 554edd58 authored by POLYMER's avatar POLYMER

update 230926 2nd

parent dad45449
......@@ -5256,6 +5256,48 @@
4875078 0
33701122 0
45745915 0
98920054 0
12070000 0
12070001 0
12070002 0
12070003 0
12070004 0
12070005 0
12070006 0
65130475 0
77000501 0
77000502 0
77000503 0
77000504 0
77000505 0
77000506 0
77000508 0
77000509 0
77000510 0
77000511 0
77000512 0
77000513 0
77000515 0
77000516 0
77000517 0
77000518 0
77000519 0
77000520 0
77000521 0
77000522 0
77000523 0
77000524 0
77000525 0
77000526 0
77000527 0
77000528 0
77000529 0
77014514 0
77014515 0
98920146 0
98920215 0
98920253 0
98920273 0
#limit
33403513 1
82204250 1
......
No preview for this file type
No preview for this file type
expansions/pics/88880043.jpg

331 KB | W: | H:

expansions/pics/88880043.jpg

17.3 KB | W: | H:

expansions/pics/88880043.jpg
expansions/pics/88880043.jpg
expansions/pics/88880043.jpg
expansions/pics/88880043.jpg
  • 2-up
  • Swipe
  • Onion skin
......@@ -66,3 +66,13 @@ function cm.op(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,0,m)
end
end
if not require and Duel.LoadScript then
function require(str)
local name=str
for word in string.gmatch(str,"%w+") do
name=word
end
Duel.LoadScript(name..".lua")
return true
end
end
\ No newline at end of file
--parasomnia
--22.05.18
local m=11450000
local cm=_G["c"..m]
local cm,m=GetID()
local tableclone=function(tab,mytab)
local res=mytab or {}
for i,v in pairs(tab) do res[i]=v end
......@@ -34,7 +33,19 @@ function cm.initial_effect(c)
local e1=_Effect.CreateEffect(c)
c:RegisterEffect(e1)
end
function read111(tab)
for k,v in pairs(tab) do
Debug.Message(k)
local sel=Duel.SelectOption(0,aux.Stringid(m,0),aux.Stringid(m,1),aux.Stringid(m,2))
if sel==0 and aux.GetValueType(v)=="table" then
read111(v)
end
if sel==2 then return end
end
end
function cm.op(e,tp,eg,ep,ev,re,r,rp)
read111(package.loaded)
_Duel.Hint(HINT_CARD,0,m)
_Duel.Hint(HINT_MUSIC,0,aux.Stringid(m,1))
local ct0=_Duel.GetMatchingGroupCount(_Card.IsCode,0,0xff,0,nil,m)
......
......@@ -187,7 +187,7 @@ function cm.scop(e,tp,eg,ep,ev,re,r,rp)
end
local A=1103515245
local B=12345
local M=32767
local M=1073741824 --32767
function cm.roll(min,max)
min=tonumber(min)
max=tonumber(max)
......@@ -280,6 +280,7 @@ function cm.spop(e,tp,eg,ep,ev,re,r,rp)
end
end
table.insert(tab1,ac)
table.insert(cm.blacklist,ac)
ac=nil
end
for i=1,ct1 do
......@@ -356,6 +357,7 @@ function cm.spop(e,tp,eg,ep,ev,re,r,rp)
end
end
table.insert(tab2,ac)
table.insert(cm.blacklist,ac)
ac=nil
end
for i=1,ct2 do
......
......@@ -89,7 +89,9 @@ function cm.actarget(e,te,tp)
end
function cm.costop(e,tp,eg,ep,ev,re,r,rp)
local te=e:GetLabelObject()
Duel.MoveToField(e:GetHandler(),tp,tp,LOCATION_SZONE,POS_FACEUP,false)
local loc=LOCATION_SZONE
if e:GetHandler():IsType(TYPE_FIELD) then loc=LOCATION_FZONE end
Duel.MoveToField(e:GetHandler(),tp,tp,loc,POS_FACEUP,false)
cm.activate_sequence[te]=e:GetHandler():GetSequence()
e:GetHandler():CreateEffectRelation(te)
local c=e:GetHandler()
......
......@@ -61,16 +61,19 @@ function c11561016.hxop(e,tp,eg,ep,ev,re,r,rp)
local d=math.floor(flag/4)
local chk=0
local a=0
local msg=Group.CreateGroup()
for i=1,d do
if chk==0 and g:IsExists(Card.IsAbleToHand,1,nil) and Duel.SelectYesNo(tp,aux.Stringid(11561016,0)) then
local sg=g:Filter(Card.IsAbleToHand,nil):Select(tp,1,1,nil)
Duel.SendtoHand(sg,tp,REASON_EFFECT)
Duel.ConfirmCards(1-tp,sg)
g:Sub(sg)
msg:Merge(sg)
a=a+1
else
chk=1
end
end
Duel.SendtoHand(msg,tp,REASON_EFFECT)
Duel.ConfirmCards(1-tp,msg)
if a>0 and Duel.IsExistingMatchingCard(Card.IsAbleToDeck,tp,LOCATION_HAND,0,a,nil) then
Duel.BreakEffect()
local sg=Duel.SelectMatchingCard(tp,Card.IsAbleToDeck,tp,LOCATION_HAND,0,a,a,nil)
......
......@@ -78,19 +78,19 @@ end
function cm.spcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetFlagEffect(m)>0
end
function cm.lvfilter(c)
function cm.lvfilter1(c)
return c:IsFaceup() and (c:IsType(TYPE_RITUAL) or c:IsSetCard(0x154))
and c:IsLevelAbove(1)
end
function cm.lvtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and cm.lvfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(cm.lvfilter,tp,LOCATION_MZONE,0,2,nil) end
if chk==0 then return Duel.IsExistingTarget(cm.lvfilter1,tp,LOCATION_MZONE,0,2,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
Duel.SelectTarget(tp,cm.lvfilter,tp,LOCATION_MZONE,0,2,99,nil)
Duel.SelectTarget(tp,cm.lvfilter1,tp,LOCATION_MZONE,0,2,99,nil)
end
function cm.lvop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(cm.lvfilter,nil,e)
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(cm.lvfilter1,nil,e)
Duel.Hint(HINT_SELECTMSG,tp,HINGMSG_LVRANK)
local lv=Duel.AnnounceLevel(tp,1,12)
local tc=g:GetFirst()
......
......@@ -160,19 +160,7 @@ function cm.mtop(e,tp,eg,ep,ev,re,r,rp)
local dgc=dg:GetFirst()
while dgc do
if dgc:GetCounter(0x1161)<=0 then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(cm.atkva)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
dgc:RegisterEffect(e1)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e3:SetRange(LOCATION_MZONE)
e3:SetCode(EFFECT_SELF_DESTROY)
e3:SetCondition(cm.descon)
dgc:RegisterEffect(e3)
cm.counter(dgc,c)
end
dgc:AddCounter(0x1161,1,REASON_EFFECT)
dgc=dg:GetNext()
......
--永燃的薪炎 薪炎之律者
function c12070000.initial_effect(c)
c:SetUniqueOnField(1,0,12070000)
--xyz summon
aux.AddXyzProcedure(c,nil,7,5,c12070000.ovfilter,aux.Stringid(12070000,0))
c:EnableReviveLimit()
--ov
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(12070000,5))
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetTarget(c12070000.ovtg)
e1:SetOperation(c12070000.ovop)
c:RegisterEffect(e1)
--to deck
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_TOEXTRA)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL+EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_LEAVE_FIELD)
e2:SetCondition(c12070000.tdcon)
e2:SetTarget(c12070000.tdtg)
e2:SetOperation(c12070000.tdop)
c:RegisterEffect(e2)
--xx
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
e3:SetCountLimit(1,32070000)
e3:SetCondition(c12070000.xxcon)
e3:SetOperation(c12070000.xxop)
c:RegisterEffect(e3)
end
c12070000.SetCard_NeoK_Flame=true
function c12070000.ovfilter(c)
return c.SetCard_NeoK_Flame and c:IsLevel(7) and c:IsFaceup()
end
function c12070000.ovfil(c)
return c.SetCard_NeoK_Flame and c:IsCanOverlay()
end
function c12070000.ovtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c12070000.ovfil,tp,LOCATION_GRAVE,0,1,nil) end
Duel.SetChainLimit(c12070000.chlimit)
end
function c12070000.chlimit(e,ep,tp)
return tp==ep
end
function c12070000.ovop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetMatchingGroup(c12070000.ovfil,tp,LOCATION_GRAVE,0,nil)
if c:IsRelateToEffect(e) and c:IsFaceup() and g:GetCount()>0 then
Duel.Overlay(c,g)
end
end
function c12070000.tdcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:GetReasonPlayer()==1-tp and c:IsSummonType(SUMMON_TYPE_XYZ)
end
function c12070000.tdtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToExtra() end
Duel.SetOperationInfo(0,CATEGORY_TOEXTRA,e:GetHandler(),1,0,0)
end
function c12070000.tdop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.SendtoDeck(c,nil,2,REASON_EFFECT)
end
end
function c12070000.xxcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_XYZ)
end
function c12070000.xxop(e,tp,eg,ep,ev,re,r,rp)
Duel.HintSelection(Group.FromCards(e:GetHandler()))
Duel.Hint(HINT_CARD,0,12070000)
Duel.Hint(HINT_MESSAGE,0,aux.Stringid(12070000,1))
Duel.Hint(HINT_MESSAGE,1,aux.Stringid(12070000,1))
Duel.Hint(HINT_MESSAGE,0,aux.Stringid(12070000,2))
Duel.Hint(HINT_MESSAGE,1,aux.Stringid(12070000,2))
Duel.Hint(HINT_MESSAGE,0,aux.Stringid(12070000,3))
Duel.Hint(HINT_MESSAGE,1,aux.Stringid(12070000,3))
end
--永燃的薪炎 无名游侠的旅途
function c12070001.initial_effect(c)
--summon with no tribute
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(12070001,0))
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SUMMON_PROC)
e1:SetCondition(c12070001.ntcon)
c:RegisterEffect(e1)
--Gains Effect
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(c12070001.efcon)
e2:SetOperation(c12070001.efop)
c:RegisterEffect(e2)
end
c12070001.SetCard_NeoK_Flame=true
function c12070001.cfilter(c)
return c:IsFaceup() and c.SetCard_NeoK_Flame
end
function c12070001.ntcon(e,c,minc)
if c==nil then return true end
return minc==0 and c:IsLevelAbove(5) and Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>0 and not Duel.IsExistingMatchingCard(c12070001.cfilter,c:GetControler(),LOCATION_MZONE,0,1,nil)
end
function c12070001.efcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return r==REASON_XYZ and c:GetReasonCard().SetCard_NeoK_Flame and c:GetReasonCard():IsType(TYPE_XYZ)
end
function c12070001.efop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local rc=c:GetReasonCard()
local e1=Effect.CreateEffect(rc)
e1:SetDescription(aux.Stringid(12070001,1))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_TRIGGER_O+EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetTarget(c12070001.thtg)
e1:SetOperation(c12070001.thop)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
rc:RegisterEffect(e1,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
function c12070001.thfilter(c)
return c.SetCard_NeoK_Flame and (c:IsAbleToHand() or c:IsCanOverlay())
end
function c12070001.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c12070001.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
end
function c12070001.thop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.SelectMatchingCard(tp,c12070001.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
local tc=g:GetFirst()
local op=0
if tc:IsAbleToHand() and tc:IsCanOverlay() then
op=Duel.SelectOption(tp,aux.Stringid(12070001,2),aux.Stringid(12070001,3))
elseif tc:IsAbleToHand() then
op=Duel.SelectOption(tp,aux.Stringid(12070001,2))
elseif tc:IsCanOverlay() then
op=Duel.SelectOption(tp,aux.Stringid(12070001,3))+1
end
if op==0 then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tc)
elseif op==1 then
if c:IsRelateToEffect(e) and c:IsFaceup() then
Duel.Overlay(c,tc)
end
end
end
end
--永燃的薪炎 遗世火鸟的燃羽
function c12070002.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,12070002)
e1:SetCost(c12070002.cost)
e1:SetTarget(c12070002.target)
e1:SetOperation(c12070002.operation)
c:RegisterEffect(e1)
--remove
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(12070002,1))
e2:SetCategory(CATEGORY_REMOVE)
e2:SetType(EFFECT_TYPE_XMATERIAL+EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_MZONE)
e2:SetCost(c12070002.rmcost)
e2:SetTarget(c12070002.rmtg)
e2:SetOperation(c12070002.rmop)
c:RegisterEffect(e2)
--damage
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_XMATERIAL+EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EVENT_CHAINING)
e3:SetRange(LOCATION_MZONE)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e3:SetOperation(c12070002.regop)
c:RegisterEffect(e3)
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_XMATERIAL+EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e4:SetCode(EVENT_CHAIN_SOLVED)
e4:SetRange(LOCATION_MZONE)
e4:SetCondition(c12070002.damcon)
e4:SetOperation(c12070002.damop)
c:RegisterEffect(e4)
end
c12070002.SetCard_NeoK_Flame=true
function c12070002.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckLPCost(tp,500) end
Duel.PayLPCost(tp,500)
end
function c12070002.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>4 end
end
function c12070002.filter(c)
return c.SetCard_NeoK_Flame and c:IsAbleToHand()
end
function c12070002.operation(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)==0 then return end
Duel.ConfirmDecktop(tp,5)
local g=Duel.GetDecktopGroup(tp,5):Filter(c12070002.filter,nil)
if g:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(12070002,0)) then
local sg=g:Select(tp,1,1,nil)
Duel.ConfirmCards(1-tp,sg)
Duel.SendtoHand(sg,tp,REASON_EFFECT)
end
Duel.ShuffleDeck(tp)
end
function c12070002.rmcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST)
end
function c12070002.rmtg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return e:GetHandler().SetCard_NeoK_Flame and e:GetHandler():IsType(TYPE_XYZ) and (Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2) and c:IsAbleToRemove() and c:GetFlagEffect(12070002)==0 and Duel.IsPlayerCanDraw(tp,1) end
c:RegisterFlagEffect(12070002,RESET_CHAIN,0,1)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,e:GetHandler(),1,0,0)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end
function c12070002.rmop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsFaceup() and c:IsRelateToEffect(e) then
local pos=c:GetPosition()
Duel.Remove(c,0,REASON_EFFECT+REASON_TEMPORARY)
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(c)
e1:SetLabel(pos)
e1:SetCountLimit(1)
e1:SetOperation(c12070002.xretop)
Duel.RegisterEffect(e1,tp)
if Duel.IsPlayerCanDraw(tp,1) then
Duel.BreakEffect()
Duel.Draw(tp,1,REASON_EFFECT)
end
end
end
function c12070002.xretop(e,tp,eg,ep,ev,re,r,rp)
local pos=e:GetLabel()
Duel.Hint(HINT_CARD,0,12070002)
Duel.MoveToField(e:GetLabelObject(),tp,tp,LOCATION_MZONE,pos,true)
end
function c12070002.regop(e,tp,eg,ep,ev,re,r,rp)
e:GetHandler():RegisterFlagEffect(12070002,RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET+RESET_CHAIN,0,1)
end
function c12070002.damcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return ep~=tp and c:GetFlagEffect(12070002)~=0 and e:GetHandler().SetCard_NeoK_Flame and e:GetHandler():IsType(TYPE_XYZ)
end
function c12070002.damop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,0,12070002)
Duel.Damage(1-tp,500,REASON_EFFECT)
end
--永燃的薪炎 淬火骑士的剑袭
function c12070003.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,12070003)
e1:SetCost(c12070003.cost)
e1:SetTarget(c12070003.target)
e1:SetOperation(c12070003.operation)
c:RegisterEffect(e1)
--dam
--local e2=Effect.CreateEffect(c)
--e2:SetDescription(aux.Stringid(12070003,1))
--e2:SetCategory(CATEGORY_DAMAGE)
--e2:SetType(EFFECT_TYPE_XMATERIAL+EFFECT_TYPE_QUICK_O)
--e2:SetCode(EVENT_CHAINING)
--e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
--e2:SetRange(LOCATION_MZONE)
--e2:SetCountLimit(1)
--e2:SetCondition(c12070003.damcon)
--e2:SetCost(c12070003.damcost)
--e2:SetTarget(c12070003.damtg)
--e2:SetOperation(c12070003.damop)
--c:RegisterEffect(e2)
--all
--local e3=Effect.CreateEffect(c)
--e3:SetType(EFFECT_TYPE_XMATERIAL)
--e3:SetCode(EFFECT_ATTACK_ALL)
--e3:SetValue(1)
--e3:SetCondition(c12070003.alcon)
--c:RegisterEffect(e3)
--atk
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_XMATERIAL)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetRange(LOCATION_MZONE)
e2:SetCondition(function(e)
return e:GetHandler().SetCard_NeoK_Flame and e:GetHandler():IsType(TYPE_XYZ) end)
e2:SetValue(function(e,c)
return c:GetOverlayCount()*100 end)
c:RegisterEffect(e2)
--dam cal
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_QUICK_O+EFFECT_TYPE_XMATERIAL)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1)
e3:SetCondition(function(e)
return e:GetHandler().SetCard_NeoK_Flame and e:GetHandler():IsType(TYPE_XYZ) end)
e3:SetCost(c12070003.damccost)
e3:SetTarget(c12070003.damctg)
e3:SetOperation(c12070003.damcop)
c:RegisterEffect(e3)
end
c12070003.SetCard_NeoK_Flame=true
function c12070003.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckLPCost(tp,500) end
Duel.PayLPCost(tp,500)
end
function c12070003.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>4 end
end
function c12070003.filter(c)
return c.SetCard_NeoK_Flame and c:IsAbleToHand()
end
function c12070003.operation(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)==0 then return end
Duel.ConfirmDecktop(tp,5)
local g=Duel.GetDecktopGroup(tp,5):Filter(c12070003.filter,nil)
if g:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(12070003,0)) then
local sg=g:Select(tp,1,1,nil)
Duel.ConfirmCards(1-tp,sg)
Duel.SendtoHand(sg,tp,REASON_EFFECT)
end
Duel.ShuffleDeck(tp)
end
function c12070003.damcon(e,tp,eg,ep,ev,re,r,rp)
return rp==1-tp and re:IsActiveType(TYPE_MONSTER) and not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) and bit.band(re:GetActivateLocation(),LOCATION_MZONE)~=0
end
function c12070003.damcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST)
end
function c12070003.damtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler().SetCard_NeoK_Flame and e:GetHandler():IsType(TYPE_XYZ) and re:GetHandler():GetBaseAttack()>0 end
local atk=re:GetHandler():GetBaseAttack()
Duel.SetTargetPlayer(1-tp)
Duel.SetTargetParam(atk)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,atk)
end
function c12070003.damop(e,tp,eg,ep,ev,re,r,rp)
local atk=re:GetHandler():GetBaseAttack()
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Damage(p,atk,REASON_EFFECT)
end
function c12070003.alcon(e)
local tp=e:GetHandlerPlayer()
return e:GetHandler().SetCard_NeoK_Flame and e:GetHandler():IsType(TYPE_XYZ) and Duel.GetLP(tp)<=Duel.GetLP(1-tp)
end
function c12070003.damccost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST)
end
function c12070003.damctg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingTarget(nil,tp,0,LOCATION_MZONE,1,nil) end
local g=Duel.SelectTarget(tp,nil,tp,0,LOCATION_MZONE,1,1,nil)
end
function c12070003.damcop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if c:IsRelateToEffect(e) and tc:IsRelateToEffect(e) then
Duel.CalculateDamage(c,tc)
end
end
--永燃的薪炎 烈焰圣歌的誓约
function c12070004.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,12070004)
e1:SetCost(c12070004.cost)
e1:SetTarget(c12070004.target)
e1:SetOperation(c12070004.operation)
c:RegisterEffect(e1)
--destroy replace
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_XMATERIAL+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EFFECT_DESTROY_REPLACE)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetRange(LOCATION_MZONE)
e2:SetTarget(c12070004.reptg)
c:RegisterEffect(e2)
--atk
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_XMATERIAL)
e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e3:SetRange(LOCATION_MZONE)
e3:SetCode(EFFECT_UPDATE_ATTACK)
e3:SetCondition(c12070004.atkcon)
e3:SetValue(c12070004.atkval)
c:RegisterEffect(e3)
end
c12070004.SetCard_NeoK_Flame=true
function c12070004.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckLPCost(tp,500) end
Duel.PayLPCost(tp,500)
end
function c12070004.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>4 end
end
function c12070004.filter(c)
return c.SetCard_NeoK_Flame and c:IsAbleToHand()
end
function c12070004.operation(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)==0 then return end
Duel.ConfirmDecktop(tp,5)
local g=Duel.GetDecktopGroup(tp,5):Filter(c12070004.filter,nil)
if g:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(12070004,0)) then
local sg=g:Select(tp,1,1,nil)
Duel.ConfirmCards(1-tp,sg)
Duel.SendtoHand(sg,tp,REASON_EFFECT)
end
Duel.ShuffleDeck(tp)
end
function c12070004.reptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return e:GetHandler().SetCard_NeoK_Flame and e:GetHandler():IsType(TYPE_XYZ) and c:IsReason(REASON_BATTLE+REASON_EFFECT) and not c:IsReason(REASON_REPLACE) and c:CheckRemoveOverlayCard(tp,1,REASON_EFFECT) end
if Duel.SelectEffectYesNo(tp,e:GetHandler(),96) then
c:RemoveOverlayCard(tp,1,1,REASON_EFFECT)
return true
else return false end
end
function c12070004.atkcon(e)
local tp=e:GetHandlerPlayer()
return e:GetHandler().SetCard_NeoK_Flame and e:GetHandler():IsType(TYPE_XYZ) and Duel.GetLP(tp)<=Duel.GetLP(1-tp)
end
function c12070004.atkval(e,c)
return c:GetOverlayCount()*500
end
--永燃的薪炎 薪炎王剑的凯旋
function c12070005.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,12070005)
e1:SetCost(c12070005.cost)
e1:SetTarget(c12070005.target)
e1:SetOperation(c12070005.operation)
c:RegisterEffect(e1)
--destroy
--local e2=Effect.CreateEffect(c)
--e2:SetDescription(aux.Stringid(12070005,1))
--e2:SetCategory(CATEGORY_DESTROY)
--e2:SetType(EFFECT_TYPE_XMATERIAL+EFFECT_TYPE_IGNITION)
--e2:SetRange(LOCATION_MZONE)
--e2:SetCountLimit(1)
--e2:SetCost(c12070005.descost)
--e2:SetTarget(c12070005.destg)
--e2:SetOperation(c12070005.desop)
--c:RegisterEffect(e2)
--dam
--local e3=Effect.CreateEffect(c)
--e3:SetDescription(aux.Stringid(12070005,2))
--e3:SetCategory(CATEGORY_DAMAGE+CATEGORY_NEGATE)
--e3:SetType(EFFECT_TYPE_XMATERIAL+EFFECT_TYPE_QUICK_O)
--e3:SetCode(EVENT_CHAINING)
--e3:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
--e3:SetRange(LOCATION_MZONE)
--e3:SetCountLimit(1)
--e3:SetCondition(c12070005.damcon)
--e3:SetCost(c12070005.damcost)
--e3:SetTarget(c12070005.damtg)
--e3:SetOperation(c12070005.damop)
--c:RegisterEffect(e3)
--atk
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_XMATERIAL)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetRange(LOCATION_MZONE)
e2:SetCondition(function(e)
return e:GetHandler().SetCard_NeoK_Flame and e:GetHandler():IsType(TYPE_XYZ) end)
e2:SetValue(function(e,c)
return c:GetOverlayCount()*100 end)
c:RegisterEffect(e2)
--destroy
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_DESTROY)
e3:SetType(EFFECT_TYPE_IGNITION+EFFECT_TYPE_XMATERIAL)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1)
e3:SetCondition(function(e)
return e:GetHandler().SetCard_NeoK_Flame and e:GetHandler():IsType(TYPE_XYZ) end)
e3:SetCost(c12070005.xdescost)
e3:SetTarget(c12070005.xdestg)
e3:SetOperation(c12070005.xdesop)
c:RegisterEffect(e3)
end
c12070005.SetCard_NeoK_Flame=true
function c12070005.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckLPCost(tp,500) end
Duel.PayLPCost(tp,500)
end
function c12070005.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>4 end
end
function c12070005.filter(c)
return c.SetCard_NeoK_Flame and c:IsAbleToHand()
end
function c12070005.operation(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)==0 then return end
Duel.ConfirmDecktop(tp,5)
local g=Duel.GetDecktopGroup(tp,5):Filter(c12070005.filter,nil)
if g:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(12070005,0)) then
local sg=g:Select(tp,1,1,nil)
Duel.ConfirmCards(1-tp,sg)
Duel.SendtoHand(sg,tp,REASON_EFFECT)
end
Duel.ShuffleDeck(tp)
end
function c12070005.desfil(c,atk)
return c:IsFaceup() and c:IsAttackBelow(atk) and c:IsSummonType(SUMMON_TYPE_SPECIAL)
end
function c12070005.descost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.PayLPCost(tp,math.floor(Duel.GetLP(tp)/2))
end
function c12070005.destg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.IsExistingMatchingCard(c12070005.desfil,tp,LOCATION_MZONE,LOCATION_MZONE,1,c,c:GetAttack()) end
local g=Duel.GetMatchingGroup(c12070005.desfil,tp,LOCATION_MZONE,LOCATION_MZONE,c,c:GetAttack())
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0)
end
function c12070005.desop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and c:IsFaceup() then
local g=Duel.GetMatchingGroup(c12070005.desfil,tp,LOCATION_MZONE,LOCATION_MZONE,aux.ExceptThisCard(e),c:GetAttack())
Duel.Destroy(g,REASON_EFFECT)
end
end
function c12070005.damcon(e,tp,eg,ep,ev,re,r,rp)
return rp==1-tp and re:IsActiveType(TYPE_MONSTER) and not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) and bit.band(re:GetActivateLocation(),LOCATION_MZONE)~=0 and Duel.IsChainNegatable(ev)
end
function c12070005.damcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST)
end
function c12070005.damtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler().SetCard_NeoK_Flame and e:GetHandler():IsType(TYPE_XYZ) end
local atk=re:GetHandler():GetBaseAttack()
Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,atk)
end
function c12070005.damop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.NegateActivation(ev) then
local atk=re:GetHandler():GetBaseAttack()
Duel.Damage(1-tp,atk,REASON_EFFECT)
end
end
function c12070005.xdescost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.PayLPCost(tp,Duel.GetLP(tp)/2)
end
function c12070005.xdesfilter(c,atk)
return c:IsFaceup() and c:IsAttackBelow(atk) and c:IsSummonType(SUMMON_TYPE_SPECIAL)
end
function c12070005.xdestg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.IsExistingMatchingCard(c12070005.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,c,c:GetAttack()) end
local g=Duel.GetMatchingGroup(c12070005.xdesfilter,tp,LOCATION_MZONE,LOCATION_MZONE,c,c:GetAttack())
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0)
end
function c12070005.xdesop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) or c:IsFacedown() then return end
local g=Duel.GetMatchingGroup(c12070005.xdesfilter,tp,LOCATION_MZONE,LOCATION_MZONE,aux.ExceptThisCard(e),c:GetAttack())
if g:GetCount()>0 then
Duel.Destroy(g,REASON_EFFECT)
end
end
--永燃的薪炎 燎原炎车的狼烟
function c12070006.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,12070006)
e1:SetCost(c12070006.cost)
e1:SetTarget(c12070006.target)
e1:SetOperation(c12070006.operation)
c:RegisterEffect(e1)
--atk up
--local e2=Effect.CreateEffect(c)
--e2:SetCategory(CATEGORY_ATKCHANGE)
--e2:SetType(EFFECT_TYPE_XMATERIAL+EFFECT_TYPE_QUICK_O)
--e2:SetRange(LOCATION_MZONE)
--e2:SetCode(EVENT_PRE_DAMAGE_CALCULATE)
--e2:SetCondition(c12070006.atkcon)
--e2:SetCost(c12070006.atkcost)
--e2:SetOperation(c12070006.atkop)
--c:RegisterEffect(e2)
--immune
--local e3=Effect.CreateEffect(c)
--e3:SetType(EFFECT_TYPE_XMATERIAL)
--e3:SetCode(EFFECT_IMMUNE_EFFECT)
--e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
--e3:SetRange(LOCATION_MZONE)
--e3:SetCondition(c12070006.imcon)
--e3:SetValue(c12070006.efilter)
--c:RegisterEffect(e3)
--atk
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_XMATERIAL)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetRange(LOCATION_MZONE)
e2:SetCondition(function(e)
return e:GetHandler().SetCard_NeoK_Flame and e:GetHandler():IsType(TYPE_XYZ) end)
e2:SetValue(function(e,c)
return c:GetOverlayCount()*100 end)
c:RegisterEffect(e2)
--negate
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(12070006,1))
e3:SetCategory(CATEGORY_NEGATE)
e3:SetType(EFFECT_TYPE_QUICK_O+EFFECT_TYPE_XMATERIAL)
e3:SetCode(EVENT_CHAINING)
e3:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1)
e3:SetCondition(c12070006.discon)
e3:SetCost(c12070006.discost)
e3:SetTarget(c12070006.distg)
e3:SetOperation(c12070006.disop)
c:RegisterEffect(e3)
end
c12070006.SetCard_NeoK_Flame=true
function c12070006.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckLPCost(tp,500) end
Duel.PayLPCost(tp,500)
end
function c12070006.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>4 end
end
function c12070006.filter(c)
return c.SetCard_NeoK_Flame and c:IsAbleToHand()
end
function c12070006.operation(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)==0 then return end
Duel.ConfirmDecktop(tp,5)
local g=Duel.GetDecktopGroup(tp,5):Filter(c12070006.filter,nil)
if g:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(12070006,0)) then
local sg=g:Select(tp,1,1,nil)
Duel.ConfirmCards(1-tp,sg)
Duel.SendtoHand(sg,tp,REASON_EFFECT)
end
Duel.ShuffleDeck(tp)
end
function c12070006.atkcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local bc=c:GetBattleTarget()
return bc and bc:IsSummonType(SUMMON_TYPE_SPECIAL) and bc:GetAttack()>0 and e:GetHandler().SetCard_NeoK_Flame and e:GetHandler():IsType(TYPE_XYZ)
end
function c12070006.atkcost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:GetFlagEffect(12070006)==0 and e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST)
c:RegisterFlagEffect(12070006,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_DAMAGE_CAL,0,1)
end
function c12070006.atkop(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 c12070006.imcon(e)
local tp=e:GetHandlerPlayer()
return e:GetHandler().SetCard_NeoK_Flame and e:GetHandler():IsType(TYPE_XYZ) and Duel.GetLP(tp)<=Duel.GetLP(1-tp)
end
function c12070006.efilter(e,te)
return te:GetOwnerPlayer()~=e:GetOwnerPlayer() and te:IsActivated()
end
function c12070006.discon(e,tp,eg,ep,ev,re,r,rp)
return rp==1-tp and not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) and Duel.IsChainNegatable(ev) and re:GetHandler():IsOnField() and re:IsActiveType(TYPE_MONSTER) and e:GetHandler().SetCard_NeoK_Flame and e:GetHandler():IsType(TYPE_XYZ)
end
function c12070006.discost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST)
end
function c12070006.distg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0)
end
function c12070006.disop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local atk=re:GetHandler():GetBaseAttack()
if Duel.NegateActivation(ev) and atk and atk>0 then
Duel.Damage(1-tp,atk,REASON_EFFECT)
end
end
--永燃的薪炎 淬火骑士的剑袭
function c12071003.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,12071003)
e1:SetCost(c12071003.cost)
e1:SetTarget(c12071003.target)
e1:SetOperation(c12071003.operation)
c:RegisterEffect(e1)
--dam
--local e2=Effect.CreateEffect(c)
--e2:SetDescription(aux.Stringid(12071003,1))
--e2:SetCategory(CATEGORY_DAMAGE)
--e2:SetType(EFFECT_TYPE_XMATERIAL+EFFECT_TYPE_QUICK_O)
--e2:SetCode(EVENT_CHAINING)
--e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
--e2:SetRange(LOCATION_MZONE)
--e2:SetCountLimit(1)
--e2:SetCondition(c12071003.damcon)
--e2:SetCost(c12071003.damcost)
--e2:SetTarget(c12071003.damtg)
--e2:SetOperation(c12071003.damop)
--c:RegisterEffect(e2)
--all
--local e3=Effect.CreateEffect(c)
--e3:SetType(EFFECT_TYPE_XMATERIAL)
--e3:SetCode(EFFECT_ATTACK_ALL)
--e3:SetValue(1)
--e3:SetCondition(c12071003.alcon)
--c:RegisterEffect(e3)
--atk
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_XMATERIAL)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetRange(LOCATION_MZONE)
e2:SetCondition(function(e)
return e:GetHandler().SetCard_NeoK_Flame and e:GetHandler():IsType(TYPE_XYZ) end)
e2:SetValue(function(e,c)
return c:GetOverlayCount()*100 end)
c:RegisterEffect(e2)
--dam cal
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_QUICK_O+EFFECT_TYPE_XMATERIAL)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1)
e3:SetCondition(function(e)
return e:GetHandler().SetCard_NeoK_Flame and e:GetHandler():IsType(TYPE_XYZ) end)
e3:SetCost(c12071003.damccost)
e3:SetTarget(c12071003.damctg)
e3:SetOperation(c12071003.damcop)
c:RegisterEffect(e3)
end
c12071003.SetCard_NeoK_Flame=true
function c12071003.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckLPCost(tp,500) end
Duel.PayLPCost(tp,500)
end
function c12071003.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>4 end
end
function c12071003.filter(c)
return c.SetCard_NeoK_Flame and c:IsAbleToHand()
end
function c12071003.operation(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)==0 then return end
Duel.ConfirmDecktop(tp,5)
local g=Duel.GetDecktopGroup(tp,5):Filter(c12071003.filter,nil)
if g:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(12071003,0)) then
local sg=g:Select(tp,1,1,nil)
Duel.ConfirmCards(1-tp,sg)
Duel.SendtoHand(sg,tp,REASON_EFFECT)
end
Duel.ShuffleDeck(tp)
end
function c12071003.damcon(e,tp,eg,ep,ev,re,r,rp)
return rp==1-tp and re:IsActiveType(TYPE_MONSTER) and not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) and bit.band(re:GetActivateLocation(),LOCATION_MZONE)~=0
end
function c12071003.damcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST)
end
function c12071003.damtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler().SetCard_NeoK_Flame and e:GetHandler():IsType(TYPE_XYZ) and re:GetHandler():GetBaseAttack()>0 end
local atk=re:GetHandler():GetBaseAttack()
Duel.SetTargetPlayer(1-tp)
Duel.SetTargetParam(atk)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,atk)
end
function c12071003.damop(e,tp,eg,ep,ev,re,r,rp)
local atk=re:GetHandler():GetBaseAttack()
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Damage(p,atk,REASON_EFFECT)
end
function c12071003.alcon(e)
local tp=e:GetHandlerPlayer()
return e:GetHandler().SetCard_NeoK_Flame and e:GetHandler():IsType(TYPE_XYZ) and Duel.GetLP(tp)<=Duel.GetLP(1-tp)
end
function c12071003.damccost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST)
end
function c12071003.damctg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingTarget(nil,tp,0,LOCATION_MZONE,1,nil) end
local g=Duel.SelectTarget(tp,nil,tp,0,LOCATION_MZONE,1,1,nil)
end
function c12071003.damcop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if c:IsRelateToEffect(e) and tc:IsRelateToEffect(e) then
Duel.CalculateDamage(c,tc)
end
end
--永燃的薪炎 薪炎王剑的凯旋
function c12071005.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,12071005)
e1:SetCost(c12071005.cost)
e1:SetTarget(c12071005.target)
e1:SetOperation(c12071005.operation)
c:RegisterEffect(e1)
--destroy
--local e2=Effect.CreateEffect(c)
--e2:SetDescription(aux.Stringid(12071005,1))
--e2:SetCategory(CATEGORY_DESTROY)
--e2:SetType(EFFECT_TYPE_XMATERIAL+EFFECT_TYPE_IGNITION)
--e2:SetRange(LOCATION_MZONE)
--e2:SetCountLimit(1)
--e2:SetCost(c12071005.descost)
--e2:SetTarget(c12071005.destg)
--e2:SetOperation(c12071005.desop)
--c:RegisterEffect(e2)
--dam
--local e3=Effect.CreateEffect(c)
--e3:SetDescription(aux.Stringid(12071005,2))
--e3:SetCategory(CATEGORY_DAMAGE+CATEGORY_NEGATE)
--e3:SetType(EFFECT_TYPE_XMATERIAL+EFFECT_TYPE_QUICK_O)
--e3:SetCode(EVENT_CHAINING)
--e3:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
--e3:SetRange(LOCATION_MZONE)
--e3:SetCountLimit(1)
--e3:SetCondition(c12071005.damcon)
--e3:SetCost(c12071005.damcost)
--e3:SetTarget(c12071005.damtg)
--e3:SetOperation(c12071005.damop)
--c:RegisterEffect(e3)
--atk
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_XMATERIAL)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetRange(LOCATION_MZONE)
e2:SetCondition(function(e)
return e:GetHandler().SetCard_NeoK_Flame and e:GetHandler():IsType(TYPE_XYZ) end)
e2:SetValue(function(e,c)
return c:GetOverlayCount()*100 end)
c:RegisterEffect(e2)
--destroy
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_DESTROY)
e3:SetType(EFFECT_TYPE_IGNITION+EFFECT_TYPE_XMATERIAL)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1)
e3:SetCondition(function(e)
return e:GetHandler().SetCard_NeoK_Flame and e:GetHandler():IsType(TYPE_XYZ) end)
e3:SetCost(c12071005.xdescost)
e3:SetTarget(c12071005.xdestg)
e3:SetOperation(c12071005.xdesop)
c:RegisterEffect(e3)
end
c12071005.SetCard_NeoK_Flame=true
function c12071005.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckLPCost(tp,500) end
Duel.PayLPCost(tp,500)
end
function c12071005.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>4 end
end
function c12071005.filter(c)
return c.SetCard_NeoK_Flame and c:IsAbleToHand()
end
function c12071005.operation(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)==0 then return end
Duel.ConfirmDecktop(tp,5)
local g=Duel.GetDecktopGroup(tp,5):Filter(c12071005.filter,nil)
if g:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(12071005,0)) then
local sg=g:Select(tp,1,1,nil)
Duel.ConfirmCards(1-tp,sg)
Duel.SendtoHand(sg,tp,REASON_EFFECT)
end
Duel.ShuffleDeck(tp)
end
function c12071005.desfil(c,atk)
return c:IsFaceup() and c:IsAttackBelow(atk) and c:IsSummonType(SUMMON_TYPE_SPECIAL)
end
function c12071005.descost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.PayLPCost(tp,math.floor(Duel.GetLP(tp)/2))
end
function c12071005.destg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.IsExistingMatchingCard(c12071005.desfil,tp,LOCATION_MZONE,LOCATION_MZONE,1,c,c:GetAttack()) end
local g=Duel.GetMatchingGroup(c12071005.desfil,tp,LOCATION_MZONE,LOCATION_MZONE,c,c:GetAttack())
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0)
end
function c12071005.desop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and c:IsFaceup() then
local g=Duel.GetMatchingGroup(c12071005.desfil,tp,LOCATION_MZONE,LOCATION_MZONE,aux.ExceptThisCard(e),c:GetAttack())
Duel.Destroy(g,REASON_EFFECT)
end
end
function c12071005.damcon(e,tp,eg,ep,ev,re,r,rp)
return rp==1-tp and re:IsActiveType(TYPE_MONSTER) and not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) and bit.band(re:GetActivateLocation(),LOCATION_MZONE)~=0 and Duel.IsChainNegatable(ev)
end
function c12071005.damcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST)
end
function c12071005.damtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler().SetCard_NeoK_Flame and e:GetHandler():IsType(TYPE_XYZ) end
local atk=re:GetHandler():GetBaseAttack()
Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,atk)
end
function c12071005.damop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.NegateActivation(ev) then
local atk=re:GetHandler():GetBaseAttack()
Duel.Damage(1-tp,atk,REASON_EFFECT)
end
end
function c12071005.xdescost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.PayLPCost(tp,Duel.GetLP(tp)/2)
end
function c12071005.xdesfilter(c,atk)
return c:IsFaceup() and c:IsAttackBelow(atk) and c:IsSummonType(SUMMON_TYPE_SPECIAL)
end
function c12071005.xdestg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.IsExistingMatchingCard(c12071005.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,c,c:GetAttack()) end
local g=Duel.GetMatchingGroup(c12071005.xdesfilter,tp,LOCATION_MZONE,LOCATION_MZONE,c,c:GetAttack())
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0)
end
function c12071005.xdesop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) or c:IsFacedown() then return end
local g=Duel.GetMatchingGroup(c12071005.xdesfilter,tp,LOCATION_MZONE,LOCATION_MZONE,aux.ExceptThisCard(e),c:GetAttack())
if g:GetCount()>0 then
Duel.Destroy(g,REASON_EFFECT)
end
end
--永燃的薪炎 燎原炎车的狼烟
function c12071006.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,12071006)
e1:SetCost(c12071006.cost)
e1:SetTarget(c12071006.target)
e1:SetOperation(c12071006.operation)
c:RegisterEffect(e1)
--atk up
--local e2=Effect.CreateEffect(c)
--e2:SetCategory(CATEGORY_ATKCHANGE)
--e2:SetType(EFFECT_TYPE_XMATERIAL+EFFECT_TYPE_QUICK_O)
--e2:SetRange(LOCATION_MZONE)
--e2:SetCode(EVENT_PRE_DAMAGE_CALCULATE)
--e2:SetCondition(c12071006.atkcon)
--e2:SetCost(c12071006.atkcost)
--e2:SetOperation(c12071006.atkop)
--c:RegisterEffect(e2)
--immune
--local e3=Effect.CreateEffect(c)
--e3:SetType(EFFECT_TYPE_XMATERIAL)
--e3:SetCode(EFFECT_IMMUNE_EFFECT)
--e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
--e3:SetRange(LOCATION_MZONE)
--e3:SetCondition(c12071006.imcon)
--e3:SetValue(c12071006.efilter)
--c:RegisterEffect(e3)
--atk
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_XMATERIAL)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetRange(LOCATION_MZONE)
e2:SetCondition(function(e)
return e:GetHandler().SetCard_NeoK_Flame and e:GetHandler():IsType(TYPE_XYZ) end)
e2:SetValue(function(e,c)
return c:GetOverlayCount()*100 end)
c:RegisterEffect(e2)
--negate
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(12071006,1))
e3:SetCategory(CATEGORY_NEGATE)
e3:SetType(EFFECT_TYPE_QUICK_O+EFFECT_TYPE_XMATERIAL)
e3:SetCode(EVENT_CHAINING)
e3:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1)
e3:SetCondition(c12071006.discon)
e3:SetCost(c12071006.discost)
e3:SetTarget(c12071006.distg)
e3:SetOperation(c12071006.disop)
c:RegisterEffect(e3)
end
c12071006.SetCard_NeoK_Flame=true
function c12071006.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckLPCost(tp,500) end
Duel.PayLPCost(tp,500)
end
function c12071006.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>4 end
end
function c12071006.filter(c)
return c.SetCard_NeoK_Flame and c:IsAbleToHand()
end
function c12071006.operation(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)==0 then return end
Duel.ConfirmDecktop(tp,5)
local g=Duel.GetDecktopGroup(tp,5):Filter(c12071006.filter,nil)
if g:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(12071006,0)) then
local sg=g:Select(tp,1,1,nil)
Duel.ConfirmCards(1-tp,sg)
Duel.SendtoHand(sg,tp,REASON_EFFECT)
end
Duel.ShuffleDeck(tp)
end
function c12071006.atkcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local bc=c:GetBattleTarget()
return bc and bc:IsSummonType(SUMMON_TYPE_SPECIAL) and bc:GetAttack()>0 and e:GetHandler().SetCard_NeoK_Flame and e:GetHandler():IsType(TYPE_XYZ)
end
function c12071006.atkcost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:GetFlagEffect(12071006)==0 and e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST)
c:RegisterFlagEffect(12071006,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_DAMAGE_CAL,0,1)
end
function c12071006.atkop(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 c12071006.imcon(e)
local tp=e:GetHandlerPlayer()
return e:GetHandler().SetCard_NeoK_Flame and e:GetHandler():IsType(TYPE_XYZ) and Duel.GetLP(tp)<=Duel.GetLP(1-tp)
end
function c12071006.efilter(e,te)
return te:GetOwnerPlayer()~=e:GetOwnerPlayer() and te:IsActivated()
end
function c12071006.discon(e,tp,eg,ep,ev,re,r,rp)
return rp==1-tp and not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) and Duel.IsChainNegatable(ev) and re:GetHandler():IsOnField() and re:IsActiveType(TYPE_MONSTER) and e:GetHandler().SetCard_NeoK_Flame and e:GetHandler():IsType(TYPE_XYZ)
end
function c12071006.discost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST)
end
function c12071006.distg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0)
end
function c12071006.disop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local atk=re:GetHandler():GetBaseAttack()
if Duel.NegateActivation(ev) and atk and atk>0 then
Duel.Damage(1-tp,atk,REASON_EFFECT)
end
end
......@@ -1247,7 +1247,7 @@ function Chikichikibanban.c4a71Limitsplimit(e,c)
return c:IsLocation(LOCATION_EXTRA) and not c:IsType(TYPE_XYZ)
end
function Chikichikibanban.c4a71Limitsplimit2(e,se,sp,st)
return se:GetHandler():IsSetCard(0x4a71)
return se:GetHandler():IsSetCard(0x4a76)
end
--铳影通用回收(代写)
function Chikichikibanban.c4a71tohand(c,tg,op,category)
......@@ -1269,7 +1269,7 @@ function Chikichikibanban.c4a71tohand(c,tg,op,category)
c:RegisterEffect(e1)
end
function Chikichikibanban.c4a71tohandthfilter(c)
return c:IsSetCard(0x4a71) and c:IsAbleToHand()
return c:IsSetCard(0x4a76) and c:IsAbleToHand()
end
function Chikichikibanban.c4a71tohandthtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Chikichikibanban.c4a71tohandthfilter,tp,LOCATION_GRAVE,0,1,nil) end
......
--尤格·萨隆
local cm,m,o=GetID()
function cm.initial_effect(c)
Yogg_g=Group.CreateGroup()
Yogg_g:KeepAlive()
--to hand
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetType(EFFECT_TYPE_TRIGGER_O+EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetOperation(cm.op)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e2)
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(cm.rmcon)
ge1:SetOperation(cm.checkop)
Duel.RegisterEffect(ge1,0)
end
end
local A=1103515245
local B=12345
local M=32767
local KOISHI_CHECK=false
if Card.SetCardData then KOISHI_CHECK=true end
cm.blacklist={}
local _SelectMatchingCard=Duel.SelectMatchingCard
local _SelectReleaseGroup=Duel.SelectReleaseGroup
local _SelectReleaseGroupEx=Duel.SelectReleaseGroupEx
local _SelectTarget=Duel.SelectTarget
local _SelectTribute=Duel.SelectTribute
local _DiscardHand=Duel.DiscardHand
local _DRemoveOverlayCard=Duel.RemoveOverlayCard
local _CRemoveOverlayCard=Card.RemoveOverlayCard
local _FilterSelect=Group.FilterSelect
local _Select=Group.Select
function cm.roll(min,max)
min=tonumber(min)
max=tonumber(max)
cm.r=((cm.r*A+B)%M)/M
if min~=nil then
if max==nil then
return math.floor(cm.r*min)+1
else
max=max-min+1
return math.floor(cm.r*max+min)
end
end
return cm.r
end
function cm.list(code)
for _,codes in pairs(cm.blacklist) do
if codes==code then return true end
end
return false
end
function cm.op(e,tp,eg,ep,ev,re,r,rp)
local tp=e:GetHandler():GetControler()
if not cm.r then
cm.r=Duel.GetFieldGroup(0,LOCATION_DECK+LOCATION_HAND,LOCATION_DECK+LOCATION_EXTRA):GetSum(Card.GetCode)
end
local g1=Group.CreateGroup()
local g2=Group.CreateGroup()
local ng1=Group.CreateGroup()
local ng2=Group.CreateGroup()
local ac=nil
local _TGetID=GetID
if Yogg_g:GetCount()>0 then
ct1=math.min(Yogg_g:GetCount(),85)
local tab1={}
for i=1,ct1 do
while not ac do
local int=cm.roll(1,132000016)
--continuously updated
if int>132000000 and int<132000014 then int=int+739100000 end
if int==132000014 then int=460524290 end
if int==132000015 then int=978210027 end
if int==132000016 then int=250000000 end
if KOISHI_CHECK then
local cc,ca,ctype=Duel.ReadCard(int,CARDDATA_CODE,CARDDATA_ALIAS,CARDDATA_TYPE)
if cc then
local dif=cc-ca
local real=0
if dif>-10 and dif<10 then
real=ca
else
real=cc
end
local prec=Duel.CreateToken(tp,real)
if ctype&TYPE_TOKEN==0 and not cm.list(real) and (ctype&TYPE_SPELL~=0 or ctype&TYPE_TRAP~=0) and prec:CheckActivateEffect(false,false,false)~=nil then
ac=real
end
end
else
if not _G["c"..int] then
_G["c"..int]={}
_G["c"..int].__index=_G["c"..int]
end
GetID=function()
return _G["c"..int],int
end
if pcall(function() require("expansions/script/c"..int) end) or pcall(function() require("script/c"..int) end) then
_G["c"..int]=nil
local bool,token=pcall(Duel.CreateToken,tp,int)
if bool and not token:IsType(TYPE_TOKEN) and (token:IsType(TYPE_SPELL) or token:IsType(TYPE_SPELL)) and token:CheckActivateEffect(false,false,false)~=nil then
ac=token:GetCode()
end
end
end
end
table.insert(tab1,ac)
table.insert(cm.blacklist,ac)
ac=nil
end
for i=1,ct1 do
g1:AddCard(Duel.CreateToken(tp,tab1[i]))
end
if #g1>0 then
local codes={}
for tc in aux.Next(g1) do
local code=tc:GetCode()
table.insert(codes,code)
end
table.sort(codes)
if aux.GetValueType(codes[1])=="number" then
local afilter={codes[1],OPCODE_ISCODE}
if #codes>1 then
for i=2,#codes do
table.insert(afilter,codes[i])
table.insert(afilter,OPCODE_ISCODE)
table.insert(afilter,OPCODE_OR)
end
end
local ac=g1:GetFirst()
while ac do
if ac:IsType(TYPE_FIELD) then
Duel.MoveToField(ac,tp,tp,LOCATION_FZONE,POS_FACEUP,true)
Duel.RaiseEvent(ac,4179255,te,0,tp,tp,Duel.GetCurrentChain())
else
Duel.MoveToField(ac,tp,tp,LOCATION_SZONE,POS_FACEUP,true)
end
local te=ac:GetActivateEffect()
te:UseCountLimit(tp,1,true)
cm.ActivateCard(ac,tp,e)
if not (ac:IsType(TYPE_CONTINUOUS) or ac:IsType(TYPE_FIELD) or ac:IsType(TYPE_EQUIP)) then
Duel.SendtoGrave(ac,REASON_RULE)
end
ac=g1:GetNext()
end
end
end
end
end
function cm.rmcon(e,tp,eg,ep,ev,re,r,rp)
return rp==tp and re:IsHasType(EFFECT_TYPE_ACTIVATE) and re:IsActiveType(TYPE_SPELL+TYPE_TRAP)
end
function cm.checkop(e,tp,eg,ep,ev,re,r,rp)
Yogg_g:AddCard(re:GetHandler())
end
function cm.ActivateCard(c,tp,oe)
local e=c:GetActivateEffect()
local cos,tg,op=e:GetCost(),e:GetTarget(),e:GetOperation()
if e and (not cos or cos(e,tp,eg,ep,ev,re,r,rp,0)) and (not tg or tg(e,tp,eg,ep,ev,re,r,rp,0)) then
oe:SetProperty(e:GetProperty())
local code=c:GetOriginalCode()
Duel.Hint(HINT_CARD,tp,code)
Duel.Hint(HINT_CARD,1-tp,code)
e:UseCountLimit(tp,1,true)
c:CreateEffectRelation(e)
if cos then cos(e,p,eg,ep,ev,re,r,rp,1) end
if tg then tg(e,tp,eg,ep,ev,re,r,rp,1) end
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
if g and #g~=0 then
local tg=g:GetFirst()
while tg do
tg:CreateEffectRelation(e)
tg=g:GetNext()
end
end
if op then op(e,tp,eg,ep,ev,re,r,rp) end
c:ReleaseEffectRelation(e)
if g then
tg=g:GetFirst()
while tg do
tg:ReleaseEffectRelation(e)
tg=g:GetNext()
end
end
end
end
--苔丝·格雷迈恩
local cm,m,o=GetID()
function cm.initial_effect(c)
Tess_g=Group.CreateGroup()
Tess_g:KeepAlive()
GM_g=Group.CreateGroup()
GM_g:KeepAlive()
--to hand
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetType(EFFECT_TYPE_TRIGGER_O+EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetOperation(cm.op)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e2)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE_START+PHASE_DRAW)
e1:SetRange(LOCATION_HAND+LOCATION_DECK)
e1:SetCondition(cm.con2)
e1:SetOperation(cm.op2)
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(cm.rmcon)
ge1:SetOperation(cm.checkop)
Duel.RegisterEffect(ge1,0)
end
end
function cm.con2(e,tp)
return Duel.GetFlagEffect(tp,m)==0
end
function cm.op2(e,tp)
local c=e:GetHandler()
local g=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_HAND+LOCATION_DECK,LOCATION_HAND+LOCATION_DECK,nil)
GM_g:Merge(g)
Duel.RegisterFlagEffect(tp,m,RESET_PHASE+PHASE_END,0,1000)
end
function cm.op(e,tp,eg,ep,ev,re,r,rp)
local tp=e:GetHandler():GetControler()
if Tess_g:GetCount()~=0 then
local bc=Tess_g:GetFirst()
while bc do
if not GM_g:IsContains(bc) then
local ac=Duel.CreateToken(tp,bc:GetCode())
if ac:CheckActivateEffect(false,false,false)~=nil then
if ac:IsType(TYPE_FIELD) then
Duel.MoveToField(ac,tp,tp,LOCATION_FZONE,POS_FACEUP,true)
Duel.RaiseEvent(ac,4179255,te,0,tp,tp,Duel.GetCurrentChain())
else
Duel.MoveToField(ac,tp,tp,LOCATION_SZONE,POS_FACEUP,true)
end
local te=ac:GetActivateEffect()
te:UseCountLimit(tp,1,true)
cm.ActivateCard(ac,tp,e)
if not (ac:IsType(TYPE_CONTINUOUS) or ac:IsType(TYPE_FIELD) or ac:IsType(TYPE_EQUIP)) then
Duel.SendtoGrave(ac,REASON_RULE)
end
end
end
bc=Tess_g:GetNext()
end
end
end
function cm.rmcon(e,tp,eg,ep,ev,re,r,rp)
return rp==tp and re:IsHasType(EFFECT_TYPE_ACTIVATE) and re:IsActiveType(TYPE_SPELL+TYPE_TRAP)
end
function cm.checkop(e,tp,eg,ep,ev,re,r,rp)
Tess_g:AddCard(re:GetHandler())
end
function cm.ActivateCard(c,tp,oe)
local e=c:GetActivateEffect()
local cos,tg,op=e:GetCost(),e:GetTarget(),e:GetOperation()
if e and (not cos or cos(e,tp,eg,ep,ev,re,r,rp,0)) and (not tg or tg(e,tp,eg,ep,ev,re,r,rp,0)) then
oe:SetProperty(e:GetProperty())
local code=c:GetOriginalCode()
Duel.Hint(HINT_CARD,tp,code)
Duel.Hint(HINT_CARD,1-tp,code)
e:UseCountLimit(tp,1,true)
c:CreateEffectRelation(e)
if cos then cos(e,p,eg,ep,ev,re,r,rp,1) end
if tg then tg(e,tp,eg,ep,ev,re,r,rp,1) end
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
if g and #g~=0 then
local tg=g:GetFirst()
while tg do
tg:CreateEffectRelation(e)
tg=g:GetNext()
end
end
if op then op(e,tp,eg,ep,ev,re,r,rp) end
c:ReleaseEffectRelation(e)
if g then
tg=g:GetFirst()
while tg do
tg:ReleaseEffectRelation(e)
tg=g:GetNext()
end
end
end
end
--清流淌我心
local cm,m,o=GetID()
function cm.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DISABLE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER)
e1:SetTarget(cm.target)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and aux.NegateMonsterFilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(aux.NegateMonsterFilter,tp,0,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISABLE)
Duel.SelectTarget(tp,aux.NegateMonsterFilter,tp,0,LOCATION_MZONE,1,1,nil)
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsFaceup() and tc:IsRelateToEffect(e) and tc:IsCanBeDisabledByEffect(e) then
Duel.NegateRelatedChain(tc,RESET_TURN_SET)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetValue(RESET_TURN_SET)
e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e2)
if Duel.IsExistingMatchingCard(Card.IsAttribute,tp,LOCATION_GRAVE,0,7,nil,ATTRIBUTE_WATER) and Duel.SelectYesNo(tp,aux.Stringid(m,0)) then
if Duel.GetFieldGroupCount(tp,LOCATION_HAND,0)<Duel.GetFieldGroupCount(tp,0,LOCATION_HAND) then
Duel.Draw(tp,Duel.GetFieldGroupCount(tp,0,LOCATION_HAND)-Duel.GetFieldGroupCount(tp,LOCATION_HAND,0),REASON_EFFECT)
elseif Duel.GetFieldGroupCount(tp,LOCATION_HAND,0)>Duel.GetFieldGroupCount(tp,0,LOCATION_HAND) then
for i=1,Duel.GetFieldGroupCount(tp,LOCATION_HAND,0)-Duel.GetFieldGroupCount(tp,0,LOCATION_HAND) do
local g1=Duel.GetMatchingGroup(Card.IsAbleToRemove,tp,0,LOCATION_HAND,nil):RandomSelect(tp,1)
Duel.Remove(g1,REASON_EFFECT)
end
end
end
end
end
\ No newline at end of file
--微风入我怀
local cm,m,o=GetID()
function cm.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCondition(cm.spcon)
e1:SetTarget(cm.target)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
end
function cm.cfilter(c)
return c:IsFaceup() and c:IsRace(RACE_SPELLCASTER) and c:IsAttribute(ATTRIBUTE_WIND)
end
function cm.spcon(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetFieldGroup(tp,LOCATION_MZONE,0)
return #g>0 and g:FilterCount(cm.cfilter,nil)==#g
end
function cm.filter(c)
return ((c:IsAttack(1320) and c:IsDefense(1450)) or (c:IsRace(RACE_SPELLCASTER) and c:GetBaseAttack()==1850) or (c:IsType(TYPE_RITUAL) and c:IsType(TYPE_MONSTER))) and c:IsAbleToHand()
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,cm.filter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
Duel.Draw(tp,1,REASON_EFFECT)
end
end
\ No newline at end of file
--神光耀我瞳
local cm,m,o=GetID()
function cm.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(cm.tg)
e1:SetOperation(cm.op)
c:RegisterEffect(e1)
end
function cm.tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsFacedown,tp,0,LOCATION_ONFIELD,1,nil) end
end
function cm.op(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(Card.IsFacedown,tp,0,LOCATION_ONFIELD,nil)
local endcount=0
if g:GetCount()>0 then
Duel.ConfirmCards(tp,g)
endcount=endcount+g:GetCount()
local g2=Duel.IsExistingMatchingCard(aux.TRUE,tp,0,LOCATION_HAND,1,nil)
if g2~=0 then
Duel.ConfirmCards(tp,g2)
endcount=endcount+g2:GetCount()
if endcount>=1 then
Duel.Recover(tp,500,REASON_EFFECT)
end
if endcount>=3 then
Duel.Draw(tp,1,REASON_EFFECT)
end
if endcount>=5 then
local uc=Duel.GetMatchingGroup(Card.IsAbleToRemove,tp,0,LOCATION_HAND,nil):RandomSelect(tp,1)
Duel.Remove(uc,POS_FACEUP,REASON_EFFECT)
end
if endcount>=7 then
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_REVERSE_DECK)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetTargetRange(1,1)
Duel.RegisterEffect(e2,tp)
end
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:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND+CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(cm.target)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,1))
e1:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND+CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCost(cm.cost)
e1:SetTarget(cm.target1)
e1:SetOperation(cm.activate1)
c:RegisterEffect(e1)
end
function cm.filter(c)
return c:IsCode(759393,4376658,76615300,92518817) and c:IsAbleToHand()
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function cm.spcheck(g)
return g:GetClassCount(Card.GetCode)==1
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(cm.filter,tp,LOCATION_DECK,0,nil)
if g:GetCount()>0 then
local ft=math.min(3,#g)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local hg=g:SelectSubGroup(tp,cm.spcheck,false,1,ft)
if #hg>0 and Duel.SendtoHand(hg,nil,REASON_EFFECT)>0 and hg:Filter(Card.IsLocation,nil,LOCATION_HAND):FilterCount(Card.IsControler,nil,tp)>0 then
local og=Duel.GetOperatedGroup():Filter(Card.IsLocation,nil,LOCATION_HAND):Filter(Card.IsControler,nil,tp)
Duel.ConfirmCards(1-tp,og)
end
end
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local g1=Duel.GetMatchingGroup(Card.IsCode,tp,LOCATION_DECK+LOCATION_EXTRA,0,nil,759393):RandomSelect(tp,1)
g1:Merge(Duel.GetMatchingGroup(Card.IsCode,tp,LOCATION_DECK+LOCATION_EXTRA,0,nil,4376658):RandomSelect(tp,1))
g1:Merge(Duel.GetMatchingGroup(Card.IsCode,tp,LOCATION_DECK+LOCATION_EXTRA,0,nil,76615300):RandomSelect(tp,1))
g1:Merge(Duel.GetMatchingGroup(Card.IsCode,tp,LOCATION_DECK+LOCATION_EXTRA,0,nil,92518817):RandomSelect(tp,1))
g1:Merge(Duel.GetMatchingGroup(Card.IsCode,tp,LOCATION_DECK+LOCATION_EXTRA,0,nil,48815792):RandomSelect(tp,1))
if chk==0 then return g1:GetCount()>=5 end
Duel.SendtoGrave(g1,REASON_RULE)
end
function cm.filter2(c)
return c:IsAttribute(ATTRIBUTE_FIRE) and c:IsAbleToHand()
end
function cm.target1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.filter2,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function cm.activate1(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(cm.filter2,tp,LOCATION_DECK,0,nil)
if g:GetCount()>0 then
local ft=math.min(3,#g)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local hg=g:SelectSubGroup(tp,cm.spcheck,false,1,ft)
if #hg>0 and Duel.SendtoHand(hg,nil,REASON_EFFECT)>0 and hg:Filter(Card.IsLocation,nil,LOCATION_HAND):FilterCount(Card.IsControler,nil,tp)>0 then
local og=Duel.GetOperatedGroup():Filter(Card.IsLocation,nil,LOCATION_HAND):Filter(Card.IsControler,nil,tp)
Duel.ConfirmCards(1-tp,og)
end
end
end
\ No newline at end of file
--自奏圣乐·伽拉忒莉
local cm,m,o=GetID()
function cm.initial_effect(c)
--link summon
aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsLinkType,TYPE_EFFECT),2,2,cm.lcheck)
c:EnableReviveLimit()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCondition(cm.drcon1)
e1:SetOperation(cm.drop1)
c:RegisterEffect(e1)
--sp_summon effect
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetCondition(cm.regcon)
e2:SetOperation(cm.regop)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e3:SetCode(EVENT_CHAIN_SOLVED)
e3:SetCondition(cm.drcon2)
e3:SetOperation(cm.drop2)
c:RegisterEffect(e3)
--todeck
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(30741503,0))
e2:SetCategory(CATEGORY_TODECK)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,m)
e2:SetCondition(cm.tdcon1)
e2:SetTarget(cm.tdtg)
e2:SetOperation(cm.tdop)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetCondition(cm.tdcon2)
c:RegisterEffect(e3)
end
function cm.lcheck(g)
return g:IsExists(Card.IsLinkSetCard,1,nil,0x11b)
end
function cm.tdcon1(e,tp,eg,ep,ev,re,r,rp)
return not Duel.IsPlayerAffectedByEffect(tp,90351981)
end
function cm.tdcon2(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsPlayerAffectedByEffect(tp,90351981)
end
function cm.tdfilter(c)
return c:IsFaceup() and c:IsRace(RACE_MACHINE) and c:IsAbleToDeck()
end
function cm.tdtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_REMOVED) and chkc:IsControler(tp) and cm.tdfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(cm.tdfilter,tp,LOCATION_REMOVED,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectTarget(tp,cm.tdfilter,tp,LOCATION_REMOVED,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,1,0,0)
end
function cm.setfilter(c)
return c:IsRace(RACE_MACHINE) and c:IsAttribute(ATTRIBUTE_DARK) and c:IsAbleToGrave()
end
function cm.tdop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.SendtoDeck(tc,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)~=0 and tc:IsLocation(LOCATION_DECK+LOCATION_EXTRA) then
local xg=Duel.GetMatchingGroup(Card.IsCode,tp,LOCATION_DECK,0,nil,tc:GetCode())
local g=Duel.GetMatchingGroup(cm.setfilter,tp,LOCATION_DECK,0,xg)
if g:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(m,1)) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
local sg=g:Select(tp,1,1,nil)
Duel.SendtoGrave(sg,REASON_EFFECT)
end
end
end
function cm.filter(c,sp)
return c:IsSummonPlayer(sp)
end
function cm.drcon1(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(cm.filter,1,nil,1-tp) and e:GetHandler():IsLinkState()
and (not re:IsHasType(EFFECT_TYPE_ACTIONS) or re:IsHasType(EFFECT_TYPE_CONTINUOUS))
end
function cm.drop1(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetFlagEffect(tp,m)<3 then
Duel.Draw(tp,1,REASON_EFFECT)
Duel.RegisterFlagEffect(tp,m,RESET_PHASE+PHASE_END,0,1)
end
end
function cm.regcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(cm.filter,1,nil,1-tp) and e:GetHandler():IsLinkState()
and re:IsHasType(EFFECT_TYPE_ACTIONS) and not re:IsHasType(EFFECT_TYPE_CONTINUOUS)
end
function cm.regop(e,tp,eg,ep,ev,re,r,rp)
Duel.RegisterFlagEffect(tp,m+10000000,RESET_CHAIN,0,1)
end
function cm.drcon2(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFlagEffect(tp,m+10000000)>0
end
function cm.drop2(e,tp,eg,ep,ev,re,r,rp)
local n=Duel.GetFlagEffect(tp,m+10000000)
local abled=3-Duel.GetFlagEffect(tp,m)
if abled>0 then
local tn=math.min(n,abled)
Duel.ResetFlagEffect(tp,m+10000000)
Duel.Draw(tp,tn,REASON_EFFECT)
for i=1,tn do
Duel.RegisterFlagEffect(tp,m,RESET_PHASE+PHASE_END,0,1)
end
end
end
\ No newline at end of file
--双选模式启动
--Thanks to PurpleNightfall&SEINEctor Phan
local cm,m,o=GetID()
DuelModeChange=DuelModeChange or {}
DuelModeChange.loaded_metatable_list={}
function cm.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE_START+PHASE_DRAW)
e1:SetRange(LOCATION_EXTRA)
e1:SetCondition(cm.con)
e1:SetOperation(cm.op)
c:RegisterEffect(e1)
end
if not cm.enable_all_setname then
cm.enable_all_setname=true
cm._is_set_card=Card.IsSetCard
Card.IsSetCard=function (c,...)
return Duel.GetFlagEffect(tp,m)~=0 or cm._is_set_card(c,...)
end
cm._is_link_set_card=Card.IsLinkSetCard
Card.IsLinkSetCard=function (c,...)
return Duel.GetFlagEffect(tp,m)~=0 or cm._is_link_set_card(c,...)
end
cm._is_fusion_set_card=Card.IsFusionSetCard
Card.IsFusionSetCard=function (c,...)
return Duel.GetFlagEffect(tp,m)~=0 or cm._is_fusion_set_card(c,...)
end
cm._is_previous_set_card=Card.IsPreviousSetCard
Card.IsPreviousSetCard=function (c,...)
return Duel.GetFlagEffect(tp,m)~=0 or cm._is_previous_set_card(c,...)
end
cm._is_original_set_card=Card.IsOriginalSetCard
Card.IsOriginalSetCard=function (c,...)
return Duel.GetFlagEffect(tp,m)~=0 or cm._is_original_set_card(c,...)
end
cm._is_code=Card.IsCode
Card.IsCode=function (c,...)
return Duel.GetFlagEffect(tp,m)~=0 or cm._is_code(c,...)
end
cm._is_original_code_rule=Card.IsOriginalCodeRule
Card.IsOriginalCodeRule=function (c,...)
return Duel.GetFlagEffect(tp,m)~=0 or cm._is_original_code_rule(c,...)
end
cm._is_link_code=Card.IsLinkCode
Card.IsLinkCode=function (c,...)
return Duel.GetFlagEffect(tp,m)~=0 or cm._is_link_code(c,...)
end
cm._is_fusion_code=Card.IsFusionCode
Card.IsFusionCode=function (c,...)
return Duel.GetFlagEffect(tp,m)~=0 or cm._is_fusion_code(c,...)
end
cm._is_attribute=Card.IsAttribute
Card.IsAttribute=function (c,...)
return Duel.GetFlagEffect(tp,m)~=0 or cm._is_attribute(c,...)
end
cm._is_fusion_attribute=Card.IsFusionAttribute
Card.IsFusionAttribute=function (c,...)
return Duel.GetFlagEffect(tp,m)~=0 or cm._is_fusion_attribute(c,...)
end
cm._is_link_attribute=Card.IsLinkAttribute
Card.IsLinkAttribute=function (c,...)
return Duel.GetFlagEffect(tp,m)~=0 or cm._is_link_attribute(c,...)
end
cm._is_attack=Card.IsAttack
Card.IsAttack=function (c,...)
return Duel.GetFlagEffect(tp,m)~=0 or cm._is_attack(c,...)
end
cm._is_attack_above=Card.IsAttackAbove
Card.IsAttackAbove=function (c,...)
return Duel.GetFlagEffect(tp,m)~=0 or cm._is_attack_above(c,...)
end
cm._is_attack_below=Card.IsAttackBelow
Card.IsAttackBelow=function (c,...)
return Duel.GetFlagEffect(tp,m)~=0 or cm._is_attack_below(c,...)
end
cm._is_defence=Card.IsDefense
Card.IsDefense=function (c,...)
return Duel.GetFlagEffect(tp,m)~=0 or cm._is_defence(c,...)
end
cm._is_defence_above=Card.IsDefenseAbove
Card.IsDefenseAbove=function (c,...)
return Duel.GetFlagEffect(tp,m)~=0 or cm._is_defence_above(c,...)
end
cm._is_defence_below=Card.IsDefenseBelow
Card.IsDefenseBelow=function (c,...)
return Duel.GetFlagEffect(tp,m)~=0 or cm._is_defence_below(c,...)
end
cm._is_race=Card.IsRace
Card.IsRace=function (c,...)
return Duel.GetFlagEffect(tp,m)~=0 or cm._is_race(c,...)
end
cm._is_link_race=Card.IsLinkRace
Card.IsLinkRace=function (c,...)
return Duel.GetFlagEffect(tp,m)~=0 or cm._is_link_race(c,...)
end
cm._is_level=Card.IsLevel
Card.IsLevel=function (c,...)
return Duel.GetFlagEffect(tp,m)~=0 or cm._is_level(c,...)
end
cm._is_level_above=Card.IsLevelAbove
Card.IsLevelAbove=function (c,...)
return Duel.GetFlagEffect(tp,m)~=0 or cm._is_level_above(c,...)
end
cm._is_level_below=Card.IsLevelBelow
Card.IsLevelBelow=function (c,...)
return Duel.GetFlagEffect(tp,m)~=0 or cm._is_level_below(c,...)
end
cm._is_xyz_level=Card.IsXyzLevel
Card.IsXyzLevel=function (c,...)
return Duel.GetFlagEffect(tp,m)~=0 or cm._is_xyz_level(c,...)
end
cm._is_rank=Card.IsRank
Card.IsRank=function (c,...)
return Duel.GetFlagEffect(tp,m)~=0 or cm._is_rank(c,...)
end
cm._is_rank_above=Card.IsRankAbove
Card.IsRankAbove=function (c,...)
return Duel.GetFlagEffect(tp,m)~=0 or cm._is_rank_above(c,...)
end
cm._is_rank_below=Card.IsRankBelow
Card.IsRankBelow=function (c,...)
return Duel.GetFlagEffect(tp,m)~=0 or cm._is_rank_below(c,...)
end
cm._is_link=Card.IsLink
Card.IsLink=function (c,...)
return Duel.GetFlagEffect(tp,m)~=0 or cm._is_link(c,...)
end
cm._is_link_above=Card.IsLinkAbove
Card.IsLinkAbove=function (c,...)
return Duel.GetFlagEffect(tp,m)~=0 or cm._is_link_above(c,...)
end
cm._is_link_below=Card.IsLinkBelow
Card.IsLinkBelow=function (c,...)
return Duel.GetFlagEffect(tp,m)~=0 or cm._is_link_below(c,...)
end
cm._is_type=Card.IsType
Card.IsType=function (c,...)
return Duel.GetFlagEffect(tp,m)~=0 or cm._is_type(c,...)
end
cm._is_fusion_type=Card.IsFusionType
Card.IsFusionType=function (c,...)
return Duel.GetFlagEffect(tp,m)~=0 or cm._is_fusion_type(c,...)
end
cm._is_synchro_type=Card.IsSynchroType
Card.IsSynchroType=function (c,...)
return Duel.GetFlagEffect(tp,m)~=0 or cm._is_synchro_type(c,...)
end
cm._is_xyz_type=Card.IsXyzType
Card.IsXyzType=function (c,...)
return Duel.GetFlagEffect(tp,m)~=0 or cm._is_xyz_type(c,...)
end
cm._is_link_type=Card.IsLinkType
Card.IsLinkType=function (c,...)
return Duel.GetFlagEffect(tp,m)~=0 or cm._is_link_type(c,...)
end
end
function cm.con(e,tp)
return Duel.GetFlagEffect(tp,m)==0
end
function cm.op(e,tp)
local c=e:GetHandler()
DuelModeChange.TwoPick1(tp)
DuelModeChange.TwoPick1(1-tp)
if Duel.GetFlagEffect(1-tp,m+10000000)==0 then
Duel.RegisterFlagEffect(tp,m+10000000,RESET_PHASE+PHASE_END,0,1000)
else
DuelModeChange.TwoPick1(tp)
DuelModeChange.TwoPick1(1-tp)
end
Duel.RegisterFlagEffect(tp,m,RESET_PHASE+PHASE_END,0,1000)
end
local A=1103515245
local B=12345
local M=1073741824
function DuelModeChange.TwoPick1(tp)
DuelModeChange.DCard(tp)
DuelModeChange.CreateCards(tp)
end
function DuelModeChange.DCard(tp)
local g1=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_DECK+LOCATION_EXTRA+LOCATION_HAND,0,nil)
Debug.Message("正在删除原有卡片……")
for i=1,g1:GetCount() do
local dc=g1:GetFirst()
Duel.Exile(dc,REASON_RULE)
g1:RemoveCard(dc)
end
end
function DuelModeChange.CreateCards(tp)
Duel.RegisterFlagEffect(tp,m,RESET_PHASE+PHASE_END,0,1000)
for u=1,30 do
if not cm.r then
cm.r=Duel.GetFieldGroup(0,LOCATION_HAND,LOCATION_HAND):GetSum(Card.GetCode)
end
local g1=Group.CreateGroup()
local g2=Group.CreateGroup()
local ng1=Group.CreateGroup()
local ng2=Group.CreateGroup()
local ac=nil
local _TGetID=GetID
local tab1={}
for i=1,4 do
while not ac do
local int=cm.roll(1,132000016)
--continuously updated
if int>132000000 and int<132000014 then int=int+739100000 end
if int==132000014 then int=460524290 end
if int==132000015 then int=978210027 end
if int==132000016 then int=250000000 end
local cc,ca,ctype=Duel.ReadCard(int,CARDDATA_CODE,CARDDATA_ALIAS,CARDDATA_TYPE)
if cc then
local dif=cc-ca
local real=0
if dif>-10 and dif<10 then
real=ca
else
real=cc
end
if ctype&TYPE_TOKEN==0 and not cm.list(real) then
ac=real
end
end
end
table.insert(tab1,ac)
table.insert(cm.blacklist,ac)
ac=nil
end
for i=1,4 do
g1:AddCard(Duel.CreateToken(tp,tab1[i]))
end
if #g1>0 then
local codes={}
for tc in aux.Next(g1) do
local code=tc:GetCode()
table.insert(codes,code)
end
table.sort(codes)
if aux.GetValueType(codes[1])=="number" then
local afilter={codes[1],OPCODE_ISCODE}
if #codes>1 then
for i=2,#codes do
table.insert(afilter,codes[i])
table.insert(afilter,OPCODE_ISCODE)
table.insert(afilter,OPCODE_OR)
end
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CODE)
Debug.Message("请选择需要的卡牌("..u.."/30)")
local ac=Duel.AnnounceCard(tp,table.unpack(afilter))
if ac==tab1[1] or ac==tab1[2] then
local gc1=Duel.CreateToken(tp,g1:GetFirst():GetCode())
g1:RemoveCard(g1:GetFirst())
local gc2=Duel.CreateToken(tp,g1:GetFirst():GetCode())
Duel.SendtoDeck(gc1,tp,2,REASON_EFFECT)
Duel.SendtoDeck(gc2,tp,2,REASON_EFFECT)
else
g1:RemoveCard(g1:GetFirst())
g1:RemoveCard(g1:GetFirst())
local gc1=Duel.CreateToken(tp,g1:GetFirst():GetCode())
g1:RemoveCard(g1:GetFirst())
local gc2=Duel.CreateToken(tp,g1:GetFirst():GetCode())
Duel.SendtoDeck(gc1,tp,2,REASON_EFFECT)
Duel.SendtoDeck(gc2,tp,2,REASON_EFFECT)
end
end
end
end
Duel.ShuffleDeck(tp)
Duel.Draw(tp,5,REASON_EFFECT)
end
cm.blacklist={}
local _SelectMatchingCard=Duel.SelectMatchingCard
local _SelectReleaseGroup=Duel.SelectReleaseGroup
local _SelectReleaseGroupEx=Duel.SelectReleaseGroupEx
local _SelectTarget=Duel.SelectTarget
local _SelectTribute=Duel.SelectTribute
local _DiscardHand=Duel.DiscardHand
local _DRemoveOverlayCard=Duel.RemoveOverlayCard
local _CRemoveOverlayCard=Card.RemoveOverlayCard
local _FilterSelect=Group.FilterSelect
local _Select=Group.Select
function cm.roll(min,max)
min=tonumber(min)
max=tonumber(max)
cm.r=((cm.r*A+B)%M)/M
if min~=nil then
if max==nil then
return math.floor(cm.r*min)+1
else
max=max-min+1
return math.floor(cm.r*max+min)
end
end
return cm.r
end
function cm.list(code)
for _,codes in pairs(cm.blacklist) do
if codes==code then return true end
end
return false
end
\ No newline at end of file
--战争迷雾
local s,id,o=GetID()
function s.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetOperation(s.op)
c:RegisterEffect(e1)
end
function s.op(e,tp,eg,ep,ev,re,r,rp)
for i=0,1 do
local g=Duel.GetFieldGroup(i,0,LOCATION_EXTRA)
local tc=g:RandomSelect(i,1):GetFirst()
if tc then
tc:SetCardData(CARDDATA_TYPE,Duel.ReadCard(tc,CARDDATA_TYPE))
end
end
end
\ No newline at end of file
--冰结界的极冰龙 三叉龙
local s,id,o=GetID()
function s.initial_effect(c)
c:EnableReviveLimit()
--Cannot SP Sum self
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.FALSE)
c:RegisterEffect(e1)
--spsummon
local e2=Effect.CreateEffect(c)
e2:SetDescription(2)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_HAND)
e2:SetCountLimit(1,id)
e2:SetCondition(s.spcon)
e2:SetCost(s.spcost)
e2:SetTarget(s.sptg)
e2:SetOperation(s.spop)
c:RegisterEffect(e2)
--search
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(19814508,0))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOHAND+CATEGORY_SEARCH)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1,id+1)
e3:SetCode(EVENT_SUMMON_SUCCESS)
e3:SetTarget(s.target)
e3:SetOperation(s.operation)
c:RegisterEffect(e3)
Duel.AddCustomActivityCounter(id,ACTIVITY_SPSUMMON,s.counterfilter)
end
function s.counterfilter(c)
return not c:IsSummonLocation(LOCATION_EXTRA) or
(c:IsAttribute(ATTRIBUTE_WATER) and c:IsLevelAbove(9) and c:IsRace(RACE_DRAGON))
end
function s.cfilter(c)
return c:IsFaceup() and c:IsSetCard(0x2f)
end
function s.spcon(e,tp,eg,ep,ev,re,r,rp)
local ct=Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)
return ct>0 and ct==Duel.GetMatchingGroupCount(s.cfilter,tp,LOCATION_MZONE,0,nil)
end
function s.costfilter(c)
return c:IsSetCard(0x2f) and c:IsType(TYPE_MONSTER) and c:IsAttack(2700) and c:IsDefense(2000) and c:IsAbleToGraveAsCost()
end
function s.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetCustomActivityCount(id,tp,ACTIVITY_SPSUMMON)==0 and Duel.IsExistingMatchingCard(s.costfilter,tp,LOCATION_EXTRA,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,s.costfilter,tp,LOCATION_EXTRA,0,1,1,nil)
Duel.SendtoGrave(g,REASON_COST)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
e1:SetTargetRange(1,0)
e1:SetTarget(s.splimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function s.splimit(e,c,sump,sumtype,sumpos,targetp)
return c:IsLocation(LOCATION_EXTRA) and not (c:IsAttribute(ATTRIBUTE_WATER) and c:IsLevelAbove(9) and c:IsRace(RACE_DRAGON))
end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,true,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function s.fselect(g)
return g:GetClassCount(Card.GetLocation)>1
end
function s.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
local g1=Duel.GetMatchingGroup(Card.IsAbleToRemove,tp,0,LOCATION_HAND,nil)
local g2=Duel.GetMatchingGroup(Card.IsAbleToRemove,tp,0,LOCATION_ONFIELD+LOCATION_GRAVE,nil)
if Duel.SpecialSummon(c,0,tp,tp,true,false,POS_FACEUP)~=0
and (#g1>0 or #g2>0) and Duel.SelectYesNo(tp,aux.Stringid(id,2)) then
local rg=nil
if #g1>0 and #g2>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
rg=g2:SelectSubGroup(tp,s.fselect,false,1,2)
if Duel.SelectYesNo(tp,aux.Stringid(id,3)) then
local sg=g1:RandomSelect(tp,1)
rg:Merge(sg)
end
elseif #g1>0 and #g2==0 then
rg=g1:RandomSelect(tp,1)
elseif #g2>0 and #g1==0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
rg=g2:SelectSubGroup(tp,s.fselect,false,1,2)
end
Duel.Remove(rg,POS_FACEUP,REASON_EFFECT)
end
end
end
function s.spfilter(c,e,tp)
return c:IsSetCard(0x2f) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP,1-tp)
end
function s.thfilter(c)
return c:IsLevelBelow(6) and c:IsSetCard(0x2f) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
local tc=eg:GetFirst()
if chk==0 then return tc:IsSetCard(0x2f) and Duel.GetLocationCount(1-tp,LOCATION_MZONE,tp)>0 and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_HAND,0,1,nil,e,tp) and Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
end
function s.operation(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(1-tp,LOCATION_MZONE,tp)==0 then return end
local sg=Duel.GetMatchingGroup(s.spfilter,tp,LOCATION_HAND,0,nil,e,tp)
local tg=Duel.GetMatchingGroup(s.thfilter,tp,LOCATION_DECK,0,nil)
if #sg>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sum=sg:Select(tp,1,1,nil)
if Duel.SpecialSummon(sum,0,tp,1-tp,false,false,POS_FACEUP)~=0 and #tg>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local tohand=tg:Select(tp,1,1,nil)
Duel.SendtoHand(tohand,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tohand)
end
end
end
\ No newline at end of file
--混沌小蓝 洗衣支配者
local s,id,o=GetID()
function s.initial_effect(c)
--synchro summon
aux.AddSynchroProcedure(c,nil,aux.NonTuner(nil),1)
c:EnableReviveLimit()
--deckdes
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(13171876,0))
e1:SetCategory(CATEGORY_DECKDES)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCountLimit(1,id)
e1:SetCondition(s.ddcon)
e1:SetTarget(s.ddtg)
e1:SetOperation(s.ddop)
c:RegisterEffect(e1)
--spsummon
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,id+1)
e2:SetCost(s.spcost)
e2:SetTarget(s.sptg)
e2:SetOperation(s.spop)
c:RegisterEffect(e2)
end
function s.ddcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_SYNCHRO)
end
function s.ddtg(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 s.ddop(e,tp,eg,ep,ev,re,r,rp)
Duel.DiscardDeck(tp,3,REASON_EFFECT)
end
function s.costfilter(c,e,tp)
return c:IsAbleToRemoveAsCost() and c:IsAttribute(ATTRIBUTE_LIGHT+ATTRIBUTE_DARK) and Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_GRAVE,0,1,c,e,tp)
end
function s.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(s.costfilter,tp,LOCATION_HAND+LOCATION_GRAVE,0,e:GetHandler(),e,tp)
if chk==0 then return g:CheckSubGroup(aux.gfcheck,2,2,Card.IsAttribute,ATTRIBUTE_LIGHT,ATTRIBUTE_DARK) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local sg=g:SelectSubGroup(tp,aux.gfcheck,false,2,2,Card.IsAttribute,ATTRIBUTE_LIGHT,ATTRIBUTE_DARK)
Duel.Remove(sg,POS_FACEUP,REASON_COST)
end
function s.filter(c,e,tp)
return c:IsCode(13171876) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE)
end
function s.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.filter),tp,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
--临界精灵 公主
local m=77000501
local cm=_G["c"..m]
function cm.initial_effect(c)
--Effect 1
local e11=Effect.CreateEffect(c)
e11:SetDescription(aux.Stringid(m,0))
e11:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e11:SetType(EFFECT_TYPE_SINGLE)
e11:SetCode(EFFECT_SUMMON_PROC)
e11:SetCondition(cm.ntcon)
e11:SetValue(1)
c:RegisterEffect(e11)
--Effect 2
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_REMOVE)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCountLimit(1,m)
e1:SetTarget(cm.tgtg)
e1:SetOperation(cm.tgop)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e2)
--Effect 3
local e12=Effect.CreateEffect(c)
e12:SetDescription(aux.Stringid(m,1))
e12:SetCategory(CATEGORY_DESTROY+CATEGORY_SPECIAL_SUMMON)
e12:SetProperty(EFFECT_FLAG_DELAY)
e12:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e12:SetRange(LOCATION_REMOVED)
e12:SetCode(EVENT_SPSUMMON_SUCCESS)
e12:SetCountLimit(1,m)
e12:SetTarget(cm.remtg1)
e12:SetOperation(cm.remop1)
c:RegisterEffect(e12)
local e13=e12:Clone()
e13:SetCode(EVENT_SUMMON_SUCCESS)
c:RegisterEffect(e13)
--Effect 4
--Effect 5
end
--Effect 1
function cm.cfilter(c)
return c:IsFaceup() and c:IsSetCard(0xee2)
end
function cm.ntcon(e,c,minc)
if c==nil then return true end
local tp=c:GetControler()
return minc==0 and c:IsLevelAbove(5) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and (Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)==0 or Duel.IsExistingMatchingCard(cm.cfilter,tp,LOCATION_MZONE,0,1,nil))
end
--Effect 2
function cm.tgtg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsAbleToRemove() end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,c,1,0,0)
end
function cm.tgop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.Remove(e:GetHandler(),POS_FACEUP,REASON_EFFECT)
end
end
--Effect 3
function cm.filter(c,e,tp)
return c:IsSummonPlayer(1-tp) and c:IsLocation(LOCATION_MZONE)
end
function cm.remtg1(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return eg:IsExists(cm.filter,1,nil,nil,tp)
and 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.remop1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
if Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)>0 then
if c:IsFaceup() and c:IsLocation(LOCATION_MZONE) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetValue(1000)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END+RESET_OPPO_TURN)
c:RegisterEffect(e1)
end
if Duel.IsExistingMatchingCard(aux.TRUE,tp,0,LOCATION_ONFIELD,1,nil)
and Duel.SelectYesNo(tp,aux.Stringid(m,1)) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectMatchingCard(tp,aux.TRUE,tp,0,LOCATION_ONFIELD,1,1,nil)
Duel.HintSelection(g)
Duel.Destroy(g,REASON_EFFECT)
end
end
end
\ No newline at end of file
--精灵封印者-士
local m=77000502
local cm=_G["c"..m]
function cm.initial_effect(c)
--Effect 1
local e6=Effect.CreateEffect(c)
e6:SetType(EFFECT_TYPE_SINGLE)
e6:SetCode(EFFECT_UPDATE_ATTACK)
e6:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e6:SetRange(LOCATION_MZONE)
e6:SetValue(cm.atkval)
c:RegisterEffect(e6)
--Effect 2
local e13=Effect.CreateEffect(c)
e13:SetDescription(aux.Stringid(m,0))
e13:SetCategory(CATEGORY_REMOVE+CATEGORY_SPECIAL_SUMMON)
e13:SetType(EFFECT_TYPE_IGNITION)
e13:SetRange(LOCATION_MZONE)
e13:SetCountLimit(1)
e13:SetTarget(cm.target)
e13:SetOperation(cm.operation)
c:RegisterEffect(e13)
--Effect 3
--Effect 4
--Effect 5
end
--Effect 1
function cm.cfilter(c)
return c:IsFaceup() and c:IsSetCard(0xee2)
end
function cm.atkval(e,c)
return Duel.GetMatchingGroupCount(cm.cfilter,e:GetHandlerPlayer(),LOCATION_REMOVED,LOCATION_REMOVED,nil)*100
end
--Effect 2
function cm.tohfilter(c)
return c:IsAbleToRemove() and c:IsSetCard(0xee2)
end
function cm.sumfilter(c,e,tp)
return c:IsType(TYPE_MONSTER) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.tohfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,tp,LOCATION_DECK)
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g1=Duel.SelectMatchingCard(tp,cm.tohfilter,tp,LOCATION_DECK,0,1,1,nil)
if g1:GetCount()>0 then
local cg=Duel.GetMatchingGroup(cm.sumfilter,tp,0,LOCATION_HAND,nil,e,tp)
if Duel.Remove(g1,POS_FACEUP,REASON_EFFECT)~=0
and cg:GetCount()>0
and Duel.SelectYesNo(1-tp,aux.Stringid(m,1)) then
if Duel.GetLocationCount(1-tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,1-tp,HINTMSG_SPSUMMON)
local g=cg:Select(1-tp,1,1,nil)
local tc=g:GetFirst()
if tc and Duel.SpecialSummonStep(tc,0,1-tp,1-tp,false,false,POS_FACEUP) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e2)
end
Duel.SpecialSummonComplete()
end
end
end
--Effect 3
--Effect 4
--Effect 5
--临界精灵 梦魇
local m=77000503
local cm=_G["c"..m]
function cm.initial_effect(c)
--Effect 1
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCountLimit(1,m)
e1:SetTarget(cm.sptg)
e1:SetOperation(cm.spop)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e2)
--Effect 2
local e22=Effect.CreateEffect(c)
e22:SetType(EFFECT_TYPE_SINGLE)
e22:SetCode(EFFECT_LEAVE_FIELD_REDIRECT)
e22:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e22:SetCondition(cm.recon)
e22:SetValue(LOCATION_REMOVED)
c:RegisterEffect(e22)
--Effect 3
local e12=Effect.CreateEffect(c)
e12:SetDescription(aux.Stringid(m,1))
e12:SetCategory(CATEGORY_SPECIAL_SUMMON)
e12:SetProperty(EFFECT_FLAG_DELAY)
e12:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e12:SetRange(LOCATION_REMOVED)
e12:SetCode(EVENT_SPSUMMON_SUCCESS)
e12:SetCountLimit(1,m+100)
e12:SetTarget(cm.remtg1)
e12:SetOperation(cm.remop1)
c:RegisterEffect(e12)
local e13=e12:Clone()
e13:SetCode(EVENT_SUMMON_SUCCESS)
c:RegisterEffect(e13)
--Effect 4
--Effect 5
end
--Effect 1
function cm.filter3(c,e,tp)
return c:IsSetCard(0xee2) and c:IsType(TYPE_MONSTER)
and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(cm.filter3,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,cm.filter3,tp,LOCATION_DECK,0,1,1,nil,e,tp)
local tc=g:GetFirst()
if g:GetCount()>0 then
if not tc:GetOriginalCode()~=77000503 then
if Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)>0
and tc:IsFaceup() then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CHANGE_CODE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
e1:SetValue(77000503)
tc:RegisterEffect(e1)
end
else
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
end
end
end
--Effect 2
function cm.recon(e)
return e:GetHandler():IsFaceup()
end
--Effect 3
function cm.filter(c,e,tp)
return c:IsSummonPlayer(1-tp) and c:IsLocation(LOCATION_MZONE)
end
function cm.remtg1(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return eg:IsExists(cm.filter,1,nil,nil,tp)
and 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.remop1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
end
\ No newline at end of file
--临界精灵 炎魔
local m=77000504
local cm=_G["c"..m]
function cm.initial_effect(c)
--Effect 1
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.hspcon)
c:RegisterEffect(e1)
--Effect 2
local e11=Effect.CreateEffect(c)
e11:SetDescription(aux.Stringid(m,0))
e11:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e11:SetCode(EVENT_SUMMON_SUCCESS)
e11:SetProperty(EFFECT_FLAG_DELAY)
e11:SetCountLimit(1,m+100)
e11:SetTarget(cm.tgtg)
e11:SetOperation(cm.tgop)
c:RegisterEffect(e11)
local e2=e11:Clone()
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e2)
end
--Effect 1
function cm.cfilter(c)
return c:IsFaceup() and c:IsSetCard(0xee2)
end
function cm.hspcon(e,c)
if c==nil then return true end
local tp=e:GetHandlerPlayer()
return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and (Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)==0 or Duel.IsExistingMatchingCard(cm.cfilter,tp,LOCATION_MZONE,0,1,nil))
end
--Effect 2
function cm.tgtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
end
function cm.tgop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and c:IsFaceup() then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetValue(1)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
c:RegisterEffect(e1)
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e5:SetCode(EVENT_DAMAGE_STEP_END)
e5:SetCondition(cm.descon)
e5:SetOperation(cm.desop)
e5:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
c:RegisterEffect(e5,true)
end
end
function cm.descon(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetHandler():GetBattleTarget()
return tc and tc:IsRelateToBattle()
end
function cm.desop(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetHandler():GetBattleTarget()
Duel.Hint(HINT_CARD,0,m)
Duel.Destroy(tc,REASON_EFFECT)
end
--Effect 3
--Effect 4
--Effect 5
--临界精灵 隐居者
local m=77000505
local cm=_G["c"..m]
function cm.initial_effect(c)
--Effect 1
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_REMOVE)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetTarget(cm.tgtg)
e1:SetOperation(cm.tgop)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e2)
--Effect 2
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SYNCHRO_LEVEL)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetValue(cm.synclv)
c:RegisterEffect(e1)
--Effect 3
local e12=Effect.CreateEffect(c)
e12:SetCategory(CATEGORY_SPECIAL_SUMMON)
e12:SetProperty(EFFECT_FLAG_DELAY)
e12:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e12:SetRange(LOCATION_REMOVED)
e12:SetCode(EVENT_SPSUMMON_SUCCESS)
e12:SetCountLimit(1,m)
e12:SetTarget(cm.remtg1)
e12:SetOperation(cm.remop1)
c:RegisterEffect(e12)
local e13=e12:Clone()
e13:SetCode(EVENT_SUMMON_SUCCESS)
c:RegisterEffect(e13)
end
--Effect 1
function cm.tgtg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsAbleToRemove() end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,c,1,0,0)
end
function cm.tgop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.Remove(e:GetHandler(),POS_FACEUP,REASON_EFFECT)
end
end
--Effect 2
function cm.synclv(e,c)
local lv=e:GetHandler():GetLevel()
return 1*65536+lv
end
--Effect 3
function cm.filter(c,e,tp)
return c:IsSummonPlayer(1-tp) and c:IsLocation(LOCATION_MZONE)
end
function cm.remtg1(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return eg:IsExists(cm.filter,1,nil,nil,tp)
and 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.remop1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
if Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)>0 then
if Duel.IsExistingMatchingCard(Card.IsFaceup,tp,0,LOCATION_MZONE,1,nil) then
Duel.BreakEffect()
local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,0,LOCATION_MZONE,nil)
local tc=g:GetFirst()
while tc do
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(-1000)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
tc=g:GetNext()
end
end
end
end
--Effect 4
--Effect 5
--临界精灵 公主-鏖杀公
local m=77000506
local cm=_G["c"..m]
function cm.initial_effect(c)
c:EnableReviveLimit()
--spsummon condition
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_SPSUMMON_CONDITION)
e1:SetValue(cm.splimit)
c:RegisterEffect(e1)
--Effect 1
local e13=Effect.CreateEffect(c)
e13:SetDescription(aux.Stringid(m,0))
e13:SetCategory(CATEGORY_REMOVE+CATEGORY_ATKCHANGE)
e13:SetType(EFFECT_TYPE_IGNITION)
e13:SetRange(LOCATION_MZONE)
e13:SetCountLimit(1)
e13:SetCost(cm.rmcost)
e13:SetTarget(cm.rmtg)
e13:SetOperation(cm.rmop)
c:RegisterEffect(e13)
--Effect 2
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetCode(EFFECT_CANNOT_ACTIVATE)
e2:SetRange(LOCATION_MZONE)
e2:SetTargetRange(0,1)
e2:SetValue(1)
e2:SetCondition(cm.actcon)
c:RegisterEffect(e2)
--Effect 3
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,2))
e2:SetCategory(CATEGORY_TOEXTRA+CATEGORY_GRAVE_ACTION)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetRange(LOCATION_MZONE)
e2:SetCode(EVENT_PHASE+PHASE_STANDBY)
e2:SetCountLimit(1)
e2:SetTarget(cm.rettg)
e2:SetOperation(cm.retop)
c:RegisterEffect(e2)
--Effect 4
--Effect 5
end
--spsummon condition
function cm.splimit(e,se,sp,st)
return se:GetHandler():IsCode(77000513)
end
--Effect 1
function cm.rmfilter(c)
return c:IsAbleToRemoveAsCost() and c:IsSetCard(0xee2)
and c:IsType(TYPE_MONSTER) and not c:IsAttack(0)
end
function cm.rmcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.rmfilter,tp,LOCATION_HAND+LOCATION_DECK,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,cm.rmfilter,tp,LOCATION_HAND+LOCATION_DECK,0,1,1,nil)
Duel.Remove(g,POS_FACEUP,REASON_COST)
e:SetLabel(g:GetFirst():GetAttack())
end
function cm.rmtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
end
function cm.rmop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=e:GetLabel()
if c:IsRelateToEffect(e) and c:IsFaceup() then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(tc)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE)
c:RegisterEffect(e1)
end
end
--Effect 2
function cm.actcon(e)
return Duel.GetAttacker()==e:GetHandler() or Duel.GetAttackTarget()==e:GetHandler()
end
--Effect 3
function cm.rettg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToExtra() end
Duel.SetOperationInfo(0,CATEGORY_TOEXTRA,e:GetHandler(),1,0,0)
end
function cm.retop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not e:GetHandler():IsRelateToEffect(e) or e:GetHandler():IsFacedown() then return end
Duel.SendtoDeck(e:GetHandler(),nil,SEQ_DECKSHUFFLE,REASON_EFFECT)
if c:IsLocation(LOCATION_EXTRA) then
if Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,nil)
and Duel.SelectYesNo(tp,aux.Stringid(m,1)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(Card.IsAbleToRemove),tp,LOCATION_GRAVE,LOCATION_GRAVE,1,2,nil)
if g:GetCount()>0 then
Duel.Remove(g,POS_FACEUP,REASON_EFFECT)
end
end
end
end
--Effect 4
--Effect 5
--临界精灵 梦魇-刻刻帝
local m=77000508
local cm=_G["c"..m]
function cm.initial_effect(c)
c:EnableReviveLimit()
--spsummon condition
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e0:SetCode(EFFECT_SPSUMMON_CONDITION)
e0:SetValue(cm.splimit)
c:RegisterEffect(e0)
--Effect 1
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_REMOVE)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_CHAINING)
e1:SetRange(LOCATION_MZONE)
e1:SetCondition(cm.condition)
e1:SetTarget(cm.disrmtg)
e1:SetOperation(cm.disrmop)
c:RegisterEffect(e1)
--Effect 2
local e11=Effect.CreateEffect(c)
e11:SetType(EFFECT_TYPE_SINGLE)
e11:SetCode(EFFECT_DIRECT_ATTACK)
c:RegisterEffect(e11)
--Effect 3
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH+CATEGORY_GRAVE_ACTION+CATEGORY_TOEXTRA)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCode(EVENT_TO_GRAVE)
e3:SetCondition(cm.thcon)
e3:SetTarget(cm.thtg)
e3:SetOperation(cm.thop)
c:RegisterEffect(e3)
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH+CATEGORY_GRAVE_ACTION+CATEGORY_TOEXTRA)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_REMOVE)
e2:SetTarget(cm.thtg)
e2:SetOperation(cm.thop)
c:RegisterEffect(e2)
--Effect 4
--Effect 5
end
--spsummon condition
function cm.splimit(e,se,sp,st)
return se:GetHandler():IsCode(77000513)
end
--Effect 1
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return rp==1-tp
end
function cm.disrmtg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local b1=Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,LOCATION_MZONE,LOCATION_MZONE,1,c) and Duel.GetFlagEffect(tp,m)==0
local b2=Duel.GetFieldGroupCount(tp,0,LOCATION_HAND)>0
and Duel.IsPlayerCanRemove(tp)
and Duel.GetFlagEffect(tp,m+1)==0
if chk==0 then return b1 or b2 end
end
function cm.disrmop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local b1=Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,LOCATION_MZONE,LOCATION_MZONE,1,c) and Duel.GetFlagEffect(tp,m)==0
local b2=Duel.GetFieldGroupCount(tp,0,LOCATION_HAND)>0
and Duel.IsPlayerCanRemove(tp)
and Duel.GetFlagEffect(tp,m+1)==0
local op=0
if b1 and b2 then op=Duel.SelectOption(tp,aux.Stringid(m,1),aux.Stringid(m,2))
elseif b1 then op=Duel.SelectOption(tp,aux.Stringid(m,1))
elseif b2 then op=Duel.SelectOption(tp,aux.Stringid(m,2))+1
else return end
if op==0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,Card.IsAbleToRemove,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,c)
local tc=g:GetFirst()
if g:GetCount()>0 then
if Duel.Remove(tc,0,REASON_EFFECT+REASON_TEMPORARY)~=0 then
tc:RegisterFlagEffect(m,RESET_EVENT+RESETS_STANDARD,0,1)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetReset(RESET_PHASE+PHASE_END,2)
e1:SetLabelObject(tc)
e1:SetCountLimit(1)
e1:SetCondition(cm.retcon)
e1:SetOperation(cm.retop)
Duel.RegisterEffect(e1,tp)
end
Duel.RegisterFlagEffect(tp,m,RESET_PHASE+PHASE_END,0,1)
end
else
local g=Duel.GetMatchingGroup(Card.IsAbleToRemove,tp,0,LOCATION_HAND,nil,tp,POS_FACEDOWN)
if g:GetCount()==0 then return end
local rg=g:RandomSelect(tp,1)
local tc1=rg:GetFirst()
Duel.Remove(tc1,POS_FACEDOWN,REASON_EFFECT)
tc1:RegisterFlagEffect(m,RESET_EVENT+RESETS_STANDARD,0,1)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetCountLimit(1)
e1:SetLabelObject(tc1)
e1:SetReset(RESET_PHASE+PHASE_END,2)
e1:SetCondition(cm.retcon)
e1:SetOperation(cm.retop1)
Duel.RegisterEffect(e1,tp)
Duel.RegisterFlagEffect(tp,m+1,RESET_PHASE+PHASE_END,0,1)
end
end
function cm.retcon(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject()
if tc:GetFlagEffect(m)==0 then
e:Reset()
return false
else
return Duel.GetTurnPlayer()==1-tp
end
end
function cm.retop(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject()
Duel.ReturnToField(tc)
Card.ResetFlagEffect(tc,m)
end
function cm.retop1(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject()
Duel.SendtoHand(tc,1-tp,REASON_EFFECT)
Card.ResetFlagEffect(tc,m)
end
--Effect 3
function cm.thcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPreviousLocation(LOCATION_ONFIELD)
end
function cm.thfilter(c)
return c:IsSetCard(0xee2) and c:IsAttribute(ATTRIBUTE_DARK) and c:IsAbleToHand()
end
function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.thfilter,tp,LOCATION_DECK,0,1,nil) and e:GetHandler():IsAbleToExtra()
and e:GetHandler():GetFlagEffect(m)==0 end
e:GetHandler():RegisterFlagEffect(m,RESET_CHAIN,0,1)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
Duel.SetOperationInfo(0,CATEGORY_TOEXTRA,e:GetHandler(),1,0,0)
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
Duel.SendtoDeck(e:GetHandler(),nil,SEQ_DECKSHUFFLE,REASON_EFFECT)
if c:IsLocation(LOCATION_EXTRA) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,cm.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
end
--临界精灵 炎魔-灼烂歼鬼
local m=77000509
local cm=_G["c"..m]
function cm.initial_effect(c)
c:EnableReviveLimit()
--spsummon condition
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e0:SetCode(EFFECT_SPSUMMON_CONDITION)
e0:SetValue(cm.splimit)
c:RegisterEffect(e0)
--Effect 1
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetTarget(cm.destg)
e1:SetOperation(cm.desop)
c:RegisterEffect(e1)
--Effect 2
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetCode(EFFECT_PIERCE)
e4:SetValue(DOUBLE_DAMAGE)
c:RegisterEffect(e4)
--Effect 3
local e14=Effect.CreateEffect(c)
e14:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_SINGLE)
e14:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e14:SetRange(LOCATION_MZONE)
e14:SetCode(EFFECT_DESTROY_REPLACE)
e14:SetTarget(cm.reptg)
c:RegisterEffect(e14)
--Effect 4
--Effect 5
end
--spsummon condition
function cm.splimit(e,se,sp,st)
return se:GetHandler():IsCode(77000513)
end
--Effect 1
function cm.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() end
if chk==0 then return Duel.IsExistingTarget(nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function cm.desop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.Destroy(tc,REASON_EFFECT)
end
end
--Effect 2
--Effect 3
function cm.repfilter(c)
return c:IsSetCard(0xee2) and c:IsAbleToRemove()
end
function cm.reptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsReason(REASON_BATTLE+REASON_EFFECT) and not c:IsReason(REASON_REPLACE)
and Duel.IsExistingMatchingCard(cm.repfilter,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,nil) end
if Duel.SelectEffectYesNo(tp,c,96) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESREPLACE)
local g=Duel.SelectMatchingCard(tp,cm.repfilter,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,1,nil)
Duel.Remove(g,POS_FACEUP,REASON_EFFECT+REASON_REPLACE)
return true
else return false end
end
--Effect 4
--Effect 5
--临界精灵 隐居者-冰结傀儡
local m=77000510
local cm=_G["c"..m]
function cm.initial_effect(c)
c:EnableReviveLimit()
--Effect 1
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DISABLE)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCountLimit(1,m)
e1:SetTarget(cm.distg)
e1:SetOperation(cm.disop)
c:RegisterEffect(e1)
--Effect 2
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_UPDATE_ATTACK)
e3:SetRange(LOCATION_MZONE)
e3:SetTargetRange(0,LOCATION_MZONE)
e3:SetCondition(cm.atkcon)
e3:SetTarget(cm.atktg)
e3:SetValue(-1000)
c:RegisterEffect(e3)
--Effect 3
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,0))
e2:SetCategory(CATEGORY_TOEXTRA+CATEGORY_GRAVE_ACTION)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetRange(LOCATION_MZONE)
e2:SetCode(EVENT_PHASE+PHASE_STANDBY)
e2:SetCountLimit(1)
e2:SetTarget(cm.rettg)
e2:SetOperation(cm.retop)
c:RegisterEffect(e2)
--Effect 4
--Effect 5
end
--Effect 1
function cm.distg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(aux.NegateEffectMonsterFilter,tp,0,LOCATION_MZONE,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_DISABLE,nil,1,tp,LOCATION_MZONE)
end
function cm.disop(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISABLE)
local g=Duel.SelectMatchingCard(tp,aux.NegateEffectMonsterFilter,tp,0,LOCATION_MZONE,1,1,nil)
local tc=g:GetFirst()
if tc then
Duel.HintSelection(g)
Duel.NegateRelatedChain(tc,RESET_TURN_SET)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetValue(RESET_TURN_SET)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e2)
end
end
--Effect 2
function cm.atkcon(e)
local tp=e:GetHandlerPlayer()
local a,d=Duel.GetBattleMonster(tp)
return Duel.GetCurrentPhase()==PHASE_DAMAGE_CAL and a and d and a:IsSetCard(0xee2)
end
function cm.atktg(e,c)
local tp=e:GetHandlerPlayer()
local a,d=Duel.GetBattleMonster(tp)
return c==d
end
--Effect 3
function cm.rettg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToExtra() end
Duel.SetOperationInfo(0,CATEGORY_TOEXTRA,e:GetHandler(),1,0,0)
end
function cm.retop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not e:GetHandler():IsRelateToEffect(e) or e:GetHandler():IsFacedown() then return end
Duel.SendtoDeck(e:GetHandler(),nil,SEQ_DECKSHUFFLE,REASON_EFFECT)
if c:IsLocation(LOCATION_EXTRA) then
if Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,nil)
and Duel.SelectYesNo(tp,aux.Stringid(m,1)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(Card.IsAbleToRemove),tp,LOCATION_GRAVE,LOCATION_GRAVE,1,1,nil)
if g:GetCount()>0 then
Duel.Remove(g,POS_FACEUP,REASON_EFFECT)
end
end
end
end
--Effect 4
--Effect 5
--临界精灵 自像幻视
local m=77000511
local cm=_G["c"..m]
function cm.initial_effect(c)
--link summon
c:EnableReviveLimit()
aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsLinkCode,77000502),1,1)
--cannot link material
local e31=Effect.CreateEffect(c)
e31:SetType(EFFECT_TYPE_SINGLE)
e31:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e31:SetCode(EFFECT_CANNOT_BE_LINK_MATERIAL)
e31:SetValue(cm.lmlimit)
c:RegisterEffect(e31)
--Effect 1
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_REMOVE)
e1:SetType(EFFECT_TYPE_TRIGGER_O+EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCondition(cm.thcon)
e1:SetTarget(cm.thtg)
e1:SetOperation(cm.thop)
c:RegisterEffect(e1)
--Effect 2
local e6=Effect.CreateEffect(c)
e6:SetType(EFFECT_TYPE_SINGLE)
e6:SetCode(EFFECT_UPDATE_ATTACK)
e6:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e6:SetRange(LOCATION_MZONE)
e6:SetValue(cm.atkval)
c:RegisterEffect(e6)
--Effect 3
--Effect 4
--Effect 5
end
--cannot link material
function cm.lmlimit(e)
local c=e:GetHandler()
return c:IsStatus(STATUS_SPSUMMON_TURN) and c:IsSummonType(SUMMON_TYPE_LINK)
end
--Effect 1
function cm.thcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_LINK)
end
function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,LOCATION_HAND,0,1,nil) end
local g=Duel.GetMatchingGroup(Card.IsAbleToRemove,tp,LOCATION_HAND,0,nil)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,1,0,0)
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,Card.IsAbleToRemove,tp,LOCATION_HAND,0,1,1,nil)
if g:GetCount()>0 then
Duel.Remove(g,POS_FACEUP,REASON_EFFECT)
end
end
--Effect 2
function cm.cfilter(c)
return c:IsFaceup() and c:IsSetCard(0xee2)
end
function cm.atkval(e,c)
return Duel.GetMatchingGroupCount(cm.cfilter,e:GetHandlerPlayer(),LOCATION_REMOVED,LOCATION_REMOVED,nil)*100
end
--Effect 3
--Effect 4
--Effect 5
--临界精灵 空间震
local m=77000512
local cm=_G["c"..m]
function cm.initial_effect(c)
--Effect 1
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetHintTiming(TIMINGS_CHECK_MONSTER+TIMING_SSET)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(cm.target)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
--Effect 2
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_REMOVE)
e2:SetCountLimit(1,m)
e2:SetTarget(cm.settg)
e2:SetOperation(cm.setop)
c:RegisterEffect(e2)
--Effect 3
--Effect 4
--Effect 5
end
--Effect 1
function cm.rmfilter(c)
return c:IsType(TYPE_MONSTER) and c:IsSetCard(0xee2)
and (c:IsLocation(LOCATION_HAND) or c:IsFaceup())
and c:IsAbleToRemove()
end
function cm.spfilter(c,e,tp)
return c:IsType(TYPE_MONSTER) and c:IsSetCard(0xee2)
and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
local b1=Duel.IsExistingMatchingCard(cm.rmfilter,tp,LOCATION_HAND+LOCATION_MZONE,0,1,nil)
and Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,0,LOCATION_ONFIELD,1,nil,tp)
local b2=Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_REMOVED,0,1,nil,e,tp)
if chk==0 then return b1 or b2 end
local s=0
if b1 and not b2 then
s=Duel.SelectOption(tp,aux.Stringid(m,0))
elseif not b1 and b2 then
s=Duel.SelectOption(tp,aux.Stringid(m,1))+1
elseif b1 and b2 then
s=Duel.SelectOption(tp,aux.Stringid(m,0),aux.Stringid(m,1))
end
e:SetLabel(s)
if s==0 then
e:SetCategory(CATEGORY_REMOVE)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,tp,LOCATION_HAND)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,1-tp,LOCATION_ONFIELD)
else
e:SetCategory(CATEGORY_SPECIAL_SUMMON)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_REMOVED)
end
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if e:GetLabel()==0 then
if not (Duel.IsExistingMatchingCard(cm.rmfilter,tp,LOCATION_HAND+LOCATION_MZONE,0,1,nil) and Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,0,LOCATION_ONFIELD,1,nil,tp)) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g1=Duel.SelectMatchingCard(tp,cm.rmfilter,tp,LOCATION_HAND+LOCATION_MZONE,0,1,1,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g2=Duel.SelectMatchingCard(tp,Card.IsAbleToRemove,tp,0,LOCATION_ONFIELD,1,1,nil,tp)
g1:Merge(g2)
Duel.HintSelection(g1)
Duel.Remove(g1,POS_FACEUP,REASON_EFFECT)
end
if e:GetLabel()==1 then
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,cm.spfilter,tp,LOCATION_REMOVED,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
end
--Effect 2
function cm.settg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsSSetable() end
end
function cm.setop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.SSet(tp,c)
end
end
--Effect 3
--Effect 4
--Effect 5
--临界精灵 神威灵装
local m=77000513
local cm=_G["c"..m]
function cm.initial_effect(c)
--Effect 1
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMING_END_PHASE)
e1:SetTarget(cm.target)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
--Effect 2
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_REMOVE)
e2:SetCountLimit(1,m)
e2:SetTarget(cm.settg)
e2:SetOperation(cm.setop)
c:RegisterEffect(e2)
--Effect 3
--Effect 4
--Effect 5
end
--Effect 1
function cm.tfilter(c,att,e,tp,tc)
return c:IsSetCard(0xee2) and c:IsAttribute(att)
and c:IsCanBeSpecialSummoned(e,0,tp,true,false) and Duel.GetLocationCountFromEx(tp,tp,tc,c)>0
end
function cm.filter(c,e,tp)
return c:IsFaceup() and c:IsSetCard(0xee2) and c:IsType(TYPE_MONSTER)
and c:IsAbleToRemove()
and Duel.IsExistingMatchingCard(cm.tfilter,tp,LOCATION_EXTRA,0,1,nil,c:GetAttribute(),e,tp,c)
end
function cm.chkfilter(c,att)
return c:IsFaceup() and c:IsSetCard(0xee2) and (c:GetAttribute()&att)==att
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) and cm.chkfilter(chkc,e:GetLabel()) end
if chk==0 then return Duel.IsExistingTarget(cm.filter,tp,LOCATION_MZONE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectTarget(tp,cm.filter,tp,LOCATION_MZONE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,tp,LOCATION_ONFIELD)
e:SetLabel(g:GetFirst():GetAttribute())
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if not tc:IsRelateToEffect(e) then return end
local att=tc:GetAttribute()
if Duel.Remove(tc,POS_FACEUP,REASON_EFFECT)==0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=Duel.SelectMatchingCard(tp,cm.tfilter,tp,LOCATION_EXTRA,0,1,1,nil,att,e,tp,nil)
if sg:GetCount()>0 then
Duel.BreakEffect()
Duel.SpecialSummon(sg,0,tp,tp,true,false,POS_FACEUP)
sg:GetFirst():CompleteProcedure()
end
end
--Effect 2
function cm.settg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsSSetable() end
end
function cm.setop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.SSet(tp,c)
end
end
--Effect 3
--Effect 4
--Effect 5
--临界精灵 歌姬
local m=77000515
local cm=_G["c"..m]
function cm.initial_effect(c)
--Effect 1
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_CONTROL)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCountLimit(1,m)
e1:SetTarget(cm.postg)
e1:SetOperation(cm.posop)
c:RegisterEffect(e1)
local e15=e1:Clone()
e15:SetCode(EVENT_SUMMON_SUCCESS)
c:RegisterEffect(e15)
--Effect 2
local e12=Effect.CreateEffect(c)
e12:SetDescription(aux.Stringid(m,1))
e12:SetCategory(CATEGORY_SPECIAL_SUMMON)
e12:SetProperty(EFFECT_FLAG_DELAY)
e12:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e12:SetRange(LOCATION_REMOVED)
e12:SetCode(EVENT_SPSUMMON_SUCCESS)
e12:SetCountLimit(1,m+100)
e12:SetTarget(cm.remtg1)
e12:SetOperation(cm.remop1)
c:RegisterEffect(e12)
local e13=e12:Clone()
e13:SetCode(EVENT_SUMMON_SUCCESS)
c:RegisterEffect(e13)
--Effect 3
--Effect 4
--Effect 5
end
--Effect 1
function cm.postg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:GetLocation()==LOCATION_MZONE and chkc:GetControler()~=tp and chkc:IsControlerCanBeChanged() end
if chk==0 then return Duel.IsExistingTarget(Card.IsControlerCanBeChanged,tp,0,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONTROL)
local g=Duel.SelectTarget(tp,Card.IsControlerCanBeChanged,tp,0,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_CONTROL,g,1,0,0)
end
function cm.posop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.GetControl(tc,tp)~=0 then
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(cm.descon)
e2:SetOperation(cm.desop)
Duel.RegisterEffect(e2,tp)
end
end
function cm.descon(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
function cm.desop(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject()
if tc:IsAbleToRemove() then
Duel.Remove(tc,POS_FACEUP,REASON_EFFECT)
end
end
--Effect 2
function cm.filter(c,e,tp)
return c:IsSummonPlayer(1-tp) and c:IsLocation(LOCATION_MZONE)
end
function cm.remtg1(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return eg:IsExists(cm.filter,1,nil,nil,tp)
and 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.remop1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
end
--Effect 3
--Effect 4
--Effect 5
--临界精灵 狂战士
local m=77000516
local cm=_G["c"..m]
function cm.initial_effect(c)
--Effect 1
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.spcon)
e1:SetOperation(cm.spop)
c:RegisterEffect(e1)
--Effect 2
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,0))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCode(EVENT_CHAINING)
e3:SetRange(LOCATION_REMOVED)
e3:SetCountLimit(1,m+100)
e3:SetCondition(cm.con)
e3:SetTarget(cm.tg)
e3:SetOperation(cm.op)
c:RegisterEffect(e3)
local e5=Effect.CreateEffect(c)
e5:SetCategory(CATEGORY_SPECIAL_SUMMON)
e5:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e5:SetCode(EVENT_MSET)
e5:SetRange(LOCATION_REMOVED)
e5:SetProperty(EFFECT_FLAG_DELAY)
e5:SetCountLimit(1,m+100)
e5:SetCondition(cm.con2)
e5:SetTarget(cm.tg)
e5:SetOperation(cm.op)
c:RegisterEffect(e5)
local e6=e5:Clone()
e6:SetCode(EVENT_SSET)
c:RegisterEffect(e6)
local e7=Effect.CreateEffect(c)
e7:SetCategory(CATEGORY_SPECIAL_SUMMON)
e7:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e7:SetCode(EVENT_CHANGE_POS)
e7:SetRange(LOCATION_REMOVED)
e7:SetProperty(EFFECT_FLAG_DELAY)
e7:SetCountLimit(1,m+100)
e7:SetCondition(cm.con3)
e7:SetTarget(cm.tg)
e7:SetOperation(cm.op)
c:RegisterEffect(e7)
--Effect 3
--Effect 4
--Effect 5
end
--Effect 1
function cm.spfilter(c)
return c:IsSetCard(0xee2) and c:IsAbleToRemoveAsCost()
end
function cm.spcon(e,c)
if c==nil then return true end
local tp=e:GetHandlerPlayer()
return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_HAND,0,1,c)
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp,c)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,cm.spfilter,tp,LOCATION_HAND,0,1,1,c)
Duel.Remove(g,POS_FACEUP,REASON_COST)
end
--Effect 2
function cm.con2(e,tp,eg,ep,ev,re,r,rp)
return rp~=tp
end
function cm.cfilter(c,tp,rp)
return c:IsFacedown() and rp==tp
end
function cm.con3(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(cm.cfilter,1,nil,1-tp,rp)
end
function cm.con(e,tp,eg,ep,ev,re,r,rp)
return re:IsHasType(EFFECT_TYPE_ACTIVATE) and rp~=tp
end
function cm.tg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
end
function cm.op(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
if Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)>0 then
if Duel.IsExistingMatchingCard(cm.strfilter,tp,0,LOCATION_ONFIELD,1,nil)
and Duel.SelectYesNo(tp,aux.Stringid(m,1)) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,cm.strfilter,tp,0,LOCATION_ONFIELD,1,1,nil)
Duel.HintSelection(g)
Duel.Remove(g,POS_FACEUP,REASON_EFFECT)
end
end
end
function cm.strfilter(c)
return c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsAbleToRemove()
end
--Effect 3
--Effect 4
--Effect 5
--临界精灵 女巫
local m=77000517
local cm=_G["c"..m]
function cm.initial_effect(c)
--Effect 1
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_REMOVE)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetTarget(cm.tgtg)
e1:SetOperation(cm.tgop)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e2)
--Effect 2
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_XYZ_LEVEL)
e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e3:SetRange(LOCATION_MZONE)
e3:SetValue(cm.xyzlv)
e3:SetLabel(7)
c:RegisterEffect(e3)
--Effect 3
local e12=Effect.CreateEffect(c)
e12:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_POSITION)
e12:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e12:SetCode(EVENT_ATTACK_ANNOUNCE)
e12:SetRange(LOCATION_REMOVED)
e12:SetCountLimit(1,m)
e12:SetCondition(cm.negcon)
e12:SetTarget(cm.negtg)
e12:SetOperation(cm.negop)
c:RegisterEffect(e12)
--Effect 4
--Effect 5
end
--Effect 1
function cm.tgtg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsAbleToRemove() end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,c,1,0,0)
end
function cm.tgop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.Remove(e:GetHandler(),POS_FACEUP,REASON_EFFECT)
end
end
--Effect 2
function cm.xyzlv(e,c,rc)
if rc:IsType(TYPE_XYZ) then
return c:GetLevel()+0x10000*e:GetLabel()
else
return c:GetLevel()
end
end
--Effect 3
function cm.negcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetAttacker():GetControler()~=tp
end
function cm.negtg(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.negop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
if Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)>0 then
if Duel.IsExistingMatchingCard(cm.cgfilter,tp,0,LOCATION_MZONE,1,nil) then
Duel.BreakEffect()
local g=Duel.GetMatchingGroup(cm.cgfilter,tp,0,LOCATION_MZONE,nil)
Duel.ChangePosition(g,POS_FACEUP_DEFENSE)
end
end
end
function cm.cgfilter(c)
return c:IsPosition(POS_FACEUP_ATTACK) and c:IsCanChangePosition()
end
--Effect 4
--Effect 5
--临界精灵 天使
local m=77000518
local cm=_G["c"..m]
function cm.initial_effect(c)
--Effect 1
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)
e1:SetCondition(cm.spcon)
e1:SetOperation(cm.spop)
c:RegisterEffect(e1)
--Effect 2
local e12=Effect.CreateEffect(c)
e12:SetDescription(aux.Stringid(m,1))
e12:SetCategory(CATEGORY_SPECIAL_SUMMON)
e12:SetProperty(EFFECT_FLAG_DELAY)
e12:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e12:SetRange(LOCATION_REMOVED)
e12:SetCode(EVENT_SPSUMMON_SUCCESS)
e12:SetCountLimit(1,m+100)
e12:SetTarget(cm.remtg1)
e12:SetOperation(cm.remop1)
c:RegisterEffect(e12)
local e13=e12:Clone()
e13:SetCode(EVENT_SUMMON_SUCCESS)
c:RegisterEffect(e13)
--Effect 3
--Effect 4
--Effect 5
end
--Effect 1
function cm.spfilter(c,tp)
return c:IsReleasable() and Duel.GetMZoneCount(1-tp,c,tp)>0
end
function cm.cfilter(c)
return c:IsFaceup() and c:IsSetCard(0xee2)
end
function cm.spcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
return Duel.IsExistingMatchingCard(cm.spfilter,tp,0,LOCATION_MZONE,1,nil,tp) and Duel.IsExistingMatchingCard(cm.cfilter,tp,LOCATION_MZONE,0,1,nil)
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp,c)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local g=Duel.SelectMatchingCard(tp,cm.spfilter,tp,0,LOCATION_MZONE,1,1,nil,tp)
Duel.Release(g,REASON_COST)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_DRAW)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetTarget(cm.target)
e1:SetOperation(cm.operation)
e1:SetReset(RESET_EVENT+0xec0000+RESET_PHASE+PHASE_END)
c:RegisterEffect(e1)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
local p1=1-e:GetHandlerPlayer()
if chk==0 then return true end
Duel.SetTargetPlayer(p1)
Duel.SetTargetParam(1)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end
function cm.operation(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
--Effect 2
function cm.filter(c,e,tp)
return c:IsSummonPlayer(1-tp) and c:IsLocation(LOCATION_MZONE)
end
function cm.remtg1(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return eg:IsExists(cm.filter,1,nil,nil,tp)
and 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.remop1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
end
--Effect 3
--Effect 4
--Effect 5
--临界精灵 歌姬-破军歌姬
local m=77000519
local cm=_G["c"..m]
function cm.initial_effect(c)
c:EnableReviveLimit()
--spsummon condition
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_SPSUMMON_CONDITION)
e1:SetValue(cm.splimit)
c:RegisterEffect(e1)
--Effect 1
local e13=Effect.CreateEffect(c)
e13:SetDescription(aux.Stringid(m,0))
e13:SetCategory(CATEGORY_ATKCHANGE)
e13:SetType(EFFECT_TYPE_IGNITION)
e13:SetRange(LOCATION_MZONE)
e13:SetCountLimit(1)
e13:SetTarget(cm.adtg)
e13:SetOperation(cm.adop)
c:RegisterEffect(e13)
--Effect 2
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetRange(LOCATION_MZONE)
e2:SetCode(EFFECT_CANNOT_RELEASE)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetTargetRange(LOCATION_MZONE,0)
e2:SetTarget(cm.indtg)
c:RegisterEffect(e2)
local ea=Effect.CreateEffect(c)
ea:SetCode(EFFECT_CANNOT_CHANGE_CONTROL)
ea:SetType(EFFECT_TYPE_FIELD)
ea:SetRange(LOCATION_MZONE)
ea:SetTargetRange(LOCATION_MZONE,0)
ea:SetTarget(cm.indtg)
ea:SetValue(1)
c:RegisterEffect(ea)
--Effect 3
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,2))
e2:SetCategory(CATEGORY_TOEXTRA+CATEGORY_GRAVE_ACTION)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetRange(LOCATION_MZONE)
e2:SetCode(EVENT_PHASE+PHASE_STANDBY)
e2:SetCountLimit(1)
e2:SetTarget(cm.rettg)
e2:SetOperation(cm.retop)
c:RegisterEffect(e2)
--Effect 4
--Effect 5
end
--spsummon condition
function cm.splimit(e,se,sp,st)
return se:GetHandler():IsCode(77000513)
end
--Effect 1
function cm.adfilter(c)
return c:IsFaceup() and c:IsSetCard(0xee2)
end
function cm.adtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.adfilter,tp,LOCATION_MZONE,0,1,nil) end
end
function cm.adop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(cm.adfilter,tp,LOCATION_MZONE,0,nil)
local tc=g:GetFirst()
while tc do
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(500)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
tc=g:GetNext()
end
end
--Effect 2
function cm.indtg(e,c)
return c:IsSetCard(0xee2) and c:IsFaceup()
end
--Effect 3
function cm.rettg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToExtra() end
Duel.SetOperationInfo(0,CATEGORY_TOEXTRA,e:GetHandler(),1,0,0)
end
function cm.retop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not e:GetHandler():IsRelateToEffect(e) or e:GetHandler():IsFacedown() then return end
Duel.SendtoDeck(e:GetHandler(),nil,SEQ_DECKSHUFFLE,REASON_EFFECT)
if c:IsLocation(LOCATION_EXTRA) then
if Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,nil)
and Duel.SelectYesNo(tp,aux.Stringid(m,1)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(Card.IsAbleToRemove),tp,LOCATION_GRAVE,LOCATION_GRAVE,1,2,nil)
if g:GetCount()>0 then
Duel.Remove(g,POS_FACEUP,REASON_EFFECT)
end
end
end
end
--Effect 4
--Effect 5
--临界精灵 狂战士-飓风骑士
local m=77000520
local cm=_G["c"..m]
function cm.initial_effect(c)
c:EnableReviveLimit()
--spsummon condition
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e0:SetCode(EFFECT_SPSUMMON_CONDITION)
e0:SetValue(cm.splimit)
c:RegisterEffect(e0)
--Effect 1
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(m,0))
e4:SetCategory(CATEGORY_REMOVE)
e4:SetType(EFFECT_TYPE_IGNITION)
e4:SetRange(LOCATION_MZONE)
e4:SetCountLimit(1)
e4:SetProperty(EFFECT_FLAG_CARD_TARGET)
e4:SetTarget(cm.destg)
e4:SetOperation(cm.desop)
c:RegisterEffect(e4)
--Effect 2
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_EXTRA_ATTACK)
e1:SetValue(1)
c:RegisterEffect(e1)
--Effect 3
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,2))
e2:SetCategory(CATEGORY_TOEXTRA+CATEGORY_GRAVE_ACTION)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetRange(LOCATION_MZONE)
e2:SetCode(EVENT_PHASE+PHASE_STANDBY)
e2:SetCountLimit(1)
e2:SetTarget(cm.rettg)
e2:SetOperation(cm.retop)
c:RegisterEffect(e2)
--Effect 4
--Effect 5
end
--spsummon condition
function cm.splimit(e,se,sp,st)
return se:GetHandler():IsCode(77000513)
end
--Effect 1
function cm.desfilter(c)
return c:IsFacedown()
end
function cm.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_SZONE) and chkc:IsControler(1-tp) and cm.desfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(cm.desfilter,tp,0,LOCATION_SZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectTarget(tp,cm.desfilter,tp,0,LOCATION_SZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,1,0,0)
Duel.SetChainLimit(cm.chainlimit)
end
function cm.chainlimit(e,rp,tp)
return not e:IsHasType(EFFECT_TYPE_ACTIVATE)
end
function cm.desop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsFacedown() and tc:IsRelateToEffect(e) then
Duel.Remove(tc,POS_FACEUP,REASON_EFFECT)
end
end
--Effect 2
--Effect 3
function cm.rettg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToExtra() end
Duel.SetOperationInfo(0,CATEGORY_TOEXTRA,e:GetHandler(),1,0,0)
end
function cm.retop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not e:GetHandler():IsRelateToEffect(e) or e:GetHandler():IsFacedown() then return end
Duel.SendtoDeck(e:GetHandler(),nil,SEQ_DECKSHUFFLE,REASON_EFFECT)
if c:IsLocation(LOCATION_EXTRA) then
if Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,nil)
and Duel.SelectYesNo(tp,aux.Stringid(m,1)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(Card.IsAbleToRemove),tp,LOCATION_GRAVE,LOCATION_GRAVE,1,2,nil)
if g:GetCount()>0 then
Duel.Remove(g,POS_FACEUP,REASON_EFFECT)
end
end
end
end
--Effect 4
--Effect 5
--临界精灵 女巫-赝造魔女
local m=77000521
local cm=_G["c"..m]
function cm.initial_effect(c)
c:EnableReviveLimit()
--spsummon condition
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e0:SetCode(EFFECT_SPSUMMON_CONDITION)
e0:SetValue(cm.splimit)
c:RegisterEffect(e0)
--Effect 1
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetRange(LOCATION_MZONE)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER)
e1:SetCountLimit(1,m)
e1:SetCost(cm.copycost)
e1:SetTarget(cm.copytg)
e1:SetOperation(cm.copyop)
c:RegisterEffect(e1)
--Effect 2
local ea=Effect.CreateEffect(c)
ea:SetDescription(aux.Stringid(m,4))
ea:SetCategory(CATEGORY_POSITION)
ea:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
ea:SetCode(EVENT_BATTLE_START)
ea:SetTarget(cm.rmtg)
ea:SetOperation(cm.rmop)
c:RegisterEffect(ea)
--Effect 3
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,2))
e2:SetCategory(CATEGORY_TOEXTRA+CATEGORY_GRAVE_ACTION)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetRange(LOCATION_MZONE)
e2:SetCode(EVENT_PHASE+PHASE_STANDBY)
e2:SetCountLimit(1)
e2:SetTarget(cm.rettg)
e2:SetOperation(cm.retop)
c:RegisterEffect(e2)
--Effect 4
--Effect 5
end
--spsummon condition
function cm.splimit(e,se,sp,st)
return se:GetHandler():IsCode(77000513)
end
--Effect 1
function cm.copycost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():GetFlagEffect(m)==0 end
e:GetHandler():RegisterFlagEffect(m,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1)
end
function cm.copyfilter(c)
return c:IsType(TYPE_MONSTER) and not c:IsType(TYPE_TOKEN)
and c:IsFaceup()
end
function cm.copytg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local c=e:GetHandler()
if chkc then return chkc:IsLocation(LOCATION_REMOVED) and cm.copyfilter(chkc) and chkc~=c end
if chk==0 then return Duel.IsExistingTarget(cm.copyfilter,tp,LOCATION_REMOVED,LOCATION_REMOVED,1,c) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,cm.copyfilter,tp,LOCATION_REMOVED,LOCATION_REMOVED,1,1,c)
end
function cm.copyop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc and c:IsRelateToEffect(e) and c:IsFaceup() and tc:IsRelateToEffect(e) then
local code=tc:GetOriginalCodeRule()
local cid=0
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EFFECT_CHANGE_CODE)
e1:SetValue(code)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
c:RegisterEffect(e1)
if not tc:IsType(TYPE_TRAPMONSTER) then
cid=c:CopyEffect(code,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,1)
end
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,3))
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EVENT_PHASE+PHASE_END)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e3:SetCountLimit(1)
e3:SetRange(LOCATION_MZONE)
e3:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
e3:SetLabelObject(e1)
e3:SetLabel(cid)
e3:SetOperation(cm.rstop)
c:RegisterEffect(e3)
end
end
function cm.rstop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local cid=e:GetLabel()
if cid~=0 then
c:ResetEffect(cid,RESET_COPY)
c:ResetEffect(RESET_DISABLE,RESET_EVENT)
end
local e1=e:GetLabelObject()
e1:Reset()
Duel.HintSelection(Group.FromCards(c))
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
end
--Effect 2
function cm.rmtg(e,tp,eg,ep,ev,re,r,rp,chk)
local tc=e:GetHandler():GetBattleTarget()
if chk==0 then return tc and tc:IsControler(1-tp) and tc:IsCanChangePosition() end
Duel.SetOperationInfo(0,CATEGORY_POSITION,tc,1,0,0)
end
function cm.rmop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=e:GetHandler():GetBattleTarget()
if tc:IsRelateToBattle() then
if Duel.ChangePosition(tc,POS_FACEUP_DEFENSE,POS_FACEDOWN_DEFENSE,POS_FACEUP_ATTACK,POS_FACEUP_ATTACK)~=0 then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK_FINAL)
e1:SetValue(0)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_SET_DEFENSE_FINAL)
e2:SetValue(0)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e2)
end
end
end
--Effect 3
function cm.rettg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToExtra() end
Duel.SetOperationInfo(0,CATEGORY_TOEXTRA,e:GetHandler(),1,0,0)
end
function cm.retop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not e:GetHandler():IsRelateToEffect(e) or e:GetHandler():IsFacedown() then return end
Duel.SendtoDeck(e:GetHandler(),nil,SEQ_DECKSHUFFLE,REASON_EFFECT)
if c:IsLocation(LOCATION_EXTRA) then
if Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,nil)
and Duel.SelectYesNo(tp,aux.Stringid(m,1)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(Card.IsAbleToRemove),tp,LOCATION_GRAVE,LOCATION_GRAVE,1,1,nil)
if g:GetCount()>0 then
Duel.Remove(g,POS_FACEUP,REASON_EFFECT)
end
end
end
end
--Effect 4
--Effect 5
\ No newline at end of file
--临界精灵 天使-绝灭天使
local m=77000522
local cm=_G["c"..m]
function cm.initial_effect(c)
c:EnableReviveLimit()
--spsummon condition
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e0:SetCode(EFFECT_SPSUMMON_CONDITION)
e0:SetValue(cm.splimit)
c:RegisterEffect(e0)
--Effect 1
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,0))
e2:SetCategory(CATEGORY_NEGATE+CATEGORY_REMOVE)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_CHAINING)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL+EFFECT_FLAG_NO_TURN_RESET)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1)
e2:SetCondition(cm.discon)
e2:SetTarget(cm.distg)
e2:SetOperation(cm.disop)
c:RegisterEffect(e2)
--Effect 2
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EVENT_CHAINING)
e3:SetRange(LOCATION_MZONE)
e3:SetCondition(cm.negcon)
e3:SetOperation(cm.negop)
c:RegisterEffect(e3)
local e13=Effect.CreateEffect(c)
e13:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e13:SetCode(EVENT_CHAIN_END)
e13:SetRange(LOCATION_MZONE)
e13:SetCondition(cm.damcon)
e13:SetOperation(cm.damop)
c:RegisterEffect(e13)
--Effect 3
local e4=Effect.CreateEffect(c)
e4:SetCategory(CATEGORY_REMOVE+CATEGORY_TOEXTRA)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e4:SetCode(EVENT_DESTROYED)
e4:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP)
e4:SetRange(LOCATION_REMOVED)
e4:SetCountLimit(1,m)
e4:SetCondition(cm.retcon)
e4:SetTarget(cm.rettg)
e4:SetOperation(cm.retop)
c:RegisterEffect(e4)
--Effect 4
--Effect 5
end
--spsummon condition
function cm.splimit(e,se,sp,st)
return se:GetHandler():IsCode(77000513)
end
--Effect 1
function cm.discon(e,tp,eg,ep,ev,re,r,rp)
return not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) and Duel.IsChainNegatable(ev)
end
function cm.distg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return aux.nbcon(tp,re) end
e:GetHandler():RegisterFlagEffect(0,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(m,3))
Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0)
if re:GetHandler():IsRelateToEffect(re) then
Duel.SetOperationInfo(0,CATEGORY_REMOVE,eg,1,0,0)
end
end
function cm.disop(e,tp,eg,ep,ev,re,r,rp)
if Duel.NegateActivation(ev) and re:GetHandler():IsRelateToEffect(re) then
Duel.Remove(eg,POS_FACEUP,REASON_EFFECT)
end
end
--Effect 2
function cm.recon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetFlagEffect(m)>0
end
function cm.rmlimit(e,c,tp,r)
return (c:IsSetCard(0xee2) and c:IsFaceup()) and c~=e:GetHandler()
and r==REASON_EFFECT
end
function cm.negcon(e,tp,eg,ep,ev,re,r,rp)
return rp==1-tp
end
function cm.negop(e,tp,eg,ep,ev,re,r,rp)
local e4=Effect.CreateEffect(e:GetHandler())
e4:SetType(EFFECT_TYPE_FIELD)
e4:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e4:SetCode(EFFECT_CANNOT_REMOVE)
e4:SetRange(LOCATION_MZONE)
e4:SetTargetRange(LOCATION_MZONE,0)
e4:SetCondition(cm.recon)
e4:SetTarget(cm.rmlimit)
e4:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e4,tp)
e:GetHandler():RegisterFlagEffect(m,RESET_PHASE+PHASE_END,0,1)
end
function cm.damcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return ep~=tp and c:GetFlagEffect(m)~=0
end
function cm.damop(e,tp,eg,ep,ev,re,r,rp)
Card.ResetFlagEffect(e:GetHandler(),m)
end
--Effect 3
function cm.drcfilter(c,tp)
return c:IsPreviousLocation(LOCATION_ONFIELD) and c:IsReason(REASON_BATTLE+REASON_EFFECT)
end
function cm.retcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(cm.drcfilter,1,nil,tp)
end
function cm.rettg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToExtra() end
Duel.SetOperationInfo(0,CATEGORY_TOEXTRA,e:GetHandler(),1,0,0)
end
function cm.retop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
Duel.SendtoDeck(e:GetHandler(),nil,SEQ_DECKSHUFFLE,REASON_EFFECT)
if c:IsLocation(LOCATION_EXTRA) then
if Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,Card.IsAbleToRemove,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
if g:GetCount()>0 then
Duel.Remove(g,POS_FACEUP,REASON_EFFECT)
end
end
end
end
--Effect 4
--Effect 5
--反转体 天香-暴虐公
local m=77000523
local cm=_G["c"..m]
function cm.initial_effect(c)
c:EnableReviveLimit()
--spsummon condition
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_SPSUMMON_CONDITION)
e1:SetValue(cm.splimit)
c:RegisterEffect(e1)
--Effect 1
local e13=Effect.CreateEffect(c)
e13:SetCategory(CATEGORY_DESTROY)
e13:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e13:SetCode(EVENT_SPSUMMON_SUCCESS)
e13:SetTarget(cm.destg)
e13:SetOperation(cm.desop)
c:RegisterEffect(e13)
--Effect 2
local e21=Effect.CreateEffect(c)
e21:SetType(EFFECT_TYPE_SINGLE)
e21:SetCode(EFFECT_IMMUNE_EFFECT)
e21:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e21:SetRange(LOCATION_MZONE)
e21:SetValue(cm.immval)
c:RegisterEffect(e21)
local e22=Effect.CreateEffect(c)
e22:SetType(EFFECT_TYPE_SINGLE)
e22:SetCode(EFFECT_IMMUNE_EFFECT)
e22:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e22:SetRange(LOCATION_MZONE)
e22:SetValue(cm.stefilter)
c:RegisterEffect(e22)
--Effect 3
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,2))
e2:SetCategory(CATEGORY_TOEXTRA+CATEGORY_REMOVE)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e2:SetRange(LOCATION_MZONE)
e2:SetCode(EVENT_PHASE+PHASE_END)
e2:SetCountLimit(1)
e2:SetCondition(cm.reccon)
e2:SetTarget(cm.rettg)
e2:SetOperation(cm.retop)
c:RegisterEffect(e2)
--Effect 4
--Effect 5
end
--spsummon condition
function cm.splimit(e,se,sp,st)
return se:GetHandler():IsCode(77000528)
end
--Effect 1
function cm.destg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,c) end
local sg=Duel.GetMatchingGroup(Card.IsAbleToRemove,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,c)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,sg,sg:GetCount(),0,0)
end
function cm.desop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local sg=Duel.GetMatchingGroup(nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,aux.ExceptThisCard(e))
local ct=Duel.Destroy(sg,REASON_EFFECT,LOCATION_REMOVED)
if ct>0 and c:IsFaceup() and c:IsRelateToEffect(e) then
local og=Duel.GetOperatedGroup()
local g=og:FilterCount(cm.dsfilter,nil)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetProperty(EFFECT_FLAG_COPY_INHERIT)
e1:SetValue(g*1000)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE)
c:RegisterEffect(e1)
end
end
function cm.dsfilter(c)
return c:IsSetCard(0xee2) and c:IsType(TYPE_MONSTER)
end
--Effect 2
function cm.immval(e,te)
local tc=te:GetOwner()
return tc~=e:GetHandler() and te:IsActiveType(TYPE_MONSTER) and te:IsActivated()
and te:GetActivateLocation()==LOCATION_MZONE and tc:IsSummonLocation(LOCATION_EXTRA)
end
function cm.stefilter(e,te)
return te:IsActiveType(TYPE_SPELL+TYPE_TRAP)
end
--Effect 3
function cm.reccon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()~=tp
end
function cm.rettg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_TOEXTRA,e:GetHandler(),1,0,0)
end
function cm.retop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not e:GetHandler():IsRelateToEffect(e) or e:GetHandler():IsFacedown() then return end
Duel.SendtoDeck(e:GetHandler(),nil,SEQ_DECKSHUFFLE,REASON_EFFECT)
if c:IsLocation(LOCATION_EXTRA) then
if Duel.IsExistingMatchingCard(cm.deckfilter,tp,LOCATION_DECK,0,1,nil)
and Duel.SelectYesNo(tp,aux.Stringid(m,1)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,cm.deckfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.Remove(g,POS_FACEUP,REASON_EFFECT)
end
end
end
end
function cm.deckfilter(c)
return c:IsAbleToRemove() and c:IsSetCard(0xee2)
end
--Effect 4
--Effect 5
\ No newline at end of file
--临界精灵 星宫-封解主
local m=77000524
local cm=_G["c"..m]
function cm.initial_effect(c)
c:EnableReviveLimit()
--spsummon condition
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e0:SetCode(EFFECT_SPSUMMON_CONDITION)
e0:SetValue(cm.splimit)
c:RegisterEffect(e0)
--Effect 1
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,0))
e2:SetCategory(CATEGORY_DISABLE)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_CHAINING)
e2:SetProperty(EFFECT_FLAG_NO_TURN_RESET)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1)
e2:SetCondition(cm.discon)
e2:SetTarget(cm.distg)
e2:SetOperation(cm.disop)
c:RegisterEffect(e2)
--Effect 2
local e6=Effect.CreateEffect(c)
e6:SetType(EFFECT_TYPE_SINGLE)
e6:SetCode(EFFECT_UPDATE_ATTACK)
e6:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e6:SetRange(LOCATION_MZONE)
e6:SetValue(cm.atkval)
c:RegisterEffect(e6)
--Effect 3
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,2))
e2:SetCategory(CATEGORY_TOEXTRA+CATEGORY_DISABLE)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetRange(LOCATION_MZONE)
e2:SetCode(EVENT_PHASE+PHASE_STANDBY)
e2:SetCountLimit(1)
e2:SetTarget(cm.rettg)
e2:SetOperation(cm.retop)
c:RegisterEffect(e2)
--Effect 4
--Effect 5
end
--spsummon condition
function cm.splimit(e,se,sp,st)
return se:GetHandler():IsCode(77000513)
end
--Effect 1
function cm.discon(e,tp,eg,ep,ev,re,r,rp)
local ct=Duel.GetCurrentChain()
if ct<2 then return end
if not Duel.IsChainDisablable(ev) then return false end
local te,p=Duel.GetChainInfo(ct-1,CHAININFO_TRIGGERING_EFFECT,CHAININFO_TRIGGERING_PLAYER)
return not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED)
and te and te:GetHandler():IsSetCard(0xee2)
and p==tp and rp==1-tp
end
function cm.distg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
e:GetHandler():RegisterFlagEffect(0,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(m,3))
Duel.SetOperationInfo(0,CATEGORY_DISABLE,eg,1,0,0)
end
function cm.disop(e,tp,eg,ep,ev,re,r,rp)
Duel.NegateEffect(ev)
end
--Effect 2
function cm.cfilter(c)
return c:IsFaceup() and c:IsSetCard(0xee2)
end
function cm.atkval(e,c)
return Duel.GetMatchingGroupCount(cm.cfilter,e:GetHandlerPlayer(),LOCATION_REMOVED,LOCATION_REMOVED,nil)*100
end
--Effect 3
function cm.rettg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToExtra() end
Duel.SetOperationInfo(0,CATEGORY_TOEXTRA,e:GetHandler(),1,0,0)
end
function cm.retop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tg=Duel.GetMatchingGroup(aux.NegateAnyFilter,tp,0,LOCATION_ONFIELD,nil)
if not e:GetHandler():IsRelateToEffect(e) or e:GetHandler():IsFacedown() then return end
Duel.SendtoDeck(e:GetHandler(),nil,SEQ_DECKSHUFFLE,REASON_EFFECT)
if c:IsLocation(LOCATION_EXTRA) then
if #tg>0 and Duel.SelectYesNo(tp,aux.Stringid(m,1)) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISABLE)
local sg=tg:Select(tp,1,1,nil)
Duel.HintSelection(sg)
local tc=sg:GetFirst()
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
end
end
end
--Effect 4
--Effect 5
--临界精灵 修女-嗫告篇帙
local m=77000525
local cm=_G["c"..m]
function cm.initial_effect(c)
c:EnableReviveLimit()
--spsummon condition
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e0:SetCode(EFFECT_SPSUMMON_CONDITION)
e0:SetValue(cm.splimit)
c:RegisterEffect(e0)
--Effect 1
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_CHAINING)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetCondition(cm.chcon)
e1:SetTarget(cm.chtg)
e1:SetOperation(cm.chop)
c:RegisterEffect(e1)
--Effect 2
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,4))
e3:SetCategory(CATEGORY_REMOVE)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCode(EVENT_TO_HAND)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1,m)
e3:SetCondition(cm.hdcon)
e3:SetTarget(cm.hdtg)
e3:SetOperation(cm.hdop)
c:RegisterEffect(e3)
--Effect 3
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,2))
e2:SetCategory(CATEGORY_TOEXTRA)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetRange(LOCATION_MZONE)
e2:SetCode(EVENT_PHASE+PHASE_STANDBY)
e2:SetCountLimit(1)
e2:SetTarget(cm.rettg)
e2:SetOperation(cm.retop)
c:RegisterEffect(e2)
--Effect 4
--Effect 5
end
--spsummon condition
function cm.splimit(e,se,sp,st)
return se:GetHandler():IsCode(77000513)
end
--Effect 1
function cm.chcon(e,tp,eg,ep,ev,re,r,rp)
return rp==1-tp
end
function cm.chtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDraw(tp,1)
and Duel.IsPlayerCanDraw(1-tp,1) end
end
function cm.chop(e,tp,eg,ep,ev,re,r,rp)
local g=Group.CreateGroup()
Duel.ChangeTargetCard(ev,g)
Duel.ChangeChainOperation(ev,cm.repop)
end
function cm.repop(e,tp,eg,ep,ev,re,r,rp)
Duel.Draw(tp,1,REASON_EFFECT)
Duel.Draw(1-tp,1,REASON_EFFECT)
end
--Effect 2
function cm.cfilter(c,tp)
return c:IsControler(tp) and c:IsPreviousLocation(LOCATION_DECK)
end
function cm.hdcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase()~=PHASE_DRAW and eg:IsExists(cm.cfilter,1,nil,1-tp)
end
function cm.hdtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,0,LOCATION_HAND,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,tp,LOCATION_HAND)
end
function cm.hdop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(Card.IsAbleToRemove,tp,0,LOCATION_HAND,nil)
if g:GetCount()>0 then
local sg=g:RandomSelect(tp,1)
Duel.Remove(sg,POS_FACEUP,REASON_EFFECT)
end
end
--Effect 3
function cm.rettg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToExtra() end
Duel.SetOperationInfo(0,CATEGORY_TOEXTRA,e:GetHandler(),1,0,0)
end
function cm.retop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetFieldGroup(tp,0,LOCATION_HAND)
if not e:GetHandler():IsRelateToEffect(e) or e:GetHandler():IsFacedown() then return end
Duel.SendtoDeck(e:GetHandler(),nil,SEQ_DECKSHUFFLE,REASON_EFFECT)
if c:IsLocation(LOCATION_EXTRA) then
if #g>0 and Duel.SelectYesNo(tp,aux.Stringid(m,1)) then
Duel.BreakEffect()
Duel.ConfirmCards(tp,g)
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(m,3))
local sg=g:Select(tp,1,1,nil)
if sg~=nil then Duel.ShuffleHand(1-tp) end
end
end
end
--Effect 4
--Effect 5
--临界精灵 星宫
local m=77000526
local cm=_G["c"..m]
function cm.initial_effect(c)
--Effect 1
local e21=Effect.CreateEffect(c)
e21:SetDescription(aux.Stringid(m,0))
e21:SetCategory(CATEGORY_DISABLE)
e21:SetType(EFFECT_TYPE_QUICK_O)
e21:SetCode(EVENT_CHAINING)
e21:SetRange(LOCATION_HAND)
e21:SetCountLimit(1,m)
e21:SetCondition(cm.discon)
e21:SetCost(aux.bfgcost)
e21:SetTarget(cm.distg)
e21:SetOperation(cm.disop)
c:RegisterEffect(e21)
--Effect 2
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,0))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_DISABLE)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCode(EVENT_CHAIN_NEGATED)
e3:SetRange(LOCATION_REMOVED)
e3:SetCountLimit(1,m+100)
e3:SetCondition(cm.sumcon)
e3:SetTarget(cm.sumtg)
e3:SetOperation(cm.sumop)
c:RegisterEffect(e3)
local e8=e3:Clone()
e3:SetCode(EVENT_CHAIN_DISABLED)
c:RegisterEffect(e8)
--Effect 3
--Effect 4
--Effect 5
end
--Effect 1
function cm.discon(e,tp,eg,ep,ev,re,r,rp)
local ct=Duel.GetCurrentChain()
if ct<2 then return end
if not Duel.IsChainDisablable(ev) then return false end
local te,p=Duel.GetChainInfo(ct-1,CHAININFO_TRIGGERING_EFFECT,CHAININFO_TRIGGERING_PLAYER)
return not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED)
and te and te:GetHandler():IsSetCard(0xee2)
and p==tp and rp==1-tp
end
function cm.distg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_DISABLE,eg,1,0,0)
end
function cm.disop(e,tp,eg,ep,ev,re,r,rp)
Duel.NegateEffect(ev)
end
--Effect 2
function cm.sumcon(e,tp,eg,ep,ev,re,r,rp)
return rp==tp
end
function cm.sumtg(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.sumop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tg=Duel.GetMatchingGroup(aux.NegateAnyFilter,tp,0,LOCATION_ONFIELD,nil)
if not c:IsRelateToEffect(e) then return end
if Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)>0 then
if #tg>0 and Duel.SelectYesNo(tp,aux.Stringid(m,1)) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISABLE)
local sg=tg:Select(tp,1,1,nil)
Duel.HintSelection(sg)
local tc=sg:GetFirst()
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
end
end
end
--Effect 3
--Effect 4
--Effect 5
--临界精灵 修女
local m=77000527
local cm=_G["c"..m]
function cm.initial_effect(c)
--Effect 1
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,1))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,m)
e1:SetCost(aux.bfgcost)
e1:SetTarget(cm.target)
e1:SetOperation(cm.operation)
c:RegisterEffect(e1)
--Effect 2
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_TRIGGER_O+EFFECT_TYPE_FIELD)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_TO_HAND)
e2:SetCountLimit(1,m+100)
e2:SetRange(LOCATION_REMOVED)
e2:SetCondition(cm.drcon)
e2:SetTarget(cm.drtg)
e2:SetOperation(cm.drop)
c:RegisterEffect(e2)
--Effect 3
--Effect 4
--Effect 5
end
--Effect 1
function cm.filter2(c)
return c:IsSetCard(0xee2) and c:IsAbleToHand()
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.filter2,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local tg=Duel.SelectMatchingCard(tp,cm.filter2,tp,LOCATION_DECK,0,1,1,nil)
if tg:GetCount()>0 then
Duel.SendtoHand(tg,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tg)
end
end
--Effect 2
function cm.cfilter(c,tp)
return c:IsControler(tp) and c:IsPreviousLocation(LOCATION_DECK) and c:IsReason(REASON_EFFECT)
end
function cm.drcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(cm.cfilter,1,nil,1-tp) and rp==1-tp
end
function cm.drtg(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.drop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
end
--Effect 3
--Effect 4
--Effect 5
--临界精灵 灵核反转
local m=77000528
local cm=_G["c"..m]
function cm.initial_effect(c)
--Effect 1
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetHintTiming(TIMINGS_CHECK_MONSTER+TIMING_SSET)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,m)
e1:SetTarget(cm.target)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
--Effect 2
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_REMOVE)
e2:SetCountLimit(1,m+100)
e2:SetTarget(cm.thtg)
e2:SetOperation(cm.thop)
c:RegisterEffect(e2)
--Effect 3
--Effect 4
--Effect 5
end
--Effect 1
function cm.rmfilter(c,e,tp)
local tc=c
return c:IsType(TYPE_MONSTER) and c:IsSetCard(0xee2)
and (c:IsLocation(LOCATION_HAND) or c:IsFaceup())
and c:IsAbleToRemove()
and Duel.IsExistingMatchingCard(cm.tfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp,tc)
end
function cm.todfilter1(c,e,tp)
local tc=c
return c:IsType(TYPE_MONSTER) and c:IsSetCard(0xee2)
and (c:IsLocation(LOCATION_HAND) or c:IsFaceup())
and c:IsAbleToDeck()
and Duel.IsExistingMatchingCard(cm.tfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp,tc)
end
function cm.tfilter(c,e,tp,tc)
return c:IsSetCard(0x9eef)
and c:IsCanBeSpecialSummoned(e,0,tp,true,false)
and Duel.GetLocationCountFromEx(tp,tp,tc,c)>0
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
local b1=Duel.IsExistingMatchingCard(cm.rmfilter,tp,LOCATION_HAND+LOCATION_MZONE,0,1,nil,e,tp)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
local b2=Duel.IsExistingMatchingCard(cm.todfilter1,tp,LOCATION_HAND+LOCATION_MZONE,0,1,nil,e,tp)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
if chk==0 then return b1 or b2 end
local s=0
if b1 and not b2 then
s=Duel.SelectOption(tp,aux.Stringid(m,0))
elseif not b1 and b2 then
s=Duel.SelectOption(tp,aux.Stringid(m,1))+1
elseif b1 and b2 then
s=Duel.SelectOption(tp,aux.Stringid(m,0),aux.Stringid(m,1))
end
e:SetLabel(s)
if s==0 then
e:SetCategory(CATEGORY_SPECIAL_SUMMON)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,tp,LOCATION_HAND+LOCATION_ONFIELD)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
else
e:SetCategory(CATEGORY_SPECIAL_SUMMON)
Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,1,tp,LOCATION_HAND+LOCATION_ONFIELD)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if e:GetLabel()~=0 then
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g1=Duel.GetMatchingGroup(cm.todfilter1,tp,LOCATION_HAND+LOCATION_MZONE,0,nil,e,tp)
if g1:GetCount()<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local tg1=g1:Select(tp,1,1,nil)
Duel.ConfirmCards(1-tp,tg1)
if Duel.SendtoDeck(tg1,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)~=0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g3=Duel.SelectMatchingCard(tp,cm.tfilter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp,tc)
Duel.SpecialSummon(g3,0,tp,tp,true,false,POS_FACEUP)
g3:GetFirst():CompleteProcedure()
end
else
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local tg=Duel.SelectMatchingCard(tp,cm.rmfilter,tp,LOCATION_HAND+LOCATION_MZONE,0,1,1,nil,e,tp)
local tc=tg:GetFirst()
if tc~=nil and Duel.Remove(tc,POS_FACEUP,REASON_EFFECT)~=0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,cm.tfilter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp,tc)
Duel.SpecialSummon(g,0,tp,tp,true,false,POS_FACEUP)
g:GetFirst():CompleteProcedure()
end
end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EFFECT_CANNOT_SUMMON)
e1:SetTargetRange(1,0)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
local e2=e1:Clone()
e2:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
Duel.RegisterEffect(e2,tp)
end
--Effect 2
function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToHand() end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,e:GetHandler(),1,0,0)
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsRelateToEffect(e) then
Duel.SendtoHand(e:GetHandler(),nil,REASON_EFFECT)
end
end
\ No newline at end of file
--临界精灵 限定灵装
local m=77000529
local cm=_G["c"..m]
function cm.initial_effect(c)
--Effect 1
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:SetTarget(cm.target)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
--Effect 2
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_REMOVE)
e2:SetCountLimit(1,m+100)
e2:SetTarget(cm.thtg)
e2:SetOperation(cm.thop)
c:RegisterEffect(e2)
--Effect 3
--Effect 4
--Effect 5
end
--Effect 1
function cm.filter(c,e,tp)
local att=c:GetAttribute()
return c:IsFaceup()
and c:IsAbleToRemove()
and Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp,att,c)
end
function cm.spfilter(c,e,tp,att,mc)
return c:IsSetCard(0xee2) and c:IsAttribute(att) and c:IsCanBeSpecialSummoned(e,0,tp,true,false)
and Duel.GetLocationCountFromEx(tp,tp,mc,c)>0
end
function cm.chkfilter(c,tc)
local att=tc:GetAttribute()
return c:IsFaceup() and (c:GetAttribute()&att)==att
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) and cm.chkfilter(chkc,e:GetLabelObject()) end
if chk==0 then return Duel.IsExistingTarget(cm.filter,tp,LOCATION_MZONE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectTarget(tp,cm.filter,tp,LOCATION_MZONE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
e:SetLabelObject(g:GetFirst())
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
local c=e:GetHandler()
if not tc:IsRelateToEffect(e) then return end
local att=tc:GetAttribute()
if Duel.Remove(tc,POS_FACEUP,REASON_EFFECT)==0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,cm.spfilter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp,att,nil)
local tc=g:GetFirst()
if g:GetCount()>0 then
Duel.BreakEffect()
Duel.SpecialSummon(tc,0,tp,tp,true,false,POS_FACEUP)
tc:CompleteProcedure()
tc:RegisterFlagEffect(m,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,2)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetCondition(cm.descon)
e1:SetOperation(cm.desop)
e1:SetReset(RESET_PHASE+PHASE_END,2)
e1:SetCountLimit(1)
e1:SetLabel(Duel.GetTurnCount())
e1:SetLabelObject(tc)
Duel.RegisterEffect(e1,tp)
end
end
function cm.descon(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject()
return Duel.GetTurnCount()~=e:GetLabel() and tc:GetFlagEffect(m)~=0
and tc:IsAbleToDeck()
end
function cm.desop(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject()
Duel.SendtoDeck(tc,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)
end
--Effect 2
function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToHand() end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,e:GetHandler(),1,0,0)
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsRelateToEffect(e) then
Duel.SendtoHand(e:GetHandler(),nil,REASON_EFFECT)
end
end
--Effect 3
--Effect 4
--Effect 5
--反转体 恶魔-救世魔王
function c77014514.initial_effect(c)
c:EnableReviveLimit()
--spsummon condition
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_SPSUMMON_CONDITION)
e1:SetValue(c77014514.splimit)
c:RegisterEffect(e1)
--move
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(7969770,0))
e1:SetCategory(CATEGORY_REMOVE)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetTarget(c77014514.mvtg)
e1:SetOperation(c77014514.mvop)
c:RegisterEffect(e1)
--damage
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_DAMAGE)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e2:SetCode(EVENT_PHASE+PHASE_STANDBY)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1)
e2:SetCondition(c77014514.damcon)
e2:SetTarget(c77014514.damtg)
e2:SetOperation(c77014514.damop)
c:RegisterEffect(e2)
--to deck and recover
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_TOEXTRA+CATEGORY_RECOVER)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_DESTROYED)
e3:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP)
e3:SetRange(LOCATION_REMOVED)
e3:SetCondition(c77014514.tdrcon)
e3:SetTarget(c77014514.tdrtg)
e3:SetOperation(c77014514.tdrop)
c:RegisterEffect(e3)
end
function c77014514.splimit(e,se,sp,st)
return se:GetHandler():IsCode(77000528)
end
function c77014514.mvtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return e:GetHandler():GetFlagEffect(77014514)==0 and Duel.IsExistingTarget(nil,tp,LOCATION_MZONE,0,1,nil)
and Duel.GetLocationCount(tp,LOCATION_MZONE,PLAYER_NONE,0)>0 end
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(77014514,1))
Duel.SelectTarget(tp,nil,tp,LOCATION_MZONE,0,1,1,nil)
end
function c77014514.mvop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if not tc:IsRelateToEffect(e) or tc:IsControler(1-tp)
or Duel.GetLocationCount(tp,LOCATION_MZONE,PLAYER_NONE,0)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOZONE)
local s=Duel.SelectDisableField(tp,1,LOCATION_MZONE,0,0)
local nseq=math.log(s,2)
Duel.MoveSequence(tc,nseq)
local rg=tc:GetColumnGroup():Filter(Card.IsAbleToRemove,nil)
if rg:GetCount()>0 then
Duel.Remove(rg,POS_FACEUP,REASON_EFFECT)
end
if c:IsRelateToEffect(e) then
c:RegisterFlagEffect(77014514,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,2)
end
end
function c77014514.damcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==tp
end
function c77014514.damtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetTargetParam(1000)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,0,0,PLAYER_ALL,1000)
end
function c77014514.damop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local d=Duel.GetChainInfo(0,CHAININFO_TARGET_PARAM)
Duel.Damage(tp,d,REASON_EFFECT)
Duel.Damage(1-tp,d,REASON_EFFECT)
end
function c77014514.ckfil(c)
return c:IsPreviousLocation(LOCATION_ONFIELD) and c:IsReason(REASON_BATTLE+REASON_EFFECT)
end
function c77014514.tdrcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c77014514.ckfil,1,nil)
end
function c77014514.tdrtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToExtra() end
Duel.SetOperationInfo(0,CATEGORY_TOEXTRA,e:GetHandler(),1,0,0)
end
function c77014514.tdrop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetFieldGroup(tp,LOCATION_REMOVED,LOCATION_REMOVED)
if c:IsRelateToEffect(e) and Duel.SendtoDeck(c,nil,0,REASON_EFFECT)~=0 and g:GetCount()>0 then
Duel.BreakEffect()
Duel.Recover(tp,g:GetCount()*100,REASON_EFFECT)
Duel.Recover(1-tp,g:GetCount()*100,REASON_EFFECT)
end
end
--反转体 梦魇-狂狂帝
function c77014515.initial_effect(c)
c:EnableReviveLimit()
--spsummon condition
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_SPSUMMON_CONDITION)
e1:SetValue(c77014515.splimit)
c:RegisterEffect(e1)
--confirm and SpecialSummon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(77014515,0))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1)
e2:SetTarget(c77014515.castg)
e2:SetOperation(c77014515.casop)
c:RegisterEffect(e2)
--redirect
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_LEAVE_FIELD_REDIRECT)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e3:SetCondition(c77014515.recon)
e3:SetValue(LOCATION_REMOVED)
c:RegisterEffect(e3)
--to deck and remove
local e4=Effect.CreateEffect(c)
e4:SetCategory(CATEGORY_TOEXTRA+CATEGORY_RECOVER)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e4:SetCode(EVENT_DESTROYED)
e4:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP)
e4:SetRange(LOCATION_REMOVED)
e4:SetCondition(c77014515.tdrcon)
e4:SetTarget(c77014515.tdrtg)
e4:SetOperation(c77014515.tdrop)
c:RegisterEffect(e4)
end
function c77014515.splimit(e,se,sp,st)
return se:GetHandler():IsCode(77000528)
end
function c77014515.castg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():GetFlagEffect(77014515)==0 and Duel.GetFieldGroupCount(tp,0,LOCATION_HAND)>0 end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,1-tp,LOCATION_HAND)
end
function c77014515.cspfil(c,e,tp)
return c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_ATTACK,1-tp)
end
function c77014515.casop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetFieldGroup(tp,0,LOCATION_HAND)
if g:GetCount()>0 then
Duel.ConfirmCards(tp,g)
if g:IsExists(c77014515.cspfil,1,nil,e,tp) and Duel.GetLocationCount(1-tp,LOCATION_MZONE)>0 then
local tc=g:Select(tp,1,1,nil):GetFirst()
if tc and Duel.SpecialSummonStep(tc,0,tp,1-tp,false,false,POS_FACEUP_ATTACK) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetValue(RESET_TURN_SET)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e2)
end
Duel.SpecialSummonComplete()
end
end
if c:IsRelateToEffect(e) then
c:RegisterFlagEffect(77014515,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,2)
end
end
function c77014515.recon(e)
return e:GetHandler():IsFaceup()
end
function c77014515.ckfil(c)
return c:IsPreviousLocation(LOCATION_ONFIELD) and c:IsReason(REASON_BATTLE+REASON_EFFECT)
end
function c77014515.tdrcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c77014515.ckfil,1,nil)
end
function c77014515.trmfil(c)
return c:IsSetCard(0xee2) and c:IsAbleToRemove()
end
function c77014515.tdrtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToExtra() and Duel.IsExistingMatchingCard(c77014515.trmfil,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOEXTRA,e:GetHandler(),1,0,0)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,tp,LOCATION_DECK)
end
function c77014515.tdrop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetMatchingGroup(c77014515.trmfil,tp,LOCATION_DECK,0,nil)
if c:IsRelateToEffect(e) and Duel.SendtoDeck(c,nil,0,REASON_EFFECT)~=0 and g:GetCount()>0 then
Duel.BreakEffect()
local rg=g:Select(tp,1,1,nil)
Duel.Remove(rg,POS_FACEUP,REASON_EFFECT)
end
end
......@@ -6,6 +6,7 @@ function c88880043.initial_effect(c)
e1:SetCategory(CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,88880043)
e1:SetTarget(c88880043.target)
e1:SetOperation(c88880043.activate)
c:RegisterEffect(e1)
......@@ -15,11 +16,11 @@ function c88880043.initial_effect(c)
e2:SetCategory(CATEGORY_CONTROL+CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_ACTIVATE)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetCountLimit(1,88880043)
e2:SetCost(c88880043.cost)
e2:SetTarget(c88880043.target2)
e2:SetOperation(c88880043.activate2)
c:RegisterEffect(e2)
end
function c88880043.thfilter(c)
return c:IsSetCard(0xc06) and c:IsAbleToHand()
......@@ -39,7 +40,7 @@ end
function c88880043.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,1,c) end
Duel.DiscardHand(tp,Card.IsDiscardable,1,1,REASON_COST+REASON_DISCARD)
Duel.DiscardHand(tp,Card.IsDiscardable,3,3,REASON_COST+REASON_DISCARD)
end
function c88880043.ntrfilter(c)
return c:IsControlerCanBeChanged()
......
--源赖光
local s,id,o=GetID()
function s.initial_effect(c)
c:EnableReviveLimit()
--cannot special summon
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_SPSUMMON_CONDITION)
c:RegisterEffect(e1)
--special summon
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_SPSUMMON_PROC)
e2:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e2:SetRange(LOCATION_HAND)
e2:SetCountLimit(1,88884396)
e2:SetCondition(s.spcon)
c:RegisterEffect(e2)
--disable
local e3=Effect.CreateEffect(c)
e3:SetDescription(1131)
e3:SetCategory(CATEGORY_DISABLE)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_CHAINING)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1)
e3:SetCondition(s.discon)
e3:SetCost(s.discost)
e3:SetTarget(s.distg)
e3:SetOperation(s.disop)
c:RegisterEffect(e3)
--draw
local e4=Effect.CreateEffect(c)
e4:SetDescription(1109)
e4:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e4:SetProperty(EFFECT_FLAG_DELAY)
e4:SetCode(EVENT_SPSUMMON_SUCCESS)
e4:SetCountLimit(1,88884397)
e4:SetTarget(s.thtg)
e4:SetOperation(s.thop)
c:RegisterEffect(e4)
local e5=e4:Clone()
e5:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e5:SetCode(EVENT_CHAINING)
e5:SetRange(LOCATION_MZONE)
e5:SetCondition(s.condition)
c:RegisterEffect(e5)
if not s.global_flag then
s.global_flag=true
s[0]={}
s[1]={}
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_SUMMON_SUCCESS)
ge1:SetOperation(s.regop)
Duel.RegisterEffect(ge1,0)
local ge2=ge1:Clone()
ge2:SetCode(EVENT_SPSUMMON_SUCCESS)
Duel.RegisterEffect(ge2,0)
end
end
function s.regop(e,tp,eg,ep,ev,re,r,rp)
for tc in aux.Next(eg) do
if tc:IsSetCard(0x8881) then
local code=tc:GetCode()
if Duel.GetFlagEffect(tc:GetSummonPlayer(),code)==0 then
table.insert(s[tc:GetSummonPlayer()],code)
Duel.RegisterFlagEffect(tc:GetSummonPlayer(),code,RESET_PHASE+PHASE_END,0,0)
end
if #s[tc:GetSummonPlayer()]>=3 and Duel.GetFlagEffect(tc:GetSummonPlayer(),88884396)==0 then
Duel.RegisterFlagEffect(tc:GetSummonPlayer(),88884398,RESET_PHASE+PHASE_END,0,0)
end
end
end
end
function s.spcon(e,c)
if c==nil then return true end
return Duel.GetFlagEffect(c:GetControler(),88884398)>0 and Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>0
and not Duel.IsExistingMatchingCard(s.cfilter2,c:GetControler(),LOCATION_MZONE,0,1,nil)
end
function s.cfilter2(c)
return c:IsFacedown() or (not c:IsSetCard(0x8881))
end
function s.discon(e,tp,eg,ep,ev,re,r,rp)
return ep==1-tp
end
function s.cfilter(c)
return c:IsSetCard(0x8881) and c:IsAbleToGraveAsCost()
end
function s.discost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_HAND+LOCATION_ONFIELD,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,s.cfilter,tp,LOCATION_HAND+LOCATION_ONFIELD,0,1,1,nil)
Duel.SendtoGrave(g,REASON_COST)
end
function s.distg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
Duel.SetOperationInfo(0,CATEGORY_DISABLE,eg,1,0,0)
if re:GetHandler():IsDestructable() and re:GetHandler():IsRelateToEffect(re) then
Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,1,0,0)
end
end
function s.disop(e,tp,eg,ep,ev,re,r,rp)
if Duel.NegateEffect(ev) and re:GetHandler():IsRelateToEffect(re) then
Duel.Destroy(eg,REASON_EFFECT)
end
end
function s.thfilter(c)
return c:IsSetCard(0x8881) and c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsAbleToHand()
end
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function s.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
function s.condition(e,tp,eg,ep,ev,re,r,rp)
return rp==1-tp and re:IsActiveType(TYPE_SPELL)
end
\ No newline at end of file
--坂田金时
local s,id,o=GetID()
function s.initial_effect(c)
--special summon
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,88884399)
e1:SetCondition(s.spcon)
c:RegisterEffect(e1)
--atk & def
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetRange(LOCATION_MZONE)
e2:SetTargetRange(LOCATION_MZONE,0)
e2:SetTarget(aux.TargetBoolFunction(Card.IsSetCard,0x8881))
e2:SetValue(100)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EFFECT_UPDATE_DEFENSE)
c:RegisterEffect(e3)
--draw
local e4=Effect.CreateEffect(c)
e4:SetDescription(1109)
e4:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e4:SetProperty(EFFECT_FLAG_DELAY)
e4:SetCode(EVENT_SUMMON_SUCCESS)
e4:SetCountLimit(1,88884400)
e4:SetTarget(s.thtg)
e4:SetOperation(s.thop)
c:RegisterEffect(e4)
local e5=e4:Clone()
e5:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e5)
local e6=e4:Clone()
e6:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e6:SetCode(EVENT_CHAINING)
e6:SetRange(LOCATION_MZONE)
e6:SetCondition(s.condition)
c:RegisterEffect(e6)
if not s.global_flag then
s.global_flag=true
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_SUMMON_SUCCESS)
ge1:SetOperation(s.regop)
Duel.RegisterEffect(ge1,0)
local ge2=ge1:Clone()
ge2:SetCode(EVENT_SPSUMMON_SUCCESS)
Duel.RegisterEffect(ge2,0)
end
end
function s.spcon(e,c)
if c==nil then return true end
return Duel.GetFlagEffect(c:GetControler(),88884400)>0 and Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>0
and not Duel.IsExistingMatchingCard(s.cfilter2,c:GetControler(),LOCATION_MZONE,0,1,nil)
end
function s.cfilter2(c)
return c:IsFacedown() or (not c:IsSetCard(0x8881))
end
function s.regop(e,tp,eg,ep,ev,re,r,rp)
for tc in aux.Next(eg) do
if tc:IsSetCard(0x8881) and not tc:IsLevel(0) then
local lv=tc:GetLevel()
if lv>8 and Duel.GetFlagEffect(tc:GetSummonPlayer(),88884400)==0 then
Duel.RegisterFlagEffect(tc:GetSummonPlayer(),88884400,RESET_PHASE+PHASE_END,0,0)
end
end
end
end
function s.thfilter(c)
return c:IsSetCard(0x8881) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
end
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function s.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
function s.condition(e,tp,eg,ep,ev,re,r,rp)
return rp==1-tp and re:IsActiveType(TYPE_SPELL)
end
\ No newline at end of file
--源为朝
local s,id,o=GetID()
function s.initial_effect(c)
--special summon
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,88884402)
e1:SetCondition(s.spcon)
c:RegisterEffect(e1)
--atk & def
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetRange(LOCATION_MZONE)
e2:SetTargetRange(LOCATION_MZONE,0)
e2:SetTarget(aux.TargetBoolFunction(Card.IsSetCard,0x8881))
e2:SetValue(100)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EFFECT_UPDATE_DEFENSE)
c:RegisterEffect(e3)
--draw
local e4=Effect.CreateEffect(c)
e4:SetDescription(1109)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e4:SetProperty(EFFECT_FLAG_DELAY)
e4:SetCode(EVENT_SUMMON_SUCCESS)
e4:SetCountLimit(1,88884403)
e4:SetTarget(s.settg)
e4:SetOperation(s.setop)
c:RegisterEffect(e4)
local e5=e4:Clone()
e5:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e5)
local e6=e4:Clone()
e6:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e6:SetCode(EVENT_CHAINING)
e6:SetRange(LOCATION_MZONE)
e6:SetCondition(s.condition)
c:RegisterEffect(e6)
if not s.global_flag then
s.global_flag=true
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_SUMMON_SUCCESS)
ge1:SetOperation(s.regop)
Duel.RegisterEffect(ge1,0)
local ge2=ge1:Clone()
ge2:SetCode(EVENT_SPSUMMON_SUCCESS)
Duel.RegisterEffect(ge2,0)
end
end
function s.spcon(e,c)
if c==nil then return true end
return Duel.GetFlagEffect(c:GetControler(),88884403)>0 and Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>0
and not Duel.IsExistingMatchingCard(s.cfilter2,c:GetControler(),LOCATION_MZONE,0,1,nil)
end
function s.cfilter2(c)
return c:IsFacedown() or (not c:IsSetCard(0x8881))
end
function s.regop(e,tp,eg,ep,ev,re,r,rp)
for tc in aux.Next(eg) do
if tc:IsSetCard(0x8881) and not tc:IsLevel(0) then
local lv=tc:GetLevel()
if lv>7 and Duel.GetFlagEffect(tc:GetSummonPlayer(),88884403)==0 then
Duel.RegisterFlagEffect(tc:GetSummonPlayer(),88884403,RESET_PHASE+PHASE_END,0,0)
end
end
end
end
function s.condition(e,tp,eg,ep,ev,re,r,rp)
return rp==1-tp and re:IsActiveType(TYPE_MONSTER)
end
function s.setfilter(c)
return c:IsCode(88884432) and c:IsSSetable() and c:IsFaceupEx()
end
function s.settg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local ct=Duel.GetLocationCount(tp,LOCATION_SZONE)
return ct>0 and Duel.IsExistingMatchingCard(s.setfilter,tp,LOCATION_DECK+LOCATION_REMOVED,0,1,nil)
end
end
function s.setop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
local g=Duel.SelectMatchingCard(tp,s.setfilter,tp,LOCATION_DECK+LOCATION_REMOVED,0,1,1,nil)
local tc=g:GetFirst()
if tc and Duel.SSet(tp,tc)~=0 then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_TRAP_ACT_IN_SET_TURN)
e1:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
end
end
--渡边纲
local s,id,o=GetID()
function s.initial_effect(c)
--special summon
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,88884405)
e1:SetCondition(s.spcon)
c:RegisterEffect(e1)
--atk & def
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetRange(LOCATION_MZONE)
e2:SetTargetRange(LOCATION_MZONE,0)
e2:SetTarget(aux.TargetBoolFunction(Card.IsSetCard,0x8881))
e2:SetValue(100)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EFFECT_UPDATE_DEFENSE)
c:RegisterEffect(e3)
--draw
local e4=Effect.CreateEffect(c)
e4:SetDescription(1109)
e4:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e4:SetProperty(EFFECT_FLAG_DELAY)
e4:SetCode(EVENT_SUMMON_SUCCESS)
e4:SetCountLimit(1,88884406)
e4:SetTarget(s.thtg)
e4:SetOperation(s.thop)
c:RegisterEffect(e4)
local e5=e4:Clone()
e5:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e5)
local e6=e4:Clone()
e6:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e6:SetCode(EVENT_CHAINING)
e6:SetRange(LOCATION_MZONE)
e6:SetCondition(s.condition)
c:RegisterEffect(e6)
if not s.global_flag then
s.global_flag=true
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_SUMMON_SUCCESS)
ge1:SetOperation(s.regop)
Duel.RegisterEffect(ge1,0)
local ge2=ge1:Clone()
ge2:SetCode(EVENT_SPSUMMON_SUCCESS)
Duel.RegisterEffect(ge2,0)
end
end
function s.spcon(e,c)
if c==nil then return true end
return Duel.GetFlagEffect(c:GetControler(),88884406)>0 and Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>0
and not Duel.IsExistingMatchingCard(s.cfilter2,c:GetControler(),LOCATION_MZONE,0,1,nil)
end
function s.cfilter2(c)
return c:IsFacedown() or (not c:IsSetCard(0x8881))
end
function s.regop(e,tp,eg,ep,ev,re,r,rp)
for tc in aux.Next(eg) do
if tc:IsSetCard(0x8881) and not tc:IsLevel(0) then
local lv=tc:GetLevel()
if lv>6 and Duel.GetFlagEffect(tc:GetSummonPlayer(),88884406)==0 then
Duel.RegisterFlagEffect(tc:GetSummonPlayer(),88884406,RESET_PHASE+PHASE_END,0,0)
end
end
end
end
function s.condition(e,tp,eg,ep,ev,re,r,rp)
return rp==1-tp and re:IsActiveType(TYPE_MONSTER)
end
function s.thfilter(c)
return c:IsCode(88884420) and c:IsAbleToHand() and c:IsFaceupEx()
end
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK+LOCATION_REMOVED,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK+LOCATION_REMOVED)
end
function s.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_DECK+LOCATION_REMOVED,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
\ No newline at end of file
--巴御前
local s,id,o=GetID()
function s.initial_effect(c)
--special summon
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,88884408)
e1:SetCondition(s.spcon)
c:RegisterEffect(e1)
--atk & def
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetRange(LOCATION_MZONE)
e2:SetTargetRange(LOCATION_MZONE,0)
e2:SetTarget(aux.TargetBoolFunction(Card.IsSetCard,0x8881))
e2:SetValue(100)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EFFECT_UPDATE_DEFENSE)
c:RegisterEffect(e3)
--draw
local e4=Effect.CreateEffect(c)
e4:SetDescription(1131)
e4:SetCategory(CATEGORY_DISABLE)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e4:SetProperty(EFFECT_FLAG_DELAY)
e4:SetCode(EVENT_SUMMON_SUCCESS)
e4:SetCountLimit(1,88884409)
e4:SetTarget(s.distg)
e4:SetOperation(s.disop)
c:RegisterEffect(e4)
local e5=e4:Clone()
e5:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e5)
local e6=e4:Clone()
e6:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e6:SetCode(EVENT_CHAINING)
e6:SetRange(LOCATION_MZONE)
e6:SetCondition(s.condition)
c:RegisterEffect(e6)
if not s.global_flag then
s.global_flag=true
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_SUMMON_SUCCESS)
ge1:SetOperation(s.regop)
Duel.RegisterEffect(ge1,0)
local ge2=ge1:Clone()
ge2:SetCode(EVENT_SPSUMMON_SUCCESS)
Duel.RegisterEffect(ge2,0)
end
end
function s.spcon(e,c)
if c==nil then return true end
return Duel.GetFlagEffect(c:GetControler(),88884409)>0 and Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>0
and not Duel.IsExistingMatchingCard(s.cfilter2,c:GetControler(),LOCATION_MZONE,0,1,nil)
end
function s.cfilter2(c)
return c:IsFacedown() or (not c:IsSetCard(0x8881))
end
function s.regop(e,tp,eg,ep,ev,re,r,rp)
for tc in aux.Next(eg) do
if tc:IsSetCard(0x8881) and not tc:IsLevel(0) then
local lv=tc:GetLevel()
if lv>5 and Duel.GetFlagEffect(tc:GetSummonPlayer(),88884409)==0 then
Duel.RegisterFlagEffect(tc:GetSummonPlayer(),88884409,RESET_PHASE+PHASE_END,0,0)
end
end
end
end
function s.condition(e,tp,eg,ep,ev,re,r,rp)
return rp==1-tp and re:IsActiveType(TYPE_TRAP)
end
function s.distg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(aux.NegateAnyFilter,tp,0,LOCATION_ONFIELD,1,nil) end
local g=Duel.GetMatchingGroup(aux.NegateAnyFilter,tp,0,LOCATION_ONFIELD,nil)
Duel.SetOperationInfo(0,CATEGORY_DISABLE,g,1,0,0)
end
function s.disop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISABLE)
local g=Duel.SelectMatchingCard(tp,aux.NegateAnyFilter,tp,0,LOCATION_ONFIELD,1,1,nil)
local tc=g:GetFirst()
if tc:IsFaceup() and tc:IsCanBeDisabledByEffect(e,false) then
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
end
end
\ No newline at end of file
--牛若丸
local s,id,o=GetID()
function s.initial_effect(c)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(62706865,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCountLimit(1,88884411)
e1:SetTarget(s.sptg)
e1:SetOperation(s.spop)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e1)
--cannot be target
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e3:SetCode(EFFECT_CANNOT_BE_BATTLE_TARGET)
e3:SetRange(LOCATION_MZONE)
e3:SetCondition(s.limtcon)
e3:SetValue(aux.imval1)
c:RegisterEffect(e3)
local e4=e3:Clone()
e4:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e4:SetValue(aux.tgoval)
c:RegisterEffect(e4)
end
function s.spfilter(c,e,tp)
return c:IsSetCard(0x8881) and c:IsType(TYPE_MONSTER) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP)
end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function s.thfilter(c)
return c:IsSetCard(0x8881) and c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsAbleToHand()
end
function s.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<1 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
local tohand=Duel.GetMatchingGroup(s.thfilter,tp,LOCATION_DECK,0,nil)
if Duel.GetFieldGroupCount(tp,LOCATION_HAND,0)==0 and #tohand>0 and Duel.SelectYesNo(tp,aux.Stringid(88884411,1)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local tc=tohand:Select(tp,1,1,nil)
Duel.SendtoHand(tc,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
end
function s.limtcon(e,tp,eg,ep,ev,re,r,rp)
return not Duel.IsExistingMatchingCard(s.cfilter2,tp,LOCATION_MZONE,0,1,e:GetHandler())
end
function s.cfilter2(c)
return c:IsFacedown() or (not c:IsSetCard(0x8881))
end
\ No newline at end of file
--MAX-源为朝
local s,id,o=GetID()
function s.initial_effect(c)
--synchro summon
aux.AddSynchroProcedure(c,aux.FilterBoolFunction(Card.IsAttribute,ATTRIBUTE_LIGHT),aux.NonTuner(nil),1)
c:EnableReviveLimit()
--overlay
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(90448279,2))
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCondition(s.ovcon)
e1:SetTarget(s.ovtg)
e1:SetOperation(s.ovop)
c:RegisterEffect(e1)
--indes
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetRange(LOCATION_MZONE)
e2:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e2:SetCondition(s.indcon)
e2:SetValue(1)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
c:RegisterEffect(e3)
local e3=e2:Clone()
e3:SetCode(EFFECT_UPDATE_ATTACK)
e3:SetValue(s.atkval)
c:RegisterEffect(e3)
--destroy
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(48905153,1))
e4:SetCategory(CATEGORY_DESTROY)
e4:SetType(EFFECT_TYPE_QUICK_O)
e4:SetProperty(EFFECT_FLAG_CARD_TARGET)
e4:SetCode(EVENT_FREE_CHAIN)
e4:SetRange(LOCATION_MZONE)
e4:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e4:SetCountLimit(1,88884414)
e4:SetCost(s.descost)
e4:SetTarget(s.destg)
e4:SetOperation(s.desop)
c:RegisterEffect(e4)
end
function s.ovcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_SYNCHRO)
end
function s.ofilter(c,e)
return c:IsCode(88884402) and c:IsCanOverlay() and (not e or not c:IsImmuneToEffect(e))
end
function s.ovtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.ofilter,tp,LOCATION_ONFIELD+LOCATION_DECK+LOCATION_GRAVE,0,1,nil) end
end
function s.ovop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL)
local g=Duel.GetMatchingGroup(aux.NecroValleyFilter(s.ofilter),tp,LOCATION_ONFIELD+LOCATION_DECK+LOCATION_GRAVE,0,nil,e)
local tc=g:GetFirst()
while tc do
local og=tc:GetOverlayGroup()
if og:GetCount()>0 then
Duel.SendtoGrave(og,REASON_RULE)
end
Duel.Overlay(c,tc)
tc=g:GetNext()
end
Duel.ShuffleDeck(tp)
end
end
function s.indcon(e)
return e:GetHandler():IsSummonType(SUMMON_TYPE_SYNCHRO)
end
function s.atkval(e,c)
return c:GetMaterialCount()*500
end
function s.descost(e,tp,eg,ep,ev,re,r,rp,chk)
e:SetLabel(100)
if chk==0 then return true end
end
function s.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and chkc:IsFaceup() end
local og=e:GetHandler():GetOverlayGroup()
local sg=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
if chk==0 then
if e:GetLabel()~=100 then return false end
e:SetLabel(0)
return Duel.IsExistingTarget(aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil)
and e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end
local ct=#sg
if #sg>#og then ct=#og end
e:GetHandler():RemoveOverlayCard(tp,1,ct,REASON_COST)
local cg=Duel.GetOperatedGroup()
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,#cg,#cg,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,#cg,0,0)
end
function s.desop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(Card.IsRelateToEffect,nil,e)
Duel.Destroy(g,REASON_EFFECT)
end
\ No newline at end of file
--五条大桥的邂逅
local s,id,o=GetID()
function s.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(56465981,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,88884417+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(s.target)
e1:SetOperation(s.activate)
c:RegisterEffect(e1)
end
function s.thfilter(c,check)
return c:IsAbleToHand() and ((check and c:IsSetCard(0x8881) and c:IsType(TYPE_MONSTER)) or c:IsCode(88884429))
end
function s.checkfilter(c)
return c:IsCode(88884429) and c:IsFaceup()
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local check=Duel.IsExistingMatchingCard(s.checkfilter,tp,LOCATION_FZONE,0,1,nil)
return Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil,check)
end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
local check=Duel.IsExistingMatchingCard(s.checkfilter,tp,LOCATION_FZONE,0,1,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_DECK,0,1,1,nil,check)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
\ No newline at end of file
--大江山·菩提鬼杀
local s,id,o=GetID()
function s.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMING_END_PHASE+TIMING_EQUIP)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCountLimit(1,88884420+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(s.target)
e1:SetOperation(s.activate)
c:RegisterEffect(e1)
--to hand
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(9659580,2))
e3:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_GRAVE)
e3:SetCondition(aux.exccon)
e3:SetCost(aux.bfgcost)
e3:SetTarget(s.thtg)
e3:SetOperation(s.thop)
c:RegisterEffect(e3)
end
function s.filter(c)
return c:IsRace(RACE_FIEND)
end
function s.cfilter(c)
return c:IsFaceup() and c:IsSetCard(0x8881)
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and s.filter(chkc) and chkc~=e:GetHandler() end
if chk==0 then return Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_MZONE,0,1,nil)
and Duel.IsExistingTarget(s.filter,tp,0,LOCATION_MZONE,1,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,s.filter,tp,0,LOCATION_MZONE,1,1,e:GetHandler())
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function s.checkfilter(c)
return c:IsCode(88884405) and c:IsFaceup()
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.Destroy(tc,REASON_EFFECT)
local check=Duel.IsExistingMatchingCard(s.checkfilter,tp,LOCATION_ONFIELD,0,1,nil)
local remove=Duel.GetMatchingGroup(Card.IsAbleToRemove,tp,0,LOCATION_GRAVE,nil)
if check and #remove>0 and Duel.SelectYesNo(tp,1005) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local rc=remove:Select(tp,1,3,nil)
Duel.Remove(rc,POS_FACEUP,REASON_EFFECT)
end
end
end
function s.thfilter(c)
return c:IsSetCard(0x8881) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
end
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function s.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
\ No newline at end of file
--童子切安纲
local s,id,o=GetID()
function s.initial_effect(c)
--activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,88884423+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(s.target)
e1:SetOperation(s.activate)
c:RegisterEffect(e1)
--destroy
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(48905153,1))
e3:SetCategory(CATEGORY_DESTROY)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetRange(LOCATION_SZONE)
e3:SetCountLimit(1)
e3:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e3:SetTarget(s.destg)
e3:SetOperation(s.desop)
c:RegisterEffect(e3)
end
function s.spfilter(c,e,tp)
return c:IsSetCard(0x8881) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_HAND+LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_GRAVE)
Duel.SetOperationInfo(0,CATEGORY_EQUIP,e:GetHandler(),1,tp,LOCATION_HAND+LOCATION_GRAVE)
end
function s.eqlimit(e,c)
return e:GetOwner()==c
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.spfilter),tp,LOCATION_HAND+LOCATION_GRAVE,0,1,1,nil,e,tp)
local tc=g:GetFirst()
if tc and Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)~=0 then
Duel.Equip(tp,c,tc)
--Add Equip limit
local e1=Effect.CreateEffect(tc)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_EQUIP_LIMIT)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
e1:SetValue(s.eqlimit)
c:RegisterEffect(e1)
end
end
function s.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and chkc:IsFaceup() end
if chk==0 then return Duel.IsExistingTarget(aux.TRUE,tp,0,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,aux.TRUE,tp,0,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function s.desop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.Destroy(tc,REASON_EFFECT)
end
end
\ No newline at end of file
--随后,在大江山
local s,id,o=GetID()
function s.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,88884426+EFFECT_COUNT_CODE_OATH)
c:RegisterEffect(e1)
--race
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetRange(LOCATION_SZONE)
e2:SetTargetRange(0,LOCATION_MZONE)
e2:SetCode(EFFECT_CHANGE_RACE)
e2:SetCondition(s.ndcon)
e2:SetValue(RACE_FIEND)
c:RegisterEffect(e2)
--spsummon
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(74018812,1))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_LEAVE_FIELD)
e3:SetRange(LOCATION_SZONE)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCondition(s.thcon)
e3:SetTarget(s.thtg)
e3:SetOperation(s.thop)
c:RegisterEffect(e3)
end
function s.ndcfilter(c)
return c:IsFaceup() and c:IsSetCard(0x8881)
end
function s.ndcon(e)
return Duel.IsExistingMatchingCard(s.ndcfilter,e:GetHandlerPlayer(),LOCATION_MZONE,0,1,nil)
end
function s.thfilter(c,lv)
return c:IsType(TYPE_MONSTER) and c:GetLevel()<lv and c:IsSetCard(0x8881) and c:IsAbleToHand()
end
function s.cfilter(c,tp)
local lv=c:GetLevel()
return c:IsPreviousLocation(LOCATION_MZONE) and c:IsSetCard(0x8881)
and Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil,lv)
end
function s.thcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(s.cfilter,1,nil,tp)
end
function s.thtg(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 s.thop(e,tp,eg,ep,ev,re,r,rp)
local g=eg:Filter(Card.IsSetCard,nil,0x8881)
local tg=g:GetMaxGroup(Card.GetLevel)
local lv=tg:GetFirst():GetLevel()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local tc=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_DECK,0,1,1,nil,lv)
if tc:GetCount()>0 then
local tlv=tc:GetFirst():GetLevel()
Duel.SendtoHand(tc,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tc)
local e0=Effect.CreateEffect(e:GetHandler())
e0:SetType(EFFECT_TYPE_FIELD)
e0:SetCode(EFFECT_CANNOT_TO_HAND)
e0:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e0:SetTargetRange(1,0)
e0:SetTarget(s.thlimit)
e0:SetLabel(tlv)
e0:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e0,tp)
end
end
function s.thlimit(e,c,tp,re)
return c:IsLevel(e:GetLabel()) and re and re:GetHandler():IsCode(88884426)
end
\ No newline at end of file
--遮那王流离谭
local s,id,o=GetID()
function s.initial_effect(c)
--activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,88884429+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(s.target)
e1:SetOperation(s.activate)
c:RegisterEffect(e1)
--atk & def
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetRange(LOCATION_FZONE)
e2:SetTargetRange(LOCATION_MZONE,0)
e2:SetTarget(aux.TargetBoolFunction(Card.IsSetCard,0x8881))
e2:SetValue(500)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EFFECT_UPDATE_DEFENSE)
c:RegisterEffect(e3)
--pendulem
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e4:SetCode(EVENT_SUMMON_SUCCESS)
e4:SetRange(LOCATION_FZONE)
e4:SetProperty(EFFECT_FLAG_DELAY)
e4:SetCountLimit(1,88884430)
e4:SetCondition(s.pencon)
e4:SetOperation(s.penop)
c:RegisterEffect(e4)
local e5=e4:Clone()
e5:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e5)
end
function s.filter(c)
return c:IsSetCard(0x8881) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK+LOCATION_GRAVE)
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.filter),tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
function s.penfilter(c,tp)
return c:IsFaceup() and c:IsSetCard(0x8881)
end
function s.pencon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(s.penfilter,1,nil,tp) and not eg:IsContains(e:GetHandler())
end
function s.penop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=eg:Filter(s.penfilter,nil,tp)
local tc=g:GetFirst()
while tc do
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e1:SetValue(1)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
tc:RegisterFlagEffect(0,RESET_EVENT+RESETS_STANDARD-RESET_TOFIELD+RESET_PHASE+PHASE_END,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(88884429,0))
tc=g:GetNext()
end
end
\ No newline at end of file
--轰沉·弓张月
local s,id,o=GetID()
function s.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMING_END_PHASE+TIMING_EQUIP)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCountLimit(1,88884420+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(s.target)
e1:SetOperation(s.activate)
c:RegisterEffect(e1)
--to hand
local e2=Effect.CreateEffect(c)
e2:SetDescription(1131)
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_GRAVE)
e2:SetCondition(aux.exccon)
e2:SetCost(aux.bfgcost)
e2:SetTarget(s.thtg)
e2:SetOperation(s.thop)
c:RegisterEffect(e2)
end
function s.cfilter(c)
return c:IsFaceup() and c:IsSetCard(0x8881)
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and s.filter(chkc) and chkc~=e:GetHandler() end
if chk==0 then return Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_MZONE,0,1,nil)
and Duel.IsExistingTarget(aux.TRUE,tp,0,LOCATION_ONFIELD,1,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,aux.TRUE,tp,0,LOCATION_ONFIELD,1,1,e:GetHandler())
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function s.checkfilter(c)
return c:IsCode(88884402) and c:IsFaceup()
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.Destroy(tc,REASON_EFFECT)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EFFECT_CANNOT_ACTIVATE)
e1:SetTargetRange(0,1)
e1:SetValue(s.aclimit)
e1:SetLabel(tc:GetOriginalCodeRule())
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
local check=Duel.IsExistingMatchingCard(s.checkfilter,tp,LOCATION_ONFIELD,0,1,nil)
local des=Duel.GetMatchingGroup(aux.TRUE,tp,0,LOCATION_ONFIELD,nil)
if check and #des>0 and Duel.SelectYesNo(tp,aux.Stringid(88884432,2)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local rc=des:Select(tp,1,1,nil)
Duel.Destroy(rc,REASON_EFFECT)
end
end
end
function s.aclimit(e,re)
return re:GetOwner():IsOriginalCodeRule(table.unpack{e:GetLabel()})
end
function s.thfilter(c)
return c:IsSetCard(0x8881) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
end
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function s.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
\ No newline at end of file
--平景清
local s,id,o=GetID()
xpcall(function() require("expansions/script/c17035101") end,function() require("script/c17035101") end)
function s.initial_effect(c)
--synchro summon
aux.AddSynchroProcedure(c,aux.FilterBoolFunction(Card.IsAttribute,ATTRIBUTE_LIGHT),aux.NonTuner(nil),1)
c:EnableReviveLimit()
--spsummon condition
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_SPSUMMON_CONDITION)
e1:SetValue(aux.synlimit)
c:RegisterEffect(e1)
--indes
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetRange(LOCATION_MZONE)
e2:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e2:SetCondition(s.indcon)
e2:SetValue(1)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
c:RegisterEffect(e3)
local e3=e2:Clone()
e3:SetCode(EFFECT_UPDATE_ATTACK)
e3:SetValue(s.atkval)
c:RegisterEffect(e3)
--destroy
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(88884450,1))
e4:SetCategory(CATEGORY_DESTROY)
e4:SetType(EFFECT_TYPE_QUICK_O)
e4:SetCode(EVENT_FREE_CHAIN)
e4:SetRange(LOCATION_MZONE)
e4:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e4:SetCountLimit(1,88884450)
e4:SetCost(s.rmcost)
e4:SetTarget(s.rmtg)
e4:SetOperation(s.rmop)
c:RegisterEffect(e4)
chiki.FakeDarkSynchroProcedure(c,s.tgrfilter,s.fselect,2,99,nil,LOCATION_HAND+LOCATION_GRAVE,0,aux.tdcfop(c))
end
function s.tgrfilter(c)
return c:IsType(TYPE_MONSTER) and c:IsSetCard(0x8881) and c:IsAbleToDeckAsCost()
end
function s.mnfilter(c,g)
return c:IsType(TYPE_TUNER) and g:IsExists(s.mnfilter2,1,c,c)
end
function s.mnfilter2(c,mc)
return not c:IsType(TYPE_TUNER)
end
function s.fselect(g,tp,sc)
return g:IsExists(s.mnfilter,1,nil,g) and g:GetSum(Card.GetLevel)==11
and g:Filter(Card.IsType,nil,TYPE_TUNER):GetCount()==1
end
function s.indcon(e)
return e:GetHandler():IsSummonType(SUMMON_TYPE_SYNCHRO)
end
function s.atkval(e,c)
return c:GetMaterialCount()*500
end
function s.costfilter(c)
return c:IsSetCard(0x8881) and c:IsType(TYPE_MONSTER) and c:IsAbleToGraveAsCost()
end
function s.rmcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.costfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,s.costfilter,tp,LOCATION_DECK,0,1,1,nil)
Duel.SendtoGrave(g,REASON_COST)
end
function s.rmtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,0,LOCATION_ONFIELD+LOCATION_GRAVE,1,nil) end
local g=Duel.GetMatchingGroup(Card.IsAbleToRemove,tp,0,LOCATION_ONFIELD+LOCATION_GRAVE,nil)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,1,0,0)
end
function s.rmop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(Card.IsAbleToRemove),tp,0,LOCATION_ONFIELD+LOCATION_GRAVE,1,1,nil)
local tc=g:GetFirst()
if tc then
Duel.Remove(tc,POS_FACEUP,REASON_EFFECT)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EFFECT_CANNOT_ACTIVATE)
e1:SetTargetRange(0,1)
e1:SetValue(s.aclimit)
e1:SetLabel(tc:GetOriginalCodeRule())
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
end
function s.aclimit(e,re)
return re:GetOwner():IsOriginalCodeRule(table.unpack{e:GetLabel()})
end
\ No newline at end of file
......@@ -44,6 +44,7 @@ function cm.indestg(e,c)
return c:IsSetCard(0x83)
end
function cm.val(e,re,dam,r,rp)
if r&REASON_EFFECT==0 then return dam end
local rc=re:GetHandler()
if bit.band(r,REASON_EFFECT)~=0 and rc:IsSetCard(0x83) and rc:IsControler(e:GetHandlerPlayer()) then
return dam*2
......
--天启号 朱庇斯特
function c98920146.initial_effect(c)
--xyz summon
aux.AddXyzProcedure(c,nil,12,2,c98920146.ovfilter,aux.Stringid(98920146,0),2,c98920146.xyzop)
c:EnableReviveLimit()
--disable
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(98920146,1))
e1:SetCategory(CATEGORY_DISABLE)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_MZONE)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e1:SetCost(c98920146.tgcost)
e1:SetTarget(c98920146.tgtg)
e1:SetOperation(c98920146.tgop)
c:RegisterEffect(e1)
--overlay
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(98920146,0))
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCode(EVENT_TO_HAND)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1)
e3:SetCondition(c98920146.hdcon)
e3:SetTarget(c98920146.hdtg)
e3:SetOperation(c98920146.hdop)
c:RegisterEffect(e3)
if not c98920146.global_check then
c98920146.global_check=true
local ge1=Effect.GlobalEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_BATTLED)
ge1:SetOperation(c98920146.checkop)
Duel.RegisterEffect(ge1,0)
end
end
function c98920146.ovfilter(c)
return c:IsFaceup() and c:IsType(TYPE_XYZ)
end
function c98920146.xyzop(e,tp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,98920146)>0 and Duel.GetFlagEffect(tp,90448280)==0 end
Duel.RegisterFlagEffect(tp,90448280,RESET_PHASE+PHASE_END,EFFECT_FLAG_OATH,1)
end
function c98920146.check(c)
return c and c:IsType(TYPE_XYZ)
end
function c98920146.checkop(e,tp,eg,ep,ev,re,r,rp)
if c98920146.check(Duel.GetAttacker()) or c98920146.check(Duel.GetAttackTarget()) then
Duel.RegisterFlagEffect(tp,98920146,RESET_PHASE+PHASE_END,0,1)
Duel.RegisterFlagEffect(1-tp,98920146,RESET_PHASE+PHASE_END,0,1)
end
end
function c98920146.tgcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,2,REASON_COST) end
e:GetHandler():RemoveOverlayCard(tp,2,2,REASON_COST)
end
function c98920146.tgtg(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(c98920146.dsfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,e:GetHandler())
if chk==0 then return #g>0 end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,g,#g,0,0)
end
function c98920146.dsfilter(c)
return c:IsFaceup() and (c:IsLocation(LOCATION_SZONE) or c:IsType(TYPE_EFFECT))
end
function c98920146.tgop(e,tp,eg,ep,ev,re,r,rp)
local g=e:GetHandler()
local g=Duel.GetMatchingGroup(c98920146.dsfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,aux.ExceptThisCard(e))
if #g>0 then
local tc=g:GetFirst()
while tc do
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e2)
tc=g:GetNext()
end
end
end
function c98920146.cfilter(c,tp)
return c:IsControler(tp) and c:IsPreviousLocation(LOCATION_DECK)
end
function c98920146.hdcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase()~=PHASE_DRAW and eg:IsExists(c98920146.cfilter,1,nil,1-tp)
end
function c98920146.ofilter(c,e)
return c:IsCanOverlay() and (not e or not c:IsImmuneToEffect(e))
end
function c98920146.hdtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsType(TYPE_XYZ) and Duel.IsExistingMatchingCard(c98920146.ofilter,tp,LOCATION_HAND+LOCATION_DECK+LOCATION_EXTRA,0,1,nil) end
end
function c98920146.hdop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL)
local g=Duel.SelectMatchingCard(tp,c98920146.ofilter,tp,LOCATION_HAND+LOCATION_DECK+LOCATION_EXTRA,0,1,1,nil,e)
local tc=g:GetFirst()
if tc then
Duel.Overlay(c,tc)
end
Duel.ShuffleDeck(tp)
end
end
\ No newline at end of file
--隐秘怯懦魔术师
function c98920215.initial_effect(c)
--xyz summon
aux.AddXyzProcedure(c,nil,3,2)
c:EnableReviveLimit()
--battle indes
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetValue(c98920215.indcon)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
c:RegisterEffect(e2)
local e3=e1:Clone()
e3:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e3:SetValue(aux.tgoval)
c:RegisterEffect(e3)
--set
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(98920215,1))
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e4:SetCode(EVENT_TO_GRAVE)
e4:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e4:SetCondition(c98920215.setcon)
e4:SetTarget(c98920215.settg)
e4:SetOperation(c98920215.setop)
c:RegisterEffect(e4)
--Activate
local e5=Effect.CreateEffect(c)
e5:SetDescription(aux.Stringid(98920215,0))
e5:SetCategory(CATEGORY_NEGATE+CATEGORY_DESTROY)
e5:SetType(EFFECT_TYPE_QUICK_O)
e5:SetCode(EVENT_CHAINING)
e5:SetCountLimit(1)
e5:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
e5:SetRange(LOCATION_MZONE)
e5:SetCondition(c98920215.condition)
e5:SetCost(c98920215.cost)
e5:SetTarget(c98920215.target)
e5:SetOperation(c98920215.activate)
c:RegisterEffect(e5)
end
function c98920215.indcon(e,c)
return Duel.IsExistingMatchingCard(aux.TRUE,e:GetHandlerPlayer(),LOCATION_MZONE,0,1,e:GetHandler())
end
function c98920215.filter(c)
return c:IsType(TYPE_SPELL) and c:IsSSetable()
end
function c98920215.setcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsSummonType(SUMMON_TYPE_XYZ) and (rp==1-tp and c:IsReason(REASON_EFFECT) and c:IsPreviousControler(tp) and c:IsPreviousLocation(LOCATION_ONFIELD)) or c:IsReason(REASON_BATTLE)
end
function c98920215.settg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
end
function c98920215.setop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
local g=Duel.SelectMatchingCard(tp,c98920215.filter,tp,LOCATION_DECK,0,1,1,nil)
local tc=g:GetFirst()
if tc then
Duel.SSet(tp,tc)
end
end
function c98920215.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentChain()>=2
end
function c98920215.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST)
end
function c98920215.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local ng=Group.CreateGroup()
local dg=Group.CreateGroup()
for i=1,ev do
local te=Duel.GetChainInfo(i,CHAININFO_TRIGGERING_EFFECT)
if te:IsHasType(EFFECT_TYPE_ACTIVATE) or te:IsActiveType(TYPE_MONSTER) then
local tc=te:GetHandler()
ng:AddCard(tc)
if tc:IsRelateToEffect(te) then
dg:AddCard(tc)
end
end
end
Duel.SetTargetCard(dg)
Duel.SetOperationInfo(0,CATEGORY_NEGATE,ng,ng:GetCount(),0,0)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,dg,dg:GetCount(),0,0)
end
function c98920215.activate(e,tp,eg,ep,ev,re,r,rp)
local dg=Group.CreateGroup()
for i=1,ev do
local te,tgp=Duel.GetChainInfo(i,CHAININFO_TRIGGERING_EFFECT,CHAININFO_TRIGGERING_PLAYER)
local tc=te:GetHandler()
if tgp~=tp and (te:IsHasType(EFFECT_TYPE_ACTIVATE) or te:IsActiveType(TYPE_MONSTER))
and Duel.NegateActivation(i) and tc:IsRelateToEffect(e) and tc:IsRelateToEffect(te) then
dg:AddCard(tc)
end
end
Duel.Destroy(dg,REASON_EFFECT)
end
\ No newline at end of file
--异怪之妖精 艾尔芙妮
function c98920253.initial_effect(c)
--xyz summon
aux.AddXyzProcedure(c,aux.FilterBoolFunction(Card.IsAttribute,ATTRIBUTE_WIND),3,2)
c:EnableReviveLimit()
--search
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(98920253,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetCountLimit(1,98920253)
e1:SetRange(LOCATION_MZONE)
e1:SetCost(c98920253.cost)
e1:SetTarget(c98920253.target)
e1:SetOperation(c98920253.operation)
c:RegisterEffect(e1)
--remove
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(98920253,1))
e3:SetCategory(CATEGORY_REMOVE)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
e3:SetCountLimit(1,98920353)
e3:SetCondition(c98920253.descon)
e3:SetTarget(c98920253.destg)
e3:SetOperation(c98920253.desop)
c:RegisterEffect(e3)
end
function c98920253.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST)
end
function c98920253.filter(c)
return c:IsAttribute(ATTRIBUTE_WIND) and c:IsAbleToHand()
end
function c98920253.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c98920253.filter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c98920253.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c98920253.filter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
local tc=g:GetFirst()
if tc:IsLocation(LOCATION_HAND) and tc:IsLevelAbove(0) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EFFECT_CANNOT_ACTIVATE)
e1:SetTargetRange(1,1)
e1:SetLabel(tc:GetLevel()+1)
e1:SetReset(RESET_PHASE+PHASE_MAIN1+RESET_OPPO_TURN)
e1:SetValue(c98920253.val)
Duel.RegisterEffect(e1,tp)
end
end
end
function c98920253.val(e,re,tp)
return re:IsActiveType(TYPE_MONSTER) and re:GetHandler():IsLevelAbove(e:GetLabel())
end
function c98920253.descon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_XYZ)
end
function c98920253.destg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsFacedown,tp,0,LOCATION_ONFIELD,1,nil) end
local g=Duel.GetMatchingGroup(Card.IsFacedown,tp,0,LOCATION_ONFIELD,nil)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,1,0,0)
end
function c98920253.desop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectMatchingCard(tp,Card.IsFacedown,tp,0,LOCATION_ONFIELD,1,1,nil)
if g:GetCount()>0 then
Duel.HintSelection(g)
Duel.Remove(g,POS_FACEUP,REASON_EFFECT)
end
end
\ No newline at end of file
--加把劲团长
function c98920273.initial_effect(c)
--xyz summon
aux.AddXyzProcedure(c,aux.FilterBoolFunction(nil),4,2)
c:EnableReviveLimit()
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetDescription(aux.Stringid(98920273,0))
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetCountLimit(1,98920273)
e1:SetRange(LOCATION_MZONE)
e1:SetCost(c98920273.cost)
e1:SetTarget(c98920273.sptg)
e1:SetOperation(c98920273.spop)
c:RegisterEffect(e1)
--target/atk protection
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetRange(LOCATION_MZONE)
e2:SetTargetRange(0,LOCATION_MZONE)
e2:SetCode(EFFECT_CANNOT_SELECT_BATTLE_TARGET)
e2:SetCondition(c98920273.atcon)
e2:SetValue(c98920273.atlimit)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e3:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE+EFFECT_FLAG_SET_AVAILABLE)
e3:SetRange(LOCATION_MZONE)
e3:SetTargetRange(LOCATION_MZONE,0)
e3:SetCondition(c98920273.atcon)
e3:SetTarget(c98920273.tglimit)
e3:SetValue(aux.tgoval)
c:RegisterEffect(e3)
end
function c98920273.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST)
end
function c98920273.spfilter(c,e,tp)
return c:IsRace(RACE_WARRIOR) and (c:IsLevel(4) or c:IsLevel(5)) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE)
end
function c98920273.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c98920273.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function c98920273.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c98920273.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
local tc=g:GetFirst()
if tc and Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP_DEFENSE)~=0 then
local fid=e:GetHandler():GetFieldID()
tc:RegisterFlagEffect(98920273,RESET_EVENT+RESETS_STANDARD,0,1,fid)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetCountLimit(1)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetLabel(fid)
e1:SetLabelObject(tc)
e1:SetCondition(c98920273.descon)
e1:SetOperation(c98920273.desop)
Duel.RegisterEffect(e1,tp)
end
end
function c98920273.descon(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject()
if tc:GetFlagEffectLabel(98920273)~=e:GetLabel() then
e:Reset()
return false
else return true end
end
function c98920273.desop(e,tp,eg,ep,ev,re,r,rp)
Duel.Destroy(e:GetLabelObject(),REASON_EFFECT)
end
function c98920273.atcon(e)
return e:GetHandler():GetOverlayCount()~=0
end
function c98920273.atlimit(e,c)
return c~=e:GetHandler()
end
function c98920273.tglimit(e,c)
return c~=e:GetHandler()
end
\ No newline at end of file
......@@ -1064,6 +1064,9 @@
!setname 0xc05 废都
!setname 0xc06 神蚀
#ALTER 888
!setname 0x8881 源氏
#Derren 910 0x9d0~0x9df
!setname 0x9d0 真神
!setname 0x9d1 真神兽
......@@ -1090,6 +1093,9 @@
!setname 0xad0 超古代的
!setname 0xad2 萝卜-R
#yun优 398623059 770 0xee0-0xeef
!setname 0xee2 临界精灵
#TYGOC Submissions
#Desruc_6872 987
!counter 0x57b Scarlet Counter
......
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