home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Mobiclic 148
/
MOBICLIC148.ISO
/
mac
/
DATA
/
QZZ148
/
QZZ148_00
/
QZZ148_00.swf
/
scripts
/
frame_295
/
DoAction.as
< prev
Wrap
Text File
|
2012-10-16
|
34KB
|
1,048 lines
function clearAllInterval(lFrom)
{
trace("clearAllInterval M3 from : " + lFrom);
clearInterval(IntervalRemplisBarre);
clearInterval(IntervalLanceBruitageChrono);
clearInterval(IntervalVIRTUEL);
clearInterval(IntervalIndice);
}
function testeReponseM3(lClip)
{
trace("testeReponseM3");
trace("lCLip = " + lCLip);
desactiveTOUT();
gRemplisBarreOK = undefined;
clearAllInterval("testeReponseM3");
trace("lClip.texte_REPONSE = " + lClip.texte_REPONSE);
gResult = lClip.texte_REPONSE.text.toLowerCase();
gResult = videEspaces(gResult);
trace("________REPONSE__________________ " + gResult);
gQuestionNum = gQuestionNumLM.split("_")[0];
var _loc2_ = [];
XmlLM = moduleInfo.returnNodeByPath("Module." + gLangue + ".LegendesMedias");
gReponseOK = gereTextes.getTextById(XmlLM,"LM_R" + gimme2digits(gQuestionNum) + "A");
_loc2_.push(videEspaces(gReponseOK.toLowerCase()));
var _loc4_ = gereTextes.getTextById(XmlLM,"LM_E" + gimme2digits(gQuestionNum));
_loc4_ = _loc4_.split(",");
var _loc1_ = 0;
while(_loc1_ < _loc4_.length)
{
var _loc3_ = videEspaces(_loc4_[_loc1_].toLowerCase());
_loc2_.push(_loc3_);
_loc1_ = _loc1_ + 1;
}
var _loc5_ = false;
_loc1_ = 0;
while(_loc1_ < _loc2_.length)
{
if(gResult.indexOf(_loc2_[_loc1_]) !== -1)
{
_loc5_ = true;
break;
}
_loc1_ = _loc1_ + 1;
}
if(getPos(_loc2_,gResult) !== -1 || _loc5_ == true)
{
trace("bonne reponse");
gBonneRep = true;
gListeJoueurMixed[gJoueur - 1].gListeReponseManche.push("A");
}
else
{
trace("mauvaise reponse");
gBonneRep = false;
gListeJoueurMixed[gJoueur - 1].gListeReponseManche.push("B");
}
joueBruitage({nomSon:"B_LETTRE",actionFin:"testeReponseDone"});
}
function initManche()
{
var _loc2_ = 0;
while(_loc2_ < gNbJoueurs_M[gManche - 1])
{
trace("initManche");
trace("i = " + _loc2_);
trace("gListeJoueurMixed[i].Avatar = " + gListeJoueurMixed[_loc2_].Avatar);
this["JOUEUR_" + (_loc2_ + 1)].gotoAndPlay("A" + gListeJoueurMixed[_loc2_].Avatar);
this["BORNE_" + (_loc2_ + 1)].texte_PSEUDO.text = gListeJoueurMixed[_loc2_].Pseudo;
this["BORNE_" + (_loc2_ + 1)].LETTRE.texte_LETTRE.text = "";
this["BORNE_" + (_loc2_ + 1)].SCORE.texte_SCORE.text = String(gListeJoueurMixed[_loc2_].Score);
if(gListeJoueurMixed[_loc2_].Type == "REEL")
{
this["BORNE_" + (_loc2_ + 1)].BARIL.PICTO_ORDI._visible = false;
}
_loc2_ = _loc2_ + 1;
}
gJoueur = 1;
gNoQuestion = 1;
}
function lanceQuestion()
{
gClipReponse = undefined;
gValuePoint = 4;
if(gNoQuestion == 1 && gJoueur == 1)
{
gotoAndPlay("JEU_M" + gManche + "_C" + gTypePartie);
}
if(gNoQuestion == 1 && gListeJoueurMixed[gJoueur - 1].Type == "REEL")
{
gTimerJoueur = getTimer();
}
eteintJoueurs();
allumeJoueur();
var _loc11_ = this["BORNE_" + gJoueur].LETTRE;
_loc11_.gotoAndPlay("E1");
var _loc6_ = this["BORNE_" + gJoueur].LETTRE.texte_LETTRE;
_loc6_.text = "";
if(gListeJoueurMixed[gJoueur - 1].Type == "REEL")
{
coupeBruitPerso();
}
this["JOUEUR_" + gJoueur].AVATAR.gotoAndPlay("E2");
gereTextes.videLM();
var _loc5_ = this["TABLEAU_M" + gManche];
_loc5_._visible = true;
var _loc13_ = _loc5_.ZAP;
if(gListeJoueurMixed[gJoueur - 1].Type == "VIRTUEL")
{
_loc5_.texte_REPONSE.type = "dynamic";
_loc5_.texte_REPONSE.selectable = false;
_loc13_._visible = true;
_loc13_.pIB = "IB_ZAP";
_loc13_.onRollOver = function()
{
gereCursor(2);
this.gotoAndPlay("E2");
gereTextes.afficheIB({codeIB:this.pIB,X:740,Y:300});
};
_loc13_.onRollOut = function()
{
gereCursor(1);
this.gotoAndPlay("E1");
gereTextes.masqueIB();
};
_loc13_.onPress = function()
{
gRemplisBarreOK = undefined;
desactiveTOUT();
clearAllInterval("CLIC ZAP");
gereTextes.masqueIB();
gereCursor(1);
this.gotoAndPlay("E1");
var _loc9_ = gListeReponse.length;
var _loc6_ = gNoQuestion;
var _loc4_ = gNoQuestion;
while(_loc4_ <= gListeNbQ_M[gManche - 1])
{
if(randomValue(0,100) < 95)
{
if(randomValue(0,100) < 90)
{
var _loc3_ = getPos(gListeReponse,"A");
}
else
{
_loc3_ = getPos(gListeReponse,"B");
}
}
else
{
_loc3_ = undefined;
}
trace("gNoQuestion = " + gNoQuestion);
if(_loc3_ !== undefined)
{
trace("________REPONSE__________________ " + gListeReponse[_loc3_]);
trace("_________POS_________________ " + _loc3_);
gListeJoueurMixed[gJoueur - 1].gListeReponseManche.push(gListeReponse[_loc3_]);
gListeJoueurMixed[gJoueur - 1].gListePosReponseManche.push(_loc3_);
}
else
{
gListeJoueurMixed[gJoueur - 1].gListeReponseManche.push(0);
gListeJoueurMixed[gJoueur - 1].gListePosReponseManche.push(-1);
}
if(gListeReponse[_loc3_] == "A")
{
if(_loc4_ == _loc6_)
{
gListeJoueurMixed[gJoueur - 1].Score += gValuePoint;
}
else
{
gListeJoueurMixed[gJoueur - 1].Score += randomValue(1,4);
}
var _loc5_ = _root["BORNE_" + gJoueur].SCORE.texte_SCORE;
_loc5_.text = String(gListeJoueurMixed[gJoueur - 1].Score);
}
gNoQuestion += 1;
gListeReponse = randomiseList(gList_ABC);
gListeJoueurMixed[gJoueur - 1].gListeTirageReponseManche.push(gListeReponse);
trace("gListeReponse = " + gListeReponse);
_loc4_ = _loc4_ + 1;
}
joueBruitage({nomSon:"B_ZAP",actionFin:"suiteReponse"});
};
}
else
{
_loc5_.texte_REPONSE.type = "input";
_loc5_.texte_REPONSE.editable = true;
_loc5_.texte_REPONSE.selectable = true;
_loc13_._visible = false;
}
trace("gListePartieQ[gManche-1] = " + gListePartieQ[gManche - 1]);
trace("gListePartieQ[gManche-1][gJoueur-1] = " + gListePartieQ[gManche - 1][gJoueur - 1]);
trace("gNoQuestion = " + gNoQuestion);
gQuestionNum = gimme2digits(gListePartieQ[gManche - 1][gJoueur - 1][gNoQuestion - 1]);
gQuestionNumLM = gQuestionNum + "_3";
trace("gQuestionNumLM = " + gQuestionNumLM);
gereTextes.afficheLM({mc:_loc5_,codeLM:"LM_Q" + gQuestionNumLM});
var _loc10_ = _loc5_["LM_Q" + gQuestionNumLM];
var _loc12_ = 30;
if(_loc10_.LM.texte._height < _loc12_)
{
_loc10_._y += _loc10_.LM.texte._height / 2;
}
CAPITAINE.gotoAndPlay("E1");
_loc13_ = _loc5_.POINT.texte_POINT;
if(gManche < 3)
{
_loc13_.text = String(gManche);
}
else
{
_loc13_.text = String(gValuePoint);
}
_loc5_.texte_REPONSE.text = "";
_loc5_.texte_REPONSE.textColor = "0x000000";
if(gListeJoueurMixed[gJoueur - 1].Type == "REEL")
{
_loc5_.texte_REPONSE.onChanged = function()
{
joueBruitage({nomSon:"B_TAPE"});
if(this.text !== "")
{
if(gBT_OKactif == undefined)
{
initBT_OK();
}
}
else if(gBT_OKactif == true)
{
desinitBT_OK();
}
};
}
_loc13_ = _loc5_["ROND_" + (gNoQuestion - 1)];
_loc13_.gotoAndPlay("E3");
_loc13_ = _loc5_["ROND_" + gNoQuestion];
_loc13_.gotoAndPlay("E2");
gList_ABC = ["A","B","C"];
var _loc4_ = 1;
while(_loc4_ < 4)
{
var _loc8_ = _loc5_["INDICE_" + gimme2digits(_loc4_)];
_loc6_ = _loc5_["texte_LMI" + gimme2digits(_loc4_)];
_loc8_._visible = false;
_loc6_._visible = false;
_loc4_ = _loc4_ + 1;
}
gIndice = 0;
gDone = 0;
desinitBT_OK();
XmlLM = this.moduleInfo.returnNodeByPath("Module." + gLangue + ".LegendesMedias");
gReponseOK = gereTextes.getTextById(XmlLM,"LM_R" + gimme2digits(Number(gQuestionNumLM.split("_")[0])) + "A");
clearAllInterval("lanceQuestion");
if(gListeJoueurMixed[gJoueur - 1].Type == "VIRTUEL")
{
IntervalVIRTUEL = setInterval(this,"reponseVirtuelle",randomValue(50,gListeTimerM[gManche - 1] * 1000 - 100));
}
gBT_OKactif = undefined;
_loc5_.COMPTEUR_T.masque._y = -132;
gTimer = getTimer();
gRemplisBarreOK = true;
trace("%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% M3 creation Intervals");
IntervalIndice = setInterval(this,"remplisIndice",gListeTimerM[gManche - 1] * 1000 / 4);
IntervalRemplisBarre = setInterval(this,"remplisBarre",100);
IntervalLanceBruitageChrono = setInterval(this,"lanceB_CHRONO",gListeTimerM[gManche - 1] * 1000 - 2191);
}
function lanceB_CHRONO()
{
if(gRemplisBarreOK == true)
{
trace("AV M3 IntervalLanceBruitageChrono = " + IntervalLanceBruitageChrono);
clearInterval(IntervalLanceBruitageChrono);
trace("AP M3 IntervalLanceBruitageChrono = " + IntervalLanceBruitageChrono);
joueBruitage({nomSon:"B_CHRONO"});
}
}
function remplisBarre()
{
if(gRemplisBarreOK == true)
{
gTemps = getTimer() - gTimer;
var _loc6_ = gTemps * 100 / (gListeTimerM[gManche - 1] * 1000);
var _loc4_ = this["TABLEAU_M" + gManche];
var _loc5_ = _loc4_.COMPTEUR_T.masque;
_loc5_._y = -132 + 69 * _loc6_ / 100;
if(_loc5_._y >= -63)
{
desactiveTOUT();
var _loc2_ = 0;
while(_loc2_ < gListeReponse.length)
{
var _loc3_ = _loc4_["REPONSE_" + gList_ABC[_loc2_]];
_loc3_.gotoAndPlay("E1");
_loc2_ = _loc2_ + 1;
}
trace("fin descente ");
trace("combien = " + (getTimer() - gTimer));
_loc5_._y = -63;
clearAllInterval("fin remplisBarre");
gListeJoueurMixed[gJoueur - 1].gListeReponseManche.push(0);
testeReponseDone();
}
}
else
{
trace("M3 BUG DEJOUE remplisBarre !!!!!!!!");
clearAllInterval("BUG DEJOUE remplisBarre");
}
}
function reponseVirtuelle()
{
if(gRemplisBarreOK == true)
{
if(gListeJoueurMixed[gJoueur - 1].Type == "VIRTUEL")
{
var _loc3_ = this["TABLEAU_M" + gManche];
trace("reponseVirtuelle");
trace("myClip0 = " + _loc3_);
trace("AV M3 IntervalVIRTUEL = " + IntervalVIRTUEL);
clearInterval(IntervalVIRTUEL);
trace("AP M3 IntervalVIRTUEL = " + IntervalVIRTUEL);
gBonneRep = false;
if(randomValue(0,100) < 95)
{
gRemplisBarreOK = undefined;
desactiveTOUT();
clearAllInterval("reponseVirtuelle");
if(randomValue(0,100) < 90)
{
var _loc4_ = gReponseOK.length;
gListeJoueurMixed[gJoueur - 1].gListeReponseManche.push("A");
gBonneRep = true;
trace("reponseVirtuelle : bonne réponse");
}
else
{
_loc4_ = randomValue(4,8);
gListeJoueurMixed[gJoueur - 1].gListeReponseManche.push("B");
trace("reponseVirtuelle : mauvaise réponse");
}
var _loc2_ = 1;
while(_loc2_ <= _loc4_)
{
_loc3_.texte_REPONSE.text += "*";
_loc2_ = _loc2_ + 1;
}
clearInterval(IntervalApresReponseVirtuelle);
gClicVirtuelOK = true;
trace("%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% M3 creation Interval clicOkVirtuel");
IntervalApresReponseVirtuelle = setInterval(this,"clicOkVirtuel",1000);
}
else
{
trace("reponseVirtuelle : ne repondra pas");
}
}
else
{
trace("M3 REPONSEVIRTUELLE DETECTEE ALORS QUE JOUEUR REEL !!!!!!!!");
trace("AV M3 IntervalVIRTUEL = " + IntervalVIRTUEL);
clearInterval(IntervalVIRTUEL);
trace("AP M3 IntervalVIRTUEL = " + IntervalVIRTUEL);
}
}
else
{
trace("M3 BUG DEJOUE reponseVirtuelle !!!!!!!!");
clearAllInterval("reponseVirtuelle");
}
}
function clicOkVirtuel()
{
if(gClicVirtuelOK == true)
{
gClicVirtuelOK = undefined;
trace("clicOkVirtuel M3");
trace("AV M3 IntervalApresReponseVirtuelle = " + IntervalApresReponseVirtuelle);
clearInterval(IntervalApresReponseVirtuelle);
trace("AP M3 IntervalApresReponseVirtuelle = " + IntervalApresReponseVirtuelle);
var _loc2_ = this["TABLEAU_M" + gManche];
var _loc4_ = _loc2_.BT_OK;
_loc4_.gotoAndPlay("E2");
joueBruitage({nomSon:"B_ROLL_OK"});
var _loc3_ = _loc2_.ZAP;
_loc3_.gotoAndPlay("E1");
gereTextes.masqueIB();
joueBruitage({nomSon:"B_LETTRE",actionFin:"testeReponseDone"});
}
else
{
trace("M3 BUG DEJOUE clicOkVirtuel !!!!!!!!");
clearInterval(IntervalApresReponseVirtuelle);
}
}
function initBT_OK()
{
gKeyDown = undefined;
Key.addListener(KeyListener);
gBT_OKactif = true;
var myClip0 = this["TABLEAU_M" + gManche];
var _loc2_ = myClip0.BT_OK;
_loc2_._alpha = 100;
trace("myClip = " + _loc2_);
_loc2_.mc = myClip0;
_loc2_.onRollOver = function()
{
if(gDone == 0)
{
gereCursor(2);
this.gotoAndPlay("E2");
joueBruitage({nomSon:"B_ROLL_OK"});
}
};
_loc2_.onRollOut = function()
{
if(gDone == 0)
{
gereCursor(1);
this.gotoAndPlay("E1");
stopBruitage({nomSon:"B_ROLL_OK"});
}
};
_loc2_.onPress = function()
{
if(gDone == 0)
{
trace("REPONSE CLIC");
this.gotoAndPlay("E1");
trace("myClip0 = " + myClip0);
this.mc.texte_REPONSE.type = "dynamic";
this.mc.texte_REPONSE.editable = false;
gRemplisBarreOK = undefined;
clearAllInterval("CLIC BT_OK");
gereCursor(1);
stopBruitage({nomSon:"B_ROLL_OK"});
gDone = 1;
testeReponseM3(this.mc);
}
};
}
function testeReponseDone()
{
var _loc2_ = this["TABLEAU_M" + gManche];
_loc2_.texte_REPONSE.text = gReponseOK;
if(gListeJoueurMixed[gJoueur - 1].Type == "REEL")
{
gListeJoueurMixed[gJoueur - 1].TempsReponse = getTimer() - gTimerJoueur;
}
var _loc4_ = this["JOUEUR_" + gJoueur].AVATAR;
var _loc3_ = this["BORNE_" + gJoueur].LETTRE;
var _loc6_ = this["BORNE_" + gJoueur].SCORE.texte_SCORE;
var _loc7_ = gListeJoueurMixed[gJoueur - 1].gListeReponseManche[gNoQuestion - 1];
trace("myClip0.texte_REPONSE.textColor = " + _loc2_.texte_REPONSE.textColor);
switch(_loc7_)
{
case 0:
_loc3_.gotoAndPlay("E2");
_loc4_.gotoAndPlay("E4");
joueBruitage({nomSon:"B_REPONSE_E",actionFin:"suiteReponse"});
break;
case "A":
_loc2_.texte_REPONSE.textColor = "0x0000FF";
gListeJoueurMixed[gJoueur - 1].Score += gValuePoint;
_loc6_.text = String(gListeJoueurMixed[gJoueur - 1].Score);
_loc3_.gotoAndPlay("E3");
var _loc5_ = this["BORNE_" + gJoueur].LETTRE.texte_LETTRE;
_loc5_.text = "";
_loc4_.gotoAndPlay("E3");
joueBruitage({nomSon:"B_REPONSE_S",actionFin:"suiteReponse"});
break;
default:
_loc2_.texte_REPONSE.textColor = "0xFF0000";
_loc3_.gotoAndPlay("E4");
_loc5_ = this["BORNE_" + gJoueur].LETTRE.texte_LETTRE;
_loc5_.text = "";
_loc4_.gotoAndPlay("E4");
joueBruitage({nomSon:"B_REPONSE_E",actionFin:"suiteReponse"});
}
}
function suiteReponse()
{
var _loc4_ = this["TABLEAU_M" + gManche];
gRemplisBarreOK = undefined;
clearAllInterval("suiteReponse");
if(gNoQuestion < gListeNbQ_M[gManche - 1])
{
gNoQuestion += 1;
CAPITAINE.gotoAndPlay("E2");
joueSon({nomSon:"M" + gManche + "_Q" + gNoQuestion,actionFin:"lanceQuestion"});
}
else
{
trace("gJoueur = " + gJoueur);
trace("gListeJoueurMixed[gJoueur-1].gListeReponseManche = " + gListeJoueurMixed[gJoueur - 1].gListeReponseManche);
var _loc6_ = this["BORNE_" + gJoueur].BARIL;
_loc6_.gotoAndPlay("E1");
if(gListeJoueurMixed[gJoueur - 1].Type == "REEL")
{
this["BORNE_" + gJoueur].BARIL.PICTO_ORDI._visible = false;
}
_loc4_._visible = false;
var _loc3_ = this["BORNE_" + gJoueur].LETTRE;
_loc3_.gotoAndPlay("E1");
var _loc2_ = this["BORNE_" + gJoueur].LETTRE.texte_LETTRE;
trace("myClip2 = " + _loc2_);
_loc2_.text = "";
if(gJoueur < gNbJoueurs_M[gManche - 1])
{
gJoueur += 1;
eteintJoueurs();
allumeJoueur();
_loc6_ = this["BORNE_" + gJoueur].BARIL;
_loc6_.gotoAndPlay("E2");
if(gListeJoueurMixed[gJoueur - 1].Type == "REEL")
{
this["BORNE_" + gJoueur].BARIL.PICTO_ORDI._visible = false;
}
_loc3_ = this["BORNE_" + gJoueur].LETTRE;
_loc3_.gotoAndPlay("E1");
_loc2_ = this["BORNE_" + gJoueur].LETTRE.texte_LETTRE;
_loc2_.text = "";
gNoQuestion = 1;
CAPITAINE.gotoAndPlay("E2");
if(gListeJoueurMixed[gJoueur - 1].Type == "REEL")
{
var _loc5_ = "M" + gManche + "_01";
}
else
{
_loc5_ = "M" + gManche + "_01" + "_V";
}
joueSon({nomSon:_loc5_,actionFin:"initLanceManche"});
}
else
{
trace("fin manche");
_loc3_ = this["BORNE_" + gJoueur].LETTRE;
_loc3_.gotoAndPlay("E1");
_loc2_ = this["BORNE_" + gJoueur].LETTRE.texte_LETTRE;
_loc2_.text = "";
classeJoueurs();
}
}
}
function classeJoueurs()
{
var _loc27_ = undefined;
var _loc7_ = [];
var _loc16_ = 50;
var _loc6_ = [];
var _loc2_ = [];
var _loc17_ = 0;
var _loc24_ = [];
var _loc23_ = [];
var _loc11_ = 0;
while(_loc11_ < gNbJoueurs_M[gManche - 1])
{
if(gListeJoueurMixed[_loc11_].Score < _loc16_)
{
_loc7_ = [];
_loc7_.push(_loc11_);
_loc16_ = gListeJoueurMixed[_loc11_].Score;
}
else if(gListeJoueurMixed[_loc11_].Score == _loc16_)
{
_loc7_.push(_loc11_);
}
if(gListeJoueurMixed[_loc11_].Score > _loc17_)
{
_loc6_ = [];
_loc6_.push(_loc11_);
_loc17_ = gListeJoueurMixed[_loc11_].Score;
}
else if(gListeJoueurMixed[_loc11_].Score == _loc17_)
{
_loc6_.push(_loc11_);
}
trace("gListeJoueurMixed Joueur " + _loc11_ + " Score = " + gListeJoueurMixed[_loc11_].Score);
if(gListeJoueurMixed[_loc11_].Type == "REEL")
{
_loc24_.push(_loc11_);
}
else
{
_loc23_.push(_loc11_);
}
trace("gListeJoueurMixed Joueur " + _loc11_ + " Type = " + gListeJoueurMixed[_loc11_].Type);
_loc11_ = _loc11_ + 1;
}
trace("pScoreMin = " + _loc16_);
trace("pListePosMin = " + _loc7_);
trace("pListePosMax = " + _loc6_);
trace("pListeREEL = " + _loc24_);
trace("pListeVIRTUEL = " + _loc23_);
var _loc4_ = [];
var _loc15_ = [];
if(_loc6_.length > 1)
{
_loc11_ = 0;
while(_loc11_ < _loc6_.length)
{
if(gListeJoueurMixed[_loc6_[_loc11_]].Type == "REEL")
{
_loc4_.push(_loc6_[_loc11_]);
}
else
{
_loc15_.push(_loc6_[_loc11_]);
}
trace("gListeJoueurMixed MAX joueur " + [_loc6_[_loc11_]] + " Type = " + gListeJoueurMixed[_loc6_[_loc11_]].Type);
_loc11_ = _loc11_ + 1;
}
trace("pListePosMax _______________________ ");
trace("pListeREEL_MAX = " + _loc4_);
trace("pListeVIRTUEL_MAX = " + _loc15_);
if(_loc4_.length == 1)
{
gFirst = _loc4_[0];
_loc2_.push(_loc4_[0]);
trace("--- pListeOrdre MAX 1 = " + _loc2_);
var _loc12_ = _loc15_.length;
if(_loc12_ > 0)
{
var _loc9_ = 0;
while(_loc9_ < _loc12_)
{
_loc2_.push(_loc15_[_loc9_]);
trace("--- pListeOrdre MAX AJOUT VIRTUEL(S) 1 = " + _loc2_);
_loc9_ = _loc9_ + 1;
}
}
}
else
{
trace("test chrono");
var _loc21_ = 0;
var _loc22_ = 0;
_loc11_ = 0;
while(_loc11_ < _loc4_.length)
{
trace("pListeREEL[i] = " + _loc4_[_loc11_]);
trace("gListeJoueurMixed[pListeREEL_MAX[i]].TempsReponse = " + gListeJoueurMixed[_loc4_[_loc11_]].TempsReponse);
if(_loc21_ == 0)
{
_loc22_ = gListeJoueurMixed[_loc4_[_loc11_]].TempsReponse;
gFirst = _loc4_[_loc11_];
_loc2_.push(_loc4_[_loc11_]);
trace("--- pListeOrdre MAX 2= " + _loc2_);
_loc21_ = 1;
}
else if(gListeJoueurMixed[_loc4_[_loc11_]].TempsReponse < _loc22_)
{
gFirst = _loc4_[_loc11_];
_loc2_.splice(0,0,_loc4_[_loc11_]);
trace("--- pListeOrdre MAX 3 = " + _loc2_);
}
else
{
trace("getPos(pListeOrdre,gFirst)+1 = " + (getPos(_loc2_,gFirst) + 1));
_loc2_.push(_loc4_[_loc11_]);
trace("___ pListeOrdre MAX 5 = " + _loc2_);
}
_loc11_ = _loc11_ + 1;
}
_loc12_ = _loc15_.length;
if(_loc12_ > 0)
{
_loc9_ = 0;
while(_loc9_ < _loc12_)
{
_loc2_.push(_loc15_[_loc9_]);
trace("--- pListeOrdre MAX AJOUT VIRTUEL(S) 2 = " + _loc2_);
_loc9_ = _loc9_ + 1;
}
}
}
}
else
{
gFirst = _loc6_[0];
_loc2_.push(_loc6_[0]);
trace("--- pListeOrdre MAX 4 = " + _loc2_);
}
if(_loc2_.length < gNbJoueurs_M[gManche - 1])
{
var _loc5_ = [];
var _loc8_ = [];
if(_loc7_.length > 1)
{
_loc11_ = 0;
while(_loc11_ < _loc7_.length)
{
if(gListeJoueurMixed[_loc7_[_loc11_]].Type == "REEL")
{
_loc5_.push(_loc7_[_loc11_]);
}
else
{
_loc8_.push(_loc7_[_loc11_]);
}
trace("gListeJoueurMixed MIN joueur " + [_loc7_[_loc11_]] + " Type = " + gListeJoueurMixed[_loc7_[_loc11_]].Type);
_loc11_ = _loc11_ + 1;
}
trace("pListeREEL_MIN = " + _loc5_);
trace("pListeVIRTUEL_MIN = " + _loc8_);
if(_loc5_.length > 0)
{
trace("test chrono");
_loc21_ = 0;
_loc22_ = 0;
_loc11_ = 0;
while(_loc11_ < _loc5_.length)
{
trace("pListeREEL_MIN[i] = " + _loc5_[_loc11_]);
trace("gListeJoueurMixed[pListeREEL_MIN[i]].TempsReponse = " + gListeJoueurMixed[_loc5_[_loc11_]].TempsReponse);
if(_loc21_ == 0)
{
_loc22_ = gListeJoueurMixed[_loc5_[_loc11_]].TempsReponse;
gDer = _loc5_[_loc11_];
_loc2_.push(_loc5_[_loc11_]);
trace("___ pListeOrdre MIN 2 = " + _loc2_);
_loc21_ = 1;
}
else if(gListeJoueurMixed[_loc5_[_loc11_]].TempsReponse > _loc22_)
{
_loc2_.push(_loc5_[_loc11_]);
trace("___ pListeOrdre MIN 3 = " + _loc2_);
gDer = _loc5_[_loc11_];
}
else
{
_loc2_.splice(getPos(_loc2_,gDer),0,_loc5_[_loc11_]);
trace("___ pListeOrdre MIN 5 = " + _loc2_);
}
_loc11_ = _loc11_ + 1;
}
_loc27_ = true;
_loc12_ = _loc8_.length;
if(_loc12_ > 0)
{
_loc9_ = 0;
while(_loc9_ < _loc12_)
{
_loc2_.push(_loc8_[_loc9_]);
gDer = _loc8_[_loc9_];
trace("--- pListeOrdre MIN AJOUT VIRTUEL(S) 2 = " + _loc2_);
_loc9_ = _loc9_ + 1;
}
}
}
else if(_loc8_.length > 0)
{
var _loc10_ = 0;
while(_loc10_ < _loc8_.length)
{
gDer = _loc8_[_loc10_];
_loc2_.push(_loc8_[_loc10_]);
trace("___ pListeOrdre MIN 1 = " + _loc2_);
_loc10_ = _loc10_ + 1;
}
}
}
else
{
gDer = _loc7_[0];
_loc2_.push(_loc7_[0]);
trace("___ pListeOrdre MIN 4 = " + _loc2_);
}
}
else
{
gDer = _loc2_[_loc2_.length - 1];
_loc27_ = true;
}
trace("gDer = " + gDer);
trace("gListeJoueurMixed[gDer].Score = " + gListeJoueurMixed[gDer].Score);
trace("AJOUT ");
_loc11_ = 0;
while(_loc11_ < gNbJoueurs_M[gManche - 1])
{
var _loc13_ = getPos(_loc2_,_loc11_);
trace("pListeOrdre = " + _loc2_);
trace("i = " + _loc11_);
trace("pPos = " + _loc13_);
if(_loc13_ == -1)
{
_loc12_ = _loc2_.length;
trace("pLength = " + _loc12_);
var _loc3_ = 0;
while(_loc3_ < _loc12_)
{
trace("gListeJoueurMixed[i].Score = " + gListeJoueurMixed[_loc11_].Score);
trace("j = " + _loc3_);
trace("pListeOrdre[j] = " + _loc2_[_loc3_]);
trace("gListeJoueurMixed[pListeOrdre[j]].Score = " + gListeJoueurMixed[_loc2_[_loc3_]].Score);
if(gListeJoueurMixed[_loc11_].Score >= gListeJoueurMixed[_loc2_[_loc3_]].Score)
{
_loc2_.splice(_loc3_,0,_loc11_);
trace("___ pListeOrdre AJOUT = " + _loc2_);
break;
}
_loc3_ = _loc3_ + 1;
}
}
_loc11_ = _loc11_ + 1;
}
trace("pListePosMin = " + _loc7_);
trace("pListePosMax = " + _loc6_);
trace("+++ pListeOrdre = " + _loc2_);
trace("gDer = " + gDer);
trace("gFirst = " + gFirst);
_loc11_ = 0;
while(_loc11_ < gNbJoueurs_M[gManche - 1])
{
var _loc14_ = this["JOUEUR_" + (_loc11_ + 1)].AVATAR;
var _loc19_ = this["BORNE_" + (_loc11_ + 1)].LETTRE;
_loc19_.gotoAndPlay("E1");
var _loc18_ = this["BORNE_" + (_loc11_ + 1)].LETTRE.texte_LETTRE;
var _loc20_ = this["BORNE_" + (_loc11_ + 1)].BARIL;
_loc18_.text = "";
if(_loc11_ !== gDer)
{
_loc14_.gotoAndPlay("E5");
_loc20_.gotoAndPlay("E3");
}
else
{
_loc14_.gotoAndPlay("E6");
}
if(gListeJoueurMixed[_loc11_].Type == "REEL")
{
this["BORNE_" + (_loc11_ + 1)].BARIL.PICTO_ORDI._visible = false;
}
_loc11_ = _loc11_ + 1;
}
eteintJoueurs();
var _loc26_ = 0;
var _loc25_ = 0;
_loc11_ = 0;
while(_loc11_ < gNbJoueurs_M[gManche - 1])
{
trace("gListeJoueurMixed[i].Type = " + gListeJoueurMixed[_loc11_].Type);
if(gListeJoueurMixed[_loc11_].Type == "VIRTUEL")
{
_loc26_ += 1;
}
else
{
_loc25_ += 1;
}
_loc11_ = _loc11_ + 1;
}
if(_loc25_ == 2)
{
if(_loc27_ == true)
{
var _loc28_ = "M" + gManche + "_C2_S3";
}
else
{
_loc28_ = "M" + gManche + "_C2_S2";
}
CAPITAINE.gotoAndPlay("E3");
joueSon({nomSon:_loc28_,actionFin:"finManche"});
}
else
{
if(gListeJoueurMixed[gFirst].Type == "VIRTUEL")
{
_loc28_ = "M" + gManche + "_C1_E";
CAPITAINE.gotoAndPlay("E4");
}
else
{
_loc28_ = "M" + gManche + "_C1_S1";
CAPITAINE.gotoAndPlay("E3");
}
joueSon({nomSon:_loc28_,actionFin:"finManche"});
}
}
function finManche()
{
if(gTypePartie == 1)
{
var _loc2_ = 0;
while(_loc2_ < gNbJoueurs_M[gManche - 1])
{
if(gListeJoueurMixed[_loc2_].Type == "REEL")
{
coupeBruitPerso(_loc2_);
}
_loc2_ = _loc2_ + 1;
}
}
this["JOUEUR_" + gJoueur].AVATAR.gotoAndPlay("E1");
CAPITAINE.gotoAndPlay("E1");
gManche += 1;
gotoAndPlay("TRANSIT_0" + gManche);
var _loc6_ = MC_SUCCES;
var _loc3_ = gListeJoueurMixed[gFirst];
MC_SUCCES.AVATAR.gotoAndPlay("A" + _loc3_.Avatar);
gTypepartie = 1;
gFin = 1;
MC_SUCCES.pseudo.text = _loc3_.Pseudo;
joueBruitage({nomSon:"B_JINGLE_04",actionFin:"finPartie"});
}
function desinitBT_OK()
{
Key.removeListener(KeyListener);
gBT_OKactif = undefined;
var _loc3_ = this["TABLEAU_M" + gManche];
var _loc2_ = _loc3_.BT_OK;
_loc2_.gotoAndPlay("E1");
_loc2_._alpha = 50;
desactiveClip(_loc2_);
}
function remplisIndice()
{
if(gRemplisBarreOK == true)
{
var _loc2_ = this["TABLEAU_M" + gManche];
gIndice += 1;
gValuePoint = 4 - gIndice;
var _loc6_ = _loc2_["INDICE_" + gimme2digits(gIndice)];
var _loc7_ = _loc2_["texte_LMI" + gimme2digits(gIndice)];
_loc6_._visible = true;
gereTextes.afficheLM({mc:_loc2_,codeLM:"LM_I" + gimme2digits(gQuestionNum) + gList_ABC[gIndice - 1],numR:gimme2digits(gIndice)});
var _loc3_ = _loc2_["LM_I" + gimme2digits(gQuestionNum) + gList_ABC[gIndice - 1]];
var _loc5_ = 30;
if(_loc3_.LM.texte._height < _loc5_)
{
_loc3_._y += _loc3_.LM.texte._height / 2 - 5;
}
var _loc4_ = _loc2_.POINT.texte_POINT;
_loc4_.text = String(Number(_loc4_.text) - 1);
CAPITAINE.gotoAndPlay("E2");
joueSon({nomSon:"M3_INDICE_" + gimme2digits(gIndice),zapBlock:"NOZAP_NOBLOCK",actionFin:"finSonDEB"});
if(gIndice == 3)
{
trace("3eme indice done");
trace("AV M3 IntervalIndice = " + IntervalIndice);
clearInterval(IntervalIndice);
trace("AP M3 IntervalIndice = " + IntervalIndice);
}
}
else
{
trace("M3 BUG DEJOUE remplisIndice !!!!!!!!");
clearAllInterval("remplisIndice");
}
}
function desactiveTOUT()
{
desinitBT_OK();
Key.removeListener(KeyListener);
var _loc4_ = this["TABLEAU_M" + gManche];
_loc4_.texte_REPONSE.selectable = false;
_loc4_.texte_REPONSE.type = "dynamic";
_loc4_.texte_REPONSE.editable = false;
var _loc5_ = _loc4_.ZAP;
desactiveClip(_loc5_);
var _loc2_ = 0;
while(_loc2_ < gListeReponse.length)
{
var _loc3_ = _loc4_["REPONSE_" + gimme2digits(_loc2_ + 1)];
desactiveClip(_loc3_);
_loc2_ = _loc2_ + 1;
}
_loc5_ = _loc4_.ZAP;
desactiveClip(_loc3_);
}
function initAfficheManche()
{
this["BORNE_" + gJoueur].BARIL.gotoAndPlay("E2");
if(gListeJoueurMixed[gJoueur - 1].Type == "REEL")
{
this["BORNE_" + gJoueur].BARIL.PICTO_ORDI._visible = false;
}
lanceQuestion();
}
function initLanceManche()
{
coupeBruitPerso();
this["JOUEUR_" + gJoueur].AVATAR.gotoAndPlay("E2");
if(gJoueur > 1)
{
if(gListeJoueurMixed[gJoueur - 2].Type == "REEL")
{
coupeBruitPerso(gJoueur - 2);
}
this["JOUEUR_" + (gJoueur - 1)].AVATAR.gotoAndPlay("E1");
}
CAPITAINE.gotoAndPlay("E1");
var _loc4_ = this["TABLEAU_M" + gManche];
gWidthTexteReponse = _loc4_.texte_REPONSE._width;
trace("gWidthTexteReponse = " + gWidthTexteReponse);
var _loc2_ = 1;
while(_loc2_ <= 5)
{
var _loc3_ = _loc4_["ROND_" + _loc2_];
if(_loc2_ <= gListeNbQ_M[gManche - 1])
{
_loc3_.gotoAndPlay("E1");
}
else
{
_loc3_._visible = false;
}
_loc2_ = _loc2_ + 1;
}
gListeJoueurMixed[gJoueur - 1].gListeReponseManche = [];
gListeJoueurMixed[gJoueur - 1].gListePosReponseManche = [];
gListeJoueurMixed[gJoueur - 1].gListeTirageReponseManche = [];
initAfficheManche();
}
KeyListener = new Object();
KeyListener.onKeyDown = function()
{
if(gKeyDown == undefined)
{
var _loc0_ = null;
if((_loc0_ = Key.getCode()) === 13)
{
if(gDone == 0)
{
gDone = 1;
trace("REPONSE ENTER");
gRemplisBarreOK = undefined;
clearAllInterval("keyDown");
gereCursor(1);
var _loc2_ = _root["TABLEAU_M" + gManche];
_loc2_.texte_REPONSE.selectable = false;
_loc2_.texte_REPONSE.type = "dynamic";
_loc2_.texte_REPONSE.editable = false;
testeReponseM3(_loc2_);
}
}
}
};
KeyListener.onKeyUp = function()
{
gKeyDown = undefined;
};