share/hedgewars/Data/Scripts/Multiplayer/Mutant.lua
changeset 13019 880662cf41ee
parent 12988 a15413d896c3
child 13036 434bcdd9562c
equal deleted inserted replaced
13018:0248cf0da834 13019:880662cf41ee
   117         " |" ..
   117         " |" ..
   118 	loc("Scoring: ") .. "|" ..
   118 	loc("Scoring: ") .. "|" ..
   119 	loc("+2 for becoming the Mutant") .. "|" ..
   119 	loc("+2 for becoming the Mutant") .. "|" ..
   120 	loc("+1 to the Mutant for killing anyone") .. "|" ..
   120 	loc("+1 to the Mutant for killing anyone") .. "|" ..
   121 	loc("+1 to the Bottom Feeder for killing anyone") .. "|" ..
   121 	loc("+1 to the Bottom Feeder for killing anyone") .. "|" ..
   122 	loc("-1 to anyone for a suicide") .. "|" ..
   122 	loc("-1 to anyone for a suicide")
   123 	loc("Other kills don't give you points.")
       
   124 
   123 
   125 	return ruleSet
   124 	return ruleSet
   126 
   125 
   127 end
   126 end
   128 
   127 
   367     SetState(gear, gstLoser)
   366     SetState(gear, gstLoser)
   368     SetEffect(gear, heResurrectable, false)
   367     SetEffect(gear, heResurrectable, false)
   369     SetHealth(gear, 0)
   368     SetHealth(gear, 0)
   370 end
   369 end
   371 
   370 
   372 function updateScore()
   371 function renderScores()
   373 
       
   374     local showScore = ""
       
   375 
       
   376     for i=0, TeamsCount-1 do
   372     for i=0, TeamsCount-1 do
   377         if teams[i]~= nil then
   373         if teams[i]~= nil then
   378 
   374             SetTeamLabel(teams[i], string.format(loc("Score: %d | Deaths: %d"), getTeamValue(teams[i], "Score"), getTeamValue(teams[i], "DeadHogs")))
   379             local curr_score = getTeamValue(teams[i], "Score")
   375         end
   380             showScore = showScore .. string.format(loc("%s: %d (deaths: %d)"), teams[i], curr_score, getTeamValue(teams[i], "DeadHogs")) .. "|"
   376     end
   381 
       
   382         end
       
   383     end
       
   384 
       
   385     ShowMission(loc("Mutant"),
       
   386                 loc("Scores"),
       
   387                 showScore, 4, 1)
       
   388 
       
   389     HideMission()
       
   390 
       
   391 end
   377 end
   392 
   378 
   393 function checkScore()
   379 function checkScore()
   394 local showScore = ""
   380 local showScore = ""
   395 local lowest_score_team = nil
   381 local lowest_score_team = nil
   505         runOnHogsInTeam(setFeeder, lowest_score_team)
   491         runOnHogsInTeam(setFeeder, lowest_score_team)
   506     end
   492     end
   507 
   493 
   508     if meh == false then
   494     if meh == false then
   509 		meh = true
   495 		meh = true
   510 	else
       
   511 		ShowMission(    loc("Mutant"),
       
   512                     loc("Scores"),
       
   513                     showScore, 4, 1)
       
   514 		HideMission()
       
   515 	end
   496 	end
   516 
   497 
   517     end
   498     end
   518 end
   499 end
   519 
   500 
   600                 if teams[j] == GetHogTeamName(hhs[i]) then
   581                 if teams[j] == GetHogTeamName(hhs[i]) then
   601                     break
   582                     break
   602                 end
   583                 end
   603             end
   584             end
   604         end
   585         end
       
   586 
       
   587         renderScores()
   605 
   588 
   606         ---***---
   589         ---***---
   607 end
   590 end
   608 
   591 
   609 function set_Mutant_and_Score(gear)
   592 function set_Mutant_and_Score(gear)
   698             killsCounter = killsCounter + 1
   681             killsCounter = killsCounter + 1
   699             countBodies()
   682             countBodies()
   700         end
   683         end
   701         AddVisualGear(GetX(gear), GetY(gear), vgtSmokeRing, 0, false)
   684         AddVisualGear(GetX(gear), GetY(gear), vgtSmokeRing, 0, false)
   702         PlaySound(sndWhack)
   685         PlaySound(sndWhack)
   703         updateScore()
   686         renderScores()
   704     end
   687     end
   705 end
   688 end
   706 end
   689 end
   707 
   690 
   708 function onGearDamage(gear, damage)
   691 function onGearDamage(gear, damage)