Skip to content

Commit 3016277

Browse files
authored
Added new card scripts
1 parent d052956 commit 3016277

File tree

5 files changed

+402
-0
lines changed

5 files changed

+402
-0
lines changed

pre-release/c101208009.lua

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
--紋章獣グリフォン
2+
--Heraldic Beast Gryphon
3+
--scripted by Naim
4+
local EFFECT_DOUBLE_XYZ_MATERIAL=511001225 --to be removed when the procedure is updated
5+
local s,id=GetID()
6+
function s.initial_effect(c)
7+
--Special Summon this card from your hand
8+
local e1=Effect.CreateEffect(c)
9+
e1:SetDescription(aux.Stringid(id,0))
10+
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
11+
e1:SetType(EFFECT_TYPE_IGNITION)
12+
e1:SetRange(LOCATION_HAND)
13+
e1:SetCountLimit(1,id)
14+
e1:SetCost(s.spcost)
15+
e1:SetTarget(s.sptg)
16+
e1:SetOperation(s.spop)
17+
c:RegisterEffect(e1)
18+
--Can be treated as 2 Materials for the Xyz Summon of a "Number" Xyz monter that requires 3 or more materials
19+
local e2=Effect.CreateEffect(c)
20+
e2:SetType(EFFECT_TYPE_SINGLE)
21+
e2:SetCode(EFFECT_DOUBLE_XYZ_MATERIAL)
22+
e2:SetValue(1)
23+
e2:SetCondition(function(e) return not Duel.HasFlagEffect(e:GetHandlerPlayer(),id) end)
24+
e2:SetOperation(function(e,c,matg) return c:IsSetCard(SET_NUMBER) and c.minxyzct and c.minxyzct>=3 and matg:FilterCount(s.gryphonhoptfilter,nil)<2 end)
25+
c:RegisterEffect(e2)
26+
--HOPT workaround for having already used the double material effect earlier in that turn
27+
aux.GlobalCheck(s,function()
28+
local ge1=Effect.CreateEffect(c)
29+
ge1:SetType(EFFECT_TYPE_FIELD)
30+
ge1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_SET_AVAILABLE+EFFECT_FLAG_IGNORE_RANGE)
31+
ge1:SetCode(EFFECT_MATERIAL_CHECK)
32+
ge1:SetValue(s.valcheck)
33+
Duel.RegisterEffect(ge1,0)
34+
end)
35+
end
36+
s.listed_series={SET_HERALDIC_BEAST}
37+
s.listed_names={id}
38+
function s.costfilter(c)
39+
return c:IsSetCard(SET_HERALDIC_BEAST) and c:IsMonster() and c:IsAbleToGraveAsCost() and not c:IsCode(id)
40+
end
41+
function s.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
42+
if chk==0 then return Duel.IsExistingMatchingCard(s.costfilter,tp,LOCATION_DECK,0,1,nil) end
43+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
44+
local g=Duel.SelectMatchingCard(tp,s.costfilter,tp,LOCATION_DECK,0,1,1,nil)
45+
Duel.SendtoGrave(g,REASON_COST)
46+
end
47+
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
48+
local c=e:GetHandler()
49+
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
50+
and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end
51+
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,tp,0)
52+
end
53+
function s.spop(e,tp,eg,ep,ev,re,r,rp)
54+
local c=e:GetHandler()
55+
if c:IsRelateToEffect(e) then
56+
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
57+
end
58+
--Cannot Special Summon from the Extra Deck for the rest of this turn, except by Xyz Summon
59+
local e1=Effect.CreateEffect(c)
60+
e1:SetDescription(aux.Stringid(id,1))
61+
e1:SetType(EFFECT_TYPE_FIELD)
62+
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CLIENT_HINT)
63+
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
64+
e1:SetTargetRange(1,0)
65+
e1:SetTarget(function(e,c,sump,sumtype) return c:IsLocation(LOCATION_EXTRA) and (sumtype&SUMMON_TYPE_XYZ)~=SUMMON_TYPE_XYZ end)
66+
e1:SetReset(RESET_PHASE|PHASE_END)
67+
Duel.RegisterEffect(e1,tp)
68+
--Can only use monsters with "Heraldic Beast" and/or "Number" in their original names as material for an Xyz Summon this turn
69+
local e2=Effect.CreateEffect(c)
70+
e2:SetType(EFFECT_TYPE_FIELD)
71+
e2:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
72+
e2:SetCode(EFFECT_CANNOT_BE_XYZ_MATERIAL)
73+
e2:SetTargetRange(LOCATION_ALL,LOCATION_ALL)
74+
e2:SetTarget(function(e,c) return not c:IsOriginalSetCard({SET_HERALDIC_BEAST,SET_NUMBER}) end)
75+
e2:SetValue(function(e,c) return c and c:IsControler(e:GetHandlerPlayer()) end)
76+
e2:SetReset(RESET_PHASE|PHASE_END)
77+
Duel.RegisterEffect(e2,tp)
78+
end
79+
function s.gryphonhoptfilter(c)
80+
return c:IsCode(id) and c:IsHasEffect(EFFECT_DOUBLE_XYZ_MATERIAL)
81+
end
82+
function s.valcheck(e,c)
83+
if not (c:IsType(TYPE_XYZ) and c:IsSetCard(SET_NUMBER) and c.minxyzct and c.minxyzct>=3) then return end
84+
local g=c:GetMaterial()
85+
if #g<c.minxyzct and g:IsExists(s.gryphonhoptfilter,1,nil) then
86+
Duel.RegisterFlagEffect(c:GetControler(),id,RESET_PHASE|PHASE_END,0,1)
87+
end
88+
end

pre-release/c101208010.lua

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
--紋章獣スタット・ホエール
2+
--Heraldic Beast Stat Whale
3+
--scripted by Naim
4+
local s,id=GetID()
5+
function s.initial_effect(c)
6+
--Add 2 "Heraldry" Spells/Traps from your Deck to your hand.
7+
local e1=Effect.CreateEffect(c)
8+
e1:SetDescription(aux.Stringid(id,0))
9+
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
10+
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
11+
e1:SetProperty(EFFECT_FLAG_DELAY)
12+
e1:SetCode(EVENT_SUMMON_SUCCESS)
13+
e1:SetCountLimit(1,id)
14+
e1:SetCost(aux.DiscardCost())
15+
e1:SetTarget(s.thtg)
16+
e1:SetOperation(s.thop)
17+
c:RegisterEffect(e1)
18+
local e2=e1:Clone()
19+
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
20+
c:RegisterEffect(e2)
21+
--Special Summon in Defense Position 2 "Heraldic Beast" monsters with the same name from your GY
22+
local e3=Effect.CreateEffect(c)
23+
e3:SetDescription(aux.Stringid(id,1))
24+
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
25+
e3:SetType(EFFECT_TYPE_IGNITION)
26+
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
27+
e3:SetRange(LOCATION_GRAVE)
28+
e3:SetCountLimit(1,{id,1})
29+
e3:SetCost(aux.SelfBanishCost)
30+
e3:SetTarget(s.sptg)
31+
e3:SetOperation(s.spop)
32+
c:RegisterEffect(e3)
33+
end
34+
s.listed_series={SET_HERALDRY,SET_HERALDIC_BEAST}
35+
function s.thfilter(c)
36+
return c:IsSetCard(SET_HERALDRY) and c:IsSpellTrap() and c:IsAbleToHand()
37+
end
38+
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
39+
if chk==0 then return Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,2,nil) end
40+
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,2,tp,LOCATION_DECK)
41+
end
42+
function s.thop(e,tp,eg,ep,ev,re,r,rp)
43+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
44+
local g=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_DECK,0,2,2,nil)
45+
if #g==2 then
46+
Duel.SendtoHand(g,nil,REASON_EFFECT)
47+
Duel.ConfirmCards(1-tp,g)
48+
end
49+
end
50+
function s.spfilter(c,e,tp)
51+
return c:IsSetCard(SET_HERALDIC_BEAST) and c:IsCanBeEffectTarget(e) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE)
52+
end
53+
function s.spcheck(sg,e,tp,mg)
54+
return sg:GetClassCount(Card.GetCode)==1
55+
end
56+
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
57+
local g=Duel.GetMatchingGroup(s.spfilter,tp,LOCATION_GRAVE,0,e:GetHandler(),e,tp)
58+
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>=2
59+
and not Duel.IsPlayerAffectedByEffect(tp,CARD_BLUEEYES_SPIRIT)
60+
and aux.SelectUnselectGroup(g,e,tp,2,2,s.spcheck,0) end
61+
local tg=aux.SelectUnselectGroup(g,e,tp,2,2,s.spcheck,1,tp,HINTMSG_SPSUMMON)
62+
Duel.SetTargetCard(tg)
63+
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,tg,2,tp,0)
64+
end
65+
function s.spop(e,tp,eg,ep,ev,re,r,rp)
66+
local tg=Duel.GetTargetCards(e)
67+
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
68+
if #tg>0 and ft>0 and not Duel.IsPlayerAffectedByEffect(tp,CARD_BLUEEYES_SPIRIT) then
69+
if ft==1 then
70+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
71+
tg=tg:FilterSelect(tp,Card.IsCanBeSpecialSummoned,1,1,nil,e,0,tp,false,false,POS_FACEUP_DEFENSE)
72+
end
73+
Duel.SpecialSummon(tg,0,tp,tp,false,false,POS_FACEUP_DEFENSE)
74+
end
75+
local c=e:GetHandler()
76+
--Cannot Special Summon from the Extra Deck for the rest of this turn, except by Xyz Summon
77+
local e1=Effect.CreateEffect(c)
78+
e1:SetDescription(aux.Stringid(id,2))
79+
e1:SetType(EFFECT_TYPE_FIELD)
80+
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CLIENT_HINT)
81+
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
82+
e1:SetTargetRange(1,0)
83+
e1:SetTarget(function(e,c,sump,sumtype) return c:IsLocation(LOCATION_EXTRA) and (sumtype&SUMMON_TYPE_XYZ)~=SUMMON_TYPE_XYZ end)
84+
e1:SetReset(RESET_PHASE|PHASE_END)
85+
Duel.RegisterEffect(e1,tp)
86+
--Can only use monsters with "Heraldic Beast" and/or "Number" in their original names as material for an Xyz Summon this turn
87+
local e2=Effect.CreateEffect(c)
88+
e2:SetType(EFFECT_TYPE_FIELD)
89+
e2:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
90+
e2:SetCode(EFFECT_CANNOT_BE_XYZ_MATERIAL)
91+
e2:SetTargetRange(LOCATION_ALL,LOCATION_ALL)
92+
e2:SetTarget(function(e,c) return not c:IsOriginalSetCard({SET_HERALDIC_BEAST,SET_NUMBER}) end)
93+
e2:SetValue(function(e,c) return c and c:IsControler(e:GetHandlerPlayer()) end)
94+
e2:SetReset(RESET_PHASE|PHASE_END)
95+
Duel.RegisterEffect(e2,tp)
96+
end

