Commit a7374ae9 authored by nanahira's avatar nanahira

Limit pick time each pick to 1min

parent 84659dfa
......@@ -101,7 +101,7 @@ function Auxiliary.SinglePick(p,list,count)
end
local sg=g1:Clone()
sg:Merge(g2)
Duel.ResetTimeLimit(p)
Duel.ResetTimeLimit(p,60)
Duel.Hint(HINT_SELECTMSG,p,HINTMSG_TODECK)
local sc=sg:Select(p,1,1,nil):GetFirst()
local rg=g1:IsContains(sc) and g2 or g1
......@@ -121,7 +121,7 @@ function Auxiliary.SinglePickForMain(p,list,count)
end
local sg=g1:Clone()
sg:Merge(g2)
Duel.ResetTimeLimit(p)
Duel.ResetTimeLimit(p,60)
Duel.Hint(HINT_SELECTMSG,p,HINTMSG_TODECK)
local sc=sg:Select(p,1,1,nil):GetFirst()
local tg=g1:IsContains(sc) and g1 or g2
......
......@@ -745,7 +745,13 @@ int SingleDuel::Analyze(char* msgbuffer, unsigned int len) {
}
case MSG_RESET_TIME: {
player = BufferIO::ReadInt8(pbuf);
int time = BufferIO::ReadInt8(pbuf);
if(host_info.time_limit) {
if(time)
time_limit[player] = time;
else
time_limit[player] = host_info.time_limit;
}
break;
}
case MSG_RETRY: {
......
......@@ -53,11 +53,15 @@ int32 scriptlib::duel_get_start_count(lua_State * L) {
int32 scriptlib::duel_reset_time_limit(lua_State * L) {
check_param_count(L, 1);
int32 p = lua_tonumberint(L, 1);
int32 time = 0;
if(p != 0 && p != 1)
luaL_error(L, "Parameter 1 should be 0 or 1.", 2);
if(lua_gettop(L) >= 2)
time = lua_tonumberint(L, 2);
duel* pduel = interpreter::get_duel_info(L);
pduel->write_buffer8(MSG_RESET_TIME);
pduel->write_buffer8(p);
pduel->write_buffer8(time);
return 0;
}
//modded
......
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