Skip to content

Commit 1bcda68

Browse files
authored
Added new card scripts
1 parent 5fee57e commit 1bcda68

File tree

2 files changed

+169
-0
lines changed

2 files changed

+169
-0
lines changed

pre-release/c101303027.lua

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
--天雷ノ双風神 シーナ
2+
--Sheena the Twin Storm Deities of Divine Thunder
3+
--scripted by Naim
4+
local s,id=GetID()
5+
function s.initial_effect(c)
6+
--Special Summon this card from your hand, then apply this effect based on that card effect's type
7+
local e1=Effect.CreateEffect(c)
8+
e1:SetDescription(aux.Stringid(id,0))
9+
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOHAND)
10+
e1:SetType(EFFECT_TYPE_QUICK_O)
11+
e1:SetCode(EVENT_CHAINING)
12+
e1:SetRange(LOCATION_HAND)
13+
e1:SetCountLimit(1,id)
14+
e1:SetCondition(s.spcon)
15+
e1:SetTarget(s.sptg)
16+
e1:SetOperation(s.spop)
17+
c:RegisterEffect(e1)
18+
--The first time this card would be destroyed by battle each turn, it is not destroyed
19+
local e2=Effect.CreateEffect(c)
20+
e2:SetType(EFFECT_TYPE_SINGLE)
21+
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
22+
e2:SetCode(EFFECT_INDESTRUCTABLE_COUNT)
23+
e2:SetRange(LOCATION_MZONE)
24+
e2:SetCountLimit(1)
25+
e2:SetValue(function(e,re,r,rp) return (r&REASON_BATTLE)>0 end)
26+
c:RegisterEffect(e2)
27+
end
28+
s.listed_names={id}
29+
function s.spcon(e,tp,eg,ep,ev,re,r,rp)
30+
return rp==1-tp and Duel.IsExistingMatchingCard(aux.FaceupFilter(Card.IsAttribute,ATTRIBUTE_WIND),tp,LOCATION_MZONE,0,1,nil)
31+
end
32+
function s.rthfilter(c)
33+
return c:IsFaceup() and c:IsAbleToHand() and not c:IsCode(id)
34+
end
35+
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
36+
local c=e:GetHandler()
37+
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
38+
and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
39+
and ((re:IsMonsterEffect() and Duel.IsExistingMatchingCard(s.rthfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil))
40+
or (re:IsSpellTrapEffect() and Duel.IsExistingMatchingCard(aux.AND(Card.IsSpellTrap,Card.IsAbleToHand),tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil))) end
41+
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,tp,0)
42+
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,PLAYER_ALL,LOCATION_ONFIELD)
43+
end
44+
function s.spop(e,tp,eg,ep,ev,re,r,rp)
45+
local c=e:GetHandler()
46+
if c:IsRelateToEffect(e) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)>0 then
47+
local g=Group.CreateGroup()
48+
if re:IsMonsterEffect() then
49+
g=Duel.GetMatchingGroup(s.rthfilter,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
50+
elseif re:IsSpellTrapEffect(e) then
51+
g=Duel.GetMatchingGroup(aux.AND(Card.IsSpellTrap,Card.IsAbleToHand),tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
52+
end
53+
if #g>0 then
54+
Duel.BreakEffect()
55+
Duel.SendtoHand(g,nil,REASON_EFFECT)
56+
end
57+
end
58+
end

pre-release/c101303035.lua

Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
--神芸なる知恵の乙女
2+
--Artmage Non Finito
3+
--scripted by Naim
4+
local s,id=GetID()
5+
function s.initial_effect(c)
6+
c:EnableReviveLimit()
7+
--Fusion Materials: 2 "Artmage" monsters
8+
Fusion.AddProcMixN(c,true,true,aux.FilterBoolFunctionEx(Card.IsSetCard,SET_ARTMAGE),2)
9+
c:AddMustBeFusionSummoned()
10+
--You can only Fusion Summon or Special Summon by its alternate procedure "Artmage Nonfinite" once per turn
11+
local e0=Effect.CreateEffect(c)
12+
e0:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
13+
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
14+
e0:SetCode(EVENT_SPSUMMON_SUCCESS)
15+
e0:SetCondition(s.regcon)
16+
e0:SetOperation(s.regop)
17+
c:RegisterEffect(e0)
18+
--You can Special Summon this card by discarding 1 Spell/Trap and Tributing 1 Level 7 or higher "Artmage" monster in your hand or field
19+
local e1=Effect.CreateEffect(c)
20+
e1:SetDescription(aux.Stringid(id,0))
21+
e1:SetType(EFFECT_TYPE_FIELD)
22+
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
23+
e1:SetCode(EFFECT_SPSUMMON_PROC)
24+
e1:SetRange(LOCATION_EXTRA)
25+
e1:SetCondition(s.selfspcon)
26+
e1:SetTarget(s.selfsptg)
27+
e1:SetOperation(s.selfspop)
28+
e1:SetValue(1)
29+
c:RegisterEffect(e1)
30+
--Set 1 "Artmage" Spell/Trap from your Deck
31+
local e2=Effect.CreateEffect(c)
32+
e2:SetDescription(aux.Stringid(id,1))
33+
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
34+
e2:SetProperty(EFFECT_FLAG_DELAY)
35+
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
36+
e2:SetTarget(s.settg)
37+
e2:SetOperation(s.setop)
38+
c:RegisterEffect(e2)
39+
--Fusion Summon 1 Fusion Monster by using monsters you control
40+
local fusion_params={handler=c,matfilter=Fusion.OnFieldMat}
41+
local e3=Effect.CreateEffect(c)
42+
e3:SetDescription(aux.Stringid(id,2))
43+
e3:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_FUSION_SUMMON)
44+
e3:SetType(EFFECT_TYPE_QUICK_O)
45+
e3:SetCode(EVENT_FREE_CHAIN)
46+
e3:SetRange(LOCATION_MZONE)
47+
e3:SetCountLimit(1)
48+
e3:SetCondition(function(e,tp) return Duel.IsTurnPlayer(1-tp) end)
49+
e3:SetTarget(Fusion.SummonEffTG(fusion_params))
50+
e3:SetOperation(Fusion.SummonEffOP(fusion_params))
51+
e3:SetHintTiming(0,TIMING_STANDBY_PHASE|TIMING_MAIN_END|TIMINGS_CHECK_MONSTER_E)
52+
c:RegisterEffect(e3)
53+
end
54+
s.listed_series={SET_ARTMAGE}
55+
s.listed_names={id}
56+
function s.regcon(e)
57+
local c=e:GetHandler()
58+
return c:IsFusionSummoned() or c:IsSummonType(SUMMON_TYPE_SPECIAL+1)
59+
end
60+
function s.regop(e,tp,eg,ep,ev,re,r,rp)
61+
--Prevent another Fusion Summon or Special Summon by its alternate procedure of "Artmage Nonfinite" that turn
62+
local e1=Effect.CreateEffect(e:GetHandler())
63+
e1:SetType(EFFECT_TYPE_FIELD)
64+
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
65+
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
66+
e1:SetTargetRange(1,0)
67+
e1:SetTarget(function(e,c,sump,sumtype)
68+
return c:IsCode(id) and (sumtype&SUMMON_TYPE_FUSION==SUMMON_TYPE_FUSION or sumtype&SUMMON_TYPE_SPECIAL+1==SUMMON_TYPE_SPECIAL+1)
69+
end)
70+
e1:SetReset(RESET_PHASE|PHASE_END)
71+
Duel.RegisterEffect(e1,tp)
72+
end
73+
function s.selfspcostfilter(c,tp,fc)
74+
return c:IsLevelAbove(7) and c:IsSetCard(SET_ARTMAGE) and Duel.GetLocationCountFromEx(tp,tp,c,fc)>0
75+
end
76+
function s.selfspcon(e,c)
77+
if not c then return true end
78+
if c:IsFaceup() then return false end
79+
local tp=c:GetControler()
80+
return Duel.IsExistingMatchingCard(aux.AND(Card.IsSpellTrap,Card.IsDiscardable),tp,LOCATION_HAND,0,1,nil)
81+
and Duel.CheckReleaseGroup(tp,s.selfspcostfilter,1,true,1,true,c,tp,nil,nil,nil,tp,c)
82+
end
83+
function s.selfsptg(e,tp,eg,ep,ev,re,r,rp,chk,c)
84+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISCARD)
85+
local dg=Duel.SelectMatchingCard(tp,aux.AND(Card.IsSpellTrap,Card.IsDiscardable),tp,LOCATION_HAND,0,1,1,true,nil)
86+
if not dg then return false end
87+
local rg=Duel.SelectReleaseGroup(tp,s.selfspcostfilter,1,1,true,true,true,c,tp,nil,false,nil,tp,c)
88+
if not rg then return false end
89+
e:SetLabelObject(dg+rg)
90+
return true
91+
end
92+
function s.selfspop(e,tp,eg,ep,ev,re,r,rp,c)
93+
local g=e:GetLabelObject()
94+
if not g or #g~=2 then return end
95+
local dg,rg=g:Split(Card.IsSpellTrap,nil)
96+
Duel.SendtoGrave(dg,REASON_COST|REASON_MATERIAL|REASON_DISCARD)
97+
Duel.Release(rg,REASON_COST|REASON_MATERIAL)
98+
end
99+
function s.setfilter(c)
100+
return c:IsSetCard(SET_ARTMAGE) and c:IsSpellTrap() and c:IsSSetable()
101+
end
102+
function s.settg(e,tp,eg,ep,ev,re,r,rp,chk)
103+
if chk==0 then return Duel.IsExistingMatchingCard(s.setfilter,tp,LOCATION_DECK,0,1,nil) end
104+
end
105+
function s.setop(e,tp,eg,ep,ev,re,r,rp)
106+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
107+
local g=Duel.SelectMatchingCard(tp,s.setfilter,tp,LOCATION_DECK,0,1,1,nil)
108+
if #g>0 then
109+
Duel.SSet(tp,g)
110+
end
111+
end

0 commit comments

Comments
 (0)