public ScreenMainGame() { instance = this; mScriptSys = ScriptProcess.getInstance(); mScriptSys.setScreenMainGame(this); if (SaveLoadGame.startNewGame) { // 开始新游戏 Combat.FightDisable(); ScriptResources.initGlobalVar(); ScriptResources.initGlobalEvents(); SaveLoadGame.NpcObjs = mNPCObj; sPlayerList.clear(); Player.sGoodsList.clear(); Player.sMoney = 0; startChapter(1, 1); ScriptExecutor.goonExecute = true; mRunScript = true; } else { // 再续前缘 loadMap( SaveLoadGame.MapType, SaveLoadGame.MapIndex, SaveLoadGame.MapScreenX, SaveLoadGame.MapScreenY); mNPCObj = SaveLoadGame.NpcObjs; for (int i = 0; i < mNPCObj.length; i++) { if (mNPCObj[i] != null) { mNPCObj[i].setICanWalk(mCanWalk); } } if (sPlayerList.size() > 0) { mPlayer = sPlayerList.get(0); } else { createActor(1, 4, 3); // Log.e("error", "存档读取出错"); } mScriptSys.loadScript(SaveLoadGame.ScriptType, SaveLoadGame.ScriptIndex); mScriptExecutor = mScriptSys.getScriptExecutor(); ScriptExecutor.goonExecute = true; mRunScript = false; } // Player.sMoney = 999999; }
public void startChapter(int type, int index) { System.out.println("ScreenMainGame.startChapter " + type + " " + index); mScriptSys.loadScript(type, index); mScriptExecutor = mScriptSys.getScriptExecutor(); // update(0); ScriptExecutor.goonExecute = false; for (int i = 1; i <= 40; i++) { mNPCObj[i] = null; } ScriptResources.initLocalVar(); SaveLoadGame.ScriptType = type; SaveLoadGame.ScriptIndex = index; }