Skip to content

Commit 3e17d00

Browse files
authored
Update "Gulliver Chain"
-Script clean-up -Does not require an effect to be the reason for activation requirement
1 parent 00a828b commit 3e17d00

1 file changed

Lines changed: 19 additions & 17 deletions

File tree

unofficial/c511001458.lua

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,39 @@
1+
--ガリバー・チェーン
12
--Gulliver Chain
23
local s,id=GetID()
34
function s.initial_effect(c)
4-
--activate
5+
--When a monster(s) on the field changes its position: Target 1 of those monsters; change that target to face-up Defense Position.
56
local e1=Effect.CreateEffect(c)
6-
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
7+
e1:SetCategory(CATEGORY_POSITION)
78
e1:SetType(EFFECT_TYPE_ACTIVATE)
9+
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
810
e1:SetCode(EVENT_CHANGE_POS)
9-
e1:SetCondition(s.condition)
1011
e1:SetTarget(s.target)
1112
e1:SetOperation(s.operation)
1213
c:RegisterEffect(e1)
1314
local e2=Effect.CreateEffect(c)
1415
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
1516
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
16-
e2:SetRange(LOCATION_SZONE)
1717
e2:SetCode(EVENT_CHAIN_SOLVED)
18+
e2:SetRange(LOCATION_SZONE)
1819
e2:SetLabelObject(e1)
1920
e2:SetCondition(aux.PersistentTgCon)
2021
e2:SetOperation(aux.PersistentTgOp(true))
2122
c:RegisterEffect(e2)
22-
--destroy
23+
--When the targeted monster is changed to Attack Position, destroy it and this card.
2324
local e3=Effect.CreateEffect(c)
2425
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
2526
e3:SetCode(EVENT_CHANGE_POS)
26-
e3:SetOperation(s.desop)
2727
e3:SetRange(LOCATION_SZONE)
28+
e3:SetCondition(s.descon)
29+
e3:SetOperation(s.desop)
2830
c:RegisterEffect(e3)
2931
end
30-
function s.condition(e,tp,eg,ep,ev,re,r,rp)
31-
return re and rp==tp
32-
end
33-
function s.filter(c,e,tp)
34-
return c:IsControler(1-tp) and c:IsCanBeEffectTarget(e) and c:IsLocation(LOCATION_MZONE)
32+
function s.filter(c,e)
33+
return c:IsCanBeEffectTarget(e) and c:IsLocation(LOCATION_MZONE)
3534
end
3635
function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
37-
local g=eg:Filter(s.filter,nil,e,tp)
36+
local g=eg:Filter(s.filter,nil,e)
3837
if chkc then return g:IsContains(chkc) end
3938
if chk==0 then return #g>0 end
4039
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_POSCHANGE)
@@ -51,11 +50,14 @@ function s.operation(e,tp,eg,ep,ev,re,r,rp)
5150
Duel.ChangePosition(tc,POS_FACEUP_DEFENSE)
5251
end
5352
end
53+
function s.descon(e,tp,eg,ep,ev,re,r,rp)
54+
local tc=e:GetHandler():GetFirstCardTarget()
55+
return tc and eg:IsContains(tc) and tc:IsAttackPos()
56+
end
5457
function s.desop(e,tp,eg,ep,ev,re,r,rp)
58+
Duel.Hint(HINT_CARD,0,id)
5559
local c=e:GetHandler()
5660
local tc=c:GetFirstCardTarget()
57-
if tc and tc:IsAttackPos() then
58-
local g=Group.FromCards(tc,c)
59-
Duel.Destroy(g,REASON_EFFECT)
60-
end
61-
end
61+
local g=Group.FromCards(tc,c)
62+
Duel.Destroy(g,REASON_EFFECT)
63+
end

0 commit comments

Comments
 (0)