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

2022/3/23 模块化KP07完成

parent beddf353
...@@ -22,7 +22,7 @@ function cm.thfilter(c) ...@@ -22,7 +22,7 @@ function cm.thfilter(c)
return c:IsRace(RACE_PSYCHO) and c:IsAbleToHand() return c:IsRace(RACE_PSYCHO) 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)
return RD.IsLPBelowOpponent(tp) return RD.IsLPBelowOpponent(tp,1)
end end
cm.cost=RD.CostPayLP(500) cm.cost=RD.CostPayLP(500)
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk) function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
......
...@@ -17,7 +17,7 @@ function cm.initial_effect(c) ...@@ -17,7 +17,7 @@ function cm.initial_effect(c)
end end
--Atk Up --Atk Up
function cm.condition(e,tp,eg,ep,ev,re,r,rp) function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return RD.MaximumMode(e) and RD.IsLPBelowOpponent(tp) return RD.MaximumMode(e) and RD.IsLPBelowOpponent(tp,1)
end end
cm.cost=RD.CostSendHandToGrave(Card.IsAbleToGraveAsCost,1,1) cm.cost=RD.CostSendHandToGrave(Card.IsAbleToGraveAsCost,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)
......
...@@ -19,7 +19,7 @@ function cm.exfilter(c) ...@@ -19,7 +19,7 @@ function cm.exfilter(c)
return c:IsType(TYPE_MONSTER) and c:IsLocation(LOCATION_GRAVE) return c:IsType(TYPE_MONSTER) and c:IsLocation(LOCATION_GRAVE)
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 RD.IsLPBelowOpponent(tp) return RD.IsLPBelowOpponent(tp,1)
end end
cm.cost=RD.CostSendHandToDeckBottom(Card.IsAbleToDeckAsCost,1,1,false) cm.cost=RD.CostSendHandToDeckBottom(Card.IsAbleToDeckAsCost,1,1,false)
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk) function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
......
...@@ -29,9 +29,9 @@ function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -29,9 +29,9 @@ function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SendtoGrave(g,REASON_COST) Duel.SendtoGrave(g,REASON_COST)
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=RD.IsCostLabel(e) or Duel.GetMZoneCount(tp)>0
if chk==0 then if chk==0 then
RD.ResetCostLabel() local res=RD.IsCostLabel(e) or Duel.GetMZoneCount(tp)>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.spfilter,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)
......
...@@ -34,8 +34,8 @@ function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -34,8 +34,8 @@ 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=RD.IsCostLabel(e) or Duel.GetMZoneCount(tp)>0
if chk==0 then if chk==0 then
local res=RD.IsCostLabel(e) or Duel.GetMZoneCount(tp)>0
RD.ResetCostLabel(e) RD.ResetCostLabel(e)
return res and Duel.IsExistingMatchingCard(cm.filter,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
...@@ -43,7 +43,7 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -43,7 +43,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)
if RD.SelectAndSpecialSummon(cm.filter,tp,LOCATION_HAND,0,1,1,nil,e,POS_FACEUP)~=0 and e:GetLabel()==20170039 then if RD.SelectAndSpecialSummon(cm.filter,tp,LOCATION_HAND,0,1,1,nil,e,POS_FACEUP)~=0 and e:GetLabel()==20170039 then
local tc=RD.GetOperatedGroup():GetFirst() local tc=Duel.GetOperatedGroup():GetFirst()
RD.AttachAtkDef(e,tc,1500,0,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END) RD.AttachAtkDef(e,tc,1500,0,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
end end
end end
\ No newline at end of file
...@@ -32,8 +32,8 @@ function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -32,8 +32,8 @@ 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=RD.IsCostLabel(e) or Duel.GetMZoneCount(tp)>0
if chk==0 then if chk==0 then
local res=RD.IsCostLabel(e) or Duel.GetMZoneCount(tp)>0
RD.ResetCostLabel(e) RD.ResetCostLabel(e)
return res and Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_HAND,0,1,nil,e,tp) return res and Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_HAND,0,1,nil,e,tp)
end end
......
...@@ -19,7 +19,7 @@ end ...@@ -19,7 +19,7 @@ end
function cm.confilter(c,tp,re,rp) function cm.confilter(c,tp,re,rp)
return c:IsPreviousPosition(POS_ATTACK) and c:GetPreviousLevelOnField()>=7 return c:IsPreviousPosition(POS_ATTACK) and c:GetPreviousLevelOnField()>=7
and RD.IsPreviousRace(c,RACE_WARRIOR) and RD.IsPreviousRace(c,RACE_WARRIOR)
and c:GetPreviousControler()==tp and c:IsPreviousLocation(LOCATION_MZONE) and RD.IsPreviousControler(c,tp) and c:IsPreviousLocation(LOCATION_MZONE)
and (c==Duel.GetAttackTarget() and (c==Duel.GetAttackTarget()
or (rp==1-tp and re and re:IsActiveType(TYPE_TRAP) and c:IsReason(REASON_EFFECT)) or (rp==1-tp and re and re:IsActiveType(TYPE_TRAP) and c:IsReason(REASON_EFFECT))
) )
......
...@@ -7,7 +7,7 @@ function cm.initial_effect(c) ...@@ -7,7 +7,7 @@ function cm.initial_effect(c)
--Fusion Material --Fusion Material
aux.AddFusionProcCode2(c,list[1],list[2],true,true) aux.AddFusionProcCode2(c,list[1],list[2],true,true)
--Multi-Choose Effect --Multi-Choose Effect
local e1=RD.CreateMultiChooseEffect(c,aux.Stringid(m,1),cm.eff1con,cm.eff1op,aux.Stringid(m,2),cm.eff2con,cm.eff2op) local e1=RD.CreateMultiChooseEffect(c,aux.Stringid(m,1),nil,cm.eff1op,aux.Stringid(m,2),cm.eff2con,cm.eff2op)
e1:SetDescription(aux.Stringid(m,0)) e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_ATKCHANGE) e1:SetCategory(CATEGORY_ATKCHANGE)
e1:SetCondition(cm.condition) e1:SetCondition(cm.condition)
...@@ -27,9 +27,6 @@ function cm.condition(e,tp,eg,ep,ev,re,r,rp) ...@@ -27,9 +27,6 @@ function cm.condition(e,tp,eg,ep,ev,re,r,rp)
end end
cm.cost=RD.CostSendDeckTopToGrave(1) cm.cost=RD.CostSendDeckTopToGrave(1)
--Atk Up --Atk Up
function cm.eff1con(e,tp,eg,ep,ev,re,r,rp)
return true
end
function cm.eff1op(e,tp,eg,ep,ev,re,r,rp) function cm.eff1op(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
......
...@@ -21,48 +21,22 @@ function cm.costfilter(c) ...@@ -21,48 +21,22 @@ function cm.costfilter(c)
return c:IsCode(list[1],list[2]) and c:IsAbleToDeckOrExtraAsCost() return c:IsCode(list[1],list[2]) and c:IsAbleToDeckOrExtraAsCost()
end end
function cm.spfilter(c,e,tp) function cm.spfilter(c,e,tp)
return c:IsRace(RACE_FISH+RACE_SEASERPENT) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) return c:IsRace(RACE_FISH+RACE_SEASERPENT) 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.GetFieldGroupCount(tp,0,LOCATION_MZONE)>0 return Duel.GetFieldGroupCount(tp,0,LOCATION_MZONE)>0
end end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk) cm.cost=RD.CostSendGraveToDeckBottom(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,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.GetMZoneCount(tp)>0 if chk==0 then return Duel.GetMZoneCount(tp)>0
and Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_HAND,0,1,nil,e,tp) end and Duel.IsExistingMatchingCard(cm.spfilter,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.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(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
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)
......
...@@ -17,26 +17,19 @@ end ...@@ -17,26 +17,19 @@ end
function cm.costfilter(c) function cm.costfilter(c)
return c:IsType(TYPE_MONSTER) and c:IsAbleToDeckOrExtraAsCost() return c:IsType(TYPE_MONSTER) and c:IsAbleToDeckOrExtraAsCost()
end end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk) function cm.exfilter(c,tc)
if chk==0 then return Duel.IsExistingMatchingCard(cm.costfilter,tp,LOCATION_GRAVE,0,2,nil) end return RD.IsSameCode(c,tc)
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,2,REASON_COST)
end end
cm.cost=RD.CostSendGraveToDeck(cm.costfilter,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(Card.IsFacedown,tp,0,LOCATION_SZONE,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(Card.IsFacedown,tp,0,LOCATION_SZONE,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,HINTMSG_FACEDOWN) RD.SelectAndDoAction(HINTMSG_FACEDOWN,Card.IsFacedown,tp,0,LOCATION_SZONE,1,1,nil,function(g)
local g=Duel.SelectMatchingCard(tp,Card.IsFacedown,tp,0,LOCATION_SZONE,1,1,nil)
local tc=g:GetFirst()
if tc then
Duel.HintSelection(g)
Duel.ConfirmCards(tp,g) Duel.ConfirmCards(tp,g)
if Duel.IsExistingMatchingCard(Card.IsCode,tp,0,LOCATION_GRAVE,1,nil,tc:GetCode()) if Duel.IsExistingMatchingCard(cm.exfilter,tp,0,LOCATION_GRAVE,1,nil,g:GetFirst())
and Duel.SelectYesNo(tp,aux.Stringid(m,1)) then and Duel.SelectYesNo(tp,aux.Stringid(m,1)) then
Duel.Destroy(tc,REASON_EFFECT) Duel.Destroy(g,REASON_EFFECT)
end end
end end)
end end
\ No newline at end of file
...@@ -18,23 +18,14 @@ end ...@@ -18,23 +18,14 @@ end
function cm.costfilter(c) function cm.costfilter(c)
return c:IsType(TYPE_NORMAL) return c:IsType(TYPE_NORMAL)
end end
function cm.check(g,tp) function cm.check(g,e,tp)
return g:IsExists(cm.costfilter,1,nil) return g:IsExists(cm.costfilter,1,nil)
end end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk) cm.cost=RD.CostSendHandSubToGrave(Card.IsAbleToGraveAsCost,cm.check,2,2)
local g=Duel.GetMatchingGroup(Card.IsAbleToGraveAsCost,tp,LOCATION_HAND,0,nil)
if chk==0 then return g:CheckSubGroup(cm.check,2,2,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local sg=g:SelectSubGroup(tp,cm.check,false,2,2,nil)
Duel.SendtoGrave(sg,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
...@@ -6,18 +6,15 @@ function cm.initial_effect(c) ...@@ -6,18 +6,15 @@ function cm.initial_effect(c)
aux.AddCodeList(c,list[1],list[2]) aux.AddCodeList(c,list[1],list[2])
--Fusion Material --Fusion Material
aux.AddFusionProcCode2(c,list[1],list[2],true,true) aux.AddFusionProcCode2(c,list[1],list[2],true,true)
--Select Effect --Multi-Choose Effect
local e1=RushDuel.BaseSelectEffect(c,aux.Stringid(m,1),cm.eff1con,cm.eff1op,aux.Stringid(m,2),cm.eff2con,cm.eff2op) local e1=RD.CreateMultiChooseEffect(c,aux.Stringid(m,1),cm.eff1con,cm.eff1op,aux.Stringid(m,2),cm.eff2con,cm.eff2op)
e1:SetDescription(aux.Stringid(m,0)) e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_ATKCHANGE) e1:SetCategory(CATEGORY_ATKCHANGE+CATEGORY_DESTROY)
e1:SetCost(cm.cost) e1:SetCost(cm.cost)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
--Select Effect --Multi-Choose Effect
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
--Atk Up --Atk Up
function cm.eff1con(e,tp,eg,ep,ev,re,r,rp) function cm.eff1con(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFieldGroupCount(tp,LOCATION_MZONE,LOCATION_MZONE)>0 return Duel.GetFieldGroupCount(tp,LOCATION_MZONE,LOCATION_MZONE)>0
...@@ -26,12 +23,7 @@ function cm.eff1op(e,tp,eg,ep,ev,re,r,rp) ...@@ -26,12 +23,7 @@ function cm.eff1op(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 atk=Duel.GetFieldGroupCount(tp,LOCATION_MZONE,LOCATION_MZONE)*300 local atk=Duel.GetFieldGroupCount(tp,LOCATION_MZONE,LOCATION_MZONE)*300
local e1=Effect.CreateEffect(c) RD.AttachAtkDef(e,c,atk,0,RESET_EVENT+RESETS_STANDARD+RESET_DISABLE+RESET_PHASE+PHASE_END)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(atk)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE+RESET_PHASE+PHASE_END)
c:RegisterEffect(e1)
end end
end end
--Destroy --Destroy
......
...@@ -6,49 +6,35 @@ function cm.initial_effect(c) ...@@ -6,49 +6,35 @@ function cm.initial_effect(c)
aux.AddCodeList(c,list[1],list[2]) aux.AddCodeList(c,list[1],list[2])
--Fusion Material --Fusion Material
aux.AddFusionProcCode2(c,list[1],list[2],true,true) aux.AddFusionProcCode2(c,list[1],list[2],true,true)
--Select Effect --Multi-Choose Effect
local e1=RushDuel.BaseSelectEffect(c,aux.Stringid(m,1),cm.condition,cm.eff1op,aux.Stringid(m,2),cm.condition,cm.eff2op) local e1=RD.CreateMultiChooseEffect(c,aux.Stringid(m,1),nil,cm.eff1op,aux.Stringid(m,2),nil,cm.eff2op)
e1:SetDescription(aux.Stringid(m,0)) e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_DAMAGE+CATEGORY_ATKCHANGE+CATEGORY_RECOVER+CATEGORY_SPECIAL_SUMMON+CATEGORY_GRAVE_SPSUMMON) e1:SetCategory(CATEGORY_DAMAGE+CATEGORY_ATKCHANGE+CATEGORY_RECOVER+CATEGORY_SPECIAL_SUMMON+CATEGORY_GRAVE_SPSUMMON)
e1:SetCondition(cm.condition)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
--Select Effect --Multi-Choose Effect
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 return Duel.GetFieldGroupCount(tp,0,LOCATION_MZONE)>0
end end
--Damage --Damage
function cm.eff1op(e,tp,eg,ep,ev,re,r,rp) function cm.eff1op(e,tp,eg,ep,ev,re,r,rp)
if Duel.Damage(tp,2000,REASON_EFFECT)~=0 if Duel.Damage(tp,2000,REASON_EFFECT)~=0 then
and Duel.IsExistingMatchingCard(Card.IsFaceup,tp,0,LOCATION_MZONE,1,nil)
and Duel.SelectYesNo(tp,aux.Stringid(m,3)) then
Duel.BreakEffect()
local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,0,LOCATION_MZONE,nil) local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,0,LOCATION_MZONE,nil)
local tc=g:GetFirst() if g:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(m,3)) then
while tc do Duel.BreakEffect()
local e1=Effect.CreateEffect(e:GetHandler()) g:ForEach(function(tc)
e1:SetType(EFFECT_TYPE_SINGLE) RD.AttachAtkDef(e,tc,-3000,0,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
e1:SetCode(EFFECT_UPDATE_ATTACK) end)
e1:SetValue(-3000)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
tc=g:GetNext()
end end
end end
end end
--Recover --Recover
function cm.spfilter(c,e,tp) function cm.spfilter(c,e,tp)
return c:IsLevelAbove(7) and c:IsRace(RACE_PSYCHO) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) return c:IsLevelAbove(7) and c:IsRace(RACE_PSYCHO) and RD.IsCanBeSpecialSummoned(c,e,tp,POS_FACEUP)
end end
function cm.eff2op(e,tp,eg,ep,ev,re,r,rp) function cm.eff2op(e,tp,eg,ep,ev,re,r,rp)
if Duel.Recover(tp,1000,REASON_EFFECT)~=0 if Duel.Recover(tp,1000,REASON_EFFECT)~=0 then
and Duel.GetMZoneCount(tp)>0 RD.CanSelectAndSpecialSummon(aux.Stringid(m,4),aux.NecroValleyFilter(cm.spfilter),tp,LOCATION_GRAVE,0,1,1,nil,e,POS_FACEUP,true)
and Duel.IsExistingMatchingCard(aux.NecroValleyFilter(cm.spfilter),tp,LOCATION_GRAVE,0,1,nil,e,tp)
and Duel.SelectYesNo(tp,aux.Stringid(m,4)) 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 then
Duel.BreakEffect()
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end end
end end
\ No newline at end of file
...@@ -6,41 +6,30 @@ function cm.initial_effect(c) ...@@ -6,41 +6,30 @@ function cm.initial_effect(c)
aux.AddCodeList(c,list[1],list[2]) aux.AddCodeList(c,list[1],list[2])
--Fusion Material --Fusion Material
aux.AddFusionProcCode2(c,list[1],list[2],true,true) aux.AddFusionProcCode2(c,list[1],list[2],true,true)
--Select Effect --Multi-Choose Effect
local e1=RushDuel.BaseSelectEffect(c,aux.Stringid(m,1),cm.eff1con,cm.eff1op,aux.Stringid(m,2),cm.eff2con,cm.eff2op) local e1=RD.CreateMultiChooseEffect(c,aux.Stringid(m,1),nil,cm.eff1op,aux.Stringid(m,2),cm.eff2con,cm.eff2op)
e1:SetDescription(aux.Stringid(m,0)) e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_ATKCHANGE+CATEGORY_POSITION) e1:SetCategory(CATEGORY_ATKCHANGE+CATEGORY_POSITION)
e1:SetCost(cm.cost) e1:SetCost(cm.cost)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
--Select Effect --Multi-Choose Effect
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
--Cannot Special Summon --Cannot Special Summon
function cm.eff1con(e,tp,eg,ep,ev,re,r,rp)
return true
end
function cm.eff1op(e,tp,eg,ep,ev,re,r,rp) function cm.eff1op(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
RD.AttachAtkDef(e,c,500,0,RESET_EVENT+RESETS_STANDARD+RESET_DISABLE+RESET_PHASE+PHASE_END+RESET_OPPO_TURN)
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetDescription(aux.Stringid(m,3))
e1:SetCode(EFFECT_UPDATE_ATTACK) e1:SetType(EFFECT_TYPE_FIELD)
e1:SetValue(500) e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CLIENT_HINT)
e1:SetRange(LOCATION_MZONE)
e1:SetTargetRange(1,1)
e1:SetTarget(cm.sumlimit)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE+RESET_PHASE+PHASE_END+RESET_OPPO_TURN) e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE+RESET_PHASE+PHASE_END+RESET_OPPO_TURN)
c:RegisterEffect(e1) c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,3))
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CLIENT_HINT)
e2:SetRange(LOCATION_MZONE)
e2:SetTargetRange(1,1)
e2:SetTarget(cm.sumlimit)
e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE+RESET_PHASE+PHASE_END+RESET_OPPO_TURN)
c:RegisterEffect(e2)
end end
end end
function cm.sumlimit(e,c,sump,sumtype,sumpos,targetp) function cm.sumlimit(e,c,sump,sumtype,sumpos,targetp)
...@@ -48,16 +37,13 @@ function cm.sumlimit(e,c,sump,sumtype,sumpos,targetp) ...@@ -48,16 +37,13 @@ function cm.sumlimit(e,c,sump,sumtype,sumpos,targetp)
end end
--Position --Position
function cm.posfilter(c) function cm.posfilter(c)
return c:IsCanChangePosition() and RushDuel.IsHasDefense(c) return RD.IsCanChangePosition(c)
end end
function cm.eff2con(e,tp,eg,ep,ev,re,r,rp) function cm.eff2con(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(cm.posfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) return Duel.IsExistingMatchingCard(cm.posfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil)
end end
function cm.eff2op(e,tp,eg,ep,ev,re,r,rp) function cm.eff2op(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_POSCHANGE) RD.SelectAndDoAction(HINTMSG_POSCHANGE,cm.posfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil,function(g)
local g=Duel.SelectMatchingCard(tp,cm.posfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil) RD.ChangePosition(g)
if g:GetCount()>0 then end)
Duel.HintSelection(g)
Duel.ChangePosition(g,POS_FACEUP_DEFENSE,POS_FACEUP_DEFENSE,POS_FACEUP_ATTACK,POS_FACEUP_ATTACK)
end
end end
\ No newline at end of file
...@@ -21,29 +21,19 @@ end ...@@ -21,29 +21,19 @@ end
function cm.filter(c) function cm.filter(c)
return c:IsType(TYPE_MONSTER) return c:IsType(TYPE_MONSTER)
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.GetFieldGroupCount(tp,0,LOCATION_DECK)>6 end if chk==0 then return Duel.GetFieldGroupCount(tp,0,LOCATION_DECK)>6 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)
if Duel.GetFieldGroupCount(tp,0,LOCATION_DECK)<7 then return end if Duel.GetFieldGroupCount(tp,0,LOCATION_DECK)<7 then return end
Duel.ConfirmDecktop(1-tp,7) Duel.ConfirmDecktop(1-tp,7)
local atk=Duel.GetDecktopGroup(1-tp,7):FilterCount(cm.filter,nil)*500 local atk=Duel.GetDecktopGroup(1-tp,7):FilterCount(cm.filter,nil)*-500
Duel.SortDecktop(1-tp,1-tp,7) Duel.SortDecktop(1-tp,1-tp,7)
if atk>0 and Duel.SelectYesNo(tp,aux.Stringid(m,1)) then if atk~=0 and Duel.SelectYesNo(tp,aux.Stringid(m,1)) then
local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,0,LOCATION_MZONE,nil) local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,0,LOCATION_MZONE,nil)
local tc=g:GetFirst() g:ForEach(function(tc)
while tc do RD.AttachAtkDef(e,tc,atk,0,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
local e1=Effect.CreateEffect(e:GetHandler()) end)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(-atk)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
tc=g:GetNext()
end
end end
end end
\ No newline at end of file
...@@ -22,8 +22,7 @@ function cm.setfilter(c) ...@@ -22,8 +22,7 @@ function cm.setfilter(c)
return c:IsCode(list[3],list[4]) and c:IsSSetable() return c:IsCode(list[3],list[4]) and c:IsSSetable()
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.IsSpecialSummonTurn(e:GetHandler())
return c:IsReason(REASON_SPSUMMON) and c:IsStatus(STATUS_SPSUMMON_TURN)
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
...@@ -31,18 +30,7 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -31,18 +30,7 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,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)
if Duel.Damage(1-tp,1000,REASON_EFFECT)~=0 if Duel.Damage(1-tp,1000,REASON_EFFECT)~=0 and Duel.Draw(tp,1,REASON_EFFECT)~=0 then
and Duel.Draw(tp,1,REASON_EFFECT)~=0 then RD.CanSelectGroupAndSet(aux.Stringid(m,2),aux.NecroValleyFilter(cm.setfilter),aux.dncheck,tp,LOCATION_GRAVE,0,1,2,nil,e)
local ct=Duel.GetLocationCount(tp,LOCATION_SZONE)
if ct>2 then ct=2 end
if ct>0 and Duel.IsExistingMatchingCard(aux.NecroValleyFilter(cm.setfilter),tp,LOCATION_GRAVE,0,1,nil)
and Duel.SelectYesNo(tp,aux.Stringid(m,2)) then
local mg=Duel.GetMatchingGroup(aux.NecroValleyFilter(cm.setfilter),tp,LOCATION_GRAVE,0,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
local sg=mg:SelectSubGroup(tp,aux.dncheck,false,1,ct)
if sg:GetCount()>0 then
Duel.SSet(tp,sg)
end
end
end end
end end
\ No newline at end of file
...@@ -20,28 +20,12 @@ end ...@@ -20,28 +20,12 @@ end
function cm.costfilter(c) function cm.costfilter(c)
return c:IsRace(RACE_PYRO) and c:IsAbleToDeckOrExtraAsCost() return c:IsRace(RACE_PYRO) and c:IsAbleToDeckOrExtraAsCost()
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.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) local reset=RESET_EVENT+RESETS_STANDARD+RESET_DISABLE+RESET_PHASE+PHASE_END
e1:SetType(EFFECT_TYPE_SINGLE) RD.AttachAtkDef(e,c,600,0,reset)
e1:SetCode(EFFECT_UPDATE_ATTACK) RD.AttachPierce(e,c,aux.Stringid(m,1),reset)
e1:SetValue(600)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE+RESET_PHASE+PHASE_END)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,1))
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_PIERCE)
e2:SetProperty(EFFECT_FLAG_CLIENT_HINT)
e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE+RESET_PHASE+PHASE_END)
c:RegisterEffect(e2)
end end
end end
\ No newline at end of file
...@@ -24,23 +24,14 @@ end ...@@ -24,23 +24,14 @@ end
function cm.desfilter(c) function cm.desfilter(c)
return c:IsType(TYPE_SPELL+TYPE_TRAP) return c:IsType(TYPE_SPELL+TYPE_TRAP)
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.IsExistingMatchingCard(cm.desfilter,tp,0,LOCATION_ONFIELD,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(cm.desfilter,tp,0,LOCATION_ONFIELD,1,nil) end
local g=Duel.GetMatchingGroup(cm.desfilter,tp,0,LOCATION_ONFIELD,nil) local g=Duel.GetMatchingGroup(cm.desfilter,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.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_DESTROY) RD.SelectAndDoAction(HINTMSG_DESTROY,cm.desfilter,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
...@@ -20,30 +20,15 @@ function cm.initial_effect(c) ...@@ -20,30 +20,15 @@ function cm.initial_effect(c)
end end
--Draw --Draw
function cm.spfilter(c,e,tp) function cm.spfilter(c,e,tp)
return c:IsRace(RACE_CYBERSE) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) return c:IsRace(RACE_CYBERSE) 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,2)
and Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>2 end
Duel.DiscardDeck(tp,2,REASON_COST)
end end
cm.cost=RD.CostSendDeckTopToGrave(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.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) if RD.Draw()~=0 and Duel.GetFieldGroupCount(tp,0,LOCATION_MZONE)>0 then
if Duel.Draw(p,d,REASON_EFFECT)~=0 RD.CanSelectAndSpecialSummon(aux.Stringid(m,1),cm.spfilter,tp,LOCATION_HAND,0,1,1,nil,e,POS_FACEUP)
and Duel.GetFieldGroupCount(tp,0,LOCATION_MZONE)>0
and Duel.GetMZoneCount(tp)>0
and Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_HAND,0,1,nil,e,tp)
and Duel.SelectYesNo(tp,aux.Stringid(m,1)) 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 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end end
end end
\ No newline at end of file
...@@ -14,7 +14,7 @@ function cm.initial_effect(c) ...@@ -14,7 +14,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.atktg) e2:SetTarget(cm.uptg)
e2:SetValue(400) e2:SetValue(400)
c:RegisterEffect(e2) c:RegisterEffect(e2)
--Indes --Indes
...@@ -29,10 +29,10 @@ function cm.initial_effect(c) ...@@ -29,10 +29,10 @@ function cm.initial_effect(c)
end end
--Activate --Activate
function cm.condition(e,tp,eg,ep,ev,re,r,rp) function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetLP(1-tp)>Duel.GetLP(tp) return RD.IsLPBelowOpponent(tp,1)
end end
--Atk Up --Atk Up
function cm.atktg(e,c) function cm.uptg(e,c)
return c:IsFaceup() and c:IsLevelAbove(7) and c:IsRace(RACE_MACHINE) return c:IsFaceup() and c:IsLevelAbove(7) and c:IsRace(RACE_MACHINE)
end end
--Indes --Indes
......
...@@ -22,23 +22,11 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -22,23 +22,11 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsFaceup,tp,LOCATION_MZONE,0,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(Card.IsFaceup,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),Card.IsFaceup,tp,LOCATION_MZONE,0,1,2,nil,function(g)
local g=Duel.SelectMatchingCard(tp,Card.IsFaceup,tp,LOCATION_MZONE,0,1,2,nil) g:ForEach(function(tc)
if g:GetCount()>0 then RD.AttachEffectIndes(e,tc,cm.indval,aux.Stringid(m,2),RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
Duel.HintSelection(g) end)
local tc=g:GetFirst() end)
while tc do
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetDescription(aux.Stringid(m,2))
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e1:SetProperty(EFFECT_FLAG_CLIENT_HINT)
e1:SetValue(cm.indval)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
tc=g:GetNext()
end
end
end end
function cm.indval(e,re,rp) function cm.indval(e,re,rp)
return rp==1-e:GetHandlerPlayer() and re:IsActiveType(TYPE_TRAP) return rp==1-e:GetHandlerPlayer() and re:IsActiveType(TYPE_TRAP)
......
...@@ -16,12 +16,12 @@ end ...@@ -16,12 +16,12 @@ end
function cm.costfilter(c) function cm.costfilter(c)
return c:IsLevelAbove(7) and c:IsAbleToDeckOrExtraAsCost() return c:IsLevelAbove(7) and c:IsAbleToDeckOrExtraAsCost()
end end
function cm.thfilter(c) function cm.filter(c)
return c:IsType(TYPE_NORMAL) and c:IsAbleToHand() return c:IsType(TYPE_NORMAL) and c:IsAbleToHand()
end end
function cm.costcheck(g,tp) function cm.costcheck(g,tp)
return g:GetClassCount(Card.GetRace,nil)==g:GetCount() return g:GetClassCount(Card.GetRace,nil)==g:GetCount()
and Duel.IsExistingMatchingCard(cm.thfilter,tp,LOCATION_GRAVE,0,1,g) and Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_GRAVE,0,1,g)
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)
local g=Duel.GetMatchingGroup(cm.costfilter,tp,LOCATION_GRAVE,0,nil) local g=Duel.GetMatchingGroup(cm.costfilter,tp,LOCATION_GRAVE,0,nil)
...@@ -30,37 +30,23 @@ function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -30,37 +30,23 @@ function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local sg=g:SelectSubGroup(tp,cm.costcheck,false,3,3,tp) local sg=g:SelectSubGroup(tp,cm.costcheck,false,3,3,tp)
Duel.ConfirmCards(1-tp,sg) Duel.ConfirmCards(1-tp,sg)
Duel.SendtoDeck(sg,nil,0,REASON_COST) Duel.SendtoDeck(sg,nil,0,REASON_COST)
local option=Duel.SelectOption(tp,aux.Stringid(m,1),aux.Stringid(m,2))
local ct=Duel.GetOperatedGroup():FilterCount(Card.IsLocation,nil,LOCATION_DECK) local ct=Duel.GetOperatedGroup():FilterCount(Card.IsLocation,nil,LOCATION_DECK)
Duel.SortDecktop(tp,tp,ct) Duel.SortDecktop(tp,tp,ct)
for i=1,ct do if option==1 then
local tc=Duel.GetDecktopGroup(tp,1):GetFirst() RD.SendDeckTopToBottom(tp,ct)
Duel.MoveSequence(tc,1)
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)
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) then
if g:GetCount()>0 and Duel.SendtoHand(g,nil,REASON_EFFECT)~=0 then RD.CanSelectAndDoAction(aux.Stringid(m,3),aux.Stringid(m,4),Card.IsFaceup,tp,0,LOCATION_MZONE,1,1,nil,function(sg)
Duel.ConfirmCards(1-tp,g) RD.AttachAtkDef(e,sg:GetFirst(),-1500,0,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
if Duel.IsExistingMatchingCard(Card.IsFaceup,tp,0,LOCATION_MZONE,1,nil) end)
and Duel.SelectYesNo(tp,aux.Stringid(m,1)) then
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(m,2))
local sg=Duel.SelectMatchingCard(tp,Card.IsFaceup,tp,0,LOCATION_MZONE,1,1,nil)
if sg:GetCount()>0 then
Duel.BreakEffect()
Duel.HintSelection(sg)
local tc=sg:GetFirst()
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)
tc:RegisterEffect(e1)
end
end end
end end)
end end
\ No newline at end of file
...@@ -16,31 +16,19 @@ end ...@@ -16,31 +16,19 @@ end
function cm.costfilter(c) function cm.costfilter(c)
return c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsAbleToGraveAsCost() return c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsAbleToGraveAsCost()
end end
function cm.spfilter(c,e,tp) function cm.filter(c,e,tp)
return c:IsRace(RACE_FISH+RACE_SEASERPENT+RACE_AQUA+RACE_THUNDER) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) return c:IsRace(RACE_FISH+RACE_SEASERPENT+RACE_AQUA+RACE_THUNDER)
end and c:IsCanBeSpecialSummoned(c,e,tp,POS_FACEUP)
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,1,e:GetHandler()) 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 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.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) 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.AttachAtkDef(e,tc,-800,0,RESET_EVENT+RESETS_STANDARD+RESET_DISABLE+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:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(-800)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
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_SEASERPENT) return c:IsFaceup() and c:IsRace(RACE_SEASERPENT)
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
...@@ -13,11 +13,11 @@ function cm.initial_effect(c) ...@@ -13,11 +13,11 @@ 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.atktg) e2:SetTarget(cm.uptg)
e2:SetValue(400) e2:SetValue(400)
c:RegisterEffect(e2) c:RegisterEffect(e2)
end end
--Atk --Atk
function cm.atktg(e,c) function cm.uptg(e,c)
return c:IsFaceup() and c:IsAttribute(ATTRIBUTE_FIRE) and c:IsControler(Duel.GetTurnPlayer()) return c:IsFaceup() and c:IsAttribute(ATTRIBUTE_FIRE) and c:IsControler(Duel.GetTurnPlayer())
end end
\ No newline at end of file
...@@ -26,25 +26,16 @@ end ...@@ -26,25 +26,16 @@ 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.GetFieldGroupCount(tp,0,LOCATION_DECK)>4 end if chk==0 then return Duel.GetFieldGroupCount(tp,0,LOCATION_DECK)>4 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)
local g=Duel.GetFieldGroup(tp,0,LOCATION_DECK) if Duel.GetFieldGroupCount(tp,0,LOCATION_DECK)<5 then return end
if g:GetCount()<5 then return end RD.SendDeckBottomToTop(1-tp,5)
for i=1,5 do
local tc=g:GetMinGroup(Card.GetSequence):GetFirst()
Duel.MoveSequence(tc,0)
end
Duel.ConfirmDecktop(1-tp,5) Duel.ConfirmDecktop(1-tp,5)
local dam=Duel.GetDecktopGroup(1-tp,5):FilterCount(cm.filter,nil)*400 local dam=Duel.GetDecktopGroup(1-tp,5):FilterCount(cm.filter,nil)*400
if dam>0 then if dam~=0 then
Duel.Damage(1-tp,dam,REASON_EFFECT) Duel.Damage(1-tp,dam,REASON_EFFECT)
end end
Duel.SortDecktop(1-tp,1-tp,5) Duel.SortDecktop(1-tp,1-tp,5)
......
...@@ -18,29 +18,20 @@ end ...@@ -18,29 +18,20 @@ end
function cm.confilter(c) function cm.confilter(c)
return c:IsFaceup() and c:IsLevelAbove(7) and c:IsAttribute(ATTRIBUTE_EARTH) and c:IsRace(RACE_MACHINE) return c:IsFaceup() and c:IsLevelAbove(7) and c:IsAttribute(ATTRIBUTE_EARTH) and c:IsRace(RACE_MACHINE)
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.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.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) 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.AttachCannotDirectAttack(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_CANNOT_DIRECT_ATTACK)
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
...@@ -31,15 +31,9 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -31,15 +31,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 atk=Duel.GetMatchingGroupCount(cm.atkfilter,tp,LOCATION_GRAVE,LOCATION_GRAVE,nil)*100 local atk=Duel.GetMatchingGroupCount(cm.atkfilter,tp,LOCATION_GRAVE,LOCATION_GRAVE,nil)*100
if atk==0 then return end
local g=Duel.GetMatchingGroup(cm.filter,tp,LOCATION_MZONE,0,nil) local g=Duel.GetMatchingGroup(cm.filter,tp,LOCATION_MZONE,0,nil)
local tc=g:GetFirst() g:ForEach(function(tc)
while tc do RD.AttachAtkDef(e,tc,atk,0,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
local e1=Effect.CreateEffect(e:GetHandler()) end)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(atk)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
tc=g:GetNext()
end
end end
\ No newline at end of file
...@@ -14,34 +14,27 @@ function cm.initial_effect(c) ...@@ -14,34 +14,27 @@ function cm.initial_effect(c)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
--Activate --Activate
function cm.ctfilter(c) function cm.filter(c)
return c:IsType(TYPE_NORMAL) and c:IsRace(RACE_PYRO) return c:IsType(TYPE_NORMAL) and c:IsRace(RACE_PYRO)
end end
function cm.exfilter(c) function cm.exfilter(c)
return c:IsFaceup() and c:IsType(TYPE_NORMAL) and c:IsRace(RACE_PYRO) return c:IsFaceup() and c:IsType(TYPE_NORMAL) and c:IsRace(RACE_PYRO)
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)
local ct=Duel.GetMatchingGroupCount(cm.ctfilter,tp,LOCATION_GRAVE,0,nil) local max=math.min(Duel.GetMatchingGroupCount(cm.filter,tp,LOCATION_GRAVE,0,nil),Duel.GetFieldGroupCount(tp,LOCATION_DECK,0))
if chk==0 then return ct>0 and Duel.IsExistingMatchingCard(Card.IsAbleToGraveAsCost,tp,LOCATION_HAND,0,1,e:GetHandler()) end if chk==0 then return max>0 and Duel.IsExistingMatchingCard(Card.IsAbleToGraveAsCost,tp,LOCATION_HAND,0,1,e:GetHandler()) end
if ct>Duel.GetFieldGroupCount(tp,LOCATION_DECK,0) then ct=Duel.GetFieldGroupCount(tp,LOCATION_DECK,0) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,Card.IsAbleToGraveAsCost,tp,LOCATION_HAND,0,1,ct,nil) local g=Duel.SelectMatchingCard(tp,Card.IsAbleToGraveAsCost,tp,LOCATION_HAND,0,1,max,nil)
e:SetLabel(g:GetCount()) local ct=Duel.SendtoGrave(g,REASON_COST)
Duel.SendtoGrave(g,REASON_COST) e:SetLabel(ct)
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
local ct=e:GetLabel() local ct=e:GetLabel()
Duel.SetTargetPlayer(tp) RD.TargetDraw(tp,ct)
Duel.SetTargetParam(ct)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,ct)
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.Draw()~=0 and Duel.IsExistingMatchingCard(cm.exfilter,tp,LOCATION_MZONE,0,1,nil) then
if Duel.Draw(p,d,REASON_EFFECT)~=0 RD.CanDraw(aux.Stringid(m,1),tp,1)
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
\ No newline at end of file
...@@ -17,25 +17,15 @@ end ...@@ -17,25 +17,15 @@ 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.cost(e,tp,eg,ep,ev,re,r,rp,chk) cm.cost=RD.CostSendHandToGrave(cm.costfilter,1,1,nil,nil,function(g)
if chk==0 then return Duel.IsExistingMatchingCard(cm.costfilter,tp,LOCATION_HAND,0,1,nil) end return g:GetFirst():GetLevel()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) end)
local g=Duel.SelectMatchingCard(tp,cm.costfilter,tp,LOCATION_HAND,0,1,1,nil)
e:SetLabel(g:GetFirst():GetLevel())
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.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.Draw()~=0 and e:GetLabel()==7 then
if Duel.Draw(p,d,REASON_EFFECT)~=0 RD.CanDraw(aux.Stringid(m,1),tp,1)
and e:GetLabel()==7
and Duel.IsPlayerCanDraw(tp,1)
and Duel.SelectYesNo(tp,aux.Stringid(m,1)) then
Duel.Draw(tp,1,REASON_EFFECT)
end end
end end
\ No newline at end of file
...@@ -16,38 +16,25 @@ end ...@@ -16,38 +16,25 @@ end
function cm.costfilter(c) function cm.costfilter(c)
return c:IsType(TYPE_MONSTER) and c:IsAbleToDeckOrExtraAsCost() return c:IsType(TYPE_MONSTER) and c:IsAbleToDeckOrExtraAsCost()
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.tdcheck(g) function cm.exfilter(c)
return g:GetClassCount(Card.GetRace)==1 return c:IsLocation(LOCATION_DECK)
end end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk) function cm.check(g)
if chk==0 then return Duel.IsExistingMatchingCard(cm.costfilter,tp,LOCATION_GRAVE,0,2,nil) end return g:GetClassCount(Card.GetRace)==1
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,2,REASON_COST)
end end
cm.cost=RD.CostSendGraveToDeck(cm.costfilter,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)
local g=Duel.GetMatchingGroup(cm.tdfilter,tp,0,LOCATION_GRAVE,nil) local g=Duel.GetMatchingGroup(cm.filter,tp,0,LOCATION_GRAVE,nil)
if chk==0 then return g:CheckSubGroup(cm.tdcheck,2,2,nil) end if chk==0 then return g:CheckSubGroup(cm.check,2,2,nil) end
Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,1,1-tp,LOCATION_GRAVE) Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,1,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)
local g=Duel.GetMatchingGroup(aux.NecroValleyFilter(cm.tdfilter),tp,0,LOCATION_GRAVE,nil) RD.SelectGroupAndDoAction(HINTMSG_TODECK,aux.NecroValleyFilter(cm.filter),cm.check,tp,0,LOCATION_GRAVE,2,7,nil,function(g)
if not g:CheckSubGroup(cm.tdcheck,2,2,nil) then return end if RD.SendToDeckAndExists(g,cm.exfilter,4,nil) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK) RD.CanDraw(aux.Stringid(m,1),tp,1)
aux.GCheckAdditional=cm.tdcheck
local sg=g:SelectSubGroup(tp,aux.TRUE,false,2,7,nil)
aux.GCheckAdditional=nil
if sg:GetCount()>0 then
Duel.ConfirmCards(1-tp,sg)
Duel.SendtoDeck(sg,nil,2,REASON_EFFECT)
local og=Duel.GetOperatedGroup()
local ct=og:FilterCount(Card.IsLocation,nil,LOCATION_DECK)
if ct>=4 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
...@@ -28,22 +28,11 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -28,22 +28,11 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetFieldGroup(tp,LOCATION_HAND,LOCATION_HAND) local g=Duel.GetFieldGroup(tp,LOCATION_HAND,LOCATION_HAND)
if Duel.SendtoGrave(g,REASON_EFFECT)~=0 then if Duel.SendtoGrave(g,REASON_EFFECT)~=0 then
local og=Duel.GetOperatedGroup() local og=Duel.GetOperatedGroup()
local ct=og:FilterCount(cm.filter,nil) local atk=og:FilterCount(cm.filter,nil)*300
if ct>0 and Duel.IsExistingMatchingCard(Card.IsFaceup,tp,LOCATION_MZONE,0,1,nil) if atk==0 then return end
and Duel.SelectYesNo(tp,aux.Stringid(m,1)) then RD.CanSelectAndDoAction(aux.Stringid(m,1),aux.Stringid(m,2),Card.IsFaceup,tp,LOCATION_MZONE,0,1,1,nil,function(sg)
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(m,2)) Duel.BreakEffect()
local sg=Duel.SelectMatchingCard(tp,Card.IsFaceup,tp,LOCATION_MZONE,0,1,1,nil) RD.AttachAtkDef(e,sg:GetFirst(),atk,0,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
if sg:GetCount()>0 then end)
Duel.BreakEffect()
Duel.HintSelection(sg)
local tc=sg:GetFirst()
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(ct*300)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
end
end
end end
end end
\ No newline at end of file
...@@ -24,17 +24,13 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -24,17 +24,13 @@ 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
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),aux.NecroValleyFilter(cm.filter),tp,LOCATION_GRAVE,0,1,1,nil,function(g)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cm.filter),tp,LOCATION_GRAVE,0,1,1,nil) local tc=g:GetFirst()
local tc=g:GetFirst()
if tc then
Duel.HintSelection(g)
local atk=tc:GetAttack() local atk=tc:GetAttack()
if atk>0 and Duel.Recover(tp,atk,REASON_EFFECT)>=1000 if atk>0 and Duel.Recover(tp,atk,REASON_EFFECT)>=1000
and tc:IsAbleToHand() and tc:IsAbleToHand()
and Duel.SelectYesNo(tp,aux.Stringid(m,2)) then and Duel.SelectYesNo(tp,aux.Stringid(m,2)) then
Duel.SendtoHand(tc,nil,REASON_EFFECT) RD.SendToHandAndExists(tc,1-tp)
Duel.ConfirmCards(1-tp,tc)
end end
end end)
end end
\ No newline at end of file
...@@ -20,15 +20,9 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -20,15 +20,9 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetAttacker() local tc=Duel.GetAttacker()
local c=Duel.GetAttackTarget() local c=Duel.GetAttackTarget()
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.AttachBattleIndes(e,tc,1,nil,RESET_PHASE+PHASE_DAMAGE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e1:SetValue(1)
e1:SetReset(RESET_PHASE+PHASE_DAMAGE)
tc:RegisterEffect(e1)
if c and c:IsRelateToBattle() and c:IsFaceup() then if c and c:IsRelateToBattle() and c:IsFaceup() then
local e2=e1:Clone() RD.AttachBattleIndes(e,c,1,nil,RESET_PHASE+PHASE_DAMAGE)
c:RegisterEffect(e2)
end end
end end
end end
\ No newline at end of file
...@@ -24,13 +24,7 @@ function cm.condition(e,tp,eg,ep,ev,re,r,rp) ...@@ -24,13 +24,7 @@ function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetAttacker():IsControler(1-tp) return Duel.GetAttacker():IsControler(1-tp)
and c and c:IsControler(tp) and c:IsFaceup() and c:IsRace(RACE_FISH+RACE_SEASERPENT) and c and c:IsControler(tp) and c:IsFaceup() and c:IsRace(RACE_FISH+RACE_SEASERPENT)
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.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
local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,0,LOCATION_MZONE,nil) local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,0,LOCATION_MZONE,nil)
......
...@@ -18,33 +18,24 @@ end ...@@ -18,33 +18,24 @@ end
function cm.confilter(c) function cm.confilter(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.posfilter(c) function cm.filter(c)
return c:IsFaceup() and c:IsCanChangePosition() and RushDuel.IsHasDefense(c) return c:IsFaceup() and RD.IsCanChangePosition(c)
end end
function cm.spfilter(c,e,tp) function cm.spfilter(c,e,tp)
return c:IsType(TYPE_NORMAL) and c:IsRace(RACE_SEASERPENT) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) return c:IsType(TYPE_NORMAL) and c:IsRace(RACE_SEASERPENT) 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)
and Duel.GetAttacker():IsControler(1-tp) and Duel.GetAttackTarget()==nil and Duel.GetAttacker():IsControler(1-tp) and Duel.GetAttackTarget()==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.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 if g:GetCount()>0 and RD.ChangePosition(g)~=0 then
and Duel.ChangePosition(g,POS_FACEUP_DEFENSE,POS_FACEUP_DEFENSE,POS_FACEUP_ATTACK,POS_FACEUP_ATTACK)~=0 RD.CanSelectAndSpecialSummon(aux.Stringid(m,1),aux.NecroValleyFilter(cm.spfilter),tp,LOCATION_GRAVE,0,1,1,nil,e,POS_FACEUP,true)
and Duel.GetMZoneCount(tp)>0
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.BreakEffect()
Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP)
end
end end
end end
\ No newline at end of file
...@@ -17,11 +17,11 @@ function cm.initial_effect(c) ...@@ -17,11 +17,11 @@ function cm.initial_effect(c)
end end
--Activate --Activate
function cm.confilter(c,tp) function cm.confilter(c,tp)
return c:GetPreviousControler()==tp and c:IsPreviousLocation(LOCATION_MZONE) return RD.IsPreviousControler(c,tp) and c:IsPreviousLocation(LOCATION_MZONE)
and c:IsReason(REASON_EFFECT) and c:IsReason(REASON_EFFECT)
end end
function cm.spfilter(c,e,tp) function cm.spfilter(c,e,tp)
return c:IsAttribute(ATTRIBUTE_FIRE) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE) return c:IsAttribute(ATTRIBUTE_FIRE) 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 rp==1-tp and eg:IsExists(cm.confilter,1,nil,tp) return rp==1-tp and eg:IsExists(cm.confilter,1,nil,tp)
...@@ -32,19 +32,12 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -32,19 +32,12 @@ 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.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.spfilter),tp,LOCATION_GRAVE,0,1,1,nil,e,POS_FACEUP_DEFENSE)~=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) if tc:IsCode(list[1],list[2]) then
if g:GetCount()>0 RD.CanSelectAndDoAction(aux.Stringid(m,1),HINTMSG_DESTROY,nil,tp,0,LOCATION_MZONE,1,1,nil,function(sg)
and Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP_DEFENSE)~=0 Duel.Destroy(sg,REASON_EFFECT)
and g:GetFirst():IsCode(list[1],list[2]) end)
and Duel.IsExistingMatchingCard(nil,tp,0,LOCATION_MZONE,1,nil)
and Duel.SelectYesNo(tp,aux.Stringid(m,1)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local sg=Duel.SelectMatchingCard(tp,nil,tp,0,LOCATION_MZONE,1,1,nil)
if sg:GetCount()>0 then
Duel.HintSelection(sg)
Duel.Destroy(sg,REASON_EFFECT)
end end
end end
end end
\ No newline at end of file
...@@ -16,34 +16,23 @@ function cm.initial_effect(c) ...@@ -16,34 +16,23 @@ function cm.initial_effect(c)
end end
--Activate --Activate
function cm.confilter(c,tp) function cm.confilter(c,tp)
return c:GetPreviousControler()==tp and c==Duel.GetAttackTarget() return RD.IsPreviousControler(c,tp) and c==Duel.GetAttackTarget()
end end
function cm.exfilter(c) function cm.exfilter(c)
return c:IsAttribute(ATTRIBUTE_FIRE) return c:IsAttribute(ATTRIBUTE_FIRE)
end end
function cm.spfilter(c,e,tp) function cm.spfilter(c,e,tp)
return c:IsCode(list[1],list[2]) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) return c:IsCode(list[1],list[2]) 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 true end if chk==0 then return true end
Duel.SetTargetPlayer(tp) RD.TargetRecover(tp,900)
Duel.SetTargetParam(900)
Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,900)
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 and Duel.IsExistingMatchingCard(cm.exfilter,tp,LOCATION_GRAVE,0,9,nil) then
if Duel.Recover(p,d,REASON_EFFECT)~=0 RD.CanSelectAndSpecialSummon(aux.Stringid(m,1),aux.NecroValleyFilter(cm.spfilter),tp,LOCATION_GRAVE,0,1,1,nil,e,POS_FACEUP)
and Duel.IsExistingMatchingCard(cm.exfilter,tp,LOCATION_GRAVE,0,9,nil)
and Duel.GetMZoneCount(tp)>0
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 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
end end
\ No newline at end of file
...@@ -21,21 +21,14 @@ end ...@@ -21,21 +21,14 @@ 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.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 true end if chk==0 then return true end
Duel.SetTargetPlayer(1-tp) RD.TargetDamage(1-tp,300)
Duel.SetTargetParam(300)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,300)
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) local p=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER)
if Duel.Damage(p,d,REASON_EFFECT)~=0 and p==1-tp then if RD.Damage()~=0 and p==1-tp then
local e1=Effect.CreateEffect(e:GetHandler()) local e1=Effect.CreateEffect(e:GetHandler())
e1:SetDescription(aux.Stringid(m,1)) e1:SetDescription(aux.Stringid(m,1))
e1:SetType(EFFECT_TYPE_FIELD) e1:SetType(EFFECT_TYPE_FIELD)
......
...@@ -17,34 +17,23 @@ function cm.initial_effect(c) ...@@ -17,34 +17,23 @@ function cm.initial_effect(c)
end end
--Activate --Activate
function cm.confilter(c,tp,rp) function cm.confilter(c,tp,rp)
return c:IsPreviousPosition(POS_FACEUP) and bit.band(c:GetPreviousRaceOnField(),RACE_MACHINE)~=0 return c:IsPreviousPosition(POS_FACEUP) and RD.IsPreviousRace(c,RACE_MACHINE)
and c:GetPreviousControler()==tp and c:IsPreviousLocation(LOCATION_MZONE) and RD.IsPreviousControler(c,tp) and c:IsPreviousLocation(LOCATION_MZONE)
and ((rp==1-tp and c:IsReason(REASON_EFFECT)) or c==Duel.GetAttackTarget()) and ((rp==1-tp and c:IsReason(REASON_EFFECT)) or c==Duel.GetAttackTarget())
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.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,rp) return eg:IsExists(cm.confilter,1,nil,tp,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(1-tp) RD.TargetDamage(1-tp,300)
Duel.SetTargetParam(300)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,300)
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) local p=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER)
if Duel.Damage(p,d,REASON_EFFECT)~=0 and p==1-tp if RD.Damage()~=0 and p==1-tp then
and Duel.GetMZoneCount(tp)>0 RD.CanSelectAndSpecialSummon(aux.Stringid(m,1),aux.NecroValleyFilter(cm.spfilter),tp,LOCATION_GRAVE,0,1,2,nil,e,POS_FACEUP)
and Duel.IsExistingMatchingCard(aux.NecroValleyFilter(cm.spfilter),tp,LOCATION_GRAVE,0,1,nil,e,tp)
and Duel.SelectYesNo(tp,aux.Stringid(m,1)) then
local ct=RushDuel.GetSPCount(tp,2)
if ct<1 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cm.spfilter),tp,LOCATION_GRAVE,0,1,ct,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end end
end end
\ No newline at end of file
...@@ -25,33 +25,27 @@ function cm.condition(e,tp,eg,ep,ev,re,r,rp) ...@@ -25,33 +25,27 @@ 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(1-tp) RD.TargetDamage(1-tp,400)
Duel.SetTargetParam(400)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,400)
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.Damage()
Duel.Damage(p,d,REASON_EFFECT)
if Duel.GetFlagEffect(tp,m)~=0 then return end if Duel.GetFlagEffect(tp,m)~=0 then return end
RD.CreateHintEffect(e,aux.Stringid(m,1),tp,1,0,RESET_PHASE+PHASE_END)
local e1=Effect.CreateEffect(e:GetHandler()) local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD) e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_UNRELEASABLE_SUM) e1:SetCode(EFFECT_UNRELEASABLE_SUM)
e1:SetProperty(EFFECT_FLAG_SET_AVAILABLE) e1:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
e1:SetTargetRange(0,LOCATION_MZONE) e1:SetTargetRange(0,LOCATION_MZONE)
e1:SetTarget(cm.reltg) e1:SetLabel(1-tp)
e1:SetValue(1) e1:SetTarget(cm.sumtg)
e1:SetValue(cm.sumlimit)
e1:SetReset(RESET_PHASE+PHASE_END) e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp) 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.reltg(e,c) function cm.sumtg(e,c)
return c:IsFacedown() return c:IsFacedown()
end
function cm.sumlimit(e,c)
return c~=nil and c:IsControler(e:GetLabel())
end end
\ No newline at end of file
...@@ -17,24 +17,13 @@ end ...@@ -17,24 +17,13 @@ end
function cm.costfilter(c) function cm.costfilter(c)
return c:IsAttribute(ATTRIBUTE_FIRE) and c:IsAbleToGraveAsCost() return c:IsAttribute(ATTRIBUTE_FIRE) 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.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.Draw()~=0 and Duel.IsExistingMatchingCard(Card.IsFaceup,tp,LOCATION_FZONE,LOCATION_FZONE,1,nil) then
if Duel.Draw(p,d,REASON_EFFECT)~=0 RD.CanDraw(aux.Stringid(m,1),tp,1)
and Duel.IsExistingMatchingCard(Card.IsFaceup,tp,LOCATION_FZONE,LOCATION_FZONE,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
\ No newline at end of file
...@@ -18,14 +18,9 @@ function cm.costfilter(c,e,tp) ...@@ -18,14 +18,9 @@ function cm.costfilter(c,e,tp)
return c:IsAbleToGraveAsCost() and Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_HAND,0,1,c,e,tp) return c:IsAbleToGraveAsCost() and Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_HAND,0,1,c,e,tp)
end end
function cm.spfilter(c,e,tp) function cm.spfilter(c,e,tp)
return c:IsLevel(7) and c:IsRace(RACE_DRAGON) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_ATTACK) return c:IsLevel(7) and c:IsRace(RACE_DRAGON) and RD.IsCanBeSpecialSummoned(c,e,tp,POS_FACEUP_ATTACK)
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,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,cm.costfilter,tp,LOCATION_HAND,0,1,1,nil,e,tp)
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)
local c=e:GetHandler() local c=e:GetHandler()
if chk==0 then return c:IsAbleToGrave() and Duel.GetMZoneCount(tp,c)>0 if chk==0 then return c:IsAbleToGrave() and Duel.GetMZoneCount(tp,c)>0
...@@ -35,19 +30,10 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -35,19 +30,10 @@ 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 c=e:GetHandler() local c=e:GetHandler()
if c:IsRelateToEffect(e) and Duel.SendtoGrave(c,REASON_EFFECT)~=0 and Duel.GetMZoneCount(tp)>0 then if c:IsRelateToEffect(e) and Duel.SendtoGrave(c,REASON_EFFECT)~=0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) if RD.SelectAndSpecialSummon(cm.spfilter,tp,LOCATION_HAND,0,1,1,nil,e,POS_FACEUP_ATTACK)~=0 then
local g=Duel.SelectMatchingCard(tp,cm.spfilter,tp,LOCATION_HAND,0,1,1,nil,e,tp) local tc=Duel.GetOperatedGroup():GetFirst()
local tc=g:GetFirst() RD.AttachAtkDef(e,tc,1500,0,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
if not tc then return end
Duel.BreakEffect()
if Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP_ATTACK)~=0 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)
tc:RegisterEffect(e1)
end 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