Commit 354dd002 authored by wind2009's avatar wind2009

Fix

parent ae1beb12
Pipeline #40554 passed with stages
in 1 minute and 36 seconds
No preview for this file type
......@@ -94,4 +94,4 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp)
end
Duel.ShuffleHand(1-tp)
end
end
\ No newline at end of file
end
......@@ -96,4 +96,4 @@ function s.descon(e,tp,eg,ep,ev,re,r,rp)
e:Reset()
return false
end
end
\ No newline at end of file
end
......@@ -11,7 +11,7 @@ function s.initial_effect(c)
e1:SetCountLimit(1,id+EFFECT_COUNT_CODE_OATH)
e1:SetCondition(s.spcon)
c:RegisterEffect(e1)
--negate
--destroy
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_DESTROY)
......@@ -61,4 +61,4 @@ function s.desop(e,tp,eg,ep,ev,re,r,rp)
g:AddCard(c)
end
Duel.Destroy(g,REASON_EFFECT)
end
\ No newline at end of file
end
......@@ -59,7 +59,7 @@ function s.setop(e,tp,eg,ep,ev,re,r,rp)
end
function s.spcon(e,tp,eg,ep,ev,re,r,rp)
local ph=Duel.GetCurrentPhase()
return Duel.GetTurnPlayer()~=tp and (ph==PHASE_MAIN1 or ph==PHASE_MAIN2)
return Duel.GetTurnPlayer()~=tp and Duel.IsMainPhase()
end
function s.tdfilter(c,e,tp)
return c:IsSetCard(0x1cf) and c:IsType(TYPE_MONSTER)
......@@ -93,7 +93,7 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp)
local tg=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(Card.IsRelateToChain,nil)
if tg:GetCount()<2 then
return
elseif tg:GetCount()==2 then
elseif tg:GetCount()==2 and tg:IsExists(Card.IsAbleToDeck,2,nil) then
aux.PlaceCardsOnDeckBottom(tp,tg)
elseif tg:GetCount()>2 and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
......@@ -110,4 +110,4 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp)
end
end
end
end
\ No newline at end of file
end
......@@ -44,20 +44,24 @@ function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToChain() then
if tc and tc:IsRelateToChain() then
if aux.NecroValleyNegateCheck(tc) then return end
if not aux.NecroValleyFilter()(tc) then return end
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
end
end
function s.thfilter(c)
return c:IsFaceup() and c:IsSetCard(0x1cf) and c:IsAbleToHand()
function s.thfilter(c,e)
return c:IsFaceup() and c:IsSetCard(0x1cf) and c:IsAbleToHand() and c:IsCanBeEffectTarget(e)
end
function s.gcheck(g)
return g:GetSum(Card.GetBaseAttack)>0
end
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local tg=Duel.GetMatchingGroup(s.thfilter,tp,LOCATION_MZONE,0,nil,e)
if chkc then return chkc:IsOnField() and chkc:IsControler(tp) and s.thfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(s.thfilter,tp,LOCATION_MZONE,0,1,nil) end
if chk==0 then return tg:CheckSubGroup(s.gcheck,1,99) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local g=Duel.SelectTarget(tp,s.thfilter,tp,LOCATION_MZONE,0,1,99,nil)
local g=tg:SelectSubGroup(tp,s.gcheck,false,1,99)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,#g,0,0)
Duel.SetTargetParam(g:GetSum(Card.GetBaseAttack))
Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,g:GetSum(Card.GetBaseAttack))
......@@ -83,4 +87,4 @@ function s.thop(e,tp,eg,ep,ev,re,r,rp)
end
end
end
end
\ No newline at end of file
end
......@@ -7,6 +7,7 @@ function s.initial_effect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,id)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e1:SetTarget(s.target)
e1:SetOperation(s.activate)
c:RegisterEffect(e1)
......@@ -24,36 +25,38 @@ function s.initial_effect(c)
e2:SetOperation(s.disop)
c:RegisterEffect(e2)
end
function s.spfilter(c,e,tp,cost)
function s.spfilter(c,e,tp)
return c:IsSetCard(0x1cf) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
and not Duel.IsExistingMatchingCard(aux.AND(Card.IsFaceup,Card.IsCode),tp,LOCATION_ONFIELD,0,1,nil,c:GetCode())
and (c:IsLocation(LOCATION_DECK+LOCATION_GRAVE) and Duel.GetMZoneCount(tp)>0
or c:IsLocation(LOCATION_EXTRA) and Duel.GetLocationCountFromEx(tp,tp,nil,c)>0)
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_DECK+LOCATION_GRAVE+LOCATION_EXTRA,0,1,nil,e,tp,e:IsCostChecked()) end
if chk==0 then return Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_DECK+LOCATION_GRAVE+LOCATION_EXTRA,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK+LOCATION_GRAVE+LOCATION_EXTRA)
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.spfilter),tp,LOCATION_DECK+LOCATION_GRAVE+LOCATION_EXTRA,0,1,1,nil,e,tp,false)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.spfilter),tp,LOCATION_DECK+LOCATION_GRAVE+LOCATION_EXTRA,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetTargetRange(1,0)
e1:SetTarget(s.splimit)
Duel.RegisterEffect(e1,tp)
if e:IsHasType(EFFECT_TYPE_ACTIVATE) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetTargetRange(1,0)
e1:SetTarget(s.splimit)
Duel.RegisterEffect(e1,tp)
end
end
function s.splimit(e,c)
return c:IsLocation(LOCATION_EXTRA) and not (c:IsRace(RACE_MACHINE) and c:GetTextAttack()>=0 and c:GetTextAttack()<=1500)
end
function s.cfilter(c,tp)
return c:IsSetCard(0x1cf) and c:IsLocation(LOCATION_MZONE)
return c:IsSetCard(0x1cf) and c:IsLocation(LOCATION_MZONE)
and c:IsControler(tp) and c:IsFaceup()
end
function s.discon(e,tp,eg,ep,ev,re,r,rp)
......@@ -70,4 +73,4 @@ function s.distg(e,tp,eg,ep,ev,re,r,rp,chk)
end
function s.disop(e,tp,eg,ep,ev,re,r,rp)
Duel.NegateEffect(ev)
end
\ No newline at end of file
end
......@@ -7,6 +7,7 @@ function s.initial_effect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_CHAINING)
e1:SetCountLimit(1,id+EFFECT_COUNT_CODE_OATH)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
e1:SetCondition(s.condition)
e1:SetTarget(s.target)
e1:SetOperation(s.activate)
......@@ -36,12 +37,13 @@ function s.activate(e,tp,eg,ep,ev,re,r,rp)
if g:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local sg=g:Select(tp,1,1,nil)
Duel.HintSelection(sg)
if Duel.Destroy(sg,REASON_EFFECT)~=0
and Duel.NegateActivation(ev)
and ec:IsRelateToEffect(re)
and ec:IsRelateToChain(ev)
and Duel.Destroy(ec,REASON_EFFECT)~=0 then
Duel.BreakEffect()
Duel.Recover(tp,2000,REASON_EFFECT)
end
end
end
\ No newline at end of file
end
......@@ -67,4 +67,4 @@ function s.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
\ No newline at end of file
end
......@@ -81,4 +81,4 @@ function s.thop(e,tp,eg,ep,ev,re,r,rp)
if tc:IsRelateToChain() and aux.NecroValleyFilter()(tc) then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
end
end
\ No newline at end of file
end
......@@ -106,4 +106,4 @@ function s.cpop(e,tp,eg,ep,ev,re,r,rp)
if op then op(e,tp,eg,ep,ev,re,r,rp) end
Duel.BreakEffect()
Duel.SendtoDeck(te:GetHandler(),nil,SEQ_DECKSHUFFLE,REASON_EFFECT)
end
\ No newline at end of file
end
......@@ -61,4 +61,4 @@ function s.activate(e,tp,eg,ep,ev,re,r,rp)
end
function s.splimit(e,c)
return not c:IsSetCard(0x114)
end
\ No newline at end of file
end
......@@ -100,4 +100,4 @@ function s.activate(e,tp,eg,ep,ev,re,r,rp)
tc:RegisterEffect(e1,true)
tc:CompleteProcedure()
end
end
\ No newline at end of file
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