Skip to content

Commit 1a1a265

Browse files
authored
Added new card scripts
1 parent 97d8eef commit 1a1a265

File tree

4 files changed

+311
-0
lines changed

4 files changed

+311
-0
lines changed

pre-release/c100200282.lua

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
--聖月の皇太子レグルス
2+
--Regulus, the Prince of Endymion
3+
--scripted by pyrQ
4+
local s,id=GetID()
5+
function s.initial_effect(c)
6+
--The first time this card would be destroyed by battle each turn, it is not destroyed
7+
local e1=Effect.CreateEffect(c)
8+
e1:SetType(EFFECT_TYPE_SINGLE)
9+
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
10+
e1:SetCode(EFFECT_INDESTRUCTABLE_COUNT)
11+
e1:SetRange(LOCATION_MZONE)
12+
e1:SetCountLimit(1)
13+
e1:SetValue(function(e,re,r,rp) return (r&REASON_BATTLE)>0 end)
14+
c:RegisterEffect(e1)
15+
--Lose LP equal to the revealed Spellcaster monster's Level x 300, and if you do, Special Summon this card
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,0})
22+
e2:SetCost(Cost.Reveal(function(c) return c:IsRace(RACE_SPELLCASTER) and c:HasLevel() end,true,1,1,function(e,tp,og) e:SetLabel(og:GetFirst():GetLevel()) end))
23+
e2:SetTarget(s.sptg)
24+
e2:SetOperation(s.spop)
25+
c:RegisterEffect(e2)
26+
--Add 1 Spell that mentions "Regulus, the Prince of Endymion" from your Deck to your hand
27+
local e3=Effect.CreateEffect(c)
28+
e3:SetDescription(aux.Stringid(id,1))
29+
e3:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
30+
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
31+
e3:SetProperty(EFFECT_FLAG_DELAY)
32+
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
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_names={CARD_REGULUS_THE_PRINCE_OF_ENDYMION}
39+
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
40+
local c=e:GetHandler()
41+
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
42+
and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end
43+
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,tp,0)
44+
end
45+
function s.spop(e,tp,eg,ep,ev,re,r,rp)
46+
Duel.SetLP(tp,Duel.GetLP(tp)-e:GetLabel()*300)
47+
local c=e:GetHandler()
48+
if c:IsRelateToEffect(e) then
49+
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
50+
end
51+
end
52+
function s.thfilter(c)
53+
return c:IsSpell() and c:ListsCode(CARD_REGULUS_THE_PRINCE_OF_ENDYMION) and c:IsAbleToHand()
54+
end
55+
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
56+
if chk==0 then return Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil) end
57+
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
58+
end
59+
function s.thop(e,tp,eg,ep,ev,re,r,rp)
60+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
61+
local g=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_DECK,0,1,1,nil)
62+
if #g>0 then
63+
Duel.SendtoHand(g,nil,REASON_EFFECT)
64+
Duel.ConfirmCards(1-tp,g)
65+
end
66+
end

