Commit b3a91dce authored by Tang Xinwei's avatar Tang Xinwei

fix c100212005 c101204059

parent a15958d3
...@@ -21,12 +21,13 @@ function c100212005.initial_effect(c) ...@@ -21,12 +21,13 @@ function c100212005.initial_effect(c)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET) e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_BATTLED) e2:SetCode(EVENT_BATTLED)
e2:SetCountLimit(1,EFFECT_COUNT_CODE_CHAIN)
e2:SetCondition(c100212005.spcon1) e2:SetCondition(c100212005.spcon1)
e2:SetTarget(c100212005.sptg) e2:SetTarget(c100212005.sptg)
e2:SetOperation(c100212005.spop) e2:SetOperation(c100212005.spop)
c:RegisterEffect(e2) c:RegisterEffect(e2)
e3=e2:Clone() local e3=e2:Clone()
e3:SetCode(EVENT_BATTLED) e3:SetCode(EVENT_BATTLE_DAMAGE)
e3:SetCondition(c100212005.spcon2) e3:SetCondition(c100212005.spcon2)
c:RegisterEffect(e3) c:RegisterEffect(e3)
local e4=Effect.CreateEffect(c) local e4=Effect.CreateEffect(c)
...@@ -43,7 +44,7 @@ function c100212005.matfilter(c) ...@@ -43,7 +44,7 @@ function c100212005.matfilter(c)
return c:IsAttribute(ATTRIBUTE_DARK) and c:IsType(TYPE_PENDULUM) return c:IsAttribute(ATTRIBUTE_DARK) and c:IsType(TYPE_PENDULUM)
end end
function c100212005.cfilter(c,tp) function c100212005.cfilter(c,tp)
return c:IsSetCard(0x10f8,0x20f8) and Duel.GetMZoneCount(tp,c)>0 return c:IsSetCard(0x10f8,0x20f8) and c:IsType(TYPE_PENDULUM) and Duel.GetMZoneCount(tp,c)>0
and (c:IsFaceup() or c:IsControler(tp)) and (c:IsFaceup() or c:IsControler(tp))
end end
function c100212005.pspcost(e,tp,eg,ep,ev,re,r,rp,chk) function c100212005.pspcost(e,tp,eg,ep,ev,re,r,rp,chk)
...@@ -65,12 +66,12 @@ end ...@@ -65,12 +66,12 @@ end
function c100212005.spcon1(e,tp,eg,ep,ev,re,r,rp) function c100212005.spcon1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
local bc=c:GetBattleTarget() local bc=c:GetBattleTarget()
return bc and bc:IsStatus(STATUS_BATTLE_DESTROYED) return not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) and bc~=nil and bc:IsStatus(STATUS_BATTLE_DESTROYED)
end end
function c100212005.spcon2(e,tp,eg,ep,ev,re,r,rp) function c100212005.spcon2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
local bc=c:GetBattleTarget() local bc=c:GetBattleTarget()
return ep~=tp and not (bc and bc:IsStatus(STATUS_BATTLE_DESTROYED)) return not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) and ep~=tp
end end
function c100212005.spfilter(c,e,tp) function c100212005.spfilter(c,e,tp)
return c:IsSetCard(0x20f8) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE) return c:IsSetCard(0x20f8) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE)
...@@ -79,17 +80,38 @@ function c100212005.spfilter(c,e,tp) ...@@ -79,17 +80,38 @@ function c100212005.spfilter(c,e,tp)
end end
function c100212005.sptg(e,tp,eg,ep,ev,re,r,rp,chk) function c100212005.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c100212005.spfilter,tp,LOCATION_DECK+LOCATION_EXTRA+LOCATION_GRAVE,0,1,nil,e,tp) end if chk==0 then return Duel.IsExistingMatchingCard(c100212005.spfilter,tp,LOCATION_DECK+LOCATION_EXTRA+LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK+LOCATION_EXTRA) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK+LOCATION_EXTRA+LOCATION_GRAVE)
end
function c100212005.filter(c)
return c:IsFaceup() and c:IsType(TYPE_PENDULUM) and c:IsLocation(LOCATION_EXTRA)
end
function c100212005.gcheck(g,tp,eft)
return g:FilterCount(c100212005.filter,nil)<=eft
end end
function c100212005.spop(e,tp,eg,ep,ev,re,r,rp) function c100212005.spop(e,tp,eg,ep,ev,re,r,rp)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE) local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
local eft=Duel.GetLocationCountFromEx(tp,tp,nil,TYPE_PENDULUM)
if ft<=0 then return end if ft<=0 then return end
if ft>=2 then ft=2 end if ft>=2 then ft=2 end
if Duel.IsPlayerAffectedByEffect(tp,59822133) then ft=1 end if Duel.IsPlayerAffectedByEffect(tp,59822133) then ft=1 end
local g=Duel.GetMatchingGroup(c100212005.spfilter,tp,LOCATION_DECK+LOCATION_EXTRA+LOCATION_GRAVE,0,nil,e,tp)
if g:GetCount()==0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c100212005.spfilter,tp,LOCATION_DECK+LOCATION_EXTRA+LOCATION_GRAVE,0,1,ft,nil,e,tp) local sg=g:SelectSubGroup(tp,c100212005.gcheck,false,1,ft,tp,eft)
if g:GetCount()>0 then if sg:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP_DEFENSE) local exg=sg:Filter(c100212005.filter,nil)
sg:Sub(exg)
if exg:GetCount()>0 then
for tc in aux.Next(exg) do
Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP_DEFENSE)
end
end
if sg:GetCount()>0 then
for tc in aux.Next(sg) do
Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP_DEFENSE)
end
end
Duel.SpecialSummonComplete()
end end
end end
function c100212005.pencon(e,tp,eg,ep,ev,re,r,rp) function c100212005.pencon(e,tp,eg,ep,ev,re,r,rp)
......
...@@ -34,7 +34,7 @@ function c101204059.initial_effect(c) ...@@ -34,7 +34,7 @@ function c101204059.initial_effect(c)
c:RegisterEffect(e4) c:RegisterEffect(e4)
end end
function c101204059.indcon(e) function c101204059.indcon(e)
return Duel.GetCurrentPhase()==PHASE_MAIN1 return Duel.GetCurrentPhase()==PHASE_MAIN1 and Duel.GetTurnPlayer()==tp
end end
function c101204059.indtg(e,c) function c101204059.indtg(e,c)
return c:IsRace(RACE_DRAGON) and c:IsAttribute(ATTRIBUTE_FIRE) return c:IsRace(RACE_DRAGON) and c:IsAttribute(ATTRIBUTE_FIRE)
......
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