Commit 246aacdc authored by gg123gg's avatar gg123gg Committed by GitHub

Update c12008030.lua

parent 8c52b0f1
...@@ -35,6 +35,59 @@ end ...@@ -35,6 +35,59 @@ end
function c12008030.regcon(e,tp,eg,ep,ev,re,r,rp) function c12008030.regcon(e,tp,eg,ep,ev,re,r,rp)
return re and re:GetHandler():IsSetCard(0x1fb3) return re and re:GetHandler():IsSetCard(0x1fb3)
end end
function c12008030.regop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_PUBLIC)
--双色的连心
function c12008030.initial_effect(c)
--Activate
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e0:SetCode(EVENT_TO_HAND)
e0:SetCondition(c12008030.regcon)
e0:SetOperation(c12008030.regop)
c:RegisterEffect(e0)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetCondition(c12008030.tdcon2)
e1:SetCode(EFFECT_CHANGE_TYPE)
e1:SetOperation(c12008030.value)
c:RegisterEffect(e1)
--spsummon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(12008030,0))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_ACTIVATE)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetTarget(c12008030.sptg1)
e2:SetOperation(c12008030.spop1)
c:RegisterEffect(e2)
--Activate
local e1=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(12008030,1))
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_QUICK_O)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetCode(EVENT_BATTLE_DESTROYED)
e1:SetCondition(aux.exccon)
e1:SetCondition(c12008030.condition)
e1:SetTarget(c12008030.target)
e1:SetOperation(c12008030.operation)
c:RegisterEffect(e1)
end
function c12008030.tdcon2(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFlagEffect(tp,12008030)>0
end
function c12008030.value(e)
return e:GetHandler():GetType()+TYPE_QUICKPLAY
end
function c12008030.regcon(e,tp,eg,ep,ev,re,r,rp)
return re and re:GetHandler():IsSetCard(0x1fb3)
end
function c12008030.regop(e,tp,eg,ep,ev,re,r,rp) function c12008030.regop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
...@@ -45,16 +98,15 @@ function c12008030.regop(e,tp,eg,ep,ev,re,r,rp) ...@@ -45,16 +98,15 @@ function c12008030.regop(e,tp,eg,ep,ev,re,r,rp)
Duel.RegisterFlagEffect(tp,12008030,RESET_PHASE+PHASE_END,0,2) Duel.RegisterFlagEffect(tp,12008030,RESET_PHASE+PHASE_END,0,2)
end end
function c12008030.spfilter1(c,e,tp) function c12008030.spfilter1(c,e,tp)
return c:IsFaceup() and c:IsSetCard(0x1fbd) and c:IsLevelAbove(1) return c:IsFaceup() and c:IsSetCard(0x1fb3) and c:IsLevelAbove(1)
and Duel.IsExistingMatchingCard(c12008030.spfilter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,c,c:GetLevel()) and Duel.IsExistingMatchingCard(c12008030.spfilter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,c,c:GetLevel())
and aux.MustMaterialCheck(c,tp,EFFECT_MUST_BE_XMATERIAL) and aux.MustMaterialCheck(c,tp,EFFECT_MUST_BE_XMATERIAL) and Duel.GetLocationCountFromEx(tp,tp,c,TYPE_XYZ)>0
end end
function c12008030.spfilter2(c,e,tp,mc,level) function c12008030.spfilter2(c,e,tp,mc,level)
return c:IsType(TYPE_XYZ) and c:GetRank()==level and mc:IsCanBeXyzMaterial(c) return c:IsType(TYPE_XYZ) and c:GetRank()==level --and mc:IsCanBeXyzMaterial(c)
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_XYZ,tp,false,false) and Duel.GetLocationCountFromEx(tp,tp,mc,c)>0 and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_XYZ,tp,false,false)
end end
function c12008030.sptg1(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c12008030.sptg1(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) and c12008030.spfilter1(chkc,e,tp) end
if chk==0 then return Duel.IsExistingTarget(c12008030.spfilter1,tp,LOCATION_MZONE,0,1,nil,e,tp) end if chk==0 then return Duel.IsExistingTarget(c12008030.spfilter1,tp,LOCATION_MZONE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
Duel.SelectTarget(tp,c12008030.spfilter1,tp,LOCATION_MZONE,0,1,1,nil,e,tp) Duel.SelectTarget(tp,c12008030.spfilter1,tp,LOCATION_MZONE,0,1,1,nil,e,tp)
......
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