Commit dcff9e26 authored by nanahira's avatar nanahira

fix

parent ffdb39ad
...@@ -44,7 +44,7 @@ function cm.initial_effect(c) ...@@ -44,7 +44,7 @@ function cm.initial_effect(c)
e8:SetType(EFFECT_TYPE_IGNITION) e8:SetType(EFFECT_TYPE_IGNITION)
e8:SetRange(LOCATION_MZONE) e8:SetRange(LOCATION_MZONE)
e8:SetCountLimit(1) e8:SetCountLimit(1)
e8:SetCost(cm.cost) e8:SetCost(Senya.ReleaseCost(LOCATION_ONFIELD,LOCATION_ONFIELD))
e8:SetTarget(cm.tgtg) e8:SetTarget(cm.tgtg)
e8:SetOperation(cm.tgop) e8:SetOperation(cm.tgop)
c:RegisterEffect(e8) c:RegisterEffect(e8)
...@@ -77,11 +77,6 @@ end ...@@ -77,11 +77,6 @@ end
function cm.efilter(e,te) function cm.efilter(e,te)
return te:GetHandler():GetSummonLocation()==LOCATION_EXTRA and te:GetOwner()~=e:GetOwner() and te:IsActiveType(TYPE_MONSTER) return te:GetHandler():GetSummonLocation()==LOCATION_EXTRA and te:GetOwner()~=e:GetOwner() and te:IsActiveType(TYPE_MONSTER)
end end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsReleasable,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end
local g=Duel.SelectMatchingCard(tp,Card.IsReleasable,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
Duel.Release(g,REASON_COST)
end
function cm.tgfilter(c) function cm.tgfilter(c)
return c:IsType(TYPE_MONSTER) and c:IsAbleToGrave() and Senya.check_set_sawawa(c) return c:IsType(TYPE_MONSTER) and c:IsAbleToGrave() and Senya.check_set_sawawa(c)
end end
......
...@@ -31,16 +31,12 @@ function cm.dfilter(c,e) ...@@ -31,16 +31,12 @@ function cm.dfilter(c,e)
return c:IsAbleToChangeControler() and not c:IsImmuneToEffect(e) return c:IsAbleToChangeControler() and not c:IsImmuneToEffect(e)
end end
function cm.destg(e,tp,eg,ep,ev,re,r,rp,chk) function cm.destg(e,tp,eg,ep,ev,re,r,rp,chk)
local b1=0 local b1=Duel.GetLocationCount(tp,LOCATION_PZONE)
if Duel.CheckLocation(tp,LOCATION_PZONE,0) then b1=b1+1 end
if Duel.CheckLocation(tp,LOCATION_PZONE,1) then b1=b1+1 end
local g=Duel.GetMatchingGroup(cm.dfilter,tp,0,LOCATION_SZONE,nil,e) local g=Duel.GetMatchingGroup(cm.dfilter,tp,0,LOCATION_SZONE,nil,e)
if chk==0 then return b1>0 and #g>0 end if chk==0 then return b1>0 and #g>0 end
end end
function cm.desop(e,tp,eg,ep,ev,re,r,rp) function cm.desop(e,tp,eg,ep,ev,re,r,rp)
local b1=0 local b1=Duel.GetLocationCount(tp,LOCATION_PZONE)
if Duel.CheckLocation(tp,LOCATION_PZONE,0) then b1=b1+1 end
if Duel.CheckLocation(tp,LOCATION_PZONE,1) then b1=b1+1 end
local g=Duel.GetMatchingGroup(cm.dfilter,tp,0,LOCATION_PZONE,nil,e) local g=Duel.GetMatchingGroup(cm.dfilter,tp,0,LOCATION_PZONE,nil,e)
if not (b1>0 and #g>0) then return end if not (b1>0 and #g>0) then return end
if b1>=#g then if b1>=#g then
......
...@@ -4,21 +4,17 @@ local cm=_G["c"..m] ...@@ -4,21 +4,17 @@ local cm=_G["c"..m]
xpcall(function() require("expansions/script/c37564765") end,function() require("script/c37564765") end) xpcall(function() require("expansions/script/c37564765") end,function() require("script/c37564765") end)
function cm.initial_effect(c) function cm.initial_effect(c)
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DISABLE)
e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN) e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,m+EFFECT_COUNT_CODE_OATH) e1:SetCountLimit(1,m+EFFECT_COUNT_CODE_OATH)
e1:SetCost(cm.cost) e1:SetCost(Senya.ReleaseCost(LOCATION_HAND+LOCATION_MZONE,0,cm.filter))
e1:SetOperation(cm.operation) e1:SetOperation(cm.operation)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
function cm.filter(c) function cm.filter(c)
return Senya.check_set_sawawa(c) and c:IsType(TYPE_MONSTER) and c:IsReleasable() return Senya.check_set_sawawa(c) and c:IsType(TYPE_MONSTER) and c:IsReleasable()
end end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_HAND+LOCATION_ONFIELD,0,1,nil) end
local g=Duel.SelectMatchingCard(tp,cm.filter,tp,LOCATION_HAND+LOCATION_ONFIELD,0,1,1,nil)
Duel.Release(g,REASON_COST)
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp) function cm.operation(e,tp,eg,ep,ev,re,r,rp)
-- --
local e1=Effect.CreateEffect(e:GetHandler()) local e1=Effect.CreateEffect(e:GetHandler())
......
...@@ -19,7 +19,7 @@ function cm.initial_effect(c) ...@@ -19,7 +19,7 @@ function cm.initial_effect(c)
e1:SetRange(LOCATION_HAND) e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,m) e1:SetCountLimit(1,m)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCost(cm.DiscardHandCost) e1:SetCost(Senya.ReleaseCost(LOCATION_HAND,0,cm.costfilter,true))
e1:SetTarget(cm.sptg) e1:SetTarget(cm.sptg)
e1:SetOperation(cm.spop) e1:SetOperation(cm.spop)
c:RegisterEffect(e1) c:RegisterEffect(e1)
......
...@@ -63,8 +63,9 @@ function cm.initial_effect(c) ...@@ -63,8 +63,9 @@ function cm.initial_effect(c)
e2:SetRange(LOCATION_GRAVE) e2:SetRange(LOCATION_GRAVE)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL) e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
e2:SetCost(function(e,tp,eg,ep,ev,re,r,rp,chk) e2:SetCost(function(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroup(tp,aux.FilterEqualFunction(Card.GetOriginalCode,37564765),1,nil) end local f=function(c) return Duel.GetMZoneCount(tp,c,tp)>0 and c:GetOriginalCode()==37564765 end
local g=Duel.SelectReleaseGroup(tp,aux.FilterEqualFunction(Card.GetOriginalCode,37564765),1,1,nil) if chk==0 then return Duel.CheckReleaseGroup(tp,f,1,nil) end
local g=Duel.SelectReleaseGroup(tp,f,1,1,nil)
Duel.Release(g,REASON_COST) Duel.Release(g,REASON_COST)
end) end)
e2:SetCondition(function(e,tp,eg,ep,ev,re,r,rp) e2:SetCondition(function(e,tp,eg,ep,ev,re,r,rp)
...@@ -224,8 +225,7 @@ function cm.CopySpellChainingFilter(c,e,tp,eg,ep,ev,re,r,rp) ...@@ -224,8 +225,7 @@ function cm.CopySpellChainingFilter(c,e,tp,eg,ep,ev,re,r,rp)
return true return true
end end
function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk) function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetMZoneCount(tp)>0 if chk==0 then return Duel.IsPlayerCanSpecialSummonMonster(tp,m,0,0x21,7,2850,2100,RACE_FAIRY,ATTRIBUTE_LIGHT) end
and Duel.IsPlayerCanSpecialSummonMonster(tp,m,0,0x21,7,2850,2100,RACE_FAIRY,ATTRIBUTE_LIGHT) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end end
function cm.thop(e,tp,eg,ep,ev,re,r,rp) function cm.thop(e,tp,eg,ep,ev,re,r,rp)
......
...@@ -32,11 +32,9 @@ function cm.initial_effect(c) ...@@ -32,11 +32,9 @@ function cm.initial_effect(c)
e3:SetRange(LOCATION_PZONE) e3:SetRange(LOCATION_PZONE)
e3:SetCountLimit(1,m) e3:SetCountLimit(1,m)
e3:SetCost(function(e,tp,eg,ep,ev,re,r,rp,chk) e3:SetCost(function(e,tp,eg,ep,ev,re,r,rp,chk)
local p1=Duel.CheckLocation(tp,LOCATION_SZONE,6) local pend=Duel.GetLocationCount(tp,LOCATION_PZONE)>0
local p2=Duel.CheckLocation(tp,LOCATION_SZONE,7)
local pend=p1 or p2
local c=e:GetHandler() local c=e:GetHandler()
local g=Duel.GetMatchingGroup(cm.f,tp,LOCATION_ONFIELD,0,c,pend) local g=Senya.GetReleaseGroup(tp,LOCATION_ONFIELD,0,cm.f,c,pend)
e:SetLabel(1) e:SetLabel(1)
if chk==0 then return #g>0 and c:IsReleasable() end if chk==0 then return #g>0 and c:IsReleasable() end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
...@@ -48,13 +46,13 @@ function cm.initial_effect(c) ...@@ -48,13 +46,13 @@ function cm.initial_effect(c)
if chk==0 then if chk==0 then
local l=e:GetLabel() local l=e:GetLabel()
e:SetLabel(0) e:SetLabel(0)
if l~=1 and not (Duel.CheckLocation(tp,LOCATION_SZONE,6) and Duel.CheckLocation(tp,LOCATION_SZONE,7)) then return false end if l~=1 and Duel.GetLocationCount(tp,LOCATION_PZONE)<2 then return false end
return Duel.IsExistingMatchingCard(cm.pcfilter,tp,LOCATION_DECK,0,2,nil) return Duel.IsExistingMatchingCard(cm.pcfilter,tp,LOCATION_DECK,0,2,nil)
end end
e:SetLabel(0) e:SetLabel(0)
end) end)
e3:SetOperation(function(e,tp,eg,ep,ev,re,r,rp) e3:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
if not (Duel.CheckLocation(tp,LOCATION_SZONE,6) and Duel.CheckLocation(tp,LOCATION_SZONE,7)) then return end if not Duel.GetLocationCount(tp,LOCATION_PZONE)<2 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOFIELD) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOFIELD)
local g=Duel.SelectMatchingCard(tp,cm.pcfilter,tp,LOCATION_DECK,0,2,2,nil) local g=Duel.SelectMatchingCard(tp,cm.pcfilter,tp,LOCATION_DECK,0,2,2,nil)
local pc=g:GetFirst() local pc=g:GetFirst()
...@@ -87,7 +85,7 @@ function cm.initial_effect(c) ...@@ -87,7 +85,7 @@ function cm.initial_effect(c)
end end
cm.pendulum_level=7 cm.pendulum_level=7
function cm.f(c,pend) function cm.f(c,pend)
if not pend and (c:GetSequence()<5 or c:IsLocation(LOCATION_MZONE)) then return false end if not pend and not c:IsLocation(LOCATION_PZONE) and c:GetSequence()>0 and c:GetSequence()<4 then return false end
return c:IsCode(37564765) and c:IsReleasable() return c:IsCode(37564765) and c:IsReleasable()
end end
function cm.pcfilter(c) function cm.pcfilter(c)
......
...@@ -2200,6 +2200,41 @@ function cm.GetFusionMaterial(tp,loc,oloc,f,gc,e,...) ...@@ -2200,6 +2200,41 @@ function cm.GetFusionMaterial(tp,loc,oloc,f,gc,e,...)
if e then g1=g1:Filter(cm.NonImmuneFilter,nil,e) end if e then g1=g1:Filter(cm.NonImmuneFilter,nil,e) end
return g1 return g1
end end
function cm.GetReleaseGroup(tp,loc,oloc,f,gc,...)
local g1=Duel.GetReleaseGroup(tp)
if loc then
local floc=(loc & LOCATION_MZONE)
if floc~=0 then
g1=g1:Filter(Card.IsLocation,nil,floc)
else
g1:Clear()
end
local eloc=loc-floc
if eloc~=0 then
local g2=Duel.GetMatchingGroup(Card.IsReleasable,tp,eloc,0,nil)
g1:Merge(g2)
end
end
if oloc and oloc~=0 then
local g3=Duel.GetMatchingGroup(Card.IsReleasable,tp,0,oloc,nil)
g1:Merge(g3)
end
if f then g1=g1:Filter(f,nil,...) end
if gc then g1:RemoveCard(gc) end
return g1
end
function cm.ReleaseCost(loc,oloc,f,self,...)
local ext_params={...}
return function(e,tp,eg,ep,ev,re,r,rp,chk)
local ec=self and e:GetHandler()
local mg=cm.GetReleaseGroup(tp,loc,oloc,f,ec,table.unpack(ext_params))
if chk==0 then return #mg>0 and (not ec or ec:IsReleasable()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local g=mg:Select(tp,1,1,nil)
if ec then g:AddCard(ec) end
Duel.Release(g,REASON_COST)
end
end
function cm.ChainLimitCost(original_cost) function cm.ChainLimitCost(original_cost)
return function(e,tp,eg,ep,ev,re,r,rp,chk) return function(e,tp,eg,ep,ev,re,r,rp,chk)
local effect_code=e:GetHandler():GetFlagEffectLabel(37564766) local effect_code=e:GetHandler():GetFlagEffectLabel(37564766)
......
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