pre-release/c101208045.lua

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
--No.69 紋章神コート・オブ・アームズ-ゴッド・シャーター
2+
--Number 69: Heraldry Crest - Shatter Stream
3+
--scripted by Naim
4+
local s,id=GetID()
5+
function s.initial_effect(c)
6+
c:EnableReviveLimit()
7+
--Xyz Summon procedure: 4 Level 4 monsters OR 1 monster whose original name is "Number 69: Heraldry Crest"
8+
Xyz.AddProcedure(c,nil,4,4,s.ovfilter,aux.Stringid(id,0),4)
9+
--Special Summon 1 "Number 69: Heraldry Crest - Dark Matter Demolition" from your Extra Deck and destroy an opponent's monster
10+
local e1=Effect.CreateEffect(c)
11+
e1:SetDescription(aux.Stringid(id,0))
12+
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_DESTROY)
13+
e1:SetType(EFFECT_TYPE_QUICK_O)
14+
e1:SetCode(EVENT_CHAINING)
15+
e1:SetRange(LOCATION_MZONE)
16+
e1:SetCountLimit(1,id)
17+
e1:SetCondition(s.spcon)
18+
e1:SetTarget(s.sptg)
19+
e1:SetOperation(s.spop)
20+
c:RegisterEffect(e1)
21+
local e2=e1:Clone()
22+
e2:SetCode(EVENT_ATTACK_ANNOUNCE)
23+
e2:SetCondition(function(e,tp) return Duel.GetAttacker():IsControler(1-tp) end)
24+
c:RegisterEffect(e2)
25+
end
26+
s.xyz_number=69
27+
s.listed_series={2407234,101208046} --"Number 69: Heraldry Crest", "Number 69: Heraldry Crest - Dark Matter Demolition"
28+
function s.ovfilter(c,tp,xyzc)
29+
return c:IsFaceup() and c:IsOriginalCodeRule(2407234)
30+
end
31+
function s.spcon(e,tp,eg,ep,ev,re,r,rp)
32+
local ttype,tloc,tplayer=Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_TYPE,CHAININFO_TRIGGERING_LOCATION,CHAININFO_TRIGGERING_CONTROLER)
33+
return ttype&TYPE_MONSTER>0 and tloc&LOCATION_ONFIELD>0 and tplayer==1-tp
34+
end
35+
function s.xyzfilter(c,e,tp,mc)
36+
return c:IsCode(101208046) and mc:IsCanBeXyzMaterial(c,tp,REASON_EFFECT)
37+
and Duel.GetLocationCountFromEx(tp,tp,mc,c)>0 and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_XYZ,tp,false,false)
38+
end
39+
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
40+
local c=e:GetHandler()
41+
if chk==0 then
42+
local pg=aux.GetMustBeMaterialGroup(tp,Group.FromCards(c),tp,nil,nil,REASON_XYZ)
43+
return (#pg<=0 or (#pg==1 and pg:IsContains(c)))
44+
and Duel.IsExistingMatchingCard(s.xyzfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp,c)
45+
end
46+
Duel.SetTargetCard(eg)
47+
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
48+
Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,1,tp,0)
49+
end
50+
function s.spop(e,tp,eg,ep,ev,re,r,rp)
51+
local c=e:GetHandler()
52+
if not (c:IsFaceup() and c:IsRelateToEffect(e) and c:IsControler(tp) and not c:IsImmuneToEffect(e)) then return end
53+
local pg=aux.GetMustBeMaterialGroup(tp,Group.FromCards(c),tp,nil,nil,REASON_XYZ)
54+
if #pg>1 or (#pg==1 and not pg:IsContains(c)) then return end
55+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
56+
local xyzc=Duel.SelectMatchingCard(tp,s.xyzfilter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp,c):GetFirst()
57+
if not xyzc then return end
58+
xyzc:SetMaterial(c)
59+
Duel.Overlay(xyzc,c)
60+
if Duel.SpecialSummon(xyzc,SUMMON_TYPE_XYZ,tp,tp,false,false,POS_FACEUP)>0 then
61+
xyzc:CompleteProcedure()
62+
local dg=Duel.GetFirstTarget()
63+
if dg:IsControler(1-tp) and dg:IsRelateToEffect(e)
64+
and (Duel.CheckEvent(EVENT_ATTACK_ANNOUNCE) or dg:IsRelateToEffect(re)) then
65+
Duel.BreakEffect()
66+
Duel.Destroy(dg,REASON_EFFECT)
67+
end
68+
end
69+
end

