Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 11 additions & 10 deletions cards_specific_functions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -871,32 +871,33 @@ end
Drytron={}
function Drytron.TributeCostFilter(c,tp)
return ((c:IsSetCard(SET_DRYTRON) and c:IsMonster()) or c:IsRitualMonster()) and (c:IsControler(tp) or c:IsFaceup())
and (c:IsInMainMZone(tp) or Duel.GetLocationCount(tp,LOCATION_MZONE)>0)
and Duel.GetMZoneCount(tp,c)>0
end
function Drytron.TributeBaseCost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroupCost(tp,Drytron.TributeCostFilter,1,true,nil,e:GetHandler(),tp) end
local sg=Duel.SelectReleaseGroupCost(tp,Drytron.TributeCostFilter,1,1,true,nil,e:GetHandler(),tp)
local c=e:GetHandler()
if chk==0 then return Duel.CheckReleaseGroupCost(tp,Drytron.TributeCostFilter,1,true,nil,c,tp) end
local sg=Duel.SelectReleaseGroupCost(tp,Drytron.TributeCostFilter,1,1,true,nil,c,tp)
Duel.Release(sg,REASON_COST)
end
function Drytron.ExtraCon(base,e,tp,eg,ep,ev,re,r,rp)
return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
end
function Drytron.TributeExtraCost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local id=c:GetOriginalCode()
if chk==0 then return Duel.GetCustomActivityCount(id,tp,ACTIVITY_SPSUMMON)==0 end
--Cannot Special Summon this turn, except Unsummonable
--You cannot Special Summon monsters, except monsters that cannot be Normal Summoned/Set, the turn you activate this effect
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,1))
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH+EFFECT_FLAG_CLIENT_HINT)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetTargetRange(1,0)
e1:SetTarget(Drytron.TributeSummonLimit)
e1:SetTarget(function(e,c) return c:IsSummonableCard() end)
e1:SetReset(RESET_PHASE|PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function Drytron.TributeSummonLimit(e,c)
return c:IsSummonableCard()
end
Drytron.TributeCost=aux.CostWithReplace(Drytron.TributeBaseCost,CARD_URSARCTIC_DRYTRON,nil,Drytron.TributeExtraCost)
Drytron.TributeCost=aux.CostWithReplace(Drytron.TributeBaseCost,CARD_URSARCTIC_DRYTRON,Drytron.ExtraCon,Drytron.TributeExtraCost)

--[[
Effect.CreateMysteruneQPEffect(c,id,[uniquecat,uniquetg,uniqueop,rmcount,uniqueprop,uniquecode])
Expand Down
32 changes: 13 additions & 19 deletions official/c16471775.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,37 +3,34 @@
--Scripted by edo9300
local s,id=GetID()
function s.initial_effect(c)
--add 2
--Add 2 "Ursarctic" monsters from your Deck to your hand
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,id)
e1:SetCost(s.cost)
e1:SetCost(Cost.Discard(nil,true))
e1:SetTarget(s.target)
e1:SetOperation(s.activate)
c:RegisterEffect(e1)
--Banish replace
--If you would Tribute a monster(s) to activate an "Ursarctic" monster's effect, except the turn this card was sent to the GY, you can banish this card from your GY instead
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,0))
e2:SetDescription(aux.Stringid(id,1))
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(CARD_URSARCTIC_BIG_DIPPER)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetTargetRange(1,0)
e2:SetCode(CARD_URSARCTIC_BIG_DIPPER)
e2:SetRange(LOCATION_GRAVE)
e2:SetTargetRange(1,0)
e2:SetCountLimit(1,{id,1})
e2:SetCondition(aux.AND(s.repcon,aux.exccon))
e2:SetCondition(aux.AND(aux.exccon,function(e) return e:GetHandler():IsAbleToRemoveAsCost() end))
e2:SetValue(s.repval)
e2:SetOperation(s.repop)
c:RegisterEffect(e2)
end
s.listed_series={0xa3}
function s.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,1,e:GetHandler()) end
Duel.DiscardHand(tp,Card.IsDiscardable,1,1,REASON_COST+REASON_DISCARD)
end
s.listed_series={SET_URSARCTIC}
function s.thfilter(c)
return c:IsSetCard(0x165) and c:IsMonster() and c:IsAbleToHand()
return c:IsSetCard(SET_URSARCTIC) and c:IsMonster() and c:IsAbleToHand()
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,2,2,nil) end
Expand All @@ -47,14 +44,11 @@ function s.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.ConfirmCards(1-tp,g)
end
end
function s.repcon(e)
return e:GetHandler():IsAbleToRemoveAsCost()
end
function s.repval(base,e,tp,eg,ep,ev,re,r,rp,chk,extracon)
local c=e:GetHandler()
return c:IsMonster() and c:IsSetCard(0x165) and (not extracon or extracon(base,c,e,tp,eg,ep,ev,re,r,rp,chk))
return c:IsSetCard(SET_URSARCTIC) and c:IsMonster() and (extracon==nil or extracon(base,e,tp,eg,ep,ev,re,r,rp))
end
function s.repop(base,e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,0,id)
Duel.Remove(base:GetHandler(),POS_FACEUP,REASON_COST+REASON_REPLACE)
end
Duel.Remove(base:GetHandler(),POS_FACEUP,REASON_COST|REASON_REPLACE)
end
72 changes: 31 additions & 41 deletions official/c25725326.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,62 +4,52 @@
local s,id=GetID()
function s.initial_effect(c)
c:EnableReviveLimit()
--1 Level 4 or lower "Prank-Kids" monster
Link.AddProcedure(c,s.mfilter,1,1)
--Can only Link Summon "Prank-Kids Meow-Meow-Mu" once per turn
--Link Summon procedure: 1 Level 4 or lower "Prank-Kids" monster
Link.AddProcedure(c,s.matfilter,1,1)
--You can only Link Summon "Prank-Kids Meow-Meow-Mu" once per turn
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e0:SetCode(EVENT_SPSUMMON_SUCCESS)
e0:SetCondition(function(e) return e:GetHandler():IsLinkSummoned() end)
e0:SetOperation(s.regop)
c:RegisterEffect(e0)
--If a "Prank-Kids" monster you control would Tribute itself to activate its effect during your opponent's turn, you can banish this card you control or from your GY instead
local e1=Effect.CreateEffect(c)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCondition(s.regcon)
e1:SetOperation(s.regop)
e1:SetDescription(aux.Stringid(id,0))
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(CARD_PRANKKIDS_MEOWMU)
e1:SetRange(LOCATION_MZONE|LOCATION_GRAVE)
e1:SetTargetRange(1,0)
e1:SetCountLimit(1,id)
e1:SetCondition(function(e) return e:GetHandler():IsAbleToRemoveAsCost() end)
e1:SetValue(s.repval)
e1:SetOperation(s.repop)
c:RegisterEffect(e1)
--Replace "Prank-Kids" monsters' Tribute cost
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,0))
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetCode(CARD_PRANKKIDS_MEOWMU)
e2:SetRange(LOCATION_MZONE+LOCATION_GRAVE)
e2:SetTargetRange(1,0)
e2:SetCountLimit(1,id)
e2:SetCondition(s.repcon)
e2:SetValue(s.repval)
e2:SetOperation(s.repop)
c:RegisterEffect(e2)
end
s.listed_series={SET_PRANK_KIDS}
s.listed_names={id}
s.listed_series={0x120}
function s.mfilter(c,lc,sumtype,tp)
return c:IsSetCard(0x120,lc,sumtype,tp) and c:IsLevelBelow(4)
end
function s.regcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_LINK)
function s.matfilter(c,lc,sumtype,tp)
return c:IsSetCard(SET_PRANK_KIDS,lc,sumtype,tp) and c:IsLevelBelow(4)
end
function s.regop(e,tp,eg,ep,ev,re,r,rp)
--Cannot Link Summon "Prank-Kids Meow-Meow-Mu"
--You cannot Link Summon "Prank-Kids Meow-Meow-Mu" for the rest of this turn
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetTargetRange(1,0)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetTarget(s.splimit)
e1:SetTarget(function(e,c,sump,sumtype,sumpos,targetp,se) return c:IsCode(id) and sumtype&SUMMON_TYPE_LINK==SUMMON_TYPE_LINK end)
e1:SetReset(RESET_PHASE|PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function s.splimit(e,c,sump,sumtype,sumpos,targetp,se)
return c:IsCode(id) and sumtype&SUMMON_TYPE_LINK==SUMMON_TYPE_LINK
end
function s.repcon(e)
return e:GetHandler():IsAbleToRemoveAsCost()
end
function s.repval(base,e,tp,eg,ep,ev,re,r,rp,chk,extracon)
local c=e:GetHandler()
local bp=e:GetHandlerPlayer()
return Duel.IsTurnPlayer(1-bp) and c:IsSetCard(0x120) and c:IsLocation(LOCATION_MZONE) and c:IsControler(bp)
and (not extracon or extracon(base,e,tp,eg,ep,ev,re,r,rp))
return Duel.IsTurnPlayer(1-tp) and c:IsSetCard(SET_PRANK_KIDS) and c:IsLocation(LOCATION_MZONE) and c:IsControler(tp)
and (extracon==nil or extracon(base,e,tp,eg,ep,ev,re,r,rp))
end
function s.repop(base,e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,0,id)
Duel.Remove(base:GetHandler(),POS_FACEUP,REASON_COST+REASON_REPLACE)
Duel.Remove(base:GetHandler(),POS_FACEUP,REASON_COST|REASON_REPLACE)
end
127 changes: 61 additions & 66 deletions official/c27693363.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,45 +2,39 @@
--Ursarctic Polari
local s,id=GetID()
function s.initial_effect(c)
--Must be properly summoned before reviving
c:EnableReviveLimit()
--Must be Special Summoned by its own method
c:AddMustBeSpecialSummoned()
--Must be Special Summoned (from your Extra Deck) by sending 2 monsters you control with a Level difference of 1 to the GY (1 Tuner and 1 non-Tuner)
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_FIELD)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e0:SetCode(EFFECT_SPSUMMON_PROC)
e0:SetRange(LOCATION_EXTRA)
e0:SetCondition(s.sprcon)
e0:SetTarget(s.sprtg)
e0:SetOperation(s.sprop)
c:RegisterEffect(e0)
--Activate 1 "Ursarctic Big Dipper" from your Deck
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_SPSUMMON_CONDITION)
e1:SetDescription(aux.Stringid(id,0))
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCountLimit(1,id)
e1:SetTarget(s.acttg)
e1:SetOperation(s.actop)
c:RegisterEffect(e1)
--Special Summon procedure (from the Extra Deck)
--Add to your hand, or Special Summon, 1 "Ursarctic" monster from your GY
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_SPSUMMON_PROC)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e2:SetRange(LOCATION_EXTRA)
e2:SetCondition(s.sprcon)
e2:SetTarget(s.sprtg)
e2:SetOperation(s.sprop)
e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,{id,1})
e2:SetCost(aux.CostWithReplace(s.thspcost,CARD_URSARCTIC_BIG_DIPPER,s.extracon))
e2:SetTarget(s.thsptg)
e2:SetOperation(s.thspop)
c:RegisterEffect(e2)
--Activate 1 "Ursarctic Big Dipper" from your Deck
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(id,0))
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCountLimit(1,id)
e3:SetCondition(s.accon)
e3:SetOperation(s.acop)
c:RegisterEffect(e3)
--Add to hand or Special Summon 1 "Ursarctic" monster from the GY
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(id,1))
e4:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOHAND)
e4:SetType(EFFECT_TYPE_IGNITION)
e4:SetRange(LOCATION_MZONE)
e4:SetCountLimit(1,{id,1})
e4:SetCost(aux.CostWithReplace(s.cost,CARD_URSARCTIC_BIG_DIPPER,s.extracon))
e4:SetTarget(s.target)
e4:SetOperation(s.operation)
c:RegisterEffect(e4)
end
s.listed_series={SET_URSARCTIC}
s.listed_names={CARD_URSARCTIC_BIG_DIPPER}
Expand Down Expand Up @@ -83,50 +77,51 @@ function s.sprop(e,tp,eg,ep,ev,re,r,rp,c)
if not g then return end
Duel.SendtoGrave(g,REASON_COST)
end
function s.fieldfilter(c,tp)
function s.actfilter(c,tp)
return c:IsCode(CARD_URSARCTIC_BIG_DIPPER) and c:GetActivateEffect() and c:GetActivateEffect():IsActivatable(tp,true,true)
end
function s.accon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(s.fieldfilter,tp,LOCATION_DECK,0,1,nil,tp)
function s.acttg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.actfilter,tp,LOCATION_DECK,0,1,nil,tp) end
end
function s.acop(e,tp,eg,ep,ev,re,r,rp)
function s.actop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOFIELD)
local tc=Duel.SelectMatchingCard(tp,s.fieldfilter,tp,LOCATION_DECK,0,1,1,nil,tp):GetFirst()
Duel.ActivateFieldSpell(tc,e,tp,eg,ep,ev,re,r,rp)
local sc=Duel.SelectMatchingCard(tp,s.actfilter,tp,LOCATION_DECK,0,1,1,nil,tp):GetFirst()
if sc then
Duel.ActivateFieldSpell(sc,e,tp,eg,ep,ev,re,r,rp)
end
end
function s.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroupCost(tp,Card.IsLevelAbove,1,false,nil,nil,7) end
local sg=Duel.SelectReleaseGroupCost(tp,Card.IsLevelAbove,1,1,false,nil,nil,7)
Duel.Release(sg,REASON_COST)
function s.thspcostfilter(c,e,tp)
return c:IsLevelAbove(7) and Duel.IsExistingMatchingCard(s.thspfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp,Duel.GetMZoneCount(tp,c)>0)
end
function s.extracon(base,c,e,tp)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
return Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_GRAVE,0,1,c,ft,base,tp)
function s.thspfilter(c,e,tp,mmz_chk)
return (c:IsSetCard(SET_URSARCTIC) and c:IsMonster()) and (c:IsAbleToHand() or (mmz_chk and c:IsCanBeSpecialSummoned(e,0,tp,false,false)))
end
function s.filter(c,ft,e,tp)
return (c:IsSetCard(SET_URSARCTIC) and c:IsMonster()) and (c:IsAbleToHand() or (ft>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false)))
function s.thspcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroupCost(tp,s.thspcostfilter,1,false,nil,nil,e,tp) end
local g=Duel.SelectReleaseGroupCost(tp,s.thspcostfilter,1,1,false,nil,nil,e,tp)
Duel.Release(g,REASON_COST)
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
return Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_GRAVE,0,1,nil,ft,e,tp)
end
function s.thsptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,nil,1,tp,0)
Duel.SetPossibleOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_GRAVE)
Duel.SetPossibleOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE)
end
function s.operation(e,tp,eg,ep,ev,re,r,rp)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SELF)
local tc=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_GRAVE,0,1,1,nil,ft,e,tp):GetFirst()
if tc then
aux.ToHandOrElse(tc,tp,
function(tc)
return ft>0 and tc:IsCanBeSpecialSummoned(e,0,tp,false,false)
function s.thspop(e,tp,eg,ep,ev,re,r,rp)
local mmz_chk=Duel.GetLocationCount(tp,LOCATION_MZONE)>0
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(id,2))
local sc=Duel.SelectMatchingCard(tp,s.thspfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp,mmz_chk):GetFirst()
if not sc then return end
aux.ToHandOrElse(sc,tp,
function()
return mmz_chk and sc:IsCanBeSpecialSummoned(e,0,tp,false,false)
end,
function(tc)
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
function()
Duel.SpecialSummon(sc,0,tp,tp,false,false,POS_FACEUP)
end,
aux.Stringid(id,1))
end
aux.Stringid(id,3)
)
end
function s.extracon(base,e,tp,eg,ep,ev,re,r,rp,c)
return Duel.IsExistingMatchingCard(s.thspfilter,tp,LOCATION_GRAVE,0,1,c,e,tp,Duel.GetLocationCount(tp,LOCATION_MZONE)>0)
end
Loading