Commit 73b9e48c authored by Huangnan's avatar Huangnan

fix

parent f26f9dea
No preview for this file type
...@@ -65,19 +65,17 @@ function cm.operation(e,tp,eg,ep,ev,re,r,rp) ...@@ -65,19 +65,17 @@ function cm.operation(e,tp,eg,ep,ev,re,r,rp)
e2:SetDescription(aux.Stringid(m,5)) e2:SetDescription(aux.Stringid(m,5))
e2:SetType(EFFECT_TYPE_FIELD) e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_QP_ACT_IN_NTPHAND) e2:SetCode(EFFECT_QP_ACT_IN_NTPHAND)
e2:SetRange(LOCATION_SZONE)
e2:SetTargetRange(LOCATION_HAND,0) e2:SetTargetRange(LOCATION_HAND,0)
e2:Reset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,2) e2:Reset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,2)
c:RegisterEffect(e2) Duel.RegisterEffect(e2,tp)
local e3=Effect.CreateEffect(c) local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,5)) e3:SetDescription(aux.Stringid(m,5))
e3:SetType(EFFECT_TYPE_FIELD) e3:SetType(EFFECT_TYPE_FIELD)
e3:SetProperty(EFFECT_FLAG_SET_AVAILABLE) e3:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
e3:SetCode(EFFECT_QP_ACT_IN_SET_TURN) e3:SetCode(EFFECT_QP_ACT_IN_SET_TURN)
e3:SetRange(LOCATION_SZONE)
e3:SetTargetRange(LOCATION_SZONE,0) e3:SetTargetRange(LOCATION_SZONE,0)
e3:Reset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,2) e3:Reset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,2)
c:RegisterEffect(e3) Duel.RegisterEffect(e2,tp)
end end
function cm.tftg(e,tp,eg,ep,ev,re,r,rp,chk) function cm.tftg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0 end if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0 end
......
...@@ -52,7 +52,7 @@ function s.operation(e,tp,eg,ep,ev,re,r,rp) ...@@ -52,7 +52,7 @@ function s.operation(e,tp,eg,ep,ev,re,r,rp)
local te,code=Duel.GetChainInfo(i,CHAININFO_TRIGGERING_EFFECT,CHAININFO_TRIGGERING_CODE) local te,code=Duel.GetChainInfo(i,CHAININFO_TRIGGERING_EFFECT,CHAININFO_TRIGGERING_CODE)
if tc:GetCode()==code then if tc:GetCode()==code then
--local g=Duel.GetMatchingGroup(s.nefilter,tp,0,LOCATION_GRAVE+LOCATION_ONFIELD+LOCATION_HAND,nil,code) --local g=Duel.GetMatchingGroup(s.nefilter,tp,0,LOCATION_GRAVE+LOCATION_ONFIELD+LOCATION_HAND,nil,code)
if Duel.SelectYesNo(tp,aux.Stringid(id,1)) and Duel.IsExistingMatchingCard(s.cfilter,e:GetHandlerPlayer(),LOCATION_ONFIELD,0,1,nil) then if Duel.IsExistingMatchingCard(s.cfilter,e:GetHandlerPlayer(),LOCATION_ONFIELD,0,1,nil) and Duel.SelectYesNo(tp,aux.Stringid(id,1)) then
Duel.BreakEffect() Duel.BreakEffect()
Duel.NegateEffect(i) Duel.NegateEffect(i)
......
...@@ -69,7 +69,7 @@ function s.pfilter(c) ...@@ -69,7 +69,7 @@ function s.pfilter(c)
end end
function s.operation(e,tp,eg,ep,ev,re,r,rp) function s.operation(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.SelectMatchingCard(tp,nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil) local g=Duel.SelectMatchingCard(tp,nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
Duel.Destroy(g,REASON_EFFECT) if Duel.Destroy(g,REASON_EFFECT) ==0 then return end
local c=e:GetHandler() local c=e:GetHandler()
local count = c:GetLinkedGroupCount() local count = c:GetLinkedGroupCount()
if count > 0 and Duel.IsExistingMatchingCard(s.pfilter,e:GetHandlerPlayer(),LOCATION_GRAVE+LOCATION_HAND,0,1,nil) and Duel.SelectYesNo(tp,aux.Stringid(id,1)) then if count > 0 and Duel.IsExistingMatchingCard(s.pfilter,e:GetHandlerPlayer(),LOCATION_GRAVE+LOCATION_HAND,0,1,nil) and Duel.SelectYesNo(tp,aux.Stringid(id,1)) then
......
...@@ -20,7 +20,7 @@ function cm.initial_effect(c) ...@@ -20,7 +20,7 @@ function cm.initial_effect(c)
e2:SetRange(LOCATION_ONFIELD) e2:SetRange(LOCATION_ONFIELD)
e2:SetTargetRange(0,LOCATION_MZONE) e2:SetTargetRange(0,LOCATION_MZONE)
e2:SetValue(cm.etarget) e2:SetValue(cm.etarget)
Duel.RegisterEffect(e2,tp) c:RegisterEffect(e2)
local e7=Effect.CreateEffect(c) local e7=Effect.CreateEffect(c)
e7:SetType(EFFECT_TYPE_FIELD) e7:SetType(EFFECT_TYPE_FIELD)
e7:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET) e7:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
......
...@@ -18,8 +18,9 @@ function cm.initial_effect(c) ...@@ -18,8 +18,9 @@ function cm.initial_effect(c)
e2:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND) e2:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_TO_GRAVE) e2:SetCode(EVENT_TO_GRAVE)
e2:SetProperty(EFFECT_FLAG_DELAY) e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e2:SetCountLimit(1,m+100) e2:SetCountLimit(1,m+100)
e2:SetCondition(cm.spcon)
e2:SetTarget(cm.sptg) e2:SetTarget(cm.sptg)
e2:SetOperation(cm.spop) e2:SetOperation(cm.spop)
c:RegisterEffect(e2) c:RegisterEffect(e2)
...@@ -31,7 +32,7 @@ function cm.initial_effect(c) ...@@ -31,7 +32,7 @@ function cm.initial_effect(c)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e4:SetCode(EVENT_FREE_CHAIN) e4:SetCode(EVENT_FREE_CHAIN)
e4:SetRange(LOCATION_ONFIELD) e4:SetRange(LOCATION_ONFIELD)
e4:SetCountLimit(1) e4:SetCondition(cm.rmcon)
e4:SetOperation(cm.rmop) e4:SetOperation(cm.rmop)
c:RegisterEffect(e4) c:RegisterEffect(e4)
end end
...@@ -51,6 +52,10 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -51,6 +52,10 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.SpecialSummon(c,SUMMON_VALUE_SELF,tp,tp,true,false,POS_FACEUP) Duel.SpecialSummon(c,SUMMON_VALUE_SELF,tp,tp,true,false,POS_FACEUP)
end end
--tohand --tohand
function cm.spcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsPreviousLocation(LOCATION_MZONE) and c:IsPreviousPosition(POS_FACEUP)
end
function cm.spfilter(c,e,tp) function cm.spfilter(c,e,tp)
return c:IsAbleToHand() and c:IsSetCard(0x3596) and c:IsType(TYPE_MONSTER) return c:IsAbleToHand() and c:IsSetCard(0x3596) and c:IsType(TYPE_MONSTER)
end end
...@@ -68,15 +73,21 @@ function cm.spop(e,tp,eg,ep,ev,re,r,rp) ...@@ -68,15 +73,21 @@ function cm.spop(e,tp,eg,ep,ev,re,r,rp)
end end
end end
--remove --remove
function cm.rmcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return Duel.GetTurnPlayer()==tp and c:GetFlagEffect(m)<1 and Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) and Duel.IsExistingMatchingCard(cm.rmfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil)
end
function cm.rmfilter(c) function cm.rmfilter(c)
return c:IsSetCard(0x3596) and c:IsFaceup() return c:IsSetCard(0x3596) and c:IsFaceup()
end end
function cm.rmop(e,tp,eg,ep,ev,re,r,rp) function cm.rmop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
if Duel.IsExistingMatchingCard(cm.rmfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) and Duel.SelectYesNo(tp,aux.Stringid(m,0)) then if Duel.SelectYesNo(tp,aux.Stringid(m,0)) then
Duel.Hint(HINTMSG_SELECT,tp,HINTMSG_REMOVE) Duel.Hint(HINTMSG_SELECT,tp,HINTMSG_REMOVE)
local rg=Duel.GetFieldGroup(tp,LOCATION_ONFIELD,LOCATION_ONFIELD):Select(tp,1,1,nil) local rg=Duel.GetMatchingGroup(Card.IsAbleToRemove,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil):Select(tp,1,1,nil)
Duel.HintSelection(rg)
Duel.Remove(rg,POS_FACEUP,REASON_EFFECT) Duel.Remove(rg,POS_FACEUP,REASON_EFFECT)
c:RegisterFlagEffect(m,RESET_PHASE+PHASE_END+RESET_EVENT+RESETS_STANDARD,0,0)
end end
end end
......
...@@ -55,11 +55,13 @@ function cm.operation(e,tp,eg,ep,ev,re,r,rp) ...@@ -55,11 +55,13 @@ function cm.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.ConfirmCards(1-tp,g) Duel.ConfirmCards(1-tp,g)
--act in hand --act in hand
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,3))
e1:SetType(EFFECT_TYPE_FIELD) e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_QP_ACT_IN_NTPHAND) e1:SetCode(EFFECT_QP_ACT_IN_NTPHAND)
e1:SetTarget(aux.TargetBoolFunction(Card.IsSetCard,0x596)) e1:SetTarget(aux.TargetBoolFunction(Card.IsSetCard,0x596))
e1:SetTargetRange(LOCATION_HAND,0) e1:SetTargetRange(LOCATION_HAND,0)
e1:SetCountLimit(1) e1:SetCountLimit(1)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp) Duel.RegisterEffect(e1,tp)
local e2=e1:Clone() local e2=e1:Clone()
e2:SetCode(EFFECT_TRAP_ACT_IN_HAND) e2:SetCode(EFFECT_TRAP_ACT_IN_HAND)
......
...@@ -45,7 +45,7 @@ function cm.initial_effect(c) ...@@ -45,7 +45,7 @@ function cm.initial_effect(c)
e5:SetType(EFFECT_TYPE_QUICK_O) e5:SetType(EFFECT_TYPE_QUICK_O)
e5:SetCode(EVENT_FREE_CHAIN) e5:SetCode(EVENT_FREE_CHAIN)
e5:SetRange(LOCATION_MZONE) e5:SetRange(LOCATION_MZONE)
e5:SetCountLimit(1) e5:SetCountLimit(1,m)
e5:SetCost(cm.cost) e5:SetCost(cm.cost)
e5:SetTarget(cm.target) e5:SetTarget(cm.target)
e5:SetOperation(cm.operation) e5:SetOperation(cm.operation)
...@@ -57,7 +57,7 @@ function cm.initial_effect(c) ...@@ -57,7 +57,7 @@ function cm.initial_effect(c)
e6:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e6:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e6:SetProperty(EFFECT_FLAG_DELAY) e6:SetProperty(EFFECT_FLAG_DELAY)
e6:SetCode(EVENT_SPSUMMON_SUCCESS) e6:SetCode(EVENT_SPSUMMON_SUCCESS)
e6:SetCountLimit(1,m) e6:SetCountLimit(1,m+100)
e6:SetTarget(cm.thtg) e6:SetTarget(cm.thtg)
e6:SetOperation(cm.thop) e6:SetOperation(cm.thop)
c:RegisterEffect(e6) c:RegisterEffect(e6)
......
...@@ -16,7 +16,6 @@ function cm.initial_effect(c) ...@@ -16,7 +16,6 @@ function cm.initial_effect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_FREE_CHAIN) e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_ONFIELD) e2:SetRange(LOCATION_ONFIELD)
e2:SetCountLimit(1,m)
e2:SetCondition(cm.repcon) e2:SetCondition(cm.repcon)
e2:SetOperation(cm.repop) e2:SetOperation(cm.repop)
c:RegisterEffect(e2) c:RegisterEffect(e2)
...@@ -55,17 +54,19 @@ function cm.acttg(e,c) ...@@ -55,17 +54,19 @@ function cm.acttg(e,c)
end end
--replace --replace
function cm.repfilter(c) function cm.repfilter(c)
return c:IsSetCard(0x5596) and c:IsType(TYPE_TRAP) and c:IsType(TYPE_CONTINUOUS) return c:IsSetCard(0x5596) and c:IsType(TYPE_TRAP) and c:IsType(TYPE_CONTINUOUS) and c:CheckActivateEffect(false,true,false)~=nil
end end
function cm.repcon(e,tp,eg,ep,ev,re,r,rp) function cm.repcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(cm.repfilter,tp,LOCATION_GRAVE,0,1,1,nil) return Duel.GetTurnPlayer()==tp and Duel.IsExistingMatchingCard(cm.repfilter,tp,LOCATION_GRAVE,0,1,nil)
end end
function cm.repop(e,tp,eg,ep,ev,re,r,rp) function cm.repop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
local g=Duel.GetMatchingGroup(cm.repfilter,tp,LOCATION_GRAVE,0,nil) local g=Duel.GetMatchingGroup(cm.repfilter,tp,LOCATION_GRAVE,0,nil)
if #g>0 and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then
Duel.Hint(HINTMSG_SELECT,tp,HINTMSG_OPERATECARD) Duel.Hint(HINTMSG_SELECT,tp,HINTMSG_OPERATECARD)
local tc=g:Select(tp,1,1,nil):GetFirst() local tg=g:Select(tp,1,1,nil)
Duel.HintSelection(tg)
local tc=tg:GetFirst()
c:CreateEffectRelation(e) c:CreateEffectRelation(e)
tc:CreateEffectRelation(e) tc:CreateEffectRelation(e)
local te,ceg,cep,cev,cre,cr,crp=tc:CheckActivateEffect(false,true,true) local te,ceg,cep,cev,cre,cr,crp=tc:CheckActivateEffect(false,true,true)
......
...@@ -17,7 +17,6 @@ function cm.initial_effect(c) ...@@ -17,7 +17,6 @@ function cm.initial_effect(c)
e2:SetDescription(aux.Stringid(m,6)) e2:SetDescription(aux.Stringid(m,6))
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_FREE_CHAIN) e2:SetCode(EVENT_FREE_CHAIN)
e2:SetCountLimit(1)
e2:SetRange(LOCATION_FZONE) e2:SetRange(LOCATION_FZONE)
e2:SetCondition(cm.recon) e2:SetCondition(cm.recon)
e2:SetOperation(cm.reop) e2:SetOperation(cm.reop)
...@@ -45,7 +44,8 @@ function cm.stfilter(c) ...@@ -45,7 +44,8 @@ function cm.stfilter(c)
return c:IsSetCard(0x596) and c:IsSSetable() and c:IsType(TYPE_TRAP+TYPE_SPELL) return c:IsSetCard(0x596) and c:IsSSetable() and c:IsType(TYPE_TRAP+TYPE_SPELL)
end end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk) function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return (Duel.IsExistingMatchingCard(cm.stfilter,tp,LOCATION_DECK,0,1,nil) and Duel.GetLocationCount(tp,LOCATION_SZONE)>0) or (Duel.IsExistingMatchingCard(cm.thfilter,tp,LOCATION_DECK,0,1,nil,e,tp)) end if chk==0 then return Duel.IsExistingMatchingCard(cm.stfilter,tp,LOCATION_DECK,0,1,nil) or (Duel.IsExistingMatchingCard(cm.thfilter,tp,LOCATION_DECK,0,1,nil,e,tp)) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end end
function cm.activate(e,tp,eg,ep,ev,re,r,rp) function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
...@@ -66,6 +66,11 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -66,6 +66,11 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local sg=thg:Select(tp,1,1,nil) local sg=thg:Select(tp,1,1,nil)
Duel.SendtoHand(sg,tp,REASON_EFFECT) Duel.SendtoHand(sg,tp,REASON_EFFECT)
Duel.ConfirmCards(1-tp,sg) Duel.ConfirmCards(1-tp,sg)
elseif ct==2 then
local spg=Duel.GetMatchingGroup(cm.thfilter,tp,LOCATION_DECK,0,nil,e,tp)
Duel.Hint(HINTMSG_SELECT,tp,HINTMSG_SPSUMMON)
local sg=spg:Select(tp,1,1,nil)
Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP)
end end
elseif a and not b and not d then elseif a and not b and not d then
local stg=Duel.GetMatchingGroup(cm.stfilter,tp,LOCATION_DECK,0,nil) local stg=Duel.GetMatchingGroup(cm.stfilter,tp,LOCATION_DECK,0,nil)
...@@ -100,23 +105,31 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -100,23 +105,31 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local sg=thg:Select(tp,1,1,nil) local sg=thg:Select(tp,1,1,nil)
Duel.SendtoHand(sg,tp,REASON_EFFECT) Duel.SendtoHand(sg,tp,REASON_EFFECT)
Duel.ConfirmCards(1-tp,sg) Duel.ConfirmCards(1-tp,sg)
elseif ct==1 then
local spg=Duel.GetMatchingGroup(cm.thfilter,tp,LOCATION_DECK,0,nil,e,tp)
Duel.Hint(HINTMSG_SELECT,tp,HINTMSG_SPSUMMON)
local sg=spg:Select(tp,1,1,nil)
Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP)
end end
end end
end end
--recall --recall
function cm.recon(e,tp,eg,ep,ev,re,r,rp) function cm.recon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==tp local c=e:GetHandler()
return Duel.GetTurnPlayer()==tp and c:GetFlagEffect(m)==0 and Duel.GetMatchingGroupCount(cm.actfilter,tp,LOCATION_SZONE,0,c)>0
end end
function cm.actfilter(c,mc) function cm.actfilter(c,mc)
return c:IsFaceup() and c:IsSetCard(0x3596) and c:IsType(TYPE_SPELL+TYPE_TRAP) and c~=mc return c:IsFaceup() and c:IsSetCard(0x3596) and c:CheckActivateEffect(false,true,false)~=nil and c:IsType(TYPE_SPELL+TYPE_TRAP) and c~=mc
end end
function cm.reop(e,tp,eg,ep,ev,re,r,rp) function cm.reop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
local mc=c local mc=c
local g=Duel.GetMatchingGroup(cm.actfilter,tp,LOCATION_SZONE,0,nil,mc) local g=Duel.GetMatchingGroup(cm.actfilter,tp,LOCATION_SZONE,0,c)
if #g>0 and Duel.SelectYesNo(tp,aux.Stringid(m,0))then if Duel.SelectYesNo(tp,aux.Stringid(m,0))then
Duel.Hint(HINTMSG_SELECT,tp,HINTMSG_OPERATECARD) Duel.Hint(HINTMSG_SELECT,tp,HINTMSG_OPERATECARD)
local tc=g:Select(tp,1,1,nil):GetFirst() local tg=g:Select(tp,1,1,nil)
Duel.HintSelection(tg)
local tc=tg:GetFirst()
c:CreateEffectRelation(e) c:CreateEffectRelation(e)
tc:CreateEffectRelation(e) tc:CreateEffectRelation(e)
local te,ceg,cep,cev,cre,cr,crp=tc:CheckActivateEffect(false,true,true) local te,ceg,cep,cev,cre,cr,crp=tc:CheckActivateEffect(false,true,true)
...@@ -124,6 +137,7 @@ function cm.reop(e,tp,eg,ep,ev,re,r,rp) ...@@ -124,6 +137,7 @@ function cm.reop(e,tp,eg,ep,ev,re,r,rp)
e:SetLabelObject(te) e:SetLabelObject(te)
local op=te:GetOperation() local op=te:GetOperation()
if op then op(e,tp,eg,ep,ev,re,r,rp) end if op then op(e,tp,eg,ep,ev,re,r,rp) end
e:GetHandler():RegisterFlagEffect(m,RESET_PHASE+PHASE_END+RESET_EVENT+RESETS_STANDARD,0,0)
end end
end end
--Set --Set
...@@ -135,10 +149,14 @@ function cm.costfilter2(c,code) ...@@ -135,10 +149,14 @@ function cm.costfilter2(c,code)
return c:IsSetCard(0x596) and (c:IsAbleToHand() or c:IsSSetable()) and c:IsType(TYPE_SPELL+TYPE_TRAP) and not c:IsCode(code) return c:IsSetCard(0x596) and (c:IsAbleToHand() or c:IsSSetable()) and c:IsType(TYPE_SPELL+TYPE_TRAP) and not c:IsCode(code)
end end
function cm.stcost(e,tp,eg,ep,ev,re,r,rp,chk) function cm.stcost(e,tp,eg,ep,ev,re,r,rp,chk)
e:SetLabel(100)
if chk==0 then return true end if chk==0 then return true end
end end
function cm.sttg(e,tp,eg,ep,ev,re,r,rp,chk) function cm.sttg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.costfilter,tp,LOCATION_HAND+LOCATION_ONFIELD,0,1,nil) end if chk==0 then
if e:GetLabel()~=100 then return false end
e:SetLabel(0)
return Duel.IsExistingMatchingCard(cm.costfilter,tp,LOCATION_HAND+LOCATION_ONFIELD,0,1,nil) end
local tc=Duel.SelectMatchingCard(tp,cm.costfilter,tp,LOCATION_HAND+LOCATION_ONFIELD,0,1,1,nil):GetFirst() local tc=Duel.SelectMatchingCard(tp,cm.costfilter,tp,LOCATION_HAND+LOCATION_ONFIELD,0,1,1,nil):GetFirst()
e:SetLabelObject(tc) e:SetLabelObject(tc)
Duel.ConfirmCards(1-tp,tc) Duel.ConfirmCards(1-tp,tc)
......
...@@ -28,7 +28,7 @@ function cm.initial_effect(c) ...@@ -28,7 +28,7 @@ function cm.initial_effect(c)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EVENT_CHAINING) e3:SetCode(EVENT_CHAINING)
e3:SetRange(LOCATION_ONFIELD) e3:SetRange(LOCATION_ONFIELD)
e3:SetCountLimit(1) e3:SetCondition(cm.discon)
e3:SetOperation(cm.disop) e3:SetOperation(cm.disop)
c:RegisterEffect(e3) c:RegisterEffect(e3)
end end
...@@ -83,9 +83,13 @@ function cm.disable(e,c) ...@@ -83,9 +83,13 @@ function cm.disable(e,c)
return c:IsAttribute(ATTRIBUTE_DARK+ATTRIBUTE_LIGHT) return c:IsAttribute(ATTRIBUTE_DARK+ATTRIBUTE_LIGHT)
end end
--disable effect --disable effect
function cm.discon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetFlagEffect(m)<1
end
function cm.disop(e,tp,eg,ep,ev,re,r,rp) function cm.disop(e,tp,eg,ep,ev,re,r,rp)
if Duel.IsChainNegatable(ev) and Duel.SelectYesNo(tp,aux.Stringid(m,2)) then if Duel.IsChainNegatable(ev) and Duel.SelectYesNo(tp,aux.Stringid(m,2)) then
Duel.Hint(HINT_CARD,0,m) Duel.Hint(HINT_CARD,0,m)
Duel.NegateEffect(ev) Duel.NegateEffect(ev)
e:GetHandler():RegisterFlagEffect(m,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,0)
end end
end end
\ No newline at end of file
...@@ -58,12 +58,12 @@ function cm.actop(e,tp,eg,ep,ev,re,r,rp) ...@@ -58,12 +58,12 @@ function cm.actop(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:SetTarget(cm.atktg) e1:SetTarget(cm.uptg)
e1:SetValue(1000) e1:SetValue(1000)
Duel.RegisterEffect(e1,tp) Duel.RegisterEffect(e1,tp)
end end
function cm.atktg(c) function cm.uptg(e,c)
return c:IsSetCard(0x3596) return c:IsSetCard(0x3596) and c:IsFaceup()
end end
--SearchCard --SearchCard
function cm.thfilter1(c) function cm.thfilter1(c)
...@@ -123,7 +123,7 @@ function cm.thop(e,tp,eg,ep,ev,re,r,rp) ...@@ -123,7 +123,7 @@ function cm.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.RegisterEffect(e1,tp) Duel.RegisterEffect(e1,tp)
end end
function cm.etg(e,c) function cm.etg(e,c)
return c:IsSetCard(0x596) and c:IsType(TYPE_CONTINUOUS) return c:IsSetCard(0x596) and c:IsType(TYPE_CONTINUOUS) and c:IsFaceup()
end end
function cm.efilter(e,te) function cm.efilter(e,te)
local tp=e:GetHandlerPlayer() local tp=e:GetHandlerPlayer()
......
...@@ -58,7 +58,7 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -58,7 +58,7 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
end end
function cm.activate(e,tp,eg,ep,ev,re,r,rp) function cm.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_OPERATECARD) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_OPERATECARD)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cm.thfilter),tp,LOCATION_DECK,0,1,1,nil,e,tp) local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cm.thfilter),tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil,e,tp)
local tc=g:GetFirst() local tc=g:GetFirst()
if tc then if tc then
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE) local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
......
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