Skip to content

Commit 8cfa355

Browse files
authored
Added new card script
1 parent 3d98ae0 commit 8cfa355

File tree

1 file changed

+65
-0
lines changed

1 file changed

+65
-0
lines changed

pre-release/c100200266.lua

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
--心を凍らせるスノークリスタル
2+
--Soulicer Crystal
3+
--Scripted by The Razgriz
4+
local s,id=GetID()
5+
function s.initial_effect(c)
6+
--Cannot be destroyed by card effects
7+
local e1=Effect.CreateEffect(c)
8+
e1:SetType(EFFECT_TYPE_SINGLE)
9+
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
10+
e1:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
11+
e1:SetRange(LOCATION_MZONE)
12+
e1:SetValue(1)
13+
c:RegisterEffect(e1)
14+
--Special Summon this card from your hand
15+
local e2=Effect.CreateEffect(c)
16+
e2:SetDescription(aux.Stringid(id,0))
17+
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
18+
e2:SetType(EFFECT_TYPE_IGNITION)
19+
e2:SetRange(LOCATION_HAND)
20+
e2:SetCountLimit(1,id)
21+
e2:SetCondition(function(e,tp) return Duel.GetFieldGroupCount(tp,0,LOCATION_MZONE)>=Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)+2 end)
22+
e2:SetTarget(s.sptg)
23+
e2:SetOperation(s.spop)
24+
c:RegisterEffect(e2)
25+
--Negate the effects of 1 Effect Monster your opponent controls
26+
local e3=Effect.CreateEffect(c)
27+
e3:SetDescription(aux.Stringid(id,1))
28+
e3:SetCategory(CATEGORY_DISABLE)
29+
e3:SetType(EFFECT_TYPE_IGNITION)
30+
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
31+
e3:SetRange(LOCATION_MZONE)
32+
e3:SetCountLimit(1,{id,1})
33+
e3:SetTarget(s.distg)
34+
e3:SetOperation(s.disop)
35+
c:RegisterEffect(e3)
36+
end
37+
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
38+
local c=e:GetHandler()
39+
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
40+
and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end
41+
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,tp,0)
42+
end
43+
function s.spop(e,tp,eg,ep,ev,re,r,rp)
44+
local c=e:GetHandler()
45+
if c:IsRelateToEffect(e) then
46+
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
47+
end
48+
end
49+
function s.disfilter(c)
50+
return c:IsType(TYPE_EFFECT) and c:IsNegatableMonster()
51+
end
52+
function s.distg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
53+
if chkc then return chkc:IsControler(1-tp) and chkc:IsLocation(LOCATION_MZONE) and s.disfilter(chkc) end
54+
if chk==0 then return Duel.IsExistingTarget(s.disfilter,tp,0,LOCATION_MZONE,1,nil) end
55+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_NEGATE)
56+
local g=Duel.SelectTarget(tp,s.disfilter,tp,0,LOCATION_MZONE,1,1,nil)
57+
Duel.SetOperationInfo(0,CATEGORY_DISABLE,g,1,tp,0)
58+
end
59+
function s.disop(e,tp,eg,ep,ev,re,r,rp)
60+
local tc=Duel.GetFirstTarget()
61+
if tc:IsRelateToEffect(e) then
62+
--Negate its effects
63+
tc:NegateEffects(e:GetHandler())
64+
end
65+
end

0 commit comments

Comments
 (0)