["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"}},
["PlaceInFieldZone"]={"Place in spell and trap zone",0,HINTMSG_TOFIELD,DESC_PLACE_TO_FIELD_SCL,nil,{Scl.Place2Field,7,sg,tp,tp,"FieldZone"}},
["PlaceInPendulumZone"]={"Place in spell and trap zone",0,HINTMSG_TOFIELD,DESC_PLACE_TO_FIELD_SCL,nil,{Scl.Place2Field,7,sg,tp,tp,"PendulumZone"}},
--Register Condition, Cost, Target and Operation for reg_eff
--cost, target and operation can be function or array. If be array-format, it calls s.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.
--//return effect for code1, effect for code2, ...
-->>this function is an intermediate function, eg see Scl.CreateSingleBuffEffect, Scl.CreateSingleBuffCondition, Scl.CreateFieldBuffEffect, Scl.CreatePlayerBuffEffect and Scl.AddSingleBuff, Scl.AddEquipBuff
scl.list_format_cost_or_target_or_operation(ex_op)(e, tp, eg, ep, ev, re, r, rp, 2)
end
end
--Mix several single activate effects into one activate effect.
...
...
@@ -2361,7 +2380,7 @@ function Scl.CreateQuickOptionalEffect(reg_obj, code, desc_obj, lim_obj, ctgy, f
end
--Create a quick effect, negate the card's effect (neg_typ == "NegateEffect") or activation (neg_typ == "NegateActivation").
--op_str is the index to find the corresponding operation and the extra category(s) in Scl.Category_List, means negate the effect/activation, and do that operation to the negated card.
--con can be function, nil, or be a array { ... }, if be nil or array-format, it equals to call the s.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 + EFFECT_FLAG_DAMAGE_CAL" to the property if neg_typ == "NegateActivation".
--ex_ctgy (defualt == nil) means extra categroy(s) the ex_op brings to.
...
...
@@ -2381,9 +2400,9 @@ function Scl.CreateQuickOptionalEffect_Negate(reg_obj, neg_typ, op_str, lim_obj,
reg_ctgy = neg_typ == "NegateActivation" and reg_ctgy | CATEGORY_NEGATE or reg_ctgy | CATEGORY_DISABLE
local reg_flag = Scl.GetNumFormatProperty(ex_flag or 0)
reg_flag = neg_typ == "NegateActivation" and reg_flag | (EFFECT_FLAG_DAMAGE_CAL + EFFECT_FLAG_DAMAGE_STEP) or reg_flag | ( EFFECT_FLAG_DAMAGE_STEP)
--Special Summon a monster to either player's field, call Scl.AddSummonBuff and Scl.AddSummonBuff2Self.
--Special Summon a monster to either player's field, call Scl.AddSingleBuff and Scl.AddSingleBuff2Self.
--use nearly same as Duel.SpecialSummon.
--but the parama - zone_pl is useless, it is replaced by sum_eff (summon effect), to check whether the card(s) can be special summoned.
--also the parama - sum_zone is change to array-format { [0] = number-format zone0, [1] = number-format zone1 }, means can special summon to player 0's zone0, or special summon to player1's zone1 (default == { [0] == 0x1f }, { [1] == 0x1f }).
...
...
@@ -3029,7 +3058,7 @@ function scl.target_special_summon_token(tk_code_or_fun, ct, sum_pos, tg_p, leav
--Get effect cost/target/operation paramas form list, for quick set the effect cost/target/operation (s.list_format_cost_or_target_or_operation(list))
--"s.list_format_cost_or_target_or_operation" will first check if all lists is meet their condition, if the effect pass all lists' checks, you can activate/solve that effect, then do some different operations, depending on each list's first parama - list_typ
--Get effect cost/target/operation paramas form list, for quick set the effect cost/target/operation (scl.list_format_cost_or_target_or_operation(list))
--"scl.list_format_cost_or_target_or_operation" will first check if all lists is meet their condition, if the effect pass all lists' checks, you can activate/solve that effect, then do some different operations, depending on each list's first parama - list_typ
--[[
the first parama in the list always be list_typ, it means that list's kind.
list_typ == "Cost", means it is a cost-list (using in Effect.SetCost), when you activate the effect, you must select a number of cards (depending the list's "minct" and "maxct" prarmas) form the card groups that meet the condition, then immediately do cost on them. If a cost indicated by one of the lists cannot be operated correctly, the remainder costs indicated by the remainder lists will be immediately termination of operation.
...
...
@@ -3241,7 +3270,7 @@ function s.get_cost_or_target_or_operation_paramas(arr, e, tp, eg, ep, ev, re, r
end
--Change a list-format effect cost/target/operation to function-format, using in Scl.CreatexxxEffect.
--list format and eg see s.get_cost_or_target_or_operation_paramas
function s.cost_or_target_or_operation_group_check(g, parama, arr1, ...)
--for some shenbi reasons, koshipro will lost paramas during the spell/trap card call this function, so I must use a table to protect the paramas, but original edition ygopro don't have this problem.
local e, tp, eg, ep, ev, re, r, rp, reuse_idx, used_arr, group_filter = table.unpack(parama)
local used_arr2, used_group_this_reuse_idx = s.cost_or_target_or_operation_reuse_cards_check(used_arr, reuse_idx, g)
if not s.operate_filter(group_filter)(g, e, tp, eg, ep, ev, re, r, rp) then
return false
...
...
@@ -3571,11 +3602,11 @@ function s.get_tribute_group_filter(c, zone_self, tp, re)
used_arr2[reuse_idx] = Scl.MixArrays(Scl.CloneArray(used_arr2[reuse_idx]), Scl.Group2CardList(used_group or Group.CreateGroup()))
return used_arr2, Scl.Mix2Group(used_arr2[reuse_idx]) + (except_group or Group.CreateGroup())
end
function s.operate_selected_cost_or_operat_objects(current_sel_object, total_sel_group, category_str, replace_operation, reason, e, tp, eg, ep, ev, re, r, rp)
if replace_operation then
...
...
@@ -3724,7 +3755,7 @@ function scl.cost_remove_counter_from_field(ct_typ, self_zone, oppo_zone, minct,
return function(e, tp, eg, ep, ev, re, r, rp, chk)
local minct2= Scl.CheckBoolean(minct) and Duel.GetCounter(self_zone, oppo_zone, ct_typ) or minct
local maxct2= Scl.CheckBoolean(maxct) and Duel.GetCounter(self_zone, oppo_zone, ct_typ) or maxct
return c:IsSummonType(SUMMON_TYPE_SPECIAL) and Scl.IsPreviouslyInZone(c, zone_obj) and (not player or (player == 0 and c:IsPreviousControler(tp)) or (player == 1 and c:IsPreviousControler(1 - tp)))
end
end
--Nested function
...
...
@@ -3978,7 +4009,7 @@ function scl.cond_is_card_exists(card_filter, self_zone, oppo_zone, ct, except_o
return function(e)
local self_zone2 = Scl.GetNumFormatZone(self_zone or LOCATION_MZONE)
local oppo_zone2 = Scl.GetNumFormatZone(oppo_zone or 0)
local facedowng = correctg:Filter(Card.IsFacedown, nil)
if#facedowng>0then
Duel.ConfirmCards(1-movep,facedowng)
if #facedowng > 0 and targetp == movep then
Duel.ConfirmCards(1 - targetp, facedowng)
end
return #correctg, correctg, correctg:GetFirst()
end
--Operation: activate "tc" to field
--use nearly same as Duel.MoveToField, but switch the sequence of the format "card_obj" and "movep"
--Operation: activate "tc" to field.
--if you want to activate a field spell, and there is a card currently in the field zone, this function will first send that card to GY, and will raise an event for "Ancient Pixie Dragon" after activated.
--it will do the cost of the activated card
--it will do the cost of the activated effect
--if apply_effect == true (default == false), it will do the target and operation of the activated effect.
--//return activated count, activated group, first activated card
local zone = aux.SequenceToGlobal(c:GetControler(), c:IsOnField() and c:GetLocation() or c:GetPreviousLocation(), c:IsOnField() and c:GetSequence() or c:GetPreviousSequence())
return zone & srd_zone == zone
end
--Get cards surround to obj while obj is leaves the field (up, down, left & right zone)
--paramas see Scl.GetSurroundingGroup
--//return group
function Scl.GetPreviousSurroundingGroup(obj, contains)