Commit f78d5957 authored by argon.sun's avatar argon.sun

fix

parent 7bf43dca
......@@ -24,7 +24,7 @@ function c11834972.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local t={}
for i=1,ct do t[i]=i end
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(11834972,1))
local ac=Duel.AnnounceNumber(tp,unpack(t))
local ac=Duel.AnnounceNumber(tp,table.unpack(t))
Duel.DiscardDeck(tp,ac,REASON_COST)
local g=Duel.GetOperatedGroup()
e:SetLabel(g:FilterCount(Card.IsSetCard,nil,0x39)*200)
......
......@@ -27,7 +27,7 @@ function c17078030.cost(e,tp,eg,ep,ev,re,r,rp,chk)
l=l+1
end
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(17078030,0))
local announce=Duel.AnnounceNumber(tp,unpack(t))
local announce=Duel.AnnounceNumber(tp,table.unpack(t))
Duel.PayLPCost(tp,announce)
e:GetLabelObject():SetLabel(announce)
e:GetHandler():SetHint(CHINT_NUMBER,announce)
......
......@@ -57,7 +57,7 @@ function c1781310.activate(e,tp,eg,ep,ev,re,r,rp)
off=off+1
end
if off==1 then return end
local op=Duel.SelectOption(tp,unpack(ops))
local op=Duel.SelectOption(tp,table.unpack(ops))
if opval[op]==1 then
local g=Duel.GetMatchingGroup(c1781310.dfilter1,tp,0,LOCATION_MZONE,nil)
Duel.Destroy(g,REASON_EFFECT)
......
......@@ -48,7 +48,7 @@ function c26082117.tg(e,tp,eg,ep,ev,re,r,rp,chk)
end
t[p]=nil
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(26082117,1))
e:SetLabel(Duel.AnnounceNumber(tp,unpack(t)))
e:SetLabel(Duel.AnnounceNumber(tp,table.unpack(t)))
end
function c26082117.op(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
......
......@@ -42,40 +42,27 @@ function c31828916.filter(c,atk,att,e,tp)
and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c31828916.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return false end
local dg=eg:Filter(c31828916.cfilter,nil,e:GetLabelObject():GetLabelObject(),e,tp)
if dg:GetCount()==1 then
e:SetLabel(1)
e:SetLabelObject(dg:GetFirst())
return true
elseif dg:GetCount()==2 then
e:SetLabel(2)
return true
end
return false
end
if e:GetLabel()==2 then
eg:GetFirst():CreateEffectRelation(e)
eg:GetNext():CreateEffectRelation(e)
else
e:GetLabelObject():CreateEffectRelation(e)
end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and eg:IsExists(c31828916.cfilter,1,nil,e:GetLabelObject():GetLabelObject(),e,tp) end
Duel.SetTargetCard(eg)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function c31828916.cfilter2(c,e,tp)
return c:IsRace(RACE_MACHINE) and c:IsControler(tp) and c:IsRelateToEffect(e)
and Duel.IsExistingMatchingCard(c31828916.filter,tp,LOCATION_DECK,0,1,nil,c:GetAttack(),c:GetAttribute(),e,tp)
end
function c31828916.operation(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
if e:GetLabel()==1 then
local tc=e:GetLabelObject()
if not tc:IsRelateToEffect(e) then return end
local sg=eg:Filter(c31828916.cfilter2,nil,e,tp)
if sg:GetCount()==1 then
local tc=sg:GetFirst()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c31828916.filter,tp,LOCATION_DECK,0,1,1,nil,tc:GetAttack(),tc:GetAttribute(),e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
else
local sg=eg:Filter(Card.IsRelateToEffect,nil,e)
local tc=sg:GetFirst()
if not tc then return end
local atk=tc:GetAttack()
......
......@@ -18,12 +18,12 @@ function c3280747.activate(e,tp,eg,ep,ev,re,r,rp)
local i=1
local p=1
for i=1,6 do t[i]=i end
local a1=Duel.AnnounceNumber(tp,unpack(t))
local a1=Duel.AnnounceNumber(tp,table.unpack(t))
for i=1,6 do
if a1~=i then t[p]=i p=p+1 end
end
t[p]=nil
local a2=Duel.AnnounceNumber(tp,unpack(t))
local a2=Duel.AnnounceNumber(tp,table.unpack(t))
local dc=Duel.TossDice(1-tp,1)
if dc==a1 or dc==a2 then Duel.Draw(tp,dc,REASON_EFFECT)
else Duel.DiscardDeck(tp,dc,REASON_EFFECT) end
......
......@@ -23,7 +23,7 @@ function c34149830.condition(e,tp,eg,ep,ev,re,r,rp)
tc=Duel.GetAttackTarget()
bc=Duel.GetAttacker()
end
return tc and not tc:IsHasEffect(EFFECT_INDESTRUCTABLE_BATTLE)
return tc and bc and not tc:IsHasEffect(EFFECT_INDESTRUCTABLE_BATTLE)
and ((tc:IsDefence() and tc:GetDefence()<bc:GetAttack()) or (tc:IsAttack() and tc:GetAttack()<=bc:GetAttack()))
end
function c34149830.spfilter(c,e,tp)
......
......@@ -27,7 +27,7 @@ function c35514096.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if t1 then m[ct]=aux.Stringid(35514096,1) n[ct]=1 ct=ct+1 end
if t2 then m[ct]=aux.Stringid(35514096,2) n[ct]=2 ct=ct+1 end
if t3 then m[ct]=aux.Stringid(35514096,3) n[ct]=3 ct=ct+1 end
local sp=Duel.SelectOption(tp,unpack(m))
local sp=Duel.SelectOption(tp,table.unpack(m))
op=n[sp+1]
end
e:SetLabel(op)
......
......@@ -46,7 +46,7 @@ function c6061630.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
end
lvt[pc]=nil
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(6061630,1))
local lv=Duel.AnnounceNumber(tp,unpack(lvt))
local lv=Duel.AnnounceNumber(tp,table.unpack(lvt))
e:GetHandler():RemoveCounter(tp,0x3001,lv,REASON_COST)
e:SetLabel(lv)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_GRAVE)
......
......@@ -29,7 +29,7 @@ function c67196946.cost(e,tp,eg,ep,ev,re,r,rp,chk)
l=l+1
end
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(67196946,0))
local announce=Duel.AnnounceNumber(tp,unpack(t))
local announce=Duel.AnnounceNumber(tp,table.unpack(t))
Duel.PayLPCost(tp,announce)
e:SetLabel(announce/500)
end
......
......@@ -45,7 +45,7 @@ function c6733059.cost1(e,tp,eg,ep,ev,re,r,rp,chk)
end
lvt[pc]=nil
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(6733059,2))
local lv=Duel.AnnounceNumber(tp,unpack(lvt))
local lv=Duel.AnnounceNumber(tp,table.unpack(lvt))
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local rg=cg:Select(tp,lv,lv,nil)
Duel.Remove(rg,POS_FACEUP,REASON_COST)
......@@ -75,7 +75,7 @@ function c6733059.cost2(e,tp,eg,ep,ev,re,r,rp,chk)
end
lvt[pc]=nil
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(6733059,2))
local lv=Duel.AnnounceNumber(tp,unpack(lvt))
local lv=Duel.AnnounceNumber(tp,table.unpack(lvt))
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local rg=cg:Select(tp,lv,lv,nil)
Duel.Remove(rg,POS_FACEUP,REASON_COST)
......
......@@ -12,7 +12,7 @@ function c67445676.initial_effect(c)
c:RegisterEffect(e1)
end
function c67445676.spcon(e,tp,eg,ep,ev,re,r,rp)
return re:GetHandler():IsCode(21051977)
return e:GetHandler():IsReason(REASON_EFFECT) and re and re:GetHandler():IsCode(21051977)
end
function c67445676.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
......
......@@ -33,7 +33,7 @@ function c81426505.destg(e,tp,eg,ep,ev,re,r,rp,chk)
if Duel.IsExistingMatchingCard(c81426505.filter2,tp,0,LOCATION_ONFIELD,1,nil) then t[p]=aux.Stringid(81426505,1) p=p+1 end
if Duel.IsExistingMatchingCard(c81426505.filter3,tp,0,LOCATION_SZONE,1,nil) then t[p]=aux.Stringid(81426505,2) p=p+1 end
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(81426505,3))
local sel=Duel.SelectOption(tp,unpack(t))+1
local sel=Duel.SelectOption(tp,table.unpack(t))+1
local opt=t[sel]-aux.Stringid(81426505,0)
local sg=nil
if opt==0 then sg=Duel.GetMatchingGroup(c81426505.filter1,tp,0,LOCATION_MZONE,nil)
......
......@@ -20,25 +20,29 @@ function c83584898.initial_effect(c)
e3:SetCode(EFFECT_SET_DEFENCE)
e3:SetValue(100)
c:RegisterEffect(e3)
--equip limit
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetCode(EFFECT_EQUIP_LIMIT)
e4:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e4:SetValue(1)
e4:SetType(EFFECT_TYPE_EQUIP)
e4:SetCode(EFFECT_CANNOT_ATTACK)
c:RegisterEffect(e4)
--damage
--equip limit
local e5=Effect.CreateEffect(c)
e5:SetDescription(aux.Stringid(83584898,0))
e5:SetCategory(CATEGORY_DAMAGE)
e5:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e5:SetCode(EVENT_PHASE+PHASE_STANDBY)
e5:SetRange(LOCATION_SZONE)
e5:SetCountLimit(1)
e5:SetCondition(c83584898.damcon)
e5:SetTarget(c83584898.damtg)
e5:SetOperation(c83584898.damop)
e5:SetType(EFFECT_TYPE_SINGLE)
e5:SetCode(EFFECT_EQUIP_LIMIT)
e5:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e5:SetValue(1)
c:RegisterEffect(e5)
--damage
local e6=Effect.CreateEffect(c)
e6:SetDescription(aux.Stringid(83584898,0))
e6:SetCategory(CATEGORY_DAMAGE)
e6:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e6:SetCode(EVENT_PHASE+PHASE_STANDBY)
e6:SetRange(LOCATION_SZONE)
e6:SetCountLimit(1)
e6:SetCondition(c83584898.damcon)
e6:SetTarget(c83584898.damtg)
e6:SetOperation(c83584898.damop)
c:RegisterEffect(e6)
end
function c83584898.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsFaceup() end
......
......@@ -44,7 +44,7 @@ function c84389640.cost(e,tp,eg,ep,ev,re,r,rp,chk)
t[i]=i*100
end
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(84389640,1))
local pay=Duel.AnnounceNumber(tp,unpack(t))
local pay=Duel.AnnounceNumber(tp,table.unpack(t))
Duel.PayLPCost(tp,pay)
e:SetLabel(-pay)
e:GetHandler():RegisterFlagEffect(84389640,RESET_PHASE+RESET_DAMAGE_CAL,0,1)
......
--YZ-キャタピラー·ドラゴン
function c91998120.initial_effect(c)
c:EnableReviveLimit()
--spsummon condition
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_SPSUMMON_CONDITION)
e1:SetValue(c91998120.splimit)
c:RegisterEffect(e1)
--special summon rule
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_SPSUMMON_PROC)
e2:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e2:SetRange(LOCATION_EXTRA)
e2:SetCondition(c91998120.spcon)
e2:SetOperation(c91998120.spop)
c:RegisterEffect(e2)
--destroy
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(91998120,0))
e3:SetCategory(CATEGORY_DESTROY)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetRange(LOCATION_MZONE)
e3:SetCost(c91998120.descost)
e3:SetTarget(c91998120.destg)
e3:SetOperation(c91998120.desop)
c:RegisterEffect(e3)
end
c91998120.material_count=3
c91998120.material={62651957,65622692,64500000}
function c91998120.splimit(e,se,sp,st)
return not e:GetHandler():IsLocation(LOCATION_EXTRA+LOCATION_GRAVE)
end
function c91998120.spfilter(c,code)
return c:IsCode(code) and c:IsAbleToRemoveAsCost()
end
function c91998120.spcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if ft<-2 then return false end
local g1=Duel.GetMatchingGroup(c91998120.spfilter,tp,LOCATION_ONFIELD,0,nil,62651957)
local g2=Duel.GetMatchingGroup(c91998120.spfilter,tp,LOCATION_ONFIELD,0,nil,65622692)
local g3=Duel.GetMatchingGroup(c91998120.spfilter,tp,LOCATION_ONFIELD,0,nil,64500000)
if g1:GetCount()==0 or g2:GetCount()==0 or g3:GetCount()==0 then return false end
if ft>0 then return true end
local f1=g1:FilterCount(Card.IsLocation,nil,LOCATION_MZONE)>0 and 1 or 0
local f2=g2:FilterCount(Card.IsLocation,nil,LOCATION_MZONE)>0 and 1 or 0
local f3=g3:FilterCount(Card.IsLocation,nil,LOCATION_MZONE)>0 and 1 or 0
if ft==-2 then return f1+f2+f3==3
elseif ft==-1 then return f1+f2+f3>=2
else return f1+f2+f3>=1 end
end
function c91998120.spop(e,tp,eg,ep,ev,re,r,rp,c)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
local g1=Duel.GetMatchingGroup(c91998120.spfilter,tp,LOCATION_ONFIELD,0,nil,62651957)
local g2=Duel.GetMatchingGroup(c91998120.spfilter,tp,LOCATION_ONFIELD,0,nil,65622692)
local g3=Duel.GetMatchingGroup(c91998120.spfilter,tp,LOCATION_ONFIELD,0,nil,64500000)
g1:Merge(g2)
g1:Merge(g3)
local g=Group.CreateGroup()
local tc=nil
for i=1,3 do
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
if ft<=0 then
tc=g1:FilterSelect(tp,Card.IsLocation,1,1,nil,LOCATION_MZONE):GetFirst()
else
tc=g1:Select(tp,1,1,nil):GetFirst()
end
g:AddCard(tc)
g1:Remove(Card.IsCode,nil,tc:GetCode())
ft=ft+1
end
Duel.Remove(g,POS_FACEUP,REASON_COST)
end
function c91998120.descost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,1,nil) end
Duel.DiscardHand(tp,Card.IsDiscardable,1,1,REASON_COST+REASON_DISCARD)
end
function c91998120.filter(c)
return c:IsDestructable()
end
function c91998120.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and chkc:IsControler(1-tp) and c91998120.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c91998120.filter,tp,0,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,c91998120.filter,tp,0,LOCATION_ONFIELD,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0)
end
function c91998120.desop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.Destroy(tc,REASON_EFFECT)
end
end
--YZ-キャタピラー·ドラゴン
function c91998121.initial_effect(c)
c:EnableReviveLimit()
--spsummon condition
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_SPSUMMON_CONDITION)
e1:SetValue(c91998121.splimit)
c:RegisterEffect(e1)
--special summon rule
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_SPSUMMON_PROC)
e2:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e2:SetRange(LOCATION_EXTRA)
e2:SetCondition(c91998121.spcon)
e2:SetOperation(c91998121.spop)
c:RegisterEffect(e2)
--destroy
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(91998121,0))
e3:SetCategory(CATEGORY_DESTROY)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetRange(LOCATION_MZONE)
e3:SetCost(c91998121.descost)
e3:SetTarget(c91998121.destg)
e3:SetOperation(c91998121.desop)
c:RegisterEffect(e3)
end
c91998121.material_count=3
c91998121.material={62651957,65622692,64500000}
function c91998121.splimit(e,se,sp,st)
return not e:GetHandler():IsLocation(LOCATION_EXTRA+LOCATION_GRAVE)
end
function c91998121.spfilter(c,code)
return c:IsCode(code) and c:IsAbleToRemoveAsCost()
end
function c91998121.spcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if ft<-2 then return false end
local g1=Duel.GetMatchingGroup(c91998121.spfilter,tp,LOCATION_ONFIELD,0,nil,62651957)
local g2=Duel.GetMatchingGroup(c91998121.spfilter,tp,LOCATION_ONFIELD,0,nil,65622692)
local g3=Duel.GetMatchingGroup(c91998121.spfilter,tp,LOCATION_ONFIELD,0,nil,64500000)
if g1:GetCount()==0 or g2:GetCount()==0 or g3:GetCount()==0 then return false end
if ft>0 then return true end
local f1=g1:FilterCount(Card.IsLocation,nil,LOCATION_MZONE)>0 and 1 or 0
local f2=g2:FilterCount(Card.IsLocation,nil,LOCATION_MZONE)>0 and 1 or 0
local f3=g3:FilterCount(Card.IsLocation,nil,LOCATION_MZONE)>0 and 1 or 0
if ft==-2 then return f1+f2+f3==3
elseif ft==-1 then return f1+f2+f3>=2
else return f1+f2+f3>=1 end
end
function c91998121.spop(e,tp,eg,ep,ev,re,r,rp,c)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
local g1=Duel.GetMatchingGroup(c91998121.spfilter,tp,LOCATION_ONFIELD,0,nil,62651957)
local g2=Duel.GetMatchingGroup(c91998121.spfilter,tp,LOCATION_ONFIELD,0,nil,65622692)
local g3=Duel.GetMatchingGroup(c91998121.spfilter,tp,LOCATION_ONFIELD,0,nil,64500000)
g1:Merge(g2)
g1:Merge(g3)
local g=Group.CreateGroup()
local tc=nil
for i=1,3 do
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
if ft<=0 then
tc=g1:FilterSelect(tp,Card.IsLocation,1,1,nil,LOCATION_MZONE):GetFirst()
else
tc=g1:Select(tp,1,1,nil):GetFirst()
end
g:AddCard(tc)
g1:Remove(Card.IsCode,nil,tc:GetCode())
ft=ft+1
end
Duel.Remove(g,POS_FACEUP,REASON_COST)
end
function c91998121.descost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,1,nil) end
Duel.DiscardHand(tp,Card.IsDiscardable,1,1,REASON_COST+REASON_DISCARD)
end
function c91998121.filter(c)
return c:IsDestructable()
end
function c91998121.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and chkc:IsControler(1-tp) and c91998121.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c91998121.filter,tp,0,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,c91998121.filter,tp,0,LOCATION_ONFIELD,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0)
end
function c91998121.desop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.Destroy(tc,REASON_EFFECT)
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