share/hedgewars/Data/Scripts/Multiplayer/Space_Invasion.lua
changeset 12424 b9cc405541c1
parent 12334 0bc8c5fcd08c
child 12426 9f3387907e06
equal deleted inserted replaced
12423:e9d2efe5763b 12424:b9cc405541c1
   756 		for i = 0, (numhhs-1) do
   756 		for i = 0, (numhhs-1) do
   757 			if GetHogTeamName(hhs[i]) == winnerTeam then
   757 			if GetHogTeamName(hhs[i]) == winnerTeam then
   758 				SetState(hhs[i], bor(GetState(hhs[i]), gstWinner))
   758 				SetState(hhs[i], bor(GetState(hhs[i]), gstWinner))
   759 			end
   759 			end
   760 		end
   760 		end
   761 		AddCaption(string.format("%s wins!", winnerTeam))
   761 		AddCaption(string.format(loc("%s wins!"), winnerTeam))
   762 		SendStat(siGameResult, string.format("%s wins!", winnerTeam))
   762 		SendStat(siGameResult, string.format(loc("%s wins!"), winnerTeam))
   763 
   763 
   764 		for i = 1, TeamsCount do
   764 		for i = 1, TeamsCount do
   765 			SendStat(siPointType, loc("points"))
   765 			SendStat(siPointType, loc("points"))
   766 			SendStat(siPlayerKills, tostring(teamStats[i].score), teamStats[i].name)
   766 			SendStat(siPlayerKills, tostring(teamStats[i].score), teamStats[i].name)
   767 		end
   767 		end
   812 					text = loc("The hardships of the war turned %s (%s) into a killing machine: %d invaders destroyed in one round!")
   812 					text = loc("The hardships of the war turned %s (%s) into a killing machine: %d invaders destroyed in one round!")
   813 				else
   813 				else
   814 					text = loc("%s (%s) is Rambo in a hedgehog costume! He destroyed %d invaders in one round.")
   814 					text = loc("%s (%s) is Rambo in a hedgehog costume! He destroyed %d invaders in one round.")
   815 				end
   815 				end
   816 			elseif awardRoundKills.value >= 11 then
   816 			elseif awardRoundKills.value >= 11 then
   817 				text = loc("%s (%s) is addicted to killing: %d invaders destoyed in one round.")
   817 				text = loc("%s (%s) is addicted to killing: %d invaders destroyed in one round.")
   818 			else
   818 			else
   819 				text = loc("%s (%s) destroyed %d invaders in one round.")
   819 				text = loc("%s (%s) destroyed %d invaders in one round.")
   820 			end
   820 			end
   821 			SendStat(siCustomAchievement,
   821 			SendStat(siCustomAchievement,
   822 			string.format(text,
   822 			string.format(text,
  1524 						}
  1524 						}
  1525 					end
  1525 					end
  1526 		
  1526 		
  1527 				end
  1527 				end
  1528 
  1528 
  1529 				AddCaption(loc(string.format("Round score: %d", roundScore)), 0xFFFFFFFF, capgrpMessage2)
  1529 				AddCaption(loc(string.format(loc("Round score: %d"), roundScore)), 0xFFFFFFFF, capgrpMessage2)
  1530 
  1530 
  1531 				-- other awards
  1531 				-- other awards
  1532 				awardRoundScore = UpdateSimpleAward(awardRoundScore, roundScore, 50)
  1532 				awardRoundScore = UpdateSimpleAward(awardRoundScore, roundScore, 50)
  1533 				awardRoundKills = UpdateSimpleAward(awardRoundKills, roundKills, 5)
  1533 				awardRoundKills = UpdateSimpleAward(awardRoundKills, roundKills, 5)
  1534 
  1534 
  1860 		elseif (vType[i] == "ammo") then
  1860 		elseif (vType[i] == "ammo") then
  1861 			AddVisualGear(vCircX[i], vCircY[i], vgtExplosion, 0, false)
  1861 			AddVisualGear(vCircX[i], vCircY[i], vgtExplosion, 0, false)
  1862 			PlaySound(sndExplosion)
  1862 			PlaySound(sndExplosion)
  1863 			PlaySound(sndShotgunReload)
  1863 			PlaySound(sndShotgunReload)
  1864 			wepAmmo[0] = wepAmmo[0] + barrelBonus
  1864 			wepAmmo[0] = wepAmmo[0] + barrelBonus
  1865 			AddCaption(string.format("+%d Ammo", barrelBonus), 0x00ff00ff,capgrpMessage)
  1865 			AddCaption(string.format(loc("+%d Ammo"), barrelBonus), 0x00ff00ff,capgrpMessage)
  1866 			DrawTag(1)
  1866 			DrawTag(1)
  1867 
  1867 
  1868 			GK = GK + 1
  1868 			GK = GK + 1
  1869 			if GK == 3 then
  1869 			if GK == 3 then
  1870 				GK = 0
  1870 				GK = 0
  2100 
  2100 
  2101 
  2101 
  2102 				--nw WriteLnToConsole("Collision confirmed. The gtExplosives is within the circ radius!")
  2102 				--nw WriteLnToConsole("Collision confirmed. The gtExplosives is within the circ radius!")
  2103 
  2103 
  2104 				dist = (GetDistFromXYtoXY(vCircX[i], vCircY[i], getGearValue(gear,"XP"), getGearValue(gear,"YP")) - (NR*NR))
  2104 				dist = (GetDistFromXYtoXY(vCircX[i], vCircY[i], getGearValue(gear,"XP"), getGearValue(gear,"YP")) - (NR*NR))
  2105 				--AddCaption(loc("Dist: ") .. dist .. "!",0xffba00ff,capgrpGameState)
       
  2106 				if dist >= 1000000 then
  2105 				if dist >= 1000000 then
  2107 					sniperHits = sniperHits +1
  2106 					sniperHits = sniperHits +1
  2108 					AddCaption(loc("Sniper! +8 points!"),0xffba00ff,capgrpGameState)
  2107 					AddCaption(loc("Sniper! +8 points!"),0xffba00ff,capgrpGameState)
  2109 					AwardPoints(8)
  2108 					AwardPoints(8)
  2110 					if sniperHits == 3 then
  2109 					if sniperHits == 3 then