home *** CD-ROM | disk | FTP | other *** search
/ 600 Games / 600games.iso / Acao / flameout.swf / scripts / __Packages / GameSummaryPanel.as < prev    next >
Encoding:
Text File  |  2006-06-13  |  4.2 KB  |  125 lines

  1. class GameSummaryPanel extends LRG.LRGMovieClip
  2. {
  3.    var m_kKillsText;
  4.    var m_kSurvivalText;
  5.    var m_kAccuracyText;
  6.    var m_kScoreText;
  7.    var m_kHydrogenText;
  8.    var m_kComboShotsText;
  9.    var m_kRankText;
  10.    var m_kBackground;
  11.    var m_kOkButton;
  12.    var onKeyUp;
  13.    var onRelease;
  14.    var m_kHelpButton;
  15.    function GameSummaryPanel()
  16.    {
  17.       super();
  18.    }
  19.    function init()
  20.    {
  21.       super.init();
  22.    }
  23.    function onShow()
  24.    {
  25.       this.m_kKillsText.text = PlayerState(_global.getPlayerState()).getKillsTotal();
  26.       if(PlayerState(_global.getPlayerState()).getTimeTotal() >= 60)
  27.       {
  28.          var _loc3_ = Math.round(PlayerState(_global.getPlayerState()).getTimeTotal()) % 60;
  29.          if(_loc3_ < 10)
  30.          {
  31.             this.m_kSurvivalText.text = Math.floor(PlayerState(_global.getPlayerState()).getTimeTotal() / 60) + ":0" + Math.round(PlayerState(_global.getPlayerState()).getTimeTotal()) % 60;
  32.          }
  33.          else
  34.          {
  35.             this.m_kSurvivalText.text = Math.floor(PlayerState(_global.getPlayerState()).getTimeTotal() / 60) + ":" + Math.round(PlayerState(_global.getPlayerState()).getTimeTotal()) % 60;
  36.          }
  37.       }
  38.       else
  39.       {
  40.          this.m_kSurvivalText.text = Math.round(PlayerState(_global.getPlayerState()).getTimeTotal()) + " sec";
  41.       }
  42.       if(PlayerState(_global.getPlayerState()).getShotsTotal() > 0)
  43.       {
  44.          this.m_kAccuracyText.text = Math.round(PlayerState(_global.getPlayerState()).getHitsTotal() / PlayerState(_global.getPlayerState()).getShotsTotal() * 100) + " %";
  45.       }
  46.       else
  47.       {
  48.          this.m_kAccuracyText.text = "0 %";
  49.       }
  50.       this.m_kScoreText.text = PlayerState(_global.getPlayerState()).getScore();
  51.       this.m_kHydrogenText.text = PlayerState(_global.getPlayerState()).getHydrogenTotal();
  52.       this.m_kComboShotsText.text = PlayerState(_global.getPlayerState()).getComboShotsTotal();
  53.       switch(PlayerState(_global.getPlayerState()).getLevel())
  54.       {
  55.          case 1:
  56.             this.m_kRankText.text = "Chimera Fodder";
  57.             break;
  58.          case 2:
  59.             this.m_kRankText.text = "Aspirant";
  60.             break;
  61.          case 3:
  62.             this.m_kRankText.text = "Pupil";
  63.             break;
  64.          case 4:
  65.             this.m_kRankText.text = "Combatant";
  66.             break;
  67.          case 5:
  68.             this.m_kRankText.text = "Marksman";
  69.             break;
  70.          case 6:
  71.             this.m_kRankText.text = "Informant";
  72.             break;
  73.          case 7:
  74.             this.m_kRankText.text = "Operative";
  75.             break;
  76.          case 8:
  77.             this.m_kRankText.text = "Striker";
  78.             break;
  79.          case 9:
  80.             this.m_kRankText.text = "Guardian";
  81.             break;
  82.          case 10:
  83.             this.m_kRankText.text = "Executor";
  84.             break;
  85.          case 11:
  86.             this.m_kRankText.text = "Templar";
  87.             break;
  88.          default:
  89.             this.m_kRankText.text = "Harbinger";
  90.       }
  91.       this.m_kBackground.onPress = function()
  92.       {
  93.       };
  94.       this.m_kBackground.onRelease = function()
  95.       {
  96.       };
  97.       this.m_kBackground.useHandCursor = false;
  98.       this.m_kOkButton.onRelease = function()
  99.       {
  100.          _global.playSound("fma_button.wav",1,_global.g_kApplication);
  101.          this.onKeyUp = undefined;
  102.          Key.removeListener(this);
  103.          _global.g_kApplication.m_kGui.m_kGameSummaryPanel.gotoAndStop("Hide");
  104.          _global.g_kApplication.m_kGui.m_kGameSummaryPanel._visible = false;
  105.          _global.g_kApplication.m_kGameScreen.startGame();
  106.       };
  107.       Key.addListener(this.m_kOkButton);
  108.       this.m_kOkButton.onKeyUp = function()
  109.       {
  110.          if(Key.getCode() == 13)
  111.          {
  112.             this.onRelease();
  113.          }
  114.       };
  115.       this.m_kHelpButton.onRelease = function()
  116.       {
  117.          _global.g_kApplication.m_kGui.m_kGameSummaryPanel.gotoAndStop("Hide");
  118.          _global.g_kApplication.m_kGui.m_kGameSummaryPanel._visible = false;
  119.          _global.g_kApplication.m_kGui.m_kHelpPanel.gotoAndStop("Hide");
  120.          _global.g_kApplication.m_kGui.m_kHelpPanel._visible = false;
  121.          _global.g_kApplication.m_kGui.m_kHelpPanel.onShow();
  122.       };
  123.    }
  124. }
  125.