--Some special effects like "black hole", affect the whole card group, record that group's cards count in scl.list_format_cost_or_target_or_operation
scl.black_hole_count=0
--For a mandatory trigger effect, the target check will always return TRUE, but if you want to copy that effect, you should do a common target check, like optional trigger effects.
Scl.Mandatory_Effect_Target_Check=false
--Attach extra effect
--Attach extra effect
EFFECT_ADDITIONAL_EFFECT_SCL=id+100
EFFECT_ADDITIONAL_EFFECT_SCL=id+100
...
@@ -97,7 +98,6 @@ EFFECT_SET_MATERIAL_SCL = id + 105
...
@@ -97,7 +98,6 @@ EFFECT_SET_MATERIAL_SCL = id + 105
--For special buff: activate spell & trap form any zone
--For special buff: activate spell & trap form any zone
["Add2Hand"]={"Add to Hand",CATEGORY_TOHAND,HINTMSG_ATOHAND,{1249315,0},{26118970,1},{Scl.Send2Hand,4,sg,nil,r}},
["Add2Hand"]={"Add to Hand",CATEGORY_TOHAND,HINTMSG_ATOHAND,{1249315,0},{26118970,1},{Scl.Send2Hand,4,sg,nil,r}},
["AddFromDeck2Hand"]={"Add from Deck to Hand",{CATEGORY_SEARCH,CATEGORY_TOHAND},HINTMSG_ATOHAND,{1249315,0},{26118970,1},{Scl.Send2Hand,4,sg,nil,r}},
["AddFromDeck2Hand"]={"Add from Deck to Hand",{CATEGORY_SEARCH,CATEGORY_TOHAND},HINTMSG_ATOHAND,{1249315,0},{26118970,1},{Scl.Send2Hand,4,sg,nil,r}},
["AddFromGY2Hand"]={"Add from GY to Hand",{CATEGORY_GRAVE_ACTION,CATEGORY_TOHAND},HINTMSG_ATOHAND,{1249315,0},{26118970,1},{Scl.Send2Hand,4,sg,nil,r}},
["AddFromGY2Hand"]={"Add from GY to Hand",{CATEGORY_GRAVE_ACTION,CATEGORY_TOHAND},HINTMSG_ATOHAND,{1249315,0},{26118970,1},{Scl.Send2Hand,4,sg,nil,r}},
["AddFromDeck/GY2Hand"]={"Add from GY to Hand",{CATEGORY_GRAVE_ACTION,CATEGORY_SEARCH,CATEGORY_TOHAND},HINTMSG_ATOHAND,{1249315,0},{26118970,1},{Scl.Send2Hand,4,sg,nil,r}},
["AddFromDeck/GY2Hand"]={"Add from GY to Hand",{CATEGORY_GRAVE_ACTION,CATEGORY_SEARCH,CATEGORY_TOHAND},HINTMSG_ATOHAND,{1249315,0},{26118970,1},{Scl.Send2Hand,4,sg,nil,r}},
["Return2Hand"]={"Return to Hand",CATEGORY_TOHAND,HINTMSG_RTOHAND,{13890468,0},{9464441,2},{Scl.Send2Hand,4,sg,nil,r}},
["Return2Hand"]={"Return to Hand",CATEGORY_TOHAND,HINTMSG_RTOHAND,{13890468,0},{9464441,2},{Scl.Send2Hand,4,sg,nil,r}},
["ShuffleIn2Deck"]={"Send to Deck",CATEGORY_TODECK,HINTMSG_TODECK,{4779823,1},HINTMSG_WOULD_TO_DECK_SCL,{Scl.Send2Deck,4,sg,nil,2,r}},
["ShuffleIn2Deck"]={"Send to Deck",CATEGORY_TODECK,HINTMSG_TODECK,{4779823,1},HINTMSG_WOULD_TO_DECK_SCL,{Scl.Send2Deck,4,sg,nil,SEQ_DECKSHUFFLE,r}},
["Look&ShuffleIn2Deck"]={"Send to Deck",CATEGORY_TODECK,HINTMSG_TODECK,{4779823,1},HINTMSG_WOULD_TO_DECK_SCL,{Scl.LookAndSend2Deck,4,sg,nil,2,r}},
["Look&ShuffleIn2Deck"]={"Send to Deck",CATEGORY_TODECK,HINTMSG_TODECK,{4779823,1},HINTMSG_WOULD_TO_DECK_SCL,{Scl.LookAndSend2Deck,4,sg,nil,SEQ_DECKSHUFFLE,r}},
["ShuffleIn2DeckTop"]={"Shuffle into Deck-Top",CATEGORY_TODECK,HINTMSG_TODECK,{55705473,1},HINTMSG_WOULD_TO_DECK_SCL,{Scl.Send2Deck,4,sg,nil,2,r}},
["ShuffleIn2DeckTop"]={"Shuffle into Deck-Top",CATEGORY_TODECK,HINTMSG_TODECK,{55705473,1},HINTMSG_WOULD_TO_DECK_SCL,{Scl.Send2Deck,4,sg,nil,SEQ_DECKTOP,r}},
["ShuffleIn2DeckBottom"]={"Shuffle into Deck-Bottom",CATEGORY_TODECK,HINTMSG_TODECK,{55705473,2},HINTMSG_WOULD_TO_DECK_SCL,{Scl.Send2Deck,4,sg,nil,0,r}},
["ShuffleIn2DeckBottom"]={"Shuffle into Deck-Bottom",CATEGORY_TODECK,HINTMSG_TODECK,{55705473,2},HINTMSG_WOULD_TO_DECK_SCL,{Scl.Send2Deck,4,sg,nil,SEQ_DECKBOTTOM,r}},
["PlaceOnDeckTop"]={"Place on the top of the Deck",0,{45593826,3},{15521027,3},0,{Scl.PlaceOnDeckTopOrBottom,3,sg,0}},
["PlaceOnDeckTop"]={"Place on the top of the Deck",0,{45593826,3},{15521027,3},0,{Scl.PlaceOnDeckTopOrBottom,3,sg,0}},
["PlaceOnDeckBottom"]={"Place on the bottom of the Deck",0,0,{15521027,4},0,{Scl.PlaceOnDeckTopOrBottom,3,sg,1}},
["PlaceOnDeckBottom"]={"Place on the bottom of the Deck",0,0,{15521027,4},0,{Scl.PlaceOnDeckTopOrBottom,3,sg,1}},
["Return2Extra"]={"Return to Extra",CATEGORY_TOEXTRA,HINTMSG_TODECK,{4779823,1},HINTMSG_WOULD_TO_DECK_SCL,{Scl.Send2Extra,4,sg,nil,2,r}},
["Return2Extra"]={"Return to Extra",CATEGORY_TOEXTRA,HINTMSG_TODECK,{4779823,1},HINTMSG_WOULD_TO_DECK_SCL,{Scl.Send2Extra,4,sg,nil,2,r}},
...
@@ -491,7 +507,9 @@ function s.create_category_list()
...
@@ -491,7 +507,9 @@ function s.create_category_list()
["NormalSummon"]={"Normal Summon in attack position",CATEGORY_SUMMON,HINTMSG_SUMMON,{65247798,0},{41139112,0},{Scl.NormalSummon,7,sg,tp,true,nil,nil,nil,POS_FACEUP_ATTACK}},
["NormalSet"]={"Normal Summon in face-down position",CATEGORY_SUMMON,HINTMSG_SUMMON,{65247798,0},{41139112,0},{Scl.NormalSummon,7,sg,tp,true,nil,nil,nil,POS_FACEDOWN_DEFENSE}},
["Look"]={"Look (can show public)",0,HINTMSG_CONFIRM,{51351302,0},nil,{Scl.Look,1,sg}},
["Look"]={"Look (can show public)",0,HINTMSG_CONFIRM,{51351302,0},nil,{Scl.Look,1,sg}},
["Reveal"]={"Reveal, (cannot show public)",0,HINTMSG_CONFIRM,{51351302,0},nil,{Scl.RevealCards,2,sg,RESETS_SCL}},
["Reveal"]={"Reveal, (cannot show public)",0,HINTMSG_CONFIRM,{51351302,0},nil,{Scl.RevealCards,2,sg}},
["RevealUntilEP"]={"Reveal until End-Phase",0,HINTMSG_CONFIRM,{51351302,0},nil,{Scl.RevealCards,2,sg,RESETS_EP_SCL}},
["RevealUntilEP"]={"Reveal until End-Phase",0,HINTMSG_CONFIRM,{51351302,0},nil,{Scl.RevealCards,2,sg,RESETS_EP_SCL}},
["PlaceOnField"]={"Place on field",0,HINTMSG_TOFIELD,DESC_PLACE_TO_FIELD_SCL,nil,{Scl.Place2Field,7,sg,tp}},
["PlaceOnField"]={"Place on field",0,HINTMSG_TOFIELD,DESC_PLACE_TO_FIELD_SCL,nil,{Scl.PlaceOnField,7,sg,tp,tp,"AnyZone",POS_FACEUP,true}},
["PlaceInSpell&TrapZone"]={"Place in spell and trap zone",0,HINTMSG_TOFIELD,DESC_PLACE_TO_FIELD_SCL,nil,{Scl.Place2Field,7,sg,tp,tp,"Spell&TrapZone",POS_FACEUP,true}},
["PlaceInSpell&TrapZone"]={"Place in spell and trap zone",0,HINTMSG_TOFIELD,DESC_PLACE_TO_FIELD_SCL,nil,{Scl.PlaceOnField,7,sg,tp,tp,"Spell&TrapZone",POS_FACEUP,true}},
["PlaceInFieldZone"]={"Place in spell and trap zone",0,HINTMSG_TOFIELD,DESC_PLACE_TO_FIELD_SCL,nil,{Scl.Place2Field,7,sg,tp,tp,"FieldZone",POS_FACEUP,true}},
["PlaceInFieldZone"]={"Place in spell and trap zone",0,HINTMSG_TOFIELD,DESC_PLACE_TO_FIELD_SCL,nil,{Scl.PlaceOnField,7,sg,tp,tp,"FieldZone",POS_FACEUP,true}},
["PlaceInPendulumZone"]={"Place in spell and trap zone",0,HINTMSG_TOFIELD,DESC_PLACE_TO_FIELD_SCL,nil,{Scl.Place2Field,7,sg,tp,tp,"PendulumZone",POS_FACEUP,true}},
["PlaceInPendulumZone"]={"Place in spell and trap zone",0,HINTMSG_TOFIELD,DESC_PLACE_TO_FIELD_SCL,nil,{Scl.PlaceOnField,7,sg,tp,tp,"PendulumZone",POS_FACEUP,true}},
--default_value: use for some complex buff, like "UnaffectedByOpponentsCardEffects", its default_value = scl.value_unaffected_by_opponents_card_effects, if you set another value, the buff will only be applied when both the default_value and the another value are correct.
@@ -976,7 +1004,9 @@ function s.raise_global_event_op(con, event_code)
...
@@ -976,7 +1004,9 @@ function s.raise_global_event_op(con, event_code)
returnfunction(e,tp,eg,ep,ev,re,r,rp)
returnfunction(e,tp,eg,ep,ev,re,r,rp)
con=conoraux.TRUE
con=conoraux.TRUE
localres,sg=con(e,tp,eg,ep,ev,re,r,rp)
localres,sg=con(e,tp,eg,ep,ev,re,r,rp)
ifnotresthenreturnend
ifnotresthen
return
end
sg=sgoreg
sg=sgoreg
Duel.RaiseEvent(sg,event_code,re,r,rp,ep,ev)
Duel.RaiseEvent(sg,event_code,re,r,rp,ep,ev)
fortcinaux.Next(sg)do
fortcinaux.Next(sg)do
...
@@ -988,7 +1018,7 @@ end
...
@@ -988,7 +1018,7 @@ end
--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
--Register Condition, Cost, Target and Operation for reg_eff
--Register Condition, Cost, Target and Operation for reg_eff
--cost, target and operation can be function or array. If be array-format, it calls scl.list_format_cost_or_target_or_operation to change it to function.
--cost, target and operation can be function or array. If be array-format, it calls scl.list_format_cost_or_target_or_operation to change it to function.
--if eff_val == 1, it will first call the default value (for some complex buff like "UnaffectedByOpponentsCardEffects", if you set the value to 1, it will call the default value, rather than directly call "1", but some other buffs likes "+ATK", due to no default value, it will directly call "1".)
--case complex buff like "UnaffectedByOpponentsCardEffects", if you set an extra value for this buff, the buff must meets the default value (see in Scl.Buff_Code_List) and the extra value.
--"mat_fun" can be string-format (like "Send2GY", "Bainsh", see Scl.Category_List), call s.operate_selected_objects to do the operation on the selected materials and set operation info due to the categroy.
--"mat_fun" can be string-format (like "Send2GY", "Bainsh", see Scl.Category_List), call s.operate_selected_objects to do the operation on the selected materials and set operation info due to the categroy.
--OR can be function-format, call mat_fun(selected_materials, e, tp, eg, ep, ev, re, r, rp) to do the operation on the selected materials.
--OR can be function-format, call mat_fun(selected_materials, e, tp, eg, ep, ev, re, r, rp) to do the operation on the selected materials.
--only after all the selected materials be operated successfully by "mat_fun", the fusion summon will be continued, so if you used function-format "mat_fun", PLZ noticed that you should return a boolean value to make this function to distinguish whether you have operated successfully (like return Duel.Destroy(g, REASON_MATERIAL + REASON_EFFECT + REASON_FUSION) == #g)
--only after all the selected materials be operated successfully by "mat_fun", the fusion summon will be continued, so if you used function-format "mat_fun", PLZ noticed that you should return a boolean value to make this function to distinguish whether you have operated successfully (like return Duel.Destroy(g, REASON_MATERIAL + REASON_EFFECT + REASON_FUSION) == #g)
--if you set the parama must_include_card (defualt = nil), means you must use that card as one of the fusion materials
--if you set the parama must_include_card (default = nil), means you must use that card as one of the fusion materials
--fcheck, gcheck (defualt == nil) use to limit your to select materials.
--fcheck, gcheck (default == nil) use to limit your to select materials.
--ex_ctgy (defualt == nil) means extra categroy(s) the ex_op and the function-format mat_fun brings to.
--ex_ctgy (default == nil) means extra categroy(s) the ex_op and the function-format mat_fun brings to.
--ex_flag (defualt == nil) means extra property(s) the ex_tg and ex_op brings to.
--ex_flag (default == nil) means extra property(s) the ex_tg and ex_op brings to.
--ex_tg (defualt == aux.TRUE) means add an additional target-check to this function.
--ex_tg (default == aux.TRUE) means add an additional target-check to this function.
--[[ex_op (defualt == nil) means add an additional operation to this function.
--[[ex_op (default == nil) means add an additional operation to this function.
call ex_op(e, tp, eg, ep, ev, re, r, rp, chk)
call ex_op(e, tp, eg, ep, ev, re, r, rp, chk)
if chk == 0, means do this operation before select-material-operation, and only this function returns true, the select-material-operation will be continued.
if chk == 0, means do this operation before select-material-operation, and only this function returns true, the select-material-operation will be continued.
if chk == 1, means do this operation after the fuison-summon-operation be operated successfully (return true)
if chk == 1, means do this operation after the fuison-summon-operation be operated successfully (return true)
...
@@ -2131,7 +2202,7 @@ function s.fusion_summon_operation(ex_op, fus_filter, mat_obj, mat_fun, must_inc
...
@@ -2131,7 +2202,7 @@ function s.fusion_summon_operation(ex_op, fus_filter, mat_obj, mat_fun, must_inc
ifsg2then
ifsg2then
sg:Merge(sg2)
sg:Merge(sg2)
end
end
Scl.SelectHint(tp,"SpecialSummon")
Scl.HintSelect(tp,"SpecialSummon")
localtc=sg:Select(tp,1,1,nil):GetFirst()
localtc=sg:Select(tp,1,1,nil):GetFirst()
ifnottcthen
ifnottcthen
gotoFINAL
gotoFINAL
...
@@ -2397,10 +2468,10 @@ end
...
@@ -2397,10 +2468,10 @@ end
--con can be function, nil, or be a array { ... }, if be nil or array-format, it equals to call the scl.negate_activation_or_effect_con("NegateEffect" ,nil/ ...).
--con can be function, nil, or be a array { ... }, if be nil or array-format, it equals to call the scl.negate_activation_or_effect_con("NegateEffect" ,nil/ ...).
--automatic add "EFFECT_FLAG_DAMAGE_STEP" to the property if neg_typ == "NegateEffect".
--automatic add "EFFECT_FLAG_DAMAGE_STEP" to the property if neg_typ == "NegateEffect".
--automatic add "EFFECT_FLAG_DAMAGE_STEP + EFFECT_FLAG_DAMAGE_CAL" to the property if neg_typ == "NegateActivation".
--automatic add "EFFECT_FLAG_DAMAGE_STEP + EFFECT_FLAG_DAMAGE_CAL" to the property if neg_typ == "NegateActivation".
--ex_ctgy (defualt == nil) means extra categroy(s) the ex_op brings to.
--ex_ctgy (default == nil) means extra categroy(s) the ex_op brings to.
--ex_flag (defualt == nil) means extra property(s) the ex_tg and ex_op brings to.
--ex_flag (default == nil) means extra property(s) the ex_tg and ex_op brings to.
--ex_tg (defualt == aux.TRUE) means add an additional target-check to this function.
--ex_tg (default == aux.TRUE) means add an additional target-check to this function.
--[[ex_op (defualt == nil) means add an additional operation to this function.
--[[ex_op (default == nil) means add an additional operation to this function.
call ex_op(e, tp, eg, ep, ev, re, r, rp, chk)
call ex_op(e, tp, eg, ep, ev, re, r, rp, chk)
if chk == 0, means do this operation before negate-operation, and only this function returns true, the negate-operation will be continued.
if chk == 0, means do this operation before negate-operation, and only this function returns true, the negate-operation will be continued.
if chk == 1, means do this operation after both the negate-operation and the operate-negated-card-operation(if has) be operated successfully (return true)
if chk == 1, means do this operation after both the negate-operation and the operate-negated-card-operation(if has) be operated successfully (return true)
...
@@ -2628,19 +2699,19 @@ end
...
@@ -2628,19 +2699,19 @@ end
--[[times: nil every phase
--[[times: nil every phase
0 next phase
0 next phase
1 or + times phase
1 or + times phase
whos: nil each player
whos: nil/2 each player
tp yours phase
tp yours phase
1-tp your opponent's phase
1-tp your opponent's phase
--]]
--]]
--fun_obj can be string-format, as the index to find the operate function in Scl.Category_List, or can be a function that will be call operate(g, e, tp, ...)
--fun_obj can be string-format, as the index to find the operate function in Scl.Category_List, or can be a function that will be call operate(g, e, tp, ...)
{ 1.list_typ == "Cost/Target/~Target/Operation", 2.card filter or { card filter, group filter },
{ 1.list_typ == "Cost/Target/~Target/Operation",
3.string-format categroy or {string-format categroy, repalce_operation}, 4.self's zonse, 5.opponent's zones,
2.string-format categroy or {string-format categroy, repalce_operation}, 3.card filter or { card filter, group filter },
6.min count, 7.max count, 8.cannot check/select card or card group, 9.reuseable index }
4.self's zonse,
5.opponent's zones,
6.min count,
7.max count,
8.cannot check/select card or card group,
9.reuseable index }
Paramas explain:
Paramas explain:
2.card filter (default == aux.TRUE): the checked/selected card(s) must meet the conditions this filter points to. If the filter is be defined by official "Card" or "aux" metatable, the function will call filter(c) to check, otherwise will call filter(c, e, tp, ...).
2.card filter (default == aux.TRUE): the checked/selected card(s) must meet the conditions this filter points to. If the filter is be defined by official "Card" or "aux" metatable, the function will call filter(c) to check, otherwise will call filter(c, e, tp, ...).
group filter (default == aux.TRUE): if check/select 2+ cards as a group at the same time, that group must meet the conditions this filter points to. If the filter is be defined by official "Group" or "aux" metatable, the function will call filter(g) to check, otherwise will call filter(g, e, tp, ...).
group filter (default == aux.TRUE): if check/select 2+ cards as a group at the same time, that group must meet the conditions this filter points to. If the filter is be defined by official "Group" or "aux" metatable, the function will call filter(g) to check, otherwise will call filter(g, e, tp, ...).
...
@@ -3212,7 +3308,7 @@ end
...
@@ -3212,7 +3308,7 @@ end
9.reuseable index (default == 0), if list-A with a reuseable index pass the check, the other lists with same index cannot duplicate check list-A's checked card(s).
9.reuseable index (default == 0), if list-A with a reuseable index pass the check, the other lists with same index cannot duplicate check list-A's checked card(s).
Example A, "You can send 1 monster on the field to GY, and if you do, banish 1 monster on the field" - If there is only one card on the field, and that card can either be sent to GY or banished, obviously, you cannot activate this effect, you cannot check that card twice, so you should set a same reuseable index in both 2 lists, to prevent the duplicate check.
Example A, "You can send 1 monster on the field to GY, and if you do, banish 1 monster on the field" - If there is only one card on the field, and that card can either be sent to GY or banished, obviously, you cannot activate this effect, you cannot check that card twice, so you should set a same reuseable index in both 2 lists, to prevent the duplicate check.
Example B, "You can negate the effects of 1 face-up monster on the field, and if you do, increase 1000 ATK to 1 face-up monster on the field." - If their is only 1 face-up card on the field, and that card's effects can be negated, obviously, you activate this effect, you can check that card twice, so you should set different reuseable indexes in that 2 lists, to allow the duplicate check.
Example B, "You can negate the effects of 1 face-up monster on the field, and if you do, increase 1000 ATK to 1 face-up monster on the field." - If their is only 1 face-up card on the field, and that card's effects can be negated, obviously, you activate this effect, you can check that card twice, so you should set different reuseable indexes in that 2 lists, to allow the duplicate check.
2.extra_operate_function: add an additional operate to the effect cost/target, call extra_operate_function(current list's selected card(s), all above lists's selected card(s),e, tp, eg, ...) to operate.
2.extra_operate_function: add an additional operate to the effect cost/target, call extra_operate_function(current list's selected card(s), all above lists's selected card(s),e, tp, eg, ...) to operate.
//return list_typ, extra_operate_function
//return list_typ, extra_operate_function
...
@@ -3238,14 +3334,14 @@ function s.get_cost_or_target_or_operation_paramas(arr, e, tp, eg, ep, ev, re, r
...
@@ -3238,14 +3334,14 @@ function s.get_cost_or_target_or_operation_paramas(arr, e, tp, eg, ep, ev, re, r
--1.list type ("Cost", "~Target", "Target","PlayerTarget","Operation","ExtraCheck","ExtraOperation")
--1.list type ("Cost", "~Target", "Target","PlayerTarget","Operation","ExtraCheck","ExtraOperation")
--there are some effects, that their real costs will affect their operations. If you register their costs by Effect.SetCost directly, it will cause bug when the effects are copied by other copy effects, because the copy effects only copy the effect targets and operations, ignore costs. To avoid the bugs, use Effect.SetLabel as a dummy cost, and register the real cost in effect target.
--there are some effects, that their real costs will affect their operations. If you register their costs by Effect.SetCost directly, it will cause bug when the effects are copied by other copy effects, because the copy effects only copy the effect targets and operations, ignore costs. To avoid the bugs, use Effect.SetLabel as a dummy cost, and register the real cost in effect target.
--code default == 100
--code default == 100
functionscl.cost_check_copy_status(code)
functionscl.cost_set_copy_status(code)
returnfunction(e,tp,eg,ep,ev,re,r,rp,chk)
returnfunction(e,tp,eg,ep,ev,re,r,rp,chk)
e:SetLabel(codeor100)
e:SetLabel(codeor100)
returntrue
returntrue
...
@@ -3873,11 +3982,11 @@ end
...
@@ -3873,11 +3982,11 @@ end
--cost: once per chain
--cost: once per chain
--flag_code default == the effect handler's original code.
--flag_code default == the effect handler's original code.
--player_lim default == false, == true means "you can only use xxx's effect once per chain"
--player_lim default == false, == true means "you can only use xxx's effect once per chain"
--pos can be constant like POS_ATTACK, or can be string-format, "+" means faceup, "-" means facedown, "1" means attack, "0" means defense (see Scl.Position_List)
--the format of ... : phase_str1, player1, phase_str2, player2, ... ("Or" check)
--the format of ... : phase_str1, player1, phase_str2, player2, ... ("Or" check)
--OR can be { phase_str1, player1, phase_str2, player2, ... }, { phase_strA, playerA, phase_strB, playerB, ... }, ... ("And" check)
--OR can be { phase_str1, player1, phase_str2, player2, ... } ... ("And" check)
--phase_str can be string-fromat (like "MP" or "MP,BP"), the function will split phase_obj to single phase strings and use them as index to find the corresponding number or function format phase in Scl.Phase_List.
--phase_str can be string-fromat (like "MP" or "MP,BP"), the function will split phase_obj to single phase strings and use them as index to find the corresponding number or function format phase in Scl.Phase_List.
--you can add "~" as prefix to the phase_str, the function will turn to mean "excpet in XXX Phase".
--you can add "~" as prefix to the phase_str, the function will turn to mean "excpet in XXX Phase".
--player (default == nil): if == 0, means in your turn, if == 1, means in your opponent's turn, if == nil, means in any player's turn.
--player (default == nil): if == 0, means in your turn, if == 1, means in your opponent's turn, if == 2, means in any player's turn.
-->>eg1. scl.cond_in_phase("M1")
-->>eg1. scl.cond_in_phase("M1", 2)
-->>check the current phase is the Main Phase1 or not.
-->>check the current phase is the Main Phase1 or not.
-->>eg2. scl.cond_in_phase("M1,BP")
-->>eg2. scl.cond_in_phase("M1,BP", 2)
-->>check the current phase is the Main Phase1 or Battle Phase, or not.
-->>check the current phase is the Main Phase1 or Battle Phase, or not.
-->>eg3. scl.con_phase("~MP")
-->>eg3. scl.con_phase("~MP", 2)
-->>check the current phase is not Main Phase.
-->>check the current phase is not Main Phase.
-->>eg4. scl.con_phase("~MP", 0, "BP", 1)
-->>eg4. scl.con_phase("~MP", 0, "BP", 1)
-->>check the current phase is not in your turn's Main Phase, or in your opponent's Battle Phase.
-->>check the current phase is not in your turn's Main Phase, or in your opponent's Battle Phase.
-->>eg4. scl.con_phase({"~MP", 0}, {"~BP", 1})
-->>eg4. scl.con_phase({"~MP", 0, "~BP", 1})
-->>check the current phase is not in your turn's Main Phase, and not in your opponent's Battle Phase.
-->>check the current phase is not in your turn's Main Phase, and not in your opponent's Battle Phase.
--Select minct ~ maxct cards that meets filter_obj, from self_zone and/or oppo_zone, except except_obj.
--Select minct ~ maxct cards that meets filter_obj, from self_zone and/or oppo_zone, except except_obj.
--use sel_hint as select hint (see Scl.SelectHint)
--use sel_hint as select hint (see Scl.HintSelect)
--filter_obj can be single card_filter, or be { card_filter, group_filter }, the selected cards must meet card_filter(c, ...), and the selected group must meet group_filter(g, ...)
--filter_obj can be single card_filter, or be { card_filter, group_filter }, the selected cards must meet card_filter(c, ...), and the selected group must meet group_filter(g, ...)
@@ -4214,7 +4429,7 @@ function s.more_returns_operate(fun1, ...)
...
@@ -4214,7 +4429,7 @@ function s.more_returns_operate(fun1, ...)
end
end
returnct,og,tc
returnct,og,tc
end
end
--equip the "equip_obj" as equip card to "equip_target", on "ep"'s (defualt == e's handler player) field.
--equip the "equip_obj" as equip card to "equip_target", on "ep"'s (default == e's handler player) field.
--"equip_obj" can be card or group, if is a group, and there are not enough zones form all of them to equip, you will select cards witch you want to keep equip.
--"equip_obj" can be card or group, if is a group, and there are not enough zones form all of them to equip, you will select cards witch you want to keep equip.
--keep_face_up (default == true) == false, means equip with "equip_obj"'s current position.
--keep_face_up (default == true) == false, means equip with "equip_obj"'s current position.
--if the "equip_obj" don't have EFFECT_EQUIP_LIMIT buff, this function will auto register to it.
--if the "equip_obj" don't have EFFECT_EQUIP_LIMIT buff, this function will auto register to it.
...
@@ -4231,7 +4446,7 @@ function Scl.Equip(equip_obj, equip_target, ep, keep_face_up)
...
@@ -4231,7 +4446,7 @@ function Scl.Equip(equip_obj, equip_target, ep, keep_face_up)
--to spell and trap, use Duel.SSet, to monster, special summon them in facedown defense position
--to spell and trap, use Duel.SSet, to monster, special summon them in facedown defense position
--Bug in set extra deck monsters
--Bug in set extra deck monsters
--return set count, set group, first set card
--return set count, set group, first set card
functionScl.SetCards(card_obj,sp,tp,confirm)
functionScl.SetCard(card_obj,sp,tp,confirm)
locale,_,p=Scl.GetCurrentEffectInfo()
locale,_,p=Scl.GetCurrentEffectInfo()
sp=sporp
sp=sporp
tp=tporsp
tp=tporsp
...
@@ -4802,7 +5111,7 @@ function Scl.SetCards(card_obj, sp, tp, confirm)
...
@@ -4802,7 +5111,7 @@ function Scl.SetCards(card_obj, sp, tp, confirm)
end
end
localct,og=0,Group.CreateGroup()
localct,og=0,Group.CreateGroup()
if#stg>sftthen
if#stg>sftthen
Scl.SelectHint(sp,HINTMSG_SET)
Scl.HintSelect(sp,HINTMSG_SET)
sg=stg:Select(sp,sft,sft,nil)
sg=stg:Select(sp,sft,sft,nil)
end
end
if#sg>0then
if#sg>0then
...
@@ -4811,7 +5120,7 @@ function Scl.SetCards(card_obj, sp, tp, confirm)
...
@@ -4811,7 +5120,7 @@ function Scl.SetCards(card_obj, sp, tp, confirm)
og:Merge(og2)
og:Merge(og2)
end
end
if#mg>mftthen
if#mg>mftthen
Scl.SelectHint(sp,HINTMSG_SET)
Scl.HintSelect(sp,HINTMSG_SET)
sg=mg:Select(sp,mft,mft,nil)
sg=mg:Select(sp,mft,mft,nil)
end
end
if#sg>0then
if#sg>0then
...
@@ -4820,7 +5129,7 @@ function Scl.SetCards(card_obj, sp, tp, confirm)
...
@@ -4820,7 +5129,7 @@ function Scl.SetCards(card_obj, sp, tp, confirm)
og:Merge(og2)
og:Merge(og2)
end
end
ifconfirmand#og>0then
ifconfirmand#og>0then
Duel.ConfirmCards(1-tp,og)
Duel.ConfirmCards(1-tp,og)
end
end
returnct,og,og:GetFirst()
returnct,og,og:GetFirst()
end
end
...
@@ -5040,7 +5349,7 @@ function Scl.GetSZoneCount(p1, leave_obj, p2, zone)
...
@@ -5040,7 +5349,7 @@ function Scl.GetSZoneCount(p1, leave_obj, p2, zone)
end
end
--Get surrounding zone (up, down, left & right zone)
--Get surrounding zone (up, down, left & right zone)
--obj: can be card or group, or zone index (if you want to transfer zone index, you can use aux.SequenceToGlobal to get that zone index).
--obj: can be card or group, or zone index (if you want to transfer zone index, you can use aux.SequenceToGlobal to get that zone index).
--lim_zone_obj (defult == "OnField"): can be "OnField", "MonsterZone" or "Spell&TrapZone", means get which kind of surrounding zones.
--lim_zone_obj (default == "OnField"): can be "OnField", "MonsterZone" or "Spell&TrapZone", means get which kind of surrounding zones.
--tp: use this player's camera to see the zone index
--tp: use this player's camera to see the zone index
--contain_self (default == false): include itself's zone (mid)
--contain_self (default == false): include itself's zone (mid)
--//return zones
--//return zones
...
@@ -5125,7 +5434,7 @@ function Scl.GetPreviousSurroundingZone(obj, lim_zone_obj, tp, contain_self)
...
@@ -5125,7 +5434,7 @@ function Scl.GetPreviousSurroundingZone(obj, lim_zone_obj, tp, contain_self)
end
end
--Get adjacent zone (left & right zone)
--Get adjacent zone (left & right zone)
--obj: can be card or group, or zone index (if you want to transfer zone index, you can use aux.SequenceToGlobal to get that zone index).
--obj: can be card or group, or zone index (if you want to transfer zone index, you can use aux.SequenceToGlobal to get that zone index).
--lim_zone_obj (defult == "OnField"): can be "OnField", "MonsterZone" or "Spell&TrapZone", means get which kind of adjacent zones.
--lim_zone_obj (default == "OnField"): can be "OnField", "MonsterZone" or "Spell&TrapZone", means get which kind of adjacent zones.
--tp: use this player's camera to see the zone index
--tp: use this player's camera to see the zone index
--contain_self (default == false): include itself's zone (mid)
--contain_self (default == false): include itself's zone (mid)
--//return zones
--//return zones
...
@@ -5306,7 +5615,7 @@ end
...
@@ -5306,7 +5615,7 @@ end
3. Love.IsLinkSeries(c) -- equal to Scl.IsLinkSeries(c, "YiFanJiang")
3. Love.IsLinkSeries(c) -- equal to Scl.IsLinkSeries(c, "YiFanJiang")
4. Love.IsPreviousSeries(c) -- equal to Scl.IsPreviousSeries(c, "YiFanJiang")
4. Love.IsPreviousSeries(c) -- equal to Scl.IsPreviousSeries(c, "YiFanJiang")
5. Love.IsOriginalSeries(c) -- equal to Scl.IsOriginalSeries(c, "YiFanJiang")
5. Love.IsOriginalSeries(c) -- equal to Scl.IsOriginalSeries(c, "YiFanJiang")
6~10 Love.IsXXXXSeriesMonster(c) (XXXX can be "", "Fusion", "Link" ……, see above)-- equal to Scl.IsXXXXSeries(c, "YiFanJiang") and c:IsType(TYPE_MONSTER)
6~10 Love.IsXXXXSeriesMonster(c) (XXXX can be "", "Fusion", "Link" ……, see above)-- equal to Scl.IsXXXXSeries(c, "YiFanJiang") and c:IsType(TYPE_MONSTER)
11~15 Love.IsXXXXSeriesSpell(c) (XXXX can be "", "Fusion", "Link" ……, see above) -- equal to Scl.IsXXXXSeries(c, "YiFanJiang") and c:IsType(TYPE_SPELL)
11~15 Love.IsXXXXSeriesSpell(c) (XXXX can be "", "Fusion", "Link" ……, see above) -- equal to Scl.IsXXXXSeries(c, "YiFanJiang") and c:IsType(TYPE_SPELL)
16~20 Love.IsXXXXSeriesTrap(c) (XXXX can be "", "Fusion", "Link" ……, see above) -- equal to Scl.IsXXXXSeries(c, "YiFanJiang") and c:IsType(TYPE_TRAP)
16~20 Love.IsXXXXSeriesTrap(c) (XXXX can be "", "Fusion", "Link" ……, see above) -- equal to Scl.IsXXXXSeries(c, "YiFanJiang") and c:IsType(TYPE_TRAP)
21~25 Love.IsXXXXSeriesSpellOrTrap(c) (XXXX can be "", "Fusion", "Link" ……, see above) -- equal to Scl.IsXXXXSeries(c, "YiFanJiang") and c:IsType(TYPE_SPELL + TYPE_TRAP)
21~25 Love.IsXXXXSeriesSpellOrTrap(c) (XXXX can be "", "Fusion", "Link" ……, see above) -- equal to Scl.IsXXXXSeries(c, "YiFanJiang") and c:IsType(TYPE_SPELL + TYPE_TRAP)
...
@@ -5340,20 +5649,18 @@ function Scl.define_inside_series(prefix, suffix, series_str)
...
@@ -5340,20 +5649,18 @@ function Scl.define_inside_series(prefix, suffix, series_str)
end
end
end
end
--Get the activate effect's handler, and if it is relate to chain
--Get the activate effect's handler, and if it is relate to chain
--if faceup == true, add the additional check that the handler must be faceup position.
--For continous effects, PLZ use Effect.GetHandler, don't use this function
--For continous effects, PLZ use Effect.GetHandler, don't use this function
--Get effect target(s) that is releate to chain and meets filter(c, ...)
--Get effect target(s) that is releate to chain and meets filter(c, ...)
--//return target group, first target card
--//return target group, first target card
...
@@ -5416,7 +5723,7 @@ function s.add_summon_procedure_con(con)
...
@@ -5416,7 +5723,7 @@ function s.add_summon_procedure_con(con)
end
end
end
end
--Add normal summon procedure
--Add normal summon procedure
--if the parama "limit" (defualt == false) == true, means force that monster's normal summon procedure by this function, it cannot be normal summoned by other ways, and the summon procedure will auto set property "!NegateEffect,Uncopyable".
--if the parama "limit" (default == false) == true, means force that monster's normal summon procedure by this function, it cannot be normal summoned by other ways, and the summon procedure will auto set property "!NegateEffect,Uncopyable".
--this function will also auto add c == nil check to "con", and add the parama "tp" to "con" check (return con(e, c, tp, minct))
--this function will also auto add c == nil check to "con", and add the parama "tp" to "con" check (return con(e, c, tp, minct))
--if the parama "limit" (defualt == false) == true, means force that monster's normal summon procedure by this function, it cannot be normal summoned by other ways, and the summon procedure will auto set property "!NegateEffect,Uncopyable".
--if the parama "limit" (default == false) == true, means force that monster's normal summon procedure by this function, it cannot be normal summoned by other ways, and the summon procedure will auto set property "!NegateEffect,Uncopyable".
--this function will also auto add c == nil check to "con", and add the parama "tp" to "con" check (return con(e, c, tp, minct))
--this function will also auto add c == nil check to "con", and add the parama "tp" to "con" check (return con(e, c, tp, minct))