equal
deleted
inserted
replaced
38 - teams: Table of teams. There must be 1-8 teams. |
38 - teams: Table of teams. There must be 1-8 teams. |
39 |
39 |
40 Optional fields |
40 Optional fields |
41 - ammoConfig Table containing basic ammo values (default: infinite skip only) |
41 - ammoConfig Table containing basic ammo values (default: infinite skip only) |
42 - initVars Table where you set up environment parameters such as MinesNum. |
42 - initVars Table where you set up environment parameters such as MinesNum. |
43 - wind If set, the wind will permanently set to this value (-100..100) |
43 - wind If set, the wind will permanently set to this value (-100..100). Implies gfDisableWind |
44 - gears: Table of objects. |
44 - gears: Table of objects. |
45 - girders Table of girders |
45 - girders Table of girders |
46 - rubbers Table of rubbers |
46 - rubbers Table of rubbers |
47 |
47 |
48 AMMO |
48 AMMO |
639 |
639 |
640 for initVarName, initVarValue in pairs(params.initVars) do |
640 for initVarName, initVarValue in pairs(params.initVars) do |
641 _G[initVarName] = initVarValue |
641 _G[initVarName] = initVarValue |
642 end |
642 end |
643 if #params.teams == 1 then |
643 if #params.teams == 1 then |
644 EnableGameFlags(gfOneClanMode) |
644 GameFlags = bor(GameFlags, gfOneClanMode) |
|
645 end |
|
646 if params.wind then |
|
647 GameFlags = bor(GameFlags, gfDisableWind) |
645 end |
648 end |
646 |
649 |
647 local clanCounter = 0 |
650 local clanCounter = 0 |
648 for teamID, teamData in pairs(params.teams) do |
651 for teamID, teamData in pairs(params.teams) do |
649 local name, clanID, grave, fort, voice, flag |
652 local name, clanID, grave, fort, voice, flag |
693 end |
696 end |
694 end |
697 end |
695 end |
698 end |
696 |
699 |
697 _G.onNewTurn = function() |
700 _G.onNewTurn = function() |
698 if params.wind ~= nil then |
|
699 SetWind(params.wind) |
|
700 end |
|
701 _G.sm.gameStarted = true |
701 _G.sm.gameStarted = true |
702 |
702 |
703 if params.customGoalCheck == "turnStart" then |
703 if params.customGoalCheck == "turnStart" then |
704 _G.sm.checkRegularVictory() |
704 _G.sm.checkRegularVictory() |
705 _G.sm.checkWinOrFail() |
705 _G.sm.checkWinOrFail() |
747 params.goalText = params.goalText .. "|" .. string.format(loc("Mines time: %.1fs"), MinesTime/1000) |
747 params.goalText = params.goalText .. "|" .. string.format(loc("Mines time: %.1fs"), MinesTime/1000) |
748 else |
748 else |
749 params.goalText = params.goalText .. "|" .. string.format(loc("Mines time: %.2fs"), MinesTime/1000) |
749 params.goalText = params.goalText .. "|" .. string.format(loc("Mines time: %.2fs"), MinesTime/1000) |
750 end |
750 end |
751 end |
751 end |
|
752 if params.wind then |
|
753 SetWind(params.wind) |
|
754 end |
752 ShowMission(params.missionTitle, loc("Scenario"), params.goalText, params.missionIcon, 5000) |
755 ShowMission(params.missionTitle, loc("Scenario"), params.goalText, params.missionIcon, 5000) |
753 |
756 |
754 -- Spawn objects |
757 -- Spawn objects |
755 |
758 |
756 if params.gears ~= nil then |
759 if params.gears ~= nil then |
859 _G.onGameTick20 = function() |
862 _G.onGameTick20 = function() |
860 if params.customGoalCheck == "instant" then |
863 if params.customGoalCheck == "instant" then |
861 _G.sm.checkWinOrFail() |
864 _G.sm.checkWinOrFail() |
862 end |
865 end |
863 end |
866 end |
|
867 |
864 end |
868 end |
865 |
869 |