Commit 5ca47b55 authored by nekrozar's avatar nekrozar

fix material check

https://www.db.yugioh-card.com/yugiohdb/faq_search.action?ope=5&fid=10617

質問の状況のように、「青眼の亜白龍」を含むモンスター3体で融合召喚された「青眼の究極亜竜」がその後に裏側守備表示になった場合には、その後に表側表示に戻ったとしても、その「青眼の究極亜竜」は『元々のカード名が「青眼の亜白龍」となるモンスターを素材としてこのカードが融合召喚されている』事にはなりません。
parent 301bed8a
...@@ -36,6 +36,20 @@ function c13518809.initial_effect(c) ...@@ -36,6 +36,20 @@ function c13518809.initial_effect(c)
e4:SetTarget(c13518809.damtg) e4:SetTarget(c13518809.damtg)
e4:SetOperation(c13518809.damop) e4:SetOperation(c13518809.damop)
c:RegisterEffect(e4) c:RegisterEffect(e4)
--material check
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e5:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e5:SetCode(EVENT_SPSUMMON_SUCCESS)
e5:SetCondition(c13518809.matcon)
e5:SetOperation(c13518809.matop)
c:RegisterEffect(e5)
local e6=Effect.CreateEffect(c)
e6:SetType(EFFECT_TYPE_SINGLE)
e6:SetCode(EFFECT_MATERIAL_CHECK)
e6:SetValue(c13518809.valcheck)
e6:SetLabelObject(e5)
c:RegisterEffect(e6)
end end
function c13518809.indcon(e,tp,eg,ep,ev,re,r,rp) function c13518809.indcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_RITUAL) return e:GetHandler():IsSummonType(SUMMON_TYPE_RITUAL)
...@@ -47,9 +61,7 @@ function c13518809.mfilter(c) ...@@ -47,9 +61,7 @@ function c13518809.mfilter(c)
return not c:IsType(TYPE_RITUAL) return not c:IsType(TYPE_RITUAL)
end end
function c13518809.condition(e) function c13518809.condition(e)
local c=e:GetHandler() return e:GetHandler():GetFlagEffect(13518809)>0
local mg=c:GetMaterial()
return c:GetSummonType()==SUMMON_TYPE_RITUAL and mg:GetCount()>0 and not mg:IsExists(c13518809.mfilter,1,nil)
end end
function c13518809.damtg(e,tp,eg,ep,ev,re,r,rp,chk) function c13518809.damtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end if chk==0 then return true end
...@@ -64,3 +76,17 @@ function c13518809.damop(e,tp,eg,ep,ev,re,r,rp) ...@@ -64,3 +76,17 @@ function c13518809.damop(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM) local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Damage(p,d,REASON_EFFECT) Duel.Damage(p,d,REASON_EFFECT)
end end
function c13518809.matcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_RITUAL) and e:GetLabel()==1
end
function c13518809.matop(e,tp,eg,ep,ev,re,r,rp)
e:GetHandler():RegisterFlagEffect(13518809,RESET_EVENT+RESETS_STANDARD,0,1)
end
function c13518809.valcheck(e,c)
local g=c:GetMaterial()
if g:GetCount()>0 and not g:IsExists(c13518809.mfilter,1,nil) then
e:GetLabelObject():SetLabel(1)
else
e:GetLabelObject():SetLabel(0)
end
end
...@@ -34,13 +34,26 @@ function c20654247.initial_effect(c) ...@@ -34,13 +34,26 @@ function c20654247.initial_effect(c)
e4:SetTarget(c20654247.postg) e4:SetTarget(c20654247.postg)
e4:SetOperation(c20654247.posop) e4:SetOperation(c20654247.posop)
c:RegisterEffect(e4) c:RegisterEffect(e4)
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e0:SetCode(EVENT_SPSUMMON_SUCCESS)
e0:SetCondition(c20654247.matcon)
e0:SetOperation(c20654247.matop)
c:RegisterEffect(e0)
local e5=Effect.CreateEffect(c) local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_SINGLE) e5:SetType(EFFECT_TYPE_SINGLE)
e5:SetCode(EFFECT_MATERIAL_CHECK) e5:SetCode(EFFECT_MATERIAL_CHECK)
e5:SetValue(c20654247.valcheck) e5:SetValue(c20654247.valcheck)
e5:SetLabelObject(e4) e5:SetLabelObject(e0)
c:RegisterEffect(e5) c:RegisterEffect(e5)
end end
function c20654247.matcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_RITUAL) and e:GetLabel()==1
end
function c20654247.matop(e,tp,eg,ep,ev,re,r,rp)
e:GetHandler():RegisterFlagEffect(20654247,RESET_EVENT+RESETS_STANDARD,0,1)
end
function c20654247.valcheck(e,c) function c20654247.valcheck(e,c)
local mg=c:GetMaterial() local mg=c:GetMaterial()
if mg:IsExists(Card.IsCode,1,nil,89631139) then if mg:IsExists(Card.IsCode,1,nil,89631139) then
...@@ -50,8 +63,7 @@ function c20654247.valcheck(e,c) ...@@ -50,8 +63,7 @@ function c20654247.valcheck(e,c)
end end
end end
function c20654247.poscon(e,tp,eg,ep,ev,re,r,rp) function c20654247.poscon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() return e:GetHandler():GetFlagEffect(20654247)>0
return c:GetSummonType()==SUMMON_TYPE_RITUAL and e:GetLabel()==1
end end
function c20654247.postg(e,tp,eg,ep,ev,re,r,rp,chk) function c20654247.postg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsCanChangePosition,tp,0,LOCATION_MZONE,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(Card.IsCanChangePosition,tp,0,LOCATION_MZONE,1,nil) end
......
...@@ -27,11 +27,18 @@ function c43228023.initial_effect(c) ...@@ -27,11 +27,18 @@ function c43228023.initial_effect(c)
e3:SetTarget(c43228023.destg) e3:SetTarget(c43228023.destg)
e3:SetOperation(c43228023.desop) e3:SetOperation(c43228023.desop)
c:RegisterEffect(e3) c:RegisterEffect(e3)
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e0:SetCode(EVENT_SPSUMMON_SUCCESS)
e0:SetCondition(c43228023.matcon)
e0:SetOperation(c43228023.matop)
c:RegisterEffect(e0)
local e4=Effect.CreateEffect(c) local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE) e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetCode(EFFECT_MATERIAL_CHECK) e4:SetCode(EFFECT_MATERIAL_CHECK)
e4:SetValue(c43228023.valcheck) e4:SetValue(c43228023.valcheck)
e4:SetLabelObject(e3) e4:SetLabelObject(e0)
c:RegisterEffect(e4) c:RegisterEffect(e4)
end end
function c43228023.descost(e,tp,eg,ep,ev,re,r,rp,chk) function c43228023.descost(e,tp,eg,ep,ev,re,r,rp,chk)
...@@ -48,7 +55,7 @@ function c43228023.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) ...@@ -48,7 +55,7 @@ function c43228023.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_ONFIELD) and chkc:IsControler(1-tp) end if chkc then return chkc:IsLocation(LOCATION_ONFIELD) and chkc:IsControler(1-tp) end
if chk==0 then return Duel.IsExistingTarget(nil,tp,0,LOCATION_ONFIELD,1,nil) end if chk==0 then return Duel.IsExistingTarget(nil,tp,0,LOCATION_ONFIELD,1,nil) end
local ct=1 local ct=1
if e:GetLabel()==1 and e:GetHandler():IsSummonType(SUMMON_TYPE_FUSION) then ct=3 end if e:GetHandler():GetFlagEffect(43228023)>0 then ct=3 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,nil,tp,0,LOCATION_ONFIELD,1,ct,nil) local g=Duel.SelectTarget(tp,nil,tp,0,LOCATION_ONFIELD,1,ct,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
...@@ -57,6 +64,12 @@ function c43228023.desop(e,tp,eg,ep,ev,re,r,rp) ...@@ -57,6 +64,12 @@ function c43228023.desop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(Card.IsRelateToEffect,nil,e) local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(Card.IsRelateToEffect,nil,e)
Duel.Destroy(g,REASON_EFFECT) Duel.Destroy(g,REASON_EFFECT)
end end
function c43228023.matcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_FUSION) and e:GetLabel()==1
end
function c43228023.matop(e,tp,eg,ep,ev,re,r,rp)
e:GetHandler():RegisterFlagEffect(43228023,RESET_EVENT+RESETS_STANDARD,0,1)
end
function c43228023.spfilter(c) function c43228023.spfilter(c)
return c:IsOriginalCodeRule(38517737) return c:IsOriginalCodeRule(38517737)
end end
......
...@@ -39,6 +39,20 @@ function c59913418.initial_effect(c) ...@@ -39,6 +39,20 @@ function c59913418.initial_effect(c)
e3:SetTarget(c59913418.destg) e3:SetTarget(c59913418.destg)
e3:SetOperation(c59913418.desop) e3:SetOperation(c59913418.desop)
c:RegisterEffect(e3) c:RegisterEffect(e3)
--material check
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e4:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e4:SetCode(EVENT_SPSUMMON_SUCCESS)
e4:SetCondition(c59913418.matcon)
e4:SetOperation(c59913418.matop)
c:RegisterEffect(e4)
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_SINGLE)
e5:SetCode(EFFECT_MATERIAL_CHECK)
e5:SetValue(c59913418.valcheck)
e5:SetLabelObject(e4)
c:RegisterEffect(e5)
end end
function c59913418.indcon(e,tp,eg,ep,ev,re,r,rp) function c59913418.indcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_RITUAL) return e:GetHandler():IsSummonType(SUMMON_TYPE_RITUAL)
...@@ -50,9 +64,7 @@ function c59913418.mfilter(c) ...@@ -50,9 +64,7 @@ function c59913418.mfilter(c)
return not c:IsType(TYPE_RITUAL) return not c:IsType(TYPE_RITUAL)
end end
function c59913418.costcon(e) function c59913418.costcon(e)
local c=e:GetHandler() return e:GetHandler():GetFlagEffect(59913418)>0
local mg=c:GetMaterial()
return c:GetSummonType()==SUMMON_TYPE_RITUAL and mg:GetCount()>0 and not mg:IsExists(c59913418.mfilter,1,nil)
end end
function c59913418.costval(e,re,rp,val) function c59913418.costval(e,re,rp,val)
if re and re:IsHasType(0x7e0) and re:GetHandler()==e:GetHandler() then if re and re:IsHasType(0x7e0) and re:GetHandler()==e:GetHandler() then
...@@ -78,3 +90,17 @@ function c59913418.desop(e,tp,eg,ep,ev,re,r,rp) ...@@ -78,3 +90,17 @@ function c59913418.desop(e,tp,eg,ep,ev,re,r,rp)
Duel.Damage(1-tp,ct*200,REASON_EFFECT) Duel.Damage(1-tp,ct*200,REASON_EFFECT)
end end
end end
function c59913418.matcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_RITUAL) and e:GetLabel()==1
end
function c59913418.matop(e,tp,eg,ep,ev,re,r,rp)
e:GetHandler():RegisterFlagEffect(59913418,RESET_EVENT+RESETS_STANDARD,0,1)
end
function c59913418.valcheck(e,c)
local g=c:GetMaterial()
if g:GetCount()>0 and not g:IsExists(c59913418.mfilter,1,nil) then
e:GetLabelObject():SetLabel(1)
else
e:GetLabelObject():SetLabel(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