Commit f1bac301 authored by POLYMER's avatar POLYMER

fix test

parent 258f95b6
No preview for this file type
QutryZcd = {}
function QutryZcd.AddXyzProcedure(c,f,lv,ct,alterf,maxct,op)
local desc=aux.Stringid(9910100,0)
local e1=Effect.CreateEffect(c)
e1:SetDescription(1165)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e1:SetRange(LOCATION_EXTRA)
if not maxct then maxct=ct end
e1:SetCondition(QutryZcd.XyzCondition(f,lv,ct,maxct,alterf,desc,op))
e1:SetTarget(QutryZcd.XyzTarget(f,lv,ct,maxct,alterf,desc,op))
e1:SetOperation(QutryZcd.XyzOperation(f,lv,ct,maxct,alterf,desc,op))
e1:SetValue(SUMMON_TYPE_XYZ)
c:RegisterEffect(e1)
end
function QutryZcd.XyzCondition(f,lv,minc,maxc,alterf,desc,op)
return function(e,c,og,min,max)
if c==nil then return true end
if c:IsType(TYPE_PENDULUM) and c:IsFaceup() then return false end
local tp=c:GetControler()
local mg=nil
if og then
mg=og
else
mg=Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_ONFIELD,0,nil)
end
if (not min or min<=1) and mg:IsExists(QutryZcd.XyzAlterFilter,minc,nil,alterf,c,e,tp,op,lv) then
local ssg=mg:Filter(QutryZcd.XyzAlterFilter,nil,alterf,c,e,tp,op,lv)
if ssg:IsExists(QutryZcd.MFilter1,1,nil) and ssg:IsExists(QutryZcd.MFilter2,1,nil,c,tp)
and ssg:IsExists(Card.IsLocation,1,nil,LOCATION_SZONE) then return true end
end
local minc=minc
local maxc=maxc
if min then
if min>minc then minc=min end
if max<maxc then maxc=max end
if minc>maxc then return false end
end
return Duel.CheckXyzMaterial(c,f,lv,minc,maxc,og)
end
end
function QutryZcd.XyzTarget(f,lv,minc,maxc,alterf,desc,op)
return function(e,tp,eg,ep,ev,re,r,rp,chk,c,og,min,max)
if og and not min then
return true
end
local minc=minc
local maxc=maxc
if min then
if min>minc then minc=min end
if max<maxc then maxc=max end
end
local mg=nil
if og then
mg=og
else
mg=Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_ONFIELD,0,nil)
end
local b1=Duel.CheckXyzMaterial(c,f,lv,minc,maxc,og)
local b2=nil
local ssg=nil
if (not min or min<=1) and mg:IsExists(QutryZcd.XyzAlterFilter,minc,nil,alterf,c,e,tp,op,lv) then
ssg=mg:Filter(QutryZcd.XyzAlterFilter,nil,alterf,c,e,tp,op,lv)
b2=ssg:IsExists(QutryZcd.MFilter1,1,nil) and ssg:IsExists(QutryZcd.MFilter2,1,nil,c,tp)
and ssg:IsExists(Card.IsLocation,1,nil,LOCATION_SZONE)
end
local g=Group.CreateGroup()
if b2 and (not b1 or Duel.SelectYesNo(tp,desc)) then
e:SetLabel(1)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL)
tsg=ssg:FilterSelect(tp,QutryZcd.MFilter1,1,1,nil)
local tc1=tsg:GetFirst()
g:AddCard(tc1)
ssg:RemoveCard(tc1)
local flagct=1
if not QutryZcd.MFilter2(tc1,c,tp) then
tsg=ssg:FilterSelect(tp,QutryZcd.MFilter2,1,1,nil,c,tp)
local tc2=tsg:GetFirst()
g:AddCard(tc2)
ssg:RemoveCard(tc2)
flagct=2
end
local g2=ssg:FilterSelect(tp,QutryZcd.XyzAlterFilter,minc-flagct,maxc-flagct,nil,alterf,c,e,tp,op,lv)
g:Merge(g2)
if op then op(e,tp,1,g:GetFirst()) end
else
e:SetLabel(0)
g=Duel.SelectXyzMaterial(tp,c,f,lv,minc,maxc,og)
end
if g then
g:KeepAlive()
e:SetLabelObject(g)
return true
else return false end
end
end
function QutryZcd.XyzOperation(f,lv,minc,maxc,alterf,desc,op)
return function(e,tp,eg,ep,ev,re,r,rp,c,og,min,max)
if og and not min then
local sg=Group.CreateGroup()
local tc=og:GetFirst()
while tc do
local sg1=tc:GetOverlayGroup()
sg:Merge(sg1)
tc=og:GetNext()
end
Duel.SendtoGrave(sg,REASON_RULE)
c:SetMaterial(og)
Duel.Overlay(c,og)
else
local mg=e:GetLabelObject()
local sg=Group.CreateGroup()
local tc=mg:GetFirst()
while tc do
local sg1=tc:GetOverlayGroup()
sg:Merge(sg1)
tc=mg:GetNext()
end
Duel.SendtoGrave(sg,REASON_RULE)
c:SetMaterial(mg)
Duel.Overlay(c,mg)
mg:DeleteGroup()
end
end
end
function QutryZcd.XyzAlterFilter(c,alterf,xyzc,e,tp,op,lv)
return alterf(c)
and c:IsCanBeXyzMaterial(xyzc)
and Auxiliary.MustMaterialCheck(c,tp,EFFECT_MUST_BE_XMATERIAL) and (not op or op(e,tp,0,c))
and c:IsXyzLevel(xyzc,lv)
end
function QutryZcd.MFilter1(c)
return c:IsType(TYPE_MONSTER) and c:IsSetCard(0x9958)
end
function QutryZcd.MFilter2(c,xyzc,tp)
return Duel.GetLocationCountFromEx(tp,tp,c,xyzc)>0
end
...@@ -23,7 +23,7 @@ function c9910101.sptg(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -23,7 +23,7 @@ function c9910101.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
and c:IsAbleToDeck() end and c:IsAbleToDeck() end
end end
function c9910101.thfilter(c) function c9910101.thfilter(c)
return c:IsSetCard(0x952) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand() and not c:IsCode(9910101) return c:IsSetCard(0x9958) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand() and not c:IsCode(9910101)
end end
function c9910101.spop(e,tp,eg,ep,ev,re,r,rp) function c9910101.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
...@@ -31,7 +31,7 @@ function c9910101.spop(e,tp,eg,ep,ev,re,r,rp) ...@@ -31,7 +31,7 @@ function c9910101.spop(e,tp,eg,ep,ev,re,r,rp)
Duel.ConfirmDecktop(tp,1) Duel.ConfirmDecktop(tp,1)
local g=Duel.GetDecktopGroup(tp,1) local g=Duel.GetDecktopGroup(tp,1)
local tc=g:GetFirst() local tc=g:GetFirst()
if tc:IsSetCard(0x952) and tc:IsType(TYPE_MONSTER) then if tc:IsSetCard(0x9958) and tc:IsType(TYPE_MONSTER) then
if c:IsRelateToEffect(e) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)~=0 if c:IsRelateToEffect(e) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)~=0
and not tc:IsForbidden() then and not tc:IsForbidden() then
Duel.DisableShuffleCheck() Duel.DisableShuffleCheck()
......
...@@ -42,7 +42,7 @@ function c9910103.spop(e,tp,eg,ep,ev,re,r,rp) ...@@ -42,7 +42,7 @@ function c9910103.spop(e,tp,eg,ep,ev,re,r,rp)
Duel.ConfirmDecktop(tp,1) Duel.ConfirmDecktop(tp,1)
local g=Duel.GetDecktopGroup(tp,1) local g=Duel.GetDecktopGroup(tp,1)
local tc=g:GetFirst() local tc=g:GetFirst()
if tc:IsSetCard(0x952) and tc:IsType(TYPE_MONSTER) then if tc:IsSetCard(0x9958) and tc:IsType(TYPE_MONSTER) then
if c:IsRelateToEffect(e) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)~=0 if c:IsRelateToEffect(e) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)~=0
and not tc:IsForbidden() then and not tc:IsForbidden() then
Duel.DisableShuffleCheck() Duel.DisableShuffleCheck()
......
--战车道装甲·四号坦克 --战车道装甲·四号坦克
require("expansions/script/c9910106") Duel.LoadScript("c9910100.lua")
function c9910105.initial_effect(c) function c9910105.initial_effect(c)
--xyz summon --xyz summon
Zcd.AddXyzProcedure(c,nil,4,2,c9910105.xyzfilter,aux.Stringid(9910105,0),99) QutryZcd.AddXyzProcedure(c,nil,4,2,c9910105.xyzfilter,99)
c:EnableReviveLimit() c:EnableReviveLimit()
--destroy & spsummon --destroy & spsummon
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
...@@ -17,14 +17,14 @@ function c9910105.initial_effect(c) ...@@ -17,14 +17,14 @@ function c9910105.initial_effect(c)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
function c9910105.xyzfilter(c) function c9910105.xyzfilter(c)
return (c:IsType(TYPE_MONSTER) or (c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsSetCard(0x952) and c:IsFaceup())) return (c:IsType(TYPE_MONSTER) or (c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsSetCard(0x9958) and c:IsFaceup()))
end end
function c9910105.cost(e,tp,eg,ep,ev,re,r,rp,chk) function c9910105.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST) e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST)
end end
function c9910105.spfilter(c,e,tp) function c9910105.spfilter(c,e,tp)
return c:IsSetCard(0x952) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) return c:IsSetCard(0x9958) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end end
function c9910105.target(e,tp,eg,ep,ev,re,r,rp,chk) function c9910105.target(e,tp,eg,ep,ev,re,r,rp,chk)
local ct=0 local ct=0
......
...@@ -174,7 +174,6 @@ ...@@ -174,7 +174,6 @@
!setname 0xa950 桃绯 !setname 0xa950 桃绯
!setname 0xc950 远古造物 !setname 0xc950 远古造物
!counter 0x1950 韶光指示物 !counter 0x1950 韶光指示物
!setname 0x952 战车道
!setname 0x953 幽鬼 !setname 0x953 幽鬼
!counter 0x953 复仇指示物 !counter 0x953 复仇指示物
!setname 0x3954 匪魔 !setname 0x3954 匪魔
...@@ -199,6 +198,7 @@ ...@@ -199,6 +198,7 @@
!setname 0x3958 溯雪 !setname 0x3958 溯雪
!setname 0x5958 浩瀚生态 !setname 0x5958 浩瀚生态
!setname 0x6958 浩瀚开拓者 !setname 0x6958 浩瀚开拓者
!setname 0x9958 战车道
#篁楠 10 0x200-0x20f #篁楠 10 0x200-0x20f
!setname 0xc204 Madoka !setname 0xc204 Madoka
......
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