Skip to content

Commit cd47ce6

Browse files
authored
Added new card scripts
1 parent 3a7f80a commit cd47ce6

3 files changed

Lines changed: 239 additions & 0 deletions

File tree

pre-release/c101402032.lua

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
--グリズリーファザー
2+
--Father Grizzly
3+
--scripted by Naim
4+
local s,id=GetID()
5+
function s.initial_effect(c)
6+
--When this card is destroyed by battle and sent to the GY: You can Special Summon 1 Level 4 monster with 1400 ATK from your Deck, or if you have 2 or more Level 4 monsters with 1400 ATK in your GY, you can Special Summon 1 Normal Monster instead
7+
local e1=Effect.CreateEffect(c)
8+
e1:SetDescription(aux.Stringid(id,0))
9+
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
10+
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
11+
e1:SetCode(EVENT_BATTLE_DESTROYED)
12+
e1:SetCondition(function(e)
13+
return e:GetHandler():IsLocation(LOCATION_GRAVE)
14+
end)
15+
e1:SetTarget(s.sptg)
16+
e1:SetOperation(s.spop)
17+
c:RegisterEffect(e1)
18+
--When your opponent activates a monster effect and you control a face-up non-Effect Monster (Quick Effect): You can banish this card from your GY; negate the activation, and if you do, destroy that monster. You can only use this effect of "Father Grizzly" once per turn
19+
local e2=Effect.CreateEffect(c)
20+
e2:SetDescription(aux.Stringid(id,1))
21+
e2:SetCategory(CATEGORY_NEGATE+CATEGORY_DESTROY)
22+
e2:SetType(EFFECT_TYPE_QUICK_O)
23+
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
24+
e2:SetCode(EVENT_CHAINING)
25+
e2:SetRange(LOCATION_GRAVE)
26+
e2:SetCountLimit(1,id)
27+
e2:SetCondition(function(e,tp,eg,ep,ev,re,r,rp)
28+
return ep==1-tp and re:IsMonsterEffect() and Duel.IsChainNegatable(ev)
29+
and Duel.IsExistingMatchingCard(aux.FaceupFilter(Card.IsNonEffectMonster),tp,LOCATION_MZONE,0,1,nil)
30+
end)
31+
e2:SetCost(Cost.SelfBanish)
32+
e2:SetTarget(function(e,tp,eg,ep,ev,re,r,rp,chk)
33+
if chk==0 then return true end
34+
local rc=re:GetHandler()
35+
Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,tp,0)
36+
if rc:IsDestructable() and rc:IsRelateToEffect(re) then
37+
Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,1,tp,0)
38+
end
39+
end)
40+
e2:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
41+
if Duel.NegateActivation(ev) and re:GetHandler():IsRelateToEffect(re) then
42+
Duel.Destroy(eg,REASON_EFFECT)
43+
end
44+
end)
45+
c:RegisterEffect(e2)
46+
end
47+
function s.normalspconfilter(c)
48+
return c:IsLevel(4) and c:IsAttack(1400)
49+
end
50+
function s.spfilter(c,e,tp,normal_chk)
51+
return c:IsCanBeSpecialSummoned(e,0,tp,false,false) and ((c:IsLevel(4) and c:IsAttack(1400))
52+
or (normal_chk and c:IsType(TYPE_NORMAL)))
53+
end
54+
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
55+
if chk==0 then
56+
local normal_chk=Duel.IsExistingMatchingCard(s.normalspconfilter,tp,LOCATION_GRAVE,0,2,nil)
57+
return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
58+
and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp,normal_chk)
59+
end
60+
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
61+
end
62+
function s.spop(e,tp,eg,ep,ev,re,r,rp)
63+
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
64+
local normal_chk=Duel.IsExistingMatchingCard(s.normalspconfilter,tp,LOCATION_GRAVE,0,2,nil)
65+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
66+
local g=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp,normal_chk)
67+
if #g>0 then
68+
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
69+
end
70+
end

