Commit 5e52dbed authored by wind2009's avatar wind2009

Merge branch 'master' of upstream into master

parents 6bb9a6bd dc4588d3
......@@ -15,16 +15,10 @@ function c18895832.cost(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.PayLPCost(tp,1000)
end
function c18895832.filter(c)
return c:IsFaceup() and c:IsRace(RACE_MACHINE)
end
function c18895832.tfilter(c)
return not c:IsAbleToRemove()
return c:IsFaceupEx() and c:IsRace(RACE_MACHINE) and c:IsAbleToRemove()
end
function c18895832.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local g=Duel.GetMatchingGroup(c18895832.filter,tp,0,LOCATION_MZONE+LOCATION_GRAVE,nil)
return g:GetCount()>0 and not g:IsExists(c18895832.tfilter,1,nil)
end
if chk==0 then return Duel.IsExistingMatchingCard(c18895832.filter,tp,0,LOCATION_MZONE+LOCATION_GRAVE,1,nil) end
local g=Duel.GetMatchingGroup(c18895832.filter,tp,0,LOCATION_MZONE+LOCATION_GRAVE,nil)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,g:GetCount(),0,0)
end
......
......@@ -57,7 +57,6 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp)
local tag=g:Select(tp,1,1,nil)
Duel.SendtoHand(tag,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tag)
Duel.ShuffleDeck(tp)
end
end
function s.desfilter2(c,tp)
......
......@@ -43,7 +43,6 @@ function c28912357.operation(e,tp,eg,ep,ev,re,r,rp)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
Duel.ShuffleDeck(tp)
end
end
function c28912357.spcon(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -19,7 +19,9 @@ function c34968834.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
if rp==1-tp and tp==e:GetLabel() then
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
e:SetCategory(CATEGORY_SPECIAL_SUMMON|CATEGORY_DECKDES)
else
e:SetCategory(CATEGORY_SPECIAL_SUMMON)
end
end
function c34968834.filter(c,e,tp)
......
......@@ -6,6 +6,7 @@ function s.initial_effect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e1:SetCountLimit(1,id)
e1:SetTarget(s.target)
e1:SetOperation(s.activate)
......@@ -30,13 +31,12 @@ function s.filter(c,e,tp)
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_HAND+LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_DECK)
end
function s.posfilter(c)
return c:IsFaceup() and c:IsCanTurnSet()
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)+Duel.GetLocationCount(1-tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_HAND+LOCATION_DECK,0,1,1,nil,e,tp)
if g:GetCount()>0 then
......@@ -44,13 +44,15 @@ function s.activate(e,tp,eg,ep,ev,re,r,rp)
local s1=Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and tc:IsCanBeSpecialSummoned(e,0,tp,false,false)
local s2=Duel.GetLocationCount(1-tp,LOCATION_MZONE)>0 and tc:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEDOWN_DEFENSE,1-tp)
local op=aux.SelectFromOptions(tp,
{s1,aux.Stringid(id,2),tp},
{s2,aux.Stringid(id,3),1-tp})
if Duel.SpecialSummon(tc,0,tp,op,false,false,op==tp and POS_FACEUP or POS_FACEDOWN_DEFENCE)~=0
and Duel.IsExistingMatchingCard(s.posfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil)
{s1,aux.Stringid(id,2),tp},
{s2,aux.Stringid(id,3),1-tp})
local sumpos=op==tp and POS_FACEUP or POS_FACEDOWN_DEFENCE
if Duel.SpecialSummon(tc,0,tp,op,false,false,sumpos)==0 then return end
if op==1-tp then Duel.ConfirmCards(1-tp,tc) end
if Duel.IsExistingMatchingCard(s.posfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil)
and Duel.SelectYesNo(tp,aux.Stringid(id,4)) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_POSCHANGE)
local sg=Duel.SelectMatchingCard(tp,s.posfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
Duel.HintSelection(sg)
Duel.ChangePosition(sg:GetFirst(),POS_FACEDOWN_DEFENSE)
......
......@@ -31,7 +31,7 @@ function c73898890.initial_effect(c)
c:RegisterEffect(e2)
end
function c73898890.lcheck(g)
return g:IsExists(Card.IsType,1,nil,TYPE_RITUAL)
return g:IsExists(Card.IsLinkType,1,nil,TYPE_RITUAL)
end
function c73898890.tdfilter(c)
return c:IsAbleToDeck() and c:IsType(TYPE_RITUAL) and c:IsType(TYPE_MONSTER)
......
......@@ -56,8 +56,14 @@ function s.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.RegisterEffect(e2,tp)
local ch=Duel.GetCurrentChain()
if ch>1 then
local p,code=Duel.GetChainInfo(ch-1,CHAININFO_TRIGGERING_PLAYER,CHAININFO_TRIGGERING_CODE)
local p,code,te=Duel.GetChainInfo(ch-1,CHAININFO_TRIGGERING_PLAYER,CHAININFO_TRIGGERING_CODE,CHAININFO_TRIGGERING_EFFECT)
if p==1-tp then
if te then
local tc=te:GetHandler()
if tc and tc:IsRelateToEffect(te) then
code=tc:GetCode()
end
end
local g=Duel.GetMatchingGroup(s.rmfilter,tp,0,LOCATION_ONFIELD+LOCATION_GRAVE,nil,code)
if #g>0 and Duel.SelectYesNo(tp,aux.Stringid(id,1)) then
Duel.BreakEffect()
......
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