Commit a8ce2d50 authored by mercury233's avatar mercury233

update scripts

parent fe634708
#created by ... #created by ...
#main #main
100246002
100200159
100308002
100308003
100308004
100308022
100308023
100308041
100412001
100412004
100412005
100412006
100412012
100412013
100412014
100412015
100412017
100412018
100412020
100412021
100412022
100412023
100412024
100412025
100412026
100412002 100412002
100412003 100412003
100412019 100412019
...@@ -18,6 +43,8 @@ ...@@ -18,6 +43,8 @@
100412027 100412027
100412032 100412032
#extra #extra
100319041
100319042
100412008 100412008
100412009 100412009
100412011 100412011
......
#The first line is used for comment #The first line is used for comment
!victory 0x1f 「守护神 艾克佐迪亚」效果胜利 !victory 0x1f 「守护神 艾克佐迪亚」效果胜利
!setname 0x226 咒眼 !setname 0x226 咒眼
!setname 0x227 无限 !setname 0x227 无限
!setname 0x228 魔女术 !setname 0x228 魔女术
!setname 0x229 时间怪盗 !setname 0x229 时间怪盗
!setname 0x230 恩底弥翁 !setname 0x230 恩底弥翁
--アンクリボー
--
--Script by JoyJ
function c100200159.initial_effect(c)
--Special Summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(100200159,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_ATTACK_ANNOUNCE)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,100200159)
e1:SetCondition(c100200159.spcon)
e1:SetCost(c100200159.spcost)
e1:SetTarget(c100200159.sptg)
e1:SetOperation(c100200159.spop)
c:RegisterEffect(e1)
--To Hand
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(100200159,1))
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_TO_GRAVE)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCountLimit(1,100200159+100)
e2:SetCondition(c100200159.thcon)
e2:SetTarget(c100200159.thtg)
e2:SetOperation(c100200159.thop)
c:RegisterEffect(e2)
end
function c100200159.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()~=tp
end
function c100200159.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsDiscardable() end
Duel.SendtoGrave(e:GetHandler(),REASON_COST+REASON_DISCARD)
end
function c100200159.spfilter(c,e,tp)
return c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c100200159.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local c=e:GetHandler()
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and c100200159.spfilter(chkc,e,tp) and chkc~=c end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c100200159.spfilter,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,c,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c100200159.spfilter,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,1,c,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function c100200159.spop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
local fid=e:GetHandler():GetFieldID()
tc:RegisterFlagEffect(100200159,RESET_EVENT+RESETS_STANDARD,0,1,fid)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetCountLimit(1)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetLabel(fid)
e1:SetLabelObject(tc)
e1:SetCondition(c100200159.tgcon)
e1:SetOperation(c100200159.tgop)
Duel.RegisterEffect(e1,tp)
end
end
function c100200159.tgcon(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject()
if tc:GetFlagEffectLabel(100200159)~=e:GetLabel() then
e:Reset()
return false
else return true end
end
function c100200159.tgop(e,tp,eg,ep,ev,re,r,rp)
Duel.SendtoGrave(e:GetLabelObject(),REASON_EFFECT)
end
function c100200159.thcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsReason(REASON_DESTROY) and e:GetHandler():IsReason(REASON_BATTLE+REASON_EFFECT)
end
function c100200159.thfilter(c)
return c:IsCode(83764718) and c:IsAbleToHand()
end
function c100200159.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c100200159.thfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil) end
end
function c100200159.thop(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_END)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCountLimit(1)
e1:SetOperation(c100200159.thop2)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function c100200159.thop2(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c100200159.thfilter),tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
--Sin Territory --Sin Territory
--
--Script by nekrozar --Script by nekrozar
function c100236116.initial_effect(c) function c100236116.initial_effect(c)
--Activate --Activate
......
...@@ -28,7 +28,7 @@ function c100236117.initial_effect(c) ...@@ -28,7 +28,7 @@ function c100236117.initial_effect(c)
c:RegisterEffect(e3) c:RegisterEffect(e3)
--To hand --To hand
local e4=Effect.CreateEffect(c) local e4=Effect.CreateEffect(c)
e4:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH) e4:SetCategory(CATEGORY_TOHAND)
e4:SetType(EFFECT_TYPE_IGNITION) e4:SetType(EFFECT_TYPE_IGNITION)
e4:SetProperty(EFFECT_FLAG_CARD_TARGET) e4:SetProperty(EFFECT_FLAG_CARD_TARGET)
e4:SetRange(LOCATION_GRAVE) e4:SetRange(LOCATION_GRAVE)
......
--エンプレス・オブ・エンディミオン
--
--Script by JoyJ and mercury233
function c100308002.initial_effect(c)
--Pendulum Summon
c:EnableCounterPermit(0x1,LOCATION_PZONE+LOCATION_MZONE)
aux.EnablePendulumAttribute(c)
c:SetSPSummonOnce(100308002)
--Add Counter
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e1:SetCode(EVENT_CHAINING)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetRange(LOCATION_PZONE)
e1:SetOperation(aux.chainreg)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e2:SetCode(EVENT_CHAIN_SOLVED)
e2:SetRange(LOCATION_PZONE)
e2:SetOperation(c100308002.counterop)
c:RegisterEffect(e2)
--Special Summon
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(100308002,0))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_PZONE)
e3:SetCountLimit(1)
e3:SetCost(c100308002.spcost)
e3:SetTarget(c100308002.sptg)
e3:SetOperation(c100308002.spop)
c:RegisterEffect(e3)
--Special Summon Success
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(100308002,1))
e4:SetCategory(CATEGORY_TOHAND)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e4:SetCode(EVENT_SPSUMMON_SUCCESS)
e4:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET)
e4:SetTarget(c100308002.rthtg)
e4:SetOperation(c100308002.rthop)
c:RegisterEffect(e4)
--Deck Search
local e5=Effect.CreateEffect(c)
e5:SetDescription(aux.Stringid(100308002,2))
e5:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e5:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e5:SetCode(EVENT_BATTLE_DESTROYED)
e5:SetTarget(c100308002.thtg)
e5:SetOperation(c100308002.thop)
c:RegisterEffect(e5)
local e6=Effect.CreateEffect(c)
e6:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e6:SetCode(EVENT_LEAVE_FIELD_P)
e6:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e6:SetOperation(c100308002.regop)
e6:SetLabelObject(e5)
c:RegisterEffect(e6)
end
function c100308002.counterop(e,tp,eg,ep,ev,re,r,rp)
if re:IsHasType(EFFECT_TYPE_ACTIVATE) and re:IsActiveType(TYPE_SPELL) and e:GetHandler():GetFlagEffect(1)>0 then
e:GetHandler():AddCounter(0x1,1)
end
end
function c100308002.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsCanRemoveCounter(tp,0x1,3,REASON_COST) end
e:GetHandler():RemoveCounter(tp,0x1,3,REASON_COST)
end
function c100308002.spfilter(c,e,tp)
return c:IsCanAddCounter(0x1,1,false,LOCATION_MZONE) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c100308002.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>=2 and not Duel.IsPlayerAffectedByEffect(tp,59822133)
and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and c:IsCanAddCounter(0x1,1,false,LOCATION_MZONE)
and Duel.IsExistingMatchingCard(c100308002.spfilter,tp,LOCATION_HAND,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,2,tp,LOCATION_HAND+LOCATION_PZONE)
end
function c100308002.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
if Duel.IsPlayerAffectedByEffect(tp,59822133) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c100308002.spfilter,tp,LOCATION_HAND,0,1,1,nil,e,tp)
if g:GetCount()>0 then
g:AddCard(c)
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
for tc in aux.Next(g) do
tc:AddCounter(0x1,1)
end
end
end
function c100308002.rthfilter(c)
return c:IsAbleToHand() and c:GetCounter(0x1)>0
end
function c100308002.rthtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end
if chk==0 then return Duel.IsExistingTarget(c100308002.rthfilter,tp,LOCATION_ONFIELD,0,1,e:GetHandler())
and Duel.IsExistingTarget(Card.IsAbleToHand,tp,0,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local g1=Duel.SelectTarget(tp,c100308002.rthfilter,tp,LOCATION_ONFIELD,0,1,1,e:GetHandler())
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local g2=Duel.SelectTarget(tp,Card.IsAbleToHand,tp,0,LOCATION_ONFIELD,1,1,nil)
g1:Merge(g2)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g1,g1:GetCount(),0,LOCATION_ONFIELD)
end
function c100308002.rthop(e,tp,eg,ep,ev,re,r,rp)
local tg=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
local g=tg:Filter(Card.IsRelateToEffect,nil,e)
local ct=0
for tc in aux.Next(g) do
if tc:IsControler(tp) then
ct=ct+tc:GetCounter(0x1)
end
end
Duel.SendtoHand(g,nil,REASON_EFFECT)
if Duel.GetOperatedGroup():GetCount()>0 then
e:GetHandler():AddCounter(0x1,ct)
end
end
function c100308002.thcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetLabel()>0
end
function c100308002.thfilter(c)
return c:IsSetCard(0x230) and c:IsAbleToHand()
end
function c100308002.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c100308002.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c100308002.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c100308002.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 c100308002.regop(e,tp,eg,ep,ev,re,r,rp)
e:GetLabelObject():SetLabel(e:GetHandler():GetCounter(0x1))
end
--マギステル・オブ・エンディミオン
--
--Script by JoyJ and mercury233
function c100308003.initial_effect(c)
--Pendulum Summon
c:EnableCounterPermit(0x1,LOCATION_PZONE+LOCATION_MZONE)
aux.EnablePendulumAttribute(c)
c:SetSPSummonOnce(100308003)
--Add Counter
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e1:SetCode(EVENT_CHAINING)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetRange(LOCATION_PZONE)
e1:SetOperation(aux.chainreg)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e2:SetCode(EVENT_CHAIN_SOLVED)
e2:SetRange(LOCATION_PZONE)
e2:SetOperation(c100308003.counterop)
c:RegisterEffect(e2)
--Special Summon
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(100308003,0))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_PZONE)
e3:SetCountLimit(1)
e3:SetCost(c100308003.spcost)
e3:SetTarget(c100308003.sptg)
e3:SetOperation(c100308003.spop)
c:RegisterEffect(e3)
--add counter
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(100308003,1))
e4:SetCategory(CATEGORY_COUNTER)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e4:SetCode(EVENT_ATTACK_ANNOUNCE)
e4:SetTarget(c100308003.countertg2)
e4:SetOperation(c100308003.counterop2)
c:RegisterEffect(e4)
--special summon
local e5=Effect.CreateEffect(c)
e5:SetDescription(aux.Stringid(100308003,2))
e5:SetType(EFFECT_TYPE_QUICK_O)
e5:SetCode(EVENT_FREE_CHAIN)
e5:SetRange(LOCATION_MZONE)
e5:SetCountLimit(1)
e5:SetHintTiming(0,TIMING_END_PHASE)
e5:SetCondition(c100308003.spcon2)
e5:SetCost(c100308003.spcost2)
e5:SetTarget(c100308003.sptg2)
e5:SetOperation(c100308003.spop2)
c:RegisterEffect(e5)
--pendulum set
local e6=Effect.CreateEffect(c)
e6:SetDescription(aux.Stringid(100308003,1))
e6:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e6:SetProperty(EFFECT_FLAG_DELAY)
e6:SetCode(EVENT_DESTROYED)
e6:SetCondition(c100308003.pencon)
e6:SetTarget(c100308003.pentg)
e6:SetOperation(c100308003.penop)
c:RegisterEffect(e6)
local e7=Effect.CreateEffect(c)
e7:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e7:SetCode(EVENT_LEAVE_FIELD_P)
e7:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e7:SetOperation(c100308003.regop)
e7:SetLabelObject(e6)
c:RegisterEffect(e7)
end
function c100308003.counterop(e,tp,eg,ep,ev,re,r,rp)
if re:IsHasType(EFFECT_TYPE_ACTIVATE) and re:IsActiveType(TYPE_SPELL) and e:GetHandler():GetFlagEffect(1)>0 then
e:GetHandler():AddCounter(0x1,1)
end
end
function c100308003.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsCanRemoveCounter(tp,0x1,3,REASON_COST) end
e:GetHandler():RemoveCounter(tp,0x1,3,REASON_COST)
end
function c100308003.spfilter(c,e,tp)
return c:IsFaceup() and c:IsCanAddCounter(0x1,1,false,LOCATION_MZONE) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c100308003.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>=2 and not Duel.IsPlayerAffectedByEffect(tp,59822133)
and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and c:IsCanAddCounter(0x1,1,false,LOCATION_MZONE)
and Duel.IsExistingMatchingCard(c100308003.spfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,2,tp,LOCATION_EXTRA+LOCATION_PZONE)
end
function c100308003.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
if Duel.IsPlayerAffectedByEffect(tp,59822133) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c100308003.spfilter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp)
if g:GetCount()>0 then
g:AddCard(c)
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
for tc in aux.Next(g) do
tc:AddCounter(0x1,1)
end
end
end
function c100308003.countertg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsCanAddCounter(0x1,1) end
Duel.SetOperationInfo(0,CATEGORY_COUNTER,nil,1,0,0)
end
function c100308003.counterop2(e,tp,eg,ep,ev,re,r,rp)
e:GetHandler():AddCounter(0x1,1)
end
function c100308003.spcon2(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==1-tp
end
function c100308003.spcost2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsCanRemoveCounter(tp,1,0,0x1,3,REASON_COST) end
Duel.RemoveCounter(tp,1,0,0x1,3,REASON_COST)
end
function c100308003.spfilter2(c,e,tp)
return c:IsCanAddCounter(0x1,1,false,LOCATION_MZONE) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c100308003.sptg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c100308003.spfilter2,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function c100308003.spop2(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tc=Duel.SelectMatchingCard(tp,c100308003.spfilter2,tp,LOCATION_DECK,0,1,1,nil,e,tp):GetFirst()
if tc then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
end
end
function c100308003.pencon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsPreviousLocation(LOCATION_MZONE) and c:IsFaceup()
end
function c100308003.pentg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckLocation(tp,LOCATION_PZONE,0) or Duel.CheckLocation(tp,LOCATION_PZONE,1) end
end
function c100308003.penop(e,tp,eg,ep,ev,re,r,rp)
if not Duel.CheckLocation(tp,LOCATION_PZONE,0) and not Duel.CheckLocation(tp,LOCATION_PZONE,1) then return end
local c=e:GetHandler()
if c:IsRelateToEffect(e) and Duel.MoveToField(c,tp,tp,LOCATION_SZONE,POS_FACEUP,true) then
c:AddCounter(0x1,e:GetLabel())
end
end
function c100308003.regop(e,tp,eg,ep,ev,re,r,rp)
e:GetLabelObject():SetLabel(e:GetHandler():GetCounter(0x1))
end
--サーヴァント・オブ・エンディミオン
--
--Script by JoyJ and mercury233
function c100308004.initial_effect(c)
--Pendulum Summon
c:EnableCounterPermit(0x1,LOCATION_PZONE+LOCATION_MZONE)
aux.EnablePendulumAttribute(c)
c:SetSPSummonOnce(100308004)
--Add Counter
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e1:SetCode(EVENT_CHAINING)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetRange(LOCATION_PZONE)
e1:SetOperation(aux.chainreg)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e2:SetCode(EVENT_CHAIN_SOLVED)
e2:SetRange(LOCATION_PZONE)
e2:SetOperation(c100308004.counterop)
c:RegisterEffect(e2)
--Special Summon
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(100308004,0))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_PZONE)
e3:SetCountLimit(1)
e3:SetCost(c100308004.spcost)
e3:SetTarget(c100308004.sptg)
e3:SetOperation(c100308004.spop)
c:RegisterEffect(e3)
--direct attack
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetCode(EFFECT_DIRECT_ATTACK)
e4:SetCondition(c100308004.dacon)
c:RegisterEffect(e4)
--add counter
local e5=Effect.CreateEffect(c)
e5:SetDescription(aux.Stringid(100308003,2))
e5:SetType(EFFECT_TYPE_QUICK_O)
e5:SetCode(EVENT_FREE_CHAIN)
e5:SetRange(LOCATION_MZONE)
e5:SetCountLimit(1)
e5:SetHintTiming(0,TIMING_END_PHASE)
e5:SetCondition(c100308004.countercon2)
e5:SetCost(c100308004.countercost2)
e5:SetTarget(c100308004.countertg2)
e5:SetOperation(c100308004.counterop2)
c:RegisterEffect(e5)
--pendulum set
local e6=Effect.CreateEffect(c)
e6:SetDescription(aux.Stringid(100308004,1))
e6:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e6:SetProperty(EFFECT_FLAG_DELAY)
e6:SetCode(EVENT_DESTROYED)
e6:SetCondition(c100308004.pencon)
e6:SetTarget(c100308004.pentg)
e6:SetOperation(c100308004.penop)
c:RegisterEffect(e6)
local e7=Effect.CreateEffect(c)
e7:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e7:SetCode(EVENT_LEAVE_FIELD_P)
e7:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e7:SetOperation(c100308004.regop)
e7:SetLabelObject(e6)
c:RegisterEffect(e7)
end
function c100308004.counterop(e,tp,eg,ep,ev,re,r,rp)
if re:IsHasType(EFFECT_TYPE_ACTIVATE) and re:IsActiveType(TYPE_SPELL) and e:GetHandler():GetFlagEffect(1)>0 then
e:GetHandler():AddCounter(0x1,1)
end
end
function c100308004.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsCanRemoveCounter(tp,0x1,3,REASON_COST) end
e:GetHandler():RemoveCounter(tp,0x1,3,REASON_COST)
end
function c100308004.spfilter(c,e,tp)
return c:IsAttackAbove(1000) and c:IsCanAddCounter(0x1,1,false,LOCATION_MZONE) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c100308004.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>=2 and not Duel.IsPlayerAffectedByEffect(tp,59822133)
and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and c:IsCanAddCounter(0x1,1,false,LOCATION_MZONE)
and Duel.IsExistingMatchingCard(c100308004.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,2,tp,LOCATION_DECK+LOCATION_PZONE)
end
function c100308004.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
if Duel.IsPlayerAffectedByEffect(tp,59822133) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c100308004.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
if g:GetCount()>0 then
g:AddCard(c)
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
for tc in aux.Next(g) do
tc:AddCounter(0x1,1)
end
end
end
function c100308004.dacon(e)
return e:GetHandler():GetCounter(0x1)>0
end
function c100308004.countercon2(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==1-tp
end
function c100308004.countercost2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,1,e:GetHandler()) end
Duel.DiscardHand(tp,Card.IsDiscardable,1,1,REASON_COST+REASON_DISCARD)
end
function c100308004.countertg2(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsCanAddCounter(0x1,1)
and Duel.IsExistingMatchingCard(Card.IsCanAddCounter,tp,LOCATION_ONFIELD,0,1,c,0x1,1) end
local g=Duel.GetMatchingGroup(Card.IsCanAddCounter,tp,LOCATION_ONFIELD,0,c,0x1,1)
g:AddCard(c)
Duel.SetOperationInfo(0,CATEGORY_COUNTER,g,#g,0,0)
end
function c100308004.counterop2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetMatchingGroup(Card.IsCanAddCounter,tp,LOCATION_ONFIELD,0,c,0x1,1)
if c:IsRelateToEffect(e) then g:AddCard(c) end
for tc in aux.Next(g) do
if tc:IsCanAddCounter(0x1,1) then
tc:AddCounter(0x1,1)
end
end
end
function c100308004.pencon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsPreviousLocation(LOCATION_MZONE) and c:IsFaceup()
end
function c100308004.pentg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckLocation(tp,LOCATION_PZONE,0) or Duel.CheckLocation(tp,LOCATION_PZONE,1) end
end
function c100308004.penop(e,tp,eg,ep,ev,re,r,rp)
if not Duel.CheckLocation(tp,LOCATION_PZONE,0) and not Duel.CheckLocation(tp,LOCATION_PZONE,1) then return end
local c=e:GetHandler()
if c:IsRelateToEffect(e) and Duel.MoveToField(c,tp,tp,LOCATION_SZONE,POS_FACEUP,true) then
c:AddCounter(0x1,e:GetLabel())
end
end
function c100308004.regop(e,tp,eg,ep,ev,re,r,rp)
e:GetLabelObject():SetLabel(e:GetHandler():GetCounter(0x1))
end
--魔力統轄
--
--Script by JoyJ and mercury233
function c100308022.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,100308022+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(c100308022.target)
e1:SetOperation(c100308022.operation)
c:RegisterEffect(e1)
end
function c100308022.filter(c)
return c:IsSetCard(0x230) and c:IsAbleToHand()
end
function c100308022.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c100308022.filter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c100308022.cfilter(c)
return c:IsCode(100308022,75014062) and (c:IsFaceup() or c:IsLocation(LOCATION_GRAVE))
end
function c100308022.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c100308022.filter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 and Duel.SendtoHand(g,nil,REASON_EFFECT)>0 then
Duel.ConfirmCards(1-tp,g)
local ct=Duel.GetMatchingGroupCount(c100308022.cfilter,tp,LOCATION_ONFIELD+LOCATION_GRAVE,0,nil)
if ct>0 and Duel.GetMatchingGroupCount(Card.IsCanAddCounter,tp,LOCATION_ONFIELD,0,nil,0x1,1)>0
and Duel.SelectYesNo(tp,aux.Stringid(100308022,0)) then
while ct>0 do
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(100308022,1))
local tc=Duel.SelectMatchingCard(tp,Card.IsCanAddCounter,tp,LOCATION_ONFIELD,0,1,1,nil,0x1,1):GetFirst()
if not tc then break end
tc:AddCounter(0x1,1)
ct=ct-1
end
end
end
end
--魔法都市の実験施設
--
--Script by JoyJ and mercury233
function c100308023.initial_effect(c)
c:EnableCounterPermit(0x1,LOCATION_SZONE)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,100308023+EFFECT_COUNT_CODE_OATH)
c:RegisterEffect(e1)
--Code Change
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_CHANGE_CODE)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetRange(LOCATION_SZONE)
e2:SetValue(39910367)
c:RegisterEffect(e2)
--Add Counter
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
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_CONTINUOUS+EFFECT_TYPE_FIELD)
e4:SetCode(EVENT_CHAIN_SOLVED)
e4:SetRange(LOCATION_SZONE)
e4:SetOperation(c100308023.counterop)
c:RegisterEffect(e4)
--Special Summon
local e5=Effect.CreateEffect(c)
e5:SetDescription(aux.Stringid(100308023,0))
e5:SetCategory(CATEGORY_SPECIAL_SUMMON)
e5:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e5:SetCode(EVENT_BATTLED)
e5:SetRange(LOCATION_SZONE)
e5:SetCondition(c100308023.spcon)
e5:SetCost(c100308023.spcost)
e5:SetTarget(c100308023.sptg)
e5:SetOperation(c100308023.spop)
c:RegisterEffect(e5)
end
function c100308023.counterop(e,tp,eg,ep,ev,re,r,rp)
if re:IsHasType(EFFECT_TYPE_ACTIVATE) and re:IsActiveType(TYPE_SPELL) and e:GetHandler():GetFlagEffect(1)>0 then
e:GetHandler():AddCounter(0x1,1)
end
end
function c100308023.spconcheck(c,tp)
return c and c:IsRace(RACE_SPELLCASTER) and c:IsControler(tp) and c:IsStatus(STATUS_BATTLE_DESTROYED)
end
function c100308023.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetAttackTarget()~=nil
and (c100308023.spconcheck(Duel.GetAttacker(),tp)
or c100308023.spconcheck(Duel.GetAttackTarget(),tp))
end
function c100308023.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsCanRemoveCounter(tp,LOCATION_ONFIELD,0,0x1,6,REASON_COST) end
Duel.RemoveCounter(tp,LOCATION_ONFIELD,0,0x1,6,REASON_COST)
end
function c100308023.spfilter(c,e,tp)
return c:IsRace(RACE_SPELLCASTER) and c:IsLevelAbove(7) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c100308023.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c100308023.spfilter,tp,LOCATION_DECK+LOCATION_HAND,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function c100308023.spop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c100308023.spfilter,tp,LOCATION_DECK+LOCATION_HAND,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
--救魔の標
--
--Script by mercury233
function c100308041.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,100308041+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(c100308041.target)
e1:SetOperation(c100308041.activate)
c:RegisterEffect(e1)
end
function c100308041.filter(c)
return c:IsRace(RACE_SPELLCASTER) and c:IsType(TYPE_EFFECT) and c:IsAbleToHand()
end
function c100308041.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:GetControler()==tp and chkc:GetLocation()==LOCATION_GRAVE and c100308041.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c100308041.filter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectTarget(tp,c100308041.filter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0)
end
function c100308041.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
end
end
--デコード・トーカー・エクステンド
--
--Script by JoyJ
function c100319041.initial_effect(c)
c:EnableReviveLimit()
aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsLinkType,TYPE_EFFECT),2)
--Change Name
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CHANGE_CODE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetValue(1861629)
c:RegisterEffect(e1)
--Atk Up
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetRange(LOCATION_MZONE)
e2:SetValue(c100319041.atkval)
c:RegisterEffect(e2)
--Double Attack
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EVENT_BATTLE_DESTROYED)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e3:SetRange(LOCATION_MZONE)
e3:SetCondition(c100319041.regcon)
e3:SetOperation(c100319041.regop)
c:RegisterEffect(e3)
local e4=e3:Clone()
e4:SetCode(EVENT_TO_GRAVE)
e4:SetCondition(c100319041.regcon2)
c:RegisterEffect(e4)
local e5=Effect.CreateEffect(c)
e5:SetDescription(aux.Stringid(100319041,0))
e5:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e5:SetCode(EVENT_CUSTOM+100319041)
e5:SetProperty(EFFECT_FLAG_SINGLE_RANGE+EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP)
e5:SetRange(LOCATION_MZONE)
e5:SetCountLimit(1)
e5:SetCondition(c100319041.atkcon)
e5:SetTarget(c100319041.atktg)
e5:SetOperation(c100319041.atkop)
c:RegisterEffect(e5)
end
function c100319041.atkval(e,c)
return c:GetLinkedGroupCount()*500
end
function c100319041.cfilter(c,tp,zone)
local seq=c:GetPreviousSequence()
if c:GetPreviousControler()~=tp then seq=seq+16 end
return c:IsPreviousLocation(LOCATION_MZONE) and bit.extract(zone,seq)~=0
end
function c100319041.regcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c100319041.cfilter,1,nil,tp,e:GetHandler():GetLinkedZone())
end
function c100319041.cfilter2(c,tp,zone)
return not c:IsReason(REASON_BATTLE) and c100319041.cfilter(c,tp,zone)
end
function c100319041.regcon2(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c100319041.cfilter2,1,nil,tp,e:GetHandler():GetLinkedZone())
end
function c100319041.regop(e,tp,eg,ep,ev,re,r,rp)
Duel.RaiseSingleEvent(e:GetHandler(),EVENT_CUSTOM+100319041,e,0,tp,0,0)
end
function c100319041.atkcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==tp
and Duel.GetCurrentPhase()>=PHASE_BATTLE_START and Duel.GetCurrentPhase()<=PHASE_BATTLE
end
function c100319041.atktg(e,tp,eg,ep,ev,re,r,rp,chk)
return not e:GetHandler():IsHasEffect(EFFECT_EXTRA_ATTACK)
end
function c100319041.atkop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EFFECT_EXTRA_ATTACK)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
e1:SetValue(1)
c:RegisterEffect(e1)
end
--トラックブラック
--
--Script by JoyJ
function c100319042.initial_effect(c)
aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsLinkType,TYPE_EFFECT),2,2)
c:EnableReviveLimit()
--Draw
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(100319042,0))
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,100319042)
e1:SetTarget(c100319042.target)
e1:SetOperation(c100319042.operation)
c:RegisterEffect(e1)
end
function c100319042.tgfilter(c,lg)
return c:IsFaceup() and lg:IsContains(c)
end
function c100319042.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local lg=e:GetHandler():GetLinkedGroup()
if chkc then return chkc:IsLocation(LOCATION_MZONE) and c:IsFaceup() and chkc:IsControler(tp) end
if chk==0 then return Duel.IsExistingTarget(c100319042.tgfilter,tp,LOCATION_MZONE,0,1,nil,lg) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
Duel.SelectTarget(tp,c100319042.tgfilter,tp,LOCATION_MZONE,0,1,1,nil,lg)
end
function c100319042.operation(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local tc=Duel.GetFirstTarget()
if not tc:IsRelateToEffect(e) then return end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetDescription(aux.Stringid(100319042,1))
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_BATTLE_DESTROYING)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
e1:SetCondition(aux.bdocon)
e1:SetOperation(c100319042.drop)
tc:RegisterEffect(e1)
end
function c100319042.drop(e,tp,eg,ep,ev,re,r,rp)
Duel.Draw(tp,1,REASON_EFFECT)
end
--無限起動ハーヴェスター
--
--Script by JoyJ
function c100412001.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(100412001,0))
e1:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCountLimit(1,100412001)
e1:SetTarget(c100412001.thtg)
e1:SetOperation(c100412001.thop)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e2)
--lv change
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(100412001,1))
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1,100412001+100)
e3:SetTarget(c100412001.lvtg)
e3:SetOperation(c100412001.lvop)
c:RegisterEffect(e3)
end
function c100412001.thfilter(c)
return c:IsSetCard(0x227) and c:IsAbleToHand() and not c:IsCode(100412001)
end
function c100412001.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c100412001.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c100412001.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c100412001.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
end
end
function c100412001.lvfilter(c)
return c:IsFaceup() and c:IsRace(RACE_MACHINE) and c:IsLevelAbove(0)
end
function c100412001.lvtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local c=e:GetHandler()
if chkc then return chkc:IsControler(tp) and chkc~=c and chkc:IsLocation(LOCATION_MZONE) and c100412001.lvfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c100412001.lvfilter,tp,LOCATION_MZONE,0,1,c) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
Duel.SelectTarget(tp,c100412001.lvfilter,tp,LOCATION_MZONE,0,1,1,c)
end
function c100412001.lvop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if c:IsRelateToEffect(e) and tc:IsRelateToEffect(e) then
local lv=c:GetOriginalLevel()+tc:GetOriginalLevel()
c100412001.setlv(c,c,lv)
c100412001.setlv(c,tc,lv)
end
end
function c100412001.setlv(c,ec,lv)
local e1=Effect.CreateEffect(c)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CHANGE_LEVEL)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
e1:SetValue(lv)
ec:RegisterEffect(e1)
end
...@@ -50,7 +50,7 @@ function c100412002.lvfilter(c) ...@@ -50,7 +50,7 @@ function c100412002.lvfilter(c)
end end
function c100412002.lvtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c100412002.lvtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local c=e:GetHandler() local c=e:GetHandler()
if chkc then return chkc:IsLocation(LOCATION_MZONE) and c100412002.lvfilter(chkc) end if chkc then return chkc:IsControler(tp) and chkc~=c and chkc:IsLocation(LOCATION_MZONE) and c100412002.lvfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c100412002.lvfilter,tp,LOCATION_MZONE,0,1,c) end if chk==0 then return Duel.IsExistingTarget(c100412002.lvfilter,tp,LOCATION_MZONE,0,1,c) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
Duel.SelectTarget(tp,c100412002.lvfilter,tp,LOCATION_MZONE,0,1,1,c) Duel.SelectTarget(tp,c100412002.lvfilter,tp,LOCATION_MZONE,0,1,1,c)
......
...@@ -54,7 +54,7 @@ function c100412003.thcost(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -54,7 +54,7 @@ function c100412003.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.Remove(g,POS_FACEUP,REASON_COST) Duel.Remove(g,POS_FACEUP,REASON_COST)
end end
function c100412003.thfilter(c) function c100412003.thfilter(c)
return c:IsAbleToHand() and c:IsCode(100412999) return c:IsAbleToHand() and c:IsCode(100412012)
end end
function c100412003.thtg(e,tp,eg,ep,ev,re,r,rp,chk) function c100412003.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c100412003.thfilter,tp,LOCATION_DECK,0,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(c100412003.thfilter,tp,LOCATION_DECK,0,1,nil) end
......
--無限起動ドラグショベル
--
--Script by JoyJ
function c100412004.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(100412004,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,100412004)
e1:SetCost(c100412004.spcost)
e1:SetTarget(c100412004.sptg)
e1:SetOperation(c100412004.spop)
c:RegisterEffect(e1)
--search
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(100412004,1))
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,100412004+100)
e2:SetCost(c100412004.thcost)
e2:SetTarget(c100412004.thtg)
e2:SetOperation(c100412004.thop)
c:RegisterEffect(e2)
end
function c100412004.cfilter(c,tp)
return c:IsRace(RACE_MACHINE) and c:IsAttribute(ATTRIBUTE_EARTH) and Duel.GetMZoneCount(tp,c)>0
end
function c100412004.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroup(tp,c100412004.cfilter,1,nil,tp) end
local g=Duel.SelectReleaseGroup(tp,c100412004.cfilter,1,1,nil,tp)
Duel.Release(g,REASON_COST)
end
function c100412004.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 c100412004.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_DEFENSE)
end
end
function c100412004.thcfilter(c)
return c:IsRace(RACE_MACHINE) and c:IsType(TYPE_MONSTER) and c:IsAbleToRemoveAsCost()
end
function c100412004.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c100412004.thcfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,c100412004.thcfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.Remove(g,POS_FACEUP,REASON_COST)
end
function c100412004.thfilter(c)
return c:IsAbleToHand() and c:IsCode(100412013)
end
function c100412004.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c100412004.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c100412004.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c100412004.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
--無限起動トレンチャー
--
--Script by JoyJ
function c100412005.initial_effect(c)
--Special Summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(100412005,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,100412005)
e1:SetCost(c100412005.spcost)
e1:SetTarget(c100412005.sptg)
e1:SetOperation(c100412005.spop)
c:RegisterEffect(e1)
--Special Summon from Grave
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(100412005,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,100412005+100)
e2:SetCost(aux.bfgcost)
e2:SetTarget(c100412005.sptg2)
e2:SetOperation(c100412005.spop2)
c:RegisterEffect(e2)
end
function c100412005.cfilter(c,tp)
return c:IsRace(RACE_MACHINE) and c:IsAttribute(ATTRIBUTE_EARTH) and Duel.GetMZoneCount(tp,c)>0
end
function c100412005.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroup(tp,c100412005.cfilter,1,nil,tp) end
local g=Duel.SelectReleaseGroup(tp,c100412005.cfilter,1,1,nil,tp)
Duel.Release(g,REASON_COST)
end
function c100412005.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 c100412005.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_DEFENSE)
end
end
function c100412005.spfilter2(c,e,tp)
return c:IsLevelBelow(5) and c:IsSetCard(0x227) and not c:IsCode(100412005)
and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE)
end
function c100412005.sptg2(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_GRAVE) and c100412005.spfilter2(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c100412005.spfilter2,tp,LOCATION_GRAVE,0,1,e:GetHandler(),e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c100412005.spfilter2,tp,LOCATION_GRAVE,0,1,1,e:GetHandler(),e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function c100412005.spop2(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP_DEFENSE)
end
end
--無限起動スクレイパー
--
--Script by JoyJ
function c100412006.initial_effect(c)
--Special Summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(100412006,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,100412006)
e1:SetCost(c100412006.spcost)
e1:SetTarget(c100412006.sptg)
e1:SetOperation(c100412006.spop)
c:RegisterEffect(e1)
--Draw
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(100412006,1))
e2:SetCategory(CATEGORY_TODECK+CATEGORY_DRAW)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,100412006+100)
e2:SetCost(aux.bfgcost)
e2:SetTarget(c100412006.drtg)
e2:SetOperation(c100412006.drop)
c:RegisterEffect(e2)
end
function c100412006.cfilter(c,tp)
return c:IsRace(RACE_MACHINE) and c:IsAttribute(ATTRIBUTE_EARTH) and Duel.GetMZoneCount(tp,c)>0
end
function c100412006.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroup(tp,c100412006.cfilter,1,nil,tp) end
local g=Duel.SelectReleaseGroup(tp,c100412006.cfilter,1,1,nil,tp)
Duel.Release(g,REASON_COST)
end
function c100412006.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 c100412006.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_DEFENSE)
end
end
function c100412006.tdfilter(c,e,tp)
return c:IsRace(RACE_MACHINE) and c:IsAttribute(ATTRIBUTE_EARTH) and c:IsAbleToDeck()
end
function c100412006.drtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c100412006.tdfilter(chkc) end
if chk==0 then return Duel.IsPlayerCanDraw(tp,2)
and Duel.IsExistingTarget(c100412006.tdfilter,tp,LOCATION_GRAVE,0,5,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectTarget(tp,c100412006.tdfilter,tp,LOCATION_GRAVE,0,5,5,e:GetHandler())
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,g:GetCount(),0,0)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,2)
end
function c100412006.drop(e,tp,eg,ep,ev,re,r,rp)
local tg=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(Card.IsRelateToEffect,nil,e)
if #tg==0 then return end
Duel.SendtoDeck(tg,nil,0,REASON_EFFECT)
local g=Duel.GetOperatedGroup()
if g:IsExists(Card.IsLocation,1,nil,LOCATION_DECK) then Duel.ShuffleDeck(tp) end
local ct=g:FilterCount(Card.IsLocation,nil,LOCATION_DECK+LOCATION_EXTRA)
if ct>0 then
Duel.BreakEffect()
Duel.Draw(tp,2,REASON_EFFECT)
end
end
--超接地展開
--
--Script by JoyJ
function c100412012.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--Cannot Become Target
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e2:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e2:SetRange(LOCATION_SZONE)
e2:SetTargetRange(LOCATION_MZONE,0)
e2:SetTarget(c100412012.immtg)
e2:SetValue(aux.tgoval)
c:RegisterEffect(e2)
--Rank Up
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(100412012,0))
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetRange(LOCATION_SZONE)
e3:SetCountLimit(1)
e3:SetTarget(c100412012.target)
e3:SetOperation(c100412012.operation)
c:RegisterEffect(e3)
end
function c100412012.immtg(e,c)
return c:IsRace(RACE_MACHINE) and c:IsType(TYPE_XYZ) and c:IsFaceup()
end
function c100412012.tgfilter(c,e,tp)
if not (c:IsFaceup() and c:IsType(TYPE_XYZ) and c:IsSetCard(0x227) and Duel.GetLocationCountFromEx(tp,tp,c)>0) then return false end
return Duel.IsExistingMatchingCard(c100412012.spfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp,c:GetRank()+2,c)
end
function c100412012.spfilter(c,e,tp,rank,mc)
return c:IsRace(RACE_MACHINE) and c:IsType(TYPE_XYZ) and c:IsRank(rank) and mc:IsCanBeXyzMaterial(c,tp)
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_XYZ,tp,false,false)
end
function c100412012.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and c100412012.tgfilter(chkc,e,tp) end
if chk==0 then return Duel.IsExistingTarget(c100412012.tgfilter,tp,LOCATION_MZONE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
Duel.SelectTarget(tp,c100412012.tgfilter,tp,LOCATION_MZONE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function c100412012.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if not tc:IsRelateToEffect(e) or not tc:IsControler(tp) or Duel.GetLocationCountFromEx(tp,tp,tc)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c100412012.spfilter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp,tc:GetRank()+2,tc)
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()
end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(1,0)
e1:SetTarget(c100412012.splimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function c100412012.splimit(e,c,sump,sumtype,sumpos,targetp,se)
return not (c:IsRace(RACE_MACHINE) and c:IsAttribute(ATTRIBUTE_EARTH))
end
--超信地旋回
--
--Script by mercury233 and JoyJ
function c100412013.initial_effect(c)
--destroy monster
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(100412013,0))
e1:SetCategory(CATEGORY_POSITION+CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER)
e1:SetTarget(c100412013.target1)
e1:SetOperation(c100412013.operation1)
c:RegisterEffect(e1)
--destroy s&t
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(100412013,1))
e2:SetCategory(CATEGORY_POSITION+CATEGORY_DESTROY)
e2:SetType(EFFECT_TYPE_ACTIVATE)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetHintTiming(0,TIMING_END_PHASE)
e2:SetTarget(c100412013.target2)
e2:SetOperation(c100412013.operation2)
c:RegisterEffect(e2)
end
function c100412013.tgfilter1(c)
return c:IsRace(RACE_MACHINE) and c:IsAttribute(ATTRIBUTE_EARTH)
and c:IsType(TYPE_XYZ) and c:IsPosition(POS_FACEUP_ATTACK) and c:IsCanChangePosition()
end
function c100412013.target1(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end
if chk==0 then return Duel.IsExistingTarget(nil,tp,0,LOCATION_MZONE,1,nil)
and Duel.IsExistingTarget(c100412013.tgfilter1,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_POSCHANGE)
local pg=Duel.SelectTarget(tp,c100412013.tgfilter1,tp,LOCATION_MZONE,0,1,1,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local dg=Duel.SelectTarget(tp,nil,tp,0,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_POSITION,pg,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,dg,1,0,0)
end
function c100412013.operation1(e,tp,eg,ep,ev,re,r,rp)
local ex1,pg=Duel.GetOperationInfo(0,CATEGORY_POSITION)
local ex2,dg=Duel.GetOperationInfo(0,CATEGORY_DESTROY)
local pc=pg:GetFirst()
local dc=dg:GetFirst()
if pc:IsRelateToEffect(e) and dc:IsRelateToEffect(e)
and pc:IsControler(tp)
and Duel.ChangePosition(pc,POS_FACEUP_DEFENSE,POS_FACEUP_ATTACK,POS_FACEUP_ATTACK,POS_FACEUP_ATTACK)~=0
and dc:IsControler(1-tp) then
Duel.Destroy(dc,REASON_EFFECT)
end
end
function c100412013.tgfilter2(c)
return c:IsRace(RACE_MACHINE) and c:IsAttribute(ATTRIBUTE_EARTH)
and c:IsType(TYPE_XYZ) and c:IsPosition(POS_FACEUP_DEFENSE) and c:IsCanChangePosition()
end
function c100412013.target2(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end
if chk==0 then return Duel.IsExistingTarget(nil,tp,0,LOCATION_SZONE,1,nil)
and Duel.IsExistingTarget(c100412013.tgfilter2,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_POSCHANGE)
local pg=Duel.SelectTarget(tp,c100412013.tgfilter2,tp,LOCATION_MZONE,0,1,1,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local dg=Duel.SelectTarget(tp,nil,tp,0,LOCATION_SZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_POSITION,pg,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,dg,1,0,0)
end
function c100412013.operation2(e,tp,eg,ep,ev,re,r,rp)
local ex1,pg=Duel.GetOperationInfo(0,CATEGORY_POSITION)
local ex2,dg=Duel.GetOperationInfo(0,CATEGORY_DESTROY)
local pc=pg:GetFirst()
local dc=dg:GetFirst()
if pc:IsRelateToEffect(e) and dc:IsRelateToEffect(e)
and pc:IsControler(tp)
and Duel.ChangePosition(pc,POS_FACEUP_DEFENSE,POS_FACEUP_ATTACK,POS_FACEUP_ATTACK,POS_FACEUP_ATTACK)~=0
and dc:IsControler(1-tp) then
Duel.Destroy(dc,REASON_EFFECT)
end
end
--ウィッチクラフト・ポトリー
--
--Scripted By-FW空鸽
function c100412014.initial_effect(c)
--Special Summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(100412014,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetHintTiming(0,TIMING_MAIN_END)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,100412014)
e1:SetCondition(c100412014.spcon)
e1:SetCost(c100412014.spcost)
e1:SetTarget(c100412014.sptg)
e1:SetOperation(c100412014.spop)
c:RegisterEffect(e1)
--to hand
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,100412014+100)
e2:SetCondition(c100412014.thcon)
e2:SetCost(aux.bfgcost)
e2:SetTarget(c100412014.thtg)
e2:SetOperation(c100412014.thop)
c:RegisterEffect(e2)
end
function c100412014.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2
end
function c100412014.costfilter(c,tp)
if c:IsLocation(LOCATION_HAND) then return c:IsType(TYPE_SPELL) and c:IsDiscardable() end
return c:IsFaceup() and c:IsAbleToGraveAsCost() and (c:IsHasEffect(100412024) or c:IsHasEffect(100412025))
end
function c100412014.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c100412014.costfilter,tp,LOCATION_HAND+LOCATION_SZONE,0,1,nil,tp) end
local g=Duel.GetMatchingGroup(c100412014.costfilter,tp,LOCATION_HAND+LOCATION_SZONE,0,nil,tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISCARD)
local tc=g:Select(tp,1,1,nil):GetFirst()
if tc:IsLocation(LOCATION_SZONE) then
Duel.RegisterFlagEffect(tp,tc:GetCode(),RESET_PHASE+PHASE_END,0,1)
Duel.Release(e:GetHandler(),REASON_COST)
Duel.SendtoGrave(tc,REASON_COST)
else
Duel.Release(e:GetHandler(),REASON_COST)
Duel.SendtoGrave(tc,REASON_COST+REASON_DISCARD)
end
end
function c100412014.spfilter(c,e,tp)
return c:IsSetCard(0x228) and not c:IsCode(100412014) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c100412014.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetMZoneCount(tp,e:GetHandler())>0
and Duel.IsExistingMatchingCard(c100412014.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function c100412014.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c100412014.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
function c100412014.thcon(e)
return Duel.GetFieldGroupCount(e:GetHandler():GetControler(),LOCATION_HAND,0)==0
end
function c100412014.thfilter(c)
return c:IsSetCard(0x228) and c:IsAbleToHand()
end
function c100412014.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c100412014.thfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c100412014.thfilter,tp,LOCATION_GRAVE,0,1,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectTarget(tp,c100412014.thfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0)
end
function c100412014.thop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
end
end
--ウィッチクラフト・ピットレ
--
--Scripted By-FW空鸽
function c100412015.initial_effect(c)
--Special Summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(100412015,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetHintTiming(0,TIMING_MAIN_END)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,100412015)
e1:SetCondition(c100412015.spcon)
e1:SetCost(c100412015.spcost)
e1:SetTarget(c100412015.sptg)
e1:SetOperation(c100412015.spop)
c:RegisterEffect(e1)
--draw
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,100412015+100)
e2:SetCost(aux.bfgcost)
e2:SetTarget(c100412015.drtg)
e2:SetOperation(c100412015.drop)
c:RegisterEffect(e2)
end
function c100412015.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2
end
function c100412015.costfilter(c,tp)
if c:IsLocation(LOCATION_HAND) then return c:IsType(TYPE_SPELL) and c:IsDiscardable() end
return c:IsFaceup() and c:IsAbleToGraveAsCost() and (c:IsHasEffect(100412024) or c:IsHasEffect(100412025))
end
function c100412015.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c100412015.costfilter,tp,LOCATION_HAND+LOCATION_SZONE,0,1,nil,tp) end
local g=Duel.GetMatchingGroup(c100412015.costfilter,tp,LOCATION_HAND+LOCATION_SZONE,0,nil,tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISCARD)
local tc=g:Select(tp,1,1,nil):GetFirst()
if tc:IsLocation(LOCATION_SZONE) then
Duel.RegisterFlagEffect(tp,tc:GetCode(),RESET_PHASE+PHASE_END,0,1)
Duel.Release(e:GetHandler(),REASON_COST)
Duel.SendtoGrave(tc,REASON_COST)
else
Duel.Release(e:GetHandler(),REASON_COST)
Duel.SendtoGrave(tc,REASON_COST+REASON_DISCARD)
end
end
function c100412015.spfilter(c,e,tp)
return c:IsSetCard(0x228) and not c:IsCode(100412015) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c100412015.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetMZoneCount(tp,e:GetHandler())>0
and Duel.IsExistingMatchingCard(c100412015.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function c100412015.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c100412015.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
function c100412015.drtg(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 c100412015.tgfilter(c)
return c:IsSetCard(0x228) and c:IsAbleToGrave()
end
function c100412015.drop(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Draw(p,d,REASON_EFFECT)
Duel.ShuffleHand(p)
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(p,c100412015.tgfilter,p,LOCATION_HAND,0,1,1,nil)
local tg=g:GetFirst()
if tg then
if Duel.SendtoGrave(g,REASON_EFFECT)==0 then
Duel.ConfirmCards(1-p,tg)
Duel.ShuffleHand(p)
end
else
local sg=Duel.GetFieldGroup(p,LOCATION_HAND,0)
Duel.Remove(sg,POS_FACEUP,REASON_EFFECT)
end
end
...@@ -31,14 +31,23 @@ end ...@@ -31,14 +31,23 @@ end
function c100412016.spcon(e,tp,eg,ep,ev,re,r,rp) function c100412016.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2 return Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2
end end
function c100412016.costfilter(c) function c100412016.costfilter(c,tp)
return c:IsType(TYPE_SPELL) and c:IsDiscardable() if c:IsLocation(LOCATION_HAND) then return c:IsType(TYPE_SPELL) and c:IsDiscardable() end
return c:IsFaceup() and c:IsAbleToGraveAsCost() and (c:IsHasEffect(100412024) or c:IsHasEffect(100412025))
end end
function c100412016.spcost(e,tp,eg,ep,ev,re,r,rp,chk) function c100412016.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c100412016.costfilter,tp,LOCATION_HAND,0,1,nil) if chk==0 then return Duel.IsExistingMatchingCard(c100412016.costfilter,tp,LOCATION_HAND+LOCATION_SZONE,0,1,nil,tp) end
and e:GetHandler():IsReleasable() end local g=Duel.GetMatchingGroup(c100412016.costfilter,tp,LOCATION_HAND+LOCATION_SZONE,0,nil,tp)
Duel.Release(e:GetHandler(),REASON_COST) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISCARD)
Duel.DiscardHand(tp,c100412016.costfilter,1,1,REASON_COST+REASON_DISCARD,nil) local tc=g:Select(tp,1,1,nil):GetFirst()
if tc:IsLocation(LOCATION_SZONE) then
Duel.RegisterFlagEffect(tp,tc:GetCode(),RESET_PHASE+PHASE_END,0,1)
Duel.Release(e:GetHandler(),REASON_COST)
Duel.SendtoGrave(tc,REASON_COST)
else
Duel.Release(e:GetHandler(),REASON_COST)
Duel.SendtoGrave(tc,REASON_COST+REASON_DISCARD)
end
end end
function c100412016.spfilter(c,e,tp) function c100412016.spfilter(c,e,tp)
return c:IsSetCard(0x228) and not c:IsCode(100412016) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) return c:IsSetCard(0x228) and not c:IsCode(100412016) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
......
--ウィッチクラフト・エーデル
--
--Scripted By-FW空鸽
function c100412017.initial_effect(c)
--Special Summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(100412017,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetHintTiming(0,TIMING_MAIN_END)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,100412017)
e1:SetCost(c100412017.spcost)
e1:SetTarget(c100412017.sptg)
e1:SetOperation(c100412017.spop)
c:RegisterEffect(e1)
--special summon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(100412017,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,100412017+100)
e2:SetCost(c100412017.cost)
e2:SetTarget(c100412017.target)
e2:SetOperation(c100412017.activate)
c:RegisterEffect(e2)
end
function c100412017.costfilter(c,tp)
if c:IsLocation(LOCATION_HAND) then return c:IsType(TYPE_SPELL) and c:IsDiscardable() end
return c:IsFaceup() and c:IsAbleToGraveAsCost() and (c:IsHasEffect(100412024) or c:IsHasEffect(100412025))
end
function c100412017.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c100412017.costfilter,tp,LOCATION_HAND+LOCATION_SZONE,0,1,nil,tp) end
local g=Duel.GetMatchingGroup(c100412017.costfilter,tp,LOCATION_HAND+LOCATION_SZONE,0,nil,tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISCARD)
local tc=g:Select(tp,1,1,nil):GetFirst()
if tc:IsLocation(LOCATION_SZONE) then
Duel.RegisterFlagEffect(tp,tc:GetCode(),RESET_PHASE+PHASE_END,0,1)
Duel.SendtoGrave(tc,REASON_COST)
else
Duel.SendtoGrave(tc,REASON_COST+REASON_DISCARD)
end
end
function c100412017.cost(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 c100412017.spfilter(c,e,tp)
return c:IsSetCard(0x228) and not c:IsCode(100412017) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c100412017.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetMZoneCount(tp,e:GetHandler())>0
and Duel.IsExistingMatchingCard(c100412017.spfilter,tp,LOCATION_HAND,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
end
function c100412017.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c100412017.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)
end
end
function c100412017.filter(c,e,tp)
return c:IsRace(RACE_SPELLCASTER) and not c:IsCode(100412017) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c100412017.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and c100412017.filter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c100412017.filter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c100412017.filter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function c100412017.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
end
end
--ウィッチクラフト・ハイネ
--
--Scripted By-FW空鸽
function c100412018.initial_effect(c)
--cannot be target
local e1=Effect.CreateEffect(c)
e1:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetRange(LOCATION_MZONE)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetTargetRange(LOCATION_MZONE,0)
e1:SetTarget(c100412018.tgtg)
e1:SetValue(aux.tgoval)
c:RegisterEffect(e1)
--destroy
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(100412018,1))
e2:SetCategory(CATEGORY_DESTROY)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,100412018)
e2:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e2:SetCost(c100412018.descost)
e2:SetTarget(c100412018.destg)
e2:SetOperation(c100412018.desop)
c:RegisterEffect(e2)
end
function c100412018.tgtg(e,c)
return c~=e:GetHandler() and c:IsRace(RACE_SPELLCASTER)
end
function c100412018.costfilter(c,tp)
if c:IsLocation(LOCATION_HAND) then return c:IsType(TYPE_SPELL) and c:IsDiscardable() end
return c:IsFaceup() and c:IsAbleToGraveAsCost() and (c:IsHasEffect(100412024) or c:IsHasEffect(100412025))
end
function c100412018.descost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c100412018.costfilter,tp,LOCATION_HAND+LOCATION_SZONE,0,1,nil,tp) end
local g=Duel.GetMatchingGroup(c100412018.costfilter,tp,LOCATION_HAND+LOCATION_SZONE,0,nil,tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISCARD)
local tc=g:Select(tp,1,1,nil):GetFirst()
if tc:IsLocation(LOCATION_SZONE) then
Duel.RegisterFlagEffect(tp,tc:GetCode(),RESET_PHASE+PHASE_END,0,1)
Duel.SendtoGrave(tc,REASON_COST)
else
Duel.SendtoGrave(tc,REASON_COST+REASON_DISCARD)
end
end
function c100412018.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and chkc:IsFaceup() end
if chk==0 then return Duel.IsExistingTarget(Card.IsFaceup,tp,0,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,Card.IsFaceup,tp,0,LOCATION_ONFIELD,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function c100412018.desop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.Destroy(tc,REASON_EFFECT)
end
end
...@@ -59,12 +59,21 @@ function c100412019.atkop(e,tp,eg,ep,ev,re,r,rp) ...@@ -59,12 +59,21 @@ function c100412019.atkop(e,tp,eg,ep,ev,re,r,rp)
e2:SetCode(EFFECT_UPDATE_DEFENSE) e2:SetCode(EFFECT_UPDATE_DEFENSE)
tc:RegisterEffect(e2) tc:RegisterEffect(e2)
end end
function c100412019.cfilter2(c) function c100412019.costfilter(c,tp)
return c:IsType(TYPE_SPELL) and c:IsDiscardable() if c:IsLocation(LOCATION_HAND) then return c:IsType(TYPE_SPELL) and c:IsDiscardable() end
return c:IsFaceup() and c:IsAbleToGraveAsCost() and (c:IsHasEffect(100412024) or c:IsHasEffect(100412025))
end end
function c100412019.discost(e,tp,eg,ep,ev,re,r,rp,chk) function c100412019.discost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c100412019.cfilter2,tp,LOCATION_HAND,0,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(c100412019.costfilter,tp,LOCATION_HAND+LOCATION_SZONE,0,1,nil,tp) end
Duel.DiscardHand(tp,c100412019.cfilter2,1,1,REASON_COST+REASON_DISCARD,nil) local g=Duel.GetMatchingGroup(c100412019.costfilter,tp,LOCATION_HAND+LOCATION_SZONE,0,nil,tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISCARD)
local tc=g:Select(tp,1,1,nil):GetFirst()
if tc:IsLocation(LOCATION_SZONE) then
Duel.RegisterFlagEffect(tp,tc:GetCode(),RESET_PHASE+PHASE_END,0,1)
Duel.SendtoGrave(tc,REASON_COST)
else
Duel.SendtoGrave(tc,REASON_COST+REASON_DISCARD)
end
end end
function c100412019.distg(e,tp,eg,ep,ev,re,r,rp,chk) function c100412019.distg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(aux.disfilter1,tp,0,LOCATION_MZONE,1,e:GetHandler()) end if chk==0 then return Duel.IsExistingMatchingCard(aux.disfilter1,tp,0,LOCATION_MZONE,1,e:GetHandler()) end
......
--ウィッチクラフト・クリエイション
--
--Scripted By-FW空鸽
function c100412020.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,100412020)
e1:SetTarget(c100412020.target)
e1:SetOperation(c100412020.activate)
c:RegisterEffect(e1)
--to hand
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(100412020,0))
e2:SetCategory(CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_PHASE+PHASE_END)
e2:SetCountLimit(1,100412020)
e2:SetRange(LOCATION_GRAVE)
e2:SetCondition(c100412020.thcon)
e2:SetTarget(c100412020.thtg)
e2:SetOperation(c100412020.thop)
c:RegisterEffect(e2)
end
function c100412020.filter(c)
return c:IsSetCard(0x228) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
end
function c100412020.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c100412020.filter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c100412020.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c100412020.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 c100412020.rccfilter(c)
return c:IsFaceup() and c:IsSetCard(0x228)
end
function c100412020.thcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==tp
and Duel.IsExistingMatchingCard(c100412020.rccfilter,tp,LOCATION_MZONE,0,1,nil)
end
function c100412020.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToHand() end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,e:GetHandler(),1,0,0)
end
function c100412020.thop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsFaceup() and c:IsRelateToEffect(e) then
Duel.SendtoHand(c,nil,REASON_EFFECT)
end
end
--ウィッチクラフト・サボタージュ
--
--Scripted By-FW空鸽
function c100412021.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,100412021)
e1:SetTarget(c100412021.target)
e1:SetOperation(c100412021.activate)
c:RegisterEffect(e1)
--to hand
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(100412021,0))
e2:SetCategory(CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_PHASE+PHASE_END)
e2:SetCountLimit(1,100412021)
e2:SetRange(LOCATION_GRAVE)
e2:SetCondition(c100412021.thcon)
e2:SetTarget(c100412021.thtg)
e2:SetOperation(c100412021.thop)
c:RegisterEffect(e2)
end
function c100412021.filter(c,e,tp)
return c:IsSetCard(0x228) and c:IsType(TYPE_MONSTER) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c100412021.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and c100412021.filter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c100412021.filter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c100412021.filter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function c100412021.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
end
end
function c100412021.rccfilter(c)
return c:IsFaceup() and c:IsSetCard(0x228)
end
function c100412021.thcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==tp
and Duel.IsExistingMatchingCard(c100412021.rccfilter,tp,LOCATION_MZONE,0,1,nil)
end
function c100412021.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToHand() end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,e:GetHandler(),1,0,0)
end
function c100412021.thop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsFaceup() and c:IsRelateToEffect(e) then
Duel.SendtoHand(c,nil,REASON_EFFECT)
end
end
--ウィッチクラフト・コラボレーション
--
--Scripted By-FW空鸽
function c100412022.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_ATKCHANGE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,100412022)
e1:SetCondition(c100412022.dbcon)
e1:SetTarget(c100412022.target)
e1:SetOperation(c100412022.activate)
c:RegisterEffect(e1)
--to hand
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(100412022,0))
e2:SetCategory(CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_PHASE+PHASE_END)
e2:SetCountLimit(1,100412022)
e2:SetRange(LOCATION_GRAVE)
e2:SetCondition(c100412022.thcon)
e2:SetTarget(c100412022.thtg)
e2:SetOperation(c100412022.thop)
c:RegisterEffect(e2)
end
function c100412022.dbcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsAbleToEnterBP()
end
function c100412022.filter(c)
return c:IsSetCard(0x228) and c:IsFaceup()
end
function c100412022.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and chkc:IsFaceup() end
if chk==0 then return Duel.IsExistingTarget(c100412022.filter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,Card.IsFaceup,tp,LOCATION_MZONE,0,1,1,nil)
end
function c100412022.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsFaceup() then
--extra attack
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_EXTRA_ATTACK)
e1:SetValue(1)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
--actlimit
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetCode(EFFECT_CANNOT_ACTIVATE)
e2:SetRange(LOCATION_MZONE)
e2:SetTargetRange(0,1)
e2:SetValue(c100412022.aclimit)
e2:SetCondition(c100412022.actcon)
e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e2)
end
end
function c100412022.rccfilter(c)
return c:IsFaceup() and c:IsSetCard(0x228)
end
function c100412022.thcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==tp
and Duel.IsExistingMatchingCard(c100412022.rccfilter,tp,LOCATION_MZONE,0,1,nil)
end
function c100412022.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToHand() end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,e:GetHandler(),1,0,0)
end
function c100412022.thop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsFaceup() and c:IsRelateToEffect(e) then
Duel.SendtoHand(c,nil,REASON_EFFECT)
end
end
function c100412022.aclimit(e,re,tp)
return re:GetHandler():IsType(TYPE_SPELL+TYPE_TRAP) and re:IsHasType(EFFECT_TYPE_ACTIVATE)
end
function c100412022.actcon(e)
return Duel.GetAttacker()==e:GetHandler() or Duel.GetAttackTarget()==e:GetHandler()
end
--ウィッチクラフト・ドレーピング
--
--Scripted By-FW空鸽
function c100412023.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,100412023)
e1:SetTarget(c100412023.target)
e1:SetOperation(c100412023.activate)
c:RegisterEffect(e1)
--to hand
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(100412023,0))
e2:SetCategory(CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_PHASE+PHASE_END)
e2:SetCountLimit(1,100412023)
e2:SetRange(LOCATION_GRAVE)
e2:SetCondition(c100412023.thcon)
e2:SetTarget(c100412023.thtg)
e2:SetOperation(c100412023.thop)
c:RegisterEffect(e2)
end
function c100412023.filter(c)
return c:IsType(TYPE_SPELL+TYPE_TRAP)
end
function c100412023.cfilter(c)
return c:IsFaceup() and c:IsSetCard(0x228)
end
function c100412023.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and chkc:IsControler(1-tp) and chkc:IsAbleToHand() end
if chk==0 then return Duel.IsExistingMatchingCard(c100412023.cfilter,tp,LOCATION_MZONE,0,1,nil)
and Duel.IsExistingTarget(Card.IsAbleToHand,tp,0,LOCATION_SZONE,1,nil) end
local ct=Duel.GetMatchingGroupCount(c100412023.cfilter,tp,LOCATION_MZONE,0,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local g=Duel.SelectTarget(tp,Card.IsAbleToHand,tp,0,LOCATION_SZONE,1,ct,nil)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,g:GetCount(),0,0)
end
function c100412023.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(Card.IsRelateToEffect,nil,e)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
end
end
function c100412023.thcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==tp
and Duel.IsExistingMatchingCard(c100412023.rccfilter,tp,LOCATION_MZONE,0,1,nil)
end
function c100412023.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToHand() end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,e:GetHandler(),1,0,0)
end
function c100412023.thop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsFaceup() and c:IsRelateToEffect(e) then
Duel.SendtoHand(c,nil,REASON_EFFECT)
end
end
--ウィッチクラフト・シュミッタ
--
--Scripted By-FW空鸽
function c100412024.initial_effect(c)
--Activate
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_ACTIVATE)
e0:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e0)
--indes
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_INDESTRUCTABLE_COUNT)
e1:SetRange(LOCATION_SZONE)
e1:SetTargetRange(LOCATION_MZONE,0)
e1:SetTarget(c100412024.target)
e1:SetValue(c100412024.indct)
c:RegisterEffect(e1)
--ep set
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(100412024,0))
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_PHASE+PHASE_END)
e2:SetRange(LOCATION_GRAVE)
e2:SetCondition(c100412024.setcon)
e2:SetTarget(c100412024.settg)
e2:SetOperation(c100412024.setop)
c:RegisterEffect(e2)
--change cost
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e3:SetCode(100412024)
e3:SetCondition(c100412024.costcon)
e3:SetRange(LOCATION_SZONE)
c:RegisterEffect(e3)
end
function c100412024.target(e,c)
return c:IsSetCard(0x228)
end
function c100412024.indct(e,re,r,rp)
if bit.band(r,REASON_BATTLE+REASON_EFFECT)~=0 then
return 1
else return 0 end
end
function c100412024.rccfilter(c)
return c:IsFaceup() and c:IsSetCard(0x228)
end
function c100412024.setcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFlagEffect(tp,100412024)==0 and Duel.GetTurnPlayer()==tp
and Duel.IsExistingMatchingCard(c100412024.rccfilter,tp,LOCATION_MZONE,0,1,nil)
end
function c100412024.settg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0 end
Duel.RegisterFlagEffect(tp,100412024,RESET_PHASE+PHASE_END,0,1)
end
function c100412024.setop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 then return end
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.MoveToField(c,tp,tp,LOCATION_SZONE,POS_FACEUP,true)
end
end
function c100412024.costcon(e)
return Duel.GetFlagEffect(e:GetHandlerPlayer(),100412024)==0
end
--ウィッチクラフト・スクロール
--
--Scripted By-FW空鸽
function c100412025.initial_effect(c)
--Activate
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_ACTIVATE)
e0:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e0)
--draw
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(100412025,0))
e1:SetCategory(CATEGORY_DRAW)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_BATTLE_DESTROYING)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetRange(LOCATION_SZONE)
e1:SetCountLimit(1)
e1:SetCondition(c100412025.drcon)
e1:SetTarget(c100412025.drtg)
e1:SetOperation(c100412025.drop)
c:RegisterEffect(e1)
--ep set
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(100412025,0))
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_PHASE+PHASE_END)
e2:SetRange(LOCATION_GRAVE)
e2:SetCondition(c100412025.setcon)
e2:SetTarget(c100412025.settg)
e2:SetOperation(c100412025.setop)
c:RegisterEffect(e2)
--change cost
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e3:SetCode(100412025)
e3:SetCondition(c100412025.costcon)
e3:SetRange(LOCATION_SZONE)
c:RegisterEffect(e3)
end
function c100412025.drcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local rc=eg:GetFirst()
return rc:IsRelateToBattle() and rc:IsStatus(STATUS_OPPO_BATTLE)
and rc:IsFaceup() and rc:IsSetCard(0x228) and rc:IsControler(tp)
end
function c100412025.drtg(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 c100412025.drop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Draw(p,d,REASON_EFFECT)
end
function c100412025.rccfilter(c)
return c:IsFaceup() and c:IsSetCard(0x228)
end
function c100412025.setcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFlagEffect(tp,100412025)==0 and Duel.GetTurnPlayer()==tp
and Duel.IsExistingMatchingCard(c100412025.rccfilter,tp,LOCATION_MZONE,0,1,nil)
end
function c100412025.settg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0 end
Duel.RegisterFlagEffect(tp,100412025,RESET_PHASE+PHASE_END,0,1)
end
function c100412025.setop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 then return end
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.MoveToField(c,tp,tp,LOCATION_SZONE,POS_FACEUP,true)
end
end
function c100412025.costcon(e)
return Duel.GetFlagEffect(e:GetHandlerPlayer(),100412025)==0
end
--ウィッチクラフト・マスターピース
--
--Scripted By-FW空鸽
function c100412026.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,100412026)
e1:SetCondition(c100412026.setcon)
e1:SetTarget(c100412026.target)
e1:SetOperation(c100412026.activate)
c:RegisterEffect(e1)
--spsummon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(100412026,0))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,100412026+100)
e2:SetCondition(aux.exccon)
e2:SetCost(c100412026.spcost)
e2:SetTarget(c100412026.sptg)
e2:SetOperation(c100412026.spop)
c:RegisterEffect(e2)
end
function c100412026.rccfilter(c)
return c:IsFaceup() and c:IsSetCard(0x228)
end
function c100412026.setcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c100412026.rccfilter,tp,LOCATION_MZONE,0,1,nil)
end
function c100412026.filter(c,e,tp)
return c:IsType(TYPE_SPELL) and Duel.IsExistingMatchingCard(c100412026.filter2,tp,LOCATION_DECK,0,1,nil,c:GetCode(),e,tp)
end
function c100412026.filter2(c,code,e,tp)
return c:IsCode(code) and c:IsAbleToHand()
end
function c100412026.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c100412026.filter(chkc,e,tp) end
if chk==0 then return Duel.IsExistingTarget(c100412026.filter,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(100412026,0))
Duel.SelectTarget(tp,c100412026.filter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c100412026.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c100412026.filter2,tp,LOCATION_DECK,0,1,1,nil,tc:GetOriginalCode())
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
function c100412026.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
e:SetLabel(100)
return true
end
function c100412026.cfilter(c)
return c:IsType(TYPE_SPELL) and c:IsAbleToRemoveAsCost()
end
function c100412026.spfilter(c,e,tp,lv)
return c:IsSetCard(0x228) and c:IsLevelBelow(lv) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c100412026.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then
if e:GetLabel()~=100 then return false end
e:SetLabel(0)
local cg=Duel.GetMatchingGroup(c100412026.cfilter,tp,LOCATION_GRAVE,0,nil)
return c:IsAbleToRemoveAsCost()
and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c100412026.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp,cg:GetCount())
end
local cg=Duel.GetMatchingGroup(c100412026.cfilter,tp,LOCATION_GRAVE,0,nil)
local tg=Duel.GetMatchingGroup(c100412026.spfilter,tp,LOCATION_DECK,0,nil,e,tp,cg:GetCount())
local lvt={}
local tc=tg:GetFirst()
while tc do
local tlv=0
tlv=tlv+tc:GetLevel()
lvt[tlv]=tlv
tc=tg:GetNext()
end
local pc=1
for i=1,12 do
if lvt[i] then lvt[i]=nil lvt[pc]=i pc=pc+1 end
end
lvt[pc]=nil
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(100412026,2))
local lv=Duel.AnnounceNumber(tp,table.unpack(lvt))
local rg1=Group.CreateGroup()
if lv>1 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local rg2=cg:Select(tp,lv-1,lv-1,c)
rg1:Merge(rg2)
end
rg1:AddCard(c)
Duel.Remove(rg1,POS_FACEUP,REASON_COST)
e:SetLabel(lv)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function c100412026.sfilter(c,e,tp,lv)
return c:IsSetCard(0x228) and c:IsLevel(lv) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c100412026.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
local lv=e:GetLabel()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c100412026.sfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp,lv)
local tc=g:GetFirst()
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment