Commit 5a693983 authored by nanahira's avatar nanahira

Merge branch 'master' of git.mycard.moe:mycard/pre-release-database-cdb

parents b3e5f074 c4ffac40
Pipeline #42962 passed with stages
in 3 minutes and 49 seconds
...@@ -115,7 +115,7 @@ add_script_diff: ...@@ -115,7 +115,7 @@ add_script_diff:
FIELDS: 'name,desc,overallString,picUrl' FIELDS: 'name,desc,overallString,picUrl'
GIT_DEPTH: '1000' GIT_DEPTH: '1000'
OUTPUT_FILENAME: test-release.json OUTPUT_FILENAME: test-release.json
REF_COMMIT: '21.29' # 更新的时候改这里,修改成上一个tag的版本号 REF_COMMIT: '21.30' # 更新的时候改这里,修改成上一个tag的版本号
script: script:
- apt update;apt -y install wget - apt update;apt -y install wget
- currentPath=$PWD - currentPath=$PWD
......
...@@ -65,18 +65,19 @@ function s.tdcon(e,tp,eg,ep,ev,re,r,rp) ...@@ -65,18 +65,19 @@ function s.tdcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==1-tp return Duel.GetTurnPlayer()==1-tp
end end
function s.tdfilter(c,tp) function s.tdfilter(c,tp)
return c:IsFaceup() and c:IsAttribute(ATTRIBUTE_WIND) and c:IsAbleToDeck() return c:IsFaceup() and c:IsControler(tp) and c:IsAttribute(ATTRIBUTE_WIND) and c:IsType(TYPE_MONSTER)
and Duel.IsExistingTarget(Card.IsAbleToDeck,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,c) end
function s.gcheck(g,tp)
return g:IsExists(s.tdfilter,1,nil,tp)
end end
function s.tdtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function s.tdtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end if chkc then return false end
if chk==0 then return Duel.IsExistingTarget(s.tdfilter,tp,LOCATION_MZONE,0,1,nil) end local rg=Duel.GetMatchingGroup(aux.AND(Card.IsAbleToDeck,Card.IsCanBeEffectTarget),tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK) if chk==0 then return rg:CheckSubGroup(s.gcheck,2,2,tp) end
local g1=Duel.SelectTarget(tp,s.tdfilter,tp,LOCATION_MZONE,0,1,1,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g2=Duel.SelectTarget(tp,Card.IsAbleToDeck,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,g1) local tg=rg:SelectSubGroup(tp,s.gcheck,false,2,2,tp)
g1:Merge(g2) Duel.SetTargetCard(tg)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g1,2,0,0) Duel.SetOperationInfo(0,CATEGORY_TODECK,tg,2,0,0)
end end
function s.tdop(e,tp,eg,ep,ev,re,r,rp) function s.tdop(e,tp,eg,ep,ev,re,r,rp)
local tg=Duel.GetTargetsRelateToChain() local tg=Duel.GetTargetsRelateToChain()
......
...@@ -26,7 +26,7 @@ function s.initial_effect(c) ...@@ -26,7 +26,7 @@ function s.initial_effect(c)
e3:SetDescription(aux.Stringid(id,1)) e3:SetDescription(aux.Stringid(id,1))
e3:SetCategory(CATEGORY_DESTROY) e3:SetCategory(CATEGORY_DESTROY)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DELAY) e3:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP)
e3:SetCode(EVENT_SPSUMMON_SUCCESS) e3:SetCode(EVENT_SPSUMMON_SUCCESS)
e3:SetCountLimit(1,id+o) e3:SetCountLimit(1,id+o)
e3:SetTarget(s.destg) e3:SetTarget(s.destg)
......
...@@ -37,38 +37,37 @@ function s.initial_effect(c) ...@@ -37,38 +37,37 @@ function s.initial_effect(c)
e3:SetOperation(s.desop) e3:SetOperation(s.desop)
c:RegisterEffect(e3) c:RegisterEffect(e3)
end end
function s.hspfilter1(c,tp,fc) function s.hspfilter1(c,tp,fc,g)
return c:IsFusionSetCard(0x10f3) return c:IsFusionSetCard(0x10f3)
and c:IsControler(tp) and c:IsCanBeFusionMaterial(fc,SUMMON_TYPE_SPECIAL) and c:IsControler(tp) and c:IsCanBeFusionMaterial(fc,SUMMON_TYPE_SPECIAL)
and Duel.IsExistingMatchingCard(s.hspfilter2,tp,LOCATION_MZONE,LOCATION_MZONE,1,c,tp,fc,c) and g:IsExists(s.hspfilter2,1,c,tp,fc)
end end
function s.hspfilter2(c,tp,fc,sc) function s.hspfilter2(c,tp,fc)
local g=Group.FromCards(c,sc)
return c:IsFaceup() and c:GetCounter(0x1041)>0 return c:IsFaceup() and c:GetCounter(0x1041)>0
and c:IsReleasable(REASON_MATERIAL|REASON_SPSUMMON) and c:IsReleasable(REASON_MATERIAL|REASON_SPSUMMON)
and c:IsCanBeFusionMaterial(fc,SUMMON_TYPE_SPECIAL) and c:IsCanBeFusionMaterial(fc,SUMMON_TYPE_SPECIAL)
and Duel.GetLocationCountFromEx(tp,tp,g,fc)>0 end
function s.hspfilter(c,tp,fc)
return (c:IsFaceup() or c:IsControler(tp)) and (c:IsFusionSetCard(0x10f3) or c:GetCounter(0x1041)>0)
and c:IsReleasable(REASON_MATERIAL|REASON_SPSUMMON)
and c:IsCanBeFusionMaterial(fc,SUMMON_TYPE_SPECIAL)
end
function s.fselect(g,tp,fc)
return g:IsExists(s.hspfilter1,1,nil,tp,fc,g) and Duel.GetLocationCountFromEx(tp,tp,g,fc)>0
end end
function s.hspcon(e,c) function s.hspcon(e,c)
if c==nil then return true end if c==nil then return true end
return Duel.CheckReleaseGroupEx(c:GetControler(),s.hspfilter1,1,REASON_SPSUMMON,false,nil,c:GetControler(),c) local rg=Duel.GetMatchingGroup(s.hspfilter,e:GetHandlerPlayer(),LOCATION_MZONE,LOCATION_MZONE,nil,e:GetHandlerPlayer(),c)
return rg:CheckSubGroup(s.fselect,2,2,e:GetHandlerPlayer(),c)
end end
function s.hsptg(e,tp,eg,ep,ev,re,r,rp,chk,c) function s.hsptg(e,tp,eg,ep,ev,re,r,rp,chk,c)
local g1=Duel.GetReleaseGroup(tp,false,REASON_SPSUMMON):Filter(s.hspfilter1,nil,tp,c) local rg=Duel.GetMatchingGroup(s.hspfilter,tp,LOCATION_MZONE,LOCATION_MZONE,nil,tp,c)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local tc1=g1:SelectUnselect(nil,tp,false,true,1,1) local sg=rg:SelectSubGroup(tp,s.fselect,true,2,2,tp,c)
if tc1 then if sg:GetCount()>0 then
local g2=Duel.GetMatchingGroup(s.hspfilter2,tp,LOCATION_MZONE,LOCATION_MZONE,tc1,tp,c,tc1) sg:KeepAlive()
local tc2=g2:SelectUnselect(nil,tp,false,true,1,1) e:SetLabelObject(sg)
if tc2 then
local mg=Group.CreateGroup()
mg:AddCard(tc1)
mg:AddCard(tc2)
mg:KeepAlive()
e:SetLabelObject(mg)
return true return true
end
return false
else return false end else return false end
end end
function s.hspop(e,tp,eg,ep,ev,re,r,rp,c) function s.hspop(e,tp,eg,ep,ev,re,r,rp,c)
......
...@@ -12,16 +12,20 @@ function s.initial_effect(c) ...@@ -12,16 +12,20 @@ function s.initial_effect(c)
e1:SetOperation(s.activate) e1:SetOperation(s.activate)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
function s.cfilter1(c,tp) function s.cfilter1(c)
return c:IsSetCard(0x2dd) and c:IsType(TYPE_MONSTER) return c:IsSetCard(0x2dd) and c:IsType(TYPE_MONSTER)
and Duel.IsExistingMatchingCard(s.cfilter2,tp,LOCATION_DECK,0,1,c)
end end
function s.cfilter2(c) function s.cfilter2(c)
return c:IsRace(RACE_DINOSAUR) return c:IsRace(RACE_DINOSAUR)
end end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk) function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then if chk==0 then
return Duel.IsExistingMatchingCard(s.cfilter1,tp,LOCATION_DECK,0,1,nil,tp) and Duel.IsPlayerCanDiscardDeck(tp,2) return Duel.IsExistingMatchingCard(s.cfilter1,tp,LOCATION_DECK,0,1,nil)
and Duel.IsExistingMatchingCard(s.cfilter2,tp,LOCATION_DECK,0,1,nil)
and Duel.IsExistingMatchingCard(
function(c) return s.cfilter1(c) or s.cfilter2(c) end,
tp,LOCATION_DECK,0,2,nil
)
end end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,0,LOCATION_EXTRA) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,0,LOCATION_EXTRA)
end end
...@@ -30,35 +34,32 @@ function s.filter2(c,e,tp,m,f,chkf) ...@@ -30,35 +34,32 @@ function s.filter2(c,e,tp,m,f,chkf)
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false) and c:CheckFusionMaterial(m,nil,chkf) and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false) and c:CheckFusionMaterial(m,nil,chkf)
end end
function s.activate(e,tp,eg,ep,ev,re,r,rp) function s.activate(e,tp,eg,ep,ev,re,r,rp)
local g1=Duel.GetMatchingGroup(s.cfilter1,tp,LOCATION_DECK,0,nil,tp)
local dcount=Duel.GetFieldGroupCount(tp,LOCATION_DECK,0) local dcount=Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)
if dcount==0 then return end if dcount==0 then return end
local seq1=-1 local g1=Duel.GetMatchingGroup(s.cfilter1,tp,LOCATION_DECK,0,nil)
local spcard1=nil if #g1==0 then return end
for tc in aux.Next(g1) do
if tc:GetSequence()>seq1 then
seq1=tc:GetSequence()
spcard1=tc
end
end
local g2=Duel.GetMatchingGroup(s.cfilter2,tp,LOCATION_DECK,0,nil) local g2=Duel.GetMatchingGroup(s.cfilter2,tp,LOCATION_DECK,0,nil)
local seq2=-1 if #g2==0 then return end
local spcard2=nil -- top card in g1
for tc in aux.Next(g2) do local c1=g1:GetMaxGroup(Card.GetSequence):GetFirst()
if tc:GetSequence()>seq2 and tc:GetSequence()~=seq1 then -- top card in g2
seq2=tc:GetSequence() local c2=g2:GetMaxGroup(Card.GetSequence):GetFirst()
spcard2=tc local seq=math.min(c1:GetSequence(),c2:GetSequence())
end -- same card: try 2nd top
if c1==c2 then
g1:RemoveCard(c1)
g2:RemoveCard(c2)
-- if no 2nd cards, just exit
if #g1==0 and #g2==0 then return end
local seq1=(#g1>0) and select(2,g1:GetMaxGroup(Card.GetSequence)) or -1
local seq2=(#g2>0) and select(2,g2:GetMaxGroup(Card.GetSequence)) or -1
seq=math.max(seq1,seq2)
end end
if seq1==-1 or seq2==-1 then local excavate_count=dcount-seq
Duel.ConfirmDecktop(tp,dcount) Duel.ConfirmDecktop(tp,excavate_count)
Duel.ShuffleDeck(tp) Duel.SetLP(tp,Duel.GetLP(tp)-excavate_count*400)
return local mg=Duel.GetDecktopGroup(tp,excavate_count):Filter(Card.IsType,nil,TYPE_MONSTER)
end
if seq2<seq1 then seq1=seq2 end
Duel.ConfirmDecktop(tp,dcount-seq1)
Duel.SetLP(tp,Duel.GetLP(tp)-(dcount-seq1)*400)
local mg=Duel.GetDecktopGroup(tp,dcount-seq1):Filter(Card.IsType,nil,TYPE_MONSTER)
local chkf=tp local chkf=tp
local sg1=Duel.GetMatchingGroup(s.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg,nil,chkf) local sg1=Duel.GetMatchingGroup(s.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg,nil,chkf)
local mg2=nil local mg2=nil
...@@ -85,6 +86,7 @@ function s.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -85,6 +86,7 @@ function s.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.SpecialSummon(tc,SUMMON_TYPE_FUSION,tp,tp,false,false,POS_FACEUP) Duel.SpecialSummon(tc,SUMMON_TYPE_FUSION,tp,tp,false,false,POS_FACEUP)
elseif ce~=nil then elseif ce~=nil then
local mat2=Duel.SelectFusionMaterial(tp,tc,mg2,nil,chkf) local mat2=Duel.SelectFusionMaterial(tp,tc,mg2,nil,chkf)
Duel.BreakEffect()
local fop=ce:GetOperation() local fop=ce:GetOperation()
fop(ce,e,tp,tc,mat2) fop(ce,e,tp,tc,mat2)
end end
......
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