Commit 16a98132 authored by VanillaSalt's avatar VanillaSalt

fix

parent 6245a9f7
......@@ -2,11 +2,12 @@
function c12538374.initial_effect(c)
--Special Summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(12538374,0))
e1:SetType(EFFECT_TYPE_TRIGGER_O+EFFECT_TYPE_FIELD)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetCode(EVENT_PHASE+PHASE_STANDBY)
e1:SetRange(LOCATION_GRAVE)
e1:SetDescription(aux.Stringid(12538374,0))
e1:SetCountLimit(1)
e1:SetCondition(c12538374.condition)
e1:SetTarget(c12538374.target)
e1:SetOperation(c12538374.operation)
......
......@@ -28,16 +28,15 @@ function c18378582.initial_effect(c)
c:RegisterEffect(e3)
end
function c18378582.rfilter(c,code)
return c and c:IsFaceup() and c:IsCode(code)
return c:IsFaceup() and c:IsCode(code)
end
function c18378582.spcon(e,c)
if c==nil then return true end
return (c18378582.rfilter(Duel.GetFieldCard(0,LOCATION_SZONE,5),56433456)
or c18378582.rfilter(Duel.GetFieldCard(1,LOCATION_SZONE,5),56433456))
return Duel.IsEnvironment(56433456)
and Duel.CheckReleaseGroup(c:GetControler(),c18378582.rfilter,1,nil,66073051)
end
function c18378582.spop(e,tp,eg,ep,ev,re,r,rp,c)
local g=Duel.SelectReleaseGroup(c:GetControler(),c18378582.rfilter,1,1,nil,66073051)
local g=Duel.SelectReleaseGroup(tp,c18378582.rfilter,1,1,nil,66073051)
Duel.Release(g,REASON_COST)
end
function c18378582.cfilter(c)
......@@ -53,8 +52,7 @@ function c18378582.destg(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0)
end
function c18378582.desop(e,tp,eg,ep,ev,re,r,rp,chk)
if (c18378582.rfilter(Duel.GetFieldCard(0,LOCATION_SZONE,5),56433456)
or c18378582.rfilter(Duel.GetFieldCard(1,LOCATION_SZONE,5),56433456)) then
if Duel.IsEnvironment(56433456) then
local g=Duel.GetMatchingGroup(Card.IsDestructable,tp,0,LOCATION_MZONE,nil)
Duel.Destroy(g,REASON_EFFECT)
end
......
......@@ -32,13 +32,7 @@ end
function c22900598.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstMatchingCard(c22900598.filter,tp,LOCATION_DECK,0,nil,tp)
if tc then
local fc=Duel.GetFieldCard(1-tp,LOCATION_SZONE,5)
if fc and fc:IsFaceup() then
Duel.MoveToField(tc,tp,tp,LOCATION_SZONE,POS_FACEUP,true)
Duel.Destroy(fc,REASON_RULE)
else
Duel.MoveToField(tc,tp,tp,LOCATION_SZONE,POS_FACEUP,true)
end
Duel.MoveToField(tc,tp,tp,LOCATION_SZONE,POS_FACEUP,true)
local te=tc:GetActivateEffect()
local tep=tc:GetControler()
local cost=te:GetCost()
......
......@@ -81,9 +81,5 @@ function c24096228.operation(e,tp,eg,ep,ev,re,r,rp)
if tg then tg(e,tp,eg,ep,ev,re,r,rp,1) end
Duel.BreakEffect()
if op then op(e,tp,eg,ep,ev,re,r,rp) end
if bit.band(tpe,TYPE_FIELD)~=0 then
local of=Duel.GetFieldCard(1-tp,LOCATION_SZONE,5)
if of then Duel.Destroy(of,REASON_RULE) end
end
end
end
......@@ -12,8 +12,10 @@ function c25173686.initial_effect(c)
c:RegisterEffect(e1)
end
function c25173686.condition(e,tp,eg,ep,ev,re,r,rp)
local ct=Duel.GetFieldGroupCount(tp,0,LOCATION_SZONE)
return ct==6 or (ct==5 and Duel.GetFieldCard(1-tp,LOCATION_SZONE,5)==nil)
for i=0,4 do
if Duel.GetFieldCard(1-tp,LOCATION_SZONE,i)==nil then return false end
end
return true
end
function c25173686.filter(c)
return c:GetSequence()<5 and c:IsDestructable()
......
......@@ -25,17 +25,12 @@ function c48934760.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(48934760,0))
local tc=Duel.SelectMatchingCard(tp,c48934760.filter,tp,LOCATION_DECK,0,1,1,nil,tp):GetFirst()
if tc then
if Duel.GetFieldCard(tp,LOCATION_SZONE,5)~=nil then
Duel.Destroy(Duel.GetFieldCard(tp,LOCATION_SZONE,5),REASON_RULE)
local fc=Duel.GetFieldCard(tp,LOCATION_SZONE,5)
if fc then
Duel.SendtoGrave(fc,REASON_RULE)
Duel.BreakEffect()
Duel.MoveToField(tc,tp,tp,LOCATION_SZONE,POS_FACEUP,true)
elseif Duel.GetFieldCard(1-tp,LOCATION_SZONE,5)~=nil
and Duel.GetFieldCard(1-tp,LOCATION_SZONE,5):IsFaceup() then
Duel.MoveToField(tc,tp,tp,LOCATION_SZONE,POS_FACEUP,true)
Duel.Destroy(Duel.GetFieldCard(1-tp,LOCATION_SZONE,5),REASON_RULE)
else
Duel.MoveToField(tc,tp,tp,LOCATION_SZONE,POS_FACEUP,true)
end
Duel.MoveToField(tc,tp,tp,LOCATION_SZONE,POS_FACEUP,true)
local te=tc:GetActivateEffect()
local tep=tc:GetControler()
local cost=te:GetCost()
......
......@@ -20,7 +20,7 @@ function c49398568.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local hg=Duel.GetFieldGroup(tp,LOCATION_HAND,0)
hg:RemoveCard(e:GetHandler())
if chk==0 then return hg:GetCount()>0 and hg:FilterCount(c49398568.cfilter,nil)==hg:GetCount() end
Duel.SendtoGrave(hg,REASON_COST)
Duel.SendtoGrave(hg,REASON_COST+REASON_DISCARD)
end
function c49398568.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local ftg=re:GetTarget()
......
......@@ -12,6 +12,8 @@ function c51838385.initial_effect(c)
end
function c51838385.atkcon(e)
local tp=e:GetHandlerPlayer()
local ct=Duel.GetFieldGroupCount(tp,LOCATION_HAND+LOCATION_SZONE,0)
return ct==0 or (ct==1 and Duel.GetFieldCard(tp,LOCATION_SZONE,5))
for i=0,4 do
if Duel.GetFieldCard(tp,LOCATION_SZONE,i) then return false end
end
return Duel.GetFieldGroupCount(tp,LOCATION_HAND,0)==0
end
--デビル·マゼラ
--デビルマゼラ
function c6133894.initial_effect(c)
c:EnableReviveLimit()
--cannot special summon
......@@ -27,26 +27,23 @@ function c6133894.initial_effect(c)
c:RegisterEffect(e3)
end
function c6133894.rfilter(c,code)
return c and c:IsFaceup() and c:IsCode(code)
return c:IsFaceup() and c:IsCode(code)
end
function c6133894.spcon(e,c)
if c==nil then return true end
return (c6133894.rfilter(Duel.GetFieldCard(0,LOCATION_SZONE,5),94585852)
or c6133894.rfilter(Duel.GetFieldCard(1,LOCATION_SZONE,5),94585852))
return Duel.IsEnvironment(94585852)
and Duel.CheckReleaseGroup(c:GetControler(),c6133894.rfilter,1,nil,66073051)
end
function c6133894.spop(e,tp,eg,ep,ev,re,r,rp,c)
local g=Duel.SelectReleaseGroup(c:GetControler(),c6133894.rfilter,1,1,nil,66073051)
local g=Duel.SelectReleaseGroup(tp,c6133894.rfilter,1,1,nil,66073051)
Duel.Release(g,REASON_COST)
end
function c6133894.hdtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local g=Duel.GetMatchingGroup(Card.IsDestructable,tp,0,LOCATION_MZONE,nil)
Duel.SetOperationInfo(0,CATEGORY_HANDES,nil,0,1-tp,3)
end
function c6133894.hdop(e,tp,eg,ep,ev,re,r,rp,chk)
if (c6133894.rfilter(Duel.GetFieldCard(0,LOCATION_SZONE,5),94585852)
or c6133894.rfilter(Duel.GetFieldCard(1,LOCATION_SZONE,5),94585852)) then
if Duel.IsEnvironment(94585852) then
local g=Duel.GetFieldGroup(tp,0,LOCATION_HAND):RandomSelect(tp,3)
Duel.SendtoGrave(g,REASON_EFFECT+REASON_DISCARD)
end
......
......@@ -63,7 +63,10 @@ function c73136204.tdop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
local sg=g:Filter(Card.IsRelateToEffect,nil,e)
if sg:GetCount()>0 then
local ct=Duel.SendtoDeck(sg,nil,0,REASON_EFFECT)
Duel.SendtoDeck(sg,nil,0,REASON_EFFECT)
local og=Duel.GetOperatedGroup()
local ct=og:FilterCount(Card.IsLocation,nil,LOCATION_DECK)
if ct==0 then return end
Duel.SortDecktop(tp,tp,ct)
for i=1,ct do
local mg=Duel.GetDecktopGroup(tp,1)
......
......@@ -27,7 +27,7 @@ function c77121851.spcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetFlagEffect(77121851)~=0
end
function c77121851.costfilter(c)
return c:IsRace(0xc200) and c:IsAbleToGraveAsCost()
return c:IsRace(RACE_BEAST+RACE_BEASTWARRIOR+RACE_WINDBEAST) and (c:IsLocation(LOCATION_HAND) or c:IsFaceup()) and c:IsAbleToGraveAsCost()
end
function c77121851.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c77121851.costfilter,tp,LOCATION_HAND+LOCATION_MZONE,0,1,nil) end
......
......@@ -23,10 +23,7 @@ function c8310162.initial_effect(c)
c:RegisterEffect(e2)
end
function c8310162.descon(e)
local c=e:GetHandler()
local f1=Duel.GetFieldCard(0,LOCATION_SZONE,5)
local f2=Duel.GetFieldCard(1,LOCATION_SZONE,5)
return ((f1==nil or not f1:IsFaceup() or f1:GetCode()~=27564031) and (f2==nil or not f2:IsFaceup() or f2:GetCode()~=27564031))
return not Duel.IsEnvironment(27564031)
end
function c8310162.spcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetSummonType()==SUMMON_TYPE_SYNCHRO
......
......@@ -25,7 +25,7 @@ function c95239444.initial_effect(c)
c:RegisterEffect(e2)
end
function c95239444.cfilter(c,lv)
return c:IsRace(RACE_PLANT) and c:IsLevelBelow(lv) and c:IsAbleToGraveAsCost()
return c:IsRace(RACE_PLANT) and c:IsLevelBelow(lv) and (c:IsLocation(LOCATION_HAND) or c:IsFaceup()) and c:IsAbleToGraveAsCost()
end
function c95239444.stcost(e,tp,eg,ep,ev,re,r,rp,chk)
local ct=Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)
......
......@@ -21,19 +21,15 @@ end
function c97970833.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstMatchingCard(c97970833.filter,tp,LOCATION_DECK,0,nil,tp)
if tc then
if Duel.GetFieldCard(tp,LOCATION_SZONE,5)~=nil then
Duel.Destroy(Duel.GetFieldCard(tp,LOCATION_SZONE,5),REASON_RULE)
local fc=Duel.GetFieldCard(tp,LOCATION_SZONE,5)
if fc then
Duel.SendtoGrave(fc,REASON_RULE)
Duel.BreakEffect()
Duel.MoveToField(tc,tp,tp,LOCATION_SZONE,POS_FACEUP,true)
elseif Duel.GetFieldCard(1-tp,LOCATION_SZONE,5)~=nil
and Duel.GetFieldCard(1-tp,LOCATION_SZONE,5):IsFaceup() then
Duel.MoveToField(tc,tp,tp,LOCATION_SZONE,POS_FACEUP,true)
Duel.Destroy(Duel.GetFieldCard(1-tp,LOCATION_SZONE,5),REASON_RULE)
if Duel.IsPlayerCanDraw(1-tp,1) and Duel.SelectYesNo(tp,aux.Stringid(97970833,0)) then
Duel.Draw(1-tp,1,REASON_EFFECT)
end
else
Duel.MoveToField(tc,tp,tp,LOCATION_SZONE,POS_FACEUP,true)
end
Duel.MoveToField(tc,tp,tp,LOCATION_SZONE,POS_FACEUP,true)
fc=Duel.GetFieldCard(1-tp,LOCATION_SZONE,5)
if fc and fc:IsFaceup() and Duel.IsPlayerCanDraw(1-tp,1) and Duel.SelectYesNo(tp,aux.Stringid(97970833,0)) then
Duel.Draw(1-tp,1,REASON_EFFECT)
end
Duel.RaiseEvent(tc,EVENT_CHAIN_SOLVED,tc:GetActivateEffect(),0,tp,tp,Duel.GetCurrentChain())
end
......
......@@ -651,8 +651,8 @@ end
function Auxiliary.FConditionFun2(f1,f2,insf)
return function(e,g,gc,chkf)
if g==nil then return insf end
if gc then return (f1(gc) and g:IsExists(f2,1,nil))
or (f2(gc) and g:IsExists(f1,1,nil)) end
if gc then return (f1(gc) and g:IsExists(f2,1,gc))
or (f2(gc) and g:IsExists(f1,1,gc)) end
local g1=Group.CreateGroup() local g2=Group.CreateGroup() local fs=false
local tc=g:GetFirst()
while tc do
......@@ -668,11 +668,9 @@ end
function Auxiliary.FOperationFun2(f1,f2,insf)
return function(e,tp,eg,ep,ev,re,r,rp,gc,chkf)
if gc then
local sg=eg:Filter(Auxiliary.FConditionFilterF2c,nil,f1,f2)
local b1=f1(gc)
local b2=f2(gc)
if b1 and not b2 then sg:Remove(f1,nil) end
if b2 and not b1 then sg:Remove(f2,nil) end
local sg=Group.CreateGroup()
if f1(gc) then sg:Merge(eg:Filter(f2,gc)) end
if f2(gc) then sg:Merge(eg:Filter(f1,gc)) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FMATERIAL)
local g1=sg:Select(tp,1,1,nil)
Duel.SetFusionMaterial(g1)
......
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