Commit 109ace1a authored by Tachibana's avatar Tachibana

nmbd

parent 9709d0a4
......@@ -2,7 +2,7 @@
if not pcall(function() require("expansions/script/c10199991") end) then require("script/c10199991") end
local m = 10199990
local vm = 10199991
local Version_Number = 20210505
local Version_Number = 20210513
if rsv.Library_Switch then return end
rsv.Library_Switch = true
-----------------------"Part_Effect_Base"-----------------------
......@@ -632,7 +632,7 @@ function rsef.Attribute(reg_list, eff_type, att_list, val_list, tg, tg_range_lis
if rsof.Table_List(rsef.value_affect_self_srt_list, eff_code) and eff_type == "sv" and not reset_list then
eff_flag = eff_flag | EFFECT_FLAG_SINGLE_RANGE
end
if not range and (not reset_list or eff_flag & EFFECT_FLAG_SINGLE_RANGE ~= 0) then
if not range and (not reset_list or eff_flag & EFFECT_FLAG_SINGLE_RANGE ~= 0 or eff_type == "fv") then
range = rsef.GetRegisterRange(reg_list)
end
if reset_list then
......@@ -1257,8 +1257,6 @@ function rstg.SC_DestroyReplace(repfilter, tg)
end
if Duel.SelectEffectYesNo(tp, c, 96) then
rshint.Card(c:GetOriginalCode())
local container=e:GetLabelObject()
container:Merge(rg)
tg(e, tp, eg, ep, ev, re, r, rp, 1)
return true
end
......@@ -1468,19 +1466,15 @@ function rscf.AddTokenList(c,tk_code1,...)
for _, tk_code in pairs(tk_code_list) do
aux.AddCodeList(c,tk_code)
if not rstg.tk_list[tk_code] then
rstg.tk_list[tk_code] = { }
local ge1 = rsef.FC_Global(0, EVENT_ADJUST, tk_code, nil, rsop.AddTokenList_Op(tk_code))
end
end
end
function rsop.AddTokenList_Op(tk_code)
if not rstg.tk_list[tk_code] then
rstg.tk_list[tk_code] = { }
end
return function(e, tp)
for tk_code, tk_list in pairs(rstg.tk_list) do
if #tk_list == 0 then
tk_list = { [0] = Duel.CreateToken(0, tk_code), [1]= Duel.CreateToken(1, tk_code) }
end
if not rstg.tk_list[tk_code][1] then
rstg.tk_list[tk_code] = { [0] = Duel.CreateToken(0, tk_code), [1]= Duel.CreateToken(1, tk_code) }
end
end
end
......@@ -1523,14 +1517,18 @@ function rssf.CheckTokenSummonable(e, tp, tk_code_or_fun, sum_pos, tg_p, sum_zon
not Duel.IsPlayerCanSpecialSummonMonster(tp, tk_code, tk_set, tk_type, tk_atk, tk_def, tk_lv, tk_race, tk_att, sum_pos, sp, sum_type) then
return false
end
if tk and not tk:IsCanBeSpecialSummoned(e, sum_type or 0, tp, false, false, sum_pos, sp, sum_zone) then
return false
if tk then
if not sum_zone then
return tk:IsCanBeSpecialSummoned(e, sum_type or 0, tp, false, false, sum_pos, sp)
else
return tk:IsCanBeSpecialSummoned(e, sum_type or 0, tp, false, false, sum_pos, sp, sum_zone)
end
end
return true
end
function rssf.SpecialSummonToken(e, tp, tk_code_or_fun, minct, maxct, sum_pos, tg_p, sum_zone, ...)
local res_ct = 0
local res = rssf.CheckTokenSummonable(e, tp, tk_code_or_fun, minct, sum_pos, tg_p, sum_zone, ...)
local res = rssf.CheckTokenSummonable(e, tp, tk_code_or_fun, sum_pos, tg_p, sum_zone, ...)
if not res then return res_ct end
local ft = Duel.GetLocationCount(sp, LOCATION_MZONE, tp)
if ft <= 0 then return false end
......@@ -1579,6 +1577,7 @@ end
--Effect Target: Negative Effect / Activate
function rstg.disneg(dn_type, dn_str, ex_tg)
return function(e, tp, eg, ep, ev, re, r, rp, chk, chkc)
dn_str = dn_str or "dum"
local c = e:GetHandler()
local rc = re:GetHandler()
if chkc then return ex_tg(e, tp, eg, ep, ev, re, r, rp, chk, chkc) end
......@@ -1764,7 +1763,7 @@ function rstg.GetTargetAttribute(e, tp, eg, ep, ev, re, r, rp, target_list)
--case 2.3
if type(filter_card) == "number" then
if filter_card == 0 then
loc_self = true
loc_self = nil
elseif filter_card > 0 and not loc_self then
loc_self = 0xff
minct = filter_card
......@@ -2221,7 +2220,7 @@ function rscost.CostSolve(selected_group, category_str_list, category_fun, list_
if not category_str_list or #category_str_list == 0 then return true end
local reason = list_type == "cost" and REASON_COST or REASON_EFFECT
if reason ~= REASON_COST then
rsop.CheckOperationHint(g)
rsop.CheckOperationHint(selected_group)
end
return rsop.Operation_Solve(selected_group, solve_string, reason, { }, 1, e, tp, eg, ep, ev, re, r, rp)
end
......@@ -2484,7 +2483,7 @@ function rscon.phase(p1, ...)
end
--Condition in Main Phase
function rscon.phmp(e)
return rscon.phase("mp1, mp2")(e)
return rscon.phase("mp1,mp2")(e)
end
--Condition: Phase no damage calculate , for change atk / def
function rscon.adcon(e)
......@@ -2569,7 +2568,7 @@ function rscon.disneg(dn_type, dn_filter, pl_fun)
if type(dn_filter) == "string" then
local str_list = rsof.String_Split(dn_filter)
for _, dn_str in pairs(str_list) do
if rsef.Effect_Type_Check(dn_str, e) then return true end
if rsef.Effect_Type_Check(dn_str, re) then return true end
end
end
return false
......@@ -2645,20 +2644,25 @@ function rsop.disneg(dn_type, dn_str, ex_op)
return function(e, tp, eg, ep, ev, re, r, rp)
local c = e:GetHandler()
local rc = re:GetHandler()
local res = ex_op(e, tp, eg, ep, ev, re, r, rp, 0)
if rsof.Check_Boolean(res,false) then return end
local res = not ex_op and true or ex_op(e, tp, eg, ep, ev, re, r, rp, 0)
if rsof.Check_Boolean(res,true) or type(res) == "nil" then
if dn_type == "dis" then
res = Duel.NegateEffect(ev)
else
res = Duel.NegateActivation(ev)
end
if rsof.Check_Boolean(res,false) then return end
if rsof.Check_Boolean(res,true) then
if dn_str and dn_str ~= "dum" and not rc:IsRelateToEffect(re) then
res = false
end
if dn_str and rc:IsRelateToEffect(re) then
res = rsop.Operation_Solve(eg, dn_str, REASON_EFFECT, { }, 1, e, tp, eg, ep, ev, re, r, rp) > 0
end
if res then
end
if res or type(res) == "nil" then
ex_op(e, tp, eg, ep, ev, re, r, rp, 1)
end
end
ex_op(e, tp, eg, ep, ev, re, r, rp, 2)
end
end
......@@ -2758,7 +2762,7 @@ function rsop.Equip(e, equip_card, equip_target, keep_face_up, equip_oppo_side,
e1:SetLabelObject(equip_target)
if equip_target == c then e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) end
else
eff_list = { eqc:IsHasEffect(EFFECT_EQUIP_LIMIT) }
eff_list = { equip_card:IsHasEffect(EFFECT_EQUIP_LIMIT) }
e1 = eff_list[1]
end
if equip_quick_buff then
......@@ -2790,7 +2794,7 @@ function rsop.CheckOperateCorrectly(solve_loc, check_count)
end
--Operation: Send to Deck and Draw
function rsop.ToDeckDraw(dp, dct, is_break, check_count)
local res = rsop.CheckOperateCorrectly(solve_loc, check_count)
local res, ct, g = rsop.CheckOperateCorrectly(rsloc.de, check_count)
if not res then return 0 end
if g:IsExists(Card.IsLocation, 1, nil, LOCATION_DECK) then
Duel.ShuffleDeck(dp)
......@@ -2884,7 +2888,7 @@ function rsop.SendtoHand(corg, p, reason, no_confirm)
end
end
end
return ct
return ct, og, tc
end
--Operation: Send to deck
function rsop.SendtoDeck(corg, tp, seq, reason)
......@@ -2992,14 +2996,16 @@ function rsop.ChangePosition(corg, p1, p2, p3, p4, ...)
if tc:IsCanChangePosition() and (tc:IsAttackPos() or tc:IsFacedown()) then
pos = pos | POS_FACEUP_DEFENSE
end
pos = Duel.SelectPosition(tp, pos)
pos = Duel.SelectPosition(tp, tc, pos)
ct2, og2 = rsop.Operation(Duel.ChangePosition, tc, pos)
ct = ct + ct2
og:Merge(og2)
end
return ct, og, og:GetFirst()
else
elseif p2 then
return rsop.Operation(Duel.ChangePosition, sg, p1, p2, p3, p4, ...)
else
return rsop.Operation(Duel.ChangePosition, sg, p1, p1, p1, p1, ...)
end
end
--Operation: Get control
......@@ -3194,13 +3200,15 @@ function rsop.SortDeck(corg, seq, confirm)
return #g, g, g:GetFirst()
end
--Operation function:Overlay
function rsop.Overlay_Filter(c,e)
if not e then return c:IsCanOverlay()
else
return not c:IsImmuneToEffect(e) and c:IsCanOverlay(e:GetHandlerPlayer())
end
end
function rsop.Overlay(e, xyzc, mat_corg, set_sum_mat, ex_over)
--e = e or Duel.GetChainInfo(0,CHAININFO_TRIGGERING_EFFECT)
local g = rsgf.Mix2(mat_corg)
if e then
local img = g:Filter(Card.IsImmuneToEffect,nil,e)
g:Sub(img)
end
local g = rsgf.Mix2(mat_corg):Filter(rsop.Overlay_Filter,nil,e)
if not xyzc or not xyzc:IsType(TYPE_XYZ) or #g <= 0 then return 0, nil end
local tg = Group.CreateGroup()
for tc in aux.Next(g) do
......@@ -3213,6 +3221,11 @@ function rsop.Overlay(e, xyzc, mat_corg, set_sum_mat, ex_over)
Duel.SendtoGrave(tg, REASON_RULE)
end
end
for tc in aux.Next(g) do
if tc:IsType(TYPE_SPELL+TYPE_TRAP) and (tc:IsOnField() or tc:IsStatus(STATUS_ACTIVATE_DISABLED)) then
tc:CancelToGrave()
end
end
if set_sum_mat then
xyzc:SetMaterial(g)
end
......@@ -4485,13 +4498,13 @@ end
function rscf.spfilter(f, ...)
local ext_paramms = { ... }
return function(c, e, tp)
return c:IsCanBeSpecialSummoned(e, 0, tp, false, false) and (not f or f(c, table.unpack(rsof.Table_Mix(ext_paramms, { e, tp }))))
return c:IsCanBeSpecialSummoned(e, 0, tp, false, false) and (not f or f(c, table.unpack(rsof.Table_Mix(ext_paramms, { e, tp })))) and c:IsType(TYPE_MONSTER)
end
end
function rscf.spfilter2(f, ...)
local ext_paramms = { ... }
return function(c, e, tp)
return c:IsCanBeSpecialSummoned(e, 0, tp, false, false) and (not f or f(c, table.unpack(rsof.Table_Mix(ext_paramms, { e, tp })))) and rszsf.GetUseAbleMZoneCount(c, tp) > 0
return c:IsCanBeSpecialSummoned(e, 0, tp, false, false) and (not f or f(c, table.unpack(rsof.Table_Mix(ext_paramms, { e, tp })))) and rszsf.GetUseAbleMZoneCount(c, tp) > 0 and c:IsType(TYPE_MONSTER)
end
end
--Card filter function : Face - up from Remove
......
......@@ -398,6 +398,9 @@ function rsef.Get_Value_Effect_Attribute_List()
, ["mat"] = { EFFECT_MATERIAL_CHECK, 1, nil, nil, EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_SET_AVAILABLE+EFFECT_FLAG_IGNORE_RANGE }
, ["ormat"] = { EFFECT_OVERLAY_RITUAL_MATERIAL, 1 } , ["grmat"] = { EFFECT_EXTRA_RITUAL_MATERIAL, 1 }
, ["fmat"] = { EFFECT_EXTRA_FUSION_MATERIAL, 1 }
}
......@@ -406,7 +409,11 @@ function rsef.Get_Value_Effect_Attribute_List()
, "im", "indb", "inde", "indct", "ind", "tgb~", "tge~"
, "fcode", "fset", "latt", "lrace", "lcode", "lset" }
, "fcode", "fset", "latt", "lrace", "lcode", "lset"
, "ormat", "grmat", "fmat"
}
local affect_self_list2 = { }
for _, str in pairs(affect_self_list) do
......@@ -772,6 +779,7 @@ function rsef.FV_LIMIT(reg_list, lim_list, val_list, tg, tg_range_list, con, res
end
--Field Val Effect: Other Limit (affect Player)
function rsef.FV_LIMIT_PLAYER(reg_list, lim_list, val_list, tg, tg_range_list, con, reset_list, flag, desc_list)
local str_list2 = rsef.LIMIT_List(lim_list)
return rsef.FV_Player(reg_list, str_list2, val_list, tg, tg_range_list, flag, nil, con, reset_list, desc_list)
end
--Leave field list
......
......@@ -96,12 +96,14 @@ local rsch = Churck
#XueXiao 3234454893
local rsmd = Mrs_Dice
local rsxjm = XueJiMo
#HuangWu 1103516856
local rsdc = Dragon_Caller
#BoJue 1025644096
local rsad = Ancient_Dragon
local rsfwh = Flame_Witch
#ZhenLiXiYaZhiChongHuoMo 3129411731
local rsmmd = Mo_Jie_Di_Di
......
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