STORY   LOOP   FURRY   PORN   GAMES
• C •   SERVICES [?] [R] RND   POPULAR
Archived flashes:
228086
/disc/ · /res/     /show/ · /fap/ · /gg/ · /swf/P0001 · P2561 · P5121

<div style="position:absolute;top:-99px;left:-99px;"><img src="http://swfchan.com:57475/11932354?noj=FRM11932354-2DC" width="1" height="1"></div>

Ring Pass Not.swf

This is the info page for
Flash #9579

(Click the ID number above for more basic data on this flash file.)


ActionScript [AS1/AS2]
Combined Code
movieClip 103 dragon_fire_good_mc { frame 2 { _root.playSound('Dragon'); } frame 57 { stop(); _root.raiseGameWonSign(); } } movieClip 176 dragon_fire_bad_mc { frame 2 { _root.playSound('Dragon'); } frame 57 { stop(); _root.raiseGameOverSign(); } } movieClip 179 { } movieClip 186 { } movieClip 192 { } movieClip 198 stella_terra_synergy_mc { frame 116 { stop(); } } movieClip 204 { } movieClip 206 stella_sol_synergy_mc { frame 116 { stop(); } } movieClip 212 sol_terra_synergy_mc { frame 116 { stop(); } } movieClip 221 { } movieClip 223 luna_terra_synergy_mc { frame 116 { stop(); } } movieClip 230 luna_sol_synergy_mc { frame 116 { stop(); } } movieClip 236 stella_luna_synergy_mc { frame 116 { stop(); } } movieClip 243 { } movieClip 245 sol_yellow_synergy_mc { frame 116 { stop(); } } movieClip 252 { } movieClip 254 terra_red_synergy_mc { frame 116 { stop(); } } movieClip 260 terra_yellow_synergy_mc { frame 116 { stop(); } } movieClip 267 { } movieClip 269 terra_green_synergy_mc { frame 116 { stop(); } } movieClip 276 { } movieClip 278 terra_blue_synergy_mc { frame 116 { stop(); } } movieClip 284 stella_yellow_synergy_mc { frame 116 { stop(); } } movieClip 290 stella_red_synergy_mc { frame 116 { stop(); } } movieClip 304 stella_green_synergy_mc { frame 116 { stop(); } } movieClip 311 stella_blue_synergy_mc { frame 116 { stop(); } } movieClip 319 sol_red_synergy_mc { frame 116 { stop(); } } movieClip 325 sol_blue_synergy_mc { frame 116 { stop(); } } movieClip 331 sol_green_synergy_mc { frame 116 { stop(); } } movieClip 337 luna_yellow_synergy_mc { frame 116 { stop(); } } movieClip 343 { } movieClip 345 yellow_red_synergy_mc { frame 116 { stop(); } } movieClip 351 { } movieClip 353 yellow_blue_synergy_mc { frame 116 { stop(); } } movieClip 359 { } movieClip 361 yellow_green_synergy_mc { frame 116 { stop(); } } movieClip 367 luna_green_synergy_mc { frame 116 { stop(); } } movieClip 373 luna_red_synergy_mc { frame 116 { stop(); } } movieClip 379 green_red_synergy_mc { frame 116 { stop(); } } movieClip 385 green_blue_synergy_mc { frame 116 { stop(); } } movieClip 390 { } movieClip 392 blue_red_synergy_mc { frame 116 { stop(); } } movieClip 398 luna_blue_synergy_mc { frame 116 { stop(); } } movieClip 401 yellow_transform_mo_mc { } movieClip 405 { frame 20 { stop(); } } movieClip 409 { frame 20 { stop(); } } movieClip 416 { frame 20 { stop(); } } movieClip 417 yellow_transform_mc { frame 40 { stop(); _root.mainExtras.addNext(); } } movieClip 421 { frame 20 { stop(); } } movieClip 425 { frame 20 { stop(); } } movieClip 430 { frame 20 { stop(); } } movieClip 431 green_transform_mc { frame 40 { stop(); _root.mainExtras.addNext(); } } movieClip 435 { frame 20 { stop(); } } movieClip 439 { frame 20 { stop(); } } movieClip 444 { frame 20 { stop(); } } movieClip 445 red_transform_mc { frame 40 { stop(); _root.mainExtras.addNext(); } } movieClip 449 { frame 20 { stop(); } } movieClip 453 { frame 20 { stop(); } } movieClip 454 blue_transform_mc { frame 40 { stop(); _root.mainExtras.addNext(); } } movieClip 462 { frame 40 { stop(); } } movieClip 468 { frame 40 { stop(); } } movieClip 469 blue_bomb_mc { frame 40 { stop(); _root.mainExtras.addNext(); } } movieClip 473 { frame 40 { stop(); } } movieClip 479 { frame 40 { stop(); } } movieClip 480 red_bomb_mc { frame 40 { stop(); _root.mainExtras.addNext(); } } movieClip 485 { frame 20 { stop(); } } movieClip 489 { frame 20 { stop(); } } movieClip 490 { } movieClip 491 d2_extradeal { frame 40 { stop(); _root.mainExtras.addNext(); } } movieClip 496 { frame 20 { stop(); } } movieClip 500 { frame 20 { stop(); } } movieClip 501 d3_extradeal { frame 40 { stop(); _root.mainExtras.addNext(); } } movieClip 506 { frame 20 { stop(); } } movieClip 510 { frame 20 { stop(); } } movieClip 511 d4_extradeal { frame 40 { stop(); _root.mainExtras.addNext(); } } movieClip 514 red_mc { frame 1 { stop(); } } movieClip 517 yellow_mc { frame 1 { stop(); } } movieClip 520 green_mc { frame 1 { stop(); } } movieClip 523 blue_mc { frame 1 { stop(); } } movieClip 526 mouse_mc { } movieClip 527 menu_mc { } movieClip 528 deal_mc { } movieClip 531 stella_constraint { } movieClip 534 shape_constraint { } movieClip 537 color_constraint { } movieClip 540 luna_constraint { } movieClip 543 blue_constraint { } movieClip 546 green_constraint { } movieClip 549 sol_constraint { } movieClip 552 red_constraint { } movieClip 555 terra_constraint { } movieClip 558 yellow_constraint { } movieClip 560 entry_start_mc { } movieClip 562 joker_mo_mc { } movieClip 565 red_bomb_mo_mc { } movieClip 568 blue_bomb_mo_mc { } movieClip 571 switch_mo_mc { } movieClip 574 extra_deal_mo_mc { } movieClip 578 joker_tile_mc { } movieClip 581 no_more_deals_mc { } movieClip 585 extra_tile_mc { } movieClip 591 { } button 593 { on (press) { _root.highScoresUpdated = true; _root.playSound('button1.wav'); this._parent.unloadMovie(); _root.backtohighscores = true; _root.jumpToEntry(); } } movieClip 595 { } button 596 { on (press) { this.handleSubmitPress(); } } movieClip 597 highscore_mc { frame 1 { function handleSubmitPress() { _root.addRecordScore('RPN', 'basic_scores', this.playerName.text, this.points, this.level); _root.addRecordScore('RPN', 'basic_levels', this.playerName.text, this.level, this.points); _root.highScoresUpdated = true; _root.playSound('button1.wav'); _root.newHighscore = false; _root.updateHighScores(); var v3 = new mx.transitions.Tween(this, '_alpha', mx.transitions.easing.Regular.easeOut, 100, 0, 0.8, 1); Key.removeListener(this); v3.parent = this; v3.onMotionFinished = function () { this.parent.unloadMovie(); }; } } } movieClip 600 end_game_mc { } movieClip 603 red_transform_mo_mc { } movieClip 606 green_transform_mo_mc { } movieClip 609 blue_transform_mo_mc { } movieClip 612 sol_transform_mo_mc { } movieClip 615 luna_transform_mo_mc { } movieClip 618 terra_transform_mo_mc { } movieClip 621 stella_transform_mo_mc { } button 629 { on (release) { this.musicEnabled_mc = _root.optionsMenu_mc.musicEnabled_mc; _root.playSound('button1.wav'); if (_root.bgMusicEnabled) { _root.rpnDisableBGMusic(); this.musicEnabled_mc._alpha = 0; } else { _root.rpnEnableBGMusic(); this.musicEnabled_mc._alpha = 100; } } } button 634 { on (release) { _root.playSound('button1.wav'); _root.menusDisabled = false; _root.inGameMenuDisabled = false; _root.optionsMenu_mc.unloadMovie(); } } button 637 { on (release) { this.soundEnabled_mc = _root.optionsMenu_mc.soundEnabled_mc; if (_root.bgSoundsEnabled) { _root.rpnDisableSounds(); this.soundEnabled_mc._alpha = 0; } else { _root.rpnEnableSounds(); this.soundEnabled_mc._alpha = 100; } _root.playSound('button1.wav'); } } movieClip 640 v_sign { } movieClip 641 optionsMenu_mc { } movieClip 643 quit_options_mc { } movieClip 645 v_mc { } movieClip 648 { } button 654 { on (release) { if (_root.inGameMenuDisabled) { return undefined; } _root.inGameMenuDisabled = true; _root.playSound('button1.wav'); _root.optionsMenu_mc = _root.getReggedStageMC(); _root.optionsMenu_mc.swapDepths(21001); _root.optionsMenu_mc.attachMovie('optionsMenu_mc', 'movie', _root.getNextDepth()); _root.optionsMenu_mc._x = 322; _root.optionsMenu_mc._y = 25; _root.optionsMenu_mc = _root.optionsMenu_mc.movie; _root.optionsMenu_mc.soundEnabled_mc._alpha = _root.bgSoundsEnabled ? 100 : 0; _root.optionsMenu_mc.musicEnabled_mc._alpha = _root.bgMusicEnabled ? 100 : 0; _root.optionsMenu_mc.fullscreenEnabled_mc._alpha = _root.fullscreenEnabled ? 100 : 0; } } button 656 { on (release) { if (_root.inGameMenuDisabled) { return undefined; } _root.inGameMenuDisabled = true; _root.playSound('button1.wav'); var are_you_sure_mc = _root.getReggedStageMC(); are_you_sure_mc.swapDepths(21001); are_you_sure_mc.attachMovie('are_you_sure_mc', 'movie', _root.getNextDepth()); are_you_sure_mc._x = 291.4; are_you_sure_mc._y = 50; var kl = new Object(); kl.parent = are_you_sure_mc; kl.onKeyDown = function () { var v3 = Key.getCode(); if (v3 == 89) { _root.playSound('button1.wav'); _root.inGameMenuDisabled = false; Key.removeListener(this); this.yesClickedHook(); this._parent.unloadMovie(); } if (v3 == 78) { _root.playSound('button1.wav'); _root.inGameMenuDisabled = false; Key.removeListener(this); this.noClickedHook(); this._parent.unloadMovie(); } }; kl.yesClickedHook = function () { _root.gameMenu_mc = undefined; _root.endTutorial(); _root.jumpToEntry(); }; kl.noClickedHook = function () {}; are_you_sure_mc.movie.kl = kl; Key.addListener(kl); } } button 658 { on (release) { if (_root.inGameMenuDisabled) { return undefined; } _root.inGameMenuDisabled = true; _root.playSound('button1.wav'); var are_you_sure_mc = _root.getReggedStageMC(); are_you_sure_mc.swapDepths(21001); are_you_sure_mc.attachMovie('are_you_sure_mc', 'movie', _root.getNextDepth()); are_you_sure_mc._x = 291.4; are_you_sure_mc._y = 50; var kl = new Object(); kl.parent = are_you_sure_mc; kl.onKeyDown = function () { var v3 = Key.getCode(); if (v3 == 89) { _root.playSound('button1.wav'); _root.inGameMenuDisabled = false; Key.removeListener(this); this.yesClickedHook(); this.parent.unloadMovie(); } if (v3 == 78) { _root.playSound('button1.wav'); _root.inGameMenuDisabled = false; Key.removeListener(this); this.noClickedHook(); this.parent.unloadMovie(); } }; kl.yesClickedHook = function () { fscommand('quit'); }; kl.noClickedHook = function () {}; are_you_sure_mc.movie.kl = kl; Key.addListener(kl); } } button 660 { on (release) { if (_root.inGameMenuDisabled) { return undefined; } _root.playSound('button1.wav'); _root.mainTable.activate(); _root.mainDeck.activate(); _root.mainExtras.activate(); _root.ActivateDeal(); _root.mainTimer.resumeTimer(); _root.menu_mc.enabled = true; _root.deal_mc.enabled = true; _root.tip_btn.enabled = true; _root.gameMenu_mc.unloadMovie(); _root.gameMenu_mc = undefined; } } movieClip 661 inGameMenu_mc { instance continue_mc of movieClip 648 { onClipEvent (release) { if (_root.inGameMenuDisabled) { return undefined; } _root.playSound('button1.wav'); _root.mainTable.activate(); _root.mainDeck.activate(); _root.mainExtras.activate(); _root.ActivateDeal(); _root.mainTimer.resumeTimer(); _root.gameMenu_mc.unloadMovie(); _root.gameMenu_mc = undefined; } } } movieClip 665 { } movieClip 666 are_you_sure_mc { instance of movieClip 665 { onClipEvent (release) { _root.playSound('button1.wav'); _root.inGameMenuDisabled = false; this._parent.kl.yesClickedHook(); Key.removeListener(this._parent.kl); this._parent.unloadMovie(); } } instance of movieClip 665 { onClipEvent (release) { _root.playSound('button1.wav'); _root.inGameMenuDisabled = false; this._parent.kl.noClickedHook(); Key.removeListener(this._parent.kl); this._parent.unloadMovie(); } } } movieClip 669 game_bg1_mc { } movieClip 672 game_bg3_mc { } movieClip 675 game_bg2_mc { } movieClip 698 blue_bomb_effect { frame 12 { this.unloadMovie(); } } movieClip 721 red_bomb_effect { frame 11 { this.unloadMovie(); } } movieClip 751 Menu Text Highlight { } movieClip 755 { frame 20 { stop(); } } movieClip 759 { frame 20 { stop(); } } movieClip 769 { frame 20 { stop(); } } movieClip 770 joker_mc { frame 40 { stop(); _root.mainExtras.addNext(); } } movieClip 774 { frame 20 { stop(); } } movieClip 778 { frame 20 { stop(); } } movieClip 782 { frame 20 { stop(); } } movieClip 792 { frame 20 { stop(); } } movieClip 793 switch_mc { frame 40 { stop(); _root.mainExtras.addNext(); } } movieClip 797 { frame 20 { stop(); } } movieClip 800 { frame 20 { stop(); } } movieClip 805 { frame 20 { stop(); } } movieClip 806 stella_transform_mc { frame 40 { stop(); _root.mainExtras.addNext(); } } movieClip 809 { frame 20 { stop(); } } movieClip 812 { frame 20 { stop(); } } movieClip 816 { frame 20 { stop(); } } movieClip 817 terra_transform_mc { frame 40 { stop(); _root.mainExtras.addNext(); } } movieClip 820 { frame 20 { stop(); } } movieClip 823 { frame 20 { stop(); } } movieClip 827 { frame 20 { stop(); } } movieClip 828 luna_transform_mc { frame 40 { stop(); _root.mainExtras.addNext(); } } movieClip 831 { frame 20 { stop(); } } movieClip 834 { frame 20 { stop(); } } movieClip 838 { frame 20 { stop(); } } movieClip 839 sol_transform_mc { frame 40 { stop(); _root.mainExtras.addNext(); } } movieClip 844 skip_mc { } button 848 { on (release) { _root.playSequencedSound('button1.wav', _root.tutorialStartGame); } } movieClip 849 game_bg0_mc { } movieClip 852 timer_bg_mc { } movieClip 855 timer_green_bg_mc { } movieClip 857 timer_mask_mc { } button 864 { on (release) { _root.removeMovieClip('quest_screen_mc'); if (!_root.inGameScene) { _root.playSequencedSound('button1.wav', _root.jumpToGame); } else { _root.playSequencedSound('button1.wav', _root.rpnNextRound); } } } movieClip 865 quest_screen_mc { frame 1 { _root.onMouseUp = undefined; if (_root.currentLevel == undefined) { _root.currentLevel = 1; } var numcount2String = new Array('first', 'second', 'third', 'fourth', 'fifth', 'sixth', 'seventh', 'eight', 'ninth', 'tenth'); var numsTextFormat = new TextFormat(); numsTextFormat.font = 'Calligraphic'; numsTextFormat.bold = false; numsTextFormat.size = 20; numsTextFormat.letterSpacing = 0; numsTextFormat.align = 'center'; _root.rpnPlayBGMusic('Quest BG'); var tg_txt = _root.quest_screen_mc.dummy.next_quest_txt; numsTextFormat.color = 14810955; tg_txt.setNewTextFormat(numsTextFormat); tg_txt.sharpness = 0; tg_txt.antiAliasType = 'advanced'; tg_txt.selectable = false; tg_txt.embedFonts = true; var level = _root.currentLevel; var sorcererType = 'Sand'; if (_root.currentLevel > 10) { sorcererType = 'Ocean'; } if (_root.currentLevel > 20) { sorcererType = 'Flame'; } while (level > 10) { level -= 10; } _root.quest_screen_mc.dummy.next_quest_txt.text = ''; _root.quest_screen_mc.next_txt = 'Next: The ' + numcount2String[level - 1] + ' ring of the ' + sorcererType + ' Sorcerer'; var tip = _root.getRandomTip(); tg_txt = tip_txt; numsTextFormat.font = 'Calligraphic'; numsTextFormat.size = 14; numsTextFormat.bold = true; numsTextFormat.color = 16763904; numsTextFormat.align = 'center'; tg_txt.setNewTextFormat(numsTextFormat); tg_txt.setTextFormat(numsTextFormat); tg_txt.sharpness = 0; tg_txt.antiAliasType = 'advanced'; tg_txt.selectable = false; tg_txt.embedFonts = true; tg_txt.text = 'Tip: ' + tip; } } button 870 { on (release) { _root.playSound('button1.wav'); _root.tutorialOKClicked(); } } movieClip 871 tutorial_text_bg_mc { } movieClip 873 { } movieClip 875 { } movieClip 886 { } movieClip 887 circle_mc { frame 100 { stop(); } frame 100 { stop(); } frame 100 { stop(); } } movieClip 890 { } movieClip 891 green_transform_tip_mc { } movieClip 893 { } movieClip 894 red_bomb_tip_mc { } movieClip 896 { } movieClip 897 blue_transform_tip_mc { } movieClip 899 { } movieClip 900 red_transform_tip_mc { } movieClip 902 { } movieClip 903 yellow_transform_tip_mc { } movieClip 905 { } movieClip 906 terra_transform_tip_mc { } movieClip 908 { } movieClip 909 luna_transform_tip_mc { } movieClip 911 { } movieClip 912 stella_transform_tip_mc { } movieClip 914 { } movieClip 915 sol_transform_tip_mc { } movieClip 917 { } movieClip 918 joker_tip_mc { } movieClip 920 { } movieClip 921 blue_bomb_tip_mc { } movieClip 923 { } movieClip 924 switch_tip_mc { } movieClip 925 sol_one_mc { } movieClip 926 sol_mc { frame 1 { stop(); } } movieClip 927 stella_one_mc { } movieClip 928 stella_mc { frame 1 { stop(); } } movieClip 929 luna_one_mc { } movieClip 930 luna_mc { frame 1 { stop(); } } movieClip 931 terra_one_mc { } movieClip 932 terra_mc { frame 1 { stop(); } } movieClip 933 luna_flipped_mc { frame 1 { stop(); } } movieClip 934 terra_flipped_mc { frame 1 { stop(); } } movieClip 937 synergy_mo_mc { } movieClip 947 Wand { frame 1 { if (this.fadeIn == true) { _root.setFadein(this, 5.5); } } frame 42 { if (this.fadeOut == true) { _root.setFadeout(this, 5.5); } } frame 60 { if (this.onlyOnce == true) { gotoAndStop('prestart'); } else { gotoAndPlay('start'); } } frame 61 { stop(); } } movieClip 948 constraintHolder { } movieClip 950 { } movieClip 951 { } movieClip 952 cardHitArea { } movieClip 954 { } movieClip 962 { } movieClip 963 Synergy Effect { frame 61 { stop(); } } movieClip 969 { frame 15 { stop(); } } movieClip 970 { frame 45 { stop(); } } movieClip 971 Smoke Effect { frame 20 { stop(); this._parent.unloadMovie('movie'); } } frame 1 { function isRecordScore(tool, category, main_score, secondary_score) { var v8 = 'highscores_' + category; var v4 = _root.getSavedObject(tool, v8); var v2 = 0; while (v2 < v4.maxlength) { var v3 = v4.main_score[v2]; var v5 = v4.secondary_score[v2]; if (v3 == undefined) { return true; } if (v3 < main_score || v3 == main_score && v5 < secondary_score) { return true; } ++v2; } return false; } function addRecordScore(tool, category, player, main_score, secondary_score) { var v12 = 'highscores_' + category; var v3 = _root.getSavedObject(tool, v12); var v2 = 0; while (v2 < v3.maxlength) { var v6 = v3.main_score[v2]; var v7 = v3.secondary_score[v2]; if (v6 == undefined) { break; } if (v6 < main_score || v6 == main_score && v7 < secondary_score) { break; } ++v2; } var v4 = player; var v9 = main_score; var v8 = secondary_score; do { var v5 = v3.player[v2]; v6 = v3.main_score[v2]; v7 = v3.secondary_score[v2]; v3.player[v2] = v4; v3.main_score[v2] = v9; v3.secondary_score[v2] = v8; v4 = v5; v9 = v6; v8 = v7; ++v2; } while (v4 != undefined && v2 < v3.maxlength); v3.length = v2; _root.flushSavedObject(); } function getRecordScore(tool, category, idx) { var v5 = 'highscores_' + category; var v3 = _root.getSavedObject(tool, v5); var v2 = new Object(); v2.player = v3.player[idx]; v2.main_score = v3.main_score[idx]; v2.secondary_score = v3.secondary_score[idx]; return v2; } function initRecordsTable(tool, category, maxlength) { var v2 = 'highscores_' + category; var v3 = _root.getSavedObject(tool, v2); if (v3.maxlength != undefined) { return undefined; } resetRecordsTable(tool, category, maxlength); _root.flushSavedObject(); } function resetRecordsTable(tool, category, maxlength) { var v4 = 'highscores_' + category; var v2 = _root.getSavedObject(tool, v4); delete v2.player; delete v2.main_score; delete v2.secondary_score; v2.maxlength = maxlength; v2.player = new Array(maxlength); v2.main_score = new Array(maxlength); v2.secondary_score = new Array(maxlength); _root.flushSavedObject(); } function newRandomCards(num) { cards = new Array(); var v1 = 1; while (v1 <= num) { cards[v1] = newRandomCard(); ++v1; } return cards; } function newRandomCard() { return new cardObj(randomColor(), randomShape(), randomColor(), randomShape()); } function randomColor() { switch (int(Math.random() * 4)) { case 0: return 'red'; case 1: return 'blue'; case 2: return 'green'; case 3: return 'yellow'; } } function randomShape() { switch (int(Math.random() * 4)) { case 0: return 'luna'; case 1: return 'stella'; case 2: return 'terra'; case 3: return 'sol'; } } function isColor(type) { if (type == 'red' || type == 'blue' || type == 'yellow' || type == 'green') { return true; } return false; } function getNextDepth() { if (nonReggedMCs == undefined || nonReggedMCs == NaN) { nonReggedMCs = 0; } if (nextAvailableDepth == undefined) { nextAvailableDepth = 11000 - nonReggedMCs; } --nextAvailableDepth; return nextAvailableDepth; } function handleDealClickGameNotOver() { if (_root.mainDeck.noMoreDeals() == 1 && _root.lastDealWarningIssued == false) { var v2 = _root.getReggedStageMC(); v2.attachMovie('no_more_deals_mc', 'dummy', 15000); v2.swapDepths(15000); v2._x = 64.3; v2._y = 209.4; v2.onMouseDown = _root.unloadSelf; _root.playSound('tool_message.wav'); _root.lastDealWarningIssued = true; return undefined; } _root.mainDeck.deal(); return undefined; } function handleHighScoresUpdate() { _root.initHighScores(); var v9 = Number(_root.total_points_txt.text); var v8 = Number(_root.currentLevel); if (_root.total_points_txt.text == 0) { return false; } if (!_root.isRecordScore('RPN', 'basic_scores', _root.total_points_txt.text, _root.currentLevel) && !_root.isRecordScore('RPN', 'basic_levels', _root.currentLevel, _root.total_points_txt.text)) { return false; } _root.newHighscore = true; _root.rpnStopSynergies(); _root.jumpToScores(); var v3 = _root.getReggedStageMC(); _root.hs_mc = v3; v3.attachMovie('highscore_mc', 'highscore', 20000); v3.swapDepths(20000); v3._x = 185.8; v3._y = 361.4; var v6 = new Object(); v6.parent = v3.highscore; v6.onKeyDown = function () { var v2 = Key.getCode(); if (v2 == 13) { Key.removeListener(this); this.parent.handleSubmitPress(); } }; Key.addListener(v6); v3.highscore.points = v9; v3.highscore.level = v8; var v4 = new TextFormat(); v4.font = 'AndalusNumbers'; v4.bold = true; v4.size = 14; v4.align = 'center'; v4.letterSpacing = 2; var v5 = v3.highscore.playerName; v4.color = 4203023; v5.setNewTextFormat(v4); v5.sharpness = 0; v5.antiAliasType = 'advanced'; v5.embedFonts = true; return true; } function setCard(obj, val) { if (val != undefined) { setCard(obj, undefined); obj.leftColor.attachMovie(val.leftColor + '_mc', 'leftCol_mc', getNextDepth()); obj.rightColor.attachMovie(val.rightColor + '_mc', 'rightCol_mc', getNextDepth()); obj.rightShape.attachMovie(val.rightShape + '_mc', 'rightShp_mc', getNextDepth()); if (val.leftShape == 'luna' || val.leftShape == 'terra') { obj.leftShape.attachMovie(val.leftShape + '_flipped_mc', 'leftShp_mc', getNextDepth()); } else { obj.leftShape.attachMovie(val.leftShape + '_mc', 'leftShp_mc', getNextDepth()); } obj.cardval = val; obj._visible = true; _root.registerStageMC(obj.leftColor.leftCol_mc); _root.registerStageMC(obj.rightColor.rightCol_mc); _root.registerStageMC(obj.leftShape.leftShp_mc); _root.registerStageMC(obj.rightShape.rightShp_mc); if (val.joker) { setJoker(obj); } } else { obj.leftColor.leftCol_mc.removeMovieClip(); obj.leftShape.leftShp_mc.removeMovieClip(); obj.rightColor.rightCol_mc.removeMovieClip(); obj.rightShape.rightShp_mc.removeMovieClip(); obj.jokerEffect.removeMovieClip(); obj.extraDealEffect.removeMovieClip(); obj.cardval = undefined; obj._visible = false; } } function setJoker(card) { card.cardval.joker = true; card.attachMovie('joker_tile_mc', 'jokerEffect', getNextDepth()); _root.registerStageMC(card.jokerEffect); } function setExtraDealCard(card) { card.cardval.extradeal = true; card.tween = new mx.transitions.Tween(card, '_alpha', mx.transitions.easing.Regular.easeInOut, 95, 60, 1, 1); card.tween.onMotionFinished = card.tween.yoyo; } function unsetExtraDealCard(card) { card.cardval.extradeal = false; card.tween.stop(); } function playSound(name, loops, vol) { if (!_root.bgSoundsEnabled) { return undefined; } if (loops == undefined) { loops = 0; } var v2 = new Sound(); v2.attachSound(name); v2.start(0, loops); false; } function playSequencedSound(name, func) { if (!_root.bgSoundsEnabled) { func(); return undefined; } var v3 = new Sound(); v3.onSoundComplete = function () { this.func(); }; v3.func = func; v3.attachSound(name); v3.start(); false; } function clearStage() { _root.game_bg_mc2.swapDepths(1); _root.tutorial_text_bg_mc.swapDepths(2); for (obj in _root.stageObjs) { _root.stageObjs[obj].removeMovieClip(); delete _root.stageObjs[obj]; _root.stageObjs[obj] = undefined; } delete _root.stageObjs; _root.stageObjs = undefined; if (nonReggedMCs == undefined || nonReggedMCs == NaN) { nonReggedMCs = 0; } nextAvailableDepth = 11000 - nonReggedMCs; } function getStageMC(regged) { if (_root.stageObjs == undefined) { _root.stageObjs = new Array(); } if (nonReggedMCs == undefined || nonReggedMCs == NaN) { nonReggedMCs = 0; } if (regged != true) { ++nonReggedMCs; } var v2 = 0; if (regged) { v2 = 'Regged' + _root.stageObjs.length; var v3 = 'dynamicObject' + v2; _root.createEmptyMovieClip(v3, _root.getNextDepth()); return _root[v3]; } v2 = nonReggedMCs; var v3 = 'dynamicObject' + v2; _root.createEmptyMovieClip(v3, _root.getNextDepth()); return _root[v3]; } function getReggedStageMC() { var v1 = getStageMC(true); registerStageMC(v1); return v1; } function registerStageMC(mc) { if (_root.stageObjs == undefined) { _root.stageObjs = new Array(); } _root.stageObjs.push(mc); } function generateIdxSet(nums, maxNum) { var v5 = new Array(); var v6 = new Array(); var v3 = 0; while (v3 < nums) { v6.push(int((maxNum - v3) * Math.random() + 1)); ++v3; } v3 = 0; while (v3 < nums) { var v2 = v6[v3]; var v4 = v5; v4.sort(); var v1 = 0; while (v1 < v3) { if (v4[v1] <= v2) { ++v2; } ++v1; } v5.push(v2); ++v3; } return v5; } function generateConstraints(level, slotsNum) { var v4 = new Array(); var v9 = _root.getConstraintNums(level); var v5 = _root.generateIdxSet(v9.totalConstraints, slotsNum); var v7 = v9.genColor; var v6 = v9.genShape + v7; var v8 = v9.spcColor + v6; var v2; var v3 = 0; while (v3 < v7) { v2 = new Object(); v2.idx = v5[v3]; v2.cnstr = 'color'; v4.push(v2); false; ++v3; } v3 = v7; while (v3 < v6) { v2 = new Object(); v2.idx = v5[v3]; v2.cnstr = 'shape'; v4.push(v2); false; ++v3; } v3 = v6; while (v3 < v8) { v2 = new Object(); v2.idx = v5[v3]; v2.cnstr = randomColor(); v4.push(v2); false; ++v3; } v3 = v8; while (v3 < v9.totalConstraints) { v2 = new Object(); v2.idx = v5[v3]; v2.cnstr = randomShape(); v4.push(v2); false; ++v3; } return v4; } function getConstraintNums(level) { var v1 = new Object(); if (level > 30) { level = 30; } v1.genColor = genColorPerLevel[level - 1]; v1.genShape = genShapePerLevel[level - 1]; v1.spcColor = spcColorPerLevel[level - 1]; v1.spcShape = spcShapePerLevel[level - 1]; v1.totalConstraints = v1.genColor + v1.genShape + v1.spcColor + v1.spcShape; return v1; } function loadMouse() { Mouse.hide(); if (_root.mouse_mc) { _root.mouse_mc.unloadMovie(); _root.mouse_mc = undefined; } if (_root.mouse_mc == undefined) { _root.mouse_mc = _root.getStageMC(); _root.mouse_mc.swapDepths(25000); _root.mouse_mc.attachMovie('mouse_mc', 'dummy', _root.getNextDepth()); _root.mouse_mc.onEnterFrame = _root.updateMouseLocation; } } function updateMouseLocation() { this._x = _root._xmouse; this._y = _root._ymouse; } function unloadSelf() { this.unloadMovie(); } function getSavedObject(tool, name) { var v1 = SharedObject.getLocal(tool + '_' + name); if (v1 == undefined) { trace('FATAL: getSavedObject(' + tool + ', ' + name + ') has failed. Possibly a permissions/space issue.'); return undefined; } if (v1.data.val == undefined) { v1.data.val = new Object(); } return v1.data.val; } function flushSavedObject() { var v1 = SharedObject.getLocal(tool + '_' + name); v1.flush(); } function setFadein(obj, step) { obj._alpha = 0; obj.fadein_step = step; obj.onEnterFrame = _root.fadeInEffect; } function setFadeout(obj, step) { obj._alpha = 100; obj.fadeout_step = step; obj.onEnterFrame = _root.fadeOutEffect; } function fadeInEffect() { this._alpha += this.fadein_step; if (this._alpha > 100) { this._alpha = 100; this.onEnterFrame = undefined; } } function fadeOutEffect() { this._alpha -= this.fadeout_step; if (this._alpha < 0) { this._alpha = 0; this.onEnterFrame = undefined; } } function initHighScores() { if ((_root.getRecordScore('RPN', 'basic_scores', 0)).player == undefined || (_root.getRecordScore('RPN', 'basic_levels', 0)).player == undefined) { _root.resetRecordsTable('RPN', 'basic_levels', 11); _root.resetRecordsTable('RPN', 'basic_scores', 11); var v2 = 10; while (v2 >= 0) { _root.addRecordScore('RPN', 'basic_scores', 'Sorcerer', 100 + v2 * 100, 1); _root.addRecordScore('RPN', 'basic_levels', 'Sorcerer', 1 + v2, 100 + v2 * 100); --v2; } } } function setSynergy() { var v2; v2 = _root.currentLevel - 3; if (v2 < 1) { _root.synergy1 = undefined; _root.synergy2 = undefined; return undefined; } while (v2 > 28) { v2 -= 28; } if (v2 == 1) { _root.generateSynergySet(); } var v5 = _root.synergiesSet[v2 - 1].s1; var v4 = _root.synergiesSet[v2 - 1].s2; _root.playSound('Synergy Startup'); var v6 = v5 + '_' + v4 + '_synergy_mc'; _root.synergy1 = v5; _root.synergy2 = v4; var v3 = _root.getReggedStageMC(); v3.swapDepths(20500); v3.attachMovie(v6, 'movie', 100); v3._x = 324.9; v3._y = 246.6; v3.movie.onRollOver = _root.synergyOnRollOver; v3.movie.onRollOut = _root.synergyOnRollOut; } function synergyOnRollOver() { if (_root.inGameMenuDisabled == false) { return undefined; } if (_root.rpnGameOver()) { return undefined; } if (this.synergy_mo_mc != undefined) { return undefined; } if (this._currentframe != this._totalframes) { return undefined; } this.lala = _root.getReggedStageMC(); this.lala.swapDepths(20500); this.lala.attachMovie('synergy_mo_mc', 'movie', 25000); this.lala._x = 463; this.lala._y = 167; } function synergyOnRollOut() { removeMovieClip(this.lala); } function generateSynergySet() { _root.synergiesSet = new Array(); var v2 = new Array(); var v6 = 0; while (v6 < 4) { var v5 = v6 + 1; while (v5 < 4) { var v4 = new Object(); v4.s1 = colorsArray[v6]; v4.s2 = colorsArray[v5]; v2.push(v4); ++v5; } v5 = 0; while (v5 < 4) { v4 = new Object(); v4.s1 = shapesArray[v6]; v4.s2 = colorsArray[v5]; v2.push(v4); ++v5; } ++v6; } v6 = 0; while (v6 < 4) { v5 = v6 + 1; while (v5 < 4) { v4 = new Object(); v4.s1 = shapesArray[v6]; v4.s2 = shapesArray[v5]; v2.push(v4); ++v5; } ++v6; } while (v2.length > 0) { var v7 = int(Math.random() * v2.length); _root.synergiesSet.push(v2[v7]); var v8 = new Array(); var v3 = 0; while (v3 < v7) { v8.push(v2[v3]); ++v3; } v3 = v7 + 1; while (v3 < v2.length) { v8.push(v2[v3]); ++v3; } v2 = v8; } } function addExtrasByLevel(level) { if (_root.specialDebugMode == level) { _root.addExtraDeals(4, 4); _root.addExtraBonuses('red_bomb', 2); _root.addExtraBonuses('switch', 2); _root.addExtraBonuses('joker', 2); _root.addExtraBonuses('blue_bomb', 2); } if (level == 1) { _root.addExtraDeals(4, 3); } if (level == 10 || level == 15) { _root.addExtraBonuses(randomTransformColor(), 1); _root.addExtraBonuses(randomTransformShape(), 1); } if (level == 20) { _root.addExtraBonuses(randomTransform(), 1); _root.addExtraBonuses(randomTransform(), 1); _root.addExtraBonuses(randomTransform(), 1); } if (level == 25) { _root.addExtraBonuses(randomTransformColor(), 1); _root.addExtraBonuses(randomTransformColor(), 1); _root.addExtraBonuses(randomTransformShape(), 1); _root.addExtraBonuses(randomTransformShape(), 1); } if (level == 30) { _root.addExtraBonuses(randomTransform(), 1); _root.addExtraBonuses(randomTransform(), 1); _root.addExtraBonuses(randomTransform(), 1); _root.addExtraBonuses(randomTransform(), 1); _root.addExtraBonuses(randomTransform(), 1); } if (level > 30) { _root.addExtraBonuses(randomTransform(), 1); } } function randomTransform() { if (int(Math.random() * 2) == 0) { return randomTransformColor(); } else { return randomTransformShape(); } } function randomTransformColor() { return _root.randomColor() + '_transform'; } function randomTransformShape() { var v2 = _root.randomShape(); return v2 + '_transform'; } function addExtraDeals(cards, num) { if (num == undefined || num < 1) { return undefined; } _root.mainExtras.add('d' + cards + '_extradeal', num, _root.extraDealClick, 'extra_deal_mo_mc', cards); } function addExtraBonuses(type, num) { if (num == undefined || num < 1) { return undefined; } _root.mainExtras.add(type + '_mc', num, eval('_root.extra' + type + 'Click'), type + '_mo_mc', undefined); } function extraDealClick() { if (_root.mainExtras.mActive == false) { return undefined; } _root.tutorialNotifyExtraDealClicked(); var v3 = _root.mainExtras.getExtraInfo(this.idx); this.onRollOut(); _root.mainExtras.remove(this.idx); _root.mainDeck.setExtraDeal(v3); _root.playSound('Extra Deal'); _root.lastDealWarningIssued = false; } function extrared_bombClick() { if (_root.mainTable.isEmpty()) { playSound('Illegal Click'); return undefined; } _root.mainExtras.deactivate(); _root.mainDeck.deactivate(); _root.mainTable.deactivate(); this.mouse_over_elem.removeMovieClip(); extrasAddTip('red_bomb'); _root.playSound('tool_message.wav'); _root.mainExtras.remove(this.idx); _root.onMouseDown = _root.redBombOnTileClick; _root.lastDealWarningIssued = false; } function redBombOnTileClick() { var v3 = _root.mainTable.getSlotIdxFromCursor(); if (v3 == undefined || _root.mainTable.getCard(v3) == undefined) { playSound('Illegal Click'); return undefined; } _root.playSound('red_bomb.wav'); _root.mainTable.setCard(v3, NULL); var v2 = _root.getReggedStageMC(); v2.attachMovie('red_bomb_effect', dummy, _root.getNextDepth()); v2.swapDepths(16500); var v4 = _root.mainTable.getTileEffectCoords(v3); v2._x = v4._x; v2._y = v4._y; _root.tutorialNotifyExtraDealClicked(); _root.mainExtras.activate(); _root.mainDeck.activate(); _root.mainTable.activate(); extrasRemoveTip(); _root.onMouseDown = undefined; } function extrablue_bombClick() { if (!_root.mainTable.hasConstraints()) { playSound('Illegal Click'); return undefined; } _root.mainExtras.deactivate(); _root.mainDeck.deactivate(); _root.mainTable.deactivate(); this.mouse_over_elem.removeMovieClip(); extrasAddTip('blue_bomb'); _root.playSound('tool_message.wav'); _root.mainExtras.remove(this.idx); _root.onMouseDown = _root.blueBombOnTileClick; _root.lastDealWarningIssued = false; } function blueBombOnTileClick() { var v3 = _root.mainTable.getConstraintIdxFromCursor(); if (v3 == undefined) { playSound('Illegal Click'); return undefined; } _root.playSound('blue_bomb.wav'); _root.mainTable.setConstraint(v3, NULL); var v2 = _root.getReggedStageMC(); v2.attachMovie('blue_bomb_effect', dummy, _root.getNextDepth()); v2.swapDepths(16500); var v4 = _root.mainTable.getSliceEffectCoords(v3); v2._x = v4._x; v2._y = v4._y; _root.mainExtras.activate(); _root.mainDeck.activate(); _root.mainTable.activate(); extrasRemoveTip(); _root.onMouseDown = undefined; } function extraswitchClick() { _root.mainExtras.deactivate(); _root.mainDeck.deactivate(); _root.mainTable.deactivate(); this.mouse_over_elem.removeMovieClip(); extrasAddTip('switch'); _root.playSound('tool_message.wav'); _root.mainExtras.remove(this.idx); _root.onMouseDown = _root.switchOnTileClick; _root.lastDealWarningIssued = false; } function switchOnTileClick() { var v2 = _root.mainTable.getSlotIdxFromCursor(); if (v2 != undefined && _root.mainTable.getCard(v2) != undefined) { if (!switchTableTile(v2)) { playSound('Illegal Click'); return undefined; } } else { v2 = _root.mainDeck.getSlotIdxFromCursor(); if (v2 != undefined) { switchDeckTile(v2); } else { playSound('Illegal Click'); return undefined; } } _root.playSound('switch.wav'); _root.tutorialNotifyExtraDealClicked(); _root.mainExtras.activate(); _root.mainDeck.activate(); _root.mainTable.activate(); extrasRemoveTip(); _root.onMouseDown = undefined; } function switchDeckTile(idx) { var v2 = (_root.mainDeck.getCard(idx)).cardval; var v3 = new cardObj(v2.rightColor, v2.rightShape, v2.leftColor, v2.leftShape); _root.setFadein(_root.mainDeck.setCard(idx, v3), 4); } function switchTableTile(idx) { var v2 = _root.mainTable.getCard(idx); var v4 = new cardObj(v2.rightColor, v2.rightShape, v2.leftColor, v2.leftShape); _root.mainTable.setCard(idx, undefined); if (_root.mainTable.illegalPlacement(idx, v4, -1)) { _root.mainTable.setCard(idx, v2); return false; } else { _root.setFadein(_root.mainTable.setCard(idx, v4), 4); return true; } } function extrajokerClick() { _root.mainExtras.deactivate(); _root.mainDeck.deactivate(); _root.mainTable.deactivate(); this.mouse_over_elem.removeMovieClip(); _root.playSound('tool_message.wav'); _root.mainExtras.remove(this.idx); extrasAddTip('joker'); _root.onMouseDown = _root.jokerOnTileClick; _root.lastDealWarningIssued = false; } function jokerOnTileClick() { var v2 = _root.mainTable.getSlotIdxFromCursor(); var v3 = _root.mainDeck.getSlotIdxFromCursor(); if ((v2 == undefined || _root.mainTable.getCard(v2) == undefined) && v3 == undefined) { playSound('Illegal Click'); return undefined; } if (v2 != undefined) { _root.mainTable.setJoker(v2); } else { _root.mainDeck.setJoker(v3); } _root.playSound('joker.wav'); _root.mainExtras.activate(); _root.mainDeck.activate(); _root.mainTable.activate(); extrasRemoveTip(); _root.onMouseDown = undefined; } function extraDealMO() { if (_root.mainExtras.mActive == false) { return undefined; } if (this.mouse_over_elem == undefined) { this.mouse_over_elem = _root.getReggedStageMC(); this.mouse_over_elem.swapDepths(17020); this.mouse_over_elem.attachMovie(this.tip, 'msg', 17020); this.mouse_over_elem._x = this._x - 53; this.mouse_over_elem._y = this._y - 128; this.mouse_over_elem._alpha = 0; _root.setFadein(this.mouse_over_elem, 10); } } function extraDealMOut() { this.mouse_over_elem.removeMovieClip(); this.mouse_over_elem = undefined; } function transformClick(extradeal, color, shape) { _root.mainExtras.deactivate(); _root.mainDeck.deactivate(); _root.mainTable.deactivate(); extradeal.mouse_over_elem.removeMovieClip(); _root.playSound('tool_message.wav'); _root.mainExtras.remove(extradeal.idx); _root.transformToColor = color; _root.transformToShape = shape; if (color != undefined) { extrasAddTip(color + '_transform'); } if (shape != undefined) { extrasAddTip(shape + '_transform'); } _root.onMouseDown = _root.transformOnTileClick; _root.lastDealWarningIssued = false; } function transformOnTileClick() { var v2 = _root.mainTable.getSlotIdxAndSideFromCursor(); var v3 = _root.mainDeck.getSlotIdxAndSideFromCursor(); if ((v2 == undefined || _root.mainTable.getCard(v2.idx) == undefined) && v3 == undefined) { playSound('Illegal Click'); return false; } if (v2 != undefined) { if (!transformTableTile(v2.idx, v2.leftSide)) { return undefined; } } else { transformDeckTile(v3.idx, v3.leftSide); } _root.playSound('transform.wav'); _root.mainExtras.activate(); _root.mainDeck.activate(); _root.mainTable.activate(); extrasRemoveTip(); _root.onMouseDown = undefined; } function transformTableTile(idx, left) { var v3 = _root.mainTable.getCard(idx); var v2 = new cardObj(v3.leftColor, v3.leftShape, v3.rightColor, v3.rightShape); if (left) { if (_root.transformToColor != undefined) { v2.leftColor = _root.transformToColor; } if (_root.transformToShape != undefined) { v2.leftShape = _root.transformToShape; } } else { if (_root.transformToColor != undefined) { v2.rightColor = _root.transformToColor; } if (_root.transformToShape != undefined) { v2.rightShape = _root.transformToShape; } } _root.mainTable.setCard(idx, undefined); if (_root.mainTable.illegalPlacement(idx, v2, -1)) { _root.mainTable.setCard(idx, v3); playSound('Illegal Click'); return false; } else { var v4 = _root.mainTable.setCard(idx, v2); if (left) { if (_root.transformToColor != undefined) { _root.setFadein(v4.leftColor, 4); } if (_root.transformToShape != undefined) { _root.setFadein(v4.leftShape, 4); } return true; } if (_root.transformToColor != undefined) { _root.setFadein(v4.rightColor, 4); } if (_root.transformToShape != undefined) { _root.setFadein(v4.rightShape, 4); } return true; } } function transformDeckTile(idx, left) { var v4 = (_root.mainDeck.getCard(idx)).cardval; var v2 = new cardObj(v4.leftColor, v4.leftShape, v4.rightColor, v4.rightShape); if (left) { if (_root.transformToColor != undefined) { v2.leftColor = _root.transformToColor; } if (_root.transformToShape != undefined) { v2.leftShape = _root.transformToShape; } } else { if (_root.transformToColor != undefined) { v2.rightColor = _root.transformToColor; } if (_root.transformToShape != undefined) { v2.rightShape = _root.transformToShape; } } var v3 = _root.mainDeck.setCard(idx, v2); if (left) { if (_root.transformToColor != undefined) { _root.setFadein(v3.leftColor, 4); } if (_root.transformToShape != undefined) { _root.setFadein(v3.leftShape, 4); } return true; } if (_root.transformToColor != undefined) { _root.setFadein(v3.rightColor, 4); } if (_root.transformToShape != undefined) { _root.setFadein(v3.rightShape, 4); } return true; } function extrablue_transformClick() { transformClick(this, 'blue', undefined); } function extragreen_transformClick() { transformClick(this, 'green', undefined); } function extrared_transformClick() { transformClick(this, 'red', undefined); } function extrayellow_transformClick() { transformClick(this, 'yellow', undefined); } function extraluna_transformClick() { transformClick(this, undefined, 'luna'); } function extraterra_transformClick() { transformClick(this, undefined, 'terra'); } function extrasol_transformClick() { transformClick(this, undefined, 'sol'); } function extrastella_transformClick() { transformClick(this, undefined, 'stella'); } function extrasAddTip(name) { _root.extra_tip_mc = _root.getReggedStageMC(); with (_root.extra_tip_mc) { attachMovie(name + '_tip_mc', 'dummy', 10000); _x = 320; _y = 60; } } function extrasRemoveTip() { removeMovieClip(_root.extra_tip_mc); } function getRandomTip() { return tips[int(Math.random() * tips.length)]; } function getInstruction(idx) { if (instructions.length <= idx) { return undefined; } else { return instructions[idx]; } } function rpnInit() { var v3 = new TextFormat(); v3.font = 'AndalusNumbers'; v3.bold = true; v3.size = 18; var v2 = _root.points_txt; v3.color = 7623171; v2.setNewTextFormat(v3); v2.setTextFormat(v3); v2.sharpness = 0; v2.antiAliasType = 'advanced'; v2.selectable = false; v2.embedFonts = true; v2 = _root.level_txt; v3.color = 4203023; v2.setNewTextFormat(v3); v2.setTextFormat(v3); v2.sharpness = 0; v2.antiAliasType = 'advanced'; v2.selectable = false; v2.embedFonts = true; v2 = _root.total_points_txt; v3.color = 7672066; v2.setNewTextFormat(v3); v2.setTextFormat(v3); v2.sharpness = 0; v2.antiAliasType = 'advanced'; v2.selectable = false; v2.embedFonts = true; v2 = _root.instructions_txt; v3.font = 'Calligraphic'; v3.size = 14; v3.color = 7672066; v3.align = 'left'; v2.setNewTextFormat(v3); v2.setTextFormat(v3); v2.sharpness = 0; v2.antiAliasType = 'advanced'; v2.selectable = false; v2.embedFonts = true; var v4 = new Array(185, 185, 195, 205, 220); var v5 = new Array(368, 388, 408, 428, 448); _root.mainExtras = new rpnExtraDeals(47, 350, v4, v5); } function rpnGameOver() { return _root.mainTable.isFull() || _root.mainDeck.isEmpty() || _root.mainTimer != undefined && _root.mainTimer.isTimeElapsed(); } function rpnGameWon() { return _root.rpnGameOver() && _root.mainTable.getScore() == 48; } function rpnGameLost() { return _root.rpnGameOver() && !_root.rpnGameWon(); } function rpnNewGame(level, baseScore, from_quest) { if (level == 1 && from_quest != false) { from_quest = true; } if (from_quest) { _root.levelDone = false; } _root.onMouseDown = undefined; _root.onMouseUp = undefined; _root.level_txt.text = level; _root.currentLevel = level; _root.baseScore = baseScore; _root.bonusesGiven = false; _root.roundBonusPoints = 0; if (from_quest) { _root.clearStage(); } if (!_root.isTutorialRunning()) { _root.tutorial_txt.text = ''; } else { _root.tutorial_text_bg_mc = _root.getReggedStageMC(); _root.tutorial_text_bg_mc.swapDepths(_root.tutorial_txt); tutorial_text_bg_mc.attachMovie('tutorial_text_bg_mc', 'bg_mc', 10000); tutorial_text_bg_mc._x = 38; tutorial_text_bg_mc._y = 376; } _root.mainExtras.activate(); _root.mainExtras.refresh(); _root.lastDealWarningIssued = false; _root.highScoresUpdated = false; if (from_quest != true && !_root.isTutorialRunning() && _root.currentLevel <= 30) { rpnLoadQuestScreen(); return undefined; } _root.levelUpdated = false; inGame = true; _root.game_bg_mc2 = _root.getReggedStageMC(); _root.game_bg_mc2.swapDepths(-16383); _root.game_bg_mc2._alpha = 100; var v5 = int((level - 1) / 10) + 1; if (v5 > 3) { v5 = 3; } if (_root.isTutorialRunning()) { v5 = 0; } _root.game_bg_mc2.attachMovie('game_bg' + v5 + '_mc', 'bg', -5000); _root.game_bg_mc2._x = 0; _root.game_bg_mc2._y = 0; if (_root.currentLevel <= 30) { _root.dragon_mc = _root.getReggedStageMC(); _root.dragon_mc.attachMovie('dragon_fire_bad_mc', 'movie', _root.getNextDepth()); _root.dragon_mc._x = -2; _root.dragon_mc._y = 0; _root.dragon_mc.movie.gotoAndStop(1); } else { _root.dragon_mc.removeMovieClip('movie'); } _root.victory_mc = _root.getReggedStageMC(); _root.victory_mc.attachMovie('Star Burst', 'movie', _root.getNextDepth()); _root.victory_mc._x = 0; _root.victory_mc._y = 0; _root.victory_mc.movie.gotoAndStop('start'); _root.wizard_wand_mc = _root.getReggedStageMC(); _root.wizard_wand_mc.swapDepths(1000); _root.wizard_wand_mc.attachMovie('Wand', 'movie', 1000); _root.wizard_wand_mc._x = 0; _root.wizard_wand_mc._y = 0; _root.wizard_wand_mc.movie.onlyOnce = true; _root.wizard_wand_mc.movie.gotoAndStop('prestart'); _root.text_highlight_mc = _root.getReggedStageMC(); _root.text_highlight_mc.attachMovie('Text Highlight', 'movie', _root.getNextDepth()); _root.text_highlight_mc._x = -8; _root.text_highlight_mc._y = -6; _root.text_highlight_mc.movie.gotoAndStart('start'); if (_root.gameMode == 'survival') { rpnInitTimer(); } else { _root.mainTimer = undefined; } _root.resetTableAndDeck(); rpnStopSynergies(false); _root.won_this_round_txt._visible = false; _root.setSynergy(); var v3 = _root.generateConstraints(_root.level_txt.text, _root.mainTable.mSlotsNum); var v2 = 0; while (v2 < v3.length) { _root.mainTable.setConstraint(v3[v2].idx, v3[v2].cnstr); ++v2; } _root.rpnPlayBGMusic(undefined); _root.playSequencedSound('StartGame', _root.moveToGameMusic); _root.addExtrasByLevel(level); _root.instructions_txt.text = ''; _root.hasBonuses = false; _root.currInstructionIdx = 0; if (!_root.isTutorialRunning()) { _root.setInstructionsColor(1399040, 14); _root.rpnSetTextMessage('Level ' + level + ' begins!\n'); if (level == 1) { _root.setInstructionsColor(7672066, 14); _root.currInstructionIdx = 1; _root.textIsInstruction = true; _root.rpnAddTextMessage('1. ' + _root.getInstruction(0)); } if (level == 2) { _root.setInstructionsColor(7672066, 14, true, -0.5); _root.rpnAddTextMessage('The triangle in the inner circle is a "limiter". The two tiles you put next to it have to match the way the limiter shows. This limiter is a "color" limiter - the two tiles must have matching colors.\n'); } if (level == 4) { _root.setInstructionsColor(7672066, 14); _root.rpnAddTextMessage('Every synergic match you create this round will get you special bonuses. You can see the synergic couple on the right, above the level box.'); } if (level == 10) { _root.setInstructionsColor(7672066, 14); _root.rpnAddTextMessage('From now on, you will get special power-ups every 5 levels - "transform tools". These tools can change one color or one symbol to another.'); } } _root.loadMouse(); _root.mainTable.deactivate(); _root.mainDeck.deactivate(); _root.mainExtras.deactivate(); DeactivateDeal(); _root.menu_mc.onRelease = undefined; _root.menu_mc.enabled = false; _root.deal_mc.enabled = false; _root.tip_btn.enabled = false; if (!(level == 1 || level == 10 || level == 15 || level == 20 || level == 25 || level == 30 || level > 30)) { _root.rpnNotifyExtrasAdded(); } if (level != 0) { _root.lastGameWasTutorial = false; } } function resetTableAndDeck() { var tableSlots = Array(); tableSlots.push('dummy'); var i = 1; while (i <= 8) { tableSlots.push(eval('_root.circleSlot' + i + '_mc')); ++i; } _root.mainDeck.unsetExtras(); delete _root.mainTable; _root.mainTable = new rpnTable(8, tableSlots); delete _root.mainDeck; _root.mainDeck = new rpnDeck(4); } function rpnReset() { _root.mainExtras.reset(); _root.mainTable.reset(); _root.mainDeck.reset(); inGame = false; } function rpnPlayBGMusic(name) { if (_root.bgmusic_on != name) { _root.bgmusic_sound.stop(); delete _root.bgmusic_sound; _root.bgmusic_sound = new Sound(); _root.bgmusic_sound.attachSound(name); if (_root.bgMusicEnabled) { _root.bgmusic_sound.start(0, 100000); } _root.bgmusic_on = name; } } function rpnEnableBGMusic() { _root.bgMusicEnabled = true; _root.bgmusic_sound.start(0, 100000); } function rpnDisableBGMusic() { _root.bgMusicEnabled = false; _root.bgmusic_sound.stop(); } function rpnEnableSounds() { _root.bgSoundsEnabled = true; } function rpnDisableSounds() { _root.bgSoundsEnabled = false; } function rpnHandleGameWon() { inGame = false; _root.endTutorial(); _root.mainDeck.unsetExtras(); _root.mainTimer.suspendTimer(); _root.mainTable.deactivate(); _root.mainDeck.deactivate(); _root.mainExtras.deactivate(); _root.DeactivateDeal(); _root.menu_mc.onRelease = undefined; _root.menu_mc.enabled = false; _root.tip_btn.enabled = false; if (_root.currentLevel <= 30) { _root.dragon_mc.removeMovieClip('movie'); _root.dragon_mc = _root.getReggedStageMC(); _root.dragon_mc.swapDepths(20499); _root.dragon_mc.attachMovie('dragon_fire_good_mc', 'movie', _root.getNextDepth()); _root.dragon_mc._x = -2; _root.dragon_mc._y = 0; _root.dragon_mc.movie.gotoAndPlay(1); } } function rpnHandleBonuses() { var v5 = false; var v2 = getHarmonicPoints(); if (v2 != undefined) { _root.addExtraDeals(2, v2.D2); _root.addExtraDeals(3, v2.D3); _root.addExtraDeals(4, v2.D4); _root.addExtraBonuses('red_bomb', v2.RB); _root.addExtraBonuses('switch', v2.SW); _root.addExtraBonuses('joker', v2.JO); _root.addExtraBonuses('blue_bomb', v2.BB); if (v2.D2 > 0 || v2.D3 > 0 || v2.D4 > 0 || v2.RB > 0 || v2.SW > 0 || v2.JO > 0 || v2.BB > 0) { v5 = true; } _root.roundBonusPoints += Number(v2.points); } var v3 = getPoolPoints(); _root.addExtraDeals(2, v3.D2); _root.addExtraDeals(3, v3.D3); _root.addExtraDeals(4, v3.D4); _root.addExtraBonuses('red_bomb', v3.RB); _root.addExtraBonuses('switch', v3.SW); _root.addExtraBonuses('joker', v3.JO); _root.addExtraBonuses('blue_bomb', v3.BB); if (v3.D2 > 0 || v3.D3 > 0 || v3.D4 > 0 || v3.RB > 0 || v3.SW > 0 || v3.JO > 0 || v3.BB > 0) { v5 = true; } _root.roundBonusPoints += Number(v3.points); var v7 = _root.hasBonuses; var v4 = getSynergyPoints(); _root.addExtraDeals(2, v4.D2); _root.addExtraDeals(3, v4.D3); _root.addExtraDeals(4, v4.D4); if (v4.D2 > 0 || v4.D3 > 0 || v4.D4 > 0) { v5 = true; } _root.mainTable.deactivate(); _root.mainDeck.deactivate(); _root.mainExtras.deactivate(); if (_root.mainTimer != undefined) { var v6 = int(_root.mainTimer.remainingSeconds()) * 2; if (v6 > 0) { _root.addSpecialSetsMsg('Survival time bonus, ', v6, 0, 0, 0, 0, 0, 0, 0); } _root.roundBonusPoints += v6; } if (!v7) { _root.setInstructionsColor(1510, 14); _root.rpnAddTextMessage('Don\'t forget: creating special sets will get you special bonuses!\n'); } _root.setInstructionsColor(617, 16, false); _root.rpnAddTextMessage('Click anywhere to continue\n'); if (!v5) { _root.rpnNotifyExtrasAdded(); } clearInterval(_root.bonusIntervalId); _root.bonusesGiven = true; } function dragonDefeatedAfterEffect() { var v2 = _root.getReggedStageMC(); v2.attachMovie('end_game_mc', 'dummy', 15000); v2.swapDepths(15000); v2._x = -23.6; v2._y = -52.1; } function rpnInitTimer() { _root.timer_green_bg_mc = _root.getReggedStageMC(); _root.timer_green_bg_mc.swapDepths(18702); with (_root.timer_green_bg_mc) { attachMovie('timer_green_bg_mc', 'movie', 18702); _x = 503; _y = 63; } _root.timer_mask_mc = _root.getReggedStageMC(); _root.timer_mask_mc.swapDepths(18701); with (_root.timer_mask_mc) { attachMovie('timer_mask_mc', 'movie', 18701); _x = 503; _y = 63; } _root.timer_green_bg_mc.setMask(_root.timer_mask_mc); _root.mainTimer = new cpiTimer(_root.timer_mask_mc); var timerLength = Math.min(120 + 4 * _root.currentLevel, 240) * 1000; _root.mainTimer.startTimer(timerLength); _root.mainTimer.suspendTimer(); _root.timer_mc = _root.getReggedStageMC(); _root.timer_mc.swapDepths(18700); with (_root.timer_mc) { attachMovie('timer_bg_mc', 'movie', 18700); _x = 503; _y = 63; } } function rpnHandleGameLost() { inGame = false; _root.endTutorial(); _root.mainTable.deactivate(); _root.mainDeck.deactivate(); _root.mainExtras.deactivate(); DeactivateDeal(); _root.menu_mc.onRelease = undefined; _root.menu_mc.enabled = false; _root.mainDeck.unsetExtras(); _root.mainTimer.suspendTimer(); _root.rpnPlayBGMusic(undefined); _root.dragon_mc.swapDepths(22000); if (_root.currentLevel <= 30) { _root.dragon_mc.movie.gotoAndPlay(2); } else { _root.raiseGameOverSign(); } } function raiseGameOverSign() { _root.playSequencedSound('Game Over', _root.moveToBGMusic); if (_root.currentLevel <= 30) { _root.setInstructionsColor(7672066, 14); _root.rpnSetTextMessage('The ring was not strong enough to stop the dragon and you have been incinerated...\n'); _root.playSound('New Message'); } _root.setInstructionsColor(1510, 30); _root.rpnAddTextMessage('Game Over\n'); _root.setInstructionsColor(1510, 14); _root.rpnAddTextMessage('Click anywhere to continue\n'); _root.onMouseUp = rpnLostClick; } function raiseGameWonSign() { _root.victory_mc.movie.play(); _root.playSound('Ring Complete'); _root.instructions_txt.text = ''; _root.instructions_txt.filters = filter; _root.setInstructionsColor(622336, 18, true); _root.rpnSetTextMessage('\n'); _root.setWonColor(); _root.won_this_round_txt._visible = true; _root.playSound('New Message'); if (!_root.lastGameWasTutorial) { _root.bonusIntervalId = setInterval(rpnHandleBonuses, 1000); } else { trace('No bonuses for tutorial'); _root.rpnNotifyExtrasAdded(); _root.bonusesGiven = true; } } function moveToBGMusic() { _root.rpnPlayBGMusic('background_music'); } function moveToGameMusic() { _root.rpnPlayBGMusic('game_music'); } function rpnDealClicked() { _root.playSound('button1.wav'); _root.tutorialNotifyDealClicked(); if (!_root.rpnGameOver()) { _root.handleDealClickGameNotOver(); return undefined; } if (_root.lastGameWasTutorial) { _root.mainExtras.reset(); _root.rpnNewGame(1, 0, false); return undefined; } if (_root.rpnGameWon()) { _root.baseScore += Number(_root.points_txt.text); ++_root.currentLevel; _root.rpnNewGame(_root.currentLevel, _root.baseScore); return undefined; } if (!_root.highScoresUpdated) { if (_root.handleHighScoresUpdate()) { return undefined; } } _root.mainExtras.reset(); _root.jumpToEntry(); } function setInstructionsColor(color, size, isBold, letterSpacing) { if (isBold == undefined) { isBold = true; } if (letterSpacing == undefined) { letterSpacing = 0; } var v2 = new TextFormat(); v2.font = 'Calligraphic'; v2.bold = isBold; v2.size = size; v2.letterSpacing = letterSpacing; var v3 = _root.instructions_txt; v2.color = color; v3.setNewTextFormat(v2); v3.sharpness = 0; v3.antiAliasType = 'advanced'; v3.selectable = false; v3.embedFonts = true; } function setWonColor() { color = 622336; size = 18; bold = true; if (isBold == undefined) { isBold = true; } if (letterSpacing == undefined) { letterSpacing = 0; } var v2 = new TextFormat(); v2.font = 'Calligraphic'; v2.bold = isBold; v2.size = size; v2.letterSpacing = letterSpacing; var v3 = _root.instructions_txt; v2.color = color; v3.setNewTextFormat(v2); v3.sharpness = 0; v3.antiAliasType = 'advanced'; v3.selectable = false; v3.embedFonts = true; } function setTipColor(color, size) { var v2 = new TextFormat(); v2.font = 'Calligraphic'; v2.bold = true; v2.size = size; v2.letterSpacing = 0; var v3 = _root.tips_box.movie.tip_txt; v2.color = color; v3.setNewTextFormat(v2); v3.sharpness = 0; v3.antiAliasType = 'advanced'; v3.selectable = false; v3.embedFonts = true; } function rpnAddTextMessage(msg) { if (_root.currentLevel == 0) { return undefined; } _root.textIsIntstruction = false; _root.instructions_txt.replaceText(10000, 10000, msg); } function rpnSetTextMessage(msg) { if (_root.currentLevel == 0) { return undefined; } _root.textIsInstruction = false; _root.instructions_txt.text = msg; } function rpnSetInstructionTextMessage(msg) { if (_root.currentLevel == 0) { return undefined; } _root.textIsInstruction = true; _root.instructions_txt.text = msg; } function updateInstructionInWindow() { if (!_root.textIsInstruction) { _root.currInstructionIdx = 0; } var v2 = _root.currInstructionIdx + 1; var v3 = _root.getInstruction(v2 - 1); if (v3 == undefined) { _root.currInstructionIdx = 0; updateInstructionInWindow(); return undefined; } _root.setInstructionsColor(7672066, 14); rpnSetInstructionTextMessage(v2 + '. ' + v3); ++_root.currInstructionIdx; } function DeactivateDeal() { _root.deal_mc.onPress = undefined; } function ActivateDeal() { _root.deal_mc.onPress = _root.rpnDealClicked; } function rpnNotifyExtrasAdded() { if (_root.rpnGameOver()) { if (_root.currentLevel == 30) { var v2 = _root.getReggedStageMC(); v2.attachMovie('end_game_mc', 'dummy', 15000); v2.swapDepths(15000); v2._x = -25.5; v2._y = -51; } _root.deal_mc.onPress = undefined; if (_root.currentLevel < 30) { _root.onMouseUp = _root.rpnDealClicked; } else { _root.onMouseUp = _root.rpnNextRoundAfter30; } } else { _root.mainTable.activate(); _root.mainDeck.activate(); _root.mainExtras.activate(); _root.mainTimer.resumeTimer(); _root.menu_mc.onRelease = rpnMenuReleased; _root.menu_mc.enabled = true; _root.deal_mc.enabled = true; _root.tip_btn.enabled = true; ActivateDeal(); } } function rpnLoadQuestScreen(level) { _root.mainTable.deactivate(); _root.mainDeck.deactivate(); _root.mainExtras.deactivate(); _root.tip_btn.enabled = false; if (level == undefined) { level = _root.currentLevel; } _root.quest_screen_mc = _root.getReggedStageMC(); _root.quest_screen_mc.attachMovie('quest_screen_mc', 'dummy', 23000); _root.quest_screen_mc.swapDepths(23000); _root.quest_screen_mc._x = 0; _root.quest_screen_mc._y = 0; var v7 = 106; var v9 = 320; var v8 = 214; var v2 = 1; while (v2 <= 30) { var v3 = _root.quest_screen_mc.attachMovie('circle_mc', 'sand_circle' + v2, 23000 + v2); var v5 = 0.1903995547630177; var v4 = v2 * v5; if (v2 > 10) { v4 += v5; } if (v2 > 20) { v4 += v5; } v3._x = v9 + v7 * Math.sin(v4); v3._y = v8 - v7 * Math.cos(v4); if (v2 < level) { v3.gotoAndStop('big'); } if (v2 > level) { v3.gotoAndStop('small'); } if (v2 == level) { v3.gotoAndPlay('small'); } ++v2; } var v10 = new mx.transitions.Tween(_root.quest_screen_mc, '_alpha', mx.transitions.easing.Regular.easeIn, 0, 100, 1, 1); v10.onMotionFinished = function () { _root.quest_screen_mc.dummy.next_quest_txt.text = _root.quest_screen_mc.next_txt; }; } function rpnNextRound() { rpnNewGame(_root.currentLevel, _root.baseScore, true); } function rpnNextRoundAfter30() { _root.baseScore += Number(_root.points_txt.text); ++_root.currentLevel; rpnNextRound(); } function rpnLostClick() { _root.onMouseUp = undefined; _root.rpnDealClicked(); } function rpnStopSynergies(remove) { var i = 1; while (i <= 8) { var li = (i == 8) ? 1 : i + 1; var synergyName = 'synergy' + i + li + '_mc'; var synergy = eval('_root.' + synergyName); synergy.gotoAndStop(1); synergy.running = false; var barName = 'bar' + i + li + '_mc'; var bar = eval('_root.' + barName); bar.gotoAndStop(1); bar.running = false; bar._visible = false; if (remove == true) { removeMovieClip(synergy); removeMovieClip(bar); } ++i; } } function rpnMenuReleased() { if (_root.gameMenu_mc != undefined) { return undefined; } _root.playSound('button1.wav'); if (_root.rpnGameOver()) { if (_root.handleHighScoresUpdate()) { return undefined; } } _root.inGameMenuDisabled = false; _root.mainTable.deactivate(); _root.mainDeck.deactivate(); _root.mainExtras.deactivate(); _root.DeactivateDeal(); _root.mainTimer.suspendTimer(); _root.menu_mc.enabled = false; _root.deal_mc.enabled = false; _root.tip_btn.enabled = false; _root.gameMenu_mc = _root.getReggedStageMC(); var v2 = _root.gameMenu_mc; v2.swapDepths(21000); v2.attachMovie('inGameMenu_mc', 'movie', 21000); v2._x = 0; v2._y = 0; _root.setFadein(v2, 10); } function startTutorial() { tutorialStage = -1; tutorialIsRunning = true; _root.mainTable.deactivate(); _root.mainDeck.deactivate(); _root.mainExtras.deactivate(); _root.DeactivateDeal(); _root.lastGameWasTutorial = true; } function endTutorial() { tutorialIsRunning = false; } function tutorialStartGame() { endTutorial(); setTutorialTextMessage(''); _root.rpnNewGame(1, 0, false); } function tutorialOKClicked() { var v2 = tutorialUntils[tutorialStage]; if (v2 == seconds10) { ++tutorialStage; beginTutorialStage(); } else { setTutorialTextMessage(_root.tutorial_txt.text); } } function advanceTutorial() { if (oneTileRemaining() && tutorialStage < 12) { tutorialStage = 12; beginTutorialStage(); advanceTutorial(); return undefined; } if (tutorialStage < 0 || tutorialUntils[tutorialStage]()) { ++tutorialStage; beginTutorialStage(); advanceTutorial(); } } function beginTutorialStage() { tutorialBegins[tutorialStage](); setTutorialTextMessage(tutorialMessages[tutorialStage]); } function isTutorialRunning() { return tutorialIsRunning; } function isTutorialDone() {} function ringNotEmpty() { return !_root.mainTable.isEmpty(); } function stage1begin() { _root.mainTable.activate(); _root.mainDeck.activate(); _root.mainExtras.deactivate(); _root.menu_mc.enabled = false; } function twoNeighbouringTiles() { var v2 = 1; while (v2 <= 8) { var v4 = _root.mainTable.getCard(v2); var v3 = _root.mainTable.getCard(v2 < 8 ? v2 + 1 : 1); if (v4 != undefined && v3 != undefined) { return true; } ++v2; } return false; } function twoTilesFit() { return _root.mainTable.getScore() > 0; } function beginTutorialTimer() { tutorialTimer = getTimer(); } function seconds10() { return getTimer() - tutorialTimer > 10000; } function resetDealClicked() { tutorialDealClicked = false; _root.ActivateDeal(); _root.mainTable.deactivate(); _root.mainDeck.deactivate(); _root.mainExtras.deactivate(); } function tutorialNotifyDealClicked() { tutorialDealClicked = true; } function dealIsPressed() { if (tutorialDealClicked) { _root.mainTable.activate(); _root.mainDeck.activate(); } return tutorialDealClicked; } function enableExtraDeals() { _root.mainExtras.activate(); tutorialExtraDealClicked = false; _root.addExtraDeals(4, 2); _root.addExtraBonuses('red_bomb', 1); _root.addExtraBonuses('switch', 1); } function tutorialNotifyExtraDealClicked() { tutorialExtraDealClicked = true; } function extraDeal4CardPressed() { _root.mainTable.deactivate(); _root.mainDeck.deactivate(); _root.menu_mc.enabled = false; if (tutorialExtraDealClicked) { _root.mainTable.activate(); _root.mainDeck.activate(); } return tutorialExtraDealClicked; } function addConstraint() { var v2 = 1; while (v2 <= 8) { if (_root.mainTable.getCard(v2) != undefined) { } else { _root.mainTable.setConstraint(v2, 'color'); break; } ++v2; } beginTutorialTimer(); } function ringIsComplete() { return _root.mainTable.isFull(); } function gameWon() { return _root.mainTable.getScore() == 48; } function never() { return false; } function startGame() { endTutorial(); } function setTutorialTextMessage(msg) { setTutorialColor(16777130, 20); _root.tutorial_txt.text = msg; var v2 = 20; while (_root.tutorial_txt.maxscroll > 1) { v2 -= 2; setTutorialColor(16777130, v2); _root.tutorial_txt.text = msg; } new mx.transitions.Tween(_root.tutorial_txt, '_alpha', mx.transitions.easing.None.easeIn, 40, 100, 0.5, 1); } function setTutorialColor(color, size) { var v2 = new TextFormat(); v2.font = 'Calligraphic'; v2.bold = true; v2.size = size; v2.letterSpacing = 0; var v3 = _root.tutorial_txt; v2.color = color; v3.setNewTextFormat(v2); v3.sharpness = 0; v3.antiAliasType = 'advanced'; v3.selectable = false; v3.embedFonts = true; } function oneTileRemaining() { return _root.mainTable.filledSlotsNum() == 7; } function checkNoCurrentTile() { return _root.currentTile() == undefined; } function jumpToGame() { trace(_root.classic_btn); trace(_root.classic_btn.enabled); _root.classic_btn.enabled = false; _root.survival_btn.enabled = false; _root.menu_text_highlight_mc.removeMovieClip('movie'); gotoAndPlay(6); } var nextAvailableDepth; var nonReggedMCs; var genColorPerLevel = new Array(0, 1, 0, 1, 2, 0, 0, 1, 1, 0, 1, 1, 1, 2, 1, 0, 1, 0, 0, 1, 2, 1, 1, 0, 2, 2, 1, 2, 1, 2); var genShapePerLevel = new Array(0, 0, 1, 1, 0, 1, 0, 1, 1, 1, 0, 1, 1, 0, 0, 1, 1, 1, 0, 2, 0, 1, 1, 2, 2, 2, 3, 1, 2, 2); var spcColorPerLevel = new Array(0, 0, 0, 0, 0, 1, 1, 1, 0, 2, 0, 1, 2, 0, 2, 1, 1, 2, 2, 2, 2, 2, 1, 1, 2, 1, 1, 2, 1, 2); var spcShapePerLevel = new Array(0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 2, 1, 0, 2, 1, 2, 2, 2, 3, 1, 2, 2, 3, 3, 1, 2, 2, 2, 3, 2); var advGenColorPerLevel = new Array(1, 1, 0, 1, 1, 1, 1, 2, 1, 1, 0, 2, 1, 0, 1, 0, 0, 2, 1, 2, 1, 0, 3, 2, 2, 1, 1, 3, 2, 2); var advGenShapePerLevel = new Array(1, 1, 1, 0, 0, 1, 1, 0, 0, 0, 1, 0, 1, 1, 0, 1, 1, 1, 1, 0, 1, 2, 1, 1, 1, 2, 2, 1, 2, 2); var advSpcColorPerLevel = new Array(1, 0, 2, 0, 1, 1, 2, 0, 2, 1, 1, 2, 1, 1, 3, 2, 1, 2, 1, 2, 1, 1, 2, 1, 3, 2, 1, 3, 3, 2); var advSpcShapePerLevel = new Array(0, 1, 0, 2, 1, 1, 0, 2, 1, 1, 2, 1, 2, 2, 1, 2, 3, 1, 2, 2, 3, 3, 1, 2, 1, 2, 3, 1, 1, 2); var colorsArray = new Array('yellow', 'green', 'blue', 'red'); var shapesArray = new Array('stella', 'luna', 'sol', 'terra'); var synergiesSet; var tips = new Array('One ping means the tile you used fits an adjacent tile.', 'Two pings mean the tile you used fits the tiles on both sides.', 'If you put a tile next to another and see smoke comes out - the tiles don\'t fit.', 'Extra deals differ in size. You can get a 2 cards, a 3 cards or a 4 cards extra deal.', 'You can place together two tiles that don\'t fit, but make sure everything fits when you put the last tile in the ring.', 'Color quadruples harmonic set is a set where there\'s an equal number of each color in the ring.', 'Double double harmonic set is a set where there are at least two of each color and two of each symbol.', 'Double triples harmonic set is a set where there are at least three of each color and three of each symbol.', 'Symbol quadruples harmonic set is a set where there\'s an equal number of each symbol in the ring.', 'Starting in level 10 you get transform tools every 5 levels. These tools allow you to change tiles to a specific color or symbol.', 'When you complete the 30th ring you defeat the dragon. You can go on playing for a personal record.', 'After level 30 you get one random transform tool each level.'); var instructions = new Array('Try to fit the tiles in the ring matching either color or symbol and complete a full magic circle.', 'Use the cards that were dealt to the four slots on your left. Press "deal" when you can\'t use the ones already in the slots.', 'After exhausting the 4 standard deals you have in one round try using the extra deals to survive a tricky ring.', 'Once a tile is inside the ring you can not drag it back to the slot.', 'You can move a tile that is already in the ring to another place in the ring, unless a Limiter is preventing this.', 'A cracked slot can not contain cards (not including extra deals).', 'Eight tiles make a set - a complete magic ring that can prevent the dragon from burning you.', 'Each tile has two sides - left and right. Each side has one color and one symbol.', 'There are four symbols: Luna (moon), Terra (earth), Sol (sun) and Stella (star), and four colors: Red, Green, Yellow and Blue.', 'Creating special combinations of tiles will get you bonus points and bonus tools.', '"Harmonic sets" are special combinations of tiles, where all colors or all symbols are equally represented.', '"Pool sets" are sets with large amounts of one color or symbol.', 'The first Limiter appears in the second round. it looks like a pizza Limiter with the word "Color" on it.', 'The "Color" Limiter prevents you from matching next to it two tiles that don\'t have a matching color.', 'As you advance in level, the number of Limiters grows and they become more specific.'); var mainTable; var mainDeck; var mainExtras; var tileOriginalLocation; var inGame = false; var dragon_mc; var victory_mc; var wizard_wand_mc; var text_highlight_mc; var tips_box; var lastDealWarningIssued = false; var tutorialMode = true; var tutorialStage = -1; var tutorialIsRunning = false; var tutorialTimer; var tutorialDealClicked = false; var tutorialExtraDealClicked = false; var tutorialMessages = new Array('Pick a tile from the slot and put it anywhere in the ring.', 'Good! Now pick another tile and put it in the ring next to the first tile. Try to fit either color or symbol.', 'These tiles don’t fit each other. You can put them next to each other now, but when you fill the ring with tiles a wrong match will make the magic circle fail and you will lose the game…', 'Very good! Completing a full ring where adjacent tiles fit each other will protect you from the dragon’s breath.', '', 'When you have no use for the current tiles press the “Deal” button. You will get new tiles but each press of the button decreases the amount of tiles in the slots.', 'Great! You have 4 standard deals each round so you can use the “Deal” button 2 more times.', '', 'If the 4 standard deals are not enough you can use the “Extra Deals” in the bonus toolbox. Press the 4 card extra deal and see what happens.', 'The “Extra Deal” bonuses and other tools can be used when you have a tough ring that you just cannot complete with only the standard deals.', 'You can see what other bonus tools do by moving the mouse over them.', 'When you see a triangle inside the ring it means you are somehow limited. This is a “Color” limiter. The two tiles that touch it must match in color. ', '', 'One more tile to go! Don\'t forget to make sure all the tiles match, so the ring will be strong enough to protect you.', 'This time the dragon got you… You can press "OK" and test your skill starting your first real ring!', 'Congratulations! You have completed a full ring preventing the dragon’s breath from reaching you!', 'You now know pretty much everything you need to start playing the game. Press “OK” to start the 1st ring of the classic mode.'); var tutorialBegins = new Array(stage1begin, undefined, undefined, beginTutorialTimer, undefined, resetDealClicked, beginTutorialTimer, undefined, enableExtraDeals, beginTutorialTimer, beginTutorialTimer, addConstraint, undefined, undefined, undefined, undefined, beginTutorialTimer); var tutorialUntils = new Array(ringNotEmpty, twoNeighbouringTiles, twoTilesFit, seconds10, checkNoCurrentTile, dealIsPressed, seconds10, checkNoCurrentTile, extraDeal4CardPressed, seconds10, seconds10, undefined, oneTileRemaining, ringIsComplete, gameWon, seconds10, never); _root.inGameScene = false; _root.onEnterFrame = function () { Mouse.hide(); }; if (_root.bgMusicEnabled == undefined) { _root.tutorialAlreadyPlayed = undefined; _root.bgMusicEnabled = true; _root.bgSoundsEnabled = true; _root.fullscreenEnabled = false; } _root.rpnPlayBGMusic('background_music'); _root.loadMouse(); _root.menusDisabled = false; _root.newHighscore = false; _root.menu_text_highlight_mc = _root.getReggedStageMC(); _root.menu_text_highlight_mc.attachMovie('Menu Text Highlight', 'movie', _root.getNextDepth()); _root.menu_text_highlight_mc._x = 0; _root.menu_text_highlight_mc._y = 0; _root.menu_text_highlight_mc.movie.gotoAndStart('start'); _root.classic_btn.enabled = true; _root.survival_btn.enabled = true; _root.instructions_btn.enabled = true; _root.powerups_btn.enabled = true; _root.options_btn.enabled = true; _root.highscores_btn.enabled = true; _root.credits_btn.enabled = true; _root.quit_btn.enabled = true; _root.currentLevel = 1; _root.baseScore = 0; fscommand('showmenu', false); stop(); } button 977 { on (release) { if (_root.menusDisabled) { return undefined; } _root.playSound('button1.wav'); fscommand('quit'); } } button 980 { on (release) { if (_root.menusDisabled) { return undefined; } _root.menu_text_highlight_mc.unloadMovie(); _root.playSound('button1.wav'); _root.gotoAndStop('instructions'); } } button 983 { on (release) { if (_root.menusDisabled) { return undefined; } _root.menu_text_highlight_mc.unloadMovie(); _root.playSound('button1.wav'); _root.gotoAndStop('powerups'); } } button 986 { on (release) { if (_root.menusDisabled) { return undefined; } _root.menusDisabled = true; _root.playSound('button1.wav'); _root.optionsMenu_mc = _root.getReggedStageMC(); _root.optionsMenu_mc.attachMovie('optionsMenu_mc', 'movie', _root.getNextDepth()); _root.optionsMenu_mc._x = 90; _root.optionsMenu_mc._y = 228.3; _root.optionsMenu_mc = _root.optionsMenu_mc.movie; _root.optionsMenu_mc.soundEnabled_mc._alpha = _root.bgSoundsEnabled ? 100 : 0; _root.optionsMenu_mc.musicEnabled_mc._alpha = _root.bgMusicEnabled ? 100 : 0; } } button 989 { on (release) { if (_root.menusDisabled) { return undefined; } _root.menu_text_highlight_mc.unloadMovie(); _root.playSound('button1.wav'); _root.gotoAndStop('highscore'); } } button 992 { on (release) { if (_root.menusDisabled) { return undefined; } _root.menu_text_highlight_mc.unloadMovie(); _root.playSound('button1.wav'); _root.gotoAndStop('credits'); } } button 996 { on (release) { _root.classic_btn.enabled = false; _root.survival_btn.enabled = false; _root.instructions_btn.enabled = false; _root.powerups_btn.enabled = false; _root.options_btn.enabled = false; _root.highscores_btn.enabled = false; _root.credits_btn.enabled = false; _root.quit_btn.enabled = false; _root.specialDebugMode = undefined; _root.gameMode = 'basic'; if (_root.tutorialPlayed == undefined) { _root.tutorialPlayed = true; _root.playSequencedSound('button1.wav', _root.jumpToGame); } else { _root.rpnLoadQuestScreen(1); } } } button 1000 { on (release) { _root.classic_btn.enabled = false; _root.survival_btn.enabled = false; _root.instructions_btn.enabled = false; _root.powerups_btn.enabled = false; _root.options_btn.enabled = false; _root.highscores_btn.enabled = false; _root.credits_btn.enabled = false; _root.quit_btn.enabled = false; _root.specialDebugMode = undefined; _root.gameMode = 'survival'; _root.playSound('button1.wav'); _root.rpnLoadQuestScreen(1); } } movieClip 1051 __Packages.mx.transitions.OnEnterFrameBeacon { #initclip if (!_global.mx) { _global.mx = new Object(); } if (!_global.mx.transitions) { _global.mx.transitions = new Object(); } if (!_global.mx.transitions.OnEnterFrameBeacon) { var v1 = function () {}; mx.transitions.OnEnterFrameBeacon = v1; var v2 = v1.prototype; v1.init = function () { var v4 = _global.MovieClip; if (!_root.__OnEnterFrameBeacon) { mx.transitions.BroadcasterMX.initialize(v4); var v3 = _root.createEmptyMovieClip('__OnEnterFrameBeacon', 9876); v3.onEnterFrame = function () { _global.MovieClip.broadcastMessage('onEnterFrame'); }; } }; v1.version = '1.1.0.52'; ASSetPropFlags(mx.transitions.OnEnterFrameBeacon.prototype, null, 1); } #endinitclip } movieClip 1052 __Packages.mx.transitions.BroadcasterMX { #initclip if (!_global.mx) { _global.mx = new Object(); } if (!_global.mx.transitions) { _global.mx.transitions = new Object(); } if (!_global.mx.transitions.BroadcasterMX) { var v1 = function () {}; mx.transitions.BroadcasterMX = v1; var v2 = v1.prototype; v1.initialize = function (o, dontCreateArray) { if (o.broadcastMessage != undefined) { delete o.broadcastMessage; } o.addListener = mx.transitions.BroadcasterMX.prototype.addListener; o.removeListener = mx.transitions.BroadcasterMX.prototype.removeListener; if (!dontCreateArray) { o._listeners = new Array(); } }; v2.addListener = function (o) { this.removeListener(o); if (this.broadcastMessage == undefined) { this.broadcastMessage = mx.transitions.BroadcasterMX.prototype.broadcastMessage; } return this._listeners.push(o); }; v2.removeListener = function (o) { var v2 = this._listeners; var v3 = v2.length; while (v3--) { if (v2[v3] == o) { v2.splice(v3, 1); if (!v2.length) { this.broadcastMessage = undefined; } return true; } } return false; }; v2.broadcastMessage = function () { var v5 = String(arguments.shift()); var v4 = this._listeners.concat(); var v6 = v4.length; var v3 = 0; while (v3 < v6) { v4[v3][v5].apply(v4[v3], arguments); ++v3; } }; v1.version = '1.1.0.52'; ASSetPropFlags(mx.transitions.BroadcasterMX.prototype, null, 1); } #endinitclip } movieClip 1053 __Packages.mx.transitions.Tween { #initclip if (!_global.mx) { _global.mx = new Object(); } if (!_global.mx.transitions) { _global.mx.transitions = new Object(); } if (!_global.mx.transitions.Tween) { var v1 = function (obj, prop, func, begin, finish, duration, useSeconds) { mx.transitions.OnEnterFrameBeacon.init(); if (!arguments.length) { return undefined; } this.obj = obj; this.prop = prop; this.begin = begin; this.__set__position(begin); this.__set__duration(duration); this.useSeconds = useSeconds; if (func) { this.func = func; } this.__set__finish(finish); this._listeners = []; this.addListener(this); this.start(); }; mx.transitions.Tween = v1; var v2 = v1.prototype; v2.__set__time = function (t) { this.prevTime = this._time; if (t > this.__get__duration()) { if (this.looping) { this.rewind(t - this._duration); this.update(); this.broadcastMessage('onMotionLooped', this); } else { if (this.useSeconds) { this._time = this._duration; this.update(); } this.stop(); this.broadcastMessage('onMotionFinished', this); } } else { if (t < 0) { this.rewind(); this.update(); } else { this._time = t; this.update(); } } return this.__get__time(); }; v2.__get__time = function () { return this._time; }; v2.__set__duration = function (d) { this._duration = (d == null || d <= 0) ? _global.Infinity : d; return this.__get__duration(); }; v2.__get__duration = function () { return this._duration; }; v2.__set__FPS = function (fps) { var v2 = this.isPlaying; this.stopEnterFrame(); this._fps = fps; if (v2) { this.startEnterFrame(); } return this.__get__FPS(); }; v2.__get__FPS = function () { return this._fps; }; v2.__set__position = function (p) { this.setPosition(p); return this.__get__position(); }; v2.setPosition = function (p) { this.prevPos = this._pos; this._pos = p; this.obj[this.prop] = this._pos; this.broadcastMessage('onMotionChanged', this, this._pos); updateAfterEvent(); }; v2.__get__position = function () { return this.getPosition(); }; v2.getPosition = function (t) { if (t == undefined) { t = this._time; } return this.func(t, this.begin, this.change, this._duration); }; v2.__set__finish = function (f) { this.change = f - this.begin; return this.__get__finish(); }; v2.__get__finish = function () { return this.begin + this.change; }; v2.continueTo = function (finish, duration) { this.begin = this.position; this.__set__finish(finish); if (duration != undefined) { this.__set__duration(duration); } this.start(); }; v2.yoyo = function () { this.continueTo(this.begin, this.__get__time()); }; v2.startEnterFrame = function () { if (this._fps == undefined) { _global.MovieClip.addListener(this); } else { this._intervalID = setInterval(this, 'onEnterFrame', 1000 / this._fps); } this.isPlaying = true; }; v2.stopEnterFrame = function () { if (this._fps == undefined) { _global.MovieClip.removeListener(this); } else { clearInterval(this._intervalID); } this.isPlaying = false; }; v2.start = function () { this.rewind(); this.startEnterFrame(); this.broadcastMessage('onMotionStarted', this); }; v2.stop = function () { this.stopEnterFrame(); this.broadcastMessage('onMotionStopped', this); }; v2.resume = function () { this.fixTime(); this.startEnterFrame(); this.broadcastMessage('onMotionResumed', this); }; v2.rewind = function (t) { this._time = (t == undefined) ? 0 : t; this.fixTime(); this.update(); }; v2.fforward = function () { this.__set__time(this._duration); this.fixTime(); }; v2.nextFrame = function () { if (this.useSeconds) { this.__set__time((getTimer() - this._startTime) / 1000); } else { this.__set__time(this._time + 1); } }; v2.onEnterFrame = function () { this.nextFrame(); }; v2.prevFrame = function () { if (!this.useSeconds) { this.__set__time(this._time - 1); } }; v2.toString = function () { return '[Tween]'; }; v2.fixTime = function () { if (this.useSeconds) { this._startTime = getTimer() - this._time * 1000; } }; v2.update = function () { this.__set__position(this.getPosition(this._time)); }; v1.version = '1.1.0.52'; v1.__initBeacon = mx.transitions.OnEnterFrameBeacon.init(); v1.__initBroadcaster = mx.transitions.BroadcasterMX.initialize(mx.transitions.Tween.prototype, true); v2.func = function (t, b, c, d) { return c * t / d + b; }; v2.addProperty('FPS', v2.__get__FPS, v2.__set__FPS); v2.addProperty('duration', v2.__get__duration, v2.__set__duration); v2.addProperty('finish', v2.__get__finish, v2.__set__finish); v2.addProperty('position', v2.__get__position, v2.__set__position); v2.addProperty('time', v2.__get__time, v2.__set__time); ASSetPropFlags(mx.transitions.Tween.prototype, null, 1); } #endinitclip } movieClip 1054 __Packages.mx.transitions.easing.Regular { #initclip if (!_global.mx) { _global.mx = new Object(); } if (!_global.mx.transitions) { _global.mx.transitions = new Object(); } if (!_global.mx.transitions.easing) { _global.mx.transitions.easing = new Object(); } if (!_global.mx.transitions.easing.Regular) { var v1 = function () {}; mx.transitions.easing.Regular = v1; var v2 = v1.prototype; v1.easeIn = function (t, b, c, d) { t /= d; return c * t * t + b; }; v1.easeOut = function (t, b, c, d) { t /= d; return -c * t * (t - 2) + b; }; v1.easeInOut = function (t, b, c, d) { t /= d / 2; if (t < 1) { return (c / 2) * t * t + b; } return (-c / 2) * (--t * (t - 2) - 1) + b; }; v1.version = '1.1.0.52'; ASSetPropFlags(mx.transitions.easing.Regular.prototype, null, 1); } #endinitclip } movieClip 1055 __Packages.rpnExtraDeals { #initclip if (!_global.rpnExtraDeals) { var v1 = function (basex, basey, right_bounds, row_bounds) { this.mX = basex; this.mY = basey; this.mWidth = 16; this.mHeight = 16; this.mRightBounds = right_bounds; this.mRowBounds = row_bounds; this.mNextExtra = 0; this.mDeals = new Array(); this.mNextAdds = new Array(); this.mActive = true; }; _global.rpnExtraDeals = v1; var v2 = v1.prototype; v2.addNext = function (dontShift) { if (dontShift != true) { this.mNextAdds.shift(); } if (this.mNextAdds.length == 0) { _root.rpnNotifyExtrasAdded(); return undefined; } var v3 = this.mNextAdds[0]; this.add(v3.type, 1, v3.onPressAction, v3.tip, v3.extraInfo, true); }; v2.add = function (type, times, onPressAction, tip, extraInfo, force) { var v11 = this.mNextAdds.length > 0; while (times > 0) { if (force != true) { var v4 = new Object(); v4.type = type; v4.onPressAction = onPressAction; v4.tip = tip; v4.extraInfo = extraInfo; this.mNextAdds.push(v4); --times; continue; } var v3 = new Object(); v3.icon = _root.getReggedStageMC(); v3.icon.swapDepths(15500); v3.icon.attachMovie(type, 'nm' + this.mNextExtra, _root.getNextDepth()); v3.idx = this.mDeals.length; v3.type = type; v3.tip = tip; v3.extraInfo = extraInfo; v3.onPressAction = onPressAction; v3.icon.idx = v3.idx; v3.icon.tip = v3.tip; v3.icon.onPress = undefined; v3.icon.onRollOver = undefined; v3.icon.onRollOut = undefined; _root.playSound('Bonus Ping'); this.setLocation(v3); this.mDeals.push(v3); ++this.mNextExtra; --times; } if (!v11) { this.addNext(true); } }; v2.refresh = function () { var v4 = 0; while (v4 < this.mDeals.length) { var v3 = this.mDeals[v4]; v3.icon = _root.getReggedStageMC(); v3.icon.attachMovie(v3.type, 'nm' + this.mNextExtra, _root.getNextDepth()); v3.icon.idx = v3.idx; v3.icon.tip = v3.tip; v3.icon.onPress = v3.onPressAction; v3.icon.onRollOver = _root.extraDealMO; v3.icon.onRollOut = _root.extraDealMOut; v3.icon['nm' + this.mNextExtra].gotoAndStop(v3.icon['nm' + this.mNextExtra]._totalframes); this.setLocation(v3); ++this.mNextExtra; ++v4; } }; v2.reset = function () { while (this.mDeals.length > 0) { this.remove(this.mDeals.length - 1); } }; v2.deactivate = function () { this.mActive = false; var v3 = 0; while (v3 < this.mDeals.length) { var v2 = this.mDeals[v3]; v2.icon.onPress = undefined; v2.icon.onRollOver = undefined; v2.icon.onRollOut = undefined; ++v3; } }; v2.activate = function () { this.mActive = true; var v4 = 0; while (v4 < this.mDeals.length) { var v3 = this.mDeals[v4]; v3.icon.onPress = v3.onPressAction; v3.icon.onRollOver = _root.extraDealMO; v3.icon.onRollOut = _root.extraDealMOut; ++v4; } }; v2.remove = function (idx) { var v4 = new Array(); var v3 = 0; while (v3 < this.mDeals.length) { var v2 = this.mDeals[v3]; if (v3 == idx) { v2.icon.removeMovieClip(); } else { v2.idx = v4.length; v2.icon.idx = v2.idx; this.setLocation(v2); v4.push(v2); } ++v3; } this.mDeals = v4; }; v2.setLocation = function (new_mc) { var v3 = new_mc.idx; var v2 = 0; var v5 = new_mc.icon; var v4 = this.mWidth + 2; while (this.mX + (this.mWidth + 2) * (v3 + 1) > this.mRightBounds[v2]) { if (this.mRightBounds.length <= v2 + 1) { break; } v3 -= Math.floor((this.mRightBounds[v2] - this.mX) / v4); ++v2; } v5._y = this.mRowBounds[v2]; v5._x = this.mX + v4 * v3; }; v2.getExtraInfo = function (idx) { return this.mDeals[idx].extraInfo; }; ASSetPropFlags(_global.rpnExtraDeals.prototype, null, 1); } #endinitclip } movieClip 1056 __Packages.cpiTimer { #initclip if (!_global.cpiTimer) { var v1 = function (timer_mask_mc) { this.mTimerMask_mc = timer_mask_mc; this.mOrigTimerHeight = this.mTimerMask_mc._height; this.mOrigTimerY = this.mTimerMask_mc._y; }; _global.cpiTimer = v1; var v2 = v1.prototype; v2.startTimer = function (time) { this.mTotalTime = time; this.mRemainingTime = time; this.mTimeElapsed = 0; this.mLastSampledTime = getTimer(); this.mStopped = false; this.updateTime(); }; v2.suspendTimer = function () { this.mStopped = true; }; v2.resumeTimer = function () { this.mStopped = false; }; v2.updateTime = function () { if (this.mStopped) { this.mLastSampledTime = getTimer(); return undefined; } var v3 = getTimer(); var v4 = v3 - this.mLastSampledTime; if (this.mTotalTime - this.mTimeElapsed > 10000 && this.mTotalTime - this.mTimeElapsed - v4 <= 10000) { _root.rpnPlayBGMusic('Timer'); } this.mTimeElapsed += v4; this.mLastSampledTime = v3; this.mTimerMask_mc._height = this.mOrigTimerHeight * (1 - this.mTimeElapsed / this.mTotalTime); this.mTimerMask_mc._y = this.mOrigTimerY + this.mOrigTimerHeight - this.mTimerMask_mc._height; }; v2.isTimeElapsed = function () { return this.mTimeElapsed >= this.mTotalTime; }; v2.remainingSeconds = function () { return Math.max((this.mTotalTime - this.mTimeElapsed) / 1000, 0); }; ASSetPropFlags(_global.cpiTimer.prototype, null, 1); } #endinitclip } movieClip 1057 __Packages.rpnDeck { #initclip if (!_global.rpnDeck) { var v1 = function (slotsNum) { this.mSlotsNum = slotsNum; this.mActiveSlots = this.mSlotsNum; this.mLastActiveSlots = 0; this.mExtraDeal = false; this.reset(); }; _global.rpnDeck = v1; var v2 = v1.prototype; v2.unsetExtras = function () { var v2 = 0; while (v2 < this.mSlotsNum) { this.unsetExtraDealCard(v2); ++v2; } }; v2.reset = function () { this.unsetExtras(); this.mActiveSlots = this.mSlotsNum; this.mLastActiveSlots = 0; this.mExtraDeal = false; delete this.mSlotMCs; this.mSlotMCs = new Array(); this.shuffleCards(); var i = this.mSlotsNum - 1; while (i >= 0) { var deckCard = eval('_root.deckCard' + (i + 1) + '_mc'); deckCard.duplicateMovieClip('newDeckCard' + i, _root.getNextDepth()); deckCard.swapDepths(-1000 + i); var newDeckCard = eval('newDeckCard' + i); _root.registerStageMC(newDeckCard); this.mSlotMCs.push(newDeckCard); --i; } this.shuffleCards(); var i = 0; while (i < this.mSlotsNum) { var currCard = this.mSlotMCs[i]; currCard.isOccupied = true; currCard.onPress = _root.deckCardOnPress; currCard.onRelease = _root.deckCardOnRelease; (eval('_root.card' + (i + 1) + '_crack_mc')).gotoAndStop('unused'); ++i; } }; v2.clear = function () { this.unsetExtras(); var v3 = 0; while (v3 < this.mSlotsNum) { _root.setCard(this.mSlotMCs[v3], undefined); ++v3; } }; v2.deal = function () { this.unsetExtras(); if (this.mExtraDeal) { var v2 = this.mLastActiveSlots - 1; while (this.mActiveSlots > v2) { if (this.mActiveSlots != this.mLastActiveSlots) { this.silentRemoveCard(); } else { this.removeCard(); } } this.mLastActiveSlots = 0; this.mExtraDeal = false; this.shuffleCards(); } else { this.removeCard(); } }; v2.setExtraDeal = function (howmanyCards) { this.unsetExtras(); if (!this.mExtraDeal) { this.mLastActiveSlots = this.mActiveSlots; } while (this.mActiveSlots > howmanyCards) { this.silentRemoveCard(); } this.mActiveSlots = howmanyCards; this.mExtraDeal = true; this.shuffleCards(); }; v2.removeCard = function () { this.silentRemoveCard(); (eval('_root.card' + (this.mActiveSlots + 1) + '_crack_mc')).swapDepths(-500 + this.mActiveSlots); (eval('_root.card' + (this.mActiveSlots + 1) + '_crack_mc')).gotoAndPlay('start'); this.shuffleCards(); _root.playSound('crack.wav'); }; v2.silentRemoveCard = function () { --this.mActiveSlots; this.mSlotMCs[this.mActiveSlots].isOccupied = false; _root.setCard(this.mSlotMCs[this.mActiveSlots], undefined); }; v2.getSlotIdxFromCursor = function () { var v3 = 0; while (v3 < this.mActiveSlots) { this.mSlotMCs[v3].isOccupied = true; if (this.mSlotMCs[v3].hitTest(_root._xmouse, _root._ymouse, true)) { return v3; } ++v3; } return undefined; }; v2.getSlotIdxAndSideFromCursor = function () { var v3 = 0; while (v3 < this.mActiveSlots) { this.mSlotMCs[v3].isOccupied = true; if (this.mSlotMCs[v3].hitTest(_root._xmouse, _root._ymouse, true)) { var v4 = new Object(); v4.idx = v3; if (this.mSlotMCs[v3].leftColor.hitTest(_root._xmouse, _root._ymouse, true)) { v4.leftSide = true; } else { v4.leftSide = false; } return v4; } ++v3; } return undefined; }; v2.getCard = function (idx) { return this.mSlotMCs[idx]; }; v2.setCard = function (idx, val) { _root.setCard(this.mSlotMCs[idx], val); return this.mSlotMCs[idx]; }; v2.setJoker = function (idx) { _root.setJoker(this.mSlotMCs[idx]); }; v2.setExtraDealCard = function (idx) { _root.setExtraDealCard(this.mSlotMCs[idx]); }; v2.unsetExtraDealCard = function (idx) { _root.unsetExtraDealCard(this.mSlotMCs[idx]); }; v2.shuffleCards = function () { var v3 = 0; while (v3 < this.mActiveSlots) { this.unsetExtraDealCard(v3); this.mSlotMCs[v3].isOccupied = true; this.setCard(v3, _root.newRandomCard()); _root.setFadein(this.mSlotMCs[v3], 4); if (this.mExtraDeal) { this.setExtraDealCard(v3); } else { this.unsetExtraDealCard(v3); } ++v3; } }; v2.deactivate = function () { var v2 = 0; while (v2 < this.mActiveSlots) { this.mSlotMCs[v2].onPress = undefined; this.mSlotMCs[v2].onRelease = undefined; ++v2; } }; v2.activate = function () { var v3 = 0; while (v3 < this.mActiveSlots) { this.mSlotMCs[v3].onPress = _root.deckCardOnPress; this.mSlotMCs[v3].onRelease = _root.deckCardOnRelease; ++v3; } }; v2.isEmpty = function () { return this.mActiveSlots == 0; }; v2.activeSlots = function () { return this.mActiveSlots; }; v2.noMoreDeals = function () { if (this.mActiveSlots == 1) { return true; } var v2 = this.mLastActiveSlots - 1; if (this.mExtraDeal && v2 == 0) { return true; } return false; }; ASSetPropFlags(_global.rpnDeck.prototype, null, 1); } #endinitclip } movieClip 1058 __Packages.cardObj { #initclip if (!_global.cardObj) { var v1 = function (leftCol, leftShp, rightCol, rightShp) { this.leftColor = leftCol; this.leftShape = leftShp; this.rightColor = rightCol; this.rightShape = rightShp; this.isJoker = false; }; _global.cardObj = v1; var v2 = v1.prototype; ASSetPropFlags(_global.cardObj.prototype, null, 1); } #endinitclip } movieClip 1059 __Packages.mx.transitions.easing.None { #initclip if (!_global.mx) { _global.mx = new Object(); } if (!_global.mx.transitions) { _global.mx.transitions = new Object(); } if (!_global.mx.transitions.easing) { _global.mx.transitions.easing = new Object(); } if (!_global.mx.transitions.easing.None) { var v1 = function () {}; mx.transitions.easing.None = v1; var v2 = v1.prototype; v1.easeNone = function (t, b, c, d) { return c * t / d + b; }; v1.easeIn = function (t, b, c, d) { return c * t / d + b; }; v1.easeOut = function (t, b, c, d) { return c * t / d + b; }; v1.easeInOut = function (t, b, c, d) { return c * t / d + b; }; v1.version = '1.1.0.52'; ASSetPropFlags(mx.transitions.easing.None.prototype, null, 1); } #endinitclip } movieClip 1060 __Packages.rpnTable { #initclip if (!_global.rpnTable) { var v1 = function (slotsNum, slotLocations) { this.mSlotsNum = slotsNum; this.mSlots = new Array(this.mSlotsNum); this.mSlotLocations = slotLocations; this.mOccupiedSlots = 0; this.mConstraints = new Array(slotsNum); this.liftedIdx = undefined; this.reset(); }; _global.rpnTable = v1; var v2 = v1.prototype; v2.setCard = function (idx, card) { this.mSlots[idx] = card; if (card == undefined) { if (this.mSlotLocations[idx].isOccupied) { --this.mOccupiedSlots; } this.mSlotLocations[idx].isOccupied = false; var removedCard = eval('duplicatedSlot' + idx + '_mc'); removedCard.removeMovieClip(); return undefined; } var currCard = this.getDuplicatedSlot(idx); this.mSlotLocations[idx].isOccupied = true; ++this.mOccupiedSlots; _root.setCard(currCard, card); currCard.onPress = (card == undefined) ? undefined : _root.tableCardOnPress; if (card != undefined) { currCard.onRelease = _root.tableCardOnRelease; currCard.idx = idx; return currCard; } currCard.onRelease = undefined; currCard.idx = idx; return currCard; }; v2.setJoker = function (idx) { var jokeredCard = eval('duplicatedSlot' + idx + '_mc'); _root.setJoker(jokeredCard); }; v2.illegalPlacement = function (idx, card, origIdx) { var v3 = (idx == 8) ? 1 : idx + 1; var v5 = (idx == 1) ? 8 : idx - 1; if (card.joker) { return false; } return this.illegalGeneralPlacement(card, v3, idx, v5, origIdx) || this.illegalLeftPlacement(card, this.getConstraint(v3, idx)) || this.illegalRightPlacement(card, this.getConstraint(idx, v5)); }; v2.illegalGeneralPlacement = function (card, lidx, idx, ridx, origIdx) { var v4 = this.getConstraint(lidx, idx); var v7 = this.getConstraint(idx, ridx); var v6 = this.getCard(lidx); var v3 = this.getCard(ridx); if (origIdx != lidx && this.illegalGeneralConstraint(v6, card, v4) || origIdx != ridx && this.illegalGeneralConstraint(card, v3, v7)) { return true; } return false; }; v2.illegalGeneralConstraint = function (lcard, rcard, cnstr) { if (cnstr == undefined || cnstr != 'color' && cnstr != 'shape') { return false; } if (lcard == undefined || rcard == undefined) { return false; } if (cnstr == 'color') { return lcard.rightColor != rcard.leftColor; } else { return lcard.rightShape != rcard.leftShape; } }; v2.illegalLeftPlacement = function (card, constraint) { if (constraint == undefined || constraint == 'shape' || constraint == 'color') { return false; } if (card.leftShape != constraint && card.leftColor != constraint) { return true; } return false; }; v2.illegalRightPlacement = function (card, constraint) { if (constraint == undefined || constraint == 'shape' || constraint == 'color') { return false; } if (card.rightShape != constraint && card.rightColor != constraint) { return true; } return false; }; v2.getCard = function (idx) { return this.mSlots[idx]; }; v2.getScore = function () { var v6 = 0; var v2 = 1; while (v2 <= this.mSlotsNum) { var v5 = (v2 == 8) ? 1 : v2 + 1; var v3 = this.getCard(v2); var v4 = this.getCard(v5); if (this.cardsMatch(v4, v3)) { v6 += 6; } ++v2; } return v6; }; v2.updateBrightMatchs = function () { var i = 1; while (i <= 8) { var left = (i == 8) ? 1 : i + 1; var currCard = this.getCard(i); var leftCard = this.getCard(left); var currSlot = eval('duplicatedSlot' + i + '_mc'); var leftSlot = eval('duplicatedSlot' + left + '_mc'); if (!this.cardsMatch(leftCard, currCard)) { currSlot.leftRunning = false; } else { if (currSlot.leftRunning) { } else { currSlot.leftRunning = true; if (leftCard.rightColor == currCard.leftColor) { leftSlot.rightColor.rightCol_mc.gotoAndPlay(1); currSlot.leftColor.leftCol_mc.gotoAndPlay(1); } if (leftCard.rightShape == currCard.leftShape) { leftSlot.rightShape.rightShp_mc.gotoAndPlay(1); currSlot.leftShape.leftShp_mc.gotoAndPlay(1); } } } ++i; } }; v2.applyNewBars = function () { var idx = 1; while (idx <= 8) { var left = (idx == 8) ? 1 : idx + 1; var currCard = this.getCard(idx); var leftCard = this.getCard(left); var lidx = left; var hasSynergy = this.cardsMatch(leftCard, currCard); var s_mc = eval('_root.bar' + idx + '' + lidx + '_mc'); if (!hasSynergy || idx == this.liftedIdx || lidx == this.liftedIdx) { s_mc._visible = false; s_mc.gotoAndStop(1); s_mc.running = false; } else { if (hasSynergy && (!s_mc.running || s_mc.running == undefined)) { s_mc.gotoAndPlay(1); s_mc._visible = true; s_mc.swapDepths(300 + idx); s_mc.running = true; } } ++idx; } }; v2.removeAllBars = function () { var idx = 1; while (idx <= 8) { var lidx = (idx == 8) ? 1 : idx + 1; var s_mc = eval('_root.bar' + idx + '' + lidx + '_mc'); s_mc._visible = false; s_mc.gotoAndStop(1); s_mc.running = false; ++idx; } }; v2.applyNewSmoke = function (idx) { var lidx = (idx == 8) ? 1 : idx + 1; var ridx = (idx == 1) ? 8 : idx - 1; var lcard = this.getCard(lidx); var card = this.getCard(idx); var rcard = this.getCard(ridx); var newSmokeApplied = false; if (lcard != undefined && !this.cardsMatch(lcard, card)) { var s_mc = eval('_root.smoke' + idx + '' + lidx + '_mc'); s_mc.attachMovie('Smoke Effect', 'movie', 16020 + idx); s_mc.movie.gotoAndPlay(1); s_mc.swapDepths(16020 + idx); newSmokeApplied = true; } if (rcard != undefined && !this.cardsMatch(card, rcard)) { var s_mc = eval('_root.smoke' + ridx + '' + idx + '_mc'); s_mc.attachMovie('Smoke Effect', 'movie', 16030 + idx); s_mc.movie.gotoAndPlay(1); s_mc.swapDepths(16030 + idx); newSmokeApplied = true; } if (newSmokeApplied) { _root.playSound('Tile Mismatch'); } }; v2.countTiles = function () { var v4 = new Object(); v4.sol = 0; v4.terra = 0; v4.stella = 0; v4.luna = 0; v4.red = 0; v4.yellow = 0; v4.green = 0; v4.blue = 0; var v2 = 1; while (v2 <= this.mSlotsNum) { var v3 = this.getCard(v2); this.countCard(v4, v3); ++v2; } return v4; }; v2.countCard = function (tiles, card) { this.countColor(tiles, card.leftColor); this.countColor(tiles, card.rightColor); this.countShape(tiles, card.leftShape); this.countShape(tiles, card.rightShape); }; v2.countColor = function (tiles, color) { var orig = eval('tiles.' + color); eval('tiles.' + color) = orig + 1; return tiles; }; v2.countShape = function (tiles, shape) { var orig = eval('tiles.' + shape); eval('tiles.' + shape) = orig + 1; return tiles; }; v2.cardsMatch = function (lcard, rcard) { if (lcard == undefined || rcard == undefined) { return false; } if (lcard.joker || rcard.joker) { return true; } if (lcard.rightColor == rcard.leftColor || lcard.rightShape == rcard.leftShape) { return true; } return false; }; v2.isFull = function () { return this.mOccupiedSlots == this.mSlotsNum; }; v2.isEmpty = function () { return this.mOccupiedSlots == 0; }; v2.filledSlotsNum = function () { return this.mOccupiedSlots; }; v2.reset = function () { this.initSlots(); }; v2.activate = function () { var i = 1; while (i <= this.mSlotsNum) { (eval('duplicatedSlot' + i + '_mc')).onPress = _root.tableCardOnPress; (eval('duplicatedSlot' + i + '_mc')).onRelease = _root.tableCardOnRelease; ++i; } }; v2.deactivate = function () { var i = 1; while (i <= this.mSlotsNum) { (eval('duplicatedSlot' + i + '_mc')).onPress = undefined; (eval('duplicatedSlot' + i + '_mc')).onRelease = undefined; ++i; } }; v2.initSlots = function () { var v2 = 1; while (v2 <= this.mSlotsNum) { this.mSlotLocations[v2].idx = v2; this.mSlotLocations[v2].isOccupied = false; ++v2; } this.mOccupiedSlots = 0; }; v2.setConstraint = function (ridx, constraint) { this.mConstraints[ridx] = constraint; var lidx = (ridx == 8) ? 1 : ridx + 1; var slice = eval('_root.slice' + ridx + lidx + '_mc'); if (constraint == undefined) { slice.mc.removeMovieClip(); } else { slice.attachMovie(constraint + '_constraint', 'mc', _root.getNextDepth()); _root.registerStageMC(slice.mc); } }; v2.getConstraint = function (lidx, ridx) { if (lidx != 1) { var v2 = lidx - 1; return this.mConstraints[v2]; } var v2 = 8; return this.mConstraints[v2]; }; v2.getConstraintIdxFromCursor = function () { var ridx = 1; while (ridx <= this.mSlotsNum) { var lidx = (ridx == 8) ? 1 : ridx + 1; var slice = eval('_root.slice' + ridx + lidx + '_mc'); if (slice.hitTest(_root._xmouse, _root._ymouse, true)) { return ridx; } ++ridx; } return undefined; }; v2.getSlotFromCursor = function () { var v3 = 1; while (v3 <= this.mSlotsNum) { if (this.mSlotLocations[v3].hitTest(_root._xmouse, _root._ymouse, true)) { return this.mSlotLocations[v3]; } ++v3; } return undefined; }; v2.getSlotIdxFromCursor = function () { var v3 = 1; while (v3 <= this.mSlotsNum) { if (this.mSlotLocations[v3].hitTest(_root._xmouse, _root._ymouse, true)) { return v3; } ++v3; } return undefined; }; v2.getSlotIdxAndSideFromCursor = function () { var v3 = 1; while (v3 <= this.mSlotsNum) { if (this.mSlotLocations[v3].hitTest(_root._xmouse, _root._ymouse, true)) { var v4 = new Object(); v4.idx = v3; if (this.mSlotLocations[v3].leftColor.hitTest(_root._xmouse, _root._ymouse, true)) { v4.leftSide = true; } else { v4.leftSide = false; } return v4; } ++v3; } return undefined; }; v2.getDuplicatedSlot = function (idx) { _root.mainDeck.mSlotMCs[0].duplicateMovieClip('duplicatedSlot' + idx + '_mc', _root.getNextDepth()); var newSlot = eval('duplicatedSlot' + idx + '_mc'); newSlot._x = this.mSlotLocations[idx]._x; newSlot._y = this.mSlotLocations[idx]._y; newSlot._rotation = this.mSlotLocations[idx]._rotation; newSlot._alpha = 100; _root.registerStageMC(newSlot); return newSlot; }; v2.hasConstraints = function () { var v2 = 0; while (v2 < this.mConstraints.length) { if (this.mConstraints[v2] != undefined) { return true; } ++v2; } return false; }; v2.getLeftEffectCoords = function (idx) { return this.mSlotLocations[idx].leftEffectCoords; }; v2.getRightEffectCoords = function (idx) { return this.mSlotLocations[idx].rightEffectCoords; }; v2.getSliceEffectCoords = function (ridx) { if (ridx != 8) { var lidx = ridx + 1; var slice = eval('_root.slice' + ridx + lidx + '_mc'); return slice; } var lidx = 1; var slice = eval('_root.slice' + ridx + lidx + '_mc'); return slice; }; v2.getTileEffectCoords = function (idx) { return this.mSlotLocations[idx]; }; ASSetPropFlags(_global.rpnTable.prototype, null, 1); } #endinitclip } button 1005 { on (release) { _root.playSound('button1.wav'); _root.clearStage(); _root.gotoAndStop('menu'); } } frame 3 { } frame 4 { function writeHighScores() { _root.initHighScores(); _root.getReggedStageMC(); var v2 = _root.getReggedStageMC(); _root.scoresObj = v2; var v3 = 0; while (v3 <= 10) { var v7 = _root.getRecordScore('RPN', 'basic_scores', v3); var v8 = v7.player; var v10 = v7.main_score; var v9 = v7.secondary_score; if (v8 == undefined) { } else { var v4 = 'player_name_' + v3; var v6 = 'level_' + v3; var v5 = 'score_' + v3; v2.createTextField(v4, _root.getNextDepth(), 110, 62 + v3 * 23, 100, 22); setHighscoresText(v2[v4], 'left'); v2[v4].text = v8; v2.createTextField(v6, _root.getNextDepth(), 190, 62 + v3 * 23, 27, 22); setHighscoresText(v2[v6], 'right'); v2[v6].text = v9; v2.createTextField(v5, _root.getNextDepth(), 225, 62 + v3 * 23, 65, 22); setHighscoresText(v2[v5], 'right'); v2[v5].text = v10; } ++v3; } v3 = 0; while (v3 <= 10) { v7 = _root.getRecordScore('RPN', 'basic_levels', v3); v8 = v7.player; v9 = v7.main_score; v10 = v7.secondary_score; if (v8 == undefined) { } else { v4 = 'player_name2_' + v3; v6 = 'level2_' + v3; v5 = 'score2_' + v3; v2.createTextField(v4, _root.getNextDepth(), 379, 62 + v3 * 23, 100, 22); setHighscoresText(v2[v4], 'left'); v2[v4].text = v8; v2.createTextField(v6, _root.getNextDepth(), 459, 62 + v3 * 23, 27, 22); setHighscoresText(v2[v6], 'right'); v2[v6].text = v9; v2.createTextField(v5, _root.getNextDepth(), 494, 62 + v3 * 23, 65, 22); setHighscoresText(v2[v5], 'right'); v2[v5].text = v10; } ++v3; } } function updateHighScores() { var v3 = _root.scoresObj; var v2 = 0; while (v2 <= 10) { var v4 = _root.getRecordScore('RPN', 'basic_scores', v2); var v5 = v4.player; var v10 = v4.main_score; var v8 = v4.secondary_score; if (v5 == undefined) { } else { var v6 = 'player_name_' + v2; var v9 = 'level_' + v2; var v7 = 'score_' + v2; v3[v6].text = v5; v3[v9].text = v8; v3[v7].text = v10; } ++v2; } v2 = 0; while (v2 <= 10) { v4 = _root.getRecordScore('RPN', 'basic_levels', v2); v5 = v4.player; v8 = v4.main_score; v10 = v4.secondary_score; if (v5 == undefined) { } else { v6 = 'player_name2_' + v2; v9 = 'level2_' + v2; v7 = 'score2_' + v2; v3[v6].text = v5; v3[v9].text = v8; v3[v7].text = v10; } ++v2; } } function setHighscoresText(tf, alignment) { var v1 = new TextFormat(); v1.font = 'GaramondEmbed'; v1.bold = true; v1.size = 16; v1.align = alignment; v1.color = 8396832; tf.setNewTextFormat(v1); tf.sharpness = 0; tf.antiAliasType = 'advanced'; tf.selectable = false; tf.embedFonts = true; } if (!_root.newHighscore) { _root.clearStage(); } var scoresObj; writeHighScores(); Selection.setFocus(_root.hs_mc.highscore.playerName); Selection.setSelection(0, 0); } frame 6 { function isRecordScore(tool, category, main_score, secondary_score) { var v8 = 'highscores_' + category; var v4 = _root.getSavedObject(tool, v8); var v2 = 0; while (v2 < v4.maxlength) { var v3 = v4.main_score[v2]; var v5 = v4.secondary_score[v2]; if (v3 == undefined) { return true; } if (v3 < main_score || v3 == main_score && v5 < secondary_score) { return true; } ++v2; } return false; } function addRecordScore(tool, category, player, main_score, secondary_score) { var v12 = 'highscores_' + category; var v3 = _root.getSavedObject(tool, v12); var v2 = 0; while (v2 < v3.maxlength) { var v6 = v3.main_score[v2]; var v7 = v3.secondary_score[v2]; if (v6 == undefined) { break; } if (v6 < main_score || v6 == main_score && v7 < secondary_score) { break; } ++v2; } var v4 = player; var v9 = main_score; var v8 = secondary_score; do { var v5 = v3.player[v2]; v6 = v3.main_score[v2]; v7 = v3.secondary_score[v2]; v3.player[v2] = v4; v3.main_score[v2] = v9; v3.secondary_score[v2] = v8; v4 = v5; v9 = v6; v8 = v7; ++v2; } while (v4 != undefined && v2 < v3.maxlength); v3.length = v2; _root.flushSavedObject(); } function getRecordScore(tool, category, idx) { var v5 = 'highscores_' + category; var v3 = _root.getSavedObject(tool, v5); var v2 = new Object(); v2.player = v3.player[idx]; v2.main_score = v3.main_score[idx]; v2.secondary_score = v3.secondary_score[idx]; return v2; } function initRecordsTable(tool, category, maxlength) { var v2 = 'highscores_' + category; var v3 = _root.getSavedObject(tool, v2); if (v3.maxlength != undefined) { return undefined; } resetRecordsTable(tool, category, maxlength); _root.flushSavedObject(); } function resetRecordsTable(tool, category, maxlength) { var v4 = 'highscores_' + category; var v2 = _root.getSavedObject(tool, v4); delete v2.player; delete v2.main_score; delete v2.secondary_score; v2.maxlength = maxlength; v2.player = new Array(maxlength); v2.main_score = new Array(maxlength); v2.secondary_score = new Array(maxlength); _root.flushSavedObject(); } function newRandomCards(num) { cards = new Array(); var v1 = 1; while (v1 <= num) { cards[v1] = newRandomCard(); ++v1; } return cards; } function newRandomCard() { return new cardObj(randomColor(), randomShape(), randomColor(), randomShape()); } function randomColor() { switch (int(Math.random() * 4)) { case 0: return 'red'; case 1: return 'blue'; case 2: return 'green'; case 3: return 'yellow'; } } function randomShape() { switch (int(Math.random() * 4)) { case 0: return 'luna'; case 1: return 'stella'; case 2: return 'terra'; case 3: return 'sol'; } } function isColor(type) { if (type == 'red' || type == 'blue' || type == 'yellow' || type == 'green') { return true; } return false; } function getNextDepth() { if (nonReggedMCs == undefined || nonReggedMCs == NaN) { nonReggedMCs = 0; } if (nextAvailableDepth == undefined) { nextAvailableDepth = 11000 - nonReggedMCs; } --nextAvailableDepth; return nextAvailableDepth; } function handleDealClickGameNotOver() { if (_root.mainDeck.noMoreDeals() == 1 && _root.lastDealWarningIssued == false) { var v2 = _root.getReggedStageMC(); v2.attachMovie('no_more_deals_mc', 'dummy', 15000); v2.swapDepths(15000); v2._x = 64.3; v2._y = 209.4; v2.onMouseDown = _root.unloadSelf; _root.playSound('tool_message.wav'); _root.lastDealWarningIssued = true; return undefined; } _root.mainDeck.deal(); return undefined; } function handleHighScoresUpdate() { _root.initHighScores(); var v9 = Number(_root.total_points_txt.text); var v8 = Number(_root.currentLevel); if (_root.total_points_txt.text == 0) { return false; } if (!_root.isRecordScore('RPN', 'basic_scores', _root.total_points_txt.text, _root.currentLevel) && !_root.isRecordScore('RPN', 'basic_levels', _root.currentLevel, _root.total_points_txt.text)) { return false; } _root.newHighscore = true; _root.rpnStopSynergies(); _root.jumpToScores(); var v3 = _root.getReggedStageMC(); _root.hs_mc = v3; v3.attachMovie('highscore_mc', 'highscore', 20000); v3.swapDepths(20000); v3._x = 185.8; v3._y = 361.4; var v6 = new Object(); v6.parent = v3.highscore; v6.onKeyDown = function () { var v2 = Key.getCode(); if (v2 == 13) { Key.removeListener(this); this.parent.handleSubmitPress(); } }; Key.addListener(v6); v3.highscore.points = v9; v3.highscore.level = v8; var v4 = new TextFormat(); v4.font = 'AndalusNumbers'; v4.bold = true; v4.size = 14; v4.align = 'center'; v4.letterSpacing = 2; var v5 = v3.highscore.playerName; v4.color = 4203023; v5.setNewTextFormat(v4); v5.sharpness = 0; v5.antiAliasType = 'advanced'; v5.embedFonts = true; return true; } function setCard(obj, val) { if (val != undefined) { setCard(obj, undefined); obj.leftColor.attachMovie(val.leftColor + '_mc', 'leftCol_mc', getNextDepth()); obj.rightColor.attachMovie(val.rightColor + '_mc', 'rightCol_mc', getNextDepth()); obj.rightShape.attachMovie(val.rightShape + '_mc', 'rightShp_mc', getNextDepth()); if (val.leftShape == 'luna' || val.leftShape == 'terra') { obj.leftShape.attachMovie(val.leftShape + '_flipped_mc', 'leftShp_mc', getNextDepth()); } else { obj.leftShape.attachMovie(val.leftShape + '_mc', 'leftShp_mc', getNextDepth()); } obj.cardval = val; obj._visible = true; _root.registerStageMC(obj.leftColor.leftCol_mc); _root.registerStageMC(obj.rightColor.rightCol_mc); _root.registerStageMC(obj.leftShape.leftShp_mc); _root.registerStageMC(obj.rightShape.rightShp_mc); if (val.joker) { setJoker(obj); } } else { obj.leftColor.leftCol_mc.removeMovieClip(); obj.leftShape.leftShp_mc.removeMovieClip(); obj.rightColor.rightCol_mc.removeMovieClip(); obj.rightShape.rightShp_mc.removeMovieClip(); obj.jokerEffect.removeMovieClip(); obj.extraDealEffect.removeMovieClip(); obj.cardval = undefined; obj._visible = false; } } function setJoker(card) { card.cardval.joker = true; card.attachMovie('joker_tile_mc', 'jokerEffect', getNextDepth()); _root.registerStageMC(card.jokerEffect); } function setExtraDealCard(card) { card.cardval.extradeal = true; card.tween = new mx.transitions.Tween(card, '_alpha', mx.transitions.easing.Regular.easeInOut, 95, 60, 1, 1); card.tween.onMotionFinished = card.tween.yoyo; } function unsetExtraDealCard(card) { card.cardval.extradeal = false; card.tween.stop(); } function playSound(name, loops, vol) { if (!_root.bgSoundsEnabled) { return undefined; } if (loops == undefined) { loops = 0; } var v2 = new Sound(); v2.attachSound(name); v2.start(0, loops); false; } function playSequencedSound(name, func) { if (!_root.bgSoundsEnabled) { func(); return undefined; } var v3 = new Sound(); v3.onSoundComplete = function () { this.func(); }; v3.func = func; v3.attachSound(name); v3.start(); false; } function clearStage() { _root.game_bg_mc2.swapDepths(1); _root.tutorial_text_bg_mc.swapDepths(2); for (obj in _root.stageObjs) { _root.stageObjs[obj].removeMovieClip(); delete _root.stageObjs[obj]; _root.stageObjs[obj] = undefined; } delete _root.stageObjs; _root.stageObjs = undefined; if (nonReggedMCs == undefined || nonReggedMCs == NaN) { nonReggedMCs = 0; } nextAvailableDepth = 11000 - nonReggedMCs; } function getStageMC(regged) { if (_root.stageObjs == undefined) { _root.stageObjs = new Array(); } if (nonReggedMCs == undefined || nonReggedMCs == NaN) { nonReggedMCs = 0; } if (regged != true) { ++nonReggedMCs; } var v2 = 0; if (regged) { v2 = 'Regged' + _root.stageObjs.length; var v3 = 'dynamicObject' + v2; _root.createEmptyMovieClip(v3, _root.getNextDepth()); return _root[v3]; } v2 = nonReggedMCs; var v3 = 'dynamicObject' + v2; _root.createEmptyMovieClip(v3, _root.getNextDepth()); return _root[v3]; } function getReggedStageMC() { var v1 = getStageMC(true); registerStageMC(v1); return v1; } function registerStageMC(mc) { if (_root.stageObjs == undefined) { _root.stageObjs = new Array(); } _root.stageObjs.push(mc); } function generateIdxSet(nums, maxNum) { var v5 = new Array(); var v6 = new Array(); var v3 = 0; while (v3 < nums) { v6.push(int((maxNum - v3) * Math.random() + 1)); ++v3; } v3 = 0; while (v3 < nums) { var v2 = v6[v3]; var v4 = v5; v4.sort(); var v1 = 0; while (v1 < v3) { if (v4[v1] <= v2) { ++v2; } ++v1; } v5.push(v2); ++v3; } return v5; } function generateConstraints(level, slotsNum) { var v4 = new Array(); var v9 = _root.getConstraintNums(level); var v5 = _root.generateIdxSet(v9.totalConstraints, slotsNum); var v7 = v9.genColor; var v6 = v9.genShape + v7; var v8 = v9.spcColor + v6; var v2; var v3 = 0; while (v3 < v7) { v2 = new Object(); v2.idx = v5[v3]; v2.cnstr = 'color'; v4.push(v2); false; ++v3; } v3 = v7; while (v3 < v6) { v2 = new Object(); v2.idx = v5[v3]; v2.cnstr = 'shape'; v4.push(v2); false; ++v3; } v3 = v6; while (v3 < v8) { v2 = new Object(); v2.idx = v5[v3]; v2.cnstr = randomColor(); v4.push(v2); false; ++v3; } v3 = v8; while (v3 < v9.totalConstraints) { v2 = new Object(); v2.idx = v5[v3]; v2.cnstr = randomShape(); v4.push(v2); false; ++v3; } return v4; } function getConstraintNums(level) { var v1 = new Object(); if (level > 30) { level = 30; } v1.genColor = genColorPerLevel[level - 1]; v1.genShape = genShapePerLevel[level - 1]; v1.spcColor = spcColorPerLevel[level - 1]; v1.spcShape = spcShapePerLevel[level - 1]; v1.totalConstraints = v1.genColor + v1.genShape + v1.spcColor + v1.spcShape; return v1; } function loadMouse() { Mouse.hide(); if (_root.mouse_mc) { _root.mouse_mc.unloadMovie(); _root.mouse_mc = undefined; } if (_root.mouse_mc == undefined) { _root.mouse_mc = _root.getStageMC(); _root.mouse_mc.swapDepths(25000); _root.mouse_mc.attachMovie('mouse_mc', 'dummy', _root.getNextDepth()); _root.mouse_mc.onEnterFrame = _root.updateMouseLocation; } } function updateMouseLocation() { this._x = _root._xmouse; this._y = _root._ymouse; } function unloadSelf() { this.unloadMovie(); } function getSavedObject(tool, name) { var v1 = SharedObject.getLocal(tool + '_' + name); if (v1 == undefined) { trace('FATAL: getSavedObject(' + tool + ', ' + name + ') has failed. Possibly a permissions/space issue.'); return undefined; } if (v1.data.val == undefined) { v1.data.val = new Object(); } return v1.data.val; } function flushSavedObject() { var v1 = SharedObject.getLocal(tool + '_' + name); v1.flush(); } function setFadein(obj, step) { obj._alpha = 0; obj.fadein_step = step; obj.onEnterFrame = _root.fadeInEffect; } function setFadeout(obj, step) { obj._alpha = 100; obj.fadeout_step = step; obj.onEnterFrame = _root.fadeOutEffect; } function fadeInEffect() { this._alpha += this.fadein_step; if (this._alpha > 100) { this._alpha = 100; this.onEnterFrame = undefined; } } function fadeOutEffect() { this._alpha -= this.fadeout_step; if (this._alpha < 0) { this._alpha = 0; this.onEnterFrame = undefined; } } function initHighScores() { if ((_root.getRecordScore('RPN', 'basic_scores', 0)).player == undefined || (_root.getRecordScore('RPN', 'basic_levels', 0)).player == undefined) { _root.resetRecordsTable('RPN', 'basic_levels', 11); _root.resetRecordsTable('RPN', 'basic_scores', 11); var v2 = 10; while (v2 >= 0) { _root.addRecordScore('RPN', 'basic_scores', 'Sorcerer', 100 + v2 * 100, 1); _root.addRecordScore('RPN', 'basic_levels', 'Sorcerer', 1 + v2, 100 + v2 * 100); --v2; } } } function setSynergy() { var v2; v2 = _root.currentLevel - 3; if (v2 < 1) { _root.synergy1 = undefined; _root.synergy2 = undefined; return undefined; } while (v2 > 28) { v2 -= 28; } if (v2 == 1) { _root.generateSynergySet(); } var v5 = _root.synergiesSet[v2 - 1].s1; var v4 = _root.synergiesSet[v2 - 1].s2; _root.playSound('Synergy Startup'); var v6 = v5 + '_' + v4 + '_synergy_mc'; _root.synergy1 = v5; _root.synergy2 = v4; var v3 = _root.getReggedStageMC(); v3.swapDepths(20500); v3.attachMovie(v6, 'movie', 100); v3._x = 324.9; v3._y = 246.6; v3.movie.onRollOver = _root.synergyOnRollOver; v3.movie.onRollOut = _root.synergyOnRollOut; } function synergyOnRollOver() { if (_root.inGameMenuDisabled == false) { return undefined; } if (_root.rpnGameOver()) { return undefined; } if (this.synergy_mo_mc != undefined) { return undefined; } if (this._currentframe != this._totalframes) { return undefined; } this.lala = _root.getReggedStageMC(); this.lala.swapDepths(20500); this.lala.attachMovie('synergy_mo_mc', 'movie', 25000); this.lala._x = 463; this.lala._y = 167; } function synergyOnRollOut() { removeMovieClip(this.lala); } function generateSynergySet() { _root.synergiesSet = new Array(); var v2 = new Array(); var v6 = 0; while (v6 < 4) { var v5 = v6 + 1; while (v5 < 4) { var v4 = new Object(); v4.s1 = colorsArray[v6]; v4.s2 = colorsArray[v5]; v2.push(v4); ++v5; } v5 = 0; while (v5 < 4) { v4 = new Object(); v4.s1 = shapesArray[v6]; v4.s2 = colorsArray[v5]; v2.push(v4); ++v5; } ++v6; } v6 = 0; while (v6 < 4) { v5 = v6 + 1; while (v5 < 4) { v4 = new Object(); v4.s1 = shapesArray[v6]; v4.s2 = shapesArray[v5]; v2.push(v4); ++v5; } ++v6; } while (v2.length > 0) { var v7 = int(Math.random() * v2.length); _root.synergiesSet.push(v2[v7]); var v8 = new Array(); var v3 = 0; while (v3 < v7) { v8.push(v2[v3]); ++v3; } v3 = v7 + 1; while (v3 < v2.length) { v8.push(v2[v3]); ++v3; } v2 = v8; } } function setTileOrigin(tile_mc) { if (tile_mc == undefined) { tileOriginalLocation.tile = undefined; return undefined; } tileOriginalLocation.tile = tile_mc; tileOriginalLocation._x = tile_mc._x; tileOriginalLocation._y = tile_mc._y; tileOriginalLocation._rotation = tile_mc._rotation; } function returnTileToOrigin() { (currentTile())._x = tileOriginalLocation._x; (currentTile())._y = tileOriginalLocation._y; (currentTile())._rotation = tileOriginalLocation._rotation; (currentTile()).rotate_tween.stop(); delete (currentTile()).rotate_tween; if ((currentTile()).idx != undefined) { _root.mainTable.applyNewSmoke((currentTile()).idx); } } function currentTile() { return tileOriginalLocation.tile; } function placeTileOnTarget(tile, target) { if (target == undefined) { return false; } var v3 = (currentTile() == undefined) ? -1 : (currentTile()).idx; if (v3 == target.idx) { return false; } if (_root.mainTable.getCard(target.idx) != undefined) { _root.playSound('Tile Mismatch'); return false; } if (_root.mainTable.illegalPlacement(target.idx, tile.cardval, v3)) { _root.setInstructionsColor(16711680, 14); _root.rpnSetTextMessage('The tile doesn\'t fit here. The limiter in the inner circle allows only a specific match.\n'); _root.playSound('Tile Mismatch'); return false; } _root.mainTable.setCard(target.idx, tile.cardval); return true; } function adjustToCursor(obj) { obj._x = _root._xmouse; obj._y = _root._ymouse; } function deckCardOnPress() { cardPressTime = getTimer(); if (!this.isOccupied) { return undefined; } _root.onMouseMove = cardOnMouseMove; setTileOrigin(this); adjustToCursor(this); if (_root.getInstanceAtDepth(19000) == undefined) { this.swapDepths(19000); } else { this.swapDepths(_root.getInstanceAtDepth(19000)); } this.startDrag(); } function deckCardOnRelease() { this.onPress = _root.deckCardOnPress; if (getTimer() - cardPressTime < 100) { this.onPress = _root.deckCardOnRelease; return undefined; } this.stopDrag(); _root.onMouseMove = undefined; var v3 = _root.mainTable.getSlotFromCursor(); returnTileToOrigin(); if (placeTileOnTarget(currentTile(), v3)) { _root.setCard(currentTile(), _root.newRandomCard()); applyNewSynergies(); _root.mainTable.applyNewBars(); _root.mainTable.applyNewSmoke(v3.idx); _root.giveBonusTipIfPossible(); var v4 = _root.mainTable.getScore(); playScoreMusic(v3.idx); _root.lastDealWarningIssued = false; } else { _root.playSound('enteringSlot.wav'); } this.swapDepths(_root.getNextDepth()); setTileOrigin(undefined); } function tableCardOnPress() { cardPressTime = getTimer(); _root.onMouseMove = cardOnMouseMove; setTileOrigin(this); adjustToCursor(this); if (_root.getInstanceAtDepth(19000) == undefined) { this.swapDepths(19000); } else { this.swapDepths(_root.getInstanceAtDepth(19000)); } _root.mainTable.liftedIdx = (currentTile()).idx; this.startDrag(); } function tableCardOnRelease() { this.onPress = _root.tableCardOnPress; if (getTimer() - cardPressTime < 100) { this.onPress = _root.tableCardOnRelease; return undefined; } this.stopDrag(); _root.onMouseMove = undefined; _root.mainTable.liftedIdx = undefined; var v3 = _root.mainTable.getSlotFromCursor(); if (placeTileOnTarget(currentTile(), v3)) { _root.mainTable.setCard((currentTile()).idx, undefined); this.removeMovieClip(); var v4 = _root.mainTable.getScore(); playScoreMusic(v3.idx); _root.lastDealWarningIssued = false; applyNewSynergies(); _root.mainTable.applyNewBars(); _root.mainTable.applyNewSmoke(v3.idx); } else { if ((currentTile()).idx == v3.idx || v3 == undefined) { playScoreMusic((currentTile()).idx); } else { _root.playSound('enteringSlot.wav'); } returnTileToOrigin(); this.swapDepths(_root.getNextDepth()); } setTileOrigin(undefined); } function cardOnMouseMove() { targetSlot = _root.mainTable.getSlotFromCursor(); if (targetSlot == undefined) { return undefined; } var v5 = currentTile(); if (v5._rotation == targetSlot._rotation) { return undefined; } if (v5.rotate_tween.finalRotation == targetSlot._rotation && v5.rotate_tween != undefined && v5.rotate_tween.completed == false) { return undefined; } v5.rotate_tween.stop(); delete v5.rotate_tween; var v3 = v5._rotation; var v4 = targetSlot._rotation; while (v3 - v4 > 180) { v4 += 360; } while (v4 - v3 > 180) { v3 += 360; } v5.rotate_tween = new mx.transitions.Tween(currentTile(), '_rotation', mx.transitions.easing.Regular.easeIn, v3, v4, 0.2, 1); v5.rotate_tween.completed = false; v5.rotate_tween.finalRotation = targetSlot._rotation; v5.rotate_tween.onMotionFinished = function () { this.completed = true; }; (currentTile())._x = root._xmouse; (currentTile())._y = root._ymouse; } function playScoreMusic(idx) { var v6 = (idx == 8) ? 1 : idx + 1; var v5 = (idx == 1) ? 8 : idx - 1; var v4 = _root.mainTable.getCard(idx); var v10 = _root.mainTable.getCard(v6); var v7 = _root.mainTable.getCard(v5); var v8 = false; var v9 = false; var v3 = 0; if (_root.mainTable.cardsMatch(v4, v7)) { ++v3; v8 = true; } if (_root.mainTable.cardsMatch(v10, v4)) { ++v3; v9 = true; } if (v3 > 0) { _root.playSound(v3 + 'match.wav'); _root.wizard_wand_mc.movie.fadeIn = true; _root.wizard_wand_mc.movie.fadeOut = true; _root.wizard_wand_mc.movie.gotoAndPlay('start'); } else { _root.playSound('enteringSlot.wav'); } if (checkSynergy(idx) || checkSynergy(v5)) { _root.playSound('Synergy'); } } function giveBonusTipIfPossible() { if (_root.isTutorialRunning()) { return undefined; } if (_root.mainTable.filledSlotsNum() == 5) { var v7 = _root.mainTable.countTiles(); var v5 = 0; var v6 = ''; for (elem in v7) { if (v7[elem] <= v5) { continue; } v5 = v7[elem]; v6 = elem; } v6 = (v6.charAt(0)).toUpperCase() + v6.substr(1, v6.length - 1); _root.setInstructionsColor(1450919, 14); _root.rpnSetTextMessage('You have ' + v5 + ' ' + v6 + 's in the ring. Try accumulating more to create a "' + v6 + ' Pool set"'); _root.playSound('New Message'); return undefined; } if (_root.mainTable.filledSlotsNum() == 6) { v7 = _root.mainTable.countTiles(); var v4 = 17; var v3 = 17; for (elem in v7) { var v2 = v7[elem]; if (elem == 'red' || elem == 'blue' || elem == 'green' || elem == 'yellow') { if (v4 > v2) { v4 = v2; } } else { if (v3 > v2) { v3 = v2; } } } if (v3 >= 2) { _root.setInstructionsColor(1450919, 14); _root.rpnSetTextMessage('You have 4 Shape doubles in the ring. Try to create a "Shape Harmonic set" by accumulating 3 or 4 from each shape.'); _root.playSound('New Message'); return undefined; } if (v4 >= 2) { _root.rpnSetTextMessage('You have 4 Color doubles in the ring. Try to create a "Color Harmonic set" by accumulating 3 or 4 from each color.'); _root.playSound('New Message'); return undefined; } return undefined; } } function applyNewSynergies() { var idx = 1; while (idx <= 8) { var hasSynergy = checkSynergy(idx); var lidx = (idx == 8) ? 1 : idx + 1; var s_mc = eval('_root.synergy' + idx + '' + lidx + '_mc'); if (s_mc.running == undefined) { s_mc.running = false; } if (hasSynergy && !s_mc.running) { s_mc.gotoAndPlay(1); s_mc.swapDepths(16020 + idx); s_mc.running = true; } if (!hasSynergy && s_mc.running) { s_mc.swapDepths(-100 + idx); s_mc.gotoAndStop(1); s_mc.running = false; } ++idx; } } function addExtrasByLevel(level) { if (_root.specialDebugMode == level) { _root.addExtraDeals(4, 4); _root.addExtraBonuses('red_bomb', 2); _root.addExtraBonuses('switch', 2); _root.addExtraBonuses('joker', 2); _root.addExtraBonuses('blue_bomb', 2); } if (level == 1) { _root.addExtraDeals(4, 3); } if (level == 10 || level == 15) { _root.addExtraBonuses(randomTransformColor(), 1); _root.addExtraBonuses(randomTransformShape(), 1); } if (level == 20) { _root.addExtraBonuses(randomTransform(), 1); _root.addExtraBonuses(randomTransform(), 1); _root.addExtraBonuses(randomTransform(), 1); } if (level == 25) { _root.addExtraBonuses(randomTransformColor(), 1); _root.addExtraBonuses(randomTransformColor(), 1); _root.addExtraBonuses(randomTransformShape(), 1); _root.addExtraBonuses(randomTransformShape(), 1); } if (level == 30) { _root.addExtraBonuses(randomTransform(), 1); _root.addExtraBonuses(randomTransform(), 1); _root.addExtraBonuses(randomTransform(), 1); _root.addExtraBonuses(randomTransform(), 1); _root.addExtraBonuses(randomTransform(), 1); } if (level > 30) { _root.addExtraBonuses(randomTransform(), 1); } } function randomTransform() { if (int(Math.random() * 2) == 0) { return randomTransformColor(); } else { return randomTransformShape(); } } function randomTransformColor() { return _root.randomColor() + '_transform'; } function randomTransformShape() { var v2 = _root.randomShape(); return v2 + '_transform'; } function addExtraDeals(cards, num) { if (num == undefined || num < 1) { return undefined; } _root.mainExtras.add('d' + cards + '_extradeal', num, _root.extraDealClick, 'extra_deal_mo_mc', cards); } function addExtraBonuses(type, num) { if (num == undefined || num < 1) { return undefined; } _root.mainExtras.add(type + '_mc', num, eval('_root.extra' + type + 'Click'), type + '_mo_mc', undefined); } function extraDealClick() { if (_root.mainExtras.mActive == false) { return undefined; } _root.tutorialNotifyExtraDealClicked(); var v3 = _root.mainExtras.getExtraInfo(this.idx); this.onRollOut(); _root.mainExtras.remove(this.idx); _root.mainDeck.setExtraDeal(v3); _root.playSound('Extra Deal'); _root.lastDealWarningIssued = false; } function extrared_bombClick() { if (_root.mainTable.isEmpty()) { playSound('Illegal Click'); return undefined; } _root.mainExtras.deactivate(); _root.mainDeck.deactivate(); _root.mainTable.deactivate(); this.mouse_over_elem.removeMovieClip(); extrasAddTip('red_bomb'); _root.playSound('tool_message.wav'); _root.mainExtras.remove(this.idx); _root.onMouseDown = _root.redBombOnTileClick; _root.lastDealWarningIssued = false; } function redBombOnTileClick() { var v3 = _root.mainTable.getSlotIdxFromCursor(); if (v3 == undefined || _root.mainTable.getCard(v3) == undefined) { playSound('Illegal Click'); return undefined; } _root.playSound('red_bomb.wav'); _root.mainTable.setCard(v3, NULL); var v2 = _root.getReggedStageMC(); v2.attachMovie('red_bomb_effect', dummy, _root.getNextDepth()); v2.swapDepths(16500); var v4 = _root.mainTable.getTileEffectCoords(v3); v2._x = v4._x; v2._y = v4._y; _root.tutorialNotifyExtraDealClicked(); _root.mainExtras.activate(); _root.mainDeck.activate(); _root.mainTable.activate(); extrasRemoveTip(); _root.onMouseDown = undefined; } function extrablue_bombClick() { if (!_root.mainTable.hasConstraints()) { playSound('Illegal Click'); return undefined; } _root.mainExtras.deactivate(); _root.mainDeck.deactivate(); _root.mainTable.deactivate(); this.mouse_over_elem.removeMovieClip(); extrasAddTip('blue_bomb'); _root.playSound('tool_message.wav'); _root.mainExtras.remove(this.idx); _root.onMouseDown = _root.blueBombOnTileClick; _root.lastDealWarningIssued = false; } function blueBombOnTileClick() { var v3 = _root.mainTable.getConstraintIdxFromCursor(); if (v3 == undefined) { playSound('Illegal Click'); return undefined; } _root.playSound('blue_bomb.wav'); _root.mainTable.setConstraint(v3, NULL); var v2 = _root.getReggedStageMC(); v2.attachMovie('blue_bomb_effect', dummy, _root.getNextDepth()); v2.swapDepths(16500); var v4 = _root.mainTable.getSliceEffectCoords(v3); v2._x = v4._x; v2._y = v4._y; _root.mainExtras.activate(); _root.mainDeck.activate(); _root.mainTable.activate(); extrasRemoveTip(); _root.onMouseDown = undefined; } function extraswitchClick() { _root.mainExtras.deactivate(); _root.mainDeck.deactivate(); _root.mainTable.deactivate(); this.mouse_over_elem.removeMovieClip(); extrasAddTip('switch'); _root.playSound('tool_message.wav'); _root.mainExtras.remove(this.idx); _root.onMouseDown = _root.switchOnTileClick; _root.lastDealWarningIssued = false; } function switchOnTileClick() { var v2 = _root.mainTable.getSlotIdxFromCursor(); if (v2 != undefined && _root.mainTable.getCard(v2) != undefined) { if (!switchTableTile(v2)) { playSound('Illegal Click'); return undefined; } } else { v2 = _root.mainDeck.getSlotIdxFromCursor(); if (v2 != undefined) { switchDeckTile(v2); } else { playSound('Illegal Click'); return undefined; } } _root.playSound('switch.wav'); _root.tutorialNotifyExtraDealClicked(); _root.mainExtras.activate(); _root.mainDeck.activate(); _root.mainTable.activate(); extrasRemoveTip(); _root.onMouseDown = undefined; } function switchDeckTile(idx) { var v2 = (_root.mainDeck.getCard(idx)).cardval; var v3 = new cardObj(v2.rightColor, v2.rightShape, v2.leftColor, v2.leftShape); _root.setFadein(_root.mainDeck.setCard(idx, v3), 4); } function switchTableTile(idx) { var v2 = _root.mainTable.getCard(idx); var v4 = new cardObj(v2.rightColor, v2.rightShape, v2.leftColor, v2.leftShape); _root.mainTable.setCard(idx, undefined); if (_root.mainTable.illegalPlacement(idx, v4, -1)) { _root.mainTable.setCard(idx, v2); return false; } else { _root.setFadein(_root.mainTable.setCard(idx, v4), 4); return true; } } function extrajokerClick() { _root.mainExtras.deactivate(); _root.mainDeck.deactivate(); _root.mainTable.deactivate(); this.mouse_over_elem.removeMovieClip(); _root.playSound('tool_message.wav'); _root.mainExtras.remove(this.idx); extrasAddTip('joker'); _root.onMouseDown = _root.jokerOnTileClick; _root.lastDealWarningIssued = false; } function jokerOnTileClick() { var v2 = _root.mainTable.getSlotIdxFromCursor(); var v3 = _root.mainDeck.getSlotIdxFromCursor(); if ((v2 == undefined || _root.mainTable.getCard(v2) == undefined) && v3 == undefined) { playSound('Illegal Click'); return undefined; } if (v2 != undefined) { _root.mainTable.setJoker(v2); } else { _root.mainDeck.setJoker(v3); } _root.playSound('joker.wav'); _root.mainExtras.activate(); _root.mainDeck.activate(); _root.mainTable.activate(); extrasRemoveTip(); _root.onMouseDown = undefined; } function extraDealMO() { if (_root.mainExtras.mActive == false) { return undefined; } if (this.mouse_over_elem == undefined) { this.mouse_over_elem = _root.getReggedStageMC(); this.mouse_over_elem.swapDepths(17020); this.mouse_over_elem.attachMovie(this.tip, 'msg', 17020); this.mouse_over_elem._x = this._x - 53; this.mouse_over_elem._y = this._y - 128; this.mouse_over_elem._alpha = 0; _root.setFadein(this.mouse_over_elem, 10); } } function extraDealMOut() { this.mouse_over_elem.removeMovieClip(); this.mouse_over_elem = undefined; } function transformClick(extradeal, color, shape) { _root.mainExtras.deactivate(); _root.mainDeck.deactivate(); _root.mainTable.deactivate(); extradeal.mouse_over_elem.removeMovieClip(); _root.playSound('tool_message.wav'); _root.mainExtras.remove(extradeal.idx); _root.transformToColor = color; _root.transformToShape = shape; if (color != undefined) { extrasAddTip(color + '_transform'); } if (shape != undefined) { extrasAddTip(shape + '_transform'); } _root.onMouseDown = _root.transformOnTileClick; _root.lastDealWarningIssued = false; } function transformOnTileClick() { var v2 = _root.mainTable.getSlotIdxAndSideFromCursor(); var v3 = _root.mainDeck.getSlotIdxAndSideFromCursor(); if ((v2 == undefined || _root.mainTable.getCard(v2.idx) == undefined) && v3 == undefined) { playSound('Illegal Click'); return false; } if (v2 != undefined) { if (!transformTableTile(v2.idx, v2.leftSide)) { return undefined; } } else { transformDeckTile(v3.idx, v3.leftSide); } _root.playSound('transform.wav'); _root.mainExtras.activate(); _root.mainDeck.activate(); _root.mainTable.activate(); extrasRemoveTip(); _root.onMouseDown = undefined; } function transformTableTile(idx, left) { var v3 = _root.mainTable.getCard(idx); var v2 = new cardObj(v3.leftColor, v3.leftShape, v3.rightColor, v3.rightShape); if (left) { if (_root.transformToColor != undefined) { v2.leftColor = _root.transformToColor; } if (_root.transformToShape != undefined) { v2.leftShape = _root.transformToShape; } } else { if (_root.transformToColor != undefined) { v2.rightColor = _root.transformToColor; } if (_root.transformToShape != undefined) { v2.rightShape = _root.transformToShape; } } _root.mainTable.setCard(idx, undefined); if (_root.mainTable.illegalPlacement(idx, v2, -1)) { _root.mainTable.setCard(idx, v3); playSound('Illegal Click'); return false; } else { var v4 = _root.mainTable.setCard(idx, v2); if (left) { if (_root.transformToColor != undefined) { _root.setFadein(v4.leftColor, 4); } if (_root.transformToShape != undefined) { _root.setFadein(v4.leftShape, 4); } return true; } if (_root.transformToColor != undefined) { _root.setFadein(v4.rightColor, 4); } if (_root.transformToShape != undefined) { _root.setFadein(v4.rightShape, 4); } return true; } } function transformDeckTile(idx, left) { var v4 = (_root.mainDeck.getCard(idx)).cardval; var v2 = new cardObj(v4.leftColor, v4.leftShape, v4.rightColor, v4.rightShape); if (left) { if (_root.transformToColor != undefined) { v2.leftColor = _root.transformToColor; } if (_root.transformToShape != undefined) { v2.leftShape = _root.transformToShape; } } else { if (_root.transformToColor != undefined) { v2.rightColor = _root.transformToColor; } if (_root.transformToShape != undefined) { v2.rightShape = _root.transformToShape; } } var v3 = _root.mainDeck.setCard(idx, v2); if (left) { if (_root.transformToColor != undefined) { _root.setFadein(v3.leftColor, 4); } if (_root.transformToShape != undefined) { _root.setFadein(v3.leftShape, 4); } return true; } if (_root.transformToColor != undefined) { _root.setFadein(v3.rightColor, 4); } if (_root.transformToShape != undefined) { _root.setFadein(v3.rightShape, 4); } return true; } function extrablue_transformClick() { transformClick(this, 'blue', undefined); } function extragreen_transformClick() { transformClick(this, 'green', undefined); } function extrared_transformClick() { transformClick(this, 'red', undefined); } function extrayellow_transformClick() { transformClick(this, 'yellow', undefined); } function extraluna_transformClick() { transformClick(this, undefined, 'luna'); } function extraterra_transformClick() { transformClick(this, undefined, 'terra'); } function extrasol_transformClick() { transformClick(this, undefined, 'sol'); } function extrastella_transformClick() { transformClick(this, undefined, 'stella'); } function extrasAddTip(name) { _root.extra_tip_mc = _root.getReggedStageMC(); with (_root.extra_tip_mc) { attachMovie(name + '_tip_mc', 'dummy', 10000); _x = 320; _y = 60; } } function extrasRemoveTip() { removeMovieClip(_root.extra_tip_mc); } function getRandomTip() { return tips[int(Math.random() * tips.length)]; } function getInstruction(idx) { if (instructions.length <= idx) { return undefined; } else { return instructions[idx]; } } function rpnInit() { var v3 = new TextFormat(); v3.font = 'AndalusNumbers'; v3.bold = true; v3.size = 18; var v2 = _root.points_txt; v3.color = 7623171; v2.setNewTextFormat(v3); v2.setTextFormat(v3); v2.sharpness = 0; v2.antiAliasType = 'advanced'; v2.selectable = false; v2.embedFonts = true; v2 = _root.level_txt; v3.color = 4203023; v2.setNewTextFormat(v3); v2.setTextFormat(v3); v2.sharpness = 0; v2.antiAliasType = 'advanced'; v2.selectable = false; v2.embedFonts = true; v2 = _root.total_points_txt; v3.color = 7672066; v2.setNewTextFormat(v3); v2.setTextFormat(v3); v2.sharpness = 0; v2.antiAliasType = 'advanced'; v2.selectable = false; v2.embedFonts = true; v2 = _root.instructions_txt; v3.font = 'Calligraphic'; v3.size = 14; v3.color = 7672066; v3.align = 'left'; v2.setNewTextFormat(v3); v2.setTextFormat(v3); v2.sharpness = 0; v2.antiAliasType = 'advanced'; v2.selectable = false; v2.embedFonts = true; var v4 = new Array(185, 185, 195, 205, 220); var v5 = new Array(368, 388, 408, 428, 448); _root.mainExtras = new rpnExtraDeals(47, 350, v4, v5); } function rpnGameOver() { return _root.mainTable.isFull() || _root.mainDeck.isEmpty() || _root.mainTimer != undefined && _root.mainTimer.isTimeElapsed(); } function rpnGameWon() { return _root.rpnGameOver() && _root.mainTable.getScore() == 48; } function rpnGameLost() { return _root.rpnGameOver() && !_root.rpnGameWon(); } function rpnNewGame(level, baseScore, from_quest) { if (level == 1 && from_quest != false) { from_quest = true; } if (from_quest) { _root.levelDone = false; } _root.onMouseDown = undefined; _root.onMouseUp = undefined; _root.level_txt.text = level; _root.currentLevel = level; _root.baseScore = baseScore; _root.bonusesGiven = false; _root.roundBonusPoints = 0; if (from_quest) { _root.clearStage(); } if (!_root.isTutorialRunning()) { _root.tutorial_txt.text = ''; } else { _root.tutorial_text_bg_mc = _root.getReggedStageMC(); _root.tutorial_text_bg_mc.swapDepths(_root.tutorial_txt); tutorial_text_bg_mc.attachMovie('tutorial_text_bg_mc', 'bg_mc', 10000); tutorial_text_bg_mc._x = 38; tutorial_text_bg_mc._y = 376; } _root.mainExtras.activate(); _root.mainExtras.refresh(); _root.lastDealWarningIssued = false; _root.highScoresUpdated = false; if (from_quest != true && !_root.isTutorialRunning() && _root.currentLevel <= 30) { rpnLoadQuestScreen(); return undefined; } _root.levelUpdated = false; inGame = true; _root.game_bg_mc2 = _root.getReggedStageMC(); _root.game_bg_mc2.swapDepths(-16383); _root.game_bg_mc2._alpha = 100; var v5 = int((level - 1) / 10) + 1; if (v5 > 3) { v5 = 3; } if (_root.isTutorialRunning()) { v5 = 0; } _root.game_bg_mc2.attachMovie('game_bg' + v5 + '_mc', 'bg', -5000); _root.game_bg_mc2._x = 0; _root.game_bg_mc2._y = 0; if (_root.currentLevel <= 30) { _root.dragon_mc = _root.getReggedStageMC(); _root.dragon_mc.attachMovie('dragon_fire_bad_mc', 'movie', _root.getNextDepth()); _root.dragon_mc._x = -2; _root.dragon_mc._y = 0; _root.dragon_mc.movie.gotoAndStop(1); } else { _root.dragon_mc.removeMovieClip('movie'); } _root.victory_mc = _root.getReggedStageMC(); _root.victory_mc.attachMovie('Star Burst', 'movie', _root.getNextDepth()); _root.victory_mc._x = 0; _root.victory_mc._y = 0; _root.victory_mc.movie.gotoAndStop('start'); _root.wizard_wand_mc = _root.getReggedStageMC(); _root.wizard_wand_mc.swapDepths(1000); _root.wizard_wand_mc.attachMovie('Wand', 'movie', 1000); _root.wizard_wand_mc._x = 0; _root.wizard_wand_mc._y = 0; _root.wizard_wand_mc.movie.onlyOnce = true; _root.wizard_wand_mc.movie.gotoAndStop('prestart'); _root.text_highlight_mc = _root.getReggedStageMC(); _root.text_highlight_mc.attachMovie('Text Highlight', 'movie', _root.getNextDepth()); _root.text_highlight_mc._x = -8; _root.text_highlight_mc._y = -6; _root.text_highlight_mc.movie.gotoAndStart('start'); if (_root.gameMode == 'survival') { rpnInitTimer(); } else { _root.mainTimer = undefined; } _root.resetTableAndDeck(); rpnStopSynergies(false); _root.won_this_round_txt._visible = false; _root.setSynergy(); var v3 = _root.generateConstraints(_root.level_txt.text, _root.mainTable.mSlotsNum); var v2 = 0; while (v2 < v3.length) { _root.mainTable.setConstraint(v3[v2].idx, v3[v2].cnstr); ++v2; } _root.rpnPlayBGMusic(undefined); _root.playSequencedSound('StartGame', _root.moveToGameMusic); _root.addExtrasByLevel(level); _root.instructions_txt.text = ''; _root.hasBonuses = false; _root.currInstructionIdx = 0; if (!_root.isTutorialRunning()) { _root.setInstructionsColor(1399040, 14); _root.rpnSetTextMessage('Level ' + level + ' begins!\n'); if (level == 1) { _root.setInstructionsColor(7672066, 14); _root.currInstructionIdx = 1; _root.textIsInstruction = true; _root.rpnAddTextMessage('1. ' + _root.getInstruction(0)); } if (level == 2) { _root.setInstructionsColor(7672066, 14, true, -0.5); _root.rpnAddTextMessage('The triangle in the inner circle is a "limiter". The two tiles you put next to it have to match the way the limiter shows. This limiter is a "color" limiter - the two tiles must have matching colors.\n'); } if (level == 4) { _root.setInstructionsColor(7672066, 14); _root.rpnAddTextMessage('Every synergic match you create this round will get you special bonuses. You can see the synergic couple on the right, above the level box.'); } if (level == 10) { _root.setInstructionsColor(7672066, 14); _root.rpnAddTextMessage('From now on, you will get special power-ups every 5 levels - "transform tools". These tools can change one color or one symbol to another.'); } } _root.loadMouse(); _root.mainTable.deactivate(); _root.mainDeck.deactivate(); _root.mainExtras.deactivate(); DeactivateDeal(); _root.menu_mc.onRelease = undefined; _root.menu_mc.enabled = false; _root.deal_mc.enabled = false; _root.tip_btn.enabled = false; if (!(level == 1 || level == 10 || level == 15 || level == 20 || level == 25 || level == 30 || level > 30)) { _root.rpnNotifyExtrasAdded(); } if (level != 0) { _root.lastGameWasTutorial = false; } } function resetTableAndDeck() { var tableSlots = Array(); tableSlots.push('dummy'); var i = 1; while (i <= 8) { tableSlots.push(eval('_root.circleSlot' + i + '_mc')); ++i; } _root.mainDeck.unsetExtras(); delete _root.mainTable; _root.mainTable = new rpnTable(8, tableSlots); delete _root.mainDeck; _root.mainDeck = new rpnDeck(4); } function rpnReset() { _root.mainExtras.reset(); _root.mainTable.reset(); _root.mainDeck.reset(); inGame = false; } function rpnPlayBGMusic(name) { if (_root.bgmusic_on != name) { _root.bgmusic_sound.stop(); delete _root.bgmusic_sound; _root.bgmusic_sound = new Sound(); _root.bgmusic_sound.attachSound(name); if (_root.bgMusicEnabled) { _root.bgmusic_sound.start(0, 100000); } _root.bgmusic_on = name; } } function rpnEnableBGMusic() { _root.bgMusicEnabled = true; _root.bgmusic_sound.start(0, 100000); } function rpnDisableBGMusic() { _root.bgMusicEnabled = false; _root.bgmusic_sound.stop(); } function rpnEnableSounds() { _root.bgSoundsEnabled = true; } function rpnDisableSounds() { _root.bgSoundsEnabled = false; } function rpnHandleGameWon() { inGame = false; _root.endTutorial(); _root.mainDeck.unsetExtras(); _root.mainTimer.suspendTimer(); _root.mainTable.deactivate(); _root.mainDeck.deactivate(); _root.mainExtras.deactivate(); _root.DeactivateDeal(); _root.menu_mc.onRelease = undefined; _root.menu_mc.enabled = false; _root.tip_btn.enabled = false; if (_root.currentLevel <= 30) { _root.dragon_mc.removeMovieClip('movie'); _root.dragon_mc = _root.getReggedStageMC(); _root.dragon_mc.swapDepths(20499); _root.dragon_mc.attachMovie('dragon_fire_good_mc', 'movie', _root.getNextDepth()); _root.dragon_mc._x = -2; _root.dragon_mc._y = 0; _root.dragon_mc.movie.gotoAndPlay(1); } } function rpnHandleBonuses() { var v5 = false; var v2 = getHarmonicPoints(); if (v2 != undefined) { _root.addExtraDeals(2, v2.D2); _root.addExtraDeals(3, v2.D3); _root.addExtraDeals(4, v2.D4); _root.addExtraBonuses('red_bomb', v2.RB); _root.addExtraBonuses('switch', v2.SW); _root.addExtraBonuses('joker', v2.JO); _root.addExtraBonuses('blue_bomb', v2.BB); if (v2.D2 > 0 || v2.D3 > 0 || v2.D4 > 0 || v2.RB > 0 || v2.SW > 0 || v2.JO > 0 || v2.BB > 0) { v5 = true; } _root.roundBonusPoints += Number(v2.points); } var v3 = getPoolPoints(); _root.addExtraDeals(2, v3.D2); _root.addExtraDeals(3, v3.D3); _root.addExtraDeals(4, v3.D4); _root.addExtraBonuses('red_bomb', v3.RB); _root.addExtraBonuses('switch', v3.SW); _root.addExtraBonuses('joker', v3.JO); _root.addExtraBonuses('blue_bomb', v3.BB); if (v3.D2 > 0 || v3.D3 > 0 || v3.D4 > 0 || v3.RB > 0 || v3.SW > 0 || v3.JO > 0 || v3.BB > 0) { v5 = true; } _root.roundBonusPoints += Number(v3.points); var v7 = _root.hasBonuses; var v4 = getSynergyPoints(); _root.addExtraDeals(2, v4.D2); _root.addExtraDeals(3, v4.D3); _root.addExtraDeals(4, v4.D4); if (v4.D2 > 0 || v4.D3 > 0 || v4.D4 > 0) { v5 = true; } _root.mainTable.deactivate(); _root.mainDeck.deactivate(); _root.mainExtras.deactivate(); if (_root.mainTimer != undefined) { var v6 = int(_root.mainTimer.remainingSeconds()) * 2; if (v6 > 0) { _root.addSpecialSetsMsg('Survival time bonus, ', v6, 0, 0, 0, 0, 0, 0, 0); } _root.roundBonusPoints += v6; } if (!v7) { _root.setInstructionsColor(1510, 14); _root.rpnAddTextMessage('Don\'t forget: creating special sets will get you special bonuses!\n'); } _root.setInstructionsColor(617, 16, false); _root.rpnAddTextMessage('Click anywhere to continue\n'); if (!v5) { _root.rpnNotifyExtrasAdded(); } clearInterval(_root.bonusIntervalId); _root.bonusesGiven = true; } function dragonDefeatedAfterEffect() { var v2 = _root.getReggedStageMC(); v2.attachMovie('end_game_mc', 'dummy', 15000); v2.swapDepths(15000); v2._x = -23.6; v2._y = -52.1; } function rpnInitTimer() { _root.timer_green_bg_mc = _root.getReggedStageMC(); _root.timer_green_bg_mc.swapDepths(18702); with (_root.timer_green_bg_mc) { attachMovie('timer_green_bg_mc', 'movie', 18702); _x = 503; _y = 63; } _root.timer_mask_mc = _root.getReggedStageMC(); _root.timer_mask_mc.swapDepths(18701); with (_root.timer_mask_mc) { attachMovie('timer_mask_mc', 'movie', 18701); _x = 503; _y = 63; } _root.timer_green_bg_mc.setMask(_root.timer_mask_mc); _root.mainTimer = new cpiTimer(_root.timer_mask_mc); var timerLength = Math.min(120 + 4 * _root.currentLevel, 240) * 1000; _root.mainTimer.startTimer(timerLength); _root.mainTimer.suspendTimer(); _root.timer_mc = _root.getReggedStageMC(); _root.timer_mc.swapDepths(18700); with (_root.timer_mc) { attachMovie('timer_bg_mc', 'movie', 18700); _x = 503; _y = 63; } } function rpnHandleGameLost() { inGame = false; _root.endTutorial(); _root.mainTable.deactivate(); _root.mainDeck.deactivate(); _root.mainExtras.deactivate(); DeactivateDeal(); _root.menu_mc.onRelease = undefined; _root.menu_mc.enabled = false; _root.mainDeck.unsetExtras(); _root.mainTimer.suspendTimer(); _root.rpnPlayBGMusic(undefined); _root.dragon_mc.swapDepths(22000); if (_root.currentLevel <= 30) { _root.dragon_mc.movie.gotoAndPlay(2); } else { _root.raiseGameOverSign(); } } function raiseGameOverSign() { _root.playSequencedSound('Game Over', _root.moveToBGMusic); if (_root.currentLevel <= 30) { _root.setInstructionsColor(7672066, 14); _root.rpnSetTextMessage('The ring was not strong enough to stop the dragon and you have been incinerated...\n'); _root.playSound('New Message'); } _root.setInstructionsColor(1510, 30); _root.rpnAddTextMessage('Game Over\n'); _root.setInstructionsColor(1510, 14); _root.rpnAddTextMessage('Click anywhere to continue\n'); _root.onMouseUp = rpnLostClick; } function raiseGameWonSign() { _root.victory_mc.movie.play(); _root.playSound('Ring Complete'); _root.instructions_txt.text = ''; _root.instructions_txt.filters = filter; _root.setInstructionsColor(622336, 18, true); _root.rpnSetTextMessage('\n'); _root.setWonColor(); _root.won_this_round_txt._visible = true; _root.playSound('New Message'); if (!_root.lastGameWasTutorial) { _root.bonusIntervalId = setInterval(rpnHandleBonuses, 1000); } else { trace('No bonuses for tutorial'); _root.rpnNotifyExtrasAdded(); _root.bonusesGiven = true; } } function moveToBGMusic() { _root.rpnPlayBGMusic('background_music'); } function moveToGameMusic() { _root.rpnPlayBGMusic('game_music'); } function rpnDealClicked() { _root.playSound('button1.wav'); _root.tutorialNotifyDealClicked(); if (!_root.rpnGameOver()) { _root.handleDealClickGameNotOver(); return undefined; } if (_root.lastGameWasTutorial) { _root.mainExtras.reset(); _root.rpnNewGame(1, 0, false); return undefined; } if (_root.rpnGameWon()) { _root.baseScore += Number(_root.points_txt.text); ++_root.currentLevel; _root.rpnNewGame(_root.currentLevel, _root.baseScore); return undefined; } if (!_root.highScoresUpdated) { if (_root.handleHighScoresUpdate()) { return undefined; } } _root.mainExtras.reset(); _root.jumpToEntry(); } function setInstructionsColor(color, size, isBold, letterSpacing) { if (isBold == undefined) { isBold = true; } if (letterSpacing == undefined) { letterSpacing = 0; } var v2 = new TextFormat(); v2.font = 'Calligraphic'; v2.bold = isBold; v2.size = size; v2.letterSpacing = letterSpacing; var v3 = _root.instructions_txt; v2.color = color; v3.setNewTextFormat(v2); v3.sharpness = 0; v3.antiAliasType = 'advanced'; v3.selectable = false; v3.embedFonts = true; } function setWonColor() { color = 622336; size = 18; bold = true; if (isBold == undefined) { isBold = true; } if (letterSpacing == undefined) { letterSpacing = 0; } var v2 = new TextFormat(); v2.font = 'Calligraphic'; v2.bold = isBold; v2.size = size; v2.letterSpacing = letterSpacing; var v3 = _root.instructions_txt; v2.color = color; v3.setNewTextFormat(v2); v3.sharpness = 0; v3.antiAliasType = 'advanced'; v3.selectable = false; v3.embedFonts = true; } function setTipColor(color, size) { var v2 = new TextFormat(); v2.font = 'Calligraphic'; v2.bold = true; v2.size = size; v2.letterSpacing = 0; var v3 = _root.tips_box.movie.tip_txt; v2.color = color; v3.setNewTextFormat(v2); v3.sharpness = 0; v3.antiAliasType = 'advanced'; v3.selectable = false; v3.embedFonts = true; } function rpnAddTextMessage(msg) { if (_root.currentLevel == 0) { return undefined; } _root.textIsIntstruction = false; _root.instructions_txt.replaceText(10000, 10000, msg); } function rpnSetTextMessage(msg) { if (_root.currentLevel == 0) { return undefined; } _root.textIsInstruction = false; _root.instructions_txt.text = msg; } function rpnSetInstructionTextMessage(msg) { if (_root.currentLevel == 0) { return undefined; } _root.textIsInstruction = true; _root.instructions_txt.text = msg; } function updateInstructionInWindow() { if (!_root.textIsInstruction) { _root.currInstructionIdx = 0; } var v2 = _root.currInstructionIdx + 1; var v3 = _root.getInstruction(v2 - 1); if (v3 == undefined) { _root.currInstructionIdx = 0; updateInstructionInWindow(); return undefined; } _root.setInstructionsColor(7672066, 14); rpnSetInstructionTextMessage(v2 + '. ' + v3); ++_root.currInstructionIdx; } function DeactivateDeal() { _root.deal_mc.onPress = undefined; } function ActivateDeal() { _root.deal_mc.onPress = _root.rpnDealClicked; } function rpnNotifyExtrasAdded() { if (_root.rpnGameOver()) { if (_root.currentLevel == 30) { var v2 = _root.getReggedStageMC(); v2.attachMovie('end_game_mc', 'dummy', 15000); v2.swapDepths(15000); v2._x = -25.5; v2._y = -51; } _root.deal_mc.onPress = undefined; if (_root.currentLevel < 30) { _root.onMouseUp = _root.rpnDealClicked; } else { _root.onMouseUp = _root.rpnNextRoundAfter30; } } else { _root.mainTable.activate(); _root.mainDeck.activate(); _root.mainExtras.activate(); _root.mainTimer.resumeTimer(); _root.menu_mc.onRelease = rpnMenuReleased; _root.menu_mc.enabled = true; _root.deal_mc.enabled = true; _root.tip_btn.enabled = true; ActivateDeal(); } } function rpnLoadQuestScreen(level) { _root.mainTable.deactivate(); _root.mainDeck.deactivate(); _root.mainExtras.deactivate(); _root.tip_btn.enabled = false; if (level == undefined) { level = _root.currentLevel; } _root.quest_screen_mc = _root.getReggedStageMC(); _root.quest_screen_mc.attachMovie('quest_screen_mc', 'dummy', 23000); _root.quest_screen_mc.swapDepths(23000); _root.quest_screen_mc._x = 0; _root.quest_screen_mc._y = 0; var v7 = 106; var v9 = 320; var v8 = 214; var v2 = 1; while (v2 <= 30) { var v3 = _root.quest_screen_mc.attachMovie('circle_mc', 'sand_circle' + v2, 23000 + v2); var v5 = 0.1903995547630177; var v4 = v2 * v5; if (v2 > 10) { v4 += v5; } if (v2 > 20) { v4 += v5; } v3._x = v9 + v7 * Math.sin(v4); v3._y = v8 - v7 * Math.cos(v4); if (v2 < level) { v3.gotoAndStop('big'); } if (v2 > level) { v3.gotoAndStop('small'); } if (v2 == level) { v3.gotoAndPlay('small'); } ++v2; } var v10 = new mx.transitions.Tween(_root.quest_screen_mc, '_alpha', mx.transitions.easing.Regular.easeIn, 0, 100, 1, 1); v10.onMotionFinished = function () { _root.quest_screen_mc.dummy.next_quest_txt.text = _root.quest_screen_mc.next_txt; }; } function rpnNextRound() { rpnNewGame(_root.currentLevel, _root.baseScore, true); } function rpnNextRoundAfter30() { _root.baseScore += Number(_root.points_txt.text); ++_root.currentLevel; rpnNextRound(); } function rpnLostClick() { _root.onMouseUp = undefined; _root.rpnDealClicked(); } function rpnStopSynergies(remove) { var i = 1; while (i <= 8) { var li = (i == 8) ? 1 : i + 1; var synergyName = 'synergy' + i + li + '_mc'; var synergy = eval('_root.' + synergyName); synergy.gotoAndStop(1); synergy.running = false; var barName = 'bar' + i + li + '_mc'; var bar = eval('_root.' + barName); bar.gotoAndStop(1); bar.running = false; bar._visible = false; if (remove == true) { removeMovieClip(synergy); removeMovieClip(bar); } ++i; } } function rpnMenuReleased() { if (_root.gameMenu_mc != undefined) { return undefined; } _root.playSound('button1.wav'); if (_root.rpnGameOver()) { if (_root.handleHighScoresUpdate()) { return undefined; } } _root.inGameMenuDisabled = false; _root.mainTable.deactivate(); _root.mainDeck.deactivate(); _root.mainExtras.deactivate(); _root.DeactivateDeal(); _root.mainTimer.suspendTimer(); _root.menu_mc.enabled = false; _root.deal_mc.enabled = false; _root.tip_btn.enabled = false; _root.gameMenu_mc = _root.getReggedStageMC(); var v2 = _root.gameMenu_mc; v2.swapDepths(21000); v2.attachMovie('inGameMenu_mc', 'movie', 21000); v2._x = 0; v2._y = 0; _root.setFadein(v2, 10); } function getHarmonicPoints() { var v2 = new Object(); var v6 = _root.mainTable.countTiles(); v2.points = 0; v2.D2 = 0; v2.D3 = 0; v2.D4 = 0; v2.RB = 0; v2.SW = 0; v2.JO = 0; v2.BB = 0; var v3 = getHarmonicPointsDouble(v6); var v5 = getHarmonicPointsSingleSymbol(v6); var v4 = getHarmonicPointsSingleColor(v6); if (v3.len > 1) { v2.points += v3.points; v2.D2 += v3.D2; v2.D3 += v3.D3; v2.D4 += v3.D4; v2.RB += v3.RB; v2.SW += v3.SW; v2.JO += v3.JO; v2.BB += v3.BB; var v7 = (v3.len == 2) ? 'Doubles Harmony, ' : ((v3.len == 3) ? 'Double Triples Harmony, ' : 'Full Harmony, '); _root.addSpecialSetsMsg(v7, v3.points, v3.D2, v3.D3, v3.D4, v3.RB, v3.SW, v3.JO, v3.BB); } if (v5.len > v3.len) { v2.points += v5.points; v2.D2 += v5.D2; v2.D3 += v5.D3; v2.D4 += v5.D4; v2.RB += v5.RB; v2.SW += v5.SW; v2.JO += v5.JO; v2.BB += v5.BB; v7 = (v5.len == 2) ? 'Symbols Harmony, ' : ((v5.len == 3) ? 'Symbol Triples Harmony, ' : 'Symbol Quadruples Harmony, '); _root.addSpecialSetsMsg(v7, v5.points, v5.D2, v5.D3, v5.D4, v5.RB, v5.SW, v5.JO, v5.BB); } if (v4.len > v3.len) { v2.points += v4.points; v2.D2 += v4.D2; v2.D3 += v4.D3; v2.D4 += v4.D4; v2.RB += v4.RB; v2.SW += v4.SW; v2.JO += v4.JO; v2.BB += v4.BB; v7 = (v4.len == 2) ? 'Colors Harmony, ' : ((v4.len == 3) ? 'Color Triples Harmony, ' : 'Color Quadruples Harmony, '); _root.addSpecialSetsMsg(v7, v4.points, v4.D2, v4.D3, v4.D4, v4.RB, v4.SW, v4.JO, v4.BB); } return v2; } function getHarmonicPointsDouble(tilesCnt) { var v5 = new Array(2, 3, 4); var v13 = new Array(30, 400, 2000); var v12 = new Array(0, 0, 0); var v11 = new Array(0, 1, 0); var v10 = new Array(0, 0, 4); var v8 = new Array(0, 0, 1); var v6 = new Array(0, 0, 1); var v7 = new Array(0, 0, 1); var v9 = new Array(0, 1, 1); var v2 = new Object(); v2.len = 0; var v1 = v5.length - 1; while (v1 >= 0) { var v4 = v5[v1]; if (Math.min(Math.min(tilesCnt.sol, tilesCnt.luna), Math.min(tilesCnt.terra, tilesCnt.stella)) >= v4 && Math.min(Math.min(tilesCnt.red, tilesCnt.green), Math.min(tilesCnt.yellow, tilesCnt.blue)) >= v4) { v2.len = v4; v2.points = v13[v1]; v2.D2 = v12[v1]; v2.D3 = v11[v1]; v2.D4 = v10[v1]; v2.RB = v8[v1]; v2.SW = v6[v1]; v2.JO = v7[v1]; v2.BB = v9[v1]; break; } --v1; } return v2; } function getHarmonicPointsSingleSymbol(tilesCnt) { var v5 = new Array(3, 4); var v13 = new Array(160, 1000); var v12 = new Array(0, 0); var v11 = new Array(0, 2); var v10 = new Array(0, 1); var v8 = new Array(0, 0); var v6 = new Array(0, 0); var v7 = new Array(0, 1); var v9 = new Array(0, 0); var v2 = new Object(); v2.len = 0; var v1 = v5.length - 1; while (v1 >= 0) { var v4 = v5[v1]; if (Math.min(Math.min(tilesCnt.sol, tilesCnt.luna), Math.min(tilesCnt.terra, tilesCnt.stella)) >= v4) { v2.len = v4; v2.points = v13[v1]; v2.D2 = v12[v1]; v2.D3 = v11[v1]; v2.D4 = v10[v1]; v2.RB = v8[v1]; v2.SW = v6[v1]; v2.JO = v7[v1]; v2.BB = v9[v1]; break; } --v1; } return v2; } function getHarmonicPointsSingleColor(tilesCnt) { var v5 = new Array(3, 4); var v13 = new Array(120, 900); var v12 = new Array(0, 1); var v11 = new Array(0, 1); var v10 = new Array(0, 1); var v8 = new Array(0, 0); var v6 = new Array(0, 0); var v7 = new Array(0, 1); var v9 = new Array(0, 0); var v2 = new Object(); v2.len = 0; var v1 = v5.length - 1; while (v1 >= 0) { var v4 = v5[v1]; if (Math.min(Math.min(tilesCnt.red, tilesCnt.blue), Math.min(tilesCnt.green, tilesCnt.yellow)) >= v4) { v2.len = v4; v2.points = v13[v1]; v2.D2 = v12[v1]; v2.D3 = v11[v1]; v2.D4 = v10[v1]; v2.RB = v8[v1]; v2.SW = v6[v1]; v2.JO = v7[v1]; v2.BB = v9[v1]; break; } --v1; } return v2; } function getPoolPoints() { var tilesCnt = _root.mainTable.countTiles(); var reqs = new Array(8, 9, 10, 11, 12, 13, 14, 15, 16); var pts = new Array(30, 60, 120, 250, 400, 800, 1300, 1800, 2500); var d2 = new Array(0, 1, 0, 1, 0, 1, 0, 0, 0); var d3 = new Array(0, 0, 1, 0, 0, 1, 0, 0, 0); var d4 = new Array(0, 0, 0, 1, 2, 1, 3, 4, 5); var rb_bonus = new Array(0, 0, 1, 1, 1, 1, 2, 2, 3); var s_bonus = new Array(1, 1, 1, 1, 2, 2, 2, 3, 3); var j_bonus = new Array(0, 1, 1, 1, 1, 1, 2, 2, 3); var bb_bonus = new Array(0, 1, 1, 1, 1, 2, 2, 3, 3); var possiblePools = new Array(); var octColorPts = getDoubleOctColorPts(tilesCnt); var octShapePts = getDoubleOctShapePts(tilesCnt); var ptsObj = new Object(); ptsObj.points = 0; ptsObj.D2 = 0; ptsObj.D3 = 0; ptsObj.D4 = 0; ptsObj.RB = 0; ptsObj.SW = 0; ptsObj.JO = 0; ptsObj.BB = 0; if (octColorPts != undefined && octShapePts != undefined) { ptsObj.points = 1600; ptsObj.D4 = 3; ptsObj.RB = 1; ptsObj.JO = 1; var msg = 'Minor Full Harmony, '; _root.addSpecialSetsMsg(msg, ptsObj.points, ptsObj.D2, ptsObj.D3, ptsObj.D4, ptsObj.RB, ptsObj.SW, ptsObj.JO, ptsObj.BB); return ptsObj; } if (octColorPts != undefined) { ptsObj.points += octColorPts.points; ptsObj.D2 += octColorPts.D2; ptsObj.D3 += octColorPts.D3; ptsObj.D4 += octColorPts.D4; ptsObj.RB += octColorPts.RB; ptsObj.SW += octColorPts.SW; ptsObj.JO += octColorPts.JO; ptsObj.BB += octColorPts.BB; var msg = 'Two Colors Harmony, '; _root.addSpecialSetsMsg(msg, octColorPts.points, octColorPts.D2, octColorPts.D3, octColorPts.D4, octColorPts.RB, octColorPts.SW, octColorsPts.JO, octColorPts.BB); } else { possiblePools.push('red'); possiblePools.push('blue'); possiblePools.push('green'); possiblePools.push('yellow'); } if (octShapePts != undefined) { ptsObj.points += octShapePts.points; ptsObj.D2 += octShapePts.D2; ptsObj.D3 += octShapePts.D3; ptsObj.D4 += octShapePts.D4; ptsObj.RB += octColorPts.RB; ptsObj.SW += octColorPts.SW; ptsObj.JO += octColorPts.JO; ptsObj.BB += octColorPts.BB; var msg = 'Two Symbols Harmony, '; _root.addSpecialSetsMsg(msg, octShapePts.points, octShapePts.D2, octShapePts.D3, octShapePts.D4, octShapePts.RB, octShapePts.SW, octShapePts.JO, octShapePts.BB); } else { possiblePools.push('luna'); possiblePools.push('terra'); possiblePools.push('sol'); possiblePools.push('stella'); } for (var elem in possiblePools) { var type = possiblePools[elem]; var tilesNum = eval('tilesCnt.' + type); var i = reqs.length - 1; while (i >= 0) { var k = _root.isColor(type) ? i + 1 : i; if (k >= reqs.length) { } else { if (tilesNum < reqs[k]) { } else { var msg = (type.charAt(0)).toUpperCase() + type.substr(1, type.length - 1); msg += ' ' + reqs[k] + ' Pool, '; var RB = (type == 'sol' || type == 'red') ? rb_bonus[i] : 0; var SW = (type == 'luna' || type == 'yellow') ? s_bonus[i] : 0; var JO = (type == 'terra' || type == 'green') ? j_bonus[i] : 0; var BB = (type == 'stella' || type == 'blue') ? bb_bonus[i] : 0; _root.addSpecialSetsMsg(msg, pts[i], d2[i], d3[i], d4[i], RB, SW, JO, BB); ptsObj.points += pts[k]; ptsObj.D2 += d2[i]; ptsObj.D3 += d3[i]; ptsObj.D4 += d4[i]; ptsObj.RB += RB; ptsObj.SW += SW; ptsObj.JO = JO; ptsObj.BB += BB; break; } } --i; } } return ptsObj; } function getDoubleOctColorPts(tilesCnt) { var eights = 0; var colors = new Array('red', 'blue', 'green', 'yellow'); for (idx in colors) { var c = colors[idx]; var cnt = eval('tilesCnt.' + c); if (cnt == 8) { ++eights; } } if (eights == 2) { var retVal = new Object(); retVal.points = 600; retVal.D2 = 1; retVal.D3 = 0; retVal.D4 = 1; retVal.RB = 1; retVal.SW = 0; retVal.JO = 0; retVal.BB = 0; return retVal; } return undefined; } function getSynergyPoints() { var v2 = new Object(); v2.D2 = 0; v2.D3 = 0; v2.D4 = 0; v2.points = _root.getSynergyScore(); var v3 = countSynergies(); if (v3 < 2) { return v2; } if (v3 >= 2) { v2.D3 = 1; } if (v3 > 2) { v2.D4 = v3 - 2; } _root.addSpecialSetsMsg('Synergy pairs, ', v2.points, v2.D2, v2.D3, v2.D4, 0, 0, 0, 0); return v2; } function getSynergyScore() { var v1 = countSynergies(); if (v1 == 0) { return 0; return 0; } if (v1 == 1) { return 50; return 0; } if (v1 == 2) { return 150; return 0; } if (v1 == 3) { return 500; return 0; } if (v1 >= 4) { return 500 + 1000 * (v1 - 3); } return 0; } function countSynergies() { var v2 = 0; var v1 = 1; while (v1 <= 8) { if (checkSynergy(v1)) { ++v2; } ++v1; } return v2; } function checkSynergy(i) { var v3 = _root.mainTable.getCard(i); var v4 = (i == 8) ? 1 : i + 1; if (i == _root.mainTable.liftedIdx || v4 == _root.mainTable.liftedIdx) { return false; } var v2 = _root.mainTable.getCard(v4); if (v3 == undefined || v2 == undefined) { return false; } if (!_root.mainTable.cardsMatch(v2, v3)) { return false; } if ((v2.rightColor == _root.synergy1 || v2.rightShape == _root.synergy1) && (v3.leftColor == _root.synergy2 || v3.leftShape == _root.synergy2)) { return true; } if ((v2.rightColor == _root.synergy2 || v2.rightShape == _root.synergy2) && (v3.leftColor == _root.synergy1 || v3.leftShape == _root.synergy1)) { return true; } return false; } function getDoubleOctShapePts(tilesCnt) { var eights = 0; var shapes = new Array('sol', 'luna', 'terra', 'stella'); for (idx in shapes) { var s = shapes[idx]; var cnt = eval('tilesCnt.' + s); if (cnt == 8) { ++eights; } } if (eights == 2) { var retVal = new Object(); retVal.points = 700; retVal.D2 = 0; retVal.D3 = 1; retVal.D4 = 1; retVal.RB = 0; retVal.SW = 1; retVal.JO = 0; retVal.BB = 0; return retVal; } return undefined; } function getTextColor() { return 9830480; } function getBonusColor() { return 25610; } function setTextColor() { _root.setInstructionsColor(getTextColor(), 14, false); } function setBonusColor() { _root.setInstructionsColor(getBonusColor(), 14, true); } function addSpecialSetsMsg(msg, points, d2, d3, d4, red_bombs, switchs, jokers, blue_bombs) { if (_root.hasBonuses == false) { _root.setInstructionsColor(617, 14, false); appendGeneralMsg('Special sets you have created:\n'); } _root.hasBonuses = true; setTextColor(); appendGeneralMsg(msg); if (points == undefined) { return undefined; } if (points != 0) { setBonusColor(); appendGeneralMsg(points); setTextColor(); appendGeneralMsg(' pts'); } var v2 = 2 * d2 + 3 * d3 + 4 * d4; appendBonusMsg(v2, 'tile'); appendBonusMsg(red_bombs, 'red bomb'); appendBonusMsg(switchs, 'switch'); appendBonusMsg(jokers, 'joker'); appendBonusMsg(blue_bombs, 'blue bomb'); appendGeneralMsg('\n'); } function appendGeneralMsg(msg) { if (_root.currentLevel == 0) { return undefined; } _root.instructions_txt.replaceText(10000, 10000, msg); } function appendBonusMsg(amount, type) { if (amount != 0) { setTextColor(); appendGeneralMsg(', '); setBonusColor(); appendGeneralMsg(amount + ' '); setTextColor(); if (amount != 1) { appendGeneralMsg(type + 's'); } else { appendGeneralMsg(type); } } } function frameRefresh() { Mouse.hide(); if (_root.levelUpdated) { return undefined; } handleOutOfBounds(); _root.mainTimer.updateTime(); _root.mainTable.applyNewBars(); _root.applyNewSynergies(); _root.mainTable.updateBrightMatchs(); var v3 = _root.isTutorialRunning(); if (v3) { _root.advanceTutorial(); } if (isNaN(_root.baseScore)) { _root.baseScore = 0; } var v2 = _root.getSynergyScore(); if (_root.currentLevel == 0) { _root.points_txt.text = ''; _root.total_points_txt.text = ''; } else { _root.points_txt.text = _root.mainTable.getScore() + v2 + _root.roundBonusPoints; _root.total_points_txt.text = _root.mainTable.getScore() + _root.baseScore + v2 + _root.roundBonusPoints; } if (_root.levelDone) { if (_root.bonusesGiven) { _root.levelUpdated = true; } return undefined; } if (!_root.rpnGameOver() && !_root.rpnGameWon()) { return undefined; } _root.mainDeck.deactivate(); _root.mainTable.deactivate(); _root.mainExtras.deactivate(); if (levelDone) { return undefined; } if (_root.rpnGameWon()) { _root.rpnHandleGameWon(); } if (_root.rpnGameLost()) { _root.rpnHandleGameLost(); } levelDone = true; } function jumpToEntry() { _root.inGame = false; _root.mainDeck.clear(); _root.tutorial_txt.text = ''; _root.resetTableAndDeck(); _root.rpnStopSynergies(true); gotoAndStop(1); _root.clearStage(); _root.mainTable.reset(); _root.mainDeck.clear(); } function jumpToScores() { _root.inGame = false; _root.mainDeck.clear(); _root.resetTableAndDeck(); _root.rpnStopSynergies(true); gotoAndStop('highscore'); _root.clearStage(); _root.mainTable.reset(); _root.mainDeck.clear(); } function handleOutOfBounds() { if (!stageArea_mc.hitTest(_root._xmouse, _root._ymouse)) { var v2 = _root.currentTile(); } if (v2 != undefined) { v2.onRelease(); } } function reshuffleCardsAfterCrack() { _root.playSound('deal.wav', _root.mainDeck.activeSlots()); } var nextAvailableDepth; var nonReggedMCs; var genColorPerLevel = new Array(0, 1, 0, 1, 2, 0, 0, 1, 1, 0, 1, 1, 1, 2, 1, 0, 1, 0, 0, 1, 2, 1, 1, 0, 2, 2, 1, 2, 1, 2); var genShapePerLevel = new Array(0, 0, 1, 1, 0, 1, 0, 1, 1, 1, 0, 1, 1, 0, 0, 1, 1, 1, 0, 2, 0, 1, 1, 2, 2, 2, 3, 1, 2, 2); var spcColorPerLevel = new Array(0, 0, 0, 0, 0, 1, 1, 1, 0, 2, 0, 1, 2, 0, 2, 1, 1, 2, 2, 2, 2, 2, 1, 1, 2, 1, 1, 2, 1, 2); var spcShapePerLevel = new Array(0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 2, 1, 0, 2, 1, 2, 2, 2, 3, 1, 2, 2, 3, 3, 1, 2, 2, 2, 3, 2); var advGenColorPerLevel = new Array(1, 1, 0, 1, 1, 1, 1, 2, 1, 1, 0, 2, 1, 0, 1, 0, 0, 2, 1, 2, 1, 0, 3, 2, 2, 1, 1, 3, 2, 2); var advGenShapePerLevel = new Array(1, 1, 1, 0, 0, 1, 1, 0, 0, 0, 1, 0, 1, 1, 0, 1, 1, 1, 1, 0, 1, 2, 1, 1, 1, 2, 2, 1, 2, 2); var advSpcColorPerLevel = new Array(1, 0, 2, 0, 1, 1, 2, 0, 2, 1, 1, 2, 1, 1, 3, 2, 1, 2, 1, 2, 1, 1, 2, 1, 3, 2, 1, 3, 3, 2); var advSpcShapePerLevel = new Array(0, 1, 0, 2, 1, 1, 0, 2, 1, 1, 2, 1, 2, 2, 1, 2, 3, 1, 2, 2, 3, 3, 1, 2, 1, 2, 3, 1, 1, 2); var colorsArray = new Array('yellow', 'green', 'blue', 'red'); var shapesArray = new Array('stella', 'luna', 'sol', 'terra'); var synergiesSet; var tileOriginalLocation = new Object(); var cardPressTime = undefined; var tips = new Array('One ping means the tile you used fits an adjacent tile.', 'Two pings mean the tile you used fits the tiles on both sides.', 'If you put a tile next to another and see smoke comes out - the tiles don\'t fit.', 'Extra deals differ in size. You can get a 2 cards, a 3 cards or a 4 cards extra deal.', 'You can place together two tiles that don\'t fit, but make sure everything fits when you put the last tile in the ring.', 'Color quadruples harmonic set is a set where there\'s an equal number of each color in the ring.', 'Double double harmonic set is a set where there are at least two of each color and two of each symbol.', 'Double triples harmonic set is a set where there are at least three of each color and three of each symbol.', 'Symbol quadruples harmonic set is a set where there\'s an equal number of each symbol in the ring.', 'Starting in level 10 you get transform tools every 5 levels. These tools allow you to change tiles to a specific color or symbol.', 'When you complete the 30th ring you defeat the dragon. You can go on playing for a personal record.', 'After level 30 you get one random transform tool each level.'); var instructions = new Array('Try to fit the tiles in the ring matching either color or symbol and complete a full magic circle.', 'Use the cards that were dealt to the four slots on your left. Press "deal" when you can\'t use the ones already in the slots.', 'After exhausting the 4 standard deals you have in one round try using the extra deals to survive a tricky ring.', 'Once a tile is inside the ring you can not drag it back to the slot.', 'You can move a tile that is already in the ring to another place in the ring, unless a Limiter is preventing this.', 'A cracked slot can not contain cards (not including extra deals).', 'Eight tiles make a set - a complete magic ring that can prevent the dragon from burning you.', 'Each tile has two sides - left and right. Each side has one color and one symbol.', 'There are four symbols: Luna (moon), Terra (earth), Sol (sun) and Stella (star), and four colors: Red, Green, Yellow and Blue.', 'Creating special combinations of tiles will get you bonus points and bonus tools.', '"Harmonic sets" are special combinations of tiles, where all colors or all symbols are equally represented.', '"Pool sets" are sets with large amounts of one color or symbol.', 'The first Limiter appears in the second round. it looks like a pizza Limiter with the word "Color" on it.', 'The "Color" Limiter prevents you from matching next to it two tiles that don\'t have a matching color.', 'As you advance in level, the number of Limiters grows and they become more specific.'); var mainTable; var mainDeck; var mainExtras; var tileOriginalLocation; var inGame = false; var dragon_mc; var victory_mc; var wizard_wand_mc; var text_highlight_mc; var tips_box; var lastDealWarningIssued = false; var tileOriginalLocation; var currentLevel = 1; var baseScore = 0; var onStage = true; var levelDone = false; var highScoresUpdated = false; var roundBonusPoints; var levelUpdated; var bonusesGiven; var lastGameWasTutorial; _root.inGameMenuDisabled = true; _root.inGameScene = true; var firstLevel = 1; if (_root.tutorialAlreadyPlayed == undefined) { _root.tutorialAlreadyPlayed = true; if (_root.gameMode == 'basic') { _root.startTutorial(); firstLevel = 0; } } if (_root.specialDebugMode != undefined) { firstLevel = _root.specialDebugMode; _root.endTutorial(); } rpnInit(); rpnNewGame(firstLevel, 0); _root.onEnterFrame = frameRefresh; stop(); } movieClip 1013 { } movieClip 1014 { frame 23 { stop(); } } movieClip 1029 { frame 1 { gotoAndStop('unused'); } frame 14 { if (this.onEnd != undefined) { this.onEnd(); } stop(); } frame 15 { stop(); } } movieClip 1031 { } movieClip 1033 { } movieClip 1040 { } movieClip 1041 { } button 1046 { on (release) { _root.playSound('button1.wav'); _root.playSound('New Message'); _root.updateInstructionInWindow(); } }




http://swfchan.com/2/9579/info.shtml
Created: 19/3 -2019 04:19:28 Last modified: 25/3 -2020 12:11:56 Server time: 02/05 -2024 14:04:03