|
|
|
|
--------------------------------------------------------------------------------
|
|
|
|
|
-- Cake Progress Func --
|
|
|
|
|
--------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
function KQInit( Var )
|
|
|
|
|
cExecCheck "KQInit"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if Var == nil
|
|
|
|
|
then
|
|
|
|
|
ErrorLog( "InitCake : Var nil" )
|
|
|
|
|
return
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-- <EFBFBD>÷<EFBFBD><EFBFBD>̾<EFBFBD><EFBFBD><EFBFBD> ù <EFBFBD>α<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD>ٸ<EFBFBD><EFBFBD><EFBFBD>.
|
|
|
|
|
if #Var["Player"] < 1
|
|
|
|
|
then
|
|
|
|
|
if Var["InitialSec"] + WAIT_PLAYER_MAP_LOGIN_SEC_MAX <= cCurrentSecond()
|
|
|
|
|
then
|
|
|
|
|
cEndOfKingdomQuest( Var[ "MapIndex" ] )
|
|
|
|
|
return
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
return
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
--[[
|
|
|
|
|
-- <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD>ȯ
|
|
|
|
|
local RegenDoor = RegenInfo["Door"]
|
|
|
|
|
Var["Door"] = cDoorBuild( Var["MapIndex"], RegenDoor["Index"], RegenDoor["X"], RegenDoor["Y"], 0, 1000 )
|
|
|
|
|
if Var["Door"] == nil
|
|
|
|
|
then
|
|
|
|
|
GoToFail( Var, "Invisible door regen fail" )
|
|
|
|
|
return
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
cDoorAction( Var["Door"], RegenDoor["Block"], "close" )
|
|
|
|
|
--]]
|
|
|
|
|
|
|
|
|
|
-- <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD>ȯ
|
|
|
|
|
local RegenDoor = RegenInfo["Door"]
|
|
|
|
|
Var["Door"] = {}
|
|
|
|
|
for k = 1, #RegenDoor
|
|
|
|
|
do
|
|
|
|
|
local DoorInfo = RegenDoor[ k ]
|
|
|
|
|
Var["Door"][ k ] = cDoorBuild( Var["MapIndex"], DoorInfo["Index"], DoorInfo["X"], DoorInfo["Y"], DoorInfo["DIR"], DoorInfo["SCALE"] )
|
|
|
|
|
if Var["Door"][ k ] == nil
|
|
|
|
|
then
|
|
|
|
|
GoToFail( Var, "Door Npc regen fail" )
|
|
|
|
|
return
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
cDoorAction( Var["Door"][ k ], DoorInfo["Block"], "close" )
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-- <EFBFBD><EFBFBD><EFBFBD><EFBFBD>ũ, <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD>Ǹ<EFBFBD> NPC <EFBFBD><EFBFBD>ȯ
|
|
|
|
|
local RegenNPC = RegenInfo["NPC"]
|
|
|
|
|
for i = 1, #RegenNPC
|
|
|
|
|
do
|
|
|
|
|
cNPCRegen( Var["MapIndex"], RegenNPC[ i ] )
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-- <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD>ܰ<EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
Var["StepFunc"] = StartWait
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function StartWait( Var )
|
|
|
|
|
cExecCheck "StartWait"
|
|
|
|
|
|
|
|
|
|
if Var == nil
|
|
|
|
|
then
|
|
|
|
|
ErrorLog( "StartWait : Var nil" )
|
|
|
|
|
return
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-- <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD>ʱ<EFBFBD>ȭ
|
|
|
|
|
local StartWaitInfo = Var["StartWait"]
|
|
|
|
|
if StartWaitInfo == nil
|
|
|
|
|
then
|
|
|
|
|
Var["StartWait"] = {}
|
|
|
|
|
StartWaitInfo = Var["StartWait"]
|
|
|
|
|
|
|
|
|
|
StartWaitInfo["NextSetpWaitTime"] = Var["CurSec"] + DelayTime["StartWait"]
|
|
|
|
|
|
|
|
|
|
StartWaitInfo["DialogTime"] = Var["CurSec"]
|
|
|
|
|
StartWaitInfo["DialogStep"] = 1
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-- <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD>ٸ<EFBFBD><EFBFBD>鼭 <EFBFBD><EFBFBD><EFBFBD>̾<EFBFBD><EFBFBD>α<EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
if StartWaitInfo["DialogTime"] ~= nil
|
|
|
|
|
then
|
|
|
|
|
|
|
|
|
|
if StartWaitInfo["DialogTime"] <= Var["CurSec"]
|
|
|
|
|
then
|
|
|
|
|
|
|
|
|
|
local DialogStep = StartWaitInfo["DialogStep"]
|
|
|
|
|
local MaxDialogStep = #NoticeInfo["KDCake_Role"]
|
|
|
|
|
|
|
|
|
|
if DialogStep <= MaxDialogStep
|
|
|
|
|
then
|
|
|
|
|
cScriptMsg( Var["MapIndex"], nil, NoticeInfo["KDCake_Role"][ DialogStep ] )
|
|
|
|
|
|
|
|
|
|
StartWaitInfo["DialogTime"] = Var["CurSec"] + DelayTime["StartDialogInterval"]
|
|
|
|
|
StartWaitInfo["DialogStep"] = DialogStep + 1
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if DialogStep > MaxDialogStep
|
|
|
|
|
then
|
|
|
|
|
StartWaitInfo["DialogTime"] = nil
|
|
|
|
|
StartWaitInfo["DialogStep"] = nil
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-- <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD>ܰ<EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
if StartWaitInfo["NextSetpWaitTime"] <= Var["CurSec"]
|
|
|
|
|
then
|
|
|
|
|
Var["StepFunc"] = RoundWait
|
|
|
|
|
Var["StartWait"] = nil
|
|
|
|
|
StartWaitInfo = nil
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function RoundWait( Var )
|
|
|
|
|
cExecCheck "RoundWait"
|
|
|
|
|
|
|
|
|
|
if Var == nil
|
|
|
|
|
then
|
|
|
|
|
ErrorLog( "RoundWait : Var nil" )
|
|
|
|
|
return
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-- <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD>ʱ<EFBFBD>ȭ
|
|
|
|
|
local RoundWaitInfo = Var["RoundWait"]
|
|
|
|
|
if RoundWaitInfo == nil
|
|
|
|
|
then
|
|
|
|
|
Var["RoundWait"] = {}
|
|
|
|
|
RoundWaitInfo = Var["RoundWait"]
|
|
|
|
|
|
|
|
|
|
RoundWaitInfo["NextSetpWaitTime"] = Var["CurSec"] + DelayTime["RoundWait"]
|
|
|
|
|
RoundWaitInfo["DialogTime"] = Var["CurSec"] + DelayTime["RoundStartMessage"]
|
|
|
|
|
|
|
|
|
|
cTimer( Var["MapIndex"], 0 )
|
|
|
|
|
|
|
|
|
|
Var["RoundTimeOver"] = false
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if RoundWaitInfo["DialogTime"] ~= nil
|
|
|
|
|
then
|
|
|
|
|
|
|
|
|
|
if RoundWaitInfo["DialogTime"] <= Var["CurSec"]
|
|
|
|
|
then
|
|
|
|
|
cScriptMsg( Var["MapIndex"], nil, NoticeInfo["RoundStart_10SecondAgo"], tostring( Var["Round"] ) )
|
|
|
|
|
|
|
|
|
|
RoundWaitInfo["DialogTime"] = nil
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-- <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD>ܰ<EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
if RoundWaitInfo["NextSetpWaitTime"] <= Var["CurSec"]
|
|
|
|
|
then
|
|
|
|
|
Var["StepFunc"] = RoundProcess
|
|
|
|
|
Var["RoundWait"] = nil
|
|
|
|
|
RoundWaitInfo = nil
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-- <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
function RoundProcess( Var )
|
|
|
|
|
cExecCheck "RoundProcess"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if Var == nil
|
|
|
|
|
then
|
|
|
|
|
ErrorLog( "RoundProcess : Var nil" )
|
|
|
|
|
return
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
local RedTeamInfo = Var["Team"][ KQ_TEAM["RED"] ]
|
|
|
|
|
local BlueTeamInfo = Var["Team"][ KQ_TEAM["BLUE"] ]
|
|
|
|
|
|
|
|
|
|
if RedTeamInfo == nil
|
|
|
|
|
then
|
|
|
|
|
ErrorLog( "RoundProcess : RedTeamInfo nil" )
|
|
|
|
|
return
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
if BlueTeamInfo == nil
|
|
|
|
|
then
|
|
|
|
|
ErrorLog( "RoundProcess : BlueTeamInfo nil" )
|
|
|
|
|
return
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-- <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD>ʱ<EFBFBD>ȭ
|
|
|
|
|
if Var["RoundEndTime"] == 0
|
|
|
|
|
then
|
|
|
|
|
|
|
|
|
|
-- <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD>˸<EFBFBD>
|
|
|
|
|
cEffectMsg_AllInMap( Var["MapIndex"], EFFECT_MSG_TYPE["EMT_WATER_START"] )
|
|
|
|
|
cScriptMsg( Var["MapIndex"], nil, NoticeInfo["RoundStart"], tostring( Var["Round"] ) )
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-- <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
--cDoorAction( Var["Door"], RegenInfo["Door"]["Block"], "open" )
|
|
|
|
|
for k = 1, #Var["Door"]
|
|
|
|
|
do
|
|
|
|
|
cDoorAction( Var["Door"][ k ], RegenInfo["Door"][ k ]["Block"], "open" )
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-- <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD>ð<EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
Var["RoundEndTime"] = Var["CurSec"] + DelayTime["RoundLimit"]
|
|
|
|
|
|
|
|
|
|
cTimer( Var["MapIndex"], DelayTime["RoundLimit"] )
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-- <EFBFBD>ʱ<EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
RedTeamInfo["Score"] = Player_TeamMemberCount( Var, KQ_TEAM["RED"] )
|
|
|
|
|
BlueTeamInfo["Score"] = Player_TeamMemberCount( Var, KQ_TEAM["BLUE"] )
|
|
|
|
|
|
|
|
|
|
cScoreBoard_AllInMap( Var["MapIndex"], true, Var["Round"], RedTeamInfo["Win"], RedTeamInfo["Score"],
|
|
|
|
|
BlueTeamInfo["Win"], BlueTeamInfo["Score"] )
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-- <EFBFBD>÷<EFBFBD><EFBFBD>̾<EFBFBD><EFBFBD> ŷ<EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
for i = 1, #Var["Player"]
|
|
|
|
|
do
|
|
|
|
|
Var["Player"][ i ]["IsOut"] = false
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-- <EFBFBD>÷<EFBFBD><EFBFBD>̾<EFBFBD> <EFBFBD>Ŵ<EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
if Player_Manager( Var ) == false
|
|
|
|
|
then
|
|
|
|
|
Var["StepFunc"] = KQReward
|
|
|
|
|
Var["RoundEndTime"] = 0
|
|
|
|
|
return
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-- <EFBFBD><EFBFBD><EFBFBD><EFBFBD> Ȯ<EFBFBD><EFBFBD>, <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD>ܰ<EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
-- <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 0<EFBFBD>̵Ǹ<EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD>ܰ<EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ؾ<EFBFBD><EFBFBD>Ѵ<EFBFBD>.
|
|
|
|
|
if RedTeamInfo["Score"] == 0 or BlueTeamInfo["Score"] == 0
|
|
|
|
|
then
|
|
|
|
|
Var["StepFunc"] = RoundEnd
|
|
|
|
|
Var["RoundEndTime"] = 0
|
|
|
|
|
|
|
|
|
|
Var["RoundTimeOver"]= false
|
|
|
|
|
return
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-- <EFBFBD>ð<EFBFBD> Ȯ<EFBFBD><EFBFBD>, <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD>ܰ<EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
if Var["RoundEndTime"] <= Var["CurSec"]
|
|
|
|
|
then
|
|
|
|
|
Var["StepFunc"] = RoundEnd
|
|
|
|
|
Var["RoundEndTime"] = 0
|
|
|
|
|
|
|
|
|
|
Var["RoundTimeOver"]= true
|
|
|
|
|
return
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-- <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
function RoundEnd( Var )
|
|
|
|
|
cExecCheck "RoundEnd"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if Var == nil
|
|
|
|
|
then
|
|
|
|
|
ErrorLog( "RoundProcess : Var nil" )
|
|
|
|
|
return
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
local RedTeamInfo = Var["Team"][ KQ_TEAM["RED"] ]
|
|
|
|
|
local BlueTeamInfo = Var["Team"][ KQ_TEAM["BLUE"] ]
|
|
|
|
|
|
|
|
|
|
if RedTeamInfo == nil
|
|
|
|
|
then
|
|
|
|
|
ErrorLog( "RoundProcess : RedTeamInfo nil" )
|
|
|
|
|
return
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
if BlueTeamInfo == nil
|
|
|
|
|
then
|
|
|
|
|
ErrorLog( "RoundProcess : BlueTeamInfo nil" )
|
|
|
|
|
return
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-- <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD>ʱ<EFBFBD>ȭ
|
|
|
|
|
local RoundEndInfo = Var["RoundEnd"]
|
|
|
|
|
if RoundEndInfo == nil
|
|
|
|
|
then
|
|
|
|
|
Var["RoundEnd"] = {}
|
|
|
|
|
RoundEndInfo = Var["RoundEnd"]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
RoundEndInfo["NextSetpWaitTime"] = Var["CurSec"] + DelayTime["RoundEndWait"]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-- Ÿ<EFBFBD≯<EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
cTimer( Var["MapIndex"], 0 )
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-- <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> ó<EFBFBD><EFBFBD>
|
|
|
|
|
local Emotion = {}
|
|
|
|
|
|
|
|
|
|
if RedTeamInfo["Score"] > BlueTeamInfo["Score"] and Var["RoundTimeOver"] == false
|
|
|
|
|
then
|
|
|
|
|
|
|
|
|
|
-- <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> : <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD>¸<EFBFBD>
|
|
|
|
|
RedTeamInfo["Win"] = RedTeamInfo["Win"] + 1
|
|
|
|
|
BlueTeamInfo["Lose"] = BlueTeamInfo["Lose"] + 1
|
|
|
|
|
|
|
|
|
|
Emotion[ KQ_TEAM["RED"] ] = RoundInfo["Emotion"]["WIN"]
|
|
|
|
|
Emotion[ KQ_TEAM["BLUE"] ] = RoundInfo["Emotion"]["LOSE"]
|
|
|
|
|
|
|
|
|
|
cScriptMsg( Var["MapIndex"], nil, NoticeInfo["RoundEnd"][ KQ_TEAM["RED"] ], tostring( Var["Round"] ) )
|
|
|
|
|
|
|
|
|
|
elseif RedTeamInfo["Score"] < BlueTeamInfo["Score"] and Var["RoundTimeOver"] == false
|
|
|
|
|
then
|
|
|
|
|
|
|
|
|
|
-- <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> : <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD>¸<EFBFBD>
|
|
|
|
|
RedTeamInfo["Lose"] = RedTeamInfo["Lose"] + 1
|
|
|
|
|
BlueTeamInfo["Win"] = BlueTeamInfo["Win"] + 1
|
|
|
|
|
|
|
|
|
|
Emotion[ KQ_TEAM["RED"] ] = RoundInfo["Emotion"]["LOSE"]
|
|
|
|
|
Emotion[ KQ_TEAM["BLUE"] ] = RoundInfo["Emotion"]["WIN"]
|
|
|
|
|
|
|
|
|
|
cScriptMsg( Var["MapIndex"], nil, NoticeInfo["RoundEnd"][ KQ_TEAM["BLUE"] ], tostring( Var["Round"] ) )
|
|
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
|
|
-- <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> : <EFBFBD><EFBFBD><EFBFBD>º<EFBFBD>
|
|
|
|
|
RedTeamInfo["Draw"] = RedTeamInfo["Draw"] + 1
|
|
|
|
|
BlueTeamInfo["Draw"] = BlueTeamInfo["Draw"] + 1
|
|
|
|
|
|
|
|
|
|
Emotion[ KQ_TEAM["RED"] ] = RoundInfo["Emotion"]["DRAW"]
|
|
|
|
|
Emotion[ KQ_TEAM["BLUE"] ] = RoundInfo["Emotion"]["DRAW"]
|
|
|
|
|
|
|
|
|
|
cScriptMsg( Var["MapIndex"], nil, NoticeInfo["RoundEnd"]["DRAW"], tostring( Var["Round"] ) )
|
|
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
RedTeamInfo["Score"] = 0
|
|
|
|
|
BlueTeamInfo["Score"] = 0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-- <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD>˸<EFBFBD>
|
|
|
|
|
cScoreBoard_AllInMap( Var["MapIndex"], true, Var["Round"], RedTeamInfo["Win"], RedTeamInfo["Score"],
|
|
|
|
|
BlueTeamInfo["Win"], BlueTeamInfo["Score"] )
|
|
|
|
|
|
|
|
|
|
-- <EFBFBD≯<EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
for i = 1, #Var["Player"]
|
|
|
|
|
do
|
|
|
|
|
local PlayerInfo = Var["Player"][ i ]
|
|
|
|
|
|
|
|
|
|
if PlayerInfo["IsInMap"] == true
|
|
|
|
|
then
|
|
|
|
|
|
|
|
|
|
cSetAbstate( PlayerInfo["Handle"], "StaAdlFStun", 1, (DelayTime["RoundEndWait"] * 1000) )
|
|
|
|
|
cEmotion( PlayerInfo["Handle"], Emotion[ PlayerInfo["TeamType"] ] )
|
|
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
PlayerInfo["CakeHandle"] = nil
|
|
|
|
|
PlayerInfo["CakeAbstateTime"] = 0
|
|
|
|
|
PlayerInfo["PrisonLinkToWaitTime"] = 0
|
|
|
|
|
PlayerInfo["IsOut"] = false
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-- <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD>ð<EFBFBD> Ȯ<EFBFBD><EFBFBD>
|
|
|
|
|
if RoundEndInfo["NextSetpWaitTime"] > Var["CurSec"]
|
|
|
|
|
then
|
|
|
|
|
return
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-- ŷ<EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> Ȯ<EFBFBD><EFBFBD>
|
|
|
|
|
if Var["Round"] >= RoundInfo["LastRound"] or
|
|
|
|
|
RedTeamInfo["Win"] >= RoundInfo["WinRound"] or
|
|
|
|
|
BlueTeamInfo["Win"] >= RoundInfo["WinRound"]
|
|
|
|
|
then
|
|
|
|
|
|
|
|
|
|
Var["StepFunc"] = KQReward
|
|
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
|
|
Var["Round"] = Var["Round"] + 1
|
|
|
|
|
Var["StepFunc"] = RoundWait
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-- <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
-- cDoorAction( Var["Door"], RegenInfo["Door"]["Block"], "close" )
|
|
|
|
|
for k = 1, #Var["Door"]
|
|
|
|
|
do
|
|
|
|
|
cDoorAction( Var["Door"][ k ], RegenInfo["Door"][ k ]["Block"], "close" )
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
-- <EFBFBD>÷<EFBFBD><EFBFBD>̾<EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD>ġ<EFBFBD><EFBFBD> <EFBFBD>Ű<EFBFBD><EFBFBD>ֱ<EFBFBD>
|
|
|
|
|
for i = 1, #Var["Player"]
|
|
|
|
|
do
|
|
|
|
|
local PlayerInfo = Var["Player"][ i ]
|
|
|
|
|
local RegenLocInfo = TeamRegenLocation[ PlayerInfo["TeamType"] ]
|
|
|
|
|
|
|
|
|
|
if PlayerInfo["IsInMap"] == true and RegenLocInfo ~= nil
|
|
|
|
|
then
|
|
|
|
|
|
|
|
|
|
cCastTeleport( PlayerInfo["Handle"], "SpecificCoord", RegenLocInfo["X"], RegenLocInfo["Y"] )
|
|
|
|
|
--cLinkTo( PlayerInfo["Handle"], Var["MapIndex"], RegenLocInfo["X"], RegenLocInfo["Y"] )
|
|
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Var["RoundEnd"] = nil
|
|
|
|
|
RoundEndInfo = nil
|
|
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function KQReward( Var )
|
|
|
|
|
cExecCheck "KQReward"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if Var == nil
|
|
|
|
|
then
|
|
|
|
|
ErrorLog( "KQReward : Var nil" )
|
|
|
|
|
return
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-- Ÿ<EFBFBD≯<EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
cTimer( Var["MapIndex"], 0 )
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
local RedTeamInfo = Var["Team"][ KQ_TEAM["RED"] ]
|
|
|
|
|
local BlueTeamInfo = Var["Team"][ KQ_TEAM["BLUE"] ]
|
|
|
|
|
|
|
|
|
|
if RedTeamInfo == nil
|
|
|
|
|
then
|
|
|
|
|
ErrorLog( "KQReward : RedTeamInfo nil" )
|
|
|
|
|
return
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
if BlueTeamInfo == nil
|
|
|
|
|
then
|
|
|
|
|
ErrorLog( "KQReward : BlueTeamInfo nil" )
|
|
|
|
|
return
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-- ŷ<EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʈ <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
local KQResult = {}
|
|
|
|
|
|
|
|
|
|
-- ŷ<EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʈ <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
if RedTeamInfo["Win"] > BlueTeamInfo["Win"]
|
|
|
|
|
then
|
|
|
|
|
-- <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD>¸<EFBFBD>
|
|
|
|
|
KQResult[ KQ_TEAM["RED"] ] = "WIN"
|
|
|
|
|
KQResult[ KQ_TEAM["BLUE"] ] = "LOSE"
|
|
|
|
|
|
|
|
|
|
cScriptMsg( Var["MapIndex"], nil, NoticeInfo["KQEnd"][ KQ_TEAM["RED"] ] )
|
|
|
|
|
|
|
|
|
|
elseif RedTeamInfo["Win"] < BlueTeamInfo["Win"]
|
|
|
|
|
then
|
|
|
|
|
-- <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD>¸<EFBFBD>
|
|
|
|
|
KQResult[ KQ_TEAM["RED"] ] = "LOSE"
|
|
|
|
|
KQResult[ KQ_TEAM["BLUE"] ] = "WIN"
|
|
|
|
|
|
|
|
|
|
cScriptMsg( Var["MapIndex"], nil, NoticeInfo["KQEnd"][ KQ_TEAM["BLUE"] ] )
|
|
|
|
|
|
|
|
|
|
else
|
|
|
|
|
-- <EFBFBD><EFBFBD><EFBFBD>º<EFBFBD>
|
|
|
|
|
KQResult[ KQ_TEAM["RED"] ] = "DRAW"
|
|
|
|
|
KQResult[ KQ_TEAM["BLUE"] ] = "DRAW"
|
|
|
|
|
|
|
|
|
|
cScriptMsg( Var["MapIndex"], nil, NoticeInfo["KQEnd"]["DRAW"] )
|
|
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-- <EFBFBD>÷<EFBFBD><EFBFBD>̾<EFBFBD><EFBFBD> ŷ<EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
local PlayerList = Var["Player"]
|
|
|
|
|
if PlayerList == nil
|
|
|
|
|
then
|
|
|
|
|
ErrorLog( "KQReward : PlayerList nil" )
|
|
|
|
|
return
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
for i = 1, #PlayerList
|
|
|
|
|
do
|
|
|
|
|
local PlayerInfo = PlayerList[ i ]
|
|
|
|
|
local RewardInfo = CakeWarResult[ KQResult[ PlayerInfo["TeamType"] ] ]
|
|
|
|
|
|
|
|
|
|
if cIsInMap( PlayerInfo["Handle"], Var["MapIndex"] ) ~= nil
|
|
|
|
|
then
|
|
|
|
|
|
|
|
|
|
cEffectMsg( PlayerInfo["Handle"], RewardInfo["EffectMsg"] )
|
|
|
|
|
cKQRewardIndex( PlayerInfo["Handle"], RewardInfo["RewardIndex"] )
|
|
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-- <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
Var["StepFunc"] = ReturnToHome
|
|
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-- <EFBFBD><EFBFBD>ȯ
|
|
|
|
|
function ReturnToHome( Var )
|
|
|
|
|
cExecCheck "ReturnToHome"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if Var == nil
|
|
|
|
|
then
|
|
|
|
|
ErrorLog( "ReturnToHome : Var nil" )
|
|
|
|
|
return
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-- <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD>ʱ<EFBFBD>ȭ
|
|
|
|
|
if Var["ReturnToHome"] == nil
|
|
|
|
|
then
|
|
|
|
|
DebugLog( "Start ReturnToHome" )
|
|
|
|
|
Var["ReturnToHome"] = {}
|
|
|
|
|
Var["ReturnToHome"]["ReturnStepSec"] = Var["CurSec"]
|
|
|
|
|
Var["ReturnToHome"]["ReturnStepNo"] = 1
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-- Return : return notice substep
|
|
|
|
|
if Var["ReturnToHome"]["ReturnStepNo"] <= #NoticeInfo["KQReturn"]
|
|
|
|
|
then
|
|
|
|
|
if Var["ReturnToHome"]["ReturnStepSec"] <= Var["CurSec"]
|
|
|
|
|
then
|
|
|
|
|
-- Notice of Escape
|
|
|
|
|
if NoticeInfo["KQReturn"][ Var["ReturnToHome"]["ReturnStepNo"] ]["Index"] ~= nil
|
|
|
|
|
then
|
|
|
|
|
cNotice( Var["MapIndex"], NoticeInfo["KQReturn"]["ScriptFileName"], NoticeInfo["KQReturn"][ Var["ReturnToHome"]["ReturnStepNo"] ]["Index"] )
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
-- Go To Next Notice
|
|
|
|
|
Var["ReturnToHome"]["ReturnStepNo"] = Var["ReturnToHome"]["ReturnStepNo"] + 1
|
|
|
|
|
Var["ReturnToHome"]["ReturnStepSec"] = Var["CurSec"] + DelayTime["GapKQReturnNotice"]
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
return
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-- Return : linkto substep
|
|
|
|
|
if Var["ReturnToHome"]["ReturnStepNo"] > #NoticeInfo["KQReturn"]
|
|
|
|
|
then
|
|
|
|
|
if Var["ReturnToHome"]["ReturnStepSec"] <= Var["CurSec"]
|
|
|
|
|
then
|
|
|
|
|
--Finish_KQ
|
|
|
|
|
cLinkToAll( Var["MapIndex"], LinkInfo["ReturnMap"]["MapIndex"], LinkInfo["ReturnMap"]["x"], LinkInfo["ReturnMap"]["y"] )
|
|
|
|
|
cVanishAll();
|
|
|
|
|
|
|
|
|
|
Var["ReturnToHome"] = nil
|
|
|
|
|
if cEndOfKingdomQuest( Var["MapIndex"] ) == nil
|
|
|
|
|
then
|
|
|
|
|
ErrorLog( "ReturnToHome::Function cEndOfKingdomQuest failed" )
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
return
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|