Commit 47478cd4 authored by 未闻皂名's avatar 未闻皂名

2025/2/8 扭防抗性调整更新

parent 6215534f
Pipeline #33042 passed with stages
in 9 minutes and 55 seconds
......@@ -226,18 +226,43 @@ function RushDuel.CanSelectGroupAndSet(desc, filter, check, tp, s_range, o_range
return 0
end
-- 过滤可以改变表示形式的卡
function RushDuel.FilterChangePositionTarget(card, effect, player, reason, hints)
local effects = {card:IsHasEffect(EFFECT_CANNOT_CHANGE_POSITION_EFFECT)}
for i, e in ipairs(effects) do
local value = e:GetValue()
if value == 1 then
hints:AddCard(e:GetHandler())
return false
elseif type(value) == "function" and value(e, effect, reason, player) then
hints:AddCard(e:GetHandler())
return false
end
end
return true
end
-- 操作: 改变表示形式
function RushDuel.ChangePosition(target, pos)
if pos == nil then
return Duel.ChangePosition(target, POS_FACEUP_DEFENSE, POS_FACEUP_DEFENSE, POS_FACEUP_ATTACK, POS_FACEUP_ATTACK)
function RushDuel.ChangePosition(target, effect, player, reason, pos)
local hints = Group.CreateGroup()
local group = RushDuel.ToGroup(target):Filter(RushDuel.FilterChangePositionTarget, nil, effect, player, reason, hints)
local tc = hints:GetFirst()
if tc then
Duel.Hint(HINT_CARD, 0, tc:GetOriginalCode())
end
if group:GetCount() > 0 then
if pos == nil then
return Duel.ChangePosition(group, POS_FACEUP_DEFENSE, POS_FACEUP_DEFENSE, POS_FACEUP_ATTACK, POS_FACEUP_ATTACK)
else
return Duel.ChangePosition(group, pos)
end
else
return Duel.ChangePosition(target, pos)
return 0
end
end
-- 操作: 加入/返回手卡, 并给对方确认
function RushDuel.SendToHandAndExists(target, confirm_player, filter, count, expect)
local g = RushDuel.ToMaximunGroup(target):Filter(Card.IsAbleToHand,nil)
local g = RushDuel.ToMaximunGroup(target):Filter(Card.IsAbleToHand, nil)
if Duel.SendtoHand(g, nil, REASON_EFFECT) == 0 then
return false
end
......@@ -248,7 +273,7 @@ function RushDuel.SendToHandAndExists(target, confirm_player, filter, count, exp
end
-- 操作: 返回对方手卡, 不能确认那些卡
function RushDuel.SendToOpponentHand(target)
local g = RushDuel.ToMaximunGroup(target):Filter(Card.IsAbleToHand,nil)
local g = RushDuel.ToMaximunGroup(target):Filter(Card.IsAbleToHand, nil)
return Duel.SendtoHand(g, nil, REASON_EFFECT)
end
......@@ -297,12 +322,12 @@ end
-- 操作: 返回卡组
function RushDuel.SendToDeckAndExists(target, filter, count, expect)
local g = RushDuel.ToMaximunGroup(target):Filter(Card.IsAbleToDeck,nil)
local g = RushDuel.ToMaximunGroup(target):Filter(Card.IsAbleToDeck, nil)
return Duel.SendtoDeck(g, nil, SEQ_DECKSHUFFLE, REASON_EFFECT) ~= 0 and RushDuel.IsOperatedGroupExists(filter, count, expect)
end
-- 操作: 返回卡组上面 (排序)
function RushDuel.SendToDeckTop(target, sort_player)
local g = RushDuel.ToMaximunGroup(target):Filter(Card.IsAbleToDeck,nil)
local g = RushDuel.ToMaximunGroup(target):Filter(Card.IsAbleToDeck, nil)
if sort_player ~= nil then
local og, ct = RushDuel.SendToDeckSort(g, SEQ_DECKTOP, REASON_EFFECT, sort_player)
return ct
......@@ -312,7 +337,7 @@ function RushDuel.SendToDeckTop(target, sort_player)
end
-- 操作: 返回卡组下面 (排序)
function RushDuel.SendToDeckBottom(target, sort_player)
local g = RushDuel.ToMaximunGroup(target):Filter(Card.IsAbleToDeck,nil)
local g = RushDuel.ToMaximunGroup(target):Filter(Card.IsAbleToDeck, nil)
if sort_player ~= nil then
local og, ct = RushDuel.SendToDeckSort(g, SEQ_DECKBOTTOM, REASON_EFFECT, sort_player)
return ct
......@@ -322,19 +347,19 @@ function RushDuel.SendToDeckBottom(target, sort_player)
end
-- 操作: 返回卡组上面或下面 (排序)
function RushDuel.SendToDeckTopOrBottom(target, sort_player, top_desc, bottom_desc)
local g = RushDuel.ToMaximunGroup(target):Filter(Card.IsAbleToDeck,nil)
local g = RushDuel.ToMaximunGroup(target):Filter(Card.IsAbleToDeck, nil)
local sequence = Duel.SelectOption(sort_player, top_desc, bottom_desc)
local og, ct = RushDuel.SendToDeckSort(g, sequence, REASON_EFFECT, sort_player)
return ct
end
-- 操作: 返回对方卡组上面 (排序)
function RushDuel.SendToOpponentDeck(target)
local g = RushDuel.ToMaximunGroup(target):Filter(Card.IsAbleToDeck,nil)
local g = RushDuel.ToMaximunGroup(target):Filter(Card.IsAbleToDeck, nil)
return Duel.SendtoDeck(g, nil, SEQ_DECKSHUFFLE, REASON_EFFECT)
end
-- 操作: 返回对方卡组上面 (排序)
function RushDuel.SendToOpponentDeckTop(target, player)
local g = RushDuel.ToMaximunGroup(target):Filter(Card.IsAbleToDeck,nil)
local g = RushDuel.ToMaximunGroup(target):Filter(Card.IsAbleToDeck, nil)
if g:GetCount() == 1 then
return Duel.SendtoDeck(g, nil, SEQ_DECKTOP, REASON_EFFECT)
else
......@@ -344,7 +369,7 @@ function RushDuel.SendToOpponentDeckTop(target, player)
end
-- 操作: 返回对方卡组下面 (排序)
function RushDuel.SendToOpponentDeckBottom(target, player)
local g = RushDuel.ToMaximunGroup(target):Filter(Card.IsAbleToDeck,nil)
local g = RushDuel.ToMaximunGroup(target):Filter(Card.IsAbleToDeck, nil)
if g:GetCount() == 1 then
return Duel.SendtoDeck(g, nil, SEQ_DECKBOTTOM, REASON_EFFECT)
else
......
......@@ -51,15 +51,6 @@ 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
-- 条件: 可否特殊召唤
......
......@@ -95,7 +95,7 @@ end
function RushDuel._private_action_change_position(position, set_label_before, set_object_before, set_label_after, set_object_after)
return function(g, e, tp, eg, ep, ev, re, r, rp)
RushDuel.SetLabelAndObject(e, g, set_label_before, set_object_before)
if RushDuel.ChangePosition(g, position) ~= 0 then
if RushDuel.ChangePosition(g, e, tp, REASON_COST, position) ~= 0 then
local og = Duel.GetOperatedGroup()
RushDuel.SetLabelAndObject(e, og, set_label_after, set_object_after)
end
......@@ -358,9 +358,9 @@ function RushDuel.CostChangeSelfPosition(pos1, pos2)
return (not pos1 or c:IsPosition(pos1)) and RushDuel.IsCanChangePosition(c, e, tp, REASON_COST)
end
if pos2 then
RD.ChangePosition(c, pos2)
RushDuel.ChangePosition(c, e, tp, REASON_COST, pos2)
else
RD.ChangePosition(c)
RushDuel.ChangePosition(c, e, tp, REASON_COST)
end
end
end
......
......@@ -47,8 +47,8 @@ function RushDuel.HintOrConfirm(group, hint_selection, confirm, target_player)
end
end
-- 将 卡片组/卡片/效果 转化为卡片组, 对于极大怪兽, 其素材也包含其中
function RushDuel.ToMaximunGroup(target)
-- 将 卡片组/卡片/效果 转化为卡片组
function RushDuel.ToGroup(target)
local type = Auxiliary.GetValueType(target)
local g = Group.CreateGroup()
if type == "Group" then
......@@ -58,6 +58,12 @@ function RushDuel.ToMaximunGroup(target)
elseif type == "Effect" then
g:AddCard(target:GetHandler())
end
return g
end
-- 将 卡片组/卡片/效果 转化为卡片组, 对于极大怪兽, 其素材也包含其中
function RushDuel.ToMaximunGroup(target)
local g = RushDuel.ToGroup(target)
local overlay = Group.CreateGroup()
g:ForEach(function(tc)
if RushDuel.IsMaximumMode(tc) then
......
......@@ -25,5 +25,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)
local filter=RD.Filter(cm.posfilter,e,tp)
RD.SelectAndDoAction(HINTMSG_POSCHANGE,filter,tp,0,LOCATION_MZONE,1,1,nil,RD.ChangePosition)
RD.SelectAndDoAction(HINTMSG_POSCHANGE,filter,tp,0,LOCATION_MZONE,1,1,nil,function(g)
RD.ChangePosition(g,e,tp,REASON_EFFECT)
end)
end
\ No newline at end of file
......@@ -29,7 +29,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)
local c=e:GetHandler()
if c:IsFaceup() and c:IsRelateToEffect(e) and RD.ChangePosition(c)~=0 then
if c:IsFaceup() and c:IsRelateToEffect(e) and RD.ChangePosition(c,e,tp,REASON_EFFECT)~=0 then
RD.CanSelectAndSpecialSummon(aux.Stringid(m,1),aux.NecroValleyFilter(cm.spfilter),tp,LOCATION_GRAVE,0,1,1,nil,e,POS_FACEUP,true)
end
end
\ No newline at end of file
......@@ -26,6 +26,6 @@ end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local filter=RD.Filter(cm.posfilter,e,tp)
RD.SelectAndDoAction(HINTMSG_POSCHANGE,filter,tp,0,LOCATION_MZONE,1,1,nil,function(g)
RD.ChangePosition(g,POS_FACEUP_ATTACK)
RD.ChangePosition(g,e,tp,REASON_EFFECT,POS_FACEUP_ATTACK)
end)
end
\ No newline at end of file
......@@ -35,6 +35,6 @@ function cm.operation(e,tp,eg,ep,ev,re,r,rp)
if ct==0 then return end
local filter=RD.Filter(cm.posfilter,e,tp)
RD.SelectAndDoAction(HINTMSG_POSCHANGE,filter,tp,0,LOCATION_MZONE,1,ct,nil,function(g)
RD.ChangePosition(g,POS_FACEUP_DEFENSE)
RD.ChangePosition(g,e,tp,REASON_EFFECT,POS_FACEUP_DEFENSE)
end)
end
\ No newline at end of file
......@@ -43,7 +43,7 @@ function cm.operation(e,tp,eg,ep,ev,re,r,rp)
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,filter,tp,0,LOCATION_MZONE,1,1,nil,function(sg)
RD.ChangePosition(sg,POS_FACEUP_DEFENSE)
RD.ChangePosition(sg,e,tp,REASON_EFFECT,POS_FACEUP_DEFENSE)
end)
end
end
\ No newline at end of file
......@@ -39,7 +39,7 @@ function cm.operation(e,tp,eg,ep,ev,re,r,rp)
if Duel.IsExistingMatchingCard(cm.exfilter,tp,LOCATION_MZONE,0,1,nil) then
local filter=RD.Filter(cm.posfilter,e,tp)
RD.CanSelectAndDoAction(aux.Stringid(m,3),HINTMSG_POSCHANGE,filter,tp,0,LOCATION_MZONE,1,1,nil,function(sg)
RD.ChangePosition(sg)
RD.ChangePosition(sg,e,tp,REASON_EFFECT)
end)
end
end)
......
......@@ -28,6 +28,6 @@ end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local filter=RD.Filter(cm.posfilter,e,tp)
RD.SelectAndDoAction(HINTMSG_SET,filter,tp,0,LOCATION_MZONE,1,2,nil,function(g)
RD.ChangePosition(g,POS_FACEDOWN_DEFENSE)
RD.ChangePosition(g,e,tp,REASON_EFFECT,POS_FACEDOWN_DEFENSE)
end)
end
\ No newline at end of file
......@@ -37,7 +37,7 @@ function cm.operation(e,tp,eg,ep,ev,re,r,rp)
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)
RD.ChangePosition(mg,e,tp,REASON_EFFECT,POS_FACEUP_DEFENSE)
end
end)
end
......
......@@ -29,6 +29,6 @@ end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local filter=RD.Filter(cm.posfilter,e,tp)
RD.SelectAndDoAction(HINTMSG_POSCHANGE,filter,tp,0,LOCATION_MZONE,1,1,nil,function(g)
RD.ChangePosition(g,POS_FACEUP_ATTACK)
RD.ChangePosition(g,e,tp,REASON_EFFECT,POS_FACEUP_ATTACK)
end)
end
\ No newline at end of file
......@@ -30,5 +30,7 @@ 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_POSCHANGE,RD.IsCanChangePosition,tp,0,LOCATION_MZONE,1,3,nil,RD.ChangePosition)
RD.SelectAndDoAction(HINTMSG_POSCHANGE,RD.IsCanChangePosition,tp,0,LOCATION_MZONE,1,3,nil,function(g)
RD.ChangePosition(g,e,tp,REASON_EFFECT)
end)
end
\ No newline at end of file
......@@ -25,6 +25,6 @@ end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local filter=RD.Filter(cm.filter,e,tp)
RD.SelectAndDoAction(HINTMSG_SET,filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil,function(g)
RD.ChangePosition(g,POS_FACEDOWN_DEFENSE)
RD.ChangePosition(g,e,tp,REASON_EFFECT,POS_FACEDOWN_DEFENSE)
end)
end
\ No newline at end of file
......@@ -27,6 +27,6 @@ end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local filter=RD.Filter(cm.filter,e,tp)
RD.SelectAndDoAction(HINTMSG_POSCHANGE,filter,tp,0,LOCATION_MZONE,1,1,nil,function(g)
RD.ChangePosition(g,POS_FACEUP_ATTACK)
RD.ChangePosition(g,e,tp,REASON_EFFECT,POS_FACEUP_ATTACK)
end)
end
\ No newline at end of file
......@@ -42,6 +42,6 @@ end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local filter=RD.Filter(cm.posfilter,e,tp)
RD.SelectGroupAndDoAction(HINTMSG_POSCHANGE,filter,cm.check,tp,LOCATION_MZONE,LOCATION_MZONE,2,2,nil,function(g)
RD.ChangePosition(g,POS_FACEUP_DEFENSE)
RD.ChangePosition(g,e,tp,REASON_EFFECT,POS_FACEUP_DEFENSE)
end)
end
\ No newline at end of file
......@@ -24,6 +24,6 @@ end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local filter=RD.Filter(cm.posfilter,e,tp)
RD.SelectAndDoAction(HINTMSG_DEFENSE,filter,tp,LOCATION_MZONE,0,1,1,nil,function(g)
RD.ChangePosition(g,POS_FACEUP_ATTACK)
RD.ChangePosition(g,e,tp,REASON_EFFECT,POS_FACEUP_ATTACK)
end)
end
\ No newline at end of file
......@@ -30,6 +30,6 @@ end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local filter=RD.Filter(cm.filter,e,tp)
RD.SelectAndDoAction(HINTMSG_SET,filter,tp,0,LOCATION_MZONE,1,1,nil,function(g)
RD.ChangePosition(g,POS_FACEDOWN_DEFENSE)
RD.ChangePosition(g,e,tp,REASON_EFFECT,POS_FACEDOWN_DEFENSE)
end)
end
\ No newline at end of file
......@@ -25,7 +25,7 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp)
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)
local ct=RD.ChangePosition(g,e,tp,REASON_EFFECT,POS_FACEUP_DEFENSE)
Duel.Recover(tp,ct*400,REASON_EFFECT)
end
end
\ No newline at end of file
......@@ -28,6 +28,6 @@ end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=eg:GetFirst()
if tc:IsRelateToEffect(e) then
RD.ChangePosition(tc,POS_FACEDOWN_DEFENSE)
RD.ChangePosition(tc,e,tp,REASON_EFFECT,POS_FACEDOWN_DEFENSE)
end
end
\ No newline at end of file
......@@ -32,6 +32,6 @@ end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local filter=RD.Filter(cm.filter,e,tp)
RD.SelectAndDoAction(HINTMSG_SET,filter,tp,0,LOCATION_MZONE,1,2,nil,function(g)
RD.ChangePosition(g,POS_FACEDOWN_DEFENSE)
RD.ChangePosition(g,e,tp,REASON_EFFECT,POS_FACEDOWN_DEFENSE)
end)
end
\ No newline at end of file
......@@ -26,7 +26,7 @@ end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local filter=RD.Filter(cm.filter,e,tp)
RD.SelectAndDoAction(HINTMSG_POSCHANGE,filter,tp,0,LOCATION_MZONE,1,1,nil,function(g)
if RD.ChangePosition(g,POS_FACEUP_DEFENCE)~=0 then
if RD.ChangePosition(g,e,tp,REASON_EFFECT,POS_FACEUP_DEFENCE)~=0 then
RD.AttachAtkDef(e,g:GetFirst(),0,-600,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
end
end)
......
......@@ -23,6 +23,6 @@ end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local filter=RD.Filter(cm.filter,e,tp)
RD.SelectAndDoAction(HINTMSG_POSCHANGE,filter,tp,0,LOCATION_MZONE,1,1,nil,function(g)
RD.ChangePosition(g,POS_FACEUP_DEFENSE)
RD.ChangePosition(g,e,tp,REASON_EFFECT,POS_FACEUP_DEFENSE)
end)
end
\ No newline at end of file
......@@ -37,7 +37,7 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp)
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)
RD.ChangePosition(sg,e,tp,REASON_EFFECT,POS_FACEUP_DEFENSE)
end
end
end)
......
......@@ -28,7 +28,7 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetAttacker()
if tc:IsRelateToBattle() and tc:IsAttackPos() and RD.ChangePosition(tc,POS_FACEUP_DEFENSE)~=0 then
if tc:IsRelateToBattle() and tc:IsAttackPos() and RD.ChangePosition(tc,e,tp,REASON_EFFECT,POS_FACEUP_DEFENSE)~=0 then
RD.CanSelectAndSpecialSummon(HINTMSG_SPSUMMON,aux.NecroValleyFilter(cm.spfilter),tp,LOCATION_GRAVE,0,1,1,nil,e,POS_FACEUP)
end
end
\ No newline at end of file
......@@ -29,6 +29,6 @@ end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local filter=RD.Filter(cm.posfilter,e,tp)
RD.SelectAndDoAction(HINTMSG_POSCHANGE,filter,tp,0,LOCATION_MZONE,1,1,nil,function(g)
RD.ChangePosition(g,POS_FACEUP_ATTACK)
RD.ChangePosition(g,e,tp,REASON_EFFECT,POS_FACEUP_ATTACK)
end)
end
\ No newline at end of file
......@@ -34,7 +34,7 @@ end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local filter=RD.Filter(cm.filter,e,tp)
RD.SelectAndDoAction(HINTMSG_POSCHANGE,filter,tp,LOCATION_MZONE,0,1,2,nil,function(g)
if RD.ChangePosition(g,POS_FACEUP_DEFENSE)~=0 and Duel.GetFlagEffect(tp,m)==0 then
if RD.ChangePosition(g,e,tp,REASON_EFFECT,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)
RD.CreateCannotSelectBattleTargetEffect(e,cm.atkcon,nil,cm.atklimit,tp,0,LOCATION_MZONE,RESET_PHASE+PHASE_END)
......
......@@ -30,6 +30,6 @@ end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local filter=RD.Filter(cm.filter,e,tp)
RD.SelectAndDoAction(HINTMSG_POSCHANGE,filter,tp,0,LOCATION_MZONE,1,2,nil,function(g)
RD.ChangePosition(g,POS_FACEUP_DEFENSE)
RD.ChangePosition(g,e,tp,REASON_EFFECT,POS_FACEUP_DEFENSE)
end)
end
\ No newline at end of file
......@@ -35,7 +35,7 @@ function cm.operation(e,tp,eg,ep,ev,re,r,rp)
if ct==0 then return end
local filter=RD.Filter(cm.posfilter,e,tp)
RD.SelectAndDoAction(HINTMSG_POSCHANGE,filter,tp,0,LOCATION_MZONE,1,ct,nil,function(g)
if RD.ChangePosition(g,POS_FACEUP_ATTACK)~=0 then
if RD.ChangePosition(g,e,tp,REASON_EFFECT,POS_FACEUP_ATTACK)~=0 then
local og=Duel.GetOperatedGroup()
og:ForEach(function(tc)
RD.SetBaseAtkDef(e,tc,0,nil,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
......
......@@ -30,7 +30,7 @@ end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local filter=RD.Filter(cm.filter,e,tp)
RD.SelectAndDoAction(HINTMSG_POSCHANGE,filter,tp,LOCATION_MZONE,0,1,1,nil,function(g)
if RD.ChangePosition(g)~=0 then
if RD.ChangePosition(g,e,tp,REASON_EFFECT)~=0 then
RD.AttachAtkDef(e,g:GetFirst(),1500,0,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
end
end)
......
......@@ -30,7 +30,7 @@ end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetAttacker()
if tc:IsRelateToBattle() and tc:IsAttackPos()
and RD.ChangePosition(tc,POS_FACEUP_DEFENSE)~=0
and RD.ChangePosition(tc,e,tp,REASON_EFFECT,POS_FACEUP_DEFENSE)~=0
and tc:IsRace(RACE_DRAGON+RACE_SPELLCASTER+RACE_FAIRY) then
RD.CanSelectAndDoAction(aux.Stringid(m,1),HINTMSG_DESTROY,cm.desfilter,tp,0,LOCATION_ONFIELD,1,1,nil,function(g)
Duel.Destroy(g,REASON_EFFECT)
......
......@@ -31,7 +31,7 @@ end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local filter=RD.Filter(cm.posfilter,e,tp)
RD.SelectAndDoAction(HINTMSG_POSCHANGE,filter,tp,0,LOCATION_MZONE,1,1,nil,function(g)
if RD.ChangePosition(g,POS_FACEUP_ATTACK)~=0 then
if RD.ChangePosition(g,e,tp,REASON_EFFECT,POS_FACEUP_ATTACK)~=0 then
Duel.Recover(tp,g:GetFirst():GetBaseAttack(),REASON_EFFECT)
end
end)
......
......@@ -34,7 +34,7 @@ end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local filter=RD.Filter(cm.posfilter,e,tp)
RD.SelectAndDoAction(HINTMSG_SET,filter,tp,0,LOCATION_MZONE,1,1,nil,function(g)
if RD.ChangePosition(g,POS_FACEDOWN_DEFENSE)~=0 then
if RD.ChangePosition(g,e,tp,REASON_EFFECT,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)
end)
......
......@@ -28,7 +28,7 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=g:GetFirst()
RD.AttachAtkDef(e,tc,1000,0,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
if RD.IsCanChangePosition(tc,e,tp,REASON_EFFECT) and Duel.SelectEffectYesNo(tp,tc,aux.Stringid(m,2)) then
RD.ChangePosition(tc)
RD.ChangePosition(tc,e,tp,REASON_EFFECT)
end
end)
end
\ No newline at end of file
......@@ -31,7 +31,7 @@ end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local filter=RD.Filter(cm.posfilter,e,tp)
RD.SelectAndDoAction(HINTMSG_POSCHANGE,filter,tp,0,LOCATION_MZONE,1,1,nil,function(g)
if RD.ChangePosition(g)~=0 and Duel.IsExistingMatchingCard(cm.exfilter,tp,LOCATION_MZONE,0,1,nil) then
if RD.ChangePosition(g,e,tp,REASON_EFFECT)~=0 and Duel.IsExistingMatchingCard(cm.exfilter,tp,LOCATION_MZONE,0,1,nil) then
RD.CanDraw(aux.Stringid(m,1),tp,1)
end
end)
......
......@@ -34,6 +34,6 @@ end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(cm.filter,tp,0,LOCATION_MZONE,nil,e,tp)
if g:GetCount()>0 then
RD.ChangePosition(g,POS_FACEUP_DEFENSE)
RD.ChangePosition(g,e,tp,REASON_EFFECT,POS_FACEUP_DEFENSE)
end
end
\ No newline at end of file
......@@ -38,7 +38,7 @@ end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local filter=RD.Filter(cm.filter,e,tp)
RD.SelectAndDoAction(HINTMSG_POSCHANGE,filter,tp,0,LOCATION_MZONE,1,1,nil,function(g)
if RD.ChangePosition(g,POS_FACEUP_DEFENSE)~=0 then
if RD.ChangePosition(g,e,tp,REASON_EFFECT,POS_FACEUP_DEFENSE)~=0 then
Duel.Damage(1-tp,500,REASON_EFFECT)
end
end)
......
......@@ -24,6 +24,6 @@ end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local filter=RD.Filter(cm.posfilter,e,tp)
RD.SelectAndDoAction(HINTMSG_POSCHANGE,filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil,function(g)
RD.ChangePosition(g,POS_FACEUP_DEFENSE)
RD.ChangePosition(g,e,tp,REASON_EFFECT,POS_FACEUP_DEFENSE)
end)
end
\ No newline at end of file
......@@ -31,7 +31,7 @@ end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local filter=RD.Filter(cm.posfilter,e,tp)
RD.SelectAndDoAction(HINTMSG_POSCHANGE,filter,tp,0,LOCATION_MZONE,1,1,nil,function(g)
if RD.ChangePosition(g,POS_FACEUP_ATTACK)~=0 and g:GetFirst():IsAttribute(ATTRIBUTE_EARTH) then
if RD.ChangePosition(g,e,tp,REASON_EFFECT,POS_FACEUP_ATTACK)~=0 and g:GetFirst():IsAttribute(ATTRIBUTE_EARTH) then
RD.CanDraw(aux.Stringid(m,1),tp,1)
end
end)
......
......@@ -31,6 +31,6 @@ end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local filter=RD.Filter(cm.filter,e,tp)
RD.SelectAndDoAction(HINTMSG_POSCHANGE,filter,tp,0,LOCATION_MZONE,1,1,nil,function(g)
RD.ChangePosition(g,POS_FACEUP_DEFENSE)
RD.ChangePosition(g,e,tp,REASON_EFFECT,POS_FACEUP_DEFENSE)
end)
end
\ No newline at end of file
......@@ -27,7 +27,7 @@ end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local filter=RD.Filter(cm.filter,e,tp)
RD.SelectAndDoAction(HINTMSG_POSCHANGE,filter,tp,0,LOCATION_MZONE,1,1,nil,function(g)
if RD.ChangePosition(g,POS_FACEUP_ATTACK)~=0 and g:GetFirst():IsType(TYPE_NORMAL) then
if RD.ChangePosition(g,e,tp,REASON_EFFECT,POS_FACEUP_ATTACK)~=0 and g:GetFirst():IsType(TYPE_NORMAL) then
RD.CanDraw(aux.Stringid(m,1),tp,1)
end
end)
......
......@@ -23,6 +23,6 @@ end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local filter=RD.Filter(cm.filter,e,tp)
RD.SelectAndDoAction(HINTMSG_POSCHANGE,filter,tp,0,LOCATION_MZONE,1,1,nil,function(g)
RD.ChangePosition(g,POS_FACEUP_ATTACK)
RD.ChangePosition(g,e,tp,REASON_EFFECT,POS_FACEUP_ATTACK)
end)
end
\ No newline at end of file
......@@ -33,6 +33,6 @@ end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=eg:GetFirst()
if tc:IsRelateToEffect(e) then
RD.ChangePosition(tc,POS_FACEDOWN_DEFENSE)
RD.ChangePosition(tc,e,tp,REASON_EFFECT,POS_FACEDOWN_DEFENSE)
end
end
\ No newline at end of file
......@@ -32,7 +32,7 @@ end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local filter=RD.Filter(cm.filter,e,tp)
RD.SelectAndDoAction(HINTMSG_POSCHANGE,filter,tp,LOCATION_MZONE,0,1,2,nil,function(g)
if RD.ChangePosition(g,POS_FACEUP_DEFENSE)~=0
if RD.ChangePosition(g,e,tp,REASON_EFFECT,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)
Duel.BreakEffect()
......
......@@ -32,7 +32,7 @@ function cm.operation1(e,tp,eg,ep,ev,re,r,rp)
pos=POS_FACEUP_ATTACK
end
pos=Duel.SelectPosition(tp,tc,pos)
RD.ChangePosition(tc,pos)
RD.ChangePosition(tc,e,tp,REASON_EFFECT,pos)
end)
end
--Destroy
......
......@@ -45,7 +45,7 @@ end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local filter=RD.Filter(cm.filter,e,tp)
RD.SelectAndDoAction(HINTMSG_POSCHANGE,filter,tp,LOCATION_MZONE,0,1,1,nil,function(g)
if RD.ChangePosition(g,POS_FACEUP_DEFENSE)~=0 then
if RD.ChangePosition(g,e,tp,REASON_EFFECT,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
......
......@@ -27,10 +27,10 @@ end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local filter=RD.Filter(cm.filter,e,tp)
RD.SelectAndDoAction(HINTMSG_POSCHANGE,filter,tp,0,LOCATION_MZONE,1,2,nil,function(g)
if RD.ChangePosition(g)~=0 then
if RD.ChangePosition(g,e,tp,REASON_EFFECT)~=0 then
local posfilter=RD.Filter(cm.posfilter,e,tp)
RD.CanSelectAndDoAction(aux.Stringid(m,1),HINTMSG_POSCHANGE,posfilter,tp,LOCATION_MZONE,0,1,1,nil,function(sg)
RD.ChangePosition(sg)
RD.ChangePosition(sg,e,tp,REASON_EFFECT)
end)
end
end)
......
......@@ -46,6 +46,6 @@ end
function cm.operation2(e,tp,eg,ep,ev,re,r,rp)
local filter=RD.Filter(cm.posfilter,e,tp)
RD.SelectAndDoAction(HINTMSG_POSCHANGE,filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil,function(g)
RD.ChangePosition(g)
RD.ChangePosition(g,e,tp,REASON_EFFECT)
end)
end
\ No newline at end of file
......@@ -35,7 +35,7 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(cm.filter,tp,0,LOCATION_MZONE,nil,e,tp)
if g:GetCount()>0 and RD.ChangePosition(g)~=0 then
if g:GetCount()>0 and RD.ChangePosition(g,e,tp,REASON_EFFECT)~=0 then
RD.CanSelectAndSpecialSummon(aux.Stringid(m,1),aux.NecroValleyFilter(cm.spfilter),tp,LOCATION_GRAVE,0,1,1,nil,e,POS_FACEUP,true)
end
end
\ No newline at end of file
......@@ -40,7 +40,7 @@ end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local filter=RD.Filter(cm.filter,e,tp)
RD.SelectAndDoAction(HINTMSG_SET,filter,tp,0,LOCATION_MZONE,1,1,nil,function(g)
if RD.ChangePosition(g,POS_FACEDOWN_DEFENSE)~=0 and e:GetLabel()==1 then
if RD.ChangePosition(g,e,tp,REASON_EFFECT,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)
end)
......
......@@ -29,7 +29,7 @@ end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local filter=RD.Filter(cm.filter,e,tp)
RD.SelectAndDoAction(HINTMSG_POSCHANGE,filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil,function(g)
if RD.ChangePosition(g,POS_FACEUP_ATTACK)~=0 then
if RD.ChangePosition(g,e,tp,REASON_EFFECT,POS_FACEUP_ATTACK)~=0 then
RD.CanDraw(aux.Stringid(m,1),tp,1,true)
end
end)
......
......@@ -35,7 +35,7 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=eg:GetFirst()
if tc:IsRelateToEffect(e) and RD.ChangePosition(tc,POS_FACEDOWN_DEFENSE)~=0 then
if tc:IsRelateToEffect(e) and RD.ChangePosition(tc,e,tp,REASON_EFFECT,POS_FACEDOWN_DEFENSE)~=0 then
RD.CanSelectAndDoAction(aux.Stringid(m,1),aux.Stringid(m,2),cm.upfilter,tp,LOCATION_MZONE,0,1,1,nil,function(g)
RD.AttachAtkDef(e,g:GetFirst(),500,500,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
end)
......
......@@ -25,7 +25,7 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp)
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
if RD.ChangePosition(tc,e,tp,REASON_EFFECT,POS_FACEUP_ATTACK)~=0 and tc:IsType(TYPE_NORMAL) then
RD.AttachAtkDef(e,tc,1000,0,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
end
end)
......
......@@ -29,7 +29,7 @@ function cm.operation(e,tp,eg,ep,ev,re,r,rp)
if RD.SendToDeckAndExists(g) and Duel.IsExistingMatchingCard(cm.exfilter,tp,LOCATION_MZONE,0,1,nil) then
local filter=RD.Filter(cm.posfilter,e,tp)
RD.CanSelectAndDoAction(aux.Stringid(m,1),HINTMSG_POSCHANGE,filter,tp,0,LOCATION_MZONE,1,1,nil,function(sg)
RD.ChangePosition(sg,POS_FACEUP_DEFENSE)
RD.ChangePosition(sg,e,tp,REASON_EFFECT,POS_FACEUP_DEFENSE)
end)
end
end)
......
......@@ -31,7 +31,7 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp)
if tc:IsType(TYPE_NORMAL) then
local filter=RD.Filter(cm.posfilter,e,tp)
RD.CanSelectAndDoAction(aux.Stringid(m,3),HINTMSG_POSCHANGE,filter,tp,0,LOCATION_MZONE,1,1,nil,function(sg)
RD.ChangePosition(sg)
RD.ChangePosition(sg,e,tp,REASON_EFFECT)
end)
end
end)
......
......@@ -40,12 +40,12 @@ end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local filter=RD.Filter(cm.filter,e,tp)
RD.SelectAndDoAction(HINTMSG_POSCHANGE,filter,tp,LOCATION_MZONE,0,1,3,nil,function(g)
if RD.ChangePosition(g,POS_FACEUP_DEFENCE)~=0
if RD.ChangePosition(g,e,tp,REASON_EFFECT,POS_FACEUP_DEFENCE)~=0
and Duel.IsExistingMatchingCard(cm.exfilter,tp,LOCATION_MZONE,0,2,nil) then
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)
RD.ChangePosition(sg,e,tp,REASON_EFFECT,POS_FACEUP_DEFENCE)
end)
end
end)
......
......@@ -31,6 +31,6 @@ end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local filter=RD.Filter(cm.filter,e,tp)
RD.SelectAndDoAction(HINTMSG_SET,filter,tp,0,LOCATION_MZONE,1,1,nil,function(g)
RD.ChangePosition(g,POS_FACEDOWN_DEFENSE)
RD.ChangePosition(g,e,tp,REASON_EFFECT,POS_FACEDOWN_DEFENSE)
end)
end
\ No newline at end of file
......@@ -32,7 +32,7 @@ end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local filter=RD.Filter(cm.filter,e,tp)
RD.SelectAndDoAction(HINTMSG_POSCHANGE,filter,tp,0,LOCATION_MZONE,1,1,nil,function(g)
if RD.ChangePosition(g,POS_FACEUP_DEFENSE)~=0 then
if RD.ChangePosition(g,e,tp,REASON_EFFECT,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
Duel.BreakEffect()
......
......@@ -28,6 +28,6 @@ end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=eg:GetFirst()
if tc:IsRelateToEffect(e) then
RD.ChangePosition(tc,POS_FACEUP_DEFENSE)
RD.ChangePosition(tc,e,tp,REASON_EFFECT,POS_FACEUP_DEFENSE)
end
end
\ No newline at end of file
......@@ -46,7 +46,7 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp)
and not tc:IsPosition(POS_FACEUP_DEFENSE)
and RD.IsCanChangePosition(tc,e,tp,REASON_EFFECT)
and Duel.SelectYesNo(tp,aux.Stringid(m,2)) then
RD.ChangePosition(tc,POS_FACEUP_DEFENSE)
RD.ChangePosition(tc,e,tp,REASON_EFFECT,POS_FACEUP_DEFENSE)
end
end
end
\ No newline at end of file
......@@ -20,7 +20,7 @@ function cm.target1(e,tp,eg,ep,ev,re,r,rp,chk)
end
function cm.operation1(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(RD.IsCanChangePosition,tp,LOCATION_MZONE,0,nil)
if g:GetCount()>0 and RD.ChangePosition(g)~=0 then
if g:GetCount()>0 and RD.ChangePosition(g,e,tp,REASON_EFFECT)~=0 then
RD.CanSelectAndDoAction(aux.Stringid(m,3),aux.Stringid(m,4),Card.IsFaceup,tp,0,LOCATION_MZONE,1,1,nil,function(g)
Duel.BreakEffect()
local atk=Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)*-800
......
......@@ -23,7 +23,7 @@ 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,e,tp) end
local g=Duel.GetMatchingGroup(cm.costfilter,tp,LOCATION_MZONE,0,nil,e,tp)
RD.ChangePosition(g,POS_FACEUP_DEFENSE)
RD.ChangePosition(g,e,tp,REASON_COST,POS_FACEUP_DEFENSE)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroupCount(tp,0,LOCATION_HAND)>0 end
......
......@@ -34,7 +34,7 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp)
RD.SelectAndDoAction(HINTMSG_POSCHANGE,RD.IsCanChangePosition,tp,0,LOCATION_MZONE,1,3,nil,function(g)
local sg=Duel.GetMatchingGroup(cm.filter,tp,LOCATION_MZONE,0,nil)
local atk=Duel.GetMatchingGroupCount(cm.atkfilter,tp,LOCATION_GRAVE,0,nil)*100
if RD.ChangePosition(g)~=0 and sg:GetCount()>0 and atk~=0 and Duel.SelectYesNo(tp,aux.Stringid(m,1)) then
if RD.ChangePosition(g,e,tp,REASON_EFFECT)~=0 and sg:GetCount()>0 and atk~=0 and Duel.SelectYesNo(tp,aux.Stringid(m,1)) then
Duel.BreakEffect()
sg:ForEach(function(tc)
RD.AttachAtkDef(e,tc,atk,0,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
......
......@@ -36,7 +36,7 @@ end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local filter=RD.Filter(cm.filter,e,tp)
RD.SelectAndDoAction(HINTMSG_POSCHANGE,filter,tp,0,LOCATION_MZONE,1,1,nil,function(g)
if RD.ChangePosition(g,POS_FACEUP_DEFENCE)~=0 then
if RD.ChangePosition(g,e,tp,REASON_EFFECT,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()
RD.SendToHandAndExists(g,1-tp)
......
......@@ -32,7 +32,7 @@ function cm.operation(e,tp,eg,ep,ev,re,r,rp)
and Duel.IsExistingMatchingCard(cm.exfilter,tp,0,LOCATION_SZONE,1,nil) then
local filter=RD.Filter(cm.posfilter,e,tp)
RD.CanSelectAndDoAction(aux.Stringid(m,1),HINTMSG_POSCHANGE,filter,tp,0,LOCATION_MZONE,1,1,nil,function(g)
RD.ChangePosition(g,POS_FACEDOWN_DEFENSE)
RD.ChangePosition(g,e,tp,REASON_EFFECT,POS_FACEDOWN_DEFENSE)
end)
end
end
\ No newline at end of file
......@@ -31,6 +31,6 @@ end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local filter=RD.Filter(cm.filter,e,tp)
RD.SelectAndDoAction(HINTMSG_SET,filter,tp,0,LOCATION_MZONE,1,2,nil,function(g)
RD.ChangePosition(g,POS_FACEDOWN_DEFENSE)
RD.ChangePosition(g,e,tp,REASON_EFFECT,POS_FACEDOWN_DEFENSE)
end)
end
\ No newline at end of file
......@@ -38,7 +38,7 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.SendtoGrave(g,REASON_EFFECT)~=0 then
local filter=RD.Filter(cm.posfilter,e,tp)
RD.CanSelectAndDoAction(aux.Stringid(m,1),HINTMSG_POSCHANGE,filter,tp,LOCATION_MZONE,0,1,2,nil,function(sg)
RD.ChangePosition(sg,POS_FACEUP_DEFENSE)
RD.ChangePosition(sg,e,tp,REASON_EFFECT,POS_FACEUP_DEFENSE)
end)
end
end)
......
......@@ -37,7 +37,7 @@ end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local filter=RD.Filter(cm.filter,e,tp)
RD.SelectAndDoAction(HINTMSG_POSCHANGE,filter,tp,LOCATION_MZONE,0,1,3,nil,function(g)
if RD.ChangePosition(g,POS_FACEUP_DEFENCE)~=0 then
if RD.ChangePosition(g,e,tp,REASON_EFFECT,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)
if def==0 or g:GetCount()==0 then return end
......
......@@ -30,7 +30,7 @@ function cm.operation(e,tp,eg,ep,ev,re,r,rp)
RD.AttachAtkDef(e,c,1500,0,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
RD.AttachAttackNotChainTrap(e,m,c,aux.Stringid(m,1),RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
else
RD.ChangePosition(c,POS_FACEUP_DEFENSE)
RD.ChangePosition(c,e,tp,REASON_EFFECT,POS_FACEUP_DEFENSE)
end
end
end
\ No newline at end of file
......@@ -33,6 +33,6 @@ end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local filter=RD.Filter(cm.posfilter,e,tp)
RD.SelectAndDoAction(HINTMSG_POSCHANGE,filter,tp,0,LOCATION_MZONE,1,1,nil,function(g)
RD.ChangePosition(g,POS_FACEUP_ATTACK)
RD.ChangePosition(g,e,tp,REASON_EFFECT,POS_FACEUP_ATTACK)
end)
end
\ No newline at end of file
......@@ -29,6 +29,6 @@ end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local filter=RD.Filter(cm.posfilter,e,tp)
RD.SelectAndDoAction(HINTMSG_SET,filter,tp,0,LOCATION_MZONE,1,1,nil,function(g)
RD.ChangePosition(g,POS_FACEDOWN_DEFENSE)
RD.ChangePosition(g,e,tp,REASON_EFFECT,POS_FACEDOWN_DEFENSE)
end)
end
\ No newline at end of file
......@@ -33,7 +33,7 @@ end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local filter=RD.Filter(cm.posfilter,e,tp)
RD.SelectAndDoAction(HINTMSG_SET,filter,tp,0,LOCATION_MZONE,1,1,nil,function(g)
if RD.ChangePosition(g,POS_FACEDOWN_DEFENSE)~=0 then
if RD.ChangePosition(g,e,tp,REASON_EFFECT,POS_FACEDOWN_DEFENSE)~=0 then
local c=e:GetHandler()
if c:IsFaceup() and c:IsRelateToEffect(e) then
local reset=RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END
......
......@@ -30,7 +30,7 @@ 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
local filter=RD.Filter(cm.posfilter,e,tp)
RD.CanSelectAndDoAction(aux.Stringid(m,1),HINTMSG_POSCHANGE,filter,tp,LOCATION_MZONE,0,1,1,nil,function(g)
RD.ChangePosition(g)
RD.ChangePosition(g,e,tp,REASON_EFFECT)
end)
end
end
\ No newline at end of file
......@@ -44,7 +44,7 @@ end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local filter=RD.Filter(cm.filter,e,tp)
RD.SelectAndDoAction(HINTMSG_SET,filter,tp,0,LOCATION_MZONE,1,1,nil,function(g)
if RD.ChangePosition(g,POS_FACEDOWN_DEFENSE)~=0
if RD.ChangePosition(g,e,tp,REASON_EFFECT,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)
RD.SendToOpponentHand(sg)
......
......@@ -33,7 +33,7 @@ end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local filter=RD.Filter(cm.filter,e,tp)
RD.SelectAndDoAction(HINTMSG_POSCHANGE,filter,tp,0,LOCATION_MZONE,1,1,nil,function(g)
if RD.ChangePosition(g,POS_FACEUP_DEFENSE)~=0 then
if RD.ChangePosition(g,e,tp,REASON_EFFECT,POS_FACEUP_DEFENSE)~=0 then
local atk=g:GetFirst():GetBaseAttack()
if atk~=0 then
Duel.BreakEffect()
......
......@@ -42,6 +42,6 @@ function cm.operation(e,tp,eg,ep,ev,re,r,rp)
pos=POS_FACEUP_ATTACK
end
pos=Duel.SelectPosition(tp,tc,pos)
RD.ChangePosition(tc,pos)
RD.ChangePosition(tc,e,tp,REASON_EFFECT,pos)
end)
end
\ No newline at end of file
......@@ -30,11 +30,11 @@ end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local filter=RD.Filter(cm.posfilter,e,tp)
local g=Duel.GetMatchingGroup(filter,tp,0,LOCATION_MZONE,nil)
if g:GetCount()>0 and RD.ChangePosition(g,POS_FACEDOWN_DEFENSE)~=0 then
if g:GetCount()>0 and RD.ChangePosition(g,e,tp,REASON_EFFECT,POS_FACEDOWN_DEFENSE)~=0 then
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)
RD.ChangePosition(sg,e,tp,REASON_EFFECT,POS_FACEUP_ATTACK)
end)
end
end
\ No newline at end of file
......@@ -37,7 +37,7 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=eg:GetFirst()
if tc:IsRelateToEffect(e) and RD.ChangePosition(tc,POS_FACEDOWN_DEFENSE)~=0 then
if tc:IsRelateToEffect(e) and RD.ChangePosition(tc,e,tp,REASON_EFFECT,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
end
\ No newline at end of file
......@@ -24,5 +24,7 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
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)
RD.SelectAndDoAction(HINTMSG_POSCHANGE,RD.IsCanChangePosition,tp,0,LOCATION_MZONE,1,1,nil,function(g)
RD.ChangePosition(g,e,tp,REASON_EFFECT)
end)
end
\ No newline at end of file
......@@ -38,6 +38,6 @@ end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local filter=RD.Filter(cm.filter,e,tp)
RD.SelectAndDoAction(HINTMSG_SET,filter,tp,0,LOCATION_MZONE,1,1,nil,function(g)
RD.ChangePosition(g,POS_FACEDOWN_DEFENSE)
RD.ChangePosition(g,e,tp,REASON_EFFECT,POS_FACEDOWN_DEFENSE)
end)
end
\ No newline at end of file
......@@ -34,7 +34,7 @@ end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local filter=RD.Filter(cm.posfilter,e,tp)
RD.SelectAndDoAction(HINTMSG_SET,filter,tp,0,LOCATION_MZONE,1,1,nil,function(g)
if RD.ChangePosition(g,POS_FACEDOWN_DEFENSE)~=0 then
if RD.ChangePosition(g,e,tp,REASON_EFFECT,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
end)
......
......@@ -43,7 +43,7 @@ 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
local filter=RD.Filter(cm.posfilter,e,tp)
RD.CanSelectGroupAndDoAction(aux.Stringid(m,1),HINTMSG_POSCHANGE,filter,cm.poscheck,tp,LOCATION_MZONE,0,1,3,nil,function(g)
if RD.ChangePosition(g,POS_FACEUP_DEFENSE)~=0 then
if RD.ChangePosition(g,e,tp,REASON_EFFECT,POS_FACEUP_DEFENSE)~=0 then
local og=Duel.GetOperatedGroup()
og:ForEach(function(tc)
if tc:IsPosition(POS_FACEUP_DEFENSE) then
......
......@@ -26,7 +26,7 @@ end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local filter=RD.Filter(cm.filter,e,tp)
RD.SelectAndDoAction(HINTMSG_POSCHANGE,filter,tp,0,LOCATION_MZONE,1,1,nil,function(g)
if RD.ChangePosition(g,POS_FACEUP_DEFENCE)~=0 then
if RD.ChangePosition(g,e,tp,REASON_EFFECT,POS_FACEUP_DEFENCE)~=0 then
RD.AttachAtkDef(e,g:GetFirst(),0,-2000,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
end
end)
......
......@@ -36,6 +36,6 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp)
if tc:IsRelateToEffect(e) then
g:AddCard(tc)
end
RD.ChangePosition(g,POS_FACEUP_DEFENSE)
RD.ChangePosition(g,e,tp,REASON_EFFECT,POS_FACEUP_DEFENSE)
end)
end
\ No newline at end of file
......@@ -38,7 +38,7 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=eg:GetFirst()
if tc:IsRelateToEffect(e) and RD.ChangePosition(tc,POS_FACEDOWN_DEFENSE)~=0
if tc:IsRelateToEffect(e) and RD.ChangePosition(tc,e,tp,REASON_EFFECT,POS_FACEDOWN_DEFENSE)~=0
and Duel.IsExistingMatchingCard(cm.exfilter,tp,LOCATION_MZONE,0,1,nil) then
RD.CanSelectAndDoAction(aux.Stringid(m,1),HINTMSG_TODECK,cm.tdfilter,tp,0,LOCATION_ONFIELD,1,1,nil,function(g)
RD.SendToOpponentDeckTop(g,tp)
......
......@@ -32,7 +32,7 @@ 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,function(g)
local c=e:GetHandler()
if RD.ChangePosition(g)~=0 and c:IsFaceup() and c:IsRelateToEffect(e) and RD.IsMaximumMode(c) then
if RD.ChangePosition(g,e,tp,REASON_EFFECT)~=0 and c:IsFaceup() and c:IsRelateToEffect(e) and RD.IsMaximumMode(c) then
RD.AttachPierce(e,c,aux.Stringid(m,1),RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
end
end)
......
......@@ -39,6 +39,6 @@ end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(cm.filter,tp,0,LOCATION_MZONE,nil,e,tp)
if g:GetCount()>0 then
RD.ChangePosition(g)
RD.ChangePosition(g,e,tp,REASON_EFFECT)
end
end
\ No newline at end of file
......@@ -34,7 +34,7 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=eg:GetFirst()
if tc:IsRelateToEffect(e) and RD.ChangePosition(tc,POS_FACEDOWN_DEFENSE)~=0 then
if tc:IsRelateToEffect(e) and RD.ChangePosition(tc,e,tp,REASON_EFFECT,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(g)
Duel.BreakEffect()
RD.SendToHandAndExists(g,1-tp)
......
......@@ -34,6 +34,6 @@ end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local filter=RD.Filter(cm.filter,e,tp)
RD.SelectGroupAndDoAction(HINTMSG_SET,filter,cm.check,tp,0,LOCATION_MZONE,1,2,nil,function(g)
RD.ChangePosition(g,POS_FACEDOWN_DEFENSE)
RD.ChangePosition(g,e,tp,REASON_EFFECT,POS_FACEDOWN_DEFENSE)
end)
end
\ No newline at end of file
......@@ -27,7 +27,7 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetAttackTarget()
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
if RD.ChangePosition(tc,e,tp,REASON_EFFECT)~=0 then
local dam=Duel.GetFieldGroupCount(tp,0,LOCATION_MZONE)*200
Duel.Damage(1-tp,dam,REASON_EFFECT)
end
......
......@@ -34,6 +34,6 @@ end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local filter=RD.Filter(cm.filter,e,tp)
RD.SelectAndDoAction(HINTMSG_POSCHANGE,filter,tp,0,LOCATION_MZONE,1,2,nil,function(g)
RD.ChangePosition(g,POS_FACEUP_DEFENSE)
RD.ChangePosition(g,e,tp,REASON_EFFECT,POS_FACEUP_DEFENSE)
end)
end
\ No newline at end of file
......@@ -38,7 +38,7 @@ function cm.operation(e,tp,eg,ep,ev,re,r,rp)
and RD.IsOperatedGroupExists(cm.exfilter,1,nil) then
local filter=RD.Filter(cm.posfilter,e,tp)
RD.CanSelectAndDoAction(aux.Stringid(m,1),HINTMSG_POSCHANGE,filter,tp,0,LOCATION_MZONE,1,3,nil,function(sg)
RD.ChangePosition(sg)
RD.ChangePosition(sg,e,tp,REASON_EFFECT)
end)
end
end
\ No newline at end of file
......@@ -42,7 +42,7 @@ end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local filter=RD.Filter(cm.filter,e,tp)
RD.SelectAndDoAction(HINTMSG_SET,filter,tp,0,LOCATION_MZONE,1,1,nil,function(g)
if RD.ChangePosition(g,POS_FACEDOWN_DEFENSE)~=0 then
if RD.ChangePosition(g,e,tp,REASON_EFFECT,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
end)
......
......@@ -30,7 +30,7 @@ function cm.operation(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetFieldGroupCount(tp,LOCATION_FZONE,0)>0 then
local filter=RD.Filter(cm.posfilter,e,tp)
RD.CanSelectAndDoAction(aux.Stringid(m,3),HINTMSG_POSCHANGE,filter,tp,0,LOCATION_MZONE,1,1,nil,function(sg)
RD.ChangePosition(sg)
RD.ChangePosition(sg,e,tp,REASON_EFFECT)
end)
end
end
......
......@@ -46,7 +46,7 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp)
if tc:IsRelateToEffect(e) and Duel.Destroy(tc,REASON_EFFECT)~=0 and e:GetLabel()==20247016 then
local filter=RD.Filter(cm.posfilter,e,tp)
RD.CanSelectAndDoAction(aux.Stringid(m,1),HINTMSG_POSCHANGE,filter,tp,0,LOCATION_MZONE,1,1,nil,function(sg)
RD.ChangePosition(sg)
RD.ChangePosition(sg,e,tp,REASON_EFFECT)
end)
end
end
\ No newline at end of file
......@@ -28,7 +28,7 @@ end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetAttacker()
if tc:IsRelateToBattle() and tc:IsAttackPos()
and RD.ChangePosition(tc,POS_FACEUP_DEFENSE)~=0
and RD.ChangePosition(tc,e,tp,REASON_EFFECT,POS_FACEUP_DEFENSE)~=0
and Duel.GetLP(tp)<=Duel.GetLP(1-tp) then
RD.CanSelectAndDoAction(aux.Stringid(m,1),HINTMSG_DESTROY,Card.IsAttackPos,tp,0,LOCATION_MZONE,1,1,nil,function(g)
if Duel.Destroy(g,REASON_EFFECT)~=0 then
......
......@@ -28,7 +28,7 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetAttacker()
if tc:IsRelateToBattle() and tc:IsAttackPos() and RD.ChangePosition(tc,POS_FACEUP_DEFENSE)~=0 then
if tc:IsRelateToBattle() and tc:IsAttackPos() and RD.ChangePosition(tc,e,tp,REASON_EFFECT,POS_FACEUP_DEFENSE)~=0 then
Duel.BreakEffect()
Duel.Damage(1-tp,1000,REASON_EFFECT)
end
......
......@@ -34,7 +34,7 @@ function cm.operation(e,tp,eg,ep,ev,re,r,rp)
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
if RD.ChangePosition(g,e,tp,REASON_EFFECT,POS_FACEUP_ATTACK)~=0 and c:IsFaceup() and c:IsRelateToEffect(e) then
Duel.BreakEffect()
RD.AttachAtkDef(e,c,-1300,0,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
end
......
......@@ -43,7 +43,7 @@ end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local filter=RD.Filter(cm.filter,e,tp)
RD.SelectAndDoAction(HINTMSG_SET,filter,tp,0,LOCATION_MZONE,1,1,nil,function(g)
if RD.ChangePosition(g,POS_FACEDOWN_DEFENSE)~=0
if RD.ChangePosition(g,e,tp,REASON_EFFECT,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)
Duel.Destroy(sg,REASON_EFFECT)
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment