520 SaveMissionVar("Won", "true") |
520 SaveMissionVar("Won", "true") |
521 _G.sm.wonVarWritten = true |
521 _G.sm.wonVarWritten = true |
522 end |
522 end |
523 AddCaption(loc("Victory!"), capcolDefault, capgrpGameState) |
523 AddCaption(loc("Victory!"), capcolDefault, capgrpGameState) |
524 SendStat(siGameResult, loc("You win!")) |
524 SendStat(siGameResult, loc("You win!")) |
525 if GetHogLevel(CurrentHedgehog) == 0 then |
|
526 SetState(CurrentHedgehog, bor(GetState(CurrentHedgehog), gstWinner)) |
|
527 SetState(CurrentHedgehog, band(GetState(CurrentHedgehog), bnot(gstHHDriven))) |
|
528 PlaySound(sndVictory, CurrentHedgehog) |
|
529 end |
|
530 _G.sm.makeStats(_G.sm.playerClan) |
525 _G.sm.makeStats(_G.sm.playerClan) |
531 EndGame() |
526 EndGame() |
|
527 if GetHogLevel(CurrentHedgehog) == 0 then |
|
528 for team, hog in pairs(teamHogs[GetHogTeamName(CurrentHedgehog)]) do |
|
529 SetState(hog, gstWinner) |
|
530 PlaySound(sndVictory, hog) |
|
531 end |
|
532 end |
532 end |
533 end |
533 end |
534 end |
534 |
535 |
535 _G.sm.lose = function(failReason) |
536 _G.sm.lose = function(failReason) |
536 if not _G.sm.gameEnded then |
537 if not _G.sm.gameEnded then |