Skip to content

Commit 25ae316

Browse files
authored
Added new card scripts
1 parent 0d934fa commit 25ae316

File tree

2 files changed

+156
-0
lines changed

2 files changed

+156
-0
lines changed

pre-release/c101208022.lua

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
--スター・ライゼオル
2+
--Star Ryzeal
3+
--scripted by Naim
4+
local s,id=GetID()
5+
function s.initial_effect(c)
6+
--You can Special Summon this card (from your hand) by detaching 1 material from a monster you control
7+
local e1=Effect.CreateEffect(c)
8+
e1:SetDescription(aux.Stringid(id,0))
9+
e1:SetType(EFFECT_TYPE_FIELD)
10+
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
11+
e1:SetCode(EFFECT_SPSUMMON_PROC)
12+
e1:SetRange(LOCATION_HAND)
13+
e1:SetCountLimit(1,id,EFFECT_COUNT_CODE_OATH)
14+
e1:SetCondition(s.selfspcon)
15+
e1:SetTarget(s.selfsptg)
16+
e1:SetOperation(s.selfspop)
17+
c:RegisterEffect(e1)
18+
--Set 1 "Ryzeal" Spell/Trap from your Deck
19+
local e2=Effect.CreateEffect(c)
20+
e2:SetDescription(aux.Stringid(id,1))
21+
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
22+
e2:SetProperty(EFFECT_FLAG_DELAY)
23+
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
24+
e2:SetCountLimit(1,{id,1})
25+
e2:SetTarget(s.settg)
26+
e2:SetOperation(s.setop)
27+
c:RegisterEffect(e2)
28+
end
29+
s.listed_series={SET_RYZEAL}
30+
function s.selfspcon(e,c)
31+
if c==nil then return true end
32+
local tp=e:GetHandlerPlayer()
33+
return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
34+
and Duel.CheckRemoveOverlayCard(tp,1,0,1,REASON_COST)
35+
end
36+
function s.selfsptg(e,tp,eg,ep,ev,re,r,rp,chk,c)
37+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVEXYZ)
38+
local g=Duel.GetOverlayGroup(tp,1,0):Select(tp,0,1,nil)
39+
if #g>0 then
40+
g:KeepAlive()
41+
e:SetLabelObject(g)
42+
return true
43+
end
44+
return false
45+
end
46+
function s.selfspop(e,tp,eg,ep,ev,re,r,rp,c)
47+
local g=e:GetLabelObject()
48+
if not g then return end
49+
local xyzc=g:GetFirst():GetOverlayTarget()
50+
Duel.SendtoGrave(g,REASON_COST)
51+
Duel.RaiseSingleEvent(xyzc,EVENT_DETACH_MATERIAL,e,0,0,0,0)
52+
Duel.RaiseEvent(xyzc,EVENT_DETACH_MATERIAL,e,REASON_EFFECT,tp,tp,0)
53+
--You cannot Special Summon from the Extra Deck for the rest of this turn, except Rank 4 Xyz Monsters
54+
local e1=Effect.CreateEffect(c)
55+
e1:SetDescription(aux.Stringid(id,2))
56+
e1:SetType(EFFECT_TYPE_FIELD)
57+
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH+EFFECT_FLAG_CLIENT_HINT)
58+
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
59+
e1:SetTargetRange(1,0)
60+
e1:SetTarget(function(e,c) return c:IsLocation(LOCATION_EXTRA) and not (c:IsType(TYPE_XYZ) and c:IsRank(4)) end)
61+
e1:SetReset(RESET_PHASE|PHASE_END)
62+
Duel.RegisterEffect(e1,tp)
63+
--"Clock Lizard" check
64+
aux.addTempLizardCheck(c,tp,function(e,c) return not (c:IsOriginalType(TYPE_XYZ) and c:IsOriginalRank(4)) end)
65+
end
66+
function s.setfilter(c)
67+
return c:IsSetCard(SET_RYZEAL) and c:IsSpellTrap() and c:IsSSetable()
68+
end
69+
function s.settg(e,tp,eg,ep,ev,re,r,rp,chk)
70+
if chk==0 then return Duel.IsExistingMatchingCard(s.setfilter,tp,LOCATION_DECK,0,1,nil) end
71+
end
72+
function s.setop(e,tp,eg,ep,ev,re,r,rp)
73+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
74+
local g=Duel.SelectMatchingCard(tp,s.setfilter,tp,LOCATION_DECK,0,1,1,nil)
75+
if #g>0 then
76+
Duel.SSet(tp,g)
77+
end
78+
end

pre-release/c101208075.lua

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
--ライゼオル・マスドライバー
2+
--Ryzeal Mass Driver
3+
--scripted by Naim
4+
local s,id=GetID()
5+
function s.initial_effect(c)
6+
--Apply the following effect then you can attach this card to a Rank 4 Xyz Monster you control as material
7+
local e1=Effect.CreateEffect(c)
8+
e1:SetDescription(aux.Stringid(id,0))
9+
e1:SetCategory(CATEGORY_ATKCHANGE)
10+
e1:SetType(EFFECT_TYPE_ACTIVATE)
11+
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
12+
e1:SetCode(EVENT_FREE_CHAIN)
13+
e1:SetCountLimit(1,id)
14+
e1:SetHintTiming(TIMING_DAMAGE_STEP,TIMING_DAMAGE_STEP|TIMING_STANDBY_PHASE|TIMING_MAIN_END|TIMINGS_CHECK_MONSTER_E)
15+
e1:SetCondition(function() return not (Duel.IsPhase(PHASE_DAMAGE) and Duel.IsDamageCalculated()) end)
16+
e1:SetTarget(s.atktg)
17+
e1:SetOperation(s.atkop)
18+
c:RegisterEffect(e1)
19+
--Banish 1 card from your opponent's GY
20+
local e2=Effect.CreateEffect(c)
21+
e2:SetDescription(aux.Stringid(id,1))
22+
e2:SetCategory(CATEGORY_REMOVE)
23+
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
24+
e2:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET)
25+
e2:SetCode(EVENT_TO_GRAVE)
26+
e2:SetCountLimit(1,{id,1})
27+
e2:SetCondition(function(e) return not e:GetHandler():IsPreviousLocation(LOCATION_ONFIELD) end)
28+
e2:SetTarget(s.rmvtg)
29+
e2:SetOperation(s.rmvop)
30+
c:RegisterEffect(e2)
31+
end
32+
s.listed_series={SET_RYZEAL}
33+
function s.atktg(e,tp,eg,ep,ev,re,r,rp,chk)
34+
if chk==0 then return true end
35+
local g=Duel.GetMatchingGroup(aux.FaceupFilter(Card.IsSetCard,SET_RYZEAL),tp,LOCATION_MZONE,0,nil)
36+
Duel.SetOperationInfo(0,CATEGORY_ATKCHANGE,g,#g,tp,1000)
37+
end
38+
function s.xyzfilter(c,mc,tp)
39+
return c:IsType(TYPE_XYZ) and c:IsRank(4) and c:IsFaceup() and mc:IsCanBeXyzMaterial(c,tp,REASON_EFFECT)
40+
end
41+
function s.atkop(e,tp,eg,ep,ev,re,r,rp)
42+
local c=e:GetHandler()
43+
--"Ryzeal" monsters you control will gain 1000 ATK for the rest of this turn
44+
local e1=Effect.CreateEffect(c)
45+
e1:SetType(EFFECT_TYPE_FIELD)
46+
e1:SetCode(EFFECT_UPDATE_ATTACK)
47+
e1:SetTargetRange(LOCATION_MZONE,0)
48+
e1:SetTarget(function(e,c) return c:IsSetCard(SET_RYZEAL) end)
49+
e1:SetValue(1000)
50+
e1:SetReset(RESET_PHASE|PHASE_END)
51+
Duel.RegisterEffect(e1,tp)
52+
aux.RegisterClientHint(c,0,tp,1,0,aux.Stringid(id,2))
53+
if c:IsRelateToEffect(e) and Duel.IsExistingMatchingCard(s.xyzfilter,tp,LOCATION_MZONE,0,1,nil,c,tp)
54+
and Duel.SelectYesNo(tp,aux.Stringid(id,3)) then
55+
c:CancelToGrave()
56+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
57+
local tc=Duel.SelectMatchingCard(tp,s.xyzfilter,tp,LOCATION_MZONE,0,1,1,nil,c,tp):GetFirst()
58+
if tc then
59+
Duel.HintSelection(tc)
60+
Duel.BreakEffect()
61+
if tc:IsImmuneToEffect(e) then return end
62+
Duel.Overlay(tc,c)
63+
end
64+
end
65+
end
66+
function s.rmvtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
67+
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(1-tp) and chkc:IsAbleToRemove() end
68+
if chk==0 then return Duel.IsExistingTarget(Card.IsAbleToRemove,tp,0,LOCATION_GRAVE,1,nil) end
69+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
70+
local g=Duel.SelectTarget(tp,Card.IsAbleToRemove,tp,0,LOCATION_GRAVE,1,1,nil)
71+
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,1,tp,0)
72+
end
73+
function s.rmvop(e,tp,eg,ep,ev,re,r,rp)
74+
local tc=Duel.GetFirstTarget()
75+
if tc:IsRelateToEffect(e) then
76+
Duel.Remove(tc,POS_FACEUP,REASON_EFFECT)
77+
end
78+
end

0 commit comments

Comments
 (0)