Commit cad3627f authored by nanahira's avatar nanahira

new cards VJMP

parent 44a8b72a
--コード・ジェネレーター
function c30114823.initial_effect(c)
--hand link
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetCode(EFFECT_EXTRA_LINK_MATERIAL)
e1:SetRange(LOCATION_HAND)
e1:SetCondition(c30114823.matcon)
e1:SetValue(c30114823.matval)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_BE_MATERIAL)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetCondition(c30114823.ctcon)
e2:SetOperation(c30114823.ctop)
c:RegisterEffect(e2)
--to grave
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(30114823,0))
e3:SetCategory(CATEGORY_DECKDES+CATEGORY_TOHAND+CATEGORY_SEARCH)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCode(EVENT_BE_MATERIAL)
e3:SetCountLimit(1,30114823)
e3:SetCondition(c30114823.tdcon)
e3:SetTarget(c30114823.tdtg)
e3:SetOperation(c30114823.tdop)
c:RegisterEffect(e3)
end
function c30114823.matcon(e)
return Duel.GetFlagEffect(e:GetHandlerPlayer(),30114823)==0
end
function c30114823.mfilter(c)
return c:IsLocation(LOCATION_MZONE) and c:IsRace(RACE_CYBERSE)
end
function c30114823.exmfilter(c)
return c:IsLocation(LOCATION_HAND) and c:IsCode(30114823)
end
function c30114823.matval(e,c,mg)
return c:IsSetCard(0x101) and mg:IsExists(c30114823.mfilter,1,nil) and not mg:IsExists(c30114823.exmfilter,1,nil)
end
function c30114823.ctcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPreviousLocation(LOCATION_HAND)
end
function c30114823.ctop(e,tp,eg,ep,ev,re,r,rp)
Duel.RegisterFlagEffect(tp,30114823,RESET_PHASE+PHASE_END,0,1)
end
function c30114823.tdcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
e:SetLabel(0)
if c:IsPreviousLocation(LOCATION_ONFIELD) then e:SetLabel(1) end
return c:IsLocation(LOCATION_GRAVE) and c:IsPreviousLocation(LOCATION_ONFIELD+LOCATION_HAND) and r==REASON_LINK and c:GetReasonCard():IsSetCard(0x101)
end
function c30114823.tdfilter(c,chk)
return c:IsRace(RACE_CYBERSE) and c:IsAttackBelow(1200) and (c:IsAbleToGrave() or (chk==1 and c:IsAbleToHand()))
end
function c30114823.tdtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c30114823.tdfilter,tp,LOCATION_DECK,0,1,nil,e:GetLabel()) end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK)
end
function c30114823.tdop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c30114823.tdfilter,tp,LOCATION_DECK,0,1,1,nil,e:GetLabel())
local tc=g:GetFirst()
if tc and tc:IsAbleToGrave() and (e:GetLabel()==0 or not tc:IsAbleToHand() or Duel.SelectOption(tp,1191,1190)==0) then
Duel.SendtoGrave(tc,REASON_EFFECT)
else
Duel.SendtoHand(tc,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tc)
end
end
--捕食植物スパイダー・オーキッド
function c30537973.initial_effect(c)
--pendulum summon
aux.EnablePendulumAttribute(c,false)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetDescription(1160)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_HAND)
e1:SetCost(c30537973.reg)
c:RegisterEffect(e1)
--destroy
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(30537973,0))
e2:SetCategory(CATEGORY_DESTROY)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetRange(LOCATION_PZONE)
e2:SetCountLimit(1,30537973)
e2:SetCondition(c30537973.descon)
e2:SetTarget(c30537973.destg)
e2:SetOperation(c30537973.desop)
c:RegisterEffect(e2)
--to hand
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(30537973,1))
e3:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_PHASE+PHASE_END)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1,30537974)
e3:SetCost(c30537973.thcost)
e3:SetTarget(c30537973.thtg)
e3:SetOperation(c30537973.thop)
c:RegisterEffect(e3)
if not c30537973.global_check then
c30537973.global_check=true
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_SUMMON_SUCCESS)
ge1:SetLabel(30537973)
ge1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
ge1:SetOperation(aux.sumreg)
Duel.RegisterEffect(ge1,0)
local ge2=ge1:Clone()
ge2:SetCode(EVENT_SPSUMMON_SUCCESS)
ge2:SetLabel(30537973)
Duel.RegisterEffect(ge2,0)
end
end
function c30537973.reg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
e:GetHandler():RegisterFlagEffect(30537973,RESET_PHASE+PHASE_END,EFFECT_FLAG_OATH,1)
end
function c30537973.descon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetFlagEffect(30537973)~=0
end
function c30537973.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local c=e:GetHandler()
if chkc then return chkc:IsLocation(LOCATION_SZONE) and chkc:IsControler(tp) and chkc:IsFaceup() and chkc~=c end
if chk==0 then return Duel.IsExistingTarget(Card.IsFaceup,tp,LOCATION_SZONE,LOCATION_SZONE,1,c) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,Card.IsFaceup,tp,LOCATION_SZONE,LOCATION_SZONE,1,1,c)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function c30537973.desop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if e:GetHandler():IsRelateToEffect(e) and tc:IsRelateToEffect(e) then
Duel.Destroy(tc,REASON_EFFECT)
end
end
function c30537973.costfilter(c)
return c:IsRace(RACE_PLANT) and c:IsDiscardable()
end
function c30537973.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():GetFlagEffect(30537973)~=0
and Duel.IsExistingMatchingCard(c30537973.costfilter,tp,LOCATION_HAND,0,1,nil) end
Duel.DiscardHand(tp,c30537973.costfilter,1,1,REASON_DISCARD+REASON_COST)
e:GetHandler():ResetFlagEffect(30537973)
end
function c30537973.thfilter(c)
return c:IsLevelBelow(4) and c:IsRace(RACE_PLANT) and c:IsAbleToHand()
end
function c30537973.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c30537973.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c30537973.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c30537973.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 c77522571.initial_effect(c)
--pendulum summon
aux.EnablePendulumAttribute(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(77522571,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_PZONE)
e1:SetCountLimit(1,77522571)
e1:SetCost(c77522571.spcost1)
e1:SetTarget(c77522571.sptg1)
e1:SetOperation(c77522571.spop1)
c:RegisterEffect(e1)
--special summon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(77522571,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,77522572)
e2:SetTarget(c77522571.sptg2)
e2:SetOperation(c77522571.spop2)
c:RegisterEffect(e2)
--special summon
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(77522571,2))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_FUSION_SUMMON)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1,77522573)
e3:SetCost(c77522571.spcost3)
e3:SetTarget(c77522571.sptg3)
e3:SetOperation(c77522571.spop3)
c:RegisterEffect(e3)
end
function c77522571.costfilter1(c,e,tp)
return c:IsLevelBelow(4) and (c:IsSetCard(0xa9) or c:IsSetCard(0xad) or c:IsSetCard(0xc3))
and Duel.GetMZoneCount(tp,c)>0 and (c:IsControler(tp) or c:IsFaceup())
and Duel.IsExistingMatchingCard(c77522571.spfilter1,tp,LOCATION_DECK,0,1,nil,e,tp,c:GetLevel(),c:GetCode())
end
function c77522571.spfilter1(c,e,tp,lv,code)
return c:IsRace(RACE_FIEND) and c:IsLevel(lv) and not c:IsCode(code) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c77522571.spcost1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroup(tp,c77522571.costfilter1,1,nil,e,tp) end
local rg=Duel.SelectReleaseGroup(tp,c77522571.costfilter1,1,1,nil,e,tp)
e:SetLabel(rg:GetFirst():GetLevel())
e:SetValue(rg:GetFirst():GetCode())
Duel.Release(rg,REASON_COST)
end
function c77522571.sptg1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function c77522571.spop1(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
local lv=e:GetLabel()
local code=e:GetValue()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c77522571.spfilter1,tp,LOCATION_DECK,0,1,1,nil,e,tp,lv,code)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
function c77522571.spfilter2(c,e,tp)
return (c:IsSetCard(0xa9) or c:IsSetCard(0xad) or c:IsSetCard(0xc3)) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c77522571.sptg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c77522571.spfilter2,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function c77522571.spop2(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c77522571.spfilter2,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
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetTargetRange(1,0)
e1:SetTarget(c77522571.splimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function c77522571.splimit(e,c)
return not c:IsType(TYPE_FUSION) and c:IsLocation(LOCATION_EXTRA)
end
function c77522571.costfilter(c)
return c:IsLevelAbove(1) and c:IsRace(RACE_FIEND)
end
function c77522571.fselect(c,e,tp,rg,sg)
sg:AddCard(c)
local res=c77522571.fgoal(e,tp,sg) or rg:IsExists(c77522571.fselect,1,sg,e,tp,rg,sg)
sg:RemoveCard(c)
return res
end
function c77522571.lvcheck(g)
local lv=0
local tc=g:GetFirst()
while tc do
lv=lv+tc:GetLevel()
tc=g:GetNext()
end
return lv
end
function c77522571.fgoal(e,tp,sg)
if sg:GetCount()>1 and Duel.GetLocationCountFromEx(tp,tp,sg)>0 then
local lv=c77522571.lvcheck(sg)
Duel.SetSelectedCard(sg)
return Duel.CheckReleaseGroup(tp,nil,0,nil) and Duel.IsExistingMatchingCard(c77522571.spfilter3,tp,LOCATION_EXTRA,0,1,nil,e,tp,lv)
else return false end
end
function c77522571.spfilter3(c,e,tp,lv)
return c:IsSetCard(0xad) and c:IsType(TYPE_FUSION) and c:IsLevel(lv) and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false) and c:CheckFusionMaterial()
end
function c77522571.relfilter(c,g)
return g:IsContains(c)
end
function c77522571.spcost3(e,tp,eg,ep,ev,re,r,rp,chk)
local rg=Duel.GetReleaseGroup(tp):Filter(c77522571.costfilter,nil)
local g=Group.CreateGroup()
if chk==0 then return rg:IsExists(c77522571.fselect,1,nil,e,tp,rg,g) end
while true do
local mg=rg:Filter(c77522571.fselect,g,e,tp,rg,g)
if mg:GetCount()==0 or (c77522571.fgoal(e,tp,g) and not Duel.SelectYesNo(tp,210)) then break end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local sg=Duel.SelectReleaseGroup(tp,c77522571.relfilter,1,1,nil,mg)
g:Merge(sg)
end
local lv=c77522571.lvcheck(g)
e:SetLabel(lv)
Duel.Release(g,REASON_COST)
end
function c77522571.sptg3(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return aux.MustMaterialCheck(nil,tp,EFFECT_MUST_BE_FMATERIAL) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function c77522571.spop3(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCountFromEx(tp)<=0 or not aux.MustMaterialCheck(nil,tp,EFFECT_MUST_BE_FMATERIAL) then return end
local lv=e:GetLabel()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c77522571.spfilter3,tp,LOCATION_EXTRA,0,1,1,nil,e,tp,lv)
local tc=g:GetFirst()
if tc then
tc:SetMaterial(nil)
if Duel.SpecialSummon(tc,SUMMON_TYPE_FUSION,tp,tp,false,false,POS_FACEUP)~=0 then
tc:CompleteProcedure()
end
end
end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment