Skip to content

Commit f24293b

Browse files
authored
Added new card script
1 parent 040df03 commit f24293b

File tree

1 file changed

+91
-0
lines changed

1 file changed

+91
-0
lines changed

pre-release/c101304017.lua

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
--ミミグル・フラワー
2+
--Mimighoul Flower
3+
local s,id=GetID()
4+
function s.initial_effect(c)
5+
--FLIP: Apply these effects in sequence
6+
local e1=Effect.CreateEffect(c)
7+
e1:SetDescription(aux.Stringid(id,0))
8+
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH+CATEGORY_CONTROL)
9+
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_FLIP+EFFECT_TYPE_TRIGGER_F)
10+
e1:SetCountLimit(1,{id,0})
11+
e1:SetCondition(function() return Duel.IsMainPhase() end)
12+
e1:SetTarget(s.efftg)
13+
e1:SetOperation(s.effop)
14+
c:RegisterEffect(e1)
15+
--During your Main Phase: You can Special Summon this card from your hand to your opponent's field in face-down Defense Position, or if a face-down monster is on the field, you can Special Summon this card face-up on your field
16+
local e2=Effect.CreateEffect(c)
17+
e2:SetDescription(aux.Stringid(id,1))
18+
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
19+
e2:SetType(EFFECT_TYPE_IGNITION)
20+
e2:SetRange(LOCATION_HAND)
21+
e2:SetCountLimit(1,{id,1})
22+
e2:SetTarget(s.selfsptg)
23+
e2:SetOperation(s.selfspop)
24+
c:RegisterEffect(e2)
25+
end
26+
s.listed_series={SET_MIMIGHOUL}
27+
function s.efftg(e,tp,eg,ep,ev,re,r,rp,chk)
28+
if chk==0 then return true end
29+
local c=e:GetHandler()
30+
if c:IsAbleToChangeControler() then
31+
Duel.SetOperationInfo(0,CATEGORY_CONTROL,c,1,tp,0)
32+
end
33+
Duel.SetPossibleOperationInfo(0,CATEGORY_TOHAND,nil,1,1-tp,LOCATION_DECK)
34+
end
35+
function s.thfilter(c)
36+
return (c:IsType(TYPE_FLIP) or c:IsSetCard(SET_MIMIGHOUL)) and c:IsAbleToHand()
37+
end
38+
function s.effop(e,tp,eg,ep,ev,re,r,rp,chk)
39+
local break_chk=false
40+
--Your opponent can add 1 Flip monster or "Mimighoul" card from their Deck to their hand
41+
local opp=1-tp
42+
if Duel.IsExistingMatchingCard(s.thfilter,opp,LOCATION_DECK,0,1,nil)
43+
and Duel.SelectYesNo(opp,aux.Stringid(id,2)) then
44+
Duel.Hint(HINT_SELECTMSG,opp,HINTMSG_ATOHAND)
45+
local g=Duel.SelectMatchingCard(opp,s.thfilter,opp,LOCATION_DECK,0,1,1,nil)
46+
if #g>0 then
47+
break_chk=true
48+
Duel.SendtoHand(g,nil,REASON_EFFECT)
49+
Duel.ConfirmCards(tp,g)
50+
Duel.ShuffleHand(opp)
51+
end
52+
end
53+
--Give control of this card to your opponent
54+
local c=e:GetHandler()
55+
if c:IsRelateToEffect(e) then
56+
if break_chk then Duel.BreakEffect() end
57+
Duel.GetControl(c,opp)
58+
end
59+
end
60+
function s.selfsptg(e,tp,eg,ep,ev,re,r,rp,chk)
61+
local c=e:GetHandler()
62+
if chk==0 then return (Duel.GetLocationCount(1-tp,LOCATION_MZONE,tp)>0
63+
and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEDOWN_DEFENSE,1-tp))
64+
or (Duel.IsExistingMatchingCard(Card.IsFacedown,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil)
65+
and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
66+
and c:IsCanBeSpecialSummoned(e,0,tp,false,false)) end
67+
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,tp,0)
68+
end
69+
function s.selfspop(e,tp,eg,ep,ev,re,r,rp)
70+
local c=e:GetHandler()
71+
if not c:IsRelateToEffect(e) then return end
72+
local b1=Duel.GetLocationCount(1-tp,LOCATION_MZONE,tp)>0
73+
and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEDOWN_DEFENSE,1-tp)
74+
local b2=Duel.IsExistingMatchingCard(Card.IsFacedown,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil)
75+
and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
76+
and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
77+
local op=nil
78+
if b1 and b2 then
79+
op=Duel.SelectEffect(tp,
80+
{b1,aux.Stringid(id,3)},
81+
{b2,aux.Stringid(id,4)})
82+
else
83+
op=(b1 and 1) or (b2 and 2) or 1
84+
end
85+
if op==1 then
86+
if Duel.SpecialSummon(c,0,tp,1-tp,false,false,POS_FACEDOWN_DEFENSE)==0 then return end
87+
Duel.ConfirmCards(tp,c)
88+
elseif op==2 then
89+
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
90+
end
91+
end

0 commit comments

Comments
 (0)