-
Notifications
You must be signed in to change notification settings - Fork 151
Expand file tree
/
Copy pathc22862454.lua
More file actions
45 lines (45 loc) · 1.6 KB
/
Copy pathc22862454.lua
File metadata and controls
45 lines (45 loc) · 1.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
--プロキシー・ドラゴン
function c22862454.initial_effect(c)
--link summon
aux.AddLinkProcedure(c,nil,2,2)
c:EnableReviveLimit()
--destroy replace
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_DESTROY_REPLACE)
e1:SetRange(LOCATION_MZONE)
e1:SetTarget(c22862454.desreptg)
e1:SetValue(c22862454.desrepval)
e1:SetOperation(c22862454.desrepop)
c:RegisterEffect(e1)
end
function c22862454.repfilter(c,tp)
return c:IsControler(tp) and c:IsOnField()
and c:IsReason(REASON_BATTLE+REASON_EFFECT) and not c:IsReason(REASON_REPLACE)
end
function c22862454.desfilter(c,e,tp)
return c:IsControler(tp) and c:IsType(TYPE_MONSTER)
and c:IsDestructable(e) and not c:IsStatus(STATUS_DESTROY_CONFIRMED+STATUS_BATTLE_DESTROYED) and not c:IsImmuneToEffect(e)
end
function c22862454.desreptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local g=c:GetLinkedGroup()
if chk==0 then return eg:IsExists(c22862454.repfilter,1,nil,tp)
and g:IsExists(c22862454.desfilter,1,nil,e,tp) end
if Duel.SelectEffectYesNo(tp,c,96) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESREPLACE)
local sg=g:FilterSelect(tp,c22862454.desfilter,1,1,nil,e,tp)
e:SetLabelObject(sg:GetFirst())
sg:GetFirst():SetStatus(STATUS_DESTROY_CONFIRMED,true)
return true
else return false end
end
function c22862454.desrepval(e,c)
return c22862454.repfilter(c,e:GetHandlerPlayer())
end
function c22862454.desrepop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,0,22862454)
local tc=e:GetLabelObject()
tc:SetStatus(STATUS_DESTROY_CONFIRMED,false)
Duel.Destroy(tc,REASON_EFFECT+REASON_REPLACE)
end