Frame 1
_root.gameLogic = new com.midasplayer.pokerSolitaire.GameLogic();
_root.gameView = new com.midasplayer.pokerSolitaire.GameView();
_root.gameLogic.setGameView(_root.gameView);
_root.gameLogic.init(_root.gameBoardDummy);
_root._visible = false;
Symbol 48 MovieClip Frame 1
stop();
Symbol 172 MovieClip Frame 125
Symbol 181 MovieClip [Instruktion] Frame 1
stop();
Symbol 196 MovieClip [scorepop] Frame 21
this.removeMovieClip();
Symbol 209 MovieClip [nugget_rain] Frame 62
this.removeMovieClip();
Symbol 211 MovieClip [frozen_expl] Frame 25
this.removeMovieClip();
Symbol 215 MovieClip [Lvl3_star] Frame 55
this.removeMovieClip();
Symbol 219 MovieClip [Lvl2_star] Frame 55
this.removeMovieClip();
Symbol 223 MovieClip [Lvl1_star] Frame 55
this.removeMovieClip();
Symbol 234 MovieClip Frame 32
stop();
Symbol 260 MovieClip Frame 33
gotoAndPlay ("start");
Symbol 263 MovieClip [levelCleared] Frame 1
this.bonus._visible = false;
this.score._visible = false;
Symbol 263 MovieClip [levelCleared] Frame 60
this.bonus._visible = true;
Symbol 263 MovieClip [levelCleared] Frame 100
_root.gameView.updateScore();
this.score._visible = true;
if (_root.gameLogic.getLevel() < 3) {
stop();
}
Symbol 263 MovieClip [levelCleared] Frame 228
stop();
Symbol 264 MovieClip [cardflip] Frame 4
var numberFlips = 3;
var flipIndex = Math.floor(Math.random() * numberFlips);
var i = 0;
while (i < numberFlips) {
if (i != flipIndex) {
this["flip_" + i]._visible = false;
}
i++;
}
Symbol 264 MovieClip [cardflip] Frame 15
this.removeMovieClip();
Symbol 267 MovieClip [explosion] Frame 27
this.removeMovieClip();
Symbol 269 MovieClip [Puff_anim] Frame 21
this.removeMovieClip();
Symbol 291 MovieClip Frame 1
stop();
Symbol 291 MovieClip Frame 12
_root.gameView.updateGoalHands();
Symbol 324 MovieClip [__Packages.com.midasplayer.gameCore.AbstractGameLogic] Frame 0
class com.midasplayer.gameCore.AbstractGameLogic
{
var m_gameMode, m_randomSeed, m_random, m_performanceTimer, m_performanceTimerName, m_scopeRef, m_resetTick, m_tickCount, m_gameState, m_gda, m_world, NUMBER_LEVELS, m_timeLimit, m_gameView, m_timeLeft, m_pendingStateStart, m_clientInput, m_infoScreen;
function AbstractGameLogic () {
}
function getGameMode() {
return(m_gameMode);
}
function setAchievement(achievement) {
m_hasAchievement = achievement;
}
function hasAchievement() {
return(m_hasAchievement);
}
function getSeed() {
return(m_randomSeed);
}
function getRandom() {
return(m_random);
}
function setTicksPerSecond(ticksPerSecond) {
TICKS_PER_SECOND = ticksPerSecond;
TIME_PER_TICK = 1000 / TICKS_PER_SECOND;
}
function getTicksPerSecond() {
return(TICKS_PER_SECOND);
}
function getTimePerTick() {
return(TIME_PER_TICK);
}
function isServer() {
return(SERVER);
}
function isClient() {
return(!SERVER);
}
function startPerformaceTimer(scope, functionName) {
if (!PERFORMANCE_LOG) {
return(undefined);
}
m_performanceTimer.insert(getTimer());
m_performanceTimerName.insert((scope + "::") + functionName);
}
function stopPerformaceTimer() {
if (!PERFORMANCE_LOG) {
return(undefined);
}
var _local3 = m_performanceTimer.size() - 1;
var _local6 = getTimer() - Number(m_performanceTimer.get(_local3));
var _local5 = String(m_performanceTimerName.get(_local3));
m_performanceTimer.removeByIndex(_local3);
m_performanceTimerName.removeByIndex(_local3);
var _local4 = "";
var _local2 = 0;
while (_local2 < _local3) {
_local4 = _local4 + "- ";
_local2++;
}
_local4 = _local4 + (((("[" + _local5) + "]:\t") + _local6) + " ms");
trace(_local4);
}
function init(scopeRef) {
m_scopeRef = scopeRef;
m_resetTick = true;
m_tickCount = 0;
m_lastTickTime = -1;
m_ipTime = 0;
m_gameState = com.midasplayer.gameCore.GameState.INSTRUCTIONS;
if (isClient()) {
m_gda = new com.midasplayer.util.GameDataAcquirer();
m_gda.beginWait(mx.utils.Delegate.create(this, setupGame));
}
m_world = new com.midasplayer.gameCore.World(this, getScopeRef());
onInit();
if (DEV) {
new com.midasplayer.util.FpsCounter(_root);
}
if (PERFORMANCE_LOG) {
m_performanceTimer = new com.midasplayer.util.ArrayList();
m_performanceTimerName = new com.midasplayer.util.ArrayList();
}
}
function getScopeRef() {
return(m_scopeRef);
}
function setupGame() {
m_gameMode = Number(m_gda.getGameData("gameMode"));
m_randomSeed = Number(m_gda.getGameData("randomSeed"));
m_random = new com.midasplayer.util.Random(m_randomSeed);
NUMBER_LEVELS = Number(m_gda.getGameData("numberLevels"));
m_timeLimit = new com.midasplayer.util.ArrayList(m_gda.getGameData("timeLimit"));
if (m_timeLimit.size() < NUMBER_LEVELS) {
var _local3 = Number(m_timeLimit.get(0));
m_timeLimit = new com.midasplayer.util.ArrayList();
var _local2 = 0;
while (_local2 < NUMBER_LEVELS) {
m_timeLimit.insert(_local3);
_local2++;
}
}
onSetGameData(m_gda);
parseClientInput();
getGameView().onInit();
m_scopeRef.onEnterFrame = mx.utils.Delegate.create(this, update);
}
function setGameView(gameView) {
m_gameView = gameView;
m_gameView.setGameLogic(this);
}
function getWorld() {
return(m_world);
}
function getGameLogic() {
return(this);
}
function getTickCount() {
return(m_tickCount);
}
function getIPTime() {
return(m_ipTime);
}
function getGameTime() {
return(getTickCount() * TIME_PER_TICK);
}
function getScore() {
return(m_score);
}
function setScore(score) {
m_score = Math.max(score, 0);
}
function addScore(score) {
m_score = Math.max(m_score + score, 0);
trace("Add score: " + score);
trace("-- Total score: " + m_score);
}
function getLevel() {
return(m_level);
}
function getNumberLevels() {
return(NUMBER_LEVELS);
}
function addTime(time) {
m_timeLeft = Math.max(m_timeLeft + time, 0);
}
function getTimeLeft() {
return(m_timeLeft);
}
function getTimeLeftPercent() {
return((getTimeLeft() / m_timeLimit.get(getLevel())) * 100);
}
function getState() {
return(m_gameState);
}
function getStateString() {
if (m_gameState == com.midasplayer.gameCore.GameState.INSTRUCTIONS) {
return("INSTRUCTIONS");
}
if (m_gameState == com.midasplayer.gameCore.GameState.GAME_START) {
return("GAME_START");
}
if (m_gameState == com.midasplayer.gameCore.GameState.LEVEL_SETUP) {
return("LEVEL_SETUP");
}
if (m_gameState == com.midasplayer.gameCore.GameState.LEVEL_START_PENDING) {
return("LEVEL_START_PENDING");
}
if (m_gameState == com.midasplayer.gameCore.GameState.LEVEL_RUNNING) {
return("LEVEL_RUNNING");
}
if (m_gameState == com.midasplayer.gameCore.GameState.LEVEL_OVER_PENDING) {
return("LEVEL_OVER_PENDING");
}
if (m_gameState == com.midasplayer.gameCore.GameState.LEVEL_OVER) {
return("LEVEL_OVER");
}
if (m_gameState == com.midasplayer.gameCore.GameState.LEVEL_SUMMARY) {
return("LEVEL_SUMMARY");
}
if (m_gameState == com.midasplayer.gameCore.GameState.GAME_OVER_PENDING) {
return("GAME_OVER_PENDING");
}
if (m_gameState == com.midasplayer.gameCore.GameState.GAME_OVER) {
return("GAME_OVER");
}
if (m_gameState == com.midasplayer.gameCore.GameState.GAME_SUMMARY) {
return("GAME_SUMMARY");
}
if (m_gameState == com.midasplayer.gameCore.GameState.GAME_QUIT) {
return("GAME_QUIT");
}
return("NONE");
}
function setState(state) {
m_gameState = state;
if (((state == com.midasplayer.gameCore.GameState.LEVEL_START_PENDING) || (state == com.midasplayer.gameCore.GameState.LEVEL_OVER_PENDING)) || (state == com.midasplayer.gameCore.GameState.GAME_OVER_PENDING)) {
m_pendingStateStart = getTickCount();
}
}
function getPendingStateDurationStart() {
return(m_pendingStateDuration[0]);
}
function getPendingStateDurationEnd() {
return(m_pendingStateDuration[1]);
}
function setPendingStateDuration(durationStart, durationEnd) {
m_pendingStateDuration[0] = durationStart;
m_pendingStateDuration[1] = durationEnd;
}
function isPractice() {
return(PRACTICE_GAME);
}
function isDev() {
return(DEV);
}
function isLocalGame() {
return(LOCAL_GAME);
}
function update() {
checkForServerResponse();
if (m_gameState == com.midasplayer.gameCore.GameState.NONE) {
trace("INVALID GAME STATE!!");
} else if (m_gameState == com.midasplayer.gameCore.GameState.INSTRUCTIONS) {
getGameLogic().updateInfoScreen();
} else if (m_gameState == com.midasplayer.gameCore.GameState.GAME_START) {
fscommand ("gameStart");
setState(com.midasplayer.gameCore.GameState.LEVEL_SETUP);
} else if (m_gameState == com.midasplayer.gameCore.GameState.LEVEL_SETUP) {
trace("-- State: SETUP");
m_resetTick = true;
m_timeLeft = Number(m_timeLimit.get(getLevel()));
onLevelSetup();
getGameView().onLevelSetup();
setState(com.midasplayer.gameCore.GameState.LEVEL_START_PENDING);
} else if (m_gameState == com.midasplayer.gameCore.GameState.LEVEL_START_PENDING) {
checkPendingState();
gameLoop();
} else if (m_gameState == com.midasplayer.gameCore.GameState.LEVEL_RUNNING) {
gameLoop();
} else if (m_gameState == com.midasplayer.gameCore.GameState.LEVEL_OVER_PENDING) {
checkPendingState();
gameLoop();
} else if (m_gameState == com.midasplayer.gameCore.GameState.LEVEL_OVER) {
trace("-- State: LEVEL_OVER");
onLevelOver();
m_level++;
if (m_level >= NUMBER_LEVELS) {
setState(com.midasplayer.gameCore.GameState.GAME_OVER);
} else {
setState(com.midasplayer.gameCore.GameState.LEVEL_SUMMARY);
}
} else if (m_gameState == com.midasplayer.gameCore.GameState.LEVEL_SUMMARY) {
getGameLogic().updateInfoScreen();
} else if (m_gameState == com.midasplayer.gameCore.GameState.GAME_OVER_PENDING) {
checkPendingState();
gameLoop();
} else if (m_gameState == com.midasplayer.gameCore.GameState.GAME_OVER) {
trace("-- State: GAME_OVER");
setState(com.midasplayer.gameCore.GameState.GAME_SUMMARY);
fscommand ("gameEnd", m_score);
trace("gameEnd: " + m_score);
} else if (m_gameState == com.midasplayer.gameCore.GameState.GAME_SUMMARY) {
getGameLogic().updateInfoScreen();
} else if (m_gameState == com.midasplayer.gameCore.GameState.GAME_QUIT) {
if (!m_gameQuit) {
fscommand ("gameQuit");
m_gameQuit = true;
}
}
}
function completeLevel() {
if (getState() != com.midasplayer.gameCore.GameState.LEVEL_RUNNING) {
return(undefined);
}
setState(com.midasplayer.gameCore.GameState.LEVEL_OVER_PENDING);
onCompleteLevel();
getGameView().onCompleteLevel();
}
function gameOver() {
if (getState() != com.midasplayer.gameCore.GameState.LEVEL_RUNNING) {
return(undefined);
}
setState(com.midasplayer.gameCore.GameState.GAME_OVER_PENDING);
onGameOver();
getGameView().onGameOver();
}
function checkPendingState() {
if (((m_gameState == com.midasplayer.gameCore.GameState.LEVEL_START_PENDING) || (m_gameState == com.midasplayer.gameCore.GameState.LEVEL_OVER_PENDING)) || (m_gameState == com.midasplayer.gameCore.GameState.GAME_OVER_PENDING)) {
var _local3 = ((m_gameState == com.midasplayer.gameCore.GameState.LEVEL_START_PENDING) ? (m_pendingStateDuration[0]) : (m_pendingStateDuration[1]));
if (getTickCount() >= (m_pendingStateStart + _local3)) {
var _local2 = com.midasplayer.gameCore.GameState.NONE;
if (m_gameState == com.midasplayer.gameCore.GameState.LEVEL_START_PENDING) {
_local2 = com.midasplayer.gameCore.GameState.LEVEL_RUNNING;
} else if (m_gameState == com.midasplayer.gameCore.GameState.LEVEL_OVER_PENDING) {
_local2 = com.midasplayer.gameCore.GameState.LEVEL_OVER;
} else if (m_gameState == com.midasplayer.gameCore.GameState.GAME_OVER_PENDING) {
_local2 = com.midasplayer.gameCore.GameState.GAME_OVER;
}
setState(_local2);
}
}
}
function gameLoop() {
if (m_resetTick) {
m_resetTick = false;
m_lastTickTime = getTimer();
}
var _local2 = 0;
for(;;){
calcIPTime();
if (m_ipTime < 1) {
break;
}
tickGame();
if ((((getState() != com.midasplayer.gameCore.GameState.LEVEL_RUNNING) && (getState() != com.midasplayer.gameCore.GameState.LEVEL_START_PENDING)) && (getState() != com.midasplayer.gameCore.GameState.LEVEL_OVER_PENDING)) && (getState() != com.midasplayer.gameCore.GameState.GAME_OVER_PENDING)) {
break;
}
if (_local2 >= 1000) {
trace("Infinite recursions or intolerable delay in gameLoop");
break;
}
if (getGameLogic().isDev() && (_local2 > 1)) {
break;
}
_local2++;
};
renderGame();
}
function calcIPTime() {
if (isServer()) {
m_ipTime = 1;
} else if (isClient()) {
m_ipTime = (getTimer() - m_lastTickTime) / TIME_PER_TICK;
}
}
function handleInput() {
if ((m_clientInput.size() > 0) && (getState() == com.midasplayer.gameCore.GameState.LEVEL_RUNNING)) {
var _local2;
do {
if ((m_clientInput == undefined) || (m_clientInput.size() == 0)) {
break;
}
_local2 = com.midasplayer.gameCore.ClientInput(m_clientInput.get(0));
var _local3 = _local2.getTick();
if (_local3 == getTickCount()) {
var _local4 = false;
_local4 = onHandleInput(_local2);
if (!_local4) {
trace("ClientInput NOT handled correctly. " + _local2.toString());
}
m_clientInput.removeByIndex(0);
} else if (_local3 < getTickCount()) {
trace((("ClientInput skipped! InputTick: " + _local3) + " Tick: ") + getTickCount());
}
} while ((_local2 != undefined) && (_local2.getTick() == getTickCount()));
}
}
function tickGame() {
handleInput();
getWorld().tick();
onTick();
getGameView().onTick();
m_lastTickTime = m_lastTickTime + TIME_PER_TICK;
m_tickCount++;
calcIPTime();
checkPendingState();
if (getState() == com.midasplayer.gameCore.GameState.LEVEL_RUNNING) {
m_timeLeft = m_timeLeft - TIME_PER_TICK;
if (getTimeLeft() <= 0) {
if (onLevelTimeUp()) {
completeLevel();
} else {
gameOver();
}
}
}
}
function renderGame() {
var _local2 = getIPTime();
getWorld().render(_local2);
onRender(_local2);
getGameView().onRender(_local2);
}
function sendRequest(request) {
request = request.split("<").join("<");
request = request.split(">").join(">");
request = request.split(""").join("\"");
fscommand ("request", request);
}
function sendPlaydata(playData) {
if (PRACTICE_GAME) {
return(undefined);
}
fscommand ("playData", playData);
trace("playData: " + playData);
}
function checkForServerResponse() {
if (_root.response != undefined) {
var _local3 = _root.response;
_root.response = undefined;
_local3 = _local3.split("<").join("<");
_local3 = _local3.split(">").join(">");
_local3 = _local3.split(""").join("\"");
onResponseReceived(_local3);
}
}
function trimArray(arrayList) {
var _local2 = 0;
while (_local2 < arrayList.size()) {
var _local1 = String(arrayList.get(_local2));
if (_local1.charAt(0) == " ") {
_local1 = _local1.substr(1);
}
if (_local1.charAt(_local1.length) == " ") {
_local1 = _local1.substring(0, _local1.length - 1);
}
arrayList.set(_local2, _local1);
_local2++;
}
}
function trace(string) {
if (isClient()) {
trace(string);
var _local2 = getScopeRef().debug_text;
_local2.text = (string + newline) + _local2.text;
if (!DEV) {
_local2._visible = false;
}
} else if (isServer()) {
}
}
function getInfoScreen() {
return(m_infoScreen);
}
function updateInfoScreen() {
var _local2 = getState();
if (m_infoScreen == undefined) {
m_infoScreen = new com.midasplayer.gameCore.InfoScreen();
var _local3 = com.midasplayer.gameCore.GameState.NONE;
if (_local2 == com.midasplayer.gameCore.GameState.INSTRUCTIONS) {
_local3 = com.midasplayer.gameCore.GameState.GAME_START;
} else if (_local2 == com.midasplayer.gameCore.GameState.LEVEL_SUMMARY) {
_local3 = com.midasplayer.gameCore.GameState.LEVEL_SETUP;
} else if (_local2 == com.midasplayer.gameCore.GameState.GAME_SUMMARY) {
_local3 = com.midasplayer.gameCore.GameState.GAME_QUIT;
}
m_infoScreen.setExitState(this, _local3);
m_gameView.onInitInfoScreen(m_infoScreen, _local2);
}
m_infoScreen.update();
m_gameView.onUpdateInfoScreen(m_infoScreen, _local2);
}
function infoScreenExit() {
var _local2 = m_infoScreen.getExitState();
setState(_local2);
m_infoScreen = undefined;
}
function addWorldObject(obj, worldLayer, symbol, clipName) {
return(getWorld().addWorldObject(obj, worldLayer, symbol, clipName));
}
function parseClientInput() {
var _local2 = _level0.playData;
m_clientInput = com.midasplayer.gameCore.ClientInput.parseInput(_local2);
}
function setClientInput(clientInputList) {
m_clientInput = clientInputList;
}
function getGameView() {
return(m_gameView);
}
function onSetGameData(gda) {
var _local2 = "onSetGameData";
trace(("~~ " + _local2) + "()");
}
function onResponseReceived(response) {
var _local2 = "onResponseReceived";
trace(("~~ " + _local2) + "()");
}
function onLevelSetup() {
var _local2 = "onLevelSetup";
trace(("~~ " + _local2) + "()");
}
function onLevelTimeUp() {
var _local2 = "onLevelTimeUp";
trace(("~~ " + _local2) + "()");
return(false);
}
function onLevelOver() {
var _local2 = "onLevelOver";
trace(("~~ " + _local2) + "()");
}
function onCompleteLevel() {
var _local2 = "onCompleteLevel";
trace(("~~ " + _local2) + "()");
}
function onGameOver() {
var _local2 = "onGameOver";
trace(("~~ " + _local2) + "()");
}
function onInit() {
var _local2 = "onInit";
trace(("~~ " + _local2) + "()");
}
function onTick() {
var _local1 = "onTick";
}
function onRender(ipTime) {
var _local1 = "onRender";
}
function onHandleInput(input) {
return(false);
}
static var PRACTICE_GAME = false;
static var DEV = false;
static var LOCAL_GAME = false;
static var PERFORMANCE_LOG = false;
var m_gameQuit = false;
static var GAME_MODE_NORMAL = 0;
static var GAME_MODE_SHORT = 1;
static var GAME_MODE_DELUXE = 2;
var m_pendingStateDuration = new Array(0, 0);
var m_lastTickTime = -1;
var m_ipTime = 0;
var m_score = 0;
var m_level = 0;
var m_hasAchievement = false;
static var TICKS_PER_SECOND = 4;
static var TIME_PER_TICK = 1000 / TICKS_PER_SECOND;
var SERVER = false;
}
Symbol 325 MovieClip [__Packages.com.midasplayer.gameCore.World] Frame 0
class com.midasplayer.gameCore.World
{
var m_scopeRef, m_gameLogic, m_clip, m_layers, m_worldObjects, m_worldObjectRemove;
function World (gameLogic, scope) {
m_scopeRef = scope;
m_gameLogic = gameLogic;
m_clip = m_scopeRef.createEmptyMovieClip("world", m_scopeRef.getNextHighestDepth());
m_clip._x = WORLD_OFFSET_X;
m_clip._y = WORLD_OFFSET_Y;
m_layers = new com.midasplayer.util.ArrayList();
m_worldObjects = new com.midasplayer.util.ArrayList();
m_worldObjectRemove = new com.midasplayer.util.ArrayList();
}
function getGameLogic() {
return(m_gameLogic);
}
function getClip() {
return(m_clip);
}
function render(ipTime) {
var _local3 = m_worldObjects.size();
var _local2 = 0;
while (_local2 < _local3) {
m_worldObjects.get(_local2).render(ipTime);
_local2++;
}
}
function tick() {
var _local5 = m_worldObjects.size();
var _local2 = 0;
while (_local2 < _local5) {
m_worldObjects.get(_local2).update();
_local2++;
}
_local2 = 0;
while (_local2 < _local5) {
m_worldObjects.get(_local2).onTick();
_local2++;
}
var _local4 = 0;
while (_local4 < m_worldObjectRemove.size()) {
_local2 = 0;
while (_local2 < m_worldObjects.size()) {
var _local3 = com.midasplayer.gameCore.WorldObject(m_worldObjects.get(_local2));
if (_local3.getObjId() == m_worldObjectRemove.get(_local4)) {
_local3.getObjectView().removeClip();
_local3.onRemovedFromWorld();
m_worldObjects.removeByIndex(_local2);
break;
}
_local2++;
}
_local4++;
}
if (m_worldObjectRemove.size() > 0) {
m_worldObjectRemove.clear();
}
}
function getLayer(layer) {
if (m_layers.size() <= layer) {
var _local2 = m_layers.size();
while (_local2 <= layer) {
addLayer();
_local2++;
}
}
return(MovieClip(m_layers.get(layer)));
}
function addLayer() {
m_layers.insert(getClip().createEmptyMovieClip("layer_" + m_layers.size(), getClip().getNextHighestDepth()));
return(m_layers.size());
}
function addWorldObject(obj, worldLayer, symbol, clipName) {
var _local3 = m_worldObjectIdCounter;
m_worldObjectIdCounter++;
obj.setObjId(_local3);
m_worldObjects.insert(obj);
addWorldObjectHelper(obj, symbol, worldLayer, clipName);
return(obj);
}
function addWorldObjectHelper(obj, symbol, worldLayer, clipName) {
obj.setGameLogic(m_gameLogic);
obj.setWorld(this);
obj.getObjectView().setClip(symbol, worldLayer, clipName);
obj.onAddedToWorld();
}
function clearWorldObjects() {
trace("clearWorldObjects");
var _local2 = 0;
while (_local2 < m_worldObjects.size()) {
var _local3 = com.midasplayer.gameCore.WorldObject(m_worldObjects.get(_local2));
_local3.getObjectView().removeClip();
_local3.onRemovedFromWorld();
_local2++;
}
m_worldObjects.clear();
}
function removeWorldObject(obj) {
m_worldObjectRemove.insert(obj.getObjId());
obj.getObjectView().setClip("");
}
function getAllWorldObjects() {
return(m_worldObjects);
}
function getWorldObject(objId) {
var _local2 = 0;
while (_local2 < m_worldObjects.size()) {
var _local3 = m_worldObjects[_local2];
if (_local3.getObjId() == objId) {
return(com.midasplayer.gameCore.WorldObject(m_worldObjects.get(_local2)));
}
_local2++;
}
return(undefined);
}
static var WORLD_EDGE_TOP = 0;
static var WORLD_EDGE_BOTTOM = 345;
static var WORLD_EDGE_LEFT = 0;
static var WORLD_EDGE_RIGHT = 460;
static var WORLD_OFFSET_X = 0;
static var WORLD_OFFSET_Y = 0;
var m_worldObjectIdCounter = 0;
}
Symbol 326 MovieClip [__Packages.com.midasplayer.util.ArrayList] Frame 0
class com.midasplayer.util.ArrayList
{
var value;
function ArrayList (ar) {
if (ar == undefined) {
value = new Array();
} else {
value = ar;
}
}
function insert(obj, pos) {
var _local2 = value.length;
if ((pos == undefined) || (pos >= _local2)) {
value.push(obj);
return(_local2);
}
value.splice(pos, 0, obj);
return(pos);
}
function get(pos) {
return(value[pos]);
}
function set(pos, o) {
value[pos] = o;
}
function indexOf(obj) {
var _local2 = 0;
while (_local2 < value.length) {
if (obj == value[_local2]) {
return(_local2);
}
_local2++;
}
return(-1);
}
function remove(obj) {
return(removeByIndex(indexOf(obj)));
}
function removeByIndex(pos) {
var _local2;
var _local4 = value.length;
if ((pos < _local4) && (pos >= 0)) {
_local2 = value[pos];
value.splice(pos, 1);
}
return(_local2);
}
function size() {
return(value.length);
}
function clear() {
value = new Array();
}
function toArray() {
return(value);
}
function foreach(fn) {
var _local2 = 0;
var _local3 = value.length;
while (_local2 < _local3) {
if (fn(_local2, value[_local2]) == false) {
break;
}
_local2++;
}
}
function sortOn(field) {
value.sortOn(field);
}
function sort(sortFn) {
value.sort(sortFn);
}
function get iterator() {
return(new com.midasplayer.util.ArrayListIterator(this));
}
function subList(from, to) {
if ((to > value.length) || (!to)) {
to = value.length;
}
var _local4 = value.slice(from, to);
var _local3 = new com.midasplayer.util.ArrayList(_local4);
return(_local3);
}
}
Symbol 327 MovieClip [__Packages.com.midasplayer.util.Iterator] Frame 0
interface com.midasplayer.util.Iterator
{
}
Symbol 328 MovieClip [__Packages.com.midasplayer.util.ArrayListIterator] Frame 0
class com.midasplayer.util.ArrayListIterator implements com.midasplayer.util.Iterator
{
var ptr, list;
function ArrayListIterator (list) {
ptr = 0;
this.list = list;
}
function next() {
if (ptr < list.size()) {
return(list.get(ptr++));
}
return(undefined);
}
function hasNext() {
return(ptr < list.size());
}
function remove() {
if (ptr == 0) {
return(undefined);
}
list.removeByIndex(ptr - 1);
}
}
Symbol 329 MovieClip [__Packages.com.midasplayer.gameCore.WorldObject] Frame 0
class com.midasplayer.gameCore.WorldObject
{
var DEFAULT_SYMBOL, m_animFrame, m_posX, m_posY, m_rotation, m_scaleX, m_scaleY, m_alpha, m_visible, m_objectView, m_gameLogic, m_world, m_parent;
function WorldObject (defaultSymbol) {
if ((defaultSymbol != undefined) && (defaultSymbol != "")) {
DEFAULT_SYMBOL = defaultSymbol;
}
m_animFrame = new com.midasplayer.gameCore.InterpolationValue(1);
m_posX = new com.midasplayer.gameCore.InterpolationValue(0);
m_posY = new com.midasplayer.gameCore.InterpolationValue(0);
m_rotation = new com.midasplayer.gameCore.InterpolationValue(0);
m_scaleX = new com.midasplayer.gameCore.InterpolationValue(100);
m_scaleY = new com.midasplayer.gameCore.InterpolationValue(100);
m_alpha = new com.midasplayer.gameCore.InterpolationValue(100);
m_visible = new Array();
m_visible.push(true);
m_visible.push(true);
if (m_objectView != undefined) {
deleteObjectView();
}
m_objectView = createObjectView();
getObjectView().setObject(this);
}
function deleteObjectView() {
delete m_objectView;
}
function setDefaultSymbol(symbol) {
DEFAULT_SYMBOL = symbol;
}
function getDefaultSymbol() {
return(DEFAULT_SYMBOL);
}
function setObjId(id) {
m_objectId = id;
}
function getObjId() {
return(m_objectId);
}
function setGameLogic(gameLogic) {
m_gameLogic = gameLogic;
}
function getGameLogic() {
return(m_gameLogic);
}
function setWorld(world) {
m_world = world;
}
function getWorld() {
return(m_world);
}
function removeFromWorld() {
m_world.removeWorldObject(this);
}
function setPerformCollision(collision) {
m_performCollision = collision;
}
function getPerformCollision() {
return(m_performCollision);
}
function setPhysicsEnabled(physics) {
m_physicsEnabled = physics;
}
function isPhysicsEnabled() {
return(m_physicsEnabled);
}
function setAnimated(animated) {
m_animated = animated;
}
function isAnimated() {
return(m_animated);
}
function animPlay() {
m_playing = true;
}
function animStop() {
m_playing = false;
}
function isAnimPlaying() {
return(m_playing);
}
function setAnimLooping(loop) {
m_looping = loop;
}
function isAnimLooping() {
return(m_looping);
}
function setPlaybackSpeed(speed) {
m_playbackSpeed = speed;
}
function getPlaybackSpeed() {
return(m_playbackSpeed);
}
function setFrame(frame) {
m_animFrame.setValue(frame);
}
function getFrame(ipTime) {
return(m_animFrame.getValue(ipTime));
}
function setParent(parent) {
m_parent = parent;
}
function getParent() {
return(m_parent);
}
function setX(x) {
m_posX.setValue(x);
getObjectView().makeDirty();
}
function setY(y) {
m_posY.setValue(y);
getObjectView().makeDirty();
}
function setPos(x, y) {
setX(x);
setY(y);
}
function setPrevX(x) {
m_posX.setPrevValue(x);
getObjectView().makeDirty();
}
function setPrevY(y) {
m_posY.setPrevValue(y);
getObjectView().makeDirty();
}
function setNextX(x) {
m_posX.setNextValue(x);
getObjectView().makeDirty();
}
function setNextY(y) {
m_posY.setNextValue(y);
getObjectView().makeDirty();
}
function setVelX(vel) {
m_posVelocityX = vel;
}
function setVelY(vel) {
m_posVelocityY = vel;
}
function setVel(vel) {
m_posVelocityX = vel.x;
m_posVelocityY = vel.y;
}
function addVelX(vel) {
m_posVelocityX = m_posVelocityX + vel;
}
function addVelY(vel) {
m_posVelocityY = m_posVelocityY + vel;
}
function setGravity(vel) {
m_gravity = vel;
}
function setRotation(rot) {
m_rotation.setValue(rot);
getObjectView().makeDirty();
}
function setRotationVel(vel) {
m_rotationVelocity = vel;
}
function addRotationVel(vel) {
m_rotationVelocity = m_rotationVelocity + vel;
}
function setScaleX(scale) {
m_scaleX.setValue(scale);
getObjectView().makeDirty();
}
function setNextScaleX(scale) {
m_scaleX.setNextValue(scale);
getObjectView().makeDirty();
}
function setScaleXVel(vel) {
m_scaleXVelocity = vel;
}
function setScaleY(scale) {
m_scaleY.setValue(scale);
getObjectView().makeDirty();
}
function setNextScaleY(scale) {
m_scaleY.setNextValue(scale);
getObjectView().makeDirty();
}
function setScaleYVel(vel) {
m_scaleYVelocity = vel;
}
function setAlpha(alpha) {
m_alpha.setValue(alpha);
getObjectView().makeDirty();
}
function setNextAlpha(alpha) {
m_alpha.setNextValue(alpha);
getObjectView().makeDirty();
}
function setAlphaVel(vel) {
m_alphaVelocity = vel;
}
function setVisible(visible) {
m_visible[0] = (m_visible[1] = visible);
getObjectView().makeDirty();
}
function setNextVisible(visible) {
m_visible[1] = visible;
getObjectView().makeDirty();
}
function getX(ipTime) {
return(m_posX.getValue(ipTime));
}
function getY(ipTime) {
return(m_posY.getValue(ipTime));
}
function getPos(ipTime) {
return(new com.midasplayer.util.Vec2D(m_posX.getValue(ipTime), m_posY.getValue(ipTime)));
}
function getVelX() {
return(m_posVelocityX);
}
function getVelY() {
return(m_posVelocityY);
}
function getVel() {
return(new com.midasplayer.util.Vec2D(m_posVelocityX, m_posVelocityY));
}
function getGravity() {
return(m_gravity);
}
function getRotation(ipTime) {
return(m_rotation.getValue(ipTime));
}
function getRotationVel() {
return(m_rotationVelocity);
}
function getScaleX(ipTime) {
return(m_scaleX.getValue(ipTime));
}
function getScaleXVel() {
return(m_scaleXVelocity);
}
function getScaleY(ipTime) {
return(m_scaleY.getValue(ipTime));
}
function getScaleYVel() {
return(m_scaleYVelocity);
}
function getAlpha(ipTime) {
return(m_alpha.getValue(ipTime));
}
function getAlphaVel() {
return(m_alphaVelocity);
}
function getVisible(ipTime) {
if (ipTime < 1) {
return(m_visible[0]);
}
return(m_visible[1]);
}
function setDestroyTick(tick) {
m_destroyTick = tick;
}
function getDestroyTick() {
return(m_destroyTick);
}
function getUseHandCursor() {
return(m_useHandCursor);
}
function setUseHandCursor(useHand) {
m_useHandCursor = useHand;
getObjectView().updateHandCursor();
}
function addInputEnabled(input) {
setInputEnabled(m_inputEnabled | input);
}
function removeInputEnabled(input) {
setInputEnabled(m_inputEnabled ^ input);
}
function setInputEnabled(input) {
m_inputEnabled = input;
getObjectView().setupInput();
}
function isInputEnabled(input) {
return((input & m_inputEnabled) == input);
}
function updatePhysics() {
}
function isDirty() {
return(m_dirty);
}
function updateIPValue(ipValue, vel) {
ipValue.updateValue(ipValue.getNextValue() + vel);
m_dirty = true;
}
function update() {
if ((m_destroyTick != -1) && (m_gameLogic.getTickCount() >= m_destroyTick)) {
m_world.removeWorldObject(this);
}
if (m_physicsEnabled) {
m_posVelocityY = m_posVelocityY + m_gravity;
}
m_dirty = false;
if (m_posVelocityX != 0) {
updateIPValue(m_posX, m_posVelocityX);
}
if (m_posVelocityY != 0) {
updateIPValue(m_posY, m_posVelocityY);
}
if (m_rotationVelocity != 0) {
updateIPValue(m_rotation, m_rotationVelocity);
}
if (m_alphaVelocity != 0) {
updateIPValue(m_alpha, m_alphaVelocity);
}
if (m_scaleXVelocity != 0) {
updateIPValue(m_scaleX, m_scaleXVelocity);
}
if (m_scaleYVelocity != 0) {
updateIPValue(m_scaleY, m_scaleYVelocity);
}
if (m_visible[0] != m_visible[1]) {
m_visible[0] = m_visible[1];
m_dirty = true;
}
if (m_animated && (m_playing)) {
var _local5 = m_animFrame.getNextValue() + m_playbackSpeed;
m_animFrame.updateValue(_local5);
var _local4 = m_animFrame.getPrevValue();
var _local3 = getObjectView().getFrames();
if (_local4 > _local3) {
if (!m_looping) {
m_animFrame.setValue(_local3);
animStop();
} else {
var _local2 = getObjectView().getFrames();
m_animFrame.setNextValue(m_animFrame.getNextValue() - _local2);
m_animFrame.setPrevValue(m_animFrame.getPrevValue() - _local2);
}
}
}
}
function render(ipTime) {
m_objectView.render(ipTime);
}
function createObjectView() {
return(new com.midasplayer.gameCore.WorldObjectView());
}
function getObjectView() {
return(m_objectView);
}
function onMouseEvent() {
}
function onPress() {
}
function onRelease() {
}
function onRollOver() {
}
function onRollOut() {
}
function onDragOver() {
}
function onDragOut() {
}
function onMouseMove() {
}
function onClipLoaded() {
}
function onAddedToWorld() {
}
function onRemovedFromWorld() {
}
function onTick() {
}
static var INPUT_NONE = 0;
static var INPUT_MOUSE_PRESS = 1;
static var INPUT_MOUSE_RELEASE = 2;
static var INPUT_MOUSE_ROLL_OVER = 4;
static var INPUT_MOUSE_ROLL_OUT = 8;
static var INPUT_MOUSE_DRAG_OVER = 16;
static var INPUT_MOUSE_DRAG_OUT = 32;
static var INPUT_MOUSE_MOVE = 64;
var m_objectId = -1;
var m_inputEnabled = 0;
var m_worldLayer = 0;
var m_useHandCursor = false;
var m_performCollision = false;
var m_physicsEnabled = true;
var m_animated = false;
var m_playing = true;
var m_looping = true;
var m_playbackSpeed = 0.2;
var m_posVelocityX = 0;
var m_posVelocityY = 0;
var m_gravity = 0;
var m_rotationVelocity = 0;
var m_scaleXVelocity = 0;
var m_scaleYVelocity = 0;
var m_alphaVelocity = 0;
var m_destroyTick = -1;
var m_dirty = false;
}
Symbol 330 MovieClip [__Packages.com.midasplayer.gameCore.WorldObjectView] Frame 0
class com.midasplayer.gameCore.WorldObjectView
{
var m_object, m_clip;
function WorldObjectView () {
}
function isDirty() {
return(m_dirty);
}
function makeDirty() {
m_dirty = true;
}
function setObject(worldObject) {
m_object = worldObject;
}
function getClip() {
return(m_clip);
}
function gotoAndStop(frame) {
getClip().gotoAndStop(frame);
}
function getFrames() {
return(getClip()._framesloaded);
}
function setClip(symbol, worldLayer, clipName) {
if (symbol == undefined) {
symbol = getObject().getDefaultSymbol();
}
if (worldLayer != undefined) {
m_worldLayer = worldLayer;
}
if ((clipName == undefined) || (clipName == null)) {
clipName = (symbol + "_") + getObject().getObjId();
}
var _local5 = getObject().getWorld().getLayer(m_worldLayer);
var _local3 = _local5.getNextHighestDepth();
if (m_clip != undefined) {
_local3 = m_clip.getDepth();
m_clip.removeMovieClip();
}
if (symbol == SYMBOL_EMPTY_MOVIECLIP) {
m_clip = _local5.createEmptyMovieClip(clipName, _local3);
} else if (symbol != "") {
m_clip = _local5.attachMovie(symbol, clipName, _local3);
if (m_clip == undefined) {
trace(((((("Falied to attach clip: " + symbol) + " for objId: ") + getObject().getObjId()) + " Symbol: '") + symbol) + "'");
}
} else {
m_clip = undefined;
}
m_clip._visible = false;
updateHandCursor();
makeDirty();
getObject().setFrame(1);
if (getObject().isAnimated()) {
m_clip.stop();
}
getObject().onClipLoaded();
onClipLoaded();
setupInput();
}
function removeClip() {
m_clip.removeMovieClip();
onClipRemoved();
}
function updateHandCursor() {
m_clip.useHandCursor = getObject().getUseHandCursor();
}
function setupInput() {
if (getObject().isInputEnabled(com.midasplayer.gameCore.WorldObject.INPUT_MOUSE_PRESS)) {
getClip().onPress = mx.utils.Delegate.create(this, onPress);
} else {
getClip().onPress = undefined;
}
if (getObject().isInputEnabled(com.midasplayer.gameCore.WorldObject.INPUT_MOUSE_RELEASE)) {
getClip().onRelease = mx.utils.Delegate.create(this, onRelease);
} else {
getClip().onRelease = undefined;
}
if (getObject().isInputEnabled(com.midasplayer.gameCore.WorldObject.INPUT_MOUSE_ROLL_OVER)) {
getClip().onRollOver = mx.utils.Delegate.create(this, onRollOver);
} else {
getClip().onRollOver = undefined;
}
if (getObject().isInputEnabled(com.midasplayer.gameCore.WorldObject.INPUT_MOUSE_ROLL_OUT)) {
getClip().onRollOut = mx.utils.Delegate.create(this, onRollOut);
} else {
getClip().onRollOut = undefined;
}
if (getObject().isInputEnabled(com.midasplayer.gameCore.WorldObject.INPUT_MOUSE_DRAG_OVER)) {
getClip().onDragOut = mx.utils.Delegate.create(this, onDragOut);
} else {
getClip().onDragOut = undefined;
}
if (getObject().isInputEnabled(com.midasplayer.gameCore.WorldObject.INPUT_MOUSE_DRAG_OUT)) {
getClip().onDragOut = mx.utils.Delegate.create(this, onDragOut);
} else {
getClip().onDragOut = undefined;
}
if (getObject().isInputEnabled(com.midasplayer.gameCore.WorldObject.INPUT_MOUSE_MOVE)) {
getClip().onMouseMove = mx.utils.Delegate.create(this, onMouseMove);
} else {
getClip().onMouseMove = undefined;
}
}
function isMouseOver() {
return(m_mouseOver);
}
function onPress() {
getObject().onPress();
getObject().onMouseEvent();
}
function onRelease() {
getObject().onRelease();
getObject().onMouseEvent();
}
function onRollOver() {
getObject().onRollOver();
m_mouseOver = true;
getObject().onMouseEvent();
}
function onRollOut() {
getObject().onRollOut();
m_mouseOver = false;
getObject().onMouseEvent();
}
function onDragOver() {
getObject().onDragOver();
m_mouseOver = true;
getObject().onMouseEvent();
}
function onDragOut() {
getObject().onDragOut();
m_mouseOver = false;
getObject().onMouseEvent();
}
function onMouseMove() {
getObject().onMouseMove();
getObject().onMouseEvent();
}
function render(ipTime) {
if (m_clip == undefined) {
return(undefined);
}
var _local2 = getObject();
if ((!m_dirty) && (_local2.isDirty())) {
makeDirty();
}
if (m_dirty) {
m_clip._x = _local2.getX(ipTime);
m_clip._y = _local2.getY(ipTime);
m_clip._rotation = _local2.getRotation(ipTime);
m_clip._xscale = _local2.getScaleX(ipTime);
m_clip._yscale = _local2.getScaleY(ipTime);
m_clip._alpha = _local2.getAlpha(ipTime);
m_clip._visible = _local2.getVisible(ipTime);
m_dirty = false;
}
onRender(ipTime);
}
function getGameLogic() {
return(getObject().getGameLogic());
}
function getObject() {
return(m_object);
}
function onClipLoaded() {
}
function onClipRemoved() {
}
function onRender(ipTime) {
}
static var SYMBOL_EMPTY_MOVIECLIP = "____symbol_empty_movieclip";
var m_mouseOver = false;
var m_worldLayer = 0;
var m_dirty = false;
}
Symbol 331 MovieClip [__Packages.mx.utils.Delegate] Frame 0
class mx.utils.Delegate extends Object
{
var func;
function Delegate (f) {
super();
func = f;
}
static function create(obj, func) {
var _local2 = function () {
var _local2 = arguments.callee.target;
var _local3 = arguments.callee.func;
return(_local3.apply(_local2, arguments));
};
_local2.target = obj;
_local2.func = func;
return(_local2);
}
function createDelegate(obj) {
return(create(obj, func));
}
}
Symbol 332 MovieClip [__Packages.com.midasplayer.gameCore.InterpolationValue] Frame 0
class com.midasplayer.gameCore.InterpolationValue
{
function InterpolationValue (startValue) {
if (startValue != undefined) {
setValue(startValue);
}
}
function getPrevValue() {
return(m_prevValue);
}
function getNextValue() {
return(m_nextValue);
}
function setValue(valueParam) {
setPrevValue(valueParam);
setNextValue(valueParam);
}
function setPrevValue(valueParam) {
m_prevValue = valueParam;
}
function setNextValue(valueParam) {
m_nextValue = valueParam;
}
function setWaypointValue(valueParam, IPparam) {
m_waypointValue = valueParam;
m_waypointIP = IPparam;
}
function clearWaypoint() {
m_waypointIP = -1;
}
function updateValue(valueParam) {
setPrevValue(getNextValue());
setNextValue(valueParam);
}
function getValue(ipTime) {
if (((ipTime == undefined) || (ipTime == 1)) || (m_prevValue == m_nextValue)) {
return(m_nextValue);
}
if (ipTime == 0) {
return(m_prevValue);
}
if ((m_waypointIP > 0) && (m_waypointIP < 1)) {
if (ipTime == m_waypointIP) {
return(m_waypointValue);
}
if (ipTime < m_waypointIP) {
return(m_prevValue + ((m_waypointValue - m_prevValue) * (ipTime / m_waypointIP)));
}
if (ipTime > m_waypointIP) {
return(m_waypointValue + (((m_nextValue - m_waypointValue) * (ipTime - m_waypointIP)) / (1 - m_waypointIP)));
}
}
return(m_prevValue + ((m_nextValue - m_prevValue) * ipTime));
}
var m_prevValue = 0;
var m_nextValue = 0;
var m_waypointValue = 0;
var m_waypointIP = -1;
}
Symbol 333 MovieClip [__Packages.com.midasplayer.util.Vec2D] Frame 0
class com.midasplayer.util.Vec2D
{
function Vec2D (x, y) {
if (x != undefined) {
this.x = x;
}
if (y != undefined) {
this.y = y;
}
}
function toString() {
return(((("<" + x) + ", ") + y) + ">");
}
function addition(vec) {
return(new com.midasplayer.util.Vec2D(x + vec.x, y + vec.y));
}
function subtract(vec) {
return(new com.midasplayer.util.Vec2D(x - vec.x, y - vec.y));
}
function multiply(scalar) {
return(new com.midasplayer.util.Vec2D(x * scalar, y * scalar));
}
function divide(scalar) {
return(new com.midasplayer.util.Vec2D(x / scalar, y / scalar));
}
function normalize() {
return(divide(length()));
}
function length() {
return(Math.sqrt(lengthSqr()));
}
function lengthSqr() {
return(Math.pow(x, 2) + Math.pow(y, 2));
}
function dot(vec) {
return((x * vec.x) + (y * vec.y));
}
function project(vec) {
var _local4 = dot(vec);
var _local3 = new com.midasplayer.util.Vec2D();
_local3.x = (_local4 / ((vec.x * vec.x) + (vec.y * vec.y))) * vec.x;
_local3.y = (_local4 / ((vec.x * vec.x) + (vec.y * vec.y))) * vec.y;
return(_local3);
}
var x = 0;
var y = 0;
}
Symbol 334 MovieClip [__Packages.com.midasplayer.gameCore.AbstractGameView] Frame 0
class com.midasplayer.gameCore.AbstractGameView
{
var m_gameLogic;
function AbstractGameView () {
}
function setGameLogic(gameLogic) {
m_gameLogic = gameLogic;
}
function getGameLogic() {
return(m_gameLogic);
}
function onInitInfoScreen(infoScreen, currentState) {
}
function onUpdateInfoScreen(infoScreen, currentState) {
}
function onInit() {
}
function onLevelSetup() {
}
function onCompleteLevel() {
}
function onGameOver() {
}
function onTick() {
}
function onRender(ipTime) {
}
}
Symbol 335 MovieClip [__Packages.com.midasplayer.gameCore.GameState] Frame 0
class com.midasplayer.gameCore.GameState
{
function GameState () {
}
static var NONE = -1;
static var INSTRUCTIONS = 0;
static var GAME_START = 1;
static var LEVEL_SETUP = 2;
static var LEVEL_START_PENDING = 3;
static var LEVEL_RUNNING = 4;
static var LEVEL_OVER_PENDING = 5;
static var LEVEL_OVER = 6;
static var LEVEL_SUMMARY = 7;
static var GAME_OVER_PENDING = 8;
static var GAME_OVER = 9;
static var GAME_SUMMARY = 10;
static var GAME_QUIT = 11;
}
Symbol 336 MovieClip [__Packages.com.midasplayer.gameCore.InfoScreen] Frame 0
class com.midasplayer.gameCore.InfoScreen
{
var m_okButtonText, m_clip, m_okButton, m_gameLogic, m_soundIdentifier;
function InfoScreen () {
m_okButtonText = com.midasplayer.util.I18n.getString("start");
}
function setDeleteOnExit(deleteOnExit) {
m_deleteOnExit = deleteOnExit;
}
function deleteOnExit() {
return(m_deleteOnExit);
}
function getTimePassed() {
return(m_expireTime - m_timeRemaining);
}
function getTimeRemaining() {
return(m_timeRemaining);
}
function setTimeRemaining(time) {
m_timeRemaining = time;
}
function setFps(fps) {
m_fps = fps;
}
function setLooping(looping) {
m_looping = looping;
}
function getClip() {
return(m_clip);
}
function init(parent, symbol, expireTime) {
if (symbol == undefined) {
symbol = DEFAULT_SYMBOL;
}
if (expireTime != undefined) {
m_expireTime = expireTime;
}
m_clip = parent.attachMovie(symbol, symbol + "_infoscreen", parent.getNextHighestDepth());
setOkButton(m_clip[SIGN_NAME].ok_button);
setExpireTime(expireTime);
}
function setClip(clip) {
m_clip = clip;
}
function setOkButton(okButton) {
m_okButton = okButton;
m_okButton.onPress = mx.utils.Delegate.create(this, exit);
m_okButton.onRollOver = mx.utils.Delegate.create(this, okButtonRollOver);
m_okButton.onRollOut = mx.utils.Delegate.create(this, okButtonRollOut);
}
function okButtonRollOver() {
m_okButton.gotoAndStop(2);
updateButtonText();
}
function okButtonRollOut() {
m_okButton.gotoAndStop(1);
updateButtonText();
}
function setPos(x, y) {
m_clip._x = x;
m_clip._y = y;
}
function setExitState(gameLogic, exitState) {
m_gameLogic = gameLogic;
m_exitState = exitState;
}
function getExitState() {
return(m_exitState);
}
function setExpireTime(expireTime) {
m_expireTime = expireTime;
m_startTime = getTimer();
m_timeRemaining = expireTime;
m_lastTimer = getTimer();
}
function setSound(sound, soundVolume) {
m_soundIdentifier = sound;
com.midasplayer.fx.SoundManager.play(m_soundIdentifier, soundVolume);
}
function setButtonText(textValue) {
m_okButtonText = textValue;
}
function setSignText(textFieldName, textValue) {
m_clip[SIGN_NAME][textFieldName].text = textValue;
}
function setText(textFieldName, textValue) {
m_clip[textFieldName].text = textValue;
}
function setElementVisible(name, visible) {
m_clip[name]._visible = visible;
}
function updateButtonText() {
m_okButton.text.text = m_okButtonText;
}
function update() {
if (m_clip == undefined) {
exit();
return(undefined);
}
var _local4 = (getTimer() - m_lastTimer) / 1000;
m_lastTimer = getTimer();
m_timeRemaining = m_timeRemaining - _local4;
var _local6 = m_okButtonText;
var _local5 = m_clip[SIGN_NAME][TIMER_NAME];
if (_local5 != undefined) {
_local5.gotoAndStop(m_timeRemaining - 1);
}
updateButtonText();
if (m_timeRemaining <= 0) {
exit();
}
var _local2;
if (_local2 != undefined) {
var _local3 = Math.floor(_local4 * m_fps);
if (m_looping) {
_local3 = (_local3 % _local2._framesloaded) + 1;
} else if (_local3 > _local2._framesloaded) {
_local3 = _local2._framesloaded;
}
_local2.gotoAndStop(_local3);
}
}
function exit() {
if (deleteOnExit() && (m_clip != undefined)) {
m_clip._visible = false;
m_clip.removeMovieClip();
trace("delete movie " + m_clip);
}
if (m_soundIdentifier != undefined) {
com.midasplayer.fx.SoundManager.stop(m_soundIdentifier);
}
m_gameLogic.infoScreenExit();
}
static var DEFAULT_SYMBOL = "info_screen";
static var SIGN_NAME = "sign";
static var ANIM_NAME = "anim";
static var TIMER_NAME = "timer";
static var OK_BUTTON_TEXT = "ok_button_text";
var m_startTime = -1;
var m_lastTimer = -1;
var m_expireTime = 10;
var m_exitState = com.midasplayer.gameCore.GameState.NONE;
var m_deleteOnExit = true;
var m_timeRemaining = -1;
var m_fps = 20;
var m_looping = true;
}
Symbol 337 MovieClip [__Packages.com.midasplayer.util.I18n] Frame 0
class com.midasplayer.util.I18n
{
static var lang;
function I18n () {
}
static function init(newLang) {
lang = newLang;
}
static function getString(name) {
var _local1 = lang.get(name);
if (_local1 == undefined) {
return(("{" + name) + "}");
}
return(_local1.toString());
}
}
Symbol 338 MovieClip [__Packages.com.midasplayer.util.Map] Frame 0
class com.midasplayer.util.Map
{
var map, lastSize;
function Map (init) {
map = new Object();
for (var _local3 in init) {
map["@" + _local3] = init[_local3];
}
lastSize = -1;
}
function put(key, value) {
map["@" + key] = value;
lastSize = -1;
}
function get(key) {
return(map["@" + key]);
}
function remove(key) {
var _local2 = map["@" + key];
delete map["@" + key];
lastSize = -1;
return(_local2);
}
function count() {
if (lastSize < 0) {
lastSize = 0;
for (var _local2 in map) {
lastSize++;
}
}
return(lastSize);
}
function size() {
return(count());
}
function clear() {
map = {};
lastSize = 0;
}
function dump() {
var _local2 = "";
for (var _local3 in map) {
_local2 = _local2 + (((_local3 + "=>") + map[_local3]) + newline);
}
trace(_local2);
}
function toArray() {
var _local2 = [];
for (var _local3 in map) {
_local2[_local2.length] = map[_local3];
}
return(_local2);
}
function keySet() {
var _local2 = [];
for (var _local3 in map) {
_local2[_local2.length] = _local3.substring(1);
}
return(_local2);
}
function foreach(fn) {
do {
if ((in map) == null) {
break;
}
var _local3 = in map;
} while (fn(_local3.substring(1), map[_local3]) != false);
do {
} while ("foreach" != null);
lastSize = -1;
}
}
Symbol 339 MovieClip [__Packages.com.midasplayer.fx.SoundManager] Frame 0
class com.midasplayer.fx.SoundManager
{
function SoundManager () {
}
static function parseGroup(group) {
return(((group == undefined) ? (DEFAULT_GROUP) : (group)));
}
static function addSoundGroup(group) {
var _local1 = soundEnabledMap.get(group);
if (_local1 == undefined) {
soundEnabledMap.put(group, {groupEnabled:isSoundEnabled(DEFAULT_GROUP)});
}
}
static function isSoundEnabled(group) {
group = parseGroup(group);
var _local1 = soundEnabledMap.get(group).groupEnabled;
if (_local1 == undefined) {
_local1 = true;
}
return(_local1);
}
static function enableSounds(enabled, group) {
group = parseGroup(group);
addSoundGroup(group);
var _local2 = (soundEnabledMap.get(group).groupEnabled = enabled);
trace(((("soundEnabled: " + isSoundEnabled(group)) + " '") + group) + "'");
if (!enabled) {
muteAll(group);
} else {
restoreMuteAll(group);
}
}
static function stopAll(group) {
sounds.foreach(function (name, soundEntry) {
soundEntry.sound.stop();
soundEntry.playStatus = false;
});
}
static function muteAll(group) {
group = parseGroup(group);
sounds.foreach(function (name, soundEntry) {
if (soundEntry.group == group) {
soundEntry.sound.setVolume(0);
}
});
}
static function restoreMuteAll(group) {
group = parseGroup(group);
sounds.foreach(function (name, soundEntry) {
if (soundEntry.group == group) {
soundEntry.sound.setVolume(soundEntry.realVol);
}
});
}
static function stop(resource) {
var _local1 = sounds.get(resource);
if (_local1 != undefined) {
_local1.sound.stop();
_local1.playStatus = false;
}
}
static function getCalibratedVolume(flashVolume) {
flashVolume = Math.min(100, flashVolume);
flashVolume = Math.max(0, flashVolume);
return(Math.ceil(Math.pow(flashVolume / 100, 1.46) * 100));
}
static function setVolume(resource, percent) {
var _local1 = sounds.get(resource);
if ((_local1 != undefined) && (_local1.playStatus == true)) {
var _local2 = getCalibratedVolume(percent);
_local1.sound.setVolume(_local2);
_local1.sound.volume = _local2;
}
}
static function isPlaying(resource) {
var _local1 = sounds.get(resource);
return((_local1 != undefined) && (_local1.playStatus == true));
}
static function play(resource, volume, isLoop, group) {
if (volume == undefined) {
volume = 100;
}
if (isLoop == undefined) {
isLoop = false;
}
volume = getCalibratedVolume(volume);
var _local1 = sounds.get(resource);
if (_local1 == undefined) {
_local1 = loadResource(resource, group);
}
if (_local1 != undefined) {
_local1.sound.setVolume((isSoundEnabled(_local1.group) ? (volume) : 0));
_local1.realVol = volume;
_local1.playStatus = true;
_local1.sound.start(0, (isLoop ? 32767 : 1));
}
}
static function loadResource(resource, group) {
group = parseGroup(group);
addSoundGroup(group);
var _local3 = _root.getNextHighestDepth();
var _local2 = new Sound(_root.createEmptyMovieClip("sm_sndhold_" + _local3, _local3));
_local2.attachSound(resource);
_local2.onSoundComplete = function () {
var _local1 = com.midasplayer.fx.SoundManager.sounds.get(resource);
_local1.playStatus = false;
};
sounds.put(resource, {realVol:100, sound:_local2, playStatus:true, group:group});
return(sounds.get(resource));
}
static var DEFAULT_GROUP = "default";
static var sounds = new com.midasplayer.util.Map();
static var soundEnabledMap = new com.midasplayer.util.Map();
}
Symbol 340 MovieClip [__Packages.com.midasplayer.util.GameDataAcquirer] Frame 0
class com.midasplayer.util.GameDataAcquirer
{
var attrib, multiplayerAttrib, trees, targetVar, dataEvent, timerFn, timer, error;
function GameDataAcquirer (variable) {
attrib = new com.midasplayer.util.Map();
multiplayerAttrib = new com.midasplayer.util.Map();
trees = new com.midasplayer.util.Map();
if (variable != undefined) {
targetVar = variable;
} else {
targetVar = "gameData";
}
}
function beginWait(fn) {
dataEvent = fn;
timerFn = function (caller) {
var _local1 = _level0[caller.targetVar];
if (((_local1 != undefined) && (_local1 != null)) && (_local1.length > 0)) {
caller.parse(_local1);
if (caller.dataEvent != undefined) {
caller.dataEvent();
}
caller.dataEvent = undefined;
clearInterval(caller.timer);
}
};
timer = setInterval(timerFn, 100, this);
}
function poll() {
if (!parsed) {
var _local2 = _level0[targetVar];
if (((_local2 != undefined) && (_local2 != null)) && (_local2.length > 0)) {
parse(_local2);
parsed = true;
return(true);
}
}
return(false);
}
function getAttributes() {
return(attrib);
}
function getSubTrees(name) {
return(trees.get(name));
}
function getGameData(name) {
return(attrib.get(name));
}
function getMultiplayerData(name) {
return(multiplayerAttrib.get(name));
}
function parse(data) {
attrib.clear();
var _local7 = new com.midasplayer.util.Map();
var _local9 = new XML();
_local9.ignoreWhite = true;
_local9.parseXML(data);
var _local4 = _local9.firstChild;
if (_local4.nodeName != "gamedata") {
error = "Bad XML (expected <gamedata>)";
return(undefined);
}
for (var _local8 in _local4.attributes) {
var _local5;
var _local3 = _local4.attributes[_local8];
if ((_local3.indexOf("[") == 0) && ((_local5 = _local3.indexOf("]")) != -1)) {
_local3 = _local3.substring(1, _local5).split(",");
}
attrib.put(_local8, _local3);
}
for (var _local8 in _local4.childNodes) {
var _local2 = _local4.childNodes[_local8];
switch (_local2.nodeName) {
case "text" :
_local7.put(_local2.attributes.id, _local2.firstChild.nodeValue);
break;
case "multiplayer" :
for (var _local8 in _local2.attributes) {
multiplayerAttrib.put(_local8, _local2.attributes[_local8]);
}
break;
default :
var _local6;
_local6 = trees.get(_local2.nodeName);
if (_local6 == undefined) {
trees.put(_local2.nodeName, [_local2]);
} else {
_local6.push(_local2);
}
}
}
trace("parse(): completed");
com.midasplayer.util.I18n.init(_local7);
}
var parsed = false;
}
Symbol 341 MovieClip [__Packages.com.midasplayer.util.Random] Frame 0
class com.midasplayer.util.Random
{
var mta, mti, lastSeed;
function Random (aSeed) {
mta = new Array(N);
mti = N + 1;
if (aSeed != undefined) {
init_genrand(aSeed);
}
}
function setSeed(s) {
init_genrand(s);
}
function getSeed() {
return(lastSeed);
}
function nextInt(n) {
return((genrand_int32() & 2147483647) % n);
}
function nextFloat() {
return(next(24) / 16777216);
}
function nextDouble() {
return(next(24) / 16777216);
}
function next(bits) {
if (bits < 32) {
return(genrand_int32() & ((1 << bits) - 1));
}
return(genrand_int32());
}
function init_genrand(s) {
s = int(s);
trace("Random::init_genrand(): seed=" + s);
var _local5 = getTimer();
lastSeed = s;
mta[0] = s;
var _local2 = s;
var _local3 = new com.midasplayer.util.Integer64();
mti = 1;
while (mti < N) {
_local3.init32((_local2 >>> 30) ^ _local2);
_local3.mulu32(1812433253);
_local2 = (mta[mti] = int(_local3.lsb + mti));
mti++;
}
var _local6 = getTimer();
trace(("Random::init_genrand(): initialization ~" + (_local6 - _local5)) + "ms");
}
function genrand_int32() {
var _local3 = 0;
if (mti >= N) {
if (mti == (N + 1)) {
init_genrand(5489);
}
var _local4 = getTimer();
var _local2 = 0;
_local2 = 0;
while (_local2 < (N - M)) {
_local3 = (mta[_local2] & UPPER_MASK) | (mta[_local2 + 1] & LOWER_MASK);
mta[_local2] = (mta[_local2 + M] ^ (_local3 >>> 1)) ^ mag01[_local3 & 1];
_local2++;
}
while (_local2 < (N - 1)) {
_local3 = (mta[_local2] & UPPER_MASK) | (mta[_local2 + 1] & LOWER_MASK);
mta[_local2] = (mta[_local2 + (M - N)] ^ (_local3 >>> 1)) ^ mag01[_local3 & 1];
_local2++;
}
_local3 = (mta[N - 1] & UPPER_MASK) | (mta[0] & LOWER_MASK);
mta[N - 1] = (mta[M - 1] ^ (_local3 >>> 1)) ^ mag01[_local3 & 1];
mti = 0;
var _local5 = getTimer();
trace(((("Random::genrand_int32(): precalc " + N) + " new numbers ~") + (_local5 - _local4)) + "ms");
}
_local3 = mta[mti++];
_local3 = _local3 ^ (_local3 >>> 11);
_local3 = _local3 ^ ((_local3 << 7) & 2636928640);
_local3 = _local3 ^ ((_local3 << 15) & 4022730752);
_local3 = _local3 ^ (_local3 >>> 18);
return(_local3);
}
static var N = 624;
static var M = 397;
static var MATRIX_A = 2567483615;
static var UPPER_MASK = 2147483648;
static var LOWER_MASK = 2147483647;
static var mag01 = [0, 2567483615];
}
Symbol 342 MovieClip [__Packages.com.midasplayer.util.Integer64] Frame 0
class com.midasplayer.util.Integer64
{
var r, p, s;
function Integer64 (lowInt) {
r = [[0, 0, 0, 0, 0], [0, 0, 0, 0, 0], [0, 0, 0, 0, 0], [0, 0, 0, 0, 0], [0, 0, 0, 0, 0]];
p = [0, 0, 0, 0, 0];
s = [0, 0, 0];
if (lowInt != undefined) {
merge(lowInt);
}
}
function init(v) {
var _local2 = 0;
while (_local2 < p.length) {
p[_local2] = v.p[_local2];
_local2++;
}
}
function init32(n) {
p[0] = n & 32767;
n = n >>> 15;
p[1] = n & 32767;
n = n >>> 15;
p[2] = n & 3;
p[3] = 0;
p[4] = 0;
}
function get lsb() {
return((p[0] | (p[1] << SH)) | ((p[2] & 3) << 30));
}
function get msb() {
return((((p[2] >> 2) | ((p[3] << SH) >> 2)) | ((p[4] << (SH * 2)) >> 2)) & 2147483647);
}
function binaryShiftLeft(step) {
var _local2 = 0;
while (_local2 < step) {
shl();
_local2++;
}
}
function binaryShiftRight(step) {
var _local4 = (step / SH) >> 0;
var _local5 = step - (_local4 * SH);
var _local2 = p.length - 1;
while (_local2 > 0) {
var _local3 = 0;
while (_local3 < _local4) {
p[_local3] = p[_local3 + 1];
_local3++;
}
p[_local2--] = 0;
}
if (_local5 > 0) {
var _local3 = 0;
while (_local3 < _local5) {
shr();
_local3++;
}
}
}
function binaryNot(o) {
p[0] = p[0] ^ o.p[0];
p[1] = p[1] ^ o.p[1];
p[2] = p[2] ^ o.p[2];
p[3] = p[3] ^ o.p[3];
p[4] = p[4] ^ o.p[4];
}
function add64(o) {
var _local4 = 0;
var _local3 = 1;
var _local2 = 0;
while ((_local3 < p.length) && (o.p[_local2] != 0)) {
_local3++;
}
_local2 = 0;
while (_local2 < _local3) {
_local4 = _local4 + (p[_local2] + o.p[_local2]);
p[_local2] = _local4 & MASK;
_local4 = _local4 >> SH;
_local2++;
}
}
function add32(num) {
var _local2 = 0;
var _local5 = num & MASK;
num = num >> SH;
var _local6 = num & MASK;
num = num >> SH;
var _local4 = num & 3;
_local2 = _local2 + (p[0] + _local5);
p[0] = _local2 & MASK;
_local2 = _local2 >> SH;
_local2 = _local2 + (p[1] + _local6);
p[1] = _local2 & MASK;
_local2 = _local2 >> SH;
_local2 = _local2 + (p[2] + _local4);
p[2] = _local2 & MASK;
}
function mulu32(num) {
var _local3 = 0;
s[0] = num & MASK;
num = num >>> 15;
s[1] = num & MASK;
num = num >>> 15;
s[2] = num & 3;
var _local2 = 0;
while (_local2 < 3) {
var _local4 = s[_local2];
_local3 = _local4 * p[0];
r[_local2][0] = _local3 & MASK;
_local3 = _local3 >> SH;
_local3 = _local3 + (_local4 * p[1]);
r[_local2][1] = _local3 & MASK;
_local3 = _local3 >> SH;
_local3 = _local3 + (_local4 * p[2]);
r[_local2][2] = _local3 & 3;
_local2++;
}
_local3 = r[0][0];
p[0] = _local3 & MASK;
_local3 = _local3 >> SH;
_local3 = _local3 + (r[0][1] + r[1][0]);
p[1] = _local3 & MASK;
_local3 = _local3 >> SH;
_local3 = _local3 + ((r[0][2] + r[1][1]) + r[2][0]);
p[2] = _local3 & 3;
p[3] = 0;
p[4] = 0;
}
function mul64(o) {
var _local2 = 0;
var _local3 = 0;
while (_local3 < 5) {
var _local4 = o.p[_local3];
_local2 = _local4 * p[0];
r[_local3][0] = _local2 & MASK;
_local2 = _local2 >> SH;
_local2 = _local2 + (_local4 * p[1]);
r[_local3][1] = _local2 & MASK;
_local2 = _local2 >> SH;
_local2 = _local2 + (_local4 * p[2]);
r[_local3][2] = _local2 & MASK;
_local2 = _local2 >> SH;
_local2 = _local2 + (_local4 * p[3]);
r[_local3][3] = _local2 & MASK;
_local2 = _local2 >> SH;
_local2 = _local2 + (_local4 * p[4]);
r[_local3][4] = _local2 & MASK;
_local3++;
}
_local2 = r[0][0];
p[0] = _local2 & MASK;
_local2 = _local2 >> SH;
_local2 = _local2 + (r[0][1] + r[1][0]);
p[1] = _local2 & MASK;
_local2 = _local2 >> SH;
_local2 = _local2 + ((r[0][2] + r[1][1]) + r[2][0]);
p[2] = _local2 & MASK;
_local2 = _local2 >> SH;
_local2 = _local2 + (((r[0][3] + r[1][2]) + r[2][1]) + r[3][0]);
p[3] = _local2 & MASK;
_local2 = _local2 >> SH;
_local2 = _local2 + ((((r[0][4] + r[1][3]) + r[2][2]) + r[3][1]) + r[4][0]);
p[4] = _local2 & 7;
}
function mul32(value) {
mul64(new com.midasplayer.util.Integer64(value));
}
function merge(a) {
var _local2 = 0;
while (_local2 < 3) {
p[_local2] = p[_local2] + (a & 32767);
a = a >>> 15;
_local2++;
}
return(a);
}
function shl() {
var _local5 = 0;
var _local4 = 0;
var _local2 = 0;
var _local3 = p.length;
while (_local2 < _local3) {
_local5 = (p[_local2] & 16384) >> 14;
p[_local2] = p[_local2] << 1;
p[_local2] = (p[_local2] | _local4) & 32767;
_local2++;
_local4 = _local5;
}
}
function shr() {
var _local4 = 0;
var _local3 = 0;
var _local2 = p.length - 1;
while (_local2 >= 0) {
_local4 = (p[_local2] & 1) << 14;
p[_local2] = p[_local2] >> 1;
p[_local2] = (p[_local2] | _local3) & 32767;
_local2--;
_local3 = _local4;
}
}
static var MASK = 32767;
static var SH = 15;
}
Symbol 343 MovieClip [__Packages.com.midasplayer.util.FpsCounter] Frame 0
class com.midasplayer.util.FpsCounter
{
var m_clip, m_textField;
function FpsCounter (scope) {
var _local4 = 0;
var _local3 = 0;
var _local2 = "fpsTextField";
m_clip = scope.createEmptyMovieClip("fpsCounter", scope.getNextHighestDepth());
m_clip.createTextField(_local2, m_clip.getNextHighestDepth(), _local4, _local3, 100, 30);
m_textField = m_clip[_local2];
m_textField.textColor = 16711680 /* 0xFF0000 */;
m_clip.onEnterFrame = mx.utils.Delegate.create(this, onRender);
}
function onRender() {
var _local2 = getTimer();
m_fpsCount++;
if ((getTimer() - m_lastFpsUpdateTime) >= 1000) {
var _local3 = "FPS: " + m_fpsCount;
m_lastFpsUpdateTime = _local2;
m_textField.text = _local3;
m_fpsCount = 0;
m_lastFpsUpdateTime = getTimer();
}
}
var m_fpsCount = 0;
var m_lastFpsUpdateTime = 0;
}
Symbol 344 MovieClip [__Packages.com.midasplayer.gameCore.ClientInput] Frame 0
class com.midasplayer.gameCore.ClientInput
{
var m_entries, m_time, m_type, m_tick;
function ClientInput () {
m_entries = new com.midasplayer.util.ArrayList();
m_time = new Date();
}
function setType(type) {
m_type = type;
}
function getType() {
return(m_type);
}
function setTick(tick) {
m_tick = tick;
}
function getTick() {
return(m_tick);
}
function getTime() {
return(m_time);
}
function addEntry(entry) {
m_entries.insert(entry);
}
function getNumEntries() {
return(m_entries.size());
}
function getInt(index) {
return(Number(m_entries.get(index)));
}
function toString() {
var _local3 = "";
_local3 = _local3 + "[CLIENT DATA] ";
_local3 = _local3 + ((("C:" + m_type) + " T:") + m_tick);
var _local2 = 0;
while (_local2 < m_entries.size()) {
_local3 = _local3 + ((" '" + String(m_entries.get(_local2))) + "'");
_local2++;
}
return(_local3);
}
static function parseInput(inputString) {
var _local13 = new com.midasplayer.util.ArrayList();
var _local12 = "[CDATA[";
var _local1 = 0;
var _local5 = 0;
var _local14 = 10000;
var _local8 = 0;
while (_local8 < _local14) {
_local1 = inputString.indexOf(_local12, _local1);
if (_local1 == -1) {
break;
}
_local1 = _local1 + _local12.length;
var _local4 = new com.midasplayer.gameCore.ClientInput();
_local5 = inputString.indexOf(",", _local1);
var _local9 = Number(inputString.substr(_local1, _local5 - _local1));
_local4.setType(_local9);
_local1 = _local5 + 1;
_local5 = inputString.indexOf(",", _local1);
var _local10 = inputString.substr(_local1, _local5 - _local1);
var _local3 = _local10.split(" ");
if (_local3.length > 0) {
var _local11 = Number(_local3[0]);
_local4.setTick(_local11);
_local3.splice(0, 1);
}
var _local2 = 0;
while (_local2 < _local3.length) {
var _local6 = _local3[_local2];
_local4.addEntry(_local6);
_local2++;
}
_local1 = _local5 + 1;
_local13.insert(_local4);
_local8++;
}
return(_local13);
}
}
Symbol 345 MovieClip [__Packages.com.midasplayer.pokerSolitaire.GameLogic] Frame 0
class com.midasplayer.pokerSolitaire.GameLogic extends com.midasplayer.gameCore.AbstractGameLogic
{
var m_gameBoard, m_gameView, trace, setTicksPerSecond, setPendingStateDuration, m_levelWidth, trimArray, m_levelHeight, m_levelLayout, m_decks, m_freeze, m_bombs, m_golden, m_goalHands, getNumberLevels, m_handsLimit, gameOver, getLevel, setAchievement, getState, getTickCount, sendPlaydata;
function GameLogic () {
super();
}
function getGameBoard() {
return(m_gameBoard);
}
function getGameView() {
return(com.midasplayer.pokerSolitaire.GameView(m_gameView));
}
function onInit() {
trace("INIT!!!");
com.midasplayer.gameCore.AbstractGameLogic.DEV = false;
com.midasplayer.gameCore.AbstractGameLogic.PERFORMANCE_LOG = false;
com.midasplayer.gameCore.AbstractGameLogic.PRACTICE_GAME = false;
m_gameBoard = new com.midasplayer.pokerSolitaire.GameBoard();
m_gameBoard.setGameLogic(this);
getGameView().setGameBoard(m_gameBoard);
setTicksPerSecond(4);
setPendingStateDuration(6, 4);
var _local3 = new Object();
_local3.onKeyDown = function () {
if (Key.getCode() == 32) {
trace("submit hand!");
_root.gameLogic.submitHand();
}
};
Key.addListener(_local3);
}
function onSetGameData(gda) {
trace("GameDataReceived");
m_levelWidth = new com.midasplayer.util.ArrayList(gda.getGameData("levelWidth"));
trimArray(m_levelWidth);
m_levelHeight = new com.midasplayer.util.ArrayList(gda.getGameData("levelHeight"));
trimArray(m_levelHeight);
m_levelLayout = new com.midasplayer.util.ArrayList(gda.getGameData("levelLayout"));
trimArray(m_levelLayout);
m_decks = new com.midasplayer.util.ArrayList();
m_freeze = new com.midasplayer.util.ArrayList();
m_bombs = new com.midasplayer.util.ArrayList();
m_golden = new com.midasplayer.util.ArrayList();
m_goalHands = new com.midasplayer.util.ArrayList();
var _local2 = 0;
while (_local2 < getNumberLevels()) {
var _local5 = new com.midasplayer.util.ArrayList(gda.getGameData("deck_" + _local2));
trimArray(_local5);
m_decks.insert(_local5);
var _local7 = new com.midasplayer.util.ArrayList(gda.getGameData("freeze_" + _local2));
trimArray(_local7);
m_freeze.insert(_local7);
var _local4 = new com.midasplayer.util.ArrayList(gda.getGameData("bombs_" + _local2));
trimArray(_local4);
m_bombs.insert(_local4);
var _local8 = new com.midasplayer.util.ArrayList(gda.getGameData("golden_" + _local2));
trimArray(_local8);
m_golden.insert(_local8);
var _local6 = new com.midasplayer.util.ArrayList(gda.getGameData("goalHands_" + _local2));
trimArray(_local6);
m_goalHands.insert(_local6);
_local2++;
}
m_handsLimit = new com.midasplayer.util.ArrayList(gda.getGameData("handsLimit"));
trimArray(m_handsLimit);
}
function onHandleInput(input) {
var _local2 = input.getType();
if (_local2 == com.midasplayer.pokerSolitaire.GameBoard.INPUT_TYPE_CLICK_CARD) {
var _local3 = input.getInt(0);
var _local4 = input.getInt(1);
getGameBoard().cardClicked(_local3, _local4);
trace(((("~~~~ clicked card - [" + _local3) + ", ") + _local4) + "]");
return(true);
}
if (_local2 == com.midasplayer.pokerSolitaire.GameBoard.INPUT_TYPE_SUBMIT_HAND) {
submitHand();
trace("~~~~ submit hand ");
return(true);
}
if (_local2 == com.midasplayer.pokerSolitaire.GameBoard.INPUT_TYPE_QUIT) {
gameOver();
trace("~~~~ quit");
return(true);
}
return(false);
}
function onLevelSetup() {
trace("--- onLevelSetup");
var _local2 = getLevel();
var _local10 = Number(m_levelWidth.get(_local2));
var _local7 = Number(m_levelHeight.get(_local2));
var _local4 = String(m_levelLayout.get(_local2));
var _local5 = com.midasplayer.util.ArrayList(m_decks.get(_local2));
var _local9 = com.midasplayer.util.ArrayList(m_freeze.get(_local2));
var _local3 = com.midasplayer.util.ArrayList(m_bombs.get(_local2));
var _local11 = com.midasplayer.util.ArrayList(m_golden.get(_local2));
var _local8 = com.midasplayer.util.ArrayList(m_goalHands.get(_local2));
var _local6 = Number(m_handsLimit.get(_local2));
m_gameBoard.clearLevel();
m_gameBoard.setupLevel(_local10, _local7, _local4);
m_gameBoard.setDeck(_local5);
m_gameBoard.setFreeze(_local9);
m_gameBoard.setBombs(_local3);
m_gameBoard.setGolden(_local11);
m_gameBoard.setGoalHands(_local8);
m_gameBoard.setHandsLeft(_local6);
m_gameBoard.initCards();
}
function onLevelTimeUp() {
return(m_gameBoard.onLevelTimeUp());
}
function onCompleteLevel() {
if ((getLevel() >= 1) && (getGameBoard().hasValidAchievement())) {
setAchievement(true);
}
}
function exitButtonPush() {
if (getState() != com.midasplayer.gameCore.GameState.LEVEL_RUNNING) {
return(undefined);
}
var _local2 = ((com.midasplayer.pokerSolitaire.GameBoard.INPUT_TYPE_QUIT + ",") + getTickCount()) + " ,=0";
sendPlaydata(_local2);
gameOver();
}
function submitHand() {
getGameBoard().submitHand();
}
static var LAYER_CARDS_HITAREA = 0;
static var LAYER_CARDS = 1;
static var LAYER_CARD_EFFECT = 2;
static var LAYER_SCOREPOP = 3;
static var LAYER_OVERLAY_EFFECT = 4;
}
Symbol 346 MovieClip [__Packages.com.midasplayer.pokerSolitaire.GameBoard] Frame 0
class com.midasplayer.pokerSolitaire.GameBoard
{
var m_width, m_height, m_gameLogic, m_deck, m_cards, m_inputBuffer, m_activeHand, m_goalHands, m_bonus, m_levelBonusAdded, m_lastComboTick, m_handsLeft, m_freeze, m_bombs, m_golden;
function GameBoard () {
}
function getWidth() {
return(m_width);
}
function getHeight() {
return(m_height);
}
function hasValidAchievement() {
return(m_validAchievement);
}
function setGameLogic(gameLogic) {
m_gameLogic = gameLogic;
}
function getGameLogic() {
return(m_gameLogic);
}
function clearLevel() {
getGameLogic().getWorld().clearWorldObjects();
m_width = 0;
m_height = 0;
m_deck = new com.midasplayer.util.ArrayList();
m_deckIndex = 0;
m_cards = new com.midasplayer.util.ArrayList();
m_inputBuffer = new com.midasplayer.util.ArrayList();
m_activeHand = HAND_NONE;
m_goalHands = new com.midasplayer.util.ArrayList();
m_bonus = 0;
m_levelBonusAdded = false;
m_lastComboTick = -1000;
getGameLogic().getGameView().updateScore();
}
function getBonus() {
return(m_bonus);
}
function getActiveHand() {
return(m_activeHand);
}
function setGoalHands(goalHands) {
m_goalHands = goalHands;
getGameLogic().getGameView().updateGoalHands();
}
function setHandsLeft(handsLeft) {
m_handsLeft = handsLeft;
}
function setDeck(deck) {
m_deck = deck;
m_deckIndex = 0;
}
function setFreeze(freeze) {
m_freeze = freeze;
}
function setBombs(bombs) {
m_bombs = bombs;
}
function setGolden(golden) {
m_golden = golden;
}
function initCards() {
var _local4 = m_height - 1;
while (_local4 >= 0) {
var _local2 = 0;
while (_local2 < m_width) {
var _local3 = getCard(_local2, _local4);
if (_local3 == undefined) {
} else {
_local3.setValueString(dealCard());
}
_local2++;
}
_local4--;
}
increaseFreeze();
countdownBombs();
}
function dealCard() {
var _local9 = String(m_deck.get(m_deckIndex));
var _local7 = false;
var _local2 = 0;
while (_local2 < m_bombs.size()) {
var _local4 = Number(m_bombs.get(_local2));
if (m_deckIndex == _local4) {
trace("deal card: BOMB " + m_deckIndex);
_local7 = true;
break;
}
_local2++;
}
var _local6 = false;
_local2 = 0;
while (_local2 < m_freeze.size()) {
var _local5 = Number(m_freeze.get(_local2));
if (m_deckIndex == _local5) {
trace("deal card: FROZEN " + m_deckIndex);
_local6 = true;
break;
}
_local2++;
}
var _local8 = false;
_local2 = 0;
while (_local2 < m_golden.size()) {
var _local3 = Number(m_golden.get(_local2));
if (m_deckIndex == _local3) {
trace("deal card: GOLDEN " + m_deckIndex);
_local8 = true;
break;
}
_local2++;
}
_local9 = ((_local9 + (_local7 ? (com.midasplayer.pokerSolitaire.Card.BOMB_MAX + 1) : 0)) + (_local6 ? (com.midasplayer.pokerSolitaire.Card.FREEZE_PENDING) : 0)) + (_local8 ? 1 : 0);
m_deckIndex++;
if (m_deckIndex >= m_deck.size()) {
m_deckIndex = 0;
}
return(_local9);
}
function setupLevel(width, height, layout) {
clearLevel();
m_width = width;
m_height = height;
var _local4 = 0;
while (_local4 < m_height) {
var _local3 = 0;
while (_local3 < m_width) {
var _local2;
var _local5 = layout.charAt((_local4 * m_width) + _local3);
if (_local5 != LEVEL_ITEM_EMPTY) {
_local2 = com.midasplayer.pokerSolitaire.Card(getGameLogic().addWorldObject(new com.midasplayer.pokerSolitaire.Card(), com.midasplayer.pokerSolitaire.GameLogic.LAYER_CARDS));
_local2.setGameBoard(this);
_local2.setBoardPos(_local3, _local4);
_local2.setFalldownOffset(2);
}
m_cards.insert(_local2);
_local3++;
}
_local4++;
}
}
function isOffset(columnOrRow) {
return((columnOrRow % 2) == 1);
}
function getAdjacentCards(x, y) {
var _local6 = new com.midasplayer.util.ArrayList();
var _local3 = 0;
while (_local3 < 6) {
var _local2;
if (_local3 == 0) {
_local2 = getCard(x, y - 1);
} else if (_local3 == 1) {
_local2 = getCard(x, y + 1);
} else if (_local3 == 2) {
_local2 = getCard(x - 1, y);
} else if (_local3 == 3) {
_local2 = getCard(x + 1, y);
} else if (_local3 == 4) {
_local2 = getCard(x - 1, (isOffset(x) ? (y - 1) : (y + 1)));
} else if (_local3 == 5) {
_local2 = getCard(x + 1, (isOffset(x) ? (y - 1) : (y + 1)));
}
if ((_local2 != undefined) && (_local2 != null)) {
_local6.insert(_local2);
}
_local3++;
}
return(_local6);
}
function getAdjacentCardsInBuffer(x, y) {
var _local6 = new com.midasplayer.util.ArrayList();
var _local7 = getAdjacentCards(x, y);
var _local5 = 0;
while (_local5 < _local7.size()) {
var _local3 = com.midasplayer.pokerSolitaire.Card(_local7.get(_local5));
var _local2 = 0;
while (_local2 < m_inputBuffer.size()) {
var _local4 = getCardFromInputBuffer(_local2);
if (_local4 == _local3) {
_local6.insert(_local3);
}
_local2++;
}
_local5++;
}
return(_local6);
}
function getAdjacentCardsNotInBuffer(x, y) {
var _local8 = new com.midasplayer.util.ArrayList();
var _local7 = getAdjacentCards(x, y);
var _local5 = 0;
while (_local5 < _local7.size()) {
var _local6 = com.midasplayer.pokerSolitaire.Card(_local7.get(_local5));
var _local4 = false;
var _local2 = 0;
while (_local2 < m_inputBuffer.size()) {
var _local3 = getCardFromInputBuffer(_local2);
if (_local3 == _local6) {
_local4 = true;
}
_local2++;
}
if (!_local4) {
_local8.insert(_local6);
}
_local5++;
}
return(_local8);
}
function isAdjacent(x1, y1, x2, y2) {
var _local4 = getAdjacentCards(x1, y1);
var _local2 = 0;
while (_local2 < _local4.size()) {
var _local3 = com.midasplayer.pokerSolitaire.Card(_local4.get(_local2));
if ((_local3.getBoardX() == x2) && (_local3.getBoardY() == y2)) {
return(true);
}
_local2++;
}
return(false);
}
function getConnectedCards(activeCard, pieceList) {
var _local8 = getAdjacentCardsInBuffer(activeCard.getBoardX(), activeCard.getBoardY());
var _local6 = 0;
while (_local6 < _local8.size()) {
var _local3 = com.midasplayer.pokerSolitaire.Card(_local8.get(_local6));
var _local7 = false;
var _local2 = 0;
while (_local2 < pieceList.size()) {
var _local5 = com.midasplayer.pokerSolitaire.Card(pieceList.get(_local2));
if (_local3.getObjId() == _local5.getObjId()) {
_local7 = true;
}
_local2++;
}
if (!_local7) {
pieceList.insert(_local3);
getConnectedCards(_local3, pieceList);
}
_local6++;
}
}
function getCard(x, y) {
if ((x < 0) || (x >= m_width)) {
return(undefined);
}
if ((y < 0) || (y >= m_height)) {
return(undefined);
}
return(com.midasplayer.pokerSolitaire.Card(m_cards.get((y * m_width) + x)));
}
function cardClicked(x, y) {
var _local2 = new com.midasplayer.gameCore.ClientInput();
_local2.setType(INPUT_TYPE_CLICK_CARD);
_local2.setTick(getGameLogic().getTickCount());
_local2.addEntry(x);
_local2.addEntry(y);
handleClientInput(_local2);
}
static function inputSortBySize(a, b) {
var _local4 = com.midasplayer.util.ArrayList(a);
var _local3 = com.midasplayer.util.ArrayList(b);
var _local2 = _local4.size();
var _local1 = _local3.size();
if (_local2 > _local1) {
return(-1);
}
if (_local2 < _local1) {
return(1);
}
return(0);
}
function handleClientInput(clientInput) {
if ((getGameLogic().getState() != com.midasplayer.gameCore.GameState.LEVEL_RUNNING) || (clientInput.getTick() != getGameLogic().getTickCount())) {
return(false);
}
var _local51 = clientInput.getInt(0);
var _local50 = clientInput.getInt(1);
var _local57 = getCard(_local51, _local50);
if (_local57 == undefined) {
getGameLogic().trace("No card clicked!");
return(false);
}
var _local58 = ((((((INPUT_TYPE_CLICK_CARD + ",") + getGameLogic().getTickCount()) + " ") + _local51) + " ") + _local50) + " ,=0";
getGameLogic().sendPlaydata(_local58);
var _local4 = 0;
while (_local4 < m_cards.size()) {
var _local41 = com.midasplayer.pokerSolitaire.Card(m_cards.get(_local4));
if (_local41 != undefined) {
_local41.setDisabled(false);
}
_local4++;
}
var _local61 = false;
var _local53 = true;
_local4 = 0;
while (_local4 < m_inputBuffer.size()) {
var _local42 = com.midasplayer.gameCore.ClientInput(m_inputBuffer.get(_local4));
var _local45 = _local42.getInt(0);
var _local49 = _local42.getInt(1);
var _local41 = getCardFromInputBuffer(_local4);
_local41.setActive(false);
if ((_local45 == _local51) && (_local49 == _local50)) {
trace("remove card");
m_inputBuffer.removeByIndex(_local4);
_local4--;
_local53 = false;
}
_local4++;
}
if (!_local53) {
var _local60 = _local51;
var _local59 = _local50;
var _local7 = new com.midasplayer.util.ArrayList();
var _local30 = getAdjacentCardsInBuffer(_local60, _local59);
var _local35 = 0;
while (_local35 < _local30.size()) {
var _local19 = com.midasplayer.pokerSolitaire.Card(_local30.get(_local35));
var _local27 = false;
var _local31 = 0;
while (_local31 < _local7.size()) {
var _local12 = com.midasplayer.util.ArrayList(_local7.get(_local31));
var _local10 = 0;
while (_local10 < _local12.size()) {
var _local28 = com.midasplayer.pokerSolitaire.Card(_local12.get(_local10));
if (_local28.getObjId() == _local19.getObjId()) {
_local27 = true;
}
_local10++;
}
_local31++;
}
if (!_local27) {
var _local12 = new com.midasplayer.util.ArrayList();
_local12.insert(_local19);
getConnectedCards(_local19, _local12);
_local7.insert(_local12);
_local4 = 0;
while (_local4 < _local12.size()) {
var _local41 = com.midasplayer.pokerSolitaire.Card(_local12.get(_local4));
_local4++;
}
}
_local35++;
}
var _local20 = -1;
if (_local20 == -1) {
var _local43 = 0;
var _local31 = 0;
while (_local31 < _local7.size()) {
var _local25 = com.midasplayer.util.ArrayList(_local7.get(_local31));
var _local36 = _local25.size();
if (_local36 == _local43) {
_local20 = -1;
} else if (_local36 > _local43) {
_local20 = _local31;
_local43 = _local36;
}
_local31++;
}
}
if ((_local20 == -1) && (m_inputBuffer.size() > 0)) {
var _local52 = getCardFromInputBuffer(0);
var _local31 = 0;
while (_local31 < _local7.size()) {
if (_local20 != -1) {
break;
}
var _local25 = com.midasplayer.util.ArrayList(_local7.get(_local31));
var _local10 = 0;
while (_local10 < _local25.size()) {
var _local28 = com.midasplayer.pokerSolitaire.Card(_local25.get(_local10));
if (_local28.getObjId() == _local52.getObjId()) {
_local20 = _local31;
break;
}
_local10++;
}
_local31++;
}
}
var _local31 = 0;
while (_local31 < _local7.size()) {
if (_local31 == _local20) {
} else {
var _local25 = com.midasplayer.util.ArrayList(_local7.get(_local31));
var _local10 = 0;
while (_local10 < _local25.size()) {
var _local29 = com.midasplayer.pokerSolitaire.Card(_local25.get(_local10));
removeInputCard(_local29);
_local10++;
}
}
_local31++;
}
} else if (_local53) {
if (m_inputBuffer.size() > 0) {
var _local54 = false;
_local4 = 0;
while (_local4 < m_inputBuffer.size()) {
var _local40 = com.midasplayer.gameCore.ClientInput(m_inputBuffer.get(_local4));
var _local47 = _local40.getInt(0);
var _local46 = _local40.getInt(1);
if (isAdjacent(_local51, _local50, _local47, _local46)) {
_local54 = true;
break;
}
_local4++;
}
if (!_local54) {
clearClientInput();
_local53 = false;
}
}
if (m_inputBuffer.size() < 5) {
m_inputBuffer.insert(clientInput);
}
}
if (m_inputBuffer.size() >= 1) {
_local4 = 0;
while (_local4 < m_cards.size()) {
var _local41 = com.midasplayer.pokerSolitaire.Card(m_cards.get(_local4));
if (_local41 != undefined) {
_local41.setDisabled(true);
}
_local4++;
}
if (m_inputBuffer.size() < 5) {
_local4 = 0;
while (_local4 < m_inputBuffer.size()) {
var _local41 = getCardFromInputBuffer(_local4);
var _local30 = getAdjacentCards(_local41.getBoardX(), _local41.getBoardY());
var _local8 = 0;
while (_local8 < _local30.size()) {
var _local26 = com.midasplayer.pokerSolitaire.Card(_local30.get(_local8));
_local26.setDisabled(false);
_local8++;
}
_local4++;
}
}
_local4 = 0;
while (_local4 < m_inputBuffer.size()) {
var _local41 = getCardFromInputBuffer(_local4);
_local41.setActive(true);
_local41.setDisabled(false);
_local4++;
}
}
com.midasplayer.fx.SoundManager.play(com.midasplayer.pokerSolitaire.GameView.SOUND_MARK_CARD, com.midasplayer.pokerSolitaire.GameView.SOUND_MARK_CARD_VOLUME);
var _local5 = new com.midasplayer.util.ArrayList();
var _local23 = 0;
var _local3 = true;
var _local44 = com.midasplayer.pokerSolitaire.Card.COLOR_NONE;
var _local22 = true;
var _local21 = new Array(0, 0, 0, 0, 0);
var _local38 = 0;
var _local56 = m_inputBuffer.size();
var _local34 = 0;
while (_local34 < m_inputBuffer.size()) {
var _local18 = -1;
var _local37 = getCardFromInputBuffer(_local34);
var _local24 = _local37.getValue();
var _local39 = _local37.getColor();
if (_local24 == com.midasplayer.pokerSolitaire.Card.VALUE_JOKER) {
_local23++;
} else {
_local4 = 0;
while (_local4 < _local5.size()) {
var _local48 = com.midasplayer.util.ArrayList(_local5.get(_local4));
var _local14 = com.midasplayer.pokerSolitaire.Card(_local48.get(0));
if (_local24 == _local14.getValue()) {
_local18 = _local4;
break;
}
_local4++;
}
if (_local24 != com.midasplayer.pokerSolitaire.Card.VALUE_JOKER) {
if (_local22 && ((_local39 == _local44) || (_local44 == com.midasplayer.pokerSolitaire.Card.COLOR_NONE))) {
_local22 = true;
_local44 = _local39;
} else {
_local22 = false;
}
if (_local18 == -1) {
_local5.insert(new com.midasplayer.util.ArrayList());
_local18 = _local5.size() - 1;
}
var _local48 = com.midasplayer.util.ArrayList(_local5.get(_local18));
_local48.insert(_local37);
}
}
_local34++;
}
_local5.sort(inputSortBySize);
var _local13 = 100;
var _local17 = -1;
var _local33 = 0;
while (_local33 < 2) {
var _local32 = _local33 == 0;
_local13 = 100;
_local17 = -1;
_local3 = true;
_local4 = 0;
while (_local4 < _local5.size()) {
var _local15 = com.midasplayer.util.ArrayList(_local5.get(_local4));
var _local14 = com.midasplayer.pokerSolitaire.Card(_local15.get(0));
var _local16 = _local15.size();
_local21[_local4] = _local16;
if (_local16 > 1) {
_local3 = false;
}
if (_local3) {
var _local11 = _local13;
var _local9 = _local17;
_local11 = Math.min(_local14.getValueNum(_local32), _local13);
_local9 = Math.max(_local14.getValueNum(_local32), _local17);
if ((_local9 - _local11) < 5) {
_local3 = true;
_local13 = _local11;
_local17 = _local9;
} else {
_local3 = false;
break;
}
}
_local4++;
}
if (_local3) {
break;
}
_local33++;
}
_local38 = _local21[0];
if (_local56 != 5) {
_local22 = false;
_local3 = false;
}
var _local6 = HAND_NONE;
var _local2 = 0;
while (_local2 < HAND_LENGTH) {
if (_local2 == HAND_FIVE_OF_A_KIND) {
if ((_local38 + _local23) == 5) {
_local6 = _local2;
}
} else if (_local2 == HAND_ROYAL_FLUSH) {
if ((_local3 && (_local22)) && (_local13 >= 10)) {
_local6 = _local2;
}
} else if (_local2 == HAND_STRAIGHT_FLUSH) {
if (_local3 && (_local22)) {
_local6 = _local2;
}
} else if (_local2 == HAND_FOUR_OF_A_KIND) {
if ((_local38 + _local23) == 4) {
_local6 = _local2;
}
} else if (_local2 == HAND_FULL_HOUSE) {
if (((_local21[0] + _local23) == 3) && (_local21[1] == 2)) {
_local6 = _local2;
}
} else if (_local2 == HAND_STRAIGHT) {
if (_local3) {
_local6 = _local2;
}
} else if (_local2 == HAND_FLUSH) {
if (_local22) {
_local6 = _local2;
}
} else if (_local2 == HAND_THREE_OF_A_KIND) {
if ((_local38 + _local23) == 3) {
_local6 = _local2;
}
} else if (_local2 == HAND_TWO_PAIRS) {
if ((_local21[0] == 2) && (_local21[1] == 2)) {
_local6 = _local2;
}
} else if (_local2 == HAND_ONE_PAIR) {
if ((_local38 + _local23) == 2) {
_local6 = _local2;
}
}
if (_local6 != HAND_NONE) {
break;
}
_local2++;
}
m_activeHand = _local6;
if (canSubmitHand()) {
getGameLogic().getGameView().setSubmitButtonFrame(2);
} else {
getGameLogic().getGameView().setSubmitButtonFrame(1);
}
return(true);
}
function canSubmitHand() {
if (getGameLogic().getState() != com.midasplayer.gameCore.GameState.LEVEL_RUNNING) {
return(false);
}
if (getActiveHand() == HAND_NONE) {
return(false);
}
if (m_inputBuffer.size() != 5) {
return(false);
}
return(true);
}
function submitHand(sendPlaydata) {
if (sendPlaydata == undefined) {
sendPlaydata = true;
}
if (!canSubmitHand()) {
return(undefined);
}
if (sendPlaydata) {
var _local23 = ((INPUT_TYPE_SUBMIT_HAND + ",") + getGameLogic().getTickCount()) + " ,=0";
getGameLogic().sendPlaydata(_local23);
}
var _local25 = getActiveHand();
var _local13 = 0;
var _local9 = getGameLogic();
var _local14 = false;
var _local15 = false;
var _local10 = 0;
var _local12 = 0;
var _local11 = 0;
var _local18 = m_inputBuffer.size();
_local9.trace(" Combo: ");
var _local6 = 0;
while (_local6 < m_inputBuffer.size()) {
var _local4 = getCardFromInputBuffer(_local6);
_local4.setFalldown(true);
if (_local4.getFreeze() > 0) {
_local15 = true;
}
if (_local4.isBomb()) {
_local14 = true;
}
var _local7 = _local4.getBoardX();
var _local8 = _local4.getBoardY();
var _local5 = getAdjacentCardsNotInBuffer(_local7, _local8);
var _local2 = 0;
while (_local2 < _local5.size()) {
var _local3 = com.midasplayer.pokerSolitaire.Card(_local5.get(_local2));
if ((_local3 != undefined) && (_local3.getFreeze() == com.midasplayer.pokerSolitaire.Card.FREEZE_MAX)) {
_local3.setFreeze(com.midasplayer.pokerSolitaire.Card.FREEZE_PENDING);
}
_local2++;
}
if (_local4.isGolden()) {
_local13++;
}
_local4.makeCardFlip();
getGameLogic().trace((((((" Card: " + _local4.getValue()) + " - at [") + _local4.getBoardX()) + ", ") + _local4.getBoardY()) + "]");
_local12 = _local12 + (_local4.getX() + (com.midasplayer.pokerSolitaire.BoardObject.CARD_WIDTH / 2));
_local11 = _local11 + (_local4.getY() + (com.midasplayer.pokerSolitaire.BoardObject.CARD_HEIGHT / 2));
_local6++;
}
_local10 = _local10 + Number(SCORE_HAND.get(_local25));
cardsFalldown();
if ((_local15 && (_local14)) && (BOMB_FREEZE_COMBO_ACTIVE)) {
_local6 = 0;
while (_local6 < m_cards.size()) {
var _local4 = com.midasplayer.pokerSolitaire.Card(m_cards.get(_local6));
if (_local4 != undefined) {
if (_local4.getFreeze() > 0) {
_local4.unfreeze();
}
if (_local4.isBomb()) {
_local4.disarmBomb();
}
}
_local6++;
}
}
increaseFreeze();
var _local20 = countdownBombs();
var _local16 = (getGameLogic().getTickCount() - m_lastComboTick) * m_gameLogic.getTimePerTick();
trace("timeSinceLastCombo: " + _local16);
m_lastComboTick = getGameLogic().getTickCount();
if (_local16 <= COMBO_SPEED_TIME) {
var _local19 = Math.round(((COMBO_SPEED_TIME - _local16) / COMBO_SPEED_TIME) * SCORE_COMBO_SPEED_BONUS);
_local10 = _local10 + _local19;
trace("speedBonus: " + _local19);
}
_local9 = getGameLogic();
if (_local20) {
_local9.setPendingStateDuration(undefined, 12);
_local9.gameOver();
} else if (checkFreeze()) {
_local9.gameOver();
}
m_handsLeft--;
var _local24 = decrementGoalHand(getActiveHand());
_local10 = _local10 + (_local24 * SCORE_REQUIRED_HAND);
var _local17 = Math.pow(SCORE_GOLD_MULTIPLIER, _local13);
_local9.trace("score: " + _local10);
trace("multiplier: " + _local17);
if (_local17 > 1) {
_local10 = _local10 * _local17;
_local10 = Math.round(_local10);
if (!_local20) {
_local9.getGameView().makeGoldRain();
}
}
trace("combo score: " + _local10);
trace("---------------\n");
_local9.addScore(_local10);
_local9.getGameView().makeScorePop(_local10, _local12 / _local18, _local11 / _local18);
_local9.getGameView().updateScore();
var _local22 = checkHandsLeft();
if (_local22) {
if (onLevelTimeUp()) {
_local9.completeLevel();
} else {
_local9.gameOver();
}
}
_local9.getGameView().onSubmitHand(_local10);
clearClientInput();
}
function cardsFalldown() {
var _local7 = 0;
while (_local7 < m_width) {
var _local8 = 0;
var _local4 = m_height - 1;
while (_local4 >= 0) {
var _local6 = getCard(_local7, _local4);
if (_local6.isFalldown()) {
var _local3 = _local4 - 1;
var _local5;
while (true) {
if (_local3 < 0) {
_local5 = dealCard();
_local8++;
break;
}
var _local2 = getCard(_local7, _local3);
if ((_local2 != undefined) && (!_local2.isFalldown())) {
_local2.setFalldown(true);
_local5 = _local2.getValueString();
break;
}
_local3--;
}
if (_local5 == undefined) {
trace("undefined value string");
} else {
_local6.setFalldown(false);
_local6.setFalldownOffset((_local3 - _local4) - _local8);
_local6.setValueString(_local5);
}
}
_local4--;
}
_local7++;
}
}
function increaseFreeze() {
var _local2 = 0;
while (_local2 < m_cards.size()) {
var _local3 = com.midasplayer.pokerSolitaire.Card(m_cards.get(_local2));
if (_local3 != undefined) {
_local3.increaseFreeze();
}
_local2++;
}
}
function countdownBombs() {
var _local4 = false;
var _local3 = 0;
while (_local3 < m_cards.size()) {
var _local2 = com.midasplayer.pokerSolitaire.Card(m_cards.get(_local3));
if ((_local2 != undefined) && (_local2.isBomb())) {
if (_local2.countdownBomb()) {
_local2.detonateBomb();
_local4 = true;
}
}
_local3++;
}
return(_local4);
}
function checkFreeze() {
var _local5 = 0;
var _local4 = 0;
while (_local4 < m_height) {
var _local2 = 0;
while (_local2 < m_width) {
var _local3 = getCard(_local2, _local4);
if ((_local3 != undefined) && (_local3.getFreeze() < com.midasplayer.pokerSolitaire.Card.FREEZE_MAX)) {
_local5++;
}
_local2++;
}
_local4++;
}
return(_local5 < 5);
}
function decrementGoalHand(handIndex, recursive) {
if (recursive == undefined) {
recursive = true;
}
var _local3 = Number(m_goalHands.get(handIndex));
if (_local3 > 0) {
_local3--;
m_goalHands.set(handIndex, _local3);
getGameLogic().getGameView().makeGoalHandEffect(handIndex);
return(1);
}
if (recursive) {
if (handIndex == HAND_FIVE_OF_A_KIND) {
var _local7 = decrementGoalHand(HAND_FOUR_OF_A_KIND, false);
var _local6 = ((_local7 == 0) ? (decrementGoalHand(HAND_FULL_HOUSE)) : 0);
return(_local7 + _local6);
}
if ((handIndex == HAND_ROYAL_FLUSH) || (handIndex == HAND_STRAIGHT_FLUSH)) {
var _local7 = decrementGoalHand(HAND_FLUSH);
var _local6 = ((_local7 == 0) ? (decrementGoalHand(HAND_STRAIGHT)) : 0);
return(_local7 + _local6);
}
if (handIndex == HAND_FOUR_OF_A_KIND) {
var _local7 = decrementGoalHand(HAND_THREE_OF_A_KIND, false);
var _local6 = 0;
if (_local7 == 0) {
_local6 = decrementGoalHand(HAND_TWO_PAIRS);
}
return(_local7 + _local6);
}
if (handIndex == HAND_FULL_HOUSE) {
var _local7 = decrementGoalHand(HAND_THREE_OF_A_KIND, false);
if (_local7 == 0) {
var _local6 = decrementGoalHand(HAND_TWO_PAIRS);
if (_local6 != 0) {
return(_local6);
}
}
var _local5 = decrementGoalHand(HAND_ONE_PAIR);
return(_local7 + _local5);
}
if (handIndex == HAND_STRAIGHT) {
} else if (handIndex == HAND_FLUSH) {
} else {
if (handIndex == HAND_THREE_OF_A_KIND) {
return(decrementGoalHand(HAND_ONE_PAIR));
}
if (handIndex == HAND_TWO_PAIRS) {
var _local7 = decrementGoalHand(HAND_ONE_PAIR);
var _local6 = decrementGoalHand(HAND_ONE_PAIR);
return(_local7 + _local6);
}
if (handIndex == HAND_ONE_PAIR) {
}
}
}
return(0);
}
function getHandsLeft() {
return(m_handsLeft);
}
function checkHandsLeft() {
return(m_handsLeft <= 0);
}
function getGoalHand(hand) {
return(Number(m_goalHands.get(hand)));
}
function checkGoalHands() {
var _local2 = 0;
while (_local2 < HAND_LENGTH) {
if (getGoalHand(_local2) > 0) {
return(false);
}
_local2++;
}
return(true);
}
function clearClientInput() {
trace("clear input buffer!");
var _local3 = 0;
while (_local3 < m_cards.size()) {
var _local2 = com.midasplayer.pokerSolitaire.Card(m_cards.get(_local3));
if (_local2 != undefined) {
_local2.setActive(false);
_local2.setDisabled(false);
}
_local3++;
}
m_inputBuffer.clear();
m_activeHand = HAND_NONE;
getGameLogic().getGameView().setSubmitButtonFrame(1);
}
function removeInputCard(card) {
var _local2 = 0;
while (_local2 < m_inputBuffer.size()) {
var _local3 = getCardFromInputBuffer(_local2);
if (_local3.getObjId() == card.getObjId()) {
_local3.setActive(false);
m_inputBuffer.removeByIndex(_local2);
return(undefined);
}
_local2++;
}
}
function getCardFromInputBuffer(index) {
var _local2 = com.midasplayer.gameCore.ClientInput(m_inputBuffer.get(index));
return(getCard(_local2.getInt(0), _local2.getInt(1)));
}
function onLevelTimeUp() {
if (m_handsLeft > 0) {
submitHand(false);
}
clearClientInput();
var _local3 = false;
var _local2 = getGameLogic();
if (checkGoalHands() && (!m_levelBonusAdded)) {
m_bonus = Number(SCORE_LEVEL_BONUS.get(_local2.getLevel()));
_local2.addScore(m_bonus);
_local3 = true;
m_levelBonusAdded = true;
}
return(_local3);
}
static var LEVEL_ITEM_EMPTY = ".";
static var LEVEL_ITEM_CARD = "*";
static var LEVEL_ITEM_HEAT = "@";
static var LEVEL_ITEM_LOCKED = "=";
static var INPUT_TYPE_CLICK_CARD = 28;
static var INPUT_TYPE_SUBMIT_HAND = 666;
static var INPUT_TYPE_QUIT = 999;
static var COMBO_SPEED_TIME = 15000;
static var SCORE_COMBO_SPEED_BONUS = 15;
static var SCORE_LEVEL_BONUS = new com.midasplayer.util.ArrayList(new Array(500, 1000, 1500));
static var SCORE_HAND = new com.midasplayer.util.ArrayList(new Array(600, 500, 400, 250, 175, 150, 130, 120, 100, 50));
static var SCORE_REQUIRED_HAND = 200;
static var SCORE_GOLD_MULTIPLIER = 1.5;
static var HAND_NONE = -1;
static var HAND_FIVE_OF_A_KIND = 0;
static var HAND_ROYAL_FLUSH = 1;
static var HAND_STRAIGHT_FLUSH = 2;
static var HAND_FOUR_OF_A_KIND = 3;
static var HAND_FULL_HOUSE = 4;
static var HAND_FLUSH = 5;
static var HAND_STRAIGHT = 6;
static var HAND_THREE_OF_A_KIND = 7;
static var HAND_TWO_PAIRS = 8;
static var HAND_ONE_PAIR = 9;
static var HAND_LENGTH = 10;
static var BOMB_FREEZE_COMBO_ACTIVE = false;
var m_deckIndex = 0;
var m_validAchievement = true;
}
Symbol 347 MovieClip [__Packages.com.midasplayer.pokerSolitaire.BoardObject] Frame 0
class com.midasplayer.pokerSolitaire.BoardObject extends com.midasplayer.gameCore.WorldObject
{
var m_gameBoard, setX, setY, setScaleX, setScaleY;
function BoardObject () {
super();
}
function getGameLogic() {
return(com.midasplayer.pokerSolitaire.GameLogic(super.getGameLogic()));
}
function setGameBoard(gameBoard) {
m_gameBoard = gameBoard;
}
function getGameBoard() {
return(m_gameBoard);
}
function getBoardX() {
return(m_boardX);
}
function getBoardY() {
return(m_boardY);
}
function setBoardPos(x, y) {
m_boardX = x;
m_boardY = y;
updatePosition();
}
function updatePosition() {
var _local3 = getBoardX();
var _local5 = getBoardY();
var _local4 = LEFT_OFFSET + (_local3 * CARD_WIDTH);
var _local2 = TOP_OFFSET + (_local5 * CARD_HEIGHT);
if (!m_gameBoard.isOffset(_local3)) {
_local2 = _local2 + (CARD_HEIGHT / 2);
}
setX(_local4);
setY(_local2);
setScaleX(CARD_SCALE);
setScaleY(CARD_SCALE);
}
static var CARD_SCALE = 100;
static var CARD_WIDTH = (60 * CARD_SCALE) / 100;
static var CARD_HEIGHT = (70 * CARD_SCALE) / 100;
static var LEFT_OFFSET = 0;
static var TOP_OFFSET = 0;
var m_boardX = -1;
var m_boardY = -1;
}
Symbol 348 MovieClip [__Packages.com.midasplayer.pokerSolitaire.Card] Frame 0
class com.midasplayer.pokerSolitaire.Card extends com.midasplayer.pokerSolitaire.BoardObject
{
var setInputEnabled, setAnimated, setUseHandCursor, m_objectView, m_value, m_color, getGameLogic, getGameBoard, getBoardX, getBoardY;
function Card () {
super();
setInputEnabled(((com.midasplayer.gameCore.WorldObject.INPUT_MOUSE_PRESS | com.midasplayer.gameCore.WorldObject.INPUT_MOUSE_ROLL_OVER) | com.midasplayer.gameCore.WorldObject.INPUT_MOUSE_ROLL_OUT) | com.midasplayer.gameCore.WorldObject.INPUT_MOUSE_DRAG_OUT);
setAnimated(false);
setUseHandCursor(true);
}
function createObjectView() {
return(new com.midasplayer.pokerSolitaire.CardView());
}
function getObjectView() {
return(com.midasplayer.pokerSolitaire.CardView(m_objectView));
}
function getValue() {
return(m_value);
}
function getValueNum(aceHigh) {
if (m_value == VALUE_ACE) {
return((aceHigh ? 14 : 1));
}
if (m_value == VALUE_KING) {
return(13);
}
if (m_value == VALUE_QUEEN) {
return(12);
}
if (m_value == VALUE_JACK) {
return(11);
}
if (m_value == VALUE_TEN) {
return(10);
}
var _local2 = Number(m_value);
if (_local2 != "NaN") {
return(_local2);
}
}
function getColor() {
return(m_color);
}
function setValueString(valueString) {
var _local4 = valueString.charAt(0);
var _local3 = valueString.charAt(1);
var _local5 = Number(valueString.charAt(2));
var _local6 = Number(valueString.charAt(3));
var _local7 = Number(valueString.charAt(4)) == 1;
m_value = _local3;
m_color = _local4;
m_bomb = _local5;
m_freeze = _local6;
m_golden = _local7;
getObjectView().updateView();
}
function getValueString() {
return((((m_color + m_value) + m_bomb) + m_freeze) + (m_golden ? 1 : 0));
}
function equalValue(card) {
if ((getValue() == VALUE_JOKER) || (card.getValue() == VALUE_JOKER)) {
return(true);
}
return(getValue() == card.getValue());
}
function equalColor(card) {
if ((getValue() == VALUE_JOKER) || (card.getValue() == VALUE_JOKER)) {
return(true);
}
return(getColor() == card.getColor());
}
function isBomb() {
return(m_bomb > 0);
}
function getBombCount() {
return(m_bomb);
}
function setBomb() {
m_bomb = BOMB_MAX;
getObjectView().updateView();
}
function countdownBomb() {
if (m_bomb > 0) {
m_bomb--;
getObjectView().updateView();
if (m_bomb <= 0) {
return(true);
}
}
return(false);
}
function disarmBomb() {
m_bomb = 0;
getObjectView().updateView();
makeBombEffect();
}
function detonateBomb() {
m_bomb = 0;
getObjectView().updateView();
getObjectView().makeEffect("explosion", -30, -30, 300);
getGameLogic().getGameView().onBombExplode();
}
function getFreeze() {
return(m_freeze);
}
function setFreeze(freeze) {
m_freeze = freeze;
getObjectView().updateView();
}
function unfreeze() {
m_freeze = 0;
getObjectView().updateView();
makeFreezeEffect();
}
function addFreeze() {
m_freeze++;
getObjectView().updateView();
}
function isGolden() {
return(m_golden);
}
function isActive() {
return(m_active);
}
function setActive(active) {
m_active = active;
getObjectView().updateView();
}
function isDisabled() {
return(m_disabled);
}
function setDisabled(disabled) {
m_disabled = disabled;
getObjectView().updateView();
}
function setFalldown(falldown) {
m_falldown = falldown;
}
function isFalldown() {
return(m_falldown);
}
function makeCardFlip() {
getObjectView().makeEffect("cardflip");
if (isBomb()) {
makeBombEffect();
}
if (getFreeze() > 0) {
makeFreezeEffect();
}
}
function makeBombEffect() {
getObjectView().makeEffect("puff_anim", 40, 15);
}
function makeFreezeEffect() {
getObjectView().makeEffect("frozen_expl", 35, 25);
}
function setFalldownOffset(yOffset) {
getObjectView().setFalldownOffset(yOffset);
}
function onPress() {
if (getGameLogic().getState() != com.midasplayer.gameCore.GameState.LEVEL_RUNNING) {
return(undefined);
}
if (m_freeze < FREEZE_MAX) {
getGameBoard().cardClicked(getBoardX(), getBoardY());
}
}
function increaseFreeze() {
if ((m_freeze > 0) && (m_freeze < FREEZE_MAX)) {
addFreeze();
}
}
static var COLOR_NONE = "-";
static var COLOR_CLUBS = "c";
static var COLOR_DIAMONDS = "d";
static var COLOR_HEARTS = "h";
static var COLOR_SPADES = "s";
static var VALUE_JOKER = "*";
static var VALUE_ACE = "a";
static var VALUE_KING = "k";
static var VALUE_QUEEN = "q";
static var VALUE_JACK = "j";
static var VALUE_TEN = "0";
static var FREEZE_MAX = 3;
static var FREEZE_PENDING = 1;
static var BOMB_MAX = 3;
var DEFAULT_SYMBOL = "kort";
var m_active = false;
var m_disabled = false;
var m_falldown = false;
var m_freeze = 0;
var m_bomb = 0;
var m_golden = false;
}
Symbol 349 MovieClip [__Packages.com.midasplayer.pokerSolitaire.CardView] Frame 0
class com.midasplayer.pokerSolitaire.CardView extends com.midasplayer.gameCore.WorldObjectView
{
var getClip, getGameLogic;
function CardView () {
super();
}
function getObject() {
return(com.midasplayer.pokerSolitaire.Card(super.getObject()));
}
function updateView() {
var _local3 = getClip();
var _local2 = getObject();
var _local4 = "";
_local4 = _local2.getColor();
_local4 = _local4 + String(_local2.getValue());
_local3.gotoAndStop(_local4);
var _local7 = _local2.isActive();
_local3.highlight._visible = _local7;
var _local8 = _local2.isDisabled();
_local3.highlight_disabled._visible = _local8;
var _local6 = _local2.getFreeze() + 1;
_local3.freeze.gotoAndStop(_local6);
var _local9 = _local2.isBomb();
var _local5 = _local2.getBombCount();
_local3.bomb._visible = _local9;
_local3.bomb.countdown.gotoAndStop(_local5);
var _local10 = _local2.isGolden();
_local3.golden._visible = _local10;
}
function setFalldownOffset(yOffset) {
var _local5 = mx.transitions.easing.Bounce.easeOut;
var _local3 = yOffset * com.midasplayer.pokerSolitaire.BoardObject.CARD_HEIGHT;
var _local4 = 0;
var _local2 = 1;
var _local6 = new mx.transitions.Tween(this, "m_offsetY", _local5, _local3, _local4, _local2, true);
}
function makeEffect(identifier, xOffset, yOffset, scale) {
if (xOffset == undefined) {
xOffset = 0;
}
if (yOffset == undefined) {
yOffset = 0;
}
if (scale == undefined) {
scale = 100;
}
var _local3 = getClip();
var _local4 = getGameLogic().getWorld().getLayer(com.midasplayer.pokerSolitaire.GameLogic.LAYER_CARD_EFFECT);
var _local2 = _local4.attachMovie(identifier, "effect_" + getObject().getObjId(), _local4.getNextHighestDepth());
_local2._x = _local3._x + xOffset;
_local2._y = _local3._y + yOffset;
_local2._xscale = (_local2._yscale = scale);
}
function onRender() {
var _local3 = getObject();
var _local2 = getClip();
_local2._x = _local3.getX() + m_offsetX;
_local2._y = _local3.getY() + m_offsetY;
}
var m_offsetX = 0;
var m_offsetY = 0;
}
Symbol 350 MovieClip [__Packages.mx.transitions.easing.Bounce] Frame 0
class mx.transitions.easing.Bounce
{
function Bounce () {
}
static function easeOut(t, b, c, d) {
t = t / d;
if (t < 0.363636363636364) {
return((c * ((7.5625 * t) * t)) + b);
}
if (t < 0.727272727272727) {
t = t - 0.545454545454545;
return((c * (((7.5625 * t) * t) + 0.75)) + b);
}
if (t < 0.909090909090909) {
t = t - 0.818181818181818;
return((c * (((7.5625 * t) * t) + 0.9375)) + b);
}
t = t - 0.954545454545455;
return((c * (((7.5625 * t) * t) + 0.984375)) + b);
}
static function easeIn(t, b, c, d) {
return((c - easeOut(d - t, 0, c, d)) + b);
}
static function easeInOut(t, b, c, d) {
if (t < (d / 2)) {
return((easeIn(t * 2, 0, c, d) * 0.5) + b);
}
return(((easeOut((t * 2) - d, 0, c, d) * 0.5) + (c * 0.5)) + b);
}
static var version = "1.1.0.52";
}
Symbol 351 MovieClip [__Packages.mx.transitions.OnEnterFrameBeacon] Frame 0
class mx.transitions.OnEnterFrameBeacon
{
function OnEnterFrameBeacon () {
}
static function init() {
var _local4 = _global.MovieClip;
if (!_root.__OnEnterFrameBeacon) {
mx.transitions.BroadcasterMX.initialize(_local4);
var _local3 = _root.createEmptyMovieClip("__OnEnterFrameBeacon", 9876);
_local3.onEnterFrame = function () {
_global.MovieClip.broadcastMessage("onEnterFrame");
};
}
}
static var version = "1.1.0.52";
}
Symbol 352 MovieClip [__Packages.mx.transitions.BroadcasterMX] Frame 0
class mx.transitions.BroadcasterMX
{
var _listeners;
function BroadcasterMX () {
}
static function initialize(o, dontCreateArray) {
if (o.broadcastMessage != undefined) {
delete o.broadcastMessage;
}
o.addListener = mx.transitions.BroadcasterMX.prototype.addListener;
o.removeListener = mx.transitions.BroadcasterMX.prototype.removeListener;
if (!dontCreateArray) {
o._listeners = new Array();
}
}
function addListener(o) {
removeListener(o);
if (broadcastMessage == undefined) {
broadcastMessage = mx.transitions.BroadcasterMX.prototype.broadcastMessage;
}
return(_listeners.push(o));
}
function removeListener(o) {
var _local2 = _listeners;
var _local3 = _local2.length;
while (_local3--) {
if (_local2[_local3] == o) {
_local2.splice(_local3, 1);
if (!_local2.length) {
broadcastMessage = undefined;
}
return(true);
}
}
return(false);
}
function broadcastMessage() {
var _local5 = String(arguments.shift());
var _local4 = _listeners.concat();
var _local6 = _local4.length;
var _local3 = 0;
while (_local3 < _local6) {
_local4[_local3][_local5].apply(_local4[_local3], arguments);
_local3++;
}
}
static var version = "1.1.0.52";
}
Symbol 353 MovieClip [__Packages.mx.transitions.Tween] Frame 0
class mx.transitions.Tween
{
var obj, prop, begin, useSeconds, _listeners, addListener, prevTime, _time, looping, _duration, broadcastMessage, isPlaying, _fps, prevPos, _pos, change, _intervalID, _startTime;
function Tween (obj, prop, func, begin, finish, duration, useSeconds) {
mx.transitions.OnEnterFrameBeacon.init();
if (!arguments.length) {
return;
}
this.obj = obj;
this.prop = prop;
this.begin = begin;
position = (begin);
this.duration = (duration);
this.useSeconds = useSeconds;
if (func) {
this.func = func;
}
this.finish = (finish);
_listeners = [];
addListener(this);
start();
}
function set time(t) {
prevTime = _time;
if (t > duration) {
if (looping) {
rewind(t - _duration);
update();
broadcastMessage("onMotionLooped", this);
} else {
if (useSeconds) {
_time = _duration;
update();
}
stop();
broadcastMessage("onMotionFinished", this);
}
} else if (t < 0) {
rewind();
update();
} else {
_time = t;
update();
}
//return(time);
}
function get time() {
return(_time);
}
function set duration(d) {
_duration = (((d == null) || (d <= 0)) ? (_global.Infinity) : (d));
//return(duration);
}
function get duration() {
return(_duration);
}
function set FPS(fps) {
var _local2 = isPlaying;
stopEnterFrame();
_fps = fps;
if (_local2) {
startEnterFrame();
}
//return(FPS);
}
function get FPS() {
return(_fps);
}
function set position(p) {
setPosition(p);
//return(position);
}
function setPosition(p) {
prevPos = _pos;
obj[prop] = (_pos = p);
broadcastMessage("onMotionChanged", this, _pos);
updateAfterEvent();
}
function get position() {
return(getPosition());
}
function getPosition(t) {
if (t == undefined) {
t = _time;
}
return(func(t, begin, change, _duration));
}
function set finish(f) {
change = f - begin;
//return(finish);
}
function get finish() {
return(begin + change);
}
function continueTo(finish, duration) {
begin = position;
this.finish = (finish);
if (duration != undefined) {
this.duration = (duration);
}
start();
}
function yoyo() {
continueTo(begin, time);
}
function startEnterFrame() {
if (_fps == undefined) {
_global.MovieClip.addListener(this);
} else {
_intervalID = setInterval(this, "onEnterFrame", 1000 / _fps);
}
isPlaying = true;
}
function stopEnterFrame() {
if (_fps == undefined) {
_global.MovieClip.removeListener(this);
} else {
clearInterval(_intervalID);
}
isPlaying = false;
}
function start() {
rewind();
startEnterFrame();
broadcastMessage("onMotionStarted", this);
}
function stop() {
stopEnterFrame();
broadcastMessage("onMotionStopped", this);
}
function resume() {
fixTime();
startEnterFrame();
broadcastMessage("onMotionResumed", this);
}
function rewind(t) {
_time = ((t == undefined) ? 0 : (t));
fixTime();
update();
}
function fforward() {
time = (_duration);
fixTime();
}
function nextFrame() {
if (useSeconds) {
time = ((getTimer() - _startTime) / 1000);
} else {
time = (_time + 1);
}
}
function onEnterFrame() {
nextFrame();
}
function prevFrame() {
if (!useSeconds) {
time = (_time - 1);
}
}
function toString() {
return("[Tween]");
}
function fixTime() {
if (useSeconds) {
_startTime = getTimer() - (_time * 1000);
}
}
function update() {
position = (getPosition(_time));
}
static var version = "1.1.0.52";
static var __initBeacon = mx.transitions.OnEnterFrameBeacon.init();
static var __initBroadcaster = mx.transitions.BroadcasterMX.initialize(mx.transitions.Tween.prototype, true);
function func(t, b, c, d) {
return(((c * t) / d) + b);
}
}
Symbol 354 MovieClip [__Packages.com.midasplayer.pokerSolitaire.GameView] Frame 0
class com.midasplayer.pokerSolitaire.GameView extends com.midasplayer.gameCore.AbstractGameView
{
var m_gameBoard, m_scoreSign, m_introCardFrames, m_beaverSound, m_timeAlertPlayed, m_levelStartPlayTick, m_submitButtom, m_beaverAnim, m_goalHandTypes;
function GameView () {
super();
}
function getGameLogic() {
return(com.midasplayer.pokerSolitaire.GameLogic(super.getGameLogic()));
}
function setGameBoard(gameBoard) {
m_gameBoard = gameBoard;
}
function getGameBoard() {
return(m_gameBoard);
}
function setBeaver(beaver) {
m_beaver = beaver;
}
function isBeaver() {
return(m_beaver);
}
static function getHandString(hand) {
if (hand == com.midasplayer.pokerSolitaire.GameBoard.HAND_FIVE_OF_A_KIND) {
return(com.midasplayer.util.I18n.getString("five_of_a_kind"));
}
if (hand == com.midasplayer.pokerSolitaire.GameBoard.HAND_ROYAL_FLUSH) {
return(com.midasplayer.util.I18n.getString("royal_flush"));
}
if (hand == com.midasplayer.pokerSolitaire.GameBoard.HAND_STRAIGHT_FLUSH) {
return(com.midasplayer.util.I18n.getString("straight_flush"));
}
if (hand == com.midasplayer.pokerSolitaire.GameBoard.HAND_FOUR_OF_A_KIND) {
return(com.midasplayer.util.I18n.getString("four_of_a_kind"));
}
if (hand == com.midasplayer.pokerSolitaire.GameBoard.HAND_FULL_HOUSE) {
return(com.midasplayer.util.I18n.getString("full_house"));
}
if (hand == com.midasplayer.pokerSolitaire.GameBoard.HAND_FLUSH) {
return(com.midasplayer.util.I18n.getString("flush"));
}
if (hand == com.midasplayer.pokerSolitaire.GameBoard.HAND_STRAIGHT) {
return(com.midasplayer.util.I18n.getString("straight"));
}
if (hand == com.midasplayer.pokerSolitaire.GameBoard.HAND_THREE_OF_A_KIND) {
return(com.midasplayer.util.I18n.getString("three_of_a_kind"));
}
if (hand == com.midasplayer.pokerSolitaire.GameBoard.HAND_TWO_PAIRS) {
return(com.midasplayer.util.I18n.getString("two_pairs"));
}
if (hand == com.midasplayer.pokerSolitaire.GameBoard.HAND_ONE_PAIR) {
return(com.midasplayer.util.I18n.getString("one_pair"));
}
return(com.midasplayer.util.I18n.getString("no_hand"));
}
function onInitInfoScreen(infoScreen, currentState) {
var _local6 = getGameLogic();
var _local17 = getGameLogic().getGameBoard();
trace("- initInfoScreen");
com.midasplayer.fx.SoundManager.stop(SOUND_LOOP);
com.midasplayer.fx.SoundManager.stop(SOUND_COUNTDOWN);
playBeaverAnim(BEAVER_ANIM_IDLE);
m_scoreSign.beaver._visible = false;
if (isBeaver()) {
updateScore();
}
if (currentState == com.midasplayer.gameCore.GameState.INSTRUCTIONS) {
m_introCardFrames = new com.midasplayer.util.ArrayList();
var _local4 = 0;
while (_local4 < 31) {
m_introCardFrames.insert(Math.floor(Math.random() * 53) + 1);
_local4++;
}
var _local18 = INSTRUCTION_INFO_SCREEN_TIME;
if (isBeaver()) {
_local18 = INSTRUCTION_INFO_SCREEN_TIME_BEAVER;
}
infoScreen.init(_root.gameBoardDummy, "instruktion", _local18);
if (!isBeaver()) {
infoScreen.setPos(0, 0);
} else {
infoScreen.setPos(-130, 0);
}
infoScreen.setSound(SOUND_INTRO, SOUND_INTRO_VOLUME);
infoScreen.setText("instructions_header", com.midasplayer.util.I18n.getString("instructions_header"));
var _local9 = infoScreen.getClip();
_local9.onRelease = function () {
_root.gameLogic.getInfoScreen().setTimeRemaining(0);
};
} else if ((currentState == com.midasplayer.gameCore.GameState.LEVEL_SUMMARY) || ((currentState == com.midasplayer.gameCore.GameState.GAME_SUMMARY) && (getGameLogic().getLevel() >= 3))) {
var _local16 = _local6.getScore();
var _local7 = _local6.getLevel();
var _local10 = _local7 >= getGameLogic().getNumberLevels();
trace("getGameLogic().getLevel(): " + getGameLogic().getLevel());
getGameLogic().getWorld().clearWorldObjects();
var _local14 = "levelCleared";
if (isBeaver()) {
_local14 = "summary";
}
infoScreen.init(_root.gameBoardDummy, _local14, (_local10 ? (GAME_SUMMARY_INFO_SCREEN_TIME) : (SUMMARY_INFO_SCREEN_TIME)));
var _local9 = infoScreen.getClip();
if (!isBeaver()) {
infoScreen.setPos(180, 220);
} else {
infoScreen.setPos(-130, 0);
}
var _local8;
if (_local10) {
_local8 = com.midasplayer.util.I18n.getString("game_cleared");
infoScreen.setSound(SOUND_GAME_SUMMARY, SOUND_GAME_SUMMARY_VOLUME);
} else {
_local8 = com.midasplayer.util.I18n.getString("level_complete");
if (isBeaver()) {
var _local13 = _local9.attachMovie("wurst_levelcleared", "wurst", _local9.getNextHighestDepth());
_local13._x = 205;
_local13._y = 287;
} else {
infoScreen.setSound(SOUND_SUMMARY, SOUND_SUMMARY_VOLUME);
com.midasplayer.fx.SoundManager.play(SOUND_CAUGHT, SOUND_CAUGHT_VOLUME);
}
}
_local9 = infoScreen.getClip();
if (!isBeaver()) {
_local9.faces.gotoAndStop(_local7);
} else {
_local9.gotoAndStop((_local10 ? 2 : 1));
}
infoScreen.setText("header", _local8);
infoScreen.setText("text", com.midasplayer.util.I18n.getString("name_" + _local7));
infoScreen.setText("bonus", (com.midasplayer.util.I18n.getString("bonus") + ": ") + _local17.getBonus());
infoScreen.setText("score", (com.midasplayer.util.I18n.getString("score") + ": ") + _local16);
_local9.onRelease = function () {
if (_root.gameLogic.getInfoScreen().getTimePassed() > com.midasplayer.pokerSolitaire.GameView.INFO_SCREEN_DELAY) {
_root.gameLogic.getInfoScreen().setTimeRemaining(0);
}
};
} else if (currentState == com.midasplayer.gameCore.GameState.GAME_SUMMARY) {
trace("gameOver");
getGameLogic().getWorld().clearWorldObjects();
var _local5 = getGameLogic().getLevel() >= 3;
var _local14 = "gameOver";
if (isBeaver()) {
_local14 = "summary";
}
infoScreen.init(_root.gameBoardDummy, _local14, GAME_OVER_INFO_SCREEN_TIME);
if (!isBeaver()) {
infoScreen.setPos(180, 220);
} else {
infoScreen.setPos(-130, 0);
}
infoScreen.setDeleteOnExit(false);
var _local9 = infoScreen.getClip();
infoScreen.setSound(SOUND_GAME_OVER, SOUND_GAME_OVER_VOLUME);
if (_local5) {
var _local8 = com.midasplayer.util.I18n.getString("game_cleared");
} else {
var _local8 = com.midasplayer.util.I18n.getString("game_over");
}
trace("headerString: " + _local8);
var _local15 = false;
if (getGameLogic().getLevel() >= getGameLogic().getNumberLevels()) {
_local15 = true;
}
var _local16 = _local6.getScore();
var _local12 = _local17.getBonus();
var _local19 = _local16 - _local12;
infoScreen.setText("header", _local8);
infoScreen.setText("register", com.midasplayer.util.I18n.getString("register"));
infoScreen.setText("score_header", com.midasplayer.util.I18n.getString("score"));
infoScreen.setText("score", String(_local19));
infoScreen.setText("bonus_header", com.midasplayer.util.I18n.getString("bonus"));
infoScreen.setText("bonus", String(_local12));
infoScreen.setElementVisible("register", _local15);
infoScreen.setElementVisible("score_header", _local5);
infoScreen.setElementVisible("score", _local5);
infoScreen.setElementVisible("bonus_header", _local5);
infoScreen.setElementVisible("bonus", _local5);
infoScreen.setText("total_score_header", com.midasplayer.util.I18n.getString("total_score"));
infoScreen.setText("total_score", String(_local16));
var _local20 = (_local5 ? 2 : 1);
if (isBeaver()) {
_local9.gotoAndStop((_local5 ? 2 : 3));
}
_local9.gfx.gotoAndStop(_local20);
_local9.onRelease = function () {
if (_root.gameLogic.getInfoScreen().getTimePassed() > com.midasplayer.pokerSolitaire.GameView.INFO_SCREEN_DELAY) {
_root.gameLogic.getInfoScreen().setTimeRemaining(0);
}
};
}
}
function onUpdateInfoScreen(infoScreen, currentState) {
if (currentState == com.midasplayer.gameCore.GameState.INSTRUCTIONS) {
var _local10 = infoScreen.getClip();
var _local3 = 0;
while (_local3 < 31) {
var _local2 = _local10.exempel[_local3];
_local2.highlight._visible = false;
_local2.highlight_disabled._visible = false;
_local2.freeze._visible = false;
_local2.bomb._visible = false;
_local2.golden._visible = false;
var _local4 = Number(m_introCardFrames.get(_local3));
_local2.gotoAndStop(_local4);
_local3++;
}
_local10 = infoScreen.getClip();
var _local7 = Math.max(0, infoScreen.getTimeRemaining());
var _local9 = com.midasplayer.util.I18n.getString("game_starts");
var _local8 = ((_local7 == 1) ? (com.midasplayer.util.I18n.getString("second")) : (com.midasplayer.util.I18n.getString("seconds")));
infoScreen.setText("timer", (((((_local9 + " ") + com.midasplayer.util.I18n.getString("in")) + " ") + Math.round(_local7)) + " ") + _local8);
infoScreen.setText("instructions", com.midasplayer.util.I18n.getString("instructions_" + _local10._currentframe));
}
if ((currentState == com.midasplayer.gameCore.GameState.LEVEL_SUMMARY) || (currentState == com.midasplayer.gameCore.GameState.GAME_SUMMARY)) {
var _local10 = infoScreen.getClip();
_local10.stamp.text.text = com.midasplayer.util.I18n.getString("caught");
var _local7 = infoScreen.getTimeRemaining();
var _local9 = ((currentState == com.midasplayer.gameCore.GameState.LEVEL_SUMMARY) ? (com.midasplayer.util.I18n.getString("game_starts")) : (com.midasplayer.util.I18n.getString("game_ends")));
var _local8 = ((_local7 == 1) ? (com.midasplayer.util.I18n.getString("second")) : (com.midasplayer.util.I18n.getString("seconds")));
infoScreen.setText("timer", (((((_local9 + " ") + com.midasplayer.util.I18n.getString("in")) + " ") + Math.round(_local7)) + " ") + _local8);
}
}
function onLevelSetup() {
var _local3 = getGameLogic().getLevel();
m_scoreSign.stack.gotoAndStop(_local3 + 1);
var _local4 = _root.attachMovie(("lvl" + Number(_local3 + 1)) + "_star", "level_star", _root.getNextHighestDepth());
_local4._x = 280;
_local4._y = 215;
m_scoreSign.beaver._visible = true;
playBeaverAnim(BEAVER_ANIM_IDLE);
m_beaverSound = undefined;
com.midasplayer.fx.SoundManager.play(SOUND_LOOP, SOUND_LOOP_VOLUME, true);
m_timeAlertPlayed = false;
m_levelStartPlayTick = getGameLogic().getTickCount() + 4;
}
function onInit() {
m_scoreSign = _root.score_sign;
m_scoreSign._visible = false;
if (getGameLogic().isDev()) {
com.midasplayer.fx.SoundManager.enableSounds(false);
}
m_scoreSign.time_left_header.text = com.midasplayer.util.I18n.getString("time");
m_scoreSign.hands_left_header.text = com.midasplayer.util.I18n.getString("hands");
m_scoreSign.score_header.text = com.midasplayer.util.I18n.getString("score");
m_scoreSign.required_hands_header.text = com.midasplayer.util.I18n.getString("required_hands");
_root.sound_toggle.onRelease = function () {
if (com.midasplayer.fx.SoundManager.isSoundEnabled()) {
trace("Sound: off");
com.midasplayer.fx.SoundManager.enableSounds(false);
_root.sound_toggle_text.text = com.midasplayer.util.I18n.getString("sound_off");
_root.gameView.onButtonClick();
} else {
trace("Sound: on");
com.midasplayer.fx.SoundManager.enableSounds(true);
_root.sound_toggle_text.text = com.midasplayer.util.I18n.getString("sound_on");
_root.gameView.onButtonClick();
}
};
_root.sound_toggle_text.text = com.midasplayer.util.I18n.getString("sound_on");
_root.exit_game_text.text = com.midasplayer.util.I18n.getString("exit_game");
_root.exit_game.onRelease = function () {
_root.gameView.onButtonClick();
_root.gameLogic.exitButtonPush();
trace("exit game pressed");
};
m_submitButtom = _root.btn_submit;
setSubmitButtonFrame(1);
m_submitButtom.onPress = function () {
_root.gameView.setSubmitButtonFrame(3);
};
m_submitButtom.onRelease = function () {
_root.gameLogic.submitHand();
_root.gameView.setSubmitButtonFrame(1);
};
_root._visible = true;
}
function setSubmitButtonFrame(frame) {
m_submitButtom.gotoAndStop(frame);
m_submitButtom.text.text = com.midasplayer.util.I18n.getString("submit");
if (frame == 2) {
com.midasplayer.fx.SoundManager.play(SOUND_ACTIVE_HAND, SOUND_ACTIVE_HAND_VOLUME);
}
}
function onTick() {
if (m_levelStartPlayTick == getGameLogic().getTickCount()) {
com.midasplayer.fx.SoundManager.play(SOUND_LEVEL_START, SOUND_LEVEL_START_VOLUME);
}
if (m_beaverSound != undefined) {
if (!com.midasplayer.fx.SoundManager.isPlaying(m_beaverSound)) {
playBeaverAnim(BEAVER_ANIM_IDLE);
m_beaverSound = undefined;
}
}
}
function onRender() {
var _local2 = getGameLogic();
var _local7 = _local2.getGameBoard();
var _local6 = m_gameBoard.getActiveHand();
var _local5 = getHandString(_local6);
if (_local6 == com.midasplayer.pokerSolitaire.GameBoard.HAND_NONE) {
_local5 = "";
}
m_scoreSign.active_hand.text = _local5;
m_scoreSign._visible = true;
var _local3 = _local2.getTimeLeft();
var _local8 = ((_local3 % 500) < 250) && (_local2.getState() == com.midasplayer.gameCore.GameState.LEVEL_RUNNING);
var _local4 = false;
setNumericField(_local7.getHandsLeft(), m_scoreSign, "hands_left_");
_local4 = (_local3 <= 10000) && (_local8);
setNumericField(Math.round(_local3 / 1000), m_scoreSign, "time_", _local4);
if (_local4 && (!m_timeAlertPlayed)) {
com.midasplayer.fx.SoundManager.play(SOUND_COUNTDOWN, SOUND_COUNTDOWN_VOLUME);
m_timeAlertPlayed = true;
}
}
function playBeaverAnimWithSound(anim, sound) {
m_beaverSound = sound;
com.midasplayer.fx.SoundManager.play(sound, SOUND_BEAVER_VOLUME);
playBeaverAnim(anim);
trace("beaverSound: " + m_beaverSound);
trace("beaverAnim: " + anim);
}
function playBeaverAnim(anim) {
m_beaverAnim = anim;
m_scoreSign.beaver.gotoAndPlay(anim);
}
function getBeaverAnim() {
return(m_beaverAnim);
}
function updateScore() {
trace("updateScore");
setNumericField(getGameLogic().getScore(), m_scoreSign, "score_");
}
function makeGoalHandEffect(handIndex) {
var _local2 = 0;
while (_local2 < m_goalHandTypes.size()) {
var _local3 = Number(m_goalHandTypes.get(_local2));
if (_local3 == handIndex) {
var _local4 = m_scoreSign["goal_hand_" + _local2];
_local4.pop.gotoAndPlay(2);
return(undefined);
}
_local2++;
}
}
function updateGoalHands() {
var _local7 = getGameBoard();
var _local3 = 0;
_local3 = 0;
while (_local3 < 4) {
m_scoreSign["goal_hand_" + _local3]._visible = false;
_local3++;
}
_local3 = 0;
m_goalHandTypes = new com.midasplayer.util.ArrayList();
var _local2 = 0;
while (_local2 < com.midasplayer.pokerSolitaire.GameBoard.HAND_LENGTH) {
var _local5 = _local7.getGoalHand(_local2);
if (_local5 > 0) {
var _local4 = m_scoreSign["goal_hand_" + _local3];
_local4._visible = true;
_local4.goal_hand_text.text = getHandString(_local2);
var _local6 = _local2 + 1;
_local4.goal_hand_icon.gotoAndStop(_local6);
trace("-- handFrame: " + _local6);
setNumericField(_local5, _local4, "goal_hand_count_");
trace("goal hand: " + getHandString(_local2));
m_goalHandTypes.insert(_local2);
_local3++;
}
_local2++;
}
}
function makeScorePop(score, xPos, yPos) {
var _local3 = getGameLogic().getWorld().getLayer(com.midasplayer.pokerSolitaire.GameLogic.LAYER_SCOREPOP);
var _local2 = _local3.attachMovie("scorepop", (("scorepop_" + xPos) + "_") + yPos, _local3.getNextHighestDepth());
_local2._x = xPos;
_local2._y = yPos;
setNumericField(score, _local2.score, "score_");
}
function onSubmitHand(score) {
if (!isBeaver()) {
if (score > 450) {
com.midasplayer.fx.SoundManager.play(SOUND_SUBMIT_HAND_3, SOUND_SUBMIT_HAND_3_VOLUME);
} else if (score > 200) {
com.midasplayer.fx.SoundManager.play(SOUND_SUBMIT_HAND_2, SOUND_SUBMIT_HAND_2_VOLUME);
} else {
com.midasplayer.fx.SoundManager.play(SOUND_SUBMIT_HAND, SOUND_SUBMIT_HAND_VOLUME);
}
} else {
com.midasplayer.fx.SoundManager.play(SOUND_SUBMIT_HAND, SOUND_SUBMIT_HAND_VOLUME);
if (m_beaverSound != SOUND_BEAVER_BOMB) {
if (score >= BEAVER_CHEER_LIMIT_1) {
var _local2 = 0;
var _local4 = 0;
if (score > BEAVER_CHEER_LIMIT_2) {
_local2 = 1;
_local4 = 2;
}
var _local5 = Math.floor(Math.random() * 2) + _local4;
var _local8 = Math.floor(Math.random() * 1) + _local2;
var _local7 = BEAVER_CHEER_PREFIX + _local5;
var _local6 = BEAVER_ANIMS[_local8];
playBeaverAnimWithSound(_local6, _local7);
}
}
}
}
function setNumericField(number, parent, prefix, hidden) {
if (hidden == undefined) {
hidden = false;
}
var _local1 = 0;
while (_local1 < 7) {
var _local2 = number;
if (_local1 > 0) {
_local2 = Math.floor(_local2 / Math.pow(10, _local1));
}
_local2 = _local2 % 10;
_local2 = _local2 + 1;
parent[prefix + _local1].gotoAndStop(_local2);
var _local3 = true;
if ((_local1 > (String(number).length - 1)) || (hidden)) {
_local3 = false;
}
parent[(prefix + "dot_") + _local1].gotoAndStop((_local3 ? 1 : 2));
parent[prefix + _local1]._visible = _local3;
_local1++;
}
}
function makeGoldRain() {
makeEffect("nugget_rain", 190, 190);
com.midasplayer.fx.SoundManager.play(SOUND_SUBMIT_GOLD_HAND, SOUND_SUBMIT_GOLD_HAND_VOLUME);
}
function onBombExplode() {
com.midasplayer.fx.SoundManager.play(SOUND_BOMB, SOUND_BOMB_VOLUME);
playBeaverAnimWithSound(BEAVER_ANIM_BOMB, SOUND_BEAVER_BOMB);
}
function makeEffect(identifier, x, y) {
var _local3 = getGameLogic().getWorld().getLayer(com.midasplayer.pokerSolitaire.GameLogic.LAYER_OVERLAY_EFFECT);
var _local2 = _local3.attachMovie(identifier, "effect_" + identifier, _local3.getNextHighestDepth());
_local2._x = x;
_local2._y = y;
}
static var SOUND_INTRO = "sound_intro";
static var SOUND_INTRO_VOLUME = 50;
static var SOUND_LOOP = "sound_loop";
static var SOUND_LOOP_VOLUME = 30;
static var SOUND_MARK_CARD = "sound_mark_card";
static var SOUND_MARK_CARD_VOLUME = 30;
static var SOUND_ACTIVE_HAND = "sound_active_hand";
static var SOUND_ACTIVE_HAND_VOLUME = 50;
static var SOUND_SUBMIT_HAND = "sound_submit_hand";
static var SOUND_SUBMIT_HAND_VOLUME = 50;
static var SOUND_SUBMIT_HAND_2 = "sound_submit_hand_2";
static var SOUND_SUBMIT_HAND_2_VOLUME = 50;
static var SOUND_SUBMIT_HAND_3 = "sound_submit_hand_3";
static var SOUND_SUBMIT_HAND_3_VOLUME = 50;
static var SOUND_SUBMIT_GOLD_HAND = "sound_submit_gold_hand";
static var SOUND_SUBMIT_GOLD_HAND_VOLUME = 30;
static var SOUND_BOMB = "sound_bomb";
static var SOUND_BOMB_VOLUME = 70;
static var SOUND_COUNTDOWN = "sound_countdown";
static var SOUND_COUNTDOWN_VOLUME = 50;
static var SOUND_LEVEL_START = "sound_level_start";
static var SOUND_LEVEL_START_VOLUME = 50;
static var SOUND_GAME_SUMMARY = "sound_game_summary";
static var SOUND_GAME_SUMMARY_VOLUME = 50;
static var SOUND_SUMMARY = "sound_summary";
static var SOUND_SUMMARY_VOLUME = 50;
static var SOUND_CAUGHT = "sound_caught";
static var SOUND_CAUGHT_VOLUME = 50;
static var SOUND_GAME_OVER = "sound_game_over";
static var SOUND_GAME_OVER_VOLUME = 50;
static var INSTRUCTION_INFO_SCREEN_TIME = 20;
static var INSTRUCTION_INFO_SCREEN_TIME_BEAVER = 15;
static var INFO_SCREEN_DELAY = 3;
static var GAME_OVER_INFO_SCREEN_TIME = 21;
static var GAME_SUMMARY_INFO_SCREEN_TIME = 21;
static var SUMMARY_INFO_SCREEN_TIME = 15;
static var BEAVER_CHEER_LIMIT_1 = 200;
static var BEAVER_CHEER_LIMIT_2 = 450;
static var BEAVER_CHEER_PREFIX = "sound_beaver_cheer_";
static var SOUND_BEAVER_BOMB = "sound_beaver_bomb";
static var SOUND_BEAVER_VOLUME = 200;
static var NUM_BEAVER_SOUNDS = 4;
static var BEAVER_ANIMS = new Array("pekfinger", "heja");
static var NUM_BEAVER_ANIMS = 2;
static var BEAVER_ANIM_IDLE = "idle";
static var BEAVER_ANIM_BOMB = "bombskratt";
var m_graphicFrame = 1;
var m_beaver = false;
}