Commit 54a71f0c authored by REIKAI's avatar REIKAI 💬

repo 10.9

parent 4af8223b
Pipeline #17117 passed with stages
in 19 minutes and 1 second
No preview for this file type
...@@ -68,6 +68,9 @@ Scl.Global_Reason = nil ...@@ -68,6 +68,9 @@ Scl.Global_Reason = nil
Scl.Extra_Operate_Parama_Check_Hint = would_hint Scl.Extra_Operate_Parama_Check_Hint = would_hint
Scl.Extra_Operate_Parama_Need_Break = need_break Scl.Extra_Operate_Parama_Need_Break = need_break
Scl.Extra_Operate_Parama_Select_Hint = sel_hint Scl.Extra_Operate_Parama_Select_Hint = sel_hint
--Use for Scl.CreateActivateEffect_Activate1ofTheseEffects
Scl.Choose_One_Effect_Condition_Index = nil
Scl.Choose_One_Effect_Select_Index = { }
--Attach extra effect --Attach extra effect
EFFECT_ADDITIONAL_EFFECT_SCL = id + 100 EFFECT_ADDITIONAL_EFFECT_SCL = id + 100
...@@ -250,18 +253,58 @@ Scl.Effect_Type_List = { ...@@ -250,18 +253,58 @@ Scl.Effect_Type_List = {
--use for some functions that need fo ergodic each summon type. --use for some functions that need fo ergodic each summon type.
Scl.Summon_Type_List = { Scl.Summon_Type_List = {
["SpecialSummon"] = { SUMMON_TYPE_SPECIAL }, ["SpecialSummon"] = SUMMON_TYPE_SPECIAL,
["AdvanceSummon"] = { SUMMON_TYPE_ADVANCE }, ["AdvanceSummon"] = SUMMON_TYPE_ADVANCE,
["RitualSummon"] = { SUMMON_TYPE_RITUAL, TYPE_RITUAL }, ["RitualSummon"] = SUMMON_TYPE_RITUAL,
["FusionSummon"] = { SUMMON_TYPE_FUSION, TYPE_FUSION }, ["FusionSummon"] = SUMMON_TYPE_FUSION,
["SynchroSummon"] = { SUMMON_TYPE_SYNCHRO, TYPE_SYNCHRO }, ["SynchroSummon"] = SUMMON_TYPE_SYNCHRO,
["XyzSummon"] = { SUMMON_TYPE_XYZ, TYPE_XYZ }, ["XyzSummon"] = SUMMON_TYPE_XYZ,
["LinkSummon"] = { SUMMON_TYPE_LINK, TYPE_LINK }, ["LinkSummon"] = SUMMON_TYPE_LINK,
["PendulumSummon"] = { SUMMON_TYPE_PENDULUM }, ["PendulumSummon"] = SUMMON_TYPE_PENDULUM,
["SpecialSummonBySelf"] = { SUMMON_TYPE_SPECIAL + SUMMON_VALUE_SELF }, ["SpecialSummonBySelf"] = SUMMON_TYPE_SPECIAL + SUMMON_VALUE_SELF,
["DualSummon"] = { SUMMON_TYPE_DUAL }, ["DualSummon"] = SUMMON_TYPE_DUAL,
["FlipSummon"] = { SUMMON_TYPE_FLIP }, ["FlipSummon"] = SUMMON_TYPE_FLIP,
["NormalSummon"] = { SUMMON_TYPE_NORMAL } ["NormalSummon"] = SUMMON_TYPE_NORMAL
}
--Timing list
Scl.Timing_List = {
["FreeChain"] = { EVENT_FREE_CHAIN },
["Adjust"] = { EVENT_ADJUST },
["BreakEffect"] = { EVENT_BREAK_EFFECT },
["Move"] = { EVENT_MOVE },
["BeSummoned"] = { EVENT_SUMMON_SUCCESS, aux.TRUE, aux.TRUE, EVENT_SPSUMMON_SUCCESS, aux.TRUE, aux.TRUE, EVENT_FLIP_SUMMON_SUCCESS, aux.TRUE, aux.TRUE },
["BeNormalSummoned"] = { EVENT_SUMMON_SUCCESS },
["BeSpecialSummoned"] = { EVENT_SPSUMMON_SUCCESS },
["BeRitualSummoned"] = { EVENT_SPSUMMON_SUCCESS },
["BeFusionSummoned"] = { EVENT_SPSUMMON_SUCCESS },
["BeSynchroSummoned"] = { EVENT_SPSUMMON_SUCCESS },
["BeXyzSummoned"] = { EVENT_SPSUMMON_SUCCESS },
["BePendulumSummoned"] = { EVENT_SPSUMMON_SUCCESS },
["BeLinkSummoned"] = { EVENT_SPSUMMON_SUCCESS },
["BeFlipSummoned"] = { EVENT_FLIP_SUMMON_SUCCESS },
["BeFlip"] = { EVENT_FLIP },
["BeSent2GY"] = { EVENT_TOGRAVE },
["BeDestroyedByBattle"] = { EVENT_BATTLE_DESTROYED },
["BeSent2GYByEffect"] = { EVENT_TOGRAVE, { Scl.IsReason, 0, "Effect" } },
["BeDestroyedByEffect"] = { EVENT_DESTROYED },
["BeDestroyedByBattle/Effect"] = { EVENT_DESTROYED },
["DestroyByBattle"] = { EVENT_BATTLE_DESTROYING },
["DestroyByBattle&Send2GY"] = { EVENT_BATTLE_DESTROYING },
["BeBainshed"] = { EVENT_REMOVE },
["BeAdd2Hand"] = { EVENT_TOHAND },
["BeReturned2Deck"] = { EVENT_TODECK },
["Spell&TrapBeSet"] = { EVENT_SSET },
["BeSet"] = { EVENT_SET_SCL },
["PositionBeChanged"] = { EVENT_CHANGE_POS },
["BeUsedAsMaterial"] = { EVENT_BE_MATERIAL },
["BeUsedAsMaterial4FusionSummon"] = { EVENT_BE_MATERIAL },
["BeUsedAsMaterial4SynchroSummon"] = { EVENT_BE_MATERIAL },
["BeUsedAsMaterial4XyzSummon"] = { EVENT_BE_MATERIAL },
["BeUsedAsMaterial4LinkSummon"] = { EVENT_BE_MATERIAL },
["BeTributed"] = { EVENT_RELEASE }
} }
...@@ -780,11 +823,11 @@ function s.raise_global_event_op(con, event_code) ...@@ -780,11 +823,11 @@ function s.raise_global_event_op(con, event_code)
end end
end end
end end
--Mix any single SET-events to a global SET event (rscode.Set). --Mix any single SET-events to a global SET event (EVENT_SET_SCL).
--including normal set monster, special summon monster(s) in face-down position, change a face-up monster(s) to face-down position, set a Spell/Trap(s). --including normal set monster, special summon monster(s) in face-down position, change a face-up monster(s) to face-down position, set a Spell/Trap(s).
--//return the trigger effect for EVENT_MSET, EVENT_SSET, EVENT_SPSUMMON_SUCCESS, EVENT_CHANGE_POS --//return the trigger effect for EVENT_MSET, EVENT_SSET, EVENT_SPSUMMON_SUCCESS, EVENT_CHANGE_POS
function Scl.RaiseGlobalSetEvent() function Scl.RaiseGlobalSetEvent()
return Scl.RaiseGlobalEvent(rscode.Set, EVENT_MSET, nil, EVENT_SSET, nil, EVENT_SPSUMMON_SUCCESS, s.raise_global_set_event_con, EVENT_CHANGE_POS, s.raise_set_event_con) return Scl.RaiseGlobalEvent(EVENT_SET_SCL, EVENT_MSET, nil, EVENT_SSET, nil, EVENT_SPSUMMON_SUCCESS, s.raise_global_set_event_con, EVENT_CHANGE_POS, s.raise_set_event_con)
end end
function s.raise_global_set_event_con(e, tp, eg) function s.raise_global_set_event_con(e, tp, eg)
local sg = eg:Filter(Card.IsFacedown, nil) local sg = eg:Filter(Card.IsFacedown, nil)
...@@ -1646,12 +1689,12 @@ end ...@@ -1646,12 +1689,12 @@ end
--//return fusion summon effect --//return fusion summon effect
--[[ --[[
>>eg1. "Polymerization" (24094653) = >>eg1. "Polymerization" (24094653) =
local e1 = Scl.CreateActivateEffect_FusionSummon(c, nil, nil, aux.TRUE, s.mat, "Send2GY") local e1 = Scl.CreateActivateEffect_FusionSummon(c, nil, aux.TRUE, s.mat, "Send2GY")
function s.mat(e,tp) function s.mat(e,tp)
return Duel.GetFusionMaterial(tp) return Duel.GetFusionMaterial(tp)
end end
>>eg2. "Super Polymerization" (48130397) = >>eg2. "Super Polymerization" (48130397) =
local e1 = Scl.CreateActivateEffect_FusionSummon(c, nil, nil, aux.TRUE, s.mat, "Send2GY", nil, nil, nil, nil, nil, nil, nil, { "PlayerCost", "Discard", 1 }, s.extg) local e1 = Scl.CreateActivateEffect_FusionSummon(c, nil, aux.TRUE, s.mat, "Send2GY", nil, nil, nil, nil, nil, nil, nil, { "PlayerCost", "Discard", 1 }, s.extg)
function s.mat(e,tp) function s.mat(e,tp)
local g1 = Duel.GetFusionMaterial(tp):Filter(Card.IsOnField, nil) local g1 = Duel.GetFusionMaterial(tp):Filter(Card.IsOnField, nil)
local g2 = Duel.GetMatchingGroup(Card.IsFaceup,tp,0,LOCATION_MZONE,nil) local g2 = Duel.GetMatchingGroup(Card.IsFaceup,tp,0,LOCATION_MZONE,nil)
...@@ -1666,7 +1709,7 @@ end ...@@ -1666,7 +1709,7 @@ end
end end
end end
>>eg3. "Cynet Fusion" (65801012) = >>eg3. "Cynet Fusion" (65801012) =
local e1 = Scl.CreateActivateEffect_FusionSummon(c, nil, nil, aux.FilterBoolFunction(Card.IsRace, RACE_CYBERSE), s.mat, s.matop, nil, s.fcheck, nil, s.gcheck) local e1 = Scl.CreateActivateEffect_FusionSummon(c, nil, aux.FilterBoolFunction(Card.IsRace, RACE_CYBERSE), s.mat, s.matop, nil, s.fcheck, nil, s.gcheck, nil, nil, "Banish,GYAction")
function s.exfilter(c) function s.exfilter(c)
return c:IsType(TYPE_LINK) and c:IsRace(RACE_CYBERSE) and c:IsAbleToRemove() return c:IsType(TYPE_LINK) and c:IsRace(RACE_CYBERSE) and c:IsAbleToRemove()
end end
...@@ -1694,14 +1737,14 @@ end ...@@ -1694,14 +1737,14 @@ end
return sg:FilterCount(Card.IsLocation,nil,LOCATION_GRAVE)<=1 return sg:FilterCount(Card.IsLocation,nil,LOCATION_GRAVE)<=1
end end
]] ]]
function Scl.CreateActivateEffect_FusionSummon(reg_obj, desc_obj, lim_obj, fus_filter, mat_obj, mat_fun, must_include_card, fcheck, fgcheck, gcheck, ex_ctgy, ex_flag, con, cost, ex_tg, ex_op) function Scl.CreateActivateEffect_FusionSummon(reg_obj, lim_obj, fus_filter, mat_obj, mat_fun, must_include_card, fcheck, fgcheck, gcheck, con, cost, ex_ctgy, ex_flag, ex_tg, ex_op, desc_obj)
local ctgy2 = ex_ctgy and ex_ctgy .. ",FusionSummon" or "FusionSummon" local ctgy2 = ex_ctgy and ex_ctgy .. ",FusionSummon" or "FusionSummon"
if type(mat_fun) == "string" then if type(mat_fun) == "string" then
ctgy2 = ctgy2 .. "," .. mat_fun ctgy2 = ctgy2 .. "," .. mat_fun
end end
ex_tg = ex_tg or aux.TRUE ex_tg = ex_tg or aux.TRUE
ex_op = ex_op or aux.TRUE ex_op = ex_op or aux.TRUE
local e1 = Scl.CreateActivateEffect(reg_obj, nil, nil, lim_obj, ctgy2, ex_flag, con, cost, s.fusion_summon_target(ex_tg, fus_filter, mat_obj, mat_fun, must_include_card, fcheck, fgcheck, gcheck), s.fusion_summon_operation(ex_op, fus_filter, mat_obj, mat_fun, must_include_card, fcheck, fgcheck, gcheck)) local e1 = Scl.CreateActivateEffect(reg_obj, nil, desc_obj or "FusionSummon", lim_obj, ctgy2, ex_flag, con, cost, s.fusion_summon_target(ex_tg, fus_filter, mat_obj, mat_fun, must_include_card, fcheck, fgcheck, gcheck), s.fusion_summon_operation(ex_op, fus_filter, mat_obj, mat_fun, must_include_card, fcheck, fgcheck, gcheck))
return e1 return e1
end end
function s.fusion_summon_filter(c, fus_filter, e, tp, mat, matf, must_include_card, chkf) function s.fusion_summon_filter(c, fus_filter, e, tp, mat, matf, must_include_card, chkf)
...@@ -1827,12 +1870,31 @@ function s.fusion_summon_operation(ex_op, fus_filter, mat_obj, mat_fun, must_inc ...@@ -1827,12 +1870,31 @@ function s.fusion_summon_operation(ex_op, fus_filter, mat_obj, mat_fun, must_inc
s.list_format_cost_or_target_or_operation(ex_op)(e, tp, eg, ep, ev, re, r, rp, 2) s.list_format_cost_or_target_or_operation(ex_op)(e, tp, eg, ep, ev, re, r, rp, 2)
end end
end end
--Mix several single activate effects into one activate effect.
--when you activate the mixed effect, you will select which single activate effect you want to activate and apply.
--this function use single activate effects' descriptions as the hint for you selecting, so you should add corresponding descriptions to thoes single activate effects.
--... is the single activate effects that you want to mix in.
--the single activate effects that be mixed cannot be activated.
--//return the mixed effect.
-->>eg1. local e1 = Scl.CreateActivateEffect(c, nil, "Banish", { 1, id, "Oath" }, "Banish", "Target", nil, nil, s.tg, s.op)
-->> local e2 = Scl.CreateActivateEffect(c, nil, "Destroy", { 1, id, "Oath" }, "Destroy", "Target", nil, nil, s.tg2, s.op2)
-->> local e3 = Scl.CreateActivateEffect_Activate1ofTheseEffects(c, e1, e2)
-->>mix effect e1 and e2 into e3.
function Scl.CreateActivateEffect_Activate1ofTheseEffects(reg_obj, ...) function Scl.CreateActivateEffect_Activate1ofTheseEffects(reg_obj, ...)
local eff_arr = { ... } local eff_arr = { ... }
local code_arr = { } local code_arr = { }
local con_arr = { }
local cost_arr = { }
local tg_arr = { }
local op_arr = { }
local desc_arr = { }
for _, e in pairs(eff_arr) do for _, e in pairs(eff_arr) do
table.insert(code_arr, e:GetCode()) table.insert(code_arr, e:GetCode() or EVENT_FREE_CHAIN)
table.insert(con_arr, e:GetCondition() or aux.TRUE)
table.insert(cost_arr, e:GetCost() or aux.TRUE)
table.insert(tg_arr, e:GetTarget() or aux.TRUE)
table.insert(op_arr, e:GetOperation() or aux.TRUE)
table.insert(desc_arr, e:GetDescription() or DESC_ACTIVATE_SCL)
e:Reset() e:Reset()
end end
local code = 0 local code = 0
...@@ -1841,7 +1903,109 @@ function Scl.CreateActivateEffect_Activate1ofTheseEffects(reg_obj, ...) ...@@ -1841,7 +1903,109 @@ function Scl.CreateActivateEffect_Activate1ofTheseEffects(reg_obj, ...)
else else
code = EVENT_FREE_CHAIN code = EVENT_FREE_CHAIN
end end
local e1 = Scl.CreateActivateEffect(reg_obj, nil, nil, lim_obj, nil, nil, con, cost, s.fusion_summon_target(ex_tg, fus_filter, mat_obj, mat_fun, must_include_card, fcheck, fgcheck, gcheck), s.fusion_summon_operation(ex_op, fus_filter, mat_obj, mat_fun, must_include_card, fcheck, fgcheck, gcheck)) local e1 = Scl.CreateActivateEffect(reg_obj, code, nil, nil, nil, nil, s.apply_1_of_these_effects_condition(eff_arr, code_arr, con_arr), nil, s.apply_1_of_these_effects_target(eff_arr, code_arr, cost_arr, tg_arr, op_arr, desc_arr))
return e1
end
function s.apply_1_of_these_effects_condition(eff_arr, code_arr, con_arr)
return function(e, tp, ...)
local arr = { }
for idx, con in pairs(con_arr) do
local ce = eff_arr[idx]
local code = code_arr[idx]
if code == EVENT_FREE_CHAIN then
if con(e, tp, ...) and ce:CheckCountLimit(tp) then
table.insert(arr, idx)
end
else
local res, eg, ep, ev, re, r, rp = Duel.CheckEvent(code, true)
if res and con(e, tp, eg, ep, ev, re, r, rp) and ce:CheckCountLimit(tp) then
table.insert(arr, idx)
end
end
end
Scl.Choose_One_Effect_Condition_Index = arr
return #arr > 0
end
end
function s.apply_1_of_these_effects_target(eff_arr, code_arr, cost_arr, tg_arr, op_arr, desc_arr)
return function(e, tp, eg, ep, ev, re, r, rp, chk, chkc)
local con_arr = Scl.Choose_One_Effect_Condition_Index
if chkc then
local idx = Scl.Choose_One_Effect_Select_Index[e][Duel.GetCurrentChain()]
return idx > 0 and tg_arr[idx](e, tp, eg, ep, ev, re, r, rp, chk, chkc)
end
local arr = { }
if e:IsCostChecked() then
for idx, cost in pairs(cost_arr) do
local code = code_arr[idx]
if code == EVENT_FREE_CHAIN then
if cost(e, tp, eg, ep, ev, re, r, rp, 0) then
table.insert(arr, idx)
end
else
local res, eg2, ep2, ev2, re2, r2, rp2 = Duel.CheckEvent(code, true)
if cost(e, tp, eg2, ep2, ev2, re2, r2, rp2, 0) then
table.insert(arr, idx)
end
end
end
end
local arr2 = { }
for idx, tg in pairs(tg_arr) do
if not e:IsCostChecked() then
table.insert(arr, idx)
end
local code = code_arr[idx]
if code == EVENT_FREE_CHAIN then
if tg(e, tp, eg, ep, ev, re, r, rp, 0) then
table.insert(arr2, idx)
end
else
local res, eg2, ep2, ev2, re2, r2, rp2 = Duel.CheckEvent(code, true)
if tg(e, tp, eg2, ep2, ev2, re2, r2, rp2, 0) then
table.insert(arr2, idx)
end
end
end
local res, arr3 = Scl.IsArraysHasIntersection(arr, arr2)
if chk == 0 then
return res and (not con_arr or Scl.IsArraysHasIntersection(arr3, con_arr))
end
local desc_arr2 = { }
for idx, desc in pairs(desc_arr) do
local res = Scl.IsArrayContains_Single(arr3, idx)
table.insert(desc_arr2, res and Scl.IsArrayContains_Single(con_arr, idx))
table.insert(desc_arr2, desc)
end
local opt = Scl.SelectOption(tp, table.unpack(desc_arr2))
Scl.Choose_One_Effect_Select_Index[e] = Scl.Choose_One_Effect_Select_Index[e] or { }
Scl.Choose_One_Effect_Select_Index[e][Duel.GetCurrentChain()] = opt
local code = code_arr[opt]
local res, eg2, ep2, ev2, re2, r2, rp2 = false, nil, 0, 0, nil, 0, 0
if code ~= EVENT_FREE_CHAIN then
res, eg2, ep2, ev2, re2, r2, rp2 = Duel.CheckEvent(code, true)
end
local ce = eff_arr[opt]
ce:UseCountLimit(tp)
if e:IsCostChecked() then
local cost = cost_arr[opt]
if code == EVENT_FREE_CHAIN then
cost(e, tp, eg, ep, ev, re, r, rp, 1)
else
cost(e, tp, eg2, ep2, ev2, re2, r2, rp2, 1)
end
end
--beacuse some effects' operations is set in there targets, so first set operation, and second do the chk == 1 target, make target can reset operation.
e:SetOperation(op_arr[opt])
local tg = tg_arr[opt]
if code == EVENT_FREE_CHAIN then
tg(e, tp, eg, ep, ev, re, r, rp, 1)
else
tg(e, tp, eg2, ep2, ev2, re2, r2, rp2, 1)
end
Scl.Choose_One_Effect_Condition_Index = nil
return #arr > 0
end
end end
--<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< --<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
...@@ -2444,7 +2608,7 @@ end ...@@ -2444,7 +2608,7 @@ end
-->>"This card cannot be special summoned from extra, except by Link Summon". -->>"This card cannot be special summoned from extra, except by Link Summon".
function scl.value_spsummon_from_extra(sum_str) function scl.value_spsummon_from_extra(sum_str)
return function(e, se, sp, st) return function(e, se, sp, st)
local st2 = Scl.Summon_Type_List[sum_str][1] local st2 = Scl.Summon_Type_List[sum_str]
return not e:GetHandler():IsLocation(LOCATION_EXTRA) or st & st2 == st2 return not e:GetHandler():IsLocation(LOCATION_EXTRA) or st & st2 == st2
end end
end end
...@@ -3466,11 +3630,21 @@ end ...@@ -3466,11 +3630,21 @@ end
--Nested function --Nested function
--condition: If this card is XXX summoned --condition: If this card is XXX summoned
--will use typ_str as index to find the number-format summon type from Scl.Summon_Type_List. --will use typ_str as index to find the number-format summon type from Scl.Summon_Type_List.
--if field_check(default == false) == true, means check is "eg" contains at least 1 monster meets summon type.
-->>eg1. scl.cond_is_summon_type("LinkSummon") -->>eg1. scl.cond_is_summon_type("LinkSummon")
-->>check if this card is link summoned. -->>check whether this card is link summoned.
function scl.cond_is_summon_type(typ_str) -->>eg1. scl.cond_is_summon_type("LinkSummon", true)
return function(e) -->>check whether eg include a monster that is link summoned.
return e:GetHandler():GetSummonType() & Scl.Summon_Type_List[typ_str] == Scl.Summon_Type_List[typ_str] function scl.cond_is_summon_type(typ_str, field_check)
return function(e, tp, eg)
local f = function(c)
return c:GetSummonType() & Scl.Summon_Type_List[typ_str] == Scl.Summon_Type_List[typ_str]
end
if field_check then
return eg:IsExists(f, 1, nil)
else
return f(e:GetHandler())
end
end end
end end
--Nested function --Nested function
...@@ -3529,6 +3703,20 @@ function Scl.SetExtraSelectAndOperateParama(would_hint, need_break, sel_hint) ...@@ -3529,6 +3703,20 @@ function Scl.SetExtraSelectAndOperateParama(would_hint, need_break, sel_hint)
Scl.Extra_Operate_Parama_Select_Hint = sel_hint Scl.Extra_Operate_Parama_Select_Hint = sel_hint
return true return true
end end
--Nearly same as Duel.GetMatchingGroup.
--zone_self and zone_oppo can be string-format (see Scl.Zone_List)
--//return group
-->>eg1. Scl.GetMatchingGroup(Card.IsAbleToHand, tp, "Deck", 0, nil)
-->>check whether there is a card in your deck that can be added to the hand, return that group
function Scl.GetMatchingGroup(filter_obj, tp, zone_self, zone_oppo, except_obj, ...)
local filter_arr = type(filter_obj) == "table" and filter_obj or { filter_obj }
local card_filter, group_filter = table.unpack(filter_arr)
card_filter = card_filter or aux.TRUE
group_filter = group_filter or aux.TRUE
local self_zone2 = Scl.GetNumFormatZone(self_zone)
local oppo_zone2 = Scl.GetNumFormatZone(oppo_zone)
return Duel.GetMatchingGroup(card_filter, tp, self_zone2, oppo_zone2, except_obj, ...)
end
--Nearly same as Duel.IsExistingMatchingCard, but has follow changes. --Nearly same as Duel.IsExistingMatchingCard, but has follow changes.
--filter_obj can be card_filter or { card_filter, group_filter } --filter_obj can be card_filter or { card_filter, group_filter }
--zone_self and zone_oppo can be string-format (see Scl.Zone_List) --zone_self and zone_oppo can be string-format (see Scl.Zone_List)
...@@ -3538,13 +3726,7 @@ end ...@@ -3538,13 +3726,7 @@ end
-->>eg2. Scl.IsExistingMatchingCard({ Card.IsAbleToHand, aux.dncheck }, tp, "Deck", 0, 2, nil) -->>eg2. Scl.IsExistingMatchingCard({ Card.IsAbleToHand, aux.dncheck }, tp, "Deck", 0, 2, nil)
-->>check whether there are 2 cards in your deck that have different names and can be added to the hand. -->>check whether there are 2 cards in your deck that have different names and can be added to the hand.
function Scl.IsExistingMatchingCard(filter_obj, tp, zone_self, zone_oppo, ct, except_obj, ...) function Scl.IsExistingMatchingCard(filter_obj, tp, zone_self, zone_oppo, ct, except_obj, ...)
local filter_arr = type(filter_obj) == "table" and filter_obj or { filter_obj } local g = Scl.GetMatchingGroup(filter_obj, tp, zone_self, zone_oppo, except_obj, ...)
local card_filter, group_filter = table.unpack(filter_arr)
card_filter = card_filter or aux.TRUE
group_filter = group_filter or aux.TRUE
local self_zone2 = Scl.GetNumFormatZone(self_zone)
local oppo_zone2 = Scl.GetNumFormatZone(oppo_zone)
local g = Duel.GetMatchingGroup(card_filter, tp, self_zone2, oppo_zone2, except_obj, ...)
return g:CheckSubGroup(group_filter, ct, #g, ...) return g:CheckSubGroup(group_filter, ct, #g, ...)
end end
--Nearly same as Group.IsExists, but has follow changes. --Nearly same as Group.IsExists, but has follow changes.
...@@ -4791,6 +4973,7 @@ end ...@@ -4791,6 +4973,7 @@ end
--can call some scl's custom functions in the procedure, like extra synchro material, dark synchro, custom level synchro, custom synchro material action, and so on --can call some scl's custom functions in the procedure, like extra synchro material, dark synchro, custom level synchro, custom synchro material action, and so on
--return summon effect --return summon effect
function Scl.AddSynchroProcedure(c, f1, f2, f3, f4, minc, maxc, gc) function Scl.AddSynchroProcedure(c, f1, f2, f3, f4, minc, maxc, gc)
c:EnableReviveLimit()
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetDescription(1164) e1:SetDescription(1164)
e1:SetType(EFFECT_TYPE_FIELD) e1:SetType(EFFECT_TYPE_FIELD)
...@@ -4977,6 +5160,9 @@ end ...@@ -4977,6 +5160,9 @@ end
--can call some scl's custom functions in the procedure, like extra xyz material, custom xyz material action, utility xyz material, and so on --can call some scl's custom functions in the procedure, like extra xyz material, custom xyz material action, utility xyz material, and so on
--return summon effect --return summon effect
function Scl.AddlXyzProcedure(c, f, gf, minc, maxc, alterf, desc, op) function Scl.AddlXyzProcedure(c, f, gf, minc, maxc, alterf, desc, op)
c:EnableReviveLimit()
f = type(f) == "number" and aux.FilterBoolFunction(Card.IsXyzLevel, f) or f
gf = gf or aux.TRUE
alterf = alterf or aux.FALSE alterf = alterf or aux.FALSE
local e1 = Effect.CreateEffect(c) local e1 = Effect.CreateEffect(c)
e1:SetDescription(1165) e1:SetDescription(1165)
...@@ -5174,6 +5360,7 @@ end ...@@ -5174,6 +5360,7 @@ end
--can call some scl's custom functions in the procedure, like extra link material, custom link material action, and so on --can call some scl's custom functions in the procedure, like extra link material, custom link material action, and so on
--return summon effect --return summon effect
function Scl.AddlLinkProcedure(c, f, min, max, gf) function Scl.AddlLinkProcedure(c, f, min, max, gf)
c:EnableReviveLimit()
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetDescription(1166) e1:SetDescription(1166)
e1:SetType(EFFECT_TYPE_FIELD) e1:SetType(EFFECT_TYPE_FIELD)
...@@ -6075,7 +6262,7 @@ s.record_previous_inside_series() ...@@ -6075,7 +6262,7 @@ s.record_previous_inside_series()
s.record_official_filter() s.record_official_filter()
s.add_current_effect_check() s.add_current_effect_check()
s.add_type_normal_spell_or_trap_scl() s.add_type_normal_spell_or_trap_scl()
Scl.RaiseGlobalSetEvent()
--<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< --<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
--<<<<<<<<<<<<<<<<<<<<<<<<<<< Custom Cards <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< --<<<<<<<<<<<<<<<<<<<<<<<<<<< Custom Cards <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
......
...@@ -19,6 +19,16 @@ function cm.initial_effect(c) ...@@ -19,6 +19,16 @@ function cm.initial_effect(c)
e2:SetRange(LOCATION_MZONE) e2:SetRange(LOCATION_MZONE)
e2:SetOperation(cm.op) e2:SetOperation(cm.op)
c:RegisterEffect(e2) c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e3:SetRange(LOCATION_MZONE)
e3:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e3:SetValue(1)
c:RegisterEffect(e3)
local e4=e3:Clone()
e4:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
c:RegisterEffect(e4)
local ex=Effect.CreateEffect(c) local ex=Effect.CreateEffect(c)
ex:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) ex:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ex:SetCode(EVENT_ADJUST) ex:SetCode(EVENT_ADJUST)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment