Skip to content

Commit 4028afe

Browse files
authored
Fix "The Phantom Knights of Ragged Gloves"
Should be able to send any "Phantom Knights" card/general script clean-up
1 parent 8828495 commit 4028afe

File tree

1 file changed

+11
-22
lines changed

1 file changed

+11
-22
lines changed

official/c63821877.lua

Lines changed: 11 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,29 @@
11
--幻影騎士団ラギッドグローブ
2+
--The Phantom Knights of Ragged Gloves
23
local s,id=GetID()
34
function s.initial_effect(c)
4-
--effect gain
5+
--An Xyz Monster that uses this card as material gains 1000 ATK
56
local e1=Effect.CreateEffect(c)
67
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
78
e1:SetCode(EVENT_BE_MATERIAL)
89
e1:SetProperty(EFFECT_FLAG_EVENT_PLAYER)
910
e1:SetCountLimit(1,id)
10-
e1:SetCondition(s.efcon)
11+
e1:SetCondition(function(e,tp,eg,ep,ev,re,r,rp) return r==REASON_XYZ and e:GetHandler():GetReasonCard():IsAttribute(ATTRIBUTE DARK) end)
1112
e1:SetOperation(s.efop)
1213
c:RegisterEffect(e1)
13-
--to grave
14+
--Send 1 "Phantom Knights" card from your Deck to the GY
1415
local e2=Effect.CreateEffect(c)
1516
e2:SetDescription(aux.Stringid(id,1))
1617
e2:SetCategory(CATEGORY_TOGRAVE)
1718
e2:SetType(EFFECT_TYPE_IGNITION)
1819
e2:SetRange(LOCATION_GRAVE)
1920
e2:SetCountLimit(1,{id,1})
20-
e2:SetCost(aux.bfgcost)
21+
e2:SetCost(Cost.SelfBanish)
2122
e2:SetTarget(s.tgtg)
2223
e2:SetOperation(s.tgop)
2324
c:RegisterEffect(e2)
2425
end
25-
s.listed_series={0x10db,0xdb}
26-
function s.efcon(e,tp,eg,ep,ev,re,r,rp)
27-
local c=e:GetHandler()
28-
return r==REASON_XYZ and c:GetReasonCard():IsAttribute(ATTRIBUTE_DARK)
29-
end
26+
s.listed_series={SET_PHANTOM_KNIGHTS}
3027
function s.efop(e,tp,eg,ep,ev,re,r,rp)
3128
local c=e:GetHandler()
3229
local rc=c:GetReasonCard()
@@ -35,35 +32,27 @@ function s.efop(e,tp,eg,ep,ev,re,r,rp)
3532
e1:SetCategory(CATEGORY_ATKCHANGE)
3633
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
3734
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
38-
e1:SetCondition(s.atkcon)
35+
e1:SetCondition(function (e) return e:GetHandler():IsXyzSummoned() end)
3936
e1:SetOperation(s.atkop)
40-
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
37+
e1:SetReset(RESET_EVENT|RESETS_STANDARD)
4138
rc:RegisterEffect(e1,true)
4239
if not rc:IsType(TYPE_EFFECT) then
4340
local e2=Effect.CreateEffect(c)
4441
e2:SetType(EFFECT_TYPE_SINGLE)
4542
e2:SetCode(EFFECT_ADD_TYPE)
4643
e2:SetValue(TYPE_EFFECT)
47-
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
44+
e2:SetReset(RESET_EVENT|RESETS_STANDARD)
4845
rc:RegisterEffect(e2,true)
4946
end
5047
end
51-
function s.atkcon(e,tp,eg,ep,ev,re,r,rp)
52-
return e:GetHandler():IsSummonType(SUMMON_TYPE_XYZ)
53-
end
5448
function s.atkop(e,tp,eg,ep,ev,re,r,rp)
5549
local c=e:GetHandler()
5650
if c:IsRelateToEffect(e) and c:IsFaceup() then
57-
local e1=Effect.CreateEffect(c)
58-
e1:SetType(EFFECT_TYPE_SINGLE)
59-
e1:SetCode(EFFECT_UPDATE_ATTACK)
60-
e1:SetValue(1000)
61-
e1:SetReset(RESET_EVENT+RESETS_STANDARD_DISABLE)
62-
c:RegisterEffect(e1)
51+
c:UpdateAttack(1000)
6352
end
6453
end
6554
function s.tgfilter(c)
66-
return (c:IsSetCard(0x10db) or (c:IsSetCard(0xdb) and c:IsSpellTrap())) and c:IsAbleToGrave()
55+
return c:IsSetCard(SET_PHANTOM_KNIGHTS) and c:IsAbleToGrave()
6756
end
6857
function s.tgtg(e,tp,eg,ep,ev,re,r,rp,chk)
6958
if chk==0 then return Duel.IsExistingMatchingCard(s.tgfilter,tp,LOCATION_DECK,0,1,nil) end

0 commit comments

Comments
 (0)