share/hedgewars/Data/Scripts/Multiplayer/Continental_supplies.lua
changeset 15999 9128bb16aaf5
parent 15997 f362e82cddcf
equal deleted inserted replaced
15998:91c487e7d11d 15999:9128bb16aaf5
   234 		quit_hint = "|"..loc("Hint: Use the quit key to see the team’s continent.")
   234 		quit_hint = "|"..loc("Hint: Use the quit key to see the team’s continent.")
   235 	else
   235 	else
   236 		select_wep = ""
   236 		select_wep = ""
   237 		quit_hint = ""
   237 		quit_hint = ""
   238 	end
   238 	end
       
   239 	local gameFlagPrepend = ""
       
   240 	local continentInfoPlace = loc("Continents: Select a continent after placing your hogs.")
       
   241 	local continentInfoNormal = loc("Continents: Select a continent at the beginning.")
       
   242 	local continentInfo = continentInfoNormal
       
   243 	if GetGameFlag(gfKing) then
       
   244 		gameFlagPrepend = gameFlagPrepend .. GetEngineString("TGoalStrId", gidKing).."|"
       
   245 		if GetGameFlag(gfPlaceHog) then
       
   246 			gameFlagPrepend = gameFlagPrepend .. GetEngineString("TGoalStrId", gidPlaceHog).."|"
       
   247 		else
       
   248 			gameFlagPrepend = gameFlagPrepend .. GetEngineString("TGoalStrId", gidPlaceKing).."|"
       
   249 		end
       
   250 		continentInfo = continentInfoPlace
       
   251 	else
       
   252 		if GetGameFlag(gfPlaceHog) then
       
   253 			gameFlagPrepend = gameFlagPrepend .. GetEngineString("TGoalStrId", gidPlaceHog).."|"
       
   254 			continentInfo = continentInfoPlace
       
   255 		end
       
   256 	end
   239 	local general_information =
   257 	local general_information =
   240 		loc("Continents: Select a continent at the beginning.").."|"..
   258 		gameFlagPrepend..
       
   259 		continentInfo.."|"..
   241 		loc("Supplies: Each continent gives you unique weapons, specials and health.").."|"..
   260 		loc("Supplies: Each continent gives you unique weapons, specials and health.").."|"..
   242 		loc("Weapon specials: Some weapons have special modes (see weapon description).")..
   261 		loc("Weapon specials: Some weapons have special modes (see weapon description).")..
   243 		select_wep..
   262 		select_wep..
   244 		quit_hint
   263 		quit_hint
   245 	return general_information
   264 	return general_information
  1143 end
  1162 end
  1144 
  1163 
  1145 function onGameInit()
  1164 function onGameInit()
  1146 	SuddenDeathTurns= SuddenDeathTurns+1
  1165 	SuddenDeathTurns= SuddenDeathTurns+1
  1147 	-- Disable GameFlags that are incompatible with this game
  1166 	-- Disable GameFlags that are incompatible with this game
  1148 	DisableGameFlags(gfKing, gfPlaceHog, gfPerHogAmmo, gfSharedAmmo, gfResetWeps)
  1167 	DisableGameFlags(gfPerHogAmmo, gfSharedAmmo, gfResetWeps)
  1149 end
  1168 end
  1150 
  1169 
  1151 function onEndTurn()
  1170 function onEndTurn()
       
  1171 	if(TotalRounds == -1) then
       
  1172 		-- Do nothing if placing hogs
       
  1173 		return
       
  1174 	end
  1152 	if(CS.TEAM_CONTINENT[GetHogTeamName(CurrentHedgehog)]==0)
  1175 	if(CS.TEAM_CONTINENT[GetHogTeamName(CurrentHedgehog)]==0)
  1153 	then
  1176 	then
  1154 		CS.TEAM_CONTINENT[GetHogTeamName(CurrentHedgehog)]=GetRandom(#CS.CONTINENT_INFORMATION)+1
  1177 		CS.TEAM_CONTINENT[GetHogTeamName(CurrentHedgehog)]=GetRandom(#CS.CONTINENT_INFORMATION)+1
  1155 		SetContinentWeapons()
  1178 		SetContinentWeapons()
  1156 		HideMission()
  1179 		HideMission()
  1188 	SetSoundMask(sndMissed, false)
  1211 	SetSoundMask(sndMissed, false)
  1189 	CS.AFRICAN_SPECIAL_NON_PROJECTILE_USED=false
  1212 	CS.AFRICAN_SPECIAL_NON_PROJECTILE_USED=false
  1190 	SetAttackState(true)
  1213 	SetAttackState(true)
  1191 
  1214 
  1192 	--when all hogs are "placed"
  1215 	--when all hogs are "placed"
  1193 	if(GetCurAmmoType()~=amTeleport)
  1216 	if(TotalRounds ~= -1)
  1194 	then
  1217 	then
  1195 		--will run once when the game really starts (after placing hogs and so on
  1218 		--will run once when the game really starts (after placing hogs and so on
  1196 		if(CS.INIT_TEAMS[GetHogTeamName(CurrentHedgehog)] == nil)
  1219 		if(CS.INIT_TEAMS[GetHogTeamName(CurrentHedgehog)] == nil)
  1197 		then
  1220 		then
  1198 			SetInputMask(band(GetInputMask(), gmWeapon))
  1221 			SetInputMask(band(GetInputMask(), gmWeapon))