pre-release/c100450018.lua

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
--エンディミオンの侍女ジェニー
2+
--Genni, the Maid of Endymion
3+
--scripted by pyrQ
4+
local s,id=GetID()
5+
function s.initial_effect(c)
6+
--Special Summon this card from your hand
7+
local e1=Effect.CreateEffect(c)
8+
e1:SetDescription(aux.Stringid(id,0))
9+
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
10+
e1:SetType(EFFECT_TYPE_IGNITION)
11+
e1:SetRange(LOCATION_HAND)
12+
e1:SetCountLimit(1,{id,0})
13+
e1:SetCondition(function(e,tp) return Duel.IsExistingMatchingCard(aux.FaceupFilter(Card.IsRace,RACE_SPELLCASTER),tp,LOCATION_MZONE,0,1,nil) end)
14+
e1:SetTarget(s.selfsptg)
15+
e1:SetOperation(s.selfspop)
16+
c:RegisterEffect(e1)
17+
--Banish 1 Spellcaster monster you control, and if you do, Special Summon 1 "Witchcrafter" monster from your Deck
18+
local e2=Effect.CreateEffect(c)
19+
e2:SetDescription(aux.Stringid(id,1))
20+
e2:SetCategory(CATEGORY_REMOVE+CATEGORY_SPECIAL_SUMMON)
21+
e2:SetType(EFFECT_TYPE_QUICK_O)
22+
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
23+
e2:SetCode(EVENT_FREE_CHAIN)
24+
e2:SetRange(LOCATION_MZONE)
25+
e2:SetCountLimit(1,{id,1})
26+
e2:SetCondition(function() return Duel.IsMainPhase() end)
27+
e2:SetTarget(s.rmsptg)
28+
e2:SetOperation(s.rmspop)
29+
e2:SetHintTiming(0,TIMING_MAIN_END|TIMINGS_CHECK_MONSTER)
30+
c:RegisterEffect(e2)
31+
end
32+
s.listed_series={SET_WITCHCRAFTER}
33+
s.listed_names={id}
34+
function s.selfsptg(e,tp,eg,ep,ev,re,r,rp,chk)
35+
local c=e:GetHandler()
36+
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
37+
and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end
38+
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,tp,0)
39+
end
40+
function s.selfspop(e,tp,eg,ep,ev,re,r,rp)
41+
local c=e:GetHandler()
42+
if c:IsRelateToEffect(e) then
43+
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
44+
end
45+
end
46+
function s.rmfilter(c,tp)
47+
return c:IsRace(RACE_SPELLCASTER) and c:IsAbleToRemove() and c:IsFaceup() and Duel.GetMZoneCount(tp,c)>0
48+
end
49+
function s.deckspfilter(c,e,tp)
50+
return c:IsSetCard(SET_WITCHCRAFTER) and not c:IsCode(id) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
51+
end
52+
function s.rmsptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
53+
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) and s.rmfilter(chkc,tp) end
54+
if chk==0 then return Duel.IsExistingTarget(s.rmfilter,tp,LOCATION_MZONE,0,1,nil,tp)
55+
and Duel.IsExistingMatchingCard(s.deckspfilter,tp,LOCATION_DECK,0,1,nil,e,tp) end
56+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
57+
local g=Duel.SelectTarget(tp,s.rmfilter,tp,LOCATION_MZONE,0,1,1,nil,tp)
58+
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,1,tp,0)
59+
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
60+
end
61+
function s.rmspop(e,tp,eg,ep,ev,re,r,rp)
62+
local tc=Duel.GetFirstTarget()
63+
if tc:IsRelateToEffect(e) and Duel.Remove(tc,POS_FACEUP,REASON_EFFECT)>0
64+
and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then
65+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
66+
local g=Duel.SelectMatchingCard(tp,s.deckspfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
67+
if #g>0 then
68+
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
69+
end
70+
end
71+
end

pre-release/c100450019.lua

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
--エンディミオン皇国
2+
--Endymion Empire
3+
--scripted by pyrQ
4+
local s,id=GetID()
5+
function s.initial_effect(c)
6+
--When this card is activated: Add 1 "Regulus, the Prince of Endymion" or 1 monster that mentions it from your Deck to your hand, then if your opponent controls a monster, you can Special Summon 1 Spellcaster monster from your hand
7+
local e1=Effect.CreateEffect(c)
8+
e1:SetDescription(aux.Stringid(id,0))
9+
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH+CATEGORY_SPECIAL_SUMMON)
10+
e1:SetType(EFFECT_TYPE_ACTIVATE)
11+
e1:SetCode(EVENT_FREE_CHAIN)
12+
e1:SetCountLimit(1,{id,0},EFFECT_COUNT_CODE_OATH)
13+
e1:SetTarget(s.target)
14+
e1:SetOperation(s.activate)
15+
c:RegisterEffect(e1)
16+
--If a card(s) you control would be destroyed by battle or card effect, you can destroy 1 "Regulus, the Prince of Endymion" in your hand or face-up Monster Zone instead
17+
local e2=Effect.CreateEffect(c)
18+
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
19+
e2:SetCode(EFFECT_DESTROY_REPLACE)
20+
e2:SetRange(LOCATION_SZONE)
21+
e2:SetCountLimit(1,{id,1})
22+
e2:SetTarget(s.desreptg)
23+
e2:SetOperation(s.desrepop)
24+
e2:SetValue(function(e,c) return s.repfilter(c,e:GetHandlerPlayer()) end)
25+
c:RegisterEffect(e2)
26+
end
27+
s.listed_names={CARD_REGULUS_THE_PRINCE_OF_ENDYMION}
28+
function s.thfilter(c)
29+
return (c:IsCode(CARD_REGULUS_THE_PRINCE_OF_ENDYMION) or (c:IsMonster() and c:ListsCode(CARD_REGULUS_THE_PRINCE_OF_ENDYMION)))
30+
and c:IsAbleToHand()
31+
end
32+
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
33+
if chk==0 then return Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil) end
34+
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
35+
Duel.SetPossibleOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
36+
end
37+
function s.spfilter(c,e,tp)
38+
return c:IsRace(RACE_SPELLCASTER) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
39+
end
40+
function s.activate(e,tp,eg,ep,ev,re,r,rp)
41+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
42+
local g=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_DECK,0,1,1,nil)
43+
if #g>0 and Duel.SendtoHand(g,nil,REASON_EFFECT)>0 then
44+
Duel.ConfirmCards(1-tp,g)
45+
Duel.ShuffleHand(tp)
46+
if Duel.GetFieldGroupCount(tp,0,LOCATION_MZONE)>0 and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
47+
and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_HAND,0,1,nil,e,tp)
48+
and Duel.SelectYesNo(tp,aux.Stringid(id,1)) then
49+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
50+
local sg=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_HAND,0,1,1,nil,e,tp)
51+
if #sg>0 then
52+
Duel.BreakEffect()
53+
Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP)
54+
end
55+
end
56+
end
57+
end
58+
function s.repfilter(c,tp)
59+
return c:IsControler(tp) and c:IsOnField() and c:IsReason(REASON_BATTLE|REASON_EFFECT)
60+
and not c:IsReason(REASON_REPLACE)
61+
end
62+
function s.desfilter(c,e)
63+
return c:IsCode(CARD_REGULUS_THE_PRINCE_OF_ENDYMION) and (c:IsLocation(LOCATION_HAND) or c:IsFaceup())
64+
and c:IsDestructable(e) and not c:IsStatus(STATUS_DESTROY_CONFIRMED|STATUS_BATTLE_DESTROYED)
65+
end
66+
function s.desreptg(e,tp,eg,ep,ev,re,r,rp,chk)
67+
if chk==0 then return eg:IsExists(s.repfilter,1,nil,tp)
68+
and Duel.IsExistingMatchingCard(s.desfilter,tp,LOCATION_HAND|LOCATION_MZONE,0,1,nil,e) end
69+
if Duel.SelectEffectYesNo(tp,e:GetHandler(),96) then
70+
Duel.Hint(HINT_CARD,0,id)
71+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESREPLACE)
72+
local sc=Duel.SelectMatchingCard(tp,s.desfilter,tp,LOCATION_HAND|LOCATION_MZONE,0,1,1,nil,e):GetFirst()
73+
e:SetLabelObject(sc)
74+
sc:SetStatus(STATUS_DESTROY_CONFIRMED,true)
75+
if sc:IsLocation(LOCATION_HAND) then
76+
Duel.ConfirmCards(1-tp,sc)
77+
else
78+
Duel.HintSelection(sc)
79+
end
80+
return true
81+
else
82+
return false
83+
end
84+
end
85+
function s.desrepop(e,tp,eg,ep,ev,re,r,rp)
86+
local sc=e:GetLabelObject()
87+
sc:SetStatus(STATUS_DESTROY_CONFIRMED,false)
88+
Duel.Destroy(sc,REASON_EFFECT|REASON_REPLACE)
89+
end

