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

2025/1/28 修改改变表示形式的判断

parent b44267fe
Pipeline #32827 passed with stages
in 10 minutes and 30 seconds
No preview for this file type
...@@ -22,8 +22,9 @@ EFFECT_PLAYER_CANNOT_ACTIVATE_TRAP_BATTLE = 120261022 -- 暗物质人偶·水母 ...@@ -22,8 +22,9 @@ EFFECT_PLAYER_CANNOT_ACTIVATE_TRAP_BATTLE = 120261022 -- 暗物质人偶·水母
EFFECT_ATTACK_NOT_CHAIN_TRAP = 120140004 -- 不许始末战士 (攻击宣言时, 对方不能把陷阱卡发动) EFFECT_ATTACK_NOT_CHAIN_TRAP = 120140004 -- 不许始末战士 (攻击宣言时, 对方不能把陷阱卡发动)
EFFECT_ONLY_FUSION_SUMMON = 120263031 -- 只能融合召唤 (奇迹融合) EFFECT_ONLY_FUSION_SUMMON = 120263031 -- 只能融合召唤 (奇迹融合)
EFFECT_MAXIMUM_MODE = 120272058 -- 通过效果变成极大模式 (时间机器) EFFECT_MAXIMUM_MODE = 120272058 -- 通过效果变成极大模式 (时间机器)
EFFECT_CANNOT_TO_HAND_EFFECT = 120274001 -- 不会被效果回到手卡 EFFECT_CANNOT_TO_HAND_EFFECT = 120274001 -- 不会因效果回到手卡
EFFECT_CANNOT_TO_DECK_EFFECT = 120274002 -- 不会被效果回到卡组·额外卡组 EFFECT_CANNOT_TO_DECK_EFFECT = 120274002 -- 不会因效果回到卡组·额外卡组
EFFECT_CANNOT_CHANGE_POSITION_EFFECT = 120277011 -- 不会因效果改变表示形式
-- 标记 -- 标记
FLAG_SUMMON_TURN = 120000011 -- 召唤·特殊召唤的回合被盖放, 不再符合召唤·特殊召唤的回合的条件 FLAG_SUMMON_TURN = 120000011 -- 召唤·特殊召唤的回合被盖放, 不再符合召唤·特殊召唤的回合的条件
......
...@@ -47,8 +47,20 @@ function RushDuel.IsCanChangeDef(card) ...@@ -47,8 +47,20 @@ function RushDuel.IsCanChangeDef(card)
return card:IsDefenseAbove(0) and not RushDuel.IsMaximumMode(card) return card:IsDefenseAbove(0) and not RushDuel.IsMaximumMode(card)
end end
-- 条件: 可否改变表示形式 -- 条件: 可否改变表示形式
function RushDuel.IsCanChangePosition(card) function RushDuel.IsCanChangePosition(card, effect, player, reason)
return card:IsCanChangePosition() and not RushDuel.IsMaximumMode(card) if not card:IsCanChangePosition() or RushDuel.IsMaximumMode(card) then
return false
end
local effects = {card:IsHasEffect(EFFECT_CANNOT_CHANGE_POSITION_EFFECT)}
for i, e in ipairs(effects) do
local value = e:GetValue()
if value == 1 then
return false
elseif type(value) == "function" and value(e, effect, reason, player) then
return false
end
end
return true
end end
-- 条件: 可否特殊召唤 -- 条件: 可否特殊召唤
function RushDuel.IsCanBeSpecialSummoned(card, effect, player, position) function RushDuel.IsCanBeSpecialSummoned(card, effect, player, position)
......
...@@ -355,7 +355,7 @@ function RushDuel.CostChangeSelfPosition(pos1, pos2) ...@@ -355,7 +355,7 @@ function RushDuel.CostChangeSelfPosition(pos1, pos2)
return function(e, tp, eg, ep, ev, re, r, rp, chk) return function(e, tp, eg, ep, ev, re, r, rp, chk)
local c = e:GetHandler() local c = e:GetHandler()
if chk == 0 then if chk == 0 then
return (not pos1 or c:IsPosition(pos1)) and RushDuel.IsCanChangePosition(c) return (not pos1 or c:IsPosition(pos1)) and RushDuel.IsCanChangePosition(c, e, tp, REASON_COST)
end end
if pos2 then if pos2 then
RD.ChangePosition(c, pos2) RD.ChangePosition(c, pos2)
......
...@@ -14,12 +14,16 @@ function cm.initial_effect(c) ...@@ -14,12 +14,16 @@ function cm.initial_effect(c)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
--Position --Position
function cm.posfilter(c,e,tp)
return RD.IsCanChangePosition(c,e,tp,REASON_EFFECT)
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)
if chk==0 then return Duel.IsExistingMatchingCard(RD.IsCanChangePosition,tp,0,LOCATION_MZONE,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(cm.posfilter,tp,0,LOCATION_MZONE,1,nil,e,tp) end
local g=Duel.GetMatchingGroup(RD.IsCanChangePosition,tp,0,LOCATION_MZONE,nil) local g=Duel.GetMatchingGroup(cm.posfilter,tp,0,LOCATION_MZONE,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
end end
function cm.operation(e,tp,eg,ep,ev,re,r,rp) function cm.operation(e,tp,eg,ep,ev,re,r,rp)
RD.SelectAndDoAction(HINTMSG_POSCHANGE,RD.IsCanChangePosition,tp,0,LOCATION_MZONE,1,1,nil,RD.ChangePosition) local filter=RD.Filter(cm.posfilter,e,tp)
RD.SelectAndDoAction(HINTMSG_POSCHANGE,filter,tp,0,LOCATION_MZONE,1,1,nil,RD.ChangePosition)
end end
\ No newline at end of file
...@@ -24,7 +24,7 @@ end ...@@ -24,7 +24,7 @@ end
cm.cost=RD.CostSendDeckTopToGrave(3) cm.cost=RD.CostSendDeckTopToGrave(3)
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 RD.IsCanChangePosition(c) end if chk==0 then return RD.IsCanChangePosition(c,e,tp,REASON_EFFECT) end
Duel.SetOperationInfo(0,CATEGORY_POSITION,c,1,0,0) Duel.SetOperationInfo(0,CATEGORY_POSITION,c,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)
......
...@@ -14,17 +14,18 @@ function cm.initial_effect(c) ...@@ -14,17 +14,18 @@ function cm.initial_effect(c)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
--Position --Position
function cm.posfilter(c) function cm.posfilter(c,e,tp)
return c:IsFacedown() and RD.IsCanChangePosition(c) return c:IsFacedown() and RD.IsCanChangePosition(c,e,tp,REASON_EFFECT)
end end
cm.cost=RD.CostPayLP(1000) cm.cost=RD.CostPayLP(1000)
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk) function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.posfilter,tp,0,LOCATION_MZONE,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(cm.posfilter,tp,0,LOCATION_MZONE,1,nil,e,tp) end
local g=Duel.GetMatchingGroup(cm.posfilter,tp,0,LOCATION_MZONE,nil) local g=Duel.GetMatchingGroup(cm.posfilter,tp,0,LOCATION_MZONE,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
end end
function cm.operation(e,tp,eg,ep,ev,re,r,rp) function cm.operation(e,tp,eg,ep,ev,re,r,rp)
RD.SelectAndDoAction(HINTMSG_POSCHANGE,cm.posfilter,tp,0,LOCATION_MZONE,1,1,nil,function(g) local filter=RD.Filter(cm.posfilter,e,tp)
RD.SelectAndDoAction(HINTMSG_POSCHANGE,filter,tp,0,LOCATION_MZONE,1,1,nil,function(g)
RD.ChangePosition(g,POS_FACEUP_ATTACK) RD.ChangePosition(g,POS_FACEUP_ATTACK)
end) end)
end end
\ No newline at end of file
...@@ -20,20 +20,21 @@ end ...@@ -20,20 +20,21 @@ end
function cm.filter(c) function cm.filter(c)
return c:IsFaceup() and c:IsRace(RACE_AQUA) return c:IsFaceup() and c:IsRace(RACE_AQUA)
end end
function cm.posfilter(c) function cm.posfilter(c,e,tp)
return c:IsAttackPos() and RD.IsCanChangePosition(c) return c:IsAttackPos() and RD.IsCanChangePosition(c,e,tp,REASON_EFFECT)
end end
cm.cost=RD.CostSendHandToGrave(cm.costfilter,1,1) cm.cost=RD.CostSendHandToGrave(cm.costfilter,1,1)
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk) function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_MZONE,0,1,nil) if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_MZONE,0,1,nil)
and Duel.IsExistingMatchingCard(cm.posfilter,tp,0,LOCATION_MZONE,1,nil) end and Duel.IsExistingMatchingCard(cm.posfilter,tp,0,LOCATION_MZONE,1,nil,e,tp) end
local g=Duel.GetMatchingGroup(cm.posfilter,tp,0,LOCATION_MZONE,nil) local g=Duel.GetMatchingGroup(cm.posfilter,tp,0,LOCATION_MZONE,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
end end
function cm.operation(e,tp,eg,ep,ev,re,r,rp) function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local ct=Duel.GetMatchingGroupCount(cm.filter,tp,LOCATION_MZONE,0,nil) local ct=Duel.GetMatchingGroupCount(cm.filter,tp,LOCATION_MZONE,0,nil)
if ct==0 then return end if ct==0 then return end
RD.SelectAndDoAction(HINTMSG_POSCHANGE,cm.posfilter,tp,0,LOCATION_MZONE,1,ct,nil,function(g) local filter=RD.Filter(cm.posfilter,e,tp)
RD.SelectAndDoAction(HINTMSG_POSCHANGE,filter,tp,0,LOCATION_MZONE,1,ct,nil,function(g)
RD.ChangePosition(g,POS_FACEUP_DEFENSE) RD.ChangePosition(g,POS_FACEUP_DEFENSE)
end) end)
end end
\ No newline at end of file
...@@ -20,8 +20,8 @@ end ...@@ -20,8 +20,8 @@ end
function cm.exfilter(c) function cm.exfilter(c)
return c:IsFaceup() and c:IsType(TYPE_EQUIP) return c:IsFaceup() and c:IsType(TYPE_EQUIP)
end end
function cm.posfilter(c) function cm.posfilter(c,e,tp)
return c:IsAttackPos() and RD.IsCanChangePosition(c) return c:IsAttackPos() and RD.IsCanChangePosition(c,e,tp,REASON_EFFECT)
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.IsSummonTurn(e:GetHandler()) return RD.IsSummonTurn(e:GetHandler())
...@@ -39,9 +39,10 @@ function cm.operation(e,tp,eg,ep,ev,re,r,rp) ...@@ -39,9 +39,10 @@ function cm.operation(e,tp,eg,ep,ev,re,r,rp)
if Duel.SendtoGrave(g1,REASON_EFFECT)==0 then return end if Duel.SendtoGrave(g1,REASON_EFFECT)==0 then return end
local ct=Duel.GetOperatedGroup():FilterCount(cm.ctfilter,nil) local ct=Duel.GetOperatedGroup():FilterCount(cm.ctfilter,nil)
if ct==0 then return end if ct==0 then return end
local filter=RD.Filter(cm.posfilter,e,tp)
if Duel.Damage(1-tp,ct*100,REASON_EFFECT)~=0 if Duel.Damage(1-tp,ct*100,REASON_EFFECT)~=0
and Duel.IsExistingMatchingCard(cm.exfilter,tp,LOCATION_ONFIELD,0,1,nil) then and Duel.IsExistingMatchingCard(cm.exfilter,tp,LOCATION_ONFIELD,0,1,nil) then
RD.CanSelectAndDoAction(aux.Stringid(m,1),HINTMSG_POSCHANGE,cm.posfilter,tp,0,LOCATION_MZONE,1,1,nil,function(sg) RD.CanSelectAndDoAction(aux.Stringid(m,1),HINTMSG_POSCHANGE,filter,tp,0,LOCATION_MZONE,1,1,nil,function(sg)
RD.ChangePosition(sg,POS_FACEUP_DEFENSE) RD.ChangePosition(sg,POS_FACEUP_DEFENSE)
end) end)
end end
......
...@@ -23,8 +23,8 @@ end ...@@ -23,8 +23,8 @@ end
function cm.exfilter(c) function cm.exfilter(c)
return c:IsFaceup() and c:IsCode(list[1]) return c:IsFaceup() and c:IsCode(list[1])
end end
function cm.posfilter(c) function cm.posfilter(c,e,tp)
return c:IsFaceup() and RD.IsCanChangePosition(c) return c:IsFaceup() and RD.IsCanChangePosition(c,e,tp,REASON_EFFECT)
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.IsAbleToEnterBP() return Duel.IsAbleToEnterBP()
...@@ -37,7 +37,8 @@ function cm.operation(e,tp,eg,ep,ev,re,r,rp) ...@@ -37,7 +37,8 @@ function cm.operation(e,tp,eg,ep,ev,re,r,rp)
RD.SelectAndDoAction(aux.Stringid(m,1),cm.filter,tp,LOCATION_MZONE,0,1,1,nil,function(g) RD.SelectAndDoAction(aux.Stringid(m,1),cm.filter,tp,LOCATION_MZONE,0,1,1,nil,function(g)
RD.AttachPierce(e,g:GetFirst(),aux.Stringid(m,2),RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END) RD.AttachPierce(e,g:GetFirst(),aux.Stringid(m,2),RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
if Duel.IsExistingMatchingCard(cm.exfilter,tp,LOCATION_MZONE,0,1,nil) then if Duel.IsExistingMatchingCard(cm.exfilter,tp,LOCATION_MZONE,0,1,nil) then
RD.CanSelectAndDoAction(aux.Stringid(m,3),HINTMSG_POSCHANGE,cm.posfilter,tp,0,LOCATION_MZONE,1,1,nil,function(sg) local filter=RD.Filter(cm.posfilter,e,tp)
RD.CanSelectAndDoAction(aux.Stringid(m,3),HINTMSG_POSCHANGE,filter,tp,0,LOCATION_MZONE,1,1,nil,function(sg)
RD.ChangePosition(sg) RD.ChangePosition(sg)
end) end)
end end
......
...@@ -14,19 +14,20 @@ function cm.initial_effect(c) ...@@ -14,19 +14,20 @@ function cm.initial_effect(c)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
--Position --Position
function cm.posfilter(c) function cm.posfilter(c,e,tp)
return c:IsFaceup() and c:IsLevelBelow(6) and c:IsDefenseBelow(1000) and RD.IsCanChangePosition(c) and c:IsCanTurnSet() return c:IsFaceup() and c:IsLevelBelow(6) and c:IsDefenseBelow(1000) and RD.IsCanChangePosition(c,e,tp,REASON_EFFECT) and c:IsCanTurnSet()
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)>1 return Duel.GetFieldGroupCount(tp,0,LOCATION_MZONE)>1
end end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk) function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.posfilter,tp,0,LOCATION_MZONE,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(cm.posfilter,tp,0,LOCATION_MZONE,1,nil,e,tp) end
local g=Duel.GetMatchingGroup(cm.posfilter,tp,0,LOCATION_MZONE,nil) local g=Duel.GetMatchingGroup(cm.posfilter,tp,0,LOCATION_MZONE,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
end end
function cm.operation(e,tp,eg,ep,ev,re,r,rp) function cm.operation(e,tp,eg,ep,ev,re,r,rp)
RD.SelectAndDoAction(HINTMSG_SET,cm.posfilter,tp,0,LOCATION_MZONE,1,2,nil,function(g) local filter=RD.Filter(cm.posfilter,e,tp)
RD.SelectAndDoAction(HINTMSG_SET,filter,tp,0,LOCATION_MZONE,1,2,nil,function(g)
RD.ChangePosition(g,POS_FACEDOWN_DEFENSE) RD.ChangePosition(g,POS_FACEDOWN_DEFENSE)
end) end)
end end
\ No newline at end of file
...@@ -7,7 +7,7 @@ function cm.initial_effect(c) ...@@ -7,7 +7,7 @@ function cm.initial_effect(c)
--Discard Deck --Discard Deck
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0)) e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_DECKDES) e1:SetCategory(CATEGORY_DECKDES+CATEGORY_POSITION)
e1:SetType(EFFECT_TYPE_IGNITION) e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE) e1:SetRange(LOCATION_MZONE)
e1:SetTarget(cm.target) e1:SetTarget(cm.target)
...@@ -21,8 +21,8 @@ end ...@@ -21,8 +21,8 @@ end
function cm.filter(c) function cm.filter(c)
return c:IsFaceup() and RD.IsCanAttachPierce(c) return c:IsFaceup() and RD.IsCanAttachPierce(c)
end end
function cm.posfilter(c) function cm.posfilter(c,e,tp)
return c:IsAttackPos() and RD.IsCanChangePosition(c) return c:IsAttackPos() and RD.IsCanChangePosition(c,e,tp,REASON_EFFECT)
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.IsPlayerCanDiscardDeck(tp,1) end if chk==0 then return Duel.IsPlayerCanDiscardDeck(tp,1) end
...@@ -34,7 +34,8 @@ function cm.operation(e,tp,eg,ep,ev,re,r,rp) ...@@ -34,7 +34,8 @@ function cm.operation(e,tp,eg,ep,ev,re,r,rp)
g:ForEach(function(tc) g:ForEach(function(tc)
RD.AttachPierce(e,tc,aux.Stringid(m,3),RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END) RD.AttachPierce(e,tc,aux.Stringid(m,3),RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
end) end)
local mg=Duel.GetMatchingGroup(cm.posfilter,tp,0,LOCATION_MZONE,nil) local filter=RD.Filter(cm.posfilter,e,tp)
local mg=Duel.GetMatchingGroup(filter,tp,0,LOCATION_MZONE,nil)
if g:IsExists(Card.IsCode,1,nil,list[1]) and mg:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(m,4)) then if g:IsExists(Card.IsCode,1,nil,list[1]) and mg:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(m,4)) then
RD.ChangePosition(mg,POS_FACEUP_DEFENSE) RD.ChangePosition(mg,POS_FACEUP_DEFENSE)
end end
......
...@@ -17,17 +17,18 @@ end ...@@ -17,17 +17,18 @@ end
function cm.costfilter(c) function cm.costfilter(c)
return c:IsAttribute(ATTRIBUTE_WATER) and c:IsAbleToGraveAsCost() return c:IsAttribute(ATTRIBUTE_WATER) and c:IsAbleToGraveAsCost()
end end
function cm.posfilter(c) function cm.posfilter(c,e,tp)
return c:IsDefensePos() and RD.IsCanChangePosition(c) return c:IsDefensePos() and RD.IsCanChangePosition(c,e,tp,REASON_EFFECT)
end end
cm.cost=RD.CostSendHandToGrave(cm.costfilter,1,1) cm.cost=RD.CostSendHandToGrave(cm.costfilter,1,1)
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk) function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.posfilter,tp,0,LOCATION_MZONE,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(cm.posfilter,tp,0,LOCATION_MZONE,1,nil,e,tp) end
local g=Duel.GetMatchingGroup(cm.posfilter,tp,0,LOCATION_MZONE,nil) local g=Duel.GetMatchingGroup(cm.posfilter,tp,0,LOCATION_MZONE,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
end end
function cm.operation(e,tp,eg,ep,ev,re,r,rp) function cm.operation(e,tp,eg,ep,ev,re,r,rp)
RD.SelectAndDoAction(HINTMSG_POSCHANGE,cm.posfilter,tp,0,LOCATION_MZONE,1,1,nil,function(g) local filter=RD.Filter(cm.posfilter,e,tp)
RD.SelectAndDoAction(HINTMSG_POSCHANGE,filter,tp,0,LOCATION_MZONE,1,1,nil,function(g)
RD.ChangePosition(g,POS_FACEUP_ATTACK) RD.ChangePosition(g,POS_FACEUP_ATTACK)
end) end)
end end
\ No newline at end of file
...@@ -13,17 +13,18 @@ function cm.initial_effect(c) ...@@ -13,17 +13,18 @@ function cm.initial_effect(c)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
--Activate --Activate
function cm.filter(c) function cm.filter(c,e,tp)
return c:IsFaceup() and RD.IsCanChangePosition(c) and c:IsCanTurnSet() return c:IsFaceup() and RD.IsCanChangePosition(c,e,tp,REASON_EFFECT) and c:IsCanTurnSet()
end end
cm.cost=RD.CostSendHandToGrave(Card.IsAbleToGraveAsCost,2,2) cm.cost=RD.CostSendHandToGrave(Card.IsAbleToGraveAsCost,2,2)
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk) function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil,e,tp) end
local g=Duel.GetMatchingGroup(cm.filter,tp,LOCATION_MZONE,LOCATION_MZONE,nil) local g=Duel.GetMatchingGroup(cm.filter,tp,LOCATION_MZONE,LOCATION_MZONE,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
end end
function cm.activate(e,tp,eg,ep,ev,re,r,rp) function cm.activate(e,tp,eg,ep,ev,re,r,rp)
RD.SelectAndDoAction(HINTMSG_SET,cm.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil,function(g) local filter=RD.Filter(cm.filter,e,tp)
RD.SelectAndDoAction(HINTMSG_SET,filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil,function(g)
RD.ChangePosition(g,POS_FACEDOWN_DEFENSE) RD.ChangePosition(g,POS_FACEDOWN_DEFENSE)
end) end)
end end
\ No newline at end of file
...@@ -13,19 +13,20 @@ function cm.initial_effect(c) ...@@ -13,19 +13,20 @@ function cm.initial_effect(c)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
--Activate --Activate
function cm.filter(c) function cm.filter(c,e,tp)
return c:IsFacedown() and RD.IsCanChangePosition(c) return c:IsFacedown() and RD.IsCanChangePosition(c,e,tp,REASON_EFFECT)
end end
function cm.condition(e,tp,eg,ep,ev,re,r,rp) function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(Card.IsFacedown,tp,0,LOCATION_MZONE,2,nil) return Duel.IsExistingMatchingCard(Card.IsFacedown,tp,0,LOCATION_MZONE,2,nil)
end end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk) function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,0,LOCATION_MZONE,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,0,LOCATION_MZONE,1,nil,e,tp) end
local g=Duel.GetMatchingGroup(cm.filter,tp,0,LOCATION_MZONE,nil) local g=Duel.GetMatchingGroup(cm.filter,tp,0,LOCATION_MZONE,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
end end
function cm.activate(e,tp,eg,ep,ev,re,r,rp) function cm.activate(e,tp,eg,ep,ev,re,r,rp)
RD.SelectAndDoAction(HINTMSG_POSCHANGE,cm.filter,tp,0,LOCATION_MZONE,1,1,nil,function(g) local filter=RD.Filter(cm.filter,e,tp)
RD.SelectAndDoAction(HINTMSG_POSCHANGE,filter,tp,0,LOCATION_MZONE,1,1,nil,function(g)
RD.ChangePosition(g,POS_FACEUP_ATTACK) RD.ChangePosition(g,POS_FACEUP_ATTACK)
end) end)
end end
\ No newline at end of file
...@@ -22,9 +22,9 @@ function cm.confilter(c) ...@@ -22,9 +22,9 @@ function cm.confilter(c)
end end
function cm.posfilter(c,e,tp) function cm.posfilter(c,e,tp)
if c:IsControler(tp) then if c:IsControler(tp) then
return c:IsPosition(POS_FACEUP_ATTACK) and c:IsCode(list[1]) and RD.IsCanChangePosition(c) return c:IsPosition(POS_FACEUP_ATTACK) and c:IsCode(list[1]) and RD.IsCanChangePosition(c,e,tp,REASON_EFFECT)
else else
return c:IsAttackPos() and RD.IsCanChangePosition(c) return c:IsAttackPos() and RD.IsCanChangePosition(c,e,tp,REASON_EFFECT)
end end
end end
function cm.check(g) function cm.check(g)
......
...@@ -13,16 +13,17 @@ function cm.initial_effect(c) ...@@ -13,16 +13,17 @@ function cm.initial_effect(c)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
--Position --Position
function cm.posfilter(c) function cm.posfilter(c,e,tp)
return c:IsPosition(POS_FACEUP_DEFENSE) and c:IsRace(RACE_WARRIOR) and RD.IsCanChangePosition(c) return c:IsPosition(POS_FACEUP_DEFENSE) and c:IsRace(RACE_WARRIOR) and RD.IsCanChangePosition(c,e,tp,REASON_EFFECT)
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,LOCATION_MZONE,0,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(cm.posfilter,tp,LOCATION_MZONE,0,1,nil,e,tp) end
local g=Duel.GetMatchingGroup(cm.posfilter,tp,LOCATION_MZONE,0,nil) local g=Duel.GetMatchingGroup(cm.posfilter,tp,LOCATION_MZONE,0,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
end end
function cm.operation(e,tp,eg,ep,ev,re,r,rp) function cm.operation(e,tp,eg,ep,ev,re,r,rp)
RD.SelectAndDoAction(HINTMSG_DEFENSE,cm.posfilter,tp,LOCATION_MZONE,0,1,1,nil,function(g) local filter=RD.Filter(cm.posfilter,e,tp)
RD.SelectAndDoAction(HINTMSG_DEFENSE,filter,tp,LOCATION_MZONE,0,1,1,nil,function(g)
RD.ChangePosition(g,POS_FACEUP_ATTACK) RD.ChangePosition(g,POS_FACEUP_ATTACK)
end) end)
end end
\ No newline at end of file
...@@ -16,19 +16,20 @@ end ...@@ -16,19 +16,20 @@ end
function cm.confilter(c) function cm.confilter(c)
return c:IsFaceup() and c:IsRace(RACE_PSYCHO) return c:IsFaceup() and c:IsRace(RACE_PSYCHO)
end end
function cm.filter(c) function cm.filter(c,e,tp)
return c:IsFaceup() and RD.IsCanChangePosition(c) and c:IsCanTurnSet() return c:IsFaceup() and RD.IsCanChangePosition(c,e,tp,REASON_EFFECT) and c:IsCanTurnSet()
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,2,nil) return Duel.IsExistingMatchingCard(cm.confilter,tp,LOCATION_MZONE,0,2,nil)
end end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk) function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,0,LOCATION_MZONE,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,0,LOCATION_MZONE,1,nil,e,tp) end
local g=Duel.GetMatchingGroup(cm.filter,tp,0,LOCATION_MZONE,nil) local g=Duel.GetMatchingGroup(cm.filter,tp,0,LOCATION_MZONE,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
end end
function cm.activate(e,tp,eg,ep,ev,re,r,rp) function cm.activate(e,tp,eg,ep,ev,re,r,rp)
RD.SelectAndDoAction(HINTMSG_SET,cm.filter,tp,0,LOCATION_MZONE,1,1,nil,function(g) local filter=RD.Filter(cm.filter,e,tp)
RD.SelectAndDoAction(HINTMSG_SET,filter,tp,0,LOCATION_MZONE,1,1,nil,function(g)
RD.ChangePosition(g,POS_FACEDOWN_DEFENSE) RD.ChangePosition(g,POS_FACEDOWN_DEFENSE)
end) end)
end end
\ No newline at end of file
...@@ -12,17 +12,18 @@ function cm.initial_effect(c) ...@@ -12,17 +12,18 @@ function cm.initial_effect(c)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
--Activate --Activate
function cm.posfilter(c) function cm.posfilter(c,e,tp)
return c:IsPosition(POS_FACEUP_ATTACK) and c:IsRace(RACE_AQUA) and RD.IsCanChangePosition(c) return c:IsPosition(POS_FACEUP_ATTACK) and c:IsRace(RACE_AQUA) and RD.IsCanChangePosition(c,e,tp,REASON_EFFECT)
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,LOCATION_MZONE,0,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(cm.posfilter,tp,LOCATION_MZONE,0,1,nil,e,tp) end
local g=Duel.GetMatchingGroup(cm.posfilter,tp,LOCATION_MZONE,0,nil) local g=Duel.GetMatchingGroup(cm.posfilter,tp,LOCATION_MZONE,0,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,g:GetCount(),0,0) Duel.SetOperationInfo(0,CATEGORY_POSITION,g,g:GetCount(),0,0)
Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,g:GetCount()*400) Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,g:GetCount()*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 g=Duel.GetMatchingGroup(cm.posfilter,tp,LOCATION_MZONE,0,nil) local filter=RD.Filter(cm.posfilter,e,tp)
local g=Duel.GetMatchingGroup(filter,tp,LOCATION_MZONE,0,nil)
if g:GetCount()>0 then if g:GetCount()>0 then
local ct=RD.ChangePosition(g,POS_FACEUP_DEFENSE) local ct=RD.ChangePosition(g,POS_FACEUP_DEFENSE)
Duel.Recover(tp,ct*400,REASON_EFFECT) Duel.Recover(tp,ct*400,REASON_EFFECT)
......
...@@ -21,7 +21,7 @@ function cm.condition(e,tp,eg,ep,ev,re,r,rp) ...@@ -21,7 +21,7 @@ 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)
local tc=eg:GetFirst() local tc=eg:GetFirst()
if chk==0 then return RD.IsCanChangePosition(tc) and tc:IsCanTurnSet() end if chk==0 then return RD.IsCanChangePosition(tc,e,tp,REASON_EFFECT) and tc:IsCanTurnSet() end
Duel.SetTargetCard(tc) Duel.SetTargetCard(tc)
Duel.SetOperationInfo(0,CATEGORY_POSITION,tc,1,0,0) Duel.SetOperationInfo(0,CATEGORY_POSITION,tc,1,0,0)
end end
......
...@@ -17,20 +17,21 @@ end ...@@ -17,20 +17,21 @@ end
function cm.costfilter(c) function cm.costfilter(c)
return c:IsType(TYPE_NORMAL) and c:IsLevel(2) and c:IsAbleToGraveAsCost() return c:IsType(TYPE_NORMAL) and c:IsLevel(2) and c:IsAbleToGraveAsCost()
end end
function cm.filter(c) function cm.filter(c,e,tp)
return c:IsFaceup() and RD.IsCanChangePosition(c) and c:IsCanTurnSet() return c:IsFaceup() and RD.IsCanChangePosition(c,e,tp,REASON_EFFECT) and c:IsCanTurnSet()
end end
function cm.condition(e,tp,eg,ep,ev,re,r,rp) function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetAttacker():IsControler(1-tp) return Duel.GetAttacker():IsControler(1-tp)
end end
cm.cost=RD.CostSendHandToGrave(cm.costfilter,2,2) cm.cost=RD.CostSendHandToGrave(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(cm.filter,tp,0,LOCATION_MZONE,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,0,LOCATION_MZONE,1,nil,e,tp) end
local g=Duel.GetMatchingGroup(cm.filter,tp,0,LOCATION_MZONE,nil) local g=Duel.GetMatchingGroup(cm.filter,tp,0,LOCATION_MZONE,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
end end
function cm.activate(e,tp,eg,ep,ev,re,r,rp) function cm.activate(e,tp,eg,ep,ev,re,r,rp)
RD.SelectAndDoAction(HINTMSG_SET,cm.filter,tp,0,LOCATION_MZONE,1,2,nil,function(g) local filter=RD.Filter(cm.filter,e,tp)
RD.SelectAndDoAction(HINTMSG_SET,filter,tp,0,LOCATION_MZONE,1,2,nil,function(g)
RD.ChangePosition(g,POS_FACEDOWN_DEFENSE) RD.ChangePosition(g,POS_FACEDOWN_DEFENSE)
end) end)
end end
\ No newline at end of file
...@@ -14,17 +14,18 @@ function cm.initial_effect(c) ...@@ -14,17 +14,18 @@ function cm.initial_effect(c)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
--Position --Position
function cm.filter(c) function cm.filter(c,e,tp)
return c:IsAttackPos() and RD.IsCanChangePosition(c) return c:IsAttackPos() and RD.IsCanChangePosition(c,e,tp,REASON_EFFECT)
end end
cm.cost=RD.CostChangeSelfPosition(POS_FACEUP_ATTACK,POS_FACEUP_DEFENSE) cm.cost=RD.CostChangeSelfPosition(POS_FACEUP_ATTACK,POS_FACEUP_DEFENSE)
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,e,tp) end
local g=Duel.GetMatchingGroup(cm.filter,tp,0,LOCATION_MZONE,nil) local g=Duel.GetMatchingGroup(cm.filter,tp,0,LOCATION_MZONE,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
end end
function cm.operation(e,tp,eg,ep,ev,re,r,rp) function cm.operation(e,tp,eg,ep,ev,re,r,rp)
RD.SelectAndDoAction(HINTMSG_POSCHANGE,cm.filter,tp,0,LOCATION_MZONE,1,1,nil,function(g) local filter=RD.Filter(cm.filter,e,tp)
RD.SelectAndDoAction(HINTMSG_POSCHANGE,filter,tp,0,LOCATION_MZONE,1,1,nil,function(g)
if RD.ChangePosition(g,POS_FACEUP_DEFENCE)~=0 then if RD.ChangePosition(g,POS_FACEUP_DEFENCE)~=0 then
RD.AttachAtkDef(e,g:GetFirst(),0,-600,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END) RD.AttachAtkDef(e,g:GetFirst(),0,-600,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
end end
......
...@@ -14,9 +14,9 @@ function cm.initial_effect(c) ...@@ -14,9 +14,9 @@ function cm.initial_effect(c)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
--Activate --Activate
function cm.costfilter(c) function cm.costfilter(c,e,tp)
return c:IsPosition(POS_FACEUP_ATTACK) and c:IsLevelAbove(7) and c:IsRace(RACE_WARRIOR) return c:IsPosition(POS_FACEUP_ATTACK) and c:IsLevelAbove(7) and c:IsRace(RACE_WARRIOR)
and RD.IsCanChangePosition(c) and RD.IsCanChangePosition(c,e,tp,REASON_COST)
end end
cm.cost=RD.CostChangePosition(cm.costfilter,1,1) cm.cost=RD.CostChangePosition(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)
......
...@@ -12,16 +12,17 @@ function cm.initial_effect(c) ...@@ -12,16 +12,17 @@ function cm.initial_effect(c)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
--Activate --Activate
function cm.filter(c) function cm.filter(c,e,tp)
return c:IsAttackPos() and RD.IsCanChangePosition(c) return c:IsAttackPos() and RD.IsCanChangePosition(c,e,tp,REASON_EFFECT)
end end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk) function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,0,LOCATION_MZONE,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,0,LOCATION_MZONE,1,nil,e,tp) end
local g=Duel.GetMatchingGroup(cm.filter,tp,0,LOCATION_MZONE,nil) local g=Duel.GetMatchingGroup(cm.filter,tp,0,LOCATION_MZONE,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
end end
function cm.activate(e,tp,eg,ep,ev,re,r,rp) function cm.activate(e,tp,eg,ep,ev,re,r,rp)
RD.SelectAndDoAction(HINTMSG_POSCHANGE,cm.filter,tp,0,LOCATION_MZONE,1,1,nil,function(g) local filter=RD.Filter(cm.filter,e,tp)
RD.SelectAndDoAction(HINTMSG_POSCHANGE,filter,tp,0,LOCATION_MZONE,1,1,nil,function(g)
RD.ChangePosition(g,POS_FACEUP_DEFENSE) RD.ChangePosition(g,POS_FACEUP_DEFENSE)
end) end)
end end
\ No newline at end of file
...@@ -19,8 +19,8 @@ end ...@@ -19,8 +19,8 @@ end
function cm.confilter2(c,tp) function cm.confilter2(c,tp)
return c:GetSummonPlayer()==tp return c:GetSummonPlayer()==tp
end end
function cm.posfilter(c) function cm.posfilter(c,e,tp)
return c:IsAttackPos() and RD.IsCanChangePosition(c) return c:IsAttackPos() and RD.IsCanChangePosition(c,e,tp,REASON_EFFECT)
end end
function cm.condition(e,tp,eg,ep,ev,re,r,rp) function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(cm.confilter1,tp,LOCATION_MZONE,0,2,nil) return Duel.IsExistingMatchingCard(cm.confilter1,tp,LOCATION_MZONE,0,2,nil)
...@@ -34,7 +34,8 @@ end ...@@ -34,7 +34,8 @@ end
function cm.activate(e,tp,eg,ep,ev,re,r,rp) function cm.activate(e,tp,eg,ep,ev,re,r,rp)
RD.SelectAndDoAction(HINTMSG_RTOHAND,Card.IsAbleToHand,tp,LOCATION_MZONE,0,1,1,nil,function(g) RD.SelectAndDoAction(HINTMSG_RTOHAND,Card.IsAbleToHand,tp,LOCATION_MZONE,0,1,1,nil,function(g)
if RD.SendToHandAndExists(g,1-tp) then if RD.SendToHandAndExists(g,1-tp) then
local sg=Duel.GetMatchingGroup(cm.posfilter,tp,LOCATION_MZONE,0,nil) local filter=RD.Filter(cm.posfilter,e,tp)
local sg=Duel.GetMatchingGroup(filter,tp,LOCATION_MZONE,0,nil)
if sg:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(m,1)) then if sg:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(m,1)) then
RD.ChangePosition(sg,POS_FACEUP_DEFENSE) RD.ChangePosition(sg,POS_FACEUP_DEFENSE)
end end
......
...@@ -23,7 +23,7 @@ function cm.condition(e,tp,eg,ep,ev,re,r,rp) ...@@ -23,7 +23,7 @@ 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)
local tc=Duel.GetAttacker() local tc=Duel.GetAttacker()
if chk==0 then return tc:IsAttackPos() and RD.IsCanChangePosition(tc) end if chk==0 then return tc:IsAttackPos() and RD.IsCanChangePosition(tc,e,tp,REASON_EFFECT) end
Duel.SetOperationInfo(0,CATEGORY_POSITION,tc,1,0,0) Duel.SetOperationInfo(0,CATEGORY_POSITION,tc,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)
......
...@@ -16,18 +16,19 @@ function cm.initial_effect(c) ...@@ -16,18 +16,19 @@ function cm.initial_effect(c)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
--Position --Position
function cm.posfilter(c) function cm.posfilter(c,e,tp)
return c:IsDefensePos() and RD.IsCanChangePosition(c) return c:IsDefensePos() and RD.IsCanChangePosition(c,e,tp,REASON_EFFECT)
end end
cm.cost=RD.CostSendDeckTopToGrave(3) cm.cost=RD.CostSendDeckTopToGrave(3)
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk) function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.posfilter,tp,0,LOCATION_MZONE,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(cm.posfilter,tp,0,LOCATION_MZONE,1,nil,e,tp) end
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription()) Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
local g=Duel.GetMatchingGroup(cm.posfilter,tp,0,LOCATION_MZONE,nil) local g=Duel.GetMatchingGroup(cm.posfilter,tp,0,LOCATION_MZONE,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
end end
function cm.operation(e,tp,eg,ep,ev,re,r,rp) function cm.operation(e,tp,eg,ep,ev,re,r,rp)
RD.SelectAndDoAction(HINTMSG_POSCHANGE,cm.posfilter,tp,0,LOCATION_MZONE,1,1,nil,function(g) local filter=RD.Filter(cm.posfilter,e,tp)
RD.SelectAndDoAction(HINTMSG_POSCHANGE,filter,tp,0,LOCATION_MZONE,1,1,nil,function(g)
RD.ChangePosition(g,POS_FACEUP_ATTACK) RD.ChangePosition(g,POS_FACEUP_ATTACK)
end) end)
end end
\ No newline at end of file
...@@ -19,20 +19,21 @@ end ...@@ -19,20 +19,21 @@ end
function cm.confilter2(c,tp) function cm.confilter2(c,tp)
return c:GetSummonPlayer()==tp return c:GetSummonPlayer()==tp
end end
function cm.filter(c) function cm.filter(c,e,tp)
return not c:IsPosition(POS_FACEUP_DEFENSE) and RD.IsCanChangePosition(c) return not c:IsPosition(POS_FACEUP_DEFENSE) and RD.IsCanChangePosition(c,e,tp,REASON_EFFECT)
end end
function cm.condition(e,tp,eg,ep,ev,re,r,rp) function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetMatchingGroupCount(cm.confilter1,tp,LOCATION_MZONE,0,nil)==3 return Duel.GetMatchingGroupCount(cm.confilter1,tp,LOCATION_MZONE,0,nil)==3
and eg:IsExists(cm.confilter2,1,nil,1-tp) and eg:IsExists(cm.confilter2,1,nil,1-tp)
end end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk) function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_MZONE,0,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_MZONE,0,1,nil,e,tp) end
local g=Duel.GetMatchingGroup(cm.filter,tp,LOCATION_MZONE,0,nil) local g=Duel.GetMatchingGroup(cm.filter,tp,LOCATION_MZONE,0,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
end end
function cm.activate(e,tp,eg,ep,ev,re,r,rp) function cm.activate(e,tp,eg,ep,ev,re,r,rp)
RD.SelectAndDoAction(HINTMSG_POSCHANGE,cm.filter,tp,LOCATION_MZONE,0,1,2,nil,function(g) local filter=RD.Filter(cm.filter,e,tp)
RD.SelectAndDoAction(HINTMSG_POSCHANGE,filter,tp,LOCATION_MZONE,0,1,2,nil,function(g)
if RD.ChangePosition(g,POS_FACEUP_DEFENSE)~=0 and Duel.GetFlagEffect(tp,m)==0 then if RD.ChangePosition(g,POS_FACEUP_DEFENSE)~=0 and Duel.GetFlagEffect(tp,m)==0 then
RD.CreateHintEffect(e,aux.Stringid(m,1),tp,0,1,RESET_PHASE+PHASE_END) RD.CreateHintEffect(e,aux.Stringid(m,1),tp,0,1,RESET_PHASE+PHASE_END)
RD.CreateCannotDirectAttackEffect(e,nil,tp,0,LOCATION_MZONE,RESET_PHASE+PHASE_END) RD.CreateCannotDirectAttackEffect(e,nil,tp,0,LOCATION_MZONE,RESET_PHASE+PHASE_END)
......
...@@ -16,19 +16,20 @@ end ...@@ -16,19 +16,20 @@ end
function cm.confilter(c) function cm.confilter(c)
return c:IsFaceup() and c:IsLevelAbove(5) and c:IsAttribute(ATTRIBUTE_WIND) and c:IsRace(RACE_WARRIOR) return c:IsFaceup() and c:IsLevelAbove(5) and c:IsAttribute(ATTRIBUTE_WIND) and c:IsRace(RACE_WARRIOR)
end end
function cm.filter(c) function cm.filter(c,e,tp)
return c:IsAttackPos() and RD.IsCanChangePosition(c) return c:IsAttackPos() and RD.IsCanChangePosition(c,e,tp,REASON_EFFECT)
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.filter,tp,0,LOCATION_MZONE,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,0,LOCATION_MZONE,1,nil,e,tp) end
local g=Duel.GetMatchingGroup(cm.filter,tp,0,LOCATION_MZONE,nil) local g=Duel.GetMatchingGroup(cm.filter,tp,0,LOCATION_MZONE,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
end end
function cm.activate(e,tp,eg,ep,ev,re,r,rp) function cm.activate(e,tp,eg,ep,ev,re,r,rp)
RD.SelectAndDoAction(HINTMSG_POSCHANGE,cm.filter,tp,0,LOCATION_MZONE,1,2,nil,function(g) local filter=RD.Filter(cm.filter,e,tp)
RD.SelectAndDoAction(HINTMSG_POSCHANGE,filter,tp,0,LOCATION_MZONE,1,2,nil,function(g)
RD.ChangePosition(g,POS_FACEUP_DEFENSE) RD.ChangePosition(g,POS_FACEUP_DEFENSE)
end) end)
end end
\ No newline at end of file
...@@ -17,8 +17,8 @@ end ...@@ -17,8 +17,8 @@ end
function cm.filter(c) function cm.filter(c)
return c:IsFaceup() and c:IsRace(RACE_MACHINE) return c:IsFaceup() and c:IsRace(RACE_MACHINE)
end end
function cm.posfilter(c) function cm.posfilter(c,e,tp)
return c:IsPosition(POS_FACEDOWN_DEFENSE) and RD.IsCanChangePosition(c) return c:IsPosition(POS_FACEDOWN_DEFENSE) and RD.IsCanChangePosition(c,e,tp,REASON_EFFECT)
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() local c=e:GetHandler()
...@@ -26,14 +26,15 @@ function cm.condition(e,tp,eg,ep,ev,re,r,rp) ...@@ -26,14 +26,15 @@ 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.IsExistingMatchingCard(cm.filter,tp,LOCATION_MZONE,0,1,nil) if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_MZONE,0,1,nil)
and Duel.IsExistingMatchingCard(cm.posfilter,tp,0,LOCATION_MZONE,1,nil) end and Duel.IsExistingMatchingCard(cm.posfilter,tp,0,LOCATION_MZONE,1,nil,e,tp) end
local g=Duel.GetMatchingGroup(cm.posfilter,tp,0,LOCATION_MZONE,nil) local g=Duel.GetMatchingGroup(cm.posfilter,tp,0,LOCATION_MZONE,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
end end
function cm.operation(e,tp,eg,ep,ev,re,r,rp) function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local ct=Duel.GetMatchingGroupCount(cm.filter,tp,LOCATION_MZONE,0,nil) local ct=Duel.GetMatchingGroupCount(cm.filter,tp,LOCATION_MZONE,0,nil)
if ct==0 then return end if ct==0 then return end
RD.SelectAndDoAction(HINTMSG_POSCHANGE,cm.posfilter,tp,0,LOCATION_MZONE,1,ct,nil,function(g) local filter=RD.Filter(cm.posfilter,e,tp)
RD.SelectAndDoAction(HINTMSG_POSCHANGE,filter,tp,0,LOCATION_MZONE,1,ct,nil,function(g)
if RD.ChangePosition(g,POS_FACEUP_ATTACK)~=0 then if RD.ChangePosition(g,POS_FACEUP_ATTACK)~=0 then
local og=Duel.GetOperatedGroup() local og=Duel.GetOperatedGroup()
og:ForEach(function(tc) og:ForEach(function(tc)
......
...@@ -16,19 +16,20 @@ end ...@@ -16,19 +16,20 @@ end
function cm.confilter(c,tp) function cm.confilter(c,tp)
return c:GetSummonPlayer()==tp and c:IsLevelAbove(5) return c:GetSummonPlayer()==tp and c:IsLevelAbove(5)
end end
function cm.filter(c) function cm.filter(c,e,tp)
return c:IsFaceup() and c:IsRace(RACE_MACHINE) and RD.IsCanChangePosition(c) return c:IsFaceup() and c:IsRace(RACE_MACHINE) and RD.IsCanChangePosition(c,e,tp,REASON_EFFECT)
end end
function cm.condition(e,tp,eg,ep,ev,re,r,rp) function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(cm.confilter,1,nil,1-tp) return eg:IsExists(cm.confilter,1,nil,1-tp)
end end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk) function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.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,e,tp) end
local g=Duel.GetMatchingGroup(cm.filter,tp,LOCATION_MZONE,0,nil) local g=Duel.GetMatchingGroup(cm.filter,tp,LOCATION_MZONE,0,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
end end
function cm.activate(e,tp,eg,ep,ev,re,r,rp) function cm.activate(e,tp,eg,ep,ev,re,r,rp)
RD.SelectAndDoAction(HINTMSG_POSCHANGE,cm.filter,tp,LOCATION_MZONE,0,1,1,nil,function(g) local filter=RD.Filter(cm.filter,e,tp)
RD.SelectAndDoAction(HINTMSG_POSCHANGE,filter,tp,LOCATION_MZONE,0,1,1,nil,function(g)
if RD.ChangePosition(g)~=0 then if RD.ChangePosition(g)~=0 then
RD.AttachAtkDef(e,g:GetFirst(),1500,0,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END) RD.AttachAtkDef(e,g:GetFirst(),1500,0,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
end end
......
...@@ -24,7 +24,7 @@ function cm.condition(e,tp,eg,ep,ev,re,r,rp) ...@@ -24,7 +24,7 @@ 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)
local tc=Duel.GetAttacker() local tc=Duel.GetAttacker()
if chk==0 then return tc:IsAttackPos() and RD.IsCanChangePosition(tc) end if chk==0 then return tc:IsAttackPos() and RD.IsCanChangePosition(tc,e,tp,REASON_EFFECT) end
Duel.SetOperationInfo(0,CATEGORY_POSITION,tc,1,0,0) Duel.SetOperationInfo(0,CATEGORY_POSITION,tc,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)
......
...@@ -17,19 +17,20 @@ end ...@@ -17,19 +17,20 @@ end
function cm.confilter(c) function cm.confilter(c)
return c:IsFaceup() and c:IsLevelAbove(7) and c:IsRace(RACE_PLANT) return c:IsFaceup() and c:IsLevelAbove(7) and c:IsRace(RACE_PLANT)
end end
function cm.posfilter(c) function cm.posfilter(c,e,tp)
return c:IsDefensePos() and RD.IsCanChangePosition(c) return c:IsDefensePos() and RD.IsCanChangePosition(c,e,tp,REASON_EFFECT)
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.posfilter,tp,0,LOCATION_MZONE,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(cm.posfilter,tp,0,LOCATION_MZONE,1,nil,e,tp) end
local g=Duel.GetMatchingGroup(cm.posfilter,tp,0,LOCATION_MZONE,nil) local g=Duel.GetMatchingGroup(cm.posfilter,tp,0,LOCATION_MZONE,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
end end
function cm.operation(e,tp,eg,ep,ev,re,r,rp) function cm.operation(e,tp,eg,ep,ev,re,r,rp)
RD.SelectAndDoAction(HINTMSG_POSCHANGE,cm.posfilter,tp,0,LOCATION_MZONE,1,1,nil,function(g) local filter=RD.Filter(cm.posfilter,e,tp)
RD.SelectAndDoAction(HINTMSG_POSCHANGE,filter,tp,0,LOCATION_MZONE,1,1,nil,function(g)
if RD.ChangePosition(g,POS_FACEUP_ATTACK)~=0 then if RD.ChangePosition(g,POS_FACEUP_ATTACK)~=0 then
Duel.Recover(tp,g:GetFirst():GetBaseAttack(),REASON_EFFECT) Duel.Recover(tp,g:GetFirst():GetBaseAttack(),REASON_EFFECT)
end end
......
...@@ -19,20 +19,21 @@ end ...@@ -19,20 +19,21 @@ 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.posfilter(c) function cm.posfilter(c,e,tp)
return c:IsPosition(POS_FACEUP_ATTACK) and c:IsLevelBelow(8) and RD.IsCanChangePosition(c) and c:IsCanTurnSet() return c:IsPosition(POS_FACEUP_ATTACK) and c:IsLevelBelow(8) and RD.IsCanChangePosition(c,e,tp,REASON_EFFECT) and c:IsCanTurnSet()
end end
function cm.thfilter(c) function cm.thfilter(c)
return c:IsCode(list[1]) and c:IsAbleToHand() return c:IsCode(list[1]) and c:IsAbleToHand()
end end
cm.cost=RD.CostSendGraveToDeck(cm.costfilter,3,3) cm.cost=RD.CostSendGraveToDeck(cm.costfilter,3,3)
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk) function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.posfilter,tp,0,LOCATION_MZONE,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(cm.posfilter,tp,0,LOCATION_MZONE,1,nil,e,tp) end
local g=Duel.GetMatchingGroup(cm.posfilter,tp,0,LOCATION_MZONE,nil) local g=Duel.GetMatchingGroup(cm.posfilter,tp,0,LOCATION_MZONE,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
end end
function cm.operation(e,tp,eg,ep,ev,re,r,rp) function cm.operation(e,tp,eg,ep,ev,re,r,rp)
RD.SelectAndDoAction(HINTMSG_SET,cm.posfilter,tp,0,LOCATION_MZONE,1,1,nil,function(g) local filter=RD.Filter(cm.posfilter,e,tp)
RD.SelectAndDoAction(HINTMSG_SET,filter,tp,0,LOCATION_MZONE,1,1,nil,function(g)
if RD.ChangePosition(g,POS_FACEDOWN_DEFENSE)~=0 then if RD.ChangePosition(g,POS_FACEDOWN_DEFENSE)~=0 then
RD.CanSelectAndDoAction(aux.Stringid(m,1),HINTMSG_ATOHAND,aux.NecroValleyFilter(cm.thfilter),tp,LOCATION_GRAVE,0,1,1,nil,function(sg) RD.CanSelectAndDoAction(aux.Stringid(m,1),HINTMSG_ATOHAND,aux.NecroValleyFilter(cm.thfilter),tp,LOCATION_GRAVE,0,1,1,nil,function(sg)
RD.SendToHandAndExists(sg,1-tp) RD.SendToHandAndExists(sg,1-tp)
......
...@@ -27,7 +27,7 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -27,7 +27,7 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp)
RD.SelectAndDoAction(aux.Stringid(m,1),cm.filter,tp,LOCATION_MZONE,0,1,1,nil,function(g) RD.SelectAndDoAction(aux.Stringid(m,1),cm.filter,tp,LOCATION_MZONE,0,1,1,nil,function(g)
local tc=g:GetFirst() local tc=g:GetFirst()
RD.AttachAtkDef(e,tc,1000,0,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END) RD.AttachAtkDef(e,tc,1000,0,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
if RD.IsCanChangePosition(tc) and Duel.SelectEffectYesNo(tp,tc,aux.Stringid(m,2)) then if RD.IsCanChangePosition(tc,e,tp,REASON_EFFECT) and Duel.SelectEffectYesNo(tp,tc,aux.Stringid(m,2)) then
RD.ChangePosition(tc) RD.ChangePosition(tc)
end end
end) end)
......
...@@ -16,20 +16,21 @@ end ...@@ -16,20 +16,21 @@ 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.filter(c) function cm.posfilter(c,e,tp)
return RD.IsCanChangePosition(c) return RD.IsCanChangePosition(c,e,tp,REASON_EFFECT)
end end
function cm.exfilter(c) function cm.exfilter(c)
return c:IsFaceup() and c:IsLevel(10) return c:IsFaceup() and c:IsLevel(10)
end end
cm.cost=RD.CostSendHandToGrave(cm.costfilter,1,1) cm.cost=RD.CostSendHandToGrave(cm.costfilter,1,1)
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk) function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,0,LOCATION_MZONE,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(cm.posfilter,tp,0,LOCATION_MZONE,1,nil,e,tp) end
local g=Duel.GetMatchingGroup(cm.filter,tp,0,LOCATION_MZONE,nil) local g=Duel.GetMatchingGroup(cm.posfilter,tp,0,LOCATION_MZONE,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
end end
function cm.activate(e,tp,eg,ep,ev,re,r,rp) function cm.activate(e,tp,eg,ep,ev,re,r,rp)
RD.SelectAndDoAction(HINTMSG_POSCHANGE,cm.filter,tp,0,LOCATION_MZONE,1,1,nil,function(g) local filter=RD.Filter(cm.posfilter,e,tp)
RD.SelectAndDoAction(HINTMSG_POSCHANGE,filter,tp,0,LOCATION_MZONE,1,1,nil,function(g)
if RD.ChangePosition(g)~=0 and Duel.IsExistingMatchingCard(cm.exfilter,tp,LOCATION_MZONE,0,1,nil) then if RD.ChangePosition(g)~=0 and Duel.IsExistingMatchingCard(cm.exfilter,tp,LOCATION_MZONE,0,1,nil) then
RD.CanDraw(aux.Stringid(m,1),tp,1) RD.CanDraw(aux.Stringid(m,1),tp,1)
end end
......
...@@ -17,8 +17,8 @@ end ...@@ -17,8 +17,8 @@ end
function cm.costfilter(c) function cm.costfilter(c)
return c:IsRace(RACE_PLANT) and c:IsAbleToDeckOrExtraAsCost() return c:IsRace(RACE_PLANT) and c:IsAbleToDeckOrExtraAsCost()
end end
function cm.filter(c) function cm.filter(c,e,tp)
return c:IsAttackPos() and RD.IsCanChangePosition(c) return c:IsAttackPos() and RD.IsCanChangePosition(c,e,tp,REASON_EFFECT)
end end
function cm.condition(e,tp,eg,ep,ev,re,r,rp) function cm.condition(e,tp,eg,ep,ev,re,r,rp)
local c=Duel.GetAttackTarget() local c=Duel.GetAttackTarget()
...@@ -27,12 +27,12 @@ function cm.condition(e,tp,eg,ep,ev,re,r,rp) ...@@ -27,12 +27,12 @@ function cm.condition(e,tp,eg,ep,ev,re,r,rp)
end end
cm.cost=RD.CostSendGraveToDeckBottom(cm.costfilter,2,2) cm.cost=RD.CostSendGraveToDeckBottom(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(cm.filter,tp,0,LOCATION_MZONE,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,0,LOCATION_MZONE,1,nil,e,tp) end
local g=Duel.GetMatchingGroup(cm.filter,tp,0,LOCATION_MZONE,nil) local g=Duel.GetMatchingGroup(cm.filter,tp,0,LOCATION_MZONE,nil,e,tp)
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.filter,tp,0,LOCATION_MZONE,nil) local g=Duel.GetMatchingGroup(cm.filter,tp,0,LOCATION_MZONE,nil,e,tp)
if g:GetCount()>0 then if g:GetCount()>0 then
RD.ChangePosition(g,POS_FACEUP_DEFENSE) RD.ChangePosition(g,POS_FACEUP_DEFENSE)
end end
......
...@@ -23,20 +23,21 @@ end ...@@ -23,20 +23,21 @@ end
function cm.confilter2(c,tp) function cm.confilter2(c,tp)
return c:GetSummonPlayer()==tp and c:IsFaceup() and c:IsLevelAbove(5) return c:GetSummonPlayer()==tp and c:IsFaceup() and c:IsLevelAbove(5)
end end
function cm.filter(c) function cm.filter(c,e,tp)
return c:IsAttackPos() and RD.IsCanChangePosition(c) return c:IsAttackPos() and RD.IsCanChangePosition(c,e,tp,REASON_EFFECT)
end end
function cm.condition(e,tp,eg,ep,ev,re,r,rp) function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(cm.confilter1,tp,LOCATION_MZONE,0,1,nil) return Duel.IsExistingMatchingCard(cm.confilter1,tp,LOCATION_MZONE,0,1,nil)
and eg:IsExists(cm.confilter2,1,nil,1-tp) and eg:IsExists(cm.confilter2,1,nil,1-tp)
end end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk) function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,0,LOCATION_MZONE,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,0,LOCATION_MZONE,1,nil,e,tp) end
local g=Duel.GetMatchingGroup(cm.filter,tp,0,LOCATION_MZONE,nil) local g=Duel.GetMatchingGroup(cm.filter,tp,0,LOCATION_MZONE,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
end end
function cm.activate(e,tp,eg,ep,ev,re,r,rp) function cm.activate(e,tp,eg,ep,ev,re,r,rp)
RD.SelectAndDoAction(HINTMSG_POSCHANGE,cm.filter,tp,0,LOCATION_MZONE,1,1,nil,function(g) local filter=RD.Filter(cm.filter,e,tp)
RD.SelectAndDoAction(HINTMSG_POSCHANGE,filter,tp,0,LOCATION_MZONE,1,1,nil,function(g)
if RD.ChangePosition(g,POS_FACEUP_DEFENSE)~=0 then if RD.ChangePosition(g,POS_FACEUP_DEFENSE)~=0 then
Duel.Damage(1-tp,500,REASON_EFFECT) Duel.Damage(1-tp,500,REASON_EFFECT)
end end
......
...@@ -13,16 +13,17 @@ function cm.initial_effect(c) ...@@ -13,16 +13,17 @@ function cm.initial_effect(c)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
--Position --Position
function cm.posfilter(c) function cm.posfilter(c,e,tp)
return c:IsPosition(POS_FACEUP_ATTACK) and c:IsRace(RACE_WARRIOR) and RD.IsCanChangePosition(c) return c:IsPosition(POS_FACEUP_ATTACK) and c:IsRace(RACE_WARRIOR) and RD.IsCanChangePosition(c,e,tp,REASON_EFFECT)
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,LOCATION_MZONE,LOCATION_MZONE,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(cm.posfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil,e,tp) end
local g=Duel.GetMatchingGroup(cm.posfilter,tp,LOCATION_MZONE,LOCATION_MZONE,nil) local g=Duel.GetMatchingGroup(cm.posfilter,tp,LOCATION_MZONE,LOCATION_MZONE,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
end end
function cm.operation(e,tp,eg,ep,ev,re,r,rp) function cm.operation(e,tp,eg,ep,ev,re,r,rp)
RD.SelectAndDoAction(HINTMSG_POSCHANGE,cm.posfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil,function(g) local filter=RD.Filter(cm.posfilter,e,tp)
RD.SelectAndDoAction(HINTMSG_POSCHANGE,filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil,function(g)
RD.ChangePosition(g,POS_FACEUP_DEFENSE) RD.ChangePosition(g,POS_FACEUP_DEFENSE)
end) end)
end end
\ No newline at end of file
...@@ -17,19 +17,20 @@ end ...@@ -17,19 +17,20 @@ end
function cm.confilter(c) function cm.confilter(c)
return c:IsFaceup() and c:IsType(TYPE_NORMAL) and c:IsRace(RACE_PLANT) return c:IsFaceup() and c:IsType(TYPE_NORMAL) and c:IsRace(RACE_PLANT)
end end
function cm.posfilter(c) function cm.posfilter(c,e,tp)
return c:IsDefensePos() and RD.IsCanChangePosition(c) return c:IsDefensePos() and RD.IsCanChangePosition(c,e,tp,REASON_EFFECT)
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.posfilter,tp,0,LOCATION_MZONE,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(cm.posfilter,tp,0,LOCATION_MZONE,1,nil,e,tp) end
local g=Duel.GetMatchingGroup(cm.posfilter,tp,0,LOCATION_MZONE,nil) local g=Duel.GetMatchingGroup(cm.posfilter,tp,0,LOCATION_MZONE,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
end end
function cm.operation(e,tp,eg,ep,ev,re,r,rp) function cm.operation(e,tp,eg,ep,ev,re,r,rp)
RD.SelectAndDoAction(HINTMSG_POSCHANGE,cm.posfilter,tp,0,LOCATION_MZONE,1,1,nil,function(g) local filter=RD.Filter(cm.posfilter,e,tp)
RD.SelectAndDoAction(HINTMSG_POSCHANGE,filter,tp,0,LOCATION_MZONE,1,1,nil,function(g)
if RD.ChangePosition(g,POS_FACEUP_ATTACK)~=0 and g:GetFirst():IsAttribute(ATTRIBUTE_EARTH) then if RD.ChangePosition(g,POS_FACEUP_ATTACK)~=0 and g:GetFirst():IsAttribute(ATTRIBUTE_EARTH) then
RD.CanDraw(aux.Stringid(m,1),tp,1) RD.CanDraw(aux.Stringid(m,1),tp,1)
end end
......
...@@ -14,8 +14,8 @@ function cm.initial_effect(c) ...@@ -14,8 +14,8 @@ function cm.initial_effect(c)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
--Activate --Activate
function cm.filter(c) function cm.filter(c,e,tp)
return c:IsAttackPos() and RD.IsCanChangePosition(c) return c:IsAttackPos() and RD.IsCanChangePosition(c,e,tp,REASON_EFFECT)
end end
function cm.condition(e,tp,eg,ep,ev,re,r,rp) function cm.condition(e,tp,eg,ep,ev,re,r,rp)
local c=Duel.GetAttackTarget() local c=Duel.GetAttackTarget()
...@@ -24,12 +24,13 @@ function cm.condition(e,tp,eg,ep,ev,re,r,rp) ...@@ -24,12 +24,13 @@ function cm.condition(e,tp,eg,ep,ev,re,r,rp)
end end
cm.cost=RD.CostPayLP(600) cm.cost=RD.CostPayLP(600)
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,e,tp) end
local g=Duel.GetMatchingGroup(cm.filter,tp,0,LOCATION_MZONE,nil) local g=Duel.GetMatchingGroup(cm.filter,tp,0,LOCATION_MZONE,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
end end
function cm.activate(e,tp,eg,ep,ev,re,r,rp) function cm.activate(e,tp,eg,ep,ev,re,r,rp)
RD.SelectAndDoAction(HINTMSG_POSCHANGE,cm.filter,tp,0,LOCATION_MZONE,1,1,nil,function(g) local filter=RD.Filter(cm.filter,e,tp)
RD.SelectAndDoAction(HINTMSG_POSCHANGE,filter,tp,0,LOCATION_MZONE,1,1,nil,function(g)
RD.ChangePosition(g,POS_FACEUP_DEFENSE) RD.ChangePosition(g,POS_FACEUP_DEFENSE)
end) end)
end end
\ No newline at end of file
...@@ -13,19 +13,20 @@ function cm.initial_effect(c) ...@@ -13,19 +13,20 @@ function cm.initial_effect(c)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
--Activate --Activate
function cm.filter(c) function cm.filter(c,e,tp)
return c:IsDefensePos() and RD.IsCanChangePosition(c) return c:IsDefensePos() and RD.IsCanChangePosition(c,e,tp,REASON_EFFECT)
end end
function cm.condition(e,tp,eg,ep,ev,re,r,rp) function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(Card.IsFaceup,tp,LOCATION_FZONE,LOCATION_FZONE,1,nil) return Duel.IsExistingMatchingCard(Card.IsFaceup,tp,LOCATION_FZONE,LOCATION_FZONE,1,nil)
end end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk) function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,0,LOCATION_MZONE,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,0,LOCATION_MZONE,1,nil,e,tp) end
local g=Duel.GetMatchingGroup(cm.filter,tp,0,LOCATION_MZONE,nil) local g=Duel.GetMatchingGroup(cm.filter,tp,0,LOCATION_MZONE,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
end end
function cm.activate(e,tp,eg,ep,ev,re,r,rp) function cm.activate(e,tp,eg,ep,ev,re,r,rp)
RD.SelectAndDoAction(HINTMSG_POSCHANGE,cm.filter,tp,0,LOCATION_MZONE,1,1,nil,function(g) local filter=RD.Filter(cm.filter,e,tp)
RD.SelectAndDoAction(HINTMSG_POSCHANGE,filter,tp,0,LOCATION_MZONE,1,1,nil,function(g)
if RD.ChangePosition(g,POS_FACEUP_ATTACK)~=0 and g:GetFirst():IsType(TYPE_NORMAL) then if RD.ChangePosition(g,POS_FACEUP_ATTACK)~=0 and g:GetFirst():IsType(TYPE_NORMAL) then
RD.CanDraw(aux.Stringid(m,1),tp,1) RD.CanDraw(aux.Stringid(m,1),tp,1)
end end
......
...@@ -12,16 +12,17 @@ function cm.initial_effect(c) ...@@ -12,16 +12,17 @@ function cm.initial_effect(c)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
--Activate --Activate
function cm.filter(c) function cm.filter(c,e,tp)
return c:IsDefensePos() and RD.IsCanChangePosition(c) return c:IsDefensePos() and RD.IsCanChangePosition(c,e,tp,REASON_EFFECT)
end end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk) function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,0,LOCATION_MZONE,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,0,LOCATION_MZONE,1,nil,e,tp) end
local g=Duel.GetMatchingGroup(cm.filter,tp,0,LOCATION_MZONE,nil) local g=Duel.GetMatchingGroup(cm.filter,tp,0,LOCATION_MZONE,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
end end
function cm.activate(e,tp,eg,ep,ev,re,r,rp) function cm.activate(e,tp,eg,ep,ev,re,r,rp)
RD.SelectAndDoAction(HINTMSG_POSCHANGE,cm.filter,tp,0,LOCATION_MZONE,1,1,nil,function(g) local filter=RD.Filter(cm.filter,e,tp)
RD.SelectAndDoAction(HINTMSG_POSCHANGE,filter,tp,0,LOCATION_MZONE,1,1,nil,function(g)
RD.ChangePosition(g,POS_FACEUP_ATTACK) RD.ChangePosition(g,POS_FACEUP_ATTACK)
end) end)
end end
\ No newline at end of file
...@@ -26,7 +26,7 @@ end ...@@ -26,7 +26,7 @@ end
cm.cost=RD.CostSendHandToGrave(cm.costfilter,1,1) 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 tc=eg:GetFirst() local tc=eg:GetFirst()
if chk==0 then return RD.IsCanChangePosition(tc) and tc:IsCanTurnSet() end if chk==0 then return RD.IsCanChangePosition(tc,e,tp,REASON_EFFECT) and tc:IsCanTurnSet() end
Duel.SetTargetCard(tc) Duel.SetTargetCard(tc)
Duel.SetOperationInfo(0,CATEGORY_POSITION,tc,1,0,0) Duel.SetOperationInfo(0,CATEGORY_POSITION,tc,1,0,0)
end end
......
...@@ -14,8 +14,8 @@ function cm.initial_effect(c) ...@@ -14,8 +14,8 @@ function cm.initial_effect(c)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
--Activate --Activate
function cm.filter(c) function cm.filter(c,e,tp)
return c:IsAttackPos() and RD.IsCanChangePosition(c) return c:IsAttackPos() and RD.IsCanChangePosition(c,e,tp,REASON_EFFECT)
end 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()
...@@ -25,12 +25,13 @@ function cm.condition(e,tp,eg,ep,ev,re,r,rp) ...@@ -25,12 +25,13 @@ function cm.condition(e,tp,eg,ep,ev,re,r,rp)
end end
cm.cost=RD.CostPayLP(1000) cm.cost=RD.CostPayLP(1000)
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,e,tp) end
local g=Duel.GetMatchingGroup(cm.filter,tp,LOCATION_MZONE,0,nil) local g=Duel.GetMatchingGroup(cm.filter,tp,LOCATION_MZONE,0,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
end end
function cm.activate(e,tp,eg,ep,ev,re,r,rp) function cm.activate(e,tp,eg,ep,ev,re,r,rp)
RD.SelectAndDoAction(HINTMSG_POSCHANGE,cm.filter,tp,LOCATION_MZONE,0,1,2,nil,function(g) local filter=RD.Filter(cm.filter,e,tp)
RD.SelectAndDoAction(HINTMSG_POSCHANGE,filter,tp,LOCATION_MZONE,0,1,2,nil,function(g)
if RD.ChangePosition(g,POS_FACEUP_DEFENSE)~=0 if RD.ChangePosition(g,POS_FACEUP_DEFENSE)~=0
and Duel.GetMatchingGroupCount(Card.IsDefensePos,tp,LOCATION_MZONE,0,nil)==3 then and Duel.GetMatchingGroupCount(Card.IsDefensePos,tp,LOCATION_MZONE,0,nil)==3 then
RD.CanSelectAndDoAction(aux.Stringid(m,1),HINTMSG_TODECK,aux.NecroValleyFilter(cm.tdfilter),tp,0,LOCATION_GRAVE,1,5,nil,function(sg) RD.CanSelectAndDoAction(aux.Stringid(m,1),HINTMSG_TODECK,aux.NecroValleyFilter(cm.tdfilter),tp,0,LOCATION_GRAVE,1,5,nil,function(sg)
......
...@@ -14,9 +14,9 @@ function cm.initial_effect(c) ...@@ -14,9 +14,9 @@ function cm.initial_effect(c)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
--Atk Up --Atk Up
function cm.costfilter(c) function cm.costfilter(c,e,tp)
return c:IsPosition(POS_FACEUP_ATTACK) and c:IsLevelAbove(5) and c:IsRace(RACE_FIEND) return c:IsPosition(POS_FACEUP_ATTACK) and c:IsLevelAbove(5) and c:IsRace(RACE_FIEND)
and RD.IsCanChangePosition(c) and RD.IsCanChangePosition(c,e,tp,REASON_COST)
end end
cm.cost=RD.CostChangePosition(cm.costfilter,1,1) cm.cost=RD.CostChangePosition(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)
......
...@@ -12,17 +12,18 @@ function cm.initial_effect(c) ...@@ -12,17 +12,18 @@ function cm.initial_effect(c)
e2:SetCategory(CATEGORY_DESTROY) e2:SetCategory(CATEGORY_DESTROY)
end end
--Position --Position
function cm.posfilter(c) function cm.posfilter(c,e,tp)
return RD.IsCanChangePosition(c) and (not c:IsPosition(POS_FACEUP_ATTACK) or c:IsCanTurnSet()) return RD.IsCanChangePosition(c,e,tp,REASON_EFFECT) and (not c:IsPosition(POS_FACEUP_ATTACK) or c:IsCanTurnSet())
end end
function cm.target1(e,tp,eg,ep,ev,re,r,rp,chk) function cm.target1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.posfilter,tp,0,LOCATION_MZONE,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(cm.posfilter,tp,0,LOCATION_MZONE,1,nil,e,tp) end
local g=Duel.GetMatchingGroup(cm.posfilter,tp,0,LOCATION_MZONE,nil) local g=Duel.GetMatchingGroup(cm.posfilter,tp,0,LOCATION_MZONE,nil,e,tp)
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription()) Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
end end
function cm.operation1(e,tp,eg,ep,ev,re,r,rp) function cm.operation1(e,tp,eg,ep,ev,re,r,rp)
RD.SelectAndDoAction(HINTMSG_POSCHANGE,cm.posfilter,tp,0,LOCATION_MZONE,1,1,nil,function(g) local filter=RD.Filter(cm.posfilter,e,tp)
RD.SelectAndDoAction(HINTMSG_POSCHANGE,filter,tp,0,LOCATION_MZONE,1,1,nil,function(g)
local tc=g:GetFirst() local tc=g:GetFirst()
local pos=POS_FACEUP_ATTACK+POS_FACEDOWN_DEFENSE local pos=POS_FACEUP_ATTACK+POS_FACEDOWN_DEFENSE
if tc:IsPosition(POS_FACEUP_ATTACK) then if tc:IsPosition(POS_FACEUP_ATTACK) then
......
...@@ -23,9 +23,9 @@ end ...@@ -23,9 +23,9 @@ end
function cm.confilter2(c,tp) function cm.confilter2(c,tp)
return c:GetSummonPlayer()==tp return c:GetSummonPlayer()==tp
end end
function cm.filter(c) function cm.filter(c,e,tp)
return c:IsPosition(POS_FACEUP_ATTACK) and c:IsLevelAbove(8) and c:IsAttribute(ATTRIBUTE_LIGHT) return c:IsPosition(POS_FACEUP_ATTACK) and c:IsLevelAbove(8) and c:IsAttribute(ATTRIBUTE_LIGHT)
and RD.IsCanChangePosition(c) and RD.IsCanChangePosition(c,e,tp,REASON_EFFECT)
end end
function cm.exfilter(c) function cm.exfilter(c)
return c:IsType(TYPE_NORMAL) return c:IsType(TYPE_NORMAL)
...@@ -38,18 +38,19 @@ function cm.condition(e,tp,eg,ep,ev,re,r,rp) ...@@ -38,18 +38,19 @@ function cm.condition(e,tp,eg,ep,ev,re,r,rp)
and eg:IsExists(cm.confilter2,1,nil,1-tp) and eg:IsExists(cm.confilter2,1,nil,1-tp)
end end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk) function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_MZONE,0,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_MZONE,0,1,nil,e,tp) end
local g=Duel.GetMatchingGroup(cm.filter,tp,LOCATION_MZONE,0,nil) local g=Duel.GetMatchingGroup(cm.filter,tp,LOCATION_MZONE,0,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
end end
function cm.activate(e,tp,eg,ep,ev,re,r,rp) function cm.activate(e,tp,eg,ep,ev,re,r,rp)
RD.SelectAndDoAction(HINTMSG_POSCHANGE,cm.filter,tp,LOCATION_MZONE,0,1,1,nil,function(g) local filter=RD.Filter(cm.filter,e,tp)
RD.SelectAndDoAction(HINTMSG_POSCHANGE,filter,tp,LOCATION_MZONE,0,1,1,nil,function(g)
if RD.ChangePosition(g,POS_FACEUP_DEFENSE)~=0 then if RD.ChangePosition(g,POS_FACEUP_DEFENSE)~=0 then
local sg=Duel.GetMatchingGroup(cm.exfilter,tp,LOCATION_GRAVE,0,nil) local sg=Duel.GetMatchingGroup(cm.exfilter,tp,LOCATION_GRAVE,0,nil)
local race=RD.GroupBor(sg,Card.GetRace) local race=RD.GroupBor(sg,Card.GetRace)
if race~=0 then if race~=0 then
local filter=RD.Filter(cm.desfilter,race) local desfilter=RD.Filter(cm.desfilter,race)
RD.CanSelectAndDoAction(aux.Stringid(m,1),HINTMSG_DESTROY,filter,tp,0,LOCATION_MZONE,1,1,nil,function(dg) RD.CanSelectAndDoAction(aux.Stringid(m,1),HINTMSG_DESTROY,desfilter,tp,0,LOCATION_MZONE,1,1,nil,function(dg)
Duel.BreakEffect() Duel.BreakEffect()
Duel.Destroy(dg,REASON_EFFECT) Duel.Destroy(dg,REASON_EFFECT)
end) end)
......
...@@ -13,21 +13,23 @@ function cm.initial_effect(c) ...@@ -13,21 +13,23 @@ function cm.initial_effect(c)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
--Position --Position
function cm.filter(c) function cm.filter(c,e,tp)
return RD.IsCanChangePosition(c) return RD.IsCanChangePosition(c,e,tp,REASON_EFFECT)
end end
function cm.posfilter(c) function cm.posfilter(c,e,tp)
return c:IsFaceup() and RD.IsCanChangePosition(c) return c:IsFaceup() and RD.IsCanChangePosition(c,e,tp,REASON_EFFECT)
end end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk) function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,0,LOCATION_MZONE,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,0,LOCATION_MZONE,1,nil,e,tp) end
local g=Duel.GetMatchingGroup(cm.filter,tp,0,LOCATION_MZONE,nil) local g=Duel.GetMatchingGroup(cm.filter,tp,0,LOCATION_MZONE,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
end end
function cm.operation(e,tp,eg,ep,ev,re,r,rp) function cm.operation(e,tp,eg,ep,ev,re,r,rp)
RD.SelectAndDoAction(HINTMSG_POSCHANGE,cm.filter,tp,0,LOCATION_MZONE,1,2,nil,function(g) local filter=RD.Filter(cm.filter,e,tp)
RD.SelectAndDoAction(HINTMSG_POSCHANGE,filter,tp,0,LOCATION_MZONE,1,2,nil,function(g)
if RD.ChangePosition(g)~=0 then if RD.ChangePosition(g)~=0 then
RD.CanSelectAndDoAction(aux.Stringid(m,1),HINTMSG_POSCHANGE,cm.posfilter,tp,LOCATION_MZONE,0,1,1,nil,function(sg) local posfilter=RD.Filter(cm.posfilter,e,tp)
RD.CanSelectAndDoAction(aux.Stringid(m,1),HINTMSG_POSCHANGE,posfilter,tp,LOCATION_MZONE,0,1,1,nil,function(sg)
RD.ChangePosition(sg) RD.ChangePosition(sg)
end) end)
end end
......
...@@ -34,17 +34,18 @@ function cm.splimit(e,c,tp,sumtp,sumpos) ...@@ -34,17 +34,18 @@ function cm.splimit(e,c,tp,sumtp,sumpos)
return c:IsLevelBelow(9) and (sumpos&POS_ATTACK)>0 return c:IsLevelBelow(9) and (sumpos&POS_ATTACK)>0
end end
--Position --Position
function cm.posfilter(c) function cm.posfilter(c,e,tp)
return RD.IsCanChangePosition(c) return RD.IsCanChangePosition(c,e,tp,REASON_EFFECT)
end end
function cm.target2(e,tp,eg,ep,ev,re,r,rp,chk) function cm.target2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.posfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(cm.posfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil,e,tp) end
local g=Duel.GetMatchingGroup(cm.posfilter,tp,LOCATION_MZONE,LOCATION_MZONE,nil) local g=Duel.GetMatchingGroup(cm.posfilter,tp,LOCATION_MZONE,LOCATION_MZONE,nil,e,tp)
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription()) Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
end end
function cm.operation2(e,tp,eg,ep,ev,re,r,rp) function cm.operation2(e,tp,eg,ep,ev,re,r,rp)
RD.SelectAndDoAction(HINTMSG_POSCHANGE,cm.posfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil,function(g) local filter=RD.Filter(cm.posfilter,e,tp)
RD.SelectAndDoAction(HINTMSG_POSCHANGE,filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil,function(g)
RD.ChangePosition(g) RD.ChangePosition(g)
end) end)
end end
\ No newline at end of file
...@@ -18,8 +18,8 @@ end ...@@ -18,8 +18,8 @@ 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.filter(c) function cm.filter(c,e,tp)
return c:IsFaceup() and RD.IsCanChangePosition(c) return c:IsFaceup() and RD.IsCanChangePosition(c,e,tp,REASON_EFFECT)
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 RD.IsCanBeSpecialSummoned(c,e,tp,POS_FACEUP) return c:IsType(TYPE_NORMAL) and c:IsRace(RACE_SEASERPENT) and RD.IsCanBeSpecialSummoned(c,e,tp,POS_FACEUP)
...@@ -29,12 +29,12 @@ function cm.condition(e,tp,eg,ep,ev,re,r,rp) ...@@ -29,12 +29,12 @@ function cm.condition(e,tp,eg,ep,ev,re,r,rp)
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.filter,tp,0,LOCATION_MZONE,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,0,LOCATION_MZONE,1,nil,e,tp) end
local g=Duel.GetMatchingGroup(cm.filter,tp,0,LOCATION_MZONE,nil) local g=Duel.GetMatchingGroup(cm.filter,tp,0,LOCATION_MZONE,nil,e,tp)
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.filter,tp,0,LOCATION_MZONE,nil) local g=Duel.GetMatchingGroup(cm.filter,tp,0,LOCATION_MZONE,nil,e,tp)
if g:GetCount()>0 and RD.ChangePosition(g)~=0 then if g:GetCount()>0 and RD.ChangePosition(g)~=0 then
RD.CanSelectAndSpecialSummon(aux.Stringid(m,1),aux.NecroValleyFilter(cm.spfilter),tp,LOCATION_GRAVE,0,1,1,nil,e,POS_FACEUP,true) RD.CanSelectAndSpecialSummon(aux.Stringid(m,1),aux.NecroValleyFilter(cm.spfilter),tp,LOCATION_GRAVE,0,1,1,nil,e,POS_FACEUP,true)
end end
......
...@@ -18,8 +18,8 @@ function cm.confilter(c,tp,rp) ...@@ -18,8 +18,8 @@ function cm.confilter(c,tp,rp)
return RD.IsPreviousControler(c,tp) and c:IsPreviousLocation(LOCATION_MZONE) return 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.filter(c) function cm.filter(c,e,tp)
return c:IsFaceup() and RD.IsCanChangePosition(c) and c:IsCanTurnSet() return c:IsFaceup() and RD.IsCanChangePosition(c,e,tp,REASON_EFFECT) and c:IsCanTurnSet()
end end
function cm.exfilter(c,tp) function cm.exfilter(c,tp)
return c:IsControler(tp) and RD.IsPreviousControler(c,tp) and c:IsLevel(10) return c:IsControler(tp) and RD.IsPreviousControler(c,tp) and c:IsLevel(10)
...@@ -28,8 +28,8 @@ function cm.condition(e,tp,eg,ep,ev,re,r,rp) ...@@ -28,8 +28,8 @@ function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(cm.confilter,1,nil,tp,rp) and Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)==0 return eg:IsExists(cm.confilter,1,nil,tp,rp) and Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)==0
end end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk) function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,0,LOCATION_MZONE,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,0,LOCATION_MZONE,1,nil,e,tp) end
local g=Duel.GetMatchingGroup(cm.filter,tp,0,LOCATION_MZONE,nil) local g=Duel.GetMatchingGroup(cm.filter,tp,0,LOCATION_MZONE,nil,e,tp)
if eg:IsExists(cm.exfilter,1,nil,tp) then if eg:IsExists(cm.exfilter,1,nil,tp) then
e:SetLabel(1) e:SetLabel(1)
else else
...@@ -38,7 +38,8 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -38,7 +38,8 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
end end
function cm.activate(e,tp,eg,ep,ev,re,r,rp) function cm.activate(e,tp,eg,ep,ev,re,r,rp)
RD.SelectAndDoAction(HINTMSG_SET,cm.filter,tp,0,LOCATION_MZONE,1,1,nil,function(g) local filter=RD.Filter(cm.filter,e,tp)
RD.SelectAndDoAction(HINTMSG_SET,filter,tp,0,LOCATION_MZONE,1,1,nil,function(g)
if RD.ChangePosition(g,POS_FACEDOWN_DEFENSE)~=0 and e:GetLabel()==1 then if RD.ChangePosition(g,POS_FACEDOWN_DEFENSE)~=0 and e:GetLabel()==1 then
RD.CanSelectAndDoAction(aux.Stringid(m,1),HINTMSG_DESTROY,Card.IsFacedown,tp,0,LOCATION_ONFIELD,1,1,nil,function(sg) RD.CanSelectAndDoAction(aux.Stringid(m,1),HINTMSG_DESTROY,Card.IsFacedown,tp,0,LOCATION_ONFIELD,1,1,nil,function(sg)
Duel.Destroy(sg,REASON_EFFECT) Duel.Destroy(sg,REASON_EFFECT)
......
...@@ -17,17 +17,18 @@ function cm.costfilter(c,e,tp) ...@@ -17,17 +17,18 @@ function cm.costfilter(c,e,tp)
return c:IsFaceup() and c:IsRace(RACE_PLANT) and c:IsAbleToGraveAsCost() return c:IsFaceup() and c:IsRace(RACE_PLANT) and c:IsAbleToGraveAsCost()
and Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,c) and Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,c)
end end
function cm.filter(c) function cm.filter(c,e,tp)
return c:IsDefensePos() and RD.IsCanChangePosition(c) return c:IsDefensePos() and RD.IsCanChangePosition(c,e,tp,REASON_EFFECT)
end end
cm.cost=RD.CostSendMZoneToGrave(cm.costfilter,1,1,false) cm.cost=RD.CostSendMZoneToGrave(cm.costfilter,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)
if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil,e,tp) end
local g=Duel.GetMatchingGroup(cm.filter,tp,LOCATION_MZONE,LOCATION_MZONE,nil) local g=Duel.GetMatchingGroup(cm.filter,tp,LOCATION_MZONE,LOCATION_MZONE,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
end end
function cm.activate(e,tp,eg,ep,ev,re,r,rp) function cm.activate(e,tp,eg,ep,ev,re,r,rp)
RD.SelectAndDoAction(HINTMSG_POSCHANGE,cm.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil,function(g) local filter=RD.Filter(cm.filter,e,tp)
RD.SelectAndDoAction(HINTMSG_POSCHANGE,filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil,function(g)
if RD.ChangePosition(g,POS_FACEUP_ATTACK)~=0 then if RD.ChangePosition(g,POS_FACEUP_ATTACK)~=0 then
RD.CanDraw(aux.Stringid(m,1),tp,1,true) RD.CanDraw(aux.Stringid(m,1),tp,1,true)
end end
......
...@@ -29,7 +29,7 @@ end ...@@ -29,7 +29,7 @@ end
cm.cost=RD.CostSendGraveToDeckBottom(cm.costfilter,1,1) cm.cost=RD.CostSendGraveToDeckBottom(cm.costfilter,1,1)
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk) function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
local tc=eg:GetFirst() local tc=eg:GetFirst()
if chk==0 then return RD.IsCanChangePosition(tc) and tc:IsCanTurnSet() end if chk==0 then return RD.IsCanChangePosition(tc,e,tp,REASON_EFFECT) and tc:IsCanTurnSet() end
Duel.SetTargetCard(tc) Duel.SetTargetCard(tc)
Duel.SetOperationInfo(0,CATEGORY_POSITION,tc,1,0,0) Duel.SetOperationInfo(0,CATEGORY_POSITION,tc,1,0,0)
end end
......
...@@ -12,8 +12,8 @@ function cm.initial_effect(c) ...@@ -12,8 +12,8 @@ function cm.initial_effect(c)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
--Activate --Activate
function cm.posfilter(c) function cm.posfilter(c,e,tp)
return c:IsDefensePos() and RD.IsCanChangePosition(c) return c:IsDefensePos() and RD.IsCanChangePosition(c,e,tp,REASON_EFFECT)
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 tc=Duel.GetAttacker() local tc=Duel.GetAttacker()
...@@ -22,7 +22,8 @@ function cm.condition(e,tp,eg,ep,ev,re,r,rp) ...@@ -22,7 +22,8 @@ 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)
if not Duel.NegateAttack() then return end if not Duel.NegateAttack() then return end
RD.SelectAndDoAction(aux.Stringid(m,1),cm.posfilter,tp,LOCATION_MZONE,0,1,1,nil,function(g) local filter=RD.Filter(cm.posfilter,e,tp)
RD.SelectAndDoAction(aux.Stringid(m,1),filter,tp,LOCATION_MZONE,0,1,1,nil,function(g)
local tc=g:GetFirst() local tc=g:GetFirst()
if RD.ChangePosition(tc,POS_FACEUP_ATTACK)~=0 and tc:IsType(TYPE_NORMAL) then if RD.ChangePosition(tc,POS_FACEUP_ATTACK)~=0 and tc:IsType(TYPE_NORMAL) then
RD.AttachAtkDef(e,tc,1000,0,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END) RD.AttachAtkDef(e,tc,1000,0,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
......
...@@ -16,8 +16,8 @@ end ...@@ -16,8 +16,8 @@ end
function cm.exfilter(c) function cm.exfilter(c)
return c:IsFaceup() and c:IsType(TYPE_NORMAL) and c:IsLevelAbove(7) return c:IsFaceup() and c:IsType(TYPE_NORMAL) and c:IsLevelAbove(7)
end end
function cm.posfilter(c) function cm.posfilter(c,e,tp)
return c:IsAttackPos() and RD.IsCanChangePosition(c) return c:IsAttackPos() and RD.IsCanChangePosition(c,e,tp,REASON_EFFECT)
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(Card.IsAbleToDeck,tp,0,LOCATION_GRAVE,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToDeck,tp,0,LOCATION_GRAVE,1,nil) end
...@@ -27,7 +27,8 @@ end ...@@ -27,7 +27,8 @@ 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(HINTMSG_TODECK,aux.NecroValleyFilter(Card.IsAbleToDeck),tp,0,LOCATION_GRAVE,1,1,nil,function(g) RD.SelectAndDoAction(HINTMSG_TODECK,aux.NecroValleyFilter(Card.IsAbleToDeck),tp,0,LOCATION_GRAVE,1,1,nil,function(g)
if RD.SendToDeckAndExists(g) and Duel.IsExistingMatchingCard(cm.exfilter,tp,LOCATION_MZONE,0,1,nil) then if RD.SendToDeckAndExists(g) and Duel.IsExistingMatchingCard(cm.exfilter,tp,LOCATION_MZONE,0,1,nil) then
RD.CanSelectAndDoAction(aux.Stringid(m,1),HINTMSG_POSCHANGE,cm.posfilter,tp,0,LOCATION_MZONE,1,1,nil,function(sg) local filter=RD.Filter(cm.posfilter,e,tp)
RD.CanSelectAndDoAction(aux.Stringid(m,1),HINTMSG_POSCHANGE,filter,tp,0,LOCATION_MZONE,1,1,nil,function(sg)
RD.ChangePosition(sg,POS_FACEUP_DEFENSE) RD.ChangePosition(sg,POS_FACEUP_DEFENSE)
end) end)
end end
......
...@@ -15,8 +15,8 @@ end ...@@ -15,8 +15,8 @@ end
function cm.filter(c) function cm.filter(c)
return c:IsFaceup() and c:IsRace(RACE_GALAXY) and RD.IsCanAttachPierce(c) return c:IsFaceup() and c:IsRace(RACE_GALAXY) and RD.IsCanAttachPierce(c)
end end
function cm.posfilter(c) function cm.posfilter(c,e,tp)
return RD.IsCanChangePosition(c) return RD.IsCanChangePosition(c,e,tp,REASON_EFFECT)
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.IsAbleToEnterBP() return Duel.IsAbleToEnterBP()
...@@ -29,7 +29,8 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -29,7 +29,8 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=g:GetFirst() local tc=g:GetFirst()
RD.AttachPierce(e,tc,aux.Stringid(m,2),RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END) RD.AttachPierce(e,tc,aux.Stringid(m,2),RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
if tc:IsType(TYPE_NORMAL) then if tc:IsType(TYPE_NORMAL) then
RD.CanSelectAndDoAction(aux.Stringid(m,3),HINTMSG_POSCHANGE,cm.posfilter,tp,0,LOCATION_MZONE,1,1,nil,function(sg) local filter=RD.Filter(cm.posfilter,e,tp)
RD.CanSelectAndDoAction(aux.Stringid(m,3),HINTMSG_POSCHANGE,filter,tp,0,LOCATION_MZONE,1,1,nil,function(sg)
RD.ChangePosition(sg) RD.ChangePosition(sg)
end) end)
end end
......
...@@ -20,28 +20,30 @@ end ...@@ -20,28 +20,30 @@ end
function cm.confilter(c,tp) function cm.confilter(c,tp)
return c:GetSummonPlayer()==tp return c:GetSummonPlayer()==tp
end end
function cm.filter(c) function cm.filter(c,e,tp)
return c:IsPosition(POS_FACEUP_ATTACK) and c:IsRace(RACE_INSECT) and RD.IsCanChangePosition(c) return c:IsPosition(POS_FACEUP_ATTACK) and c:IsRace(RACE_INSECT) and RD.IsCanChangePosition(c,e,tp,REASON_EFFECT)
end end
function cm.exfilter(c) function cm.exfilter(c)
return c:IsPosition(POS_FACEUP_DEFENSE) return c:IsPosition(POS_FACEUP_DEFENSE)
end end
function cm.posfilter(c) function cm.posfilter(c,e,tp)
return c:IsAttackPos() and RD.IsCanChangePosition(c) return c:IsAttackPos() and RD.IsCanChangePosition(c,e,tp,REASON_EFFECT)
end end
function cm.condition(e,tp,eg,ep,ev,re,r,rp) function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(cm.confilter,1,nil,1-tp) return eg:IsExists(cm.confilter,1,nil,1-tp)
end end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk) function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.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,e,tp) end
local g=Duel.GetMatchingGroup(cm.filter,tp,LOCATION_MZONE,0,nil) local g=Duel.GetMatchingGroup(cm.filter,tp,LOCATION_MZONE,0,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
end end
function cm.activate(e,tp,eg,ep,ev,re,r,rp) function cm.activate(e,tp,eg,ep,ev,re,r,rp)
RD.SelectAndDoAction(HINTMSG_POSCHANGE,cm.filter,tp,LOCATION_MZONE,0,1,3,nil,function(g) local filter=RD.Filter(cm.filter,e,tp)
RD.SelectAndDoAction(HINTMSG_POSCHANGE,filter,tp,LOCATION_MZONE,0,1,3,nil,function(g)
if RD.ChangePosition(g,POS_FACEUP_DEFENCE)~=0 if RD.ChangePosition(g,POS_FACEUP_DEFENCE)~=0
and Duel.IsExistingMatchingCard(cm.exfilter,tp,LOCATION_MZONE,0,2,nil) then and Duel.IsExistingMatchingCard(cm.exfilter,tp,LOCATION_MZONE,0,2,nil) then
RD.CanSelectAndDoAction(aux.Stringid(m,1),HINTMSG_POSCHANGE,cm.posfilter,tp,0,LOCATION_MZONE,1,1,nil,function(sg) local posfilter=RD.Filter(cm.posfilter,e,tp)
RD.CanSelectAndDoAction(aux.Stringid(m,1),HINTMSG_POSCHANGE,posfilter,tp,0,LOCATION_MZONE,1,1,nil,function(sg)
Duel.BreakEffect() Duel.BreakEffect()
RD.ChangePosition(sg,POS_FACEUP_DEFENCE) RD.ChangePosition(sg,POS_FACEUP_DEFENCE)
end) end)
......
...@@ -16,20 +16,21 @@ end ...@@ -16,20 +16,21 @@ end
function cm.confilter(c,tp) function cm.confilter(c,tp)
return c:GetSummonPlayer()==tp and c:IsLevelAbove(7) return c:GetSummonPlayer()==tp and c:IsLevelAbove(7)
end end
function cm.filter(c) function cm.filter(c,e,tp)
return c:IsFaceup() and c:IsType(TYPE_EFFECT) and c:IsLevelBelow(8) return c:IsFaceup() and c:IsType(TYPE_EFFECT) and c:IsLevelBelow(8)
and RD.IsCanChangePosition(c) and c:IsCanTurnSet() and RD.IsCanChangePosition(c,e,tp,REASON_EFFECT) and c:IsCanTurnSet()
end end
function cm.condition(e,tp,eg,ep,ev,re,r,rp) function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(cm.confilter,1,nil,1-tp) return eg:IsExists(cm.confilter,1,nil,1-tp)
end end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk) function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.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,e,tp) end
local g=Duel.GetMatchingGroup(cm.filter,tp,0,LOCATION_MZONE,nil) local g=Duel.GetMatchingGroup(cm.filter,tp,0,LOCATION_MZONE,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
end end
function cm.activate(e,tp,eg,ep,ev,re,r,rp) function cm.activate(e,tp,eg,ep,ev,re,r,rp)
RD.SelectAndDoAction(HINTMSG_SET,cm.filter,tp,0,LOCATION_MZONE,1,1,nil,function(g) local filter=RD.Filter(cm.filter,e,tp)
RD.SelectAndDoAction(HINTMSG_SET,filter,tp,0,LOCATION_MZONE,1,1,nil,function(g)
RD.ChangePosition(g,POS_FACEDOWN_DEFENSE) RD.ChangePosition(g,POS_FACEDOWN_DEFENSE)
end) end)
end end
\ No newline at end of file
...@@ -17,20 +17,21 @@ end ...@@ -17,20 +17,21 @@ 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.filter(c) function cm.filter(c,e,tp)
return c:IsPosition(POS_FACEDOWN_DEFENSE) and RD.IsCanChangePosition(c) return c:IsPosition(POS_FACEDOWN_DEFENSE) and RD.IsCanChangePosition(c,e,tp,REASON_EFFECT)
end end
function cm.downfilter(c) function cm.downfilter(c)
return c:IsFaceup() and RD.IsCanChangeDef(c) return c:IsFaceup() and RD.IsCanChangeDef(c)
end end
cm.cost=RD.CostSendGraveToDeck(cm.costfilter,3,3) cm.cost=RD.CostSendGraveToDeck(cm.costfilter,3,3)
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,e,tp) end
local g=Duel.GetMatchingGroup(cm.filter,tp,0,LOCATION_MZONE,nil) local g=Duel.GetMatchingGroup(cm.filter,tp,0,LOCATION_MZONE,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
end end
function cm.operation(e,tp,eg,ep,ev,re,r,rp) function cm.operation(e,tp,eg,ep,ev,re,r,rp)
RD.SelectAndDoAction(HINTMSG_POSCHANGE,cm.filter,tp,0,LOCATION_MZONE,1,1,nil,function(g) local filter=RD.Filter(cm.filter,e,tp)
RD.SelectAndDoAction(HINTMSG_POSCHANGE,filter,tp,0,LOCATION_MZONE,1,1,nil,function(g)
if RD.ChangePosition(g,POS_FACEUP_DEFENSE)~=0 then if RD.ChangePosition(g,POS_FACEUP_DEFENSE)~=0 then
local sg=Duel.GetMatchingGroup(cm.downfilter,tp,0,LOCATION_MZONE,nil) local sg=Duel.GetMatchingGroup(cm.downfilter,tp,0,LOCATION_MZONE,nil)
if sg:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(m,1)) then if sg:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(m,1)) then
......
...@@ -21,7 +21,7 @@ function cm.condition(e,tp,eg,ep,ev,re,r,rp) ...@@ -21,7 +21,7 @@ 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)
local tc=eg:GetFirst() local tc=eg:GetFirst()
if chk==0 then return RD.IsCanChangePosition(tc) end if chk==0 then return RD.IsCanChangePosition(tc,e,tp,REASON_EFFECT) end
Duel.SetTargetCard(tc) Duel.SetTargetCard(tc)
Duel.SetOperationInfo(0,CATEGORY_POSITION,tc,1,0,0) Duel.SetOperationInfo(0,CATEGORY_POSITION,tc,1,0,0)
end end
......
...@@ -44,7 +44,7 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -44,7 +44,7 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.IsExistingMatchingCard(cm.exfilter,tp,LOCATION_GRAVE,0,1,nil) if Duel.IsExistingMatchingCard(cm.exfilter,tp,LOCATION_GRAVE,0,1,nil)
and tc:IsRelateToEffect(e) and tc:IsRelateToEffect(e)
and not tc:IsPosition(POS_FACEUP_DEFENSE) and not tc:IsPosition(POS_FACEUP_DEFENSE)
and RD.IsCanChangePosition(tc) and RD.IsCanChangePosition(tc,e,tp,REASON_EFFECT)
and Duel.SelectYesNo(tp,aux.Stringid(m,2)) then and Duel.SelectYesNo(tp,aux.Stringid(m,2)) then
RD.ChangePosition(tc,POS_FACEUP_DEFENSE) RD.ChangePosition(tc,POS_FACEUP_DEFENSE)
end end
......
...@@ -13,16 +13,16 @@ function cm.initial_effect(c) ...@@ -13,16 +13,16 @@ function cm.initial_effect(c)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
--Activate --Activate
function cm.costfilter(c) function cm.costfilter(c,e,tp)
return c:IsPosition(POS_FACEUP_ATTACK) and c:IsType(TYPE_NORMAL) and c:IsRace(RACE_ZOMBIE) return c:IsPosition(POS_FACEUP_ATTACK) and c:IsType(TYPE_NORMAL) and c:IsRace(RACE_ZOMBIE)
and RD.IsCanChangePosition(c) and RD.IsCanChangePosition(c,e,tp,REASON_COST)
end end
function cm.filter(c) function cm.filter(c)
return c:IsPosition(POS_FACEUP_DEFENSE) and c:IsRace(RACE_ZOMBIE) return c:IsPosition(POS_FACEUP_DEFENSE) and c:IsRace(RACE_ZOMBIE)
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)
if chk==0 then return Duel.IsExistingMatchingCard(cm.costfilter,tp,LOCATION_MZONE,0,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(cm.costfilter,tp,LOCATION_MZONE,0,1,nil,e,tp) end
local g=Duel.GetMatchingGroup(cm.costfilter,tp,LOCATION_MZONE,0,nil) local g=Duel.GetMatchingGroup(cm.costfilter,tp,LOCATION_MZONE,0,nil,e,tp)
RD.ChangePosition(g,POS_FACEUP_DEFENSE) RD.ChangePosition(g,POS_FACEUP_DEFENSE)
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)
......
...@@ -17,8 +17,8 @@ function cm.initial_effect(c) ...@@ -17,8 +17,8 @@ function cm.initial_effect(c)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
--Position --Position
function cm.filter(c) function cm.filter(c,e,tp)
return c:IsAttackPos() and RD.IsCanChangePosition(c) return c:IsAttackPos() and RD.IsCanChangePosition(c,e,tp,REASON_EFFECT)
end end
function cm.thfilter(c) function cm.thfilter(c)
return c:IsCode(list[1],list[2]) and c:IsAbleToHand() return c:IsCode(list[1],list[2]) and c:IsAbleToHand()
...@@ -29,12 +29,13 @@ function cm.condition(e,tp,eg,ep,ev,re,r,rp) ...@@ -29,12 +29,13 @@ function cm.condition(e,tp,eg,ep,ev,re,r,rp)
end end
cm.cost=RD.CostPayLP(700) cm.cost=RD.CostPayLP(700)
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,e,tp) end
local g=Duel.GetMatchingGroup(cm.filter,tp,0,LOCATION_MZONE,nil) local g=Duel.GetMatchingGroup(cm.filter,tp,0,LOCATION_MZONE,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
end end
function cm.operation(e,tp,eg,ep,ev,re,r,rp) function cm.operation(e,tp,eg,ep,ev,re,r,rp)
RD.SelectAndDoAction(HINTMSG_POSCHANGE,cm.filter,tp,0,LOCATION_MZONE,1,1,nil,function(g) local filter=RD.Filter(cm.filter,e,tp)
RD.SelectAndDoAction(HINTMSG_POSCHANGE,filter,tp,0,LOCATION_MZONE,1,1,nil,function(g)
if RD.ChangePosition(g,POS_FACEUP_DEFENCE)~=0 then if RD.ChangePosition(g,POS_FACEUP_DEFENCE)~=0 then
RD.CanSelectAndDoAction(aux.Stringid(m,1),HINTMSG_ATOHAND,aux.NecroValleyFilter(cm.thfilter),tp,LOCATION_GRAVE,0,1,1,nil,function(g) RD.CanSelectAndDoAction(aux.Stringid(m,1),HINTMSG_ATOHAND,aux.NecroValleyFilter(cm.thfilter),tp,LOCATION_GRAVE,0,1,1,nil,function(g)
Duel.BreakEffect() Duel.BreakEffect()
......
...@@ -17,8 +17,8 @@ end ...@@ -17,8 +17,8 @@ end
function cm.exfilter(c) function cm.exfilter(c)
return c:GetSequence()<5 return c:GetSequence()<5
end end
function cm.posfilter(c) function cm.posfilter(c,e,tp)
return c:IsFaceup() and c:IsType(TYPE_NORMAL) and RD.IsCanChangePosition(c) and c:IsCanTurnSet() return c:IsFaceup() and c:IsType(TYPE_NORMAL) and RD.IsCanChangePosition(c,e,tp,REASON_EFFECT) and c:IsCanTurnSet()
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.IsSummonTurn(e:GetHandler()) return RD.IsSummonTurn(e:GetHandler())
...@@ -30,7 +30,8 @@ end ...@@ -30,7 +30,8 @@ end
function cm.operation(e,tp,eg,ep,ev,re,r,rp) function cm.operation(e,tp,eg,ep,ev,re,r,rp)
if RD.SendDeckTopToGraveAndExists(tp,2) if RD.SendDeckTopToGraveAndExists(tp,2)
and Duel.IsExistingMatchingCard(cm.exfilter,tp,0,LOCATION_SZONE,1,nil) then and Duel.IsExistingMatchingCard(cm.exfilter,tp,0,LOCATION_SZONE,1,nil) then
RD.CanSelectAndDoAction(aux.Stringid(m,1),HINTMSG_POSCHANGE,cm.posfilter,tp,0,LOCATION_MZONE,1,1,nil,function(g) local filter=RD.Filter(cm.posfilter,e,tp)
RD.CanSelectAndDoAction(aux.Stringid(m,1),HINTMSG_POSCHANGE,filter,tp,0,LOCATION_MZONE,1,1,nil,function(g)
RD.ChangePosition(g,POS_FACEDOWN_DEFENSE) RD.ChangePosition(g,POS_FACEDOWN_DEFENSE)
end) end)
end end
......
...@@ -17,19 +17,20 @@ end ...@@ -17,19 +17,20 @@ end
function cm.confilter(c,tp) function cm.confilter(c,tp)
return c:GetSummonPlayer()==tp and c:IsFaceup() and c:IsSummonLocation(LOCATION_GRAVE) return c:GetSummonPlayer()==tp and c:IsFaceup() and c:IsSummonLocation(LOCATION_GRAVE)
end end
function cm.filter(c) function cm.filter(c,e,tp)
return c:IsFaceup() and c:IsLevelBelow(8) and RD.IsCanChangePosition(c) and c:IsCanTurnSet() return c:IsFaceup() and c:IsLevelBelow(8) and RD.IsCanChangePosition(c,e,tp,REASON_EFFECT) and c:IsCanTurnSet()
end end
function cm.condition(e,tp,eg,ep,ev,re,r,rp) function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(cm.confilter,1,nil,1-tp) return eg:IsExists(cm.confilter,1,nil,1-tp)
end end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk) function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.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,e,tp) end
local g=Duel.GetMatchingGroup(cm.filter,tp,0,LOCATION_MZONE,nil) local g=Duel.GetMatchingGroup(cm.filter,tp,0,LOCATION_MZONE,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
end end
function cm.activate(e,tp,eg,ep,ev,re,r,rp) function cm.activate(e,tp,eg,ep,ev,re,r,rp)
RD.SelectAndDoAction(HINTMSG_SET,cm.filter,tp,0,LOCATION_MZONE,1,2,nil,function(g) local filter=RD.Filter(cm.filter,e,tp)
RD.SelectAndDoAction(HINTMSG_SET,filter,tp,0,LOCATION_MZONE,1,2,nil,function(g)
RD.ChangePosition(g,POS_FACEDOWN_DEFENSE) RD.ChangePosition(g,POS_FACEDOWN_DEFENSE)
end) end)
end end
\ No newline at end of file
...@@ -20,8 +20,8 @@ end ...@@ -20,8 +20,8 @@ end
function cm.confilter(c,tp) function cm.confilter(c,tp)
return c:GetSummonPlayer()==tp and c:IsFaceup() return c:GetSummonPlayer()==tp and c:IsFaceup()
end end
function cm.posfilter(c) function cm.posfilter(c,e,tp)
return c:IsAttackPos() and RD.IsCanChangePosition(c) return c:IsAttackPos() and RD.IsCanChangePosition(c,e,tp,REASON_EFFECT)
end end
function cm.condition(e,tp,eg,ep,ev,re,r,rp) function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(cm.confilter,1,nil,1-tp) return eg:IsExists(cm.confilter,1,nil,1-tp)
...@@ -36,7 +36,8 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -36,7 +36,8 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp)
RD.SelectAndDoAction(HINTMSG_TOGRAVE,Card.IsAbleToGrave,p,LOCATION_HAND,0,1,1,nil,function(g) RD.SelectAndDoAction(HINTMSG_TOGRAVE,Card.IsAbleToGrave,p,LOCATION_HAND,0,1,1,nil,function(g)
Duel.BreakEffect() Duel.BreakEffect()
if Duel.SendtoGrave(g,REASON_EFFECT)~=0 then if Duel.SendtoGrave(g,REASON_EFFECT)~=0 then
RD.CanSelectAndDoAction(aux.Stringid(m,1),HINTMSG_POSCHANGE,cm.posfilter,tp,LOCATION_MZONE,0,1,2,nil,function(sg) local filter=RD.Filter(cm.posfilter,e,tp)
RD.CanSelectAndDoAction(aux.Stringid(m,1),HINTMSG_POSCHANGE,filter,tp,LOCATION_MZONE,0,1,2,nil,function(sg)
RD.ChangePosition(sg,POS_FACEUP_DEFENSE) RD.ChangePosition(sg,POS_FACEUP_DEFENSE)
end) end)
end end
......
...@@ -20,8 +20,8 @@ end ...@@ -20,8 +20,8 @@ end
function cm.confilter(c,tp) function cm.confilter(c,tp)
return c:GetSummonPlayer()==tp return c:GetSummonPlayer()==tp
end end
function cm.filter(c) function cm.filter(c,e,tp)
return c:IsPosition(POS_FACEUP_ATTACK) and c:IsType(TYPE_NORMAL) and c:IsRace(RACE_GALAXY) and RD.IsCanChangePosition(c) return c:IsPosition(POS_FACEUP_ATTACK) and c:IsType(TYPE_NORMAL) and c:IsRace(RACE_GALAXY) and RD.IsCanChangePosition(c,e,tp,REASON_EFFECT)
end end
function cm.deffilter(c) function cm.deffilter(c)
return c:IsFaceup() and c:IsRace(RACE_GALAXY) return c:IsFaceup() and c:IsRace(RACE_GALAXY)
...@@ -30,12 +30,13 @@ function cm.condition(e,tp,eg,ep,ev,re,r,rp) ...@@ -30,12 +30,13 @@ function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(cm.confilter,1,nil,1-tp) return eg:IsExists(cm.confilter,1,nil,1-tp)
end end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk) function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.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,e,tp) end
local g=Duel.GetMatchingGroup(cm.filter,tp,LOCATION_MZONE,0,nil) local g=Duel.GetMatchingGroup(cm.filter,tp,LOCATION_MZONE,0,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
end end
function cm.activate(e,tp,eg,ep,ev,re,r,rp) function cm.activate(e,tp,eg,ep,ev,re,r,rp)
RD.SelectAndDoAction(HINTMSG_POSCHANGE,cm.filter,tp,LOCATION_MZONE,0,1,3,nil,function(g) local filter=RD.Filter(cm.filter,e,tp)
RD.SelectAndDoAction(HINTMSG_POSCHANGE,filter,tp,LOCATION_MZONE,0,1,3,nil,function(g)
if RD.ChangePosition(g,POS_FACEUP_DEFENCE)~=0 then if RD.ChangePosition(g,POS_FACEUP_DEFENCE)~=0 then
local def=Duel.GetMatchingGroupCount(cm.deffilter,tp,LOCATION_MZONE,0,nil)*500 local def=Duel.GetMatchingGroupCount(cm.deffilter,tp,LOCATION_MZONE,0,nil)*500
local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_MZONE,0,nil) local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_MZONE,0,nil)
......
...@@ -18,20 +18,21 @@ end ...@@ -18,20 +18,21 @@ end
function cm.confilter(c) function cm.confilter(c)
return c:IsFaceup() and c:IsRace(RACE_MACHINE) return c:IsFaceup() and c:IsRace(RACE_MACHINE)
end end
function cm.posfilter(c) function cm.posfilter(c,e,tp)
return c:IsFacedown() and RD.IsCanChangePosition(c) return c:IsFacedown() and RD.IsCanChangePosition(c,e,tp,REASON_EFFECT)
end end
function cm.condition(e,tp,eg,ep,ev,re,r,rp) function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetMatchingGroupCount(cm.confilter,tp,LOCATION_MZONE,0,nil)==3 return Duel.GetMatchingGroupCount(cm.confilter,tp,LOCATION_MZONE,0,nil)==3
end end
cm.cost=RD.CostSendSelfToGrave() cm.cost=RD.CostSendSelfToGrave()
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk) function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.posfilter,tp,0,LOCATION_MZONE,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(cm.posfilter,tp,0,LOCATION_MZONE,1,nil,e,tp) end
local g=Duel.GetMatchingGroup(cm.posfilter,tp,0,LOCATION_MZONE,nil) local g=Duel.GetMatchingGroup(cm.posfilter,tp,0,LOCATION_MZONE,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
end end
function cm.operation(e,tp,eg,ep,ev,re,r,rp) function cm.operation(e,tp,eg,ep,ev,re,r,rp)
RD.SelectAndDoAction(HINTMSG_POSCHANGE,cm.posfilter,tp,0,LOCATION_MZONE,1,1,nil,function(g) local filter=RD.Filter(cm.posfilter,e,tp)
RD.SelectAndDoAction(HINTMSG_POSCHANGE,filter,tp,0,LOCATION_MZONE,1,1,nil,function(g)
RD.ChangePosition(g,POS_FACEUP_ATTACK) RD.ChangePosition(g,POS_FACEUP_ATTACK)
end) end)
end end
\ No newline at end of file
...@@ -17,17 +17,18 @@ end ...@@ -17,17 +17,18 @@ end
function cm.costfilter(c) function cm.costfilter(c)
return c:IsRace(RACE_MACHINE) and c:IsAbleToGraveAsCost() return c:IsRace(RACE_MACHINE) and c:IsAbleToGraveAsCost()
end end
function cm.posfilter(c) function cm.posfilter(c,e,tp)
return c:IsPosition(POS_FACEUP_ATTACK) and c:IsLevelBelow(6) and RD.IsCanChangePosition(c) and c:IsCanTurnSet() return c:IsPosition(POS_FACEUP_ATTACK) and c:IsLevelBelow(6) and RD.IsCanChangePosition(c,e,tp,REASON_EFFECT) and c:IsCanTurnSet()
end end
cm.cost=RD.CostSendHandToGrave(cm.costfilter,1,1) cm.cost=RD.CostSendHandToGrave(cm.costfilter,1,1)
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk) function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.posfilter,tp,0,LOCATION_MZONE,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(cm.posfilter,tp,0,LOCATION_MZONE,1,nil,e,tp) end
local g=Duel.GetMatchingGroup(cm.posfilter,tp,0,LOCATION_MZONE,nil) local g=Duel.GetMatchingGroup(cm.posfilter,tp,0,LOCATION_MZONE,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
end end
function cm.operation(e,tp,eg,ep,ev,re,r,rp) function cm.operation(e,tp,eg,ep,ev,re,r,rp)
RD.SelectAndDoAction(HINTMSG_SET,cm.posfilter,tp,0,LOCATION_MZONE,1,1,nil,function(g) local filter=RD.Filter(cm.posfilter,e,tp)
RD.SelectAndDoAction(HINTMSG_SET,filter,tp,0,LOCATION_MZONE,1,1,nil,function(g)
RD.ChangePosition(g,POS_FACEDOWN_DEFENSE) RD.ChangePosition(g,POS_FACEDOWN_DEFENSE)
end) end)
end end
\ No newline at end of file
...@@ -15,8 +15,8 @@ function cm.initial_effect(c) ...@@ -15,8 +15,8 @@ function cm.initial_effect(c)
end end
--Position --Position
cm.indval=RD.ValueEffectIndesType(0,TYPE_TRAP) cm.indval=RD.ValueEffectIndesType(0,TYPE_TRAP)
function cm.posfilter(c) function cm.posfilter(c,e,tp)
return c:IsFaceup() and RD.IsCanChangePosition(c) and c:IsCanTurnSet() return c:IsFaceup() and RD.IsCanChangePosition(c,e,tp,REASON_EFFECT) and c:IsCanTurnSet()
end end
cm.cost=RD.CostSendHandToGrave(Card.IsAbleToGraveAsCost,1,1,nil,nil,function(g) cm.cost=RD.CostSendHandToGrave(Card.IsAbleToGraveAsCost,1,1,nil,nil,function(g)
if g:IsExists(Card.IsType,1,nil,TYPE_MONSTER) then if g:IsExists(Card.IsType,1,nil,TYPE_MONSTER) then
...@@ -26,12 +26,13 @@ cm.cost=RD.CostSendHandToGrave(Card.IsAbleToGraveAsCost,1,1,nil,nil,function(g) ...@@ -26,12 +26,13 @@ cm.cost=RD.CostSendHandToGrave(Card.IsAbleToGraveAsCost,1,1,nil,nil,function(g)
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.posfilter,tp,0,LOCATION_MZONE,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(cm.posfilter,tp,0,LOCATION_MZONE,1,nil,e,tp) end
local g=Duel.GetMatchingGroup(cm.posfilter,tp,0,LOCATION_MZONE,nil) local g=Duel.GetMatchingGroup(cm.posfilter,tp,0,LOCATION_MZONE,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
end end
function cm.operation(e,tp,eg,ep,ev,re,r,rp) function cm.operation(e,tp,eg,ep,ev,re,r,rp)
RD.SelectAndDoAction(HINTMSG_SET,cm.posfilter,tp,0,LOCATION_MZONE,1,1,nil,function(g) local filter=RD.Filter(cm.posfilter,e,tp)
RD.SelectAndDoAction(HINTMSG_SET,filter,tp,0,LOCATION_MZONE,1,1,nil,function(g)
if RD.ChangePosition(g,POS_FACEDOWN_DEFENSE)~=0 then if RD.ChangePosition(g,POS_FACEDOWN_DEFENSE)~=0 then
local c=e:GetHandler() local c=e:GetHandler()
if c:IsFaceup() and c:IsRelateToEffect(e) then if c:IsFaceup() and c:IsRelateToEffect(e) then
......
...@@ -18,8 +18,8 @@ end ...@@ -18,8 +18,8 @@ end
function cm.exfilter(c) function cm.exfilter(c)
return c:IsFaceup() and c:IsLevel(8) return c:IsFaceup() and c:IsLevel(8)
end end
function cm.posfilter(c) function cm.posfilter(c,e,tp)
return c:IsFaceup() and c:IsRace(RACE_GALAXY) and RD.IsCanChangePosition(c) return c:IsFaceup() and c:IsRace(RACE_GALAXY) and RD.IsCanChangePosition(c,e,tp,REASON_EFFECT)
end end
cm.cost=RD.CostChangeSelfPosition(POS_FACEUP_ATTACK,POS_FACEUP_DEFENSE) cm.cost=RD.CostChangeSelfPosition(POS_FACEUP_ATTACK,POS_FACEUP_DEFENSE)
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,7 +28,8 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -28,7 +28,8 @@ 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)
if RD.Damage()~=0 and Duel.IsExistingMatchingCard(cm.exfilter,tp,LOCATION_MZONE,0,1,nil) then if RD.Damage()~=0 and Duel.IsExistingMatchingCard(cm.exfilter,tp,LOCATION_MZONE,0,1,nil) then
RD.CanSelectAndDoAction(aux.Stringid(m,1),HINTMSG_POSCHANGE,cm.posfilter,tp,LOCATION_MZONE,0,1,1,nil,function(g) local filter=RD.Filter(cm.posfilter,e,tp)
RD.CanSelectAndDoAction(aux.Stringid(m,1),HINTMSG_POSCHANGE,filter,tp,LOCATION_MZONE,0,1,1,nil,function(g)
RD.ChangePosition(g) RD.ChangePosition(g)
end) end)
end end
......
...@@ -23,8 +23,8 @@ end ...@@ -23,8 +23,8 @@ end
function cm.confilter2(c,tp) function cm.confilter2(c,tp)
return c:GetSummonPlayer()==tp and c:IsFaceup() return c:GetSummonPlayer()==tp and c:IsFaceup()
end end
function cm.filter(c) function cm.filter(c,e,tp)
return c:IsFaceup() and c:IsLevelBelow(8) and RD.IsCanChangePosition(c) and c:IsCanTurnSet() return c:IsFaceup() and c:IsLevelBelow(8) and RD.IsCanChangePosition(c,e,tp,REASON_EFFECT) and c:IsCanTurnSet()
end end
function cm.exfilter(c) function cm.exfilter(c)
return c:IsFaceup() and c:IsLevel(8) and c:IsRace(RACE_GALAXY) return c:IsFaceup() and c:IsLevel(8) and c:IsRace(RACE_GALAXY)
...@@ -37,12 +37,13 @@ function cm.condition(e,tp,eg,ep,ev,re,r,rp) ...@@ -37,12 +37,13 @@ function cm.condition(e,tp,eg,ep,ev,re,r,rp)
and eg:IsExists(cm.confilter2,1,nil,1-tp) and eg:IsExists(cm.confilter2,1,nil,1-tp)
end end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk) function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,0,LOCATION_MZONE,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,0,LOCATION_MZONE,1,nil,e,tp) end
local g=Duel.GetMatchingGroup(cm.filter,tp,0,LOCATION_MZONE,nil) local g=Duel.GetMatchingGroup(cm.filter,tp,0,LOCATION_MZONE,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
end end
function cm.activate(e,tp,eg,ep,ev,re,r,rp) function cm.activate(e,tp,eg,ep,ev,re,r,rp)
RD.SelectAndDoAction(HINTMSG_SET,cm.filter,tp,0,LOCATION_MZONE,1,1,nil,function(g) local filter=RD.Filter(cm.filter,e,tp)
RD.SelectAndDoAction(HINTMSG_SET,filter,tp,0,LOCATION_MZONE,1,1,nil,function(g)
if RD.ChangePosition(g,POS_FACEDOWN_DEFENSE)~=0 if RD.ChangePosition(g,POS_FACEDOWN_DEFENSE)~=0
and Duel.IsExistingMatchingCard(cm.exfilter,tp,LOCATION_MZONE,0,1,nil) then and Duel.IsExistingMatchingCard(cm.exfilter,tp,LOCATION_MZONE,0,1,nil) then
RD.CanSelectAndDoAction(aux.Stringid(m,1),HINTMSG_RTOHAND,cm.thfilter,tp,0,LOCATION_MZONE,1,1,nil,function(sg) RD.CanSelectAndDoAction(aux.Stringid(m,1),HINTMSG_RTOHAND,cm.thfilter,tp,0,LOCATION_MZONE,1,1,nil,function(sg)
......
...@@ -18,20 +18,21 @@ end ...@@ -18,20 +18,21 @@ end
function cm.costfilter(c) function cm.costfilter(c)
return c:IsFaceup() and c:IsAttribute(ATTRIBUTE_DARK) and c:IsRace(RACE_FAIRY) and c:IsAbleToGraveAsCost() return c:IsFaceup() and c:IsAttribute(ATTRIBUTE_DARK) and c:IsRace(RACE_FAIRY) and c:IsAbleToGraveAsCost()
end end
function cm.filter(c) function cm.filter(c,e,tp)
return c:IsFacedown() and RD.IsCanChangePosition(c) return c:IsFacedown() and RD.IsCanChangePosition(c,e,tp,REASON_EFFECT)
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,1) return RD.IsLPBelowOpponent(tp,1)
end end
cm.cost=RD.CostSendMZoneToGrave(cm.costfilter,1,1,true) cm.cost=RD.CostSendMZoneToGrave(cm.costfilter,1,1,true)
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,e,tp) end
local g=Duel.GetMatchingGroup(cm.filter,tp,0,LOCATION_MZONE,nil) local g=Duel.GetMatchingGroup(cm.filter,tp,0,LOCATION_MZONE,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
end end
function cm.operation(e,tp,eg,ep,ev,re,r,rp) function cm.operation(e,tp,eg,ep,ev,re,r,rp)
RD.SelectAndDoAction(HINTMSG_POSCHANGE,cm.filter,tp,0,LOCATION_MZONE,1,1,nil,function(g) local filter=RD.Filter(cm.filter,e,tp)
RD.SelectAndDoAction(HINTMSG_POSCHANGE,filter,tp,0,LOCATION_MZONE,1,1,nil,function(g)
if RD.ChangePosition(g,POS_FACEUP_DEFENSE)~=0 then if RD.ChangePosition(g,POS_FACEUP_DEFENSE)~=0 then
local atk=g:GetFirst():GetBaseAttack() local atk=g:GetFirst():GetBaseAttack()
if atk~=0 then if atk~=0 then
......
...@@ -18,8 +18,8 @@ end ...@@ -18,8 +18,8 @@ end
function cm.confilter(c) function cm.confilter(c)
return c:IsFaceup() and c:IsLevelAbove(5) and c:IsAttribute(ATTRIBUTE_DARK) return c:IsFaceup() and c:IsLevelAbove(5) and c:IsAttribute(ATTRIBUTE_DARK)
end end
function cm.posfilter(c) function cm.posfilter(c,e,tp)
return c:IsFaceup() and c:IsLevelBelow(8) and RD.IsCanChangePosition(c) return c:IsFaceup() and c:IsLevelBelow(8) and RD.IsCanChangePosition(c,e,tp,REASON_EFFECT)
and (not c:IsPosition(POS_FACEUP_ATTACK) or c:IsCanTurnSet()) and (not c:IsPosition(POS_FACEUP_ATTACK) or c:IsCanTurnSet())
end end
function cm.condition(e,tp,eg,ep,ev,re,r,rp) function cm.condition(e,tp,eg,ep,ev,re,r,rp)
...@@ -27,12 +27,13 @@ function cm.condition(e,tp,eg,ep,ev,re,r,rp) ...@@ -27,12 +27,13 @@ function cm.condition(e,tp,eg,ep,ev,re,r,rp)
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)
if chk==0 then return Duel.IsExistingMatchingCard(cm.posfilter,tp,0,LOCATION_MZONE,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(cm.posfilter,tp,0,LOCATION_MZONE,1,nil,e,tp) end
local g=Duel.GetMatchingGroup(cm.posfilter,tp,0,LOCATION_MZONE,nil) local g=Duel.GetMatchingGroup(cm.posfilter,tp,0,LOCATION_MZONE,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
end end
function cm.operation(e,tp,eg,ep,ev,re,r,rp) function cm.operation(e,tp,eg,ep,ev,re,r,rp)
RD.SelectAndDoAction(HINTMSG_POSCHANGE,cm.posfilter,tp,0,LOCATION_MZONE,1,1,nil,function(g) local filter=RD.Filter(cm.posfilter,e,tp)
RD.SelectAndDoAction(HINTMSG_POSCHANGE,filter,tp,0,LOCATION_MZONE,1,1,nil,function(g)
local tc=g:GetFirst() local tc=g:GetFirst()
local pos=POS_FACEUP_ATTACK+POS_FACEDOWN_DEFENSE local pos=POS_FACEUP_ATTACK+POS_FACEDOWN_DEFENSE
if tc:IsPosition(POS_FACEUP_ATTACK) then if tc:IsPosition(POS_FACEUP_ATTACK) then
......
...@@ -13,24 +13,26 @@ function cm.initial_effect(c) ...@@ -13,24 +13,26 @@ function cm.initial_effect(c)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
--Activate --Activate
function cm.posfilter(c) function cm.posfilter(c,e,tp)
return c:IsPosition(POS_FACEUP_ATTACK) and RD.IsCanChangePosition(c) and c:IsCanTurnSet() return c:IsPosition(POS_FACEUP_ATTACK) and RD.IsCanChangePosition(c,e,tp,REASON_EFFECT) and c:IsCanTurnSet()
end end
function cm.exfilter(c) function cm.exfilter(c,e,tp)
return c:IsFacedown() and RD.IsCanChangePosition(c) return c:IsFacedown() and RD.IsCanChangePosition(c,e,tp,REASON_EFFECT)
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)==3 return 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)
if chk==0 then return Duel.IsExistingMatchingCard(cm.posfilter,tp,0,LOCATION_MZONE,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(cm.posfilter,tp,0,LOCATION_MZONE,1,nil,e,tp) end
local g=Duel.GetMatchingGroup(cm.posfilter,tp,0,LOCATION_MZONE,nil) local g=Duel.GetMatchingGroup(cm.posfilter,tp,0,LOCATION_MZONE,nil,e,tp)
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 filter=RD.Filter(cm.posfilter,e,tp)
local g=Duel.GetMatchingGroup(filter,tp,0,LOCATION_MZONE,nil)
if g:GetCount()>0 and RD.ChangePosition(g,POS_FACEDOWN_DEFENSE)~=0 then if g:GetCount()>0 and RD.ChangePosition(g,POS_FACEDOWN_DEFENSE)~=0 then
RD.CanSelectAndDoAction(aux.Stringid(m,1),HINTMSG_POSCHANGE,cm.exfilter,tp,0,LOCATION_MZONE,1,3,nil,function(sg) local exfilter=RD.Filter(cm.exfilter,e,tp)
RD.CanSelectAndDoAction(aux.Stringid(m,1),HINTMSG_POSCHANGE,exfilter,tp,0,LOCATION_MZONE,1,3,nil,function(sg)
Duel.BreakEffect() Duel.BreakEffect()
RD.ChangePosition(sg,POS_FACEUP_ATTACK) RD.ChangePosition(sg,POS_FACEUP_ATTACK)
end) end)
......
...@@ -31,7 +31,7 @@ end ...@@ -31,7 +31,7 @@ end
cm.cost=RD.CostSendMZoneToGrave(cm.costfilter,1,1,false) cm.cost=RD.CostSendMZoneToGrave(cm.costfilter,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)
local tc=eg:GetFirst() local tc=eg:GetFirst()
if chk==0 then return RD.IsCanChangePosition(tc) and tc:IsCanTurnSet() end if chk==0 then return RD.IsCanChangePosition(tc,e,tp,REASON_EFFECT) and tc:IsCanTurnSet() end
Duel.SetTargetCard(tc) Duel.SetTargetCard(tc)
Duel.SetOperationInfo(0,CATEGORY_POSITION,tc,1,0,0) Duel.SetOperationInfo(0,CATEGORY_POSITION,tc,1,0,0)
end end
......
...@@ -23,20 +23,21 @@ end ...@@ -23,20 +23,21 @@ end
function cm.confilter2(c,tp) function cm.confilter2(c,tp)
return c:GetSummonPlayer()==tp and c:IsFaceup() return c:GetSummonPlayer()==tp and c:IsFaceup()
end end
function cm.filter(c) function cm.filter(c,e,tp)
return c:IsFaceup() and c:IsLevelBelow(8) and RD.IsCanChangePosition(c) and c:IsCanTurnSet() return c:IsFaceup() and c:IsLevelBelow(8) and RD.IsCanChangePosition(c,e,tp,REASON_EFFECT) and c:IsCanTurnSet()
end end
function cm.condition(e,tp,eg,ep,ev,re,r,rp) function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(cm.confilter1,tp,LOCATION_MZONE,0,1,nil) return Duel.IsExistingMatchingCard(cm.confilter1,tp,LOCATION_MZONE,0,1,nil)
and eg:IsExists(cm.confilter2,1,nil,1-tp) and eg:IsExists(cm.confilter2,1,nil,1-tp)
end end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk) function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,0,LOCATION_MZONE,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,0,LOCATION_MZONE,1,nil,e,tp) end
local g=Duel.GetMatchingGroup(cm.filter,tp,0,LOCATION_MZONE,nil) local g=Duel.GetMatchingGroup(cm.filter,tp,0,LOCATION_MZONE,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
end end
function cm.activate(e,tp,eg,ep,ev,re,r,rp) function cm.activate(e,tp,eg,ep,ev,re,r,rp)
RD.SelectAndDoAction(HINTMSG_SET,cm.filter,tp,0,LOCATION_MZONE,1,1,nil,function(g) local filter=RD.Filter(cm.filter,e,tp)
RD.SelectAndDoAction(HINTMSG_SET,filter,tp,0,LOCATION_MZONE,1,1,nil,function(g)
RD.ChangePosition(g,POS_FACEDOWN_DEFENSE) RD.ChangePosition(g,POS_FACEDOWN_DEFENSE)
end) end)
end end
\ No newline at end of file
...@@ -17,8 +17,8 @@ end ...@@ -17,8 +17,8 @@ end
function cm.confilter(c) function cm.confilter(c)
return c:IsAttribute(ATTRIBUTE_LIGHT) and c:IsRace(RACE_MACHINE) return c:IsAttribute(ATTRIBUTE_LIGHT) and c:IsRace(RACE_MACHINE)
end end
function cm.posfilter(c) function cm.posfilter(c,e,tp)
return c:IsFaceup() and c:IsLevelBelow(4) and RD.IsCanChangePosition(c) and c:IsCanTurnSet() return c:IsFaceup() and c:IsLevelBelow(4) and RD.IsCanChangePosition(c,e,tp,REASON_EFFECT) and c:IsCanTurnSet()
end end
function cm.spfilter(c,e,tp) function cm.spfilter(c,e,tp)
return c:IsLevel(5) and c:IsRace(RACE_MACHINE) and RD.IsCanBeSpecialSummoned(c,e,tp,POS_FACEUP) return c:IsLevel(5) and c:IsRace(RACE_MACHINE) and RD.IsCanBeSpecialSummoned(c,e,tp,POS_FACEUP)
...@@ -27,12 +27,13 @@ function cm.condition(e,tp,eg,ep,ev,re,r,rp) ...@@ -27,12 +27,13 @@ function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(cm.confilter,tp,LOCATION_GRAVE,0,3,nil) return Duel.IsExistingMatchingCard(cm.confilter,tp,LOCATION_GRAVE,0,3,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.posfilter,tp,0,LOCATION_MZONE,1,nil,e,tp) end
local g=Duel.GetMatchingGroup(cm.posfilter,tp,0,LOCATION_MZONE,nil) local g=Duel.GetMatchingGroup(cm.posfilter,tp,0,LOCATION_MZONE,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
end end
function cm.operation(e,tp,eg,ep,ev,re,r,rp) function cm.operation(e,tp,eg,ep,ev,re,r,rp)
RD.SelectAndDoAction(HINTMSG_SET,cm.posfilter,tp,0,LOCATION_MZONE,1,1,nil,function(g) local filter=RD.Filter(cm.posfilter,e,tp)
RD.SelectAndDoAction(HINTMSG_SET,filter,tp,0,LOCATION_MZONE,1,1,nil,function(g)
if RD.ChangePosition(g,POS_FACEDOWN_DEFENSE)~=0 then if RD.ChangePosition(g,POS_FACEDOWN_DEFENSE)~=0 then
RD.CanSelectAndSpecialSummon(aux.Stringid(m,1),cm.spfilter,tp,LOCATION_HAND,0,1,1,nil,e,POS_FACEUP,true) RD.CanSelectAndSpecialSummon(aux.Stringid(m,1),cm.spfilter,tp,LOCATION_HAND,0,1,1,nil,e,POS_FACEUP,true)
end end
......
...@@ -25,8 +25,8 @@ end ...@@ -25,8 +25,8 @@ end
function cm.spfilter(c,e,tp) function cm.spfilter(c,e,tp)
return c:IsLevel(4) and c:IsRace(RACE_SPELLCASTER) and RD.IsCanBeSpecialSummoned(c,e,tp,POS_FACEUP_ATTACK) return c:IsLevel(4) and c:IsRace(RACE_SPELLCASTER) and RD.IsCanBeSpecialSummoned(c,e,tp,POS_FACEUP_ATTACK)
end end
function cm.posfilter(c) function cm.posfilter(c,e,tp)
return c:IsAttackPos() and RD.IsCanChangePosition(c) return c:IsAttackPos() and RD.IsCanChangePosition(c,e,tp,REASON_EFFECT)
end end
function cm.poscheck(g) function cm.poscheck(g)
return g:IsExists(Card.IsLinkCode,1,nil,list[1]) return g:IsExists(Card.IsLinkCode,1,nil,list[1])
...@@ -41,7 +41,8 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -41,7 +41,8 @@ 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(aux.NecroValleyFilter(cm.spfilter),tp,LOCATION_GRAVE,0,1,1,nil,e,POS_FACEUP_ATTACK)~=0 then if RD.SelectAndSpecialSummon(aux.NecroValleyFilter(cm.spfilter),tp,LOCATION_GRAVE,0,1,1,nil,e,POS_FACEUP_ATTACK)~=0 then
RD.CanSelectGroupAndDoAction(aux.Stringid(m,1),HINTMSG_POSCHANGE,cm.posfilter,cm.poscheck,tp,LOCATION_MZONE,0,1,3,nil,function(g) local filter=RD.Filter(cm.posfilter,e,tp)
RD.CanSelectGroupAndDoAction(aux.Stringid(m,1),HINTMSG_POSCHANGE,filter,cm.poscheck,tp,LOCATION_MZONE,0,1,3,nil,function(g)
if RD.ChangePosition(g,POS_FACEUP_DEFENSE)~=0 then if RD.ChangePosition(g,POS_FACEUP_DEFENSE)~=0 then
local og=Duel.GetOperatedGroup() local og=Duel.GetOperatedGroup()
og:ForEach(function(tc) og:ForEach(function(tc)
......
...@@ -14,17 +14,18 @@ function cm.initial_effect(c) ...@@ -14,17 +14,18 @@ function cm.initial_effect(c)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
--Position --Position
function cm.filter(c) function cm.filter(c,e,tp)
return c:IsAttackPos() and RD.IsCanChangePosition(c) return c:IsAttackPos() and RD.IsCanChangePosition(c,e,tp,REASON_EFFECT)
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)
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,e,tp) end
local g=Duel.GetMatchingGroup(cm.filter,tp,0,LOCATION_MZONE,nil) local g=Duel.GetMatchingGroup(cm.filter,tp,0,LOCATION_MZONE,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
end end
function cm.operation(e,tp,eg,ep,ev,re,r,rp) function cm.operation(e,tp,eg,ep,ev,re,r,rp)
RD.SelectAndDoAction(HINTMSG_POSCHANGE,cm.filter,tp,0,LOCATION_MZONE,1,1,nil,function(g) local filter=RD.Filter(cm.filter,e,tp)
RD.SelectAndDoAction(HINTMSG_POSCHANGE,filter,tp,0,LOCATION_MZONE,1,1,nil,function(g)
if RD.ChangePosition(g,POS_FACEUP_DEFENCE)~=0 then if RD.ChangePosition(g,POS_FACEUP_DEFENCE)~=0 then
RD.AttachAtkDef(e,g:GetFirst(),0,-2000,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END) RD.AttachAtkDef(e,g:GetFirst(),0,-2000,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
end end
......
...@@ -16,21 +16,22 @@ end ...@@ -16,21 +16,22 @@ end
function cm.confilter(c,tp) function cm.confilter(c,tp)
return c:GetSummonPlayer()==tp and c:IsLevelAbove(5) return c:GetSummonPlayer()==tp and c:IsLevelAbove(5)
end end
function cm.filter(c) function cm.filter(c,e,tp)
return c:IsPosition(POS_FACEUP_ATTACK) and c:IsRace(RACE_DRAGON+RACE_MACHINE) and RD.IsCanChangePosition(c) return c:IsPosition(POS_FACEUP_ATTACK) and c:IsRace(RACE_DRAGON+RACE_MACHINE) and RD.IsCanChangePosition(c,e,tp,REASON_EFFECT)
end end
function cm.condition(e,tp,eg,ep,ev,re,r,rp) function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(cm.confilter,1,nil,1-tp) return eg:IsExists(cm.confilter,1,nil,1-tp)
end end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk) function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
local tc=eg:GetFirst() local tc=eg:GetFirst()
if chk==0 then return RD.IsCanChangePosition(tc) if chk==0 then return RD.IsCanChangePosition(tc,e,tp,REASON_EFFECT)
and Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_MZONE,0,1,nil) end and Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_MZONE,0,1,nil,e,tp) end
Duel.SetTargetCard(tc) Duel.SetTargetCard(tc)
Duel.SetOperationInfo(0,CATEGORY_POSITION,nil,2,0,0) Duel.SetOperationInfo(0,CATEGORY_POSITION,nil,2,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)
RD.SelectAndDoAction(HINTMSG_POSCHANGE,cm.filter,tp,LOCATION_MZONE,0,1,1,nil,function(g) local filter=RD.Filter(cm.filter,e,tp)
RD.SelectAndDoAction(HINTMSG_POSCHANGE,filter,tp,LOCATION_MZONE,0,1,1,nil,function(g)
local tc=eg:GetFirst() local tc=eg:GetFirst()
if tc:IsRelateToEffect(e) then if tc:IsRelateToEffect(e) then
g:AddCard(tc) g:AddCard(tc)
......
...@@ -32,7 +32,7 @@ end ...@@ -32,7 +32,7 @@ end
cm.cost=RD.CostSendGraveToDeck(cm.costfilter,2,2) 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 tc=eg:GetFirst() local tc=eg:GetFirst()
if chk==0 then return RD.IsCanChangePosition(tc) and tc:IsCanTurnSet() end if chk==0 then return RD.IsCanChangePosition(tc,e,tp,REASON_EFFECT) and tc:IsCanTurnSet() end
Duel.SetTargetCard(tc) Duel.SetTargetCard(tc)
Duel.SetOperationInfo(0,CATEGORY_POSITION,tc,1,0,0) Duel.SetOperationInfo(0,CATEGORY_POSITION,tc,1,0,0)
end end
......
...@@ -20,8 +20,8 @@ end ...@@ -20,8 +20,8 @@ end
function cm.costfilter(c) function cm.costfilter(c)
return c:IsType(TYPE_MONSTER) and c:IsAbleToDeckAsCost() return c:IsType(TYPE_MONSTER) and c:IsAbleToDeckAsCost()
end end
function cm.filter(c) function cm.filter(c,e,tp)
return RD.IsCanChangePosition(c) return RD.IsCanChangePosition(c,e,tp,REASON_EFFECT)
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_GRAVE,0,5,nil) return Duel.IsExistingMatchingCard(cm.confilter,tp,LOCATION_GRAVE,0,5,nil)
...@@ -32,12 +32,12 @@ function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -32,12 +32,12 @@ function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SendtoDeck(g,nil,SEQ_DECKSHUFFLE,REASON_COST) Duel.SendtoDeck(g,nil,SEQ_DECKSHUFFLE,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)
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,e,tp) end
local g=Duel.GetMatchingGroup(cm.filter,tp,0,LOCATION_MZONE,nil) local g=Duel.GetMatchingGroup(cm.filter,tp,0,LOCATION_MZONE,nil,e,tp)
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.filter,tp,0,LOCATION_MZONE,nil) local g=Duel.GetMatchingGroup(cm.filter,tp,0,LOCATION_MZONE,nil,e,tp)
if g:GetCount()>0 then if g:GetCount()>0 then
RD.ChangePosition(g) RD.ChangePosition(g)
end end
......
...@@ -28,7 +28,7 @@ function cm.condition(e,tp,eg,ep,ev,re,r,rp) ...@@ -28,7 +28,7 @@ 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)
local tc=eg:GetFirst() local tc=eg:GetFirst()
if chk==0 then return RD.IsCanChangePosition(tc) and tc:IsCanTurnSet() end if chk==0 then return RD.IsCanChangePosition(tc,e,tp,REASON_EFFECT) and tc:IsCanTurnSet() end
Duel.SetTargetCard(tc) Duel.SetTargetCard(tc)
Duel.SetOperationInfo(0,CATEGORY_POSITION,tc,1,0,0) Duel.SetOperationInfo(0,CATEGORY_POSITION,tc,1,0,0)
end end
......
...@@ -17,8 +17,8 @@ end ...@@ -17,8 +17,8 @@ end
function cm.confilter(c,tp) function cm.confilter(c,tp)
return c:GetSummonPlayer()==tp and c:IsSummonLocation(LOCATION_HAND+LOCATION_GRAVE) return c:GetSummonPlayer()==tp and c:IsSummonLocation(LOCATION_HAND+LOCATION_GRAVE)
end end
function cm.filter(c) function cm.filter(c,e,tp)
return c:IsFaceup() and c:IsLevelBelow(12) and RD.IsCanChangePosition(c) and c:IsCanTurnSet() return c:IsFaceup() and c:IsLevelBelow(12) and RD.IsCanChangePosition(c,e,tp,REASON_EFFECT) and c:IsCanTurnSet()
end end
function cm.check(g,atk) function cm.check(g,atk)
return g:GetSum(Card.GetLevel)<=12 return g:GetSum(Card.GetLevel)<=12
...@@ -27,12 +27,13 @@ function cm.condition(e,tp,eg,ep,ev,re,r,rp) ...@@ -27,12 +27,13 @@ function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(cm.confilter,1,nil,1-tp) return eg:IsExists(cm.confilter,1,nil,1-tp)
end end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk) function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.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,e,tp) end
local g=Duel.GetMatchingGroup(cm.filter,tp,0,LOCATION_MZONE,nil) local g=Duel.GetMatchingGroup(cm.filter,tp,0,LOCATION_MZONE,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
end end
function cm.activate(e,tp,eg,ep,ev,re,r,rp) function cm.activate(e,tp,eg,ep,ev,re,r,rp)
RD.SelectGroupAndDoAction(HINTMSG_SET,cm.filter,cm.check,tp,0,LOCATION_MZONE,1,2,nil,function(g) local filter=RD.Filter(cm.filter,e,tp)
RD.SelectGroupAndDoAction(HINTMSG_SET,filter,cm.check,tp,0,LOCATION_MZONE,1,2,nil,function(g)
RD.ChangePosition(g,POS_FACEDOWN_DEFENSE) RD.ChangePosition(g,POS_FACEDOWN_DEFENSE)
end) end)
end end
\ No newline at end of file
...@@ -25,7 +25,7 @@ function cm.condition(e,tp,eg,ep,ev,re,r,rp) ...@@ -25,7 +25,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 tc=Duel.GetAttackTarget() local tc=Duel.GetAttackTarget()
if Duel.NegateAttack() and tc and RD.IsCanChangePosition(tc) and Duel.SelectYesNo(tp,aux.Stringid(m,1)) then if Duel.NegateAttack() and tc and RD.IsCanChangePosition(tc,e,tp,REASON_EFFECT) and Duel.SelectYesNo(tp,aux.Stringid(m,1)) then
Duel.BreakEffect() Duel.BreakEffect()
if RD.ChangePosition(tc)~=0 then if RD.ChangePosition(tc)~=0 then
local dam=Duel.GetFieldGroupCount(tp,0,LOCATION_MZONE)*200 local dam=Duel.GetFieldGroupCount(tp,0,LOCATION_MZONE)*200
......
...@@ -20,19 +20,20 @@ end ...@@ -20,19 +20,20 @@ end
function cm.confilter(c,tp) function cm.confilter(c,tp)
return c:GetSummonPlayer()==tp and c:IsPosition(POS_FACEUP_ATTACK) return c:GetSummonPlayer()==tp and c:IsPosition(POS_FACEUP_ATTACK)
end end
function cm.filter(c) function cm.filter(c,e,tp)
return c:IsAttackPos() and c:IsLevelBelow(8) and RD.IsCanChangePosition(c) return c:IsAttackPos() and c:IsLevelBelow(8) and RD.IsCanChangePosition(c,e,tp,REASON_EFFECT)
end end
function cm.condition(e,tp,eg,ep,ev,re,r,rp) function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(cm.confilter,1,nil,1-tp) and Duel.GetFieldGroupCount(tp,0,LOCATION_MZONE)>=2 return eg:IsExists(cm.confilter,1,nil,1-tp) and Duel.GetFieldGroupCount(tp,0,LOCATION_MZONE)>=2
end end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk) function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,0,LOCATION_MZONE,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,0,LOCATION_MZONE,1,nil,e,tp) end
local g=Duel.GetMatchingGroup(cm.filter,tp,0,LOCATION_MZONE,nil) local g=Duel.GetMatchingGroup(cm.filter,tp,0,LOCATION_MZONE,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
end end
function cm.activate(e,tp,eg,ep,ev,re,r,rp) function cm.activate(e,tp,eg,ep,ev,re,r,rp)
RD.SelectAndDoAction(HINTMSG_POSCHANGE,cm.filter,tp,0,LOCATION_MZONE,1,2,nil,function(g) local filter=RD.Filter(cm.filter,e,tp)
RD.SelectAndDoAction(HINTMSG_POSCHANGE,filter,tp,0,LOCATION_MZONE,1,2,nil,function(g)
RD.ChangePosition(g,POS_FACEUP_DEFENSE) RD.ChangePosition(g,POS_FACEUP_DEFENSE)
end) end)
end end
\ No newline at end of file
...@@ -28,8 +28,8 @@ function cm.spcon(e,c) ...@@ -28,8 +28,8 @@ function cm.spcon(e,c)
and Duel.IsExistingMatchingCard(cm.spconfilter,tp,LOCATION_ONFIELD,0,1,nil) and Duel.IsExistingMatchingCard(cm.spconfilter,tp,LOCATION_ONFIELD,0,1,nil)
end end
--Atk Up --Atk Up
function cm.costfilter(c) function cm.costfilter(c,e,tp)
return c:IsFaceup() and RD.IsCanChangePosition(c) return c:IsFaceup() and RD.IsCanChangePosition(c,e,tp,REASON_COST)
end end
function cm.filter(c) function cm.filter(c)
return c:IsFaceup() and c:IsCode(list[1]) return c:IsFaceup() and c:IsCode(list[1])
......
...@@ -21,8 +21,8 @@ end ...@@ -21,8 +21,8 @@ end
function cm.exfilter(c) function cm.exfilter(c)
return RD.IsLegendCode(c,list[1]) return RD.IsLegendCode(c,list[1])
end end
function cm.posfilter(c) function cm.posfilter(c,e,tp)
return RD.IsCanChangePosition(c) return RD.IsCanChangePosition(c,e,tp,REASON_EFFECT)
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() local c=e:GetHandler()
...@@ -36,7 +36,8 @@ end ...@@ -36,7 +36,8 @@ end
function cm.operation(e,tp,eg,ep,ev,re,r,rp) function cm.operation(e,tp,eg,ep,ev,re,r,rp)
if RD.SelectAndSet(aux.NecroValleyFilter(cm.setfilter),tp,LOCATION_GRAVE,0,1,2,nil,e)~=0 if RD.SelectAndSet(aux.NecroValleyFilter(cm.setfilter),tp,LOCATION_GRAVE,0,1,2,nil,e)~=0
and RD.IsOperatedGroupExists(cm.exfilter,1,nil) then and RD.IsOperatedGroupExists(cm.exfilter,1,nil) then
RD.CanSelectAndDoAction(aux.Stringid(m,1),HINTMSG_POSCHANGE,cm.posfilter,tp,0,LOCATION_MZONE,1,3,nil,function(sg) local filter=RD.Filter(cm.posfilter,e,tp)
RD.CanSelectAndDoAction(aux.Stringid(m,1),HINTMSG_POSCHANGE,filter,tp,0,LOCATION_MZONE,1,3,nil,function(sg)
RD.ChangePosition(sg) RD.ChangePosition(sg)
end) end)
end end
......
...@@ -24,8 +24,8 @@ end ...@@ -24,8 +24,8 @@ end
function cm.costfilter(c) function cm.costfilter(c)
return c:IsRace(RACE_PSYCHO) and c:IsAbleToDeckOrExtraAsCost() return c:IsRace(RACE_PSYCHO) and c:IsAbleToDeckOrExtraAsCost()
end end
function cm.filter(c) function cm.filter(c,e,tp)
return c:IsFaceup() and c:IsLevelBelow(8) and RD.IsCanChangePosition(c) and c:IsCanTurnSet() return c:IsFaceup() and c:IsLevelBelow(8) and RD.IsCanChangePosition(c,e,tp,REASON_EFFECT) and c:IsCanTurnSet()
end end
function cm.spfilter(c,e,tp) function cm.spfilter(c,e,tp)
return c:IsLevel(2) and c:IsRace(RACE_PSYCHO) and RD.IsCanBeSpecialSummoned(c,e,tp,POS_FACEUP) return c:IsLevel(2) and c:IsRace(RACE_PSYCHO) and RD.IsCanBeSpecialSummoned(c,e,tp,POS_FACEUP)
...@@ -35,12 +35,13 @@ function cm.condition(e,tp,eg,ep,ev,re,r,rp) ...@@ -35,12 +35,13 @@ function cm.condition(e,tp,eg,ep,ev,re,r,rp)
end end
cm.cost=RD.CostSendGraveToDeck(cm.costfilter,2,2) 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(cm.filter,tp,0,LOCATION_MZONE,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,0,LOCATION_MZONE,1,nil,e,tp) end
local g=Duel.GetMatchingGroup(cm.filter,tp,0,LOCATION_MZONE,nil) local g=Duel.GetMatchingGroup(cm.filter,tp,0,LOCATION_MZONE,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
end end
function cm.activate(e,tp,eg,ep,ev,re,r,rp) function cm.activate(e,tp,eg,ep,ev,re,r,rp)
RD.SelectAndDoAction(HINTMSG_SET,cm.filter,tp,0,LOCATION_MZONE,1,1,nil,function(g) local filter=RD.Filter(cm.filter,e,tp)
RD.SelectAndDoAction(HINTMSG_SET,filter,tp,0,LOCATION_MZONE,1,1,nil,function(g)
if RD.ChangePosition(g,POS_FACEDOWN_DEFENSE)~=0 then if RD.ChangePosition(g,POS_FACEDOWN_DEFENSE)~=0 then
RD.CanSelectAndSpecialSummon(aux.Stringid(m,1),aux.NecroValleyFilter(cm.spfilter),tp,LOCATION_GRAVE,0,1,1,nil,e,POS_FACEUP,true) RD.CanSelectAndSpecialSummon(aux.Stringid(m,1),aux.NecroValleyFilter(cm.spfilter),tp,LOCATION_GRAVE,0,1,1,nil,e,POS_FACEUP,true)
end end
......
...@@ -16,8 +16,8 @@ end ...@@ -16,8 +16,8 @@ end
function cm.costfilter(c) function cm.costfilter(c)
return c:IsFaceup() and c:IsRace(RACE_BEASTWARRIOR) and c:GetBaseAttack()>0 and c:IsAbleToGraveAsCost() return c:IsFaceup() and c:IsRace(RACE_BEASTWARRIOR) and c:GetBaseAttack()>0 and c:IsAbleToGraveAsCost()
end end
function cm.posfilter(c) function cm.posfilter(c,e,tp)
return RD.IsCanChangePosition(c) return RD.IsCanChangePosition(c,e,tp,REASON_EFFECT)
end end
cm.cost=RD.CostSendMZoneToGrave(cm.costfilter,1,1,true,function(g) cm.cost=RD.CostSendMZoneToGrave(cm.costfilter,1,1,true,function(g)
return g:GetSum(Card.GetBaseAttack) return g:GetSum(Card.GetBaseAttack)
...@@ -28,7 +28,8 @@ function cm.operation(e,tp,eg,ep,ev,re,r,rp) ...@@ -28,7 +28,8 @@ function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local atk=e:GetLabel() local atk=e:GetLabel()
RD.AttachAtkDef(e,c,atk,0,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END) RD.AttachAtkDef(e,c,atk,0,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
if Duel.GetFieldGroupCount(tp,LOCATION_FZONE,0)>0 then if Duel.GetFieldGroupCount(tp,LOCATION_FZONE,0)>0 then
RD.CanSelectAndDoAction(aux.Stringid(m,3),HINTMSG_POSCHANGE,cm.posfilter,tp,0,LOCATION_MZONE,1,1,nil,function(sg) local filter=RD.Filter(cm.posfilter,e,tp)
RD.CanSelectAndDoAction(aux.Stringid(m,3),HINTMSG_POSCHANGE,filter,tp,0,LOCATION_MZONE,1,1,nil,function(sg)
RD.ChangePosition(sg) RD.ChangePosition(sg)
end) end)
end end
......
...@@ -22,8 +22,8 @@ end ...@@ -22,8 +22,8 @@ end
function cm.costfilter(c) function cm.costfilter(c)
return c:IsCode(list[1],list[2]) and c:IsAbleToDeckAsCost() return c:IsCode(list[1],list[2]) and c:IsAbleToDeckAsCost()
end end
function cm.posfilter(c) function cm.posfilter(c,e,tp)
return RD.IsCanChangePosition(c) return RD.IsCanChangePosition(c,e,tp,REASON_EFFECT)
end end
function cm.condition(e,tp,eg,ep,ev,re,r,rp) function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(cm.confilter,1,nil,1-tp) return eg:IsExists(cm.confilter,1,nil,1-tp)
...@@ -44,7 +44,8 @@ end ...@@ -44,7 +44,8 @@ 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=eg:GetFirst() local tc=eg:GetFirst()
if tc:IsRelateToEffect(e) and Duel.Destroy(tc,REASON_EFFECT)~=0 and e:GetLabel()==20247016 then if tc:IsRelateToEffect(e) and Duel.Destroy(tc,REASON_EFFECT)~=0 and e:GetLabel()==20247016 then
RD.CanSelectAndDoAction(aux.Stringid(m,1),HINTMSG_POSCHANGE,cm.posfilter,tp,0,LOCATION_MZONE,1,1,nil,function(sg) local filter=RD.Filter(cm.posfilter,e,tp)
RD.CanSelectAndDoAction(aux.Stringid(m,1),HINTMSG_POSCHANGE,filter,tp,0,LOCATION_MZONE,1,1,nil,function(sg)
RD.ChangePosition(sg) RD.ChangePosition(sg)
end) end)
end end
......
...@@ -22,7 +22,7 @@ function cm.condition(e,tp,eg,ep,ev,re,r,rp) ...@@ -22,7 +22,7 @@ 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)
local tc=Duel.GetAttacker() local tc=Duel.GetAttacker()
if chk==0 then return tc:IsAttackPos() and RD.IsCanChangePosition(tc) end if chk==0 then return tc:IsAttackPos() and RD.IsCanChangePosition(tc,e,tp,REASON_EFFECT) end
Duel.SetOperationInfo(0,CATEGORY_POSITION,tc,1,0,0) Duel.SetOperationInfo(0,CATEGORY_POSITION,tc,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)
......
...@@ -23,7 +23,7 @@ end ...@@ -23,7 +23,7 @@ end
cm.cost=RD.CostSendMZoneToHand(cm.costfilter,1,1) cm.cost=RD.CostSendMZoneToHand(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 tc=Duel.GetAttacker() local tc=Duel.GetAttacker()
if chk==0 then return tc:IsAttackPos() and RD.IsCanChangePosition(tc) end if chk==0 then return tc:IsAttackPos() and RD.IsCanChangePosition(tc,e,tp,REASON_EFFECT) end
Duel.SetOperationInfo(0,CATEGORY_POSITION,tc,1,0,0) Duel.SetOperationInfo(0,CATEGORY_POSITION,tc,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)
......
...@@ -18,20 +18,21 @@ end ...@@ -18,20 +18,21 @@ end
function cm.confilter(c) function cm.confilter(c)
return c:IsFaceup() and c:IsRace(RACE_REPTILE) return c:IsFaceup() and c:IsRace(RACE_REPTILE)
end end
function cm.posfilter(c) function cm.posfilter(c,e,tp)
return c:IsFacedown() and RD.IsCanChangePosition(c) return c:IsFacedown() and RD.IsCanChangePosition(c,e,tp,REASON_EFFECT)
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,e:GetHandler()) return Duel.IsExistingMatchingCard(cm.confilter,tp,LOCATION_MZONE,0,1,e:GetHandler())
end end
cm.cost=RD.CostPayLP(300) cm.cost=RD.CostPayLP(300)
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,LOCATION_MZONE,LOCATION_MZONE,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(cm.posfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil,e,tp) end
local g=Duel.GetMatchingGroup(cm.posfilter,tp,LOCATION_MZONE,LOCATION_MZONE,nil) local g=Duel.GetMatchingGroup(cm.posfilter,tp,LOCATION_MZONE,LOCATION_MZONE,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
end end
function cm.operation(e,tp,eg,ep,ev,re,r,rp) function cm.operation(e,tp,eg,ep,ev,re,r,rp)
RD.SelectAndDoAction(HINTMSG_POSCHANGE,cm.posfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil,function(g) local filter=RD.Filter(cm.posfilter,e,tp)
RD.SelectAndDoAction(HINTMSG_POSCHANGE,filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil,function(g)
local c=e:GetHandler() local c=e:GetHandler()
if RD.ChangePosition(g,POS_FACEUP_ATTACK)~=0 and c:IsFaceup() and c:IsRelateToEffect(e) then if RD.ChangePosition(g,POS_FACEUP_ATTACK)~=0 and c:IsFaceup() and c:IsRelateToEffect(e) then
Duel.BreakEffect() Duel.BreakEffect()
......
...@@ -25,8 +25,8 @@ end ...@@ -25,8 +25,8 @@ end
function cm.confilter2(c,tp) function cm.confilter2(c,tp)
return c:GetSummonPlayer()==tp return c:GetSummonPlayer()==tp
end end
function cm.filter(c) function cm.filter(c,e,tp)
return c:IsFaceup() and RD.IsCanChangePosition(c) and c:IsCanTurnSet() return c:IsFaceup() and RD.IsCanChangePosition(c,e,tp,REASON_EFFECT) and c:IsCanTurnSet()
end end
function cm.exfilter(c) function cm.exfilter(c)
return c:IsFaceup() and c:IsCode(list[1]) return c:IsFaceup() and c:IsCode(list[1])
...@@ -36,12 +36,13 @@ function cm.condition(e,tp,eg,ep,ev,re,r,rp) ...@@ -36,12 +36,13 @@ function cm.condition(e,tp,eg,ep,ev,re,r,rp)
and eg:IsExists(cm.confilter2,1,nil,1-tp) and eg:IsExists(cm.confilter2,1,nil,1-tp)
end end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk) function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,0,LOCATION_MZONE,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,0,LOCATION_MZONE,1,nil,e,tp) end
local g=Duel.GetMatchingGroup(cm.filter,tp,0,LOCATION_MZONE,nil) local g=Duel.GetMatchingGroup(cm.filter,tp,0,LOCATION_MZONE,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
end end
function cm.activate(e,tp,eg,ep,ev,re,r,rp) function cm.activate(e,tp,eg,ep,ev,re,r,rp)
RD.SelectAndDoAction(HINTMSG_SET,cm.filter,tp,0,LOCATION_MZONE,1,1,nil,function(g) local filter=RD.Filter(cm.filter,e,tp)
RD.SelectAndDoAction(HINTMSG_SET,filter,tp,0,LOCATION_MZONE,1,1,nil,function(g)
if RD.ChangePosition(g,POS_FACEDOWN_DEFENSE)~=0 if RD.ChangePosition(g,POS_FACEDOWN_DEFENSE)~=0
and Duel.IsExistingMatchingCard(cm.exfilter,tp,LOCATION_MZONE,0,1,nil) then and Duel.IsExistingMatchingCard(cm.exfilter,tp,LOCATION_MZONE,0,1,nil) then
RD.CanSelectAndDoAction(aux.Stringid(m,1),HINTMSG_DESTROY,Card.IsFacedown,tp,0,LOCATION_ONFIELD,1,1,nil,function(sg) RD.CanSelectAndDoAction(aux.Stringid(m,1),HINTMSG_DESTROY,Card.IsFacedown,tp,0,LOCATION_ONFIELD,1,1,nil,function(sg)
......
...@@ -19,8 +19,8 @@ end ...@@ -19,8 +19,8 @@ end
function cm.costfilter(c) function cm.costfilter(c)
return c:IsRace(RACE_DRAGON) and c:IsAbleToGraveAsCost() return c:IsRace(RACE_DRAGON) and c:IsAbleToGraveAsCost()
end end
function cm.posfilter(c) function cm.posfilter(c,e,tp)
return c:IsFacedown() and RD.IsCanChangePosition(c) return c:IsFacedown() and RD.IsCanChangePosition(c,e,tp,REASON_EFFECT)
end end
function cm.exfilter1(c) function cm.exfilter1(c)
return c:IsFaceup() and c:IsRace(RACE_DRAGON) return c:IsFaceup() and c:IsRace(RACE_DRAGON)
...@@ -33,12 +33,13 @@ function cm.spfilter(c,e,tp) ...@@ -33,12 +33,13 @@ function cm.spfilter(c,e,tp)
end end
cm.cost=RD.CostSendHandToGrave(cm.costfilter,1,1) cm.cost=RD.CostSendHandToGrave(cm.costfilter,1,1)
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk) function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.posfilter,tp,0,LOCATION_MZONE,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(cm.posfilter,tp,0,LOCATION_MZONE,1,nil,e,tp) end
local g=Duel.GetMatchingGroup(cm.posfilter,tp,0,LOCATION_MZONE,nil) local g=Duel.GetMatchingGroup(cm.posfilter,tp,0,LOCATION_MZONE,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
end end
function cm.operation(e,tp,eg,ep,ev,re,r,rp) function cm.operation(e,tp,eg,ep,ev,re,r,rp)
RD.SelectAndDoAction(HINTMSG_POSCHANGE,cm.posfilter,tp,0,LOCATION_MZONE,1,1,nil,function(g) local filter=RD.Filter(cm.posfilter,e,tp)
RD.SelectAndDoAction(HINTMSG_POSCHANGE,filter,tp,0,LOCATION_MZONE,1,1,nil,function(g)
if RD.ChangePosition(g,POS_FACEUP_ATTACK)~=0 if RD.ChangePosition(g,POS_FACEUP_ATTACK)~=0
and Duel.IsExistingMatchingCard(cm.exfilter1,tp,LOCATION_MZONE,0,1,nil) and Duel.IsExistingMatchingCard(cm.exfilter1,tp,LOCATION_MZONE,0,1,nil)
and not Duel.IsExistingMatchingCard(cm.exfilter2,tp,LOCATION_MZONE,0,1,nil) then and not Duel.IsExistingMatchingCard(cm.exfilter2,tp,LOCATION_MZONE,0,1,nil) then
......
...@@ -19,8 +19,8 @@ end ...@@ -19,8 +19,8 @@ end
function cm.costfilter(c) function cm.costfilter(c)
return c:IsRace(RACE_DRAGON) and c:IsAbleToGraveAsCost() return c:IsRace(RACE_DRAGON) and c:IsAbleToGraveAsCost()
end end
function cm.posfilter(c) function cm.posfilter(c,e,tp)
return c:IsAttackPos() and RD.IsCanChangePosition(c) and c:IsCanTurnSet() return c:IsAttackPos() and RD.IsCanChangePosition(c,e,tp,REASON_EFFECT) and c:IsCanTurnSet()
end end
function cm.exfilter1(c) function cm.exfilter1(c)
return c:IsFaceup() and c:IsRace(RACE_DRAGON) return c:IsFaceup() and c:IsRace(RACE_DRAGON)
...@@ -33,12 +33,13 @@ function cm.spfilter(c,e,tp) ...@@ -33,12 +33,13 @@ function cm.spfilter(c,e,tp)
end end
cm.cost=RD.CostSendHandToGrave(cm.costfilter,1,1) cm.cost=RD.CostSendHandToGrave(cm.costfilter,1,1)
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk) function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.posfilter,tp,0,LOCATION_MZONE,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(cm.posfilter,tp,0,LOCATION_MZONE,1,nil,e,tp) end
local g=Duel.GetMatchingGroup(cm.posfilter,tp,0,LOCATION_MZONE,nil) local g=Duel.GetMatchingGroup(cm.posfilter,tp,0,LOCATION_MZONE,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
end end
function cm.operation(e,tp,eg,ep,ev,re,r,rp) function cm.operation(e,tp,eg,ep,ev,re,r,rp)
RD.SelectAndDoAction(HINTMSG_SET,cm.posfilter,tp,0,LOCATION_MZONE,1,1,nil,function(g) local filter=RD.Filter(cm.posfilter,e,tp)
RD.SelectAndDoAction(HINTMSG_SET,filter,tp,0,LOCATION_MZONE,1,1,nil,function(g)
if RD.ChangePosition(g,POS_FACEDOWN_DEFENSE)~=0 if RD.ChangePosition(g,POS_FACEDOWN_DEFENSE)~=0
and Duel.IsExistingMatchingCard(cm.exfilter1,tp,LOCATION_MZONE,0,1,nil) and Duel.IsExistingMatchingCard(cm.exfilter1,tp,LOCATION_MZONE,0,1,nil)
and not Duel.IsExistingMatchingCard(cm.exfilter2,tp,LOCATION_MZONE,0,1,nil) then and not Duel.IsExistingMatchingCard(cm.exfilter2,tp,LOCATION_MZONE,0,1,nil) then
......
...@@ -17,17 +17,18 @@ end ...@@ -17,17 +17,18 @@ end
function cm.costfilter(c) function cm.costfilter(c)
return c:IsRace(RACE_WYRM) and c:IsAbleToDeckOrExtraAsCost() return c:IsRace(RACE_WYRM) and c:IsAbleToDeckOrExtraAsCost()
end end
function cm.posfilter(c) function cm.posfilter(c,e,tp)
return c:IsFaceup() and c:IsLevelBelow(9) and RD.IsCanChangePosition(c) and c:IsCanTurnSet() return c:IsFaceup() and c:IsLevelBelow(9) and RD.IsCanChangePosition(c,e,tp,REASON_EFFECT) and c:IsCanTurnSet()
end end
cm.cost=RD.CostSendGraveToDeck(cm.costfilter,2,2) 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(cm.posfilter,tp,0,LOCATION_MZONE,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(cm.posfilter,tp,0,LOCATION_MZONE,1,nil,e,tp) end
local g=Duel.GetMatchingGroup(cm.posfilter,tp,0,LOCATION_MZONE,nil) local g=Duel.GetMatchingGroup(cm.posfilter,tp,0,LOCATION_MZONE,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
end end
function cm.operation(e,tp,eg,ep,ev,re,r,rp) function cm.operation(e,tp,eg,ep,ev,re,r,rp)
RD.SelectAndDoAction(HINTMSG_SET,cm.posfilter,tp,0,LOCATION_MZONE,1,1,nil,function(g) local filter=RD.Filter(cm.posfilter,e,tp)
RD.SelectAndDoAction(HINTMSG_SET,filter,tp,0,LOCATION_MZONE,1,1,nil,function(g)
if RD.ChangePosition(g,POS_FACEDOWN_DEFENSE)~=0 then if RD.ChangePosition(g,POS_FACEDOWN_DEFENSE)~=0 then
Duel.BreakEffect() Duel.BreakEffect()
Duel.ConfirmDecktop(1-tp,3) Duel.ConfirmDecktop(1-tp,3)
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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