Continental supplies: Show continent in team bars
authorWuzzy <Wuzzy2@mail.ru>
Sat, 15 Jun 2019 16:05:13 +0200
changeset 15153 276bdf531ae0
parent 15152 35f6213ba1fa
child 15154 13a69aad9325
Continental supplies: Show continent in team bars
ChangeLog.txt
share/hedgewars/Data/Scripts/Multiplayer/Continental_supplies.lua
--- a/ChangeLog.txt	Sat Jun 15 14:49:18 2019 +0200
+++ b/ChangeLog.txt	Sat Jun 15 16:05:13 2019 +0200
@@ -42,6 +42,7 @@
  + Control, CTF_Blizzard: Display scores in stats screen
  + CTF_Blizzard: Various minor graphical and text improvements
  + Frenzy: Change ammo slots
+ + Continental supplies: Show continent in team bars
  * Balanced Random Weapon: Fix Lua errors after using Time Box
  * Racer: Fix racer ghost not getting reset after a skip
  * Space Invasion: No longer allow to set start shield above shield limit
--- a/share/hedgewars/Data/Scripts/Multiplayer/Continental_supplies.lua	Sat Jun 15 14:49:18 2019 +0200
+++ b/share/hedgewars/Data/Scripts/Multiplayer/Continental_supplies.lua	Sat Jun 15 16:05:13 2019 +0200
@@ -528,6 +528,7 @@
 	elseif not CS.GAME_STARTED then
 		AddCaption(CS.CONTINENT_INFORMATION[continent][1], GetClanColor(GetHogClan(CurrentHedgehog)), capgrpAmmoinfo)
 	end
+	SetContinentTeamLabel()
 end
 
 --will show a circle of gears (eye candy)
@@ -1145,6 +1146,16 @@
 	SuddenDeathTurns= SuddenDeathTurns+1
 end
 
+function onEndTurn()
+	if(CS.TEAM_CONTINENT[GetHogTeamName(CurrentHedgehog)]==0)
+	then
+		CS.TEAM_CONTINENT[GetHogTeamName(CurrentHedgehog)]=GetRandom(#CS.CONTINENT_INFORMATION)+1
+		SetContinentWeapons()
+		HideMission()
+	end
+	SetContinentTeamLabel()
+end
+
 --what happen when a turn starts
 function onNewTurn()
 	--will refresh the info on each tab weapon
@@ -1631,6 +1642,10 @@
 	end
 end
 
+function SetContinentTeamLabel()
+	SetTeamLabel(GetHogTeamName(CurrentHedgehog), CS.CONTINENT_INFORMATION[CS.TEAM_CONTINENT[GetHogTeamName(CurrentHedgehog)]][1])
+end
+
 function onGameTick()
 	-- This is a trick to show the continent label delayed by 1 tick
 	if CS.CONTINENT_LABEL_TIMER > 0 then