Skip to content

Commit fa92c10

Browse files
authored
Update "Shutter Layer 1"
-Should Special Summon as an effect monster -Missing target flag -other script fixes
1 parent 485dc78 commit fa92c10

1 file changed

Lines changed: 18 additions & 16 deletions

File tree

‎unofficial/c810000080.lua‎

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,41 +2,42 @@
22
--Shutter Layer 1
33
local s,id=GetID()
44
function s.initial_effect(c)
5-
--Special Summon this card as a Normal Monster
5+
--Special Summon this card as an Effect Monster
66
local e1=Effect.CreateEffect(c)
77
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
88
e1:SetType(EFFECT_TYPE_ACTIVATE)
9+
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
910
e1:SetCode(EVENT_FREE_CHAIN)
10-
e1:SetTarget(s.target)
11-
e1:SetOperation(s.operation)
11+
e1:SetTarget(s.selfsptg)
12+
e1:SetOperation(s.selfspop)
1213
c:RegisterEffect(e1)
13-
--Destroy this card
14+
--Destroy this card when the targeted monster leaves the field
1415
local e2=Effect.CreateEffect(c)
15-
e2:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
16+
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
1617
e2:SetRange(LOCATION_ONFIELD)
1718
e2:SetCode(EVENT_LEAVE_FIELD)
1819
e2:SetCondition(s.descon)
1920
e2:SetOperation(s.desop)
2021
c:RegisterEffect(e2)
2122
end
22-
function s.filter(c,e,tp)
23-
return c:IsFaceup() and c:GetLevel()>0
24-
and Duel.IsPlayerCanSpecialSummonMonster(tp,id,0,TYPE_MONSTER|TYPE_NORMAL,c:GetBaseAttack(),c:GetBaseDefense(),c:GetLevel(),c:GetRace(),c:GetAttribute())
23+
function s.selfspfilter(c,e,tp)
24+
return c:IsFaceup() and c:HasLevel()
25+
and Duel.IsPlayerCanSpecialSummonMonster(tp,id,0,TYPE_MONSTER|TYPE_EFFECT,c:GetBaseAttack(),c:GetBaseDefense(),c:GetLevel(),c:GetRace(),c:GetAttribute())
2526
end
26-
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
27-
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and s.filter(chkc,e,tp) end
27+
function s.selfsptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
28+
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and s.selfspfilter(chkc,e,tp) end
2829
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
29-
and Duel.IsExistingTarget(s.filter,tp,0,LOCATION_MZONE,1,nil,e,tp) end
30-
local g=Duel.SelectTarget(tp,s.filter,tp,0,LOCATION_MZONE,1,1,nil,e,tp)
30+
and Duel.IsExistingTarget(s.selfspfilter,tp,0,LOCATION_MZONE,1,nil,e,tp) end
31+
local g=Duel.SelectTarget(tp,s.selfspfilter,tp,0,LOCATION_MZONE,1,1,nil,e,tp)
3132
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
3233
end
33-
function s.operation(e,tp,eg,ep,ev,re,r,rp)
34+
function s.selfspop(e,tp,eg,ep,ev,re,r,rp)
3435
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
3536
local tc=Duel.GetFirstTarget()
3637
local c=e:GetHandler()
3738
if not c:IsRelateToEffect(e) or not tc or tc:IsFacedown() or not tc:IsRelateToEffect(e) then return end
38-
if not Duel.IsPlayerCanSpecialSummonMonster(tp,id,0,TYPE_MONSTER|TYPE_NORMAL,tc:GetBaseAttack(),tc:GetBaseDefense(),tc:GetLevel(),tc:GetRace(),tc:GetAttribute()) then return end
39-
c:AddMonsterAttribute(TYPE_MONSTER|TYPE_NORMAL|TYPE_SPELL,tc:GetAttribute(),tc:GetRace(),tc:GetLevel(),tc:GetBaseAttack(),tc:GetBaseDefense())
39+
if not Duel.IsPlayerCanSpecialSummonMonster(tp,id,0,TYPE_MONSTER|TYPE_EFFECT,tc:GetAttack(),tc:GetDefense(),tc:GetLevel(),tc:GetRace(),tc:GetAttribute()) then return end
40+
c:AddMonsterAttribute(TYPE_MONSTER|TYPE_EFFECT|TYPE_SPELL,tc:GetAttribute(),tc:GetRace(),tc:GetLevel(),tc:GetBaseAttack(),tc:GetBaseDefense())
4041
if Duel.SpecialSummonStep(c,0,tp,tp,true,false,POS_FACEUP) then
4142
c:AddMonsterAttributeComplete()
4243
local e1=Effect.CreateEffect(c)
@@ -81,5 +82,6 @@ function s.descon(e,tp,eg,ep,ev,re,r,rp)
8182
return tc and eg:IsContains(tc)
8283
end
8384
function s.desop(e,tp,eg,ep,ev,re,r,rp)
85+
Duel.Hint(HINT_CARD,0,id)
8486
Duel.Destroy(e:GetHandler(),REASON_EFFECT)
85-
end
87+
end

0 commit comments

Comments
 (0)