Skip to content

Commit d739afe

Browse files
authored
Added new card scripts
1 parent 07aa605 commit d739afe

File tree

3 files changed

+224
-0
lines changed

3 files changed

+224
-0
lines changed

pre-release/c100448001.lua

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
--破滅と終焉の支配者
2+
--End of the World Ruler
3+
--Scripted by The Razgriz
4+
local s,id=GetID()
5+
function s.initial_effect(c)
6+
c:EnableReviveLimit()
7+
--This card's name becomes "Demise, King of Armageddon" while in the hand or field
8+
local e1=Effect.CreateEffect(c)
9+
e1:SetType(EFFECT_TYPE_SINGLE)
10+
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
11+
e1:SetCode(EFFECT_CHANGE_CODE)
12+
e1:SetRange(LOCATION_HAND|LOCATION_MZONE)
13+
e1:SetValue(72426662)
14+
c:RegisterEffect(e1)
15+
--Apply the effect of a Ritual Spell that Ritual Summons
16+
local e2=Effect.CreateEffect(c)
17+
e2:SetDescription(aux.Stringid(id,0))
18+
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
19+
e2:SetType(EFFECT_TYPE_IGNITION)
20+
e2:SetRange(LOCATION_HAND)
21+
e2:SetCountLimit(1,id)
22+
e2:SetCost(Cost.AND(Cost.SelfReveal,Cost.PayLP(2000),s.applycost))
23+
e2:SetTarget(s.applytg)
24+
e2:SetOperation(s.applyop)
25+
c:RegisterEffect(e2)
26+
--Destroy as many other cards on the field as possible, then this card gains 2900 ATK
27+
local e3=Effect.CreateEffect(c)
28+
e3:SetDescription(aux.Stringid(id,1))
29+
e3:SetCategory(CATEGORY_DESTROY+CATEGORY_ATKCHANGE)
30+
e3:SetType(EFFECT_TYPE_IGNITION)
31+
e3:SetRange(LOCATION_MZONE)
32+
e3:SetCountLimit(1,{id,1})
33+
e3:SetCost(Cost.PayLP(2000))
34+
e3:SetTarget(s.destg)
35+
e3:SetOperation(s.desop)
36+
c:RegisterEffect(e3)
37+
end
38+
s.listed_series={SET_END_OF_THE_WORLD}
39+
s.listed_names={72426662} --"Demise, King of Armageddon"
40+
function s.applyfilter(c)
41+
return c:IsRitualSpell() and c:IsAbleToRemoveAsCost() and c:CheckActivateEffect(true,true,false)~=nil
42+
end
43+
function s.applycost(e,tp,eg,ep,ev,re,r,rp,chk)
44+
if chk==0 then return Duel.IsExistingMatchingCard(s.applyfilter,tp,LOCATION_DECK,0,1,nil) end
45+
end
46+
function s.applytg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
47+
if chkc then
48+
local te=e:GetLabelObject()
49+
return tg and tg(e,tp,eg,ep,ev,re,r,rp,0,chkc)
50+
end
51+
if chk==0 then return Duel.IsExistingMatchingCard(s.applyfilter,tp,LOCATION_DECK,0,1,nil) end
52+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
53+
local g=Duel.SelectMatchingCard(tp,s.applyfilter,tp,LOCATION_DECK,0,1,1,nil)
54+
Duel.Remove(g,POS_FACEUP,REASON_COST)
55+
local te=g:GetFirst():CheckActivateEffect(true,true,false)
56+
e:SetLabel(te:GetLabel())
57+
e:SetLabelObject(te:GetLabelObject())
58+
local tg=te:GetTarget()
59+
e:SetProperty(te:GetProperty())
60+
if tg then
61+
tg(e,tp,eg,ep,ev,re,r,rp,1)
62+
end
63+
te:SetLabel(e:GetLabel())
64+
te:SetLabelObject(e:GetLabelObject())
65+
e:SetLabelObject(te)
66+
Duel.ClearOperationInfo(0)
67+
end
68+
function s.applyop(e,tp,eg,ep,ev,re,r,rp)
69+
local te=e:GetLabelObject()
70+
if te then
71+
e:SetLabel(te:GetLabel())
72+
e:SetLabelObject(te:GetLabelObject())
73+
local op=te:GetOperation()
74+
if op then op(e,tp,eg,ep,ev,re,r,rp) end
75+
te:SetLabel(e:GetLabel())
76+
te:SetLabelObject(e:GetLabelObject())
77+
end
78+
end
79+
function s.destg(e,tp,eg,ep,ev,re,r,rp,chk)
80+
local g=Duel.GetMatchingGroup(nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,e:GetHandler())
81+
if chk==0 then return #g>0 end
82+
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,#g,tp,0)
83+
end
84+
function s.desop(e,tp,eg,ep,ev,re,r,rp)
85+
local c=e:GetHandler()
86+
local exc=c:IsRelateToEffect(e) and c or nil
87+
local g=Duel.GetMatchingGroup(nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,exc)
88+
if #g>0 and Duel.Destroy(g,REASON_EFFECT)>0 and c:IsRelateToEffect(e) and c:IsFaceup() then
89+
Duel.BreakEffect()
90+
--This card gains 2900 ATK
91+
c:UpdateAttack(2900)
92+
end
93+
end

