153 lines
3.8 KiB
Lua
Raw Normal View History

2023-06-26 04:40:53 -07:00
--------------------------------------------------------------------------------
-- KDFargels Main File --
--------------------------------------------------------------------------------
require( "common" )
require( "KQ/KDFargels/Data/Name" ) -- <20><><EFBFBD>ϰ<EFBFBD><CFB0><EFBFBD>, <20><><EFBFBD><EFBFBD><EFBFBD≯<EFBFBD>, <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD>̺<EFBFBD>
require( "KQ/KDFargels/Data/Regen" ) -- <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>(<28>׷<EFBFBD>, <20><>, NPC, <20><>, <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>, <20><>ġ <20><> <20>Ӽ<EFBFBD> <20><><EFBFBD><EFBFBD>)
require( "KQ/KDFargels/Data/Process" ) -- <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ÿ<EFBFBD>Ӱ<EFBFBD> <20><>ũ <20><><EFBFBD><EFBFBD>, <20><><EFBFBD><EFBFBD>, <20><><EFBFBD><EFBFBD>Ʈ <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
require( "KQ/KDFargels/Data/Boss" ) -- <20><><EFBFBD><EFBFBD> Boss<73><73> <20>ൿ <20><><EFBFBD><EFBFBD><><C3A4> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>(<28><><EFBFBD><EFBFBD>ȯ <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>))
require( "KQ/KDFargels/Functions/SubFunc" ) -- <20><>ü<EFBFBD><C3BC><EFBFBD><EFBFBD> <20><><EFBFBD><20>ʿ<EFBFBD><CABF><EFBFBD> <20><><EFBFBD><EFBFBD> Sub Functions
require( "KQ/KDFargels/Functions/Routine" ) -- <20><> <20><20>ٴ<EFBFBD> AI <20><><EFBFBD><EFBFBD> <20><>ƾ<EFBFBD><C6BE>
require( "KQ/KDFargels/Functions/Progress" ) -- <20><> <20>ܰ谡 <20><><EFBFBD>ǵ<EFBFBD> <20><><EFBFBD><EFBFBD> <20>Լ<EFBFBD><D4BC><EFBFBD>
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-- -- -- --
-- -- <20><><EFBFBD><EFBFBD><EFBFBD>Լ<EFBFBD> -- --
-- -- -- --
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
function Main( Field )
cExecCheck( "Main" )
local EventMemory = InstanceField[Field]
if EventMemory == nil then
cDebugLog( "EventMemory == nil" )
InstanceField[Field] = { }
EventMemory = InstanceField[Field]
EventMemory["MapIndex"] = Field
EventMemory["CurrentTime"] = 0
EventMemory["EventNumber"] = 1
EventMemory["EventData"] = { }
EventMemory["CheckTime"] = 1
EventMemory["EM_STATE"] = EM_STATE["Start"]
EventMemory["EventState"] = ES_STATE["STATE_1"]
EventMemory["CameraMove"] = { }
EventMemory["CameraMove"]["CameraState"] = CAMERA_STATE["NORMAL"]
EventMemory["CameraMove"]["CheckTime"] = 0
EventMemory["CameraMove"]["Number"] = 1
EventMemory["CameraMove"]["Focus"] = { }
EventMemory["CameraMove"]["Focus"]["X"] = 0
EventMemory["CameraMove"]["Focus"]["Y"] = 0
EventMemory["CameraMove"]["Focus"]["DIR"] = 0
EventMemory["FaceCut"] = { }
EventMemory["FaceCut"]["Number"] = 1
EventMemory["FaceCut"]["CheckTime"] = 0
EventMemory["PlayerList"] = { }
EventMemory["PlayerLogin"] = false
EventMemory["CheckLimitTime"] = 999999999;
DoorCreate( EventMemory )
cSetFieldScript( Field, SCRIPT_MAIN )
cFieldScriptFunc( EventMemory["MapIndex"], "MapLogin", "PlayerMapLogin" )
end
MainRoutine( EventMemory )
end
function MainRoutine( EventMemory )
cExecCheck( "MainRoutine" )
if EventMemory == nil then
return
end
if EventMemory["PlayerLogin"] == false then
return
end
if EVENT_GAME_OVER == true then
return
end
-- 0.1<EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
if EventMemory["CurrentTime"] + 0.1 > cCurrentSecond() then
return
else
EventMemory["CurrentTime"] = cCurrentSecond()
-- <20><><EFBFBD>ѽð<D1BD> üũ
if EventMemory["CheckLimitTime"] ~= nil then
if EventMemory["CheckLimitTime"] <= EventMemory["CurrentTime"] then
cTimer( EventMemory["MapIndex"], 0 )
cLinkToAll( EventMemory["MapIndex"], LINK_INFO["RETURNMAP1"]["MAP_INDEX"], LINK_INFO["RETURNMAP1"]["X"], LINK_INFO["RETURNMAP1"]["Y"])
cEndOfKingdomQuest( EventMemory["MapIndex"] )
end
end
end
if EventMemory["EM_STATE"] == EM_STATE["Play"] then
local ReturnValue = EVENT_ROUTINE[EventMemory["EventNumber"]]( EventMemory )
if ReturnValue == EVENT_ROUTINE_END then
EventMemory["EM_STATE"] = EM_STATE["End"]
end
return
elseif EventMemory["EM_STATE"] == EM_STATE["Start"] then
EVENT_INIT_FUCTION[EventMemory["EventNumber"]]( EventMemory )
EventMemory["EM_STATE"] = EM_STATE["Play"]
return
elseif EventMemory["EM_STATE"] == EM_STATE["End"] then
EVENT_DEINIT_FUNCTION( EventMemory )
return
end
end