Commit ef642e87 authored by 聖園ミカ's avatar 聖園ミカ 🐟

54188

parent 8428e6bd
Pipeline #31057 passed with stage
in 9 minutes and 55 seconds
No preview for this file type
...@@ -942,9 +942,6 @@ ...@@ -942,9 +942,6 @@
31300027 1 --PekoMiko大战争 31300027 1 --PekoMiko大战争
31300037 2 --赌鬼巫女 miko 31300037 2 --赌鬼巫女 miko
31300040 1 --黄油巫女 miko 31300040 1 --黄油巫女 miko
31300042 1 --Bijou
31300043 1 --魔女 Bijou
31300045 1 --Biboo
#332 #332
33200251 1 --机略纵横 鲁子敬 33200251 1 --机略纵横 鲁子敬
33200907 1 --寒霜灵兽 玛狃拉 33200907 1 --寒霜灵兽 玛狃拉
......
--追风逐电,灭亡的狼烟
function c29969185.initial_effect(c)
--xyz summon
aux.AddXyzProcedure(c,c29969185.mfilter0,8,2,c29969185.ovfilter,aux.Stringid(29969185,0),2,c29969185.xyzop)
c:EnableReviveLimit()
--direct attack
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DIRECT_ATTACK)
c:RegisterEffect(e1)
--full break
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(29969185,1))
e2:SetCategory(CATEGORY_DESTROY)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_BATTLE_DAMAGE)
e2:SetCountLimit(1,299969185)
e2:SetCondition(c29969185.descondition)
e2:SetCost(c29969185.descost)
e2:SetTarget(c29969185.destg)
e2:SetOperation(c29969185.desop)
c:RegisterEffect(e2)
--special summon
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(29969185,2))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCode(EVENT_DESTROYED)
e3:SetCountLimit(1,29969186)
e3:SetTarget(c29969185.sptg)
e3:SetOperation(c29969185.spop)
c:RegisterEffect(e3)
--voice
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e0:SetCode(EVENT_SPSUMMON_SUCCESS)
e0:SetOperation(c29969185.sumsuc)
c:RegisterEffect(e0)
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_SINGLE)
e4:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e4:SetCode(EVENT_LEAVE_FIELD)
e4:SetCondition(c29969185.leavecon1)
e4:SetOperation(c29969185.leaveop1)
c:RegisterEffect(e4)
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e5:SetCategory(CATEGORY_DESTROY)
e5:SetCode(EVENT_BATTLE_DESTROYING)
e5:SetCondition(aux.bdocon)
e5:SetOperation(c29969185.winop)
c:RegisterEffect(e5)
end
function c29969185.sumsuc(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(24,0,aux.Stringid(29969185,3))
end
function c29969185.leavecon1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsPreviousLocation(LOCATION_MZONE)
and c:IsPreviousControler(tp) and c:GetReasonPlayer()==1-tp
end
function c29969185.leaveop1(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(24,0,aux.Stringid(29969185,4))
end
function c29969185.winop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(24,0,aux.Stringid(29969185,6))
end
function c29969185.mfilter0(c)
return c:IsRace(RACE_MACHINE) and c:IsAttribute(ATTRIBUTE_FIRE)
end
function c29969185.grfilter(c)
return c:IsRace(RACE_MACHINE) and c:IsAttribute(ATTRIBUTE_FIRE)
end
function c29969185.ovfilter(c)
local g=Duel.GetMatchingGroup(c29969185.grfilter,c:GetControler(),LOCATION_GRAVE,0,nil)
local ct=g:GetClassCount(Card.GetCode)
return ct>=4 and c:IsFaceup() and c:GetBaseAttack()==1800 and c:GetBaseDefense()==0
and c:IsRace(RACE_DRAGON) and c:IsAttribute(ATTRIBUTE_DARK)
and c:IsLevel(4)
end
function c29969185.xyzop(e,tp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,29969185)==0 end
Duel.RegisterFlagEffect(tp,29969185,RESET_PHASE+PHASE_END,EFFECT_FLAG_OATH,1)
end
function c29969185.desfilter(c)
return not (c:IsFaceup() and c:IsAttribute(ATTRIBUTE_FIRE)) or c:IsFacedown()
end
function c29969185.descondition(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetFieldGroup(tp,LOCATION_MZONE,0)
return ep~=tp and Duel.GetAttackTarget()==nil and Duel.GetOverlayCount(tp,1,0)>=4
and #g>0 and g:FilterCount(c29969185.desfilter,nil)==0
end
function c29969185.descost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckRemoveOverlayCard(tp,1,0,Duel.GetOverlayCount(tp,1,0),REASON_COST) end
Duel.RemoveOverlayCard(tp,1,0,Duel.GetOverlayCount(tp,1,0),Duel.GetOverlayCount(tp,1,0),REASON_COST)
end
function c29969185.destg(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetFieldGroup(tp,0,LOCATION_ONFIELD)
if chk==0 then return g:GetCount()>0 end
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0)
end
function c29969185.desop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetFieldGroup(tp,0,LOCATION_ONFIELD)
if g:GetCount()>0 then
Duel.Hint(24,0,aux.Stringid(29969185,5))
Duel.Destroy(g,REASON_RULE)
end
end
function c29969185.mfilter(c)
return c:IsRace(RACE_MACHINE) and c:IsAttribute(ATTRIBUTE_FIRE) and c:IsCanOverlay()
end
function c29969185.sptg(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 c29969185.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)~=0 then
local g=Duel.GetMatchingGroup(aux.NecroValleyFilter(c29969185.mfilter),tp,LOCATION_HAND+LOCATION_GRAVE,0,nil)
if g:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(29969185,2)) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL)
local mg=g:Select(tp,1,4,nil)
Duel.Overlay(c,mg)
end
end
end
--净怜异灵·山脇大人
function c29990000.initial_effect(c)
aux.AddCodeList(c,29990010)
--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)
e1:SetValue(c29990000.splimit)
c:RegisterEffect(e1)
--spsummon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(29990000,0))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_TO_GRAVE)
e2:SetCountLimit(1,29990000+EFFECT_COUNT_CODE_OATH)
e2:SetCondition(c29990000.spcon)
e2:SetTarget(c29990000.sptg)
e2:SetOperation(c29990000.spop)
c:RegisterEffect(e2)
--to hand
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(29990000,1))
e3:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
e3:SetTarget(c29990000.thtg)
e3:SetOperation(c29990000.thop)
c:RegisterEffect(e3)
local e4=e3:Clone()
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e4:SetRange(LOCATION_MZONE)
e4:SetCondition(c29990000.sumcon)
c:RegisterEffect(e4)
--race change
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_QUICK_O)
e5:SetCode(EVENT_FREE_CHAIN)
e5:SetRange(LOCATION_GRAVE+LOCATION_REMOVED)
e5:SetCountLimit(1)
e5:SetTarget(c29990000.rctg)
e5:SetOperation(c29990000.rcop)
c:RegisterEffect(e5)
end
function c29990000.splimit(e,se,sp,st)
return se:GetHandler():IsSetCard(0x751)
end
function c29990000.spcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return re and re:GetHandler():IsType(TYPE_QUICKPLAY) and c:IsReason(REASON_EFFECT) and c:IsPreviousLocation(LOCATION_HAND)
end
function c29990000.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function c29990000.spop(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsRelateToEffect(e) then
Duel.SpecialSummon(e:GetHandler(),0,tp,tp,false,false,POS_FACEUP)
end
end
function c29990000.cfilter(c,tp)
return c:IsFaceup() and c:IsCode(29990010) and c:IsControler(tp)
end
function c29990000.sumcon(e,tp,eg,ep,ev,re,r,rp)
return not eg:IsContains(e:GetHandler()) and eg:IsExists(c29990000.cfilter,1,nil,tp)
end
function c29990000.ctfilter(c)
return c:IsFaceup() and c:IsSetCard(0x751) and c:IsLevel(2)
end
function c29990000.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local ct=Duel.GetMatchingGroup(c29990000.ctfilter,tp,LOCATION_MZONE,0,nil):GetClassCount(Card.GetCode)
if Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)<ct then return false end
end
end
function c29990000.thfilter(c)
return c:IsSetCard(0x751) and not c:IsCode(29990000) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
end
function c29990000.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c29990000.thfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK+LOCATION_GRAVE)
end
function c29990000.filter3(c,code)
return c:IsSetCard(0x751)
end
function c29990000.thop(e,tp,eg,ep,ev,re,r,rp)
local ct=Duel.GetMatchingGroup(c29990000.ctfilter,tp,LOCATION_MZONE,0,nil):GetClassCount(Card.GetCode)
Duel.ConfirmDecktop(tp,ct)
local g=Duel.GetDecktopGroup(tp,ct)
local ac=Duel.GetChainInfo(0,CHAININFO_TARGET_PARAM)
local hg=g:Filter(c29990000.filter3,nil,ac)
g:Sub(hg)
if hg:GetCount()~=0 and Duel.SelectYesNo(tp,aux.Stringid(29990000,3))then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c29990000.thfilter),tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil)
if #g>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
Duel.ShuffleDeck(tp)
end
function c29990000.rctg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return not e:GetHandler():IsRace(RACE_FAIRY) end
Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,e:GetHandler(),1,0,0)
end
function c29990000.rcop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CHANGE_RACE)
e1:SetValue(RACE_FAIRY)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE+RESET_PHASE+PHASE_END)
c:RegisterEffect(e1)
end
end
--净怜异灵·小丰后
function c29990010.initial_effect(c)
aux.AddCodeList(c,29990000)
--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)
e1:SetValue(c29990010.splimit)
c:RegisterEffect(e1)
--spsummon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(29990010,0))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_TO_GRAVE)
e2:SetCountLimit(1,29990010+EFFECT_COUNT_CODE_OATH)
e2:SetCondition(c29990010.spcon)
e2:SetTarget(c29990010.sptg)
e2:SetOperation(c29990010.spop)
c:RegisterEffect(e2)
--special summon
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(29990010,1))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetTarget(c29990010.sptg2)
e3:SetOperation(c29990010.spop2)
c:RegisterEffect(e3)
local e4=e3:Clone()
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e4:SetRange(LOCATION_MZONE)
e4:SetCondition(c29990010.sumcon)
c:RegisterEffect(e4)
--race change
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_QUICK_O)
e5:SetCode(EVENT_FREE_CHAIN)
e5:SetRange(LOCATION_GRAVE+LOCATION_REMOVED)
e5:SetCountLimit(1)
e5:SetTarget(c29990010.rctg)
e5:SetOperation(c29990010.rcop)
c:RegisterEffect(e5)
end
function c29990010.splimit(e,se,sp,st)
return se:GetHandler():IsSetCard(0x751)
end
function c29990010.spcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return re and re:GetHandler():IsType(TYPE_QUICKPLAY) and c:IsReason(REASON_EFFECT) and c:IsPreviousLocation(LOCATION_HAND)
end
function c29990010.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function c29990010.spop(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsRelateToEffect(e) then
Duel.SpecialSummon(e:GetHandler(),0,tp,tp,false,false,POS_FACEUP)
end
end
function c29990010.cfilter(c,tp)
return c:IsFaceup() and c:IsCode(29990000) and c:IsControler(tp)
end
function c29990010.sumcon(e,tp,eg,ep,ev,re,r,rp)
return not eg:IsContains(e:GetHandler()) and eg:IsExists(c29990010.cfilter,1,nil,tp)
end
function c29990010.ctfilter(c)
return c:IsFaceup() and c:IsSetCard(0x751) and c:IsLevel(2)
end
function c29990010.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local ct=Duel.GetMatchingGroup(c29990010.ctfilter,tp,LOCATION_MZONE,0,nil):GetClassCount(Card.GetCode)
if Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)<ct then return false end
end
end
function c29990010.spfilter(c,e,tp)
return c:IsSetCard(0x751) and c:IsLevel(2) and not c:IsCode(29990010) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c29990010.sptg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c29990010.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)
end
function c29990010.filter3(c,code)
return c:IsSetCard(0x751)
end
function c29990010.spop2(e,tp,eg,ep,ev,re,r,rp)
local ct=Duel.GetMatchingGroup(c29990010.ctfilter,tp,LOCATION_MZONE,0,nil):GetClassCount(Card.GetCode)
Duel.ConfirmDecktop(tp,ct)
local g=Duel.GetDecktopGroup(tp,ct)
local ac=Duel.GetChainInfo(0,CHAININFO_TARGET_PARAM)
local hg=g:Filter(c29990010.filter3,nil,ac)
g:Sub(hg)
if hg:GetCount()~=0 and Duel.SelectYesNo(tp,aux.Stringid(29990010,3))then
if Duel.GetLocationCount(tp,LOCATION_MZONE)<1 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c29990010.spfilter),tp,LOCATION_HAND+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
Duel.ShuffleDeck(tp)
end
function c29990010.rctg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return not e:GetHandler():IsRace(RACE_FAIRY) end
Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,e:GetHandler(),1,0,0)
end
function c29990010.rcop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CHANGE_RACE)
e1:SetValue(RACE_FAIRY)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE+RESET_PHASE+PHASE_END)
c:RegisterEffect(e1)
end
end
--净怜异灵·小天音
function c29990020.initial_effect(c)
aux.AddCodeList(c,29990030)
--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)
e1:SetValue(c29990020.splimit)
c:RegisterEffect(e1)
--spsummon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(29990020,0))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_TO_GRAVE)
e2:SetCountLimit(1,29990020+EFFECT_COUNT_CODE_OATH)
e2:SetCondition(c29990020.spcon)
e2:SetTarget(c29990020.sptg)
e2:SetOperation(c29990020.spop)
c:RegisterEffect(e2)
--set
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(29990020,1))
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCountLimit(2,29990021+EFFECT_COUNT_CODE_OATH)
e3:SetCost(c29990020.cost)
e3:SetTarget(c29990020.target)
e3:SetOperation(c29990020.operation)
c:RegisterEffect(e3)
local e4=e3:Clone()
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e4:SetRange(LOCATION_MZONE)
e4:SetCondition(c29990020.sumcon)
c:RegisterEffect(e4)
--race change
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_QUICK_O)
e5:SetCode(EVENT_FREE_CHAIN)
e5:SetRange(LOCATION_GRAVE+LOCATION_REMOVED)
e5:SetCountLimit(1)
e5:SetTarget(c29990020.rctg)
e5:SetOperation(c29990020.rcop)
c:RegisterEffect(e5)
end
function c29990020.splimit(e,se,sp,st)
return se:GetHandler():IsSetCard(0x751)
end
function c29990020.spcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return re and re:GetHandler():IsType(TYPE_QUICKPLAY) and c:IsReason(REASON_EFFECT) and c:IsPreviousLocation(LOCATION_HAND)
end
function c29990020.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function c29990020.spop(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsRelateToEffect(e) then
Duel.SpecialSummon(e:GetHandler(),0,tp,tp,false,false,POS_FACEUP)
end
end
function c29990020.filter1(c,e,tp)
return ((c:IsType(TYPE_XYZ) and c:IsSetCard(0x751)) or ((c:IsRank(2) or c:IsRank(7)) and c:IsType(TYPE_XYZ) and c:IsRace(RACE_FAIRY))) and Duel.IsExistingMatchingCard(c29990020.filter2,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,nil,e,tp,c)
end
function c29990020.filter2(c,e,tp,sc)
return c:IsType(TYPE_QUICKPLAY) and c:IsSSetable() and aux.IsCodeListed(sc,c:GetCode())
end
function c29990020.cfilter(c,tp)
return c:IsFaceup() and c:IsCode(29990030) and c:IsControler(tp)
end
function c29990020.sumcon(e,tp,eg,ep,ev,re,r,rp)
return not eg:IsContains(e:GetHandler()) and eg:IsExists(c29990020.cfilter,1,nil,tp)
end
function c29990020.ctfilter(c)
return c:IsFaceup() and c:IsSetCard(0x751) and c:IsLevel(2)
end
function c29990020.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c29990020.filter1,tp,LOCATION_EXTRA,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM)
local g=Duel.SelectMatchingCard(tp,c29990020.filter1,tp,LOCATION_EXTRA,0,1,1,nil,e,tp)
Duel.ConfirmCards(1-tp,g)
e:SetLabelObject(g:GetFirst())
end
function c29990020.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local ct=Duel.GetMatchingGroup(c29990020.ctfilter,tp,LOCATION_MZONE,0,nil):GetClassCount(Card.GetCode)
if Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)<ct then return false end
end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0
end
end
function c29990020.filter3(c,code)
return c:IsSetCard(0x751)
end
function c29990020.operation(e,tp,eg,ep,ev,re,r,rp)
local ct=Duel.GetMatchingGroup(c29990020.ctfilter,tp,LOCATION_MZONE,0,nil):GetClassCount(Card.GetCode)
Duel.ConfirmDecktop(tp,ct)
local g=Duel.GetDecktopGroup(tp,ct)
local ac=Duel.GetChainInfo(0,CHAININFO_TARGET_PARAM)
local hg=g:Filter(c29990020.filter3,nil,ac)
g:Sub(hg)
if hg:GetCount()~=0 and Duel.SelectYesNo(tp,aux.Stringid(29990020,3))then
if Duel.GetLocationCount(tp,LOCATION_SZONE)<1 then return end
local sc=e:GetLabelObject()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c29990020.filter2),tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,1,nil,e,tp,sc)
if g:GetCount()>0 then
Duel.SSet(tp,g:GetFirst())
end
Duel.ShuffleDeck(tp)
end
end
function c29990020.rctg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return not e:GetHandler():IsRace(RACE_FAIRY) end
Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,e:GetHandler(),1,0,0)
end
function c29990020.rcop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CHANGE_RACE)
e1:SetValue(RACE_FAIRY)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE+RESET_PHASE+PHASE_END)
c:RegisterEffect(e1)
end
end
--净怜异灵·小樱庭
function c29990030.initial_effect(c)
aux.AddCodeList(c,29990020)
--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)
e1:SetValue(c29990030.splimit)
c:RegisterEffect(e1)
--spsummon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(29990030,0))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_TO_GRAVE)
e2:SetCountLimit(1,29990030+EFFECT_COUNT_CODE_OATH)
e2:SetCondition(c29990030.spcon)
e2:SetTarget(c29990030.sptg)
e2:SetOperation(c29990030.spop)
c:RegisterEffect(e2)
--to grave
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(29990030,1))
e3:SetCategory(CATEGORY_TOGRAVE+CATEGORY_DECKDES)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCountLimit(2,29990031+EFFECT_COUNT_CODE_OATH)
e3:SetCost(c29990030.cost)
e3:SetTarget(c29990030.target)
e3:SetOperation(c29990030.operation)
c:RegisterEffect(e3)
local e4=e3:Clone()
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e4:SetRange(LOCATION_MZONE)
e4:SetCondition(c29990030.sumcon)
c:RegisterEffect(e4)
--race change
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_QUICK_O)
e5:SetCode(EVENT_FREE_CHAIN)
e5:SetRange(LOCATION_GRAVE+LOCATION_REMOVED)
e5:SetCountLimit(1)
e5:SetTarget(c29990030.rctg)
e5:SetOperation(c29990030.rcop)
c:RegisterEffect(e5)
end
function c29990030.splimit(e,se,sp,st)
return se:GetHandler():IsSetCard(0x751)
end
function c29990030.spcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return re and re:GetHandler():IsType(TYPE_QUICKPLAY) and c:IsReason(REASON_EFFECT) and c:IsPreviousLocation(LOCATION_HAND)
end
function c29990030.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function c29990030.spop(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsRelateToEffect(e) then
Duel.SpecialSummon(e:GetHandler(),0,tp,tp,false,false,POS_FACEUP)
end
end
function c29990030.filter1(c,e,tp)
return ((c:IsType(TYPE_XYZ) and c:IsSetCard(0x751)) or ((c:IsRank(2) or c:IsRank(7))
and c:IsType(TYPE_XYZ) and c:IsRace(RACE_FAIRY)))
and Duel.IsExistingMatchingCard(c29990030.filter2,tp,LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE,0,1,nil,e,tp,c)
end
function c29990030.filter2(c,e,tp,sc)
return c:IsType(TYPE_QUICKPLAY) and c:IsAbleToGrave() and aux.IsCodeListed(sc,c:GetCode())
end
function c29990030.cfilter(c,tp)
return c:IsFaceup() and c:IsCode(29990030) and c:IsControler(tp)
end
function c29990030.sumcon(e,tp,eg,ep,ev,re,r,rp)
return not eg:IsContains(e:GetHandler()) and eg:IsExists(c29990030.cfilter,1,nil,tp)
end
function c29990030.ctfilter(c)
return c:IsFaceup() and c:IsSetCard(0x751) and c:IsLevel(2)
end
function c29990030.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c29990030.filter1,tp,LOCATION_EXTRA,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM)
local g=Duel.SelectMatchingCard(tp,c29990030.filter1,tp,LOCATION_EXTRA,0,1,1,nil,e,tp)
Duel.ConfirmCards(1-tp,g)
e:SetLabelObject(g:GetFirst())
end
function c29990030.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local ct=Duel.GetMatchingGroup(c29990030.ctfilter,tp,LOCATION_MZONE,0,nil):GetClassCount(Card.GetCode)
if Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)<ct then return false end
end
if chk==0 then return true end
end
function c29990030.filter3(c,code)
return c:IsSetCard(0x751)
end
function c29990030.operation(e,tp,eg,ep,ev,re,r,rp)
local ct=Duel.GetMatchingGroup(c29990030.ctfilter,tp,LOCATION_MZONE,0,nil):GetClassCount(Card.GetCode)
Duel.ConfirmDecktop(tp,ct)
local g=Duel.GetDecktopGroup(tp,ct)
local ac=Duel.GetChainInfo(0,CHAININFO_TARGET_PARAM)
local hg=g:Filter(c29990030.filter3,nil,ac)
g:Sub(hg)
if hg:GetCount()~=0 and Duel.SelectYesNo(tp,aux.Stringid(29990030,3))then
local sc=e:GetLabelObject()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c29990030.filter2,tp,LOCATION_DECK,0,1,1,nil,e,tp,sc)
if g:GetCount()>0 then
Duel.SendtoGrave(g:GetFirst(),REASON_EFFECT)
end
Duel.ShuffleDeck(tp)
end
end
function c29990030.rctg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return not e:GetHandler():IsRace(RACE_FAIRY) end
Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,e:GetHandler(),1,0,0)
end
function c29990030.rcop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CHANGE_RACE)
e1:SetValue(RACE_FAIRY)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE+RESET_PHASE+PHASE_END)
c:RegisterEffect(e1)
end
end
--净怜异灵·小阿黛尔
function c29990040.initial_effect(c)
aux.AddCodeList(c,29990050)
--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)
e1:SetValue(c29990040.splimit)
c:RegisterEffect(e1)
--spsummon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(29990040,0))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_TO_GRAVE)
e2:SetCountLimit(1,29990040+EFFECT_COUNT_CODE_OATH)
e2:SetCondition(c29990040.spcon)
e2:SetTarget(c29990040.sptg)
e2:SetOperation(c29990040.spop)
c:RegisterEffect(e2)
--cannot destroy
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(29990040,1))
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
e3:SetCountLimit(2,29990041+EFFECT_COUNT_CODE_OATH)
e3:SetOperation(c29990040.operation)
c:RegisterEffect(e3)
local e4=e3:Clone()
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e4:SetRange(LOCATION_MZONE)
e4:SetCondition(c29990040.sumcon)
c:RegisterEffect(e4)
--race change
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_QUICK_O)
e5:SetCode(EVENT_FREE_CHAIN)
e5:SetRange(LOCATION_GRAVE+LOCATION_REMOVED)
e5:SetCountLimit(1)
e5:SetTarget(c29990040.rctg)
e5:SetOperation(c29990040.rcop)
c:RegisterEffect(e5)
end
function c29990040.splimit(e,se,sp,st)
return se:GetHandler():IsSetCard(0x751)
end
function c29990040.spcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return re and re:GetHandler():IsType(TYPE_QUICKPLAY) and c:IsReason(REASON_EFFECT) and c:IsPreviousLocation(LOCATION_HAND)
end
function c29990040.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function c29990040.spop(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsRelateToEffect(e) then
Duel.SpecialSummon(e:GetHandler(),0,tp,tp,false,false,POS_FACEUP)
end
end
function c29990040.cfilter(c,tp)
return c:IsFaceup() and c:IsCode(29990050) and c:IsControler(tp)
end
function c29990040.sumcon(e,tp,eg,ep,ev,re,r,rp)
return not eg:IsContains(e:GetHandler()) and eg:IsExists(c29990040.cfilter,1,nil,tp)
end
function c29990040.ctfilter(c)
return c:IsFaceup() and c:IsSetCard(0x751) and c:IsLevel(2)
end
function c29990040.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local ct=Duel.GetMatchingGroup(c29990040.ctfilter,tp,LOCATION_MZONE,0,nil):GetClassCount(Card.GetCode)
if Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)<ct then return false end
end
end
function c29990040.indtg(e,c)
return c:IsSetCard(0x751) and c:IsLevel(2) and not c:IsRace(RACE_WARRIOR)
end
function c29990040.filter3(c,code)
return c:IsSetCard(0x751)
end
function c29990040.operation(e,tp,eg,ep,ev,re,r,rp)
local ct=Duel.GetMatchingGroup(c29990040.ctfilter,tp,LOCATION_MZONE,0,nil):GetClassCount(Card.GetCode)
Duel.ConfirmDecktop(tp,ct)
local g=Duel.GetDecktopGroup(tp,ct)
local ac=Duel.GetChainInfo(0,CHAININFO_TARGET_PARAM)
local hg=g:Filter(c29990040.filter3,nil,ac)
g:Sub(hg)
if hg:GetCount()~=0 and Duel.SelectYesNo(tp,aux.Stringid(29990040,3))then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e1:SetTargetRange(LOCATION_MZONE,0)
e1:SetTarget(c29990040.indtg)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetValue(1)
Duel.RegisterEffect(e1,tp)
end
Duel.ShuffleDeck(tp)
end
function c29990040.rctg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return not e:GetHandler():IsRace(RACE_FAIRY) end
Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,e:GetHandler(),1,0,0)
end
function c29990040.rcop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CHANGE_RACE)
e1:SetValue(RACE_FAIRY)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE+RESET_PHASE+PHASE_END)
c:RegisterEffect(e1)
end
end
--净怜异灵·小佐月
function c29990050.initial_effect(c)
aux.AddCodeList(c,29990040)
--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)
e1:SetValue(c29990050.splimit)
c:RegisterEffect(e1)
--spsummon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(29990050,0))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_TO_GRAVE)
e2:SetCountLimit(1,29990050+EFFECT_COUNT_CODE_OATH)
e2:SetCondition(c29990050.spcon)
e2:SetTarget(c29990050.sptg)
e2:SetOperation(c29990050.spop)
c:RegisterEffect(e2)
--cannot destroy
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(29990050,1))
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
e3:SetCountLimit(2,29990051+EFFECT_COUNT_CODE_OATH)
e3:SetOperation(c29990050.operation)
c:RegisterEffect(e3)
local e4=e3:Clone()
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e4:SetRange(LOCATION_MZONE)
e4:SetCondition(c29990050.sumcon)
c:RegisterEffect(e4)
--race change
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_QUICK_O)
e5:SetCode(EVENT_FREE_CHAIN)
e5:SetRange(LOCATION_GRAVE+LOCATION_REMOVED)
e5:SetCountLimit(1)
e5:SetTarget(c29990050.rctg)
e5:SetOperation(c29990050.rcop)
c:RegisterEffect(e5)
end
function c29990050.splimit(e,se,sp,st)
return se:GetHandler():IsSetCard(0x751)
end
function c29990050.spcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return re and re:GetHandler():IsType(TYPE_QUICKPLAY) and c:IsReason(REASON_EFFECT) and c:IsPreviousLocation(LOCATION_HAND)
end
function c29990050.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function c29990050.spop(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsRelateToEffect(e) then
Duel.SpecialSummon(e:GetHandler(),0,tp,tp,false,false,POS_FACEUP)
end
end
function c29990050.cfilter(c,tp)
return c:IsFaceup() and c:IsCode(29990040) and c:IsControler(tp)
end
function c29990050.sumcon(e,tp,eg,ep,ev,re,r,rp)
return not eg:IsContains(e:GetHandler()) and eg:IsExists(c29990050.cfilter,1,nil,tp)
end
function c29990050.ctfilter(c)
return c:IsFaceup() and c:IsSetCard(0x751) and c:IsLevel(2)
end
function c29990050.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local ct=Duel.GetMatchingGroup(c29990050.ctfilter,tp,LOCATION_MZONE,0,nil):GetClassCount(Card.GetCode)
if Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)<ct then return false end
end
end
function c29990050.indtg(e,c)
return c:IsSetCard(0x751) and c:IsLevel(2) and not c:IsRace(RACE_ZOMBIE)
end
function c29990050.filter3(c,code)
return c:IsSetCard(0x751)
end
function c29990050.operation(e,tp,eg,ep,ev,re,r,rp)
local ct=Duel.GetMatchingGroup(c29990050.ctfilter,tp,LOCATION_MZONE,0,nil):GetClassCount(Card.GetCode)
Duel.ConfirmDecktop(tp,ct)
local g=Duel.GetDecktopGroup(tp,ct)
local ac=Duel.GetChainInfo(0,CHAININFO_TARGET_PARAM)
local hg=g:Filter(c29990050.filter3,nil,ac)
g:Sub(hg)
if hg:GetCount()~=0 and Duel.SelectYesNo(tp,aux.Stringid(29990050,3))then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e1:SetTargetRange(LOCATION_MZONE,0)
e1:SetTarget(c29990050.indtg)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetValue(1)
Duel.RegisterEffect(e1,tp)
end
Duel.ShuffleDeck(tp)
end
function c29990050.rctg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return not e:GetHandler():IsRace(RACE_FAIRY) end
Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,e:GetHandler(),1,0,0)
end
function c29990050.rcop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CHANGE_RACE)
e1:SetValue(RACE_FAIRY)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE+RESET_PHASE+PHASE_END)
c:RegisterEffect(e1)
end
end
--净怜异灵·魔王归来
function c29990100.initial_effect(c)
aux.AddCodeList(c,29990000,29990110)
c:EnableReviveLimit()
--connot special summon
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e0:SetCode(EFFECT_SPSUMMON_CONDITION)
c:RegisterEffect(e0)
--Gains Effect
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(29990100,0))
e1:SetType(EFFECT_TYPE_XMATERIAL+EFFECT_TYPE_QUICK_O)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(3,29990100+EFFECT_COUNT_CODE_OATH)
e1:SetCondition(c29990100.orucon)
e1:SetTarget(c29990100.mattg)
e1:SetOperation(c29990100.matop)
c:RegisterEffect(e1)
--sp summon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(29990100,1))
e2:SetCategory(CATEGORY_TODECK+CATEGORY_SPECIAL_SUMMON)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_GRAVE)
e2:SetTarget(c29990100.sptg)
e2:SetOperation(c29990100.spop)
c:RegisterEffect(e2)
--special summon
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_SPSUMMON_PROC)
e3:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e3:SetRange(LOCATION_HAND+LOCATION_DECK)
e3:SetCondition(c29990100.hspcon)
e3:SetTarget(c29990100.hsptg)
e3:SetOperation(c29990100.hspop)
c:RegisterEffect(e3)
--redirect
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetCode(EFFECT_LEAVE_FIELD_REDIRECT)
e4:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e4:SetTargetRange(LOCATION_ONFIELD,LOCATION_ONFIELD)
e4:SetValue(LOCATION_REMOVED)
c:RegisterEffect(e4)
if not c29990100.global_check then
c29990100.global_check=true
local ge1=Effect.GlobalEffect()
ge1:SetType(EFFECT_TYPE_FIELD)
ge1:SetCode(EFFECT_TO_GRAVE_REDIRECT)
ge1:SetTargetRange(LOCATION_OVERLAY,LOCATION_OVERLAY)
ge1:SetTarget(aux.TargetBoolFunction(Card.IsCode,29990100))
ge1:SetValue(LOCATION_REMOVED)
Duel.RegisterEffect(ge1,0)
end
end
function c29990100.orucon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsSetCard(0x751) or (c:IsRank(7) and c:IsRace(RACE_FAIRY))
end
function c29990100.xyzfilter(c)
return c:IsFaceup() and c:IsType(TYPE_XYZ) and (c:IsSetCard(0x751) or ((c:IsRank(2) or c:IsRank(7)) and c:IsRace(RACE_FAIRY)))
end
function c29990100.mfilter(c)
return c:IsType(TYPE_QUICKPLAY) and c:IsCanOverlay()
end
function c29990100.mattg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsPosition(LOCATION_MZONE) and c29990100.xyzfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c29990100.xyzfilter,tp,LOCATION_MZONE,0,1,nil)
and Duel.IsExistingMatchingCard(c29990100.mfilter,tp,LOCATION_GRAVE,0,1,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,c29990100.xyzfilter,tp,LOCATION_MZONE,0,1,1,nil)
end
function c29990100.matop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsFaceup() and tc:IsRelateToEffect(e) and not tc:IsImmuneToEffect(e) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c29990100.mfilter),tp,LOCATION_GRAVE,0,1,1,nil)
if g:GetCount()>0 then
Duel.Overlay(tc,g)
end
end
end
function c29990100.spfilter(c,ft)
return c:IsFaceup() and c:IsCode(29990000) and c:IsAbleToDeck() and (ft>0 or c:GetSequence()<5)
end
function c29990100.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c29990100.spfilter(chkc,ft) end
if chk==0 then return Duel.IsExistingTarget(c29990100.spfilter,tp,LOCATION_MZONE,0,1,nil,ft)
and ft>-1 and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,true,true,POS_FACEUP_DEFENSE) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectTarget(tp,c29990100.spfilter,tp,LOCATION_MZONE,0,1,1,nil,ft)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function c29990100.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.SendtoDeck(tc,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)~=0 and c:IsRelateToEffect(e)
then
Duel.SpecialSummon(c,0,tp,tp,true,true,POS_FACEUP_DEFENSE)
end
end
function c29990100.sprfilter(c)
return c:IsFaceup() and c:IsCode(29990110)
end
function c29990100.hspfilter(c)
return c:IsCode(29990000) and c:IsReleasable()
end
function c29990100.hspcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c29990100.sprfilter,tp,LOCATION_ONFIELD,0,1,nil)
and Duel.IsExistingMatchingCard(c29990100.hspfilter,tp,LOCATION_HAND,0,1,c)
end
function c29990100.hsptg(e,tp,eg,ep,ev,re,r,rp,chk,c)
local g=Duel.GetMatchingGroup(c29990100.hspfilter,tp,LOCATION_HAND,0,c)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local tc=g:SelectUnselect(nil,tp,false,true,1,1)
if tc then
e:SetLabelObject(tc)
return true
else return false end
end
function c29990100.hspop(e,tp,eg,ep,ev,re,r,rp,c)
local g=e:GetLabelObject()
Duel.Release(g,REASON_SPSUMMON+REASON_RELEASE)
end
\ No newline at end of file
--净怜异灵·掌心上的美好
function c29990110.initial_effect(c)
aux.AddCodeList(c,29990010,29990100)
c:EnableReviveLimit()
--connot special summon
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e0:SetCode(EFFECT_SPSUMMON_CONDITION)
c:RegisterEffect(e0)
--Gains Effect
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(29990110,0))
e1:SetType(EFFECT_TYPE_XMATERIAL+EFFECT_TYPE_QUICK_O)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(3,29990110+EFFECT_COUNT_CODE_OATH)
e1:SetCondition(c29990110.orucon)
e1:SetTarget(c29990110.mattg)
e1:SetOperation(c29990110.matop)
c:RegisterEffect(e1)
--sp summon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(29990110,1))
e2:SetCategory(CATEGORY_TODECK+CATEGORY_SPECIAL_SUMMON)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_GRAVE)
e2:SetTarget(c29990110.sptg)
e2:SetOperation(c29990110.spop)
c:RegisterEffect(e2)
--special summon
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_SPSUMMON_PROC)
e3:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e3:SetRange(LOCATION_HAND+LOCATION_DECK)
e3:SetCondition(c29990110.hspcon)
e3:SetTarget(c29990110.hsptg)
e3:SetOperation(c29990110.hspop)
c:RegisterEffect(e3)
--redirect
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetCode(EFFECT_LEAVE_FIELD_REDIRECT)
e4:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e4:SetTargetRange(LOCATION_ONFIELD,LOCATION_ONFIELD)
e4:SetValue(LOCATION_REMOVED)
c:RegisterEffect(e4)
if not c29990110.global_check then
c29990110.global_check=true
local ge1=Effect.GlobalEffect()
ge1:SetType(EFFECT_TYPE_FIELD)
ge1:SetCode(EFFECT_TO_GRAVE_REDIRECT)
ge1:SetTargetRange(LOCATION_OVERLAY,LOCATION_OVERLAY)
ge1:SetTarget(aux.TargetBoolFunction(Card.IsCode,29990110))
ge1:SetValue(LOCATION_REMOVED)
Duel.RegisterEffect(ge1,0)
end
end
function c29990110.orucon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsSetCard(0x751) or (c:IsRank(7) and c:IsRace(RACE_FAIRY))
end
function c29990110.xyzfilter(c)
return c:IsFaceup() and c:IsType(TYPE_XYZ) and (c:IsSetCard(0x751) or ((c:IsRank(2) or c:IsRank(7)) and c:IsRace(RACE_FAIRY)))
end
function c29990110.mfilter(c)
return c:IsLevelBelow(2) and c:IsRace(RACE_FAIRY) and c:IsCanOverlay()
end
function c29990110.mattg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsPosition(LOCATION_MZONE) and c29990110.xyzfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c29990110.xyzfilter,tp,LOCATION_MZONE,0,1,nil)
and Duel.IsExistingMatchingCard(c29990110.mfilter,tp,LOCATION_GRAVE,0,1,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,c29990110.xyzfilter,tp,LOCATION_MZONE,0,1,1,nil)
end
function c29990110.matop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsFaceup() and tc:IsRelateToEffect(e) and not tc:IsImmuneToEffect(e) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c29990110.mfilter),tp,LOCATION_GRAVE,0,1,1,nil)
if g:GetCount()>0 then
Duel.Overlay(tc,g)
end
end
end
function c29990110.spfilter(c,ft)
return c:IsFaceup() and c:IsCode(29990010) and c:IsAbleToDeck() and (ft>0 or c:GetSequence()<5)
end
function c29990110.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c29990110.spfilter(chkc,ft) end
if chk==0 then return Duel.IsExistingTarget(c29990110.spfilter,tp,LOCATION_MZONE,0,1,nil,ft)
and ft>-1 and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,true,true,POS_FACEUP_DEFENSE) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectTarget(tp,c29990110.spfilter,tp,LOCATION_MZONE,0,1,1,nil,ft)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function c29990110.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.SendtoDeck(tc,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)~=0 and c:IsRelateToEffect(e)
then
Duel.SpecialSummon(c,0,tp,tp,true,true,POS_FACEUP_DEFENSE)
end
end
function c29990110.sprfilter(c)
return c:IsFaceup() and c:IsCode(29990100)
end
function c29990110.hspfilter(c)
return c:IsCode(29990010) and c:IsReleasable()
end
function c29990110.hspcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c29990110.sprfilter,tp,LOCATION_ONFIELD,0,1,nil)
and Duel.IsExistingMatchingCard(c29990110.hspfilter,tp,LOCATION_HAND,0,1,c)
end
function c29990110.hsptg(e,tp,eg,ep,ev,re,r,rp,chk,c)
local g=Duel.GetMatchingGroup(c29990110.hspfilter,tp,LOCATION_HAND,0,c)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local tc=g:SelectUnselect(nil,tp,false,true,1,1)
if tc then
e:SetLabelObject(tc)
return true
else return false end
end
function c29990110.hspop(e,tp,eg,ep,ev,re,r,rp,c)
local g=e:GetLabelObject()
Duel.Release(g,REASON_SPSUMMON+REASON_RELEASE)
end
\ No newline at end of file
--净怜异灵·望红危渡梦浮桥
function c29990120.initial_effect(c)
aux.AddCodeList(c,29990020,29990130)
c:EnableReviveLimit()
--connot special summon
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e0:SetCode(EFFECT_SPSUMMON_CONDITION)
c:RegisterEffect(e0)
--Gains Effect
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(29990120,0))
e1:SetCategory(CATEGORY_TODECK)
e1:SetType(EFFECT_TYPE_XMATERIAL+EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,29990120+EFFECT_COUNT_CODE_OATH)
e1:SetCondition(c29990120.orucon)
e1:SetTarget(c29990120.tdtg)
e1:SetOperation(c29990120.tdop)
c:RegisterEffect(e1)
--sp summon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(29990120,1))
e2:SetCategory(CATEGORY_TODECK+CATEGORY_SPECIAL_SUMMON)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,29990121+EFFECT_COUNT_CODE_OATH)
e2:SetTarget(c29990120.sptg)
e2:SetOperation(c29990120.spop)
c:RegisterEffect(e2)
--special summon
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_SPSUMMON_PROC)
e3:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e3:SetRange(LOCATION_HAND+LOCATION_DECK)
e3:SetCountLimit(1,29990122+EFFECT_COUNT_CODE_OATH)
e3:SetCondition(c29990120.hspcon)
e3:SetTarget(c29990120.hsptg)
e3:SetOperation(c29990120.hspop)
c:RegisterEffect(e3)
--redirect
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetCode(EFFECT_LEAVE_FIELD_REDIRECT)
e4:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e4:SetTargetRange(LOCATION_ONFIELD,LOCATION_ONFIELD)
e4:SetValue(LOCATION_REMOVED)
c:RegisterEffect(e4)
if not c29990120.global_check then
c29990120.global_check=true
local ge1=Effect.GlobalEffect()
ge1:SetType(EFFECT_TYPE_FIELD)
ge1:SetCode(EFFECT_TO_GRAVE_REDIRECT)
ge1:SetTargetRange(LOCATION_OVERLAY,LOCATION_OVERLAY)
ge1:SetTarget(aux.TargetBoolFunction(Card.IsCode,29990120))
ge1:SetValue(LOCATION_REMOVED)
Duel.RegisterEffect(ge1,0)
end
end
function c29990120.orucon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsSetCard(0x751) or (c:IsRank(7) and c:IsRace(RACE_FAIRY))
end
function c29990120.ctfilter(c)
return c:IsFaceup() and c:IsSetCard(0x751) and c:IsType(TYPE_XYZ)
end
function c29990120.tdfilter(c)
return c:IsType(TYPE_SPELL+TYPE_TRAP) and not c:IsType(TYPE_QUICKPLAY) and c:IsAbleToDeck()
end
function c29990120.fselect(g)
return g:IsExists(Card.IsSetCard,1,nil,0x751)
end
function c29990120.tdtg(e,tp,eg,ep,ev,re,r,rp,chk)
local cg=Duel.GetMatchingGroup(c29990120.ctfilter,tp,LOCATION_MZONE,0,nil)
local ct=cg:GetClassCount(Card.GetCode)
local g=Duel.GetMatchingGroup(c29990120.tdfilter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,nil)
if chk==0 then return g:CheckSubGroup(c29990120.fselect,1,ct) end
Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,1,tp,0)
end
function c29990120.tdop(e,tp,eg,ep,ev,re,r,rp)
local cg=Duel.GetMatchingGroup(c29990120.ctfilter,tp,LOCATION_MZONE,0,nil)
local ct=cg:GetClassCount(Card.GetCode)
local g=Duel.GetMatchingGroup(aux.NecroValleyFilter(c29990120.tdfilter),tp,LOCATION_GRAVE+LOCATION_REMOVED,0,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local sg=g:SelectSubGroup(tp,c29990120.fselect,false,1,ct)
if sg and #sg~=0 then
Duel.SendtoDeck(sg,nil,ct,REASON_EFFECT)
end
end
function c29990120.spfilter(c,ft)
return c:IsFaceup() and c:IsCode(29990020) and c:IsAbleToDeck() and (ft>0 or c:GetSequence()<5)
end
function c29990120.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c29990120.spfilter(chkc,ft) end
if chk==0 then return Duel.IsExistingTarget(c29990120.spfilter,tp,LOCATION_MZONE,0,1,nil,ft)
and ft>-1 and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,true,true,POS_FACEUP_DEFENSE) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectTarget(tp,c29990120.spfilter,tp,LOCATION_MZONE,0,1,1,nil,ft)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function c29990120.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.SendtoDeck(tc,nil,SEQ_DECKBOTTOM,REASON_EFFECT)~=0 and c:IsRelateToEffect(e)
then
Duel.SpecialSummon(c,0,tp,tp,true,true,POS_FACEUP_DEFENSE)
end
end
function c29990120.sprfilter(c)
return c:IsFaceup() and c:IsCode(29990130)
end
function c29990120.hspfilter(c)
return c:IsCode(29990020) and c:IsReleasable()
end
function c29990120.hspcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c29990120.sprfilter,tp,LOCATION_ONFIELD,0,1,nil)
and Duel.IsExistingMatchingCard(c29990120.hspfilter,tp,LOCATION_HAND,0,1,c)
end
function c29990120.hsptg(e,tp,eg,ep,ev,re,r,rp,chk,c)
local g=Duel.GetMatchingGroup(c29990120.hspfilter,tp,LOCATION_HAND,0,c)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local tc=g:SelectUnselect(nil,tp,false,true,1,1)
if tc then
e:SetLabelObject(tc)
return true
else return false end
end
function c29990120.hspop(e,tp,eg,ep,ev,re,r,rp,c)
local g=e:GetLabelObject()
Duel.Release(g,REASON_SPSUMMON+REASON_RELEASE)
end
\ No newline at end of file
--净怜异灵·雨过天晴,心旷神怡
function c29990130.initial_effect(c)
aux.AddCodeList(c,29990030,29990120)
c:EnableReviveLimit()
--connot special summon
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e0:SetCode(EFFECT_SPSUMMON_CONDITION)
c:RegisterEffect(e0)
--Gains Effect
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(29990130,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_XMATERIAL+EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,29990130+EFFECT_COUNT_CODE_OATH)
e1:SetCondition(c29990130.orucon)
e1:SetTarget(c29990130.thtg)
e1:SetOperation(c29990130.thop)
c:RegisterEffect(e1)
--sp summon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(29990130,1))
e2:SetCategory(CATEGORY_TODECK+CATEGORY_SPECIAL_SUMMON)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,29990131+EFFECT_COUNT_CODE_OATH)
e2:SetTarget(c29990130.sptg)
e2:SetOperation(c29990130.spop)
c:RegisterEffect(e2)
--special summon
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_SPSUMMON_PROC)
e3:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e3:SetRange(LOCATION_HAND+LOCATION_DECK)
e3:SetCountLimit(1,29990132+EFFECT_COUNT_CODE_OATH)
e3:SetCondition(c29990130.hspcon)
e3:SetTarget(c29990130.hsptg)
e3:SetOperation(c29990130.hspop)
c:RegisterEffect(e3)
--redirect
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetCode(EFFECT_LEAVE_FIELD_REDIRECT)
e4:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e4:SetTargetRange(LOCATION_ONFIELD,LOCATION_ONFIELD)
e4:SetValue(LOCATION_REMOVED)
c:RegisterEffect(e4)
if not c29990130.global_check then
c29990130.global_check=true
local ge1=Effect.GlobalEffect()
ge1:SetType(EFFECT_TYPE_FIELD)
ge1:SetCode(EFFECT_TO_GRAVE_REDIRECT)
ge1:SetTargetRange(LOCATION_OVERLAY,LOCATION_OVERLAY)
ge1:SetTarget(aux.TargetBoolFunction(Card.IsCode,29990130))
ge1:SetValue(LOCATION_REMOVED)
Duel.RegisterEffect(ge1,0)
end
end
function c29990130.orucon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsSetCard(0x751) or (c:IsRank(7) and c:IsRace(RACE_FAIRY))
end
function c29990130.ctfilter(c)
return c:IsFaceup() and c:IsSetCard(0x751) and c:IsType(TYPE_XYZ)
end
function c29990130.thfilter(c)
return c:IsSetCard(0x751) and c:IsType(TYPE_SPELL+TYPE_TRAP) and not c:IsType(TYPE_QUICKPLAY) and c:IsAbleToHand()
end
function c29990130.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
return Duel.IsExistingMatchingCard(c29990130.ctfilter,tp,LOCATION_MZONE,0,1,nil)
and Duel.IsExistingMatchingCard(c29990130.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c29990130.thop(e,tp,eg,ep,ev,re,r,rp)
local g1=Duel.GetMatchingGroup(c29990130.ctfilter,tp,LOCATION_MZONE,0,nil)
if g1:GetCount()==0 then return end
local ct=g1:GetClassCount(Card.GetCode)
local g2=Duel.SelectMatchingCard(tp,c29990130.thfilter,tp,LOCATION_DECK,0,1,ct,nil)
if g2:GetCount()>=0 then
Duel.SendtoHand(g2,nil,REASON_EFFECT)
end
end
function c29990130.spfilter(c,ft)
return c:IsFaceup() and c:IsCode(29990030) and c:IsAbleToDeck() and (ft>0 or c:GetSequence()<5)
end
function c29990130.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c29990130.spfilter(chkc,ft) end
if chk==0 then return Duel.IsExistingTarget(c29990130.spfilter,tp,LOCATION_MZONE,0,1,nil,ft)
and ft>-1 and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,true,true,POS_FACEUP_DEFENSE) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectTarget(tp,c29990130.spfilter,tp,LOCATION_MZONE,0,1,1,nil,ft)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function c29990130.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.SendtoDeck(tc,nil,SEQ_DECKBOTTOM,REASON_EFFECT)~=0 and c:IsRelateToEffect(e)
then
Duel.SpecialSummon(c,0,tp,tp,true,true,POS_FACEUP_DEFENSE)
end
end
function c29990130.sprfilter(c)
return c:IsFaceup() and c:IsCode(29990120)
end
function c29990130.hspfilter(c)
return c:IsCode(29990030) and c:IsReleasable()
end
function c29990130.hspcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c29990130.sprfilter,tp,LOCATION_ONFIELD,0,1,nil)
and Duel.IsExistingMatchingCard(c29990130.hspfilter,tp,LOCATION_HAND,0,1,c)
end
function c29990130.hsptg(e,tp,eg,ep,ev,re,r,rp,chk,c)
local g=Duel.GetMatchingGroup(c29990130.hspfilter,tp,LOCATION_HAND,0,c)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local tc=g:SelectUnselect(nil,tp,false,true,1,1)
if tc then
e:SetLabelObject(tc)
return true
else return false end
end
function c29990130.hspop(e,tp,eg,ep,ev,re,r,rp,c)
local g=e:GetLabelObject()
Duel.Release(g,REASON_SPSUMMON+REASON_RELEASE)
end
\ No newline at end of file
--净怜异灵·微光的预兆
function c29990140.initial_effect(c)
aux.AddCodeList(c,29990040,29990150)
c:EnableReviveLimit()
--connot special summon
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e0:SetCode(EFFECT_SPSUMMON_CONDITION)
c:RegisterEffect(e0)
--Gains Effect
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(29990140,0))
e1:SetProperty(EFFECT_FLAG_CANNOT_INACTIVATE+EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CAN_FORBIDDEN)
e1:SetType(EFFECT_TYPE_XMATERIAL+EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,29990140+EFFECT_COUNT_CODE_OATH)
e1:SetCondition(c29990140.orucon)
e1:SetOperation(c29990140.racop)
c:RegisterEffect(e1)
--sp summon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(29990140,1))
e2:SetCategory(CATEGORY_TODECK+CATEGORY_SPECIAL_SUMMON)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,29990141+EFFECT_COUNT_CODE_OATH)
e2:SetTarget(c29990140.sptg)
e2:SetOperation(c29990140.spop)
c:RegisterEffect(e2)
--special summon
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_SPSUMMON_PROC)
e3:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e3:SetRange(LOCATION_HAND+LOCATION_DECK)
e3:SetCountLimit(1,29990142+EFFECT_COUNT_CODE_OATH)
e3:SetCondition(c29990140.hspcon)
e3:SetTarget(c29990140.hsptg)
e3:SetOperation(c29990140.hspop)
c:RegisterEffect(e3)
--redirect
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetCode(EFFECT_LEAVE_FIELD_REDIRECT)
e4:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e4:SetTargetRange(LOCATION_ONFIELD,LOCATION_ONFIELD)
e4:SetValue(LOCATION_REMOVED)
c:RegisterEffect(e4)
if not c29990140.global_check then
c29990140.global_check=true
local ge1=Effect.GlobalEffect()
ge1:SetType(EFFECT_TYPE_FIELD)
ge1:SetCode(EFFECT_TO_GRAVE_REDIRECT)
ge1:SetTargetRange(LOCATION_OVERLAY,LOCATION_OVERLAY)
ge1:SetTarget(aux.TargetBoolFunction(Card.IsCode,29990140))
ge1:SetValue(LOCATION_REMOVED)
Duel.RegisterEffect(ge1,0)
end
end
function c29990140.orucon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsSetCard(0x751) or (c:IsRank(7) and c:IsRace(RACE_FAIRY))
end
function c29990140.sctg(e,c)
return c:IsType(TYPE_XYZ) and c:IsRace(RACE_FAIRY) and c:IsRank(7)
end
function c29990140.racop(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_FIELD)
e1:SetProperty(EFFECT_FLAG_CANNOT_INACTIVATE+EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CAN_FORBIDDEN)
e1:SetCode(EFFECT_ADD_SETCODE)
e1:SetRange(LOCATION_MZONE)
e1:SetTargetRange(LOCATION_MZONE,0)
e1:SetTarget(c29990140.sctg)
e1:SetValue(0x751)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
c:RegisterEffect(e1)
end
end
function c29990140.spfilter(c,ft)
return c:IsFaceup() and c:IsCode(29990040) and c:IsAbleToDeck() and (ft>0 or c:GetSequence()<5)
end
function c29990140.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c29990140.spfilter(chkc,ft) end
if chk==0 then return Duel.IsExistingTarget(c29990140.spfilter,tp,LOCATION_MZONE,0,1,nil,ft)
and ft>-1 and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,true,true,POS_FACEUP_DEFENSE) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectTarget(tp,c29990140.spfilter,tp,LOCATION_MZONE,0,1,1,nil,ft)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function c29990140.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.SendtoDeck(tc,nil,SEQ_DECKTOP,REASON_EFFECT)~=0 and c:IsRelateToEffect(e)
then
Duel.SpecialSummon(c,0,tp,tp,true,true,POS_FACEUP_DEFENSE)
end
end
function c29990140.sprfilter(c)
return c:IsFaceup() and c:IsCode(29990150)
end
function c29990140.hspfilter(c)
return c:IsCode(29990040) and c:IsReleasable()
end
function c29990140.hspcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c29990140.sprfilter,tp,LOCATION_ONFIELD,0,1,nil)
and Duel.IsExistingMatchingCard(c29990140.hspfilter,tp,LOCATION_HAND,0,1,c)
end
function c29990140.hsptg(e,tp,eg,ep,ev,re,r,rp,chk,c)
local g=Duel.GetMatchingGroup(c29990140.hspfilter,tp,LOCATION_HAND,0,c)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local tc=g:SelectUnselect(nil,tp,false,true,1,1)
if tc then
e:SetLabelObject(tc)
return true
else return false end
end
function c29990140.hspop(e,tp,eg,ep,ev,re,r,rp,c)
local g=e:GetLabelObject()
Duel.Release(g,REASON_SPSUMMON+REASON_RELEASE)
end
--净怜异灵·娇滴滴,聚人心
function c29990150.initial_effect(c)
aux.AddCodeList(c,29990050,29990140)
c:EnableReviveLimit()
--cannot special summon
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e0:SetCode(EFFECT_SPSUMMON_CONDITION)
c:RegisterEffect(e0)
--Gains Effect
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(29990150,0))
e1:SetType(EFFECT_TYPE_XMATERIAL+EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,29990150+EFFECT_COUNT_CODE_OATH)
e1:SetCondition(c29990150.orucon)
e1:SetOperation(c29990150.racop)
c:RegisterEffect(e1)
--sp summon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(29990150,1))
e2:SetCategory(CATEGORY_TODECK+CATEGORY_SPECIAL_SUMMON)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,29990151+EFFECT_COUNT_CODE_OATH)
e2:SetTarget(c29990150.sptg)
e2:SetOperation(c29990150.spop)
c:RegisterEffect(e2)
--special summon
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_SPSUMMON_PROC)
e3:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e3:SetRange(LOCATION_HAND+LOCATION_DECK)
e3:SetCountLimit(1,29990152+EFFECT_COUNT_CODE_OATH)
e3:SetCondition(c29990150.hspcon)
e3:SetTarget(c29990150.hsptg)
e3:SetOperation(c29990150.hspop)
c:RegisterEffect(e3)
--redirect
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetCode(EFFECT_LEAVE_FIELD_REDIRECT)
e4:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e4:SetTargetRange(LOCATION_ONFIELD,LOCATION_ONFIELD)
e4:SetValue(LOCATION_REMOVED)
c:RegisterEffect(e4)
if not c29990150.global_check then
c29990150.global_check=true
local ge1=Effect.GlobalEffect()
ge1:SetType(EFFECT_TYPE_FIELD)
ge1:SetCode(EFFECT_TO_GRAVE_REDIRECT)
ge1:SetTargetRange(LOCATION_OVERLAY,LOCATION_OVERLAY)
ge1:SetTarget(aux.TargetBoolFunction(Card.IsCode,29990150))
ge1:SetValue(LOCATION_REMOVED)
Duel.RegisterEffect(ge1,0)
end
end
function c29990150.orucon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsSetCard(0x751) or (c:IsRank(7) and c:IsRace(RACE_FAIRY))
end
function c29990150.racop(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_FIELD)
e1:SetProperty(EFFECT_FLAG_CANNOT_INACTIVATE+EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CAN_FORBIDDEN)
e1:SetCode(EFFECT_ADD_RACE)
e1:SetRange(LOCATION_MZONE)
e1:SetTargetRange(LOCATION_MZONE,0)
e1:SetTarget(aux.TargetBoolFunction(Card.IsSetCard,0x751))
e1:SetValue(RACE_FAIRY)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetValue(RACE_THUNDER)
c:RegisterEffect(e2)
end
end
function c29990150.spfilter(c,ft)
return c:IsFaceup() and c:IsCode(29990050) and c:IsAbleToDeck() and (ft>0 or c:GetSequence()<5)
end
function c29990150.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c29990150.spfilter(chkc,ft) end
if chk==0 then return Duel.IsExistingTarget(c29990150.spfilter,tp,LOCATION_MZONE,0,1,nil,ft)
and ft>-1 and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,true,true,POS_FACEUP_DEFENSE) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectTarget(tp,c29990150.spfilter,tp,LOCATION_MZONE,0,1,1,nil,ft)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function c29990150.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.SendtoDeck(tc,nil,SEQ_DECKTOP,REASON_EFFECT)~=0 and c:IsRelateToEffect(e)
then
Duel.SpecialSummon(c,0,tp,tp,true,true,POS_FACEUP_DEFENSE)
end
end
function c29990150.sprfilter(c)
return c:IsFaceup() and c:IsCode(29990140)
end
function c29990150.hspfilter(c)
return c:IsCode(29990050) and c:IsReleasable()
end
function c29990150.hspcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c29990150.sprfilter,tp,LOCATION_ONFIELD,0,1,nil)
and Duel.IsExistingMatchingCard(c29990150.hspfilter,tp,LOCATION_HAND,0,1,c)
end
function c29990150.hsptg(e,tp,eg,ep,ev,re,r,rp,chk,c)
local g=Duel.GetMatchingGroup(c29990150.hspfilter,tp,LOCATION_HAND,0,c)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local tc=g:SelectUnselect(nil,tp,false,true,1,1)
if tc then
e:SetLabelObject(tc)
return true
else return false end
end
function c29990150.hspop(e,tp,eg,ep,ev,re,r,rp,c)
local g=e:GetLabelObject()
Duel.Release(g,REASON_SPSUMMON+REASON_RELEASE)
end
\ No newline at end of file
--净怜异灵决胜一瞬
function c29990300.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_HANDES+CATEGORY_DECKDES+CATEGORY_TOGRAVE+CATEGORY_DRAW)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCondition(c29990300.condition)
e1:SetTarget(c29990300.target)
e1:SetOperation(c29990300.activate)
c:RegisterEffect(e1)
--tograve
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(29990300,5))
e2:SetCategory(CATEGORY_DECKDES+CATEGORY_TOGRAVE)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_TO_GRAVE)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e2:SetCondition(c29990300.tgcon)
e2:SetTarget(c29990300.tgtg)
e2:SetOperation(c29990300.tgop)
c:RegisterEffect(e2)
end
function c29990300.condition(e,tp,eg,ep,ev,re,r,rp)
local ph=Duel.GetCurrentPhase()
return ph==PHASE_MAIN1 or ph==PHASE_MAIN2
end
function c29990300.filter(c,e,tp)
return c:IsSetCard(0x751) and c:IsLevel(2) and c:IsType(TYPE_MONSTER) and c:IsAbleToGrave()
end
function c29990300.filter1(c,e,tp)
return c:IsSetCard(0x751) and c:IsLevel(7) and c:IsType(TYPE_MONSTER) and c:IsAbleToGrave()
and Duel.IsExistingMatchingCard(c29990300.gfilter,tp,LOCATION_GRAVE,0,1,nil,c:GetRace(),e,tp)
end
function c29990300.filter2(c,e,tp)
return c:IsSetCard(0x751) and c:IsLevel(7) and c:IsType(TYPE_MONSTER) and c:IsAbleToGrave()
and Duel.IsExistingMatchingCard(c29990300.gfilter,tp,LOCATION_GRAVE,0,1,nil,c:GetRace(),e,tp)
end
function c29990300.gfilter(c,race)
return c:IsRace(race) and (c:IsLevel(2) or c:IsSetCard(0x751))
and (c:IsLocation(LOCATION_GRAVE))
end
function c29990300.xfilter(c,e,tp)
return c:IsFaceup() and c:IsSetCard(0x751)
end
function c29990300.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c29990300.filter,tp,LOCATION_HAND,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_HANDES,nil,0,tp,1)
end
function c29990300.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c29990300.filter,tp,LOCATION_HAND,0,nil,e,tp)
local x=Duel.GetMatchingGroup(c29990300.xfilter,tp,LOCATION_MZONE,0,nil,e,tp)
local c=g:GetClassCount(Card.GetCode)
if c>=1 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISCARD)
aux.GCheckAdditional=aux.dncheck
local sg=g:SelectSubGroup(tp,aux.TRUE,false,1,3)
aux.GCheckAdditional=nil
local ct=Duel.SendtoGrave(sg,REASON_EFFECT+REASON_DISCARD)
if ct==0 then return end
local g1=Duel.GetMatchingGroup(c29990300.filter1,tp,LOCATION_DECK,0,nil,e,tp)
local g2=Duel.GetMatchingGroup(c29990300.filter2,tp,LOCATION_REMOVED,0,nil,e,tp)
if ct>=1 and ct<=3 and #g1+#g2>0 and Duel.SelectYesNo(tp,aux.Stringid(29990300,0)) then
Duel.BreakEffect()
if #g1>0 and (#g2==0 or Duel.SelectOption(tp,aux.Stringid(29990300,1),aux.Stringid(29990300,2))==0) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local sg1=g1:Select(tp,1,ct,nil)
if Duel.SendtoGrave(sg1,REASON_EFFECT)==3
and x:GetClassCount(Card.GetCode)>=3
and Duel.IsPlayerCanDraw(tp,3)
and Duel.SelectYesNo(tp,aux.Stringid(29990300,3)) then
Duel.BreakEffect()
Duel.ShuffleDeck(tp)
Duel.Draw(tp,3,REASON_EFFECT)
end
else
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local sg2=g2:Select(tp,1,ct,nil)
if Duel.SendtoGrave(sg2,REASON_EFFECT+REASON_RETURN)==3
and Duel.IsPlayerCanDraw(tp,3)
and Duel.SelectYesNo(tp,aux.Stringid(29990300,3)) then
Duel.BreakEffect()
Duel.ShuffleDeck(tp)
Duel.Draw(tp,3,REASON_EFFECT)
end
end
end
end
end
function c29990300.tgcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsReason(REASON_COST) and re:IsHasType(0x7e0) and re:IsActiveType(TYPE_MONSTER)
and re:GetHandler():IsSetCard(0x751) and c:IsPreviousLocation(LOCATION_OVERLAY)
end
function c29990300.tgfilter(c,tp)
return c:IsSetCard(0x751) and c:IsLevel(2) and c:IsType(TYPE_MONSTER)
and not Duel.IsExistingMatchingCard(Card.IsCode,tp,LOCATION_GRAVE,0,1,nil,c:GetCode())
and c:IsAbleToGrave()
end
function c29990300.tgtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c29990300.tgfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK)
end
function c29990300.tgop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c29990300.tgfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoGrave(g,REASON_EFFECT)
end
end
--慰藉净怜异灵的寂寞
function c29990310.initial_effect(c)
aux.AddCodeList(c,29990000,29990010)
--ac
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_ACTIVATE)
e0:SetCode(EVENT_FREE_CHAIN)
e0:SetCost(c29990310.opcost)
c:RegisterEffect(e0)
--sp summon
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_DECKDES)
e1:SetRange(LOCATION_SZONE)
e1:SetCountLimit(1,29990310+EFFECT_COUNT_CODE_OATH)
e1:SetCost(c29990310.cost)
e1:SetHintTiming(0,TIMING_END_PHASE)
e1:SetTarget(c29990310.sptg)
e1:SetOperation(c29990310.spop)
c:RegisterEffect(e1)
--xyz level
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_XYZ_LEVEL)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetRange(LOCATION_MZONE)
e2:SetValue(c29990310.xyzlv)
e2:SetLabel(2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_GRANT)
e3:SetRange(LOCATION_SZONE)
e3:SetTargetRange(LOCATION_MZONE,0)
e3:SetTarget(c29990310.eftg)
e3:SetLabelObject(e2)
c:RegisterEffect(e3)
end
function c29990310.opfilter(c)
return c:IsSetCard(0x751) and c:IsType(TYPE_MONSTER) and not c:IsPublic()
end
function c29990310.fselect(g,tp)
return g:GetClassCount(Card.GetRace)==#g
end
function c29990310.opcost(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(c29990310.opfilter,tp,LOCATION_HAND+LOCATION_DECK,0,nil)
if chk==0 then return g:GetClassCount(Card.GetCode)>=6 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM)
local cg=g:SelectSubGroup(tp,c29990310.fselect,false,6,6)
Duel.ConfirmCards(1-tp,cg)
Duel.ShuffleHand(tp)
Duel.ShuffleDeck(tp)
end
function c29990310.costfilter1(c)
return c:IsType(TYPE_QUICKPLAY) and c:IsCode(29990300) and not c:IsPublic()
end
function c29990310.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c29990310.costfilter1,tp,LOCATION_HAND+LOCATION_DECK,0,2,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM)
local g=Duel.SelectMatchingCard(tp,c29990310.costfilter1,tp,LOCATION_HAND+LOCATION_DECK,0,2,2,nil)
Duel.ConfirmCards(1-tp,g)
Duel.ShuffleHand(tp)
Duel.ShuffleDeck(tp)
end
function c29990310.list(c,e,tp,code)
return aux.IsCodeListed(c,code) and c:IsLevel(2) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and c:IsSetCard(0x751)
end
function c29990310.list2(c,e,tp,code)
return aux.IsCodeListed(c,code) and c:IsLevel(2) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and c:IsSetCard(0x751) and c:IsCode(29990000,29990010)
end
function c29990310.chklist1(c)
return c:IsFaceup() and c:IsCode(29990000)
end
function c29990310.chklist2(c)
return c:IsFaceup() and c:IsCode(29990010)
end
function c29990310.sptg1(c,e,tp)
return c:IsSetCard(0x751) and c:IsLevel(2)
and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
and Duel.IsExistingMatchingCard(c29990310.list,tp,LOCATION_DECK,0,1,c,e,tp,c:GetCode())
end
function c29990310.sptg2(c,e,tp)
return c:IsSetCard(0x751) and c:IsCode(29990000,29990010)
and c:IsLevel(2) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
and Duel.IsExistingMatchingCard(c29990310.list2,tp,LOCATION_DECK,0,1,c,e,tp,c:GetCode())
end
function c29990310.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local g=false
if Duel.IsExistingMatchingCard(c29990310.chklist1,tp,LOCATION_MZONE,0,1,nil)
and Duel.IsExistingMatchingCard(c29990310.chklist2,tp,LOCATION_MZONE,0,1,nil)
then g=true
end
if chk==0 and g then
return Duel.GetLocationCount(tp,LOCATION_MZONE)>=2 and
Duel.IsExistingMatchingCard(c29990310.sptg1,tp,LOCATION_DECK,0,1,nil,e,tp)
elseif chk==0 then
return Duel.GetLocationCount(tp,LOCATION_MZONE)>=2 and
Duel.IsExistingMatchingCard(c29990310.sptg2,tp,LOCATION_DECK,0,1,nil,e,tp)
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,2,tp,LOCATION_DECK)
end
function c29990310.spop(e,tp,eg,ep,ev,re,r,rp)
local g=false
if Duel.IsExistingMatchingCard(c29990310.chklist1,tp,LOCATION_MZONE,0,1,nil)
and Duel.IsExistingMatchingCard(c29990310.chklist2,tp,LOCATION_MZONE,0,1,nil)
then g=true
end
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=1 then return false end
if g and Duel.IsExistingMatchingCard(c29990310.sptg1,tp,LOCATION_DECK,0,1,nil,e,tp) then
Duel.Hint(3,tp,HINTMSG_SPSUMMON)
local c1=Duel.SelectMatchingCard(tp,c29990310.sptg1,tp,LOCATION_DECK,0,1,1,nil,e,tp):GetFirst()
Duel.Hint(3,tp,HINTMSG_SPSUMMON)
local c2=Duel.SelectMatchingCard(tp,c29990310.list,tp,LOCATION_DECK,0,1,1,c1,e,tp,c1:GetCode())
c2:AddCard(c1)
Duel.SpecialSummon(c2,0,tp,tp,false,false,POS_FACEUP)
elseif Duel.IsExistingMatchingCard(c29990310.sptg2,tp,LOCATION_DECK,0,1,nil,e,tp) then
Duel.Hint(3,tp,HINTMSG_SPSUMMON)
local c1=Duel.SelectMatchingCard(tp,c29990310.sptg2,
tp,LOCATION_DECK,0,1,1,nil,e,tp):GetFirst()
Duel.Hint(3,tp,HINTMSG_SPSUMMON)
local c2=Duel.SelectMatchingCard(tp,c29990310.list2,tp,LOCATION_DECK,0,1,1,c1,e,tp,c1:GetCode())
c2:AddCard(c1)
Duel.SpecialSummon(c2,0,tp,tp,false,false,POS_FACEUP)
end
end
function c29990310.eftg(e,c)
return c:IsLevel(7) and c:IsSetCard(0x751)
end
function c29990310.xyzlv(e,c,rc)
if rc:IsRace(RACE_FAIRY) then
return c:GetLevel()+0x10000*e:GetLabel()
else
return c:GetLevel()
end
end
--净怜异灵的褒奖大餐
function c29990315.initial_effect(c)
--activate
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_ACTIVATE)
e0:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e0)
--recover
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(29990315,0))
e1:SetCategory(CATEGORY_RECOVER)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_BATTLE_DAMAGE)
e1:SetRange(LOCATION_SZONE+LOCATION_GRAVE)
e1:SetCondition(c29990315.atkcon)
e1:SetOperation(c29990315.regop)
c:RegisterEffect(e1)
--invincible
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_IMMUNE_EFFECT)
e2:SetRange(LOCATION_SZONE+LOCATION_GRAVE)
e2:SetTargetRange(LOCATION_ONFIELD+LOCATION_GRAVE,0)
e2:SetCondition(c29990315.indcon)
e2:SetTarget(c29990315.indtg)
e2:SetValue(c29990315.efilter)
c:RegisterEffect(e2)
end
function c29990315.cfilter(c)
return c:IsSetCard(0x751) and c:IsType(TYPE_XYZ)
end
function c29990315.atkcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c29990315.cfilter,1,nil)
end
function c29990315.regop(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_BATTLE)
e1:SetCountLimit(1)
e1:SetTarget(c29990315.rectg)
e1:SetOperation(c29990315.recop)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function c29990315.recfilter(c)
return c:IsFaceup() and c:IsSetCard(0x751) and c:IsType(TYPE_XYZ)
end
function c29990315.rectg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c29990315.recfilter,tp,LOCATION_MZONE,0,1,nil) end
local g=Duel.GetMatchingGroup(c29990315.recfilter,tp,LOCATION_MZONE,0,nil)
local rec=g:GetClassCount(Card.GetCode)*300
Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,rec)
end
function c29990315.recop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c29990315.recfilter,tp,LOCATION_MZONE,0,nil)
local rec=g:GetClassCount(Card.GetCode)*300
Duel.Recover(tp,rec,REASON_EFFECT)
end
function c29990315.indcon(e)
return Duel.GetCurrentPhase()==PHASE_MAIN2 and Duel.GetLP(e:GetHandlerPlayer())>=15000
end
function c29990315.indtg(e,c)
return c:IsSetCard(0x751)
end
function c29990315.efilter(e,te)
return te:GetOwnerPlayer()~=e:GetHandlerPlayer()
end
\ No newline at end of file
--净怜异灵相濡一瞬
function c29990350.initial_effect(c)
aux.AddCodeList(c,29990300,29990040,29990140,29990440)
--change name
aux.EnableChangeCode(c,29990300,LOCATION_HAND+LOCATION_DECK+LOCATION_ONFIELD+LOCATION_GRAVE+LOCATION_REMOVED)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(29990350,1))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_HANDES)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,29990350+EFFECT_COUNT_CODE_OATH)
e1:SetCondition(c29990350.con)
e1:SetCost(c29990350.cost)
e1:SetTarget(c29990350.sptg)
e1:SetOperation(c29990350.activate)
c:RegisterEffect(e1)
--copy
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_HANDES)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_TO_GRAVE)
e2:SetCountLimit(1,29990351+EFFECT_COUNT_CODE_OATH)
e2:SetCondition(c29990350.cpcon)
e2:SetTarget(c29990350.sptg)
e2:SetOperation(c29990350.activate)
c:RegisterEffect(e2)
end
function c29990350.con(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()~=tp
and (Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2)
end
function c29990350.cfilter1(c,e,tp)
return ((c:IsType(TYPE_XYZ) and c:IsSetCard(0x751))
or ((c:IsRank(2) or c:IsRank(7)) and c:IsType(TYPE_XYZ) and c:IsRace(RACE_FAIRY))) and c:IsType(TYPE_MONSTER) and c:IsAbleToExtraAsCost()
and Duel.IsExistingMatchingCard(c29990350.cfilter2,tp,LOCATION_MZONE,0,1,c,e,tp,c)
end
function c29990350.cfilter2(c,e,tp,tc)
if c:IsCode(tc:GetCode()) then return false end
local sg=Group.FromCards(tc,c)
local g=Duel.GetMatchingGroup(c29990350.spfilter1,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,sg,e,tp)
return ((c:IsType(TYPE_XYZ) and c:IsSetCard(0x751))
or ((c:IsRank(2) or c:IsRank(7)) and c:IsType(TYPE_XYZ) and c:IsRace(RACE_FAIRY))) and c:IsType(TYPE_MONSTER) and c:IsAbleToExtraAsCost() and g:GetClassCount(Card.GetCode)>1
end
function c29990350.spfilter1(c,e,tp)
return c:IsLevelBelow(2) and c:IsRace(RACE_FAIRY) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c29990350.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c29990350.cfilter1,tp,LOCATION_MZONE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g1=Duel.SelectMatchingCard(tp,c29990350.cfilter1,tp,LOCATION_MZONE,0,1,1,nil,e,tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g2=Duel.SelectMatchingCard(tp,c29990350.cfilter2,tp,LOCATION_MZONE,0,1,1,g1:GetFirst(),e,tp,g1:GetFirst())
g1:Merge(g2)
Duel.SendtoDeck(g1,nil,SEQ_DECKSHUFFLE,REASON_COST)
end
function c29990350.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(c29990350.spfilter1,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,nil,e,tp)
local h1=Duel.GetFieldGroupCount(tp,LOCATION_HAND,0)
if e:GetHandler():IsLocation(LOCATION_HAND) then h1=h1-1 end
if chk==0 then return not Duel.IsPlayerAffectedByEffect(tp,59822133)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>1 and g:GetClassCount(Card.GetCode)>1
and h1>0
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,2,tp,LOCATION_GRAVE+LOCATION_REMOVED)
Duel.SetOperationInfo(0,CATEGORY_HANDES,nil,0,tp,1)
end
function c29990350.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.DiscardHand(tp,nil,1,1,REASON_EFFECT+REASON_DISCARD)==0 then return end
if Duel.IsPlayerAffectedByEffect(tp,59822133) or Duel.GetLocationCount(tp,LOCATION_MZONE)<=1 then return end
local g=Duel.GetMatchingGroup(aux.NecroValleyFilter(c29990350.spfilter1),tp,LOCATION_GRAVE+LOCATION_REMOVED,0,nil,e,tp)
if g:GetClassCount(Card.GetCode)>1 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg1=g:SelectSubGroup(tp,aux.dncheck,false,2,2)
Duel.SpecialSummon(sg1,0,tp,tp,false,false,POS_FACEUP)
end
end
function c29990350.cpfilter(c)
return c:IsCode(29990040,29990140,29990440)
end
function c29990350.cpcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return re and re:GetHandler():IsType(TYPE_QUICKPLAY) and c:IsReason(REASON_EFFECT) and c:IsPreviousLocation(LOCATION_HAND)
and Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>=2
and Duel.IsExistingMatchingCard(c29990350.cpfilter,c:GetControler(),LOCATION_ONFIELD+LOCATION_GRAVE,0,1,nil)
end
\ No newline at end of file
--净怜异灵破涕一瞬
function c29990360.initial_effect(c)
aux.AddCodeList(c,29990300,29990050,29990150,29990450)
--change name
aux.EnableChangeCode(c,29990300,LOCATION_HAND+LOCATION_DECK+LOCATION_ONFIELD+LOCATION_GRAVE+LOCATION_REMOVED)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_HANDES)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,29990360+EFFECT_COUNT_CODE_OATH)
e1:SetCost(c29990360.cost)
e1:SetCondition(c29990360.con)
e1:SetTarget(c29990360.tg)
e1:SetOperation(c29990360.activate)
c:RegisterEffect(e1)
--copy
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_HANDES)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_TO_GRAVE)
e2:SetCountLimit(1,29990361+EFFECT_COUNT_CODE_OATH)
e2:SetCondition(c29990360.cpcon)
e2:SetTarget(c29990360.tg)
e2:SetOperation(c29990360.activate)
c:RegisterEffect(e2)
end
function c29990360.cfilter(c)
return c:IsFaceup() and ((c:IsType(TYPE_XYZ) and c:IsSetCard(0x751))
or ((c:IsRank(2) or c:IsRank(7))
and c:IsType(TYPE_XYZ) and c:IsRace(RACE_FAIRY)))
end
function c29990360.con(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()~=tp
and (Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2)
and Duel.IsExistingMatchingCard(c29990360.cfilter,tp,LOCATION_ONFIELD,0,1,nil)
end
function c29990360.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local ct=Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)
if chk==0 then return Duel.CheckLPCost(tp,ct*300) end
Duel.PayLPCost(tp,ct*700)
end
function c29990360.tg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local h1=Duel.GetFieldGroupCount(tp,LOCATION_HAND,0)
if e:GetHandler():IsLocation(LOCATION_HAND) then h1=h1-1 end
if chk==0 then return h1>0
end
Duel.SetOperationInfo(0,CATEGORY_HANDES,nil,0,tp,1)
end
function c29990360.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.DiscardHand(tp,nil,1,1,REASON_EFFECT+REASON_DISCARD)==0 then return end
local c=e:GetHandler()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e1:SetTargetRange(LOCATION_MZONE,0)
e1:SetTarget(c29990360.indestg)
e1:SetValue(1)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetCode(EFFECT_CANNOT_REMOVE)
e2:SetTarget(c29990360.efilter)
e2:SetTargetRange(1,1)
e2:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e2,tp)
end
function c29990360.indestg(e,c)
return c:IsFaceup() and
((((c:IsType(TYPE_XYZ) and c:IsSetCard(0x751))
or ((c:IsRank(2) or c:IsRank(7)) and c:IsType(TYPE_XYZ) and c:IsRace(RACE_FAIRY))))
or c:IsType(TYPE_SPELL+TYPE_TRAP))
end
function c29990360.efilter(e,c,rp,r,re)
local tp=e:GetHandlerPlayer()
return c:IsControler(tp) and c:IsOnField() and
((c:IsLocation(LOCATION_MZONE) and ((c:IsType(TYPE_XYZ) and c:IsSetCard(0x751))
or ((c:IsRank(2) or c:IsRank(7)) and c:IsType(TYPE_XYZ) and c:IsRace(RACE_FAIRY))) and c:IsFaceup())
or c:IsType(TYPE_SPELL+TYPE_TRAP))
and r&REASON_EFFECT~=0 and re:GetOwnerPlayer()~=tp
end
function c29990360.cpfilter(c)
return c:IsCode(29990050,29990150,29990450)
end
function c29990360.cpcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return re and re:GetHandler():IsType(TYPE_QUICKPLAY) and c:IsReason(REASON_EFFECT) and c:IsPreviousLocation(LOCATION_HAND)
and Duel.IsExistingMatchingCard(c29990360.cpfilter,c:GetControler(),LOCATION_ONFIELD+LOCATION_GRAVE,0,1,nil)
end
\ No newline at end of file
--被阻断的净怜异灵的回忆
function c29990370.initial_effect(c)
--Activate
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_ACTIVATE)
e0:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e0)
--confirm deck
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(29990370,0))
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_PREDRAW)
e1:SetRange(LOCATION_SZONE)
e1:SetCondition(c29990370.con)
e1:SetCost(c29990370.cost)
e1:SetOperation(c29990370.cfop)
c:RegisterEffect(e1)
end
function c29990370.mfilter(c)
return c:IsType(TYPE_QUICKPLAY)
end
function c29990370.ffilter(c)
return c:IsType(TYPE_XYZ) and (c:IsSetCard(0x751) or c:IsRace(RACE_FAIRY)) and c:GetOverlayGroup():IsExists(c29990370.mfilter,1,nil)
end
function c29990370.con(e,tp,eg,ep,ev,re,r,rp)
return (tp~=Duel.GetTurnPlayer() or Duel.GetTurnPlayer()==tp)
and Duel.IsExistingMatchingCard(c29990370.ffilter,tp,LOCATION_MZONE,0,1,nil)
and e:GetHandler():IsStatus(STATUS_EFFECT_ENABLED)
end
function c29990370.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckRemoveOverlayCard(tp,1,0,3,REASON_COST) end
Duel.RemoveOverlayCard(tp,1,0,3,3,REASON_COST)
end
function c29990370.cfop(e,tp,eg,ep,ev,re,r,rp)
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(c29990370.filter)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_CANNOT_ACTIVATE)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetTargetRange(1,0)
e2:SetCondition(c29990370.accon)
e2:SetValue(c29990370.aclimit)
e2:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e2,tp)
end
function c29990370.accon(e)
local ph=Duel.GetCurrentPhase()
return ph>=PHASE_BATTLE_START and ph<=PHASE_BATTLE
end
function c29990370.aclimit(e,re,tp)
return re:IsActiveType(TYPE_MONSTER) and (re:GetHandler():IsRace(RACE_FAIRY) or re:GetHandler():IsSetCard(0x751))
end
function c29990370.filter(e,re,tp)
return re:IsHasCategory(CATEGORY_CONTROL) or re:IsHasCategory(CATEGORY_DESTROY)
end
\ No newline at end of file
--守护净怜异灵的真意
function c29990380.initial_effect(c)
aux.AddCodeList(c,29990300)
--remove
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(29990380,0))
e1:SetCategory(CATEGORY_REMOVE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,29990380+EFFECT_COUNT_CODE_OATH)
e1:SetCondition(c29990380.condition)
e1:SetCost(c29990380.rmcost)
e1:SetTarget(c29990380.rmtg)
e1:SetOperation(c29990380.rmop)
c:RegisterEffect(e1)
--salvage
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(29990380,1))
e2:SetCategory(CATEGORY_TODECK)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_GRAVE)
e2:SetCost(c29990380.cost2)
e2:SetTarget(c29990380.target2)
e2:SetOperation(c29990380.operation2)
c:RegisterEffect(e2)
end
function c29990380.condition(e,tp,eg,ep,ev,re,r,rp)
local ph=Duel.GetCurrentPhase()
return ph>=PHASE_BATTLE_START and ph<=PHASE_BATTLE
end
function c29990380.cfilter(c)
return c:IsAbleToRemoveAsCost() and c:IsCode(29990300)
end
function c29990380.rmcost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.IsExistingMatchingCard(c29990380.cfilter,tp,LOCATION_HAND,0,1,c) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local sg=Duel.SelectMatchingCard(tp,c29990380.cfilter,tp,LOCATION_HAND,0,1,1,c)
Duel.Remove(sg,POS_FACEUP,REASON_COST)
end
function c29990380.filter(c)
return c:IsFaceup() and c:IsSetCard(0x751) and c:IsType(TYPE_XYZ)
end
function c29990380.rmfilter(c)
return c:IsType(TYPE_MONSTER) and c:IsAbleToRemove()
end
function c29990380.rmtg(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(c29990380.filter,tp,LOCATION_MZONE,0,nil)
if chk==0 then return g:GetCount()~=0
and Duel.IsExistingMatchingCard(c29990380.rmfilter,tp,0,LOCATION_GRAVE,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,1-tp,LOCATION_GRAVE)
end
function c29990380.rmop(e,tp,eg,ep,ev,re,r,rp)
local cg=Duel.GetMatchingGroup(c29990380.filter,tp,LOCATION_MZONE,0,nil)
local ct=cg:GetClassCount(Card.GetCode)
if ct==0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,c29990380.rmfilter,tp,0,LOCATION_GRAVE,1,ct,nil)
if g:GetCount()>0 then
Duel.Remove(g,POS_FACEUP,REASON_EFFECT)
end
end
function c29990380.cfilter2(c)
return c:IsCode(29990300) and c:IsAbleToRemoveAsCost()
end
function c29990380.cost2(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return e:GetHandler():IsAbleToRemoveAsCost()
and Duel.IsExistingMatchingCard(c29990380.cfilter2,tp,LOCATION_HAND+LOCATION_ONFIELD+LOCATION_GRAVE,0,3,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,c29990380.cfilter2,tp,LOCATION_HAND+LOCATION_ONFIELD+LOCATION_GRAVE,0,3,3,e:GetHandler())
g:AddCard(c)
Duel.Remove(g,POS_FACEUP,REASON_COST)
end
function c29990380.tdfilter(c)
return c:IsType(TYPE_MONSTER)
and ((c:IsSetCard(0x751))
or ((c:IsRank(2) or c:IsRank(7)) and c:IsType(TYPE_XYZ) and c:IsRace(RACE_FAIRY))
or (c:IsAttribute(ATTRIBUTE_DARK) or c:IsAttribute(ATTRIBUTE_LIGHT))
and c:IsAttack(100) and c:IsDefense(100) and c:IsLevel(1))
and c:IsAbleToDeck()
end
function c29990380.target2(e,tp,eg,ep,ev,re,r,rp,chk)
if chkc then return chkc:IsLocation(LOCATION_GRAVE+LOCATION_REMOVED) and chkc:IsControler(tp) and c29990380.tdfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c29990380.tdfilter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,6,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectTarget(tp,aux.NecroValleyFilter(c29990380.tdfilter),tp,LOCATION_GRAVE+LOCATION_REMOVED,0,6,6,nil)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,g:GetCount(),0,0)
end
function c29990380.operation2(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(Card.IsRelateToEffect,nil,e)
if #g>0 then
Duel.SendtoDeck(g,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)
end
end
--净怜异灵·Holy Knight
function c29990400.initial_effect(c)
aux.AddCodeList(c,29990000,29990300)
--xyz summon
aux.AddXyzProcedure(c,nil,7,2,nil,nil,99)
c:EnableReviveLimit()
--voice
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e0:SetCode(EVENT_SPSUMMON_SUCCESS)
e0:SetOperation(c29990400.sumsuc)
c:RegisterEffect(e0)
local e31=Effect.CreateEffect(c)
e31:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_SINGLE)
e31:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e31:SetCode(EVENT_LEAVE_FIELD)
e31:SetCondition(c29990400.leavecon1)
e31:SetOperation(c29990400.leaveop1)
c:RegisterEffect(e31)
--attribute
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE+EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EFFECT_ADD_ATTRIBUTE)
e1:SetRange(LOCATION_MZONE)
e1:SetValue(ATTRIBUTE_FIRE+ATTRIBUTE_LIGHT+ATTRIBUTE_DARK)
c:RegisterEffect(e1)
--atk up
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(29990400,0))
e2:SetCategory(CATEGORY_ATKCHANGE)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetCode(EVENT_PHASE+PHASE_BATTLE_START)
e2:SetRange(LOCATION_MZONE)
e2:SetCost(c29990400.atkcost)
e2:SetTarget(c29990400.atktg)
e2:SetOperation(c29990400.atkop)
c:RegisterEffect(e2)
--protect summon
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
e3:SetRange(LOCATION_MZONE)
e3:SetCondition(c29990400.protectcon)
e3:SetOperation(c29990400.protectop)
c:RegisterEffect(e3)
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e4:SetRange(LOCATION_MZONE)
e4:SetCode(EVENT_CHAIN_END)
e4:SetOperation(c29990400.limop2)
c:RegisterEffect(e4)
end
function c29990400.sumsuc(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(24,0,aux.Stringid(29990400,14))
end
function c29990400.leavecon1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsPreviousLocation(LOCATION_MZONE)
and c:IsPreviousControler(tp) and c:GetReasonPlayer()==1-tp
end
function c29990400.leaveop1(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(24,0,aux.Stringid(29990400,15))
end
function c29990400.atkcost(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 c29990400.atkfilter(c)
return c:IsFaceup() and c:IsRank(7) and c:IsType(TYPE_XYZ) and c:IsRace(RACE_FAIRY) and not c:IsCode(29990400)
end
function c29990400.atktg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local c=e:GetHandler()
if chk==0 then return e:GetHandler():IsDefenseAbove(500)
and Duel.IsExistingTarget(c29990400.atkfilter,tp,LOCATION_MZONE,0,1,c) end
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c29990400.atkfilter(chkc) and chkc~=c end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,c29990400.atkfilter,tp,LOCATION_MZONE,0,1,1,c)
end
function c29990400.atkop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
local ct=Duel.GetOverlayGroup(tp,1,0):FilterCount(Card.IsType,nil,TYPE_QUICKPLAY)
if c:IsRelateToEffect(e) and c:IsControler(tp) and c:IsFaceup() and c:IsDefenseAbove(500)
and c:IsLocation(LOCATION_MZONE) and tc:IsRelateToEffect(e)
and tc:IsFaceup() and tc:IsLocation(LOCATION_MZONE) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EFFECT_UPDATE_DEFENSE)
e1:SetValue(-500)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_BATTLE)
c:RegisterEffect(e1)
if not c:IsHasEffect(EFFECT_REVERSE_UPDATE) then
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetValue(ct*300)
e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_BATTLE)
c:RegisterEffect(e2)
local e3=e2:Clone()
tc:RegisterEffect(e3)
end
end
end
function c29990400.protectfilter(c,tp)
return c:IsSummonPlayer(tp) and c:IsSetCard(0x751)
and c:IsSummonType(SUMMON_TYPE_XYZ)
end
function c29990400.protectcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetOverlayGroup():IsExists(c29990400.orufilter,1,nil,e)
and e:GetHandler():GetOverlayGroup():IsExists(c29990400.orufilter2,1,nil,e)
and eg:IsExists(c29990400.protectfilter,1,nil,tp)
end
function c29990400.orufilter(c,e)
return c:IsType(TYPE_QUICKPLAY) and (c:IsCode(29990300) or aux.IsCodeListed(c,29990300))
end
function c29990400.orufilter2(c,e)
return c:IsCode(29990000)
end
function c29990400.protectop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetCurrentChain()==0 then
Duel.SetChainLimitTillChainEnd(c29990400.chainlm)
elseif Duel.GetCurrentChain()==1 then
e:GetHandler():RegisterFlagEffect(29990400,RESET_EVENT+RESETS_STANDARD,0,1)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_CHAINING)
e1:SetOperation(c29990400.resetop)
Duel.RegisterEffect(e1,tp)
local e2=e1:Clone()
e2:SetCode(EVENT_BREAK_EFFECT)
e2:SetReset(RESET_CHAIN)
Duel.RegisterEffect(e2,tp)
end
end
function c29990400.resetop(e,tp,eg,ep,ev,re,r,rp)
e:GetHandler():ResetFlagEffect(29990400)
e:Reset()
end
function c29990400.limop2(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():GetFlagEffect(29990400)~=0 then
Duel.SetChainLimitTillChainEnd(c29990400.chainlm)
end
e:GetHandler():ResetFlagEffect(29990400)
end
function c29990400.chainlm(e,rp,tp)
return tp==rp
end
\ No newline at end of file
--净怜异灵·Happy Legion
function c29990410.initial_effect(c)
aux.AddCodeList(c,29990010,29990300)
--xyz summon
aux.AddXyzProcedure(c,nil,7,2,nil,nil,99)
c:EnableReviveLimit()
--voice
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e0:SetCode(EVENT_SPSUMMON_SUCCESS)
e0:SetOperation(c29990410.sumsuc)
c:RegisterEffect(e0)
local e31=Effect.CreateEffect(c)
e31:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_SINGLE)
e31:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e31:SetCode(EVENT_LEAVE_FIELD)
e31:SetCondition(c29990410.leavecon1)
e31:SetOperation(c29990410.leaveop1)
c:RegisterEffect(e31)
--attribute
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE+EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EFFECT_ADD_ATTRIBUTE)
e1:SetRange(LOCATION_MZONE)
e1:SetValue(ATTRIBUTE_FIRE+ATTRIBUTE_LIGHT+ATTRIBUTE_DARK)
c:RegisterEffect(e1)
--negate
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(29990410,0))
e2:SetCategory(CATEGORY_NEGATE+CATEGORY_DESTROY)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_CHAINING)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
e2:SetRange(LOCATION_MZONE)
e2:SetCost(c29990410.efcost)
e2:SetCondition(c29990410.discon)
e2:SetTarget(c29990410.distg)
e2:SetOperation(c29990410.disop)
c:RegisterEffect(e2)
--remove
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(29990410,1))
e3:SetCategory(CATEGORY_REMOVE)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetRange(LOCATION_MZONE)
e3:SetCost(c29990410.efcost)
e3:SetCondition(c29990410.rmcon)
e3:SetTarget(c29990410.rmtg)
e3:SetOperation(c29990410.rmop)
c:RegisterEffect(e3)
--protect summon
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD)
e4:SetCode(EFFECT_CANNOT_DISABLE_SPSUMMON)
e4:SetRange(LOCATION_MZONE)
e4:SetProperty(EFFECT_FLAG_IGNORE_RANGE+EFFECT_FLAG_SET_AVAILABLE)
e4:SetTargetRange(1,0)
e4:SetCondition(c29990410.protectcon)
e4:SetTarget(aux.TargetBoolFunction(Card.IsSetCard,0x751))
c:RegisterEffect(e4)
end
function c29990410.sumsuc(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(24,0,aux.Stringid(29990410,14))
end
function c29990410.leavecon1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsPreviousLocation(LOCATION_MZONE)
and c:IsPreviousControler(tp) and c:GetReasonPlayer()==1-tp
end
function c29990410.leaveop1(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(24,0,aux.Stringid(29990410,15))
end
function c29990410.efcost(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 c29990410.confilter(c)
return c:IsFaceup() and c:IsRank(7) and c:IsType(TYPE_XYZ) and c:IsRace(RACE_FAIRY) and not c:IsCode(29990410)
end
function c29990410.discon(e,tp,eg,ep,ev,re,r,rp)
if ep==tp or e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) then return false end
return Duel.GetCurrentPhase()>=PHASE_BATTLE_START and Duel.GetCurrentPhase()<=PHASE_BATTLE and
re:IsActiveType(TYPE_SPELL+TYPE_TRAP) and Duel.IsChainNegatable(ev) and Duel.IsExistingMatchingCard(c29990410.confilter,tp,LOCATION_MZONE,0,1,e:GetHandler())
end
function c29990410.distg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsDefenseAbove(400) end
Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0)
if re:GetHandler():IsDestructable() and re:GetHandler():IsRelateToEffect(re) then
Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,1,0,0)
end
end
function c29990410.disop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and c:IsFaceup() and c:IsDefenseAbove(400) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EFFECT_UPDATE_DEFENSE)
e1:SetValue(-400)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_BATTLE)
c:RegisterEffect(e1)
if not c:IsHasEffect(EFFECT_REVERSE_UPDATE) then
if Duel.NegateActivation(ev) and re:GetHandler():IsRelateToEffect(re) then
Duel.Destroy(eg,REASON_EFFECT)
end
end
end
end
function c29990410.rmcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase()>=PHASE_BATTLE_START and Duel.GetCurrentPhase()<=PHASE_BATTLE
and Duel.IsExistingMatchingCard(c29990410.confilter,tp,LOCATION_MZONE,0,1,e:GetHandler())
end
function c29990410.rmfilter(c)
return c:IsFaceup() and c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsAbleToRemove(tp,POS_FACEDOWN)
end
function c29990410.rmtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsDefenseAbove(400)
and Duel.IsExistingMatchingCard(c29990410.rmfilter,tp,0,LOCATION_ONFIELD,1,nil) end
local g=Duel.GetMatchingGroup(c29990410.rmfilter,tp,0,LOCATION_ONFIELD,nil)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,1,0,0)
end
function c29990410.rmop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and c:IsFaceup() and c:IsDefenseAbove(400) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EFFECT_UPDATE_DEFENSE)
e1:SetValue(-400)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_BATTLE)
c:RegisterEffect(e1)
if not c:IsHasEffect(EFFECT_REVERSE_UPDATE) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,c29990410.rmfilter,tp,0,LOCATION_ONFIELD,1,1,nil)
if g:GetCount()>0 then
Duel.HintSelection(g)
Duel.Remove(g,POS_FACEDOWN,REASON_EFFECT)
end
end
end
end
function c29990410.protectcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetOverlayGroup():IsExists(c29990410.orufilter,1,nil,e)
and e:GetHandler():GetOverlayGroup():IsExists(c29990410.orufilter2,1,nil,e)
end
function c29990410.orufilter(c,e)
return c:IsType(TYPE_QUICKPLAY) and (c:IsCode(29990300) or aux.IsCodeListed(c,29990300))
end
function c29990410.orufilter2(c,e)
return c:IsCode(29990010)
end
\ No newline at end of file
--净怜异灵·山脇大人的手下:魔法喵喵
function c29990420.initial_effect(c)
aux.AddCodeList(c,29990020,29990300)
--xyz summon
aux.AddXyzProcedure(c,nil,7,2)
c:EnableReviveLimit()
--voice
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e0:SetCode(EVENT_SPSUMMON_SUCCESS)
e0:SetOperation(c29990420.sumsuc)
c:RegisterEffect(e0)
local e31=Effect.CreateEffect(c)
e31:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_SINGLE)
e31:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e31:SetCode(EVENT_LEAVE_FIELD)
e31:SetCondition(c29990420.leavecon1)
e31:SetOperation(c29990420.leaveop1)
c:RegisterEffect(e31)
--attribute
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE+EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EFFECT_ADD_ATTRIBUTE)
e1:SetRange(LOCATION_MZONE)
e1:SetValue(ATTRIBUTE_FIRE+ATTRIBUTE_LIGHT+ATTRIBUTE_DARK)
c:RegisterEffect(e1)
--negate
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(29990420,0))
e2:SetCategory(CATEGORY_DISABLE)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_ATTACK_ANNOUNCE)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,29990420)
e2:SetCost(c29990420.efcost)
e2:SetCondition(c29990420.discon)
e2:SetTarget(c29990420.distg)
e2:SetOperation(c29990420.disop)
c:RegisterEffect(e2)
--def down
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(29990420,1))
e3:SetCategory(CATEGORY_DEFCHANGE)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_ATTACK_ANNOUNCE)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1,29990421)
e3:SetCost(c29990420.efcost)
e3:SetCondition(c29990420.defcon)
e3:SetTarget(c29990420.deftg)
e3:SetOperation(c29990420.defop)
c:RegisterEffect(e3)
--recover
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e4:SetCategory(CATEGORY_RECOVER)
e4:SetCode(EVENT_CHAINING)
e4:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e4:SetRange(LOCATION_MZONE)
e4:SetOperation(aux.chainreg)
c:RegisterEffect(e4)
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e5:SetCode(EVENT_CHAIN_SOLVED)
e5:SetRange(LOCATION_MZONE)
e5:SetCondition(c29990420.lifecon)
e5:SetOperation(c29990420.recop)
c:RegisterEffect(e5)
end
function c29990420.sumsuc(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(24,0,aux.Stringid(29990420,14))
end
function c29990420.leavecon1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsPreviousLocation(LOCATION_MZONE)
and c:IsPreviousControler(tp) and c:GetReasonPlayer()==1-tp
end
function c29990420.leaveop1(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(24,0,aux.Stringid(29990420,15))
end
function c29990420.efcost(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 c29990420.confilter(c)
return c:IsFaceup() and c:IsRank(7) and c:IsType(TYPE_XYZ) and c:IsRace(RACE_FAIRY) and not c:IsCode(29990420)
end
function c29990420.discon(e,tp,eg,ep,ev,re,r,rp)
local at=Duel.GetAttacker()
return at and at:IsControler(tp)
and Duel.IsExistingMatchingCard(c29990420.confilter,tp,LOCATION_MZONE,0,1,e:GetHandler())
end
function c29990420.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 c29990420.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.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+RESET_PHASE+PHASE_BATTLE)
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+RESET_PHASE+PHASE_BATTLE)
tc:RegisterEffect(e2)
end
end
function c29990420.defcon(e,tp,eg,ep,ev,re,r,rp)
local at=Duel.GetAttacker()
return at and at:IsControler(tp)
and Duel.IsExistingMatchingCard(c29990420.confilter,tp,LOCATION_MZONE,0,1,e:GetHandler())
end
function c29990420.deftg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsFaceup,tp,0,LOCATION_MZONE,1,nil)
and Duel.GetFlagEffect(tp,29990420)==0 end
Duel.RegisterFlagEffect(tp,29990420,RESET_CHAIN,0,1)
end
function c29990420.defop(e,tp,eg,ep,ev,re,r,rp)
local count = function(c)
return c:IsFaceup() and c:IsRank(7) and c:IsRace(RACE_FAIRY) and c:GetOverlayCount()>0 end;
local og=Duel.GetMatchingGroup(count,tp,LOCATION_MZONE,0,nil)
local ct=0
if #og>0 then
for tc in aux.Next(og) do
ct=ct+tc:GetOverlayCount()
end
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local tc=Duel.SelectMatchingCard(tp,Card.IsFaceup,tp,0,LOCATION_MZONE,1,1,nil):GetFirst()
if not tc then return end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_DEFENSE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetValue(ct*-300)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_BATTLE)
tc:RegisterEffect(e1)
end
function c29990420.lifecon(e,tp,eg,ep,ev,re,r,rp)
return re and re:IsActiveType(TYPE_XYZ) and re:GetHandler():IsSetCard(0x751)
and rp==tp and e:GetHandler():GetFlagEffect(1)>0
and e:GetHandler():GetOverlayGroup():IsExists(c29990420.orufilter,1,nil,e)
and e:GetHandler():GetOverlayGroup():IsExists(c29990420.orufilter2,1,nil,e)
end
function c29990420.orufilter(c,e)
return c:IsType(TYPE_QUICKPLAY) and (c:IsCode(29990300) or aux.IsCodeListed(c,29990300))
end
function c29990420.orufilter2(c,e)
return c:IsCode(29990020)
end
function c29990420.recop(e,tp,eg,ep,ev,re,r,rp)
Duel.Recover(tp,300,REASON_EFFECT)
end
\ No newline at end of file
--净怜异灵·对决!!空气舞台
function c29990430.initial_effect(c)
aux.AddCodeList(c,29990030,29990300)
--xyz summon
aux.AddXyzProcedure(c,nil,7,2)
c:EnableReviveLimit()
--voice
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e0:SetCode(EVENT_SPSUMMON_SUCCESS)
e0:SetOperation(c29990430.sumsuc)
c:RegisterEffect(e0)
local e31=Effect.CreateEffect(c)
e31:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_SINGLE)
e31:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e31:SetCode(EVENT_LEAVE_FIELD)
e31:SetCondition(c29990430.leavecon1)
e31:SetOperation(c29990430.leaveop1)
c:RegisterEffect(e31)
--attribute
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE+EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EFFECT_ADD_ATTRIBUTE)
e1:SetRange(LOCATION_MZONE)
e1:SetValue(ATTRIBUTE_FIRE+ATTRIBUTE_LIGHT+ATTRIBUTE_DARK)
c:RegisterEffect(e1)
--pierce
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(29990430,0))
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_ATTACK_ANNOUNCE)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,29990430)
e2:SetCost(c29990430.cost)
e2:SetCondition(c29990430.con)
e2:SetTarget(c29990430.pietg)
e2:SetOperation(c29990430.pieop)
c:RegisterEffect(e2)
--recover
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e3:SetCategory(CATEGORY_RECOVER)
e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e3:SetRange(LOCATION_MZONE)
e3:SetCode(EVENT_BATTLE_DAMAGE)
e3:SetCondition(c29990430.lifecon)
e3:SetTarget(c29990430.rectg)
e3:SetOperation(c29990430.recop)
c:RegisterEffect(e3)
end
function c29990430.sumsuc(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(24,0,aux.Stringid(29990430,14))
end
function c29990430.leavecon1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsPreviousLocation(LOCATION_MZONE)
and c:IsPreviousControler(tp) and c:GetReasonPlayer()==1-tp
end
function c29990430.leaveop1(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(24,0,aux.Stringid(29990430,15))
end
function c29990430.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 c29990430.con(e,tp,eg,ep,ev,re,r,rp)
local at=Duel.GetAttacker()
return at and at:IsControler(tp)
end
function c29990430.confilter(c)
return c:IsFaceup() and c:IsRank(7) and c:IsType(TYPE_XYZ) and c:IsRace(RACE_FAIRY) and not c:IsCode(29990430)
end
function c29990430.pietg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c29990430.confilter(chkc) and chkc~=c end
if chk==0 then return Duel.IsExistingTarget(c29990430.confilter,tp,LOCATION_MZONE,0,1,c) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,c29990430.confilter,tp,LOCATION_MZONE,0,1,1,c)
end
function c29990430.pieop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if c:IsRelateToEffect(e) and c:IsControler(tp) and c:IsFaceup()
and c:IsLocation(LOCATION_MZONE) and tc:IsRelateToEffect(e)
and tc:IsFaceup() and tc:IsLocation(LOCATION_MZONE) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EFFECT_PIERCE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_BATTLE)
c:RegisterEffect(e1)
local e2=e1:Clone()
tc:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e3:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e3:SetRange(LOCATION_MZONE)
e3:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e3:SetTarget(c29990430.indtg)
e3:SetValue(DOUBLE_DAMAGE)
e3:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_BATTLE)
c:RegisterEffect(e3)
local e4=e3:Clone()
tc:RegisterEffect(e4)
end
end
function c29990430.indtg(e,c)
local tc=e:GetHandler()
return c==tc or c==tc:GetBattleTarget()
end
function c29990430.lifecon(e,tp,eg,ep,ev,re,r,rp)
return ep~=tp and eg:GetFirst():IsControler(tp) and eg:GetFirst():IsSetCard(0x751)
and e:GetHandler():GetOverlayGroup():IsExists(c29990430.orufilter,1,nil,e)
and e:GetHandler():GetOverlayGroup():IsExists(c29990430.orufilter2,1,nil,e)
end
function c29990430.orufilter(c,e)
return c:IsType(TYPE_QUICKPLAY) and (c:IsCode(29990300) or aux.IsCodeListed(c,29990300))
end
function c29990430.orufilter2(c,e)
return c:IsCode(29990030)
end
function c29990430.rectg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(ev)
Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,ev)
end
function c29990430.recop(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Recover(p,d,REASON_EFFECT)
end
\ No newline at end of file
--净怜异灵·雪花的Hexerei
function c29990440.initial_effect(c)
aux.AddCodeList(c,29990040,29990300)
--xyz summon
aux.AddXyzProcedure(c,nil,7,2)
c:EnableReviveLimit()
--voice
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e0:SetCode(EVENT_SPSUMMON_SUCCESS)
e0:SetOperation(c29990440.sumsuc)
c:RegisterEffect(e0)
local e31=Effect.CreateEffect(c)
e31:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_SINGLE)
e31:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e31:SetCode(EVENT_LEAVE_FIELD)
e31:SetCondition(c29990440.leavecon1)
e31:SetOperation(c29990440.leaveop1)
c:RegisterEffect(e31)
--attribute
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE+EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EFFECT_ADD_ATTRIBUTE)
e1:SetRange(LOCATION_MZONE)
e1:SetValue(ATTRIBUTE_FIRE+ATTRIBUTE_LIGHT+ATTRIBUTE_DARK)
c:RegisterEffect(e1)
--lock
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(29990440,0))
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_ATTACK_ANNOUNCE)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,29990440)
e2:SetCost(c29990440.efcost)
e2:SetCondition(c29990440.lockcon)
e2:SetOperation(c29990440.lockop)
c:RegisterEffect(e2)
--token
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(29990440,1))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOKEN)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_ATTACK_ANNOUNCE)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1,29990441)
e3:SetCost(c29990440.efcost)
e3:SetCondition(c29990440.tokencon)
e3:SetTarget(c29990440.tktg)
e3:SetOperation(c29990440.tkop)
c:RegisterEffect(e3)
local e7=e3:Clone()
e7:SetDescription(aux.Stringid(29990440,2))
e7:SetTarget(c29990440.tktg1)
e7:SetOperation(c29990440.tkop1)
c:RegisterEffect(e7)
local e8=e3:Clone()
e8:SetDescription(aux.Stringid(29990440,3))
e8:SetTarget(c29990440.tktg2)
e8:SetOperation(c29990440.tkop2)
c:RegisterEffect(e8)
local e9=e3:Clone()
e9:SetDescription(aux.Stringid(29990440,4))
e9:SetTarget(c29990440.tktg3)
e9:SetOperation(c29990440.tkop3)
c:RegisterEffect(e9)
--protect effect
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e4:SetCode(EVENT_CHAINING)
e4:SetRange(LOCATION_MZONE)
e4:SetCondition(c29990440.ngchaincon)
e4:SetOperation(c29990440.chainop)
c:RegisterEffect(e4)
end
function c29990440.sumsuc(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(24,0,aux.Stringid(29990440,14))
end
function c29990440.leavecon1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsPreviousLocation(LOCATION_MZONE)
and c:IsPreviousControler(tp) and c:GetReasonPlayer()==1-tp
end
function c29990440.leaveop1(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(24,0,aux.Stringid(29990440,15))
end
function c29990440.efcost(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 c29990440.confilter(c)
return c:IsFaceup() and c:IsRank(7) and c:IsType(TYPE_XYZ) and c:IsRace(RACE_FAIRY) and not c:IsCode(29990440)
end
function c29990440.lockcon(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetAttacker()
return tc:IsControler(1-tp) and tc:IsRelateToBattle()
and Duel.IsExistingMatchingCard(c29990440.confilter,tp,LOCATION_MZONE,0,1,e:GetHandler())
end
function c29990440.lockop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local tc=Duel.GetAttacker()
if tc:IsFaceup() and tc:IsRelateToBattle() then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_TRIGGER)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_BATTLE)
tc:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_CANNOT_ATTACK_ANNOUNCE)
e2:SetCondition(c29990440.btcon)
tc:RegisterEffect(e2)
end
end
function c29990440.btcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetAttackedCount()>0
end
function c29990440.tokencon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetAttacker():IsControler(1-tp)
and Duel.IsExistingMatchingCard(c29990440.confilter,tp,LOCATION_MZONE,0,1,nil)
end
function c29990440.tktg(e,tp,eg,ep,ev,re,r,rp,chk)
if chkc then return chkc:IsOnField() and c29990440.filter(chkc) end
if chk==0 then
local c=e:GetHandler()
return Duel.GetLocationCount(tp,LOCATION_MZONE)>=2
and not Duel.IsPlayerAffectedByEffect(tp,59822133)
and Duel.IsPlayerCanSpecialSummonMonster(tp,29990540,0,TYPES_TOKEN_MONSTER,c:GetAttack(),c:GetDefense(),c:GetLevel(),c:GetRace(),c:GetAttribute()) end
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(29990440,0))
e:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOKEN)
e:SetProperty(0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,2,0,0)
Duel.SetOperationInfo(0,CATEGORY_TOKEN,nil,2,0,0)
end
function c29990440.tkop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local atk=c:GetAttack()
local def=c:GetDefense()
local lv=c:GetRank()
local race=c:GetRace()
local att=c:GetAttribute()
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=1 or not c:IsRelateToEffect(e) or c:IsFacedown()
or Duel.IsPlayerAffectedByEffect(tp,59822133)
or not Duel.IsPlayerCanSpecialSummonMonster(tp,29990540,0,TYPES_TOKEN_MONSTER,atk,def,lv,race,att) then return end
for i=1,2 do
local token=Duel.CreateToken(tp,29990540)
c:CreateRelation(token,RESET_EVENT+RESETS_STANDARD)
Duel.SpecialSummonStep(token,0,tp,tp,false,false,POS_FACEUP)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK_FINAL)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE,EFFECT_FLAG2_OPTION)
e1:SetRange(LOCATION_MZONE)
e1:SetValue(c29990440.tokenatk)
e1:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TOFIELD)
token:RegisterEffect(e1,true)
local e2=e1:Clone()
e2:SetCode(EFFECT_SET_DEFENSE_FINAL)
e2:SetValue(c29990440.tokendef)
token:RegisterEffect(e2,true)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_CHANGE_LEVEL)
e3:SetValue(c29990440.tokenlv)
e3:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TOFIELD)
token:RegisterEffect(e3,true)
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetCode(EFFECT_CHANGE_RACE)
e4:SetValue(c29990440.tokenrace)
e4:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TOFIELD)
token:RegisterEffect(e4,true)
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_SINGLE)
e5:SetCode(EFFECT_CHANGE_ATTRIBUTE)
e5:SetValue(c29990440.tokenatt)
e5:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TOFIELD)
token:RegisterEffect(e5,true)
local e6=Effect.CreateEffect(c)
e6:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e6:SetCode(EVENT_ADJUST)
e6:SetRange(LOCATION_MZONE)
e6:SetCondition(c29990440.tokendescon)
e6:SetOperation(c29990440.tokendesop)
e6:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TOFIELD)
token:RegisterEffect(e6,true)
local e7=Effect.CreateEffect(c)
e7:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e7:SetCode(EVENT_PHASE+PHASE_BATTLE)
e7:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE+EFFECT_CANNOT_DISABLE)
e7:SetRange(LOCATION_MZONE)
e7:SetOperation(c29990440.tokendesop2)
e7:SetReset(RESET_EVENT+RESETS_STANDARD)
token:RegisterEffect(e7,true)
local e8=Effect.CreateEffect(c)
e8:SetType(EFFECT_TYPE_SINGLE)
e8:SetCode(EFFECT_IMMUNE_EFFECT)
e8:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e8:SetRange(LOCATION_MZONE)
e8:SetValue(c29990440.tokenefilter)
token:RegisterEffect(e8,true)
local e9=Effect.CreateEffect(c)
e9:SetType(EFFECT_TYPE_SINGLE)
e9:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e9:SetCode(EFFECT_CANNOT_BE_LINK_MATERIAL)
e9:SetRange(LOCATION_MZONE)
e9:SetValue(1)
token:RegisterEffect(e9,true)
local e10=e9:Clone()
e10:SetCode(EFFECT_CANNOT_BE_FUSION_MATERIAL)
e10:SetValue(c29990440.tokenfuslimit)
token:RegisterEffect(e10,true)
local e11=e9:Clone()
e11:SetCode(EFFECT_CANNOT_BE_SYNCHRO_MATERIAL)
token:RegisterEffect(e11,true)
local e12=e9:Clone()
e12:SetCode(EFFECT_CANNOT_BE_XYZ_MATERIAL)
token:RegisterEffect(e12,true)
local e13=e9:Clone()
e13:SetCode(EFFECT_UNRELEASABLE_SUM)
token:RegisterEffect(e13,true)
local e14=e9:Clone()
e14:SetCode(EFFECT_UNRELEASABLE_NONSUM)
token:RegisterEffect(e14,true)
end
Duel.SpecialSummonComplete()
end
function c29990440.tokenatk(e,c)
return e:GetOwner():GetAttack()
end
function c29990440.tokendef(e,c)
return e:GetOwner():GetDefense()
end
function c29990440.tokenlv(e,c)
return e:GetOwner():GetRank()
end
function c29990440.tokenrace(e,c)
return e:GetOwner():GetRace()
end
function c29990440.tokenatt(e,c)
return e:GetOwner():GetAttribute()
end
function c29990440.tokendescon(e,tp,eg,ep,ev,re,r,rp)
return not e:GetOwner():IsRelateToCard(e:GetHandler())
end
function c29990440.tokendesop(e,tp,eg,ep,ev,re,r,rp)
Duel.Destroy(e:GetHandler(),REASON_RULE)
end
function c29990440.tokendesop2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
Duel.Destroy(c,REASON_RULE)
e:Reset()
end
function c29990440.tokenefilter(e,re)
return e:GetHandlerPlayer()~=re:GetOwnerPlayer()
end
function c29990440.tokenfuslimit(e,c,sumtype)
return sumtype==SUMMON_TYPE_FUSION
end
function c29990440.ngchaincon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetOverlayGroup():IsExists(c29990440.orufilter,1,nil,e)
and e:GetHandler():GetOverlayGroup():IsExists(c29990440.orufilter2,1,nil,e)
end
function c29990440.orufilter(c,e)
return c:IsType(TYPE_QUICKPLAY) and (c:IsCode(29990300) or aux.IsCodeListed(c,29990300))
end
function c29990440.orufilter2(c,e)
return c:IsCode(29990040)
end
function c29990440.chainop(e,tp,eg,ep,ev,re,r,rp)
if re:GetHandler():IsSetCard(0x751) and re:IsActiveType(TYPE_XYZ) and ep==tp then
Duel.SetChainLimit(c29990440.chainlm)
end
end
function c29990440.chainlm(re,rp,tp)
return tp==rp and re:GetActivateLocation()==LOCATION_HAND and re:IsActiveType(TYPE_MONSTER)
end
function c29990440.tktg1(e,tp,eg,ep,ev,re,r,rp,chk)
if chkc then return chkc:IsOnField() and c29990440.filter(chkc) end
if chk==0 then
local c=e:GetHandler()
return Duel.GetLocationCount(tp,LOCATION_MZONE)>=2
and not Duel.IsPlayerAffectedByEffect(tp,59822133)
and Duel.IsPlayerCanSpecialSummonMonster(tp,29990541,0,TYPES_TOKEN_MONSTER,c:GetAttack(),c:GetDefense(),c:GetLevel(),c:GetRace(),c:GetAttribute()) end
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(29990440,0))
e:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOKEN)
e:SetProperty(0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,2,0,0)
Duel.SetOperationInfo(0,CATEGORY_TOKEN,nil,2,0,0)
end
function c29990440.tkop1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local atk=c:GetAttack()
local def=c:GetDefense()
local lv=c:GetRank()
local race=c:GetRace()
local att=c:GetAttribute()
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=1 or not c:IsRelateToEffect(e) or c:IsFacedown()
or Duel.IsPlayerAffectedByEffect(tp,59822133)
or not Duel.IsPlayerCanSpecialSummonMonster(tp,29990541,0,TYPES_TOKEN_MONSTER,atk,def,lv,race,att) then return end
for i=1,2 do
local token=Duel.CreateToken(tp,29990541)
c:CreateRelation(token,RESET_EVENT+RESETS_STANDARD)
Duel.SpecialSummonStep(token,0,tp,tp,false,false,POS_FACEUP)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK_FINAL)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE,EFFECT_FLAG2_OPTION)
e1:SetRange(LOCATION_MZONE)
e1:SetValue(c29990440.tokenatk)
e1:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TOFIELD)
token:RegisterEffect(e1,true)
local e2=e1:Clone()
e2:SetCode(EFFECT_SET_DEFENSE_FINAL)
e2:SetValue(c29990440.tokendef)
token:RegisterEffect(e2,true)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_CHANGE_LEVEL)
e3:SetValue(c29990440.tokenlv)
e3:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TOFIELD)
token:RegisterEffect(e3,true)
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetCode(EFFECT_CHANGE_RACE)
e4:SetValue(c29990440.tokenrace)
e4:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TOFIELD)
token:RegisterEffect(e4,true)
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_SINGLE)
e5:SetCode(EFFECT_CHANGE_ATTRIBUTE)
e5:SetValue(c29990440.tokenatt)
e5:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TOFIELD)
token:RegisterEffect(e5,true)
local e6=Effect.CreateEffect(c)
e6:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e6:SetCode(EVENT_ADJUST)
e6:SetRange(LOCATION_MZONE)
e6:SetCondition(c29990440.tokendescon)
e6:SetOperation(c29990440.tokendesop)
e6:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TOFIELD)
token:RegisterEffect(e6,true)
local e7=Effect.CreateEffect(c)
e7:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e7:SetCode(EVENT_PHASE+PHASE_BATTLE)
e7:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE+EFFECT_CANNOT_DISABLE)
e7:SetRange(LOCATION_MZONE)
e7:SetOperation(c29990440.tokendesop2)
e7:SetReset(RESET_EVENT+RESETS_STANDARD)
token:RegisterEffect(e7,true)
local e8=Effect.CreateEffect(c)
e8:SetType(EFFECT_TYPE_SINGLE)
e8:SetCode(EFFECT_IMMUNE_EFFECT)
e8:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e8:SetRange(LOCATION_MZONE)
e8:SetValue(c29990440.tokenefilter)
token:RegisterEffect(e8,true)
local e9=Effect.CreateEffect(c)
e9:SetType(EFFECT_TYPE_SINGLE)
e9:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e9:SetCode(EFFECT_CANNOT_BE_LINK_MATERIAL)
e9:SetRange(LOCATION_MZONE)
e9:SetValue(1)
token:RegisterEffect(e9,true)
local e10=e9:Clone()
e10:SetCode(EFFECT_CANNOT_BE_FUSION_MATERIAL)
e10:SetValue(c29990440.tokenfuslimit)
token:RegisterEffect(e10,true)
local e11=e9:Clone()
e11:SetCode(EFFECT_CANNOT_BE_SYNCHRO_MATERIAL)
token:RegisterEffect(e11,true)
local e12=e9:Clone()
e12:SetCode(EFFECT_CANNOT_BE_XYZ_MATERIAL)
token:RegisterEffect(e12,true)
local e13=e9:Clone()
e13:SetCode(EFFECT_UNRELEASABLE_SUM)
token:RegisterEffect(e13,true)
local e14=e9:Clone()
e14:SetCode(EFFECT_UNRELEASABLE_NONSUM)
token:RegisterEffect(e14,true)
end
Duel.SpecialSummonComplete()
end
function c29990440.tktg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chkc then return chkc:IsOnField() and c29990440.filter(chkc) end
if chk==0 then
local c=e:GetHandler()
return Duel.GetLocationCount(tp,LOCATION_MZONE)>=2
and not Duel.IsPlayerAffectedByEffect(tp,59822133)
and Duel.IsPlayerCanSpecialSummonMonster(tp,29990542,0,TYPES_TOKEN_MONSTER,c:GetAttack(),c:GetDefense(),c:GetLevel(),c:GetRace(),c:GetAttribute()) end
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(29990440,0))
e:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOKEN)
e:SetProperty(0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,2,0,0)
Duel.SetOperationInfo(0,CATEGORY_TOKEN,nil,2,0,0)
end
function c29990440.tkop2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local atk=c:GetAttack()
local def=c:GetDefense()
local lv=c:GetRank()
local race=c:GetRace()
local att=c:GetAttribute()
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=1 or not c:IsRelateToEffect(e) or c:IsFacedown()
or Duel.IsPlayerAffectedByEffect(tp,59822133)
or not Duel.IsPlayerCanSpecialSummonMonster(tp,29990542,0,TYPES_TOKEN_MONSTER,atk,def,lv,race,att) then return end
for i=1,2 do
local token=Duel.CreateToken(tp,29990542)
c:CreateRelation(token,RESET_EVENT+RESETS_STANDARD)
Duel.SpecialSummonStep(token,0,tp,tp,false,false,POS_FACEUP)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK_FINAL)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE,EFFECT_FLAG2_OPTION)
e1:SetRange(LOCATION_MZONE)
e1:SetValue(c29990440.tokenatk)
e1:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TOFIELD)
token:RegisterEffect(e1,true)
local e2=e1:Clone()
e2:SetCode(EFFECT_SET_DEFENSE_FINAL)
e2:SetValue(c29990440.tokendef)
token:RegisterEffect(e2,true)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_CHANGE_LEVEL)
e3:SetValue(c29990440.tokenlv)
e3:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TOFIELD)
token:RegisterEffect(e3,true)
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetCode(EFFECT_CHANGE_RACE)
e4:SetValue(c29990440.tokenrace)
e4:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TOFIELD)
token:RegisterEffect(e4,true)
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_SINGLE)
e5:SetCode(EFFECT_CHANGE_ATTRIBUTE)
e5:SetValue(c29990440.tokenatt)
e5:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TOFIELD)
token:RegisterEffect(e5,true)
local e6=Effect.CreateEffect(c)
e6:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e6:SetCode(EVENT_ADJUST)
e6:SetRange(LOCATION_MZONE)
e6:SetCondition(c29990440.tokendescon)
e6:SetOperation(c29990440.tokendesop)
e6:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TOFIELD)
token:RegisterEffect(e6,true)
local e7=Effect.CreateEffect(c)
e7:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e7:SetCode(EVENT_PHASE+PHASE_BATTLE)
e7:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE+EFFECT_CANNOT_DISABLE)
e7:SetRange(LOCATION_MZONE)
e7:SetOperation(c29990440.tokendesop2)
e7:SetReset(RESET_EVENT+RESETS_STANDARD)
token:RegisterEffect(e7,true)
local e8=Effect.CreateEffect(c)
e8:SetType(EFFECT_TYPE_SINGLE)
e8:SetCode(EFFECT_IMMUNE_EFFECT)
e8:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e8:SetRange(LOCATION_MZONE)
e8:SetValue(c29990440.tokenefilter)
token:RegisterEffect(e8,true)
local e9=Effect.CreateEffect(c)
e9:SetType(EFFECT_TYPE_SINGLE)
e9:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e9:SetCode(EFFECT_CANNOT_BE_LINK_MATERIAL)
e9:SetRange(LOCATION_MZONE)
e9:SetValue(1)
token:RegisterEffect(e9,true)
local e10=e9:Clone()
e10:SetCode(EFFECT_CANNOT_BE_FUSION_MATERIAL)
e10:SetValue(c29990440.tokenfuslimit)
token:RegisterEffect(e10,true)
local e11=e9:Clone()
e11:SetCode(EFFECT_CANNOT_BE_SYNCHRO_MATERIAL)
token:RegisterEffect(e11,true)
local e12=e9:Clone()
e12:SetCode(EFFECT_CANNOT_BE_XYZ_MATERIAL)
token:RegisterEffect(e12,true)
local e13=e9:Clone()
e13:SetCode(EFFECT_UNRELEASABLE_SUM)
token:RegisterEffect(e13,true)
local e14=e9:Clone()
e14:SetCode(EFFECT_UNRELEASABLE_NONSUM)
token:RegisterEffect(e14,true)
end
Duel.SpecialSummonComplete()
end
function c29990440.tktg3(e,tp,eg,ep,ev,re,r,rp,chk)
if chkc then return chkc:IsOnField() and c29990440.filter(chkc) end
if chk==0 then
local c=e:GetHandler()
return Duel.GetLocationCount(tp,LOCATION_MZONE)>=2
and not Duel.IsPlayerAffectedByEffect(tp,59822133)
and Duel.IsPlayerCanSpecialSummonMonster(tp,29990543,0,TYPES_TOKEN_MONSTER,c:GetAttack(),c:GetDefense(),c:GetLevel(),c:GetRace(),c:GetAttribute()) end
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(29990440,0))
e:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOKEN)
e:SetProperty(0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,2,0,0)
Duel.SetOperationInfo(0,CATEGORY_TOKEN,nil,2,0,0)
end
function c29990440.tkop3(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local atk=c:GetAttack()
local def=c:GetDefense()
local lv=c:GetRank()
local race=c:GetRace()
local att=c:GetAttribute()
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=1 or not c:IsRelateToEffect(e) or c:IsFacedown()
or Duel.IsPlayerAffectedByEffect(tp,59822133)
or not Duel.IsPlayerCanSpecialSummonMonster(tp,29990543,0,TYPES_TOKEN_MONSTER,atk,def,lv,race,att) then return end
for i=1,2 do
local token=Duel.CreateToken(tp,29990543)
c:CreateRelation(token,RESET_EVENT+RESETS_STANDARD)
Duel.SpecialSummonStep(token,0,tp,tp,false,false,POS_FACEUP)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK_FINAL)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE,EFFECT_FLAG2_OPTION)
e1:SetRange(LOCATION_MZONE)
e1:SetValue(c29990440.tokenatk)
e1:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TOFIELD)
token:RegisterEffect(e1,true)
local e2=e1:Clone()
e2:SetCode(EFFECT_SET_DEFENSE_FINAL)
e2:SetValue(c29990440.tokendef)
token:RegisterEffect(e2,true)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_CHANGE_LEVEL)
e3:SetValue(c29990440.tokenlv)
e3:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TOFIELD)
token:RegisterEffect(e3,true)
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetCode(EFFECT_CHANGE_RACE)
e4:SetValue(c29990440.tokenrace)
e4:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TOFIELD)
token:RegisterEffect(e4,true)
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_SINGLE)
e5:SetCode(EFFECT_CHANGE_ATTRIBUTE)
e5:SetValue(c29990440.tokenatt)
e5:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TOFIELD)
token:RegisterEffect(e5,true)
local e6=Effect.CreateEffect(c)
e6:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e6:SetCode(EVENT_ADJUST)
e6:SetRange(LOCATION_MZONE)
e6:SetCondition(c29990440.tokendescon)
e6:SetOperation(c29990440.tokendesop)
e6:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TOFIELD)
token:RegisterEffect(e6,true)
local e7=Effect.CreateEffect(c)
e7:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e7:SetCode(EVENT_PHASE+PHASE_BATTLE)
e7:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE+EFFECT_CANNOT_DISABLE)
e7:SetRange(LOCATION_MZONE)
e7:SetOperation(c29990440.tokendesop2)
e7:SetReset(RESET_EVENT+RESETS_STANDARD)
token:RegisterEffect(e7,true)
local e8=Effect.CreateEffect(c)
e8:SetType(EFFECT_TYPE_SINGLE)
e8:SetCode(EFFECT_IMMUNE_EFFECT)
e8:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e8:SetRange(LOCATION_MZONE)
e8:SetValue(c29990440.tokenefilter)
token:RegisterEffect(e8,true)
local e9=Effect.CreateEffect(c)
e9:SetType(EFFECT_TYPE_SINGLE)
e9:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e9:SetCode(EFFECT_CANNOT_BE_LINK_MATERIAL)
e9:SetRange(LOCATION_MZONE)
e9:SetValue(1)
token:RegisterEffect(e9,true)
local e10=e9:Clone()
e10:SetCode(EFFECT_CANNOT_BE_FUSION_MATERIAL)
e10:SetValue(c29990440.tokenfuslimit)
token:RegisterEffect(e10,true)
local e11=e9:Clone()
e11:SetCode(EFFECT_CANNOT_BE_SYNCHRO_MATERIAL)
token:RegisterEffect(e11,true)
local e12=e9:Clone()
e12:SetCode(EFFECT_CANNOT_BE_XYZ_MATERIAL)
token:RegisterEffect(e12,true)
local e13=e9:Clone()
e13:SetCode(EFFECT_UNRELEASABLE_SUM)
token:RegisterEffect(e13,true)
local e14=e9:Clone()
e14:SetCode(EFFECT_UNRELEASABLE_NONSUM)
token:RegisterEffect(e14,true)
end
Duel.SpecialSummonComplete()
end
--净怜异灵·暗杀者忍法络绎不绝
function c29990450.initial_effect(c)
aux.AddCodeList(c,29990030,29990300)
--xyz summon
aux.AddXyzProcedure(c,nil,7,2)
c:EnableReviveLimit()
--voice
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e0:SetCode(EVENT_SPSUMMON_SUCCESS)
e0:SetOperation(c29990450.sumsuc)
c:RegisterEffect(e0)
local e31=Effect.CreateEffect(c)
e31:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_SINGLE)
e31:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e31:SetCode(EVENT_LEAVE_FIELD)
e31:SetCondition(c29990450.leavecon1)
e31:SetOperation(c29990450.leaveop1)
c:RegisterEffect(e31)
--attribute
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE+EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EFFECT_ADD_ATTRIBUTE)
e1:SetRange(LOCATION_MZONE)
e1:SetValue(ATTRIBUTE_FIRE+ATTRIBUTE_LIGHT+ATTRIBUTE_DARK)
c:RegisterEffect(e1)
--must attack
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(29990450,0))
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_ATTACK_ANNOUNCE)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,29990450)
e2:SetCost(c29990450.cost)
e2:SetCondition(c29990450.con)
e2:SetTarget(c29990450.tg)
e2:SetOperation(c29990450.op)
c:RegisterEffect(e2)
--protect effect
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EVENT_CHAINING)
e3:SetRange(LOCATION_MZONE)
e3:SetCondition(c29990450.ngchaincon)
e3:SetOperation(c29990450.chainop)
c:RegisterEffect(e3)
end
function c29990450.sumsuc(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(24,0,aux.Stringid(29990450,14))
end
function c29990450.leavecon1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsPreviousLocation(LOCATION_MZONE)
and c:IsPreviousControler(tp) and c:GetReasonPlayer()==1-tp
end
function c29990450.leaveop1(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(24,0,aux.Stringid(29990450,15))
end
function c29990450.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 c29990450.con(e,tp,eg,ep,ev,re,r,rp)
local at=Duel.GetAttacker()
return at and at:IsControler(1-tp)
end
function c29990450.confilter(c)
return c:IsFaceup() and c:IsRank(7) and c:IsType(TYPE_XYZ) and c:IsRace(RACE_FAIRY) and not c:IsCode(29990450)
end
function c29990450.tg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c29990450.confilter(chkc) and chkc~=c end
if chk==0 then return Duel.IsExistingTarget(c29990450.confilter,tp,LOCATION_MZONE,0,1,c) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,c29990450.confilter,tp,LOCATION_MZONE,0,1,1,c)
end
function c29990450.op(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if c:IsRelateToEffect(e) and c:IsControler(tp) and c:IsFaceup()
and c:IsLocation(LOCATION_MZONE) and tc:IsRelateToEffect(e)
and tc:IsFaceup() and tc:IsLocation(LOCATION_MZONE) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EFFECT_SET_POSITION)
e1:SetRange(LOCATION_MZONE)
e1:SetTarget(c29990450.target)
e1:SetTargetRange(0,LOCATION_MZONE)
e1:SetValue(POS_FACEUP_ATTACK)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_BATTLE)
c:RegisterEffect(e1)
local e2=e1:Clone()
tc:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e3:SetCode(EFFECT_MUST_ATTACK)
e3:SetRange(LOCATION_MZONE)
e3:SetTargetRange(0,LOCATION_MZONE)
e3:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_BATTLE)
c:RegisterEffect(e3)
local e4=e3:Clone()
e4:SetCode(EFFECT_MUST_ATTACK_MONSTER)
e4:SetValue(c29990450.atklimit)
c:RegisterEffect(e4)
local e5=e3:Clone()
tc:RegisterEffect(e5)
local e6=e4:Clone()
tc:RegisterEffect(e6)
local e7=Effect.CreateEffect(c)
e7:SetDescription(aux.Stringid(29990450,1))
e7:SetCategory(CATEGORY_DAMAGE)
e7:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e7:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CANNOT_DISABLE)
e7:SetCode(EVENT_DAMAGE_STEP_END)
e7:SetRange(LOCATION_MZONE)
e7:SetCondition(c29990450.damcon)
e7:SetTarget(c29990450.damtg)
e7:SetOperation(c29990450.damop)
c:RegisterEffect(e7)
local e8=e7:Clone()
tc:RegisterEffect(e8)
end
end
function c29990450.target(e,c)
return c:IsDefenseBelow(2000)
end
function c29990450.atklimit(e,c)
return c==e:GetHandler()
end
function c29990450.damcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler()==Duel.GetAttackTarget()
end
function c29990450.damtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():GetOverlayGroup():FilterCount(Card.IsType,nil,TYPE_QUICKPLAY)>0 end
local ct=e:GetHandler():GetOverlayGroup():FilterCount(Card.IsType,nil,TYPE_QUICKPLAY)
Duel.SetTargetPlayer(1-tp)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,ct*300)
end
function c29990450.damop(e,tp,eg,ep,ev,re,r,rp)
local p=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER)
local ct=e:GetHandler():GetOverlayGroup():FilterCount(Card.IsType,nil,TYPE_QUICKPLAY)
Duel.Damage(p,ct*300,REASON_EFFECT)
end
function c29990450.ngchaincon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetOverlayGroup():IsExists(c29990450.orufilter,1,nil,e)
and e:GetHandler():GetOverlayGroup():IsExists(c29990450.orufilter2,1,nil,e)
end
function c29990450.orufilter(c,e)
return c:IsType(TYPE_QUICKPLAY) and (c:IsCode(29990300) or aux.IsCodeListed(c,29990300))
end
function c29990450.orufilter2(c,e)
return c:IsCode(29990050)
end
function c29990450.chainop(e,tp,eg,ep,ev,re,r,rp)
if re:GetHandler():IsSetCard(0x751) and re:IsActiveType(TYPE_XYZ) and ep==tp then
Duel.SetChainLimit(c29990450.chainlm)
end
end
function c29990450.chainlm(re,rp,tp)
return tp==rp and re:GetActivateLocation()==LOCATION_ONFIELD and re:IsActiveType(TYPE_MONSTER)
end
\ No newline at end of file
--净怜异灵结缘一瞬 绊属魔从
function c29990600.initial_effect(c)
aux.AddCodeList(c,29990100,29990110,29990300,299990400,299990410)
--change name
aux.EnableChangeCode(c,29990300,LOCATION_HAND+LOCATION_DECK+LOCATION_ONFIELD+LOCATION_GRAVE+LOCATION_REMOVED)
--Activate
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(29990600,0))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_HANDES)
e2:SetType(EFFECT_TYPE_ACTIVATE)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_MAIN_END)
e2:SetCondition(c29990600.condition)
e2:SetTarget(c29990600.sctg)
e2:SetOperation(c29990600.scop)
c:RegisterEffect(e2)
--sp summon
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(29990600,1))
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_LEAVE_FIELD)
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP)
e3:SetRange(LOCATION_GRAVE)
e3:SetCondition(c29990600.gsccondition)
e3:SetTarget(c29990600.gsctg)
e3:SetOperation(c29990600.gscop)
c:RegisterEffect(e3)
end
function c29990600.condition(e,tp,eg,ep,ev,re,r,rp)
local ph=Duel.GetCurrentPhase()
return ph==PHASE_MAIN1 or ph==PHASE_MAIN2
end
function c29990600.mfilter(c)
return c:IsFaceup() and c:IsSetCard(0x751) and c:IsLevelAbove(1) and not c:IsType(TYPE_TOKEN)
end
function c29990600.xyzfilter(c,mg)
return (c:IsCode(29990400) or c:IsCode(29990410) or ((c:IsRank(2) or c:IsRank(7))
and c:IsType(TYPE_XYZ) and c:IsRace(RACE_FAIRY))) and c:IsXyzSummonable(nil,mg)
end
function c29990600.sctg(e,tp,eg,ep,ev,re,r,rp,chk)
local h1=Duel.GetFieldGroupCount(tp,LOCATION_HAND,0)
if e:GetHandler():IsLocation(LOCATION_HAND) then h1=h1-1 end
if chk==0 then
local mg=Duel.GetMatchingGroup(c29990600.mfilter,tp,LOCATION_MZONE,0,nil)
return h1>0
and Duel.IsExistingMatchingCard(c29990600.xyzfilter,tp,LOCATION_EXTRA,0,1,nil,mg)
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
Duel.SetOperationInfo(0,CATEGORY_HANDES,nil,0,tp,1)
end
function c29990600.scop(e,tp,eg,ep,ev,re,r,rp)
if Duel.DiscardHand(tp,nil,1,1,REASON_EFFECT+REASON_DISCARD)==0 then return end
local mg=Duel.GetMatchingGroup(c29990600.mfilter,tp,LOCATION_MZONE,0,nil)
local g=Duel.GetMatchingGroup(c29990600.xyzfilter,tp,LOCATION_EXTRA,0,nil,mg)
if g:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=g:Select(tp,1,1,nil):GetFirst()
Duel.XyzSummon(tp,sg,mg,1,6)
end
end
function c29990600.cfilter(c)
return c:IsSetCard(0x751) and c:IsType(TYPE_XYZ)
end
function c29990600.gsccondition(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c29990600.cfilter,tp,LOCATION_EXTRA+LOCATION_MZONE,0,nil)
return g:GetClassCount(Card.GetCode)>=3
and Duel.GetFlagEffect(tp,29990600)==0
and aux.exccon(e) and eg:IsExists(c29990600.spgfilter,1,nil,tp) and Duel.GetTurnCount()>=3
end
function c29990600.spgfilter(c,tp)
return c:IsSetCard(0x751) and c:IsPreviousControler(tp) and c:IsPreviousLocation(LOCATION_MZONE)
and c:IsPreviousPosition(POS_FACEUP) and c:GetReasonPlayer()==1-tp and c:IsType(TYPE_XYZ)
and not c:IsReason(REASON_RULE) and not (c:IsCode(29990400) or c:IsCode(29990410))
end
function c29990600.filter(c,e,tp)
return (c:IsCode(29990400) or c:IsCode(29990410)) and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_XYZ,tp,false,true)
and ((Duel.GetLocationCountFromEx(tp,tp,mc,c)>0 and c:IsLocation(LOCATION_EXTRA))
or (Duel.GetMZoneCount(tp,mc)>0 and c:IsLocation(LOCATION_REMOVED)))
end
function c29990600.filter0(c,e,tp,mc)
return (c:IsCode(29990400) or c:IsCode(29990410)) and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_XYZ,tp,false,true)
and ((Duel.GetLocationCountFromEx(tp,tp,mc,c)>0 and c:IsLocation(LOCATION_EXTRA))
or (Duel.GetMZoneCount(tp,mc)>0 and c:IsLocation(LOCATION_REMOVED)))
and mc:IsCanBeXyzMaterial(c)
end
function c29990600.gmfilter(c,e,tp)
return c:IsCode(29990100) and Duel.IsExistingMatchingCard(c29990600.filter0,tp,LOCATION_EXTRA+LOCATION_REMOVED,0,1,nil,e,tp,c)
and aux.MustMaterialCheck(c,tp,EFFECT_MUST_BE_XMATERIAL)
end
function c29990600.gmfilter1(c,e,tp)
return c:IsCode(29990110) and Duel.IsExistingMatchingCard(c29990600.filter0,tp,LOCATION_EXTRA+LOCATION_REMOVED,0,1,nil,e,tp,c)
and aux.MustMaterialCheck(c,tp,EFFECT_MUST_BE_XMATERIAL)
end
function c29990600.gsctg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.IsExistingMatchingCard(c29990600.filter,tp,LOCATION_EXTRA+LOCATION_REMOVED,0,1,nil,e,tp) and
Duel.IsExistingMatchingCard(c29990600.gmfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) and
Duel.IsExistingMatchingCard(c29990600.gmfilter1,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA+LOCATION_REMOVED)
end
function c29990600.scfilter(c,e,tp)
return (c:IsCode(29990400) or c:IsCode(29990410)) and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_XYZ,tp,false,true)
and ((Duel.GetLocationCountFromEx(tp,tp,mc,c)>0 and c:IsLocation(LOCATION_EXTRA))
or (Duel.GetMZoneCount(tp,mc)>0 and c:IsLocation(LOCATION_REMOVED)))
end
function c29990600.gscop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetTurnCount()<3 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL)
local mg1=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c29990600.gmfilter),tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL)
local mg2=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c29990600.gmfilter1),tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
local mg3=Group.__bor(mg1,mg2)
if mg1:GetCount()>0 and mg2:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tc=Duel.SelectMatchingCard(tp,c29990600.scfilter,tp,LOCATION_EXTRA+LOCATION_REMOVED,0,1,1,nil,e,tp):GetFirst()
if tc then
tc:SetMaterial(mg3)
Duel.Overlay(tc,mg3)
Duel.SpecialSummon(tc,SUMMON_TYPE_XYZ,tp,tp,false,true,POS_FACEUP)
tc:CompleteProcedure()
end
end
Duel.RegisterFlagEffect(tp,29990600,RESET_PHASE+PHASE_END,0,3)
end
--净怜异灵结缘一瞬 绊属刃心
function c29990620.initial_effect(c)
aux.AddCodeList(c,29990140,29990150,29990300,299990440,299990450)
--change name
aux.EnableChangeCode(c,29990300,LOCATION_HAND+LOCATION_DECK+LOCATION_ONFIELD+LOCATION_GRAVE+LOCATION_REMOVED)
--Activate
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(29990620,0))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_HANDES)
e2:SetType(EFFECT_TYPE_ACTIVATE)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_MAIN_END)
e2:SetCondition(c29990620.condition)
e2:SetTarget(c29990620.sctg)
e2:SetOperation(c29990620.scop)
c:RegisterEffect(e2)
--sp summon
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(29990620,1))
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_LEAVE_FIELD)
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP)
e3:SetRange(LOCATION_GRAVE)
e3:SetCondition(c29990620.gsccondition)
e3:SetTarget(c29990620.gsctg)
e3:SetOperation(c29990620.gscop)
c:RegisterEffect(e3)
end
function c29990620.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()~=tp
and (Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2)
end
function c29990620.mfilter(c)
return c:IsFaceup() and c:IsSetCard(0x751) and c:IsLevelAbove(1) and not c:IsType(TYPE_TOKEN)
end
function c29990620.xyzfilter(c,mg)
return (c:IsCode(29990440) or c:IsCode(29990450) or ((c:IsRank(2) or c:IsRank(7))
and c:IsType(TYPE_XYZ) and c:IsRace(RACE_FAIRY))) and c:IsXyzSummonable(nil,mg)
end
function c29990620.sctg(e,tp,eg,ep,ev,re,r,rp,chk)
local h1=Duel.GetFieldGroupCount(tp,LOCATION_HAND,0)
if e:GetHandler():IsLocation(LOCATION_HAND) then h1=h1-1 end
if chk==0 then
local mg=Duel.GetMatchingGroup(c29990620.mfilter,tp,LOCATION_MZONE,0,nil)
return h1>0
and Duel.IsExistingMatchingCard(c29990620.xyzfilter,tp,LOCATION_EXTRA,0,1,nil,mg)
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
Duel.SetOperationInfo(0,CATEGORY_HANDES,nil,0,tp,1)
end
function c29990620.scop(e,tp,eg,ep,ev,re,r,rp)
if Duel.DiscardHand(tp,nil,1,1,REASON_EFFECT+REASON_DISCARD)==0 then return end
local mg=Duel.GetMatchingGroup(c29990620.mfilter,tp,LOCATION_MZONE,0,nil)
local g=Duel.GetMatchingGroup(c29990620.xyzfilter,tp,LOCATION_EXTRA,0,nil,mg)
if g:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=g:Select(tp,1,1,nil):GetFirst()
Duel.XyzSummon(tp,sg,mg,1,6)
end
end
function c29990620.cfilter(c)
return c:IsSetCard(0x751) and not c:IsType(TYPE_XYZ)
end
function c29990620.gsccondition(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c29990620.cfilter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,nil)
return g:GetClassCount(Card.GetCode)>=3 and Duel.GetTurnPlayer()~=tp
and Duel.GetFlagEffect(tp,29990620)==0
and aux.exccon(e) and eg:IsExists(c29990620.spgfilter,1,nil,tp) and Duel.GetTurnCount()>=3
end
function c29990620.spgfilter(c,tp)
return c:IsSetCard(0x751) and c:IsPreviousControler(tp) and c:IsPreviousLocation(LOCATION_MZONE)
and c:IsPreviousPosition(POS_FACEUP) and c:GetReasonPlayer()==1-tp and c:IsType(TYPE_XYZ)
and not c:IsReason(REASON_RULE) and not (c:IsCode(29990440) or c:IsCode(29990450))
end
function c29990620.filter(c,e,tp)
return (c:IsCode(29990440) or c:IsCode(29990450)) and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_XYZ,tp,false,true)
and (Duel.GetMZoneCount(tp,mc)>0 and c:IsLocation(LOCATION_GRAVE+LOCATION_REMOVED))
end
function c29990620.filter0(c,e,tp,mc)
return (c:IsCode(29990440) or c:IsCode(29990450)) and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_XYZ,tp,false,true)
and (Duel.GetMZoneCount(tp,mc)>0 and c:IsLocation(LOCATION_GRAVE+LOCATION_REMOVED))
and mc:IsCanBeXyzMaterial(c)
end
function c29990620.gmfilter(c,e,tp)
return c:IsCode(29990140) and Duel.IsExistingMatchingCard(c29990620.filter0,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,nil,e,tp,c)
and aux.MustMaterialCheck(c,tp,EFFECT_MUST_BE_XMATERIAL)
end
function c29990620.gmfilter1(c,e,tp)
return c:IsCode(29990150) and Duel.IsExistingMatchingCard(c29990620.filter0,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,nil,e,tp,c)
and aux.MustMaterialCheck(c,tp,EFFECT_MUST_BE_XMATERIAL)
end
function c29990620.gsctg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.IsExistingMatchingCard(c29990620.filter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,nil,e,tp) and
Duel.IsExistingMatchingCard(c29990620.gmfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) and
Duel.IsExistingMatchingCard(c29990620.gmfilter1,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE+LOCATION_REMOVED)
end
function c29990620.scfilter(c,e,tp)
return (c:IsCode(29990440) or c:IsCode(29990450)) and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_XYZ,tp,false,true)
and (Duel.GetMZoneCount(tp,mc)>0 and c:IsLocation(LOCATION_GRAVE+LOCATION_REMOVED))
end
function c29990620.gscop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetTurnCount()<3 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL)
local mg1=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c29990620.gmfilter),tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL)
local mg2=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c29990620.gmfilter1),tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
local mg3=Group.__bor(mg1,mg2)
if mg1:GetCount()>0 and mg2:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tc=Duel.SelectMatchingCard(tp,c29990620.scfilter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,1,nil,e,tp):GetFirst()
if tc then
tc:SetMaterial(mg3)
Duel.Overlay(tc,mg3)
Duel.SpecialSummon(tc,SUMMON_TYPE_XYZ,tp,tp,false,true,POS_FACEUP)
tc:CompleteProcedure()
end
end
Duel.RegisterFlagEffect(tp,29990620,RESET_PHASE+PHASE_END,0,3)
end
--心维交感 真翼融合 红与青的彩饰
function c29990630.initial_effect(c)
aux.AddCodeList(c,29990000,29990010,29990100,29990110,29990300,29990400,29990410)
--ac
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_ACTIVATE)
e0:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e0)
--effect gain
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(29990630,0))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetCondition(c29990630.condition)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(2,29990630+EFFECT_COUNT_CODE_OATH)
e2:SetCost(c29990630.xyzcost)
e2:SetTarget(c29990630.sptg)
e2:SetOperation(c29990630.spop)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_GRANT)
e3:SetRange(LOCATION_SZONE)
e3:SetTargetRange(LOCATION_MZONE,0)
e3:SetTarget(c29990630.eftg)
e3:SetLabelObject(e2)
c:RegisterEffect(e3)
--effect gain
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(29990630,1))
e4:SetType(EFFECT_TYPE_QUICK_O)
e4:SetCode(EVENT_FREE_CHAIN)
e4:SetRange(LOCATION_MZONE)
e4:SetCountLimit(2,29990631+EFFECT_COUNT_CODE_OATH)
e4:SetTarget(c29990630.nametg)
e4:SetOperation(c29990630.nameop)
c:RegisterEffect(e4)
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_GRANT)
e5:SetRange(LOCATION_SZONE)
e5:SetTargetRange(LOCATION_MZONE,0)
e5:SetTarget(c29990630.eftg2)
e5:SetLabelObject(e4)
c:RegisterEffect(e5)
--search
local e6=Effect.CreateEffect(c)
e6:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e6:SetProperty(EFFECT_FLAG_DELAY)
e6:SetCode(EVENT_TO_GRAVE)
e6:SetCondition(c29990630.tgcondition)
e6:SetCountLimit(1,29990633+EFFECT_COUNT_CODE_OATH)
e6:SetTarget(c29990630.acttg)
e6:SetOperation(c29990630.actop)
c:RegisterEffect(e6)
end
function c29990630.condition(e,tp,eg,ep,ev,re,r,rp)
local ph=Duel.GetCurrentPhase()
return ph==PHASE_MAIN1 or ph==PHASE_MAIN2
end
function c29990630.xyzcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDiscardDeckAsCost(tp,3) end
Duel.DiscardDeck(tp,3,REASON_COST)
end
function c29990630.eftg(e,c)
return (c:IsRace(RACE_FAIRY) and c:IsType(TYPE_XYZ) and c:IsRank(2)) or
(c:GetBaseAttack()==100 and c:GetBaseDefense()==100
and c:IsRace(RACE_FAIRY) and (c:IsAttribute(ATTRIBUTE_DARK) or c:IsAttribute(ATTRIBUTE_LIGHT))
and c:IsLevel(1))
end
function c29990630.eftg2(e,c)
return c:IsCode(29990400) or c:IsCode(29990410)
end
function c29990630.chargefilter1(c,e,tp)
return c:IsCode(29990100)
end
function c29990630.chargefilter2(c,e,tp)
return c:IsCode(29990110)
end
function c29990630.filter1(c,e,tp,mc)
return c:IsCode(29990400)
and mc:IsCanBeXyzMaterial(c)
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_XYZ,tp,false,false)
and Duel.GetLocationCountFromEx(tp,tp,mc,c)>0
end
function c29990630.filter2(c,e,tp,mc)
return c:IsCode(29990410)
and mc:IsCanBeXyzMaterial(c)
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_XYZ,tp,false,false)
and Duel.GetLocationCountFromEx(tp,tp,mc,c)>0
end
function c29990630.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local b1=aux.MustMaterialCheck(c,tp,EFFECT_MUST_BE_XMATERIAL)
and Duel.IsExistingMatchingCard(c29990630.filter1,tp,LOCATION_EXTRA,0,1,nil,e,tp,c)
and Duel.GetFlagEffect(tp,29990631)==0
local b2=aux.MustMaterialCheck(c,tp,EFFECT_MUST_BE_XMATERIAL)
and Duel.IsExistingMatchingCard(c29990630.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,c)
and Duel.GetFlagEffect(tp,29990632)==0
if chk==0 then return b1 or b2 end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function c29990630.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsFaceup() and c:IsRelateToEffect(e) and c:IsControler(tp) and not c:IsImmuneToEffect(e) and aux.MustMaterialCheck(c,tp,EFFECT_MUST_BE_XMATERIAL) then
Duel.Hint(HINT_MESSAGE,tp,aux.Stringid(29990630,6))
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local b1=Duel.IsExistingMatchingCard(c29990630.filter1,tp,LOCATION_EXTRA,0,1,nil,e,tp,c)
and Duel.GetFlagEffect(tp,29990631)==0
local b2=Duel.IsExistingMatchingCard(c29990630.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,c)
and Duel.GetFlagEffect(tp,29990632)==0
local op=0
if b1 and b2 then op=Duel.SelectOption(tp,aux.Stringid(29990630,2),aux.Stringid(29990630,3))
elseif b1 then op=Duel.SelectOption(tp,aux.Stringid(29990630,2))
elseif b2 then op=Duel.SelectOption(tp,aux.Stringid(29990630,3))+1
else return end
if op==0 then
Duel.Hint(HINT_MESSAGE,tp,aux.Stringid(29990630,7))
local g1=Duel.SelectMatchingCard(tp,c29990630.filter1,tp,LOCATION_EXTRA,0,1,1,nil,e,tp,c)
local tc=g1:GetFirst()
if tc then
local mg=c:GetOverlayGroup()
if mg:GetCount()>0 then
Duel.Overlay(tc,mg)
end
tc:SetMaterial(Group.FromCards(c))
Duel.Overlay(tc,Group.FromCards(c))
Duel.SpecialSummon(tc,SUMMON_TYPE_XYZ,tp,tp,false,false,POS_FACEUP)
tc:CompleteProcedure()
local g1=Duel.GetMatchingGroup(aux.NecroValleyFilter(c29990630.chargefilter1),tp,LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE+LOCATION_REMOVED,0,nil,e,tp,c)
if g1:GetCount()>0 and Duel.IsExistingMatchingCard(Card.IsCode,tp,LOCATION_GRAVE,0,1,nil,29990000)
and Duel.IsExistingMatchingCard(Card.IsCode,tp,LOCATION_GRAVE,0,1,nil,29990300)
and Duel.SelectYesNo(tp,aux.Stringid(29990630,4)) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(29990630,5))
local sg=g1:Select(tp,1,1,nil)
Duel.Overlay(tc,sg)
end
end
Duel.RegisterFlagEffect(tp,29990631,RESET_PHASE+PHASE_END,0,1)
else
Duel.Hint(HINT_MESSAGE,tp,aux.Stringid(29990630,8))
local g2=Duel.SelectMatchingCard(tp,c29990630.filter2,tp,LOCATION_EXTRA,0,1,1,nil,e,tp,c)
local tc=g2:GetFirst()
if tc then
local mg=c:GetOverlayGroup()
if mg:GetCount()>0 then
Duel.Overlay(tc,mg)
end
tc:SetMaterial(Group.FromCards(c))
Duel.Overlay(tc,Group.FromCards(c))
Duel.SpecialSummon(tc,SUMMON_TYPE_XYZ,tp,tp,false,false,POS_FACEUP)
tc:CompleteProcedure()
local g1=Duel.GetMatchingGroup(aux.NecroValleyFilter(c29990630.chargefilter2),tp,LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE+LOCATION_REMOVED,0,nil,e,tp,c)
if g1:GetCount()>0 and Duel.IsExistingMatchingCard(Card.IsCode,tp,LOCATION_GRAVE,0,1,nil,29990010)
and Duel.IsExistingMatchingCard(Card.IsCode,tp,LOCATION_GRAVE,0,1,nil,299990300)
and Duel.SelectYesNo(tp,aux.Stringid(29990630,4)) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(29990630,5))
local sg=g1:Select(tp,1,1,nil)
Duel.Overlay(tc,sg)
end
end
Duel.RegisterFlagEffect(tp,29990632,RESET_PHASE+PHASE_END,0,1)
end
end
end
function c29990630.nametg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:GetOverlayCount()>=1 and c:GetOverlayGroup():IsExists(c29990630.filterO,1,nil) end
local g=e:GetHandler():GetOverlayGroup():Filter(Card.IsRace,nil,RACE_FAIRY)
local ag=Group.CreateGroup()
local codes={}
for c in aux.Next(g) do
local code=c:GetCode()
if not ag:IsExists(Card.IsCode,1,nil,code) then
ag:AddCard(c)
table.insert(codes,code)
end
end
table.sort(codes)
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)
local ac=Duel.AnnounceCard(tp,table.unpack(afilter))
getmetatable(e:GetHandler()).announce_filter={RACE_FAIRY,OPCODE_ISRACE,code,OPCODE_ISCODE,OPCODE_NOT,OPCODE_AND}
Duel.SetTargetParam(ac)
Duel.SetOperationInfo(0,CATEGORY_ANNOUNCE,nil,0,tp,0)
end
function c29990630.filterO(c)
return c:IsRace(RACE_FAIRY)
end
function c29990630.nameop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_MESSAGE,tp,aux.Stringid(29990630,9))
local ac=Duel.GetChainInfo(0,CHAININFO_TARGET_PARAM)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and c:IsFaceup() then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EFFECT_CHANGE_CODE)
e1:SetValue(ac)
c:RegisterEffect(e1)
end
end
function c29990630.tgcondition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFlagEffect(tp,29990630)==0
end
function c29990630.actfilter1(c,e,tp)
return c:IsCode(29990640) and c:GetActivateEffect():IsActivatable(tp)
end
function c29990630.actfilter2(c,e,tp)
return c:IsCode(29990650) and c:GetActivateEffect():IsActivatable(tp)
end
function c29990630.acttg(e,tp,eg,ep,ev,re,r,rp,chk)
if Duel.GetTurnPlayer()==tp then
if chk==0 then return Duel.IsExistingMatchingCard(c29990630.actfilter1,tp,LOCATION_DECK+LOCATION_GRAVE+LOCATION_REMOVED,0,1,nil,e,tp) end
e:SetCategory(0)
else
if chk==0 then return Duel.IsExistingMatchingCard(c29990630.actfilter2,tp,LOCATION_DECK+LOCATION_GRAVE+LOCATION_REMOVED,0,1,nil,e,tp) end
e:SetCategory(0)
end
end
function c29990630.actop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetTurnPlayer()==tp then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_OPERATECARD)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c29990630.actfilter1),tp,LOCATION_DECK+LOCATION_GRAVE+LOCATION_REMOVED,0,1,1,nil,e,tp)
local tc=g:GetFirst()
if tc then
Duel.MoveToField(tc,tp,tp,LOCATION_SZONE,POS_FACEUP,true)
local te=tc:GetActivateEffect()
local tep=tc:GetControler()
local cost=te:GetCost()
if cost then cost(te,tep,eg,ep,ev,re,r,rp,1) end
end
else
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_OPERATECARD)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c29990630.actfilter2),tp,LOCATION_DECK+LOCATION_GRAVE+LOCATION_REMOVED,0,1,1,nil,e,tp)
local tc=g:GetFirst()
if tc then
Duel.MoveToField(tc,tp,tp,LOCATION_SZONE,POS_FACEUP,true)
local te=tc:GetActivateEffect()
local tep=tc:GetControler()
local cost=te:GetCost()
if cost then cost(te,tep,eg,ep,ev,re,r,rp,1) end
end
end
Duel.RegisterFlagEffect(tp,29990630,RESET_PHASE+PHASE_END,0,3)
end
--心维交感 真翼融合 蓝与粉的彩饰
function c29990640.initial_effect(c)
aux.AddCodeList(c,29990020,29990030,29990120,29990130,29990300,29990420,29990430)
--ac
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_ACTIVATE)
e0:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e0)
--effect gain
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(29990640,0))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetCondition(c29990640.condition)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(2,29990640+EFFECT_COUNT_CODE_OATH)
e2:SetCost(c29990640.xyzcost)
e2:SetTarget(c29990640.sptg)
e2:SetOperation(c29990640.spop)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_GRANT)
e3:SetRange(LOCATION_SZONE)
e3:SetTargetRange(LOCATION_MZONE,0)
e3:SetTarget(c29990640.eftg)
e3:SetLabelObject(e2)
c:RegisterEffect(e3)
--effect gain
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(29990640,1))
e4:SetType(EFFECT_TYPE_QUICK_O)
e4:SetCode(EVENT_FREE_CHAIN)
e4:SetRange(LOCATION_MZONE)
e4:SetCountLimit(2,29990641+EFFECT_COUNT_CODE_OATH)
e4:SetTarget(c29990640.nametg)
e4:SetOperation(c29990640.nameop)
c:RegisterEffect(e4)
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_GRANT)
e5:SetRange(LOCATION_SZONE)
e5:SetTargetRange(LOCATION_MZONE,0)
e5:SetTarget(c29990640.eftg2)
e5:SetLabelObject(e4)
c:RegisterEffect(e5)
end
function c29990640.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==tp
and (Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2)
end
function c29990640.xyzcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDiscardDeckAsCost(tp,3) end
Duel.DiscardDeck(tp,3,REASON_COST)
end
function c29990640.eftg(e,c)
return (c:IsRace(RACE_FAIRY) and c:IsType(TYPE_XYZ) and c:IsRank(2)) or
(c:GetBaseAttack()==100 and c:GetBaseDefense()==100
and c:IsRace(RACE_FAIRY) and (c:IsAttribute(ATTRIBUTE_DARK) or c:IsAttribute(ATTRIBUTE_LIGHT))
and c:IsLevel(1))
end
function c29990640.eftg2(e,c)
return c:IsCode(29990420) or c:IsCode(29990430)
end
function c29990640.chargefilter1(c,e,tp)
return c:IsCode(29990120)
end
function c29990640.chargefilter2(c,e,tp)
return c:IsCode(29990130)
end
function c29990640.filter1(c,e,tp,mc)
return c:IsCode(29990420)
and mc:IsCanBeXyzMaterial(c)
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_XYZ,tp,false,false)
and Duel.GetLocationCountFromEx(tp,tp,mc,c)>0
end
function c29990640.filter2(c,e,tp,mc)
return c:IsCode(29990430)
and mc:IsCanBeXyzMaterial(c)
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_XYZ,tp,false,false)
and Duel.GetLocationCountFromEx(tp,tp,mc,c)>0
end
function c29990640.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local b1=aux.MustMaterialCheck(c,tp,EFFECT_MUST_BE_XMATERIAL)
and Duel.IsExistingMatchingCard(c29990640.filter1,tp,LOCATION_EXTRA,0,1,nil,e,tp,c)
and Duel.GetFlagEffect(tp,29990641)==0
local b2=aux.MustMaterialCheck(c,tp,EFFECT_MUST_BE_XMATERIAL)
and Duel.IsExistingMatchingCard(c29990640.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,c)
and Duel.GetFlagEffect(tp,29990642)==0
if chk==0 then return b1 or b2 end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function c29990640.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsFaceup() and c:IsRelateToEffect(e) and c:IsControler(tp) and not c:IsImmuneToEffect(e) and aux.MustMaterialCheck(c,tp,EFFECT_MUST_BE_XMATERIAL) then
Duel.Hint(HINT_MESSAGE,tp,aux.Stringid(29990640,6))
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local b1=Duel.IsExistingMatchingCard(c29990640.filter1,tp,LOCATION_EXTRA,0,1,nil,e,tp,c)
and Duel.GetFlagEffect(tp,29990641)==0
local b2=Duel.IsExistingMatchingCard(c29990640.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,c)
and Duel.GetFlagEffect(tp,29990642)==0
local op=0
if b1 and b2 then op=Duel.SelectOption(tp,aux.Stringid(29990640,2),aux.Stringid(29990640,3))
elseif b1 then op=Duel.SelectOption(tp,aux.Stringid(29990640,2))
elseif b2 then op=Duel.SelectOption(tp,aux.Stringid(29990640,3))+1
else return end
if op==0 then
Duel.Hint(HINT_MESSAGE,tp,aux.Stringid(29990640,7))
local g1=Duel.SelectMatchingCard(tp,c29990640.filter1,tp,LOCATION_EXTRA,0,1,1,nil,e,tp,c)
local tc=g1:GetFirst()
if tc then
local mg=c:GetOverlayGroup()
if mg:GetCount()>0 then
Duel.Overlay(tc,mg)
end
tc:SetMaterial(Group.FromCards(c))
Duel.Overlay(tc,Group.FromCards(c))
Duel.SpecialSummon(tc,SUMMON_TYPE_XYZ,tp,tp,false,false,POS_FACEUP)
tc:CompleteProcedure()
local g1=Duel.GetMatchingGroup(aux.NecroValleyFilter(c29990640.chargefilter1),tp,LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE+LOCATION_REMOVED,0,nil,e,tp,c)
if g1:GetCount()>0 and Duel.IsExistingMatchingCard(Card.IsCode,tp,LOCATION_GRAVE,0,1,nil,29990020)
and Duel.IsExistingMatchingCard(Card.IsCode,tp,LOCATION_GRAVE,0,1,nil,29990300)
and Duel.SelectYesNo(tp,aux.Stringid(29990640,4)) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(29990640,5))
local sg=g1:Select(tp,1,1,nil)
Duel.Overlay(tc,sg)
end
end
Duel.RegisterFlagEffect(tp,29990641,RESET_PHASE+PHASE_END,0,1)
else
Duel.Hint(HINT_MESSAGE,tp,aux.Stringid(29990640,8))
local g2=Duel.SelectMatchingCard(tp,c29990640.filter2,tp,LOCATION_EXTRA,0,1,1,nil,e,tp,c)
local tc=g2:GetFirst()
if tc then
local mg=c:GetOverlayGroup()
if mg:GetCount()>0 then
Duel.Overlay(tc,mg)
end
tc:SetMaterial(Group.FromCards(c))
Duel.Overlay(tc,Group.FromCards(c))
Duel.SpecialSummon(tc,SUMMON_TYPE_XYZ,tp,tp,false,false,POS_FACEUP)
tc:CompleteProcedure()
local g1=Duel.GetMatchingGroup(aux.NecroValleyFilter(c29990640.chargefilter2),tp,LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE+LOCATION_REMOVED,0,nil,e,tp,c)
if g1:GetCount()>0 and Duel.IsExistingMatchingCard(Card.IsCode,tp,LOCATION_GRAVE,0,1,nil,29990030)
and Duel.IsExistingMatchingCard(Card.IsCode,tp,LOCATION_GRAVE,0,1,nil,299990300)
and Duel.SelectYesNo(tp,aux.Stringid(29990640,4)) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(29990640,5))
local sg=g1:Select(tp,1,1,nil)
Duel.Overlay(tc,sg)
end
end
Duel.RegisterFlagEffect(tp,29990642,RESET_PHASE+PHASE_END,0,1)
end
end
end
function c29990640.nametg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:GetOverlayCount()>=1 and c:GetOverlayGroup():IsExists(c29990640.filterO,1,nil) end
local g=e:GetHandler():GetOverlayGroup():Filter(Card.IsRace,nil,RACE_FAIRY)
local ag=Group.CreateGroup()
local codes={}
for c in aux.Next(g) do
local code=c:GetCode()
if not ag:IsExists(Card.IsCode,1,nil,code) then
ag:AddCard(c)
table.insert(codes,code)
end
end
table.sort(codes)
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)
local ac=Duel.AnnounceCard(tp,table.unpack(afilter))
getmetatable(e:GetHandler()).announce_filter={RACE_FAIRY,OPCODE_ISRACE,code,OPCODE_ISCODE,OPCODE_NOT,OPCODE_AND}
Duel.SetTargetParam(ac)
Duel.SetOperationInfo(0,CATEGORY_ANNOUNCE,nil,0,tp,0)
end
function c29990640.filterO(c)
return c:IsRace(RACE_FAIRY)
end
function c29990640.nameop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_MESSAGE,tp,aux.Stringid(29990640,9))
local ac=Duel.GetChainInfo(0,CHAININFO_TARGET_PARAM)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and c:IsFaceup() then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EFFECT_CHANGE_CODE)
e1:SetValue(ac)
c:RegisterEffect(e1)
end
end
--心维交感 真翼融合 黄与紫的彩饰
function c29990650.initial_effect(c)
aux.AddCodeList(c,29990040,29990050,29990140,29990150,29990300,29990440,29990450)
--ac
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_ACTIVATE)
e0:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e0)
--effect gain
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(29990650,0))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetCondition(c29990650.condition)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(2,29990650+EFFECT_COUNT_CODE_OATH)
e2:SetCost(c29990650.xyzcost)
e2:SetTarget(c29990650.sptg)
e2:SetOperation(c29990650.spop)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_GRANT)
e3:SetRange(LOCATION_SZONE)
e3:SetTargetRange(LOCATION_MZONE,0)
e3:SetTarget(c29990650.eftg)
e3:SetLabelObject(e2)
c:RegisterEffect(e3)
--effect gain
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(29990650,1))
e4:SetType(EFFECT_TYPE_QUICK_O)
e4:SetCode(EVENT_FREE_CHAIN)
e4:SetRange(LOCATION_MZONE)
e4:SetCountLimit(2,29990641+EFFECT_COUNT_CODE_OATH)
e4:SetTarget(c29990650.nametg)
e4:SetOperation(c29990650.nameop)
c:RegisterEffect(e4)
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_GRANT)
e5:SetRange(LOCATION_SZONE)
e5:SetTargetRange(LOCATION_MZONE,0)
e5:SetTarget(c29990650.eftg2)
e5:SetLabelObject(e4)
c:RegisterEffect(e5)
end
function c29990650.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()~=tp
and (Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2)
end
function c29990650.xyzcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDiscardDeckAsCost(tp,3) end
Duel.DiscardDeck(tp,3,REASON_COST)
end
function c29990650.eftg(e,c)
return (c:IsRace(RACE_FAIRY) and c:IsType(TYPE_XYZ) and c:IsRank(2)) or
(c:GetBaseAttack()==100 and c:GetBaseDefense()==100
and c:IsRace(RACE_FAIRY) and (c:IsAttribute(ATTRIBUTE_DARK) or c:IsAttribute(ATTRIBUTE_LIGHT))
and c:IsLevel(1))
end
function c29990650.eftg2(e,c)
return c:IsCode(29990440) or c:IsCode(29990450)
end
function c29990650.chargefilter1(c,e,tp)
return c:IsCode(29990140)
end
function c29990650.chargefilter2(c,e,tp)
return c:IsCode(29990150)
end
function c29990650.filter1(c,e,tp,mc)
return c:IsCode(29990440)
and mc:IsCanBeXyzMaterial(c)
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_XYZ,tp,false,false)
and Duel.GetLocationCountFromEx(tp,tp,mc,c)>0
end
function c29990650.filter2(c,e,tp,mc)
return c:IsCode(29990450)
and mc:IsCanBeXyzMaterial(c)
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_XYZ,tp,false,false)
and Duel.GetLocationCountFromEx(tp,tp,mc,c)>0
end
function c29990650.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local b1=aux.MustMaterialCheck(c,tp,EFFECT_MUST_BE_XMATERIAL)
and Duel.IsExistingMatchingCard(c29990650.filter1,tp,LOCATION_EXTRA,0,1,nil,e,tp,c)
and Duel.GetFlagEffect(tp,29990651)==0
local b2=aux.MustMaterialCheck(c,tp,EFFECT_MUST_BE_XMATERIAL)
and Duel.IsExistingMatchingCard(c29990650.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,c)
and Duel.GetFlagEffect(tp,29990652)==0
if chk==0 then return b1 or b2 end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function c29990650.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsFaceup() and c:IsRelateToEffect(e) and c:IsControler(tp) and not c:IsImmuneToEffect(e) and aux.MustMaterialCheck(c,tp,EFFECT_MUST_BE_XMATERIAL) then
Duel.Hint(HINT_MESSAGE,tp,aux.Stringid(29990650,6))
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local b1=Duel.IsExistingMatchingCard(c29990650.filter1,tp,LOCATION_EXTRA,0,1,nil,e,tp,c)
and Duel.GetFlagEffect(tp,29990651)==0
local b2=Duel.IsExistingMatchingCard(c29990650.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,c)
and Duel.GetFlagEffect(tp,29990652)==0
local op=0
if b1 and b2 then op=Duel.SelectOption(tp,aux.Stringid(29990650,2),aux.Stringid(29990650,3))
elseif b1 then op=Duel.SelectOption(tp,aux.Stringid(29990650,2))
elseif b2 then op=Duel.SelectOption(tp,aux.Stringid(29990650,3))+1
else return end
if op==0 then
Duel.Hint(HINT_MESSAGE,tp,aux.Stringid(29990650,7))
local g1=Duel.SelectMatchingCard(tp,c29990650.filter1,tp,LOCATION_EXTRA,0,1,1,nil,e,tp,c)
local tc=g1:GetFirst()
if tc then
local mg=c:GetOverlayGroup()
if mg:GetCount()>0 then
Duel.Overlay(tc,mg)
end
tc:SetMaterial(Group.FromCards(c))
Duel.Overlay(tc,Group.FromCards(c))
Duel.SpecialSummon(tc,SUMMON_TYPE_XYZ,tp,tp,false,false,POS_FACEUP)
tc:CompleteProcedure()
local g1=Duel.GetMatchingGroup(aux.NecroValleyFilter(c29990650.chargefilter1),tp,LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE+LOCATION_REMOVED,0,nil,e,tp,c)
if g1:GetCount()>0 and Duel.IsExistingMatchingCard(Card.IsCode,tp,LOCATION_GRAVE,0,1,nil,29990040)
and Duel.IsExistingMatchingCard(Card.IsCode,tp,LOCATION_GRAVE,0,1,nil,29990300)
and Duel.SelectYesNo(tp,aux.Stringid(29990650,4)) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(29990650,5))
local sg=g1:Select(tp,1,1,nil)
Duel.Overlay(tc,sg)
end
end
Duel.RegisterFlagEffect(tp,29990641,RESET_PHASE+PHASE_END,0,1)
else
Duel.Hint(HINT_MESSAGE,tp,aux.Stringid(29990650,8))
local g2=Duel.SelectMatchingCard(tp,c29990650.filter2,tp,LOCATION_EXTRA,0,1,1,nil,e,tp,c)
local tc=g2:GetFirst()
if tc then
local mg=c:GetOverlayGroup()
if mg:GetCount()>0 then
Duel.Overlay(tc,mg)
end
tc:SetMaterial(Group.FromCards(c))
Duel.Overlay(tc,Group.FromCards(c))
Duel.SpecialSummon(tc,SUMMON_TYPE_XYZ,tp,tp,false,false,POS_FACEUP)
tc:CompleteProcedure()
local g1=Duel.GetMatchingGroup(aux.NecroValleyFilter(c29990650.chargefilter2),tp,LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE+LOCATION_REMOVED,0,nil,e,tp,c)
if g1:GetCount()>0 and Duel.IsExistingMatchingCard(Card.IsCode,tp,LOCATION_GRAVE,0,1,nil,29990050)
and Duel.IsExistingMatchingCard(Card.IsCode,tp,LOCATION_GRAVE,0,1,nil,299990300)
and Duel.SelectYesNo(tp,aux.Stringid(29990650,4)) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(29990650,5))
local sg=g1:Select(tp,1,1,nil)
Duel.Overlay(tc,sg)
end
end
Duel.RegisterFlagEffect(tp,29990642,RESET_PHASE+PHASE_END,0,1)
end
end
end
function c29990650.nametg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:GetOverlayCount()>=1 and c:GetOverlayGroup():IsExists(c29990650.filterO,1,nil) end
local g=e:GetHandler():GetOverlayGroup():Filter(Card.IsRace,nil,RACE_FAIRY)
local ag=Group.CreateGroup()
local codes={}
for c in aux.Next(g) do
local code=c:GetCode()
if not ag:IsExists(Card.IsCode,1,nil,code) then
ag:AddCard(c)
table.insert(codes,code)
end
end
table.sort(codes)
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)
local ac=Duel.AnnounceCard(tp,table.unpack(afilter))
getmetatable(e:GetHandler()).announce_filter={RACE_FAIRY,OPCODE_ISRACE,code,OPCODE_ISCODE,OPCODE_NOT,OPCODE_AND}
Duel.SetTargetParam(ac)
Duel.SetOperationInfo(0,CATEGORY_ANNOUNCE,nil,0,tp,0)
end
function c29990650.filterO(c)
return c:IsRace(RACE_FAIRY)
end
function c29990650.nameop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_MESSAGE,tp,aux.Stringid(29990650,9))
local ac=Duel.GetChainInfo(0,CHAININFO_TARGET_PARAM)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and c:IsFaceup() then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EFFECT_CHANGE_CODE)
e1:SetValue(ac)
c:RegisterEffect(e1)
end
end
--血泣幻聻 枉然的默日劫剧
function c29990700.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOEXTRA+CATEGORY_TODECK)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EVENT_CHAINING)
e1:SetCondition(c29990700.condition)
e1:SetTarget(c29990700.target)
e1:SetOperation(c29990700.activate)
c:RegisterEffect(e1)
--act in hand
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_TRAP_ACT_IN_HAND)
c:RegisterEffect(e2)
end
function c29990700.condition(e,tp,eg,ep,ev,re,r,rp)
return ep~=tp and re:IsActiveType(TYPE_QUICKPLAY) and re:IsHasType(EFFECT_TYPE_ACTIVATE)
end
function c29990700.filter(c)
return (c:IsType(TYPE_XYZ) and c:IsRankAbove(7) and (c:IsRace(RACE_FIEND)) and c:IsAbleToExtra())
or (c:IsType(TYPE_XYZ) and c:IsRankAbove(7) and (c:IsRace(RACE_SEASERPENT)) and c:IsAbleToExtra())
or (c:IsType(TYPE_XYZ) and c:IsRankAbove(7) and (c:IsRace(RACE_SPELLCASTER)) and c:IsAbleToExtra())
or (c:IsType(TYPE_XYZ) and c:IsRankAbove(7) and (c:IsRace(RACE_FIEND)) and c:IsAbleToExtra())
or (c:IsType(TYPE_XYZ) and c:IsRankAbove(7) and (c:IsRace(RACE_ILLUSION)) and c:IsAbleToExtra())
or (c:IsType(TYPE_XYZ) and c:IsRankAbove(7) and (c:IsRace(RACE_WARRIOR)) and c:IsAbleToExtra())
or (c:IsType(TYPE_XYZ) and c:IsRankAbove(7) and (c:IsRace(RACE_ZOMBIE)) and c:IsAbleToExtra())
end
function c29990700.filter2(c)
return c:IsType(TYPE_QUICKPLAY) and c:IsAbleToDeck()
end
function c29990700.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c29990700.filter,tp,0,LOCATION_MZONE,1,nil) end
local sg=Duel.GetMatchingGroup(c29990700.filter,tp,0,LOCATION_MZONE,nil)
Duel.SetOperationInfo(0,CATEGORY_TOEXTRA,sg,sg:GetCount(),0,0)
end
function c29990700.activate(e,tp,eg,ep,ev,re,r,rp)
local sg=Duel.GetMatchingGroup(c29990700.filter,tp,0,LOCATION_MZONE,nil)
local g=Duel.GetMatchingGroup(c29990700.filter2,tp,0,LOCATION_HAND,nil)
if sg:GetCount()>0 then
if Duel.SendtoDeck(sg,nil,SEQ_DECKTOP,REASON_EFFECT)~=0 and g:GetCount()>0 then
Duel.ShuffleHand(1-tp)
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local sg2=g:Select(1-tp,1,1,nil)
Duel.SendtoDeck(sg2,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)
end
end
end
--millennium bug
function c29999999.initial_effect(c)
--cannot special summon
local e1=Effect.CreateEffect(c)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SPSUMMON_CONDITION)
c:RegisterEffect(e1)
--tribute limit
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_TRIBUTE_LIMIT)
e2:SetValue(c29999999.tlimit)
c:RegisterEffect(e2)
--summon with 2 tribute
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(29999999,0))
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_LIMIT_SUMMON_PROC)
e3:SetCondition(c29999999.ttcon)
e3:SetOperation(c29999999.ttop)
e3:SetValue(SUMMON_TYPE_ADVANCE)
c:RegisterEffect(e3)
local e4=Effect.CreateEffect(c)
e4:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetCode(EFFECT_LIMIT_SET_PROC)
e4:SetCondition(c29999999.setcon)
c:RegisterEffect(e4)
--atkup
local e5=Effect.CreateEffect(c)
e5:SetDescription(aux.Stringid(29999999,1))
e5:SetCategory(CATEGORY_DESTROY)
e5:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e5:SetCode(EVENT_SUMMON_SUCCESS)
e5:SetTarget(c29999999.destg)
e5:SetOperation(c29999999.desop)
c:RegisterEffect(e5)
--cannot activite
local e6=Effect.CreateEffect(c)
e6:SetType(EFFECT_TYPE_FIELD)
e6:SetCode(EFFECT_CANNOT_ACTIVATE)
e6:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e6:SetRange(LOCATION_MZONE)
e6:SetTargetRange(1,1)
e6:SetValue(c29999999.actlimit)
e6:SetCondition(c29999999.ctcon)
c:RegisterEffect(e6)
--disable
local e7=Effect.CreateEffect(c)
e7:SetType(EFFECT_TYPE_FIELD)
e7:SetRange(LOCATION_MZONE)
e7:SetTargetRange(LOCATION_OVERLAY+LOCATION_ONFIELD+LOCATION_GRAVE+LOCATION_REMOVED+LOCATION_HAND+LOCATION_DECK+LOCATION_EXTRA,LOCATION_OVERLAY+LOCATION_ONFIELD+LOCATION_GRAVE+LOCATION_REMOVED+LOCATION_HAND+LOCATION_DECK+LOCATION_EXTRA)
e7:SetTarget(c29999999.disable)
e7:SetCondition(c29999999.discon)
e7:SetCode(EFFECT_DISABLE)
c:RegisterEffect(e7)
--disable summon
local e8=Effect.CreateEffect(c)
e8:SetType(EFFECT_TYPE_FIELD)
e8:SetRange(LOCATION_MZONE)
e8:SetCode(EFFECT_CANNOT_SUMMON)
e8:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e8:SetTargetRange(1,1)
e8:SetTarget(c29999999.sumlimit)
e8:SetCondition(c29999999.sumcon)
c:RegisterEffect(e8)
local e9=e8:Clone()
e9:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
c:RegisterEffect(e9)
local e10=e8:Clone()
e10:SetCode(EFFECT_CANNOT_FLIP_SUMMON)
c:RegisterEffect(e10)
local e11=e8:Clone()
e11:SetCode(EFFECT_CANNOT_MSET)
c:RegisterEffect(e11)
local e12=e8:Clone()
e12:SetCode(EFFECT_CANNOT_TURN_SET)
c:RegisterEffect(e12)
--avoid damage
local e13=Effect.CreateEffect(c)
e13:SetType(EEFFECT_TYPE_FIELD)
e13:SetCode(EFFECT_CHANGE_DAMAGE)
e13:SetRange(LOCATION_MZONE)
e13:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e13:SetTargetRange(1,1)
e13:SetValue(c29999999.damval)
c:RegisterEffect(e13)
--destroy
local e14=Effect.CreateEffect(c)
e14:SetType(EFFECT_TYPE_SINGLE)
e14:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e14:SetRange(LOCATION_MZONE)
e14:SetCode(EFFECT_SELF_DESTROY)
e14:SetCondition(c29999999.descon)
c:RegisterEffect(e14)
end
function c29999999.tlimit(e,c)
local atk=c:GetAttack()
local def=c:GetDefense()
return not (atk<2000 and def<2000 and c:IsLevelAbove(10))
end
function c29999999.ttcon(e,c,minc)
if c==nil then return true end
return minc<=2 and Duel.CheckTribute(c,2)
end
function c29999999.ttop(e,tp,eg,ep,ev,re,r,rp,c)
local g=Duel.SelectTribute(tp,c,2,2)
c:SetMaterial(g)
Duel.Release(g,REASON_SUMMON+REASON_MATERIAL)
end
function c29999999.setcon(e,c,minc)
if not c then return true end
return false
end
function c29999999.desfilter(c)
local atk=c:GetAttack()
local def=c:GetDefense()
return c:IsFaceup() and (atk>=2000 or def>=2000)
end
function c29999999.destg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local g=Duel.GetMatchingGroup(c29999999.desfilter,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0)
end
function c29999999.desop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c29999999.desfilter,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
if g:GetCount()>0 then
Duel.Destroy(g,REASON_EFFECT)
end
end
function c29999999.ctcon(e)
local tp=e:GetHandlerPlayer()
return e:GetHandler():IsSummonType(SUMMON_TYPE_NORMAL)
end
function c29999999.actlimit(e,re,rp)
local rc=re:GetHandler()
return re:IsActiveType(TYPE_MONSTER) and (rc:IsAttackAbove(2000) or rc:IsDefenseAbove(2000))
end
function c29999999.disable(e,c)
return c~=e:GetHandler() and not c:IsCode(29999999) and (c:IsType(TYPE_EFFECT) or bit.band(c:GetOriginalType(),TYPE_EFFECT)==TYPE_EFFECT) and (c:GetAttack()>=2000 or c:GetDefense()>=2000)
end
function c29999999.discon(e)
local tp=e:GetHandlerPlayer()
return e:GetHandler():IsSummonType(SUMMON_TYPE_NORMAL)
end
function c29999999.sumlimit(e,c,sump,sumtype,sumpos,targetp)
return c~=e:GetHandler() and (c:GetAttack()>=2000 or c:GetDefense()>=2000)
end
function c29999999.sumcon(e)
local tp=e:GetHandlerPlayer()
return e:GetHandler():IsSummonType(SUMMON_TYPE_NORMAL)
end
function c29999999.damval(e,re,val,r,rp,rc)
if val>=2000 then return 0 else return val end
end
function c29999999.descon(e)
return e:GetHandler():IsAttackAbove(2000) or e:GetHandler():IsDefenseAbove(2000)
end
\ No newline at end of file
--Bijou
local s,id,o=GetID()
function s.initial_effect(c)
s.searcheff(c)
s.fusioneff(c)
end
function s.fusioneff(c)
--fusion
local e1=Effect.CreateEffect(c)
e1:SetDescription(1169)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_FUSION_SUMMON+CATEGORY_GRAVE_ACTION)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_GRAVE)
e1:SetCountLimit(1,id+114)
e1:SetCost(s.drcost)
e1:SetCondition(s.condition)
e1:SetTarget(s.target)
e1:SetOperation(s.activate)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetHintTiming(0,TIMING_END_PHASE)
e2:SetCondition(s.condition2)
c:RegisterEffect(e2)
if not s.global_check then
s.global_check=true
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_DESTROYED)
ge1:SetOperation(s.checkop)
Duel.RegisterEffect(ge1,0)
end
end
function s.checkop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetFlagEffect(0,id)~=0 or Duel.GetFlagEffect(1,id)~=0 then return end
for tc in aux.Next(eg) do
if tc:IsRace(RACE_ROCK) and not tc:IsReason(REASON_RULE) then
Duel.RegisterFlagEffect(0,id,RESET_PHASE+PHASE_END,0,1)
Duel.RegisterFlagEffect(1,id,RESET_PHASE+PHASE_END,0,1)
end
end
end
function s.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFlagEffect(tp,id)==0
end
function s.condition2(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFlagEffect(tp,id)~=0
end
function s.drcost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsAbleToDeckAsCost() end
Duel.SendtoDeck(c,1-tp,SEQ_DECKSHUFFLE,REASON_COST)
end
function s.filter1(c,e)
return c:IsType(TYPE_MONSTER) and c:IsCanBeFusionMaterial() and c:IsFaceupEx()
and c:IsAbleToDeck() and not c:IsImmuneToEffect(e)
end
function s.filter2(c,e,tp,m,f,chkf)
return c:IsLevel(1) and c:IsRace(RACE_ROCK) and c:IsType(TYPE_FUSION) and (not f or f(c))
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false) and c:CheckFusionMaterial(m,nil,chkf)
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then
local chkf=tp
local mg1=Duel.GetMatchingGroup(s.filter1,tp,LOCATION_REMOVED+LOCATION_GRAVE,0,c,e)
local res=Duel.IsExistingMatchingCard(s.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg1,nil,chkf)
if not res then
local ce=Duel.GetChainMaterial(tp)
if ce~=nil then
local fgroup=ce:GetTarget()
local mg2=fgroup(ce,e,tp)
local mf=ce:GetValue()
res=Duel.IsExistingMatchingCard(s.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg2,mf,chkf)
end
end
return res
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local chkf=tp
local mg1=Duel.GetMatchingGroup(aux.NecroValleyFilter(s.filter1),tp,LOCATION_REMOVED+LOCATION_GRAVE,0,c,e)
local sg1=Duel.GetMatchingGroup(s.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg1,nil,chkf)
local mg2=nil
local sg2=nil
local ce=Duel.GetChainMaterial(tp)
if ce~=nil then
local fgroup=ce:GetTarget()
mg2=fgroup(ce,e,tp)
local mf=ce:GetValue()
sg2=Duel.GetMatchingGroup(s.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg2,mf,chkf)
end
if sg1:GetCount()>0 or (sg2~=nil and sg2:GetCount()>0) then
local sg=sg1:Clone()
if sg2 then sg:Merge(sg2) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tg=sg:Select(tp,1,1,nil)
local tc=tg:GetFirst()
if sg1:IsContains(tc) and (sg2==nil or not sg2:IsContains(tc) or not Duel.SelectYesNo(tp,ce:GetDescription())) then
local mat1=Duel.SelectFusionMaterial(tp,tc,mg1,nil,chkf)
tc:SetMaterial(mat1)
Duel.SendtoDeck(mat1,nil,SEQ_DECKSHUFFLE,REASON_EFFECT+REASON_MATERIAL+REASON_FUSION)
Duel.BreakEffect()
Duel.SpecialSummon(tc,SUMMON_TYPE_FUSION,tp,tp,false,false,POS_FACEUP)
else
local mat2=Duel.SelectFusionMaterial(tp,tc,mg2,nil,chkf)
local fop=ce:GetOperation()
fop(ce,e,tp,tc,mat2)
end
tc:CompleteProcedure()
end
end
function s.searcheff(c)
--to hand
local e5=Effect.CreateEffect(c)
e5:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e5:SetType(EFFECT_TYPE_IGNITION)
e5:SetRange(LOCATION_MZONE+LOCATION_HAND)
e5:SetCountLimit(1,id)
e5:SetCost(s.thcost)
e5:SetTarget(s.thtg)
e5:SetOperation(s.thop)
c:RegisterEffect(e5)
end
function s.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToGraveAsCost() end
Duel.SendtoGrave(e:GetHandler(),REASON_COST)
end
function s.thfilter(c)
return c:IsLevel(1) and c:IsRace(RACE_ROCK) 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)
local b1=Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil)
local b2=Duel.IsExistingMatchingCard(s.thfilter,tp,0,LOCATION_DECK,1,nil)
local off=1
local ops={}
local opval={}
if b1 then
ops[off]=103
opval[off-1]=tp
off=off+1
end
if b2 then
ops[off]=102
opval[off-1]=1-tp
off=off+1
end
local op=Duel.SelectOption(1-tp,table.unpack(ops))
local sel=opval[op]
Duel.Hint(HINT_SELECTMSG,sel,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(sel,s.thfilter,sel,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-sel,g)
end
end
\ No newline at end of file
--魔女 Bijou
local s,id,o=GetID()
function s.initial_effect(c)
s.specialsum(c)
s.fusioneff(c)
end
function s.fusioneff(c)
--destroy
local e3=Effect.CreateEffect(c)
e3:SetDescription(1169)
e3:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_FUSION_SUMMON+CATEGORY_TOGRAVE)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1,id+114)
e3:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e3:SetCost(s.cost)
e3:SetTarget(s.target)
e3:SetOperation(s.activate)
c:RegisterEffect(e3)
end
function s.costfilter(c)
return c:IsType(TYPE_SPELL) and c:IsAbleToGraveAsCost()
end
function s.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local b1=Duel.IsExistingMatchingCard(s.costfilter,tp,LOCATION_HAND+LOCATION_SZONE,0,1,e:GetHandler())
if chk==0 then return b1 or b2 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,s.costfilter,tp,LOCATION_HAND+LOCATION_SZONE,0,1,1,nil)
Duel.SendtoGrave(g,REASON_COST)
end
function s.filter(c,e,tp)
return c:IsType(TYPE_FUSION) and c:IsLevel(1) and c:IsRace(RACE_ROCK) and c:CheckFusionMaterial()
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false) and Duel.GetLocationCountFromEx(tp,tp,nil,c)>0
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return aux.MustMaterialCheck(nil,tp,EFFECT_MUST_BE_FMATERIAL)
and Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_EXTRA,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
if not aux.MustMaterialCheck(nil,tp,EFFECT_MUST_BE_FMATERIAL) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp)
local tc=g:GetFirst()
if not tc then return end
tc:SetMaterial(nil)
Duel.SpecialSummon(tc,SUMMON_TYPE_FUSION,tp,tp,false,false,POS_FACEUP)
end
function s.specialsum(c)
if not s.global_check then
s.global_check=true
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_SUMMON_SUCCESS)
ge1:SetOperation(s.chk)
Duel.RegisterEffect(ge1,0)
local ge2=ge1:Clone()
ge2:SetCode(EVENT_SPSUMMON_SUCCESS)
Duel.RegisterEffect(ge2,0)
end
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(2)
e1:SetCategory(CATEGORY_REMOVE)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_TO_HAND)
e1:SetCountLimit(1,id)
e1:SetTarget(s.sptg)
e1:SetOperation(s.spop)
c:RegisterEffect(e1)
end
function s.chk(e,tp,eg,ep,ev,re,r,rp)
for tc in aux.Next(eg) do
local p=tc:GetSummonPlayer()
if tc:IsRace(RACE_ROCK) and Duel.GetFlagEffect(p,id)==0 then
Duel.RegisterFlagEffect(p,id,RESET_PHASE+PHASE_END,0,0)
end
end
end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
end
function s.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetCountLimit(1)
e1:SetOperation(s.tgop)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_UPDATE_LEVEL)
e2:SetTargetRange(LOCATION_HAND,0)
e2:SetValue(4)
e2:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e2,tp)
end
function s.rmfilter(c)
return c:IsAbleToRemove() and c:IsFacedown()
end
function s.tgop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetFlagEffect(tp,id)==0 then
Duel.Hint(HINT_CARD,0,id)
local g=Duel.GetMatchingGroup(s.rmfilter,tp,LOCATION_EXTRA,0,nil)
local ct=math.min(#g,4)
if ct>0 then
local sg=g:RandomSelect(tp,ct)
Duel.Remove(sg,POS_FACEDOWN,REASON_EFFECT)
end
end
e:Reset()
end
\ No newline at end of file
--Bijou石像
local s,id,o=GetID()
function s.initial_effect(c)
--xyz summon
aux.AddXyzProcedure(c,nil,1,2,s.ovfilter,aux.Stringid(id,0),2,s.xyzop)
c:EnableReviveLimit()
s.destroy_self(c)
s.specialsummon_rock(c)
end
function s.ovfilter(c)
return c:IsFaceup() and c:IsRace(RACE_ROCK)
end
function s.xyzop(e,tp,chk)
if chk==0 then return true end
e:GetHandler():RegisterFlagEffect(id,RESET_EVENT+RESETS_STANDARD-RESET_TOFIELD+RESET_PHASE+PHASE_END,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(id,3))
end
function s.specialsummon_rock(c)
--search
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e5:SetCode(EVENT_LEAVE_FIELD_P)
e5:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e5:SetOperation(s.regop)
c:RegisterEffect(e5)
local e6=Effect.CreateEffect(c)
e6:SetCategory(CATEGORY_TODECK+CATEGORY_SPECIAL_SUMMON+CATEGORY_FUSION_SUMMON)
e6:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e6:SetProperty(EFFECT_FLAG_DELAY)
e6:SetCode(EVENT_DESTROYED)
e6:SetCondition(s.spcon)
e6:SetTarget(s.sptg)
e6:SetOperation(s.spop)
e6:SetLabelObject(e5)
c:RegisterEffect(e6)
end
function s.regop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local ct=c:GetFlagEffect(id)
e:SetLabel(ct)
end
function s.spcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local ct=e:GetLabelObject():GetLabel()
return ct==0
end
function s.filter1(c,e)
return c:IsType(TYPE_MONSTER) and c:IsCanBeFusionMaterial() and c:IsFaceupEx()
and c:IsAbleToDeck() and not c:IsImmuneToEffect(e)
end
function s.filter2(c,e,tp,m,f,chkf)
return c:IsLevel(1) and c:IsRace(RACE_ROCK) and c:IsType(TYPE_FUSION) and (not f or f(c))
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false) and c:CheckFusionMaterial(m,nil,chkf)
end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local chkf=tp
local mg1=Duel.GetMatchingGroup(s.filter1,tp,LOCATION_REMOVED+LOCATION_GRAVE,0,nil,e)
local res=Duel.IsExistingMatchingCard(s.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg1,nil,chkf)
if not res then
local ce=Duel.GetChainMaterial(tp)
if ce~=nil then
local fgroup=ce:GetTarget()
local mg2=fgroup(ce,e,tp)
local mf=ce:GetValue()
res=Duel.IsExistingMatchingCard(s.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg2,mf,chkf)
end
end
return res
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function s.spop(e,tp,eg,ep,ev,re,r,rp)
local chkf=tp
local mg1=Duel.GetMatchingGroup(aux.NecroValleyFilter(s.filter1),tp,LOCATION_REMOVED+LOCATION_GRAVE,0,nil,e)
local sg1=Duel.GetMatchingGroup(s.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg1,nil,chkf)
local mg2=nil
local sg2=nil
local ce=Duel.GetChainMaterial(tp)
if ce~=nil then
local fgroup=ce:GetTarget()
mg2=fgroup(ce,e,tp)
local mf=ce:GetValue()
sg2=Duel.GetMatchingGroup(s.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg2,mf,chkf)
end
if sg1:GetCount()>0 or (sg2~=nil and sg2:GetCount()>0) then
local sg=sg1:Clone()
if sg2 then sg:Merge(sg2) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tg=sg:Select(tp,1,1,nil)
local tc=tg:GetFirst()
if sg1:IsContains(tc) and (sg2==nil or not sg2:IsContains(tc) or not Duel.SelectYesNo(tp,ce:GetDescription())) then
local mat1=Duel.SelectFusionMaterial(tp,tc,mg1,nil,chkf)
tc:SetMaterial(mat1)
Duel.SendtoDeck(mat1,nil,SEQ_DECKSHUFFLE,REASON_EFFECT+REASON_MATERIAL+REASON_FUSION)
Duel.BreakEffect()
Duel.SpecialSummon(tc,SUMMON_TYPE_FUSION,tp,tp,false,false,POS_FACEUP)
else
local mat2=Duel.SelectFusionMaterial(tp,tc,mg2,nil,chkf)
local fop=ce:GetOperation()
fop(ce,e,tp,tc,mat2)
end
tc:CompleteProcedure()
end
end
function s.destroy_self(c)
--destroy
local e3=Effect.CreateEffect(c)
e3:SetDescription(1101)
e3:SetCategory(CATEGORY_DESTROY)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1)
e3:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e3:SetCost(s.descost)
e3:SetTarget(s.destg)
e3:SetOperation(s.desop)
c:RegisterEffect(e3)
end
function s.descost(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 s.destg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsDestructable() end
Duel.SetOperationInfo(0,CATEGORY_DESTROY,e:GetHandler(),1,0,0)
end
function s.desop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.Destroy(c,REASON_EFFECT)
end
end
--Biboo
local s,id,o=GetID()
function s.initial_effect(c)
s.todeck_thiscard(c)
s.specialsum(c)
end
function s.todeck_thiscard(c)
--fusion
local e1=Effect.CreateEffect(c)
e1:SetDescription(1108)
e1:SetCategory(CATEGORY_TOGRAVE+CATEGORY_TODECK)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_GRAVE)
e1:SetCountLimit(1,id+114)
e1:SetCost(s.drcost)
e1:SetCondition(s.drcon)
e1:SetTarget(s.drtg)
e1:SetOperation(s.drop)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetHintTiming(0,TIMING_END_PHASE)
e2:SetCondition(s.drcon2)
c:RegisterEffect(e2)
if not s.global_check then
s.global_check=true
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_DESTROYED)
ge1:SetOperation(s.checkop)
Duel.RegisterEffect(ge1,0)
end
end
function s.checkop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetFlagEffect(0,id)~=0 or Duel.GetFlagEffect(1,id)~=0 then return end
for tc in aux.Next(eg) do
if tc:IsRace(RACE_ROCK) and not tc:IsReason(REASON_RULE) then
Duel.RegisterFlagEffect(0,id,RESET_PHASE+PHASE_END,0,1)
Duel.RegisterFlagEffect(1,id,RESET_PHASE+PHASE_END,0,1)
end
end
end
function s.drcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFlagEffect(tp,id)==0
end
function s.drcon2(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFlagEffect(tp,id)~=0
end
function s.drcost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsAbleToDeckAsCost() end
Duel.SendtoDeck(c,1-tp,SEQ_DECKSHUFFLE,REASON_COST)
end
function s.filter(c)
return c:IsRace(RACE_ROCK) and c:IsAbleToGrave()
end
function s.tdfilter(c)
return c:IsRace(RACE_ROCK) and c:IsAbleToDeck()
end
function s.drtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK)
Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,1,tp,LOCATION_GRAVE)
end
function s.drop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 and Duel.SendtoGrave(g,REASON_EFFECT)~=0 then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local tg=Duel.SelectMatchingCard(tp,s.tdfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.SendtoDeck(tg,1-tp,SEQ_DECKSHUFFLE,REASON_EFFECT)
end
end
function s.specialsum(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(1109)
e1:SetCategory(CATEGORY_SEARCH+CATEGORY_TODECK+CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_TO_HAND)
e1:SetCountLimit(1,id)
e1:SetTarget(s.thtg)
e1:SetOperation(s.thop)
c:RegisterEffect(e1)
end
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_TODECK,e:GetHandler(),1,0,0)
end
function s.thfilter(c)
return c:IsLevel(1) and c:IsRace(RACE_ROCK) and c:IsAbleToHand()
end
function s.thop(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsRelateToEffect(e) and Duel.SetLP(tp,Duel.GetLP(tp)-800)~=0 then
Duel.SendtoDeck(e:GetHandler(),1-tp,SEQ_DECKSHUFFLE,REASON_EFFECT)
local g=Duel.GetMatchingGroup(s.thfilter,tp,LOCATION_DECK,0,nil)
if g:GetCount()>0 and Duel.SelectYesNo(tp,1109) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local sg=g:Select(tp,1,1,nil)
Duel.SendtoHand(sg,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,sg)
end
end
end
--感情结晶体
local s,id,o=GetID()
function s.initial_effect(c)
--fusion material
aux.AddFusionProcFunFunRep(c,aux.FilterBoolFunction(Card.IsFusionType,TYPE_EFFECT),aux.FilterBoolFunction(Card.IsRace,RACE_ROCK),2,63,true)
s.eq2(c)
s.speialsum(c)
end
function s.speialsum(c)
--Special Summon
local e2=Effect.CreateEffect(c)
e2:SetDescription(2)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_DESTROYED)
e2:SetCountLimit(1,id)
e2:SetCondition(s.spcon2)
e2:SetTarget(s.sptg2)
e2:SetOperation(s.spop2)
c:RegisterEffect(e2)
end
function s.spcon2(e,tp,eg,ep,ev,re,r,rp)
return bit.band(r,REASON_EFFECT+REASON_BATTLE)~=0 and e:GetHandler():IsPreviousLocation(LOCATION_ONFIELD)
end
function s.spfilter(c,e,tp)
local b1=c:IsAbleToHand()
local b2=Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP)
return c:IsType(TYPE_NORMAL) and c:IsRace(RACE_ROCK) and c:IsLevel(1) and (b1 or b2)
end
function s.sptg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK+LOCATION_GRAVE)
end
function s.spop2(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SELECT)
local tc=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.spfilter),tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil,e,tp):GetFirst()
if not tc then return end
local b1=tc:IsAbleToHand()
local b2=Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and tc:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP)
if aux.SelectFromOptions(tp,{b1,1190},{b2,2})==1 then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tc)
else
Duel.SpecialSummon(tcg,0,tp,tp,false,false,POS_FACEUP_DEFENSE)
end
end
function s.eq2(c)
--destroy
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(20366274,1))
e4:SetCategory(CATEGORY_DESTROY)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e4:SetCode(EVENT_BATTLE_START)
e4:SetCondition(s.descon)
e4:SetTarget(s.destg)
e4:SetOperation(s.desop)
c:RegisterEffect(e4)
end
function s.descon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local bc=c:GetBattleTarget()
return bc and bc:IsSummonType(SUMMON_TYPE_SPECIAL)
end
function s.destg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_DESTROY,e:GetHandler():GetBattleTarget(),1,0,0)
end
function s.desop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local bc=c:GetBattleTarget()
if bc:IsRelateToBattle() then
if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 or c:IsFacedown() or not c:IsRelateToEffect(e) then return end
if bc:IsRelateToEffect(e) then
if not Duel.Equip(tp,c,bc) then return end
local e1=Effect.CreateEffect(c)
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)
e1:SetLabelObject(bc)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_EQUIP)
e2:SetCode(EFFECT_CHANGE_RACE)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
e2:SetValue(RACE_ROCK)
c:RegisterEffect(e2)
--control
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_EQUIP)
e3:SetCode(EFFECT_SET_CONTROL)
e3:SetReset(RESET_EVENT+RESETS_STANDARD)
e3:SetValue(s.cval)
c:RegisterEffect(e3)
end
end
end
function s.atk(c)
--spsummon success
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
e3:SetCondition(s.sumcon)
e3:SetOperation(s.sucop)
c:RegisterEffect(e3)
end
function s.sumcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_FUSION)
end
function s.sucop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_BASE_ATTACK)
e1:SetValue(c:GetMaterialCount()*400)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_SET_BASE_DEFENSE)
c:RegisterEffect(e2)
local e3=e1:Clone()
e3:SetCode(EFFECT_EXTRA_ATTACK_MONSTER)
e3:SetValue(c:GetMaterialCount()-1)
e3:SetReset(RESET_EVENT+RESETS_STANDARD)
c:RegisterEffect(e3)
end
function s.equip(c)
--ntr
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_CONTROL)
e1:SetDescription(aux.Stringid(80117527,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+TIMING_MAIN_END)
e1:SetCountLimit(1,EFFECT_COUNT_CODE_CHAIN)
e1:SetCondition(s.eqcon)
e1:SetTarget(s.eqtg)
e1:SetOperation(s.eqop)
c:RegisterEffect(e1)
end
function s.eqcon(e,tp,eg,ep,ev,re,r,rp)
local ph=Duel.GetCurrentPhase()
return ph==PHASE_MAIN1 or ph==PHASE_MAIN2
end
function s.eqfilter(c,atk)
return c:IsFaceup() and c:IsAttackBelow(atk)
end
function s.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local c=e:GetHandler()
local atk=c:GetAttack()
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and s.eqfilter(chkc,atk) end
if chk==0 then return Duel.IsExistingTarget(s.eqfilter,tp,0,LOCATION_MZONE,1,nil,atk) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
local g=Duel.SelectTarget(tp,s.eqfilter,tp,0,LOCATION_MZONE,1,1,nil,atk)
Duel.SetOperationInfo(0,CATEGORY_CONTROL,g,1,0,0)
end
function s.eqop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 or c:IsFacedown() or not c:IsRelateToEffect(e) then return end
if tc:IsRelateToEffect(e) then
if not Duel.Equip(tp,c,tc) then return end
local e1=Effect.CreateEffect(c)
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)
e1:SetLabelObject(tc)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_EQUIP)
e2:SetCode(EFFECT_CHANGE_RACE)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
e2:SetValue(RACE_ROCK)
c:RegisterEffect(e2)
--control
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_EQUIP)
e3:SetCode(EFFECT_SET_CONTROL)
e3:SetReset(RESET_EVENT+RESETS_STANDARD)
e3:SetValue(s.cval)
c:RegisterEffect(e3)
end
end
function s.eqlimit(e,c)
return c==e:GetLabelObject()
end
function s.cval(e,c)
return e:GetHandlerPlayer()
end
function s.toextra(c)
--token
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(9047460,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOKEN)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_LEAVE_FIELD)
e1:SetTarget(s.tktg)
e1:SetOperation(s.tkop)
c:RegisterEffect(e1)
end
function s.tktg(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 s.tkop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and c:IsExtraDeckMonster() then
Duel.SendtoDeck(c,nil,SEQ_DECKTOP,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:SetCategory(CATEGORY_TOGRAVE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,id)
e1:SetTarget(s.target)
e1:SetOperation(s.activate)
c:RegisterEffect(e1)
s.setthiscard(c)
end
function s.tgfilter(c)
return c:IsRace(RACE_ROCK) and c:IsAbleToGrave()
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.tgfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK)
end
function s.cfilter1(c)
return c:IsFaceup() and c:IsRace(RACE_ROCK) and c:IsType(TYPE_NORMAL)
end
function s.cfilter2(c)
return c:IsFaceup() and c:IsSummonType(SUMMON_TYPE_ADVANCE)
end
function s.cfilter3(c)
return c:IsFaceup() and c:IsType(TYPE_FUSION)
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,s.tgfilter,tp,LOCATION_DECK,0,1,1,nil)
local tc=g:GetFirst()
if tc and Duel.SendtoGrave(tc,REASON_EFFECT)>0 and tc:IsLocation(LOCATION_GRAVE) and tc:IsRace(RACE_ROCK) and tc:IsType(TYPE_NORMAL)
and Duel.IsExistingMatchingCard(s.tgfilter,tp,LOCATION_DECK,0,1,nil)
and Duel.SelectYesNo(tp,aux.Stringid(id,0)) then
local ct=0
if Duel.IsExistingMatchingCard(s.cfilter1,tp,LOCATION_MZONE,0,1,nil) then ct=ct+1 end
if Duel.IsExistingMatchingCard(s.cfilter2,tp,LOCATION_MZONE,0,1,nil) then ct=ct+1 end
if Duel.IsExistingMatchingCard(s.cfilter3,tp,LOCATION_MZONE,0,1,nil) then ct=ct+1 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g1=Duel.SelectMatchingCard(tp,s.tgfilter,tp,LOCATION_DECK,0,1,ct,nil)
Duel.SendtoGrave(g1,REASON_EFFECT)
end
end
function s.setthiscard(c)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_TO_GRAVE)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCountLimit(1,id+114)
e2:SetCondition(s.setcon)
e2:SetTarget(s.settg)
e2:SetOperation(s.setop)
c:RegisterEffect(e2)
end
function s.setcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsReason(REASON_COST) and re:IsActivated() and re:IsActiveType(TYPE_MONSTER)
end
function s.settg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsSSetable() end
Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,c,1,0,0)
end
function s.setop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then Duel.SSet(tp,c) end
end
\ No newline at end of file
--Biboo的游戏
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)
c:RegisterEffect(e1)
s.selecteff(c)
s.tofiled(c)
end
function s.tofiled(c)
--set
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_GRAVE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCountLimit(1,id+114)
e1:SetTarget(s.settg)
e1:SetOperation(s.setop)
c:RegisterEffect(e1)
end
function s.releasefilter(c)
return c:IsFaceup() and c:IsRace(RACE_ROCK)
end
function s.settg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and s.releasefilter(chkc) end
if chk==0 then return e:GetHandler():IsType(TYPE_FIELD)
and Duel.IsExistingTarget(s.releasefilter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,s.releasefilter,tp,LOCATION_MZONE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,e:GetHandler(),1,0,0)
end
function s.setop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc and tc:IsRelateToEffect(e) and c:IsRelateToEffect(e)
and c:IsType(TYPE_FIELD) and Duel.Destroy(tc,REASON_EFFECT)~=0 then
local fc=Duel.GetFieldCard(tp,LOCATION_FZONE,0)
if fc then
Duel.SendtoGrave(fc,REASON_RULE)
Duel.BreakEffect()
end
Duel.MoveToField(e:GetHandler(),tp,tp,LOCATION_FZONE,POS_FACEUP,true)
end
end
function s.selecteff(c)
--to hand
local e2=Effect.CreateEffect(c)
e2:SetDescription(1150)
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH+CATEGORY_SUMMON+CATEGORY_DESTROY)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_SUMMON_SUCCESS)
e2:SetCountLimit(1,id)
e2:SetRange(LOCATION_SZONE)
e2:SetCondition(s.thcon)
e2:SetTarget(s.thtg)
e2:SetOperation(s.thop)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e3)
local e4=e2:Clone()
e4:SetCode(EVENT_FLIP_SUMMON_SUCCESS)
c:RegisterEffect(e4)
end
function s.cfilter(c)
return c:IsFaceup() and c:IsRace(RACE_ROCK)
end
function s.thcon(e,tp,eg,ep,ev,re,r,rp)
if #eg>1 then return false end
return eg:IsExists(s.cfilter,1,nil,e)
end
function s.thfilter(c)
return c:IsRace(RACE_ROCK) and c:IsLevel(1)
end
function s.adfilter(c)
return c:IsSummonable(true,nil,1) or c:IsMSetable(true,nil,1)
end
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
end
function s.thop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=eg:GetFirst()
local p=tc:GetSummonPlayer()
local b1=Duel.IsExistingMatchingCard(s.adfilter,p,LOCATION_HAND,0,1,nil)
local b2=tc:IsDestructable()
if b2 and (not b1 or Duel.SelectOption(p,1167,1101)==1) then
local g=Duel.GetMatchingGroup(s.thfilter,p,LOCATION_DECK,0,nil)
if Duel.Destroy(tc,REASON_EFFECT)~=0 and g:GetCount()>0
and Duel.SelectYesNo(p,1109) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,p,HINTMSG_ATOHAND)
local sg=g:Select(p,1,1,nil)
if #sg>0 then
Duel.SendtoHand(sg,nil,REASON_EFFECT)
Duel.ConfirmCards(1-p,sg)
end
end
else
Duel.Hint(HINT_SELECTMSG,p,HINTMSG_SUMMON)
local g=Duel.SelectMatchingCard(tp,s.adfilter,p,LOCATION_HAND,0,1,1,nil)
local tc=g:GetFirst()
if tc then
local s1=tc:IsSummonable(true,nil,1)
local s2=tc:IsMSetable(true,nil,1)
if (s1 and s2 and Duel.SelectPosition(p,tc,POS_FACEUP_ATTACK+POS_FACEDOWN_DEFENSE)==POS_FACEUP_ATTACK) or not s2 then
Duel.Summon(p,tc,true,nil,1)
else
Duel.MSet(p,tc,true,nil,1)
end
end
end
end
\ No newline at end of file
--小石头
local s,id,o=GetID()
function s.initial_effect(c)
s.rockguy(c)
s.todeck(c)
end
function s.todeck(c)
--to deck
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_TODECK)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_GRAVE)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetCountLimit(1,id+114)
e3:SetTarget(s.tdtg)
e3:SetOperation(s.tdop)
c:RegisterEffect(e3)
end
function s.tdfilter(c,e,tp)
return c:IsRace(RACE_ROCK) and c:IsType(TYPE_NORMAL) and c:IsLevelBelow(4) and c:IsAbleToDeck()
end
function s.tdtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsAbleToDeck() and chkc~=e:GetHandler() end
if chk==0 then return e:GetHandler():IsAbleToDeck() and Duel.IsPlayerCanDraw(tp,1)
and Duel.IsExistingTarget(s.tdfilter,tp,LOCATION_GRAVE,0,1,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectTarget(tp,s.tdfilter,tp,LOCATION_GRAVE,0,1,1,e:GetHandler())
g:AddCard(e:GetHandler())
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,2,0,0)
end
function s.tdop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
local g=Group.FromCards(c,tc)
if c:IsRelateToEffect(e) and tc:IsRelateToEffect(e)
and Duel.SendtoDeck(g,nil,SEQ_DECKBOTTOM,REASON_EFFECT)~=0 and Duel.IsPlayerCanDraw(tp,1) then
Duel.Draw(tp,1,REASON_EFFECT)
end
end
function s.rockguy(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,id)
e1:SetTarget(s.target)
e1:SetOperation(s.activate)
c:RegisterEffect(e1)
end
function s.filter(c,e,tp)
return c:IsRace(RACE_ROCK) and c:IsType(TYPE_NORMAL) and c:IsLevelBelow(4)
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.filter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function s.activate(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,s.filter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
--魔人 Bijou
local s,id,o=GetID()
function s.initial_effect(c)
s.specialsum(c)
s.searchcard(c)
end
function s.searchcard(c)
--to hand
local e1=Effect.CreateEffect(c)
e1:SetDescription(1109)
e1:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetCountLimit(1,id+114)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCondition(s.seacon)
e1:SetTarget(s.seatg)
e1:SetOperation(s.seaop)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e2)
end
function s.seacon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFlagEffect(tp,id)~=0
end
function s.searchfilter(c)
return c:IsRace(RACE_ROCK) and c:IsLevel(1) and c:IsAbleToHand()
end
function s.seatg(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.seaop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetFlagEffect(tp,id)==0 then return end
local p=e:GetHandler():GetOwner()
Duel.Hint(HINT_SELECTMSG,p,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(p,s.searchfilter,p,LOCATION_DECK,0,1,1,nil)
if #g>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-p,g)
end
end
function s.specialsum(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(1109)
e1:SetCategory(CATEGORY_DESTROY+CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_TO_HAND)
e1:SetCountLimit(1,id)
e1:SetTarget(s.thtg)
e1:SetOperation(s.thop)
c:RegisterEffect(e1)
end
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local g=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_ONFIELD+LOCATION_HAND,0,e:GetHandler())
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE+LOCATION_HAND)
end
function s.thfilter(c,e,tp)
return c:IsLevel(1) and c:IsRace(RACE_ROCK) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function s.fselect(g,e,tp)
return Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_GRAVE+LOCATION_HAND,0,1,nil,e,tp)
and Duel.GetMZoneCount(tp,g,tp)>0
end
function s.thop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_ONFIELD+LOCATION_HAND,0,c)
if not g:CheckSubGroup(s.fselect,1,1,e,tp) then return end
Duel.RegisterFlagEffect(tp,id,RESET_PHASE+PHASE_END,0,1)
Duel.RegisterFlagEffect(1-tp,id,RESET_PHASE+PHASE_END,0,1)
local sg=Duel.GetMatchingGroup(aux.NecroValleyFilter(s.thfilter),tp,LOCATION_GRAVE+LOCATION_HAND,0,nil,e,tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local dg=g:SelectSubGroup(tp,s.fselect,false,1,1,e,tp)
if g:GetCount()>0 and Duel.Destroy(dg,REASON_EFFECT)~=0 and #sg>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sc=sg:Select(tp,1,1,nil):GetFirst()
if sc and Duel.SpecialSummon(sc,0,tp,tp,false,false,POS_FACEUP)~=0 then
--
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_FUSION_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE)
--e2:SetCountLimit(1)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
e2:SetTarget(s.target)
e2:SetOperation(s.operation)
sc:RegisterEffect(e2)
end
end
end
function s.filter1(c,e)
return not c:IsImmuneToEffect(e)
end
function s.filter2(c,e,tp,m,f,gc,chkf)
return c:IsType(TYPE_FUSION) and (not f or f(c))
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false) and c:CheckFusionMaterial(m,gc,chkf)
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then
local chkf=tp
local mg1=Duel.GetFusionMaterial(tp)
local res=Duel.IsExistingMatchingCard(s.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg1,nil,c,chkf)
if not res then
local ce=Duel.GetChainMaterial(tp)
if ce~=nil then
local fgroup=ce:GetTarget()
local mg2=fgroup(ce,e,tp)
local mf=ce:GetValue()
res=Duel.IsExistingMatchingCard(s.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg2,mf,c,chkf)
end
end
return res
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function s.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local chkf=tp
if not c:IsRelateToEffect(e) or c:IsImmuneToEffect(e) then return end
local mg1=Duel.GetFusionMaterial(tp):Filter(s.filter1,nil,e)
local sg1=Duel.GetMatchingGroup(s.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg1,nil,c,chkf)
local mg2=nil
local sg2=nil
local ce=Duel.GetChainMaterial(tp)
if ce~=nil then
local fgroup=ce:GetTarget()
mg2=fgroup(ce,e,tp)
local mf=ce:GetValue()
sg2=Duel.GetMatchingGroup(s.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg2,mf,c,chkf)
end
if sg1:GetCount()>0 or (sg2~=nil and sg2:GetCount()>0) then
local sg=sg1:Clone()
if sg2 then sg:Merge(sg2) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tg=sg:Select(tp,1,1,nil)
local tc=tg:GetFirst()
if sg1:IsContains(tc) and (sg2==nil or not sg2:IsContains(tc) or not Duel.SelectYesNo(tp,ce:GetDescription())) then
local mat1=Duel.SelectFusionMaterial(tp,tc,mg1,c,chkf)
tc:SetMaterial(mat1)
Duel.SendtoGrave(mat1,REASON_EFFECT+REASON_MATERIAL+REASON_FUSION)
Duel.BreakEffect()
Duel.SpecialSummon(tc,SUMMON_TYPE_FUSION,tp,tp,false,false,POS_FACEUP)
else
local mat2=Duel.SelectFusionMaterial(tp,tc,mg2,c,chkf)
local fop=ce:GetOperation()
fop(ce,e,tp,tc,mat2)
end
tc:CompleteProcedure()
end
end
\ No newline at end of file
--魔人 Bijou
local s,id,o=GetID()
function s.initial_effect(c)
s.specialsum(c)
s.searchcard(c)
end
function s.searchcard(c)
--to hand
local e1=Effect.CreateEffect(c)
e1:SetDescription(1109)
e1:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetCountLimit(1,id)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetTarget(s.seatg)
e1:SetOperation(s.seaop)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e2)
end
function s.searchfilter(c)
return c:IsSetCard(0x5527) and c:IsAbleToHand()
end
function s.seatg(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.seaop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetFlagEffect(tp,id)==0 then return end
local p=e:GetOwner()
Duel.Hint(HINT_SELECTMSG,p,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(p,s.searchfilter,p,LOCATION_DECK,0,1,1,nil)
if #g>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-p,g)
end
end
function s.specialsum(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(1109)
e1:SetCategory(CATEGORY_DESTROY+CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_TO_HAND)
e1:SetCountLimit(1,id)
e1:SetTarget(s.thtg)
e1:SetOperation(s.thop)
c:RegisterEffect(e1)
end
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local g=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_ONFIELD+LOCATION_HAND,0,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE+LOCATION_HAND)
end
function s.thfilter(c,e,tp)
return c:IsLevel(1) and c:IsRace(RACE_ROCK) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function s.fselect(g,e,tp)
return Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_GRAVE+LOCATION_HAND,0,1,nil,e,tp)
and Duel.GetMZoneCount(tp,g,tp)>0
end
function s.thop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_ONFIELD+LOCATION_HAND,0,nil)
if not g:CheckSubGroup(s.fselect,1,1,e,tp) then return end
Duel.RegisterFlagEffect(tp,id,RESET_PHASE+PHASE_END,0,1)
Duel.RegisterFlagEffect(1-tp,id,RESET_PHASE+PHASE_END,0,1)
local sg=Duel.GetMatchingGroup(aux.NecroValleyFilter(s.thfilter),tp,LOCATION_GRAVE+LOCATION_HAND,0,nil,e,tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local dg=g:SelectSubGroup(tp,s.fselect,false,1,1,e,tp)
if g:GetCount()>0 and Duel.Destroy(dg,REASON_EFFECT)~=0 and #sg>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sc=sg:Select(tp,1,1,nil):GetFirst()
if sc and Duel.SpecialSummon(sc,0,tp,tp,false,false,POS_FACEUP)~=0 then
--
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_FUSION_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE)
--e2:SetCountLimit(1)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
e2:SetTarget(s.target)
e2:SetOperation(s.operation)
sc:RegisterEffect(e2)
end
end
end
function s.filter1(c,e)
return not c:IsImmuneToEffect(e)
end
function s.filter2(c,e,tp,m,f,gc,chkf)
return c:IsType(TYPE_FUSION) and (not f or f(c))
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false) and c:CheckFusionMaterial(m,gc,chkf)
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then
local chkf=tp
local mg1=Duel.GetFusionMaterial(tp)
local res=Duel.IsExistingMatchingCard(s.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg1,nil,c,chkf)
if not res then
local ce=Duel.GetChainMaterial(tp)
if ce~=nil then
local fgroup=ce:GetTarget()
local mg2=fgroup(ce,e,tp)
local mf=ce:GetValue()
res=Duel.IsExistingMatchingCard(s.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg2,mf,c,chkf)
end
end
return res
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function s.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local chkf=tp
if not c:IsRelateToEffect(e) or c:IsImmuneToEffect(e) then return end
local mg1=Duel.GetFusionMaterial(tp):Filter(s.filter1,nil,e)
local sg1=Duel.GetMatchingGroup(s.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg1,nil,c,chkf)
local mg2=nil
local sg2=nil
local ce=Duel.GetChainMaterial(tp)
if ce~=nil then
local fgroup=ce:GetTarget()
mg2=fgroup(ce,e,tp)
local mf=ce:GetValue()
sg2=Duel.GetMatchingGroup(s.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg2,mf,c,chkf)
end
if sg1:GetCount()>0 or (sg2~=nil and sg2:GetCount()>0) then
local sg=sg1:Clone()
if sg2 then sg:Merge(sg2) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tg=sg:Select(tp,1,1,nil)
local tc=tg:GetFirst()
if sg1:IsContains(tc) and (sg2==nil or not sg2:IsContains(tc) or not Duel.SelectYesNo(tp,ce:GetDescription())) then
local mat1=Duel.SelectFusionMaterial(tp,tc,mg1,c,chkf)
tc:SetMaterial(mat1)
Duel.SendtoGrave(mat1,REASON_EFFECT+REASON_MATERIAL+REASON_FUSION)
Duel.BreakEffect()
Duel.SpecialSummon(tc,SUMMON_TYPE_FUSION,tp,tp,false,false,POS_FACEUP)
else
local mat2=Duel.SelectFusionMaterial(tp,tc,mg2,c,chkf)
local fop=ce:GetOperation()
fop(ce,e,tp,tc,mat2)
end
tc:CompleteProcedure()
end
end
\ No newline at end of file
--魔人 Bijou
local s,id,o=GetID()
function s.initial_effect(c)
s.specialrule(c)
s.tograve(c)
s.speialsum(c)
end
function s.speialsum(c)
--Special Summon
local e2=Effect.CreateEffect(c)
e2:SetDescription(2)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_DESTROYED)
e2:SetCountLimit(1,id)
e2:SetCondition(s.spcon2)
e2:SetTarget(s.sptg2)
e2:SetOperation(s.spop2)
c:RegisterEffect(e2)
end
function s.spcon2(e,tp,eg,ep,ev,re,r,rp)
return bit.band(r,REASON_EFFECT+REASON_BATTLE)~=0 and e:GetHandler():IsPreviousLocation(LOCATION_ONFIELD)
end
function s.spfilter(c,e,tp)
local b1=c:IsAbleToHand()
local b2=Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP)
return c:IsType(TYPE_NORMAL) and c:IsRace(RACE_ROCK) and c:IsLevel(1) and (b1 or b2)
end
function s.sptg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK+LOCATION_GRAVE)
end
function s.spop2(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SELECT)
local tc=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.spfilter),tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil,e,tp):GetFirst()
if not tc then return end
local b1=tc:IsAbleToHand()
local b2=Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and tc:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP)
if aux.SelectFromOptions(tp,{b1,1190},{b2,2})==1 then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tc)
else
Duel.SpecialSummon(tcg,0,tp,tp,false,false,POS_FACEUP_DEFENSE)
end
end
function s.SpecialSummon(c)
--destroy
local e3=Effect.CreateEffect(c)
e3:SetDescription(2)
e3:SetCategory(CATEGORY_DESTROY+CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetRange(LOCATION_GRAVE)
e3:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e3:SetTarget(s.sptg)
e3:SetOperation(s.spop)
c:RegisterEffect(e3)
end
function s.tfilter(c,tp)
return c:IsFaceup() and Duel.GetMZoneCount(tp,c)>0 and c:IsRace(RACE_ROCK)
end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local c=e:GetHandler()
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and s.tfilter(chkc,tp) end
if chk==0 then return c:IsCanBeSpecialSummoned(e,0,tp,false,false)
and Duel.IsExistingTarget(s.tfilter,tp,LOCATION_MZONE,0,1,nil,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,s.tfilter,tp,LOCATION_MZONE,0,1,1,nil,tp)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
end
function s.spop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.Destroy(tc,REASON_EFFECT)~=0 then
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
end
end
function s.tograve(c)
--destroy
local e3=Effect.CreateEffect(c)
e3:SetDescription(1108)
e3:SetCategory(CATEGORY_TOGRAVE+CATEGORY_ATKCHANGE+CATEGORY_DESTROY)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetRange(LOCATION_MZONE)
e3:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e3:SetCost(s.tgcost)
e3:SetTarget(s.tgtg)
e3:SetOperation(s.tgop)
c:RegisterEffect(e3)
end
function s.tgcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsReleasable() end
Duel.Release(e:GetHandler(),REASON_COST)
end
function s.tgtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDiscardDeck(1-tp,1) end
end
function s.tgfilter(c)
return c:IsLevel(1) and c:IsAbleToGrave() and c:IsRace(RACE_ROCK)
end
function s.tgop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetFieldGroup(tp,0,LOCATION_DECK)
if g:GetCount()<1 then return end
Duel.ConfirmCards(tp,g)
local sg=Duel.GetMatchingGroup(s.tgfilter,tp,0,LOCATION_DECK,nil)
local ct=Duel.SendtoGrave(sg,REASON_EFFECT)
if ct==0 then return end
Duel.BreakEffect()
local dg=Group.CreateGroup()
local tg=Duel.GetMatchingGroup(Card.IsFaceup,tp,0,LOCATION_MZONE,nil)
for tc in aux.Next(tg) do
local preatk=tc:GetAttack()
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
e1:SetValue(-ct*600)
tc:RegisterEffect(e1)
if preatk~=0 and tc:IsAttack(0) then dg:AddCard(tc) end
end
Duel.Destroy(dg,REASON_EFFECT)
end
function s.specialrule(c)
c:SetSPSummonOnce(id)
c:EnableReviveLimit()
--material
aux.AddFusionProcFun2(c,s.matfilter,aux.FilterBoolFunction(Card.IsFusionType,TYPE_EFFECT),true)
end
function s.matfilter(c)
return c:IsFusionAttribute(ATTRIBUTE_EARTH) or c:IsRace(RACE_ROCK)
end
\ No newline at end of file
--小鬼 Biboo
local s,id,o=GetID()
function s.initial_effect(c)
s.specialrule(c)
s.setfield(c)
s.speialsum(c)
--s.damage(c)
end
function s.speialsum(c)
--Special Summon
local e2=Effect.CreateEffect(c)
e2:SetDescription(2)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_DESTROYED)
e2:SetCountLimit(1,id)
e2:SetCondition(s.spcon2)
e2:SetTarget(s.sptg2)
e2:SetOperation(s.spop2)
c:RegisterEffect(e2)
end
function s.spcon2(e,tp,eg,ep,ev,re,r,rp)
return bit.band(r,REASON_EFFECT+REASON_BATTLE)~=0 and e:GetHandler():IsPreviousLocation(LOCATION_ONFIELD)
end
function s.spfilter(c,e,tp)
local b1=c:IsAbleToHand()
local b2=Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP)
return c:IsType(TYPE_NORMAL) and c:IsRace(RACE_ROCK) and c:IsLevel(1) and (b1 or b2)
end
function s.sptg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK+LOCATION_GRAVE)
end
function s.spop2(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SELECT)
local tc=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.spfilter),tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil,e,tp):GetFirst()
if not tc then return end
local b1=tc:IsAbleToHand()
local b2=Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and tc:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP)
if aux.SelectFromOptions(tp,{b1,1190},{b2,2})==1 then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tc)
else
Duel.SpecialSummon(tcg,0,tp,tp,false,false,POS_FACEUP_DEFENSE)
end
end
function s.damage(c)
--Special Summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(1122)
e1:SetCategory(CATEGORY_DAMAGE)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_DESTROYED)
e1:SetCountLimit(1,id)
e1:SetTarget(s.damtg)
e1:SetOperation(s.damop)
c:RegisterEffect(e1)
end
function s.filter2(c)
return c:IsCode(31300056) and not c:IsForbidden()
end
function s.damtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return (Duel.GetLocationCount(tp,LOCATION_SZONE)>0 or Duel.GetLocationCount(1-tp,LOCATION_SZONE)>0)
and Duel.IsExistingMatchingCard(s.filter2,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil) end
end
function s.damop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOFIELD)
local tc=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.filter2),tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil,tp):GetFirst()
local b1=Duel.GetLocationCount(tp,LOCATION_SZONE)>0
local b2=Duel.GetLocationCount(1-tp,LOCATION_SZONE)>0
local op=aux.SelectFromOptions(tp,{b1,102},{b2,103})
local p=tp
if op==2 then p=1-tp end
Duel.MoveToField(tc,tp,p,LOCATION_SZONE,POS_FACEUP,true)
end
function s.setfield(c)
--des
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_DELAY)
--e1:SetCondition(s.sumcon)
e1:SetTarget(s.destg)
e1:SetOperation(s.desop)
c:RegisterEffect(e1)
end
function s.filter(c,tp)
local b1=c:IsCode(31300048) and c:IsType(TYPE_FIELD)
local b2=c:IsCode(31300056) and (Duel.GetLocationCount(tp,LOCATION_SZONE)>0 or Duel.GetLocationCount(1-tp,LOCATION_SZONE)>0)
return (b1 or b2) and not c:IsForbidden()
end
function s.destg(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,tp) end
end
function s.desop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOFIELD)
local tc=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.filter),tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil,tp):GetFirst()
if tc:IsCode(31300048) then
local p=0
if Duel.SelectOption(tp,102,103)==1 then
p=1-tp
else
p=tp
end
if tc then
local fc=Duel.GetFieldCard(p,LOCATION_FZONE,0)
if fc then
Duel.SendtoGrave(fc,REASON_RULE)
Duel.BreakEffect()
end
Duel.MoveToField(tc,tp,p,LOCATION_FZONE,POS_FACEUP,true)
end
end
if tc:IsCode(31300056) then
local op=aux.SelectFromOptions(tp,{Duel.GetLocationCount(tp,LOCATION_SZONE)>0,102},{Duel.GetLocationCount(1-tp,LOCATION_SZONE)>0,103})
if op==2 then
p=1-tp
else
p=tp
end
Duel.MoveToField(tc,tp,p,LOCATION_SZONE,POS_FACEUP,true)
end
end
function s.specialrule(c)
c:EnableReviveLimit()
--material
aux.AddFusionProcFun2(c,s.matfilter,aux.FilterBoolFunction(Card.IsFusionType,TYPE_EFFECT),true)
end
function s.matfilter(c)
return c:IsFusionAttribute(ATTRIBUTE_EARTH) or c:IsRace(RACE_ROCK)
end
\ No newline at end of file
--盛夏 Bijou
local s,id,o=GetID()
function s.initial_effect(c)
s.todeck(c)
s.speialsum(c)
end
function s.speialsum(c)
--Special Summon
local e2=Effect.CreateEffect(c)
e2:SetDescription(2)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_DESTROYED)
e2:SetCountLimit(1,id)
e2:SetCondition(s.spcon2)
e2:SetTarget(s.sptg2)
e2:SetOperation(s.spop2)
c:RegisterEffect(e2)
end
function s.spcon2(e,tp,eg,ep,ev,re,r,rp)
return bit.band(r,REASON_EFFECT+REASON_BATTLE)~=0 and e:GetHandler():IsPreviousLocation(LOCATION_ONFIELD)
end
function s.spfilter(c,e,tp)
local b1=c:IsAbleToHand()
local b2=Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP)
return c:IsType(TYPE_NORMAL) and c:IsRace(RACE_ROCK) and c:IsLevel(1) and (b1 or b2)
end
function s.sptg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK+LOCATION_GRAVE)
end
function s.spop2(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SELECT)
local tc=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.spfilter),tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil,e,tp):GetFirst()
if not tc then return end
local b1=tc:IsAbleToHand()
local b2=Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and tc:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP)
if aux.SelectFromOptions(tp,{b1,1190},{b2,2})==1 then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tc)
else
Duel.SpecialSummon(tcg,0,tp,tp,false,false,POS_FACEUP_DEFENSE)
end
end
function s.specialsum(c)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(2)
e1:SetCategory(CATEGORY_DRAW+CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_ATTACK_ANNOUNCE)
e1:SetRange(LOCATION_GRAVE)
e1:SetCountLimit(1,id)
e1:SetCost(aux.bfgcost)
e1:SetCondition(s.condition)
e1:SetTarget(s.target)
e1:SetOperation(s.operation)
c:RegisterEffect(e1)
end
function s.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetAttacker():GetControler()~=tp
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDraw(tp,1) end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(1)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end
function s.operation(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
local a=Duel.GetAttacker()
if Duel.Draw(p,d,REASON_EFFECT)~=0 then
local tc=Duel.GetOperatedGroup():GetFirst()
if a and tc:IsRace(RACE_ROCK) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and tc:IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.SelectYesNo(tp,2) then
Duel.BreakEffect()
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
Duel.CalculateDamage(a,tc)
end
end
end
function s.todeck(c)
--fusion material
c:EnableReviveLimit()
aux.AddFusionProcCodeFun(c,s.ffilter,aux.FilterBoolFunction(Card.IsFusionType,TYPE_EFFECT),1,true,true)
--to hand
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_TODECK)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_DELAY)
--e1:SetCountLimit(1,id)
e1:SetTarget(s.thtg)
e1:SetOperation(s.thop)
c:RegisterEffect(e1)
end
function s.ffilter(c)
return c:IsRace(RACE_ROCK) or c:IsFusionAttribute(ATTRIBUTE_EARTH)
end
function s.thfilter(c)
return c:IsRace(RACE_ROCK) and (c:IsAbleToDeck() or c:IsLocation(LOCATION_DECK))
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_GRAVE,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,1,tp,LOCATION_DECK+LOCATION_GRAVE)
end
function s.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.thfilter),tp,LOCATION_DECK+LOCATION_GRAVE,0,1,4,nil)
if g:GetCount()>0 then
Duel.SendtoDeck(g,1-tp,SEQ_DECKSHUFFLE,REASON_EFFECT)
end
end
\ No newline at end of file
--捣乱的Biboo
local s,id,o=GetID()
function s.initial_effect(c)
s.av(c)
s.tohandself(c)
end
function s.tohandself(c)
--set
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_GRAVE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCountLimit(1,id+114)
e1:SetTarget(s.settg)
e1:SetOperation(s.setop)
c:RegisterEffect(e1)
end
function s.releasefilter(c)
return c:IsFaceup() and c:IsRace(RACE_ROCK)
end
function s.settg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local c=e:GetHandler()
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and s.releasefilter(chkc) end
if chk==0 then return c:IsAbleToHand() and Duel.IsExistingTarget(s.releasefilter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,s.releasefilter,tp,LOCATION_MZONE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,e:GetHandler(),1,0,0)
end
function s.setop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc and tc:IsRelateToEffect(e) and c:IsRelateToEffect(e) and Duel.Destroy(tc,REASON_EFFECT)~=0 then
Duel.BreakEffect()
Duel.SendtoHand(c,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,c)
end
end
function s.set(c)
--draw
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(17626381,0))
e2:SetCategory(CATEGORY_TODECK+CATEGORY_DRAW)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e2:SetRange(LOCATION_GRAVE)
e2:SetCode(EVENT_DESTROYED)
e2:SetCondition(s.drcon)
e2:SetTarget(s.settg)
e2:SetOperation(s.setop)
c:RegisterEffect(e2)
end
function s.settg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local c=e:GetHandler()
if chkc then return s.cfilter(chkc,tp) end
if chk==0 then return eg:IsExists(s.cfilter,1,nil,tp) and Duel.GetLocationCount(tp,LOCATION_SZONE)>0 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local sc=eg:FilterSelect(tp,s.cfilter,1,1,nil,tp)
Duel.SetTargetCard(sc)
Duel.SetOperationInfo(0,CATEGORY_TODECK,sc,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,c,1,0,0)
end
function s.setop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.SendtoDeck(tc,nil,SEQ_DECKBOTTOM,REASON_EFFECT)>0 then
local c=e:GetHandler()
if c:IsRelateToEffect(e) and Duel.GetLocationCount(tp,LOCATION_SZONE)>0 then
Duel.BreakEffect()
Duel.MoveToField(c,tp,tp,LOCATION_SZONE,POS_FACEUP,true)
end
end
end
function s.av(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--draw
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(17626381,0))
e2:SetCategory(CATEGORY_TODECK+CATEGORY_DRAW)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e2:SetRange(LOCATION_SZONE)
e2:SetCode(EVENT_DESTROYED)
e2:SetCondition(s.drcon)
e2:SetTarget(s.drtg)
e2:SetOperation(s.drop)
c:RegisterEffect(e2)
end
function s.cfilter(c,tp)
return c:IsReason(REASON_BATTLE+REASON_EFFECT) and c:IsPreviousLocation(LOCATION_MZONE) and c:IsPreviousControler(tp)
and c:IsRace(RACE_ROCK)
end
function s.drcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(s.cfilter,1,nil,tp)
end
function s.drtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,id)==0 end
Duel.RegisterFlagEffect(tp,id,RESET_CHAIN,EFFECT_FLAG_OATH,1)
Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,0,PLAYER_ALL,1)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,PLAYER_ALL,1)
end
function s.drop(e,tp,eg,ep,ev,re,r,rp)
local h1=Duel.GetFieldGroupCount(tp,LOCATION_HAND,0)
local h2=Duel.GetFieldGroupCount(tp,0,LOCATION_HAND)
local g=Duel.GetFieldGroup(tp,LOCATION_HAND,LOCATION_HAND)
Duel.SendtoDeck(g,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)
Duel.BreakEffect()
Duel.Draw(tp,h1,REASON_EFFECT)
Duel.Draw(1-tp,h2,REASON_EFFECT)
end
--石头 Bijou
local s,id,o=GetID()
function s.initial_effect(c)
s.specialsum(c)
s.search(c)
end
function s.search(c)
--summon success
local e1=Effect.CreateEffect(c)
e1:SetDescription(1109)
e1:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetTarget(s.addct)
e1:SetOperation(s.addc)
c:RegisterEffect(e1)
end
function s.filter(c)
return c:IsLevel(1) and c:IsRace(RACE_ROCK) and c:IsAbleToHand()
end
function s.addct(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.addc(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
function s.specialsum(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(1109)
e1:SetCategory(CATEGORY_DESTROY+CATEGORY_REMOVE)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_TO_HAND)
e1:SetCountLimit(1,id)
e1:SetTarget(s.thtg)
e1:SetOperation(s.thop)
c:RegisterEffect(e1)
end
function s.desfilter(c,tp)
return Duel.IsExistingMatchingCard(s.sumfilter,tp,LOCATION_HAND+LOCATION_MZONE,0,1,c)
end
function s.sumfilter(c)
return c:IsRace(RACE_ROCK) and c:IsSummonable(true,nil)
end
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local b1=Duel.IsExistingMatchingCard(s.desfilter,tp,LOCATION_ONFIELD+LOCATION_HAND,0,1,nil,tp)
local b2=Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,LOCATION_EXTRA,0,4,nil)
return b1 or b2 end
end
function s.thop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local b1=Duel.IsExistingMatchingCard(s.desfilter,tp,LOCATION_ONFIELD+LOCATION_HAND,0,1,nil,tp)
local b2=Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,LOCATION_EXTRA,0,4,nil)
local op=aux.SelectFromOptions(tp,{b1,1151},{b2,1370})
if op==1 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectMatchingCard(tp,s.desfilter,tp,LOCATION_ONFIELD+LOCATION_HAND,0,1,1,nil,tp)
if Duel.Destroy(g,REASON_EFFECT)~=0 then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SUMMON)
local sg=Duel.SelectMatchingCard(tp,s.sumfilter,tp,LOCATION_HAND+LOCATION_MZONE,0,1,1,nil)
local tc=sg:GetFirst()
if tc then
Duel.Summon(tp,tc,true,nil)
end
end
end
if op==2 then
--level
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_UPDATE_LEVEL)
e2:SetTargetRange(LOCATION_HAND,0)
e2:SetReset(RESET_PHASE+PHASE_END)
e2:SetValue(4)
Duel.RegisterEffect(e2,tp)
Duel.BreakEffect()
local rg=Duel.GetMatchingGroup(Card.IsAbleToRemove,tp,LOCATION_EXTRA,0,nil)
if rg:GetCount()>0 then
local srg=rg:RandomSelect(tp,4)
Duel.Remove(srg,POS_FACEDOWN,REASON_EFFECT)
end
end
end
--悍警 Bijou
local s,id,o=GetID()
function s.initial_effect(c)
s.sumself(c)
s.sumself2(c)
end
function s.sumself2(c)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DESTROY+CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMING_END_PHASE)
e1:SetRange(LOCATION_HAND+LOCATION_GRAVE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCountLimit(1,id+114)
e1:SetTarget(s.gsptg)
e1:SetOperation(s.gspop)
c:RegisterEffect(e1)
end
function s.tfilter(c,sc,tp)
return c:IsFaceup() and Duel.GetMZoneCount(tp,c)>0 and c:IsRace(RACE_ROCK)
end
function s.gsptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local c=e:GetHandler()
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and s.tfilter(chkc,c,tp) end
if chk==0 then return c:IsCanBeSpecialSummoned(e,0,tp,false,false)
and Duel.IsExistingTarget(s.tfilter,tp,LOCATION_MZONE,0,1,nil,c,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,s.tfilter,tp,LOCATION_MZONE,0,1,1,nil,c,tp)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
end
function s.gspop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.Destroy(tc,REASON_EFFECT)~=0 then
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
end
end
function s.sumself(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(2)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_TO_HAND)
e1:SetCountLimit(1,id)
e1:SetTarget(s.sptg)
e1:SetOperation(s.spop)
c:RegisterEffect(e1)
end
function s.setfilter(c)
return c:IsType(TYPE_MONSTER) and not c:IsForbidden()
end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>-1
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.GetLocationCount(tp,LOCATION_SZONE)>0
and Duel.IsExistingMatchingCard(s.setfilter,tp,LOCATION_GRAVE+LOCATION_HAND,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function s.target(e,c)
local seq=c:GetSequence()
return math.abs(e:GetHandler():GetSequence()-seq)<=1
end
function s.spop(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
if Duel.GetLocationCount(tp,LOCATION_SZONE)~=0 then
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.setfilter),tp,LOCATION_GRAVE+LOCATION_HAND,0,1,1,nil)
local tc=g:GetFirst()
if tc then
Duel.MoveToField(tc,tp,tp,LOCATION_SZONE,POS_FACEUP,true)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetCode(EFFECT_CHANGE_TYPE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET)
e1:SetValue(TYPE_SPELL+TYPE_CONTINUOUS)
tc:RegisterEffect(e1)
--race
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetRange(LOCATION_SZONE)
e2:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e2:SetCode(EFFECT_CHANGE_RACE)
e2:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET)
e2:SetTarget(s.target)
e2:SetValue(RACE_ROCK)
tc:RegisterEffect(e2)
end
end
end
\ No newline at end of file
--星-存护-
local cm,m,o=GetID()
function cm.initial_effect(c)
for i=0,0xffff do
c:EnableCounterPermit(i,LOCATION_ONFIELD)
end
--search
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,0))
e3:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_HAND)
e3:SetCountLimit(1,m)
e3:SetCondition(cm.condition)
e3:SetTarget(cm.target)
e3:SetOperation(cm.operation)
c:RegisterEffect(e3)
--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(cm.atcon)
e2:SetValue(cm.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(cm.atcon)
e3:SetTarget(cm.tglimit)
e3:SetValue(aux.tgoval)
c:RegisterEffect(e3)
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_ADJUST)
ge1:SetCondition(cm.checkcon)
ge1:SetOperation(cm.checkop)
Duel.RegisterEffect(ge1,0)
end
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,1))
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_CUSTOM+m)
e1:SetRange(LOCATION_MZONE)
e1:SetOperation(cm.cgop)
c:RegisterEffect(e1)
end
if not cm.preservationcheck then
cm.lastcounter=0
cm.counterchange=0
end
function cm.checkcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local p=c:GetControler()
local ph=Duel.GetCurrentPhase()
local counternum=0
for i=0,0xffff do
counternum=counternum+Duel.GetCounter(p,LOCATION_ONFIELD,0,i)
end
e:SetLabel(counternum)
return cm.lastcounter~=counternum and not (ph>=PHASE_BATTLE_START and ph<=PHASE_BATTLE)
end
function cm.checkop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local p=c:GetControler()
local counternum=e:GetLabel()
cm.counterchange=math.abs(cm.lastcounter-counternum)
cm.lastcounter=counternum
Duel.RaiseEvent(c,EVENT_CUSTOM+m,nil,0,p,p,0)
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetMatchingGroupCount(aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)>=5 and Duel.IsExistingMatchingCard(aux.TRUE,tp,LOCATION_FZONE,0,1,nil)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP_DEFENSE)~=0 then
--
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EVENT_ADJUST)
e1:SetCondition(cm.levelchangecon)
e1:SetOperation(cm.levelchangeop)
e1:SetReset(RESET_EVENT+0xff0000)
c:RegisterEffect(e1)
for i=0,0xffff do
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e0:SetRange(LOCATION_MZONE)
e0:SetCode(EVENT_ADJUST)
e0:SetLabel(i)
e0:SetCondition(cm.countercon)
e0:SetOperation(cm.counterop)
e0:SetReset(RESET_EVENT+0xff0000)
c:RegisterEffect(e0)
end
end
end
function cm.levelchangecon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local ph=Duel.GetCurrentPhase()
return c:GetLevel()~=math.min(Duel.GetMatchingGroupCount(aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil),13) and not (ph>=PHASE_BATTLE_START and ph<=PHASE_BATTLE)
end
function cm.levelchangeop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local lv=math.min(Duel.GetMatchingGroupCount(aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil),13)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EFFECT_CHANGE_LEVEL)
e1:SetValue(lv)
e1:SetReset(RESET_EVENT+0xff0000)
c:RegisterEffect(e1)
end
function cm.countercon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local i=e:GetLabel()
local ph=Duel.GetCurrentPhase()
local tf=false
if Duel.GetCounter(tp,LOCATION_ONFIELD,0,i)~=c:GetCounter(i) and c:GetCounter(i)~=c:GetLevel() and Duel.GetCounter(tp,LOCATION_ONFIELD,0,i)~=0 then
tf=true
end
return tf and not (ph>=PHASE_BATTLE_START and ph<=PHASE_BATTLE)
end
function cm.counterop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local i=e:GetLabel()
local lv=c:GetLevel()
local ct=c:GetCounter(i)
if ct>lv then
c:RemoveCounter(tp,i,ct-lv,REASON_RULE)
elseif ct<lv then
c:AddCounter(i,lv-ct)
Debug.Message(i)
end
end
function cm.atcon(e)
return e:GetHandler():GetDefense()~=0
end
function cm.atlimit(e,c)
return c~=e:GetHandler()
end
function cm.tglimit(e,c)
return c~=e:GetHandler()
end
function cm.cgop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,0,m)
local c=e:GetHandler()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_DEFENSE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
e1:SetValue(cm.counterchange*400)
c:RegisterEffect(e1)
Duel.Recover(tp,cm.counterchange*400,REASON_EFFECT)
end
--星-存护-
local cm,m,o=GetID()
function cm.initial_effect(c)
for i=0,0xffff do
c:EnableCounterPermit(i,LOCATION_ONFIELD)
end
--search
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,0))
e3:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_HAND)
e3:SetCountLimit(1,m)
e3:SetCondition(cm.condition)
e3:SetTarget(cm.target)
e3:SetOperation(cm.operation)
c:RegisterEffect(e3)
--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(cm.atcon)
e2:SetValue(cm.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(cm.atcon)
e3:SetTarget(cm.tglimit)
e3:SetValue(aux.tgoval)
c:RegisterEffect(e3)
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_ADJUST)
ge1:SetCondition(cm.checkcon)
ge1:SetOperation(cm.checkop)
Duel.RegisterEffect(ge1,0)
end
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,1))
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_CUSTOM+m)
e1:SetRange(LOCATION_MZONE)
e1:SetOperation(cm.cgop)
c:RegisterEffect(e1)
end
if not cm.preservationcheck then
cm.lastcounter=0
cm.counterchange=0
end
function cm.checkcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local p=c:GetControler()
local ph=Duel.GetCurrentPhase()
local counternum=0
for i=0,0xffff do
counternum=counternum+Duel.GetCounter(p,LOCATION_ONFIELD,0,i)
end
e:SetLabel(counternum)
return cm.lastcounter~=counternum and not (ph>=PHASE_BATTLE_START and ph<=PHASE_BATTLE)
end
function cm.checkop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local p=c:GetControler()
local counternum=e:GetLabel()
cm.counterchange=math.abs(cm.lastcounter-counternum)
cm.lastcounter=counternum
Duel.RaiseEvent(c,EVENT_CUSTOM+m,nil,0,p,p,0)
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetMatchingGroupCount(aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)>=5 and Duel.IsExistingMatchingCard(aux.TRUE,tp,LOCATION_FZONE,0,1,nil)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP_DEFENSE)~=0 then
--
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EVENT_ADJUST)
e1:SetCondition(cm.levelchangecon)
e1:SetOperation(cm.levelchangeop)
e1:SetReset(RESET_EVENT+0xff0000)
c:RegisterEffect(e1)
for i=0,0xffff do
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e0:SetRange(LOCATION_MZONE)
e0:SetCode(EVENT_ADJUST)
e0:SetLabel(i)
e0:SetCondition(cm.countercon)
e0:SetOperation(cm.counterop)
e0:SetReset(RESET_EVENT+0xff0000)
c:RegisterEffect(e0)
end
end
end
function cm.levelchangecon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local ph=Duel.GetCurrentPhase()
return c:GetLevel()~=math.min(Duel.GetMatchingGroupCount(aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil),13) and not (ph>=PHASE_BATTLE_START and ph<=PHASE_BATTLE)
end
function cm.levelchangeop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local lv=math.min(Duel.GetMatchingGroupCount(aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil),13)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EFFECT_CHANGE_LEVEL)
e1:SetValue(lv)
e1:SetReset(RESET_EVENT+0xff0000)
c:RegisterEffect(e1)
end
function cm.countercon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local i=e:GetLabel()
local ph=Duel.GetCurrentPhase()
local tf=false
if Duel.GetCounter(tp,LOCATION_ONFIELD,0,i)~=c:GetCounter(i) and c:GetCounter(i)~=c:GetLevel() and Duel.GetCounter(tp,LOCATION_ONFIELD,0,i)~=0 then
tf=true
end
return tf and not (ph>=PHASE_BATTLE_START and ph<=PHASE_BATTLE)
end
function cm.counterop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local i=e:GetLabel()
local lv=c:GetLevel()
local ct=c:GetCounter(i)
if ct>lv then
c:RemoveCounter(tp,i,ct-lv,REASON_RULE)
elseif ct<lv then
c:AddCounter(i,lv-ct)
Debug.Message(i)
end
end
function cm.atcon(e)
return e:GetHandler():GetDefense()~=0
end
function cm.atlimit(e,c)
return c~=e:GetHandler()
end
function cm.tglimit(e,c)
return c~=e:GetHandler()
end
function cm.cgop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,0,m)
local c=e:GetHandler()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_DEFENSE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
e1:SetValue(cm.counterchange*400)
c:RegisterEffect(e1)
Duel.Recover(tp,cm.counterchange*400,REASON_EFFECT)
end
--超涡轮喷射龙
function c74449000.initial_effect(c)
c:EnableCounterPermit(0x279)
aux.AddCodeList(c,74449000)
local e0=Effect.CreateEffect(c)
e0:SetCategory(CATEGORY_COUNTER)
e0:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e0:SetCode(EVENT_SUMMON_SUCCESS)
e0:SetProperty(EFFECT_FLAG_DELAY)
e0:SetOperation(c74449000.countop)
c:RegisterEffect(e0)
local e1=e0:Clone()
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(74449000,0))
e2:SetCategory(CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE)
e2:SetCost(c74449000.spcost)
e2:SetTarget(c74449000.sptg)
e2:SetOperation(c74449000.spop)
e2:SetCountLimit(1,74449000)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(74449000,1))
e3:SetCategory(CATEGORY_TOGRAVE)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_MZONE)
e3:SetCost(c74449000.spcost)
e3:SetTarget(c74449000.sptg)
e3:SetOperation(c74449000.spop2)
e3:SetCountLimit(1,74449000)
c:RegisterEffect(e3)
end
function c74449000.countop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and c:IsFaceup() then
c:AddCounter(0x279,4)
end
end
function c74449000.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsCanRemoveCounter(tp,0x279,2,REASON_COST) end
e:GetHandler():RemoveCounter(tp,0x279,2,REASON_COST)
end
function c74449000.filter(c)
return c:IsCanHaveCounter(0x279) and c:IsType(TYPE_MONSTER) and c:IsAttribute(ATTRIBUTE_FIRE)
end
function c74449000.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c74449000.filter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c74449000.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_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c74449000.filter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SendtoHand(g,tp,REASON_EFFECT)
end
end
function c74449000.spop2(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,c74449000.filter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SendtoGrave(g,REASON_EFFECT)
Duel.Damage(1-tp,g:GetFirst():GetLevel()*200,REASON_EFFECT)
end
end
\ No newline at end of file
--魔神兵Zgon
function c74449001.initial_effect(c)
c:EnableCounterPermit(0x279)
aux.AddCodeList(c,74449000)
local e0=Effect.CreateEffect(c)
e0:SetDescription(aux.Stringid(74449001,1))
e0:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_COUNTER)
e0:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e0:SetCode(EVENT_TO_GRAVE)
e0:SetProperty(EFFECT_FLAG_DELAY)
e0:SetCountLimit(1,74449001)
e0:SetTarget(c74449001.tgtg)
e0:SetOperation(c74449001.tgop)
c:RegisterEffect(e0)
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(81109178,1))
e3:SetCategory(CATEGORY_DAMAGE)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e3:SetCode(EVENT_PHASE+PHASE_END)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1)
e3:SetTarget(c74449001.damtg2)
e3:SetOperation(c74449001.damop2)
c:RegisterEffect(e3)
end
function c74449001.damtg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local ct=e:GetHandler():GetCounter(0x233)
Duel.SetTargetPlayer(1-tp)
Duel.SetTargetParam(ct)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,ct)
end
function c74449001.damop2(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
local c=e:GetHandler()
local ct=c:GetCounter(0x233)
if c:RemoveCounter(tp,0x233,ct,REASON_EFFECT) then
Duel.Damage(p,ct*300,REASON_EFFECT)
end
end
function c74449001.tgfilter(c)
return c:IsAbleToRemove(REASON_EFFECT) and c:IsAttribute(ATTRIBUTE_FIRE)
end
function c74449001.tgtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c74449001.tgfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON+CATEGORY_COUNTER,nil,1,tp,LOCATION_GRAVE)
end
function c74449001.tgop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
local c=e:GetHandler()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,c74449001.tgfilter,tp,LOCATION_GRAVE,0,1,1,c)
if g:GetCount()>0 then
Duel.Remove(g,POS_FACEUP,REASON_EFFECT)
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
c:AddCounter(0x279,g:GetFirst():GetLevel())
end
end
\ No newline at end of file
--砰砰巴库弹头
--lua--星空璀璨之地
function c74449002.initial_effect(c)
c:EnableCounterPermit(0x279)
aux.AddCodeList(c,74449000)
--Special Summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(74449002,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,74449002)
e1:SetCost(c74449002.spcost)
e1:SetTarget(c74449002.sptg)
e1:SetOperation(c74449002.spop)
c:RegisterEffect(e1)
--atk up
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_ATKCHANGE)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_ATTACK_ANNOUNCE)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,74449002)
e2:SetCost(c74449002.atkcost)
e2:SetCondition(c74449002.atkcon)
e2:SetOperation(c74449002.atkop)
c:RegisterEffect(e2)
end
function c74449002.cfilter(c,tp)
return c:IsAttribute(ATTRIBUTE_FIRE) and Duel.GetMZoneCount(tp,c)>0
end
function c74449002.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroup(tp,c74449002.cfilter,1,nil,tp) end
local g=Duel.SelectReleaseGroup(tp,c74449002.cfilter,1,1,nil,tp)
e:GetHandler():RegisterFlagEffect(74449002,RESET_TODECK,0,1,g:GetFirst():GetLevel())
Duel.Release(g,REASON_COST)
end
function c74449002.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
end
function c74449002.spop(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)
local num=c:GetFlagEffectLabel(74449002)
c:AddCounter(0x279,num)
end
end
function c74449002.atkcost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
rt=math.min(c:GetCounter(0x279),3)
if chk==0 then return rt>0 and c:IsCanRemoveCounter(tp,0x279,1,REASON_COST) end
local ct=Duel.AnnounceLevel(tp,1,rt,nil)
e:SetLabel(ct)
c:RemoveCounter(tp,0x279,ct,REASON_COST)
end
function c74449002.atkcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetAttacker():IsControler(1-tp)
end
function c74449002.filter(c)
return c:IsAttribute(ATTRIBUTE_FIRE) and c:IsAbleToGrave() and c:IsLevelBelow(4)
end
function c74449002.atkop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local bc=Duel.GetAttacker()
local ct=e:GetLabel()
if bc:IsFaceup() and bc:IsRelateToBattle() and ct>0 then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(ct*500)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
bc:RegisterEffect(e1)
end
if ct>=1 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.GetMatchingGroup(c74449002.filter,tp,LOCATION_DECK,0,nil)
local sg=g:SelectSubGroup(tp,aux.TRUE,false,1,ct)
if sg:GetCount()>0 then
Duel.SendtoGrave(sg,REASON_EFFECT)
end
end
end
\ No newline at end of file
--喷射瓦尔坎
function c74449005.initial_effect(c)
c:EnableCounterPermit(0x279)
aux.AddCodeList(c,74449000)
c:EnableReviveLimit()
aux.AddLinkProcedure(c,c74449005.matfilter,1,1)
local e0=Effect.CreateEffect(c)
e0:SetDescription(aux.Stringid(74449005,0))
e0:SetCategory(CATEGORY_COUNTER)
e0:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e0:SetCode(EVENT_SPSUMMON_SUCCESS)
e0:SetCondition(c74449005.atkcon)
e0:SetTarget(c74449005.atktg)
e0:SetOperation(c74449005.atkop)
e0:SetCountLimit(1,74449005)
c:RegisterEffect(e0)
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOGRAVE)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCost(c74449005.spcost)
e1:SetTarget(c74449005.target)
e1:SetOperation(c74449005.operation)
e1:SetCountLimit(1,74449105)
c:RegisterEffect(e1)
end
function c74449005.spfilter1(c,e,tp)
return c:IsCanHaveCounter(0x279) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.IsExistingMatchingCard(c74449005.spfilter2,tp,LOCATION_DECK,0,1,nil,c:GetCode())
end
function c74449005.spfilter2(c,code)
return c:IsCanHaveCounter(0x279) and c:IsAbleToGrave() and not c:IsCode(code) and c:IsType(TYPE_MONSTER)
end
function c74449005.operation(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c74449005.spfilter1,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 g2=Duel.SelectMatchingCard(tp,c74449005.spfilter2,tp,LOCATION_DECK,0,1,1,nil,g:GetFirst():GetCode())
if g2:GetCount()>0 then
Duel.SendtoGrave(g2,REASON_EFFECT)
end
end
end
function c74449005.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsCanRemoveCounter(tp,0x279,2,REASON_COST) end
e:GetHandler():RemoveCounter(tp,0x279,2,REASON_COST)
end
function c74449005.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c74449005.spfilter1,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON+CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK)
end
function c74449005.atkcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_LINK)
end
function c74449005.atktg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local mg=e:GetHandler():GetMaterial()
if mg:GetCount()<1 then return false end
if chkc then return mg:IsContains(chkc) end
if chk==0 then return true end
local c=mg:GetFirst()
Duel.SetTargetCard(c)
end
function c74449005.atkop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
local num=tc:GetFlagEffectLabel(74449005)
c:AddCounter(0x279,num)
end
function c74449005.matfilter(c)
if c:IsCanHaveCounter(0x279) and c:IsType(TYPE_MONSTER) then
c:ResetFlagEffect(74449005)
c:RegisterFlagEffect(74449005,RESET_TODECK,0,1,c:GetCounter(0x279))
end
return c:IsCanHaveCounter(0x279) and c:IsType(TYPE_MONSTER)
end
\ No newline at end of file
--轰炸凤凰
function c74449006.initial_effect(c)
c:EnableCounterPermit(0x279)
aux.AddCodeList(c,74449000)
c:EnableReviveLimit()
aux.AddLinkProcedure(c,c74449006.matfilter,2,2)
local e0=Effect.CreateEffect(c)
e0:SetDescription(aux.Stringid(74449006,0))
e0:SetCategory(CATEGORY_COUNTER)
e0:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e0:SetCode(EVENT_SPSUMMON_SUCCESS)
e0:SetCondition(c74449006.atkcon)
e0:SetTarget(c74449006.atktg)
e0:SetOperation(c74449006.atkop)
e0:SetCountLimit(1,74449006100)
c:RegisterEffect(e0)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(74449006,0))
e1:SetCategory(CATEGORY_DAMAGE)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetCountLimit(1,74449006000)
e1:SetRange(LOCATION_MZONE)
e1:SetTarget(c74449006.tg)
e1:SetOperation(c74449006.op)
c:RegisterEffect(e1)
end
function c74449006.atkcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_LINK)
end
function c74449006.atktg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local mg=e:GetHandler():GetMaterial()
if mg:GetCount()<1 then return false end
if chkc then return mg:IsContains(chkc) end
if chk==0 then return true end
local num=0
local c=mg:GetFirst()
num=num+c:GetFlagEffectLabel(74449006)
c=mg:GetNext()
num=num+c:GetFlagEffectLabel(74449006)
e:SetLabel(num)
end
function c74449006.atkop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local num=e:GetLabel()
c:AddCounter(0x279,num)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c74449006.filter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SendtoHand(g,tp,REASON_EFFECT)
end
end
function c74449006.filter(c)
return aux.IsCodeListed(c,74449000)
end
function c74449006.matfilter(c)
if c:IsCanHaveCounter(0x279) and c:IsType(TYPE_MONSTER) then
c:ResetFlagEffect(74449006)
c:RegisterFlagEffect(74449006,RESET_TODECK,0,1,c:GetCounter(0x279))
end
return c:IsCanHaveCounter(0x279) and c:IsType(TYPE_MONSTER)
end
function c74449006.op(e,tp,eg,ep,ev,re,r,rp)
local cnum=Duel.GetMatchingGroupCount(c74449006.grfilter,tp,LOCATION_GRAVE,0,nil)
local counter=e:GetHandler():GetCounter(0x279)
Duel.Damage(1-tp,cnum*100*counter,REASON_EFFECT)
end
function c74449006.tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,500)
end
function c74449006.grfilter(c)
return c:IsCanHaveCounter(0x279) or c:IsAttribute(ATTRIBUTE_FIRE)
end
\ No newline at end of file
--砰砰巴库进击
function c74449007.initial_effect(c)
aux.AddCodeList(c,74449000)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_DAMAGE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,74449007+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(c74449007.target)
e1:SetOperation(c74449007.activate)
c:RegisterEffect(e1)
end
function c74449007.filter(c,e,tp)
return c:IsCanHaveCounter(0x279) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c74449007.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c74449007.filter,tp,LOCATION_DECK,0,1,nil,e,tp)
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function c74449007.activate(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,c74449007.filter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
Duel.BreakEffect()
local rc=g:GetFirst()
local lv=rc:GetLevel()
Duel.Damage(tp,lv*200,REASON_EFFECT)
Duel.Damage(1-tp,lv*200,REASON_EFFECT)
end
end
--砰砰巴库扫射
--lua--星空璀璨之地
function c74449008.initial_effect(c)
aux.AddCodeList(c,74449000)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,74449008+EFFECT_COUNT_CODE_OATH)
e1:SetCost(c74449008.cost)
e1:SetTarget(c74449008.target)
e1:SetOperation(c74449008.activate)
c:RegisterEffect(e1)
end
function c74449008.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckLPCost(tp,1000) end
Duel.PayLPCost(tp,1000)
end
function c74449008.spfilter(c,e,tp)
return c:IsType(TYPE_MONSTER) and c:IsCanHaveCounter(0x279) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP)
end
function c74449008.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c74449008.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE)
end
function c74449008.activate(e,tp,eg,ep,ev,re,r,rp)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if ft<=0 then return end
if ft>3 then ft=3 end
if Duel.IsPlayerAffectedByEffect(tp,59822133) then ft=1 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c74449008.spfilter,tp,LOCATION_GRAVE,0,1,ft,nil,e,tp)
for tc in aux.Next(g) do
Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP)
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=e1:Clone()
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetValue(RESET_TURN_SET)
tc:RegisterEffect(e2)
end
Duel.SpecialSummonComplete()
end
\ No newline at end of file
--轰轰坦克·加农
--lua--星空璀璨之地
function c74449011.initial_effect(c)
c:EnableCounterPermit(0x279)
aux.AddCodeList(c,74449000)
--special summon (self)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(74449011,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,74449011)
e1:SetCost(c74449011.cost)
e1:SetTarget(c74449011.sptg1)
e1:SetOperation(c74449011.spop1)
c:RegisterEffect(e1)
--spsummon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(74449011,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_SUMMON_SUCCESS)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCountLimit(1,74449011)
e2:SetTarget(c74449011.sptg2)
e2:SetOperation(c74449011.spop2)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e3)
end
function c74449011.cfilter(c)
return c:GetCounter(0x279)>0 and c:IsReleasable()
end
function c74449011.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c74449011.cfilter,tp,LOCATION_MZONE,0,1,nil) end
local g=Duel.SelectMatchingCard(tp,c74449011.cfilter,tp,LOCATION_MZONE,0,1,1,nil)
Duel.Release(g,REASON_COST)
end
function c74449011.sptg1(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 c74449011.spop1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP_DEFENSE)
end
function c74449011.spfilter(c,e,tp)
return c:IsCode(74449012) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c74449011.sptg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c74449011.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function c74449011.spop2(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,c74449011.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
local tc=g:GetFirst()
if tc and Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP) then
local e1=Effect.CreateEffect(tc)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(tc)
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()
Duel.BreakEffect()
Duel.Damage(1-tp,800,REASON_EFFECT)
end
\ No newline at end of file
--轰轰坦克·魔刃
--lua--星空璀璨之地
function c74449012.initial_effect(c)
c:EnableCounterPermit(0x279)
aux.AddCodeList(c,74449000)
--special summon (self)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(74449012,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,74449012)
e1:SetCost(c74449012.cost)
e1:SetTarget(c74449012.sptg1)
e1:SetOperation(c74449012.spop1)
c:RegisterEffect(e1)
--spsummon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(74449012,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_SUMMON_SUCCESS)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCountLimit(1,74449012)
e2:SetTarget(c74449012.sptg2)
e2:SetOperation(c74449012.spop2)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e3)
end
function c74449012.cfilter(c)
return c:GetCounter(0x279)>0 and c:IsReleasable()
end
function c74449012.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c74449012.cfilter,tp,LOCATION_MZONE,0,1,nil) end
local g=Duel.SelectMatchingCard(tp,c74449012.cfilter,tp,LOCATION_MZONE,0,1,1,nil)
Duel.Release(g,REASON_COST)
end
function c74449012.sptg1(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 c74449012.spop1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP_DEFENSE)
end
function c74449012.spfilter(c,e,tp)
return c:IsCode(74449011) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c74449012.sptg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c74449012.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function c74449012.spop2(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,c74449012.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
local tc=g:GetFirst()
if tc and Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP) then
local e1=Effect.CreateEffect(tc)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(tc)
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()
local dg=Duel.GetMatchingGroup(nil,tp,0,LOCATION_ONFIELD,nil)
if dg:GetCount()>0 then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local sg=dg:Select(tp,1,1,nil)
Duel.HintSelection(sg)
Duel.Destroy(sg,REASON_EFFECT)
end
end
--熔炉锤鼠
function c74449013.initial_effect(c)
c:EnableCounterPermit(0x279)
aux.AddCodeList(c,74449000)
--
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e1:SetValue(1)
c:RegisterEffect(e1)
--get effect
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_XMATERIAL)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetRange(LOCATION_MZONE)
e2:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e2:SetCondition(c74449013.condition)
e2:SetValue(1)
c:RegisterEffect(e2)
end
function c74449013.condition(e)
return e:GetHandler():IsCanHaveCounter(0x279)
end
--轰轰战车·熔炉锤
--lua--星空璀璨之地
function c74449014.initial_effect(c)
c:EnableCounterPermit(0x279)
aux.AddCodeList(c,74449000)
--xyz summon
aux.AddXyzProcedure(c,c74449014.mfilter,4,2,c74449014.ovfilter,aux.Stringid(74449014,0),2,c74449014.xyzop)
c:EnableReviveLimit()
--
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(74449014,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH+CATEGORY_TOGRAVE)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetCost(c74449014.cost)
e1:SetTarget(c74449014.target)
e1:SetOperation(c74449014.activate)
c:RegisterEffect(e1)
--extra summon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(74449014,1))
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetRange(LOCATION_MZONE)
e2:SetTargetRange(LOCATION_HAND+LOCATION_MZONE,0)
e2:SetCode(EFFECT_EXTRA_SUMMON_COUNT)
e2:SetTarget(aux.TargetBoolFunction(Card.IsCanHaveCounter,0x279))
c:RegisterEffect(e2)
end
function c74449014.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 c74449014.mfilter(c)
return c:IsCanHaveCounter(0x279) and c:IsType(TYPE_MONSTER)
end
function c74449014.ovfilter(c)
return c:IsFaceup() and c:IsCode(74449013) and c:GetCounter(0x279)>=2
end
function c74449014.xyzop(e,tp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,74449014)==0 end
Duel.RegisterFlagEffect(tp,74449014,RESET_PHASE+PHASE_END,EFFECT_FLAG_OATH,1)
end
function c74449014.filter(c)
return c:IsType(TYPE_MONSTER) and c:IsCanHaveCounter(0x279) and (c:IsAbleToHand() or c:IsAbleToGrave())
end
function c74449014.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c74449014.filter,tp,LOCATION_DECK,0,1,nil) end
end
function c74449014.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_OPERATECARD)
local g=Duel.SelectMatchingCard(tp,c74449014.filter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()<=0 then return end
local tc=g:GetFirst()
if tc:IsAbleToHand() and (not tc:IsAbleToGrave() or Duel.SelectOption(tp,1190,1191)==0) then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tc)
else
Duel.SendtoGrave(tc,REASON_EFFECT)
end
end
\ No newline at end of file
--轰轰战士·炎翼翔鼠
local m=74449015
local cm=_G["c"..m]
function cm.initial_effect(c)
c:EnableCounterPermit(0x279)
aux.AddCodeList(c,74449000)
--DIRECT_ATTACK
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DIRECT_ATTACK)
e1:SetCondition(c74449015.incon)
c:RegisterEffect(e1)
--get effect
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(74449015,0))
e2:SetCategory(CATEGORY_ATKCHANGE)
e2:SetType(EFFECT_TYPE_XMATERIAL+EFFECT_TYPE_IGNITION)
e2:SetCountLimit(1)
e2:SetCondition(c74449015.con)
e2:SetCost(c74449015.cost)
e2:SetTarget(c74449015.tg)
e2:SetOperation(c74449015.op)
c:RegisterEffect(e2)
end
function c74449015.incon(e)
return Duel.GetCounter(e:GetHandlerPlayer(),LOCATION_ONFIELD,0,0x279)>=3
end
function c74449015.con(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsCanHaveCounter(0x279)
end
function c74449015.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.IsCanRemoveCounter(tp,1,0,0x279,2,REASON_COST) end
Duel.RemoveCounter(tp,1,0,0x279,2,REASON_COST)
end
function c74449015.tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
end
function c74449015.op(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_SET_ATTACK_FINAL)
e1:SetValue(math.ceil(c:GetAttack()/2))
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DIRECT_ATTACK)
e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
c:RegisterEffect(e2)
end
end
--轰轰战士·炎拳殴鼠
local m=74449016
local cm=_G["c"..m]
function cm.initial_effect(c)
c:EnableCounterPermit(0x279)
aux.AddCodeList(c,74449000)
--cannot be destroyed
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:SetCondition(c74449016.incon)
e1:SetValue(1)
c:RegisterEffect(e1)
--get effect
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(74449016,0))
e2:SetType(EFFECT_TYPE_XMATERIAL+EFFECT_TYPE_IGNITION)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetCountLimit(1)
e2:SetCondition(c74449016.con)
e2:SetCost(c74449016.cost)
e2:SetOperation(c74449016.op)
c:RegisterEffect(e2)
end
function c74449016.incon(e)
return Duel.GetCounter(e:GetHandlerPlayer(),LOCATION_ONFIELD,0,0x279)>=3
end
function c74449016.con(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsCanHaveCounter(0x279)
end
function c74449016.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.IsCanRemoveCounter(tp,1,0,0x279,2,REASON_COST) end
Duel.RemoveCounter(tp,1,0,0x279,2,REASON_COST)
end
function c74449016.op(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
local n=c:GetAttack()/2
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetCode(EFFECT_UPDATE_ATTACK)
e0:SetValue(n)
e0:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE+RESET_PHASE+PHASE_END)
c:RegisterEffect(e0)
end
\ No newline at end of file
--轰轰战士·炎笛奏鼠
local m=74449017
local cm=_G["c"..m]
function cm.initial_effect(c)
c:EnableCounterPermit(0x279)
aux.AddCodeList(c,74449000)
--extra summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(74449017,0))
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetRange(LOCATION_MZONE)
e1:SetTargetRange(LOCATION_HAND+LOCATION_MZONE,0)
e1:SetCode(EFFECT_EXTRA_SUMMON_COUNT)
e1:SetCondition(c74449017.incon)
e1:SetTarget(aux.TargetBoolFunction(Card.IsSetCard,0x279))
c:RegisterEffect(e1)
--get effect
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(74449017,1))
e2:SetCategory(CATEGORY_RECOVER)
e2:SetType(EFFECT_TYPE_XMATERIAL+EFFECT_TYPE_IGNITION)
e2:SetCountLimit(1)
e2:SetCondition(c74449017.con)
e2:SetCost(c74449017.cost)
e2:SetTarget(c74449017.tg)
e2:SetOperation(c74449017.op)
c:RegisterEffect(e2)
end
function c74449017.incon(e)
return Duel.GetCounter(e:GetHandlerPlayer(),LOCATION_ONFIELD,0,0x279)>=3
end
function c74449017.con(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsCanHaveCounter(0x279)
end
function c74449017.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.IsCanRemoveCounter(tp,1,0,0x279,2,REASON_COST) end
Duel.RemoveCounter(tp,1,0,0x279,2,REASON_COST)
end
function c74449017.filter(c)
return c:IsCanHaveCounter(0x279) and c:IsFaceup() and c:IsType(TYPE_MONSTER)
end
function c74449017.tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local g=Duel.GetMatchingGroupCount(c74449017.filter,tp,LOCATION_ONFIELD,0,nil)
Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,200*g)
end
function c74449017.op(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
local g=Duel.GetMatchingGroupCount(c74449017.filter,tp,LOCATION_ONFIELD,0,nil)
Duel.Recover(tp,200*g,REASON_EFFECT)
end
--轰轰裁判·炎锣裁鼠
local m=74449018
local cm=_G["c"..m]
function cm.initial_effect(c)
c:EnableCounterPermit(0x279)
aux.AddCodeList(c,74449000)
--indestructable effect
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:SetValue(SUMMON_VALUE_SELF)
e1:SetCountLimit(1,74449018+EFFECT_COUNT_CODE_OATH)
e1:SetCondition(c74449018.hspcon)
c:RegisterEffect(e1)
--destroy
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,74449018)
e2:SetCost(c74449018.cost)
e2:SetTarget(c74449018.tg)
e2:SetOperation(c74449018.op)
c:RegisterEffect(e2)
end
function c74449018.hspcon(e)
local c=e:GetHandler()
return Duel.GetCounter(e:GetHandlerPlayer(),LOCATION_ONFIELD,0,0x279)>=3 and Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>0
end
function c74449018.cfilter(c)
return c:IsCanHaveCounter(0x279) and c:IsType(TYPE_MONSTER)
end
function c74449018.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroup(tp,c74449018.cfilter,1,nil) and Duel.GetFieldGroupCount(tp,0,LOCATION_MZONE)~=0 end
local g=Duel.SelectReleaseGroup(tp,c74449018.cfilter,1,1,nil)
Duel.Release(g,REASON_COST)
end
function c74449018.filter(c,e,tp)
return c:IsAttack(1500) and c:IsDefense(200) and c:IsAttribute(ATTRIBUTE_FIRE) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c74449018.tg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c74449018.filter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingTarget(nil,tp,0,LOCATION_MZONE,1,nil) and Duel.IsExistingMatchingCard(c74449018.filter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SELECT)
local tc=Duel.SelectTarget(tp,nil,tp,0,LOCATION_MZONE,1,1,nil)
local atk=tc:GetAttack()/2000
local ts=1+atk
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,ts,tp,LOCATION_DECK)
end
function c74449018.op(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
local atk=tc:GetAttack()/2000
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if ft<=0 then return end
local ts=1+atk
if ts>ft then ts=ft end
if Duel.IsPlayerAffectedByEffect(tp,59822133) then ts=1 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c74449018.filter,tp,LOCATION_DECK,0,1,ts,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
--裁判的休息
local m=74449019
local cm=_G["c"..m]
function cm.initial_effect(c)
c:EnableCounterPermit(0x279)
aux.AddCodeList(c,74449000)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCategory(CATEGORY_RECOVER)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,74449019+EFFECT_COUNT_CODE_OATH)
e1:SetCondition(c74449019.condition)
e1:SetTarget(c74449019.target)
e1:SetOperation(c74449019.activate)
c:RegisterEffect(e1)
end
function c74449019.condition(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(Card.IsCanHaveCounter,tp,LOCATION_MZONE,0,nil,0x279)
return g:IsExists(Card.IsControler,1,nil,tp)
end
function c74449019.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local t={}
local i=1
for i=1,4 do t[i]=i end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_NUMBER)
e:SetLabel(Duel.AnnounceNumber(tp,table.unpack(t)))
Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,i*500)
end
function c74449019.filter(c,dnum)
return c:IsCanAddCounter(0x279,4-dnum) and c:IsType(TYPE_MONSTER)
end
function c74449019.activate(e,tp,eg,ep,ev,re,r,rp)
local dnum=e:GetLabel()
local ct=4-dnum
Duel.Recover(tp,dnum*500,REASON_EFFECT)
if ct>0 and Duel.GetMatchingGroupCount(c74449019.filter,tp,LOCATION_ONFIELD,0,nil,dnum)>0 then
while ct>0 do
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_COUNTER)
local tc=Duel.SelectMatchingCard(tp,c74449019.filter,tp,LOCATION_ONFIELD,0,1,1,nil,dnum):GetFirst()
if not tc then break end
tc:AddCounter(0x279,1)
ct=ct-1
end
end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetCountLimit(1)
e1:SetOperation(c74449019.damop)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function c74449019.damop(e,tp,eg,ep,ev,re,r,rp)
local dam=Duel.GetCounter(tp,LOCATION_ONFIELD,0,0x279)
Duel.Hint(HINT_CARD,0,74449019)
Duel.SetLP(tp,Duel.GetLP(tp)-dam*300)
end
--轰轰进军
local m=74449020
local cm=_G["c"..m]
function cm.initial_effect(c)
c:EnableCounterPermit(0x279)
aux.AddCodeList(c,74449000)
--activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_COUNTER+CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,74449020)
e1:SetTarget(c74449020.target)
e1:SetOperation(c74449020.activate)
c:RegisterEffect(e1)
--
--counter
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_SUMMON_SUCCESS)
e2:SetRange(LOCATION_SZONE)
e2:SetOperation(c74449020.counter)
c:RegisterEffect(e2)
local e0=e2:Clone()
e0:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e0)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EVENT_CHAINING)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e3:SetRange(LOCATION_SZONE)
e3:SetOperation(aux.chainreg)
c:RegisterEffect(e3)
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e4:SetCode(EVENT_CHAIN_SOLVED)
e4:SetRange(LOCATION_SZONE)
e4:SetOperation(cm.op)
c:RegisterEffect(e4)
end
function c74449020.filter(c)
return c:IsSetCard(0x279) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
end
function c74449020.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsCanAddCounter(tp,0x279,1,e:GetHandler())
and Duel.IsExistingMatchingCard(c74449020.filter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_COUNTER,nil,1,0,0x279)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c74449020.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
c:AddCounter(0x279,1)
end
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c74449020.filter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
function c74449020.cfilter(c)
return c:IsSetCard(0x279)
end
function c74449020.counter(e,tp,eg,ep,ev,re,r,rp)
if eg:IsExists(c74449020.cfilter,1,nil) then
e:GetHandler():AddCounter(0x279,1)
end
end
function c74449020.op(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local rc=re:GetHandler()
if rc:IsSetCard(0x279) and re:IsActiveType(TYPE_MONSTER) and c:GetFlagEffect(1)>0 then
e:GetHandler():AddCounter(0x279,1)
end
end
--轰轰公主·炎伞华鼠
local m=74449021
local cm=_G["c"..m]
function cm.initial_effect(c)
c:EnableCounterPermit(0x279)
aux.AddCodeList(c,74449000)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetRange(LOCATION_HAND)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetCountLimit(1,74449021)
e1:SetCondition(c74449021.spcon)
e1:SetTarget(c74449021.sptg)
e1:SetOperation(c74449021.spop)
c:RegisterEffect(e1)
local e0=e1:Clone()
e0:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e0)
--get effect
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(74449021,0))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_XMATERIAL+EFFECT_TYPE_IGNITION)
e2:SetCountLimit(1)
e2:SetCondition(c74449021.con)
e2:SetCost(c74449021.cost)
e2:SetTarget(c74449021.tg)
e2:SetOperation(c74449021.op)
c:RegisterEffect(e2)
end
function c74449021.cfilter(c,tp)
return c:IsFaceup() and c:IsSummonPlayer(tp) and c:IsSetCard(0x279) and not c:IsCode(74449021)
end
function c74449021.spcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c74449021.cfilter,1,nil,tp)
end
function c74449021.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,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function c74449021.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
function c74449021.con(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsCanHaveCounter(0x279)
end
function c74449021.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.IsCanRemoveCounter(tp,1,0,0x279,2,REASON_COST) end
Duel.RemoveCounter(tp,1,0,0x279,2,REASON_COST)
end
function c74449021.spfilter(c,e,tp)
return c:IsSetCard(0x279) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c74449021.tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c74449021.spfilter,tp,LOCATION_HAND,0,1,nil,e,tp) end
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
end
function c74449021.op(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,c74449021.spfilter,tp,LOCATION_HAND,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
c:AddCounter(0x279,2)
end
end
\ No newline at end of file
--轰轰学生·炎尾颓鼠
local m=74449022
local cm=_G["c"..m]
function cm.initial_effect(c)
c:EnableCounterPermit(0x279)
aux.AddCodeList(c,74449000)
--indes
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetRange(LOCATION_MZONE)
e1:SetTargetRange(LOCATION_MZONE,0)
e1:SetCondition(c74449022.incon)
e1:SetTarget(c74449022.imtg)
c:RegisterEffect(e1)
local e3=e1:Clone()
e3:SetCode(EFFECT_XYZ_LEVEL)
e3:SetValue(c74449022.xyzlv)
e3:SetLabel(6)
c:RegisterEffect(e3)
local e4=e1:Clone()
e4:SetCode(EFFECT_XYZ_LEVEL)
e4:SetValue(c74449022.xyzlv)
e4:SetLabel(8)
c:RegisterEffect(e4)
--get effect
--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:SetCountLimit(1,74449022)
e2:SetCondition(c74449022.efcon)
e2:SetOperation(c74449022.efop)
c:RegisterEffect(e2)
end
function c74449022.incon(e)
return Duel.GetCounter(e:GetHandlerPlayer(),LOCATION_ONFIELD,0,0x279)>=3
end
function cm.imtg(e,c)
return c:IsSetCard(0x279)
end
function cm.xyzlv(e,c,rc)
if rc:IsCanHaveCounter(0x279) then
return c:GetLevel()+0x10000*e:GetLabel()
else
return c:GetLevel()
end
end
function c74449022.efcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return r==REASON_XYZ and c:GetReasonCard():IsCanHaveCounter(0x279)
end
function c74449022.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(74449022,6))
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(c74449022.thtg)
e1:SetOperation(c74449022.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 c74449022.thfilter(c)
return c:GetType()==TYPE_SPELL and c:IsSetCard(0x95) and c:IsAbleToHand()
end
function c74449022.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c74449022.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c74449022.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c74449022.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 m=74449023
local cm=_G["c"..m]
function cm.initial_effect(c)
aux.AddCodeList(c,74449000)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,74449023+EFFECT_COUNT_CODE_OATH)
e1:SetCost(c74449023.cost)
e1:SetTarget(c74449023.target)
e1:SetOperation(c74449023.activate)
e1:SetLabel(0)
c:RegisterEffect(e1)
end
function c74449023.cost(e,tp,eg,ep,ev,re,r,rp,chk)
e:SetLabel(100)
if chk==0 then return true end
end
function c74449023.spfilter(c,e,tp)
return c:IsSetCard(0x279) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c74449023.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
if e:GetLabel()~=100 then return false end
e:SetLabel(0)
local dg=Duel.GetMatchingGroup(c74449023.spfilter,tp,LOCATION_DECK,0,nil,e,tp)
return e:IsHasType(EFFECT_TYPE_ACTIVATE) and dg:GetClassCount(Card.GetCode)>=3 and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsCanRemoveCounter(tp,1,0,0x279,2,REASON_COST)
end
e:SetLabel(0)
Duel.RemoveCounter(tp,1,0,0x279,2,REASON_COST)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function c74449023.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c74449023.spfilter,tp,LOCATION_DECK,0,nil,e,tp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 or g:GetClassCount(Card.GetCode)<3 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM)
local sg=g:SelectSubGroup(tp,aux.dncheck,false,3,3)
if #sg>0 then
Duel.ConfirmCards(1-tp,sg)
local tc=sg:RandomSelect(1-tp,1):GetFirst()
Duel.ConfirmCards(tp,tc)
if Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)>0 then
local atk=tc:GetAttack()
Duel.BreakEffect()
Duel.Recover(1-tp,atk,REASON_EFFECT)
end
Duel.ShuffleDeck(tp)
end
end
\ No newline at end of file
--被迫逃跑的学生
local m=74449024
local cm=_G["c"..m]
function cm.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,74449024+EFFECT_COUNT_CODE_OATH)
e1:SetCost(c74449024.cost)
e1:SetTarget(c74449024.target)
e1:SetOperation(c74449024.activate)
e1:SetLabel(0)
c:RegisterEffect(e1)
end
function c74449024.cost(e,tp,eg,ep,ev,re,r,rp,chk)
e:SetLabel(100)
if chk==0 then return true end
end
function c74449024.spfilter(c,e,tp,code)
return not c:IsCode(code) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c74449024.tgfilter(c,e)
return c:IsSetCard(0x279) and c:IsAbleToGrave() and Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp,c:GetCode())
end
function c74449024.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
if e:GetLabel()~=100 then return false end
e:SetLabel(0)
return e:IsHasType(EFFECT_TYPE_ACTIVATE) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsCanRemoveCounter(tp,1,0,0x279,2,REASON_COST)
and Duel.IsExistingMatchingCard(c74449024.tgfilter,tp,LOCATION_DECK,0,1,nil,e)
end
e:SetLabel(0)
Duel.RemoveCounter(tp,1,0,0x279,2,REASON_COST)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK)
end
function c74449024.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c74449024.tgfilter,tp,LOCATION_DECK,0,1,1,nil)
local tc=g:GetFirst()
local lev=tc:GetLevel()
local code=tc:GetCode()
if g:GetCount()>0 then
Duel.BreakEffect()
if Duel.SendtoGrave(tc,0,REASON_EFFECT)>0 and Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp,code) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g2=Duel.SelectMatchingCard(tp,cm.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp,code)
local ttc=g2:GetFirst()
if g2:GetCount()>0 and Duel.SpecialSummon(ttc,0,tp,tp,false,false,POS_FACEUP) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EFFECT_CHANGE_LEVEL)
e1:SetValue(lev)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
ttc:RegisterEffect(e1)
end
end
end
end
--售卖水果的学生
local m=74449025
local cm=_G["c"..m]
function cm.initial_effect(c)
aux.AddCodeList(c,74449000)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetCost(c74449025.cost)
e1:SetTarget(c74449025.target)
e1:SetOperation(c74449025.activate)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_FLIP_SUMMON_SUCCESS)
c:RegisterEffect(e2)
local e3=e1:Clone()
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e3)
end
function c74449025.cost(e,tp,eg,ep,ev,re,r,rp,chk)
e:SetLabel(100)
if chk==0 then return true end
end
function c74449025.filter(c,e,tp)
return c:IsFaceup() and c:IsLocation(LOCATION_MZONE) and c:IsSummonPlayer(1-tp)
and (not e or c:IsRelateToEffect(e))
end
function c74449025.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
if e:GetLabel()~=100 then return false end
e:SetLabel(0)
return e:IsHasType(EFFECT_TYPE_ACTIVATE) and Duel.IsCanRemoveCounter(tp,1,0,0x279,2,REASON_COST)
and eg:IsExists(c74449025.filter,1,nil,nil,tp)
end
e:SetLabel(0)
Duel.RemoveCounter(tp,1,0,0x279,2,REASON_COST)
Duel.SetTargetCard(eg)
end
function c74449025.recop2(e,tp,eg,ep,ev,re,r,rp)
local g=eg:Filter(c74449025.filter,nil,e,tp)
if g:GetCount()>0 then
if g:GetCount()>1 then
g=g:RandomSelect(tp,1)
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local g2=Duel.SelectMatchingCard(tp,nil,tp,LOCATION_MZONE,0,1,1,nil)
if g2:GetCount()>0 then
g2:Merge(g2,g)
Duel.Release(g2,REASON_EFFECT)
end
local bc=g:GetFirst()
if bc:IsLevelAbove(1) then lk=bc:GetOriginalLevel()
elseif bc:IsRankAbove(1) then lk=bc:GetOriginalRank()
elseif bc:IsLinkAbove(1) then lk=bc:GetLink()
end
local att=bc:GetOriginalAttribute()
local atk=bc:GetAttack()
if lk>0 and Duel.GetLocationCount(1-tp,LOCATION_MZONE)>0
and Duel.IsPlayerCanSpecialSummonMonster(tp,74449026,0,TYPES_TOKEN_MONSTER,nil,0,nil,bc:GetRace(),bc:GetAttribute()) then
local token=Duel.CreateToken(tp,74449026)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK)
e1:SetValue(atk)
e1:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TOFIELD)
token:RegisterEffect(e1)
local e3=e1:Clone()
e3:SetCode(EFFECT_CHANGE_LEVEL)
e3:SetValue(lk)
token:RegisterEffect(e3)
local e4=e1:Clone()
e4:SetCode(EFFECT_CHANGE_RACE)
e4:SetValue(bc:GetRace())
token:RegisterEffect(e4)
local e5=e1:Clone()
e5:SetCode(EFFECT_CHANGE_ATTRIBUTE)
e5:SetValue(bc:GetAttribute())
token:RegisterEffect(e5)
Duel.SpecialSummon(token,0,tp,1-tp,false,false,POS_FACEUP)
end
end
end
--水果衍生物
function c74449026.initial_effect(c)
c:EnableCounterPermit(0x279)
end
--禁止通行的学生
local m=74449027
local cm=_G["c"..m]
function cm.initial_effect(c)
aux.AddCodeList(c,74449000)
--Activate(effect)
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_NEGATE+CATEGORY_DESTROY+CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_CHAINING)
e1:SetCondition(c74449027.condition)
e1:SetCost(c74449027.cost)
e1:SetTarget(c74449027.target)
e1:SetOperation(c74449027.activate)
c:RegisterEffect(e1)
end
function c74449027.condition(e,tp,eg,ep,ev,re,r,rp)
return (re:IsActiveType(TYPE_MONSTER) or re:IsHasType(EFFECT_TYPE_ACTIVATE)) and Duel.IsChainNegatable(ev)
end
function c74449027.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.IsCanRemoveCounter(tp,1,0,0x279,2,REASON_COST) end
Duel.RemoveCounter(tp,1,0,0x279,2,REASON_COST)
end
function c74449027.filter(c)
return c:IsSetCard(0x279) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
end
function c74449027.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c74449027.filter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0)
if re:GetHandler():IsDestructable() and re:GetHandler():IsRelateToEffect(re) then
Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
end
function c74449027.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.NegateActivation(ev) and re:GetHandler():IsRelateToEffect(re) then
Duel.Destroy(eg,REASON_EFFECT)
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c74449027.filter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
end
--轰轰战车·赤陨星
local m=74449028
local cm=_G["c"..m]
function cm.initial_effect(c)
c:EnableCounterPermit(0x279)
aux.AddCodeList(c,74449000)
--xyz summon
aux.AddXyzProcedure(c,aux.FilterBoolFunction(Card.IsCanHaveCounter,0x279),4,2,nil,nil,99)
c:EnableReviveLimit()
--
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(74449028,0))
e1:SetCategory(CATEGORY_DAMAGE)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCountLimit(1,74449028)
e1:SetCondition(c74449028.condition)
e1:SetTarget(c74449028.target)
e1:SetOperation(c74449028.operation)
c:RegisterEffect(e1)
--remove
local e5=Effect.CreateEffect(c)
e5:SetDescription(aux.Stringid(74449028,1))
e5:SetCategory(CATEGORY_REMOVE)
e5:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e5:SetCode(EVENT_BATTLE_START)
e5:SetCountLimit(1,74449128)
e5:SetCondition(c74449028.rmcon)
e5:SetTarget(c74449028.rmtg)
e5:SetOperation(c74449028.rmop)
c:RegisterEffect(e5)
end
function c74449028.condition(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_XYZ)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local ct=e:GetHandler():GetOverlayCount()
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,ct*500)
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local ct=e:GetHandler():GetOverlayCount()
Duel.Damage(1-tp,ct*500,REASON_EFFECT)
end
function c74449028.rmcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local bc=c:GetBattleTarget()
e:SetLabelObject(bc)
return Duel.GetAttacker()==c and bc and bc:IsControler(1-tp)
end
function c74449028.rmtg(e,tp,eg,ep,ev,re,r,rp,chk)
local bc=e:GetLabelObject()
if chk==0 then return bc and bc:IsRelateToBattle() and bc:IsAbleToRemove() end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,bc,1,0,0)
end
function c74449028.rmop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local bc=e:GetLabelObject()
if bc and bc:IsRelateToBattle() and bc:IsControler(1-tp) and Duel.Remove(bc,0,REASON_EFFECT+REASON_TEMPORARY)~=0 then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetLabelObject(bc)
e1:SetCountLimit(1)
e1:SetOperation(c74449028.retop)
Duel.RegisterEffect(e1,tp)
end
if c:IsRelateToEffect(e) and c:IsChainAttackable() then
Duel.ChainAttack()
end
end
function c74449028.retop(e,tp,eg,ep,ev,re,r,rp)
Duel.ReturnToField(e:GetLabelObject())
end
\ No newline at end of file
--轰轰飞艇·飞鼠军
local m=74449029
local cm=_G["c"..m]
function cm.initial_effect(c)
c:EnableCounterPermit(0x279)
aux.AddCodeList(c,74449000)
--xyz summon
aux.AddXyzProcedure(c,aux.FilterBoolFunction(Card.IsCanHaveCounter,0x279),4,2,nil,nil,99)
c:EnableReviveLimit()
--to hand
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(74449029,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH+CATEGORY_GRAVE_ACTION)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCountLimit(1,74449029)
e1:SetCost(c74449029.thcost)
e1:SetCondition(c74449029.thcon)
e1:SetTarget(c74449029.thtg)
e1:SetOperation(c74449029.thop)
c:RegisterEffect(e1)
--overlay
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(74449029,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_GRAVE)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetCountLimit(1,74449129)
e2:SetCondition(aux.exccon)
e2:SetTarget(c74449029.ovtg)
e2:SetOperation(c74449029.ovop)
c:RegisterEffect(e2)
end
function c74449029.thcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_XYZ)
end
function c74449029.thcost(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 c74449029.thfilter(c)
return (c:IsSetCard(0x279) and c:IsAbleToHand()) or (aux.IsCodeListed(c,74449000) and (c:IsType(TYPE_SPELL) or c:IsType(TYPE_TRAP)))
end
function c74449029.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c74449029.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c74449029.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c74449029.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 c74449029.ovfilter(c)
return c:IsSetCard(0x279) and c:IsLevel(4) and c:IsCanOverlay() and c:IsFaceup()
end
function c74449029.ovtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c74449029.ovfilter(chkc) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c74449029.ovfilter,tp,LOCATION_MZONE,0,1,nil)
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local g=Duel.SelectTarget(tp,c74449029.ovfilter,tp,LOCATION_MZONE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function c74449029.ovop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if c:IsRelateToEffect(e) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)>0
and tc:IsRelateToEffect(e) and tc:IsFaceup() then
Duel.Overlay(c,Group.FromCards(tc))
end
end
\ No newline at end of file
--轰轰暴走·炎刃逆鼠
function c74449030.initial_effect(c)
c:EnableCounterPermit(0x279)
aux.AddCodeList(c,74449000)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(74449030,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_TRIGGER_O+EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetCountLimit(1,74449030)
e1:SetTarget(c74449030.sptg)
e1:SetOperation(c74449030.spop)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(74449030,0))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_XMATERIAL+EFFECT_TYPE_IGNITION)
e3:SetCountLimit(1)
e3:SetCondition(c74449030.con)
e3:SetCost(c74449030.cost)
e3:SetTarget(c74449030.tg)
e3:SetOperation(c74449030.op)
c:RegisterEffect(e3)
end
local list={}
function c74449030.con(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsCanHaveCounter(0x279)
end
function c74449030.costf(e,tp,c)
return Duel.IsExistingMatchingCard(c74449030.spfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp,c,1) or Duel.IsExistingMatchingCard(c74449030.spfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp,c,2) or Duel.IsExistingMatchingCard(c74449030.spfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp,c,3) or Duel.IsExistingMatchingCard(c74449030.spfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp,c,4)
end
function c74449030.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c74449030.costf(e,tp,c) end
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(17078030,0))
local announce=Duel.AnnounceNumber(tp,table.unpack(t))
Duel.RemoveCounter(tp,LOCATION_MZONE,0,0x279,announce,REASON_COST)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,announce,tp,LOCATION_EXTRA)
end
function c74449030.spfilter(c,e,tp,mc,num)
if c:IsRank(mc:GetRank()+num) and c:IsSetCard(0x279) and c:IsType(TYPE_XYZ)
and mc:IsCanBeXyzMaterial(c)
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_XYZ,tp,false,false)
and Duel.GetLocationCountFromEx(tp,tp,mc,c)>0
and Duel.IsCanRemoveCounter(tp,1,0,0x279,num,REASON_COST) then
list[num]=num
return true
end
return false
end
function c74449030.tg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c74449030.tgf(e,tp,c) and aux.MustMaterialCheck(c,tp,EFFECT_MUST_BE_XMATERIAL) end
end
function c74449030.op(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsFaceup() and c:IsRelateToEffect(e) and c:IsControler(tp) and not c:IsImmuneToEffect(e) and aux.MustMaterialCheck(c,tp,EFFECT_MUST_BE_XMATERIAL) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c74449030.costf,tp,LOCATION_EXTRA,0,1,1,nil,e,tp,c)
local tc=g:GetFirst()
if tc then
local mg=c:GetOverlayGroup()
if mg:GetCount()>0 then
Duel.Overlay(tc,mg)
end
tc:SetMaterial(Group.FromCards(c))
Duel.Overlay(tc,Group.FromCards(c))
if Duel.SpecialSummon(tc,SUMMON_TYPE_XYZ,tp,tp,false,false,POS_FACEUP)~=0 then
tc:CompleteProcedure()
end
end
end
end
function c74449030.filter(c)
return c:IsSetCard(0x279) and c:IsAbleToHand()
end
function c74449030.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c74449030.filter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c74449030.spop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c74449030.filter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
e:GetHandler():AddCounter(0x279,3)
end
end
\ No newline at end of file
--ENum.29 轰轰惩戒·冠军
function c74449031.initial_effect(c)
c:EnableCounterPermit(0x279)
aux.AddCodeList(c,74449000)
--xyz summon
aux.AddXyzProcedure(c,aux.FilterBoolFunction(Card.IsCanHaveCounter,0x279),4,2,nil,nil,99)
c:EnableReviveLimit()
--
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(74449031,0))
e1:SetCategory(CATEGORY_DAMAGE)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCountLimit(1,74449031000)
e1:SetCondition(c74449031.condition)
e1:SetOperation(c74449031.op)
c:RegisterEffect(e1)
--atkup
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(74449031,1))
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetRange(LOCATION_MZONE)
e2:SetCode(EVENT_ATTACK_ANNOUNCE)
e2:SetCountLimit(1,74449031100)
e2:SetOperation(c74449031.atkop)
c:RegisterEffect(e2)
end
function c74449031.atkop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local val=Duel.GetCounter(tp,LOCATION_ONFIELD,0,0x279)*200
if c:IsFaceup() and c:IsRelateToEffect(e) and val>0 then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(val)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE+RESET_PHASE+PHASE_END)
c:RegisterEffect(e1)
end
end
function c74449031.condition(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_XYZ)
end
function c74449031.op(e,tp,eg,ep,ev,re,r,rp)
e:GetHandler():AddCounter(0x279,3)
end
\ No newline at end of file
--ENum.29 轰轰惩戒·爆印
function c74449032.initial_effect(c)
c:EnableCounterPermit(0x279)
aux.AddCodeList(c,74449000)
--xyz summon
aux.AddXyzProcedure(c,aux.FilterBoolFunction(Card.IsCanHaveCounter,0x279),4,3,c74449032.ovfilter,aux.Stringid(86532744,1),99)
c:EnableReviveLimit()
--
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(74449032,0))
e1:SetCategory(CATEGORY_DAMAGE)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCountLimit(1,74449032000)
e1:SetCondition(c74449032.condition)
e1:SetOperation(c74449032.op)
c:RegisterEffect(e1)
--atkup
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(74449032,1))
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetRange(LOCATION_MZONE)
e2:SetCode(EVENT_ATTACK_ANNOUNCE)
e2:SetCountLimit(1,74449032100)
e2:SetOperation(c74449032.atkop)
c:RegisterEffect(e2)
end
function c74449032.ovfilter(c)
return c:IsFaceup() and c:IsCode(74449031)
end
function c74449032.atkop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local val=Duel.GetCounter(tp,LOCATION_ONFIELD,0,0x279)*200
if c:IsFaceup() and c:IsRelateToEffect(e) and val>0 then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(val)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE+RESET_PHASE+PHASE_END)
c:RegisterEffect(e1)
end
end
function c74449032.condition(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_XYZ) and Duel.IsExistingMatchingCard(nil,tp,0,LOCATION_MZONE,nil)
end
function c74449032.op(e,tp,eg,ep,ev,re,r,rp)
if chk==0 then return Duel.IsExistingMatchingCard(nil,tp,0,LOCATION_MZONE,nil) end
local dg=Duel.GetMatchingGroup(nil,tp,0,LOCATION_MZONE,nil)
if dg:GetCount()>0 then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local sg=dg:Select(tp,1,1,nil)
Duel.HintSelection(sg)
Duel.Destroy(sg,REASON_EFFECT)
local bc=sg:GetFirst()
local lk
if bc:IsLevelAbove(1) then lk=bc:GetOriginalLevel()
elseif bc:IsRankAbove(1) then lk=bc:GetOriginalRank()
elseif bc:IsLinkAbove(1) then lk=bc:GetLink() end
e:GetHandler():AddCounter(0x279,lk)
end
end
\ No newline at end of file
--源初ENum.0 轰轰惩戒·火种
function c74449033.initial_effect(c)
c:EnableCounterPermit(0x279)
aux.AddCodeList(c,74449000)
c:EnableReviveLimit()
aux.AddXyzProcedureLevelFree(c,c74449033.mfilter,c74449033.xyzcheck,2,2)
--
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(74449033,0))
e1:SetCategory(CATEGORY_DAMAGE)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCountLimit(1,74449031000)
e1:SetTarget(c74449033.target)
e1:SetCondition(c74449033.condition)
e1:SetOperation(c74449033.activate)
c:RegisterEffect(e1)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(74449033,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,74449033)
e1:SetCost(c74449033.spcost)
e1:SetOperation(c74449033.spop)
c:RegisterEffect(e1)
end
function c74449033.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:CheckRemoveOverlayCard(tp,1,REASON_COST) and Duel.IsExistingMatchingCard(Card.IsCode,tp,LOCATION_DECK,0,1,nil,74449044) end
c:RemoveOverlayCard(tp,1,1,REASON_COST)
end
function c74449033.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.IsExistingMatchingCard(Card.IsCode,tp,LOCATION_DECK,0,1,nil,74449044) then
local g=Duel.SelectMatchingCard(tp,Card.IsCode,tp,LOCATION_DECK,0,1,1,nil,74449044)
Duel.SendtoHand(g,tp,REASON_EFFECT)
end
end
function c74449033.condition(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_XYZ)
end
function c74449033.filter(c,e,tp)
return c:IsCanBeEffectTarget(e) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c74449033.xyzfilter(c,mg)
return c:IsAttribute(ATTRIBUTE_FIRE) and c:IsXyzSummonable(mg,2,2)
end
function c74449033.mfilter1(c,mg,exg)
return mg:IsExists(c74449033.mfilter2,1,c,c,exg)
end
function c74449033.mfilter2(c,mc,exg)
return exg:IsExists(Card.IsXyzSummonable,1,nil,Group.FromCards(c,mc))
end
function c74449033.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end
local mg=Duel.GetMatchingGroup(c74449033.filter,tp,LOCATION_GRAVE,0,nil,e,tp)
local exg=Duel.GetMatchingGroup(c74449033.xyzfilter,tp,LOCATION_EXTRA,0,nil,mg)
if chk==0 then return Duel.IsPlayerCanSpecialSummonCount(tp,2)
and not Duel.IsPlayerAffectedByEffect(tp,59822133)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>1
and exg:GetCount()>0 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg1=mg:FilterSelect(tp,c74449033.mfilter1,1,1,nil,mg,exg)
local tc1=sg1:GetFirst()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg2=mg:FilterSelect(tp,c74449033.mfilter2,1,1,tc1,tc1,exg)
sg1:Merge(sg2)
Duel.SetTargetCard(sg1)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,sg1,2,0,0)
end
function c74449033.filter2(c,e,tp)
return c:IsRelateToEffect(e) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c74449033.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.IsPlayerAffectedByEffect(tp,59822133) then return end
if Duel.GetLocationCount(tp,LOCATION_MZONE)<2 then return end
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(c74449033.filter2,nil,e,tp)
if g:GetCount()<2 then return end
local tc=g:GetFirst()
while tc do
Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP)
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=e1:Clone()
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetValue(RESET_TURN_SET)
tc:RegisterEffect(e2)
tc=g:GetNext()
end
Duel.SpecialSummonComplete()
Duel.AdjustAll()
if g:FilterCount(Card.IsLocation,nil,LOCATION_MZONE)<2 then return end
local xyzg=Duel.GetMatchingGroup(c74449033.xyzfilter,tp,LOCATION_EXTRA,0,nil,g)
if xyzg:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local xyz=xyzg:Select(tp,1,1,nil):GetFirst()
Duel.XyzSummon(tp,xyz,g)
e:GetHandler():AddCounter(0x279,xyz:GetRank())
end
end
function c74449033.mfilter(c,xyzc)
return c:IsXyzType(TYPE_XYZ) and not c:IsSetCard(0x48)
end
function c74449033.xyzcheck(g)
return g:GetClassCount(Card.GetRank)==1
end
\ No newline at end of file
--升阶魔法-火种之力
function c74449044.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCost(c74449044.cost)
e1:SetCondition(c74449044.condition)
e1:SetTarget(c74449044.target)
e1:SetOperation(c74449044.activate)
c:RegisterEffect(e1)
end
function c74449044.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2
end
function c74449044.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetCounter(0x279)>0 end
Duel.RemoveCounter(tp,LOCATION_ONFIELD,0,1,REASON_COST)
end
function c74449044.filter1(c,e,tp)
local rk=c:GetRank()
return rk>0 and c:IsFaceup() and c:IsAttribute(ATTRIBUTE_FIRE) and c:GetOverlayCount()==0
and Duel.IsExistingMatchingCard(c74449044.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,c,c:GetRank()+1)
and aux.MustMaterialCheck(c,tp,EFFECT_MUST_BE_XMATERIAL)
end
function c74449044.filter2(c,e,tp,mc,rk)
return c:IsRank(rk) and c:IsAttribute(ATTRIBUTE_FIRE) and mc:IsCanBeXyzMaterial(c)
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_XYZ,tp,false,false) and Duel.GetLocationCountFromEx(tp,tp,mc,c)>0
end
function c74449044.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) and c74449044.filter1(chkc,e,tp) end
if chk==0 then return Duel.IsExistingTarget(c74449044.filter1,tp,LOCATION_MZONE,0,1,nil,e,tp)
and e:GetHandler():IsCanOverlay() end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local g=Duel.SelectTarget(tp,c74449044.filter1,tp,LOCATION_MZONE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function c74449044.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if not aux.MustMaterialCheck(tc,tp,EFFECT_MUST_BE_XMATERIAL) then return end
if tc:IsFacedown() or not tc:IsRelateToEffect(e) or tc:IsControler(1-tp) or tc:IsImmuneToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c74449044.filter2,tp,LOCATION_EXTRA,0,1,1,nil,e,tp,tc,tc:GetRank()+1)
local sc=g:GetFirst()
if sc then
local mg=tc:GetOverlayGroup()
if mg:GetCount()~=0 then
Duel.Overlay(sc,mg)
end
sc:SetMaterial(Group.FromCards(tc))
Duel.Overlay(sc,Group.FromCards(tc))
Duel.SpecialSummon(sc,SUMMON_TYPE_XYZ,tp,tp,false,false,POS_FACEUP)
sc:CompleteProcedure()
if c:IsRelateToEffect(e) then
c:CancelToGrave()
Duel.Overlay(sc,Group.FromCards(c))
end
end
end
\ No newline at end of file
...@@ -563,9 +563,6 @@ ...@@ -563,9 +563,6 @@
!setname 0x252 融合势力 !setname 0x252 融合势力
!counter 0x251 过载指示物 !counter 0x251 过载指示物
#胆小的兔子 2490482695 299 0x750-0x75f
!setname 0x751 净怜异灵
#沃亚森斯奥克斯 2201771890 300 0x930-0x93f #沃亚森斯奥克斯 2201771890 300 0x930-0x93f
!setname 0x93a 能力者 !setname 0x93a 能力者
!setname 0xa93a 念能力者 !setname 0xa93a 念能力者
...@@ -1336,12 +1333,6 @@ ...@@ -1336,12 +1333,6 @@
!setname 0x3730 洛克 !setname 0x3730 洛克
!setname 0x5730 圣物 !setname 0x5730 圣物
#龙舞Manto 2294632065 744 0x270-0x27f
!setname 0x270 ENum.
!setname 0x279 轰轰
!setname 0x1279 轰轰惩戒
!counter 0x279 炎爆指示物
#天生 756460095 756 0x2c0-0x2cf #天生 756460095 756 0x2c0-0x2cf
!setname 0x2c0 崩坏 !setname 0x2c0 崩坏
!setname 0x32c0 崩坏神格 !setname 0x32c0 崩坏神格
......
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