Commit 0bbfe4b7 authored by Tachibana's avatar Tachibana

ybb

parent 3f5dd780
...@@ -44,7 +44,7 @@ function cm.sumlimit(e,c,sump,sumtype,sumpos,targetp,se) ...@@ -44,7 +44,7 @@ function cm.sumlimit(e,c,sump,sumtype,sumpos,targetp,se)
return not c:IsAttribute(ATTRIBUTE_WIND) return not c:IsAttribute(ATTRIBUTE_WIND)
end end
function cm.filter(c,e,tp) function cm.filter(c,e,tp)
return c:IsType(TYPE_MONSTER) and aux.IsCodeListed(c,81010004) and c:IsAttribute(ATTRIBUTE_WATER) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_ATTACK) return c:IsType(TYPE_MONSTER) and aux.IsCodeListed(c,81010004) and c:IsAttribute(ATTRIBUTE_WIND) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_ATTACK)
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)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
......
...@@ -12,10 +12,12 @@ function cm.initial_effect(c) ...@@ -12,10 +12,12 @@ function cm.initial_effect(c)
e1:SetOperation(cm.op1) e1:SetOperation(cm.op1)
c:RegisterEffect(e1) c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_QUICK_O) e2:SetDescription(aux.Stringid(m,1))
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON) e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetCode(EVENT_TO_GRAVE) e2:SetCode(EVENT_TO_GRAVE)
e2:SetRange(LOCATION_HAND+LOCATION_GRAVE) e2:SetRange(LOCATION_HAND+LOCATION_GRAVE)
e2:SetCountLimit(1,m+100)
e2:SetCondition(cm.con2) e2:SetCondition(cm.con2)
e2:SetTarget(cm.tg2) e2:SetTarget(cm.tg2)
e2:SetOperation(cm.op2) e2:SetOperation(cm.op2)
...@@ -67,15 +69,41 @@ function cm.op1(e,tp,eg,ep,ev,re,r,rp) ...@@ -67,15 +69,41 @@ function cm.op1(e,tp,eg,ep,ev,re,r,rp)
Duel.SpecialSummonComplete() Duel.SpecialSummonComplete()
local mg=Group.FromCards(c,tc) local mg=Group.FromCards(c,tc)
if not (c:IsLocation(LOCATION_MZONE) and tc:IsLocation(LOCATION_MZONE)) then return end if not (c:IsLocation(LOCATION_MZONE) and tc:IsLocation(LOCATION_MZONE)) then return end
local g=Duel.GetMatchingGroup(cm.opf1,tp,LOCATION_EXTRA,0,1,nil,nil,mg) if cm.opf1(tc,c,tp) and Duel.SelectYesNo(tp,aux.Stringid(m,0)) then
if g:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(m,0)) then c:RegisterFlagEffect(m,RESET_EVENT+RESETS_STANDARD,0,1)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SYNCHRO_MATERIAL)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
local mg=Group.FromCards(c,tc)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=g:Select(tp,1,1,nil) local g=Duel.SelectMatchingCard(tp,cm.opf11,tp,LOCATION_EXTRA,0,1,1,nil,mg)
Duel.SynchroSummon(tp,sg:GetFirst(),nil,mg) local sc=g:GetFirst()
if sc then
Duel.BreakEffect()
Duel.SynchroSummon(tp,sc,nil,mg)
else
c:ResetFlagEffect(m)
e1:Reset()
end
end end
end end
function cm.opf1(c,g) function cm.opf11(c,g)
return c:IsSynchroSummonable(g) and c:IsAttribute(ATTRIBUTE_WATER+ATTRIBUTE_WIND) return c:IsSynchroSummonable(nil,g) and c:IsAttribute(ATTRIBUTE_WATER+ATTRIBUTE_WIND)
end
function cm.opf1(tc,c,tp)
if not tc:IsFaceup() or not tc:IsCanBeSynchroMaterial() then return false end
c:RegisterFlagEffect(m,0,0,1)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SYNCHRO_MATERIAL)
tc:RegisterEffect(e1,true)
local mg=Group.FromCards(c,tc)
local res=Duel.IsExistingMatchingCard(cm.opf11,tp,LOCATION_EXTRA,0,1,nil,mg)
c:ResetFlagEffect(m)
e1:Reset()
return res
end end
--e2 --e2
function cm.conf2(c,tp) function cm.conf2(c,tp)
...@@ -85,7 +113,8 @@ function cm.con2(e,tp,eg,ep,ev,re,r,rp) ...@@ -85,7 +113,8 @@ function cm.con2(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(cm.conf2,1,nil,tp) return eg:IsExists(cm.conf2,1,nil,tp)
end end
function cm.tg2(e,tp,eg,ep,ev,re,r,rp,chk) function cm.tg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end end
function cm.op2(e,tp,eg,ep,ev,re,r,rp) function cm.op2(e,tp,eg,ep,ev,re,r,rp)
...@@ -93,13 +122,10 @@ function cm.op2(e,tp,eg,ep,ev,re,r,rp) ...@@ -93,13 +122,10 @@ function cm.op2(e,tp,eg,ep,ev,re,r,rp)
if c:IsRelateToEffect(e) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)>0 then if c:IsRelateToEffect(e) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)>0 then
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE) e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EVENT_LEAVE_FIELD) e2:SetCode(EFFECT_LEAVE_FIELD_REDIRECT)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetOperation(cm.op2) e2:SetReset(RESET_EVENT+RESETS_REDIRECT)
e2:SetValue(LOCATION_REMOVED+POS_FACEDOWN)
c:RegisterEffect(e2,true) c:RegisterEffect(e2,true)
end end
end
function cm.op2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
Duel.Remove(c,POS_FACEDOWN,REASON_EFFECT)
end end
\ No newline at end of file
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