pre-release/c100448002.lua

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
--ナイトメア・アイズ・サクリファイス
2+
--Nightmare-Eyes Restrict
3+
--Scripted by The Razgriz
4+
local s,id=GetID()
5+
function s.initial_effect(c)
6+
c:EnableReviveLimit()
7+
--Fusion Materials: 2 monsters with different Types (Fiend, Illusion, or Spellcaster)
8+
Fusion.AddProcMixN(c,true,true,s.matfilter,2)
9+
--Equip 1 monster your opponent controls to this card as an Equip Spell
10+
local e1a=Effect.CreateEffect(c)
11+
e1a:SetDescription(aux.Stringid(id,0))
12+
e1a:SetCategory(CATEGORY_EQUIP)
13+
e1a:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
14+
e1a:SetProperty(EFFECT_FLAG_DELAY)
15+
e1a:SetCode(EVENT_SPSUMMON_SUCCESS)
16+
e1a:SetCountLimit(1,id)
17+
e1a:SetTarget(s.eqtg)
18+
e1a:SetOperation(s.eqop)
19+
c:RegisterEffect(e1a)
20+
local e1b=e1a:Clone()
21+
e1b:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
22+
e1b:SetCode(EVENT_PHASE+PHASE_BATTLE)
23+
e1b:SetRange(LOCATION_MZONE)
24+
e1b:SetCondition(function(e) return e:GetHandler():GetBattledGroupCount()>0 end)
25+
c:RegisterEffect(e1b)
26+
aux.AddEREquipLimit(c,nil,s.eqval,s.equipop,e1a)
27+
aux.AddEREquipLimit(c,nil,s.eqval,s.equipop,e1b)
28+
--Gains ATK equal to the combined ATK of those equipped monsters
29+
local e2=Effect.CreateEffect(c)
30+
e2:SetType(EFFECT_TYPE_SINGLE)
31+
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
32+
e2:SetCode(EFFECT_UPDATE_ATTACK)
33+
e2:SetRange(LOCATION_MZONE)
34+
e2:SetCondition(function(e) return e:GetHandler():GetEquipGroup():IsExists(aux.FaceupFilter(Card.HasFlagEffect,id),1,nil) end)
35+
e2:SetValue(function(e,c) return c:GetEquipGroup():Match(function(c) return c:HasFlagEffect(id) and c:IsFaceup() and c:GetTextAttack()>0 end,nil):GetSum(Card.GetTextAttack) end)
36+
c:RegisterEffect(e2)
37+
--If this card battles a monster, neither can be destroyed by that battle
38+
local e3=Effect.CreateEffect(c)
39+
e3:SetType(EFFECT_TYPE_FIELD)
40+
e3:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
41+
e3:SetRange(LOCATION_MZONE)
42+
e3:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
43+
e3:SetTarget(function(e,c) local handler=e:GetHandler() return c==handler or c==handler:GetBattleTarget() end)
44+
e3:SetValue(1)
45+
c:RegisterEffect(e3)
46+
--Your opponent's monsters cannot attack monsters, except this one
47+
local e4=Effect.CreateEffect(c)
48+
e4:SetType(EFFECT_TYPE_FIELD)
49+
e4:SetCode(EFFECT_CANNOT_SELECT_BATTLE_TARGET)
50+
e4:SetRange(LOCATION_MZONE)
51+
e4:SetTargetRange(0,LOCATION_MZONE)
52+
e4:SetValue(function(e,c) return c~=e:GetHandler() end)
53+
c:RegisterEffect(e4)
54+
end
55+
function s.matfilter(c,fc,sumtype,sp,sub,mg,sg)
56+
return c:IsRace(RACE_FIEND|RACE_ILLUSION|RACE_SPELLCASTER,fc,sumtype,sp) and (not sg or sg:FilterCount(aux.TRUE,c)==0 or not sg:IsExists(Card.IsRace,1,c,c:GetRace(),fc,sumtype,sp))
57+
end
58+
function s.eqtg(e,tp,eg,ep,ev,re,r,rp,chk)
59+
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0
60+
and Duel.IsExistingMatchingCard(Card.IsAbleToChangeControler,tp,0,LOCATION_MZONE,1,nil) end
61+
Duel.SetOperationInfo(0,CATEGORY_EQUIP,nil,1,1-tp,LOCATION_MZONE)
62+
end
63+
function s.eqop(e,tp,eg,ep,ev,re,r,rp)
64+
if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 then return end
65+
local c=e:GetHandler()
66+
if not (c:IsRelateToEffect(e) and c:IsFaceup()) then return end
67+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
68+
local sc=Duel.SelectMatchingCard(tp,Card.IsAbleToChangeControler,tp,0,LOCATION_MZONE,1,1,nil):GetFirst()
69+
if sc then
70+
Duel.HintSelection(sc)
71+
s.equipop(c,e,tp,sc)
72+
end
73+
end
74+
function s.eqval(ec,c,tp)
75+
return ec:IsControler(1-tp)
76+
end
77+
function s.equipop(c,e,tp,tc)
78+
c:EquipByEffectAndLimitRegister(e,tp,tc,id)
79+
end

