Commit 0d3c7096 authored by VanillaSalt's avatar VanillaSalt

fix

parent d8bc74c8
......@@ -52,6 +52,7 @@ function c387282.lvop(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CHANGE_LEVEL)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetValue(lv)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
c:RegisterEffect(e1)
......
......@@ -8,6 +8,7 @@ function c58600555.initial_effect(c)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e1:SetRange(LOCATION_EXTRA)
e1:SetCondition(c58600555.xyzcon)
e1:SetTarget(c58600555.xyztg)
e1:SetOperation(c58600555.xyzop)
e1:SetValue(SUMMON_TYPE_XYZ)
c:RegisterEffect(e1)
......@@ -40,44 +41,83 @@ function c58600555.ovfilter(c,tp,xyzc)
return c:IsFaceup() and c:IsType(TYPE_XYZ) and (c:GetRank()==3 or c:GetRank()==4) and c:IsRace(RACE_INSECT) and c:IsCanBeXyzMaterial(xyzc)
and c:CheckRemoveOverlayCard(tp,2,REASON_COST)
end
function c58600555.ovfilter2(c)
return c:IsFaceup() and c:GetLevel()==5 and c:IsRace(RACE_INSECT) and c:IsAttribute(ATTRIBUTE_LIGHT)
function c58600555.mfilter(c)
return c:IsRace(RACE_INSECT) and c:IsAttribute(ATTRIBUTE_LIGHT)
end
function c58600555.xyzcon(e,c,og)
function c58600555.xyzcon(e,c,og,min,max)
if c==nil then return true end
local tp=c:GetControler()
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
local ct=-ft
if 2<=ct then return false end
if ct<1 and not og and Duel.IsExistingMatchingCard(c58600555.ovfilter,tp,LOCATION_MZONE,0,1,nil,tp,c) then
local mg=nil
if og then
mg=og
else
mg=Duel.GetFieldGroup(tp,LOCATION_MZONE,0)
end
if ct<1 and (not min or min<=1) and mg:IsExists(c58600555.ovfilter,1,nil,tp,c) then
return true
end
return Duel.CheckXyzMaterial(c,c58600555.ovfilter2,5,2,2,og)
local minc=2
local maxc=5
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 ct<minc and Duel.CheckXyzMaterial(c,c58600555.mfilter,5,minc,maxc,og)
end
function c58600555.xyzop(e,tp,eg,ep,ev,re,r,rp,c,og)
if og then
c:SetMaterial(og)
Duel.Overlay(c,og)
else
function c58600555.xyztg(e,tp,eg,ep,ev,re,r,rp,chk,c,og,min,max)
if og and not min then
return true
end
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
local ct=-ft
local b1=Duel.CheckXyzMaterial(c,c58600555.ovfilter2,5,2,2,og)
local b2=ct<1 and Duel.IsExistingMatchingCard(c58600555.ovfilter,tp,LOCATION_MZONE,0,1,nil,tp,c)
local minc=2
local maxc=5
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.GetFieldGroup(tp,LOCATION_MZONE,0)
end
local b1=ct<minc and Duel.CheckXyzMaterial(c,c58600555.mfilter,5,minc,maxc,og)
local b2=ct<1 and (not min or min<=1) and mg:IsExists(c58600555.ovfilter,1,nil,tp,c)
local g=nil
if b2 and (not b1 or Duel.SelectYesNo(tp,aux.Stringid(58600555,2))) then
e:SetLabel(1)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL)
local mg=Duel.SelectMatchingCard(tp,c58600555.ovfilter,tp,LOCATION_MZONE,0,1,1,nil,tp,c)
mg:GetFirst():RemoveOverlayCard(tp,2,2,REASON_COST)
g=mg:FilterSelect(tp,c58600555.ovfilter,1,1,nil,tp,c)
g:GetFirst():RemoveOverlayCard(tp,2,2,REASON_COST)
else
e:SetLabel(0)
g=Duel.SelectXyzMaterial(tp,c,c58600555.mfilter,5,minc,maxc,og)
end
if g then
g:KeepAlive()
e:SetLabelObject(g)
return true
else return false end
end
function c58600555.xyzop(e,tp,eg,ep,ev,re,r,rp,c,og,min,max)
if og and not min then
c:SetMaterial(og)
Duel.Overlay(c,og)
else
local mg=e:GetLabelObject()
if e:GetLabel()==1 then
local mg2=mg:GetFirst():GetOverlayGroup()
if mg2:GetCount()~=0 then
Duel.Overlay(c,mg2)
end
end
c:SetMaterial(mg)
Duel.Overlay(c,mg)
else
local mg=Duel.SelectXyzMaterial(tp,c,c58600555.ovfilter2,5,2,2)
c:SetMaterial(mg)
Duel.Overlay(c,mg)
end
mg:DeleteGroup()
end
end
function c58600555.tdcost(e,tp,eg,ep,ev,re,r,rp,chk)
......
......@@ -26,7 +26,7 @@ function c59432181.activate(e,tp,eg,ep,ev,re,r,rp)
local cg=Duel.SelectMatchingCard(tp,c59432181.filter,tp,LOCATION_EXTRA,0,1,1,nil)
if cg:GetCount()==0 then return end
Duel.ConfirmCards(1-tp,cg)
local code1,code2=cg:GetFirst():GetCode()
local code1,code2=cg:GetFirst():GetOriginalCodeRule()
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetDescription(aux.Stringid(59432181,0))
e1:SetType(EFFECT_TYPE_SINGLE)
......
......@@ -22,7 +22,7 @@ function c60681103.initial_effect(c)
c:RegisterEffect(e2)
end
function c60681103.rmcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPreviousLocation(LOCATION_GRAVE)
return e:GetHandler():GetSummonLocation()==LOCATION_GRAVE
end
function c60681103.rmfilter(c)
return c:IsType(TYPE_MONSTER) and c:IsAbleToRemove()
......
......@@ -39,13 +39,13 @@ function c69868555.initial_effect(c)
c:RegisterEffect(e4)
end
function c69868555.cfilter(c)
return c:IsFaceup() and not c:IsPreviousLocation(LOCATION_GRAVE)
return c:GetSummonLocation()~=LOCATION_GRAVE
end
function c69868555.dfilter(c)
return c:IsFaceup() and c:IsRace(RACE_DRAGON) and (c:GetLevel()==7 or c:GetLevel()==8)
function c69868555.dfilter(c,eg)
return c:IsFaceup() and c:IsRace(RACE_DRAGON) and (c:GetLevel()==7 or c:GetLevel()==8) and not eg:IsContains(c)
end
function c69868555.discon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c69868555.cfilter,1,nil) and Duel.IsExistingMatchingCard(c69868555.dfilter,tp,LOCATION_MZONE,0,1,nil)
return eg:IsExists(c69868555.cfilter,1,nil) and Duel.IsExistingMatchingCard(c69868555.dfilter,tp,LOCATION_MZONE,0,1,nil,eg)
end
function c69868555.distg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
......@@ -109,9 +109,9 @@ function c69868555.thcostfilter(c)
and (c:IsLocation(LOCATION_HAND) or c:IsFaceup())
end
function c69868555.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c69868555.thcostfilter,tp,LOCATION_ONFIELD+LOCATION_HAND,0,1,e:GetHandler()) end
if chk==0 then return Duel.IsExistingMatchingCard(c69868555.thcostfilter,tp,LOCATION_MZONE+LOCATION_HAND,0,1,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c69868555.thcostfilter,tp,LOCATION_ONFIELD+LOCATION_HAND,0,1,1,e:GetHandler())
local g=Duel.SelectMatchingCard(tp,c69868555.thcostfilter,tp,LOCATION_MZONE+LOCATION_HAND,0,1,1,e:GetHandler())
Duel.SendtoGrave(g,REASON_COST)
end
function c69868555.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
......
--電子光虫-ライノセバス
function c85004150.initial_effect(c)
--xyz summon
aux.AddXyzProcedure(c,c85004150.mfilter,7,2,nil,nil,5,nil)
c:EnableReviveLimit()
--special summon
--xyz summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(85004150,0))
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e1:SetRange(LOCATION_EXTRA)
e1:SetCondition(c85004150.xyzcon)
e1:SetTarget(c85004150.xyztg)
e1:SetOperation(c85004150.xyzop)
e1:SetValue(SUMMON_TYPE_XYZ)
c:RegisterEffect(e1)
......@@ -32,24 +30,89 @@ function c85004150.initial_effect(c)
e3:SetCode(EFFECT_PIERCE)
c:RegisterEffect(e3)
end
c85004150.xyz_count=2
function c85004150.ovfilter(c,tp,xyzc)
return c:IsFaceup() and c:IsType(TYPE_XYZ) and (c:GetRank()==5 or c:GetRank()==6) and c:IsRace(RACE_INSECT) and c:IsCanBeXyzMaterial(xyzc)
and c:CheckRemoveOverlayCard(tp,2,REASON_COST)
end
function c85004150.mfilter(c)
return c:IsRace(RACE_INSECT) and c:IsAttribute(ATTRIBUTE_LIGHT)
end
function c85004150.mfilter2(c,tp,xyzc)
return c:IsFaceup() and c:IsType(TYPE_XYZ) and (c:GetRank()==5 or c:GetRank()==6) and c:IsRace(RACE_INSECT) and c:IsCanBeXyzMaterial(xyzc)
and c:CheckRemoveOverlayCard(tp,2,REASON_EFFECT)
end
function c85004150.xyzcon(e,c)
function c85004150.xyzcon(e,c,og,min,max)
if c==nil then return true end
local tp=c:GetControler()
return Duel.IsExistingMatchingCard(c85004150.mfilter2,tp,LOCATION_MZONE,0,1,nil,tp,c)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
local ct=-ft
local mg=nil
if og then
mg=og
else
mg=Duel.GetFieldGroup(tp,LOCATION_MZONE,0)
end
if ct<1 and (not min or min<=1) and mg:IsExists(c85004150.ovfilter,1,nil,tp,c) then
return true
end
local minc=2
local maxc=5
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 ct<minc and Duel.CheckXyzMaterial(c,c85004150.mfilter,7,minc,maxc,og)
end
function c85004150.xyzop(e,tp,eg,ep,ev,re,r,rp,c)
function c85004150.xyztg(e,tp,eg,ep,ev,re,r,rp,chk,c,og,min,max)
if og and not min then
return true
end
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
local ct=-ft
local minc=2
local maxc=5
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.GetFieldGroup(tp,LOCATION_MZONE,0)
end
local b1=ct<minc and Duel.CheckXyzMaterial(c,c85004150.mfilter,7,minc,maxc,og)
local b2=ct<1 and (not min or min<=1) and mg:IsExists(c85004150.ovfilter,1,nil,tp,c)
local g=nil
if b2 and (not b1 or Duel.SelectYesNo(tp,aux.Stringid(85004150,2))) then
e:SetLabel(1)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL)
local g=Duel.SelectMatchingCard(tp,c85004150.mfilter2,tp,LOCATION_MZONE,0,1,1,nil,tp,c)
g:GetFirst():RemoveOverlayCard(tp,2,2,REASON_EFFECT)
c:SetMaterial(g)
Duel.Overlay(c,g)
g=mg:FilterSelect(tp,c85004150.ovfilter,1,1,nil,tp,c)
g:GetFirst():RemoveOverlayCard(tp,2,2,REASON_COST)
else
e:SetLabel(0)
g=Duel.SelectXyzMaterial(tp,c,c85004150.mfilter,7,minc,maxc,og)
end
if g then
g:KeepAlive()
e:SetLabelObject(g)
return true
else return false end
end
function c85004150.xyzop(e,tp,eg,ep,ev,re,r,rp,c,og,min,max)
if og and not min then
c:SetMaterial(og)
Duel.Overlay(c,og)
else
local mg=e:GetLabelObject()
if e:GetLabel()==1 then
local mg2=mg:GetFirst():GetOverlayGroup()
if mg2:GetCount()~=0 then
Duel.Overlay(c,mg2)
end
end
c:SetMaterial(mg)
Duel.Overlay(c,mg)
mg:DeleteGroup()
end
end
function c85004150.desfilter(c)
return c:IsFaceup() and c:IsDestructable()
......
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