Commit bf231ca4 authored by wind2009's avatar wind2009

Fix

parent ce57f21e
Pipeline #41107 canceled with stages
in 5 seconds
-- --磁石の戦士Σ+
local s,id,o=GetID() local s,id,o=GetID()
function s.initial_effect(c) function s.initial_effect(c)
--must attack --must attack
...@@ -35,13 +35,13 @@ function s.initial_effect(c) ...@@ -35,13 +35,13 @@ function s.initial_effect(c)
c:RegisterEffect(e4) c:RegisterEffect(e4)
end end
function s.atkfilter(c) function s.atkfilter(c)
return c:IsAttribute(ATTRIBUTE_EARTH) return c:IsAttribute(ATTRIBUTE_EARTH) and c:IsFaceup()
end end
function s.atkcon(e) function s.atkcon(e)
return Duel.IsExistingMatchingCard(s.atkfilter,e:GetHandlerPlayer(),LOCATION_MZONE,0,1,nil) return Duel.IsExistingMatchingCard(s.atkfilter,e:GetHandlerPlayer(),LOCATION_MZONE,0,1,nil)
end end
function s.atklimit(e,c) function s.atklimit(e,c)
return c:IsAttribute(ATTRIBUTE_EARTH) return c:IsAttribute(ATTRIBUTE_EARTH) and c:IsFaceup()
end end
function s.podfilter(c) function s.podfilter(c)
return c:IsAttribute(ATTRIBUTE_EARTH) and c:IsFaceup() return c:IsAttribute(ATTRIBUTE_EARTH) and c:IsFaceup()
...@@ -51,8 +51,8 @@ function s.podcond(e) ...@@ -51,8 +51,8 @@ function s.podcond(e)
return Duel.IsExistingMatchingCard(s.podfilter,tp,0,LOCATION_MZONE,1,nil) return Duel.IsExistingMatchingCard(s.podfilter,tp,0,LOCATION_MZONE,1,nil)
end end
function s.filter(c,e,tp) function s.filter(c,e,tp)
return not c:IsCode(id) and c:IsLevelBelow(4) return not c:IsCode(id) and c:IsLevelBelow(4) and c:IsCode(0x2066)
and (c:IsAbleToHand() or (Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false))) and (c:IsAbleToHand() or Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false))
end end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and s.filter(chkc,e,tp) end if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and s.filter(chkc,e,tp) end
...@@ -68,7 +68,7 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp) ...@@ -68,7 +68,7 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and tc:IsCanBeSpecialSummoned(e,0,tp,false,false) if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and tc:IsCanBeSpecialSummoned(e,0,tp,false,false)
and (not tc:IsAbleToHand() or Duel.SelectOption(tp,1190,1152)==1) then and (not tc:IsAbleToHand() or Duel.SelectOption(tp,1190,1152)==1) then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP) Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
else elseif tc:IsAbleToHand() then
Duel.SendtoHand(tc,nil,REASON_EFFECT) Duel.SendtoHand(tc,nil,REASON_EFFECT)
end end
end end
......
...@@ -12,7 +12,7 @@ function s.initial_effect(c) ...@@ -12,7 +12,7 @@ function s.initial_effect(c)
e1:SetTarget(s.fsptg) e1:SetTarget(s.fsptg)
e1:SetOperation(s.fspop) e1:SetOperation(s.fspop)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--to hand --to grave
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1)) e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_TOGRAVE) e2:SetCategory(CATEGORY_TOGRAVE)
...@@ -51,7 +51,7 @@ function s.fsptg(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -51,7 +51,7 @@ function s.fsptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler() local c=e:GetHandler()
if chk==0 then if chk==0 then
local chkf=tp local chkf=tp
local mg1=Duel.GetFusionMaterial(tp):Filter(Card.IsRace,nil,RACE_ROCK) local mg1=Duel.GetFusionMaterial(tp):Filter(s.spfilter1,nil,e)
local res=Duel.IsExistingMatchingCard(s.spfilter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg1,nil,c,chkf) local res=Duel.IsExistingMatchingCard(s.spfilter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg1,nil,c,chkf)
if not res then if not res then
local ce=Duel.GetChainMaterial(tp) local ce=Duel.GetChainMaterial(tp)
...@@ -87,13 +87,13 @@ function s.fspop(e,tp,eg,ep,ev,re,r,rp) ...@@ -87,13 +87,13 @@ function s.fspop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tg=sg:Select(tp,1,1,nil) local tg=sg:Select(tp,1,1,nil)
local tc=tg:GetFirst() local tc=tg:GetFirst()
if sg1:IsContains(tc) and (sg2==nil or not sg2:IsContains(tc) or not Duel.SelectYesNo(tp,ce:GetDescription())) then if sg1:IsContains(tc) and (sg2==nil or not sg2:IsContains(tc) or ce and not Duel.SelectYesNo(tp,ce:GetDescription())) then
local mat1=Duel.SelectFusionMaterial(tp,tc,mg1,c,chkf) local mat1=Duel.SelectFusionMaterial(tp,tc,mg1,c,chkf)
tc:SetMaterial(mat1) tc:SetMaterial(mat1)
Duel.SendtoGrave(mat1,REASON_EFFECT+REASON_MATERIAL+REASON_FUSION) Duel.SendtoGrave(mat1,REASON_EFFECT+REASON_MATERIAL+REASON_FUSION)
Duel.BreakEffect() Duel.BreakEffect()
Duel.SpecialSummon(tc,SUMMON_TYPE_FUSION,tp,tp,false,false,POS_FACEUP) Duel.SpecialSummon(tc,SUMMON_TYPE_FUSION,tp,tp,false,false,POS_FACEUP)
else elseif ce then
local mat2=Duel.SelectFusionMaterial(tp,tc,mg2,c,chkf) local mat2=Duel.SelectFusionMaterial(tp,tc,mg2,c,chkf)
local fop=ce:GetOperation() local fop=ce:GetOperation()
fop(ce,e,tp,tc,mat2) fop(ce,e,tp,tc,mat2)
...@@ -102,7 +102,7 @@ function s.fspop(e,tp,eg,ep,ev,re,r,rp) ...@@ -102,7 +102,7 @@ function s.fspop(e,tp,eg,ep,ev,re,r,rp)
end end
end end
function s.tgfilter(c) function s.tgfilter(c)
return c:IsSetCard(0x2066) and c:IsLevel(8) and c:IsAbleToGrave() return c:IsSetCard(0xe9) and c:IsLevel(8) and c:IsAbleToGrave()
end end
function s.tgtg(e,tp,eg,ep,ev,re,r,rp,chk) function s.tgtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.tgfilter,tp,LOCATION_DECK,0,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(s.tgfilter,tp,LOCATION_DECK,0,1,nil) end
...@@ -111,13 +111,15 @@ end ...@@ -111,13 +111,15 @@ end
function s.tgop(e,tp,eg,ep,ev,re,r,rp) function s.tgop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,s.tgfilter,tp,LOCATION_DECK,0,1,1,nil) local g=Duel.SelectMatchingCard(tp,s.tgfilter,tp,LOCATION_DECK,0,1,1,nil)
Duel.SendtoGrave(g,REASON_EFFECT) if g:GetCount()>0 then
Duel.SendtoGrave(g,REASON_EFFECT)
end
end end
function s.atkcon(e,tp,eg,ep,ev,re,r,rp) function s.atkcon(e,tp,eg,ep,ev,re,r,rp)
local a=Duel.GetAttacker() local a=Duel.GetAttacker()
local b=Duel.GetAttackTarget() local b=Duel.GetAttackTarget()
return a:IsFaceup() and a:IsAttribute(ATTRIBUTE_EARTH) return a:IsFaceup() and a:IsAttribute(ATTRIBUTE_EARTH)
or b:IsFaceup() and b:IsAttribute(ATTRIBUTE_EARTH) and b:IsFaceup() and b:IsAttribute(ATTRIBUTE_EARTH)
end end
function s.atkop(e,tp,eg,ep,ev,re,r,rp) function s.atkop(e,tp,eg,ep,ev,re,r,rp)
Duel.NegateAttack() Duel.NegateAttack()
......
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