Commit 2b54d0fc authored by 未闻皂名's avatar 未闻皂名

2022/3/19 模块化KP05和P003

parent 090a5f5c
...@@ -17,27 +17,13 @@ function cm.costfilter(c) ...@@ -17,27 +17,13 @@ function cm.costfilter(c)
return c:IsType(TYPE_SPELL+TYPE_TRAP) and not c:IsPublic() return c:IsType(TYPE_SPELL+TYPE_TRAP) and not c:IsPublic()
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())
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.costfilter,tp,LOCATION_HAND,0,2,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM)
local g=Duel.SelectMatchingCard(tp,cm.costfilter,tp,LOCATION_HAND,0,2,2,nil)
Duel.ConfirmCards(1-tp,g)
Duel.ShuffleHand(tp)
end end
cm.cost=RD.CostShowHand(cm.costfilter,2,2)
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)
......
...@@ -17,10 +17,7 @@ end ...@@ -17,10 +17,7 @@ end
function cm.filter(c) function cm.filter(c)
return c:IsType(TYPE_TRAP) return c:IsType(TYPE_TRAP)
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_GRAVE,0,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_GRAVE,0,1,nil) end
end end
...@@ -28,12 +25,7 @@ function cm.operation(e,tp,eg,ep,ev,re,r,rp) ...@@ -28,12 +25,7 @@ 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 ct=Duel.GetMatchingGroupCount(cm.filter,tp,LOCATION_GRAVE,0,nil) local ct=Duel.GetMatchingGroupCount(cm.filter,tp,LOCATION_GRAVE,0,nil)
local e1=Effect.CreateEffect(c) RD.AttachAtkDef(e,c,ct*200,0,RESET_EVENT+RESETS_STANDARD+RESET_DISABLE+RESET_PHASE+PHASE_END)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(ct*200)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE+RESET_PHASE+PHASE_END)
c:RegisterEffect(e1)
if ct>=5 then if ct>=5 then
Duel.Damage(1-tp,1000,REASON_EFFECT) Duel.Damage(1-tp,1000,REASON_EFFECT)
end end
......
...@@ -20,37 +20,23 @@ function cm.costfilter(c) ...@@ -20,37 +20,23 @@ function cm.costfilter(c)
return c:IsType(TYPE_MONSTER) and c:IsAbleToDeckOrExtraAsCost() return c:IsType(TYPE_MONSTER) and c:IsAbleToDeckOrExtraAsCost()
end end
function cm.posfilter(c) function cm.posfilter(c)
return c:IsPosition(POS_FACEUP_ATTACK) and c:IsLevelBelow(8) and RushDuel.IsHasDefense(c) and c:IsCanTurnSet() return c:IsPosition(POS_FACEUP_ATTACK) and c:IsLevelBelow(8) and RD.IsCanChangePosition(c) and c:IsCanTurnSet()
end 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.CostSendGraveToDeck(cm.costfilter,3,3)
if chk==0 then return Duel.IsExistingMatchingCard(cm.costfilter,tp,LOCATION_GRAVE,0,3,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectMatchingCard(tp,cm.costfilter,tp,LOCATION_GRAVE,0,3,3,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.IsExistingMatchingCard(cm.posfilter,tp,0,LOCATION_MZONE,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(cm.posfilter,tp,0,LOCATION_MZONE,1,nil) end
local g=Duel.GetMatchingGroup(cm.posfilter,tp,0,LOCATION_MZONE,nil) local g=Duel.GetMatchingGroup(cm.posfilter,tp,0,LOCATION_MZONE,nil)
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_SET) RD.SelectAndDoAction(HINTMSG_SET,cm.posfilter,tp,0,LOCATION_MZONE,1,1,nil,function(g)
local g=Duel.SelectMatchingCard(tp,cm.posfilter,tp,0,LOCATION_MZONE,1,1,nil) if RD.ChangePosition(g,POS_FACEDOWN_DEFENSE)~=0 then
if g:GetCount()>0 then RD.CanSelectAndDoAction(aux.Stringid(m,1),HINTMSG_ATOHAND,aux.NecroValleyFilter(cm.thfilter),tp,LOCATION_GRAVE,0,1,1,nil,function(sg)
Duel.HintSelection(g) RD.SendToHandAndExists(sg,1-tp)
if Duel.ChangePosition(g,POS_FACEDOWN_DEFENSE)~=0 end)
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.SendtoHand(sg,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,sg)
end
end end
end end)
end end
\ No newline at end of file
...@@ -19,25 +19,17 @@ function cm.confilter(c) ...@@ -19,25 +19,17 @@ function cm.confilter(c)
return c:IsFaceup() and c:IsAttack(100) and c:IsDefense(100) return c:IsFaceup() and c:IsAttack(100) and c:IsDefense(100)
end end
function cm.spfilter(c,e,tp) function cm.spfilter(c,e,tp)
return c:IsLevel(7) and c:IsRace(RACE_PSYCHO) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_ATTACK) return c:IsLevel(7) and c:IsRace(RACE_PSYCHO) and RD.IsCanBeSpecialSummoned(c,e,tp,POS_FACEUP_ATTACK)
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)
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 RD.SelectAndSpecialSummon(aux.NecroValleyFilter(cm.spfilter),tp,LOCATION_GRAVE,0,1,1,nil,e,POS_FACEUP_ATTACK)
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_ATTACK)
end
end end
\ No newline at end of file
...@@ -18,20 +18,11 @@ end ...@@ -18,20 +18,11 @@ end
function cm.costfilter(c) function cm.costfilter(c)
return c:IsType(TYPE_FIELD) and c:IsAbleToDeckAsCost() return c:IsType(TYPE_FIELD) and c:IsAbleToDeckAsCost()
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 true end if chk==0 then return true end
Duel.SetTargetPlayer(1-tp) RD.TargetDamage(1-tp,600)
Duel.SetTargetParam(600)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,600)
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.Damage()
Duel.Damage(p,d,REASON_EFFECT)
end end
\ No newline at end of file
...@@ -15,31 +15,17 @@ function cm.initial_effect(c) ...@@ -15,31 +15,17 @@ function cm.initial_effect(c)
end end
--Pierce --Pierce
function cm.filter(c) function cm.filter(c)
return c:IsFaceup() and c:IsLevelAbove(5) and c:IsRace(RACE_FIEND) return c:IsFaceup() and c:IsLevelAbove(5) and c:IsRace(RACE_FIEND) and RD.IsCanAttachPierce(c)
and not c:IsHasEffect(EFFECT_CANNOT_ATTACK)
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.GetFieldGroupCount(tp,0,LOCATION_MZONE)>0 and Duel.IsAbleToEnterBP() return Duel.GetFieldGroupCount(tp,0,LOCATION_MZONE)>0 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
...@@ -18,11 +18,11 @@ end ...@@ -18,11 +18,11 @@ end
function cm.costfilter(c,tp) function cm.costfilter(c,tp)
return c:IsFaceup() and c:IsRace(RACE_PSYCHO) and c:IsAbleToGraveAsCost() and Duel.GetMZoneCount(tp,c)>0 return c:IsFaceup() and c:IsRace(RACE_PSYCHO) and c:IsAbleToGraveAsCost() and Duel.GetMZoneCount(tp,c)>0
end end
function cm.spfilter(c,e,tp) function cm.filter(c,e,tp)
return c:IsLevel(7) and c:IsRace(RACE_PSYCHO) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) return c:IsLevel(7) and c:IsRace(RACE_PSYCHO) and RD.IsCanBeSpecialSummoned(c,e,tp,POS_FACEUP)
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)
e:SetLabel(1) RD.SetCostLabel(e)
if chk==0 then return Duel.IsExistingMatchingCard(cm.costfilter,tp,LOCATION_MZONE,0,1,nil,tp) end if chk==0 then return Duel.IsExistingMatchingCard(cm.costfilter,tp,LOCATION_MZONE,0,1,nil,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,cm.costfilter,tp,LOCATION_MZONE,0,1,1,nil,tp) local g=Duel.SelectMatchingCard(tp,cm.costfilter,tp,LOCATION_MZONE,0,1,1,nil,tp)
...@@ -32,23 +32,16 @@ function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -32,23 +32,16 @@ function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
end end
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)
local res=e:GetLabel()==1 or Duel.GetMZoneCount(tp)>0 local res=RD.IsCostLabel(e) or Duel.GetMZoneCount(tp)>0
if chk==0 then if chk==0 then
e:SetLabel(0) RD.ResetCostLabel(e)
return res and Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_HAND,0,1,nil,e,tp) return res and Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_HAND,0,1,nil,e,tp)
end end
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.activate(e,tp,eg,ep,ev,re,r,rp) function cm.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetMZoneCount(tp)<1 then return end if RD.SelectAndSpecialSummon(cm.filter,tp,LOCATION_HAND,0,1,1,nil,e,POS_FACEUP)~=0 and e:GetLabel()==2 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local tc=RD.GetOperatedGroup():GetFirst()
local g=Duel.SelectMatchingCard(tp,cm.spfilter,tp,LOCATION_HAND,0,1,1,nil,e,tp) RD.AttachAtkDef(e,tc,1500,0,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
if g:GetCount()>0 and Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)~=0 and e:GetLabel()==2 then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(1500)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
g:GetFirst():RegisterEffect(e1)
end end
end end
\ No newline at end of file
...@@ -18,38 +18,24 @@ end ...@@ -18,38 +18,24 @@ end
function cm.costfilter(c) function cm.costfilter(c)
return c:IsRace(RACE_PSYCHO) and c:IsAbleToDeckOrExtraAsCost() return c:IsRace(RACE_PSYCHO) and c:IsAbleToDeckOrExtraAsCost()
end end
function cm.thfilter(c) function cm.filter(c)
return c:IsType(TYPE_NORMAL) and c:IsRace(RACE_PSYCHO) and c:IsAbleToHand() return c:IsType(TYPE_NORMAL) and c:IsRace(RACE_PSYCHO) and c:IsAbleToHand()
end end
function cm.costcheck(g,tp) function cm.exfilter(c)
return Duel.IsExistingMatchingCard(cm.thfilter,tp,LOCATION_GRAVE,0,1,g) return c:IsCode(list[1]) and c:IsLocation(LOCATION_HAND)
end end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk) function cm.costcheck(g,e,tp)
local g=Duel.GetMatchingGroup(cm.costfilter,tp,LOCATION_GRAVE,0,nil) return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_GRAVE,0,1,g)
if chk==0 then return g:CheckSubGroup(cm.costcheck,2,2,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local sg=g:SelectSubGroup(tp,cm.costcheck,false,2,2,tp)
Duel.ConfirmCards(1-tp,sg)
Duel.SendtoDeck(sg,nil,0,REASON_COST)
local ct=Duel.GetOperatedGroup():FilterCount(Card.IsLocation,nil,LOCATION_DECK)
Duel.SortDecktop(tp,tp,ct)
for i=1,ct do
local tc=Duel.GetDecktopGroup(tp,1):GetFirst()
Duel.MoveSequence(tc,1)
end
end end
cm.cost=RD.CostSendGraveSubToDeckBottom(cm.costfilter,cm.costcheck,2,2)
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.thfilter,tp,LOCATION_GRAVE,0,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_GRAVE) Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_GRAVE)
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_ATOHAND) RD.SelectAndDoAction(HINTMSG_ATOHAND,aux.NecroValleyFilter(cm.filter),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) if RD.SendToHandAndExists(g,1-tp,cm.exfilter,1,nil) then
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
if g:GetFirst():IsCode(list[1]) then
Duel.Recover(tp,1000,REASON_EFFECT) Duel.Recover(tp,1000,REASON_EFFECT)
end end
end end)
end end
\ No newline at end of file
...@@ -4,7 +4,7 @@ cm.name="王家魔族指令" ...@@ -4,7 +4,7 @@ cm.name="王家魔族指令"
function cm.initial_effect(c) function cm.initial_effect(c)
--Activate --Activate
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_ATKCHANGE) e1:SetCategory(CATEGORY_ATKCHANGE+CATEGORY_POSITION)
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)
...@@ -19,30 +19,16 @@ end ...@@ -19,30 +19,16 @@ end
function cm.filter(c) function cm.filter(c)
return c:IsFaceup() and c:IsAttribute(ATTRIBUTE_LIGHT) and c:IsRace(RACE_FIEND) return c:IsFaceup() and c:IsAttribute(ATTRIBUTE_LIGHT) and c:IsRace(RACE_FIEND)
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.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.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,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)
if g:GetCount()>0 then
Duel.HintSelection(g)
local tc=g:GetFirst() local tc=g:GetFirst()
local e1=Effect.CreateEffect(e:GetHandler()) RD.AttachAtkDef(e,tc,1000,0,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
e1:SetType(EFFECT_TYPE_SINGLE) if RD.IsCanChangePosition(tc) and Duel.SelectYesNo(tp,aux.Stringid(m,2)) then
e1:SetCode(EFFECT_UPDATE_ATTACK) RD.ChangePosition(tc)
e1:SetValue(1000)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
if tc:IsCanChangePosition() and RushDuel.IsHasDefense(tc) and Duel.SelectYesNo(tp,aux.Stringid(m,2)) then
Duel.BreakEffect()
Duel.ChangePosition(g,POS_FACEUP_DEFENSE,POS_FACEUP_DEFENSE,POS_FACEUP_ATTACK,POS_FACEUP_ATTACK)
end end
end end)
end end
\ No newline at end of file
...@@ -17,20 +17,11 @@ end ...@@ -17,20 +17,11 @@ end
function cm.costfilter(c) function cm.costfilter(c)
return c:IsDefenseBelow(100) and c:IsAbleToDeckOrExtraAsCost() return c:IsDefenseBelow(100) and c:IsAbleToDeckOrExtraAsCost()
end end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk) cm.cost=RD.CostSendGraveToDeck(cm.costfilter,4,4)
if chk==0 then return Duel.IsExistingMatchingCard(cm.costfilter,tp,LOCATION_GRAVE,0,4,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectMatchingCard(tp,cm.costfilter,tp,LOCATION_GRAVE,0,4,4,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.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.activate(e,tp,eg,ep,ev,re,r,rp) function cm.activate(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
...@@ -16,32 +16,22 @@ end ...@@ -16,32 +16,22 @@ end
function cm.costfilter(c) function cm.costfilter(c)
return c:IsType(TYPE_MONSTER) and c:IsAbleToGraveAsCost() return c:IsType(TYPE_MONSTER) and c:IsAbleToGraveAsCost()
end end
function cm.posfilter(c) function cm.filter(c)
return c:IsCanChangePosition() and RushDuel.IsHasDefense(c) return RD.IsCanChangePosition(c)
end end
function cm.exfilter(c) function cm.exfilter(c)
return c:IsFaceup() and c:IsLevel(10) return c:IsFaceup() and c:IsLevel(10)
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.IsExistingMatchingCard(cm.posfilter,tp,0,LOCATION_MZONE,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,0,LOCATION_MZONE,1,nil) end
local g=Duel.GetMatchingGroup(cm.posfilter,tp,0,LOCATION_MZONE,nil) local g=Duel.GetMatchingGroup(cm.filter,tp,0,LOCATION_MZONE,nil)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
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_POSCHANGE) RD.SelectAndDoAction(HINTMSG_POSCHANGE,cm.filter,tp,0,LOCATION_MZONE,1,1,nil,function(g)
local g=Duel.SelectMatchingCard(tp,cm.posfilter,tp,0,LOCATION_MZONE,1,1,nil) if RD.ChangePosition(g)~=0 and Duel.IsExistingMatchingCard(cm.exfilter,tp,LOCATION_MZONE,0,1,nil) then
if g:GetCount()>0 then RD.CanDraw(aux.Stringid(m,1),tp,1)
Duel.HintSelection(g)
if Duel.ChangePosition(g,POS_FACEUP_DEFENSE,POS_FACEUP_DEFENSE,POS_FACEUP_ATTACK,POS_FACEUP_ATTACK)~=0
and Duel.IsExistingMatchingCard(cm.exfilter,tp,LOCATION_MZONE,0,1,nil)
and Duel.IsPlayerCanDraw(tp,1) and Duel.SelectYesNo(tp,aux.Stringid(m,1)) then
Duel.Draw(tp,1,REASON_EFFECT)
end end
end end)
end end
\ No newline at end of file
...@@ -20,28 +20,20 @@ end ...@@ -20,28 +20,20 @@ end
function cm.costfilter(c) function cm.costfilter(c)
return c:IsRace(RACE_AQUA) and c:IsAbleToGraveAsCost() return c:IsRace(RACE_AQUA) and c:IsAbleToGraveAsCost()
end end
function cm.desfilter(c) function cm.filter(c)
return c:IsFaceup() and c:IsLevelBelow(8) return c:IsFaceup() and c:IsLevelBelow(8)
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)
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.IsExistingMatchingCard(cm.desfilter,tp,0,LOCATION_MZONE,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,0,LOCATION_MZONE,1,nil) end
local g=Duel.GetMatchingGroup(cm.desfilter,tp,0,LOCATION_MZONE,nil) local g=Duel.GetMatchingGroup(cm.filter,tp,0,LOCATION_MZONE,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
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_DESTROY) RD.SelectAndDoAction(HINTMSG_DESTROY,cm.filter,tp,0,LOCATION_MZONE,1,1,nil,function(g)
local g=Duel.SelectMatchingCard(tp,cm.desfilter,tp,0,LOCATION_MZONE,1,1,nil)
if g:GetCount()>0 then
Duel.HintSelection(g)
if Duel.Destroy(g,REASON_EFFECT)~=0 if Duel.Destroy(g,REASON_EFFECT)~=0
and bit.band(g:GetFirst():GetPreviousRaceOnField(),RACE_SPELLCASTER)~=0 and bit.band(g:GetFirst():GetPreviousRaceOnField(),RACE_SPELLCASTER)~=0
and Duel.GetFieldGroupCount(tp,0,LOCATION_MZONE)>0 and Duel.GetFieldGroupCount(tp,0,LOCATION_MZONE)>0
...@@ -49,5 +41,5 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -49,5 +41,5 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local dg=Duel.GetFieldGroup(tp,0,LOCATION_MZONE) local dg=Duel.GetFieldGroup(tp,0,LOCATION_MZONE)
Duel.Destroy(dg,REASON_EFFECT) Duel.Destroy(dg,REASON_EFFECT)
end end
end end)
end end
\ No newline at end of file
...@@ -25,20 +25,12 @@ function cm.condition(e,tp,eg,ep,ev,re,r,rp) ...@@ -25,20 +25,12 @@ 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 true end if chk==0 then return true end
Duel.SetTargetPlayer(tp) RD.TargetRecover(tp,500)
Duel.SetTargetParam(500)
Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,500)
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 p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM) if RD.Recover()~=0 then
if Duel.Recover(p,d,REASON_EFFECT)~=0 RD.CanSelectAndDoAction(aux.Stringid(m,1),HINTMSG_DESTROY,cm.desfilter,tp,0,LOCATION_ONFIELD,1,1,nil,function(g)
and Duel.IsExistingMatchingCard(cm.desfilter,tp,0,LOCATION_ONFIELD,1,nil)
and Duel.SelectYesNo(tp,aux.Stringid(m,1)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectMatchingCard(tp,cm.desfilter,tp,0,LOCATION_ONFIELD,1,1,nil)
if g:GetCount()>0 then
Duel.HintSelection(g)
Duel.Destroy(g,REASON_EFFECT) Duel.Destroy(g,REASON_EFFECT)
end end)
end end
end end
\ No newline at end of file
...@@ -13,46 +13,23 @@ function cm.initial_effect(c) ...@@ -13,46 +13,23 @@ function cm.initial_effect(c)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
--Activate --Activate
function cm.spfilter(c,e,tp) function cm.filter(c,e,tp)
return c:IsType(TYPE_NORMAL) and c:IsLevelBelow(4) and c:IsRace(RACE_PLANT) return c:IsType(TYPE_NORMAL) and c:IsLevelBelow(4) and c:IsRace(RACE_PLANT)
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.IsPlayerCanDiscardDeckAsCost(tp,1) end
Duel.DiscardDeck(tp,1,REASON_COST)
end end
cm.cost=RD.CostSendDeckTopToGrave(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.filter,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.activate(e,tp,eg,ep,ev,re,r,rp) function cm.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetMZoneCount(tp)<1 then return end if RD.SelectAndSpecialSummon(aux.NecroValleyFilter(cm.filter),tp,LOCATION_GRAVE,0,1,1,nil,e,POS_FACEUP)~=0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local tc=Duel.GetOperatedGroup():GetFirst()
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cm.spfilter),tp,LOCATION_GRAVE,0,1,1,nil,e,tp) RD.AttachEndPhase(e,tc,tp,m,cm.tdop,aux.Stringid(m,1))
local tc=g:GetFirst()
if tc and Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)~=0 then
tc:RegisterFlagEffect(0,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,m,aux.Stringid(m,1))
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetCountLimit(1)
e1:SetLabelObject(tc)
e1:SetCondition(cm.tdcon)
e1:SetOperation(cm.tdop)
Duel.RegisterEffect(e1,tp)
end
end
function cm.tdcon(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject()
local fids={tc:GetFlagEffectLabel(tc,0)}
for i=1,#fids do
if fids[i]==m then return true end
end end
e:Reset()
return false
end end
function cm.tdop(e,tp,eg,ep,ev,re,r,rp) function cm.tdop(e,tp,eg,ep,ev,re,r,rp)
Duel.SendtoDeck(e:GetLabelObject(),nil,1,REASON_EFFECT) Duel.Hint(HINT_CARD,0,m)
RD.SendToDeckBottom(e:GetLabelObject())
end end
\ No newline at end of file
...@@ -19,33 +19,21 @@ end ...@@ -19,33 +19,21 @@ end
function cm.confilter(c) function cm.confilter(c)
return c:IsFaceup() and c:IsCode(list[1]) return c:IsFaceup() and c:IsCode(list[1])
end end
function cm.spfilter(c,e,tp) function cm.filter(c,e,tp)
return c:IsRace(RACE_BEASTWARRIOR) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) return c:IsRace(RACE_BEASTWARRIOR) 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_ONFIELD,0,1,nil) return Duel.IsExistingMatchingCard(cm.confilter,tp,LOCATION_ONFIELD,0,1,nil)
end end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk) cm.cost=RD.CostPayLP(1000)
if chk==0 then return Duel.CheckLPCost(tp,1000) end
Duel.PayLPCost(tp,1000)
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.filter,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.activate(e,tp,eg,ep,ev,re,r,rp) function cm.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetMZoneCount(tp)<1 then return end if RD.SelectAndSpecialSummon(aux.NecroValleyFilter(cm.filter),tp,LOCATION_GRAVE,0,1,1,nil,e,POS_FACEUP)~=0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local tc=Duel.GetOperatedGroup():GetFirst()
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cm.spfilter),tp,LOCATION_GRAVE,0,1,1,nil,e,tp) RD.AttachPierce(e,tc,aux.Stringid(m,1),RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
local tc=g:GetFirst()
if tc and Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)~=0 then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetDescription(aux.Stringid(m,1))
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 end
\ No newline at end of file
...@@ -16,24 +16,24 @@ function cm.initial_effect(c) ...@@ -16,24 +16,24 @@ function cm.initial_effect(c)
end end
--Activate --Activate
function cm.confilter(c) function cm.confilter(c)
return c:IsFaceup() and (RushDuel.IsLegendCode(c,list[1]) return c:IsFaceup() and (RD.IsLegendCode(c,list[1])
or (c:IsType(TYPE_NORMAL) and c:IsLevelAbove(7) and c:IsRace(RACE_FIEND))) or (c:IsType(TYPE_NORMAL) and c:IsLevelAbove(7) and c:IsRace(RACE_FIEND)))
end end
function cm.tgfilter(c) function cm.filter(c)
return c:IsType(TYPE_NORMAL) and c:IsAbleToGrave() return c:IsType(TYPE_NORMAL) and c:IsAbleToGrave()
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)
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.tgfilter,tp,LOCATION_HAND,0,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_HAND,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_HAND) Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_HAND)
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_TOGRAVE) RD.SelectAndDoAction(HINTMSG_TOGRAVE,cm.filter,tp,LOCATION_HAND,0,1,1,nil,function(g)
local g=Duel.SelectMatchingCard(tp,cm.tgfilter,tp,LOCATION_HAND,0,1,1,nil) if RD.SendToGraveAndExists(g) then
if g:GetCount()>0 and Duel.SendtoGrave(g,REASON_EFFECT)~=0 then Duel.BreakEffect()
Duel.BreakEffect() Duel.Damage(1-tp,1300,REASON_EFFECT)
Duel.Damage(1-tp,1300,REASON_EFFECT) end
end end)
end end
\ No newline at end of file
...@@ -16,22 +16,19 @@ end ...@@ -16,22 +16,19 @@ end
function cm.confilter(c) function cm.confilter(c)
return c:IsFaceup() and c:IsRace(RACE_PLANT) return c:IsFaceup() and c:IsRace(RACE_PLANT)
end end
function cm.desfilter(c) function cm.filter(c)
return c:IsType(TYPE_SPELL+TYPE_TRAP) return c:IsType(TYPE_SPELL+TYPE_TRAP)
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)
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.desfilter,tp,0,LOCATION_ONFIELD,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,0,LOCATION_ONFIELD,1,nil) end
local g=Duel.GetMatchingGroup(cm.desfilter,tp,0,LOCATION_ONFIELD,nil) local g=Duel.GetMatchingGroup(cm.filter,tp,0,LOCATION_ONFIELD,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
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_DESTROY) RD.SelectAndDoAction(HINTMSG_DESTROY,cm.filter,tp,0,LOCATION_ONFIELD,1,1,nil,function(g)
local g=Duel.SelectMatchingCard(tp,cm.desfilter,tp,0,LOCATION_ONFIELD,1,1,nil)
if g:GetCount()>0 then
Duel.HintSelection(g)
Duel.Destroy(g,REASON_EFFECT) Duel.Destroy(g,REASON_EFFECT)
end end)
end end
\ No newline at end of file
...@@ -12,32 +12,23 @@ function cm.initial_effect(c) ...@@ -12,32 +12,23 @@ function cm.initial_effect(c)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
--Activate --Activate
function cm.tdfilter(c) function cm.filter(c)
return c:IsType(TYPE_MONSTER) and c:IsAbleToDeck() return c:IsType(TYPE_MONSTER) and c:IsAbleToDeck()
end end
function cm.thfilter(c) function cm.thfilter(c)
return c:IsFaceup() and c:IsAbleToHand() return c:IsFaceup() and c:IsAbleToHand()
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.tdfilter,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,nil) end
local g=Duel.GetMatchingGroup(cm.tdfilter,tp,LOCATION_GRAVE,LOCATION_GRAVE,nil) local g=Duel.GetMatchingGroup(cm.filter,tp,LOCATION_GRAVE,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.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_TODECK) RD.SelectAndDoAction(HINTMSG_TODECK,aux.NecroValleyFilter(cm.filter),tp,LOCATION_GRAVE,LOCATION_GRAVE,1,1,nil,function(g)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cm.tdfilter),tp,LOCATION_GRAVE,LOCATION_GRAVE,1,1,nil) if RD.SendToDeckAndExists(g) and Duel.GetFieldGroupCount(tp,0,LOCATION_HAND)==0 then
if g:GetCount()>0 then RD.CanSelectAndDoAction(aux.Stringid(m,1),HINTMSG_RTOHAND,cm.thfilter,tp,0,LOCATION_MZONE,1,1,nil,function(sg)
Duel.ConfirmCards(1-tp,g) RD.SendToOpponentHand(sg)
if Duel.SendtoDeck(g,nil,2,REASON_EFFECT)~=0 end)
and Duel.GetFieldGroupCount(tp,0,LOCATION_HAND)==0
and Duel.IsExistingMatchingCard(cm.thfilter,tp,0,LOCATION_MZONE,1,nil)
and Duel.SelectYesNo(tp,aux.Stringid(m,1)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local sg=Duel.SelectMatchingCard(tp,cm.thfilter,tp,0,LOCATION_MZONE,1,1,nil)
if sg:GetCount()>0 then
Duel.HintSelection(sg)
Duel.SendtoHand(sg,nil,REASON_EFFECT)
end
end end
end end)
end end
\ No newline at end of file
...@@ -16,7 +16,7 @@ end ...@@ -16,7 +16,7 @@ end
function cm.confilter(c) function cm.confilter(c)
return c:IsFaceup() and c:IsRace(RACE_WARRIOR+RACE_WINDBEAST) return c:IsFaceup() and c:IsRace(RACE_WARRIOR+RACE_WINDBEAST)
end end
function cm.desfilter(c) function cm.filter(c)
return c:IsType(TYPE_SPELL+TYPE_TRAP) return c:IsType(TYPE_SPELL+TYPE_TRAP)
end end
function cm.tdfilter(c) function cm.tdfilter(c)
...@@ -26,24 +26,16 @@ function cm.condition(e,tp,eg,ep,ev,re,r,rp) ...@@ -26,24 +26,16 @@ function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(cm.confilter,tp,LOCATION_MZONE,0,2,nil) return Duel.IsExistingMatchingCard(cm.confilter,tp,LOCATION_MZONE,0,2,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)
if chk==0 then return Duel.IsExistingMatchingCard(cm.desfilter,tp,0,LOCATION_ONFIELD,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,0,LOCATION_ONFIELD,1,nil) end
local g=Duel.GetMatchingGroup(cm.desfilter,tp,0,LOCATION_ONFIELD,nil) local g=Duel.GetMatchingGroup(cm.filter,tp,0,LOCATION_ONFIELD,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
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_DESTROY) RD.SelectAndDoAction(HINTMSG_DESTROY,cm.filter,tp,0,LOCATION_ONFIELD,1,1,nil,function(g)
local g=Duel.SelectMatchingCard(tp,cm.desfilter,tp,0,LOCATION_ONFIELD,1,1,nil) if Duel.Destroy(g,REASON_EFFECT)~=0 then
if g:GetCount()>0 then RD.CanSelectAndDoAction(aux.Stringid(m,1),HINTMSG_TODECK,aux.NecroValleyFilter(cm.tdfilter),tp,LOCATION_GRAVE,0,1,1,nil,function(sg)
Duel.HintSelection(g) RD.SendToDeckTop(sg)
if Duel.Destroy(g,REASON_EFFECT)~=0 end)
and Duel.IsExistingMatchingCard(aux.NecroValleyFilter(cm.tdfilter),tp,LOCATION_GRAVE,0,1,nil)
and Duel.SelectYesNo(tp,aux.Stringid(m,1)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local sg=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cm.tdfilter),tp,LOCATION_GRAVE,0,1,1,nil)
if sg:GetCount()>0 then
Duel.SendtoDeck(sg,nil,0,REASON_EFFECT)
Duel.ConfirmDecktop(tp,1)
end
end end
end end)
end end
\ No newline at end of file
...@@ -13,7 +13,7 @@ function cm.initial_effect(c) ...@@ -13,7 +13,7 @@ function cm.initial_effect(c)
e2:SetCode(EFFECT_UPDATE_ATTACK) e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetRange(LOCATION_FZONE) e2:SetRange(LOCATION_FZONE)
e2:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE) e2:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e2:SetTarget(cm.adtg) e2:SetTarget(cm.uptg)
e2:SetValue(200) e2:SetValue(200)
c:RegisterEffect(e2) c:RegisterEffect(e2)
local e3=e2:Clone() local e3=e2:Clone()
...@@ -21,6 +21,6 @@ function cm.initial_effect(c) ...@@ -21,6 +21,6 @@ function cm.initial_effect(c)
c:RegisterEffect(e3) c:RegisterEffect(e3)
end end
--Atk & Def --Atk & Def
function cm.adtg(e,c) function cm.uptg(e,c)
return c:IsFaceup() and c:IsRace(RACE_DINOSAUR+RACE_ZOMBIE+RACE_ROCK) return c:IsFaceup() and c:IsRace(RACE_DINOSAUR+RACE_ZOMBIE+RACE_ROCK)
end end
\ No newline at end of file
...@@ -19,7 +19,7 @@ end ...@@ -19,7 +19,7 @@ end
function cm.confilter2(c,tp) function cm.confilter2(c,tp)
return c:GetSummonPlayer()==tp return c:GetSummonPlayer()==tp
end end
function cm.tdfilter(c) function cm.filter(c)
return c:IsType(TYPE_MONSTER) and c:IsAbleToDeck() return c:IsType(TYPE_MONSTER) and c:IsAbleToDeck()
end end
function cm.exfilter(c) function cm.exfilter(c)
...@@ -30,25 +30,16 @@ function cm.condition(e,tp,eg,ep,ev,re,r,rp) ...@@ -30,25 +30,16 @@ function cm.condition(e,tp,eg,ep,ev,re,r,rp)
and eg:IsExists(cm.confilter2,1,nil,1-tp) and eg:IsExists(cm.confilter2,1,nil,1-tp)
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.tdfilter,tp,0,LOCATION_GRAVE,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,0,LOCATION_GRAVE,1,nil) end
local g=Duel.GetMatchingGroup(cm.tdfilter,tp,0,LOCATION_GRAVE,nil) local g=Duel.GetMatchingGroup(cm.filter,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.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_TODECK) RD.SelectAndDoAction(HINTMSG_TODECK,aux.NecroValleyFilter(cm.filter),tp,0,LOCATION_GRAVE,1,5,nil,function(g)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cm.tdfilter),tp,0,LOCATION_GRAVE,1,5,nil) if RD.SendToDeckAndExists(g) and Duel.IsExistingMatchingCard(cm.exfilter,tp,0,LOCATION_MZONE,1,nil) then
if g:GetCount()>0 then RD.CanSelectAndDoAction(aux.Stringid(m,1),HINTMSG_TODECK,aux.NecroValleyFilter(cm.filter),tp,0,LOCATION_GRAVE,1,5,nil,function(sg)
Duel.ConfirmCards(1-tp,g) RD.SendToDeckAndExists(sg)
if Duel.SendtoDeck(g,nil,2,REASON_EFFECT)~=0 end)
and Duel.IsExistingMatchingCard(cm.exfilter,tp,0,LOCATION_MZONE,1,nil)
and Duel.IsExistingMatchingCard(aux.NecroValleyFilter(cm.tdfilter),tp,0,LOCATION_GRAVE,1,nil)
and Duel.SelectYesNo(tp,aux.Stringid(m,1)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local sg=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cm.tdfilter),tp,0,LOCATION_GRAVE,1,5,nil)
if sg:GetCount()>0 then
Duel.ConfirmCards(1-tp,sg)
Duel.SendtoDeck(sg,nil,2,REASON_EFFECT)
end
end end
end end)
end end
\ No newline at end of file
...@@ -23,24 +23,11 @@ end ...@@ -23,24 +23,11 @@ end
function cm.activate(e,tp,eg,ep,ev,re,r,rp) function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetAttacker() local tc=Duel.GetAttacker()
if tc and tc:IsRelateToBattle() and tc:IsFaceup() then if tc and tc:IsRelateToBattle() and tc:IsFaceup() then
local e1=Effect.CreateEffect(e:GetHandler()) RD.AttachAtkDef(e,tc,-600,0,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(-600)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
if Duel.IsExistingMatchingCard(cm.exfilter,tp,0,LOCATION_MZONE,1,nil) then if Duel.IsExistingMatchingCard(cm.exfilter,tp,0,LOCATION_MZONE,1,nil) then
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 sg=Duel.SelectMatchingCard(tp,Card.IsFaceup,tp,0,LOCATION_MZONE,1,1,nil) RD.AttachAtkDef(e,g:GetFirst(),-1000000,0,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
if sg:GetCount()>0 then end)
Duel.HintSelection(sg)
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetValue(-1000000)
e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
sg:GetFirst():RegisterEffect(e2)
end
end end
end end
end end
\ No newline at end of file
...@@ -17,34 +17,22 @@ end ...@@ -17,34 +17,22 @@ end
function cm.costfilter(c) function cm.costfilter(c)
return c:IsRace(RACE_PLANT) and c:IsAbleToDeckOrExtraAsCost() return c:IsRace(RACE_PLANT) and c:IsAbleToDeckOrExtraAsCost()
end end
function cm.posfilter(c) function cm.filter(c)
return c:IsAttackPos() and c:IsCanChangePosition() and RushDuel.IsHasDefense(c) return c:IsAttackPos() and RD.IsCanChangePosition(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)
local c=Duel.GetAttackTarget() local c=Duel.GetAttackTarget()
return Duel.GetAttacker():IsControler(1-tp) and c and c:IsFaceup() and c:IsRace(RACE_PLANT) return Duel.GetAttacker():IsControler(1-tp) and c and c:IsFaceup() and c:IsRace(RACE_PLANT)
end end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk) cm.cost=RD.CostSendGraveToDeckBottom(cm.costfilter,2,2)
if chk==0 then return Duel.IsExistingMatchingCard(cm.costfilter,tp,LOCATION_GRAVE,0,2,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectMatchingCard(tp,cm.costfilter,tp,LOCATION_GRAVE,0,2,2,nil)
Duel.ConfirmCards(1-tp,g)
Duel.SendtoDeck(g,nil,0,REASON_COST)
local ct=Duel.GetOperatedGroup():FilterCount(Card.IsLocation,nil,LOCATION_DECK)
Duel.SortDecktop(tp,tp,ct)
for i=1,ct do
local tg=Duel.GetDecktopGroup(tp,1)
Duel.MoveSequence(tg:GetFirst(),1)
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.posfilter,tp,0,LOCATION_MZONE,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,0,LOCATION_MZONE,1,nil) end
local g=Duel.GetMatchingGroup(cm.posfilter,tp,0,LOCATION_MZONE,nil) local g=Duel.GetMatchingGroup(cm.filter,tp,0,LOCATION_MZONE,nil)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,g:GetCount(),0,0) Duel.SetOperationInfo(0,CATEGORY_POSITION,g,g:GetCount(),0,0)
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 g=Duel.GetMatchingGroup(cm.posfilter,tp,0,LOCATION_MZONE,nil) local g=Duel.GetMatchingGroup(cm.filter,tp,0,LOCATION_MZONE,nil)
if g:GetCount()>0 then if g:GetCount()>0 then
Duel.ChangePosition(g,POS_FACEUP_DEFENSE) RD.ChangePosition(g,POS_FACEUP_DEFENSE)
end end
end end
\ No newline at end of file
...@@ -18,18 +18,12 @@ function cm.costfilter(c) ...@@ -18,18 +18,12 @@ function cm.costfilter(c)
return c:IsRace(RACE_PLANT) and c:IsAbleToDeckOrExtraAsCost() return c:IsRace(RACE_PLANT) and c:IsAbleToDeckOrExtraAsCost()
end end
function cm.spfilter(c,e,tp) function cm.spfilter(c,e,tp)
return c:IsRace(RACE_PLANT) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_ATTACK) return c:IsRace(RACE_PLANT) and RD.IsCanBeSpecialSummoned(c,e,tp,POS_FACEUP_ATTACK)
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.GetAttacker():IsControler(1-tp) and Duel.GetAttackTarget()==nil return Duel.GetAttacker():IsControler(1-tp) and Duel.GetAttackTarget()==nil
end end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk) cm.cost=RD.CostSendGraveToDeck(cm.costfilter,3,3)
if chk==0 then return Duel.IsExistingMatchingCard(cm.costfilter,tp,LOCATION_GRAVE,0,3,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectMatchingCard(tp,cm.costfilter,tp,LOCATION_GRAVE,0,3,3,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 true end if chk==0 then return true end
local tc=Duel.GetAttacker() local tc=Duel.GetAttacker()
...@@ -37,14 +31,7 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -37,14 +31,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)
local tc=Duel.GetAttacker() local tc=Duel.GetAttacker()
if tc and tc:IsRelateToBattle() and Duel.Destroy(tc,REASON_EFFECT)~=0 if tc and tc:IsRelateToBattle() and Duel.Destroy(tc,REASON_EFFECT)~=0 then
and Duel.GetMZoneCount(tp)>0 RD.CanSelectAndSpecialSummon(aux.Stringid(m,1),aux.NecroValleyFilter(cm.spfilter),tp,LOCATION_GRAVE,0,1,1,nil,e,POS_FACEUP_ATTACK)
and Duel.IsExistingMatchingCard(aux.NecroValleyFilter(cm.spfilter),tp,LOCATION_GRAVE,0,1,nil,e,tp)
and Duel.SelectYesNo(tp,aux.Stringid(m,1)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cm.spfilter),tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
if sg:GetCount()>0 then
Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP_ATTACK)
end
end end
end end
\ No newline at end of file
...@@ -23,25 +23,22 @@ end ...@@ -23,25 +23,22 @@ end
function cm.confilter2(c,tp) function cm.confilter2(c,tp)
return c:GetSummonPlayer()==tp and c:IsFaceup() and c:IsLevelAbove(5) return c:GetSummonPlayer()==tp and c:IsFaceup() and c:IsLevelAbove(5)
end end
function cm.posfilter(c) function cm.filter(c)
return c:IsAttackPos() and c:IsCanChangePosition() and RushDuel.IsHasDefense(c) return c:IsAttackPos() and RD.IsCanChangePosition(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.IsExistingMatchingCard(cm.confilter1,tp,LOCATION_MZONE,0,1,nil) return Duel.IsExistingMatchingCard(cm.confilter1,tp,LOCATION_MZONE,0,1,nil)
and eg:IsExists(cm.confilter2,1,nil,1-tp) and eg:IsExists(cm.confilter2,1,nil,1-tp)
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.posfilter,tp,0,LOCATION_MZONE,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,0,LOCATION_MZONE,1,nil) end
local g=Duel.GetMatchingGroup(cm.posfilter,tp,0,LOCATION_MZONE,nil) local g=Duel.GetMatchingGroup(cm.filter,tp,0,LOCATION_MZONE,nil)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
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_POSCHANGE) RD.SelectAndDoAction(HINTMSG_POSCHANGE,cm.filter,tp,0,LOCATION_MZONE,1,1,nil,function(g)
local g=Duel.SelectMatchingCard(tp,cm.posfilter,tp,0,LOCATION_MZONE,1,1,nil) if RD.ChangePosition(g,POS_FACEUP_DEFENSE)~=0 then
if g:GetCount()>0 then
Duel.HintSelection(g)
if Duel.ChangePosition(g,POS_FACEUP_DEFENSE)~=0 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
...@@ -22,8 +22,8 @@ end ...@@ -22,8 +22,8 @@ end
function cm.confilter2(c,tp) function cm.confilter2(c,tp)
return c:GetSummonPlayer()==tp return c:GetSummonPlayer()==tp
end end
function cm.spfilter(c,e,tp) function cm.filter(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(cm.confilter1,tp,LOCATION_MZONE,0,1,nil) return Duel.IsExistingMatchingCard(cm.confilter1,tp,LOCATION_MZONE,0,1,nil)
...@@ -31,14 +31,11 @@ function cm.condition(e,tp,eg,ep,ev,re,r,rp) ...@@ -31,14 +31,11 @@ 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.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.filter,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.activate(e,tp,eg,ep,ev,re,r,rp) function cm.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetMZoneCount(tp)<1 then return end if RD.SelectAndSpecialSummon(aux.NecroValleyFilter(cm.filter),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
Duel.BreakEffect() Duel.BreakEffect()
Duel.Recover(tp,1500,REASON_EFFECT) Duel.Recover(tp,1500,REASON_EFFECT)
end end
......
...@@ -16,28 +16,23 @@ function cm.initial_effect(c) ...@@ -16,28 +16,23 @@ function cm.initial_effect(c)
end end
--Activate --Activate
function cm.confilter(c,tp) function cm.confilter(c,tp)
return (RushDuel.IsLegendCode(c,list[1]) or c:GetPreviousCodeOnField()==list[1] or ( return (RD.IsLegendCode(c,list[1]) or c:GetPreviousCodeOnField()==list[1] or (
bit.band(c:GetPreviousTypeOnField(),TYPE_NORMAL)~=0 bit.band(c:GetPreviousTypeOnField(),TYPE_NORMAL)~=0
and c:GetPreviousLevelOnField()>=7 and c:GetPreviousLevelOnField()>=7
and bit.band(c:GetPreviousRaceOnField(),RACE_FIEND)~=0 and bit.band(c:GetPreviousRaceOnField(),RACE_FIEND)~=0
)) and c:GetPreviousControler()==tp and c==Duel.GetAttackTarget() )) and c:GetPreviousControler()==tp and c==Duel.GetAttackTarget()
end end
function cm.spfilter(c,e,tp) function cm.filter(c,e,tp)
return c:IsType(TYPE_NORMAL) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) return c:IsType(TYPE_NORMAL) 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 eg:IsExists(cm.confilter,1,nil,tp) return eg:IsExists(cm.confilter,1,nil,tp)
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.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.filter,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.activate(e,tp,eg,ep,ev,re,r,rp) function cm.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetMZoneCount(tp)<1 then return end RD.SelectAndSpecialSummon(aux.NecroValleyFilter(cm.filter),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
...@@ -40,9 +40,9 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -40,9 +40,9 @@ 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)
local g=Duel.GetMatchingGroup(cm.filter,tp,0,LOCATION_GRAVE,nil) local g=Duel.GetMatchingGroup(cm.filter,tp,0,LOCATION_GRAVE,nil)
local ct=g:GetCount() local dam=g:GetCount()*100
if ct>0 and Duel.Damage(tp,ct*100,REASON_EFFECT)~=0 then if dam~=0 and Duel.Damage(tp,dam,REASON_EFFECT)~=0 then
Duel.BreakEffect() Duel.BreakEffect()
Duel.SendtoDeck(g,nil,2,REASON_EFFECT) RD.SendToDeckAndExists(g)
end end
end end
\ No newline at end of file
...@@ -16,35 +16,26 @@ end ...@@ -16,35 +16,26 @@ end
function cm.confilter(c,tp) function cm.confilter(c,tp)
return c:GetSummonPlayer()==tp return c:GetSummonPlayer()==tp
end end
function cm.spfilter1(c,e,tp) function cm.filter(c,e,tp)
return c:IsRace(RACE_PLANT) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) return c:IsRace(RACE_PLANT) and RD.IsCanBeSpecialSummoned(c,e,tp,POS_FACEUP)
end end
function cm.spfilter2(c,e,tp) function cm.spfilter(c,e,tp)
return c:IsType(TYPE_NORMAL) and c:IsLevel(1) and c:IsRace(RACE_PLANT) return c:IsType(TYPE_NORMAL) and c:IsLevel(1) and c:IsRace(RACE_PLANT)
and c:IsCanBeSpecialSummoned(e,0,tp,false,false) 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 eg:IsExists(cm.confilter,1,nil,1-tp) return eg:IsExists(cm.confilter,1,nil,1-tp)
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.GetMZoneCount(tp)>0 if chk==0 then return Duel.GetMZoneCount(tp)>0
and Duel.IsExistingMatchingCard(cm.spfilter1,tp,LOCATION_HAND,0,1,nil,e,tp) end and Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_HAND,0,1,nil,e,tp) end
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.activate(e,tp,eg,ep,ev,re,r,rp) function cm.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetMZoneCount(tp)<1 then return end if RD.SelectAndSpecialSummon(cm.filter,tp,LOCATION_HAND,0,1,1,nil,e,POS_FACEUP)~=0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local tc=Duel.GetOperatedGroup():GetFirst()
local g=Duel.SelectMatchingCard(tp,cm.spfilter1,tp,LOCATION_HAND,0,1,1,nil,e,tp) if tc:IsType(TYPE_NORMAL) then
if g:GetCount()>0 RD.CanSelectAndSpecialSummon(aux.Stringid(m,1),aux.NecroValleyFilter(cm.spfilter),tp,LOCATION_GRAVE,0,1,2,nil,e,POS_FACEUP)
and Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)~=0
and g:GetFirst():IsType(TYPE_NORMAL)
and Duel.GetMZoneCount(tp)>0
and Duel.IsExistingMatchingCard(aux.NecroValleyFilter(cm.spfilter2),tp,LOCATION_GRAVE,0,1,nil,e,tp)
and Duel.SelectYesNo(tp,aux.Stringid(m,1)) then
local ct=RushDuel.GetSPCount(tp,2)
local sg=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cm.spfilter2),tp,LOCATION_GRAVE,0,1,ct,nil,e,tp)
if sg:GetCount()>0 then
Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP)
end end
end end
end end
\ No newline at end of file
...@@ -19,37 +19,26 @@ end ...@@ -19,37 +19,26 @@ end
function cm.costfilter(c) function cm.costfilter(c)
return c:IsType(TYPE_TRAP) and c:IsAbleToGraveAsCost() return c:IsType(TYPE_TRAP) and c:IsAbleToGraveAsCost()
end end
function cm.thfilter1(c) function cm.filter(c)
return c:IsLevelAbove(7) and c:IsAttribute(ATTRIBUTE_DARK) and c:IsRace(RACE_SPELLCASTER) and c:IsAbleToHand() return c:IsLevelAbove(7) and c:IsAttribute(ATTRIBUTE_DARK) and c:IsRace(RACE_SPELLCASTER) and c:IsAbleToHand()
end end
function cm.thfilter2(c) function cm.exfilter(c)
return c:IsLevelAbove(6) and c:IsRace(RACE_SPELLCASTER) and c:IsAbleToHand() return c:IsCode(list[1]) and c:IsLocation(LOCATION_HAND)
end end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk) function cm.thfilter(c)
if chk==0 then return Duel.IsExistingMatchingCard(cm.costfilter,tp,LOCATION_HAND,0,1,nil) end return c:IsLevelAbove(6) and c:IsRace(RACE_SPELLCASTER) and c:IsAbleToHand()
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 end
cm.cost=RD.CostSendHandToGrave(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.IsExistingMatchingCard(cm.thfilter1,tp,LOCATION_GRAVE,0,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_GRAVE,0,1,nil) end
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.filter),tp,LOCATION_GRAVE,0,1,1,nil,function(g)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cm.thfilter1),tp,LOCATION_GRAVE,0,1,1,nil) if RD.SendToHandAndExists(g,1-tp,cm.exfilter,1,nil) then
if g:GetCount()>0 then RD.CanSelectAndDoAction(aux.Stringid(m,1),HINTMSG_ATOHAND,aux.NecroValleyFilter(cm.thfilter),tp,LOCATION_GRAVE,0,1,1,nil,function(sg)
Duel.SendtoHand(g,nil,REASON_EFFECT) RD.SendToHandAndExists(sg,1-tp)
Duel.ConfirmCards(1-tp,g) end)
if g:GetFirst():IsCode(list[1])
and Duel.IsExistingMatchingCard(aux.NecroValleyFilter(cm.thfilter2),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.thfilter2),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)
end end
\ No newline at end of file
...@@ -27,11 +27,8 @@ function cm.condition(e,tp,eg,ep,ev,re,r,rp) ...@@ -27,11 +27,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
...@@ -16,21 +16,13 @@ end ...@@ -16,21 +16,13 @@ end
function cm.thfilter(c) function cm.thfilter(c)
return c:IsType(TYPE_MONSTER) and c:IsAbleToHand() return c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
end end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk) cm.cost=RD.CostSendHandToGrave(Card.IsAbleToGraveAsCost,1,1)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToGraveAsCost,tp,LOCATION_HAND,0,1,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,Card.IsAbleToGraveAsCost,tp,LOCATION_HAND,0,1,1,e:GetHandler())
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(cm.thfilter,tp,LOCATION_GRAVE,0,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(cm.thfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_GRAVE) Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_GRAVE)
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_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
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