home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
404 Jogos
/
CLJG.iso
/
Aventura
/
Kung_Fu.swf
/
scripts
/
DefineSprite_1594
/
frame_1
/
DoAction.as
Wrap
Text File
|
2007-09-26
|
1KB
|
55 lines
function parseCheat(k)
{
var c = 0;
while(c < cheatCodes.length)
{
if(String.fromCharCode(k).toLowerCase() != cheatCodes[c][0].toLowerCase().charAt(cheatCount[c]++))
{
cheatCount[c] = k != cheatCodes[c][0].charCodeAt(0) ? 0 : 1;
}
if(cheatCount[c] == cheatCodes[c][0].length)
{
cheatCodes[c][1].apply(null,[]);
cheatCount[c] = 0;
}
c++;
}
}
function func1()
{
_root.specialone = "on";
_root.specialtwo = "on";
_root.specialthree = "on";
}
function func2()
{
if(_root.jukebox == "on")
{
_root.Main.Menu.s.stop();
_root.Main.Menu.ss.stop();
_root.Main.gotoAndStop("jukebox");
trace("jukebox cheatmode activated");
}
}
function func3()
{
if(_root.stamina == "on")
{
_root.fatigue = 100;
trace("full stamina");
}
}
function func4()
{
trace("cheat four");
_root.powerbarthingy.gotoAndPlay(2);
}
cheatCodes = [["big guns",func1],["jukebox",func2],["I am poofed",func3],["full power",func4]];
cheatCount = [];
cheatListener = {};
cheatListener.onKeyDown = function()
{
parseCheat(Key.getAscii());
};
Key.addListener(cheatListener);