Skip to content

Commit c38d866

Browse files
authored
Added new card script
1 parent 2ef856f commit c38d866

File tree

1 file changed

+106
-0
lines changed

1 file changed

+106
-0
lines changed

pre-release/c101304024.lua

Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
--調和ノ天救竜
2+
--Fidraulis Harmonia
3+
--scripted by pyrQ
4+
local s,id=GetID()
5+
function s.initial_effect(c)
6+
--When your opponent activates a monster effect on the field (Quick Effect): You can reveal this card in your hand and up to 5 Synchro Monsters in your Extra Deck; apply these effects in sequence based on the total number revealed, also you cannot activate the effects of monsters Special Summoned from the Extra Deck until the end of your next turn, except Synchro Monsters
7+
local e1=Effect.CreateEffect(c)
8+
e1:SetDescription(aux.Stringid(id,0))
9+
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOGRAVE+CATEGORY_DESTROY)
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.effcon)
15+
e1:SetCost(s.effcost)
16+
e1:SetTarget(s.efftg)
17+
e1:SetOperation(s.effop)
18+
c:RegisterEffect(e1)
19+
end
20+
function s.effcon(e,tp,eg,ep,ev,re,r,rp)
21+
return rp==1-tp and re:IsMonsterEffect() and Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_LOCATION)==LOCATION_MZONE
22+
end
23+
function s.revealfilter(c)
24+
return c:IsSynchroMonster() and not c:IsPublic()
25+
end
26+
function s.rescon(sg,e,tp,mg)
27+
local b1=#sg==1
28+
local b2=#sg==3 and sg:IsExists(Card.IsAbleToGrave,1,nil)
29+
local b3=#sg==5 and sg:IsExists(Card.IsAbleToGrave,1,nil) and Duel.GetFieldGroupCount(tp,0,LOCATION_MZONE)>0
30+
return b1 or b2 or b3
31+
end
32+
function s.effcost(e,tp,eg,ep,ev,re,r,rp,chk)
33+
local c=e:GetHandler()
34+
local g=Duel.GetMatchingGroup(s.revealfilter,tp,LOCATION_EXTRA,0,nil)
35+
if chk==0 then return not c:IsPublic() and #g>0 end
36+
local max_reveal_count=math.min(#g,5)
37+
local sg=aux.SelectUnselectGroup(g,e,tp,1,max_reveal_count,s.rescon,1,tp,HINTMSG_CONFIRM,s.rescon)
38+
Duel.ConfirmCards(1-tp,c)
39+
Duel.ConfirmCards(1-tp,sg)
40+
Duel.ShuffleExtra(tp)
41+
e:SetLabel(#sg+1)
42+
e:SetLabelObject(sg)
43+
for sc in sg:Iter() do
44+
sc:CreateEffectRelation(e)
45+
end
46+
end
47+
function s.efftg(e,tp,eg,ep,ev,re,r,rp,chk)
48+
local c=e:GetHandler()
49+
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
50+
and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end
51+
local reveal_count=e:GetLabel()
52+
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,tp,0)
53+
if reveal_count>=4 then
54+
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_EXTRA)
55+
end
56+
if reveal_count==6 then
57+
Duel.SetOperationInfo(0,CATEGORY_DESTROY,Duel.GetFieldGroup(tp,0,LOCATION_MZONE),1,tp,0)
58+
end
59+
end
60+
function s.effop(e,tp,eg,ep,ev,re,r,rp)
61+
local c=e:GetHandler()
62+
local break_chk=false
63+
local reveal_count=e:GetLabel()
64+
if reveal_count>=2 and c:IsRelateToEffect(e) then
65+
--● 2+: Special Summon this card
66+
break_chk=true
67+
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
68+
end
69+
if reveal_count>=4 then
70+
--● 4+: Send 1 of the revealed Synchro Monsters to the GY
71+
local revealed_synchros=e:GetLabelObject():Match(Card.IsRelateToEffect,nil,e)
72+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
73+
local g=revealed_synchros:FilterSelect(tp,Card.IsAbleToGrave,1,1,nil)
74+
if #g>0 then
75+
if break_chk then Duel.BreakEffect() end
76+
break_chk=true
77+
Duel.SendtoGrave(g,REASON_EFFECT)
78+
end
79+
end
80+
if reveal_count==6 then
81+
--● 6: Destroy 1 monster your opponent controls
82+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
83+
local g=Duel.SelectMatchingCard(tp,nil,tp,0,LOCATION_MZONE,1,1,nil)
84+
if #g>0 then
85+
Duel.HintSelection(g)
86+
if break_chk then Duel.BreakEffect() end
87+
Duel.Destroy(g,REASON_EFFECT)
88+
end
89+
end
90+
local reset_count=Duel.IsTurnPlayer(tp) and 2 or 1
91+
--You cannot activate the effects of monsters Special Summoned from the Extra Deck until the end of your next turn, except Synchro Monsters
92+
local e1=Effect.CreateEffect(c)
93+
e1:SetDescription(aux.Stringid(id,1))
94+
e1:SetType(EFFECT_TYPE_FIELD)
95+
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CLIENT_HINT)
96+
e1:SetCode(EFFECT_CANNOT_ACTIVATE)
97+
e1:SetTargetRange(1,0)
98+
e1:SetValue(s.aclimit)
99+
e1:SetReset(RESET_PHASE|PHASE_END|RESET_SELF_TURN,reset_count)
100+
Duel.RegisterEffect(e1,tp)
101+
end
102+
function s.aclimit(e,re,tp)
103+
local rc=re:GetHandler()
104+
return re:IsMonsterEffect() and rc:IsOnField() and rc:IsSummonLocation(LOCATION_EXTRA)
105+
and not rc:IsSynchroMonster()
106+
end

0 commit comments

Comments
 (0)