Commit e190cc55 authored by POLYMER's avatar POLYMER

fix

parent e6958ec4
...@@ -9,12 +9,12 @@ function s.initial_effect(c) ...@@ -9,12 +9,12 @@ function s.initial_effect(c)
e1:SetTarget(s.target) e1:SetTarget(s.target)
e1:SetOperation(s.activate) e1:SetOperation(s.activate)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--back --back
local e3=Effect.CreateEffect(c) local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(id,0)) e3:SetDescription(aux.Stringid(id,0))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON) e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_QUICK_O) e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN) e3:SetCode(EVENT_FREE_CHAIN)
e3:SetRange(0x30) e3:SetRange(0x30)
e3:SetCountLimit(1,id) e3:SetCountLimit(1,id)
e3:SetCost(s.spcost) e3:SetCost(s.spcost)
...@@ -25,82 +25,82 @@ end ...@@ -25,82 +25,82 @@ 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 Duel.IsPlayerCanDiscardDeck(tp,3) end if chk==0 then return Duel.IsPlayerCanDiscardDeck(tp,3) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,0,LOCATION_DECK) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,0,LOCATION_DECK)
getmetatable(e:GetHandler()).announce_filter={TYPE_RITUAL,OPCODE_ISTYPE,TYPE_SPELL+TYPE_TRAP,OPCODE_ISTYPE,OPCODE_NOT,OPCODE_AND} getmetatable(e:GetHandler()).announce_filter={TYPE_RITUAL,OPCODE_ISTYPE,TYPE_SPELL+TYPE_TRAP,OPCODE_ISTYPE,OPCODE_NOT,OPCODE_AND}
local ac=Duel.AnnounceCard(tp,table.unpack(getmetatable(e:GetHandler()).announce_filter)) local ac=Duel.AnnounceCard(tp,table.unpack(getmetatable(e:GetHandler()).announce_filter))
e:SetLabel(ac) e:SetLabel(ac)
end end
function s.filter(c,e,tp) function s.filter(c,e,tp)
return c:IsCanBeSpecialSummoned(e,0,tp,true,true) and c:IsType(TYPE_RITUAL) return c:IsCanBeSpecialSummoned(e,0,tp,true,true) and c:IsType(TYPE_RITUAL+TYPE_MONSTER)
end end
function s.cdfilter(c,code) function s.cdfilter(c,code)
return c:IsCode(13000757) or c:IsCode(code) return c:IsCode(13000757) or c:IsCode(code)
end end
function s.rlfilter(c) function s.rlfilter(c)
return c:IsReleasable() and c:IsType(TYPE_RITUAL) return c:IsReleasable() and c:IsType(TYPE_RITUAL)
and c:IsType(TYPE_MONSTER+TYPE_SPELL) and c:IsType(TYPE_MONSTER+TYPE_SPELL)
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 cid=e:GetLabel() local cid=e:GetLabel()
local RspCheck=false local RspCheck=false
if Duel.IsPlayerCanDiscardDeck(tp,3) then if Duel.IsPlayerCanDiscardDeck(tp,3) then
Duel.ConfirmDecktop(tp,3) Duel.ConfirmDecktop(tp,3)
local g=Duel.GetDecktopGroup(tp,3) local g=Duel.GetDecktopGroup(tp,3)
if g:GetCount()>0 then if g:GetCount()>0 then
if g:IsExists(s.cdfilter,1,nil,cid) then RspCheck=true end if g:IsExists(s.cdfilter,1,nil,cid) then RspCheck=true end
if g:IsExists(s.filter,1,nil,e,tp) and Duel.GetLocationCount(tp,0x04)>0 and Duel.SelectYesNo(tp,aux.Stringid(id,0)) then if g:IsExists(s.filter,1,nil,e,tp) and Duel.GetLocationCount(tp,0x04)>0 and Duel.SelectYesNo(tp,aux.Stringid(id,0)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=g:FilterSelect(tp,s.filter,1,1,nil,e,tp) local sg=g:FilterSelect(tp,s.filter,1,1,nil,e,tp)
local tc=sg:GetFirst() local tc=sg:GetFirst()
if RspCheck and Duel.SelectYesNo(tp,aux.Stringid(id,1)) then if RspCheck and Duel.SelectYesNo(tp,aux.Stringid(id,1)) then
Duel.SpecialSummon(tc,SUMMON_TYPE_RITUAL,tp,tp,true,true,POS_FACEUP) Duel.SpecialSummon(tc,SUMMON_TYPE_RITUAL,tp,tp,true,true,POS_FACEUP)
tc:CompleteProcedure() tc:CompleteProcedure()
else else
if Duel.SpecialSummonStep(tc,0,tp,tp,true,true,POS_FACEUP) then if Duel.SpecialSummonStep(tc,0,tp,tp,true,true,POS_FACEUP) then
Duel.NegateRelatedChain(tc,RESET_TURN_SET) Duel.NegateRelatedChain(tc,RESET_TURN_SET)
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DISABLE) e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD) e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1) tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE) e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DISABLE_EFFECT) e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetValue(RESET_TURN_SET) e2:SetValue(RESET_TURN_SET)
e2:SetReset(RESET_EVENT+RESETS_STANDARD) e2:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e2) tc:RegisterEffect(e2)
Duel.SpecialSummonComplete() Duel.SpecialSummonComplete()
end end
end end
g:Sub(sg) g:Sub(sg)
end end
local rg=g:Filter(s.rlfilter,nil) local rg=g:Filter(s.rlfilter,nil)
if #rg>0 then if #rg>0 then
Duel.Release(rg,REASON_EFFECT) Duel.Release(rg,REASON_EFFECT)
end end
Duel.ShuffleDeck(tp) Duel.ShuffleDeck(tp)
end end
end end
end end
function s.spcost(e,tp,eg,ep,ev,re,r,rp,chk) function s.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,0x02,0,1,nil) if chk==0 then return Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,0x02,0,1,nil)
and e:GetHandler():IsAbleToDeckAsCost() end and e:GetHandler():IsAbleToDeckAsCost() end
Duel.DiscardHand(tp,Card.IsDiscardable,1,1,REASON_COST+REASON_DISCARD) Duel.DiscardHand(tp,Card.IsDiscardable,1,1,REASON_COST+REASON_DISCARD)
Duel.SendtoDeck(e:GetHandler(),nil,2,REASON_COST) Duel.SendtoDeck(e:GetHandler(),nil,2,REASON_COST)
end end
function s.mfilter(c) function s.mfilter(c)
return c:IsType(TYPE_MONSTER) and c:IsType(TYPE_RITUAL) return c:IsType(TYPE_MONSTER) and c:IsType(TYPE_RITUAL)
end end
function s.filter2(c,e,tp,m,f,chkf) function s.filter2(c,e,tp,m,f,chkf)
return c:IsType(TYPE_FUSION) and (not f or f(c)) return c:IsType(TYPE_FUSION) and (not f or f(c))
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.spop(e,tp,eg,ep,ev,re,r,rp) function s.spop(e,tp,eg,ep,ev,re,r,rp)
s.activate(e,tp,eg,ep,ev,re,r,rp) s.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.BreakEffect() Duel.BreakEffect()
local mg=Duel.GetMatchingGroup(s.mfilter,tp,0x06,0,nil) local mg=Duel.GetMatchingGroup(s.mfilter,tp,0x06,0,nil)
local lg=Duel.GetMatchingGroup(Card.IsLinkSummonable,tp,0x40,0,nil,mg,c) local lg=Duel.GetMatchingGroup(Card.IsLinkSummonable,tp,0x40,0,nil,mg,c)
local res=Duel.IsExistingMatchingCard(s.filter2,tp,0x40,0,1,nil,e,tp,mg,c,chkf) local res=Duel.IsExistingMatchingCard(s.filter2,tp,0x40,0,1,nil,e,tp,mg,c,chkf)
if not res then if not res then
local ce=Duel.GetChainMaterial(tp) local ce=Duel.GetChainMaterial(tp)
if ce~=nil then if ce~=nil then
...@@ -110,15 +110,15 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp) ...@@ -110,15 +110,15 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp)
res=Duel.IsExistingMatchingCard(s.filter2,tp,0x40,0,1,nil,e,tp,mg2,mf,c,chkf) res=Duel.IsExistingMatchingCard(s.filter2,tp,0x40,0,1,nil,e,tp,mg2,mf,c,chkf)
end end
end end
local op=2 local op=2
if #lg>0 and res then op=Duel.SelectOption(tp,aux.Stringid(id,2),aux.Stringid(id,3),aux.Stringid(id,4)) if #lg>0 and res then op=Duel.SelectOption(tp,aux.Stringid(id,2),aux.Stringid(id,3),aux.Stringid(id,4))
elseif res then op=Duel.SelectOption(tp,aux.Stringid(id,2),aux.Stringid(id,4)) if op==1 then op=2 end elseif res then op=Duel.SelectOption(tp,aux.Stringid(id,2),aux.Stringid(id,4)) if op==1 then op=2 end
elseif #lg>0 then op=Duel.SelectOption(tp,aux.Stringid(id,3),aux.Stringid(id,4))+1 elseif #lg>0 then op=Duel.SelectOption(tp,aux.Stringid(id,3),aux.Stringid(id,4))+1
else return end else return end
if op==0 then if op==0 then
s.fusion(e,tp,eg,ep,ev,re,r,rp,mg) s.fusion(e,tp,eg,ep,ev,re,r,rp,mg)
end end
if op==1 then if op==1 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=lg:Select(tp,1,1,nil) local sg=lg:Select(tp,1,1,nil)
Duel.LinkSummon(tp,sg:GetFirst(),mg,c) Duel.LinkSummon(tp,sg:GetFirst(),mg,c)
...@@ -128,7 +128,7 @@ function s.fusion(e,tp,eg,ep,ev,re,r,rp,mg) ...@@ -128,7 +128,7 @@ function s.fusion(e,tp,eg,ep,ev,re,r,rp,mg)
local c=e:GetHandler() local c=e:GetHandler()
local chkf=tp local chkf=tp
local mg1=Group.CreateGroup() local mg1=Group.CreateGroup()
mg1:Merge(mg) mg1:Merge(mg)
local sg1=Duel.GetMatchingGroup(s.filter2,tp,0x40,0,nil,e,tp,mg1,nil,c,chkf) local sg1=Duel.GetMatchingGroup(s.filter2,tp,0x40,0,nil,e,tp,mg1,nil,c,chkf)
local mg2=nil local mg2=nil
local sg2=nil local sg2=nil
......
...@@ -36,7 +36,7 @@ function s.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -36,7 +36,7 @@ function s.activate(e,tp,eg,ep,ev,re,r,rp)
e1:SetType(EFFECT_TYPE_FIELD) e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_UPDATE_ATTACK) e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetTargetRange(LOCATION_MZONE,0) e1:SetTargetRange(LOCATION_MZONE,0)
e1:SetValue(1500) e1:SetValue(800)
e1:SetReset(RESET_PHASE+PHASE_END,2) e1:SetReset(RESET_PHASE+PHASE_END,2)
Duel.RegisterEffect(e1,tp) Duel.RegisterEffect(e1,tp)
end end
...@@ -56,13 +56,14 @@ function s.rlop(e,tp,eg,ep,ev,re,r,rp) ...@@ -56,13 +56,14 @@ function s.rlop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
local code=tc:GetCode() local code=tc:GetCode()
local cs=_G["c"..code] local cs=_G["c"..code]
Duel.SSet(tp,tc,tp,true) if Duel.SSet(tp,tc,tp,true) then
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_QP_ACT_IN_SET_TURN) e1:SetCode(EFFECT_QP_ACT_IN_SET_TURN)
e1:SetProperty(EFFECT_FLAG_SET_AVAILABLE) e1:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET) e1:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET)
tc:RegisterEffect(e1) tc:RegisterEffect(e1)
end
--copy effect --copy effect
if tc:IsType(TYPE_QUICKPLAY) then return end if tc:IsType(TYPE_QUICKPLAY) then return end
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
...@@ -72,18 +73,13 @@ function s.rlop(e,tp,eg,ep,ev,re,r,rp) ...@@ -72,18 +73,13 @@ function s.rlop(e,tp,eg,ep,ev,re,r,rp)
e2:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET) e2:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET)
e2:SetValue(TYPE_QUICKPLAY) e2:SetValue(TYPE_QUICKPLAY)
tc:RegisterEffect(e2) tc:RegisterEffect(e2)
local e3=Effect.CreateEffect(c) tc:RegisterFlagEffect(0,RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(id,0))
e3:SetDescription(aux.Stringid(id,1)) local eff=tc:GetActivateEffect()
e3:SetType(EFFECT_TYPE_QUICK_O+EFFECT_TYPE_ACTIVATE) local eff2=eff:Clone()
e3:SetCode(EVENT_FREE_CHAIN) eff:SetDescription(aux.Stringid(id,0))
e3:SetRange(LOCATION_SZONE) eff2:SetProperty(eff2:GetProperty(),EFFECT_FLAG2_COF)
e3:SetProperty(EFFECT_FLAG_SET_AVAILABLE) eff2:SetHintTiming(TIMING_END_PHASE,TIMING_END_PHASE)
e3:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE) eff2:SetReset(RESET_EVENT+RESETS_STANDARD)
e3:SetCountLimit(1,code+EFFECT_COUNT_CODE_OATH) tc:RegisterEffect(eff2)
e3:SetTarget(cs.target)
e3:SetOperation(cs.activate)
e3:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET)
tc:RegisterEffect(e3)
end end
end end
...@@ -6,7 +6,7 @@ function cm.initial_effect(c) ...@@ -6,7 +6,7 @@ function cm.initial_effect(c)
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH) e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN) e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCost(cm.cost) --e1:SetCost(cm.cost)
e1:SetTarget(cm.target) e1:SetTarget(cm.target)
e1:SetOperation(cm.activate) e1:SetOperation(cm.activate)
c:RegisterEffect(e1) c:RegisterEffect(e1)
...@@ -15,6 +15,7 @@ function cm.initial_effect(c) ...@@ -15,6 +15,7 @@ function cm.initial_effect(c)
e2:SetDescription(aux.Stringid(m,0)) e2:SetDescription(aux.Stringid(m,0))
e2:SetType(EFFECT_TYPE_SINGLE) e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_QP_ACT_IN_NTPHAND) e2:SetCode(EFFECT_QP_ACT_IN_NTPHAND)
e2:SetCost(cm.cost)
e2:SetCondition(cm.handcon) e2:SetCondition(cm.handcon)
c:RegisterEffect(e2) c:RegisterEffect(e2)
end end
...@@ -45,9 +46,10 @@ function cm.handcon(e) ...@@ -45,9 +46,10 @@ function cm.handcon(e)
end end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk) function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetTurnPlayer()==tp or Duel.IsExistingMatchingCard(cm.hcfil,tp,LOCATION_HAND,0,1,nil) end if chk==0 then return Duel.GetTurnPlayer()==tp or Duel.IsExistingMatchingCard(cm.hcfil,tp,LOCATION_HAND,0,1,nil) end
if Duel.GetTurnPlayer()==tp then e:SetLabel(1)
e:SetLabel(1) if Duel.GetTurnPlayer()~=tp then
else --e:SetLabel(1)
--else
e:SetLabel(2) e:SetLabel(2)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM)
local g=Duel.GetMatchingGroup(cm.hcfil,tp,LOCATION_HAND,0,nil):Select(tp,1,1,nil) local g=Duel.GetMatchingGroup(cm.hcfil,tp,LOCATION_HAND,0,nil):Select(tp,1,1,nil)
......
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