Commit bd2aac58 authored by GuGu's avatar GuGu

Update c34036.lua

parent f0b9dc8e
Pipeline #32864 passed with stage
in 7 seconds
...@@ -54,13 +54,14 @@ function s.ctfilter(c) ...@@ -54,13 +54,14 @@ function s.ctfilter(c)
return c:IsFaceup() and c:IsControlerCanBeChanged() return c:IsFaceup() and c:IsControlerCanBeChanged()
end end
function s.cttg(e,tp,eg,ep,ev,re,r,rp,chk) function s.cttg(e,tp,eg,ep,ev,re,r,rp,chk)
local seq=e:GetHandler():GetSequence()
local ctrl_tp=e:GetHandlerPlayer() local ctrl_tp=e:GetHandlerPlayer()
local opp_tp=1-ctrl_tp local opp_tp=1-ctrl_tp
if chk==0 then if chk==0 then
local g=Duel.GetMatchingGroup(s.ctfilter,opp_tp,LOCATION_MZONE,0,nil) local g=Duel.GetMatchingGroup(s.ctfilter,opp_tp,LOCATION_MZONE,0,nil)
if #g==0 then return false end if #g==0 then return false end
local maxatk=g:GetMaxGroup(Card.GetAttack):GetFirst() local maxatk=g:GetMaxGroup(Card.GetAttack):GetFirst()
return maxatk and Duel.GetLocationCount(ctrl_tp,LOCATION_MZONE)>0 return maxatk and e:GetHandler():IsOnField() and seq<=4 and Duel.CheckLocation(tp,LOCATION_MZONE,seq)
end end
local g=Duel.GetMatchingGroup(s.ctfilter,opp_tp,LOCATION_MZONE,0,nil) local g=Duel.GetMatchingGroup(s.ctfilter,opp_tp,LOCATION_MZONE,0,nil)
local maxatk=g:GetMaxGroup(Card.GetAttack) local maxatk=g:GetMaxGroup(Card.GetAttack)
...@@ -72,9 +73,10 @@ function s.ctop(e,tp,eg,ep,ev,re,r,rp) ...@@ -72,9 +73,10 @@ function s.ctop(e,tp,eg,ep,ev,re,r,rp)
local ctrl_tp=c:GetControler() local ctrl_tp=c:GetControler()
local opp_tp=1-ctrl_tp local opp_tp=1-ctrl_tp
local seq=c:GetSequence() -- 获取当前卡所在序列号 local seq=c:GetSequence() -- 获取当前卡所在序列号
local zone=1<<seq
local g=Duel.GetMatchingGroup(Card.IsFaceup,opp_tp,LOCATION_MZONE,0,nil) local g=Duel.GetMatchingGroup(Card.IsFaceup,opp_tp,LOCATION_MZONE,0,nil)
if #g==0 then return end if #g==0 and not (c:IsOnField() and seq<=4 and Duel.CheckLocation(tp,LOCATION_MZONE,seq)) then return end
-- 获取最高攻击力怪兽 -- 获取最高攻击力怪兽
local maxatk=g:GetMaxGroup(Card.GetAttack) local maxatk=g:GetMaxGroup(Card.GetAttack)
...@@ -84,22 +86,35 @@ function s.ctop(e,tp,eg,ep,ev,re,r,rp) ...@@ -84,22 +86,35 @@ function s.ctop(e,tp,eg,ep,ev,re,r,rp)
end end
local tc=maxatk:GetFirst() local tc=maxatk:GetFirst()
if tc and Duel.GetLocationCount(ctrl_tp,LOCATION_MZONE,seq)>0 then if tc and tc:IsControlerCanBeChanged() then
-- 转移控制权 -- 转移控制权
Duel.GetControl(tc,ctrl_tp,0,0,seq) Duel.GetControl(tc,tp,0,0,zone)
-- 附加效果:无效化+不能攻击 -- 附加效果:无效化+不能攻击
local e1=Effect.CreateEffect(c) if tc:IsCanBeDisabledByEffect(e) then
e1:SetType(EFFECT_TYPE_SINGLE) local e1=Effect.CreateEffect(c)
e1:SetCode(EFFECT_DISABLE) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD) e1:SetCode(EFFECT_DISABLE)
tc:RegisterEffect(e1) e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetValue(RESET_TURN_SET)
tc:RegisterEffect(e2)
if tc:IsType(TYPE_TRAPMONSTER) then
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_DISABLE_TRAPMONSTER)
e3:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e3)
end
end
local e2=Effect.CreateEffect(c) local e4=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE) e4:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_CANNOT_ATTACK) e4:SetCode(EFFECT_CANNOT_ATTACK)
e2:SetReset(RESET_EVENT+RESETS_STANDARD) e4:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e2) tc:RegisterEffect(e4)
end end
end 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