Remove team score messages in Knockball/Basketball because they're redundant
authorWuzzy <almikes@aol.com>
Fri, 25 Nov 2016 14:06:00 +0100
changeset 12086 ed40d46c9e59
parent 12085 6c734d8defef
child 12087 c680b7db1e2e
Remove team score messages in Knockball/Basketball because they're redundant
share/hedgewars/Data/Maps/Basketball/map.lua
share/hedgewars/Data/Maps/Knockball/map.lua
--- a/share/hedgewars/Data/Maps/Basketball/map.lua	Fri Nov 25 13:53:22 2016 +0100
+++ b/share/hedgewars/Data/Maps/Basketball/map.lua	Fri Nov 25 14:06:00 2016 +0100
@@ -2,8 +2,6 @@
 
 HedgewarsScriptLoad("/Scripts/Locale.lua")
 
-local score = {[0] = 0, [1] = 0, [2] = 0, [3] = 0, [4] = 0, [5] = 0}
-
 local started = false
 
 function onGameInit()
@@ -24,39 +22,11 @@
 	started = true
 end
 
-function onGameTick()
-end
-
 function onAmmoStoreInit()
 	SetAmmo(amBaseballBat, 9, 0, 0, 0)
 	SetAmmo(amSkip, 9, 0, 0, 0)
 end
 
-function onGearAdd(gear)
-end
-
-function onGearDelete(gear)
-	if not started then
-		return
-	end
-	if (GetGearType(gear) == gtHedgehog) and CurrentHedgehog ~= nil then
-		local clan = GetHogClan(CurrentHedgehog)
-		local s
-		if clan ~= nil then
-			if GetHogClan(CurrentHedgehog) ~= GetHogClan(gear) then
-				score[clan] = score[clan] + 1
-				s = string.format(loc("%s is out and Team %d|scored a point!| |Score:"), GetHogName(gear), clan + 1)
-			else
-				score[clan] = score[clan] - 1
-				s = string.format(loc("%s is out and Team %d|scored a penalty!| |Score:"), GetHogName(gear), clan + 1)
-			end
-			s = s .. " " .. score[0]
-			for i = 1, ClansCount - 1 do s = s .. " - " .. score[i] end
-			ShowMission(loc("Basketball"), loc("Not So Friendly Match"), s, -amBaseballBat, 0)
-		end
-	end
-end
-
 function onNewTurn()
     SetWeapon(amBaseballBat)
 end
--- a/share/hedgewars/Data/Maps/Knockball/map.lua	Fri Nov 25 13:53:22 2016 +0100
+++ b/share/hedgewars/Data/Maps/Knockball/map.lua	Fri Nov 25 14:06:00 2016 +0100
@@ -2,12 +2,8 @@
 
 HedgewarsScriptLoad("/Scripts/Locale.lua")
 
-local score = {[0] = 0, [1] = 0, [2] = 0, [3] = 0, [4] = 0, [5] = 0}
-
 local ball = nil
 
-local started = false
-
 function onGameInit()
 	GameFlags = gfSolidLand + gfInvulnerable + gfDivideTeams
 	TurnTime = 20000
@@ -22,7 +18,6 @@
 
 function onGameStart()
 	ShowMission(loc("Knockball"), loc("Not So Friendly Match"), loc("Bat balls at your enemies and|push them into the sea!"), -amBaseballBat, 0)
-	started = true
 end
 
 function onGameTick()
@@ -48,26 +43,8 @@
 end
 
 function onGearDelete(gear)
-	if not started then
-		return
-	end
 	if gear == ball then
 		ball = nil
-	elseif (GetGearType(gear) == gtHedgehog) and CurrentHedgehog ~= nil then
-		local clan = GetHogClan(CurrentHedgehog)
-		local s
-		if clan ~= nil then
-			if GetHogClan(CurrentHedgehog) ~= GetHogClan(gear) then
-				score[clan] = score[clan] + 1
-				s = string.format(loc("%s is out and Team %d|scored a point!| |Score:"), GetHogName(gear), clan + 1)
-			else
-				score[clan] = score[clan] - 1
-				s = string.format(loc("%s is out and Team %d|scored a penalty!| |Score:"), GetHogName(gear), clan + 1)
-			end
-			s = s .. " " .. score[0]
-			for i = 1, ClansCount - 1 do s = s .. " - " .. score[i] end
-			ShowMission(loc("Knockball"), loc("Not So Friendly Match"), s, -amBaseballBat, 0)
-		end
 	end
 end