pre-release/c101402035.lua

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
--一日万倍龍
2+
--Myriaday Dragon
3+
--Scripted by The Razgriz
4+
local s,id=GetID()
5+
local COUNTER_MYRIAD=0x21d
6+
function s.initial_effect(c)
7+
c:EnableCounterPermit(COUNTER_MYRIAD)
8+
--Once per turn, during the End Phase: You can pay 100 LP; place 1 Myriad Counter on this card
9+
local e1=Effect.CreateEffect(c)
10+
e1:SetDescription(aux.Stringid(id,0))
11+
e1:SetCategory(CATEGORY_COUNTER)
12+
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
13+
e1:SetCode(EVENT_PHASE+PHASE_END)
14+
e1:SetRange(LOCATION_MZONE)
15+
e1:SetCountLimit(1)
16+
e1:SetCost(Cost.PayLP(100))
17+
e1:SetTarget(function(e,tp,eg,ep,ev,re,r,rp,chk)
18+
local c=e:GetHandler()
19+
if chk==0 then return c:IsCanAddCounter(COUNTER_MYRIAD,1) end
20+
Duel.SetOperationInfo(0,CATEGORY_COUNTER,c,1,tp,COUNTER_MYRIAD)
21+
end)
22+
e1:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
23+
local c=e:GetHandler()
24+
if c:IsRelateToEffect(e) then
25+
c:AddCounter(COUNTER_MYRIAD,1)
26+
end
27+
end)
28+
c:RegisterEffect(e1)
29+
--Once per turn, during your Main Phase: You can place 1 Myriad Counter on this card for every 1000 points difference between your LP and your opponent's
30+
local e2=Effect.CreateEffect(c)
31+
e2:SetDescription(aux.Stringid(id,1))
32+
e2:SetCategory(CATEGORY_COUNTER)
33+
e2:SetType(EFFECT_TYPE_IGNITION)
34+
e2:SetRange(LOCATION_MZONE)
35+
e2:SetCountLimit(1)
36+
e2:SetTarget(function(e,tp,eg,ep,ev,re,r,rp,chk)
37+
local c=e:GetHandler()
38+
local number_of_counters=math.abs(Duel.GetLP(tp)-Duel.GetLP(1-tp))//1000
39+
if chk==0 then return number_of_counters>0 and c:IsCanAddCounter(COUNTER_MYRIAD,number_of_counters) end
40+
Duel.SetOperationInfo(0,CATEGORY_COUNTER,c,number_of_counters,tp,COUNTER_MYRIAD)
41+
end)
42+
e2:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
43+
local c=e:GetHandler()
44+
if not c:IsRelateToEffect(e) then return end
45+
local number_of_counters=math.abs(Duel.GetLP(tp)-Duel.GetLP(1-tp))//1000
46+
if number_of_counters>0 then
47+
c:AddCounter(COUNTER_MYRIAD,number_of_counters)
48+
end
49+
end)
50+
c:RegisterEffect(e2)
51+
--Gains 10,000 ATK/DEF while it has 10 or more Myriad Counters
52+
local e3a=Effect.CreateEffect(c)
53+
e3a:SetType(EFFECT_TYPE_SINGLE)
54+
e3a:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
55+
e3a:SetCode(EFFECT_UPDATE_ATTACK)
56+
e3a:SetRange(LOCATION_MZONE)
57+
e3a:SetCondition(function(e)
58+
return e:GetHandler():GetCounter(COUNTER_MYRIAD)>=10
59+
end)
60+
e3a:SetValue(10000)
61+
c:RegisterEffect(e3a)
62+
local e3b=e3a:Clone()
63+
e3b:SetCode(EFFECT_UPDATE_DEFENSE)
64+
c:RegisterEffect(e3b)
65+
--If this card would be destroyed by battle or card effect, remove 1 Myriad Counter from it instead
66+
local e4=Effect.CreateEffect(c)
67+
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
68+
e4:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
69+
e4:SetCode(EFFECT_DESTROY_REPLACE)
70+
e4:SetRange(LOCATION_MZONE)
71+
e4:SetTarget(function(e,tp,eg,ep,ev,re,r,rp,chk)
72+
if chk==0 then
73+
local c=e:GetHandler()
74+
return not c:IsReason(REASON_REPLACE|REASON_RULE) and c:HasCounter(COUNTER_MYRIAD,1)
75+
end
76+
return true
77+
end)
78+
e4:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
79+
e:GetHandler():RemoveCounter(tp,COUNTER_MYRIAD,1,REASON_EFFECT)
80+
end)
81+
c:RegisterEffect(e4)
82+
end
83+
s.counter_place_list={COUNTER_MYRIAD}