pre-release/c100450020.lua

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
--レグルスの矢
2+
--Regulus' Arrow
3+
--scripted by pyrQ
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,0})
12+
e1:SetCondition(function(e,tp) return Duel.IsExistingMatchingCard(aux.FaceupFilter(Card.IsCode,CARD_REGULUS_THE_PRINCE_OF_ENDYMION),tp,LOCATION_ONFIELD,0,1,nil) end)
13+
e1:SetTarget(s.efftg)
14+
e1:SetOperation(s.effop)
15+
e1:SetHintTiming(0,TIMING_MAIN_END|TIMING_BATTLE_END|TIMINGS_CHECK_MONSTER_E)
16+
c:RegisterEffect(e1)
17+
--Special Summon 1 "Regulus, the Prince of Endymion" or 1 monster that mentions it from your GY
18+
local e2=Effect.CreateEffect(c)
19+
e2:SetDescription(aux.Stringid(id,1))
20+
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
21+
e2:SetType(EFFECT_TYPE_IGNITION)
22+
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
23+
e2:SetRange(LOCATION_GRAVE)
24+
e2:SetCountLimit(1,{id,1})
25+
e2:SetCost(Cost.SelfBanish)
26+
e2:SetTarget(s.sptg)
27+
e2:SetOperation(s.spop)
28+
c:RegisterEffect(e2)
29+
end
30+
s.listed_names={CARD_REGULUS_THE_PRINCE_OF_ENDYMION}
31+
function s.desfilter(c)
32+
return c:GetBattledGroupCount()>0
33+
end
34+
function s.efftg(e,tp,eg,ep,ev,re,r,rp,chk)
35+
local b1=Duel.IsExistingMatchingCard(s.desfilter,tp,0,LOCATION_MZONE,1,nil)
36+
local event_chaining,_,_,event_value,reason_effect=Duel.CheckEvent(EVENT_CHAINING,true)
37+
local reason_card=reason_effect and reason_effect:GetHandler() or nil
38+
local b2=event_chaining and reason_effect:IsHasType(EFFECT_TYPE_ACTIVATE)
39+
and (reason_card:IsNormalSpell() or reason_card:IsQuickPlaySpell())
40+
and Duel.IsChainDisablable(ev)
41+
if chk==0 then return b1 or b2 end
42+
local op=Duel.SelectEffect(tp,
43+
{b1,aux.Stringid(id,2)},
44+
{b2,aux.Stringid(id,3)})
45+
e:SetLabel(op,event_value or 0)
46+
if op==1 then
47+
e:SetCategory(CATEGORY_DESTROY)
48+
Duel.SetOperationInfo(0,CATEGORY_DESTROY,nil,1,1-tp,LOCATION_MZONE)
49+
elseif op==2 then
50+
e:SetCategory(CATEGORY_DISABLE)
51+
Duel.SetOperationInfo(0,CATEGORY_DISABLE,eg,1,tp,0)
52+
end
53+
end
54+
function s.effop(e,tp,eg,ep,ev,re,r,rp)
55+
local op,event_value=e:GetLabel()
56+
if op==1 then
57+
--Destroy 1 monster your opponent controls that battled this turn
58+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
59+
local g=Duel.SelectMatchingCard(tp,s.desfilter,tp,0,LOCATION_MZONE,1,1,nil)
60+
if #g>0 then
61+
Duel.HintSelection(g)
62+
Duel.Destroy(g,REASON_EFFECT)
63+
end
64+
elseif op==2 then
65+
--When a Normal or Quick-Play Spell Card is activated: Negate that effect
66+
Duel.NegateEffect(event_value)
67+
end
68+
end
69+
function s.spfilter(c,e,tp)
70+
return (c:IsCode(CARD_REGULUS_THE_PRINCE_OF_ENDYMION) or c:ListsCode(CARD_REGULUS_THE_PRINCE_OF_ENDYMION))
71+
and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
72+
end
73+
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
74+
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_GRAVE) and s.spfilter(chkc,e,tp) end
75+
if chk==0 then return Duel.IsExistingTarget(s.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
76+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
77+
local g=Duel.SelectTarget(tp,s.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
78+
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,tp,0)
79+
end
80+
function s.spop(e,tp,eg,ep,ev,re,r,rp)
81+
local tc=Duel.GetFirstTarget()
82+
if tc:IsRelateToEffect(e) then
83+
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
84+
end
85+
end

0 commit comments

Comments
 (0)