Frame 1
_global.debugMode = false;
infoTitle.text = "";
infoText.text = "";
startButton.label.text = "";
errorTitle._visible = false;
errorText._visible = false;
warnLabel.text = "";
startButton._visible = false;
if (debugMode) {
warnLabel.text = "Warning: Debug client";
gameData = (((((((((((((((((("<gamedata timelimit=\"300\" seed=\"1188891958\" characters=\"N R QU L N E E S I A D L D R P O W M S L I G Z I A J R O A I O R T E R A W A R S E I M B QU X R H T H E M G QU I A A L QU I O H I F T T A T A O K D A T G I QU E E E R E C T O R E E D L R L A I G E T R U E G S D T C Y U N D T E I L E H A S A T T D E E P F G S D T C Y U N D T E I L E H A S A T T D E E P F \" scores=\"2 1 7 2 2 1 1 1 1 1 2 2 2 1 3 1 5 3 1 2 1 2 10 1 1 8 1 1 1 1 1 1 1 1 1 1 5 1 1 1 1 1 3 3 7 8 1 4 1 4 1 3 2 7 1 1 1 2 7 1 1 4 1 4 1 1 1 1 1 1 5 2 1 1 2 1 7 1 1 1 1 1 4 1 1 1 1 1 2 2 1 2 1 1 2 1 1 1 2 1 2 1 2 1 4 5 2 2 2 1 1 1 2 1 4 1 1 1 1 1 2 1 1 3 4 2 1 2 1 4 5 2 2 2 1 1 1 2 1 4 1 1 1 1 1 2 1 1 3 4 \" bonuscoords=\"0 0 1 0 2 0 3 0 4 0 0 1 1 1 2 1 3 1 4 1 0 2 1 2 2 2 3 2 4 2 0 3 1 3 2 3 3 3 4 3 0 4 1 4 2 4 3 4 4 4 \"><text id=\"welcome\">\u00E4Welcome to Keyword</text><text id=\"round\">\u00E4Round</text><text id=\"button_play\">\u00E4Play!</text><text id=\"instuctions1\">\u00E4The aim of this game is to...\n\n\n\njhasdasda\nfdadaskjda\n\n\n\n\n\n\n\njdas</text><text id=\"the_game_will_end_in\">\u00E4The game will end in</text>" + "<text id=\"the_game_will_end\">\u00E4The game will end in {0} seconds</text>") + "<text id=\"game_over\">\u00E4Game over!</text>") + "<text id=\"round1_title\">\u00E4Round 1</text>") + "<text id=\"round2_title\">\u00E4Round 2</text>") + "<text id=\"round3_title\">\u00E4Round 3</text>") + "<text id=\"round4_title\">\u00E4Round 4</text>") + "<text id=\"round5_title\">\u00E4Round 5</text>") + "<text id=\"roundx_title\">\u00E4Bonus round</text>") + "<text id=\"did_not_qualify\">\u00E4You did not qualify for the bonus round</text>") + "<text id=\"total_score\">\u00E4Total score</text>") + "<text id=\"score\">\u00E4Score</text>") + "<text id=\"out_of_time\">\u00E4You ran out of time</text>") + "<text id=\"seconds\">\u00E4seconds</text>") + "<text id=\"time_left\">\u00E4Time Left</text>") + "<text id=\"bonus\">\u00E4Bonus</text>") + "<text id=\"best_word\">\u00E4Best word</text>") + "<text id=\"end_round\">\u00E4End Round</text>") + "<text id=\"end_game\">\u00E4End Game</text>") + "</gamedata>";
}
var inited = false;
onEnterFrame = function () {
if ((!inited) && (gameData != undefined)) {
infoLabel.text = gameData.toString();
inited = true;
startButton._visible = true;
board.initGame();
infoTitle.text = _global.textMappings.welcome;
var _local2 = _global.textMappings.instuctions1;
_local2 = _local2.split("\r\n").join(newline);
_local2 = _local2.split("\n\r").join(newline);
_local2 = _local2.split("\r").join(newline);
_local2 = _local2.split(newline).join(newline);
infoText.text = _local2;
endGameLabel.text = _global.textMappings.end_game;
}
if (response != undefined) {
board.responseReceived(response);
response = undefined;
}
};
Symbol 50 MovieClip [ReflectoText] Frame 1
#initclip 25
Object.registerClass("ReflectoText", com.midasplayer.wordbattle.ReflectoText);
#endinitclip
stop();
Symbol 50 MovieClip [ReflectoText] Frame 15
stop();
Symbol 71 MovieClip Frame 1
stop();
Symbol 72 MovieClip Frame 1
stop();
Symbol 72 MovieClip Frame 2
stop();
Symbol 72 MovieClip Frame 3
stop();
Symbol 73 MovieClip [TextNumber] Frame 1
#initclip 15
Object.registerClass("TextNumber", com.midasplayer.wordbattle.TextNumber);
#endinitclip
Symbol 74 MovieClip [RoundData] Frame 1
#initclip 16
Object.registerClass("RoundData", com.midasplayer.wordbattle.RoundData);
#endinitclip
Symbol 209 MovieClip [Letter] Frame 1
#initclip 17
Object.registerClass("Letter", com.midasplayer.wordbattle.Letter);
#endinitclip
Symbol 221 MovieClip Frame 1
stop();
Symbol 221 MovieClip Frame 7
stop();
Symbol 221 MovieClip Frame 35
stop();
Symbol 222 MovieClip [LetterHolder] Frame 1
#initclip 18
Object.registerClass("LetterHolder", com.midasplayer.wordbattle.LetterHolder);
#endinitclip
Symbol 231 MovieClip Frame 1
stop();
Symbol 246 MovieClip Frame 1
stop();
Symbol 246 MovieClip Frame 2
stop();
Symbol 246 MovieClip Frame 3
stop();
Symbol 246 MovieClip Frame 4
stop();
Symbol 247 MovieClip [ScorePoof] Frame 1
#initclip 19
Object.registerClass("ScorePoof", com.midasplayer.wordbattle.ScorePoof);
#endinitclip
stop();
Symbol 302 MovieClip Frame 1
stop();
Symbol 303 MovieClip [OpponentWordLabel] Frame 1
#initclip 20
Object.registerClass("OpponentWordLabel", com.midasplayer.wordbattle.WordLabel);
#endinitclip
Symbol 309 MovieClip [NumberFlipper] Frame 1
#initclip 21
Object.registerClass("NumberFlipper", com.midasplayer.wordbattle.NumberFlipper);
#endinitclip
Symbol 313 MovieClip [ScorePanel] Frame 1
#initclip 22
Object.registerClass("ScorePanel", com.midasplayer.wordbattle.ScorePanel);
#endinitclip
Symbol 320 Button
on (press) {
_parent.clearClicked();
}
Symbol 327 MovieClip Frame 1
stop();
Symbol 327 MovieClip Frame 2
stop();
Symbol 327 MovieClip Frame 3
stop();
Symbol 329 MovieClip [WordLabel] Frame 1
#initclip 23
Object.registerClass("WordLabel", com.midasplayer.wordbattle.WordLabel);
#endinitclip
Symbol 335 MovieClip Frame 1
stop();
Symbol 335 MovieClip Frame 10
stop();
Symbol 335 MovieClip Frame 20
stop();
Symbol 351 MovieClip Frame 1
stop();
Symbol 359 MovieClip Frame 1
stop();
Symbol 359 MovieClip Frame 7
stop();
Symbol 361 MovieClip Frame 1
stop();
Symbol 361 MovieClip Frame 7
stop();
Symbol 363 MovieClip Frame 1
stop();
Symbol 363 MovieClip Frame 7
stop();
Symbol 364 MovieClip [Board] Frame 1
#initclip 24
Object.registerClass("Board", com.midasplayer.wordbattle.Board);
#endinitclip
Symbol 377 Button
on (rollOver) {
_root.endGameLabel.textColor = 16777215 /* 0xFFFFFF */;
}
on (rollOut) {
_root.endGameLabel.textColor = 39321;
}
on (press) {
_root.board.endGame();
}
Symbol 379 MovieClip [__Packages.com.midasplayer.wordbattle.TextNumber] Frame 0
class com.midasplayer.wordbattle.TextNumber extends MovieClip
{
var reflectoText, numberCounter, text;
function TextNumber () {
super();
}
function clear() {
reflectoText.gotoAndStop(1);
numberCounter._alpha = 0;
}
function prepareText(newText) {
reflectoText.gotoAndStop(1);
text = newText;
numberCounter._alpha = 0;
fade = 0;
}
function showText() {
reflectoText.setText(text);
reflectoText.gotoAndPlay(2);
targetFade = 80;
}
function prepareNumber(newTargetNumber) {
longNumber = false;
numberCounter.gotoAndStop(2);
currentNumber = 0;
targetNumber = newTargetNumber;
}
function prepareLongNumber(newTargetNumber) {
longNumber = true;
numberCounter.gotoAndStop(3);
currentNumber = 0;
targetNumber = newTargetNumber;
}
function showNumber() {
fade = 100;
increaseStartTime = getTimer();
if (longNumber) {
if (targetNumber > 0) {
increaseEndTime = increaseStartTime + 1200;
} else {
increaseEndTime = increaseStartTime + 200;
}
numberCounter.digit0.gotoAndStop(1);
numberCounter.digit1.gotoAndStop(1);
numberCounter.digit2.gotoAndStop(1);
numberCounter.digit3.gotoAndStop(1);
numberCounter.digit4.gotoAndStop(1);
} else {
numberCounter.digit0.gotoAndStop(1);
increaseEndTime = increaseStartTime + (targetNumber * 200);
}
currentNumber = 0;
return((increaseEndTime - increaseStartTime) + 500);
}
function getNumber() {
return(currentNumber);
}
function reallySetNumber(num) {
if (num != currentNumber) {
currentNumber = num;
if (longNumber) {
var _local3 = num;
var _local2 = 0;
while (_local2 < 5) {
var _local4 = _local3 % 10;
numberCounter["digit" + _local2].gotoAndStop(_local4 + 1);
_local3 = Math.floor(_local3 / 10);
_local2++;
}
} else {
numberCounter.digit0.gotoAndStop(num + 1);
}
fade = 100;
}
}
function fadeOut() {
increaseStartTime = -1;
increaseEndTime = -1;
reflectoText.gotoAndPlay(16);
targetFade = 0;
}
function hide() {
targetFade = 0;
fade = targetFade;
}
function onEnterFrame() {
if (increaseStartTime > 0) {
var _local6 = (getTimer() - increaseStartTime) / (increaseEndTime - increaseStartTime);
if (_local6 > 1) {
increaseStartTime = -1;
increaseEndTime = -1;
_local6 = 1;
}
var _local5 = Math.floor(targetNumber * _local6);
if (_local5 != currentNumber) {
fade = 100;
if (longNumber) {
var _local3 = _local5;
var _local2 = 0;
while (_local2 < 5) {
var _local4 = _local3 % 10;
numberCounter["digit" + _local2].gotoAndStop(_local4 + 1);
_local3 = Math.floor(_local3 / 10);
_local2++;
}
} else {
numberCounter.digit0.gotoAndStop(_local5 + 1);
}
currentNumber = _local5;
}
}
numberCounter._alpha = fade;
if (fade > targetFade) {
fade = fade - 2;
}
}
var currentNumber = 0;
var targetNumber = 0;
var fade = 0;
var increaseStartTime = -1;
var increaseEndTime = -1;
var longNumber = false;
var targetFade = 80;
}
Symbol 380 MovieClip [__Packages.com.midasplayer.wordbattle.RoundData] Frame 0
class com.midasplayer.wordbattle.RoundData extends MovieClip
{
var board, textNumber0, textNumber1, textNumber2, textNumber3, textNumber4;
function RoundData () {
super();
}
function show(approvedWords, duplicateWords, newRoundScore, position, newCallback, finalRound, d0, d1, d2) {
board = newCallback;
showed = 0;
shouldSetShowTime = true;
endRoundTime = getTimer() + 15000;
roundScore = newRoundScore;
textNumber0.prepareText(_global.textMappings.your_approved_words);
textNumber1.prepareText(_global.textMappings.duplicate_words);
textNumber2.prepareText(_global.textMappings.score_this_round);
textNumber3.prepareText(_global.textMappings.your_position);
if (finalRound) {
textNumber4.prepareText(_global.textMappings.game_ends_in);
} else {
textNumber4.prepareText(_global.textMappings.next_round_starts_in);
}
textNumber0.prepareNumber(approvedWords);
textNumber1.prepareNumber(duplicateWords);
textNumber2.prepareLongNumber(roundScore);
textNumber3.prepareNumber(position);
textNumber4.prepareNumber(9);
}
function bricksRevealed() {
showTime = getTimer() + 1000;
}
function onEnterFrame() {
if ((shouldSetShowTime && (showTime > 0)) && (getTimer() > showTime)) {
if (showed < 9) {
var _local5 = Math.floor(showed / 2);
if ((showed - (_local5 * 2)) == 0) {
this["textNumber" + _local5].showText();
showTime = showTime + 500;
} else {
if (_local5 == 3) {
if (!KILLED) {
board.showScoreForPlayer(0);
board.showScoreForPlayer(1);
board.showScoreForPlayer(2);
board.showScoreForPlayer(3);
board.increaseTotalScore(roundScore);
board.sortScores();
board.changeLeader();
var _local6 = board.getPlayerPos() + 1;
textNumber3.prepareNumber(_local6);
}
}
var _local7 = this["textNumber" + _local5].showNumber();
roundAnimationStep(_local5, _local7 + 200);
}
showed++;
if (showed == 9) {
board.showLeader();
}
} else if (showed < 10) {
showTime = showTime + 100;
var _local4 = Math.floor((endRoundTime - getTimer()) / 1000);
if (_local4 > 9) {
_local4 = 9;
}
if (_local4 < 0) {
_local4 = 0;
var _local3 = 0;
while (_local3 < 5) {
this["textNumber" + _local3].fadeOut();
_local3++;
}
showTime = showTime + 1500;
showed++;
} else {
if (_local4 < 5) {
if (textNumber4.getNumber() != _local4) {
if (_local4 == 0) {
_global.secondCountSlutSound.start();
} else {
_global.secondCountSound.start();
}
}
}
textNumber4.reallySetNumber(_local4);
}
} else {
var _local3 = 0;
while (_local3 < 5) {
this["textNumber" + _local3].hide();
_local3++;
}
board.roundAnimationDone();
showTime = -1;
showed = 0;
shouldSetShowTime = false;
}
}
}
function roundAnimationStep(step, expectedTime) {
if (step == 0) {
showAcceptedWords();
} else if (step == 1) {
showDuplicateWords();
} else if (step == 2) {
_global.scoreCountUpSound.start();
if (!KILLED) {
board.scorePanel.showRoundScore();
var _local3 = 0;
while (_local3 < 4) {
board["opponentLabel" + _local3].scorePanel.showRoundScore();
_local3++;
}
}
showTime = showTime + expectedTime;
} else if (step == 3) {
showTime = showTime + expectedTime;
} else {
showTime = showTime + expectedTime;
}
}
function showAcceptedWords() {
if (!KILLED) {
var _local2 = 0;
while (_local2 < 4) {
board.revealOpponentWord(_local2);
_local2++;
}
var _local3 = 0;
while (_local3 < 3) {
board["wordLabel" + _local3].showAccepted();
_local2 = 0;
while (_local2 < 4) {
board["opponentLabel" + _local2]["wordLabel" + _local3].showAccepted();
_local2++;
}
_local3++;
}
}
showTime = showTime + 1500;
var _local4 = 12;
}
function showDuplicateWords() {
if (!KILLED) {
var _local3 = 0;
while (_local3 < 3) {
board["wordLabel" + _local3].showRealScores();
var _local2 = 0;
while (_local2 < 4) {
board["opponentLabel" + _local2]["wordLabel" + _local3].showRealScores();
_local2++;
}
_local3++;
}
}
showTime = showTime + 1500;
}
var KILLED = false;
var showed = 0;
var showTime = -1;
var endRoundTime = 0;
var roundScore = 0;
var shouldSetShowTime = false;
}
Symbol 381 MovieClip [__Packages.com.midasplayer.wordbattle.Letter] Frame 0
class com.midasplayer.wordbattle.Letter extends MovieClip
{
var bg, letterClip, scoreClip, bonusClip, letter, score, bonus, idString, yPos, xPos, h, y, _y;
function Letter () {
super();
letterPositions = letterPositions.split("_A").join(String.fromCharCode(260));
letterPositions = letterPositions.split("_C").join(String.fromCharCode(262));
letterPositions = letterPositions.split("_E").join(String.fromCharCode(280));
letterPositions = letterPositions.split("_L").join(String.fromCharCode(321));
letterPositions = letterPositions.split("_N").join(String.fromCharCode(323));
letterPositions = letterPositions.split("_O").join(String.fromCharCode(211));
letterPositions = letterPositions.split("_S").join(String.fromCharCode(346));
letterPositions = letterPositions.split("_Z").join(String.fromCharCode(377));
letterPositions = letterPositions.split(":Z").join(String.fromCharCode(379));
bg.stop();
bg.gotoAndStop(13);
letterClip.stop();
scoreClip.stop();
bonusClip.stop();
mode = 4;
col = 0;
}
function clear() {
letterClip.gotoAndStop(0);
scoreClip.gotoAndStop(0);
bonusClip.gotoAndStop(0);
}
function setup(charStr, scoreStr, bonusType) {
letter = charStr;
score = Number(scoreStr);
bonus = bonusType;
letterClipPos = Math.floor(letterPositions.indexOf(charStr) / 2) + 1;
scoreClipPos = score + 2;
bonusClipPos = bonus + 1;
if (((scoreStr == "") || (scoreStr == undefined)) || (scoreStr == null)) {
scoreClipPos = 1;
}
letterClip.gotoAndStop(letterClipPos);
scoreClip.gotoAndStop(scoreClipPos);
bonusClip.gotoAndStop(bonusClipPos);
mode = 0;
var _local2 = "N";
if (bonus == BONUS_2X_LETTER) {
_local2 = "2L";
} else if (bonus == BONUS_3X_LETTER) {
_local2 = "3L";
} else if (bonus == BONUS_2X_WORD) {
_local2 = "2W";
}
idString = (((((("" + xPos) + ",") + yPos) + ",") + _local2) + ",") + charStr;
occupied = null;
mode = 0;
if ((bonus == BONUS_2X_LETTER) || (bonus == BONUS_3X_LETTER)) {
mode = 1;
}
if (bonus == BONUS_2X_WORD) {
mode = 3;
}
bg.gotoAndStop(((mode * 3) + 1) + col);
if (((charStr == null) || (charStr == undefined)) || (charStr == "")) {
mode = 4;
col = 0;
bg.gotoAndStop(1);
bg.gotoAndStop(13);
letterClip.gotoAndStop(0);
scoreClip.gotoAndStop(0);
bonusClip.gotoAndStop(0);
}
}
function copyFrom(letter) {
letterClip.gotoAndStop(letter.letterClipPos);
scoreClip.gotoAndStop(letter.scoreClipPos);
bonusClip.gotoAndStop(letter.bonusClipPos);
bg.gotoAndStop(((letter.mode * 3) + 1) + letter.col);
}
function init(xPos, yPos) {
this.xPos = xPos;
this.yPos = yPos;
h = 0;
ha = 0;
}
function setColor(col) {
this.col = col;
bg.gotoAndStop(((mode * 3) + 1) + this.col);
}
function onEnterFrame() {
if (_y != Math.floor(y - h)) {
_y = Math.floor(y - h);
}
h = h + ha;
if (!pressed) {
ha = ha + 0.5;
}
var _local2 = 0;
if (col != 0) {
_local2 = -2;
}
if ((occupied != null) && (occupied.previewMode)) {
}
if (h >= _local2) {
ha = 0;
h = _local2;
}
}
function isNear(x, y) {
return(Math.max(Math.abs(x - xPos), Math.abs(y - yPos)) == 1);
}
function getShownLetter() {
return(letter);
}
var occupied = null;
var letterPositions = " A B C D E F G H I J K L M N O P Q R S T U V W X Y Z \u00C5 \u00C4 \u00D6 \u00DC QU\u00C6 \u00D8 _A _C _E _L _N _O _S _Z :Z ";
static var BONUS_NONE = 0;
static var BONUS_2X_LETTER = 1;
static var BONUS_3X_LETTER = 2;
static var BONUS_2X_WORD = 3;
var pressed = false;
var ha = 0;
var mode = 0;
var col = 0;
var letterClipPos = 0;
var scoreClipPos = 0;
var bonusClipPos = 0;
}
Symbol 382 MovieClip [__Packages.com.midasplayer.wordbattle.WordLabel] Frame 0
class com.midasplayer.wordbattle.WordLabel extends MovieClip
{
var id, board, selectionPlate, statusCheckbox, letters, textLabel, bgColor, textBackground, tosetAccepted, tosetShowTime, updateTime, scoreLabel0, scoreLabel1, scoreLabel2, scoreLabel3, scoreLabel4, dupeIndicator, wordPreview, targetText;
function WordLabel () {
super();
}
function init(board, id) {
this.id = id;
this.board = board;
selectionPlate.gotoAndStop(3);
statusCheckbox.stop();
statusCheckbox.gotoAndStop(3);
letters = new Array();
textLabel.text = "";
bgColor = new Color(textBackground);
var thisLabel = this;
selectionPlate.onRollOver = function () {
thisLabel.previewMode = true;
};
selectionPlate.onRollOut = function () {
thisLabel.previewMode = false;
};
selectionPlate.onPress = function () {
thisLabel.board.labelPressed(thisLabel);
};
setSelected(false);
}
function clearClicked() {
clearAllLetters();
board.labelPressed(this);
}
function setAccepted(accepted, showTime) {
tosetAccepted = accepted;
tosetShowTime = showTime;
}
function showAccepted() {
accepted = tosetAccepted;
showTime = getTimer() + tosetShowTime;
}
function showRealScores() {
updateTime = getTimer() + tosetShowTime;
}
function setSelected(selected) {
this.selected = selected;
selectionPlate.gotoAndStop((selected ? 1 : (((letters.length > 0) ? 2 : 3))));
if (selected) {
bgColor.setTransform({ra:100, rb:0, ga:0, gb:0, ba:0, bb:0, aa:50, ab:0});
} else {
bgColor.setTransform({ra:0, rb:0, ga:0, gb:0, ba:0, bb:0, aa:50, ab:0});
}
var _local2 = 0;
while (_local2 < letters.length) {
var _local3 = letters[_local2];
if (selected) {
_local3.setColor(1);
} else {
_local3.setColor(2);
}
_local2++;
}
}
function canClick(x, y) {
if (letters.length == 0) {
return(true);
}
var _local2 = letters[letters.length - 1];
return(_local2.isNear(x, y));
}
function addChar(letter) {
letters.push(letter);
textLabel.text = textLabel.text + letter.getShownLetter();
board.labelChanged(this);
selectionPlate.gotoAndStop((selected ? 1 : (((letters.length > 0) ? 2 : 3))));
}
function isLastChar(letter) {
return((letters.length >= 3) && (letter == letters[letters.length - 1]));
}
function isEmpty() {
return(letters.length == 0);
}
function clearCheckBox() {
}
function clearAllLetters() {
while (letters.length > 0) {
var _local2 = letters.pop();
_local2.setColor(0);
_local2.occupied = null;
}
textLabel.text = "";
board.labelChanged(this);
selectionPlate.gotoAndStop((selected ? 1 : (((letters.length > 0) ? 2 : 3))));
}
function getWordCode1() {
var _local4 = "";
var _local2 = 0;
while (_local2 < letters.length) {
var _local3 = letters[_local2];
if (_local2 > 0) {
_local4 = _local4 + " ";
}
_local4 = _local4 + _local3.idString;
_local2++;
}
return(_local4);
}
function getWordPos() {
var _local4 = "";
var _local2 = 0;
while (_local2 < letters.length) {
var _local3 = letters[_local2];
if (_local2 > 0) {
_local4 = _local4 + " ";
}
_local4 = _local4 + ((_local3.xPos + ",") + _local3.yPos);
_local2++;
}
return(_local4);
}
function getWordCode2() {
var _local4 = "";
var _local2 = 0;
while (_local2 < letters.length) {
var _local3 = letters[_local2];
if (_local2 > 0) {
_local4 = _local4 + " ";
}
_local4 = _local4 + (("" + _local3.idString) + "");
_local2++;
}
return(_local4);
}
function calcScore() {
score = 0;
if (letters.length >= 3) {
var _local6 = 1;
var _local5 = 0;
var _local7 = letters.length;
var _local4 = 0;
while (_local4 < letters.length) {
var _local2 = letters[_local4];
var _local3 = _local2.score;
if (_local2.bonus == com.midasplayer.wordbattle.Letter.BONUS_2X_LETTER) {
_local3 = _local3 * 2;
} else if (_local2.bonus == com.midasplayer.wordbattle.Letter.BONUS_3X_LETTER) {
_local3 = _local3 * 3;
} else if (_local2.bonus == com.midasplayer.wordbattle.Letter.BONUS_2X_WORD) {
_local6 = _local6 * 2;
}
_local5 = _local5 + _local3;
_local4++;
}
score = (20 * (_local5 + ((_local7 * _local7) / 2))) * _local6;
}
scoreLabel0.targetValue = Math.floor(score / 1) % 10;
scoreLabel1.targetValue = Math.floor(score / 10) % 10;
scoreLabel2.targetValue = Math.floor(score / 100) % 10;
scoreLabel3.targetValue = Math.floor(score / 1000) % 10;
scoreLabel4.targetValue = Math.floor(score / 10000) % 10;
}
function clearUntil(letter) {
if (letters.length == 1) {
var _local3 = letters.pop();
_local3.setColor(0);
_local3.occupied = null;
textLabel.text = "";
board.labelChanged(this);
} else {
while ((letters.length > 0) && (letters[letters.length - 1] != letter)) {
var _local3 = letters.pop();
_local3.setColor(0);
_local3.occupied = null;
}
board.labelChanged(this);
}
textLabel.text = "";
var _local2 = 0;
while (_local2 < letters.length) {
textLabel.text = textLabel.text + letters[_local2].getShownLetter();
_local2++;
}
selectionPlate.gotoAndStop((selected ? 1 : (((letters.length > 0) ? 2 : 3))));
}
function setDupe(dupeNum) {
dupeIndicator._alpha = 0;
dupeIndicator.gotoAndStop(dupeNum);
}
function onEnterFrame() {
if (showTime > 0) {
statusCheckbox._alpha = 100;
if (getTimer() > showTime) {
wordPreview._alpha = 0;
textLabel.text = dePolificate(targetText);
if (playSounds) {
if (accepted == 1) {
_global.wordGoodSound.start();
} else if (accepted == 2) {
_global.wordBadSound.start();
} else {
_global.sharedWordSound.start();
}
}
statusCheckbox.gotoAndStop(accepted);
showTime = 0;
clearTime = getTimer() + 10000;
scoreLabel0.targetValue = Math.floor(score / 1) % 10;
scoreLabel1.targetValue = Math.floor(score / 10) % 10;
scoreLabel2.targetValue = Math.floor(score / 100) % 10;
scoreLabel3.targetValue = Math.floor(score / 1000) % 10;
scoreLabel4.targetValue = Math.floor(score / 10000) % 10;
}
}
if (updateTime > 0) {
if (getTimer() > updateTime) {
updateTime = 0;
score = realScore;
clearDupeTime = getTimer() + 8000;
if (dupeLevel > 0) {
if (dupeLevel > 4) {
dupeLevel = 4;
}
if (shouldShowPoof) {
statusCheckbox.scorePoof.show(dupeLevel);
}
statusCheckbox.gotoAndStop(4 + dupeLevel);
}
scoreLabel0.targetValue = Math.floor(score / 1) % 10;
scoreLabel1.targetValue = Math.floor(score / 10) % 10;
scoreLabel2.targetValue = Math.floor(score / 100) % 10;
scoreLabel3.targetValue = Math.floor(score / 1000) % 10;
scoreLabel4.targetValue = Math.floor(score / 10000) % 10;
}
}
if (clearTime > 0) {
var _local3 = Math.round((clearTime - getTimer()) / 10);
if (_local3 > 100) {
_local3 = 100;
}
if (_local3 < 0) {
_local3 = 0;
}
statusCheckbox._alpha = _local3;
if (getTimer() > clearTime) {
statusCheckbox.gotoAndStop(3);
clearTime = 0;
}
}
if (clearDupeTime > 0) {
var _local3 = Math.round((clearDupeTime - getTimer()) / 10);
if (_local3 > 100) {
_local3 = 100;
}
if (_local3 < 0) {
_local3 = 0;
}
dupeIndicator._alpha = _local3;
if (getTimer() > clearDupeTime) {
dupeIndicator.gotoAndStop(1);
clearDupeTime = 0;
}
}
}
function dePolificate(str) {
return(str);
}
var selected = false;
var previewMode = false;
var playSounds = false;
var shouldShowPoof = false;
var shouldShowWord = false;
var accepted = 1;
var showTime = 0;
var clearTime = 0;
var clearDupeTime = 0;
var dupeLevel = 0;
var score = 0;
var realScore = 0;
}
Symbol 383 MovieClip [__Packages.com.midasplayer.wordbattle.Board] Frame 0
class com.midasplayer.wordbattle.Board extends MovieClip
{
var targetRound, playerTotalScore, roundScores, wordLabel0, wordLabel1, wordLabel2, scorePanel, opponentLabel0, opponentLabel1, opponentLabel2, opponentLabel3, attachMovie, tiles, comm, roundCounterText, timeCounterText, roundLabel, timeLeftLabel, scoreLabel, roundData, roundCounter, timeCounter, timeAlert, selectedLabel, lid0, lid1, lid2;
function Board () {
super();
targetRound = ROUND_COUNT;
playerTotalScore = new Array();
playerTotalScore[0] = -2;
playerTotalScore[1] = -2;
playerTotalScore[2] = -2;
playerTotalScore[3] = -2;
playerTotalScore[4] = -2;
_global.clockSound = new Sound();
_global.clockSound.attachSound("clockAlertSound");
_global.markSound = new Sound();
_global.markSound.attachSound("markSound");
_global.wordGoodSound = new Sound();
_global.wordGoodSound.attachSound("wordGoodSound");
_global.wordBadSound = new Sound();
_global.wordBadSound.attachSound("wordBadSound");
_global.sharedWordSound = new Sound();
_global.sharedWordSound.attachSound("sharedWordSound");
_global.startSound = new Sound();
_global.startSound.attachSound("startSound");
_global.startSound.start();
_global.newRoundSound = new Sound();
_global.newRoundSound.attachSound("newRoundSound");
_global.bonusRoundSound = new Sound();
_global.bonusRoundSound.attachSound("bonusRoundSound");
_global.submitWordSound = new Sound();
_global.submitWordSound.attachSound("submitWordSound");
_global.getGoldSound = new Sound();
_global.getGoldSound.attachSound("getGoldSound");
_global.scoreCountUpSound = new Sound();
_global.scoreCountUpSound.attachSound("scoreCountUpSound");
_global.secondCountSlutSound = new Sound();
_global.secondCountSlutSound.attachSound("secondCountSlutSound");
_global.secondCountSound = new Sound();
_global.secondCountSound.attachSound("secondCountSound");
roundScores = new Array();
var _local7 = 0;
while (_local7 < 6) {
roundScores[_local7] = 0;
_local7++;
}
var _local5 = 0;
while (_local5 < 4) {
this["opponentLabel" + _local5].scorePanel.nameLabel.text = "-- nobody --";
var _local6 = 0;
while (_local6 < 3) {
this["opponentLabel" + _local5]["wordLabel" + _local6].textLabel.text = "";
this["opponentLabel" + _local5]["wordLabel" + _local6].wordPreview._alpha = 100;
wordPreview(_local5, _local6, 0);
this["opponentLabel" + _local5]["wordLabel" + _local6].statusCheckbox.gotoAndStop(3);
_local6++;
}
_local6 = 0;
while (_local6 < 7) {
this["opponentLabel" + _local5].scorePanel["scoreLabel" + _local6].targetValue = 0;
_local6++;
}
_local5++;
}
setTimeCounter(0, 0, 0);
_root.resultWindow._visible = false;
_root.goTitle._visible = false;
_root.goScoreTitle._visible = false;
_root.goBonusTitle._visible = false;
_root.goRoundList._visible = false;
_root.goScoreList._visible = false;
_root.goBonusList._visible = false;
_root.goInfo._visible = false;
wordLabel0.playSounds = true;
wordLabel1.playSounds = true;
wordLabel2.playSounds = true;
}
function init() {
scorePanel.setPlayerMode(true);
opponentLabel0.scorePanel.setPlayerMode(false);
opponentLabel1.scorePanel.setPlayerMode(false);
opponentLabel2.scorePanel.setPlayerMode(false);
opponentLabel3.scorePanel.setPlayerMode(false);
increaseTotalScore(0);
var _local8 = 0;
while (_local8 < 3) {
var _local5 = 0;
while (_local5 < 10) {
var _local3 = attachMovie("Arrow", (("a_" + _local8) + "_") + _local5, (1000 + (_local8 * 10)) + _local5);
_local3.stop();
_local3._visible = false;
var _local10 = Math.floor(Math.random() * 3) + 1;
var _local9 = Math.floor(Math.random() * 3) + 1;
_local3._x = ((462 + (56 * _local10)) + 24) - 16;
_local3._y = ((20 + (56 * _local9)) + 24) - 16;
var _local2 = Math.floor(Math.random() * 8);
if (((_local2 == 0) || (_local2 == 1)) || (_local2 == 7)) {
_local3._y = _local3._y - 27;
} else if (((_local2 == 3) || (_local2 == 4)) || (_local2 == 5)) {
_local3._y = _local3._y + 27;
}
if (((_local2 == 5) || (_local2 == 6)) || (_local2 == 7)) {
_local3._x = _local3._x - 27;
} else if (((_local2 == 1) || (_local2 == 2)) || (_local2 == 3)) {
_local3._x = _local3._x + 27;
}
_local3.gotoAndStop((_local2 + 1) + (Math.floor(Math.random() * 2) * 8));
_local5++;
}
_local8++;
}
wordLabel0.init(this, 0);
wordLabel1.init(this, 1);
wordLabel2.init(this, 2);
wordLabel0.calcScore();
wordLabel1.calcScore();
wordLabel2.calcScore();
calcScore();
roundScore = 0;
revealPos = 125;
revealed = 125;
tiles = new Array();
var _local6 = 0;
while (_local6 < 5) {
tiles[_local6] = new Array();
var _local4 = 0;
while (_local4 < 5) {
var _local7 = this[(("l_" + _local6) + "_") + _local4];
_local7.occupied = null;
_local7.init(this, _local6, _local4);
tiles[_local6][_local4] = _local7.lowerLetter;
_local4++;
}
_local6++;
}
}
function initGame() {
comm = new com.midasplayer.wordbattle.Comm(this);
roundCounterText.setInstaText(_global.textMappings.round);
timeCounterText.setInstaText(_global.textMappings.time_left);
roundLabel.text = _global.textMappings.round;
timeLeftLabel.text = _global.textMappings.time_left;
scoreLabel.text = _global.textMappings.score;
startIn = getTimer() + 9000;
var _local3 = this;
}
function startGame() {
started = true;
openAllLids();
roundScore = 0;
revealPos = 0;
lastTime = getTimer();
}
function nextRound() {
if ((roundNum == targetRound) || (outOfTime)) {
roundEndTime = -1;
roundNum = targetRound;
gameOver = true;
labelPressed(null);
noInput = true;
shouldSendWordPreview = false;
} else if (!hideMode) {
roundEndTime = getTimer() + ROUND_TIME;
}
}
function initArrow(word, letter, x1, y1, x2, y2, mode) {
var _local7 = this[(("a_" + word) + "_") + letter];
if (mode == -1) {
_local7._visible = false;
} else {
var _local2 = 0;
if ((x2 == (x1 + 0)) && (y2 == (y1 - 1))) {
_local2 = 0;
}
if ((x2 == (x1 + 1)) && (y2 == (y1 - 1))) {
_local2 = 1;
}
if ((x2 == (x1 + 1)) && (y2 == (y1 + 0))) {
_local2 = 2;
}
if ((x2 == (x1 + 1)) && (y2 == (y1 + 1))) {
_local2 = 3;
}
if ((x2 == (x1 + 0)) && (y2 == (y1 + 1))) {
_local2 = 4;
}
if ((x2 == (x1 - 1)) && (y2 == (y1 + 1))) {
_local2 = 5;
}
if ((x2 == (x1 - 1)) && (y2 == (y1 + 0))) {
_local2 = 6;
}
if ((x2 == (x1 - 1)) && (y2 == (y1 - 1))) {
_local2 = 7;
}
_local7._x = (((462 + (56 * x1)) + 24) - 16) + ((x2 - x1) * 28);
_local7._y = (((20 + (56 * y1)) + 24) - 16) + ((y2 - y1) * 28);
_local7._visible = true;
_local7.gotoAndStop((_local2 + 1) + (mode * 8));
}
}
function submit() {
if (!started) {
startIn = 0;
_global.startSound.stop();
_root.startButton._visible = false;
_root.infoTitle._visible = false;
_root.infoText._visible = false;
startGame();
return(undefined);
}
if (noInput) {
return(undefined);
}
clockPaused = true;
var _local4 = getTimer() - roundStartTime;
halfSeconds = Math.floor(_local4 / 500);
labelPressed(null);
noInput = true;
shouldSendWordPreview = false;
comm.submitWords(wordLabel0, wordLabel1, wordLabel2);
removeWordArrows(wordLabel0);
removeWordArrows(wordLabel1);
removeWordArrows(wordLabel2);
}
function lastPlayer() {
if (splashesShown < ROUND_COUNT) {
crashGame(_global.textMappings.opponent_disconnect);
}
}
function endGame() {
if ((!gameOver) && (!gameEnded)) {
realTotalScore = 0;
totalScore = 0;
comm.endGamePressed();
crashGame(_global.textMappings.local_disconnect);
}
}
function crashGame(reason) {
if ((!gameOver) && (!gameEnded)) {
roundData.KILLED = true;
roundData._alpha = 0;
wordLabel0.clearAllLetters();
buildWordArrows(wordLabel0);
wordLabel1.clearAllLetters();
buildWordArrows(wordLabel1);
wordLabel2.clearAllLetters();
buildWordArrows(wordLabel2);
_root.errorTitle.text = "";
_root.errorText.text = reason;
crashState = 1;
gameEnded = true;
if (!hasSentGameEnd) {
roundNum = ROUND_COUNT;
comm.doGameOver();
hasSentGameEnd = true;
fscommand ("gameEnd", realTotalScore.toString());
}
hideMode = true;
bricksReceived();
}
}
function prepareWords() {
}
function wordsAcceptedForPlayer(playerNum, s0, s1, s2, t0, t1, t2, d0, d1, d2, pw0, pw1, pw2) {
var _local19 = s0 > 0;
var _local18 = s1 > 0;
var _local17 = s2 > 0;
var _local5 = 1;
var _local4 = 1;
var _local3 = 1;
if (d0 > 0) {
if (t0 == pw0) {
_local5 = 2;
}
if (t0 == pw1) {
_local5 = 3;
}
if (t0 == pw2) {
_local5 = 4;
}
}
if (d1 > 0) {
if (t1 == pw0) {
_local4 = 2;
}
if (t1 == pw1) {
_local4 = 3;
}
if (t1 == pw2) {
_local4 = 4;
}
}
if (d2 > 0) {
if (t2 == pw0) {
_local3 = 2;
}
if (t2 == pw1) {
_local3 = 3;
}
if (t2 == pw2) {
_local3 = 4;
}
}
var _local11 = (s0.valueOf() + s1.valueOf()) + s2.valueOf();
this["opponentLabel" + playerNum].scorePanel.setRoundScore(_local11);
this["opponentLabel" + playerNum].wordLabel0.setDupe(_local5);
this["opponentLabel" + playerNum].wordLabel1.setDupe(_local4);
this["opponentLabel" + playerNum].wordLabel2.setDupe(_local3);
this["opponentLabel" + playerNum].wordLabel0.dupeLevel = d0;
this["opponentLabel" + playerNum].wordLabel1.dupeLevel = d1;
this["opponentLabel" + playerNum].wordLabel2.dupeLevel = d2;
this["opponentLabel" + playerNum].wordLabel0.setAccepted((_local19 ? (((d0 > 0) ? 4 : 1)) : 2), 0);
this["opponentLabel" + playerNum].wordLabel1.setAccepted((_local18 ? (((d1 > 0) ? 4 : 1)) : 2), 500);
this["opponentLabel" + playerNum].wordLabel2.setAccepted((_local17 ? (((d2 > 0) ? 4 : 1)) : 2), 1000);
this["opponentLabel" + playerNum].wordLabel0.targetText = t0;
this["opponentLabel" + playerNum].wordLabel1.targetText = t1;
this["opponentLabel" + playerNum].wordLabel2.targetText = t2;
this["opponentLabel" + playerNum].wordLabel0.shouldShowWord = true;
this["opponentLabel" + playerNum].wordLabel1.shouldShowWord = true;
this["opponentLabel" + playerNum].wordLabel2.shouldShowWord = true;
increaseTotalScoreForPlayer(playerNum, s0);
increaseTotalScoreForPlayer(playerNum, s1);
increaseTotalScoreForPlayer(playerNum, s2);
}
function revealOpponentWord(playerNum) {
}
function wordPreview(playerNum, word, count) {
this["opponentLabel" + playerNum]["wordLabel" + word].wordPreview.gotoAndStop(((playerNum * 10) + count) + 1);
}
function wordsAccepted(s0, s1, s2, duplicateWords, d0, d1, d2) {
var _local9 = s0 > 0;
var _local8 = s1 > 0;
var _local6 = s2 > 0;
shouldSendWordPreview = false;
var _local7 = (s0 + s1) + s2;
realTotalScore = realTotalScore + _local7;
wordLabel0.setDupe(((d0 > 0) ? 2 : 1));
wordLabel1.setDupe(((d1 > 0) ? 3 : 1));
wordLabel2.setDupe(((d2 > 0) ? 4 : 1));
wordLabel0.realScore = s0;
wordLabel1.realScore = s1;
wordLabel2.realScore = s2;
var _local2 = 0;
if (_local9) {
_local2++;
} else {
wordLabel0.score = 0;
}
if (_local8) {
_local2++;
} else {
wordLabel1.score = 0;
}
if (_local6) {
_local2++;
} else {
wordLabel2.score = 0;
}
var _local4 = wordLabel0.textLabel.text;
wordLabel0.clearAllLetters();
wordLabel0.textLabel.text = _local4;
wordLabel0.targetText = _local4;
_local4 = wordLabel1.textLabel.text;
wordLabel1.clearAllLetters();
wordLabel1.textLabel.text = _local4;
wordLabel1.targetText = _local4;
_local4 = wordLabel2.textLabel.text;
wordLabel2.clearAllLetters();
wordLabel2.textLabel.text = _local4;
wordLabel2.targetText = _local4;
wordLabel0.setAccepted((_local9 ? (((d0 > 0) ? 4 : 1)) : 2), 0);
wordLabel1.setAccepted((_local8 ? (((d1 > 0) ? 4 : 1)) : 2), 500);
wordLabel2.setAccepted((_local6 ? (((d2 > 0) ? 4 : 1)) : 2), 1000);
wordLabel0.dupeLevel = d0;
wordLabel1.dupeLevel = d1;
wordLabel2.dupeLevel = d2;
wordLabel0.shouldShowPoof = true;
wordLabel1.shouldShowPoof = true;
wordLabel2.shouldShowPoof = true;
calcScore();
roundScore = _local7;
roundScores[roundNum] = roundScore;
removeWordArrows(wordLabel0);
removeWordArrows(wordLabel1);
removeWordArrows(wordLabel2);
scorePanel.setRoundScore(roundScore);
var _local5 = getPlayerPos() + 1;
if (roundNum == (ROUND_COUNT - 1)) {
if (!hasSentGameEnd) {
fscommand ("playData", ("799," + _local5) + "=0");
comm.doGameOver();
hasSentGameEnd = true;
fscommand ("gameEnd", realTotalScore.toString());
}
}
splashesShown++;
roundData.show(_local2, duplicateWords, roundScore, _local5, this, roundNum == (ROUND_COUNT - 1), d0 > 0, d1 > 0, d2 > 0);
revealPos = 0;
roundScore = 0;
}
function roundOver() {
roundNum++;
}
function bricksReceived() {
if (started) {
if (hideMode) {
closeAllLids();
} else {
openAllLids();
}
}
revealed = -25;
}
function onEnterFrame() {
if (counterAlphaTime > 0) {
var _local10 = (getTimer() - counterAlphaTime) / 30;
if (_local10 > 100) {
_local10 = 100;
counterAlphaTime = -1;
}
roundCounter._alpha = _local10;
timeCounter._alpha = _local10;
roundCounterText._alpha = 100 - (_local10 * 0.66);
timeCounterText._alpha = 100 - (_local10 * 0.66);
}
comm.tick();
if (((!gameStarted) && (connectedTime >= 0)) && ((getTimer() - connectedTime) > 30000)) {
crashGame(_global.textMappings.opponent_noconnect);
}
var _local8 = 0;
while (_local8 < 5) {
var _local7 = this["pos" + _local8]._alpha + 5;
if (_local7 > 100) {
_local7 = 100;
}
this["pos" + _local8]._alpha = _local7;
_local8++;
}
if (startIn > 0) {
var _local15 = Math.floor((startIn - getTimer()) / 1000);
if (getTimer() > startIn) {
startIn = -1;
submit();
}
return(undefined);
}
if (crashStartTime > 0) {
if (getTimer() > (crashStartTime + 1500)) {
_root.errorTitle._visible = true;
_root.errorText._visible = true;
}
if (getTimer() > (crashStartTime + 6500)) {
crashStartTime = -1;
comm.shutdownForReal();
fscommand ("gameQuit");
}
}
if (!inited) {
init();
inited = true;
}
var _local12 = getTimer();
if (roundEndTime > 0) {
var _local11 = Math.round(roundEndTime - getTimer());
if (_local11 < 0) {
_local11 = 0;
roundEndTime = -1;
submit();
hideMode = true;
bricksReceived();
}
var _local9 = Math.floor(_local11 / 1000);
if ((_local9 < 5) && (lastRemainingSeconds != _local9)) {
lastRemainingSeconds = _local9;
if (_local9 == 0) {
_global.secondCountSlutSound.start();
} else {
_global.secondCountSound.start();
}
}
var _local13 = Math.floor(_local9 / 60);
_local9 = _local9 - (_local13 * 60);
setTimeCounter(_local13, Math.floor(_local9 / 10), Math.floor(_local9 % 10));
}
if ((lastTime >= 0) && (!gameOver)) {
if (!clockPaused) {
passedTime = passedTime + (_local12 - lastTime);
}
lastTime = _local12;
if (gameEnded) {
passedTime = passedTime + 60000;
}
}
if (revealed < 25) {
if (revealed < 0) {
_local8 = 0;
while ((_local8 < 2) && (revealed < 0)) {
var _local6 = revealed + 15;
if ((_local6 >= 0) && (_local6 < 25)) {
if (_local6 == 0) {
_global.newRoundSound.start();
}
var _local5 = Math.floor(_local6 * 11) % 5;
var _local4 = Math.floor((_local6 * 11) / 5) % 5;
if (!hideMode) {
this[(("l_" + _local5) + "_") + _local4].brickPopup.gotoAndPlay(2);
} else {
this[(("l_" + _local5) + "_") + _local4].brickPopup.gotoAndPlay(8);
}
}
revealed++;
_local8++;
}
} else {
_local8 = 0;
while ((_local8 < 2) && (revealed < 25)) {
var _local6 = revealed + 15;
if ((_local6 >= 0) && (_local6 < 25)) {
var _local5 = Math.floor(_local6 * 11) % 5;
var _local4 = Math.floor((_local6 * 11) / 5) % 5;
if (!hideMode) {
this[(("l_" + _local5) + "_") + _local4].brickPopup.gotoAndPlay(2);
} else {
this[(("l_" + _local5) + "_") + _local4].brickPopup.gotoAndPlay(8);
}
}
var _local5 = Math.floor(revealPos) % 5;
var _local4 = Math.floor(revealPos / 5) % 5;
if (!hideMode) {
this[(("l_" + _local5) + "_") + _local4].reveal(comm.getChar(_local5, _local4), comm.getScore(_local5, _local4), ((roundNum < targetRound) ? (comm.getBonusAt(_local5, _local4)) : 0));
} else {
this[(("l_" + _local5) + "_") + _local4].reveal(undefined, undefined, 0);
}
revealPos = revealPos + 11;
revealed++;
_local8++;
}
}
if (revealed == 25) {
if (crashState == 1) {
crashState = 2;
crashStartTime = getTimer();
}
if (!hideMode) {
wordLabel0.clearAllLetters();
wordLabel1.clearAllLetters();
wordLabel2.clearAllLetters();
buildWordArrows(wordLabel0);
buildWordArrows(wordLabel1);
buildWordArrows(wordLabel2);
} else {
roundData.bricksRevealed();
removeWordArrows(wordLabel0);
removeWordArrows(wordLabel1);
removeWordArrows(wordLabel2);
}
if (!hideMode) {
calcScore();
wordLabel0.calcScore();
wordLabel1.calcScore();
wordLabel2.calcScore();
wordLabel0.clearCheckBox();
wordLabel1.clearCheckBox();
wordLabel2.clearCheckBox();
}
if (roundNum < targetRound) {
noInput = hideMode;
shouldSendWordPreview = !hideMode;
}
var _local14 = roundNum;
nextWord();
nextRound();
if (_local14 < targetRound) {
roundStartTime = getTimer();
noInput = hideMode;
shouldSendWordPreview = !hideMode;
} else if (endTime < 0) {
endTime = getTimer();
}
clockPaused = false;
}
}
if (gameOver) {
timeAlert._visible = false;
}
}
function roundAnimationDone() {
scorePanel.setRoundScore(0);
scorePanel.showRoundScore();
var _local2 = 0;
while (_local2 < 4) {
this["opponentLabel" + _local2].scorePanel.setRoundScore(0);
this["opponentLabel" + _local2].scorePanel.showRoundScore();
this["opponentLabel" + _local2].wordLabel0.textLabel.text = "";
this["opponentLabel" + _local2].wordLabel1.textLabel.text = "";
this["opponentLabel" + _local2].wordLabel2.textLabel.text = "";
this["opponentLabel" + _local2].wordLabel0.wordPreview._alpha = 100;
this["opponentLabel" + _local2].wordLabel1.wordPreview._alpha = 100;
this["opponentLabel" + _local2].wordLabel2.wordPreview._alpha = 100;
wordPreview(_local2, 0, 0);
wordPreview(_local2, 1, 0);
wordPreview(_local2, 2, 0);
_local2++;
}
if (roundNum < ROUND_COUNT) {
hideMode = false;
comm.nextRound();
} else {
timeAlert._visible = false;
comm.shutdownForReal();
if (!hasSentGameEnd) {
hasSentGameEnd = true;
fscommand ("gameEnd", realTotalScore.toString());
}
fscommand ("gameQuit");
endTime = -1;
}
}
function setTimeCounter(min, sec0, sec1) {
timeCounter.digit0.gotoAndStop(min + 1);
timeCounter.digit1.gotoAndStop(sec0 + 1);
timeCounter.digit2.gotoAndStop(sec1 + 1);
}
function labelPressed(wordLabel) {
if (noInput) {
return(undefined);
}
if (selectedLabel != null) {
if (selectedLabel.letters.length < 3) {
selectedLabel.clearAllLetters();
}
}
if ((wordLabel != null) && (wordLabel == selectedLabel)) {
selectedLabel = null;
nextWord();
return(undefined);
}
selectedLabel = wordLabel;
wordLabel0.setSelected(wordLabel == wordLabel0);
wordLabel1.setSelected(wordLabel == wordLabel1);
wordLabel2.setSelected(wordLabel == wordLabel2);
buildWordArrows(wordLabel0);
buildWordArrows(wordLabel1);
buildWordArrows(wordLabel2);
wordLabel0.calcScore();
wordLabel1.calcScore();
wordLabel2.calcScore();
calcScore();
}
function buildWordArrows(word) {
var _local2 = 0;
while (_local2 < 10) {
if (word.letters.length >= (_local2 + 2)) {
var _local5 = word.letters[_local2];
var _local4 = word.letters[_local2 + 1];
initArrow(word.id, _local2, _local5.xPos, _local5.yPos, _local4.xPos, _local4.yPos, (word.selected ? 0 : 1));
} else {
initArrow(word.id, _local2, -1, -1, -1, -1, -1);
}
_local2++;
}
}
function removeWordArrows(word) {
var _local2 = 0;
while (_local2 < 10) {
initArrow(word.id, _local2, -1, -1, -1, -1, -1);
_local2++;
}
}
function calcScore() {
var _local2 = 0;
_local2 = _local2 + wordLabel0.score;
_local2 = _local2 + wordLabel1.score;
_local2 = _local2 + wordLabel2.score;
roundScore = _local2;
}
function increaseTotalScoreForPlayer(playerNum, toAdd) {
playerTotalScore[playerNum] = playerTotalScore[playerNum] + toAdd;
}
function showScoreForPlayer(playerNum) {
this["opponentLabel" + playerNum].scorePanel.scoreLabel0.targetValue = Math.floor(playerTotalScore[playerNum] / 1) % 10;
this["opponentLabel" + playerNum].scorePanel.scoreLabel1.targetValue = Math.floor(playerTotalScore[playerNum] / 10) % 10;
this["opponentLabel" + playerNum].scorePanel.scoreLabel2.targetValue = Math.floor(playerTotalScore[playerNum] / 100) % 10;
this["opponentLabel" + playerNum].scorePanel.scoreLabel3.targetValue = Math.floor(playerTotalScore[playerNum] / 1000) % 10;
this["opponentLabel" + playerNum].scorePanel.scoreLabel4.targetValue = Math.floor(playerTotalScore[playerNum] / 10000) % 10;
this["opponentLabel" + playerNum].scorePanel.scoreLabel5.targetValue = Math.floor(playerTotalScore[playerNum] / 100000) % 10;
this["opponentLabel" + playerNum].scorePanel.scoreLabel6.targetValue = Math.floor(playerTotalScore[playerNum] / 1000000) % 10;
}
function increaseTotalScore(toAdd) {
totalScore = totalScore + toAdd;
scorePanel.scoreLabel0.targetValue = Math.floor(totalScore / 1) % 10;
scorePanel.scoreLabel1.targetValue = Math.floor(totalScore / 10) % 10;
scorePanel.scoreLabel2.targetValue = Math.floor(totalScore / 100) % 10;
scorePanel.scoreLabel3.targetValue = Math.floor(totalScore / 1000) % 10;
scorePanel.scoreLabel4.targetValue = Math.floor(totalScore / 10000) % 10;
scorePanel.scoreLabel5.targetValue = Math.floor(totalScore / 100000) % 10;
scorePanel.scoreLabel6.targetValue = Math.floor(totalScore / 1000000) % 10;
}
function letterPressed(letter) {
if (noInput) {
return(undefined);
}
if (tiles[letter.xPos][letter.yPos].occupied == null) {
if (selectedLabel != null) {
if (selectedLabel.canClick(letter.xPos, letter.yPos)) {
if (selectedLabel.letters.length < 10) {
selectedLabel.addChar(letter);
letter.setColor(1);
tiles[letter.xPos][letter.yPos].occupied = selectedLabel;
_global.markSound.start();
letter.h = -3;
letter.ha = 0;
letter.pressed = true;
letter.setColor(1);
buildWordArrows(selectedLabel);
selectedLabel.calcScore();
calcScore();
}
} else {
_global.markSound.start();
letter.h = -3;
letter.ha = 0;
letter.pressed = true;
selectedLabel.clearAllLetters();
letterPressed(letter);
buildWordArrows(selectedLabel);
selectedLabel.calcScore();
calcScore();
}
}
} else {
var _local4 = tiles[letter.xPos][letter.yPos].occupied;
if (_local4 == selectedLabel) {
if (_local4.isLastChar(letter)) {
_global.submitWordSound.start();
buildWordArrows(_local4);
nextWord();
} else {
letter.h = -3;
letter.ha = 0;
letter.pressed = true;
_local4.clearUntil(letter);
_local4.calcScore();
calcScore();
buildWordArrows(_local4);
}
} else if ((selectedLabel == null) || (selectedLabel.letters.length == 0)) {
labelPressed(_local4);
}
}
}
function nextWord() {
var _local2 = 0;
while (_local2 < 3) {
if (this["wordLabel" + _local2].isEmpty()) {
labelPressed(this["wordLabel" + _local2]);
return(undefined);
}
_local2++;
}
labelPressed(null);
}
function getPlayerPos() {
var _local3 = new Array();
var _local7 = new Array();
_local3[0] = realTotalScore;
_local7[0] = 2;
var _local5 = 0;
while (_local5 < 4) {
_local3[_local5 + 1] = playerTotalScore[_local5];
_local7[_local5 + 1] = _local5 + 3;
_local3[(_local5 + 1) + 4] = -1;
_local7[(_local5 + 1) + 4] = 1;
_local5++;
}
var _local8 = new Array();
_local5 = 0;
while (_local5 < 5) {
var _local6 = -100;
var _local4 = -100;
var _local2 = 0;
while (_local2 < 9) {
if (_local3[_local2] > _local6) {
_local6 = _local3[_local2];
_local4 = _local2;
}
_local2++;
}
_local3[_local4] = -200;
_local8[_local5] = _local7[_local4];
if (_local7[_local4] == 2) {
return(_local5);
}
_local5++;
}
}
function sortScores() {
var _local5 = new Array();
var _local7 = new Array();
_local5[0] = totalScore;
_local7[0] = 2;
var _local4 = 0;
while (_local4 < 4) {
_local5[_local4 + 1] = playerTotalScore[_local4];
_local7[_local4 + 1] = _local4 + 3;
_local5[(_local4 + 1) + 4] = -1;
_local7[(_local4 + 1) + 4] = 1;
_local4++;
}
var _local8 = new Array();
_local4 = 0;
while (_local4 < 5) {
var _local6 = -100;
var _local3 = -100;
var _local2 = 0;
while (_local2 < 9) {
if (_local5[_local2] > _local6) {
_local6 = _local5[_local2];
_local3 = _local2;
}
_local2++;
}
if (_local4 == 0) {
leader = _local7[_local3];
}
_local5[_local3] = -200;
_local8[_local4] = _local7[_local3];
this["pos" + _local4]._alpha = 0;
this["pos" + _local4].gotoAndStop(_local7[_local3]);
_local4++;
}
}
function changeLeader() {
if (oldLeader != leader) {
if (oldLeader == 2) {
scorePanel.setLeader(false);
}
if (oldLeader > 2) {
this["opponentLabel" + (oldLeader - 3)].scorePanel.setLeader(false);
}
oldLeader = leader;
}
}
function showLeader() {
if (leader == 2) {
if (!scorePanel.isLeader()) {
_global.getGoldSound.start();
}
scorePanel.setLeader(true);
}
if (leader > 2) {
this["opponentLabel" + (leader - 3)].scorePanel.setLeader(true);
}
}
function labelChanged(label) {
var _local3 = label.id;
var _local2 = label.letters.length;
if (_local2 > 9) {
_local2 = 9;
}
if (shouldSendWordPreview) {
comm.sendWordPreview(_local3, _local2);
}
}
function openAllLids() {
roundCounter.gotoAndStop(roundNum + 2);
lid0.gotoAndPlay(2);
lid1.gotoAndPlay(2);
lid2.gotoAndPlay(2);
counterAlphaTime = getTimer();
}
function closeAllLids() {
lid0.gotoAndPlay(8);
lid1.gotoAndPlay(8);
lid2.gotoAndPlay(8);
}
var ROUND_TIME = 61000;
var ROUND_COUNT = 4;
var inited = false;
var revealPos = 0;
var revealed = 0;
var gameStarted = false;
var shouldSendWordPreview = false;
var connectedTime = -1;
var counterAlphaTime = -1;
var lastRoundSlider = -1;
var clockState = -1;
var roundScore = 0;
var totalScore = 0;
var realTotalScore = 0;
var noInput = true;
var outOfTime = false;
var roundNum = 0;
var roundStartTime = 0;
var totalTimeBonus = 0;
var halfSeconds = 0;
var lastTime = -1;
var passedTime = 0;
var endTime = -1;
var splashesShown = 0;
var bestWord = "None!";
var bestWordScore = 0;
var gameOver = false;
var totalFiveLetterWords = 0;
var totalSixLetterWords = 0;
var timeAlertValue = 0;
var roundXFlashTime = 0;
var roundXStartTime = -1;
var timeAlertFlashTime = -1;
var gameEnded = false;
var started = false;
var startIn = 0;
var clockPaused = true;
var roundEndTime = -1;
var hasSentGameEnd = false;
var hideMode = false;
var crashStartTime = -1;
var crashState = 0;
var lastRemainingSeconds = -1;
var oldLeader = -1;
var leader = -1;
}
Symbol 384 MovieClip [__Packages.util.CommCallback] Frame 0
interface util.CommCallback{}
Symbol 385 MovieClip [__Packages.util.Client] Frame 0
class util.Client
{
var id, name, avatar, isPlayer, isConnected;
function Client (id, name, avatar) {
this.id = id;
this.name = name;
this.avatar = avatar;
isPlayer = false;
isConnected = true;
}
}
Symbol 386 MovieClip [__Packages.com.midasplayer.wordbattle.Comm] Frame 0
class com.midasplayer.wordbattle.Comm
{
var connectedPlayers, playerIds, reversePlayerIds, board, bonuses, comm, serverIp, serverPort, slotId, magic, config, chars, scores, localClient;
function Comm (board) {
connectedPlayers = 0;
playerIds = new Array();
reversePlayerIds = new Array();
this.board = board;
parseGameData();
var _local2 = 0;
while (_local2 < 25) {
bonuses[_local2] = com.midasplayer.wordbattle.Letter.BONUS_NONE;
_local2++;
}
comm = new util.Communicator(this);
comm.connect(serverIp, serverPort, slotId, magic);
}
function parseGameData() {
var _local8 = new XML(_root.gameData);
config = new Object();
_global.textMappings = new Object();
var _local5 = _local8.firstChild.childNodes;
var _local4 = 0;
while (_local4 < _local5.length) {
if (config[_local5[_local4].nodeName] == undefined) {
config[_local5[_local4].nodeName] = new Object();
}
config[_local5[_local4].nodeName][_local5[_local4].attributes.id] = new String(_local5[_local4].firstChild.nodeValue);
if (_local5[_local4].nodeName == "text") {
_global.textMappings[_local5[_local4].attributes.id] = new String(_local5[_local4].firstChild.nodeValue);
}
if (_local5[_local4].nodeName == "multiplayer") {
serverIp = new String(_local5[_local4].attributes.hostname);
serverPort = new Number(_local5[_local4].attributes.port);
slotId = new String(_local5[_local4].attributes.slotid);
magic = new String(_local5[_local4].attributes.magic);
}
_local4++;
}
chars = new Array();
scores = new Array();
bonuses = new Array();
var _local7 = 0;
while (_local7 < 5) {
chars[_local7] = new Array();
scores[_local7] = new Array();
var _local6 = 0;
while (_local6 < 5) {
chars[_local7][_local6] = "?";
scores[_local7][_local6] = "4";
_local6++;
}
_local7++;
}
}
function getChar(x, y) {
return(chars[x][y]);
}
function getScore(x, y) {
return(scores[x][y]);
}
function getBonusAt(x, y) {
return(bonuses[x + (y * 5)]);
}
function submitWords(word0, word1, word2) {
var _local2 = "<words>";
_local2 = _local2 + (("<word id=\"1\">" + word0.getWordPos()) + "</word>");
_local2 = _local2 + (("<word id=\"2\">" + word1.getWordPos()) + "</word>");
_local2 = _local2 + (("<word id=\"3\">" + word2.getWordPos()) + "</word>");
_local2 = _local2 + "</words>";
fscommand ("playData", ("656,1 " + word0.getWordPos()) + "=0");
fscommand ("playData", ("656,2 " + word1.getWordPos()) + "=0");
fscommand ("playData", ("656,3 " + word2.getWordPos()) + "=0");
comm.sendData("JWS " + _local2);
}
function replace(str, from, to) {
return(str.split(from).join(to));
}
function disconnected() {
}
function tick() {
comm.tick();
}
function connecting() {
}
function unableToConnect() {
board.crashGame(_global.textMappings.unable_to_connect);
disconnected();
}
function localDisconnect() {
fscommand ("playData", ("188," + localClient.id) + "=0");
board.crashGame(_global.textMappings.local_disconnect);
disconnected();
}
function clientAccepted(client) {
board.scorePanel.nameLabel.text = client.name.substr(1, client.name.length - 2);
_root.infoLabel.text = _root.infoLabel.text + "\rClient accepted!";
comm.sendData("CIR");
localClient = client;
fscommand ("playData", ("111," + client.id) + "=0");
localPlayerNum = client.id;
board.connectedTime = getTimer();
}
function clientConnected(client) {
playerIds[connectedPlayers] = client;
reversePlayerIds[client.id] = connectedPlayers;
board["opponentLabel" + connectedPlayers].scorePanel.nameLabel.text = client.name.substr(1, client.name.length - 2);
board["opponentLabel" + connectedPlayers].activeFade.gotoAndPlay(2);
board.playerTotalScore[connectedPlayers] = 0;
_root.infoLabel.text = _root.infoLabel.text + ("\rClient connected: " + client.name.substr(1, client.name.length - 2));
fscommand ("playData", ("223," + client.id) + "=0");
connectedPlayers++;
board.sortScores();
}
function clientDisconnected(playerNum, remainingPlayers) {
var _local2 = reversePlayerIds[playerNum];
var _local3 = playerIds[_local2];
board["opponentLabel" + _local2].scorePanel.nameLabel.text = ("[" + _local3.name.substr(1, _local3.name.length - 2)) + "]";
board["opponentLabel" + _local2].activeFade.gotoAndPlay(12);
fscommand ("playData", ("244," + playerNum) + "=0");
if (remainingPlayers == 1) {
board.lastPlayer();
}
}
function startGame() {
_root.infoLabel.text = _root.infoLabel.text + "\rGamestart!";
fscommand ("playData", "1020=0");
comm.sendData("JGB");
board.gameStarted = true;
}
function gameCommand(cmdStr) {
var _local28 = cmdStr.substr(0, 3);
if (_local28 == "JSB") {
var _local34 = new XML(cmdStr.substr(4));
var _local22 = cmdStr.substr(4);
_local22 = _local22.substr(8);
_local22 = _local22.substr(0, _local22.length - 9);
fscommand ("playData", ((("819," + roundNum) + " ") + _local22) + "=0");
roundNum++;
var _local20 = _local22.split(" ");
var _local11 = 0;
var _local12 = 0;
while (_local12 < 5) {
var _local13 = 0;
while (_local13 < 5) {
var _local4 = _local20[_local11++].split(",");
chars[_local13][_local12] = new String(_local4[2]);
scores[_local13][_local12] = new Number(_local4[0]);
scores[_local13][_local12] = scores[_local13][_local12].valueOf();
var _local2 = new String(_local4[1]);
if (_local2 == "N") {
bonuses[_local13 + (_local12 * 5)] = com.midasplayer.wordbattle.Letter.BONUS_NONE;
}
if (_local2 == "2W") {
bonuses[_local13 + (_local12 * 5)] = com.midasplayer.wordbattle.Letter.BONUS_2X_WORD;
}
if (_local2 == "2L") {
bonuses[_local13 + (_local12 * 5)] = com.midasplayer.wordbattle.Letter.BONUS_2X_LETTER;
}
if (_local2 == "3L") {
bonuses[_local13 + (_local12 * 5)] = com.midasplayer.wordbattle.Letter.BONUS_3X_LETTER;
}
_local13++;
}
_local12++;
}
board.bricksReceived();
} else if (_local28 == "JWC") {
var _local33 = new XML(cmdStr.substr(4));
var _local3 = _local33.firstChild.childNodes;
var _local14 = new Array();
_local14[0] = new Array();
_local14[1] = new Array();
_local14[2] = new Array();
_local14[3] = new Array();
_local14[4] = new Array();
var _local15 = new Array();
_local15[0] = new Array();
_local15[1] = new Array();
_local15[2] = new Array();
_local15[3] = new Array();
_local15[4] = new Array();
var _local18 = new Array();
_local18[0] = false;
_local18[1] = false;
_local18[2] = false;
_local18[3] = false;
_local18[4] = false;
var _local29 = new Array();
_local29[0] = new Array();
_local29[1] = new Array();
_local29[2] = new Array();
_local29[3] = new Array();
_local29[4] = new Array();
var _local23 = 0;
var _local11 = 0;
while (_local11 < _local3.length) {
if (_local3[_local11].nodeName == "word") {
var _local7 = _local3[_local11].attributes.playernum.valueOf();
var _local25 = new Number(_local3[_local11].attributes.id);
var _local17 = new Number(_local3[_local11].attributes.score);
var _local26 = new Number(_local3[_local11].attributes.count);
var _local21 = new String(_local3[_local11].attributes.check);
var _local16 = new String(_local3[_local11].firstChild.nodeValue);
var _local24 = "";
if (_local16.length > 0) {
var _local10 = _local16.split(" ");
var _local5 = 0;
while (_local5 < _local10.length) {
var _local6 = _local10[_local5].split(",");
var _local9 = new Number(_local6[0]);
var _local8 = new Number(_local6[1]);
var _local13 = _local9.valueOf();
var _local12 = _local8.valueOf();
_local24 = _local24 + getChar(_local13, _local12);
_local5++;
}
} else {
_local26 = 0;
}
_local29[_local7][_local25 - 1] = _local24;
_local14[_local7][_local25 - 1] = _local17;
_local15[_local7][_local25 - 1] = _local26.valueOf() - 1;
_local18[_local7] = true;
if (_local7 == localPlayerNum) {
if (_local26.valueOf() > 1) {
_local23++;
}
fscommand ("playData", (((((("788," + _local3[_local11].attributes.id) + " ") + _local3[_local11].attributes.count) + " ") + _local3[_local11].attributes.check) + "=") + _local17);
}
}
_local11++;
}
board.prepareWords();
_local11 = 0;
while (_local11 < 4) {
var _local19 = playerIds[_local11].id;
if (_local18[_local19]) {
board.wordsAcceptedForPlayer(_local11, _local14[_local19][0], _local14[_local19][1], _local14[_local19][2], _local29[_local19][0], _local29[_local19][1], _local29[_local19][2], _local15[_local19][0], _local15[_local19][1], _local15[_local19][2], _local29[localPlayerNum][0], _local29[localPlayerNum][1], _local29[localPlayerNum][2]);
}
_local11++;
}
board.wordsAccepted(_local14[localPlayerNum][0], _local14[localPlayerNum][1], _local14[localPlayerNum][2], _local23, _local15[localPlayerNum][0], _local15[localPlayerNum][1], _local15[localPlayerNum][2]);
board.roundOver();
} else if (_local28 == "PWC") {
var _local29 = cmdStr.substr(4).split(" ");
var _local30 = new Number(_local29[0]);
var _local25 = _local30.valueOf();
var _local31 = new Number(_local29[1]);
var _local24 = _local31.valueOf();
var _local32 = new Number(_local29[2]);
var _local26 = _local32.valueOf();
var _local11 = 0;
while (_local11 < 4) {
var _local19 = playerIds[_local11].id;
if (_local19 == _local25) {
board.wordPreview(_local11, _local24, _local26);
}
_local11++;
}
}
}
function nextRound() {
comm.sendData("JGB");
}
function doGameOver() {
comm.sendData("CGO");
}
function sendWordPreview(word, count) {
comm.sendData((((("PWC " + localClient.id) + " ") + word) + " ") + count);
}
function shutdownForReal() {
comm.disconnect();
}
function endGamePressed() {
fscommand ("playData", "755=0");
}
var bonusReport = "";
var roundCount = 0;
var bonusPos = 0;
var localPlayerNum = -1;
var roundNum = 0;
}
Symbol 387 MovieClip [__Packages.util.Communicator] Frame 0
class util.Communicator
{
var callback, connectString, slotId, magic, socket;
function Communicator (callback) {
this.callback = callback;
}
function connect(serverIp, serverPort, slotId, magic) {
connectString = (serverIp + ":") + serverPort;
this.slotId = slotId;
this.magic = magic;
socket = new XMLSocket();
callback.connecting();
var thisComm = this;
socket.onConnect = function (success) {
_root.infoLabel.text = _root.infoLabel.text + ("\ronConnect: " + success);
if (success) {
thisComm.connected();
} else {
thisComm.unableToConnect();
}
};
socket.onData = function (str) {
_root.infoLabel.text = _root.infoLabel.text + ("\ronData: " + str);
thisComm.cmdReceived(str);
};
socket.onClose = function () {
_root.infoLabel.text = _root.infoLabel.text + "\ronClose";
thisComm.localDisconnect();
};
_root.infoLabel.text = _root.infoLabel.text + (((("\r!Connecting to " + serverIp) + ":") + serverPort) + "...");
if (!socket.connect(serverIp, serverPort)) {
_root.infoLabel.text = _root.infoLabel.text + "\r!connect: aww :'(";
thisComm.unableToConnect();
} else {
_root.infoLabel.text = _root.infoLabel.text + "\rconnect: yay =D";
}
}
function cmdReceived(str) {
_root.infoLabel.text = _root.infoLabel.text + ("\rGot CMD: " + str);
var _local3 = str.split(" ");
if (_local3[0] == "SCA") {
var _local7 = new Number(_local3[1]);
var _local4 = _local3[2];
var _local5 = 3;
while (_local4.charAt(_local4.length - 1) != "\"") {
_local4 = _local4 + (" " + _local3[_local5++]);
}
var _local8 = _local3[_local5];
callback.clientAccepted(new util.Client(_local7, _local4, _local8));
isConnected = true;
} else if (_local3[0] == "SAC") {
var _local7 = new Number(_local3[1]);
var _local4 = _local3[2];
var _local5 = 3;
while (_local4.charAt(_local4.length - 1) != "\"") {
_local4 = _local4 + (" " + _local3[_local5++]);
}
var _local8 = _local3[_local5];
callback.clientConnected(new util.Client(_local7, _local4, _local8));
} else if (_local3[0] == "SCD") {
var _local7 = new Number(_local3[1]);
var _local9 = new Number(_local3[2]);
callback.clientDisconnected(_local7, _local9);
} else if (_local3[0] == "SSG") {
fscommand ("gameStart");
callback.startGame();
} else if (_local3[0] == "STM") {
var _local10 = new Number(_local3[1]);
} else {
callback.gameCommand(str);
}
}
function unableToConnect() {
disconnected();
callback.unableToConnect();
}
function localDisconnect() {
disconnected();
callback.localDisconnect();
}
function disconnected() {
isConnected = false;
}
function connected() {
sendData((("CCC " + slotId) + " ") + magic);
}
function sendData(cmd) {
socket.send(cmd);
}
function disconnect() {
socket.close();
isConnected = false;
}
function tick() {
if (isConnected) {
var _local2 = getTimer();
if ((_local2 - lastPingTime) > 10000) {
lastPingTime = _local2;
sendData("CTM");
}
}
}
var pingTime = 4;
var lastPingTime = -1;
var isConnected = false;
}
Symbol 388 MovieClip [__Packages.com.midasplayer.wordbattle.LetterHolder] Frame 0
class com.midasplayer.wordbattle.LetterHolder extends MovieClip
{
var letter, tint1, tint2, tintColor1, tintColor2, board, lowerLetter;
function LetterHolder () {
super();
letter._visible = false;
tint1._visible = false;
tint2._visible = false;
tintColor1 = new Color(tint1);
tintColor1.setTransform({ra:100, rb:0, ga:100, gb:0, ba:100, bb:0, aa:0, ab:0});
tintColor2 = new Color(tint2);
tintColor2.setTransform({ra:100, rb:0, ga:100, gb:0, ba:100, bb:0, aa:0, ab:0});
}
function init(board, x, y) {
this.board = board;
lowerLetter.init(x, y);
}
function reveal(charStr, scoreStr, bonusType) {
revealing = true;
letter._visible = true;
letter.copyFrom(lowerLetter);
lowerLetter.setup(charStr, scoreStr, bonusType);
tintColor1.setTransform({ra:0, rb:0, ga:0, gb:0, ba:0, bb:0, aa:0, ab:0});
tintColor2.setTransform({ra:0, rb:0, ga:0, gb:0, ba:0, bb:0, aa:100, ab:0});
tint1._visible = true;
tint2._visible = true;
ya = 1;
}
function onPress() {
board.letterPressed(lowerLetter);
}
function onRollOver() {
if (lowerLetter.occupied != null) {
lowerLetter.occupied.previewMode = true;
}
}
function onRollOut() {
if (lowerLetter.occupied != null) {
lowerLetter.occupied.previewMode = false;
}
}
function onMouseUp() {
lowerLetter.pressed = false;
}
function onDragOut() {
lowerLetter.pressed = false;
}
function onEnterFrame() {
if (revealing) {
letter.y = letter.y - ya;
ya = ya + 1;
lowerLetter.y = (48 + letter.y) / 10;
tint1._y = letter._y / 6;
tint2._y = letter._y + 48;
if (letter._y < -48) {
revealing = false;
letter._visible = false;
letter.y = 0;
letter.clear();
lowerLetter.y = 0;
ya = 0;
tint1._visible = false;
tint2._visible = false;
tintColor1.setTransform({ra:0, rb:0, ga:0, gb:0, ba:0, bb:0, aa:100, ab:0});
tintColor2.setTransform({ra:0, rb:0, ga:0, gb:0, ba:0, bb:0, aa:100, ab:0});
} else {
tintColor1.setTransform({ra:0, rb:0, ga:0, gb:0, ba:0, bb:0, aa:((-letter._y) * 50) / 30, ab:0});
tintColor2.setTransform({ra:0, rb:0, ga:0, gb:0, ba:0, bb:0, aa:50 + ((letter._y * 50) / 48), ab:0});
}
}
}
var t = 0;
var ya = 0;
var revealing = false;
}
Symbol 389 MovieClip [__Packages.com.midasplayer.wordbattle.ScorePoof] Frame 0
class com.midasplayer.wordbattle.ScorePoof extends MovieClip
{
var scoreDivisor, gotoAndPlay;
function ScorePoof () {
super();
}
function show(num) {
scoreDivisor.gotoAndStop(num);
(gotoAndPlay(2));// not popped
}
}
Symbol 390 MovieClip [__Packages.com.midasplayer.wordbattle.NumberFlipper] Frame 0
class com.midasplayer.wordbattle.NumberFlipper extends MovieClip
{
var label;
function NumberFlipper () {
super();
}
function onEnterFrame() {
if (curValue != targetValue) {
curValue++;
if (curValue > 9) {
curValue = 0;
}
label.text = curValue.toString();
}
}
var curValue = 1;
var targetValue = 0;
}
Symbol 391 MovieClip [__Packages.com.midasplayer.wordbattle.ScorePanel] Frame 0
class com.midasplayer.wordbattle.ScorePanel extends MovieClip
{
var roundScoreLabelx, roundScoreLabel4, leaderGlow, roundScoreLabel0, roundScoreLabel1, roundScoreLabel2, roundScoreLabel3, leaderIndicator;
function ScorePanel () {
super();
}
function setPlayerMode(newPlayerMode) {
playerMode = newPlayerMode;
if (!playerMode) {
roundScoreLabelx._alpha = 0;
} else {
roundScoreLabel4._alpha = 0;
}
}
function onEnterFrame() {
if (glowFadeTime > 0) {
var _local2 = (getTimer() - glowFadeTime) / 6;
if (_local2 > 100) {
_local2 = 100;
glowFadeTime = -1;
}
leaderGlow._alpha = 100 - _local2;
}
}
function setRoundScore(newTargetRoundScore) {
targetRoundScore = newTargetRoundScore;
}
function showRoundScore() {
var _local2 = targetRoundScore;
if (!playerMode) {
_local2 = _local2 * 10;
}
roundScoreLabelx.targetValue = Math.floor(_local2 / 1) % 10;
roundScoreLabel0.targetValue = Math.floor(_local2 / 10) % 10;
roundScoreLabel1.targetValue = Math.floor(_local2 / 100) % 10;
roundScoreLabel2.targetValue = Math.floor(_local2 / 1000) % 10;
roundScoreLabel3.targetValue = Math.floor(_local2 / 10000) % 10;
roundScoreLabel4.targetValue = Math.floor(_local2 / 100000) % 10;
}
function isLeader() {
return(wasLeader);
}
function setLeader(leader) {
if (leader != wasLeader) {
if (leader) {
leaderIndicator._alpha = 100;
} else {
leaderIndicator._alpha = 0;
}
leaderGlow._alpha = 100;
glowFadeTime = getTimer();
wasLeader = leader;
}
}
var wasLeader = false;
var glowFadeTime = -1;
var playerMode = false;
var targetRoundScore = 0;
}
Symbol 392 MovieClip [__Packages.com.midasplayer.wordbattle.ReflectoText] Frame 0
class com.midasplayer.wordbattle.ReflectoText extends MovieClip
{
var mainTextHolder, shadowTextHolder, gotoAndPlay, gotoAndStop;
function ReflectoText () {
super();
}
function onEnterFrame() {
if (textChanged) {
textChanged = false;
mainTextHolder.textLabel.text = text;
shadowTextHolder.textLabel.text = text;
(gotoAndPlay(2));// not popped
}
}
function setInstaText(newText) {
setText(newText);
(gotoAndStop(15));// not popped
}
function fadeInText(newText) {
setText(newText);
(gotoAndPlay(2));// not popped
}
function setText(newText) {
textChanged = true;
text = newText;
mainTextHolder.textLabel.text = text;
shadowTextHolder.textLabel.text = text;
}
var text = "";
var textChanged = false;
}