Skip to content

Commit 8da4a76

Browse files
authored
Added new card scripts
1 parent 7b7540d commit 8da4a76

File tree

8 files changed

+469
-0
lines changed

8 files changed

+469
-0
lines changed

pre-release/c101208090.lua

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
--巳剣之尊 麁正
2+
--Mitsurugi no Mikoto, Aramasa
3+
local s,id=GetID()
4+
function s.initial_effect(c)
5+
--Add 1 "Mitsurugi" monster from your Deck to your hand
6+
local e1=Effect.CreateEffect(c)
7+
e1:SetDescription(aux.Stringid(id,0))
8+
e1:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND)
9+
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
10+
e1:SetProperty(EFFECT_FLAG_DELAY)
11+
e1:SetCode(EVENT_SUMMON_SUCCESS)
12+
e1:SetCountLimit(1,id)
13+
e1:SetTarget(s.thtg)
14+
e1:SetOperation(s.thop)
15+
c:RegisterEffect(e1)
16+
local e2=e1:Clone()
17+
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
18+
c:RegisterEffect(e2)
19+
local e3=e1:Clone()
20+
e3:SetCode(EVENT_RELEASE)
21+
c:RegisterEffect(e3)
22+
--If another Reptile monster(s) you control would be destroyed by battle or card effect, you can Tribute this card instead
23+
local e4=Effect.CreateEffect(c)
24+
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
25+
e4:SetCode(EFFECT_DESTROY_REPLACE)
26+
e4:SetRange(LOCATION_MZONE)
27+
e4:SetCountLimit(1,{id,1})
28+
e4:SetTarget(s.reptg)
29+
e4:SetValue(function(e,c) return s.repfilter(c,e:GetHandlerPlayer()) end)
30+
e4:SetOperation(function(e,tp,eg,ep,ev,re,r,rp) Duel.Release(e:GetHandler(),REASON_EFFECT|REASON_REPLACE) end)
31+
c:RegisterEffect(e4)
32+
end
33+
s.listed_series={SET_MITSURUGI}
34+
s.listed_names={id}
35+
function s.thfilter(c)
36+
return c:IsSetCard(SET_MITSURUGI) and c:IsMonster() and not c:IsCode(id) 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,1,nil) end
40+
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,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,1,1,nil)
45+
if #g>0 then
46+
Duel.SendtoHand(g,nil,REASON_EFFECT)
47+
Duel.ConfirmCards(1-tp,g)
48+
end
49+
end
50+
function s.repfilter(c,tp)
51+
return c:IsFaceup() and c:IsControler(tp) and c:IsLocation(LOCATION_MZONE) and c:IsRace(RACE_REPTILE)
52+
and c:IsReason(REASON_BATTLE|REASON_EFFECT) and not c:IsReason(REASON_REPLACE)
53+
end
54+
function s.reptg(e,tp,eg,ep,ev,re,r,rp,chk)
55+
local c=e:GetHandler()
56+
if chk==0 then return eg:IsExists(s.repfilter,1,c,tp)
57+
and c:IsReleasableByEffect(e) and not c:IsStatus(STATUS_DESTROY_CONFIRMED) end
58+
return Duel.SelectEffectYesNo(tp,c,96)
59+
end

