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:
FIELDS: 'name,desc,overallString,picUrl'
GIT_DEPTH: '1000'
OUTPUT_FILENAME: test-release.json
REF_COMMIT: '21.29' # 更新的时候改这里,修改成上一个tag的版本号
REF_COMMIT: '21.30' # 更新的时候改这里,修改成上一个tag的版本号
script:
- apt update;apt -y install wget
- currentPath=$PWD
......
......@@ -65,18 +65,19 @@ function s.tdcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==1-tp
end
function s.tdfilter(c,tp)
return c:IsFaceup() and c:IsAttribute(ATTRIBUTE_WIND) and c:IsAbleToDeck()
and Duel.IsExistingTarget(Card.IsAbleToDeck,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,c)
return c:IsFaceup() and c:IsControler(tp) and c:IsAttribute(ATTRIBUTE_WIND) and c:IsType(TYPE_MONSTER)
end
function s.gcheck(g,tp)
return g:IsExists(s.tdfilter,1,nil,tp)
end
function s.tdtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end
if chk==0 then return Duel.IsExistingTarget(s.tdfilter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g1=Duel.SelectTarget(tp,s.tdfilter,tp,LOCATION_MZONE,0,1,1,nil)
local rg=Duel.GetMatchingGroup(aux.AND(Card.IsAbleToDeck,Card.IsCanBeEffectTarget),tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
if chk==0 then return rg:CheckSubGroup(s.gcheck,2,2,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g2=Duel.SelectTarget(tp,Card.IsAbleToDeck,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,g1)
g1:Merge(g2)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g1,2,0,0)
local tg=rg:SelectSubGroup(tp,s.gcheck,false,2,2,tp)
Duel.SetTargetCard(tg)
Duel.SetOperationInfo(0,CATEGORY_TODECK,tg,2,0,0)
end
function s.tdop(e,tp,eg,ep,ev,re,r,rp)
local tg=Duel.GetTargetsRelateToChain()
......
......@@ -26,7 +26,7 @@ function s.initial_effect(c)
e3:SetDescription(aux.Stringid(id,1))
e3:SetCategory(CATEGORY_DESTROY)
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:SetCountLimit(1,id+o)
e3:SetTarget(s.destg)
......
......@@ -37,38 +37,37 @@ function s.initial_effect(c)
e3:SetOperation(s.desop)
c:RegisterEffect(e3)
end
function s.hspfilter1(c,tp,fc)
function s.hspfilter1(c,tp,fc,g)
return c:IsFusionSetCard(0x10f3)
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
function s.hspfilter2(c,tp,fc,sc)
local g=Group.FromCards(c,sc)
function s.hspfilter2(c,tp,fc)
return c:IsFaceup() and c:GetCounter(0x1041)>0
and c:IsReleasable(REASON_MATERIAL|REASON_SPSUMMON)
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
function s.hspcon(e,c)
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
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)
local tc1=g1:SelectUnselect(nil,tp,false,true,1,1)
if tc1 then
local g2=Duel.GetMatchingGroup(s.hspfilter2,tp,LOCATION_MZONE,LOCATION_MZONE,tc1,tp,c,tc1)
local tc2=g2:SelectUnselect(nil,tp,false,true,1,1)
if tc2 then
local mg=Group.CreateGroup()
mg:AddCard(tc1)
mg:AddCard(tc2)
mg:KeepAlive()
e:SetLabelObject(mg)
return true
end
return false
local sg=rg:SelectSubGroup(tp,s.fselect,true,2,2,tp,c)
if sg:GetCount()>0 then
sg:KeepAlive()
e:SetLabelObject(sg)
return true
else return false end
end
function s.hspop(e,tp,eg,ep,ev,re,r,rp,c)
......
......@@ -12,16 +12,20 @@ function s.initial_effect(c)
e1:SetOperation(s.activate)
c:RegisterEffect(e1)
end
function s.cfilter1(c,tp)
function s.cfilter1(c)
return c:IsSetCard(0x2dd) and c:IsType(TYPE_MONSTER)
and Duel.IsExistingMatchingCard(s.cfilter2,tp,LOCATION_DECK,0,1,c)
end
function s.cfilter2(c)
return c:IsRace(RACE_DINOSAUR)
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
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
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,0,LOCATION_EXTRA)
end
......@@ -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)
end
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)
if dcount==0 then return end
local seq1=-1
local spcard1=nil
for tc in aux.Next(g1) do
if tc:GetSequence()>seq1 then
seq1=tc:GetSequence()
spcard1=tc
end
end
local g1=Duel.GetMatchingGroup(s.cfilter1,tp,LOCATION_DECK,0,nil)
if #g1==0 then return end
local g2=Duel.GetMatchingGroup(s.cfilter2,tp,LOCATION_DECK,0,nil)
local seq2=-1
local spcard2=nil
for tc in aux.Next(g2) do
if tc:GetSequence()>seq2 and tc:GetSequence()~=seq1 then
seq2=tc:GetSequence()
spcard2=tc
end
if #g2==0 then return end
-- top card in g1
local c1=g1:GetMaxGroup(Card.GetSequence):GetFirst()
-- top card in g2
local c2=g2:GetMaxGroup(Card.GetSequence):GetFirst()
local seq=math.min(c1:GetSequence(),c2:GetSequence())
-- 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
if seq1==-1 or seq2==-1 then
Duel.ConfirmDecktop(tp,dcount)
Duel.ShuffleDeck(tp)
return
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 excavate_count=dcount-seq
Duel.ConfirmDecktop(tp,excavate_count)
Duel.SetLP(tp,Duel.GetLP(tp)-excavate_count*400)
local mg=Duel.GetDecktopGroup(tp,excavate_count):Filter(Card.IsType,nil,TYPE_MONSTER)
local chkf=tp
local sg1=Duel.GetMatchingGroup(s.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg,nil,chkf)
local mg2=nil
......@@ -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)
elseif ce~=nil then
local mat2=Duel.SelectFusionMaterial(tp,tc,mg2,nil,chkf)
Duel.BreakEffect()
local fop=ce:GetOperation()
fop(ce,e,tp,tc,mat2)
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