Skip to content

Commit 6e5e609

Browse files
authored
Added new card scripts
1 parent fa20c3a commit 6e5e609

File tree

3 files changed

+227
-0
lines changed

3 files changed

+227
-0
lines changed

pre-release/c101301037.lua

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
--聖秘なる竜騎士
2+
--Sacramentum Dragoon
3+
--scripted by Naim
4+
local s,id=GetID()
5+
function s.initial_effect(c)
6+
c:EnableReviveLimit()
7+
--Fusion Materials: 1 Dragon monster + 1 Spellcaster monster
8+
Fusion.AddProcMix(c,true,true,aux.FilterBoolFunctionEx(Card.IsRace,RACE_DRAGON),aux.FilterBoolFunctionEx(Card.IsRace,RACE_SPELLCASTER))
9+
--Loses 100 ATK for each of your banished cards
10+
local e1=Effect.CreateEffect(c)
11+
e1:SetType(EFFECT_TYPE_SINGLE)
12+
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
13+
e1:SetCode(EFFECT_UPDATE_ATTACK)
14+
e1:SetRange(LOCATION_MZONE)
15+
e1:SetValue(function(e) return -100*Duel.GetFieldGroupCount(e:GetHandlerPlayer(),LOCATION_REMOVED,0) end)
16+
c:RegisterEffect(e1)
17+
--While you control this Fusion Summoned card, your opponent cannot activate the effects of Special Summoned Dragon and Spellcaster monsters they control
18+
local e2=Effect.CreateEffect(c)
19+
e2:SetType(EFFECT_TYPE_FIELD)
20+
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
21+
e2:SetCode(EFFECT_CANNOT_ACTIVATE)
22+
e2:SetRange(LOCATION_MZONE)
23+
e2:SetTargetRange(0,1)
24+
e2:SetCondition(function(e) return e:GetHandler():IsFusionSummoned() end)
25+
e2:SetValue(s.actlimval)
26+
c:RegisterEffect(e2)
27+
--Special Summon 1 Dragon or 1 Spellcaster monster from your GY and place the other on the bottom of the Deck
28+
local e3=Effect.CreateEffect(c)
29+
e3:SetDescription(aux.Stringid(id,0))
30+
e3:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TODECK)
31+
e3:SetType(EFFECT_TYPE_IGNITION)
32+
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
33+
e3:SetRange(LOCATION_MZONE)
34+
e3:SetCountLimit(1,id)
35+
e3:SetTarget(s.sptdtg)
36+
e3:SetOperation(s.sptdop)
37+
c:RegisterEffect(e3)
38+
end
39+
function s.actlimval(e,re,rp)
40+
local rc=re:GetHandler()
41+
return re:IsMonsterEffect() and rc:IsSpecialSummoned() and rc:IsFaceup() and rc:IsRace(RACE_DRAGON|RACE_SPELLCASTER) and rc:IsLocation(LOCATION_MZONE)
42+
end
43+
function s.sptdfilter(c,e,tp)
44+
return c:IsRace(RACE_DRAGON|RACE_SPELLCASTER) and (c:IsCanBeSpecialSummoned(e,0,tp,false,false) or c:IsAbleToDeck())
45+
end
46+
function s.rescon(sg,e,tp,mg)
47+
return sg:IsExists(Card.IsRace,1,nil,RACE_DRAGON) and sg:IsExists(Card.IsRace,1,nil,RACE_SPELLCASTER)
48+
and sg:IsExists(s.spchk,1,nil,e,tp,sg)
49+
end
50+
function s.spchk(c,e,tp,sg)
51+
return c:IsCanBeSpecialSummoned(e,0,tp,false,false) and (#sg==1 or sg:IsExists(Card.IsAbleToDeck,1,c))
52+
end
53+
function s.sptdtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
54+
if chkc then return false end
55+
local g=Duel.GetMatchingGroup(s.sptdfilter,tp,LOCATION_GRAVE,0,nil,e,tp)
56+
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
57+
and #g>=2 and aux.SelectUnselectGroup(g,e,tp,2,2,s.rescon,0) end
58+
local tg=aux.SelectUnselectGroup(g,e,tp,2,2,s.rescon,1,tp,HINTMSG_TARGET)
59+
Duel.SetTargetCard(tg)
60+
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,tg,1,tp,0)
61+
Duel.SetOperationInfo(0,CATEGORY_TODECK,tg,1,tp,0)
62+
end
63+
function s.sptdop(e,tp,eg,ep,ev,re,r,rp)
64+
local tg=Duel.GetTargetCards(e)
65+
if (#tg==0 or Duel.GetLocationCount(tp,LOCATION_MZONE)<=0) then return end
66+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
67+
local sg=tg:FilterSelect(tp,s.spchk,1,1,nil,e,tp,tg)
68+
if #sg>0 and Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP)>0 and #tg==2 then
69+
local dg=tg-sg
70+
Duel.HintSelection(dg)
71+
Duel.SendtoDeck(dg,nil,SEQ_DECKBOTTOM,REASON_EFFECT)
72+
end
73+
end

pre-release/c101301048.lua

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
--超念銃士ヴァロン
2+
--Vallon, the Psychic Skyblaster
3+
--scripted by Naim
4+
local s,id=GetID()
5+
function s.initial_effect(c)
6+
c:EnableReviveLimit()
7+
--Xyz Summon procedure: 2 Level 5 monsters
8+
Xyz.AddProcedure(c,nil,5,2)
9+
--Change 1 face-up monster your opponent controls to face-down Defense Position
10+
local e1=Effect.CreateEffect(c)
11+
e1:SetDescription(aux.Stringid(id,0))
12+
e1:SetCategory(CATEGORY_POSITION)
13+
e1:SetType(EFFECT_TYPE_QUICK_O)
14+
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
15+
e1:SetCode(EVENT_FREE_CHAIN)
16+
e1:SetRange(LOCATION_MZONE)
17+
e1:SetCountLimit(1,id)
18+
e1:SetHintTiming(0,TIMING_MAIN_END|TIMINGS_CHECK_MONSTER)
19+
e1:SetCondition(function() return Duel.IsMainPhase() end)
20+
e1:SetCost(Cost.Detach(1))
21+
e1:SetTarget(s.postg)
22+
e1:SetOperation(s.posop)
23+
c:RegisterEffect(e1,false,REGISTER_FLAG_DETACH_XMAT)
24+
--Destroy 1 face-down card on the field
25+
local e2=Effect.CreateEffect(c)
26+
e2:SetDescription(aux.Stringid(id,1))
27+
e2:SetCategory(CATEGORY_DESTROY)
28+
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
29+
e2:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY)
30+
e2:SetCode(EVENT_TO_GRAVE)
31+
e2:SetCountLimit(1,{id,1})
32+
e2:SetTarget(s.destg)
33+
e2:SetOperation(s.desop)
34+
c:RegisterEffect(e2)
35+
end
36+
function s.postg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
37+
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsCanTurnSet() and chkc:IsControler(1-tp) end
38+
if chk==0 then return Duel.IsExistingTarget(Card.IsCanTurnSet,tp,0,LOCATION_MZONE,1,nil) end
39+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_POSCHANGE)
40+
local g=Duel.SelectTarget(tp,Card.IsCanTurnSet,tp,0,LOCATION_MZONE,1,1,nil)
41+
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,tp,POS_FACEDOWN_DEFENSE)
42+
end
43+
function s.posop(e,tp,eg,ep,ev,re,r,rp)
44+
local tc=Duel.GetFirstTarget()
45+
if tc:IsFaceup() and tc:IsRelateToEffect(e) then
46+
Duel.ChangePosition(tc,POS_FACEDOWN_DEFENSE)
47+
end
48+
end
49+
function s.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
50+
if chkc then return chkc:IsOnField() and chkc:IsFacedown() end
51+
if chk==0 then return Duel.IsExistingTarget(Card.IsFacedown,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end
52+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
53+
local g=Duel.SelectTarget(tp,Card.IsFacedown,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
54+
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,tp,0)
55+
end
56+
function s.desop(e,tp,eg,ep,ev,re,r,rp)
57+
local tc=Duel.GetFirstTarget()
58+
if tc:IsRelateToEffect(e) then
59+
Duel.Destroy(tc,REASON_EFFECT)
60+
end
61+
end

pre-release/c101301051.lua

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
--うかのみつねのおなり
2+
--Ukanomitsune-no-Onari
3+
--scripted by Naim
4+
local s,id=GetID()
5+
function s.initial_effect(c)
6+
c:EnableReviveLimit()
7+
--Link Summon procedure: 2 LIGHT monsters, including a Beast monster
8+
Link.AddProcedure(c,aux.FilterBoolFunctionEx(Card.IsAttribute,ATTRIBUTE_LIGHT),2,2,s.matcheck)
9+
--Your opponent cannot target cards in the Field Zones with card effects
10+
local e1=Effect.CreateEffect(c)
11+
e1:SetType(EFFECT_TYPE_FIELD)
12+
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE+EFFECT_FLAG_SET_AVAILABLE)
13+
e1:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
14+
e1:SetRange(LOCATION_MZONE)
15+
e1:SetTargetRange(LOCATION_FZONE,LOCATION_FZONE)
16+
e1:SetValue(aux.tgoval)
17+
c:RegisterEffect(e1)
18+
--Set 1 Quick-Play Spell from your GY
19+
local e2=Effect.CreateEffect(c)
20+
e2:SetDescription(aux.Stringid(id,0))
21+
e2:SetCategory(CATEGORY_LEAVE_GRAVE)
22+
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
23+
e2:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET)
24+
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
25+
e2:SetCountLimit(1,id)
26+
e2:SetCondition(function(e) return e:GetHandler():IsLinkSummoned() end)
27+
e2:SetTarget(s.settg)
28+
e2:SetOperation(s.setop)
29+
c:RegisterEffect(e2)
30+
--Apply effects up to the number of cards in the Field Zones
31+
local e3=Effect.CreateEffect(c)
32+
e3:SetDescription(aux.Stringid(id,1))
33+
e3:SetCategory(CATEGORY_DESTROY+CATEGORY_DAMAGE)
34+
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
35+
e3:SetProperty(EFFECT_FLAG_DELAY)
36+
e3:SetCode(EVENT_DESTROYED)
37+
e3:SetCountLimit(1,{id,1})
38+
e3:SetTarget(s.efftg)
39+
e3:SetOperation(s.effop)
40+
c:RegisterEffect(e3)
41+
end
42+
function s.matcheck(g,lc,sumtype,tp)
43+
return g:IsExists(Card.IsRace,1,nil,RACE_BEAST,lc,sumtype,tp)
44+
end
45+
function s.setfilter(c)
46+
return c:IsQuickPlaySpell() and c:IsSSetable()
47+
end
48+
function s.settg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
49+
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and s.setfilter(chkc) end
50+
if chk==0 then return Duel.IsExistingTarget(s.setfilter,tp,LOCATION_GRAVE,0,1,nil) end
51+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
52+
local g=Duel.SelectTarget(tp,s.setfilter,tp,LOCATION_GRAVE,0,1,1,nil)
53+
Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,g,1,tp,0)
54+
end
55+
function s.setop(e,tp,eg,ep,ev,re,r,rp)
56+
local tc=Duel.GetFirstTarget()
57+
if tc:IsRelateToEffect(e) and tc:IsSSetable() then
58+
Duel.SSet(tp,tc)
59+
end
60+
end
61+
function s.efftg(e,tp,eg,ep,ev,re,r,rp,chk)
62+
if chk==0 then return Duel.GetFieldGroupCount(0,LOCATION_FZONE,LOCATION_FZONE)>0 end
63+
Duel.SetPossibleOperationInfo(0,CATEGORY_DESTROY,nil,1,1-tp,LOCATION_ONFIELD)
64+
Duel.SetPossibleOperationInfo(0,CATEGORY_DAMAGE,nil,1,1-tp,1500)
65+
end
66+
function s.effop(e,tp,eg,ep,ev,re,r,rp)
67+
local ct=Duel.GetFieldGroupCount(0,LOCATION_FZONE,LOCATION_FZONE)
68+
if ct==0 then return end
69+
local g=Duel.GetFieldGroup(tp,0,LOCATION_ONFIELD)
70+
local b1=#g>0
71+
local b2=true
72+
local b3=b1 and ct==2
73+
local op=Duel.SelectEffect(tp,
74+
{b1,aux.Stringid(id,2)},
75+
{b2,aux.Stringid(id,3)},
76+
{b3,aux.Stringid(id,4)})
77+
local breakeffect=false
78+
if op&1>0 then
79+
--Destroy 1 card your opponent controls
80+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
81+
local sg=g:Select(tp,1,1,nil)
82+
if #sg>0 then
83+
Duel.HintSelection(sg)
84+
Duel.Destroy(sg,REASON_EFFECT)
85+
breakeffect=true
86+
end
87+
end
88+
if op&2>0 then
89+
--Inflict 1500 damage to your opponent
90+
if breakeffect then Duel.BreakEffect() end
91+
Duel.Damage(1-tp,1500,REASON_EFFECT)
92+
end
93+
end

0 commit comments

Comments
 (0)