pre-release/c101208091.lua

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
--巳剣之皇子 小碓
2+
--Mitsurugi no Miko, Wousu
3+
--scripted by pyrQ
4+
local s,id=GetID()
5+
function s.initial_effect(c)
6+
--You can Special Summon this card (from your hand) by Tributing 1 other Reptile mosnter from your hand and 1 monster your opponent controls
7+
local e1=Effect.CreateEffect(c)
8+
e1:SetDescription(aux.Stringid(id,0))
9+
e1:SetType(EFFECT_TYPE_FIELD)
10+
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
11+
e1:SetCode(EFFECT_SPSUMMON_PROC)
12+
e1:SetRange(LOCATION_HAND)
13+
e1:SetCountLimit(1,id,EFFECT_COUNT_CODE_OATH)
14+
e1:SetCondition(s.spcon)
15+
e1:SetTarget(s.sptg)
16+
e1:SetOperation(s.spop)
17+
c:RegisterEffect(e1)
18+
--Discard 1 card, and if you do, add this card to your hand
19+
local e2=Effect.CreateEffect(c)
20+
e2:SetDescription(aux.Stringid(id,1))
21+
e2:SetCategory(CATEGORY_HANDES+CATEGORY_TOHAND)
22+
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
23+
e2:SetProperty(EFFECT_FLAG_DELAY)
24+
e2:SetCode(EVENT_RELEASE)
25+
e2:SetCountLimit(1,{id,1})
26+
e2:SetTarget(s.thtg)
27+
e2:SetOperation(s.thop)
28+
c:RegisterEffect(e2)
29+
end
30+
function s.spconfilter(c,tp)
31+
return (c:IsRace(RACE_REPTILE) or c:IsControler(1-tp)) and c:IsReleasable()
32+
end
33+
function s.spcon(e,c)
34+
if c==nil then return true end
35+
local tp=e:GetHandlerPlayer()
36+
local g=Duel.GetMatchingGroup(s.spconfilter,tp,LOCATION_HAND,LOCATION_MZONE,c,tp)
37+
return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and #g>0 and aux.SelectUnselectGroup(g,e,tp,2,2,aux.dpcheck(Card.GetControler),0)
38+
end
39+
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk,c)
40+
local rg=Duel.GetMatchingGroup(s.spconfilter,tp,LOCATION_HAND,LOCATION_MZONE,c,tp)
41+
local g=aux.SelectUnselectGroup(rg,e,tp,2,2,aux.dpcheck(Card.GetControler),1,tp,HINTMSG_RELEASE,nil,nil,true)
42+
if #g>0 then
43+
g:KeepAlive()
44+
e:SetLabelObject(g)
45+
return true
46+
end
47+
return false
48+
end
49+
function s.spop(e,tp,eg,ep,ev,re,r,rp,c)
50+
local g=e:GetLabelObject()
51+
if not g then return end
52+
Duel.Release(g,REASON_COST)
53+
g:DeleteGroup()
54+
--You cannot Special Summon nor activate monster effects for the rest of this turn, except Reptile monsters
55+
local e1=Effect.CreateEffect(c)
56+
e1:SetDescription(aux.Stringid(id,2))
57+
e1:SetType(EFFECT_TYPE_FIELD)
58+
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH+EFFECT_FLAG_CLIENT_HINT)
59+
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
60+
e1:SetTargetRange(1,0)
61+
e1:SetTarget(function(e,c) return not c:IsRace(RACE_REPTILE) end)
62+
e1:SetReset(RESET_PHASE|PHASE_END)
63+
Duel.RegisterEffect(e1,tp)
64+
local e2=e1:Clone()
65+
e2:SetCode(EFFECT_CANNOT_ACTIVATE)
66+
e2:SetTarget(aux.TRUE)
67+
e2:SetValue(function(e,re) return re:IsMonsterEffect() and not re:GetHandler():IsRace(RACE_REPTILE) end)
68+
Duel.RegisterEffect(e2,tp)
69+
end
70+
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
71+
local c=e:GetHandler()
72+
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,1,nil,REASON_EFFECT)
73+
and c:IsAbleToHand() end
74+
Duel.SetOperationInfo(0,CATEGORY_HANDES,nil,0,tp,1)
75+
Duel.SetOperationInfo(0,CATEGORY_TOHAND,c,1,tp,0)
76+
end
77+
function s.thop(e,tp,eg,ep,ev,re,r,rp)
78+
local c=e:GetHandler()
79+
if Duel.DiscardHand(tp,Card.IsDiscardable,1,1,REASON_EFFECT|REASON_DISCARD)>0 and c:IsRelateToEffect(e) then
80+
Duel.SendtoHand(c,nil,REASON_EFFECT)
81+
Duel.ConfirmCards(1-tp,c)
82+
end
83+
end

