Skip to content

Commit 05ebf06

Browse files
authored
Update "Missile Knight"
- Was coded as an Ignition instead of a Quick Effect - Minor script polish
1 parent 1702865 commit 05ebf06

File tree

1 file changed

+20
-20
lines changed

1 file changed

+20
-20
lines changed

unofficial/c511009727.lua

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,21 @@
1+
--ミサイル・ナイト
12
--Missile Knight
23
local s,id=GetID()
34
function s.initial_effect(c)
4-
--destroy
5-
local e2=Effect.CreateEffect(c)
6-
e2:SetDescription(aux.Stringid(id,0))
7-
e2:SetCategory(CATEGORY_DESTROY)
8-
e2:SetType(EFFECT_TYPE_IGNITION)
9-
e2:SetRange(LOCATION_GRAVE)
10-
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
11-
e2:SetCondition(s.descon)
12-
e2:SetCost(Cost.SelfBanish)
13-
e2:SetTarget(s.destg)
14-
e2:SetOperation(s.desop)
15-
c:RegisterEffect(e2)
5+
--Destroy 1 monster on the field if you destroyed a monster this turn
6+
local e1=Effect.CreateEffect(c)
7+
e1:SetDescription(aux.Stringid(id,0))
8+
e1:SetCategory(CATEGORY_DESTROY)
9+
e1:SetType(EFFECT_TYPE_QUICK_O)
10+
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
11+
e1:SetCode(EVENT_FREE_CHAIN)
12+
e1:SetRange(LOCATION_GRAVE)
13+
e1:SetCondition(function(e,tp) return s[tp]>0 end)
14+
e1:SetCost(Cost.SelfBanish)
15+
e1:SetTarget(s.destg)
16+
e1:SetOperation(s.desop)
17+
c:RegisterEffect(e1)
18+
--Check for monsters destroyed during a given turn
1619
aux.GlobalCheck(s,function()
1720
s[0]=0
1821
s[1]=0
@@ -27,27 +30,24 @@ function s.initial_effect(c)
2730
end)
2831
end)
2932
end
30-
function s.spfilter(c,tp)
33+
function s.chkfilter(c,tp)
3134
return c:IsPreviousLocation(LOCATION_MZONE) and (c:IsReason(REASON_BATTLE) or c:IsReason(REASON_EFFECT) and c:GetReasonPlayer()==tp)
3235
end
3336
function s.checkop(e,tp,eg,ep,ev,re,r,rp)
34-
if eg:IsExists(s.spfilter,1,nil,tp) then
37+
if eg:IsExists(s.chkfilter,1,nil,tp) then
3538
s[tp]=s[tp]+1
3639
end
3740
end
38-
function s.descon(e,tp)
39-
return s[tp]>0
40-
end
4141
function s.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
4242
if chkc then return chkc:IsLocation(LOCATION_MZONE) end
43-
if chk==0 then return true end
43+
if chk==0 then return Duel.IsExistingTarget(aux.TRUE,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil) end
4444
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
4545
local g=Duel.SelectTarget(tp,aux.TRUE,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
46-
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,#g,0,0)
46+
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,tp,0)
4747
end
4848
function s.desop(e,tp,eg,ep,ev,re,r,rp)
4949
local tc=Duel.GetFirstTarget()
5050
if tc and tc:IsRelateToEffect(e) then
5151
Duel.Destroy(tc,REASON_EFFECT)
5252
end
53-
end
53+
end

0 commit comments

Comments
 (0)