Skip to content

Commit 616cff6

Browse files
authored
Added new card scripts
1 parent c046011 commit 616cff6

File tree

2 files changed

+124
-0
lines changed

2 files changed

+124
-0
lines changed

pre-release/c101304070.lua

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
--2つに1つ
2+
--One of Two
3+
--scripted by pyrQ
4+
local s,id=GetID()
5+
function s.initial_effect(c)
6+
--Reveal 1 monster and 2 Traps from your Deck, your opponent randomly picks 1, you look at the rest and banish 1 Trap, then your opponent chooses 1 of these effects for you to apply
7+
local e1=Effect.CreateEffect(c)
8+
e1:SetDescription(aux.Stringid(id,0))
9+
e1:SetCategory(CATEGORY_REMOVE+CATEGORY_TOHAND+CATEGORY_SEARCH+CATEGORY_SPECIAL_SUMMON)
10+
e1:SetType(EFFECT_TYPE_ACTIVATE)
11+
e1:SetCode(EVENT_FREE_CHAIN)
12+
e1:SetTarget(s.target)
13+
e1:SetOperation(s.activate)
14+
c:RegisterEffect(e1)
15+
end
16+
function s.rescon(sg,e,tp,mg)
17+
return sg:IsExists(Card.IsMonster,1,nil) and sg:IsExists(Card.IsTrap,2,nil)
18+
end
19+
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
20+
local g=Duel.GetMatchingGroup(aux.OR(Card.IsMonster,Card.IsTrap),tp,LOCATION_DECK,0,nil)
21+
if chk==0 then return #g>=3 and Duel.IsPlayerCanRemove(tp) and aux.SelectUnselectGroup(g,e,tp,3,3,s.rescon,0) end
22+
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,tp,LOCATION_DECK)
23+
Duel.SetPossibleOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
24+
Duel.SetPossibleOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
25+
end
26+
function s.activate(e,tp,eg,ep,ev,re,r,rp)
27+
if not Duel.IsPlayerCanRemove(tp) then return end
28+
local g=Duel.GetMatchingGroup(aux.OR(Card.IsMonster,Card.IsTrap),tp,LOCATION_DECK,0,nil)
29+
if #g<3 then return end
30+
local sg=aux.SelectUnselectGroup(g,e,tp,3,3,s.rescon,1,tp,HINTMSG_CONFIRM)
31+
if #sg==0 then return end
32+
local opp=1-tp
33+
Duel.ConfirmCards(opp,sg)
34+
local picked_card=sg:RandomSelect(opp,1):GetFirst()
35+
sg:RemoveCard(picked_card)
36+
Duel.ConfirmCards(tp,sg)
37+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
38+
local banished_card=sg:FilterSelect(tp,aux.AND(Card.IsTrap,Card.IsAbleToRemove),1,1,nil)
39+
if #banished_card==0 or Duel.Remove(banished_card,POS_FACEUP,REASON_EFFECT)==0 then return end
40+
sg:RemoveCard(banished_card)
41+
local op=Duel.SelectEffect(opp,
42+
{true,aux.Stringid(id,1)},
43+
{true,aux.Stringid(id,2)})
44+
Duel.BreakEffect()
45+
if op==1 then
46+
--● Show the picked card, and if it is a monster, either add it to your hand or Special Summon it. Otherwise, banish it. Shuffle the remaining card into the Deck
47+
Duel.ConfirmCards(opp,picked_card)
48+
if picked_card:IsMonster() then
49+
aux.ToHandOrElse(picked_card,tp,
50+
function()
51+
return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and picked_card:IsCanBeSpecialSummoned(e,0,tp,false,false)
52+
end,
53+
function()
54+
Duel.SpecialSummon(picked_card,0,tp,tp,false,false,POS_FACEUP)
55+
end,
56+
aux.Stringid(id,3)
57+
)
58+
else
59+
Duel.Remove(picked_card,POS_FACEUP,REASON_EFFECT)
60+
end
61+
elseif op==2 then
62+
--● Show the card that was not picked nor banished, and if it is a monster, add it to your hand. Otherwise, banish it. Shuffle the remaining card into the Deck
63+
local other_card=sg:GetFirst()
64+
Duel.ConfirmCards(opp,other_card)
65+
if other_card:IsMonster() then
66+
Duel.SendtoHand(other_card,nil,REASON_EFFECT)
67+
else
68+
Duel.Remove(other_card,POS_FACEUP,REASON_EFFECT)
69+
end
70+
end
71+
Duel.ShuffleDeck(tp)
72+
end

pre-release/c101304078.lua

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
--サモンショック
2+
--Summon Shock
3+
local s,id=GetID()
4+
local COUNTER_SUMMON=0x148
5+
function s.initial_effect(c)
6+
c:EnableCounterPermit(COUNTER_SUMMON)
7+
c:SetCounterLimit(COUNTER_SUMMON,4)
8+
--Activate
9+
local e0=Effect.CreateEffect(c)
10+
e0:SetType(EFFECT_TYPE_ACTIVATE)
11+
e0:SetCode(EVENT_FREE_CHAIN)
12+
e0:SetHintTiming(0,TIMING_STANDBY_PHASE)
13+
c:RegisterEffect(e0)
14+
--Each time a monster(s) is Normal or Special Summoned, place 1 Summon Counter on this card (max. 4)
15+
local e1a=Effect.CreateEffect(c)
16+
e1a:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
17+
e1a:SetCode(EVENT_SUMMON_SUCCESS)
18+
e1a:SetRange(LOCATION_SZONE)
19+
e1a:SetOperation(s.counterop)
20+
c:RegisterEffect(e1a)
21+
local e1b=e1a:Clone()
22+
e1b:SetCode(EVENT_SPSUMMON_SUCCESS)
23+
c:RegisterEffect(e1b)
24+
--If the 4th Summon Counter is placed on this card: Remove all Summon Counters from this card, and if you do, send all monsters on the field to the GY
25+
local e2=Effect.CreateEffect(c)
26+
e2:SetDescription(aux.Stringid(id,0))
27+
e2:SetCategory(CATEGORY_TOGRAVE)
28+
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
29+
e2:SetCode(EVENT_CUSTOM+id)
30+
e2:SetTarget(s.tgtg)
31+
e2:SetOperation(s.tgop)
32+
c:RegisterEffect(e2)
33+
end
34+
s.counter_place_list={COUNTER_SUMMON}
35+
function s.counterop(e,tp,eg,ep,ev,re,r,rp)
36+
local c=e:GetHandler()
37+
if c:AddCounter(COUNTER_SUMMON,1) and c:GetCounter(COUNTER_SUMMON)==4 then
38+
Duel.RaiseSingleEvent(c,EVENT_CUSTOM+id,re,0,0,tp,0)
39+
end
40+
end
41+
function s.tgtg(e,tp,eg,ep,ev,re,r,rp,chk)
42+
if chk==0 then return true end
43+
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,PLAYER_ALL,LOCATION_MZONE)
44+
end
45+
function s.tgop(e,tp,eg,ep,ev,re,r,rp)
46+
local c=e:GetHandler()
47+
local g=Duel.GetFieldGroup(tp,LOCATION_MZONE,LOCATION_MZONE)
48+
if c:IsRelateToEffect(e) and c:RemoveCounter(tp,COUNTER_SUMMON,c:GetCounter(COUNTER_SUMMON),REASON_EFFECT)
49+
and c:GetCounter(COUNTER_SUMMON)==0 and #g>0 then
50+
Duel.SendtoGrave(g,REASON_EFFECT)
51+
end
52+
end

0 commit comments

Comments
 (0)