diff --git a/cards_specific_functions.lua b/cards_specific_functions.lua index 7041d8a810..704059d2c9 100644 --- a/cards_specific_functions.lua +++ b/cards_specific_functions.lua @@ -276,47 +276,21 @@ function Auxiliary.MaleficSummonOperation(cd,loc) end end ---Discard cost for Witchcrafter monsters, supports the replacements from the Continuous Spells -local Witchcrafter={} -function Witchcrafter.DiscardSpell(c) - return c:IsDiscardable() and c:IsSpell() -end -function Witchcrafter.DiscardCost(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return Duel.IsExistingMatchingCard(Witchcrafter.DiscardSpell,tp,LOCATION_HAND,0,1,nil) end - Duel.DiscardHand(tp,Witchcrafter.DiscardSpell,1,1,REASON_COST+REASON_DISCARD) -end -Auxiliary.WitchcrafterDiscardCost=Auxiliary.CostWithReplace(Witchcrafter.DiscardCost,EFFECT_WITCHCRAFTER_REPLACE) +Witchcrafter={} -function Witchcrafter.ReleaseCost(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return e:GetHandler():IsReleasable() end - Duel.Release(e:GetHandler(),REASON_COST) -end -Auxiliary.WitchcrafterDiscardAndReleaseCost=Auxiliary.CostWithReplace(Witchcrafter.DiscardCost,EFFECT_WITCHCRAFTER_REPLACE,nil,Witchcrafter.ReleaseCost) +Witchcrafter.DiscardCost=Cost.Replaceable(Cost.Discard(Card.IsSpell)) +Witchcrafter.TributeAndDiscardCost=Cost.AND(Cost.SelfTribute,Witchcrafter.DiscardCost) -function Witchcrafter.repcon(e) - return e:GetHandler():IsAbleToGraveAsCost() -end -function Witchcrafter.repval(base,e,tp,eg,ep,ev,re,r,rp,chk,extracon) - local c=e:GetHandler() - return c:IsControler(tp) and c:IsMonster() and c:IsSetCard(SET_WITCHCRAFTER) -end -function Witchcrafter.repop(id) - return function(base,e,tp,eg,ep,ev,re,r,rp) - Duel.Hint(HINT_CARD,0,id) - Duel.SendtoGrave(base:GetHandler(),REASON_COST) - end -end -function Auxiliary.CreateWitchcrafterReplace(c,id) +function Witchcrafter.CreateCostReplaceEffect(c) local e=Effect.CreateEffect(c) e:SetType(EFFECT_TYPE_FIELD) - e:SetCode(EFFECT_WITCHCRAFTER_REPLACE) e:SetProperty(EFFECT_FLAG_PLAYER_TARGET) + e:SetCode(EFFECT_COST_REPLACE) e:SetTargetRange(1,0) - e:SetRange(LOCATION_SZONE) - e:SetCountLimit(1,id) - e:SetCondition(Witchcrafter.repcon) - e:SetValue(Witchcrafter.repval) - e:SetOperation(Witchcrafter.repop(id)) + e:SetValue(function(base,extracon,e,tp) + local c=e:GetHandler() + return c:IsSetCard(SET_WITCHCRAFTER) and c:IsControler(tp) and c:IsLocation(LOCATION_MZONE) + end) return e end @@ -532,14 +506,6 @@ function Auxiliary.IceBarrierDiscardCost(f,discard,minc,maxc) end end ---Function to be used as the target for "S-Force" effects that apply to monsters in the same column as your "S-Force" monsters -function Auxiliary.SForceTarget(e,cc) - local function filter(c,tp) - return c:IsControler(tp) and c:IsFaceup() and c:IsMonster() and c:IsSetCard(SET_S_FORCE) - end - return cc:GetColumnGroup():IsExists(filter,1,cc,e:GetHandlerPlayer()) -end - -- Description: Checks for whether the equip card still has the equip effect once it reaches SZONE -- This is used to correct the interaction between Phantom of Chaos (or alike) and any monsters that equip themselves to another function Auxiliary.ZWEquipLimit(tc,te) @@ -708,72 +674,90 @@ function Auxiliary.AddAmazementQuickEquipEffect(c,id) e2:SetOperation(AA.qeqeop) c:RegisterEffect(e2) end --- Cost for "S-Force" cards that banish a card from the hand, needed for "S-Force Chase" (55049722) from LIOV -local SForce={} -function SForce.CostFilter(c) - return c:IsSetCard(SET_S_FORCE) and c:IsAbleToRemoveAsCost() -end -function SForce.Cost(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return Duel.IsExistingMatchingCard(SForce.CostFilter,tp,LOCATION_HAND,0,1,nil) end - Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) - local rg=Duel.SelectMatchingCard(tp,SForce.CostFilter,tp,LOCATION_HAND,0,1,1,nil) - Duel.Remove(rg,POS_FACEUP,REASON_COST) -end -Auxiliary.SForceCost=Auxiliary.CostWithReplace(SForce.Cost,CARD_SFORCE_CHASE) ---Standard functions for the "Ursarctic" Special Summoning Quick Effects -local Ursarctic={} -function Ursarctic.spcfilter(c) - return c:IsLocation(LOCATION_HAND) and c:IsLevelAbove(7) -end -function Ursarctic.spcost(e,tp,eg,ep,ev,re,r,rp,chk) - local c=e:GetHandler() - if chk==0 then return Duel.CheckReleaseGroupCost(tp,Ursarctic.spcfilter,1,true,nil,c) end - local g=Duel.SelectReleaseGroupCost(tp,Ursarctic.spcfilter,1,1,true,nil,c) - Duel.Release(g,REASON_COST) -end -function Ursarctic.summontarget(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 - and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end - Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0) + + +SForce={} +do + local function cost_filter(c) + return c:IsSetCard(SET_S_FORCE) and c:IsAbleToRemoveAsCost() + end + + SForce.BanishCost=Cost.Replaceable(function(e,tp,eg,ep,ev,re,r,rp,chk) + if chk==0 then return Duel.IsExistingMatchingCard(cost_filter,tp,LOCATION_HAND,0,1,nil) end + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) + local rg=Duel.SelectMatchingCard(tp,cost_filter,tp,LOCATION_HAND,0,1,1,nil) + Duel.Remove(rg,POS_FACEUP,REASON_COST) + end) + + local function column_filter(c,tp) + return c:IsSetCard(SET_S_FORCE) and c:IsMonster() and c:IsControler(tp) and c:IsFaceup() + end + + function SForce.ColumnTarget(e,cc) + return cc:GetColumnGroup():IsExists(column_filter,1,cc,e:GetHandlerPlayer()) + end end -function Ursarctic.summonoperation(id) - return function(e,tp,eg,ep,ev,re,r,rp) + +Ursarctic={} +do + local function spcostfilter(c) + return c:IsLevelAbove(7) and c:IsLocation(LOCATION_HAND) + end + + local function spcost(e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() - if c:IsRelateToEffect(e) then - Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP) + if chk==0 then return Duel.CheckReleaseGroupCost(tp,spcostfilter,1,true,nil,c) end + local g=Duel.SelectReleaseGroupCost(tp,spcostfilter,1,1,true,nil,c) + Duel.Release(g,REASON_COST) + end + + local function sptg(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) end + Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,tp,0) + end + + local function spop(id) + return function(e,tp,eg,ep,ev,re,r,rp) + local c=e:GetHandler() + if c:IsRelateToEffect(e) then + Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP) + end + --You cannot Special Summon for the rest of this turn, except monsters with a Level + local e1=Effect.CreateEffect(c) + e1:SetDescription(aux.Stringid(id,1)) + e1:SetType(EFFECT_TYPE_FIELD) + e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CLIENT_HINT) + e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON) + e1:SetTargetRange(1,0) + e1:SetTarget(function(e,c) return not c:IsLevelAbove(0) end) + e1:SetReset(RESET_PHASE|PHASE_END) + Duel.RegisterEffect(e1,tp) end - --Cannot Special Summon, except monsters with a Level + end + + function Ursarctic.CreateSpSummonQuickEffect(c,id) + --During the Main Phase (Quick Effect): You can Tribute 1 other Level 7 or higher monster from your hand; Special Summon this card from your hand, also you cannot Special Summon for the rest of this turn, except monsters with a Level local e1=Effect.CreateEffect(c) - e1:SetDescription(aux.Stringid(id,1)) - e1:SetType(EFFECT_TYPE_FIELD) - e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON) - e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CLIENT_HINT) - e1:SetTargetRange(1,0) - e1:SetTarget(function(e,c) return not c:IsLevelAbove(0) end) - e1:SetReset(RESET_PHASE+PHASE_END) - Duel.RegisterEffect(e1,tp) + e1:SetDescription(aux.Stringid(id,0)) + e1:SetCategory(CATEGORY_SPECIAL_SUMMON) + e1:SetType(EFFECT_TYPE_QUICK_O) + e1:SetCode(EVENT_FREE_CHAIN) + e1:SetRange(LOCATION_HAND) + e1:SetCountLimit(1,id) + e1:SetCondition(function() return Duel.IsMainPhase() end) + e1:SetCost(Cost.Replaceable(spcost)) + e1:SetTarget(sptg) + e1:SetOperation(spop(id)) + e1:SetHintTiming(0,TIMING_MAIN_END|TIMINGS_CHECK_MONSTER) + return e1 + end + + function Ursarctic.AddSpSummonQuickEffect(c,...) + c:RegisterEffect(Ursarctic.CreateSpSummonQuickEffect(c,...)) end end -function Auxiliary.CreateUrsarcticSpsummon(c,id) - local e1=Effect.CreateEffect(c) - e1:SetCategory(CATEGORY_SPECIAL_SUMMON) - e1:SetType(EFFECT_TYPE_QUICK_O) - e1:SetCode(EVENT_FREE_CHAIN) - e1:SetRange(LOCATION_HAND) - e1:SetHintTiming(0,TIMING_MAIN_END) - e1:SetCountLimit(1,id) - e1:SetCondition(function() return Duel.IsMainPhase() end) - e1:SetCost(Auxiliary.CostWithReplace(Ursarctic.spcost,CARD_URSARCTIC_BIG_DIPPER)) - e1:SetTarget(Ursarctic.summontarget) - e1:SetOperation(Ursarctic.summonoperation(id)) - return e1 -end -local Stardust={} -function Stardust.ReleaseSelfCost(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return e:GetHandler():IsReleasable() end - Duel.Release(e:GetHandler(),REASON_COST) -end -Auxiliary.StardustCost=Auxiliary.CostWithReplace(Stardust.ReleaseSelfCost,84012625) function Auxiliary.DoubleSnareValidity(c,range,property) if c then @@ -864,35 +848,41 @@ function Cyberdark.EquipOperation_NTG(f,op) 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 Duel.GetMZoneCount(tp,c)>0 -end -function Drytron.TributeBaseCost(e,tp,eg,ep,ev,re,r,rp,chk) - 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 - --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:SetTargetRange(1,0) - e1:SetTarget(function(e,c) return c:IsSummonableCard() end) - e1:SetReset(RESET_PHASE|PHASE_END) - Duel.RegisterEffect(e1,tp) +do + local function tribute_cost_filter(c,tp) + return ((c:IsSetCard(SET_DRYTRON) and c:IsMonster()) or c:IsRitualMonster()) and (c:IsControler(tp) or c:IsFaceup()) + and Duel.GetMZoneCount(tp,c)>0 + end + + local function tribute_base_cost(e,tp,eg,ep,ev,re,r,rp,chk) + local c=e:GetHandler() + if chk==0 then return Duel.CheckReleaseGroupCost(tp,tribute_cost_filter,1,true,nil,c,tp) end + local sg=Duel.SelectReleaseGroupCost(tp,tribute_cost_filter,1,1,true,nil,c,tp) + Duel.Release(sg,REASON_COST) + end + + local function extracon(base,e,tp,eg,ep,ev,re,r,rp) + return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 + end + + local function tribute_extra_cost(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 + --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:SetTargetRange(1,0) + e1:SetTarget(function(e,c) return c:IsSummonableCard() end) + e1:SetReset(RESET_PHASE|PHASE_END) + Duel.RegisterEffect(e1,tp) + end + + Drytron.TributeCost=Cost.AND(Cost.Replaceable(tribute_base_cost,extracon),tribute_extra_cost) end -Drytron.TributeCost=aux.CostWithReplace(Drytron.TributeBaseCost,CARD_URSARCTIC_DRYTRON,Drytron.ExtraCon,Drytron.TributeExtraCost) --[[ Effect.CreateMysteruneQPEffect(c,id,[uniquecat,uniquetg,uniqueop,rmcount,uniqueprop,uniquecode]) @@ -1043,48 +1033,33 @@ Effect.CreateMysteruneQPEffect = (function() end end)() ---[[ - Effect.CreateVernalizerSPEffect(c,id,desc,uniquecat,uniquetg,uniqueop) - - Creates an ignition Effect object for the "Vernusylph" effects that - discard themselves and another card from the hand. - Includes handling for "Vernusylph Corolla" cost replacement. - - Card c: the owner of the Effect - int id: the card ID used for the HOPT restriction and strings - int desc: the string ID of the effect description (will also be used for the limitcount code) - int uniquecat: the category of the unique effect - function uniquetg: the target function for the effect - function uniqueop: the unique effect's operation function, excluding the special summoning and lingering restriction, - the function must return true to proceed to the special summon, - it can also return an optional passcode (int) which will be excluded from the special summon ---]] -Effect.CreateVernalizerSPEffect=(function() +Vernusylph={} +do local stringbase=9350312 -- use strings from "Flourishing Hils" so they don't need to be stored in every card - local function verncostfilter(c) + local function spcostfilter(c) return (c:IsMonster() or c:IsSetCard(SET_VERNUSYLPH)) and c:IsDiscardable() end - local function verncost(e,tp,eg,ep,ev,re,r,rp,chk) + local function spcost(e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() - if chk==0 then return c:IsDiscardable() and Duel.IsExistingMatchingCard(verncostfilter,tp,LOCATION_HAND,0,1,c) end + if chk==0 then return c:IsDiscardable() and Duel.IsExistingMatchingCard(spcostfilter,tp,LOCATION_HAND,0,1,c) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISCARD) - local g=Duel.SelectMatchingCard(tp,verncostfilter,tp,LOCATION_HAND,0,1,1,c) + local g=Duel.SelectMatchingCard(tp,spcostfilter,tp,LOCATION_HAND,0,1,1,c) Duel.SendtoGrave(g+c,REASON_COST+REASON_DISCARD) end - local function vernspfilter(c,e,tp,code) + local function spfilter(c,e,tp,code) return c:IsAttribute(ATTRIBUTE_EARTH) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and not (code and c:IsCode(code)) end - local function vernop(uniqueop,e,tp,eg,ep,ev,re,r,rp) + local function spop(uniqueop,e,tp,eg,ep,ev,re,r,rp) local proceed,exemptID=uniqueop(e,tp,eg,ep,ev,re,r,rp) if proceed and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 - and Duel.IsExistingMatchingCard(aux.NecroValleyFilter(vernspfilter),tp,LOCATION_GRAVE,0,1,nil,e,tp,exemptID) + and Duel.IsExistingMatchingCard(aux.NecroValleyFilter(spfilter),tp,LOCATION_GRAVE,0,1,nil,e,tp,exemptID) and Duel.SelectYesNo(tp,aux.Stringid(stringbase,1)) then Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) - local sg=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(vernspfilter),tp,LOCATION_GRAVE,0,1,1,nil,e,tp,exemptID) + local sg=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(spfilter),tp,LOCATION_GRAVE,0,1,1,nil,e,tp,exemptID) if #sg>0 then Duel.BreakEffect() Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP) @@ -1102,23 +1077,43 @@ Effect.CreateVernalizerSPEffect=(function() Duel.RegisterEffect(e1,tp) end - return function(c,id,desc,uniquecat,uniquetg,uniqueop) + + --[[ + Creates an ignition Effect object for the "Vernusylph" effects that + discard themselves and another card from the hand. + Includes handling for "Vernusylph Corolla" cost replacement. + + Card c: the owner of the Effect + int id: the card ID used for the HOPT restriction and strings + int desc: the string ID of the effect description (will also be used for the limitcount code) + int uniquecat: the category of the unique effect + function uniquetg: the target function for the effect + function uniqueop: the unique effect's operation function, excluding the special summoning and lingering restriction, + the function must return true to proceed to the special summon, + it can also return an optional passcode (int) which will be excluded from the special summon + --]] + + function Vernusylph.CreateSpSummonEffect(c,id,desc,uniquecat,uniquetg,uniqueop) local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,desc)) e1:SetCategory(uniquecat|CATEGORY_SPECIAL_SUMMON) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_HAND) e1:SetCountLimit(1,{id,desc}) - e1:SetCost(aux.CostWithReplace(verncost,CARD_VERNUSYLPH_COROLLA)) + e1:SetCost(Cost.Replaceable(spcost)) e1:SetTarget(function(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return uniquetg(e,tp,eg,ep,ev,re,r,rp,chk) end uniquetg(e,tp,eg,ep,ev,re,r,rp,chk) Duel.SetPossibleOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE) end) - e1:SetOperation(function(...) vernop(uniqueop,...) end) + e1:SetOperation(function(...) spop(uniqueop,...) end) return e1 end -end)() + + function Vernusylph.AddSpSummonEffect(c,...) + c:RegisterEffect(Vernusylph.CreateSpSummonEffect(c,...)) + end +end --[[ Handles the additional destruction effect for diff --git a/constant.lua b/constant.lua index ccf5435045..b8e4ab3fc1 100644 --- a/constant.lua +++ b/constant.lua @@ -630,6 +630,7 @@ EFFECT_ORICHALCUM_CHAIN = 511002116 EFFECT_DOUBLE_XYZ_MATERIAL = 511001225 EFFECT_SATELLARKNIGHT_CAPELLA = 86466163 EFFECT_STAR_SERAPH_SOVEREIGNTY = 91110378 +EFFECT_COST_REPLACE = 84012625 --Events EVENT_STARTUP = 1000 EVENT_FLIP = 1001 diff --git a/official/c10266279.lua b/official/c10266279.lua index 7a730acb8f..2f38b45f8d 100644 --- a/official/c10266279.lua +++ b/official/c10266279.lua @@ -24,7 +24,7 @@ function s.initial_effect(c) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetRange(LOCATION_MZONE) e2:SetCountLimit(1,{id,1}) - e2:SetCost(aux.CostWithReplace(s.mdescost,EFFECT_POWER_PATRON_REPLACE)) + e2:SetCost(Cost.Replaceable(s.mdescost)) e2:SetTarget(s.mdestg) e2:SetOperation(s.mdesop) c:RegisterEffect(e2) @@ -131,4 +131,4 @@ function s.thop(e,tp,eg,ep,ev,re,r,rp) Duel.HintSelection(g) Duel.SendtoHand(g,nil,REASON_EFFECT) end -end \ No newline at end of file +end diff --git a/official/c14108995.lua b/official/c14108995.lua index c9ba552a19..73672229b2 100644 --- a/official/c14108995.lua +++ b/official/c14108995.lua @@ -22,7 +22,7 @@ function s.initial_effect(c) e3:SetDescription(aux.Stringid(id,0)) e3:SetType(EFFECT_TYPE_FIELD) e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET) - e3:SetCode(CARD_VERNUSYLPH_COROLLA) + e3:SetCode(EFFECT_COST_REPLACE) e3:SetRange(LOCATION_SZONE) e3:SetTargetRange(LOCATION_HAND,0) e3:SetCountLimit(1) @@ -31,16 +31,18 @@ function s.initial_effect(c) c:RegisterEffect(e3) end s.listed_series={SET_VERNUSYLPH} -function s.repval(base,e,tp,eg,ep,ev,re,r,rp,chk,extracon) +function s.repval(base,extracon,e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() return c:IsMonster() and c:IsSetCard(SET_VERNUSYLPH) and c:IsDiscardable() end +function s.hintselectionfilter(c) + return c:IsCode(id) and not c:HasFlagEffect(id) +end function s.repop(base,e,tp,eg,ep,ev,re,r,rp) - Duel.Hint(HINT_CARD,0,id) local c=base:GetHandler() - if #{Duel.GetPlayerEffect(tp,CARD_VERNUSYLPH_COROLLA)}>1 then - Duel.HintSelection(c,true) + if Duel.IsExistingMatchingCard(s.hintselectionfilter,tp,LOCATION_SZONE,0,1,c) then + Duel.HintSelection(c) end c:RegisterFlagEffect(id,RESETS_STANDARD_PHASE_END,EFFECT_FLAG_CLIENT_HINT,1,nil,aux.Stringid(id,1)) Duel.SendtoGrave(e:GetHandler(),REASON_COST|REASON_DISCARD) -end \ No newline at end of file +end diff --git a/official/c1527418.lua b/official/c1527418.lua index c7e7617253..16c94b9b06 100644 --- a/official/c1527418.lua +++ b/official/c1527418.lua @@ -23,7 +23,7 @@ function s.initial_effect(c) e2:SetRange(LOCATION_MZONE) e2:SetCountLimit(1,{id,1}) e2:SetCondition(s.negcon) - e2:SetCost(aux.CostWithReplace(s.negcost,EFFECT_FUR_HIRE_REPLACE)) + e2:SetCost(Cost.Replaceable(s.negcost)) e2:SetTarget(s.negtg) e2:SetOperation(s.negop) c:RegisterEffect(e2) @@ -62,4 +62,4 @@ function s.negtg(e,tp,eg,ep,ev,re,r,rp,chk) end function s.negop(e,tp,eg,ep,ev,re,r,rp) Duel.NegateActivation(ev) -end \ No newline at end of file +end diff --git a/official/c16471775.lua b/official/c16471775.lua index 2369b692f4..965bdb7886 100644 --- a/official/c16471775.lua +++ b/official/c16471775.lua @@ -19,7 +19,7 @@ function s.initial_effect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetType(EFFECT_TYPE_FIELD) e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET) - e2:SetCode(CARD_URSARCTIC_BIG_DIPPER) + e2:SetCode(EFFECT_COST_REPLACE) e2:SetRange(LOCATION_GRAVE) e2:SetTargetRange(1,0) e2:SetCountLimit(1,{id,1}) @@ -44,11 +44,10 @@ function s.activate(e,tp,eg,ep,ev,re,r,rp) Duel.ConfirmCards(1-tp,g) end end -function s.repval(base,e,tp,eg,ep,ev,re,r,rp,chk,extracon) +function s.repval(base,extracon,e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() - return c:IsSetCard(SET_URSARCTIC) and c:IsMonster() and (extracon==nil or extracon(base,e,tp,eg,ep,ev,re,r,rp)) + return c:IsSetCard(SET_URSARCTIC) and c:IsMonster() and 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 \ No newline at end of file +end diff --git a/official/c16940215.lua b/official/c16940215.lua index 597becdfb4..f6f00a408e 100644 --- a/official/c16940215.lua +++ b/official/c16940215.lua @@ -11,7 +11,7 @@ function s.initial_effect(c) e1:SetCode(EVENT_CHAINING) e1:SetRange(LOCATION_MZONE) e1:SetCondition(s.discon) - e1:SetCost(aux.CostWithReplace(s.discost,CARD_NATURIA_CAMELLIA)) + e1:SetCost(Cost.Replaceable(s.discost)) e1:SetTarget(s.distg) e1:SetOperation(s.disop) c:RegisterEffect(e1) @@ -43,4 +43,4 @@ function s.disop(e,tp,eg,ep,ev,re,r,rp) if Duel.NegateActivation(ev) and re:GetHandler():IsRelateToEffect(re) then Duel.Destroy(eg,REASON_EFFECT) end -end \ No newline at end of file +end diff --git a/official/c17473466.lua b/official/c17473466.lua index 0da36e515d..e7cab99297 100644 --- a/official/c17473466.lua +++ b/official/c17473466.lua @@ -19,7 +19,7 @@ function s.initial_effect(c) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetRange(LOCATION_MZONE) e2:SetCountLimit(1,{id,0}) - e2:SetCost(aux.CostWithReplace(s.descost,EFFECT_POWER_PATRON_REPLACE)) + e2:SetCost(Cost.Replaceable(s.descost)) e2:SetTarget(s.destg) e2:SetOperation(s.desop) c:RegisterEffect(e2) @@ -107,4 +107,4 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp) if #g>0 then Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP) end -end \ No newline at end of file +end diff --git a/official/c19605133.lua b/official/c19605133.lua index 81680d240e..1c57c3b25f 100644 --- a/official/c19605133.lua +++ b/official/c19605133.lua @@ -20,7 +20,7 @@ function s.initial_effect(c) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetProperty(EFFECT_FLAG_CARD_TARGET) e2:SetRange(LOCATION_MZONE) - e2:SetCost(aux.CostWithReplace(s.atcost,CARD_NATURIA_CAMELLIA)) + e2:SetCost(Cost.Replaceable(s.atcost)) e2:SetTarget(s.attg) e2:SetOperation(s.atop) c:RegisterEffect(e2) @@ -65,4 +65,4 @@ function s.atop(e,tp,eg,ep,ev,re,r,rp) e1:SetReset(RESETS_STANDARD_PHASE_END) tc:RegisterEffect(e1) end -end \ No newline at end of file +end diff --git a/official/c19673561.lua b/official/c19673561.lua index 1b48ed9133..a921f616f5 100644 --- a/official/c19673561.lua +++ b/official/c19673561.lua @@ -22,8 +22,12 @@ function s.initial_effect(c) e2:SetOperation(s.drop) c:RegisterEffect(e2) --replace discard effect - local e2=aux.CreateWitchcrafterReplace(c,id) + local e2=Witchcrafter.CreateCostReplaceEffect(c) e2:SetDescription(aux.Stringid(id,2)) + e2:SetRange(LOCATION_SZONE) + e2:SetCountLimit(1,id) + e2:SetCondition(function(base) return base:GetHandler():IsAbleToGraveAsCost() end) + e2:SetOperation(function(base) Duel.SendtoGrave(base:GetHandler(),REASON_COST) end) c:RegisterEffect(e2) --to S/T Zone local e4=Effect.CreateEffect(c) @@ -77,4 +81,4 @@ function s.tfop(e,tp,eg,ep,ev,re,r,rp) if c:IsRelateToEffect(e) then Duel.MoveToField(c,tp,tp,LOCATION_SZONE,POS_FACEUP,true) end -end \ No newline at end of file +end diff --git a/official/c20515672.lua b/official/c20515672.lua index ecfb9807bb..f25a5463d9 100644 --- a/official/c20515672.lua +++ b/official/c20515672.lua @@ -18,7 +18,7 @@ function s.initial_effect(c) e1b:SetRange(LOCATION_MZONE) e1b:SetLabelObject(e1a) e1b:SetTargetRange(0,LOCATION_MZONE) - e1b:SetTarget(aux.SForceTarget) + e1b:SetTarget(SForce.ColumnTarget) c:RegisterEffect(e1b) --Shuffle 1 "S-Force" monster into the Deck and Special Summon banished "S-Force" monster local e2=Effect.CreateEffect(c) @@ -69,4 +69,4 @@ function s.tdop(e,tp,eg,ep,ev,re,r,rp) Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP) end end -end \ No newline at end of file +end diff --git a/official/c21368442.lua b/official/c21368442.lua index 376553cf96..4b026b85c6 100644 --- a/official/c21368442.lua +++ b/official/c21368442.lua @@ -25,7 +25,7 @@ function s.initial_effect(c) e3:SetCode(EFFECT_LEAVE_FIELD_REDIRECT) e3:SetTargetRange(0,LOCATION_MZONE) e3:SetValue(LOCATION_REMOVED) - e3:SetTarget(aux.SForceTarget) + e3:SetTarget(SForce.ColumnTarget) c:RegisterEffect(e3) end s.listed_series={SET_S_FORCE} @@ -43,4 +43,4 @@ function s.thop(e,tp,eg,ep,ev,re,r,rp) Duel.SendtoHand(g,nil,REASON_EFFECT) Duel.ConfirmCards(1-tp,g) end -end \ No newline at end of file +end diff --git a/official/c21522601.lua b/official/c21522601.lua index cf186c1605..54318b538c 100644 --- a/official/c21522601.lua +++ b/official/c21522601.lua @@ -23,7 +23,7 @@ function s.initial_effect(c) e2:SetCode(EVENT_FREE_CHAIN) e2:SetRange(LOCATION_MZONE) e2:SetCountLimit(1,{id,1}) - e2:SetCost(aux.WitchcrafterDiscardCost) + e2:SetCost(Witchcrafter.DiscardCost) e2:SetTarget(s.distg) e2:SetOperation(s.disop) c:RegisterEffect(e2) @@ -72,4 +72,4 @@ function s.disop(e,tp,eg,ep,ev,re,r,rp) for tc in g:Iter() do tc:NegateEffects(c,RESET_PHASE|PHASE_END) end -end \ No newline at end of file +end diff --git a/official/c21744288.lua b/official/c21744288.lua index 0b74fdfe8f..19aef5dddb 100644 --- a/official/c21744288.lua +++ b/official/c21744288.lua @@ -13,7 +13,7 @@ function s.initial_effect(c) e1:SetCountLimit(1,id) e1:SetHintTiming(0,TIMING_MAIN_END) e1:SetCondition(function() return Duel.IsMainPhase() end) - e1:SetCost(aux.WitchcrafterDiscardAndReleaseCost) + e1:SetCost(Witchcrafter.TributeAndDiscardCost) e1:SetTarget(s.sptarget) e1:SetOperation(s.spop) c:RegisterEffect(e1) @@ -60,4 +60,4 @@ function s.tgop(e,tp,eg,ep,ev,re,r,rp) if #g>0 then Duel.SendtoGrave(g,REASON_EFFECT) end -end \ No newline at end of file +end diff --git a/official/c22180094.lua b/official/c22180094.lua index 25331fc170..2e4c9878dc 100644 --- a/official/c22180094.lua +++ b/official/c22180094.lua @@ -12,7 +12,7 @@ function s.initial_effect(c) e1:SetRange(LOCATION_MZONE) e1:SetHintTiming(0,TIMING_MAIN_END|TIMING_SUMMON|TIMING_SPSUMMON) e1:SetCountLimit(1,id) - e1:SetCost(aux.SForceCost) + e1:SetCost(SForce.BanishCost) e1:SetTarget(s.thtg) e1:SetOperation(s.thop) c:RegisterEffect(e1) @@ -28,7 +28,7 @@ function s.initial_effect(c) e2:SetRange(LOCATION_MZONE) e2:SetLabelObject(e2a) e2:SetTargetRange(0,LOCATION_MZONE) - e2:SetTarget(aux.SForceTarget) + e2:SetTarget(SForce.ColumnTarget) c:RegisterEffect(e2) end s.listed_series={SET_S_FORCE} @@ -54,4 +54,4 @@ function s.thop(e,tp,eg,ep,ev,re,r,rp) Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP_DEFENSE) end end -end \ No newline at end of file +end diff --git a/official/c25725326.lua b/official/c25725326.lua index 56779badea..8139b39d80 100644 --- a/official/c25725326.lua +++ b/official/c25725326.lua @@ -19,7 +19,7 @@ function s.initial_effect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetType(EFFECT_TYPE_FIELD) e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET) - e1:SetCode(CARD_PRANKKIDS_MEOWMU) + e1:SetCode(EFFECT_COST_REPLACE) e1:SetRange(LOCATION_MZONE|LOCATION_GRAVE) e1:SetTargetRange(1,0) e1:SetCountLimit(1,id) @@ -44,12 +44,11 @@ function s.regop(e,tp,eg,ep,ev,re,r,rp) e1:SetReset(RESET_PHASE|PHASE_END) Duel.RegisterEffect(e1,tp) end -function s.repval(base,e,tp,eg,ep,ev,re,r,rp,chk,extracon) +function s.repval(base,extracon,e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() 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)) + and 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 \ No newline at end of file +end diff --git a/official/c27383719.lua b/official/c27383719.lua index c4f99def1b..cb36d10ea6 100644 --- a/official/c27383719.lua +++ b/official/c27383719.lua @@ -21,7 +21,7 @@ function s.initial_effect(c) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetRange(LOCATION_MZONE) e2:SetCountLimit(1,{id,1}) - e2:SetCost(aux.SForceCost) + e2:SetCost(SForce.BanishCost) e2:SetTarget(s.destg) e2:SetOperation(s.desop) c:RegisterEffect(e2) @@ -46,7 +46,7 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp) end end function s.desfilter(c,e) - return aux.SForceTarget(e,c) + return SForce.ColumnTarget(e,c) end function s.destg(e,tp,eg,ep,ev,re,r,rp,chk) local g=Duel.GetMatchingGroup(s.desfilter,tp,0,LOCATION_MZONE,nil,e) @@ -58,4 +58,4 @@ function s.desop(e,tp,eg,ep,ev,re,r,rp) if #g>0 then Duel.Destroy(g,REASON_EFFECT) end -end \ No newline at end of file +end diff --git a/official/c27693363.lua b/official/c27693363.lua index 29d312b16b..31f11c2c2e 100644 --- a/official/c27693363.lua +++ b/official/c27693363.lua @@ -31,7 +31,7 @@ function s.initial_effect(c) 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:SetCost(Cost.Replaceable(s.thspcost,s.extracon)) e2:SetTarget(s.thsptg) e2:SetOperation(s.thspop) c:RegisterEffect(e2) @@ -124,4 +124,4 @@ function s.thspop(e,tp,eg,ep,ev,re,r,rp) 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 \ No newline at end of file +end diff --git a/official/c28715905.lua b/official/c28715905.lua index 6c585cf898..7153fd8c6d 100644 --- a/official/c28715905.lua +++ b/official/c28715905.lua @@ -4,7 +4,7 @@ local s,id=GetID() function s.initial_effect(c) --special summon - c:RegisterEffect(aux.CreateUrsarcticSpsummon(c,id)) + Ursarctic.AddSpSummonQuickEffect(c,id) --Pop local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) @@ -42,4 +42,4 @@ function s.popop(e,tp,eg,ep,ev,re,r,rp) if tc and tc:IsRelateToEffect(e) then Duel.Destroy(tc,REASON_EFFECT) end -end \ No newline at end of file +end diff --git a/official/c29537493.lua b/official/c29537493.lua index 8821f06133..6ceda21e8c 100644 --- a/official/c29537493.lua +++ b/official/c29537493.lua @@ -4,7 +4,7 @@ local s,id=GetID() function s.initial_effect(c) --special summon - c:RegisterEffect(aux.CreateUrsarcticSpsummon(c,id)) + Ursarctic.AddSpSummonQuickEffect(c,id) --to hand local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,0)) @@ -32,4 +32,4 @@ function s.thop(e,tp,eg,ep,ev,re,r,rp) Duel.SendtoHand(g,nil,REASON_EFFECT) Duel.ConfirmCards(1-tp,g) end -end \ No newline at end of file +end diff --git a/official/c29942771.lua b/official/c29942771.lua index 79ac33ed49..f46da6e868 100644 --- a/official/c29942771.lua +++ b/official/c29942771.lua @@ -22,7 +22,7 @@ function s.initial_effect(c) e3:SetDescription(aux.Stringid(id,1)) e3:SetType(EFFECT_TYPE_FIELD) e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET) - e3:SetCode(CARD_NATURIA_CAMELLIA) + e3:SetCode(EFFECT_COST_REPLACE) e3:SetRange(LOCATION_MZONE) e3:SetTargetRange(1,0) e3:SetCountLimit(1,{id,1}) @@ -62,12 +62,11 @@ function s.tgop(e,tp,eg,ep,ev,re,r,rp) Duel.SendtoGrave(g,REASON_EFFECT) end end -function s.repval(base,e,tp,eg,ep,ev,re,r,rp,chk,extracon) +function s.repval(base,extracon,e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() - return c:IsSetCard(SET_NATURIA) and c:IsMonster() and (extracon==nil or extracon(base,e,tp,eg,ep,ev,re,r,rp)) + return c:IsSetCard(SET_NATURIA) and c:IsMonster() and 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.DiscardDeck(tp,2,REASON_COST) end function s.spfilter(c,e,tp) @@ -84,4 +83,4 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp) if #g>0 then Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP) end -end \ No newline at end of file +end diff --git a/official/c30983281.lua b/official/c30983281.lua index 7d23d7e736..1ca3da9a64 100644 --- a/official/c30983281.lua +++ b/official/c30983281.lua @@ -27,7 +27,7 @@ function s.initial_effect(c) e2:SetHintTiming(0,TIMING_MAIN_END|TIMINGS_CHECK_MONSTER) e2:SetCountLimit(1,{id,2}) e2:SetCondition(function() return Duel.IsMainPhase() end) - e2:SetCost(aux.CostWithReplace(Cost.AND(Cost.SelfTribute,s.exspcost),84012625,s.extracon)) + e2:SetCost(Cost.Replaceable(Cost.AND(Cost.SelfTribute,s.exspcost),s.extracon)) e2:SetTarget(s.exsptg) e2:SetOperation(s.exspop) c:RegisterEffect(e2) @@ -95,4 +95,4 @@ function s.exspop(e,tp,eg,ep,ev,re,r,rp) end function s.extracon(base,e,tp,eg,ep,ev,re,r,rp) return Duel.IsExistingMatchingCard(s.exspfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp) -end \ No newline at end of file +end diff --git a/official/c36745317.lua b/official/c36745317.lua index ea800556d0..abbf0dd97c 100644 --- a/official/c36745317.lua +++ b/official/c36745317.lua @@ -15,7 +15,7 @@ function s.initial_effect(c) e1:SetOperation(s.atkop) c:RegisterEffect(e1) --Send 1 EARTH monster to the GY - c:RegisterEffect(Effect.CreateVernalizerSPEffect(c,id,1,CATEGORY_TOGRAVE,s.tgtg,s.tgop)) + Vernusylph.AddSpSummonEffect(c,id,1,CATEGORY_TOGRAVE,s.tgtg,s.tgop) end s.listed_series={SET_VERNUSYLPH} function s.atktg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) @@ -50,4 +50,4 @@ function s.tgop(e,tp,eg,ep,ev,re,r,rp) if tc and Duel.SendtoGrave(tc,REASON_EFFECT)>0 and tc:IsLocation(LOCATION_GRAVE) then return true,tc:GetCode() end -end \ No newline at end of file +end diff --git a/official/c38916526.lua b/official/c38916526.lua index 8c8d850ade..d804d10c31 100644 --- a/official/c38916526.lua +++ b/official/c38916526.lua @@ -23,7 +23,7 @@ function s.initial_effect(c) e2:SetRange(LOCATION_MZONE) e2:SetCountLimit(1,{id,1}) e2:SetCondition(s.negcon) - e2:SetCost(aux.CostWithReplace(s.negcost,EFFECT_FUR_HIRE_REPLACE)) + e2:SetCost(Cost.Replaceable(s.negcost)) e2:SetTarget(s.negtg) e2:SetOperation(s.negop) c:RegisterEffect(e2) @@ -79,4 +79,4 @@ function s.negop(e,tp,eg,ep,ev,re,r,rp) if Duel.NegateActivation(ev) and re:IsHasType(EFFECT_TYPE_ACTIVATE) and re:GetHandler():IsRelateToEffect(re) then Duel.SendtoGrave(eg,REASON_EFFECT) end -end \ No newline at end of file +end diff --git a/official/c43871165.lua b/official/c43871165.lua index 519c0e67e5..dc716cec8c 100644 --- a/official/c43871165.lua +++ b/official/c43871165.lua @@ -21,7 +21,7 @@ function s.initial_effect(c) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetRange(LOCATION_MZONE) e2:SetCountLimit(1,{id,1}) - e2:SetCost(aux.CostWithReplace(s.mdescost,EFFECT_POWER_PATRON_REPLACE)) + e2:SetCost(Cost.Replaceable(s.mdescost)) e2:SetTarget(s.mdestg) e2:SetOperation(s.mdesop) c:RegisterEffect(e2) @@ -140,4 +140,4 @@ function s.thop(e,tp,eg,ep,ev,re,r,rp) Duel.SendtoHand(g,nil,REASON_EFFECT) Duel.ConfirmCards(1-tp,g) end -end \ No newline at end of file +end diff --git a/official/c43886072.lua b/official/c43886072.lua index 9f2685aaa3..810e237f06 100644 --- a/official/c43886072.lua +++ b/official/c43886072.lua @@ -26,7 +26,7 @@ function s.initial_effect(c) e2:SetCountLimit(1,id) e2:SetHintTiming(0,TIMINGS_CHECK_MONSTER_E|TIMING_MAIN_END) e2:SetCondition(s.thcon) - e2:SetCost(aux.CostWithReplace(Cost.SelfTribute,CARD_PRANKKIDS_MEOWMU)) + e2:SetCost(Cost.Replaceable(Cost.SelfTribute)) e2:SetTarget(s.thtg) e2:SetOperation(s.thop) c:RegisterEffect(e2) @@ -69,4 +69,4 @@ function s.thop(e,tp,eg,ep,ev,re,r,rp) end function s.indtg(e,c) return c:IsSetCard(SET_PRANK_KIDS) -end \ No newline at end of file +end diff --git a/official/c44508094.lua b/official/c44508094.lua index 56b6b76db8..8b8607361d 100644 --- a/official/c44508094.lua +++ b/official/c44508094.lua @@ -14,7 +14,7 @@ function s.initial_effect(c) e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL) e1:SetRange(LOCATION_MZONE) e1:SetCondition(s.condition) - e1:SetCost(aux.StardustCost) + e1:SetCost(Cost.Replaceable(Cost.SelfTribute)) e1:SetTarget(s.target) e1:SetOperation(s.operation) c:RegisterEffect(e1) @@ -60,4 +60,4 @@ function s.sumop(e,tp,eg,ep,ev,re,r,rp) if e:GetHandler():IsRelateToEffect(e) then Duel.SpecialSummon(e:GetHandler(),0,tp,tp,false,false,POS_FACEUP) end -end \ No newline at end of file +end diff --git a/official/c44509529.lua b/official/c44509529.lua index e7b4335867..73e4f5be77 100644 --- a/official/c44509529.lua +++ b/official/c44509529.lua @@ -27,7 +27,7 @@ function s.initial_effect(c) e2:SetCountLimit(1,id) e2:SetHintTiming(0,TIMING_STANDBY_PHASE|TIMING_MAIN_END|TIMINGS_CHECK_MONSTER_E) e2:SetCondition(function(e,tp) return Duel.IsTurnPlayer(1-tp) end) - e2:SetCost(aux.CostWithReplace(Cost.SelfTribute,CARD_PRANKKIDS_MEOWMU,s.extracon)) + e2:SetCost(Cost.Replaceable(Cost.SelfTribute,s.extracon)) e2:SetTarget(s.sptg) e2:SetOperation(s.spop) c:RegisterEffect(e2) @@ -81,4 +81,4 @@ function s.extracon(base,e,tp,eg,ep,ev,re,r,rp) if Duel.GetMZoneCount(tp,repl_c)<2 then return false end local g=Duel.GetMatchingGroup(s.spfilter,tp,LOCATION_GRAVE,0,repl_c,e,tp) return aux.SelectUnselectGroup(g,e,tp,2,2,aux.dncheck,0) -end \ No newline at end of file +end diff --git a/official/c53557529.lua b/official/c53557529.lua index 24f6c511a0..cea677aafb 100644 --- a/official/c53557529.lua +++ b/official/c53557529.lua @@ -19,13 +19,13 @@ function s.initial_effect(c) local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_FIELD) e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET) - e2:SetCode(EFFECT_FUR_HIRE_REPLACE) + e2:SetCode(EFFECT_COST_REPLACE) e2:SetRange(LOCATION_GRAVE) e2:SetTargetRange(1,0) e2:SetCountLimit(1,{id,1}) e2:SetCondition(function(e) return e:GetHandler():IsAbleToRemoveAsCost() end) e2:SetValue(s.repval) - e2:SetOperation(function(base,e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_CARD,0,id) Duel.Remove(base:GetHandler(),POS_FACEUP,REASON_COST) end) + e2:SetOperation(function(base) Duel.Remove(base:GetHandler(),POS_FACEUP,REASON_COST) end) c:RegisterEffect(e2) end s.listed_series={SET_FUR_HIRE} @@ -69,7 +69,7 @@ function s.activate(e,tp,eg,ep,ev,re,r,rp) e1:SetReset(RESET_PHASE|PHASE_END) Duel.RegisterEffect(e1,tp) end -function s.repval(base,e,tp,eg,ep,ev,re,r,rp,chk) +function s.repval(base,extracon,e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() return c:IsSetCard(SET_FUR_HIRE) and c:IsFaceup() and c:IsControler(tp) and c:IsLocation(LOCATION_MZONE) -end \ No newline at end of file +end diff --git a/official/c54700519.lua b/official/c54700519.lua index 76fce48ccb..56a6ba0bf1 100644 --- a/official/c54700519.lua +++ b/official/c54700519.lua @@ -4,7 +4,7 @@ local s,id=GetID() function s.initial_effect(c) --special summon - c:RegisterEffect(aux.CreateUrsarcticSpsummon(c,id)) + Ursarctic.AddSpSummonQuickEffect(c,id) --Change Position local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) @@ -42,4 +42,4 @@ function s.posop(e,tp,eg,ep,ev,re,r,rp) if tc and tc:IsRelateToEffect(e) then Duel.ChangePosition(tc,POS_FACEDOWN_DEFENSE) end -end \ No newline at end of file +end diff --git a/official/c55049722.lua b/official/c55049722.lua index 827b0a339b..9c0b3074bf 100644 --- a/official/c55049722.lua +++ b/official/c55049722.lua @@ -16,10 +16,10 @@ function s.initial_effect(c) c:RegisterEffect(e1) --Cost replacement for "S-Force" monsters that would banish cards to activate their effects local e2=Effect.CreateEffect(c) - e2:SetType(EFFECT_TYPE_FIELD) e2:SetDescription(aux.Stringid(id,1)) + e2:SetType(EFFECT_TYPE_FIELD) e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET) - e2:SetCode(EFFECT_SFORCE_REPLACE) + e2:SetCode(EFFECT_COST_REPLACE) e2:SetRange(LOCATION_GRAVE) e2:SetTargetRange(1,0) e2:SetCountLimit(1,{id,1}) @@ -47,12 +47,11 @@ end function s.repcon(e) return e:GetHandler():IsAbleToRemoveAsCost() end -function s.repval(base,e,tp,eg,ep,ev,re,r,rp,chk) +function s.repval(base,extracon,e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() return c:IsFaceup() and c:IsControler(tp) and c:IsLocation(LOCATION_MZONE) and c:IsSetCard(SET_S_FORCE) 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) -end \ No newline at end of file +end diff --git a/official/c55936191.lua b/official/c55936191.lua index b20a203f58..0b326b6596 100644 --- a/official/c55936191.lua +++ b/official/c55936191.lua @@ -3,7 +3,7 @@ local s,id=GetID() function s.initial_effect(c) --special summon - c:RegisterEffect(aux.CreateUrsarcticSpsummon(c,id)) + Ursarctic.AddSpSummonQuickEffect(c,id) --to hand local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,0)) @@ -32,4 +32,4 @@ function s.thop(e,tp,eg,ep,ev,re,r,rp) if tc:IsRelateToEffect(e) then Duel.SendtoHand(tc,nil,REASON_EFFECT) end -end \ No newline at end of file +end diff --git a/official/c58139997.lua b/official/c58139997.lua index 19db63005c..341b74d7c6 100644 --- a/official/c58139997.lua +++ b/official/c58139997.lua @@ -12,7 +12,7 @@ function s.initial_effect(c) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1,id) e1:SetHintTiming(0,TIMING_MAIN_END|TIMING_END_PHASE) - e1:SetCost(aux.WitchcrafterDiscardCost) + e1:SetCost(Witchcrafter.DiscardCost) e1:SetTarget(s.sptg) e1:SetOperation(s.spop) c:RegisterEffect(e1) @@ -63,4 +63,4 @@ function s.spop2(e,tp,eg,ep,ev,re,r,rp) if tc:IsRelateToEffect(e) then Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP) end -end \ No newline at end of file +end diff --git a/official/c58363151.lua b/official/c58363151.lua index af2f20bb29..78b9d06df6 100644 --- a/official/c58363151.lua +++ b/official/c58363151.lua @@ -24,7 +24,7 @@ function s.initial_effect(c) e3:SetCode(EFFECT_UPDATE_ATTACK) e3:SetRange(LOCATION_MZONE) e3:SetTargetRange(0,LOCATION_MZONE) - e3:SetTarget(aux.SForceTarget) + e3:SetTarget(SForce.ColumnTarget) e3:SetValue(-600) c:RegisterEffect(e3) end @@ -51,4 +51,4 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp) if tc:IsRelateToEffect(e) then Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP) end -end \ No newline at end of file +end diff --git a/official/c58589739.lua b/official/c58589739.lua index c0b633f9e2..262121f474 100644 --- a/official/c58589739.lua +++ b/official/c58589739.lua @@ -24,7 +24,7 @@ function s.initial_effect(c) e2:SetCode(EFFECT_CANNOT_CHANGE_POSITION) e2:SetProperty(EFFECT_FLAG_SET_AVAILABLE) e2:SetTargetRange(0,LOCATION_MZONE) - e2:SetTarget(aux.SForceTarget) + e2:SetTarget(SForce.ColumnTarget) c:RegisterEffect(e2) end s.listed_series={SET_S_FORCE} @@ -43,4 +43,4 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp) if tc:IsRelateToEffect(e) then Duel.ChangePosition(tc,POS_FACEUP_DEFENSE,POS_FACEDOWN_DEFENSE,POS_FACEUP_ATTACK,POS_FACEUP_ATTACK) end -end \ No newline at end of file +end diff --git a/official/c59851535.lua b/official/c59851535.lua index 3b785fc9b5..f5edfc7b44 100644 --- a/official/c59851535.lua +++ b/official/c59851535.lua @@ -13,7 +13,7 @@ function s.initial_effect(c) e1:SetCountLimit(1,id) e1:SetHintTiming(0,TIMING_MAIN_END) e1:SetCondition(function() return Duel.IsMainPhase() end) - e1:SetCost(aux.WitchcrafterDiscardAndReleaseCost) + e1:SetCost(Witchcrafter.TributeAndDiscardCost) e1:SetTarget(s.sptg) e1:SetOperation(s.spop) c:RegisterEffect(e1) @@ -67,4 +67,4 @@ function s.thop(e,tp,eg,ep,ev,re,r,rp) if tc:IsRelateToEffect(e) then Duel.SendtoHand(tc,nil,REASON_EFFECT) end -end \ No newline at end of file +end diff --git a/official/c61257789.lua b/official/c61257789.lua index ea9a0d3c66..8346c79163 100644 --- a/official/c61257789.lua +++ b/official/c61257789.lua @@ -19,7 +19,7 @@ function s.initial_effect(c) e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL) e2:SetRange(LOCATION_MZONE) e2:SetCondition(s.negcon) - e2:SetCost(aux.StardustCost) + e2:SetCost(Cost.Replaceable(Cost.SelfTribute)) e2:SetTarget(s.negtg) e2:SetOperation(s.negop) c:RegisterEffect(e2) @@ -94,4 +94,4 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp) if tc and tc:IsRelateToEffect(e) then Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP) end -end \ No newline at end of file +end diff --git a/official/c62133026.lua b/official/c62133026.lua index 7dec266d6f..6f80fb3703 100644 --- a/official/c62133026.lua +++ b/official/c62133026.lua @@ -14,7 +14,7 @@ function s.initial_effect(c) e1:SetValue(aux.tgoval) c:RegisterEffect(e1) --Add 1 "Vernalizer Fairy" card from the GY to the hand - c:RegisterEffect(Effect.CreateVernalizerSPEffect(c,id,0,CATEGORY_TOHAND,s.thtg,s.thop)) + Vernusylph.AddSpSummonEffect(c,id,0,CATEGORY_TOHAND,s.thtg,s.thop) end s.listed_names={id} s.listed_series={SET_VERNUSYLPH} @@ -32,4 +32,4 @@ function s.thop(e,tp,eg,ep,ev,re,r,rp) Duel.ConfirmCards(1-tp,g) return true end -end \ No newline at end of file +end diff --git a/official/c62714453.lua b/official/c62714453.lua index eea206d634..db500c8d85 100644 --- a/official/c62714453.lua +++ b/official/c62714453.lua @@ -21,7 +21,7 @@ function s.initial_effect(c) e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_MZONE) - e1:SetCost(aux.CostWithReplace(s.spcost,CARD_URSARCTIC_BIG_DIPPER,s.extracon)) + e1:SetCost(Cost.Replaceable(s.spcost,s.extracon)) e1:SetTarget(s.sptg) e1:SetOperation(s.spop) c:RegisterEffect(e1) @@ -118,4 +118,4 @@ function s.aclimit(e,re,tp) end function s.extracon(base,e,tp,eg,ep,ev,re,r,rp) return Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp) -end \ No newline at end of file +end diff --git a/official/c64756282.lua b/official/c64756282.lua index 8d1ef2d2c3..ddf76692cd 100644 --- a/official/c64756282.lua +++ b/official/c64756282.lua @@ -13,7 +13,7 @@ function s.initial_effect(c) e1:SetCountLimit(1,id) e1:SetHintTiming(0,TIMING_MAIN_END|TIMINGS_CHECK_MONSTER) e1:SetCondition(function() return Duel.IsMainPhase() end) - e1:SetCost(aux.WitchcrafterDiscardAndReleaseCost) + e1:SetCost(Witchcrafter.TributeAndDiscardCost) e1:SetTarget(s.sptg) e1:SetOperation(s.spop) c:RegisterEffect(e1) @@ -73,4 +73,4 @@ function s.effop(e,tp,eg,ep,ev,re,r,rp) if op then op(e,tp,eg,ep,ev,re,r,rp) end -end \ No newline at end of file +end diff --git a/official/c65479980.lua b/official/c65479980.lua index 120eefa7a8..932e400018 100644 --- a/official/c65479980.lua +++ b/official/c65479980.lua @@ -27,7 +27,7 @@ function s.initial_effect(c) e3:SetCondition(s.atcon) e3:SetValue(s.atlimit) e3:SetTargetRange(0,LOCATION_MZONE) - e3:SetTarget(aux.SForceTarget) + e3:SetTarget(SForce.ColumnTarget) c:RegisterEffect(e3) end s.listed_series={SET_S_FORCE} @@ -50,4 +50,4 @@ function s.atcon(e) end function s.atlimit(e,c) return not e:GetHandler():GetColumnGroup():IsContains(c) -end \ No newline at end of file +end diff --git a/official/c67466547.lua b/official/c67466547.lua index f993024c80..73fb24dfa8 100644 --- a/official/c67466547.lua +++ b/official/c67466547.lua @@ -23,7 +23,7 @@ function s.initial_effect(c) e2:SetRange(LOCATION_MZONE) e2:SetCountLimit(1,{id,1}) e2:SetCondition(s.drcon) - e2:SetCost(aux.CostWithReplace(s.drcost,EFFECT_FUR_HIRE_REPLACE)) + e2:SetCost(Cost.Replaceable(s.drcost)) e2:SetTarget(s.drtg) e2:SetOperation(s.drop) c:RegisterEffect(e2) @@ -68,4 +68,4 @@ end function s.drop(e,tp,eg,ep,ev,re,r,rp) local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM) Duel.Draw(p,d,REASON_EFFECT) -end \ No newline at end of file +end diff --git a/official/c70875686.lua b/official/c70875686.lua index 20e8a6775e..0c61601531 100644 --- a/official/c70875686.lua +++ b/official/c70875686.lua @@ -20,7 +20,7 @@ function s.initial_effect(c) e1:SetCode(EVENT_FREE_CHAIN) e1:SetRange(LOCATION_MZONE) e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER_E|TIMING_MAIN_END) - e1:SetCost(aux.CostWithReplace(Cost.SelfTribute,CARD_PRANKKIDS_MEOWMU)) + e1:SetCost(Cost.Replaceable(Cost.SelfTribute)) e1:SetTarget(s.destg) e1:SetOperation(s.desop) c:RegisterEffect(e1) @@ -65,4 +65,4 @@ function s.thop(e,tp,eg,ep,ev,re,r,rp) if tc and tc:IsRelateToEffect(e) then Duel.SendtoHand(tc,nil,REASON_EFFECT) end -end \ No newline at end of file +end diff --git a/official/c7478431.lua b/official/c7478431.lua index b29328880b..71d8780b8d 100644 --- a/official/c7478431.lua +++ b/official/c7478431.lua @@ -11,7 +11,7 @@ function s.initial_effect(c) e1:SetCode(EVENT_CHAINING) e1:SetRange(LOCATION_MZONE) e1:SetCondition(s.discon) - e1:SetCost(aux.CostWithReplace(s.discost,CARD_NATURIA_CAMELLIA)) + e1:SetCost(Cost.Replaceable(s.discost)) e1:SetTarget(s.distg) e1:SetOperation(s.disop) c:RegisterEffect(e1) @@ -43,4 +43,4 @@ function s.disop(e,tp,eg,ep,ev,re,r,rp) if Duel.NegateActivation(ev) and re:GetHandler():IsRelateToEffect(re) then Duel.Destroy(eg,REASON_EFFECT) end -end \ No newline at end of file +end diff --git a/official/c74892653.lua b/official/c74892653.lua index bdff78c1a4..43aeaba403 100644 --- a/official/c74892653.lua +++ b/official/c74892653.lua @@ -13,7 +13,7 @@ function s.initial_effect(c) e1:SetCode(EVENT_SPSUMMON) e1:SetRange(LOCATION_MZONE) e1:SetCondition(s.condition) - e1:SetCost(aux.StardustCost) + e1:SetCost(Cost.Replaceable(Cost.SelfTribute)) e1:SetTarget(s.target) e1:SetOperation(s.operation) c:RegisterEffect(e1) @@ -91,4 +91,4 @@ function s.scop(e,tp,eg,ep,ev,re,r,rp) if tc and Duel.SpecialSummon(tc,SUMMON_TYPE_SYNCHRO,tp,tp,false,false,POS_FACEUP)>0 then tc:CompleteProcedure() end -end \ No newline at end of file +end diff --git a/official/c76636978.lua b/official/c76636978.lua index e8b4b413dc..432a42d4bc 100644 --- a/official/c76636978.lua +++ b/official/c76636978.lua @@ -15,7 +15,7 @@ function s.initial_effect(c) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1,{id,0}) e1:SetCondition(s.discon) - e1:SetCost(Cost.AND(aux.StardustCost,Cost.HardOncePerChain(id))) + e1:SetCost(Cost.AND(Cost.Replaceable(Cost.SelfTribute),Cost.HardOncePerChain(id))) e1:SetTarget(s.distg) e1:SetOperation(s.disop) c:RegisterEffect(e1) @@ -86,4 +86,4 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp) if #g>0 then Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP) end -end \ No newline at end of file +end diff --git a/official/c80086070.lua b/official/c80086070.lua index 0477c5dcd8..d13deea3ab 100644 --- a/official/c80086070.lua +++ b/official/c80086070.lua @@ -40,7 +40,7 @@ function s.initial_effect(c) e4:SetRange(LOCATION_MZONE) e4:SetCountLimit(1) e4:SetCondition(s.discon) - e4:SetCost(aux.CostWithReplace(s.discost,CARD_URSARCTIC_BIG_DIPPER)) + e4:SetCost(Cost.Replaceable(s.discost)) e4:SetTarget(s.distg) e4:SetOperation(s.disop) c:RegisterEffect(e4) diff --git a/official/c81108658.lua b/official/c81108658.lua index 2842b2904d..8f455edc12 100644 --- a/official/c81108658.lua +++ b/official/c81108658.lua @@ -4,7 +4,7 @@ local s,id=GetID() function s.initial_effect(c) --special summon - c:RegisterEffect(aux.CreateUrsarcticSpsummon(c,id)) + Ursarctic.AddSpSummonQuickEffect(c,id) --Banish local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) @@ -42,4 +42,4 @@ function s.banop(e,tp,eg,ep,ev,re,r,rp) if tc:IsRelateToEffect(e) then Duel.Remove(tc,POS_FACEUP,REASON_EFFECT) end -end \ No newline at end of file +end diff --git a/official/c81321206.lua b/official/c81321206.lua index a61200745f..6e10d95208 100644 --- a/official/c81321206.lua +++ b/official/c81321206.lua @@ -3,7 +3,7 @@ local s,id=GetID() function s.initial_effect(c) --special summon - c:RegisterEffect(aux.CreateUrsarcticSpsummon(c,id)) + Ursarctic.AddSpSummonQuickEffect(c,id) --spsummon local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,0)) @@ -32,4 +32,4 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp) if #g>0 then Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP) end -end \ No newline at end of file +end diff --git a/official/c81519836.lua b/official/c81519836.lua index 32af864682..d438f2cd22 100644 --- a/official/c81519836.lua +++ b/official/c81519836.lua @@ -13,7 +13,7 @@ function s.initial_effect(c) e1:SetValue(-600) c:RegisterEffect(e1) --Search 1 EARTH Fairy monster - c:RegisterEffect(Effect.CreateVernalizerSPEffect(c,id,0,CATEGORY_TOHAND+CATEGORY_SEARCH,s.thtg,s.thop)) + Vernusylph.AddSpSummonEffect(c,id,0,CATEGORY_TOHAND+CATEGORY_SEARCH,s.thtg,s.thop) end s.listed_names={id} s.listed_series={SET_VERNUSYLPH} @@ -31,4 +31,4 @@ function s.thop(e,tp,eg,ep,ev,re,r,rp) Duel.ConfirmCards(1-tp,g) return true end -end \ No newline at end of file +end diff --git a/official/c81997228.lua b/official/c81997228.lua index 904df04bf6..e531af4913 100644 --- a/official/c81997228.lua +++ b/official/c81997228.lua @@ -20,7 +20,7 @@ function s.initial_effect(c) e1:SetCode(EVENT_FREE_CHAIN) e1:SetRange(LOCATION_MZONE) e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER_E|TIMING_MAIN_END) - e1:SetCost(aux.CostWithReplace(Cost.SelfTribute,CARD_PRANKKIDS_MEOWMU)) + e1:SetCost(Cost.Replaceable(Cost.SelfTribute)) e1:SetTarget(s.destg) e1:SetOperation(s.desop) c:RegisterEffect(e1) @@ -65,4 +65,4 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp,chk) if tc and tc:IsRelateToEffect(e) then Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP) end -end \ No newline at end of file +end diff --git a/official/c83289866.lua b/official/c83289866.lua index 1dfcabce16..80d2c10b09 100644 --- a/official/c83289866.lua +++ b/official/c83289866.lua @@ -18,8 +18,12 @@ function s.initial_effect(c) e2:SetValue(s.indct) c:RegisterEffect(e2) --replace discard effect - local e3=aux.CreateWitchcrafterReplace(c,id) - e3:SetDescription(aux.Stringid(id,2)) + local e3=Witchcrafter.CreateCostReplaceEffect(c) + e3:SetDescription(aux.Stringid(id,0)) + e3:SetRange(LOCATION_SZONE) + e3:SetCountLimit(1,id) + e3:SetCondition(function(base) return base:GetHandler():IsAbleToGraveAsCost() end) + e3:SetOperation(function(base) Duel.SendtoGrave(base:GetHandler(),REASON_COST) end) c:RegisterEffect(e3) --to S/T Zone local e4=Effect.CreateEffect(c) @@ -55,4 +59,4 @@ function s.tfop(e,tp,eg,ep,ev,re,r,rp) if c:IsRelateToEffect(e) then Duel.MoveToField(c,tp,tp,LOCATION_SZONE,POS_FACEUP,true) end -end \ No newline at end of file +end diff --git a/official/c84012625.lua b/official/c84012625.lua index a9399a4eb8..c440e67d8e 100644 --- a/official/c84012625.lua +++ b/official/c84012625.lua @@ -18,7 +18,7 @@ function s.initial_effect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetType(EFFECT_TYPE_FIELD) e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET) - e2:SetCode(84012625) + e2:SetCode(EFFECT_COST_REPLACE) e2:SetRange(LOCATION_GRAVE) e2:SetTargetRange(1,0) e2:SetCondition(function(e) return e:GetHandler():IsAbleToRemoveAsCost() end) @@ -61,12 +61,11 @@ function s.tdop(e,tp,eg,ep,ev,re,r,rp) local bc1=Duel.GetBattleMonster(tp) Duel.SendtoDeck(bc1:GetBattleTarget(),nil,SEQ_DECKSHUFFLE,REASON_EFFECT) end -function s.repval(base,e,tp,eg,ep,ev,re,r,rp,chk,extracon) +function s.repval(base,extracon,e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() return c:IsSetCard(SET_STARDUST) and c:IsType(TYPE_SYNCHRO) and c:IsControler(tp) and c:IsLocation(LOCATION_MZONE) - and c:IsFaceup() and (extracon==nil or extracon(base,e,tp,eg,ep,ev,re,r,rp)) + and c:IsFaceup() and 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 \ No newline at end of file +end diff --git a/official/c84523092.lua b/official/c84523092.lua index 38b74bad6a..1f579e2ca5 100644 --- a/official/c84523092.lua +++ b/official/c84523092.lua @@ -23,7 +23,7 @@ function s.initial_effect(c) e2:SetRange(LOCATION_MZONE) e2:SetCountLimit(1,id) e2:SetHintTiming(0,TIMINGS_CHECK_MONSTER_E) - e2:SetCost(aux.WitchcrafterDiscardCost) + e2:SetCost(Witchcrafter.DiscardCost) e2:SetTarget(s.destg) e2:SetOperation(s.desop) c:RegisterEffect(e2) @@ -43,4 +43,4 @@ function s.desop(e,tp,eg,ep,ev,re,r,rp) if tc:IsRelateToEffect(e) then Duel.Destroy(tc,REASON_EFFECT) end -end \ No newline at end of file +end diff --git a/official/c84905691.lua b/official/c84905691.lua index 3412bb6864..d0d0f8a918 100644 --- a/official/c84905691.lua +++ b/official/c84905691.lua @@ -9,7 +9,7 @@ function s.initial_effect(c) e1:SetType(EFFECT_TYPE_QUICK_O) e1:SetCode(EVENT_SPSUMMON_SUCCESS) e1:SetRange(LOCATION_MZONE) - e1:SetCost(aux.CostWithReplace(s.descost,CARD_NATURIA_CAMELLIA)) + e1:SetCost(Cost.Replaceable(s.descost)) e1:SetTarget(s.destg) e1:SetOperation(s.desop) c:RegisterEffect(e1) @@ -36,4 +36,4 @@ function s.desop(e,tp,eg,ep,ev,re,r,rp) if #g>0 then Duel.Destroy(g,REASON_EFFECT) end -end \ No newline at end of file +end diff --git a/official/c89264428.lua b/official/c89264428.lua index 992209f702..a4dbd26aa2 100644 --- a/official/c89264428.lua +++ b/official/c89264428.lua @@ -15,7 +15,7 @@ function s.initial_effect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetType(EFFECT_TYPE_FIELD) e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET) - e1:SetCode(CARD_URSARCTIC_BIG_DIPPER) + e1:SetCode(EFFECT_COST_REPLACE) e1:SetRange(LOCATION_FZONE) e1:SetTargetRange(1,0) e1:SetCountLimit(1) @@ -48,18 +48,17 @@ s.listed_series={SET_URSARCTIC} s.counter_place_list={COUNTER_BIG_DIPPER} function s.repconfilter(c,extracon,base,e,tp,eg,ep,ev,re,r,rp) return c:IsLevelAbove(7) and c:IsSetCard(SET_URSARCTIC) and c:IsAbleToRemoveAsCost() - and (extracon==nil or extracon(base,e,tp,eg,ep,ev,re,r,rp,c)) + and (not extracon or extracon(base,e,tp,eg,ep,ev,re,r,rp,c)) end function s.repcon(e) return Duel.IsExistingMatchingCard(s.repconfilter,e:GetHandlerPlayer(),LOCATION_GRAVE,0,1,nil) end -function s.repval(base,e,tp,eg,ep,ev,re,r,rp,chk,extracon) +function s.repval(base,extracon,e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() return c:IsSetCard(SET_URSARCTIC) and c:IsMonster() - and (extracon==nil or Duel.IsExistingMatchingCard(s.repconfilter,e:GetHandlerPlayer(),LOCATION_GRAVE,0,1,nil,extracon,base,e,tp,eg,ep,ev,re,r,rp)) + and Duel.IsExistingMatchingCard(s.repconfilter,e:GetHandlerPlayer(),LOCATION_GRAVE,0,1,nil,extracon,base,e,tp,eg,ep,ev,re,r,rp) end -function s.repop(base,e,tp,eg,ep,ev,re,r,rp,chk,extracon) - Duel.Hint(HINT_CARD,0,id) +function s.repop(base,e,tp,eg,ep,ev,re,r,rp,chk) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) local g=Duel.SelectMatchingCard(tp,s.repconfilter,tp,LOCATION_GRAVE,0,1,1,nil,extracon,base,e,tp,eg,ep,ev,re,r,rp) Duel.Remove(g,POS_FACEUP,REASON_COST|REASON_REPLACE) @@ -85,4 +84,4 @@ function s.ctrlop(e,tp,eg,ep,ev,re,r,rp) if tc:IsRelateToEffect(e) then Duel.GetControl(tc,tp) end -end \ No newline at end of file +end diff --git a/official/c89771220.lua b/official/c89771220.lua index 2b1845f4ea..23d59de1d4 100644 --- a/official/c89771220.lua +++ b/official/c89771220.lua @@ -17,7 +17,7 @@ function s.initial_effect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetType(EFFECT_TYPE_FIELD) e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET) - e2:SetCode(CARD_URSARCTIC_BIG_DIPPER) + e2:SetCode(EFFECT_COST_REPLACE) e2:SetRange(LOCATION_GRAVE) e2:SetTargetRange(1,0) e2:SetCountLimit(1,id) @@ -25,9 +25,6 @@ function s.initial_effect(c) e2:SetValue(s.repval) e2:SetOperation(s.repop) c:RegisterEffect(e2) - local e3=e2:Clone() - e3:SetCode(CARD_URSARCTIC_DRYTRON) - c:RegisterEffect(e3) end s.listed_names={33250142,CARD_URSARCTIC_BIG_DIPPER,58793369,27693363,97148796} --"Ultimate Flagship Ursatron", "Ursarctic Big Dipper", "Drytron Fafnir", "Ursarctic Polari", "Drytron Alpha Thuban" @@ -69,13 +66,12 @@ function s.activate(e,tp,eg,ep,ev,re,r,rp) if Duel.SpecialSummon(sc,0,tp,tp,true,false,POS_FACEUP)>0 then sc:CompleteProcedure() end - end + end end -function s.repval(base,e,tp,eg,ep,ev,re,r,rp,chk,extracon) +function s.repval(base,extracon,e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() - return c:IsSetCard({SET_URSARCTIC,SET_DRYTRON}) and c:IsMonster() and (extracon==nil or extracon(base,e,tp,eg,ep,ev,re,r,rp)) + return c:IsSetCard({SET_URSARCTIC,SET_DRYTRON}) and c:IsMonster() and 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 \ No newline at end of file +end diff --git a/official/c91864689.lua b/official/c91864689.lua index fdf4be53d0..bbb79d1938 100644 --- a/official/c91864689.lua +++ b/official/c91864689.lua @@ -24,7 +24,7 @@ function s.initial_effect(c) e3:SetCode(EFFECT_CANNOT_BE_LINK_MATERIAL) e3:SetValue(s.sumlimit) e3:SetTargetRange(0,LOCATION_MZONE) - e3:SetTarget(aux.SForceTarget) + e3:SetTarget(SForce.ColumnTarget) c:RegisterEffect(e3) end s.listed_series={SET_S_FORCE} @@ -47,4 +47,4 @@ end function s.sumlimit(e,c) if not c then return false end return c:IsLinkAbove(3) -end \ No newline at end of file +end diff --git a/official/c9238125.lua b/official/c9238125.lua index 3871bdadd0..1568559def 100644 --- a/official/c9238125.lua +++ b/official/c9238125.lua @@ -15,7 +15,7 @@ function s.initial_effect(c) e1:SetOperation(s.atkop) c:RegisterEffect(e1) --Draw 1 card - c:RegisterEffect(Effect.CreateVernalizerSPEffect(c,id,1,CATEGORY_DRAW,s.drtg,s.drop)) + Vernusylph.AddSpSummonEffect(c,id,1,CATEGORY_DRAW,s.drtg,s.drop) end s.listed_series={SET_VERNUSYLPH} function s.atktg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) @@ -48,4 +48,4 @@ end function s.drop(e,tp,eg,ep,ev,re,r,rp) local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM) return Duel.Draw(p,d,REASON_EFFECT)>0 -end \ No newline at end of file +end diff --git a/official/c93454062.lua b/official/c93454062.lua index d61c182302..95917e2335 100644 --- a/official/c93454062.lua +++ b/official/c93454062.lua @@ -13,7 +13,7 @@ function s.initial_effect(c) e1:SetCountLimit(1,id) e1:SetHintTiming(0,TIMING_MAIN_END|TIMINGS_CHECK_MONSTER) e1:SetCondition(function() return Duel.IsMainPhase() end) - e1:SetCost(aux.CostWithReplace(Cost.SelfTribute,CARD_NATURIA_CAMELLIA,function(base,e,tp,eg,ep,ev,re,r,rp) return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 end)) + e1:SetCost(Cost.Replaceable(Cost.SelfTribute,function(base,e,tp) return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 end)) e1:SetTarget(s.decksptg) e1:SetOperation(s.deckspop) c:RegisterEffect(e1) @@ -71,4 +71,4 @@ function s.selfspop(e,tp,eg,ep,ev,re,r,rp) if c:IsRelateToEffect(e) then Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP) end -end \ No newline at end of file +end diff --git a/official/c9350312.lua b/official/c9350312.lua index 6e2108803d..fb616553e8 100644 --- a/official/c9350312.lua +++ b/official/c9350312.lua @@ -13,7 +13,7 @@ function s.initial_effect(c) e1:SetValue(1) c:RegisterEffect(e1) --Search 1 "Vernalizer Fairy" card - c:RegisterEffect(Effect.CreateVernalizerSPEffect(c,id,0,CATEGORY_TOHAND+CATEGORY_SEARCH,s.thtg,s.thop)) + Vernusylph.AddSpSummonEffect(c,id,0,CATEGORY_TOHAND+CATEGORY_SEARCH,s.thtg,s.thop) end s.listed_names={id} s.listed_series={SET_VERNUSYLPH} @@ -31,4 +31,4 @@ function s.thop(e,tp,eg,ep,ev,re,r,rp) Duel.ConfirmCards(1-tp,g) return true end -end \ No newline at end of file +end diff --git a/official/c95245544.lua b/official/c95245544.lua index 96169663fa..0179eecaa4 100644 --- a/official/c95245544.lua +++ b/official/c95245544.lua @@ -13,7 +13,7 @@ function s.initial_effect(c) e1:SetCountLimit(1,id) e1:SetHintTiming(0,TIMING_MAIN_END) e1:SetCondition(function() return Duel.IsMainPhase() end) - e1:SetCost(aux.WitchcrafterDiscardAndReleaseCost) + e1:SetCost(Witchcrafter.TributeAndDiscardCost) e1:SetTarget(s.sptg) e1:SetOperation(s.spop) c:RegisterEffect(e1) @@ -68,4 +68,4 @@ function s.drop(e,tp,eg,ep,ev,re,r,rp) Duel.Remove(g2,POS_FACEUP,REASON_EFFECT) end end -end \ No newline at end of file +end diff --git a/official/c95974848.lua b/official/c95974848.lua index 1e98c7c17d..c78e225b59 100644 --- a/official/c95974848.lua +++ b/official/c95974848.lua @@ -12,7 +12,7 @@ function s.initial_effect(c) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1,id) e1:SetCondition(s.condition) - e1:SetCost(aux.SForceCost) + e1:SetCost(SForce.BanishCost) e1:SetTarget(s.target) e1:SetOperation(s.operation) c:RegisterEffect(e1) @@ -23,7 +23,7 @@ function s.initial_effect(c) e2:SetRange(LOCATION_MZONE) e2:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE) e2:SetTargetRange(0,LOCATION_MZONE) - e2:SetTarget(aux.SForceTarget) + e2:SetTarget(SForce.ColumnTarget) e2:SetValue(aux.tgoval) c:RegisterEffect(e2) end @@ -40,4 +40,4 @@ function s.operation(e,tp,eg,ep,ev,re,r,rp) if re:GetHandler():IsRelateToEffect(re) then Duel.Destroy(eg,REASON_EFFECT) end -end \ No newline at end of file +end diff --git a/pre-release/c101305055.lua b/pre-release/c101305055.lua index 93c3fd3638..0a8473e4f5 100644 --- a/pre-release/c101305055.lua +++ b/pre-release/c101305055.lua @@ -17,7 +17,7 @@ function s.initial_effect(c) local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_FIELD) e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET) - e2:SetCode(EFFECT_POWER_PATRON_REPLACE) + e2:SetCode(EFFECT_COST_REPLACE) e2:SetRange(LOCATION_GRAVE) e2:SetTargetRange(1,0) e2:SetCountLimit(1,{id,1}) @@ -66,11 +66,10 @@ function s.inactop(e,tp,eg,ep,ev,re,r,rp) end end end -function s.repval(base,e,tp,eg,ep,ev,re,r,rp,chk) +function s.repval(base,extracon,e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() return c:IsSetCard(SET_POWER_PATRON) and c:IsFaceup() and c:IsControler(tp) and c:IsLocation(LOCATION_MZONE) 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) -end \ No newline at end of file +end diff --git a/unofficial/c513000075.lua b/unofficial/c513000075.lua index 9ba9275506..fb6cb223c2 100644 --- a/unofficial/c513000075.lua +++ b/unofficial/c513000075.lua @@ -37,7 +37,7 @@ function s.initial_effect(c) e3:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL) e3:SetRange(LOCATION_MZONE) e3:SetCondition(s.condition) - e3:SetCost(aux.StardustCost) + e3:SetCost(Cost.Replaceable(Cost.SelfTribute)) e3:SetTarget(s.target) e3:SetOperation(s.operation) c:RegisterEffect(e3) @@ -113,4 +113,4 @@ function s.sumop(e,tp,eg,ep,ev,re,r,rp) if e:GetHandler():IsRelateToEffect(e) then Duel.SpecialSummon(e:GetHandler(),0,tp,tp,false,false,POS_FACEUP) end -end \ No newline at end of file +end diff --git a/utility.lua b/utility.lua index fb8035ac42..376c1a22fd 100644 --- a/utility.lua +++ b/utility.lua @@ -120,84 +120,6 @@ if not c946 then c946.initial_effect=function()end end -local function cost_replace_getvalideffs(replacecode,extracon,e,tp,eg,ep,ev,re,r,rp,chk) - local t={} - for _,eff in ipairs({Duel.GetPlayerEffect(tp,replacecode)}) do - if eff:CheckCountLimit(tp) then - local val=eff:GetValue() - if type(val)=="number" then - if val==1 then - table.insert(t,eff) - end - elseif type(val)=="function" then - if val(eff,e,tp,eg,ep,ev,re,r,rp,chk,extracon) then - table.insert(t,eff) - end - end - end - end - return t -end - -function Auxiliary.CostWithReplace(base,replacecode,extracon,alwaysexecute) - return function(e,tp,eg,ep,ev,re,r,rp,chk) - if alwaysexecute and not alwaysexecute(e,tp,eg,ep,ev,re,r,rp,0) then return false end - local cost_chk=base(e,tp,eg,ep,ev,re,r,rp,0) - if chk==0 then - if cost_chk then return true end - for _,eff in ipairs({Duel.GetPlayerEffect(tp,replacecode)}) do - if eff:CheckCountLimit(tp) then - local val=eff:GetValue() - if type(val)=="number" and val==1 then return true end - if type(val)=="function" and val(eff,e,tp,eg,ep,ev,re,r,rp,chk,extracon) then return true end - end - end - return false - end - local effs=cost_replace_getvalideffs(replacecode,extracon,e,tp,eg,ep,ev,re,r,rp,chk) - if alwaysexecute then alwaysexecute(e,tp,eg,ep,ev,re,r,rp,1) end - if not cost_chk or #effs>0 then - local eff=effs[1] - if #effs>1 then - local effsPerCard={} - local effsHandlersGroup=Group.CreateGroup() - for _,_eff in ipairs(effs) do - local _effCard=_eff:GetHandler() - effsHandlersGroup:AddCard(_effCard) - if not effsPerCard[_effCard] then effsPerCard[_effCard]={} end - table.insert(effsPerCard[_effCard],_eff) - end - local effCard=nil - if #effsHandlersGroup==1 and (not cost_chk or Duel.SelectEffectYesNo(tp,effCard)) then - effCard=effsHandlersGroup:GetFirst() - elseif #effsHandlersGroup>1 then - while effCard==nil and (not cost_chk or Duel.SelectYesNo(tp,98)) do - Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RESOLVEEFFECT) - effCard=effsHandlersGroup:Select(tp,1,1,cost_chk,nil) - end - if effCard then effCard=effCard:GetFirst() end - end - if not effCard then return base(e,tp,eg,ep,ev,re,r,rp,1) end - local effsOfThatCard=effsPerCard[effCard] - if #effsOfThatCard==1 then - eff=effsOfThatCard[1] - else - local desctable={} - for _,_eff in ipairs(effsOfThatCard) do - table.insert(desctable,_eff:GetDescription()) - end - eff=effsOfThatCard[Duel.SelectOption(tp,false,table.unpack(desctable)) + 1] - end - elseif cost_chk and not Duel.SelectEffectYesNo(tp,eff:GetHandler()) then - return base(e,tp,eg,ep,ev,re,r,rp,1) - end - local res={eff:GetOperation()(eff,e,tp,eg,ep,ev,re,r,rp,chk,extracon)} - eff:UseCountLimit(tp) - return table.unpack(res) - end - return base(e,tp,eg,ep,ev,re,r,rp,1) - end -end Card.IsMonster=aux.FilterBoolFunction(Card.IsType,TYPE_MONSTER) @@ -1576,11 +1498,11 @@ end function Cost.Discard(filter,other,min,max,op) local min_type=type(min) local max_type=type(max) - + local function filter_final(c,e,tp) return (not filter or filter(c,e,tp)) and c:IsDiscardable() end - + local function cost_func(e,tp,eg,ep,ev,re,r,rp,chk) local min_count=(min_type=="function" and min(e,tp)) or (min==nil and 1) @@ -1601,11 +1523,11 @@ function Cost.Reveal(filter,other,min,max,op,location) local min_type=type(min) local max_type=type(max) location=location or LOCATION_HAND - + local function filter_final(c,e,tp) return (not filter or filter(c,e,tp)) and not c:IsPublic() end - + local function cost_func(e,tp,eg,ep,ev,re,r,rp,chk) local min_count=(min_type=="function" and min(e,tp)) or (min==nil and 1) @@ -1814,6 +1736,88 @@ function Cost.Choice(...) return full_cost end +local function check_cost_replace_effect(eff,extracon,e,tp,...) + if not eff:CheckCountLimit(tp) then return false end + local val=eff:GetValue() + return val==1 or (type(val)=="function" and val(eff,extracon,e,tp,...)) +end + +local function select_cost_replace_effect(tp,effs) + if #effs==1 then return effs[1] end + local desctable={} + for _,_eff in ipairs(effs) do + table.insert(desctable,_eff:GetDescription()) + end + local op=Duel.SelectOption(tp,false,table.unpack(desctable)) + return effs[op+1] +end + +--if this function returns nil, then the base cost should be used +local function get_cost_replace_effect_to_apply(base_chk,extracon,e,tp,...) + local effs={} + for _,eff in ipairs({Duel.GetPlayerEffect(tp,EFFECT_COST_REPLACE)}) do + if check_cost_replace_effect(eff,extracon,e,tp,...) then table.insert(effs,eff) end + end + + if #effs==0 then return end + + if #effs==1 then + if base_chk and not Duel.SelectEffectYesNo(tp,effs[1]:GetHandler()) then return end + return effs[1] + end + + local effs_per_card={} + local eff_handlers=Group.CreateGroup() + for _,eff in ipairs(effs) do + local ec=eff:GetHandler() + eff_handlers:AddCard(ec) + if not effs_per_card[ec] then effs_per_card[ec]={} end + table.insert(effs_per_card[ec],eff) + end + + if #eff_handlers==1 then + if base_chk and not Duel.SelectEffectYesNo(tp,eff_handlers:GetFirst()) then return end + return select_cost_replace_effect(tp,effs) + end + + local g=nil + while true do + if base_chk and not Duel.SelectYesNo(tp,98) then return end + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RESOLVEEFFECT) + g=eff_handlers:Select(tp,1,1,base_chk,nil) + if g and #g>0 then + return select_cost_replace_effect(tp,effs_per_card[g:GetFirst()]) + end + end +end + +function Cost.Replaceable(base,extracon) + extracon=extracon or aux.TRUE + + return function(e,tp,eg,ep,ev,re,r,rp,chk) + local base_chk=base(e,tp,eg,ep,ev,re,r,rp,0) + + if chk==0 then + if base_chk then return true end + for _,eff in ipairs({Duel.GetPlayerEffect(tp,EFFECT_COST_REPLACE)}) do + if check_cost_replace_effect(eff,extracon,e,tp,eg,ep,ev,re,r,rp,chk) then return true end + end + return false + end + + local eff=get_cost_replace_effect_to_apply(base_chk,extracon,e,tp,eg,ep,ev,re,r,rp,chk) + if not eff then return base(e,tp,eg,ep,ev,re,r,rp,1) end + + Duel.Hint(HINT_CARD,0,eff:GetHandler():GetOriginalCode()) + local res={eff:GetOperation()(eff,e,tp,eg,ep,ev,re,r,rp,chk)} + eff:UseCountLimit(tp) + return table.unpack(res) + end +end + +--temporary alias, to be moved to deprecated aliases +Auxiliary.CostWithReplace=Cost.Replaceable + function Card.EquipByEffectLimit(e,c) if e:GetOwner()~=c then return false end local eff={c:GetCardEffect(89785779+EFFECT_EQUIP_LIMIT)}