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)
return c:IsFaceup() and c:IsControlerCanBeChanged()
end
function s.cttg(e,tp,eg,ep,ev,re,r,rp,chk)
local seq=e:GetHandler():GetSequence()
local ctrl_tp=e:GetHandlerPlayer()
local opp_tp=1-ctrl_tp
if chk==0 then
local g=Duel.GetMatchingGroup(s.ctfilter,opp_tp,LOCATION_MZONE,0,nil)
if #g==0 then return false end
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
local g=Duel.GetMatchingGroup(s.ctfilter,opp_tp,LOCATION_MZONE,0,nil)
local maxatk=g:GetMaxGroup(Card.GetAttack)
......@@ -72,9 +73,10 @@ function s.ctop(e,tp,eg,ep,ev,re,r,rp)
local ctrl_tp=c:GetControler()
local opp_tp=1-ctrl_tp
local seq=c:GetSequence() -- 获取当前卡所在序列号
local zone=1<<seq
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)
......@@ -84,22 +86,35 @@ function s.ctop(e,tp,eg,ep,ev,re,r,rp)
end
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)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
if tc:IsCanBeDisabledByEffect(e) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DISABLE)
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)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_CANNOT_ATTACK)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e2)
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetCode(EFFECT_CANNOT_ATTACK)
e4:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e4)
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