pre-release/c101208092.lua

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
--天羽々斬之巳剣
2+
--Ame no Habakiri no Mitsurugi
3+
--scripted by pyrQ
4+
local s,id=GetID()
5+
function s.initial_effect(c)
6+
c:EnableReviveLimit()
7+
--Monsters your opponent controls lose 800 ATK
8+
local e1=Effect.CreateEffect(c)
9+
e1:SetType(EFFECT_TYPE_FIELD)
10+
e1:SetCode(EFFECT_UPDATE_ATTACK)
11+
e1:SetRange(LOCATION_MZONE)
12+
e1:SetTargetRange(0,LOCATION_MZONE)
13+
e1:SetValue(-800)
14+
c:RegisterEffect(e1)
15+
--Special Summon 1 "Mitsurugi" monster from your Deck, then Tribute 1 monster you control
16+
local e2=Effect.CreateEffect(c)
17+
e2:SetDescription(aux.Stringid(id,0))
18+
e2:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_RELEASE)
19+
e2:SetType(EFFECT_TYPE_IGNITION)
20+
e2:SetRange(LOCATION_HAND)
21+
e2:SetCountLimit(1,id,EFFECT_COUNT_CODE_DUEL)
22+
e2:SetCost(Cost.SelfReveal)
23+
e2:SetTarget(s.sptg)
24+
e2:SetOperation(s.spop)
25+
c:RegisterEffect(e2)
26+
--Add 1 "Mitsurugi" card from your Deck to your hand then you can Special Summon this card
27+
local e3=Effect.CreateEffect(c)
28+
e3:SetDescription(aux.Stringid(id,1))
29+
e3:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH+CATEGORY_SPECIAL_SUMMON)
30+
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
31+
e3:SetProperty(EFFECT_FLAG_DELAY)
32+
e3:SetCode(EVENT_RELEASE)
33+
e3:SetCountLimit(1,{id,1})
34+
e3:SetTarget(s.thtg)
35+
e3:SetOperation(s.thop)
36+
c:RegisterEffect(e3)
37+
end
38+
s.listed_series={SET_MITSURUGI}
39+
s.listed_names={id,81560239} --"Mitsurugi Ritual"
40+
function s.spfilter(c,e,tp)
41+
return c:IsSetCard(SET_MITSURUGI) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
42+
end
43+
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
44+
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsPlayerCanRelease(tp)
45+
and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp) end
46+
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
47+
Duel.SetOperationInfo(0,CATEGORY_RELEASE,nil,1,tp,LOCATION_MZONE)
48+
end
49+
function s.spop(e,tp,eg,ep,ev,re,r,rp)
50+
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
51+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
52+
local sg=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
53+
if #sg>0 and Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP)>0 then
54+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
55+
local rg=Duel.SelectMatchingCard(tp,Card.IsReleasableByEffect,tp,LOCATION_MZONE,0,1,1,nil)
56+
if #rg>0 then
57+
Duel.HintSelection(rg)
58+
Duel.BreakEffect()
59+
Duel.Release(rg,REASON_EFFECT)
60+
end
61+
end
62+
end
63+
function s.thfilter(c)
64+
return c:IsSetCard(SET_MITSURUGI) and c:IsAbleToHand() and not c:IsCode(id)
65+
end
66+
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
67+
if chk==0 then return Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil) end
68+
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
69+
Duel.SetPossibleOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,tp,0)
70+
end
71+
function s.thop(e,tp,eg,ep,ev,re,r,rp)
72+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
73+
local g=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_DECK,0,1,1,nil)
74+
if #g==0 or Duel.SendtoHand(g,nil,REASON_EFFECT)==0 then return end
75+
Duel.ConfirmCards(1-tp,g)
76+
local c=e:GetHandler()
77+
if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and c:IsRelateToEffect(e) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
78+
and Duel.SelectYesNo(tp,aux.Stringid(id,2)) then
79+
Duel.BreakEffect()
80+
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
81+
end
82+
end

pre-release/c101208093.lua

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
--巳剣之神鏡
2+
--Mitsurugi Mirror
3+
--scripted by pyrQ
4+
local s,id=GetID()
5+
function s.initial_effect(c)
6+
--Ritual Summon any Reptile Ritual Monster from your hand or GY
7+
local e1=Ritual.CreateProc({handler=c,lvtype=RITPROC_GREATER,filter=function(c) return c:IsRace(RACE_REPTILE) end,matfilter=function(c) return c:IsRace(RACE_REPTILE) end,location=LOCATION_HAND|LOCATION_GRAVE})
8+
e1:SetCountLimit(1,id)
9+
c:RegisterEffect(e1)
10+
--Shuffle this card into the Deck
11+
local e2=Effect.CreateEffect(c)
12+
e2:SetDescription(aux.Stringid(id,1))
13+
e2:SetCategory(CATEGORY_TODECK)
14+
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
15+
e2:SetProperty(EFFECT_FLAG_DELAY,EFFECT_FLAG2_CHECK_SIMULTANEOUS)
16+
e2:SetCode(EVENT_RELEASE)
17+
e2:SetRange(LOCATION_GRAVE)
18+
e2:SetCountLimit(1,{id,1})
19+
e2:SetCondition(s.tdcon)
20+
e2:SetTarget(s.tdtg)
21+
e2:SetOperation(s.tdop)
22+
c:RegisterEffect(e2)
23+
end
24+
s.listed_names={19899073,55397172,101208092}
25+
--"Ame no Murakumo no Mitsurugi", "Futsu no Mitama no Mitsurugi", "Ame no Habakiri no Mitsurugi"
26+
function s.tdconfilter(c,tp)
27+
return c:IsPreviousCodeOnField(19899073,55397172,101208092) and c:IsPreviousPosition(POS_FACEUP) and c:IsPreviousControler(tp)
28+
and c:IsPreviousLocation(LOCATION_ONFIELD)
29+
end
30+
function s.tdcon(e,tp,eg,ep,ev,re,r,rp)
31+
return eg:IsExists(s.tdconfilter,1,nil,tp) and not eg:IsContains(e:GetHandler())
32+
end
33+
function s.tdtg(e,tp,eg,ep,ev,re,r,rp,chk)
34+
local c=e:GetHandler()
35+
if chk==0 then return c:IsAbleToDeck() end
36+
Duel.SetOperationInfo(0,CATEGORY_TODECK,c,1,tp,0)
37+
end
38+
function s.tdop(e,tp,eg,ep,ev,re,r,rp)
39+
local c=e:GetHandler()
40+
if c:IsRelateToEffect(e) then
41+
Duel.HintSelection(c)
42+
Duel.SendtoDeck(c,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)
43+
end
44+
end

