Skip to content

Commit

Permalink
Added new card scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
pyrQ committed Sep 20, 2024
1 parent f28648a commit 35cc840
Show file tree
Hide file tree
Showing 14 changed files with 1,187 additions and 0 deletions.
66 changes: 66 additions & 0 deletions pre-release/c100200261.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
--玲瓏竜 クンツァイド
--Dragolithia Kunzite
--Scripted by Eerie Code
local s,id=GetID()
function s.initial_effect(c)
--Send 1 Level 7 or higher Normal Monster from your hand or Deck to the GY, and if you do, Special Summon this card
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_TOGRAVE+CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,id)
e1:SetTarget(s.tgsptg)
e1:SetOperation(s.tgspop)
c:RegisterEffect(e1)
--Special Summon 1 Normal Monster from your GY in Defense Position
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,id)
e2:SetCost(aux.selfbanishcost)
e2:SetTarget(s.gysptg)
e2:SetOperation(s.gyspop)
c:RegisterEffect(e2)
end
function s.tgfilter(c)
return c:IsType(TYPE_NORMAL) and c:IsLevelAbove(7) and c:IsAbleToGrave()
end
function s.tgsptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
and Duel.IsExistingMatchingCard(s.tgfilter,tp,LOCATION_HAND|LOCATION_DECK,0,1,c) end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_HAND|LOCATION_DECK)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,tp,0)
end
function s.tgspop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local tc=Duel.SelectMatchingCard(tp,s.tgfilter,tp,LOCATION_HAND|LOCATION_DECK,0,1,1,c):GetFirst()
if tc and Duel.SendtoGrave(tc,REASON_EFFECT)>0 and tc:IsLocation(LOCATION_GRAVE)
and c:IsRelateToEffect(e) then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
end
function s.gyspfilter(c,e,tp)
return c:IsType(TYPE_NORMAL) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE)
end
function s.gysptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_GRAVE) and s.gyspfilter(chkc,e,tp) end
local c=e:GetHandler()
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(s.gyspfilter,tp,LOCATION_GRAVE,0,1,c,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,s.gyspfilter,tp,LOCATION_GRAVE,0,1,1,c,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,tp,0)
end
function s.gyspop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP_DEFENSE)
end
end
90 changes: 90 additions & 0 deletions pre-release/c100306148.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
--Japanese name
--Theia, the Primal Being
--scripted by Naim
local s,id=GetID()
function s.initial_effect(c)
--Special Summon this card from your hand
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,id)
e1:SetHintTiming(0,TIMING_MAIN_END|TIMINGS_CHECK_MONSTER)
e1:SetCondition(function() return Duel.IsMainPhase() end)
e1:SetCost(s.spcost)
e1:SetTarget(s.sptg)
e1:SetOperation(s.spop)
c:RegisterEffect(e1)
--Neither player can Normal and/or Special Summon more than 4 times per turn while this card is face-up in the Monster Zone
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetRange(LOCATION_MZONE)
e2:SetCode(EFFECT_CANNOT_SUMMON)
e2:SetTargetRange(1,1)
e2:SetTarget(function(e,c,tp) return e:GetHandler():GetFlagEffect(id+tp)>=4 end)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
c:RegisterEffect(e3)
--Register a flag to this card everytime Normal and Special Summons happen
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e4:SetCode(EVENT_SUMMON_SUCCESS)
e4:SetProperty(EFFECT_FLAG_DELAY)
e4:SetRange(LOCATION_MZONE)
e4:SetCondition(function(e,tp,eg) return eg and not eg:IsContains(e:GetHandler()) end)
e4:SetOperation(function(e,tp,eg,ep) e:GetHandler():RegisterFlagEffect(id+ep,RESETS_STANDARD_PHASE_END,0,1) end)
c:RegisterEffect(e4)
local e5=e4:Clone()
e5:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e5)
--Special Summon left count
local e6=Effect.CreateEffect(c)
e6:SetType(EFFECT_TYPE_FIELD)
e6:SetCode(EFFECT_LEFT_SPSUMMON_COUNT)
e6:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e6:SetRange(LOCATION_MZONE)
e6:SetTargetRange(1,1)
e6:SetValue(s.countval)
c:RegisterEffect(e6)
end
function s.spcheck(sg,tp)
return aux.ReleaseCheckMMZ(sg,tp) and sg:CheckWithSumGreater(Card.GetLevel,11,1,99)
end
function s.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroupCost(tp,Card.HasLevel,1,99,false,s.spcheck,nil) end
local g=Duel.SelectReleaseGroupCost(tp,Card.HasLevel,1,99,false,s.spcheck,nil)
Duel.Release(g,REASON_COST)
end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,tp,0)
Duel.SetPossibleOperationInfo(0,CATEGORY_DESTROY,nil,1,PLAYER_EITHER,LOCATION_MZONE)
end
function s.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)>0 and Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)==1 then
local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,nil):GetMaxGroup(Card.GetAttack)
if #g>0 and Duel.SelectYesNo(tp,aux.Stringid(id,1)) then
if #g>1 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
g=g:Select(tp,1,1,nil)
end
Duel.HintSelection(g)
Duel.BreakEffect()
Duel.Destroy(g,REASON_EFFECT)
end
end
end
function s.countval(e,re,sump)
local ct=e:GetHandler():GetFlagEffect(id+sump)
if ct>=4 then
return 0
else
return 4-ct
end
end
73 changes: 73 additions & 0 deletions pre-release/c100306149.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
--Japanese name
--Mind Castlin
--Scripted by Eerie Code
local s,id=GetID()
function s.initial_effect(c)
c:EnableReviveLimit()
--Synchro Summon procedure: 1 Tuner + 1+ non-Tuner monsters
Synchro.AddProcedure(c,nil,1,1,Synchro.NonTuner(nil),1,99)
--Switch control of 1 opponent's face-up monster and this card
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_CONTROL)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,{id,0})
e1:SetTarget(s.cttg1)
e1:SetOperation(s.ctop1)
c:RegisterEffect(e1)
--Switch control of 1 face-up monster on each field
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_CONTROL)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET)
e2:SetCode(EVENT_TO_GRAVE)
e2:SetCountLimit(1,{id,1})
e2:SetCondition(s.ctcon)
e2:SetTarget(s.cttg2)
e2:SetOperation(s.ctop2)
c:RegisterEffect(e2)
end
function s.ctfilter(c,tp,e)
return c:IsFaceup() and c:IsAbleToChangeControler() and Duel.GetMZoneCount(c:GetControler(),c,tp,LOCATION_REASON_CONTROL)>0
and (not e or c:IsCanBeEffectTarget(e))
end
function s.cttg1(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local c=e:GetHandler()
if chkc then return chkc:IsControler(1-tp) and chkc:IsLocation(LOCATION_MZONE) and s.ctfilter(chkc,tp) end
if chk==0 then return c:IsAbleToChangeControler() and Duel.GetMZoneCount(tp,c,tp,LOCATION_REASON_CONTROL)>0
and Duel.IsExistingTarget(s.ctfilter,tp,0,LOCATION_MZONE,1,nil,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONTROL)
local g=Duel.SelectTarget(tp,s.ctfilter,tp,0,LOCATION_MZONE,1,1,nil,tp)
g:AddCard(c)
Duel.SetOperationInfo(0,CATEGORY_CONTROL,g,2,tp,0)
end
function s.ctop1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if c:IsRelateToEffect(e) and tc:IsRelateToEffect(e) then
Duel.SwapControl(c,tc)
end
end
function s.ctcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsPreviousLocation(LOCATION_MZONE) and c:IsSummonType(SUMMON_TYPE_SYNCHRO)
end
function s.cttg2(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end
if chk==0 then return Duel.IsExistingTarget(s.ctfilter,tp,LOCATION_MZONE,0,1,nil,tp)
and Duel.IsExistingTarget(s.ctfilter,tp,0,LOCATION_MZONE,1,nil,tp) end
local g=Duel.GetMatchingGroup(s.ctfilter,tp,LOCATION_MZONE,LOCATION_MZONE,nil,tp,e)
local tg=aux.SelectUnselectGroup(g,e,tp,2,2,aux.dpcheck(Card.GetControler),1,tp,HINTMSG_CONTROL)
Duel.SetTargetCard(tg)
Duel.SetOperationInfo(0,CATEGORY_CONTROL,tg,2,tp,0)
end
function s.ctop2(e,tp,eg,ep,ev,re,r,rp)
local tg=Duel.GetTargetCards(e)
local c1,c2=tg:GetFirst(),tg:GetNext()
if c1:IsRelateToEffect(e) and c2:IsRelateToEffect(e) then
Duel.SwapControl(c1,c2)
end
end
39 changes: 39 additions & 0 deletions pre-release/c100306150.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
--Japanese name
--Heavy Polymerization
--Scripted by Naim
local s,id=GetID()
function s.initial_effect(c)
Fusion.RegisterSummonEff{handler=c,mincount=3,extrafil=s.fextra,extratg=s.extratg,extraop=s.extraop,stage2=s.stage2}
end
function s.fcheck(tp,sg,fc)
return sg:FilterCount(Card.IsLocation,nil,LOCATION_EXTRA)<=Duel.GetFieldGroupCount(tp,0,LOCATION_MZONE)
end
function s.fextra(e,tp,mg)
local eg=Duel.GetMatchingGroup(Card.IsAbleToRemove,tp,LOCATION_EXTRA,0,nil)
if #eg>0 then
return eg,s.fcheck
end
return nil
end
function s.extraop(e,tc,tp,sg)
local rg=sg:Filter(Card.IsLocation,nil,LOCATION_EXTRA)
if #rg>0 then
Duel.Remove(rg,POS_FACEUP,REASON_EFFECT|REASON_MATERIAL|REASON_FUSION)
e:SetLabel(rg:GetSum(Card.GetAttack))
sg:Sub(rg)
else
e:SetLabel(0)
end
end
function s.extratg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetPossibleOperationInfo(0,CATEGORY_REMOVE,nil,1,tp,LOCATION_EXTRA)
end
function s.stage2(e,tc,tp,sg,chk)
if chk==0 then
local ct=e:GetLabel()
if ct>0 then
Duel.SetLP(tp,Duel.GetLP(tp)-ct)
end
end
end
Loading

0 comments on commit 35cc840

Please sign in to comment.