pre-release/c101208046.lua

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
--No.69 紋章神コート・オブ・アームズ-ゴッド・レイジ
2+
--Number 69: Heraldry Crest - Dark Matter Demolition
3+
--Scripted by The Razgriz
4+
local s,id=GetID()
5+
function s.initial_effect(c)
6+
c:EnableReviveLimit()
7+
--Xyz Summon procedure: 5 Level 4 monsters
8+
Xyz.AddProcedure(c,nil,4,5)
9+
--Cannot be destroyed by battle or card effects
10+
local e1=Effect.CreateEffect(c)
11+
e1:SetType(EFFECT_TYPE_SINGLE)
12+
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
13+
e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
14+
e1:SetRange(LOCATION_MZONE)
15+
e1:SetValue(1)
16+
c:RegisterEffect(e1)
17+
local e2=e1:Clone()
18+
e2:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
19+
c:RegisterEffect(e2)
20+
--Change opponent's monster's name to "Unknown"
21+
local e3=Effect.CreateEffect(c)
22+
e3:SetDescription(aux.Stringid(id,0))
23+
e3:SetType(EFFECT_TYPE_QUICK_O)
24+
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
25+
e3:SetCode(EVENT_FREE_CHAIN)
26+
e3:SetRange(LOCATION_MZONE)
27+
e3:SetCountLimit(1)
28+
e3:SetHintTiming(0,TIMING_STANDBY_PHASE|TIMING_MAIN_END|TIMINGS_CHECK_MONSTER_E)
29+
e3:SetCost(aux.dxmcostgen(1,1,nil))
30+
e3:SetTarget(s.namechangetg)
31+
e3:SetOperation(s.namechangeop)
32+
c:RegisterEffect(e3,false,REGISTER_FLAG_DETACH_XMAT)
33+
--Negate the activated effects of "Unknown" your opponent controls
34+
local e4=Effect.CreateEffect(c)
35+
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
36+
e4:SetCode(EVENT_CHAIN_SOLVING)
37+
e4:SetRange(LOCATION_MZONE)
38+
e4:SetOperation(s.disop)
39+
c:RegisterEffect(e4)
40+
end
41+
s.xyz_number=69
42+
s.listed_names={CARD_UNKNOWN}
43+
function s.namechangefilter(c)
44+
return c:IsFaceup() and not c:IsCode(CARD_UNKNOWN)
45+
end
46+
function s.namechangetg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
47+
if chkc then return chkc:IsControler(1-tp) and chkc:IsLocation(LOCATION_MZONE) and s.namechangefilter(chkc) end
48+
if chk==0 then return Duel.IsExistingTarget(s.namechangefilter,tp,0,LOCATION_MZONE,1,nil) end
49+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
50+
Duel.SelectTarget(tp,s.namechangefilter,tp,0,LOCATION_MZONE,1,1,nil)
51+
end
52+
function s.namechangeop(e,tp,eg,ep,ev,re,r,rp)
53+
local tc=Duel.GetFirstTarget()
54+
if tc:IsRelateToEffect(e) and not tc:IsCode(CARD_UNKNOWN) then
55+
--Its name becomes "Unknown"
56+
local e1=Effect.CreateEffect(e:GetHandler())
57+
e1:SetType(EFFECT_TYPE_SINGLE)
58+
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
59+
e1:SetCode(EFFECT_CHANGE_CODE)
60+
e1:SetValue(CARD_UNKNOWN)
61+
e1:SetReset(RESET_EVENT|RESETS_STANDARD)
62+
tc:RegisterEffect(e1)
63+
end
64+
end
65+
function s.disop(e,tp,eg,ep,ev,re,r,rp)
66+
if rp==1-tp and re:IsMonsterEffect() then
67+
local rc=re:GetHandler()
68+
if rc:IsRelateToEffect(re) and rc:IsCode(CARD_UNKNOWN) then
69+
Duel.NegateEffect(ev)
70+
end
71+
end
72+
end

0 commit comments

Comments
 (0)