701 end |
697 end |
702 |
698 |
703 _G.onNewTurn = function() |
699 _G.onNewTurn = function() |
704 _G.sm.gameStarted = true |
700 _G.sm.gameStarted = true |
705 |
701 |
706 if params.customGoals == nil then |
702 if params.customGoalCheck == "turnStart" then |
707 _G.sm.checkRegularVictory() |
|
708 elseif params.customGoalCheck == "turnStart" then |
|
709 _G.sm.checkRegularVictory() |
703 _G.sm.checkRegularVictory() |
710 _G.sm.checkWinOrFail() |
704 _G.sm.checkWinOrFail() |
711 end |
705 end |
712 end |
706 end |
713 |
707 |
714 _G.onEndTurn = function() |
708 _G.onEndTurn = function() |
715 _G.sm.gameTurns = _G.sm.gameTurns + 1 |
709 _G.sm.gameTurns = _G.sm.gameTurns + 1 |
716 |
710 |
717 if params.customGoals == nil then |
711 if params.customGoalCheck == "turnEnd" then |
718 _G.sm.checkRegularVictory() |
|
719 elseif params.customGoalCheck == "turnEnd" then |
|
720 _G.sm.checkRegularVictory() |
712 _G.sm.checkRegularVictory() |
721 _G.sm.checkWinOrFail() |
713 _G.sm.checkWinOrFail() |
|
714 end |
|
715 end |
|
716 |
|
717 _G.onGameResult = function(winningClan) |
|
718 if (params.customGoals == nil) and (not _G.sm.wonVarWritten) and (winningClan == _G.sm.playerClan) then |
|
719 SaveMissionVar("Won", "true") |
|
720 _G.sm.wonVarWritten = true |
722 end |
721 end |
723 end |
722 end |
724 |
723 |
725 _G.onAmmoStoreInit = function() |
724 _G.onAmmoStoreInit = function() |
726 local ammoTypesDone = {} |
725 local ammoTypesDone = {} |