pre-release/c101402051.lua

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
--解層竜ストラティアエ
2+
--Destratification Dino Stratiae
3+
--scripted by Naim
4+
local s,id=GetID()
5+
function s.initial_effect(c)
6+
c:EnableReviveLimit()
7+
--Link Summon procedure: 2 monsters, including a Dinosaur monster
8+
Link.AddProcedure(c,nil,2,2,s.linkmatcheck)
9+
--Keep track of the total original ATK of the Dinosaur monsters used as its material
10+
local e0=Effect.CreateEffect(c)
11+
e0:SetType(EFFECT_TYPE_SINGLE)
12+
e0:SetCode(EFFECT_MATERIAL_CHECK)
13+
e0:SetValue(function(e,c)
14+
local mg=c:GetMaterial():Match(Card.IsRace,nil,RACE_DINOSAUR,c,SUMMON_TYPE_LINK,e:GetHandlerPlayer())
15+
e:SetLabel(mg:GetSum(Card.GetBaseAttack)//2)
16+
end)
17+
c:RegisterEffect(e0)
18+
--If this card is Link Summoned: You can make this card gain ATK equal to half the total original ATK of the Dinosaur monsters used as its material
19+
local e1=Effect.CreateEffect(c)
20+
e1:SetDescription(aux.Stringid(id,0))
21+
e1:SetCategory(CATEGORY_ATKCHANGE)
22+
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
23+
e1:SetProperty(EFFECT_FLAG_DELAY)
24+
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
25+
e1:SetCondition(function(e)
26+
return e:GetHandler():IsLinkSummoned() and e0:GetLabel()>0
27+
end)
28+
e1:SetTarget(function(e,tp,eg,ep,ev,re,r,rp,chk)
29+
if chk==0 then return true end
30+
local atk=e0:GetLabel()
31+
e:GetChainData().atk=atk
32+
Duel.SetOperationInfo(0,CATEGORY_ATKCHANGE,e:GetHandler(),1,tp,atk)
33+
end)
34+
e1:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
35+
local c=e:GetHandler()
36+
if c:IsRelateToEffect(e) and c:IsFaceup() then
37+
--Make this card gain ATK equal to half the total original ATK of the Dinosaur monsters used as its material
38+
c:UpdateAttack(e:GetChainData().atk)
39+
end
40+
end)
41+
c:RegisterEffect(e1)
42+
--During your Main Phase: You can Fusion Summon 1 Dinosaur Fusion Monster from your Extra Deck, by banishing its materials from your field and/or GY, also you cannot Special Summon from the Extra Deck for the rest of this turn, except Dinosaur monsters. You can only use this effect of "Destratification Dino Stratiae" once per turn
43+
local fusion_params={
44+
fusfilter=function(c) return c:IsRace(RACE_DINOSAUR) end,
45+
matfilter=Fusion.OnFieldMat(Card.IsAbleToRemove),
46+
extrafil=function(e,tp,mg)
47+
if not Duel.IsPlayerAffectedByEffect(tp,CARD_SPIRIT_ELIMINATION) then
48+
return Duel.GetMatchingGroup(Fusion.IsMonsterFilter(Card.IsAbleToRemove),tp,LOCATION_GRAVE,0,nil)
49+
end
50+
return nil
51+
end,
52+
extraop=Fusion.BanishMaterial,
53+
extratg=function(e,tp,eg,ep,ev,re,r,rp,chk)
54+
if chk==0 then return true end
55+
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,tp,LOCATION_MZONE|LOCATION_GRAVE)
56+
end,
57+
stage2=function(e,fc,tp,mg,chk)
58+
if chk~=2 then return end
59+
local c=e:GetHandler()
60+
--You cannot Special Summon from the Extra Deck for the rest of this turn, except Dinosaur monsters
61+
local e1=Effect.CreateEffect(c)
62+
e1:SetDescription(aux.Stringid(id,2))
63+
e1:SetType(EFFECT_TYPE_FIELD)
64+
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CLIENT_HINT)
65+
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
66+
e1:SetTargetRange(1,0)
67+
e1:SetTarget(function(e,c) return c:IsLocation(LOCATION_EXTRA) and c:IsRaceExcept(RACE_DINOSAUR) end)
68+
e1:SetReset(RESET_PHASE|PHASE_END)
69+
Duel.RegisterEffect(e1,tp)
70+
--"Clock Lizard" check
71+
aux.addTempLizardCheck(c,tp,function(c) return not c:IsOriginalRace(RACE_DINOSAUR) end)
72+
end
73+
}
74+
local e2=Effect.CreateEffect(c)
75+
e2:SetDescription(aux.Stringid(id,1))
76+
e2:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_FUSION_SUMMON+CATEGORY_REMOVE)
77+
e2:SetType(EFFECT_TYPE_IGNITION)
78+
e2:SetRange(LOCATION_MZONE)
79+
e2:SetCountLimit(1,id)
80+
e2:SetTarget(Fusion.SummonEffTG(fusion_params))
81+
e2:SetOperation(Fusion.SummonEffOP(fusion_params))
82+
c:RegisterEffect(e2)
83+
end
84+
function s.linkmatcheck(g,linkc,sumtype,tp)
85+
return g:IsExists(Card.IsRace,1,nil,RACE_DINOSAUR,linkc,sumtype,tp)
86+
end

0 commit comments

Comments
 (0)