Frame 1
stop();
this.onEnterFrame = function () {
if (this._framesLoaded == this._totalFrames) {
gotoAndStop ("Title");
delete this.onEnterFrame;
}
};
Frame 20
new Main(this);
Symbol 428 MovieClip [__Packages.library.State] Frame 0
class library.State
{
var mcRef, sState;
function State (_mcRef) {
mcRef = _mcRef;
}
function setState(_sState) {
sState = _sState;
mcRef.gotoAndStop(sState);
loadState(sState);
}
function setMc(_mcRef) {
mcRef = _mcRef;
setState(sState);
}
function pause() {
mcRef.mcState.stop();
}
function resume() {
mcRef.mcState.play();
}
function enterFrame() {
this["do" + sState]();
}
function loadState(_sState) {
this["start" + sState]();
}
function isStateComplete() {
if (mcRef.mcState._currentframe == mcRef.mcState._totalframes) {
this["end" + sState]();
}
return(mcRef.mcState._currentframe == mcRef.mcState._totalframes);
}
function get Mc() {
return(mcRef);
}
function get getState() {
return(sState);
}
}
Symbol 429 MovieClip [__Packages.Main] Frame 0
class Main extends library.State
{
static var Instance;
var mcRef, enterFrame, setState, btnStart, btnContinue, oCharSelect, oGame;
function Main (_mcRef) {
super();
mcRef = _mcRef;
mcRef.onEnterFrame = library.Delegate.create(this, enterFrame);
Instance = this;
setState(sSTATE_TITLE);
}
function startTitle() {
btnStart = new ContinueButton(mcRef.btnStart, library.Delegate.create(this, setState, sSTATE_CHARSELECT), "");
mcRef.btnContinue._visible = false;
btnContinue = new ContinueButton(mcRef.btnContinue, library.Delegate.create(this, loadGame), "Continue game");
}
function doTitle() {
btnStart.enterFrame();
btnContinue.enterFrame();
}
function startCharSelect() {
btnStart = new ContinueButton(mcRef.btnStart, library.Delegate.create(this, setState, sSTATE_GAME), "");
oCharSelect = new CharSelect(mcRef);
}
function startGame() {
var _local2 = oCharSelect.__get__name();
oGame = new Game(mcRef);
oGame.setCharacter(oCharSelect.__get__Color(), _local2);
}
function doGame() {
oGame.enterFrame();
}
function loadGame() {
}
static var sSTATE_TITLE = "Title";
static var sSTATE_CHARSELECT = "CharSelect";
static var sSTATE_GAME = "Game";
}
Symbol 430 MovieClip [__Packages.Game] Frame 0
class Game extends library.State
{
var oLevel, oBattle, oPlayer, oDialogBox, oShop, setState, bKeyLeftDown, bKeyRightDown, bKeyUpDown, bKeyDownDown, nTimer;
function Game (_mcRef) {
super(_mcRef);
oLevel = new Level(_mcRef.mcLevel);
oBattle = new Battle(_mcRef.mcBattle, library.Delegate.create(this, endBattleGood), library.Delegate.create(this, endBattleBad));
oPlayer = new Player();
oDialogBox = new DialogBox(_mcRef.mcDialogBox);
oShop = new Shop(_mcRef.mcShop);
setState(sSTATE_SHOP);
}
function startInit() {
bKeyLeftDown = false;
bKeyRightDown = false;
bKeyUpDown = false;
bKeyDownDown = false;
oPlayer.setPlayerData(oShop.playerData());
oLevel.load(oShop.__get__level(), oPlayer.__get__light());
}
function doInit() {
oShop.enterFrame();
if (oShop.__get__getState() == library.Popup.sSTATE_HIDDEN) {
setState(sSTATE_LEVEL);
}
}
function startShop() {
oShop.setShop(oPlayer.getPlayerData());
}
function doShop() {
oShop.enterFrame();
oBattle.enterFrame();
if (oShop.__get__getState() == library.Popup.sSTATE_OUT) {
setState(sSTATE_INIT);
}
}
function doLevel() {
var _local3 = "";
var _local2 = false;
if (Key.isDown(37) && (!bKeyLeftDown)) {
_local3 = oLevel.movement(Level.sLEFT);
bKeyLeftDown = true;
_local2 = true;
} else {
bKeyLeftDown = Key.isDown(37);
}
if (!_local2) {
if (Key.isDown(39) && (!bKeyRightDown)) {
_local3 = oLevel.movement(Level.sRIGHT);
bKeyRightDown = true;
_local2 = true;
} else {
bKeyRightDown = Key.isDown(39);
}
}
if (!_local2) {
if (Key.isDown(38) && (!bKeyUpDown)) {
_local3 = oLevel.movement(Level.sUP);
bKeyUpDown = true;
_local2 = true;
} else {
bKeyUpDown = Key.isDown(38);
}
}
if (!_local2) {
if (Key.isDown(40) && (!bKeyDownDown)) {
_local3 = oLevel.movement(Level.sDOWN);
bKeyDownDown = true;
_local2 = true;
} else {
bKeyDownDown = Key.isDown(40);
}
}
switch (_local3) {
case "Chest" :
var _local4 = DataItems.getItem(oLevel.__get__currentLevel());
var _local5 = ("You have found " + _local4.discover) + "!";
if (!oPlayer.addInventory(_local4)) {
_local5 = _local5 + (("\nBut you have no more space in your inventory.\nYou throw the " + _local4.name) + " away.");
}
_local3 = oDialogBox.setDialog(_local5);
setState(sSTATE_DIALOG);
break;
case "Fountain" :
var _local6 = oPlayer.getPlayerData();
oPlayer.setHealth(_local6.maxhealth);
_local3 = oDialogBox.setDialog("You immerge your body into the fountain, letting the fresh water wash away the battles of the day, leaving you completely refreshed.");
setState(sSTATE_DIALOG);
break;
case "End" :
setState(sSTATE_SHOP);
break;
case "Monster" :
var _local7 = oLevel.getMonster();
oBattle.setMonster(oPlayer.getPlayerData(), _local7);
setState(sSTATE_BATTLE);
break;
case "Movement" :
setState(sSTATE_FOE_MOVE);
}
}
function startFoeMove() {
nTimer = nDELAY_MOVEMENT + getTimer();
}
function doFoeMove() {
if (nTimer < getTimer()) {
if (oLevel.monsterMovement() == "Monster") {
var _local2 = oLevel.getMonster();
oBattle.setMonster(oPlayer.getPlayerData(), _local2);
setState(sSTATE_BATTLE);
} else {
setState(sSTATE_AFTER_FOE_MOVE);
}
}
}
function startAfterFoeMove() {
nTimer = nDELAY_MOVEMENT + getTimer();
}
function doAfterFoeMove() {
if (nTimer < getTimer()) {
setState(sSTATE_LEVEL);
}
}
function doDialog() {
oDialogBox.enterFrame();
if (oDialogBox.__get__getState() == library.Popup.sSTATE_HIDDEN) {
setState(sSTATE_FOE_MOVE);
}
}
function doBattle() {
oBattle.enterFrame();
if (oBattle.__get__getState() == library.Popup.sSTATE_HIDDEN) {
setState(sSTATE_FOE_MOVE);
}
}
function setCharacter(_oColor, _sName) {
oPlayer.setColor(_oColor);
oLevel.setPlayerColor(_oColor);
oShop.setPlayerColor(_oColor);
oShop.setName(_sName);
}
function endBattleGood() {
oPlayer.setHealth(oBattle.getPlayerHealth());
oPlayer.setExperience(oBattle.getExperience());
oPlayer.setEquipment(oBattle.getEquipment());
oBattle.setState(library.Popup.sSTATE_OUT);
oLevel.removeMonster();
}
function endBattleBad() {
oLevel.playerDie();
oBattle.setState(library.Popup.sSTATE_OUT);
oShop.__set__success(false);
setState(sSTATE_SHOP);
}
static var nDELAY_MOVEMENT = 50;
static var sSTATE_INIT = "Init";
static var sSTATE_LEVEL = "Level";
static var sSTATE_FOE_MOVE = "FoeMove";
static var sSTATE_AFTER_FOE_MOVE = "AfterFoeMove";
static var sSTATE_DIALOG = "Dialog";
static var sSTATE_BATTLE = "Battle";
static var sSTATE_SHOP = "Shop";
}
Symbol 431 MovieClip [__Packages.library.Popup] Frame 0
class library.Popup extends library.State
{
var setState, fMidFunction, isStateComplete, fOutFunction, sState, __get__midFunction, __get__outFunction;
function Popup (_mcRef) {
super(_mcRef);
setState(sSTATE_HIDDEN);
}
function loadState(_sState) {
super.loadState(_sState);
switch (_sState) {
case sSTATE_HIDDEN :
break;
case sSTATE_IN :
break;
case sSTATE_IDLE :
if (fMidFunction) {
fMidFunction();
fMidFunction = undefined;
}
break;
case sSTATE_OUT :
}
}
function doIn() {
if (isStateComplete()) {
setState(sSTATE_IDLE);
}
}
function doOut() {
if (isStateComplete()) {
if (fOutFunction) {
fOutFunction();
fOutFunction = undefined;
}
setState(sSTATE_HIDDEN);
}
}
function startTransition() {
if (sState == sSTATE_HIDDEN) {
setState(sSTATE_IN);
}
}
function set midFunction(_fMidFunction) {
fMidFunction = _fMidFunction;
//return(__get__midFunction());
}
function set outFunction(_fOutFunction) {
fOutFunction = _fOutFunction;
//return(__get__outFunction());
}
static var sSTATE_HIDDEN = "Hidden";
static var sSTATE_IN = "In";
static var sSTATE_IDLE = "Idle";
static var sSTATE_OUT = "Out";
}
Symbol 432 MovieClip [__Packages.Battle] Frame 0
class Battle extends library.Popup
{
var fWin, fLose, oPlayer, mcRef, oFoe, oPlayerSplat, oFoeSplat, oBtnRock, oBtnPaper, oBtnScissors, setState;
function Battle (_mcRef, _fWin, _fLose) {
super(_mcRef);
fWin = _fWin;
fLose = _fLose;
}
function startIn() {
oPlayer.setMc(mcRef.mcState.mcPlayer, mcRef.mcState.mcPlayerArms);
oFoe.setMc(mcRef.mcState.mcFoe);
}
function startIdle() {
oPlayer.setMc(mcRef.mcPlayer, mcRef.mcPlayerArms);
oFoe.setMc(mcRef.mcFoe);
oPlayerSplat = new Splat(mcRef.mcPlayerSplat, library.Delegate.create(this, endBattleEffect));
oFoeSplat = new Splat(mcRef.mcFoeSplat, library.Delegate.create(this, endBattleEffect));
oBtnRock = new library.MCButton(mcRef.mcRock);
oBtnPaper = new library.MCButton(mcRef.mcPaper);
oBtnScissors = new library.MCButton(mcRef.mcScissors);
setPhase(sPHASE_CHOOSE);
}
function doIdle() {
oPlayerSplat.enterFrame();
oFoeSplat.enterFrame();
oPlayer.enterFrame();
oFoe.enterFrame();
oBtnRock.enterFrame();
oBtnPaper.enterFrame();
oBtnScissors.enterFrame();
if (mcRef.mcRock._visible) {
if (Key.isDown(90)) {
attackChosen(sROCK);
} else if (Key.isDown(88)) {
attackChosen(sPAPER);
} else if (Key.isDown(67)) {
attackChosen(sSCISSORS);
}
}
}
function startOut() {
oPlayer.setMc(mcRef.mcState.mcPlayer, mcRef.mcState.mcPlayerArms);
oFoe.setMc(mcRef.mcState.mcFoe);
}
function setMonster(_oPlayer, _oMonster) {
oPlayer = new PlayerBattleCharacter(_oPlayer, fWin, fLose);
oFoe = new FoeBattleCharacter(_oMonster);
setState(library.Popup.sSTATE_IN);
}
function setPhase(_sPhase) {
switch (_sPhase) {
case sPHASE_CHOOSE :
mcRef.mcHealthPlayer.mcHealthText.txtHP.text = (oPlayer.__get__hp() + "/") + oPlayer.__get__maxhp();
mcRef.mcHealthPlayer.gotoAndStop(Math.ceil(mcRef.mcHealthPlayer._totalFrames * (oPlayer.__get__hp() / oPlayer.__get__maxhp())));
mcRef.mcHealthFoe.mcHealthText.txtHP.text = (oFoe.__get__hp() + "/") + oFoe.__get__maxhp();
mcRef.mcHealthFoe.gotoAndStop(Math.ceil(mcRef.mcHealthFoe._totalFrames * (oFoe.__get__hp() / oFoe.__get__maxhp())));
mcRef.mcPlayerName.txtName.text = oPlayer.name;
mcRef.mcFoeName.txtName.text = oFoe.name;
var _local2 = mcRef.txtFoeName.getTextFormat();
if (oFoe.__get__name() > 9) {
_local2.size = 28;
} else {
_local2.size = 48;
}
mcRef.txtFoeName.setFontFormat(_local2);
mcRef.mcRock._visible = true;
mcRef.mcPaper._visible = true;
mcRef.mcScissors._visible = true;
mcRef.mcRock.onPress = library.Delegate.create(this, attackChosen, sROCK);
mcRef.mcPaper.onPress = library.Delegate.create(this, attackChosen, sPAPER);
mcRef.mcScissors.onPress = library.Delegate.create(this, attackChosen, sSCISSORS);
oPlayer.setState(BattleCharacter.sSTATE_IDLE);
oFoe.setState(BattleCharacter.sSTATE_IDLE);
break;
case sPHASE_BATTLE_EFFECT :
mcRef.mcRock._visible = false;
mcRef.mcPaper._visible = false;
mcRef.mcScissors._visible = false;
break;
case sPHASE_PLAYER_DEATH :
mcRef.mcHealthPlayer.mcHealthText.txtHP.text = "0/" + oPlayer.__get__maxhp();
mcRef.mcHealthPlayer.gotoAndStop(1);
mcRef.mcHealthFoe.mcHealthText.txtHP.text = (oFoe.__get__hp() + "/") + oFoe.__get__maxhp();
mcRef.mcHealthFoe.gotoAndStop(Math.ceil(mcRef.mcHealthFoe._totalFrames * (oFoe.__get__hp() / oFoe.__get__maxhp())));
mcRef.mcHealthPlayer.txtName.text = oPlayer.name;
mcRef.mcHealthFoe.txtName.text = oFoe.name;
oPlayer.setState(BattleCharacter.sSTATE_DEATH);
oFoe.setState(BattleCharacter.sSTATE_WIN);
break;
case sPHASE_FOE_DEATH :
mcRef.mcHealthPlayer.mcHealthText.txtHP.text = (oPlayer.__get__hp() + "/") + oPlayer.__get__maxhp();
mcRef.mcHealthPlayer.gotoAndStop(Math.ceil(mcRef.mcHealthPlayer._totalFrames * (oPlayer.__get__hp() / oPlayer.__get__maxhp())));
mcRef.mcHealthFoe.mcHealthText.txtHP.text = "0/" + oFoe.__get__maxhp();
mcRef.mcHealthFoe.gotoAndStop(1);
mcRef.mcHealthPlayer.txtName.text = oPlayer.name;
mcRef.mcHealthFoe.txtName.text = oFoe.name;
oPlayer.setState(BattleCharacter.sSTATE_WIN);
oFoe.setState(BattleCharacter.sSTATE_DEATH);
}
}
function setPlayerTop(_bPlayerTop) {
if ((_bPlayerTop && (oPlayer.__get__Mc()._parent.getDepth() < oFoe.__get__Mc()._parent._parent.getDepth())) || ((!_bPlayerTop) && (oPlayer.__get__Mc()._parent.getDepth() > oFoe.__get__Mc()._parent._parent.getDepth()))) {
oPlayer.__get__Mc()._parent.swapDepths(oFoe.__get__Mc()._parent._parent);
}
}
function attackChosen(_sAttack) {
var _local2 = oFoe.getAttack();
switch (_local2) {
case sROCK :
switch (_sAttack) {
case sROCK :
oPlayerSplat.setNoEffect();
oFoeSplat.setNoEffect();
oPlayer.setState(BattleCharacter.sSTATE_NULLROCK);
oFoe.setState(BattleCharacter.sSTATE_NULLROCK);
setPlayerTop(true);
break;
case sPAPER :
oFoeSplat.setDamage(oPlayer.__get__paper());
oFoe.setDamage(oPlayer.__get__paper());
oPlayer.setState(BattleCharacter.sSTATE_PAPER);
oFoe.setState(BattleCharacter.sSTATE_GETPAPER);
setPlayerTop(false);
break;
case sSCISSORS :
oPlayerSplat.setDamage(oFoe.__get__rock());
oPlayer.setDamage(oFoe.__get__rock());
oPlayer.setState(BattleCharacter.sSTATE_GETROCK);
oFoe.setState(BattleCharacter.sSTATE_ROCK);
setPlayerTop(true);
}
break;
case sPAPER :
switch (_sAttack) {
case sROCK :
oPlayerSplat.setDamage(oFoe.__get__paper());
oPlayer.setDamage(oFoe.__get__paper());
oPlayer.setState(BattleCharacter.sSTATE_GETPAPER);
oFoe.setState(BattleCharacter.sSTATE_PAPER);
setPlayerTop(true);
break;
case sPAPER :
setPhase(sPHASE_BATTLE_EFFECT);
oPlayerSplat.setNoEffect();
oFoeSplat.setNoEffect();
oPlayer.setState(BattleCharacter.sSTATE_NULLPAPER);
oFoe.setState(BattleCharacter.sSTATE_NULLPAPER);
setPlayerTop(true);
break;
case sSCISSORS :
oFoeSplat.setDamage(oPlayer.__get__scissors());
oFoe.setDamage(oPlayer.__get__scissors());
oFoe.setState(BattleCharacter.sSTATE_GETSCISSORS);
oPlayer.setState(BattleCharacter.sSTATE_SCISSORS);
setPlayerTop(false);
}
break;
case sSCISSORS :
switch (_sAttack) {
case sROCK :
oFoeSplat.setDamage(oPlayer.__get__rock());
oFoe.setDamage(oPlayer.__get__rock());
oFoe.setState(BattleCharacter.sSTATE_GETROCK);
oPlayer.setState(BattleCharacter.sSTATE_ROCK);
setPlayerTop(false);
break;
case sPAPER :
oPlayerSplat.setDamage(oFoe.__get__scissors());
oPlayer.setDamage(oFoe.__get__scissors());
oFoe.setState(BattleCharacter.sSTATE_SCISSORS);
oPlayer.setState(BattleCharacter.sSTATE_GETSCISSORS);
setPlayerTop(false);
break;
case sSCISSORS :
oPlayerSplat.setNoEffect();
oFoeSplat.setNoEffect();
oFoe.setState(BattleCharacter.sSTATE_NULLSCISSORS);
oPlayer.setState(BattleCharacter.sSTATE_NULLSCISSORS);
setPlayerTop(false);
}
}
setPhase(sPHASE_BATTLE_EFFECT);
}
function endBattleEffect() {
if (oPlayer.__get__hp() <= 0) {
if (!oPlayer.useEquipment()) {
setPhase(sPHASE_PLAYER_DEATH);
} else {
setPhase(sPHASE_CHOOSE);
}
} else if (oFoe.__get__hp() <= 0) {
setPhase(sPHASE_FOE_DEATH);
} else {
setPhase(sPHASE_CHOOSE);
}
}
function getPlayerHealth() {
return(oPlayer.__get__hp());
}
function getExperience() {
return(oFoe.__get__experience());
}
function getEquipment() {
return(oPlayer.__get__equipment());
}
var sPHASE_CHOOSE = "Choose";
var sPHASE_BATTLE_EFFECT = "BattleEffect";
var sPHASE_PLAYER_DEATH = "PlayerDeath";
var sPHASE_FOE_DEATH = "FoeDeath";
static var sROCK = "Rock";
static var sPAPER = "Paper";
static var sSCISSORS = "Scissors";
}
Symbol 433 MovieClip [__Packages.BattleCharacter] Frame 0
class BattleCharacter extends library.State
{
var nRockAtt, nPaperAtt, nScissorAtt, nHP, nMaxHP, sName;
function BattleCharacter (_mcRef) {
super(_mcRef);
nRockAtt = 2;
nPaperAtt = 2;
nScissorAtt = 2;
nHP = 20;
nMaxHP = 20;
}
function setDamage(_nDamage) {
nHP = nHP - _nDamage;
}
function get rock() {
return(nRockAtt);
}
function get paper() {
return(nPaperAtt);
}
function get scissors() {
return(nScissorAtt);
}
function get hp() {
return(nHP);
}
function get maxhp() {
return(nMaxHP);
}
function get name() {
return(sName);
}
static var sSTATE_IDLE = "Idle";
static var sSTATE_ROCK = "Rock";
static var sSTATE_PAPER = "Paper";
static var sSTATE_SCISSORS = "Scissors";
static var sSTATE_GETROCK = "GetRock";
static var sSTATE_GETPAPER = "GetPaper";
static var sSTATE_GETSCISSORS = "GetScissors";
static var sSTATE_NULLROCK = "NullRock";
static var sSTATE_NULLPAPER = "NullPaper";
static var sSTATE_NULLSCISSORS = "NullScissors";
static var sSTATE_DEATH = "Death";
static var sSTATE_WIN = "Win";
}
Symbol 434 MovieClip [__Packages.PlayerBattleCharacter] Frame 0
class PlayerBattleCharacter extends BattleCharacter
{
var fWin, fLose, oColor, nRockAtt, nPaperAtt, nScissorAtt, nMaxHP, nHP, aEquipment, sName, isStateComplete, mcRef, mcLower, mcUpper;
function PlayerBattleCharacter (_oPlayer, _fWin, _fLose) {
super();
fWin = _fWin;
fLose = _fLose;
oColor = _oPlayer.color;
nRockAtt = _oPlayer.rock;
nPaperAtt = _oPlayer.paper;
nScissorAtt = _oPlayer.scissors;
nMaxHP = _oPlayer.maxhealth;
nHP = _oPlayer.health;
aEquipment = _oPlayer.aEquipment;
sName = _oPlayer.name;
setState(BattleCharacter.sSTATE_IDLE);
}
function startIdle() {
setColors();
}
function startRock() {
setColors();
}
function startPaper() {
setColors();
}
function startScissors() {
setColors();
}
function startGetRock() {
setColors();
}
function startGetPaper() {
setColors();
}
function startGetScissors() {
setColors();
}
function startNullRock() {
setColors();
}
function startNullPaper() {
setColors();
}
function startNullScissors() {
setColors();
}
function startDeath() {
setColors();
}
function startWin() {
setColors();
}
function doDeath() {
if (isStateComplete()) {
fLose();
}
}
function doWin() {
if (isStateComplete()) {
fWin();
}
}
function setColors() {
var _local2 = new flash.geom.Transform(mcRef.mcState.mcHead);
_local2.colorTransform = oColor;
_local2 = new flash.geom.Transform(mcRef.mcState.mcBody);
_local2.colorTransform = oColor;
_local2 = new flash.geom.Transform(mcRef.mcState.mcCock);
_local2.colorTransform = oColor;
_local2 = new flash.geom.Transform(mcLower);
_local2.colorTransform = oColor;
}
function setState(_sState) {
mcLower.gotoAndStop(_sState);
super.setState(_sState);
}
function setMc(_mcRef, _mcLower, _mcUpper) {
_mcLower.gotoAndStop("Player");
mcLower = _mcLower.mcState;
_mcUpper.gotoAndStop("Player");
mcUpper = _mcUpper;
_mcRef.gotoAndStop("Player");
super.setMc(_mcRef.mcState);
}
function useEquipment() {
var _local3 = false;
var _local2;
_local2 = 0;
while (_local2 < aEquipment.length) {
if (aEquipment[_local2].health > 0) {
nHP = nHP + aEquipment[_local2].health;
nHP = Math.min(nHP, nMaxHP);
aEquipment.splice(_local2, 1);
if (nHP > 0) {
_local3 = true;
break;
}
}
_local2++;
}
return(_local3);
}
function get equipment() {
return(aEquipment);
}
}
Symbol 435 MovieClip [__Packages.FoeBattleCharacter] Frame 0
class FoeBattleCharacter extends BattleCharacter
{
var sFoe, sArmor, oColor, nRockProb, nPaperProb, nRockAtt, nPaperAtt, nScissorAtt, nMaxHP, nHP, nExperience, sName, setState, mcRef, mcLower, mcUpper;
function FoeBattleCharacter (_oFoe) {
super();
sFoe = _oFoe.monster;
sArmor = _oFoe.armor;
oColor = _oFoe.color;
nRockProb = _oFoe.rockprob;
nPaperProb = _oFoe.paperprob;
nRockAtt = _oFoe.rock;
nPaperAtt = _oFoe.paper;
nScissorAtt = _oFoe.scissors;
nMaxHP = _oFoe.health;
nHP = nMaxHP;
nExperience = _oFoe.experience;
sName = _oFoe.name;
setState(BattleCharacter.sSTATE_IDLE);
}
function startIdle() {
setColors(mcRef.mcState);
}
function startRock() {
setColors(mcRef.mcState);
}
function startPaper() {
setColors(mcRef.mcState);
}
function startScissors() {
setColors(mcRef.mcState);
}
function startGetRock() {
setColors(mcRef.mcState);
}
function startGetPaper() {
setColors(mcRef.mcState);
}
function startGetScissors() {
setColors(mcRef.mcState);
}
function startNullRock() {
setColors(mcRef.mcState);
}
function startNullPaper() {
setColors(mcRef.mcState);
}
function startNullScissors() {
setColors(mcRef.mcState);
}
function startDeath() {
setColors(mcRef.mcState);
}
function startWin() {
setColors(mcRef.mcState);
}
function setMc(_mcRef, _mcLower, _mcUpper) {
mcLower = _mcLower.mcState;
mcUpper = _mcUpper;
_mcRef.gotoAndStop("Foe");
_mcRef.mcState.gotoAndStop(sFoe);
super.setMc(_mcRef.mcState.mcState);
}
function setColors(_mcRef) {
var _local2 = new flash.geom.Transform(_mcRef.mcBody);
_local2.colorTransform = oColor;
_mcRef.mcArmor.gotoAndStop(sArmor);
}
function getAttack() {
var _local2;
var _local3 = Math.floor(Math.random() * 100);
if (_local3 < nRockProb) {
_local2 = Battle.sROCK;
} else if (_local3 < nPaperProb) {
_local2 = Battle.sPAPER;
} else {
_local2 = Battle.sSCISSORS;
}
return(_local2);
}
function get experience() {
return(nExperience);
}
}
Symbol 436 MovieClip [__Packages.Splat] Frame 0
class Splat extends library.State
{
var fEndSplat, nX, mcRef, nY, setState, isStateComplete;
function Splat (_mcRef, _fEndSplat) {
super(_mcRef);
fEndSplat = _fEndSplat;
nX = mcRef._x;
nY = mcRef._y;
setState(sSTATE_HIDDEN);
}
function doDamage() {
if (isStateComplete()) {
fEndSplat();
setState(sSTATE_HIDDEN);
}
}
function doNoEffect() {
if (isStateComplete()) {
fEndSplat();
setState(sSTATE_HIDDEN);
}
}
function setDamage(_nDamage) {
nX = mcRef._x + (Math.floor(Math.random() * 60) - 30);
nY = mcRef._y + (Math.floor(Math.random() * 60) - 30);
setState(sSTATE_DAMAGE);
mcRef.mcState.mcText.txtText.text = _nDamage;
var _local2 = Math.ceil(Math.random() * 6);
mcRef.mcState.mcSplat.gotoAndStop("Splat" + _local2);
}
function setNoEffect() {
nX = mcRef._x + (Math.floor(Math.random() * 60) - 30);
nY = mcRef._y + (Math.floor(Math.random() * 60) - 30);
setState(sSTATE_NOEFFECT);
var _local2 = Math.ceil(Math.random() * 6);
mcRef.mcState.mcSplat.gotoAndStop("Splat" + _local2);
}
var sSTATE_DAMAGE = "Damage";
var sSTATE_NOEFFECT = "NoEffect";
var sSTATE_HIDDEN = "Hidden";
}
Symbol 437 MovieClip [__Packages.library.MCButton] Frame 0
class library.MCButton extends library.State
{
var setState, mcRef;
function MCButton (_mcRef, _fFunction) {
super(_mcRef);
setState("Idle");
mcRef.onRollOver = library.Delegate.create(this, setState, "Over");
mcRef.onRollOut = library.Delegate.create(this, setState, "Idle");
mcRef.onPress = library.Delegate.create(this, setState, "Down");
mcRef.onMouseUp = library.Delegate.create(this, setState, "Idle");
mcRef.onRelease = _fFunction;
}
}
Symbol 438 MovieClip [__Packages.library.Delegate] Frame 0
class library.Delegate extends Object
{
var func;
function Delegate (f) {
super();
func = f;
}
static function create(obj, func) {
var _local2 = function () {
var _local3 = arguments.callee.target;
var _local4 = arguments.callee.func;
var _local2 = arguments.callee.arg;
_local2 = _local2.concat(arguments);
return(_local4.apply(_local3, _local2));
};
_local2.target = obj;
_local2.func = func;
_local2.arg = arguments.slice(2);
return(_local2);
}
function createDelegate(obj) {
return(create(obj, func));
}
}
Symbol 439 MovieClip [__Packages.Level] Frame 0
class Level
{
var mcRef, oPlayerPos, sTileset, nLevel, nLight, aDungeon, aEnnemies, aDark, oPlayerColor;
function Level (_mcRef) {
mcRef = _mcRef;
oPlayerPos = new Object({x:0, y:0});
sTileset = "mcTile";
nLevel = -1;
nLight = 1;
}
function movement(_sDirection) {
var _local3 = "";
switch (_sDirection) {
case sLEFT :
if (isNotBlock(aDungeon[oPlayerPos.y][oPlayerPos.x - 1], true)) {
oPlayerPos.x--;
_local3 = "Movement";
}
break;
case sRIGHT :
if (isNotBlock(aDungeon[oPlayerPos.y][oPlayerPos.x + 1], true)) {
oPlayerPos.x++;
_local3 = "Movement";
}
break;
case sUP :
if (isNotBlock(aDungeon[oPlayerPos.y - 1][oPlayerPos.x], true)) {
oPlayerPos.y--;
_local3 = "Movement";
}
break;
case sDOWN :
if (!isNotBlock(aDungeon[oPlayerPos.y + 1][oPlayerPos.x], true)) {
break;
}
oPlayerPos.y++;
_local3 = "Movement";
}
var _local2;
if (aDungeon[oPlayerPos.y][oPlayerPos.x] == "Chest") {
_local3 = "Chest";
aDungeon[oPlayerPos.y][oPlayerPos.x] = "ChestOpen";
} else if (aDungeon[oPlayerPos.y][oPlayerPos.x] == "End") {
_local3 = "End";
} else if (aDungeon[oPlayerPos.y][oPlayerPos.x] == "Fountain") {
_local3 = "Fountain";
aDungeon[oPlayerPos.y][oPlayerPos.x] = "FountainUsed";
} else {
_local2 = 0;
while (_local2 < aEnnemies.length) {
if ((aEnnemies[_local2].x == oPlayerPos.x) && (aEnnemies[_local2].y == oPlayerPos.y)) {
_local3 = "Monster";
break;
}
_local2++;
}
}
display(sTileset);
return(_local3);
}
function load(_nLevel, _nLight) {
nLight = _nLight;
var _local4 = GenerateDungeon.newDungeon(_nLevel);
var _local3;
var _local2;
aEnnemies = new Array();
aDungeon = new Array();
aDark = new Array();
_local2 = 0;
while (_local2 < _local4.length) {
aDungeon.push(new Array());
aDark.push(new Array());
_local3 = 0;
while (_local3 < _local4[_local2].length) {
switch (_local4[_local2][_local3]) {
case "S" :
aDungeon[_local2].push("Road");
oPlayerPos.x = _local3;
oPlayerPos.y = _local2;
break;
case "E" :
aDungeon[_local2].push("End");
break;
case "X" :
aDungeon[_local2].push("Block");
break;
case "C" :
aDungeon[_local2].push("Chest");
break;
case "O" :
case "N" :
aDungeon[_local2].push("Road");
break;
case "F" :
aDungeon[_local2].push("Fountain");
break;
case 0 :
case 1 :
case 2 :
case 3 :
case 4 :
case 5 :
case 6 :
aDungeon[_local2].push("Road");
aEnnemies.push(DataEnnemies.getMonster(nLevel, _local4[_local2][_local3]));
aEnnemies[aEnnemies.length - 1].x = _local3;
aEnnemies[aEnnemies.length - 1].y = _local2;
}
aDark[_local2].push("X");
_local3++;
}
_local2++;
}
var _local5;
_local2 = 0;
while (_local2 < aDungeon.length) {
_local3 = 0;
while (_local3 < aDungeon[_local2].length) {
if ((aDungeon[_local2][_local3] == "Road") && (aDungeon[_local2 - 1][_local3] == "Block")) {
if (aDungeon[_local2 - 2][_local3] == "Road") {
aDungeon[_local2 - 1][_local3] = "Road";
} else {
_local5 = Math.floor(Math.random() * 13);
if (_local5 <= 1) {
aDungeon[_local2 - 1][_local3] = "Torch";
} else if (_local5 == 2) {
aDungeon[_local2 - 1][_local3] = "Skeleton";
} else {
aDungeon[_local2 - 1][_local3] = "Wall";
}
}
}
_local3++;
}
_local2++;
}
display(sTileset);
nLevel = _nLevel;
}
function isNotBlock(_sTile, _bOnlyBlock) {
var _local2 = (((_sTile != "Block") && (_sTile != "Torch")) && (_sTile != "Skeleton")) && (_sTile != "Wall");
return(_local2);
}
function monsterMovement() {
var _local9;
var _local7 = 0;
var _local6;
var _local4;
var _local5;
var _local8;
var _local2;
var _local3;
_local2 = 0;
while (_local2 < aEnnemies.length) {
if (aEnnemies[_local2].movement > 0) {
_local7 = aEnnemies[_local2].movement;
do {
_local6 = false;
_local4 = aEnnemies[_local2].y;
_local5 = aEnnemies[_local2].x;
_local8 = Math.floor(Math.random() * 6);
switch (_local8) {
case 0 :
_local4--;
break;
case 1 :
_local5++;
break;
case 2 :
_local4++;
break;
case 3 :
_local5--;
}
if (isNotBlock(aDungeon[_local4][_local5], false)) {
_local3 = 0;
while (_local3 < aEnnemies.length) {
if (_local2 != _local3) {
if ((aEnnemies[_local3].x == _local5) && (aEnnemies[_local3].y == _local4)) {
_local6 = true;
break;
}
}
_local3++;
}
if (!_local6) {
_local7--;
aEnnemies[_local2].y = _local4;
aEnnemies[_local2].x = _local5;
}
}
} while (_local7 > 0);
}
_local2++;
}
_local2 = 0;
while (_local2 < aEnnemies.length) {
if ((aEnnemies[_local2].x == oPlayerPos.x) && (aEnnemies[_local2].y == oPlayerPos.y)) {
_local9 = "Monster";
break;
}
_local2++;
}
display(sTileset);
return(_local9);
}
function display(_sTiles) {
var _local5;
for (_local5 in mcRef) {
mcRef[_local5].swapDepths(mcRef.getNextHighestDepth());
mcRef[_local5].removeMovieClip();
}
var _local2;
var _local4;
_local4 = oPlayerPos.y - nLight;
while (_local4 <= (oPlayerPos.y + nLight)) {
_local2 = oPlayerPos.x - nLight;
while (_local2 <= (oPlayerPos.x + nLight)) {
aDark[_local4][_local2] = "O";
_local2++;
}
_local4++;
}
var _local3;
_local4 = 0;
while (_local4 < aDungeon.length) {
_local2 = 0;
while (_local2 < aDungeon[_local4].length) {
if (aDark[_local4][_local2] == "O") {
_local3 = mcRef.attachMovie(_sTiles, "mcTile" + mcRef.getNextHighestDepth(), mcRef.getNextHighestDepth());
_local3._x = (_local2 - oPlayerPos.x) * _local3._width;
_local3._y = (_local4 - oPlayerPos.y) * _local3._height;
_local3.gotoAndStop(aDungeon[_local4][_local2]);
}
_local2++;
}
_local4++;
}
var _local6;
_local2 = 0;
while (_local2 < aEnnemies.length) {
if (aDark[aEnnemies[_local2].y][aEnnemies[_local2].x] == "O") {
_local3 = mcRef.attachMovie("mcMonster", "mcMonster" + mcRef.getNextHighestDepth(), mcRef.getNextHighestDepth());
_local3._x = (aEnnemies[_local2].x - oPlayerPos.x) * _local3._width;
_local3._y = (aEnnemies[_local2].y - oPlayerPos.y) * _local3._height;
_local3.gotoAndStop(aEnnemies[_local2].monster);
_local6 = new flash.geom.Transform(_local3.mcState.mcBody);
_local6.colorTransform = aEnnemies[_local2].color;
_local3.mcState.mcArmor.gotoAndStop(aEnnemies[_local2].armor);
}
_local2++;
}
_local3 = mcRef.attachMovie("mcPlayer", "mcPlayer", mcRef.getNextHighestDepth());
_local3._x = 0;
_local3._y = 0;
_local6 = new flash.geom.Transform(_local3);
_local6.colorTransform = oPlayerColor;
}
function setPlayerColor(_oColor) {
oPlayerColor = _oColor;
var _local2 = new flash.geom.Transform(mcRef.mcPlayer);
_local2.colorTransform = oPlayerColor;
}
function getMonster() {
var _local2;
_local2 = 0;
while (_local2 < aEnnemies.length) {
if ((aEnnemies[_local2].x == oPlayerPos.x) && (aEnnemies[_local2].y == oPlayerPos.y)) {
break;
}
_local2++;
}
return(aEnnemies[_local2]);
}
function removeMonster() {
var _local2;
_local2 = 0;
while (_local2 < aEnnemies.length) {
if ((aEnnemies[_local2].x == oPlayerPos.x) && (aEnnemies[_local2].y == oPlayerPos.y)) {
aEnnemies.splice(_local2, 1);
break;
}
_local2++;
}
display(sTileset);
}
function playerDie() {
nLevel--;
}
function get currentLevel() {
return(nLevel);
}
static var sLEFT = "Left";
static var sRIGHT = "Right";
static var sUP = "Up";
static var sDOWN = "Down";
}
Symbol 440 MovieClip [__Packages.GenerateDungeon] Frame 0
class GenerateDungeon
{
function GenerateDungeon () {
}
static function newDungeon(_nLevel) {
var _local10;
var _local13;
if ((Math.random() * 2) == 0) {
_local10 = ARRAY_PARAM_X[_nLevel];
_local13 = ARRAY_PARAM_Y[_nLevel];
} else {
_local10 = ARRAY_PARAM_Y[_nLevel];
_local13 = ARRAY_PARAM_X[_nLevel];
}
var _local14 = Math.floor(Math.random() * (ARRAY_PARAM_ROOMS_MAX[_nLevel] - ARRAY_PARAM_ROOMS_MIN[_nLevel])) + ARRAY_PARAM_ROOMS_MIN[_nLevel];
var _local11;
var _local4 = new Array();
var _local1;
var _local2;
var _local16 = Math.floor(Math.random() * (ARRAY_PARAM_FOUNTAINS_MAX[_nLevel] - ARRAY_PARAM_FOUNTAINS_MIN[_nLevel])) + ARRAY_PARAM_FOUNTAINS_MIN[_nLevel];
var _local3 = new Array();
_local2 = 0;
while (_local2 < ((_local13 * nDISTANCE_BETWEEN_ROOMS) + ((nDISTANCE_BETWEEN_ROOMS + 1) % 2))) {
_local3[_local2] = new Array();
_local1 = 0;
while (_local1 < ((_local10 * nDISTANCE_BETWEEN_ROOMS) + ((nDISTANCE_BETWEEN_ROOMS + 1) % 2))) {
_local3[_local2][_local1] = "X";
_local1++;
}
_local2++;
}
trace((((((("newDungeon: " + _nLevel) + " / ") + _local10) + " / ") + _local13) + " / ") + _local14);
while (_local14 > 0) {
_local1 = (Math.floor(Math.random() * _local10) * nDISTANCE_BETWEEN_ROOMS) + Math.floor(nDISTANCE_BETWEEN_ROOMS / 2);
_local2 = (Math.floor(Math.random() * _local13) * nDISTANCE_BETWEEN_ROOMS) + Math.floor(nDISTANCE_BETWEEN_ROOMS / 2);
_local11 = new Object();
_local11.x = _local1;
_local11.y = _local2;
if (!searchArray(_local1, _local2, _local4)) {
_local14--;
switch (_local14) {
case 0 :
_local3[_local2][_local1] = "S";
break;
case 1 :
_local3[_local2][_local1] = "E";
break;
default :
if (_local16 > 0) {
_local16--;
_local3[_local2][_local1] = "F";
} else if (Math.random() < ARRAY_PARAM_CHESTS[_nLevel]) {
_local3[_local2][_local1] = "C";
} else {
_local3[_local2][_local1] = "N";
}
}
if ((nDISTANCE_BETWEEN_ROOMS > 3) && (_local3[_local2][_local1] != "N")) {
_local3[_local2 - 1][_local1 - 1] = "O";
_local3[_local2 - 1][_local1] = "O";
_local3[_local2 - 1][_local1 + 1] = "O";
_local3[_local2][_local1 - 1] = "O";
_local3[_local2][_local1 + 1] = "O";
_local3[_local2 + 1][_local1 - 1] = "O";
_local3[_local2 + 1][_local1] = "O";
_local3[_local2 + 1][_local1 + 1] = "O";
}
_local4.push(_local11);
}
}
var _local6;
var _local5;
var _local12;
var _local9;
var _local8;
_local6 = 0;
while (_local6 < _local4.length) {
_local9 = _local10 * _local13;
_local5 = 0;
while (_local5 < _local4.length) {
if (_local6 != _local5) {
_local8 = Math.sqrt(Math.pow(_local4[_local6].x - _local4[_local5].x, 2) + Math.pow(_local4[_local6].y - _local4[_local5].y, 2));
if (_local8 < _local9) {
_local9 = _local8;
_local12 = _local5;
}
}
_local5++;
}
_local1 = ((_local4[_local12].x - Math.floor(nDISTANCE_BETWEEN_ROOMS / 2)) / nDISTANCE_BETWEEN_ROOMS) - ((_local4[_local6].x - Math.floor(nDISTANCE_BETWEEN_ROOMS / 2)) / nDISTANCE_BETWEEN_ROOMS);
_local2 = ((_local4[_local12].y - Math.floor(nDISTANCE_BETWEEN_ROOMS / 2)) / nDISTANCE_BETWEEN_ROOMS) - ((_local4[_local6].y - Math.floor(nDISTANCE_BETWEEN_ROOMS / 2)) / nDISTANCE_BETWEEN_ROOMS);
createConnection(_local3, _local1, _local2, _local4[_local6].x, _local4[_local6].y);
_local6++;
}
var _local7 = verifySeparations(_local4, _local3);
while (_local7.length > 0) {
_local1 = ((_local7[0][0] - Math.floor(nDISTANCE_BETWEEN_ROOMS / 2)) / nDISTANCE_BETWEEN_ROOMS) - ((_local7[1][0] - Math.floor(nDISTANCE_BETWEEN_ROOMS / 2)) / nDISTANCE_BETWEEN_ROOMS);
_local2 = ((_local7[0][1] - Math.floor(nDISTANCE_BETWEEN_ROOMS / 2)) / nDISTANCE_BETWEEN_ROOMS) - ((_local7[1][1] - Math.floor(nDISTANCE_BETWEEN_ROOMS / 2)) / nDISTANCE_BETWEEN_ROOMS);
_local3 = createConnection(_local3, _local1, _local2, _local7[1][0], _local7[1][1]);
_local7 = verifySeparations(_local4, _local3);
}
_local3 = setMonsters(_local3, _nLevel);
return(_local3);
}
static function setMonsters(_aDungeon, _nLevel) {
var _local3;
var _local2;
var _local5 = Math.floor(Math.random() * (ARRAY_PARAM_MONSTERS_MAX[_nLevel] - (ARRAY_PARAM_MONSTERS_MIN[_nLevel] - 1))) + ARRAY_PARAM_MONSTERS_MIN[_nLevel];
var _local6;
while (_local5 > 0) {
_local6 = Math.floor(Math.random() * (ARRAY_PARAM_MONSTERS_LEVELS_MAX[_nLevel] - (ARRAY_PARAM_MONSTERS_LEVELS_MIN[_nLevel] - 1))) + ARRAY_PARAM_MONSTERS_LEVELS_MIN[_nLevel];
_local5--;
do {
_local3 = Math.floor(Math.random() * _aDungeon[0].length);
_local2 = Math.floor(Math.random() * _aDungeon.length);
} while (_aDungeon[_local2][_local3] != "O");
_aDungeon[_local2][_local3] = _local6;
}
return(_aDungeon);
}
static function verifySeparations(_aRooms, _aDungeon) {
var _local14 = new Array();
var _local2 = new Array();
var _local4 = 0;
var _local16;
var _local15;
var _local5;
var _local8;
var _local3;
var _local1;
_local5 = 0;
while (_local5 < _aRooms.length) {
_local8 = false;
if (_local5 > 0) {
_local3 = 0;
while (_local3 < _local2.length) {
_local1 = 0;
while (_local1 < _local2[_local3].length) {
if ((_local2[_local3][_local1][0] == _aRooms[_local5].x) && (_local2[_local3][_local1][1] == _aRooms[_local5].y)) {
_local8 = true;
break;
}
_local1++;
}
if (_local8) {
break;
}
_local3++;
}
}
if (!_local8) {
_local2[_local4] = new Array();
_local2[_local4] = movement(_aDungeon, _aRooms[_local5].x, _aRooms[_local5].y, "", new Array(), 0);
_local4++;
}
_local5++;
}
var _local12;
var _local11;
var _local10;
var _local6;
var _local9 = _aDungeon.length * _aDungeon[0].length;
if (_local2.length > 1) {
_local4 = 1;
while (_local4 < _local2.length) {
_local3 = 0;
while (_local3 < _local2[_local4].length) {
_local1 = 0;
while (_local1 < _local2[0].length) {
_local6 = Math.sqrt(Math.pow(_local2[0][_local1][0] - _local2[_local4][_local3][0], 2) + Math.pow(_local2[0][_local1][1] - _local2[_local4][_local3][1], 2));
if (_local6 < _local9) {
_local9 = _local6;
_local12 = _local1;
_local10 = _local3;
_local11 = _local4;
}
_local1++;
}
_local3++;
}
_local4++;
}
_local14.push(new Array(_local2[0][_local12][0], _local2[0][_local12][1]));
_local14.push(new Array(_local2[_local11][_local10][0], _local2[_local11][_local10][1]));
}
return(_local14);
}
static function movement(_aDungeon, _nX, _nY, _sDirection, _aSeparation, _nResursion) {
var _local6 = false;
if (_nResursion < 150) {
if (_aDungeon[_nY][_nX] != "O") {
var _local1;
_local1 = 0;
while (_local1 < _aSeparation.length) {
if ((_aSeparation[_local1][0] == _nX) && (_aSeparation[_local1][1] == _nY)) {
_local6 = true;
break;
}
_local1++;
}
if (!_local6) {
_aSeparation.push(new Array(_nX, _nY));
}
}
if (!_local6) {
if (((_aDungeon[_nY][_nX - Math.floor(nDISTANCE_BETWEEN_ROOMS / 2)] != "X") && ((_nX - Math.floor(nDISTANCE_BETWEEN_ROOMS / 2)) > 0)) && (_sDirection != Level.sRIGHT)) {
_aSeparation = movement(_aDungeon, _nX - Math.floor(nDISTANCE_BETWEEN_ROOMS / 2), _nY, Level.sLEFT, _aSeparation, _nResursion + 1);
}
if (((_aDungeon[_nY][_nX + Math.floor(nDISTANCE_BETWEEN_ROOMS / 2)] != "X") && ((_nX + Math.floor(nDISTANCE_BETWEEN_ROOMS / 2)) < _aDungeon[0].length)) && (_sDirection != Level.sLEFT)) {
_aSeparation = movement(_aDungeon, _nX + Math.floor(nDISTANCE_BETWEEN_ROOMS / 2), _nY, Level.sRIGHT, _aSeparation, _nResursion + 1);
}
if (((_aDungeon[_nY - Math.floor(nDISTANCE_BETWEEN_ROOMS / 2)][_nX] != "X") && ((_nY - Math.floor(nDISTANCE_BETWEEN_ROOMS / 2)) > 0)) && (_sDirection != Level.sDOWN)) {
_aSeparation = movement(_aDungeon, _nX, _nY - Math.floor(nDISTANCE_BETWEEN_ROOMS / 2), Level.sUP, _aSeparation, _nResursion + 1);
}
if (((_aDungeon[_nY + Math.floor(nDISTANCE_BETWEEN_ROOMS / 2)][_nX] != "X") && ((_nY + Math.floor(nDISTANCE_BETWEEN_ROOMS / 2)) < _aDungeon.length)) && (_sDirection != Level.sUP)) {
_aSeparation = movement(_aDungeon, _nX, _nY + Math.floor(nDISTANCE_BETWEEN_ROOMS / 2), Level.sDOWN, _aSeparation, _nResursion + 1);
}
}
}
return(_aSeparation);
}
static function createConnection(_aDungeon, _nX, _nY, _nPosX, _nPosY) {
while ((_nX != 0) || (_nY != 0)) {
if (((Math.floor(Math.random() * 2) == 0) && (_nX != 0)) || (_nY == 0)) {
if (_nX < 0) {
_aDungeon[_nPosY][_nPosX - 1] = "O";
_aDungeon[_nPosY][_nPosX - 2] = "O";
if (nDISTANCE_BETWEEN_ROOMS > 3) {
_aDungeon[_nPosY][_nPosX - 3] = "O";
}
if (nDISTANCE_BETWEEN_ROOMS > 4) {
_aDungeon[_nPosY][_nPosX - 4] = "O";
}
if (_aDungeon[_nPosY][_nPosX - nDISTANCE_BETWEEN_ROOMS] == "X") {
_aDungeon[_nPosY][_nPosX - nDISTANCE_BETWEEN_ROOMS] = "O";
}
_nX++;
_nPosX = _nPosX - nDISTANCE_BETWEEN_ROOMS;
} else {
_aDungeon[_nPosY][_nPosX + 1] = "O";
_aDungeon[_nPosY][_nPosX + 2] = "O";
if (nDISTANCE_BETWEEN_ROOMS > 3) {
_aDungeon[_nPosY][_nPosX + 3] = "O";
}
if (nDISTANCE_BETWEEN_ROOMS > 4) {
_aDungeon[_nPosY][_nPosX + 4] = "O";
}
if (_aDungeon[_nPosY][_nPosX + nDISTANCE_BETWEEN_ROOMS] == "X") {
_aDungeon[_nPosY][_nPosX + nDISTANCE_BETWEEN_ROOMS] = "O";
}
_nX--;
_nPosX = _nPosX + nDISTANCE_BETWEEN_ROOMS;
}
} else if (_nY < 0) {
_aDungeon[_nPosY - 1][_nPosX] = "O";
_aDungeon[_nPosY - 2][_nPosX] = "O";
if (nDISTANCE_BETWEEN_ROOMS > 3) {
_aDungeon[_nPosY - 3][_nPosX] = "O";
}
if (nDISTANCE_BETWEEN_ROOMS > 4) {
_aDungeon[_nPosY - 4][_nPosX] = "O";
}
if (_aDungeon[_nPosY - nDISTANCE_BETWEEN_ROOMS][_nPosX] == "X") {
_aDungeon[_nPosY - nDISTANCE_BETWEEN_ROOMS][_nPosX] = "O";
}
_nY++;
_nPosY = _nPosY - nDISTANCE_BETWEEN_ROOMS;
} else {
_aDungeon[_nPosY + 1][_nPosX] = "O";
_aDungeon[_nPosY + 2][_nPosX] = "O";
if (nDISTANCE_BETWEEN_ROOMS > 3) {
_aDungeon[_nPosY + 3][_nPosX] = "O";
}
if (nDISTANCE_BETWEEN_ROOMS > 4) {
_aDungeon[_nPosY + 4][_nPosX] = "O";
}
if (_aDungeon[_nPosY + nDISTANCE_BETWEEN_ROOMS][_nPosX] == "X") {
_aDungeon[_nPosY + nDISTANCE_BETWEEN_ROOMS][_nPosX] = "O";
}
_nY--;
_nPosY = _nPosY + nDISTANCE_BETWEEN_ROOMS;
}
}
return(_aDungeon);
}
static function searchArray(_nX, _nY, _aRooms) {
var _local3 = false;
var _local1;
_local1 = 0;
while (_local1 < _aRooms.length) {
if ((_aRooms[_local1].x == _nX) && (_aRooms[_local1].y == _nY)) {
_local3 = true;
}
_local1++;
}
return(_local3);
}
static var nDISTANCE_BETWEEN_ROOMS = 4;
static var ARRAY_PARAM_X = new Array(6, 8, 9, 10, 12, 13);
static var ARRAY_PARAM_Y = new Array(6, 8, 10, 12, 12, 13);
static var ARRAY_PARAM_ROOMS_MIN = new Array(8, 11, 14, 18, 22, 27);
static var ARRAY_PARAM_ROOMS_MAX = new Array(10, 13, 18, 22, 27, 31);
static var ARRAY_PARAM_MONSTERS_MIN = new Array(6, 10, 12, 15, 18, 25);
static var ARRAY_PARAM_MONSTERS_MAX = new Array(8, 13, 16, 19, 24, 28);
static var ARRAY_PARAM_MONSTERS_LEVELS_MIN = new Array(1, 1, 1, 2, 3, 4);
static var ARRAY_PARAM_MONSTERS_LEVELS_MAX = new Array(1, 2, 3, 3, 4, 5);
static var ARRAY_PARAM_CHESTS = new Array(0.7, 0.6, 0.5, 0.4, 0.5, 0.55);
static var ARRAY_PARAM_FOUNTAINS_MIN = new Array(0, 1, 2, 3, 4, 5);
static var ARRAY_PARAM_FOUNTAINS_MAX = new Array(0, 1, 3, 4, 6, 7);
static var sROOM_START = "Start";
static var sROOM_END = "End";
static var sROOM_CHEST = "Chest";
static var sROOM_FOUNTAIN = "Fountain";
static var sROOM_NOTHING = "Nothing";
}
Symbol 441 MovieClip [__Packages.DataEnnemies] Frame 0
class DataEnnemies
{
function DataEnnemies () {
}
static function getMonster(_nDungeon, _nLevel) {
var _local1 = new Object();
var _local2;
var _local3;
switch (_nLevel) {
case 0 :
_local1.name = "Goblin";
_local1.armor = "None";
_local1.cock = "None";
_local1.head = "None";
_local1.monster = "Orc";
_local1.rock = 1;
_local1.paper = 1;
_local1.scissors = 1;
_local1.health = 4;
_local1.experience = 12;
_local1.movement = 0;
_local1.color = new flash.geom.ColorTransform(0.5, 1, 0.5, 1, 0, -20, 0, 0);
_local1.rockprob = 0;
_local1.paperprob = 100;
break;
case 1 :
_local2 = new Array("Goblin", "Orc");
_local3 = Math.floor(Math.random() * _local2.length);
switch (_local2[_local3]) {
case "Goblin" :
_local1.name = "Goblin";
_local1 = setPhysical(_local1, "None", sGOBLIN, "None", "None");
_local1 = setMonster(_local1, 1, 1, 1, 4, 12, 0, 33, 66);
_local1.color = new flash.geom.ColorTransform(0.5, 1, 0.5, 1, 0, -20, 0, 0);
break;
case "Orc" :
_local1.name = "Orc";
_local1 = setPhysical(_local1, "None", sORC, "None", "None");
_local1 = setMonster(_local1, 2, 2, 2, 6, 20, 0, 45, 72);
_local1.color = new flash.geom.ColorTransform(0.9, 1, 0.7, 1, 10, 0, 0, 0);
}
break;
case 2 :
_local2 = new Array("Snow Goblin", "Desert Goblin", "Brace Orc");
_local3 = Math.floor(Math.random() * _local2.length);
switch (_local2[_local3]) {
case "Snow Goblin" :
_local1.name = "Snow Goblin";
_local1 = setPhysical(_local1, "None", sGOBLIN, "None", "None");
_local1 = setMonster(_local1, 5, 5, 5, 13, 32, 0, 30, 60);
_local1.color = new flash.geom.ColorTransform(0.82, 1, 1, 1, 25, 56, 117, 0);
break;
case "Desert Goblin" :
_local1.name = "Desert Goblin";
_local1 = setPhysical(_local1, "None", sGOBLIN, "None", "None");
_local1 = setMonster(_local1, 4, 6, 5, 10, 32, 0, 33, 66);
_local1.color = new flash.geom.ColorTransform(1, 0.5, 0.5, 1, -20, 0, 0, 0);
break;
case "Brace Orc" :
_local1.name = "Brace Orc";
_local1 = setPhysical(_local1, "Braces", sORC, "None", "None");
_local1 = setMonster(_local1, 7, 5, 5, 21, 20, 1, 45, 72);
_local1.color = new flash.geom.ColorTransform(0.9, 1, 0.7, 1, 10, 0, 0, 0);
}
break;
case 3 :
_local2 = new Array("Leather Goblin", "Flamming Orc", "Chocolate Orc");
_local3 = Math.floor(Math.random() * _local2.length);
switch (_local2[_local3]) {
case "Leather Goblin" :
_local1.name = "Leather Goblin";
_local1 = setPhysical(_local1, "Leather", sGOBLIN, "None", "None");
_local1 = setMonster(_local1, 8, 8, 9, 91, 0, 1, 33, 66);
_local1.color = new flash.geom.ColorTransform(0.5, 1, 0.5, 1, 0, -20, 0, 0);
break;
case "Flamming Orc" :
_local1.name = "Flamming Orc";
_local1 = setPhysical(_local1, "None", sORC, "None", "None");
_local1 = setMonster(_local1, 18, 13, 18, 40, 20, 1, 25, 75);
_local1.color = new flash.geom.ColorTransform(0.58, 0.58, 0.66, 1, 137, 51, 91, 0);
break;
case "Chocolate Orc" :
_local1.name = "Chocolate Orc";
_local1 = setPhysical(_local1, "None", sORC, "None", "None");
_local1.color = new flash.geom.ColorTransform(0.48, 0.4, 0.4, 1, 51, 28, 0, 0);
_local1 = setMonster(_local1, 13, 0, 13, 50, 20, 1, 35, 35);
}
break;
case 4 :
_local2 = new Array("Armored Snow Goblin", "Armored Desert Goblin");
_local3 = Math.floor(Math.random() * _local2.length);
switch (_local2[_local3]) {
case "Armored Snow Goblin" :
_local1.name = "Armored Snow Goblin";
_local1 = setPhysical(_local1, "Leather", sGOBLIN, "None", "None");
_local1 = setMonster(_local1, 15, 15, 15, 70, 131, 0, 45, 72);
_local1.color = new flash.geom.ColorTransform(0.82, 1, 1, 1, 25, 56, 117, 0);
break;
case "Armored Desert Goblin" :
_local1.name = "Armored Desert Goblin";
_local1 = setPhysical(_local1, "Leather", sGOBLIN, "None", "None");
_local1 = setMonster(_local1, 19, 15, 19, 108, 139, 0, 45, 72);
_local1.color = new flash.geom.ColorTransform(1, 0.5, 0.5, 1, -20, 0, 0, 0);
break;
case "Doppelganger" :
_local1.name = "Doppelganger";
_local1.armor = "None";
_local1.cock = "None";
_local1.head = "None";
_local1.monster = sDOPPELGANGER;
_local1.color = new flash.geom.ColorTransform(1, 1, 1, 1, 0, 0, 0, 0);
_local1 = setMonster(_local1, 0, 0, 0, 0, 0, 0, 33, 66);
}
break;
case 5 :
_local2 = new Array("Dominating Orc");
_local3 = Math.floor(Math.random() * _local2.length);
switch (_local2[_local3]) {
case "Dominating Goblin" :
_local1.name = "Dominating Goblin";
_local1 = setPhysical(_local1, "Leather", sGOBLIN, "None", "None");
_local1 = setMonster(_local1, 20, 19, 22, 85, 155, 0, 45, 70);
_local1.color = new flash.geom.ColorTransform(0.65, 0.65, 0.65, 1, 38, 48, 1, 0);
break;
case "Dominating Orc" :
_local1.name = "Dominating Orc";
_local1 = setPhysical(_local1, "Braces", sORC, "None", "None");
_local1 = setMonster(_local1, 20, 19, 22, 85, 2, 0, 45, 70);
_local1.color = new flash.geom.ColorTransform(0.65, 0.65, 0.65, 1, 38, 48, 1, 0);
}
}
return(_local1);
}
static function setPhysical(_oMonster, _sArmor, _sBody, _sCock, _sHead) {
_oMonster.armor = _sArmor;
_oMonster.monster = _sBody;
_oMonster.cock = _sCock;
_oMonster.head = _sHead;
return(_oMonster);
}
static function setMonster(_oMonster, _nRock, _nPaper, _nScissors, _nHealth, _nExperience, _nMovement, _nRockProb, _nPaperProb) {
_oMonster.rock = _nRock;
_oMonster.paper = _nPaper;
_oMonster.scissors = _nScissors;
_oMonster.health = _nHealth;
_oMonster.experience = _nExperience;
_oMonster.movement = _nMovement;
_oMonster.rockprob = _nRockProb;
_oMonster.paperprob = _nPaperProb;
return(_oMonster);
}
static function getAttackState(_oPlayer, _oMonster, _sAttack) {
var _local1 = new Object();
_local1.playerarmor = _oPlayer.armor;
_local1.playerbody = _oPlayer.body;
_local1.playercock = _oPlayer.cock;
_local1.playerhead = _oPlayer.head;
_local1.monsterarmor = _oMonster.armor;
_local1.monsterbody = _oMonster.body;
_local1.monstercock = _oMonster.cock;
_local1.monsterhead = _oMonster.head;
switch (_oMonster.body) {
case sGOBLIN :
break;
case sORC :
break;
case sDOPPELGANGER :
}
return(_local1);
}
static var sGOBLIN = "Goblin";
static var sORC = "Orc";
static var sDOPPELGANGER = "Doppelganger";
}
Symbol 442 MovieClip [__Packages.DialogBox] Frame 0
class DialogBox extends library.Popup
{
var bKeyDown, oKeyListener, sText, setState, mcRef, oDialogOptions;
function DialogBox (_mcRef) {
super(_mcRef);
bKeyDown = false;
var _local3 = new Object();
oKeyListener = new Object();
oKeyListener.onKeyDown = library.Delegate.create(this, keyDown);
oKeyListener.onKeyUp = library.Delegate.create(this, keyUp);
Key.addListener(oKeyListener);
}
function setDialog(_sText) {
sText = _sText;
setState(library.Popup.sSTATE_IN);
}
function startIn() {
mcRef.mcState.mcState.mcText.txtText.text = sText;
}
function startIdle() {
mcRef.mcState.mcText.txtText.text = sText;
oDialogOptions = new DialogOptions(mcRef.mcOptions);
}
function doIdle() {
oDialogOptions.enterFrame();
if (bKeyDown) {
if (oDialogOptions.__get__getState() == library.Popup.sSTATE_HIDDEN) {
setState(library.Popup.sSTATE_OUT);
}
}
}
function startOut() {
mcRef.mcState.mcState.mcText.txtText.text = sText;
}
function keyDown() {
bKeyDown = true;
}
function keyUp() {
bKeyDown = false;
}
}
Symbol 443 MovieClip [__Packages.DialogOptions] Frame 0
class DialogOptions extends library.Popup
{
var aOptions, mcRef, sAnswer;
function DialogOptions (_mcRef) {
super(_mcRef);
}
function startIn() {
}
function startIdle() {
mcRef.mcState.txtOption1.text = aOptions[0].text;
mcRef.mcState.txtOption1.onPress = library.Delegate.create(this, setAnswer, aOptions[0].answer);
mcRef.mcState.txtOption2.text = aOptions[1].text;
mcRef.mcState.txtOption2.onPress = library.Delegate.create(this, setAnswer, aOptions[1].answer);
}
function startOut() {
}
function setOptions(_aOptions) {
aOptions = _aOptions;
}
function setAnswer(_sAnswer) {
sAnswer = _sAnswer;
}
function get answer() {
return(sAnswer);
}
}
Symbol 444 MovieClip [__Packages.Player] Frame 0
class Player
{
var sName, nRockAtt, nPaperAtt, nScissorsAtt, nRockAttMax, nPaperAttMax, nScissorsAttMax, nLight, nEquipment, nInventory, nLuck, nHealth, nMaxHealth, nBoostsRemaining, nExperience, nNextLevel, aInventory, aEquipment, sBody, sArmor, sHead, sCock, nLevel, oColor, oStomachColor, oCockColor;
function Player () {
sName = "";
nRockAtt = 2;
nPaperAtt = 2;
nScissorsAtt = 2;
nRockAttMax = 2;
nPaperAttMax = 2;
nScissorsAttMax = 2;
nLight = 1;
nEquipment = 3;
nInventory = 6;
nLuck = 0;
nHealth = 20;
nMaxHealth = 20;
nBoostsRemaining = 0;
nExperience = 0;
nNextLevel = 100;
aInventory = new Array();
aEquipment = new Array();
sBody = "";
sArmor = "";
sHead = "";
sCock = "";
nLevel = 1;
}
function addInventory(_oItem) {
var _local2 = aInventory.length < nInventory;
if (aInventory.length < nInventory) {
aInventory.push(_oItem);
}
return(_local2);
}
function setColor(_oColor, _oStomachColor, _oCockColor) {
oColor = _oColor;
oStomachColor = _oStomachColor;
oCockColor = _oCockColor;
}
function setPlayerData(_oObject) {
nRockAtt = _oObject.rock;
nPaperAtt = _oObject.paper;
nScissorsAtt = _oObject.scissors;
nRockAttMax = _oObject.rockmax;
nPaperAttMax = _oObject.papermax;
nScissorsAttMax = _oObject.scissorsmax;
sName = _oObject.name;
nLevel = _oObject.level;
nMaxHealth = _oObject.maxhealth;
nHealth = nMaxHealth;
nExperience = _oObject.experience;
nNextLevel = _oObject.nextLevel;
nLight = _oObject.light;
nLuck = _oObject.luck;
nEquipment = _oObject.equipment;
nInventory = _oObject.inventory;
nBoostsRemaining = _oObject.boostsRemaining;
aInventory = _oObject.aInventory;
aEquipment = _oObject.aEquipment;
sBody = _oObject.body;
sArmor = _oObject.armor;
sHead = _oObject.head;
sCock = _oObject.cock;
oColor = _oObject.color;
oStomachColor = _oObject.stomachcolor;
oCockColor = _oObject.cockcolor;
return(_oObject);
}
function getPlayerData() {
var _local2 = new Object();
_local2.color = oColor;
_local2.rock = nRockAtt;
_local2.paper = nPaperAtt;
_local2.scissors = nScissorsAtt;
_local2.rockmax = nRockAttMax;
_local2.papermax = nPaperAttMax;
_local2.scissorsmax = nScissorsAttMax;
_local2.health = nHealth;
_local2.maxhealth = nMaxHealth;
_local2.name = sName;
_local2.level = nLevel;
_local2.experience = nExperience;
_local2.nextLevel = nNextLevel;
_local2.boostsRemaining = nBoostsRemaining;
_local2.light = nLight;
_local2.luck = nLuck;
_local2.equipment = nEquipment;
_local2.inventory = nInventory;
_local2.aInventory = aInventory;
_local2.aEquipment = aEquipment;
_local2.body = sBody;
_local2.armor = sArmor;
_local2.head = sHead;
_local2.cock = sCock;
_local2.color = oColor;
_local2.stomachcolor = oStomachColor;
_local2.cockcolor = oCockColor;
return(_local2);
}
function setHealth(_nHealth) {
nHealth = _nHealth;
}
function setExperience(_nExperience) {
nExperience = nExperience + _nExperience;
}
function setEquipment(_aEquipment) {
aEquipment = _aEquipment;
}
function get light() {
return(nLight);
}
}
Symbol 445 MovieClip [__Packages.Shop] Frame 0
class Shop extends library.Popup
{
var nBoostRock, nBoostPaper, nBoostScissors, nBoostRockMax, nBoostPaperMax, nBoostScissorsMax, nBoostHealth, nBoostLight, nBoostLuck, nBoostInventory, nBoostEquipment, bSuccess, oSelector, mcRef, oBtnEnterLevel, oBtnPrev, oBtnNext, oPlayer, oBtnRock, oBtnPaper, oBtnScissors, oBtnHealth, oBtnLight, oBtnLuck, oBtnEquipment, oBtnInventory, setState, __get__success;
function Shop (_mcRef) {
super(_mcRef);
nBoostRock = 0;
nBoostPaper = 0;
nBoostScissors = 0;
nBoostRockMax = 0;
nBoostPaperMax = 0;
nBoostScissorsMax = 0;
nBoostHealth = 0;
nBoostLight = 0;
nBoostLuck = 0;
nBoostInventory = 0;
nBoostEquipment = 0;
bSuccess = false;
oSelector = new ShopLevelSelector();
}
function startIn() {
var _local2 = mcRef.mcState.mcState;
setScreen(_local2);
_local2.mcLevelUp._visible = false;
_local2.mcLevelRock._visible = false;
_local2.mcLevelPaper._visible = false;
_local2.mcLevelScissors._visible = false;
_local2.mcLevelHealth._visible = false;
_local2.mcLevelLight._visible = false;
_local2.mcLevelLuck._visible = false;
_local2.mcLevelEquipment._visible = false;
_local2.mcLevelInventory._visible = false;
oBtnEnterLevel = new library.MCButton(_local2.btnStartLevel);
oBtnPrev = new library.MCButton(_local2.mcPrevious);
oBtnNext = new library.MCButton(_local2.mcNext);
}
function startIdle() {
setScreen(mcRef.mcState);
oBtnEnterLevel = new library.MCButton(mcRef.mcState.btnStartLevel, library.Delegate.create(this, startLevel));
oBtnPrev = new library.MCButton(mcRef.mcState.mcPrevious, library.Delegate.create(oSelector, oSelector.changeLocation, -1));
oBtnNext = new library.MCButton(mcRef.mcState.mcNext, library.Delegate.create(oSelector, oSelector.changeLocation, 1));
showLevelUp(mcRef.mcState);
bSuccess = true;
}
function doIdle() {
mcRef.mcState.mcLevelUp.txtText.text = ("Level up\n" + oPlayer.boostsRemaining) + " boosts remaining";
oBtnEnterLevel.enterFrame();
oBtnRock.enterFrame();
oBtnPaper.enterFrame();
oBtnScissors.enterFrame();
oBtnHealth.enterFrame();
oBtnLight.enterFrame();
oBtnLuck.enterFrame();
oBtnEquipment.enterFrame();
oBtnInventory.enterFrame();
}
function showLevelUp(_mcRef) {
if (oPlayer.boostsRemaining > 0) {
_mcRef.mcLevelUp._visible = true;
_mcRef.mcLevelUp.txtText.text = ("Level up\n" + oPlayer.boostsRemaining) + " boosts remaining";
oBtnRock = new MCBtnLevelUp(_mcRef.mcLevelRock, "+" + nBoostRock, library.Delegate.create(this, addLevel, BattleCharacter.sSTATE_ROCK));
_mcRef.mcLevelRock._visible = nBoostRock > 0;
oBtnPaper = new MCBtnLevelUp(_mcRef.mcLevelPaper, "+" + nBoostPaper, library.Delegate.create(this, addLevel, BattleCharacter.sSTATE_PAPER));
_mcRef.mcLevelPaper._visible = nBoostPaper > 0;
oBtnScissors = new MCBtnLevelUp(_mcRef.mcLevelScissors, "+" + nBoostScissors, library.Delegate.create(this, addLevel, BattleCharacter.sSTATE_SCISSORS));
_mcRef.mcLevelScissors._visible = nBoostScissors > 0;
oBtnHealth = new MCBtnLevelUp(_mcRef.mcLevelHealth, "+" + nBoostHealth, library.Delegate.create(this, addLevel, "Health"));
_mcRef.mcLevelHealth._visible = nBoostHealth > 0;
oBtnLight = new MCBtnLevelUp(_mcRef.mcLevelLight, "+" + nBoostLight, library.Delegate.create(this, addLevel, "Light"));
_mcRef.mcLevelLight._visible = nBoostLight > 0;
oBtnEquipment = new MCBtnLevelUp(_mcRef.mcLevelEquipment, "+" + nBoostEquipment, library.Delegate.create(this, addLevel, "Equipment"));
_mcRef.mcLevelEquipment._visible = nBoostEquipment > 0;
oBtnInventory = new MCBtnLevelUp(_mcRef.mcLevelInventory, "+" + nBoostInventory, library.Delegate.create(this, addLevel, "Inventory"));
_mcRef.mcLevelInventory._visible = nBoostInventory > 0;
oBtnLuck = new MCBtnLevelUp(_mcRef.mcLevelLuck, "+" + nBoostLuck, library.Delegate.create(this, addLevel, "Luck"));
_mcRef.mcLevelLuck._visible = nBoostLuck > 0;
} else {
_mcRef.mcLevelUp._visible = false;
_mcRef.mcLevelRock._visible = false;
_mcRef.mcLevelPaper._visible = false;
_mcRef.mcLevelScissors._visible = false;
_mcRef.mcLevelHealth._visible = false;
_mcRef.mcLevelLight._visible = false;
_mcRef.mcLevelLuck._visible = false;
_mcRef.mcLevelEquipment._visible = false;
_mcRef.mcLevelInventory._visible = false;
}
}
function startOut() {
var _local2 = mcRef.mcState.mcState;
setScreen(_local2);
_local2.mcLevelUp._visible = false;
_local2.mcLevelRock._visible = false;
_local2.mcLevelPaper._visible = false;
_local2.mcLevelScissors._visible = false;
_local2.mcLevelHealth._visible = false;
_local2.mcLevelLight._visible = false;
_local2.mcLevelLuck._visible = false;
_local2.mcLevelEquipment._visible = false;
_local2.mcLevelInventory._visible = false;
oBtnEnterLevel = new library.MCButton(_local2.btnStartLevel);
oBtnPrev = new library.MCButton(_local2.mcPrevious);
oBtnNext = new library.MCButton(_local2.mcNext);
}
function setEquipmentStat(_sStat, _txtField) {
var _local5 = _txtField.getTextFormat();
var _local3 = 0;
var _local2;
_local2 = 0;
while (_local2 < oPlayer.aEquipment.length) {
_local3 = _local3 + oPlayer.aEquipment[_local2][_sStat];
_local2++;
}
if (_local3 < 0) {
_local5.color = 6684672 /* 0x660000 */;
} else if (_local3 > 0) {
_local5.color = 26112;
} else {
_local5.color = 0;
}
_txtField.setNewTextFormat(_local5);
_txtField.text = oPlayer[_sStat];
}
function setScreen(_mcRef) {
oSelector.setMc(_mcRef.mcProgression);
_mcRef.mcName.txtName.text = oPlayer.name;
_mcRef.mcLevel.txtLevel.text = "Level " + oPlayer.level;
setEquipmentStat("rock", _mcRef.mcRock.txtText);
setEquipmentStat("paper", _mcRef.mcPaper.txtText);
setEquipmentStat("scissors", _mcRef.mcScissors.txtText);
setEquipmentStat("rockmax", _mcRef.txtRockMax);
setEquipmentStat("papermax", _mcRef.txtPaperMax);
setEquipmentStat("scissorsmax", _mcRef.txtScissorsMax);
setEquipmentStat("maxhealth", _mcRef.mcHealth.txtText);
setEquipmentStat("light", _mcRef.mcLight.txtText);
setEquipmentStat("luck", _mcRef.mcLuck.txtText);
_mcRef.txtEquipment.text = oPlayer.equipment;
_mcRef.txtInventory.text = oPlayer.inventory;
_mcRef.mcNextLevel.txtNextLevel.text = "XP to next Level: " + Math.max(0, oPlayer.nextLevel - oPlayer.experience);
var _local5 = new flash.geom.Transform(_mcRef.mcPlayerSmall);
_local5.colorTransform = oPlayer.color;
_local5 = new flash.geom.Transform(_mcRef.mcPlayerBig);
_local5.colorTransform = oPlayer.color;
switch (oPlayer.equipment) {
case 3 :
_mcRef.mcEquipment.gotoAndStop("Three");
break;
case 4 :
_mcRef.mcEquipment.gotoAndStop("Four");
break;
case 5 :
_mcRef.mcEquipment.gotoAndStop("Five");
break;
case 6 :
_mcRef.mcEquipment.gotoAndStop("Six");
}
switch (oPlayer.inventory) {
case 6 :
_mcRef.mcInventory.gotoAndStop("Six");
break;
case 7 :
_mcRef.mcInventory.gotoAndStop("Seven");
break;
case 8 :
_mcRef.mcInventory.gotoAndStop("Eight");
break;
case 9 :
_mcRef.mcInventory.gotoAndStop("Nine");
break;
case 10 :
_mcRef.mcInventory.gotoAndStop("Ten");
break;
case 11 :
_mcRef.mcInventory.gotoAndStop("Eleven");
break;
case 12 :
_mcRef.mcInventory.gotoAndStop("Twelve");
break;
case 13 :
_mcRef.mcInventory.gotoAndStop("Thirteen");
break;
case 14 :
_mcRef.mcInventory.gotoAndStop("Fourteen");
break;
case 15 :
_mcRef.mcInventory.gotoAndStop("Fifteen");
break;
case 16 :
_mcRef.mcInventory.gotoAndStop("Sixteen");
break;
case 17 :
_mcRef.mcInventory.gotoAndStop("Seventeen");
break;
case 18 :
_mcRef.mcInventory.gotoAndStop("Eighteen");
}
var _local4;
var _local2;
_local2 = 0;
while (_local2 < oPlayer.aInventory.length) {
_mcRef["inventory" + _local2].removeMovieClip();
_local4 = _mcRef.attachMovie("mcItem", "inventory" + _local2, _mcRef.getNextHighestDepth());
_local4.gotoAndStop(oPlayer.aInventory[_local2].item);
_local4._x = _mcRef.mcInventory["mcItem" + (_local2 + 1)]._x + _mcRef.mcInventory._x;
_local4._y = _mcRef.mcInventory["mcItem" + (_local2 + 1)]._y + _mcRef.mcInventory._y;
_local4.onPress = library.Delegate.create(this, clickItem, _local4, oPlayer.aInventory[_local2], "inventory", _local2);
_local2++;
}
_local2 = 0;
while (_local2 < oPlayer.aEquipment.length) {
_mcRef["equipment" + _local2].removeMovieClip();
_local4 = _mcRef.attachMovie("mcItem", "equipment" + _local2, _mcRef.getNextHighestDepth());
_local4.gotoAndStop(oPlayer.aEquipment[_local2].item);
_local4._x = _mcRef.mcEquipment["mcItem" + (_local2 + 1)]._x + _mcRef.mcEquipment._x;
_local4._y = _mcRef.mcEquipment["mcItem" + (_local2 + 1)]._y + _mcRef.mcEquipment._y;
_local4.onPress = library.Delegate.create(this, clickItem, _local4, oPlayer.aEquipment[_local2], "equipment", _local2);
_local2++;
}
}
function clickItem(_mcItem, _oItem, _sLocation, _nPosition) {
_mcItem.swapDepths(_mcItem._parent.getNextHighestDepth());
_mcItem.startDrag();
_mcItem.onMouseUp = library.Delegate.create(this, dropItem, _mcItem, _oItem, _sLocation, _nPosition);
}
function dropItem(_mcItem, _oItem, _sLocation, _nPosition) {
_mcItem.stopDrag();
_mcItem.onMouseUp = undefined;
delete _mcItem.onMouseUp;
var _local8 = false;
var _local3;
var _local9;
if (_mcItem._parent.mcInventory.hitTest(_root._xmouse, _root._ymouse)) {
_local3 = 0;
while (_local3 < oPlayer.inventory) {
if (_mcItem._parent.mcInventory["mcItem" + (_local3 + 1)].hitTest(_root._xmouse, _root._ymouse)) {
if (oPlayer.aInventory.length > _local3) {
if (_sLocation == "inventory") {
oPlayer.aInventory[_nPosition] = oPlayer.aInventory[_local3];
oPlayer.aInventory[_local3] = _oItem;
} else {
changeEquipment(oPlayer.aInventory[_local3], 1);
changeEquipment(_oItem, -1);
oPlayer.aEquipment[_nPosition] = oPlayer.aInventory[_local3];
oPlayer.aInventory[_local3] = _oItem;
}
} else {
oPlayer.aInventory.push(_oItem);
if (_sLocation == "inventory") {
oPlayer.aInventory.splice(_nPosition, 1);
} else {
changeEquipment(oPlayer.aEquipment[_nPosition], -1);
_mcItem._parent["equipment" + (oPlayer.aEquipment.length - 1)].swapDepths(_mcItem._parent.getNextHighestDepth());
_mcItem._parent["equipment" + (oPlayer.aEquipment.length - 1)].removeMovieClip();
oPlayer.aEquipment.splice(_nPosition, 1);
}
}
_local8 = true;
break;
}
_local3++;
}
} else if (_mcItem._parent.mcEquipment.hitTest(_root._xmouse, _root._ymouse)) {
_local3 = 0;
while (_local3 < oPlayer.equipment) {
if (_mcItem._parent.mcEquipment["mcItem" + (_local3 + 1)].hitTest(_root._xmouse, _root._ymouse)) {
if (oPlayer.aEquipment.length > _local3) {
if (_sLocation == "inventory") {
changeEquipment(_oItem, 1);
changeEquipment(oPlayer.aEquipment[_local3], -1);
oPlayer.aInventory[_nPosition] = oPlayer.aEquipment[_local3];
oPlayer.aEquipment[_local3] = _oItem;
} else {
oPlayer.aEquipment[_nPosition] = oPlayer.aEquipment[_local3];
oPlayer.aEquipment[_local3] = _oItem;
}
} else {
changeEquipment(_oItem, 1);
oPlayer.aEquipment.push(_oItem);
if (_sLocation == "inventory") {
_mcItem._parent["inventory" + (oPlayer.aInventory.length - 1)].swapDepths(_mcItem._parent.getNextHighestDepth());
_mcItem._parent["inventory" + (oPlayer.aInventory.length - 1)].removeMovieClip();
oPlayer.aInventory.splice(_nPosition, 1);
} else {
oPlayer.aEquipment.splice(_nPosition, 1);
}
}
_local8 = true;
break;
}
_local3++;
}
} else if (_mcItem._parent.mcSell.mcItem.hitTest(_root._xmouse, _root._ymouse)) {
oPlayer.experience = oPlayer.experience + _oItem.sell;
setLevelUp();
showLevelUp(_mcItem._parent);
if (_sLocation == "inventory") {
_mcItem._parent["inventory" + (oPlayer.aInventory.length - 1)].swapDepths(_mcItem._parent.getNextHighestDepth());
_mcItem._parent["inventory" + (oPlayer.aInventory.length - 1)].removeMovieClip();
oPlayer.aInventory.splice(_nPosition, 1);
} else {
changeEquipment(_oItem, -1);
_mcItem._parent["equipment" + (oPlayer.aEquipment.length - 1)].swapDepths(_mcItem._parent.getNextHighestDepth());
_mcItem._parent["equipment" + (oPlayer.aEquipment.length - 1)].removeMovieClip();
oPlayer.aEquipment.splice(_nPosition, 1);
}
}
_mcItem.removeMovieClip();
setScreen(mcRef.mcState);
}
function setShop(_oPlayer) {
if (bSuccess) {
oSelector.addLevel();
}
oPlayer = _oPlayer;
setLevelUp();
setState(library.Popup.sSTATE_IN);
}
function changeEquipment(_oItem, _nMultipler) {
oPlayer.rock = oPlayer.rock + (_oItem.rock * _nMultipler);
oPlayer.paper = oPlayer.paper + (_oItem.paper * _nMultipler);
oPlayer.scissors = oPlayer.scissors + (_oItem.scissors * _nMultipler);
oPlayer.rockmax = oPlayer.rockmax + (_oItem.rockmax * _nMultipler);
oPlayer.papermax = oPlayer.papermax + (_oItem.papermax * _nMultipler);
oPlayer.scissorsmax = oPlayer.scissorsmax + (_oItem.scissorsmax * _nMultipler);
oPlayer.maxhealth = oPlayer.maxhealth + (_oItem.maxhealth * _nMultipler);
oPlayer.health = oPlayer.maxhealth;
oPlayer.light = oPlayer.light + (_oItem.light * _nMultipler);
oPlayer.luck = oPlayer.luck + (_oItem.luck * _nMultipler);
}
function setLevelUp() {
trace((("setLevelUp: " + oPlayer.experience) + " >= ") + oPlayer.nextLevel);
if ((oPlayer.experience >= oPlayer.nextLevel) && (oPlayer.boostsRemaining <= 0)) {
var _local2 = DataLevelUp.levelUp(oPlayer.level);
nBoostRock = nBoostRock + _local2.rock;
nBoostPaper = nBoostPaper + _local2.paper;
nBoostScissors = nBoostScissors + _local2.scissors;
nBoostHealth = nBoostHealth + _local2.health;
nBoostLight = nBoostLight + _local2.light;
nBoostInventory = nBoostInventory + _local2.inventory;
nBoostEquipment = nBoostEquipment + _local2.equipment;
nBoostLuck = nBoostLuck + _local2.luck;
oPlayer.boostsRemaining = oPlayer.boostsRemaining + 2;
oPlayer.level++;
oPlayer.nextLevel = _local2.nextlevel;
}
}
function setPlayerColor(_oColor) {
oPlayer.color = _oColor;
var _local2 = new flash.geom.Transform(mcRef.mcState.mcState.mcPlayerSmall);
_local2.colorTransform = oPlayer.color;
_local2 = new flash.geom.Transform(mcRef.mcState.mcState.mcPlayerBig);
_local2.colorTransform = oPlayer.color;
}
function setName(_sName) {
oPlayer.name = _sName;
mcRef.mcState.mcState.txtName.text = oPlayer.name;
}
function addLevel(_sType) {
switch (_sType) {
case BattleCharacter.sSTATE_ROCK :
oPlayer.rock = oPlayer.rock + nBoostRock;
nBoostRock = 0;
break;
case BattleCharacter.sSTATE_PAPER :
oPlayer.paper = oPlayer.paper + nBoostPaper;
nBoostPaper = 0;
break;
case BattleCharacter.sSTATE_SCISSORS :
oPlayer.scissors = oPlayer.scissors + nBoostScissors;
nBoostScissors = 0;
break;
case "Health" :
oPlayer.maxhealth = oPlayer.maxhealth + nBoostHealth;
oPlayer.health = oPlayer.maxhealth;
nBoostHealth = 0;
break;
case "Light" :
oPlayer.light = oPlayer.light + nBoostLight;
nBoostLight = 0;
break;
case "Luck" :
oPlayer.luck = oPlayer.luck + nBoostLuck;
nBoostLuck = 0;
break;
case "Inventory" :
oPlayer.inventory = oPlayer.inventory + nBoostInventory;
nBoostInventory = 0;
break;
case "Equipment" :
oPlayer.equipment = oPlayer.equipment + nBoostEquipment;
nBoostEquipment = 0;
}
oPlayer.boostsRemaining--;
setLevelUp();
setScreen(mcRef.mcState);
showLevelUp(mcRef.mcState);
}
function startLevel() {
setState(library.Popup.sSTATE_OUT);
}
function playerData() {
return(oPlayer);
}
function get level() {
return(oSelector.__get__node());
}
function set success(_bSuccess) {
bSuccess = _bSuccess;
//return(__get__success());
}
}
Symbol 446 MovieClip [__Packages.ShopLevelSelector] Frame 0
class ShopLevelSelector
{
var mcRef, nNode, nDungeon, aLocations;
function ShopLevelSelector (_mcRef) {
mcRef = _mcRef;
nNode = 0;
nDungeon = 0;
aLocations = DataLocations.getLocations();
}
function setMc(_mcRef) {
mcRef = _mcRef;
setLocation();
}
function addLevel() {
trace("addLevel: " + _nNode);
var _nNode = Math.min(nNode + 1, aLocations[nDungeon].aNodeUnlocked.length - 1);
aLocations[nDungeon].aNodeUnlocked[_nNode] = true;
nNode = _nNode;
}
function changeLocation(_nNext) {
var _local2 = Math.min(Math.max(nNode + _nNext, 0), DataLocations.nNODES_PER_LOCATION - 1);
if (aLocations[nDungeon].aNodeUnlocked.length > _local2) {
if (aLocations[nDungeon].aNodeUnlocked[_local2]) {
nNode = _local2;
setLocation();
}
}
}
function setLocation() {
var _local2;
_local2 = 0;
while (_local2 < aLocations[nDungeon].aNodeUnlocked.length) {
switch (_local2) {
case nNode :
mcRef.mcProgression["mcNode" + (_local2 + 1)].gotoAndStop(sSTATE_NODE_CURRENT);
break;
case DataLocations.nNODES_PER_LOCATION - 1 :
if (aLocations[nDungeon].aNodeUnlocked[_local2]) {
mcRef.mcProgression["mcNode" + (_local2 + 1)].gotoAndStop(sSTATE_NODE_BOSS);
} else {
mcRef.mcProgression["mcNode" + (_local2 + 1)].gotoAndStop(sSTATE_NODE_BOSS_LOCKED);
}
break;
default :
if (aLocations[nDungeon].aNodeUnlocked[_local2]) {
if (aLocations[nDungeon].aNodeUnlocked[_local2 + 1]) {
mcRef.mcProgression["mcNode" + (_local2 + 1)].gotoAndStop(sSTATE_NODE_COMPLETED);
} else {
mcRef.mcProgression["mcNode" + (_local2 + 1)].gotoAndStop(sSTATE_NODE_NEXT);
}
} else {
mcRef.mcProgression["mcNode" + (_local2 + 1)].gotoAndStop(sSTATE_NODE_LOCKED);
}
}
_local2++;
}
}
function get node() {
return(nNode);
}
static var sSTATE_NODE_COMPLETED = "Completed";
static var sSTATE_NODE_NEXT = "Next";
static var sSTATE_NODE_LOCKED = "Locked";
static var sSTATE_NODE_BOSS_LOCKED = "BossLocked";
static var sSTATE_NODE_BOSS = "Boss";
static var sSTATE_NODE_BOSS_COMPLETED = "BossCompleted";
static var sSTATE_NODE_CURRENT = "Current";
}
Symbol 447 MovieClip [__Packages.DataLocations] Frame 0
class DataLocations
{
function DataLocations () {
}
static function getLocations() {
var _local2;
var _local4 = new Array();
var _local3;
var _local1;
_local3 = 0;
while (_local3 < aLocations.length) {
_local2 = new Object();
_local2.name = aLocations[_local3];
_local2.aNodeUnlocked = new Array();
_local1 = 0;
while (_local1 < nNODES_PER_LOCATION) {
_local2.aNodeUnlocked.push(_local1 == 0);
_local1++;
}
_local4.push(_local2);
_local3++;
}
return(_local4);
}
static var nNODES_PER_LOCATION = 6;
static var aLocations = new Array("Dungeon");
}
Symbol 448 MovieClip [__Packages.MCBtnLevelUp] Frame 0
class MCBtnLevelUp extends library.MCButton
{
var sText, mcRef;
function MCBtnLevelUp (_mcRef, _sText, _fFunction) {
super(_mcRef, _fFunction);
sText = _sText;
mcRef.mcText.txtText.text = sText;
}
function startIdle() {
mcRef.mcText.txtText.text = sText;
}
function startOver() {
mcRef.mcText.txtText.text = sText;
}
function startDown() {
mcRef.mcText.txtText.text = sText;
}
}
Symbol 449 MovieClip [__Packages.DataLevelUp] Frame 0
class DataLevelUp
{
function DataLevelUp () {
}
static function levelUp(_nLevel) {
var _local1 = new Object();
if (aROCK.length < _nLevel) {
_nLevel = 0;
} else {
_local1.rock = aROCK[_nLevel];
_local1.paper = aPAPER[_nLevel];
_local1.scissors = aSCISSORS[_nLevel];
_local1.health = aHEALTH[_nLevel];
_local1.light = aLIGHT[_nLevel];
_local1.luck = aLUCK[_nLevel];
_local1.inventory = aINVENTORY[_nLevel];
_local1.equipment = aEQUIPMENT[_nLevel];
_local1.nextlevel = aNEXT_LEVEL[_nLevel];
}
return(_local1);
}
static var aLEVEL = new Array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10);
static var aROCK = new Array(0, 1, 1, 1, 2, 2, 2, 3, 3, 5, 8);
static var aPAPER = new Array(0, 1, 1, 1, 2, 2, 2, 3, 3, 5, 8);
static var aSCISSORS = new Array(0, 1, 1, 1, 2, 2, 2, 3, 3, 5, 8);
static var aHEALTH = new Array(0, 5, 7, 8, 10, 12, 15, 17, 20, 23, 30);
static var aLIGHT = new Array(0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0);
static var aINVENTORY = new Array(0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0);
static var aEQUIPMENT = new Array(0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0);
static var aLUCK = new Array(0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0);
static var aNEXT_LEVEL = new Array(100, 350, 700, 1100, 1600, 2150, 2700, 3400, 4300, 5300, 6500, 8000, 10000, 999999);
static var nMAX_LEVEL = 11;
}
Symbol 450 MovieClip [__Packages.DataItems] Frame 0
class DataItems
{
function DataItems () {
}
static function getItem(_nDungeon) {
var _local1 = new Array();
var _local2;
var _local3;
switch (_nDungeon + 1) {
case 0 :
case 1 :
_local1 = new Array("Sock", "Dildo", "Condom", "GummiBear", "Rock");
_local2 = Math.floor(Math.random() * _local1.length);
break;
case 2 :
_local1 = new Array("Sock", "Dildo", "Condom", "EnergyDrink", "Kamasutra", "Chocolate", "Gem", "Rock", "Rock");
_local2 = Math.floor(Math.random() * _local1.length);
break;
case 3 :
case 4 :
case 5 :
case 6 :
_local1 = new Array("BrightToothpaste", "AnalBeads", "CockRing", "EnergyDrink", "Kamasutra", "Chocolate", "Gem", "Rock", "Rock");
_local2 = Math.floor(Math.random() * _local1.length);
}
_local3 = getDescription(_local1[_local2]);
return(_local3);
}
static function getDescription(_sName) {
var _local1 = new Object();
_local1.sell = 0;
_local1.rock = 0;
_local1.paper = 0;
_local1.scissors = 0;
_local1.health = 0;
_local1.maxhealth = 0;
_local1.light = 0;
_local1.luck = 0;
_local1.desc = "";
_local1.name = _sName;
_local1.item = _sName;
_local1.color = new flash.geom.ColorTransform(1, 1, 1, 1, 0, 0, 0, 0);
switch (_sName) {
case "BrightToothpaste" :
_local1.sell = 51;
_local1.scissors = 5;
_local1.light = 1;
_local1.desc = "Makes your mouth more appealing and your surroundings brighter.";
_local1.name = "Bright Toothpaste";
_local1.discover = "a pack of bright toothpaste";
break;
case "Dildo" :
_local1.sell = 42;
_local1.paper = 3;
_local1.desc = "Improves your anal power.";
_local1.name = "Anal Beads";
_local1.discover = "a purple dildo";
break;
case "AnalBeads" :
_local1.sell = 82;
_local1.paper = 7;
_local1.desc = "Improves your anal power.";
_local1.name = "Anal Beads";
_local1.discover = "anal beads";
break;
case "Condom" :
_local1.sell = 42;
_local1.scissors = 3;
_local1.rock = 1;
_local1.desc = "Improves your anal power.";
_local1.name = "a tasty condom";
_local1.discover = "a condom";
break;
case "CockRing" :
_local1.sell = 50;
_local1.rock = 6;
_local1.maxhealth = 5;
_local1.desc = "Keeps your erection hard as steel.";
_local1.name = "Cock Ring";
_local1.discover = "a cock ring";
break;
case "EnergyDrink" :
_local1.sell = 15;
_local1.health = 15;
_local1.desc = "Picks you right back up when you fall.";
_local1.name = "POW Energy Drink";
_local1.discover = "a can of POW energy drink";
break;
case "Kamasutra" :
_local1.sell = 300;
_local1.desc = "Teaches you all you need to know about sex.";
_local1.name = "Kama Sutra";
_local1.discover = "a copy of the Kama Sutra";
break;
case "Gem" :
_local1.sell = 44;
_local1.maxhealth = 10;
_local1.desc = "Teaches you all you need to know about sex.";
_local1.name = "New Age Gem";
_local1.discover = "a new age gem";
break;
case "Rock" :
_local1.sell = 1;
_local1.desc = "Sell this to become one rock less dumb.";
_local1.name = "Rock";
_local1.discover = "a rock";
break;
case "Chocolate" :
_local1.sell = 72;
_local1.health = 55;
_local1.desc = "Chocolate: the most desired.";
_local1.name = "Kama Sutra";
_local1.discover = "a chocolate bunny";
break;
case "Sock" :
_local1.sell = 72;
_local1.rock = 3;
_local1.desc = "Chocolate: the most desired.";
_local1.name = "Kama Sutra";
_local1.discover = "a sock";
break;
case "GummiBear" :
_local1.sell = 5;
_local1.health = 3;
_local1.desc = "Chocolate: the most desired.";
_local1.name = "Kama Sutra";
_local1.discover = "a gummi bear";
}
return(_local1);
}
}
Symbol 451 MovieClip [__Packages.ContinueButton] Frame 0
class ContinueButton extends library.MCButton
{
var mcRef, sMessage;
function ContinueButton (_mcRef, _fClick, _sMessage) {
super(_mcRef, _fClick);
mcRef.onRollOver = library.Delegate.create(this, rollOver);
mcRef.onPress = library.Delegate.create(this, press);
sMessage = _sMessage;
}
function rollOver() {
mcRef.gotoAndStop("Over");
if (sMessage == "") {
mcRef.mcNotice._visible = false;
} else {
mcRef.mcNotice._visible = true;
mcRef.mcNotice.txtText.text = sMessage;
}
}
function press() {
mcRef.gotoAndStop("Down");
if (sMessage == "") {
mcRef.mcNotice._visible = false;
} else {
mcRef.mcNotice._visible = true;
mcRef.mcNotice.txtText.text = sMessage;
}
}
}
Symbol 452 MovieClip [__Packages.CharSelect] Frame 0
class CharSelect
{
var mcRef, sName, oColor;
function CharSelect (_mcRef) {
mcRef = _mcRef;
mcRef.mcRed.onPress = library.Delegate.create(this, changeColor, sRED);
mcRef.mcBlue.onPress = library.Delegate.create(this, changeColor, sBLUE);
mcRef.mcYellow.onPress = library.Delegate.create(this, changeColor, sYELLOW);
mcRef.mcGreen.onPress = library.Delegate.create(this, changeColor, sGREEN);
mcRef.mcBrown.onPress = library.Delegate.create(this, changeColor, sBROWN);
mcRef.mcPink.onPress = library.Delegate.create(this, changeColor, sPINK);
mcRef.mcWhite.onPress = library.Delegate.create(this, changeColor, sWHITE);
mcRef.mcDark.onPress = library.Delegate.create(this, changeColor, sDARK);
var _local3 = new Array(sRED, sBLUE, sYELLOW, sGREEN, sBROWN, sPINK, sWHITE, sDARK);
var _local2 = Math.floor(Math.random() * _local3.length);
changeColor(_local3[_local2]);
var _local4 = new Array("Lusty", "Mike", "Caesar", "Vuvuzela", "Duke", "Kit", "Foxnor", "Punk", "Slippy", "Blaze");
_local2 = Math.floor(Math.random() * _local4.length);
mcRef.mcName.txtName.text = _local4[_local2];
sName = mcRef.mcName.txtName.text;
mcRef.mcName.txtName.onChanged = library.Delegate.create(this, changeText);
}
function changeText() {
sName = mcRef.mcName.txtName.text;
}
function changeColor(_sColor) {
var _local4;
var _local2 = new flash.geom.Transform(mcRef.mcPlayerSmall);
switch (_sColor) {
case sRED :
oColor = new flash.geom.ColorTransform(1, 0.3, 0.3, 1, 30, 0, 0, 0);
break;
case sBLUE :
oColor = new flash.geom.ColorTransform(0.2, 0.5, 1, 1, 5, 15, 75, 0);
break;
case sYELLOW :
oColor = new flash.geom.ColorTransform(1, 1, 0.25, 1, 30, 25, 25, 0);
break;
case sGREEN :
oColor = new flash.geom.ColorTransform(0, 1, 0, 1, 0, 15, 0, 0);
break;
case sBROWN :
oColor = new flash.geom.ColorTransform(1, 0.7, 0.5, 1, -10, 0, 0, 0);
break;
case sPINK :
oColor = new flash.geom.ColorTransform(1, 0.7, 0.9, 1, 97, 51, 102, 0);
break;
case sDARK :
oColor = new flash.geom.ColorTransform(0.65, 0.65, 0.65, 1, 0, 0, 0, 0);
break;
case sWHITE :
oColor = new flash.geom.ColorTransform(1, 1, 1, 1, 0, 0, 0, 0);
}
_local2.colorTransform = oColor;
_local2 = new flash.geom.Transform(mcRef.mcPlayerBig);
_local2.colorTransform = oColor;
}
function get Color() {
return(oColor);
}
function get name() {
return(sName);
}
static var sRED = "Red";
static var sBLUE = "Blue";
static var sYELLOW = "Yellow";
static var sGREEN = "Green";
static var sBROWN = "Brown";
static var sPINK = "Pink";
static var sDARK = "Dark";
static var sWHITE = "White";
}
Symbol 303 MovieClip Frame 5
stop();
Symbol 304 MovieClip Frame 5
stop();
Symbol 315 MovieClip Frame 5
stop();
Symbol 316 MovieClip Frame 5
stop();
Symbol 327 MovieClip Frame 5
stop();
Symbol 328 MovieClip Frame 5
stop();