Commit 5553daf4 authored by Tachibana's avatar Tachibana

ndyd

parent 53d1d4ec
Pipeline #5097 passed with stages
in 21 minutes and 35 seconds
......@@ -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 = 20210614
local Version_Number = 20210618
if rsv.Library_Switch then return end
rsv.Library_Switch = true
-----------------------"Part_Effect_Base"-----------------------
......@@ -4657,57 +4657,6 @@ function rshint.SelectOption(p, ...)
return opval[op]
end
end
--Function: Select many options (nexpage and lastpage)
function rshint.SelectOption_Page(p, hint_list1, ...)
local hint_list = { hint_list1, ... }
local nextpage = {m + 1, 4 }
local lastpage = {m + 1, 5 }
local null = {m + 1, 6 }
local agree = {m + 1, 7 }
local op, currentpage = 0, 1
local len = #hint_list
local maxpage = len <= 4 and 1 or math.ceil((len - 1) / 3)
local pagehint = { }
for page = 1, maxpage do
pagehint[page] = { }
if page == 1 then
pagehint[page] = { hint_list[1], hint_list[2] or null, hint_list[3] or null, hint_list[4] or null }
elseif page > 1 then
local idx = page * 3-1
pagehint[page] = { hint_list[idx] or null, hint_list[idx + 1] or null, hint_list[idx + 2] or null }
end
if page ~= 1 then
table.insert(pagehint[page], 1, lastpage)
end
if page ~= maxpage then
table.insert(pagehint[page], 5, nextpage)
end
if page == maxpage then
table.insert(pagehint[page], 5, agree)
end
end
local currentpage = 1
repeat
op = Duel.SelectOption(p, rshint.SwitchHintFormat("s", pagehint[currentpage]) ) + 1
--null
if type(pagehint[currentpage][op]) == "table" and pagehint[currentpage][op][1] == null[1] and pagehint[currentpage][op][2] == null[2] then op = 0 end
--action agree
local res1 = currentpage == maxpage and op == 5
--action selected
local res2 = op ~= 1 and op ~= 5
--action selected first page
local res3 = op == 1 and currentpage == 1
--next page
if op == 5 and currentpage < maxpage then currentpage = currentpage + 1 end
--last page
if op == 1 and currentpage > 1 then currentpage = currentpage - 1 end
until op ~= 0 and (res1 or res2 or res3)
if op ~= 5 and op ~= 1 and currentpage ~= 1 then
op = 3 * currentpage + op - 3
end
local isfinsh = currentpage == maxpage and op == 5
return isfinsh and 0 or op
end
--Function: Select number options
function rshint.AnnounceNumber(tp, maxdigit)
maxdigit = maxdigit or 7
......@@ -4742,43 +4691,6 @@ function rshint.AnnounceNumber(tp, maxdigit)
until op == 0
return num
end
--Function: Select number options 2
function rshint.AnnounceNumber_List(tp, num1, ...)
local selectnum = {m + 1, 8 }
local add = {m + 1, 11 }
local confirm = {m + 1, 9 }
local clear = {m + 1, 10 }
local agree = {m + 1, 7 }
local num = 0
repeat
op = rsop.SelectOption_Page(tp, selectnum, add, confirm, clear)
if op == 3 then
Debug.Message("Confirm select number:" .. num)
elseif op == 4 then
num = 0
elseif op == 1 then
num = Duel.AnnounceNumber(tp, num1, ...)
elseif op == 2 then
num = num + Duel.AnnounceNumber(tp, num1, ...)
end
until op == 0
return num
end
--Function: Announce number from file , for TEST CARD
function rshint.AnnounceNumber_Default(tp, file_loc, sel_list_str)
dofile(file_loc)
local sel_list_name = rsv[sel_list_str]
if sel_list_name then
if type(sel_list_name) == "table" then
return Duel.AnnounceNumber(tp, table.unpack(sel_list_name))
elseif type(sel_list_name) == "number" then
return Duel.AnnounceNumber(tp, sel_list_name)
end
else
Debug.Message("rshint.Select_Presupposition, sel_list_name not found.")
return
end
end
-------------------"Part_Other_Function"---------------------
--Special Debug
......
......@@ -66,7 +66,7 @@ function c19500004.atkcon(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetAttacker()
if tc:IsControler(1-tp) then tc=Duel.GetAttackTarget() end
e:SetLabelObject(tc)
return tc and tc:IsFaceup() and tc:IsSetCard(0x3990)
return tc and tc:IsFaceup() and tc:IsSetCard(0x3991)
end
function c19500004.desfilter(c)
return c:IsType(TYPE_MONSTER) and c:IsSetCard(0x3990)
......
......@@ -7,7 +7,7 @@ function c19500017.initial_effect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_CUSTOM+19500017)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e1:SetRange(LOCATION_HAND)
e1:SetRange(LOCATION_HAND+LOCATION_GRAVE)
e1:SetCondition(c19500017.spcon)
e1:SetTarget(c19500017.sptg)
e1:SetOperation(c19500017.spop)
......
......@@ -73,7 +73,7 @@ function cm.disable(e,c)
end
function cm.cfilter(c,tp)
return c:IsPreviousLocation(LOCATION_ONFIELD) and c:GetPreviousControler()==tp and c:IsSetCard(0x3420,0x5420) and c:IsPreviousPosition(POS_FACEUP)
return c:IsPreviousLocation(LOCATION_MZONE) and c:GetPreviousControler()==tp and c:IsSetCard(0x3420,0x5420) and c:IsPreviousPosition(POS_FACEUP)
end
function cm.acop(e,tp,eg,ep,ev,re,r,rp)
local ct=eg:FilterCount(cm.cfilter,nil,tp)
......
......@@ -134,7 +134,7 @@ function cm.limop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetCurrentChain()==0 then
Duel.SetChainLimitTillChainEnd(cm.chainlm)
elseif Duel.GetCurrentChain()==1 then
Duel.RegisterFlagEffect(m,RESET_PHASE+PHASE_END,0,1)
Duel.RegisterFlagEffect(tp,m,RESET_PHASE+PHASE_END,0,1)
end
end
function cm.limop2(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -66,5 +66,5 @@ function cm.ckfilter2(c)
return c:IsAttribute(ATTRIBUTE_LIGHT) and c:IsType(TYPE_MONSTER) and c:IsFaceup()
end
function cm.handcon(e)
return not Duel.IsExistingMatchingCard(cm.ckfilter,e:GetHandlerPlayer(),LOCATION_MZONE,0,1,nil)
return not Duel.IsExistingMatchingCard(cm.ckfilter2,e:GetHandlerPlayer(),LOCATION_MZONE,0,1,nil)
end
\ No newline at end of file
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