share/hedgewars/Data/Scripts/Multiplayer/Space_Invasion.lua
changeset 13019 880662cf41ee
parent 12426 9f3387907e06
child 13026 ca7fdb431b34
equal deleted inserted replaced
13018:0248cf0da834 13019:880662cf41ee
   573 
   573 
   574 function RebuildTeamInfo()
   574 function RebuildTeamInfo()
   575 
   575 
   576 	-- make a list of individual team names
   576 	-- make a list of individual team names
   577 	for i = 0, (TeamsCount-1) do
   577 	for i = 0, (TeamsCount-1) do
   578 		teamNameArr[i] = " " -- = i
       
   579 		teamSize[i] = 0
   578 		teamSize[i] = 0
   580 		teamIndex[i] = 0
   579 		teamIndex[i] = 0
   581 		teamScore[i] = 0
   580 		teamScore[i] = 0
   582 		teamCircsKilled[i] = 0
   581 		teamCircsKilled[i] = 0
   583 		teamSurfer[i] = false
   582 		teamSurfer[i] = false
   626 			end
   625 			end
   627 		end
   626 		end
   628 
   627 
   629 	end
   628 	end
   630 
   629 
       
   630 	for i=0, TeamsCount-1 do
       
   631 		SetTeamLabel(teamNameArr[i], teamScore[i])
       
   632 	end
       
   633 
   631 end
   634 end
   632 
   635 
   633 -- control
   636 -- control
   634 function AwardPoints(p)
   637 function AwardPoints(p)
   635 	roundScore = roundScore + p
   638 	roundScore = roundScore + p
   636 	DrawTag(4)
   639 	DrawTag(4)
   637 
   640 
   638 	for i = 0,(TeamsCount-1) do
   641 	for i = 0,(TeamsCount-1) do
   639 		if teamClan[i] == GetHogClan(CurrentHedgehog) then
   642 		if teamClan[i] == GetHogClan(CurrentHedgehog) then
   640 			teamScore[i] = teamScore[i] + p
   643 			teamScore[i] = teamScore[i] + p
       
   644 			SetTeamLabel(teamNameArr[i], teamScore[i])
   641 		end
   645 		end
   642 	end
   646 	end
   643 
   647 
   644 end
   648 end
   645 
   649 
   727 	for i = TeamsCount,1,-1 do
   731 	for i = TeamsCount,1,-1 do
   728 		entireC = entireC .. teamComment[i]
   732 		entireC = entireC .. teamComment[i]
   729 	end
   733 	end
   730 	local statusText, scoreText
   734 	local statusText, scoreText
   731 	if roundNumber >= roundLimit then
   735 	if roundNumber >= roundLimit then
   732 		if teamStats[1].score == teamStats[2].score then
   736 		statusText = loc("Game over!")
   733 			statusText = loc("Status Update")
   737 		scoreText = loc("Final team scores:")
   734 			scoreText = loc("Team scores:")
       
   735 		else
       
   736 			statusText = loc("Game over!")
       
   737 			scoreText = loc("Final team scores:")
       
   738 		end
       
   739 	else
   738 	else
   740 		statusText = loc("Status Update")
   739 		AddCaption(string.format(loc("Rounds complete: %d/%d"), roundNumber, roundLimit, 0xFFFFFFFF))
   741 		scoreText = loc("Team scores:")
   740 		return
   742 	end
   741 	end
   743 	local displayTime
   742 	local displayTime
   744 	if roundNumber >= roundLimit then
   743 	if roundNumber >= roundLimit then
   745 		displayTime = 20000
   744 		displayTime = 20000
   746 	else
   745 	else
  1254 				loc("Collect the green and purple invaders.") .. "|" ..
  1253 				loc("Collect the green and purple invaders.") .. "|" ..
  1255 				loc("Use the shield to protect yourself from bazookas.") .. "|" ..
  1254 				loc("Use the shield to protect yourself from bazookas.") .. "|" ..
  1256 				" " .. "|" ..
  1255 				" " .. "|" ..
  1257 
  1256 
  1258 				string.format(loc("Round Limit: %d"), roundLimit) .. "|" ..
  1257 				string.format(loc("Round Limit: %d"), roundLimit) .. "|" ..
  1259 				string.format(loc("Turn Time: %dsec"), (TurnTime/1000)) .. "|" ..
       
  1260 				" " .. "|" ..
  1258 				" " .. "|" ..
  1261 
  1259 
  1262 				loc("Movement: [Up], [Down], [Left], [Right]") .. "|" ..
  1260 				loc("Movement: [Up], [Down], [Left], [Right]") .. "|" ..
  1263 				loc("Fire: [Precise]") .. "|" ..
  1261 				loc("Fire: [Precise]") .. "|" ..
  1264 				loc("Toggle Shield: [Long jump]") .. "|" ..
  1262 				loc("Toggle Shield: [Long jump]") .. "|" ..