Skip to content

Commit b2fff52

Browse files
authored
Add files via upload
1 parent c26b898 commit b2fff52

File tree

2 files changed

+85
-80
lines changed

2 files changed

+85
-80
lines changed

unofficial/c511002903.lua

Lines changed: 37 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,63 @@
1+
--ネジマキのカタパルト
12
--Gearspring Catapult
23
local s,id=GetID()
4+
local COUNTER_GEARSPRING=0x107
35
function s.initial_effect(c)
4-
c:EnableCounterPermit(0x107)
6+
c:EnableCounterPermit(COUNTER_GEARSPRING)
57
--Activate
8+
local e0=Effect.CreateEffect(c)
9+
e0:SetType(EFFECT_TYPE_ACTIVATE)
10+
e0:SetCode(EVENT_FREE_CHAIN)
11+
c:RegisterEffect(e0)
12+
--During each of your Standby Phases, place 1 Gearspring Counter on this card
613
local e1=Effect.CreateEffect(c)
7-
e1:SetType(EFFECT_TYPE_ACTIVATE)
8-
e1:SetCode(EVENT_FREE_CHAIN)
14+
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
15+
e1:SetCode(EVENT_PHASE+PHASE_STANDBY)
16+
e1:SetRange(LOCATION_SZONE)
17+
e1:SetCountLimit(1)
18+
e1:SetCondition(function(e,tp) return Duel.IsTurnPlayer(tp) and e:GetHandler():IsCanAddCounter(COUNTER_GEARSPRING,1) end)
19+
e1:SetOperation(s.standbycounterop)
920
c:RegisterEffect(e1)
10-
--add counter
21+
--Increase the ATK of 1 monster you control by 500 until the end of the turn
1122
local e2=Effect.CreateEffect(c)
12-
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
23+
e2:SetDescription(aux.Stringid(id,0))
24+
e2:SetCategory(CATEGORY_ATKCHANGE)
25+
e2:SetType(EFFECT_TYPE_IGNITION)
26+
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
1327
e2:SetRange(LOCATION_SZONE)
14-
e2:SetCountLimit(1)
15-
e2:SetCode(EVENT_PHASE+PHASE_STANDBY)
16-
e2:SetCondition(s.ctcon)
17-
e2:SetOperation(s.ctop)
28+
e2:SetCost(s.atkcost)
29+
e2:SetTarget(s.atktg)
30+
e2:SetOperation(s.atkop)
1831
c:RegisterEffect(e2)
19-
--gain atk
20-
local e3=Effect.CreateEffect(c)
21-
e3:SetDescription(aux.Stringid(id,0))
22-
e3:SetCategory(CATEGORY_ATKCHANGE)
23-
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
24-
e3:SetType(EFFECT_TYPE_IGNITION)
25-
e3:SetRange(LOCATION_SZONE)
26-
e3:SetCost(s.atkcost)
27-
e3:SetTarget(s.atktg)
28-
e3:SetOperation(s.atkop)
29-
c:RegisterEffect(e3)
3032
end
31-
function s.ctcon(e,tp,eg,ep,ev,re,r,rp)
32-
return Duel.GetTurnPlayer()==tp
33-
end
34-
function s.ctop(e,tp,eg,ep,ev,re,r,rp)
33+
s.counter_place_list={COUNTER_GEARSPRING}
34+
function s.standbycounterop(e,tp,eg,ep,ev,re,r,rp)
3535
local c=e:GetHandler()
36-
c:AddCounter(0x107,1)
37-
Duel.RaiseEvent(c,511002905,e,REASON_EFFECT,tp,tp,0x107)
36+
if c:AddCounter(COUNTER_GEARSPRING,1) then
37+
Duel.RaiseEvent(c,EVENT_CUSTOM+511002905,e,REASON_EFFECT,tp,tp,1)
38+
end
3839
end
3940
function s.atkcost(e,tp,eg,ep,ev,re,r,rp,chk)
40-
if chk==0 then return e:GetHandler():IsCanRemoveCounter(tp,0x107,1,REASON_COST) end
41-
e:GetHandler():RemoveCounter(tp,0x107,1,REASON_COST)
41+
local c=e:GetHandler()
42+
if chk==0 then return c:IsCanRemoveCounter(tp,COUNTER_GEARSPRING,1,REASON_COST) end
43+
c:RemoveCounter(tp,COUNTER_GEARSPRING,1,REASON_COST)
4244
end
4345
function s.atktg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
44-
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsFaceup() and chkc:IsControler(tp) end
46+
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and chkc:IsFaceup() end
4547
if chk==0 then return Duel.IsExistingTarget(Card.IsFaceup,tp,LOCATION_MZONE,0,1,nil) end
46-
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
48+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATKDEF)
4749
Duel.SelectTarget(tp,Card.IsFaceup,tp,LOCATION_MZONE,0,1,1,nil)
4850
end
4951
function s.atkop(e,tp,eg,ep,ev,re,r,rp)
5052
local tc=Duel.GetFirstTarget()
51-
if tc and tc:IsRelateToEffect(e) and tc:IsFaceup() then
53+
if tc:IsRelateToEffect(e) and tc:IsFaceup() then
54+
--It gains 500 ATK until the end of this turn
5255
local e1=Effect.CreateEffect(e:GetHandler())
5356
e1:SetType(EFFECT_TYPE_SINGLE)
57+
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
5458
e1:SetCode(EFFECT_UPDATE_ATTACK)
55-
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
5659
e1:SetValue(500)
60+
e1:SetReset(RESETS_STANDARD_PHASE_END)
5761
tc:RegisterEffect(e1)
5862
end
59-
end
63+
end

