Skip to content

Commit 44db38d

Browse files
authored
Added new card scripts
1 parent ddf7c38 commit 44db38d

15 files changed

+1446
-0
lines changed

pre-release/c100443001.lua

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
--恋する乙女
2+
--Maiden in Love
3+
--scripted by Naim
4+
local s,id=GetID()
5+
local COUNTER_MAIDEN=0x1090
6+
function s.initial_effect(c)
7+
--Monsters your opponent controls that can attack must attack this card
8+
local e1=Effect.CreateEffect(c)
9+
e1:SetType(EFFECT_TYPE_FIELD)
10+
e1:SetCode(EFFECT_MUST_ATTACK)
11+
e1:SetTargetRange(0,LOCATION_MZONE)
12+
e1:SetRange(LOCATION_MZONE)
13+
c:RegisterEffect(e1)
14+
local e2=e1:Clone()
15+
e2:SetCode(EFFECT_MUST_ATTACK_MONSTER)
16+
e2:SetValue(function(e,c) return c==e:GetHandler() end)
17+
c:RegisterEffect(e2)
18+
--Cannot be destroyed by battle
19+
local e3=Effect.CreateEffect(c)
20+
e3:SetType(EFFECT_TYPE_SINGLE)
21+
e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
22+
e3:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
23+
e3:SetRange(LOCATION_MZONE)
24+
e3:SetValue(1)
25+
c:RegisterEffect(e3)
26+
--Activate 1 of these effects at the end of the Damage Step, if this card battled an opponent's monster
27+
local e4=Effect.CreateEffect(c)
28+
e4:SetDescription(aux.Stringid(id,0))
29+
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
30+
e4:SetCode(EVENT_DAMAGE_STEP_END)
31+
e4:SetCondition(s.effcon)
32+
e4:SetTarget(s.efftg)
33+
e4:SetOperation(s.effop)
34+
c:RegisterEffect(e4)
35+
end
36+
function s.effcon(e,tp,eg,ep,ev,re,r,rp)
37+
local c=e:GetHandler()
38+
return c:GetBattleTarget() and c:IsStatus(STATUS_OPPO_BATTLE)
39+
end
40+
function s.controlfilter(c)
41+
return c:HasCounter(COUNTER_MAIDEN) and c:IsControlerCanBeChanged()
42+
end
43+
function s.efftg(e,tp,eg,ep,ev,re,r,rp,chk)
44+
local b1=Duel.IsExistingMatchingCard(Card.IsCanAddCounter,tp,0,LOCATION_MZONE,1,nil,COUNTER_MAIDEN,1)
45+
local b2=Duel.IsExistingMatchingCard(s.controlfilter,tp,0,LOCATION_MZONE,1,nil)
46+
local c=e:GetHandler()
47+
if chk==0 then return c:IsLocation(LOCATION_MZONE) and c:IsRelateToBattle() and (b1 or b2) end
48+
local op=Duel.SelectEffect(tp,
49+
{b1,aux.Stringid(id,1)},
50+
{b2,aux.Stringid(id,2)})
51+
e:SetLabel(op)
52+
if op==1 then
53+
e:SetCategory(CATEGORY_COUNTER)
54+
Duel.SetOperationInfo(0,CATEGORY_COUNTER,nil,1,tp,COUNTER_MAIDEN)
55+
elseif op==2 then
56+
e:SetCategory(CATEGORY_CONTROL)
57+
local g=Duel.GetMatchingGroup(s.controlfilter,tp,0,LOCATION_MZONE,nil)
58+
Duel.SetOperationInfo(0,CATEGORY_CONTROL,g,1,tp,0)
59+
end
60+
end
61+
function s.effop(e,tp,eg,ep,ev,re,r,rp)
62+
local op=e:GetLabel()
63+
if op==1 then
64+
--Place 1 Maiden Counter on 1 face-up monster your opponent controls.
65+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_COUNTER)
66+
local sc=Duel.SelectMatchingCard(tp,Card.IsCanAddCounter,tp,0,LOCATION_MZONE,1,1,nil,COUNTER_MAIDEN,1):GetFirst()
67+
if sc then
68+
sc:AddCounter(COUNTER_MAIDEN,1)
69+
end
70+
elseif op==2 then
71+
--Take control of 1 opponent's monster with a Maiden Counter.
72+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONTROL)
73+
local sc=Duel.SelectMatchingCard(tp,s.controlfilter,tp,0,LOCATION_MZONE,1,1,nil):GetFirst()
74+
if sc then
75+
Duel.GetControl(sc,tp)
76+
end
77+
78+
end
79+
end

pre-release/c100443003.lua

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
--ユーカリ・モール
2+
--Eucalyptus Mole
3+
--scripted by pyrQ
4+
local s,id=GetID()
5+
function s.initial_effect(c)
6+
--Special Summon 1 Level 4 or lower Beast monster from your Deck in face-down Defense Position
7+
local e1=Effect.CreateEffect(c)
8+
e1:SetDescription(aux.Stringid(id,0))
9+
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_POSITION)
10+
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
11+
e1:SetProperty(EFFECT_FLAG_DELAY)
12+
e1:SetCode(EVENT_SUMMON_SUCCESS)
13+
e1:SetCountLimit(1,id)
14+
e1:SetTarget(s.fdsptg)
15+
e1:SetOperation(s.fdspop)
16+
c:RegisterEffect(e1)
17+
local e2=e1:Clone()
18+
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
19+
c:RegisterEffect(e2)
20+
--Special Summon 1 "Koala" monster from your Deck
21+
local e3=Effect.CreateEffect(c)
22+
e3:SetDescription(aux.Stringid(id,1))
23+
e3:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_ATKCHANGE)
24+
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
25+
e3:SetProperty(EFFECT_FLAG_DELAY)
26+
e3:SetCode(EVENT_DESTROYED)
27+
e3:SetCountLimit(1,{id,1})
28+
e3:SetTarget(s.koalasptg)
29+
e3:SetOperation(s.koalaspop)
30+
c:RegisterEffect(e3)
31+
end
32+
s.listed_series={SET_KOALA}
33+
function s.fdspfilter(c,e,tp)
34+
return c:IsLevelBelow(4) and c:IsRace(RACE_BEAST) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEDOWN_DEFENSE)
35+
end
36+
function s.fdsptg(e,tp,eg,ep,ev,re,r,rp,chk)
37+
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
38+
and Duel.IsExistingMatchingCard(s.fdspfilter,tp,LOCATION_DECK,0,1,nil,e,tp) end
39+
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
40+
Duel.SetPossibleOperationInfo(0,CATEGORY_POSITION,e:GetHandler(),1,tp,POS_FACEUP_DEFENSE)
41+
end
42+
function s.fdspop(e,tp,eg,ep,ev,re,r,rp)
43+
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
44+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
45+
local g=Duel.SelectMatchingCard(tp,s.fdspfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
46+
if #g>0 and Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEDOWN_DEFENSE)>0 then
47+
Duel.ConfirmCards(1-tp,g)
48+
local c=e:GetHandler()
49+
if c:IsRelateToEffect(e) and c:IsAttackPos() then
50+
Duel.BreakEffect()
51+
Duel.ChangePosition(c,POS_FACEUP_DEFENSE)
52+
end
53+
end
54+
end
55+
function s.koalaspfilter(c,e,tp)
56+
return c:IsSetCard(SET_KOALA) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
57+
end
58+
function s.koalasptg(e,tp,eg,ep,ev,re,r,rp,chk)
59+
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
60+
and Duel.IsExistingMatchingCard(s.koalaspfilter,tp,LOCATION_DECK,0,1,nil,e,tp) end
61+
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
62+
end
63+
function s.koalaspop(e,tp,eg,ep,ev,re,r,rp)
64+
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
65+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
66+
local g=Duel.SelectMatchingCard(tp,s.koalaspfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
67+
if #g>0 and Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)>0 then
68+
local c=e:GetHandler()
69+
aux.RegisterClientHint(c,0,tp,1,0,aux.Stringid(id,2))
70+
--Non-Effect Beast monsters you control gain ATK equal to their own original DEF
71+
local e1=Effect.CreateEffect(c)
72+
e1:SetType(EFFECT_TYPE_FIELD)
73+
e1:SetCode(EFFECT_UPDATE_ATTACK)
74+
e1:SetTargetRange(LOCATION_MZONE,0)
75+
e1:SetTarget(function(e,c) return c:IsNonEffectMonster() and c:IsRace(RACE_BEAST) end)
76+
e1:SetValue(function(e,c) return c:GetBaseDefense() end)
77+
e1:SetReset(RESET_PHASE|PHASE_END,2)
78+
Duel.RegisterEffect(e1,tp)
79+
end
80+
end

pre-release/c100443010.lua

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
--魂の結束-ソウル・ユニオン
2+
--Soul Union
3+
--scripted by pyrQ
4+
local s,id=GetID()
5+
function s.initial_effect(c)
6+
--Activate
7+
local e1=Effect.CreateEffect(c)
8+
e1:SetDescription(aux.Stringid(id,0))
9+
e1:SetCategory(CATEGORY_ATKCHANGE+CATEGORY_REMOVE+CATEGORY_SPECIAL_SUMMON+CATEGORY_FUSION_SUMMON)
10+
e1:SetType(EFFECT_TYPE_ACTIVATE)
11+
e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP)
12+
e1:SetCode(EVENT_FREE_CHAIN)
13+
e1:SetHintTiming(TIMING_DAMAGE_STEP,TIMING_DAMAGE_STEP|TIMING_STANDBY_PHASE|TIMING_MAIN_END|TIMINGS_CHECK_MONSTER_E)
14+
e1:SetCountLimit(1,id,EFFECT_COUNT_CODE_OATH)
15+
e1:SetCondition(aux.StatChangeDamageStepCondition)
16+
e1:SetTarget(s.target)
17+
e1:SetOperation(s.activate)
18+
c:RegisterEffect(e1)
19+
end
20+
s.listed_series={SET_ELEMENTAL_HERO}
21+
function s.atkfilter(c)
22+
return c:IsSetCard(SET_ELEMENTAL_HERO) and c:HasNonZeroAttack()
23+
end
24+
function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
25+
if chkc then return false end
26+
if chk==0 then return Duel.IsExistingTarget(Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil)
27+
and Duel.IsExistingTarget(s.atkfilter,tp,LOCATION_GRAVE,0,1,nil) end
28+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATKDEF)
29+
local tc=Duel.SelectTarget(tp,Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil):GetFirst()
30+
e:SetLabelObject(tc)
31+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
32+
Duel.SelectTarget(tp,s.atkfilter,tp,LOCATION_GRAVE,0,1,1,nil)
33+
Duel.SetPossibleOperationInfo(0,CATEGORY_REMOVE,nil,1,tp,LOCATION_GRAVE)
34+
Duel.SetPossibleOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
35+
Duel.SetPossibleOperationInfo(0,CATEGORY_FUSION_SUMMON,nil,1,tp,LOCATION_EXTRA)
36+
end
37+
function s.fusconfilter(c)
38+
return c:IsSetCard(SET_ELEMENTAL_HERO) and c:IsType(TYPE_NORMAL) and c:IsFaceup()
39+
end
40+
function s.activate(e,tp,eg,ep,ev,re,r,rp)
41+
local tg=Duel.GetTargetCards(e)
42+
if #tg~=2 then return end
43+
local fc=e:GetLabelObject()
44+
local gc=(tg-fc):GetFirst()
45+
if fc:IsFaceup() and not fc:IsImmuneToEffect(e) then
46+
--That monster on the field gains ATK equal to the ATK of that other monster in the GY until the end of this turn
47+
local e1=Effect.CreateEffect(e:GetHandler())
48+
e1:SetType(EFFECT_TYPE_SINGLE)
49+
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
50+
e1:SetCode(EFFECT_UPDATE_ATTACK)
51+
e1:SetValue(gc:GetAttack())
52+
e1:SetReset(RESETS_STANDARD_PHASE_END)
53+
fc:RegisterEffect(e1)
54+
if not Duel.IsExistingMatchingCard(s.fusconfilter,tp,LOCATION_MZONE|LOCATION_GRAVE,0,1,nil) then return end
55+
local params={fusfilter=aux.FilterBoolFunction(Card.IsSetCard,SET_ELEMENTAL_HERO),matfilter=function(c) return c:IsLocation(LOCATION_GRAVE) and c:IsAbleToRemove() end,extrafil=s.fextra,extraop=Fusion.BanishMaterial}
56+
if Fusion.SummonEffTG(params)(e,tp,eg,ep,ev,re,r,rp,0) and Duel.SelectYesNo(tp,aux.Stringid(id,1)) then
57+
Duel.BreakEffect()
58+
Fusion.SummonEffOP(params)(e,tp,eg,ep,ev,re,r,rp)
59+
end
60+
end
61+
end
62+
function s.fextra(e,tp,mg)
63+
if not Duel.IsPlayerAffectedByEffect(tp,69832741) then
64+
return Duel.GetMatchingGroup(Fusion.IsMonsterFilter(Card.IsAbleToRemove),tp,LOCATION_GRAVE,0,nil)
65+
end
66+
return nil
67+
end

