home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Mobiclic 168
/
MOBICLIC168.ISO
/
mac
/
DATA
/
GAM168
/
GAM168_00
/
GAM168_00.swf
/
scripts
/
frame_59
/
DoAction.as
Wrap
Text File
|
2014-10-17
|
3KB
|
111 lines
function allumePerso()
{
if(_root.gCountPerso < 2)
{
lVilGen = _root.randRange(0,1);
switch(lVilGen)
{
case 0:
_root["VILAIN_" + gListPerso[gPerso - 1]]._visible = 1;
_root["lifetimeStartV" + gListPerso[gPerso - 1]] = getTimer();
_root["lifetimeV" + gListPerso[gPerso - 1]] = 3000;
gPersoActive.push("VILAIN_" + gListPerso[gPerso - 1]);
break;
case 1:
_root["GENTIL_" + gListPerso[gPerso - 1]]._visible = 1;
_root["lifetimeStartG" + gListPerso[gPerso - 1]] = getTimer();
_root["lifetimeG" + gListPerso[gPerso - 1]] = 3000;
gPersoActive.push("GENTIL_" + gListPerso[gPerso - 1]);
}
_root[gPersoActive[gPersoActive.length - 1]].gTimePause = 0;
_root.gCountPerso += 1;
_root.gPerso += 1;
if(gPerso === 11)
{
listBase = [1,2,3,4,5,6,7,8,9,10];
gPerso = 1;
gListPerso = [];
i = 0;
while(i <= 9)
{
lElement = _root.randRange(0,listBase.length - 1);
myPerso = listBase[lElement];
if(myPerso < 10)
{
myPerso = "0" + myPerso;
}
else
{
myPerso = "10";
}
_root.gListPerso.push(myPerso);
listBase.splice(lElement,1);
i++;
}
}
}
}
function eteindrePerso(type, num, freezeScore)
{
if(freezeScore !== 1)
{
_root.gScore -= 1;
_root.joueBruitage({nomSon:"B_ECHEC"});
}
switch(type)
{
case "V":
_root["VILAIN_" + num]._visible = 0;
_root.gCountPerso -= 1;
lPos = _root.getPos(gPersoActive,"VILAIN_" + num);
gPersoActive = gPersoActive.splice(lPos + 1);
break;
case "G":
_root["GENTIL_" + num]._visible = 0;
_root.gCountPerso -= 1;
lPos = _root.getPos(gPersoActive,"GENTIL_" + num);
gPersoActive = gPersoActive.splice(lPos + 1);
}
_root[gPersoActive[lPos]].gTimePause = 0;
}
gScore = 0;
i = 1;
while(i < 11)
{
if(i < 10)
{
perso = "0" + String(i);
}
else
{
perso = "10";
}
_root["VILAIN_" + perso]._visible = 0;
_root["GENTIL_" + perso]._visible = 0;
i++;
}
listBase = [1,2,3,4,5,6,7,8,9,10];
gListPerso = [];
i = 0;
while(i <= 9)
{
lElement = _root.randRange(0,listBase.length - 1);
myPerso = listBase[lElement];
if(myPerso < 10)
{
myPerso = "0" + myPerso;
}
else
{
myPerso = "10";
}
_root.gListPerso.push(myPerso);
listBase.splice(lElement,1);
i++;
}
gPerso = 1;
gPersoActive = [];
gTimePause = 0;
gJeuEnCours = true;
stop();