Commit ca560194 authored by mercury233's avatar mercury233 Committed by GitHub

fix

parent 4668b1fd
......@@ -5,28 +5,19 @@ function c42899204.initial_effect(c)
e1:SetCategory(CATEGORY_CONTROL)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_CANNOT_DISABLE)
e1:SetTarget(c42899204.target)
e1:SetOperation(c42899204.activate)
c:RegisterEffect(e1)
--target
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetRange(LOCATION_SZONE)
e2:SetCode(EVENT_CHAIN_SOLVED)
e2:SetLabelObject(e1)
e2:SetCondition(c42899204.tgcon)
e2:SetOperation(c42899204.tgop)
c:RegisterEffect(e2)
--setcode
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_ADD_SETCODE)
e3:SetRange(LOCATION_SZONE)
e3:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e3:SetCondition(c42899204.setcon)
e3:SetTarget(aux.ctg)
e3:SetValue(0x129)
e3:SetTarget(c42899204.distg)
c:RegisterEffect(e3)
--Destroy
local e4=Effect.CreateEffect(c)
......@@ -56,24 +47,30 @@ function c42899204.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
local c=e:GetHandler()
if c:IsRelateToEffect(e) and tc:IsRelateToEffect(e) then
Duel.GetControl(tc,tp)
c:SetCardTarget(tc)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_CONTROL)
e1:SetProperty(EFFECT_FLAG_OWNER_RELATE+EFFECT_FLAG_SET_AVAILABLE)
e1:SetValue(c42899204.ctval)
e1:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET)
e1:SetCondition(c42899204.con)
tc:RegisterEffect(e1,true)
end
end
function c42899204.tgcon(e,tp,eg,ep,ev,re,r,rp)
return re==e:GetLabelObject()
function c42899204.con(e)
local c=e:GetOwner()
local h=e:GetHandler()
return c:IsHasCardTarget(h) and not h:IsImmuneToEffect(e)
end
function c42899204.tgop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetChainInfo(ev,CHAININFO_TARGET_CARDS):GetFirst()
if c:IsRelateToEffect(re) and tc:IsFaceup() and tc:IsRelateToEffect(re) then
c:SetCardTarget(tc)
end
function c42899204.ctval(e,c)
return e:GetOwnerPlayer()
end
function c42899204.filter2(c)
return c:IsCode(44133040) and c:IsFaceup()
end
function c42899204.distg(e,c)
return e:GetHandler():IsHasCardTarget(c) and Duel.IsExistingMatchingCard(c42899204.filter2,tp,LOCATION_SZONE,0,1,nil)
function c42899204.setcon(e)
return Duel.IsExistingMatchingCard(c42899204.filter2,e:GetOwnerPlayer(),LOCATION_SZONE,0,1,nil)
end
function c42899204.descon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
......
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