pre-release/c101301005.lua

Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
--月光金獅子
2+
--Lunalight Gold Leo
3+
--scripted by Naim
4+
local s,id=GetID()
5+
function s.initial_effect(c)
6+
--Add 1 "Lunalight" monster from your Deck to your hand, except "Lunalight Gold Leo", then discard 1 card
7+
local e1=Effect.CreateEffect(c)
8+
e1:SetDescription(aux.Stringid(id,0))
9+
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH+CATEGORY_HANDES)
10+
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
11+
e1:SetProperty(EFFECT_FLAG_DELAY)
12+
e1:SetCode(EVENT_SUMMON_SUCCESS)
13+
e1:SetCountLimit(1,id)
14+
e1:SetTarget(s.deckthtg)
15+
e1:SetOperation(s.deckthop)
16+
c:RegisterEffect(e1)
17+
local e2=e1:Clone()
18+
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
19+
c:RegisterEffect(e2)
20+
--Add 1 "Lunalight" monster sent to the GY to the hand
21+
local e3=Effect.CreateEffect(c)
22+
e3:SetDescription(aux.Stringid(id,1))
23+
e3:SetCategory(CATEGORY_TOHAND)
24+
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
25+
e3:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP)
26+
e3:SetCode(EVENT_CUSTOM+id)
27+
e3:SetRange(LOCATION_MZONE)
28+
e3:SetCountLimit(1,{id,1})
29+
e3:SetTarget(s.gythtg)
30+
e3:SetOperation(s.gythop)
31+
c:RegisterEffect(e3)
32+
local g=Group.CreateGroup()
33+
g:KeepAlive()
34+
e3:SetLabelObject(g)
35+
--Keep track of "Lunalight" monsters sent to the GY
36+
local e4=Effect.CreateEffect(c)
37+
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
38+
e4:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
39+
e4:SetCode(EVENT_TO_GRAVE)
40+
e4:SetRange(LOCATION_MZONE)
41+
e4:SetLabelObject(e3)
42+
e4:SetOperation(s.regop)
43+
c:RegisterEffect(e4)
44+
end
45+
s.listed_series={SET_LUNALIGHT}
46+
s.listed_names={id}
47+
function s.deckthfilter(c)
48+
return c:IsSetCard(SET_LUNALIGHT) and c:IsMonster() and not c:IsCode(id) and c:IsAbleToHand()
49+
end
50+
function s.deckthtg(e,tp,eg,ep,ev,re,r,rp,chk)
51+
if chk==0 then return Duel.IsExistingMatchingCard(s.deckthfilter,tp,LOCATION_DECK,0,1,nil) end
52+
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
53+
end
54+
function s.deckthop(e,tp,eg,ep,ev,re,r,rp)
55+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
56+
local g=Duel.SelectMatchingCard(tp,s.deckthfilter,tp,LOCATION_DECK,0,1,1,nil)
57+
if #g>0 and Duel.SendtoHand(g,nil,REASON_EFFECT)>0 and g:GetFirst():IsLocation(LOCATION_HAND) then
58+
Duel.ConfirmCards(1-tp,g)
59+
Duel.ShuffleHand(tp)
60+
Duel.BreakEffect()
61+
Duel.DiscardHand(tp,nil,1,1,REASON_EFFECT|REASON_DISCARD,nil)
62+
end
63+
end
64+
function s.gythfilter(c,e,tp)
65+
return c:IsSetCard(SET_LUNALIGHT) and c:IsMonster() and c:IsAbleToHand()
66+
and c:IsCanBeEffectTarget(e) and c:IsLocation(LOCATION_GRAVE) and c:IsControler(tp)
67+
end
68+
function s.regop(e,tp,eg,ep,ev,re,r,rp)
69+
local tg=eg:Filter(s.gythfilter,nil,e,tp)
70+
if #tg>0 then
71+
for tc in tg:Iter() do
72+
tc:RegisterFlagEffect(id,RESET_CHAIN,0,1)
73+
end
74+
local g=e:GetLabelObject():GetLabelObject()
75+
if Duel.GetCurrentChain()==0 then g:Clear() end
76+
g:Merge(tg)
77+
g:Remove(function(c) return c:GetFlagEffect(id)==0 end,nil)
78+
e:GetLabelObject():SetLabelObject(g)
79+
Duel.RaiseEvent(e:GetHandler(),EVENT_CUSTOM+id,e,0,tp,tp,0)
80+
end
81+
end
82+
function s.gythtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
83+
local g=e:GetLabelObject():Filter(s.gythfilter,nil,e,tp)
84+
if chkc then return g:IsContains(chkc) and s.gythfilter(chkc,e,tp) end
85+
if chk==0 then return #g>0 end
86+
local tc=nil
87+
if #g>1 then
88+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
89+
tc=g:Select(tp,1,1,nil):GetFirst()
90+
else
91+
tc=g:GetFirst()
92+
end
93+
Duel.SetTargetCard(tc)
94+
Duel.SetOperationInfo(0,CATEGORY_TOHAND,tc,1,tp,0)
95+
end
96+
function s.gythop(e,tp,eg,ep,ev,re,r,rp)
97+
local tc=Duel.GetFirstTarget()
98+
if tc:IsRelateToEffect(e) then
99+
Duel.SendtoHand(tc,nil,REASON_EFFECT)
100+
end
101+
end

0 commit comments

Comments
 (0)