Commit c19941a4 authored by 未闻皂名's avatar 未闻皂名

2022/3/22 模块化KP07部分卡

parent 019b3389
...@@ -19,12 +19,7 @@ end ...@@ -19,12 +19,7 @@ end
function cm.costfilter(c) function cm.costfilter(c)
return c:IsFaceup() and c:IsCode(list[1]) and c:IsAbleToGraveAsCost() return c:IsFaceup() and c:IsCode(list[1]) and c:IsAbleToGraveAsCost()
end end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk) cm.cost=RD.CostSendOnFieldToGrave(cm.costfilter,1,1,false)
if chk==0 then return Duel.IsExistingMatchingCard(cm.costfilter,tp,LOCATION_ONFIELD,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,cm.costfilter,tp,LOCATION_ONFIELD,0,1,1,nil)
Duel.SendtoGrave(g,REASON_COST)
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(nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,e:GetHandler()) end if chk==0 then return Duel.IsExistingMatchingCard(nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,e:GetHandler()) end
local g=Duel.GetMatchingGroup(nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,e:GetHandler()) local g=Duel.GetMatchingGroup(nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,e:GetHandler())
......
...@@ -18,11 +18,10 @@ function cm.confilter(c) ...@@ -18,11 +18,10 @@ function cm.confilter(c)
return c:IsFaceup() and c:IsLevelAbove(7) return c:IsFaceup() and c:IsLevelAbove(7)
end end
function cm.spfilter(c,e,tp) function cm.spfilter(c,e,tp)
return c:IsType(TYPE_NORMAL) and c:IsLevel(3) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) return c:IsType(TYPE_NORMAL) and c:IsLevel(3) and RD.IsCanBeSpecialSummoned(c,e,tp,POS_FACEUP)
end end
function cm.condition(e,tp,eg,ep,ev,re,r,rp) function cm.condition(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() return RD.IsSummonTurn(e:GetHandler())
return c:IsReason(REASON_SUMMON) and c:IsStatus(STATUS_SUMMON_TURN)
and Duel.IsExistingMatchingCard(cm.confilter,tp,0,LOCATION_MZONE,1,nil) and Duel.IsExistingMatchingCard(cm.confilter,tp,0,LOCATION_MZONE,1,nil)
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)
...@@ -31,10 +30,5 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -31,10 +30,5 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE)
end end
function cm.operation(e,tp,eg,ep,ev,re,r,rp) function cm.operation(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetMZoneCount(tp)<1 then return end RD.SelectAndSpecialSummon(aux.NecroValleyFilter(cm.spfilter),tp,LOCATION_GRAVE,0,1,1,nil,e,POS_FACEUP)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cm.spfilter),tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end end
\ No newline at end of file
...@@ -18,7 +18,7 @@ function cm.confilter(c) ...@@ -18,7 +18,7 @@ function cm.confilter(c)
return c:IsFaceup() and c:IsLevel(7) and c:IsRace(RACE_WARRIOR) return c:IsFaceup() and c:IsLevel(7) and c:IsRace(RACE_WARRIOR)
end end
function cm.spfilter(c,e,tp) function cm.spfilter(c,e,tp)
return c:IsLevel(7) and c:IsRace(RACE_WARRIOR) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) return c:IsLevel(7) and c:IsRace(RACE_WARRIOR) and RD.IsCanBeSpecialSummoned(c,e,tp,POS_FACEUP)
end end
function cm.condition(e,tp,eg,ep,ev,re,r,rp) function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(cm.confilter,tp,LOCATION_MZONE,0,1,nil) return Duel.IsExistingMatchingCard(cm.confilter,tp,LOCATION_MZONE,0,1,nil)
...@@ -29,10 +29,5 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -29,10 +29,5 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
end end
function cm.operation(e,tp,eg,ep,ev,re,r,rp) function cm.operation(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetMZoneCount(tp)<1 then return end RD.SelectAndSpecialSummon(cm.spfilter,tp,LOCATION_HAND,0,1,1,nil,e,POS_FACEUP)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,cm.spfilter,tp,LOCATION_HAND,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end end
\ No newline at end of file
...@@ -19,24 +19,16 @@ end ...@@ -19,24 +19,16 @@ end
function cm.thfilter(c) function cm.thfilter(c)
return c:IsCode(list[1]) and c:IsAbleToHand() return c:IsCode(list[1]) and c:IsAbleToHand()
end end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk) cm.cost=RD.CostPayLP(500)
if chk==0 then return Duel.CheckLPCost(tp,500) end
Duel.PayLPCost(tp,500)
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.IsPlayerCanDiscardDeck(tp,1) end if chk==0 then return Duel.IsPlayerCanDiscardDeck(tp,1) end
Duel.SetOperationInfo(0,CATEGORY_DECKDES,nil,0,tp,1) Duel.SetOperationInfo(0,CATEGORY_DECKDES,nil,0,tp,1)
end end
function cm.operation(e,tp,eg,ep,ev,re,r,rp) function cm.operation(e,tp,eg,ep,ev,re,r,rp)
if Duel.DiscardDeck(tp,1,REASON_EFFECT)~=0 if Duel.DiscardDeck(tp,1,REASON_EFFECT)~=0 then
and Duel.IsExistingMatchingCard(aux.NecroValleyFilter(cm.thfilter),tp,LOCATION_GRAVE,0,1,nil) RD.CanSelectAndDoAction(aux.Stringid(m,1),HINTMSG_ATOHAND,aux.NecroValleyFilter(cm.thfilter),tp,LOCATION_GRAVE,0,1,99,nil,function(g)
and Duel.SelectYesNo(tp,aux.Stringid(m,1)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cm.thfilter),tp,LOCATION_GRAVE,0,1,99,nil)
if g:GetCount()>0 then
Duel.BreakEffect() Duel.BreakEffect()
Duel.SendtoHand(g,nil,REASON_EFFECT) RD.SendToHandAndExists(g,1-tp)
Duel.ConfirmCards(1-tp,g) end)
end
end end
end end
\ No newline at end of file
...@@ -16,22 +16,13 @@ end ...@@ -16,22 +16,13 @@ end
--Atk Down --Atk Down
function cm.condition(e,tp,eg,ep,ev,re,r,rp) function cm.condition(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
return (c:IsReason(REASON_SUMMON) and c:IsStatus(STATUS_SUMMON_TURN)) return RD.IsSummonTurn(c) or RD.IsSpecialSummonTurn(c)
or (c:IsReason(REASON_SPSUMMON) and c:IsStatus(STATUS_SPSUMMON_TURN))
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDiscardDeckAsCost(tp,1) end
Duel.DiscardDeck(tp,1,REASON_COST)
end end
cm.cost=RD.CostSendDeckTopToGrave(1)
function cm.operation(e,tp,eg,ep,ev,re,r,rp) function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
if c:IsFaceup() and c:IsRelateToEffect(e) then if c:IsFaceup() and c:IsRelateToEffect(e) then
local e1=Effect.CreateEffect(c) RD.AttachAtkDef(e,c,-800,0,RESET_EVENT+RESETS_STANDARD+RESET_DISABLE+RESET_PHASE+PHASE_END)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(-800)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE+RESET_PHASE+PHASE_END)
c:RegisterEffect(e1)
if Duel.SelectYesNo(tp,aux.Stringid(m,1)) then if Duel.SelectYesNo(tp,aux.Stringid(m,1)) then
Duel.BreakEffect() Duel.BreakEffect()
Duel.Recover(tp,800,REASON_EFFECT) Duel.Recover(tp,800,REASON_EFFECT)
......
...@@ -21,8 +21,7 @@ function cm.thfilter(c) ...@@ -21,8 +21,7 @@ function cm.thfilter(c)
return c:IsLevelAbove(7) and c:IsRace(RACE_WARRIOR) and c:IsAbleToHand() return c:IsLevelAbove(7) and c:IsRace(RACE_WARRIOR) and c:IsAbleToHand()
end end
function cm.condition(e,tp,eg,ep,ev,re,r,rp) function cm.condition(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() return RD.IsSummonTurn(e:GetHandler())
return c:IsReason(REASON_SUMMON) and c:IsStatus(STATUS_SUMMON_TURN)
and Duel.IsExistingMatchingCard(cm.confilter,tp,0,LOCATION_MZONE,1,nil) and Duel.IsExistingMatchingCard(cm.confilter,tp,0,LOCATION_MZONE,1,nil)
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)
...@@ -30,31 +29,14 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -30,31 +29,14 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_GRAVE) Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_GRAVE)
end end
function cm.operation(e,tp,eg,ep,ev,re,r,rp) function cm.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) RD.SelectAndDoAction(HINTMSG_ATOHAND,aux.NecroValleyFilter(cm.thfilter),tp,LOCATION_GRAVE,0,1,1,nil,function(g)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cm.thfilter),tp,LOCATION_GRAVE,0,1,1,nil) RD.SendToHandAndExists(g,1-tp)
if g:GetCount()>0 then end)
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
if Duel.GetFlagEffect(tp,m)~=0 then return end if Duel.GetFlagEffect(tp,m)~=0 then return end
local e1=Effect.CreateEffect(e:GetHandler()) RD.CreateHintEffect(e,aux.Stringid(m,1),tp,1,0,RESET_PHASE+PHASE_END)
e1:SetType(EFFECT_TYPE_FIELD) RD.CreateAttackLimitEffect(e,cm.atktg,tp,LOCATION_MZONE,0,RESET_PHASE+PHASE_END)
e1:SetCode(EFFECT_CANNOT_ATTACK)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetTargetRange(LOCATION_MZONE,0)
e1:SetTarget(cm.atktg)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
--Hint
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetDescription(aux.Stringid(m,1))
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CLIENT_HINT)
e2:SetTargetRange(1,0)
e2:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e2,tp)
Duel.RegisterFlagEffect(tp,m,RESET_PHASE+PHASE_END,0,1) Duel.RegisterFlagEffect(tp,m,RESET_PHASE+PHASE_END,0,1)
end end
function cm.atktg(e,c) function cm.atktg(e,c)
return RushDuel.IsHasDefense(c) and c:IsDefenseBelow(1900) return RD.IsDefenseBelow(c,1900)
end end
\ No newline at end of file
...@@ -15,30 +15,17 @@ function cm.initial_effect(c) ...@@ -15,30 +15,17 @@ function cm.initial_effect(c)
end end
--Pierce --Pierce
function cm.filter(c) function cm.filter(c)
return c:IsFaceup() and c:IsRace(RACE_WARRIOR) and not c:IsHasEffect(EFFECT_CANNOT_ATTACK) return c:IsFaceup() and c:IsRace(RACE_WARRIOR) and RD.IsCanAttachPierce(c)
end end
function cm.condition(e,tp,eg,ep,ev,re,r,rp) function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetMatchingGroupCount(Card.IsFaceup,tp,LOCATION_MZONE,0,nil)==3 and Duel.IsAbleToEnterBP() return Duel.GetMatchingGroupCount(Card.IsFaceup,tp,LOCATION_MZONE,0,nil)==3 and Duel.IsAbleToEnterBP()
end end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk) cm.cost=RD.CostSendDeckTopToGrave(1)
if chk==0 then return Duel.IsPlayerCanDiscardDeckAsCost(tp,1) end
Duel.DiscardDeck(tp,1,REASON_COST)
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.filter,tp,LOCATION_MZONE,0,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_MZONE,0,1,nil) end
end end
function cm.operation(e,tp,eg,ep,ev,re,r,rp) function cm.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(m,1)) RD.SelectAndDoAction(aux.Stringid(m,1),cm.filter,tp,LOCATION_MZONE,0,1,1,nil,function(g)
local g=Duel.SelectMatchingCard(tp,cm.filter,tp,LOCATION_MZONE,0,1,1,nil) RD.AttachPierce(e,g:GetFirst(),aux.Stringid(m,2),RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
if g:GetCount()>0 then end)
Duel.HintSelection(g)
local tc=g:GetFirst()
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetDescription(aux.Stringid(m,2))
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_PIERCE)
e1:SetProperty(EFFECT_FLAG_CLIENT_HINT)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
end
end end
\ No newline at end of file
...@@ -14,10 +14,10 @@ function cm.initial_effect(c) ...@@ -14,10 +14,10 @@ function cm.initial_effect(c)
end end
--Position --Position
function cm.filter(c) function cm.filter(c)
return c:IsCanChangePosition() and RushDuel.IsHasDefense(c) return RD.IsCanChangePosition(c)
end end
function cm.posfilter(c) function cm.posfilter(c)
return c:IsFaceup() and c:IsCanChangePosition() and RushDuel.IsHasDefense(c) return c:IsFaceup() and RD.IsCanChangePosition(c)
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.filter,tp,0,LOCATION_MZONE,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,0,LOCATION_MZONE,1,nil) end
...@@ -25,19 +25,11 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -25,19 +25,11 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
end end
function cm.operation(e,tp,eg,ep,ev,re,r,rp) function cm.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_POSCHANGE) RD.SelectAndDoAction(HINTMSG_POSCHANGE,cm.filter,tp,0,LOCATION_MZONE,1,2,nil,function(g)
local g=Duel.SelectMatchingCard(tp,cm.filter,tp,0,LOCATION_MZONE,1,2,nil) if RD.ChangePosition(g)~=0 then
if g:GetCount()>0 then RD.CanSelectAndDoAction(aux.Stringid(m,1),HINTMSG_POSCHANGE,cm.posfilter,tp,LOCATION_MZONE,0,1,1,nil,function(sg)
Duel.HintSelection(g) RD.ChangePosition(sg)
if Duel.ChangePosition(g,POS_FACEUP_DEFENSE,POS_FACEUP_DEFENSE,POS_FACEUP_ATTACK,POS_FACEUP_ATTACK)~=0 end)
and Duel.IsExistingMatchingCard(cm.posfilter,tp,LOCATION_MZONE,0,1,nil)
and Duel.SelectYesNo(tp,aux.Stringid(m,1)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_POSCHANGE)
local sg=Duel.SelectMatchingCard(tp,cm.posfilter,tp,LOCATION_MZONE,0,1,1,nil)
if sg:GetCount()>0 then
Duel.HintSelection(sg)
Duel.ChangePosition(sg,POS_FACEUP_DEFENSE,POS_FACEUP_DEFENSE,POS_FACEUP_ATTACK,POS_FACEUP_ATTACK)
end
end end
end end)
end end
\ No newline at end of file
...@@ -19,7 +19,7 @@ function cm.confilter(c) ...@@ -19,7 +19,7 @@ function cm.confilter(c)
end end
function cm.spfilter(c,e,tp) function cm.spfilter(c,e,tp)
return c:IsType(TYPE_NORMAL) and c:IsLevelAbove(5) and c:IsRace(RACE_FIEND) return c:IsType(TYPE_NORMAL) and c:IsLevelAbove(5) and c:IsRace(RACE_FIEND)
and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE) and RD.IsCanBeSpecialSummoned(c,e,tp,POS_FACEUP_DEFENSE)
end end
function cm.condition(e,tp,eg,ep,ev,re,r,rp) function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(cm.confilter,tp,0,LOCATION_MZONE,1,nil) return Duel.IsExistingMatchingCard(cm.confilter,tp,0,LOCATION_MZONE,1,nil)
...@@ -30,18 +30,10 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -30,18 +30,10 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
end end
function cm.operation(e,tp,eg,ep,ev,re,r,rp) function cm.operation(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetMZoneCount(tp)<1 then return end if RD.SelectAndSpecialSummon(cm.spfilter,tp,LOCATION_HAND,0,1,1,nil,e,POS_FACEUP_DEFENSE)~=0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,cm.spfilter,tp,LOCATION_HAND,0,1,1,nil,e,tp)
if g:GetCount()>0 and Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP_DEFENSE)~=0 then
local c=e:GetHandler() local c=e:GetHandler()
if c:IsFaceup() and c:IsRelateToEffect(e) then if c:IsFaceup() and c:IsRelateToEffect(e) then
local e1=Effect.CreateEffect(c) RD.AttachLevel(e,c,5,RESET_EVENT+RESETS_STANDARD+RESET_DISABLE+RESET_PHASE+PHASE_END)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_LEVEL)
e1:SetValue(5)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE+RESET_PHASE+PHASE_END)
c:RegisterEffect(e1)
end end
end end
end end
\ No newline at end of file
...@@ -34,12 +34,11 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -34,12 +34,11 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
end end
function cm.operation(e,tp,eg,ep,ev,re,r,rp) function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(cm.thfilter,tp,LOCATION_GRAVE,0,nil) local g=Duel.GetMatchingGroup(cm.thfilter,tp,LOCATION_GRAVE,0,nil)
if g:GetCount()>0 and Duel.SendtoHand(g,nil,REASON_EFFECT)~=0 then if g:GetCount()>0 and RD.SendToHandAndExists(g,1-tp) then
Duel.ConfirmCards(1-tp,g)
local c=e:GetHandler() local c=e:GetHandler()
if c:IsRelateToEffect(e) then if c:IsRelateToEffect(e) then
Duel.BreakEffect() Duel.BreakEffect()
Duel.SendtoDeck(c,nil,1,REASON_EFFECT) RD.SendToDeckBottom(c)
end end
end end
end end
\ No newline at end of file
...@@ -17,7 +17,7 @@ function cm.initial_effect(c) ...@@ -17,7 +17,7 @@ function cm.initial_effect(c)
end end
--Special Summon --Special Summon
function cm.spfilter(c,e,tp) function cm.spfilter(c,e,tp)
return c:IsCode(list[1]) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) return c:IsCode(list[1]) and RD.IsCanBeSpecialSummoned(c,e,tp,POS_FACEUP)
end end
function cm.condition(e,tp,eg,ep,ev,re,r,rp) function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(Card.IsFaceup,tp,LOCATION_FZONE,LOCATION_FZONE,1,nil) return Duel.IsExistingMatchingCard(Card.IsFaceup,tp,LOCATION_FZONE,LOCATION_FZONE,1,nil)
...@@ -28,30 +28,10 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -28,30 +28,10 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE)
end end
function cm.operation(e,tp,eg,ep,ev,re,r,rp) function cm.operation(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetMZoneCount(tp)>0 then RD.SelectAndSpecialSummon(aux.NecroValleyFilter(cm.spfilter),tp,LOCATION_GRAVE,0,1,1,nil,e,POS_FACEUP)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cm.spfilter),tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
if Duel.GetFlagEffect(tp,m)~=0 then return end if Duel.GetFlagEffect(tp,m)~=0 then return end
local e1=Effect.CreateEffect(e:GetHandler()) RD.CreateHintEffect(e,aux.Stringid(m,1),tp,1,0,RESET_PHASE+PHASE_END)
e1:SetType(EFFECT_TYPE_FIELD) RD.CreateAttackLimitEffect(e,cm.atktg,tp,LOCATION_MZONE,0,RESET_PHASE+PHASE_END)
e1:SetCode(EFFECT_CANNOT_ATTACK)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetTargetRange(LOCATION_MZONE,0)
e1:SetTarget(cm.atktg)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
--Hint
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetDescription(aux.Stringid(m,1))
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CLIENT_HINT)
e2:SetTargetRange(1,0)
e2:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e2,tp)
Duel.RegisterFlagEffect(tp,m,RESET_PHASE+PHASE_END,0,1) Duel.RegisterFlagEffect(tp,m,RESET_PHASE+PHASE_END,0,1)
end end
function cm.atktg(e,c) function cm.atktg(e,c)
......
...@@ -29,11 +29,8 @@ function cm.condition(e,tp,eg,ep,ev,re,r,rp) ...@@ -29,11 +29,8 @@ function cm.condition(e,tp,eg,ep,ev,re,r,rp)
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.IsPlayerCanDraw(tp,1) end if chk==0 then return Duel.IsPlayerCanDraw(tp,1) end
Duel.SetTargetPlayer(tp) RD.TargetDraw(tp,1)
Duel.SetTargetParam(1)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end end
function cm.operation(e,tp,eg,ep,ev,re,r,rp) function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM) RD.Draw()
Duel.Draw(p,d,REASON_EFFECT)
end end
\ No newline at end of file
...@@ -22,25 +22,16 @@ end ...@@ -22,25 +22,16 @@ end
function cm.exfilter(c) function cm.exfilter(c)
return c:IsFaceup() and c:IsCode(list[1],list[2]) return c:IsFaceup() and c:IsCode(list[1],list[2])
end end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk) cm.cost=RD.CostSendDeckTopToGrave(1)
if chk==0 then return Duel.IsPlayerCanDiscardDeckAsCost(tp,1) end
Duel.DiscardDeck(tp,1,REASON_COST)
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.tdfilter,tp,0,LOCATION_GRAVE,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(cm.tdfilter,tp,0,LOCATION_GRAVE,1,nil) end
local g=Duel.GetMatchingGroup(cm.tdfilter,tp,0,LOCATION_GRAVE,nil) local g=Duel.GetMatchingGroup(cm.tdfilter,tp,0,LOCATION_GRAVE,nil)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_TODECK,g,1,0,0)
end end
function cm.operation(e,tp,eg,ep,ev,re,r,rp) function cm.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK) RD.SelectAndDoAction(HINTMSG_TODECK,aux.NecroValleyFilter(cm.tdfilter),tp,0,LOCATION_GRAVE,1,1,nil,function(g)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cm.tdfilter),tp,0,LOCATION_GRAVE,1,1,nil) if RD.SendToDeckAndExists(g) and Duel.IsExistingMatchingCard(cm.exfilter,tp,LOCATION_ONFIELD,0,1,nil) then
if g:GetCount()>0 then RD.CanDiscardDeck(aux.Stringid(m,1),tp,2)
Duel.ConfirmCards(1-tp,g)
if Duel.SendtoDeck(g,nil,2,REASON_EFFECT)~=0
and Duel.IsExistingMatchingCard(cm.exfilter,tp,LOCATION_ONFIELD,0,1,nil)
and Duel.IsPlayerCanDiscardDeck(tp,2)
and Duel.SelectYesNo(tp,aux.Stringid(m,1)) then
Duel.DiscardDeck(tp,2,REASON_EFFECT)
end end
end end)
end end
\ No newline at end of file
...@@ -20,19 +20,11 @@ end ...@@ -20,19 +20,11 @@ end
function cm.costfilter(c) function cm.costfilter(c)
return c:IsCode(list[1],list[2]) and c:IsAbleToGraveAsCost() return c:IsCode(list[1],list[2]) and c:IsAbleToGraveAsCost()
end end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk) cm.cost=RD.CostSendHandToGrave(cm.costfilter,1,1)
if chk==0 then return Duel.IsExistingMatchingCard(cm.costfilter,tp,LOCATION_HAND,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,cm.costfilter,tp,LOCATION_HAND,0,1,1,nil)
Duel.SendtoGrave(g,REASON_COST)
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.IsPlayerCanDraw(tp,1) end if chk==0 then return Duel.IsPlayerCanDraw(tp,1) end
Duel.SetTargetPlayer(tp) RD.TargetDraw(tp,1)
Duel.SetTargetParam(1)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end end
function cm.operation(e,tp,eg,ep,ev,re,r,rp) function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM) RD.Draw()
Duel.Draw(p,d,REASON_EFFECT)
end end
\ No newline at end of file
...@@ -19,27 +19,15 @@ end ...@@ -19,27 +19,15 @@ end
function cm.exfilter(c) function cm.exfilter(c)
return c:IsFaceup() and c:IsCode(list[1],list[2]) return c:IsFaceup() and c:IsCode(list[1],list[2])
end end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk) cm.cost=RD.CostSendDeckTopToGrave(1)
if chk==0 then return Duel.IsPlayerCanDiscardDeckAsCost(tp,1) end
Duel.DiscardDeck(tp,1,REASON_COST)
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(Card.IsFaceup,tp,0,LOCATION_MZONE,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(Card.IsFaceup,tp,0,LOCATION_MZONE,1,nil) end
end end
function cm.operation(e,tp,eg,ep,ev,re,r,rp) function cm.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(m,1)) RD.SelectAndDoAction(aux.Stringid(m,1),Card.IsFaceup,tp,0,LOCATION_MZONE,1,1,nil,function(g)
local g=Duel.SelectMatchingCard(tp,Card.IsFaceup,tp,0,LOCATION_MZONE,1,1,nil) RD.AttachAtkDef(e,g:GetFirst(),-500,0,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
if g:GetCount()>0 then
Duel.HintSelection(g)
local tc=g:GetFirst()
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(-500)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
if Duel.IsExistingMatchingCard(cm.exfilter,tp,LOCATION_ONFIELD,0,1,nil) then if Duel.IsExistingMatchingCard(cm.exfilter,tp,LOCATION_ONFIELD,0,1,nil) then
Duel.Damage(1-tp,500,REASON_EFFECT) Duel.Damage(1-tp,500,REASON_EFFECT)
end end
end end)
end end
\ No newline at end of file
...@@ -19,25 +19,14 @@ function cm.confilter(c) ...@@ -19,25 +19,14 @@ function cm.confilter(c)
return c:IsFaceup() and c:IsCode(list[1]) return c:IsFaceup() and c:IsCode(list[1])
end end
function cm.condition(e,tp,eg,ep,ev,re,r,rp) function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return not e:GetHandler():IsHasEffect(EFFECT_UNRELEASABLE_SUM) return RD.IsCanAttachDoubleTribute(e:GetHandler())
and Duel.IsExistingMatchingCard(cm.confilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) and Duel.IsExistingMatchingCard(cm.confilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil)
end end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk) cm.cost=RD.CostPayLP(500)
if chk==0 then return Duel.CheckLPCost(tp,500) end
Duel.PayLPCost(tp,500)
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp) function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
if c:IsFaceup() and c:IsRelateToEffect(e) then if c:IsFaceup() and c:IsRelateToEffect(e) then
--Double Tribute RD.AttachDoubleTribute(e,c,cm.trival,aux.Stringid(m,1),RESET_EVENT+RESETS_STANDARD+RESET_DISABLE+RESET_PHASE+PHASE_END)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,1))
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DOUBLE_TRIBUTE)
e1:SetProperty(EFFECT_FLAG_CLIENT_HINT)
e1:SetValue(cm.trival)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE+RESET_PHASE+PHASE_END)
c:RegisterEffect(e1)
end end
end end
function cm.trival(e,c) function cm.trival(e,c)
......
...@@ -21,45 +21,19 @@ function cm.costfilter(c) ...@@ -21,45 +21,19 @@ function cm.costfilter(c)
end end
function cm.spfilter(c,e,tp) function cm.spfilter(c,e,tp)
return c:IsType(TYPE_NORMAL) and c:IsAttribute(ATTRIBUTE_FIRE) and c:IsDefense(400) return c:IsType(TYPE_NORMAL) and c:IsAttribute(ATTRIBUTE_FIRE) and c:IsDefense(400)
and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and RD.IsCanBeSpecialSummoned(c,e,tp,POS_FACEUP)
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.costfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectMatchingCard(tp,cm.costfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.ConfirmCards(1-tp,g)
Duel.SendtoDeck(g,nil,1,REASON_COST)
end end
cm.cost=RD.CostSendGraveToDeckBottom(cm.costfilter,1,1)
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.GetMZoneCount(tp)>0 if chk==0 then return Duel.GetMZoneCount(tp)>0
and Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end and Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE)
end end
function cm.operation(e,tp,eg,ep,ev,re,r,rp) function cm.operation(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetMZoneCount(tp)>0 then RD.SelectAndSpecialSummon(aux.NecroValleyFilter(cm.spfilter),tp,LOCATION_GRAVE,0,1,1,nil,e,POS_FACEUP)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cm.spfilter),tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
if Duel.GetFlagEffect(tp,m)~=0 then return end if Duel.GetFlagEffect(tp,m)~=0 then return end
local e1=Effect.CreateEffect(e:GetHandler()) RD.CreateHintEffect(e,aux.Stringid(m,1),tp,1,0,RESET_PHASE+PHASE_END)
e1:SetType(EFFECT_TYPE_FIELD) RD.CreateAttackLimitEffect(e,cm.atktg,tp,LOCATION_MZONE,0,RESET_PHASE+PHASE_END)
e1:SetCode(EFFECT_CANNOT_ATTACK)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetTargetRange(LOCATION_MZONE,0)
e1:SetTarget(cm.atktg)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
--Hint
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetDescription(aux.Stringid(m,1))
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CLIENT_HINT)
e2:SetTargetRange(1,0)
e2:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e2,tp)
Duel.RegisterFlagEffect(tp,m,RESET_PHASE+PHASE_END,0,1) Duel.RegisterFlagEffect(tp,m,RESET_PHASE+PHASE_END,0,1)
end end
function cm.atktg(e,c) function cm.atktg(e,c)
......
...@@ -20,37 +20,23 @@ function cm.costfilter(c) ...@@ -20,37 +20,23 @@ function cm.costfilter(c)
return c:IsAttribute(ATTRIBUTE_FIRE) and c:IsAbleToDeckOrExtraAsCost() return c:IsAttribute(ATTRIBUTE_FIRE) and c:IsAbleToDeckOrExtraAsCost()
end end
function cm.spfilter(c,e,tp) function cm.spfilter(c,e,tp)
return c:IsCode(list[1]) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) return c:IsCode(list[1]) and RD.IsCanBeSpecialSummoned(c,e,tp,POS_FACEUP)
end end
function cm.costcheck(g,e,tp) function cm.costcheck(g,e,tp)
return Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_GRAVE,0,1,g,e,tp) return Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_GRAVE,0,1,g,e,tp)
end end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk) cm.cost=RD.CostSendGraveSubToDeck(cm.costfilter,cm.costcheck,3,3)
local g=Duel.GetMatchingGroup(cm.costfilter,tp,LOCATION_GRAVE,0,nil)
if chk==0 then return g:CheckSubGroup(cm.costcheck,3,3,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local sg=g:SelectSubGroup(tp,cm.costcheck,false,3,3,e,tp)
Duel.ConfirmCards(1-tp,sg)
Duel.SendtoDeck(sg,nil,2,REASON_COST)
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.GetMZoneCount(tp)>0 if chk==0 then return Duel.GetMZoneCount(tp)>0
and Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end and Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE)
end end
function cm.operation(e,tp,eg,ep,ev,re,r,rp) function cm.operation(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetMZoneCount(tp)<1 then return end if RD.SelectAndSpecialSummon(aux.NecroValleyFilter(cm.spfilter),tp,LOCATION_GRAVE,0,1,1,nil,e,POS_FACEUP)~=0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cm.spfilter),tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
if g:GetCount()>0 and Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)~=0 then
local c=e:GetHandler() local c=e:GetHandler()
if c:IsFaceup() and c:IsRelateToEffect(e) then if c:IsFaceup() and c:IsRelateToEffect(e) then
local e1=Effect.CreateEffect(c) Duel.BreakEffect()
e1:SetType(EFFECT_TYPE_SINGLE) RD.AttachAtkDef(e,c,2000,0,RESET_EVENT+RESETS_STANDARD+RESET_DISABLE+RESET_PHASE+PHASE_END)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(2000)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE+RESET_PHASE+PHASE_END)
c:RegisterEffect(e1)
end end
end end
end end
\ No newline at end of file
...@@ -25,38 +25,15 @@ end ...@@ -25,38 +25,15 @@ end
function cm.condition(e,tp,eg,ep,ev,re,r,rp) function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(cm.confilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) return Duel.IsExistingMatchingCard(cm.confilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil)
end end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk) cm.cost=RD.CostSendMZoneToGrave(cm.costfilter,2,2,true)
if chk==0 then return Duel.IsExistingMatchingCard(cm.costfilter,tp,LOCATION_MZONE,0,2,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,cm.costfilter,tp,LOCATION_MZONE,0,2,2,nil)
Duel.SendtoGrave(g,REASON_COST)
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp) function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
if c:IsFaceup() and c:IsRelateToEffect(e) then if c:IsFaceup() and c:IsRelateToEffect(e) then
local e1=Effect.CreateEffect(c) RD.AttachAtkDef(e,c,2500,0,RESET_EVENT+RESETS_STANDARD+RESET_DISABLE+RESET_PHASE+PHASE_END)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(2500)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE+RESET_PHASE+PHASE_END)
c:RegisterEffect(e1)
end end
local e2=Effect.CreateEffect(c) RD.CreateHintEffect(e,aux.Stringid(m,1),tp,1,0,RESET_PHASE+PHASE_END)
e2:SetType(EFFECT_TYPE_FIELD) local e1=RD.CreateAttackLimitEffect(e,cm.atktg,tp,LOCATION_MZONE,0,RESET_PHASE+PHASE_END)
e2:SetCode(EFFECT_CANNOT_ATTACK) e1:SetLabel(c:GetFieldID())
e2:SetTargetRange(LOCATION_MZONE,0)
e2:SetTarget(cm.atktg)
e2:SetLabel(c:GetFieldID())
e2:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e2,tp)
--Hint
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,1))
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CLIENT_HINT)
e3:SetTargetRange(1,0)
e3:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e3,tp)
end end
function cm.atktg(e,c) function cm.atktg(e,c)
return e:GetLabel()~=c:GetFieldID() return e:GetLabel()~=c:GetFieldID()
......
...@@ -17,34 +17,22 @@ function cm.initial_effect(c) ...@@ -17,34 +17,22 @@ function cm.initial_effect(c)
end end
--Special Summon --Special Summon
function cm.spfilter(c,e,tp) function cm.spfilter(c,e,tp)
return c:IsCode(list[1]) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE) return c:IsCode(list[1]) and RD.IsCanBeSpecialSummoned(c,e,tp,POS_FACEUP_DEFENSE)
end end
function cm.thfilter(c) function cm.thfilter(c)
return c:IsCode(list[2],list[3]) and c:IsAbleToHand() return c:IsCode(list[2],list[3]) and c:IsAbleToHand()
end end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk) cm.cost=RD.CostSendSelfToGrave()
if chk==0 then return e:GetHandler():IsAbleToGraveAsCost() end
Duel.SendtoGrave(e:GetHandler(),REASON_COST)
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.GetMZoneCount(tp,e:GetHandler())>0 if chk==0 then return Duel.GetMZoneCount(tp,e:GetHandler())>0
and Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end and Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE)
end end
function cm.operation(e,tp,eg,ep,ev,re,r,rp) function cm.operation(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetMZoneCount(tp)<1 then return end if RD.SelectAndSpecialSummon(aux.NecroValleyFilter(cm.spfilter),tp,LOCATION_GRAVE,0,1,1,nil,e,POS_FACEUP_DEFENSE)~=0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) RD.CanSelectAndDoAction(aux.Stringid(m,1),HINTMSG_ATOHAND,aux.NecroValleyFilter(cm.thfilter),tp,LOCATION_GRAVE,0,1,1,nil,function(sg)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cm.spfilter),tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
if g:GetCount()>0
and Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP_DEFENSE)~=0
and Duel.IsExistingMatchingCard(aux.NecroValleyFilter(cm.thfilter),tp,LOCATION_GRAVE,0,1,nil)
and Duel.SelectYesNo(tp,aux.Stringid(m,1)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local sg=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cm.thfilter),tp,LOCATION_GRAVE,0,1,1,nil)
if sg:GetCount()>0 then
Duel.BreakEffect() Duel.BreakEffect()
Duel.SendtoHand(sg,nil,REASON_EFFECT) RD.SendToHandAndExists(sg,1-tp)
Duel.ConfirmCards(1-tp,sg) end)
end
end end
end end
\ No newline at end of file
...@@ -23,28 +23,15 @@ end ...@@ -23,28 +23,15 @@ end
function cm.thfilter(c) function cm.thfilter(c)
return c:IsType(TYPE_NORMAL) and c:IsRace(RACE_MACHINE) and c:IsAbleToHand() return c:IsType(TYPE_NORMAL) and c:IsRace(RACE_MACHINE) and c:IsAbleToHand()
end end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk) cm.cost=RD.CostSendGraveToDeck(cm.costfilter,1,1)
if chk==0 then return Duel.IsExistingMatchingCard(cm.costfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectMatchingCard(tp,cm.costfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.ConfirmCards(1-tp,g)
Duel.SendtoDeck(g,nil,2,REASON_COST)
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.IsPlayerCanDiscardDeck(tp,2) end if chk==0 then return Duel.IsPlayerCanDiscardDeck(tp,2) end
Duel.SetOperationInfo(0,CATEGORY_DECKDES,nil,0,tp,2) Duel.SetOperationInfo(0,CATEGORY_DECKDES,nil,0,tp,2)
end end
function cm.operation(e,tp,eg,ep,ev,re,r,rp) function cm.operation(e,tp,eg,ep,ev,re,r,rp)
if Duel.DiscardDeck(tp,2,REASON_EFFECT)==0 then return end if RD.SendDeckTopToGraveAndExists(tp,2,cm.exfilter,1,nil) then
local g=Duel.GetOperatedGroup() RD.CanSelectAndDoAction(aux.Stringid(m,1),HINTMSG_ATOHAND,aux.NecroValleyFilter(cm.thfilter),tp,LOCATION_GRAVE,0,1,1,nil,function(g)
if g:IsExists(cm.exfilter,1,nil) RD.SendToHandAndExists(g,1-tp)
and Duel.IsExistingMatchingCard(aux.NecroValleyFilter(cm.thfilter),tp,LOCATION_GRAVE,0,1,nil) end)
and Duel.SelectYesNo(tp,aux.Stringid(m,1)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local sg=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cm.thfilter),tp,LOCATION_GRAVE,0,1,1,nil)
if sg:GetCount()>0 then
Duel.SendtoHand(sg,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,sg)
end
end end
end end
\ No newline at end of file
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