Commit 6daccee8 authored by Nemo Ma's avatar Nemo Ma

fix

parent 65f1d0d3
--破坏剑士的试炼
--21.08.27
local m=11451602
local cm=_G["c"..m]
local cm,m=GetID()
function cm.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
......@@ -46,7 +45,8 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local g1=g:SelectSubGroup(tp,cm.fselect,false,1,3)
if Duel.Destroy(g1,REASON_EFFECT)>0 then
local sg=Duel.GetOperatedGroup():Filter(cm.spfilter,nil,e,tp)
if #sg>0 and Duel.SelectYesNo(tp,aux.Stringid(m,1)) then
local g2=Duel.GetMatchingGroup(cm.thfilter,tp,LOCATION_DECK,0,nil)
if #sg>0 and #g2>0 and Duel.SelectYesNo(tp,aux.Stringid(m,1)) then
local ct=Duel.GetLocationCount(1-tp,LOCATION_MZONE)
if Duel.IsPlayerAffectedByEffect(tp,59822133) then ct=1 end
if #sg>ct then
......@@ -78,6 +78,6 @@ function cm.thop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.SendtoHand(c,nil,REASON_EFFECT)
Duel.ConfirmCards(tp,c)
Duel.ConfirmCards(1-tp,c)
end
end
\ No newline at end of file
......@@ -12,26 +12,13 @@ function cm.initial_effect(c)
e1:SetOperation(cm.pspop)
c:RegisterEffect(e1)
end
function cm.PConditionFilter(c,e,tp,lscale,rscale,eset)
local lv=0
if c.pendulum_level then
lv=c.pendulum_level
else
lv=c:GetLevel()
end
local bool=Auxiliary.PendulumSummonableBool(c)
return (c:IsLocation(LOCATION_HAND) or (c:IsFaceup() and c:IsType(TYPE_PENDULUM)))
and lv>lscale and lv<rscale and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_PENDULUM,tp,bool,bool)
and not c:IsForbidden()
and (PENDULUM_CHECKLIST&(0x1<<tp)==0 or Auxiliary.PConditionExtraFilter(c,e,tp,lscale,rscale,eset))
end
function cm.pspcon(e,tp,eg,ep,ev,re,r,rp)
if not PENDULUM_CHECKLIST then
PENDULUM_CHECKLIST=0
if not Auxiliary.PendulumChecklist then
Auxiliary.PendulumChecklist=0
local ge1=Effect.GlobalEffect()
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_PHASE_START+PHASE_DRAW)
ge1:SetOperation(aux.PendulumReset)
ge1:SetOperation(Auxiliary.PendulumReset)
Duel.RegisterEffect(ge1,0)
end
local eset={Duel.IsPlayerAffectedByEffect(tp,EFFECT_EXTRA_PENDULUM_SUMMON)}
......@@ -47,17 +34,9 @@ function cm.pspcon(e,tp,eg,ep,ev,re,r,rp)
else
g=Duel.GetFieldGroup(tp,loc,0)
end
return g:IsExists(cm.PConditionFilter,1,nil,e,tp,lscale,rscale,eset)
return g:IsExists(aux.PConditionFilter,1,nil,e,tp,lscale,rscale,eset)
end
function cm.pspop(e,tp,eg,ep,ev,re,r,rp,sg,og)
if not PENDULUM_CHECKLIST then
PENDULUM_CHECKLIST=0
local ge1=Effect.GlobalEffect()
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_PHASE_START+PHASE_DRAW)
ge1:SetOperation(Auxiliary.PendulumReset)
Duel.RegisterEffect(ge1,0)
end
local lscale=1
local rscale=9
local eset={Duel.IsPlayerAffectedByEffect(tp,EFFECT_EXTRA_PENDULUM_SUMMON)}
......@@ -76,12 +55,12 @@ function cm.pspop(e,tp,eg,ep,ev,re,r,rp,sg,og)
if ft1>0 then loc=loc|LOCATION_HAND end
if ft2>0 then loc=loc|LOCATION_EXTRA end
if og then
tg=og:Filter(Card.IsLocation,nil,loc):Filter(cm.PConditionFilter,nil,e,tp,lscale,rscale,eset)
tg=og:Filter(Card.IsLocation,nil,loc):Filter(aux.PConditionFilter,nil,e,tp,lscale,rscale,eset)
else
tg=Duel.GetMatchingGroup(cm.PConditionFilter,tp,loc,0,nil,e,tp,lscale,rscale,eset)
tg=Duel.GetMatchingGroup(aux.PConditionFilter,tp,loc,0,nil,e,tp,lscale,rscale,eset)
end
local ce=nil
local b1=PENDULUM_CHECKLIST&(0x1<<tp)==0
local b1=aux.PendulumChecklist&(0x1<<tp)==0
local b2=#eset>0
if b1 and b2 then
local options={1163}
......@@ -111,17 +90,10 @@ function cm.pspop(e,tp,eg,ep,ev,re,r,rp,sg,og)
if ce then
Duel.Hint(HINT_CARD,0,ce:GetOwner():GetOriginalCode())
end
local g1=g:Filter(Card.IsLocation,nil,LOCATION_EXTRA)
g:Sub(g1)
for tc in aux.Next(g1) do
local bool=aux.PendulumSummonableBool(tc)
Duel.SpecialSummonStep(tc,SUMMON_TYPE_PENDULUM,tp,tp,bool,bool,POS_FACEUP)
end
for tc in aux.Next(g) do
local bool=aux.PendulumSummonableBool(tc)
Duel.SpecialSummonStep(tc,SUMMON_TYPE_PENDULUM,tp,tp,bool,bool,POS_FACEUP)
end
g:Merge(g1)
Duel.SpecialSummonComplete()
for tc in aux.Next(g) do tc:CompleteProcedure() end
end
\ No newline at end of file
......@@ -20,7 +20,7 @@ end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
if not re:IsActiveType(TYPE_MONSTER) then return false end
local atk=re:GetHandler():GetAttack()
return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_DECK+LOCATION_EXTRA,0,1,nil,atk)
return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_DECK+LOCATION_EXTRA,0,1,nil,atk) and rp==1-tp
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
......
......@@ -50,7 +50,7 @@ function cm.dfilter(c)
return c:IsReleasable() and c:GetOriginalLevel()>0
end
function cm.filter(c,e,tp)
return (c:IsSetCard(0x87af) or (_G["c"..c:GetCode()] and _G["c"..c:GetCode()].named_with_Arknight)) and c:IsRace(RACE_SPELLCASTER)
return (c:IsSetCard(0x87af) or (_G["c"..c:GetCode()] and _G["c"..c:GetCode()].named_with_Arknight)) --and c:IsRace(RACE_SPELLCASTER)
end
function cm.gfilter(g,c)
local rg = g:Filter(cm.check,nil)
......@@ -60,7 +60,7 @@ function cm.gfilter(g,c)
lv = rg:GetSum(Card.GetRitualLevel,c)
_flag,lv2 = rg:GetMinGroup(Card.GetRitualLevel,c)
end
return Duel.GetMZoneCount(c:GetControler(),g)>0 and g:CheckWithSumGreater(cm.lvfun,c:GetLevel(),c) and ((g:FilterCount(cm.mfilter,nil)+lv) <=c:GetLevel() or (rg:CheckWithSumGreater(cm.lvfun,c:GetLevel(),c) and (rg:GetSum(Card.GetRitualLevel,c) - lv2)<c:GetLevel() and g:FilterCount(cm.mfilter,nil)==0))
return Duel.GetMZoneCount(c:GetControler(),rg)>0 and g:CheckWithSumGreater(cm.lvfun,c:GetLevel(),c) and ((g:FilterCount(cm.mfilter,nil)+lv) <=c:GetLevel() or (rg:CheckWithSumGreater(cm.lvfun,c:GetLevel(),c) and (rg:GetSum(Card.GetRitualLevel,c) - lv2)<c:GetLevel() and g:FilterCount(cm.mfilter,nil)==0))
end
function cm.RitualUltimateFilter(c,filter,e,tp,m1,m2,level_function,greater_or_equal,chk)
if (bit.band(c:GetType(),0x81)~=0x81) or (filter and not filter(c,e,tp,chk)) or not c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_RITUAL,tp,false,true) then return false end
......
......@@ -41,10 +41,9 @@ function cm.initial_effect(c)
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(m,0))
e4:SetCategory(CATEGORY_DESTROY)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e4:SetCode(EVENT_SPSUMMON_SUCCESS)
e4:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CANNOT_NEGATE)
e4:SetTarget(cm.ctltg)
e4:SetOperation(cm.ctlop)
c:RegisterEffect(e4)
--
......@@ -89,21 +88,21 @@ function cm.spop(e,tp,eg,ep,ev,re,r,rp)
end
end
end
function cm.tgfilter(c,tp)
local g=Card.GetColumnGroup(c):Filter(Card.IsControler,nil,1-tp)
if not g:IsContains(c) then return false end
return c:IsLocation(LOCATION_MZONE) or g:GetCount()==1
end
function cm.ctltg(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(cm.tgfilter,tp,0,LOCATION_ONFIELD,nil,tp)
if chk==0 then return Duel.IsExistingMatchingCard(cm.tgfilter,tp,0,LOCATION_ONFIELD,1,nil,tp) end
Duel.SetOperationInfo(0,CATEGORY_DECKDES,g,1,0,LOCATION_ONFIELD)
function cm.desf(c)
return c:GetSequence()==5 or c:GetSequence()==6
end
function cm.ctlop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.GetMatchingGroup(cm.tgfilter,tp,0,LOCATION_ONFIELD,nil,tp)
local g=e:GetHandler():GetColumnGroup():Filter(Card.IsControler,nil,1-e:GetHandlerPlayer())
local cg = g:Filter(cm.desf,nil)
local dg = g:Filter(Card.IsType,nil,TYPE_MONSTER)
if g:GetCount()>0 then
Duel.Destroy(g,REASON_EFFECT)
if #g == 1 then
Duel.Destroy(g,REASON_EFFECT)
elseif cg:GetCount()>0 then
Duel.Destroy(cg,REASON_EFFECT)
else
Duel.Destroy(dg,REASON_EFFECT)
end
end
end
function cm.PConditionFilterArcKnight(c,e,tp,lscale,rscale,f,tc,eset)
......
......@@ -57,18 +57,18 @@ end
--e0
function cm.ngfilter(c)
return c:IsFaceup() and not c:IsDisabled()
return c:IsFaceup() and not c:IsType(TYPE_NORMAL) and not c:IsDisabled()
end
function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.ngfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end
local g=Duel.GetMatchingGroup(cm.ngfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
if chk==0 then return Duel.IsExistingMatchingCard(aux.NegateAnyFilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end
local g=Duel.GetMatchingGroup(aux.NegateAnyFilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
Duel.SetOperationInfo(0,CATEGORY_NEGATE,g,1,tp,nil)
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not Duel.IsExistingMatchingCard(cm.ngfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) then return end
if not Duel.IsExistingMatchingCard(aux.NegateAnyFilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local g=Duel.SelectMatchingCard(tp,cm.ngfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
local g=Duel.SelectMatchingCard(tp,aux.NegateAnyFilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
Duel.HintSelection(g)
local tc=g:GetFirst()
local e1=Effect.CreateEffect(e:GetHandler())
......
......@@ -132,10 +132,10 @@ function cm.addc(e,tp,eg,ep,ev,re,r,rp)
end
ct=math.floor(ct/2)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,cm.thfilter,tp,LOCATION_DECK,0,ct,ct,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
local tg=Duel.SelectMatchingCard(tp,cm.thfilter,tp,LOCATION_DECK,0,ct,ct,nil)
if tg:GetCount()>0 then
Duel.SendtoHand(tg,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tg)
end
end
function cm.valcheck(e,c)
......
......@@ -52,7 +52,7 @@ function c72412590.atktarget(e,c)
return c:IsAttribute(ATTRIBUTE_DARK)
end
function c72412590.dafilter(c)
return c:GetAttribute()~=ATTRIBUTE_DARK
return c:GetAttribute()~=ATTRIBUTE_DARK and c:IsFaceup()
end
function c72412590.datg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and aux.disfilter1(chkc) end
......
......@@ -43,6 +43,7 @@ function c72421540.activate(e,tp,eg,ep,ev,re,r,rp)
e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e3:SetRange(LOCATION_MZONE)
e3:SetCode(EFFECT_SET_ATTACK)
e3:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
e3:SetCondition(c72421540.atkcon)
e3:SetValue(c72421540.atkval)
tc:RegisterEffect(e3)
......
......@@ -80,25 +80,13 @@ function c83000069.spop(e,tp,eg,ep,ev,re,r,rp)
end
end
end
function c83000069.thcon(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject()
if tc:GetFlagEffectLabel(83000069)~=e:GetLabel() then
e:Reset()
return false
else
return true
end
end
function c83000069.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.SendtoHand(e:GetLabelObject(),nil,REASON_EFFECT)
end
-----------
function c83000069.spfilter(c,e,tp)
return c:IsType(TYPE_MONSTER) and c:IsAttack(800) and c:IsDefense(1000) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c83000069.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsAbleToHand()
if chk==0 then return c:IsAbleToHand() and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c83000069.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,c,1,0,0)
......
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