unofficial/c511002904.lua

Lines changed: 48 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,77 +1,78 @@
1+
--自動ネジマキ機
12
--Automatic Gearspring Machine
23
local s,id=GetID()
4+
local COUNTER_GEARSPRING=0x107
35
function s.initial_effect(c)
4-
c:EnableCounterPermit(0x107)
5-
--Activate
6+
c:EnableCounterPermit(COUNTER_GEARSPRING)
7+
--When you activate this card: Place 2 Gearspring Counters on it
68
local e1=Effect.CreateEffect(c)
9+
e1:SetDescription(aux.Stringid(id,0))
710
e1:SetCategory(CATEGORY_COUNTER)
811
e1:SetType(EFFECT_TYPE_ACTIVATE)
912
e1:SetCode(EVENT_FREE_CHAIN)
1013
e1:SetTarget(s.target)
1114
e1:SetOperation(s.activate)
1215
c:RegisterEffect(e1)
13-
--add counter
16+
--During each of your Standby Phases, place 1 Gearspring Counter on this card
1417
local e2=Effect.CreateEffect(c)
1518
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
19+
e2:SetCode(EVENT_PHASE+PHASE_STANDBY)
1620
e2:SetRange(LOCATION_SZONE)
1721
e2:SetCountLimit(1)
18-
e2:SetCode(EVENT_PHASE+PHASE_STANDBY)
19-
e2:SetCondition(s.ctcon)
20-
e2:SetOperation(s.ctop)
22+
e2:SetCondition(function(e,tp) return Duel.IsTurnPlayer(tp) and e:GetHandler():IsCanAddCounter(COUNTER_GEARSPRING,1) end)
23+
e2:SetOperation(s.standbycounterop)
2124
c:RegisterEffect(e2)
22-
--place
23-
local e4=Effect.CreateEffect(c)
24-
e4:SetCategory(CATEGORY_COUNTER)
25-
e4:SetDescription(aux.Stringid(47408488,1))
26-
e4:SetType(EFFECT_TYPE_IGNITION)
27-
e4:SetRange(LOCATION_SZONE)
28-
e4:SetCost(s.plcost)
29-
e4:SetTarget(s.pltg)
30-
e4:SetOperation(s.plop)
31-
c:RegisterEffect(e4)
25+
--Place Gearspring Counters on another card you can place a Gearspring Counter on, equal to the number of Gearspring Counters that were on this card
26+
local e3=Effect.CreateEffect(c)
27+
e3:SetDescription(aux.Stringid(id,1))
28+
e3:SetCategory(CATEGORY_COUNTER)
29+
e3:SetType(EFFECT_TYPE_IGNITION)
30+
e3:SetRange(LOCATION_SZONE)
31+
e3:SetCost(s.maincountercost)
32+
e3:SetTarget(s.maincountertg)
33+
e3:SetOperation(s.maincounterop)
34+
c:RegisterEffect(e3)
3235
end
36+
s.counter_place_list={COUNTER_GEARSPRING}
3337
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
34-
if chk==0 then return true end
35-
Duel.SetOperationInfo(0,CATEGORY_COUNTER,nil,2,0,0x107)
38+
local c=e:GetHandler()
39+
if chk==0 then return c:IsCanAddCounter(COUNTER_GEARSPRING,2,false,LOCATION_SZONE) end
40+
Duel.SetOperationInfo(0,CATEGORY_COUNTER,c,2,tp,COUNTER_GEARSPRING)
3641
end
3742
function s.activate(e,tp,eg,ep,ev,re,r,rp)
3843
local c=e:GetHandler()
39-
if c:IsRelateToEffect(e) then
40-
c:AddCounter(0x107,2)
41-
Duel.RaiseEvent(c,id+1,e,REASON_EFFECT,tp,tp,0x107)
44+
if c:IsRelateToEffect(e) and c:AddCounter(COUNTER_GEARSPRING,2) then
45+
Duel.RaiseEvent(c,EVENT_CUSTOM+511002905,e,REASON_EFFECT,tp,tp,2)
4246
end
4347
end
44-
function s.ctcon(e,tp,eg,ep,ev,re,r,rp)
45-
return Duel.GetTurnPlayer()==tp
46-
end
47-
function s.ctop(e,tp,eg,ep,ev,re,r,rp)
48+
function s.standbycounterop(e,tp,eg,ep,ev,re,r,rp)
4849
local c=e:GetHandler()
49-
c:AddCounter(0x107,1)
50-
Duel.RaiseSingleEvent(c,id+1,e,0,0,tp,0)
50+
if c:AddCounter(COUNTER_GEARSPRING,1) then
51+
Duel.RaiseEvent(c,EVENT_CUSTOM+511002905,e,REASON_EFFECT,tp,tp,1)
52+
end
5153
end
52-
function s.plcost(e,tp,eg,ep,ev,re,r,rp,chk)
53-
if chk==0 then return e:GetHandler():IsAbleToGraveAsCost() end
54-
e:SetLabel(e:GetHandler():GetCounter(0x107))
55-
Duel.SendtoGrave(e:GetHandler(),REASON_COST)
54+
function s.maincountercost(e,tp,eg,ep,ev,re,r,rp,chk)
55+
local c=e:GetHandler()
56+
if chk==0 then return c:IsAbleToGraveAsCost() end
57+
e:SetLabel(c:GetCounter(COUNTER_GEARSPRING))
58+
Duel.SendtoGrave(c,REASON_COST)
5659
end
57-
function s.pltg(e,tp,eg,ep,ev,re,r,rp,chk)
60+
function s.maincountertg(e,tp,eg,ep,ev,re,r,rp,chk)
5861
if chk==0 then
5962
local c=e:GetHandler()
60-
local ct=c:GetCounter(0x107)
61-
return ct>0 and Duel.IsExistingMatchingCard(Card.IsCanAddCounter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,c,0x107,ct)
63+
local ct=c:GetCounter(COUNTER_GEARSPRING)
64+
return ct>0 and Duel.IsExistingMatchingCard(Card.IsCanAddCounter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,c,COUNTER_GEARSPRING,ct)
6265
end
63-
Duel.SetTargetParam(e:GetLabel())
64-
e:SetLabel(0)
65-
Duel.SetOperationInfo(0,CATEGORY_COUNTER,nil,ct,0,0x107)
66+
Duel.SetOperationInfo(0,CATEGORY_COUNTER,nil,e:GetLabel(),tp,COUNTER_GEARSPRING)
6667
end
67-
function s.plop(e,tp,eg,ep,ev,re,r,rp)
68-
local ct=Duel.GetChainInfo(0,CHAININFO_TARGET_PARAM)
69-
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(73853830,1))
70-
local g=Duel.SelectMatchingCard(tp,Card.IsCanAddCounter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil,0x107,ct)
71-
local tc=g:GetFirst()
72-
if tc then
73-
Duel.HintSelection(g)
74-
tc:AddCounter(0x107,ct)
75-
Duel.RaiseEvent(tc,id+1,e,REASON_EFFECT,tp,tp,0x107)
68+
function s.maincounterop(e,tp,eg,ep,ev,re,r,rp)
69+
local ct=e:GetLabel()
70+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_COUNTER)
71+
local sc=Duel.SelectMatchingCard(tp,Card.IsCanAddCounter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil,COUNTER_GEARSPRING,ct):GetFirst()
72+
if sc then
73+
Duel.HintSelection(sc)
74+
if sc:AddCounter(COUNTER_GEARSPRING,ct) then
75+
Duel.RaiseEvent(sc,EVENT_CUSTOM+511002905,e,REASON_EFFECT,tp,tp,ct)
76+
end
7677
end
77-
end
78+
end

0 commit comments

Comments
 (0)