Skip to content

Commit 9390e4c

Browse files
authored
Added new card scripts
1 parent 5410462 commit 9390e4c

File tree

2 files changed

+114
-0
lines changed

2 files changed

+114
-0
lines changed

pre-release/c101301050.lua

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
--麗しき磁律機壊
2+
--Zilofthonia Gorgon
3+
--scripted by pyrQ
4+
local s,id=GetID()
5+
function s.initial_effect(c)
6+
c:EnableReviveLimit()
7+
--Link Summon procedure: 2+ Effect Monsters
8+
Link.AddProcedure(c,aux.FilterBoolFunctionEx(Card.IsType,TYPE_EFFECT),2)
9+
--You cannot Summon/Set monsters to a zone(s) this card points to
10+
local e0=Effect.CreateEffect(c)
11+
e0:SetType(EFFECT_TYPE_FIELD)
12+
e0:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
13+
e0:SetCode(EFFECT_FORCE_MZONE)
14+
e0:SetRange(LOCATION_MZONE)
15+
e0:SetTargetRange(1,0)
16+
e0:SetValue(function(e,fp,rp,r) return r==LOCATION_REASON_CONTROL and ~(ZONES_MMZ|ZONES_EMZ) or ~e:GetHandler():GetLinkedZone() end)
17+
c:RegisterEffect(e0)
18+
--Monsters this card points to cannot attack, also their activated effects are negated
19+
local e1=Effect.CreateEffect(c)
20+
e1:SetType(EFFECT_TYPE_FIELD)
21+
e1:SetCode(EFFECT_CANNOT_ATTACK)
22+
e1:SetRange(LOCATION_MZONE)
23+
e1:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
24+
e1:SetTarget(function(e,c) return e:GetHandler():GetLinkedGroup():IsContains(c) end)
25+
c:RegisterEffect(e1)
26+
local e2=Effect.CreateEffect(c)
27+
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
28+
e2:SetCode(EVENT_CHAIN_SOLVING)
29+
e2:SetRange(LOCATION_MZONE)
30+
e2:SetCondition(s.discon)
31+
e2:SetOperation(function(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_CARD,0,id) Duel.NegateEffect(ev) end)
32+
c:RegisterEffect(e2)
33+
--Gains ATK equal to the total original ATK of all monsters this card points to
34+
local e3=Effect.CreateEffect(c)
35+
e3:SetType(EFFECT_TYPE_SINGLE)
36+
e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
37+
e3:SetCode(EFFECT_UPDATE_ATTACK)
38+
e3:SetRange(LOCATION_MZONE)
39+
e3:SetValue(function(e,c) return e:GetHandler():GetLinkedGroup():Match(Card.IsFaceup,nil):GetSum(Card.GetBaseAttack) end)
40+
c:RegisterEffect(e3)
41+
--Cannot be destroyed by battle or monster effects while it points to no monsters
42+
local e4=Effect.CreateEffect(c)
43+
e4:SetType(EFFECT_TYPE_SINGLE)
44+
e4:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
45+
e4:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
46+
e4:SetRange(LOCATION_MZONE)
47+
e4:SetValue(1)
48+
e4:SetCondition(function(e) return e:GetHandler():GetLinkedGroupCount()==0 end)
49+
c:RegisterEffect(e4)
50+
local e5=e4:Clone()
51+
e5:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
52+
e5:SetValue(function(e,re) return re:IsMonsterEffect() end)
53+
c:RegisterEffect(e5)
54+
end
55+
function s.discon(e,tp,eg,ep,ev,re,r,rp)
56+
local c=e:GetHandler()
57+
local rc=re:GetHandler()
58+
return re:IsMonsterEffect() and rc:IsRelateToEffect(re) and c:GetLinkedGroup():IsContains(rc) and not c:IsStatus(STATUS_BATTLE_DESTROYED)
59+
end

pre-release/c101301078.lua

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
--トラップホリック
2+
--Trapholic
3+
--scripted by Naim
4+
local s,id=GetID()
5+
function s.initial_effect(c)
6+
--Destroy 1 Spell/Trap you control, and if you do, Set 1 Normal Trap from your Deck
7+
local e1=Effect.CreateEffect(c)
8+
e1:SetDescription(aux.Stringid(id,0))
9+
e1:SetCategory(CATEGORY_DESTROY)
10+
e1:SetType(EFFECT_TYPE_ACTIVATE)
11+
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
12+
e1:SetCode(EVENT_FREE_CHAIN)
13+
e1:SetCountLimit(1,id,EFFECT_COUNT_CODE_OATH)
14+
e1:SetHintTiming(0,TIMING_STANDBY_PHASE|TIMING_MAIN_END|TIMINGS_CHECK_MONSTER_E)
15+
e1:SetTarget(s.target)
16+
e1:SetOperation(s.activate)
17+
c:RegisterEffect(e1)
18+
end
19+
s.listed_names={id}
20+
function s.desfilter(c,tp,ft)
21+
if not c:IsSpellTrap() then return false end
22+
if c:IsLocation(LOCATION_STZONE) then ft=ft+1 end
23+
return Duel.IsExistingMatchingCard(s.setfilter,tp,LOCATION_DECK,0,1,nil,ft>0)
24+
end
25+
function s.setfilter(c,haszone)
26+
return c:IsNormalTrap() and c:IsSSetable(haszone) and not c:IsCode(id)
27+
end
28+
function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
29+
local c=e:GetHandler()
30+
local ft=Duel.GetLocationCount(tp,LOCATION_SZONE)
31+
if not c:IsLocation(LOCATION_SZONE) and e:IsHasType(EFFECT_TYPE_ACTIVATE) then ft=ft-1 end
32+
if chkc then return chkc:IsOnField() and s.desfilter(chkc,tp,ft) and chkc~=c end
33+
if chk==0 then return Duel.IsExistingTarget(s.desfilter,tp,LOCATION_ONFIELD,0,1,c,tp,ft) end
34+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
35+
local g=Duel.SelectTarget(tp,s.desfilter,tp,LOCATION_ONFIELD,0,1,1,c,tp,ft)
36+
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,tp,0)
37+
end
38+
function s.activate(e,tp,eg,ep,ev,re,r,rp)
39+
local tc=Duel.GetFirstTarget()
40+
if tc:IsRelateToEffect(e) and Duel.Destroy(tc,REASON_EFFECT)>0 and Duel.GetLocationCount(tp,LOCATION_SZONE)>0 then
41+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
42+
local sc=Duel.SelectMatchingCard(tp,s.setfilter,tp,LOCATION_DECK,0,1,1,nil,false):GetFirst()
43+
if sc and Duel.SSet(tp,sc)>0 then
44+
--It can be activated this turn while you have 3 or more Traps in your GY
45+
local e1=Effect.CreateEffect(e:GetHandler())
46+
e1:SetDescription(aux.Stringid(id,1))
47+
e1:SetType(EFFECT_TYPE_SINGLE)
48+
e1:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
49+
e1:SetCode(EFFECT_TRAP_ACT_IN_SET_TURN)
50+
e1:SetCondition(function(e) return Duel.GetMatchingGroupCount(Card.IsTrap,tp,LOCATION_GRAVE,0,nil)>=3 end)
51+
e1:SetReset(RESETS_STANDARD_PHASE_END)
52+
sc:RegisterEffect(e1)
53+
end
54+
end
55+
end

0 commit comments

Comments
 (0)