Commit 5b6f198f authored by salix5's avatar salix5

change controller

parent ff2b689d
...@@ -33,9 +33,8 @@ function c21768554.filter(c) ...@@ -33,9 +33,8 @@ function c21768554.filter(c)
end end
function c21768554.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c21768554.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and c21768554.filter(chkc) end if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and c21768554.filter(chkc) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 if chk==0 then return Duel.IsExistingTarget(c21768554.filter,tp,0,LOCATION_MZONE,1,nil) end
and Duel.IsExistingTarget(c21768554.filter,tp,0,LOCATION_MZONE,1,nil) end local ft=Duel.GetLocationCount(tp,LOCATION_MZONE,1-tp,LOCATION_REASON_CONTROL)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if ft>3 then ft=3 end if ft>3 then ft=3 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONTROL) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONTROL)
local g=Duel.SelectTarget(tp,c21768554.filter,tp,0,LOCATION_MZONE,1,ft,nil) local g=Duel.SelectTarget(tp,c21768554.filter,tp,0,LOCATION_MZONE,1,ft,nil)
......
...@@ -51,8 +51,7 @@ function c32919136.eqlimit(e,c) ...@@ -51,8 +51,7 @@ function c32919136.eqlimit(e,c)
end end
function c32919136.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c32919136.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and c32919136.filter(chkc) end if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and c32919136.filter(chkc) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 if chk==0 then return Duel.IsExistingTarget(c32919136.filter,tp,0,LOCATION_MZONE,1,nil) end
and Duel.IsExistingTarget(c32919136.filter,tp,0,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONTROL) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONTROL)
local g=Duel.SelectTarget(tp,c32919136.filter,tp,0,LOCATION_MZONE,1,1,nil) local g=Duel.SelectTarget(tp,c32919136.filter,tp,0,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_CONTROL,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_CONTROL,g,1,0,0)
......
...@@ -15,7 +15,6 @@ function c35059553.initial_effect(c) ...@@ -15,7 +15,6 @@ function c35059553.initial_effect(c)
e2:SetValue(c35059553.value) e2:SetValue(c35059553.value)
c:RegisterEffect(e2) c:RegisterEffect(e2)
end end
LOCATION_REASON_TOFIELD=1
function c35059553.value(e,fp,rp,r) function c35059553.value(e,fp,rp,r)
if rp==e:GetHandlerPlayer() or r~=LOCATION_REASON_TOFIELD then return 5 end if rp==e:GetHandlerPlayer() or r~=LOCATION_REASON_TOFIELD then return 5 end
local limit=Duel.GetFieldGroupCount(e:GetHandlerPlayer(),LOCATION_MZONE,0) local limit=Duel.GetFieldGroupCount(e:GetHandlerPlayer(),LOCATION_MZONE,0)
......
...@@ -18,8 +18,7 @@ function c38468214.filter(c) ...@@ -18,8 +18,7 @@ function c38468214.filter(c)
end end
function c38468214.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c38468214.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and c38468214.filter(chkc) end if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and c38468214.filter(chkc) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 if chk==0 then return Duel.IsExistingTarget(c38468214.filter,tp,0,LOCATION_MZONE,1,nil) end
and Duel.IsExistingTarget(c38468214.filter,tp,0,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONTROL) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONTROL)
local g=Duel.SelectTarget(tp,c38468214.filter,tp,0,LOCATION_MZONE,1,1,nil) local g=Duel.SelectTarget(tp,c38468214.filter,tp,0,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_CONTROL,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_CONTROL,g,1,0,0)
......
...@@ -17,7 +17,7 @@ function c43476205.filter1(c,e,tp) ...@@ -17,7 +17,7 @@ function c43476205.filter1(c,e,tp)
end end
function c43476205.filter2(c,e,tp) function c43476205.filter2(c,e,tp)
local rk=c:GetRank() local rk=c:GetRank()
return rk>0 and c:IsFaceup() and c:GetOverlayCount()==0 and c:IsAbleToChangeControler() return rk>0 and c:IsFaceup() and c:GetOverlayCount()==0 and c:IsControlerCanBeChanged()
and Duel.IsExistingMatchingCard(c43476205.filter3,tp,LOCATION_EXTRA,0,1,nil,e,tp,c,rk+1) and Duel.IsExistingMatchingCard(c43476205.filter3,tp,LOCATION_EXTRA,0,1,nil,e,tp,c,rk+1)
end end
function c43476205.filter3(c,e,tp,mc,rk) function c43476205.filter3(c,e,tp,mc,rk)
...@@ -34,8 +34,7 @@ function c43476205.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) ...@@ -34,8 +34,7 @@ function c43476205.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
Duel.SelectTarget(tp,c43476205.filter1,tp,LOCATION_MZONE,0,1,1,nil,e,tp) Duel.SelectTarget(tp,c43476205.filter1,tp,LOCATION_MZONE,0,1,1,nil,e,tp)
else else
if chkc then return chkc:IsControler(1-tp) and chkc:IsLocation(LOCATION_MZONE) and c43476205.filter2(chkc,e,tp) end if chkc then return chkc:IsControler(1-tp) and chkc:IsLocation(LOCATION_MZONE) and c43476205.filter2(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 if chk==0 then return Duel.IsExistingTarget(c43476205.filter2,tp,0,LOCATION_MZONE,1,nil,e,tp) end
and Duel.IsExistingTarget(c43476205.filter2,tp,0,LOCATION_MZONE,1,nil,e,tp) end
e:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_CONTROL) e:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_CONTROL)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local g=Duel.SelectTarget(tp,c43476205.filter2,tp,0,LOCATION_MZONE,1,1,nil,e,tp) local g=Duel.SelectTarget(tp,c43476205.filter2,tp,0,LOCATION_MZONE,1,1,nil,e,tp)
......
...@@ -46,8 +46,7 @@ function c45247637.filter(c) ...@@ -46,8 +46,7 @@ function c45247637.filter(c)
end end
function c45247637.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c45247637.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:GetLocation()==LOCATION_MZONE and chkc:GetControler()~=tp and c45247637.filter(chkc) end if chkc then return chkc:GetLocation()==LOCATION_MZONE and chkc:GetControler()~=tp and c45247637.filter(chkc) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 if chk==0 then return Duel.IsExistingTarget(c45247637.filter,tp,0,LOCATION_MZONE,1,nil) end
and Duel.IsExistingTarget(c45247637.filter,tp,0,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONTROL) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONTROL)
local g=Duel.SelectTarget(tp,c45247637.filter,tp,0,LOCATION_MZONE,1,1,nil) local g=Duel.SelectTarget(tp,c45247637.filter,tp,0,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_CONTROL,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_CONTROL,g,1,0,0)
......
...@@ -43,8 +43,7 @@ function c45986603.eqlimit(e,c) ...@@ -43,8 +43,7 @@ function c45986603.eqlimit(e,c)
end end
function c45986603.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c45986603.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and c45986603.filter(chkc) end if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and c45986603.filter(chkc) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 if chk==0 then return Duel.IsExistingTarget(c45986603.filter,tp,0,LOCATION_MZONE,1,nil) end
and Duel.IsExistingTarget(c45986603.filter,tp,0,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONTROL) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONTROL)
local g=Duel.SelectTarget(tp,c45986603.filter,tp,0,LOCATION_MZONE,1,1,nil) local g=Duel.SelectTarget(tp,c45986603.filter,tp,0,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_CONTROL,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_CONTROL,g,1,0,0)
......
...@@ -40,8 +40,7 @@ function c59258334.filter(c) ...@@ -40,8 +40,7 @@ function c59258334.filter(c)
end end
function c59258334.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c59258334.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and c59258334.filter(chkc) end if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and c59258334.filter(chkc) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 if chk==0 then return Duel.IsExistingTarget(c59258334.filter,tp,0,LOCATION_MZONE,1,nil) end
and Duel.IsExistingTarget(c59258334.filter,tp,0,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONTROL) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONTROL)
local g=Duel.SelectTarget(tp,c59258334.filter,tp,0,LOCATION_MZONE,1,1,nil) local g=Duel.SelectTarget(tp,c59258334.filter,tp,0,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_CONTROL,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_CONTROL,g,1,0,0)
......
...@@ -23,7 +23,7 @@ function c70284332.filter(c,e,tp) ...@@ -23,7 +23,7 @@ function c70284332.filter(c,e,tp)
end end
function c70284332.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c70284332.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return eg:IsContains(chkc) and c70284332.filter(chkc,e,1-tp) end if chkc then return eg:IsContains(chkc) and c70284332.filter(chkc,e,1-tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and eg:IsExists(c70284332.filter,1,nil,e,1-tp) end if chk==0 then return eg:IsExists(c70284332.filter,1,nil,e,1-tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONTROL) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONTROL)
local g=eg:FilterSelect(tp,c70284332.filter,1,1,nil,e,1-tp) local g=eg:FilterSelect(tp,c70284332.filter,1,1,nil,e,1-tp)
Duel.SetTargetCard(g) Duel.SetTargetCard(g)
......
...@@ -19,8 +19,7 @@ function c71564150.filter(c) ...@@ -19,8 +19,7 @@ function c71564150.filter(c)
return c:IsFaceup() and c:IsLevelBelow(3) and c:IsControlerCanBeChanged() return c:IsFaceup() and c:IsLevelBelow(3) and c:IsControlerCanBeChanged()
end end
function c71564150.target(e,tp,eg,ep,ev,re,r,rp,chk) function c71564150.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 if chk==0 then return Duel.IsExistingMatchingCard(c71564150.filter,tp,0,LOCATION_MZONE,1,nil) end
and Duel.IsExistingMatchingCard(c71564150.filter,tp,0,LOCATION_MZONE,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_CONTROL,nil,1,1-tp,LOCATION_MZONE) Duel.SetOperationInfo(0,CATEGORY_CONTROL,nil,1,1-tp,LOCATION_MZONE)
end end
function c71564150.operation(e,tp,eg,ep,ev,re,r,rp) function c71564150.operation(e,tp,eg,ep,ev,re,r,rp)
...@@ -54,6 +53,8 @@ function c71564150.operation(e,tp,eg,ep,ev,re,r,rp) ...@@ -54,6 +53,8 @@ function c71564150.operation(e,tp,eg,ep,ev,re,r,rp)
e4:SetReset(RESET_EVENT+0x1fc0000+RESET_PHASE+PHASE_END) e4:SetReset(RESET_EVENT+0x1fc0000+RESET_PHASE+PHASE_END)
e4:SetValue(1) e4:SetValue(1)
tc:RegisterEffect(e4) tc:RegisterEffect(e4)
elseif not tc:IsImmuneToEffect(e) and tc:IsAbleToChangeControler() then
Duel.Destroy(tc,REASON_EFFECT)
end end
tc=g:GetNext() tc=g:GetNext()
end end
......
...@@ -108,6 +108,9 @@ REASON_REPLACE =0x1000000 --代替 ...@@ -108,6 +108,9 @@ REASON_REPLACE =0x1000000 --代替
REASON_DRAW =0x2000000 --抽卡 REASON_DRAW =0x2000000 --抽卡
REASON_REDIRECT =0x4000000 --改变去向(大宇宙,带菌等) REASON_REDIRECT =0x4000000 --改变去向(大宇宙,带菌等)
REASON_REVEAL =0x8000000 --翻开卡组(森罗) REASON_REVEAL =0x8000000 --翻开卡组(森罗)
--Location Reason
LOCATION_REASON_TOFIELD =0x1 --Duel.GetLocationCount()預設值,凱薩競技場
LOCATION_REASON_CONTROL =0x2 --Card.IsControlerCanBeChanged()使用
--Summon Type --召唤类型 --Summon Type --召唤类型
SUMMON_TYPE_NORMAL =0x10000000 --通常召唤(EFFECT_SUMMON_PROC,EFFECT_SET_PROC 可用Value修改數值) SUMMON_TYPE_NORMAL =0x10000000 --通常召唤(EFFECT_SUMMON_PROC,EFFECT_SET_PROC 可用Value修改數值)
SUMMON_TYPE_ADVANCE =0x11000000 --上级召唤 SUMMON_TYPE_ADVANCE =0x11000000 --上级召唤
...@@ -220,7 +223,7 @@ RESET_OVERLAY =0x04000000 --超量叠放重置 ...@@ -220,7 +223,7 @@ RESET_OVERLAY =0x04000000 --超量叠放重置
EFFECT_TYPE_SINGLE =0x0001 --自己状态变化时触发 EFFECT_TYPE_SINGLE =0x0001 --自己状态变化时触发
EFFECT_TYPE_FIELD =0x0002 --场上所有卡状态变化时触发 EFFECT_TYPE_FIELD =0x0002 --场上所有卡状态变化时触发
EFFECT_TYPE_EQUIP =0x0004 --装备效果 EFFECT_TYPE_EQUIP =0x0004 --装备效果
EFFECT_TYPE_ACTIONS =0x0008 --怪兽效果发动(对峙的G) EFFECT_TYPE_ACTIONS =0x0008 --触发型,以下的預設屬性(对峙的G)
EFFECT_TYPE_ACTIVATE =0x0010 --魔陷发动 EFFECT_TYPE_ACTIVATE =0x0010 --魔陷发动
EFFECT_TYPE_FLIP =0x0020 --翻转效果 EFFECT_TYPE_FLIP =0x0020 --翻转效果
EFFECT_TYPE_IGNITION =0x0040 --起动效果 EFFECT_TYPE_IGNITION =0x0040 --起动效果
...@@ -669,7 +672,7 @@ DUEL_ENABLE_PRIORITY =0x08 --启动优先权 ...@@ -669,7 +672,7 @@ DUEL_ENABLE_PRIORITY =0x08 --启动优先权
DUEL_PSEUDO_SHUFFLE =0x10 --不洗牌 DUEL_PSEUDO_SHUFFLE =0x10 --不洗牌
DUEL_TAG_MODE =0x20 --双打PP DUEL_TAG_MODE =0x20 --双打PP
DUEL_SIMPLE_AI =0x40 --AI DUEL_SIMPLE_AI =0x40 --AI
-- --Activity counter
ACTIVITY_SUMMON =1 -- ACTIVITY_SUMMON =1 --
ACTIVITY_NORMALSUMMON =2 -- ACTIVITY_NORMALSUMMON =2 --
ACTIVITY_SPSUMMON =3 -- ACTIVITY_SPSUMMON =3 --
......
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