|
1 | | ---機関連結 |
| 1 | +--機関連結 (Anime) |
| 2 | +--Train Connection (Anime) |
2 | 3 | local s,id=GetID() |
3 | 4 | function s.initial_effect(c) |
4 | | - aux.AddEquipProcedure(c,nil,aux.FilterBoolFunction(Card.IsRace,RACE_MACHINE),nil,s.cost) |
5 | | - --Pierce |
| 5 | + aux.AddEquipProcedure(c,nil,s.eqfilter,s.eqlimit,s.cost) |
| 6 | + --Double the equipped monster's original ATK |
| 7 | + local e1=Effect.CreateEffect(c) |
| 8 | + e1:SetType(EFFECT_TYPE_EQUIP) |
| 9 | + e1:SetCode(EFFECT_SET_ATTACK) |
| 10 | + e1:SetValue(function(e,c) return c:GetBaseAttack()*2 end) |
| 11 | + c:RegisterEffect(e1) |
| 12 | + --Inflict piercing damage |
6 | 13 | local e2=Effect.CreateEffect(c) |
7 | 14 | e2:SetType(EFFECT_TYPE_EQUIP) |
8 | 15 | e2:SetCode(EFFECT_PIERCE) |
9 | 16 | c:RegisterEffect(e2) |
10 | | - --double original atk |
11 | | - local e5=Effect.CreateEffect(c) |
12 | | - e5:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) |
13 | | - e5:SetCode(EVENT_ADJUST) |
14 | | - e5:SetRange(LOCATION_SZONE) |
15 | | - e5:SetOperation(s.atkop) |
16 | | - e5:SetLabel(0) |
17 | | - c:RegisterEffect(e5) |
18 | | - --check for doubling |
19 | | - local e6=Effect.CreateEffect(c) |
20 | | - e6:SetType(EFFECT_TYPE_SINGLE) |
21 | | - e6:SetCode(511000694) |
22 | | - c:RegisterEffect(e6) |
23 | 17 | end |
24 | | -function s.costfilter(c) |
25 | | - return c:IsRace(RACE_MACHINE) and c:GetLevel()>=8 and c:IsAbleToRemoveAsCost() and aux.SpElimFilter(c,true) |
| 18 | +function s.eqlimit(e,c) |
| 19 | + return e:GetHandler():GetEquipTarget()==c and c:IsRace(RACE_MACHINE) |
26 | 20 | end |
27 | | -function s.filterchk(c,g,sg) |
28 | | - sg:AddCard(c) |
29 | | - local res |
30 | | - if #sg<2 then |
31 | | - res=g:IsExists(s.filterchk,1,sg,g,sg) |
32 | | - else |
33 | | - res=Duel.IsExistingTarget(function(c) return c:IsFaceup() and c:IsRace(RACE_MACHINE) end,0,LOCATION_MZONE,LOCATION_MZONE,1,nil) |
34 | | - end |
35 | | - sg:RemoveCard(c) |
36 | | - return res |
| 21 | +function s.eqfilter(c) |
| 22 | + return c:IsFaceup() and c:IsRace(RACE_MACHINE) |
37 | 23 | end |
38 | | -function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) |
39 | | - local g=Duel.GetMatchingGroup(s.costfilter,tp,LOCATION_MZONE+LOCATION_GRAVE,0,nil) |
40 | | - if chk==0 then return g:IsExists(s.filterchk,1,nil,g,Group.CreateGroup()) end |
41 | | - local rg=Group.CreateGroup() |
42 | | - while #rg<2 do |
43 | | - Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) |
44 | | - local sg=g:FilterSelect(tp,s.filterchk,1,1,rg,g,rg) |
45 | | - rg:Merge(sg) |
46 | | - end |
47 | | - Duel.Remove(g,POS_FACEUP,REASON_COST) |
| 24 | +function s.rmfilter(c) |
| 25 | + return c:IsRace(RACE_MACHINE) and c:IsLevelAbove(8) and c:IsAbleToRemoveAsCost() and aux.SpElimFilter(c,true) |
48 | 26 | end |
49 | | -function s.chkfilter(c,eq) |
50 | | - local ec=c:GetEquipTarget() |
51 | | - return c:IsHasEffect(511000694) and ec and ec==eq and not c:IsDisabled() |
| 27 | +function s.rescon(sg,e,tp,mg) |
| 28 | + return Duel.IsExistingTarget(s.eqfilter,0,LOCATION_MZONE,LOCATION_MZONE,1,sg) |
52 | 29 | end |
53 | | -function s.atkop(e,tp,eg,ep,ev,re,r,rp) |
54 | | - local c=e:GetHandler() |
55 | | - local eq=c:GetEquipTarget() |
56 | | - local g=Duel.GetMatchingGroup(s.chkfilter,tp,LOCATION_SZONE,LOCATION_SZONE,c,eq) |
57 | | - if eq and c:GetFlagEffect(511000695)==0 and e:GetLabel()~=#g+1 then |
58 | | - c:ResetEffect(RESET_DISABLE,RESET_EVENT) |
59 | | - local tc=g:GetFirst() |
60 | | - while tc do |
61 | | - tc:RegisterFlagEffect(511000695,RESET_EVENT+RESETS_STANDARD_DISABLE,0,0) |
62 | | - tc=g:GetNext() |
63 | | - end |
64 | | - local atk=eq:GetBaseAttack() |
65 | | - for i=1,#g+1 do |
66 | | - atk=atk*2 |
67 | | - end |
68 | | - local e1=Effect.CreateEffect(c) |
69 | | - e1:SetType(EFFECT_TYPE_EQUIP) |
70 | | - e1:SetCode(EFFECT_SET_BASE_ATTACK) |
71 | | - e1:SetValue(atk) |
72 | | - e1:SetReset(RESET_EVENT+RESETS_STANDARD_DISABLE) |
73 | | - c:RegisterEffect(e1) |
74 | | - e:SetLabel(#g+1) |
75 | | - end |
| 30 | +function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) |
| 31 | + local g=Duel.GetMatchingGroup(s.rmfilter,tp,LOCATION_MZONE|LOCATION_GRAVE,0,nil) |
| 32 | + if chk==0 then return aux.SelectUnselectGroup(g,e,tp,2,2,s.rescon,0) end |
| 33 | + local rg=aux.SelectUnselectGroup(g,e,tp,2,2,s.rescon,1,tp,HINTMSG_REMOVE) |
| 34 | + Duel.Remove(rg,POS_FACEUP,REASON_COST) |
76 | 35 | end |
0 commit comments