Commit b8356b35 authored by wind2009's avatar wind2009

Fix

parent 957a75cf
Pipeline #43468 passed with stages
in 3 minutes and 38 seconds
...@@ -23,6 +23,7 @@ function s.initial_effect(c) ...@@ -23,6 +23,7 @@ function s.initial_effect(c)
e3:SetDescription(aux.Stringid(id,1)) e3:SetDescription(aux.Stringid(id,1))
e3:SetCategory(CATEGORY_SEARCH+CATEGORY_SPECIAL_SUMMON+CATEGORY_TOHAND+CATEGORY_DECKDES+CATEGORY_GRAVE_ACTION+CATEGORY_GRAVE_SPSUMMON) e3:SetCategory(CATEGORY_SEARCH+CATEGORY_SPECIAL_SUMMON+CATEGORY_TOHAND+CATEGORY_DECKDES+CATEGORY_GRAVE_ACTION+CATEGORY_GRAVE_SPSUMMON)
e3:SetType(EFFECT_TYPE_QUICK_O) e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e3:SetCode(EVENT_CHAINING) e3:SetCode(EVENT_CHAINING)
e3:SetRange(LOCATION_MZONE) e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1,EFFECT_COUNT_CODE_SINGLE) e3:SetCountLimit(1,EFFECT_COUNT_CODE_SINGLE)
...@@ -88,7 +89,7 @@ function s.thop(e,tp,eg,ep,ev,re,r,rp) ...@@ -88,7 +89,7 @@ function s.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.SendtoHand(oc,nil,REASON_EFFECT) Duel.SendtoHand(oc,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,oc) Duel.ConfirmCards(1-tp,oc)
res=oc:IsLocation(LOCATION_HAND) res=oc:IsLocation(LOCATION_HAND)
else elseif ft>0 and oc:IsCanBeSpecialSummoned(e,0,tp,false,false) then
res=Duel.SpecialSummon(oc,0,tp,tp,false,false,POS_FACEUP)>0 res=Duel.SpecialSummon(oc,0,tp,tp,false,false,POS_FACEUP)>0
end end
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
......
...@@ -10,6 +10,7 @@ function s.initial_effect(c) ...@@ -10,6 +10,7 @@ function s.initial_effect(c)
e1:SetCode(EVENT_FREE_CHAIN) e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,id+EFFECT_COUNT_CODE_OATH) e1:SetCountLimit(1,id+EFFECT_COUNT_CODE_OATH)
e1:SetHintTiming(TIMING_DRAW_PHASE,TIMING_DRAW_PHASE+TIMINGS_CHECK_MONSTER+TIMING_END_PHASE) e1:SetHintTiming(TIMING_DRAW_PHASE,TIMING_DRAW_PHASE+TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e1:SetCondition(s.condition)
e1:SetTarget(s.target) e1:SetTarget(s.target)
e1:SetOperation(s.activate) e1:SetOperation(s.activate)
c:RegisterEffect(e1) c:RegisterEffect(e1)
...@@ -17,6 +18,12 @@ end ...@@ -17,6 +18,12 @@ end
function s.spfilter2(c,e,tp) function s.spfilter2(c,e,tp)
return c:IsRace(RACE_SPELLCASTER) and c:IsAttribute(ATTRIBUTE_DARK) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) return c:IsRace(RACE_SPELLCASTER) and c:IsAttribute(ATTRIBUTE_DARK) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end end
function s.condition(e,tp,eg,ep,ev,re,r,rp)
local b1=Duel.IsExistingMatchingCard(s.spfilter2,tp,LOCATION_HAND+LOCATION_DECK,0,1,nil,e,tp)
local b2=Duel.IsPlayerCanSpecialSummon(1-tp) and
(Duel.GetFieldGroupCount(tp,0,LOCATION_DECK)>0 or Duel.IsExistingMatchingCard(aux.NOT(Card.IsPublic),tp,0,LOCATION_HAND,1,nil))
return b1 or b2
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 return true end if chk==0 then return true end
end end
...@@ -25,43 +32,31 @@ function s.thfilter(c) ...@@ -25,43 +32,31 @@ function s.thfilter(c)
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 c=e:GetHandler() local c=e:GetHandler()
local g1=Group.CreateGroup()
local g2=Group.CreateGroup()
if Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(s.spfilter2,tp,LOCATION_HAND+LOCATION_DECK,0,1,nil,e,tp)
and Duel.SelectYesNo(tp,aux.Stringid(id,1)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
g1=Duel.SelectMatchingCard(tp,s.spfilter2,tp,LOCATION_HAND+LOCATION_DECK,0,1,1,nil,e,tp)
end
if Duel.GetLocationCount(1-tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(s.spfilter2,1-tp,LOCATION_HAND+LOCATION_DECK,0,1,nil,e,1-tp)
and Duel.SelectYesNo(1-tp,aux.Stringid(id,1)) then
Duel.Hint(HINT_SELECTMSG,1-tp,HINTMSG_SPSUMMON)
g2=Duel.SelectMatchingCard(1-tp,s.spfilter2,1-tp,LOCATION_HAND+LOCATION_DECK,0,1,1,nil,e,1-tp)
end
local res=false local res=false
if g1:GetCount()>0 then local ss=false
local tc=g1:GetFirst() for p in aux.TurnPlayers() do
Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP) if Duel.GetLocationCount(p,LOCATION_MZONE)>0
local e1=Effect.CreateEffect(c) and Duel.IsExistingMatchingCard(s.spfilter2,p,LOCATION_HAND+LOCATION_DECK,0,1,nil,e,p)
e1:SetType(EFFECT_TYPE_SINGLE) and Duel.SelectYesNo(p,aux.Stringid(id,1)) then
e1:SetCode(EFFECT_CANNOT_TRIGGER) Duel.Hint(HINT_SELECTMSG,p,HINTMSG_SPSUMMON)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END) local sc=Duel.SelectMatchingCard(p,s.spfilter2,p,LOCATION_HAND+LOCATION_DECK,0,1,1,nil,e,p):GetFirst()
tc:RegisterEffect(e1) if Duel.SpecialSummonStep(sc,0,p,p,false,false,POS_FACEUP) then
res=tc:IsOriginalCodeRule(46986414) or tc:IsOriginalCodeRule(38033121) ss=true
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_TRIGGER)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
sc:RegisterEffect(e1)
if p==tp then
res=sc:IsOriginalCodeRule(46986414,38033121)
end
end
end
end end
if g2:GetCount()>0 then if ss then
local tc=g2:GetFirst() Duel.SpecialSummonComplete()
Duel.SpecialSummonStep(tc,0,1-tp,1-tp,false,false,POS_FACEUP)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_CANNOT_TRIGGER)
e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e2)
end end
Duel.SpecialSummonComplete() if res and Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil)
if res
and Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil)
and Duel.SelectYesNo(tp,aux.Stringid(id,2)) then and Duel.SelectYesNo(tp,aux.Stringid(id,2)) then
Duel.BreakEffect() Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
......
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