Skip to content

Commit a7816d1

Browse files
authored
"Heavy Armored Train Ironwolf (Anime)" fix
Its materials should be 2 Level 4 Machine monsters, not any 2 Level 4 monsters + shouldn't be able to target a monster that can already attack directly.
1 parent bcc501e commit a7816d1

File tree

1 file changed

+29
-32
lines changed

1 file changed

+29
-32
lines changed

unofficial/c511009026.lua

Lines changed: 29 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,42 @@
1-
--Heavy Armored Train Ironwolf
1+
--重装甲列車アイアン・ヴォルフ (Anime)
2+
--Heavy Armored Train Ironwolf (Anime)
23
local s,id=GetID()
34
function s.initial_effect(c)
4-
--xyz summon
5-
Xyz.AddProcedure(c,nil,4,2)
65
c:EnableReviveLimit()
7-
-- direct attack
8-
local e2=Effect.CreateEffect(c)
9-
e2:SetDescription(aux.Stringid(id,0))
10-
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
11-
e2:SetType(EFFECT_TYPE_IGNITION)
12-
e2:SetRange(LOCATION_MZONE)
13-
e2:SetCountLimit(1)
14-
e2:SetCondition(s.dacon)
15-
e2:SetCost(s.dacost)
16-
e2:SetTarget(s.datg)
17-
e2:SetOperation(s.daop)
18-
c:RegisterEffect(e2,false,REGISTER_FLAG_DETACH_XMAT)
6+
--Xyz Summon procedure: 2 Level 4 Machine monsters
7+
Xyz.AddProcedure(c,aux.FilterBoolFunctionEx(Card.IsRace,RACE_MACHINE),4,2)
8+
--Make 1 Machine monster you control able to attack directly this turn
9+
local e1=Effect.CreateEffect(c)
10+
e1:SetDescription(aux.Stringid(id,0))
11+
e1:SetType(EFFECT_TYPE_IGNITION)
12+
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
13+
e1:SetRange(LOCATION_MZONE)
14+
e1:SetCountLimit(1)
15+
e1:SetCondition(function() return Duel.IsAbleToEnterBP() end)
16+
e1:SetCost(Cost.Detach(1))
17+
e1:SetTarget(s.efftg)
18+
e1:SetOperation(s.effop)
19+
c:RegisterEffect(e1,false,REGISTER_FLAG_DETACH_XMAT)
1920
end
20-
function s.dacon(e,tp,eg,ep,ev,re,r,rp)
21-
return Duel.IsAbleToEnterBP()
21+
function s.tgfilter(c)
22+
return c:IsRace(RACE_MACHINE) and not c:IsHasEffect(EFFECT_DIRECT_ATTACK) and c:IsFaceup()
2223
end
23-
function s.dacost(e,tp,eg,ep,ev,re,r,rp,chk)
24-
if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end
25-
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST)
24+
function s.efftg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
25+
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and s.tgfilter(chkc) end
26+
if chk==0 then return Duel.IsExistingTarget(s.tgfilter,tp,LOCATION_MZONE,0,1,nil) end
27+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
28+
Duel.SelectTarget(tp,s.tgfilter,tp,LOCATION_MZONE,0,1,1,nil)
2629
end
27-
function s.filter(c)
28-
return c:IsFaceup() and c:IsRace(RACE_MACHINE)
29-
end
30-
function s.datg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
31-
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and s.filter(chkc) end
32-
if chk==0 then return Duel.IsExistingTarget(s.filter,tp,LOCATION_MZONE,0,1,nil) end
33-
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
34-
local g=Duel.SelectTarget(tp,s.filter,tp,LOCATION_MZONE,0,1,1,nil)
35-
end
36-
function s.daop(e,tp,eg,ep,ev,re,r,rp)
30+
function s.effop(e,tp,eg,ep,ev,re,r,rp)
3731
local tc=Duel.GetFirstTarget()
3832
if tc:IsRelateToEffect(e) then
33+
--It can attack directly this turn
3934
local e1=Effect.CreateEffect(e:GetHandler())
35+
e1:SetDescription(3205)
4036
e1:SetType(EFFECT_TYPE_SINGLE)
37+
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CLIENT_HINT)
4138
e1:SetCode(EFFECT_DIRECT_ATTACK)
42-
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
39+
e1:SetReset(RESETS_STANDARD_PHASE_END)
4340
tc:RegisterEffect(e1)
4441
end
45-
end
42+
end

0 commit comments

Comments
 (0)