Skip to content

Commit cac42a5

Browse files
authored
Update "Dimensional Catapult
Minor script polish
1 parent 97c09f8 commit cac42a5

1 file changed

Lines changed: 14 additions & 13 deletions

File tree

unofficial/c100000149.lua

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,43 @@
11
--次元破壊砲-STU
2+
--Dimensional Catapult
23
local s,id=GetID()
34
function s.initial_effect(c)
45
--Activate
56
local e1=Effect.CreateEffect(c)
67
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
78
e1:SetType(EFFECT_TYPE_ACTIVATE)
8-
e1:SetCode(EVENT_FREE_CHAIN)
99
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
10+
e1:SetCode(EVENT_FREE_CHAIN)
1011
e1:SetTarget(s.target)
1112
e1:SetOperation(s.operation)
1213
c:RegisterEffect(e1)
13-
--Destroy
14+
--When this card is destroyed, destroy the equipped monster.
1415
local e2=Effect.CreateEffect(c)
15-
e2:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_SINGLE)
16+
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
1617
e2:SetCode(EVENT_LEAVE_FIELD)
1718
e2:SetOperation(s.desop)
1819
c:RegisterEffect(e2)
19-
--negate
20+
--Negate the effects of the equipped monster
2021
local e3=Effect.CreateEffect(c)
2122
e3:SetType(EFFECT_TYPE_EQUIP)
2223
e3:SetCode(EFFECT_DISABLE)
2324
c:RegisterEffect(e3)
24-
--Pierce
25+
--The equipped monster inflicts piercing damage.
2526
local e4=Effect.CreateEffect(c)
2627
e4:SetType(EFFECT_TYPE_EQUIP)
2728
e4:SetCode(EFFECT_PIERCE)
2829
c:RegisterEffect(e4)
2930
end
30-
s.listed_names={84243274}
31-
function s.filter(c,e,tp)
31+
s.listed_names={84243274} --"VWXYZ-Dragon Catapult Cannon"
32+
function s.speqfilter(c,e,tp)
3233
return c:IsCode(84243274) and c:IsCanBeSpecialSummoned(e,0,tp,true,false)
3334
end
3435
function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
35-
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and s.filter(chkc,e,tp) end
36+
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and s.speqfilter(chkc,e,tp) end
3637
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
37-
and Duel.IsExistingTarget(s.filter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
38+
and Duel.IsExistingTarget(s.speqfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
3839
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
39-
local g=Duel.SelectTarget(tp,s.filter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
40+
local g=Duel.SelectTarget(tp,s.speqfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
4041
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
4142
Duel.SetOperationInfo(0,CATEGORY_EQUIP,e:GetHandler(),1,0,0)
4243
end
@@ -54,15 +55,15 @@ function s.operation(e,tp,eg,ep,ev,re,r,rp)
5455
e1:SetType(EFFECT_TYPE_SINGLE)
5556
e1:SetCode(EFFECT_EQUIP_LIMIT)
5657
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
57-
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
58+
e1:SetReset(RESET_EVENT|RESETS_STANDARD)
5859
e1:SetValue(s.eqlimit)
5960
c:RegisterEffect(e1)
6061
end
6162
end
6263
function s.desop(e,tp,eg,ep,ev,re,r,rp)
6364
local c=e:GetHandler()
64-
local tc=e:GetHandler():GetEquipTarget()
65+
local tc=e:GetHandler():GetFirstCardTarget()
6566
if c:IsReason(REASON_DESTROY) and tc and tc:IsLocation(LOCATION_MZONE) then
6667
Duel.Destroy(tc,REASON_EFFECT)
6768
end
68-
end
69+
end

0 commit comments

Comments
 (0)