pre-release/c101208094.lua

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
--巳剣之勾玉
2+
--Mitsurugi Magatama
3+
--Scripted by Hatter
4+
local s,id=GetID()
5+
function s.initial_effect(c)
6+
--Activate 1 of these effects
7+
local e1=Effect.CreateEffect(c)
8+
e1:SetDescription(aux.Stringid(id,0))
9+
e1:SetType(EFFECT_TYPE_ACTIVATE)
10+
e1:SetCode(EVENT_FREE_CHAIN)
11+
e1:SetCountLimit(1,id,EFFECT_COUNT_CODE_OATH)
12+
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER|TIMING_MAIN_END)
13+
e1:SetCondition(function() return Duel.IsMainPhase() end)
14+
e1:SetTarget(s.efftg)
15+
e1:SetOperation(s.effop)
16+
c:RegisterEffect(e1)
17+
end
18+
s.listed_series={SET_MITSURUGI}
19+
s.ritparams={
20+
lvtype=RITPROC_GREATER,
21+
filter=aux.FilterBoolFunction(Card.IsSetCard,SET_MITSURUGI),
22+
matfilter=aux.FilterBoolFunction(Card.IsLocation,LOCATION_MZONE)
23+
}
24+
function s.rescon(sg,tp)
25+
return Duel.IsExistingTarget(Card.IsFaceup,tp,0,LOCATION_ONFIELD,1,sg)
26+
end
27+
function s.efftg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
28+
if chkc then return chkc:IsOnField() and chkc:IsControler(1-tp) and chkc:IsFaceup() end
29+
local b1=Duel.CheckReleaseGroupCost(tp,Card.IsRace,1,false,s.rescon,nil,RACE_REPTILE)
30+
local b2=Ritual.Target(s.ritparams)(e,tp,eg,ep,ev,re,r,rp,0)
31+
if chk==0 then return b1 or b2 end
32+
local op=Duel.SelectEffect(tp,
33+
{b1,aux.Stringid(id,1)},
34+
{b2,aux.Stringid(id,2)})
35+
e:SetLabel(op)
36+
if op==1 then
37+
e:SetCategory(CATEGORY_DESTROY)
38+
e:SetProperty(EFFECT_FLAG_CARD_TARGET)
39+
local rg=Duel.SelectReleaseGroupCost(tp,Card.IsRace,1,1,false,s.rescon,nil,RACE_REPTILE)
40+
Duel.Release(rg,REASON_COST)
41+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
42+
local tg=Duel.SelectTarget(tp,Card.IsFaceup,tp,0,LOCATION_ONFIELD,1,1,nil)
43+
Duel.SetOperationInfo(0,CATEGORY_DESTROY,tg,1,tp,0)
44+
elseif op==2 then
45+
e:SetCategory(CATEGORY_RELEASE+CATEGORY_SPECIAL_SUMMON)
46+
e:SetProperty(0)
47+
Duel.SetOperationInfo(0,CATEGORY_RELEASE,nil,1,tp,LOCATION_MZONE)
48+
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
49+
end
50+
end
51+
function s.effop(e,tp,eg,ep,ev,re,r,rp)
52+
local op=e:GetLabel()
53+
if op==1 then
54+
--Destroy 1 card your opponent controls
55+
local tc=Duel.GetFirstTarget()
56+
if tc:IsRelateToEffect(e) then
57+
Duel.Destroy(tc,REASON_EFFECT)
58+
end
59+
elseif op==2 then
60+
--Ritual Summon1 "Mitsurugi" Ritual Monster from your hand, by Tributing monsters you control
61+
Ritual.Operation(s.ritparams)(e,tp,eg,ep,ev,re,r,rp)
62+
end
63+
end

0 commit comments

Comments
 (0)