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 -- 暗物质人偶·水母
EFFECT_ATTACK_NOT_CHAIN_TRAP = 120140004 -- 不许始末战士 (攻击宣言时, 对方不能把陷阱卡发动)
EFFECT_ONLY_FUSION_SUMMON = 120263031 -- 只能融合召唤 (奇迹融合)
EFFECT_MAXIMUM_MODE = 120272058 -- 通过效果变成极大模式 (时间机器)
EFFECT_CANNOT_TO_HAND_EFFECT = 120274001 -- 不会被效果回到手卡
EFFECT_CANNOT_TO_DECK_EFFECT = 120274002 -- 不会被效果回到卡组·额外卡组
EFFECT_CANNOT_TO_HAND_EFFECT = 120274001 -- 不会因效果回到手卡
EFFECT_CANNOT_TO_DECK_EFFECT = 120274002 -- 不会因效果回到卡组·额外卡组
EFFECT_CANNOT_CHANGE_POSITION_EFFECT = 120277011 -- 不会因效果改变表示形式
-- 标记
FLAG_SUMMON_TURN = 120000011 -- 召唤·特殊召唤的回合被盖放, 不再符合召唤·特殊召唤的回合的条件
......
......@@ -47,8 +47,20 @@ function RushDuel.IsCanChangeDef(card)
return card:IsDefenseAbove(0) and not RushDuel.IsMaximumMode(card)
end
-- 条件: 可否改变表示形式
function RushDuel.IsCanChangePosition(card)
return card:IsCanChangePosition() and not RushDuel.IsMaximumMode(card)
function RushDuel.IsCanChangePosition(card, effect, player, reason)
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
-- 条件: 可否特殊召唤
function RushDuel.IsCanBeSpecialSummoned(card, effect, player, position)
......
......@@ -355,7 +355,7 @@ function RushDuel.CostChangeSelfPosition(pos1, pos2)
return function(e, tp, eg, ep, ev, re, r, rp, chk)
local c = e:GetHandler()
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
if pos2 then
RD.ChangePosition(c, pos2)
......
......@@ -14,12 +14,16 @@ function cm.initial_effect(c)
c:RegisterEffect(e1)
end
--Position
function cm.posfilter(c,e,tp)
return RD.IsCanChangePosition(c,e,tp,REASON_EFFECT)
end
cm.cost=RD.CostSendHandToGrave(Card.IsAbleToGraveAsCost,1,1)
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
local g=Duel.GetMatchingGroup(RD.IsCanChangePosition,tp,0,LOCATION_MZONE,nil)
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,e,tp)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
end
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
\ No newline at end of file
......@@ -24,7 +24,7 @@ end
cm.cost=RD.CostSendDeckTopToGrave(3)
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
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)
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -14,17 +14,18 @@ function cm.initial_effect(c)
c:RegisterEffect(e1)
end
--Position
function cm.posfilter(c)
return c:IsFacedown() and RD.IsCanChangePosition(c)
function cm.posfilter(c,e,tp)
return c:IsFacedown() and RD.IsCanChangePosition(c,e,tp,REASON_EFFECT)
end
cm.cost=RD.CostPayLP(1000)
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
local g=Duel.GetMatchingGroup(cm.posfilter,tp,0,LOCATION_MZONE,nil)
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,e,tp)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
end
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)
end)
end
\ No newline at end of file
......@@ -20,20 +20,21 @@ end
function cm.filter(c)
return c:IsFaceup() and c:IsRace(RACE_AQUA)
end
function cm.posfilter(c)
return c:IsAttackPos() and RD.IsCanChangePosition(c)
function cm.posfilter(c,e,tp)
return c:IsAttackPos() and RD.IsCanChangePosition(c,e,tp,REASON_EFFECT)
end
cm.cost=RD.CostSendHandToGrave(cm.costfilter,1,1)
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)
and Duel.IsExistingMatchingCard(cm.posfilter,tp,0,LOCATION_MZONE,1,nil) end
local g=Duel.GetMatchingGroup(cm.posfilter,tp,0,LOCATION_MZONE,nil)
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,e,tp)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local ct=Duel.GetMatchingGroupCount(cm.filter,tp,LOCATION_MZONE,0,nil)
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)
end)
end
\ No newline at end of file
......@@ -20,8 +20,8 @@ end
function cm.exfilter(c)
return c:IsFaceup() and c:IsType(TYPE_EQUIP)
end
function cm.posfilter(c)
return c:IsAttackPos() and RD.IsCanChangePosition(c)
function cm.posfilter(c,e,tp)
return c:IsAttackPos() and RD.IsCanChangePosition(c,e,tp,REASON_EFFECT)
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return RD.IsSummonTurn(e:GetHandler())
......@@ -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
local ct=Duel.GetOperatedGroup():FilterCount(cm.ctfilter,nil)
if ct==0 then return end
local filter=RD.Filter(cm.posfilter,e,tp)
if Duel.Damage(1-tp,ct*100,REASON_EFFECT)~=0
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)
end)
end
......
......@@ -23,8 +23,8 @@ end
function cm.exfilter(c)
return c:IsFaceup() and c:IsCode(list[1])
end
function cm.posfilter(c)
return c:IsFaceup() and RD.IsCanChangePosition(c)
function cm.posfilter(c,e,tp)
return c:IsFaceup() and RD.IsCanChangePosition(c,e,tp,REASON_EFFECT)
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsAbleToEnterBP()
......@@ -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.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
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)
end)
end
......
......@@ -14,19 +14,20 @@ function cm.initial_effect(c)
c:RegisterEffect(e1)
end
--Position
function cm.posfilter(c)
return c:IsFaceup() and c:IsLevelBelow(6) and c:IsDefenseBelow(1000) and RD.IsCanChangePosition(c) and c:IsCanTurnSet()
function cm.posfilter(c,e,tp)
return c:IsFaceup() and c:IsLevelBelow(6) and c:IsDefenseBelow(1000) and RD.IsCanChangePosition(c,e,tp,REASON_EFFECT) and c:IsCanTurnSet()
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFieldGroupCount(tp,0,LOCATION_MZONE)>1
end
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
local g=Duel.GetMatchingGroup(cm.posfilter,tp,0,LOCATION_MZONE,nil)
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,e,tp)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
end
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)
end)
end
\ No newline at end of file
......@@ -7,7 +7,7 @@ function cm.initial_effect(c)
--Discard Deck
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_DECKDES)
e1:SetCategory(CATEGORY_DECKDES+CATEGORY_POSITION)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetTarget(cm.target)
......@@ -21,8 +21,8 @@ end
function cm.filter(c)
return c:IsFaceup() and RD.IsCanAttachPierce(c)
end
function cm.posfilter(c)
return c:IsAttackPos() and RD.IsCanChangePosition(c)
function cm.posfilter(c,e,tp)
return c:IsAttackPos() and RD.IsCanChangePosition(c,e,tp,REASON_EFFECT)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
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)
g:ForEach(function(tc)
RD.AttachPierce(e,tc,aux.Stringid(m,3),RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_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
RD.ChangePosition(mg,POS_FACEUP_DEFENSE)
end
......
......@@ -17,17 +17,18 @@ end
function cm.costfilter(c)
return c:IsAttribute(ATTRIBUTE_WATER) and c:IsAbleToGraveAsCost()
end
function cm.posfilter(c)
return c:IsDefensePos() and RD.IsCanChangePosition(c)
function cm.posfilter(c,e,tp)
return c:IsDefensePos() and RD.IsCanChangePosition(c,e,tp,REASON_EFFECT)
end
cm.cost=RD.CostSendHandToGrave(cm.costfilter,1,1)
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
local g=Duel.GetMatchingGroup(cm.posfilter,tp,0,LOCATION_MZONE,nil)
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,e,tp)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
end
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)
end)
end
\ No newline at end of file
......@@ -13,17 +13,18 @@ function cm.initial_effect(c)
c:RegisterEffect(e1)
end
--Activate
function cm.filter(c)
return c:IsFaceup() and RD.IsCanChangePosition(c) and c:IsCanTurnSet()
function cm.filter(c,e,tp)
return c:IsFaceup() and RD.IsCanChangePosition(c,e,tp,REASON_EFFECT) and c:IsCanTurnSet()
end
cm.cost=RD.CostSendHandToGrave(Card.IsAbleToGraveAsCost,2,2)
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
local g=Duel.GetMatchingGroup(cm.filter,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
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,e,tp)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
end
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)
end)
end
\ No newline at end of file
......@@ -13,19 +13,20 @@ function cm.initial_effect(c)
c:RegisterEffect(e1)
end
--Activate
function cm.filter(c)
return c:IsFacedown() and RD.IsCanChangePosition(c)
function cm.filter(c,e,tp)
return c:IsFacedown() and RD.IsCanChangePosition(c,e,tp,REASON_EFFECT)
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(Card.IsFacedown,tp,0,LOCATION_MZONE,2,nil)
end
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
local g=Duel.GetMatchingGroup(cm.filter,tp,0,LOCATION_MZONE,nil)
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,e,tp)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
end
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)
end)
end
\ No newline at end of file
......@@ -22,9 +22,9 @@ function cm.confilter(c)
end
function cm.posfilter(c,e,tp)
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
return c:IsAttackPos() and RD.IsCanChangePosition(c)
return c:IsAttackPos() and RD.IsCanChangePosition(c,e,tp,REASON_EFFECT)
end
end
function cm.check(g)
......
......@@ -13,16 +13,17 @@ function cm.initial_effect(c)
c:RegisterEffect(e1)
end
--Position
function cm.posfilter(c)
return c:IsPosition(POS_FACEUP_DEFENSE) and c:IsRace(RACE_WARRIOR) and RD.IsCanChangePosition(c)
function cm.posfilter(c,e,tp)
return c:IsPosition(POS_FACEUP_DEFENSE) and c:IsRace(RACE_WARRIOR) and RD.IsCanChangePosition(c,e,tp,REASON_EFFECT)
end
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
local g=Duel.GetMatchingGroup(cm.posfilter,tp,LOCATION_MZONE,0,nil)
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,e,tp)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
end
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)
end)
end
\ No newline at end of file
......@@ -16,19 +16,20 @@ end
function cm.confilter(c)
return c:IsFaceup() and c:IsRace(RACE_PSYCHO)
end
function cm.filter(c)
return c:IsFaceup() and RD.IsCanChangePosition(c) and c:IsCanTurnSet()
function cm.filter(c,e,tp)
return c:IsFaceup() and RD.IsCanChangePosition(c,e,tp,REASON_EFFECT) and c:IsCanTurnSet()
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(cm.confilter,tp,LOCATION_MZONE,0,2,nil)
end
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
local g=Duel.GetMatchingGroup(cm.filter,tp,0,LOCATION_MZONE,nil)
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,e,tp)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
end
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)
end)
end
\ No newline at end of file
......@@ -12,17 +12,18 @@ function cm.initial_effect(c)
c:RegisterEffect(e1)
end
--Activate
function cm.posfilter(c)
return c:IsPosition(POS_FACEUP_ATTACK) and c:IsRace(RACE_AQUA) and RD.IsCanChangePosition(c)
function cm.posfilter(c,e,tp)
return c:IsPosition(POS_FACEUP_ATTACK) and c:IsRace(RACE_AQUA) and RD.IsCanChangePosition(c,e,tp,REASON_EFFECT)
end
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
local g=Duel.GetMatchingGroup(cm.posfilter,tp,LOCATION_MZONE,0,nil)
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,e,tp)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,g:GetCount(),0,0)
Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,g:GetCount()*400)
end
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
local ct=RD.ChangePosition(g,POS_FACEUP_DEFENSE)
Duel.Recover(tp,ct*400,REASON_EFFECT)
......
......@@ -21,7 +21,7 @@ function cm.condition(e,tp,eg,ep,ev,re,r,rp)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
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.SetOperationInfo(0,CATEGORY_POSITION,tc,1,0,0)
end
......
......@@ -17,20 +17,21 @@ end
function cm.costfilter(c)
return c:IsType(TYPE_NORMAL) and c:IsLevel(2) and c:IsAbleToGraveAsCost()
end
function cm.filter(c)
return c:IsFaceup() and RD.IsCanChangePosition(c) and c:IsCanTurnSet()
function cm.filter(c,e,tp)
return c:IsFaceup() and RD.IsCanChangePosition(c,e,tp,REASON_EFFECT) and c:IsCanTurnSet()
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetAttacker():IsControler(1-tp)
end
cm.cost=RD.CostSendHandToGrave(cm.costfilter,2,2)
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
local g=Duel.GetMatchingGroup(cm.filter,tp,0,LOCATION_MZONE,nil)
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,e,tp)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
end
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)
end)
end
\ No newline at end of file
......@@ -14,17 +14,18 @@ function cm.initial_effect(c)
c:RegisterEffect(e1)
end
--Position
function cm.filter(c)
return c:IsAttackPos() and RD.IsCanChangePosition(c)
function cm.filter(c,e,tp)
return c:IsAttackPos() and RD.IsCanChangePosition(c,e,tp,REASON_EFFECT)
end
cm.cost=RD.CostChangeSelfPosition(POS_FACEUP_ATTACK,POS_FACEUP_DEFENSE)
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
local g=Duel.GetMatchingGroup(cm.filter,tp,0,LOCATION_MZONE,nil)
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,e,tp)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
end
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
RD.AttachAtkDef(e,g:GetFirst(),0,-600,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
end
......
......@@ -14,9 +14,9 @@ function cm.initial_effect(c)
c:RegisterEffect(e1)
end
--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)
and RD.IsCanChangePosition(c)
and RD.IsCanChangePosition(c,e,tp,REASON_COST)
end
cm.cost=RD.CostChangePosition(cm.costfilter,1,1)
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
......
......@@ -12,16 +12,17 @@ function cm.initial_effect(c)
c:RegisterEffect(e1)
end
--Activate
function cm.filter(c)
return c:IsAttackPos() and RD.IsCanChangePosition(c)
function cm.filter(c,e,tp)
return c:IsAttackPos() and RD.IsCanChangePosition(c,e,tp,REASON_EFFECT)
end
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
local g=Duel.GetMatchingGroup(cm.filter,tp,0,LOCATION_MZONE,nil)
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,e,tp)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
end
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)
end)
end
\ No newline at end of file
......@@ -19,8 +19,8 @@ end
function cm.confilter2(c,tp)
return c:GetSummonPlayer()==tp
end
function cm.posfilter(c)
return c:IsAttackPos() and RD.IsCanChangePosition(c)
function cm.posfilter(c,e,tp)
return c:IsAttackPos() and RD.IsCanChangePosition(c,e,tp,REASON_EFFECT)
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(cm.confilter1,tp,LOCATION_MZONE,0,2,nil)
......@@ -34,7 +34,8 @@ end
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)
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
RD.ChangePosition(sg,POS_FACEUP_DEFENSE)
end
......
......@@ -23,7 +23,7 @@ function cm.condition(e,tp,eg,ep,ev,re,r,rp)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
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)
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -16,18 +16,19 @@ function cm.initial_effect(c)
c:RegisterEffect(e1)
end
--Position
function cm.posfilter(c)
return c:IsDefensePos() and RD.IsCanChangePosition(c)
function cm.posfilter(c,e,tp)
return c:IsDefensePos() and RD.IsCanChangePosition(c,e,tp,REASON_EFFECT)
end
cm.cost=RD.CostSendDeckTopToGrave(3)
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())
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)
end
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)
end)
end
\ No newline at end of file
......@@ -19,20 +19,21 @@ end
function cm.confilter2(c,tp)
return c:GetSummonPlayer()==tp
end
function cm.filter(c)
return not c:IsPosition(POS_FACEUP_DEFENSE) and RD.IsCanChangePosition(c)
function cm.filter(c,e,tp)
return not c:IsPosition(POS_FACEUP_DEFENSE) and RD.IsCanChangePosition(c,e,tp,REASON_EFFECT)
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetMatchingGroupCount(cm.confilter1,tp,LOCATION_MZONE,0,nil)==3
and eg:IsExists(cm.confilter2,1,nil,1-tp)
end
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
local g=Duel.GetMatchingGroup(cm.filter,tp,LOCATION_MZONE,0,nil)
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,e,tp)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
end
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
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)
......
......@@ -16,19 +16,20 @@ end
function cm.confilter(c)
return c:IsFaceup() and c:IsLevelAbove(5) and c:IsAttribute(ATTRIBUTE_WIND) and c:IsRace(RACE_WARRIOR)
end
function cm.filter(c)
return c:IsAttackPos() and RD.IsCanChangePosition(c)
function cm.filter(c,e,tp)
return c:IsAttackPos() and RD.IsCanChangePosition(c,e,tp,REASON_EFFECT)
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(cm.confilter,tp,LOCATION_MZONE,0,1,nil)
end
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
local g=Duel.GetMatchingGroup(cm.filter,tp,0,LOCATION_MZONE,nil)
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,e,tp)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
end
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)
end)
end
\ No newline at end of file
......@@ -17,8 +17,8 @@ end
function cm.filter(c)
return c:IsFaceup() and c:IsRace(RACE_MACHINE)
end
function cm.posfilter(c)
return c:IsPosition(POS_FACEDOWN_DEFENSE) and RD.IsCanChangePosition(c)
function cm.posfilter(c,e,tp)
return c:IsPosition(POS_FACEDOWN_DEFENSE) and RD.IsCanChangePosition(c,e,tp,REASON_EFFECT)
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
......@@ -26,14 +26,15 @@ function cm.condition(e,tp,eg,ep,ev,re,r,rp)
end
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)
and Duel.IsExistingMatchingCard(cm.posfilter,tp,0,LOCATION_MZONE,1,nil) end
local g=Duel.GetMatchingGroup(cm.posfilter,tp,0,LOCATION_MZONE,nil)
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,e,tp)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local ct=Duel.GetMatchingGroupCount(cm.filter,tp,LOCATION_MZONE,0,nil)
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
local og=Duel.GetOperatedGroup()
og:ForEach(function(tc)
......
......@@ -16,19 +16,20 @@ end
function cm.confilter(c,tp)
return c:GetSummonPlayer()==tp and c:IsLevelAbove(5)
end
function cm.filter(c)
return c:IsFaceup() and c:IsRace(RACE_MACHINE) and RD.IsCanChangePosition(c)
function cm.filter(c,e,tp)
return c:IsFaceup() and c:IsRace(RACE_MACHINE) and RD.IsCanChangePosition(c,e,tp,REASON_EFFECT)
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(cm.confilter,1,nil,1-tp)
end
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
local g=Duel.GetMatchingGroup(cm.filter,tp,LOCATION_MZONE,0,nil)
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,e,tp)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
end
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
RD.AttachAtkDef(e,g:GetFirst(),1500,0,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
end
......
......@@ -24,7 +24,7 @@ function cm.condition(e,tp,eg,ep,ev,re,r,rp)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
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)
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -17,19 +17,20 @@ end
function cm.confilter(c)
return c:IsFaceup() and c:IsLevelAbove(7) and c:IsRace(RACE_PLANT)
end
function cm.posfilter(c)
return c:IsDefensePos() and RD.IsCanChangePosition(c)
function cm.posfilter(c,e,tp)
return c:IsDefensePos() and RD.IsCanChangePosition(c,e,tp,REASON_EFFECT)
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(cm.confilter,tp,LOCATION_MZONE,0,1,nil)
end
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
local g=Duel.GetMatchingGroup(cm.posfilter,tp,0,LOCATION_MZONE,nil)
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,e,tp)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
end
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
Duel.Recover(tp,g:GetFirst():GetBaseAttack(),REASON_EFFECT)
end
......
......@@ -19,20 +19,21 @@ end
function cm.costfilter(c)
return c:IsType(TYPE_MONSTER) and c:IsAbleToDeckOrExtraAsCost()
end
function cm.posfilter(c)
return c:IsPosition(POS_FACEUP_ATTACK) and c:IsLevelBelow(8) and RD.IsCanChangePosition(c) and c:IsCanTurnSet()
function cm.posfilter(c,e,tp)
return c:IsPosition(POS_FACEUP_ATTACK) and c:IsLevelBelow(8) and RD.IsCanChangePosition(c,e,tp,REASON_EFFECT) and c:IsCanTurnSet()
end
function cm.thfilter(c)
return c:IsCode(list[1]) and c:IsAbleToHand()
end
cm.cost=RD.CostSendGraveToDeck(cm.costfilter,3,3)
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
local g=Duel.GetMatchingGroup(cm.posfilter,tp,0,LOCATION_MZONE,nil)
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,e,tp)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
end
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
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)
......
......@@ -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)
local tc=g:GetFirst()
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)
end
end)
......
......@@ -16,20 +16,21 @@ end
function cm.costfilter(c)
return c:IsType(TYPE_MONSTER) and c:IsAbleToGraveAsCost()
end
function cm.filter(c)
return RD.IsCanChangePosition(c)
function cm.posfilter(c,e,tp)
return RD.IsCanChangePosition(c,e,tp,REASON_EFFECT)
end
function cm.exfilter(c)
return c:IsFaceup() and c:IsLevel(10)
end
cm.cost=RD.CostSendHandToGrave(cm.costfilter,1,1)
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
local g=Duel.GetMatchingGroup(cm.filter,tp,0,LOCATION_MZONE,nil)
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,e,tp)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
end
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
RD.CanDraw(aux.Stringid(m,1),tp,1)
end
......
......@@ -17,8 +17,8 @@ end
function cm.costfilter(c)
return c:IsRace(RACE_PLANT) and c:IsAbleToDeckOrExtraAsCost()
end
function cm.filter(c)
return c:IsAttackPos() and RD.IsCanChangePosition(c)
function cm.filter(c,e,tp)
return c:IsAttackPos() and RD.IsCanChangePosition(c,e,tp,REASON_EFFECT)
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
local c=Duel.GetAttackTarget()
......@@ -27,12 +27,12 @@ function cm.condition(e,tp,eg,ep,ev,re,r,rp)
end
cm.cost=RD.CostSendGraveToDeckBottom(cm.costfilter,2,2)
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
local g=Duel.GetMatchingGroup(cm.filter,tp,0,LOCATION_MZONE,nil)
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,e,tp)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,g:GetCount(),0,0)
end
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
RD.ChangePosition(g,POS_FACEUP_DEFENSE)
end
......
......@@ -23,20 +23,21 @@ end
function cm.confilter2(c,tp)
return c:GetSummonPlayer()==tp and c:IsFaceup() and c:IsLevelAbove(5)
end
function cm.filter(c)
return c:IsAttackPos() and RD.IsCanChangePosition(c)
function cm.filter(c,e,tp)
return c:IsAttackPos() and RD.IsCanChangePosition(c,e,tp,REASON_EFFECT)
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(cm.confilter1,tp,LOCATION_MZONE,0,1,nil)
and eg:IsExists(cm.confilter2,1,nil,1-tp)
end
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
local g=Duel.GetMatchingGroup(cm.filter,tp,0,LOCATION_MZONE,nil)
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,e,tp)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
end
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
Duel.Damage(1-tp,500,REASON_EFFECT)
end
......
......@@ -13,16 +13,17 @@ function cm.initial_effect(c)
c:RegisterEffect(e1)
end
--Position
function cm.posfilter(c)
return c:IsPosition(POS_FACEUP_ATTACK) and c:IsRace(RACE_WARRIOR) and RD.IsCanChangePosition(c)
function cm.posfilter(c,e,tp)
return c:IsPosition(POS_FACEUP_ATTACK) and c:IsRace(RACE_WARRIOR) and RD.IsCanChangePosition(c,e,tp,REASON_EFFECT)
end
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
local g=Duel.GetMatchingGroup(cm.posfilter,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
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,e,tp)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
end
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)
end)
end
\ No newline at end of file
......@@ -17,19 +17,20 @@ end
function cm.confilter(c)
return c:IsFaceup() and c:IsType(TYPE_NORMAL) and c:IsRace(RACE_PLANT)
end
function cm.posfilter(c)
return c:IsDefensePos() and RD.IsCanChangePosition(c)
function cm.posfilter(c,e,tp)
return c:IsDefensePos() and RD.IsCanChangePosition(c,e,tp,REASON_EFFECT)
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(cm.confilter,tp,LOCATION_MZONE,0,1,nil)
end
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
local g=Duel.GetMatchingGroup(cm.posfilter,tp,0,LOCATION_MZONE,nil)
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,e,tp)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
end
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
RD.CanDraw(aux.Stringid(m,1),tp,1)
end
......
......@@ -14,8 +14,8 @@ function cm.initial_effect(c)
c:RegisterEffect(e1)
end
--Activate
function cm.filter(c)
return c:IsAttackPos() and RD.IsCanChangePosition(c)
function cm.filter(c,e,tp)
return c:IsAttackPos() and RD.IsCanChangePosition(c,e,tp,REASON_EFFECT)
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
local c=Duel.GetAttackTarget()
......@@ -24,12 +24,13 @@ function cm.condition(e,tp,eg,ep,ev,re,r,rp)
end
cm.cost=RD.CostPayLP(600)
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
local g=Duel.GetMatchingGroup(cm.filter,tp,0,LOCATION_MZONE,nil)
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,e,tp)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
end
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)
end)
end
\ No newline at end of file
......@@ -13,19 +13,20 @@ function cm.initial_effect(c)
c:RegisterEffect(e1)
end
--Activate
function cm.filter(c)
return c:IsDefensePos() and RD.IsCanChangePosition(c)
function cm.filter(c,e,tp)
return c:IsDefensePos() and RD.IsCanChangePosition(c,e,tp,REASON_EFFECT)
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(Card.IsFaceup,tp,LOCATION_FZONE,LOCATION_FZONE,1,nil)
end
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
local g=Duel.GetMatchingGroup(cm.filter,tp,0,LOCATION_MZONE,nil)
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,e,tp)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
end
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
RD.CanDraw(aux.Stringid(m,1),tp,1)
end
......
......@@ -12,16 +12,17 @@ function cm.initial_effect(c)
c:RegisterEffect(e1)
end
--Activate
function cm.filter(c)
return c:IsDefensePos() and RD.IsCanChangePosition(c)
function cm.filter(c,e,tp)
return c:IsDefensePos() and RD.IsCanChangePosition(c,e,tp,REASON_EFFECT)
end
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
local g=Duel.GetMatchingGroup(cm.filter,tp,0,LOCATION_MZONE,nil)
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,e,tp)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
end
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)
end)
end
\ No newline at end of file
......@@ -26,7 +26,7 @@ end
cm.cost=RD.CostSendHandToGrave(cm.costfilter,1,1)
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
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.SetOperationInfo(0,CATEGORY_POSITION,tc,1,0,0)
end
......
......@@ -14,8 +14,8 @@ function cm.initial_effect(c)
c:RegisterEffect(e1)
end
--Activate
function cm.filter(c)
return c:IsAttackPos() and RD.IsCanChangePosition(c)
function cm.filter(c,e,tp)
return c:IsAttackPos() and RD.IsCanChangePosition(c,e,tp,REASON_EFFECT)
end
function cm.tdfilter(c)
return c:IsType(TYPE_MONSTER) and c:IsAbleToDeck()
......@@ -25,12 +25,13 @@ function cm.condition(e,tp,eg,ep,ev,re,r,rp)
end
cm.cost=RD.CostPayLP(1000)
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
local g=Duel.GetMatchingGroup(cm.filter,tp,LOCATION_MZONE,0,nil)
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,e,tp)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
end
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.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)
......
......@@ -14,9 +14,9 @@ function cm.initial_effect(c)
c:RegisterEffect(e1)
end
--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)
and RD.IsCanChangePosition(c)
and RD.IsCanChangePosition(c,e,tp,REASON_COST)
end
cm.cost=RD.CostChangePosition(cm.costfilter,1,1)
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
......
......@@ -12,17 +12,18 @@ function cm.initial_effect(c)
e2:SetCategory(CATEGORY_DESTROY)
end
--Position
function cm.posfilter(c)
return RD.IsCanChangePosition(c) and (not c:IsPosition(POS_FACEUP_ATTACK) or c:IsCanTurnSet())
function cm.posfilter(c,e,tp)
return RD.IsCanChangePosition(c,e,tp,REASON_EFFECT) and (not c:IsPosition(POS_FACEUP_ATTACK) or c:IsCanTurnSet())
end
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
local g=Duel.GetMatchingGroup(cm.posfilter,tp,0,LOCATION_MZONE,nil)
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,e,tp)
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
end
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 pos=POS_FACEUP_ATTACK+POS_FACEDOWN_DEFENSE
if tc:IsPosition(POS_FACEUP_ATTACK) then
......
......@@ -23,9 +23,9 @@ end
function cm.confilter2(c,tp)
return c:GetSummonPlayer()==tp
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)
and RD.IsCanChangePosition(c)
and RD.IsCanChangePosition(c,e,tp,REASON_EFFECT)
end
function cm.exfilter(c)
return c:IsType(TYPE_NORMAL)
......@@ -38,18 +38,19 @@ function cm.condition(e,tp,eg,ep,ev,re,r,rp)
and eg:IsExists(cm.confilter2,1,nil,1-tp)
end
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
local g=Duel.GetMatchingGroup(cm.filter,tp,LOCATION_MZONE,0,nil)
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,e,tp)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
end
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
local sg=Duel.GetMatchingGroup(cm.exfilter,tp,LOCATION_GRAVE,0,nil)
local race=RD.GroupBor(sg,Card.GetRace)
if race~=0 then
local filter=RD.Filter(cm.desfilter,race)
RD.CanSelectAndDoAction(aux.Stringid(m,1),HINTMSG_DESTROY,filter,tp,0,LOCATION_MZONE,1,1,nil,function(dg)
local desfilter=RD.Filter(cm.desfilter,race)
RD.CanSelectAndDoAction(aux.Stringid(m,1),HINTMSG_DESTROY,desfilter,tp,0,LOCATION_MZONE,1,1,nil,function(dg)
Duel.BreakEffect()
Duel.Destroy(dg,REASON_EFFECT)
end)
......
......@@ -13,21 +13,23 @@ function cm.initial_effect(c)
c:RegisterEffect(e1)
end
--Position
function cm.filter(c)
return RD.IsCanChangePosition(c)
function cm.filter(c,e,tp)
return RD.IsCanChangePosition(c,e,tp,REASON_EFFECT)
end
function cm.posfilter(c)
return c:IsFaceup() and RD.IsCanChangePosition(c)
function cm.posfilter(c,e,tp)
return c:IsFaceup() and RD.IsCanChangePosition(c,e,tp,REASON_EFFECT)
end
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
local g=Duel.GetMatchingGroup(cm.filter,tp,0,LOCATION_MZONE,nil)
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,e,tp)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
end
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
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)
end)
end
......
......@@ -34,17 +34,18 @@ function cm.splimit(e,c,tp,sumtp,sumpos)
return c:IsLevelBelow(9) and (sumpos&POS_ATTACK)>0
end
--Position
function cm.posfilter(c)
return RD.IsCanChangePosition(c)
function cm.posfilter(c,e,tp)
return RD.IsCanChangePosition(c,e,tp,REASON_EFFECT)
end
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
local g=Duel.GetMatchingGroup(cm.posfilter,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
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,e,tp)
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
end
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)
end)
end
\ No newline at end of file
......@@ -18,8 +18,8 @@ end
function cm.confilter(c)
return c:IsFaceup() and c:IsCode(list[1],list[2])
end
function cm.filter(c)
return c:IsFaceup() and RD.IsCanChangePosition(c)
function cm.filter(c,e,tp)
return c:IsFaceup() and RD.IsCanChangePosition(c,e,tp,REASON_EFFECT)
end
function cm.spfilter(c,e,tp)
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)
and Duel.GetAttacker():IsControler(1-tp) and Duel.GetAttackTarget()==nil
end
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
local g=Duel.GetMatchingGroup(cm.filter,tp,0,LOCATION_MZONE,nil)
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,e,tp)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,g:GetCount(),0,0)
end
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
RD.CanSelectAndSpecialSummon(aux.Stringid(m,1),aux.NecroValleyFilter(cm.spfilter),tp,LOCATION_GRAVE,0,1,1,nil,e,POS_FACEUP,true)
end
......
......@@ -18,8 +18,8 @@ function cm.confilter(c,tp,rp)
return RD.IsPreviousControler(c,tp) and c:IsPreviousLocation(LOCATION_MZONE)
and ((rp==1-tp and c:IsReason(REASON_EFFECT)) or c==Duel.GetAttackTarget())
end
function cm.filter(c)
return c:IsFaceup() and RD.IsCanChangePosition(c) and c:IsCanTurnSet()
function cm.filter(c,e,tp)
return c:IsFaceup() and RD.IsCanChangePosition(c,e,tp,REASON_EFFECT) and c:IsCanTurnSet()
end
function cm.exfilter(c,tp)
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)
return eg:IsExists(cm.confilter,1,nil,tp,rp) and Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)==0
end
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
local g=Duel.GetMatchingGroup(cm.filter,tp,0,LOCATION_MZONE,nil)
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,e,tp)
if eg:IsExists(cm.exfilter,1,nil,tp) then
e:SetLabel(1)
else
......@@ -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)
end
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
RD.CanSelectAndDoAction(aux.Stringid(m,1),HINTMSG_DESTROY,Card.IsFacedown,tp,0,LOCATION_ONFIELD,1,1,nil,function(sg)
Duel.Destroy(sg,REASON_EFFECT)
......
......@@ -17,17 +17,18 @@ function cm.costfilter(c,e,tp)
return c:IsFaceup() and c:IsRace(RACE_PLANT) and c:IsAbleToGraveAsCost()
and Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,c)
end
function cm.filter(c)
return c:IsDefensePos() and RD.IsCanChangePosition(c)
function cm.filter(c,e,tp)
return c:IsDefensePos() and RD.IsCanChangePosition(c,e,tp,REASON_EFFECT)
end
cm.cost=RD.CostSendMZoneToGrave(cm.costfilter,1,1,false)
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
local g=Duel.GetMatchingGroup(cm.filter,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
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,e,tp)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
end
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
RD.CanDraw(aux.Stringid(m,1),tp,1,true)
end
......
......@@ -29,7 +29,7 @@ end
cm.cost=RD.CostSendGraveToDeckBottom(cm.costfilter,1,1)
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
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.SetOperationInfo(0,CATEGORY_POSITION,tc,1,0,0)
end
......
......@@ -12,8 +12,8 @@ function cm.initial_effect(c)
c:RegisterEffect(e1)
end
--Activate
function cm.posfilter(c)
return c:IsDefensePos() and RD.IsCanChangePosition(c)
function cm.posfilter(c,e,tp)
return c:IsDefensePos() and RD.IsCanChangePosition(c,e,tp,REASON_EFFECT)
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetAttacker()
......@@ -22,7 +22,8 @@ function cm.condition(e,tp,eg,ep,ev,re,r,rp)
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
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()
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)
......
......@@ -16,8 +16,8 @@ end
function cm.exfilter(c)
return c:IsFaceup() and c:IsType(TYPE_NORMAL) and c:IsLevelAbove(7)
end
function cm.posfilter(c)
return c:IsAttackPos() and RD.IsCanChangePosition(c)
function cm.posfilter(c,e,tp)
return c:IsAttackPos() and RD.IsCanChangePosition(c,e,tp,REASON_EFFECT)
end
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
......@@ -27,7 +27,8 @@ end
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)
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)
end)
end
......
......@@ -15,8 +15,8 @@ end
function cm.filter(c)
return c:IsFaceup() and c:IsRace(RACE_GALAXY) and RD.IsCanAttachPierce(c)
end
function cm.posfilter(c)
return RD.IsCanChangePosition(c)
function cm.posfilter(c,e,tp)
return RD.IsCanChangePosition(c,e,tp,REASON_EFFECT)
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsAbleToEnterBP()
......@@ -29,7 +29,8 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=g:GetFirst()
RD.AttachPierce(e,tc,aux.Stringid(m,2),RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
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)
end)
end
......
......@@ -20,28 +20,30 @@ end
function cm.confilter(c,tp)
return c:GetSummonPlayer()==tp
end
function cm.filter(c)
return c:IsPosition(POS_FACEUP_ATTACK) and c:IsRace(RACE_INSECT) and RD.IsCanChangePosition(c)
function cm.filter(c,e,tp)
return c:IsPosition(POS_FACEUP_ATTACK) and c:IsRace(RACE_INSECT) and RD.IsCanChangePosition(c,e,tp,REASON_EFFECT)
end
function cm.exfilter(c)
return c:IsPosition(POS_FACEUP_DEFENSE)
end
function cm.posfilter(c)
return c:IsAttackPos() and RD.IsCanChangePosition(c)
function cm.posfilter(c,e,tp)
return c:IsAttackPos() and RD.IsCanChangePosition(c,e,tp,REASON_EFFECT)
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(cm.confilter,1,nil,1-tp)
end
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
local g=Duel.GetMatchingGroup(cm.filter,tp,LOCATION_MZONE,0,nil)
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,e,tp)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
end
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
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()
RD.ChangePosition(sg,POS_FACEUP_DEFENCE)
end)
......
......@@ -16,20 +16,21 @@ end
function cm.confilter(c,tp)
return c:GetSummonPlayer()==tp and c:IsLevelAbove(7)
end
function cm.filter(c)
function cm.filter(c,e,tp)
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
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(cm.confilter,1,nil,1-tp)
end
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
local g=Duel.GetMatchingGroup(cm.filter,tp,0,LOCATION_MZONE,nil)
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,e,tp)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
end
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)
end)
end
\ No newline at end of file
......@@ -17,20 +17,21 @@ end
function cm.costfilter(c)
return c:IsType(TYPE_MONSTER) and c:IsAbleToDeckOrExtraAsCost()
end
function cm.filter(c)
return c:IsPosition(POS_FACEDOWN_DEFENSE) and RD.IsCanChangePosition(c)
function cm.filter(c,e,tp)
return c:IsPosition(POS_FACEDOWN_DEFENSE) and RD.IsCanChangePosition(c,e,tp,REASON_EFFECT)
end
function cm.downfilter(c)
return c:IsFaceup() and RD.IsCanChangeDef(c)
end
cm.cost=RD.CostSendGraveToDeck(cm.costfilter,3,3)
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
local g=Duel.GetMatchingGroup(cm.filter,tp,0,LOCATION_MZONE,nil)
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,e,tp)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
end
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
local sg=Duel.GetMatchingGroup(cm.downfilter,tp,0,LOCATION_MZONE,nil)
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)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
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.SetOperationInfo(0,CATEGORY_POSITION,tc,1,0,0)
end
......
......@@ -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)
and tc:IsRelateToEffect(e)
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
RD.ChangePosition(tc,POS_FACEUP_DEFENSE)
end
......
......@@ -13,16 +13,16 @@ function cm.initial_effect(c)
c:RegisterEffect(e1)
end
--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)
and RD.IsCanChangePosition(c)
and RD.IsCanChangePosition(c,e,tp,REASON_COST)
end
function cm.filter(c)
return c:IsPosition(POS_FACEUP_DEFENSE) and c:IsRace(RACE_ZOMBIE)
end
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
local g=Duel.GetMatchingGroup(cm.costfilter,tp,LOCATION_MZONE,0,nil)
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,e,tp)
RD.ChangePosition(g,POS_FACEUP_DEFENSE)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
......
......@@ -17,8 +17,8 @@ function cm.initial_effect(c)
c:RegisterEffect(e1)
end
--Position
function cm.filter(c)
return c:IsAttackPos() and RD.IsCanChangePosition(c)
function cm.filter(c,e,tp)
return c:IsAttackPos() and RD.IsCanChangePosition(c,e,tp,REASON_EFFECT)
end
function cm.thfilter(c)
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)
end
cm.cost=RD.CostPayLP(700)
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
local g=Duel.GetMatchingGroup(cm.filter,tp,0,LOCATION_MZONE,nil)
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,e,tp)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
end
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
RD.CanSelectAndDoAction(aux.Stringid(m,1),HINTMSG_ATOHAND,aux.NecroValleyFilter(cm.thfilter),tp,LOCATION_GRAVE,0,1,1,nil,function(g)
Duel.BreakEffect()
......
......@@ -17,8 +17,8 @@ end
function cm.exfilter(c)
return c:GetSequence()<5
end
function cm.posfilter(c)
return c:IsFaceup() and c:IsType(TYPE_NORMAL) and RD.IsCanChangePosition(c) and c:IsCanTurnSet()
function cm.posfilter(c,e,tp)
return c:IsFaceup() and c:IsType(TYPE_NORMAL) and RD.IsCanChangePosition(c,e,tp,REASON_EFFECT) and c:IsCanTurnSet()
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return RD.IsSummonTurn(e:GetHandler())
......@@ -30,7 +30,8 @@ end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
if RD.SendDeckTopToGraveAndExists(tp,2)
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)
end)
end
......
......@@ -17,19 +17,20 @@ end
function cm.confilter(c,tp)
return c:GetSummonPlayer()==tp and c:IsFaceup() and c:IsSummonLocation(LOCATION_GRAVE)
end
function cm.filter(c)
return c:IsFaceup() and c:IsLevelBelow(8) and RD.IsCanChangePosition(c) and c:IsCanTurnSet()
function cm.filter(c,e,tp)
return c:IsFaceup() and c:IsLevelBelow(8) and RD.IsCanChangePosition(c,e,tp,REASON_EFFECT) and c:IsCanTurnSet()
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(cm.confilter,1,nil,1-tp)
end
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
local g=Duel.GetMatchingGroup(cm.filter,tp,0,LOCATION_MZONE,nil)
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,e,tp)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
end
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)
end)
end
\ No newline at end of file
......@@ -20,8 +20,8 @@ end
function cm.confilter(c,tp)
return c:GetSummonPlayer()==tp and c:IsFaceup()
end
function cm.posfilter(c)
return c:IsAttackPos() and RD.IsCanChangePosition(c)
function cm.posfilter(c,e,tp)
return c:IsAttackPos() and RD.IsCanChangePosition(c,e,tp,REASON_EFFECT)
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(cm.confilter,1,nil,1-tp)
......@@ -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)
Duel.BreakEffect()
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)
end)
end
......
......@@ -20,8 +20,8 @@ end
function cm.confilter(c,tp)
return c:GetSummonPlayer()==tp
end
function cm.filter(c)
return c:IsPosition(POS_FACEUP_ATTACK) and c:IsType(TYPE_NORMAL) and c:IsRace(RACE_GALAXY) and RD.IsCanChangePosition(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,e,tp,REASON_EFFECT)
end
function cm.deffilter(c)
return c:IsFaceup() and c:IsRace(RACE_GALAXY)
......@@ -30,12 +30,13 @@ function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(cm.confilter,1,nil,1-tp)
end
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
local g=Duel.GetMatchingGroup(cm.filter,tp,LOCATION_MZONE,0,nil)
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,e,tp)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
end
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
local def=Duel.GetMatchingGroupCount(cm.deffilter,tp,LOCATION_MZONE,0,nil)*500
local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_MZONE,0,nil)
......
......@@ -18,20 +18,21 @@ end
function cm.confilter(c)
return c:IsFaceup() and c:IsRace(RACE_MACHINE)
end
function cm.posfilter(c)
return c:IsFacedown() and RD.IsCanChangePosition(c)
function cm.posfilter(c,e,tp)
return c:IsFacedown() and RD.IsCanChangePosition(c,e,tp,REASON_EFFECT)
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetMatchingGroupCount(cm.confilter,tp,LOCATION_MZONE,0,nil)==3
end
cm.cost=RD.CostSendSelfToGrave()
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
local g=Duel.GetMatchingGroup(cm.posfilter,tp,0,LOCATION_MZONE,nil)
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,e,tp)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
end
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)
end)
end
\ No newline at end of file
......@@ -17,17 +17,18 @@ end
function cm.costfilter(c)
return c:IsRace(RACE_MACHINE) and c:IsAbleToGraveAsCost()
end
function cm.posfilter(c)
return c:IsPosition(POS_FACEUP_ATTACK) and c:IsLevelBelow(6) and RD.IsCanChangePosition(c) and c:IsCanTurnSet()
function cm.posfilter(c,e,tp)
return c:IsPosition(POS_FACEUP_ATTACK) and c:IsLevelBelow(6) and RD.IsCanChangePosition(c,e,tp,REASON_EFFECT) and c:IsCanTurnSet()
end
cm.cost=RD.CostSendHandToGrave(cm.costfilter,1,1)
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
local g=Duel.GetMatchingGroup(cm.posfilter,tp,0,LOCATION_MZONE,nil)
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,e,tp)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
end
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)
end)
end
\ No newline at end of file
......@@ -15,8 +15,8 @@ function cm.initial_effect(c)
end
--Position
cm.indval=RD.ValueEffectIndesType(0,TYPE_TRAP)
function cm.posfilter(c)
return c:IsFaceup() and RD.IsCanChangePosition(c) and c:IsCanTurnSet()
function cm.posfilter(c,e,tp)
return c:IsFaceup() and RD.IsCanChangePosition(c,e,tp,REASON_EFFECT) and c:IsCanTurnSet()
end
cm.cost=RD.CostSendHandToGrave(Card.IsAbleToGraveAsCost,1,1,nil,nil,function(g)
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)
end
end)
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
local g=Duel.GetMatchingGroup(cm.posfilter,tp,0,LOCATION_MZONE,nil)
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,e,tp)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
end
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
local c=e:GetHandler()
if c:IsFaceup() and c:IsRelateToEffect(e) then
......
......@@ -18,8 +18,8 @@ end
function cm.exfilter(c)
return c:IsFaceup() and c:IsLevel(8)
end
function cm.posfilter(c)
return c:IsFaceup() and c:IsRace(RACE_GALAXY) and RD.IsCanChangePosition(c)
function cm.posfilter(c,e,tp)
return c:IsFaceup() and c:IsRace(RACE_GALAXY) and RD.IsCanChangePosition(c,e,tp,REASON_EFFECT)
end
cm.cost=RD.CostChangeSelfPosition(POS_FACEUP_ATTACK,POS_FACEUP_DEFENSE)
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
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
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)
end)
end
......
......@@ -23,8 +23,8 @@ end
function cm.confilter2(c,tp)
return c:GetSummonPlayer()==tp and c:IsFaceup()
end
function cm.filter(c)
return c:IsFaceup() and c:IsLevelBelow(8) and RD.IsCanChangePosition(c) and c:IsCanTurnSet()
function cm.filter(c,e,tp)
return c:IsFaceup() and c:IsLevelBelow(8) and RD.IsCanChangePosition(c,e,tp,REASON_EFFECT) and c:IsCanTurnSet()
end
function cm.exfilter(c)
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)
and eg:IsExists(cm.confilter2,1,nil,1-tp)
end
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
local g=Duel.GetMatchingGroup(cm.filter,tp,0,LOCATION_MZONE,nil)
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,e,tp)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
end
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 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)
......
......@@ -18,20 +18,21 @@ end
function cm.costfilter(c)
return c:IsFaceup() and c:IsAttribute(ATTRIBUTE_DARK) and c:IsRace(RACE_FAIRY) and c:IsAbleToGraveAsCost()
end
function cm.filter(c)
return c:IsFacedown() and RD.IsCanChangePosition(c)
function cm.filter(c,e,tp)
return c:IsFacedown() and RD.IsCanChangePosition(c,e,tp,REASON_EFFECT)
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return RD.IsLPBelowOpponent(tp,1)
end
cm.cost=RD.CostSendMZoneToGrave(cm.costfilter,1,1,true)
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
local g=Duel.GetMatchingGroup(cm.filter,tp,0,LOCATION_MZONE,nil)
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,e,tp)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
end
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
local atk=g:GetFirst():GetBaseAttack()
if atk~=0 then
......
......@@ -18,8 +18,8 @@ end
function cm.confilter(c)
return c:IsFaceup() and c:IsLevelAbove(5) and c:IsAttribute(ATTRIBUTE_DARK)
end
function cm.posfilter(c)
return c:IsFaceup() and c:IsLevelBelow(8) and RD.IsCanChangePosition(c)
function cm.posfilter(c,e,tp)
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())
end
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
cm.cost=RD.CostPayLP(500)
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
local g=Duel.GetMatchingGroup(cm.posfilter,tp,0,LOCATION_MZONE,nil)
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,e,tp)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
end
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 pos=POS_FACEUP_ATTACK+POS_FACEDOWN_DEFENSE
if tc:IsPosition(POS_FACEUP_ATTACK) then
......
......@@ -13,24 +13,26 @@ function cm.initial_effect(c)
c:RegisterEffect(e1)
end
--Activate
function cm.posfilter(c)
return c:IsPosition(POS_FACEUP_ATTACK) and RD.IsCanChangePosition(c) and c:IsCanTurnSet()
function cm.posfilter(c,e,tp)
return c:IsPosition(POS_FACEUP_ATTACK) and RD.IsCanChangePosition(c,e,tp,REASON_EFFECT) and c:IsCanTurnSet()
end
function cm.exfilter(c)
return c:IsFacedown() and RD.IsCanChangePosition(c)
function cm.exfilter(c,e,tp)
return c:IsFacedown() and RD.IsCanChangePosition(c,e,tp,REASON_EFFECT)
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFieldGroupCount(tp,0,LOCATION_MZONE)==3
end
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
local g=Duel.GetMatchingGroup(cm.posfilter,tp,0,LOCATION_MZONE,nil)
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,e,tp)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,g:GetCount(),0,0)
end
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
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()
RD.ChangePosition(sg,POS_FACEUP_ATTACK)
end)
......
......@@ -31,7 +31,7 @@ end
cm.cost=RD.CostSendMZoneToGrave(cm.costfilter,1,1,false)
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
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.SetOperationInfo(0,CATEGORY_POSITION,tc,1,0,0)
end
......
......@@ -23,20 +23,21 @@ end
function cm.confilter2(c,tp)
return c:GetSummonPlayer()==tp and c:IsFaceup()
end
function cm.filter(c)
return c:IsFaceup() and c:IsLevelBelow(8) and RD.IsCanChangePosition(c) and c:IsCanTurnSet()
function cm.filter(c,e,tp)
return c:IsFaceup() and c:IsLevelBelow(8) and RD.IsCanChangePosition(c,e,tp,REASON_EFFECT) and c:IsCanTurnSet()
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(cm.confilter1,tp,LOCATION_MZONE,0,1,nil)
and eg:IsExists(cm.confilter2,1,nil,1-tp)
end
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
local g=Duel.GetMatchingGroup(cm.filter,tp,0,LOCATION_MZONE,nil)
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,e,tp)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
end
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)
end)
end
\ No newline at end of file
......@@ -17,8 +17,8 @@ end
function cm.confilter(c)
return c:IsAttribute(ATTRIBUTE_LIGHT) and c:IsRace(RACE_MACHINE)
end
function cm.posfilter(c)
return c:IsFaceup() and c:IsLevelBelow(4) and RD.IsCanChangePosition(c) and c:IsCanTurnSet()
function cm.posfilter(c,e,tp)
return c:IsFaceup() and c:IsLevelBelow(4) and RD.IsCanChangePosition(c,e,tp,REASON_EFFECT) and c:IsCanTurnSet()
end
function cm.spfilter(c,e,tp)
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)
return Duel.IsExistingMatchingCard(cm.confilter,tp,LOCATION_GRAVE,0,3,nil)
end
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
local g=Duel.GetMatchingGroup(cm.posfilter,tp,0,LOCATION_MZONE,nil)
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,e,tp)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
end
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
RD.CanSelectAndSpecialSummon(aux.Stringid(m,1),cm.spfilter,tp,LOCATION_HAND,0,1,1,nil,e,POS_FACEUP,true)
end
......
......@@ -25,8 +25,8 @@ end
function cm.spfilter(c,e,tp)
return c:IsLevel(4) and c:IsRace(RACE_SPELLCASTER) and RD.IsCanBeSpecialSummoned(c,e,tp,POS_FACEUP_ATTACK)
end
function cm.posfilter(c)
return c:IsAttackPos() and RD.IsCanChangePosition(c)
function cm.posfilter(c,e,tp)
return c:IsAttackPos() and RD.IsCanChangePosition(c,e,tp,REASON_EFFECT)
end
function cm.poscheck(g)
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)
end
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
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
local og=Duel.GetOperatedGroup()
og:ForEach(function(tc)
......
......@@ -14,17 +14,18 @@ function cm.initial_effect(c)
c:RegisterEffect(e1)
end
--Position
function cm.filter(c)
return c:IsAttackPos() and RD.IsCanChangePosition(c)
function cm.filter(c,e,tp)
return c:IsAttackPos() and RD.IsCanChangePosition(c,e,tp,REASON_EFFECT)
end
cm.cost=RD.CostSendHandToGrave(Card.IsAbleToGraveAsCost,1,1)
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
local g=Duel.GetMatchingGroup(cm.filter,tp,0,LOCATION_MZONE,nil)
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,e,tp)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
end
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
RD.AttachAtkDef(e,g:GetFirst(),0,-2000,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
end
......
......@@ -16,21 +16,22 @@ end
function cm.confilter(c,tp)
return c:GetSummonPlayer()==tp and c:IsLevelAbove(5)
end
function cm.filter(c)
return c:IsPosition(POS_FACEUP_ATTACK) and c:IsRace(RACE_DRAGON+RACE_MACHINE) and RD.IsCanChangePosition(c)
function cm.filter(c,e,tp)
return c:IsPosition(POS_FACEUP_ATTACK) and c:IsRace(RACE_DRAGON+RACE_MACHINE) and RD.IsCanChangePosition(c,e,tp,REASON_EFFECT)
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(cm.confilter,1,nil,1-tp)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
local tc=eg:GetFirst()
if chk==0 then return RD.IsCanChangePosition(tc)
and Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_MZONE,0,1,nil) end
if chk==0 then return RD.IsCanChangePosition(tc,e,tp,REASON_EFFECT)
and Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_MZONE,0,1,nil,e,tp) end
Duel.SetTargetCard(tc)
Duel.SetOperationInfo(0,CATEGORY_POSITION,nil,2,0,0)
end
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()
if tc:IsRelateToEffect(e) then
g:AddCard(tc)
......
......@@ -32,7 +32,7 @@ end
cm.cost=RD.CostSendGraveToDeck(cm.costfilter,2,2)
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
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.SetOperationInfo(0,CATEGORY_POSITION,tc,1,0,0)
end
......
......@@ -20,8 +20,8 @@ end
function cm.costfilter(c)
return c:IsType(TYPE_MONSTER) and c:IsAbleToDeckAsCost()
end
function cm.filter(c)
return RD.IsCanChangePosition(c)
function cm.filter(c,e,tp)
return RD.IsCanChangePosition(c,e,tp,REASON_EFFECT)
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
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)
Duel.SendtoDeck(g,nil,SEQ_DECKSHUFFLE,REASON_COST)
end
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
local g=Duel.GetMatchingGroup(cm.filter,tp,0,LOCATION_MZONE,nil)
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,e,tp)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,g:GetCount(),0,0)
end
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
RD.ChangePosition(g)
end
......
......@@ -28,7 +28,7 @@ function cm.condition(e,tp,eg,ep,ev,re,r,rp)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
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.SetOperationInfo(0,CATEGORY_POSITION,tc,1,0,0)
end
......
......@@ -17,8 +17,8 @@ end
function cm.confilter(c,tp)
return c:GetSummonPlayer()==tp and c:IsSummonLocation(LOCATION_HAND+LOCATION_GRAVE)
end
function cm.filter(c)
return c:IsFaceup() and c:IsLevelBelow(12) and RD.IsCanChangePosition(c) and c:IsCanTurnSet()
function cm.filter(c,e,tp)
return c:IsFaceup() and c:IsLevelBelow(12) and RD.IsCanChangePosition(c,e,tp,REASON_EFFECT) and c:IsCanTurnSet()
end
function cm.check(g,atk)
return g:GetSum(Card.GetLevel)<=12
......@@ -27,12 +27,13 @@ function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(cm.confilter,1,nil,1-tp)
end
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
local g=Duel.GetMatchingGroup(cm.filter,tp,0,LOCATION_MZONE,nil)
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,e,tp)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
end
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)
end)
end
\ No newline at end of file
......@@ -25,7 +25,7 @@ function cm.condition(e,tp,eg,ep,ev,re,r,rp)
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
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()
if RD.ChangePosition(tc)~=0 then
local dam=Duel.GetFieldGroupCount(tp,0,LOCATION_MZONE)*200
......
......@@ -20,19 +20,20 @@ end
function cm.confilter(c,tp)
return c:GetSummonPlayer()==tp and c:IsPosition(POS_FACEUP_ATTACK)
end
function cm.filter(c)
return c:IsAttackPos() and c:IsLevelBelow(8) and RD.IsCanChangePosition(c)
function cm.filter(c,e,tp)
return c:IsAttackPos() and c:IsLevelBelow(8) and RD.IsCanChangePosition(c,e,tp,REASON_EFFECT)
end
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
end
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
local g=Duel.GetMatchingGroup(cm.filter,tp,0,LOCATION_MZONE,nil)
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,e,tp)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
end
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)
end)
end
\ No newline at end of file
......@@ -28,8 +28,8 @@ function cm.spcon(e,c)
and Duel.IsExistingMatchingCard(cm.spconfilter,tp,LOCATION_ONFIELD,0,1,nil)
end
--Atk Up
function cm.costfilter(c)
return c:IsFaceup() and RD.IsCanChangePosition(c)
function cm.costfilter(c,e,tp)
return c:IsFaceup() and RD.IsCanChangePosition(c,e,tp,REASON_COST)
end
function cm.filter(c)
return c:IsFaceup() and c:IsCode(list[1])
......
......@@ -21,8 +21,8 @@ end
function cm.exfilter(c)
return RD.IsLegendCode(c,list[1])
end
function cm.posfilter(c)
return RD.IsCanChangePosition(c)
function cm.posfilter(c,e,tp)
return RD.IsCanChangePosition(c,e,tp,REASON_EFFECT)
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
......@@ -36,7 +36,8 @@ end
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
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)
end)
end
......
......@@ -24,8 +24,8 @@ end
function cm.costfilter(c)
return c:IsRace(RACE_PSYCHO) and c:IsAbleToDeckOrExtraAsCost()
end
function cm.filter(c)
return c:IsFaceup() and c:IsLevelBelow(8) and RD.IsCanChangePosition(c) and c:IsCanTurnSet()
function cm.filter(c,e,tp)
return c:IsFaceup() and c:IsLevelBelow(8) and RD.IsCanChangePosition(c,e,tp,REASON_EFFECT) and c:IsCanTurnSet()
end
function cm.spfilter(c,e,tp)
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)
end
cm.cost=RD.CostSendGraveToDeck(cm.costfilter,2,2)
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
local g=Duel.GetMatchingGroup(cm.filter,tp,0,LOCATION_MZONE,nil)
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,e,tp)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
end
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
RD.CanSelectAndSpecialSummon(aux.Stringid(m,1),aux.NecroValleyFilter(cm.spfilter),tp,LOCATION_GRAVE,0,1,1,nil,e,POS_FACEUP,true)
end
......
......@@ -16,8 +16,8 @@ end
function cm.costfilter(c)
return c:IsFaceup() and c:IsRace(RACE_BEASTWARRIOR) and c:GetBaseAttack()>0 and c:IsAbleToGraveAsCost()
end
function cm.posfilter(c)
return RD.IsCanChangePosition(c)
function cm.posfilter(c,e,tp)
return RD.IsCanChangePosition(c,e,tp,REASON_EFFECT)
end
cm.cost=RD.CostSendMZoneToGrave(cm.costfilter,1,1,true,function(g)
return g:GetSum(Card.GetBaseAttack)
......@@ -28,7 +28,8 @@ function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local atk=e:GetLabel()
RD.AttachAtkDef(e,c,atk,0,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
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)
end)
end
......
......@@ -22,8 +22,8 @@ end
function cm.costfilter(c)
return c:IsCode(list[1],list[2]) and c:IsAbleToDeckAsCost()
end
function cm.posfilter(c)
return RD.IsCanChangePosition(c)
function cm.posfilter(c,e,tp)
return RD.IsCanChangePosition(c,e,tp,REASON_EFFECT)
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(cm.confilter,1,nil,1-tp)
......@@ -44,7 +44,8 @@ end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=eg:GetFirst()
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)
end)
end
......
......@@ -22,7 +22,7 @@ function cm.condition(e,tp,eg,ep,ev,re,r,rp)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
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)
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -23,7 +23,7 @@ end
cm.cost=RD.CostSendMZoneToHand(cm.costfilter,1,1)
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
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)
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -18,20 +18,21 @@ end
function cm.confilter(c)
return c:IsFaceup() and c:IsRace(RACE_REPTILE)
end
function cm.posfilter(c)
return c:IsFacedown() and RD.IsCanChangePosition(c)
function cm.posfilter(c,e,tp)
return c:IsFacedown() and RD.IsCanChangePosition(c,e,tp,REASON_EFFECT)
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(cm.confilter,tp,LOCATION_MZONE,0,1,e:GetHandler())
end
cm.cost=RD.CostPayLP(300)
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
local g=Duel.GetMatchingGroup(cm.posfilter,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
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,e,tp)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
end
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()
if RD.ChangePosition(g,POS_FACEUP_ATTACK)~=0 and c:IsFaceup() and c:IsRelateToEffect(e) then
Duel.BreakEffect()
......
......@@ -25,8 +25,8 @@ end
function cm.confilter2(c,tp)
return c:GetSummonPlayer()==tp
end
function cm.filter(c)
return c:IsFaceup() and RD.IsCanChangePosition(c) and c:IsCanTurnSet()
function cm.filter(c,e,tp)
return c:IsFaceup() and RD.IsCanChangePosition(c,e,tp,REASON_EFFECT) and c:IsCanTurnSet()
end
function cm.exfilter(c)
return c:IsFaceup() and c:IsCode(list[1])
......@@ -36,12 +36,13 @@ function cm.condition(e,tp,eg,ep,ev,re,r,rp)
and eg:IsExists(cm.confilter2,1,nil,1-tp)
end
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
local g=Duel.GetMatchingGroup(cm.filter,tp,0,LOCATION_MZONE,nil)
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,e,tp)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
end
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 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)
......
......@@ -19,8 +19,8 @@ end
function cm.costfilter(c)
return c:IsRace(RACE_DRAGON) and c:IsAbleToGraveAsCost()
end
function cm.posfilter(c)
return c:IsFacedown() and RD.IsCanChangePosition(c)
function cm.posfilter(c,e,tp)
return c:IsFacedown() and RD.IsCanChangePosition(c,e,tp,REASON_EFFECT)
end
function cm.exfilter1(c)
return c:IsFaceup() and c:IsRace(RACE_DRAGON)
......@@ -33,12 +33,13 @@ function cm.spfilter(c,e,tp)
end
cm.cost=RD.CostSendHandToGrave(cm.costfilter,1,1)
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
local g=Duel.GetMatchingGroup(cm.posfilter,tp,0,LOCATION_MZONE,nil)
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,e,tp)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
end
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 Duel.IsExistingMatchingCard(cm.exfilter1,tp,LOCATION_MZONE,0,1,nil)
and not Duel.IsExistingMatchingCard(cm.exfilter2,tp,LOCATION_MZONE,0,1,nil) then
......
......@@ -19,8 +19,8 @@ end
function cm.costfilter(c)
return c:IsRace(RACE_DRAGON) and c:IsAbleToGraveAsCost()
end
function cm.posfilter(c)
return c:IsAttackPos() and RD.IsCanChangePosition(c) and c:IsCanTurnSet()
function cm.posfilter(c,e,tp)
return c:IsAttackPos() and RD.IsCanChangePosition(c,e,tp,REASON_EFFECT) and c:IsCanTurnSet()
end
function cm.exfilter1(c)
return c:IsFaceup() and c:IsRace(RACE_DRAGON)
......@@ -33,12 +33,13 @@ function cm.spfilter(c,e,tp)
end
cm.cost=RD.CostSendHandToGrave(cm.costfilter,1,1)
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
local g=Duel.GetMatchingGroup(cm.posfilter,tp,0,LOCATION_MZONE,nil)
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,e,tp)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
end
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
and Duel.IsExistingMatchingCard(cm.exfilter1,tp,LOCATION_MZONE,0,1,nil)
and not Duel.IsExistingMatchingCard(cm.exfilter2,tp,LOCATION_MZONE,0,1,nil) then
......
......@@ -17,17 +17,18 @@ end
function cm.costfilter(c)
return c:IsRace(RACE_WYRM) and c:IsAbleToDeckOrExtraAsCost()
end
function cm.posfilter(c)
return c:IsFaceup() and c:IsLevelBelow(9) and RD.IsCanChangePosition(c) and c:IsCanTurnSet()
function cm.posfilter(c,e,tp)
return c:IsFaceup() and c:IsLevelBelow(9) and RD.IsCanChangePosition(c,e,tp,REASON_EFFECT) and c:IsCanTurnSet()
end
cm.cost=RD.CostSendGraveToDeck(cm.costfilter,2,2)
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
local g=Duel.GetMatchingGroup(cm.posfilter,tp,0,LOCATION_MZONE,nil)
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,e,tp)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
end
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
Duel.BreakEffect()
Duel.ConfirmDecktop(1-tp,3)
......
......@@ -19,19 +19,20 @@ end
function cm.confilter(c)
return c:IsCode(list[1]) or (c:IsAttribute(ATTRIBUTE_DARK) and RD.IsDefense(c,1200))
end
function cm.posfilter(c)
return c:IsFaceup() and c:IsLevelBelow(8) and RD.IsCanChangePosition(c) and c:IsCanTurnSet()
function cm.posfilter(c,e,tp)
return c:IsFaceup() and c:IsLevelBelow(8) and RD.IsCanChangePosition(c,e,tp,REASON_EFFECT) and c:IsCanTurnSet()
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(cm.confilter,tp,LOCATION_GRAVE,0,1,nil)
end
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
local g=Duel.GetMatchingGroup(cm.posfilter,tp,0,LOCATION_MZONE,nil)
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,e,tp)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
end
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)
end)
end
\ No newline at end of file
......@@ -19,8 +19,9 @@ end
function cm.costfilter2(c)
return c:IsLevelAbove(7) and c:IsAttribute(ATTRIBUTE_LIGHT) and c:IsRace(RACE_FIEND) and c:IsAbleToDeckOrExtraAsCost()
end
function cm.filter(c)
return c:IsPosition(POS_FACEUP_ATTACK) and c:IsAttribute(ATTRIBUTE_LIGHT) and c:IsRace(RACE_FIEND) and RD.IsCanChangePosition(c)
function cm.filter(c,e,tp)
return c:IsPosition(POS_FACEUP_ATTACK) and c:IsAttribute(ATTRIBUTE_LIGHT) and c:IsRace(RACE_FIEND)
and RD.IsCanChangePosition(c,e,tp,REASON_EFFECT)
end
cm.cost=RD.CostChooseAction(HINTMSG_TOGRAVE,HINTMSG_TODECK,aux.Stringid(m,1),
cm.costfilter1,nil,LOCATION_HAND,1,function(g)
......@@ -30,12 +31,13 @@ cm.costfilter2,nil,LOCATION_GRAVE,3,function(g)
Duel.SendtoDeck(g,nil,SEQ_DECKSHUFFLE,REASON_COST)
end)
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
local g=Duel.GetMatchingGroup(cm.filter,tp,LOCATION_MZONE,0,nil)
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,e,tp)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
end
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
RD.CanDraw(aux.Stringid(m,2),tp,2,true)
end
......
......@@ -17,18 +17,20 @@ end
function cm.costfilter(c)
return c:IsAttribute(ATTRIBUTE_LIGHT) and c:IsAbleToDeckOrExtraAsCost()
end
function cm.posfilter(c)
return c:IsPosition(POS_FACEUP_ATTACK) and c:IsLevelAbove(7) and RD.IsCanChangePosition(c) and c:IsCanTurnSet()
function cm.posfilter(c,e,tp)
return c:IsPosition(POS_FACEUP_ATTACK) and c:IsLevelAbove(7)
and RD.IsCanChangePosition(c,e,tp,REASON_EFFECT) and c:IsCanTurnSet()
end
cm.cost=RD.CostSendGraveToDeck(cm.costfilter,2,2)
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)
if chk==0 then return Duel.IsExistingMatchingCard(cm.posfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil,e,tp)
and Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>2 and Duel.GetFieldGroupCount(tp,0,LOCATION_DECK)>2 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)
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
RD.SelectAndDoAction(HINTMSG_SET,cm.posfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil,function(g)
local filter=RD.Filter(cm.posfilter,e,tp)
RD.SelectAndDoAction(HINTMSG_SET,filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil,function(g)
if RD.ChangePosition(g,POS_FACEDOWN_DEFENSE)~=0 then
Duel.BreakEffect()
Duel.ConfirmDecktop(tp,3)
......
......@@ -16,20 +16,21 @@ end
function cm.costfilter(c)
return c:IsType(TYPE_MONSTER) and c:IsAbleToDeckOrExtraAsCost()
end
function cm.filter(c)
return RD.IsCanChangePosition(c) and (not c:IsPosition(POS_FACEUP_ATTACK) or c:IsCanTurnSet())
function cm.filter(c,e,tp)
return RD.IsCanChangePosition(c,e,tp,REASON_EFFECT) and (not c:IsPosition(POS_FACEUP_ATTACK) or c:IsCanTurnSet())
end
function cm.spfilter(c)
return c:IsLevelBelow(9) and c:IsAttribute(ATTRIBUTE_EARTH+ATTRIBUTE_DARK) and c:IsRace(RACE_MACHINE)
end
cm.cost=RD.CostSendGraveToDeck(cm.costfilter,2,2)
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
local g=Duel.GetMatchingGroup(cm.filter,tp,0,LOCATION_MZONE,nil)
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,e,tp)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
end
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)
local tc=g:GetFirst()
local pos=POS_FACEUP_ATTACK+POS_FACEDOWN_DEFENSE
if tc:IsPosition(POS_FACEUP_ATTACK) then
......
......@@ -33,8 +33,8 @@ end
function cm.costfilter(c)
return c:IsRace(RACE_ROCK) and c:IsAbleToDeckOrExtraAsCost()
end
function cm.filter(c)
return c:IsFaceup() and RD.IsCanChangePosition(c) and c:IsCanTurnSet()
function cm.filter(c,e,tp)
return c:IsFaceup() and RD.IsCanChangePosition(c,e,tp,REASON_EFFECT) and c:IsCanTurnSet()
end
function cm.condition1(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(cm.confilter,1,nil,1-tp)
......@@ -44,12 +44,13 @@ function cm.condition2(e,tp,eg,ep,ev,re,r,rp)
end
cm.cost=RD.CostSendGraveToDeck(cm.costfilter,3,3)
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
local g=Duel.GetMatchingGroup(cm.filter,tp,0,LOCATION_MZONE,nil)
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,e,tp)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
end
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)
end)
end
\ No newline at end of file
......@@ -20,8 +20,8 @@ end
function cm.costfilter(c,e,tp)
return not c:IsPublic() and c:IsRace(RACE_FAIRY) and c:IsAttack(0)
end
function cm.filter(c,tp)
return (c:IsFaceup() or c:IsControler(1-tp)) and RD.IsCanChangePosition(c)
function cm.filter(c,e,tp)
return (c:IsFaceup() or c:IsControler(1-tp)) and RD.IsCanChangePosition(c,e,tp,REASON_EFFECT)
end
function cm.thfilter(c)
return c:IsCode(list[1]) and c:IsAbleToHand()
......@@ -31,12 +31,12 @@ function cm.condition(e,tp,eg,ep,ev,re,r,rp)
end
cm.cost=RD.CostShowHand(cm.costfilter,1,1)
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,tp) end
local g=Duel.GetMatchingGroup(cm.filter,tp,LOCATION_MZONE,LOCATION_MZONE,nil,tp)
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,e,tp)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local filter=RD.Filter(cm.filter,tp)
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)~=0 then
RD.CanSelectAndDoAction(aux.Stringid(m,1),HINTMSG_ATOHAND,aux.NecroValleyFilter(cm.thfilter),tp,LOCATION_GRAVE,0,1,1,nil,function(sg)
......
......@@ -23,20 +23,21 @@ end
function cm.confilter2(c,tp)
return c:GetSummonPlayer()==tp
end
function cm.filter(c)
return RD.IsCanChangePosition(c)
function cm.filter(c,e,tp)
return RD.IsCanChangePosition(c,e,tp,REASON_EFFECT)
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(cm.confilter1,tp,LOCATION_MZONE,0,1,nil)
and eg:IsExists(cm.confilter2,1,nil,1-tp)
end
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
local g=Duel.GetMatchingGroup(cm.filter,tp,0,LOCATION_MZONE,nil)
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,e,tp)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
end
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)
local e1=RD.AttachCannotTrigger(e,g:GetFirst(),aux.Stringid(m,1),RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
e1:SetCondition(function(e)
......
......@@ -21,8 +21,8 @@ end
function cm.confilter(c,tp)
return c:GetSummonPlayer()==tp
end
function cm.filter(c)
return c:IsFaceup() and c:IsType(TYPE_EFFECT) and RD.IsCanChangePosition(c) and c:IsCanTurnSet()
function cm.filter(c,e,tp)
return c:IsFaceup() and c:IsType(TYPE_EFFECT) and RD.IsCanChangePosition(c,e,tp,REASON_EFFECT) and c:IsCanTurnSet()
end
function cm.exfilter(c,tp)
return c:IsControler(1-tp) and c:GetBaseAttack()>=2600
......@@ -32,12 +32,13 @@ function cm.condition(e,tp,eg,ep,ev,re,r,rp)
end
cm.cost=RD.CostSendHandToGrave(Card.IsAbleToGraveAsCost,1,1)
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
local g=Duel.GetMatchingGroup(cm.filter,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
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,e,tp)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
RD.SelectAndDoAction(HINTMSG_SET,cm.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,2,nil,function(g)
local filter=RD.Filter(cm.filter,e,tp)
RD.SelectAndDoAction(HINTMSG_SET,filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,2,nil,function(g)
local ex=g:IsExists(cm.exfilter,1,nil,tp)
if RD.ChangePosition(g,POS_FACEDOWN_DEFENSE)~=0 and ex then
Duel.Recover(tp,1500,REASON_EFFECT)
......
......@@ -28,7 +28,7 @@ end
cm.cost=RD.CostSendMZoneToGrave(cm.costfilter,1,1,false)
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return RD.IsPlayerCanActivateTrapBattle(1-tp) and RD.IsCanChangePosition(c) and c:IsCanTurnSet() end
if chk==0 then return RD.IsPlayerCanActivateTrapBattle(1-tp) and RD.IsCanChangePosition(c,e,tp,REASON_EFFECT) and c:IsCanTurnSet() end
Duel.SetOperationInfo(0,CATEGORY_POSITION,c,1,0,0)
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -18,8 +18,8 @@ end
function cm.filter(c)
return c:IsFaceup() and c:IsAttribute(ATTRIBUTE_DARK) and c:IsRace(RACE_GALAXY) and RD.IsCanAttachPierce(c)
end
function cm.posfilter(c)
return c:IsFaceup() and RD.IsCanChangePosition(c)
function cm.posfilter(c,e,tp)
return c:IsFaceup() and RD.IsCanChangePosition(c,e,tp,REASON_EFFECT)
and (not c:IsPosition(POS_FACEUP_DEFENSE) or c:IsCanTurnSet())
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
......@@ -32,7 +32,8 @@ end
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.AttachPierce(e,g:GetFirst(),aux.Stringid(m,2),RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
RD.CanSelectAndDoAction(aux.Stringid(m,3),HINTMSG_POSCHANGE,cm.posfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil,function(g)
local filter=RD.Filter(cm.posfilter,e,tp)
RD.CanSelectAndDoAction(aux.Stringid(m,3),HINTMSG_POSCHANGE,filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil,function(g)
local tc=g:GetFirst()
local pos=POS_FACEUP_DEFENSE+POS_FACEDOWN_DEFENSE
if tc:IsPosition(POS_FACEUP_DEFENSE) then
......
......@@ -15,8 +15,8 @@ function cm.initial_effect(c)
c:RegisterEffect(e1)
end
--Confirm
function cm.costfilter(c)
return c:IsFaceup() and c:IsLevelAbove(7) and c:IsRace(RACE_DRAGON) and RD.IsCanChangePosition(c)
function cm.costfilter(c,e,tp)
return c:IsFaceup() and c:IsLevelAbove(7) and c:IsRace(RACE_DRAGON) and RD.IsCanChangePosition(c,e,tp,REASON_COST)
end
function cm.filter(c)
return c:IsFacedown() and c:GetSequence()<5
......
......@@ -24,20 +24,21 @@ end
function cm.costfilter(c)
return c:IsRace(RACE_CYBERSE) and c:IsAbleToDeckOrExtraAsCost()
end
function cm.filter(c)
return c:IsFaceup() and c:IsLevelBelow(9) and RD.IsCanChangePosition(c) and c:IsCanTurnSet()
function cm.filter(c,e,tp)
return c:IsFaceup() and c:IsLevelBelow(9) and RD.IsCanChangePosition(c,e,tp,REASON_EFFECT) and c:IsCanTurnSet()
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(cm.confilter,1,nil,1-tp)
end
cm.cost=RD.CostSendGraveToDeck(cm.costfilter,2,2)
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
local g=Duel.GetMatchingGroup(cm.filter,tp,0,LOCATION_MZONE,nil)
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,e,tp)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
end
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
RD.CanSelectAndDoAction(aux.Stringid(m,1),HINTMSG_TODECK,aux.NecroValleyFilter(Card.IsAbleToDeck),tp,0,LOCATION_GRAVE,1,1,nil,function(g)
Duel.BreakEffect()
......
......@@ -26,7 +26,7 @@ end
cm.cost=RD.CostSendGraveToDeck(cm.costfilter,2,4)
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
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)
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -13,19 +13,19 @@ function cm.initial_effect(c)
c:RegisterEffect(e1)
end
--Activate
function cm.filter(c)
return c:IsFaceup() and RD.IsCanChangePosition(c) and c:IsCanTurnSet()
function cm.filter(c,e,tp)
return c:IsFaceup() and RD.IsCanChangePosition(c,e,tp,REASON_EFFECT) and c:IsCanTurnSet()
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetAttacker():IsControler(1-tp)
end
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
local g=Duel.GetMatchingGroup(cm.filter,tp,0,LOCATION_MZONE,nil)
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,e,tp)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,g:GetCount(),0,0)
end
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
RD.ChangePosition(g,POS_FACEDOWN_DEFENSE)
end
......
......@@ -13,8 +13,8 @@ function cm.initial_effect(c)
c:RegisterEffect(e1)
end
--Atk Up
function cm.posfilter(c)
return RD.IsCanChangePosition(c) and (c:IsFacedown() or c:IsCanTurnSet())
function cm.posfilter(c,e,tp)
return RD.IsCanChangePosition(c,e,tp,REASON_EFFECT) and (c:IsFacedown() or c:IsCanTurnSet())
end
cm.cost=RD.CostSendHandOrFieldToGrave(Card.IsAbleToGraveAsCost,1,1,true,nil,nil,function(g)
return g:GetFirst():GetBaseAttack()
......@@ -25,7 +25,8 @@ function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local atk=e:GetLabel()
RD.AttachAtkDef(e,c,1500,0,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END+RESET_OPPO_TURN)
if atk==100 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)
local tc=g:GetFirst()
local pos=POS_FACEUP_ATTACK+POS_FACEDOWN_DEFENSE
if tc:IsPosition(POS_FACEUP_ATTACK) then
......
......@@ -19,20 +19,21 @@ end
function cm.costfilter(c)
return c:IsRace(RACE_GALAXY) and c:IsAbleToDeckOrExtraAsCost()
end
function cm.filter(c)
return RD.IsCanChangePosition(c) and (not c:IsPosition(POS_FACEUP_ATTACK) or c:IsCanTurnSet())
function cm.filter(c,e,tp)
return RD.IsCanChangePosition(c,e,tp,REASON_EFFECT) and (not c:IsPosition(POS_FACEUP_ATTACK) or c:IsCanTurnSet())
end
function cm.thfilter(c)
return c:IsCode(list[1]) and c:IsAbleToHand()
end
cm.cost=RD.CostSendGraveToDeck(cm.costfilter,3,3)
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
local g=Duel.GetMatchingGroup(cm.filter,tp,0,LOCATION_MZONE,nil)
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,e,tp)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
end
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)
local tc=g:GetFirst()
local pos=POS_FACEUP_ATTACK+POS_FACEDOWN_DEFENSE
if tc:IsPosition(POS_FACEUP_ATTACK) then
......
......@@ -33,7 +33,7 @@ function cm.operation(e,tp,eg,ep,ev,re,r,rp)
if RD.SelectAndSpecialSummon(aux.NecroValleyFilter(cm.spfilter),tp,LOCATION_GRAVE,0,1,1,nil,e,POS_FACEDOWN_DEFENSE)~=0 then
local c=e:GetHandler()
if c:IsFaceup() and c:IsRelateToEffect(e)
and RD.IsCanChangePosition(c) and c:IsCanTurnSet()
and RD.IsCanChangePosition(c,e,tp,REASON_EFFECT) and c:IsCanTurnSet()
and Duel.SelectEffectYesNo(tp,c,aux.Stringid(m,1)) then
Duel.BreakEffect()
RD.ChangePosition(c,POS_FACEDOWN_DEFENSE)
......
......@@ -20,19 +20,20 @@ function cm.initial_effect(c)
c:RegisterEffect(e1)
end
--Position
function cm.posfilter(c)
return c:IsFaceup() and RD.IsCanChangePosition(c) and c:IsCanTurnSet()
function cm.posfilter(c,e,tp)
return c:IsFaceup() and RD.IsCanChangePosition(c,e,tp,REASON_EFFECT) and c:IsCanTurnSet()
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return RD.IsSpecialSummonTurn(e:GetHandler())
end
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
local g=Duel.GetMatchingGroup(cm.posfilter,tp,0,LOCATION_MZONE,nil)
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,e,tp)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
end
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)
end)
local c=e:GetHandler()
......
......@@ -16,19 +16,20 @@ end
function cm.confilter(c,tp)
return c:GetSummonPlayer()==tp
end
function cm.filter(c)
return c:IsAttackPos() and RD.IsCanChangePosition(c)
function cm.filter(c,e,tp)
return c:IsAttackPos() and RD.IsCanChangePosition(c,e,tp,REASON_EFFECT)
end
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
end
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
local g=Duel.GetMatchingGroup(cm.filter,tp,0,LOCATION_MZONE,nil)
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,e,tp)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
RD.SelectAndDoAction(HINTMSG_POSCHANGE,cm.filter,tp,0,LOCATION_MZONE,1,3,nil,function(g)
local filter=RD.Filter(cm.filter,e,tp)
RD.SelectAndDoAction(HINTMSG_POSCHANGE,filter,tp,0,LOCATION_MZONE,1,3,nil,function(g)
RD.ChangePosition(g,POS_FACEUP_DEFENSE)
g:ForEach(function(tc)
local e1=RD.AttachCannotTribute(e,tc,cm.sumlimit,aux.Stringid(m,1),RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
......
......@@ -17,8 +17,8 @@ end
function cm.chainfilter(re,tp,cid)
return not (re:IsHasType(EFFECT_TYPE_ACTIVATE) and re:IsActiveType(TYPE_TRAP))
end
function cm.filter(c)
return RD.IsCanChangePosition(c) and (not c:IsPosition(POS_FACEUP_ATTACK) or c:IsCanTurnSet())
function cm.filter(c,e,tp)
return RD.IsCanChangePosition(c,e,tp,REASON_EFFECT) and (not c:IsPosition(POS_FACEUP_ATTACK) or c:IsCanTurnSet())
end
function cm.excon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCustomActivityCount(m,1-tp,ACTIVITY_CHAIN)~=0 or Duel.GetTurnCount()==2
......@@ -28,16 +28,17 @@ function cm.condition(e,tp,eg,ep,ev,re,r,rp)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
local ex=cm.excon(e,tp,eg,ep,ev,re,r,rp)
if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,0,LOCATION_MZONE,1,nil)
if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,0,LOCATION_MZONE,1,nil,e,tp)
and (not ex or (Duel.IsPlayerCanDraw(tp,2) and Duel.IsPlayerCanDraw(1-tp,2))) 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)
if ex then
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,PLAYER_ALL,2)
end
end
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)
local tc=g:GetFirst()
local pos=POS_FACEUP_ATTACK+POS_FACEDOWN_DEFENSE
if tc:IsPosition(POS_FACEUP_ATTACK) then
......
......@@ -15,8 +15,8 @@ function cm.initial_effect(c)
end
--Position
cm.indval=RD.ValueEffectIndesType(0,TYPE_TRAP)
function cm.posfilter(c)
return c:IsFaceup() and RD.IsCanChangePosition(c) and c:IsCanTurnSet()
function cm.posfilter(c,e,tp)
return c:IsFaceup() and RD.IsCanChangePosition(c,e,tp,REASON_EFFECT) and c:IsCanTurnSet()
end
cm.cost=RD.CostSendHandToGrave(Card.IsAbleToGraveAsCost,1,1,nil,nil,function(g)
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)
end
end)
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
local g=Duel.GetMatchingGroup(cm.posfilter,tp,0,LOCATION_MZONE,nil)
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,e,tp)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
end
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
local c=e:GetHandler()
if c:IsFaceup() and c:IsRelateToEffect(e) then
......
......@@ -26,7 +26,7 @@ function cm.condition(e,tp,eg,ep,ev,re,r,rp)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
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.SetOperationInfo(0,CATEGORY_POSITION,tc,1,0,0)
end
......
local m=120277011
local cm=_G["c"..m]
cm.name="宇宙苯基翼"
function cm.initial_effect(c)
--Atk Up
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetValue(cm.atkval)
c:RegisterEffect(e1)
--Cannot Change Position
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_CANNOT_CHANGE_POSITION_EFFECT)
e2:SetRange(LOCATION_MZONE)
e2:SetTargetRange(LOCATION_MZONE,0)
e2:SetTarget(cm.postg)
e2:SetValue(cm.posval)
c:RegisterEffect(e2)
--Continuous Effect
RD.AddContinuousEffect(c,e1,e2)
end
--Atk Up
function cm.filter(c)
return c:IsFaceup() and c:IsType(TYPE_FUSION)
end
function cm.atkval(e,c)
return Duel.GetMatchingGroupCount(cm.filter,c:GetControler(),LOCATION_MZONE,0,nil)*800
end
--Cannot Change Position
function cm.postg(e,c)
return c:IsPosition(POS_FACEUP_ATTACK) and c:IsRace(RACE_CYBERSE)
end
function cm.posval(e,re,r,rp)
return re and r&REASON_EFFECT~=0 and rp~=e:GetHandlerPlayer()
end
\ No newline at end of file
......@@ -18,8 +18,8 @@ function cm.spfilter(c,e,tp)
return c:IsRace(RACE_WARRIOR) and c:IsAttack(2500) and RD.IsDefense(c,2500)
and RD.IsCanBeSpecialSummoned(c,e,tp,POS_FACEUP_DEFENSE)
end
function cm.exfilter(c)
return c:IsFaceup() and c:IsAttribute(ATTRIBUTE_WATER) and RD.IsCanChangePosition(c)
function cm.exfilter(c,e,tp)
return c:IsFaceup() and c:IsAttribute(ATTRIBUTE_WATER) and RD.IsCanChangePosition(c,e,tp,REASON_EFFECT)
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return RD.IsSummonTurn(e:GetHandler())
......@@ -31,6 +31,7 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
if RD.SelectAndSpecialSummon(aux.NecroValleyFilter(cm.spfilter),tp,LOCATION_HAND+LOCATION_GRAVE,0,1,1,nil,e,POS_FACEUP_DEFENSE)~=0 then
RD.CanSelectAndDoAction(aux.Stringid(m,1),HINTMSG_POSITION,cm.exfilter,tp,LOCATION_MZONE,0,1,1,nil,RD.ChangePosition)
local filter=RD.Filter(cm.exfilter,e,tp)
RD.CanSelectAndDoAction(aux.Stringid(m,1),HINTMSG_POSITION,filter,tp,LOCATION_MZONE,0,1,1,nil,RD.ChangePosition)
end
end
\ No newline at end of file
......@@ -26,21 +26,21 @@ end
function cm.costfilter(c)
return c:IsType(TYPE_NORMAL) and c:IsAbleToDeckOrExtraAsCost()
end
function cm.filter(c)
return c:IsFacedown() and RD.IsCanChangePosition(c)
function cm.filter(c,e,tp)
return c:IsFacedown() and RD.IsCanChangePosition(c,e,tp,REASON_EFFECT)
end
function cm.desfilter(c)
return c:IsFaceup() and c:GetBaseAttack()<=2500
end
cm.cost=RD.CostSendGraveToDeck(cm.costfilter,1,1)
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
local g=Duel.GetMatchingGroup(cm.filter,tp,0,LOCATION_MZONE,nil)
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,e,tp)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,g:GetCount(),0,0)
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
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,POS_FACEUP_ATTACK)~=0
and c:IsFaceup() and c:IsRelateToEffect(e) then
RD.AttachAtkDef(e,c,700,0,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
......
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