Commit ecbb609f authored by TanakaKotoha's avatar TanakaKotoha

daniaozhuanzhuanzhuan

parent b5070a6d
Pipeline #2475 passed with stages
in 44 minutes and 44 seconds
...@@ -7,6 +7,17 @@ function cm.initial_effect(c) ...@@ -7,6 +7,17 @@ function cm.initial_effect(c)
e1:SetDescription(aux.Stringid(m,0)) e1:SetDescription(aux.Stringid(m,0))
e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN) e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCondition(cm.condition)
e1:SetTarget(cm.target)
e1:SetOperation(cm.operation)
c:RegisterEffect(e1)
--rec or dam
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetLabel(1)
e1:SetCondition(cm.condition1)
e1:SetTarget(cm.target) e1:SetTarget(cm.target)
e1:SetOperation(cm.operation) e1:SetOperation(cm.operation)
c:RegisterEffect(e1) c:RegisterEffect(e1)
...@@ -23,8 +34,11 @@ function cm.initial_effect(c) ...@@ -23,8 +34,11 @@ function cm.initial_effect(c)
e2:SetOperation(cm.plop) e2:SetOperation(cm.plop)
c:RegisterEffect(e2) c:RegisterEffect(e2)
end end
function cm.filter1(c) function cm.condition(e,tp,eg,ep,ev,re,r,rp,chk)
return ( c:IsSetCard(0xfbb) or c:IsSetCard(0x1fbd) )and c:IsAbleToHand() return not ( Duel.GetActivityCount(tp,ACTIVITY_BATTLE_PHASE)==0 and not Duel.CheckPhaseActivity() )
end
function cm.condition1(e,tp,eg,ep,ev,re,r,rp,chk)
return Duel.GetActivityCount(tp,ACTIVITY_BATTLE_PHASE)==0 and not Duel.CheckPhaseActivity()
end end
function cm.cfilter(c,e,tp) function cm.cfilter(c,e,tp)
return c:IsRace(RACE_DRAGON) and c:IsLevel(1) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) return c:IsRace(RACE_DRAGON) and c:IsLevel(1) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
...@@ -34,11 +48,12 @@ function cm.f1(c) ...@@ -34,11 +48,12 @@ function cm.f1(c)
end end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk) function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler() local c=e:GetHandler()
local tt=e:GetLabel()
local b1=( Duel.IsExistingMatchingCard(cm.cfilter,tp,LOCATION_HAND,0,1,nil,e,tp) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 ) local b1=( Duel.IsExistingMatchingCard(cm.cfilter,tp,LOCATION_HAND,0,1,nil,e,tp) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 )
local b2=( Duel.IsExistingMatchingCard(cm.f1,tp,LOCATION_HAND,0,1,nil) ) local b2=( Duel.IsExistingMatchingCard(cm.f1,tp,LOCATION_HAND,0,1,nil) )
if chk==0 then return b1 or b2 end
local b3=( Duel.CheckPhaseActivity() and b1 and b2 ) local b3=( Duel.CheckPhaseActivity() and b1 and b2 )
if b1 and b2 and b3 then op=Duel.SelectOption(tp,aux.Stringid(m,1),aux.Stringid(m,2),aux.Stringid(m,3)) if chk==0 then return b1 or b2 end
if b1 and b2 and tt==1 then op=Duel.SelectOption(tp,aux.Stringid(m,1),aux.Stringid(m,2),aux.Stringid(m,3))
elseif b1 and b2 then op=Duel.SelectOption(tp,aux.Stringid(m,1),aux.Stringid(m,2)) elseif b1 and b2 then op=Duel.SelectOption(tp,aux.Stringid(m,1),aux.Stringid(m,2))
elseif b1 then op=Duel.SelectOption(tp,aux.Stringid(m,1)) elseif b1 then op=Duel.SelectOption(tp,aux.Stringid(m,1))
elseif b2 then op=Duel.SelectOption(tp,aux.Stringid(m,2))+1 elseif b2 then op=Duel.SelectOption(tp,aux.Stringid(m,2))+1
...@@ -62,7 +77,7 @@ end ...@@ -62,7 +77,7 @@ end
function cm.operation(e,tp,eg,ep,ev,re,r,rp) function cm.operation(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,cm.cfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp) local g=Duel.SelectMatchingCard(tp,cm.cfilter,tp,LOCATION_HAND,0,1,1,nil,e,tp)
if g:GetCount()>0 then if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP) Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
local kp=Duel.GetTurnPlayer() local kp=Duel.GetTurnPlayer()
......
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