Commit 4d8b5d2c authored by wind2009's avatar wind2009

Fix

parent bf231ca4
No preview for this file type
......@@ -118,8 +118,8 @@ end
function s.atkcon(e,tp,eg,ep,ev,re,r,rp)
local a=Duel.GetAttacker()
local b=Duel.GetAttackTarget()
return a:IsFaceup() and a:IsAttribute(ATTRIBUTE_EARTH)
and b:IsFaceup() and b:IsAttribute(ATTRIBUTE_EARTH)
return a and a:IsFaceup() and a:IsAttribute(ATTRIBUTE_EARTH)
and b and b:IsFaceup() and b:IsAttribute(ATTRIBUTE_EARTH)
end
function s.atkop(e,tp,eg,ep,ev,re,r,rp)
Duel.NegateAttack()
......
......@@ -46,7 +46,7 @@ function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
{b2,aux.Stringid(id,3),2})
end
e:SetLabel(op)
if op==1 then
if op==1 then
if e:IsCostChecked() then
e:SetCategory(CATEGORY_SPECIAL_SUMMON)
end
......@@ -60,10 +60,12 @@ function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
end
function s.spop(e,tp,eg,ep,ev,re,r,rp)
if e:GetLabel()==1 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_HAND,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_HAND,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
elseif e:GetLabel()==2 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
......@@ -87,13 +89,15 @@ end
function s.spop2(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToChain() and aux.NecroValleyFilter()(tc)
and Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)~=0
and tc:GetBaseAttack()<=1200 then
and Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP)~=0
and tc:GetTextAttack()<=1200 and tc:GetTextAttack()>=0 then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetValue(1200)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
end
Duel.SpecialSummonComplete()
end
\ No newline at end of file
......@@ -21,6 +21,7 @@ function s.initial_effect(c)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,id+o)
e2:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_MAIN_END)
e2:SetCondition(s.thcon)
e2:SetCost(s.thcost)
e2:SetTarget(s.thtg)
......@@ -45,19 +46,21 @@ end
function s.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToChain()
and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)~=0 then
and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)~=0
and c:IsCanAddCounter(0x1f,3) then
Duel.BreakEffect()
c:AddCounter(0x1f,3)
end
end
function s.thcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2
return Duel.IsMainPhase()
end
function s.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsCanRemoveCounter(tp,0x1f,1,REASON_COST) end
e:GetHandler():RemoveCounter(tp,0x1f,1,REASON_COST)
end
function s.thfilter(c)
return (c:IsCode(66947414) or aux.IsCodeListed(c,66947414) and c:IsType(TYPE_SPELL+TYPE_TRAP)) and c:IsAbleToHand()
return (c:IsCode(66947414) or aux.IsCodeOrListed(c,66947414) and c:IsType(TYPE_SPELL+TYPE_TRAP)) and c:IsAbleToHand()
end
function s.spfilter(c,e,tp)
return c:IsSetCard(0x15) and c:IsLevelBelow(9) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
......
......@@ -22,6 +22,7 @@ function s.initial_effect(c)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,EFFECT_COUNT_CODE_CHAIN)
e2:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e2:SetCost(s.descost)
e2:SetTarget(s.destg)
e2:SetOperation(s.desop)
......@@ -46,7 +47,9 @@ function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
end
function s.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToChain() and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)~=0 and e:GetLabel()>0 then
if c:IsRelateToChain() and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)~=0
and e:GetLabel()>0 and c:IsCanAddCounter(0x1f) then
Duel.BreakEffect()
c:AddCounter(0x1f,e:GetLabel())
end
end
......@@ -54,18 +57,21 @@ function s.descost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsCanRemoveCounter(tp,0x1f,1,REASON_COST) end
e:GetHandler():RemoveCounter(tp,0x1f,1,REASON_COST)
end
function s.filter(c)
return c:IsFaceup() and c:IsSetCard(0x15) and Duel.IsExistingTarget(Card.IsFaceup,0,LOCATION_ONFIELD,LOCATION_ONFIELD,1,c)
function s.cfilter(c,e)
return c:IsFaceup() and c:IsCanBeEffectTarget(e)
end
function s.fselect(g)
return g:IsExists(aux.AND(Card.IsFaceup,Card.IsSetCard),1,nil,0x15)
end
function s.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end
if chk==0 then return Duel.IsExistingTarget(s.filter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,s.filter,tp,LOCATION_MZONE,0,1,1,nil)
local rg=Duel.GetMatchingGroup(s.cfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil,e)
if chk==0 then return rg:CheckSubGroup(s.fselect,2,2) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local ag=Duel.SelectTarget(tp,Card.IsFaceup,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,g)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g+ag,2,0,0)
local sg=rg:SelectSubGroup(tp,s.fselect,false,2,2)
Duel.SetTargetCard(sg)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function s.desop(e,tp,eg,ep,ev,re,r,rp)
Duel.Destroy(Duel.GetTargetsRelateToChain(),REASON_EFFECT)
end
\ No newline at end of file
end
......@@ -26,7 +26,7 @@ function s.initial_effect(c)
c:RegisterEffect(e2)
end
function s.cfilter(c)
return c:IsSetCard(0x14d,0x155) and c:IsFaceup()
return c:IsSetCard(0x14d,0x155) and c:IsFaceup() and not c:IsCode(id)
end
function s.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_MZONE,0,1,nil)
......@@ -44,7 +44,7 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp)
end
function s.spfilter(c,e,tp)
return not c:IsCode(id)
and (c:IsSetCard(0x14d,0x155) or c:IsCode(68468459) or aux.IsCodeListed(c,68468459))
and (c:IsSetCard(0x14d,0x155) or aux.IsCodeOrListed(c,68468459))
and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE)
end
function s.sptg2(e,tp,eg,ep,ev,re,r,rp,chk)
......
--超導戦騎プラズマ・マグナム
--超導戦騎プラズマ・マグナム
local s,id,o=GetID()
function s.initial_effect(c)
--material
......@@ -58,7 +58,7 @@ function s.thop(e,tp,eg,ep,ev,re,r,rp)
end
end
function s.cfilter(c)
return c:IsSetCard(0x2066) and c:IsLevel(8) and c:IsAbleToGraveAsCost()
return c:IsSetCard(0xe9) and c:IsLevel(8) and c:IsAbleToGraveAsCost()
end
function s.sumcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_DECK,0,1,nil) end
......
......@@ -23,7 +23,7 @@ function s.initial_effect(c)
--spsummon or tohand
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(id,1))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOHAND+CATEGORY_SEARCH)
e3:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOHAND+CATEGORY_SEARCH+CATEGORY_DECKDES)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1,id)
......@@ -56,7 +56,7 @@ function s.spcost2(e,tp,eg,ep,ev,re,r,rp,chk)
e:GetHandler():RemoveOverlayCard(tp,2,2,REASON_COST)
end
function s.spfilter2(c,e,tp)
if not (c:IsSetCard(0x155,0x179) or c:IsCode(68468459) or aux.IsCodeListed(c,68468459)) then return false end
if not (c:IsSetCard(0x155,0x179) or aux.IsCodeOrListed(c,68468459)) then return false end
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
return c:IsAbleToHand() or (ft>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false))
end
......@@ -72,7 +72,7 @@ function s.spop2(e,tp,eg,ep,ev,re,r,rp)
if tc:IsAbleToHand() and (not tc:IsCanBeSpecialSummoned(e,0,tp,false,false) or ft<=0 or Duel.SelectOption(tp,1190,1152)==0) then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tc)
else
elseif ft>0 and tc:IsCanBeSpecialSummoned(e,0,tp,false,false) then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
end
end
......
......@@ -16,7 +16,7 @@ function s.initial_effect(c)
c:RegisterEffect(e1)
end
function s.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2
return Duel.IsMainPhase()
end
function s.thfilter1(c)
return (c:IsCode(44839512) or c:IsSetCard(0x2066) and c:IsLevelBelow(4))
......@@ -25,9 +25,6 @@ end
function s.thfilter2(c)
return c:IsSetCard(0xe9) and c:IsLevel(8) and c:IsAbleToHand()
end
function s.filter0(c)
return (c:IsLocation(LOCATION_MZONE) or c:IsFaceupEx()) and c:IsRace(RACE_ROCK) and c:IsAbleToDeck()
end
function s.filter1(c,e)
return (c:IsLocation(LOCATION_MZONE) or c:IsFaceupEx()) and c:IsRace(RACE_ROCK)
and not c:IsImmuneToEffect(e) and c:IsAbleToDeck()
......@@ -43,7 +40,7 @@ function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
and (not e:IsCostChecked() or Duel.GetFlagEffect(tp,id+o)==0)
local b3=false
local chkf=tp
local mg1=Duel.GetMatchingGroup(s.filter0,tp,LOCATION_HAND+LOCATION_MZONE+LOCATION_GRAVE+LOCATION_REMOVED,0,nil)
local mg1=Duel.GetMatchingGroup(s.filter1,tp,LOCATION_HAND+LOCATION_MZONE+LOCATION_GRAVE+LOCATION_REMOVED,0,nil)
local res=Duel.IsExistingMatchingCard(s.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg1,nil,chkf)
if not res then
local ce=Duel.GetChainMaterial(tp)
......@@ -59,9 +56,9 @@ function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
local op=0
if b1 or b2 or b3 then
op=aux.SelectFromOptions(tp,
{b1,aux.Stringid(id,0),1},
{b2,aux.Stringid(id,1),2},
{b3,aux.Stringid(id,2),3})
{b1,aux.Stringid(id,1),1},
{b2,aux.Stringid(id,2),2},
{b3,aux.Stringid(id,3),3})
end
e:SetLabel(op)
if op==1 or op==2 then
......@@ -79,6 +76,9 @@ function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,1,tp,LOCATION_HAND+LOCATION_MZONE+LOCATION_GRAVE+LOCATION_REMOVED)
end
end
function s.cfilter(c)
return c:IsLocation(LOCATION_REMOVED) or (c:IsLocation(LOCATION_MZONE) and c:IsFaceup())
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
if e:GetLabel()==1 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
......@@ -113,14 +113,21 @@ function s.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tg=sg:Select(tp,1,1,nil)
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,nil,chkf)
tc:SetMaterial(mat1)
Duel.HintSelection(mat1)
if mat1:IsExists(Card.IsFacedown,1,nil) then
local cg=mat1:Filter(Card.IsFacedown,nil)
Duel.ConfirmCards(1-tp,cg)
end
if mat1:Filter(s.cfilter,nil):GetCount()>0 then
local cg=mat1:Filter(s.cfilter,nil)
Duel.HintSelection(cg)
end
Duel.SendtoDeck(mat1,nil,SEQ_DECKSHUFFLE,REASON_EFFECT+REASON_MATERIAL+REASON_FUSION)
Duel.BreakEffect()
Duel.SpecialSummon(tc,SUMMON_TYPE_FUSION,tp,tp,false,false,POS_FACEUP)
else
elseif ce then
local mat2=Duel.SelectFusionMaterial(tp,tc,mg2,nil,chkf)
local fop=ce:GetOperation()
fop(ce,e,tp,tc,mat2)
......
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