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

2020/12/15 为变更表示形式的卡添加MAX怪兽的检测

parent fc8f9c22
...@@ -14,6 +14,9 @@ function cm.initial_effect(c) ...@@ -14,6 +14,9 @@ function cm.initial_effect(c)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
--Position --Position
function cm.posfilter(c)
return c:IsCanChangePosition() and RushDuel.IsHasDefense(c)
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk) function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToGraveAsCost,tp,LOCATION_HAND,0,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToGraveAsCost,tp,LOCATION_HAND,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
...@@ -21,13 +24,13 @@ function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -21,13 +24,13 @@ function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SendtoGrave(g,REASON_COST) Duel.SendtoGrave(g,REASON_COST)
end end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk) function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsCanChangePosition,tp,0,LOCATION_MZONE,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(cm.posfilter,tp,0,LOCATION_MZONE,1,nil) end
local g=Duel.GetMatchingGroup(Card.IsCanChangePosition,tp,0,LOCATION_MZONE,nil) local g=Duel.GetMatchingGroup(cm.posfilter,tp,0,LOCATION_MZONE,nil)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
end end
function cm.operation(e,tp,eg,ep,ev,re,r,rp) function cm.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_POSCHANGE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_POSCHANGE)
local g=Duel.SelectMatchingCard(tp,Card.IsCanChangePosition,tp,0,LOCATION_MZONE,1,1,nil) local g=Duel.SelectMatchingCard(tp,cm.posfilter,tp,0,LOCATION_MZONE,1,1,nil)
if g:GetCount()>0 then if g:GetCount()>0 then
Duel.HintSelection(g) Duel.HintSelection(g)
Duel.ChangePosition(g,POS_FACEUP_DEFENSE,POS_FACEUP_DEFENSE,POS_FACEUP_ATTACK,POS_FACEUP_ATTACK) Duel.ChangePosition(g,POS_FACEUP_DEFENSE,POS_FACEUP_DEFENSE,POS_FACEUP_ATTACK,POS_FACEUP_ATTACK)
......
...@@ -18,7 +18,7 @@ function cm.condition(e,tp,eg,ep,ev,re,r,rp) ...@@ -18,7 +18,7 @@ function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return c:IsReason(REASON_SUMMON) and c:IsStatus(STATUS_SUMMON_TURN) return c:IsReason(REASON_SUMMON) and c:IsStatus(STATUS_SUMMON_TURN)
end end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk) function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsCanChangePosition() end if chk==0 then return e:GetHandler():IsCanChangePosition() and RushDuel.IsHasDefense(e:GetHandler()) end
Duel.ChangePosition(e:GetHandler(),POS_FACEUP_DEFENSE,POS_FACEDOWN_DEFENSE,POS_FACEUP_ATTACK,POS_FACEUP_ATTACK) Duel.ChangePosition(e:GetHandler(),POS_FACEUP_DEFENSE,POS_FACEDOWN_DEFENSE,POS_FACEUP_ATTACK,POS_FACEUP_ATTACK)
end end
function cm.operation(e,tp,eg,ep,ev,re,r,rp) function cm.operation(e,tp,eg,ep,ev,re,r,rp)
......
...@@ -20,6 +20,9 @@ end ...@@ -20,6 +20,9 @@ end
function cm.costfilter(c) function cm.costfilter(c)
return c:IsAttribute(ATTRIBUTE_WIND) and c:IsAbleToGraveAsCost() return c:IsAttribute(ATTRIBUTE_WIND) and c:IsAbleToGraveAsCost()
end end
function cm.posfilter(c)
return c:IsCanChangePosition() and RushDuel.IsHasDefense(c)
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp) function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(cm.confilter,tp,LOCATION_MZONE,0,1,nil) return Duel.IsExistingMatchingCard(cm.confilter,tp,LOCATION_MZONE,0,1,nil)
end end
...@@ -30,13 +33,13 @@ function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -30,13 +33,13 @@ function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SendtoGrave(g,REASON_COST) Duel.SendtoGrave(g,REASON_COST)
end end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk) function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsCanChangePosition,tp,0,LOCATION_MZONE,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(cm.posfilter,tp,0,LOCATION_MZONE,1,nil) end
local g=Duel.GetMatchingGroup(Card.IsCanChangePosition,tp,0,LOCATION_MZONE,nil) local g=Duel.GetMatchingGroup(cm.posfilter,tp,0,LOCATION_MZONE,nil)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
end end
function cm.activate(e,tp,eg,ep,ev,re,r,rp) function cm.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_POSCHANGE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_POSCHANGE)
local g=Duel.SelectMatchingCard(tp,Card.IsCanChangePosition,tp,0,LOCATION_MZONE,1,3,nil) local g=Duel.SelectMatchingCard(tp,cm.posfilter,tp,0,LOCATION_MZONE,1,3,nil)
if g:GetCount()>0 then if g:GetCount()>0 then
Duel.HintSelection(g) Duel.HintSelection(g)
Duel.ChangePosition(g,POS_FACEUP_DEFENSE,POS_FACEUP_DEFENSE,POS_FACEUP_ATTACK,POS_FACEUP_ATTACK) Duel.ChangePosition(g,POS_FACEUP_DEFENSE,POS_FACEUP_DEFENSE,POS_FACEUP_ATTACK,POS_FACEUP_ATTACK)
......
...@@ -22,9 +22,9 @@ function cm.confilter(c) ...@@ -22,9 +22,9 @@ function cm.confilter(c)
end end
function cm.posfilter(c,tp) function cm.posfilter(c,tp)
if c:IsControler(tp) then if c:IsControler(tp) then
return c:IsPosition(POS_FACEUP_ATTACK) and c:IsCode(list[1]) and c:IsCanChangePosition() return c:IsPosition(POS_FACEUP_ATTACK) and c:IsCode(list[1]) and c:IsCanChangePosition() and RushDuel.IsHasDefense(c)
else else
return c:IsAttackPos() and c:IsCanChangePosition() return c:IsAttackPos() and c:IsCanChangePosition() and RushDuel.IsHasDefense(c)
end end
end end
function cm.check(g,tp) function cm.check(g,tp)
......
...@@ -13,7 +13,7 @@ function cm.initial_effect(c) ...@@ -13,7 +13,7 @@ function cm.initial_effect(c)
end end
--Activate --Activate
function cm.posfilter(c) function cm.posfilter(c)
return c:IsPosition(POS_FACEUP_ATTACK) and c:IsRace(RACE_AQUA) and c:IsCanChangePosition() return c:IsPosition(POS_FACEUP_ATTACK) and c:IsRace(RACE_AQUA) and c:IsCanChangePosition() and RushDuel.IsHasDefense(c)
end end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk) function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.posfilter,tp,LOCATION_MZONE,0,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(cm.posfilter,tp,LOCATION_MZONE,0,1,nil) end
......
...@@ -19,7 +19,7 @@ function cm.filter(c) ...@@ -19,7 +19,7 @@ function cm.filter(c)
end end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk) function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler() local c=e:GetHandler()
if chk==0 then return c:IsAttackPos() and c:IsCanChangePosition() end if chk==0 then return c:IsAttackPos() and c:IsCanChangePosition() and RushDuel.IsHasDefense(c) end
Duel.ChangePosition(c,POS_FACEUP_DEFENSE) Duel.ChangePosition(c,POS_FACEUP_DEFENSE)
end end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk) function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
......
...@@ -15,7 +15,7 @@ function cm.initial_effect(c) ...@@ -15,7 +15,7 @@ function cm.initial_effect(c)
end end
--Activate --Activate
function cm.costfilter(c) function cm.costfilter(c)
return c:IsAttackPos() and c:IsLevelAbove(7) and c:IsRace(RACE_WARRIOR) and c:IsCanChangePosition() return c:IsAttackPos() and c:IsLevelAbove(7) and c:IsRace(RACE_WARRIOR) and c:IsCanChangePosition() and RushDuel.IsHasDefense(c)
end end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk) function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.costfilter,tp,LOCATION_MZONE,0,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(cm.costfilter,tp,LOCATION_MZONE,0,1,nil) end
......
...@@ -13,7 +13,7 @@ function cm.initial_effect(c) ...@@ -13,7 +13,7 @@ function cm.initial_effect(c)
end end
--Activate --Activate
function cm.filter(c) function cm.filter(c)
return c:IsAttackPos() and c:IsCanChangePosition() return c:IsAttackPos() and c:IsCanChangePosition() and RushDuel.IsHasDefense(c)
end end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk) function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,0,LOCATION_MZONE,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,0,LOCATION_MZONE,1,nil) end
......
...@@ -20,7 +20,7 @@ function cm.confilter2(c,tp) ...@@ -20,7 +20,7 @@ function cm.confilter2(c,tp)
return c:GetSummonPlayer()==tp return c:GetSummonPlayer()==tp
end end
function cm.posfilter(c) function cm.posfilter(c)
return c:IsAttackPos() and c:IsCanChangePosition() return c:IsAttackPos() and c:IsCanChangePosition() and RushDuel.IsHasDefense(c)
end end
function cm.condition(e,tp,eg,ep,ev,re,r,rp) function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(cm.confilter1,tp,LOCATION_MZONE,0,2,nil) return Duel.IsExistingMatchingCard(cm.confilter1,tp,LOCATION_MZONE,0,2,nil)
......
...@@ -22,7 +22,7 @@ function cm.condition(e,tp,eg,ep,ev,re,r,rp) ...@@ -22,7 +22,7 @@ function cm.condition(e,tp,eg,ep,ev,re,r,rp)
end end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk) function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
local tc=Duel.GetAttacker() local tc=Duel.GetAttacker()
if chk==0 then return tc:IsAttackPos() and tc:IsCanChangePosition() end if chk==0 then return tc:IsAttackPos() and tc:IsCanChangePosition() and RushDuel.IsHasDefense(tc) end
Duel.SetOperationInfo(0,CATEGORY_POSITION,tc,1,0,0) Duel.SetOperationInfo(0,CATEGORY_POSITION,tc,1,0,0)
end end
function cm.activate(e,tp,eg,ep,ev,re,r,rp) function cm.activate(e,tp,eg,ep,ev,re,r,rp)
......
...@@ -18,7 +18,7 @@ function cm.filter(c) ...@@ -18,7 +18,7 @@ function cm.filter(c)
return c:IsFaceup() and c:IsType(TYPE_NORMAL) and c:IsDefenseAbove(2000) and RushDuel.IsHasDefense(c) return c:IsFaceup() and c:IsType(TYPE_NORMAL) and c:IsDefenseAbove(2000) and RushDuel.IsHasDefense(c)
end end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk) function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsCanChangePosition() end if chk==0 then return e:GetHandler():IsCanChangePosition() and RushDuel.IsHasDefense(e:GetHandler()) end
Duel.ChangePosition(e:GetHandler(),POS_FACEUP_DEFENSE,POS_FACEDOWN_DEFENSE,POS_FACEUP_ATTACK,POS_FACEUP_ATTACK) Duel.ChangePosition(e:GetHandler(),POS_FACEUP_DEFENSE,POS_FACEDOWN_DEFENSE,POS_FACEUP_ATTACK,POS_FACEUP_ATTACK)
end end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk) function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
......
...@@ -67,19 +67,19 @@ function Auxiliary.PreloadUds() ...@@ -67,19 +67,19 @@ function Auxiliary.PreloadUds()
e6:SetTargetRange(1,1) e6:SetTargetRange(1,1)
Duel.RegisterEffect(e6,0) Duel.RegisterEffect(e6,0)
--Trap Chain --Trap Chain
local e7=Effect.GlobalEffect()
e7:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e7:SetCode(EVENT_CHAINING)
e7:SetOperation(RushDuel.TrapChainLimitOperation)
Duel.RegisterEffect(e7,0)
--Once Per Turn
local e8=Effect.GlobalEffect() local e8=Effect.GlobalEffect()
e8:SetType(EFFECT_TYPE_FIELD) e8:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e8:SetCode(EFFECT_CANNOT_ACTIVATE) e8:SetCode(EVENT_CHAINING)
e8:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e8:SetOperation(RushDuel.TrapChainLimitOperation)
e8:SetTargetRange(1,1)
e8:SetValue(RushDuel.ActivateLimit)
Duel.RegisterEffect(e8,0) Duel.RegisterEffect(e8,0)
--Once Per Turn
local e9=Effect.GlobalEffect()
e9:SetType(EFFECT_TYPE_FIELD)
e9:SetCode(EFFECT_CANNOT_ACTIVATE)
e9:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e9:SetTargetRange(1,1)
e9:SetValue(RushDuel.ActivateLimit)
Duel.RegisterEffect(e9,0)
local e9=Effect.GlobalEffect() local e9=Effect.GlobalEffect()
e9:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e9:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e9:SetCode(EVENT_CHAIN_SOLVING) e9:SetCode(EVENT_CHAIN_SOLVING)
...@@ -164,31 +164,34 @@ function RushDuel.AddMaximumProcedure(c,max_atk,left_code,right_code) ...@@ -164,31 +164,34 @@ function RushDuel.AddMaximumProcedure(c,max_atk,left_code,right_code)
e5:SetRange(LOCATION_MZONE) e5:SetRange(LOCATION_MZONE)
e5:SetCondition(RushDuel.IsMaximumMode) e5:SetCondition(RushDuel.IsMaximumMode)
c:RegisterEffect(e5) c:RegisterEffect(e5)
local e6=Effect.CreateEffect(c) local e6=e5:Clone()
e6:SetType(EFFECT_TYPE_SINGLE) e6:SetCode(EFFECT_CANNOT_CHANGE_POS_E)
e6:SetCode(EFFECT_CANNOT_TURN_SET)
e6:SetProperty(EFFECT_FLAG_SINGLE_RANGE+EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e6:SetRange(LOCATION_MZONE)
e6:SetCondition(RushDuel.IsMaximumMode)
c:RegisterEffect(e6) c:RegisterEffect(e6)
--Use 3 MZone
local e7=Effect.CreateEffect(c) local e7=Effect.CreateEffect(c)
e7:SetType(EFFECT_TYPE_FIELD) e7:SetType(EFFECT_TYPE_SINGLE)
e7:SetCode(EFFECT_MAX_MZONE) e7:SetCode(EFFECT_CANNOT_TURN_SET)
e7:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE) e7:SetProperty(EFFECT_FLAG_SINGLE_RANGE+EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e7:SetRange(LOCATION_MZONE) e7:SetRange(LOCATION_MZONE)
e7:SetTargetRange(1,0)
e7:SetCondition(RushDuel.IsMaximumMode) e7:SetCondition(RushDuel.IsMaximumMode)
e7:SetValue(1)
c:RegisterEffect(e7) c:RegisterEffect(e7)
--Leave Field --Use 3 MZone
local e8=Effect.CreateEffect(c) local e8=Effect.CreateEffect(c)
e8:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS) e8:SetType(EFFECT_TYPE_FIELD)
e8:SetCode(EVENT_LEAVE_FIELD_P) e8:SetCode(EFFECT_MAX_MZONE)
e8:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE) e8:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e8:SetRange(LOCATION_MZONE)
e8:SetTargetRange(1,0)
e8:SetCondition(RushDuel.IsMaximumMode) e8:SetCondition(RushDuel.IsMaximumMode)
e8:SetOperation(RushDuel.LeaveOperation) e8:SetValue(1)
c:RegisterEffect(e8) c:RegisterEffect(e8)
--Leave Field
local e9=Effect.CreateEffect(c)
e9:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e9:SetCode(EVENT_LEAVE_FIELD_P)
e9:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e9:SetCondition(RushDuel.IsMaximumMode)
e9:SetOperation(RushDuel.LeaveOperation)
c:RegisterEffect(e9)
end end
function RushDuel.MaximumSummonFilter(c,e,tp,left_code,right_code) function RushDuel.MaximumSummonFilter(c,e,tp,left_code,right_code)
return c:IsCode(left_code,right_code) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP) return c:IsCode(left_code,right_code) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP)
......
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