# HG changeset patch # User Wuzzy # Date 1687979774 -7200 # Node ID 9128bb16aaf5161ded150b2d192d1ddcc928e572 # Parent 91c487e7d11d346788db71b58e063ff1cad13621 CS: Add support for King Mode and PlaceHog diff -r 91c487e7d11d -r 9128bb16aaf5 share/hedgewars/Data/Scripts/Multiplayer/Continental_supplies.lua --- a/share/hedgewars/Data/Scripts/Multiplayer/Continental_supplies.lua Wed Jun 28 21:14:56 2023 +0200 +++ b/share/hedgewars/Data/Scripts/Multiplayer/Continental_supplies.lua Wed Jun 28 21:16:14 2023 +0200 @@ -236,8 +236,27 @@ select_wep = "" quit_hint = "" end + local gameFlagPrepend = "" + local continentInfoPlace = loc("Continents: Select a continent after placing your hogs.") + local continentInfoNormal = loc("Continents: Select a continent at the beginning.") + local continentInfo = continentInfoNormal + if GetGameFlag(gfKing) then + gameFlagPrepend = gameFlagPrepend .. GetEngineString("TGoalStrId", gidKing).."|" + if GetGameFlag(gfPlaceHog) then + gameFlagPrepend = gameFlagPrepend .. GetEngineString("TGoalStrId", gidPlaceHog).."|" + else + gameFlagPrepend = gameFlagPrepend .. GetEngineString("TGoalStrId", gidPlaceKing).."|" + end + continentInfo = continentInfoPlace + else + if GetGameFlag(gfPlaceHog) then + gameFlagPrepend = gameFlagPrepend .. GetEngineString("TGoalStrId", gidPlaceHog).."|" + continentInfo = continentInfoPlace + end + end local general_information = - loc("Continents: Select a continent at the beginning.").."|".. + gameFlagPrepend.. + continentInfo.."|".. loc("Supplies: Each continent gives you unique weapons, specials and health.").."|".. loc("Weapon specials: Some weapons have special modes (see weapon description).").. select_wep.. @@ -1145,10 +1164,14 @@ function onGameInit() SuddenDeathTurns= SuddenDeathTurns+1 -- Disable GameFlags that are incompatible with this game - DisableGameFlags(gfKing, gfPlaceHog, gfPerHogAmmo, gfSharedAmmo, gfResetWeps) + DisableGameFlags(gfPerHogAmmo, gfSharedAmmo, gfResetWeps) end function onEndTurn() + if(TotalRounds == -1) then + -- Do nothing if placing hogs + return + end if(CS.TEAM_CONTINENT[GetHogTeamName(CurrentHedgehog)]==0) then CS.TEAM_CONTINENT[GetHogTeamName(CurrentHedgehog)]=GetRandom(#CS.CONTINENT_INFORMATION)+1 @@ -1190,7 +1213,7 @@ SetAttackState(true) --when all hogs are "placed" - if(GetCurAmmoType()~=amTeleport) + if(TotalRounds ~= -1) then --will run once when the game really starts (after placing hogs and so on if(CS.INIT_TEAMS[GetHogTeamName(CurrentHedgehog)] == nil)