Frame 1
function onGameDataLoaded() {
var _local2 = new com.king.pyramiddeluxe.Game(_root);
_local2.init(gda);
}
var gda = (new com.midasplayer.util.GameDataAcquirer());
gda.beginWait(mx.utils.Delegate.create(this, onGameDataLoaded));
Symbol 68 MovieClip [animated_ending_inner] Frame 1
#initclip 58
Object.registerClass("animated_ending_inner", com.king.pyramiddeluxe.AnimDriver30Fps);
#endinitclip
this.bottom_line_2._visible = false;
Symbol 68 MovieClip [animated_ending_inner] Frame 342
this.bottom_line_2._visible = true;
Symbol 92 MovieClip [pyramid_map] Frame 1
stop();
Symbol 95 MovieClip [wave] Frame 52
stop();
Symbol 104 MovieClip Frame 60
_totalframes;
Symbol 105 MovieClip [scarabe_back] Frame 1
#initclip 44
Object.registerClass("scarabe_back", com.king.pyramiddeluxe.AnimDriver30Fps);
#endinitclip
Symbol 122 MovieClip [card_back] Frame 1
#initclip 45
Object.registerClass("card_back", com.king.pyramiddeluxe.AnimDriver30Fps);
#endinitclip
Symbol 122 MovieClip [card_back] Frame 50
stop();
Symbol 133 MovieClip [plane_anim_1] Frame 1
#initclip 46
Object.registerClass("plane_anim_1", com.king.pyramiddeluxe.AnimDriver30Fps);
#endinitclip
Symbol 139 MovieClip [plane_anim_2] Frame 1
#initclip 47
Object.registerClass("plane_anim_2", com.king.pyramiddeluxe.AnimDriver30Fps);
#endinitclip
Symbol 141 MovieClip [boat] Frame 1
#initclip 48
Object.registerClass("boat", com.king.pyramiddeluxe.BoatAnim);
#endinitclip
Symbol 142 MovieClip [boat_animation_1] Frame 1
#initclip 49
Object.registerClass("boat_animation_1", com.king.pyramiddeluxe.AnimDriver30Fps);
#endinitclip
Symbol 143 MovieClip [boat_animation_2] Frame 1
#initclip 50
Object.registerClass("boat_animation_2", com.king.pyramiddeluxe.AnimDriver30Fps);
#endinitclip
Symbol 158 MovieClip [train_anim_1] Frame 1
#initclip 51
Object.registerClass("train_anim_1", com.king.pyramiddeluxe.AnimDriver30Fps);
#endinitclip
Symbol 178 MovieClip [map_anim] Frame 1
#initclip 52
Object.registerClass("map_anim", com.king.pyramiddeluxe.AnimDriver30Fps);
#endinitclip
Symbol 221 MovieClip [card_collection2] Frame 1
#initclip 53
Object.registerClass("card_collection2", com.king.pyramiddeluxe.Card);
#endinitclip
Symbol 242 MovieClip [numbers] Frame 1
stop();
Symbol 244 MovieClip [current_run] Frame 1
#initclip 54
Object.registerClass("current_run", com.king.pyramiddeluxe.ComboCounter);
#endinitclip
Symbol 295 MovieClip Frame 1
if (_parent.scarabeFrame != undefined) {
gotoAndStop(_parent.scarabeFrame + 2);
}
Symbol 295 MovieClip Frame 2
if (_parent.scarabeFrame == undefined) {
this.gotoAndPlay(1);
}
Symbol 295 MovieClip Frame 3
gotoAndStop(_parent.scarabeFrame + 2);
Symbol 296 MovieClip [scarab_anim] Frame 1
#initclip 55
Object.registerClass("scarab_anim", com.king.pyramiddeluxe.Scarabe);
#endinitclip
Symbol 305 MovieClip [pyrmapyr] Frame 1
#initclip 56
Object.registerClass("pyrmapyr", com.king.pyramiddeluxe.AnimDriver30Fps);
#endinitclip
Symbol 329 MovieClip [stepanim] Frame 1
#initclip 57
Object.registerClass("stepanim", com.king.pyramiddeluxe.Pyramid);
#endinitclip
Symbol 329 MovieClip [stepanim] Frame 50
stop();
Symbol 329 MovieClip [stepanim] Frame 100
Symbol 329 MovieClip [stepanim] Frame 150
Symbol 329 MovieClip [stepanim] Frame 200
Symbol 329 MovieClip [stepanim] Frame 250
stop();
Symbol 366 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 367 MovieClip [__Packages.com.midasplayer.timing.Timeable] Frame 0
interface com.midasplayer.timing.Timeable
{
}
Symbol 368 MovieClip [__Packages.com.king.pyramiddeluxe.KingGame] Frame 0
class com.king.pyramiddeluxe.KingGame implements com.midasplayer.timing.Timeable
{
var m_parent, m_enableFrameRate, m_performance, m_mainTimer, m_forcedLow, m_soundsEnabled, m_lastFps;
function KingGame (gameParent) {
m_parent = gameParent;
var _local3 = new ContextMenu();
_local3.hideBuiltInItems();
_local3.builtInItems.quality = true;
_root.menu = _local3;
_root._quality = "high";
Stage.scaleMode = "noScale";
m_enableFrameRate = false;
m_performance = new com.midasplayer.timing.Performance(MOVIE_FPS);
m_performance.setFpsThreshold(MIN_FPS, MEASURE_TIME);
m_performance.addQualityFeedbackListener(mx.utils.Delegate.create(this, onLowQualityWarning));
m_mainTimer = new com.midasplayer.timing.Timer(this, 25);
m_forcedLow = false;
m_enableFrameRate = false;
m_soundsEnabled = true;
}
function start() {
m_parent.onEnterFrame = mx.utils.Delegate.create(this, drive);
}
function drive() {
m_mainTimer.advanceTime2();
m_performance.frameUpdated();
if (m_enableFrameRate) {
var _local2 = ((m_performance.__get__fps() > 0) ? ("fps: " + m_performance.__get__fps()) : "");
if (_local2 != m_lastFps) {
m_parent.fpsmeter_txt.text = _local2;
m_parent.fpsmeter_txt.swapDepths(m_parent.getNextHighestDepth());
m_lastFps = _local2;
}
} else if (m_lastFps.length > 0) {
m_parent.fpsmeter_txt.text = "";
m_lastFps = "";
}
}
function tick(tick) {
}
function render(tick, alpha) {
}
function init(gda) {
}
function onLowQualityWarning() {
if (!m_forcedLow) {
m_forcedLow = true;
m_parent._quality = "low";
}
}
static var MOVIE_FPS = 120;
static var MEASURE_TIME = 5;
static var MIN_FPS = 15;
}
Symbol 369 MovieClip [__Packages.com.midasplayer.timing.Timer] Frame 0
class com.midasplayer.timing.Timer
{
var timeable;
function Timer (timeable, gameTicksPerSecond) {
millisPerGameTick = 1000 / gameTicksPerSecond;
this.gameTicksPerSecond = gameTicksPerSecond;
this.timeable = timeable;
maxTickTime = 500;
}
function getMillisPerTick() {
return(millisPerGameTick);
}
function getTicksPerSecond() {
return(gameTicksPerSecond);
}
function setMaxTickTime(millis) {
maxTickTime = millis;
}
function advanceTime2() {
var _local3 = getTimer();
if (startTime < 0) {
startTime = _local3;
unprocessedTime = millisPerGameTick;
}
time = _local3 - startTime;
var _local5 = time - lastTime;
lastTime = time;
unprocessedTime = unprocessedTime + _local5;
if (unprocessedTime >= millisPerGameTick) {
var _local2 = maxTickTime + _local3;
do {
timeable.tick(tick);
tick++;
unprocessedTime = unprocessedTime - millisPerGameTick;
} while ((unprocessedTime >= millisPerGameTick) && (getTimer() < _local2));
}
var _local4 = (unprocessedTime % millisPerGameTick) / millisPerGameTick;
com.midasplayer.timing.IFloat.setAlpha(_local4);
timeable.render(tick, _local4);
}
function advanceTime() {
time = getTimer();
var _local3 = time - lastTime;
lastTime = time;
unprocessedTime = unprocessedTime + _local3;
var _local2 = 0;
while (unprocessedTime > millisPerGameTick) {
unprocessedTime = unprocessedTime - millisPerGameTick;
timeable.tick(tick);
tick++;
_local2++;
if (_local2 >= 10) {
unprocessedTime = 0;
}
}
var _local4 = unprocessedTime / millisPerGameTick;
timeable.render(tick, _local4);
}
var time = 0;
var startTime = -1;
var lastTime = 0;
var unprocessedTime = 0;
var gameTicksPerSecond = 0;
var tick = 0;
var millisPerGameTick = 0;
var maxTickTime = -1;
}
Symbol 370 MovieClip [__Packages.com.midasplayer.timing.IFloat] Frame 0
class com.midasplayer.timing.IFloat
{
static var alpha;
var ivalue, lastValue;
function IFloat (initial) {
ivalue = initial;
lastValue = initial;
alpha = 0;
}
function setTo(initial) {
ivalue = initial;
lastValue = initial;
}
function set(newValue) {
lastValue = ivalue;
ivalue = newValue;
}
function get(lalpha) {
return(lastValue + ((ivalue - lastValue) * lalpha));
}
static function setAlpha(na) {
alpha = na;
}
function get value() {
return(lastValue + ((ivalue - lastValue) * alpha));
}
function set value(v) {
ivalue = v;
lastValue = v;
//return(value);
}
}
Symbol 371 MovieClip [__Packages.com.midasplayer.timing.Performance] Frame 0
class com.midasplayer.timing.Performance
{
var idealFps, measurePeriod, minPeriodFps, listeners, startAt, period, nextFpsUpdate, totalFps, fpsCount, lastFpsCount, periodFps, updates;
function Performance (idealFps) {
this.idealFps = idealFps;
measurePeriod = 5;
minPeriodFps = (idealFps / 2) * measurePeriod;
listeners = [];
begin();
}
function begin() {
startAt = -1;
period = -1;
nextFpsUpdate = getTimer();
totalFps = 0;
fpsCount = 0;
lastFpsCount = -1;
periodFps = 0;
updates = 0;
}
function frameUpdated() {
fpsCount++;
var _local3 = getTimer();
if (startAt < 0) {
startAt = _local3;
}
if (_local3 > nextFpsUpdate) {
if (updates > 0) {
lastFpsCount = fpsCount;
totalFps = totalFps + fpsCount;
}
periodFps = periodFps + fpsCount;
if ((++period) == measurePeriod) {
if (periodFps < minPeriodFps) {
for (var _local2 in listeners) {
listeners[_local2](periodFps / measurePeriod);
}
}
period = 0;
periodFps = 0;
}
nextFpsUpdate = _local3 + 1000;
fpsCount = 0;
updates++;
}
}
function addQualityFeedbackListener(fn) {
listeners.push(fn);
}
function setFpsThreshold(minPeriodFps, measurePeriod) {
this.minPeriodFps = minPeriodFps * measurePeriod;
this.measurePeriod = measurePeriod;
}
function get fps() {
return(lastFpsCount);
}
function get averageFps() {
return(totalFps / ((getTimer() - startAt) / 1000));
}
}
Symbol 372 MovieClip [__Packages.com.midasplayer.util.GameDataAcquirer] Frame 0
class com.midasplayer.util.GameDataAcquirer
{
var attrib, trees, targetVar, dataEvent, timerFn, timer, error;
function GameDataAcquirer (variable) {
attrib = 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);
} else {
trace(("polled: " + getTimer()) + "ms");
}
};
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 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;
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 373 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 = "" + key;
var _local3 = map[_local2];
delete map[_local2];
lastSize = -1;
return(_local3);
}
function contains(key) {
return(map["" + key] != undefined);
}
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 copy() {
var _local2 = new com.midasplayer.util.Map();
for (var _local3 in map) {
_local2.map[_local3] = map[_local3];
}
return(_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;
}
return(_local2);
}
function get iterator() {
return(new com.midasplayer.util.MapIterator(this));
}
function get valueIterator() {
return(new com.midasplayer.util.MapValueIterator(this));
}
function foreach(fn) {
var _local3 = arguments.slice(1);
if (_local3.length > 0) {
do {
if ((in map) == null) {
break;
}
var _local5 = in map;
} while (fn(_local5, map[_local5], _local3[0], _local3[1], _local3[2], _local3[3], _local3[4]) != false);
do {
} while ("foreach" != null);
} else {
do {
if ((in map) == null) {
break;
}
var _local5 = in map;
} while (fn(_local5, map[_local5]) != false);
do {
} while (_local2 != null);
}
lastSize = -1;
}
function get _content() {
return(map);
}
}
Symbol 374 MovieClip [__Packages.com.midasplayer.util.Iterator] Frame 0
interface com.midasplayer.util.Iterator
{
}
Symbol 375 MovieClip [__Packages.com.midasplayer.util.MapIterator] Frame 0
class com.midasplayer.util.MapIterator implements com.midasplayer.util.Iterator
{
var map, keys, ptr;
function MapIterator (map) {
this.map = map;
keys = map.keySet();
ptr = 0;
}
function next() {
if (ptr < keys.length) {
return(keys[ptr++]);
}
return(undefined);
}
function hasNext() {
return(ptr != keys.length);
}
function remove() {
if (ptr == 0) {
return(undefined);
}
map.remove(keys[ptr - 1]);
}
}
Symbol 376 MovieClip [__Packages.com.midasplayer.util.MapValueIterator] Frame 0
class com.midasplayer.util.MapValueIterator implements com.midasplayer.util.Iterator
{
var map, mapRef, keys, ptr;
function MapValueIterator (map) {
this.map = map;
mapRef = map._content;
keys = map.keySet();
ptr = 0;
}
function next() {
return(mapRef[keys[ptr++]]);
}
function hasNext() {
return(ptr != keys.length);
}
function remove() {
if (ptr == 0) {
return(undefined);
}
map.remove(keys[ptr - 1]);
}
}
Symbol 377 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 getProperties() {
return(lang);
}
static function getString(name) {
var _local4 = lang.get(name);
var _local3;
if (_local4 == undefined) {
_local3 = ("{" + name) + "}";
} else {
_local3 = _local4.toString();
}
var _local2 = 1;
while (_local2 < arguments.length) {
_local3 = _local3.split(("{" + (_local2 - 1)) + "}").join(arguments[_local2]);
_local2++;
}
return(_local3);
}
}
Symbol 378 MovieClip [__Packages.com.king.pyramiddeluxe.Game] Frame 0
class com.king.pyramiddeluxe.Game extends com.king.pyramiddeluxe.KingGame
{
var m_quitAddr, m_soundEnabled, m_gameQuit, m_state, m_halt, m_resultFlag, m_execListPc, m_returnCode, m_soundBtn, m_quitBtn, m_data, m_mainTimer, start, m_runState, m_parent;
function Game (m_parent) {
super(m_parent);
m_quitAddr = 0;
m_soundEnabled = true;
m_gameQuit = false;
m_state = null;
m_halt = false;
m_resultFlag = false;
m_execListPc = 0;
m_returnCode = 0;
m_soundBtn = m_parent.btn_sound;
m_quitBtn = m_parent.btn_quit;
m_soundBtn.onPress = mx.utils.Delegate.create(this, onSoundToggle);
m_quitBtn.onPress = mx.utils.Delegate.create(this, onQuit);
}
function onSoundToggle() {
com.midasplayer.fx.SoundManager.enableSounds((m_soundEnabled = !m_soundEnabled));
m_soundBtn.txt.text = (m_soundEnabled ? (com.midasplayer.util.I18n.getString("btn_sound_off")) : (com.midasplayer.util.I18n.getString("btn_sound_on")));
}
function onQuit() {
m_gameQuit = true;
if (m_state) {
m_state.quitGame();
}
}
function init(gda) {
m_data = new Object();
m_data.startFrom = 0;
m_data.currentLevel = m_data.startFrom;
m_data.ticksLeft = 300000 / m_mainTimer.getMillisPerTick();
m_data.totalTicks = m_data.ticksLeft;
m_data.playedTicks = 0;
m_data.millisPerTick = m_mainTimer.getMillisPerTick();
m_data.topRunBonus = 0;
m_data.roundMultiplier = 1;
m_data.roundScoreNoBonus = 0;
m_data.wildCardBonus = 0;
m_data.unusedCardBonus = 0;
m_data.roundScore = 0;
m_data.totalScore = 0;
m_data.seed = gda.getGameData("randomseed");
m_data.rng = new com.midasplayer.util.Random(m_data.seed);
trace("m_data.seed=" + m_data.seed);
start();
}
function tick(tick) {
if (m_halt) {
return(undefined);
}
if ((m_state == null) || (m_state.disengage())) {
if ((m_execListPc < 0) || (m_execListPc >= m_execList.length)) {
trace(((tick + ": fatal: pc out of bounds (") + m_execListPc) + ")");
m_halt = true;
return(undefined);
}
if (m_state && (m_state.disengage())) {
trace(((((tick + ": (disengage ") + m_runState) + ", returncode=") + m_returnCode) + ")");
m_state.destroy();
m_returnCode = m_state.returnCode();
m_state = null;
}
if (m_gameQuit) {
trace("jump to quit address");
m_execListPc = m_quitAddr;
}
var _local5 = m_execList[m_execListPc++];
var _local2 = _local5.split(" ");
switch (_local2[0]) {
case "qu" :
m_quitAddr = parseInt(_local2[1]);
break;
case "nop" :
break;
case "st" :
var _local4 = _local2[1];
m_runState = _local4;
switch (_local4) {
case "fade" :
m_state = new com.king.pyramiddeluxe.StateFade(m_parent, tick, m_data, _local2[2]);
break;
case "init" :
m_state = new com.king.pyramiddeluxe.StateInit(m_parent, tick, m_data, _local2[2]);
break;
case "intro" :
m_state = new com.king.pyramiddeluxe.StateIntro(m_parent, tick, m_data, _local2[2]);
break;
case "game" :
m_state = new com.king.pyramiddeluxe.StateGame(m_parent, tick, m_data, _local2[2]);
break;
case "gameover" :
m_state = new com.king.pyramiddeluxe.StateGameOver(m_parent, tick, m_data, m_returnCode);
break;
case "cutscene" :
m_state = new com.king.pyramiddeluxe.StateCutscene(m_parent, tick, m_data, _local2[2]);
break;
case "complete" :
m_state = new com.king.pyramiddeluxe.StateComplete(m_parent, tick, m_data, _local2[2]);
break;
case "end" :
m_state = new com.king.pyramiddeluxe.StateEnd(m_parent, tick, m_data, _local2[2]);
break;
default :
trace((((tick + ": fatal: couldn't find [") + _local4) + "] pc=") + m_execListPc);
m_halt = true;
return(undefined);
}
trace((((((tick + ": st ") + m_runState) + "(") + m_returnCode) + ") pc=") + m_execListPc);
m_state.engage();
break;
case "stop" :
m_halt = true;
trace((tick + ": [[stop]] pc=") + m_execListPc);
break;
case "cmp" :
m_resultFlag = parseInt(_local2[1]) == m_returnCode;
break;
case "beq" :
if (m_resultFlag) {
m_execListPc--;
m_execListPc = m_execListPc + parseInt(_local2[1]);
}
break;
case "bne" :
if (!m_resultFlag) {
m_execListPc--;
m_execListPc = m_execListPc + parseInt(_local2[1]);
}
break;
case "bra" :
m_execListPc--;
m_execListPc = m_execListPc + parseInt(_local2[1]);
break;
default :
trace(((tick + ": fatal: unknown instruction [[") + _local5) + "]]");
m_halt = true;
return(undefined);
}
}
m_state.tick(tick);
}
function render(tick, alpha) {
m_state.render(tick, alpha);
}
var m_execList = ["qu 9", "st init", "st intro", "st cutscene", "st game", "cmp 0", "beq -3", "cmp 100", "beq 3", "st gameover", "stop", "st complete", "stop"];
}
Symbol 379 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 set seed(s) {
init_genrand(s);
//return(seed);
}
function get seed() {
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 _local6 = getTimer();
lastSeed = s;
mta[0] = s;
var _local2 = s;
var _local3 = new com.midasplayer.util.Integer64();
var _local4 = N;
mti = 1;
while (mti < _local4) {
_local3.init32((_local2 >>> 30) ^ _local2);
_local3.mulu32(1812433253);
_local2 = (mta[mti] = int(_local3.lsb + mti));
mti++;
}
var _local7 = getTimer();
trace(("Random::init_genrand(): initialization ~" + (_local7 - _local6)) + "ms");
}
function genrand_int32() {
var _local9 = N;
var _local3 = 0;
if (mti >= _local9) {
if (mti == (_local9 + 1)) {
init_genrand(5489);
}
var _local8 = M;
var _local6 = UPPER_MASK;
var _local4 = LOWER_MASK;
var _local5 = mag01;
var _local11 = getTimer();
var _local2 = 0;
var _local7 = _local9 - _local8;
var _local10 = _local8 - _local9;
_local2 = 0;
while (_local2 < _local7) {
_local3 = (mta[_local2] & _local6) | (mta[_local2 + 1] & _local4);
mta[_local2] = (mta[_local2 + _local8] ^ (_local3 >>> 1)) ^ _local5[_local3 & 1];
_local2++;
}
_local7 = _local9 - 1;
while (_local2 < _local7) {
_local3 = (mta[_local2] & _local6) | (mta[_local2 + 1] & _local4);
mta[_local2] = (mta[_local2 + _local10] ^ (_local3 >>> 1)) ^ _local5[_local3 & 1];
_local2++;
}
_local3 = (mta[_local9 - 1] & _local6) | (mta[0] & _local4);
mta[_local9 - 1] = (mta[_local8 - 1] ^ (_local3 >>> 1)) ^ _local5[_local3 & 1];
mti = 0;
var _local12 = getTimer();
trace(((("Random::genrand_int32(): precalc " + _local9) + " new numbers ~") + (_local12 - _local11)) + "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 380 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] << 15)) | ((p[2] & 3) << 30));
}
function get msb() {
return((((p[2] >> 2) | ((p[3] << 15) >> 2)) | ((p[4] << 30) >> 2)) & 2147483647);
}
function binaryShiftLeft(step) {
var _local2 = 0;
while (_local2 < step) {
shl();
_local2++;
}
}
function binaryShiftRight(step) {
var _local4 = (step / 15) >> 0;
var _local5 = step - (_local4 * 15);
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 & 32767;
_local4 = _local4 >> 15;
_local2++;
}
}
function add32(num) {
var _local2 = 0;
var _local5 = num & 32767;
num = num >> 15;
var _local6 = num & 32767;
num = num >> 15;
var _local4 = num & 3;
_local2 = _local2 + (p[0] + _local5);
p[0] = _local2 & 32767;
_local2 = _local2 >> 15;
_local2 = _local2 + (p[1] + _local6);
p[1] = _local2 & 32767;
_local2 = _local2 >> 15;
_local2 = _local2 + (p[2] + _local4);
p[2] = _local2 & 32767;
}
function mulu32(num) {
var _local3 = 0;
s[0] = num & 32767;
num = num >>> 15;
s[1] = num & 32767;
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 & 32767;
_local3 = _local3 >> 15;
_local3 = _local3 + (_local4 * p[1]);
r[_local2][1] = _local3 & 32767;
_local3 = _local3 >> 15;
_local3 = _local3 + (_local4 * p[2]);
r[_local2][2] = _local3 & 3;
_local2++;
}
_local3 = r[0][0];
p[0] = _local3 & 32767;
_local3 = _local3 >> 15;
_local3 = _local3 + (r[0][1] + r[1][0]);
p[1] = _local3 & 32767;
_local3 = _local3 >> 15;
_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 & 32767;
_local2 = _local2 >> 15;
_local2 = _local2 + (_local4 * p[1]);
r[_local3][1] = _local2 & 32767;
_local2 = _local2 >> 15;
_local2 = _local2 + (_local4 * p[2]);
r[_local3][2] = _local2 & 32767;
_local2 = _local2 >> 15;
_local2 = _local2 + (_local4 * p[3]);
r[_local3][3] = _local2 & 32767;
_local2 = _local2 >> 15;
_local2 = _local2 + (_local4 * p[4]);
r[_local3][4] = _local2 & 32767;
_local3++;
}
_local2 = r[0][0];
p[0] = _local2 & 32767;
_local2 = _local2 >> 15;
_local2 = _local2 + (r[0][1] + r[1][0]);
p[1] = _local2 & 32767;
_local2 = _local2 >> 15;
_local2 = _local2 + ((r[0][2] + r[1][1]) + r[2][0]);
p[2] = _local2 & 32767;
_local2 = _local2 >> 15;
_local2 = _local2 + (((r[0][3] + r[1][2]) + r[2][1]) + r[3][0]);
p[3] = _local2 & 32767;
_local2 = _local2 >> 15;
_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;
}
}
}
Symbol 381 MovieClip [__Packages.com.king.pyramiddeluxe.State] Frame 0
class com.king.pyramiddeluxe.State
{
var m_disengage, m_startTick, m_data, m_width, m_height, m_ctorParam, m_parent;
function State (aParent, tick, dao, param) {
m_disengage = false;
m_startTick = tick;
m_data = dao;
m_width = 755;
m_height = 600;
m_ctorParam = param;
m_parent = aParent;
}
function quitGame() {
}
function destroy() {
}
function engage(tick, dao, prevStateReturnCode) {
}
function disengage() {
return(true);
}
function returnCode() {
return(0);
}
function tick(tick) {
}
function render(tick, alpha) {
}
}
Symbol 382 MovieClip [__Packages.com.midasplayer.fx.SoundManager] Frame 0
class com.midasplayer.fx.SoundManager
{
static var preloadLastId, progressCallback, preloadList, preloadNum, preloadLast, beginLoadCallback;
function SoundManager () {
}
static function setup(useClip) {
m_placeholder = useClip;
}
static function isSoundEnabled() {
return(soundEnabled);
}
static function enableSounds(enabled) {
soundEnabled = enabled;
if (!enabled) {
muteAll();
} else {
restoreMuteAll();
}
}
static function stopAll() {
sounds.foreach(function (name, soundEntry) {
soundEntry.sound.stop();
soundEntry.playStatus = false;
});
}
static function muteAll() {
sounds.foreach(function (name, soundEntry) {
soundEntry.sound.setVolume(0);
soundEntry.isMuted = true;
});
}
static function restoreMuteAll() {
sounds.foreach(function (name, soundEntry) {
soundEntry.sound.setVolume(soundEntry.realVol);
soundEntry.isMuted = false;
});
}
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)) {
if (!_local1.isMuted) {
_local1.sound.setVolume(percent);
}
_local1.realVol = percent;
}
}
static function getPosition(resource) {
var _local1 = sounds.get(resource);
if ((_local1 != undefined) && (_local1.playStatus == true)) {
return(_local1.sound.position);
}
return(-1);
}
static function getLength(resource) {
var _local1 = sounds.get(resource);
if (_local1 != undefined) {
return(_local1.sound.duration);
}
return(-1);
}
static function isPlaying(resource) {
var _local1 = sounds.get(resource);
return((_local1 != undefined) && (_local1.playStatus == true));
}
static function initialize(list) {
for (var _local8 in list) {
var resource = list[_local8];
var _local2 = m_placeholder.getNextHighestDepth();
var _local1 = new Sound(m_placeholder.createEmptyMovieClip("sm_sndhold_" + _local2, _local2));
_local1.attachSound(resource);
_local1.onSoundComplete = function () {
var _local1 = com.midasplayer.fx.SoundManager.sounds.get(resource);
_local1.playStatus = false;
};
sounds.put(resource, {realVol:100, sound:_local1, playStatus:false});
}
}
static function killPreload() {
trace(("auto unloading pending \"" + preloadLastId) + "\"");
unload(preloadLastId);
progressCallback = undefined;
preloadLastId = undefined;
preloadList = undefined;
preloadNum = 0;
preloadLast = undefined;
}
static function preload(urlList, fnProgressCallback, fnBeginLoadCallback) {
beginLoadCallback = fnBeginLoadCallback;
progressCallback = fnProgressCallback;
preloadList = new Array();
for (var _local2 in urlList) {
preloadList.push(urlList[_local2]);
}
preloadLast = "";
preloadNum = urlList.length;
loadUrl_();
}
static function unload(name) {
var _local1 = sounds.get(name);
if ((_local1 != undefined) && (_local1.runtime == true)) {
var _local2 = m_placeholder[_local1.clipId];
_local2.removeMovieClip();
delete _local1.sound;
_local1.sound = undefined;
sounds.remove(name);
}
}
static function setPlaceholderParent(p) {
m_placeholder = p;
}
static function play(resource, volume, isLoop, fn) {
if (volume == undefined) {
volume = 100;
}
if (isLoop == undefined) {
isLoop = false;
}
volume = getCalibratedVolume(volume);
var _local1 = sounds.get(resource);
if (_local1 != undefined) {
_local1.sound.setVolume((soundEnabled ? (volume) : 0));
_local1.realVol = volume;
_local1.isMuted = !soundEnabled;
_local1.playStatus = true;
_local1.onPlayedFn = fn;
_local1.sound.start(0, (isLoop ? 65535 : 1));
} else {
var _local5 = m_placeholder.getNextHighestDepth();
var _local3 = new Sound(m_placeholder.createEmptyMovieClip("sm_sndhold_" + _local5, _local5));
_local3.attachSound(resource);
_local3.onSoundComplete = function () {
var _local1 = com.midasplayer.fx.SoundManager.sounds.get(resource);
_local1.playStatus = false;
com.midasplayer.fx.SoundManager.onPlayed_(resource);
};
_local3.setVolume((soundEnabled ? (volume) : 0));
_local3.start(0, (isLoop ? 65535 : 1));
sounds.put(resource, {isMuted:!soundEnabled, realVol:volume, onPlayedFn:fn, sound:_local3, playStatus:true});
}
}
static function onPlayed_(name) {
var _local1 = sounds.get(name);
if ((_local1 != undefined) && (_local1.onPlayedFn != undefined)) {
_local1.onPlayedFn();
}
}
static function loadUrl_(success) {
var _local8 = preloadNum - preloadList.length;
if (_local8 != 0) {
if (success == false) {
trace(("SoundManager.preload(): FAILED TO LOAD " + preloadLast) + ", SKIPPED!");
}
progressCallback(_local8, success);
}
if (preloadList.length == 0) {
progressCallback = undefined;
preloadList = undefined;
preloadNum = 0;
preloadLast = undefined;
return(undefined);
}
var _local5 = preloadList.pop();
preloadLast = _local5.url;
var nextId = _local5.id;
if (!_local5.id) {
var _local3 = preloadLast.lastIndexOf("/");
if (_local3 == -1) {
_local3 = 0;
} else {
_local3++;
}
var _local4 = preloadLast.lastIndexOf(".");
if (_local4 == -1) {
_local4 = preloadLast.length;
}
nextId = preloadLast.substring(_local3, _local4);
trace((("SoundManager.preload(): assigned id: " + preloadLast) + " => ") + nextId);
}
var _local7 = m_placeholder.getNextHighestDepth();
var _local6 = "dn_sndhold_" + _local7;
var _local2 = new Sound(m_placeholder.createEmptyMovieClip(_local6, _local7));
_local2.onLoad = function (a) {
var _local2 = com.midasplayer.fx.SoundManager.loadUrl_;
com.midasplayer.util.Delay.oneShot(this, _local2, 50, a);
};
_local2.onSoundComplete = function () {
var _local1 = com.midasplayer.fx.SoundManager.sounds.get(nextId);
_local1.playStatus = false;
com.midasplayer.fx.SoundManager.onPlayed_(nextId);
};
preloadLastId = nextId;
_local2.loadSound("" + preloadLast, false);
sounds.put(nextId, {realVol:100, clipId:_local6, sound:_local2, playStatus:false, runtime:true});
if (beginLoadCallback) {
beginLoadCallback(_local2, preloadLast, nextId, (preloadNum - preloadList.length) - 1);
}
}
static var m_placeholder = _root;
static var sounds = new com.midasplayer.util.Map();
static var soundEnabled = true;
}
Symbol 383 MovieClip [__Packages.com.midasplayer.util.Delay] Frame 0
class com.midasplayer.util.Delay
{
var m_fn, m_param, m_context, m_delay, m_started, m_timerId;
function Delay (context, fn, delay) {
m_fn = fn;
m_param = new Array();
var _local3 = 3;
while (_local3 < arguments.length) {
m_param.push(arguments[_local3]);
_local3++;
}
m_context = context;
m_delay = delay;
m_started = getTimer();
m_timerId = setInterval(mx.utils.Delegate.create(this, onEvent), delay);
}
function onEvent() {
if (getTimer() >= (m_delay + m_started)) {
clearInterval(m_timerId);
m_fn.apply(m_context, m_param);
m_fn = undefined;
m_param = undefined;
}
}
static function oneShot(context, fn, delay) {
var _local3 = new com.midasplayer.util.Delay(context, fn, delay);
_local3.m_param = new Array();
var _local2 = 3;
while (_local2 < arguments.length) {
_local3.m_param.push(arguments[_local2]);
_local2++;
}
}
}
Symbol 384 MovieClip [__Packages.com.king.pyramiddeluxe.StateFade] Frame 0
class com.king.pyramiddeluxe.StateFade extends com.king.pyramiddeluxe.State
{
var m_ctorParam, m_fadeTime, m_fadeDoneTick, m_startTick, m_fadeAmount, m_overlay, m_parent, m_width, m_height, m_disengage;
function StateFade (a1, a2, a3, a4, a5) {
super(a1, a2, a3, a4, a5);
}
function engage() {
var _local2 = parseInt(String(m_ctorParam), 16);
m_fadeTime = 30;
m_fadeDoneTick = m_startTick + m_fadeTime;
m_fadeAmount = new com.midasplayer.timing.IFloat(0);
m_overlay = m_parent.createEmptyMovieClip("ovr", m_parent.getNextHighestDepth());
m_overlay._alpha = 0;
m_overlay.beginFill(_local2);
m_overlay.moveTo(0, 0);
m_overlay.lineTo(m_width, 0);
m_overlay.lineTo(m_width, m_height);
m_overlay.lineTo(0, m_height);
m_overlay.lineTo(0, 0);
m_overlay.endFill();
}
function destroy() {
m_overlay.removeMovieClip();
m_overlay = null;
}
function disengage() {
return(m_disengage);
}
function returnCode() {
return(0);
}
function tick(tick) {
var _local2 = 1 - (Math.max(0, m_fadeDoneTick - tick) / m_fadeTime);
if (_local2 == 1) {
m_disengage = true;
}
m_fadeAmount.__set__value(_local2);
}
function render(tick, alpha) {
m_overlay._alpha = 100 * m_fadeAmount.__get__value();
}
}
Symbol 385 MovieClip [__Packages.com.king.pyramiddeluxe.StateInit] Frame 0
class com.king.pyramiddeluxe.StateInit extends com.king.pyramiddeluxe.State
{
var m_delayed, m_startTick, m_parent, m_disengage;
function StateInit (a1, a2, a3, a4, a5) {
super(a1, a2, a3, a4, a5);
}
function engage() {
m_delayed = m_startTick + 1;
var _local3 = m_parent.attachMovie("map_container", "cutscene", m_parent.getNextHighestDepth());
_local3._x = 12;
_local3._y = 10;
_local3._visible = false;
var _local2 = m_parent.createEmptyMovieClip("border_left", m_parent.getNextHighestDepth());
_local2.beginFill(0);
_local2.moveTo(0, 60);
_local2.lineTo(60, 60);
_local2.lineTo(60, 450);
_local2.lineTo(0, 450);
_local2.endFill();
_local2 = m_parent.createEmptyMovieClip("border_top", m_parent.getNextHighestDepth());
_local2.beginFill(0);
_local2.moveTo(0, 0);
_local2.lineTo(755, 0);
_local2.lineTo(755, 60);
_local2.lineTo(0, 60);
_local2.endFill();
_local2 = m_parent.createEmptyMovieClip("border_right", m_parent.getNextHighestDepth());
_local2.beginFill(0);
_local2.moveTo(695, 60);
_local2.lineTo(755, 60);
_local2.lineTo(755, 450);
_local2.lineTo(695, 450);
_local2.endFill();
_local2 = m_parent.createEmptyMovieClip("border_bottom", m_parent.getNextHighestDepth());
_local2.beginFill(0);
_local2.moveTo(0, 450);
_local2.lineTo(755, 450);
_local2.lineTo(755, 510);
_local2.lineTo(0, 510);
_local2.endFill();
m_parent.btn_quit.txt.text = com.midasplayer.util.I18n.getString("btn_quit_game");
m_parent.btn_sound.txt.text = com.midasplayer.util.I18n.getString("btn_sound_off");
}
function disengage() {
return(m_disengage);
}
function returnCode() {
return(-1);
}
function tick(tick) {
if (tick == m_delayed) {
var _local5 = m_parent.cutscene.anim.anim2;
var _local3 = _local5.attachMovie("wavemask", "animmask", _local5.getNextHighestDepth());
_local3._x = 68;
_local3._y = 0;
_local3._visible = false;
var _local8 = _local5.createEmptyMovieClip("maskedbkg", _local5.getNextHighestDepth());
var _local2 = 5;
while (_local2--) {
_local3 = _local5["anim_" + (1 + _local2)];
_local3._visible = false;
var _local4 = com.king.pyramiddeluxe.AnimDriver(_local3);
_local4.frozen = true;
}
fscommand ("gameStart");
trace("fscommand(\"gameStart\") tick");
var _local7 = [881, tick, "1"];
var _local6 = _local7.join(",") + ",0=0";
trace(" [playData: " + _local6);
fscommand ("playData", _local6);
m_disengage = true;
}
}
function render(tick, alpha) {
}
}
Symbol 386 MovieClip [__Packages.com.king.pyramiddeluxe.AnimDriver] Frame 0
class com.king.pyramiddeluxe.AnimDriver extends MovieClip
{
var m_isFrozen, m_ticks, m_direction, m_frameRate, m_frameTime, m_frameCounts, m_clips, cacheAsBitmap, m_stopped, m_once, m_lastTime, onEnterFrame;
function AnimDriver (frameRate) {
super();
m_isFrozen = false;
m_ticks = 0;
m_direction = 1;
m_frameRate = frameRate;
m_frameTime = (1 / m_frameRate) * 1000;
m_frameCounts = {};
m_clips = find(this);
for (var _local3 in m_clips) {
m_frameCounts[m_clips[_local3]._name] = 0;
}
cacheAsBitmap = true;
m_stopped = true;
m_once = false;
m_lastTime = getTimer();
}
function drive() {
if (m_stopped) {
cacheAsBitmap = true;
onEnterFrame = undefined;
return(undefined);
}
var _local9 = getTimer();
var _local10 = _local9 - m_lastTime;
m_lastTime = _local9;
m_ticks = m_ticks + (_local10 / m_frameTime);
var _local6 = int(m_ticks);
if (_local6 > 0) {
if (m_direction > 0) {
m_ticks = m_ticks - (m_direction * _local6);
} else if (m_direction < 0) {
m_ticks = m_ticks + (m_direction * _local6);
}
var _local5 = 0;
var _local7 = 0;
for (var _local8 in m_clips) {
var _local2 = m_clips[_local8];
if (com.king.pyramiddeluxe.AnimDriver(_local2) != null) {
var _local4 = com.king.pyramiddeluxe.AnimDriver(_local2);
if (_local4.frozen == true) {
continue;
}
}
m_frameCounts[_local2._name] = m_frameCounts[_local2._name] + (m_direction * _local6);
if (m_once) {
if ((m_direction > 0) && (m_frameCounts[_local2._name] >= _local2._totalframes)) {
m_frameCounts[_local2._name] = _local2._totalframes - 1;
_local2.frozen = true;
_local5++;
}
if ((m_direction < 0) && (m_frameCounts[_local2._name] <= 0)) {
m_frameCounts[_local2._name] = 0;
_local2.frozen = true;
_local5++;
}
}
var _local3 = (m_frameCounts[_local2._name] % _local2._totalframes) + 1;
_local2.gotoAndStop(_local3);
_local7++;
}
if (_local5 == _local7) {
m_stopped = true;
}
}
}
function get frozen() {
return(m_isFrozen);
}
function set frozen(b) {
m_isFrozen = b;
//return(frozen);
}
function forceCompleted() {
cacheAsBitmap = true;
onEnterFrame = undefined;
var _local7 = 0;
var _local6 = 0;
for (var _local5 in m_clips) {
var _local2 = m_clips[_local5];
if (com.king.pyramiddeluxe.AnimDriver(_local2) != null) {
var _local4 = com.king.pyramiddeluxe.AnimDriver(_local2);
if (_local4.frozen == true) {
continue;
}
}
m_frameCounts[_local2._name] = m_frameCounts[_local2._name] + (m_direction * 10000);
if (m_once) {
if ((m_direction > 0) && (m_frameCounts[_local2._name] >= _local2._totalframes)) {
m_frameCounts[_local2._name] = _local2._totalframes - 1;
_local2.frozen = true;
}
if ((m_direction < 0) && (m_frameCounts[_local2._name] <= 0)) {
m_frameCounts[_local2._name] = 0;
_local2.frozen = true;
}
var _local3 = (m_frameCounts[_local2._name] % _local2._totalframes) + 1;
_local2.gotoAndStop(_local3);
}
}
}
function isRunning() {
return(onEnterFrame != undefined);
}
function playOnce(dir, fromFrame) {
if (fromFrame == undefined) {
fromFrame = 1;
}
if (dir == undefined) {
m_direction = 1;
} else {
m_direction = dir;
}
m_isFrozen = false;
m_ticks = 0;
m_stopped = false;
m_once = true;
m_lastTime = getTimer();
for (var _local5 in m_clips) {
var _local2 = m_clips[_local5];
if (com.king.pyramiddeluxe.AnimDriver(_local2) != null) {
var _local3 = com.king.pyramiddeluxe.AnimDriver(_local2);
if (_local3.frozen == true) {
continue;
}
}
m_frameCounts[_local2._name] = fromFrame - 1;
_local2.gotoAndStop(fromFrame);
}
cacheAsBitmap = false;
onEnterFrame = mx.utils.Delegate.create(this, drive);
}
function playStart(startFrom) {
if (startFrom == undefined) {
startFrom = 0;
}
m_ticks = 0;
m_stopped = false;
m_lastTime = getTimer();
for (var _local5 in m_clips) {
var _local2 = m_clips[_local5];
if (com.king.pyramiddeluxe.AnimDriver(_local2) != null) {
var _local3 = com.king.pyramiddeluxe.AnimDriver(_local2);
if (_local3.frozen == true) {
continue;
}
}
m_frameCounts[_local2._name] = startFrom;
_local2.gotoAndStop(1);
}
cacheAsBitmap = false;
onEnterFrame = mx.utils.Delegate.create(this, drive);
}
function playStop() {
m_stopped = true;
onEnterFrame = undefined;
}
function find(clip) {
var _local4 = new Array();
if (clip._totalframes > 1) {
clip.stop();
_local4.push(clip);
}
for (var _local7 in clip) {
var _local3 = clip[_local7];
var _local2 = find(_local3);
for (var _local6 in _local2) {
_local4.push(_local2[_local6]);
}
}
return(_local4);
}
}
Symbol 387 MovieClip [__Packages.com.king.pyramiddeluxe.StateIntro] Frame 0
class com.king.pyramiddeluxe.StateIntro extends com.king.pyramiddeluxe.State
{
var m_parent, m_logo, m_introText, m_clicked, m_quitTime, m_lastTick, m_gameQuit, m_startTick, m_fadeBorderFullAt, m_fadeInBegin, m_disengage, m_anim;
function StateIntro (a1, a2, a3, a4, a5) {
super(a1, a2, a3, a4, a5);
}
function destroy() {
m_parent.cutscene.onPress = undefined;
m_logo.removeMovieClip();
m_introText._x = 5;
m_introText._y = 265;
}
function onMouseUp() {
if (!m_clicked) {
m_clicked = true;
m_quitTime = m_lastTick + 2;
}
}
function quitGame() {
if (!m_gameQuit) {
m_gameQuit = true;
m_quitTime = m_lastTick + 2;
}
}
function engage() {
m_clicked = false;
m_gameQuit = false;
m_parent.cutscene.swapDepths(m_parent.getNextHighestDepth());
m_parent.btn_quit.swapDepths(m_parent.getNextHighestDepth());
m_parent.btn_sound.swapDepths(m_parent.getNextHighestDepth());
var _local2 = m_parent.cutscene.anim.anim2;
m_logo = _local2.attachMovie("logo", "logo", _local2.getNextHighestDepth());
m_logo._x = 203;
m_logo._y = 83;
m_introText = _local2.attachMovie("intro_plate", "intro_text", _local2.getNextHighestDepth());
m_introText._x = 112;
m_introText._y = 265;
m_introText.blendMode = "screen";
m_introText.inner.txt.text = com.midasplayer.util.I18n.getString("intro_text");
m_introText.cacheAsBitmap = true;
com.midasplayer.fx.SoundManager.play("pyramid_intro");
m_parent.cutscene.onPress = mx.utils.Delegate.create(this, onMouseUp);
m_quitTime = m_startTick + 300;
m_fadeBorderFullAt = -1;
m_fadeInBegin = false;
m_parent.cutscene._visible = true;
}
function disengage() {
return(m_disengage);
}
function returnCode() {
return(-1);
}
function tick(tick) {
m_lastTick = tick;
if (tick == m_quitTime) {
m_fadeBorderFullAt = getTimer() + 500;
m_anim = new com.midasplayer.util.EaseOutQuadAnimator(m_introText);
m_anim.setDuration(500);
m_anim.setPosition(5, 265);
}
}
function render(tick, alpha) {
if (m_anim != undefined) {
if (m_anim.update()) {
m_anim = undefined;
}
}
if ((!m_disengage) && (m_fadeBorderFullAt != -1)) {
var _local2 = Math.max(0, m_fadeBorderFullAt - getTimer()) / 500;
var _local3 = int(100 * (1 - _local2));
m_logo._alpha = 100 - _local3;
if (_local2 == 0) {
m_disengage = true;
m_fadeBorderFullAt = -1;
}
}
}
}
Symbol 388 MovieClip [__Packages.com.midasplayer.util.Animator] Frame 0
class com.midasplayer.util.Animator
{
var finished, targetObject, x, startX, y, startY, startTime, tick, duration, timeTicks, targetY, targetX, dx, dy, dt, callback, callbackFire;
function Animator (t) {
finished = true;
targetObject = t;
x = (startX = t._x);
y = (startY = t._y);
startTime = null;
tick = 0;
duration = 800;
timeTicks = false;
}
function fillBaseCopy(t, o) {
o.targetObject = t;
o.duration = duration;
o.x = x;
o.y = y;
o.startTime = startTime;
o.finished = finished;
o.timeTicks = timeTicks;
o.tick = tick;
o.targetY = targetY;
o.targetX = targetX;
o.startX = startX;
o.startY = startY;
o.dx = dx;
o.dy = dy;
o.dt = dt;
}
function setSource(t) {
targetObject = t;
x = (startX = t._x);
y = (startY = t._y);
}
function complete() {
startTime = null;
x = targetX;
y = targetY;
finished = true;
targetObject._x = x;
targetObject._y = y;
}
function setPosition(x, y) {
startX = targetObject._x;
startY = targetObject._y;
targetX = Math.round(x);
targetY = Math.round(y);
finished = false;
startTime = null;
}
function setDuration(ms) {
duration = ms;
finished = false;
startTime = null;
}
function setDurationTicks(ticks) {
duration = ticks;
finished = false;
startTime = null;
timeTicks = true;
}
function getElapsedPercent() {
return(getElapsed());
}
function getElapsed() {
if ((!dt) || (duration == 0)) {
return(1);
}
return(Math.max(0, duration - dt) / duration);
}
function update() {
if (finished) {
if (callback && ((1 - getElapsed()) >= callbackFire)) {
callback();
callbackFire = undefined;
callback = undefined;
}
return(true);
}
if (!timeTicks) {
var _local2 = getTimer();
if (startTime == null) {
startTime = _local2;
}
dt = _local2 - startTime;
} else {
dt = tick;
tick++;
}
dx = targetX - startX;
dy = targetY - startY;
nextPosition();
var _local4 = false;
x = Math.floor(x);
if (((x >= targetX) && (targetX >= startX)) || ((x <= targetX) && (targetX <= startX))) {
_local4 = true;
x = targetX;
}
var _local3 = false;
y = Math.floor(y);
if (((y >= targetY) && (targetY >= startY)) || ((y <= targetY) && (targetY <= startY))) {
_local3 = true;
y = targetY;
}
if (_local4 && (_local3)) {
startTime = null;
x = targetX;
y = targetY;
finished = true;
}
targetObject._x = x;
targetObject._y = y;
if (callback && ((1 - getElapsed()) >= callbackFire)) {
callback();
callbackFire = undefined;
callback = undefined;
}
return(finished);
}
function setCallback(at, fn) {
callbackFire = ((at == undefined) ? 1 : (at));
callback = fn;
}
function toString() {
return((((((((("Animator[start=" + [startX, startY]) + ", target=") + [targetX, targetY]) + ", t=") + getElapsedPercent()) + ", ticks=") + tick) + ", targetObject=") + [targetObject._x, targetObject._y]);
}
function isFinished() {
return(finished);
}
function nextPosition() {
}
}
Symbol 389 MovieClip [__Packages.com.midasplayer.util.EaseOutQuadAnimator] Frame 0
class com.midasplayer.util.EaseOutQuadAnimator extends com.midasplayer.util.Animator
{
var dt, duration, x, startX, dx, y, startY, dy;
function EaseOutQuadAnimator (o) {
super(o);
}
function nextPosition() {
var _local2 = dt;
var _local4 = duration * duration;
if (_local2 > duration) {
_local2 = duration;
}
var _local3 = _local2 * _local2;
x = ((((-dx) * _local3) / _local4) + (((2 * dx) * _local2) / duration)) + startX;
y = ((((-dy) * _local3) / _local4) + (((2 * dy) * _local2) / duration)) + startY;
}
}
Symbol 390 MovieClip [__Packages.com.king.pyramiddeluxe.CardListener] Frame 0
interface com.king.pyramiddeluxe.CardListener
{
}
Symbol 391 MovieClip [__Packages.com.king.pyramiddeluxe.Card] Frame 0
class com.king.pyramiddeluxe.Card extends MovieClip
{
var m_cardState, m_currentColor, m_ox, m_oy, m_px, m_py, m_scale, m_frame, m_pxscale, m_flipAnim, m_flipAnimCompleteTime, m_animDelay, m_deadAfterCurrent, m_depthSwapped, m_removeAfterRender, m_fx, m_fxscale, m_cardData, m_fy, m_animSlave, m_currentType, m_currentSuit, m_faceVisible, m_beenInLevel, m_listener, m_clip, card, m_glowClip, glowlayer, _xscale, _yscale, _visible, cacheAsBitmap, useHandCursor, m_color, m_noMoreUpdate, m_animator, _x, _y, removeMovieClip, swapDepths, m_readyForClick, _parent;
function Card () {
super();
m_cardState = IN_DECK;
m_currentColor = {};
m_ox = 0;
m_oy = 0;
m_px = 0;
m_py = 0;
m_scale = 100;
m_frame = 54;
m_pxscale = -m_scale;
m_flipAnim = 0;
m_flipAnimCompleteTime = 0;
m_animDelay = 0;
m_deadAfterCurrent = false;
m_depthSwapped = false;
m_removeAfterRender = false;
m_fx = new com.midasplayer.timing.IFloat();
m_fxscale = new com.midasplayer.timing.IFloat();
m_cardData = null;
m_fy = new com.midasplayer.timing.IFloat();
m_animSlave = {_x:0, _y:0};
m_currentType = TYPE_UNKNOWN;
m_currentSuit = SUIT_UNKNOWN;
m_faceVisible = false;
m_beenInLevel = false;
m_listener = new Array();
m_clip = card;
m_glowClip = glowlayer;
_xscale = -m_scale;
_yscale = m_scale;
_visible = false;
cacheAsBitmap = true;
useHandCursor = false;
m_clip.gotoAndStop(m_frame);
m_color = new Color(this);
m_noMoreUpdate = false;
}
function isRemovable() {
return(((m_flipAnim == 0) && (m_animator == undefined)) && (m_noMoreUpdate));
}
function readyForAnim() {
m_noMoreUpdate = false;
}
function render() {
_x = m_fx.value;
_y = m_fy.value;
_xscale = m_fxscale.value;
}
function removeWhenNoRender() {
m_noMoreUpdate = true;
}
function flush() {
m_flipAnim = 0;
_x = m_px;
_y = m_py;
_xscale = m_pxscale;
}
function destroy() {
removeMovieClip();
}
function update(tick) {
if (m_animDelay != 0) {
m_animDelay--;
return(undefined);
}
if (m_flipAnim != 0) {
var _local4 = 8;
if ((m_cardState == IN_HAND) || (m_cardState == IN_TOMOVE_HAND)) {
_local4 = 4;
}
if (m_flipAnimCompleteTime == -1) {
m_flipAnimCompleteTime = tick + _local4;
}
var _local2 = Math.max(0, m_flipAnimCompleteTime - tick) / _local4;
if (m_flipAnim == 1) {
if (_local2 < 0.5) {
if (m_faceVisible) {
m_clip.gotoAndStop(m_frame);
} else {
m_clip.gotoAndStop(54);
}
}
m_pxscale = (-m_scale) + ((2 * m_scale) * _local2);
if (_local2 == 0) {
for (var _local3 in m_listener) {
m_listener[_local3].onAnimationDone(this, 2);
}
m_flipAnim = 0;
}
}
if (m_flipAnim == 2) {
if (_local2 < 0.5) {
if (m_faceVisible) {
m_clip.gotoAndStop(m_frame);
} else {
m_clip.gotoAndStop(54);
}
}
_local2 = 1 - _local2;
m_pxscale = (-m_scale) + ((2 * m_scale) * _local2);
if (_local2 == 1) {
for (var _local3 in m_listener) {
m_listener[_local3].onAnimationDone(this, 2);
}
m_flipAnim = 0;
}
}
}
if (m_animator != undefined) {
if (m_animator.update()) {
m_animator = undefined;
if (m_cardState == IN_TOMOVE_LEVEL) {
m_cardState = IN_LEVEL;
m_beenInLevel = true;
}
if (m_cardState == IN_TOMOVE_HAND) {
m_cardState = IN_HAND;
}
if (m_cardState == IN_TOMOVE_WILD) {
m_cardState = IN_WILD;
}
for (var _local3 in m_listener) {
m_listener[_local3].onAnimationDone(this, 1);
}
}
if (m_cardState == IN_TOMOVE_LEVEL) {
if ((!m_depthSwapped) && (m_animator.getElapsed() > 0.33)) {
swapDepths(m_cardData.getId() + 100);
m_depthSwapped = true;
}
}
m_px = m_animSlave._x;
m_py = m_animSlave._y;
}
m_fxscale.set(m_pxscale);
m_fx.set(m_px);
m_fy.set(m_py);
}
function matches(a) {
var _local2 = false;
var _local4 = a.getType();
var _local3 = getType();
var _local5 = Math.abs(_local4 - _local3) % MAX_CARDTYPE;
_local2 = _local2 || ((_local4 == TYPE_ACE) && ((_local3 == TYPE_TWO) || (_local3 == TYPE_KING)));
_local2 = _local2 || ((_local3 == TYPE_ACE) && ((_local4 == TYPE_TWO) || (_local4 == TYPE_KING)));
_local2 = _local2 || (_local5 == 1);
_local2 = _local2 || (a.isWild());
return(_local2);
}
function setCardState(s) {
m_cardState = s;
}
function getCardState() {
return(m_cardState);
}
function setReadyForClick(b) {
useHandCursor = b;
m_readyForClick = b;
}
function onRollOver() {
if ((m_cardState != IN_LEVEL) || (m_cardData.getCardLayer() != 0)) {
return(undefined);
}
if (m_cardData.isScarabe()) {
m_glowClip.filters = [new flash.filters.GlowFilter(6750207, 100, 25, 25, 5, 2, false, false)];
} else {
m_glowClip.filters = [new flash.filters.GlowFilter(6750207, 100, 10, 10, 5, 2, false, false)];
}
}
function onRollOut() {
if ((m_cardState != IN_LEVEL) || (m_cardData.getCardLayer() != 0)) {
return(undefined);
}
if (m_cardData.isScarabe()) {
m_glowClip.filters = [new flash.filters.GlowFilter(6750207, 100, 15, 15, 5, 2, false, false)];
} else {
m_glowClip.filters = [];
}
}
function onRelease() {
onRollOut();
}
function onReleaseOutside() {
onRollOut();
}
function onPress() {
if (m_readyForClick) {
for (var _local2 in m_listener) {
m_listener[_local2].onClickedCard(this);
}
}
}
function setOffset(x, y) {
m_ox = x;
m_oy = y;
}
function getCardData() {
return(m_cardData);
}
function getPosX() {
return(m_px);
}
function getPosY() {
return(m_py);
}
function getCardId() {
return(m_cardData.getId());
}
function addCardListener(listener) {
m_listener.push(listener);
}
function placeInHand() {
_visible = true;
m_animator = new com.midasplayer.util.EaseOutQuadAnimator(m_animSlave);
m_animator.setPosition(m_ox + 70, m_oy);
m_animator.setDurationTicks(3);
m_animDelay = 0;
swapDepths(_parent.getNextHighestDepth());
m_glowClip.filters = [];
m_cardState = IN_TOMOVE_HAND;
}
function placeAsWild() {
_visible = true;
m_animator = new com.midasplayer.util.EaseOutQuadAnimator(m_animSlave);
m_animator.setPosition(m_ox - 100, m_oy);
m_animator.setDurationTicks(5);
m_animDelay = 0;
m_cardState = IN_TOMOVE_WILD;
}
function placeInLevel(ox, oy, cd, delay) {
_visible = true;
m_cardData = cd;
if (cd.isScarabe()) {
m_glowClip.filters = [new flash.filters.GlowFilter(6750207, 100, 15, 15, 5, 2, false, false)];
}
m_animator = new com.midasplayer.util.EaseOutQuadAnimator(m_animSlave);
m_animator.setPosition((ox + (cd.getPosX() * 25)) + 15, (oy + (cd.getPosY() * 40)) + 28);
m_animDelay = delay;
updateDepth();
m_cardState = IN_TOMOVE_LEVEL;
}
function placeAsDead() {
_visible = true;
if (m_flipAnim != 0) {
var _local2 = 0;
if (m_faceVisible) {
m_clip.gotoAndStop(m_frame);
} else {
m_clip.gotoAndStop(54);
}
if (m_flipAnim == 1) {
m_pxscale = (-m_scale) + ((2 * m_scale) * _local2);
for (var _local3 in m_listener) {
m_listener[_local3].onAnimationDone(this, 2);
}
m_flipAnim = 0;
}
if (m_flipAnim == 2) {
_local2 = 1 - _local2;
m_pxscale = (-m_scale) + ((2 * m_scale) * _local2);
for (var _local3 in m_listener) {
m_listener[_local3].onAnimationDone(this, 2);
}
m_flipAnim = 0;
}
}
if (m_animator != undefined) {
m_animator.complete();
m_animator = undefined;
if (m_cardState == IN_TOMOVE_LEVEL) {
m_cardState = IN_LEVEL;
m_beenInLevel = true;
}
if (m_cardState == IN_TOMOVE_HAND) {
m_cardState = IN_HAND;
}
if (m_cardState == IN_TOMOVE_WILD) {
m_cardState = IN_WILD;
}
m_px = m_animSlave._x;
m_py = m_animSlave._y;
}
flush();
m_cardState = IN_DEAD;
for (var _local3 in m_listener) {
m_listener[_local3].onAnimationDone(this, 1);
}
com.midasplayer.util.Delay.oneShot(this, hideCard, 500);
}
function hideCard() {
_visible = false;
}
function removeAfterRender() {
m_removeAfterRender = true;
}
function isRemoveAfterRender() {
return(m_removeAfterRender);
}
function updateDepth() {
var _local4 = m_cardData.getTotalNoLayers();
var _local2 = m_cardData.getCardLayer();
if (_local2 != 0) {
_local2 = _local2 + 1;
}
_local4 = _local4 + 1;
var _local5 = 1 - ((_local4 - _local2) / _local4);
var _local3 = 100 - Math.round(_local5 * 33);
m_animator.setDurationTicks(4 + (_local5 * 20));
var _local6 = {ra:_local3, rb:0, ga:_local3, gb:0, ba:_local3, bb:0, aa:100, ab:0};
m_currentColor = _local6;
m_color.setTransform(m_currentColor);
}
function setPosition(x, y) {
m_px = x;
m_py = y;
m_fx.__set__value(x);
m_fy.__set__value(y);
m_animSlave = {_x:x, _y:y};
}
function setVisible(v) {
_visible = v;
}
function setSuitAndType(suit, type) {
m_currentSuit = suit;
m_currentType = type;
if ((suit == SUIT_WILD) || (type == TYPE_WILD)) {
suit = SUIT_WILD;
type = TYPE_WILD;
m_frame = 53;
} else {
m_frame = (1 + (m_currentSuit * 13)) + m_currentType;
}
setFaceVisible(m_faceVisible);
}
function setFaceVisible(v, skipAnimation) {
if (skipAnimation == true) {
m_faceVisible = v;
_xscale = m_scale;
m_clip.gotoAndStop(m_frame);
return(undefined);
}
if (m_faceVisible == v) {
m_flipAnim = 0;
return(undefined);
}
if (v == false) {
m_flipAnimCompleteTime = -1;
m_flipAnim = 1;
}
if (v == true) {
m_flipAnimCompleteTime = -1;
m_flipAnim = 2;
}
m_faceVisible = v;
}
function beenInLevel() {
return(m_beenInLevel);
}
function getType() {
return(m_currentType);
}
function getSuit() {
return(m_currentSuit);
}
function getCardName() {
return(SUITLIST.charAt(m_currentSuit + 2) + TYPELIST[m_currentType + 2]);
}
function isWild() {
return((m_currentSuit == SUIT_WILD) && (m_currentType == TYPE_WILD));
}
function isFaceVisible() {
return(m_faceVisible);
}
function suitAsString() {
switch (m_currentSuit) {
case SUIT_WILD :
return("wild");
case SUIT_CLUB :
return("club");
case SUIT_DIAMOND :
return("diamond");
case SUIT_HEART :
return("heart");
case SUIT_SPADE :
return("spade");
}
return(("unknown(suit=" + m_currentSuit) + ")");
}
function typeAsString() {
switch (m_currentType) {
case TYPE_WILD :
return("wild");
case TYPE_ACE :
return("ace");
case TYPE_TWO :
return("two");
case TYPE_THREE :
return("three");
case TYPE_FOUR :
return("four");
case TYPE_FIVE :
return("five");
case TYPE_SIX :
return("six");
case TYPE_SEVEN :
return("seven");
case TYPE_EIGHT :
return("eight");
case TYPE_NINE :
return("nine");
case TYPE_TEN :
return("ten");
case TYPE_JACK :
return("jack");
case TYPE_QUEEN :
return("queen");
case TYPE_KING :
return("king");
}
return(("unknown(type=" + m_currentType) + ")");
}
function toString() {
return(((((((((("Card[p=" + m_px) + ",") + m_py) + ", id=") + getCardName()) + ", suit=") + suitAsString()) + ", type=") + typeAsString()) + "]");
}
static var IN_DECK = 0;
static var IN_HAND = 1;
static var IN_TOMOVE_HAND = 2;
static var IN_WILD = 3;
static var IN_TOMOVE_WILD = 4;
static var IN_LEVEL = 5;
static var IN_TOMOVE_LEVEL = 6;
static var IN_TOMOVE_DEAD = 7;
static var IN_DEAD = 8;
static var TYPE_UNKNOWN = -2;
static var TYPE_WILD = -1;
static var TYPE_TWO = 0;
static var TYPE_THREE = 1;
static var TYPE_FOUR = 2;
static var TYPE_FIVE = 3;
static var TYPE_SIX = 4;
static var TYPE_SEVEN = 5;
static var TYPE_EIGHT = 6;
static var TYPE_NINE = 7;
static var TYPE_TEN = 8;
static var TYPE_JACK = 9;
static var TYPE_QUEEN = 10;
static var TYPE_KING = 11;
static var TYPE_ACE = 12;
static var SUIT_UNKNOWN = -2;
static var SUIT_WILD = -1;
static var SUIT_CLUB = 0;
static var SUIT_SPADE = 1;
static var SUIT_HEART = 2;
static var SUIT_DIAMOND = 3;
static var MIN_CARDTYPE = TYPE_TWO;
static var MAX_CARDTYPE = TYPE_ACE;
static var MIN_CARDSUIT = SUIT_CLUB;
static var MAX_CARDSUIT = SUIT_DIAMOND;
var TYPELIST = ["?", "w", "2", "3", "4", "5", "6", "7", "8", "9", "10", "j", "q", "k", "a"];
var SUITLIST = "?wcshd";
}
Symbol 392 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;
var _local3 = value.length;
while (_local2 < _local3) {
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() {
value.sort();
}
function get iterator() {
return(new com.midasplayer.util.ArrayListIterator(this));
}
function get dump() {
var _local3 = "";
var _local2 = 0;
while (_local2 < value.length) {
_local3 = _local3 + (((_local2 + " : ") + value[_local2]) + newline);
_local2++;
}
return(_local3);
}
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 393 MovieClip [__Packages.com.midasplayer.util.ArrayListIterator] Frame 0
class com.midasplayer.util.ArrayListIterator implements com.midasplayer.util.Iterator
{
var ptr, list, sz;
function ArrayListIterator (list) {
ptr = 0;
this.list = list;
sz = list.size();
}
function next() {
var _local2;
if (ptr < sz) {
_local2 = list.get(ptr);
ptr++;
}
return(_local2);
}
function hasNext() {
return(ptr < sz);
}
function remove() {
if (ptr == 0) {
return(undefined);
}
list.removeByIndex(ptr - 1);
}
}
Symbol 394 MovieClip [__Packages.com.king.pyramiddeluxe.CardData] Frame 0
class com.king.pyramiddeluxe.CardData
{
var m_isUsed, m_layer, m_totalLayer, m_id, m_x, m_y, m_blocking, m_blockedBy, m_isScarabe, m_scarabeBkg, m_bkg;
function CardData (data) {
m_isUsed = false;
m_layer = -1;
m_totalLayer = -1;
var _local2 = data.split(";");
m_id = parseInt(_local2[0]);
var _local3 = _local2[1].split(",");
m_x = parseInt(_local3[0]);
m_y = parseInt(_local3[1]);
m_blocking = [];
m_blockedBy = [];
if (_local2[2].length > 0) {
m_blocking = _local2[2].split(",");
}
if (_local2[3].length > 0) {
m_blockedBy = _local2[3].split(",");
}
m_isScarabe = _local2[4] == 1;
}
function use() {
m_isUsed = true;
}
function isUsed() {
return(m_isUsed);
}
function setScarabeBack(clip) {
m_scarabeBkg = clip;
}
function getScarabeBack(clip) {
return(m_scarabeBkg);
}
function setBackground(clip) {
m_bkg = clip;
}
function getBackground() {
return(m_bkg);
}
function setTotalNoLayers(num) {
m_totalLayer = num;
}
function getTotalNoLayers() {
return(m_totalLayer);
}
function setCardLayer(no) {
m_layer = no;
}
function getCardLayer() {
return(m_layer);
}
function getPosX() {
return(m_x);
}
function getPosY() {
return(m_y);
}
function getId() {
return(m_id);
}
function getBlockedBy() {
return(m_blockedBy);
}
function getBlocking() {
return(m_blocking);
}
function notBlocking() {
m_blocking = [];
}
function notBlockedBy(id) {
var _local3 = false;
var _local2 = 0;
while ((_local3 == false) && (_local2 < m_blockedBy.length)) {
_local3 = m_blockedBy[_local2] == id;
_local2++;
}
if (_local3 == false) {
return(undefined);
}
var _local5 = new Array();
_local2 = 0;
while (_local2 < m_blockedBy.length) {
if (m_blockedBy[_local2] != id) {
_local5.push(m_blockedBy[_local2]);
}
_local2++;
}
m_blockedBy = _local5;
}
function isScarabe() {
return(m_isScarabe);
}
}
Symbol 395 MovieClip [__Packages.com.king.pyramiddeluxe.StateGame] Frame 0
class com.king.pyramiddeluxe.StateGame extends com.king.pyramiddeluxe.State implements com.king.pyramiddeluxe.CardListener
{
var m_reasonSign, m_cardsAll, m_level, m_backdrop, m_startTick, m_parent, m_isNoMoreMoves, m_waitLeaveLevel, m_isUserQuit, m_levelReady, m_levelStarted, m_fadeBorderZeroAt, m_currentCombo, m_longestRun, m_currentScarab, m_infoBox, m_data, m_lx, m_ly, m_lox, m_loy, m_isGameOver, m_levelOver, m_gameTicks, m_cardsMoving, m_lastScore, m_lastTopRun, m_lastTimeLeft, m_lastCardLeft, m_idToCard, m_deck, m_cardClicks, m_renderList, m_cardsDeck, m_cardsUpdateList, m_cardRemoveList, m_cardsRenderList, m_cardsLeft, m_cardsTop, m_cardsRight, m_cardsBottom, m_disengage, m_tick, m_cardHand, m_cardWild;
function StateGame (a1, a2, a3, a4, a5) {
super(a1, a2, a3, a4, a5);
}
function destroy() {
com.midasplayer.util.Delay.oneShot(this, delayedDestroy, 1500);
}
function delayedDestroy() {
m_reasonSign.removeMovieClip();
var _local2 = m_cardsAll.__get__iterator();
while (_local2.hasNext()) {
var _local6 = com.king.pyramiddeluxe.Card(_local2.next());
_local6.destroy();
}
var _local4 = m_level.getNumCardsInFormation();
while (_local4--) {
var _local8 = m_backdrop.getNextHighestDepth();
var _local3 = m_level.getCardData(_local4);
var _local7 = _local3.getBackground();
_local7.removeMovieClip();
var _local5 = _local3.getScarabeBack();
_local5._parent.removeMovieClip();
}
}
function engage() {
var _local27 = [451, m_startTick];
var _local24 = _local27.join(",") + ",0=0";
trace(" [playData: " + _local24);
fscommand ("playData", _local24);
if (m_parent.background == undefined) {
var _local22 = m_parent.attachMovie("background", "background", m_parent.getNextHighestDepth());
var _local28 = _local22.attachMovie("info_plate", "infobox", m_parent.getNextHighestDepth());
m_parent.cutscene.swapDepths(m_parent.getNextHighestDepth());
_local22._y = 10;
_local28._x = -17;
_local28._y = -12;
}
m_isNoMoreMoves = false;
m_waitLeaveLevel = false;
m_isUserQuit = false;
m_backdrop = m_parent.background;
m_levelReady = false;
m_levelStarted = false;
m_fadeBorderZeroAt = getTimer() + 200;
m_parent.cutscene.anim.playOnce(1);
m_currentCombo = 0;
m_longestRun = 0;
m_currentScarab = 1;
m_infoBox = m_backdrop.infobox.texts;
m_infoBox.round_num_txt.text = com.midasplayer.util.I18n.getString("game_level");
m_infoBox.score_txt.text = com.midasplayer.util.I18n.getString("game_round_score");
m_infoBox.top_run_txt.text = com.midasplayer.util.I18n.getString("game_top_run");
m_infoBox.time_txt.text = com.midasplayer.util.I18n.getString("game_time_left");
m_infoBox.round_num_value_txt.text = m_data.currentLevel + 1;
if ((m_data.currentLevel + 1) <= 5) {
var _local28 = m_data.currentLevel + 1;
var _local12 = m_backdrop.getNextHighestDepth();
var _local22 = m_backdrop.attachMovie("posters", "post" + _local12, _local12);
_local22._xscale = 52.5;
_local22._yscale = 52.5;
_local22._x = int(Math.random() * 30) + 90;
_local22._y = int(Math.random() * 10) + 222;
_local22._rotation = int(Math.random() * 50) - 25;
_local22.gotoAndStop(_local28);
}
m_backdrop.infobox.swapDepths(m_backdrop.getNextHighestDepth());
m_lx = -1;
m_ly = -1;
m_lox = -1;
m_loy = -1;
m_data.wildCardBonus = 0;
m_data.unusedCardBonus = 0;
m_data.topRunBonus = 0;
m_data.roundScore = 0;
m_data.roundScoreNoBonus = 0;
m_isGameOver = false;
m_levelOver = false;
m_gameTicks = 0;
m_cardsMoving = 0;
m_lastScore = "";
m_lastTopRun = "";
m_lastTimeLeft = "";
m_lastCardLeft = "";
m_idToCard = new com.midasplayer.util.Map();
m_level = com.king.pyramiddeluxe.Level.create(m_data.currentLevel);
m_deck = new com.king.pyramiddeluxe.Deck();
m_deck.shuffle(m_data.rng);
m_cardClicks = new Array();
m_cardsAll = new com.midasplayer.util.ArrayList();
m_renderList = new com.midasplayer.util.ArrayList();
m_cardsDeck = new com.midasplayer.util.ArrayList();
m_cardsUpdateList = new com.midasplayer.util.ArrayList();
m_cardRemoveList = new com.midasplayer.util.ArrayList();
m_cardsRenderList = new com.midasplayer.util.ArrayList();
var _local26 = m_level.getWidth();
var _local25 = m_level.getHeight();
var _local19 = 225 + ((500 - (_local26 * 25)) / 2);
_local19 = _local19 + int((Math.random() * 20) - 10);
var _local18 = 8 + ((320 - (_local25 * 40)) / 2);
_local18 = _local18 + int((Math.random() * 20) - 10);
m_cardsLeft = _local19;
m_cardsTop = _local18;
m_cardsRight = _local19 + (_local26 * 25);
m_cardsBottom = _local18 + (_local25 * 40);
var _local20 = new Object();
var _local4 = new Array();
var _local7 = m_level.getNumCardsInFormation();
while (_local7--) {
var _local12 = m_backdrop.getNextHighestDepth();
var _local15 = m_level.getCardData(_local7);
var _local11 = (("a" + _local15.getPosX()) + ":") + _local15.getPosY();
if (_local20[_local11] != null) {
_local4.push([_local15.getPosX(), _local15.getPosY()]);
} else {
_local20[_local11] = _local7;
}
}
_local7 = m_level.getNumCardsInFormation();
while (_local7--) {
var _local12 = m_backdrop.getNextHighestDepth();
var _local15 = m_level.getCardData(_local7);
var _local14 = _local15.getPosX();
var _local13 = _local15.getPosY();
var _local5 = false;
var _local6 = 0;
while (_local6 < _local4.length) {
var _local21 = _local4[_local6];
if ((_local21[0] == _local14) && (_local21[1] == _local13)) {
_local5 = true;
}
_local6++;
}
if (_local15.isScarabe()) {
var _local17 = (_local19 + (_local15.getPosX() * 25)) + 14;
var _local16 = (_local18 + (_local15.getPosY() * 40)) + 28;
_local12 = m_backdrop.getNextHighestDepth();
var _local8 = m_backdrop.attachMovie("scarabe_back", "cb" + _local12, _local12);
_local8._x = _local17;
_local8._y = _local16;
_local12 = m_backdrop.getNextHighestDepth();
var _local9 = m_backdrop.attachMovie("scarab_center_anim", "inner_card_back" + _local12, _local12);
_local9._x = _local17;
_local9._y = _local16;
_local15.setBackground(_local8);
_local15.setScarabeBack(_local9.inner);
} else if (!_local5) {
_local12 = m_backdrop.getNextHighestDepth();
var _local8 = m_backdrop.attachMovie("card_back", "cb" + _local12, _local12);
_local8._x = _local19 + (_local15.getPosX() * 25);
_local8._y = _local18 + (_local15.getPosY() * 40);
_local15.setBackground(_local8);
}
}
_local7 = 0;
while (_local7 < m_deck.getNrCard()) {
var _local10 = m_deck.getCard(_local7);
var _local12 = m_backdrop.getNextHighestDepth();
var _local2 = m_backdrop.attachMovie("card_collection2", "card" + _local12, _local12);
_local2.setPosition(DECK_X, DECK_Y);
_local2.setOffset(DECK_X, DECK_Y);
_local2.setSuitAndType(_local10.suit, _local10.type);
_local2.update();
_local2.render();
_local2.addCardListener(this);
_local2.setVisible(_local7 == 0);
m_cardsAll.insert(_local2);
m_cardsDeck.insert(_local2);
_local7++;
}
var _local21 = m_cardsAll.size() - 1;
var _local23 = _local21 - m_level.getNumCardsInFormation();
_local7 = _local21;
var _local6 = 0;
while (_local7 - _local23) {
var _local15 = m_level.getCardData((m_level.getNumCardsInFormation() - _local6) - 1);
var _local3 = com.king.pyramiddeluxe.Card(m_cardsAll.get(_local7));
m_idToCard.put(_local15.getId(), _local3);
_local3.placeInLevel(_local19, _local18, _local15, int(_local6 * 1.5));
readyForAnim(_local3);
m_cardsDeck.remove(_local3);
m_cardsMoving++;
_local7--;
_local6++;
}
com.midasplayer.fx.SoundManager.play("wind");
}
function disengage() {
return(m_disengage);
}
function returnCode() {
if (m_isGameOver || (m_data.ticksLeft <= 0)) {
return(1);
}
if (m_data.currentLevel == TOTAL_LEVELS) {
return(100);
}
return(0);
}
function tick(tick) {
m_tick = tick;
if (m_data.ticksLeft == 0) {
onGameOver();
}
if ((!m_levelOver) && (m_levelReady)) {
if (!m_levelStarted) {
m_levelStarted = true;
var _local7 = [1, m_tick, m_data.totalScore];
var _local6 = _local7.join(",") + ",0=0";
trace(" [playData: " + _local6);
fscommand ("playData", _local6);
}
m_data.ticksLeft = Math.max(0, --m_data.ticksLeft);
m_gameTicks++;
}
for (var _local5 in m_cardClicks) {
processClickCard(m_cardClicks[_local5]);
}
m_cardClicks = [];
var _local2 = m_cardsUpdateList.__get__iterator();
while (_local2.hasNext()) {
var _local3 = com.king.pyramiddeluxe.Card(_local2.next());
if (_local3.isRemovable()) {
_local2.remove();
} else {
_local3.update(tick);
}
}
if (m_waitLeaveLevel && (m_cardsRenderList.size() == 0)) {
m_data.currentLevel++;
m_disengage = true;
}
}
function readyForAnim(c) {
c.readyForAnim();
m_cardsUpdateList.insert(c);
m_cardsRenderList.insert(c);
}
function render(tick, alpha) {
var _local5 = int((m_data.millisPerTick * m_data.ticksLeft) / 1000);
if ((!m_isGameOver) && (_local5 <= 10)) {
if (getTimer() > m_nextPlayAt) {
com.midasplayer.fx.SoundManager.play("tick_tack");
m_nextPlayAt = getTimer() + 1000;
}
}
if (m_lastTimeLeft != _local5) {
m_infoBox.time_value_txt.text = com.midasplayer.util.Numbers.asTime(_local5 * 1000, false, true);
m_lastTimeLeft = "" + _local5;
}
_local5 = m_cardsDeck.size();
if (m_lastCardLeft != _local5) {
m_backdrop.card_txt.text = _local5;
m_lastCardLeft = "" + _local5;
}
if (m_lastTopRun != m_longestRun) {
m_infoBox.top_run_value_txt.text = m_longestRun;
m_lastTopRun = "" + m_longestRun;
}
if (m_lastScore != m_data.roundScoreNoBonus) {
m_infoBox.score_value_txt.text = m_data.roundScoreNoBonus;
m_lastScore = "" + m_data.roundScoreNoBonus;
}
if (m_fadeBorderZeroAt != -1) {
var _local7 = Math.max(0, m_fadeBorderZeroAt - getTimer()) / 200;
var _local6 = int(100 * _local7);
m_parent.border_left._alpha = _local6;
m_parent.border_right._alpha = _local6;
m_parent.border_top._alpha = _local6;
m_parent.border_bottom._alpha = _local6;
if (_local7 == 0) {
m_fadeBorderZeroAt = -1;
}
}
var _local3 = m_cardsRenderList.__get__iterator();
while (_local3.hasNext()) {
var _local2 = com.king.pyramiddeluxe.Card(_local3.next());
_local2.render();
if (_local2.isRemovable()) {
if (m_cardsUpdateList.indexOf(_local2) < 0) {
_local3.remove();
_local2.flush();
}
}
}
_local3 = m_renderList.__get__iterator();
while (_local3.hasNext()) {
var _local4 = _local3.next();
if (!_local4.render()) {
if (_local4.removeAfterComplete() == true) {
_local4.removeMovieClip();
}
_local3.remove();
}
}
}
function cardMovedToLevel(c) {
if ((--m_cardsMoving) == 0) {
var _local2 = 0;
while (_local2 < m_cardsAll.size()) {
var _local5 = com.king.pyramiddeluxe.Card(m_cardsAll.get(_local2));
if (_local5.getCardState() == com.king.pyramiddeluxe.Card.IN_LEVEL) {
var _local3 = _local5.getCardData();
if (_local3.isScarabe()) {
var _local8 = com.king.pyramiddeluxe.Scarabe(_local3.getScarabeBack());
_local8.setScarabeFrame(Math.min(6, m_data.currentLevel) + 1);
var _local7 = com.king.pyramiddeluxe.AnimDriver(_local3.getBackground());
_local7.playOnce();
}
}
_local2++;
}
var _local6 = com.king.pyramiddeluxe.Card(m_cardsDeck.get(m_cardsDeck.size() - 1));
_local6.placeInHand();
_local6.setFaceVisible(true);
m_cardsDeck.remove(_local6);
trace("auto card " + _local6.getCardName());
m_cardHand = _local6;
readyForAnim(_local6);
var _local12 = [564, m_tick, m_cardHand.getCardName()];
var _local10 = _local12.join(",") + ",0=0";
trace(" [playData: " + _local10);
fscommand ("playData", _local10);
var _local11 = m_backdrop.getNextHighestDepth();
var _local9 = com.king.pyramiddeluxe.Card(m_backdrop.attachMovie("card_collection2", "card" + _local11, _local11));
_local9.setPosition(DECK_X, DECK_Y);
_local9.setOffset(DECK_X, DECK_Y);
_local9.setSuitAndType(com.king.pyramiddeluxe.Card.SUIT_WILD, com.king.pyramiddeluxe.Card.TYPE_WILD);
_local9.update();
_local9.render();
_local9.addCardListener(this);
_local9.setVisible(true);
_local9.placeAsWild();
m_cardsAll.insert(_local9);
readyForAnim(_local9);
m_cardWild = _local9;
com.midasplayer.fx.SoundManager.play("card_click");
var _local4 = 0;
while (_local4 < m_cardsDeck.size()) {
_local6 = com.king.pyramiddeluxe.Card(m_cardsDeck.get(_local4));
_local6.setReadyForClick(true);
_local4++;
}
}
}
function onLeaveLevel() {
trace("onLeaveLevel():");
m_waitLeaveLevel = true;
}
function quitGame() {
var _local3 = [13, m_tick, m_data.totalScore];
var _local2 = (_local3.join(",") + ",0=") + m_data.roundScore;
trace(" [playData: " + _local2);
fscommand ("playData", _local2);
m_isUserQuit = true;
onGameOver();
}
function onLevelOver() {
if (m_levelOver) {
return(undefined);
}
m_levelOver = true;
var _local4 = 0;
var _local2 = 0;
while (_local2 < m_cardsAll.size()) {
var _local3 = com.king.pyramiddeluxe.Card(m_cardsAll.get(_local2));
var _local5 = _local3.getCardState();
if ((_local5 == com.king.pyramiddeluxe.Card.IN_LEVEL) || (_local5 == com.king.pyramiddeluxe.Card.IN_DECK)) {
_local4++;
}
_local2++;
}
m_data.wildCardBonus = ((m_cardWild != null) ? 2000 : 0);
m_data.unusedCardBonus = _local4 * 500;
m_data.topRunBonus = m_longestRun * 200;
m_data.roundScore = ((m_data.roundScoreNoBonus + m_data.unusedCardBonus) + m_data.wildCardBonus) + m_data.topRunBonus;
m_data.roundScore = int(Math.round(m_data.roundScore * m_data.roundMultiplier));
m_data.totalScore = m_data.totalScore + m_data.roundScore;
var _local6 = [2, m_tick, m_data.totalScore];
var _local5 = (_local6.join(",") + ",0=") + m_data.roundScore;
trace(" [playData: " + _local5);
fscommand ("playData", _local5);
m_data.roundMultiplier = m_data.roundMultiplier + 0.1;
com.midasplayer.util.Delay.oneShot(this, onLeaveLevel, 3000);
}
function onGameOver() {
if (m_levelOver) {
return(undefined);
}
m_isGameOver = true;
m_levelOver = true;
m_data.wildCardBonus = 0;
m_data.unusedCardBonus = 0;
m_data.topRunBonus = m_longestRun * 200;
m_data.roundScore = ((m_data.roundScoreNoBonus + m_data.unusedCardBonus) + m_data.wildCardBonus) + m_data.topRunBonus;
m_data.roundScore = int(Math.round(m_data.roundScore * m_data.roundMultiplier));
m_data.totalScore = m_data.totalScore + m_data.roundScore;
var _local3 = [17, m_tick, m_data.totalScore];
var _local2 = (_local3.join(",") + ",0=") + m_data.roundScore;
trace(" [playData: " + _local2);
fscommand ("playData", _local2);
if (m_isNoMoreMoves) {
com.midasplayer.fx.SoundManager.play("no_more_moves_snd");
var _local5 = m_cardsRight - m_cardsLeft;
var _local4 = m_cardsBottom - m_cardsTop;
m_reasonSign = m_parent.attachMovie("end_slab", "nmm", m_parent.getNextHighestDepth());
m_reasonSign._x = m_cardsLeft + ((_local5 - 224) / 2);
m_reasonSign._y = m_cardsTop + ((_local4 - 158) / 2);
m_reasonSign.msg.text = com.midasplayer.util.I18n.getString("no_more_moves");
m_reasonSign.gotoAndStop(1);
} else if (!m_isUserQuit) {
com.midasplayer.fx.SoundManager.play("no_more_moves_snd");
var _local5 = m_cardsRight - m_cardsLeft;
var _local4 = m_cardsBottom - m_cardsTop;
m_reasonSign = m_parent.attachMovie("end_slab", "nmm", m_parent.getNextHighestDepth());
m_reasonSign._x = m_cardsLeft + ((_local5 - 224) / 2);
m_reasonSign._y = m_cardsTop + ((_local4 - 158) / 2);
m_reasonSign.msg.text = com.midasplayer.util.I18n.getString("time_is_up");
m_reasonSign.gotoAndStop(2);
}
if (!m_disengage) {
com.midasplayer.util.Delay.oneShot(this, onLeaveLevel, 5000);
}
}
function onAnimationDone(c, animId) {
if (animId == 1) {
if (c.getCardState() == com.king.pyramiddeluxe.Card.IN_DEAD) {
c.removeWhenNoRender();
}
if (c.getCardState() == com.king.pyramiddeluxe.Card.IN_HAND) {
c.removeWhenNoRender();
}
if (c.getCardState() != com.king.pyramiddeluxe.Card.IN_HAND) {
c.setFaceVisible(true);
}
}
if (animId == 2) {
c.removeWhenNoRender();
c.setReadyForClick(true);
if (c.getCardState() == com.king.pyramiddeluxe.Card.IN_LEVEL) {
cardMovedToLevel(c);
}
if (c.isWild()) {
m_levelReady = true;
}
}
}
function onClickedCard(c) {
m_cardClicks.push(c);
}
function processClickCard(c) {
if ((!m_levelReady) || (m_levelOver)) {
return(undefined);
}
m_lox = c._xmouse;
m_loy = c._ymouse;
var _local9 = {x:m_lox, y:m_loy};
c.localToGlobal(_local9);
m_lx = _local9.x;
m_ly = _local9.y;
switch (c.getCardState()) {
case com.king.pyramiddeluxe.Card.IN_DECK :
case com.king.pyramiddeluxe.Card.IN_HAND :
var _local13 = [565, m_tick, m_cardHand.getCardName(), m_lox, m_loy, m_lx, m_ly];
var _local10 = _local13.join(",") + ",0=0";
trace(" [playData: " + _local10);
fscommand ("playData", _local10);
var _local11 = m_cardsDeck.size();
if (_local11 > 0) {
com.midasplayer.fx.SoundManager.play("card_click");
if (m_cardHand) {
m_cardHand.placeAsDead();
}
var _local7 = com.king.pyramiddeluxe.Card(m_cardsDeck.get(_local11 - 1));
_local7.placeInHand();
_local7.setFaceVisible(true);
m_cardsDeck.remove(_local7);
readyForAnim(_local7);
m_cardHand = _local7;
}
testLevelEndState();
m_currentCombo = 0;
break;
case com.king.pyramiddeluxe.Card.IN_WILD :
_local13 = [577, m_tick, m_lox, m_loy, m_lx, m_ly];
_local10 = _local13.join(",") + ",0=0";
trace(" [playData: " + _local10);
fscommand ("playData", _local10);
if (m_cardHand) {
m_cardHand.placeAsDead();
}
com.midasplayer.fx.SoundManager.play("wildcard");
m_cardWild.placeInHand();
readyForAnim(m_cardWild);
m_cardHand = m_cardWild;
m_cardWild = null;
break;
case com.king.pyramiddeluxe.Card.IN_LEVEL :
var _local5 = c.getCardData();
var _local12 = _local5.getBlockedBy();
if (_local12.length == 0) {
if (c.matches(m_cardHand)) {
if (m_cardHand) {
m_cardHand.placeAsDead();
}
m_cardsDeck.remove(c);
c.placeInHand();
readyForAnim(c);
_local5.use();
com.midasplayer.fx.SoundManager.play("card_click");
if (_local5.isScarabe()) {
var _local15 = com.king.pyramiddeluxe.Scarabe(_local5.getScarabeBack());
m_renderList.insert(_local15);
} else {
showComboCount(c.getPosX(), c.getPosY() - 40, m_currentCombo + 1);
_local13 = com.king.pyramiddeluxe.AnimDriver(_local5.getBackground());
_local13.playOnce();
}
var _local6 = _local5.getBlocking();
for (var _local8 in _local6) {
var _local3 = com.king.pyramiddeluxe.Card(m_idToCard.get(_local6[_local8]));
var _local2 = _local3.getCardData();
_local2.notBlockedBy(_local5.getId());
}
_local5.notBlocking();
m_level.recompDepth();
if (_local5.isScarabe()) {
com.midasplayer.fx.SoundManager.play("scarab_extra", 66);
var _local14 = "sfx_scarab_" + (m_data.currentLevel + 1);
com.midasplayer.util.Delay.oneShot(this, playSound, 500, _local14, 66);
modifyScore((m_currentScarab * 500) + 1000, c);
m_currentScarab++;
} else {
modifyScore((m_currentCombo * 50) + 100, c);
}
m_longestRun = Math.max(m_longestRun, ++m_currentCombo);
m_cardHand = c;
testLevelEndState();
break;
}
}
modifyScore(-25, c);
break;
default :
trace(((("ignored click: Card " + c.toString()) + " [") + c.getCardState()) + "]");
}
}
function playSound(name, vol) {
com.midasplayer.fx.SoundManager.play(name, vol);
}
function showComboCount(px, py, count) {
var _local3 = m_backdrop.getNextHighestDepth();
var _local2 = m_backdrop.attachMovie("current_run", "count" + _local3, _local3);
_local2.setValue(count);
_local2.setPosition(px, py);
m_renderList.insert(_local2);
}
function modifyScore(amount, byCard) {
if (amount > 0) {
m_data.roundScoreNoBonus = m_data.roundScoreNoBonus + amount;
} else {
m_data.roundScoreNoBonus = Math.max(0, m_data.roundScoreNoBonus + amount);
}
var _local5 = byCard.getCardName();
var _local4 = [5, m_tick, _local5, m_lox, m_loy, m_lx, m_ly];
var _local2 = (_local4.join(",") + ",0=") + amount;
trace(" [playData: " + _local2);
fscommand ("playData", _local2);
}
function testLevelEndState() {
var _local5 = 0;
var _local4 = false;
var _local3 = 0;
while (_local3 < m_cardsAll.size()) {
var _local2 = com.king.pyramiddeluxe.Card(m_cardsAll.get(_local3));
if (_local2.getCardData().isScarabe()) {
if (_local2.getCardState() == com.king.pyramiddeluxe.Card.IN_LEVEL) {
_local5++;
}
}
if (_local2.getCardState() == com.king.pyramiddeluxe.Card.IN_LEVEL) {
if (_local2.getCardData().getBlockedBy().length == 0) {
_local4 = _local4 || (m_cardHand.matches(_local2));
}
_local2.updateDepth();
}
_local3++;
}
if (_local5 == 0) {
onLevelOver();
return(true);
}
if (((!_local4) && (m_cardsDeck.size() == 0)) && (m_cardWild == null)) {
m_isNoMoreMoves = true;
onGameOver();
return(true);
}
return(false);
}
var DECK_X = 485;
var DECK_Y = 370;
var TOTAL_LEVELS = 10;
var m_nextPlayAt = -1;
}
Symbol 396 MovieClip [__Packages.com.king.pyramiddeluxe.Level] Frame 0
class com.king.pyramiddeluxe.Level
{
var m_data, m_cardData, m_numLayers, m_cardDataMap;
function Level (data) {
m_data = data;
m_cardData = new Array();
var _local5 = 0;
while (_local5 < m_data.length) {
m_cardData.push(new com.king.pyramiddeluxe.CardData(m_data[_local5]));
_local5++;
}
m_numLayers = -1;
m_cardDataMap = {};
_local5 = 0;
while (_local5 < m_cardData.length) {
var _local6 = m_cardData[_local5];
_local6.setCardLayer(1);
_local6.setTotalNoLayers(1);
m_cardDataMap["a" + _local6.getId()] = _local6;
_local5++;
}
_local5 = 0;
while (_local5 < m_cardData.length) {
var _local6 = m_cardData[_local5];
var _local3 = _local6.getBlockedBy();
if (_local3.length == 0) {
_local6.setCardLayer(0);
} else {
var _local2 = 0;
while (_local2 < _local3.length) {
var _local4 = m_cardDataMap["a" + _local3[_local2]].getCardLayer();
_local6.setCardLayer(_local4 + 1);
_local2++;
}
}
_local5++;
}
_local5 = 0;
while (_local5 < m_cardData.length) {
var _local6 = m_cardData[_local5];
m_numLayers = Math.max(m_numLayers, _local6.getCardLayer());
_local5++;
}
_local5 = 0;
while (_local5 < m_cardData.length) {
var _local6 = m_cardData[_local5];
_local6.setTotalNoLayers(m_numLayers);
_local5++;
}
}
function recompDepth() {
var _local4 = 100;
var _local2 = 0;
while (_local2 < m_cardData.length) {
var _local3 = m_cardData[_local2];
if (!_local3.isUsed()) {
_local4 = Math.min(_local3.getCardLayer(), _local4);
}
_local2++;
}
if (_local4 > 0) {
_local2 = 0;
while (_local2 < m_cardData.length) {
var _local3 = m_cardData[_local2];
if (!_local3.isUsed()) {
_local3.setCardLayer(_local3.getCardLayer() - _local4);
}
_local2++;
}
}
_local2 = 0;
while (_local2 < m_cardData.length) {
var _local3 = m_cardData[_local2];
var _local5 = _local3.getBlockedBy();
if (_local5.length == 0) {
_local3.setCardLayer(0);
}
_local2++;
}
}
function getNumLayers() {
return(m_numLayers);
}
function getNumCardsInFormation() {
return(m_data.length);
}
function getWidth() {
var _local4 = 1000;
var _local3 = 0;
for (var _local5 in m_cardData) {
var _local2 = m_cardData[_local5].getPosX();
if (_local2 < _local4) {
_local4 = _local2;
}
if (_local2 > _local3) {
_local3 = _local2;
}
}
return(1 + (_local3 - _local4));
}
function getHeight() {
var _local4 = 1000;
var _local3 = 0;
for (var _local5 in m_cardData) {
var _local2 = m_cardData[_local5].getPosY();
if (_local2 < _local4) {
_local4 = _local2;
}
if (_local2 > _local3) {
_local3 = _local2;
}
}
return(1 + (_local3 - _local4));
}
function getCardData(idx) {
return(com.king.pyramiddeluxe.CardData(m_cardData[idx]));
}
function getCardDataByCardIndex(idx) {
return(com.king.pyramiddeluxe.CardData(m_cardDataMap["a" + idx]));
}
static function create(levelNo) {
if ((levelNo < LEVEL.length) && (levelNo > -1)) {
return(new com.king.pyramiddeluxe.Level(LEVEL[levelNo]));
}
return(null);
}
static var LEVEL = [["22;3,4;16,17;;0", "21;1,4;17,18;;0", "20;9,4;13,14;;0", "19;11,4;12,13;;0", "18;0,3;11;21;0", "17;2,3;10,11;22,21;0", "16;4,3;9,10;22;0", "15;6,3;8,9;;0", "14;8,3;7,8;20;0", "13;10,3;6,7;20,19;0", "12;12,3;6;19;0", "11;1,2;3;18,17;0", "10;3,2;2,3;17,16;0", "9;5,2;2;16,15;0", "8;7,2;4;15,14;0", "7;9,2;4,5;14,13;0", "6;11,2;5;13,12;0", "5;10,1;1;7,6;0", "4;8,1;1;8,7;0", "3;2,1;0;11,10;0", "2;4,1;0;10,9;0", "1;9,0;;5,4;1", "0;3,0;;3,2;1"], ["24;7,3;10,11,17;;0", "23;9,3;10,15,16;;0", "22;11,3;14,15,16;;0", "21;1,3;6,13,18;;0", "20;3,3;12,13,18;;0", "19;5,3;11,12,17;;0", "18;2,4;;21,20;0", "17;6,4;;24,19;0", "16;10,4;;23,22;0", "15;10,2;7,8;23,22;0", "14;12,2;7;22;0", "13;2,2;4,5;21,20;0", "12;4,2;3,4;20,19;0", "11;6,2;3,9;24,19;0", "10;8,2;8,9;24,23;0", "9;7,1;2;11,10;0", "8;9,1;1;15,10;0", "7;11,1;1;15,14;0", "6;0,2;5;21;0", "5;1,1;0;13,6;0", "4;3,1;0;13,12;0", "3;5,1;2;12,11;0", "2;6,0;;9,3;1", "1;10,0;;8,7;1", "0;2,0;;5,4;1"], ["27;14,3;16,17;;0", "26;16,3;15,16;;0", "25;18,3;15;;0", "24;0,3;11;;0", "23;2,3;10,11;;0", "22;4,3;9,10;;0", "21;6,3;9,14;;0", "20;8,3;13,14;;0", "19;10,3;12,13;;0", "18;12,3;12,17;;0", "17;13,2;8;27,18;0", "16;15,2;7,8;27,26;0", "15;17,2;7;26,25;0", "14;7,2;5;21,20;0", "13;9,2;5,6;20,19;0", "12;11,2;6;19,18;0", "11;1,2;4;24,23;0", "10;3,2;3,4;23,22;0", "9;5,2;3;22,21;0", "8;14,1;1;17,16;0", "7;16,1;1;16,15;0", "6;10,1;2;13,12;0", "5;8,1;2;14,13;0", "4;2,1;0;11,10;0", "3;4,1;0;10,9;0", "2;9,0;;6,5;1", "1;15,0;;8,7;1", "0;3,0;;4,3;1"], ["33;0,4;23;;0", "32;2,4;22,23,25;;0", "31;4,4;21,22,25;;0", "30;6,4;20,21;;0", "29;8,4;19,20;;0", "28;10,4;18,19,24;;0", "27;12,4;17,18,24;;0", "26;14,4;17;;0", "25;3,5;;32,31;0", "24;11,5;;28,27;0", "23;1,3;4;33,32;0", "22;3,3;3,4;32,31;0", "21;5,3;3;31,30;0", "20;7,3;5;30,29;0", "19;9,3;7;29,28;0", "18;11,3;6,7;28,27;0", "17;13,3;6;27,26;0", "16;6,0;2;;0", "15;8,0;2;;0", "7;10,2;1;19,18;0", "6;12,2;1;18,17;0", "5;7,2;2;20;0", "4;2,2;0;23,22;0", "3;4,2;0;22,21;0", "2;7,1;;16,15,5;1", "1;11,1;;7,6;1", "0;3,1;;4,3;1"], ["28;0,2;9,19;;0", "27;2,2;9,11,18,19;;0", "26;4,2;10,11,17,18;;0", "25;6,2;8,10,16,17;;0", "24;8,2;7,8,15,16;;0", "23;10,2;6,7,14,15;;0", "22;12,2;5,6,13,14;;0", "21;14,2;4,5,12,13;;0", "20;16,2;4,12;;0", "19;1,3;;28,27;0", "18;3,3;1;27,26;0", "17;5,3;1;26,25;0", "16;7,3;;25,24;0", "15;9,3;;24,23;0", "14;11,3;0;23,22;0", "13;13,3;0;22,21;0", "12;15,3;;21,20;0", "11;3,1;3;27,26;0", "10;5,1;3;26,25;0", "9;1,1;;28,27;0", "8;7,1;;25,24;0", "7;9,1;;24,23;0", "6;11,1;2;23,22;0", "5;13,1;2;22,21;0", "4;15,1;;21,20;0", "3;4,0;;11,10;1", "2;12,0;;6,5;1", "1;4,4;;18,17;1", "0;12,4;;14,13;1"], ["28;2,4;14,20;;0", "27;4,4;19,20;;0", "26;6,4;18,19;;0", "25;8,4;17,18;;0", "24;10,4;16,17;;0", "23;12,4;15,16;;0", "22;14,4;15,21;;0", "21;15,3;5,6;22;0", "20;3,3;12,13;28,27;0", "19;5,3;11,12;27,26;0", "18;7,3;10,11;26,25;0", "17;9,3;9,10;25,24;0", "16;11,3;7,9;24,23;0", "15;13,3;6,7;23,22;0", "14;1,3;8,13;28;0", "13;2,2;4;20,14;0", "12;4,2;;20,19;0", "11;6,2;2;19,18;0", "10;8,2;1,2;18,17;0", "9;10,2;1;17,16;0", "8;0,2;4;14;0", "7;12,2;;16,15;0", "6;14,2;3;21,15;0", "5;16,2;3;21;0", "4;1,1;;13,8;1", "3;15,1;;6,5;1", "2;7,1;0;11,10;0", "1;9,1;0;10,9;0", "0;8,0;;2,1;1"], ["26;12,2;17,20;;0", "25;16,2;18,19;;0", "24;6,2;15,16;;0", "23;10,2;13,14;;0", "22;0,2;10,12;;0", "21;4,2;9,11;;0", "20;13,1;0,4;26;0", "19;15,1;0,4;25;0", "18;15,3;0,3;25;0", "17;13,3;0,3;26;0", "16;7,1;1,6;24;0", "15;7,3;1,5;24;0", "14;9,1;1,6;23;0", "13;9,3;1,5;23;0", "12;1,1;2,8;22;0", "11;3,1;2,8;21;0", "10;1,3;2,7;22;0", "9;3,3;2,7;21;0", "8;2,0;;12,11;0", "7;2,4;;10,9;0", "6;8,0;;16,14;0", "5;8,4;;15,13;0", "4;14,0;;20,19;0", "3;14,4;;18,17;0", "2;2,2;;12,11,10,9;1", "1;8,2;;16,15,14,13;1", "0;14,2;;20,19,18,17;1"], ["27;8,6;15;;0", "26;10,6;14,15;;0", "25;12,6;13,14;;0", "24;14,6;13;;0", "23;0,6;10;;0", "22;2,6;8,10;;0", "21;4,6;8,9;;0", "20;6,6;9;;0", "19;3,0;11,12;;0", "18;11,0;16,17;;0", "17;10,1;7;18;0", "16;12,1;7;18;0", "15;9,5;6;27,26;0", "14;11,5;5,6;26,25;0", "13;13,5;5;25,24;0", "12;2,1;4;19;0", "11;4,1;4;19;0", "10;1,5;3;23,22;0", "9;5,5;2;21,20;0", "8;3,5;2,3;22,21;0", "7;11,2;0;17,16;0", "6;10,4;0;15,14;0", "5;12,4;0;14,13;0", "4;3,2;1;12,11;0", "3;2,4;1;10,8;0", "2;4,4;1;9,8;0", "1;3,3;;4,3,2;1", "0;11,3;;7,6,5;1"], ["29;1,3;4,5,6,26,27;;0", "28;9,3;3,9,10,24,25;;0", "27;0,2;4;29;0", "26;0,4;4;29;0", "25;10,4;3;28;0", "24;10,2;3;28;0", "23;5,3;13,16,19,20,21,22;;0", "22;4,2;8,16,17;23;0", "21;6,2;7,15,16;23;0", "20;4,4;12,13,14;23;0", "19;6,4;11,13,18;23;0", "18;7,4;9,11;19;0", "17;3,2;6,8;22;0", "16;5,2;7,8;23,22,21;0", "15;7,2;7,10;21;0", "14;3,4;5,12;20;0", "13;5,4;11,12;23,20,19;0", "12;4,5;1;20,14,13;0", "11;6,5;1;19,18,13;0", "10;8,2;3;28,15;0", "9;8,4;3;28,18;0", "8;4,1;2;22,17,16;0", "7;6,1;2;21,16,15;0", "6;2,2;4;29,17;0", "5;2,4;4;29,14;0", "4;1,3;;29,27,26,6,5;1", "3;9,3;;28,25,24,10,9;1", "2;5,0;;8,7;1", "1;5,6;;12,11;1"], ["33;7,0;15,16;;0", "32;9,0;14,15;;0", "31;3,6;22,23;;0", "30;5,6;21,22;;0", "29;7,6;20,21;;0", "28;9,6;19,20;;0", "27;3,0;17,18;;0", "26;5,0;16,17;;0", "23;2,5;5;31;0", "22;4,5;6;31,30;0", "21;6,5;6,7;30,29;0", "20;8,5;7;29,28;0", "19;10,5;10;28;0", "18;2,1;4;27;0", "17;4,1;9;27,26;0", "16;6,1;8,9;33,26;0", "15;8,1;8;33,32;0", "14;10,1;11;32;0", "13;2,3;4,5;;0", "12;10,3;10,11;;0", "11;11,2;1;14,12;0", "10;11,4;1;19,12;0", "9;5,2;3;17,16;0", "8;7,2;3;16,15;0", "7;7,4;3;21,20;0", "6;5,4;3;22,21;0", "5;1,4;2;23,13;0", "4;1,2;2;18,13;0", "3;6,3;;9,8,7,6;1", "2;0,3;;5,4;1", "1;12,3;;11,10;1"]];
}
Symbol 397 MovieClip [__Packages.com.king.pyramiddeluxe.Deck] Frame 0
class com.king.pyramiddeluxe.Deck
{
var m_availableCards;
function Deck () {
m_availableCards = new com.midasplayer.util.ArrayList();
var _local4 = com.king.pyramiddeluxe.Card.MIN_CARDSUIT;
while (_local4 <= com.king.pyramiddeluxe.Card.MAX_CARDSUIT) {
var _local3 = com.king.pyramiddeluxe.Card.MIN_CARDTYPE;
while (_local3 <= com.king.pyramiddeluxe.Card.MAX_CARDTYPE) {
var _local2 = new Object();
_local2.suit = _local4;
_local2.type = _local3;
m_availableCards.insert(_local2);
_local3++;
}
_local4++;
}
}
function shuffle(rng) {
var _local3 = new com.midasplayer.util.ArrayList();
while (m_availableCards.size() > 0) {
var _local2 = Object(m_availableCards.removeByIndex(rng.nextInt(m_availableCards.size())));
_local3.insert(_local2);
}
m_availableCards = _local3;
}
function getNrCard() {
return(m_availableCards.size());
}
function getCard(idx) {
return(m_availableCards.get(idx));
}
}
Symbol 398 MovieClip [__Packages.com.midasplayer.util.Numbers] Frame 0
class com.midasplayer.util.Numbers
{
function Numbers () {
}
static function dec2hex(iValue, padding) {
var _local1 = "";
while (iValue != 0) {
_local1 = "0123456789abcdef".charAt(iValue & 15) + _local1;
iValue = iValue >>> 4;
}
if (padding) {
if (_local1.length == 0) {
_local1 = "00";
}
if (_local1.length < 2) {
_local1 = "0" + _local1;
}
} else if (_local1.length == 0) {
_local1 = "0";
}
return(_local1);
}
static function itoa(value, numZeroPadding) {
var _local2 = "" + value;
if (numZeroPadding) {
var _local1 = numZeroPadding - 1;
while (_local1 > 0) {
if (value < Math.pow(10, _local1)) {
_local2 = "0" + _local2;
}
_local1--;
}
}
return(_local2);
}
static function asTime(millis, alwaysHours, alwaysMinutes) {
if (alwaysHours) {
alwaysMinutes = true;
}
if (millis < 0) {
millis = 0;
}
millis = millis / 1000;
millis = Math.floor(millis);
var _local3 = Math.floor(millis / 3600);
var _local4 = Math.floor(millis / 60) % 60;
var _local5 = millis % 60;
var _local1 = "";
if (alwaysHours || (_local3 > 0)) {
_local1 = _local1 + itoa(_local3, 2);
}
if (alwaysHours || (_local1.length > 0)) {
_local1 = _local1 + ":";
}
var _local6 = _local1.length;
if ((alwaysMinutes || (_local4 > 0)) || (_local3 > 0)) {
_local1 = _local1 + itoa(_local4, 2);
}
if (alwaysMinutes || (_local1.length != _local6)) {
_local1 = _local1 + ":";
}
return(_local1 + itoa(_local5, 2));
}
}
Symbol 399 MovieClip [__Packages.com.king.pyramiddeluxe.Scarabe] Frame 0
class com.king.pyramiddeluxe.Scarabe extends MovieClip
{
var m_firstRender, stop, _visible, scarabeFrame, m_startTime, _totalframes, gotoAndStop;
function Scarabe () {
super();
m_firstRender = true;
stop();
_visible = false;
}
function setScarabeFrame(num) {
scarabeFrame = num;
_visible = true;
}
function removeAfterComplete() {
return(false);
}
function render() {
if (m_firstRender) {
m_startTime = getTimer();
m_firstRender = false;
}
var _local4 = 33.3333333333333;
var _local2 = int((getTimer() - m_startTime) / _local4) + 1;
var _local3 = _totalframes;
if (_local2 >= _local3) {
return(false);
}
gotoAndStop(_local2);
return(true);
}
}
Symbol 400 MovieClip [__Packages.com.king.pyramiddeluxe.StateGameOver] Frame 0
class com.king.pyramiddeluxe.StateGameOver extends com.king.pyramiddeluxe.State
{
var m_mayQuitAhead, m_lastTick, m_clicked, m_quitTime, m_parent, m_ending, m_data, m_startTick, m_fadeBorderFullAt, m_fadeInBegin;
function StateGameOver (a1, a2, a3, a4, a5) {
super(a1, a2, a3, a4, a5);
}
function onMouseUp() {
if (m_lastTick >= m_mayQuitAhead) {
if (!m_clicked) {
m_quitTime = m_lastTick + 2;
m_clicked = true;
}
} else {
var _local2 = (m_mayQuitAhead - m_lastTick) + 2;
trace(("cool it, will quit in " + _local2) + " ticks...");
m_quitTime = m_lastTick + _local2;
m_clicked = true;
}
}
function engage() {
var _local2 = 0;
m_clicked = false;
m_parent.border_left._alpha = _local2;
m_parent.border_left.swapDepths(m_parent.getNextHighestDepth());
m_parent.border_right._alpha = _local2;
m_parent.border_right.swapDepths(m_parent.getNextHighestDepth());
m_parent.border_top._alpha = _local2;
m_parent.border_top.swapDepths(m_parent.getNextHighestDepth());
m_parent.border_bottom._alpha = _local2;
m_parent.border_bottom.swapDepths(m_parent.getNextHighestDepth());
var _local5 = m_parent.cutscene.anim.anim2;
m_ending = m_parent.attachMovie("animated_ending", "ending", m_parent.getNextHighestDepth());
m_ending._x = 2;
m_ending._y = 2;
com.midasplayer.fx.SoundManager.stopAll();
com.midasplayer.fx.SoundManager.play("pyramid_end");
var _local3 = m_data.millisPerTick * m_data.ticksLeft;
m_ending.labels.round_score_txt.text = com.midasplayer.util.I18n.getString("cut_round_score");
m_ending.labels.top_run_bonus_txt.text = com.midasplayer.util.I18n.getString("cut_top_run_bonus");
m_ending.labels.wildcard_bonus_txt.text = com.midasplayer.util.I18n.getString("cut_wildcard_bonus");
m_ending.labels.unused_card_bonus_txt.text = com.midasplayer.util.I18n.getString("cut_unused_card_bonus");
m_ending.labels.total_score_txt.text = com.midasplayer.util.I18n.getString("cut_total_score");
m_ending.labels.timeleft_txt.text = com.midasplayer.util.I18n.getString("cut_time_left");
m_ending.numbers.timeleft_value_txt.text = com.midasplayer.util.Numbers.asTime(_local3, false, true);
m_ending.numbers.round_score_value_txt.text = m_data.roundScoreNoBonus;
m_ending.numbers.top_run_bonus_value_txt.text = m_data.topRunBonus;
m_ending.numbers.wildcard_bonus_value_txt.text = m_data.wildCardBonus;
m_ending.numbers.unused_card_bonus_value_txt.text = m_data.unusedCardBonus;
m_ending.numbers.total_round_score_value_txt.text = m_data.roundScore;
m_ending.numbers.total_score_value_txt.text = m_data.totalScore;
var _local4 = 1 + (Math.max(0, m_data.currentLevel - 1) * 0.1);
m_ending.labels.total_round_score_txt.text = com.midasplayer.util.I18n.getString("cut_round_score_mult", _local4);
fscommand ("gameEnd", "" + m_data.totalScore);
trace(("fscommand(\"gameEnd\", \"" + m_data.totalScore) + "\")");
m_ending.onPress = mx.utils.Delegate.create(this, onMouseUp);
m_ending.useHandCursor = true;
m_quitTime = m_startTick + 375;
m_mayQuitAhead = m_startTick + 75;
m_fadeBorderFullAt = -1;
m_fadeInBegin = false;
m_parent.btn_quit.removeMovieClip();
m_parent.btn_sound.removeMovieClip();
}
function disengage() {
return(false);
}
function returnCode() {
return(0);
}
function tick(tick) {
m_lastTick = tick;
if (tick == m_quitTime) {
trace("fscommand(\"gameQuit\")");
fscommand ("gameQuit");
}
}
function render(tick, alpha) {
}
}
Symbol 401 MovieClip [__Packages.com.king.pyramiddeluxe.StateCutscene] Frame 0
class com.king.pyramiddeluxe.StateCutscene extends com.king.pyramiddeluxe.State
{
var m_soundEvt, m_playList, m_pyramidMap, m_leaveTick, m_lastTick, m_bkg, m_parent, m_travelAnim, m_poster, m_posterAnimator, m_appearing, m_leaveAt, m_data, m_pyramidFadedAt, m_emoAnim, m_minLeaveTick, m_mapFadedAt, m_mapAppearAt, m_pyramidAppearAt, m_playPyramidPathAnimTick, m_startTick, m_renderList, m_mapNumbers, m_fadeBorderFullAt, m_fadeBorderZeroAt, m_beginAnimations, m_travelAnimStarted, m_volumeDecreaser, m_beginFadeBorderFullTick, m_disengage, m_mapFader, m_pyramidAnim;
function StateCutscene (a1, a2, a3, a4, a5) {
super(a1, a2, a3, a4, a5);
m_soundEvt = [[[0, "loop", "train_loop", 100], [135, "decvol", "train_loop", 2], [190, "stop", "train_loop"]], [[0, "once", "travel_tune", 50], [0, "loop", "plane_loop", 100], [133, "decvol", "plane_loop", 2], [190, "stop", "plane_loop"]], [[0, "once", "travel_tune", 50], [5, "once", "ship_horn", 70], [150, "once", "ship_horn", 60]], [[0, "once", "travel_tune", 50], [10, "once", "ship_horn", 70], [125, "once", "ship_horn", 60]], [[0, "once", "travel_tune", 50], [0, "loop", "plane_loop", 100], [140, "decvol", "plane_loop", 2], [197, "stop", "plane_loop"]], [[0, "once", "travel_tune", 50]], [[0, "once", "travel_tune", 50]], [[0, "once", "travel_tune", 50]], [[0, "once", "travel_tune", 50]], [[0, "once", "travel_tune", 50]], [[0, "once", "travel_tune", 50]]];
m_playList = [];
m_pyramidMap = null;
}
function quitGame() {
m_leaveTick = m_lastTick + 2;
}
function destroy() {
m_pyramidMap.pyramid_anim.pyramid_blink.playStop();
m_bkg = m_parent.cutscene.anim.anim2;
m_bkg.maskedbkg.setMask(null);
m_bkg.emo_clip._x = 0;
m_bkg.emo_clip._y = -60;
m_bkg.emo_clip._visible = false;
if (m_travelAnim) {
m_travelAnim.forceCompleted();
m_travelAnim.__set__frozen(true);
}
m_parent.cutscene.onPress = undefined;
m_parent.cutscene.useHandCursor = false;
m_poster.removeMovieClip();
for (var _local3 in m_playList) {
var _local2 = m_playList[_local3][0];
trace("exit: stopping " + _local2);
com.midasplayer.fx.SoundManager.stop(_local2);
}
}
function beginLeave() {
trace("beginLeave()");
m_travelAnim.__set__frozen(false);
m_travelAnim.forceCompleted();
m_travelAnim.__set__frozen(true);
m_posterAnimator = new com.midasplayer.util.EaseInQuadAnimator(m_poster);
m_posterAnimator.setDuration(750);
m_posterAnimator.setPosition(573, 237);
m_posterAnimator.setPosition(573, 307);
m_appearing = false;
m_leaveAt = getTimer() + 900;
if ((m_data.currentLevel + 1) > 5) {
m_pyramidFadedAt = getTimer() + 400;
} else {
m_emoAnim = new com.midasplayer.util.EaseOutQuadAnimator(m_bkg.emo_clip);
m_emoAnim.setDuration(500);
m_emoAnim.setPosition(0, -60);
}
}
function onMouseUp() {
if ((m_leaveAt == -1) && (m_lastTick > m_minLeaveTick)) {
beginLeave();
}
}
function engage() {
m_mapFadedAt = -1;
m_mapAppearAt = -1;
m_pyramidFadedAt = -1;
m_pyramidAppearAt = -1;
m_playPyramidPathAnimTick = -1;
m_leaveAt = -1;
m_leaveTick = m_startTick + 250;
m_minLeaveTick = m_startTick;
m_bkg = m_parent.cutscene.anim.anim2;
m_renderList = new com.midasplayer.util.ArrayList();
var _local5 = 0;
m_parent.border_left._alpha = _local5;
m_parent.border_left.swapDepths(m_parent.getNextHighestDepth());
m_parent.border_right._alpha = _local5;
m_parent.border_right.swapDepths(m_parent.getNextHighestDepth());
m_parent.border_top._alpha = _local5;
m_parent.border_top.swapDepths(m_parent.getNextHighestDepth());
m_parent.border_bottom._alpha = _local5;
m_parent.border_bottom.swapDepths(m_parent.getNextHighestDepth());
m_parent.cutscene.swapDepths(m_parent.getNextHighestDepth());
m_parent.btn_quit.swapDepths(m_parent.getNextHighestDepth());
m_parent.btn_sound.swapDepths(m_parent.getNextHighestDepth());
var _local2 = m_data.currentLevel + 1;
var _local6 = m_data.millisPerTick * m_data.ticksLeft;
if (m_bkg.emo_clip == null) {
var _local4 = m_bkg.attachMovie("emo_message", "emo_clip", m_bkg.getNextHighestDepth());
_local4.blendMode = "screen";
_local4.cacheAsBitmap = true;
_local4._x = 0;
_local4._y = -60;
}
m_bkg.maskedbkg.setMask(m_bkg.animmask);
var _local7 = 1 + (Math.max(0, m_data.currentLevel - 1) * 0.1);
if (_local2 <= 5) {
trace("------------------------------ poster " + _local2);
m_bkg.emo_clip.emo.text = com.midasplayer.util.I18n.getString("emo_copy_level_" + _local2);
var _local3 = m_bkg["anim_" + _local2];
m_travelAnim = com.king.pyramiddeluxe.AnimDriver(_local3);
if (_local3.object) {
_local3.object.setFxParent(m_bkg, m_bkg.maskedbkg);
if (_local2 == 3) {
_local3.object.setAlignment(150, 133);
}
if (_local2 == 4) {
_local3.object.setAlignment(170, 215);
}
}
m_travelAnim.__set__frozen(true);
m_travelAnim._visible = true;
} else {
m_mapNumbers = m_bkg.map_nrs;
if (m_bkg.emo_clip) {
m_bkg.emo_clip.removeMovieClip();
}
if (m_mapNumbers == null) {
m_mapNumbers = m_bkg.attachMovie("map_numbers", "map_nrs", m_bkg.getNextHighestDepth());
m_mapNumbers._alpha = 0;
}
m_mapNumbers.labels.round_score_txt.text = com.midasplayer.util.I18n.getString("cut_round_score");
m_mapNumbers.labels.top_run_bonus_txt.text = com.midasplayer.util.I18n.getString("cut_top_run_bonus");
m_mapNumbers.labels.wildcard_bonus_txt.text = com.midasplayer.util.I18n.getString("cut_wildcard_bonus");
m_mapNumbers.labels.unused_card_bonus_txt.text = com.midasplayer.util.I18n.getString("cut_unused_card_bonus");
m_mapNumbers.labels.total_score_txt.text = com.midasplayer.util.I18n.getString("cut_total_score");
m_mapNumbers.labels.timeleft_txt.text = com.midasplayer.util.I18n.getString("cut_time_left");
m_mapNumbers.labels.total_round_score_txt.text = com.midasplayer.util.I18n.getString("cut_round_score_mult", _local7);
m_mapNumbers.numbers.timeleft_value_txt.text = com.midasplayer.util.Numbers.asTime(_local6, false, true);
m_mapNumbers.numbers.round_score_value_txt.text = m_data.roundScoreNoBonus;
m_mapNumbers.numbers.top_run_bonus_value_txt.text = m_data.topRunBonus;
m_mapNumbers.numbers.wildcard_bonus_value_txt.text = m_data.wildCardBonus;
m_mapNumbers.numbers.unused_card_bonus_value_txt.text = m_data.unusedCardBonus;
m_mapNumbers.numbers.total_round_score_value_txt.text = m_data.roundScore;
m_mapNumbers.numbers.total_score_value_txt.text = m_data.totalScore;
}
if (m_data.currentLevel != m_data.startFrom) {
if (m_bkg.intro_text) {
m_bkg.intro_text.removeMovieClip();
}
m_bkg.numbers.timeleft_value_txt.text = com.midasplayer.util.Numbers.asTime(_local6, false, true);
m_bkg.numbers.round_score_value_txt.text = m_data.roundScoreNoBonus;
m_bkg.numbers.top_run_bonus_value_txt.text = m_data.topRunBonus;
m_bkg.numbers.wildcard_bonus_value_txt.text = m_data.wildCardBonus;
m_bkg.numbers.unused_card_bonus_value_txt.text = m_data.unusedCardBonus;
m_bkg.numbers.total_round_score_value_txt.text = m_data.roundScore;
m_bkg.numbers.total_score_value_txt.text = m_data.totalScore;
m_bkg.labels.total_round_score_txt.text = com.midasplayer.util.I18n.getString("cut_round_score_mult", _local7);
m_bkg.labels.round_score_txt.text = com.midasplayer.util.I18n.getString("cut_round_score");
m_bkg.labels.wildcard_bonus_txt.text = com.midasplayer.util.I18n.getString("cut_wildcard_bonus");
m_bkg.labels.unused_card_bonus_txt.text = com.midasplayer.util.I18n.getString("cut_unused_card_bonus");
m_bkg.labels.total_score_txt.text = com.midasplayer.util.I18n.getString("cut_total_score");
m_bkg.labels.timeleft_txt.text = com.midasplayer.util.I18n.getString("cut_time_left");
m_bkg.labels.top_run_bonus_txt.text = com.midasplayer.util.I18n.getString("cut_top_run_bonus");
m_parent.cutscene.anim.playOnce(-1, 36);
} else {
m_playList.push(["pyramid_intro", 100]);
}
m_minLeaveTick = m_startTick + 20;
m_fadeBorderFullAt = -1;
m_fadeBorderZeroAt = -1;
m_beginAnimations = false;
m_playPyramidPathAnimTick = -1;
m_parent.cutscene._visible = true;
m_travelAnimStarted = false;
m_volumeDecreaser = [];
m_beginFadeBorderFullTick = m_startTick + 25;
m_parent.cutscene.onPress = mx.utils.Delegate.create(this, onMouseUp);
m_parent.cutscene.useHandCursor = true;
}
function disengage() {
return(m_disengage);
}
function returnCode() {
return(-1);
}
function tick(tick) {
var _local6 = m_soundEvt[m_data.currentLevel];
var _local8 = tick - m_startTick;
if (m_beginFadeBorderFullTick == tick) {
m_fadeBorderFullAt = getTimer() + 300;
}
for (var _local10 in _local6) {
var _local2 = _local6[_local10];
if (_local8 == _local2[0]) {
switch (_local2[1]) {
case "loop" :
trace((("play loop " + _local2[2]) + " at volume ") + _local2[3]);
com.midasplayer.fx.SoundManager.play(_local2[2], _local2[3], true);
m_playList.push([_local2[2], _local2[3]]);
break;
case "once" :
trace("play once " + _local2[2]);
com.midasplayer.fx.SoundManager.play(_local2[2], _local2[3]);
m_playList.push([_local2[2], _local2[3]]);
break;
case "stop" :
trace("stop " + _local2[2]);
com.midasplayer.fx.SoundManager.stop(_local2[2]);
for (var _local7 in m_playList) {
if (m_playList[_local7][0] == _local2[2]) {
delete m_playList[_local7];
m_playList[_local7] = null;
break;
}
}
break;
case "decvol" :
var _local3 = 100;
for (var _local7 in m_playList) {
if (m_playList[_local7][0] == _local2[2]) {
_local3 = m_playList[_local7][1];
}
}
trace((((("decrease volume by " + _local2[3]) + " for ") + _local2[2]) + " starting from ") + _local3);
m_volumeDecreaser.push([_local2[2], _local2[3], _local3]);
}
}
}
if (((m_travelAnim != null) && (m_travelAnimStarted)) && (!m_travelAnim.isRunning())) {
trace(("travel animation stop at +" + _local8) + " ticks");
m_travelAnim = null;
}
if ((!m_beginAnimations) && (!m_parent.cutscene.anim.isRunning())) {
var _local13 = m_data.currentLevel + 1;
if (_local13 > 5) {
m_mapFader = m_bkg.fader;
if (m_mapFader == null) {
m_mapFader = m_bkg.attachMovie("map_fader", "fader", m_bkg.getNextHighestDepth());
m_mapFader._x = -2;
m_mapFader._y = -2;
m_mapFader._alpha = 0;
m_mapFadedAt = getTimer() + 250;
} else {
m_pyramidAppearAt = getTimer() - 100;
}
m_pyramidMap = m_bkg.pyramid;
if (m_pyramidMap == null) {
m_pyramidMap = m_bkg.attachMovie("pyramid_combine", "pyramid", m_bkg.getNextHighestDepth());
m_pyramidMap._x = 80;
m_pyramidMap._y = 0;
m_pyramidMap._alpha = 0;
m_mapNumbers.swapDepths(m_bkg.getNextHighestDepth());
}
m_bkg.emo_clip.swapDepths(m_bkg.getNextHighestDepth());
trace("------------------------------ pyramid frame=" + ((_local13 - 6) + 1));
} else {
var _local14 = 1 + (Math.max(0, m_data.currentLevel - 1) * 0.1);
var _local9 = m_bkg.getNextHighestDepth();
m_poster = m_bkg.attachMovie("posters", "poster" + _local9, _local9);
m_poster._x = 573;
m_poster._y = 237;
m_poster._y = 307;
var _local12 = Math.min(6, m_data.currentLevel + 1);
if (_local12 == 6) {
_local12++;
}
m_poster.gotoAndStop(_local12);
m_posterAnimator = new com.midasplayer.util.EaseOutQuadAnimator(m_poster);
m_posterAnimator.setDuration(1500);
m_posterAnimator.setPosition(573, 307);
}
m_bkg.emo_clip._visible = true;
m_emoAnim = new com.midasplayer.util.EaseInQuadAnimator(m_bkg.emo_clip);
m_emoAnim.setDuration(800);
m_emoAnim.setPosition(0, 0);
m_beginAnimations = true;
m_appearing = true;
}
if ((m_leaveAt == -1) && (tick == m_leaveTick)) {
beginLeave();
}
if (m_leaveAt != -1) {
var _local9 = Math.max(0, m_leaveAt - getTimer()) / 900;
if (getTimer() >= m_leaveAt) {
m_disengage = true;
} else {
for (var _local10 in m_playList) {
var _local5 = m_playList[_local10][0];
var _local4 = m_playList[_local10][1];
com.midasplayer.fx.SoundManager.setVolume(_local5, int(_local9 * _local4));
}
}
}
if (tick == m_playPyramidPathAnimTick) {
m_pyramidAnim.playSection((m_data.currentLevel + 1) - 6);
m_renderList.insert(m_pyramidAnim);
m_playPyramidPathAnimTick = -1;
trace("pyramid started");
}
m_lastTick = tick;
}
function render(tick, alpha) {
if (m_emoAnim != null) {
if (m_emoAnim.update()) {
m_emoAnim = undefined;
}
}
if (m_mapFadedAt != -1) {
var _local8 = 1 - (Math.max(0, m_mapFadedAt - getTimer()) / 250);
var _local6 = int(100 * _local8);
m_mapFader._alpha = _local6;
m_mapNumbers._alpha = _local6;
if (_local8 == 1) {
m_mapFadedAt = -1;
m_pyramidAppearAt = getTimer() + 400;
}
}
if (m_pyramidAppearAt != -1) {
var _local8 = 1 - (Math.max(0, m_pyramidAppearAt - getTimer()) / 250);
var _local6 = int(100 * _local8);
m_pyramidMap._alpha = _local6;
if (_local8 == 1) {
m_pyramidAnim = com.king.pyramiddeluxe.Pyramid(m_pyramidMap.pyramid_anim);
m_pyramidMap.pyramid_anim.pyramid_blink.playStart(14);
m_pyramidAppearAt = -1;
m_playPyramidPathAnimTick = tick + 25;
}
}
if (m_leaveAt == -1) {
for (var _local7 in m_volumeDecreaser) {
var _local2 = m_volumeDecreaser[_local7];
if (_local2[2] > 0) {
_local2[2] = _local2[2] - _local2[1];
if (_local2[2] < 0) {
_local2[2] = 0;
}
}
for (var _local5 in m_playList) {
if (m_playList[_local5][0] == _local2[0]) {
m_playList[_local5][1] = _local2[2];
}
}
trace((("dec volume " + _local2[0]) + " to ") + _local2[2]);
com.midasplayer.fx.SoundManager.setVolume(_local2[0], _local2[2]);
if (_local2[2] == 0) {
for (var _local5 in m_playList) {
if (m_playList[_local5][0] == _local2[0]) {
trace("volume reach zero, stop " + _local2[0]);
com.midasplayer.fx.SoundManager.stop(_local2[0]);
delete m_playList[_local5];
delete m_volumeDecreaser[_local7];
}
}
}
}
}
if (m_fadeBorderFullAt != -1) {
var _local8 = Math.max(0, m_fadeBorderFullAt - getTimer()) / 300;
var _local6 = int(100 * (1 - _local8));
m_parent.border_left._alpha = _local6;
m_parent.border_right._alpha = _local6;
m_parent.border_top._alpha = _local6;
m_parent.border_bottom._alpha = _local6;
if (_local8 == 0) {
m_fadeBorderFullAt = -1;
}
}
if (m_posterAnimator && (m_posterAnimator.update())) {
m_posterAnimator = undefined;
if (m_appearing && (m_data.currentLevel < 5)) {
m_travelAnim.__set__frozen(false);
m_travelAnim.swapDepths(m_bkg.getNextHighestDepth());
m_travelAnim.playOnce();
m_travelAnimStarted = true;
} else if (!m_appearing) {
m_poster.removeMovieClip();
}
} else if (m_appearing) {
m_poster._alpha = (1 - m_posterAnimator.getElapsed()) * 100;
} else {
m_poster._alpha = m_posterAnimator.getElapsed() * 100;
}
var _local3 = m_renderList.__get__iterator();
while (_local3.hasNext()) {
var _local4 = _local3.next();
if (!_local4.render()) {
if (_local4.removeAfterComplete() == true) {
_local4.removeMovieClip();
}
_local3.remove();
}
}
}
}
Symbol 402 MovieClip [__Packages.com.king.pyramiddeluxe.Pyramid] Frame 0
class com.king.pyramiddeluxe.Pyramid extends MovieClip
{
var m_stopped, m_firstRender, stop, m_playFrom, m_startTime, gotoAndStop;
function Pyramid () {
super();
m_stopped = true;
m_firstRender = true;
stop();
}
function playSection(num) {
trace("playSection=" + num);
m_playFrom = num * 50;
m_firstRender = true;
m_stopped = false;
}
function removeAfterComplete() {
return(false);
}
function render() {
if (m_stopped) {
return(false);
}
if (m_firstRender) {
m_startTime = getTimer();
m_firstRender = false;
}
var _local5 = 40;
var _local2 = int((getTimer() - m_startTime) / _local5) + 1;
var _local4 = 50;
if (_local2 >= _local4) {
return(false);
}
var _local3 = _local2 + m_playFrom;
trace("pyramid frame=" + _local3);
gotoAndStop(_local3);
return(true);
}
}
Symbol 403 MovieClip [__Packages.com.midasplayer.util.EaseInQuadAnimator] Frame 0
class com.midasplayer.util.EaseInQuadAnimator extends com.midasplayer.util.Animator
{
var dt, duration, x, startX, dx, y, startY, dy, fillBaseCopy;
function EaseInQuadAnimator (o) {
super(o);
}
function nextPosition() {
var _local2 = dt * dt;
var _local3 = duration * duration;
x = ((dx * _local2) / _local3) + startX;
y = ((dy * _local2) / _local3) + startY;
}
function makeCopy(t) {
var _local2 = new com.midasplayer.util.EaseInQuadAnimator();
fillBaseCopy(t, _local2);
return(_local2);
}
}
Symbol 404 MovieClip [__Packages.com.king.pyramiddeluxe.StateComplete] Frame 0
class com.king.pyramiddeluxe.StateComplete extends com.king.pyramiddeluxe.State
{
var m_clicked, m_parent, m_ending, m_data, m_fadeInBegin, m_fadeBorderFullAt, m_quitTime, m_startTick, m_removeScoreAt, m_startAnimationAt, m_playWoschAt, m_lastTick;
function StateComplete (a1, a2, a3, a4, a5) {
super(a1, a2, a3, a4, a5);
}
function engage() {
var _local2 = 0;
m_clicked = false;
m_parent.border_left._alpha = _local2;
m_parent.border_left.swapDepths(m_parent.getNextHighestDepth());
m_parent.border_right._alpha = _local2;
m_parent.border_right.swapDepths(m_parent.getNextHighestDepth());
m_parent.border_top._alpha = _local2;
m_parent.border_top.swapDepths(m_parent.getNextHighestDepth());
m_parent.border_bottom._alpha = _local2;
m_parent.border_bottom.swapDepths(m_parent.getNextHighestDepth());
m_parent.cutscene.swapDepths(m_parent.getNextHighestDepth());
m_parent.btn_quit.swapDepths(m_parent.getNextHighestDepth());
m_parent.btn_sound.swapDepths(m_parent.getNextHighestDepth());
m_parent.btn_quit.removeMovieClip();
m_parent.btn_sound.removeMovieClip();
var _local5 = m_parent.cutscene.anim.anim2;
m_ending = m_parent.attachMovie("animated_ending", "ending", m_parent.getNextHighestDepth());
m_ending._x = 2;
m_ending._y = 2;
var _local4 = 1 + (Math.max(0, m_data.currentLevel - 1) * 0.1);
var _local3 = m_data.millisPerTick * m_data.ticksLeft;
m_ending.labels.round_score_txt.text = com.midasplayer.util.I18n.getString("cut_round_score");
m_ending.labels.top_run_bonus_txt.text = com.midasplayer.util.I18n.getString("cut_top_run_bonus");
m_ending.labels.wildcard_bonus_txt.text = com.midasplayer.util.I18n.getString("cut_wildcard_bonus");
m_ending.labels.unused_card_bonus_txt.text = com.midasplayer.util.I18n.getString("cut_unused_card_bonus");
m_ending.labels.total_score_txt.text = com.midasplayer.util.I18n.getString("cut_total_score");
m_ending.labels.timeleft_txt.text = com.midasplayer.util.I18n.getString("cut_time_left");
m_ending.labels.total_round_score_txt.text = com.midasplayer.util.I18n.getString("cut_round_score_mult", _local4);
m_ending.numbers.timeleft_value_txt.text = com.midasplayer.util.Numbers.asTime(_local3, false, true);
m_ending.numbers.round_score_value_txt.text = m_data.roundScoreNoBonus;
m_ending.numbers.top_run_bonus_value_txt.text = m_data.topRunBonus;
m_ending.numbers.wildcard_bonus_value_txt.text = m_data.wildCardBonus;
m_ending.numbers.unused_card_bonus_value_txt.text = m_data.unusedCardBonus;
m_ending.numbers.total_round_score_value_txt.text = m_data.roundScore;
m_ending.numbers.total_score_value_txt.text = m_data.totalScore;
m_ending.inner.bottom_line_1.text = com.midasplayer.util.I18n.getString("bottom_line_1");
m_ending.inner.bottom_line_2.text = com.midasplayer.util.I18n.getString("bottom_line_2");
fscommand ("gameEnd", "" + m_data.totalScore);
trace(("fscommand(\"gameEnd\", \"" + m_data.totalScore) + "\")");
m_fadeInBegin = true;
m_fadeBorderFullAt = getTimer() + 500;
m_quitTime = m_startTick + 600;
m_removeScoreAt = m_startTick + 200;
m_startAnimationAt = m_startTick + 150;
m_fadeBorderFullAt = getTimer() + 500;
m_playWoschAt = -1;
}
function disengage() {
return(false);
}
function returnCode() {
return(0);
}
function tick(tick) {
m_lastTick = tick;
if (tick == m_startAnimationAt) {
com.midasplayer.fx.SoundManager.play("completed");
m_ending.inner.playOnce();
m_playWoschAt = getTimer() + 2700;
}
if (tick == m_removeScoreAt) {
m_ending.labels._visible = false;
m_ending.numbers._visible = false;
}
if (tick == m_quitTime) {
trace("fscommand(\"gameQuit\")");
fscommand ("gameQuit");
}
}
function render(tick, alpha) {
if (m_playWoschAt != -1) {
if (getTimer() >= m_playWoschAt) {
com.midasplayer.fx.SoundManager.play("wosch");
m_playWoschAt = -1;
}
}
if (m_fadeBorderFullAt != -1) {
var _local3 = Math.max(0, m_fadeBorderFullAt - getTimer()) / 500;
var _local2 = int(100 * (1 - _local3));
m_parent.border_left._alpha = _local2;
m_parent.border_right._alpha = _local2;
m_parent.border_top._alpha = _local2;
m_parent.border_bottom._alpha = _local2;
if (_local3 == 0) {
m_fadeBorderFullAt = -1;
}
}
}
}
Symbol 405 MovieClip [__Packages.com.king.pyramiddeluxe.StateEnd] Frame 0
class com.king.pyramiddeluxe.StateEnd extends com.king.pyramiddeluxe.State
{
function StateEnd (a1, a2, a3, a4, a5) {
super(a1, a2, a3, a4, a5);
}
function engage() {
}
function disengage() {
return(false);
}
function returnCode() {
return(0);
}
function tick(tick) {
}
function render(tick, alpha) {
}
}
Symbol 406 MovieClip [__Packages.com.king.pyramiddeluxe.AnimDriver30Fps] Frame 0
class com.king.pyramiddeluxe.AnimDriver30Fps extends com.king.pyramiddeluxe.AnimDriver
{
function AnimDriver30Fps () {
super(30);
}
}
Symbol 407 MovieClip [__Packages.com.king.pyramiddeluxe.BoatAnim] Frame 0
class com.king.pyramiddeluxe.BoatAnim extends MovieClip
{
var m_parent, m_parentNoMask, _x, _y;
function BoatAnim () {
super();
}
function setFxParent(unmaskedBkg, maskedBkg) {
m_parent = maskedBkg;
m_parentNoMask = unmaskedBkg;
}
function setAlignment(x, y) {
m_ax = x;
m_ay = y;
}
function onEnterFrame() {
m_ox = m_x;
m_oy = m_y;
m_x = _x;
m_y = _y;
for (var _local15 in m_puffParticle) {
var _local7 = m_puffParticle[_local15];
var _local2 = _local7.clip;
_local7.age++;
if (_local7.age > 150) {
_local2.removeMovieClip();
delete m_puffParticle[_local15];
} else {
var _local8 = (150 - _local7.age) / 150;
var _local16 = 25 + ((1 - _local8) * 200);
_local2._x = _local7.ox;
_local2._y = _local7.oy;
_local2._xscale = _local16;
_local2._yscale = _local16;
_local2._alpha = (_local8 * 50) + 10;
_local7.ox = _local7.ox + 0.05;
_local7.oy = _local7.oy + 0.05;
}
}
for (var _local15 in m_particle) {
var _local8 = m_particle[_local15];
_local8.age++;
if (_local8.age == 150) {
m_particle[_local15].clip.removeMovieClip();
delete m_particle[_local15];
} else {
var _local4 = (150 - _local8.age) / 150;
var _local3 = 1 + _local4;
var _local6 = (((Math.cos(_local8.ro) * 0.25) * _local3) * _local8.age) + _local8.ox;
var _local5 = (((Math.sin(_local8.ro) * 0.25) * _local3) * _local8.age) + _local8.oy;
_local8.clip._x = _local6;
_local8.clip._y = _local5;
_local8.clip._alpha = (_local3 - 1) * 100;
_local8.clip.gotoAndStop(int((1 - _local4) * 51) + 1);
}
}
var _local13 = m_ox - m_x;
var _local12 = m_oy - m_y;
if ((_local13 == 0) && (_local12 == 0)) {
return(undefined);
}
var _local16 = Math.sqrt((_local13 * _local13) + (_local12 * _local12));
var _local14 = Math.atan2(_local12, _local13) * 57.2957795130823;
m_r = m_r + 0.01;
var _local11 = getTimer();
if (_local11 > m_puffDelay) {
var _local9 = {x:_x + m_ax, y:_y + m_ay};
var _local10 = m_parentNoMask.getNextHighestDepth();
var _local8 = m_parentNoMask.attachMovie("puffclip", "p" + _local10, _local10);
_local8._x = _local9.x;
_local8._y = _local9.y;
_local8._alpha = 25;
_local8._xscale = 25;
_local8._yscale = 25;
var _local7 = new Object();
_local7.clip = _local8;
_local7.age = 0;
_local7.ox = _local9.x;
_local7.oy = _local9.y;
m_puffParticle.push(_local7);
m_puffDelay = _local11 + 750;
}
if (_local11 > m_particleDelay) {
var _local9 = {x:_x + m_ax, y:_y + m_ay};
var _local10 = m_parent.getNextHighestDepth();
var _local8 = m_parent.attachMovie("wave", "w" + _local10, _local10);
_local8._x = _local9.x;
_local8._y = _local9.y;
_local8._rotation = _local14 + 135;
var _local7 = new Object();
_local7.ro = (_local14 + 135) * (Math.PI/180);
_local7.clip = _local8;
_local7.age = 0;
_local7.ox = _local9.x;
_local7.oy = _local9.y;
m_particle.push(_local7);
_local10 = m_parent.getNextHighestDepth();
_local8 = m_parent.attachMovie("wave", "w" + _local10, _local10);
_local8._x = _local9.x;
_local8._y = _local9.y;
_local8._rotation = _local14 - 135;
_local7 = new Object();
_local7.clip = _local8;
_local7.age = 0;
_local7.ro = (_local14 - 135) * (Math.PI/180);
_local7.ox = _local9.x;
_local7.oy = _local9.y;
m_particle.push(_local7);
m_particleDelay = _local11 + 600;
}
}
var m_r = 0;
var m_ox = 0;
var m_oy = 0;
var m_x = 0;
var m_y = 0;
var m_ax = 0;
var m_ay = 0;
var m_particle = [];
var m_particleDelay = 1;
var m_px = 0;
var m_py = 0;
var m_puffDelay = 0;
var m_puffParticle = [];
}
Symbol 408 MovieClip [__Packages.com.king.pyramiddeluxe.ComboCounter] Frame 0
class com.king.pyramiddeluxe.ComboCounter extends MovieClip
{
var m_firstRender, m_width, m_digits, digits, m_digit1, m_digit2, stop, _x, _y, m_startTime, _totalframes, gotoAndStop;
function ComboCounter () {
super();
m_firstRender = true;
m_width = 18;
m_digits = digits;
m_digit1 = m_digits.digit_1;
m_digit2 = m_digits.digit_2;
stop();
}
function setValue(num) {
var _local2 = int(num / 10);
if (_local2 == 0) {
m_width = m_width + 9;
m_digit1._visible = false;
} else {
m_digit1.gotoAndStop(_local2 + 1);
}
m_digit2.gotoAndStop((num % 10) + 1);
}
function removeAfterComplete() {
return(true);
}
function setPosition(x, y) {
_x = (1 + x) - (m_width / 2);
_y = y + 29;
}
function render() {
if (m_firstRender) {
m_startTime = getTimer();
m_firstRender = false;
}
var _local4 = 33.3333;
var _local2 = int((getTimer() - m_startTime) / _local4) + 1;
var _local3 = _totalframes;
if (_local2 >= _local3) {
return(false);
}
gotoAndStop(_local2);
return(true);
}
}