Skip to content

Commit 155936c

Browse files
authored
Added new card script
1 parent f6868ca commit 155936c

File tree

1 file changed

+82
-0
lines changed

1 file changed

+82
-0
lines changed

pre-release/c101301020.lua

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
--結瘴龍ティスティナ
2+
--Miasma Dragon Tistina
3+
--Scripted by Hatter
4+
local s,id=GetID()
5+
function s.initial_effect(c)
6+
--Add 1 "Tistina" monster from your Deck to your hand, except "Miasma Dragon Tistina"
7+
local e1=Effect.CreateEffect(c)
8+
e1:SetDescription(aux.Stringid(id,0))
9+
e1:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND)
10+
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
11+
e1:SetProperty(EFFECT_FLAG_DELAY)
12+
e1:SetCode(EVENT_SUMMON_SUCCESS)
13+
e1:SetCountLimit(1,id)
14+
e1:SetTarget(s.thtg)
15+
e1:SetOperation(s.thop)
16+
c:RegisterEffect(e1)
17+
local e2=e1:Clone()
18+
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
19+
c:RegisterEffect(e2)
20+
--Special Summon this card
21+
local e3=Effect.CreateEffect(c)
22+
e3:SetDescription(aux.Stringid(id,1))
23+
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
24+
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
25+
e3:SetProperty(EFFECT_FLAG_DELAY)
26+
e3:SetCode(EVENT_TO_GRAVE)
27+
e3:SetCountLimit(1,{id,1})
28+
e3:SetTarget(s.sptg)
29+
e3:SetOperation(s.spop)
30+
c:RegisterEffect(e3)
31+
end
32+
s.listed_names={id}
33+
s.listed_series={SET_TISTINA}
34+
function s.thfilter(c)
35+
return c:IsSetCard(SET_TISTINA) and c:IsMonster() and not c:IsCode(id) and c:IsAbleToHand()
36+
end
37+
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
38+
if chk==0 then return Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil) end
39+
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
40+
end
41+
function s.thop(e,tp,eg,ep,ev,re,r,rp)
42+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
43+
local g=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_DECK,0,1,1,nil)
44+
if #g>0 then
45+
Duel.SendtoHand(g,nil,REASON_EFFECT)
46+
Duel.ConfirmCards(1-tp,g)
47+
end
48+
local c=e:GetHandler()
49+
--For the rest of this turn, LIGHT "Tistina" monsters you control gain 1000 ATK
50+
local e1=Effect.CreateEffect(c)
51+
e1:SetType(EFFECT_TYPE_FIELD)
52+
e1:SetCode(EFFECT_UPDATE_ATTACK)
53+
e1:SetTargetRange(LOCATION_MZONE,0)
54+
e1:SetTarget(function(e,c) return c:IsAttribute(ATTRIBUTE_LIGHT) and c:IsSetCard(SET_TISTINA) end)
55+
e1:SetValue(1000)
56+
e1:SetReset(RESET_PHASE|PHASE_END)
57+
Duel.RegisterEffect(e1,tp)
58+
aux.RegisterClientHint(c,0,tp,1,0,aux.Stringid(id,2))
59+
end
60+
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
61+
local c=e:GetHandler()
62+
if chk==0 then return Duel.GetFieldGroupCount(0,LOCATION_FZONE,LOCATION_FZONE)>0
63+
and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
64+
and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end
65+
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,tp,0)
66+
end
67+
function s.spop(e,tp,eg,ep,ev,re,r,rp)
68+
local c=e:GetHandler()
69+
if c:IsRelateToEffect(e) then
70+
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
71+
end
72+
--You cannot Special Summon from the hand or GY for the rest of this turn, except "Tistina" monsters
73+
local e1=Effect.CreateEffect(c)
74+
e1:SetDescription(aux.Stringid(id,3))
75+
e1:SetType(EFFECT_TYPE_FIELD)
76+
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CLIENT_HINT)
77+
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
78+
e1:SetTargetRange(1,0)
79+
e1:SetTarget(function(e,c) return c:IsLocation(LOCATION_HAND|LOCATION_GRAVE) and not c:IsSetCard(SET_TISTINA) end)
80+
e1:SetReset(RESET_PHASE|PHASE_END)
81+
Duel.RegisterEffect(e1,tp)
82+
end

0 commit comments

Comments
 (0)