Commit 109ace1a authored by Tachibana's avatar Tachibana

nmbd

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