Commit 1313b652 authored by wind2009's avatar wind2009

Fix 燦幻封炉

parent 51858d12
Pipeline #28102 passed with stages
in 54 seconds
...@@ -11,7 +11,7 @@ function s.initial_effect(c) ...@@ -11,7 +11,7 @@ function s.initial_effect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetRange(LOCATION_SZONE) e1:SetRange(LOCATION_SZONE)
e1:SetCode(EVENT_BATTLE_DESTROYING) e1:SetCode(EVENT_BATTLE_DESTROYED)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCountLimit(1) e1:SetCountLimit(1)
e1:SetCondition(s.spcon) e1:SetCondition(s.spcon)
...@@ -32,20 +32,27 @@ function s.initial_effect(c) ...@@ -32,20 +32,27 @@ function s.initial_effect(c)
e2:SetOperation(s.setop) e2:SetOperation(s.setop)
c:RegisterEffect(e2) c:RegisterEffect(e2)
end end
function s.spfilter(c,tp,e)
if c:IsRace(RACE_DRAGON) and c:IsAttribute(ATTRIBUTE_FIRE) and c:IsPreviousControler(tp) then return true end
local rc=c:GetBattleTarget()
return rc:IsRace(RACE_DRAGON) and rc:IsAttribute(ATTRIBUTE_FIRE)
and (not rc:IsLocation(LOCATION_MZONE) and rc:IsPreviousControler(tp)
or rc:IsLocation(LOCATION_MZONE) and rc:IsControler(tp))
end
function s.spcon(e,tp,eg,ep,ev,re,r,rp) function s.spcon(e,tp,eg,ep,ev,re,r,rp)
local rc=eg:GetFirst() return not eg:IsContains(e:GetHandler()) and eg:IsExists(s.spfilter,1,nil,tp,e)
local tc=rc:GetBattleTarget() end
return rc:IsControler(tp) function s.tgfilter(c,e)
and rc:IsRace(RACE_DRAGON) and rc:IsAttribute(ATTRIBUTE_FIRE) return not c:IsType(TYPE_TOKEN) and c:IsFaceupEx() and c:IsType(TYPE_MONSTER) and c:IsCanBeEffectTarget(e)
and tc:IsType(TYPE_MONSTER) and tc:IsReason(REASON_BATTLE) and not tc:IsType(TYPE_TOKEN)
end end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local rc=eg:GetFirst()
local bc=rc:GetBattleTarget()
if chkc then return false end if chkc then return false end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 local g=eg:Filter(s.tgfilter,nil,e)
and bc:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE) if chk==0 then return g:GetCount()>0 end
and bc:IsCanBeEffectTarget(e) end local bc=g:GetFirst()
if g:GetCount()>1 then
bc=g:FilterSelect(tp,s.tgfilter,1,1,nil,e):GetFirst()
end
Duel.SetTargetCard(bc) Duel.SetTargetCard(bc)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,bc,1,0,0) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,bc,1,0,0)
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