home *** CD-ROM | disk | FTP | other *** search
/ Mobiclic 168 / MOBICLIC168.ISO / mac / DATA / GAM168 / GAM168_00 / GAM168_00.swf / scripts / frame_59 / DoAction.as
Text File  |  2014-10-17  |  3KB  |  111 lines

  1. function allumePerso()
  2. {
  3.    if(_root.gCountPerso < 2)
  4.    {
  5.       lVilGen = _root.randRange(0,1);
  6.       switch(lVilGen)
  7.       {
  8.          case 0:
  9.             _root["VILAIN_" + gListPerso[gPerso - 1]]._visible = 1;
  10.             _root["lifetimeStartV" + gListPerso[gPerso - 1]] = getTimer();
  11.             _root["lifetimeV" + gListPerso[gPerso - 1]] = 3000;
  12.             gPersoActive.push("VILAIN_" + gListPerso[gPerso - 1]);
  13.             break;
  14.          case 1:
  15.             _root["GENTIL_" + gListPerso[gPerso - 1]]._visible = 1;
  16.             _root["lifetimeStartG" + gListPerso[gPerso - 1]] = getTimer();
  17.             _root["lifetimeG" + gListPerso[gPerso - 1]] = 3000;
  18.             gPersoActive.push("GENTIL_" + gListPerso[gPerso - 1]);
  19.       }
  20.       _root[gPersoActive[gPersoActive.length - 1]].gTimePause = 0;
  21.       _root.gCountPerso += 1;
  22.       _root.gPerso += 1;
  23.       if(gPerso === 11)
  24.       {
  25.          listBase = [1,2,3,4,5,6,7,8,9,10];
  26.          gPerso = 1;
  27.          gListPerso = [];
  28.          i = 0;
  29.          while(i <= 9)
  30.          {
  31.             lElement = _root.randRange(0,listBase.length - 1);
  32.             myPerso = listBase[lElement];
  33.             if(myPerso < 10)
  34.             {
  35.                myPerso = "0" + myPerso;
  36.             }
  37.             else
  38.             {
  39.                myPerso = "10";
  40.             }
  41.             _root.gListPerso.push(myPerso);
  42.             listBase.splice(lElement,1);
  43.             i++;
  44.          }
  45.       }
  46.    }
  47. }
  48. function eteindrePerso(type, num, freezeScore)
  49. {
  50.    if(freezeScore !== 1)
  51.    {
  52.       _root.gScore -= 1;
  53.       _root.joueBruitage({nomSon:"B_ECHEC"});
  54.    }
  55.    switch(type)
  56.    {
  57.       case "V":
  58.          _root["VILAIN_" + num]._visible = 0;
  59.          _root.gCountPerso -= 1;
  60.          lPos = _root.getPos(gPersoActive,"VILAIN_" + num);
  61.          gPersoActive = gPersoActive.splice(lPos + 1);
  62.          break;
  63.       case "G":
  64.          _root["GENTIL_" + num]._visible = 0;
  65.          _root.gCountPerso -= 1;
  66.          lPos = _root.getPos(gPersoActive,"GENTIL_" + num);
  67.          gPersoActive = gPersoActive.splice(lPos + 1);
  68.    }
  69.    _root[gPersoActive[lPos]].gTimePause = 0;
  70. }
  71. gScore = 0;
  72. i = 1;
  73. while(i < 11)
  74. {
  75.    if(i < 10)
  76.    {
  77.       perso = "0" + String(i);
  78.    }
  79.    else
  80.    {
  81.       perso = "10";
  82.    }
  83.    _root["VILAIN_" + perso]._visible = 0;
  84.    _root["GENTIL_" + perso]._visible = 0;
  85.    i++;
  86. }
  87. listBase = [1,2,3,4,5,6,7,8,9,10];
  88. gListPerso = [];
  89. i = 0;
  90. while(i <= 9)
  91. {
  92.    lElement = _root.randRange(0,listBase.length - 1);
  93.    myPerso = listBase[lElement];
  94.    if(myPerso < 10)
  95.    {
  96.       myPerso = "0" + myPerso;
  97.    }
  98.    else
  99.    {
  100.       myPerso = "10";
  101.    }
  102.    _root.gListPerso.push(myPerso);
  103.    listBase.splice(lElement,1);
  104.    i++;
  105. }
  106. gPerso = 1;
  107. gPersoActive = [];
  108. gTimePause = 0;
  109. gJeuEnCours = true;
  110. stop();
  111.