Skip to content

Commit 1f10326

Browse files
authored
Added new card script
1 parent d94cfa3 commit 1f10326

File tree

1 file changed

+83
-0
lines changed

1 file changed

+83
-0
lines changed

pre-release/c100200279.lua

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
--トレジャー・パンサー
2+
--Treasure Panther
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)
13+
e1:SetCondition(function() return Duel.IsExistingMatchingCard(Card.IsFacedown,0,LOCATION_MZONE,LOCATION_MZONE,1,nil) end)
14+
e1:SetTarget(s.sptg)
15+
e1:SetOperation(s.spop)
16+
c:RegisterEffect(e1)
17+
--Change up to 3 Set monsters on the field to Attack Position, then if you changed 3 monsters to Attack Position, inflict 900 damage to your opponent
18+
local e2=Effect.CreateEffect(c)
19+
e2:SetDescription(aux.Stringid(id,1))
20+
e2:SetCategory(CATEGORY_POSITION+CATEGORY_DAMAGE)
21+
e2:SetType(EFFECT_TYPE_IGNITION)
22+
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
23+
e2:SetRange(LOCATION_MZONE)
24+
e2:SetCountLimit(1,{id,1})
25+
e2:SetTarget(s.postg)
26+
e2:SetOperation(s.posop)
27+
c:RegisterEffect(e2)
28+
--Send 1 Normal Monster from your Deck to the GY
29+
local e3=Effect.CreateEffect(c)
30+
e3:SetDescription(aux.Stringid(id,2))
31+
e3:SetCategory(CATEGORY_TOGRAVE)
32+
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
33+
e3:SetProperty(EFFECT_FLAG_DELAY)
34+
e3:SetCode(EVENT_FLIP)
35+
e3:SetCountLimit(1,{id,2})
36+
e3:SetTarget(s.tgtg)
37+
e3:SetOperation(s.tgop)
38+
c:RegisterEffect(e3)
39+
end
40+
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
41+
local c=e:GetHandler()
42+
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
43+
and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end
44+
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,tp,0)
45+
end
46+
function s.spop(e,tp,eg,ep,ev,re,r,rp)
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.posfilter(c)
53+
return c:IsPosition(POS_FACEDOWN_DEFENSE) and c:IsCanChangePosition()
54+
end
55+
function s.postg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
56+
if chkc then return chkc:IsLocation(LOCATION_MZONE) and s.posfilter(chkc) end
57+
if chk==0 then return Duel.IsExistingTarget(s.posfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
58+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_POSCHANGE)
59+
local g=Duel.SelectTarget(tp,s.posfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,3,nil)
60+
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,#g,tp,0)
61+
Duel.SetPossibleOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,900)
62+
end
63+
function s.posop(e,tp,eg,ep,ev,re,r,rp)
64+
local tg=Duel.GetTargetCards(e)
65+
if #tg>0 and Duel.ChangePosition(tg,POS_FACEUP_ATTACK)==3 then
66+
Duel.BreakEffect()
67+
Duel.Damage(1-tp,900,REASON_EFFECT)
68+
end
69+
end
70+
function s.tgfilter(c)
71+
return c:IsType(TYPE_NORMAL) and c:IsAbleToGrave()
72+
end
73+
function s.tgtg(e,tp,eg,ep,ev,re,r,rp,chk)
74+
if chk==0 then return Duel.IsExistingMatchingCard(s.tgfilter,tp,LOCATION_DECK,0,1,nil) end
75+
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK)
76+
end
77+
function s.tgop(e,tp,eg,ep,ev,re,r,rp)
78+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
79+
local g=Duel.SelectMatchingCard(tp,s.tgfilter,tp,LOCATION_DECK,0,1,1,nil)
80+
if #g>0 then
81+
Duel.SendtoGrave(g,REASON_EFFECT)
82+
end
83+
end

0 commit comments

Comments
 (0)