pre-release/c101303042.lua

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
--鎖縛竜ザレン
2+
--Zaren the Chainbound Dragon
3+
--Scripted by Hatter
4+
local s,id=GetID()
5+
function s.initial_effect(c)
6+
c:EnableReviveLimit()
7+
--Synchro Summon procedure: 1 Tuner + 1+ Synchro Monsters
8+
Synchro.AddProcedure(c,nil,1,1,aux.FilterBoolFunctionEx(Card.IsType,TYPE_SYNCHRO),1,99)
9+
--If this card you control would be used as Synchro Material, you can treat it as a non-Tuner
10+
local e1=Effect.CreateEffect(c)
11+
e1:SetType(EFFECT_TYPE_SINGLE)
12+
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
13+
e1:SetCode(EFFECT_NONTUNER)
14+
e1:SetRange(LOCATION_MZONE)
15+
c:RegisterEffect(e1)
16+
--Activate 1 of these effects
17+
local e2=Effect.CreateEffect(c)
18+
e2:SetDescription(aux.Stringid(id,0))
19+
e2:SetCategory(CATEGORY_DISABLE+CATEGORY_DESTROY)
20+
e2:SetType(EFFECT_TYPE_QUICK_O)
21+
e2:SetCode(EVENT_CHAINING)
22+
e2:SetRange(LOCATION_MZONE)
23+
e2:SetCountLimit(1,id)
24+
e2:SetCondition(function() return Duel.GetCurrentChain()>1 end)
25+
e2:SetTarget(s.distg)
26+
e2:SetOperation(s.disop)
27+
c:RegisterEffect(e2)
28+
end
29+
function s.distg(e,tp,eg,ep,ev,re,r,rp,chk)
30+
local b1=Duel.IsChainDisablable(ev)
31+
local b2=Duel.IsChainDisablable(ev-1)
32+
if chk==0 then return b1 or b2 end
33+
local op=Duel.SelectEffect(tp,
34+
{b1,aux.Stringid(id,1)},
35+
{b2,aux.Stringid(id,2)})
36+
local ch=ev-op+1
37+
e:SetLabel(ch)
38+
local eff=Duel.GetChainInfo(ch,CHAININFO_TRIGGERING_EFFECT)
39+
local rc=eff:GetHandler()
40+
Duel.SetOperationInfo(0,CATEGORY_DISABLE,rc,1,tp,0)
41+
if rc:IsDestructable() and rc:IsRelateToEffect(eff) then
42+
Duel.SetOperationInfo(0,CATEGORY_DESTROY,rc,1,tp,0)
43+
end
44+
end
45+
function s.disop(e,tp,eg,ep,ev,re,r,rp)
46+
local ch=e:GetLabel()
47+
local eff=Duel.GetChainInfo(ch,CHAININFO_TRIGGERING_EFFECT)
48+
local rc=eff:GetHandler()
49+
if Duel.NegateEffect(ch) and rc:IsRelateToEffect(eff) then
50+
Duel.Destroy(rc,REASON_EFFECT)
51+
end
52+
end

0 commit comments

Comments
 (0)