Skip to content

Commit 3fb72cf

Browse files
committed
"Number 18: Heraldry Patriarch" fix
- added modern handling for the Once per chain condition and for the detach cost - now it uses the correct indexes when it calls its strings
1 parent 074dc75 commit 3fb72cf

File tree

1 file changed

+13
-22
lines changed

1 file changed

+13
-22
lines changed

official/c23649496.lua

Lines changed: 13 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,25 @@
22
--Number 18: Heraldry Patriarch
33
local s,id=GetID()
44
function s.initial_effect(c)
5-
--xyz summon
5+
--Xyz Summon procedure: 2 Level 4 monsters
66
Xyz.AddProcedure(c,nil,4,2)
77
c:EnableReviveLimit()
8-
--destroy
8+
--Destroy monsters on the field
99
local e1=Effect.CreateEffect(c)
1010
e1:SetDescription(aux.Stringid(id,0))
1111
e1:SetCategory(CATEGORY_DESTROY)
1212
e1:SetType(EFFECT_TYPE_QUICK_O)
1313
e1:SetCode(EVENT_FREE_CHAIN)
1414
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER)
1515
e1:SetRange(LOCATION_MZONE)
16-
e1:SetCost(s.cost)
16+
e1:SetCountLimit(1,0,EFFECT_COUNT_CODE_CHAIN)
17+
e1:SetCost(aux.dxmcostgen(1,1,nil))
1718
e1:SetTarget(s.target)
1819
e1:SetOperation(s.operation)
1920
c:RegisterEffect(e1,false,REGISTER_FLAG_DETACH_XMAT)
20-
--to grave
21+
--Send 2 "Heraldic Beast" monsters from your Deck to the Graveyard.
2122
local e2=Effect.CreateEffect(c)
22-
e2:SetDescription(aux.Stringid(id,2))
23+
e2:SetDescription(aux.Stringid(id,1))
2324
e2:SetCategory(CATEGORY_TOGRAVE)
2425
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
2526
e2:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP)
@@ -28,14 +29,8 @@ function s.initial_effect(c)
2829
e2:SetOperation(s.tgop)
2930
c:RegisterEffect(e2)
3031
end
31-
s.listed_series={0x76}
32+
s.listed_series={SET_HERALDIC_BEAST}
3233
s.xyz_number=18
33-
function s.cost(e,tp,eg,ep,ev,re,r,rp,chk)
34-
local c=e:GetHandler()
35-
if chk==0 then return c:CheckRemoveOverlayCard(tp,1,REASON_COST) and c:GetFlagEffect(id)==0 end
36-
c:RemoveOverlayCard(tp,1,1,REASON_COST)
37-
c:RegisterFlagEffect(id,RESET_CHAIN,0,1)
38-
end
3934
function s.cfilter(c)
4035
return c:IsFaceup() and Duel.IsExistingMatchingCard(aux.FaceupFilter(Card.IsCode,c:GetCode()),0,LOCATION_MZONE,LOCATION_MZONE,1,c)
4136
end
@@ -46,9 +41,8 @@ function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
4641
end
4742
function s.operation(e,tp,eg,ep,ev,re,r,rp)
4843
local c=e:GetHandler()
49-
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(id,1))
50-
local g=Duel.SelectMatchingCard(tp,s.cfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
51-
local tc=g:GetFirst()
44+
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(id,2))
45+
local tc=Duel.SelectMatchingCard(tp,s.cfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil):GetFirst()
5246
if tc then
5347
local dg=Duel.GetMatchingGroup(aux.FaceupFilter(Card.IsCode,tc:GetCode()),tp,LOCATION_MZONE,LOCATION_MZONE,tc)
5448
Duel.Destroy(dg,REASON_EFFECT)
@@ -58,9 +52,9 @@ function s.operation(e,tp,eg,ep,ev,re,r,rp)
5852
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
5953
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
6054
e1:SetTargetRange(0,1)
61-
e1:SetTarget(s.splimit)
62-
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
6355
e1:SetLabel(tc:GetCode())
56+
e1:SetTarget(function(e,c) return c:IsCode(e:GetLabel()) end)
57+
e1:SetReset(RESET_EVENT|RESETS_STANDARD)
6458
c:RegisterEffect(e1)
6559
local e2=e1:Clone()
6660
e2:SetCode(EFFECT_CANNOT_SUMMON)
@@ -70,11 +64,8 @@ function s.operation(e,tp,eg,ep,ev,re,r,rp)
7064
c:RegisterEffect(e3)
7165
end
7266
end
73-
function s.splimit(e,c,sump,sumtype,sumpos,targetp,se)
74-
return c:IsCode(e:GetLabel())
75-
end
7667
function s.tgfilter(c)
77-
return c:IsSetCard(0x76) and c:IsMonster() and c:IsAbleToGrave()
68+
return c:IsSetCard(SET_HERALDIC_BEAST) and c:IsMonster() and c:IsAbleToGrave()
7869
end
7970
function s.tgtg(e,tp,eg,ep,ev,re,r,rp,chk)
8071
if chk==0 then return Duel.IsExistingMatchingCard(s.tgfilter,tp,LOCATION_DECK,0,2,nil) end
@@ -87,4 +78,4 @@ function s.tgop(e,tp,eg,ep,ev,re,r,rp)
8778
local sg=g:Select(tp,2,2,nil)
8879
Duel.SendtoGrave(sg,REASON_EFFECT)
8980
end
90-
end
81+
end

0 commit comments

Comments
 (0)