Commit 5e4282f8 authored by 未闻皂名's avatar 未闻皂名

2022/2/25 模块化进度:KP03

parent c368767a
...@@ -22,6 +22,19 @@ function RushDuel.ToMaximunGroup(target) ...@@ -22,6 +22,19 @@ function RushDuel.ToMaximunGroup(target)
g:Merge(overlay) g:Merge(overlay)
return g return g
end end
-- Get Useable Monster Zone Count
function RushDuel.GetMZoneCount(player, max)
local ct = Duel.GetLocationCount(player, LOCATION_MZONE)
if Duel.IsPlayerAffectedByEffect(player, 59822133) then
ct = math.min(ct, 1)
end
return math.min(ct, max)
end
-- Get Useable Spell & Trap Zone Count
function RushDuel.GetSZoneCount(player, max)
local ct = Duel.GetLocationCount(player, LOCATION_SZONE)
return math.min(ct, max)
end
-- Hint (LP Label) -- Hint (LP Label)
function RushDuel.CreateHintEffect(e, desc, tp, s, o, reset) function RushDuel.CreateHintEffect(e, desc, tp, s, o, reset)
...@@ -46,6 +59,7 @@ function RushDuel.CreateAttackLimitEffect(e, target, tp, s, o, reset) ...@@ -46,6 +59,7 @@ function RushDuel.CreateAttackLimitEffect(e, target, tp, s, o, reset)
end end
e1:SetReset(reset) e1:SetReset(reset)
Duel.RegisterEffect(e1, tp) Duel.RegisterEffect(e1, tp)
return e1
end end
-- Can not DirectA Attack (Promise) -- Can not DirectA Attack (Promise)
function RushDuel.CreateCannotDirectAttackEffect(e, target, tp, s, o, reset) function RushDuel.CreateCannotDirectAttackEffect(e, target, tp, s, o, reset)
...@@ -59,6 +73,7 @@ function RushDuel.CreateCannotDirectAttackEffect(e, target, tp, s, o, reset) ...@@ -59,6 +73,7 @@ function RushDuel.CreateCannotDirectAttackEffect(e, target, tp, s, o, reset)
end end
e1:SetReset(reset) e1:SetReset(reset)
Duel.RegisterEffect(e1, tp) Duel.RegisterEffect(e1, tp)
return e1
end end
-- Check: Is Life Point Below -- Check: Is Life Point Below
...@@ -81,6 +96,9 @@ end ...@@ -81,6 +96,9 @@ end
function RushDuel.IsSpecialSummonTurn(c) function RushDuel.IsSpecialSummonTurn(c)
return c:IsReason(REASON_SPSUMMON) and c:IsStatus(STATUS_SPSUMMON_TURN) return c:IsReason(REASON_SPSUMMON) and c:IsStatus(STATUS_SPSUMMON_TURN)
end end
function RushDuel.IsDefenseBelow(c, def)
return c:IsDefenseBelow(def) and not RushDuel.IsMaximumMode(c)
end
-- Check: Is can Change Def -- Check: Is can Change Def
function RushDuel.IsCanChangeDef(c) function RushDuel.IsCanChangeDef(c)
return c:IsDefenseAbove(0) and not RushDuel.IsMaximumMode(c) return c:IsDefenseAbove(0) and not RushDuel.IsMaximumMode(c)
...@@ -146,23 +164,47 @@ function RushDuel.CostSendDeckTopToGrave(count) ...@@ -146,23 +164,47 @@ function RushDuel.CostSendDeckTopToGrave(count)
Duel.DiscardDeck(tp, count, REASON_COST) Duel.DiscardDeck(tp, count, REASON_COST)
end end
end end
-- Cost: Send Hand Card(s) to Grave -- Cost: Send Card(s) to Grave
function RushDuel.CostSendHandToGrave(filter, min, max, set_label, set_object) function RushDuel.CostSendToGrave(filter, field, min, max, except_self, set_label_before, set_object_before, set_label_after, set_object_after)
return function(e, tp, eg, ep, ev, re, r, rp, chk) return function(e, tp, eg, ep, ev, re, r, rp, chk)
local exc = nil
if except_self then
exc = e:GetHandler()
end
if chk == 0 then if chk == 0 then
return Duel.IsExistingMatchingCard(filter, tp, LOCATION_HAND, 0, min, e:GetHandler(), e, tp) return Duel.IsExistingMatchingCard(filter, tp, field, 0, min, exc, e, tp)
end end
Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_TOGRAVE) Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_TOGRAVE)
local g = Duel.SelectMatchingCard(tp, filter, tp, LOCATION_HAND, 0, min, max, e:GetHandler(), e, tp) local g = Duel.SelectMatchingCard(tp, filter, tp, field, 0, min, max, exc, e, tp)
if set_label ~= nil then if set_label_before ~= nil then
e:SetLabel(set_label(g)) e:SetLabel(set_label_before(g))
end end
if set_object ~= nil then if set_object_before ~= nil then
e:SetLabelObject(set_object(g)) e:SetLabelObject(set_object_before(g))
end
if Duel.SendtoGrave(g, REASON_COST) ~= 0 and (set_label_after ~= nil or set_object_after ~= nil) then
local og = Duel.GetOperatedGroup()
if set_label_after ~= nil then
e:SetLabel(set_label_after(g))
end
if set_object_after ~= nil then
e:SetLabelObject(set_object_after(g))
end
end end
Duel.SendtoGrave(g, REASON_COST)
end end
end end
-- Cost: Send Hand Card(s) to Grave
function RushDuel.CostSendHandToGrave(filter, min, max, set_label_before, set_object_before, set_label_after, set_object_after)
return RushDuel.CostSendToGrave(filter, LOCATION_HAND, min, max, true, set_label_before, set_object_before, set_label_after, set_object_after)
end
-- Cost: Send Monster Zone Card(s) to Grave
function RushDuel.CostSendMZoneToGrave(filter, min, max, except_self, set_label_before, set_object_before, set_label_after, set_object_after)
return RushDuel.CostSendToGrave(filter, LOCATION_MZONE, min, max, except_self, set_label_before, set_object_before, set_label_after, set_object_after)
end
-- Cost: Send on Field Card(s) to Grave
function RushDuel.CostSendOnFieldToGrave(filter, min, max, except_self, set_label_before, set_object_before, set_label_after, set_object_after)
return RushDuel.CostSendToGrave(filter, LOCATION_ONFIELD, min, max, except_self, set_label_before, set_object_before, set_label_after, set_object_after)
end
-- Cost: Send Self to Grave -- Cost: Send Self to Grave
function RushDuel.CostSendSelfToGrave() function RushDuel.CostSendSelfToGrave()
return function(e, tp, eg, ep, ev, re, r, rp, chk) return function(e, tp, eg, ep, ev, re, r, rp, chk)
...@@ -172,22 +214,61 @@ function RushDuel.CostSendSelfToGrave() ...@@ -172,22 +214,61 @@ function RushDuel.CostSendSelfToGrave()
Duel.SendtoGrave(RushDuel.ToMaximunGroup(e:GetHandler()), REASON_COST) Duel.SendtoGrave(RushDuel.ToMaximunGroup(e:GetHandler()), REASON_COST)
end end
end end
-- Private Cost: Send Grave to Deck
function RushDuel._cost_send_grave_to_deck(e, tp, filter, min, max, set_label, set_object, sequence)
Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_TODECK)
local g = Duel.SelectMatchingCard(tp, filter, tp, LOCATION_GRAVE, 0, min, max, nil, e, tp)
Duel.ConfirmCards(1 - tp, g)
if set_label ~= nil then
e:SetLabel(set_label(g))
end
if set_object ~= nil then
e:SetLabelObject(set_object(g))
end
if sequence == 1 and g:GetCount() > 1 then
sequence = 0
end
return Duel.SendtoDeck(g, nil, sequence, REASON_COST)
end
-- Cost: Send Grave to Deck -- Cost: Send Grave to Deck
function RushDuel.CostSendGraveToDeck(filter, min, max, set_label, set_object) function RushDuel.CostSendGraveToDeck(filter, min, max, set_label, set_object)
return function(e, tp, eg, ep, ev, re, r, rp, chk) return function(e, tp, eg, ep, ev, re, r, rp, chk)
if chk == 0 then if chk == 0 then
return Duel.IsExistingMatchingCard(filter, tp, LOCATION_GRAVE, 0, min, nil, e, tp) return Duel.IsExistingMatchingCard(filter, tp, LOCATION_GRAVE, 0, min, nil, e, tp)
end end
Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_TODECK) RushDuel._cost_send_grave_to_deck(e, tp, filter, min, max, set_label, set_object, 2)
local g = Duel.SelectMatchingCard(tp, filter, tp, LOCATION_GRAVE, 0, min, max, nil, e, tp) end
Duel.ConfirmCards(1 - tp, g) end
if set_label ~= nil then -- Cost: Send Grave to Deck Top (Sort)
e:SetLabel(set_label(g)) function RushDuel.CostSendGraveToDeckTop(filter, min, max, set_label, set_object)
return function(e, tp, eg, ep, ev, re, r, rp, chk)
if chk == 0 then
return Duel.IsExistingMatchingCard(filter, tp, LOCATION_GRAVE, 0, min, nil, e, tp)
end end
if set_object ~= nil then if RushDuel._cost_send_grave_to_deck(e, tp, filter, min, max, set_label, set_object, 0) > 1 then
e:SetLabelObject(set_object(g)) local ct = Duel.GetOperatedGroup():FilterCount(Card.IsLocation, nil, LOCATION_DECK)
if ct > 1 then
Duel.SortDecktop(tp, tp, ct)
end
end
end
end
-- Cost: Send Grave to Deck Bottom (Sort)
function RushDuel.CostSendGraveToDeckBottom(filter, min, max, set_label, set_object)
return function(e, tp, eg, ep, ev, re, r, rp, chk)
if chk == 0 then
return Duel.IsExistingMatchingCard(filter, tp, LOCATION_GRAVE, 0, min, nil, e, tp)
end
if RushDuel._cost_send_grave_to_deck(e, tp, filter, min, max, set_label, set_object, 1) > 1 then
local ct = Duel.GetOperatedGroup():FilterCount(Card.IsLocation, nil, LOCATION_DECK)
if ct > 1 then
Duel.SortDecktop(tp, tp, ct)
for i = 1, ct do
local tc = Duel.GetDecktopGroup(tp, 1):GetFirst()
Duel.MoveSequence(tc, 1)
end
end
end end
Duel.SendtoDeck(g, nil, 2, REASON_COST)
end end
end end
...@@ -225,85 +306,110 @@ function RushDuel.Damage(player, damage) ...@@ -225,85 +306,110 @@ function RushDuel.Damage(player, damage)
local p, d = Duel.GetChainInfo(0, CHAININFO_TARGET_PLAYER, CHAININFO_TARGET_PARAM) local p, d = Duel.GetChainInfo(0, CHAININFO_TARGET_PLAYER, CHAININFO_TARGET_PARAM)
return Duel.Damage(player or p, damage or d, REASON_EFFECT) return Duel.Damage(player or p, damage or d, REASON_EFFECT)
end end
-- Action: Select Card(s) and Do Action -- Private Action: Select Card(s) and Do Action
function RushDuel.SelectAndDoAction(hint, filter, tp, s, o, min, max, expect, action) function RushDuel._select_and_do_action(hint, filter, tp, s, o, min, max, expect, action, optional, desc, ...)
if min < 2 or Duel.IsExistingMatchingCard(filter, tp, s, o, min, expect) then local condition = false
Duel.Hint(HINT_SELECTMSG, tp, hint) if optional then
local g = Duel.SelectMatchingCard(tp, filter, tp, s, o, min, max, expect) condition = Duel.IsExistingMatchingCard(filter, tp, s, o, min, expect, ...) and Duel.SelectYesNo(tp, desc)
if g:GetCount() > 0 then else
Duel.HintSelection(g) condition = min < 2 or Duel.IsExistingMatchingCard(filter, tp, s, o, min, expect, ...)
action(g)
end
end end
end if condition then
-- Action: Can Select Card(s) and Do Action (Select Yes No)
function RushDuel.CanSelectAndDoAction(desc, hint, filter, tp, s, o, min, max, expect, action)
if Duel.IsExistingMatchingCard(filter, tp, s, o, min, expect) and Duel.SelectYesNo(tp, desc) then
Duel.Hint(HINT_SELECTMSG, tp, hint) Duel.Hint(HINT_SELECTMSG, tp, hint)
local g = Duel.SelectMatchingCard(tp, filter, tp, s, o, min, max, expect) local g = Duel.SelectMatchingCard(tp, filter, tp, s, o, min, max, expect, ...)
if g:GetCount() > 0 then if g:GetCount() > 0 then
Duel.HintSelection(g) Duel.HintSelection(g)
action(g) return action(g, ...)
end end
end end
end end
-- Action: Select Card(s) by Group Sub Check and Do Action -- Private Action: Select Card(s) by Group Sub Check and Do Action
function RushDuel.SelectGroupAndDoAction(hint, filter, check, tp, s, o, min, max, expect, action) function RushDuel._select_group_and_do_action(hint, filter, check, tp, s, o, min, max, expect, action, optional, desc, ...)
local g = Duel.GetMatchingGroup(filter, tp, s, o, expect) local g = Duel.GetMatchingGroup(filter, tp, s, o, expect, ...)
if g:CheckSubGroup(check, min, max) then if g:CheckSubGroup(check, min, max, ...) and (not optional or Duel.SelectYesNo(tp, desc)) then
Duel.Hint(HINT_SELECTMSG, tp, hint) Duel.Hint(HINT_SELECTMSG, tp, hint)
local sg = g:SelectSubGroup(tp, check, false, min, max) local sg = g:SelectSubGroup(tp, check, false, min, max, ...)
if sg:GetCount() > 0 then if sg:GetCount() > 0 then
Duel.HintSelection(sg) Duel.HintSelection(sg)
action(sg) return action(sg, ...)
end end
end end
end end
-- Private Action: Special Summon
function RushDuel._special_summon(g, e, tp, break_effect, pos)
if break_effect then
Duel.BreakEffect()
end
return Duel.SpecialSummon(g, 0, tp, tp, false, false, pos)
end
-- Private Action: Set Spell & Trap Card
function RushDuel._set_spell_trap(g, e, tp, break_effect)
if break_effect then
Duel.BreakEffect()
end
return Duel.SSet(tp, g)
end
-- Action: Select Card(s) and Do Action
function RushDuel.SelectAndDoAction(hint, filter, tp, s, o, min, max, expect, action)
return RushDuel._select_and_do_action(hint, filter, tp, s, o, min, max, expect, action)
end
-- Action: Can Select Card(s) and Do Action (Select Yes No)
function RushDuel.CanSelectAndDoAction(desc, hint, filter, tp, s, o, min, max, expect, action)
return RushDuel._select_and_do_action(hint, filter, tp, s, o, min, max, expect, action, true, desc)
end
-- Action: Select Card(s) by Group Sub Check and Do Action
function RushDuel.SelectGroupAndDoAction(hint, filter, check, tp, s, o, min, max, expect, action)
return RushDuel._select_group_and_do_action(hint, filter, check, tp, s, o, min, max, expect, action)
end
-- Action: Can Select Card(s) by Group Sub Check and Do Action -- Action: Can Select Card(s) by Group Sub Check and Do Action
function RushDuel.CanSelectGroupAndDoAction(desc, hint, filter, check, tp, s, o, min, max, expect, action) function RushDuel.CanSelectGroupAndDoAction(desc, hint, filter, check, tp, s, o, min, max, expect, action)
local g = Duel.GetMatchingGroup(filter, tp, s, o, expect) return RushDuel._select_group_and_do_action(hint, filter, check, tp, s, o, min, max, expect, action, true, desc)
if g:CheckSubGroup(check, min, max) and Duel.SelectYesNo(tp, desc) then
Duel.Hint(HINT_SELECTMSG, tp, hint)
local sg = g:SelectSubGroup(tp, check, false, min, max)
if sg:GetCount() > 0 then
Duel.HintSelection(sg)
action(sg)
end
end
end end
-- Action: Select Card(s) and Special Summon -- Action: Select Monster Card(s) and Special Summon
function RushDuel.SelectAndSpecialSummon(filter, e, tp, s, o, min, max, expect, pos, break_effect) function RushDuel.SelectAndSpecialSummon(filter, e, tp, s, o, min, max, expect, pos, break_effect)
local ct = Duel.GetMZoneCount(tp) local ct = RushDuel.GetMZoneCount(tp, max)
if Duel.IsPlayerAffectedByEffect(tp, 59822133) then if ct >= min then
ct = 1 return RushDuel._select_and_do_action(HINTMSG_SPSUMMON, filter, tp, s, o, min, ct, expect, RushDuel._special_summon, false, nil, e, tp, break_effect, pos)
end
if ct >= min and (min < 2 or Duel.IsExistingMatchingCard(filter, tp, s, o, min, expect, e, tp)) then
Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_SPSUMMON)
local g = Duel.SelectMatchingCard(tp, filter, tp, s, o, min, math.min(max, ct), expect, e, tp)
if g:GetCount() > 0 then
if break_effect then
Duel.BreakEffect()
end
return Duel.SpecialSummon(g, 0, tp, tp, false, false, pos)
end
end end
return 0 return 0
end end
-- Action: Can Select Card(s) and Special Summon (Select Yes No) -- Action: Can Select Monster Card(s) and Special Summon (Select Yes No)
function RushDuel.CanSelectAndSpecialSummon(desc, filter, e, tp, s, o, min, max, expect, pos, break_effect) function RushDuel.CanSelectAndSpecialSummon(desc, filter, e, tp, s, o, min, max, expect, pos, break_effect)
local ct = Duel.GetMZoneCount(tp) local ct = RushDuel.GetMZoneCount(tp, max)
if Duel.IsPlayerAffectedByEffect(tp, 59822133) then if ct >= min then
ct = 1 return RushDuel._select_and_do_action(HINTMSG_SPSUMMON, filter, tp, s, o, min, ct, expect, RushDuel._special_summon, true, desc, e, tp, break_effect, pos)
end end
if ct >= min and Duel.IsExistingMatchingCard(filter, tp, s, o, min, expect, e, tp) and Duel.SelectYesNo(tp, desc) then return 0
Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_SPSUMMON) end
local g = Duel.SelectMatchingCard(tp, filter, tp, s, o, min, math.min(max, ct), expect, e, tp) -- Action: Select Spell and Trap Card(s) and Set
if g:GetCount() > 0 then function RushDuel.SelectAndSet(filter, e, tp, s, o, min, max, expect, break_effect)
if break_effect then local ct = RushDuel.GetSZoneCount(tp, max)
Duel.BreakEffect() if ct >= min then
end return RushDuel._select_and_do_action(HINTMSG_SET, filter, tp, s, o, min, ct, expect, RushDuel._set_spell_trap, false, nil, e, tp, break_effect)
return Duel.SpecialSummon(g, 0, tp, tp, false, false, pos) end
end return 0
end
-- Action: Can Select Spell and Trap Card(s) and Set (Select Yes No)
function RushDuel.CanSelectAndSet(desc, filter, e, tp, s, o, min, max, expect, break_effect)
local ct = RushDuel.GetSZoneCount(tp, max)
if ct >= min then
return RushDuel._select_and_do_action(HINTMSG_SET, filter, tp, s, o, min, ct, expect, RushDuel._set_spell_trap, true, desc, e, tp, break_effect)
end
return 0
end
-- Action: Select Spell and Trap Card(s) by Group Sub Check and Set
function RushDuel.CanSelectGroupAndSet(filter, check, e, tp, s, o, min, max, expect, break_effect)
local ct = RushDuel.GetSZoneCount(tp, max)
if ct >= min then
return RushDuel._select_group_and_do_action(HINTMSG_SET, filter, check, tp, s, o, min, ct, expect, RushDuel._set_spell_trap, false, nil, e, tp, break_effect)
end
return 0
end
-- Action: Can Select Spell and Trap Card(s) by Group Sub Check and Set (Select Yes No)
function RushDuel.CanSelectGroupAndSet(desc, filter, check, e, tp, s, o, min, max, expect, break_effect)
local ct = RushDuel.GetSZoneCount(tp, max)
if ct >= min then
return RushDuel._select_group_and_do_action(HINTMSG_SET, filter, check, tp, s, o, min, ct, expect, RushDuel._set_spell_trap, true, desc, e, tp, break_effect)
end end
return 0 return 0
end end
...@@ -350,6 +456,10 @@ end ...@@ -350,6 +456,10 @@ end
function RushDuel.AttachExtraAttack(e, c, value, desc, reset) function RushDuel.AttachExtraAttack(e, c, value, desc, reset)
return RushDuel.AttachSingleEffect(e, c, EFFECT_EXTRA_ATTACK, value, desc, reset) return RushDuel.AttachSingleEffect(e, c, EFFECT_EXTRA_ATTACK, value, desc, reset)
end end
-- Action: Attach Attack All
function RushDuel.AttachAttackAll(e, c, value, desc, reset)
return RushDuel.AttachSingleEffect(e, c, EFFECT_ATTACK_ALL, value, desc, reset)
end
-- Action: Attach Double Tribute -- Action: Attach Double Tribute
function RushDuel.AttachDoubleTribute(e, c, value, desc, reset) function RushDuel.AttachDoubleTribute(e, c, value, desc, reset)
return RushDuel.AttachSingleEffect(e, c, EFFECT_DOUBLE_TRIBUTE, value, desc, reset) return RushDuel.AttachSingleEffect(e, c, EFFECT_DOUBLE_TRIBUTE, value, desc, reset)
...@@ -381,10 +491,10 @@ function RD.AttachCannotSelectBattleTarget(e, c, value, desc, reset) ...@@ -381,10 +491,10 @@ function RD.AttachCannotSelectBattleTarget(e, c, value, desc, reset)
end end
-- Action: Set Base Atk and Def -- Action: Set Base Atk and Def
function RushDuel.SetBaseAtkDef(e, c, atk, def, reset) function RushDuel.SetBaseAtkDef(e, c, atk, def, reset)
if atk ~= nil and atk ~= 0 then if atk ~= nil then
RushDuel.AttachSingleEffect(e, c, EFFECT_SET_BASE_ATTACK, atk, nil, reset) RushDuel.AttachSingleEffect(e, c, EFFECT_SET_BASE_ATTACK, atk, nil, reset)
end end
if def ~= nil and def ~= 0 and RushDuel.IsCanChangeDef(c) then if def ~= nil and RushDuel.IsCanChangeDef(c) then
RushDuel.AttachSingleEffect(e, c, EFFECT_SET_BASE_DEFENSE, def, nil, reset) RushDuel.AttachSingleEffect(e, c, EFFECT_SET_BASE_DEFENSE, def, nil, reset)
end end
end end
......
...@@ -23,6 +23,6 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -23,6 +23,6 @@ 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)
RD.SelectAndDoAction(aux.Stringid(m,1),Card.IsFaceup,tp,0,LOCATION_MZONE,1,1,nil,function(g) RD.SelectAndDoAction(aux.Stringid(m,1),Card.IsFaceup,tp,0,LOCATION_MZONE,1,1,nil,function(g)
RD.SetBaseAtkDef(e,g:GetFirst(),1500,0,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END) RD.SetBaseAtkDef(e,g:GetFirst(),1500,nil,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
end) end)
end end
\ No newline at end of file
...@@ -22,38 +22,13 @@ end ...@@ -22,38 +22,13 @@ end
function cm.setfilter(c) function cm.setfilter(c)
return c:IsCode(list[1],list[2]) and c:IsSSetable() return c:IsCode(list[1],list[2]) and c:IsSSetable()
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(Card.IsFaceup,tp,0,LOCATION_MZONE,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(Card.IsFaceup,tp,0,LOCATION_MZONE,1,nil) end
end end
function cm.operation(e,tp,eg,ep,ev,re,r,rp) function cm.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(m,1)) RD.SelectAndDoAction(aux.Stringid(m,1),Card.IsFaceup,tp,0,LOCATION_MZONE,1,1,nil,function(g)
local g=Duel.SelectMatchingCard(tp,Card.IsFaceup,tp,0,LOCATION_MZONE,1,1,nil) RD.AttachAtkDef(e,g:GetFirst(),-500,0,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
if g:GetCount()>0 then RD.CanSelectGroupAndSet(aux.Stringid(m,2),aux.NecroValleyFilter(cm.setfilter),aux.dncheck,e,tp,LOCATION_GRAVE,0,1,2,nil,true)
Duel.HintSelection(g) end)
local tc=g:GetFirst()
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(-500)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
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.BreakEffect()
Duel.SSet(tp,sg)
end
end
end
end end
\ No newline at end of file
...@@ -21,27 +21,12 @@ end ...@@ -21,27 +21,12 @@ 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,e:GetHandler()) return Duel.IsExistingMatchingCard(cm.confilter,tp,LOCATION_MZONE,0,1,e:GetHandler())
end end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk) cm.cost=RD.CostSendDeckTopToGrave(1)
if chk==0 then return Duel.IsPlayerCanDiscardDeckAsCost(tp,1) end
Duel.DiscardDeck(tp,1,REASON_COST)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk) function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsFaceup,tp,0,LOCATION_MZONE,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(Card.IsFaceup,tp,0,LOCATION_MZONE,1,nil) end
end end
function cm.operation(e,tp,eg,ep,ev,re,r,rp) function cm.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(m,1)) RD.SelectAndDoAction(aux.Stringid(m,1),Card.IsFaceup,tp,0,LOCATION_MZONE,1,1,nil,function(g)
local g=Duel.SelectMatchingCard(tp,Card.IsFaceup,tp,0,LOCATION_MZONE,1,1,nil) RD.AttachAtkDef(e,g:GetFirst(),-200,-200,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:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(-200)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_UPDATE_DEFENSE)
tc:RegisterEffect(e2)
end
end end
\ No newline at end of file
...@@ -20,25 +20,17 @@ function cm.confilter(c) ...@@ -20,25 +20,17 @@ function cm.confilter(c)
end end
function cm.spfilter(c,e,tp) function cm.spfilter(c,e,tp)
return c:IsLevelBelow(7) and c:IsRace(RACE_BEAST+RACE_BEASTWARRIOR+RACE_WINDBEAST) return c:IsLevelBelow(7) and c:IsRace(RACE_BEAST+RACE_BEASTWARRIOR+RACE_WINDBEAST)
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 Duel.IsExistingMatchingCard(cm.confilter,tp,0,LOCATION_MZONE,1,nil) return Duel.IsExistingMatchingCard(cm.confilter,tp,0,LOCATION_MZONE,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_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)<1 then return end RD.SelectAndSpecialSummon(cm.spfilter,e,tp,LOCATION_HAND,0,1,1,nil,POS_FACEUP)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,cm.spfilter,tp,LOCATION_HAND,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end end
\ No newline at end of file
...@@ -18,31 +18,14 @@ function cm.costfilter(c) ...@@ -18,31 +18,14 @@ function cm.costfilter(c)
return c:IsRace(RACE_WARRIOR+RACE_SPELLCASTER) and c:IsAbleToDeckOrExtraAsCost() return c:IsRace(RACE_WARRIOR+RACE_SPELLCASTER) and c:IsAbleToDeckOrExtraAsCost()
end end
function cm.spfilter(c,e,tp) function cm.spfilter(c,e,tp)
return c:IsLevel(7) and c:IsRace(RACE_WARRIOR) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) return c:IsLevel(7) and c:IsRace(RACE_WARRIOR) and RD.IsCanBeSpecialSummoned(c,e,tp,POS_FACEUP)
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.costfilter,tp,LOCATION_GRAVE,0,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,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.CostSendGraveToDeckBottom(cm.costfilter,4,4)
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)<1 then return end RD.SelectAndSpecialSummon(cm.spfilter,e,tp,LOCATION_HAND,0,1,1,nil,POS_FACEUP)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,cm.spfilter,tp,LOCATION_HAND,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end end
\ No newline at end of file
...@@ -24,31 +24,13 @@ end ...@@ -24,31 +24,13 @@ end
function cm.condition(e,tp,eg,ep,ev,re,r,rp) function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetMatchingGroupCount(Card.IsFaceup,tp,0,LOCATION_MZONE,nil)==Duel.GetMatchingGroupCount(cm.confilter,tp,LOCATION_ONFIELD,0,nil) return Duel.GetMatchingGroupCount(Card.IsFaceup,tp,0,LOCATION_MZONE,nil)==Duel.GetMatchingGroupCount(cm.confilter,tp,LOCATION_ONFIELD,0,nil)
end end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk) cm.cost=RD.CostSendOnFieldToGrave(cm.costfilter,1,3,false,nil,nil,Group.GetCount)
if chk==0 then return Duel.IsExistingMatchingCard(cm.costfilter,tp,LOCATION_ONFIELD,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,cm.costfilter,tp,LOCATION_ONFIELD,0,1,3,nil)
local ct=Duel.SendtoGrave(g,REASON_COST)
e:SetLabel(ct)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk) function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsFaceup,tp,0,LOCATION_MZONE,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(Card.IsFaceup,tp,0,LOCATION_MZONE,1,nil) end
end end
function cm.operation(e,tp,eg,ep,ev,re,r,rp) function cm.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(m,1)) RD.SelectAndDoAction(aux.Stringid(m,1),Card.IsFaceup,tp,0,LOCATION_MZONE,1,1,nil,function(g)
local g=Duel.SelectMatchingCard(tp,Card.IsFaceup,tp,0,LOCATION_MZONE,1,1,nil) local down=-1000*e:GetLabel()
if g:GetCount()>0 then RD.AttachAtkDef(e,g:GetFirst(),down,down,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
Duel.HintSelection(g) end)
local atk=e:GetLabel()*1000
local tc=g:GetFirst()
local e1=Effect.CreateEffect(e:GetHandler())
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)
local e2=e1:Clone()
e2:SetCode(EFFECT_UPDATE_DEFENSE)
tc:RegisterEffect(e2)
end
end end
\ No newline at end of file
...@@ -17,10 +17,7 @@ end ...@@ -17,10 +17,7 @@ end
function cm.filter(c) function cm.filter(c)
return c:IsFaceup() and c:IsLevelAbove(7) return c:IsFaceup() and c:IsLevelAbove(7)
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
...@@ -28,11 +25,6 @@ function cm.operation(e,tp,eg,ep,ev,re,r,rp) ...@@ -28,11 +25,6 @@ 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 atk=Duel.GetMatchingGroupCount(cm.filter,tp,LOCATION_MZONE,0,nil)*400 local atk=Duel.GetMatchingGroupCount(cm.filter,tp,LOCATION_MZONE,0,nil)*400
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
\ No newline at end of file
...@@ -21,16 +21,13 @@ end ...@@ -21,16 +21,13 @@ end
function cm.condition(e,tp,eg,ep,ev,re,r,rp,chk) function cm.condition(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler() local c=e:GetHandler()
return c:IsPreviousLocation(LOCATION_HAND+LOCATION_GRAVE) return c:IsPreviousLocation(LOCATION_HAND+LOCATION_GRAVE)
and c:IsReason(REASON_SPSUMMON) and c:IsStatus(STATUS_SPSUMMON_TURN) and RD.IsSpecialSummonTurn(c)
and Duel.IsExistingMatchingCard(cm.confilter,tp,LOCATION_GRAVE,0,4,nil) and Duel.IsExistingMatchingCard(cm.confilter,tp,LOCATION_GRAVE,0,4,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.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
...@@ -17,26 +17,12 @@ end ...@@ -17,26 +17,12 @@ end
function cm.filter(c) function cm.filter(c)
return c:IsFaceup() and c:IsLevelBelow(6) and c:IsRace(RACE_DRAGON) return c:IsFaceup() and c:IsLevelBelow(6) and c:IsRace(RACE_DRAGON)
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,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,Card.IsAbleToGraveAsCost,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.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.AttachAtkDef(e,g:GetFirst(),500,0,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:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(500)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
end
end end
\ No newline at end of file
...@@ -20,23 +20,14 @@ end ...@@ -20,23 +20,14 @@ end
function cm.tdfilter(c) function cm.tdfilter(c)
return c:IsType(TYPE_MONSTER) and c:IsAbleToDeck() return c:IsType(TYPE_MONSTER) and c:IsAbleToDeck()
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.IsExistingMatchingCard(cm.tdfilter,tp,0,LOCATION_GRAVE,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(cm.tdfilter,tp,0,LOCATION_GRAVE,1,nil) end
local g=Duel.GetMatchingGroup(cm.tdfilter,tp,0,LOCATION_GRAVE,nil) local g=Duel.GetMatchingGroup(cm.tdfilter,tp,0,LOCATION_GRAVE,nil)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_TODECK,g,1,0,0)
end end
function cm.operation(e,tp,eg,ep,ev,re,r,rp) function cm.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK) RD.SelectAndDoAction(HINTMSG_TODECK,aux.NecroValleyFilter(cm.tdfilter),tp,0,LOCATION_GRAVE,1,2,nil,function(g)
local g=Duel.SelectMatchingCard(tp,cm.tdfilter,tp,0,LOCATION_GRAVE,1,2,nil) RD.SendToDeckAndExists(g)
if g:GetCount()>0 then end)
Duel.ConfirmCards(1-tp,g)
Duel.SendtoDeck(g,nil,2,REASON_EFFECT)
end
end end
\ No newline at end of file
...@@ -17,13 +17,7 @@ end ...@@ -17,13 +17,7 @@ end
function cm.costfilter(c) function cm.costfilter(c)
return c:IsLevelBelow(5) and c:IsRace(RACE_DRAGON) and c:IsAbleToDeckOrExtraAsCost() return c:IsLevelBelow(5) and c:IsRace(RACE_DRAGON) and c:IsAbleToDeckOrExtraAsCost()
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.IsExistingMatchingCard(Card.IsFaceup,tp,0,LOCATION_FZONE,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(Card.IsFaceup,tp,0,LOCATION_FZONE,1,nil) end
local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,0,LOCATION_FZONE,nil) local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,0,LOCATION_FZONE,nil)
......
...@@ -19,37 +19,19 @@ function cm.tdfilter(c) ...@@ -19,37 +19,19 @@ function cm.tdfilter(c)
return c:IsCode(list[1],list[2]) and c:IsAbleToDeck() return c:IsCode(list[1],list[2]) and c:IsAbleToDeck()
end end
function cm.desfilter(c) function cm.desfilter(c)
return c:IsFaceup() and c:IsDefenseBelow(1500) and RushDuel.IsHasDefense(c) return c:IsFaceup() and RD.IsDefenseBelow(c,1500)
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDiscardDeckAsCost(tp,1) end
Duel.DiscardDeck(tp,1,REASON_COST)
end end
cm.cost=RD.CostSendDeckTopToGrave(1)
function cm.operation(e,tp,eg,ep,ev,re,r,rp) function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
if c:IsFaceup() and c:IsRelateToEffect(e) then if c:IsFaceup() and c:IsRelateToEffect(e) then
local e1=Effect.CreateEffect(c) RD.AttachAtkDef(e,c,600,0,RESET_EVENT+RESETS_STANDARD+RESET_DISABLE+RESET_PHASE+PHASE_END)
e1:SetType(EFFECT_TYPE_SINGLE) RD.CanSelectGroupAndDoAction(aux.Stringid(m,1),HINTMSG_TODECK,aux.NecroValleyFilter(cm.tdfilter),aux.dncheck,tp,LOCATION_GRAVE,0,2,2,nil,function(g)
e1:SetCode(EFFECT_UPDATE_ATTACK) if RD.SendToDeckAndExists(g) then
e1:SetValue(600) RD.CanSelectAndDoAction(aux.Stringid(m,2),HINTMSG_DESTROY,cm.desfilter,tp,0,LOCATION_MZONE,1,1,nil,function(sg)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE+RESET_PHASE+PHASE_END) Duel.Destroy(sg,REASON_EFFECT)
c:RegisterEffect(e1) end)
local mg=Duel.GetMatchingGroup(aux.NecroValleyFilter(cm.tdfilter),tp,LOCATION_GRAVE,0,nil)
if mg:CheckSubGroup(aux.dncheck,2,2) and Duel.SelectYesNo(tp,aux.Stringid(m,1)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local sg=mg:SelectSubGroup(tp,aux.dncheck,false,2,2)
if sg:GetCount()==0 then return end
Duel.ConfirmCards(1-tp,sg)
if Duel.SendtoDeck(sg,nil,2,REASON_EFFECT)~=0
and Duel.IsExistingMatchingCard(cm.desfilter,tp,0,LOCATION_MZONE,1,nil)
and Duel.SelectYesNo(tp,aux.Stringid(m,2)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectMatchingCard(tp,cm.desfilter,tp,0,LOCATION_MZONE,1,1,nil)
Duel.HintSelection(g)
if g:GetCount()>0 then
Duel.Destroy(g,REASON_EFFECT)
end
end end
end end)
end end
end end
\ No newline at end of file
...@@ -23,11 +23,6 @@ function cm.operation(e,tp,eg,ep,ev,re,r,rp) ...@@ -23,11 +23,6 @@ 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 atk=e:GetLabel()*600 local atk=e:GetLabel()*600
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
\ No newline at end of file
...@@ -23,11 +23,8 @@ function cm.condition(e,tp,eg,ep,ev,re,r,rp) ...@@ -23,11 +23,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 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.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.Recover()
Duel.Recover(p,d,REASON_EFFECT)
end end
\ No newline at end of file
...@@ -18,18 +18,14 @@ function cm.thfilter(c) ...@@ -18,18 +18,14 @@ function cm.thfilter(c)
return c:IsType(TYPE_NORMAL) and c:IsAttribute(ATTRIBUTE_LIGHT) and c:IsRace(RACE_AQUA) and c:IsAbleToHand() return c:IsType(TYPE_NORMAL) and c:IsAttribute(ATTRIBUTE_LIGHT) and c:IsRace(RACE_AQUA) and c:IsAbleToHand()
end end
function cm.condition(e,tp,eg,ep,ev,re,r,rp) function cm.condition(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() return RD.IsSummonTurn(e:GetHandler())
return c:IsReason(REASON_SUMMON) and c:IsStatus(STATUS_SUMMON_TURN)
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.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.operation(e,tp,eg,ep,ev,re,r,rp) function cm.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) RD.SelectAndDoAction(HINTMSG_ATOHAND,aux.NecroValleyFilter(cm.thfilter),tp,LOCATION_GRAVE,0,1,1,nil,function(g)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cm.thfilter),tp,LOCATION_GRAVE,0,1,1,nil) RD.SendToHandAndExists(g,1-tp)
if g:GetCount()>0 then end)
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end end
\ No newline at end of file
...@@ -23,10 +23,7 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -23,10 +23,7 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_GRAVE) Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_GRAVE)
end end
function cm.operation(e,tp,eg,ep,ev,re,r,rp) function cm.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) RD.SelectAndDoAction(HINTMSG_ATOHAND,aux.NecroValleyFilter(cm.thfilter),tp,LOCATION_GRAVE,0,1,1,nil,function(g)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cm.thfilter),tp,LOCATION_GRAVE,0,1,1,nil) RD.SendToHandAndExists(g,1-tp)
if g:GetCount()>0 then end)
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end end
\ No newline at end of file
...@@ -15,11 +15,10 @@ function cm.initial_effect(c) ...@@ -15,11 +15,10 @@ function cm.initial_effect(c)
end end
--Special Summon --Special Summon
function cm.spfilter(c,e,tp) function cm.spfilter(c,e,tp)
return c:IsLevelBelow(7) and c:IsRace(RACE_BEASTWARRIOR) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) return c:IsLevelBelow(7) and 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)
local c=e:GetHandler() return RD.IsSummonTurn(e:GetHandler())
return c:IsReason(REASON_SUMMON) and c:IsStatus(STATUS_SUMMON_TURN)
and Duel.GetFieldGroupCount(tp,0,LOCATION_MZONE)==3 and Duel.GetFieldGroupCount(tp,0,LOCATION_MZONE)==3
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)
...@@ -28,30 +27,10 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -28,30 +27,10 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
end end
function cm.operation(e,tp,eg,ep,ev,re,r,rp) function cm.operation(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetMZoneCount(tp)>0 then RD.SelectAndSpecialSummon(cm.spfilter,e,tp,LOCATION_HAND,0,1,1,nil,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)
......
...@@ -16,63 +16,21 @@ end ...@@ -16,63 +16,21 @@ end
function cm.costfilter(c) function cm.costfilter(c)
return c:IsFaceup() and c:IsLevelBelow(4) and c:IsRace(RACE_BEASTWARRIOR) and c:IsAbleToGraveAsCost() return c:IsFaceup() and c:IsLevelBelow(4) and c:IsRace(RACE_BEASTWARRIOR) and c:IsAbleToGraveAsCost()
end end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk) cm.cost=RD.CostSendMZoneToGrave(cm.costfilter,2,2,true,function(g)
if chk==0 then return Duel.IsExistingMatchingCard(cm.costfilter,tp,LOCATION_MZONE,0,2,e:GetHandler()) end return g:GetSum(Card.GetLevel)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) end)
local g=Duel.SelectMatchingCard(tp,cm.costfilter,tp,LOCATION_MZONE,0,2,2,e:GetHandler())
e:SetLabel(g:GetSum(Card.GetLevel))
Duel.SendtoGrave(g,REASON_COST)
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp) function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
if c:IsFaceup() and c:IsRelateToEffect(e) then if c:IsFaceup() and c:IsRelateToEffect(e) then
local atk=e:GetLabel()*100 local atk=e:GetLabel()*100
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,atk,0,reset)
e1:SetCode(EFFECT_UPDATE_ATTACK) RD.AttachCannotSelectBattleTarget(e,c,cm.atlimit,aux.Stringid(m,2),reset)
e1:SetValue(atk) RD.AttachCannotDirectAttack(e,c,aux.Stringid(m,3),reset)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE+RESET_PHASE+PHASE_END) RD.AttachAttackAll(e,c,1,aux.Stringid(m,4),reset)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,2))
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_CANNOT_SELECT_BATTLE_TARGET)
e2:SetProperty(EFFECT_FLAG_CLIENT_HINT)
e2:SetValue(cm.atlimit)
e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE+RESET_PHASE+PHASE_END)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,3))
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_CANNOT_DIRECT_ATTACK)
e3:SetProperty(EFFECT_FLAG_CLIENT_HINT)
e3:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE+RESET_PHASE+PHASE_END)
c:RegisterEffect(e3)
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(m,4))
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetCode(EFFECT_ATTACK_ALL)
e4:SetProperty(EFFECT_FLAG_CLIENT_HINT)
e4:SetValue(1)
e4:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE+RESET_PHASE+PHASE_END)
c:RegisterEffect(e4)
end end
local e4=Effect.CreateEffect(c) RD.CreateHintEffect(e,aux.Stringid(m,1),tp,1,0,RESET_PHASE+PHASE_END)
e4:SetType(EFFECT_TYPE_FIELD) RD.CreateAttackLimitEffect(e,cm.atktg,tp,LOCATION_MZONE,0,RESET_PHASE+PHASE_END):SetLabel(c:GetFieldID())
e4:SetCode(EFFECT_CANNOT_ATTACK)
e4:SetTargetRange(LOCATION_MZONE,0)
e4:SetTarget(cm.atktg)
e4:SetLabel(c:GetFieldID())
e4:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e4,tp)
--Hint
local e5=Effect.CreateEffect(e:GetHandler())
e5:SetDescription(aux.Stringid(m,1))
e5:SetType(EFFECT_TYPE_FIELD)
e5:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CLIENT_HINT)
e5:SetTargetRange(1,0)
e5:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e5,tp)
end end
function cm.atlimit(e,c) function cm.atlimit(e,c)
return c:IsDefensePos() return c:IsDefensePos()
......
...@@ -17,25 +17,17 @@ end ...@@ -17,25 +17,17 @@ 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)>4 end if chk==0 then return Duel.GetFieldGroupCount(tp,0,LOCATION_DECK)>4 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)<5 then return end if Duel.GetFieldGroupCount(tp,0,LOCATION_DECK)<5 then return end
Duel.ConfirmDecktop(1-tp,5) Duel.ConfirmDecktop(1-tp,5)
local atk=Duel.GetDecktopGroup(1-tp,5):FilterCount(cm.filter,nil) local atk=Duel.GetDecktopGroup(1-tp,5):FilterCount(cm.filter,nil)*100
local c=e:GetHandler() local c=e:GetHandler()
if c:IsFaceup() and c:IsRelateToEffect(e) then if c:IsFaceup() and c:IsRelateToEffect(e) then
local e1=Effect.CreateEffect(c) RD.AttachAtkDef(e,c,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*100)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE+RESET_PHASE+PHASE_END)
c:RegisterEffect(e1)
end end
Duel.SortDecktop(1-tp,1-tp,5) Duel.SortDecktop(1-tp,1-tp,5)
for i=1,5 do for i=1,5 do
......
...@@ -7,6 +7,7 @@ function cm.initial_effect(c) ...@@ -7,6 +7,7 @@ function cm.initial_effect(c)
e1:SetDescription(aux.Stringid(m,0)) e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_DAMAGE+CATEGORY_DRAW) e1:SetCategory(CATEGORY_DAMAGE+CATEGORY_DRAW)
e1:SetType(EFFECT_TYPE_IGNITION) e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetRange(LOCATION_MZONE) e1:SetRange(LOCATION_MZONE)
e1:SetCost(cm.cost) e1:SetCost(cm.cost)
e1:SetTarget(cm.target) e1:SetTarget(cm.target)
...@@ -17,19 +18,14 @@ end ...@@ -17,19 +18,14 @@ end
function cm.costfilter(c) function cm.costfilter(c)
return c:IsFaceup() and c:IsType(TYPE_NORMAL) and c:IsRace(RACE_PYRO) and c:IsAbleToGraveAsCost() return c:IsFaceup() and c:IsType(TYPE_NORMAL) and c:IsRace(RACE_PYRO) and c:IsAbleToGraveAsCost()
end end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk) cm.cost=RD.CostSendMZoneToGrave(cm.costfilter,1,1,false)
if chk==0 then return Duel.IsExistingMatchingCard(cm.costfilter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,cm.costfilter,tp,LOCATION_MZONE,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.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,1000) RD.TargetDamage(1-tp,1000)
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 then if RD.Damage()~=0 then
Duel.Draw(tp,1,REASON_EFFECT) Duel.Draw(tp,1,REASON_EFFECT)
end end
end end
\ No newline at end of file
...@@ -30,10 +30,7 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -30,10 +30,7 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_GRAVE) Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_GRAVE)
end end
function cm.operation(e,tp,eg,ep,ev,re,r,rp) function cm.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) RD.SelectAndDoAction(HINTMSG_ATOHAND,aux.NecroValleyFilter(cm.thfilter),tp,LOCATION_GRAVE,0,1,1,nil,function(g)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cm.thfilter),tp,LOCATION_GRAVE,0,1,1,nil) RD.SendToHandAndExists(g,1-tp)
if g:GetCount()>0 then end)
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end end
\ No newline at end of file
...@@ -20,21 +20,13 @@ end ...@@ -20,21 +20,13 @@ end
function cm.thfilter(c) function cm.thfilter(c)
return c:IsRace(RACE_WINDBEAST) and c:IsAttackAbove(1500) and c:IsAbleToHand() return c:IsRace(RACE_WINDBEAST) and c:IsAttackAbove(1500) and c:IsAbleToHand()
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.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.operation(e,tp,eg,ep,ev,re,r,rp) function cm.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) RD.SelectAndDoAction(HINTMSG_ATOHAND,aux.NecroValleyFilter(cm.thfilter),tp,LOCATION_GRAVE,0,1,1,nil,function(g)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cm.thfilter),tp,LOCATION_GRAVE,0,1,1,nil) RD.SendToHandAndExists(g,1-tp)
if g:GetCount()>0 then end)
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end end
\ No newline at end of file
...@@ -20,24 +20,12 @@ end ...@@ -20,24 +20,12 @@ end
function cm.condition(e,tp,eg,ep,ev,re,r,rp) function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(Card.IsFaceup,tp,0,LOCATION_MZONE,2,nil) return Duel.IsExistingMatchingCard(Card.IsFaceup,tp,0,LOCATION_MZONE,2,nil)
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,0,LOCATION_MZONE,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,0,LOCATION_MZONE,1,nil) end
end end
function cm.operation(e,tp,eg,ep,ev,re,r,rp) function cm.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(m,1)) RD.SelectAndDoAction(aux.Stringid(m,1),cm.filter,tp,0,LOCATION_MZONE,1,1,nil,function(g)
local g=Duel.SelectMatchingCard(tp,cm.filter,tp,0,LOCATION_MZONE,1,1,nil) RD.ChangeAttribute(e,g:GetFirst(),ATTRIBUTE_LIGHT,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:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CHANGE_ATTRIBUTE)
e1:SetValue(ATTRIBUTE_LIGHT)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
end
end end
\ No newline at end of file
...@@ -19,35 +19,19 @@ function cm.filter(c) ...@@ -19,35 +19,19 @@ function cm.filter(c)
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 c=e:GetHandler() local c=e:GetHandler()
if chk==0 then return c:IsCanChangePosition() and RushDuel.IsHasDefense(c) end if chk==0 then return RD.IsCanChangePosition(c) end
Duel.ChangePosition(c,POS_FACEUP_DEFENSE,POS_FACEDOWN_DEFENSE,POS_FACEUP_ATTACK,POS_FACEUP_ATTACK) RD.ChangePosition(c)
end end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk) function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,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)
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,500,0,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
e1:SetType(EFFECT_TYPE_SINGLE) RD.AttachEffectIndes(e,tc,cm.indes,aux.Stringid(m,2),RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
e1:SetCode(EFFECT_UPDATE_ATTACK) end)
e1:SetValue(500)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetDescription(aux.Stringid(m,2))
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE+EFFECT_FLAG_CLIENT_HINT)
e2:SetRange(LOCATION_MZONE)
e2:SetValue(cm.efilter)
e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e2)
end
end end
function cm.efilter(e,re,rp) function cm.indes(e,re,rp)
return rp==1-e:GetHandlerPlayer() and re:GetOwner():IsType(TYPE_TRAP) return rp==1-e:GetHandlerPlayer() and re:GetOwner():IsType(TYPE_TRAP)
end end
\ No newline at end of file
...@@ -16,21 +16,12 @@ end ...@@ -16,21 +16,12 @@ end
function cm.costfilter(c) function cm.costfilter(c)
return c:IsType(TYPE_NORMAL) and c:IsAbleToDeckOrExtraAsCost() return c:IsType(TYPE_NORMAL) and c:IsAbleToDeckOrExtraAsCost()
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.IsExistingMatchingCard(Card.IsFacedown,tp,0,LOCATION_ONFIELD,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(Card.IsFacedown,tp,0,LOCATION_ONFIELD,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_ONFIELD,1,1,nil,function(g)
local g=Duel.SelectMatchingCard(tp,Card.IsFacedown,tp,0,LOCATION_ONFIELD,1,1,nil)
if g:GetCount()>0 then
Duel.HintSelection(g)
Duel.ConfirmCards(tp,g) Duel.ConfirmCards(tp,g)
end end)
end end
\ No newline at end of file
...@@ -27,30 +27,14 @@ end ...@@ -27,30 +27,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.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.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.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,2,nil,function(g)
local g=Duel.SelectMatchingCard(tp,cm.filter,tp,LOCATION_MZONE,0,1,2,nil) g:ForEach(function(tc)
if g:GetCount()>0 then RD.AttachAtkDef(e,tc,500,0,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:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(500)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
tc=g:GetNext()
end
end
end end
\ No newline at end of file
...@@ -24,24 +24,12 @@ end ...@@ -24,24 +24,12 @@ end
function cm.condition(e,tp,eg,ep,ev,re,r,rp) function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(cm.confilter,tp,0,LOCATION_MZONE,1,nil) return Duel.IsExistingMatchingCard(cm.confilter,tp,0,LOCATION_MZONE,1,nil)
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.AttachAtkDef(e,g:GetFirst(),1000,0,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:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(1000)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
end
end end
\ No newline at end of file
...@@ -19,18 +19,14 @@ function cm.filter(c) ...@@ -19,18 +19,14 @@ 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)
local c=e:GetHandler() return RD.IsSummonTurn(e:GetHandler())
return c:IsReason(REASON_SUMMON) and c:IsStatus(STATUS_SUMMON_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)
local dam=Duel.GetMatchingGroupCount(cm.filter,tp,0,LOCATION_ONFIELD,nil)*300 local dam=Duel.GetMatchingGroupCount(cm.filter,tp,0,LOCATION_ONFIELD,nil)*300
if chk==0 then return dam>0 end if chk==0 then return dam>0 end
Duel.SetTargetPlayer(1-tp) RD.TargetDamage(1-tp,dam)
Duel.SetTargetParam(dam)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,dam)
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=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER)
local dam=Duel.GetMatchingGroupCount(cm.filter,tp,0,LOCATION_ONFIELD,nil)*300 local dam=Duel.GetMatchingGroupCount(cm.filter,tp,0,LOCATION_ONFIELD,nil)*300
Duel.Damage(p,dam,REASON_EFFECT) RD.Damage(nil,dam)
end end
\ No newline at end of file
...@@ -26,16 +26,7 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -26,16 +26,7 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsFaceup,tp,0,LOCATION_MZONE,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(Card.IsFaceup,tp,0,LOCATION_MZONE,1,nil) end
end end
function cm.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,0,LOCATION_MZONE,1,1,nil,function(g)
local g=Duel.SelectMatchingCard(tp,Card.IsFaceup,tp,0,LOCATION_MZONE,1,1,nil) RD.AttachAtkDef(e,g:GetFirst(),-600,0,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: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)
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:IsRace(RACE_DRAGON) and c:IsAbleToDeckOrExtraAsCost() return c:IsRace(RACE_DRAGON) 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.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,6 +16,9 @@ end ...@@ -16,6 +16,9 @@ end
function cm.filter(c) function cm.filter(c)
return c:IsFaceup() and c:IsRace(RACE_WARRIOR) return c:IsFaceup() and c:IsRace(RACE_WARRIOR)
end end
function cm.exfilter(c)
return c:IsType(TYPE_MONSTER) and c:IsLocation(LOCATION_GRAVE)
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.filter,tp,LOCATION_MZONE,0,1,nil) return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_MZONE,0,1,nil)
end end
...@@ -24,23 +27,11 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -24,23 +27,11 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetOperationInfo(0,CATEGORY_DECKDES,nil,0,tp,1) Duel.SetOperationInfo(0,CATEGORY_DECKDES,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)
if Duel.DiscardDeck(tp,1,REASON_EFFECT)~=0 then if RD.SendDeckTopToGraveAndExists(tp,1,cm.exfilter,1,nil) then
local oc=Duel.GetOperatedGroup():GetFirst() RD.SelectAndDoAction(aux.Stringid(m,1),cm.filter,tp,LOCATION_MZONE,0,1,1,nil,function(g)
if oc and oc:IsType(TYPE_MONSTER) and oc:IsLocation(LOCATION_GRAVE) then local atk=Duel.GetOperatedGroup():GetFirst():GetLevel()*300
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(m,1)) RD.AttachAtkDef(e,g:GetFirst(),atk,0,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
local g=Duel.SelectMatchingCard(tp,cm.filter,tp,LOCATION_MZONE,0,1,1,nil) Duel.Damage(tp,atk,REASON_EFFECT)
if g:GetCount()>0 then end)
Duel.HintSelection(g)
local tc=g:GetFirst()
local atk=oc:GetLevel()*300
local e1=Effect.CreateEffect(e:GetHandler())
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)
Duel.Damage(tp,atk,REASON_EFFECT)
end
end
end end
end end
\ No newline at end of file
...@@ -19,23 +19,9 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -19,23 +19,9 @@ 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,300,0,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
e1:SetType(EFFECT_TYPE_SINGLE) RD.AttachPierce(e,tc,aux.Stringid(m,2),RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
e1:SetCode(EFFECT_UPDATE_ATTACK) end)
e1:SetValue(300)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetDescription(aux.Stringid(m,2))
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_PIERCE)
e2:SetProperty(EFFECT_FLAG_CLIENT_HINT)
e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e2)
end
end end
\ No newline at end of file
...@@ -23,18 +23,9 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -23,18 +23,9 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
and Duel.IsExistingMatchingCard(cm.atkfilter,tp,LOCATION_MZONE,0,1,nil) end and Duel.IsExistingMatchingCard(cm.atkfilter,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)
local atk=Duel.GetMatchingGroupCount(cm.atkfilter,tp,LOCATION_MZONE,0,nil)*400 local atk=-400*Duel.GetMatchingGroupCount(cm.atkfilter,tp,LOCATION_MZONE,0,nil)
if atk==0 then return end if atk==0 then return end
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(m,1)) RD.SelectAndDoAction(aux.Stringid(m,1),cm.filter,tp,0,LOCATION_MZONE,1,1,nil,function(g)
local g=Duel.SelectMatchingCard(tp,cm.filter,tp,0,LOCATION_MZONE,1,1,nil) RD.AttachAtkDef(e,g:GetFirst(),atk,0,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: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)
end
end end
\ No newline at end of file
...@@ -26,16 +26,7 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -26,16 +26,7 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,0,LOCATION_MZONE,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,0,LOCATION_MZONE,1,nil) end
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,0,LOCATION_MZONE,1,1,nil,function(g)
local g=Duel.SelectMatchingCard(tp,cm.filter,tp,0,LOCATION_MZONE,1,1,nil) RD.SetBaseAtkDef(e,g:GetFirst(),0,nil,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:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_BASE_ATTACK)
e1:SetValue(0)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
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(200) e2:SetValue(200)
c:RegisterEffect(e2) c:RegisterEffect(e2)
end end
--Atk Up --Atk Up
function cm.atktg(e,c) function cm.uptg(e,c)
return c:IsFaceup() and c:IsAttribute(ATTRIBUTE_LIGHT) return c:IsFaceup() and c:IsAttribute(ATTRIBUTE_LIGHT)
end end
\ No newline at end of file
...@@ -28,17 +28,8 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -28,17 +28,8 @@ 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
local atk=Duel.GetMatchingGroupCount(cm.filter,tp,LOCATION_MZONE,0,nil)*300 local atk=Duel.GetMatchingGroupCount(cm.filter,tp,LOCATION_MZONE,0,nil)*300
Duel.HintSelection(g) RD.AttachAtkDef(e,g:GetFirst(),atk,0,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
local tc=g:GetFirst() end)
local e1=Effect.CreateEffect(e:GetHandler())
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)
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.adtg) e2:SetTarget(cm.downtg)
e2:SetValue(-300) e2:SetValue(-300)
c:RegisterEffect(e2) c:RegisterEffect(e2)
local e3=e2:Clone() local e3=e2:Clone()
...@@ -29,6 +29,6 @@ function cm.condition(e,tp,eg,ep,ev,re,r,rp) ...@@ -29,6 +29,6 @@ function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetMatchingGroupCount(cm.confilter,tp,LOCATION_MZONE,0,nil)==3 return Duel.GetMatchingGroupCount(cm.confilter,tp,LOCATION_MZONE,0,nil)==3
end end
--Atk & Def Down --Atk & Def Down
function cm.adtg(e,c) function cm.downtg(e,c)
return c:IsFaceup() and not c:IsAttribute(ATTRIBUTE_WATER) return c:IsFaceup() and not c:IsAttribute(ATTRIBUTE_WATER)
end end
\ No newline at end of file
...@@ -16,24 +16,12 @@ end ...@@ -16,24 +16,12 @@ end
function cm.filter(c) function cm.filter(c)
return c:IsFaceup() and c:IsType(TYPE_NORMAL) and c:IsAttackBelow(1000) return c:IsFaceup() and c:IsType(TYPE_NORMAL) and c:IsAttackBelow(1000)
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.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) RD.AttachAtkDef(e,g:GetFirst(),1000,0,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:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(1000)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
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_INSECT+RACE_BEAST+RACE_PLANT+RACE_BEASTWARRIOR) return c:IsFaceup() and c:IsRace(RACE_INSECT+RACE_BEAST+RACE_PLANT+RACE_BEASTWARRIOR)
end end
\ No newline at end of file
...@@ -22,7 +22,7 @@ function cm.confilter(c,tp,rp) ...@@ -22,7 +22,7 @@ function cm.confilter(c,tp,rp)
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],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,rp) return eg:IsExists(cm.confilter,1,nil,tp,rp)
...@@ -33,10 +33,5 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -33,10 +33,5 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE)
end end
function cm.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.spfilter),e,tp,LOCATION_GRAVE,0,1,1,nil,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
...@@ -24,17 +24,10 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -24,17 +24,10 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return ct>0 and Duel.IsExistingMatchingCard(Card.IsFaceup,tp,0,LOCATION_MZONE,1,nil) end if chk==0 then return ct>0 and Duel.IsExistingMatchingCard(Card.IsFaceup,tp,0,LOCATION_MZONE,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)
local atk=Duel.GetMatchingGroupCount(cm.filter,tp,LOCATION_MZONE,0,nil)*300 local atk=-300*Duel.GetMatchingGroupCount(cm.filter,tp,LOCATION_MZONE,0,nil)
if atk==0 then return end if atk==0 then return end
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
\ No newline at end of file
...@@ -21,21 +21,10 @@ function cm.condition(e,tp,eg,ep,ev,re,r,rp) ...@@ -21,21 +21,10 @@ 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:IsType(TYPE_NORMAL) and c and c:IsControler(tp) and c:IsFaceup() and c:IsType(TYPE_NORMAL)
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.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,-1000,0,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(-1000)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
end end
end end
\ No newline at end of file
...@@ -21,12 +21,7 @@ end ...@@ -21,12 +21,7 @@ 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 atk=tc:GetLevel()*100 local atk=-100*tc:GetLevel()
local e1=Effect.CreateEffect(e:GetHandler()) RD.AttachAtkDef(e,tc,atk,0,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_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)
end end
end end
\ No newline at end of file
...@@ -22,11 +22,8 @@ function cm.condition(e,tp,eg,ep,ev,re,r,rp) ...@@ -22,11 +22,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,2) end if chk==0 then return Duel.IsPlayerCanDraw(tp,2) end
Duel.SetTargetPlayer(tp) RD.TargetDraw(tp,2)
Duel.SetTargetParam(2)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,2)
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
...@@ -21,14 +21,7 @@ function cm.condition(e,tp,eg,ep,ev,re,r,rp) ...@@ -21,14 +21,7 @@ function cm.condition(e,tp,eg,ep,ev,re,r,rp)
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(Card.IsFaceup,tp,LOCATION_MZONE,0,nil) local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_MZONE,0,nil)
local tc=g:GetFirst() g:ForEach(function(tc)
while tc do RD.AttachAtkDef(e,tc,900,900,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(900)
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
...@@ -18,22 +18,19 @@ function cm.confilter(c,tp) ...@@ -18,22 +18,19 @@ function cm.confilter(c,tp)
return c:GetPreviousControler()==tp and c:IsPreviousLocation(LOCATION_ONFIELD) return c:GetPreviousControler()==tp and c:IsPreviousLocation(LOCATION_ONFIELD)
and bit.band(c:GetPreviousTypeOnField(),TYPE_SPELL+TYPE_TRAP)~=0 and c:IsReason(REASON_EFFECT) and bit.band(c:GetPreviousTypeOnField(),TYPE_SPELL+TYPE_TRAP)~=0 and c:IsReason(REASON_EFFECT)
end end
function cm.desfilter(c) function cm.filter(c)
return c:IsFaceup() and c:IsType(TYPE_EFFECT) and c:IsLevelBelow(6) return c:IsFaceup() and c:IsType(TYPE_EFFECT) and c:IsLevelBelow(6)
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)
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_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)
Duel.Destroy(g,REASON_EFFECT) Duel.Destroy(g,REASON_EFFECT)
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