Skip to content

Commit a301cb2

Browse files
authored
Update "Tank Corps"
- Should not target a "KC-1 Crayton", only check if it is on the field. - Defense parameter missing from special summon checks - Tokens should not be Tributable for a Tribute Summon - Script modernization update
1 parent 4df928a commit a301cb2

1 file changed

Lines changed: 23 additions & 21 deletions

File tree

unofficial/c511000881.lua

Lines changed: 23 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,40 @@
1+
--歴戦の戦車部隊
12
--Tank Corps
23
local s,id=GetID()
34
function s.initial_effect(c)
4-
--
5+
--Special Summon 3 "Tank Tokens" while you control "KC-1 Crayton"
56
local e1=Effect.CreateEffect(c)
67
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOKEN)
7-
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
88
e1:SetType(EFFECT_TYPE_ACTIVATE)
99
e1:SetCode(EVENT_FREE_CHAIN)
10+
e1:SetCondition(function(e) return Duel.IsExistingMatchingCard(e:GetHandlerPlayer(),aux.FaceupFilter(Card.IsCode,511000880),LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end)
1011
e1:SetTarget(s.target)
1112
e1:SetOperation(s.operation)
1213
c:RegisterEffect(e1)
1314
end
14-
s.listed_names={511000880}
15-
function s.filter(c)
16-
return c:IsFaceup() and c:IsCode(511000880)
17-
end
18-
function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
19-
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and s.filter(chkc) end
20-
if chk==0 then return Duel.IsExistingTarget(s.filter,tp,LOCATION_MZONE,0,1,nil)
21-
and Duel.GetLocationCount(tp,LOCATION_MZONE)>2 and not Duel.IsPlayerAffectedByEffect(tp,CARD_BLUEEYES_SPIRIT)
22-
and Duel.IsPlayerCanSpecialSummonMonster(tp,id+1,0,TYPES_TOKEN,800,1200,3,RACE_MACHINE,ATTRIBUTE_EARTH) end
23-
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
24-
Duel.SelectTarget(tp,s.filter,tp,LOCATION_MZONE,0,1,1,nil)
15+
s.listed_names={511000880,id+1} --"KC-1 Crayton", "Tank Token"
16+
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
17+
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>2 and not Duel.IsPlayerAffectedByEffect(tp,CARD_BLUEEYES_SPIRIT)
18+
and Duel.IsPlayerCanSpecialSummonMonster(tp,id+1,0,TYPES_TOKEN,500,1200,3,RACE_MACHINE,ATTRIBUTE_EARTH,POS_FACEUP_DEFENSE) end
2519
Duel.SetOperationInfo(0,CATEGORY_TOKEN,nil,3,0,0)
2620
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,3,tp,0)
2721
end
2822
function s.operation(e,tp,eg,ep,ev,re,r,rp)
29-
local tc=Duel.GetFirstTarget()
30-
if tc and tc:IsFaceup() and tc:IsRelateToEffect(e) and Duel.GetLocationCount(tp,LOCATION_MZONE)>2 and not Duel.IsPlayerAffectedByEffect(tp,CARD_BLUEEYES_SPIRIT)
31-
and Duel.IsPlayerCanSpecialSummonMonster(tp,id+1,0,TYPES_TOKEN,800,1200,3,RACE_MACHINE,ATTRIBUTE_EARTH) then
32-
for i=1,3 do
33-
local token=Duel.CreateToken(tp,id+1)
34-
Duel.SpecialSummonStep(token,0,tp,tp,false,false,POS_FACEUP_DEFENSE)
23+
if Duel.IsPlayerAffectedByEffect(tp,CARD_BLUEEYES_SPIRIT) or Duel.GetLocationCount(tp,LOCATION_MZONE)<3 or
24+
not Duel.IsPlayerCanSpecialSummonMonster(tp,id+1,0,TYPES_TOKEN,500,1200,3,RACE_MACHINE,ATTRIBUTE_EARTH,POS_FACEUP_DEFENSE)then return end
25+
for i=1,3 do
26+
local token=Duel.CreateToken(tp,id+1)
27+
if Duel.SpecialSummonStep(token,0,tp,tp,false,false,POS_FACEUP_DEFENSE) then
28+
--Cannot be Tributed for a Tribute Summon
29+
local e1=Effect.CreateEffect(e:GetHandler())
30+
e1:SetDescription(3304)
31+
e1:SetType(EFFECT_TYPE_SINGLE)
32+
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CLIENT_HINT)
33+
e1:SetCode(EFFECT_UNRELEASABLE_SUM)
34+
e1:SetReset(RESET_EVENT|RESETS_STANDARD)
35+
e1:SetValue(1)
36+
token:RegisterEffect(e1,true)
3537
end
36-
Duel.SpecialSummonComplete()
3738
end
38-
end
39+
Duel.SpecialSummonComplete()
40+
end

0 commit comments

Comments
 (0)