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

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

Madness - Project Nexus.swf

This is the info page for
Flash #208560

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


ActionScript [AS1/AS2]
Combined Code
movieClip 1 key_manager { #initclip Object.registerClass('key_manager', KeyManager); #endinitclip } movieClip 3 { } movieClip 6 madness_bullet { frame 3 { stop(); this.removeMovieClip(); delete this; } } movieClip 8 aim_line { } movieClip 10 { } movieClip 13 { } movieClip 15 { } movieClip 16 { } movieClip 17 player_aim { } movieClip 18 pulse_timer { #initclip Object.registerClass('pulse_timer', PulseTimer); #endinitclip } movieClip 20 { } movieClip 28 { } movieClip 29 { frame 1 { stop(); if (_parent._parent._parent._parent.myDataRef.myCharacter != undefined) { gotoAndStop(_parent._parent._parent._parent.myDataRef.myCharacter); } } } movieClip 37 { } movieClip 38 { frame 1 { stop(); if (_parent._parent._parent._parent.myDataRef.myCharacter != undefined) { gotoAndStop(_parent._parent._parent._parent.myDataRef.myCharacter); } } } movieClip 39 { } movieClip 41 { frame 1 { _visible = false; } } movieClip 67 { frame 1 { stop(); } } movieClip 68 { frame 1 { function createWound(inNumber) { this['wound' + String(inNumber)] = attachMovie('madness_wound', 'wound' + String(inNumber), getNextHighestDepth()); } } } movieClip 70 { frame 1 { _visible = false; } } movieClip 96 { frame 1 { stop(); } } movieClip 97 { frame 1 { function createWound(inNumber) { this['wound' + String(inNumber)] = attachMovie('madness_wound', 'wound' + String(inNumber), getNextHighestDepth()); } } } movieClip 98 { } movieClip 99 { } movieClip 100 doors_sprite { } movieClip 101 madness_cutscene { #initclip Object.registerClass('madness_cutscene', MadnessCutscene); #endinitclip } movieClip 104 { } // unknown tag 88 length 64 button 111 { on (press) { init2(); } } movieClip 114 { } movieClip 115 { } movieClip 121 { } movieClip 129 { } movieClip 130 { } movieClip 162 { } movieClip 163 { } // unknown tag 88 length 111 movieClip 170 { } button 172 { on (press) { _parent._parent.pressMyGear(); } on (rollOver) { SwainAudioPlayer.playSound('menu2', 0); } } movieClip 173 { } button 180 { on (press) { _parent._parent.pressConfirm(); } on (rollOver) { SwainAudioPlayer.playSound('menu2', 0); } } button 183 { on (press) { _parent._parent.pressRemove(); } on (rollOver) { SwainAudioPlayer.playSound('menu2', 0); } } movieClip 191 { } button 197 { on (press) { _parent._parent.pressStats(''); } } movieClip 205 { frame 39 { stop(); } } movieClip 209 { } button 215 { on (press) { _parent._parent.pressEquip(); } on (rollOver) { SwainAudioPlayer.playSound('menu2', 0); } } button 218 { on (press) { _parent._parent.pressUnequip(); } on (rollOver) { SwainAudioPlayer.playSound('menu2', 0); } } button 221 { on (press) { _parent._parent.pressConfirm(); } on (rollOver) { SwainAudioPlayer.playSound('menu2', 0); } } button 225 { on (press) { SwainAudioPlayer.playSound('nobuy', 0); } } button 228 { on (press) { SwainAudioPlayer.playSound('nobuy', 0); } } button 231 { on (press) { SwainAudioPlayer.playSound('nobuy', 0); } } movieClip 233 { } button 239 { on (press) { _parent._parent.pressClose(); } on (rollOver) { SwainAudioPlayer.playSound('menu2', 0); } } movieClip 246 { } movieClip 247 { frame 2 { this.shift; } } movieClip 249 { } button 252 { on (press) { pressNext(); } } button 253 { on (press) { pressPrev(); } } button 257 { on (press) { pressStore(); } } button 263 { on (press) { pressNext2(); } } button 264 { on (press) { pressPrev2(); } } button 270 { on (press) { _parent._parent.pressStats('stat'); } on (rollOver) { SwainAudioPlayer.playSound('menu2', 0); } } movieClip 271 { } button 276 { on (press) { _parent._parent.pressStats('skill'); } on (rollOver) { SwainAudioPlayer.playSound('menu2', 0); } } movieClip 277 { } movieClip 278 { } movieClip 279 madness_team_setup { #initclip Object.registerClass('madness_team_setup', MadnessTeamSetup); #endinitclip frame 1 { stop(); } } movieClip 282 { } button 283 { on (press) { CharacterGenerator.storePopulator(); } } button 285 { on (press) { MadnessGameSelect.saveGame(); } } // unknown tag 88 length 64 movieClip 291 { } movieClip 292 madness_store_hire { #initclip Object.registerClass('madness_store_hire', MadnessStoreHire); #endinitclip frame 1 { stop(); } } movieClip 304 { frame 1 { function tick() { SpeedFrameSkipper.adjustFrames(this, _root.myGameSpeed); } onEnterFrame = tick; } frame 23 { _parent.removeMovieClip(); delete _parent; } } movieClip 318 { frame 1 { function tick() { SpeedFrameSkipper.adjustFrames(this, _root.myGameSpeed); } onEnterFrame = tick; } frame 27 { _parent.removeMovieClip(); delete _parent; } } movieClip 333 { frame 1 { function tick() { SpeedFrameSkipper.adjustFrames(this, _root.myGameSpeed); } onEnterFrame = tick; } frame 29 { _parent.removeMovieClip(); delete _parent; } } movieClip 354 { frame 1 { function tick() { SpeedFrameSkipper.adjustFrames(this, _root.myGameSpeed); } onEnterFrame = tick; } frame 41 { _parent.removeMovieClip(); delete _parent; } } movieClip 372 { frame 1 { function tick() { SpeedFrameSkipper.adjustFrames(this, _root.myGameSpeed); } onEnterFrame = tick; } frame 35 { _parent.removeMovieClip(); delete _parent; } } movieClip 392 { frame 1 { function tick() { SpeedFrameSkipper.adjustFrames(this, _root.myGameSpeed); } onEnterFrame = tick; } frame 39 { _parent.removeMovieClip(); delete _parent; } } movieClip 417 { frame 1 { function tick() { SpeedFrameSkipper.adjustFrames(this, _root.myGameSpeed); } onEnterFrame = tick; } frame 25 { _parent.removeMovieClip(); delete _parent; } } movieClip 418 madness_effect { } movieClip 420 { } movieClip 424 { } movieClip 426 { } // unknown tag 88 length 68 movieClip 430 { } // unknown tag 88 length 110 movieClip 436 { } movieClip 437 icon_sprite { } movieClip 439 { frame 1 { _visible = false; } } movieClip 441 ui_mug { } movieClip 443 { } movieClip 446 { } movieClip 448 { frame 1 { _visible = MadnessCharacter.myPartOn(this, 'upgradeSight', 0); } } movieClip 451 { frame 1 { gotoAndStop(MadnessCharacter.myPartOn(this, 'myColor', 0)); } } movieClip 452 { } movieClip 454 { } movieClip 458 { frame 1 { gotoAndStop(MadnessCharacter.myPartOn(this, 'myColor', 0)); } } movieClip 459 { } movieClip 461 { } movieClip 465 { frame 1 { gotoAndStop(MadnessCharacter.myPartOn(this, 'myColor', 0)); } } movieClip 466 { } movieClip 468 { } movieClip 472 { frame 1 { gotoAndStop(MadnessCharacter.myPartOn(this, 'myColor', 0)); } } movieClip 473 { } movieClip 475 { } movieClip 478 { frame 1 { _visible = MadnessCharacter.myPartOn(this, 'upgradeLaser', 0); } } movieClip 481 { frame 1 { gotoAndStop(MadnessCharacter.myPartOn(this, 'myColor', 0)); } } movieClip 482 { } movieClip 483 { } movieClip 487 { frame 1 { gotoAndStop(MadnessCharacter.myPartOn(this, 'myColor', 0)); } } movieClip 488 { } movieClip 490 { } movieClip 494 { frame 1 { gotoAndStop(MadnessCharacter.myPartOn(this, 'myColor', 0)); } } movieClip 495 { } movieClip 496 { } movieClip 500 { frame 1 { gotoAndStop(MadnessCharacter.myPartOn(this, 'myColor', 0)); } } movieClip 501 { } movieClip 502 { } movieClip 506 { frame 1 { gotoAndStop(MadnessCharacter.myPartOn(this, 'myColor', 0)); } } movieClip 507 { } movieClip 508 { } movieClip 512 { frame 1 { gotoAndStop(MadnessCharacter.myPartOn(this, 'myColor', 0)); } } movieClip 513 { } movieClip 517 { frame 1 { gotoAndStop(MadnessCharacter.myPartOn(this, 'myColor', 0)); } } movieClip 518 { } movieClip 519 { } movieClip 523 { frame 1 { gotoAndStop(MadnessCharacter.myPartOn(this, 'myColor', 0)); } } movieClip 524 { } movieClip 525 { } movieClip 529 { frame 1 { gotoAndStop(MadnessCharacter.myPartOn(this, 'myColor', 0)); } } movieClip 530 { } movieClip 531 { } movieClip 535 { frame 1 { gotoAndStop(MadnessCharacter.myPartOn(this, 'myColor', 0)); } } movieClip 536 { } movieClip 540 { frame 1 { gotoAndStop(MadnessCharacter.myPartOn(this, 'myColor', 0)); } } movieClip 541 { } movieClip 543 { } movieClip 547 { frame 1 { gotoAndStop(MadnessCharacter.myPartOn(this, 'myColor', 0)); } } movieClip 548 { } movieClip 550 { } movieClip 554 { frame 1 { gotoAndStop(MadnessCharacter.myPartOn(this, 'myColor', 0)); } } movieClip 555 { } movieClip 557 { } movieClip 561 { frame 1 { gotoAndStop(MadnessCharacter.myPartOn(this, 'myColor', 0)); } } movieClip 562 { } movieClip 564 { } movieClip 568 { frame 1 { gotoAndStop(MadnessCharacter.myPartOn(this, 'myColor', 0)); } } movieClip 569 { } movieClip 571 { } movieClip 575 { frame 1 { gotoAndStop(MadnessCharacter.myPartOn(this, 'myColor', 0)); } } movieClip 576 { } movieClip 578 { } movieClip 582 { frame 1 { gotoAndStop(MadnessCharacter.myPartOn(this, 'myColor', 0)); } } movieClip 583 { } movieClip 585 { } movieClip 589 { frame 1 { gotoAndStop(MadnessCharacter.myPartOn(this, 'myColor', 0)); } } movieClip 590 { } movieClip 591 { } movieClip 595 { frame 1 { gotoAndStop(MadnessCharacter.myPartOn(this, 'myColor', 0)); } } movieClip 596 { } movieClip 597 { } movieClip 601 { frame 1 { gotoAndStop(MadnessCharacter.myPartOn(this, 'myColor', 0)); } } movieClip 602 { } movieClip 606 { frame 1 { gotoAndStop(MadnessCharacter.myPartOn(this, 'myColor', 0)); } } movieClip 607 { } movieClip 609 { } movieClip 611 { } movieClip 613 { } movieClip 614 { } movieClip 616 { } movieClip 620 { frame 1 { gotoAndStop(MadnessCharacter.myPartOn(this, 'myColor', 0)); } } movieClip 621 { } movieClip 625 { frame 1 { gotoAndStop(MadnessCharacter.myPartOn(this, 'myColor', 0)); } } movieClip 629 { frame 1 { gotoAndStop(MadnessCharacter.myPartOn(this, 'myColor', 0)); } } movieClip 633 { frame 1 { gotoAndStop(MadnessCharacter.myPartOn(this, 'myColor', 0)); } } movieClip 634 { } movieClip 638 { frame 1 { gotoAndStop(MadnessCharacter.myPartOn(this, 'myColor', 0)); } } movieClip 642 { frame 1 { gotoAndStop(MadnessCharacter.myPartOn(this, 'myColor', 0)); } } movieClip 643 { } movieClip 647 { frame 1 { gotoAndStop(MadnessCharacter.myPartOn(this, 'myColor', 0)); } } movieClip 651 { frame 1 { gotoAndStop(MadnessCharacter.myPartOn(this, 'myColor', 0)); } } movieClip 652 { } movieClip 656 { frame 1 { gotoAndStop(MadnessCharacter.myPartOn(this, 'myColor', 0)); } } movieClip 660 { frame 1 { gotoAndStop(MadnessCharacter.myPartOn(this, 'myColor', 0)); } } movieClip 661 { } movieClip 665 { frame 1 { gotoAndStop(MadnessCharacter.myPartOn(this, 'myColor', 0)); } } movieClip 669 { frame 1 { gotoAndStop(MadnessCharacter.myPartOn(this, 'myColor', 0)); } } movieClip 670 { } movieClip 674 { frame 1 { gotoAndStop(MadnessCharacter.myPartOn(this, 'myColor', 0)); } } movieClip 675 { frame 1 { gotoAndStop(MadnessCharacter.myPartOn(this, 'myColor', 0)); } } movieClip 676 { } movieClip 680 { frame 1 { gotoAndStop(MadnessCharacter.myPartOn(this, 'myColor', 0)); } } movieClip 681 { frame 1 { gotoAndStop(MadnessCharacter.myPartOn(this, 'myColor', 0)); } } movieClip 682 { } movieClip 686 { frame 1 { gotoAndStop(MadnessCharacter.myPartOn(this, 'myColor', 0)); } } movieClip 687 { frame 1 { gotoAndStop(MadnessCharacter.myPartOn(this, 'myColor', 0)); } } movieClip 688 { } movieClip 692 { frame 1 { gotoAndStop(MadnessCharacter.myPartOn(this, 'myColor', 0)); } } movieClip 693 { frame 1 { gotoAndStop(MadnessCharacter.myPartOn(this, 'myColor', 0)); } } movieClip 694 { } movieClip 698 { frame 1 { gotoAndStop(MadnessCharacter.myPartOn(this, 'myColor', 0)); } } movieClip 702 { frame 1 { gotoAndStop(MadnessCharacter.myPartOn(this, 'myColor', 0)); } } movieClip 703 { } movieClip 707 { frame 1 { gotoAndStop(MadnessCharacter.myPartOn(this, 'myColor', 0)); } } movieClip 708 { frame 1 { gotoAndStop(MadnessCharacter.myPartOn(this, 'myColor', 0)); } } movieClip 709 { } movieClip 713 { frame 1 { gotoAndStop(MadnessCharacter.myPartOn(this, 'myColor', 0)); } } movieClip 717 { frame 1 { gotoAndStop(MadnessCharacter.myPartOn(this, 'myColor', 0)); } } movieClip 718 { } movieClip 722 { frame 1 { gotoAndStop(MadnessCharacter.myPartOn(this, 'myColor', 0)); } } movieClip 723 { frame 1 { gotoAndStop(MadnessCharacter.myPartOn(this, 'myColor', 0)); } } movieClip 724 { } movieClip 726 { } movieClip 728 { } movieClip 730 { } movieClip 731 { } movieClip 732 { } movieClip 736 { frame 1 { gotoAndStop(MadnessCharacter.myPartOn(this, 'myColor', 0)); } } movieClip 738 { } movieClip 743 { } movieClip 749 { } movieClip 754 { } movieClip 759 { } movieClip 764 { } movieClip 769 { } movieClip 774 { } movieClip 779 { } movieClip 784 { } movieClip 789 { } movieClip 794 { } movieClip 799 { } movieClip 804 { } movieClip 809 { } movieClip 815 { } movieClip 820 { } movieClip 825 { } movieClip 830 { } movieClip 835 { } movieClip 840 { } movieClip 845 { } movieClip 847 { } movieClip 849 { } movieClip 851 { } movieClip 852 { } movieClip 855 { } movieClip 859 { } movieClip 860 { } movieClip 863 { } movieClip 864 { } movieClip 865 { } movieClip 867 { } movieClip 868 { } movieClip 869 { } movieClip 870 { } movieClip 872 { } movieClip 874 { } movieClip 875 { } movieClip 876 { } movieClip 878 { } movieClip 879 { } movieClip 880 { } movieClip 882 { } movieClip 883 { } movieClip 884 { } movieClip 885 { } movieClip 887 { } movieClip 889 { } movieClip 892 { } movieClip 893 { } movieClip 894 { } button 900 { on (press) { pressMenu(); } on (rollOver) { SwainAudioPlayer.playSound('menu2', 0); } } movieClip 902 { frame 1 { _visible = false; } } movieClip 903 madness_game_menu { #initclip Object.registerClass('madness_game_menu', MadnessMenu); #endinitclip } button 906 { on (press) { _root.pickMap(); } } button 907 { on (press) { _root.pickStore(); } } button 908 { on (press) { _root.pickTeam(); } } // unknown tag 88 length 63 movieClip 918 { } movieClip 936 { frame 25 { gotoAndPlay('loop'); } } button 938 { on (press) { MadnessWorldMap.pickArena(MadnessLevel.currentLevel.totalWaves); } on (rollOver) { SwainAudioPlayer.playSound('menu2', 0); } } button 946 { on (press) { _root.pickTeam(); myCashTEXT = MadnessTeamSetup.returnPlayerCash(); } on (rollOver) { SwainAudioPlayer.playSound('menu2', 0); } } button 950 { on (press) { _root.pickStore(); } on (rollOver) { SwainAudioPlayer.playSound('menu2', 0); } } button 954 { on (press) { _root.pickItems(false); } on (rollOver) { SwainAudioPlayer.playSound('menu2', 0); } } movieClip 957 madness_menu_top_bar { frame 8 { function arenaTick() { this.myCashTEXT.text = '$' + MadnessRoster.playerRoster.myCash; } onEnterFrame = arenaTick; } } movieClip 959 myHitBox { frame 1 { _visible = false; } } movieClip 960 { frame 1 { function tick() { SpeedFrameSkipper.adjustFrames(this, _parent.myGameSpeed); } onEnterFrame = tick; } } movieClip 966 { frame 11 { stop(); } } movieClip 968 { frame 11 { stop(); } } movieClip 969 { } movieClip 977 { frame 11 { stop(); } } movieClip 981 { frame 11 { stop(); } } movieClip 982 { } movieClip 983 { frame 1 { stop(); } } movieClip 984 { frame 1 { function tick() { SpeedFrameSkipper.adjustFrames(this, _parent.myGameSpeed); } onEnterFrame = tick; } } movieClip 985 { frame 1 { function tick() { SpeedFrameSkipper.adjustFrames(this, _parent.myGameSpeed); } onEnterFrame = tick; } } movieClip 986 { frame 1 { function tick() { SpeedFrameSkipper.adjustFrames(this, _parent.myGameSpeed); } onEnterFrame = tick; } } movieClip 987 { frame 1 { function tick() { SpeedFrameSkipper.adjustFrames(this, _parent.myGameSpeed); } onEnterFrame = tick; } } movieClip 988 { frame 1 { function tick() { SpeedFrameSkipper.adjustFrames(this, _parent.myGameSpeed); } onEnterFrame = tick; } } movieClip 989 { frame 1 { function tick() { SpeedFrameSkipper.adjustFrames(this, _parent.myGameSpeed); } onEnterFrame = tick; } } movieClip 990 { frame 1 { function tick() { SpeedFrameSkipper.adjustFrames(this, _parent.myGameSpeed); } onEnterFrame = tick; } frame 14 { _parent.useActivator(); } } movieClip 991 { frame 1 { function tick() { SpeedFrameSkipper.adjustFrames(this, _parent.myGameSpeed); } onEnterFrame = tick; } } movieClip 992 { frame 1 { function tick() { SpeedFrameSkipper.adjustFrames(this, _parent.myGameSpeed); } onEnterFrame = tick; } } movieClip 993 { frame 1 { function tick() { SpeedFrameSkipper.adjustFrames(this, _parent.myGameSpeed); } onEnterFrame = tick; } } movieClip 994 { frame 1 { function tick() { SpeedFrameSkipper.adjustFrames(this, _parent.myGameSpeed); } onEnterFrame = tick; } } movieClip 995 { frame 1 { function tick() { SpeedFrameSkipper.adjustFrames(this, _parent.myGameSpeed); } onEnterFrame = tick; } frame 53 { gotoAndPlay('loop'); } } movieClip 996 { frame 1 { function tick() { SpeedFrameSkipper.adjustFrames(this, _parent.myGameSpeed); } onEnterFrame = tick; } frame 53 { gotoAndPlay('loop'); } } movieClip 997 { frame 1 { function tick() { SpeedFrameSkipper.adjustFrames(this, _parent.myGameSpeed); } onEnterFrame = tick; } frame 2 { _parent.applyYMove(3); } frame 21 { stop(); } } movieClip 998 { frame 1 { function tick() { SpeedFrameSkipper.adjustFrames(this, _parent.myGameSpeed); } onEnterFrame = tick; } } movieClip 999 { frame 1 { function tick() { SpeedFrameSkipper.adjustFrames(this, _parent.myGameSpeed); } onEnterFrame = tick; } frame 2 { _parent.applyYMove(3); } frame 21 { stop(); } } movieClip 1000 { frame 1 { function tick() { SpeedFrameSkipper.adjustFrames(this, _parent.myGameSpeed); } onEnterFrame = tick; } } movieClip 1001 { frame 1 { function tick() { SpeedFrameSkipper.adjustFrames(this, _parent.myGameSpeed); } onEnterFrame = tick; } frame 11 { _parent.playSound('swapmelee'); } frame 25 { _parent.playSound('swapmelee'); } frame 39 { _parent.playSound('swapmelee'); } frame 59 { stop(); } } movieClip 1003 { } movieClip 1011 { } movieClip 1013 { } movieClip 1021 { } movieClip 1023 { frame 1 { stop(); if (_parent._parent._parent._parent.myDataRef.myCharacter != undefined) { gotoAndStop(_parent._parent._parent._parent.myDataRef.myCharacter); } } } movieClip 1030 { } movieClip 1031 { frame 1 { stop(); if (_parent._parent._parent._parent.myDataRef.myCharacter != undefined) { gotoAndStop(_parent._parent._parent._parent.myDataRef.myCharacter); } } } movieClip 1032 { frame 1 { function tick() { SpeedFrameSkipper.adjustFrames(this, _parent.myGameSpeed); } onEnterFrame = tick; } } movieClip 1033 { frame 1 { function tick() { SpeedFrameSkipper.adjustFrames(this, _parent.myGameSpeed); } onEnterFrame = tick; } } movieClip 1034 { frame 1 { function tick() { SpeedFrameSkipper.adjustFrames(this, _parent.myGameSpeed); } onEnterFrame = tick; } frame 12 { _parent.playSound('swish'); } } movieClip 1035 { frame 1 { function tick() { SpeedFrameSkipper.adjustFrames(this, _parent.myGameSpeed); } onEnterFrame = tick; } frame 197 { stop(); } } movieClip 1036 { frame 1 { function tick() { SpeedFrameSkipper.adjustFrames(this, _parent.myGameSpeed); } onEnterFrame = tick; } frame 87 { stop(); } } movieClip 1037 { } movieClip 1038 { } movieClip 1039 { frame 1 { function tick() { SpeedFrameSkipper.adjustFrames(this, _parent.myGameSpeed); } onEnterFrame = tick; } frame 15 { _parent.playSound('land'); } frame 16 { _parent.killMe(); } frame 17 { _parent.actionSlowdown = true; } frame 46 { nextFrame(); onEnterFrame = null; } frame 47 { stop(); stop(); onEnterFrame = null; } } movieClip 1040 { frame 1 { function tick() { SpeedFrameSkipper.adjustFrames(this, _parent.myGameSpeed); } onEnterFrame = tick; } frame 21 { _parent.actionSlowdown = true; _parent.playSound('land'); } frame 27 { _parent.killMe(); } frame 117 { nextFrame(); onEnterFrame = null; } frame 118 { stop(); stop(); onEnterFrame = null; } } movieClip 1041 { frame 1 { function tick() { SpeedFrameSkipper.adjustFrames(this, _parent.myGameSpeed); } onEnterFrame = tick; } frame 23 { _parent.actionSlowdown = true; _parent.playSound('land'); } frame 27 { _parent.killMe(); } frame 47 { nextFrame(); onEnterFrame = null; } frame 48 { stop(); stop(); onEnterFrame = null; } } movieClip 1042 { frame 1 { function tick() { SpeedFrameSkipper.adjustFrames(this, _parent.myGameSpeed); } onEnterFrame = tick; } frame 21 { _parent.actionSlowdown = true; _parent.playSound('land'); } frame 37 { _parent.killMe(); } frame 65 { nextFrame(); onEnterFrame = null; } frame 66 { stop(); stop(); onEnterFrame = null; } } movieClip 1043 { frame 1 { function tick() { SpeedFrameSkipper.adjustFrames(this, _parent.myGameSpeed); } onEnterFrame = tick; } frame 17 { _parent.actionSlowdown = true; _parent.playSound('land'); } frame 22 { _parent.killMe(); } frame 41 { nextFrame(); onEnterFrame = null; } frame 42 { stop(); stop(); onEnterFrame = null; } } movieClip 1044 { frame 1 { function tick() { SpeedFrameSkipper.adjustFrames(this, _parent.myGameSpeed); } onEnterFrame = tick; _parent.actionSlowdown = true; } frame 3 { _parent.generalStaggerMovement(); } frame 9 { _parent.generalStaggerMovement(); } frame 17 { _parent.applySpeed(2); } frame 19 { _parent.applySpeed(2); } frame 21 { _parent.applySpeed(2); } frame 23 { _parent.applySpeed(2); } frame 25 { _parent.applySpeed(2); } frame 27 { _parent.killMe(); } frame 28 { _parent.playSound('land'); } frame 47 { nextFrame(); onEnterFrame = null; } frame 48 { stop(); stop(); onEnterFrame = null; } } movieClip 1045 { frame 1 { function tick() { SpeedFrameSkipper.adjustFrames(this, _parent.myGameSpeed); } onEnterFrame = tick; } frame 25 { _parent.actionSlowdown = true; _parent.playSound('land'); } frame 32 { _parent.killMe(); } frame 53 { nextFrame(); onEnterFrame = null; } frame 54 { stop(); stop(); onEnterFrame = null; } } movieClip 1046 { frame 1 { function tick() { SpeedFrameSkipper.adjustFrames(this, _parent.myGameSpeed); } onEnterFrame = tick; _parent.actionSlowdown = true; } frame 15 { _parent.applySpeed(-2); } frame 21 { _parent.applySpeed(-2); } frame 23 { _parent.applySpeed(-2); } frame 25 { _parent.applySpeed(-2); } frame 27 { _parent.applySpeed(-4); } frame 29 { _parent.applySpeed(-4); } frame 32 { _parent.killMe(); _parent.playSound('land'); } frame 55 { nextFrame(); onEnterFrame = null; } frame 56 { stop(); stop(); onEnterFrame = null; } } movieClip 1047 { frame 1 { function tick() { SpeedFrameSkipper.adjustFrames(this, _parent.myGameSpeed); } onEnterFrame = tick; _parent.actionSlowdown = true; } frame 11 { _parent.generalStaggerMovement(); } frame 25 { _parent.generalStaggerMovement(); } frame 35 { _parent.applySpeed(-2); } frame 37 { _parent.applySpeed(-2); } frame 39 { _parent.applySpeed(-2); } frame 41 { _parent.applySpeed(-4); } frame 42 { _parent.killMe(); _parent.playSound('land'); } frame 43 { _parent.applySpeed(-5); } frame 59 { nextFrame(); onEnterFrame = null; } frame 60 { stop(); stop(); onEnterFrame = null; } } movieClip 1048 { frame 1 { function tick() { SpeedFrameSkipper.adjustFrames(this, _parent.myGameSpeed); } onEnterFrame = tick; _parent.actionSlowdown = true; _parent.applySpeed(-2); } frame 66 { _parent.noDamage = true; } frame 67 { _parent.applySpeed(2); } frame 69 { _parent.applySpeed(3); } frame 71 { _parent.applySpeed(4); } frame 73 { _parent.applySpeed(5); } frame 75 { _parent.applySpeed(6); } frame 77 { _parent.applySpeed(7); } frame 79 { _parent.applySpeed(7); } frame 85 { _parent.killMe(); _parent.playSound('land'); } frame 93 { nextFrame(); onEnterFrame = null; } frame 94 { stop(); stop(); onEnterFrame = null; } } movieClip 1049 { frame 1 { function tick() { SpeedFrameSkipper.adjustFrames(this, _parent.myGameSpeed); } onEnterFrame = tick; _parent.actionSlowdown = true; _parent.applySpeed(-6); } frame 20 { _parent.generalStaggerMovement(); } frame 29 { _parent.generalStaggerMovement(); } frame 40 { _parent.generalStaggerMovement(); } frame 50 { _parent.generalStaggerMovement(); } frame 61 { _parent.generalStaggerMovement(); } frame 74 { _parent.generalStaggerMovement(); } frame 85 { _parent.generalStaggerMovement(); } frame 97 { _parent.generalStaggerMovement(); } frame 106 { _parent.generalStaggerMovement(); } frame 116 { _parent.generalStaggerMovement(); } frame 127 { _parent.generalStaggerMovement(); } frame 134 { _parent.generalStaggerMovement(); } frame 145 { _parent.generalStaggerMovement(); } frame 153 { _parent.generalStaggerMovement(); } frame 177 { _parent.generalStaggerMovement(); } frame 187 { _parent.noDamage = true; } frame 188 { _parent.applySpeed(-3); } frame 190 { _parent.applySpeed(-4); } frame 192 { _parent.applySpeed(-5); } frame 194 { _parent.applySpeed(-6); } frame 196 { _parent.applySpeed(-6); } frame 201 { _parent.killMe(); _parent.playSound('land'); } frame 223 { nextFrame(); onEnterFrame = null; } frame 224 { stop(); stop(); onEnterFrame = null; } } movieClip 1050 { frame 1 { function tick() { SpeedFrameSkipper.adjustFrames(this, _parent.myGameSpeed); } onEnterFrame = tick; _parent.actionSlowdown = true; } frame 15 { _parent.generalStaggerMovement(); } frame 23 { _parent.generalStaggerMovement(); } frame 29 { _parent.noDamage = true; } frame 30 { _parent.applySpeed(-3); } frame 32 { _parent.applySpeed(-4); } frame 34 { _parent.applySpeed(-5); } frame 36 { _parent.applySpeed(-6); } frame 38 { _parent.applySpeed(-6); } frame 39 { _parent.killMe(); _parent.playSound('land'); } frame 61 { nextFrame(); onEnterFrame = null; } frame 62 { stop(); stop(); onEnterFrame = null; } } movieClip 1051 { frame 1 { function tick() { SpeedFrameSkipper.adjustFrames(this, _parent.myGameSpeed); } onEnterFrame = tick; _parent.actionSlowdown = true; } frame 11 { _parent.generalStaggerMovement(); } frame 23 { _parent.generalStaggerMovement(); } frame 36 { _parent.generalStaggerMovement(); } frame 46 { _parent.generalStaggerMovement(); } frame 59 { _parent.generalStaggerMovement(); } frame 69 { _parent.generalStaggerMovement(); } frame 76 { _parent.noDamage = true; } frame 77 { _parent.applySpeed(-3); } frame 79 { _parent.applySpeed(-4); } frame 81 { _parent.applySpeed(-5); } frame 83 { _parent.applySpeed(-6); } frame 85 { _parent.applySpeed(-6); } frame 86 { _parent.killMe(); _parent.playSound('land'); } frame 109 { nextFrame(); onEnterFrame = null; } frame 110 { stop(); stop(); onEnterFrame = null; } } movieClip 1052 { frame 1 { function tick() { SpeedFrameSkipper.adjustFrames(this, _parent.myGameSpeed); } onEnterFrame = tick; _parent.actionSlowdown = true; } frame 74 { _parent.applySpeed(-2); } frame 76 { _parent.applySpeed(-2); } frame 77 { _parent.noDamage = true; } frame 78 { _parent.applySpeed(-2); } frame 80 { _parent.applySpeed(-2); } frame 83 { _parent.applySpeed(-3); } frame 86 { _parent.applySpeed(-3); } frame 89 { _parent.applySpeed(-3); } frame 91 { _parent.applySpeed(-4); } frame 93 { _parent.applySpeed(-4); } frame 94 { _parent.killMe(); _parent.playSound('land'); } frame 117 { nextFrame(); onEnterFrame = null; } frame 118 { stop(); stop(); onEnterFrame = null; } } movieClip 1053 { frame 1 { function tick() { SpeedFrameSkipper.adjustFrames(this, _parent.myGameSpeed); } onEnterFrame = tick; } frame 6 { _parent.playSound('land'); } frame 23 { gotoAndPlay('loop'); } frame 24 { gotoAndPlay('loop'); } frame 25 { gotoAndPlay('loop'); } } movieClip 1054 { frame 1 { function tick() { SpeedFrameSkipper.adjustFrames(this, _parent.myGameSpeed); } onEnterFrame = tick; } frame 13 { _parent.playSound('land'); } frame 29 { gotoAndPlay('loop'); } frame 30 { gotoAndPlay('loop'); } frame 31 { gotoAndPlay('loop'); } } movieClip 1055 { frame 1 { function tick() { SpeedFrameSkipper.adjustFrames(this, _parent.myGameSpeed); } onEnterFrame = tick; } frame 6 { _parent.killMe(); } frame 8 { _parent.actionSlowdown = true; } frame 14 { _parent.playSound('land'); } frame 20 { stop(); } frame 21 { stop(); } } movieClip 1056 { frame 1 { function tick() { SpeedFrameSkipper.adjustFrames(this, _parent.myGameSpeed); } onEnterFrame = tick; } frame 28 { _parent.actionSlowdown = true; } frame 29 { _parent.killMe(); _parent.playSound('land'); } frame 43 { stop(); } frame 44 { stop(); } } movieClip 1057 { frame 1 { function tick() { SpeedFrameSkipper.adjustFrames(this, _parent.myGameSpeed); } onEnterFrame = tick; } frame 3 { _parent.killMe(); _parent.playSound('land'); } frame 4 { _parent.actionSlowdown = true; } frame 16 { stop(); } frame 17 { stop(); } } movieClip 1058 { frame 1 { function tick() { SpeedFrameSkipper.adjustFrames(this, _parent.myGameSpeed); } onEnterFrame = tick; _parent.actionSlowdown = true; } frame 19 { _parent.applySpeed(-2); } frame 21 { _parent.applySpeed(-2); } frame 23 { _parent.applySpeed(-2); } frame 25 { _parent.applySpeed(-4); } frame 27 { _parent.applySpeed(-5); } frame 28 { _parent.killMe(); _parent.playSound('land'); } frame 49 { nextFrame(); onEnterFrame = null; } frame 50 { stop(); stop(); onEnterFrame = null; } } movieClip 1059 { frame 1 { function tick() { SpeedFrameSkipper.adjustFrames(this, _parent.myGameSpeed); } onEnterFrame = tick; _parent.actionSlowdown = false; } frame 28 { _parent.killMe(); _parent.playSound('land'); } frame 29 { _parent.actionSlowdown = true; } frame 49 { nextFrame(); onEnterFrame = null; } frame 50 { stop(); stop(); onEnterFrame = null; } } movieClip 1060 { frame 1 { function tick() { SpeedFrameSkipper.adjustFrames(this, _parent.myGameSpeed); } onEnterFrame = tick; } frame 34 { _parent.spitBlood(false); } frame 70 { _parent.spitBlood(false); } frame 75 { _parent.spitBlood(false); } frame 112 { _parent.spitBlood(true); } frame 115 { _parent.spitBlood(false); } frame 118 { _parent.spitBlood(false); } frame 121 { _parent.spitBlood(false); } frame 124 { _parent.spitBlood(false); } frame 144 { } frame 157 { stop(); } frame 158 { stop(); } } movieClip 1061 { frame 1 { function tick() { SpeedFrameSkipper.adjustFrames(this, _parent.myGameSpeed); } onEnterFrame = tick; } frame 17 { _parent.actionSlowdown = true; } frame 69 { _parent.wounded = 2; } frame 70 { _parent.wounded = 2; } frame 71 { _parent.wounded = 2; gotoAndPlay('loop'); } frame 72 { gotoAndPlay('loop'); } } movieClip 1062 { frame 1 { function tick() { SpeedFrameSkipper.adjustFrames(this, _parent.myGameSpeed); } onEnterFrame = tick; } } movieClip 1063 { frame 1 { function tick() { SpeedFrameSkipper.adjustFrames(this, _parent.myGameSpeed); } onEnterFrame = tick; } } movieClip 1070 { } movieClip 1071 { } movieClip 1072 { } movieClip 1074 { frame 1 { _visible = false; } } movieClip 1075 { frame 1 { function tick() { SpeedFrameSkipper.adjustFrames(this, _parent.myGameSpeed); } onEnterFrame = tick; var flipPartner = true; } } movieClip 1076 { } movieClip 1077 { frame 1 { function tick() { SpeedFrameSkipper.adjustFrames(this, _parent.myGameSpeed); } onEnterFrame = tick; } frame 21 { _parent.playSound('swish'); } frame 27 { _parent.checkMeleeHit('full', 'mid'); } frame 47 { stop(); } frame 48 { stop(); } } movieClip 1078 { frame 1 { function tick() { SpeedFrameSkipper.adjustFrames(this, _parent.myGameSpeed); } onEnterFrame = tick; } frame 21 { _parent.playSound('swish'); } frame 27 { _parent.checkMeleeHit('full', 'mid'); } frame 47 { stop(); } frame 48 { stop(); } } movieClip 1079 { frame 1 { function tick() { SpeedFrameSkipper.adjustFrames(this, _parent.myGameSpeed); } onEnterFrame = tick; _parent.playSound('swish'); } frame 5 { _parent.checkMeleeHit('full', 'mid'); } frame 29 { stop(); } frame 30 { stop(); } } movieClip 1080 { frame 1 { function tick() { SpeedFrameSkipper.adjustFrames(this, _parent.myGameSpeed); } onEnterFrame = tick; _parent.playSound('swish'); } frame 5 { _parent.checkMeleeHit('full', 'mid'); } frame 23 { stop(); } frame 24 { stop(); } } movieClip 1081 { frame 1 { function tick() { SpeedFrameSkipper.adjustFrames(this, _parent.myGameSpeed); } onEnterFrame = tick; } frame 3 { _parent.playSound('swish'); } frame 7 { _parent.checkMeleeHit('full', 'high'); } frame 24 { stop(); } frame 25 { stop(); } } movieClip 1082 { frame 1 { function tick() { SpeedFrameSkipper.adjustFrames(this, _parent.myGameSpeed); } onEnterFrame = tick; } frame 3 { _parent.playSound('swish'); } frame 7 { _parent.checkMeleeHit('full', 'low'); } frame 25 { stop(); } frame 26 { stop(); } } movieClip 1083 { frame 1 { function tick() { SpeedFrameSkipper.adjustFrames(this, _parent.myGameSpeed); } onEnterFrame = tick; } frame 5 { _parent.playSound('swish'); } frame 9 { _parent.checkMeleeHit('full', 'mid'); } frame 24 { stop(); } frame 25 { stop(); } } movieClip 1084 { frame 1 { function tick() { SpeedFrameSkipper.adjustFrames(this, _parent.myGameSpeed); } onEnterFrame = tick; } frame 5 { _parent.playSound('swish'); } frame 9 { _parent.checkMeleeHit('full', 'high'); } frame 27 { stop(); } frame 28 { stop(); } } movieClip 1085 { frame 1 { function tick() { SpeedFrameSkipper.adjustFrames(this, _parent.myGameSpeed); } onEnterFrame = tick; } frame 3 { _parent.playSound('swish'); } frame 7 { _parent.checkMeleeHit('full', 'mid'); } frame 19 { stop(); } frame 20 { stop(); } } movieClip 1086 { frame 1 { function tick() { SpeedFrameSkipper.adjustFrames(this, _parent.myGameSpeed); } onEnterFrame = tick; } frame 2 { _parent.playSound('swish'); } frame 7 { _parent.checkMeleeHit('full', 'high'); } frame 25 { _parent.playSound('swish'); } frame 29 { _parent.checkMeleeHit('full', 'high'); } frame 43 { stop(); } frame 44 { stop(); } } movieClip 1087 { frame 1 { function tick() { SpeedFrameSkipper.adjustFrames(this, _parent.myGameSpeed); } onEnterFrame = tick; } frame 9 { _parent.playSound('swish'); } frame 13 { _parent.checkMeleeHit('full', 'mid'); } frame 22 { _parent.playSound('swish'); } frame 25 { _parent.checkMeleeHit('full', 'mid'); } frame 35 { stop(); } frame 36 { stop(); } } movieClip 1088 { frame 1 { function tick() { SpeedFrameSkipper.adjustFrames(this, _parent.myGameSpeed); } onEnterFrame = tick; } frame 7 { _parent.checkMeleeHit('unarmed', 'mid'); } frame 17 { _parent.playSound('swish'); } frame 21 { _parent.checkMeleeHit('full', 'mid'); } frame 37 { stop(); } frame 38 { stop(); } } movieClip 1089 { frame 1 { function tick() { SpeedFrameSkipper.adjustFrames(this, _parent.myGameSpeed); } onEnterFrame = tick; _parent.playSound('swish'); } frame 5 { _parent.checkMeleeHit('full', 'mid'); } frame 21 { _parent.playSound('swish'); } frame 25 { _parent.checkMeleeHit('unarmed', 'mid'); } frame 37 { stop(); } frame 38 { stop(); } } movieClip 1090 { frame 1 { function tick() { SpeedFrameSkipper.adjustFrames(this, _parent.myGameSpeed); } onEnterFrame = tick; } frame 5 { _parent.checkMeleeHit('unarmed', 'mid'); } frame 23 { _parent.playSound('swish'); } frame 27 { _parent.checkMeleeHit('full', 'mid'); } frame 39 { stop(); } frame 40 { stop(); } } movieClip 1091 { frame 1 { function tick() { SpeedFrameSkipper.adjustFrames(this, _parent.myGameSpeed); } onEnterFrame = tick; } frame 5 { _parent.checkMeleeHit('unarmed', 'mid'); } frame 31 { _parent.playSound('swish'); } frame 37 { _parent.checkMeleeHit('full', 'high'); } frame 57 { stop(); } frame 58 { stop(); } } movieClip 1092 { frame 1 { function tick() { SpeedFrameSkipper.adjustFrames(this, _parent.myGameSpeed); } onEnterFrame = tick; } frame 4 { _parent.playSound('swish'); } frame 9 { _parent.checkMeleeHit('full', 'mid'); } frame 15 { _parent.playSound('swish'); } frame 19 { _parent.checkMeleeHit('full', 'mid'); } frame 26 { _parent.playSound('swish'); } frame 29 { _parent.checkMeleeHit('full', 'high'); } frame 41 { stop(); } frame 42 { stop(); } } movieClip 1093 { frame 1 { function tick() { SpeedFrameSkipper.adjustFrames(this, _parent.myGameSpeed); } onEnterFrame = tick; } frame 12 { _parent.playSound('swish'); } frame 17 { _parent.checkMeleeHit('full', 'mid'); } frame 28 { _parent.playSound('swish'); } frame 32 { _parent.checkMeleeHit('full', 'high'); } frame 49 { stop(); } frame 50 { stop(); } } movieClip 1094 { frame 1 { function tick() { SpeedFrameSkipper.adjustFrames(this, _parent.myGameSpeed); } onEnterFrame = tick; } frame 13 { _parent.playSound('swish'); } frame 19 { _parent.checkMeleeHit('unarmed', 'mid'); } frame 20 { _parent.checkMeleeHit('unarmed', 'mid'); } frame 37 { stop(); } frame 38 { stop(); } } movieClip 1095 { frame 1 { function tick() { SpeedFrameSkipper.adjustFrames(this, _parent.myGameSpeed); } onEnterFrame = tick; _parent.playSound('swish'); } frame 5 { _parent.checkMeleeHit('full', 'mid'); } frame 43 { stop(); } frame 44 { stop(); } } movieClip 1096 { frame 1 { function tick() { SpeedFrameSkipper.adjustFrames(this, _parent.myGameSpeed); } onEnterFrame = tick; } frame 4 { _parent.playSound('swish'); } frame 9 { _parent.checkMeleeHit('unarmed', 'high'); } frame 25 { stop(); } frame 26 { stop(); } } movieClip 1097 { frame 1 { function tick() { SpeedFrameSkipper.adjustFrames(this, _parent.myGameSpeed); } onEnterFrame = tick; } frame 6 { _parent.playSound('swish'); } frame 9 { _parent.checkMeleeHit('unarmed', 'high'); } frame 25 { stop(); } frame 26 { stop(); } } movieClip 1098 { frame 1 { function tick() { SpeedFrameSkipper.adjustFrames(this, _parent.myGameSpeed); } onEnterFrame = tick; } frame 11 { _parent.playSound('swish'); } frame 15 { _parent.throwWeapon(); } frame 47 { stop(); } } movieClip 1099 { frame 1 { function tick() { SpeedFrameSkipper.adjustFrames(this, _parent.myGameSpeed); } onEnterFrame = tick; } frame 13 { _parent.playSound('swishlow'); } frame 18 { _parent.checkMeleeHit('full', 'mid'); _parent.shakeyCam(8); } frame 59 { stop(); } frame 60 { stop(); } } movieClip 1100 { frame 1 { function tick() { SpeedFrameSkipper.adjustFrames(this, _parent.myGameSpeed); } onEnterFrame = tick; } frame 27 { _parent.checkMeleeHit('unarmed', 'mid'); } frame 47 { stop(); } frame 48 { stop(); } } movieClip 1101 { frame 1 { function tick() { SpeedFrameSkipper.adjustFrames(this, _parent.myGameSpeed); } onEnterFrame = tick; } frame 27 { _parent.checkMeleeHit('unarmed', 'mid'); } frame 47 { stop(); } frame 48 { stop(); } } movieClip 1102 { frame 1 { function tick() { SpeedFrameSkipper.adjustFrames(this, _parent.myGameSpeed); } onEnterFrame = tick; } frame 5 { _parent.checkMeleeHit('unarmed', 'mid'); } frame 25 { stop(); } frame 26 { stop(); } } movieClip 1103 { frame 1 { function tick() { SpeedFrameSkipper.adjustFrames(this, _parent.myGameSpeed); } onEnterFrame = tick; } frame 5 { _parent.checkMeleeHit('unarmed', 'mid'); } frame 25 { stop(); } frame 26 { stop(); } } movieClip 1104 { frame 1 { function tick() { SpeedFrameSkipper.adjustFrames(this, _parent.myGameSpeed); } onEnterFrame = tick; } frame 7 { _parent.checkMeleeHit('unarmed', 'high'); } frame 30 { stop(); } frame 31 { stop(); } } movieClip 1105 { frame 1 { function tick() { SpeedFrameSkipper.adjustFrames(this, _parent.myGameSpeed); } onEnterFrame = tick; } frame 7 { _parent.checkMeleeHit('unarmed', 'high'); } frame 29 { stop(); } frame 30 { stop(); } } movieClip 1106 { frame 1 { function tick() { SpeedFrameSkipper.adjustFrames(this, _parent.myGameSpeed); } onEnterFrame = tick; } frame 7 { _parent.checkMeleeHit('unarmed', 'low'); } frame 23 { stop(); } frame 24 { stop(); } } movieClip 1107 { frame 1 { function tick() { SpeedFrameSkipper.adjustFrames(this, _parent.myGameSpeed); } onEnterFrame = tick; } frame 7 { _parent.checkMeleeHit('unarmed', 'low'); } frame 23 { stop(); } frame 24 { stop(); } } movieClip 1108 { frame 1 { function tick() { SpeedFrameSkipper.adjustFrames(this, _parent.myGameSpeed); } onEnterFrame = tick; } frame 7 { _parent.checkMeleeHit('unarmed', 'high'); } frame 21 { stop(); } frame 22 { stop(); } } movieClip 1109 { frame 1 { function tick() { SpeedFrameSkipper.adjustFrames(this, _parent.myGameSpeed); } onEnterFrame = tick; } frame 7 { _parent.checkMeleeHit('unarmed', 'high'); } frame 21 { stop(); } frame 22 { stop(); } } movieClip 1110 { frame 1 { function tick() { SpeedFrameSkipper.adjustFrames(this, _parent.myGameSpeed); } onEnterFrame = tick; } frame 5 { _parent.checkMeleeHit('unarmed', 'high'); } frame 21 { stop(); } frame 22 { stop(); } } movieClip 1111 { frame 1 { function tick() { SpeedFrameSkipper.adjustFrames(this, _parent.myGameSpeed); } onEnterFrame = tick; } frame 3 { _parent.checkMeleeHit('unarmed', 'mid'); } frame 13 { stop(); } frame 14 { stop(); } } movieClip 1112 { frame 1 { function tick() { SpeedFrameSkipper.adjustFrames(this, _parent.myGameSpeed); } onEnterFrame = tick; } frame 3 { _parent.checkMeleeHit('unarmed', 'mid'); } frame 13 { stop(); } frame 14 { stop(); } } movieClip 1113 { frame 1 { function tick() { SpeedFrameSkipper.adjustFrames(this, _parent.myGameSpeed); } onEnterFrame = tick; } frame 5 { _parent.checkMeleeHit('unarmed', 'mid'); } frame 31 { stop(); } frame 32 { stop(); } } movieClip 1114 { frame 1 { function tick() { SpeedFrameSkipper.adjustFrames(this, _parent.myGameSpeed); } onEnterFrame = tick; } frame 7 { _parent.checkMeleeHit('unarmed', 'mid'); } frame 31 { stop(); } frame 32 { stop(); } } movieClip 1115 { frame 1 { function tick() { SpeedFrameSkipper.adjustFrames(this, _parent.myGameSpeed); } onEnterFrame = tick; } frame 7 { _parent.checkMeleeHit('unarmed', 'low'); } frame 8 { _parent.checkMeleeHit('unarmed', 'mid'); } frame 9 { _parent.checkMeleeHit('unarmed', 'high'); } frame 37 { stop(); } frame 38 { stop(); } } movieClip 1116 { frame 1 { function tick() { SpeedFrameSkipper.adjustFrames(this, _parent.myGameSpeed); } onEnterFrame = tick; } frame 19 { _parent.checkMeleeHit('unarmed', 'low'); _parent.checkMeleeHit('unarmed', 'verylow'); _parent.shakeyCam(8); } frame 44 { stop(); } frame 45 { stop(); } } movieClip 1117 { frame 1 { function tick() { SpeedFrameSkipper.adjustFrames(this, _parent.myGameSpeed); } onEnterFrame = tick; } frame 25 { _parent.checkMeleeHit('unarmed', 'low'); _parent.checkMeleeHit('unarmed', 'verylow'); } frame 26 { _parent.shakeyCam(8); } frame 52 { stop(); } frame 53 { stop(); } } movieClip 1118 { frame 1 { function tick() { SpeedFrameSkipper.adjustFrames(this, _parent.myGameSpeed); } onEnterFrame = tick; _parent.actionSlowdown = true; _parent.applySpeed(-4); } frame 2 { _parent.applySpeed(-3); } frame 8 { _parent.applySpeed(-2); } frame 22 { _parent.applySpeed(2); } frame 26 { _parent.applySpeed(3); } frame 43 { _parent.applySpeed(4); } frame 63 { MadnessEvents.bossEvents(MadnessCharacter(_parent), 'death1'); } } movieClip 1119 { frame 1 { function tick() { SpeedFrameSkipper.adjustFrames(this, _parent.myGameSpeed); } onEnterFrame = tick; } } movieClip 1120 { frame 1 { function tick() { SpeedFrameSkipper.adjustFrames(this, _parent.myGameSpeed); } onEnterFrame = tick; } } movieClip 1121 { frame 1 { function tick() { SpeedFrameSkipper.adjustFrames(this, _parent.myGameSpeed); } onEnterFrame = tick; } } movieClip 1122 { frame 1 { function tick() { SpeedFrameSkipper.adjustFrames(this, _parent.myGameSpeed); } onEnterFrame = tick; _parent.actionSlowdown = true; } frame 31 { _parent.applySpeed(4); } frame 33 { _parent.applySpeed(12); } frame 35 { _parent.applySpeed(12); } frame 37 { _parent.applySpeed(12); } frame 40 { _parent.applySpeed(12); } frame 41 { _parent.checkMeleeHit('unarmed', 'verylow'); } frame 42 { _parent.playSound('landhard'); } frame 43 { _parent.shakeyCam(19); } frame 43 { _parent.applySpeed(1); } frame 85 { _parent.playSound('swapgun'); } frame 125 { MadnessEvents.bossEvents(MadnessCharacter(_parent), 'death2'); } } movieClip 1123 { frame 1 { function tick() { SpeedFrameSkipper.adjustFrames(this, _parent.myGameSpeed); } onEnterFrame = tick; } } movieClip 1124 { frame 1 { function tick() { SpeedFrameSkipper.adjustFrames(this, _parent.myGameSpeed); } if (onEnterFrame == null) { onEnterFrame = tick; } _parent.actionSlowdown = true; } frame 29 { _parent.killMe(); _parent.playSound('landhard'); } frame 30 { _parent.shakeyCam(10); } frame 51 { MadnessEvents.bossEvents(MadnessCharacter(_parent), 'death3'); } } movieClip 1131 { } movieClip 1132 { frame 1 { function tick() { SpeedFrameSkipper.adjustFrames(this, _parent.myGameSpeed); } onEnterFrame = tick; } frame 56 { gotoAndPlay('loop'); } } movieClip 1133 { frame 1 { function tick() { SpeedFrameSkipper.adjustFrames(this, _parent.myGameSpeed); } onEnterFrame = tick; } frame 5 { _parent.generalStaggerMovement(); } frame 15 { _parent.generalStaggerMovement(); } frame 25 { stop(); } } movieClip 1134 { frame 1 { function tick() { SpeedFrameSkipper.adjustFrames(this, _parent.myGameSpeed); } onEnterFrame = tick; _parent.actionSlowdown = false; } frame 23 { _parent.actionSlowdown = true; _parent.playSound('land'); } frame 81 { stop(); } frame 82 { stop(); } } movieClip 1135 { frame 1 { function tick() { SpeedFrameSkipper.adjustFrames(this, _parent.myGameSpeed); } onEnterFrame = tick; _parent.actionSlowdown = false; } frame 23 { _parent.actionSlowdown = true; _parent.playSound('land'); } frame 81 { stop(); } frame 82 { stop(); } } movieClip 1136 { frame 1 { function tick() { SpeedFrameSkipper.adjustFrames(this, _parent.myGameSpeed); } onEnterFrame = tick; } frame 17 { stop(); } frame 18 { stop(); } } movieClip 1137 { frame 1 { function tick() { SpeedFrameSkipper.adjustFrames(this, _parent.myGameSpeed); } onEnterFrame = tick; } frame 21 { stop(); } frame 22 { stop(); } } movieClip 1138 { frame 1 { function tick() { SpeedFrameSkipper.adjustFrames(this, _parent.myGameSpeed); } onEnterFrame = tick; } frame 18 { stop(); } frame 19 { stop(); } } movieClip 1139 { frame 1 { function tick() { SpeedFrameSkipper.adjustFrames(this, _parent.myGameSpeed); } onEnterFrame = tick; } frame 2 { _parent.generalStaggerMovement(); } frame 5 { _parent.generalStaggerMovement(); } frame 17 { _parent.generalStaggerMovement(); } frame 27 { _parent.generalStaggerMovement(); } frame 37 { _parent.generalStaggerMovement(); } frame 53 { stop(); } frame 54 { stop(); } } movieClip 1140 { frame 1 { function tick() { SpeedFrameSkipper.adjustFrames(this, _parent.myGameSpeed); } onEnterFrame = tick; } frame 29 { stop(); } frame 30 { stop(); } } movieClip 1141 { frame 1 { function tick() { SpeedFrameSkipper.adjustFrames(this, _parent.myGameSpeed); } onEnterFrame = tick; } frame 25 { stop(); } frame 26 { stop(); } } movieClip 1142 { frame 1 { function tick() { SpeedFrameSkipper.adjustFrames(this, _parent.myGameSpeed); } onEnterFrame = tick; } frame 33 { stop(); } } movieClip 1143 { frame 1 { function tick() { SpeedFrameSkipper.adjustFrames(this, _parent.myGameSpeed); } onEnterFrame = tick; } frame 32 { stop(); } } movieClip 1144 { frame 1 { function tick() { SpeedFrameSkipper.adjustFrames(this, _parent.myGameSpeed); } onEnterFrame = tick; } frame 2 { _parent.generalStaggerMovement(); } frame 5 { _parent.generalStaggerMovement(); } frame 17 { _parent.generalStaggerMovement(); } frame 27 { _parent.generalStaggerMovement(); } frame 37 { _parent.generalStaggerMovement(); } frame 53 { stop(); } frame 54 { stop(); } } movieClip 1145 { frame 1 { function tick() { SpeedFrameSkipper.adjustFrames(this, _parent.myGameSpeed); } onEnterFrame = tick; } frame 67 { stop(); } frame 68 { stop(); } } movieClip 1146 { frame 1 { function tick() { SpeedFrameSkipper.adjustFrames(this, _parent.myGameSpeed); } onEnterFrame = tick; _parent.playSound('swish'); } frame 9 { nextFrame(); onEnterFrame = null; } frame 10 { stop(); stop(); onEnterFrame = null; } } movieClip 1147 { frame 1 { function tick() { SpeedFrameSkipper.adjustFrames(this, _parent.myGameSpeed); } onEnterFrame = tick; _parent.playSound('swish'); } frame 9 { nextFrame(); onEnterFrame = null; } frame 10 { stop(); stop(); onEnterFrame = null; } } movieClip 1148 { frame 1 { function tick() { SpeedFrameSkipper.adjustFrames(this, _parent.myGameSpeed); } onEnterFrame = tick; } frame 9 { _parent.playSound('swish'); } frame 33 { _parent.actionSlowdown = true; _parent.amDodging = false; _parent.playSound('land'); } frame 47 { nextFrame(); onEnterFrame = null; } frame 48 { stop(); stop(); onEnterFrame = null; } } movieClip 1149 { frame 1 { function tick() { SpeedFrameSkipper.adjustFrames(this, _parent.myGameSpeed); } onEnterFrame = tick; } frame 13 { _parent.playSound('swish'); } frame 31 { _parent.actionSlowdown = true; _parent.amDodging = false; _parent.playSound('land'); } frame 43 { nextFrame(); onEnterFrame = null; } frame 44 { stop(); stop(); onEnterFrame = null; } } movieClip 1150 { frame 1 { function tick() { SpeedFrameSkipper.adjustFrames(this, _parent.myGameSpeed); } onEnterFrame = tick; } frame 4 { _parent.playSound('land'); _parent.playSound('blunt'); } frame 10 { _parent.actionSlowdown = true; } frame 33 { _parent.amDodging = false; } frame 51 { _parent.applySpeed(-7); } frame 71 { nextFrame(); onEnterFrame = null; } frame 72 { stop(); stop(); onEnterFrame = null; } } movieClip 1151 { frame 1 { function tick() { SpeedFrameSkipper.adjustFrames(this, _parent.myGameSpeed); } onEnterFrame = tick; } frame 5 { _parent.playSound('land'); } frame 15 { _parent.actionSlowdown = true; } frame 23 { _parent.applySpeed(7); _parent.actionSlowdown = false; _parent.playSound('swish'); } frame 41 { _parent.actionSlowdown = true; _parent.amDodging = false; _parent.playSound('land'); } frame 55 { nextFrame(); onEnterFrame = null; } frame 56 { stop(); stop(); onEnterFrame = null; } } movieClip 1152 { frame 1 { function tick() { SpeedFrameSkipper.adjustFrames(this, _parent.myGameSpeed); } onEnterFrame = tick; } frame 8 { _parent.playSound('land'); _parent.playSound('blunt'); } frame 13 { _parent.actionSlowdown = true; } frame 33 { _parent.amDodging = false; } frame 43 { _parent.applySpeed(7); } frame 63 { nextFrame(); onEnterFrame = null; } frame 64 { stop(); stop(); onEnterFrame = null; } } movieClip 1153 { frame 1 { function tick() { SpeedFrameSkipper.adjustFrames(this, _parent.myGameSpeed); } onEnterFrame = tick; } frame 6 { _parent.playSound('land'); } frame 17 { _parent.actionSlowdown = true; } frame 29 { _parent.applySpeed(-7); _parent.actionSlowdown = false; } frame 32 { _parent.playSound('swish'); } frame 47 { _parent.actionSlowdown = true; _parent.amDodging = false; _parent.playSound('land'); } frame 61 { nextFrame(); onEnterFrame = null; } frame 62 { stop(); stop(); onEnterFrame = null; } } movieClip 1154 { frame 1 { function tick() { SpeedFrameSkipper.adjustFrames(this, _parent.myGameSpeed); } onEnterFrame = tick; } frame 15 { _parent.pickupGun(); } frame 22 { stop(); } } movieClip 1155 { frame 1 { function tick() { SpeedFrameSkipper.adjustFrames(this, _parent.myGameSpeed); } onEnterFrame = tick; } frame 16 { _parent.swapGear(); } frame 24 { stop(); } } movieClip 1156 madness_character { #initclip Object.registerClass('madness_character', MadnessCharacter); #endinitclip } movieClip 1159 { } movieClip 1160 { } movieClip 1161 { } movieClip 1163 { frame 1 { stop(); } } movieClip 1166 { } movieClip 1167 { } movieClip 1170 { } movieClip 1173 { frame 1 { stop(); } } movieClip 1174 Preloader { frame 1 { function enterFrameHandler() { var v2 = 0; v2 = _root.getBytesLoaded() / _root.getBytesTotal(); if (loadingBar) { loadingBar.gotoAndStop(int(v2 * (loadingBar._totalframes - 1)) + 1); } if (v2 >= 1) { onEnterFrame = null; gotoAndStop('loaded'); } } stop(); var autoPlay; var className; onEnterFrame = enterFrameHandler; } frame 10 { function _onPlayClick() { _root.nextFrame(); _root.play(); _parent._onLoaded(); } if (playButton) { playButton.onRelease = _onPlayClick; playButton.stop(); } if (autoPlay) { _onPlayClick(null); } } } movieClip 1176 Newgrounds API Classes { #initclip Object.registerClass('Newgrounds API Classes', com.newgrounds.shims.APIShim); #endinitclip } movieClip 1216 { } movieClip 1219 { } movieClip 1224 { } movieClip 1228 { } movieClip 1229 { } movieClip 1230 { } movieClip 1231 FlashAd { #initclip Object.registerClass('FlashAd', com.newgrounds.components.FlashAdBase); #endinitclip frame 1 { function initPlayButton() { if (this.playButton) { this.playButton.onRelease = onPlayClick; if (!this.showPlayButton) { this.playButton._visible = false; } } } function onPlayClick() { removeAd(); _visible = false; } stop(); } frame 2 { initPlayButton(); } } movieClip 1232 APIConnector { frame 1 { function _onLoaded() { gotoAndStop('invisible'); if (_redirect) { com.newgrounds.API.loadOfficialVersion(); return undefined; } } function _apiConnect() { var v2 = com.newgrounds.API; if (v2 && !v2.connected) { if (!apiId) { com.newgrounds.Logger.logError('No API ID entered in the API Connector component.', 'You can create an API ID for this submission at http://newgrounds.com/account/flashapi', 'Enter your API ID into the API Connector using the Component Inspector (Window -> Component Inspector).'); return undefined; } switch (debugMode) { case 'Off': default: v2.debugMode = v2.RELEASE_MODE; goto 1299; case 'Simulate Logged-in User': //Invalid switch } v2.debugMode = v2.DEBUG_MODE_LOGGED_IN; goto 1299; case 'Off': v2.debugMode = v2.DEBUG_MODE_LOGGED_OUT; goto 1299; case 'Simulate Logged-in User': v2.debugMode = v2.DEBUG_MODE_NEW_VERSION; goto 1299; case 'Simulate Logged-out User': v2.debugMode = v2.DEBUG_MODE_HOST_BLOCKED; label 1299: v2.addEventListener(com.newgrounds.APIEvent.API_CONNECTED, _onConnected); v2.connect(_root, apiId, encryptionKey, movieVersion); } } function _onConnected(event) { if (redirectOnNewVersion && event.__get__success() && (event.__get__data()).newVersion) { _redirect = true; } if (redirectOnHostBlocked && !event.__get__success() && event.__get__error() == com.newgrounds.APIEvent.ERROR_HOST_BLOCKED) { _redirect = true; } if (_redirect) { gotoAndStop('adPreloader'); forceAlwaysOnTop(); } } function forceAlwaysOnTop() { var v2 = getNextHighestDepth(); swapDepths(v2); if (Stage) { _x = (Stage.width - _width) / 2; _y = (Stage.height - _height) / 2; _visible = true; } if (_root && _root instanceof MovieClip) { (MovieClip(_root)).stop(); } } stop(); if (_root && _root instanceof MovieClip) { (MovieClip(_root)).stop(); } var apiId; var encryptionKey; var movieVersion; var debugMode; var connectorType; var redirectOnHostBlocked; var redirectOnNewVersion; var adType; var className; var _redirect; _x = int(_x); _y = int(_y); if (!debugMode) { debugMode = 'Simulate Logged-in User'; } if (!connectorType) { connectorType = 'Flash Ad + Preloader'; } if (!adType) { adType = 'Video'; } if (ad) { ad.adType = adType; } switch (connectorType) { case 'Flash Ad + Preloader': gotoAndStop('adPreloader'); break; case 'Flash Ad Only': gotoAndStop('ad'); break; case 'Invisible': gotoAndStop('invisible'); } _apiConnect(); } instance ad of movieClip 1231 FlashAd { onClipEvent (construct) { apiId = ''; showBorder = true; adType = 'Video'; } } instance loader of movieClip 1174 Preloader { onClipEvent (construct) { autoPlay = false; mainClass = ''; } } } frame 1 { var rightClick = new ContextMenu(); rightClick.hideBuiltInItems(); _root.menu = rightClick; } movieClip 1236 { } movieClip 1237 { } instance of movieClip 1231 FlashAd { onClipEvent (construct) { apiId = '23857:DC2U4SHl'; showBorder = false; adType = 'Video'; } } movieClip 1241 { } movieClip 1243 { } movieClip 1245 { } movieClip 1247 { } instance preloaderSwain of movieClip 1247 { onClipEvent (load) { _parent.myLaunch._visible = false; myBar._xscale = 0; } onClipEvent (enterFrame) { var pctLoaded = Math.round((_root.getBytesLoaded() / _root.getBytesTotal()) * 100); myBar._xscale = pctLoaded; if (_root.getBytesLoaded() == _root.getBytesTotal()) { _parent.myLaunch._visible = true; } } } movieClip 1249 { } instance of movieClip 1232 APIConnector { onClipEvent (construct) { apiId = '23857:DC2U4SHl'; encryptionKey = 'XY9W27V37yBW0WYVIHbHOPvxYnwPp1wt'; debugMode = 'Simulate Logged-in User'; movieVersion = ''; connectorType = 'Flash Ad + Preloader'; redirectOnNewVersion = true; redirectOnHostBlocked = true; adType = 'Video'; } } movieClip 1258 { } button 1261 { on (release) { _root.play(); } } movieClip 1264 { } movieClip 1267 { } movieClip 1271 { } movieClip 1275 { } movieClip 1281 { } movieClip 1283 { } movieClip 1285 { } movieClip 1287 { } movieClip 1289 { } movieClip 1291 MedalPopup { frame 1 { function onMedalUnlocked(event) { if (event.__get__success()) { _medalQueue.push(event.__get__data()); showNextUnlock(); } } function showNextUnlock() { if (_unlockedMedal) { return undefined; } if (!_medalQueue.length) { gotoAndStop('hidden'); onEnterFrame = null; return undefined; } _unlockedMedal = com.newgrounds.Medal(_medalQueue.shift()); gotoAndPlay('medalUnlocked'); } gotoAndStop('hidden'); com.newgrounds.API.addEventListener(com.newgrounds.APIEvent.MEDAL_UNLOCKED, onMedalUnlocked); var alwaysOnTop; _x = int(_x); _y = int(_y); var _unlockedMedal; var _medalQueue = []; var _alwaysOnTop = true; if (alwaysOnTop) { _alwaysOnTop = alwaysOnTop == 'true'; } } frame 15 { function medalPopupEnterFrame() { if (_alwaysOnTop) { var v1 = getNextHighestDepth(); swapDepths(v1); } if (_medalScrollRect) { _medalScrollRect.offset(2, 0); medalNameClip.scrollRect = _medalScrollRect; if (_medalScrollRect.left >= medalNameClip.textField.textWidth + 10) { _medalScrollRect = null; play(); } } } var _medalScrollRect; if (_unlockedMedal) { if (medalNameClip && medalNameClip.textField) { medalNameClip.textField.text = _unlockedMedal.name; } if (medalPointsText) { medalPointsText.text = _unlockedMedal.value.toString(); } if (medalNameClip.textField.textWidth > medalNameClip._width) { _medalScrollRect = new flash.geom.Rectangle(-medalNameClip._width, 0, medalNameClip._width, medalNameClip._height); medalNameClip.textField._width = 1000; medalNameClip.scrollRect = _medalScrollRect; } onEnterFrame = medalPopupEnterFrame; } } frame 23 { if (_unlockedMedal && medalIcon) { _unlockedMedal.attachIcon(medalIcon); } } frame 84 { if (_medalScrollRect) { stop(); } } frame 105 { stop(); _unlockedMedal = null; showNextUnlock(); } } instance of movieClip 1291 MedalPopup { onClipEvent (construct) { alwaysOnTop = 'true'; } } movieClip 4806 __Packages.SwainAudioPlayer { #initclip if (!_global.SwainAudioPlayer) { var v1 = function () {}; _global.SwainAudioPlayer = v1; var v2 = v1.prototype; v1.init = function () { SwainAudioPlayer.stopTrack(SwainAudioPlayer.musicTrack1); SwainAudioPlayer.stopTrack(SwainAudioPlayer.musicTrack2); _root.createEmptyMovieClip('musicTrack1', _root.getNextHighestDepth()); _root.createEmptyMovieClip('musicTrack2', _root.getNextHighestDepth()); SwainAudioPlayer.musicTrack1 = _root.musicTrack1; SwainAudioPlayer.musicTrack2 = _root.musicTrack2; SwainAudioPlayer.currentTrack = SwainAudioPlayer.musicTrack1; stopAllSounds(); _root.createEmptyMovieClip('soundManager', _root.getNextHighestDepth()); SwainAudioPlayer.soundManager = _root.soundManager; SwainAudioPlayer.soundManager.onEnterFrame = SwainAudioPlayer.soundTick; SwainAudioPlayer.soundTypeArray = new Array(); SwainAudioPlayer.allSounds = new Array(); SwainAudioPlayer.allSoundsMCs = new Array(); }; v1.playTrack = function (inTrack) { if (SwainAudioPlayer.musicTrack1.myTrack == SwainAudioPlayer.soundLibrary(inTrack)) { if (SwainAudioPlayer.currentTrack == SwainAudioPlayer.musicTrack2) { SwainAudioPlayer.currentTrack = SwainAudioPlayer.musicTrack1; } } else { if (SwainAudioPlayer.musicTrack2.myTrack == SwainAudioPlayer.soundLibrary(inTrack)) { if (SwainAudioPlayer.currentTrack == SwainAudioPlayer.musicTrack1) { SwainAudioPlayer.currentTrack = SwainAudioPlayer.musicTrack2; } } else { if (SwainAudioPlayer.musicTrack1 == undefined && SwainAudioPlayer.musicTrack2 == undefined || SwainAudioPlayer.currentTrack == SwainAudioPlayer.musicTrack2) { SwainAudioPlayer.currentTrack = SwainAudioPlayer.musicTrack1; } else { SwainAudioPlayer.currentTrack = SwainAudioPlayer.musicTrack2; } SwainAudioPlayer.stopTrack(SwainAudioPlayer.currentTrack); var tempTrack = SwainAudioPlayer.currentTrack; tempTrack.onEnterFrame = function () { SwainAudioPlayer.trackTick(tempTrack); }; SwainAudioPlayer.currentTrack.myTrack = new String(); SwainAudioPlayer.currentTrack.myTrack = SwainAudioPlayer.soundLibrary(inTrack); SwainAudioPlayer.currentTrack.mySound = new Sound(SwainAudioPlayer.currentTrack); SwainAudioPlayer.currentTrack.mySound.attachSound(SwainAudioPlayer.currentTrack.myTrack); SwainAudioPlayer.currentTrack.mySound.start(0, 999999); if (SwainAudioPlayer.musicTrack2.mySound == undefined || SwainAudioPlayer.musicTrack1.mySound == undefined) { SwainAudioPlayer.currentTrack.mySound.setVolume(100 * SwainAudioPlayer.volumeMusic); } else { SwainAudioPlayer.currentTrack.mySound.setVolume(0); } } } }; v1.stopTrack = function (inTrackObj) { inTrackObj.mySound.stop(inTrackObj.myTrack); inTrackObj.mySound = undefined; inTrackObj.myTrack = undefined; inTrackObj.onEnterFrame = null; }; v1.trackTick = function (inTrackObj) { if (inTrackObj != SwainAudioPlayer.currentTrack) { inTrackObj.mySound.setVolume(inTrackObj.mySound.getVolume() - 5); if (inTrackObj.mySound.getVolume() <= 0) { SwainAudioPlayer.stopTrack(inTrackObj); } } else { if (inTrackObj.mySound.getVolume() < 100 * SwainAudioPlayer.volumeMusic) { inTrackObj.mySound.setVolume(inTrackObj.mySound.getVolume() + 5); } if (inTrackObj.mySound.getVolume() > 100 * SwainAudioPlayer.volumeMusic) { inTrackObj.mySound.setVolume(100 * SwainAudioPlayer.volumeMusic); } } }; v1.fadeAllTracks = function () { SwainAudioPlayer.currentTrack = undefined; }; v1.stopAllTracks = function () { SwainAudioPlayer.currentTrack = undefined; SwainAudioPlayer.stopTrack(SwainAudioPlayer.musicTrack1); SwainAudioPlayer.stopTrack(SwainAudioPlayer.musicTrack2); }; v1.soundTick = function () { if (SwainAudioPlayer.soundTypeArray.length > 0) { SwainAudioPlayer.soundTypeArray = new Array(); } }; v1.playSound = function (inSound, inPan) { var v1 = 0; while (v1 < SwainAudioPlayer.soundTypeArray.length) { if (SwainAudioPlayer.soundTypeArray[v1] == inSound) { return false; } ++v1; } SwainAudioPlayer.soundTypeArray.push(inSound); var v3 = SwainAudioPlayer.soundManager.createEmptyMovieClip('soundMC' + SwainMath.randomNumber(0, 99999), SwainAudioPlayer.soundManager.getNextHighestDepth()); v3.newSound = new Sound(v3); v3.mySound = inSound; var newSound = v3.newSound; SwainAudioPlayer.allSounds.push(newSound); SwainAudioPlayer.allSoundsMCs.push(v3); newSound.attachSound(SwainAudioPlayer.soundLibrary(inSound)); newSound.setPan(inPan); newSound.setVolume((SwainAudioPlayer.returnVolume(inSound) - Math.abs(inPan * 0.5)) * SwainAudioPlayer.volumeSound); newSound.start(); newSound.onSoundComplete = function () { var v1 = 0; while (v1 < SwainAudioPlayer.allSounds.length) { if (newSound == SwainAudioPlayer.allSounds[v1]) { SwainAudioPlayer.allSoundsMCs[v1].removeMovieClip(); SwainAudioPlayer.allSoundsMCs.splice(v1, 1); SwainAudioPlayer.allSounds.splice(v1, 1); delete newSound; break; } ++v1; } }; }; v1.stopSound = function (inSound) { var v1 = 0; while (v1 < SwainAudioPlayer.allSounds.length) { if (SwainAudioPlayer.allSoundsMCs[v1].mySound == inSound) { SwainAudioPlayer.allSounds[v1].stop(); delete SwainAudioPlayer.allSounds[v1]; SwainAudioPlayer.allSoundsMCs[v1].removeMovieClip(); SwainAudioPlayer.allSoundsMCs.splice(v1, 1); SwainAudioPlayer.allSounds.splice(v1, 1); trace('Stopped sound ' + inSound); break; } ++v1; } }; v1.stopAllSounds = function () { while (SwainAudioPlayer.allSoundsMCs.length > 0) { SwainAudioPlayer.allSoundsMCs[0].removeMovieClip(); SwainAudioPlayer.allSoundsMCs.splice(0, 1); } while (SwainAudioPlayer.allSounds.length > 0) { SwainAudioPlayer.allSounds[0].stop(); SwainAudioPlayer.allSounds.splice(0, 1); } }; v1.soundLibrary = function (inName) { var v2; if (inName == 'test1') { return inName; } if (inName == 'test2') { return inName; } if (inName == 'test3') { return inName; } if (inName == 'sound1') { return inName; } if (inName == 'sound2') { return inName; } v2 = 'S_'; if (inName == 'door1') { v2 += 'Door'; } if (inName == 'explode') { v2 += 'Explode'; } if (inName == 'clang') { v2 += 'Clang' + SwainMath.randomNumber(1, 4); } if (inName == 'static') { v2 += 'Static' + SwainMath.randomNumber(1, 3); } if (inName == 'break') { v2 += 'Break'; } if (inName == 'activator1') { v2 += 'Activator1'; } if (inName == 'activator2') { v2 += 'Activator2'; } if (inName == 'bombbeep') { v2 += 'Bomb1'; } if (inName == 'ppk') { v2 += 'Gun_PPK'; } if (inName == 'beretta') { v2 += 'Gun_Beretta'; } if (inName == 'glock') { v2 += 'Gun_Glock'; } if (inName == 'prokiller') { v2 += 'Gun_Prokiller'; } if (inName == 'deagle') { v2 += 'Gun_Deagle'; } if (inName == '500') { v2 += 'Gun_500'; } if (inName == '357') { v2 += 'Gun_357'; } if (inName == 'smg1') { v2 += 'Gun_SMG1'; } if (inName == 'smg2') { v2 += 'Gun_SMG2'; } if (inName == 'smg3') { v2 += 'Gun_SMG3'; } if (inName == 'steyr') { v2 += 'Gun_Steyr'; } if (inName == 'sr3') { v2 += 'Gun_SR3'; } if (inName == 'm249') { v2 += 'Gun_M249'; } if (inName == 'fnfal') { v2 += 'Gun_FNFAL'; } if (inName == 'famas') { v2 += 'Gun_FAMAS'; } if (inName == 'ar15') { v2 += 'Gun_AR15'; } if (inName == 'ak74') { v2 += 'Gun_AK74'; } if (inName == 'shotgun') { v2 += 'Gun_Shotgun'; } if (inName == 'shotguncock') { v2 += 'Gun_ShotgunCock'; } if (inName == 'm203') { v2 += 'Gun_M203'; } if (inName == 'chaingun') { v2 += 'Gun_Mini' + SwainMath.randomNumber(1, 2); } if (inName == 'silencer') { v2 += 'Gun_Silencer'; } if (inName == 'emptyclip') { v2 += 'Gun_EmptyClip'; } if (inName == 'swapgun') { v2 += 'Gun_Swap'; } if (inName == 'ricochet') { v2 += 'Gun_Ricochet'; } if (inName == 'reload') { v2 += 'Gun_Reload'; } if (inName == 'slash') { v2 += 'Melee_Slash' + SwainMath.randomNumber(1, 8); } if (inName == 'blunt') { v2 += 'Melee_Blunt' + SwainMath.randomNumber(1, 18); } if (inName == 'swish') { v2 += 'Melee_Swish' + SwainMath.randomNumber(1, 3); } if (inName == 'swishlow') { v2 += 'Melee_SwishLow'; } if (inName == 'swapmelee') { v2 += 'Melee_Swap'; } if (inName == 'blockmelee') { v2 += 'Melee_Block' + SwainMath.randomNumber(1, 5); } if (inName == 'injury') { v2 += 'Injury' + SwainMath.randomNumber(1, 2); } if (inName == 'land') { v2 += 'Land' + SwainMath.randomNumber(1, 6); } if (inName == 'landhard') { v2 += 'LandHard'; } if (inName == 'menu') { v2 += 'Track_Menu'; } if (inName == 'stage1') { v2 += 'Track_Stage1'; } if (inName == 'stage2') { v2 += 'Track_Stage2'; } if (inName == 'stage3') { v2 += 'Track_Stage3'; } if (inName == 'stage4') { v2 += 'Track_Stage4'; } if (inName == 'stage5') { v2 += 'Track_Stage5'; } if (inName == 'stage6') { v2 += 'Track_Stage6'; } if (inName == 'stage7') { v2 += 'Track_Stage7'; } if (inName == 'stage8') { v2 += 'Track_Stage8'; } if (inName == 'club1') { v2 += 'Track_Club1'; } if (inName == 'club2') { v2 += 'Track_Club2'; } if (inName == 'boss1') { v2 += 'Track_Boss1'; } if (inName == 'paper1') { v2 += 'Paper1'; } if (inName == 'paper2') { v2 += 'Paper2'; } if (inName == 'menu1') { v2 += 'Menu1'; } if (inName == 'menu2') { v2 += 'Menu2'; } if (inName == 'menu3') { v2 += 'Menu3'; } if (inName == 'menu4') { v2 += 'Menu4'; } if (inName == 'menu5') { v2 += 'Menu5'; } if (inName == 'buy') { v2 += 'StoreBuy'; } if (inName == 'nobuy') { v2 += 'StoreNoBuy'; } return v2; }; v1.returnVolume = function (inName) { var v1 = 100; if (inName == 'land') { v1 *= 0.5; } if (inName == 'swish') { v1 *= 0.5; } if (inName == 'swapmelee') { v1 *= 0.6; } if (inName == 'swapgun') { v1 *= 0.7; } if (inName == 'ricochet') { v1 *= 0.6; } if (inName == 'door') { v1 *= 0.6; } if (inName == 'clang') { v1 *= 0.9; } if (inName == 'reload') { v1 *= 0.5; } if (inName == 'break') { v1 *= 0.5; } if (inName == 'static') { v1 *= 0.6; } if (inName == 'menu1') { v1 *= 0.5; } if (inName == 'menu2') { v1 *= 0.2; } if (inName == 'menu3') { v1 *= 0.9; } if (inName == 'menu4') { v1 *= 0.6; } if (inName == 'menu5') { v1 *= 0.5; } return v1; }; v1.volumeSound = 0.75; v1.volumeMusic = 0.5; ASSetPropFlags(_global.SwainAudioPlayer.prototype, null, 1); } #endinitclip } movieClip 4807 __Packages.SwainMath { #initclip if (!_global.SwainMath) { var v1 = function () {}; _global.SwainMath = v1; var v2 = v1.prototype; v1.calculate_rotation = function (source_x, source_y, target_x, target_y) { SwainMath.Xd = target_x - source_x; SwainMath.Yd = target_y - source_y; SwainMath.radAngle = Math.atan2(SwainMath.Yd, SwainMath.Xd); SwainMath.rotation_result = int(SwainMath.radAngle * 360 / 6.283185307179586 + 90); if (SwainMath.rotation_result > 180) { SwainMath.rotation_result = -180 + (SwainMath.rotation_result - 180); } return SwainMath.rotation_result; }; v1.move_me = function (this_mc, this_rotation, this_speed) { if (this_rotation > 180) { this_mc._y += this_speed * Math.cos(0.0174532925199433 * this_rotation); this_mc._x -= this_speed * Math.sin(0.0174532925199433 * this_rotation); } else { this_mc._y -= this_speed * Math.cos(0.0174532925199433 * this_rotation); this_mc._x += this_speed * Math.sin(0.0174532925199433 * this_rotation); } }; v1.move_me2 = function (this_axis, this_rotation, this_speed) { if (this_rotation > 180) { if (this_axis == 'y') { return this_speed * Math.cos(0.0174532925199433 * this_rotation); } if (this_axis == 'x') { return -(this_speed * Math.sin(0.0174532925199433 * this_rotation)); } } else { if (this_axis == 'y') { return -(this_speed * Math.cos(0.0174532925199433 * this_rotation)); } if (this_axis == 'x') { return this_speed * Math.sin(0.0174532925199433 * this_rotation); } } }; v1.get_position = function (startX, startY, this_rotation, this_distance, this_axis) { if (this_axis == 'x') { if (this_rotation > 180) { return startX - this_distance * Math.sin(0.0174532925199433 * this_rotation); } else { return startX + this_distance * Math.sin(0.0174532925199433 * this_rotation); } } if (this_axis == 'y') { if (this_rotation > 180) { return startY + this_distance * Math.cos(0.0174532925199433 * this_rotation); } else { return startY - this_distance * Math.cos(0.0174532925199433 * this_rotation); } } }; v1.get_distance = function (mc_1, mc_2) { SwainMath.point_this.x = mc_1._x; SwainMath.point_this.y = mc_1._y; SwainMath.point_target.x = mc_2._x; SwainMath.point_target.y = mc_2._y; SwainMath.this_distance = flash.geom.Point.distance(SwainMath.point_this, SwainMath.point_target); return SwainMath.this_distance; }; v1.get_distance2 = function (mc_1_x, mc_1_y, mc_2_x, mc_2_y) { SwainMath.point_this.x = mc_1_x; SwainMath.point_this.y = mc_1_y; SwainMath.point_target.x = mc_2_x; SwainMath.point_target.y = mc_2_y; SwainMath.this_distance = flash.geom.Point.distance(SwainMath.point_this, SwainMath.point_target); return SwainMath.this_distance; }; v1.randomNumber = function (min, max) { var v1 = Math.floor(Math.random() * (max - min + 1)) + min; return v1; }; v1.getAxisDistance = function (inStart, inEnd) { var v1 = inStart - inEnd; if (inStart < inEnd) { v1 *= -1; } return v1; }; v1.getRotDistance = function (inRot1, inRot2) { var v1; if (inRot1 < inRot2 - 180) { inRot1 += 360; } if (inRot1 > inRot2 + 180) { inRot1 -= 360; } v1 = inRot1 - inRot2; if (v1 < 0) { v1 *= -1; } return v1; }; v1.point_this = new flash.geom.Point(0, 0); v1.point_target = new flash.geom.Point(0, 0); v1.this_distance = new Number(); v1.Xd = new Number(); v1.Yd = new Number(); v1.radAngle = new Number(); v1.rotation_result = new Number(); ASSetPropFlags(_global.SwainMath.prototype, null, 1); } #endinitclip } movieClip 4808 __Packages.CharacterGenerator { #initclip if (!_global.CharacterGenerator) { var v1 = function () {}; _global.CharacterGenerator = v1; var v2 = v1.prototype; v1.generateCharacter = function (inCharArray, inDifficulty) {}; v1.generateRoster = function (inFaction, inUnitsArray) { var v3 = new MadnessRoster(); v3.init(inFaction); var v2 = 0; while (v2 < inUnitsArray.length) { var v1 = new MadnessDataFile(); v1.createNew(MadnessLevel.badguyShoppingList[SwainMath.randomNumber(0, MadnessLevel.badguyShoppingList.length - 1)]); v3.addCharacter(v1); v3.makeActive(v1); ++v2; } return v3; }; v1.storePopulator = function () { var v9 = MadnessRoster.storeRoster; while (MadnessRoster.storeRoster.myMembers.length > 0) { v9.removeCharacter(v9.myMembers[0]); } var v8 = 0; for (;;) { if (!(v8 < 2 || v8 < 5 && SwainMath.randomNumber(0, 2) < 2)) break; var v5 = new MadnessDataFile(); var v2 = true; if (SwainMath.randomNumber(0, 10) == 0) { var v4 = new Array(); var v6; if (MadnessRoster.playerRoster.teamLeader.myLevel >= 8) { v4.push('blockhead'); } if (MadnessRoster.playerRoster.teamLeader.myLevel >= 12) { v4.push('krinkels'); } if (MadnessRoster.playerRoster.teamLeader.myLevel >= 10) { v4.push('swain'); } if (MadnessRoster.playerRoster.teamLeader.myLevel >= 20) { v4.push('tricky'); } if (MadnessRoster.playerRoster.teamLeader.myLevel >= 20) { v4.push('jesus'); } if (MadnessRoster.playerRoster.teamLeader.myLevel >= 15) { v4.push('deimos'); } if (MadnessRoster.playerRoster.teamLeader.myLevel >= 15) { v4.push('sanford'); } if (MadnessRoster.playerRoster.teamLeader.myLevel >= 30) { v4.push('hank'); } var v7 = 0; for (;;) { if (!(v7 < 3 && v2 == true)) break; v2 = false; v6 = v4[SwainMath.randomNumber(0, v4.length - 1)]; var v3 = 0; while (v3 < MadnessRoster.storeRoster.myMembers.length) { if (MadnessRoster.storeRoster.myMembers[v3].myCharacter == v6) { v2 = true; break; } ++v3; } if (!v2) { v3 = 0; while (v3 < MadnessRoster.playerRoster.myMembers.length) { if (MadnessRoster.playerRoster.myMembers[v3].myCharacter == v6) { v2 = true; break; } ++v3; } } ++v7; } if (!v2) { v5.createNew(v6); v5.applyHireCost(v5.myLevel); v5.myWeapons[0] = undefined; v5.myWeapons[1] = undefined; v5.mixStats(); } } if (v2) { v5.createNew('arena_merc'); v5.randomStats(MadnessRoster.playerRoster.teamLeader.myLevel); ItemGenerator.assignGear(v5, MadnessRoster.playerRoster.teamLeader.myLevel); v5.myName = CharacterGenerator.allNames[SwainMath.randomNumber(0, CharacterGenerator.allNames.length - 1)]; } MadnessRoster.storeRoster.addCharacter(v5); ++v8; } if (_root.storeHire != undefined) { _root.storeHire.init(); } }; v1.returnWaveList = function (inLevel, inWave) { --inLevel; var v3 = new Array(); var v8 = 3 + Math.floor((inLevel + inWave / 4) / 4); var v2 = new Array(); var v7 = 0; if (inWave == 4 || inWave == 8) { v7 += Math.ceil(inLevel / (8 - inWave) / 5); } var v4 = 0; while (v4 < v8) { if (inLevel + inWave / 4 - 2 < v4 || v4 <= 1) { v3.push('civ'); } else { if (inLevel > 5 && v4 == 2 && inWave > 3) { v3.push('agent2'); } else { if (inLevel > 9 && v4 == 3 && inWave > 4) { v3.push('agent3'); } else { v3.push('agent'); } } } ++v4; } v4 = 0; while (v4 < v7) { if (inLevel + v4 <= 2) { v2.push('agent'); } else { if (inLevel + v4 <= 5) { v2.push('agent2'); } else { if (inLevel + v4 <= 9) { v2.push('agent3'); } else { if (inLevel + v4 <= 15) { v2.push('fatboy'); } else { v2.push('fatman'); } } } } ++v4; } var v6 = new Array(); v4 = 0; while (v4 < v3.length) { v6.push(v3[v4]); ++v4; } v4 = 0; while (v4 < v2.length) { v6.push(v2[v4]); ++v4; } return v6; }; v1.allNames = ['Kurt', 'Stu', 'Willy', 'Geeves', 'Bateman', 'James', 'Axel', 'Bruno', 'Caleb', 'Dale', 'Tucker', 'Felix', 'Fabian', 'Grant', 'Hal', 'Ives', 'Jarvis', 'T.J.', 'Nash', 'Gavyn', 'Don', 'Brooks', 'Bronson', 'Heston', 'Charleton', 'Clint', 'Eastwood', 'Jordan', 'Duane', 'Jacob', 'Stamper', 'Fulp', 'Bandelin', 'Tanner', 'Aurelius', 'Zeke', 'Yale', 'Wade', 'Vincent', 'Vance', 'Uistean', 'Thorpe', 'Shawn', 'Biddle', 'Johanson', 'Francis', 'Drake', 'Raleigh', 'Quade', 'Pedro', 'Oliver', 'Neal', 'Manuel', 'Landon', 'Keegan', 'Butch', 'Buck', 'Kane', 'Jasper', 'Smalls', 'Ponyboy', 'Godzilla', 'Sailor', 'Charles', 'Mabutu', 'Chumbo', 'Ching', 'Mr.Beautiful', 'Johnny', 'Leon', 'Norton', 'Jacob', 'Fletcher', 'Grisham', 'Graham', 'Harold', 'Watson', 'Holmes', 'Blake', 'Cartiff', 'Ulysses', 'Marty', 'Lloyd', 'Emmett', 'Tiernan', 'Tiberius', 'Thadeus', 'Max', 'Holden', 'Hayden', 'Hadrian', 'Claus', 'Claudius', 'Caesar', 'Fernando', 'Gooseman', 'Hernando', 'Wheeler', 'Ma-Ti', 'Kwame', 'Captain', 'Aden', 'Abram', 'Lee', 'Colby', 'Maynard', 'Jonesy', 'Chauncey', 'Jack', 'Harvey', 'Hugh', 'Tobias', 'Phoenix', 'Simon', 'Alucard', 'Alistar', 'Edgar', 'Edwin', 'Reuben', 'Jonas', 'Dylan', 'Kai', 'Nigel', 'Percy', 'Bruce', 'Alfie', 'Gordon', 'Lebowski', 'Walter', 'Donnie', 'Frank', 'Leo', 'Deadeye', 'Skittles', 'Addison', 'Adonis', 'Ajay', 'Ari', 'Cale', 'Carlo', 'Castle', 'Dalvin', 'Ethan', 'Eli', 'Ezekiel', 'Fox', 'Snake', 'Wolf', 'Garett', 'Gideon', 'Rocco', 'Judah', 'Mick', 'Sylas', 'Jan', 'Lionel', 'Sabin', 'Setzer', 'Spencer', 'Waylon', 'Wyatt', 'Victor', 'Malakai', 'Fingers', '8-Ball', 'Swastiko', 'Tyrone', 'Filburt', 'Bennet', 'Mordecai', 'Percival', 'Samson', 'Terrance', 'Curtis', 'Johan', 'Marcus', 'Kenton', 'Bond', 'Ashton', 'Shepard', 'Rex', 'Tony', 'Ramsay', 'Darius', 'Xerxes', 'Chief', 'Ivan', 'Drago', 'Drachen', 'Vlad', 'Joachim', 'Adolf', 'Heinrich', 'Lungren', 'Dolf', 'Rolf', 'Poopoo', 'Rigby']; ASSetPropFlags(_global.CharacterGenerator.prototype, null, 1); } #endinitclip } movieClip 4809 __Packages.MadnessRoster { #initclip if (!_global.MadnessRoster) { var v1 = function () { this.myActiveMembers = new Array(); this.myMembers = new Array(); this.myWeapons = new Array(); this.myArmor = new Array(); this.myEvents = new Array(); }; _global.MadnessRoster = v1; var v2 = v1.prototype; v2.init = function (inFaction) { this.teamFaction = inFaction; }; v2.addCharacter = function (inChar) { this.myMembers.push(inChar); inChar.myRoster = this; }; v2.makeActive = function (inChar) { if (this == MadnessRoster.playerRoster) { var v2; v2 = 0; while (v2 < MadnessRoster.maxPlayers) { if (this.myActiveMembers[v2] == undefined) { if (!this.returnActiveCharacter(inChar)) { this.myActiveMembers.push(inChar); if (this.teamLeader == undefined) { this.makeLeader(inChar); } } else { break; } } ++v2; } if (v2 == MadnessRoster.maxPlayers) { } } else { if (!this.returnActiveCharacter(inChar)) { this.myActiveMembers.push(inChar); this.findLeaderCandidate(); } } }; v2.removeActive = function (inChar) { var v2 = 0; while (v2 < MadnessRoster.maxPlayers) { if (this.myActiveMembers[v2] == inChar) { this.myActiveMembers.splice(v2, 1); break; } ++v2; } if (inChar == this.teamLeader) { this.teamLeader = undefined; this.findLeaderCandidate(); } }; v2.returnActiveCharacter = function (inChar) { var v2; v2 = 0; while (v2 < MadnessRoster.maxPlayers) { if (inChar == this.myActiveMembers[v2]) { break; } ++v2; } return v2 != MadnessRoster.maxPlayers; }; v2.removeCharacter = function (inChar) { var v2 = 0; while (v2 < this.myMembers.length) { if (this.myMembers[v2] == inChar) { this.myMembers.splice(v2, 1); break; } ++v2; } this.removeActive(inChar); }; v2.populateRoster = function (inUnits, inDifficulty, inCategory, inLeader) { var v3 = 0; while (v3 < inUnits) { var v2 = new MadnessDataFile(); v2.createNew(MadnessLevel.badguyShoppingList[SwainMath.randomNumber(0, MadnessLevel.badguyShoppingList.length - 1)]); this.addCharacter(v2); ++v3; } }; v2.makeLeader = function (inChar) { this.teamLeader = inChar; var v2 = 0; while (v2 < this.myMembers) { this.myMembers[v2].mySprite.myLeader = this.teamLeader; ++v2; } }; v2.findLeaderCandidate = function () { this.determineTeamLeader(); }; v2.addWeapon = function (inWeapon) { if (inWeapon != undefined) { this.myWeapons.unshift(inWeapon); inWeapon.myOwner = undefined; } }; v2.removeWeapon = function (inWeapon) { if (inWeapon != undefined) { var v2 = 0; while (v2 < this.myWeapons.length) { if (this.myWeapons[v2] == inWeapon) { this.myWeapons[v2].myOwner = undefined; this.myWeapons.splice(v2, 1); break; } ++v2; } } }; v2.addArmor = function (inArmor) { if (inArmor != undefined) { this.myArmor.unshift(inArmor); this.myArmor.myOwner = undefined; } }; v2.removeArmor = function (inArmor) { if (inArmor != undefined) { var v2 = 0; while (v2 < this.myArmor.length) { if (this.myArmor[v2] == inArmor) { this.myArmor[v2].myOwner = undefined; this.myArmor.splice(v2, 1); break; } ++v2; } } }; v2.releaseAllWeapons = function () { var v3 = 0; while (v3 < this.myWeapons.length) { var v2; v2 = 0; while (v2 < this.myMembers.length) { if (this.myWeapons[v3] == this.myMembers[v2].myWeapons[0] || this.myWeapons[v3] == this.myMembers[v2].myWeapons[1]) { } ++v2; } if (v2 == this.myMembers.length) { this.myWeapons[v3].myOwner = undefined; } ++v3; } }; v2.healTeam = function () { var v2 = 0; while (v2 < this.myMembers.length) { this.myMembers[v2].healMe(); ++v2; } }; v2.gameOver = function (inReason) { this.healTeam(); }; v2.copyRoster = function (otherRoster) { this.myActiveMembers = new Array(); this.myMembers = new Array(); var v5 = 0; while (v5 < otherRoster.myMembers.length) { var v4 = new MadnessDataFile(); v4.copyCharacter(otherRoster.myMembers[v5]); v4.myRoster = this; this.myMembers.push(v4); if (otherRoster.myMembers[v5] == otherRoster.teamLeader) { this.teamLeader = v4; } var v3 = 0; while (v3 < otherRoster.myActiveMembers.length) { if (otherRoster.myMembers[v5] == otherRoster.myActiveMembers[v3]) { this.myActiveMembers.push(v4); break; } ++v3; } ++v5; } this.teamFaction = otherRoster.teamFaction; this.myCash = otherRoster.myCash; this.myWeapons = otherRoster.myWeapons; this.myArmor = otherRoster.myArmor; }; v2.returnCharactersAsObjects = function () { var v2; var v4 = new Array(); var v3 = 0; while (v3 < this.myActiveMembers.length) { v2 = this.myActiveMembers[v3]; v2.saveAsActive = true; v2.saveAsLeader = v2 == this.teamLeader; ++v3; } this.myActiveMembers = new Array(); v3 = 0; while (v3 < this.myMembers.length) { v2 = this.myMembers[v3]; v2.myRoster = undefined; v4.push(Object(v2)); ++v3; } return v4; }; v2.convertCharactersToMadnessData = function (inMembers) { this.myMembers = new Array(); var v3; var v2 = 0; while (v2 < inMembers.length) { v3 = new MadnessDataFile(); v3.copyCharacter(inMembers[v2]); v3.myRoster = this; this.myMembers.push(v3); ++v2; } }; v2.convertActiveMembers = function () { var v2; this.myActiveMembers = new Array(); var v3 = 0; while (v3 < this.myMembers.length) { v2 = this.myMembers[v3]; if (v2.saveAsActive) { v2.saveAsActive = false; if (v2.saveAsLeader) { this.teamLeader = v2; } v2.saveAsLeader = false; this.myActiveMembers.push(v2); } ++v3; } }; v2.determineTeamLeader = function () { var v4 = 0; var v3; var v2 = 0; while (v2 < this.myActiveMembers.length) { if (this.myActiveMembers[v2].myLevel > v4) { v3 = this.myActiveMembers[v2]; v4 = v3.myLevel; } ++v2; } if (v3 != undefined) { this.makeLeader(v3); } }; v2.readjustActiveOrder = function () { var v2 = 0; while (v2 < this.myActiveMembers.length) { if (this.myActiveMembers[v2] == this.teamLeader) { this.myActiveMembers.splice(v2, 1); } ++v2; } this.myActiveMembers.splice(0, 0, this.teamLeader); }; v1.maxPlayers = 10; v1.maxRoster = 999; v2.myCash = new Number(); v2.teamFireScore = new Number(); ASSetPropFlags(_global.MadnessRoster.prototype, null, 1); } #endinitclip } movieClip 4810 __Packages.MadnessDataFile { #initclip if (!_global.MadnessDataFile) { var v1 = function () { this.myWeapons = new Array(); this.myHat = new Array(); this.myMouth = new Array(); this.myMask = new Array(); this.myShirt = new Array(); this.weaponArray = new Array(); this.headWounds = new Array(); this.bodyWounds = new Array(); }; _global.MadnessDataFile = v1; var v2 = v1.prototype; v2.createExisting = function (inChar) { var v4 = ['myName', 'myCharacter', 'myHeight', 'myWidth', 'myShootHeight', 'myHealth', 'mySpeed', 'myAccel', 'myDash', 'myReload', 'myBlood', 'traitBravery', 'traitCover', 'traitDistracted', 'traitTriggerFinger', 'myHat', 'myShirt', 'myMask', 'myMouth', 'lifeStatus', 'myIconPos']; var v2 = 0; while (v2 < v4.length) { this[v4[v2]] = inChar[v4[v2]]; ++v2; } v2 = 0; while (v2 < inChar.myWeapons.length) { this.createWeapon(v2, inChar.myWeapons[v2].myType, inChar.myWeapons[v2].myTag.substr(-8, 8) == 'Silencer'); ++v2; } }; v2.createNew = function (inChar) { this.myCharacter = inChar; this.myHeight = 94; this.myWidth = 50; this.myDepth = 16; this.myShootHeight = 50; this.myHeadHeight = 50; this.myIconPos = SwainMath.randomNumber(1, 4); this.myWeapons = new Array(); this.myScale = 1; this.noCollide = false; this.amSlow = false; this.bulletEater = false; this.myBoss = ''; this.autoHit = false; this.noPaint = false; this.selfShoot = false; this.weakToDash = false; this.disarmHelm = false; this.fastDeath = false; this.noRange = false; this.hitStopAttack = false; this.freakOut = false; this.meleeHealth = 3; if (this.myCharacter == 'woody') { this.myName = 'Dummy'; this.myCharacter = 'civ'; this.myHealth = 8; this.mySpeed = 5; this.myAccel = this.mySpeed / 4; this.myDash = 1.3; this.myReload = 90; this.myBlood = 'red'; this.myLevel = 1; this.traitBravery = 1; this.traitCover = 0; this.traitDistracted = 8; this.traitTriggerFinger = 1; this.traitCombatSkill = 1; this.applyStats(3, 3, 3, 3, 0, 3, null, 10, 10, 10, 10, 10, 10, 10, 10); } else { if (this.myCharacter == 'coward') { this.myName = 'Deserter'; this.myCharacter = 'civ'; this.myHealth = 8; this.mySpeed = 5; this.myAccel = this.mySpeed / 4; this.myDash = 1.3; this.myReload = 90; this.myBlood = 'red'; this.myLevel = 1; this.traitBravery = -1; this.traitCover = 0; this.traitDistracted = 8; this.traitTriggerFinger = 1; this.traitCombatSkill = 1; this.applyStats(1, 1, 1, 1, 0, 1, null, 0, 0, 0, 0, 0, 0, 0, 0); } else { if (this.myCharacter == 'civ') { this.myName = 'Grunt'; this.myHealth = 8; this.mySpeed = 5; this.myAccel = this.mySpeed / 4; this.myDash = 1.3; this.myReload = 90; this.myBlood = 'red'; this.myLevel = 1; this.traitBravery = 1; this.traitCover = 0; this.traitDistracted = 8; this.traitTriggerFinger = 1; this.traitCombatSkill = 1; this.weaponArray = ['ppk', 'beretta', 'glock20']; this.applyStats(1, 1, 1, 1, 0, 1, null, 0, 0, 0, 0, 0, 0, 0, 0); } else { if (this.myCharacter == 'agent') { this.myName = 'Agent'; this.myHealth = 12; this.mySpeed = 6; this.myAccel = this.mySpeed / 4; this.myDash = 1.3; this.myReload = 80; this.myBlood = 'red'; this.myLevel = SwainMath.randomNumber(2, 4); this.traitBravery = 3; this.traitCover = 1; this.traitDistracted = 7; this.traitTriggerFinger = 4; this.traitCombatSkill = 3; this.weaponArray = ['ppk', 'beretta', 'glock20']; this.applyStats(4, 4, 4, 4, 2, 4, null, 5, 5, 5, 5, 5, 5, 5, 5); } else { if (this.myCharacter == 'agent2') { this.myName = 'Agent Mk1'; this.myHealth = 18; this.mySpeed = 6; this.myAccel = this.mySpeed / 4; this.myDash = 1.3; this.myReload = 70; this.myBlood = 'yellow'; this.myLevel = SwainMath.randomNumber(5, 7); this.traitBravery = 5; this.traitCover = 1; this.traitDistracted = 4; this.traitTriggerFinger = 7; this.traitCombatSkill = 5; this.weaponArray = ['ppk', 'beretta', 'glock20', 'prokiller460', 'deagle', 'hk2', 'mp7', 'tmp', 'mp5k', 'pm9', 'oa93', '500snub', '357snub', 'ar15']; this.applyStats(7, 7, 7, 7, 4, 7, null, 10, 10, 10, 10, 10, 10, 10, 10); } else { if (this.myCharacter == 'agent3') { this.myName = 'Agent Mk0'; this.myHealth = 25; this.mySpeed = 6; this.myAccel = this.mySpeed / 4; this.myDash = 1.3; this.myReload = 70; this.myBlood = 'yellow'; this.myLevel = SwainMath.randomNumber(9, 11); this.traitBravery = 7; this.traitCover = 1; this.traitDistracted = 3; this.traitTriggerFinger = 7; this.traitCombatSkill = 9; this.weaponArray = ['ppk', 'beretta', 'glock20', 'prokiller460', 'deagle', 'hk2', 'mp7', 'tmp', 'mp5k', 'pm9', 'oa93', '500snub', '357snub', 'ar15']; this.createWeapon(0, this.weaponArray[SwainMath.randomNumber(0, this.weaponArray.length - 1)], false); this.createWeapon(1, this.weaponArray[SwainMath.randomNumber(0, this.weaponArray.length - 1)], false); this.weaponArray = new Array(); this.myWeapons[0].myAmmo = 2; this.myWeapons[0].myClips = 0; this.applyStats(10, 15, 10, 10, 5, 10, null, 15, 15, 15, 15, 15, 15, 15, 15); } else { if (this.myCharacter == 'mag') { this.myName = 'Mag Agent'; this.myHealth = 300; this.mySpeed = 5; this.myAccel = this.mySpeed / 4; this.myDash = 1.3; this.myReload = 70; this.myBlood = 'red'; this.myLevel = 15; this.myScale = 2.5; this.noCollide = true; this.selfShoot = true; this.amSlow = true; this.bulletEater = true; this.myBoss = 'mag1'; this.autoHit = true; this.noPaint = true; this.noRange = true; this.myStartup = 'startup_roar'; this.traitBravery = 7; this.traitCover = 1; this.traitDistracted = 3; this.traitTriggerFinger = 7; this.traitCombatSkill = 10; this.createWeapon(0, 'ppk', false); this.myWeapons[0].myClips = 2000; this.myWeapons[0].noPickup = true; this.myWeapons[0].myDamage *= 3; this.applyStats(30, 5, 0, 20, 0, 3, null, 15, 15, 15, 15, 15, 15, 15, 15); this.myHealth = 2500; this.myHealthMax = 2500; this.myTactics = 0; this.myTacticsMax = 0; } else { if (this.myCharacter == 'fatboy') { this.myName = 'Fatboy'; this.myCharacter = 'fatboy'; this.myHealth = 25; this.mySpeed = 6; this.myAccel = this.mySpeed / 4; this.myDash = 1.25; this.myReload = 70; this.myBlood = 'red'; this.myLevel = 10; this.meleeHealth = 5; this.myScale = 1.4; this.noCollide = true; this.weakToDash = true; this.disarmHelm = true; this.selfShoot = true; this.amSlow = true; this.bulletEater = true; this.noPaint = false; this.autoHit = true; this.fastDeath = true; this.myStartup = 'startup_roar'; this.traitBravery = 1; this.traitCover = 1; this.traitDistracted = 3; this.traitTriggerFinger = 5; this.traitCombatSkill = 2; this.weaponArray = ['hk2', 'mp7', 'tmp', 'mp5k', 'pm9', 'oa93']; this.createWeapon(0, this.weaponArray[SwainMath.randomNumber(0, this.weaponArray.length - 1)], false); this.myWeapons[0].myClips = 2000; this.myWeapons[0].noPickup = true; this.weaponArray = new Array(); this.applyStats(20, 1, 20, 3, 0, 3, null, 10, 10, 10, 10, 10, 10, 10, 10); this.myHealth = 220; this.myHealthMax = 220; this.myTactics = 0; this.myTacticsMax = 0; this.createArmor('armorgolem1'); this.createArmor('helmetgolem1'); } else { if (this.myCharacter == 'fatman') { this.myName = 'Fatman'; this.myCharacter = 'fatboy'; this.myHealth = 25; this.mySpeed = 6; this.myAccel = this.mySpeed / 4; this.myDash = 1.3; this.myReload = 70; this.myBlood = 'red'; this.myLevel = 15; this.meleeHealth = 7; this.myScale = 1.5; this.noCollide = true; this.weakToDash = true; this.disarmHelm = true; this.selfShoot = true; this.amSlow = true; this.bulletEater = true; this.noPaint = true; this.autoHit = true; this.fastDeath = true; this.hitStopAttack = true; this.freakOut = true; this.myStartup = 'startup_roar'; this.traitBravery = 1; this.traitCover = 1; this.traitDistracted = 3; this.traitTriggerFinger = 6; this.traitCombatSkill = 3; this.weaponArray = ['megahammer']; this.createWeapon(0, 'megahammer', false); this.createWeapon(1, 'chaingun', false); this.myWeapons[1].myClips = 20000; this.myWeapons[0].noPickup = true; this.myWeapons[1].noPickup = true; this.weaponArray = new Array(); this.applyStats(20, 1, 20, 3, 0, 3, null, 15, 15, 15, 15, 15, 15, 15, 15); this.myHealth = 500; this.myHealthMax = 500; this.myTactics = 0; this.myTacticsMax = 0; this.createArmor('armorgolem2'); this.createArmor('helmetgolem2'); } else { if (this.myCharacter == 'hank') { this.myName = 'Hank'; this.amSpecial = true; this.arenaLockArmor = true; this.myHealth = 80; this.mySpeed = 6; this.myAccel = this.mySpeed / 4; this.myDash = 1.4; this.myReload = 60; this.myBlood = 'red'; this.myLevel = 30; this.traitBravery = 10; this.traitCover = 6; this.traitDistracted = 1; this.traitTriggerFinger = 6; this.traitCombatSkill = 8; this.myWeapons[0].myClips = 200; this.myWeapons[1].myClips = 200; this.applyStats(25, 25, 25, 25, 0, 25, null, 25, 25, 25, 25, 25, 25, 25, 25); } else { if (this.myCharacter == 'sanford') { this.myName = 'Sanford'; this.amSpecial = true; this.arenaLockArmor = true; this.myHealth = 50; this.mySpeed = 6; this.myAccel = this.mySpeed / 4; this.myDash = 1.4; this.myReload = 60; this.myBlood = 'red'; this.myLevel = 15; this.traitBravery = 5; this.traitCover = 5; this.traitDistracted = 5; this.traitTriggerFinger = 4; this.traitCombatSkill = 6; this.applyStats(15, 15, 15, 15, 0, 15, null, 15, 15, 15, 15, 15, 15, 15, 15); } else { if (this.myCharacter == 'deimos') { this.myName = 'Deimos'; this.amSpecial = true; this.arenaLockArmor = true; this.myHealth = 50; this.mySpeed = 6; this.myAccel = this.mySpeed / 4; this.myDash = 1.4; this.myReload = 60; this.myBlood = 'red'; this.myLevel = 15; this.traitBravery = 5; this.traitCover = 5; this.traitDistracted = 5; this.traitTriggerFinger = 5; this.traitCombatSkill = 6; this.applyStats(15, 15, 15, 15, 0, 15, null, 15, 15, 15, 15, 15, 15, 15, 15); } else { if (this.myCharacter == 'jesus') { this.myName = 'Jesus'; this.amSpecial = true; this.arenaLockArmor = true; this.myHealth = 80; this.mySpeed = 6; this.myAccel = this.mySpeed / 4; this.myDash = 1.4; this.myReload = 60; this.myBlood = 'red'; this.myLevel = 20; this.traitBravery = 7; this.traitCover = 4; this.traitDistracted = 2; this.traitTriggerFinger = 7; this.traitCombatSkill = 10; this.createWeapon(0, '500long', false); this.createWeapon(1, 'binarysword', false); this.applyStats(25, 25, 25, 25, 0, 25, null, 25, 25, 25, 25, 25, 25, 25, 25); } else { if (this.myCharacter == 'tricky') { this.myName = 'Tricky'; this.amSpecial = true; this.arenaLockArmor = true; this.myHealth = 80; this.mySpeed = 6; this.myAccel = this.mySpeed / 4; this.myDash = 1.4; this.myReload = 60; this.myBlood = 'red'; this.myLevel = 20; this.traitBravery = 10; this.traitCover = 1; this.traitDistracted = 6; this.traitTriggerFinger = 10; this.traitCombatSkill = 10; this.weaponArray = ['mp7']; this.applyStats(25, 25, 25, 25, 0, 25, null, 25, 25, 25, 25, 25, 25, 25, 25); } else { if (this.myCharacter == 'blockhead') { this.myName = 'Blockhead'; this.amSpecial = true; this.arenaLockArmor = true; this.myHealth = 20; this.mySpeed = 6; this.myAccel = this.mySpeed / 4; this.myDash = 1.4; this.myReload = 60; this.myBlood = 'yellow'; this.myLevel = 8; this.traitBravery = 10; this.traitCover = 1; this.traitDistracted = 10; this.traitTriggerFinger = 3; this.traitCombatSkill = 4; this.weaponArray = ['ar15', 'sr3', 'ak74', 'm16', 'aug', 'ak74u', 'hk416', 'fnfal', 'm249', 'famas', 'oa93', 'pm9', 'mp5', 'mp5k', 'tmp', 'mp7', 'hk2']; this.applyStats(10, 10, 10, 10, 0, 10, null, 10, 10, 10, 10, 10, 10, 10, 10); } else { if (this.myCharacter == 'swain') { this.myName = 'The Swain'; this.amSpecial = true; this.arenaLockArmor = true; this.myHealth = 20; this.mySpeed = 6; this.myAccel = this.mySpeed / 4; this.myDash = 1.4; this.myReload = 60; this.myBlood = 'red'; this.myLevel = 10; this.traitBravery = 6; this.traitCover = 4; this.traitDistracted = 3; this.traitTriggerFinger = 7; this.traitCombatSkill = 5; this.weaponArray = ['ar15', 'sr3', 'ak74', 'm16', 'aug', 'ak74u', 'hk416', 'fnfal', 'm249', 'famas', 'oa93', 'pm9', 'mp5', 'mp5k', 'tmp', 'mp7', 'hk2']; this.applyStats(10, 10, 10, 10, 0, 10, null, 10, 10, 10, 10, 10, 10, 10, 10); } else { if (this.myCharacter == 'krinkels') { this.myName = 'Krinkles'; this.amSpecial = true; this.arenaLockArmor = true; this.myHealth = 20; this.mySpeed = 6; this.myAccel = this.mySpeed / 4; this.myDash = 1.4; this.myReload = 60; this.myBlood = 'red'; this.myLevel = 12; this.traitBravery = 7; this.traitCover = 9; this.traitDistracted = 7; this.traitTriggerFinger = 2; this.traitCombatSkill = 6; this.assignCustom('hat', this.myHat, ['hair1'], 1); this.assignCustom('mask', this.myMask, ['shades2'], 1); this.assignCustom('mouth', this.myMouth, ['chin1'], 1); this.weaponArray = ['ar15', 'sr3', 'ak74', 'm16', 'aug', 'ak74u', 'hk416', 'fnfal', 'm249', 'famas', 'oa93', 'pm9', 'mp5', 'mp5k', 'tmp', 'mp7', 'hk2']; this.applyStats(10, 10, 10, 10, 0, 10, null, 10, 10, 10, 10, 10, 10, 10, 10); } else { if (this.myCharacter == 'arena') { this.myName = 'Player'; this.amSpecial = true; this.myCharacter = 'civ'; this.myHealth = 8; this.mySpeed = 5; this.myAccel = this.mySpeed / 4; this.myDash = 1.3; this.myReload = 90; this.myBlood = 'red'; this.myLevel = 1; this.traitBravery = 1; this.traitCover = 1; this.traitDistracted = 8; this.traitTriggerFinger = 1; this.traitCombatSkill = 1; this.applyStats(0, 0, 0, 0, 0, 0, null, 0, 0, 0, 0, 0, 0, 0, 0); } else { if (this.myCharacter == 'arena_merc') { this.myName = 'Mercenary'; this.amSpecial = true; this.myCharacter = 'civ'; this.myHealth = 8; this.mySpeed = 5; this.myAccel = this.mySpeed / 4; this.myDash = 1.3; this.myReload = 90; this.myBlood = 'red'; this.myLevel = 1; this.traitBravery = 1; this.traitCover = 1; this.traitDistracted = 8; this.traitTriggerFinger = 1; this.traitCombatSkill = 1; this.applyStats(0, 0, 0, 0, 0, 0, null, 0, 0, 0, 0, 0, 0, 0, 0); } } } } } } } } } } } } } } } } } } } this.myReload = 96; this.myHealthMax = this.myHealth; if (this.weaponArray.length > 0) { this.createWeapon(0, this.weaponArray[SwainMath.randomNumber(0, this.weaponArray.length - 1)], false); } this.myUnarmed = ItemGenerator.unarmedWeapon(); }; v2.createWeapon = function (inSlot, inType, silencer) { var v2 = new Object(); v2 = ItemGenerator.createWeapon(inType, silencer); this.equipItem(v2, inSlot); }; v2.createArmor = function (inType) { var v2 = new Object(); v2 = ItemGenerator.createArmor(inType); this.equipItem(v2, 0); }; v2.equipItem = function (inItem, forceSlot) { if (inItem != undefined) { if (inItem.myCat == 'melee' || inItem.myCat == 'smg' || inItem.myCat == 'pistol' || inItem.myCat == 'revolver' || inItem.myCat == 'shotgun' || inItem.myCat == 'rifle' || inItem.myCat == 'heavy') { if (forceSlot != null) { this.unequipItem('weapon' + String(forceSlot), forceSlot == 2); this.giveItem(inItem, forceSlot); } else { if ((inItem.myCat == 'pistol' || inItem.myCat == 'revolver') && (this.myWeapons[0] != undefined || this.myWeapons[1] == undefined)) { this.unequipItem('weapon1', false); this.giveItem(inItem, 1); } else { this.unequipItem('weapon0', false); this.giveItem(inItem, 0); } } } else { if (inItem.myCat == 'shirt') { this.unequipItem(inItem.myCat, forceSlot == 2); this.giveItem(inItem, forceSlot); } else { if (inItem.myCat == 'hat') { this.unequipItem(inItem.myCat, forceSlot == 2); this.giveItem(inItem, forceSlot); } else { if (inItem.myCat == 'mask') { this.unequipItem(inItem.myCat, forceSlot == 2); this.giveItem(inItem, forceSlot); } else { if (inItem.myCat == 'mouth') { this.unequipItem(inItem.myCat, forceSlot == 2); this.giveItem(inItem, forceSlot); } } } } } } }; v2.unequipItem = function (inCat, inStore) { var v3; if (inStore) { v3 = 2; } else { if (inCat == 'weapon1') { v3 = 1; } else { v3 = 0; } } var v2; if (inCat.substr(0, 6) == 'weapon') { v2 = this.myWeapons; if (!inStore) { this.myRoster.addWeapon(v2[v3]); } } else { if (inCat == 'hat') { v2 = this.myHat; } else { if (inCat == 'mask') { v2 = this.myMask; } else { if (inCat == 'mouth') { v2 = this.myMouth; } else { if (inCat == 'shirt') { v2 = this.myShirt; } } } } if (!inStore) { this.myRoster.addArmor(v2[v3]); } } if (v2 != undefined) { if (v3 != 2) { v2[v3].myOwner = undefined; } v2[v3] = undefined; } }; v2.giveItem = function (inItem, inSlot) { var v3; if (inItem.myCat == 'melee' || inItem.myCat == 'smg' || inItem.myCat == 'pistol' || inItem.myCat == 'revolver' || inItem.myCat == 'shotgun' || inItem.myCat == 'rifle' || inItem.myCat == 'heavy') { v3 = this.myWeapons; if (inSlot != 2) { this.myRoster.removeWeapon(inItem); } } else { if (inItem.myCat == 'shirt') { v3 = this.myShirt; } else { if (inItem.myCat == 'hat') { v3 = this.myHat; } else { if (inItem.myCat == 'mask') { v3 = this.myMask; } else { if (inItem.myCat == 'mouth') { v3 = this.myMouth; } } } } if (inSlot != 2) { this.myRoster.removeArmor(inItem); } } v3[inSlot] = inItem; if (inSlot != 2) { inItem.myOwner = this; } }; v2.assignCustom = function (inCat, inCurrent, inArray, inRatio) { if (SwainMath.randomNumber(1, inRatio) == 1) { var v2 = new Object(); v2.myType = inArray[SwainMath.randomNumber(0, inArray.length - 1)]; v2.myCat = inCat; v2.myOwner = this; this.equipItem(v2, 0); } else {} }; v2.randomizeCharacter = function (inVariety) { var v3 = ['myHealth', 'traitBravery', 'traitCover', 'traitDistracted', 'traitTriggerFinger', 'traitCombatSkill']; var v2 = 0; while (v2 < v3.length) { this[v3[v2]] *= SwainMath.randomNumber(-inVariety * 1000, inVariety * 1000) / 1000; ++v2; } this.myHealthMax = this.myHealth; }; v2.applyStats = function (inStr, inDex, inTac, inEnd, inLead, inAwr, SPACER, inMelee, inUnarmed, inPistol, inRevolver, inSMG, inShotgun, inRifle, inHeavy) { this.statSTR = inStr; this.statDEX = inDex; this.statEND = inEnd; this.statTAC = inTac; this.statAWR = inAwr; this.statLEAD = inLead; this.skillMelee = inMelee; this.skillUnarmed = inUnarmed; this.skillPistol = inPistol; this.skillRevolver = inRevolver; this.skillSMG = inSMG; this.skillShotgun = inShotgun; this.skillRifle = inRifle; this.skillHeavy = inHeavy; this.changeStats(); this.assignPerks(); }; v2.changeStats = function () { if (this.amSpecial && false) { this.statDEX = 1 + Math.floor(this.myLevel / 2); this.statSTR = 1 + Math.floor(this.myLevel / 2); this.statTAC = 1 + Math.floor(this.myLevel / 2); this.statEND = 1 + Math.floor(this.myLevel / 2); this.statLEAD = 1 + Math.floor(this.myLevel / 2); this.statAWR = 1 + Math.floor(this.myLevel / 2); } if (this.amSpecial) { this.mySpeed = 4.8; } else { this.mySpeed = 4.5; } this.modSpeed = 1 + this.statDEX / 45; this.modDmg = 1 + this.statSTR / 15; this.modRecharge = 1 + this.statTAC / 10; this.modArmor = 1 + this.statEND / 15; this.modAllySmart = 1 + this.statLEAD / 15; this.modHurtTactics = 1 + this.statAWR / 50; this.modRange = this.statAWR * 1.5; this.myHealth = 6 + Math.floor(this.myLevel); if (this.amSpecial) { this.myHealth += 10; } this.myHealthMax = this.myHealth; this.myTactics = 0; var v2 = 5; while (v2 <= this.myLevel) { this.myTactics += Math.floor(5 * (0.7 - this.myLevel / 100)); ++v2; } if (MadnessDataFile.havePerk('perkTacBar1', this)) { this.myTactics += 10; } if (MadnessDataFile.havePerk('perkTacBar2', this)) { this.myTactics += 10; } if (this.amSlow) { this.myTactics = 0; } this.myTacticsMax = this.myTactics; this.mySlowMoMax = 400; this.mySlowMo = 0; }; v2.assignPerks = function () { this.perkSidearm1 = false; this.perkKnockdown1 = false; this.perkBlockBreak = false; this.perkStunDash1 = false; this.perkKnockdown2 = false; this.perkStunDash2 = false; this.perkDodge1 = false; this.perkReload1 = false; this.perkDodge2 = false; this.perkBlock1 = false; this.perkDodge3 = false; this.perkBlock2 = false; this.perkLowAcc1 = false; this.perkCoverShoot = false; this.perkTacBar1 = false; this.perkLowAcc2 = false; this.perkLowAcc3 = false; this.perkTacBar2 = false; this.perkArmor1 = false; this.perkArmor2 = false; this.perkStunProof1 = false; this.perkArmor3 = false; this.perkStunProof2 = false; this.perkImmuneLowDmg = false; this.perkTeamBonus1 = false; this.perkFearMonger1 = false; this.perkTeamBonus2 = false; this.perkFearMonger2 = false; this.perkTeamBonus3 = false; this.perkFearMonger3 = false; this.perkHeadshotCrits = false; this.perkBulletTime1 = false; this.perkBulletTime2 = false; this.perkArmorPierce = false; this.perkBulletTime3 = false; this.perkBulletTime4 = false; this.perkPistolAccuracy1 = false; this.perkPistolReload = false; this.perkPistolROF1 = false; this.perkPistolEffectiveness = false; this.perkPistolAccuracy2 = false; this.perkPistolROF2 = false; this.perkSMGAim1 = false; this.perkSMGReload = false; this.perkSMGTacDamage = false; this.perkSMGRange = false; this.perkSMGAim2 = false; var v2 = false; this.perkRifleTacDamage = false; this.perkRifleRange1 = false; this.perkRifleAccuracy = false; this.perkRifleEffectiveness = false; this.perkRifleRange2 = false; this.perkRifleReload = false; this.perkShotgunDamage = false; this.perkShotgunROF1 = false; this.perkShotgunShots1 = false; this.perkShotgunROF2 = false; this.perkShotgunReload = false; this.perkShotgunShots2 = false; this.perkMeleeMoves1 = false; this.perkMeleePistolWhip = false; this.perkMeleeMoves2 = false; this.perkMeleeDisarm = false; this.perkMeleeMoves3 = false; this.perkMeleeMoves4 = false; this.perkUnarmedMoves1 = false; this.perkUnarmedSpeed1 = false; this.perkUnarmedMoves2 = false; this.perkUnarmedSpeed2 = false; this.perkUnarmedMoves3 = false; this.perkUnarmedSpeed3 = false; if (this.statSTR >= 5) { this.perkSidearm1 = true; } if (this.statSTR >= 10) { this.perkKnockdown1 = true; } if (this.statSTR >= 15) { this.perkBlockBreak = true; } if (this.statSTR >= 20) { this.perkStunDash1 = true; } if (this.statSTR >= 25) { this.perkKnockdown2 = true; } if (this.statSTR >= 30) { this.perkStunDash2 = true; } if (this.statDEX >= 5) { this.perkDodge1 = true; } if (this.statDEX >= 10) { this.perkReload1 = true; } if (this.statDEX >= 15) { this.perkDodge2 = true; } if (this.statDEX >= 20) { this.perkBlock1 = true; } if (this.statDEX >= 25) { this.perkDodge3 = true; } if (this.statDEX >= 30) { this.perkBlock2 = true; } if (this.statTAC >= 5) { this.perkLowAcc1 = true; } if (this.statTAC >= 10) { this.perkCoverShoot = true; } if (this.statTAC >= 15) { this.perkTacBar1 = true; } if (this.statTAC >= 20) { this.perkLowAcc2 = true; } if (this.statTAC >= 25) { this.perkTacBar2 = true; } if (this.statTAC >= 30) { this.perkLowAcc3 = true; } if (this.statEND >= 5) { this.perkArmor1 = true; } if (this.statEND >= 10) { this.perkArmor2 = true; } if (this.statEND >= 15) { this.perkStunProof1 = true; } if (this.statEND >= 20) { this.perkArmor3 = true; } if (this.statEND >= 25) { this.perkStunProof2 = true; } if (this.statEND >= 30) { this.perkImmuneLowDmg = true; } if (this.statLEAD >= 5) { this.perkTeamBonus1 = true; } if (this.statLEAD >= 10) { this.perkFearMonger1 = true; } if (this.statLEAD >= 15) { this.perkTeamBonus2 = true; } if (this.statLEAD >= 20) { this.perkFearMonger2 = true; } if (this.statLEAD >= 25) { this.perkTeamBonus3 = true; } if (this.statLEAD >= 30) { this.perkFearMonger3 = true; } if (this.statAWR >= 5) { this.perkHeadshotCrits = true; } if (this.statAWR >= 10) { this.perkBulletTime1 = true; } if (this.statAWR >= 15) { this.perkBulletTime2 = true; } if (this.statAWR >= 20) { this.perkArmorPierce = true; } if (this.statAWR >= 25) { this.perkBulletTime3 = true; } if (this.statAWR >= 30) { this.perkBulletTime4 = true; } if (this.skillPistol >= 5) { this.perkPistolAccuracy1 = true; } if (this.skillPistol >= 10) { this.perkPistolReload = true; } if (this.skillPistol >= 15) { this.perkPistolROF1 = true; } if (this.skillPistol >= 20) { this.perkPistolEffectiveness = true; } if (this.skillPistol >= 25) { this.perkPistolAccuracy2 = true; } if (this.skillPistol >= 30) { this.perkPistolROF2 = true; } if (this.skillSMG >= 5) { this.perkSMGAim1 = true; } if (this.skillSMG >= 10) { this.perkSMGReload = true; } if (this.skillSMG >= 15) { this.perkSMGTacDamage = true; } if (this.skillSMG >= 20) { this.perkSMGRange = true; } if (this.skillSMG >= 25) { this.perkSMGAim2 = true; } if (this.skillSMG >= 30) { v2 = true; } if (this.skillRifle >= 5) { this.perkRifleTacDamage = true; } if (this.skillRifle >= 10) { this.perkRifleRange1 = true; } if (this.skillRifle >= 15) { this.perkRifleAccuracy = true; } if (this.skillRifle >= 20) { this.perkRifleEffectiveness = true; } if (this.skillRifle >= 25) { this.perkRifleRange2 = true; } if (this.skillRifle >= 30) { this.perkRifleReload = true; } if (this.skillShotgun >= 5) { this.perkShotgunDamage = true; } if (this.skillShotgun >= 10) { this.perkShotgunROF1 = true; } if (this.skillShotgun >= 15) { this.perkShotgunShots1 = true; } if (this.skillShotgun >= 20) { this.perkShotgunROF2 = true; } if (this.skillShotgun >= 25) { this.perkShotgunReload = true; } if (this.skillShotgun >= 30) { this.perkShotgunShots2 = true; } if (this.skillMelee >= 5) { this.perkMeleeMoves1 = true; } if (this.skillMelee >= 10) { this.perkMeleePistolWhip = true; } if (this.skillMelee >= 15) { this.perkMeleeMoves2 = true; } if (this.skillMelee >= 20) { this.perkMeleeDisarm = true; } if (this.skillMelee >= 25) { this.perkMeleeMoves3 = true; } if (this.skillMelee >= 30) { this.perkMeleeMoves4 = true; } if (this.skillUnarmed >= 5) { this.perkUnarmedMoves1 = true; } if (this.skillUnarmed >= 10) { this.perkUnarmedSpeed1 = true; } if (this.skillUnarmed >= 15) { this.perkUnarmedMoves2 = true; } if (this.skillUnarmed >= 20) { this.perkUnarmedSpeed2 = true; } if (this.skillUnarmed >= 25) { this.perkUnarmedMoves3 = true; } if (this.skillUnarmed >= 30) { this.perkUnarmedSpeed3 = true; } }; v2.healMe = function () { this.myHealth = this.myHealthMax; this.myTactics = this.myTacticsMax; var v3 = 3; var v2 = 0; while (v2 < this.headWounds.length) { if (this.headWounds[v2].myType != 'stitch' && SwainMath.randomNumber(1, v3) == 1 || this.headWounds[v2].myAge >= 2) { this.headWounds.splice(v2, 1); --v2; } else { if (this.headWounds[v2].myType.substr(0, 5) != 'punch' && this.headWounds[v2].myType != 'stitch') { this.headWounds[v2].myType = 'stitch'; this.headWounds[v2].myVariant = SwainMath.randomNumber(1, 6); } } ++v2; } v2 = 0; while (v2 < this.bodyWounds.length) { if (this.bodyWounds[v2].myType != 'stitch' && SwainMath.randomNumber(1, v3) == 1 || this.bodyWounds[v2].myAge >= 2) { this.bodyWounds.splice(v2, 1); --v2; } else { if (this.bodyWounds[v2].myType.substr(0, 5) != 'punch' && this.bodyWounds[v2].myType != 'stitch') { this.bodyWounds[v2].myType = 'stitch'; this.bodyWounds[v2].myVariant = SwainMath.randomNumber(1, 6); } } ++v2; } this.bodySpray = 0; this.headSpray = 0; v2 = 0; while (v2 < 2) { this.myWeapons[v2].myClips = 2; this.myWeapons[v2].myAmmo = this.myWeapons[v2].myAmmoMax; this.myWeapons[v2].myHealth = this.myWeapons[v2].myHealthMax; ++v2; } this.myWeapon = 0; }; v2.removeScars = function () { this.headWounds = new Array(); this.bodyWounds = new Array(); }; v1.applyPerkDescription = function (inStat, inNum, inTextName, inTextDescription, inChar) { var v3; var v2; if (inStat == 'STR') { if (inNum == 0) { v3 = 'Stat: Strength'; v2 = ' A measure of your raw strength.'; } else { if (inNum == 5) { v3 = 'Perk: Sidearm'; v2 = ' Carry a second weapon.'; } else { if (inNum == 10) { v3 = 'Perk: Knockdown 1'; v2 = ' Your blunt melee and unarmed attacks have a greater chance of knocking down enemies.'; } else { if (inNum == 15) { v3 = 'Perk: Block Breaker'; v2 = ' Your Melee and Unarmed attacks are unblockable (but may still be parried).'; } else { if (inNum == 20) { v3 = 'Perk: Stun-Dash 1'; v2 = ' Your dash attacks stun opponents.'; } else { if (inNum == 25) { v3 = 'Perk: Knockdown 2'; v2 = ' Your blunt melee and unarmed attacks have a greater chance of knocking down enemies.'; } else { if (inNum == 30) { v3 = 'Perk: Stun-Dash 2'; v2 = ' Your dash attacks knock over opponents.'; } else { v3 = 'Strength ' + inNum; v2 = 'Melee/Unarmed damage + ' + String(Math.floor(inNum * 100 / 1.5) / 100) + '%'; } } } } } } } } if (inStat == 'DEX') { if (inNum == 0) { v3 = 'Stat: Dexterity'; v2 = ' Your speed and agility.'; } else { if (inNum == 5) { v3 = 'Perk: Dodge 1'; v2 = ' When taking a Tac-Bar hit, you will automatically evade the shot, decreasing further damage (Enabled at Level 5).'; } else { if (inNum == 10) { v3 = 'Perk: Fast-Load'; v2 = ' Swap weapons more quickly.'; } else { if (inNum == 15) { v3 = 'Perk: Dodge 2'; v2 = ' Perform an active sliding dodge with increased skill.'; } else { if (inNum == 20) { v3 = 'Perk: Bullet Block'; v2 = ' Your Melee block will stop bullets at minor Tactics loss.'; } else { if (inNum == 25) { v3 = 'Perk: Dodge 3'; v2 = ' Perform an active flipping dodge with ninja-like skill.'; } else { if (inNum == 30) { v3 = 'Perk: Bullet Deflect'; v2 = ' Your Melee weapon will deflect bullets back at opponents.'; } else { v3 = 'Dexterity ' + inNum; v2 = 'Move speed + ' + String(Math.floor(inNum * 100 / 2) / 100) + '%'; } } } } } } } } if (inStat == 'TAC') { if (inNum == 0) { v3 = 'Stat: Tactics'; v2 = ' Battle savy and your tactical integrity while under fire.'; } else { if (inNum == 5) { v3 = 'Perk: Evade 1'; v2 = ' Take half Tac-Bar damage from low-accuracy shots.'; } else { if (inNum == 10) { v3 = 'Perk: Cover Fire'; v2 = ' Take half Tac-Bar damage when hit while firing from cover.'; } else { if (inNum == 15) { v3 = 'Perk: Tac-Bar 1'; v2 = ' Boost to your Tac-Bar.'; } else { if (inNum == 20) { v3 = 'Perk: Evade 2'; v2 = ' Take half Tac-Bar damage from Melee and Unarmed attacks.'; } else { if (inNum == 25) { v3 = 'Perk: Tac-Bar 2'; v2 = ' Bigger boost to your Tac-Bar.'; } else { if (inNum == 30) { v3 = 'Perk: Evade 3'; v2 = ' Take no Tac-Bar damage from low-accuracy shots.'; } else { v3 = 'Tactics ' + inNum; v2 = 'Tac-Bar Recharge + ' + String(Math.floor(inNum * 100 / 1) / 100) + '%'; } } } } } } } } if (inStat == 'END') { if (inNum == 0) { v3 = 'Stat: Endurance'; v2 = ' The ability to withstand damage of all kinds and to lift heavy armor.'; } else { if (inNum == 5) { v3 = 'Perk: Armor 1'; v2 = ' You may wear light-class armor.'; } else { if (inNum == 10) { v3 = 'Perk: Armor 2'; v2 = ' You may wear medium-class armor.'; } else { if (inNum == 15) { v3 = 'Perk: Stun-Proof 1'; v2 = ' Low- to Mid-damage attacks no longer cause you to be stunned.'; } else { if (inNum == 20) { v3 = 'Perk: Armor 3'; v2 = ' You may wear heavy-class armor.'; } else { if (inNum == 25) { v3 = 'Perk: Stun-Proof 2'; v2 = ' You are not stunned by any form of damage.'; } else { if (inNum == 30) { v3 = 'Perk: Immunity'; v2 = ' Low-damage shots inflict next to no damage to you.'; } else { v3 = 'Endurance ' + inNum; v2 = 'Damage Reduction + ' + String(Math.floor(inNum * 100 / 1.5) / 100) + '%'; } } } } } } } } if (inStat == 'LEAD') { if (inNum == 0) { v3 = 'Stat: Leadership'; v2 = ' The level of skill and morale your teammates will exhibit in combat, and the fear you inspire in enemies.'; } else { if (inNum == 5) { v3 = 'Perk: Team Bonus 1'; v2 = ' Small increase to morale and decision-making skill of allies. Plus one squadmate.'; } else { if (inNum == 10) { v3 = 'Perk: Fearmonger 1'; v2 = ' Small decrease to the morale and reaction-time of opponents. Plus one squadmate.'; } else { if (inNum == 15) { v3 = 'Perk: Team Bonus 2'; v2 = ' Medium increase to morale and decision-making skill of allies. Plus one squadmate.'; } else { if (inNum == 20) { v3 = 'Perk: Fearmonger 2'; v2 = ' Medium decrease to the morale and reaction-time of opponents. Plus one squadmate.'; } else { if (inNum == 25) { v3 = 'Perk: Team Bonus 3'; v2 = ' Large increase to morale and decision-making skill of allies. Plus one squadmate.'; } else { if (inNum == 30) { v3 = 'Perk: Fearmonger 3'; v2 = ' Large decrease to the morale and reaction-time of opponents. Plus one squadmate.'; } else { v3 = 'Leadership ' + inNum; v2 = 'Ally reaction-time - ' + String(Math.floor(inNum * 100 / 1.5) / 100) + '%'; } } } } } } } } if (inStat == 'AWR') { if (inNum == 0) { v3 = 'Stat: Awareness'; v2 = ' Your time-sense and ability to perceive the weaknesses of opponents.'; } else { if (inNum == 5) { v3 = 'Perk: Headshots'; v2 = ' Headshots deal increased damage.'; } else { if (inNum == 10) { v3 = 'Perk: Bullet-Time 1'; v2 = ' Retain full movement speed during Bullet-Time.'; } else { if (inNum == 15) { v3 = 'Perk: Bullet-Time 2'; v2 = ' Retain full Melee and Unarmed attack speed during Bullet-Time.'; } else { if (inNum == 20) { v3 = 'Perk: Armor-Piercing'; v2 = ' Close-range attacks ignore the enemy\'s medium or light armor.'; } else { if (inNum == 25) { v3 = 'Perk: Bullet-Time 3'; v2 = ' Retain full ranged attack speed during Bullet-Time.'; } else { if (inNum == 30) { v3 = 'Perk: Bullet-Time 4'; v2 = ' Increased movement speed during Bullet-Time.'; } else { v3 = 'Awareness ' + inNum; v2 = 'Tac-Bar damage + ' + String(Math.floor(inNum * 100 / 5) / 100) + '%'; } } } } } } } } if (inStat == 'Pistol') { if (inNum == 0) { v3 = 'Skill: Pistols'; v2 = ' Ability to wield small, single-handed ranged weapons.'; } else { if (inNum == 5) { v3 = 'Perk: Pistol Accuracy 1'; v2 = ' Tighten up the accuracy of pistol shots when standing still.'; } else { if (inNum == 10) { v3 = 'Perk: Pistol Reload'; v2 = ' Doubletime your pistol reload.'; } else { if (inNum == 15) { v3 = 'Perk: Pistol ROF 1'; v2 = ' Increased rate of fire with pistols.'; } else { if (inNum == 20) { v3 = 'Perk: Pistol Effectiveness'; v2 = ' Pistols hit more often outside their effective range.'; } else { if (inNum == 25) { v3 = 'Perk: Pistol Accuracy 2'; v2 = ' Further increase the accuracy of pistol shots when standing still.'; } else { if (inNum == 30) { v3 = 'Perk: Pistol ROF 2'; v2 = ' Even better rate of fire with pistols.'; } else { v3 = ' Pistols ' + inNum; v2 = 'Increase ' + inNum; } } } } } } } } if (inStat == 'SMG') { if (inNum == 0) { v3 = 'Skill: SMGs'; v2 = ' Ability to wield small, two-handed ranged weapons.'; } else { if (inNum == 5) { v3 = 'Perk: SMG Aim 1'; v2 = ' Increased accuracy the longer you hold down the trigger of your SMG.'; } else { if (inNum == 10) { v3 = 'Perk: SMG Reload'; v2 = ' Doubletime your SMG reload.'; } else { if (inNum == 15) { v3 = 'Perk: SMG Tac Damage'; v2 = ' Increased SMG damage on Tac-Bar hits versus stationary targets.'; } else { if (inNum == 20) { v3 = 'Perk: SMG Range'; v2 = ' Increase the effective range of SMGs.'; } else { if (inNum == 25) { v3 = 'Perk: SMG Aim 2'; v2 = ' Even greater accuracy the longer you hold down the trigger of your SMG.'; } else { if (inNum == 30) { v3 = 'Perk: SMG ROF'; v2 = ' Increased rate of fire with SMGs.'; } else { v3 = ' SMGs ' + inNum; v2 = 'Increase ' + inNum; } } } } } } } } if (inStat == 'Rifle') { if (inNum == 0) { v3 = 'Skill: Rifles'; v2 = ' Ability to wield large, two-handed ranged weapons.'; } else { if (inNum == 5) { v3 = 'Perk: Rifle Tac Damage'; v2 = ' Increased rifle damage on Tac-Bar hits versus stationary targets.'; } else { if (inNum == 10) { v3 = 'Perk: Rifle Range 1'; v2 = ' Increase the effective range of rifles.'; } else { if (inNum == 15) { v3 = 'Perk: Rifle Accuracy'; v2 = ' Tighten up the accuracy of rifle shots when standing still.'; } else { if (inNum == 20) { v3 = 'Perk: Rifle Effectiveness'; v2 = ' Rifles hit more often outside their effective range.'; } else { if (inNum == 25) { v3 = 'Perk: Rifle Range 2'; v2 = ' Increase the effective range of rifles.'; } else { if (inNum == 30) { v3 = 'Perk: Rifle Reload'; v2 = ' Doubletime your rifle reload.'; } else { v3 = ' Rifles ' + inNum; v2 = 'Increase ' + inNum; } } } } } } } } if (inStat == 'Shotgun') { if (inNum == 0) { v3 = 'Skill: Shotguns'; v2 = ' Ability to wield large, two-handed scatter weapons.'; } else { if (inNum == 5) { v3 = 'Perk: Shotgun Damage'; v2 = ' Increase damage of point-blank shotgun blasts.'; } else { if (inNum == 10) { v3 = 'Perk: Shotgun ROF 1'; v2 = ' Increased rate of fire with pump shotguns.'; } else { if (inNum == 15) { v3 = 'Perk: Shot Increase 1'; v2 = ' Each blast of your shotgun fires an additional pellet.'; } else { if (inNum == 20) { v3 = 'Perk: Shotgun ROF 2'; v2 = ' Even better rate of fire with pump shotguns.'; } else { if (inNum == 25) { v3 = 'Perk: Shotgun Reload'; v2 = ' Doubletime your shotgun reload.'; } else { if (inNum == 30) { v3 = 'Perk: Shot Increase 2'; v2 = ' Each blast of your shotgun fires two additional pellets.'; } else { v3 = ' Shotguns ' + inNum; v2 = 'Increase ' + inNum; } } } } } } } } if (inStat == 'Melee') { if (inNum == 0) { v3 = 'Skill: Melee'; v2 = ' Ability to wield melee weapons at close range, or thrown.'; } else { if (inNum == 5) { v3 = 'Perk: Beginner Combos'; v2 = ' Launch three basic melee attacks in quick succession.'; } else { if (inNum == 10) { v3 = 'Perk: Pistol Whip'; v2 = ' Use your ranged weapon as a slugging instrument at close range.'; } else { if (inNum == 15) { v3 = 'Perk: Advanced Combos'; v2 = ' Your three-hit combos feature more advanced moves.'; } else { if (inNum == 20) { v3 = 'Perk: Disarm'; v2 = ' Timed blocking of an opponent\'s melee attack will disarm their weapon.'; } else { if (inNum == 25) { v3 = 'Perk: Expert Combos'; v2 = ' Combos no longer include low-level attacks, and have a vastly improved cooldown time.'; } else { if (inNum == 30) { v3 = 'Perk: Master Combos'; v2 = ' Your three-hit combos end with a devastating finisher attack.'; } else { v3 = ' Melee ' + inNum; v2 = 'Increase ' + inNum; } } } } } } } } if (inStat == 'Unarmed') { if (inNum == 0) { v3 = 'Skill: Unarmed'; v2 = ' Ability to wield one\'s fists as weapons.'; } else { if (inNum == 5) { v3 = 'Perk: Basic Pugilist'; v2 = ' Throw quality punches.'; } else { if (inNum == 10) { v3 = 'Perk: Pummel 1'; v2 = ' Decrease the cooldown of your punches slightly.'; } else { if (inNum == 15) { v3 = 'Perk: Advanced Pugilist'; v2 = ' Turn your fists into lethal weapons with some new moves.'; } else { if (inNum == 20) { v3 = 'Perk: Pummel 2'; v2 = ' Decrease the cooldown of your punches moderately.'; } else { if (inNum == 25) { v3 = 'Perk: Expert Pugilist'; v2 = ' Unleash devastating martial arts moves.'; } else { if (inNum == 30) { v3 = 'Perk: Pummel 3'; v2 = ' Increase the actual speed of all unarmed attacks.'; } else { v3 = ' Unarmed ' + inNum; v2 = 'Increase ' + inNum; } } } } } } } } if (inChar['stat' + inStat] != undefined && inChar['stat' + inStat] >= inNum || inChar['skill' + inStat] != undefined && inChar['skill' + inStat] >= inNum) { inTextName.textColor = 65280; } else { inTextName.textColor = 16711680; } inTextName.text = v3; inTextDescription.text = v2; }; v2.buyStat = function (inStat, inCat) { if (this[inCat + 'Points'] > 0) { ++this[inCat + inStat]; --this[inCat + 'Points']; this.changeStats(); this.assignPerks(); } }; v2.copyCharacter = function (inChar) { for (var v3 in inChar) { this[v3] = inChar[v3]; } }; v1.havePerk = function (inPerk, inChar) { return inChar[inPerk]; }; v1.getLevelUpXP = function (inLevel, inXP) { return 100 * inLevel - 0.5 * (inLevel - 0) * 100; }; v2.applyXP = function (inXP) { this.myXP += inXP; if (this.myXP >= MadnessDataFile.getLevelUpXP(this.myLevel)) { ++this.myLevel; this.statPoints += 3; this.skillPoints += 3; this.myXP -= MadnessDataFile.getLevelUpXP(this.myLevel); this.changeStats(); } }; v2.autoApplyPoints = function () { var v3 = ['Unarmed', 'Melee', 'Pistol', 'SMG', 'Rifle', 'Shotgun']; var v2; while (this.skillPoints > 0) { v2 = v3[SwainMath.randomNumber(0, v3.length - 1)]; if (this['skill' + v2] < this.statCap) { this.buyStat(v2, 'skill'); } } v3 = ['STR', 'DEX', 'TAC', 'END', 'LEAD', 'AWR']; while (this.statPoints > 0) { v2 = v3[SwainMath.randomNumber(0, v3.length - 1)]; if (this['stat' + v2] < this.statCap) { this.buyStat(v2, 'stat'); } } }; v2.randomStats = function (inLvl) { inLvl -= SwainMath.randomNumber(0, 5); if (inLvl < 1) { inLvl = 1; } if (inLvl > 25) { inLvl = 25; } this.myLevel = inLvl; this.applyHireCost(inLvl); this.skillPoints += this.myLevel * 3; this.statPoints += this.myLevel * 3; this.autoApplyPoints(); this.traitBravery = SwainMath.randomNumber(1, 10); this.traitDistracted = SwainMath.randomNumber(1, 10); this.traitTriggerFinger = SwainMath.randomNumber(1, 10); this.traitCover = SwainMath.randomNumber(1, 10); this.traitCombatSkill = this.myLevel / 3 + SwainMath.randomNumber(0, 5); if (this.traitCombatSkill > 10) { this.traitCombatSkill = 10; } }; v2.applyHireCost = function (inLvl) { this.myHireCost = inLvl * 200 * (SwainMath.randomNumber(950, 1100) / 1050); return this.myHireCost; }; v1.findHighestSkill = function (inChar) { var v2 = ['Unarmed', 'Melee', 'Pistol', 'SMG', 'Rifle', 'Shotgun']; var v3 = new Number(); var v5; var v1 = 0; while (v1 < v2.length) { if (inChar['skill' + v2[v1]] > v3) { v3 = inChar['skill' + v2[v1]]; v5 = v2[v1]; } ++v1; } return v5; }; v2.mixStats = function () { var v2 = ['Unarmed', 'Melee', 'Pistol', 'SMG', 'Rifle', 'Shotgun']; var v4; var v3 = 0; while (v3 < v2.length) { this['skill' + v2[v3]] += SwainMath.randomNumber(-3, 3); if (this['skill' + v2[v3]] > this.statCap) { this['skill' + v2[v3]] = this.statCap; } if (this['skill' + v2[v3]] < 0) { this['skill' + v2[v3]] = 0; } ++v3; } v2 = ['STR', 'DEX', 'TAC', 'END', 'LEAD', 'AWR']; v3 = 0; while (v3 < v2.length) { this['stat' + v2[v3]] += SwainMath.randomNumber(-3, 3); if (this['stat' + v2[v3]] > this.statCap) { this['stat' + v2[v3]] = this.statCap; } if (this['stat' + v2[v3]] < 0) { this['stat' + v2[v3]] = 0; } ++v3; } }; v2.myEcho = function () { trace('Here I am - ' + this.myName); }; v2.myBossPhase = new Number(); v2.amSpecial = false; v2.headSpray = 0; v2.bodySpray = 0; v2.amSurprised = true; v2.myObjective = undefined; v2.objectiveRequired = undefined; v2.objectiveHidden = undefined; v2.myIconPos = new Number(); v2.skillCap = 30; v2.statCap = 30; v2.myXP = new Number(); v2.statPoints = 0; v2.skillPoints = 0; v2.myHireCost = new Number(); v2.myWaves = new Number(); v2.myKills = new Number(); v2.myWeapons = new Array(); v2.myWeapon = new Number(); v2.weaponArray = new Array(); v2.myHat = new Array(); v2.myMouth = new Array(); v2.myMask = new Array(); v2.myShirt = new Array(); v2.lifeStatus = 'active'; v2.saveAsActive = false; v2.saveAsLeader = false; v2.arenaLockArmor = false; v2.perkSidearm1 = false; v2.perkKnockdown1 = false; v2.perkBlockBreak = false; v2.perkStunDash1 = false; v2.perkKnockdown2 = false; v2.perkStunDash2 = false; v2.perkDodge1 = false; v2.perkReload1 = false; v2.perkDodge2 = false; v2.perkBlock1 = false; v2.perkDodge3 = false; v2.perkBlock2 = false; v2.perkLowAcc1 = false; v2.perkCoverShoot = false; v2.perkTacBar1 = false; v2.perkLowAcc2 = false; v2.perkLowAcc3 = false; v2.perkTacBar2 = false; v2.perkArmor1 = false; v2.perkArmor2 = false; v2.perkStunProof1 = false; v2.perkArmor3 = false; v2.perkStunProof2 = false; v2.perkImmuneLowDmg = false; v2.perkTeamBonus1 = false; v2.perkFearMonger1 = false; v2.perkTeamBonus2 = false; v2.perkFearMonger2 = false; v2.perkTeamBonus3 = false; v2.perkFearMonger3 = false; v2.perkHeadshotCrits = false; v2.perkBulletTime1 = false; v2.perkBulletTime2 = false; v2.perkArmorPierce = false; v2.perkBulletTime3 = false; v2.perkBulletTime4 = false; v2.perkPistolAccuracy1 = false; v2.perkPistolReload = false; v2.perkPistolROF1 = false; v2.perkPistolEffectiveness = false; v2.perkPistolAccuracy2 = false; v2.perkPistolROF2 = false; v2.perkSMGAim1 = false; v2.perkSMGReload = false; v2.perkSMGTacDamage = false; v2.perkSMGRange = false; v2.perkSMGAim2 = false; v2.perkSMGROF = false; v2.perkRifleTacDamage = false; v2.perkRifleRange1 = false; v2.perkRifleAccuracy = false; v2.perkRifleEffectiveness = false; v2.perkRifleRange2 = false; v2.perkRifleReload = false; v2.perkShotgunDamage = false; v2.perkShotgunROF1 = false; v2.perkShotgunShots1 = false; v2.perkShotgunROF2 = false; v2.perkShotgunReload = false; v2.perkShotgunShots2 = false; v2.perkMeleeMoves1 = false; v2.perkMeleePistolWhip = false; v2.perkMeleeMoves2 = false; v2.perkMeleeDisarm = false; v2.perkMeleeMoves3 = false; v2.perkMeleeMoves4 = false; v2.perkUnarmedMoves1 = false; v2.perkUnarmedSpeed1 = false; v2.perkUnarmedMoves2 = false; v2.perkUnarmedSpeed2 = false; v2.perkUnarmedMoves3 = false; v2.perkUnarmedSpeed3 = false; ASSetPropFlags(_global.MadnessDataFile.prototype, null, 1); } #endinitclip } movieClip 4811 __Packages.MadnessCharacter { #initclip if (!_global.MadnessCharacter) { var v1 = function () { super(); this.targetsHit = new Array(); this.targetsTac = new Array(); this.myLockList = new Array(); this.onEnterFrame = this.tick; }; _global.MadnessCharacter = v1; _global.MadnessCharacter extends MovieClip; var v2 = v1.prototype; v2.init = function (inRef, inRosterRef, inFaction, inPlayer, inRoster, myDoor, myStartX, myStartY) { this.myDataRef = inRef; this.myDataRef.mySprite = this; this.myRoster = inRosterRef; this.myFaction = inFaction; this.amPlayer = inPlayer; if (this.amPlayer) { this.onMouseDown = this.mouseDown; this.onMouseUp = this.mouseUp; } if (inFaction != 'player') { this.myMission = 'follow'; } else { this.myMission = 'follow'; if (MadnessGameSelect.gameMode == 'arena') { this.myMission = 'engage'; } } this.myLeader = this.myRoster.teamLeader.mySprite; this._x = myStartX; this._y = myStartY; if (this.myDataRef.loggedX != undefined) { this._x = this.myDataRef.loggedX; } if (this.myDataRef.loggedY != undefined) { this._y = this.myDataRef.loggedY; } this.refreshStats(); if (myDoor.myDir == 'right' || myDoor.myDir == 'left') { this.myFacing = myDoor.myDir; } else { if (SwainMath.randomNumber(0, 1) == 0) { this.myFacing = 'right'; } else { this.myFacing = 'left'; } } if (this.myFacing == 'right') { this.myAimX = this._x + 50; this.mySpeedRight = this.mySpeed; } else { this.myFacing = 'left'; this.myAimX = this._x - 50; this.mySpeedRight = -this.mySpeed; this._xscale = -100; } this.myAimY = this._y - 50; this.rofTimer = 9999; this.myWeapon = this.myDataRef.myWeapon; this.myRoom = this._parent.determineRoom(this._x, this._y); this._alpha = 100; this.myTacBar._alpha = 0; this.tacTimer = this.tacRerchargeDelay; if (this.myHealth <= 0 && this.myDataRef.noPaint) { this.myStatus = this.myDataRef.lastStatus; this.mySubStatus = this.myDataRef.lastSubStatus; this.myFacing = this.myDataRef.lastFacing; this.gotoAndStop(this.myStatus + this.mySubStatus); this.mySprite.onEnterFrame = this.amDead; this.cacheAsBitmap = true; this.mySprite.gotoAndStop(this.mySprite._totalframes); this.killMe(); } this.headSpray = this.myDataRef.headSpray; this.bodySpray = this.myDataRef.bodySpray; if (!this.amPlayer) { } this.myStatus = 'run'; this.gotoAndStop('run'); MadnessCharacter.adjustSprite(this); this._xscale = MadnessCharacter.setPerspectiveScale(this._x, this._y, this.myRoom); this._xscale *= this.myDataRef.myScale; this._yscale = this._xscale; MadnessCharacter.setMyDepth(this, this._yscale); if (this.myDataRef.myBoss != '') { MadnessEvents.bossEvents(this, 'start'); } if (this.myRoster == MadnessRoster.playerRoster || this.myDataRef.myBoss != '') { this.myDataRef.amSurprised = false; } this.myPulseNumber = SwainMath.randomNumber(1, 30); }; v2.pauseTick = function () { this.mySprite.stop(); if (!this._parent.paused) { this.onEnterFrame = this.tick; } }; v2.tick = function () { if (this._parent.paused) { this.onEnterFrame = this.pauseTick; } if (this.myRoom == -1) { trace('ERROR! Character without room!'); trace('ERROR! Character without room!'); trace('ERROR! Character without room!'); trace('ERROR! Character without room!'); } if (this.amPlayer && this.inputAllowed()) { this.playerControls(); } else { if (!MadnessTransition.transitionLock && this.inputAllowed()) { MadnessAI.setActions(this); } } if (this._alpha < 100) { this._alpha += 20; } ++this.lifeSpan; if (this.freakOutTimer > 0) { --this.freakOutTimer; } this.determineGameSpeed(); if (this.doorLock) { this.doorLockBoost = 1.3; } else { this.doorLockBoost = 1; } if (this.emptyClipTimer > 0 && this.amPlayer) { this.emptyClipTimer -= 1 + this.myGameSpeed; } if (this.mouseTimer > -1 && this.mouseTimer <= this.mouseTime2x) { ++this.mouseTimer; } else { this.mouseTimer = -1; if (!this.mouseHold) { this.mouse2x = false; } } if (this.mouseTimer > 0 || this.mouseTimer == -1) { this.mouseClick = false; } ++this.mouseReleaseTimer; MadnessEvents.bossEvents(this, 'tick'); this.breakdownAutoMove(); this.breakdownStatusActions(); this.breakdownAttack(); if (this.myHealth <= 0) { this.tacTimer = 0; this.myTactics = 0; } if (this.tacTimer == 0 && this.myStatus == 'idle' && MadnessDataFile.havePerk('perkDodge1', this.myDataRef) && !this.targetLock) { this.myStatus = 'tactics'; } if (!this.amDodging && !this.blocking) { if (this.tacTimer < this.tacRerchargeDelay - Math.floor(10 * this.myTacMod)) { this.tacTimer += 1 + this.myGameSpeed; if (this.myHealth > 0 && this.myTactics > 0) { this.tacDisplayTimer = 20; } } else { this.myTactics += (1 + this.myGameSpeed) * 0.05 * this.myTacMod; if (this.myTactics > this.myTacticsMax) { this.myTactics = this.myTacticsMax; } } } if (this.myTacticsMax > 0) { var v2 = 1; while (v2 <= 4) { if (this.myTactics > this.myTacticsMax - (this.myTacticsMax / 4) * v2) { this.myTacBar['dot' + String(v2)].gotoAndStop(2); } else { this.myTacBar['dot' + String(v2)].gotoAndStop(1); } ++v2; } } else { this.myTacBar._visible = false; } if (this.tacDisplayTimer > 0) { if (this.myTactics < this.myTacticsMax && this.myHealth > 0 && this.myTactics > 0) { this.tacDisplayTimer -= 0.5; } else { this.tacDisplayTimer -= 1; } } if ((this.myHealth <= 0 || this.myTactics == 0) && this.tacDisplayTimer > 10) { this.tacDisplayTimer = 10; } if (Math.abs(this.tacDisplayTimer) < 10) { this.myTacBar._alpha = Math.abs(this.tacDisplayTimer) * 10; } else { this.myTacBar._alpha = 100; } if (this.slowMoActive) { this.myDataRef.mySlowMo -= 1; if (this.myDataRef.mySlowMo <= 0) { this.myDataRef.mySlowMo = 0; this.slowMoActive = false; } } else { if (this.myDataRef.mySlowMo > this.myDataRef.mySlowMoMax) { this.myDataRef.mySlowMo = this.myDataRef.mySlowMoMax; } } this._x += this.mySpeedRight * this.slowmoSpeedMod * this.doorLockBoost; this._y += this.mySpeedDown * this.slowmoSpeedMod * this.doorLockBoost; this.hittingObstacle = false; if (this.myStatus != 'cover') { var v2 = 0; while (v2 < MadnessObstacle.allObstacles.length) { if (!MadnessObstacle.allObstacles[v2].myDataRef.noClip) { if (this._x < MadnessObstacle.allObstacles[v2]._x + MadnessObstacle.allObstacles[v2].myWidth / 2 + this.myWidth / 2 && this._x > MadnessObstacle.allObstacles[v2]._x - MadnessObstacle.allObstacles[v2].myWidth / 2 - this.myWidth / 2 && this._y < MadnessObstacle.allObstacles[v2]._y + MadnessObstacle.allObstacles[v2].myDepth / 2 && this._y > MadnessObstacle.allObstacles[v2]._y - MadnessObstacle.allObstacles[v2].myDepth / 2) { this.hittingObstacle = true; if (this._x - this.mySpeedRight * this.slowmoSpeedMod * this.doorLockBoost <= MadnessObstacle.allObstacles[v2]._x - MadnessObstacle.allObstacles[v2].myWidth / 2 - this.myWidth / 2 || this._x - this.mySpeedRight * this.slowmoSpeedMod * this.doorLockBoost >= MadnessObstacle.allObstacles[v2]._x + MadnessObstacle.allObstacles[v2].myWidth / 2 + this.myWidth / 2) { if (this._x - this.mySpeedRight * this.slowmoSpeedMod * this.doorLockBoost < MadnessObstacle.allObstacles[v2]._x) { this._x = MadnessObstacle.allObstacles[v2]._x - MadnessObstacle.allObstacles[v2].myWidth / 2 - this.myWidth / 2 - 1; } else { this._x = MadnessObstacle.allObstacles[v2]._x + MadnessObstacle.allObstacles[v2].myWidth / 2 + this.myWidth / 2 + 1; } } if (this._y - this.mySpeedDown * this.slowmoSpeedMod * this.doorLockBoost <= MadnessObstacle.allObstacles[v2]._y - MadnessObstacle.allObstacles[v2].myDepth / 2 || this._y - this.mySpeedDown * this.slowmoSpeedMod * this.doorLockBoost >= MadnessObstacle.allObstacles[v2]._y + MadnessObstacle.allObstacles[v2].myDepth / 2) { if (this._y - this.mySpeedDown * this.slowmoSpeedMod * this.doorLockBoost < MadnessObstacle.allObstacles[v2]._y) { this._y = MadnessObstacle.allObstacles[v2]._y - MadnessObstacle.allObstacles[v2].myDepth / 2 - 1; } else { this._y = MadnessObstacle.allObstacles[v2]._y + MadnessObstacle.allObstacles[v2].myDepth / 2 + 1; } } if (this.intendedTarget == this.targetPickup && this.intendedTarget != undefined && this.targetLock) { this.initiatePickup(); } if (this.moveRight || this.moveLeft) { if (this._x == MadnessObstacle.allObstacles[v2]._x + MadnessObstacle.allObstacles[v2].myWidth / 2 + this.myWidth / 2 + 1 || this._x == MadnessObstacle.allObstacles[v2]._x - MadnessObstacle.allObstacles[v2].myWidth / 2 - this.myWidth / 2 - 1) { this._y += 4 * this.slowmoSpeedMod * this.doorLockBoost; this.mySpeedDown += 0.1; } } if (!this.amPlayer) { if (this.moveUp || this.moveDown) { if (this._y == MadnessObstacle.allObstacles[v2]._y + MadnessObstacle.allObstacles[v2].myDepth / 2 + 1 || this._y == MadnessObstacle.allObstacles[v2]._y - MadnessObstacle.allObstacles[v2].myDepth / 2 - 1) { if (this.myFacing == 'right') { this._x += 4 * this.slowmoSpeedMod * this.doorLockBoost; } else { this._x -= 4 * this.slowmoSpeedMod * this.doorLockBoost; } } } } if (this.pathFind && SwainMath.randomNumber(0, 60) == 0) { this.pathFind = false; } } } ++v2; } } if (!this.targetLock && !this.targetApproach && this.myStatus != 'dodge' && this.myRoster == MadnessRoster.playerRoster) { v2 = 0; while (v2 < this._parent.noColliders.length) { if (this._parent.noColliders[v2] != this) { if (this._x < this._parent.noColliders[v2]._x + (this._parent.noColliders[v2].myWidth / 2) * (this._yscale / 100) + (this.myWidth / 2) * (this._yscale / 100) && this._x > this._parent.noColliders[v2]._x - (this._parent.noColliders[v2].myWidth / 2) * (this._yscale / 100) - (this.myWidth / 2) * (this._yscale / 100) && this._y < this._parent.noColliders[v2]._y + (this._parent.noColliders[v2].myDepth / 2) * (this._parent.noColliders[v2]._yscale / 100) && this._y > this._parent.noColliders[v2]._y - (this._parent.noColliders[v2].myDepth / 2) * (this._parent.noColliders[v2]._yscale / 100)) { if (this.mySpeedRight > 0 && this.moveRight && this._x < this._parent.noColliders[v2]._x || this.mySpeedRight < 0 && this.moveLeft && this._x > this._parent.noColliders[v2]._x) { this._x -= this.mySpeedRight * this.slowmoSpeedMod * this.doorLockBoost; if (this.mySpeedDown == 0) { this.mySpeedRight = 0; } } if (this.mySpeedDown > 0 && this.moveDown && this._y < this._parent.noColliders[v2]._y || this.mySpeedDown < 0 && this.moveUp && this._y > this._parent.noColliders[v2]._y) { this._y -= this.mySpeedDown * this.slowmoSpeedMod * this.doorLockBoost; if (this.mySpeedRight == 0) { this.mySpeedDown = 0; } } } } ++v2; } } if (this.myRoom != undefined) { if (this.myRoom.roomNumber != 0 && this._x < this.myRoom.myDL._x && this._x < this.myRoom.myUL._x) { this.myRoom = this._parent.myRooms[this.myRoom.roomNumber - 1]; } if (this.myRoom.roomNumber != this._parent.myRooms.length - 1 && this._x > this.myRoom.myDR._x && this._x > this.myRoom.myUR._x) { this.myRoom = this._parent.myRooms[this.myRoom.roomNumber + 1]; } if (this._y < this.myRoom.myUL._y && this._y < this.myRoom.myUR._y) { this._y += 5; this.mySpeedDown = 0; } if (this._y > this.myRoom.myDL._y && this._y > this.myRoom.myDR._y) { this._y -= 5; this.mySpeedDown = 0; } for (;;) { if (!(this.myRoom.roomNumber == 0 && SwainMath.calculate_rotation(this.myRoom.myDL._x, this.myRoom.myDL._y, this._x, this._y) <= this.myRoom.leftAngle)) break; this._x += this.myAccel; this.mySpeedRight = 0; if (this.intendedTarget == this.targetPickup && this.intendedTarget != undefined && this.targetLock) { this.initiatePickup(); } } for (;;) { if (!(this.myRoom.roomNumber == this._parent.myRooms.length - 1 && SwainMath.calculate_rotation(this.myRoom.myDR._x, this.myRoom.myDR._y, this._x, this._y) >= this.myRoom.rightAngle)) break; this._x -= this.myAccel; this.mySpeedRight = 0; if (this.intendedTarget == this.targetPickup && this.intendedTarget != undefined && this.targetLock) { this.initiatePickup(); } } for (;;) { if (!(SwainMath.calculate_rotation(this.myRoom.myUL._x, this.myRoom.myUL._y, this._x, this._y) < this.myRoom.upAngle && SwainMath.calculate_rotation(this.myRoom.myUL._x, this.myRoom.myUL._y, this._x, this._y) > 0)) break; this._y += this.myAccel; this.mySpeedDown = 0; if (this.intendedTarget == this.targetPickup && this.intendedTarget != undefined && this.targetLock) { this.initiatePickup(); } } while (SwainMath.calculate_rotation(this.myRoom.myDL._x, this.myRoom.myDL._y, this._x, this._y) > this.myRoom.downAngle) { this._y -= this.myAccel; this.mySpeedDown = 0; if (this.intendedTarget == this.targetPickup && this.intendedTarget != undefined && this.targetLock) { this.initiatePickup(); } } if (this.mySpeedDown == 0 && this.mySpeedRight == 0 && !this.doorLock) { this.pathFind = false; this.ignoreRooms = false; if (!this.targetLock) { this.intendedX = undefined; this.intendedY = undefined; } } } this.myLastRoom = this.myRoom; this.myRoom = this._parent.determineRoom(this._x, this._y); if (this.myRoom == undefined) { this.myRoom = this.myLastRoom; } this._xscale = MadnessCharacter.setPerspectiveScale(this._x, this._y, this.myRoom); this._xscale *= this.myDataRef.myScale; this._yscale = this._xscale; if (this.targetLock || this.pathFind) { if (this.interactType == 'execute') { this.intendedX = this.interactTarget._x; this.intendedY = this.interactTarget._y; this.intendedRoom = this._parent.determineRoom(this.intendedX, this.intendedY); } if (this.interactType == 'cover' && this.intendedTarget.inUse != undefined) { this.targetLock = false; this.pathFind = false; } if (this._x < this.intendedX + this.mySpeed * this.doorLockBoost && this._x > this.intendedX - this.mySpeed * this.doorLockBoost && this._y < this.intendedY + this.mySpeed * this.stairsAdjustMove * this.doorLockBoost && this._y > this.intendedY - this.mySpeed * this.stairsAdjustMove * this.doorLockBoost) { if (this.doorLock) { if (this.myRoster == MadnessRoster.playerRoster) { this._parent.endTimer = 1; } this.intendedTarget.addCharacter(this.myDataRef, 'exit'); this.removeMe(); } else { if (this.interactType == 'pickup') { this.initiatePickup(); } if (this.interactType == 'execute') { this.interactTarget.myStatus = 'axed'; this.interactTarget.gotoAndStop('axed'); this.interactTarget.wounded = 0; this.interactTarget._visible = false; this.myStatus = 'execute'; this.interactTarget.killMe(); if (this.interactTarget.myFacing == 'right') { this.myFacing = 'left'; } else { this.myFacing = 'right'; } this.mySpeedRight = 0; this.mySpeedDown = 0; this._x = this.intendedX; this._y = this.intendedY; } if (this.interactType == 'cover') { this.targetObstacle = this.findClosestObstacle(); this.takeCover(this.targetObstacle); } if (this.interactType == 'bodyshield') { } if (this.interactType == 'activator') { this.mySpeedRight = 0; this.mySpeedDown = 0; this.myStatus = 'use'; this.myFacing = 'right'; } this.interactType = ''; } if (this.targetLock) { this._x = this.intendedX; this._y = this.intendedY; this.mySpeedDown = 0; this.mySpeedRight = 0; } this.targetLock = false; this.pathFind = false; MadnessEvents.bossEvents(this, 'go_to'); } } if (this.myStatus != 'knockback' && this.mySubStatus.substr(0, 8) != '_wounded' && this.myStatus !== 'backtrack' && this.myStatus != 'cover' && this.myStatus.substr(0, 5) != 'dying' && this.myStatus.substr(0, 4) != 'dead' && this.myStatus.substr(0, 5) != 'dodge' && this.myStatus.substr(0, 5) != 'melee' && this.myStatus.substr(0, 7) != 'unarmed' && this.myStatus.substr(0, 4) != 'stun' && this.wounded == 0) { if (this.mySpeedRight < 0) { this.myFacing = 'left'; } else { if (this.mySpeedRight > 0) { this.myFacing = 'right'; } } } if (this.myFacing == 'left') { this._xscale *= -1; this.myTacBar._xscale = -100; } else { this.myTacBar._xscale = 100; } if (!this.myDataRef.amSlow) { if (this._xscale < 0 && !this.facingOpposite || this._xscale > 0 && this.facingOpposite) { this._rotation = this.recoilTimer / 2; } else { this._rotation = -this.recoilTimer / 2; } } this.facingOpposite = false; if (this.myStatus == 'cover' || this.myStatus == 'block' || this.myStatus == 'run' || this.myStatus == 'idle' || this.myStatus == 'tactics') { if (this.mySubStatus.substr(0, 8) != '_wounded') { if (this.returnInvertValid()) { this.facingOpposite = true; this.gotoAndStop(this.myStatus + '_turn'); } else { this.gotoAndStop(this.myStatus); } } } if (this.myStatus == 'dash') { if (this.mySpeedRight > 0 && this.mySpeedRight > this.mySpeed || this.mySpeedRight < 0 && this.mySpeedRight < -this.mySpeed) { if (this.returnInvertValid()) { this.facingOpposite = true; this.gotoAndStop('dash_turn'); } else { this.gotoAndStop('dash'); } } else { if (this.returnInvertValid()) { this.facingOpposite = true; this.gotoAndStop('run_turn'); } else { this.gotoAndStop('run'); } } } if (this.myStatus == 'dead') { this.gotoAndStop('dead' + this.mySubStatus); } if (this.myStatus.substr(0, 7) == 'wounded') { if (this.wounded == 1) { this.gotoAndStop('wounded_fall'); } else { if (this.wounded == 2) { if (this.mySpeedRight != 0) { this.gotoAndStop('wounded_move'); } else { this.gotoAndStop('wounded_idle'); } } } } if (this.myStatus.substr(0, 5) == 'melee') { this.gotoAndStop(this.myStatus); } if (this.myStatus.substr(0, 7) == 'unarmed') { this.gotoAndStop(this.myStatus); } if (this.myStatus.substr(0, 7) == 'execute') { this.gotoAndStop(this.myStatus); } if (this.myStatus.substr(0, 4) == 'axed') { this.gotoAndStop(this.myStatus); } if (this.myStatus.substr(0, 4) == 'stun') { this.gotoAndStop(this.myStatus); } if (this.myStatus == 'recover') { this.gotoAndStop(this.myStatus); } if (this.myStatus == 'startup') { this.gotoAndStop(this.mySubStatus); } if (this.myStatus == 'surrender') { this.gotoAndStop(this.myStatus + this.mySubStatus); } if (this.myStatus == 'dodge') { this.gotoAndStop(this.myStatus + this.mySubStatus); } if (this.myStatus == 'use') { this.gotoAndStop('use'); } if (this.myStatus == 'swap') { this.gotoAndStop('swap'); } if (this.myStatus == 'backtrack') { this.gotoAndStop('backtrack'); } if (this.myStatus == 'incap') { this.gotoAndStop(this.myStatus + this.mySubStatus); } if (this.myStatus == 'knockback') { this.gotoAndStop(this.myStatus + this.mySubStatus); } if (this.myStatus == 'pickup') { this.gotoAndStop('pickup'); } if (this.myStatus == 'run' || this.myStatus == 'idle' || this.myStatus == 'backtrack') { if (this.mySubStatus.substr(0, 8) == '_wounded') { this.facingOpposite = false; this.gotoAndStop(this.myStatus + this.mySubStatus); } } if ((this.myStatus == 'use' || this.myStatus == 'recover' || this.myStatus == 'tactics' || this.myStatus.substr(0, 7) == 'execute' || this.myStatus.substr(0, 5) == 'melee' || this.myStatus.substr(0, 7) == 'unarmed' || this.myStatus.substr(0, 7) == 'deflect' || this.myStatus.substr(0, 4) == 'stun' || this.myStatus == 'swap' || this.myStatus == 'pickup' || this.myStatus == 'knockback' || this.myStatus == 'startup' || this.myStatus == 'pickup') && this.mySprite._currentframe >= this.mySprite._totalframes - 1) { if (this.myStatus.substr(0, 7) == 'execute') { this.clearLockedAction('execute'); } this.myStatus = 'idle'; this.gotoAndStop('idle'); } MadnessCharacter.adjustSprite(this); ++this.aimFlashTimer; if (this.aimFlashTimer <= 5) { var v3 = this.aimFlashTimer; if (v3 <= -10) { v3 += 15; } else { if (v3 <= -5) { v3 += 10; } else { if (v3 <= 0) { v3 += 5; } } } this.myColorTransform = {'rb': 290 - v3 * 40, 'gb': 0, 'bb': 0}; this.myColor.setTransform(this.myColorTransform); } if (this.aimFlashTimer < 6 && this.myStatus != 'idle' && this.myStatus != 'run' && this.myStatus != 'backtrack' && this.myStatus != 'tactics' && this.myStatus != 'dash') { this.aimFlashTimer = 6; } if (this.aimFlashTimer == 6) { this.myColorTransform = {'rb': 0, 'gb': 0, 'bb': 0}; this.myColor.setTransform(this.myColorTransform); } if (this.rofTimer == 1 && !this.myDataRef.myWeapons[this.myWeapon].melee && !this.whipRange) { v2 = 0; while (v2 < this.myBlasts.length) { this._parent.makeBullet(this, this.myBlasts[v2].myRot, this.myBlasts[v2].myLength, this.myBlasts[v2].myX, this.myBlasts[v2].myY, null, null); ++v2; } } if (this.amPlayer && !this.thrownHook && this.myDataRef.myWeapons[this.myWeapon] == undefined && (this.myStatus == 'idle' || this.myStatus == 'run' || this.myStatus == 'backtrack') && PulseTimer.getActive(this.myPulseNumber, 10) && !this.targetLock) { this.targetPickup = this.findClosestPickup(true); } else { if (this.amPlayer && this.myStatus != 'idle' && this.myStatus != 'run' && this.myStatus != 'backtrack' && this.myStatus != 'pickup' && this.myStatus != 'dash') { this.targetPickup = undefined; } } if (this.mySpeedDown != 0) { MadnessCharacter.setMyDepth(this, this._yscale); } this.applyDeath(); if (this.myStatus == 'dead') { if (this.mySprite._currentframe == this.mySprite._totalframes) { this.mySprite.onEnterFrame = null; this.killMe(); if (this.amPlayer) { trace('Just died! Total Lives: ' + MadnessCharacter.playerLives); this._parent.playerDies(); if (!MadnessLevel.levelFailed) { trace(' **** DEAD **** ' + this.mySprite._currentframe + ' is my character\'s sprite frame'); this.invincibleTimer = 60; this.headDamage = 0; this.bodyDamage = 0; if (this.headSpray > 3) { this.headSpray = 3; } if (this.bodySpray > 3) { this.bodySpray = 3; } this.myHealth = this.myHealthMax; this.myStatus = 'recover'; trace(this.myStatus); this.deadMan = false; this.myWidth = this.myDataRef.myWidth; this.noDamage = false; } } else { if (!this.myDataRef.noPaint) { this.paintMe(); } else { this.mySprite.stop(); this.myDataRef.lastStatus = this.myStatus; this.myDataRef.lastSubStatus = this.mySubStatus; this.myDataRef.lastFacing = this.myFacing; this.cacheAsBitmap = true; return true; } } } } this.myDataRef.myHealth = this.myHealth; this.myDataRef.myTactics = this.myTactics; this.myDataRef.loggedX = this._x; this.myDataRef.loggedY = this._y; if (this.headDamage >= 3 && this.myHealth <= 0) { var v4 = new Object(); v4.x = this.mySprite.myHead._x; v4.y = this.mySprite.myHead._y + 26; this.mySprite.localToGlobal(v4); this._parent.globalToLocal(v4); this.makeSparks(v4.x, v4.y, this._y, 'drops_' + this.myDataRef.myBlood); } this.totalFrameDamage = 0; this.myStatusTEXT.text = this.myStatus; this.myMissionTEXT.text = this.myMission; this.targetLockTEXT.text = this.targetLock; this.pathFindTEXT.text = this.pathFind; }; v2.breakdownAutoMove = function () { if (this.amPlayer && !MadnessLevel.levelVictory && !this.targetLock && this.toggleGuard && !this.thrownHook && !this.blocking && (this.myStatus == 'run' || this.myStatus == 'idle' || this.myStatus == 'dash' || this.myStatus == 'backtrack')) { var v5 = false; if (!v5) { var v4 = 0; while (v4 < MadnessActivator.allActivators.length) { this.targetActivator = MadnessActivator.allActivators[v4]; if (!this.targetActivator.activated) { if (this._x < this.targetActivator._x + 80 && this._x > this.targetActivator._x - 80 && this._y < this.targetActivator._y + 50 && this._y > this.targetActivator._y - 50) { this.attractToMC(this.targetActivator, 'activator'); _root.myGameSpeed = 1; this.slowMoActive = false; this.toggleGuard = false; v5 = true; break; } } ++v4; } } if (!v5 && !MadnessActivator.bombActive) { v4 = 0; while (v4 < MadnessDoors.allDoors.length) { this.targetDoor = MadnessDoors.allDoors[v4]; if (!this.targetDoor.amLocked) { if (this.targetDoor.myDataRef.myConnection != undefined && this.lifeSpan > 20 && this.targetDoor.mySprites.length == 0 && !this._parent.roomLock) { if (this._x < this.targetDoor._x + 90 && this._x > this.targetDoor._x - 90 && this._y < this.targetDoor._y + 50 && this._y > this.targetDoor._y - 50) { this._parent.exitDoor = this.targetDoor; _root.myGameSpeed = 1; this.slowMoActive = false; this._parent.playerAim._visible = false; this.toggleGuard = false; var v3 = 0; while (v3 < this.myRoster.myActiveMembers.length) { if (this.myRoster.myActiveMembers[v3].mySprite != undefined) { this.myRoster.myActiveMembers[v3].mySprite.attractToDoor(this.targetDoor); } ++v3; } v5 = true; break; } } } ++v4; } } } if (this.targetLock || this.pathFind) { this.targetApproach = false; if (this.ignoreRooms || this.myRoom == this.intendedRoom || this._x > this.intendedX - 80 && this._x < this.intendedX + 80 && (this._y > this.intendedY - 80 && this._y < this.intendedY + 80)) { this.autoX = this.intendedX; this.autoY = this.intendedY; } else { if (this.intendedRoom.roomNumber > this.myRoom.roomNumber) { this.autoX = (this.myRoom.myUR._x + this.myRoom.myDR._x) / 2 + 20; this.autoY = (this.myRoom.myUR._y + this.myRoom.myDR._y) / 2; } else { this.autoX = (this.myRoom.myUL._x + this.myRoom.myDL._x) / 2 - 20; this.autoY = (this.myRoom.myUL._y + this.myRoom.myDL._y) / 2; } } this.moveUp = false; this.moveDown = false; this.moveRight = false; this.moveLeft = false; if (this._x < this.autoX - this.mySpeed * this.doorLockBoost) { this.moveRight = true; } else { if (this._x > this.autoX + this.mySpeed * this.doorLockBoost) { this.moveLeft = true; } } if (this._y < this.autoY - this.mySpeed * this.stairsAdjustMove * this.doorLockBoost) { this.moveDown = true; } else { if (this._y > this.autoY + this.mySpeed * this.stairsAdjustMove * this.doorLockBoost) { this.moveUp = true; } } if (!this.moveRight && !this.moveLeft && !this.moveUp && !this.moveDown && !this.doorLock) { this.pathFind = false; } if (this.targetLock && this.interactType == 'pickup' && this.amPlayer) { trace('Pickup test: ' + this.moveRight + ' ' + this.moveLeft + ' ' + this.moveUp + ' ' + this.moveDown); } } else { if (this.targetApproach) { if (this.intendedX - this._x > 5 || this.intendedX - this._x < -5) { this.mySpeedRight = (this.intendedX - this._x) / 6; } if (this.intendedY - this._y > 5 || this.intendedY - this._y < -5) { this.mySpeedDown = (this.intendedY - this._y) / 6; } if (this.intendedX - this._x < 5 && this.intendedX - this._x > -5 && this.intendedY - this._y < 5 && this.intendedY - this._y > -5) { this.targetApproach = false; } } } if (this.myStatus.substr(0, 5) != 'melee' && this.myStatus.substr(0, 7) != 'unarmed' && this.myStatus != 'cover') { this.targetApproach = false; } }; v2.breakdownStatusActions = function () { if (this.myStatus == 'idle' || this.myStatus == 'run' || this.myStatus == 'backtrack') { if ((this.amPlayer || this.myMission == 'engage' || this.myDataRef.myStartup == 'startup_bottle') && this.myDataRef.myStartup != undefined && !MadnessTransition.transitionLock) { this.myStatus = 'startup'; this.mySubStatus = this.myDataRef.myStartup; this.myDataRef.myStartup = undefined; if (!this.amPlayer && this.myAttackTarget != undefined) { if (!this.myAttackTarget._x > this._x) { this.myFacing = 'right'; } else { this.myFacing = 'left'; } } } } if (this.toggleSlowmo && this.myHealth > 0 && this.myDataRef.mySlowMo > 0 && (this.myStatus == 'idle' || this.myStatus == 'run' || this.myStatus == 'backtrack' || this.myStatus == 'block' || this.myStatus == 'dash' || this.myStatus.substr(0, 5) == 'melee' || this.myStatus.substr(0, 7) == 'unarmed') || this.toggleSlowmo && _root.myGameSpeed == 0) { if (this.slowmoTimer == 0) { this.slowmoTimer = 1; if (this.slowMoActive) { this.slowMoActive = false; } else { this.slowMoActive = true; } } } else { this.slowmoTimer = 0; } if (this.myDataRef == MadnessRoster.playerRoster.teamLeader && (this.myStatus.substr(0, 4) == 'stun' || this.myStatus == 'dead' || this.myStatus == 'knockback')) { this.slowMoActive = false; } if (this.myDataRef == MadnessRoster.playerRoster.teamLeader) { if (this.slowMoActive) { _root.myGameSpeed = 0; } else { _root.myGameSpeed = 1; } } if (this.myStatus == 'recover') { this.mySpeedDown = 0; this.mySpeedRight = 0; } else { this.invincibleTimer -= 1 + this.myGameSpeed; } if (this.myStatus == 'surrender') { if (this.myAttackTarget != undefined) { if (this.myAttackTarget._x > this._x) { this.myFacing = 'right'; } else { this.myFacing = 'left'; } } } if ((this.myStatus == 'block' || this.myStatus == 'idle' || this.myStatus == 'run' || this.myStatus == 'backtrack' || this.myStatus == 'dash') && this.rofTimer > 10) { if (this.togglePickup && !this.thrownHook && this.pickupTimer == 0) { if (this.myDataRef.myWeapons[this.myWeapon] == undefined) { if (this.targetPickup != undefined) { this.targetPickup = this.findClosestPickup(true); if (this.targetPickup != undefined) { this.attractToMC(this.targetPickup, 'pickup'); } } } else { this.myStatus = 'melee_throw1'; this.rofTimer = 1; this.rofLastFrame = 1; if (this.myAimX < this._x) { this.myFacing = 'left'; } else { this.myFacing = 'right'; } } } else { if (this.toggleGuard) { if (this.myDataRef.myWeapons[this.myWeapon].melee) { if (!this.blocking) { this.actionTimer = 1; } else { this.actionTimer += 1 + this.myGameSpeed; this.myStatus = 'block'; } this.blocking = true; } else { this.targetObstacle = this.findClosestObstacle(); if (this.targetObstacle != undefined && this.amPlayer) { this.takeCover(this.targetObstacle); if (this.amPlayer) { KeyManager.lockKeys(); } } else { this.myTactics -= 10; this.tacTimer = 0; if (this.myTactics < 0) { this.myTactics = 0; } this.myStatus = 'dodge'; this.actionTimer = 0; this.actionSlowdown = false; this.mySubStatus = '_leap'; if (this.myAimX < this._x && this.myFacing == 'right' || this.myAimX > this._x && this.myFacing == 'left') { this.mySubStatus += 'Back'; } else { this.mySubStatus += 'Front'; } this.intendedX = this.myAimX; this.intendedY = this.myAimY; if (this.amPlayer) { this.intendedRot = SwainMath.calculate_rotation(this._x, this._y, this.intendedX, this.intendedY); } else { this.intendedRot = SwainMath.randomNumber(-180, 180); } this.amDodging = true; } } } else { this.blocking = false; if (this.myStatus == 'block') { this.myStatus = 'idle'; } if (this.toggleAction && !this.thrownHook && (this.myWeapon == 1 || MadnessDataFile.havePerk('perkSidearm1', this.myDataRef) || this.myDataRef.myWeapons[1] != undefined) && (this.myDataRef.myWeapons[0] != undefined || this.myDataRef.myWeapons[1] != undefined)) { this.myStatus = 'swap'; this.actionTimer = 0; if (this.amPlayer) { if (this.myDataRef.myWeapons[1 - this.myWeapon].melee) { this.playSound('swapmelee'); } else { if (this.myDataRef.myWeapons[1 - this.myWeapon] != undefined) { this.playSound('swapgun'); } } } } } } if (this.togglePickup) { ++this.pickupTimer; } else { this.pickupTimer = 0; } } else { this.blocking = false; if (this.myStatus == 'block') { this.myStatus = 'idle'; } } if (this.myStatus == 'cover') { if (this.targetObstacle._x > this._x) { this.myFacing = 'right'; } else { this.myFacing = 'left'; } if (this.moveUp || this.moveDown || this.moveRight || this.moveLeft || this.toggleGuard) { if (this.toggleGuard && this.amPlayer) { KeyManager.lockKeys(); } this.myStatus = 'idle'; this.targetObstacle.inUse = undefined; this.targetObstacle = undefined; } } if (this.myStatus == 'dodge') { if (this.actionTimer == 0 && this.mySprite._currentframe < this.mySprite._totalframes) { this.mySpeedRight = SwainMath.get_position(this._x, this._y, this.intendedRot, this.mySpeed * 1.2, 'x') - this._x; if (this.mySpeedRight > 0 && this.mySpeedRight < 6) { this.mySpeedRight = 5.5; } if (this.mySpeedRight < 0 && this.mySpeedRight > -6) { this.mySpeedRight = -5.5; } this.mySpeedDown = SwainMath.get_position(this._x, this._y, this.intendedRot, this.mySpeed * 1.2 * 0.5, 'y') - this._y; } else { if (this.mySubStatus.substr(0, 5) == '_leap') { if (MadnessDataFile.havePerk('perkDodge3', this.myDataRef)) { this.mySubStatus = '_flip'; } else { if (MadnessDataFile.havePerk('perkDodge2', this.myDataRef)) { this.mySubStatus = '_max'; } else { this.mySubStatus = '_clumsy'; } } if (this.mySpeedRight < 0 && this.myFacing == 'right' || this.mySpeedRight > 0 && this.myFacing == 'left') { this.mySubStatus += 'Back'; } else { this.mySubStatus += 'Front'; } } this.actionTimer = 1; if (this.actionSlowdown) { this.mySpeedDown *= 0.89; if (this.mySpeedDown < 1 && this.mySpeedDown > -1) { this.mySpeedDown = 0; } this.mySpeedRight *= 0.89; if (this.mySpeedRight < 1 && this.mySpeedRight > -1) { this.mySpeedRight = 0; } } if (this.actionSlowdown && this.mySprite._currentframe == this.mySprite._totalframes) { this.myStatus = 'idle'; this.mySubStatus = ''; } } } else { this.amDodging = false; } if (this.myStatus == 'swap' || this.myStatus == 'surrender' || this.myStatus == 'startup' || this.myStatus == 'pickup') { if (this.mySpeedDown > 0) { this.mySpeedDown -= this.myAccel * this.slowmoSpeedMod; if (this.mySpeedDown < 0) { this.mySpeedDown = 0; } } if (this.mySpeedDown < 0) { this.mySpeedDown += this.myAccel * this.slowmoSpeedMod; if (this.mySpeedDown > 0) { this.mySpeedDown = 0; } } if (this.mySpeedRight > 0) { this.mySpeedRight -= this.myAccel * this.slowmoSpeedMod; if (this.mySpeedRight < 0) { this.mySpeedRight = 0; } } if (this.mySpeedRight < 0) { this.mySpeedRight += this.myAccel * this.slowmoSpeedMod; if (this.mySpeedRight > 0) { this.mySpeedRight = 0; } } } if (this.myStatus == 'action') { this.actionTimer += 1 + this.myGameSpeed; this.mySpeedDown = 0; this.mySpeedRight = 0; if (this.mySprite._currentframe == this.mySprite._totalframes || this.actionTimer > 10 && (this.moveRight || this.moveDown)) { this.myStatus = 'idle'; } } if (this.myStatus.substr(0, 7) == 'wounded' && this.wounded == 2) { this.mySpeedRight = 0; this.mySpeedDown = 0; if (this.moveRight) { this.mySpeedRight = 1; } if (this.moveLeft) { this.mySpeedRight = -1; } if (this.moveDown) { this.mySpeedDown = 0.3; } if (this.moveUp) { this.mySpeedDown = -0.3; } } if (this.myStatus.substr(0, 4) == 'axed') { this.mySpeedRight = 0; this.mySpeedDown = 0; } if (this.myStatus == 'dead') { if (this.mySubStatus.substr(0, 7) == '_stairs') { if (this.myRoom.amStairs) { if (this.mySpeedDown < 0) { this.mySpeedDown = 0; } if (this.myRoom.downAngle < 90) { if (this.mySpeedRight > 0) { this.mySpeedRight = 0; } if (this.mySpeedRight > -7) { this.mySpeedRight -= 0.5 * this.slowmoSpeedMod; } if (this.mySpeedDown < 7) { this.mySpeedDown += 0.5 * this.slowmoSpeedMod; } } else { if (this.mySpeedRight < 0) { this.mySpeedRight = 0; } if (this.mySpeedRight < 7) { this.mySpeedRight += 0.5 * this.slowmoSpeedMod; } if (this.mySpeedDown < 7) { this.mySpeedDown += 0.5 * this.slowmoSpeedMod; } } } else { this.mySpeedDown = 0; if (this.myFacing == 'right' && this.myRoom.downAngle < 90 || this.myFacing == 'left' && this.myRoom.downAngle >= 90) { this.mySubStatus = '_landed3'; } else { this.mySubStatus = '_landed' + SwainMath.randomNumber(1, 2); } this.applyDeath(); } } else { if (this.mySubStatus.substr(0, 8) == '_stagger') { this.actionSlowdown = true; } if (this.mySpeedDown > 0) { this.mySpeedDown -= 0.65 * this.slowmoSpeedMod; if (this.mySpeedDown < 0) { this.mySpeedDown = 0; } } if (this.mySpeedDown < 0) { this.mySpeedDown += 0.65 * this.slowmoSpeedMod; if (this.mySpeedDown > 0) { this.mySpeedDown = 0; } } if (this.actionSlowdown) { if (this.mySpeedRight > 0) { this.mySpeedRight -= 0.65 * this.slowmoSpeedMod; if (this.mySpeedRight < 0) { this.mySpeedRight = 0; } } if (this.mySpeedRight < 0) { this.mySpeedRight += 0.65 * this.slowmoSpeedMod; if (this.mySpeedRight > 0) { this.mySpeedRight = 0; } } } } } if (this.myStatus == 'incap') { } if (this.myStatus.substr(0, 7) == 'execute') { this.mySpeedRight = 0; this.mySpeedDown = 0; } if (this.myStatus == 'knockback') { if (this.actionSlowdown) { this.mySpeedRight *= 0.92; if (this.mySpeedRight < 1 && this.mySpeedRight > -1) { this.mySpeedRight = 0; } } this.mySpeedDown = 0; } if (this.myStatus.substr(0, 5) == 'melee' || this.myStatus.substr(0, 4) == 'stun' || this.myStatus == 'block' || this.myStatus.substr(0, 7) == 'unarmed' || this.myStatus == 'cover') { if (this.mySpeedDown > 0) { this.mySpeedDown -= this.myAccel * this.slowmoSpeedMod / 4; if (this.mySpeedDown < 0) { this.mySpeedDown = 0; } } if (this.mySpeedDown < 0) { this.mySpeedDown += this.myAccel * this.slowmoSpeedMod / 4; if (this.mySpeedDown > 0) { this.mySpeedDown = 0; } } if (this.mySpeedRight > 0) { this.mySpeedRight -= this.myAccel * this.slowmoSpeedMod / 4; if (this.mySpeedRight < 0) { this.mySpeedRight = 0; } } if (this.mySpeedRight < 0) { this.mySpeedRight += this.myAccel * this.slowmoSpeedMod / 4; if (this.mySpeedRight > 0) { this.mySpeedRight = 0; } } if (this.myStatus == 'block' && (this.moveRight || this.moveLeft || this.moveUp || this.moveDown)) { this.myStatus = 'idle'; } } if (this.meleeHealthTimer > 0) { this.meleeHealthTimer -= 1 + _root.myGameSpeed; if (this.meleeHealthTimer <= 0) { this.meleeHealthTimer = 0; this.meleeHealth = this.myDataRef.meleeHealth; } } if (this.myStatus == 'idle' || this.myStatus == 'run' || this.myStatus == 'backtrack' || this.myStatus == 'tactics') { if (this.mySubStatus.substr(0, 8) != '_wounded') { this.mySubStatus = ''; } this.stairsAdjustMove = 0.65; if (this.myRoom.amStairs && (this.moveRight || this.moveLeft)) { this.stairsAdjustMove = SwainMath.getRotDistance(90, this.myRoom.downAngle) / 50; } if (this.moveDown) { this.mySpeedDown += this.myAccel * this.stairsAdjustMove * this.slowmoSpeedMod; } else { if (this.moveUp) { this.mySpeedDown -= this.myAccel * this.stairsAdjustMove * this.slowmoSpeedMod; } else { if (this.myStatus != 'tactics') { if (this.mySpeedDown > 0) { this.mySpeedDown -= this.myAccel * this.slowmoSpeedMod; if (this.mySpeedDown < 0) { this.mySpeedDown = 0; } } if (this.mySpeedDown < 0) { this.mySpeedDown += this.myAccel * this.slowmoSpeedMod; if (this.mySpeedDown > 0) { this.mySpeedDown = 0; } } } } } if (this.myStatus != 'tactics') { if (this.mySpeedDown > this.mySpeed * this.stairsAdjustMove) { this.mySpeedDown = this.mySpeed * this.stairsAdjustMove; } if (this.mySpeedDown < -this.mySpeed * this.stairsAdjustMove) { this.mySpeedDown = -this.mySpeed * this.stairsAdjustMove; } } if (this.moveRight) { this.mySpeedRight += this.myAccel * this.slowmoSpeedMod; } else { if (this.moveLeft) { this.mySpeedRight -= this.myAccel * this.slowmoSpeedMod; } else { if (this.mySpeedRight > 0) { this.mySpeedRight -= this.myAccel * this.slowmoSpeedMod; if (this.mySpeedRight < 0) { this.mySpeedRight = 0; } } if (this.mySpeedRight < 0) { this.mySpeedRight += this.myAccel * this.slowmoSpeedMod; if (this.mySpeedRight > 0) { this.mySpeedRight = 0; } } } } if (this.mySpeedRight > this.mySpeed) { this.mySpeedRight = this.mySpeed; } if (this.mySpeedRight < -this.mySpeed) { this.mySpeedRight = -this.mySpeed; } if (this.myStatus != 'backtrack') { this.backtrackTimer = 0; } if (this.mySpeedRight == 0 && this.mySpeedDown == 0) { this.backtrackTimer = 0; if (this.myStatus != 'tactics') { this.myStatus = 'idle'; } } else { if (this.myStatus != 'tactics') { if ((this.backtrackTimer < 10 || SwainMath.randomNumber(0, 4 * (2 - this.myGameSpeed)) != 0) && (this.mySpeedRight > 0 && this.myFacing == 'left' && this.myAimX < this._x || this.mySpeedRight < 0 && this.myFacing == 'right' && this.myAimX > this._x)) { this.myStatus = 'backtrack'; if (this.reloadTimer == -1) { this.backtrackTimer += 1 + this.myGameSpeed; } } else { this.myStatus = 'run'; } } } } if (this.myStatus == 'idle' || this.myStatus == 'backtack' || this.myStatus == 'run' || this.myStatus.substr(0, 7) == 'unarmed' || this.myStatus.substr(0, 5) == 'melee') { if (this.dashTimer > 0) { ++this.dashTimer; } if (this.dashTimer > this.dashTimeEnable * 100) { if ((this.moveRight || this.moveLeft) && this.dashTimer <= this.dashTimeEnable * 101) { } } if (!this.moveRight && !this.moveLeft && this.dashTimer == -1) { this.dashTimer = 0; } if ((this.moveRight || this.moveLeft) && this.dashTimer == 0) { this.dashTimer = 1; } if (this.dashTimer > 0 && this.dashTimer < this.dashTimeEnable * 50 && !this.moveRight && !this.moveLeft) { this.dashTimer = this.dashTimeEnable * 50; } if (this.dashTimer > this.dashTimeEnable * 50 && this.dashTimer < this.dashTimeEnable * 51 && (this.moveRight || this.moveLeft) && this.myRoster == MadnessRoster.playerRoster) { this.myStatus = 'dash'; } if (this.dashTimer > this.dashTimeEnable && this.dashTimer < this.dashTimeEnable * 50 || this.dashTimer > this.dashTimeEnable * 51 && this.dashTimer < this.dashTimeEnable * 100 || this.dashTimer > this.dashTimeEnable * 101) { this.dashTimer = -1; } } if (this.myStatus == 'dash') { this.dashTimer = -1; this.stairsAdjustMove = 0.25; if (this.myRoom.amStairs && (this.moveRight || this.moveLeft)) { this.stairsAdjustMove = SwainMath.getRotDistance(90, this.myRoom.downAngle) / 35; } if (this.moveDown) { this.mySpeedDown += this.myAccel * this.stairsAdjustMove * this.slowmoSpeedMod; } else { if (this.moveUp) { this.mySpeedDown -= this.myAccel * this.stairsAdjustMove * this.slowmoSpeedMod; } else { if (this.mySpeedDown > 0) { this.mySpeedDown -= this.myAccel * this.slowmoSpeedMod; if (this.mySpeedDown < 0) { this.mySpeedDown = 0; } } if (this.mySpeedDown < 0) { this.mySpeedDown += this.myAccel * this.slowmoSpeedMod; if (this.mySpeedDown > 0) { this.mySpeedDown = 0; } } } } if (this.mySpeedDown > this.mySpeed * this.stairsAdjustMove) { this.mySpeedDown = this.mySpeed * this.stairsAdjustMove; } if (this.mySpeedDown < -this.mySpeed * this.stairsAdjustMove) { this.mySpeedDown = -this.mySpeed * this.stairsAdjustMove; } if (this.moveLeft) { this.mySpeedRight -= this.myAccel * this.slowmoSpeedMod; } else { if (this.moveRight) { this.mySpeedRight += this.myAccel * this.slowmoSpeedMod; } else { this.myStatus = 'idle'; } } if (this.mySpeedRight > this.mySpeed * this.myDash) { this.mySpeedRight = this.mySpeed * this.myDash; } if (this.mySpeedRight < -this.mySpeed * this.myDash) { this.mySpeedRight = -this.mySpeed * this.myDash; } } if (this.reloadTimer > -1) { this.reloadTimer += 1 + this.myGameSpeed; if (this.myDataRef.myWeapons[this.myWeapon].myCat == 'pistol' || this.myDataRef.myWeapons[this.myWeapon].myCat == 'revolver') { if (MadnessDataFile.havePerk('perkPistolReload', this.myDataRef)) { ++this.reloadTimer; } } else { if (this.myDataRef.myWeapons[this.myWeapon].myCat == 'smg') { if (MadnessDataFile.havePerk('perkSMGReload', this.myDataRef)) { ++this.reloadTimer; } } } if (this.myDataRef.myWeapons[this.myWeapon].myCat == 'rifle') { if (MadnessDataFile.havePerk('perkRifleReload', this.myDataRef)) { ++this.reloadTimer; } } if (this.myDataRef.myWeapons[this.myWeapon].myCat == 'shotgun') { if (MadnessDataFile.havePerk('perkShotgunReload', this.myDataRef)) { ++this.reloadTimer; } } if (this.reloadTimer >= this.mySprite.handShoot_front.myGun._totalframes && this.reloadTimer >= this.mySprite.handShoot_back.myGun._totalframes) { this.reloadTimer = -1; if (this.myDataRef.myWeapons[this.myWeapon].singleBulletClip) { this.myDataRef.myWeapons[this.myWeapon].myAmmo += 1; this.myDataRef.myWeapons[this.myWeapon].myClips -= 1; if (!this.mouseHold && this.myDataRef.myWeapons[this.myWeapon].myAmmo < this.myDataRef.myWeapons[this.myWeapon].myAmmoMax && this.myDataRef.myWeapons[this.myWeapon].myClips > 0) { this.reloadTimer = 0; this.rofLastFrame = 1; } } else { if (this.myDataRef.myWeapons[this.myWeapon].myAmmo < this.myDataRef.myWeapons[this.myWeapon].myAmmoMax) { this.myDataRef.myWeapons[this.myWeapon].myAmmo = this.myDataRef.myWeapons[this.myWeapon].myAmmoMax; this.myDataRef.myWeapons[this.myWeapon].myClips -= 1; trace('WARNING! Reload on gun ' + this.myDataRef.myWeapons[this.myWeapon].myType + ' failed, backup initiated'); } } } if (this.myStatus != 'incap' && this.myStatus != 'idle' && this.myStatus != 'run' && this.myStatus != 'backtrack' && this.myStatus != 'dash' && this.myStatus != 'cover' && this.myStatus != 'tactics') { this.reloadTimer = -1; } } if (this.myDataRef.myWeapons[this.myWeapon].myClips > 0 && this.reloadTimer == -1 && (this.myStatus == 'incap' || this.myStatus == 'idle' || this.myStatus == 'run' || this.myStatus == 'backtrack' || this.myStatus == 'dash' || this.myStatus == 'cover') && (this.toggleReload || this.myDataRef.myWeapons[this.myWeapon].myAmmo == 0) && this.rofTimer > this.myDataRef.myWeapons[this.myWeapon].myROF && this.myDataRef.myWeapons[this.myWeapon].myAmmo < this.myDataRef.myWeapons[this.myWeapon].myAmmoMax) { this.reloadTimer = 0; this.rofLastFrame = 1; } }; } else { goto 62245; } storedv2.breakdownAttack = function () { this.lastHitTimer += 1 + this.myGameSpeed; if (MadnessCharacter.aimingSprite._x == undefined && MadnessCharacter.aimingSprite != undefined) { this.aimTimer = -1; MadnessCharacter.aimingSprite = undefined; } if (this.myAttackTarget == MadnessRoster.playerRoster.teamLeader.mySprite && MadnessCharacter.aimingSprite == undefined && this.reloadTimer == -1 && !this.myDataRef.myWeapons[this.myWeapon].melee && this.myDataRef.myWeapons[this.myWeapon] != undefined && this.myDataRef.myWeapons[this.myWeapon].myAmmo > 0 && this.myRoster != MadnessRoster.playerRoster && this.mouseHold && this.myDataRef.myLevel > 0 && SwainMath.randomNumber(0, (11 - this.myDataRef.traitCombatSkill) * Math.abs(10 - this.myDataRef.myWeapons[this.myWeapon].myROF / 3)) <= 0) { if (SwainMath.get_distance(this, this.myAttackTarget) < this.myDataRef.myWeapons[this.myWeapon].myRange * 2 || this.myDataRef.noRange && SwainMath.get_distance(this, this.myAttackTarget) < 500) { MadnessCharacter.aimingSprite = this; this.aimTimer = 60 + 220 / this.myDataRef.myLevel * 3; this._parent.createAimReticle(this, this.myAttackTarget); this.aimFlash(); } } if (this.aimTimer > 0) { this.aimTimer -= 1 + this.myGameSpeed; if (this.aimTimer < 0) { this.aimTimer = 0; } } if (this.aimTimer > -1) { if (this.myAttackTarget != MadnessRoster.playerRoster.teamLeader.mySprite || this.myDataRef.myWeapons[this.myWeapon].melee || this.myDataRef.myWeapons[this.myWeapon] == undefined || this.reloadTimer != -1 || this.myStatus != 'idle' && this.myStatus != 'run' && this.myStatus != 'dash' && this.myStatus != 'backtrack' && this.myStatus != 'tactics') { this.aimTimer = -1; MadnessCharacter.aimingSprite = undefined; } } this.rofTimer += 1 + this.myGameSpeed; if (this.slowMoActive && MadnessDataFile.havePerk('perkBulletTime3', this.myDataRef)) { ++this.rofTimer; } this.rofAdjust = 0; if (this.myDataRef.myWeapons[this.myWeapon].myCat == 'pistol' || this.myDataRef.myWeapons[this.myWeapon].myCat == 'revolver') { if (MadnessDataFile.havePerk('perkPistolROF2', this.myDataRef)) { ++this.rofAdjust; } if (MadnessDataFile.havePerk('perkPistolROF1', this.myDataRef)) { ++this.rofAdjust; } } if (this.myDataRef.myWeapons[this.myWeapon].myCat == 'smg') { if (MadnessDataFile.havePerk('perkSMGROF', this.myDataRef)) { ++this.rofAdjust; } } if (this.myDataRef.myWeapons[this.myWeapon].myCat == 'shotgun' && this.myDataRef.myWeapons[this.myWeapon].havePump) { if (MadnessDataFile.havePerk('perkShotgunROF2', this.myDataRef)) { this.rofAdjust += 7; } if (MadnessDataFile.havePerk('perkShotgunROF1', this.myDataRef)) { this.rofAdjust += 7; } } if (this.rofTimer > this.myDataRef.myWeapons[this.myWeapon].myROF + 3) { this.smgAimTimer = 1; } if (MadnessDataFile.havePerk('perkSMGAim2', this.myDataRef) && this.myDataRef.myWeapons[this.myWeapon].myCat == 'smg' && this.smgAimTimer > 0.1) { this.smgAimTimer -= 0.04; } else { if (MadnessDataFile.havePerk('perkSMGAim1', this.myDataRef) && this.myDataRef.myWeapons[this.myWeapon].myCat == 'smg' && this.smgAimTimer > 0.4) { this.smgAimTimer -= 0.02; } } if (this.myStatus.substr(0, 5) != 'melee') { this.meleeComboTimer += 1 + this.myGameSpeed; if (this.meleeComboTimer > 4) { this.meleeCombos = 3; } } if (this.myMission == 'follow') { this.myMission = 'engage'; } if (this.myRoster.teamAttacker == this) { if (this.myDataRef.myWeapons[this.myWeapon].melee || this.myDataRef.myWeapons[this.myWeapon] == undefined || this.rofTimer >= this.myDataRef.myWeapons[this.myWeapon].myROF - this.rofAdjust) { this.myRoster.teamAttacker = undefined; } } if (this.reloadTimer == -1 && (this.rofTimer >= this.myDataRef.myWeapons[this.myWeapon].myROF - this.rofAdjust || this.myDataRef.myWeapons[this.myWeapon] == undefined) && (this.mouseHold && this.aimTimer == -1 || this.aimTimer == 0) && (this.myStatus == 'idle' || this.myStatus == 'run' || this.myStatus == 'backtrack' || this.myStatus == 'dash' || this.myStatus == 'cover' || this.myStatus == 'tactics' || this.myStatus == 'incap') && this.mySubStatus.substr(0, 8) != '_wounded' && (!this.myDataRef.myWeapons[this.myWeapon].melee && this.myDataRef.myWeapons[this.myWeapon] != undefined || (this.myDataRef.myWeapons[this.myWeapon] == undefined || this.myDataRef.myWeapons[this.myWeapon].melee) && (!this.moveUp && !this.moveDown && !this.moveRight && !this.moveLeft || (this.moveUp || this.moveDown || this.moveRight || this.moveLeft) && (this.mySpeedRight >= this.mySpeed * 0.7 || this.mySpeedRight <= -this.mySpeed * 0.7 || this.mySpeedDown >= this.mySpeed * this.stairsAdjustMove || this.mySpeedDown <= -this.mySpeed * this.stairsAdjustMove)))) { this.whipRange = false; if (this.aimTimer == -1 && this.myDataRef.myWeapons[this.myWeapon].myCat != 'melee' && this.myStatus != 'incap' && this.myDataRef.myWeapons[this.myWeapon] != undefined) { this.whipRange = this.checkWhipRange(); } if (this.myDataRef.myWeapons[this.myWeapon] == undefined || this.whipRange) { if (this.whipRange) { if (this.myDataRef.myCharacter == 'mag') { this.myStatus = 'unarmed_mag_' + SwainMath.randomNumber(1, 2); ItemGenerator.changeUnarmedDamage(this.myDataRef, 'unarmed_elite', false); } else { if (this.myDataRef.myWeapons[this.myWeapon].twoHand) { this.myStatus = 'melee_rifle'; } else { this.myStatus = 'melee_pistol'; } } if (this.myAimX < this._x) { this.myFacing = 'left'; } else { this.myFacing = 'right'; } } else { if (this.myStatus == 'dash') { this.myStatus = 'melee_dash1'; } else { if (MadnessDataFile.havePerk('perkUnarmedMoves3', this.myDataRef)) { if (SwainMath.randomNumber(0, 2) == 0) { this.myStatus = 'unarmed_brawl_' + SwainMath.randomNumber(1, 4); } else { if (SwainMath.randomNumber(0, 1) == 0) { this.myStatus = 'unarmed_savate_' + SwainMath.randomNumber(1, 5); } else { this.myStatus = 'unarmed_elite_' + SwainMath.randomNumber(1, 5); } } } else { if (MadnessDataFile.havePerk('perkUnarmedMoves2', this.myDataRef)) { if (SwainMath.randomNumber(0, 1) == 0) { this.myStatus = 'unarmed_brawl_' + SwainMath.randomNumber(1, 4); } else { this.myStatus = 'unarmed_savate_' + SwainMath.randomNumber(1, 5); } } else { if (MadnessDataFile.havePerk('perkUnarmedMoves1', this.myDataRef)) { this.myStatus = 'unarmed_brawl_' + SwainMath.randomNumber(1, 4); } else { this.myStatus = 'unarmed_chump_' + SwainMath.randomNumber(1, 2); } } } if (this.myAimX < this._x) { this.myFacing = 'left'; } else { this.myFacing = 'right'; } } } } else { if (this.myDataRef.myWeapons[this.myWeapon].melee) { if (this.myDataRef.myCharacter == 'fatboy') { this.myStatus = 'melee_slam'; if (this.myAimX < this._x) { this.myFacing = 'left'; } else { this.myFacing = 'right'; } } else { if (this.myStatus == 'dash') { this.myStatus = 'melee_dash2'; } else { if (this.meleeCombos > 2) { this.meleeCombos = 0; } this.meleeComboTimer = 0; if (MadnessDataFile.havePerk('perkMeleeMoves4', this.myDataRef)) { if (this.meleeCombos == 0) { this.myStatus = 'melee_better' + SwainMath.randomNumber(1, 6); } if (this.meleeCombos == 1) { this.myStatus = 'melee_better' + SwainMath.randomNumber(1, 6); } if (this.meleeCombos == 2) { this.myStatus = 'melee_finish' + SwainMath.randomNumber(1, 3); } } else { if (MadnessDataFile.havePerk('perkMeleeMoves3', this.myDataRef)) { if (this.meleeCombos == 0) { this.myStatus = 'melee_better' + SwainMath.randomNumber(1, 6); } if (this.meleeCombos == 1) { this.myStatus = 'melee_better' + SwainMath.randomNumber(1, 6); } if (this.meleeCombos == 2) { this.myStatus = 'melee_better' + SwainMath.randomNumber(1, 3); } } else { if (MadnessDataFile.havePerk('perkMeleeMoves2', this.myDataRef)) { if (this.meleeCombos == 0) { this.myStatus = 'melee_basic' + SwainMath.randomNumber(1, 6); } if (this.meleeCombos == 1) { this.myStatus = 'melee_basic' + SwainMath.randomNumber(1, 6); } if (this.meleeCombos == 2) { this.myStatus = 'melee_better' + SwainMath.randomNumber(1, 6); } } else { if (MadnessDataFile.havePerk('perkMeleeMoves1', this.myDataRef)) { if (this.meleeCombos == 0) { this.myStatus = 'melee_basic' + SwainMath.randomNumber(1, 6); } if (this.meleeCombos == 1) { this.myStatus = 'melee_basic' + SwainMath.randomNumber(1, 6); } if (this.meleeCombos == 2) { this.myStatus = 'melee_basic' + SwainMath.randomNumber(1, 6); } } else { this.meleeCombos = 2; this.myStatus = 'melee_chump' + SwainMath.randomNumber(1, 2); } } } } ++this.meleeCombos; if (this.myAimX < this._x) { this.myFacing = 'left'; } else { this.myFacing = 'right'; } } } } else { if (this.myDataRef.myWeapons[this.myWeapon].myAmmo > 0) { this.recoilTimer = this.myDataRef.myWeapons[this.myWeapon].myDamage * this.myDataRef.myWeapons[this.myWeapon].myShots; if (this.myDataRef.myWeapons[this.myWeapon].myCat != 'shotgun' && this.myDataRef.myWeapons[this.myWeapon].myCat != 'revolver' && this.myDataRef.myWeapons[this.myWeapon].myType != 'm203') { this.ejectShell(); } this.rofTimer = 1; this.rofLastFrame = 1; if (this.myDataRef.myWeapons[this.myWeapon].myDamageType == 'grenade') { MadnessCharacter.adjustSprite(this); this.launchGrenade(); } else { this.checkAttackHit('', '', this.myDataRef.myWeapons[this.myWeapon]); } if (this.myRoster != MadnessRoster.playerRoster) { this.myRoster.teamAttacker = this; this.myRoster.teamFireScore += this.returnAttackScore(); } if (this.myDataRef.myCharacter == 'mag') { this.shakeyCam(6); } this.myDataRef.myWeapons[this.myWeapon].myAmmo -= 1; if (this.aimTimer == 0) { this.aimTimer = -1; MadnessCharacter.aimingSprite = undefined; } this.playSound(this.myDataRef.myWeapons[this.myWeapon].mySound); } else { if (this.myDataRef.myWeapons[this.myWeapon].myAmmo == 0 && this.amPlayer && this.emptyClipTimer <= 0) { this.playSound('emptyclip'); this.emptyClipTimer = this.myDataRef.myWeapons[this.myWeapon].myROF; } } } } if (this.myDataRef.myWeapons[this.myWeapon] == undefined) { ItemGenerator.changeUnarmedDamage(this.myDataRef, this.myStatus, MadnessDataFile.havePerk('perkKnockdown2', this.myDataRef)); } else { ItemGenerator.changeUnarmedDamage(this.myDataRef, 'unarmed_brawl', false); } } var v2 = 0; while (v2 < this.targetsHit.length) { this.targetsHit[v2].applyDeath(); ++v2; } this.targetsHit = new Array(); if (this.recoilTimer > 0) { this.recoilTimer *= 0.8; } if (this.recoilTimer < 0) { this.recoilTimer = 0; } }; storedv2.refreshStats = function () { this.myHealth = this.myDataRef.myHealth; this.myHealthMax = this.myDataRef.myHealthMax; this.myTactics = this.myDataRef.myTactics; this.myTacticsMax = this.myDataRef.myTacticsMax; this.mySpeed = this.myDataRef.mySpeed * this.myDataRef.modSpeed; this.myAccel = this.myDataRef.myAccel * this.myDataRef.modSpeed; this.myDash = this.myDataRef.myDash; this.myHeight = this.myDataRef.myHeight; this.myWidth = this.myDataRef.myWidth; this.myDepth = this.myDataRef.myDepth; this.myReload = this.myDataRef.myReload; this.myBlood = this.myDataRef.myBlood; this.myTacMod = this.myDataRef.modRecharge; this.meleeHealth = this.myDataRef.meleeHealth; this.refreshArmor(); this.traitBravery = this.myDataRef.traitBravery; this.traitCover = this.myDataRef.traitCover; this.traitDistracted = this.myDataRef.traitDistracted; this.traitTriggerFinger = this.myDataRef.traitTriggerFinger; this.traitCombatSkill = this.myDataRef.traitCombatSkill; }; storedv2.refreshArmor = function () { this.myHeadArmor = 0; this.myBodyArmor = 0; if (this.myDataRef.myHat[0].myArmor != undefined) { this.myHeadArmor += this.myDataRef.myHat[0].myArmor; } if (this.myDataRef.myMask[0].myArmor != undefined) { this.myHeadArmor += this.myDataRef.myMask[0].myArmor; } if (this.myDataRef.myMouth[0].myArmor != undefined) { this.myHeadArmor += this.myDataRef.myMouth[0].myArmor; } if (this.myDataRef.myShirt[0].myArmor != undefined) { this.myBodyArmor += this.myDataRef.myShirt[0].myArmor; } }; storedv2.applyDeath = function () { if (this.myHealth <= 0) { if (!this.amPlayer && this.myDataRef.myBoss == '') { this.myDataRef.myHealth = this.myHealth; } if (this.myDataRef.myBoss != '') { MadnessEvents.bossEvents(this, 'kill_boss'); } if (this.myStatus != 'dead' && this.myStatus.substr(0, 4) != 'axed' && this.wounded < 1 && this.myStatus.substr(0, 4) != 'stun') { if (this.myDataRef.myScale > 2) { this.myHeight *= 1.5; this.myWidth = this.myHeight; } else { if (this.myWidth != this.myHeight) { this.myWidth = this.myHeight; } } if (this.myRoom.amStairs) { this.myStatus = 'dead'; if (this.myFacing == 'right' && this.myRoom.downAngle < 90 || this.myFacing == 'left' && this.myRoom.downAngle >= 90) { this.mySubStatus = '_stairs2'; } else { this.mySubStatus = '_stairs1'; } } else { this.myStatus = 'dead'; this.actionSlowdown = false; } if (this.myDataRef.fastDeath) { this.myDataRef.amSlow = false; } this.intendedTarget = undefined; this.pathFind = false; this.targetLock = false; if (this.myDataRef.myWeapons[this.myWeapon] != undefined) { this.dropGun(); } } } }; storedv2.killMe = function () { if (this.myDataRef.myObjective != undefined) { MadnessLevel.completeObjectiveCheck(this.myDataRef, 'kill'); } while (this.myDataRef.myEvents.length > 0) { if (this.myDataRef.myEvents[0].myType == 'function') { this.myDataRef.myEvents[0].myAction(); } this.myDataRef.myEvents.splice(0, 1); } if (!this.amPlayer) { this.myRoster.removeCharacter(this.myDataRef); } if (!this.myDataRef.noPaint) { MadnessLevel.removeNPC(this._parent.myRoomRef, this.myDataRef); } if (this.myDataRef.myBoss == '') { this.deadMan = true; } }; storedv2.paintMe = function () { this.myTacBar._visible = false; this._parent.drawToBitmap(this, 'bmpBodies'); this.removeMe(); }; storedv2.removeMe = function () { this.myDataRef.mySprite = undefined; this.removeMovieClip(); false; }; storedv2.playerControls = function () { this.moveUp = false; this.moveDown = false; this.moveLeft = false; this.moveRight = false; this.toggleAction = false; this.toggleGuard = false; this.toggleReload = false; this.togglePickup = false; this.toggleSlowmo = false; if (!MadnessTransition.transitionLock) { if (KeyManager.keyCounts.key_up > 0 && KeyManager.keyCounts.key_up > KeyManager.keyCounts.key_down) { this.moveUp = true; } if (KeyManager.keyCounts.key_down > 0 && KeyManager.keyCounts.key_down > KeyManager.keyCounts.key_up) { this.moveDown = true; } if (KeyManager.keyCounts.key_left > 0 && KeyManager.keyCounts.key_left > KeyManager.keyCounts.key_right) { this.moveLeft = true; } if (KeyManager.keyCounts.key_right > 0 && KeyManager.keyCounts.key_right > KeyManager.keyCounts.key_left) { this.moveRight = true; } if (KeyManager.keyCounts.key_action > 0) { this.toggleAction = true; } if (KeyManager.keyCounts.key_guard > 0) { this.toggleGuard = true; } if (KeyManager.keyCounts.key_reload > 0) { this.toggleReload = true; } if (KeyManager.keyCounts.key_pickup > 0) { this.togglePickup = true; } if (KeyManager.keyCounts.key_slowmo > 0) { this.toggleSlowmo = true; } } if (this.myDataRef.myWeapons[this.myWeapon] == undefined || this.rofTimer >= this.myDataRef.myWeapons[this.myWeapon].myROF - 1 || this.rofTimer <= 1) { this.myAimX = this._parent._xmouse; this.myAimY = this._parent._ymouse; } this._parent.playerAim._alpha = 50; var v2 = SwainMath.get_distance2(this._x, this._y - this.myDataRef.myShootHeight * (this._yscale / 100), this._parent._xmouse, this._parent._ymouse); var v4 = 0; if (this.myDataRef.myWeapons[this.myWeapon].myCat == 'smg') { if (MadnessDataFile.havePerk('perkSMGRange', this.myDataRef)) { v4 += 40; } } if (this.myDataRef.myWeapons[this.myWeapon].myCat == 'rifle') { if (MadnessDataFile.havePerk('perkRifleRange1', this.myDataRef)) { v4 += 30; } if (MadnessDataFile.havePerk('perkRifleRange2', this.myDataRef)) { v4 += 30; } } if (this.myDataRef.myWeapons[this.myWeapon] == undefined && v2 > this.myDataRef.myUnarmed.myRange) { v2 = this.myDataRef.myUnarmed.myRange - 10; } else { if (this.myDataRef.myWeapons[this.myWeapon].melee && v2 > this.myDataRef.myWeapons[this.myWeapon].myRange - 10) { v2 = this.myDataRef.myWeapons[this.myWeapon].myRange - 10; } else { if (v2 > this.myDataRef.myWeapons[this.myWeapon].myRange + this.myDataRef.modRange + 45 + v4) { v2 = this.myDataRef.myWeapons[this.myWeapon].myRange + this.myDataRef.modRange + 45 + v4; } } } var v3 = (this.myDataRef.myWeapons[this.myWeapon].mySpread / 30) * 100 * (v2 / 100); if (this.mySpeedRight == 0 && this.mySpeedDown == 0) { if (this.myDataRef.myWeapons[this.myWeapon].myCat == 'rifle' && MadnessDataFile.havePerk('perkRifleAccuracy', this.myDataRef)) { v3 *= 0.3; } if (this.myDataRef.myWeapons[this.myWeapon].myCat == 'pistol') { if (MadnessDataFile.havePerk('perkPistolAccuracy2', this.myDataRef)) { v3 *= 0.3; } else { if (MadnessDataFile.havePerk('perkPistolAccuracy1', this.myDataRef)) { v3 *= 0.6; } } } } this._parent.playerAim._x = SwainMath.get_position(this._x, this._y - this.myDataRef.myShootHeight * (this._yscale / 100), SwainMath.calculate_rotation(this._x, this._y - this.myDataRef.myShootHeight * (this._yscale / 100), this._parent._xmouse, this._parent._ymouse), v2, 'x'); this._parent.playerAim._y = SwainMath.get_position(this._x, this._y - this.myDataRef.myShootHeight * (this._yscale / 100), SwainMath.calculate_rotation(this._x, this._y - this.myDataRef.myShootHeight * (this._yscale / 100), this._parent._xmouse, this._parent._ymouse), v2, 'y'); this._parent.playerAim._rotation = SwainMath.calculate_rotation(this._x, this._y - this.myDataRef.myShootHeight, this._parent.playerAim._x, this._parent.playerAim._y); this._parent.playerAim.aimLine._yscale = v2; if (v3 <= 33 && !this.myDataRef.myWeapons[this.myWeapon].melee && this.myDataRef.myWeapons[this.myWeapon] != undefined) { this._parent.playerAim.aimTarget._xscale = 100 * (v3 / 33); if (this._parent.playerAim.aimTarget._xscale < 50) { this._parent.playerAim.aimTarget._xscale = 50; } this._parent.playerAim.aimTarget._yscale = this._parent.playerAim.aimTarget._xscale; } else { this._parent.playerAim.aimTarget._xscale = 100; this._parent.playerAim.aimTarget._yscale = this._parent.playerAim.aimTarget._xscale; } if (v3 <= 33) { this._parent.playerAim.aimTarget.bracketLine._visible = false; this._parent.playerAim.aimTarget.bracketL._visible = false; this._parent.playerAim.aimTarget.bracketR._visible = false; } else { this._parent.playerAim.aimTarget.bracketLine._xscale = v3; this._parent.playerAim.aimTarget.bracketLine._visible = true; this._parent.playerAim.aimTarget.bracketL._x = -v3 / 2; this._parent.playerAim.aimTarget.bracketL._visible = true; this._parent.playerAim.aimTarget.bracketR._x = v3 / 2; this._parent.playerAim.aimTarget.bracketR._visible = true; } }; storedv2.mouseDown = function () { if (!this._parent.paused && !this.targetLock && !this.mouseLock) { if (this.mouseTimer == -1) { this.mouseTimer = 0; this.mouse2x = false; } else { this.mouse2x = true; } this.mouseClick = true; this.mouseHold = true; } }; storedv2.mouseUp = function () { if (!this._parent.paused) { this.mouseClick = false; this.mouseHold = false; this.mouseReleaseTimer = 0; } if (this.mouseLock) { this.mouseLock = false; } }; storedv2.checkDamage = function (inWeapon, inAttacker, inHitX, inHitY, inRangeGood, inHeadshot) { var v14 = inHeadshot; var v3 = inWeapon.myDamage; if (v14) { if (!MadnessDataFile.havePerk('perkArmorPierce', inAttacker.myDataRef) || MadnessDataFile.havePerk('perkArmorPierce', inAttacker.myDataRef) && this.myDataRef.myHat[0].myWeight == 'heavy') { v3 -= this.myHeadArmor; } } else { if (!MadnessDataFile.havePerk('perkArmorPierce', inAttacker.myDataRef) || MadnessDataFile.havePerk('perkArmorPierce', inAttacker.myDataRef) && this.myDataRef.myShirt[0].myWeight == 'heavy') { v3 -= this.myBodyArmor; } } if (inWeapon.myCat == 'shotgun' && MadnessDataFile.havePerk('perkShotgunDamage', inAttacker.myDataRef) && SwainMath.get_distance(this, inAttacker) < 120) { v3 *= 1.3; } if (v3 < 0) { v3 = 0; } if (this.myRoster == MadnessRoster.playerRoster && MadnessGameSelect.gameMode == 'story') { v3 *= MadnessCharacter.damageDifficultyMod; } if (inWeapon.myType == 'melee') { v3 *= inAttacker.myDataRef.modDmg; } if (!inRangeGood) { v3 *= 0.5; } v3 *= this.myDataRef.modArmor; if (MadnessDataFile.havePerk('perkStunProof1', this.myDataRef) && v3 <= 6) { v3 = 1; } var v16 = 1; if (this.myFacing == 'left') { v16 = -1; } var v4 = new Object(); v4.myAge = 0; var v17 = SwainMath.randomNumber(120, 200) / 100; if (this.myDataRef.amSpecial || inWeapon.myCat == 'melee') { v17 = 1; } v4.myType = inWeapon.myDamageType + '_' + this.myBlood; v4.myVariant = SwainMath.randomNumber(1, 5); v4.myScale = 1 / this.myDataRef.myScale; var v11 = new Object(); v11.x = inHitX; v11.y = inHitY; this._parent.localToGlobal(v11); this.globalToLocal(v11); this.localToGlobal(v11); if (v3 > 0) { this.lastHitTimer = 0; if (v14) { this.myDataRef.headWounds.push(v4); this.mySprite.myHead.globalToLocal(v11); v4.myX = v11.x; v4.myY = v11.y; v4.myRotation = SwainMath.calculate_rotation(v4.myX, v4.myY, 0, 0); } else { this.myDataRef.bodyWounds.push(v4); this.mySprite.myBody.globalToLocal(v11); v4.myX = v11.x; v4.myY = v11.y; v4.myRotation = SwainMath.randomNumber(-110, -80); if (v4.myX < 0) { v4.myRotation += 180; } } if (inWeapon.myCat == 'melee' && inWeapon.myTag != 'Unarmed' && inWeapon.broken == true) { v4.myType = 'hilt_' + this.myBlood; v4.myVariant = inWeapon.myType; if (this.myHealth < 50 && this.myDataRef.myBoss == '') { this.myHealth = 0; v3 = 1; inWeapon.myHealth = 0; } } } if (v3 > 0) { if (v14) { if (MadnessDataFile.havePerk('perkHeadshotCrits', inAttacker.myDataRef)) { v3 *= v17; v4.myDamage = v3; } this.myHealth -= v3; if (this.myHealth <= 0 && !this.myDataRef.bulletEater && (!this.noDamage || this.totalFrameDamage > 0)) { var v15 = SwainMath.randomNumber(-3, v3 / 4); if (v15 > 0) { this.headSpray += v15; } v15 = SwainMath.randomNumber(-1, 1) / 2; if (v15 > 0 && this.headSpray > 0) { this.bodySpray += v15; } if (SwainMath.randomNumber(0, 2) == 0 && !this.myDataRef.bulletEater) { v15 = Math.floor(SwainMath.randomNumber(-2, v3 + this.totalFrameDamage) / 4); if (v15 > 0) { this.headDamage += v15; } } if (this.headDamage > 0) { this.splatterCharacter(this.headDamage, this.myBlood, inAttacker._x > this._x, this._x, this._y - 70, true); } } else { if (inWeapon.myDamageType.substr(0, 6) == 'bullet' && !this.myDataRef.bulletEater && (!this.noDamage || this.totalFrameDamage > 0)) { v4.myType = 'scratch_' + this.myBlood; v4.myVariant = SwainMath.randomNumber(1, 3); if (SwainMath.get_distance2(v4.myX, v4.myY, 0, 0) <= 10) { v4.myRotation = SwainMath.calculate_rotation(inAttacker._x, inAttacker._y - this.myDataRef.myShootHeight * (this._yscale / 100), inHitX, inHitY) * v16; } } } } else { this.myHealth -= v3; v4.myDamage = v3; if (this.myHealth < this.myHealthMax * 0.5 && !this.myDataRef.bulletEater && (!this.noDamage || this.totalFrameDamage > 0)) { var v15 = SwainMath.randomNumber(-3, (v3 + this.totalFrameDamage) / 4); if (v15 > 0) { this.bodySpray += v15; } v15 = SwainMath.randomNumber(-1, 1) / 2; if (v15 > 0 && this.bodySpray > 0) { this.headSpray += v15; } } if (this.myHealth <= 0 && (!this.noDamage || this.totalFrameDamage > 0)) { if (SwainMath.randomNumber(0, 2) == 0 && !this.myDataRef.bulletEater) { v15 = Math.floor(SwainMath.randomNumber(-2, v3) / 4); if (v15 > 0) { this.bodyDamage += v15; } } if (this.bodyDamage > 0) { this.splatterCharacter(this.bodyDamage, this.myBlood, inAttacker._x > this._x, this._x, this._y - 70, false); } } else { if (!inRangeGood && !this.myDataRef.bulletEater && !this.noDamage) { v4.myType = 'fleck_' + this.myBlood; v4.myVariant = SwainMath.randomNumber(1, 5); } } } if (!this.noDamage && inWeapon.myType != 'unarmed') { if (v3 < 10) { this._parent.createEffect(inHitX, inHitY, 'blood' + String(SwainMath.randomNumber(1, 3)) + '_' + this.myBlood, 60, 110, SwainMath.calculate_rotation(inHitX, inHitY, inAttacker._x, inAttacker._y - this.myDataRef.myShootHeight * (this._yscale / 100))); } else { this._parent.createEffect(inHitX, inHitY, 'blood' + String(SwainMath.randomNumber(4, 6)) + '_' + this.myBlood, 60, 110, SwainMath.calculate_rotation(inHitX, inHitY, inAttacker._x, inAttacker._y - this.myDataRef.myShootHeight * (this._yscale / 100))); } var v7 = 0; while (v7 < SwainMath.randomNumber(2, v3 / 3)) { inAttacker.makeSparks(inHitX, inHitY, this._y, 'drops_' + this.myDataRef.myBlood); ++v7; } } if (this.myDataRef.bulletEater && !this.noDamage) { if (SwainMath.randomNumber(1, v3 / 4) >= 4 & SwainMath.randomNumber(0, 2) != 0) { this.splatterCharacter(v3 / 5, this.myBlood, inAttacker._x > this._x, inHitX, inHitY, false); } if (v4.myType.substr(0, 4) != 'hilt' && v4.myType.substr(0, 5) != 'punch' && v4.myType.substr(0, 5) != 'blunt' && v4.myType.substr(0, 5) != 'blade') { if (SwainMath.randomNumber(0, 1) == 0) { v4.myType = 'bullet_' + this.myBlood; v4.myVariant = SwainMath.randomNumber(1, 5); } else { if (SwainMath.randomNumber(0, 1) == 0) { v4.myType = 'fleck_' + this.myBlood; v4.myVariant = SwainMath.randomNumber(1, 5); } else { v4.myType = 'scratch_' + this.myBlood; v4.myVariant = SwainMath.randomNumber(1, 3); } } } if (v14) { if (this.myHealth < this.myHealthMax / 1.7 && SwainMath.randomNumber(-this.myHealthMax / 9, v3) > 0) { ++this.headDamage; } if (SwainMath.randomNumber(0, this.myHealthMax / 50) == 0) { ++this.headSpray; } } else { if (this.myHealth < this.myHealthMax / 1.7 && SwainMath.randomNumber(-this.myHealthMax / 9, v3) > 0) { ++this.bodyDamage; } if (SwainMath.randomNumber(0, this.myHealthMax / 50) == 0) { ++this.bodySpray; } } } } if (v3 <= 0) { if (inWeapon.melee) { if (inWeapon.myDamageType != 'punch') { this.playSound('blockmelee'); } else { this.playSound('blockmelee'); } } else { this.playSound('ricochet'); } } else { if (inWeapon.myDamageType == 'blade') { this.playSound('slash'); } if (inWeapon.myDamageType == 'blunt' || inWeapon.myDamageType == 'punch') { this.playSound('blunt'); } } if (this.myHealth <= 0) { if ((this.headDamage >= 2 || this.bodyDamage >= 3) && !this.amInjured) { this.playSound('injury'); this.amInjured = true; } } if (this.headSpray >= 4) { this.headSpray = 4; } if (this.bodySpray >= 4) { this.bodySpray = 4; } if (this.headDamage >= 4) { this.headDamage = 4; this.mySprite.myHead.myHat._visible = false; this.mySprite.myHead.myHat2._visible = false; this.mySprite.myHead.myMouth._visible = false; this.mySprite.myHead.myMask._visible = false; } if (this.bodyDamage >= 4) { this.bodyDamage = 4; } if (this.headDamage > 3 && !this.myDataRef.bulletEater) { MadnessCharacter.clearWounds(this, 'head'); } if (this.bodyDamage > 3 && !this.myDataRef.bulletEater) { MadnessCharacter.clearWounds(this, 'body'); } this.myDataRef.headSpray = this.headSpray; this.myDataRef.bodySpray = this.bodySpray; this.mySprite.myHead.headSprite.gotoAndStop(1 + this.headDamage * 5); this.mySprite.myBody.bodySprite.gotoAndStop(1 + this.bodyDamage * 5); var v6 = 0; while (v6 < this.headSpray) { this.mySprite.myHead.headSprite.nextFrame(); ++v6; } v6 = 0; while (v6 < this.bodySpray) { this.mySprite.myBody.bodySprite.nextFrame(); ++v6; } if (v3 > 0 && this.myHealth > 0 && this.rofTimer > 5 && !this.myDataRef.bulletEater && this.myStatus != 'knockback' && !MadnessDataFile.havePerk('perkStunProof2', this.myDataRef) && !(MadnessDataFile.havePerk('perkStunProof1', this.myDataRef) && v3 < 20)) { this.mySprite.gotoAndStop('idle'); this.myStatus = 'stun' + SwainMath.randomNumber(1, 7); this.mySprite.gotoAndStop(this.myStatus); } if (this.myHealth > 0 && inAttacker.myStatus.substr(0, 10) == 'melee_dash' && (this.myDataRef.weakToDash || MadnessDataFile.havePerk('perkStunDash1', inAttacker.myDataRef) && inAttacker.myDataRef.myScale >= this.myDataRef.myScale) && this.myStatus != 'knockback') { this.mySprite.gotoAndStop('idle'); this.myStatus = 'stun_dash'; this.mySprite.gotoAndStop(this.myStatus); } if (inWeapon.melee && this.meleeHealth > 0) { this.meleeHealthHit(inAttacker, inWeapon); } MadnessCharacter.checkWounds(this); if (this.myRoster == MadnessRoster.playerRoster) { _root.gameMenu.refreshPics(); } if (this.myDataRef.amSpecial && this.myHealth > 0 && v3 > 0) { this.myTactics = this.myTacticsMax; this.tacTimer = 0; } this.totalFrameDamage += v3; if (this.myStatus == 'dead' && this.mySpeedRight != 0) { this.mySpeedRight *= 1.3; } if (this.myHealth <= 0 && !this.noDamage) { this.noDamage = true; if (v14) { if (SwainMath.randomNumber(-2, Math.floor(this.totalFrameDamage / 7)) <= 0 && this.mySubStatus.substr(0, 4) != '_fly' && this.myStatus != 'knockback') { this.mySpeedRight = 0; if (SwainMath.randomNumber(0, 4) == 0 && this.headDamage <= 2 && this.mySubStatus.substr(0, 8) != '_stagger') { this.mySubStatus = '_stagger' + SwainMath.randomNumber(3, 4); this.noDamage = false; } else { var v13 = this._parent.myRooms[0]; var v12 = this._parent.myRooms[this._parent.myRooms.length - 1]; if (this._x < v13.myDL._x + (v13.myUL._x - v13.myDL._x) * ((this._y - v13.myUL._y) / (v13.myDL._y - v13.myUL._y)) + 60 && inAttacker._x > this._x && this.myFacing == 'right' || this._x > v12.myUR._x + (v12.myDR._x - v12.myUR._x) * ((this._y - v12.myUR._y) / (v12.myDR._y - v12.myUR._y)) - 60 && inAttacker._x < this._x && this.myFacing == 'left') { this.mySubStatus = '_wall1'; } else { this.mySubStatus = '_head' + SwainMath.randomNumber(1, 2); } } } else { if (!this.enemyInFront(inAttacker) && this.myStatus != 'knockback') { this.mySubStatus = '_trip1'; } else { this.mySubStatus = '_fly' + SwainMath.randomNumber(3, 4); } if (inAttacker._x > this._x) { this.mySpeedRight -= 2 + SwainMath.randomNumber(this.totalFrameDamage / 15, this.totalFrameDamage / 9); } else { this.mySpeedRight += 2 + SwainMath.randomNumber(this.totalFrameDamage / 15, this.totalFrameDamage / 9); } } } else { if (this.mySubStatus.substr(0, 8) != '_stagger' || this.bodyDamage > 0) { if (SwainMath.randomNumber(-2, Math.ceil(this.totalFrameDamage / 7)) <= 0 && this.bodyDamage == 0 && this.mySubStatus.substr(0, 4) != '_fly' && this.myStatus != 'knockback') { this.mySpeedRight = 0; if (SwainMath.randomNumber(0, 2) > 0) { this.mySubStatus = '_body' + SwainMath.randomNumber(1, 2); } else { this.mySubStatus = '_stagger' + SwainMath.randomNumber(0, 2); this.noDamage = false; } } else { if (this._y - inHitY <= 25) { if (this.enemyInFront(inAttacker)) { this.mySubStatus = '_trip1'; } else { this.mySubStatus = '_fly' + SwainMath.randomNumber(3, 4); } } else { var v13 = this._parent.myRooms[0]; var v12 = this._parent.myRooms[this._parent.myRooms.length - 1]; if (this._x < v13.myDL._x + (v13.myUL._x - v13.myDL._x) * ((this._y - v13.myUL._y) / (v13.myDL._y - v13.myUL._y)) + 120 && inAttacker._x > this._x && this.myFacing == 'right' || this._x > v12.myUR._x + (v12.myDR._x - v12.myUR._x) * ((this._y - v12.myUR._y) / (v12.myDR._y - v12.myUR._y)) - 120 && inAttacker._x < this._x && this.myFacing == 'left') { this.mySubStatus = '_wall2'; } else { this.mySubStatus = '_fly' + SwainMath.randomNumber(1, 2); } } if (inAttacker._x > this._x) { this.mySpeedRight -= 3 + SwainMath.randomNumber(this.totalFrameDamage / 13, this.totalFrameDamage / 8); } else { this.mySpeedRight += 3 + SwainMath.randomNumber(this.totalFrameDamage / 13, this.totalFrameDamage / 8); } } } else {} } this.myStatus = 'idle'; this.applyDeath(); } }; storedv1.clearWounds = function (inChar, inCategory) { var v1 = new Number(); if (inCategory == 'head') { while (inChar.mySprite.myHead.myPart['wound' + String(v1)] != undefined) { inChar.mySprite.myHead.myPart['wound' + String(v1)].removeMovieClip(); ++v1; } } else { while (inChar.mySprite.myBody.myPart['wound' + String(v1)] != undefined) { inChar.mySprite.myBody.myPart['wound' + String(v1)].removeMovieClip(); ++v1; } } }; storedv1.checkWounds = function (inChar) { var v2 = 0; while (v2 < inChar.myDataRef.bodyWounds.length) { if (inChar.mySprite.myBody.myPart['wound' + String(v2)] == undefined) { inChar.mySprite.myBody.myPart.attachMovie('madness_wound', 'wound' + String(v2), inChar.mySprite.myBody.myPart.getNextHighestDepth()); inChar.mySprite.myBody.myPart['wound' + String(v2)]._x = inChar.myDataRef.bodyWounds[v2].myX; inChar.mySprite.myBody.myPart['wound' + String(v2)]._y = inChar.myDataRef.bodyWounds[v2].myY; inChar.mySprite.myBody.myPart['wound' + String(v2)]._rotation = inChar.myDataRef.bodyWounds[v2].myRotation; inChar.mySprite.myBody.myPart['wound' + String(v2)].gotoAndStop(inChar.myDataRef.bodyWounds[v2].myType); inChar.mySprite.myBody.myPart['wound' + String(v2)].myWound.gotoAndStop(inChar.myDataRef.bodyWounds[v2].myVariant); inChar.mySprite.myBody.myPart['wound' + String(v2)]._xscale *= inChar.myDataRef.bodyWounds[v2].myScale; inChar.mySprite.myBody.myPart['wound' + String(v2)]._yscale *= inChar.myDataRef.bodyWounds[v2].myScale; } else {} ++v2; } if (inChar.headDamage <= 3) { v2 = 0; while (v2 < inChar.myDataRef.headWounds.length) { if (inChar.mySprite.myHead.myPart['wound' + String(v2)] == undefined) { inChar.mySprite.myHead.myPart.attachMovie('madness_wound', 'wound' + String(v2), inChar.mySprite.myHead.myPart.getNextHighestDepth()); inChar.mySprite.myHead.myPart['wound' + String(v2)]._x = inChar.myDataRef.headWounds[v2].myX; inChar.mySprite.myHead.myPart['wound' + String(v2)]._y = inChar.myDataRef.headWounds[v2].myY; inChar.mySprite.myHead.myPart['wound' + String(v2)]._rotation = inChar.myDataRef.headWounds[v2].myRotation; inChar.mySprite.myHead.myPart['wound' + String(v2)].gotoAndStop(inChar.myDataRef.headWounds[v2].myType); inChar.mySprite.myHead.myPart['wound' + String(v2)].myWound.gotoAndStop(inChar.myDataRef.headWounds[v2].myVariant); inChar.mySprite.myHead.myPart['wound' + String(v2)]._xscale *= inChar.myDataRef.headWounds[v2].myScale; inChar.mySprite.myHead.myPart['wound' + String(v2)]._yscale *= inChar.myDataRef.headWounds[v2].myScale; } else {} ++v2; } } }; goto 62250; label 62245: goto 80043; label 62250: storedv2.checkAttackHit = function (inMeleeDir, inMeleeType, inWeapon) { this.bulletCheckDistance = SwainMath.randomNumber(3, 7); var v9; var v21; var v20; var v7 = new Number(); this.targetsHit = new Array(); this.targetsTac = new Array(); this.myBlasts = new Array(); var v2 = inWeapon; var v25 = v2.myShots; if (v2.myCat == 'shotgun' && MadnessDataFile.havePerk('perkShotgunShots1', this.myDataRef)) { ++v25; } if (v2.myCat == 'shotgun' && MadnessDataFile.havePerk('perkShotgunShots2', this.myDataRef)) { ++v25; } var v22 = 0; while (v22 < v25) { if (!v2.melee) { this.bulletRotation = SwainMath.randomNumber(-v2.mySpread * 100, v2.mySpread * 100) / 100; } else { this.bulletRotation = SwainMath.randomNumber(-600, 600) / 100; } if (this.aimTimer == 0) { this.bulletRotation = 0; } if (this.mySpeedRight == 0 && this.mySpeedDown == 0 && (v2.myCat == 'pistol' || v2.myCat == 'revolver')) { if (MadnessDataFile.havePerk('perkPistolAccuracy2', this.myDataRef)) { this.bulletRotation *= 0.3; } else { if (MadnessDataFile.havePerk('perkPistolAccuracy1', this.myDataRef)) { this.bulletRotation *= 0.6; } } } var v12 = new Number(); if (v2.myCat == 'smg') { this.bulletRotation *= this.smgAimTimer; if (MadnessDataFile.havePerk('perkSMGRange', this.myDataRef)) { v12 += 40; } } if (v2.myCat == 'rifle') { if (MadnessDataFile.havePerk('perkRifleAccuracy', this.myDataRef) && this.mySpeedRight == 0 && this.mySpeedDown == 0) { this.bulletRotation *= 0.3; } if (MadnessDataFile.havePerk('perkRifleRange1', this.myDataRef)) { v12 += 30; } if (MadnessDataFile.havePerk('perkRifleRange2', this.myDataRef)) { v12 += 30; } } var v3 = new Object(); if (v2.melee) { if (this.myFacing == 'left') { this.targetX = this._x + 10; } else { this.targetX = this._x - 10; } this.targetY = this._y - this.myDataRef.myShootHeight * (this._yscale / 100); } else { v3.x = 0; v3.y = 0; if (this.myAimX >= this._x) { this.mySprite.handShoot_front.myGun.myShootPoint.localToGlobal(v3); } if (this.myAimX <= this._x) { this.mySprite.handShoot_back.myGun.myShootPoint.localToGlobal(v3); } this._parent.globalToLocal(v3); this.targetX = v3.x; this.targetY = v3.y; } var v16 = 1; if (inMeleeDir == '') { v21 = 700; v20 = 400; } else { v21 = v2.myRange * this.myDataRef.myScale; v20 = 100; } if (inMeleeDir == 'verylow') { this.myAimX = SwainMath.get_position(this._x, this._y - this.myDataRef.myShootHeight * (this._yscale / 100) * v16, 170, v2.myRange * this.myDataRef.myScale, 'x'); this.myAimY = SwainMath.get_position(this._x, this._y - this.myDataRef.myShootHeight * (this._yscale / 100) * v16, 100, v2.myRange * this.myDataRef.myScale, 'y'); } else { if (inMeleeDir == 'low' || this.myDataRef.myScale > 1 && v2.melee) { this.myAimX = SwainMath.get_position(this._x, this._y - this.myDataRef.myShootHeight * (this._yscale / 100) * v16, 80 + 30 * this.myDataRef.myScale, v2.myRange * this.myDataRef.myScale, 'x'); this.myAimY = SwainMath.get_position(this._x, this._y - this.myDataRef.myShootHeight * (this._yscale / 100) * v16, 100, v2.myRange * this.myDataRef.myScale, 'y'); } else { if (inMeleeDir == 'mid') { this.myAimX = SwainMath.get_position(this._x, this._y - this.myDataRef.myShootHeight * (this._yscale / 100) * v16, 90, v2.myRange * this.myDataRef.myScale, 'x'); this.myAimY = SwainMath.get_position(this._x, this._y - this.myDataRef.myShootHeight * (this._yscale / 100) * v16, 90, v2.myRange * this.myDataRef.myScale, 'y'); } else { if (inMeleeDir == 'high') { this.myAimX = SwainMath.get_position(this._x, this._y - this.myDataRef.myShootHeight * (this._yscale / 100) * v16, 80, v2.myRange * this.myDataRef.myScale, 'x'); this.myAimY = SwainMath.get_position(this._x, this._y - this.myDataRef.myShootHeight * (this._yscale / 100) * v16, 80, v2.myRange * this.myDataRef.myScale, 'y'); } } } } if (inMeleeDir != '' && this.myFacing == 'left') { this.myAimX = this._x - (this.myAimX - this._x); } this.advanceX = SwainMath.get_position(this.targetX, this.targetY, this.bulletRotation + SwainMath.calculate_rotation(this._x, this._y - this.myDataRef.myShootHeight * (this._yscale / 100) * v16, this.myAimX, this.myAimY), this.bulletCheckDistance, 'x') - this.targetX; this.advanceY = SwainMath.get_position(this.targetX, this.targetY, this.bulletRotation + SwainMath.calculate_rotation(this._x, this._y - this.myDataRef.myShootHeight * (this._yscale / 100) * v16, this.myAimX, this.myAimY), this.bulletCheckDistance, 'y') - this.targetY; var v17 = 0; while (v17 < 5) { this.targetX += this.advanceX; this.targetY += this.advanceY; ++v17; } v9 = false; var v18 = 75; var v5; for (;;) { if (!(!v9 && this.targetX < this._x + v21 && this.targetX > this._x - v21 && this.targetY < this._y + v20 && this.targetY > -v20)) break; if (this._parent.bulletWallHit(this.targetX, this.targetY + v18 + SwainMath.randomNumber(-5, 5)) && SwainMath.randomNumber(0, v2.mySpread / 2) == 0) { if (!inWeapon.melee) { v3.x = this.targetX; v3.y = this.targetY; this._parent.localToGlobal(v3); var v15; v15 = 0; while (v15 < MadnessDoors.allDoors.length) { if (MadnessDoors.allDoors[v15].noBullet.hitTest(v3.x, v3.y, true)) { break; } ++v15; } if (v15 == MadnessDoors.allDoors.length) { this._parent.createSplat(this.targetX, this.targetY, 'bullet_' + SwainMath.randomNumber(1, 3), SwainMath.calculate_rotation(this._x, this._y, this.targetX, this.targetY)); } } else { if (this.myDataRef.myWeapons[this.myWeapon] != undefined) { this.playSound('blockmelee'); this.myStatus = 'stun_parry' + SwainMath.randomNumber(1, 2); } } var v11 = 0; while (v11 < SwainMath.randomNumber(2, this.myDataRef.myWeapons[this.myWeapon].myDamage / 5)) { this.makeSparks(this.targetX, this.targetY, this.targetY + v18, 'sparks'); ++v11; } this.targetX -= this.advanceX; this.targetY -= this.advanceY; v9 = true; break; } else { if (this._parent.bulletFloorHit(this.targetX, this.targetY)) { this.targetX -= this.advanceX; this.targetY -= this.advanceY; v9 = true; break; } } if (SwainMath.randomNumber(0, 2) > 0 && !v2.melee && v2 != undefined) { var v4; var v10 = 0; while (v10 < MadnessObstacle.allObstacles.length) { v4 = MadnessObstacle.allObstacles[v10]; if (!v4.destroyed && v4.inUse && v4.inUse.myRoster != this.myRoster) { if (v4.inUse.rofTimer >= v4.inUse.myDataRef.myWeapons[v4.inUse.myWeapon].myROF) { if (v4.myHit.hitTest(this.targetX + this._parent._x, this.targetY + this._parent._y)) { v4.hurtMe(v2.myDamage); v4.createSplat(this.targetX - v4._x, this.targetY - v4._y, 'bullet_' + SwainMath.randomNumber(1, 3), SwainMath.randomNumber(1, 5), SwainMath.calculate_rotation(this._x, this._y, this.targetX, this.targetY)); var v11 = 0; while (v11 < SwainMath.randomNumber(2, this.myDataRef.myWeapons[this.myWeapon].myDamage / 5)) { this.makeSparks(this.targetX, this.targetY, v4._y, 'sparks'); ++v11; } v9 = true; break; } } } ++v10; } } var v13 = false; v10 = 0; while (v10 < MadnessCharacter.allRosters.length) { if (MadnessCharacter.allRosters[v10].teamFaction != this.myFaction) { v11 = 0; while (v11 < MadnessCharacter.allRosters[v10].myActiveMembers.length) { this.targetEnemy = MadnessCharacter.allRosters[v10].myActiveMembers[v11].mySprite; if (this.targetEnemy != undefined && !this.targetEnemy.amDodging) { var v6; v6 = 0; while (v6 < this.targetsTac.length) { if (this.targetsTac[v6] == this.targetEnemy) { break; } ++v6; } if (v6 == this.targetsTac.length) { if (this._x < this.targetEnemy._x && this.myAimX >= this._x || this._x > this.targetEnemy._x && this.myAimX <= this._x) { if (!v2.melee || v2.melee && this.inMeleeRange(this.targetEnemy)) { if (SwainMath.randomNumber(1, this.targetEnemy.myDataRef.myScale) == 1 && this.targetEnemy.myStatus != 'knockback') { if (!this.targetEnemy.deadMan) { if (this.targetX < this.targetEnemy._x + this.targetEnemy.myHeight * (this.targetEnemy._yscale / 100) && this.targetX > this.targetEnemy._x - this.targetEnemy.myHeight * (this.targetEnemy._yscale / 100)) { if (this.targetY < this.targetEnemy._y && this.targetY > this.targetEnemy._y - this.targetEnemy.myHeight * (this.targetEnemy._yscale / 100)) { v3.x = this.targetX; v3.y = this.targetY; this._parent.localToGlobal(v3); if ((this.targetEnemy.headDamage <= 3 && !this.targetEnemy.myDataRef.bulletEater || this.targetEnemy.myDataRef.bulletEater) && this.targetEnemy.mySprite.myHead.myHit.hitTest(v3.x, v3.y, true)) { v13 = true; } if (v13 || this.targetEnemy.mySprite.myBody.myHit.hitTest(v3.x, v3.y, true)) { if (v2.melee) { this.intendedX = this.targetEnemy._x; this.intendedY = this.targetEnemy._y; this.targetApproach = true; if (this.myFacing == 'right') { this.intendedX -= v2.myRange * this.myDataRef.myScale - 40; } else { this.intendedX += v2.myRange * this.myDataRef.myScale - 40; } } v5 = 2; if (MadnessDataFile.havePerk('perkPistolEffectiveness', this.myDataRef) && (v2.myCat == 'pistol' || v2.myCat == 'revolver') || MadnessDataFile.havePerk('perkRifleEffectiveness', this.myDataRef) && v2.myCat == 'rifle') { v5 -= 1; } if (v2.upgradeLaser) { v5 -= 1; } if (v2.upgradeSight) { v5 -= 1; } if (v7 > v2.myRange * this.myDataRef.myScale + this.myDataRef.modRange + v12) { v5 += Math.ceil((v7 - (v2.myRange * this.myDataRef.myScale + this.myDataRef.modRange + v12)) / 45); } if (v5 < 0) { v5 = 0; } if (!this.myDataRef.noRange && this.aimTimer == -1 && !v2.melee && v7 > v2.myRange * this.myDataRef.myScale + this.myDataRef.modRange + v12 && SwainMath.randomNumber(0, v5) > 1) { this.targetsTac.push(this.targetEnemy); } else { if (this.amBlocking(this.targetEnemy, this, v2) && !((MadnessDataFile.havePerk('perkBlockBreak', this.myDataRef) || this.myDataRef.autoHit) && v2.melee)) { if (MadnessDataFile.havePerk('perkBlock2', this.targetEnemy.myDataRef) && !v2.melee) { this.targetEnemy.checkAttackHit('', '', v2); this.targetEnemy.deflectBullet(this, this.targetX + this.advanceX, this.targetY + this.advanceY, v2); this._parent.makeBullet(this.targetEnemy, this.targetEnemy.myBlasts[0].myRot, this.targetEnemy.myBlasts[0].myLength, this.targetEnemy.myBlasts[0].myX, this.targetEnemy.myBlasts[0].myY, this.targetX, this.targetY); } else { this.targetEnemy.blockBullet(this, this.targetX + this.advanceX, this.targetY + this.advanceY, v2); } if (MadnessDataFile.havePerk('perkMeleeDisarm', this.targetEnemy.myDataRef) && this.targetEnemy.actionTimer < 10 && v2.melee && v2.myType != 'unarmed') { trace('Disarm! ' + this.targetEnemy.actionTimer); this.myStatus = 'stun_parry' + SwainMath.randomNumber(1, 2); this.mySprite.gotoAndStop(this.myStatus); this.disarmGun(); } this.targetEnemy.blockReset(); this.targetEnemy.hitTactics(v2, this, true, false, v7 <= v2.myRange * this.myDataRef.myScale + this.myDataRef.modRange); this.damageMelee(v2); this.targetEnemy.damageMelee(this.targetEnemy.myDataRef.myWeapons[this.targetEnemy.myWeapon]); if (this.aimTimer == 0 && this.targetEnemy.myHealth > 0) { this.targetEnemy.myStatus = 'stun_parry' + SwainMath.randomNumber(1, 2); if (this.myTactics <= 0) { this.targetEnemy.disarmGun(); } } if (this.targetEnemy.myTactics == 0) { this.targetEnemy.myStatus = 'stun_parry' + SwainMath.randomNumber(1, 2); } if (v2.melee && v2.myDamageType != 'punch') { this.playSound('blockmelee'); } else { if (v2.myDamageType == 'punch') { this.playSound('blunt'); } else { this.playSound('ricochet'); } } v9 = true; break; } else { if (this.aimTimer == -1 && this.targetEnemy.myTactics > 0 && (!this.myDataRef.autoHit || !v2.melee) && !this.myDataRef.amSurprised) { this.targetEnemy.hitTactics(v2, this, false, false, v7 <= v2.myRange * this.myDataRef.myScale + this.myDataRef.modRange); this.targetsTac.push(this.targetEnemy); } else { var v14 = false; if (this.targetEnemy.myHealth > 0) { v14 = true; } MadnessCharacter.adjustSprite(this.targetEnemy); this.targetEnemy.checkDamage(v2, this, this.targetX + this.advanceX, this.targetY + this.advanceY, v7 <= v2.myRange + this.myDataRef.modRange || v2.melee || this.myDataRef.autoHit, v13); if (v14 && this.targetEnemy.myHealth <= 0) { MadnessGameSelect.appropriateXP(this.myDataRef, this.targetEnemy.myDataRef, 'attack'); } this.targetsHit.push(this.targetEnemy); this.damageMelee(v2); var v8 = 22; if (MadnessDataFile.havePerk('perkStunDash2', this.myDataRef) && this.myStatus.substr(0, 10) == 'melee_dash') { v8 = 0; } else { if (MadnessDataFile.havePerk('perkKnockdown2', this.myDataRef) && this.myStatus.substr(0, 10) != 'melee_dash') { v8 = 2; } else { if (MadnessDataFile.havePerk('perkKnockdown1', this.myDataRef) && this.myStatus.substr(0, 10) != 'melee_dash') { v8 = 6; } } } if (this.aimTimer == 0 || v2.melee && !this.targetEnemy.noDamage && ((v2.myDamageType == 'blunt' || v2.myDamageType == 'punch') && SwainMath.randomNumber(0, v8) == 0 && this.myDataRef.myScale == this.targetEnemy.myDataRef.myScale || this.myDataRef.myScale > this.targetEnemy.myDataRef.myScale)) { this.targetEnemy.applyKnockback(this, this.myDataRef.statSTR / 2, false); } v9 = true; break; } } } } } } } } } } } } ++v11; } } if (v9) { break; } ++v10; } if (!v9) { this.targetX += this.advanceX; this.targetY += this.advanceY; } v7 += this.bulletCheckDistance; } if (inMeleeDir == '') { var v23 = new Object(); this.myBlasts.push(v23); this.myBlasts[this.myBlasts.length - 1].myX = this.targetX; this.myBlasts[v22].myY = this.targetY; this.myBlasts[this.myBlasts.length - 1].myRot = this.bulletRotation; this.myBlasts[this.myBlasts.length - 1].myLength = SwainMath.get_distance2(this._x, this._y - this.myDataRef.myShootHeight * (this._yscale / 100) * v16, this.targetX, this.targetY); } ++v22; } }; storedv2.checkMeleeHit = function (hitType, hitHeight) { var v2 = this.myDataRef.myWeapons[this.myWeapon]; if (hitType == 'unarmed') { v2 = this.myDataRef.myUnarmed; } this.checkAttackHit(hitHeight, hitType, v2); }; storedv2.clearLockedAction = function (inAction) { if (inAction == 'execute') { this.interactTarget._visible = true; if (this.myFacing == 'right') { this._x += this.mySprite.spawn_player._x + this.mySprite._x; } else { this._x -= this.mySprite.spawn_player._x + this.mySprite._x; } this._y += this.mySprite.spawn_player._y + this.mySprite._y; } this.myStatus = 'idle'; this.interactType = ''; this.interactTarget = undefined; this.targetLock = false; }; storedv2.inputAllowed = function () { if (this.myStatus.substr(0, 4) == 'dead' || this.myStatus.substr(0, 5) == 'dying' || this.doorLock || this.targetLock) { return false; } else { return true; } }; storedv2.amBlocking = function (inTarget, inAttacker, thisWeapon) { return inTarget.blocking && (thisWeapon.melee || MadnessDataFile.havePerk('perkBlock1', inTarget.myDataRef)) && ((inTarget.myFacing == 'right' && !inTarget.facingOpposite || inTarget.myFacing == 'left' && inTarget.facingOpposite) && inTarget._x < inAttacker._x || (inTarget.myFacing == 'left' && !inTarget.facingOpposite || inTarget.myFacing == 'right' && inTarget.facingOpposite) && inTarget._x > inAttacker._x); }; storedv2.blockReset = function () { this.actionTimer = 1; this.recoilTimer = 14; MadnessCharacter.makeSpritePart(this, this.mySprite.handNone_front, 'Melee - Block' + String(SwainMath.randomNumber(2, 6))); }; storedv2.blockBullet = function (inSource, inX, inY, inWeapon) { var v2 = 0; while (v2 < SwainMath.randomNumber(2, 5)) { inSource.makeSparks(inX, inY, this._y, 'sparks'); ++v2; } if (!inWeapon.melee) { var v6; if (this.myFacing == 'left' && !this.facingOpposite || this.myFacing == 'right' && this.facingOpposite) { v6 = -1; } else { v6 = 1; } var v7 = SwainMath.randomNumber(-800, 800) / 100; this._parent.createParticle(inSource.myDataRef.myWeapons[inSource.myWeapon].myCasing, 'bullet', inX, inY, (SwainMath.randomNumber(-50, -10) / 10) * -v6, SwainMath.randomNumber(-150, -50) / 10, 90 * v6, SwainMath.randomNumber(-900, 900) / 10, 0.7, this._y + v7, 100, this._yscale * v6, true, 90); } }; storedv2.deflectBullet = function (inSource, inX, inY, inWeapon) { var v2 = 0; while (v2 < SwainMath.randomNumber(2, 5)) { inSource.makeSparks(inX, inY, this._y, 'sparks'); ++v2; } }; storedv2.makeSparks = function (inX, inY, inFloor, inSparkCat) { var v2; if (this.myFacing == 'left' && !this.facingOpposite || this.myFacing == 'right' && this.facingOpposite) { v2 = -1; } else { v2 = 1; } var v3 = SwainMath.randomNumber(-800, 800) / 100; this._parent.createParticle('spark' + SwainMath.randomNumber(1, 2), inSparkCat, inX, inY, (SwainMath.randomNumber(-70, -20) / 10) * v2, SwainMath.randomNumber(-200, -50) / 10, SwainMath.randomNumber(-180, 180), SwainMath.randomNumber(-900, 900) / 10, 0.7, inFloor + v3, 100, 100, false, 90); }; storedv2.ejectShell = function () { var v2; if (this.myFacing == 'left' && !this.facingOpposite || this.myFacing == 'right' && this.facingOpposite) { v2 = -1; } else { v2 = 1; } var v3 = SwainMath.randomNumber(-800, 800) / 100; this._parent.createParticle(this.myDataRef.myWeapons[this.myWeapon].myCasing, 'casing', this._x + 28 * v2, SwainMath.get_position(this._x, this._y - this.myDataRef.myShootHeight * (this._yscale / 100), SwainMath.calculate_rotation(this._x, this._y - this.myDataRef.myShootHeight * (this._yscale / 100), this.myAimX, this.myAimY), 35, 'y'), (SwainMath.randomNumber(-60, -30) / 10) * v2, SwainMath.randomNumber(-250, -150) / 10, SwainMath.calculate_rotation(this._x, this._y - this.myDataRef.myShootHeight * (this._yscale / 100), this.myAimX, this.myAimY), SwainMath.randomNumber(-900, 900) / 10, 0.7, this._y + v3, 100, this._yscale * v2, true, 90); }; storedv2.ejectClip = function () { var v2; if (this.myFacing == 'left' && !this.facingOpposite || this.myFacing == 'right' && this.facingOpposite) { v2 = -1; } else { v2 = 1; } var v3 = SwainMath.randomNumber(0, 500) / 100; this._parent.createParticle(this.myDataRef.myWeapons[this.myWeapon].myType, 'clip', this._x + 27 * v2, SwainMath.get_position(this._x, this._y - this.myDataRef.myShootHeight * (this._yscale / 100), SwainMath.calculate_rotation(this._x, this._y - this.myDataRef.myShootHeight, this.myAimX, this.myAimY), 35, 'y'), (SwainMath.randomNumber(-10, 10) / 10) * v2, 0, SwainMath.randomNumber(-50, 50) / 10, SwainMath.randomNumber(-40, 40) / 10, 0.6, this._y + v3, 100, this._yscale * v2, true, 90); }; storedv2.dropGun = function () { if (this.myDataRef.myWeapons[this.myWeapon] != undefined) { var v2; if (this.myFacing == 'left' && !this.facingOpposite || this.myFacing == 'right' && this.facingOpposite) { v2 = -1; } else { v2 = 1; } var v3 = SwainMath.randomNumber(-300, 300) / 100; this._parent.createParticle(this.myDataRef.myWeapons[this.myWeapon].myType, 'gun', this._x + 20 * v2, this._y - 40 * this.myDataRef.myScale, (SwainMath.randomNumber(-10, 10) / 10) * v2 + this.mySpeedRight * SwainMath.randomNumber(50, 120) / 100, 0, -90 * v2 + SwainMath.randomNumber(-100, 100) / 10, SwainMath.randomNumber(-14, 14) / 10, 0.5, this._y + v3, 100, this._yscale * v2, true, 90, this.myDataRef.myWeapons[this.myWeapon]); if (this.myRoster != MadnessRoster.playerRoster && this.myDataRef.myWeapons[this.myWeapon].myClips > 0) { if (MadnessGameSelect.myDifficulty == 'easy' && MadnessGameSelect.gameMode == 'story') { if (this.myDataRef.myWeapons[this.myWeapon].myClips > 3) { this.myDataRef.myWeapons[this.myWeapon].myClips = 3; } } else { this.myDataRef.myWeapons[this.myWeapon].myClips = 0; } } this.myDataRef.myWeapons[this.myWeapon] = undefined; } }; storedv2.disarmGun = function () { if (this.myDataRef.myWeapons[this.myWeapon] != undefined) { var v2; if (this.myFacing == 'left' && !this.facingOpposite || this.myFacing == 'right' && this.facingOpposite) { v2 = -1; } else { v2 = 1; } var v3 = SwainMath.randomNumber(-300, 300) / 100; this._parent.createParticle(this.myDataRef.myWeapons[this.myWeapon].myType, 'gun', this._x + 20 * v2, this._y - 40 * this.myDataRef.myScale, -16 * v2, -20, -90 * v2 + SwainMath.randomNumber(-100, 100) / 10, 50 * v2, 0.5, this._y + v3, 100, this._yscale * v2, true, 90, this.myDataRef.myWeapons[this.myWeapon]); if (this.myRoster != MadnessRoster.playerRoster && this.myDataRef.myWeapons[this.myWeapon].myClips > 0) { this.myDataRef.myWeapons[this.myWeapon].myClips = 0; } this.myDataRef.myWeapons[this.myWeapon] = undefined; } }; storedv2.disarmArmor = function (inArmor) { if (inArmor != undefined) { var v2; if (this.myFacing == 'left' && !this.facingOpposite || this.myFacing == 'right' && this.facingOpposite) { v2 = -1; } else { v2 = 1; } var v4 = SwainMath.randomNumber(-300, 300) / 100; this._parent.createParticle(inArmor.myType, 'helmet', this._x, this._y - 60 * this.myDataRef.myScale, -6 * v2, -20, -90 * v2 + SwainMath.randomNumber(-100, 100) / 10, 50 * v2, 0.5, this._y + v4, 100, this._yscale * v2, true, 90, this.myDataRef.myWeapons[this.myWeapon]); if (inArmor.myCat == 'hat') { this.myDataRef.myHat[0] = undefined; } if (inArmor.myCat == 'shirt') { this.myDataRef.myShirt[0] = undefined; } if (inArmor.myCat == 'mask') { this.myDataRef.myMask[0] = undefined; } if (inArmor.myCat == 'mouth') { this.myDataRef.myMouth[0] = undefined; } this.refreshArmor(); } }; storedv2.splatterCharacter = function (inLevel, inBlood, inDirMod, inX, inY, head) { var v3; var v11 = SwainMath.randomNumber(2, 2 + inLevel); var v2; if (inDirMod) { v2 = -1; } else { v2 = 1; } if (inLevel > 4) { inLevel = 4; } var v7 = MadnessCharacter.setPerspectiveScale(this._x, this._y, this.myRoom); var v6 = (SwainMath.randomNumber(10 + 20 * inLevel, 30 + 30 * inLevel) / 10) * v2; if (this.myDataRef.bulletEater) { v6 *= 0.2; } var v4 = 0; while (v4 < v11 * 1.5) { v3 = SwainMath.randomNumber(-800, 800) / 100; this._parent.createParticle(inBlood + String(SwainMath.randomNumber(1, 3)), 'blood', inX + 20 * v2, inY, v6, SwainMath.randomNumber(-10 + inLevel * 2, -5), SwainMath.randomNumber(-180, 180), SwainMath.randomNumber(-130, 130) / 10, 0, this._y + v3, 100, v7 * v2, false, 90); ++v4; } if (head) { v4 = 0; while (v4 < inLevel - 2) { v3 = SwainMath.randomNumber(-800, 800) / 100; this._parent.createParticle(inBlood + SwainMath.randomNumber(1, 3), 'chunk', inX + 20 * v2, inY, v6, SwainMath.randomNumber(-10 + inLevel * 2, -5), SwainMath.randomNumber(-180, 180), SwainMath.randomNumber(-130, 130) / 10, 0.5, this._y + v3, 100, v7 * v2, false, 90); ++v4; } } }; storedv1.makeSpritePart = function (inChar, inContainer, inID) { if (inID == 'remove2') { inContainer.myPart.removeMovieClip(); inContainer.partSprite._visible = true; } else { if (inContainer.myPart != undefined && inContainer.myPart.myID == inID && inID.substr(0, 4) == 'Part') { } else { if (inID.substr(0, 4) == 'Part') { inContainer.myPart.removeMovieClip(); inContainer.attachMovie(inID, 'myPart', inContainer.getNextHighestDepth()); MadnessCharacter.checkWounds(inChar); inContainer.stop(); inContainer.myPart.myID = inID; inContainer.myPart.stop(); inContainer.partSprite._visible = false; inContainer.myPart._x = 0; inContainer.myPart._y = 0; } else { if (inID == 'remove') { inContainer.myGun.removeMovieClip(); inContainer.myHand._visible = true; } else { if (inContainer.myGun != undefined && inContainer.myGun.myID == inID) { } else { inContainer.myGun.removeMovieClip(); inContainer.attachMovie(inID, 'myGun', inContainer.getNextHighestDepth()); inContainer.stop(); inContainer.myGun.myID = inID; inContainer.myGun.stop(); inContainer.myHand._visible = false; inContainer.myGun._x = -inContainer.myGun.myHand._x + inChar.myDataRef.myWeapons[inChar.myWeapon].xOffset; inContainer.myGun._y = -inContainer.myGun.myHand._y + inChar.myDataRef.myWeapons[inChar.myWeapon].yOffset; } } } } } }; storedv2.applySpeed = function (inSpeedX, inSpeedY) { if (this.myFacing == 'left') { inSpeedX *= -1; } this.mySpeedRight = inSpeedX * this.myDataRef.myScale; if (inSpeedY != undefined) { this.mySpeedDown = inSpeedY * this.myDataRef.myScale; } }; storedv2.applyYMove = function (inSpeed) { if (SwainMath.randomNumber(0, 1) == 0) { this.mySpeedDown = inSpeed; } else { this.mySpeedDown = inSpeed; } }; storedv2.generalStaggerMovement = function () { if (SwainMath.randomNumber(0, 1) == 0) { this.applySpeed(SwainMath.randomNumber(-5, -1), SwainMath.randomNumber(-2, 2)); } else { this.applySpeed(SwainMath.randomNumber(1, 5), SwainMath.randomNumber(-2, 2)); } }; storedv2.enemyInFront = function (inEnemy) { return inEnemy._x > this._x && this.myFacing == 'right' || inEnemy._x < this._x && this.myFacing == 'left'; }; goto 80048; label 80043: goto 111575; label 80048: storedv1.adjustSprite = function (inChar) { MadnessCharacter.makeSpritePart(inChar, inChar.mySprite.myHead, 'Parts - Head'); inChar.mySprite.myHead.myPart.gotoAndStop(inChar.myDataRef.myCharacter); MadnessCharacter.makeSpritePart(inChar, inChar.mySprite.myBody, 'Parts - Body'); inChar.mySprite.myBody.myPart.gotoAndStop(inChar.myDataRef.myCharacter); if (inChar.myFacing == 'left' || inChar.myFacing == 'right' && inChar.myDataRef.myWeapons[inChar.myWeapon].twoHand && (inChar.myAimX <= inChar._x && inChar.myFacing == 'right' || inChar.myAimX >= inChar._x && inChar.myFacing == 'left') && inChar.reloadTimer == -1) { inChar.mySprite.myBody.myPart.nextFrame(); } if (inChar.myFacing == 'left' && !inChar.facingOpposite || inChar.myFacing == 'right' && inChar.facingOpposite) { inChar.mySprite.myHead.myPart.nextFrame(); } if (inChar.myFacing == 'right' && inChar.myDataRef.myWeapons[inChar.myWeapon].twoHand && inChar.facingOpposite) { inChar.mySprite.myBody.myPart._xscale = -100; } else { inChar.mySprite.myBody.myPart._xscale = 100; } if (inChar.myAimX != undefined && inChar.myStatus != 'recover' && inChar.myStatus != 'stun' && inChar.myStatus != 'startup' && inChar.myHealth > 0) { var v5; if (inChar.myDataRef.myWeapons[inChar.myWeapon] == undefined && (inChar.myFacing == 'right' && inChar.myAimX < inChar._x || inChar.myFacing == 'left' && inChar.myAimX > inChar._x)) { v5 = 90; } else { if (inChar.myAimX > inChar._x) { v5 = SwainMath.calculate_rotation(inChar._x, inChar._y - 65, inChar.myAimX, inChar.myAimY); } else { v5 = -SwainMath.calculate_rotation(inChar._x, inChar._y - 65, inChar.myAimX, inChar.myAimY); } } if (v5 < 70) { v5 = 70; } if (v5 > 110) { v5 = 110; } v5 -= 90; inChar.mySprite.myHead.myPart._rotation += (v5 - inChar.mySprite.myHead.myPart._rotation) / 3; inChar.mySprite.myHead.myPart._x = SwainMath.get_position(-5, 34, inChar.mySprite.myBody.myPart._rotation + 6 + v5 / 2.5, 36, 'x'); inChar.mySprite.myHead.myPart._y = SwainMath.get_position(-5, 34, inChar.mySprite.myBody.myPart._rotation + 6 + (5 + v5 / 2.5), 36 - (5 + v5 / 2.5) / 5, 'y'); } inChar.mySprite.myHead.myPart.headSprite.gotoAndStop(1 + inChar.headDamage * 5); inChar.mySprite.myBody.myPart.bodySprite.gotoAndStop(1 + inChar.bodyDamage * 5); var v4 = 0; while (v4 < inChar.headSpray) { inChar.mySprite.myHead.myPart.headSprite.nextFrame(); ++v4; } v4 = 0; while (v4 < inChar.bodySpray) { inChar.mySprite.myBody.myPart.bodySprite.nextFrame(); ++v4; } if (MadnessGameSelect.gameMode == 'arena' && inChar.myFaction == MadnessRoster.playerRoster.teamFaction && inChar.myDataRef != MadnessRoster.playerRoster.teamLeader) { inChar.mySprite.myBody.myPart.teamColor._visible = true; inChar.mySprite.myBody.myPart.teamColor.gotoAndStop('green'); } else { inChar.mySprite.myBody.myPart.teamColor._visible = false; inChar.mySprite.myBody.myPart.teamColor.stop(); } var v9; if (inChar.myWeapon == 0) { v9 = 1; } if (inChar.myWeapon == 1) { v9 = 0; } if (inChar.myWeapon == 2) { v9 = 99; } if (inChar.myDataRef.myWeapons[v9] == undefined) { inChar.mySprite.myBody.myPart.myBackup._visible = false; inChar.mySprite.myBody.myPart.myBackup.gotoAndStop('none'); } else { inChar.mySprite.myBody.myPart.myBackup._visible = true; inChar.mySprite.myBody.myPart.myBackup.gotoAndStop(inChar.myDataRef.myWeapons[v9].myType); inChar.mySprite.myBody.myPart.myBackup.myGun = inChar.myDataRef.myWeapons[v9]; } var v2 = inChar.myDataRef.myWeapons[inChar.myWeapon]; if (v2 == undefined) { MadnessCharacter.makeSpritePart(inChar, inChar.mySprite.handNone_back, 'remove'); MadnessCharacter.makeSpritePart(inChar, inChar.mySprite.handNone_front, 'remove'); MadnessCharacter.makeSpritePart(inChar, inChar.mySprite.handShoot_back, 'remove'); MadnessCharacter.makeSpritePart(inChar, inChar.mySprite.handShoot_front, 'remove'); inChar.mySprite.handNone_back.gotoAndStop('hand_back'); inChar.mySprite.handShoot_back.gotoAndStop('hand_back'); inChar.mySprite.handNone_front.gotoAndStop('hand_front'); inChar.mySprite.handShoot_front.gotoAndStop('hand_front'); inChar.mySprite.handNone_back.myHand.gotoAndStop(inChar.myDataRef.myCharacter); inChar.mySprite.handNone_front.myHand.gotoAndStop(inChar.myDataRef.myCharacter); inChar.mySprite.handShoot_back.myHand.gotoAndStop(inChar.myDataRef.myCharacter); inChar.mySprite.handShoot_front.myHand.gotoAndStop(inChar.myDataRef.myCharacter); } else { if (v2.melee) { if (inChar.blocking) { if (inChar.mySprite.handNone_front.myGun.myID.substr(0, 13) != 'Melee - Block') { MadnessCharacter.makeSpritePart(inChar, inChar.mySprite.handNone_front, v2.myTag + ' - Block'); } inChar.mySprite.handNone_front.myGun.myMelee.gotoAndStop(v2.myType); inChar.mySprite.handNone_front.myGun.myHand.gotoAndStop('hand_back'); inChar.mySprite.handNone_front.myGun.myHand2.gotoAndStop('hand_back'); inChar.mySprite.handNone_front.myGun.gotoAndStop(inChar.actionTimer); } else { if (inChar.myFacing == 'left' && !inChar.facingOpposite || inChar.myFacing == 'right' && inChar.facingOpposite) { MadnessCharacter.makeSpritePart(inChar, inChar.mySprite.handNone_back, v2.myTag + ' - L'); MadnessCharacter.makeSpritePart(inChar, inChar.mySprite.handNone_front, 'remove'); MadnessCharacter.makeSpritePart(inChar, inChar.mySprite.handShoot_back, v2.myTag + ' - L'); MadnessCharacter.makeSpritePart(inChar, inChar.mySprite.handShoot_front, 'remove'); inChar.mySprite.handNone_back.myGun.myMelee.gotoAndStop(v2.myType); inChar.mySprite.handShoot_back.myGun.myMelee.gotoAndStop(v2.myType); inChar.mySprite.handNone_front.gotoAndStop('hand_front'); inChar.mySprite.handShoot_front.gotoAndStop('hand_front'); } else { if (inChar.myFacing == 'right' && !inChar.facingOpposite || inChar.myFacing == 'left' && inChar.facingOpposite) { MadnessCharacter.makeSpritePart(inChar, inChar.mySprite.handNone_front, v2.myTag + ' - R'); MadnessCharacter.makeSpritePart(inChar, inChar.mySprite.handNone_back, 'remove'); MadnessCharacter.makeSpritePart(inChar, inChar.mySprite.handShoot_front, v2.myTag + ' - R'); MadnessCharacter.makeSpritePart(inChar, inChar.mySprite.handShoot_back, 'remove'); inChar.mySprite.handNone_front.myGun.myMelee.gotoAndStop(v2.myType); inChar.mySprite.handShoot_front.myGun.myMelee.gotoAndStop(v2.myType); inChar.mySprite.handNone_back.gotoAndStop('hand_back'); inChar.mySprite.handShoot_back.gotoAndStop('hand_back'); } } } } else { if (inChar.myFacing == 'left' && !inChar.facingOpposite || inChar.myFacing == 'right' && inChar.facingOpposite) { if (inChar.reloadTimer == -1) { MadnessCharacter.makeSpritePart(inChar, inChar.mySprite.handNone_back, v2.myTag + ' - Fire L'); MadnessCharacter.makeSpritePart(inChar, inChar.mySprite.handShoot_back, v2.myTag + ' - Fire L'); } else { MadnessCharacter.makeSpritePart(inChar, inChar.mySprite.handNone_back, v2.myTag + ' - Reload L'); MadnessCharacter.makeSpritePart(inChar, inChar.mySprite.handShoot_back, v2.myTag + ' - Reload L'); } MadnessCharacter.makeSpritePart(inChar, inChar.mySprite.handNone_front, 'remove'); MadnessCharacter.makeSpritePart(inChar, inChar.mySprite.handShoot_front, 'remove'); inChar.mySprite.handNone_front.gotoAndStop('hand_front'); inChar.mySprite.handShoot_front.gotoAndStop('hand_front'); } if (inChar.myFacing == 'right' && !inChar.facingOpposite || inChar.myFacing == 'left' && inChar.facingOpposite) { if (inChar.reloadTimer == -1) { MadnessCharacter.makeSpritePart(inChar, inChar.mySprite.handNone_front, v2.myTag + ' - Fire R'); MadnessCharacter.makeSpritePart(inChar, inChar.mySprite.handShoot_front, v2.myTag + ' - Fire R'); } else { MadnessCharacter.makeSpritePart(inChar, inChar.mySprite.handNone_front, v2.myTag + ' - Reload R'); MadnessCharacter.makeSpritePart(inChar, inChar.mySprite.handShoot_front, v2.myTag + ' - Reload R'); } MadnessCharacter.makeSpritePart(inChar, inChar.mySprite.handNone_back, 'remove'); MadnessCharacter.makeSpritePart(inChar, inChar.mySprite.handShoot_back, 'remove'); inChar.mySprite.handNone_back.gotoAndStop('hand_back'); inChar.mySprite.handShoot_back.gotoAndStop('hand_back'); } } } inChar.mySprite.handNone_back.myHand.gotoAndStop(inChar.myDataRef.myCharacter); inChar.mySprite.handNone_front.myHand.gotoAndStop(inChar.myDataRef.myCharacter); inChar.mySprite.handShoot_back.myHand.gotoAndStop(inChar.myDataRef.myCharacter); inChar.mySprite.handShoot_front.myHand.gotoAndStop(inChar.myDataRef.myCharacter); inChar.mySprite.handNone_back.myGun.myHand.gotoAndStop(inChar.myDataRef.myCharacter); inChar.mySprite.handNone_back.myGun.myHand2.gotoAndStop(inChar.myDataRef.myCharacter); inChar.mySprite.handNone_front.myGun.myHand.gotoAndStop(inChar.myDataRef.myCharacter); inChar.mySprite.handNone_front.myGun.myHand2.gotoAndStop(inChar.myDataRef.myCharacter); inChar.mySprite.handShoot_back.myGun.myHand.gotoAndStop(inChar.myDataRef.myCharacter); inChar.mySprite.handShoot_back.myGun.myHand2.gotoAndStop(inChar.myDataRef.myCharacter); inChar.mySprite.handShoot_front.myGun.myHand.gotoAndStop(inChar.myDataRef.myCharacter); inChar.mySprite.handShoot_front.myGun.myHand2.gotoAndStop(inChar.myDataRef.myCharacter); inChar.mySprite.myHand.myHand.gotoAndStop(inChar.myDataRef.myCharacter); inChar.mySprite.myHand2.myHand.gotoAndStop(inChar.myDataRef.myCharacter); inChar.mySprite.myHand.gotoAndStop(inChar.myDataRef.myCharacter); inChar.mySprite.myHand2.gotoAndStop(inChar.myDataRef.myCharacter); if (inChar.blocking) { inChar.mySprite.handNone_front._visible = true; inChar.mySprite.handShoot_front._visible = false; inChar.mySprite.handNone_back._visible = false; inChar.mySprite.handShoot_back._visible = false; } else { if (inChar.myStatus.substr(0, 7) == 'unarmed' || inChar.myStatus.substr(0, 5) == 'melee' || inChar.myStatus.substr(0, 7) == 'execute' || inChar.myStatus == 'swap' || inChar.myStatus == 'startup' || inChar.myStatus == 'pickup' || inChar.myStatus.substr(-6, 5) == 'parry') { if (inChar.myFacing == 'right') { inChar.mySprite.handNone_front._visible = false; inChar.mySprite.handShoot_front._visible = true; inChar.mySprite.handNone_back._visible = true; inChar.mySprite.handShoot_back._visible = false; } if (inChar.myFacing == 'left') { inChar.mySprite.handNone_front._visible = true; inChar.mySprite.handShoot_front._visible = false; inChar.mySprite.handNone_back._visible = false; inChar.mySprite.handShoot_back._visible = true; } } else { if (v2 != undefined && inChar.reloadTimer > -1) { if (inChar.myFacing == 'right') { inChar.mySprite.handNone_front._visible = false; inChar.mySprite.handShoot_front._visible = true; inChar.mySprite.handNone_back._visible = false; inChar.mySprite.handShoot_back._visible = false; } if (inChar.myFacing == 'left') { inChar.mySprite.handNone_front._visible = false; inChar.mySprite.handShoot_front._visible = false; inChar.mySprite.handNone_back._visible = false; inChar.mySprite.handShoot_back._visible = true; } inChar.mySprite.handShoot_back.myGun.gotoAndStop(inChar.rofLastFrame); inChar.mySprite.handShoot_front.myGun.gotoAndStop(inChar.rofLastFrame); v4 = inChar.mySprite.handShoot_back.myGun._currentframe; while (v4 < inChar.reloadTimer + 1) { inChar.mySprite.handShoot_back.myGun.nextFrame(); ++v4; } inChar.mySprite.handShoot_front.myGun.gotoAndStop(inChar.rofLastFrame); v4 = inChar.mySprite.handShoot_front.myGun._currentframe; while (v4 < inChar.reloadTimer + 1) { inChar.mySprite.handShoot_front.myGun.nextFrame(); ++v4; } if (inChar.mySprite.handShoot_back.myGun._currentframe != undefined) { inChar.rofLastFrame = inChar.mySprite.handShoot_back.myGun._currentframe; } else { inChar.rofLastFrame = inChar.mySprite.handShoot_front.myGun._currentframe; } if (inChar.reloadTimer + 1 > inChar.mySprite.handShoot_back.myGun._totalframes) { inChar.mySprite.handShoot_back.myGun.gotoAndStop(inChar.mySprite.handShoot_back.myGun._totalframes); } if (inChar.reloadTimer + 1 > inChar.mySprite.handShoot_front.myGun._totalframes) { inChar.mySprite.handShoot_front.myGun.gotoAndStop(inChar.mySprite.handShoot_front.myGun._totalframes); } } else { if (inChar.aimTimer > -1 || v2 != undefined && inChar.rofTimer < v2.myROF + inChar.shootWaitBuffer && (inChar.myStatus == 'incap' || inChar.myStatus == 'cover' || inChar.myStatus == 'idle' || inChar.myStatus == 'run' || inChar.myStatus == 'backtrack' || inChar.myStatus == 'dash' || inChar.myStatus == 'tactics')) { if (inChar.myFacing == 'right' && !inChar.facingOpposite || inChar.myFacing == 'left' && inChar.facingOpposite) { inChar.mySprite.handNone_front._visible = false; inChar.mySprite.handShoot_front._visible = true; inChar.mySprite.handNone_back._visible = true; inChar.mySprite.handShoot_back._visible = false; } if (inChar.myFacing == 'left' && !inChar.facingOpposite || inChar.myFacing == 'right' && inChar.facingOpposite) { inChar.mySprite.handNone_front._visible = true; inChar.mySprite.handShoot_front._visible = false; inChar.mySprite.handNone_back._visible = false; inChar.mySprite.handShoot_back._visible = true; } inChar.mySprite.handShoot_back.myGun.gotoAndStop(inChar.rofLastFrame); inChar.mySprite.handShoot_front.myGun.gotoAndStop(inChar.rofLastFrame); v4 = inChar.mySprite.handShoot_back.myGun._currentframe; while (v4 < inChar.rofTimer + 1) { inChar.mySprite.handShoot_back.myGun.nextFrame(); ++v4; } inChar.mySprite.handShoot_front.myGun.gotoAndStop(inChar.rofLastFrame); v4 = inChar.mySprite.handShoot_front.myGun._currentframe; while (v4 < inChar.rofTimer + 1) { inChar.mySprite.handShoot_front.myGun.nextFrame(); ++v4; } if (inChar.mySprite.handShoot_back.myGun._currentframe != undefined) { inChar.rofLastFrame = inChar.mySprite.handShoot_back.myGun._currentframe; } else { inChar.rofLastFrame = inChar.mySprite.handShoot_front.myGun._currentframe; } if (inChar.rofTimer + 1 > inChar.mySprite.handShoot_back.myGun._totalframes) { inChar.mySprite.handShoot_back.myGun.gotoAndStop(inChar.mySprite.handShoot_back.myGun._totalframes); } if (inChar.rofTimer + 1 > inChar.mySprite.handShoot_front.myGun._totalframes) { inChar.mySprite.handShoot_front.myGun.gotoAndStop(inChar.mySprite.handShoot_front.myGun._totalframes); } if (inChar.rofTimer < inChar.mySprite.handShoot_front.myGun.myBlast._totalframes) { inChar.mySprite.handShoot_front.myGun.myBlast.gotoAndStop(inChar.rofTimer); } if (inChar.rofTimer < inChar.mySprite.handShoot_back.myGun.myBlast._totalframes) { inChar.mySprite.handShoot_back.myGun.myBlast.gotoAndStop(inChar.rofTimer); } } else { inChar.mySprite.handNone_back._visible = true; inChar.mySprite.handShoot_back._visible = false; inChar.mySprite.handNone_front._visible = true; inChar.mySprite.handShoot_front._visible = false; inChar.mySprite.handNone_back.myGun.gotoAndStop(1); inChar.mySprite.handNone_front.myGun.gotoAndStop(1); if (inChar.rofTimer < inChar.mySprite.handNone_front.myGun.myBlast._totalframes) { inChar.mySprite.handNone_front.myGun.myBlast.gotoAndStop(inChar.rofTimer); } if (inChar.rofTimer < inChar.mySprite.handNone_back.myGun.myBlast._totalframes) { inChar.mySprite.handNone_back.myGun.gotoAndStop(inChar.rofTimer); } } } } } if (v2.twoHand) { if (inChar.myFacing == 'left' && !inChar.facingOpposite || inChar.myFacing == 'right' && inChar.facingOpposite) { inChar.mySprite.handShoot_front._visible = false; inChar.mySprite.handNone_front._visible = false; } if (inChar.myFacing == 'right' && !inChar.facingOpposite || inChar.myFacing == 'left' && inChar.facingOpposite) { inChar.mySprite.handShoot_back._visible = false; inChar.mySprite.handNone_back._visible = false; } } var v8; v8 = inChar.rofTimer; var v3; var v7; if (inChar.mySprite.handShoot_front._visible) { v3 = inChar.mySprite.handShoot_front; v7 = inChar.mySprite.handNone_front; } else { if (inChar.mySprite.handShoot_back._visible) { v3 = inChar.mySprite.handShoot_back; v7 = inChar.mySprite.handNone_back; } } if (v8 < v2.myROF + inChar.shootWaitBuffer * 0.5) { inChar.lastGunX = v3.myGun._x; inChar.lastGunY = v3.myGun._y; inChar.lastGunRot = v3._rotation; } if (inChar.reloadTimer == -1 && v8 > v2.myROF + inChar.shootWaitBuffer * 0.5 && inChar.myStatus.substr(0, 5) != 'melee' && inChar.myStatus.substr(0, 5) != 'unarmed' && v8 <= v2.myROF + inChar.shootWaitBuffer) { var v6 = new Object(); v6.x = v7.myGun._x; v6.y = v7.myGun._y; v7.localToGlobal(v6); v3.globalToLocal(v6); v3.myGun._x = inChar.lastGunX; v3.myGun._y = inChar.lastGunY; v3._rotation = inChar.lastGunRot; if (v7._rotation - v3._rotation > 180) { v3._rotation += (v7._rotation - v3._rotation - 360) / (inChar.shootWaitBuffer + v2.myROF - v8 + 2) * 0.2; } else { v3._rotation += (v7._rotation - v3._rotation) / (inChar.shootWaitBuffer + v2.myROF - v8 + 2) * 0.2; } SwainMath.move_me(v3.myGun, SwainMath.calculate_rotation(v3.myGun._x, v3.myGun._y, v6.x, v6.y), SwainMath.get_distance2(v3.myGun._x, v3.myGun._y, v6.x, v6.y) / (inChar.shootWaitBuffer + v2.myROF - v8 + 5) * 0.2); inChar.lastGunX = v3.myGun._x; inChar.lastGunY = v3.myGun._y; inChar.lastGunRot = v3._rotation; } else { if (inChar.rofTimer == 1) { inChar.mySprite.handShoot_front.myGun._x = -inChar.mySprite.handShoot_front.myGun.myHand._x + inChar.myDataRef.myWeapons[inChar.myWeapon].xOffset; inChar.mySprite.handShoot_front.myGun._y = -inChar.mySprite.handShoot_front.myGun.myHand._y + inChar.myDataRef.myWeapons[inChar.myWeapon].yOffset; inChar.mySprite.handShoot_back.myGun._x = -inChar.mySprite.handShoot_back.myGun.myHand._x + inChar.myDataRef.myWeapons[inChar.myWeapon].xOffset; inChar.mySprite.handShoot_back.myGun._y = -inChar.mySprite.handShoot_back.myGun.myHand._y + inChar.myDataRef.myWeapons[inChar.myWeapon].yOffset; } if (!v2.melee && inChar.myStatus.substr(0, 7) != 'unarmed' && inChar.myStatus.substr(0, 5) != 'melee' && v2 != undefined && inChar.myStatus != 'swap' && inChar.myStats != 'recover' && inChar.myStatus != 'startup' && inChar.myStatus != 'pickup') { if (inChar.reloadTimer > -1) { inChar.mySprite.handShoot_front._rotation = -30; inChar.mySprite.handShoot_back._rotation = -30; } else { if (inChar.myAimX <= inChar._x && inChar.myFacing == 'right' || inChar.myAimX >= inChar._x && inChar.myFacing == 'left') { inChar.mySprite.handShoot_front._rotation = -90 - SwainMath.calculate_rotation(inChar._x - inChar.mySprite.handShoot_front._x, inChar._y - inChar.mySprite.handShoot_front._y, inChar.myAimX, inChar.myAimY); inChar.mySprite.handShoot_back._rotation = -90 + SwainMath.calculate_rotation(inChar._x + inChar.mySprite.handShoot_back._x, inChar._y - inChar.mySprite.handShoot_back._y, inChar.myAimX, inChar.myAimY); } else { inChar.mySprite.handShoot_front._rotation = -90 + SwainMath.calculate_rotation(inChar._x - inChar.mySprite.handShoot_front._x, inChar._y - inChar.mySprite.handShoot_front._y, inChar.myAimX, inChar.myAimY); inChar.mySprite.handShoot_back._rotation = -90 - SwainMath.calculate_rotation(inChar._x + inChar.mySprite.handShoot_back._x, inChar._y - inChar.mySprite.handShoot_back._y, inChar.myAimX, inChar.myAimY); } if (inChar._rotation > 0 && !inChar.facingOpposite || inChar._rotation < 0 && inChar.facingOpposite) { inChar.mySprite.handShoot_front._rotation += inChar._rotation; inChar.mySprite.handShoot_back._rotation += inChar._rotation; } else { inChar.mySprite.handShoot_front._rotation -= inChar._rotation; inChar.mySprite.handShoot_back._rotation -= inChar._rotation; } } } } if (inChar.mySprite.handShoot_front == undefined && inChar.mySprite.handShoot_back == undefined && inChar.mySprite.handNone_front == undefined && inChar.mySprite.handNone_back == undefined) { } else { if (inChar.mySprite.myHand != undefined) { if (inChar.mySprite.handShoot_front._visible) { inChar.mySprite.handShoot_front.myGun.myHand._visible = false; inChar.mySprite.handShoot_front.myGun.myHand2._visible = false; inChar.mySprite.myHand._visible = true; inChar.mySprite.handNone_back._visible = true; inChar.mySprite.myHand2._visible = false; } else { if (inChar.mySprite.handShoot_front != undefined) { } else { if (inChar.mySprite.handShoot_front == undefined && inChar.myFacing == 'right') { inChar.mySprite.handNone_back._visible = true; inChar.mySprite.myHand2._visible = false; } } } } else { inChar.mySprite.handShoot_front.myGun.myHand._visible = true; inChar.mySprite.handShoot_front.myGun.myHand2._visible = true; } if (inChar.mySprite.myHand2 != undefined) { if (inChar.mySprite.handShoot_back._visible) { inChar.mySprite.handShoot_back.myGun.myHand._visible = false; inChar.mySprite.handShoot_back.myGun.myHand2._visible = false; inChar.mySprite.myHand2._visible = true; inChar.mySprite.handNone_front._visible = true; inChar.mySprite.myHand._visible = false; } else { if (inChar.mySprite.handShoot_back != undefined) { } else { if (inChar.mySprite.handShoot_back == undefined && inChar.myFacing == 'left') { inChar.mySprite.handNone_front._visible = true; inChar.mySprite.myHand._visible = false; } } } } else { inChar.mySprite.handShoot_back.myGun.myHand._visible = true; inChar.mySprite.handShoot_back.myGun.myHand2._visible = true; } } ItemGenerator.setItemSprite(inChar.mySprite.handNone_front.myGun.myMelee.mySprite, v2); ItemGenerator.setItemSprite(inChar.mySprite.handNone_back.myGun.myMelee.mySprite, v2); ItemGenerator.setItemSprite(inChar.mySprite.handShoot_front.myGun.myMelee.mySprite, v2); ItemGenerator.setItemSprite(inChar.mySprite.handShoot_back.myGun.myMelee.mySprite, v2); if (inChar.myWeapon == 0) { ItemGenerator.setItemSprite(inChar.mySprite.myBody.myPart.myBackup.mySprite, inChar.myDataRef.myWeapons[1]); } else { ItemGenerator.setItemSprite(inChar.mySprite.myBody.myPart.myBackup.mySprite, inChar.myDataRef.myWeapons[0]); } if (inChar.myDataRef.myCharacter == 'tricky' && (inChar.myHealth > 0 || inChar.myStatus.substr(0, 7) == 'wounded')) { if (inChar.mySprite._currentframe <= 2) { inChar.myHeadStartX = -6.5; inChar.myHeadStartY = -2; inChar.myHeadRot = 0; inChar.myHand1StartX = inChar.mySprite.handNone_front.myHand._x; inChar.myHand1StartY = inChar.mySprite.handNone_front.myHand._y; inChar.myHand1Rot = inChar.mySprite.handNone_front.myHand._rotation; inChar.myHand2StartX = inChar.mySprite.handNone_back.myHand._x; inChar.myHand2StartY = inChar.mySprite.handNone_back.myHand._y; inChar.myHand2Rot = inChar.mySprite.handNone_back.myHand._rotation; } inChar.mySprite.myHead.myPart.headSprite._x = inChar.myHeadStartX + SwainMath.randomNumber(-15, 15) / 10; inChar.mySprite.myHead.myPart.headSprite._y = inChar.myHeadStartY + SwainMath.randomNumber(-15, 15) / 10; inChar.mySprite.myHead.myPart.headSprite._rotation = inChar.myHeadRot + SwainMath.randomNumber(-40, 40) / 10; inChar.mySprite.handNone_front.myHand._x = inChar.myHand1StartX + SwainMath.randomNumber(-15, 15) / 10; inChar.mySprite.handNone_front.myHand._y = inChar.myHand1StartY + SwainMath.randomNumber(-15, 15) / 10; inChar.mySprite.handNone_front.myHand._rotation = inChar.myHand1Rot + SwainMath.randomNumber(-40, 40) / 10; inChar.mySprite.handNone_back.myHand._x = inChar.myHand2StartX + SwainMath.randomNumber(-15, 15) / 10; inChar.mySprite.handNone_back.myHand._y = inChar.myHand2StartY + SwainMath.randomNumber(-15, 15) / 10; inChar.mySprite.handNone_back.myHand._rotation = inChar.myHand2Rot + SwainMath.randomNumber(-40, 40) / 10; } if (inChar.interactTarget != undefined) { inChar.mySprite.hisHead.gotoAndStop(inChar.interactTarget.myDataRef.myCharacter); inChar.mySprite.hisBody.gotoAndStop(inChar.interactTarget.myDataRef.myCharacter); if (inChar.mySprite.flipPartner && inChar.myFacing == 'right') { inChar.mySprite.hisHead.nextFrame(); inChar.mySprite.hisBody.nextFrame(); } inChar.mySprite.hisHand.myHand.gotoAndStop(inChar.interactTarget.myDataRef.myCharacter); inChar.mySprite.hisHand2.myHand.gotoAndStop(inChar.interactTarget.myDataRef.myCharacter); } if (inChar.headDamage > 3 || inChar.myDataRef.myHat[inChar.myHat] == undefined) { inChar.mySprite.myHead.myPart.myHat._visible = false; inChar.mySprite.myHead.myPart.myHat2._visible = false; } else { inChar.mySprite.myHead.myPart.myHat._visible = true; inChar.mySprite.myHead.myPart.myHat2._visible = true; inChar.mySprite.myHead.myPart.myHat.gotoAndStop(inChar.myDataRef.myHat[inChar.myHat].myType); inChar.mySprite.myHead.myPart.myHat2.gotoAndStop(inChar.myDataRef.myHat[inChar.myHat].myType); inChar.mySprite.myHead.myPart.myHat.inHat.gotoAndStop(inChar.myDataRef.myHat[inChar.myHat].myIntegrity); inChar.mySprite.myHead.myPart.myHat2.inHat.gotoAndStop(inChar.myDataRef.myHat[inChar.myHat].myIntegrity); } if (inChar.headDamage > 3 || inChar.myDataRef.myMask[inChar.myMask] == undefined) { inChar.mySprite.myHead.myPart.myMask._visible = false; } else { inChar.mySprite.myHead.myPart.myMask._visible = true; inChar.mySprite.myHead.myPart.myMask.gotoAndStop(inChar.myDataRef.myMask[inChar.myMask].myType); } if (inChar.headDamage > 3 || inChar.myDataRef.myMouth[inChar.myMouth] == undefined) { inChar.mySprite.myHead.myPart.myMouth._visible = false; } else { inChar.mySprite.myHead.myPart.myMouth._visible = true; inChar.mySprite.myHead.myPart.myMouth.gotoAndStop(inChar.myDataRef.myMouth[inChar.myMouth].myType); } if (inChar.myDataRef.myShirt[inChar.myShirt] == undefined) { inChar.mySprite.myBody.myPart.myShirt._visible = false; } else { inChar.mySprite.myBody.myPart.myShirt._visible = true; inChar.mySprite.myBody.myPart.myShirt.gotoAndStop(inChar.myDataRef.myShirt[inChar.myShirt].myType); } }; storedv1.setPerspectiveScale = function (inX, inY, inRoom) { var v5 = 100; if (inRoom.amStairs) { var v7 = SwainMath.get_distance2(inX, inY, inRoom.myDL._x, inRoom.myDL._y) + SwainMath.get_distance2(inX, inY, inRoom.myUL._x, inRoom.myUL._y); var v9 = SwainMath.get_distance2(inX, inY, inRoom.myDR._x, inRoom.myDR._y) + SwainMath.get_distance2(inX, inY, inRoom.myUR._x, inRoom.myUR._y); var v3 = 1 - (v7 - inRoom.leftWidth) / (inRoom.upWidth + inRoom.downWidth - inRoom.leftWidth); var v2 = 1 - (v9 - inRoom.rightWidth) / (inRoom.upWidth + inRoom.downWidth - inRoom.rightWidth); if (v2 < 0) { v2 = 0; } if (v2 > 1) { v2 = 1; } if (v3 < 0) { v3 = 0; } if (v3 > 1) { v3 = 1; } var v8 = inRoom.myDL._y * v3 + inRoom.myDR._y * v2; v5 = 100 - (v8 - inY + inRoom.ystart) / 15; return v5; } v5 = 100 - (inRoom.myDL._y - inY + inRoom.ystart) / 15; return v5; }; storedv2.attractToDoor = function (inDoor) { this.attractToMC(inDoor, 'door'); this.targetDoor = inDoor; this.myMission = 'leave'; this.doorLock = true; if (this.myRoster == MadnessRoster.playerRoster) { this._parent.followDoor = inDoor; } inDoor.keepDoorOpen(this.myDataRef); }; storedv2.attractToMC = function (inMC, inInteractType) { this.myAimX = inMC._x; this.myAimY = inMC._y - 60; this.interactType = inInteractType; this.targetLock = true; this.ignoreRooms = false; this.intendedTarget = inMC; this.intendedX = this.intendedTarget._x; this.intendedY = this.intendedTarget._y; this.intendedRoom = this._parent.determineRoom(this.intendedX, this.intendedY); this.testAddToLockList(this.interactType, this.targetLock, this.intendedTarget, this.intendedX, this.intendedY); }; storedv1.setMyDepth = function (inMC, inNum) { var v2 = 1; if (inMC.myDataRef.myScale != undefined) { v2 /= inMC.myDataRef.myScale; } while (inMC._parent.getInstanceAtDepth(Math.floor(inNum * v2 * 1000) + 100) != undefined) { inNum -= 0.001; } inMC.swapDepths(Math.floor(inNum * v2 * 1000) + 100); }; storedv2.findClosestObstacle = function () { var v2; var v7; var v6 = 999999999; var v5; var v4 = new Array(); var v3 = 0; while (v3 < MadnessObstacle.allObstacles.length) { v2 = MadnessObstacle.allObstacles[v3]; if (v2.myHealth > 0 && v2.inUse == undefined && v2.amCover) { if (this._x < v2._x + v2.myWidth / 2 + this.myWidth / 2 + v2.zoneWidth && this._x > v2._x - v2.myWidth / 2 - this.myWidth / 2 - v2.zoneWidth && this._y < v2._y + v2.myDepth / 2 + v2.zoneDepth && this._y > v2._y - v2.myDepth / 2 - v2.zoneDepth) { v4.push(v2); } } ++v3; } if (v4.length == 1) { v7 = v4[0]; return v7; } v3 = 0; while (v3 < v4.length) { v5 = SwainMath.get_distance(this, v4[v3]); if (v5 < v6) { v6 = v5; v7 = v4[v3]; } ++v3; } return v7; }; storedv2.findClosestPickup = function (inPlayer) { var v2; var v8; var v6 = 999999999; var v5; var v4 = new Array(); var v3 = 0; while (v3 < MadnessParticle.allPickups.length) { v2 = MadnessParticle.allPickups[v3]; if (!inPlayer && this._x < v2._x + 255 && this._x > v2._x - 255 && this._y < v2._y + 235 && this._y > v2._y - 235 || inPlayer && this._x < v2._x + 55 && this._x > v2._x - 55 && this._y < v2._y + 35 && this._y > v2._y - 35) { v4.push(v2); } ++v3; } if (v4.length == 1) { v8 = v4[0]; return v8; } v3 = 0; while (v3 < v4.length) { v5 = SwainMath.get_distance(this, v4[v3]); if (v5 < v6) { v6 = v5; v8 = v4[v3]; } ++v3; } return v8; }; storedv2.returnInvertValid = function () { return this.reloadTimer == -1 && (this.myAimX <= this._x && this.myFacing == 'right' || this.myAimX >= this._x && this.myFacing == 'left'); }; storedv2.swapGear = function () { this.myWeapon = 1 - this.myWeapon; this.myDataRef.myWeapon = this.myWeapon; this.rofTimer = 300; }; storedv2.hitTactics = function (inWeapon, inAttacker, inBlock, inKillShot, inRange) { var v2 = (inWeapon.myROF / 6) * inAttacker.myDataRef.modHurtTactics; if (inWeapon.myCat == 'rifle') { v2 *= 2; } if (inWeapon.myCat == 'smg') { v2 *= 1.2; } if (inWeapon.myCat == 'shotgun') { v2 *= 1; } if (inWeapon.myCat == 'pistol' || inWeapon.myCat == 'revolver') { v2 *= 1; } if (inWeapon.myCat == 'heavy') { v2 *= 0.5; } this.tacDisplayTimer = 20; if (!inRange) { if (MadnessDataFile.havePerk('perkLowAcc3', this.myDataRef)) { v2 *= 0.5; } else { if (MadnessDataFile.havePerk('perkLowAcc1', this.myDataRef)) { v2 *= 0.5; } else { v2 *= 0.9; } } } if (MadnessDataFile.havePerk('perkLowAcc2', this.myDataRef) && inWeapon.myCat == 'melee') { v2 *= 0.5; } if (MadnessDataFile.havePerk('perkCoverShoot', this.myDataRef) && this.targetObstacle.inUse == this && (this._x < this.targetObstacle._x && inAttacker._x > this.targetObstacle || this._x > this.targetObstacle._x && inAttacker._x < this.targetObstacle)) { v2 *= 0.5; } if (this.myDataRef.amSpecial && this.myStatus.substr(0, 4) == 'stun') { v2 = 0; } if (inAttacker._x > this._x && (this.myFacing == 'left' && !this.facingOpposite || this.myFacing == 'right' && this.facingOpposite) || inAttacker._x < this._x && (this.myFacing == 'right' && !this.facingOpposite || this.myFacing == 'left' && this.facingOpposite)) { v2 *= 1.5; } if (inBlock) { v2 *= 0.25; } if (this.mySpeedRight == 0 && this.mySpeedDown == 0 && !inBlock) { if (inWeapon.myCat == 'smg' && MadnessDataFile.havePerk('perkSMGTacDamage', this.myDataRef)) { v2 *= 1.2; } if (inWeapon.myCat == 'rifle' && MadnessDataFile.havePerk('perkRifleTacDamage', this.myDataRef)) { v2 *= 1.2; } v2 *= 2; } if (this.myRoster == MadnessRoster.playerRoster && MadnessGameSelect.gameMode == 'story') { v2 = v2 / 2 + v2 * MadnessCharacter.damageDifficultyMod / 2; } this.myTactics -= v2; if (v2 > 0) { this.tacTimer = 0; } if (this.myTactics <= 0) { this.myTactics = 0; } }; storedv2.damageMelee = function (inWeapon) { if (inWeapon.myCat == 'melee' && inWeapon.myTag != 'Unarmed') { inWeapon.myHealth -= 1; ItemGenerator.setItemSprite(this.mySprite.handNone_front.myGun, this.myDataRef.myWeapons[this.myWeapon]); ItemGenerator.setItemSprite(this.mySprite.handNone_back.myGun, this.myDataRef.myWeapons[this.myWeapon]); ItemGenerator.setItemSprite(this.mySprite.handShoot_front.myGun, this.myDataRef.myWeapons[this.myWeapon]); ItemGenerator.setItemSprite(this.mySprite.handShoot_back.myGun, this.myDataRef.myWeapons[this.myWeapon]); if (inWeapon.myHealth <= inWeapon.myHealthMax * 0.12 && inWeapon.broken == false) { inWeapon.broken = true; this.weaponBreakParticle(inWeapon); } if (inWeapon.myHealth <= 0) { this.myDataRef.myWeapons[this.myWeapon] = undefined; this.myStatus = 'stun' + String(SwainMath.randomNumber(1, 3)); this.mySprite.gotoAndStop(this.myStatus); this.playSound('break'); } } }; storedv2.weaponBreakParticle = function (inWeapon) { if (this.amPlayer || !this.amPlayer && this._x > this._parent.myFollowTarget._x - 400 && this._x < this._parent.myFollowTarget._x + 400) { var v2; if (this.myFacing == 'left' && !this.facingOpposite || this.myFacing == 'right' && this.facingOpposite) { v2 = -1; } else { v2 = 1; } var v3 = SwainMath.randomNumber(-800, 800) / 100; this._parent.createParticle(inWeapon.myType, 'melee_piece', this._x + 28 * v2, SwainMath.get_position(this._x, this._y - this.myDataRef.myShootHeight * (this._yscale / 100), SwainMath.calculate_rotation(this._x, this._y - this.myDataRef.myShootHeight * (this._yscale / 100), this.myAimX, this.myAimY), 35, 'y'), (SwainMath.randomNumber(-60, -30) / 10) * v2, SwainMath.randomNumber(-250, -150) / 10, SwainMath.calculate_rotation(this._x, this._y - this.myDataRef.myShootHeight * (this._yscale / 100), this.myAimX, this.myAimY), SwainMath.randomNumber(-900, 900) / 10, 0.7, this._y + v3, 100, this._yscale * v2, true, 90); } }; storedv2.spitBlood = function (inMajor) { if (this.myFacing == 'right') { this.myFacing = 'left'; } else { this.myFacing = 'right'; } var v2 = 0; while (v2 < 3) { if (this.myFacing == 'right') { this.makeSparks(this._x - (this.mySprite._x + this.mySprite.myHead._x + 10), this._y + (this.mySprite._y + this.mySprite.myHead._y + 12), this._y, 'drops_' + this.myDataRef.myBlood); } else { this.makeSparks(this._x + (this.mySprite._x + this.mySprite.myHead._x + 10), this._y + (this.mySprite._y + this.mySprite.myHead._y + 12), this._y, 'drops_' + this.myDataRef.myBlood); } if (!inMajor) { v2 = 4; } ++v2; } if (this.myFacing == 'right') { this.myFacing = 'left'; } else { this.myFacing = 'right'; } if (inMajor) { if (this.myFacing == 'left') { this._parent.createEffect(this._x - (this.mySprite._x + this.mySprite.myHead._x + 14), this._y + (this.mySprite._y + this.mySprite.myHead._y + 13), 'blood' + String(SwainMath.randomNumber(4, 6)) + '_' + this.myBlood, 100, 100, -90); } else { this._parent.createEffect(this._x + (this.mySprite._x + this.mySprite.myHead._x + 14), this._y + (this.mySprite._y + this.mySprite.myHead._y + 13), 'blood' + String(SwainMath.randomNumber(4, 6)) + '_' + this.myBlood, 100, 100, 90); } } }; storedv2.useActivator = function () { this.targetActivator.activateMe(); }; storedv2.checkWhipRange = function () { if (!MadnessDataFile.havePerk('perkMeleePistolWhip', this.myDataRef) || this.lifeSpan < 45) { return false; } else { var v2; var v4 = 0; while (v4 < MadnessCharacter.allRosters.length) { var v3 = 0; while (v3 < MadnessCharacter.allRosters[v4].myActiveMembers.length) { v2 = MadnessCharacter.allRosters[v4].myActiveMembers[v3].mySprite; if (v2.myFaction != this.myFaction) { if (v2.myHealth > 0 && !v2.amDodging) { if (v2._x > this._x && v2._x < this._x + this.myDataRef.myUnarmed.myRange * this.myDataRef.myScale * 0.8 && (this.myFacing == 'right' && !this.facingOpposite || this.myFacing == 'left' && this.facingOpposite) || v2._x < this._x && v2._x > this._x - this.myDataRef.myUnarmed.myRange * this.myDataRef.myScale * 0.8 && (this.myFacing == 'left' && !this.facingOpposite || this.myFacing == 'right' && this.facingOpposite)) { if (this.inMeleeRange(v2)) { return true; break; } } } } ++v3; } ++v4; } return false; } }; storedv2.inMeleeRange = function (inTarget) { if (this.amPlayer) { return this._y > inTarget._y - 40 && this._y < inTarget._y + 40; } else { return this._y > inTarget._y - 20 && this._y < inTarget._y + 20; } }; storedv2.inMeleeRangeAI = function (inTarget) { return this._y > inTarget._y - 40 + inTarget.mySpeedDown * 3 * this.slowmoSpeedMod && this._y < inTarget._y + 40 + inTarget.mySpeedDown * 3 * this.slowmoSpeedMod; }; storedv2.shakeyCam = function (inNum) { this._parent.shakeyCam(inNum); }; storedv2.amDead = function () { this.gotoAndStop(this._totalframes); }; storedv1.myPartOn = function (inPart, inValue, inCount) { if (inCount == undefined || inCount == 0) { inCount = 0; inPart.stop(); } if (inCount == 6) { return false; } if (inPart._parent.myDataRef.myWeapons[inPart._parent.myWeapon] != undefined) { return inPart._parent.myDataRef.myWeapons[inPart._parent.myWeapon][inValue]; } else { if (inPart._parent.myGun.myName != undefined) { return inPart._parent.myGun[inValue]; } else { return MadnessCharacter.myPartOn(inPart._parent, inValue, inCount + 1); } } }; storedv2.pickupGun = function () { this.myDataRef.myWeapons[this.myWeapon] = this.targetPickup.myGun; MadnessParticle.removePickup(this.targetPickup); if (this.myDataRef.myWeapons[this.myWeapon].melee) { this.playSound('swapmelee'); } else { if (this.myDataRef.myWeapons[this.myWeapon] != undefined) { this.playSound('swapgun'); } } }; storedv2.initiatePickup = function () { this.targetLock = false; this.myStatus = 'pickup'; this.mySpeedDown = 0; this.mySpeedRight = 0; this.targetLock = false; }; storedv2.throwWeapon = function () { var v6 = this.myDataRef.myWeapons[this.myWeapon]; if (v6 != undefined) { var v3; if (this.myFacing == 'left' && !this.facingOpposite || this.myFacing == 'right' && this.facingOpposite) { v3 = -1; } else { v3 = 1; } var v7 = SwainMath.randomNumber(-300, 300) / 100; var v4 = 10; if (this.myDataRef.myWeapons[this.myWeapon].melee) { v4 = 70; } var v8 = -(25 + this.myDataRef.statSTR / 2 + 10 * Number(this.myDataRef.myWeapons[this.myWeapon].melee)) + (30 + this.myDataRef.statSTR / 2) * ((Math.abs(this._parent.playerAim._rotation) - 20) / 90); var v9 = (25 + this.myDataRef.statSTR / 2 + 10 * Number(this.myDataRef.myWeapons[this.myWeapon].melee)) * (90 - SwainMath.getRotDistance(Math.abs(this._parent.playerAim._rotation), 90)) / 90; var v2 = new Object(); var v5; if (this.mySprite.myHand) { v5 = this.mySprite.myHand; } else { v5 = this.mySprite.myHand2; } v2.x = 0; v2.y = 0; v5.localToGlobal(v2); this._parent.globalToLocal(v2); this.myDataRef.myWeapons[this.myWeapon].myThrowerFaction = this.myFaction; this._parent.createParticle(v6.myType, 'thrown', v2.x, v2.y, v9 * v3, v8, -20 * v3 + SwainMath.randomNumber(-100, 100) / 10, v4 * v3, 0.5, this._y + v7, 100, this._yscale * v3, true, 90, this.myDataRef.myWeapons[this.myWeapon]); if (this.myRoster != MadnessRoster.playerRoster && this.myDataRef.myWeapons[this.myWeapon].myClips > 0) { this.myDataRef.myWeapons[this.myWeapon].myClips = 0; } if (this.myDataRef.myWeapons[this.myWeapon].amHook) { this.thrownHook = true; } this.myDataRef.myWeapons[this.myWeapon] = undefined; } }; storedv2.launchGrenade = function () { var v3; if (this.myFacing == 'left' && !this.facingOpposite || this.myFacing == 'right' && this.facingOpposite) { v3 = -1; } else { v3 = 1; } var v5 = SwainMath.randomNumber(-300, 300) / 100; var v6 = 4; var v7 = -45 + 45 * ((Math.abs(this._parent.playerAim._rotation) - 20) / 90); var v8 = 40 * Math.abs(this._parent.playerAim._rotation / 90); var v2 = new Object(); var v4; if (this.mySprite.handShoot_front._visible) { v4 = this.mySprite.handShoot_front; } else { v4 = this.mySprite.handShoot_back; } v2.x = 0; v2.y = 0; v4.myGun.myShootPoint.localToGlobal(v2); this._parent.globalToLocal(v2); this._parent.createParticle(this.myDataRef.myWeapons[this.myWeapon].myDamageType, 'projectile', v2.x, v2.y, v8 * v3, v7, this._parent.playerAim._rotation, v6 * v3, 0.5, this._y + v5, 100, this._yscale * v3, true, 90, this.myDataRef.myWeapons[this.myWeapon]); }; storedv2.applyKnockback = function (inSource, inPower, inReverseBlast) { if (this.myHealth > 0 && !this.noDamage && inSource.myDataRef.myScale >= this.myDataRef.myScale) { this.myStatus = 'knockback'; this.dropGun(); if (inSource._x < this._x && this.myFacing == 'left' || inSource._x > this._x && this.myFacing == 'right') { this.mySubStatus = '_1'; } else { this.mySubStatus = '_2'; } if (inSource._x < this._x) { this.mySpeedRight = inPower; } else { this.mySpeedRight = -inPower; } if (inReverseBlast) { this.mySpeedRight *= -1; } } }; storedv2.meleeHealthHit = function (inAttacker, inWeapon) { if (this.myDataRef.myHat[0] != undefined || this.blocking && this.freakOutTimer == 0) { this.meleeHealth -= 1; this.meleeHealthTimer = 90; } if (this.meleeHealth == 0 && this.myHealth > 0) { if (this.blocking) { this.disarmGun(); this.myStatus = 'stun_parry' + SwainMath.randomNumber(1, 2); } else { if (this.myDataRef.myHat[0] != undefined) { --this.myDataRef.myHat[0].myIntegrity; if (this.myDataRef.myHat[0].myIntegrity == 0) { this.disarmArmor(this.myDataRef.myHat[0]); this.myStatus = 'stun_helmet'; } else { if (this.myDataRef.freakOut) { this.freakOutTimer = 300; } } } } this.meleeHealthTimer = 500; this.meleeHealth = 999; if (inAttacker.myDataRef.myScale >= this.myDataRef.myScale) { this.applyKnockback(inAttacker, 15, false); } else { if (this.myStatus.substr(0, 4) != 'stun') { this.mySprite.gotoAndStop('idle'); this.myStatus = 'stun' + SwainMath.randomNumber(4, 5); this.mySprite.gotoAndStop(this.myStatus); } } this.meleeHealth = this.myDataRef.meleeHealth; } }; storedv2.determineGameSpeed = function () { this.myGameSpeed = _root.myGameSpeed; if (this.myStatus == 'swap' && MadnessDataFile.havePerk('perkReload1', this.myDataRef)) { ++this.myGameSpeed; } if (this.slowMoActive && (this.myStatus.substr(0, 5) == 'melee' || this.myStatus.substr(0, 7) == 'unarmed') && MadnessDataFile.havePerk('perkBulletTime2', this.myDataRef)) { ++this.myGameSpeed; } if (this.myDataRef.myWeapons[this.myWeapon] == undefined && this.myStatus.substr(0, 7) == 'unarmed') { if (MadnessDataFile.havePerk('perkUnarmedSpeed3', this.myDataRef)) { ++this.myGameSpeed; } else { if (MadnessDataFile.havePerk('perkUnarmedSpeed2', this.myDataRef) && this.mySprite._currentframe >= this.mySprite._totalframes - 8 && this.mouseHold) { ++this.myGameSpeed; } else { if (MadnessDataFile.havePerk('perkUnarmedSpeed1', this.myDataRef) && this.mySprite._currentframe >= this.mySprite._totalframes - 4 && this.mouseHold) { ++this.myGameSpeed; } } } } if (this.meleeCombos <= 2 && this.myStatus.substr(0, 5) == 'melee' && this.mySprite._currentframe >= this.mySprite._totalframes - 7 && this.mouseHold) { ++this.myGameSpeed; } if (this.myDataRef.amSlow) { this.myGameSpeed = 0; } if (this.slowMoActive && (this.myStatus == 'run' || this.myStatus == 'backtrack' || this.myStatus == 'dash' || this.myStatus == 'idle' || this.myStatus == 'dodge') && (MadnessDataFile.havePerk('perkBulletTime1', this.myDataRef) || MadnessDataFile.havePerk('perkBulletTime4', this.myDataRef))) { ++this.myGameSpeed; } this.slowmoSpeedMod = 0.4 + 0.6 * this.myGameSpeed; if (this.slowMoActive && MadnessDataFile.havePerk('perkBulletTime4', this.myDataRef)) { this.slowmoSpeedMod += 0.3; } }; storedv2.takeCover = function (inObs) { if (inObs != undefined) { this.myStatus = 'cover'; this.actionTimer = 0; this.mySpeedRight = 0; this.mySpeedDown = 0; this.toggleGuard = false; inObs.inUse = this; } }; storedv2.deserterSurrender = function () { this.myRoster.removeCharacter(this.myDataRef); var v2 = this._parent.deserterRoster; v2.addCharacter(this.myDataRef); v2.makeActive(this.myDataRef); this.myFaction = v2.teamFaction; }; storedv1.doesUnitExist = function (inUnit) { var v3; var v2 = 0; while (v2 < MadnessCharacter.allRosters.length) { var v1 = 0; while (v1 < MadnessCharacter.allRosters[v2].myActiveMembers.length) { v3 = MadnessCharacter.allRosters[v2].myActiveMembers[v1]; if (v3.myCharacter == inUnit) { return true; } ++v1; } ++v2; } return false; }; storedv2.aimFlash = function () { this.aimFlashTimer = -15; this.myColor = new Color(this); }; storedv2.playSound = function (inSound) { SwainAudioPlayer.playSound(inSound, MadWorld.returnAudioPosition(this._x)); }; storedv2.reloadMe = function () { this.myDataRef.myWeapons[this.myWeapon].myAmmo = this.myDataRef.myWeapons[this.myWeapon].myAmmoMax; this.myDataRef.myWeapons[this.myWeapon].myClips -= 1; this.playSound('reload'); }; storedv2.returnAttackScore = function () { var v1 = new Number(); v1 = 25; if (MadnessGameSelect.gameMode == 'story') { v1 -= 10 * MadnessCharacter.damageDifficultyMod; } return v1; }; storedv2.testAddToLockList = function (inType, inLock, inTarget, inX, inY) { this.myLockList.push(inType + ': ' + inLock + ' ' + inTarget + ' ' + inX + '/' + inY); }; storedv2.traceLockList = function () { trace(' ----- Lock List for unit ' + this._name + ', aka ' + this.myDataRef.myCharacter + ' ----- '); var v2 = 0; while (v2 < this.myLockList.length) { trace(v2 + ': ' + this.myLockList[v2]); ++v2; } trace(' --------------------------------------- '); }; storedv1.damageDifficultyMod = new Number(); storedv1.playerLives = new Number(); storedv2.amPlayer = new Boolean(); storedv2.wounded = new Number(); storedv2.tacRerchargeDelay = 90; storedv2.tacTimer = new Number(); storedv2.tacDisplayTimer = new Number(); storedv2.myHeadArmor = new Number(); storedv2.myBodyArmor = new Number(); storedv2.meleeHealth = new Number(); storedv2.meleeHealthTimer = new Number(); storedv2.headSpray = 0; storedv2.bodySpray = 0; storedv2.headDamage = 0; storedv2.bodyDamage = 0; storedv2.headBloodTimer = 0; storedv2.noDamage = false; storedv2.deadMan = false; storedv2.amInjured = false; storedv2.myWeapon = new Number(); storedv2.myHat = new Number(); storedv2.myMask = new Number(); storedv2.myMouth = new Number(); storedv2.myShirt = new Number(); storedv2.recoilTimer = new Number(); storedv2.deathTimer = new Number(); storedv2.blocking = false; storedv2.pickupTimer = new Number(); storedv2.aimTimer = -1; storedv2.aimFlashTimer = 50; storedv2.lastHitTimer = new Number(); storedv2.emptyClipTimer = new Number(); storedv2.mySpeedRight = new Number(); storedv2.mySpeedDown = new Number(); storedv2.myStatus = new String(); storedv2.myFacing = new String(); storedv2.facingOpposite = false; storedv2.myGameSpeed = new Number(); storedv2.slowmoSpeedMod = new Number(); storedv2.actionSlowdown = false; storedv2.amDodging = false; storedv2.backtrackTimer = new Number(); storedv2.moveLeft = false; storedv2.moveRight = false; storedv2.moveUp = false; storedv2.moveDown = false; storedv2.toggleAction = false; storedv2.toggleGuard = false; storedv2.toggleReload = false; storedv2.togglePickup = false; storedv2.toggleSlowmo = false; storedv2.mouseTimer = -1; storedv2.mouseTime2x = 9; storedv2.mouseClick = false; storedv2.mouseReleaseTimer = 2; storedv2.mouseHold = false; storedv2.mouse2x = false; storedv2.myAimX = new Number(); storedv2.myAimY = new Number(); storedv2.mouseLock = false; storedv2.actionTimer = new Number(); storedv2.swapTimer = new Number(); storedv2.rofTimer = new Number(); storedv2.meleeCombos = new Number(); storedv2.meleeComboTimer = new Number(); storedv2.smgAimTimer = 1; storedv2.rofAdjust = new Number(); storedv2.shootWaitBuffer = 30; storedv2.rofLastFrame = 1; storedv2.reloadTimer = -1; storedv2.dashTimer = -1; storedv2.dashTimeEnable = 6; storedv2.lifeSpan = new Number(); storedv2.invincibleTimer = new Number(); storedv2.slowmoTimer = new Number(); storedv2.doorLock = false; storedv2.pathFind = false; storedv2.targetLock = false; storedv2.ignoreRooms = false; storedv2.interactTarget = undefined; storedv2.interactType = new String(); storedv2.myRoom = new Object(); storedv2.targetX = new Number(); storedv2.targetY = new Number(); storedv2.advanceX = new Number(); storedv2.advanceY = new Number(); storedv2.missionTimer = 99999999999.0; storedv2.shotTimer = 99999999999.0; storedv2.inRange = false; storedv2.shootReady = false; storedv2.myMorale = new Number(); storedv2.awake = true; storedv2.freakOutTimer = new Number(); storedv2.totalFrameDamage = new Number(); storedv2.thrownHook = false; label 111575: ASSetPropFlags(_global.MadnessCharacter.prototype, null, 1); #endinitclip } movieClip 4812 __Packages.MadnessDoors { #initclip if (!_global.MadnessDoors) { var v1 = function () { super(); this.stayOpen = new Array(); this.myEnterers = new Array(); this.myExiters = new Array(); this.mySprites = new Array(); this.myStarts = new Array(); this.onEnterFrame = this.tick; }; _global.MadnessDoors = v1; _global.MadnessDoors extends MovieClip; var v2 = v1.prototype; v2.init = function (inPlaceholder, inDataRef) { this.myDataRef = inDataRef; this.myDataRef.mySprite = this; this.myDir = this.myDataRef.myDir; this.myType = this.myDataRef.myType; this.amLocked = this.myDataRef.amLocked; this.noClose = this.myDataRef.noClose; this.noSpawn = this.myDataRef.noSpawn; this.gotoAndStop(this.myType + '_' + this.myDir); this._x = inPlaceholder._x; this._y = inPlaceholder._y; inPlaceholder._visible = false; var v3 = 0; while (this['start' + String(v3)] != undefined) { this.myStarts.push(this['start' + String(v3)]); this['start' + String(v3)]._visible = false; ++v3; } if (this.myDataRef.myConnection == undefined) { this.myLock._visible = false; } else { if (this.amLocked || this._parent.roomLock || this.myDataRef.myConnection == undefined) { this.myLock.gotoAndStop(1); } else { this.myLock.gotoAndStop(2); } } this.myLock.lockLight.gotoAndStop(this.myLock.lockLight._totalframes); this.myStatus = 'closed'; this.myDoor.stop(); this.myDoorBACK.stop(); this.noBullet._visible = false; var v2 = 0; while (v2 < this.myDataRef.myCharacters.length) { this.addCharacter(this.myDataRef.myCharacters[v2], 'enter'); ++v2; } if (MadnessGameSelect.gameMode == 'arena') { if (this.myDataRef.myConnection == MadnessRoster.storeRoster) { this.myDoor.myArt.amArena.gotoAndStop('gun'); this.myDoorBACK.myArt.amArena.gotoAndStop('gun'); } else { this.myDoor.myArt.amArena.gotoAndStop('skull'); this.myDoorBACK.myArt.amArena.gotoAndStop('skull'); } } else { if (this.myDataRef.myConnection == undefined) { this.myDoor.myArt.amArena.gotoAndStop('employees'); this.myDoorBACK.myArt.amArena.gotoAndStop('employees'); if (this.myType == 'door_left') { this.myDoor.myArt.amArena.mySign._xscale = -100; } } else { this.myDoor.myArt.amArena.gotoAndStop('none'); this.myDoorBACK.myArt.amArena.gotoAndStop('none'); } } if (this.myDataRef.myConnection == undefined) { this.myDoor.myArt.gotoAndStop(2); } else { this.myDoor.myArt.gotoAndStop(1); } }; v2.pauseTick = function () { if (!this._parent.paused) { this.onEnterFrame = this.tick; } }; v2.tick = function () { if (this._parent.paused) { this.onEnterFrame = this.pauseTick; } if (this.mySprites.length == 0) { this.currentStart = 0; this.currentStartIncrement = 1; this.mySpawnTimer = 0; } else { ++this.mySpawnTimer; } if (this.myDoorBACK != undefined) { if (this.myExiters.length > 0) { this.myDoorBACK._visible = true; this.myDoor._visible = false; } if (this.myEnterers.length > 0 || this.myEnterers.length == 0 && this.myExiters.length == 0 && this.mySprites.length == 0) { this.myDoorBACK._visible = false; this.myDoor._visible = true; } } while (this.myExiters.length > 0) { this.mySprites.push(this.makeSprite(this.myExiters[0])); this.myExiters.splice(0, 1); } if (this.myStatus == 'closed' || this.myDoor == undefined) { while (this.myEnterers.length > 0) { this.mySprites.push(this.makeSprite(this.myEnterers[0])); this.myEnterers.splice(0, 1); } if (this.mySprites.length > 0 && !this.amLocked) { this.myStatus = 'opening'; this.myDoor.gotoAndPlay('opening'); this.myDoorBACK.gotoAndPlay('opening'); if (this.myDoor != undefined) { SwainAudioPlayer.playSound('door1', MadWorld.returnAudioPosition(this._x)); } } } if (this.myStatus == 'open' && !this.noClose) { if (this.stayOpen.length == 0 && this.mySprites.length == 0) { this.myStatus = 'closing'; this.myDoor.gotoAndPlay('closing'); this.myDoorBACK.gotoAndPlay('closing'); if (this.myDoor != undefined) { SwainAudioPlayer.playSound('door1', MadWorld.returnAudioPosition(this._x)); } } } if (this.myStatus == 'open' || this.myDoor == undefined) { var v2 = 0; while (v2 < this.mySprites.length) { this.spriteAI(this.mySprites[v2]); ++v2; } } if (this.amLocked || this._parent.roomLock || this.myDataRef.myConnection == undefined) { this.myLock.gotoAndStop(1); } else { this.myLock.gotoAndStop(2); } }; v2.makeSprite = function (inChar) { var v4 = String(SwainMath.randomNumber(0, 99999999999.0)); this.spriteHolder.attachMovie('doors_sprite', 'newChar' + v4, this.spriteHolder.getNextHighestDepth()); var v2 = this.spriteHolder['newChar' + v4]; v2.gotoAndStop('idle'); v2.myMission = inChar.myDoorMission; v2.myDataRef = inChar; v2.reloadTimer = -1; v2.myStatus2 = 'idle'; v2.myWeapon = v2.myDataRef.myWeapon; if (this.myDir == 'right' && v2.myMission == 'enter' || this.myDir == 'left' && v2.myMission == 'exit' || this.myDir == 'down' && SwainMath.randomNumber(0, 1) == 0) { v2.myFacing = 'right'; } else { v2.myFacing = 'left'; } if (v2.myMission != 'exit') { if (this.myDir == 'down') { v2.goTimer = this.mySprites.length + SwainMath.randomNumber(1, 5); } else { v2.goTimer = this.mySprites.length + SwainMath.randomNumber(6, 18); } } if (v2.myMission == 'enter') { v2._x = this.myStarts[this.currentStart]._x; v2._y = this.myStarts[this.currentStart]._y; v2.targetX = 0; v2.targetY = 0; this.adjustCurrentStart(); } else { v2._x = v2.myDoorX - this._x; v2._y = v2.myDoorX - this._y; if (this.myDir == 'right' || this.myDir == 'left') { v2.targetX = this.myExit._x; v2.targetY = this.myExit._y; } else { var v5 = this.myStarts[SwainMath.randomNumber(0, this.myStarts.length - 1)]; v2.targetX = v5._x; v2.targetY = v5._y; } } if (v2.myFacing == 'left') { v2.myAimX = -5; } else { v2.myAimX = 5; } v2.myAimY = v2._y; v2.headDamage = 0; v2.bodydamage = 0; v2.myShirt = 0; v2.myHat = 0; v2.myMouth = 0; v2.myMask = 0; MadnessCharacter.adjustSprite(v2); v2._xscale = MadnessCharacter.setPerspectiveScale(this._x + v2._x, this._y + v2._y, this._parent.determineRoom(this._x, this._y)); v2._xscale *= v2.myDataRef.myScale; v2._yscale = v2._xscale; if (v2.myFacing == 'left') { v2._xscale *= -1; } this.removeFromReserveList(inChar); inChar.mySprite = undefined; return v2; }; v2.removeSprite = function (inSprite, inDelete) { var v2 = 0; while (v2 < this.mySprites.length) { if (inSprite == this.mySprites[v2]) { this.mySprites.splice(v2, 1); break; } ++v2; } if (inDelete) { inSprite.removeMovieClip(); false; } }; v2.addCharacter = function (inChar, inGoal) { inChar.myDoorMission = inGoal; inChar.myDoorX = inChar.mySprite._x; inChar.myDoorY = inChar.mySprite._y; inChar.mySprite = undefined; inChar.loggedX = undefined; inChar.loggedY = undefined; if (inGoal == 'enter') { this.myEnterers.push(inChar); } else { this.myExiters.push(inChar); } }; v2.removeCharacter = function (inChar) { var v2 = 0; while (v2 < this.myEnterers.length) { if (inChar == this.myEnterers[v2]) { this.myEnterers.splice(v2, 1); break; } ++v2; } v2 = 0; while (v2 < this.myExiters.length) { if (inChar == this.myExiters[v2]) { this.myExiters.splice(v2, 1); break; } ++v2; } }; v2.adjustCurrentStart = function () { this.currentStart += this.currentStartIncrement; if (this.currentStart > this.myStarts.length - 1) { this.currentStart = this.myStarts.length - 1; this.currentStartIncrement = -1; } if (this.currentStart < 0) { this.currentStart = 0; this.currentStartIncrement = 1; } }; v2.spriteAI = function (inSprite) { if (this.mySpawnTimer >= inSprite.goTimer && inSprite.myStatus2 == 'idle') { this.mySpawnTimer -= inSprite.goTimer / 1.5; inSprite.myStatus2 = 'run'; } if (inSprite.amDone) { inSprite.myStatus2 = 'idle'; } inSprite._xscale = MadnessCharacter.setPerspectiveScale(this._x + inSprite._x, this._y + inSprite._y, this._parent.determineRoom(this._x, this._y)); inSprite._xscale *= inSprite.myDataRef.myScale; inSprite._yscale = inSprite._xscale; var v6 = 0; var v7 = 0; if (this.myDir == 'down') { v6 = 25; } else { v7 = 25; } var v8 = 0.95 + 0.95 * _root.myGameSpeed; if (inSprite.myStatus2 == 'run' && !inSprite.amDone) { if (inSprite._x < inSprite.targetX - v6) { inSprite._x += inSprite.myDataRef.mySpeed * v8; inSprite.myFacing = 'right'; } else { if (inSprite._x > inSprite.targetX + v6) { inSprite._x -= inSprite.myDataRef.mySpeed * v8; inSprite.myFacing = 'left'; inSprite._xscale *= -1; } } if (inSprite._y < inSprite.targetY - v7) { inSprite._y += (inSprite.myDataRef.mySpeed / 2) * v8; } else { if (inSprite._y > inSprite.targetY + v7) { inSprite._y -= (inSprite.myDataRef.mySpeed / 2) * v8; } } } var v5 = this.mySprites; var v4 = 0; while (v4 < v5.length) { if (inSprite._y > v5[v4]._y && inSprite.getDepth() < v5[v4].getDepth()) { inSprite.swapDepths(v5[v4]); } ++v4; } if (inSprite._x <= inSprite.targetX + v6 + inSprite.myDataRef.mySpeed && inSprite._x >= inSprite.targetX + -v6 - inSprite.myDataRef.mySpeed) { if (inSprite._y <= inSprite.targetY + v7 + inSprite.myDataRef.mySpeed / 2 && inSprite._y >= inSprite.targetY + -v7 - inSprite.myDataRef.mySpeed / 2) { if (inSprite.myMission == 'enter') { this._parent.createSprite(inSprite.myDataRef, this, this._x + inSprite._x, this._y + inSprite._y); } v4 = 0; while (v4 < this.myDataRef.myCharacters.length) { if (inSprite.myDataRef == this.myDataRef.myCharacters[v4]) { this.myDataRef.myCharacters.splice(v4, 1); break; } ++v4; } this.removeSprite(inSprite, inSprite.myMission == 'enter' || this.myDir != 'down'); inSprite.amDone = true; inSprite.myStatus2 = 'idle'; } } inSprite.gotoAndStop(inSprite.myStatus2); MadnessCharacter.adjustSprite(inSprite); }; v2.keepDoorOpen = function (inChar) { this.stayOpen.push(inChar); }; v2.removeFromReserveList = function (inChar) { var v2 = 0; while (v2 < this.stayOpen.length) { if (inChar == this.stayOpen[v2]) { this.stayOpen.splice(v2, 1); break; } ++v2; } }; v2.lockMe = function () { this.myDataRef.amLocked = true; this.myDataRef.myConnection.amLocked = true; this.myDataRef.myConnection.mySprite.amLocked = true; this.amLocked = true; }; v2.unlockMe = function () { this.myDataRef.amLocked = false; this.myDataRef.myConnection.amLocked = false; this.myDataRef.myConnection.mySprite.amLocked = false; this.amLocked = false; }; v2.currentStart = 0; v2.currentStartIncrement = 1; ASSetPropFlags(_global.MadnessDoors.prototype, null, 1); } #endinitclip } movieClip 4813 __Packages.MadnessGameSelect { #initclip if (!_global.MadnessGameSelect) { var v1 = function () { super(); }; _global.MadnessGameSelect = v1; _global.MadnessGameSelect extends MovieClip; var v2 = v1.prototype; v2.init = function () { this.setContinueButton(); MadnessGameSelect.currentGameSelect = this; SwainAudioPlayer.playTrack('menu'); }; v2.tick = function () {}; v2.pressNext = function () { this.changeGameMode(1); this.init(); }; v2.pressPrev = function () { this.changeGameMode(-1); this.init(); }; v2.pressStory = function () { MadnessGameSelect.gameMode = 'story'; this.gotoAndStop('story'); this.setContinueButton(); SwainAudioPlayer.playSound('menu1', 0); }; v2.pressArena = function () { MadnessGameSelect.gameMode = 'arena'; this.gotoAndStop('arena'); this.setContinueButton(); SwainAudioPlayer.playSound('menu1', 0); }; v2.pressOptions = function () { this.gotoAndStop('options'); this.setQualityButtons(); SwainAudioPlayer.playSound('menu1', 0); }; v2.pressCredits = function () { this.gotoAndStop('credits'); SwainAudioPlayer.playSound('menu1', 0); }; v2.pressCheats = function () { this.gotoAndStop('cheats'); SwainAudioPlayer.playSound('menu1', 0); }; v2.pressMoarMadness = function () { this.getURL('http://www.newgrounds.com/collection/madness.html', '_blank'); SwainAudioPlayer.playSound('menu1', 0); }; v2.pressQuality = function (inQual) { _root._quality = inQual; this.setQualityButtons(); SwainAudioPlayer.playSound('menu1', 0); }; v2.setQualityButtons = function () { this.highTEXT._visible = _root._quality == 'HIGH'; this.medTEXT._visible = _root._quality == 'MEDIUM'; this.lowTEXT._visible = _root._quality == 'LOW'; this.highButton._visible = _root._quality != 'HIGH'; this.medButton._visible = _root._quality != 'MEDIUM'; this.lowButton._visible = _root._quality != 'LOW'; }; v2.setContinueButton = function () { this.continueButton._visible = MadnessGameSelect.testSaveExists(); this.continueTEXT._visible = !this.continueButton._visible; }; v2.assignRandomCharacter = function () { var v3 = MadnessGameSelect.gameMode; MadnessGameSelect.gameMode = 'story'; var v2 = new MadnessDataFile(); v2.createNew(MadnessGameSelect.menuCharacters[SwainMath.randomNumber(0, MadnessGameSelect.menuCharacters.length - 1)]); v2.myWeapons[0] = undefined; v2.myWeapons[1] = undefined; MadnessStoreHire.updateCharCard(this.charIcon, v2, false); this.charIcon.mySprite.play(); MadnessGameSelect.gameMode = v3; }; v2.changeGameMode = function (inDir) { var v2; var v1 = 0; while (v1 < MadnessGameSelect.allGameModes.length) { if (MadnessGameSelect.gameMode == MadnessGameSelect.allGameModes[v1]) { v2 = v1; break; } ++v1; } var v3; if (v2 == 0 && inDir == -1) { v3 = MadnessGameSelect.allGameModes.length - 1; } else { if (v2 == MadnessGameSelect.allGameModes.length - 1 && inDir == 1) { v3 = 0; } else { v3 = v2 + inDir; } } MadnessGameSelect.gameMode = MadnessGameSelect.allGameModes[v3]; }; v2.pressNew = function () { if (MadnessGameSelect.testSaveExists()) { SwainAudioPlayer.playSound('menu1', 0); MadnessPopup.addPopup('yesno', 'You\'re about to ruin the entirety of your data.', null, 425, 180, this, -1, MadnessGameSelect.pressYes, MadnessGameSelect.pressNo); } else { MadnessGameSelect.pressYes(); } }; v2.pressContinue = function () { MadnessGameSelect.loadGame(); MadnessCharacterCreator.newGame = false; if (!MadnessTransition.transitionLock) { _root.createTransition('fade', MadnessGameSelect.gameMode + '_menu_new', null); } SwainAudioPlayer.playSound('menu4', 0); }; v1.pressYes = function () { MadnessGameSelect.newGame(); MadnessCharacterCreator.newGame = true; if (!MadnessTransition.transitionLock) { if (MadnessGameSelect.gameMode == 'arena') { MadnessCutscene.storeCutsceneInfo('cutscene_arena1', MadnessGameSelect.gameMode + '_menu_new', null); _root.createTransition('fade', 'cutscene', null); } else { _root.createTransition('fade', MadnessGameSelect.gameMode + '_menu_new', null); } } SwainAudioPlayer.playSound('menu4', 0); }; v1.pressNo = function () { MadnessPopup.currentPopup.myDataRef.closePopup(); SwainAudioPlayer.playSound('menu4', 0); }; v1.testSaveExists = function () { var v1 = SharedObject.getLocal(MadnessGameSelect.gameMode + MadnessGameSelect.saveName + String(1)); return v1.data.haveSaved != undefined; }; v1.newGame = function () { if (MadnessGameSelect.gameMode == 'story') { MadnessGameSelect.storyProgressWorld0 = [false, false, false, false, false, false, false, false]; } if (MadnessGameSelect.gameMode == 'arena') { MadnessRoster.playerRoster = new MadnessRoster(); MadnessRoster.playerRoster.init('player'); var v2 = new MadnessDataFile(); v2.createNew('arena', false); MadnessRoster.playerRoster.addCharacter(v2); MadnessRoster.playerRoster.makeActive(v2); MadnessRoster.playerRoster.myCash = 200; _root.earnedXP = new Number(); _root.earnedCash = new Number(); MadnessRoster.storeRoster = new MadnessRoster(); MadnessRoster.storeRoster.init('store'); CharacterGenerator.storePopulator(); ItemGenerator.storePopulator(); _root.newArena = true; _root.generateArena(1); } MadnessGameSelect.saveGame(); MadnessGameSelect.loadGame(); }; v1.loadGame = function () { var v2 = SharedObject.getLocal(MadnessGameSelect.gameMode + MadnessGameSelect.saveName + String(1)); if (!MadnessGameSelect.testSaveExists()) { MadnessGameSelect.newGame(); trace('No Data'); } else { if (MadnessGameSelect.gameMode == 'story') { MadnessGameSelect.storyProgressWorld0 = v2.data.storyProgressWorld0; if (MadnessGameSelect.storyProgressWorld0 == undefined) { MadnessGameSelect.storyProgressWorld0 = [false, false, false, false, false, false, false, false]; } } if (MadnessGameSelect.gameMode == 'arena') { trace('Attempting Load:'); MadnessRoster.playerRoster = new MadnessRoster(); MadnessRoster.playerRoster.copyRoster(v2.data.playerRoster); MadnessRoster.playerRoster.convertCharactersToMadnessData(v2.data.playerRosterMembers); MadnessRoster.playerRoster.convertActiveMembers(); MadnessRoster.storeRoster = new MadnessRoster(); MadnessRoster.storeRoster.copyRoster(v2.data.storeRoster); MadnessRoster.storeRoster.convertCharactersToMadnessData(v2.data.storeRosterMembers); MadnessRoster.storeRoster.convertActiveMembers(); _root.newArena = v2.data.newArena; _root.generateArena(v2.data.currentWave); trace(' LOAD! ' + v2.data.newArena + ' ' + v2.data.currentWave); } trace('Data LOADED'); } }; v1.saveGame = function () { var v2 = SharedObject.getLocal(MadnessGameSelect.gameMode + MadnessGameSelect.saveName + String(1)); v2.data.haveSaved = true; if (MadnessGameSelect.gameMode == 'story') { v2.data.storyProgressWorld0 = MadnessGameSelect.storyProgressWorld0; } if (MadnessGameSelect.gameMode == 'arena') { trace('Attempting Save:'); var v3 = new MadnessRoster(); v3.copyRoster(MadnessRoster.playerRoster); v2.data.playerRosterMembers = v3.returnCharactersAsObjects(); v3.myMembers = new Array(); v2.data.playerRoster = Object(v3); v3 = new MadnessRoster(); v3.copyRoster(MadnessRoster.storeRoster); v2.data.storeRosterMembers = v3.returnCharactersAsObjects(); v3.myMembers = new Array(); v2.data.storeRoster = Object(v3); v2.data.newArena = _root.newArena; v2.data.currentWave = MadnessLevel.currentLevel.totalWaves; } v2.flush(); if (MadnessGameSelect.gameMode == 'arena') { trace(' SAVE! ' + v2.data.newArena + ' ' + v2.data.currentWave); } trace('After Save: ' + v2.getSize() * 0.001 + ' kb'); }; v1.closeGameSelect = function () { MadnessGameSelect.currentGameSelect.removeMovieClip(); }; v1.appropriateXP = function (inSource, inTarget, inType) { if (MadnessGameSelect.gameMode == 'arena') { var v3 = inTarget.myLevel * 20; if (inSource.myLevel > inTarget.myLevel) { v3 = v3 / 2 + v3 * (inTarget.myLevel / inSource.myLevel); } _root.earnedCash += v3; if (inSource == MadnessRoster.playerRoster.teamLeader) { ++inSource.myKills; var v4 = inTarget.myLevel * 10; if (v4 < 1) { v4 += 1; } _root.earnedXP += v4; } else { if (inSource.myRoster == MadnessRoster.playerRoster) { ++inSource.myKills; var v4 = inTarget.myLevel * 8; if (v4 < 1) { v4 += 1; } inSource.applyXP(v4); inSource.autoApplyPoints(); } } } if (inSource == MadnessRoster.playerRoster.teamLeader) { if (_root.myGameSpeed == 0) { inSource.mySlowMo += 10; } else { inSource.mySlowMo += 20; } if (inSource.mySlowMo > inSource.mySlowMoMax) { inSource.mySlowMo = inSource.mySlowMoMax; } } }; v1.beatStage = function (inWorld, inLevel) { trace('Beat level!'); MadnessGameSelect['storyProgressWorld' + String(inWorld)][inLevel] = true; trace(MadnessGameSelect['storyProgressWorld' + String(inWorld)]); MadnessGameSelect.saveGame(); }; v1.gameStarted = function () { if (MadnessGameSelect.gameMode == 'story') { if (MadnessGameSelect.myDifficulty == 'easy') { MadnessCharacter.playerLives = 2; } if (MadnessGameSelect.myDifficulty == 'normal') { MadnessCharacter.playerLives = 1; } if (MadnessGameSelect.myDifficulty == 'hard') { MadnessCharacter.playerLives = 0; } } if (MadnessGameSelect.gameMode == 'arena') { MadnessCharacter.playerLives = 0; } }; v1.myDifficulty = 'normal'; v1.allGameModes = ['story', 'arena', 'options']; v1.gameMode = MadnessGameSelect.allGameModes[0]; v1.saveName = 'MadnessTest3'; v1.menuCharacters = ['hank', 'sanford', 'deimos', 'civilian', 'agent']; ASSetPropFlags(_global.MadnessGameSelect.prototype, null, 1); } #endinitclip } movieClip 4814 __Packages.MadnessStoreHire { #initclip if (!_global.MadnessStoreHire) { var v1 = function () { super(); }; _global.MadnessStoreHire = v1; _global.MadnessStoreHire extends MovieClip; var v2 = v1.prototype; v2.init = function () { _root.menuBar.myCashTEXT.text = MadnessTeamSetup.returnPlayerCash(); var v5 = 0; while (this['storeIcon' + String(v5)] != undefined) { this['storeIcon' + String(v5)].removeMovieClip(); ++v5; } var v3; var v7 = 1; var v6 = 140; var v4 = 0; while (v4 < MadnessRoster.storeRoster.myMembers.length) { this['storeIcon' + String(v4)].removeMovieClip(); v3 = this.attachMovie('madness_char_icon', 'storeIcon' + String(v4), this.getNextHighestDepth()); v3._x = 425 + v4 * v6 - (MadnessRoster.storeRoster.myMembers.length - 1) * v6 / 2; v3._y = 360; v3.gotoAndStop('hire'); v3.closeCard._visible = true; v3.myDataRef = MadnessRoster.storeRoster.myMembers[v4]; MadnessStoreHire.updateCharCard(v3.spriteGroup, MadnessRoster.storeRoster.myMembers[v4], MadnessRoster.storeRoster.myMembers[v4 - 1] != undefined || v4 == 0); v3.buttonLead._visible = false; v3.charName2TEXT.text = v3.myDataRef.myName; v3.levelTEXT.text = 'Level ' + v3.myDataRef.myLevel; v3.barTEXT.text = MadnessDataFile.findHighestSkill(v3.myDataRef); v3.costTEXT.text = '$' + Math.ceil(v3.myDataRef.myHireCost); MadnessStoreHire.updateIndividualBar(v3.barMerc, v3.myDataRef['skill' + v3.barTEXT.text]); v3.healthTEXT.text = v3.myDataRef.myHealthMax; v3.tacBarTEXT.text = v3.myDataRef.myTacticsMax; v3.mySprite.cacheAsBitmap = true; v3.myShade.cacheAsBitmap = true; v3.amActive.cacheAsBitmap = true; ++v4; } this.resetBuyButtons(); this.displayCash = MadnessStoreHire.setDisplayCash(_root.myCash); this.squadmatesTEXT.text = String(Math.floor(MadnessRoster.playerRoster.teamLeader.statLEAD / 5)); if (Math.floor(MadnessRoster.playerRoster.teamLeader.statLEAD / 5) == 1) { this.squadmatesTEXT.text += ' SQUADMATE'; } else { this.squadmatesTEXT.text += ' SQUADMATES'; } if (MadnessRoster.storeRoster.myMembers.length == 0) { this.noHirelings._visible = true; } else { this.noHirelings._visible = false; } }; v2.pressBuy = function (inCard) { if (MadnessRoster.playerRoster.myCash >= inCard.myDataRef.myHireCost) { if (MadnessRoster.playerRoster.myMembers.length < MadnessRoster.maxRoster) { MadnessRoster.playerRoster.addCharacter(inCard.myDataRef); MadnessRoster.storeRoster.removeCharacter(inCard.myDataRef); MadnessRoster.playerRoster.myCash = Math.floor(MadnessRoster.playerRoster.myCash - inCard.myDataRef.myHireCost); this.init(); SwainAudioPlayer.playSound('buy', 0); SwainAudioPlayer.playSound('blunt', 0); } else { SwainAudioPlayer.playSound('nobuy', 0); } } else { SwainAudioPlayer.playSound('nobuy', 0); } }; v2.resetBuyButtons = function () {}; v1.setDisplayCash = function (inCash) { return '$' + String(inCash); }; v1.updateBars = function (inLoc, inData) { var v2 = ['barStr', 'barDex', 'barTac', 'barEnd', 'barLead', 'barAwr', 'barPistol', 'barRevolver', 'barSMG', 'barRifle', 'barShotgun', 'barMelee', 'barUnarmed']; var v6 = ['statSTR', 'statDEX', 'statTAC', 'statEND', 'statLEAD', 'statAWR', 'skillPistol', 'skillRevolver', 'skillSMG', 'skillRifle', 'skillShotgun', 'skillMelee', 'skillUnarmed']; var v7; var v3; var v8; inLoc.healthTEXT.text = inData.myHealthMax; inLoc.tacBarTEXT.text = inData.myTacticsMax; inLoc.levelTEXT.text = 'Level ' + inData.myLevel; inLoc.charName2TEXT.text = inData.myName; inLoc.charNameTEXT.text = inData.myName; var v1 = 0; while (v1 < v2.length) { v3 = inLoc[v2[v1]]; MadnessStoreHire.updateIndividualBar(v3, inData[v6[v1]]); ++v1; } }; v1.updateIndividualBar = function (inBar, inValue) { inBar.peg1.gotoAndStop(1); inBar.peg2.gotoAndStop(1); inBar.peg3.gotoAndStop(1); inBar.peg4.gotoAndStop(1); inBar.peg5.gotoAndStop(1); inBar.peg6.gotoAndStop(1); inBar.peg7.gotoAndStop(1); inBar.peg8.gotoAndStop(1); inBar.peg9.gotoAndStop(1); inBar.peg10.gotoAndStop(1); var v1 = 1; var v2 = 0; while (v2 < inValue) { inBar['peg' + v1].nextFrame(); ++v1; if (v1 > 10) { v1 = 1; } ++v2; } }; v1.updateCharCard = function (inCard, inData, inAddTeam) { if (inData != undefined) { inCard.gotoAndStop(1); inCard.myDataRef = inData; if (_root.storeItem != undefined && !_root.storeItem.finished) { inCard.myWeapon = 2; } else { inCard.myWeapon = 0; } if (_root.storeItem != undefined && !_root.storeItem.finished && _root.storeItem.myCategory == 'hat') { inCard.myHat = 2; } else { inCard.myHat = 0; } if (_root.storeItem != undefined && !_root.storeItem.finished && _root.storeItem.myCategory == 'mask') { inCard.myMask = 2; } else { inCard.myMask = 0; } if (_root.storeItem != undefined && !_root.storeItem.finished && _root.storeItem.myCategory == 'mouth') { inCard.myMouth = 2; } else { inCard.myMouth = 0; } if (_root.storeItem != undefined && !_root.storeItem.finished && _root.storeItem.myCategory == 'shirt') { inCard.myShirt = 2; } else { inCard.myShirt = 0; } inCard.myFacing = 'right'; inCard.reloadTimer = -1; inCard.statName = inCard.myDataRef.myName; inCard.mySprite.gotoAndStop(inCard.myDataRef.myIconPos); if (inCard._name == 'spriteGroup') { inCard.mySprite.gotoAndPlay(1); } MadnessCharacter.adjustSprite(inCard); MadnessCharacter.clearWounds(inCard, 'head'); MadnessCharacter.clearWounds(inCard, 'body'); MadnessCharacter.checkWounds(inCard); inCard.weaponSlot0.myWeapon.gotoAndStop(inCard.myDataRef.myWeapons[0].myType); inCard.weaponSlot1.myWeapon.gotoAndStop(inCard.myDataRef.myWeapons[1].myType); ItemGenerator.setItemSprite(inCard.weaponSlot0.myWeapon.mySprite, inCard.myDataRef.myWeapons[0]); ItemGenerator.setItemSprite(inCard.weaponSlot1.myWeapon.mySprite, inCard.myDataRef.myWeapons[1]); if (inCard.myDataRef.myWeapons[0] == undefined) { inCard.weaponSlot0.gotoAndStop(2); } if (inCard.myDataRef.myWeapons[1] == undefined) { inCard.weaponSlot1.gotoAndStop(2); } if (inCard.myDataRef.amSpecial) { inCard.myBG.gotoAndStop(2); } else { inCard.myBG.gotoAndStop(1); } } else { inCard.myDataRef = undefined; inCard.gotoAndStop(2); inCard.addChar._visible = false; } }; v2.rejectCharacter = function (inCard) {}; v2.gunClick = function (inCard, inWeapon) {}; v2.gunRollOver = function (inCard, inWeapon) {}; v2.gunRollOut = function (inCard, inWeapon) {}; v2.displayCash = new String(); v2.myRoster = 'store'; ASSetPropFlags(_global.MadnessStoreHire.prototype, null, 1); } #endinitclip } movieClip 4815 __Packages.MadnessTeamSetup { #initclip if (!_global.MadnessTeamSetup) { var v1 = function () { super(); }; _global.MadnessTeamSetup = v1; _global.MadnessTeamSetup extends MovieClip; var v2 = v1.prototype; v2.init = function () { _root.menuBar.myCashTEXT.text = MadnessTeamSetup.returnPlayerCash(); this.gotoAndStop(1); SwainAudioPlayer.playTrack('menu'); this.removeAllCards(); var v5 = 140; var v3; var v4 = 0; while (v4 < MadnessRoster.playerRoster.myActiveMembers.length) { this['storeIcon' + String(v4)].removeMovieClip(); v3 = this.attachMovie('madness_char_icon', 'storeIcon' + String(v4), this.getNextHighestDepth()); v3._x = 425 + v4 * v5 - (MadnessRoster.playerRoster.myActiveMembers.length - 1) * v5 / 2; v3._y = 380; v3.gotoAndStop(1); v3.closeCard._visible = true; v3.myDataRef = MadnessRoster.playerRoster.myActiveMembers[v4]; MadnessStoreHire.updateCharCard(v3.spriteGroup, MadnessRoster.playerRoster.myActiveMembers[v4], MadnessRoster.playerRoster.myActiveMembers[v4 - 1] != undefined || v4 == 0); this.setLeaderBar(v3); v3.charName2TEXT.text = v3.myDataRef.myName; v3.healthTEXT.text = v3.myDataRef.myHealthMax; v3.tacBarTEXT.text = v3.myDataRef.myTacticsMax; ++v4; } if (MadnessRoster.playerRoster.teamLeader == undefined && this.storeIcon0.spriteGroup.myDataRef != undefined) { this.makeLeader(this.storeIcon0.spriteGroup.myDataRef); } this.displayPage = 0; this.selectData = MadnessRoster.playerRoster.myMembers[0]; }; v2.init2 = function () { _root.menuBar.myCashTEXT.text = MadnessTeamSetup.returnPlayerCash(); this.gotoAndStop(2); SwainAudioPlayer.playTrack('menu'); this.removeAllCards(); var v3; var v7 = 5; var v11 = 80; var v8 = 105; var v5 = 6; var v6 = 3; var v10 = 300; var v9 = 170; if (this.selectData == undefined) { this.selectData = MadnessRoster.playerRoster.myMembers[0]; } var v4 = 0; while (v4 < v6 * v5) { v3 = this.attachMovie('madness_char_portrait', 'portrait' + String(v4), this.getNextHighestDepth()); if (v4 / v5 == Math.floor((v4 + 1) / v5)) { v3._x = v10; } else { v3._x = this['portrait' + (v4 - 1)]._x + v11 + v7; } v3._y = v9 + Math.floor(v4 / v5) * (v8 + v7); if (MadnessRoster.playerRoster.myMembers[v4 + Math.floor(this.displayPage * (v6 * v5))] != undefined) { MadnessStoreHire.updateCharCard(v3, MadnessRoster.playerRoster.myMembers[v4 + Math.floor(this.displayPage * (v6 * v5))], true); v3.amActive._visible = MadnessRoster.playerRoster.returnActiveCharacter(v3.myDataRef); v3.amActive.activeStar.gotoAndStop(1); if (MadnessRoster.playerRoster.teamLeader == v3.myDataRef) { v3.amActive.activeStar.gotoAndStop(2); } v3.myShade._visible = !(MadnessRoster.playerRoster.returnActiveCharacter(v3.myDataRef) || v3.myDataRef == this.selectData); v3.selectMe._visible = v3.myDataRef == this.selectData; } else { v3.gotoAndStop(3); v3.myBG.gotoAndStop(1); } v3.mySprite.cacheAsBitmap = true; v3.myShade.cacheAsBitmap = true; v3.amActive.cacheAsBitmap = true; ++v4; } this.pagePrev._visible = this.displayPage > 0; this.pageNext._visible = Math.floor((MadnessRoster.playerRoster.myMembers.length - 1) / v6 * v5) > this.displayPage; this.pageStringTEXT.text = 'PAGE ' + String(this.displayPage + 1); if (this.selectData != undefined) { this.selectDisplay.gotoAndStop(1); } else { this.selectDisplay.gotoAndStop('none'); } MadnessStoreHire.updateCharCard(this.selectDisplay.spriteGroup, this.selectData, true); MadnessStoreHire.updateBars(this.selectDisplay, this.selectData); this.myButtons.gotoAndStop('main'); if (this.selectData == MadnessRoster.playerRoster.teamLeader) { this.myButtons.buttonSquad.gotoAndStop('leader'); } else { if (MadnessRoster.playerRoster.returnActiveCharacter(this.selectData)) { this.myButtons.buttonSquad.gotoAndStop('active'); } else { if (MadnessRoster.playerRoster.myActiveMembers.length - 1 >= Math.floor(MadnessRoster.playerRoster.teamLeader.statLEAD / 5)) { this.myButtons.buttonSquad.gotoAndStop('full'); } else { this.myButtons.buttonSquad.gotoAndStop('add'); } } } if (this.selectData == MadnessRoster.playerRoster.teamLeader) { this.myButtons.buttonStats.gotoAndStop('player'); this.myButtons.buttonStats.statFlash._visible = this.selectData.statPoints > 0 || this.selectData.skillPoints > 0; } else { this.myButtons.buttonStats.gotoAndStop('follower'); this.myButtons.buttonStats.statFlash._visible = false; } }; v2.init3 = function () { _root.menuBar.myCashTEXT.text = MadnessTeamSetup.returnPlayerCash(); this.gotoAndStop(3); SwainAudioPlayer.playTrack('menu'); this.removeAllCards(); var v7 = 15; var v8 = 72; var v11 = 74; var v13 = 68; var v12 = 17; var v18 = 6; var v17 = 3; var v10 = 310; var v9 = 170; var v3; if (this.statCat == 'stat') { v3 = ['STR', 'DEX', 'TAC', 'END', 'LEAD', 'AWR']; } if (this.statCat == 'skill') { v3 = ['Pistol', 'SMG', 'Rifle', 'Shotgun', 'Melee', 'Unarmed']; } this.selectData = MadnessRoster.playerRoster.teamLeader; var v6 = 0; while (v6 < v3.length) { var v4 = 0; while (v4 < 4) { var v5 = this.attachMovie('perk_peg', 'peg' + String(v6) + '_' + String(v4), this.getNextHighestDepth()); v5._x = v10 + (v6 * v7 + v6 * v8); v5._y = v9 + v11 + v12 * v4; v5.gotoAndStop(1); if (this.selectData[this.statCat + v3[v6]] > v4 + 10 * this.displayPage) { v5.gotoAndStop(2 + this.displayPage); } v5.myStat = v3[v6]; v5.myNum = v4 + 1 + 10 * this.displayPage; v5.justBought._visible = this.purchasedStat == this.statCat + v5.myStat + v5.myNum; v5.amSelected._visible = false; ++v4; } ++v6; } v6 = 0; while (v6 < v3.length) { v4 = 5; while (v4 < 9) { v5 = this.attachMovie('perk_peg', 'peg' + String(v6) + '_' + String(v4), this.getNextHighestDepth()); v5._x = v10 + (v6 * v7 + v6 * v8); v5._y = v9 + v11 + v12 * (v4 - 1) + v13; v5.gotoAndStop(1); if (this.selectData[this.statCat + v3[v6]] > v4 + 10 * this.displayPage) { v5.gotoAndStop(2 + this.displayPage); } v5.myStat = v3[v6]; v5.myNum = v4 + 1 + 10 * this.displayPage; v5.justBought._visible = this.purchasedStat == this.statCat + v5.myStat + v5.myNum; v5.amSelected._visible = false; ++v4; } ++v6; } v6 = 0; while (v6 < v3.length) { v5 = this.attachMovie('perk_5', 'perk' + String(v6) + 'a', this.getNextHighestDepth()); v5._x = v10 + (v6 * v7 + v6 * v8); v5._y = v9 + v11 + v12 * 4; v5.gotoAndStop(1); this.myColorTransform = {'rb': 0, 'gb': 0, 'bb': 0}; if (this.selectData[this.statCat + v3[v6]] > 4 + 10 * this.displayPage) { v5.gotoAndStop(2 + this.displayPage); this.myColorTransform = {'rb': 255, 'gb': 255, 'bb': 255}; } else { v5.myLogo._alpha = 40; } v5.myLogo.gotoAndStop(v3[v6]); this.myColor = new Color(v5.myLogo); this.myColor.setTransform(this.myColorTransform); v5.myStat = v3[v6]; v5.myNum = 5 + 10 * this.displayPage; v5.justBought._visible = this.purchasedStat == this.statCat + v5.myStat + v5.myNum; v5.amSelected._visible = false; ++v6; } v6 = 0; while (v6 < v3.length) { v5 = this.attachMovie('perk_5', 'perk' + String(v6) + 'b', this.getNextHighestDepth()); v5._x = v10 + (v6 * v7 + v6 * v8); v5._y = v9 + v11 + v12 * 8 + v13; v5.gotoAndStop(1); this.myColorTransform = {'rb': 0, 'gb': 0, 'bb': 0}; if (this.selectData[this.statCat + v3[v6]] > 9 + 10 * this.displayPage) { v5.gotoAndStop(2 + this.displayPage); this.myColorTransform = {'rb': 255, 'gb': 255, 'bb': 255}; } else { v5.myLogo._alpha = 40; } v5.myLogo.gotoAndStop(v3[v6]); this.myColor = new Color(v5.myLogo); this.myColor.setTransform(this.myColorTransform); v5.myStat = v3[v6]; v5.myNum = 10 + 10 * this.displayPage; v5.justBought._visible = this.purchasedStat == this.statCat + v5.myStat + v5.myNum; v5.amSelected._visible = false; ++v6; } v6 = 0; while (v6 < v3.length) { v5 = this.attachMovie('perk_icon', 'icon' + String(v6), this.getNextHighestDepth()); v5._x = v10 + (v6 * v7 + v6 * v8); v5._y = v9; v5.gotoAndStop(v3[v6]); v5.myStat = v3[v6]; v5.myNum = 0; if (this.selectData[this.statCat + 'Points'] > 0 && this.selectData[this.statCat + v5.myStat] < this.selectData[this.statCat + 'Cap']) { v5.myBG.gotoAndStop(2); v5.myText.textColor = 16777215; } else { v5.myBG.gotoAndStop(1); v5.myText.textColor = 10066329; } ++v6; } this.pagePrev._visible = this.displayPage > 0; this.pageNext._visible = this.displayPage < 2; this.pageStringTEXT.text = 'PAGE ' + String(this.displayPage + 1); this.myButtons.gotoAndStop('sub'); this.myButtons.buttonBack.gotoAndStop('back'); this.myButtons.buttonAlt.gotoAndStop('none'); if (this.selectData != undefined) { this.selectDisplay.gotoAndStop(5); } else { this.selectDisplay.gotoAndStop('none'); } MadnessStoreHire.updateCharCard(this.selectDisplay.spriteGroup, this.selectData, true); MadnessStoreHire.updateBars(this.selectDisplay, this.selectData); this.myPointsTEXT.text = this.selectData[this.statCat + 'Points']; if (this.selectData[this.statCat + 'Points'] == 0) { this.pointsSpendTEXT.textColor = 10027008; this.myPointsTEXT.textColor = 10027008; } else { this.pointsSpendTEXT.textColor = 16777215; this.myPointsTEXT.textColor = 16777215; } }; v2.addTeammate = function (inData) { MadnessRoster.playerRoster.makeActive(inData); this.init(); }; v2.removeTeammate = function (inCard) { if (inCard.myDataRef != MadnessRoster.playerRoster.teamLeader) { MadnessRoster.playerRoster.removeActive(inCard.myDataRef); this.init(); } }; v2.makeLeader = function (inChar) { MadnessRoster.playerRoster.makeLeader(inChar); var v2 = 0; while (v2 < MadnessRoster.playerRoster.myActiveMembers.length) { this.setLeaderBar(this['storeIcon' + v2]); ++v2; } }; v2.pressPrev = function () { --this.displayPage; this.init2(); SwainAudioPlayer.playSound('menu2', 0); }; v2.pressNext = function () { ++this.displayPage; this.init2(); SwainAudioPlayer.playSound('menu2', 0); }; v2.pressPrev2 = function () { --this.displayPage; this.purchasedStat = ''; this.init3(); SwainAudioPlayer.playSound('menu2', 0); }; v2.pressNext2 = function () { ++this.displayPage; this.purchasedStat = ''; this.init3(); SwainAudioPlayer.playSound('menu2', 0); }; v2.setLeaderBar = function (inCard) { if (MadnessRoster.playerRoster.teamLeader == inCard.spriteGroup.myDataRef && MadnessRoster.playerRoster.teamLeader != undefined) { inCard.buttonLead.gotoAndStop(1); } else { if (inCard.spriteGroup.myDataRef != undefined) { inCard.buttonLead.gotoAndStop(2); } else { inCard.buttonLead.gotoAndStop(3); } } }; v2.pressLeader = function (inSprite) { this.makeLeader(inSprite.spriteGroup.myDataRef); SwainAudioPlayer.playSound('menu1', 0); }; v2.gunClick = function (inCard, inWeapon) { inCard.weaponSlot0.rollCover._visible = false; inCard.weaponSlot1.rollCover._visible = false; this._visible = false; this.selectData = inCard.myDataRef; _root.pickItems(true); SwainAudioPlayer.playSound('menu2', 0); }; v2.gunRollOver = function (inCard, inWeapon) {}; v2.gunRollOut = function (inCard, inWeapon) {}; v2.pressPortrait = function (inPortrait) { this.selectData = inPortrait.myDataRef; this.init2(); SwainAudioPlayer.playSound('menu2', 0); }; v2.pressConfirm = function () { if (MadnessRoster.playerRoster.myActiveMembers.length - 1 < Math.floor(MadnessRoster.playerRoster.teamLeader.statLEAD / 5)) { MadnessRoster.playerRoster.makeActive(this.selectData); this.init2(); SwainAudioPlayer.playSound('menu4', 0); } }; v2.pressRemove = function () { MadnessRoster.playerRoster.removeActive(this.selectData); this.init2(); SwainAudioPlayer.playSound('menu1', 0); }; v2.pressClose = function () { this.init2(); SwainAudioPlayer.playSound('menu1', 0); }; v2.pressStore = function () { _root.pickStore(); SwainAudioPlayer.playSound('menu4', 0); }; v2.pressStats = function (inCat) { if (inCat == '' || this.statCat == undefined) { this.statCat = 'stat'; } else { this.statCat = inCat; } this.displayPage = 0; this.init3(); SwainAudioPlayer.playSound('menu1', 0); }; v2.pressMyGear = function () { this._visible = false; _root.pickItems(true); SwainAudioPlayer.playSound('menu1', 0); }; v2.removeAllCards = function () { var v3 = 0; while (v3 <= MadnessRoster.playerRoster.myActiveMembers.length) { this['storeIcon' + String(v3)].removeMovieClip(); ++v3; } var v4 = 0; while (this['portrait' + String(v4)] != undefined) { this['portrait' + String(v4)].removeMovieClip(); ++v4; } v3 = 0; while (v3 < 6) { var v2 = 0; while (v2 < 4) { this['peg' + String(v3) + '_' + String(v2)].removeMovieClip(); ++v2; } ++v3; } v3 = 0; while (v3 < 6) { this['perk' + String(v3) + 'a'].removeMovieClip(); ++v3; } v3 = 0; while (v3 < 6) { v2 = 5; while (v2 < 9) { this['peg' + String(v3) + '_' + String(v2)].removeMovieClip(); ++v2; } ++v3; } v3 = 0; while (v3 < 6) { this['perk' + String(v3) + 'b'].removeMovieClip(); ++v3; } v3 = 0; while (v3 < 6) { this['icon' + String(v3)].removeMovieClip(); ++v3; } }; v2.clickStat = function (inIcon) { if (this.selectData[this.statCat + 'Points'] > 0 && this.selectData[this.statCat + inIcon.myStat] < this.selectData[this.statCat + 'Cap']) { this.selectData.buyStat(inIcon.myStat, this.statCat); this.displayPage = Math.floor((this.selectData[this.statCat + inIcon.myStat] - 1) / 10); this.purchasedStat = this.statCat + inIcon.myStat + this.selectData[this.statCat + inIcon.myStat]; this.init3(); SwainAudioPlayer.playSound('blunt', 0); } }; v2.displayStatInfo = function (inIcon) { inIcon.amSelected._visible = true; inIcon.amSelected.play(); MadnessDataFile.applyPerkDescription(inIcon.myStat, inIcon.myNum, this.selectDisplay.myNameTEXT, this.selectDisplay.myDescriptionTEXT, this.selectData); }; v1.returnPlayerCash = function () { var v1 = Math.floor(MadnessRoster.playerRoster.myCash); return '$' + v1; }; v2.displayCash = new String(); v2.myRoster = 'team'; v2.displayPage = 0; ASSetPropFlags(_global.MadnessTeamSetup.prototype, null, 1); } #endinitclip } movieClip 4816 __Packages.ItemGenerator { #initclip if (!_global.ItemGenerator) { var v1 = function () {}; _global.ItemGenerator = v1; var v2 = v1.prototype; v1.storePopulator = function () { MadnessRoster.storeRoster.myWeapons = new Array(); MadnessRoster.storeRoster.myArmor = new Array(); var v9 = ['head', 'machette', 'switchblade', 'ironknife', 'bowieknife', 'carbonknife', 'l337sword', 'ironsword', 'tangsword', 'carbonsword', 'dragonsword', 'binarysword', 'axe', 'bottle', 'urinal', 'mallet', 'bat', 'billyclub', 'baton', 'pipe', 'hammer', 'sign']; var v15 = ['ppk', 'beretta', 'glock20', 'prokiller460', 'deagle']; var v11 = ['500long', '500snub', '357long', '357snub']; var v14 = ['hk2', 'mp7', 'tmp', 'mp5k', 'mp5', 'pm9', 'oa93']; var v12 = ['ar15', 'sr3', 'ak74', 'm16', 'aug', 'ak74u', 'hk416', 'fnfal', 'm249', 'famas']; var v10 = ['97k', 'spas12', 'usas12']; var v13 = ['chaingun']; if (MadnessGameSelect.gameMode == 'arena') { trace('Populating arena Store'); var v1; if (MadnessRoster.playerRoster.teamLeader.myLevel < 3) { v1 = ['ppk', 'beretta']; } else { if (MadnessRoster.playerRoster.teamLeader.myLevel < 5) { v1 = ['ppk', 'beretta', 'glock20', 'prokiller460']; } else { if (MadnessRoster.playerRoster.teamLeader.myLevel < 8) { v1 = ['hk2', 'mp7', 'ppk', 'beretta', 'glock20', 'prokiller460', 'deagle', '97k']; } else { if (MadnessRoster.playerRoster.teamLeader.myLevel < 10) { v1 = ['hk2', 'mp7', 'tmp', 'mp5k', 'mp5', 'pm9', 'oa93', 'ppk', 'beretta', 'glock20', 'prokiller460', 'deagle', '97k', 'spas12']; } else { if (MadnessRoster.playerRoster.teamLeader.myLevel < 12) { v1 = ['ppk', 'beretta', 'glock20', 'prokiller460', 'deagle', 'hk2', 'mp7', 'tmp', 'mp5k', 'mp5', 'pm9', 'oa93', 'ar15', 'sr3', 'ak74', 'm16', 'aug', 'ak74u', 'hk416', '97k', 'spas12']; } else { v1 = ['ppk', 'beretta', 'glock20', 'prokiller460', 'deagle', 'hk2', 'mp7', 'tmp', 'mp5k', 'mp5', 'pm9', 'oa93', 'ar15', 'sr3', 'ak74', 'm16', 'aug', 'ak74u', 'hk416', '97k', 'spas12', 'm249', 'famas', 'usas12', 'm203']; } } } } } var v5 = ['switchblade', 'bottle', 'hammer', 'pipe', 'ironknife', 'mallet', 'bowieknife', 'bat', 'baton', 'carbonknife', 'billyclub', 'machette', 'ironsword', 'tangsword', 'carbonsword', 'axe', 'l337sword', 'dragonsword', 'sign', 'binarysword']; var v2 = 0; for (;;) { if (!(v2 < MadnessRoster.playerRoster.teamLeader.myLevel * 2 && v2 < v5.length)) break; v1.push(v5[v2]); ++v2; } var v3; v2 = 0; while (v2 < v1.length) { v3 = SwainMath.randomNumber(0, v1.length - 1); MadnessRoster.storeRoster.addWeapon(ItemGenerator.createWeapon(v1[v3], ItemGenerator.canSilence(v1[v3]) && SwainMath.randomNumber(0, 10) == 0)); ++v2; } var v7 = ['top', 'tiny', 'fedora', 'hat1', 'hat2', 'hat3', 'hat4', 'hat5', 'hat6', 'hat7', 'hair1', 'hair2', 'hair3', 'hair4', 'helmet1', 'helmet2', 'helmet3']; var v6 = ['mouth1', 'mouth2', 'mouth3', 'mouth4', 'mouth5', 'mouth6', 'mask1', 'chin1']; var v4 = ['hi1', 'hi2', 'hi3', 'hi4', 'shades1', 'shades2', 'shades3', 'shades4', 'shades5', 'shades6', 'shades7', 'shades8', 'goggles1', 'paintball1', 'paintball2']; var v8 = ['armor1', 'armor2', 'armor3', 'armor4', 'armor5', 'armor6', 'armor7', 'armor8', 'armor9', 'armor10', 'coat1', 'coat2', 'coat3']; v1 = new Array(); v2 = 0; while (v2 < v7.length) { v1.push(v7[v2]); ++v2; } v2 = 0; while (v2 < v6.length) { v1.push(v6[v2]); ++v2; } v2 = 0; while (v2 < v4.length) { v1.push(v4[v2]); ++v2; } v2 = 0; while (v2 < v8.length) { v1.push(v8[v2]); ++v2; } v2 = 0; for (;;) { if (!((v2 < 5 || v2 < MadnessRoster.playerRoster.teamLeader.myLevel * 2) && v2 < 40)) break; v3 = SwainMath.randomNumber(0, v1.length - 1); MadnessRoster.storeRoster.addArmor(ItemGenerator.createArmor(v1[v3])); ++v2; } } }; v1.createArmor = function (inType) { var v1 = new Object(); v1.myType = inType; v1.myOwner = undefined; v1.amArmor = true; v1.myIntegrity = 1; if (inType == 'horn') { v1.myName = 'Horns'; v1.myCat = 'hat'; v1.myArmor = 0; v1.myWeight = 'none'; v1.myPrice = 100; } else { if (inType == 'top') { v1.myName = 'Tophat'; v1.myCat = 'hat'; v1.myArmor = 0; v1.myWeight = 'none'; v1.myPrice = 100; } else { if (inType == 'tiny') { v1.myName = 'Tiny Tophat'; v1.myCat = 'hat'; v1.myArmor = 0; v1.myWeight = 'none'; v1.myPrice = 100; } else { if (inType == 'fedora') { v1.myName = 'Fedora'; v1.myCat = 'hat'; v1.myArmor = 0; v1.myWeight = 'none'; v1.myPrice = 100; } else { if (inType == 'hat1') { v1.myName = 'SWAT Cap'; v1.myCat = 'hat'; v1.myArmor = 0.5; v1.myWeight = 'light'; v1.myPrice = 200; } else { if (inType == 'hat2') { v1.myName = 'Leon Cap'; v1.myCat = 'hat'; v1.myArmor = 0.5; v1.myWeight = 'light'; v1.myPrice = 200; } else { if (inType == 'hat3') { v1.myName = 'Sweatband'; v1.myCat = 'hat'; v1.myArmor = 0.5; v1.myWeight = 'light'; v1.myPrice = 200; } else { if (inType == 'hat4') { v1.myName = 'Ballcap'; v1.myCat = 'hat'; v1.myArmor = 0.5; v1.myWeight = 'light'; v1.myPrice = 200; } else { if (inType == 'hat5') { v1.myName = 'Desperado'; v1.myCat = 'hat'; v1.myArmor = 0; v1.myWeight = 'none'; v1.myPrice = 100; } else { if (inType == 'hat6') { v1.myName = 'Bowler'; v1.myCat = 'hat'; v1.myArmor = 0; v1.myWeight = 'none'; v1.myPrice = 100; } else { if (inType == 'hat7') { v1.myName = 'Mad Hatter'; v1.myCat = 'hat'; v1.myArmor = 0; v1.myWeight = 'none'; v1.myPrice = 100; } else { if (inType == 'hair1') { v1.myName = 'Manhair 1'; v1.myCat = 'hat'; v1.myArmor = 0; v1.myWeight = 'none'; v1.myPrice = 100; } else { if (inType == 'hair2') { v1.myName = 'Manhair 2'; v1.myCat = 'hat'; v1.myArmor = 0; v1.myWeight = 'none'; v1.myPrice = 100; } else { if (inType == 'hair3') { v1.myName = 'Mohawk 1'; v1.myCat = 'hat'; v1.myArmor = 0; v1.myWeight = 'none'; v1.myPrice = 100; } else { if (inType == 'hair4') { v1.myName = 'Mohawk 2'; v1.myCat = 'hat'; v1.myArmor = 0; v1.myWeight = 'none'; v1.myPrice = 100; } else { if (inType == 'hair5') { v1.myName = 'Krinkels Hawk'; v1.myCat = 'hat'; v1.myArmor = 0.5; v1.myWeight = 'light'; v1.myPrice = 200; } else { if (inType == 'helmet1') { v1.myName = 'Soldier Helm'; v1.myCat = 'hat'; v1.myArmor = 2; v1.myWeight = 'med'; v1.myPrice = 500; } else { if (inType == 'helmet2') { v1.myName = 'Riot Helm'; v1.myCat = 'hat'; v1.myArmor = 3; v1.myWeight = 'heavy'; v1.myPrice = 1200; } else { if (inType == 'helmet3') { v1.myName = 'Blast Helm'; v1.myCat = 'hat'; v1.myArmor = 3; v1.myWeight = 'heavy'; v1.myPrice = 1200; } else { if (inType == 'helmetgolem1') { v1.myName = 'G:013M Helm'; v1.myCat = 'hat'; v1.myArmor = 100; v1.myWeight = 'heavy'; v1.myPrice = 9999999999.0; v1.myIntegrity = 1; } else { if (inType == 'helmetgolem2') { v1.myName = 'G:014M Helm'; v1.myCat = 'hat'; v1.myArmor = 100; v1.myWeight = 'heavy'; v1.myPrice = 9999999999.0; v1.myIntegrity = 3; } else { if (inType == 'mouth1') { v1.myName = 'Breather'; v1.myCat = 'mouth'; v1.myArmor = 0.5; v1.myWeight = 'light'; v1.myPrice = 200; } else { if (inType == 'mouth2') { v1.myName = 'Breather'; v1.myCat = 'mouth'; v1.myArmor = 0.5; v1.myWeight = 'light'; v1.myPrice = 200; } else { if (inType == 'mouth3') { v1.myName = 'Bandana 1'; v1.myCat = 'mouth'; v1.myArmor = 0.5; v1.myWeight = 'light'; v1.myPrice = 200; } else { if (inType == 'mouth4') { v1.myName = 'Breather'; v1.myCat = 'mouth'; v1.myArmor = 0.5; v1.myWeight = 'light'; v1.myPrice = 200; } else { if (inType == 'mouth5') { v1.myName = 'Breather'; v1.myCat = 'mouth'; v1.myArmor = 0.5; v1.myWeight = 'light'; v1.myPrice = 200; } else { if (inType == 'mouth6') { v1.myName = 'Bandana 2'; v1.myCat = 'mouth'; v1.myArmor = 0.5; v1.myWeight = 'light'; v1.myPrice = 200; } else { if (inType == 'mask1') { v1.myName = 'Skimask'; v1.myCat = 'mouth'; v1.myArmor = 0; v1.myWeight = 'none'; v1.myPrice = 100; } else { if (inType == 'chin1') { v1.myName = 'Krinkels Scruff'; v1.myCat = 'mouth'; v1.myArmor = 0; v1.myWeight = 'none'; v1.myPrice = 100; } else { if (inType == 'hi1') { v1.myName = 'Bi-Techs'; v1.myCat = 'mask'; v1.myArmor = 0.5; v1.myWeight = 'light'; v1.myPrice = 200; } else { if (inType == 'hi2') { v1.myName = 'Uni-Visor'; v1.myCat = 'mask'; v1.myArmor = 0.5; v1.myWeight = 'light'; v1.myPrice = 200; } else { if (inType == 'hi3') { v1.myName = 'Tri-Techs'; v1.myCat = 'mask'; v1.myArmor = 0.5; v1.myWeight = 'light'; v1.myPrice = 200; } else { if (inType == 'hi4') { v1.myName = 'Uni-Techs'; v1.myCat = 'mask'; v1.myArmor = 0.5; v1.myWeight = 'light'; v1.myPrice = 200; } else { if (inType == 'shades1') { v1.myName = 'Radio-Shades'; v1.myCat = 'mask'; v1.myArmor = 0; v1.myWeight = 'none'; v1.myPrice = 100; } else { if (inType == 'shades2') { v1.myName = 'Krinkels Specs'; v1.myCat = 'mask'; v1.myArmor = 0; v1.myWeight = 'none'; v1.myPrice = 100; } else { if (inType == 'shades3') { v1.myName = 'State Troopers'; v1.myCat = 'mask'; v1.myArmor = 0; v1.myWeight = 'none'; v1.myPrice = 100; } else { if (inType == 'shades4') { v1.myName = 'Sir Eltons'; v1.myCat = 'mask'; v1.myArmor = 0; v1.myWeight = 'none'; v1.myPrice = 100; } else { if (inType == 'shades5') { v1.myName = 'Professionals'; v1.myCat = 'mask'; v1.myArmor = 0; v1.myWeight = 'none'; v1.myPrice = 100; } else { if (inType == 'shades6') { v1.myName = 'Hank Shades'; v1.myCat = 'mask'; v1.myArmor = 0; v1.myWeight = 'none'; v1.myPrice = 100; } else { if (inType == 'shades7') { v1.myName = 'Blueblockers'; v1.myCat = 'mask'; v1.myArmor = 0; v1.myWeight = 'none'; v1.myPrice = 100; } else { if (inType == 'shades8') { v1.myName = '3-D'; v1.myCat = 'mask'; v1.myArmor = 0; v1.myWeight = 'none'; v1.myPrice = 100; } else { if (inType == 'goggles1') { v1.myName = 'Dr. Horrible'; v1.myCat = 'mask'; v1.myArmor = 0; v1.myWeight = 'none'; v1.myPrice = 100; } else { if (inType == 'paintball1') { v1.myName = 'Paintball Mask'; v1.myCat = 'mask'; v1.myArmor = 1; v1.myWeight = 'light'; v1.myPrice = 200; } else { if (inType == 'paintball2') { v1.myName = 'Paintball Mask'; v1.myCat = 'mask'; v1.myArmor = 1; v1.myWeight = 'light'; v1.myPrice = 200; } else { if (inType == 'armor1') { v1.myName = 'Padded Vest'; v1.myCat = 'shirt'; v1.myArmor = 3; v1.myWeight = 'light'; v1.myPrice = 200; } else { if (inType == 'armor2') { v1.myName = 'Utility Vest'; v1.myCat = 'shirt'; v1.myArmor = 2; v1.myWeight = 'light'; v1.myPrice = 200; } else { if (inType == 'armor3') { v1.myName = 'Armored Vest'; v1.myCat = 'shirt'; v1.myArmor = 3; v1.myWeight = 'light'; v1.myPrice = 200; } else { if (inType == 'armor4') { v1.myName = 'Armored Vest'; v1.myCat = 'shirt'; v1.myArmor = 3; v1.myWeight = 'light'; v1.myPrice = 200; } else { if (inType == 'armor5') { v1.myName = 'Armored Vest'; v1.myCat = 'shirt'; v1.myArmor = 5; v1.myWeight = 'med'; v1.myPrice = 500; } else { if (inType == 'armor6') { v1.myName = 'Metal Vest'; v1.myCat = 'shirt'; v1.myArmor = 10; v1.myWeight = 'heavy'; v1.myPrice = 1200; } else { if (inType == 'armor7') { v1.myName = 'Metal Vest'; v1.myCat = 'shirt'; v1.myArmor = 10; v1.myWeight = 'heavy'; v1.myPrice = 1200; } else { if (inType == 'armor8') { v1.myName = 'Armored Vest'; v1.myCat = 'shirt'; v1.myArmor = 6; v1.myWeight = 'med'; v1.myPrice = 500; } else { if (inType == 'armor9') { v1.myName = 'Armored Suit'; v1.myCat = 'shirt'; v1.myArmor = 6; v1.myWeight = 'med'; v1.myPrice = 500; } else { if (inType == 'armor10') { v1.myName = 'Padded Suit'; v1.myCat = 'shirt'; v1.myArmor = 6; v1.myWeight = 'med'; v1.myPrice = 500; } else { if (inType == 'coat1') { v1.myName = 'Long Coat'; v1.myCat = 'shirt'; v1.myArmor = 0.5; v1.myWeight = 'light'; v1.myPrice = 200; } else { if (inType == 'coat2') { v1.myName = 'Duster'; v1.myCat = 'shirt'; v1.myArmor = 0.5; v1.myWeight = 'light'; v1.myPrice = 200; } else { if (inType == 'coat3') { v1.myName = 'Trenchcoat'; v1.myCat = 'shirt'; v1.myArmor = 0.5; v1.myWeight = 'light'; v1.myPrice = 200; } else { if (inType == 'armorgolem1') { v1.myName = 'G:013M Suit'; v1.myCat = 'shirt'; v1.myArmor = 100; v1.myWeight = 'heavy'; v1.myPrice = 99999999999.0; } else { if (inType == 'armorgolem2') { v1.myName = 'G:014M Suit'; v1.myCat = 'shirt'; v1.myArmor = 100; v1.myWeight = 'heavy'; v1.myPrice = 99999999999.0; } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } if (v1.myCat == 'hat') { v1.myDescription = 'Cover up that pretty skull with something your enemies can take aim at.'; } if (v1.myCat == 'mask') { v1.myDescription = 'They couldn\'t see your eyes before, but now you can be extra certain of it.'; } if (v1.myCat == 'mouth') { v1.myDescription = 'Take your inner badass to the next level with some sweet gob gear.'; } if (v1.myCat == 'shirt') { v1.myDescription = 'Your head isn\'t the only vital point on your body that needs covering.'; } v1.myNameFull = v1.myName; return v1; }; v1.createWeapon = function (inType, silencer) { var v1 = new Object(); v1.ammoArray = new Array(); v1.amArmor = false; v1.myType = inType; v1.myOwner = undefined; v1.upgradeSight = false; v1.upgradeLaser = false; v1.myColor = 1; v1.upgradeSilencer = silencer; v1.myRoster = undefined; v1.myFaction = undefined; v1.noPickup = false; v1.myWeight = 'none'; v1.amHook = false; v1.myDescription = 'HELLO'; v1.singleBulletClip = false; v1.amWeapon = true; if (inType == 'hk2') { v1.myTag = 'SMG - HK2'; v1.myName = 'H&K SMG2'; v1.mySound = 'smg3'; v1.twoHand = true; v1.melee = false; v1.myCat = 'smg'; v1.myDamageType = 'bullet'; v1.myCasing = 'casing_pistol'; v1.myNameFull = 'H&K SMG2 9x19mm'; v1.myDescription = 'Rather ordinary sub machine-gun for rather ordinary sub-machinegun tasts. Perfoms well across the board.'; v1.myROF = 10; v1.myDamage = 8; v1.mySpread = 6; v1.myRange = 120; v1.myShots = 1; v1.myAmmo = 30; } else { if (inType == 'mp7') { v1.myTag = 'SMG - MP7'; v1.myName = 'H&K MP7'; v1.mySound = 'smg3'; v1.twoHand = true; v1.melee = false; v1.myCat = 'smg'; v1.myDamageType = 'bullet'; v1.myCasing = 'casing_PDW'; v1.myNameFull = 'H&K MP7 4.7x30mm'; v1.myDescription = 'High magazine capacity, decent power output, good rate of fire. Just another great way to mess up someone\'s day.'; v1.myROF = 8; v1.myDamage = 7; v1.mySpread = 5; v1.myRange = 120; v1.myShots = 1; v1.myAmmo = 40; } else { if (inType == 'tmp') { v1.myTag = 'SMG - TMP'; v1.myName = 'Steyr TMP'; v1.mySound = 'smg1'; v1.twoHand = true; v1.melee = false; v1.myCat = 'smg'; v1.myDamageType = 'bullet'; v1.myCasing = 'casing_pistol'; v1.myNameFull = 'Steyr TMP 9x19mm'; v1.myDescription = 'A firearm made popular by its insane rate of fire. With this you can invite everone in the room to a bullet party nearly instantly!'; v1.myROF = 4; v1.myDamage = 8; v1.mySpread = 10; v1.myRange = 120; v1.myShots = 1; v1.myAmmo = 30; } else { if (inType == 'mp5k') { v1.myTag = 'SMG - MP5k'; v1.myName = 'H&K MP5K'; v1.mySound = 'smg1'; v1.twoHand = true; v1.melee = false; v1.myCat = 'smg'; v1.myDamageType = 'bullet'; v1.myCasing = 'casing_pistol'; v1.myNameFull = 'H&K MP5K 9x19mm'; v1.myDescription = 'A more petite alternatice to your traditional full auto while still maintaining a modicum of accuracy and control.'; v1.myROF = 6; v1.myDamage = 7; v1.mySpread = 10; v1.myRange = 120; v1.myShots = 1; v1.myAmmo = 30; } else { if (inType == 'mp5') { v1.myTag = 'SMG - MP5'; v1.myName = 'H&K MP5'; v1.mySound = 'smg3'; v1.twoHand = true; v1.melee = false; v1.myCat = 'smg'; v1.myDamageType = 'bullet'; v1.myCasing = 'casing_pistol'; v1.myNameFull = 'H&K MP5 9x19mm'; v1.myDescription = 'Made popular in Nevada for one reason: It is very good at what it does.'; v1.myROF = 6; v1.myDamage = 8; v1.mySpread = 6; v1.myRange = 120; v1.myShots = 1; v1.myAmmo = 30; } else { if (inType == 'pm9') { v1.myTag = 'SMG - Mineaba PM9'; v1.myName = 'Mineaba PM9'; v1.mySound = 'smg1'; v1.twoHand = true; v1.melee = false; v1.myCat = 'smg'; v1.myDamageType = 'bullet'; v1.myCasing = 'casing_pistol'; v1.myNameFull = 'Mineaba PM9 9x19mm'; v1.myDescription = 'This submachinegun trades some accuracy for rate of fire while keeping (most) of it\'s overall power intact.'; v1.myROF = 4; v1.myDamage = 8; v1.mySpread = 6; v1.myRange = 120; v1.myShots = 1; v1.myAmmo = 25; } else { if (inType == 'oa93') { v1.myTag = 'SMG - OA93'; v1.myName = 'O.A.93'; v1.mySound = 'smg2'; v1.twoHand = true; v1.melee = false; v1.myCat = 'smg'; v1.myDamageType = 'bullet2'; v1.myCasing = 'casing_rifle'; v1.myNameFull = 'O.A.93 5.56x45mm'; v1.myDescription = 'A grossly oversized pistol firing a rifle round in a fully automatic manner. This gun is an identity crisis that shoots bullets.'; v1.myROF = 12; v1.myDamage = 10; v1.mySpread = 10; v1.myRange = 120; v1.myShots = 1; v1.myAmmo = 30; } else { if (inType == 'ar15') { v1.myTag = 'Rifle - AR15'; v1.myName = 'AR-15'; v1.mySound = 'ar15'; v1.twoHand = true; v1.melee = false; v1.myCat = 'rifle'; v1.myDamageType = 'bullet2'; v1.myCasing = 'casing_rifle'; v1.myNameFull = 'AR-15 5.56x39mm'; v1.myDescription = 'The most mast produced .223 rifle the world has ever seen. A great all-purpose rifle, just don\'t forget your cleaning kit.'; v1.myROF = 6; v1.myDamage = 11; v1.mySpread = 4; v1.myRange = 200; v1.myShots = 1; v1.myAmmo = 30; } else { if (inType == 'sr3') { v1.myTag = 'Rifle - SR3'; v1.myName = 'SR-3'; v1.mySound = 'sr3'; v1.twoHand = true; v1.melee = false; v1.myCat = 'rifle'; v1.myDamageType = 'bullet2'; v1.myCasing = 'casing_rifle9'; v1.myNameFull = 'SR-3 9x39mm'; v1.myDescription = 'Tiny rifle bullets might do for your run of the mill gunfigher, but others might go for this gun. The SR3 is both brutal and compact.'; v1.myROF = 10; v1.myDamage = 12; v1.mySpread = 6; v1.myRange = 200; v1.myShots = 1; v1.myAmmo = 20; } else { if (inType == 'ak74') { v1.myTag = 'Rifle - AK74'; v1.myName = 'AK-74'; v1.mySound = 'ak74'; v1.twoHand = true; v1.melee = false; v1.myCat = 'rifle'; v1.myDamageType = 'bullet2'; v1.myCasing = 'casing_rifle'; v1.myNameFull = 'AK-74 5.45x39mm'; v1.myDescription = 'This rifle will be a handy thing to have around when body armor starts getting popular in Nevada.'; v1.myROF = 12; v1.myDamage = 11; v1.mySpread = 6; v1.myRange = 200; v1.myShots = 1; v1.myAmmo = 30; } else { if (inType == 'm16') { v1.myTag = 'Rifle - M16'; v1.myName = 'Colt M-16'; v1.mySound = 'ar15'; v1.twoHand = true; v1.melee = false; v1.myCat = 'rifle'; v1.myDamageType = 'bullet2'; v1.myCasing = 'casing_rifle'; v1.myNameFull = 'Colt M-16 5.56x39mm'; v1.myDescription = 'Powerful, accurate, and with a crazy rate of fire. The drawback? The vintage 20 round magazines.'; v1.myROF = 6; v1.myDamage = 12; v1.mySpread = 2; v1.myRange = 200; v1.myShots = 1; v1.myAmmo = 30; } else { if (inType == 'aug') { v1.myTag = 'Rifle - AUG'; v1.myName = 'Steyr AUG'; v1.mySound = 'steyr'; v1.twoHand = true; v1.melee = false; v1.myCat = 'rifle'; v1.myDamageType = 'bullet2'; v1.myCasing = 'casing_rifle'; v1.myNameFull = 'Steyr AUG 5.56x45mm'; v1.myDescription = 'Classic bullpup rifle. Great all arounder plus an extra large magazine for extra dead bad guys.'; v1.myROF = 8; v1.myDamage = 11; v1.mySpread = 2; v1.myRange = 200; v1.myShots = 1; v1.myAmmo = 40; } else { if (inType == 'ak74u') { v1.myTag = 'Rifle - AK74U'; v1.myName = 'AK-74U'; v1.mySound = 'ak74'; v1.twoHand = true; v1.melee = false; v1.myCat = 'rifle'; v1.myDamageType = 'bullet2'; v1.myCasing = 'casing_rifle'; v1.myNameFull = 'AK-74U 5.45x39mm'; v1.myDescription = 'A small rifle useful for taking down small men. Not to be underestimated, as this rifle can hold it\'s own in just about any scenario.'; v1.myROF = 10; v1.myDamage = 9; v1.mySpread = 6; v1.myRange = 200; v1.myShots = 1; v1.myAmmo = 30; } else { if (inType == 'hk416') { v1.myTag = 'Rifle - HK416'; v1.myName = 'H&K M-416'; v1.mySound = 'smg2'; v1.twoHand = true; v1.melee = false; v1.myCat = 'rifle'; v1.myDamageType = 'bullet2'; v1.myCasing = 'casing_rifle'; v1.myNameFull = 'H&K M-416 5.56x39mm'; v1.myDescription = 'Nothing says \'tactical\' like plastic guns! Piston operated, like an AK, but easier to control at a high rate of fire, like an AR. Best of both worlds.'; v1.myROF = 8; v1.myDamage = 11; v1.mySpread = 4; v1.myRange = 200; v1.myShots = 1; v1.myAmmo = 30; } else { if (inType == 'fnfal') { v1.myTag = 'Rifle - FN FAL'; v1.myName = 'FN FAL'; v1.mySound = 'fnfal'; v1.twoHand = true; v1.melee = false; v1.myCat = 'rifle'; v1.myDamageType = 'bullet2'; v1.myCasing = 'casing_huge'; v1.myNameFull = 'FN FAL 7.62x51mm'; v1.myDescription = 'The most powerful rifle in the Nexus Project armor. When you have to cut down mooks with heavy body armor, this is the gun you turn to.'; v1.myROF = 10; v1.myDamage = 14; v1.mySpread = 1; v1.myRange = 200; v1.myShots = 1; v1.myAmmo = 20; } else { if (inType == 'm249') { v1.myTag = 'Rifle - M249'; v1.myName = 'M-249'; v1.mySound = 'm249'; v1.twoHand = true; v1.melee = false; v1.myCat = 'rifle'; v1.myDamageType = 'bullet2'; v1.myCasing = 'casing_huge'; v1.myNameFull = 'M-249 5.56x45mm'; v1.myDescription = 'Extreme capacity! Reloading is a pain in the ass, but chances are that everone will be dead before you even need to reload.'; v1.myROF = 6; v1.myDamage = 12; v1.mySpread = 6; v1.myRange = 200; v1.myShots = 1; v1.myAmmo = 200; } else { if (inType == 'famas') { v1.myTag = 'Rifle - FAMAS'; v1.myName = 'FAMAS'; v1.mySound = 'FAMAS'; v1.twoHand = true; v1.melee = false; v1.myCat = 'rifle'; v1.myDamageType = 'bullet2'; v1.myCasing = 'casing_rifle'; v1.myNameFull = 'FAMAS 5.56x45mm'; v1.myDescription = 'This weapon trades magazine capacity for rate of fire and accuracy. A very effective tool for shooting apples off of people\'s heads.'; v1.myROF = 6; v1.myDamage = 11; v1.mySpread = 2; v1.myRange = 200; v1.myShots = 1; v1.myAmmo = 25; } else { if (inType == '97k') { v1.myTag = 'Shotgun - Norinco97k'; v1.myName = 'Norinco 97k'; v1.mySound = 'shotgun'; v1.twoHand = true; v1.melee = false; v1.myCat = 'shotgun'; v1.myDamageType = 'bullet'; v1.myCasing = 'casing_shotgun'; v1.myNameFull = 'Norinco 97k 12-Gauge'; v1.myDescription = 'Box magazine fed pump action shotgun. Great for making lasting impressions.'; v1.myROF = 40; v1.myDamage = 7; v1.mySpread = 9; v1.myRange = 160; v1.myShots = 5; v1.myAmmo = 5; v1.havePump = true; } else { if (inType == 'spas12') { v1.myTag = 'Shotgun - SPAS12'; v1.myName = 'SPAS-12'; v1.singleBulletClip = true; v1.mySound = 'shotgun'; v1.twoHand = true; v1.melee = false; v1.myCat = 'shotgun'; v1.myDamageType = 'bullet'; v1.myCasing = 'casing_shotgun'; v1.myNameFull = 'SPAS-12 12-Gauge'; v1.myDescription = 'Top of the line tactical shotgun. Perfect for clearing particularly busy rooms.'; v1.myROF = 40; v1.myDamage = 7; v1.mySpread = 9; v1.myRange = 160; v1.myShots = 5; v1.myAmmo = 8; v1.havePump = true; } else { if (inType == 'usas12') { v1.myTag = 'Shotgun - USAS12'; v1.myName = 'USAS-12'; v1.mySound = 'shotgun'; v1.twoHand = true; v1.melee = false; v1.myCat = 'shotgun'; v1.myDamageType = 'bullet'; v1.myCasing = 'casing_shotgun'; v1.myNameFull = 'USAS-12 12-Gauge'; v1.myDescription = 'This high capacity, box magazine fed, fully automatic shotgun is perfect for those days you just don\'t feel like aiming.'; v1.myROF = 14; v1.myDamage = 7; v1.mySpread = 9; v1.myRange = 160; v1.myShots = 5; v1.myAmmo = 10; v1.havePump = false; } else { if (inType == 'ppkmag') { v1.myTag = 'Pistol - PPK'; v1.myName = 'Magnum PPK'; v1.mySound = 'shotgun'; v1.myType = 'ppk'; v1.twoHand = false; v1.melee = false; v1.myCat = 'pistol'; v1.myDamageType = 'bullet2'; v1.myCasing = 'casing_pistol'; v1.myNameFull = 'Walther PPK 9x17mm'; v1.myDescription = 'The magnified version of a famiiar weapon.'; v1.myROF = 30; v1.myDamage = 20; v1.mySpread = 6; v1.myRange = 110; v1.myShots = 1; v1.myAmmo = 8; } else { if (inType == 'ppk') { v1.myTag = 'Pistol - PPK'; v1.myName = 'Walther PPK'; v1.mySound = 'ppk'; v1.twoHand = false; v1.melee = false; v1.myCat = 'pistol'; v1.myDamageType = 'bullet'; v1.myCasing = 'casing_pistol'; v1.myNameFull = 'Walther PPK 9x17mm'; v1.myDescription = 'A compact alternative to larger, more dangerous firearms. A classic weapon with classic application.'; v1.myROF = 20; v1.myDamage = 5; v1.mySpread = 6; v1.myRange = 110; v1.myShots = 1; v1.myAmmo = 8; } else { if (inType == 'beretta') { v1.myTag = 'Pistol - Beretta'; v1.myName = 'Beretta 92'; v1.mySound = 'beretta'; v1.twoHand = false; v1.melee = false; v1.myCat = 'pistol'; v1.myDamageType = 'bullet'; v1.myCasing = 'casing_pistol'; v1.myNameFull = 'Beretta 92 9x19mm'; v1.myDescription = 'A popular firearm due to an impressive magazine capacity and decent damage. Especially handy for confrontations with numerous antagonists.'; v1.myROF = 18; v1.myDamage = 7; v1.mySpread = 6; v1.myRange = 110; v1.myShots = 1; v1.myAmmo = 18; } else { if (inType == 'glock20') { v1.myTag = 'Pistol - Glock20'; v1.myName = 'Glock 20'; v1.mySound = 'glock'; v1.twoHand = false; v1.melee = false; v1.myCat = 'pistol'; v1.myDamageType = 'bullet'; v1.myCasing = 'casing_pistol'; v1.myNameFull = 'Glock 20 10x25mm'; v1.myDescription = 'This weapon is a combination of high capacity and high power. Among the best overall combat pistols Nevada has ever seen.'; v1.myROF = 16; v1.myDamage = 8; v1.mySpread = 6; v1.myRange = 110; v1.myShots = 1; v1.myAmmo = 15; } else { if (inType == 'prokiller460') { v1.myTag = 'Pistol - Prokiller460'; v1.myName = '1911A1 Custom'; v1.mySound = 'prokiller'; v1.twoHand = false; v1.melee = false; v1.myCat = 'pistol'; v1.myDamageType = 'bullet2'; v1.myCasing = 'casing_revolver'; v1.myNameFull = '1911A1 Custom .460Rowland'; v1.myDescription = 'When .45acp isn\'t enough, reach for this custom 1911A1 chambered in the powerful .460 Rowland Magnum. Top shelf brutality.'; v1.myROF = 16; v1.myDamage = 11; v1.mySpread = 6; v1.myRange = 110; v1.myShots = 1; v1.myAmmo = 7; } else { if (inType == 'deagle') { v1.myTag = 'Pistol - Deagle'; v1.myName = 'Desert Eagle'; v1.mySound = 'deagle'; v1.twoHand = false; v1.melee = false; v1.myCat = 'pistol'; v1.myDamageType = 'bullet2'; v1.myCasing = 'casing_revolver'; v1.myNameFull = 'Desert Eagle .50Action'; v1.myDescription = 'What more needs to be said about this semi automatic magic wand? Just wave it at the bad guys and shout \'Headicus Explodicus!\''; v1.myROF = 20; v1.myDamage = 12; v1.mySpread = 6; v1.myRange = 110; v1.myShots = 1; v1.myAmmo = 7; } else { if (inType == '500long') { v1.myTag = 'Pistol - 500'; v1.myName = 'S&W 500'; v1.mySound = '500'; v1.twoHand = false; v1.melee = false; v1.myCat = 'revolver'; v1.myDamageType = 'bullet2'; v1.myCasing = 'casing_revolver'; v1.myNameFull = 'S&W 500 .500 Magnum'; v1.myDescription = 'The absolute final word in one handed calibur pissing matches.'; v1.myROF = 20; v1.myDamage = 13; v1.mySpread = 2; v1.myRange = 200; v1.myShots = 1; v1.myAmmo = 5; } else { if (inType == '500snub') { v1.myTag = 'Pistol - 500_Snub'; v1.myName = 'S&W 500 Snub'; v1.mySound = '500'; v1.twoHand = false; v1.melee = false; v1.myCat = 'revolver'; v1.myDamageType = 'bullet2'; v1.myCasing = 'casing_revolver'; v1.myNameFull = 'S&W 500 Snub .500 Magnum'; v1.myDescription = 'A compact answer to the lifelong question \'What am I going to do about all these jerks all up in my face?\''; v1.myROF = 20; v1.myDamage = 11; v1.mySpread = 10; v1.myRange = 90; v1.myShots = 1; v1.myAmmo = 5; } else { if (inType == '357long') { v1.myTag = 'Pistol - 357'; v1.myName = 'Colt Revolver'; v1.mySound = '357'; v1.twoHand = false; v1.melee = false; v1.myCat = 'revolver'; v1.myDamageType = 'bullet2'; v1.myCasing = 'casing_revolver'; v1.myNameFull = 'Colt Revolver .357 Magnum'; v1.myDescription = 'Powerful, accurate, and stylish. Handy for breaking through the more durable foes in Nevada.'; v1.myROF = 20; v1.myDamage = 12; v1.mySpread = 2; v1.myRange = 200; v1.myShots = 1; v1.myAmmo = 6; } else { if (inType == '357snub') { v1.myTag = 'Pistol - 357_Snub'; v1.myName = 'Snub Colt'; v1.mySound = '357'; v1.twoHand = false; v1.melee = false; v1.myCat = 'revolver'; v1.myDamageType = 'bullet2'; v1.myCasing = 'casing_revolver'; v1.myNameFull = 'Snub Colt Revolver .357 Magnum'; v1.myDescription = 'Very powerful short range cannon. It puts down mooks fast so long as you\'re right up against them.'; v1.myROF = 20; v1.myDamage = 10; v1.mySpread = 10; v1.myRange = 90; v1.myShots = 1; v1.myAmmo = 6; } else { if (inType == 'chaingun') { v1.myTag = 'Heavy - Chaingun'; v1.myName = 'MINIGUN'; v1.noPickup = true; v1.mySound = 'chaingun'; v1.twoHand = true; v1.melee = false; v1.myCat = 'heavy'; v1.myDamageType = 'bullet2'; v1.myCasing = 'casing_huge'; v1.myNameFull = 'MINIGUN 7.62x51mm'; v1.myDescription = 'HOW DID YOU GET THIS? THIS DOES NOT BELONG TO YOU. YOU DO NOT BELONG IN NEVADA.'; v1.myROF = 4; v1.myDamage = 14; v1.mySpread = 2; v1.myRange = 200; v1.myShots = 1; v1.myAmmo = 9999999; } else { if (inType == 'm203') { v1.myTag = 'Heavy - M203'; v1.myName = 'M-203'; v1.mySound = 'm203'; v1.twoHand = true; v1.melee = false; v1.myCat = 'heavy'; v1.myDamageType = 'grenade'; v1.myCasing = 'casing_grenade'; v1.myNameFull = 'M-203 40x46mm H.E.'; v1.myDescription = 'This weapon will disperse the crowds with ease. Mind the range, however, these \'nades don\'t feature range safety.'; v1.myROF = 20; v1.myDamage = 20; v1.mySpread = 2; v1.myRange = 300; v1.myShots = 1; v1.myAmmo = 1; } else { if (inType == 'switchblade') { v1.myTag = 'Melee'; v1.myName = 'Switchblade'; v1.twoHand = false; v1.melee = true; v1.myCat = 'melee'; v1.myHealth = 20; v1.myHealthMax = v1.myHealth; v1.myNameFull = v1.myName; v1.myDescription = 'If you didn\'t know they made blades this small, it\'s because you never saw the other guy packing it.'; v1.myROF = 30; v1.myPiercing = 5; v1.myShots = 1; v1.myRange = 85; v1.brokeRange = v1.myRange / 2; v1.myDamage = 2; v1.myDamageType = 'blade'; v1.myAmmo = 1; v1.myCasing = 'spark1'; v1.mySpread = 3; } else { if (inType == 'ironknife') { v1.myTag = 'Melee'; v1.myName = 'Iron Knife'; v1.twoHand = false; v1.melee = true; v1.myCat = 'melee'; v1.myHealth = 30; v1.myHealthMax = v1.myHealth; v1.myNameFull = v1.myName; v1.myDescription = 'Your standard kitchenware, repurposed as a utensil of death. Don\'t expect much.'; v1.myROF = 30; v1.myPiercing = 5; v1.myShots = 1; v1.myRange = 105; v1.brokeRange = v1.myRange / 2; v1.myDamage = 3; v1.myDamageType = 'blade'; v1.myAmmo = 1; v1.myCasing = 'spark1'; v1.mySpread = 3; } else { if (inType == 'bowieknife') { v1.myTag = 'Melee'; v1.myName = 'Bowie Knife'; v1.twoHand = false; v1.melee = true; v1.myCat = 'melee'; v1.myHealth = 30; v1.myHealthMax = v1.myHealth; v1.myNameFull = v1.myName; v1.myDescription = 'Named for the famous knife fighter who died defending the Alamo. Now you can be just like him, except for the dead part.'; v1.myROF = 30; v1.myPiercing = 5; v1.myShots = 1; v1.myRange = 105; v1.brokeRange = v1.myRange / 2; v1.myDamage = 5; v1.myDamageType = 'blade'; v1.myAmmo = 1; v1.myCasing = 'spark1'; v1.mySpread = 3; } else { if (inType == 'carbonknife') { v1.myTag = 'Melee'; v1.myName = 'Carbon Knife'; v1.twoHand = false; v1.melee = true; v1.myCat = 'melee'; v1.myHealth = 100; v1.myHealthMax = v1.myHealth; v1.myNameFull = v1.myName; v1.myDescription = 'Specially crafted short blade with an outstanding lifespan. It may even outlast its wielder.'; v1.myROF = 30; v1.myPiercing = 5; v1.myShots = 1; v1.myRange = 105; v1.brokeRange = v1.myRange / 2; v1.myDamage = 6; v1.myDamageType = 'blade'; v1.myAmmo = 1; v1.myCasing = 'spark1'; v1.mySpread = 3; } else { if (inType == 'machette') { v1.myTag = 'Melee'; v1.myName = 'Machette'; v1.twoHand = false; v1.melee = true; v1.myCat = 'melee'; v1.myHealth = 40; v1.myHealthMax = v1.myHealth; v1.myNameFull = v1.myName; v1.myDescription = 'Take aim at your opponents\' heads and watch them fall like so many jungle vines.'; v1.myROF = 30; v1.myPiercing = 5; v1.myShots = 1; v1.myRange = 115; v1.brokeRange = v1.myRange / 2; v1.myDamage = 7; v1.myDamageType = 'blade'; v1.myAmmo = 1; v1.myCasing = 'spark1'; v1.mySpread = 3; } else { if (inType == 'ironsword') { v1.myTag = 'Melee'; v1.myName = 'Iron Sword'; v1.twoHand = false; v1.melee = true; v1.myCat = 'melee'; v1.myHealth = 50; v1.myHealthMax = v1.myHealth; v1.myNameFull = v1.myName; v1.myDescription = 'You don\'t need to be Edward the Black Prince to kill just as many people with his blade.'; v1.myROF = 30; v1.myPiercing = 5; v1.myShots = 1; v1.myRange = 130; v1.brokeRange = v1.myRange / 2; v1.myDamage = 8; v1.myDamageType = 'blade'; v1.myAmmo = 1; v1.myCasing = 'spark1'; v1.mySpread = 3; } else { if (inType == 'tangsword') { v1.myTag = 'Melee'; v1.myName = 'Megachette'; v1.twoHand = false; v1.melee = true; v1.myCat = 'melee'; v1.myHealth = 50; v1.myHealthMax = v1.myHealth; v1.myNameFull = v1.myName; v1.myDescription = 'This mighty hack-n-slasher resembles the Full Tang of a bladed weapon, but with a tremendous amount of heft for that extra cleaving power.'; v1.myROF = 30; v1.myPiercing = 5; v1.myShots = 1; v1.myRange = 130; v1.brokeRange = v1.myRange / 2; v1.myDamage = 9; v1.myDamageType = 'blade'; v1.myAmmo = 1; v1.myCasing = 'spark1'; v1.mySpread = 3; } else { if (inType == 'carbonsword') { v1.myTag = 'Melee'; v1.myName = 'Carbon Sword'; v1.twoHand = false; v1.melee = true; v1.myCat = 'melee'; v1.myHealth = 100; v1.myHealthMax = v1.myHealth; v1.myNameFull = v1.myName; v1.myDescription = 'Like the Carbon Knife, this sword will only leave your posession when pried from your cold, dead hands.'; v1.myROF = 30; v1.myPiercing = 5; v1.myShots = 1; v1.myRange = 130; v1.brokeRange = v1.myRange / 2; v1.myDamage = 10; v1.myDamageType = 'blade'; v1.myAmmo = 1; v1.myCasing = 'spark1'; v1.mySpread = 3; } else { if (inType == 'l337sword') { v1.myTag = 'Melee'; v1.myName = 'L337 Sword'; v1.twoHand = false; v1.melee = true; v1.myCat = 'melee'; v1.myHealth = 50; v1.myHealthMax = v1.myHealth; v1.myNameFull = v1.myName; v1.myDescription = 'Rumor has it that this line of swords were manifested digitally. \\startup_KILL() PROTOCOL*>'; v1.myROF = 30; v1.myPiercing = 5; v1.myShots = 1; v1.myRange = 130; v1.brokeRange = v1.myRange / 2; v1.myDamage = 16; v1.myDamageType = 'blade'; v1.myAmmo = 1; v1.myCasing = 'spark1'; v1.mySpread = 3; } else { if (inType == 'dragonsword') { v1.myTag = 'Melee'; v1.myName = 'Dragon Sword'; v1.twoHand = false; v1.melee = true; v1.myCat = 'melee'; v1.myHealth = 100; v1.myHealthMax = v1.myHealth; v1.myNameFull = v1.myName; v1.myDescription = 'Defend your dojo with great honor using this masterfully crafted piece of ancient weaponry.'; v1.myROF = 30; v1.myPiercing = 5; v1.myShots = 1; v1.myRange = 130; v1.brokeRange = v1.myRange / 2; v1.myDamage = 12; v1.myDamageType = 'blade'; v1.myAmmo = 1; v1.myCasing = 'spark1'; v1.mySpread = 3; } else { if (inType == 'binarysword') { v1.myTag = 'Melee'; v1.myName = 'Binary Sword'; v1.twoHand = false; v1.melee = true; v1.myCat = 'melee'; v1.myHealth = 200; v1.myHealthMax = v1.myHealth; v1.myNameFull = v1.myName; v1.myDescription = 'Light and dark. Black and white. Life and death. The Binary Sword holds no middle grounds as it turns your opponents OFF.'; v1.myROF = 30; v1.myPiercing = 5; v1.myShots = 1; v1.myRange = 135; v1.brokeRange = v1.myRange / 2; v1.myDamage = 20; v1.myDamageType = 'blade'; v1.myAmmo = 1; v1.myCasing = 'spark1'; v1.mySpread = 3; } else { if (inType == 'axe') { v1.myTag = 'Melee'; v1.myName = 'Axe'; v1.twoHand = false; v1.melee = true; v1.myCat = 'melee'; v1.myHealth = 50; v1.myHealthMax = v1.myHealth; v1.myNameFull = v1.myName; v1.myDescription = 'Can you not tell a lie? Doesn\'t matter. Chop \'em all down anyway.'; v1.myROF = 30; v1.myPiercing = 5; v1.myShots = 1; v1.myRange = 115; v1.brokeRange = v1.myRange / 2; v1.myDamage = 8; v1.myDamageType = 'blade'; v1.myAmmo = 1; v1.myCasing = 'spark1'; v1.mySpread = 3; } else { if (inType == 'head') { v1.myTag = 'Melee'; v1.myName = 'Severed Head'; v1.twoHand = false; v1.melee = true; v1.myCat = 'melee'; v1.myHealth = 10; v1.myHealthMax = v1.myHealth; v1.myNameFull = v1.myName; v1.myDescription = 'Where\'d you get that filthy thing?'; v1.myROF = 30; v1.myPiercing = 5; v1.myShots = 1; v1.myRange = 105; v1.brokeRange = v1.myRange / 2; v1.myDamage = 4; v1.myDamageType = 'blunt'; v1.myAmmo = 1; v1.myCasing = 'spark1'; v1.mySpread = 3; } else { if (inType == 'mallet') { v1.myTag = 'Melee'; v1.myName = 'Mallet'; v1.twoHand = false; v1.melee = true; v1.myCat = 'melee'; v1.myHealth = 20; v1.myHealthMax = v1.myHealth; v1.myNameFull = v1.myName; v1.myDescription = 'Whack-a-Mole has never been so wet and splattery.'; v1.myROF = 30; v1.myPiercing = 5; v1.myShots = 1; v1.myRange = 125; v1.brokeRange = v1.myRange / 2; v1.myDamage = 6; v1.myDamageType = 'blunt'; v1.myAmmo = 1; v1.myCasing = 'spark1'; v1.mySpread = 3; } else { if (inType == 'bat') { v1.myTag = 'Melee'; v1.myName = 'Baseball Bat'; v1.twoHand = false; v1.melee = true; v1.myCat = 'melee'; v1.myHealth = 20; v1.myHealthMax = v1.myHealth; v1.myNameFull = v1.myName; v1.myDescription = 'Aim for an opponent\'s skull and be thankful for all those times you skipped Soldier Training to go play a round of tee-ball.'; v1.myROF = 30; v1.myPiercing = 5; v1.myShots = 1; v1.myRange = 115; v1.brokeRange = v1.myRange / 2; v1.myDamage = 9; v1.myDamageType = 'blunt'; v1.myAmmo = 1; v1.myCasing = 'spark1'; v1.mySpread = 3; } else { if (inType == 'billyclub') { v1.myTag = 'Melee'; v1.myName = 'Billy Club'; v1.twoHand = false; v1.melee = true; v1.myCat = 'melee'; v1.myHealth = 30; v1.myHealthMax = v1.myHealth; v1.myNameFull = v1.myName; v1.myDescription = 'A favorite for law enforcement in the company of hostile combatants.'; v1.myROF = 30; v1.myPiercing = 5; v1.myShots = 1; v1.myRange = 120; v1.brokeRange = v1.myRange / 2; v1.myDamage = 8; v1.myDamageType = 'blunt'; v1.myAmmo = 1; v1.myCasing = 'spark1'; v1.mySpread = 3; } else { if (inType == 'baton') { v1.myTag = 'Melee'; v1.myName = 'Baton'; v1.twoHand = false; v1.melee = true; v1.myCat = 'melee'; v1.myHealth = 30; v1.myHealthMax = v1.myHealth; v1.myNameFull = v1.myName; v1.myDescription = 'Another official-capacity weapon for the subjugation of lesser beings.'; v1.myROF = 30; v1.myPiercing = 5; v1.myShots = 1; v1.myRange = 105; v1.brokeRange = v1.myRange / 2; v1.myDamage = 7; v1.myDamageType = 'blunt'; v1.myAmmo = 1; v1.myCasing = 'spark1'; v1.mySpread = 3; } else { if (inType == 'pipe') { v1.myTag = 'Melee'; v1.myName = 'Iron Pipe'; v1.twoHand = false; v1.melee = true; v1.myCat = 'melee'; v1.myHealth = 20; v1.myHealthMax = v1.myHealth; v1.myNameFull = v1.myName; v1.myDescription = 'The damage isn\'t anything to brag about, but the range of a stainless steel pipe is a definite perk.'; v1.myROF = 30; v1.myPiercing = 5; v1.myShots = 1; v1.myRange = 125; v1.brokeRange = v1.myRange / 2; v1.myDamage = 6; v1.myDamageType = 'blunt'; v1.myAmmo = 1; v1.myCasing = 'spark1'; v1.mySpread = 3; } else { if (inType == 'hammer') { v1.myTag = 'Melee'; v1.myName = 'Hammer'; v1.twoHand = false; v1.melee = true; v1.myCat = 'melee'; v1.myHealth = 20; v1.myHealthMax = v1.myHealth; v1.myNameFull = v1.myName; v1.myDescription = 'Jesus was a carpenter, so why not?'; v1.myROF = 30; v1.myPiercing = 5; v1.myShots = 1; v1.myRange = 95; v1.brokeRange = v1.myRange / 2; v1.myDamage = 5; v1.myDamageType = 'blunt'; v1.myAmmo = 1; v1.myCasing = 'spark1'; v1.mySpread = 3; } else { if (inType == 'bottle') { v1.myTag = 'Melee'; v1.myName = 'Bottle'; v1.twoHand = false; v1.melee = true; v1.myCat = 'melee'; v1.myHealth = 8; v1.myHealthMax = v1.myHealth; v1.myNameFull = v1.myName; v1.myDescription = 'Sometimes you\'ve just gotta mix business with pleasure.'; v1.myROF = 30; v1.myPiercing = 5; v1.myShots = 1; v1.myRange = 95; v1.brokeRange = v1.myRange / 2; v1.myDamage = 5; v1.myDamageType = 'blunt'; v1.myAmmo = 1; v1.myCasing = 'spark1'; v1.mySpread = 3; } else { if (inType == 'urinal') { v1.myTag = 'Melee'; v1.myName = 'Urinal'; v1.twoHand = false; v1.melee = true; v1.myCat = 'melee'; v1.myHealth = 10; v1.myHealthMax = v1.myHealth; v1.myNameFull = v1.myName; v1.myDescription = 'Flush \'em twice, just to be sure.'; v1.myROF = 30; v1.myPiercing = 5; v1.myShots = 1; v1.myRange = 125; v1.brokeRange = v1.myRange / 2; v1.myDamage = 10; v1.myDamageType = 'blunt'; v1.myAmmo = 1; v1.myCasing = 'spark1'; v1.mySpread = 3; } else { if (inType == 'sign') { v1.myTag = 'Melee'; v1.myName = 'Streetsign'; v1.twoHand = false; v1.melee = true; v1.myCat = 'melee'; v1.myHealth = 50; v1.myHealthMax = v1.myHealth; v1.myNameFull = v1.myName; v1.myDescription = 'The crossing guard just got dangerous.'; v1.myROF = 30; v1.myPiercing = 5; v1.myShots = 1; v1.myRange = 145; v1.brokeRange = v1.myRange / 2; v1.myDamage = 10; v1.myDamageType = 'blunt'; v1.myAmmo = 1; v1.myCasing = 'spark1'; v1.mySpread = 3; } else { if (inType == 'megahammer') { v1.myTag = 'Melee'; v1.myName = 'Mega Hammer'; v1.noPickup = true; v1.twoHand = false; v1.melee = true; v1.myCat = 'melee'; v1.myHealth = 9999999; v1.myHealthMax = v1.myHealth; v1.myNameFull = v1.myName; v1.myDescription = 'The fact that you have this means I hate you.'; v1.myROF = 30; v1.myPiercing = 5; v1.myShots = 1; v1.myRange = 145; v1.brokeRange = v1.myRange; v1.myDamage = 9; v1.myDamageType = 'blunt'; v1.myAmmo = 1; v1.myCasing = 'spark1'; v1.mySpread = 3; } else { if (inType == 'hook') { v1.myTag = 'Melee'; v1.myName = 'Battle Hook'; v1.twoHand = false; v1.melee = true; v1.myCat = 'melee'; v1.myHealth = 9999999; v1.myHealthMax = v1.myHealth; v1.myNameFull = v1.myName; v1.myDescription = 'A unique weapon meant for close-range combat, and closing that distance from afar.'; v1.myROF = 30; v1.myPiercing = 5; v1.myShots = 1; v1.myRange = 105; v1.brokeRange = v1.myRange / 2; v1.myDamage = 5; v1.myDamageType = 'blade'; v1.myAmmo = 1; v1.myCasing = 'spark1'; v1.mySpread = 3; v1.amHook = true; } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } v1.broken = false; if (silencer) { v1.myTag += '_Silencer'; v1.upgradeSilencer = true; v1.mySound = 'silencer'; } v1.haveSilencer = silencer; if (MadnessGameSelect.gameMode == 'arena') { if (ItemGenerator.canUpgrade(v1.myCat, 'sight')) { if (SwainMath.randomNumber(0, 10) == 0) { v1.upgradeSight = Boolean(SwainMath.randomNumber(0, 1)); } } if (ItemGenerator.canUpgrade(v1.myCat, 'laser')) { if (SwainMath.randomNumber(0, 10) == 0) { v1.upgradeLaser = Boolean(SwainMath.randomNumber(0, 1)); } } v1.myColor = SwainMath.randomNumber(1, 2); if (SwainMath.randomNumber(0, 10) == 0) { v1.myColor = 3; } } if (MadnessGameSelect.gameMode == 'story') { if (ItemGenerator.canUpgrade(v1.myCat, 'sight')) { if (SwainMath.randomNumber(0, 30 - MadnessLevel.currentLevel.myDifficulty * 3) == 0) { v1.upgradeSight = Boolean(SwainMath.randomNumber(0, 1)); } } if (ItemGenerator.canUpgrade(v1.myCat, 'laser')) { if (SwainMath.randomNumber(0, 30 - MadnessLevel.currentLevel.myDifficulty * 3) == 0) { v1.upgradeLaser = Boolean(SwainMath.randomNumber(0, 1)); } } v1.myColor = SwainMath.randomNumber(1, 2); if (SwainMath.randomNumber(0, 30) == 0) { v1.myColor = 3; } } if (v1.upgradeSight) { v1.mySpread *= 0.3; } if (v1.upgradeLaser) { v1.myRange *= 1.2; } v1.myPrice = 100; v1.myPrice *= (50 - v1.myROF) * (v1.myDamage * (v1.myShots / 2)) / 20; v1.myPrice += v1.myPrice * (v1.myAmmo / 60); if (v1.upgradeSight) { v1.myPrice *= 1.3; } if (v1.upgradeLaser) { v1.myPrice *= 1.3; } v1.myPrice = Math.floor(v1.myPrice); if (v1.myCat == 'pistol' || v1.myCat == 'revolver') { v1.xOffset = 15; v1.yOffset = -5; } if (v1.myCat == 'smg') { v1.xOffset = 6; v1.yOffset = 2; } if (v1.myCat == 'shotgun') { v1.xOffset = -9; v1.yOffset = 4; } if (v1.myCat == 'rifle') { v1.xOffset = 0; v1.yOffset = 0; } if (v1.myCat == 'heavy') { v1.xOffset = -11; v1.yOffset = -6; } if (v1.myCat == 'melee') { v1.xOffset = 0; v1.yOffset = 0; } v1.myAmmoMax = v1.myAmmo; v1.myClips = 1; if (v1.singleBulletClip) { v1.myClips = 8; } v1.myClipsMax = v1.myClips; v1.amSpecial = false; if (inType == '') { v1 = undefined; } return v1; }; v1.isWeaponValid = function (inChar, inItem, inCat) { return true; }; v1.isWeaponAvailable = function (inItem, inCat) {}; v1.unarmedWeapon = function () { var v1 = new Object(); v1.myTag = 'Unarmed'; v1.myName = 'Unarmed'; v1.twoHand = false; v1.melee = true; v1.myCat = 'melee'; v1.myROF = 30; v1.myPiercing = 0; v1.myShots = 1; v1.myRange = 95; v1.myDamage = 2; v1.myDamageType = 'punch'; v1.myAmmo = 1; v1.myCasing = 'spark1'; v1.mySpread = 3; v1.myType = 'unarmed'; return v1; }; v1.changeUnarmedDamage = function (inChar, inAttack, inDashPerk) { if (inAttack.substr(8, 6) == 'savate' || inDashPerk) { inChar.myUnarmed.myDamage = 5.5; inChar.myUnarmed.myStyle = 'savate'; } else { if (inAttack.substr(8, 5) == 'brawl') { inChar.myUnarmed.myDamage = 2.5; inChar.myUnarmed.myStyle = 'brawl'; } else { if (inAttack.substr(8, 5) == 'elite') { inChar.myUnarmed.myDamage = 10; inChar.myUnarmed.myStyle = 'elite'; } } } }; v1.setItemSprite = function (inSprite, inWeapon) { if (inWeapon.myCat == 'melee') { inSprite.stop(); if (inWeapon.myHealth <= inWeapon.myHealthMax * 0.12) { inSprite.gotoAndStop(4); } else { if (inWeapon.myHealth <= inWeapon.myHealthMax * 0.3) { inSprite.gotoAndStop(3); } else { if (inWeapon.myHealth <= inWeapon.myHealthMax * 0.75) { inSprite.gotoAndStop(2); } else { inSprite.gotoAndStop(1); } } } } }; v1.equipLoadout = function (inChar, inLoadout, inLevel) { var v2 = new Array(); var v13 = new Array(); var v5 = new Array(); var v3; var v6; var v12; var v10; var v9; var v14; if (inChar.myCharacter == 'civ') { if (inChar.myRoster.teamFaction == 'enemy') { v5 = [undefined, undefined, 'hat1', 'hat2', 'hat3', 'hat4', 'hat5', 'hat6', 'helmet1', 'helmet2', 'helmet3']; v3 = inLevel * 1.5; if (v3 > v5.length) { v3 = v5.length; } if (v3 < 4) { v3 = 4; } v6 = -15 + inLevel; if (v6 > -3) { v6 = -3; } v12 = v5[SwainMath.randomNumber(v6, v3)]; v5 = [undefined, undefined, 'armor1', 'armor2', 'armor3', 'armor4', 'armor5', 'armor8', 'armor9', 'armor10', 'armor6', 'armor7']; v3 = inLevel * 1.5; if (v3 > v5.length) { v3 = v5.length; } v6 = -20 + inLevel; if (v6 > -3) { v6 = -3; } v10 = v5[SwainMath.randomNumber(v6, v3)]; v5 = [undefined, undefined, 'mask1', 'mouth6', 'mouth3']; v3 = inLevel; if (v3 > v5.length) { v3 = v5.length; } v6 = -15 + inLevel; if (v6 > -3) { v6 = -3; } v9 = v5[SwainMath.randomNumber(v6, v3)]; v5 = [undefined, undefined, 'shades1', 'shades3', 'shades5', 'paintball1', 'paintball2', 'goggles1', 'hi1', 'hi2', 'hi3', 'hi4']; v3 = inLevel * 1.5; if (v3 > v5.length) { v3 = v5.length; } if (v3 < 3) { v3 = 3; } v6 = -15 + inLevel; if (v6 > -3) { v6 = -3; } v14 = v5[SwainMath.randomNumber(v6, v3)]; } } if (inChar.myCharacter.substr(0, 5) == 'agent') { v5 = [undefined, undefined, 'armor1', 'armor2', 'armor3', 'armor4', 'armor5', 'armor8', 'armor9', 'armor10', 'armor6', 'armor7']; v3 = inLevel * 1.5; if (inLevel * 1.5 > v5.length) { v3 = v5.length; } v6 = -25 + inLevel; if (v6 > -3) { v6 = -3; } v10 = v5[SwainMath.randomNumber(v6, v3)]; v5 = [undefined, undefined, 'mouth1', 'mouth2', 'mouth4', 'mouth5']; v3 = inLevel; if (inLevel > v5.length) { v3 = v5.length; } v6 = -25 + inLevel; if (v6 > -3) { v6 = -3; } v9 = v5[SwainMath.randomNumber(v6, v3)]; } if (MadnessLevel.currentLevel.myWorld == 0 && MadnessLevel.currentLevel.myLevel == 0) { v12 = undefined; v10 = undefined; v9 = undefined; v14 = undefined; } if (inLoadout == 'unarmed') { inChar.myRoster.removeWeapon(inChar.myWeapons[0]); inChar.myWeapons[0] = undefined; inChar.myRoster.removeWeapon(inChar.myWeapons[1]); inChar.myWeapons[1] = undefined; } if (inLoadout == 'ranged') { if (inLevel < 3) { v2 = ['ppk', 'beretta']; } else { if (inLevel < 5) { v2 = ['ppk', 'beretta', 'glock20', 'prokiller460']; } else { if (inLevel < 8) { v2 = ['hk2', 'mp7', 'ppk', 'beretta', 'glock20', 'prokiller460', 'deagle', '97k']; } else { if (inLevel < 10) { v2 = ['500snub', '357snub', 'hk2', 'mp7', 'tmp', 'mp5k', 'mp5', 'pm9', 'oa93', 'glock20', 'prokiller460', 'deagle', '97k', 'spas12']; } else { if (inLevel < 12) { v2 = ['500long', '357long', 'deagle', 'hk2', 'mp7', 'tmp', 'mp5k', 'mp5', 'pm9', 'oa93', 'ar15', 'sr3', 'ak74', 'm16', 'aug', 'ak74u', 'hk416', '97k', 'spas12']; } else { v2 = ['ar15', 'sr3', 'ak74', 'm16', 'aug', 'ak74u', 'hk416', 'fnfal', 'm249', 'famas', 'usas12']; } } } } } if (SwainMath.randomNumber(0, 5) == 0) { inLoadout = 'melee'; } } if (inLoadout == 'melee') { var v8 = ['switchblade', 'bottle', 'hammer', 'pipe', 'ironknife', 'mallet', 'bowieknife', 'bat', 'baton', 'carbonknife', 'billyclub', 'machette', 'ironsword', 'tangsword', 'carbonsword', 'axe', 'l337sword', 'dragonsword']; if (inLevel > v8.length - 5) { inLevel = v8.length - 5; } var v7 = inLevel; while (v7 < inLevel + 5) { if (v8[v7] != undefined) { v2.push(v8[v7]); } ++v7; } } v7 = 0; while (v7 < (15 - inChar.myLevel) / 5) { v2.splice(v2.length - 2, 1); ++v7; } if (inLoadout == 'bottle') { v2 = new Array(); v2.push('bottle'); } if (inLoadout != 'none') { if (v2.length > 0) { inChar.myRoster.removeWeapon(inChar.myWeapons[0]); inChar.myWeapons[0] = undefined; var v15 = ItemGenerator.createWeapon(v2[SwainMath.randomNumber(0, v2.length - 1)], false); inChar.equipItem(v15, 0); } if (v13.length > 0) { inChar.myRoster.removeWeapon(inChar.myWeapons[1]); inChar.myWeapons[1] = undefined; v15 = ItemGenerator.createWeapon(v13[SwainMath.randomNumber(0, v13.length - 1)], false); inChar.equipItem(v15, 1); } if (v12 != undefined) { var v16 = ItemGenerator.createArmor(v12, false); inChar.equipItem(v16, 0); } if (v10 != undefined) { v16 = ItemGenerator.createArmor(v10, false); inChar.equipItem(v16, 0); } if (v9 != undefined) { v16 = ItemGenerator.createArmor(v9, false); inChar.equipItem(v16, 0); } if (v14 != undefined) { v16 = ItemGenerator.createArmor(v14, false); inChar.equipItem(v16, 0); } } }; v1.canSilence = function (inType) { var v2 = ['ppk', 'beretta', 'glock20', 'prokiller460', 'hk2', 'mp7', 'tmp', 'mp5k', 'mp5', 'pm9', 'oa93']; var v1 = 0; while (v1 < v2.length) { if (inType == v2[v1]) { return true; } ++v1; } return false; }; v1.canUpgrade = function (inCat, inUpgrade) { if (inCat == 'melee') { return false; } if (inCat == 'heavy' || (inCat == 'pistol' || inCat == 'revolver') && inUpgrade == 'sight') { return false; } return true; }; v1.returnWaveLoadout = function (inLevel, inWave) { --inLevel; var v1; if (inLevel + Math.floor(inWave / 4) <= 0) { v1 = 'unarmed'; return v1; } if (inWave == 0 || inWave == 5 || inLevel + inWave / 4 <= 2) { v1 = 'melee'; return v1; } v1 = 'ranged'; return v1; }; v1.assignGear = function (inChar, inLvl) { var v5 = ['top', 'tiny', 'fedora', 'hat1', 'hat2', 'hat3', 'hat4', 'hat5', 'hat6', 'hat7', 'hair1', 'hair2', 'hair3', 'hair4', 'helmet1', 'helmet2', 'helmet3']; var v4 = ['mouth1', 'mouth2', 'mouth3', 'mouth4', 'mouth5', 'mouth6', 'mask1', 'chin1']; var v3 = ['hi1', 'hi2', 'hi3', 'hi4', 'shades1', 'shades2', 'shades3', 'shades4', 'shades5', 'shades6', 'shades7', 'shades8', 'goggles1', 'paintball1', 'paintball2']; var v6 = ['armor1', 'armor2', 'armor3', 'armor4', 'armor5', 'armor6', 'armor7', 'armor8', 'armor9', 'armor10', 'coat1', 'coat2', 'coat3']; var v1 = 0; while (v1 < 4) { if (SwainMath.randomNumber(0, Math.floor((15 - inLvl / 2) * 0.5)) <= 1) { inChar.myHireCost *= 1.15; if (v1 == 0) { inChar.equipItem(ItemGenerator.createArmor(v5[SwainMath.randomNumber(0, v5.length)]), 0); } if (v1 == 1) { inChar.equipItem(ItemGenerator.createArmor(v4[SwainMath.randomNumber(0, v4.length)]), 0); } if (v1 == 2) { inChar.equipItem(ItemGenerator.createArmor(v3[SwainMath.randomNumber(0, v3.length)]), 0); } if (v1 == 3) { inChar.equipItem(ItemGenerator.createArmor(v6[SwainMath.randomNumber(0, v6.length)]), 0); } } ++v1; } }; ASSetPropFlags(_global.ItemGenerator.prototype, null, 1); } #endinitclip } movieClip 4817 __Packages.MadnessLevel { #initclip if (!_global.MadnessLevel) { var v1 = function () {}; _global.MadnessLevel = v1; var v2 = v1.prototype; v2.generateLevel = function (inWorld, inLevel) { MadnessLevel.currentLevel = this; this.myLevel = inLevel; this.myWorld = inWorld; MadnessLevel.levelVictory = false; MadnessLevel.myRooms = new Array(); MadnessLevel.myObjectives = new Array(); MadnessRoster.playerRoster = new MadnessRoster(); MadnessRoster.playerRoster.init('player'); this.generateRooms(inWorld, inLevel); }; v2.generateRooms = function (inWorld, inLevel) { MadnessLevel.myRooms = new Array(); MadnessLevel.myObjectives = new Array(); MadnessLevel.totalRooms = new Number(); MadnessLevel.doorList = new Array(); if (inWorld == 0) { if (inLevel == 0) { this.level0_0(); } else { if (inLevel == 1) { this.level0_1(); } else { if (inLevel == 2) { this.level0_2(); } else { if (inLevel == 3) { this.level0_3(); } else { if (inLevel == 4) { this.level0_4(); } else { if (inLevel == 5) { this.level0_5(); } else { if (inLevel == 6) { this.level0_6(); } else { if (inLevel == 7) { this.level0_7(); } } } } } } } } } else { if (inWorld == 1) { } } }; v2.generateArena = function (inStartWave) { MadnessLevel.currentLevel = this; MadnessLevel.myRooms = new Array(); MadnessLevel.myObjectives = new Array(); var v4; var v5; this.totalWaves = inStartWave; this.myDifficulty = Math.floor(this.totalWaves / 2); v4 = 1; this.addRooms(v4, MadnessGameSelect.gameMode); v5 = [5]; this.addDoors(MadnessLevel.myRooms, v5); this.setDoorDir(0, 0, 'down'); MadnessLevel.myRooms[0].myDoors[0].myConnection = MadnessRoster.storeRoster; MadnessLevel.startPoint = MadnessLevel.myRooms[0].myDoors[0]; this.disableDoorSpawn(0, 0); if (_root.newArena) { this.addEvent(MadnessLevel.myRooms[0], MadnessEvents.arena_1_tutorial); } this.setDoorDir(0, 1, 'right'); this.setDoorDir(0, 2, 'down'); this.setDoorDir(0, 3, 'down'); this.setDoorDir(0, 4, 'left'); this.addActivator(0, 'panel'); this.addEvent(MadnessLevel.myRooms[0].myActivators[0], MadnessEvents.arena_1_START); this.addObstacle(0, 'barrel'); this.addObstacle(0, 'barrel'); var v3 = this.totalWaves; while (v3 > 8) { v3 -= 8; } if (v3 == 7) { v3 = 8; } this.applyTrack('stage' + v3, this); }; v2.level0_0 = function () { this.myName = '[1-A] Jail'; this.myDescription = ' In order to bring about the destruction of the Nexus Project and the Nexus Training Program, Hank has been hired to enlist the help of incarcerated agents Sanford and Deimos.'; this.myDifficulty = 4; var v2 = new MadnessDataFile(); v2.createNew('hank'); MadnessRoster.playerRoster.addCharacter(v2); MadnessRoster.playerRoster.makeActive(v2); v2.giveItem(ItemGenerator.createWeapon('glock20', false), 0); v2.giveItem(ItemGenerator.createWeapon('dragonsword', false), 1); v2.myWeapons[0].upgradeSight = true; v2.myWeapons[0].upgradeLaser = true; v2.myWeapons[0].myColor = 1; v2.myWeapons[0].myClips = 4; v2.myStartup = 'startup3'; v2 = new MadnessDataFile(); v2.createNew('sanford'); MadnessRoster.playerRoster.addCharacter(v2); v2 = new MadnessDataFile(); v2.createNew('deimos'); MadnessRoster.playerRoster.addCharacter(v2); MadnessLevel.totalRooms = 7; this.addRooms(MadnessLevel.totalRooms, MadnessGameSelect.gameMode); MadnessLevel.doorList = [1, 2, 2, 4, 3, 2, 4]; this.addDoors(MadnessLevel.myRooms, MadnessLevel.doorList); this.addStartPoint(MadnessLevel.myRooms[0]); this.setDoorDir(0, 0, 'left'); this.setDoorType(0, 0, 'blast'); this.setDoorDir(1, 0, 'right'); this.setDoorDir(1, 1, 'left'); this.setDoorType(1, 0, 'blast'); this.disableDoorSpawn(1, 0); this.setDoorDir(2, 0, 'right'); this.setDoorDir(2, 1, 'left'); this.disableDoorSpawn(2, 0); this.setDoorDir(3, 0, 'right'); this.setDoorDir(3, 1, 'down'); this.setDoorDir(3, 2, 'down'); this.setDoorDir(3, 3, 'left'); this.disableDoorSpawn(3, 0); this.setDoorDir(4, 0, 'right'); this.setDoorDir(4, 1, 'down'); this.setDoorDir(4, 2, 'left'); this.disableDoorSpawn(4, 0); this.setDoorDir(5, 0, 'right'); this.setDoorDir(5, 1, 'left'); this.setDoorDir(6, 0, 'right'); this.setDoorDir(6, 1, 'down'); this.setDoorType(6, 1, 'spikesJail'); this.disableDoorSpawn(6, 1); this.disableClose(6, 1); this.setDoorDir(6, 2, 'down'); this.setDoorType(6, 2, 'spikesJail'); this.disableDoorSpawn(6, 2); this.disableClose(6, 2); this.setDoorDir(6, 3, 'left'); this.connectDoors(0, 0, '---', 1, 0); this.connectDoors(1, 1, '---', 2, 0); this.connectDoors(2, 1, '---', 3, 0); this.connectDoors(3, 3, '---', 4, 0); this.connectDoors(4, 2, '---', 5, 0); this.connectDoors(5, 1, '---', 6, 0); this.addEvent(MadnessLevel.myRooms[0], MadnessEvents.world_0_0_tutorial1); this.addEvent(MadnessLevel.myRooms[1], MadnessEvents.world_0_0_tutorial2); this.addEvent(MadnessLevel.myRooms[2], MadnessEvents.world_0_0_tutorial3); this.addEvent(MadnessLevel.myRooms[3], MadnessEvents.world_0_0_tutorial4); this.addEvent(MadnessLevel.myRooms[4], MadnessEvents.world_0_0_tutorial5); this.addEvent(MadnessLevel.myRooms[5], MadnessEvents.world_0_0_tutorial6); this.addActivator(2, 'panel'); this.connectActivator(2, 0, '---', MadnessLevel.myRooms[2].myDoors[1], 'unlock'); this.addEvent(MadnessLevel.myRooms[2].myActivators[0], MadnessEvents.world_0_0_tutorial3b); this.addActivator(5, 'lockerLeft'); this.addActivator(6, 'panel'); this.connectActivator(6, 0, '---', MadnessLevel.myRooms[6].myDoors[1], 'unlock'); this.addActivator(6, 'panel'); this.connectActivator(6, 1, '---', MadnessLevel.myRooms[6].myDoors[2], 'unlock'); this.addEvent(MadnessLevel.myRooms[6].myActivators[1], MadnessEvents.world_0_0_prison); this.addActivator(6, 'panel'); this.addObstacle(2, 'empty1'); this.addObstacle(3, 'barrel'); this.addObstacle(5, 'empty2'); this.createNPC(MadnessLevel.myRooms[1], 'civ', 'enemy', 'melee', 5, true, 3); this.createNPC(MadnessLevel.myRooms[1], 'agent', 'enemy', 'melee', 5, true, 1); this.createNPC(MadnessLevel.myRooms[2], 'civ', 'enemy', 'unarmed', 0, true, 1); this.createNPC(MadnessLevel.myRooms[4], 'civ', 'enemy', 'unarmed', 0, true, 3); this.createNPC(MadnessLevel.myRooms[4], 'agent', 'enemy', 'unarmed', 0, true, 1); this.setStartup('stun_surprise', 0); this.createNPC(MadnessLevel.myRooms[5], 'coward', 'enemy', 'unarmed', 0, true, 1); this.resetStartup(); this.createNPC(MadnessLevel.myRooms[6].myDoors[1], 'agent', 'traitors', 'unarmed', 0, true, 1); this.createNPC(MadnessLevel.myRooms[6], 'agent', 'enemy', 'unarmed', 0, true, 2); this.createRoster(MadnessLevel.myRooms[2], ['civ', 'civ'], 'enemy', 'ranged', 0); this.createRoster(MadnessLevel.myRooms[3], ['agent', 'civ', 'civ', 'civ'], 'enemy', 'ranged', 0); this.createRoster(MadnessLevel.myRooms[3], ['agent', 'civ', 'civ', 'civ'], 'enemy', 'ranged', 0); this.createRoster(MadnessLevel.myRooms[3], ['agent', 'civ', 'civ', 'civ'], 'enemy', 'ranged', 0); this.createRoster(MadnessLevel.myRooms[4], ['agent', 'agent', 'civ'], 'enemy', 'ranged', 0); this.createRoster(MadnessLevel.myRooms[4], ['agent', 'civ', 'civ', 'civ'], 'enemy', 'ranged', 0); this.addNPC(MadnessLevel.myRooms[6].myDoors[2], MadnessRoster.playerRoster.myMembers[MadnessRoster.playerRoster.myMembers.length - 2], true); this.addNPC(MadnessLevel.myRooms[6].myDoors[2], MadnessRoster.playerRoster.myMembers[MadnessRoster.playerRoster.myMembers.length - 1], true); this.addItem(MadnessLevel.myRooms[5].myActivators[0], ItemGenerator.createWeapon('sr3', false)); this.makeObjective(MadnessRoster.playerRoster.myMembers[MadnessRoster.playerRoster.myMembers.length - 2], 'rescue', true, false); this.makeObjective(MadnessRoster.playerRoster.myMembers[MadnessRoster.playerRoster.myMembers.length - 1], 'rescue', true, false); this.myCutsceneStart = 'cutscene_world0_start'; this.applyTrack('stage1', this); }; v2.level0_1 = function () { this.myName = '[1-B] Armory'; this.myDescription = ' We\'re in danger of Nexus Units advancing their equipment loadouts. Hank is required elsewhere, so Sanford and Deimos will have to infiltrate the Armory and put an end to the Nexus weapon stockpile.'; this.myDifficulty = 1; var v2 = new MadnessDataFile(); v2.createNew('sanford'); MadnessRoster.playerRoster.addCharacter(v2); MadnessRoster.playerRoster.makeActive(v2); v2.giveItem(ItemGenerator.createWeapon('hook', false), 0); v2.giveItem(ItemGenerator.createWeapon('glock20', true), 1); v2.myWeapons[1].upgradeSight = false; v2.myWeapons[1].upgradeLaser = true; v2.myWeapons[1].myColor = 1; v2 = new MadnessDataFile(); v2.createNew('deimos'); MadnessRoster.playerRoster.addCharacter(v2); MadnessRoster.playerRoster.makeActive(v2); v2.giveItem(ItemGenerator.createWeapon('mp7', true), 0); v2.giveItem(ItemGenerator.createWeapon('beretta', true), 1); v2.myWeapons[0].upgradeSight = true; v2.myWeapons[0].upgradeLaser = true; v2.myWeapons[0].myColor = 1; v2.myWeapons[1].upgradeSight = false; v2.myWeapons[1].upgradeLaser = true; v2.myWeapons[1].myColor = 1; MadnessLevel.totalRooms = 12; this.addRooms(MadnessLevel.totalRooms, MadnessGameSelect.gameMode); MadnessLevel.doorList = [1, 2, 2, 3, 2, 3, 1, 2, 4, 3, 2, 3]; this.addDoors(MadnessLevel.myRooms, MadnessLevel.doorList); this.addStartPoint(MadnessLevel.myRooms[0]); this.setDoorDir(0, 0, 'left'); this.setDoorDir(1, 0, 'right'); this.setDoorDir(1, 1, 'left'); this.setDoorDir(2, 0, 'right'); this.setDoorDir(2, 1, 'left'); this.setDoorDir(3, 0, 'right'); this.setDoorDir(3, 1, 'down'); this.setDoorDir(3, 2, 'left'); this.setDoorDir(4, 0, 'right'); this.setDoorDir(4, 1, 'down'); this.setDoorDir(5, 0, 'right'); this.setDoorDir(5, 1, 'down'); this.setDoorDir(5, 2, 'down'); this.setDoorDir(6, 0, 'right'); this.setDoorDir(7, 0, 'down'); this.setDoorDir(7, 1, 'down'); this.setDoorDir(8, 0, 'right'); this.setDoorDir(8, 1, 'down'); this.setDoorDir(8, 2, 'down'); this.setDoorDir(8, 3, 'left'); this.setDoorDir(9, 0, 'down'); this.setDoorDir(9, 1, 'down'); this.setDoorDir(9, 2, 'left'); this.setDoorDir(10, 0, 'right'); this.setDoorDir(10, 1, 'left'); this.setDoorDir(11, 0, 'right'); this.setDoorDir(11, 1, 'down'); this.setDoorDir(11, 2, 'left'); this.connectDoors(0, 0, '---', 1, 0); this.connectDoors(1, 1, '---', 2, 0); this.connectDoors(2, 1, '---', 3, 0); this.connectDoors(3, 1, '---', 4, 0); this.connectDoors(3, 2, '---', 5, 0); this.connectDoors(5, 1, '---', 7, 0); this.connectDoors(5, 2, '---', 6, 0); this.connectDoors(7, 1, '---', 8, 2); this.connectDoors(8, 1, '---', 9, 0); this.connectDoors(9, 1, '---', 10, 0); this.connectDoors(10, 1, '---', 11, 0); this.addEvent(MadnessLevel.myRooms[0], MadnessEvents.world_0_1_0); this.addEvent(MadnessLevel.myRooms[6], MadnessEvents.world_0_1_6); this.addActivator(2, 'bomb_crate'); this.addActivator(3, 'panel'); this.addEvent(MadnessLevel.myRooms[3].myActivators[0], MadnessEvents.world_0_1_3_A); this.addActivator(4, 'bomb_crate'); this.addActivator(6, 'lockerLeft'); this.addActivator(6, 'bomb_crate'); this.addActivator(11, 'bomb_crate'); this.addObstacle(1, 'empty1'); this.addObstacle(1, 'empty1'); this.addObstacle(3, 'spikes1'); this.addObstacle(11, 'empty1'); this.setStartup('stun_surprise', 0); this.createNPC(MadnessLevel.myRooms[1], 'civ', 'enemy', 'ranged', 0, true, 0); this.resetStartup(); this.createRoster(MadnessLevel.myRooms[1], ['civ'], 'enemy', 'ranged', 0); this.createNPC(MadnessLevel.myRooms[2], 'civ', 'enemy', 'unarmed', 0, true, 3); this.createNPC(MadnessLevel.myRooms[3], 'civ', 'enemy', 'unarmed', 0, true, 3); this.createRoster(MadnessLevel.myRooms[3], ['civ', 'civ', 'civ'], 'enemy', 'melee', 0); this.createNPC(MadnessLevel.myRooms[4], 'civ', 'enemy', 'melee', 0, true, 1); this.createNPC(MadnessLevel.myRooms[5], 'civ', 'enemy', 'melee', 0, true, 4); this.createRoster(MadnessLevel.myRooms[5], ['civ', 'civ'], 'enemy', 'unarmed', 0); this.createRoster(MadnessLevel.myRooms[5], ['civ', 'civ', 'civ'], 'enemy', 'ranged', 0); this.createNPC(MadnessLevel.myRooms[7], 'civ', 'enemy', 'unarmed', 1, true, 2); this.createRoster(MadnessLevel.myRooms[7], ['civ', 'civ', 'civ'], 'enemy', 'melee', 1); this.createRoster(MadnessLevel.myRooms[7], ['civ', 'civ', 'civ'], 'enemy', 'ranged', 2); this.createNPC(MadnessLevel.myRooms[8], 'civ', 'enemy', 'melee', 1, true, 2); this.createRoster(MadnessLevel.myRooms[8], ['civ', 'agent', 'agent'], 'enemy', 'ranged', 0); this.createRoster(MadnessLevel.myRooms[8], ['civ', 'agent', 'agent'], 'enemy', 'ranged', 3); this.createRoster(MadnessLevel.myRooms[8], ['civ', 'civ', 'civ'], 'enemy', 'melee', 0); this.createRoster(MadnessLevel.myRooms[9], ['civ', 'agent', 'agent'], 'enemy', 'ranged', 0); this.createRoster(MadnessLevel.myRooms[9], ['civ', 'agent', 'agent'], 'enemy', 'ranged', 3); this.createNPC(MadnessLevel.myRooms[11], 'civ', 'enemy', 'melee', 3, true, 3); this.createNPC(MadnessLevel.myRooms[11], 'agent', 'enemy', 'ranged', 3, true, 2); this.createRoster(MadnessLevel.myRooms[11], ['civ', 'agent'], 'enemy', 'ranged', 2); this.createRoster(MadnessLevel.myRooms[11], ['civ', 'civ', 'civ', 'civ', 'agent'], 'enemy', 'ranged', 2); this.createRoster(MadnessLevel.myRooms[11], ['civ', 'agent', 'agent'], 'enemy', 'ranged', 0); this.createRoster(MadnessLevel.myRooms[11], ['civ', 'agent', 'agent'], 'enemy', 'ranged', 3); this.addItem(MadnessLevel.myRooms[6].myActivators[0], ItemGenerator.createWeapon('deagle', false)); this.addItem(MadnessLevel.myRooms[6].myActivators[0], ItemGenerator.createWeapon('97k', false)); this.makeObjective(MadnessLevel.myRooms[2].myActivators[0], 'use', true, false); this.makeObjective(MadnessLevel.myRooms[2], 'clear', true, false); this.makeObjective(MadnessLevel.myRooms[4].myActivators[0], 'use', true, false); this.makeObjective(MadnessLevel.myRooms[4], 'clear', true, false); this.makeObjective(MadnessLevel.myRooms[6].myActivators[1], 'use', true, false); this.makeObjective(MadnessLevel.myRooms[6], 'clear', true, false); this.makeObjective(MadnessLevel.myRooms[11].myActivators[0], 'use', true, false); this.makeObjective(MadnessLevel.myRooms[11], 'clear', true, false); this.applyTrack('stage2', this); }; v2.level0_2 = function () { this.myName = '[1-C] Com-Tower'; this.myDescription = ' Opposition is getting stiff. The probability of hitting the Headquarters of Project Nexus with any reliability will be nil unless we can disrupt its communications array.'; this.myDifficulty = 2; var v2 = new MadnessDataFile(); v2.createNew('sanford'); MadnessRoster.playerRoster.addCharacter(v2); MadnessRoster.playerRoster.makeActive(v2); v2.giveItem(ItemGenerator.createWeapon('hook', false), 0); v2.giveItem(ItemGenerator.createWeapon('glock20', true), 1); v2.myWeapons[1].upgradeSight = false; v2.myWeapons[1].upgradeLaser = true; v2.myWeapons[1].myColor = 1; v2 = new MadnessDataFile(); v2.createNew('deimos'); MadnessRoster.playerRoster.addCharacter(v2); MadnessRoster.playerRoster.makeActive(v2); v2.giveItem(ItemGenerator.createWeapon('mp7', true), 0); v2.giveItem(ItemGenerator.createWeapon('beretta', true), 1); v2.myWeapons[0].upgradeSight = true; v2.myWeapons[0].upgradeLaser = true; v2.myWeapons[0].myColor = 1; v2.myWeapons[1].upgradeSight = false; v2.myWeapons[1].upgradeLaser = true; v2.myWeapons[1].myColor = 1; MadnessLevel.totalRooms = 10; this.addRooms(MadnessLevel.totalRooms, MadnessGameSelect.gameMode); MadnessLevel.doorList = [1, 3, 3, 4, 2, 2, 3, 2, 2, 2]; this.addDoors(MadnessLevel.myRooms, MadnessLevel.doorList); this.addStartPoint(MadnessLevel.myRooms[0]); this.setDoorDir(0, 0, 'left'); this.setDoorDir(1, 0, 'right'); this.setDoorDir(1, 1, 'down'); this.setDoorDir(1, 2, 'left'); this.setDoorDir(2, 0, 'right'); this.setDoorDir(2, 1, 'down'); this.setDoorDir(2, 2, 'left'); this.setDoorDir(3, 0, 'right'); this.setDoorDir(3, 1, 'down'); this.setDoorDir(3, 2, 'down'); this.setDoorDir(3, 3, 'left'); this.setDoorDir(4, 0, 'right'); this.setDoorDir(4, 1, 'left'); this.setDoorDir(5, 0, 'right'); this.setDoorDir(5, 1, 'left'); this.setDoorDir(6, 0, 'right'); this.setDoorDir(6, 1, 'down'); this.setDoorDir(6, 2, 'left'); this.setDoorDir(7, 0, 'right'); this.setDoorDir(7, 1, 'down'); this.setDoorDir(8, 0, 'right'); this.setDoorDir(8, 1, 'left'); this.setDoorDir(9, 0, 'right'); this.setDoorDir(9, 1, 'down'); this.connectDoors(0, 0, '---', 1, 0); this.connectDoors(1, 1, '---', 2, 0); this.connectDoors(1, 2, '---', 3, 0); this.connectDoors(3, 2, '---', 6, 0); this.connectDoors(3, 3, '---', 4, 0); this.connectDoors(4, 1, '---', 5, 0); this.connectDoors(6, 1, '---', 7, 0); this.connectDoors(6, 2, '---', 8, 0); this.connectDoors(8, 1, '---', 9, 0); this.addEvent(MadnessLevel.myRooms[5], MadnessEvents.world_0_2_5); this.addEvent(MadnessLevel.myRooms[9], MadnessEvents.world_0_2_9); this.addActivator(5, 'bomb_power'); this.addActivator(7, 'lockerRight'); this.addActivator(9, 'lockerLeft'); this.addActivator(9, 'bomb_power'); this.setStartup('stun_surprise', 0); this.setStartNPC(); this.createNPC(MadnessLevel.myRooms[0], 'civ', 'enemy', 'ranged', 0, true, 3); this.endStartNPC(); this.resetStartup(); this.createNPC(MadnessLevel.myRooms[1], 'civ', 'enemy', 'melee', 2, true, 4); this.createRoster(MadnessLevel.myRooms[1], ['civ', 'civ'], 'enemy', 'melee', 3); this.createNPC(MadnessLevel.myRooms[2], 'civ', 'enemy', 'unarmed', 2, true, 3); this.createNPC(MadnessLevel.myRooms[2], 'agent', 'enemy', 'melee', 4, true, 2); this.createRoster(MadnessLevel.myRooms[2], ['civ', 'agent', 'agent'], 'enemy', 'ranged', 3); this.createNPC(MadnessLevel.myRooms[3], 'civ', 'enemy', 'ranged', 3, true, 2); this.createRoster(MadnessLevel.myRooms[3], ['agent', 'civ', 'civ'], 'enemy', 'melee', 4); this.createRoster(MadnessLevel.myRooms[3], ['civ'], 'enemy', 'ranged', 2); this.createNPC(MadnessLevel.myRooms[4], 'civ', 'enemy', 'melee', 3, true, 1); this.createNPC(MadnessLevel.myRooms[4], 'agent', 'enemy', 'ranged', 4, true, 2); this.createRoster(MadnessLevel.myRooms[4], ['agent', 'civ', 'civ'], 'enemy', 'ranged', 2); this.createNPC(MadnessLevel.myRooms[5], 'civ', 'enemy', 'ranged', 3, true, 4); this.createNPC(MadnessLevel.myRooms[5], 'civ', 'enemy', 'ranged', 9, true, 5); this.createRoster(MadnessLevel.myRooms[5], ['agent', 'agent', 'agent'], 'enemy', 'ranged', 1); this.createRoster(MadnessLevel.myRooms[5], ['agent', 'agent', 'agent'], 'enemy', 'ranged', 0); this.createRoster(MadnessLevel.myRooms[5], ['agent', 'agent', 'agent', 'agent'], 'enemy', 'melee', 9); this.createRoster(MadnessLevel.myRooms[5], ['agent', 'agent', 'agent', 'agent', 'agent', 'agent'], 'enemy', 'ranged', 3); this.createNPC(MadnessLevel.myRooms[7], 'civ', 'enemy', 'melee', 3, true, 4); this.createRoster(MadnessLevel.myRooms[7], ['civ', 'civ', 'civ'], 'enemy', 'ranged', 1); this.createRoster(MadnessLevel.myRooms[7], ['civ', 'civ', 'civ', 'civ'], 'enemy', 'ranged', 2); this.createRoster(MadnessLevel.myRooms[7], ['civ', 'civ', 'agent'], 'enemy', 'ranged', 2); this.createNPC(MadnessLevel.myRooms[8], 'agent', 'enemy', 'ranged', 4, true, 3); this.createNPC(MadnessLevel.myRooms[9], 'civ', 'enemy', 'melee', 4, true, 2); this.createNPC(MadnessLevel.myRooms[9], 'agent', 'enemy', 'melee', 4, true, 2); this.createRoster(MadnessLevel.myRooms[9], ['agent', 'agent', 'agent'], 'enemy', 'melee', 4); this.createRoster(MadnessLevel.myRooms[9], ['agent', 'agent', 'agent'], 'enemy', 'melee', 6); this.createRoster(MadnessLevel.myRooms[9], ['agent', 'agent', 'agent', 'agent'], 'enemy', 'melee', 9); this.createRoster(MadnessLevel.myRooms[9], ['agent', 'agent', 'agent', 'agent', 'agent', 'agent'], 'enemy', 'ranged', 3); this.addItem(MadnessLevel.myRooms[7].myActivators[0], ItemGenerator.createWeapon('beretta', false)); this.addItem(MadnessLevel.myRooms[7].myActivators[0], ItemGenerator.createWeapon('carbonknife', false)); this.addItem(MadnessLevel.myRooms[9].myActivators[0], ItemGenerator.createWeapon('spas12', false)); this.makeObjective(MadnessLevel.myRooms[5].myActivators[0], 'use', true, false); this.makeObjective(MadnessLevel.myRooms[5], 'clear', true, false); this.makeObjective(MadnessLevel.myRooms[9].myActivators[1], 'use', true, false); this.makeObjective(MadnessLevel.myRooms[9], 'clear', true, false); this.applyTrack('stage3', this); }; v2.level0_3 = function () { this.myName = '[1-D] Barracks'; this.myDescription = ' With Nexus Units reeling from the satelite blackout, we may now launch a stealth strike directly against their most precious and plentiful resource: their manpower. Kill them all!'; this.myDifficulty = 2; var v2 = new MadnessDataFile(); v2.createNew('sanford'); MadnessRoster.playerRoster.addCharacter(v2); MadnessRoster.playerRoster.makeActive(v2); v2.giveItem(ItemGenerator.createWeapon('hook', false), 0); v2.giveItem(ItemGenerator.createWeapon('glock20', true), 1); v2.myWeapons[1].upgradeSight = false; v2.myWeapons[1].upgradeLaser = true; v2.myWeapons[1].myColor = 1; v2 = new MadnessDataFile(); v2.createNew('deimos'); MadnessRoster.playerRoster.addCharacter(v2); MadnessRoster.playerRoster.makeActive(v2); v2.giveItem(ItemGenerator.createWeapon('mp7', true), 0); v2.giveItem(ItemGenerator.createWeapon('beretta', true), 1); v2.myWeapons[0].upgradeSight = true; v2.myWeapons[0].upgradeLaser = true; v2.myWeapons[0].myColor = 1; v2.myWeapons[1].upgradeSight = false; v2.myWeapons[1].upgradeLaser = true; v2.myWeapons[1].myColor = 1; MadnessLevel.totalRooms = 14; this.addRooms(MadnessLevel.totalRooms, MadnessGameSelect.gameMode); MadnessLevel.doorList = [1, 2, 2, 3, 2, 3, 3, 2, 4, 3, 2, 3, 2, 2]; this.addDoors(MadnessLevel.myRooms, MadnessLevel.doorList); this.addStartPoint(MadnessLevel.myRooms[0]); this.setDoorDir(0, 0, 'left'); this.setDoorDir(1, 0, 'right'); this.setDoorDir(1, 1, 'left'); this.setDoorDir(2, 0, 'right'); this.setDoorDir(2, 1, 'left'); this.setDoorDir(3, 0, 'right'); this.setDoorDir(3, 1, 'down'); this.setDoorDir(3, 2, 'left'); this.setDoorDir(4, 0, 'right'); this.setDoorDir(4, 1, 'down'); this.setDoorDir(5, 0, 'right'); this.setDoorDir(5, 1, 'down'); this.setDoorDir(5, 2, 'down'); this.setDoorDir(6, 0, 'right'); this.setDoorDir(6, 1, 'down'); this.setDoorDir(6, 2, 'left'); this.setDoorDir(7, 0, 'right'); this.setDoorDir(7, 1, 'left'); this.setDoorDir(8, 0, 'right'); this.setDoorDir(8, 1, 'down'); this.setDoorDir(8, 2, 'down'); this.setDoorDir(8, 3, 'left'); this.setDoorDir(9, 0, 'right'); this.setDoorDir(9, 1, 'down'); this.setDoorDir(9, 2, 'left'); this.setDoorDir(10, 0, 'right'); this.setDoorDir(10, 1, 'down'); this.setDoorDir(11, 0, 'right'); this.setDoorDir(11, 1, 'down'); this.setDoorDir(11, 2, 'down'); this.setDoorDir(12, 0, 'right'); this.setDoorDir(12, 1, 'left'); this.setDoorDir(13, 0, 'right'); this.setDoorDir(13, 1, 'left'); this.connectDoors(0, 0, '---', 1, 0); this.connectDoors(1, 1, '---', 2, 0); this.connectDoors(2, 1, '---', 3, 0); this.connectDoors(3, 1, '---', 4, 0); this.connectDoors(3, 2, '---', 5, 0); this.connectDoors(5, 1, '---', 6, 0); this.connectDoors(5, 2, '---', 7, 0); this.connectDoors(7, 1, '---', 8, 0); this.connectDoors(8, 1, '---', 9, 0); this.connectDoors(8, 2, '---', 10, 0); this.connectDoors(8, 3, '---', 11, 0); this.connectDoors(11, 1, '---', 12, 0); this.connectDoors(11, 2, '---', 13, 0); this.addEvent(MadnessLevel.myRooms[4], MadnessEvents.world_0_3_4); this.addEvent(MadnessLevel.myRooms[6], MadnessEvents.world_0_3_6); this.addEvent(MadnessLevel.myRooms[10], MadnessEvents.world_0_3_10); this.addEvent(MadnessLevel.myRooms[13], MadnessEvents.world_0_3_13); this.addActivator(3, 'lockerRight'); this.addActivator(3, 'lockerRight'); this.addActivator(5, 'lockerRight'); this.addActivator(8, 'lockerLeft'); this.addActivator(9, 'lockerRight'); this.addActivator(13, 'lockerRight'); this.addObstacle(4, 'empty1'); this.addObstacle(5, 'empty3'); this.addObstacle(8, 'empty1'); this.addObstacle(9, 'empty3'); this.addObstacle(10, 'empty1'); this.addObstacle(13, 'empty3'); this.setStartup('stun_surprise', 0); this.setStartNPC(); this.createNPC(MadnessLevel.myRooms[0], 'civ', 'enemy', 'ranged', 2, true, 1); this.endStartNPC(); this.resetStartup(); this.createNPC(MadnessLevel.myRooms[1], 'civ', 'enemy', 'melee', 4, true, 2); this.createNPC(MadnessLevel.myRooms[1], 'agent', 'enemy', 'ranged', 4, true, 1); this.createRoster(MadnessLevel.myRooms[1], ['agent', 'civ', 'agent'], 'enemy', 'ranged', 2); this.createRoster(MadnessLevel.myRooms[1], ['agent', 'agent', 'agent'], 'enemy', 'ranged', 3); this.createNPC(MadnessLevel.myRooms[2], 'agent', 'enemy', 'ranged', 5, true, 3); this.createRoster(MadnessLevel.myRooms[2], ['civ', 'civ', 'civ'], 'enemy', 'melee', 3); this.createRoster(MadnessLevel.myRooms[2], ['civ'], 'enemy', 'melee', 7); this.createNPC(MadnessLevel.myRooms[3], 'civ', 'enemy', 'unarmed', 4, true, 1); this.createNPC(MadnessLevel.myRooms[4], 'civ', 'enemy', 'melee', 4, true, 1); this.createNPC(MadnessLevel.myRooms[4], 'civ', 'enemy', 'ranged', 5, true, 2); this.createRoster(MadnessLevel.myRooms[4], ['civ'], 'enemy', 'melee', 1); this.createNPC(MadnessLevel.myRooms[5], 'civ', 'enemy', 'melee', 4, true, 2); this.createNPC(MadnessLevel.myRooms[5], 'agent', 'enemy', 'ranged', 4, true, 1); this.createRoster(MadnessLevel.myRooms[5], ['civ', 'civ', 'civ', 'civ'], 'enemy', 'ranged', 1); this.createRoster(MadnessLevel.myRooms[5], ['civ'], 'enemy', 'ranged', 1); this.createRoster(MadnessLevel.myRooms[5], ['civ', 'civ', 'civ', 'civ'], 'enemy', 'ranged', 1); this.createRoster(MadnessLevel.myRooms[5], ['civ', 'civ'], 'enemy', 'ranged', 0); this.createRoster(MadnessLevel.myRooms[5], ['civ', 'civ', 'civ', 'civ'], 'enemy', 'ranged', 0); this.createNPC(MadnessLevel.myRooms[6], 'agent', 'enemy', 'ranged', 5, true, 3); this.createNPC(MadnessLevel.myRooms[7], 'civ', 'enemy', 'melee', 5, true, 1); this.createRoster(MadnessLevel.myRooms[7], ['civ', 'civ', 'civ', 'civ'], 'enemy', 'ranged', 1); this.createRoster(MadnessLevel.myRooms[7], ['civ', 'civ', 'civ', 'civ', 'civ'], 'enemy', 'ranged', 1); this.createRoster(MadnessLevel.myRooms[7], ['civ', 'civ', 'civ', 'civ'], 'enemy', 'ranged', 1); this.createNPC(MadnessLevel.myRooms[8], 'civ', 'enemy', 'melee', 5, true, 1); this.createNPC(MadnessLevel.myRooms[8], 'agent', 'enemy', 'ranged', 5, true, 2); this.createRoster(MadnessLevel.myRooms[8], ['agent', 'agent', 'civ', 'civ'], 'enemy', 'ranged', 3); this.createRoster(MadnessLevel.myRooms[8], ['agent', 'agent', 'civ', 'civ'], 'enemy', 'ranged', 6); this.createNPC(MadnessLevel.myRooms[10], 'civ', 'enemy', 'melee', 5, true, 3); this.createNPC(MadnessLevel.myRooms[10], 'civ', 'enemy', 'unarmed', 5, true, 3); this.createNPC(MadnessLevel.myRooms[10], 'agent', 'enemy', 'unarmed', 5, true, 1); this.createNPC(MadnessLevel.myRooms[11], 'civ', 'enemy', 'melee', 5, true, 1); this.createNPC(MadnessLevel.myRooms[11], 'civ', 'enemy', 'unarmed', 4, true, 1); this.createRoster(MadnessLevel.myRooms[11], ['agent', 'agent', 'civ'], 'enemy', 'ranged', 3); this.createRoster(MadnessLevel.myRooms[11], ['agent', 'agent'], 'enemy', 'ranged', 4); this.createRoster(MadnessLevel.myRooms[11], ['agent', 'agent', 'agent', 'agent'], 'enemy', 'ranged', 6); this.createRoster(MadnessLevel.myRooms[11], ['agent'], 'enemy', 'ranged', 6); this.createNPC(MadnessLevel.myRooms[12], 'agent', 'enemy', 'ranged', 2, true, 2); this.createNPC(MadnessLevel.myRooms[12], 'agent', 'enemy', 'melee', 6, true, 2); this.createRoster(MadnessLevel.myRooms[12], ['agent', 'agent'], 'enemy', 'ranged', 3); this.createNPC(MadnessLevel.myRooms[13], 'agent', 'enemy', 'ranged', 0, true, 2); this.createNPC(MadnessLevel.myRooms[13], 'agent', 'enemy', 'ranged', 4, true, 2); this.createRoster(MadnessLevel.myRooms[13], ['agent', 'civ', 'civ', 'civ'], 'enemy', 'ranged', 3); this.createRoster(MadnessLevel.myRooms[13], ['agent', 'agent', 'civ', 'civ'], 'enemy', 'melee', 10); this.createRoster(MadnessLevel.myRooms[13], ['agent', 'agent', 'agent', 'civ'], 'enemy', 'ranged', 6); this.createRoster(MadnessLevel.myRooms[13], ['agent', 'agent', 'agent', 'agent'], 'enemy', 'ranged', 9); this.createRoster(MadnessLevel.myRooms[13], ['agent', 'agent', 'agent', 'civ'], 'enemy', 'ranged', 2); this.createRoster(MadnessLevel.myRooms[13], ['agent', 'agent', 'agent', 'agent'], 'enemy', 'ranged', 9); this.addItem(MadnessLevel.myRooms[3].myActivators[1], ItemGenerator.createWeapon('glock20', false)); this.addItem(MadnessLevel.myRooms[3].myActivators[1], ItemGenerator.createWeapon('spas12', false)); this.addItem(MadnessLevel.myRooms[5].myActivators[0], ItemGenerator.createWeapon('l337sword', false)); this.addItem(MadnessLevel.myRooms[9].myActivators[0], ItemGenerator.createWeapon('ppk', false)); this.addItem(MadnessLevel.myRooms[9].myActivators[0], ItemGenerator.createWeapon('500long', false)); this.addItem(MadnessLevel.myRooms[13].myActivators[0], ItemGenerator.createWeapon('tmp', false)); this.makeObjective(MadnessLevel.myRooms[4], 'clear', true, false); this.makeObjective(MadnessLevel.myRooms[6], 'clear', true, false); this.makeObjective(MadnessLevel.myRooms[10], 'clear', true, false); this.makeObjective(MadnessLevel.myRooms[13], 'clear', true, false); this.applyTrack('stage4', this); }; v2.level0_4 = function () { this.myName = '[1-E] Recon Hut'; this.myDescription = ' With the Communication Tower down and the Barracks totally obliterated, the Nexus has been forced to adapt. Engineers have been dispatched to convert a nearby Recon Hut into a new Com-Tower. Disable the facility.'; this.myDifficulty = 3; var v2 = new MadnessDataFile(); v2.createNew('sanford'); MadnessRoster.playerRoster.addCharacter(v2); MadnessRoster.playerRoster.makeActive(v2); v2.giveItem(ItemGenerator.createWeapon('hook', false), 0); v2.giveItem(ItemGenerator.createWeapon('glock20', true), 1); v2.myWeapons[1].upgradeSight = false; v2.myWeapons[1].upgradeLaser = true; v2.myWeapons[1].myColor = 1; v2 = new MadnessDataFile(); v2.createNew('deimos'); MadnessRoster.playerRoster.addCharacter(v2); MadnessRoster.playerRoster.makeActive(v2); v2.giveItem(ItemGenerator.createWeapon('mp7', true), 0); v2.giveItem(ItemGenerator.createWeapon('beretta', true), 1); v2.myWeapons[0].upgradeSight = true; v2.myWeapons[0].upgradeLaser = true; v2.myWeapons[0].myColor = 1; v2.myWeapons[1].upgradeSight = false; v2.myWeapons[1].upgradeLaser = true; v2.myWeapons[1].myColor = 1; MadnessLevel.totalRooms = 12; this.addRooms(MadnessLevel.totalRooms, MadnessGameSelect.gameMode); MadnessLevel.doorList = [1, 2, 3, 2, 3, 3, 2, 1, 2, 2, 2, 2]; this.addDoors(MadnessLevel.myRooms, MadnessLevel.doorList); this.addStartPoint(MadnessLevel.myRooms[0]); this.setDoorDir(0, 0, 'left'); this.setDoorDir(1, 0, 'right'); this.setDoorDir(1, 1, 'left'); this.setDoorDir(2, 0, 'right'); this.setDoorDir(2, 1, 'down'); this.setDoorDir(2, 2, 'left'); this.setDoorDir(3, 0, 'right'); this.setDoorDir(3, 1, 'left'); this.setDoorDir(4, 0, 'right'); this.setDoorDir(4, 1, 'down'); this.setDoorDir(4, 2, 'left'); this.setDoorDir(5, 0, 'right'); this.setDoorDir(5, 1, 'down'); this.setDoorDir(5, 2, 'left'); this.setDoorDir(6, 0, 'right'); this.setDoorDir(6, 1, 'left'); this.setDoorDir(7, 0, 'left'); this.setDoorDir(8, 0, 'right'); this.setDoorDir(8, 1, 'down'); this.setDoorDir(9, 0, 'right'); this.setDoorDir(9, 1, 'down'); this.setDoorDir(10, 0, 'right'); this.setDoorDir(10, 1, 'down'); this.setDoorDir(11, 0, 'right'); this.setDoorDir(11, 1, 'down'); this.connectDoors(0, 0, '---', 1, 0); this.connectDoors(1, 1, '---', 2, 0); this.connectDoors(2, 1, '---', 8, 0); this.connectDoors(2, 2, '---', 3, 0); this.connectDoors(3, 1, '---', 4, 0); this.connectDoors(4, 1, '---', 5, 1); this.connectDoors(5, 0, '---', 6, 1); this.connectDoors(6, 0, '---', 7, 0); this.connectDoors(8, 1, '---', 9, 0); this.connectDoors(9, 1, '---', 10, 0); this.connectDoors(10, 1, '---', 11, 0); this.addEvent(MadnessLevel.myRooms[2], MadnessEvents.world_0_4_2_A); this.addActivator(2, 'lockerRight'); this.addActivator(6, 'lockerLeft'); this.addActivator(7, 'bomb_powerLeft'); this.addActivator(11, 'lockerLeft'); this.addActivator(11, 'terminalRight'); this.addEvent(MadnessLevel.myRooms[11].myActivators[1], MadnessEvents.world_0_4_11_A); this.addObstacle(1, 'empty1'); this.addObstacle(2, 'spikes1'); this.addObstacle(3, 'empty3'); this.addObstacle(6, 'empty0'); this.addObstacle(7, 'empty1'); this.addObstacle(8, 'empty1'); this.addObstacle(8, 'empty3'); this.addObstacle(9, 'empty0'); this.addObstacle(11, 'empty1'); this.addObstacle(11, 'empty3'); this.createNPC(MadnessLevel.myRooms[1], 'civ', 'enemy', 'melee', 6, true, 1); this.createNPC(MadnessLevel.myRooms[1], 'civ', 'enemy', 'unarmed', 2, true, 1); this.createNPC(MadnessLevel.myRooms[3], 'civ', 'enemy', 'unarmed', 3, true, 1); this.createNPC(MadnessLevel.myRooms[3], 'agent', 'enemy', 'ranged', 2, true, 1); this.createRoster(MadnessLevel.myRooms[3], ['agent', 'agent', 'civ'], 'enemy', 'ranged', 3); this.createRoster(MadnessLevel.myRooms[3], ['agent', 'agent'], 'enemy', 'melee', 8); this.createRoster(MadnessLevel.myRooms[3], ['agent', 'agent', 'agent', 'civ'], 'enemy', 'ranged', 3); this.createRoster(MadnessLevel.myRooms[3], ['agent', 'agent', 'agent', 'agent'], 'enemy', 'melee', 8); this.createNPC(MadnessLevel.myRooms[4], 'agent', 'enemy', 'ranged', 4, true, 1); this.createRoster(MadnessLevel.myRooms[4], ['agent'], 'enemy', 'ranged', 3); this.createRoster(MadnessLevel.myRooms[4], ['agent', 'agent', 'agent', 'civ'], 'enemy', 'ranged', 3); this.createRoster(MadnessLevel.myRooms[4], ['agent', 'civ'], 'enemy', 'melee', 3); this.createRoster(MadnessLevel.myRooms[4], ['agent', 'agent', 'agent'], 'enemy', 'melee', 8); this.createNPC(MadnessLevel.myRooms[5], 'agent', 'enemy', 'ranged', 4, true, 3); this.createRoster(MadnessLevel.myRooms[5], ['agent', 'agent', 'civ'], 'enemy', 'ranged', 4); this.createNPC(MadnessLevel.myRooms[6], 'agent', 'enemy', 'ranged', 4, true, 2); this.createRoster(MadnessLevel.myRooms[6], ['agent', 'agent', 'civ'], 'enemy', 'ranged', 3); this.createRoster(MadnessLevel.myRooms[6], ['agent', 'agent', 'agent', 'agent'], 'enemy', 'ranged', 5); this.createRoster(MadnessLevel.myRooms[6], ['agent'], 'enemy', 'ranged', 3); this.createNPC(MadnessLevel.myRooms[7], 'civ', 'enemy', 'melee', 4, true, 1); this.createNPC(MadnessLevel.myRooms[7], 'agent', 'enemy', 'ranged', 4, true, 4); this.createNPC(MadnessLevel.myRooms[7], 'agent2', 'enemy', 'ranged', 8, true, 1); this.createNPC(MadnessLevel.myRooms[8], 'agent', 'enemy', 'ranged', 0, true, 2); this.createNPC(MadnessLevel.myRooms[9], 'agent', 'enemy', 'ranged', 3, true, 3); this.createNPC(MadnessLevel.myRooms[9], 'agent', 'enemy', 'ranged', 5, true, 2); this.createRoster(MadnessLevel.myRooms[10], ['agent'], 'enemy', 'ranged', 3); this.createRoster(MadnessLevel.myRooms[10], ['agent', 'agent2'], 'enemy', 'melee', 12); this.createRoster(MadnessLevel.myRooms[10], ['agent'], 'enemy', 'ranged', 3); this.createRoster(MadnessLevel.myRooms[10], ['agent'], 'enemy', 'melee', 3); this.createRoster(MadnessLevel.myRooms[10], ['agent', 'agent'], 'enemy', 'ranged', 5); this.createRoster(MadnessLevel.myRooms[10], ['agent'], 'enemy', 'ranged', 3); this.createNPC(MadnessLevel.myRooms[11], 'agent2', 'enemy', 'ranged', 6, true, 2); this.createNPC(MadnessLevel.myRooms[11], 'agent', 'enemy', 'ranged', 3, true, 3); this.createRoster(MadnessLevel.myRooms[11], ['agent2', 'agent', 'agent'], 'enemy', 'ranged', 4); this.createRoster(MadnessLevel.myRooms[11], ['agent', 'civ'], 'enemy', 'ranged', 5); this.createRoster(MadnessLevel.myRooms[11], ['agent2', 'agent', 'civ'], 'enemy', 'ranged', 5); this.createRoster(MadnessLevel.myRooms[11], ['agent', 'agent'], 'enemy', 'melee', 3); this.createRoster(MadnessLevel.myRooms[11], ['agent', 'agent2', 'civ'], 'enemy', 'ranged', 6); this.createRoster(MadnessLevel.myRooms[11], ['civ', 'agent', 'agent2'], 'enemy', 'ranged', 4); this.createRoster(MadnessLevel.myRooms[11], ['agent2', 'agent2'], 'enemy', 'ranged', 5); this.addItem(MadnessLevel.myRooms[2].myActivators[0], ItemGenerator.createWeapon('machette', false)); this.addItem(MadnessLevel.myRooms[2].myActivators[0], ItemGenerator.createWeapon('beretta', false)); this.addItem(MadnessLevel.myRooms[6].myActivators[0], ItemGenerator.createWeapon('357snub', false)); this.addItem(MadnessLevel.myRooms[6].myActivators[0], ItemGenerator.createWeapon('500snub', false)); this.addItem(MadnessLevel.myRooms[11].myActivators[0], ItemGenerator.createWeapon('oa93', false)); this.addItem(MadnessLevel.myRooms[11].myActivators[0], ItemGenerator.createWeapon('mp5k', false)); this.addItem(MadnessLevel.myRooms[11].myActivators[0], ItemGenerator.createWeapon('m203', false)); this.makeObjective(MadnessLevel.myRooms[7].myActivators[0], 'use', true, false); this.makeObjective(MadnessLevel.myRooms[7], 'clear', true, false); this.applyTrack('stage5', this); }; v2.level0_5 = function () { this.myName = '[1-F] Stronghold'; this.myDescription = ' Intercepted transmissions report the deployment of new G03LM Mk1 units for training at the Nexus Stronghold. Infiltrate the facility, learn what you can, and elminate this new threat.'; this.myDifficulty = 3; var v2 = new MadnessDataFile(); v2.createNew('sanford'); MadnessRoster.playerRoster.addCharacter(v2); MadnessRoster.playerRoster.makeActive(v2); v2.giveItem(ItemGenerator.createWeapon('hook', false), 0); v2.giveItem(ItemGenerator.createWeapon('glock20', true), 1); v2.myWeapons[1].upgradeSight = false; v2.myWeapons[1].upgradeLaser = true; v2.myWeapons[1].myColor = 1; v2 = new MadnessDataFile(); v2.createNew('deimos'); MadnessRoster.playerRoster.addCharacter(v2); MadnessRoster.playerRoster.makeActive(v2); v2.giveItem(ItemGenerator.createWeapon('mp7', true), 0); v2.giveItem(ItemGenerator.createWeapon('beretta', true), 1); v2.myWeapons[0].upgradeSight = true; v2.myWeapons[0].upgradeLaser = true; v2.myWeapons[0].myColor = 1; v2.myWeapons[1].upgradeSight = false; v2.myWeapons[1].upgradeLaser = true; v2.myWeapons[1].myColor = 1; MadnessLevel.totalRooms = 15; this.addRooms(MadnessLevel.totalRooms, MadnessGameSelect.gameMode); MadnessLevel.doorList = [1, 2, 2, 3, 2, 2, 3, 2, 3, 2, 2, 3, 2, 2, 3]; this.addDoors(MadnessLevel.myRooms, MadnessLevel.doorList); this.addStartPoint(MadnessLevel.myRooms[0]); this.setDoorDir(0, 0, 'left'); this.setDoorDir(1, 0, 'right'); this.setDoorDir(1, 1, 'left'); this.setDoorDir(2, 0, 'right'); this.setDoorDir(2, 1, 'left'); this.setDoorDir(3, 0, 'right'); this.setDoorDir(3, 1, 'down'); this.setDoorDir(3, 2, 'left'); this.setDoorDir(4, 0, 'right'); this.setDoorDir(4, 1, 'left'); this.setDoorDir(5, 0, 'right'); this.setDoorDir(5, 1, 'down'); this.setDoorDir(6, 0, 'right'); this.setDoorDir(6, 1, 'down'); this.setDoorDir(6, 2, 'left'); this.setDoorDir(7, 0, 'right'); this.setDoorDir(7, 1, 'left'); this.setDoorDir(8, 0, 'right'); this.setDoorDir(8, 1, 'down'); this.setDoorDir(8, 2, 'left'); this.setDoorDir(9, 0, 'right'); this.setDoorDir(9, 1, 'left'); this.setDoorDir(10, 0, 'right'); this.setDoorDir(10, 1, 'left'); this.setDoorDir(11, 0, 'right'); this.setDoorDir(11, 1, 'down'); this.setDoorDir(11, 2, 'left'); this.setDoorDir(12, 0, 'right'); this.setDoorDir(12, 1, 'left'); this.setDoorDir(13, 0, 'right'); this.setDoorDir(13, 1, 'left'); this.setDoorDir(14, 0, 'right'); this.setDoorDir(14, 1, 'down'); this.setDoorDir(14, 2, 'down'); this.connectDoors(0, 0, '---', 1, 0); this.connectDoors(1, 1, '---', 2, 0); this.connectDoors(2, 1, '---', 3, 0); this.connectDoors(3, 1, '---', 4, 0); this.connectDoors(3, 2, '---', 6, 0); this.connectDoors(4, 1, '---', 5, 0); this.connectDoors(6, 2, '---', 7, 0); this.connectDoors(7, 1, '---', 8, 0); this.connectDoors(8, 1, '---', 9, 0); this.connectDoors(8, 2, '---', 10, 0); this.connectDoors(10, 1, '---', 11, 0); this.connectDoors(11, 1, '---', 12, 0); this.connectDoors(11, 2, '---', 13, 0); this.connectDoors(13, 1, '---', 14, 0); this.addActivator(1, 'lockerRight'); this.addActivator(3, 'lockerLeft'); this.addActivator(4, 'lockerRight'); this.addActivator(5, 'lockerRight'); this.addActivator(7, 'lockerLeft'); this.addActivator(9, 'lockerRight'); this.addActivator(9, 'lockerRight'); this.addActivator(10, 'lockerLeft'); this.addActivator(11, 'lockerLeft'); this.addActivator(12, 'lockerRight'); this.addActivator(12, 'lockerRight'); this.addActivator(12, 'lockerRight'); this.addActivator(13, 'lockerRight'); this.addObstacle(1, 'empty1'); this.addObstacle(1, 'empty3'); this.addObstacle(4, 'empty1'); this.addObstacle(4, 'empty3'); this.addObstacle(5, 'empty3'); this.addObstacle(5, 'empty1'); this.addObstacle(8, 'empty1'); this.addObstacle(9, 'empty1'); this.addObstacle(11, 'empty4'); this.addObstacle(12, 'empty1'); this.addObstacle(12, 'empty1'); this.addObstacle(13, 'empty1'); this.addObstacle(14, 'empty1'); this.addObstacle(14, 'empty1'); this.setStartup('stun_surprise', 0); this.setStartNPC(); this.createNPC(MadnessLevel.myRooms[0], 'agent', 'enemy', 'ranged', 6, true, 2); this.endStartNPC(); this.resetStartup(); this.createNPC(MadnessLevel.myRooms[1], 'agent', 'enemy', 'melee', 7, true, 3); this.createNPC(MadnessLevel.myRooms[2], 'agent', 'enemy', 'melee', 7, true, 3); this.createNPC(MadnessLevel.myRooms[2], 'agent2', 'enemy', 'ranged', 6, true, 1); this.createRoster(MadnessLevel.myRooms[2], ['agent', 'agent', 'agent2'], 'enemy', 'ranged', 4); this.createNPC(MadnessLevel.myRooms[3], 'agent', 'enemy', 'ranged', 6, true, 2); this.createRoster(MadnessLevel.myRooms[3], ['agent', 'agent', 'agent'], 'enemy', 'ranged', 4); this.createRoster(MadnessLevel.myRooms[3], ['agent'], 'enemy', 'ranged', 8); this.createRoster(MadnessLevel.myRooms[3], ['agent', 'agent', 'agent2', 'agent'], 'enemy', 'ranged', 5); this.createNPC(MadnessLevel.myRooms[4], 'agent', 'enemy', 'ranged', 4, true, 1); this.createNPC(MadnessLevel.myRooms[4], 'agent2', 'enemy', 'ranged', 7, true, 1); this.createRoster(MadnessLevel.myRooms[5], ['agent', 'agent2', 'agent2', 'agent', 'agent'], 'enemy', 'melee', 8); this.createRoster(MadnessLevel.myRooms[5], ['agent'], 'enemy', 'melee', 12); this.createNPC(MadnessLevel.myRooms[6], 'agent', 'enemy', 'ranged', 6, true, 4); this.createNPC(MadnessLevel.myRooms[8], 'fatboy', 'enemy', 'fatboy', 10, false, 1); MadnessLevel.myRooms[8].myCharacters[0].giveItem(ItemGenerator.createWeapon('mp5', false), 0); MadnessLevel.myRooms[8].myCharacters[0].myWeapons[0].myClips = 3; MadnessLevel.myRooms[8].myCharacters[0].giveItem(ItemGenerator.createWeapon('mallet', false), 1); this.createNPC(MadnessLevel.myRooms[8], 'agent', 'enemy', 'ranged', 3, true, 2); this.createRoster(MadnessLevel.myRooms[8], ['civ', 'civ'], 'enemy', 'ranged', 4); this.addEvent(MadnessLevel.myRooms[8].myRosters[0], MadnessEvents.world_0_5_8_A); this.createRoster(MadnessLevel.myRooms[9], ['agent', 'agent', 'agent'], 'enemy', 'ranged', 0); this.createRoster(MadnessLevel.myRooms[9], ['agent', 'agent'], 'enemy', 'ranged', 1); this.createRoster(MadnessLevel.myRooms[9], ['agent', 'agent', 'agent', 'agent'], 'enemy', 'melee', 8); this.createNPC(MadnessLevel.myRooms[10], 'agent', 'enemy', 'melee', 6, true, 2); this.createNPC(MadnessLevel.myRooms[10], 'agent', 'enemy', 'unarmed', 6, true, 1); this.createRoster(MadnessLevel.myRooms[10], ['agent', 'agent', 'agent', 'agent', 'agent'], 'enemy', 'ranged', 2); this.createRoster(MadnessLevel.myRooms[10], ['agent', 'agent'], 'enemy', 'ranged', 3); this.createRoster(MadnessLevel.myRooms[10], ['agent', 'agent', 'agent', 'agent', 'agent', 'agent'], 'enemy', 'ranged', 4); this.createNPC(MadnessLevel.myRooms[11], 'agent2', 'enemy', 'melee', 10, true, 2); this.createNPC(MadnessLevel.myRooms[11], 'agent', 'enemy', 'ranged', 6, true, 1); this.createRoster(MadnessLevel.myRooms[11], ['agent', 'agent', 'agent', 'agent', 'agent', 'agent'], 'enemy', 'ranged', 0); this.createRoster(MadnessLevel.myRooms[11], ['agent', 'agent', 'agent', 'agent', 'agent'], 'enemy', 'ranged', 0); this.createRoster(MadnessLevel.myRooms[11], ['agent', 'agent'], 'enemy', 'ranged', 0); this.createNPC(MadnessLevel.myRooms[12], 'civ', 'enemy', 'ranged', 2, true, 4); this.createNPC(MadnessLevel.myRooms[12], 'agent', 'enemy', 'ranged', 6, true, 1); this.createRoster(MadnessLevel.myRooms[12], ['agent2', 'agent', 'agent', 'agent2'], 'enemy', 'ranged', 2); this.createRoster(MadnessLevel.myRooms[12], ['agent', 'agent', 'agent2', 'agent', 'agent', 'agent'], 'enemy', 'ranged', 3); this.createRoster(MadnessLevel.myRooms[12], ['agent', 'agent2', 'agent', 'agent', 'agent2', 'agent'], 'enemy', 'ranged', 4); this.createNPC(MadnessLevel.myRooms[14], 'agent', 'enemy', 'melee', 7, true, 3); this.createRoster(MadnessLevel.myRooms[14], ['fatboy'], 'enemy', 'fatboy', 0); MadnessLevel.myRooms[15].myRosters[0].myActiveMembers[0].giveItem(ItemGenerator.createWeapon('mp5', false), 0); MadnessLevel.myRooms[15].myRosters[0].myActiveMembers[0].myWeapons[0].myClips = 3; MadnessLevel.myRooms[15].myRosters[0].myActiveMembers[0].giveItem(ItemGenerator.createWeapon('mallet', false), 1); this.createRoster(MadnessLevel.myRooms[14], ['agent', 'agent'], 'enemy', 'ranged', 4); this.addEvent(MadnessLevel.myRooms[14].myRosters[1], MadnessEvents.world_0_5_14_A); this.addItem(MadnessLevel.myRooms[1].myActivators[0], ItemGenerator.createWeapon('glock20', false)); this.addItem(MadnessLevel.myRooms[3].myActivators[0], ItemGenerator.createWeapon('glock20', false)); this.addItem(MadnessLevel.myRooms[5].myActivators[0], ItemGenerator.createWeapon('bowieknife', false)); this.addItem(MadnessLevel.myRooms[5].myActivators[0], ItemGenerator.createWeapon('ironsword', false)); this.addItem(MadnessLevel.myRooms[5].myActivators[0], ItemGenerator.createWeapon('hk2', false)); this.addItem(MadnessLevel.myRooms[9].myActivators[0], ItemGenerator.createWeapon('ak74u', false)); this.addItem(MadnessLevel.myRooms[9].myActivators[0], ItemGenerator.createWeapon('carbonsword', false)); this.addItem(MadnessLevel.myRooms[12].myActivators[0], ItemGenerator.createWeapon('ak74', false)); this.addItem(MadnessLevel.myRooms[12].myActivators[2], ItemGenerator.createWeapon('prokiller460', false)); this.addItem(MadnessLevel.myRooms[12].myActivators[2], ItemGenerator.createWeapon('prokiller460', false)); this.makeObjective(MadnessLevel.myRooms[14], 'clear', true, false); this.applyTrack('stage6', this); }; } else { goto 54387; } storedv2.level0_6 = function () { this.myName = '[1-G] Bar'; this.myDescription = ' It\'s time to prepare for the final assault on the Nexus Headquarters. A nearby bar is operating as a front for a munitions depot, and hitting this location will benefit us twofold: we\'ll be well-equipped for the final battle, and Nexus morale will plummet.'; this.myDifficulty = 4; var v2 = new MadnessDataFile(); v2.createNew('sanford'); MadnessRoster.playerRoster.addCharacter(v2); MadnessRoster.playerRoster.makeActive(v2); v2.giveItem(ItemGenerator.createWeapon('hook', false), 0); v2.giveItem(ItemGenerator.createWeapon('glock20', true), 1); v2.myWeapons[1].upgradeSight = false; v2.myWeapons[1].upgradeLaser = true; v2.myWeapons[1].myColor = 1; v2 = new MadnessDataFile(); v2.createNew('deimos'); MadnessRoster.playerRoster.addCharacter(v2); MadnessRoster.playerRoster.makeActive(v2); v2.giveItem(ItemGenerator.createWeapon('mp7', true), 0); v2.giveItem(ItemGenerator.createWeapon('beretta', true), 1); v2.myWeapons[0].upgradeSight = true; v2.myWeapons[0].upgradeLaser = true; v2.myWeapons[0].myColor = 1; v2.myWeapons[1].upgradeSight = false; v2.myWeapons[1].upgradeLaser = true; v2.myWeapons[1].myColor = 1; MadnessLevel.totalRooms = 10; this.addRooms(MadnessLevel.totalRooms, MadnessGameSelect.gameMode); MadnessLevel.doorList = [1, 2, 3, 2, 2, 3, 3, 2, 2, 4]; this.addDoors(MadnessLevel.myRooms, MadnessLevel.doorList); this.addStartPoint(MadnessLevel.myRooms[0]); this.setDoorDir(0, 0, 'left'); this.setDoorDir(1, 0, 'right'); this.setDoorDir(1, 1, 'left'); this.setDoorDir(2, 0, 'right'); this.setDoorDir(2, 1, 'down'); this.setDoorDir(2, 2, 'left'); this.setDoorDir(3, 0, 'right'); this.setDoorDir(3, 1, 'left'); this.setDoorDir(4, 0, 'right'); this.setDoorDir(4, 1, 'left'); this.setDoorDir(5, 0, 'right'); this.setDoorDir(5, 1, 'down'); this.setDoorDir(5, 2, 'left'); this.setDoorDir(6, 0, 'right'); this.setDoorDir(6, 1, 'down'); this.setDoorDir(6, 2, 'left'); this.setDoorDir(7, 0, 'right'); this.setDoorDir(7, 1, 'down'); this.setDoorDir(8, 0, 'right'); this.setDoorDir(8, 1, 'left'); this.setDoorDir(9, 0, 'right'); this.setDoorDir(9, 1, 'down'); this.setDoorDir(9, 2, 'down'); this.setDoorDir(9, 3, 'left'); this.connectDoors(0, 0, '---', 1, 0); this.connectDoors(1, 1, '---', 2, 0); this.connectDoors(2, 1, '---', 3, 0); this.connectDoors(2, 2, '---', 4, 0); this.connectDoors(4, 1, '---', 5, 0); this.connectDoors(5, 2, '---', 6, 0); this.connectDoors(6, 2, '---', 7, 0); this.connectDoors(7, 1, '---', 8, 0); this.connectDoors(8, 1, '---', 9, 0); this.addActivator(2, 'lockerLeft'); this.addActivator(3, 'lockerRight'); this.addActivator(3, 'lockerRight'); this.addActivator(3, 'lockerRight'); this.addActivator(6, 'lockerRight'); this.addObstacle(1, 'empty0'); this.addObstacle(1, 'empty3'); this.addObstacle(2, 'empty1'); this.addObstacle(4, 'empty1'); this.addObstacle(6, 'empty3'); this.addObstacle(6, 'empty0'); this.addObstacle(7, 'empty0'); this.addObstacle(7, 'empty0'); this.addObstacle(7, 'empty3'); this.addObstacle(7, 'empty3'); this.addObstacle(7, 'empty3'); this.addObstacle(8, 'empty4'); this.addObstacle(9, 'empty3'); this.addObstacle(9, 'empty3'); this.addObstacle(9, 'empty0'); this.addObstacle(9, 'empty0'); this.addObstacle(9, 'empty0'); this.setStartNPC(); this.createNPC(MadnessLevel.myRooms[0], 'agent', 'enemy', 'ranged', 10, true, 2); this.endStartNPC(); this.createRoster(MadnessLevel.myRooms[0], ['agent', 'agent', 'agent'], 'enemy', 'unarmed', 2); this.createRoster(MadnessLevel.myRooms[0], ['agent', 'agent'], 'enemy', 'ranged', 4); this.createRoster(MadnessLevel.myRooms[0], ['agent', 'agent', 'agent'], 'enemy', 'melee', 2); this.createRoster(MadnessLevel.myRooms[0], ['agent2', 'agent2', 'agent2'], 'enemy', 'melee', 15); this.createNPC(MadnessLevel.myRooms[1], 'agent', 'enemy', 'ranged', 6, true, 4); this.createRoster(MadnessLevel.myRooms[1], ['agent2', 'agent2', 'agent'], 'enemy', 'ranged', 5); this.createRoster(MadnessLevel.myRooms[1], ['agent2', 'agent'], 'enemy', 'ranged', 4); this.createNPC(MadnessLevel.myRooms[2], 'agent', 'enemy', 'ranged', 6, true, 2); this.createNPC(MadnessLevel.myRooms[2], 'agent2', 'enemy', 'ranged', 6, true, 1); this.createNPC(MadnessLevel.myRooms[3], 'agent', 'enemy', 'ranged', 3, true, 2); this.createRoster(MadnessLevel.myRooms[3], ['agent', 'agent2', 'agent', 'agent'], 'enemy', 'ranged', 5); this.createRoster(MadnessLevel.myRooms[3], ['agent', 'agent', 'agent'], 'enemy', 'ranged', 6); this.createNPC(MadnessLevel.myRooms[4], 'agent', 'enemy', 'ranged', 3, true, 2); this.createNPC(MadnessLevel.myRooms[4], 'agent3', 'enemy', 'ranged', 6, true, 1); this.createRoster(MadnessLevel.myRooms[4], ['agent', 'agent2', 'agent'], 'enemy', 'ranged', 5); this.createRoster(MadnessLevel.myRooms[4], ['agent2', 'agent'], 'enemy', 'ranged', 4); this.createRoster(MadnessLevel.myRooms[4], ['agent', 'agent2', 'agent'], 'enemy', 'melee', 8); this.createRoster(MadnessLevel.myRooms[4], ['fatboy'], 'enemy', 'fatboy', 10); MadnessLevel.myRooms[4].myRosters[3].myActiveMembers[0].giveItem(ItemGenerator.createWeapon('mp5', false), 0); MadnessLevel.myRooms[4].myRosters[3].myActiveMembers[0].myWeapons[0].myClips = 3; MadnessLevel.myRooms[4].myRosters[3].myActiveMembers[0].giveItem(ItemGenerator.createWeapon('mallet', false), 1); this.createRoster(MadnessLevel.myRooms[4], ['agent', 'agent'], 'enemy', 'ranged', 5); this.addEvent(MadnessLevel.myRooms[4].myRosters[4], MadnessEvents.world_0_6_4_A); this.createNPC(MadnessLevel.myRooms[5], 'agent', 'enemy', 'ranged', 5, true, 4); this.createRoster(MadnessLevel.myRooms[5], ['agent2', 'agent2'], 'enemy', 'ranged', 5); this.createRoster(MadnessLevel.myRooms[5], ['agent2', 'agent', 'agent', 'agent', 'agent'], 'enemy', 'ranged', 4); this.setStartup('startup_bottle2', 1); this.createNPC(MadnessLevel.myRooms[6], 'civ', 'enemy', 'bottle', 5, false, 3); this.createRoster(MadnessLevel.myRooms[6], ['civ', 'civ', 'civ'], 'enemy', 'bottle', 5); this.createRoster(MadnessLevel.myRooms[6], ['civ', 'civ'], 'enemy', 'bottle', 4); this.setStartNPC(); this.createNPC(MadnessLevel.myRooms[7], 'civ', 'enemy', 'bottle', 5, false, 6); this.createRoster(MadnessLevel.myRooms[7], ['civ', 'civ', 'civ'], 'enemy', 'bottle', 5); this.createRoster(MadnessLevel.myRooms[7], ['civ', 'civ'], 'enemy', 'bottle', 4); this.createRoster(MadnessLevel.myRooms[7], ['civ', 'civ', 'civ', 'civ'], 'enemy', 'bottle', 5); this.createRoster(MadnessLevel.myRooms[7], ['civ', 'civ', 'civ', 'civ', 'civ'], 'enemy', 'bottle', 4); this.createRoster(MadnessLevel.myRooms[7], ['civ', 'civ', 'civ', 'civ'], 'enemy', 'bottle', 5); this.endStartNPC(); this.createNPC(MadnessLevel.myRooms[8], 'civ', 'enemy', 'bottle', 5, false, 4); this.createRoster(MadnessLevel.myRooms[8], ['civ', 'civ', 'civ'], 'enemy', 'bottle', 5); this.createRoster(MadnessLevel.myRooms[8], ['civ', 'civ', 'civ', 'civ'], 'enemy', 'bottle', 5); this.createRoster(MadnessLevel.myRooms[8], ['civ', 'civ', 'civ'], 'enemy', 'bottle', 5); this.resetStartup(); this.setStartNPC(); this.createNPC(MadnessLevel.myRooms[9], 'fatman', 'enemy', 'unarmed', 5, false, 1); MadnessLevel.myRooms[9].myCharacters[0].giveItem(ItemGenerator.createWeapon('megahammer', false), 0); MadnessLevel.myRooms[9].myCharacters[0].giveItem(ItemGenerator.createWeapon('chaingun', false), 1); this.endStartNPC(); this.setStartup('startup_bottle2', 1); this.createNPC(MadnessLevel.myRooms[9], 'civ', 'enemy', 'bottle', 5, false, 8); this.resetStartup(); this.createRoster(MadnessLevel.myRooms[9], ['agent', 'agent', 'agent', 'agent2'], 'enemy', 'ranged', 7); this.addEvent(MadnessLevel.myRooms[9].myRosters[0], MadnessEvents.world_0_6_9_A); this.addItem(MadnessLevel.myRooms[2].myActivators[0], ItemGenerator.createWeapon('bottle', false)); this.addItem(MadnessLevel.myRooms[2].myActivators[0], ItemGenerator.createWeapon('bottle', false)); this.addItem(MadnessLevel.myRooms[2].myActivators[0], ItemGenerator.createWeapon('bottle', false)); this.addItem(MadnessLevel.myRooms[3].myActivators[0], ItemGenerator.createWeapon('bottle', false)); this.addItem(MadnessLevel.myRooms[3].myActivators[0], ItemGenerator.createWeapon('bottle', false)); this.addItem(MadnessLevel.myRooms[3].myActivators[1], ItemGenerator.createWeapon('bottle', false)); this.addItem(MadnessLevel.myRooms[3].myActivators[1], ItemGenerator.createWeapon('bottle', false)); this.addItem(MadnessLevel.myRooms[3].myActivators[1], ItemGenerator.createWeapon('bottle', false)); this.addItem(MadnessLevel.myRooms[3].myActivators[2], ItemGenerator.createWeapon('bottle', false)); this.addItem(MadnessLevel.myRooms[6].myActivators[0], ItemGenerator.createWeapon('bottle', false)); this.addItem(MadnessLevel.myRooms[6].myActivators[0], ItemGenerator.createWeapon('bottle', false)); this.addItem(MadnessLevel.myRooms[6].myActivators[0], ItemGenerator.createWeapon('bottle', false)); this.makeObjective(MadnessLevel.myRooms[9], 'clear', true, false); this.applyTrack('club1', this); this.applyTrack('club2', MadnessLevel.myRooms[0]); this.applyTrack('boss1', MadnessLevel.myRooms[9]); }; storedv2.level0_7 = function () { this.myName = '[1-H] Nexus H.Q.'; this.myDescription = ' Agents Sanford and Deimos will follow Hank into the heart of Project Nexus and eliminate all threats. The Nexus Training Program is still a mystery to us. Discover what you can, and take no prisoners.'; this.myDifficulty = 4; var v2 = new MadnessDataFile(); v2.createNew('hank'); MadnessRoster.playerRoster.addCharacter(v2); MadnessRoster.playerRoster.makeActive(v2); v2.giveItem(ItemGenerator.createWeapon('glock20', false), 0); v2.giveItem(ItemGenerator.createWeapon('dragonsword', false), 1); v2.myWeapons[0].myClips = 4; v2.myStartup = 'startup3'; v2.myWeapons[0].upgradeSight = true; v2.myWeapons[0].upgradeLaser = true; v2.myWeapons[1].myColor = 1; v2 = new MadnessDataFile(); v2.createNew('sanford'); MadnessRoster.playerRoster.addCharacter(v2); MadnessRoster.playerRoster.makeActive(v2); v2.giveItem(ItemGenerator.createWeapon('hook', false), 0); v2.giveItem(ItemGenerator.createWeapon('glock20', true), 1); v2.myWeapons[1].upgradeSight = false; v2.myWeapons[1].upgradeLaser = true; v2.myWeapons[1].myColor = 1; v2 = new MadnessDataFile(); v2.createNew('deimos'); MadnessRoster.playerRoster.addCharacter(v2); MadnessRoster.playerRoster.makeActive(v2); v2.giveItem(ItemGenerator.createWeapon('mp7', true), 0); v2.giveItem(ItemGenerator.createWeapon('beretta', true), 1); v2.myWeapons[0].upgradeSight = true; v2.myWeapons[0].upgradeLaser = true; v2.myWeapons[0].myColor = 1; v2.myWeapons[1].upgradeSight = false; v2.myWeapons[1].upgradeLaser = true; v2.myWeapons[1].myColor = 1; MadnessLevel.totalRooms = 16; this.addRooms(MadnessLevel.totalRooms, MadnessGameSelect.gameMode); MadnessLevel.doorList = [1, 2, 2, 3, 2, 2, 3, 1, 2, 3, 2, 2, 3, 2, 2, 3]; this.addDoors(MadnessLevel.myRooms, MadnessLevel.doorList); this.addStartPoint(MadnessLevel.myRooms[0]); this.setDoorDir(0, 0, 'left'); this.setDoorDir(1, 0, 'right'); this.setDoorDir(1, 1, 'left'); this.setDoorDir(2, 0, 'right'); this.setDoorDir(2, 1, 'left'); this.setDoorDir(3, 0, 'right'); this.setDoorDir(3, 1, 'down'); this.setDoorDir(3, 2, 'left'); this.setDoorDir(4, 0, 'down'); this.setDoorDir(4, 1, 'left'); this.setDoorDir(5, 0, 'right'); this.setDoorDir(5, 1, 'left'); this.setDoorDir(6, 0, 'right'); this.setDoorDir(6, 1, 'down'); this.setDoorDir(6, 2, 'left'); this.setDoorDir(7, 0, 'left'); this.setDoorDir(8, 0, 'right'); this.setDoorDir(8, 1, 'left'); this.setDoorDir(9, 0, 'right'); this.setDoorDir(9, 1, 'down'); this.setDoorDir(9, 2, 'left'); this.setDoorDir(10, 0, 'down'); this.setDoorDir(10, 1, 'left'); this.setDoorDir(11, 0, 'right'); this.setDoorDir(11, 1, 'left'); this.setDoorDir(12, 0, 'right'); this.setDoorDir(12, 1, 'down'); this.setDoorDir(12, 2, 'left'); this.setDoorDir(13, 0, 'right'); this.setDoorDir(13, 1, 'left'); this.setDoorDir(14, 0, 'right'); this.setDoorDir(14, 1, 'left'); this.setDoorDir(15, 0, 'right'); this.setDoorDir(15, 1, 'down1'); this.setDoorDir(15, 2, 'down2'); this.setDoorType(15, 1, 'elevator'); this.setDoorType(15, 2, 'elevator'); this.connectDoors(0, 0, '---', 1, 0); this.connectDoors(1, 1, '---', 2, 0); this.connectDoors(2, 1, '---', 3, 1); this.connectDoors(3, 0, '---', 4, 1); this.connectDoors(3, 2, '---', 5, 0); this.connectDoors(5, 1, '---', 6, 1); this.connectDoors(6, 0, '---', 7, 0); this.connectDoors(6, 2, '---', 8, 0); this.connectDoors(8, 1, '---', 9, 1); this.connectDoors(9, 0, '---', 10, 1); this.connectDoors(9, 2, '---', 11, 0); this.connectDoors(11, 1, '---', 12, 1); this.connectDoors(12, 0, '---', 13, 1); this.connectDoors(12, 2, '---', 14, 0); this.connectDoors(14, 1, '---', 15, 0); this.addActivator(4, 'terminalLeft'); this.addEvent(MadnessLevel.myRooms[4].myActivators[0], MadnessEvents.world_0_7_4_A); this.addActivator(4, 'wallsafe'); this.addActivator(7, 'terminalLeft'); this.addEvent(MadnessLevel.myRooms[7].myActivators[0], MadnessEvents.world_0_7_7_A); this.addActivator(7, 'lockerRight'); this.addActivator(7, 'lockerRight'); this.addActivator(10, 'terminalLeft'); this.addEvent(MadnessLevel.myRooms[10].myActivators[0], MadnessEvents.world_0_7_10_A); this.addActivator(13, 'terminalLeft'); this.addEvent(MadnessLevel.myRooms[13].myActivators[0], MadnessEvents.world_0_7_13_A); this.addActivator(14, 'lockerLeft'); this.addItem(MadnessLevel.myRooms[4].myActivators[1], ItemGenerator.createWeapon('binarysword', false)); this.addItem(MadnessLevel.myRooms[7].myActivators[1], ItemGenerator.createWeapon('deagle', false)); this.addItem(MadnessLevel.myRooms[7].myActivators[1], ItemGenerator.createWeapon('dragonsword', false)); this.addItem(MadnessLevel.myRooms[7].myActivators[2], ItemGenerator.createWeapon('mp5', false)); this.addItem(MadnessLevel.myRooms[7].myActivators[2], ItemGenerator.createWeapon('mp7', false)); this.addItem(MadnessLevel.myRooms[14].myActivators[0], ItemGenerator.createWeapon('ar15', false)); this.addItem(MadnessLevel.myRooms[14].myActivators[0], ItemGenerator.createWeapon('m16', false)); this.addItem(MadnessLevel.myRooms[14].myActivators[0], ItemGenerator.createWeapon('hk416', false)); this.addObstacle(1, 'empty4'); this.addObstacle(1, 'empty1'); this.addObstacle(3, 'spikes1'); this.addObstacle(4, 'empty4'); this.addObstacle(4, 'empty4'); this.addObstacle(5, 'empty0'); this.addObstacle(6, 'spikes1'); this.addObstacle(7, 'empty4'); this.addObstacle(7, 'empty0'); this.addObstacle(9, 'spikes1'); this.addObstacle(10, 'empty1'); this.addObstacle(11, 'empty0'); this.addObstacle(12, 'spikes1'); this.addObstacle(12, 'empty1'); this.addObstacle(13, 'empty4'); this.addObstacle(14, 'empty1'); this.setStartNPC(); this.createNPC(MadnessLevel.myRooms[0], 'agent', 'enemy', 'ranged', 8, false, 3); this.createNPC(MadnessLevel.myRooms[0], 'agent2', 'enemy', 'ranged', 14, false, 1); this.endStartNPC(); this.createNPC(MadnessLevel.myRooms[1], 'agent2', 'enemy', 'ranged', 8, false, 3); this.createNPC(MadnessLevel.myRooms[1], 'agent3', 'enemy', 'ranged', 14, false, 1); this.createRoster(MadnessLevel.myRooms[1], ['agent', 'agent', 'agent'], 'enemy', 'melee', 12); this.createRoster(MadnessLevel.myRooms[1], ['agent', 'agent2', 'agent2'], 'enemy', 'ranged', 4); this.createNPC(MadnessLevel.myRooms[2], 'agent2', 'enemy', 'ranged', 10, false, 3); this.createRoster(MadnessLevel.myRooms[2], ['agent', 'agent', 'agent'], 'enemy', 'ranged', 8); this.createRoster(MadnessLevel.myRooms[2], ['agent', 'agent2'], 'enemy', 'melee', 12); this.createRoster(MadnessLevel.myRooms[2], ['agent', 'agent', 'agent'], 'enemy', 'melee', 4); this.createRoster(MadnessLevel.myRooms[2], ['agent', 'agent2', 'agent3'], 'enemy', 'ranged', 4); this.createNPC(MadnessLevel.myRooms[4], 'agent2', 'enemy', 'ranged', 8, false, 4); this.createRoster(MadnessLevel.myRooms[4], ['agent', 'agent', 'agent'], 'enemy', 'ranged', 8); this.createRoster(MadnessLevel.myRooms[4], ['agent', 'agent', 'agent3'], 'enemy', 'ranged', 4); this.createNPC(MadnessLevel.myRooms[5], 'agent', 'enemy', 'ranged', 8, false, 1); this.createNPC(MadnessLevel.myRooms[5], 'agent2', 'enemy', 'melee', 12, false, 2); this.createNPC(MadnessLevel.myRooms[7], 'agent2', 'enemy', 'ranged', 8, false, 4); this.createNPC(MadnessLevel.myRooms[8], 'agent', 'enemy', 'ranged', 8, false, 1); this.createNPC(MadnessLevel.myRooms[8], 'agent2', 'enemy', 'melee', 15, false, 2); this.createRoster(MadnessLevel.myRooms[8], ['agent', 'agent', 'agent'], 'enemy', 'ranged', 8); this.createRoster(MadnessLevel.myRooms[8], ['agent2', 'agent2', 'agent'], 'enemy', 'ranged', 4); this.createNPC(MadnessLevel.myRooms[10], 'agent2', 'enemy', 'melee', 18, false, 7); this.createNPC(MadnessLevel.myRooms[11], 'agent2', 'enemy', 'ranged', 10, false, 2); this.createNPC(MadnessLevel.myRooms[11], 'agent3', 'enemy', 'ranged', 17, false, 1); this.createRoster(MadnessLevel.myRooms[11], ['agent', 'agent', 'agent', 'agent', 'agent'], 'enemy', 'ranged', 3); this.createRoster(MadnessLevel.myRooms[11], ['agent', 'agent', 'agent', 'agent', 'agent'], 'enemy', 'ranged', 2); this.createRoster(MadnessLevel.myRooms[11], ['agent', 'agent', 'agent', 'agent'], 'enemy', 'ranged', 3); this.createRoster(MadnessLevel.myRooms[11], ['agent', 'agent', 'agent', 'agent', 'agent'], 'enemy', 'ranged', 2); this.createNPC(MadnessLevel.myRooms[13], 'agent3', 'enemy', 'ranged', 8, false, 3); this.createRoster(MadnessLevel.myRooms[13], ['agent', 'agent', 'agent2'], 'enemy', 'melee', 3); this.createRoster(MadnessLevel.myRooms[13], ['agent', 'agent'], 'enemy', 'ranged', 5); this.createNPC(MadnessLevel.myRooms[14], 'agent2', 'enemy', 'melee', 8, false, 2); this.createNPC(MadnessLevel.myRooms[14], 'agent3', 'enemy', 'ranged', 19, false, 2); this.setStartNPC(); this.createNPC(MadnessLevel.myRooms[15], 'mag', 'enemy', 'melee', 8, true, 1); MadnessLevel.myRooms[15].myCharacters[0].giveItem(ItemGenerator.createWeapon('ppkmag', false), 0); MadnessLevel.myRooms[15].myCharacters[0].myWeapons[0].myClips = 9999999; this.endStartNPC(); this.createNPC(MadnessLevel.myRooms[15], 'agent2', 'enemy', 'melee', 8, false, 6); this.createNPC(MadnessLevel.myRooms[14], 'agent', 'enemy', 'ranged', 19, false, 5); this.createRoster(MadnessLevel.myRooms[15], ['agent', 'agent', 'agent', 'agent', 'agent'], 'enemy', 'ranged', 3); this.addEvent(MadnessLevel.myRooms[15].myRosters[0], MadnessEvents.world_0_7_15_A); this.makeObjective(MadnessLevel.myRooms[15], 'clear', true, false); this.applyTrack('stage8', this); this.applyTrack('boss1', MadnessLevel.myRooms[15]); this.myCutsceneEnd = 'cutscene_world0_end'; }; storedv2.addRooms = function (inRooms, inMode) { var v3 = 0; while (v3 < inRooms) { var v2 = new Object(); MadnessLevel.myRooms.push(v2); v2.myNumber = v3; v2.myDoors = new Array(); v2.myActivators = new Array(); v2.myCharacters = new Array(); v2.myRosters = new Array(); v2.myEvents = new Array(); v2.myItems = new Array(); v2.myObstacles = new Array(); if (inMode == 'story') { v2.myType = 'room' + this.myWorld + '_' + this.myLevel + '_' + v3; } if (inMode == 'arena') { v2.myType = 'arena1'; } v2.myRosters = new Array(); v2.bmpBodies = undefined; ++v3; } }; storedv2.addDoors = function (inRooms, inDoors) { var v2 = 0; while (v2 < inRooms.length) { var v3 = 0; while (v3 < inDoors[v2]) { var v1 = new Object(); inRooms[v2].myDoors.push(v1); v1.myConnection = undefined; v1.mySprite = undefined; v1.amStartPoint = false; v1.myParent = inRooms[v2]; v1.myType = 'door'; v1.myDir = ''; v1.amLocked = false; v1.myCharacters = new Array(); v1.noSpawn = false; ++v3; } ++v2; } }; storedv2.connectDoors = function (inRoom1, inDoor1, UNUSED, inRoom2, inDoor2) { MadnessLevel.myRooms[inRoom1].myDoors[inDoor1].myConnection = MadnessLevel.myRooms[inRoom2].myDoors[inDoor2]; MadnessLevel.myRooms[inRoom2].myDoors[inDoor2].myConnection = MadnessLevel.myRooms[inRoom1].myDoors[inDoor1]; }; storedv2.setDoorDir = function (inRoom, inDoor, inDir) { MadnessLevel.myRooms[inRoom].myDoors[inDoor].myDir = inDir; }; storedv2.setDoorType = function (inRoom, inDoor, inType) { MadnessLevel.myRooms[inRoom].myDoors[inDoor].myType = inType; }; storedv2.disableDoorSpawn = function (inRoom, inDoor) { MadnessLevel.myRooms[inRoom].myDoors[inDoor].noSpawn = true; }; storedv2.disableClose = function (inRoom, inDoor) { MadnessLevel.myRooms[inRoom].myDoors[inDoor].noClose = true; }; storedv2.lockDoor = function (inRoom, inDoor) { MadnessLevel.myRooms[inRoom].myDoors[inDoor].amLocked = true; MadnessLevel.myRooms[inRoom].myDoors[inDoor].mySprite.amLocked = true; MadnessLevel.myRooms[inRoom].myDoors[inDoor].myConnection.amLocked = true; MadnessLevel.myRooms[inRoom].myDoors[inDoor].myConnection.mySprite.amLocked = true; }; storedv2.unlockDoor = function (inRoom, inDoor) { MadnessLevel.myRooms[inRoom].myDoors[inDoor].amLocked = false; MadnessLevel.myRooms[inRoom].myDoors[inDoor].mySprite.amLocked = false; MadnessLevel.myRooms[inRoom].myDoors[inDoor].myConnection.amLocked = false; MadnessLevel.myRooms[inRoom].myDoors[inDoor].myConnection.mySprite.amLocked = false; }; storedv2.addStartPoint = function (inRoom) { inRoom.startPoint = new Object(); inRoom.startPoint.mySprite = undefined; inRoom.startPoint.amStartPoint = true; inRoom.startPoint.myParent = inRoom; inRoom.startPoint.myDir = 'right'; MadnessLevel.startPoint = inRoom.startPoint; }; storedv2.addActivator = function (inRoom, myType) { var v1 = new Object(); MadnessLevel.myRooms[inRoom].myActivators.push(v1); v1.myTarget = undefined; v1.mySprite = undefined; v1.myParent = inRoom; v1.myType = myType; v1.myEvents = new Array(); v1.myItems = new Array(); }; storedv2.connectActivator = function (inRoom, inActivator, UNUSED, inTarget, inAction) { var v1 = new Object(); MadnessLevel.myRooms[inRoom].myActivators[inActivator].myEvents.push(v1); v1.myType = inAction; v1.myTarget = inTarget; if (inAction == 'unlock') { inTarget.amLocked = true; inTarget.myConnection.amLocked = true; } if (inAction == 'treasure') { } }; storedv2.addEvent = function (inTarget, inEvent) { var v1 = new Object(); inTarget.myEvents.push(v1); v1.myType = 'function'; v1.myAction = inEvent; }; storedv2.addObstacle = function (inRoom, myType) { var v1 = new Object(); MadnessLevel.myRooms[inRoom].myObstacles.push(v1); v1.mySprite = undefined; v1.myParent = inRoom; v1.myType = myType; v1.myEvents = new Array(); }; storedv2.makeObjective = function (inTarget, inType, inRequired, inHidden) { MadnessLevel.myObjectives.push(inTarget); inTarget.myObjective = inType; inTarget.objectiveRequired = inRequired; inTarget.objectiveHidden = inHidden; }; storedv2.linkObjective = function (inThing, inObjective, inReaction) {}; storedv1.completeObjectiveCheck = function (inTarget, inType) { var v3 = 0; while (v3 < MadnessLevel.myObjectives.length) { if (inTarget == MadnessLevel.myObjectives[v3] && inTarget != undefined) { if (inType == inTarget.myObjective && inType != undefined) { if (inType == 'rescue') { } if (inType == 'clear') { } if (inType == 'use') { } if (inType == 'kill') { } inTarget.myObjective = undefined; MadnessLevel.myObjectives.splice(v3, 1); break; } else { if (inType == 'kill' && inTarget.myObjective == 'rescue' && !MadnessLevel.levelFailed) { MadnessLevel.levelFailed = true; MadnessPopup.closeAll(); MadnessPopup.addPopup('lines', 'MISSION FAILED', null, 440, 170, undefined, 90, MadWorld.thisWorld.leaveRoomFunction, null); } } } ++v3; } v3 = 0; while (v3 < MadnessLevel.myObjectives.length) { if (MadnessLevel.myObjectives[v3].objectiveRequired) { break; } ++v3; } if (v3 == MadnessLevel.myObjectives.length || MadnessLevel.myObjectives.length == 0) { MadnessLevel.levelVictory = true; } }; storedv2.createNPC = function (inRoom, inChar, inFaction, inLoadout, inLevel, inSurprised, inTotalGuys) { var v3 = 0; while (v3 < inTotalGuys) { var v2 = new MadnessDataFile(); v2.createNew(inChar); ItemGenerator.equipLoadout(v2, inLoadout, inLevel, inSurprised); v2.amSurprised = inSurprised; v2.startupPoint = this.startPointNPC; if (SwainMath.randomNumber(0, this.startupChance) == 0) { v2.myStartup = this.currentStartup; } v2.myFaction = inFaction; v2.myEvents = new Array(); this.addNPC(inRoom, v2, inSurprised); ++v3; } }; storedv2.addNPC = function (inRoom, inChar, inSurprised) { if (inSurprised) { inChar.myWeapons[1] = undefined; inChar.myWeapon = 1; } inRoom.myCharacters.push(inChar); }; storedv1.removeNPC = function (inRoom, inChar) { var v1 = 0; while (v1 < inRoom.myCharacters.length) { if (inChar == inRoom.myCharacters[v1]) { inRoom.myCharacters.splice(v1, 1); break; } ++v1; } }; storedv2.createRoster = function (inRoom, inCreateArray, inFaction, inLoadout, inLevel) { var v3 = new MadnessRoster(); v3.init(inFaction); var v2 = 0; while (v2 < inCreateArray.length) { var v1 = new MadnessDataFile(); v1.createNew(inCreateArray[v2]); v3.addCharacter(v1); v3.makeActive(v1); ItemGenerator.equipLoadout(v1, inLoadout, inLevel, false); v1.amSurprised = false; ++v2; } inRoom.myRosters.push(v3); }; storedv1.removeRoster = function (inRoom, inRoster) { var v1 = 0; while (v1 < inRoom.myRosters.length) { if (inRoster == inRoom.myRosters[v1]) { inRoom.myRosters.splice(v1, 1); break; } ++v1; } }; storedv2.addItem = function (inTarget, inItem) { inTarget.myItems.push(inItem); }; storedv2.setStartup = function (inStart, inChance) { this.currentStartup = inStart; this.startupChance = inChance; }; storedv2.resetStartup = function () { this.currentStartup = undefined; }; storedv2.setStartNPC = function () { this.startPointNPC = true; }; storedv2.endStartNPC = function () { this.startPointNPC = false; }; storedv2.applyTrack = function (inTrack, inDestination) { inDestination.myTrack = inTrack; }; storedv1.doorList = new Array(); storedv1.myRooms = new Array(); storedv1.myObjectives = new Array(); storedv1.badguyShoppingList = new Array(); label 54387: ASSetPropFlags(_global.MadnessLevel.prototype, null, 1); #endinitclip } movieClip 4818 __Packages.MadnessEvents { #initclip if (!_global.MadnessEvents) { var v1 = function () {}; _global.MadnessEvents = v1; var v2 = v1.prototype; v1.world_0_0_prison = function () { MadnessLevel.myRooms[2].myDoors[0].noSpawn = false; MadnessLevel.currentLevel.disableDoorSpawn(2, 1); MadnessLevel.myRooms[3].myDoors[0].noSpawn = false; MadnessLevel.currentLevel.disableDoorSpawn(3, 3); MadnessLevel.myRooms[4].myDoors[0].noSpawn = false; MadnessLevel.currentLevel.disableDoorSpawn(4, 1); MadnessLevel.currentLevel.disableDoorSpawn(5, 1); MadnessLevel.currentLevel.createNPC(MadnessLevel.myRooms[2], 'civ', 'enemy', 'ranged', 3, false, 2); MadnessLevel.currentLevel.createNPC(MadnessLevel.myRooms[1], 'agent', 'enemy', 'ranged', 6, false, 4); MadnessLevel.currentLevel.createRoster(MadnessLevel.myRooms[2], ['agent', 'civ', 'civ', 'civ'], 'enemy', 'ranged', 0); MadnessLevel.currentLevel.createRoster(MadnessLevel.myRooms[3], ['agent', 'civ', 'civ', 'civ'], 'enemy', 'ranged', 0); MadnessLevel.currentLevel.createRoster(MadnessLevel.myRooms[4], ['agent', 'civ', 'civ', 'civ'], 'enemy', 'ranged', 0); MadnessLevel.currentLevel.createRoster(MadnessLevel.myRooms[6], ['agent', 'civ'], 'enemy', 'ranged', 0); MadnessLevel.currentLevel.createRoster(MadnessLevel.myRooms[6], ['civ', 'civ', 'civ'], 'enemy', 'ranged', 0); MadnessLevel.currentLevel.createRoster(MadnessLevel.myRooms[6], ['agent', 'agent'], 'enemy', 'ranged', 0); MadnessLevel.currentLevel.createRoster(MadnessLevel.myRooms[6], ['agent', 'agent', 'agent', 'agent', 'agent'], 'enemy', 'ranged', 0); MadnessPopup.addPopup('help', 'Someone will have heard that. Time to bail!', null, 400, 120, MadnessLevel.myRooms[6].myDoors[0].mySprite, 150, null, null, null, null); MadnessLevel.currentLevel.addEvent(MadnessLevel.myRooms[5], MadnessEvents.world_0_0_tutorial7); MadnessLevel.currentLevel.addEvent(MadnessLevel.myRooms[4], MadnessEvents.world_0_0_tutorial8); MadnessLevel.currentLevel.addEvent(MadnessLevel.myRooms[3], MadnessEvents.world_0_0_tutorial9); }; v1.world_0_0_tutorial1 = function () { MadnessPopup.addBuffer(15); MadnessPopup.addPopup('help', 'You\'ll be operating this mission as ' + MadnessRoster.playerRoster.teamLeader.myName + '. This man is a badass killing machine, so you should have no problem rescuing Sanford and Deimos.', null, 400, 120, MadnessRoster.playerRoster.teamLeader.mySprite.mySprite.myBody, 210, MadnessEvents.world_0_0_tutorial1b, null); MadnessPopup.addBuffer(5); MadnessPopup.addPopup('help', 'WASD Moves. Use doors by pressing SPACE [Guard] next to them.', null, 500, 120, MadnessLevel.myRooms[0].myDoors[0].mySprite, 200, null, null); }; v1.world_0_0_tutorial1b = function () {}; v1.world_0_0_tutorial2 = function () { MadnessPopup.addPopup('help', 'These idiots just got in your way. Click MOUSE 1 and aim with your mouse to show them why that was a bad idea.', null, 400, 120, MadnessLevel.myRooms[1].myCharacters[0].mySprite, 200, null, null); MadnessPopup.addBuffer(3); MadnessPopup.addPopup('help', 'To swap weapons with your sidearm, press Q.', null, 400, 120, MadnessRoster.playerRoster.teamLeader.mySprite.mySprite.myBody, 220, null, null); }; v1.world_0_0_tutorial3 = function () { MadnessPopup.addBuffer(15); MadnessPopup.addPopup('help', 'Activate this panel with your SPACE bar to get that door open.', null, 400, 120, MadnessLevel.myRooms[2].myActivators[0].mySprite.mySprite.myBox, 2200, null, null); }; v1.world_0_0_tutorial3b = function () { MadnessPopup.closeAll(); }; v1.world_0_0_tutorial4 = function () { MadnessPopup.addBuffer(15); MadnessPopup.addPopup('help', 'Take cover behind objects such as this one by pressing SPACE while holidng a ranged weapon.', null, 400, 120, MadnessLevel.myRooms[3].myObstacles[0].mySprite, 150, null, null); MadnessPopup.addBuffer(5); MadnessPopup.addPopup('help', 'You\'ll be protected from enemy fire so long as you\'re not shooting your own weapon.', null, 400, 120, undefined, 120, null, null); MadnessPopup.addBuffer(5); MadnessPopup.addPopup('help', 'Pressing SPACE again will leave cover.', null, 400, 120, undefined, 150, null, null); }; v1.world_0_0_tutorial5 = function () { MadnessPopup.addBuffer(15); MadnessPopup.addPopup('help', 'You may have noticed that you\'re a difficult target to hit. This is due to your TAC-BAR.', null, 400, 120, MadnessRoster.playerRoster.teamLeader.mySprite.mySprite.myBody, 160, null, null); MadnessPopup.addBuffer(5); MadnessPopup.addPopup('help', 'Your TAC-BAR indicates your battle prowess and natural ability to avoid enemy fire. Keep it from hitting empty, and you\'ll never take a bullet.', null, 400, 120, MadnessRoster.playerRoster.teamLeader.mySprite.mySprite.myBody, 220, null, null); MadnessPopup.addBuffer(5); MadnessPopup.addPopup('help', 'Some enemies have TAC-BARs, too. Being fired on from behind or at close range will decimate their (and your!) bar.', null, 400, 120, MadnessRoster.playerRoster.teamLeader.mySprite.mySprite.myBody, 200, null, null); MadnessPopup.addBuffer(50); MadnessPopup.addPopup('help', 'Ok, I\'m done talking about the TAC-BAR. Go that way.', null, 400, 120, MadnessLevel.myRooms[4].myDoors[1].mySprite, 120, null, null); MadnessPopup.addBuffer(100); MadnessPopup.addPopup('help', 'No...really. I\'m done now. This is it.', null, 400, 120, undefined, 120, null, null); MadnessPopup.addBuffer(100); MadnessPopup.addPopup('help', 'The real Hank would have finished this tutorial by now. You should know that.', null, 400, 120, undefined, 120, null, null); }; v1.world_0_0_tutorial6 = function () { MadnessPopup.addBuffer(15); MadnessPopup.addPopup('help', 'Did you notice that SPACE dodges or blocks when holding a ranged or melee weapon?', null, 400, 120, MadnessRoster.playerRoster.teamLeader.mySprite.mySprite.myBody, 150, null, null); MadnessPopup.addBuffer(5); MadnessPopup.addPopup('help', 'Blocking will reduce TAC-BAR damage, while dodging will outright prevent it.', null, 400, 120, MadnessRoster.playerRoster.teamLeader.mySprite.mySprite.myBody, 150, null, null); }; v1.world_0_0_tutorial7 = function () { MadnessPopup.addBuffer(10); MadnessPopup.addPopup('help', 'Pro-Tip: Double tap a direction to dash.', null, 400, 120, MadnessRoster.playerRoster.teamLeader.mySprite.mySprite.myBody, 150, null, null); }; v1.world_0_0_tutorial8 = function () { MadnessPopup.addBuffer(10); MadnessPopup.addPopup('help', 'See that red bar up top? Yeah, that one.', null, 400, 120, _root.gameMenu.tutTarget, 110, null, null); MadnessPopup.addBuffer(5); MadnessPopup.addPopup('help', 'That\'s your Bullet-Time. Kills power it. When it\'s full, press SHIFT to activate it.', null, 400, 120, _root.gameMenu.tutTarget, 190, null, null); }; v1.world_0_0_tutorial9 = function () { MadnessPopup.addBuffer(10); MadnessPopup.addPopup('help', 'Press R to reload. Be careful! This dumps your current clip and all leftover ammo in it.', null, 400, 120, _root.gameMenu.tutTarget, 170, null, null); MadnessPopup.addBuffer(5); MadnessPopup.addPopup('help', 'To drop your weapon or pick up a new one from the floor, press E.', null, 400, 120, _root.gameMenu.tutTarget, 190, null, null); }; v1.world_0_1_0 = function () { if (MadnessRoster.playerRoster.teamLeader.myCharacter == 'sanford') { MadnessPopup.addBuffer(15); MadnessPopup.addPopup('help', 'Sanford always equips a special hook weapon. Throw it like any weapon, but it\'ll come back...sometimes with a snared enemy in tow.', null, 400, 120, MadnessRoster.playerRoster.teamLeader.mySprite.mySprite.myBody, 210, null, null); } }; v1.world_0_1_6 = function () { MadnessLevel.currentLevel.createRoster(MadnessLevel.myRooms[6], ['civ', 'civ', 'civ'], 'enemy', 'ranged', 0); MadnessLevel.currentLevel.createRoster(MadnessLevel.myRooms[6], ['civ'], 'enemy', 'ranged', 1); }; v1.world_0_2_5 = function () { MadnessLevel.currentLevel.createRoster(MadnessLevel.myRooms[5], ['civ', 'civ', 'civ'], 'enemy', 'ranged', 0); MadnessLevel.currentLevel.createRoster(MadnessLevel.myRooms[5], ['agent', 'civ'], 'enemy', 'ranged', 1); MadnessLevel.currentLevel.createRoster(MadnessLevel.myRooms[4], ['civ', 'civ', 'civ'], 'enemy', 'ranged', 0); MadnessLevel.currentLevel.createRoster(MadnessLevel.myRooms[4], ['agent', 'civ'], 'enemy', 'ranged', 1); MadnessLevel.currentLevel.createRoster(MadnessLevel.myRooms[3], ['civ', 'civ', 'civ'], 'enemy', 'ranged', 0); MadnessLevel.currentLevel.createRoster(MadnessLevel.myRooms[3], ['agent', 'civ'], 'enemy', 'ranged', 1); }; v1.world_0_2_9 = function () { MadnessLevel.currentLevel.createRoster(MadnessLevel.myRooms[9], ['civ', 'civ', 'civ'], 'enemy', 'ranged', 0); MadnessLevel.currentLevel.createRoster(MadnessLevel.myRooms[9], ['agent', 'civ'], 'enemy', 'ranged', 1); MadnessLevel.currentLevel.createRoster(MadnessLevel.myRooms[8], ['civ', 'civ', 'civ'], 'enemy', 'ranged', 0); MadnessLevel.currentLevel.createRoster(MadnessLevel.myRooms[8], ['agent', 'civ'], 'enemy', 'ranged', 1); MadnessLevel.currentLevel.createRoster(MadnessLevel.myRooms[6], ['agent', 'civ'], 'enemy', 'ranged', 1); MadnessLevel.currentLevel.createRoster(MadnessLevel.myRooms[6], ['civ', 'civ', 'civ'], 'enemy', 'ranged', 0); }; v1.world_0_1_3_A = function () { MadnessLevel.myRooms[3].myObstacles[0].noClip = true; }; v1.world_0_3_4 = function () { MadnessLevel.currentLevel.createRoster(MadnessLevel.myRooms[3], ['civ', 'civ', 'civ'], 'enemy', 'ranged', 0); MadnessLevel.currentLevel.createRoster(MadnessLevel.myRooms[3], ['agent', 'civ', 'agent'], 'enemy', 'ranged', 2); }; v1.world_0_3_6 = function () { MadnessLevel.currentLevel.createRoster(MadnessLevel.myRooms[5], ['agent', 'civ', 'agent'], 'enemy', 'ranged', 2); MadnessLevel.currentLevel.createRoster(MadnessLevel.myRooms[5], ['civ', 'civ', 'civ', 'civ'], 'enemy', 'melee', 2); }; v1.world_0_3_10 = function () { MadnessLevel.currentLevel.createRoster(MadnessLevel.myRooms[9], ['civ', 'civ', 'civ', 'civ'], 'enemy', 'melee', 5); MadnessLevel.currentLevel.createRoster(MadnessLevel.myRooms[9], ['agent', 'civ', 'agent'], 'enemy', 'ranged', 2); MadnessLevel.currentLevel.createRoster(MadnessLevel.myRooms[8], ['agent', 'civ', 'agent'], 'enemy', 'ranged', 3); MadnessLevel.currentLevel.createRoster(MadnessLevel.myRooms[8], ['civ', 'civ', 'agent', 'civ'], 'enemy', 'ranged', 2); }; v1.world_0_3_13 = function () { MadnessLevel.currentLevel.createRoster(MadnessLevel.myRooms[11], ['agent', 'civ', 'agent'], 'enemy', 'ranged', 2); MadnessLevel.currentLevel.createRoster(MadnessLevel.myRooms[11], ['civ', 'civ', 'civ', 'civ', 'civ', 'civ'], 'enemy', 'ranged', 1); }; v1.world_0_4_2_A = function () { MadnessPopup.addBuffer(10); MadnessPopup.addPopup('help', 'There must be some way to lower those spikes around here. Better start looking.', null, 400, 120, MadnessLevel.myRooms[2].myObstacles[0].mySprite, 170, null, null); }; v1.world_0_4_11_A = function () { MadnessLevel.myRooms[2].myObstacles[0].noClip = true; MadnessLevel.currentLevel.addEvent(MadnessLevel.myRooms[2], MadnessEvents.world_0_4_11_B); MadnessPopup.addBuffer(10); MadnessPopup.addPopup('help', 'Wonder what that did? Better head back.', null, 400, 120, null, 170, null, null); MadnessLevel.currentLevel.createRoster(MadnessLevel.myRooms[2], ['agent', 'agent', 'civ'], 'enemy', 'ranged', 3); MadnessLevel.currentLevel.createRoster(MadnessLevel.myRooms[2], ['agent', 'agent', 'agent', 'civ'], 'enemy', 'melee', 8); MadnessLevel.currentLevel.createRoster(MadnessLevel.myRooms[2], ['agent', 'agent', 'agent', 'civ'], 'enemy', 'ranged', 3); MadnessLevel.currentLevel.createNPC(MadnessLevel.myRooms[8], 'agent', 'enemy', 'ranged', 4, false, 4); MadnessLevel.currentLevel.createNPC(MadnessLevel.myRooms[9], 'agent', 'enemy', 'ranged', 3, false, 3); }; v1.world_0_4_11_B = function () { MadnessPopup.addBuffer(10); MadnessPopup.addPopup('help', 'It seems activating the terminal has lowered those spikes.', null, 400, 120, MadnessLevel.myRooms[2].myObstacles[0].mySprite, 170, null, null); }; v1.world_0_5_8_A = function () { MadnessPopup.addBuffer(90); MadnessPopup.addPopup('buffer', '', null, 400, 120, null, 30, MadnessEvents.world_0_5_8_B, null); }; v1.world_0_5_8_B = function () { if (MadnessCharacter.doesUnitExist('fatboy')) { MadnessLevel.currentLevel.createRoster(MadnessLevel.myRooms[8], ['civ', 'civ'], 'enemy', 'ranged', 3); MadnessLevel.currentLevel.addEvent(MadnessLevel.myRooms[8].myRosters[0], MadnessEvents.world_0_5_8_A); } else {} }; v1.world_0_5_14_A = function () { if (!MadnessLevel.levelVictory) { MadnessPopup.addBuffer(90); MadnessPopup.addPopup('buffer', '', null, 400, 120, null, 30, MadnessEvents.world_0_5_14_B, null); } }; v1.world_0_5_14_B = function () { if (MadnessCharacter.doesUnitExist('fatboy')) { MadnessLevel.currentLevel.createRoster(MadnessLevel.myRooms[14], ['agent', 'agent'], 'enemy', 'ranged', 3); MadnessLevel.currentLevel.addEvent(MadnessLevel.myRooms[14].myRosters[0], MadnessEvents.world_0_5_14_A); } else {} }; v1.world_0_6_4_A = function () { MadnessPopup.addBuffer(120); MadnessPopup.addPopup('buffer', '', null, 400, 120, null, 30, MadnessEvents.world_0_6_4_B, null); }; v1.world_0_6_4_B = function () { if (MadnessCharacter.doesUnitExist('fatboy')) { MadnessLevel.currentLevel.createRoster(MadnessLevel.myRooms[4], ['agent', 'agent'], 'enemy', 'ranged', 5); MadnessLevel.currentLevel.addEvent(MadnessLevel.myRooms[4].myRosters[MadnessLevel.myRooms[4].myRosters.length - 1], MadnessEvents.world_0_6_4_A); } else {} }; v1.world_0_6_9_A = function () { if (!MadnessLevel.levelVictory) { MadnessPopup.addBuffer(120); MadnessPopup.addPopup('buffer', '', null, 400, 120, null, 30, MadnessEvents.world_0_6_9_B, null); } }; v1.world_0_6_9_B = function () { if (MadnessCharacter.doesUnitExist('fatboy')) { MadnessLevel.currentLevel.myDifficulty = 3; if (SwainMath.randomNumber(0, 1) == 0) { MadnessLevel.currentLevel.createRoster(MadnessLevel.myRooms[9], ['agent', 'agent', 'agent', 'agent2'], 'enemy', 'ranged', 7); } else { MadnessLevel.currentLevel.createRoster(MadnessLevel.myRooms[9], ['agent', 'agent', 'agent3'], 'enemy', 'ranged', 7); } MadnessLevel.currentLevel.addEvent(MadnessLevel.myRooms[9].myRosters[0], MadnessEvents.world_0_6_9_A); } else {} }; v1.world_0_7_4_A = function () { MadnessLevel.myRooms[3].myObstacles[0].noClip = true; MadnessLevel.myRooms[3].myObstacles[0].alreadyClosed = true; MadnessLevel.currentLevel.createRoster(MadnessLevel.myRooms[4], ['agent2', 'agent2'], 'enemy', 'ranged', 6); MadnessLevel.currentLevel.createRoster(MadnessLevel.myRooms[3], ['agent', 'agent2'], 'enemy', 'ranged', 7); MadnessLevel.currentLevel.createRoster(MadnessLevel.myRooms[3], ['agent', 'agent', 'agent'], 'enemy', 'ranged', 7); MadnessLevel.currentLevel.createRoster(MadnessLevel.myRooms[3], ['agent2', 'agent2'], 'enemy', 'ranged', 6); MadnessLevel.currentLevel.createRoster(MadnessLevel.myRooms[3], ['agent'], 'enemy', 'ranged', 4); }; v1.world_0_7_7_A = function () { MadnessLevel.myRooms[6].myObstacles[0].noClip = true; MadnessLevel.myRooms[6].myObstacles[0].alreadyClosed = true; MadnessLevel.currentLevel.createRoster(MadnessLevel.myRooms[7], ['agent', 'agent2', 'agent2'], 'enemy', 'ranged', 6); MadnessLevel.currentLevel.createRoster(MadnessLevel.myRooms[7], ['agent', 'agent'], 'enemy', 'ranged', 8); MadnessLevel.currentLevel.createRoster(MadnessLevel.myRooms[6], ['agent', 'agent', 'agent', 'agent2'], 'enemy', 'ranged', 7); MadnessLevel.currentLevel.createRoster(MadnessLevel.myRooms[6], ['agent', 'agent', 'agent', 'agent'], 'enemy', 'melee', 15); MadnessLevel.currentLevel.createRoster(MadnessLevel.myRooms[6], ['agent', 'agent2', 'agent2'], 'enemy', 'ranged', 6); MadnessLevel.currentLevel.createRoster(MadnessLevel.myRooms[6], ['agent', 'agent'], 'enemy', 'ranged', 8); }; v1.world_0_7_9_A = function () { if (!MadnessLevel.levelVictory) { MadnessPopup.addBuffer(120); MadnessPopup.addPopup('buffer', '', null, 400, 120, null, 30, MadnessEvents.world_0_7_9_B, null); } }; v1.world_0_7_9_B = function () { if (MadnessCharacter.doesUnitExist('fatboy')) { MadnessLevel.currentLevel.createRoster(MadnessLevel.myRooms[9], ['agent', 'agent', 'agent2'], 'enemy', 'ranged', 6); MadnessLevel.currentLevel.addEvent(MadnessLevel.myRooms[9].myRosters[MadnessLevel.myRooms[9].myRosters.length - 1], MadnessEvents.world_0_7_9_A); } else {} }; v1.world_0_7_10_A = function () { MadnessLevel.myRooms[9].myObstacles[0].noClip = true; MadnessLevel.myRooms[9].myObstacles[0].alreadyClosed = true; MadnessLevel.currentLevel.createRoster(MadnessLevel.myRooms[10], ['agent', 'agent', 'agent2', 'agent2'], 'enemy', 'ranged', 8); MadnessLevel.currentLevel.createRoster(MadnessLevel.myRooms[10], ['agent', 'agent2', 'agent', 'agent'], 'enemy', 'ranged', 3); MadnessLevel.currentLevel.createRoster(MadnessLevel.myRooms[10], ['agent', 'agent', 'agent2', 'agent2'], 'enemy', 'ranged', 8); MadnessLevel.currentLevel.createRoster(MadnessLevel.myRooms[10], ['agent', 'agent2', 'agent'], 'enemy', 'melee', 5); MadnessLevel.currentLevel.createRoster(MadnessLevel.myRooms[9], ['agent', 'agent', 'agent'], 'enemy', 'ranged', 7); MadnessLevel.currentLevel.createRoster(MadnessLevel.myRooms[9], ['agent', 'agent', 'agent2', 'agent2'], 'enemy', 'ranged', 8); MadnessLevel.currentLevel.createRoster(MadnessLevel.myRooms[9], ['agent', 'agent2', 'agent', 'agent'], 'enemy', 'melee', 15); MadnessLevel.currentLevel.createRoster(MadnessLevel.myRooms[9], ['agent', 'agent2', 'agent3'], 'enemy', 'ranged', 6); MadnessLevel.currentLevel.createRoster(MadnessLevel.myRooms[9], ['fatboy'], 'enemy', 'fatboy', 1); MadnessLevel.currentLevel.createRoster(MadnessLevel.myRooms[9], ['agent', 'agent'], 'enemy', 'ranged', 8); MadnessLevel.currentLevel.addEvent(MadnessLevel.myRooms[9].myRosters[5], MadnessEvents.world_0_7_9_A); }; v1.world_0_7_12_A = function () { MadnessPopup.addBuffer(120); MadnessPopup.addPopup('buffer', '', null, 400, 120, null, 30, MadnessEvents.world_0_7_12_B, null); }; v1.world_0_7_12_B = function () { if (MadnessCharacter.doesUnitExist('fatboy')) { MadnessLevel.currentLevel.createRoster(MadnessLevel.myRooms[12], ['agent', 'agent2', 'agent2'], 'enemy', 'ranged', 6); MadnessLevel.currentLevel.addEvent(MadnessLevel.myRooms[12].myRosters[MadnessLevel.myRooms[12].myRosters.length - 1], MadnessEvents.world_0_7_12_A); } else {} }; v1.world_0_7_13_A = function () { MadnessLevel.myRooms[12].myObstacles[0].noClip = true; MadnessLevel.myRooms[12].myObstacles[0].alreadyClosed = true; MadnessLevel.currentLevel.createRoster(MadnessLevel.myRooms[13], ['agent', 'agent', 'agent3'], 'enemy', 'ranged', 6); MadnessLevel.currentLevel.createRoster(MadnessLevel.myRooms[13], ['agent'], 'enemy', 'ranged', 7); MadnessLevel.currentLevel.createRoster(MadnessLevel.myRooms[13], ['agent2', 'agent', 'agent3'], 'enemy', 'ranged', 6); MadnessLevel.currentLevel.createRoster(MadnessLevel.myRooms[13], ['agent3', 'agent2', 'agent2'], 'enemy', 'ranged', 7); MadnessLevel.currentLevel.createRoster(MadnessLevel.myRooms[12], ['agent', 'agent2', 'agent2'], 'enemy', 'ranged', 7); MadnessLevel.currentLevel.createRoster(MadnessLevel.myRooms[12], ['agent', 'agent', 'agent3'], 'enemy', 'ranged', 6); MadnessLevel.currentLevel.createRoster(MadnessLevel.myRooms[12], ['agent2', 'agent2'], 'enemy', 'ranged', 10); MadnessLevel.currentLevel.createRoster(MadnessLevel.myRooms[12], ['agent3', 'agent3', 'agent3'], 'enemy', 'ranged', 5); MadnessLevel.currentLevel.createRoster(MadnessLevel.myRooms[12], ['fatboy'], 'enemy', 'fatboy', 10); MadnessLevel.currentLevel.createRoster(MadnessLevel.myRooms[12], ['agent', 'agent'], 'enemy', 'ranged', 8); MadnessLevel.currentLevel.addEvent(MadnessLevel.myRooms[12].myRosters[5], MadnessEvents.world_0_7_12_A); }; v1.world_0_7_15_A = function () { if (!MadnessLevel.levelVictory) { MadnessPopup.addBuffer(120); MadnessPopup.addPopup('buffer', '', null, 400, 120, null, 30, MadnessEvents.world_0_7_15_B, null); } }; v1.world_0_7_15_B = function () { if (MadnessCharacter.doesUnitExist('mag')) { MadnessLevel.currentLevel.myDifficulty = 3; if (SwainMath.randomNumber(0, 2) == 0) { MadnessLevel.currentLevel.createRoster(MadnessLevel.myRooms[15], ['agent', 'agent', 'agent2', 'agent'], 'enemy', 'ranged', 8); } else { if (SwainMath.randomNumber(0, 1) == 0) { MadnessLevel.currentLevel.createRoster(MadnessLevel.myRooms[15], ['agent2', 'agent2', 'agent'], 'enemy', 'ranged', 8); } else { MadnessLevel.currentLevel.createRoster(MadnessLevel.myRooms[15], ['agent2', 'agent', 'agent'], 'enemy', 'ranged', 8); } } MadnessLevel.currentLevel.addEvent(MadnessLevel.myRooms[15].myRosters[0], MadnessEvents.world_0_7_15_A); } else {} }; v1.arena_1_tutorial = function () { _root.newArena = false; MadnessPopup.addBuffer(10, null); MadnessPopup.addPopup('help', 'Welcome to Project Nexus, Test Subject 1v02P_6, aka "' + MadnessRoster.playerRoster.teamLeader.myName + '".', null, 440, 100, _root.newWorld.myBG.window1.madnessGuy, 140, null, null); MadnessPopup.addBuffer(10, null); MadnessPopup.addPopup('help', 'Today you\'ll be helping us to move combat science forward by engaging in a controlled battle experiment.', null, 440, 100, _root.newWorld.myBG.window1.madnessGuy, 170, null, null); MadnessPopup.addBuffer(10, null); MadnessPopup.addPopup('help', 'If you should perish during the experiment, you will retain your progress, thanks to advances in regenerative cloning. You will, however, return to the beginning of the experiment.', null, 440, 100, _root.newWorld.myBG.window1.madnessGuy, 250, null, null); MadnessPopup.addBuffer(10, null); MadnessPopup.addPopup('help', 'Press the button on the wall to let us know when you\'re ready to begin. You may also return to the Armory when the experiment is not in progress. Good luck, test subject.', null, 440, 100, MadnessLevel.myRooms[0].myActivators[0].mySprite.mySprite.myBox, 230, null, null); }; v1.arena_1_START = function () { if (MadnessRoster.playerRoster.teamLeader.myWeapons[0].melee) { MadnessRoster.playerRoster.teamLeader.myStartup = 'startup1'; } else { if (MadnessRoster.playerRoster.teamLeader.myWeapons[0] != undefined) { MadnessRoster.playerRoster.teamLeader.myStartup = 'startup3'; } else { MadnessRoster.playerRoster.teamLeader.myStartup = 'startup2b'; } } MadnessLevel.currentLevel.lockDoor(0, 0); MadnessPopup.closeAll(); MadnessPopup.addBuffer(10, null); MadnessPopup.addPopup('lines', 'WAVE ' + String(MadnessLevel.currentLevel.totalWaves), null, 440, 170, undefined, 90, MadnessEvents.arena_1_waves, null); }; v1.arena_1_waves = function () { var v2 = 8; var v1 = 0; while (v1 < v2) { MadnessLevel.currentLevel.createRoster(MadnessLevel.myRooms[0], CharacterGenerator.returnWaveList(MadnessLevel.currentLevel.totalWaves, v1), 'enemy', ItemGenerator.returnWaveLoadout(MadnessLevel.currentLevel.totalWaves, v1), MadnessLevel.currentLevel.totalWaves - Math.floor(v1 / 5)); MadnessLevel.myRooms[0].myRosters[MadnessLevel.myRooms[0].myRosters.length - 1].arenanum = v1; ++v1; } MadnessLevel.currentLevel.addEvent(MadnessLevel.myRooms[0].myRosters[MadnessLevel.myRooms[0].myRosters.length - 1], MadnessEvents.arena_1_clear); }; v1.arena_1_clear = function () { MadnessLevel.levelVictory = true; MadnessPopup.addPopup('lines', 'WAVE COMPLETE', null, 440, 170, undefined, 90, null, null); MadnessPopup.addBuffer(70, MadnessEvents.arena_1_pause); MadnessPopup.addPopup('arena', '', null, 440, 100, undefined, 50, MadnessEvents.arena_1_reset, null); }; v1.arena_1_dead = function () { MadnessLevel.levelFailed = true; MadnessLevel.currentLevel.totalWaves = 1; MadnessGameSelect.saveGame(); MadnessPopup.addBuffer(20, MadnessEvents.arena_1_pause); MadnessPopup.addPopup('arena', '', null, 440, 100, undefined, 50, MadnessEvents.arena_1_resetB, null); }; v1.arena_1_pause = function () { MadWorld.thisWorld.pauseGame(); }; v1.arena_1_reset = function () { MadnessLevel.currentLevel.unlockDoor(0, 0); MadnessLevel.currentLevel.addEvent(MadnessLevel.myRooms[0].myActivators[0], MadnessEvents.arena_1_START); if (MadnessRoster.playerRoster.teamLeader.myWaves < MadnessLevel.currentLevel.totalWaves) { MadnessRoster.playerRoster.teamLeader.myWaves = MadnessLevel.currentLevel.totalWaves; } MadnessRoster.playerRoster.teamLeader.applyXP(_root.earnedXP); _root.earnedXP = 0; MadnessRoster.playerRoster.myCash += _root.earnedCash; _root.earnedCash = 0; MadnessRoster.playerRoster.myCash = Math.floor(MadnessRoster.playerRoster.myCash); ++MadnessLevel.currentLevel.totalWaves; CharacterGenerator.storePopulator(); ItemGenerator.storePopulator(); if (!MadnessTransition.transitionLock) { _root.createTransition('fade', 'arena_menu', null); } MadnessLevel.levelVictory = false; MadnessLevel.levelFailed = false; }; v1.arena_1_resetB = function () { MadnessRoster.playerRoster.teamLeader.applyXP(_root.earnedXP); _root.earnedXP = 0; MadnessRoster.playerRoster.myCash += _root.earnedCash; _root.earnedCash = 0; MadnessRoster.playerRoster.myCash = Math.floor(MadnessRoster.playerRoster.myCash); CharacterGenerator.storePopulator(); ItemGenerator.storePopulator(); if (!MadnessTransition.transitionLock) { _root.createTransition('fade', 'arena_menu', null); } MadnessLevel.levelVictory = false; MadnessLevel.levelFailed = false; }; v1.arena_1_store = function () { if (!MadnessTransition.transitionLock) { _root.createTransition('fade', 'arena_menu', null); } }; v1.bossEvents = function (inChar, inEvent) { if (inChar.myDataRef.myBoss == 'mag1') { if (inEvent == 'start') { inChar.myFacing = 'left'; inChar._parent.attachMovie('start_point', 'bossStart', inChar._parent.getNextHighestDepth()); inChar._parent.bossStart._x = inChar._x; inChar._parent.bossStart._y = inChar._y; inChar._parent.bossStart.startFacing = inChar.myFacing; inChar._parent.bossStart._visible = false; } if (inEvent == 'tick') { if (inChar.myDataRef.myBossPhase == 0) { if (inChar.myStatus == 'idle' || inChar.myStatus == 'run' || inChar.myStatus == 'backtrack') { if (inChar._x < MadnessRoster.playerRoster.teamLeader.mySprite._x) { inChar.myFacing = 'right'; } else { inChar.myFacing = 'left'; } } } } if (inEvent == 'kill_boss') { if (inChar.myDataRef.myBossPhase == 0) { inChar.myDataRef.myBossPhase = 1; inChar.myStatus = 'dead'; inChar.mySubStatus = '_stagger_mag1'; inChar.myFacing = inChar._parent.bossStart.startFacing; inChar.mySprite.gotoAndStop(inChar.myStatus + inChar.mySubStatus); inChar.dropGun(); inChar.myDataRef.myWeapons[0].myOwner = undefined; inChar.myDataRef.myWeapons[0] = undefined; inChar.myDataRef.myHealth = 1.0e+022; inChar.myHealth = 1.0e+022; } if (inChar.myDataRef.myBossPhase == 4) { inChar.myDataRef.myBossPhase = 1; inChar.myStatus = 'dead'; inChar.mySubStatus = '_mag1'; inChar.myFacing = inChar._parent.bossStart.startFacing; inChar.mySprite.gotoAndStop(inChar.myStatus + inChar.mySubStatus); inChar.dropGun(); inChar.myDataRef.myWeapons[0].myOwner = undefined; inChar.myDataRef.myWeapons[0] = undefined; } } if (inEvent == 'death1') { inChar.myDataRef.myBossPhase = 2; inChar.myStatus = 'run'; inChar.myMission = 'retreat'; inChar.mySpeed *= 2; inChar.myAccel *= 2; inChar.mySubStatus = '_wounded'; inChar.myFacing = inChar._parent.bossStart.startFacing; inChar.mySprite.gotoAndStop(inChar.myStatus + inChar.mySubStatus); inChar.myDataRef.myHealth = 1.0e+022; inChar.myHealth = 1.0e+022; inChar.attractToMC(inChar._parent.bossStart, ''); } if (inEvent == 'go_to') { if (inChar.myDataRef.myBossPhase == 2) { inChar.myDataRef.myBossPhase = 3; inChar.myDataRef.equipItem(ItemGenerator.createWeapon('ppk', false), 0); inChar.myDataRef.myWeapons[0].noPickup = true; inChar.myDataRef.myWeapons[0].myDamage *= 3; inChar.myDataRef.myWeapons[0].myClips = 2000; inChar.myStatus = 'dead'; inChar.myFacing = inChar._parent.bossStart.startFacing; inChar.mySubStatus = '_stagger_mag2'; inChar.mySprite.gotoAndStop(inChar.myStatus + inChar.mySubStatus); inChar.myDataRef.myHealth = 1.0e+022; inChar.myHealth = 1.0e+022; } } if (inEvent == 'death2') { inChar.myDataRef.myBossPhase = 4; inChar.myStatus = 'incap'; inChar.mySubStatus = '_mag'; inChar.myMission = 'engage'; inChar.rofTimer = 9999; inChar.reloadTimer = -1; inChar.myFacing = inChar._parent.bossStart.startFacing; inChar.myWidth = inChar.myHeight * inChar.myDataRef.myScale; inChar.myDataRef.myWidth = inChar.myWidth; inChar.mySprite.gotoAndStop(inChar.myStatus + inChar.mySubStatus); inChar.myDataRef.myHealth = inChar.myDataRef.myHealthMax / 2; inChar.myHealth = inChar.myDataRef.myHealthMax / 2; inChar.myDataRef.myHealthMax = inChar.myDataRef.myHealth; inChar.myHealthMax = inChar.myHealth; } if (inEvent == 'death3') { inChar.myDataRef.myBossPhase = 5; } } }; ASSetPropFlags(_global.MadnessEvents.prototype, null, 1); } #endinitclip } movieClip 4819 __Packages.MadnessPopup { #initclip if (!_global.MadnessPopup) { var v1 = function () { super(); this.onEnterFrame = this.tick; }; _global.MadnessPopup = v1; _global.MadnessPopup extends MovieClip; var v2 = v1.prototype; v2.init = function (inDataRef) { this._alpha = 20; this.appearing = true; this.myDataRef = inDataRef; this.myType = inDataRef.myType; this.myText = inDataRef.myText; this.myChar = inDataRef.myChar; this._y = inDataRef.myY; this._x = inDataRef.myX; this.myLinkedItem = inDataRef.myLinkedItem; this.myTimer = inDataRef.myTimer; this.myYesFunction = inDataRef.myYesFunction; this.myNoFunction = inDataRef.myNoFunction; this.gotoAndStop(this.myType); this.myTextField.text = this.myText; this.myTextField2.text = this.myText; if (this.myType == 'mission') { this.myTitle1.text = this.myLinkedItem.myName; this.myTitle2.text = this.myLinkedItem.myName; } if (this.myType == 'help') { this.myMask._xscale = 100 + 100 * (this.myTextField.textWidth / 20) + 52; this.myMask._yscale = 100 + 100 * (this.myTextField.textHeight / 20) + 76; this.myFrame._visible = false; this.createEmptyMovieClip('borderMC', this.getNextHighestDepth()); this.borderMC.lineStyle(1, 16711680, 100, true, 'normal', 'square', 'miter', 1); this.borderMC.moveTo(-this.myMask._width / 2, 0); this.borderMC.lineTo(this.myMask._width / 2, 0); this.borderMC.lineTo(this.myMask._width / 2, this.myMask._height); this.borderMC.lineTo(-this.myMask._width / 2, this.myMask._height); this.borderMC.lineTo(-this.myMask._width / 2, 0); var v4 = -this.myMask._width / 2; var v3 = 0; this.lineConnectX = 0; this.lineConnectY = this.myMask._height; this.myBG._x = v4; this.myBG._y = v3; this.myFrame._x = v4; this.myFrame._y = v3; this.myTextField._x = 14 + v4; this.myTextField._y = 16 + v3; this.myMask._x = v4; this.myMask._y = v3; if (this.myDataRef.buffer == false) { this.moveTarget(); this.drawLine(); } else { this.myBG._visible = false; this.myFrame._visible = false; this.myTextField._visible = false; this.myMask._visible = false; } } else { this.targetCoord.x = 0; this.targetCoord.y = 0; this.globalToLocal(this.targetCoord); this.myShadow._x = this.targetCoord.x; this.myShadow._y = this.targetCoord.y; } if (this.myType == 'arena') { this.setArenaStats(MadnessRoster.playerRoster.teamLeader); } if (this.myType == 'mission') { this.missionIconAdjust(); this.missionDifficulty(); } MadnessPopup.currentPopup = this; if (this.myType == 'lines') { SwainAudioPlayer.playSound('menu3', 0); } if (this.myType == 'help') { SwainAudioPlayer.playSound('menu1', 0); } }; v2.tick = function () { if (this.myTimer > 1) { --this.myTimer; if (this.myType == 'arena' && this.myTimer < 2) { this.myTimer = 2; } } if (this.myTimer == 1) { this.appearing = false; if (this.myType !== 'help' && this.myType != 'lines' || this._alpha <= 0) { if (this.myYesFunction != null) { this.pressYes(false); } this.closePopup(); } } if (this._alpha < 100 && this.appearing) { this._alpha += 20; } if (this._alpha > 0 && !this.appearing) { this._alpha -= 20; } if (this.myDataRef.buffer == false) { this.moveTarget(); this.drawLine(); } if (this.myType == 'arena' && this.myTimer == 2) { this.applyXPFromEarned(); this.setArenaStats(MadnessRoster.playerRoster.teamLeader); } }; v1.beginPopup = function () { var v2 = _root.attachMovie('madness_popup', 'np' + SwainMath.randomNumber(0, 999999999), _root.getNextHighestDepth()); v2.init(MadnessPopup.pendingPopups[0]); v2.onEnterFrame = v2.tick; MadnessPopup.pendingPopups.splice(0, 1); }; v1.addBuffer = function (inTimer, inYesFunction) { var v1 = new Object(); if (MadnessPopup.pendingPopups == undefined) { MadnessPopup.pendingPopups = new Array(); } MadnessPopup.pendingPopups.push(v1); v1.buffer = true; v1.myLinkedItem = v1; v1.myTimer = inTimer; v1.myType = 'buffer'; v1.myYesFunction = inYesFunction; if (MadnessPopup.currentPopup == undefined) { MadnessPopup.beginPopup(); } }; v1.addPopup = function (inType, inText, inChar, inStickX, inStickY, inLinkedItem, inTimer, inYesFunction, inNoFunction) { var v1 = new Object(); if (MadnessPopup.pendingPopups == undefined) { MadnessPopup.pendingPopups = new Array(); } MadnessPopup.pendingPopups.push(v1); v1.buffer = false; v1.myType = inType; v1.myText = inText; v1.myChar = inChar; v1.myY = inStickY; v1.myX = inStickX; v1.myLinkedItem = inLinkedItem; v1.myTimer = inTimer; v1.myYesFunction = inYesFunction; v1.myNoFunction = inNoFunction; if (MadnessPopup.currentPopup == undefined) { MadnessPopup.beginPopup(); } }; v2.closePopup = function () { MadnessPopup.currentPopup.removeMovieClip(); MadnessPopup.currentPopup = undefined; if (MadnessPopup.pendingPopups.length > 0) { MadnessPopup.beginPopup(); } }; v1.closeAll = function () { MadnessPopup.pendingPopups = new Array(); MadnessPopup.currentPopup.closePopup(); }; v2.moveTarget = function () { if (this.myType == 'help') { if (this.myLinkedItem._x == undefined) { this.myTarget._visible = false; } else { this.targetCoord.x = 0; this.targetCoord.y = 0; this.myLinkedItem.localToGlobal(this.targetCoord); this.globalToLocal(this.targetCoord); this.myTarget._x = this.targetCoord.x; this.myTarget._y = this.targetCoord.y; } } }; v2.drawLine = function () { if (this.myType == 'help') { this.lineMC.removeMovieClip(); if (this.myLinkedItem._x != undefined) { this.createEmptyMovieClip('lineMC', this.getNextHighestDepth()); this.lineMC.lineStyle(1, 16711680, 100, true, 'normal', 'square', 'miter', 1); if (this.myTarget._y <= 0) { this.lineMC.moveTo(this.lineConnectX, 0); this.lineMC.lineTo(this.lineConnectX, this.myTarget._y / 2); } else { this.lineMC.moveTo(this.lineConnectX, this.lineConnectY); this.lineMC.lineTo(this.lineConnectX, this.lineConnectY + (this.myTarget._y - this.lineConnectY) / 2); } if (this.myTarget._x < this.lineConnectX) { this.lineMC.lineTo(this.myTarget._x + this.myTarget._width / 2, this.myTarget._y); } else { this.lineMC.lineTo(this.myTarget._x - this.myTarget._width / 2, this.myTarget._y); } } } }; v2.pressYes = function (inPlayerPressedYesManually) { if (inPlayerPressedYesManually) { SwainAudioPlayer.playSound('menu4', 0); } this.myYesFunction(); this.closePopup(); }; v2.pressNo = function () { this.myNoFunction(); this.closePopup(); }; v2.setArenaStats = function (inSource) { this.myLevelTEXT.text = inSource.myLevel; this.myCashTEXT.text = '+ $' + String(Math.floor(MadnessRoster.playerRoster.myCash)); this.xpBar.myBar._xscale = (inSource.myXP / MadnessDataFile.getLevelUpXP(inSource.myLevel, inSource.myXP)) * 100; }; v2.applyXPFromEarned = function () { if (_root.earnedXP > 0) { if (_root.earnedXP > 1) { MadnessRoster.playerRoster.teamLeader.applyXP(_root.earnedXP * 0.1); _root.earnedXP -= _root.earnedXP * 0.1; } else { MadnessRoster.playerRoster.teamLeader.applyXP(_root.earnedXP); _root.earnedXP = 0; } } if (_root.earnedCash > 0) { if (_root.earnedCash > 1) { MadnessRoster.playerRoster.myCash += _root.earnedCash * 0.1; _root.earnedCash -= _root.earnedCash * 0.1; } else { MadnessRoster.playerRoster.myCash += _root.earnedCash; _root.earnedCash = 0; } } }; v2.pressMissionCharacter = function (inSlot) { MadnessRoster.playerRoster.makeLeader(MadnessRoster.playerRoster.myActiveMembers[inSlot]); var v2 = 0; while (v2 < 4) { this['leader' + v2]._visible = MadnessRoster.playerRoster.myActiveMembers[v2] == MadnessRoster.playerRoster.teamLeader; ++v2; } this.missionIconAdjust(); }; v2.rollOverMissionCharacter = function (inSlot) { var v2 = 0; while (v2 < 4) { var v4 = new Color(this['icon' + v2]); var v3 = {'rb': 150, 'gb': 80, 'bb': 80}; if (v2 != inSlot) { v3 = {'rb': 0, 'gb': 0, 'bb': 0}; } v4.setTransform(v3); ++v2; } }; v2.rollOutMissionCharacter = function (inSlot) { var v3 = new Color(this['icon' + inSlot]); var v2 = {'rb': 0, 'gb': 0, 'bb': 0}; v3.setTransform(v2); }; v2.missionIconAdjust = function () { MadnessRoster.playerRoster.readjustActiveOrder(); var v4; var v3; var v2 = 0; while (v2 < 4) { v4 = this['icon' + v2]; v3 = MadnessRoster.playerRoster.myActiveMembers[v2]; v4.deadX._visible = false; if (v3 == undefined) { this['charName' + v2].text = ''; v4.mySprite._visible = false; this['select' + v2]._visible = false; } else { this['charName' + v2].text = v3.myName; MadnessStoreHire.updateCharCard(v4, v3, false); } this['leader' + v2]._visible = v3 == MadnessRoster.playerRoster.teamLeader; ++v2; } }; v2.missionDifficulty = function () { var v3 = ['easy', 'normal', 'hard']; var v2 = 0; while (v2 < v3.length) { this[v3[v2] + 'Difficulty']._visible = v3[v2] == MadnessGameSelect.myDifficulty; this[v3[v2] + 'Button']._visible = v3[v2] != MadnessGameSelect.myDifficulty; ++v2; } }; v2.missionChangeDifficulty = function (inDiff) { if (!MadnessTransition.transitionLock) { MadnessGameSelect.myDifficulty = inDiff; this.missionDifficulty(); } }; v1.returnSkipable = function () { var v1 = 0; while (v1 < MadnessPopup.pendingPopups.length) { if (MadnessPopup.pendingPopups[v1].myType != 'help' && MadnessPopup.pendingPopups[v1].myType != 'buffer') { return false; } ++v1; } return MadnessPopup.currentPopup.myType == 'help' || MadnessPopup.currentPopup.myType == 'buffer' || MadnessPopup.currentPopup == undefined; }; v2.targetCoord = new Object(); ASSetPropFlags(_global.MadnessPopup.prototype, null, 1); } #endinitclip } movieClip 4820 __Packages.MadnessTransition { #initclip if (!_global.MadnessTransition) { var v1 = function () { super(); this.onEnterFrame = this.tick; }; _global.MadnessTransition = v1; _global.MadnessTransition extends MovieClip; var v2 = v1.prototype; v2.init = function (inTrans, inAction, inObj) { this.myAction = inAction; this.myRef = inObj; this.gotoAndPlay(inTrans); MadnessTransition.transitionLock = true; }; v2.tick = function () { if (this.myPhase == 1) { this.myPhase = 2; MadnessPopup.closeAll(); SwainAudioPlayer.stopAllSounds(); if (this.myAction == 'room') { _root.currentStart = this.myRef; if (_root.gameMenu == undefined) { _root.createGameMenu(); } else { _root.gameMenu.init(); } _root.removeRoom(); _root.createRoom(); if (this.getDepth() < _root.gameMenu.getDepth()) { _root.gameMenu.swapDepths(this); } if (_root.gameMenu.getDepth() < _root.newWorld.getDepth()) { _root.newWorld.swapDepths(_root.gameMenu.getDepth()); } _root.exitWorldMap(); _root.exitHireStore(); _root.exitItemStore(); _root.exitTeamSetup(); _root.cutsceneDone(); _root.removeMicroMenu(); MadnessGameSelect.saveGame(); } if (this.myAction == 'menu') { _root.cutsceneDone(); _root.removeRoom(); _root.removeGameMenu(); _root.createMicroMenu(); _root.menuBar.swapDepths(this); _root.createHireStore(); _root.worldMap.swapDepths(this); MadnessRoster.playerRoster.gameOver(); } if (this.myAction == 'arena_menu' || this.myAction == 'arena_menu_new') { _root.removeRoom(); _root.removeGameMenu(); MadnessRoster.playerRoster.gameOver('arena'); if (this.myAction == 'arena_menu_new') { _root.pickCreate(); } if (this.myAction == 'arena_menu') { _root.createMicroMenu('arena'); _root.menuBar.swapDepths(this); _root.pickTeam(); } _root.createCharacter.swapDepths(this); MadnessGameSelect.closeGameSelect(); MadnessGameSelect.saveGame(); } if (this.myAction == 'story_menu' || this.myAction == 'story_menu_new') { _root.cutsceneDone(); _root.removeRoom(); _root.removeGameMenu(); _root.createMicroMenu('story'); _root.menuBar.swapDepths(this); _root.pickMap(); if (this.getDepth() < _root.worldMap.getDepth()) { _root.worldMap.swapDepths(this); } MadnessRoster.playerRoster.gameOver(); MadnessGameSelect.closeGameSelect(); } if (this.myAction == 'quit') { _root.cutsceneDone(); _root.removeRoom(); _root.removeGameMenu(); _root.pickMenu(); _root.gameSelect.swapDepths(this); MadnessRoster.playerRoster.gameOver(); } if (this.myAction == 'cutscene') { _root.exitWorldMap(); _root.exitHireStore(); _root.exitItemStore(); _root.exitTeamSetup(); _root.removeGameMenu(); _root.removeRoom(); _root.createCutscene(); _root.newCutscene.swapDepths(this); } } }; v2.completeTransition = function () { MadnessTransition.transitionLock = false; this.removeMovieClip(); }; v2.myPhase = 0; ASSetPropFlags(_global.MadnessTransition.prototype, null, 1); } #endinitclip } movieClip 4821 __Packages.MadWorld { #initclip if (!_global.MadWorld) { var v1 = function () { super(); this.myRooms = new Array(); this.hitBitmapData1 = new flash.display.BitmapData(Stage.width, Stage.height, true, 0); this.hitBitmapData2 = new flash.display.BitmapData(Stage.width, Stage.height, true, 0); this.m1 = new flash.geom.Matrix(); this.m2 = new flash.geom.Matrix(); this.origin = new flash.geom.Point(); this.intersectRect1 = new flash.geom.Rectangle(); this.intersectRect2 = new flash.geom.Rectangle(); this.rosterCreationList = new Array(); this.noColliders = new Array(); this.onEnterFrame = this.tick; }; _global.MadWorld = v1; _global.MadWorld extends MovieClip; var v2 = v1.prototype; v2.init = function (inStartRef) { MadWorld.thisWorld = this; this.myStartRef = inStartRef; this.myRoomRef = this.myStartRef.myParent; _root.myGameSpeed = 1; if (MadnessGameSelect.myDifficulty == 'easy') { MadnessCharacter.damageDifficultyMod = 0.3; } if (MadnessGameSelect.myDifficulty == 'normal') { MadnessCharacter.damageDifficultyMod = 0.5; } if (MadnessGameSelect.myDifficulty == 'hard') { MadnessCharacter.damageDifficultyMod = 1; } MadnessDoors.allDoors = new Array(); MadnessObstacle.allObstacles = new Array(); MadnessCharacter.allRosters = new Array(); MadWorld.activeFactions = new Array(); MadnessActivator.allActivators = new Array(); MadnessParticle.allPickups = new Array(); this.gotoAndStop(this.myRoomRef.myType); this.currentX = this.defaultX; this.currentY = this.defaultY; this._x = this.currentX; this._y = this.currentY; var v4 = 0; var v3; while (this['r' + v4 + '_ur'] != undefined) { this['roomObj' + String(v4)] = new Object(); v3 = this['roomObj' + String(v4)]; this.myRooms.push(v3); v3.roomNumber = v4; if (v4 == 0) { v3.myUL = this.r0_ul; v3.myDL = this.r0_dl; } else { v3.myUL = this['r' + (v4 - 1) + '_ur']; v3.myDL = this['r' + (v4 - 1) + '_dr']; } v3.myUR = this['r' + v4 + '_ur']; v3.myDR = this['r' + v4 + '_dr']; v3.leftAngle = SwainMath.calculate_rotation(v3.myDL._x - 0, v3.myDL._y + 0, v3.myUL._x - 0, v3.myUL._y - 0); v3.rightAngle = SwainMath.calculate_rotation(v3.myDR._x + 0, v3.myDR._y + 0, v3.myUR._x + 0, v3.myUR._y - 0); v3.upAngle = SwainMath.calculate_rotation(v3.myUL._x - 0, v3.myUL._y - 0, v3.myUR._x + 0, v3.myUR._y - 0); v3.downAngle = SwainMath.calculate_rotation(v3.myDL._x - 0, v3.myDL._y + 0, v3.myDR._x + 0, v3.myDR._y + 0); v3.leftWidth = SwainMath.get_distance(v3.myDL, v3.myUL); v3.rightWidth = SwainMath.get_distance(v3.myDR, v3.myUR); v3.upWidth = SwainMath.get_distance(v3.myUL, v3.myUR); v3.downWidth = SwainMath.get_distance(v3.myDL, v3.myDR); if (this['stairs' + v4] != undefined) { v3.amStairs = true; } if (v4 == 0) { v3.ystart = 0; } else { if (this.myRooms[v4 - 1].amStairs) { v3.ystart = this.myRooms[v4 - 1].ystart; } else { v3.ystart = this.myRooms[v4 - 1].myDL._y - this.myRooms[v4 - 1].myDR._y + this.myRooms[v4 - 1].ystart; } } ++v4; } this.myStart = this.PHstart; this.myStart._visible = false; this.myStart.myDataRef = inStartRef; this.myStart.myDataRef.mySprite = this.myStart; var v5 = 0; while (v5 < this.myRoomRef.myActivators.length) { var v12 = this.attachMovie('madness_activator', 'activator' + v5, this.getNextHighestDepth()); v12.init(this['PHactivator' + String(v5)], this.myRoomRef.myActivators[v5]); MadnessActivator.allActivators.push(v12); ++v5; } MadnessActivator.bombActive = false; v5 = 0; while (v5 < this.myRoomRef.myDoors.length) { var v14 = this.attachMovie('madness_doors', 'door' + v5, this.getNextHighestDepth()); v14.init(this['PHdoor' + String(v5)], this.myRoomRef.myDoors[v5]); MadnessDoors.allDoors.push(v14); ++v5; } this.followDoor = this.myStartRef.mySprite; if (this.myRoomRef.bmpBodies == undefined) { this.bmpBodies = new flash.display.BitmapData(this._width + this.bmpOffset * 2, this._height + this.bmpOffset * 2, true, 11141290); this.myRoomRef.bmpBodies = this.bmpBodies; } else { this.bmpBodies = this.myRoomRef.bmpBodies; } this.createEmptyMovieClip('mcBodies', this.getNextHighestDepth()); this.mcBodies.attachBitmap(this.bmpBodies, this.mcBodies.getNextHighestDepth(), 'auto', true); this.mcBodies._x = -this.bmpOffset; this.mcBodies._y = -this.bmpOffset; v5 = 10; while (v5 > 0) { --v5; } v5 = 0; while (v5 < this.myRoomRef.myObstacles.length) { var v13 = this.attachMovie('madness_obstacle', 'obstacle' + v5, this.getNextHighestDepth()); v13.init(this['PHobstacle' + String(v5)], this.myRoomRef.myObstacles[v5]); MadnessObstacle.allObstacles.push(v13); ++v5; } v5 = 0; while (v5 < this.myRoomRef.myItems.length) { var v8 = this.myRoomRef.myItems[v5]; this.createParticle(v8.myType, 'gun', v8.loggedX, v8.loggedY, 0, 0, v8.loggedRot, 0, 0, v8.loggedY, 100, v8.loggedScale, true, -90, v8); ++v5; } if (this.myRooms[0].myDL._x < this.myRooms[0].myUL._x) { this.leftMax = this.myRooms[0].myDL._x - 50; } else { this.leftMax = this.myRooms[0].myUL._x - 50; } if (this.myRooms[this.myRooms.length - 1].myDR._x > this.myRooms[this.myRooms.length - 1].myUR._x) { this.rightMax = this.myRooms[this.myRooms.length - 1].myDR._x + 50; } else { this.rightMax = this.myRooms[this.myRooms.length - 1].myUR._x + 50; } var v7 = this.myRooms[0].myDL._y; v5 = 0; while (v5 < this.myRooms.length) { if (this.myRooms[v5].myDL._y > v7) { v7 = this.myRooms[v5].myDL._y; } if (this.myRooms[v5].myDR._y > v7) { v7 = this.myRooms[v5].myDR._y; } ++v5; } v7 += 60; this.downMax = v7; v7 = this.myRooms[0].myUL._y; v5 = 0; while (v5 < this.myRooms.length) { if (this.myRooms[v5].myUL._y < v7) { v7 = this.myRooms[v5].myUL._y; } if (this.myRooms[v5].myUR._y < v7) { v7 = this.myRooms[v5].myUR._y; } ++v5; } v7 -= 260; this.upMax = v7; this.createEmptyMovieClip('wallHit', this.getNextHighestDepth()); this.wallHit.beginFill(16711680); this.wallHit.moveTo(this.myRooms[0].myDL._x - 100, this.myRooms[0].myDL._y); this.wallHit.lineTo(this.myRooms[0].myDL._x, this.myRooms[0].myDL._y); this.wallHit.lineTo(this.myRooms[0].myUL._x, this.myRooms[0].myUL._y); this.wallHit.lineTo(this.myRooms[0].myUL._x, this.myRooms[0].myUL._y - 100); var v10; var v9; v5 = 0; while (v5 < this.myRooms.length) { if (this.myRooms[v5].amStairs || this.myRooms[v5 + 1].amStairs) { v10 = this.myRooms[v5].myUR._x; v9 = this.myRooms[v5].myUR._y - 200; } else { v10 = this.myRooms[v5].myUR._x; v9 = this.myRooms[v5].myUR._y - 100; } this.wallHit.lineTo(v10, v9); ++v5; } this.wallHit.lineTo(this.myRooms[this.myRooms.length - 1].myUR._x, this.myRooms[this.myRooms.length - 1].myUR._y); this.wallHit.lineTo(this.myRooms[this.myRooms.length - 1].myDR._x, this.myRooms[this.myRooms.length - 1].myDR._y); this.wallHit.lineTo(this.myRooms[this.myRooms.length - 1].myDR._x + 100, this.myRooms[this.myRooms.length - 1].myDR._y); this.wallHit.lineTo(this.myRooms[this.myRooms.length - 1].myDR._x + 100, this.myRooms[this.myRooms.length - 1].myDR._y - 500); this.wallHit.lineTo(this.myRooms[0].myDL._x - 100, this.myRooms[this.myRooms.length - 1].myDR._y - 500); this.wallHit.lineTo(this.myRooms[0].myDL._x - 100, this.myRooms[0].myDL._y); this.wallHit.endFill(); this.wallHit._visible = false; this.createEmptyMovieClip('floorHit', this.getNextHighestDepth()); this.floorHit.beginFill(65280); this.floorHit.moveTo(this.myRooms[0].myDL._x - 50, this.myRooms[0].myDL._y); this.floorHit.lineTo(this.myRooms[0].myDL._x, this.myRooms[0].myDL._y); this.floorHit.lineTo(this.myRooms[0].myDR._x, this.myRooms[0].myDR._y); v5 = 0; while (v5 < this.myRooms.length) { v10 = this.myRooms[v5].myDR._x; v9 = this.myRooms[v5].myDR._y; this.floorHit.lineTo(v10, v9); ++v5; } this.floorHit.lineTo(this.myRooms[this.myRooms.length - 1].myDR._x, this.myRooms[this.myRooms.length - 1].myDR._y); this.floorHit.lineTo(this.myRooms[this.myRooms.length - 1].myDR._x + 50, this.myRooms[this.myRooms.length - 1].myDR._y); this.floorHit.lineTo(this.myRooms[this.myRooms.length - 1].myDR._x + 50, this.myRooms[this.myRooms.length - 1].myDR._y + 500); this.floorHit.lineTo(this.myRooms[0].myDL._x - 50, this.myRooms[this.myRooms.length - 1].myDR._y + 500); this.floorHit.lineTo(this.myRooms[0].myDL._x - 50, this.myRooms[0].myDL._y); this.floorHit.endFill(); this.floorHit._visible = false; if (this.myStartRef.amStartPoint) { this.createSprite(MadnessRoster.playerRoster.teamLeader, this.myStart, this.myStart._x + SwainMath.randomNumber(-20, 20), this.myStart._y + SwainMath.randomNumber(-40, 40)); } else { this.myStartRef.mySprite.addCharacter(MadnessRoster.playerRoster.teamLeader, 'enter'); } v5 = 0; while (v5 < MadnessRoster.playerRoster.myActiveMembers.length) { if (MadnessRoster.playerRoster.myActiveMembers[v5] != MadnessRoster.playerRoster.teamLeader) { if (this.myStartRef.amStartPoint) { this.createSprite(MadnessRoster.playerRoster.myActiveMembers[v5], this.myStart, this.myStart._x + SwainMath.randomNumber(-70, 70), this.myStart._y + SwainMath.randomNumber(-30, 30)); } else { this.myStartRef.mySprite.addCharacter(MadnessRoster.playerRoster.myActiveMembers[v5], 'enter'); } } ++v5; } MadWorld.activeFactions.push(MadnessRoster.playerRoster.teamFaction); this.followTarget = MadnessRoster.playerRoster.teamLeader.mySprite; MadnessCharacter.allRosters.push(MadnessRoster.playerRoster); var v15 = this.attachMovie('player_aim', 'playerAim', this.getNextHighestDepth()); v15.swapDepths(100000); v5 = 0; while (v5 < this.myRoomRef.myCharacters.length) { var v6 = this['npcRoster' + this.myRoomRef.myCharacters[v5].myFaction]; if (v6 == undefined) { this['npcRoster' + this.myRoomRef.myCharacters[v5].myFaction] = new MadnessRoster(); v6 = this['npcRoster' + this.myRoomRef.myCharacters[v5].myFaction]; v6.init(this.myRoomRef.myCharacters[v5].myFaction); MadnessCharacter.allRosters.push(v6); if (!this.factionExists(v6.teamFaction)) { MadWorld.activeFactions.push(v6.teamFaction); } } v6.addCharacter(this.myRoomRef.myCharacters[v5]); v6.makeActive(this.myRoomRef.myCharacters[v5]); var v11 = this.inventExistingNPCStartPoint(this.myRoomRef.myCharacters[v5].startupPoint); this.createSprite(this.myRoomRef.myCharacters[v5], v11, v11._x + SwainMath.randomNumber(-10, 10), v11._y + SwainMath.randomNumber(-10, 10)); ++v5; } this.rosterCreationList = this.myRoomRef.myRosters; this.deserterRoster = new MadnessRoster(); this.deserterRoster.init('deserters'); MadnessCharacter.allRosters.push(this.deserterRoster); if (this.myRoomRef.myTrack != undefined) { SwainAudioPlayer.playTrack(this.myRoomRef.myTrack); } else { SwainAudioPlayer.playTrack(MadnessLevel.currentLevel.myTrack); } }; v2.tick = function () { ++this.roomTimer; if (this.followTarget != undefined) { this.myFollowX = this.followTarget._x; this.myFollowY = this.followTarget._y; } else { this.followTarget = MadnessRoster.playerRoster.teamLeader.mySprite; if (this.myFollowX == undefined) { this.myFollowX = this.followDoor._x; this.myFollowY = this.followDoor._y; } } if (this.myFollowY - 50 < -this.defaultY + 230 - (this.currentY - this.defaultY)) { this.currentY = -this.defaultY + 230 - (this.myFollowY - 50) + this.defaultY; } if (this.myFollowY - 50 > this.defaultY - 230 - (this.currentY - this.defaultY)) { this.currentY = this.defaultY - 230 - (this.myFollowY - 50) + this.defaultY; } if (this.currentY > -this.upMax) { this.currentY = -this.upMax; } if (this.currentY < -this.downMax + this.defaultY * 2) { this.currentY = -this.downMax + this.defaultY * 2; } if (this.myFollowX < -this.defaultX + 400 - (this.currentX - this.defaultX)) { this.currentX = -this.defaultX + 400 - this.myFollowX + this.defaultX; } if (this.myFollowX > this.defaultX - 400 - (this.currentX - this.defaultX)) { this.currentX = this.defaultX - 400 - this.myFollowX + this.defaultX; } if (this.currentX < -this.rightMax + this.defaultX * 2) { this.currentX = -this.rightMax + this.defaultX * 2; } if (this.currentX > -this.leftMax) { this.currentX = -this.leftMax; } this._x = this.currentX; this._y = this.currentY; if (this.shakeCount > 0) { this._x += SwainMath.randomNumber(-this.shakeCount, this.shakeCount); this._y += SwainMath.randomNumber(-this.shakeCount, this.shakeCount); --this.shakeCount; } var v3; var v6 = 0; while (v6 < MadnessCharacter.allRosters.length) { v3 = MadnessCharacter.allRosters[v6]; if (v3.myActiveMembers.length == 0 && v3 != MadnessRoster.playerRoster && v3.teamFaction != 'deserters') { this.runRosterEvents(v3); MadnessLevel.removeRoster(this.myRoomRef, v3); MadnessCharacter.allRosters.splice(v6, 1); this.enemyCreationTimer = 0; if (this.factionGone(v3.teamFaction)) { var v5 = 0; while (v5 < MadWorld.activeFactions.length) { if (MadWorld.activeFactions[v5] == v3.teamFaction) { MadWorld.activeFactions.splice(v5, 1); if (MadWorld.activeFactions.length == 1) { _root.myGameSpeed = 1; } break; } ++v5; } } --v6; } ++v6; } ++this.enemyCreationTimer; if (this.enemyCreationTimer > 20) { var v8 = false; v6 = 0; while (v6 < this.rosterCreationList.length) { v3 = this.rosterCreationList[v6]; if (!this.factionExists(v3.teamFaction)) { MadWorld.activeFactions.push(v3.teamFaction); v8 = true; } else { if (SwainMath.randomNumber(0, 65) == 0 && this.doorsEmpty()) { var v7 = 0; var v4 = 0; while (v4 < MadnessCharacter.allRosters.length) { if (MadnessCharacter.allRosters[v4].teamFaction == v3.teamFaction) { v7 += MadnessCharacter.allRosters[v4].myActiveMembers.length; } ++v4; } if (v7 <= MadnessLevel.currentLevel.myDifficulty / 2 && v7 < 5) { v8 = true; } } } if (v8) { MadnessCharacter.allRosters.push(v3); MadnessLevel.removeRoster(this.myRoomRef, v3); this.createRosterEnemies(v3); v6 = 9999999; break; } ++v6; } } if (!this.gameStarted) { v6 = 0; while (v6 < MadnessRoster.playerRoster.myActiveMembers.length) { if (MadnessRoster.playerRoster.myActiveMembers[v6].mySprite != undefined) { this.gameStarted = true; break; } ++v6; } } if (this.gameStarted) { this.allDead = true; ++this.deadTimer; if (MadnessRoster.playerRoster.teamLeader.myHealth > 0) { this.deadTimer = 0; this.allDead = false; } } if (this.deadTimer > this.deadTimerMax) { this.deadTimer = 0; this.allDead = false; } v6 = 0; while (v6 < MadnessCharacter.allRosters.length) { if (MadnessCharacter.allRosters[v6].teamFireScore > 0) { MadnessCharacter.allRosters[v6].teamFireScore -= 1 + _root.myGameSpeed; if (MadnessCharacter.allRosters[v6].teamFireScore < 0) { MadnessCharacter.allRosters[v6].teamFireScore = 0; } } ++v6; } if (this.myRoomRef.myObjective == 'clear' && MadWorld.activeFactions.length == 1 && MadWorld.activeFactions[0] == 'player' && this.rosterCreationList.length == 0) { MadnessLevel.completeObjectiveCheck(this.myRoomRef, 'clear'); } if (this.gameStarted && !this.endRoom) { if (this.endTimer > 0 || MadnessLevel.levelVictory) { ++this.endTimer; } } if (!this.allDead && this.endTimer > this.endTimerMax) { this.leaveRoom(); } if (_root.myGameSpeed == 0) { this.slowMoActive(); } if (this.enemiesAllDead() && !MadnessActivator.bombActive) { this.roomLock = false; } else { this.roomLock = true; } }; v2.determineRoom = function (inX, inY) { this.pickedRoom = -1; if (inX < this.myRooms[0].myUL._x || inX < this.myRooms[0].myDL._x) { this.pickedRoom = 0; } else { if (inX > this.myRooms[this.myRooms.length - 1].myUR._x || inX > this.myRooms[this.myRooms.length - 1].myDR._x) { this.pickedRoom = this.myRooms.length - 1; } } if (this.pickedRoom == -1) { var v2 = 0; while (v2 < this.myRooms.length) { if (inX < this.myRooms[v2].myUR._x && inX < this.myRooms[v2].myDR._x && inX > this.myRooms[v2].myUL._x && inX > this.myRooms[v2].myDL._x && inY < this.myRooms[v2].myDR._y && inY < this.myRooms[v2].myDL._y && inY > this.myRooms[v2].myUR._y && inY > this.myRooms[v2].myUL._y) { this.pickedRoom = v2; break; } ++v2; } } if (this.pickedRoom == -1) { v2 = 0; while (v2 < this.myRooms.length) { this.thisAngle = SwainMath.calculate_rotation(this.myRooms[v2].myDL._x, this.myRooms[v2].myDL._y, inX, inY); if (this.thisAngle >= this.myRooms[v2].leftAngle - 2) { this.thisAngle = SwainMath.calculate_rotation(this.myRooms[v2].myDR._x, this.myRooms[v2].myDR._y, inX, inY); if (this.thisAngle <= this.myRooms[v2].rightAngle + 2) { this.thisAngle = 360 + SwainMath.calculate_rotation(this.myRooms[v2].myUL._x, this.myRooms[v2].myUL._y, inX, inY); if (this.thisAngle >= this.myRooms[v2].upAngle - 2) { this.thisAngle = SwainMath.calculate_rotation(this.myRooms[v2].myDL._x, this.myRooms[v2].myDL._y, inX, inY); if (this.thisAngle <= this.myRooms[v2].downAngle + 2) { this.pickedRoom = v2; break; } else {} } else {} } else {} } else {} ++v2; } } return this.myRooms[this.pickedRoom]; }; v2.determineZ = function (inMC) {}; v2.makeBullet = function (inMC, inRotOffset, inLength, inTargX, inTargY, inX, inY) { var v2 = new Object(); var v6 = this.attachMovie('madness_bullet', 'bullet' + SwainMath.randomNumber(0, 99999999), this.getNextHighestDepth()); var v7; var v5; var v4; var v8; var v13; if (inMC.myAimX >= inMC._x) { v7 = inMC.mySprite.handShoot_front; } if (inMC.myAimX <= inMC._x) { v7 = inMC.mySprite.handShoot_back; } if (inX != null) { v5 = inX; v4 = inY; } else { v2.x = 0; v2.y = 0; v7.myGun.myShootPoint.localToGlobal(v2); this.globalToLocal(v2); v5 = v2.x; v4 = v2.y; } v8 = SwainMath.get_distance2(v5, v4, inTargX, inTargY); v6._rotation = SwainMath.calculate_rotation(v5, v4, inTargX, inTargY); v6._x = v5; v6._y = v4; v6.myMask._yscale = v8; }; v2.checkLineHit = function (inStartX, inStartY, inDistance, inAngle, inTarget) { this.aimLine._x = inStartX; this.aimLine._y = inStartY; this.aimLine._rotation = inAngle; this.aimLine._yscale = inDistance; this.hitBitmapData1.fillRect(this.hitBitmapData1.rectangle, 0); this.hitBitmapData2.fillRect(this.hitBitmapData2.rectangle, 0); this.bounds = this.aimLine.getBounds(_root); this.intersectRect1.x = this.bounds.xMin; this.intersectRect1.y = this.bounds.yMin; this.intersectRect1.right = this.bounds.xMax; this.intersectRect1.bottom = this.bounds.yMax; this.bounds = inTarget.getBounds(_root); this.intersectRect2.x = this.bounds.xMin; this.intersectRect2.y = this.bounds.yMin; this.intersectRect2.right = this.bounds.xMax; this.intersectRect2.bottom = this.bounds.yMax; this.intersectRect1.intersection(this.intersectRect2); this.m1 = this.aimLine.transform.concatenatedMatrix; this.m1.translate(-this.intersectRect1.x, -this.intersectRect1.y); this.m2 = inTarget.transform.concatenatedMatrix; this.m2.translate(-this.intersectRect1.x, -this.intersectRect1.y); this.intersectRect1.offset(-this.intersectRect1.x, -this.intersectRect1.y); this.hitBitmapData1.draw(this.aimLine, this.m1, null, null, this.intersectRect1); this.hitBitmapData2.draw(inTarget, this.m2, null, null, this.intersectRect1); return this.hitBitmapData2.hitTest(this.origin, 128, this.hitBitmapData1, this.origin, 128); }; v2.createEffect = function (inX, inY, inEffect, inScaleLow, inScaleHigh, inRotation) { var v2 = this.attachMovie('madness_effect', 'newEffect' + SwainMath.randomNumber(0, 999999), this.getNextHighestDepth()); v2.gotoAndStop(inEffect); v2._x = inX; v2._y = inY; v2._xscale = SwainMath.randomNumber(inScaleLow, inScaleHigh); v2._yscale = v2._xscale; v2._rotation = inRotation; }; v2.drawToBitmap = function (inObject, inTarget) { var v2 = new flash.geom.Matrix(); v2.scale(inObject._xscale / 100, inObject._yscale / 100); v2.translate(inObject._x + this.bmpOffset, inObject._y + this.bmpOffset); this[inTarget].draw(inObject, v2); }; v2.createParticle = function (inType, inCategory, inX, inY, inXSpeed, inYSpeed, inRot, inRotSpeed, inBounce, inFloor, inAlpha, inScale, inStanding, inStandRot, inDataRef) { var v2 = this.attachMovie('madness_particle', 'prtcl' + SwainMath.randomNumber(0, 99999999), this.getNextHighestDepth()); v2.init(inType, inCategory, inX, inY, inXSpeed, inYSpeed, inRot, inRotSpeed, inBounce, inFloor, inAlpha, inScale, inStanding, inStandRot, inDataRef); }; v2.createSplat = function (inX, inY, inType, inRot) { var v2 = this.attachMovie('madness_splat', 'newBulletHole', this.getNextHighestDepth()); v2.gotoAndStop(inType); v2.mySprite.gotoAndStop(SwainMath.randomNumber(1, v2.mySprite._totalframes)); if (inRot != undefined) { v2.mySprite._rotation = inRot; } v2._x = inX; v2._y = inY; this.drawToBitmap(v2, 'bmpBodies'); v2.removeMovieClip(); false; }; v2.bulletWallHit = function (inX, inY) { return this.wallHit.hitTest(inX + this._x, inY + this._y, true); }; v2.bulletFloorHit = function (inX, inY) { return this.floorHit.hitTest(inX + this._x, inY + this._y, true); }; v2.generateUnit = function () {}; v2.createSprite = function (inChar, inDoor, inX, inY) { if (inChar.myRoster == undefined) { inChar.myRoster = this['npcRoster' + inChar.myFaction]; if (inChar.myRoster == undefined) { this['npcRoster' + inChar.myFaction] = new MadnessRoster(); inChar.myRoster = this['npcRoster' + inChar.myFaction]; inChar.myRoster.init(inChar.myFaction); MadnessCharacter.allRosters.push(inChar.myRoster); if (!this.factionExists(inChar.myRoster.teamFaction)) { MadWorld.activeFactions.push(inChar.myRoster.teamFaction); } } inChar.myRoster.addCharacter(inChar); } inChar.myRoster.makeActive(inChar); if (inChar.myRoster == MadnessRoster.playerRoster) { _root.gameMenu.init(); } var v4 = this.attachMovie('madness_character', 'sprite' + String(SwainMath.randomNumber(0, 99999999)), this.getNextHighestDepth()); v4.init(inChar, inChar.myRoster, inChar.myRoster.teamFaction, inChar == MadnessRoster.playerRoster.teamLeader, 'UNUSED', inDoor, inX, inY); if (this.myRoomRef == MadnessLevel.myRooms[0] && inChar.myObjective != undefined) { MadnessLevel.completeObjectiveCheck(inChar, 'rescue'); } if (inChar == MadnessRoster.playerRoster.teamLeader) { this.runRoomEvents(); } if (inChar.noCollide) { this.noColliders.push(inChar.mySprite); } }; v2.leaveRoom = function () { if (!MadnessTransition.transitionLock && !MadnessActivator.bombActive) { if (this.exitDoor.myDataRef.myConnection == MadnessRoster.storeRoster && this.exitDoor.myDataRef.myConnection != undefined) { _root.createTransition('fade', 'arena_menu', null); } else { if (MadnessLevel.levelVictory && !MadnessLevel.levelFailed) { if (MadnessPopup.returnSkipable()) { MadnessGameSelect.beatStage(MadnessLevel.currentLevel.myWorld, MadnessLevel.currentLevel.myLevel); MadnessPopup.addPopup('lines', 'AREA COMPLETE', null, 440, 170, undefined, 90, this.leaveRoomFunction, null); } } else { _root.createTransition('slide', 'room', this.exitDoor.myDataRef.myConnection); } } } }; v2.leaveRoomFunction = function () { if (MadnessLevel.currentLevel.myCutsceneEnd != undefined) { MadnessCutscene.storeCutsceneInfo(MadnessLevel.currentLevel.myCutsceneEnd, MadnessGameSelect.gameMode + '_menu', MadnessLevel.startPoint); _root.createTransition('endgame', 'cutscene', null); } else { _root.createTransition('endgame', MadnessGameSelect.gameMode + '_menu', null); } }; v2.gameOver = function () { if (!MadnessTransition.transitionLock) { _root.createTransition('fade', 'menu', null); } }; v2.playerDies = function () { if (MadnessGameSelect.gameMode == 'arena') { MadnessEvents.arena_1_dead(); } if (MadnessGameSelect.gameMode == 'story') { MadnessLevel.levelVictory = false; if (MadnessCharacter.playerLives == 0 && _root.mcScreenCap == undefined) { if (!MadnessLevel.levelFailed && !MadnessTransition.transitionLock) { MadnessLevel.levelFailed = true; MadnessPopup.closeAll(); MadnessPopup.addPopup('lines', 'MISSION FAILED', null, 440, 170, undefined, 90, this.leaveRoomFunction, null); } } else { this.deadGlitchEnding(); } } }; v2.deadGlitchEnding = function () { if (_root.mcScreenCap == undefined || _root.mcScreenCap.myPurpose != 'recover') { --MadnessCharacter.playerLives; var v4 = new flash.display.BitmapData(_root._width + this.bmpOffset * 2, _root._height + this.bmpOffset * 2, true, 11141290); _root.createEmptyMovieClip('mcScreenCap', _root.getNextHighestDepth()); _root.mcScreenCap.attachBitmap(v4, _root.mcScreenCap.getNextHighestDepth(), 'auto', true); _root.mcScreenCap.attachMovie('death_glitch', 'deathGlitch', this.getNextHighestDepth()); _root.mcScreenCap.startX = -this.bmpOffset; _root.mcScreenCap.startY = -this.bmpOffset; _root.mcScreenCap._x = -this.bmpOffset; _root.mcScreenCap._y = -this.bmpOffset; _root.mcScreenCap.myTimer = 190; _root.mcScreenCap.myColorTransform = new Object(); _root.mcScreenCap.myPurpose = 'recover'; var v3 = new flash.geom.Matrix(); v3.scale(_root._xscale / 100, _root._yscale / 100); v3.translate(_root._x + this.bmpOffset, _root._y + this.bmpOffset); v4.draw(_root, v3); _root.mcScreenCap.onEnterFrame = function () { _root.mcScreenCap.myTimer -= 2.5; _root.mcScreenCap.myColorTransform = {'rb': SwainMath.randomNumber(90, 100), 'gb': 0, 'bb': 0}; _root.mcScreenCap.myColor = new Color(_root.mcScreenCap); _root.mcScreenCap.myColor.setTransform(_root.mcScreenCap.myColorTransform); _root.mcScreenCap._alpha = _root.mcScreenCap.myTimer; if (SwainMath.randomNumber(0, 5) == 0 && _root.mcScreenCap.myTimer < 190) { _root.mcScreenCap._alpha = _root.mcScreenCap.myTimer / 2; } _root.mcScreenCap._x = _root.mcScreenCap.startX + SwainMath.randomNumber(-60, 60) / 10; _root.mcScreenCap._y = _root.mcScreenCap.startY + SwainMath.randomNumber(-60, 60) / 10; if (_root.mcScreenCap.myTimer <= 0) { SwainAudioPlayer.stopSound('static'); _root.mcScreenCap.removeMovieClip(); } }; } }; v2.deadContinueEnding = function () {}; v2.deadArenaEnding = function () {}; v2.slowMoActive = function () { if (_root.mcSlowmo == undefined) { var v4 = new flash.display.BitmapData(_root._width + this.bmpOffset * 2, _root._height + this.bmpOffset * 2, true, 11141290); _root.createEmptyMovieClip('mcSlowmo', _root.getNextHighestDepth()); _root.mcSlowmo.attachBitmap(v4, _root.mcSlowmo.getNextHighestDepth(), 'auto', true); _root.mcSlowmo._alpha = 60; _root.mcSlowmo._x = -this.bmpOffset; _root.mcSlowmo._y = -this.bmpOffset; var v3 = new flash.geom.Matrix(); v3.scale(_root._xscale / 100, _root._yscale / 100); v3.translate(_root._x + this.bmpOffset, _root._y + this.bmpOffset); v4.draw(_root, v3); _root.mcSlowmo.onEnterFrame = function () { _root.mcSlowmo._alpha -= 7; if (_root.mcSlowmo._alpha <= 10) { _root.mcSlowmo.removeMovieClip(); } }; } }; v2.slowMoClose = function () { if (_root.mcSlowmo != undefined) { _root.mcSlowmo.removeMovieClip(); } }; v2.createRosterEnemies = function (inRoster) { var v1; var v2 = 0; while (v2 < inRoster.myActiveMembers.length) { v1 = MadnessDoors.allDoors[SwainMath.randomNumber(0, MadnessDoors.allDoors.length - 1)]; for (;;) { if (!(v1.myDataRef.noSpawn || v1 == undefined)) break; v1 = MadnessDoors.allDoors[SwainMath.randomNumber(0, MadnessDoors.allDoors.length - 1)]; } v1.addCharacter(inRoster.myActiveMembers[v2], 'enter'); ++v2; } }; v2.factionGone = function (inFac) { var v1 = 0; while (v1 < MadnessCharacter.allRosters.length) { if (MadnessCharacter.allRosters[v1].teamFaction == inFac) { return false; } ++v1; } return true; }; v2.enemiesAllDead = function () { var v2 = 0; while (v2 < MadnessCharacter.allRosters.length) { if (MadnessCharacter.allRosters[v2].teamFaction != 'player' && MadnessCharacter.allRosters[v2].teamFaction != 'deserters') { return false; break; } ++v2; } v2 = 0; while (v2 < this.rosterCreationList.length) { if (this.rosterCreationList[v2].teamFaction != 'player' && this.rosterCreationList[v2].teamFaction != 'deserters') { return false; break; } ++v2; } return true; }; v2.runRoomEvents = function () { while (this.myRoomRef.myEvents.length > 0) { if (this.myRoomRef.myEvents[0].myType == 'function') { this.myRoomRef.myEvents[0].myAction(); } this.myRoomRef.myEvents.splice(0, 1); } }; v2.runRosterEvents = function (inRoster) { while (inRoster.myEvents.length > 0) { if (inRoster.myEvents[0].myType == 'function') { inRoster.myEvents[0].myAction(); } inRoster.myEvents.splice(0, 1); } }; v2.shakeyCam = function (inNum) { if (inNum > this.shakeCount) { this.shakeCount = inNum; } }; v2.gunItemDrop = function (inX, inY, inScale, inGun) { this.createParticle(inGun.myType, 'gun', inX, inY - 90, SwainMath.randomNumber(-20, 20) / 10, 0, -90, 0, 0.3, inY, 100, inScale, true, 90, inGun); }; v2.createAimReticle = function (inSource, inTarget) { var v2 = this.attachMovie('aim_reticle', 'aimReticle', this.getNextHighestDepth()); var aimStart = inSource.aimTimer; var v3 = 300; var bracketSpeed = v3 / aimStart; v3 += 50; v2.bracketSpeed = bracketSpeed; v2.mySource = inSource; v2.myTarget = inTarget; v2.rotSpeed = 0; v2.aimStart = aimStart; v2.bracket1._y = -v3; v2.bracket2._y = v3; v2.amDone = false; v2._alpha = 0; v2._x = inTarget._x; v2._y = inTarget._y; v2.onEnterFrame = function () { if (!this.amDone) { if (this._alpha < 100) { this._alpha += this.bracketSpeed * (1 + this.mySource.myGameSpeed); } this._x = this.myTarget._x; this._y = this.myTarget._y - 40; if (this.mySource.aimTimer < this.aimStart / 2) { this.rotSpeed = (this.aimStart / 2 / this.mySource.aimTimer) * 4.7; this._rotation += this.rotSpeed; } if (this.encircle._alpha < 100) { this.encircle._alpha += this.rotSpeed; } this.bracket1._y += this.bracketSpeed * (1 + this.mySource.myGameSpeed); this.bracket2._y -= this.bracketSpeed * (1 + this.mySource.myGameSpeed); if (this.myTarget.myHealth > 0 && this.mySource.aimTimer > -1 && MadnessCharacter.aimingSprite != undefined) { } else { this.amDone = true; this.rotSpeed = 30; } } if (this.amDone) { this.bracket1._y -= this.bracketSpeed * (3 + this.mySource.myGameSpeed); this.bracket2._y += this.bracketSpeed * (3 + this.mySource.myGameSpeed); this.rotSpeed *= 0.7; this._rotation += this.rotSpeed; this._alpha -= 10; if (this._alpha <= 0) { this.removeMovieClip(); } } }; }; v2.inventExistingNPCStartPoint = function (inStartPoint) { var v3 = this.myRooms[SwainMath.randomNumber(0, this.myRooms.length - 1)]; var v7; var v4; var v5; var v6; if (inStartPoint && this.PHstartEnemy != undefined) { v5 = this.PHstartEnemy._x - 80; v6 = this.PHstartEnemy._x + 80; v7 = this.PHstartEnemy._y - 50; v4 = this.PHstartEnemy._y + 50; } else { v7 = v3.myUL._y; if (v7 > v3.myUR._y) { v7 = v3.myUR._y; } v4 = v3.myDL._y; if (v4 < v3.myDR._y) { v4 = v3.myDR._y; } v5 = v3.myUL._x; if (v5 > v3.myDL._x) { v5 = v3.myDL._x; } v6 = v3.myUR._x; if (v6 < v3.myDR._x) { v6 = v3.myDR._x; } } var v2 = new MovieClip(); for (;;) { if (!(this.determineRoom(v2._x, v2._y) == undefined || this.determineRoom(v2._x, v2._y) == -1)) break; v2._x = SwainMath.randomNumber(v5, v6); v2._y = SwainMath.randomNumber(v7, v4); } return v2; }; v2.factionExists = function (inFaction) { var v1 = 0; while (v1 < MadWorld.activeFactions.length) { if (MadWorld.activeFactions[v1] == inFaction) { return true; } ++v1; } return false; }; v2.doorsEmpty = function () { var v1 = 0; while (v1 < MadnessDoors.allDoors.length) { if (MadnessDoors.allDoors[v1].mySprites.length > 0 || MadnessDoors.allDoors[v1].myEnterers.length > 0) { return false; } ++v1; } return true; }; v2.pauseGame = function () { this.paused = true; KeyManager.lockKeys(); MadnessRoster.playerRoster.teamLeader.mySprite.mouseLock = true; MadnessRoster.playerRoster.teamLeader.mySprite.mouseHold = false; }; v2.unpauseGame = function () { this.paused = false; KeyManager.lockKeys(); if (!MadnessRoster.playerRoster.teamLeader.mySprite.mouseHold) { MadnessRoster.playerRoster.teamLeader.mySprite.mouseLock = false; } }; v1.returnAudioPosition = function (inX) { inX += MadWorld.thisWorld._x; inX -= Stage.width / 2; inX *= 0.16; if (inX < -100) { inX = -100; } if (inX > 100) { inX = 100; } return inX; }; v2.processForeignRoster = function (inRoster) { while (inRoster.length > 0) { this.rosterCreationList.push(inRoster[0]); inRoster.splice(0, 1); } }; v2.gameStarted = false; v2.endRoom = false; v2.allDead = false; v2.endTimer = new Number(); v2.endTimerMax = 20; v2.deadTimer = new Number(); v2.deadTimerMax = 60; v2.roomTimer = new Number(); v2.paused = false; v2.defaultX = 425; v2.defaultY = 265; v2.shakeCount = new Number(); v2.testMakeTimer = new Number(); v2.enemyCreationTimer = -20; v2.bmpOffset = 200; ASSetPropFlags(_global.MadWorld.prototype, null, 1); } #endinitclip } movieClip 4822 __Packages.MadnessObstacle { #initclip if (!_global.MadnessObstacle) { var v1 = function () { super(); this.myHoles = new Array(); this.onEnterFrame = this.tick; }; _global.MadnessObstacle = v1; _global.MadnessObstacle extends MovieClip; var v2 = v1.prototype; v2.init = function (inPlaceholder, inDataRef) { this.myDataRef = inDataRef; this.myDataRef.mySprite = this; this.inUse = undefined; this._x = inPlaceholder._x; this._y = inPlaceholder._y; inPlaceholder._visible = false; this.swapDepths(this._y); this.refreshStats(inDataRef.myType); this.myType = inDataRef.myType; this.gotoAndStop(this.myType); if (this.myType.substr(0, 5) == 'empty') { this.gotoAndStop('empty'); } this._xscale = MadnessCharacter.setPerspectiveScale(this._x, this._y, this._parent.determineRoom(this._x, this._y)); this._yscale = this._xscale; MadnessCharacter.setMyDepth(this, this._yscale); this.mySprite.stop(); var v2 = 0; while (v2 < this.myDataRef.myHoles.length) { this.createSplat(this.myDataRef.myHoles[v2].myX, this.myDataRef.myHoles[v2].myY, this.myDataRef.myHoles[v2].myType, this.myDataRef.myHoles[v2].myVariant, this.myDataRef.myHoles[v2].myRot); ++v2; } this.applyStats(); }; v2.tick = function () { if (this.inUse != undefined && this.inUse.targetObstacle != this) { this.inUse = undefined; } if (this.myHealth <= 0 && !this.destroyed) { this.inUse.targetObstacle = undefined; this.inUse.myStatus = 'stun' + SwainMath.randomNumber(1, 3); this.inUse.mySprite.gotoAndStop(this.inUse.myStatus); this.clearSplats(); this.inUse = undefined; this.destroyed = true; this.removeMe(); this.amCover = false; } MadnessCharacter.setMyDepth(this, this._yscale); if (!this.amCover) { if (this.myDataRef.noClip) { this.mySprite.gotoAndStop(2); if (this.myDataRef.alreadyClosed && this.mySprite.mySpikes._visible) { this.mySprite.mySpikes._visible = false; } } else { this.mySprite.gotoAndStop(1); } } else { if (this.myHealth <= 0) { this.mySprite.gotoAndStop(3); } else { if (this.myHealth < this.myHealthMax * 0.5) { this.mySprite.gotoAndStop(2); } } } this.myDataRef.myHealth = this.myHealth; this.myDataRef.myHoles = this.myHoles; }; v2.refreshStats = function (inType) {}; v2.applyStats = function () { if (this.myType == 'woodcrate') { this.myHealth = 3000; this.myDepth = 30; this.myWidth = 75; this.amCover = true; } if (this.myType == 'barrel') { this.myHealth = 2000; this.myDepth = 26; this.myWidth = 25; this.amCover = true; } if (this.myType == 'spikes1') { this.myDepth = 900; this.myWidth = 30; this.amCover = false; } if (this.myType == 'empty0') { this.myDepth = 20; this.myWidth = 50; this.amCover = false; } if (this.myType == 'empty1') { this.myDepth = 30; this.myWidth = 50; this.amCover = false; } if (this.myType == 'empty2') { this.myDepth = 50; this.myWidth = 50; this.amCover = false; } if (this.myType == 'empty3') { this.myDepth = 40; this.myWidth = 170; this.amCover = false; } if (this.myType == 'empty4') { this.myDepth = 40; this.myWidth = 140; this.amCover = false; } this.myHealthMax = this.myHealth; if (this.myDataRef.myHealth != undefined) { this.myHealth = this.myDataRef.myHealth; this.myHealthMax = this.myDataRef.myHealthMax; } }; v2.removeMe = function () { var v2 = 0; while (v2 < MadnessObstacle.allObstacles.length) { if (this == MadnessObstacle.allObstacles[v2]) { MadnessObstacle.allObstacles[v2].splice(v2, 1); break; } ++v2; } }; v2.hurtMe = function (inDamage) { this.myHealth -= inDamage; }; v2.createSplat = function (inX, inY, inType, inVariant, inRot) { var v2 = this.attachMovie('madness_splat', 'newBulletHole', this.getNextHighestDepth()); v2.gotoAndStop(inType); v2._rotation = inRot; if (inVariant == undefined) { v2.mySprite.gotoAndStop(SwainMath.randomNumber(1, 5)); } else { v2.mySprite.gotoAndStop(inVariant); } v2._x = inX; v2._y = inY; var v3 = new Object(); v3.myX = inX; v3.myY = inY; v3.myVariant = v2.mySprite._currentframe; v3.myType = inType; v3.myRot = inRot; this.myHoles.push(v3); }; v2.clearSplats = function () { while (this.myHoles.length > 0) { trace(this.myHoles[0]); this.myHoles[0].cacheAsBitmap = false; this.myHoles[0].removMovieClip(); delete this.myHoles[0]; this.myHoles.splice(0, 1); } }; v2.spikesOpen = function () { this.myDataRef.alreadyClosed = true; }; v1.returnInsideObstacle = function (inX, inY, inWidth) { var v1 = 0; while (v1 < MadnessObstacle.allObstacles.length) { if (inX < MadnessObstacle.allObstacles[v1]._x + MadnessObstacle.allObstacles[v1].myWidth / 2 + inWidth / 2 && inX > MadnessObstacle.allObstacles[v1]._x - MadnessObstacle.allObstacles[v1].myWidth / 2 - inWidth / 2 && inY < MadnessObstacle.allObstacles[v1]._y + MadnessObstacle.allObstacles[v1].myDepth / 2 && inY > MadnessObstacle.allObstacles[v1]._y - MadnessObstacle.allObstacles[v1].myDepth / 2) { return true; } ++v1; } return false; }; v2.invincible = new Boolean(); v2.destroyed = false; v2.zoneWidth = 40; v2.zoneDepth = 15; ASSetPropFlags(_global.MadnessObstacle.prototype, null, 1); } #endinitclip } movieClip 4823 __Packages.MadnessActivator { #initclip if (!_global.MadnessActivator) { var v1 = function () { super(); this.onEnterFrame = this.tick; }; _global.MadnessActivator = v1; _global.MadnessActivator extends MovieClip; var v2 = v1.prototype; v2.init = function (inPlaceholder, inDataRef) { this.myDataRef = inDataRef; this.myDataRef.mySprite = this; this.myType = inDataRef.myType; this.gotoAndStop(this.myType); this.mySprite.gotoAndStop(1); this.activated = false; if (this.myDataRef.myEvents.length == 0) { this.mySprite.gotoAndStop(2); this.activated = true; } this._x = inPlaceholder._x; this._y = inPlaceholder._y; inPlaceholder._visible = false; if (this.myDataRef.myItemsSpent == undefined) { this.myDataRef.myItemsSpent = new Array(); } this.setDoors(); if (this.myDataRef.asploded) { this.mySprite.myBomb.gotoAndStop(this.mySprite.myBomb._totalframes); } }; v2.tick = function () { if (this.myDataRef.myEvents.length > 0 || this.myDataRef.myItems.length > 0 || this.myDataRef.myObjective != undefined) { this.activated = false; this.mySprite.gotoAndStop(1); } else { this.activated = true; this.mySprite.gotoAndStop(2); } }; v2.activateMe = function () { while (this.myDataRef.myEvents.length > 0) { if (this.myDataRef.myEvents[0].myType == 'lock') { this.myDataRef.myEvents[0].myTarget.amLocked = true; this.myDataRef.myEvents[0].myTarget.mySprite.amLocked = true; this.myDataRef.myEvents[0].myTarget.myConnection.amLocked = true; this.myDataRef.myEvents[0].myTarget.myConnection.mySprite.amLocked = true; } else { if (this.myDataRef.myEvents[0].myType == 'unlock') { this.myDataRef.myEvents[0].myTarget.amLocked = false; this.myDataRef.myEvents[0].myTarget.mySprite.amLocked = false; this.myDataRef.myEvents[0].myTarget.myConnection.amLocked = false; this.myDataRef.myEvents[0].myTarget.myConnection.mySprite.amLocked = false; } else { if (this.myDataRef.myEvents[0].myType == 'function') { this.myDataRef.myEvents[0].myAction(); } } } this.myDataRef.myEvents.splice(0, 1); } if (this.myDataRef.myItems.length > 0) { var v2 = new Object(); var v3 = this.mySprite['item' + this.myDataRef.myItemsSpent.length]; v2.x = v3._x; v2.y = v3._y; this.mySprite.localToGlobal(v2); this._parent.globalToLocal(v2); this.dropItem(this.myDataRef.myItems[0], v2.x); v3.gotoAndPlay('opening'); this.mySprite['item' + this.myDataRef.myItemsSpent.length].myIndicator._visible = false; this.myDataRef.myItems.splice(0, 1); var v4 = new Object(); this.myDataRef.myItemsSpent.push(v4); if (this.myDataRef.myItems.length > 0) { this.mySprite['item' + this.myDataRef.myItemsSpent.length].myIndicator._visible = true; } } if (this.myDataRef.myObjective == 'use') { MadnessLevel.completeObjectiveCheck(this.myDataRef, 'use'); } if (this.myType.substr(0, 4) == 'bomb') { MadnessActivator.bombActive = true; this.myDataRef.asploded = false; } if (this.myType.substr(0, 8) == 'terminal') { this.playSound('activator2'); } if (this.myType.substr(0, 5) == 'panel') { this.playSound('activator1'); } if (this.myType.substr(0, 6) == 'locker') { this.playSound('clang'); } if (this.myType == 'wallsafe') { this.playSound('clang'); } }; v2.setDoors = function () { var v4 = new Number(); var v3 = new Number(); if (this.myType.substr(0, 6) == 'locker') { v4 = 3; } if (this.myType == 'wallsafe') { v4 = 1; } var v2 = 0; while (v2 < v4) { if (this.myDataRef.myItemsSpent[v2] != undefined) { this.mySprite['item' + v2].gotoAndStop('open'); this.mySprite['item' + v2].myIndicator._visible = false; } else { if (this.myDataRef.myItems[v3] == undefined) { this.mySprite['item' + v2].gotoAndStop('open'); this.mySprite['item' + v2].myIndicator._visible = false; } else { this.mySprite['item' + v2].gotoAndStop('closed'); if (v3 == 0) { this.mySprite['item' + v2].myIndicator._visible = true; } else { this.mySprite['item' + v2].myIndicator._visible = false; } ++v3; } } ++v2; } }; v2.dropItem = function (inItem, inX) { MadWorld.thisWorld.gunItemDrop(inX, this._y, MadnessCharacter.setPerspectiveScale(inX, this._y, MadWorld.thisWorld.determineRoom(this._x, this._y)), inItem); }; v2.playSound = function (inSound) { SwainAudioPlayer.playSound(inSound, MadWorld.returnAudioPosition(this._x)); }; v2.asplodeMe = function () { this.myDataRef.asploded = true; this.playSound('explode'); MadnessActivator.bombActive = false; MadWorld.thisWorld.shakeyCam(15); var v2; var v4 = 0; while (v4 < MadnessCharacter.allRosters.length) { var v3 = 0; while (v3 < MadnessCharacter.allRosters[v4].myActiveMembers.length) { v2 = MadnessCharacter.allRosters[v4].myActiveMembers[v3].mySprite; if (!v2.deadMan) { if (SwainMath.get_distance(this, v2) < 110) { if (v2.myHealth > 0) { v2.applyKnockback(this, 10, false); } } } ++v3; } ++v4; } }; v2.bombSetup = function () { if (MadnessActivator.bombActive) { SwainAudioPlayer.playSound('swapgun', 0); } }; v2.bombBeep = function () { if (MadnessActivator.bombActive) { SwainAudioPlayer.playSound('bombbeep', 0); } }; v2.activated = false; ASSetPropFlags(_global.MadnessActivator.prototype, null, 1); } #endinitclip } movieClip 4824 __Packages.MadnessParticle { #initclip if (!_global.MadnessParticle) { var v1 = function () { super(); this.onEnterFrame = this.tick; }; _global.MadnessParticle = v1; _global.MadnessParticle extends MovieClip; var v2 = v1.prototype; v2.init = function (inType, inCategory, inX, inY, inXSpeed, inYSpeed, inRot, inRotSpeed, inBounce, inFloor, inAlpha, inScale, inStanding, inStandRot, inDataRef) { this.myGun = inDataRef; this.myThrower = this.myGun.myOwner; this.myFaction = this.myGun.myThrowerFaction; this.myType = inType; this.myCategory = inCategory; if (this.myCategory == 'thrown') { this.amDangerous = true; this.myCategory = 'gun'; } this.gotoAndStop(this.myCategory); this.mySprite.gotoAndStop(this.myType); if (this.myGun.upgradeSilencer) { this.mySprite.gotoAndStop(this.myType + '_silenced'); } if (inCategory == 'casing') { this.mySprite.mySprite.gotoAndStop(SwainMath.randomNumber(1, this.mySprite._totalframes)); } if (this.myGun.melee) { ItemGenerator.setItemSprite(this.mySprite.mySprite, this.myGun); } this.mySprite._rotation = inRot; this.myRotSpeed = inRotSpeed; this.xSpeed = inXSpeed; this.ySpeed = inYSpeed; this.myBounce = inBounce; this.myFloor = inFloor; this._alpha = inAlpha; this._x = inX; this._y = inY; this.mySprite._xscale = inScale; if (inScale < 0) { this.mySprite._yscale = -inScale; } else { this.mySprite._yscale = inScale; } MadnessCharacter.setMyDepth(this, this.mySprite._yscale); this.myStanding = inStanding; this.standRotation = inStandRot; if (this.myCategory == 'gun') { this.collectible = true; } if (this.myThrower != undefined) { this.myRoom = this.myThrower.mySprite.myRoom; } else { this.myRoom = this._parent.determineRoom(this._x, this.myFloor); } if (this.myGun.loggedX != undefined) { this._x = this.myGun.loggedX; this.myFloor = this.myGun.loggedY; this.mySprite._rotation = this.myGun.loggedRot; this.finished = this.myGun.loggedFinished; this.mySprite._xscale = this.myGun.loggedScaleX; this.mySprite._yscale = this.myGun.loggedScaleY; } if (this.myCategory == 'gun') { var v3 = false; var v2 = 0; while (v2 < this._parent.myRoomRef.myItems.length) { if (this._parent.myRoomRef.myItems[v2] == this.myGun) { v3 = true; break; } ++v2; } if (!v3) { this._parent.myRoomRef.myItems.push(this.myGun); } } this.mySprite.inHat.gotoAndStop(this.mySprite.inHat._totalframes); }; v2.pauseTick = function () { if (!this._parent.paused) { this.onEnterFrame = this.tick; } }; v2.tick = function () { if (this._parent.paused) { this.onEnterFrame = this.pauseTick; } if (this.finished) { this.killMe(); } ++this.lifespan; this.slowmoSpeedMod = 0.4 + 0.6 * _root.myGameSpeed; this._x += this.xSpeed * this.slowmoSpeedMod; if (!this.rolling) { if (this.myCategory == 'sparks' || this.myCategory.substr(0, 4) == 'drop') { this.ySpeed += MadnessParticle.gravity * this.slowmoSpeedMod * 0.7; } else { this.ySpeed += MadnessParticle.gravity * this.slowmoSpeedMod; } } this._y += this.ySpeed * this.slowmoSpeedMod; if (!this.finished) { if (this.myRoom.amStairs) { this.myFloor = SwainMath.get_position(this._x, this.myFloor, this.myRoom.upAngle, (0.4 * this.xSpeed + 0.6 * _root.myGameSpeed * this.xSpeed) * 1.38, 'y'); } if (this.myRoom != undefined) { if (this.myRoom.roomNumber != 0 && this._x < this.myRoom.myDL._x && this._x < this.myRoom.myUL._x) { this.myRoom = this._parent.myRooms[this.myRoom.roomNumber - 1]; } if (this.myRoom.roomNumber != this._parent.myRooms.length - 1 && this._x > this.myRoom.myDR._x && this._x > this.myRoom.myUR._x) { this.myRoom = this._parent.myRooms[this.myRoom.roomNumber + 1]; } if (this.myFloor < this.myRoom.myUL._y && this.myFloor < this.myRoom.myUR._y) { this.myFloor += 5; } if (this.myFloor > this.myRoom.myDL._y && this.myFloor > this.myRoom.myDR._y) { this.myFloor -= 5; } for (;;) { if (!(SwainMath.calculate_rotation(this.myRoom.myUL._x, this.myRoom.myUL._y, this._x, this.myFloor) <= this.myRoom.upAngle && SwainMath.calculate_rotation(this.myRoom.myUL._x, this.myRoom.myUL._y, this._x, this.myFloor) > 0)) break; this.myFloor += 5; this.xSpeed *= 0.95; } while (SwainMath.calculate_rotation(this.myRoom.myDL._x, this.myRoom.myDL._y, this._x, this.myFloor) >= this.myRoom.downAngle) { this.myFloor -= 5; this.xSpeed *= 0.95; } } this.myLastRoom = this.myRoom; this.myRoom = this._parent.determineRoom(this._x, this.myFloor); if (this.myRoom == undefined) { this.myRoom = this.myLastRoom; } if (this._y > this.myFloor) { this._y = this.myFloor; this.hookRecallEnable(); if (this.myType == 'grenade') { this.hitExplode('floor'); } if (this.myGun != undefined && this.ySpeed > 12 && this.myThrower != undefined) { SwainAudioPlayer.playSound('clang', MadWorld.returnAudioPosition(this._x)); } this.removeDangerous(); if (this.myCategory == 'casing') { this.mySprite.mySprite.gotoAndStop(SwainMath.randomNumber(1, this.mySprite._totalframes)); } if (this.myRoom.amStairs) { if (this.myRoom.upAngle < 90 && this.xSpeed > 0 || this.myRoom.upAngle > 90 && this.xSpeed < 0) { this.xSpeed *= -1; if (this.myGun != undefined) { SwainAudioPlayer.playSound('clang', MadWorld.returnAudioPosition(this._x)); } if (this.myType == 'grenade') { this.hitExplode('floor'); } this.removeDangerous(); } } if (this.myCategory == 'blood') { this.mySprite._visible = false; var v10 = this.attachMovie('madness_splat', 'mySplat', this.getNextHighestDepth()); this.mySplat.gotoAndStop('floor' + SwainMath.randomNumber(1, 3) + '_' + this.myType.substr(0, this.myType.length - 1)); this.mySplat._xscale = this._xscale; this.mySplat._yscale = this._yscale; if (this.myRoom.amStairs) { this.mySplat._rotation = -90 + this.myRoom.upAngle; } this.killMe('bmpBodies'); if (this.xSpeed > 0) { this.mySplat._xscale *= -1; } } if (this.ySpeed < 8) { this.rolling = true; this.ySpeed = 0; } else { this.ySpeed *= -this.myBounce; if (!this.myStanding) { this.xSpeed = (this.xSpeed + this.xSpeed * this.myBounce) / 2; } } if (this.myStanding && SwainMath.getRotDistance(this.mySprite._rotation, this.standRotation) <= 90) { if (this.mySprite._rotation < this.standRotation) { if (this.myRotSpeed > 0) { this.myRotSpeed += -this.ySpeed * 2; } else { this.myRotSpeed *= -this.myBounce; if (this.xSpeed < 0 && !this.myRoom.amStairs) { this.xSpeed += -this.ySpeed * 0.5; } } } else { if (this.myRotSpeed < 0) { this.myRotSpeed -= -this.ySpeed * 2; } else { this.myRotSpeed *= -this.myBounce; if (this.xSpeed > 0 && !this.myRoom.amStairs) { this.xSpeed -= -this.ySpeed * 0.5; } } } } else { if (this.mySprite._rotation < this.standRotation - 180) { if (this.myRotSpeed > 0) { this.myRotSpeed -= -this.ySpeed * 2; } else { this.myRotSpeed *= -this.myBounce; if (this.xSpeed < 0 && !this.myRoom.amStairs) { this.xSpeed += -this.ySpeed * 0.5; } } } else { if (this.myRotSpeed < 0) { this.myRotSpeed += -this.ySpeed * 2; } else { this.myRotSpeed *= -this.myBounce; if (this.xSpeed > 0 && !this.myRoom.amStairs) { this.xSpeed -= -this.ySpeed * 0.5; } } } } } if (this.myRoom.amStairs) { this.rolling = false; } if (this.xSpeed < 0 && (this._x <= this._parent.myRooms[0].myDL._x || this._x <= this._parent.myRooms[0].myUL._x) && SwainMath.calculate_rotation(this._parent.myRooms[0].myDL._x, this._parent.myRooms[0].myDL._y, this._x, this.myFloor) <= this._parent.myRooms[0].leftAngle || this.xSpeed > 0 && (this._x >= this._parent.myRooms[this._parent.myRooms.length - 1].myDR._x || this._x >= this._parent.myRooms[this._parent.myRooms.length - 1].myUR._x) && SwainMath.calculate_rotation(this._parent.myRooms[this._parent.myRooms.length - 1].myDR._x, this._parent.myRooms[this._parent.myRooms.length - 1].myDR._y, this._x, this.myFloor) >= this._parent.myRooms[this._parent.myRooms.length - 1].rightAngle) { this.xSpeed *= -1 * this.myBounce; this.myRotSpeed *= -1; this.hookRecallEnable(); if (this.myType == 'grenade') { this.hitExplode('wall'); } if (this.myGun != undefined) { SwainAudioPlayer.playSound('clang', MadWorld.returnAudioPosition(this._x)); } this.removeDangerous(); if (this.myCategory == 'blood') { this.mySprite._visible = false; v10 = this.attachMovie('madness_splat', 'mySplat', this.getNextHighestDepth()); this.mySplat.gotoAndStop('wall' + SwainMath.randomNumber(1, 3) + '_' + this.myType.substr(0, this.myType.length - 1)); this.mySplat._xscale = this._xscale; this.mySplat._yscale = this._yscale; this.killMe('bmpBodies'); if (this.xSpeed < 0) { } if (this.xSpeed > 0) { this.mySplat._xscale *= -1; } } } if (this.rolling) { this.xSpeed = (this.xSpeed + this.xSpeed * this.myBounce) / 2; if (!this.myStanding) { this.myRotSpeed = (this.myRotSpeed + this.myRotSpeed * this.myBounce) / 2; } } if (!this.finished && this.myStanding && this.myRotSpeed < 20 && this.myRotSpeed > -20 && this.rolling) { if (SwainMath.getRotDistance(this.mySprite._rotation, this.standRotation) <= 90) { if (this.mySprite._rotation < this.standRotation) { this.myRotSpeed += 1.2; } else { this.myRotSpeed -= 1.2; } } else { if (this.mySprite._rotation < this.standRotation + 180) { this.myRotSpeed -= 1.2; } else { this.myRotSpeed += 1.2; } } } if (this.myRotSpeed > 35) { this.myRotSpeed = 35; } if (this.myRotSpeed < -35) { this.myRotSpeed = -35; } this.mySprite._rotation += this.myRotSpeed * this.slowmoSpeedMod; if (this.ySpeed == 0 && this.xSpeed < 2 && (!this.myStanding || this.myStanding && (SwainMath.getRotDistance(this.mySprite._rotation, this.standRotation) < 20 || SwainMath.getRotDistance(this.mySprite._rotation, this.standRotation + 180) < 20))) { this.ySpeed = 0; this.xSpeed = 0; this.myRotSpeed = 0; this.finished = true; this.cacheAsBitmap = true; this.killMe('bmpBodies'); } } if (!this.finished && (this.amDangerous || this.myCategory == 'projectile')) { var v3; var v6 = false; var v9 = 0; while (v9 < MadnessCharacter.allRosters.length) { var v8 = 0; while (v8 < MadnessCharacter.allRosters[v9].myActiveMembers.length) { v3 = MadnessCharacter.allRosters[v9].myActiveMembers[v8].mySprite; if (v3.myFaction != this.myFaction && !v3.amDodging && !v3.deadMan) { if (this.myFloor > v3._y - 40 && this.myFloor < v3._y + 40) { if (this._x < v3._x + v3.myWidth / 2 && this._x > v3._x - v3.myWidth / 2) { if (this._y > v3._y - v3.myHeight && this._y < v3._y) { var v5 = new Object(); v5.x = this._x; v5.y = this._y + 5; this._parent.localToGlobal(v5); var v4 = -Math.abs(this.xSpeed / 2); while (v4 < Math.abs(this.xSpeed / 2)) { if (v3.mySprite.myHead.myHit.hitTest(v5.x + v4, v5.y, true)) { this.removeDangerous(); if (this.myType == 'grenade') { this.hitExplode('floor'); v6 = true; break; } else { var v7; if (this.myGun.melee) { v7 = ItemGenerator.createWeapon(this.myGun.myType); } else { v7 = ItemGenerator.unarmedWeapon(); } if (this.myGun.amHook && this.myThrower.myScale >= v3.myDataRef.myScale) { v3.applyKnockback(this.myThrower.mySprite, SwainMath.get_distance(this.myThrower.mySprite, v3) / 25, true); this.hookRecallEnable(); } this.assignWeaponDamage(v7, this.myGun); this.hitCharacter(v3, v7, true, this._x + v4, this._y); v6 = true; break; } } else { if (v3.mySprite.myBody.myHit.hitTest(v5.x + v4, v5.y, true)) { this.removeDangerous(); if (this.myType == 'grenade') { this.hitExplode('floor'); v6 = true; break; } else { if (this.myGun.melee) { var v7 = ItemGenerator.createWeapon(this.myGun.myType); } else { var v7 = ItemGenerator.unarmedWeapon(); } if (this.myGun.amHook && this.myThrower.myScale >= v3.myDataRef.myScale) { v3.applyKnockback(this.myThrower.mySprite, SwainMath.get_distance(this.myThrower.mySprite, v3) / 25, true); this.hookRecallEnable(); } this.assignWeaponDamage(v7, this.myGun); this.hitCharacter(v3, v7, false, this._x + v4, this._y); v6 = true; break; } } } v4 += 5; } } } } } if (v6) { break; } ++v8; } if (v6) { break; } ++v9; } } if (this.myGun.amHook) { this.setHookLine(); if (this.myThrower.mySprite._x < this._x) { if (this.ySpeed > 0) { this.xSpeed -= 4; } this.xSpeed -= 0.4; if (this.xSpeed > (this._x - this.myThrower.mySprite._x) * 0.8) { this.xSpeed = (this._x - this.myThrower.mySprite._x) * 0.8; } } else { if (this.ySpeed > 0) { this.xSpeed += 4; } this.xSpeed += 0.4; if (this.xSpeed < (this._x - this.myThrower.mySprite._x) * 0.8) { this.xSpeed = (this._x - this.myThrower.mySprite._x) * 0.8; } } } if (this.myGun.amHook) { MadnessCharacter.setMyDepth(this, this.myThrower.mySprite.getDepth() + 2); } else { MadnessCharacter.setMyDepth(this, this.mySprite._yscale); } }; v2.killMe = function (inDestination) { if (!this.myGun.amHook) { if (this.myCategory == 'gun' && !this.myGun.noPickup && (this.myThrower.myScale == 1 || this.myThrower == undefined)) { MadnessParticle.allPickups.push(this); this.onEnterFrame = this.amDead; this.cacheAsBitmap = true; this.myColor = new Color(this); } else { if (this.myCategory != 'sparks') { this._parent.drawToBitmap(this, inDestination); this.removeMovieClip(); false; } } } }; v2.amDead = function () { this.logPositioning(); if (MadnessRoster.playerRoster.teamLeader.mySprite.targetPickup == this) { if (this.myGun.myAmmo == 0 && this.myGun.myClips == 0) { this.myColorTransform = {'rb': 250, 'gb': 0, 'bb': 0}; } else { this.myColorTransform = {'rb': 0, 'gb': 250, 'bb': 0}; } } else { this.myColorTransform = {'rb': 0, 'gb': 0, 'bb': 0}; } this.myColor.setTransform(this.myColorTransform); }; v1.removePickup = function (inPickup) { var v1 = 0; while (v1 < inPickup._parent.myRoomRef.myItems.length) { if (inPickup._parent.myRoomRef.myItems[v1] == inPickup.myGun) { inPickup._parent.myRoomRef.myItems.splice(v1, 1); break; } ++v1; } v1 = 0; while (v1 < MadnessParticle.allPickups.length) { if (inPickup == MadnessParticle.allPickups[v1]) { MadnessParticle.allPickups[v1].clearPositioning(); MadnessParticle.allPickups.splice(v1, 1); break; } ++v1; } inPickup.removeMovieClip(); false; }; v2.removeMe = function (inArray) { var v2 = 0; while (v2 < inArray.length) { if (inArray[v2] == this) { inArray.splice(v2, 1); break; } ++v2; } }; v2.logPositioning = function () { if (this.myCategory == 'gun') { this.myGun.loggedX = this._x; this.myGun.loggedY = this.myFloor; this.myGun.loggedRot = this.mySprite._rotation; this.myGun.loggedFinished = this.finished; this.myGun.loggedScaleX = this.mySprite._xscale; this.myGun.loggedScaleY = this.mySprite._yscale; } }; v2.clearPositioning = function () { if (this.myCategory == 'gun') { this.myGun.loggedX = undefined; this.myGun.loggedY = undefined; this.myGun.loggedRot = undefined; this.myGun.loggedFinished = undefined; this.myGun.loggedScaleX = undefined; this.myGun.loggedScaleY = undefined; } }; v2.removeDangerous = function () { if (this.amDangerous) { this.amDangerous = false; } }; v2.hitCharacter = function (inChar, inWeapon, headHit, hitX, hitY) { this.myDataRef.modDmg = 1; var v4 = false; if (inChar.myHealth > 0) { v4 = true; } MadnessCharacter.adjustSprite(inChar); inChar.checkDamage(inWeapon, this, hitX, hitY, true, headHit); if (v4 && inChar.myHealth <= 0) { MadnessGameSelect.appropriateXP(this.myThrower, inChar.myDataRef, 'thrown'); } this.removeDangerous(); this.xSpeed *= -0.2; this.myRotSpeed *= -0.2; if (inWeapon.melee) { this.myGun.myHealth -= 2; ItemGenerator.setItemSprite(this.mySprite.mySprite, this.myGun); if (this.myGun.myHealth <= 0) { this.myGun.myHealth = 1; } } if (inWeapon.myDamageType == 'blade') { SwainAudioPlayer.playSound('slash', MadWorld.returnAudioPosition(this._x)); } if (inWeapon.myDamageType == 'blunt' || inWeapon.myDamageType == 'punch') { SwainAudioPlayer.playSound('blunt', MadWorld.returnAudioPosition(this._x)); } }; v2.hitExplode = function (inScorch) { if (inScorch == 'floor') { this._x -= this.xSpeed * 1.5; } var v2; var v5 = 0; while (v5 < MadnessCharacter.allRosters.length) { var v3 = 0; while (v3 < MadnessCharacter.allRosters[v5].myActiveMembers.length) { v2 = MadnessCharacter.allRosters[v5].myActiveMembers[v3].mySprite; if (!v2.deadMan) { if (SwainMath.get_distance(this, v2) < 170) { var v4 = false; if (v2.myHealth > 0) { v4 = true; } v2.myHealth -= this.myGun.myDamage; if (v4 && v2.myHealth <= 0) { MadnessGameSelect.appropriateXP(this.myThrower, v2.myDataRef, 'explode'); } if (v2.myHealth <= 0) { v2.myStatus = 'dead'; v2.headDamage += SwainMath.randomNumber(0, 3); v2.bodyDamage += SwainMath.randomNumber(0, 3); if (v2.headDamage > 4) { v2.headDamage = 4; } if (v2.bodyDamage > 4) { v2.bodyDamage = 4; } v2.headSpray += SwainMath.randomNumber(0, 3); v2.bodySpray += SwainMath.randomNumber(0, 3); if (v2.headSpray > 4) { v2.headSpray = 4; } if (v2.bodySpray > 4) { v2.bodySpray = 4; } } else { v2.applyKnockback(this, this.myGun.myDamage / 2, false); } if (this._x < v2._x && v2.myFacing == 'left' || this._x > v2._x && v2.myFacing == 'right') { if (v2.myStatus == 'dead') { v2.mySubStatus = '_fly' + SwainMath.randomNumber(1, 4); } } else { if (v2.myStatus == 'dead') { v2.mySubStatus = '_fly' + SwainMath.randomNumber(1, 4); } } if (this._x < v2._x) { v2.mySpeedRight = this.myGun.myDamage / 2; } else { v2.mySpeedRight = -this.myGun.myDamage / 2; } v2.applyDeath(); } } ++v3; } ++v5; } this._parent.createEffect(this._x, this._y, 'grenade_explode', 60, 60, 0); var v6; var v7; if (inScorch == 'wall') { v6 = 90; v7 = this._y; } if (inScorch == 'floor') { v6 = 0; v7 = this.myFloor; } if (this.myRoom.amStairs) { v6 = -90 + this.myRoom.upAngle; v7 = this.myFloor; } this._parent.createSplat(this._x, v7, 'grenade_scorch', v6); MadWorld.thisWorld.shakeyCam(15); SwainAudioPlayer.playSound('explode', MadWorld.returnAudioPosition(this._x)); this.removeMovieClip(); false; }; v2.assignWeaponDamage = function (inWeapon, inSource) { inWeapon.myDamage = inSource.myDamage / 2; inWeapon.myDamage += Math.abs((this.xSpeed + this.ySpeed - 20) / 2) / 4; }; v2.hookRecallEnable = function () { if (this.myGun.amHook) { this.hookRecall = true; this.onEnterFrame = this.returnToSender; } }; v2.returnToSender = function () { SwainMath.move_me(this, SwainMath.calculate_rotation(this._x, this._y, this.myThrower.mySprite._x, this.myThrower.mySprite._y - this.myThrower.myHeight / 2), 45); this.mySprite._rotation += this.myRotSpeed * this.slowmoSpeedMod; MadnessCharacter.setMyDepth(this, this.myThrower.mySprite.getDepth() + 1); this.xSpeed = 50; this.ySpeed = 0; this.setHookLine(); if (this._x < this.myThrower.mySprite._x + this.myThrower.myWidth / 2 + 10 && this._x > this.myThrower.mySprite._x - this.myThrower.myWidth / 2 - 10 && this._y < this.myThrower.mySprite._y && this._y > this.myThrower.mySprite._y - this.myThrower.myHeight - 10) { this.myThrower.mySprite.thrownHook = false; this.myThrower.mySprite.dropGun(); this.myThrower.equipItem(this.myGun, this.myThrower.myWeapons[this.myThrower.myWeapon]); MadnessParticle.removePickup(this); } }; v2.setHookLine = function () { this.lineMC.removeMovieClip(); if (this.myThrower.mySprite._x != undefined) { var v2 = new Object(); v2.x = 2; v2.y = -20; this.mySprite.localToGlobal(v2); this.globalToLocal(v2); this.lineHookX = v2.x; this.lineHookY = v2.y; var v3; if (this.myThrower.mySprite.myFacing == 'right') { if (this.myThrower.mySprite.mySprite.handShoot_front._visible) { v3 = this.myThrower.mySprite.mySprite.handShoot_front; } else { if (this.myThrower.mySprite.mySprite.myHand._visible) { v3 = this.myThrower.mySprite.mySprite.myHand; } else { v3 = this.myThrower.mySprite.mySprite.handNone_front; } } } else { if (this.myThrower.mySprite.mySprite.handShoot_front._visible) { v3 = this.myThrower.mySprite.mySprite.handShoot_back; } else { if (this.myThrower.mySprite.mySprite.myHand2._visible) { v3 = this.myThrower.mySprite.mySprite.myHand2; } else { v3 = this.myThrower.mySprite.mySprite.handNone_back; } } } v2.x = 0; v2.y = 0; v3.localToGlobal(v2); this.globalToLocal(v2); this.lineHandX = v2.x; this.lineHandY = v2.y; this.createEmptyMovieClip('lineMC', this.getNextHighestDepth()); this.lineMC.lineStyle(0.25, 0, 100, true, 'normal', 'square', 'miter', 1); this.lineMC.moveTo(this.lineHookX, this.lineHookY); this.lineMC.curveTo(this.lineHookX - (this.lineHookX - this.lineHandX) / 2, this.lineHookY - (this.lineHookY - this.lineHandY) / 2 + Math.abs(50 - (Math.abs(this.xSpeed) + Math.abs(this.ySpeed))), this.lineHandX, this.lineHandY); } }; v1.gravity = 2.8; v2.totalBounces = new Number(); v2.rolling = false; v2.floorLowered = false; v2.lifespan = 0; v2.collectible = false; v2.finished = false; v2.hookRecall = false; v1.allPickups = new Array(); ASSetPropFlags(_global.MadnessParticle.prototype, null, 1); } #endinitclip } movieClip 4825 __Packages.MadnessCutscene { #initclip if (!_global.MadnessCutscene) { var v1 = function () { super(); this.onEnterFrame = this.tick; }; _global.MadnessCutscene = v1; _global.MadnessCutscene extends MovieClip; var v2 = v1.prototype; v2.init = function () { MadnessCutscene.currentCutscene = this; this.newMovie = this.attachMovie(MadnessCutscene.cutsceneID, 'newMovie', this.getNextHighestDepth()); this.newMovie._x = 421.8; this.newMovie._y = 284.9; SwainAudioPlayer.playTrack(this.returnTrack()); }; v2.tick = function () { if (this.newMovie._currentframe == this.newMovie._totalframes) { this.pressSkip(); } }; v2.pressSkip = function () { SwainAudioPlayer.stopAllSounds(); this.newMovie.stop(); _root.createTransition('instant', MadnessCutscene.savedAction, MadnessCutscene.savedObject); MadnessCutscene.closeCutscene(); SwainAudioPlayer.playSound('menu4', 0); }; v1.closeCutscene = function () { MadnessCutscene.currentCutscene.removeMovieClip(); }; v1.storeCutsceneInfo = function (inCutscene, inAction, inObject) { MadnessCutscene.cutsceneID = inCutscene; MadnessCutscene.savedAction = inAction; MadnessCutscene.savedObject = inObject; }; v2.returnTrack = function () { var v1; if (MadnessGameSelect.gameMode == 'arena') { } v1 = 'menu'; if (MadnessGameSelect.gameMode == 'story') { if (MadnessCutscene.cutsceneID == 'cutscene_world0_start') { v1 = 'stage1'; } if (MadnessCutscene.cutsceneID == 'cutscene_world0_end') { v1 = 'stage5'; } } return v1; }; ASSetPropFlags(_global.MadnessCutscene.prototype, null, 1); } #endinitclip } movieClip 4826 __Packages.KeyManager { #initclip if (!_global.KeyManager) { var v1 = function () { super(); KeyManager.keys = new Array(); KeyManager.keyCounts = new Array(); KeyManager.keysToDetect = new Array(); this.i = 0; while (this.i < 100) { KeyManager.keys.push(0); ++this.i; } this.onEnterFrame = this.detectKeys; this.onKeyUp = this.detectKeyUp; this.onKeyDown = this.detectKeyDown; Key.addListener(this); this._visible = false; }; _global.KeyManager = v1; _global.KeyManager extends MovieClip; var v2 = v1.prototype; v1.addKey = function (keyName, keyNum) { if (KeyManager.keysToDetect[keyName] == null) { KeyManager.keysToDetect[keyName] = keyNum; KeyManager.keyCounts[keyName] = 0; } else { trace('this key has already been defined'); } }; v2.detectKeys = function () { for (var v1 in KeyManager.keysToDetect) { if (KeyManager.keys[KeyManager.keysToDetect[v1]]) { if (KeyManager.keyCounts[v1] != -1) { ++KeyManager.keyCounts[v1]; } } else { KeyManager.keyCounts[v1] = 0; } } }; v2.detectKeyDown = function () { KeyManager.keys[Key.getCode()] = true; }; v2.detectKeyUp = function () { KeyManager.keys[Key.getCode()] = false; }; v1.lockKeys = function () { for (var v1 in KeyManager.keysToDetect) { KeyManager.keyCounts[v1] = -1; } }; ASSetPropFlags(_global.KeyManager.prototype, null, 1); } #endinitclip } movieClip 4827 __Packages.MadnessCharacterCreator { #initclip if (!_global.MadnessCharacterCreator) { var v1 = function () { super(); }; _global.MadnessCharacterCreator = v1; _global.MadnessCharacterCreator extends MovieClip; var v2 = v1.prototype; v2.init = function () { if (MadnessCharacterCreator.newGame) { this.selectDisplay.gotoAndStop('create'); this.selectDisplay.newNameTEXT.text = 'Enter Name'; this.selectDisplay.newNameTEXT.text.onSetFocus = function () { Selection.setSelection(0, this.selectDisplay.newNameTEXT.text.length); }; this.newSubjectTEXT.text = 'NEW TEST SUBJECT'; } else { this.selectDisplay.gotoAndStop('create2'); this.selectDisplay.newNameTEXT.text = MadnessRoster.playerRoster.teamLeader.myName; this.selectDisplay.levelTEXT.text = 'Level ' + MadnessRoster.playerRoster.teamLeader.myLevel; trace(MadnessRoster.playerRoster.teamLeader); this.newSubjectTEXT.text = 'TEST SUBJECT FOUND'; } this.myKillsTEXT.text = MadnessRoster.playerRoster.teamLeader.myKills; this.myCashTEXT.text = '$' + Math.floor(MadnessRoster.playerRoster.myCash); this.myWavesTEXT.text = MadnessRoster.playerRoster.teamLeader.myWaves; MadnessStoreHire.updateCharCard(this.selectDisplay.spriteGroup, MadnessRoster.playerRoster.teamLeader, false); }; v2.pressDone = function () { if (MadnessGameSelect.gameMode == 'arena') { if (MadnessCharacterCreator.newGame) { MadnessRoster.playerRoster.teamLeader.myName = this.selectDisplay.newNameTEXT.text; } if (!MadnessTransition.transitionLock) { _root.createTransition('fade', 'arena_menu', null); SwainAudioPlayer.playSound('menu4', 0); } } }; v2.nameClicked = false; ASSetPropFlags(_global.MadnessCharacterCreator.prototype, null, 1); } #endinitclip } movieClip 4828 __Packages.MadnessAI { #initclip if (!_global.MadnessAI) { var v1 = function () {}; _global.MadnessAI = v1; var v2 = v1.prototype; v1.setActions = function (inChar) { inChar.moveUp = false; inChar.moveDown = false; inChar.moveLeft = false; inChar.moveRight = false; inChar.toggleAction = false; inChar.toggleReload = false; inChar.togglePickup = false; inChar.toggleSlowmo = false; inChar.mouseClick = false; inChar.mouseHold = false; inChar.shootReady = false; MadnessAI.myTarget = inChar.myAttackTarget; if (MadnessAI.myTarget._x == undefined) { MadnessAI.myTarget = undefined; } MadnessAI.myLeader = inChar.myRoster.teamLeader.mySprite; if (MadnessAI.myLeader._x == undefined) { MadnessAI.myLeader = undefined; } MadnessAI.world = inChar._parent; if (MadWorld.activeFactions.length == 1) { if (inChar.myMission == 'engage' && SwainMath.randomNumber(0, inChar.traitDistracted) == 0 || inChar.myRoster != MadnessRoster.playerRoster) { if (MadnessAI.myLeader == inChar) { inChar.myMission = 'follow'; } else { inChar.myMission = 'follow'; } inChar.intendedX = undefined; } MadnessAI.myTarget = undefined; } if (MadWorld.activeFactions.length > 1 && PulseTimer.getActive(inChar.myPulseNumber, 3)) { if (inChar.myMission == 'follow') { var v4 = 0; while (v4 < MadnessCharacter.allRosters.length) { var v3 = 0; while (v3 < MadnessCharacter.allRosters[v4].myActiveMembers.length) { if (MadnessCharacter.allRosters[v4].teamFaction != inChar.myFaction) { if (MadnessCharacter.allRosters[v4].myActiveMembers[v3].mySprite._x > inChar._x && MadnessCharacter.allRosters[v4].myActiveMembers[v3].mySprite._x < inChar._x + 500 && (inChar.myFacing == 'right' && !inChar.facingOpposite || inChar.myFacing == 'left' && inChar.facingOpposite) || MadnessCharacter.allRosters[v4].myActiveMembers[v3].mySprite._x < inChar._x && MadnessCharacter.allRosters[v4].myActiveMembers[v3].mySprite._x > inChar._x - 500 && (inChar.myFacing == 'left' && !inChar.facingOpposite || inChar.myFacing == 'right' && inChar.facingOpposite) || MadnessCharacter.allRosters[v4].myActiveMembers[v3].mySprite._x > inChar._x - 800 && MadnessCharacter.allRosters[v4].myActiveMembers[v3].mySprite._x < inChar._x + 800 && MadnessCharacter.allRosters[v4].myActiveMembers[v3].mySprite.rofTimer < 6 && !MadnessCharacter.allRosters[v4].myActiveMembers[v3].myWeapons[MadnessCharacter.allRosters[v4].myActiveMembers[v3].myWeapon].amSilenced) { inChar.myMission = 'engage'; inChar.intendedX = undefined; } } else { if (MadnessCharacter.allRosters[v4] == inChar.myRoster && MadnessCharacter.allRosters[v4].myActiveMembers[v3].mySprite.myMission == 'engage' && MadnessCharacter.allRosters[v4].myActiveMembers[v3].mySprite._x > inChar._x - 200 && MadnessCharacter.allRosters[v4].myActiveMembers[v3].mySprite._x < inChar._x + 200) { inChar.myMission = 'engage'; inChar.intendedX = undefined; } } ++v3; } ++v4; } } } if (MadnessAI.myTarget == undefined || (inChar.myRoster != MadnessRoster.playerRoster && MadnessAI.myTarget != MadnessRoster.playerRoster.teamLeader && SwainMath.randomNumber(0, inChar.traitDistracted * 10) == 0 || SwainMath.randomNumber(0, inChar.traitDistracted * 20) == 0) && inChar.aimTimer == -1) { if (inChar.myMission == 'engage' || inChar.myMission == 'surrender') { var v5; var v6 = 99999999999999.0; v4 = 0; while (v4 < MadnessCharacter.allRosters.length) { if (MadnessCharacter.allRosters[v4].teamFaction != inChar.myFaction) { v3 = 0; while (v3 < MadnessCharacter.allRosters[v4].myActiveMembers.length) { v5 = SwainMath.get_distance(inChar, MadnessCharacter.allRosters[v4].myActiveMembers[v3].mySprite); if (MadnessCharacter.allRosters[v4].myActiveMembers[v3] == MadnessRoster.playerRoster.teamLeader && SwainMath.randomNumber(0, 5) > 0 && inChar.myMission != 'surrender') { v5 *= 0.1; } if (v5 < v6) { v6 = v5; MadnessAI.myTarget = MadnessCharacter.allRosters[v4].myActiveMembers[v3].mySprite; v5 = v6; } ++v3; } } ++v4; } } } if (inChar.myStatus.substr(0, 7) == 'wounded') { if (MadnessAI.myTarget._x > inChar._x && MadnessAI.myTarget._x < inChar._x + 200) { inChar.moveLeft = true; } if (MadnessAI.myTarget._x < inChar._x && MadnessAI.myTarget._x > inChar._x - 200) { inChar.moveRight = true; } } if (inChar.myMission == 'patrol') { if (!inChar.pathFind) { ++inChar.missionTimer; if (inChar.missionTimer > 10 && inChar.myStatus == 'idle') { if (SwainMath.randomNumber(0, 90) == 1 || inChar.missionTimer > 90) { var v2; var v10; var v9; var v12 = false; inChar.intendedX = undefined; inChar.intendedY = undefined; for (;;) { if (!(v2 == undefined || MadnessAI.world.determineRoom(inChar.intendedX, inChar.intendedY) == undefined || v2 == inChar.myRoom || v2.amStairs)) break; v2 = MadnessAI.world.myRooms[SwainMath.randomNumber(0, MadnessAI.world.myRooms.length - 1)]; v10 = ((v2.myDR._x + v2.myDL._x) / 2 + (v2.myUR._x + v2.myUL._x) / 2) / 2; v9 = ((v2.myDL._y + v2.myUL._y) / 2 + (v2.myDR._y + v2.myUR._y) / 2) / 2; inChar.intendedX = SwainMath.get_position(v10, v9, SwainMath.randomNumber(-1790, 1800) / 10, SwainMath.randomNumber(0, 100), 'x'); inChar.intendedY = SwainMath.get_position(v10, v9, SwainMath.randomNumber(-1790, 1800) / 10, SwainMath.randomNumber(0, 100), 'y'); } for (;;) { if (!(v2.roomNumber == 0 && SwainMath.calculate_rotation(v2.myDL._x, v2.myDL._y, inChar.intendedX, inChar.intendedY) <= v2.leftAngle)) break; inChar.intendedX += 10; } for (;;) { if (!(v2.roomNumber == MadnessAI.world.myRooms.length - 1 && SwainMath.calculate_rotation(v2.myDR._x, v2.myDR._y, inChar.intendedX, inChar.intendedY) >= v2.rightAngle)) break; inChar.intendedX -= 10; } for (;;) { if (!(SwainMath.calculate_rotation(v2.myUL._x, v2.myUL._y, inChar.intendedX, inChar.intendedY) <= v2.upAngle && SwainMath.calculate_rotation(v2.myUL._x, v2.myUL._y, inChar.intendedX, inChar.intendedY) > 0)) break; inChar.intendedY += 10; } while (SwainMath.calculate_rotation(v2.myDL._x, v2.myDL._y, inChar.intendedX, inChar.intendedY) >= v2.downAngle) { inChar.intendedY -= 10; } inChar.intendedRoom = v2; inChar.pathFind = true; inChar.ignoreRooms = false; inChar.missionTimer = 0; } } } } if (inChar.myMission == 'roam') { if (!inChar.pathFind) { if (inChar.myRoom == MadnessAI.world.myRooms[0]) { inChar.intendedTarget = MadnessAI.world.door2; } else { inChar.intendedTarget = MadnessAI.world.door1; } inChar.intendedX = inChar.intendedTarget._x; inChar.intendedY = inChar.intendedTarget._y; inChar.intendedRoom = MadnessAI.world.determineRoom(inChar.intendedX, inChar.intendedY); inChar.pathFind = true; inChar.ignoreRooms = false; } if (inChar.pathFind) { } } if (inChar.myMission == 'engage') { if (inChar.myDataRef.amSurprised) { inChar.myDataRef.amSurprised = false; } inChar.inRange = false; if (inChar.myRoster.teamAttacker._x == undefined || SwainMath.randomNumber(0, 2) == 0) { if (inChar.myRoster == MadnessRoster.playerRoster || inChar.myDataRef.selfShoot || inChar.myDataRef.myWeapons[inChar.myWeapon].melee || inChar.myDataRef.myWeapons[inChar.myWeapon] == undefined || SwainMath.randomNumber(0, inChar.myRoster.teamFireScore) < 20) { MadnessAI.findRange = inChar.myDataRef.myWeapons[inChar.myWeapon].myRange * (1 + (11 - MadnessAI.getModdedSkill(inChar, 'traitBravery')) / 3); if (MadnessAI.findRange > 600 || inChar.myDataRef.noRange) { MadnessAI.findRange = 600; } if (inChar.myDataRef.myWeapons[inChar.myWeapon].melee) { MadnessAI.findRange = inChar.myDataRef.myWeapons[inChar.myWeapon].myRange * inChar.myDataRef.myScale; } if (inChar.myDataRef.myWeapons[inChar.myWeapon] == undefined) { MadnessAI.findRange = inChar.myDataRef.myUnarmed.myRange * inChar.myDataRef.myScale; } if (MadnessAI.myTarget.invincibleTimer <= 0 && MadnessAI.myTarget != undefined && MadnessAI.myTarget._x < inChar._x + MadnessAI.findRange && MadnessAI.myTarget._x > inChar._x - MadnessAI.findRange) { if (!inChar.myDataRef.myWeapons[inChar.myWeapon].melee) { if (!(inChar.lastHitTimer < 60 && inChar.myDataRef.hitStopAttack)) { inChar.inRange = true; } } else { if (inChar.inMeleeRangeAI(MadnessAI.myTarget)) { inChar.inRange = true; } } } } else {} } if (inChar.inRange) { inChar.shootReady = true; } if (inChar.aimTimer == -1 && inChar.targetObstacle == undefined && !inChar.myDataRef.myWeapons[inChar.myWeapon].melee && inChar.myDataRef.myWeapons[inChar.myWeapon] != undefined) { if (SwainMath.randomNumber(0, 700 - inChar.myDataRef.traitCover * 70) == 0 && !inChar.myDataRef.amSlow) { v4 = 0; while (v4 < MadnessObstacle.allObstacles.length) { if (!MadnessObstacle.allObstacles[v4].inUse && MadnessObstacle.allObstacles[v4].amCover) { if (MadnessObstacle.allObstacles[v4]._x < inChar._x + 300 + inChar.myDataRef.traitCover * 5 && MadnessObstacle.allObstacles[v4]._x > inChar._x - 300 - inChar.myDataRef.traitCover * 5) { if (MadnessAI.myTarget._x > inChar._x && MadnessObstacle.allObstacles[v4]._x > inChar._x || MadnessAI.myTarget._x < inChar._x && MadnessObstacle.allObstacles[v4]._x < inChar._x) { inChar.attractToMC(MadnessObstacle.allObstacles[v4], 'cover'); if (MadnessAI.myTarget._x > inChar._x) { inChar.intendedX = inChar.intendedTarget._x - SwainMath.randomNumber(inChar.intendedTarget.myWidth * 0.5, inChar.intendedTarget.myWidth * 0.9); } else { inChar.intendedX = inChar.intendedTarget._x + SwainMath.randomNumber(inChar.intendedTarget.myWidth * 0.5, inChar.intendedTarget.myWidth * 0.9); } inChar.intendedY = inChar.intendedTarget._y + SwainMath.randomNumber(5, 20); break; } } } ++v4; } } } if (inChar.targetObstacle != undefined && inChar.targetObstacle.inUse != undefined) { MadnessAI.thisWeapon = MadnessAI.myTarget.myDataRef.myWeapons[MadnessAI.myTarget.myWeapon]; inChar.toggleGuard = false; if (MadnessAI.thisWeapon.melee || MadnessAI.thisWeapon == undefined || MadnessAI.myTarget._x == undefined || MadnessAI.myTarget._x < inChar._x && inChar._x < inChar.targetObstacle._x || MadnessAI.myTarget._x > inChar._x && inChar._x > inChar.targetActivator._x) { if (SwainMath.randomNumber(0, inChar.myDataRef.traitDistracted * 10) == 0) { inChar.toggleGuard = true; } } } else { if (MadnessAI.myTarget.myStatus.substr(0, 5) == 'melee' || MadnessAI.myTarget.myStatus.substr(0, 7) == 'unarmed' || !MadnessAI.thisWeapon.melee && (MadnessAI.myTarget.rofTimer == 1 || MadnessAI.myTarget.rofTimer < 30 && MadnessDataFile.havePerk('perkBlock1', inChar.myDataRef))) { if (!inChar.myDataRef.amSlow && inChar.aimTimer == -1) { if ((MadnessAI.thisWeapon.melee || MadnessAI.thisWeapon == undefined) && inChar.myDataRef.myWeapons[inChar.myWeapon].melee && (SwainMath.randomNumber(0, 20 - MadnessAI.getModdedSkill(inChar, 'traitCombatSkill') * 2) == 0 || inChar.lifeSpan < 15) || (MadnessAI.thisWeapon.melee || MadnessAI.thisWeapon == undefined) && (SwainMath.randomNumber(0, (15 - MadnessAI.getModdedSkill(inChar, 'traitCombatSkill')) * 9) == 0 || inChar.lifeSpan < 15) || !(MadnessAI.thisWeapon.melee || MadnessAI.thisWeapon == undefined) && (SwainMath.randomNumber(0, (11 - MadnessAI.getModdedSkill(inChar, 'traitCombatSkill')) * 4) == 0 || inChar.lifeSpan < 15)) { if (inChar.myDataRef.myWeapons[inChar.myWeapon].melee && (MadnessAI.thisWeapon.melee || MadnessAI.thisWeapon == undefined || !MadnessAI.thisWeapon.melee && MadnessDataFile.havePerk('perkBlock1', inChar.myDataRef)) || !inChar.myDataRef.myWeapons[inChar.myWeapon].melee && MadnessAI.getModdedSkill(inChar, 'traitCombatSkill') > 1) { if (MadnessAI.thisWeapon.melee && MadnessAI.myTarget.inMeleeRange(inChar) && (inChar._x > MadnessAI.myTarget._x && inChar._x < MadnessAI.myTarget._x + MadnessAI.thisWeapon.myRange && MadnessAI.myTarget.myFacing == 'right' || inChar._x < MadnessAI.myTarget._x && inChar._x > MadnessAI.myTarget._x - MadnessAI.thisWeapon.myRange && MadnessAI.myTarget.myFacing == 'left') || !MadnessAI.thisWeapon.melee && SwainMath.getRotDistance(SwainMath.calculate_rotation(MadnessAI.myTarget._x, MadnessAI.myTarget._y, inChar._x, inChar._y), SwainMath.calculate_rotation(MadnessAI.myTarget._x, MadnessAI.myTarget._y - MadnessAI.myTarget.myDataRef.myShootHeight, MadnessAI.myTarget.myAimX, MadnessAI.myTarget.myAimY)) < 30) { inChar.toggleGuard = true; } } } } } else { inChar.toggleGuard = false; } } if (inChar._x < MadnessAI.myTarget._x && inChar.myFacing == 'left' && !inChar.pathFind && SwainMath.randomNumber(0, inChar.traitDistracted * 2) == 0) { inChar.moveRight = true; } if (inChar._x > MadnessAI.myTarget._x && inChar.myFacing == 'right' && !inChar.pathFind && SwainMath.randomNumber(0, inChar.traitDistracted * 2) == 0) { inChar.moveLeft = true; } if (inChar._x < MadnessAI.myTarget._x && inChar.intendedX > MadnessAI.myTarget._x || inChar._x > MadnessAI.myTarget._x && inChar.intendedX < MadnessAI.myTarget._x) { inChar.pathFind = false; } if (inChar.myStatus == 'idle' && SwainMath.randomNumber(0, (11 - inChar.traitDistracted) * 3) == 0) { inChar.pathFind = true; inChar.intendedX = inChar._x + SwainMath.randomNumber(-30, 30); inChar.intendedY = inChar._y + SwainMath.randomNumber(-50, 50); } MadnessAI.findRange = inChar.myDataRef.myWeapons[inChar.myWeapon].myRange * 0.95; if (inChar.myDataRef.myWeapons[inChar.myWeapon].myAmmo == 0) { MadnessAI.findRange = inChar.myDataRef.myWeapons[inChar.myWeapon].myRange * 3; } if (MadnessAI.findRange > 600) { MadnessAI.findRange = 600; } if (inChar.myDataRef.myWeapons[inChar.myWeapon].melee) { MadnessAI.findRange = inChar.myDataRef.myWeapons[inChar.myWeapon].myRange * 0.9; } if (inChar.myDataRef.myWeapons[inChar.myWeapon] == undefined) { MadnessAI.findRange = inChar.myDataRef.myUnarmed.myRange * 0.9; } if (inChar.intendedX == undefined || (!inChar.inRange || SwainMath.randomNumber(0, inChar.traitDistracted * 30) == 0 && inChar.myDataRef.myWeapons[inChar.myWeapon].myROF > 15 || inChar.intendedX < MadnessAI.myTarget._x - 400 || inChar.intendedX > MadnessAI.myTarget._x + 400) && !inChar.pathFind) { var v8; var v7 = 25; if (inChar.myDataRef.myWeapons[inChar.myWeapon].melee) { v7 = 5; } var v11 = MadnessAI.findRange; if (inChar._x < MadnessAI.myTarget._x) { v8 = SwainMath.randomNumber(-(90 + v7) * 10, -(90 - v7) * 10) / 10; v10 = SwainMath.get_position(MadnessAI.myTarget._x, MadnessAI.myTarget._y, v8, v11, 'x'); v9 = SwainMath.get_position(MadnessAI.myTarget._x, MadnessAI.myTarget._y, v8, v11, 'y'); } else { v8 = SwainMath.randomNumber((90 - v7) * 10, (90 + v7) * 10) / 10; v10 = SwainMath.get_position(MadnessAI.myTarget._x, MadnessAI.myTarget._y, v8, v11, 'x'); v9 = SwainMath.get_position(MadnessAI.myTarget._x, MadnessAI.myTarget._y, v8, v11, 'y'); } if (MadnessAI.world.determineRoom(v10, v9) != undefined && !MadnessObstacle.returnInsideObstacle(v10, v9, inChar.myWidth)) { if (v7 < 80) { v7 += 2; } inChar.intendedX = v10; inChar.intendedY = v9; inChar.intendedTarget = undefined; inChar.intendedRoom = MadnessAI.world.determineRoom(inChar.intendedX, inChar.intendedY); inChar.pathFind = true; inChar.ignoreRooms = false; } } if (inChar.myDataRef.traitBravery == -1) { inChar.myMission = 'surrender'; inChar.deserterSurrender(); } } else { inChar.inRange = false; } if (inChar.myMission == 'retreat') { } if (inChar.myMission == 'surrender') { if (inChar.myStatus == 'idle' || inChar.myStatus == 'run' || inChar.myStatus == 'dash') { inChar.myStatus = 'surrender'; inChar.mySubStatus = String(1); if (inChar.myDataRef.myWeapons[inChar.myWeapon] != undefined) { inChar.dropGun(); } } } if (inChar.myMission == 'follow') { if (MadnessAI.myLeader == undefined) { inChar.myMission = 'engage'; } else { if ((inChar.intendedX == undefined || PulseTimer.getActive(inChar.myPulseNumber, 1)) && SwainMath.get_distance(inChar, MadnessAI.myLeader) > 150) { if (MadnessAI.myLeader._x > inChar._x) { inChar.intendedX = MadnessAI.myLeader._x - SwainMath.randomNumber(60, 120); inChar.intendedY = MadnessAI.myLeader._y + SwainMath.randomNumber(-30, 30); } else { inChar.intendedX = MadnessAI.myLeader._x + SwainMath.randomNumber(60, 120); inChar.intendedY = MadnessAI.myLeader._y + SwainMath.randomNumber(-30, 30); } inChar.intendedTarget = MadnessAI.myLeader; inChar.intendedRoom = MadnessAI.world.determineRoom(inChar.intendedX, inChar.intendedY); inChar.pathFind = true; inChar.ignoreRooms = false; } } } if (MadnessAI.myTarget._x != undefined) { inChar.myAimX = MadnessAI.myTarget._x; inChar.myAimY = MadnessAI.myTarget._y - MadnessAI.myTarget.myDataRef.myHeight + 30; } else { if (inChar.rofTimer > inChar.myDataRef.myWeapons[inChar.myWeapon].myROF || inChar.rofTimer <= 1) { MadnessAI.myTarget = undefined; if (inChar.myFacing == 'left') { inChar.myAimX = inChar._x - 50; } else { inChar.myAimX = inChar._x + 50; } inChar.myAimY = inChar._y - inChar.myDataRef.myShootHeight - 15; } } if (inChar.lifeSpan > 30) { ++inChar.shotTimer; if (inChar.inRange && (SwainMath.randomNumber(0, 60 - inChar.traitTriggerFinger * 5) == 0 || inChar.myDataRef.myWeapons[inChar.myWeapon].myROF <= 10 && SwainMath.randomNumber(-4, inChar.traitTriggerFinger) > 0 && inChar.rofTimer < inChar.myDataRef.myWeapons[inChar.myWeapon].myROF + 2)) { inChar.shotTimer = 0; inChar.mouseClick = true; inChar.mouseHold = true; } } if (inChar.myDataRef.myWeapons[inChar.myWeapon].myAmmo == 0 && inChar.myDataRef.myWeapons[inChar.myWeapon].myClips > 0) { if (inChar.aimTimer == -1) { inChar.toggleReload = true; } } if (SwainMath.randomNumber(0, inChar.traitDistracted * 4) == 0) { if (inChar.myDataRef.myWeapons[inChar.myWeapon].myAmmo == 0 && inChar.myDataRef.myWeapons[inChar.myWeapon].myClips == 0 && MadWorld.activeFactions.length > 1) { if (!MadnessDataFile.havePerk('perkSidearm1', inChar.myDataRef) || inChar.myDataRef.myWeapons[1 - inChar.myWeapon].myAmmo == 0 && inChar.myDataRef.myWeapons[1 - inChar.myWeapon].myClips == 0) { inChar.dropGun(); } } if (inChar.myDataRef.myWeapons[inChar.myWeapon].myAmmo == 0 && inChar.myDataRef.myWeapons[inChar.myWeapon].myClips == 0 || inChar.myDataRef.myWeapons[inChar.myWeapon] == undefined && inChar.myDataRef.myWeapons[1 - inChar.myWeapon] != undefined && MadWorld.activeFactions.length > 1) { if (inChar.myDataRef.myWeapons[1 - inChar.myWeapon].myAmmo > 0 || inChar.myDataRef.myWeapons[1 - inChar.myWeapon].myClips > 0 || inChar.myDataRef.myWeapons[1 - inChar.myWeapon].melee || inChar.myDataRef.myWeapons[1 - inChar.myWeapon] == undefined || inChar.myDataRef.myWeapons[1 - inChar.myWeapon].myAmmo > 0 || inChar.myDataRef.myWeapons[1 - inChar.myWeapon].myClips > 0) { if (!inChar.myDataRef.amSurprised) { inChar.toggleAction = true; } } } if (inChar.myMission == 'engage') { if (inChar.myDataRef.freakOut) { if (inChar.freakOutTimer > 0 && inChar.myWeapon == 0 || inChar.freakOutTimer == 0 && inChar.myWeapon == 1) { if (inChar.myDataRef.myWeapons[0] != undefined && inChar.myDataRef.myWeapons[1] != undefined) { inChar.toggleAction = true; } } } else { if (SwainMath.randomNumber(0, 30) == 0 && inChar.myDataRef.myWeapons[1 - inChar.myWeapon] != undefined && (inChar.myDataRef.myWeapons[1 - inChar.myWeapon].myAmmo > 0 || inChar.myDataRef.myWeapons[1 - inChar.myWeapon].melee)) { inChar.toggleAction = true; } } } if (!inChar.thrownHook && inChar.myDataRef.myScale == 1 && !inChar.targetLock && inChar.myDataRef.myLevel >= 5 && SwainMath.randomNumber(0, inChar.traitDistracted * 3 - inChar.myDataRef.myLevel) <= 0 && inChar.myDataRef.myWeapons[inChar.myWeapon] == undefined && (inChar.myDataRef.myWeapons[1 - inChar.myWeapon] == undefined || inChar.myDataRef.myWeapons[1 - inChar.myWeapon].myAmmo == 0 && inChar.myDataRef.myWeapons[1 - inChar.myWeapon].myClips == 0)) { inChar.targetPickup = inChar.findClosestPickup(); if (inChar.targetPickup != undefined && (inChar.targetPickup.myGun.myAmmo > 0 || inChar.targetPickup.myGun.myClips > 0)) { inChar.attractToMC(inChar.targetPickup, 'pickup'); } } } if (inChar.myDataRef.myCharacter == 'fatboy') { if (inChar.myDataRef.myWeapons[inChar.myWeapon].melee && inChar.myDataRef.myHat[0] == undefined && inChar.myDataRef.myWeapons[1 - inChar.myWeapon].myAmmo > 0) { if (inChar._y < MadnessAI.myTarget._y + 20 && inChar._y > MadnessAI.myTarget._y - 20 && (inChar.myFacing == 'left' && MadnessAI.myTarget._x < inChar._x || inChar.myFacing == 'right' && MadnessAI.myTarget._x > inChar._x)) { inChar.togglePickup = true; } } } if (inChar.myDataRef.myWeapons[inChar.myWeapon].myType == 'hook') { if (inChar._y < MadnessAI.myTarget._y + 20 && inChar._y > MadnessAI.myTarget._y - 20 && (inChar.myFacing == 'left' && MadnessAI.myTarget._x < inChar._x || inChar.myFacing == 'right' && MadnessAI.myTarget._x > inChar._x)) { if (MadnessAI.myTarget._x > inChar._x + 90 || MadnessAI.myTarget._x < inChar._x - 90) { inChar.togglePickup = true; } } } if (inChar.hittingObstacle) { } inChar.myAttackTarget = MadnessAI.myTarget; }; v1.getModdedSkill = function (inChar, inSkill) { var v1 = inChar.myDataRef[inSkill]; if (inChar.myRoster.teamLeader != inChar.myDataRef) { if (inChar.myRoster == MadnessRoster.playerRoster) { if (inChar.myRoster.teamLeader.statLEAD != undefined) { v1 += Math.floor(inChar.myRoster.teamLeader.statLEAD / 5); } } else { if (MadnessRoster.playerRoster.teamLeader.statLEAD) { v1 -= Math.floor(MadnessRoster.playerRoster.teamLeader.statLEAD / 5); } } } if (v1 > 10) { v1 = 10; } if (v1 < 1) { v1 = 1; } return v1; }; ASSetPropFlags(_global.MadnessAI.prototype, null, 1); } #endinitclip } movieClip 4829 __Packages.PulseTimer { #initclip if (!_global.PulseTimer) { var v1 = function () { super(); this.onEnterFrame = this.tick; }; _global.PulseTimer = v1; _global.PulseTimer extends MovieClip; var v2 = v1.prototype; v2.tick = function () { ++PulseTimer.myCount; if (PulseTimer.myCount > PulseTimer.maxCount) { PulseTimer.myCount = 0; } }; v1.getActive = function (inCount, inRatio) { var v2 = 1; while (v2 <= inRatio) { inCount += Math.floor(PulseTimer.maxCount / v2); while (inCount > PulseTimer.maxCount) { inCount -= PulseTimer.maxCount; } if (inCount == PulseTimer.myCount) { return true; break; } ++v2; } return false; }; v1.myCount = new Number(); v1.maxCount = 30; ASSetPropFlags(_global.PulseTimer.prototype, null, 1); } #endinitclip } movieClip 4830 __Packages.SpeedFrameSkipper { #initclip if (!_global.SpeedFrameSkipper) { var v1 = function () {}; _global.SpeedFrameSkipper = v1; var v2 = v1.prototype; v1.adjustFrames = function (inMC, inSpeed) { if (!_root.newWorld.paused) { if (inMC._currentframe < inMC._totalframes) { var v2 = 0; while (v2 <= inSpeed) { inMC.nextFrame(); ++v2; } } else { inMC.gotoAndPlay(1); var v2 = 1; while (v2 <= inSpeed) { inMC.nextFrame(); ++v2; } } } }; ASSetPropFlags(_global.SpeedFrameSkipper.prototype, null, 1); } #endinitclip } movieClip 4831 __Packages.MadnessWorldMap { #initclip if (!_global.MadnessWorldMap) { var v1 = function () { super(); }; _global.MadnessWorldMap = v1; _global.MadnessWorldMap extends MovieClip; var v2 = v1.prototype; v2.init = function () { var v4 = 0; this.gotoAndStop(v4 + 1); var v3 = MadnessGameSelect['storyProgressWorld' + String(v4)]; if (v4 == 0) { this.button0._visible = true; this.hilightLevel(0, true); this.targetArrow._x = this.level0._x; this.targetArrow._y = this.level0._y; } var v2 = 0; while (v2 < v3.length) { this['button' + (v2 + 1)]._visible = v3[v2]; this.hilightLevel(v2 + 1, v3[v2]); if (v3[v2 - 1]) { this.targetArrow._x = this['level' + v2]._x; this.targetArrow._y = this['level' + v2]._y; } ++v2; } SwainAudioPlayer.playTrack('menu'); }; v2.cheatOpenAll = function () { var v4 = 0; var v3 = MadnessGameSelect['storyProgressWorld' + String(v4)]; var v2 = 0; while (v2 < v3.length) { if (!v3[v2]) { v3[v2] = true; break; } ++v2; } MadnessGameSelect.saveGame(); this.init(); }; v2.initiateStage = function () { if (!MadnessTransition.transitionLock) { MadnessGameSelect.gameStarted(); if (MadnessLevel.currentLevel.myCutsceneStart != undefined) { MadnessCutscene.storeCutsceneInfo(MadnessLevel.currentLevel.myCutsceneStart, 'room', MadnessLevel.startPoint); _root.createTransition('fade', 'cutscene', null); } else { _root.createTransition('fade', 'room', MadnessLevel.startPoint); } SwainAudioPlayer.playSound('menu4', 0); } }; v2.pickStage = function (inWorld, inLevel) { MadnessPopup.closeAll(); _root.generateLevel(inWorld, inLevel); MadnessPopup.addPopup('mission', MadnessLevel.currentLevel.myDescription, null, 425, 110, MadnessLevel.currentLevel, -1, this.initiateStage, MadnessPopup.closeAll); this.buttonRollOver(inLevel, false); SwainAudioPlayer.playSound('menu1', 0); }; v1.pickArena = function (inStartWave) { if (!MadnessTransition.transitionLock) { _root.generateArena(inStartWave); _root.createTransition('fade', 'room', MadnessLevel.startPoint); SwainAudioPlayer.playSound('menu4', 0); } }; v2.buttonRollOver = function (inLevel, inRollOver) { var v3 = this['level' + inLevel]; var v4 = new Color(v3); var v2; if (inRollOver) { v2 = {'rb': 180, 'gb': 40, 'bb': 40}; SwainAudioPlayer.playSound('menu2', 0); } else { v2 = {'rb': 0, 'gb': 0, 'bb': 0}; } v4.setTransform(v2); }; v2.hilightLevel = function (inLevel, inHi) { var v2 = this['level' + inLevel]; var v4 = new Color(v2); var v3; var v5 = new flash.filters.GlowFilter(16711680, 100, 10, 10, 2.3, 1, false, false); if (inHi) { v3 = {'rb': 0, 'gb': 0, 'bb': 0}; v2.filters = [v5]; } else { v3 = {'rb': -50, 'gb': -50, 'bb': -50}; v2.filters = undefined; delete v2.filters; } v4.setTransform(v3); }; v2.pressMenu = function () { if (!MadnessTransition.transitionLock && MadnessPopup.returnSkipable()) { _root.createTransition('fade', 'quit', null); SwainAudioPlayer.playSound('menu4', 0); } }; ASSetPropFlags(_global.MadnessWorldMap.prototype, null, 1); } #endinitclip } movieClip 1184 __Packages.com.newgrounds.APIConnection { #initclip if (!_global.com) { _global.com = new Object(); } if (!_global.com.newgrounds) { _global.com.newgrounds = new Object(); } if (!_global.com.newgrounds.APIConnection) { var v1 = function () { this.reset(); }; com.newgrounds.APIConnection = v1; var v2 = v1.prototype; v2.__get__hostURL = function () { return this._hostURL; }; v2.__set__hostURL = function (value) { this._hostURL = value; this.hostDomain = null; if (this._hostURL) { var v2 = this._hostURL.split('/'); if (v2[0] != 'file:' && this._hostURL != 'localhost') { this.hostDomain = v2[2]; } } if (!this.hostDomain) { this.hostDomain = 'localhost'; } return this.__get__hostURL(); }; v2.__get__sandboxType = function () { return System.security.sandboxType; }; v2.__get__isNetworkHost = function () { switch (this.__get__sandboxType()) { return true; case 'localWithFile': case 'localWithNetwork': case 'localTrusted': case 'application': return false; case 'remote': } return true; }; v2.__get__hasUserSession = function () { return this.sessionId != null && this.sessionId != '' && this.publisherId != 0; }; v2.__get__connected = function () { return this.connectionState == com.newgrounds.APIConnection.CONNECTED; }; v2.reset = function () { this.connectionState = com.newgrounds.APIConnection.NOT_CONNECTED; this.encryptionKey = null; this.sessionId = null; this.userEmail = null; this.username = null; this.userId = 0; this.userpageFormat = 0; }; v2.assertInitialized = function () { if (!this.initialized) { com.newgrounds.Logger.logError('You must initialized the API using API.connect() before using this command.'); return false; } return true; }; v2.assertConnected = function () { if (!this.connectionState == com.newgrounds.APIConnection.CONNECTED) { com.newgrounds.Logger.logError('You must establish a connection using API.connect() before using this command.'); return false; } return true; }; v2.sendSimpleCommand = function (command, completeHandler, parameters, secureParameters) { if (parameters == undefined) { parameters = null; } if (secureParameters == undefined) { secureParameters = null; } var v2 = new com.newgrounds.APICommand(command); v2.__set__parameters(parameters); v2.__set__secureParameters(secureParameters); if (completeHandler != null) { v2.addEventListener(com.newgrounds.APIEvent.COMMAND_COMPLETE, completeHandler); } v2.send(this); }; v2.sendCommand = function (command) { command.send(this); }; v2.loadInBrowser = function (command, newWindow, parameters) { if (newWindow == undefined) { newWindow = true; } if (parameters == undefined) { parameters = null; } var v2 = new com.newgrounds.APICommand(command); v2.__set__parameters(parameters); v2.loadInBrowser(this, newWindow); }; v1.NOT_CONNECTED = 'notConnected'; v1.CONNECTING = 'connecting'; v1.CONNECTED = 'connected'; v2.connectionState = com.newgrounds.APIConnection.NOT_CONNECTED; v2.apiURL = 'http://www.ngads.com/gateway_v2.php'; v2.addProperty('connected', v2.__get__connected, function () {}); v2.addProperty('hasUserSession', v2.__get__hasUserSession, function () {}); v2.addProperty('hostURL', v2.__get__hostURL, v2.__set__hostURL); v2.addProperty('isNetworkHost', v2.__get__isNetworkHost, function () {}); v2.addProperty('sandboxType', v2.__get__sandboxType, function () {}); ASSetPropFlags(com.newgrounds.APIConnection.prototype, null, 1); } #endinitclip } movieClip 1178 __Packages.com.newgrounds.EventDispatcher { #initclip if (!_global.com) { _global.com = new Object(); } if (!_global.com.newgrounds) { _global.com.newgrounds = new Object(); } if (!_global.com.newgrounds.EventDispatcher) { var v1 = function () { this._listeners = {}; }; com.newgrounds.EventDispatcher = v1; var v2 = v1.prototype; v2.addEventListener = function (type, listener) { if (!this._listeners[type]) { this._listeners[type] = []; } if (typeof listener == 'function') { this._listeners[type].push({'target': null, 'func': listener}); } else { this._listeners[type].push(listener); } }; v2.removeEventListener = function (type, listener) { var v3 = this._listeners[type]; if (v3) { var v5 = v3.length; var v2 = 0; while (v2 < v5) { if (v3[v2].func == listener || v3[v2] == listener) { v3.splice(v2, 1); return undefined; } ++v2; } } }; v2.dispatchEvent = function (event) { var v4 = this._listeners[event.__get__type()]; if (v4) { var v5 = v4.length; var v2 = 0; while (v2 < v5) { var v3 = v4[v2]; v3.func.call(v3.target, event); ++v2; } } return true; }; ASSetPropFlags(com.newgrounds.EventDispatcher.prototype, null, 1); } #endinitclip } movieClip 1177 __Packages.com.newgrounds.Event { #initclip if (!_global.com) { _global.com = new Object(); } if (!_global.com.newgrounds) { _global.com.newgrounds = new Object(); } if (!_global.com.newgrounds.Event) { var v1 = function (type) { this._type = type; }; com.newgrounds.Event = v1; var v2 = v1.prototype; v2.__get__type = function () { return this._type; }; v2.addProperty('type', v2.__get__type, function () {}); ASSetPropFlags(com.newgrounds.Event.prototype, null, 1); } #endinitclip } movieClip 1179 __Packages.com.newgrounds.APIEventDispatcher { #initclip if (!_global.com) { _global.com = new Object(); } if (!_global.com.newgrounds) { _global.com.newgrounds = new Object(); } if (!_global.com.newgrounds.APIEventDispatcher) { var v1 = function () { super(); }; com.newgrounds.APIEventDispatcher = v1; com.newgrounds.APIEventDispatcher extends com.newgrounds.EventDispatcher; var v2 = v1.prototype; v1.__get__globalDispatcher = function () { return com.newgrounds.APIEventDispatcher._globalDispatcher; }; v1.__set__globalDispatcher = function (value) { com.newgrounds.APIEventDispatcher._globalDispatcher = value; return com.newgrounds.APIEventDispatcher.__get__globalDispatcher(); }; v1.initEventQueue = function () { setInterval(com.newgrounds.APIEventDispatcher.runEventQueue, 50); return []; }; v2.dispatchEvent = function (event) { com.newgrounds.APIEventDispatcher._eventQueue.push({'dispatcher': this, 'event': event}); return true; }; v2.actualDispatchEvent = function (event) { var v3 = super.dispatchEvent(event); if (com.newgrounds.APIEventDispatcher._globalDispatcher && this != com.newgrounds.APIEventDispatcher._globalDispatcher) { com.newgrounds.APIEventDispatcher._globalDispatcher.dispatchEvent(event); } }; v1.runEventQueue = function (event) { var v3 = com.newgrounds.APIEventDispatcher._eventQueue.length; if (v3) { var v4 = com.newgrounds.APIEventDispatcher._eventQueue; com.newgrounds.APIEventDispatcher._eventQueue = []; var v1 = 0; while (v1 < v3) { var v2 = v4[v1]; v2.dispatcher.actualDispatchEvent(v2.event); ++v1; } } }; v1._eventQueue = com.newgrounds.APIEventDispatcher.initEventQueue(); v1.addProperty('globalDispatcher', v1.__get__globalDispatcher, v1.__set__globalDispatcher); ASSetPropFlags(com.newgrounds.APIEventDispatcher.prototype, null, 1); } #endinitclip } movieClip 1182 __Packages.com.newgrounds.encoders.BaseN { #initclip if (!_global.com) { _global.com = new Object(); } if (!_global.com.newgrounds) { _global.com.newgrounds = new Object(); } if (!_global.com.newgrounds.encoders) { _global.com.newgrounds.encoders = new Object(); } if (!_global.com.newgrounds.encoders.BaseN) { var v1 = function (hash) { if (hash) { this._hash = hash; } else { this._hash = com.newgrounds.encoders.BaseN.DEFAULT_HASH; } this._base = this._hash.length; this._reverseHash = new Object(); var v2 = 0; while (v2 < this._hash.length) { this._reverseHash[this._hash.charAt(v2)] = v2; ++v2; } }; com.newgrounds.encoders.BaseN = v1; var v2 = v1.prototype; v2.encodeUint = function (number, minimumChars) { if (minimumChars == undefined) { minimumChars = 1; } var v2 = ''; var v3 = number; while (v3 != 0) { v2 = this._hash.charAt(v3 % this._base) + v2; v3 /= this._base; v3 = int(v3); } while (v2.length < minimumChars) { v2 = this._hash.charAt(0) + v2; } return v2; }; v2.decodeUint = function (encodedNumber) { var v3 = 0; var v2 = 0; while (v2 < encodedNumber.length) { v3 *= this._base; v3 += this._reverseHash[encodedNumber.charAt(v2)]; ++v2; } return v3; }; v1.DEFAULT_HASH = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ`~@#$%^&*()+|;/'; ASSetPropFlags(com.newgrounds.encoders.BaseN.prototype, null, 1); } #endinitclip } movieClip 1188 __Packages.com.newgrounds.APICommand { #initclip if (!_global.com) { _global.com = new Object(); } if (!_global.com.newgrounds) { _global.com.newgrounds = new Object(); } if (!_global.com.newgrounds.APICommand) { var v1 = function (command) { super(); this._command = command; this._parameters = new Object(); this._secureParameters = new Object(); this._hasTimeout = true; }; com.newgrounds.APICommand = v1; com.newgrounds.APICommand extends com.newgrounds.APIEventDispatcher; var v2 = v1.prototype; v1.stopPendingCommands = function () { for (var v2 in com.newgrounds.APICommand._pendingCommands) { var v1 = com.newgrounds.APICommand._pendingCommands[v2]; v1.close(); } com.newgrounds.APICommand._pendingCommands = []; }; v1.onThrottleTimer = function (event) { if (getTimer() - com.newgrounds.APICommand._throttleTimestamp >= com.newgrounds.APICommand.THROTTLE_INTERVAL) { com.newgrounds.APICommand._throttleCount = 0; com.newgrounds.APICommand._throttleCount = 0; for (;;) { if (!(com.newgrounds.APICommand._commandQueue.length && com.newgrounds.APICommand._throttleCount < com.newgrounds.APICommand.THROTTLE_THRESHOLD)) break; var v1 = com.newgrounds.APICommand._commandQueue.shift(); v1.command.send(v1.connection); ++com.newgrounds.APICommand._throttleCount; } } }; v1.encryptHex = function (hexValue) { var v4 = hexValue.length % 6; var v3 = ''; var v1 = 0; while (v1 < hexValue.length) { v3 += com.newgrounds.APICommand._encryptor.encodeUint(int('0x' + hexValue.substr(v1, 6)), 4); v1 += 6; } return v4.toString() + v3; }; v2.__get__command = function () { return this._command; }; v2.__set__command = function (value) { this._command = value; return this.__get__command(); }; v2.__get__hasTimeout = function () { return this._hasTimeout; }; v2.__set__hasTimeout = function (val) { this._hasTimeout = val; return this.__get__hasTimeout(); }; v2.__get__parameters = function () { return this._parameters; }; v2.__set__parameters = function (object) { this._parameters = new Object(); if (object) { for (var v3 in object) { this._parameters[v3] = object[v3]; } } return this.__get__parameters(); }; v2.__get__preventCache = function () { return this._preventCache; }; v2.__set__preventCache = function (value) { this._preventCache = value; return this.__get__preventCache(); }; v2.__get__secureParameters = function () { return this._secureParameters; }; v2.__set__secureParameters = function (object) { this._secureParameters = new Object(); if (object) { for (var v3 in object) { this._secureParameters[v3] = object[v3]; } } return this.__get__secureParameters(); }; v2.__get__hasSecureParameters = function () { for (var v2 in this._secureParameters) { return true; } return false; }; v2.addFile = function (filename, data, dataField, contentType) { if (contentType == undefined) { contentType = 'application/octet-stream'; } if (!this._files) { this._files = new Object(); } var v3 = {'filename': filename, 'data': data, 'dataField': dataField, 'contentType': contentType}; this._files[filename] = v3; }; v2.removeFile = function (filename) { if (this._files) { delete this._files[filename]; } }; v2.clearFiles = function () { this._files = null; }; v2.close = function () { if (this._loader) { clearInterval(this._timeoutTimer); var v2 = 0; while (v2 < com.newgrounds.APICommand._pendingCommands.length) { if (com.newgrounds.APICommand._pendingCommands[v2] == this) { com.newgrounds.APICommand._pendingCommands.splice(v2, 1); break; } ++v2; } this._loader = null; } }; v2.loadInBrowser = function (connection, newWindow) { this._parameters.command_id = this._command; this._parameters.tracker_id = connection.apiId ? connection.apiId : 1; if (connection.debug) { this._parameters.debug = 1; } var v3 = connection.apiURL + '?host=' + escape(connection.hostDomain); for (var v4 in this._parameters) { v3 += '&' + escape(v4) + '=' + escape(this._parameters[v4]); } var v6; if (newWindow) { v6 = '_blank'; } else { v6 = '_top'; } _root.getURL(v3, v6); }; v2.send = function (connection) { if (com.newgrounds.APICommand._throttleCount >= com.newgrounds.APICommand.THROTTLE_THRESHOLD) { com.newgrounds.APICommand._commandQueue.push({'connection': connection, 'command': this}); } else { this.sendInternal(connection); } }; v2.sendInternal = function (connection) { var v4; v4 = new LoadVars(); v4.command_id = this._command; v4.tracker_id = connection.apiId; if (connection.debug) { v4.debug = 1; } if (this._preventCache) { v4.seed = Math.random(); } var v2; var v3; var v7; for (v2 in this._parameters) { v3 = this._parameters[v2]; if (v3 != null) { if (typeof v3 == 'boolean') { v4[v2] = int(v3); } else { v4[v2] = v3; } } } if (this.__get__hasSecureParameters()) { var v6 = new Object(); for (v2 in this._secureParameters) { v3 = this._secureParameters[v2]; if (v3 != null) { if (typeof v3 == 'boolean') { v6[v2] = int(v3); } else { v6[v2] = v3; } } } var v8 = ''; v7 = 0; while (v7 < 16) { v8 += com.newgrounds.APICommand.ENCRYPTOR_RADIX.charAt(int(Math.random() * com.newgrounds.APICommand.ENCRYPTOR_RADIX.length)); ++v7; } v4.command_id = 'securePacket'; v6.command_id = this._command; v6.as_version = 3; v6.session_id = connection.sessionId; v6.user_email = connection.userEmail; v6.publisher_id = connection.publisherId; v6.seed = v8; var v13 = com.newgrounds.crypto.MD5.hash(v8); var v11 = com.newgrounds.crypto.RC4.encrypt(com.newgrounds.encoders.json.JSON.encode(v6), connection.encryptionKey); v4.secure = com.newgrounds.APICommand.encryptHex(v13 + v11); } com.newgrounds.Logger.logInternal('Sending packet:', v4); var v12; v12 = 'application/x-www-form-urlencoded'; for (v2 in v4) { if (typeof v4[v2] == 'object') { v4[v2] = com.newgrounds.encoders.json.JSON.encode(v4[v2]); } } if (this._files) { for (var v10 in this._files) { var v5 = this._files[v10]; if (typeof v5.data == 'string') { v4[v10] = v5.data; } else { v4[v10] = com.newgrounds.encoders.json.JSON.encode(v5.data); } } } com.newgrounds.APICommand._pendingCommands.push(this); ++com.newgrounds.APICommand._throttleCount; com.newgrounds.APICommand._throttleTimestamp = getTimer(); this.startLoader(connection.apiURL, v4, v12); }; v2.startLoader = function (url, data, contentType) { this._loader = LoadVars(data); this._loader.onData = this.as2CompleteHandler; this._loader.contentType = contentType; this._loader.sendAndLoad(url, this._loader, 'POST'); if (this._hasTimeout) { setInterval(this, this.onTimeout, com.newgrounds.APICommand.TIMEOUT_INTERVAL); } }; v2.as2CompleteHandler = function (data) { var v3; var v2 = 0; while (v2 < com.newgrounds.APICommand._pendingCommands.length) { if (com.newgrounds.APICommand._pendingCommands[v2]._loader == this) { v3 = com.newgrounds.APICommand._pendingCommands[v2]; break; } ++v2; } v3.onComplete(data); }; v2.onTimeout = function (event) { this.close(); com.newgrounds.Logger.logError('Command timed out.'); this.dispatchEvent(new com.newgrounds.APIEvent(com.newgrounds.APIEvent.COMMAND_COMPLETE, null, com.newgrounds.APIEvent.ERROR_TIMED_OUT)); }; v2.onError = function (error) { com.newgrounds.Logger.logError('Error when sending command:', error); this.dispatchEvent(new com.newgrounds.APIEvent(com.newgrounds.APIEvent.COMMAND_COMPLETE, null, com.newgrounds.APIEvent.ERROR_UNKNOWN)); this.close(); }; v2.onComplete = function (data) { try { if (!data || data == '') { throw new Error(); } com.newgrounds.Logger.logInternal('Received packet:', data); var v2 = com.newgrounds.encoders.json.JSON.decode(data); if (!v2) { throw new Error(); } if (com.newgrounds.APICommand.bridge) { com.newgrounds.APICommand.bridge.sendEvent(v2.command_id, v2); } this.dispatchEvent(new com.newgrounds.APIEvent(com.newgrounds.APIEvent.COMMAND_COMPLETE, v2, (v2 && v2.success) ? com.newgrounds.APIEvent.ERROR_NONE : com.newgrounds.APIEvent.ERROR_COMMAND_FAILED)); } catch (e) { com.newgrounds.Logger.logError('Invalid response returned from server: ' + data); this.dispatchEvent(new com.newgrounds.APIEvent(com.newgrounds.APIEvent.COMMAND_COMPLETE, null, com.newgrounds.APIEvent.ERROR_BAD_RESPONSE)); } this.close(); }; v1.TIMEOUT_INTERVAL = 10000; v1.THROTTLE_INTERVAL = 10050; v1.THROTTLE_TICK_INTERVAL = 1000; v1.THROTTLE_THRESHOLD = 24; v1._throttleCount = 0; v1._commandQueue = []; v1._throttleTimer = setInterval(com.newgrounds.APICommand.onThrottleTimer, com.newgrounds.APICommand.THROTTLE_TICK_INTERVAL); v1.ENCRYPTOR_RADIX = '/g8236klvBQ#&|;Zb*7CEA59%s`Oue1wziFp$rDVY@TKxUPWytSaGHJ>dmoMR^<0~4qNLhc(I+fjn)X'; v1._encryptor = new com.newgrounds.encoders.BaseN(com.newgrounds.APICommand.ENCRYPTOR_RADIX); v1._pendingCommands = []; v1.CRLF = '\r\n'; v2.addProperty('command', v2.__get__command, v2.__set__command); v2.addProperty('hasSecureParameters', v2.__get__hasSecureParameters, function () {}); v2.addProperty('hasTimeout', v2.__get__hasTimeout, v2.__set__hasTimeout); v2.addProperty('parameters', v2.__get__parameters, v2.__set__parameters); v2.addProperty('preventCache', v2.__get__preventCache, v2.__set__preventCache); v2.addProperty('secureParameters', v2.__get__secureParameters, v2.__set__secureParameters); ASSetPropFlags(com.newgrounds.APICommand.prototype, null, 1); } #endinitclip } movieClip 1183 __Packages.com.newgrounds.Bridge { #initclip if (!_global.com) { _global.com = new Object(); } if (!_global.com.newgrounds) { _global.com.newgrounds = new Object(); } if (!_global.com.newgrounds.Bridge) { var v1 = function (id) { this._widgetId = id; this._inConnection = new LocalConnection(); this._outConnection = new LocalConnection(); this._inConnection.receiveEvent = this.receiveEvent; try { this._inConnection.connect('rec_' + this._widgetId); } com.newgrounds.Logger.addEventListener(com.newgrounds.APIEvent.LOG, {'target': this, 'func': this.onLogMessage}); }; com.newgrounds.Bridge = v1; var v2 = v1.prototype; v2.onLogMessage = function (event) { try { this._outConnection.send(this._widgetId, 'sendEvent', 'trace', String(event.__get__data())); } }; v2.sendEvent = function (command, parameters) { if (this._outConnection) { parameters = {'data': parameters}; this._outConnection.send(this._widgetId, 'sendEvent', command, parameters); } }; v2.receiveEvent = function (event, parameters) {}; v2.onStatus = function (event) {}; ASSetPropFlags(com.newgrounds.Bridge.prototype, null, 1); } #endinitclip } movieClip 1180 __Packages.com.newgrounds.APIEvent { #initclip if (!_global.com) { _global.com = new Object(); } if (!_global.com.newgrounds) { _global.com.newgrounds = new Object(); } if (!_global.com.newgrounds.APIEvent) { var v1 = function (type, data, error) { super(type); if (data == undefined) { data = null; } if (error == undefined) { error = null; } if (!error || error == '' || error == com.newgrounds.APIEvent.ERROR_NONE) { this._error = com.newgrounds.APIEvent.ERROR_NONE; this._success = true; } else { this._error = error; this._success = false; } if (data) { this._data = data; } else { this._data = {}; } }; com.newgrounds.APIEvent = v1; com.newgrounds.APIEvent extends com.newgrounds.Event; var v2 = v1.prototype; v2.clone = function () { return new com.newgrounds.APIEvent(this.__get__type(), this._data, this._error); }; v2.__get__success = function () { return this._success; }; v2.__get__data = function () { return this._data; }; v2.__get__error = function () { return this._error; }; v1.COMMAND_COMPLETE = 'commandComplete'; v1.MEDAL_UNLOCK_CONFIRMED = 'medalUnlockConfirmed'; v1.ICON_LOADED = 'iconLoaded'; v1.API_CONNECTED = 'movieConnected'; v1.LOG = 'log'; v1.MEDAL_UNLOCKED = 'medalUnlocked'; v1.SCORES_LOADED = 'scoresLoaded'; v1.SCORE_POSTED = 'scorePosted'; v1.QUERY_COMPLETE = 'queryComplete'; v1.FILE_LOADED = 'fileLoaded'; v1.FILE_SAVED = 'fileSaved'; v1.FILE_REQUESTED = 'fileRequested'; v1.VOTE_COMPLETE = 'voteComplete'; v1.ERROR_NONE = 'noError'; v1.ERROR_UNKNOWN = 'unknownError'; v1.ERROR_COMMAND_FAILED = 'commandFailed'; v1.ERROR_NOT_CONNECTED = 'notConnected'; v1.ERROR_INVALID_ARGUMENT = 'invalidArgument'; v1.ERROR_TIMED_OUT = 'timedOut'; v1.ERROR_BAD_FILE = 'badFile'; v1.ERROR_BAD_RESPONSE = 'badResponse'; v1.ERROR_SENDING_COMMAND = 'errorSendingCommand'; v1.ERROR_HOST_BLOCKED = 'hostBlocked'; v1.ERROR_ALREADY_VOTED = 'alreadyVoted'; v1.ERROR_NOT_LOGGED_IN = 'notLoggedIn'; v1.ERROR_WRONG_ENCRYPTION_KEY = 'wrongEncryptionKey'; v2.addProperty('data', v2.__get__data, function () {}); v2.addProperty('error', v2.__get__error, function () {}); v2.addProperty('success', v2.__get__success, function () {}); ASSetPropFlags(com.newgrounds.APIEvent.prototype, null, 1); } #endinitclip } movieClip 1199 __Packages.com.newgrounds.API { #initclip if (!_global.com) { _global.com = new Object(); } if (!_global.com.newgrounds) { _global.com.newgrounds = new Object(); } if (!_global.com.newgrounds.API) { var v1 = function () {}; com.newgrounds.API = v1; var v2 = v1.prototype; v1.__get__connected = function () { return com.newgrounds.API._connection.__get__connected(); }; v1.__get__isNetworkHost = function () { return com.newgrounds.API._connection.__get__isNetworkHost(); }; v1.__get__apiId = function () { com.newgrounds.API._connection.assertInitialized(); return com.newgrounds.API._connection.apiId; }; v1.__get__debugMode = function () { return com.newgrounds.API._debugMode; }; v1.__set__debugMode = function (val) { com.newgrounds.API._debugMode = val; return com.newgrounds.API.__get__debugMode(); }; v1.__get__publisherId = function () { com.newgrounds.API._connection.assertInitialized(); return com.newgrounds.API._connection.publisherId; }; v1.__get__sessionId = function () { com.newgrounds.API._connection.assertInitialized(); return com.newgrounds.API._connection.sessionId; }; v1.__get__hostDomain = function () { com.newgrounds.API._connection.assertInitialized(); return com.newgrounds.API._connection.hostDomain; }; v1.__get__hostURL = function () { com.newgrounds.API._connection.assertInitialized(); return com.newgrounds.API._connection.__get__hostURL(); }; v1.__get__isNewgrounds = function () { return com.newgrounds.API._connection.publisherId == 1; }; v1.__get__hasUserSession = function () { com.newgrounds.API._connection.assertInitialized(); return com.newgrounds.API._connection.__get__hasUserSession(); }; v1.__get__username = function () { com.newgrounds.API._connection.assertInitialized(); return com.newgrounds.API._connection.username; }; v1.__get__userId = function () { com.newgrounds.API._connection.assertInitialized(); return com.newgrounds.API._connection.userId; }; v1.assertConnected = function (eventType) { if (eventType == undefined) { eventType = null; } if (com.newgrounds.API._connection.assertConnected()) { return true; } else { if (eventType) { com.newgrounds.API.dispatchEvent(eventType, null, com.newgrounds.APIEvent.ERROR_NOT_CONNECTED); } return false; } }; v1.__get__adsApproved = function () { return com.newgrounds.API._adsApproved; }; v1.__get__adFeedURL = function () { return com.newgrounds.API._adFeedURL; }; v1.__get__medals = function () { return com.newgrounds.API._medalsArray; }; v1.__get__scoreBoards = function () { return com.newgrounds.API._scoreBoardsArray; }; v1.__get__saveGroups = function () { return com.newgrounds.API._saveGroupsArray; }; v1.connect = function (_root, apiId, encryptionKey, movieVersion) { if (encryptionKey == undefined) { encryptionKey = null; } if (movieVersion == undefined) { movieVersion = ''; } com.newgrounds.APIEventDispatcher.__set__globalDispatcher(com.newgrounds.API._dispatcher); System.security.loadPolicyFile('http://apifiles.ngfiles.com/crossdomain.xml'); if (com.newgrounds.API._connection.initialized) { com.newgrounds.Logger.logError('Connection already in progress. Please call API.disconnect() before attempting another connection.'); com.newgrounds.API.dispatchEvent(com.newgrounds.APIEvent.API_CONNECTED, false, com.newgrounds.APIEvent.ERROR_NOT_CONNECTED); return undefined; } apiId = com.newgrounds.API.trimWhitespace(apiId); if (encryptionKey) { encryptionKey = com.newgrounds.API.trimWhitespace(encryptionKey); } if (!apiId || apiId == '') { com.newgrounds.Logger.logError('No apiId given. Please use the API ID from your API settings page.'); com.newgrounds.API.dispatchEvent(com.newgrounds.APIEvent.API_CONNECTED, false, com.newgrounds.APIEvent.ERROR_INVALID_ARGUMENT); return undefined; } com.newgrounds.Logger.logMessage('====== Newgrounds API v' + com.newgrounds.API.VERSION + ' ======'); com.newgrounds.API._connection.connectionState = com.newgrounds.APIConnection.CONNECTING; _root = _root; com.newgrounds.API._movieVersion = movieVersion; com.newgrounds.API._connection.apiId = apiId; var v4; v4 = apiId.indexOf(':'); if (v4 != -1) { com.newgrounds.API._connection.trackerId = int(apiId.substring(0, v4)); } else { com.newgrounds.API._connection.trackerId = int(apiId); } if (!com.newgrounds.API._connection.trackerId) { com.newgrounds.Logger.logError('Invalid API ID: ' + apiId); com.newgrounds.API.dispatchEvent(com.newgrounds.APIEvent.API_CONNECTED, false, com.newgrounds.APIEvent.ERROR_INVALID_ARGUMENT); return undefined; } com.newgrounds.API._connection.encryptionKey = encryptionKey; com.newgrounds.API._connection.initialized = true; com.newgrounds.API._connection.__set__hostURL(_root._url); com.newgrounds.API.doConnect(_root); }; v1.doConnect = function (flashVars) { if (com.newgrounds.API.__get__isNetworkHost() && com.newgrounds.API._debugMode != com.newgrounds.API.RELEASE_MODE) { com.newgrounds.Logger.logMessage('Live file detected, turning off debug mode.'); com.newgrounds.API._debugMode = com.newgrounds.API.RELEASE_MODE; } if (flashVars && flashVars.NewgroundsAPI_SandboxID) { com.newgrounds.API._bridge = new com.newgrounds.Bridge(flashVars.NewgroundsAPI_SandboxID); com.newgrounds.APICommand.bridge = com.newgrounds.API._bridge; } if (com.newgrounds.API._debugMode == com.newgrounds.API.RELEASE_MODE) { if (flashVars) { if (flashVars.NewgroundsAPI_UserName) { com.newgrounds.API._connection.username = flashVars.NewgroundsAPI_UserName; } if (flashVars.NewgroundsAPI_UserID) { com.newgrounds.API._connection.userId = flashVars.NewgroundsAPI_UserID; } if (flashVars.NewgroundsAPI_PublisherID) { com.newgrounds.API._connection.publisherId = flashVars.NewgroundsAPI_PublisherID; } if (flashVars.NewgroundsAPI_UserpageFormat) { com.newgrounds.API._connection.userpageFormat = flashVars.NewgroundsAPI_UserpageFormat; } if (flashVars.NewgroundsAPI_SessionID) { com.newgrounds.API._connection.sessionId = flashVars.NewgroundsAPI_SessionID; } if (flashVars.NewgroundsAPI_SaveGroupID) { com.newgrounds.API._requestedSaveGroupId = flashVars.NewgroundsAPI_SaveGroupID; } if (flashVars.NewgroundsAPI_SaveFileID) { com.newgrounds.API._requestedSaveFileId = flashVars.NewgroundsAPI_SaveFileID; } } } else { com.newgrounds.API._connection.debug = true; if (com.newgrounds.API._debugMode == com.newgrounds.API.DEBUG_MODE_LOGGED_IN || com.newgrounds.API._debugMode == com.newgrounds.API.DEBUG_MODE_LOGGED_OUT) { com.newgrounds.API._connection.publisherId = 1; } if (com.newgrounds.API._debugMode == com.newgrounds.API.DEBUG_MODE_LOGGED_IN) { com.newgrounds.API._connection.sessionId = 'D3bu64p1U53R'; com.newgrounds.API._connection.userId = 10; com.newgrounds.API._connection.username = 'API-Debugger'; } } com.newgrounds.API._connection.sendSimpleCommand('connectMovie', com.newgrounds.API.onConnect, {'host': com.newgrounds.API._connection.hostDomain, 'movie_version': com.newgrounds.API._movieVersion, 'publisher_id': com.newgrounds.API._connection.publisherId}); }; v1.onConnect = function (event) { var v1 = event.__get__data(); if (!event.__get__success()) { com.newgrounds.Logger.logError('Unable to connect to the API.'); com.newgrounds.API._connection.reset(); com.newgrounds.API.dispatchEvent(com.newgrounds.APIEvent.API_CONNECTED, event.__get__data(), event.__get__error()); return undefined; } if (com.newgrounds.API.__get__debugMode() != com.newgrounds.API.RELEASE_MODE) { com.newgrounds.API._adFeedURL = com.newgrounds.API.TEST_AD_FEED_URL; } else { if (v1.ad_url) { com.newgrounds.API._adFeedURL = unescape(v1.ad_url); } } switch (v1.ad_status) { case -1: com.newgrounds.Logger.logWarning('Your movie is not approved to run Flash Ads.'); break; case 0: com.newgrounds.Logger.logWarning('Your movie is still awaiting approval to run Flash Ads.'); break; case 1: com.newgrounds.Logger.logMessage('Your movie is approved to run Flash Ads!'); } com.newgrounds.API._adsApproved = v1.ad_status == 1; if (com.newgrounds.API._debugMode == com.newgrounds.API.DEBUG_MODE_HOST_BLOCKED || v1.deny_host) { com.newgrounds.Logger.logWarning(com.newgrounds.API._connection.hostDomain + ' does not have permission to host this movie!', 'Update your API configuration to allow this host.'); com.newgrounds.API.dispatchEvent(com.newgrounds.APIEvent.API_CONNECTED, {'officialURL': unescape(v1.movie_url)}, com.newgrounds.APIEvent.ERROR_HOST_BLOCKED); com.newgrounds.API._connection.reset(); return undefined; } com.newgrounds.API._movieName = v1.movieName ? v1.movieName : ''; com.newgrounds.Logger.logMessage('Connecting to the Newgrounds API Gateway...', '----- ' + v1.movie_name + ' -----'); if (com.newgrounds.API._debugMode == com.newgrounds.API.DEBUG_MODE_NEW_VERSION) { v1.movie_version = 'Debug Mode'; } if (v1.movie_version) { com.newgrounds.Logger.logMessage('A new version of this movie is available.', 'Current version:\t' + com.newgrounds.API._movieVersion, 'Newest version:\t' + v1.movie_version, 'Use API.loadOfficialVersion() to link to the latest version.'); com.newgrounds.API._newVersion = true; } else { com.newgrounds.API._newVersion = false; } if (v1.request_portal_url) { com.newgrounds.API._connection.sendSimpleCommand('setPortalID', null, {'portal_url': com.newgrounds.API._connection.__get__hostURL()}); } com.newgrounds.API._connection.sendSimpleCommand('preloadSettings', com.newgrounds.API.onMetadataLoaded, {'publisher_id': com.newgrounds.API._connection.publisherId, 'user_id': com.newgrounds.API._connection.userId}); }; v1.onMetadataLoaded = function (event) { var v11 = event.__get__data(); var v1; var v7; if (!event.__get__success()) { com.newgrounds.Logger.logWarning('Unable to load movie metadata.'); com.newgrounds.API.disconnect(); com.newgrounds.API.dispatchEvent(com.newgrounds.APIEvent.API_CONNECTED, null, event.__get__error()); return undefined; } var v10 = 0; if (v11.medals) { v10 = v11.medals.length; var v18; if (com.newgrounds.API.__get__hasUserSession()) { v18 = com.newgrounds.API.loadLocal('medals_unlocked_' + com.newgrounds.API.__get__username()); } else { v18 = com.newgrounds.API.loadLocal('medals_unlocked'); } v1 = 0; while (v1 < v10) { var v4 = v11.medals[v1]; var v15 = v4.medal_unlocked; var v17 = v18 && v18[v4.medal_id]; var v14 = com.newgrounds.API.__get__hasUserSession() ? v15 : v17; if (com.newgrounds.API.__get__debugMode() != com.newgrounds.API.RELEASE_MODE) { v14 = false; } var v5 = new com.newgrounds.Medal(com.newgrounds.API._connection, v4.medal_id, v4.medal_name, v4.medal_description, Boolean(int(v4.secret)), v14, v4.medal_value, v4.medal_difficulty, v4.medal_icon); v5.addEventListener(com.newgrounds.APIEvent.MEDAL_UNLOCKED, com.newgrounds.API.onMedalUnlocked, false, 0, true); v5.addEventListener(com.newgrounds.APIEvent.MEDAL_UNLOCK_CONFIRMED, com.newgrounds.API.onMedalUnlockConfirmed, false, 0, true); com.newgrounds.API._medals[v5.__get__name()] = v5; com.newgrounds.API._medalsArray.push(v5); com.newgrounds.Logger.logMessage(v5); if (com.newgrounds.API.__get__hasUserSession() && v17 && !v15) { com.newgrounds.Logger.logMessage('Server missed the "' + v5.__get__name() + '" unlock. Resending...'); v5.unlock(); } ++v1; } } com.newgrounds.Logger.logMessage(v10 + ' medal' + ((v10 != 1) ? 's' : '') + ' initialized.'); v10 = 0; if (v11.score_boards) { v10 = v11.score_boards.length; v1 = 0; while (v1 < v10) { var v16 = v11.score_boards[v1]; var v9 = new com.newgrounds.ScoreBoard(com.newgrounds.API._connection, v16.name, v16.id); com.newgrounds.API._scoreBoards[v9.__get__name()] = v9; com.newgrounds.API._scoreBoardsArray.push(v9); com.newgrounds.Logger.logMessage(v9); ++v1; } } com.newgrounds.Logger.logMessage(v10 + ' scoreboard' + ((v10 != 1) ? 's' : '') + ' initialized.'); v10 = 0; if (v11.save_groups) { v10 = v11.save_groups.length; v1 = 0; while (v1 < v10) { var v2 = v11.save_groups[v1]; var v13 = []; if (v2.keys) { v7 = 0; while (v7 < v2.keys.length) { var v6 = v2.keys[v7]; v13.push(new com.newgrounds.SaveKey(v6.name, v6.id, v6.type)); ++v7; } } var v12 = []; if (v2.ratings) { v1 = 0; while (v1 < v2.ratings.length) { var v3 = v2.ratings[v1]; v12.push(new com.newgrounds.SaveRating(v3.name, v3.id, v3.float, v3.min, v3.max)); ++v1; } } var v8 = new com.newgrounds.SaveGroup(com.newgrounds.API._connection, v2.group_name, v2.group_id, v2.group_type, v13, v12); com.newgrounds.API._saveGroups[v8.__get__name()] = v8; com.newgrounds.API._saveGroupsArray.push(v8); com.newgrounds.Logger.logMessage(v8); ++v1; } } com.newgrounds.Logger.logMessage(v10 + ' save group' + ((v10 != 1) ? 's' : '') + ' initialized.'); if (v11.save_file_path) { com.newgrounds.API._saveFilePath = v11.save_file_path + '/'; com.newgrounds.SaveFile._saveFilePath = com.newgrounds.API._saveFilePath; com.newgrounds.Logger.logInternal('Save file path: ' + com.newgrounds.API._saveFilePath); } if (v11.image_file_path) { com.newgrounds.API._imageFilePath = v11.image_file_path + '/'; com.newgrounds.SaveFile._imageFilePath = com.newgrounds.API._imageFilePath; com.newgrounds.Logger.logInternal('Image file path: ' + com.newgrounds.API._imageFilePath); } com.newgrounds.Logger.logMessage('Connection complete!'); com.newgrounds.API._connection.connectionState = com.newgrounds.APIConnection.CONNECTED; com.newgrounds.API.dispatchEvent(com.newgrounds.APIEvent.API_CONNECTED, {'movieName': com.newgrounds.API._movieName, 'newVersion': com.newgrounds.API._newVersion}); if (com.newgrounds.API._requestedSaveFileId && com.newgrounds.API._requestedSaveGroupId) { com.newgrounds.API.addEventListener(com.newgrounds.APIEvent.FILE_LOADED, com.newgrounds.API.onRequestedFileLoaded); com.newgrounds.API.loadSaveFile(com.newgrounds.API._requestedSaveFileId, false); } }; v1.disconnect = function () { if (!com.newgrounds.API._connection.__get__connected()) { com.newgrounds.Logger.logWarning('The Newgrounds API is already disconnected.'); return undefined; } com.newgrounds.API._connection.reset(); for (var v2 in com.newgrounds.API._medals) { var v1 = com.newgrounds.API._medals[v2]; v1.removeEventListener(com.newgrounds.APIEvent.MEDAL_UNLOCKED, com.newgrounds.API.onMedalUnlocked); v1.removeEventListener(com.newgrounds.APIEvent.MEDAL_UNLOCK_CONFIRMED, com.newgrounds.API.onMedalUnlockConfirmed); } com.newgrounds.API._newVersion = false; com.newgrounds.API._medals = new Object(); com.newgrounds.API._medalsArray = []; com.newgrounds.API._scoreBoards = new Object(); com.newgrounds.API._scoreBoardsArray = []; com.newgrounds.API._saveGroups = new Object(); com.newgrounds.API._saveGroupsArray = []; com.newgrounds.API._sharedObjects = new Object(); com.newgrounds.API._imageFilePath = null; com.newgrounds.API._saveFilePath = null; com.newgrounds.Logger.logMessage('Disconnected from the Newgrounds API.'); }; v1.loadNewgrounds = function () { com.newgrounds.API._connection.loadInBrowser('loadNewgrounds'); }; v1.loadOfficialVersion = function () { if (com.newgrounds.API._connection.assertInitialized()) { com.newgrounds.API._connection.loadInBrowser('loadOfficialVersion', false); } }; v1.loadMySite = function () { if (com.newgrounds.API._connection.assertInitialized()) { com.newgrounds.API._connection.loadInBrowser('loadMySite'); } }; v1.loadCustomLink = function (linkName) { if (com.newgrounds.API._connection.assertInitialized()) { com.newgrounds.API._connection.loadInBrowser('loadCustomLink', true, {'link': linkName}); } }; v1.getMedal = function (medalName) { return com.newgrounds.API._medals[medalName]; }; v1.unlockMedal = function (medalName) { if (!com.newgrounds.API.assertConnected()) { return undefined; } var v1 = com.newgrounds.API._medals[medalName]; if (!v1) { com.newgrounds.Logger.logError('No medal named "' + medalName + '" w.'); return undefined; } v1.unlock(); }; v1.onMedalUnlocked = function (event) { if (event.__get__success()) { var v2 = com.newgrounds.Medal(event.__get__data()); var v1; if (com.newgrounds.API.__get__hasUserSession()) { v1 = com.newgrounds.API.loadLocal('medals_unlocked_' + com.newgrounds.API.__get__username()); if (!v1) { v1 = new Object(); } v1[v2.__get__id()] = true; com.newgrounds.API.saveLocal('medals_unlocked_' + com.newgrounds.API.__get__username(), v1); } else { v1 = com.newgrounds.API.loadLocal('medals_unlocked'); if (!v1) { v1 = new Object(); } v1[(com.newgrounds.Medal(event.__get__data())).__get__id()] = true; com.newgrounds.API.saveLocal('medals_unlocked', v1); com.newgrounds.Logger.logMessage('User instanceof not logged in. Medal "' + v2.__get__name() + '" unlocked locally.'); } } }; v1.onMedalUnlockConfirmed = function (event) { if (com.newgrounds.API.__get__hasUserSession()) { var v1 = com.newgrounds.API.loadLocal('medals_unlocked_' + com.newgrounds.API.__get__username()); if (!v1) { v1 = new Object(); } else { delete v1[(com.newgrounds.Medal(event.__get__data())).__get__id()]; } com.newgrounds.API.saveLocal('medals_unlocked_' + com.newgrounds.API.__get__username(), v1); } }; v1.clearLocalMedals = function () { for (var v2 in com.newgrounds.API._medals) { var v1 = com.newgrounds.API._medals[v2]; v1.setUnlocked(false); } if (!com.newgrounds.API.__get__hasUserSession()) { com.newgrounds.API.saveLocal('medals_unlocked', new Object()); } }; v1.getScoreBoard = function (scoreBoardName) { if (!com.newgrounds.API.assertConnected()) { return null; } return com.newgrounds.API._scoreBoards[scoreBoardName]; }; v1.loadScores = function (scoreBoardName, period, firstResult, numResults, tag) { if (period == undefined) { period = 'All-Time'; } if (firstResult == undefined) { firstResult = 1; } if (numResults == undefined) { numResults = 10; } if (tag == undefined) { tag = null; } if (!com.newgrounds.API.assertConnected()) { return null; } var v1 = com.newgrounds.API._scoreBoards[scoreBoardName]; if (!v1) { com.newgrounds.Logger.logError('No scoreboard named "' + scoreBoardName + '" w.'); com.newgrounds.API.dispatchEvent(com.newgrounds.APIEvent.SCORES_LOADED, null, com.newgrounds.APIEvent.ERROR_INVALID_ARGUMENT); return null; } v1.__set__period(period); v1.__set__firstResult(firstResult); v1.__set__numResults(numResults); v1.__set__tag(tag); v1.loadScores(); return v1; }; v1.postScore = function (scoreBoardName, numericScore, tag) { if (tag == undefined) { tag = null; } if (!com.newgrounds.API.assertConnected()) { return undefined; } if (!com.newgrounds.API.__get__hasUserSession()) { com.newgrounds.Logger.logError('The user must be logged-in to post a score.'); com.newgrounds.API.dispatchEvent(com.newgrounds.APIEvent.SCORE_POSTED, null, com.newgrounds.APIEvent.ERROR_NOT_LOGGED_IN); return undefined; } var v1 = com.newgrounds.API._scoreBoards[scoreBoardName]; if (!v1) { com.newgrounds.Logger.logError('No scoreboard named "' + scoreBoardName + '" w.'); com.newgrounds.API.dispatchEvent(com.newgrounds.APIEvent.SCORE_POSTED, null, com.newgrounds.APIEvent.ERROR_INVALID_ARGUMENT); return undefined; } v1.postScore(numericScore, tag); }; v1.getSaveGroup = function (groupName) { if (!com.newgrounds.API.assertConnected()) { return null; } return com.newgrounds.API._saveGroups[groupName]; }; v1.getSaveGroupById = function (id) { for (var v3 in com.newgrounds.API._saveGroups) { var v1 = com.newgrounds.API._saveGroups[v3]; if (v1.__get__id() == id) { return v1; } } return null; }; v1.createSaveFile = function (groupName) { if (!com.newgrounds.API.assertConnected()) { return null; } var v1 = com.newgrounds.API.getSaveGroup(groupName); if (!v1) { com.newgrounds.Logger.logError('The save group "' + groupName + '" w found.'); return null; } return new com.newgrounds.SaveFile(v1); }; v1.loadSaveFile = function (saveId, loadContents) { if (loadContents == undefined) { loadContents = true; } com.newgrounds.API._connection.sendSimpleCommand('loadSaveFile', com.newgrounds.API.onFileLoaded, {'save_id': saveId, 'get_contents': loadContents}); }; v1.onFileLoaded = function (event) { var v2; if (event.__get__success()) { v2 = com.newgrounds.SaveFile.fromObject(com.newgrounds.API.getSaveGroupById((event.__get__data()).group_id), (event.__get__data()).file); if ((event.__get__data()).get_contents) { v2.load(); } else { com.newgrounds.API.dispatchEvent(com.newgrounds.APIEvent.FILE_LOADED, v2); } } else { com.newgrounds.Logger.logError('Unable to load file:', event.__get__error()); com.newgrounds.API.dispatchEvent(com.newgrounds.APIEvent.FILE_LOADED, null, event.__get__error()); } }; v1.createSaveQuery = function (groupName) { if (!com.newgrounds.API.assertConnected()) { return null; } var v1 = com.newgrounds.API.getSaveGroup(groupName); if (!v1) { com.newgrounds.Logger.logError('The save group "' + groupName + '" w found.'); return null; } var v2 = new com.newgrounds.SaveQuery(v1); return v2; }; v1.createSaveQueryByDate = function (groupName, sortDescending) { if (sortDescending == undefined) { sortDescending = true; } var v1 = com.newgrounds.API.createSaveQuery(groupName); if (!v1) { return null; } v1.sortOn(com.newgrounds.SaveQuery.CREATED_ON, sortDescending); return v1; }; v1.createSaveQueryByName = function (groupName, filename, exactMatch, sortDescending) { if (exactMatch == undefined) { exactMatch = false; } if (sortDescending == undefined) { sortDescending = false; } var v1 = com.newgrounds.API.createSaveQuery(groupName); if (!exactMatch) { v1.addCondition(com.newgrounds.SaveQuery.FILE_NAME, com.newgrounds.SaveQuery.OPERATOR_CONTAINS, filename); return v1; } v1.addCondition(com.newgrounds.SaveQuery.FILE_NAME, com.newgrounds.SaveQuery.OPERATOR_EQUAL, filename); return v1; }; v1.createSaveQueryByRating = function (groupName, ratingName, sortDescending) { if (sortDescending == undefined) { sortDescending = true; } var v1 = com.newgrounds.API.createSaveQuery(groupName); v1.sortOn(ratingName, sortDescending); return v1; }; v1.onRequestedFileLoaded = function (event) { com.newgrounds.API.removeEventListener(com.newgrounds.APIEvent.FILE_LOADED, com.newgrounds.API.onRequestedFileLoaded); if (event.__get__success()) { var v1 = event.__get__data(); if (v1) { com.newgrounds.API.dispatchEvent(com.newgrounds.APIEvent.FILE_REQUESTED, v1); } } }; v1.addEventListener = function (eventType, listener, priority, useWeakReference) { if (priority == undefined) { priority = 0; } if (useWeakReference == undefined) { useWeakReference = true; } com.newgrounds.API._dispatcher.addEventListener(eventType, listener, false, priority, useWeakReference); }; v1.removeEventListener = function (eventType, listener) { com.newgrounds.API._dispatcher.removeEventListener(eventType, listener); }; v1.dispatchEvent = function (event, data, error) { if (data == undefined) { data = null; } if (error == undefined) { error = null; } com.newgrounds.API._dispatcher.dispatchEvent(new com.newgrounds.APIEvent(event, data, error)); }; v1.saveLocal = function (saveId, saveData) { try { var v3; var v2 = 'ng_ap_secure_' + com.newgrounds.API._connection.trackerId + '_' + com.newgrounds.crypto.RC4.encrypt(saveId, com.newgrounds.API._connection.encryptionKey); if (!com.newgrounds.API._sharedObjects[saveId]) { com.newgrounds.API._sharedObjects[saveId] = SharedObject.getLocal(v2); } v3 = com.newgrounds.API._sharedObjects[saveId]; v3.data.data = com.newgrounds.API.encodeData(saveData); } catch (v0) { if (Error(v0) != null) { var error = Error(v0); com.newgrounds.Logger.logError('Unable to save local data.', error); return false; return true; } throw v0; } return true; }; v1.loadLocal = function (saveId) { try { var v1; var v3 = 'ng_ap_secure_' + com.newgrounds.API._connection.trackerId + '_' + com.newgrounds.crypto.RC4.encrypt(saveId, com.newgrounds.API._connection.encryptionKey); if (!com.newgrounds.API._sharedObjects[saveId]) { com.newgrounds.API._sharedObjects[saveId] = SharedObject.getLocal(v3); } v1 = com.newgrounds.API._sharedObjects[saveId]; if (v1 && v1.data && v1.data.data) { return com.newgrounds.API.decodeData(v1.data.data); } return null; } catch (v0) { if (Error(v0) != null) { var error = Error(v0); com.newgrounds.Logger.logError('Unable to load local data.', error); return null; } throw v0; } return null; }; v1.logCustomEvent = function (eventName) { if (com.newgrounds.API.assertConnected()) { com.newgrounds.Logger.logMessage('Logged event: ' + eventName); com.newgrounds.API._connection.sendSimpleCommand('logCustomEvent', null, {'event': eventName}); } }; v1.encodeData = function (data) { if (!com.newgrounds.API._connection.assertInitialized()) { return null; } return com.newgrounds.crypto.RC4.encrypt(com.newgrounds.encoders.json.JSON.encode(data), com.newgrounds.API._connection.encryptionKey); }; v1.decodeData = function (data) { if (!com.newgrounds.API._connection.assertInitialized()) { return null; } try { return com.newgrounds.encoders.json.JSON.decode(com.newgrounds.crypto.RC4.decrypt(data, com.newgrounds.API._connection.encryptionKey)); } catch (v0) { if (Error(v0) != null) { var error = Error(v0); return null; } throw v0; } return null; }; v1.stopPendingCommands = function () { com.newgrounds.APICommand.stopPendingCommands(); com.newgrounds.Logger.logMessage('Pending commands stopped.'); }; v1.trimWhitespace = function (string) { if (!string) { return null; } var v3 = 0; while (string.charAt(v3) == ' ') { ++v3; } var v1 = string.length - 1; for (;;) { if (!(string.charAt(v1) == ' ' && v1 >= 0)) break; --v1; } return string.slice(v3, v1 + 1); }; v1.VERSION = '3.1.1 AS2'; v1.RELEASE_MODE = 'releaseMode'; v1.DEBUG_MODE_LOGGED_IN = 'debugModeLoggedIn'; v1.DEBUG_MODE_LOGGED_OUT = 'debugModeLoggedOut'; v1.DEBUG_MODE_NEW_VERSION = 'debugModeNewVersion'; v1.DEBUG_MODE_HOST_BLOCKED = 'debugModeHostBlocked'; v1.TEST_AD_FEED_URL = 'http://www.ngads.com/adtest.php'; v1._dispatcher = new com.newgrounds.APIEventDispatcher(); v1._connection = new com.newgrounds.APIConnection(); v1._debugMode = com.newgrounds.API.DEBUG_MODE_LOGGED_IN; v1._adsApproved = false; v1._medals = new Object(); v1._medalsArray = []; v1._scoreBoards = new Object(); v1._scoreBoardsArray = []; v1._saveGroups = new Object(); v1._saveGroupsArray = []; v1._sharedObjects = new Object(); v1.addProperty('adFeedURL', v1.__get__adFeedURL, function () {}); v1.addProperty('adsApproved', v1.__get__adsApproved, function () {}); v1.addProperty('apiId', v1.__get__apiId, function () {}); v1.addProperty('connected', v1.__get__connected, function () {}); v1.addProperty('debugMode', v1.__get__debugMode, v1.__set__debugMode); v1.addProperty('hasUserSession', v1.__get__hasUserSession, function () {}); v1.addProperty('hostDomain', v1.__get__hostDomain, function () {}); v1.addProperty('hostURL', v1.__get__hostURL, function () {}); v1.addProperty('isNetworkHost', v1.__get__isNetworkHost, function () {}); v1.addProperty('isNewgrounds', v1.__get__isNewgrounds, function () {}); v1.addProperty('medals', v1.__get__medals, function () {}); v1.addProperty('publisherId', v1.__get__publisherId, function () {}); v1.addProperty('saveGroups', v1.__get__saveGroups, function () {}); v1.addProperty('scoreBoards', v1.__get__scoreBoards, function () {}); v1.addProperty('sessionId', v1.__get__sessionId, function () {}); v1.addProperty('userId', v1.__get__userId, function () {}); v1.addProperty('username', v1.__get__username, function () {}); ASSetPropFlags(com.newgrounds.API.prototype, null, 1); } #endinitclip } movieClip 1196 __Packages.com.newgrounds.encoders.ImageScanner { #initclip if (!_global.com) { _global.com = new Object(); } if (!_global.com.newgrounds) { _global.com.newgrounds = new Object(); } if (!_global.com.newgrounds.encoders) { _global.com.newgrounds.encoders = new Object(); } if (!_global.com.newgrounds.encoders.ImageScanner) { var v1 = function (hashLength, charsPerPixel) { if (hashLength) { this._hash = com.newgrounds.encoders.ImageScanner.DEFAULT_HASH.substr(0, hashLength); } this._baseN = new com.newgrounds.encoders.BaseN(this._hash); if (charsPerPixel) { this._charsPerPixel = charsPerPixel; } this.__set__encodeAlpha(false); }; com.newgrounds.encoders.ImageScanner = v1; var v2 = v1.prototype; v2.__get__encodeAlpha = function () { return this._encodeAlpha; }; v2.__set__encodeAlpha = function (v) { this._encodeAlpha = v; this._maxPerChannel = int(Math.pow(this._hash.length, this._charsPerPixel / (this._encodeAlpha ? 4 : 3))); if (this._maxPerChannel > 256) { this._maxPerChannel = 256; } return this.__get__encodeAlpha(); }; v2.encode = function (source, callbackFunction, callbackObject) { var v4 = {'callbackFunction': callbackFunction, 'callbackObject': callbackObject, 'source': source, 'x': 0, 'y': 0, 'output': null}; var v2 = source.width.toString(); var v3 = source.height.toString(); while (v2.length < 3) { v2 = '0' + v2; } while (v3.length < 3) { v3 = '0' + v3; } v4.output = v2 + v3; var v6 = setInterval(this, 'doEncode', com.newgrounds.encoders.ImageScanner.WORK_INTERVAL, v4); v4.interval = v6; }; v2.decode = function (source, callbackFunction, callbackObject) { var v2 = {'callbackFunction': callbackFunction, 'callbackObject': callbackObject, 'source': source, 'i': 6, 'x': 0, 'y': 0, 'output': null}; var v5 = int(source.substr(0, 3)); var v6 = int(source.substr(3, 3)); v2.output = new flash.display.BitmapData(v5, v6, this._encodeAlpha); var v4 = setInterval(this, 'doDecode', com.newgrounds.encoders.ImageScanner.WORK_INTERVAL, v2); v2.interval = v4; }; v2.doEncode = function (state) { var v3 = getTimer(); for (;;) { if (!(state.y < state.source.height && getTimer() - v3 < com.newgrounds.encoders.ImageScanner.WORK_INTERVAL)) break; state.output += this.encodePixel(state.source.getPixel32(state.x, state.y)); ++state.x; if (state.x == state.source.width) { state.x = 0; ++state.y; } } if (state.y == state.source.height) { clearInterval(state.interval); state.callbackFunction.call(state.callbackObject, state.output); } }; v2.doDecode = function (state) { var v4 = getTimer(); for (;;) { if (!(state.y < state.output.height && getTimer() - v4 < com.newgrounds.encoders.ImageScanner.WORK_INTERVAL)) break; var v3 = this.decodePixel(state.source.substr(state.i, this._charsPerPixel)); state.output.setPixel32(state.x, state.y, v3); state.i += this._charsPerPixel; ++state.x; if (state.x == state.output.width) { state.x = 0; ++state.y; } } if (state.y == state.output.height) { clearInterval(state.interval); state.callbackFunction.call(state.callbackObject, state.output); } }; v2.encodePixel = function (pixel) { var v3 = pixel >> 24 & 255; var v4 = pixel >> 16 & 255; var v5 = pixel >> 8 & 255; var v2 = pixel & 255; v3 = int((v3 / 256) * this._maxPerChannel); v4 = int((v4 / 256) * this._maxPerChannel); v5 = int((v5 / 256) * this._maxPerChannel); v2 = int((v2 / 256) * this._maxPerChannel); var v7 = v4 * this._maxPerChannel * this._maxPerChannel + v5 * this._maxPerChannel + v2; if (this._encodeAlpha) { v7 += v3 * this._maxPerChannel * this._maxPerChannel * this._maxPerChannel; } return this._baseN.encodeUint(v7, this._charsPerPixel); }; v2.decodePixel = function (encodedPixel) { var v3 = 255; var v5; var v6; var v4; var v7 = 0; var v2 = this._baseN.decodeUint(encodedPixel); v4 = v2 % this._maxPerChannel; v2 /= int(this._maxPerChannel); v6 = v2 % this._maxPerChannel; v2 /= int(this._maxPerChannel); v5 = v2 % this._maxPerChannel; v2 /= int(this._maxPerChannel); if (this._encodeAlpha) { v3 = v2 % this._maxPerChannel; v2 /= int(this._maxPerChannel); } return v3 << 24 | v5 << 16 | v6 << 8 | v4; }; v1.DEFAULT_HASH = '0123456789aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ<>?:;-_=+()!&'; v2._hash = com.newgrounds.encoders.ImageScanner.DEFAULT_HASH; v2._charsPerPixel = 2; v1.WORK_INTERVAL = 33.33333333333334; v2.addProperty('encodeAlpha', v2.__get__encodeAlpha, v2.__set__encodeAlpha); ASSetPropFlags(com.newgrounds.encoders.ImageScanner.prototype, null, 1); } #endinitclip } movieClip 1197 __Packages.com.newgrounds.SaveFile { #initclip if (!_global.com) { _global.com = new Object(); } if (!_global.com.newgrounds) { _global.com.newgrounds = new Object(); } if (!_global.com.newgrounds.SaveFile) { var v1 = function (group) { super(); this._iconLoader = new com.newgrounds.BitmapLoader(com.newgrounds.SaveFile.DEFAULT_ICON, null); this._group = group; this._keys = {}; this._ratings = {}; }; com.newgrounds.SaveFile = v1; com.newgrounds.SaveFile extends com.newgrounds.APIEventDispatcher; var v2 = v1.prototype; v1.__get__currentFile = function () { return com.newgrounds.SaveFile._currentFile; }; v1.fromObject = function (group, fileData) { var v4 = new com.newgrounds.SaveFile(group); v4._name = fileData.filename; v4._description = fileData.description; v4._id = fileData.save_id; v4._authorId = fileData.user_id; v4._authorName = fileData.user_name; v4._createdDate = fileData.created; v4._modifiedDate = fileData.last_update; v4._views = fileData.views; if (fileData.thumb && fileData.thumb != '') { v4._iconLoader.__set__url(com.newgrounds.SaveFile._imageFilePath + fileData.thumb); } v4._dataURL = com.newgrounds.SaveFile._saveFilePath + fileData.file; v4._fileSize = fileData.file_size; v4._approved = fileData.status != com.newgrounds.SaveFile.STATUS_UNAPPROVED; v4._readOnly = false; v4._public = fileData.status != com.newgrounds.SaveFile.STATUS_PRIVATE && fileData.status != com.newgrounds.SaveFile.STATUS_UNAPPROVED; for (var v8 in fileData.keys) { var v6 = fileData.keys[v8]; var v2 = group.getKeyById(v6.id); if (v2) { v4._keys[v2.__get__name()] = v2.validateValue(v6.value); } } for (var v9 in fileData.ratings) { var v5 = fileData.ratings[v9]; var v3 = group.getRatingById(v5.id); if (v3) { v4._ratings[v3.__get__name()] = v3.validateValue(v5.score); } } return v4; }; v2.__get__group = function () { return this._group; }; v2.__get__name = function () { return this._name; }; v2.__set__name = function (val) { this._name = val; return this.__get__name(); }; v2.__get__description = function () { return this._description; }; v2.__set__description = function (val) { this._description = val; return this.__get__description(); }; v2.__get__id = function () { return this._id; }; v2.__get__data = function () { return this._data; }; v2.__set__data = function (val) { this._data = val; return this.__get__data(); }; v2.__get__bytesLoaded = function () { if (this._data) { return this.__get__bytesTotal(); } else { if (!this._dataLoader) { return 0; } else { return this._dataLoader.getBytesLoaded(); } } }; v2.__get__bytesTotal = function () { return this._fileSize; }; v2.__get__readOnly = function () { return this._readOnly; }; v2.__get__draft = function () { return this._draft; }; v2.__set__draft = function (v) { this._draft = v; return this.__get__draft(); }; v2.__get__authorId = function () { return this._authorId; }; v2.__get__authorName = function () { return this._authorName; }; v2.__get__keys = function () { return this._keys; }; v2.__get__ratings = function () { return this._ratings; }; v2.__get__views = function () { return this._views; }; v2.__get__createdDate = function () { return this._createdDate; }; v2.__get__updatedDate = function () { return this._modifiedDate; }; v2.toString = function () { return 'Save File: ' + this._name; }; v2.__get__icon = function () { return this._iconLoader.__get__bitmapData(); }; v2.__set__icon = function (v) { this.createIcon(v); return this.__get__icon(); }; v2.__get__iconLoaded = function () { return this._iconLoader.__get__loaded(); }; v2.createIcon = function (source) { var v9 = new flash.display.BitmapData(com.newgrounds.SaveFile.ICON_WIDTH, com.newgrounds.SaveFile.ICON_HEIGHT, false, 0); var v6; var v5; var v10 = 0; var v8 = 0; if (source instanceof flash.display.BitmapData) { v6 = source.width; v5 = source.height; } else { if (source instanceof MovieClip) { v6 = source._width; v5 = source._height; var v7 = (MovieClip(source)).getBounds(source); v10 = v7.xMin; v8 = v7.yMin; } } var v3 = new flash.geom.Matrix(); var v4; v4 = Math.min(com.newgrounds.SaveFile.ICON_WIDTH / v6, com.newgrounds.SaveFile.ICON_HEIGHT / v5); v3.translate(-v10, -v8); v3.scale(v4, v4); v3.translate((com.newgrounds.SaveFile.ICON_WIDTH - v6 * v4) / 2, (com.newgrounds.SaveFile.ICON_HEIGHT - v5 * v4) / 2); v9.draw(source, v3); this._iconLoader.__set__bitmapData(v9); }; v2.attachIcon = function (parent) { if (this._iconLoader) { return this._iconLoader.attachBitmap(parent); } com.newgrounds.Logger.logError('No icon available for this sumbission.'); return null; }; v2.save = function () { if (!(this._group.__get__connection()).__get__hasUserSession()) { com.newgrounds.Logger.logError('The user must be logged-in to save a file.'); this.dispatchEvent(new com.newgrounds.APIEvent(com.newgrounds.APIEvent.FILE_SAVED, null, com.newgrounds.APIEvent.ERROR_NOT_LOGGED_IN)); return undefined; } ++com.newgrounds.BitmapLoader._cacheSeed; com.newgrounds.SaveFile._currentFile = this; if (this.__get__iconLoaded()) { com.newgrounds.SaveFile.ICON_IMAGE_SCANNER.encode(this.__get__icon(), this.onIconEncoded, this); } else { this.encodeData(true); } }; v2.onIconEncoded = function (encodedIcon) { this._encodedIcon = encodedIcon; this.encodeData(true); }; v2.doSave = function () { var v4 = new com.newgrounds.APICommand('saveFile'); (v4.__get__secureParameters()).group = this._group.id; (v4.__get__secureParameters()).user_name = (this._group.__get__connection()).username; (v4.__get__secureParameters()).filename = this._name; (v4.__get__secureParameters()).description = this._description; if (this._draft) { (v4.__get__secureParameters()).draft = true; } if (this._id && !this._readOnly) { (v4.__get__secureParameters()).overwrite = 1; (v4.__get__secureParameters()).save_id = this._id; } var v8 = []; for (var v9 in this._keys) { var v2 = this._group.getKey(v9); if (v2) { v8.push({'id': v2.__get__id(), 'value': v2.validateValue(this._keys[v9])}); } else { com.newgrounds.Logger.logError('No key named "' + v9 + '" in save group "' + this._group.__get__name() + '".'); } } (v4.__get__secureParameters()).keys = v8; var v7 = []; for (var v10 in this._ratings) { var v3 = this._group.getRating(v10); if (v3) { v7.push({'id': v3.__get__id(), 'value': v3.validateValue(this._ratings[v10])}); } else { com.newgrounds.Logger.logError('No rating named "' + v10 + '" in save group "' + this._group.__get__name() + '".'); } } (v4.__get__secureParameters()).ratings = v7; if (typeof this._encodedData == 'string') { v4.addFile('file', this._encodedData, 'file'); } else { v4.addFile('file', com.newgrounds.encoders.json.JSON.encode(this._encodedData), 'file'); } if (this.__get__iconLoaded()) { v4.addFile('thumbnail', this._encodedIcon, 'thumbnail'); } v4.addEventListener(com.newgrounds.APIEvent.COMMAND_COMPLETE, {'target': this, 'func': this.onSaveComplete}); (this._group.__get__connection()).sendCommand(v4); }; v2.encodeData = function (encode) { this._encoderQueue = []; this._encoding = encode; if (encode) { this._encodedData = this._data; this.preEncodeObject(this, '_encodedData'); } else { this.preEncodeObject(this, '_data'); } this.encodeObject(); }; v2.preEncodeObject = function (parent, property) { var v3 = parent[property]; var v5; try { if (this._encoding) { v5 = v3 instanceof flash.display.BitmapData; } else { v5 = v3.type == '__bitmap'; } } var v2 = v3; var v8; if (v5) { this._encoderQueue.push({'parent': parent, 'property': property}); } else { if (typeof v3 == 'object' && !v8) { if (this._encoding) { if (v3 instanceof Array) { v2 = []; } else { v2 = {}; } for (var v4 in v3) { v2[v4] = v3[v4]; } parent[property] = v2; } for (v4 in v2) { this.preEncodeObject(v2, v4); } } } }; v2.encodeObject = function () { if (!this._encoderQueue.length) { if (this._encoding) { this.doSave(); } else { this._dataLoaded = true; this.checkLoadComplete(); } return undefined; } var v6 = this._encoderQueue.pop(); var v4 = v6.parent; var v3 = v6.property; var v2 = v4[v3]; var v5; if (this._encoding) { v5 = {'type': '__bitmap', 'width': v2.width, 'height': v2.height, 'transparent': v2.transparent}; v4[v3] = v5; this._encodingParent = v5; this._encodingProperty = 'data'; com.newgrounds.SaveFile.DATA_IMAGE_SCANNER.__set__encodeAlpha(v2.transparent); com.newgrounds.SaveFile.DATA_IMAGE_SCANNER.encode(flash.display.BitmapData(v2), this.encodeBitmapComplete, this); } else { this._encodingParent = v4; this._encodingProperty = v3; com.newgrounds.SaveFile.DATA_IMAGE_SCANNER.__set__encodeAlpha(v2.transparent); com.newgrounds.SaveFile.DATA_IMAGE_SCANNER.decode(String(v2.data), this.encodeBitmapComplete, this); } }; v2.encodeBitmapComplete = function (data) { this._encodingParent[this._encodingProperty] = data; this.encodeObject(); }; v2.load = function () { com.newgrounds.SaveFile._currentFile = this; this._dataLoaded = false; this._data = null; if (!this.__get__iconLoaded()) { this._iconLoader.addEventListener(com.newgrounds.APIEvent.ICON_LOADED, {'target': this, 'func': this.onIconLoaded}); this._iconLoader.load(); } this._dataLoader = new LoadVars(); var file = this; this._dataLoader.onData = function (data) { file.onDataLoaded(data); }; this._dataLoader.load(this._dataURL); }; v2.onIconLoaded = function (event) { if (!event.__get__success() && this._iconLoader.__get__url()) { com.newgrounds.Logger.logWarning('Unable to load the icon for this save file.'); } this._iconLoader.removeEventListener(com.newgrounds.APIEvent.ICON_LOADED, this.onIconLoaded); this.checkLoadComplete(); }; v2.checkLoadComplete = function () { if (this._dataLoaded && this.__get__iconLoaded()) { com.newgrounds.Logger.logMessage('Data loaded.'); this.dispatchEvent(new com.newgrounds.APIEvent(com.newgrounds.APIEvent.FILE_LOADED, this)); } }; v2.onDataLoaded = function (data) { try { if (data) { if (data.charAt(0) == '{') { this._data = com.newgrounds.encoders.json.JSON.decode(String(data)); } else { this._data = String(data); } this.encodeData(false); } } catch (v0) { if (Error(v0) != null) { var error = Error(v0); com.newgrounds.Logger.logError('Error while loading data:', error); this.dispatchEvent(new com.newgrounds.APIEvent(com.newgrounds.APIEvent.FILE_LOADED, this, com.newgrounds.APIEvent.ERROR_BAD_FILE)); } else { throw v0; } } }; v2.onDataError = function (error) { com.newgrounds.Logger.logError('Unable to load data:', error); this.dispatchEvent(new com.newgrounds.APIEvent(com.newgrounds.APIEvent.FILE_LOADED, this, com.newgrounds.APIEvent.ERROR_BAD_FILE)); }; v2.onSaveComplete = function (event) { if (event.__get__success()) { com.newgrounds.Logger.logMessage('File "' + this._name + '" saved!'); if (event.__get__data()) { this._id = (event.__get__data()).save_id; this._dataURL = unescape((event.__get__data()).file_url); } this.dispatchEvent(new com.newgrounds.APIEvent(com.newgrounds.APIEvent.FILE_SAVED, this)); } else { com.newgrounds.Logger.logError('Error saving file "' + this._name + '":', event.__get__error()); this.dispatchEvent(new com.newgrounds.APIEvent(com.newgrounds.APIEvent.FILE_SAVED, this, event.__get__error())); } }; v2.sendVote = function (ratingName, vote) { var v2 = this._group.getRating(ratingName); if (!v2) { com.newgrounds.Logger.logError('No save rating named "' + ratingName + '" exists for this save group.'); this.dispatchEvent(new com.newgrounds.APIEvent(com.newgrounds.APIEvent.VOTE_COMPLETE, {}, com.newgrounds.APIEvent.ERROR_INVALID_ARGUMENT)); return undefined; } vote = v2.validateValue(vote); if (isNaN(vote)) { com.newgrounds.Logger.logError('Invalid vote (' + vote + '). ' + ratingName + ' allows a range of ' + v2.__get__minimum() + '-' + v2.__get__maximum() + '.'); this.dispatchEvent(new com.newgrounds.APIEvent(com.newgrounds.APIEvent.VOTE_COMPLETE, {}, com.newgrounds.APIEvent.ERROR_INVALID_ARGUMENT)); return undefined; } com.newgrounds.Logger.logMessage('Voting ' + vote + ' for ' + ratingName + ' on ' + this._name + '...'); (this._group.__get__connection()).sendSimpleCommand('rateSaveFile', {'target': this, 'func': this.onVoteComplete}, null, {'group': this._group.__get__id(), 'save_id': this._id, 'rating_id': v2.__get__id(), 'vote': vote}); }; v2.onVoteComplete = function (event) { var v2 = event.__get__error(); if ((event.__get__data()).already_voted) { com.newgrounds.Logger.logError('Vote failed. You\'ve already voted on this rating today.'); v2 = com.newgrounds.APIEvent.ERROR_ALREADY_VOTED; } if (v2 == com.newgrounds.APIEvent.ERROR_NONE) { var v3 = this._group.getRatingById((event.__get__data()).rating_id); if (v3) { this._ratings[v3.__get__name()] = v3.validateValue((event.__get__data()).score); } com.newgrounds.Logger.logMessage('Vote complete!'); } this.dispatchEvent(new com.newgrounds.APIEvent(com.newgrounds.APIEvent.VOTE_COMPLETE, this, v2)); }; v2.clone = function () { var v3 = new com.newgrounds.SaveFile(this._group); v3._data = this._data; v3._description = this._description; v3._draft = this._draft; v3._fileSize = this._fileSize; v3._iconLoader.__set__bitmapData(this._iconLoader.bitmapData); var v2; for (v2 in this._keys) { v3._keys[v2] = this._keys[v2]; } for (v2 in this._ratings) { v3._ratings[v2] = this._ratings[v2]; } v3._name = this._name; return v3; }; v1.ICON_WIDTH = 90; v1.ICON_HEIGHT = 90; v1.DEFAULT_ICON = flash.display.BitmapData.loadBitmap('DefaultSaveIcon'); v1.STATUS_PRIVATE = 0; v1.STATUS_SHARED = 1; v1.STATUS_UNAPPROVED = 2; v1.STATUS_APPROVED = 3; v1._imageFilePath = ''; v1._saveFilePath = ''; v1.ICON_IMAGE_SCANNER = new com.newgrounds.encoders.ImageScanner(); v1.DATA_IMAGE_SCANNER = new com.newgrounds.encoders.ImageScanner(64, 6); v2.addProperty('authorId', v2.__get__authorId, function () {}); v2.addProperty('authorName', v2.__get__authorName, function () {}); v2.addProperty('bytesLoaded', v2.__get__bytesLoaded, function () {}); v2.addProperty('bytesTotal', v2.__get__bytesTotal, function () {}); v2.addProperty('createdDate', v2.__get__createdDate, function () {}); v1.addProperty('currentFile', v1.__get__currentFile, function () {}); v2.addProperty('data', v2.__get__data, v2.__set__data); v2.addProperty('description', v2.__get__description, v2.__set__description); v2.addProperty('draft', v2.__get__draft, v2.__set__draft); v2.addProperty('group', v2.__get__group, function () {}); v2.addProperty('icon', v2.__get__icon, v2.__set__icon); v2.addProperty('iconLoaded', v2.__get__iconLoaded, function () {}); v2.addProperty('id', v2.__get__id, function () {}); v2.addProperty('keys', v2.__get__keys, function () {}); v2.addProperty('name', v2.__get__name, v2.__set__name); v2.addProperty('ratings', v2.__get__ratings, function () {}); v2.addProperty('readOnly', v2.__get__readOnly, function () {}); v2.addProperty('updatedDate', v2.__get__updatedDate, function () {}); v2.addProperty('views', v2.__get__views, function () {}); ASSetPropFlags(com.newgrounds.SaveFile.prototype, null, 1); } #endinitclip } movieClip 1195 __Packages.com.newgrounds.SaveGroup { #initclip if (!_global.com) { _global.com = new Object(); } if (!_global.com.newgrounds) { _global.com.newgrounds = new Object(); } if (!_global.com.newgrounds.SaveGroup) { var v1 = function (connection, name, id, type, keys, ratings) { this._connection = connection; this._id = id; this._name = name; this._type = type; this._keysArray = keys; this._ratingsArray = ratings; this._keys = new Object(); this._ratings = new Object(); var v11; for (var v7 in keys) { var v2 = keys[v7]; this._keys[v2.__get__name()] = v2; } for (var v6 in ratings) { var v3 = ratings[v6]; this._ratings[v3.__get__name()] = v3; } }; com.newgrounds.SaveGroup = v1; var v2 = v1.prototype; v2.__get__connection = function () { return this._connection; }; v2.__get__name = function () { return this._name; }; v2.__get__type = function () { return this._type; }; v2.__get__id = function () { return this._id; }; v2.__get__keys = function () { return this._keysArray; }; v2.__get__ratings = function () { return this._ratingsArray; }; v2.getKey = function (name) { return this._keys[name]; }; v2.getRating = function (name) { return this._ratings[name]; }; v2.getKeyById = function (id) { for (var v4 in this._keys) { var v2 = this._keys[v4]; if (v2.__get__id() == id) { return v2; } } return null; }; v2.getRatingById = function (id) { for (var v4 in this._ratings) { var v2 = this._ratings[v4]; if (v2.__get__id() == id) { return v2; } } return null; }; v2.toString = function () { return 'SaveGroup: ' + this.__get__name() + ' Keys: ' + this._keysArray + ' Ratings: ' + this._ratingsArray; }; v1.TYPE_SYSTEM = 0; v1.TYPE_PRIVATE = 1; v1.TYPE_PUBLIC = 2; v1.TYPE_MODERATED = 3; v2.addProperty('connection', v2.__get__connection, function () {}); v2.addProperty('id', v2.__get__id, function () {}); v2.addProperty('keys', v2.__get__keys, function () {}); v2.addProperty('name', v2.__get__name, function () {}); v2.addProperty('ratings', v2.__get__ratings, function () {}); v2.addProperty('type', v2.__get__type, function () {}); ASSetPropFlags(com.newgrounds.SaveGroup.prototype, null, 1); } #endinitclip } movieClip 1193 __Packages.com.newgrounds.SaveKey { #initclip if (!_global.com) { _global.com = new Object(); } if (!_global.com.newgrounds) { _global.com.newgrounds = new Object(); } if (!_global.com.newgrounds.SaveKey) { var v1 = function (name, id, type) { this._name = name; this._id = id; this._type = type; }; com.newgrounds.SaveKey = v1; var v2 = v1.prototype; v2.__get__name = function () { return this._name; }; v2.__get__id = function () { return this._id; }; v2.__get__type = function () { return this._type; }; v2.validateValue = function (value) { switch (this._type) { return null; case com.newgrounds.SaveKey.TYPE_INTEGER: value = Number(value); if (!isNaN(value)) { var v3 = int(value); if (v3 != value) { com.newgrounds.Logger.logWarning('Float value ' + value + ' given for integer key "' + this._name + '". Clamping to ' + v3 + '.'); } return v3; } return null; case com.newgrounds.SaveKey.TYPE_FLOAT: value = Number(value); if (!isNaN(value)) { return isNaN(Number(value)); } return null; case com.newgrounds.SaveKey.TYPE_BOOLEAN: return Boolean(value); return null; case com.newgrounds.SaveKey.TYPE_STRING: return value ? value.toString() : ''; return null; } return null; }; v2.toString = function () { return this._name; }; v1.TYPE_FLOAT = 1; v1.TYPE_INTEGER = 2; v1.TYPE_STRING = 3; v1.TYPE_BOOLEAN = 4; v2.addProperty('id', v2.__get__id, function () {}); v2.addProperty('name', v2.__get__name, function () {}); v2.addProperty('type', v2.__get__type, function () {}); ASSetPropFlags(com.newgrounds.SaveKey.prototype, null, 1); } #endinitclip } movieClip 1194 __Packages.com.newgrounds.SaveRating { #initclip if (!_global.com) { _global.com = new Object(); } if (!_global.com.newgrounds) { _global.com.newgrounds = new Object(); } if (!_global.com.newgrounds.SaveRating) { var v1 = function (name, id, isFloat, minimum, maximum) { this._name = name; this._id = id; this._isFloat = isFloat; this._minimum = minimum; this._maximum = maximum; }; com.newgrounds.SaveRating = v1; var v2 = v1.prototype; v2.__get__name = function () { return this._name; }; v2.__get__id = function () { return this._id; }; v2.__get__isFloat = function () { return this._isFloat; }; v2.__get__minimum = function () { return this._minimum; }; v2.__get__maximum = function () { return this._maximum; }; v2.validateValue = function (value) { var v2 = Number(value); if (isNaN(v2)) { com.newgrounds.Logger.logError('Invalid value for rating "' + this._name + '".'); return NaN; } if (v2 < this._minimum) { com.newgrounds.Logger.logWarning(v2 + ' is out of acceptable range for rating "' + this._name + '". Clamping to ' + this._minimum + '.'); return this._minimum; } if (v2 > this._maximum) { com.newgrounds.Logger.logWarning(v2 + ' is out of acceptable range for rating "' + this._name + '". Clamping to ' + this._maximum + '.'); return this._maximum; } if (!this.__get__isFloat()) { var v3 = int(v2); if (v3 != v2) { com.newgrounds.Logger.logWarning('Float value ' + v2 + ' given for integer rating "' + this._name + '". Clamping to ' + v3 + '.'); } return v3; } return v2; }; v2.toString = function () { return this._name; }; v2.addProperty('id', v2.__get__id, function () {}); v2.addProperty('isFloat', v2.__get__isFloat, function () {}); v2.addProperty('maximum', v2.__get__maximum, function () {}); v2.addProperty('minimum', v2.__get__minimum, function () {}); v2.addProperty('name', v2.__get__name, function () {}); ASSetPropFlags(com.newgrounds.SaveRating.prototype, null, 1); } #endinitclip } movieClip 1189 __Packages.com.newgrounds.BitmapLoader { #initclip if (!_global.com) { _global.com = new Object(); } if (!_global.com.newgrounds) { _global.com.newgrounds = new Object(); } if (!_global.com.newgrounds.BitmapLoader) { var v1 = function (defaultBitmap, url) { super(); this._bitmapData = defaultBitmap; this._url = url; }; com.newgrounds.BitmapLoader = v1; com.newgrounds.BitmapLoader extends com.newgrounds.APIEventDispatcher; var v2 = v1.prototype; v2.__get__url = function () { return this._url; }; v2.__set__url = function (v) { this._loaded = false; this._url = v; return this.__get__url(); }; v2.__get__bitmapData = function () { return this._bitmapData; }; v2.__set__bitmapData = function (v) { this._bitmapData = v; this._loaded = true; return this.__get__bitmapData(); }; v2.__get__loaded = function () { return this._loaded; }; v2.disposeLoader = function () { if (this._loader) { if (this._loaderClip._parent == _root) { this._loader.unloadClip(this._loaderClip.bitmap); this._loaderClip.removeMovieClip(); } this._loader = null; this._loaderClip = null; } }; v2.load = function () { if (!this._url || this._url == '') { this.onLoadComplete(); return undefined; } this._loaded = false; if (this._bitmapData) { this._bitmapData.dispose(); this._bitmapData = null; } this.disposeLoader(); this.attachBitmap(null); }; v2.attachBitmap = function (parent) { if (!parent) { parent = _root; } var v5 = parent.getNextHighestDepth(); var v3 = parent.createEmptyMovieClip('__bitmap' + v5, v5); if (!this._loaded && this._url && this._url != '') { v3.createEmptyMovieClip('bitmap', 0); this._loader = new MovieClipLoader(); this._loaderClip = v3; if (parent == _root) { this._loaderClip._visible = false; } var thisObj = this; this._loaderClip.onEnterFrame = function () { thisObj.pollLoad(); }; this._loader.addListener({'onLoadError': function () { thisObj.onLoadComplete(); }}); this._loader.loadClip(this._url, v3.bitmap); return v3; } v3.attachBitmap(this._bitmapData, 0); return v3; }; v2.pollLoad = function () { if (this._loaderClip._width) { this.onLoadComplete(); } }; v2.onLoadComplete = function () { var v2; if (this._loader && this._loaderClip && this._loaderClip._width) { try { this._loaderClip.onEnterFrame = null; v2 = new flash.display.BitmapData(this._loaderClip._width, this._loaderClip._height, true, 0); v2.draw(this._loaderClip); this._bitmapData = v2; this._loaded = true; } catch (error) { if (v2) { v2.dispose(); } } } this.disposeLoader(); this.dispatchEvent(new com.newgrounds.APIEvent(com.newgrounds.APIEvent.ICON_LOADED, this, this._loaded ? null : com.newgrounds.APIEvent.ERROR_BAD_FILE)); }; v1._cacheSeed = 0; v2._loaded = true; v2.addProperty('bitmapData', v2.__get__bitmapData, v2.__set__bitmapData); v2.addProperty('loaded', v2.__get__loaded, function () {}); v2.addProperty('url', v2.__get__url, v2.__set__url); ASSetPropFlags(com.newgrounds.BitmapLoader.prototype, null, 1); } #endinitclip } movieClip 1198 __Packages.com.newgrounds.SaveQuery { #initclip if (!_global.com) { _global.com = new Object(); } if (!_global.com.newgrounds) { _global.com.newgrounds = new Object(); } if (!_global.com.newgrounds.SaveQuery) { var v1 = function (group) { super(); this._group = group; this._connection = group.connection; this.reset(); }; com.newgrounds.SaveQuery = v1; com.newgrounds.SaveQuery extends com.newgrounds.APIEventDispatcher; var v2 = v1.prototype; v2.__get__group = function () { return this._group; }; v2.__get__resultsPerPage = function () { return this._resultsPerPage; }; v2.__set__resultsPerPage = function (val) { this._resultsPerPage = Math.min(Math.max(val, 1), 100); return this.__get__resultsPerPage(); }; v2.__get__page = function () { return this._page; }; v2.__set__page = function (val) { this._page = Math.max(val, 1); return this.__get__page(); }; v2.prevPage = function () { this.__set__page(this.__get__page() - 1); }; v2.nextPage = function () { this.__set__page(this.__get__page() + 1); }; v2.__get__isRandomized = function () { return this._isRandomized; }; v2.__set__isRandomized = function (val) { this._isRandomized = val; return this.__get__isRandomized(); }; v2.__get__files = function () { return this._files; }; v2.reset = function () { this._page = 1; this._resultsPerPage = 10; this._isRandomized = false; this._lookupKeys = []; this._lookupRatings = []; this._fileConditions = []; this._keyConditions = []; this._ratingConditions = []; this._sortFields = []; this._files = []; this.includeAllFields(); }; v2.clone = function () { var v2 = new com.newgrounds.SaveQuery(this._group); v2._page = this._page; v2._resultsPerPage = this._resultsPerPage; v2._isRandomized = this._isRandomized; v2._lookupKeys = this._lookupKeys.concat(); v2._lookupRatings = this._lookupRatings.concat(); v2._fileConditions = this._fileConditions.concat(); v2._keyConditions = this._keyConditions.concat(); v2._ratingConditions = this._ratingConditions.concat(); return v2; }; v2.includeAllFields = function () { for (var v5 in this._group.__get__keys()) { var v2 = (this._group.__get__keys())[v5]; this._lookupKeys.push(v2.__get__id()); } for (var v4 in this._group.__get__ratings()) { var v3 = (this._group.__get__ratings())[v4]; this._lookupRatings.push(v3.__get__id()); } }; v2.addCondition = function (field, operator, value) { var v2; v2 = 0; while (v2 < com.newgrounds.SaveQuery.FILE_FIELDS.length) { if (com.newgrounds.SaveQuery.FILE_FIELDS[v2] == field) { break; } ++v2; } if (v2 == com.newgrounds.SaveQuery.FILE_FIELDS.length) { v2 = -1; } if (v2 >= 0) { this._fileConditions.push({'field': v2, 'operator': operator, 'value': value}); } else { var v3 = this._group.getKey(field); if (v3) { value = v3.validateValue(value); this._keyConditions.push({'key_id': v3.__get__id(), 'operator': operator, 'value': value}); return undefined; } var v4 = field.split('.'); var v6 = this._group.getRating(v4[0]); if (v6) { value = v6.validateValue(value); this._ratingConditions.push({'rating_id': v6.__get__id(), 'operator': operator, 'value': value, 'column': v4[1] ? v4[1] : 'score'}); return undefined; } com.newgrounds.Logger.logError('The save group "' + this._group.__get__name() + '" does not have a field named "' + field + '".'); } }; v2.sortOn = function (field, sortDescending) { if (sortDescending == undefined) { sortDescending = false; } var v2; v2 = 0; while (v2 < com.newgrounds.SaveQuery.FILE_FIELDS.length) { if (com.newgrounds.SaveQuery.FILE_FIELDS[v2] == field) { break; } ++v2; } if (v2 == com.newgrounds.SaveQuery.FILE_FIELDS.length) { v2 = -1; } if (v2 >= 0) { this._sortFields.push({'table': com.newgrounds.SaveQuery.TABLE_FILES, 'field': v2, 'desc': sortDescending}); } else { var v5 = this._group.getKey(field); if (v5) { this._sortFields.push({'table': com.newgrounds.SaveQuery.TABLE_KEYS, 'field': v5.__get__id(), 'desc': sortDescending}); return undefined; } var v3 = field.split('.'); var v6 = this._group.getRating(v3[0]); if (v6) { this._sortFields.push({'table': com.newgrounds.SaveQuery.TABLE_RATINGS, 'field': v6.__get__id(), 'desc': sortDescending, 'extra': v3[1] ? v3[1] : 'score'}); return undefined; } com.newgrounds.Logger.logError('The save group "' + this._group.__get__name() + '" does not have a field named "' + field + '".'); } }; v2.execute = function () { var v5 = {}; v5.page = this._page; v5.num_results = this._resultsPerPage; if (this._isRandomized) { v5.randomize = 1; } if (this._lookupKeys && this._lookupKeys.length) { v5.lookup_keys = this._lookupKeys; } if (this._lookupRatings && this._lookupRatings.length) { v5.lookup_ratings = this._lookupRatings; } if (this._fileConditions && this._fileConditions.length) { v5.file_conditions = this._fileConditions; } if (this._keyConditions && this._keyConditions.length) { v5.key_conditions = this._keyConditions; } if (this._ratingConditions && this._ratingConditions.length) { v5.rating_conditions = this._ratingConditions; } if (this._sortFields && this._sortFields.length) { v5.sort_conditions = this._sortFields; } this._connection.sendSimpleCommand('lookupSaveFiles', {'target': this, 'func': this.onQueryComplete}, {'publisher_id': this._connection.publisherId, 'group_id': this._group.__get__id(), 'query': v5}); }; v2.onQueryComplete = function (event) { if (event.__get__success()) { var v4 = event.__get__data(); this._files = []; if (v4.files) { var v2 = 0; while (v2 < v4.files.length) { var v3 = com.newgrounds.SaveFile.fromObject(this._group, v4.files[v2]); if (v3) { this._files.push(v3); } ++v2; } } this.dispatchEvent(new com.newgrounds.APIEvent(com.newgrounds.APIEvent.QUERY_COMPLETE, this)); } else { com.newgrounds.Logger.logError('Query failed: ' + event.__get__error()); this.dispatchEvent(new com.newgrounds.APIEvent(com.newgrounds.APIEvent.QUERY_COMPLETE, this, event.__get__error())); } }; v1.FILE_ID = 'fileId'; v1.AUTHOR_ID = 'authorId'; v1.AUTHOR_NAME = 'authorName'; v1.FILE_NAME = 'fileName'; v1.CREATED_ON = 'createdOn'; v1.UPDATED_ON = 'updatedOn'; v1.FILE_VIEWS = 'fileViews'; v1.FILE_STATUS = 'fileStatus'; v1.FILE_FIELDS = [com.newgrounds.SaveQuery.FILE_ID, com.newgrounds.SaveQuery.AUTHOR_ID, com.newgrounds.SaveQuery.AUTHOR_NAME, com.newgrounds.SaveQuery.FILE_NAME, com.newgrounds.SaveQuery.CREATED_ON, com.newgrounds.SaveQuery.UPDATED_ON, com.newgrounds.SaveQuery.FILE_VIEWS, com.newgrounds.SaveQuery.FILE_STATUS]; v1.OPERATOR_EQUAL = '='; v1.OPERATOR_LESS_THAN = '<'; v1.OPERATOR_GREATER_THAN = '>'; v1.OPERATOR_NOT_EQUAL = '!='; v1.OPERATOR_LESS_OR_EQUAL = '<='; v1.OPERATOR_GREATER_OR_EQUAL = '>='; v1.OPERATOR_CONTAINS = '*'; v1.OPERATOR_NOT_CONTAINS = '!*'; v1.OPERATOR_NOT_BEGINS_WITH = '!*='; v1.OPERATOR_NOT_ENDS_WITH = '!=*'; v1.OPERATOR_BEGINS_WITH = '*='; v1.OPERATOR_ENDS_WITH = '=*'; v1.TABLE_FILES = 1; v1.TABLE_KEYS = 2; v1.TABLE_RATINGS = 3; v2._page = 1; v2._resultsPerPage = 10; v2._isRandomized = false; v2.addProperty('files', v2.__get__files, function () {}); v2.addProperty('group', v2.__get__group, function () {}); v2.addProperty('isRandomized', v2.__get__isRandomized, v2.__set__isRandomized); v2.addProperty('page', v2.__get__page, v2.__set__page); v2.addProperty('resultsPerPage', v2.__get__resultsPerPage, v2.__set__resultsPerPage); ASSetPropFlags(com.newgrounds.SaveQuery.prototype, null, 1); } #endinitclip } movieClip 1190 __Packages.com.newgrounds.Medal { #initclip if (!_global.com) { _global.com = new Object(); } if (!_global.com.newgrounds) { _global.com.newgrounds = new Object(); } if (!_global.com.newgrounds.Medal) { var v1 = function (connection, id, name, description, secret, unlocked, value, difficultyId, iconURL) { super(); this._connection = connection; this._id = id; this._name = name; this._description = description; this._secret = secret; this._unlocked = unlocked; this._value = value; this._difficulty = com.newgrounds.Medal.DIFFICULTIES[difficultyId]; this._iconLoader = new com.newgrounds.BitmapLoader(com.newgrounds.Medal.DEFAULT_ICON, iconURL); this._iconLoader.load(); }; com.newgrounds.Medal = v1; com.newgrounds.Medal extends com.newgrounds.APIEventDispatcher; var v2 = v1.prototype; v2.__get__difficulty = function () { return this._difficulty; }; v2.__get__icon = function () { return this._iconLoader.__get__bitmapData(); }; v2.__get__id = function () { return this._id; }; v2.__get__name = function () { return this._name; }; v2.__get__description = function () { return this._description; }; v2.__get__secret = function () { return this._secret; }; v2.__get__unlocked = function () { return this._unlocked; }; v2.__get__value = function () { return this._value; }; v2.toString = function () { if (!this._unlocked) { return 'Medal: ' + this._name + '\t\t(' + 'locked, ' + this._value + 'pts, ' + this._difficulty + ')'; } return 'Medal: ' + this._name + '\t\t(' + 'unlocked, ' + this._value + 'pts, ' + this._difficulty + ')'; }; v2.attachIcon = function (parent) { return this._iconLoader.attachBitmap(parent); }; v2.unlock = function () { if (this._unlocked) { com.newgrounds.Logger.logWarning('Medal "' + this._name + '" is already unlocked.'); return undefined; } com.newgrounds.Logger.logMessage('Unlocking medal "' + this.__get__name() + '"...'); this._unlocked = true; if (this._connection.__get__hasUserSession()) { this._connection.sendSimpleCommand('unlockMedal', {'target': this, 'func': this.onUnlockConfirmed}, null, {'medal_id': this.__get__id()}); } this.dispatchEvent(new com.newgrounds.APIEvent(com.newgrounds.APIEvent.MEDAL_UNLOCKED, this)); }; v2.setUnlocked = function (unlocked) { this._unlocked = unlocked; }; v2.onUnlockConfirmed = function (event) { if (event.__get__success()) { com.newgrounds.Logger.logMessage('Medal "' + this.__get__name() + '" unlocked.'); } else { com.newgrounds.Logger.logError('Failed to unlock "' + this.__get__name() + '"!'); } this.dispatchEvent(new com.newgrounds.APIEvent(com.newgrounds.APIEvent.MEDAL_UNLOCK_CONFIRMED, this, event.__get__error())); }; v1.ICON_WIDTH = 50; v1.ICON_HEIGHT = 50; v1.DEFAULT_ICON = flash.display.BitmapData.loadBitmap('DefaultMedalIcon'); v1.DIFFICULTY_EASY = 'Easy'; v1.DIFFICULTY_MODERATE = 'Moderate'; v1.DIFFICULTY_CHALLENGING = 'Challenging'; v1.DIFFICULTY_DIFFICULT = 'Difficult'; v1.DIFFICULTY_BRUTAL = 'Brutal'; v1.DIFFICULTIES = ['Unknown', com.newgrounds.Medal.DIFFICULTY_EASY, com.newgrounds.Medal.DIFFICULTY_MODERATE, com.newgrounds.Medal.DIFFICULTY_CHALLENGING, com.newgrounds.Medal.DIFFICULTY_DIFFICULT, com.newgrounds.Medal.DIFFICULTY_BRUTAL]; v2.addProperty('description', v2.__get__description, function () {}); v2.addProperty('difficulty', v2.__get__difficulty, function () {}); v2.addProperty('icon', v2.__get__icon, function () {}); v2.addProperty('id', v2.__get__id, function () {}); v2.addProperty('name', v2.__get__name, function () {}); v2.addProperty('secret', v2.__get__secret, function () {}); v2.addProperty('unlocked', v2.__get__unlocked, function () {}); v2.addProperty('value', v2.__get__value, function () {}); ASSetPropFlags(com.newgrounds.Medal.prototype, null, 1); } #endinitclip } movieClip 1192 __Packages.com.newgrounds.ScoreBoard { #initclip if (!_global.com) { _global.com = new Object(); } if (!_global.com.newgrounds) { _global.com.newgrounds = new Object(); } if (!_global.com.newgrounds.ScoreBoard) { var v1 = function (connection, name, id) { super(); this._connection = connection; this._name = name; this._id = id; }; com.newgrounds.ScoreBoard = v1; com.newgrounds.ScoreBoard extends com.newgrounds.APIEventDispatcher; var v2 = v1.prototype; v2.__get__name = function () { return this._name; }; v2.__get__scores = function () { return this._scores; }; v2.__get__period = function () { return this._period; }; v2.__set__period = function (val) { this._period = val; return this.__get__period(); }; v2.__get__firstResult = function () { return this._firstResult; }; v2.__set__firstResult = function (val) { this._firstResult = Math.max(1, val); return this.__get__firstResult(); }; v2.__get__numResults = function () { return this._numResults; }; v2.__set__numResults = function (val) { this._numResults = val; return this.__get__numResults(); }; v2.__get__tag = function () { return this._tag; }; v2.__set__tag = function (val) { this._tag = val; return this.__get__tag(); }; v2.__get__page = function () { return Math.ceil((this._firstResult - 1) / this._numResults) + 1; }; v2.prevPage = function () { if (this.__get__firstResult() > this._numResults) { this.firstResult -= this._numResults; } }; v2.nextPage = function () { this.firstResult += this._numResults; }; v2.loadScores = function () { this._connection.sendSimpleCommand('loadScores', {'target': this, 'func': this.onScoresLoaded}, {'publisher_id': this._connection.publisherId, 'board': this._id, 'page': (this._firstResult - 1) / this._numResults + 1, 'num_results': this._numResults, 'period': this._period, 'tag': this._tag}); }; v2.postScore = function (numericScore, tag) { if (tag == undefined) { tag = null; } if (isNaN(numericScore)) { com.newgrounds.Logger.logError('Cannot post invalid score: ' + numericScore); this.dispatchEvent(new com.newgrounds.APIEvent(com.newgrounds.APIEvent.SCORE_POSTED, null, com.newgrounds.APIEvent.ERROR_INVALID_ARGUMENT)); return undefined; } com.newgrounds.Logger.logMessage('Posting a score of ' + numericScore + ' by ' + this._connection.username + ' to scoreboard "' + this._name + '"...'); this._connection.sendSimpleCommand('postScore', {'target': this, 'func': this.onScorePosted}, null, {'user_name': this._connection.username, 'board': this._id, 'value': numericScore, 'tag': tag}); }; v2.onScoresLoaded = function (event) { var v4 = event.__get__data(); this._scores = []; var v5; if (v4.first_result) { v5 = v4.first_result; } else { v5 = this._firstResult; } if (v4.scores) { var v3 = 0; while (v3 < v4.scores.length) { var v2 = v4.scores[v3]; if (v2) { this._scores[v3] = new com.newgrounds.Score(v5, v2.username, v2.value, v2.numeric_value, v2.tag); } v3++; v5++; } } this.dispatchEvent(new com.newgrounds.APIEvent(com.newgrounds.APIEvent.SCORES_LOADED, this)); }; v2.onScorePosted = function (event) { if (event.__get__success()) { com.newgrounds.Logger.logMessage('Score posted!'); var v4 = event.__get__data(); var v2 = {}; v2.score = v4.value; v2.scoreBoard = this; } else { com.newgrounds.Logger.logError('Error posting score: ' + event.__get__error()); } this.dispatchEvent(new com.newgrounds.APIEvent(com.newgrounds.APIEvent.SCORE_POSTED, storedv2, event.__get__error())); }; v2.toString = function () { return 'Scoreboard: ' + this._name; }; v1.TODAY = 'Today'; v1.THIS_WEEK = 'This Week'; v1.THIS_MONTH = 'This Month'; v1.THIS_YEAR = 'This Year'; v1.ALL_TIME = 'All-Time'; v2._period = com.newgrounds.ScoreBoard.ALL_TIME; v2._firstResult = 1; v2._numResults = 10; v2.addProperty('firstResult', v2.__get__firstResult, v2.__set__firstResult); v2.addProperty('name', v2.__get__name, function () {}); v2.addProperty('numResults', v2.__get__numResults, v2.__set__numResults); v2.addProperty('page', v2.__get__page, function () {}); v2.addProperty('period', v2.__get__period, v2.__set__period); v2.addProperty('scores', v2.__get__scores, function () {}); v2.addProperty('tag', v2.__get__tag, v2.__set__tag); ASSetPropFlags(com.newgrounds.ScoreBoard.prototype, null, 1); } #endinitclip } movieClip 1181 __Packages.com.newgrounds.Logger { #initclip if (!_global.com) { _global.com = new Object(); } if (!_global.com.newgrounds) { _global.com.newgrounds = new Object(); } if (!_global.com.newgrounds.Logger) { var v1 = function () {}; com.newgrounds.Logger = v1; var v2 = v1.prototype; v1.logInternal = function () { var v2 = arguments; com.newgrounds.Logger.log(com.newgrounds.Logger.PRIORITY_INTERNAL, v2); }; v1.logMessage = function () { var v2 = arguments; com.newgrounds.Logger.log(com.newgrounds.Logger.PRIORITY_MESSAGE, v2); }; v1.logWarning = function () { var v2 = arguments; com.newgrounds.Logger.log(com.newgrounds.Logger.PRIORITY_WARNING, v2); }; v1.logError = function () { var v2 = arguments; com.newgrounds.Logger.log(com.newgrounds.Logger.PRIORITY_ERROR, v2); }; v1.log = function (priority, messages) { if (priority == undefined) { priority = com.newgrounds.Logger.PRIORITY_MESSAGE; } if (messages == undefined) { messages = null; } if (priority >= com.newgrounds.Logger._messageLevel) { var v1 = 0; while (v1 < messages.length) { trace(com.newgrounds.Logger.HEADER + messages[v1]); com.newgrounds.Logger._eventDispatcher.dispatchEvent(new com.newgrounds.APIEvent(com.newgrounds.APIEvent.LOG, messages[v1])); ++v1; } } if (priority >= com.newgrounds.Logger._throwLevel) { throw new Error(messages.join('\n')); } }; v1.addEventListener = function (event, listener) { com.newgrounds.Logger._eventDispatcher.addEventListener(event, listener, false, 0, false); }; v1.PRIORITY_INTERNAL = 0; v1.PRIORITY_MESSAGE = 1; v1.PRIORITY_WARNING = 2; v1.PRIORITY_ERROR = 3; v1.PRIORITY_MAX = 4; v1.HEADER = '[Newgrounds API] :: '; v1._eventDispatcher = new com.newgrounds.EventDispatcher(); v1._messageLevel = com.newgrounds.Logger.PRIORITY_MESSAGE; v1._throwLevel = com.newgrounds.Logger.PRIORITY_MAX; ASSetPropFlags(com.newgrounds.Logger.prototype, null, 1); } #endinitclip } movieClip 4832 __Packages.MadnessMenu { #initclip if (!_global.MadnessMenu) { var v1 = function () { super(); this.onEnterFrame = this.tick; }; _global.MadnessMenu = v1; _global.MadnessMenu extends MovieClip; var v2 = v1.prototype; v2.init = function () { this.myRoster = MadnessRoster.playerRoster; this.setIcons(); this = MadnessMenu.currentMenu; }; v2.tick = function () { var v2; var v3 = 0; while (v3 < this.totalIcons) { v2 = this['icon' + String(v3)]; v2.targetHealthY = (this.iconHeight + 5) * (v2.myDataRef.myHealth / v2.myDataRef.myHealthMax); if (v2.targetHealthY < -this.iconHeight - 5) { v2.targetHealthY = -this.iconHeight - 5; } v2.healthBar._y += (v2.targetHealthY - v2.healthBar._y) * 0.6; if (v2.myDataRef.myHealth <= 0) { v2.deadX._visible = true; } else { v2.deadX._visible = false; } ++v3; } this.setWeaponIcon(); this.slowMoBar.myBar._xscale = 100 * (this.myRoster.teamLeader.mySlowMo / this.myRoster.teamLeader.mySlowMoMax); }; v2.setIcons = function () { var v3 = 1; while (v3 < this.totalIcons) { this['icon' + String(v3)].removeMovieClip(); ++v3; } this.icon0.myDataRef = this.myRoster.teamLeader; this.icon0.mySprite.gotoAndStop(this.icon0.myDataRef.myIconPos); this.icon0.targetHealthY = 0; this.icon0.headWounds = this.icon0.myDataRef.headWounds; this.icon0.bodyWounds = this.icon0.myDataRef.bodyWounds; this.icon0.headSpray = this.icon0.myDataRef.headSpray; this.icon0.bodySpray = this.icon0.myDataRef.bodySpray; this.icon0.myWeapon = 0; this.icon0.myHat = 0; this.icon0.myMask = 0; this.icon0.myMouth = 0; this.icon0.myShirt = 0; MadnessCharacter.adjustSprite(this.icon0); this.charNameTEXT.text = this.icon0.myDataRef.myName; this.setWeaponIcon(); this.totalIcons = 1; var v4; v3 = 0; while (v3 < this.myRoster.myActiveMembers.length) { v4 = this.myRoster.myActiveMembers[v3]; if (v4 != this.myRoster.teamLeader) { var v2 = this.attachMovie('ui_mug', 'icon' + this.totalIcons, this.getNextHighestDepth()); v2._x = this.iconStartX + (this.iconWidth * this.reduceSize + this.iconSpace) * this.totalIcons; v2._y = this.iconStartY; v2._xscale *= this.reduceSize; v2._yscale *= this.reduceSize; v2.myDataRef = v4; v2.targetHealthY = 0; v2.headWounds = v2.myDataRef.headWounds; v2.bodyWounds = v2.myDataRef.bodyWounds; v2.headSpray = v2.myDataRef.headSpray; v2.bodySpray = v2.myDataRef.bodySpray; v2.myWeapon = 0; v2.myHat = 0; v2.myMask = 0; v2.myMouth = 0; v2.myShirt = 0; v2.mySprite.gotoAndStop(v2.myDataRef.myIconPos); MadnessCharacter.adjustSprite(v2); ++this.totalIcons; } ++v3; } }; v2.refreshPics = function () { var v2 = 0; while (v2 < this.myRoster.myActiveMembers.length) { MadnessCharacter.adjustSprite(this['icon' + String(v2)]); ++v2; } }; v2.setWeaponIcon = function () { this.iconWeapon.myGun = this.icon0.myDataRef.myWeapons[this.icon0.myDataRef.myWeapon]; if (this.iconWeapon.myGun != undefined) { this.iconWeapon.myAmmo.gotoAndStop(1); if (this.iconWeapon.myGun.melee) { this.iconWeapon.myWeapon.gotoAndStop(this.iconWeapon.myGun.myType); this.iconWeapon.myWeapon2.gotoAndStop('none'); ItemGenerator.setItemSprite(this.iconWeapon.myWeapon.mySprite, this.iconWeapon.myGun); this.iconWeapon.myAmmo.myBar._x = -this.iconWeapon.myAmmo.myBar._width + (this.iconWeapon.myGun.myHealth / this.iconWeapon.myGun.myHealthMax) * this.iconWeapon.myAmmo.myBar._width; this.iconWeapon.myAmmo.myBullet.gotoAndStop(2); } else { this.iconWeapon.myWeapon.gotoAndStop('none'); this.iconWeapon.myWeapon2.gotoAndStop(this.iconWeapon.myGun.myType); if (this.iconWeapon.myGun.upgradeSilencer) { this.iconWeapon.myWeapon2.gotoAndStop(this.iconWeapon.myGun.myType + '_silenced'); } this.iconWeapon.myAmmo.myBar._x = -this.iconWeapon.myAmmo.myBar._width + (this.iconWeapon.myGun.myAmmo / this.iconWeapon.myGun.myAmmoMax) * this.iconWeapon.myAmmo.myBar._width; this.iconWeapon.myAmmo.myBullet.gotoAndStop(1); } this.iconWeapon.myAmmo.myBullet._x = this.iconWeapon.myAmmo.myBar._x + this.iconWeapon.myAmmo.myBar._width; } else { this.iconWeapon.myWeapon.gotoAndStop('none'); this.iconWeapon.myWeapon2.gotoAndStop('none'); this.iconWeapon.myAmmo.gotoAndStop(2); } if (this.iconWeapon.myGun.melee || this.iconWeapon.myGun == undefined) { this.iconWeapon.clip1.gotoAndStop('none'); this.iconWeapon.clipX._visible = false; this.iconWeapon.clipsTotal._visible = false; } else { this.iconWeapon.clip1.gotoAndStop(this.iconWeapon.myGun.myType); this.iconWeapon.clipX._visible = true; this.iconWeapon.clipsTotal._visible = true; } this.iconWeapon.clipsTotal.text = String(this.iconWeapon.myGun.myClips); }; v2.pressMenu = function () { if (!MadnessTransition.transitionLock && !MadnessLevel.levelVictory && MadnessPopup.returnSkipable()) { MadWorld.thisWorld.pauseGame(); MadnessPopup.closeAll(); MadnessPopup.addPopup('yesno', 'Are you sure you want to back out?', null, 425, 180, this, -1, this.confirmQuit, this.cancelQuit); } }; v2.confirmQuit = function () { if (!MadnessTransition.transitionLock) { _root.createTransition('fade', 'quit', null); } else { MadWorld.thisWorld.unpauseGame(); } MadnessPopup.closeAll(); }; v2.cancelQuit = function () { MadWorld.thisWorld.unpauseGame(); MadnessPopup.closeAll(); }; v2.dimWidth = 850; v2.dimHeight = 125; v2.iconStartX = 130; v2.iconStartY = 36; v2.iconWidth = 74; v2.iconHeight = 77; v2.iconSpace = 8; v2.reduceSize = 0.5; v2.totalIcons = new Number(); ASSetPropFlags(_global.MadnessMenu.prototype, null, 1); } #endinitclip } movieClip 1200 __Packages.com.newgrounds.components.FlashAdBase { #initclip if (!_global.com) { _global.com = new Object(); } if (!_global.com.newgrounds) { _global.com.newgrounds = new Object(); } if (!_global.com.newgrounds.components) { _global.com.newgrounds.components = new Object(); } if (!_global.com.newgrounds.components.FlashAdBase) { var v1 = function () { super(); try { System.security.allowDomain('server.cpmstar.com'); System.security.allowInsecureDomain('server.cpmstar.com'); } this.gotoAndStop('idle'); this._x = int(this._x); this._y = int(this._y); this.stop(); if (this.__get___newgroundsButton()) { (this.__get___newgroundsButton()).onRelease = this.onNGClick; } this.onUnload = this.removeAd; var v4 = this; this._adListener = {'onLoadError': function (target, error, httpStatus) { target._parent.onAdError(target, error, httpStatus); }}; if (this.__get__fullScreen()) { this.drawFullScreenRect(); } if (com.newgrounds.API.__get__adFeedURL()) { this.loadAdFeed(); } else { com.newgrounds.API.addEventListener(com.newgrounds.APIEvent.API_CONNECTED, {'target': this, 'func': this.loadAdFeed}); } }; com.newgrounds.components.FlashAdBase = v1; com.newgrounds.components.FlashAdBase extends MovieClip; var v2 = v1.prototype; v2.__get___adContainer = function () { return this.adContainer; }; v2.__get___newgroundsButton = function () { return this.newgroundsButton; }; v2.__get__fullScreen = function () { return this._fullScreen; }; v2.__set__fullScreen = function (v) { this._fullScreen = v; if (v) { this.drawFullScreenRect(); } else { this.clear(); } return this.__get__fullScreen(); }; v2.__get__showBorder = function () { return this._showBorder; }; v2.__set__showBorder = function (value) { this._showBorder = value; if (this._showBorder) { if (this._ad) { var v2 = this._ad.getProgress(this.__get___adContainer()); if (v2.bytesLoaded >= v2.bytesTotal) { this.gotoAndStop('loaded'); } else { this.gotoAndStop('loading'); } } else { this.gotoAndStop('idle'); } } else { this.gotoAndStop('noBorder'); } return this.__get__showBorder(); }; v2.loadAdFeed = function (event) { if (event == undefined) { event = null; } this._adFeedLoader = new LoadVars(); var target = this; this._adFeedLoader.onData = function (data) { target.onAdFeedLoaded(data); }; this._adFeedLoader.load(com.newgrounds.API.__get__adFeedURL(), this._adFeedLoader); }; v2.onAdFeedLoaded = function (data) { if (data && data != '') { this.loadAd(data); } else { this.onAdError(); } }; v2.loadAd = function (adURL) { if (this.adType != this.VIDEO_ADS) { if (adURL.indexOf('?') >= 0) { adURL += '&'; } else { adURL += '?'; } adURL += 'blockoverlays=1'; } this._ad = new MovieClipLoader(); this._ad.addListener(this._adListener); (this.__get___adContainer())._lockroot = true; this._ad.loadClip(adURL, this.__get___adContainer()); }; v2.removeAd = function () { this._adFeedLoader.onData = null; this._adFeedLoader = null; this._ad.removeListener(this._adListener); if (this.__get___adContainer()) { this._ad.unloadClip(this.__get___adContainer()); } this._ad = null; }; v2.onAdError = function (target, error, httpStatus) { com.newgrounds.Logger.logError('Unable to load ad.'); this.removeAd(); }; v2.onNGClick = function () { com.newgrounds.API.loadNewgrounds(); }; v2.drawFullScreenRect = function () { this._x = (Stage.width - this._width) / 2; this._y = (Stage.height - this._height) / 2; this.beginFill(0); this.moveTo(-Stage.width, -Stage.height); this.lineTo(Stage.width, -Stage.height); this.lineTo(Stage.width, Stage.height); this.lineTo(-Stage.width, Stage.height); this.lineTo(-Stage.width, -Stage.height); this.endFill(); }; v2._showBorder = true; v2.adType = com.newgrounds.components.FlashAdBase.prototype.VIDEO_ADS; v2.VIDEO_ADS = 'Video'; v2.SIMPLE_ADS = 'Simple'; v2.addProperty('_adContainer', v2.__get___adContainer, function () {}); v2.addProperty('_newgroundsButton', v2.__get___newgroundsButton, function () {}); v2.addProperty('fullScreen', v2.__get__fullScreen, v2.__set__fullScreen); v2.addProperty('showBorder', v2.__get__showBorder, v2.__set__showBorder); ASSetPropFlags(com.newgrounds.components.FlashAdBase.prototype, null, 1); } #endinitclip } movieClip 1191 __Packages.com.newgrounds.Score { #initclip if (!_global.com) { _global.com = new Object(); } if (!_global.com.newgrounds) { _global.com.newgrounds = new Object(); } if (!_global.com.newgrounds.Score) { var v1 = function (rank, username, score, numericValue, tag) { this._rank = rank; this._username = username; this._score = score; this._numericValue = numericValue; this._tag = tag; }; com.newgrounds.Score = v1; var v2 = v1.prototype; v2.__get__numericValue = function () { return this._numericValue; }; v2.__get__rank = function () { return this._rank; }; v2.__get__score = function () { return this._score; }; v2.__get__tag = function () { return this._tag; }; v2.__get__username = function () { return this._username; }; v2.toString = function () { return this._rank + '.\t' + this._username + '\t' + this._score; }; v2.addProperty('numericValue', v2.__get__numericValue, function () {}); v2.addProperty('rank', v2.__get__rank, function () {}); v2.addProperty('score', v2.__get__score, function () {}); v2.addProperty('tag', v2.__get__tag, function () {}); v2.addProperty('username', v2.__get__username, function () {}); ASSetPropFlags(com.newgrounds.Score.prototype, null, 1); } #endinitclip } movieClip 4833 __Packages.MadnessStoreItems { #initclip if (!_global.MadnessStoreItems) { var v1 = function () { super(); }; _global.MadnessStoreItems = v1; _global.MadnessStoreItems extends MovieClip; var v2 = v1.prototype; v2.init = function () { SwainAudioPlayer.playTrack('menu'); _root.menuBar.myCashTEXT.text = MadnessTeamSetup.returnPlayerCash(); this.teamActive = _root.teamSetup != undefined; if (this.teamActive) { this.gotoAndStop(2); } else { this.gotoAndStop(1); } var v9 = 0; while (this['item' + String(v9)] != undefined) { this['item' + String(v9)].removeMovieClip(); ++v9; } if (this.myCategory == 'weapon0' && !this.teamActive) { this.myCategory = 'ranged'; } var v5; if (this.teamActive) { if (this.myCategory == 'weapon0') { v5 = MadnessRoster.playerRoster.myWeapons; } if (this.myCategory == 'weapon1') { v5 = MadnessRoster.playerRoster.myWeapons; } if (this.myCategory == 'hat') { v5 = MadnessRoster.playerRoster.myArmor; } if (this.myCategory == 'mask') { v5 = MadnessRoster.playerRoster.myArmor; } if (this.myCategory == 'mouth') { v5 = MadnessRoster.playerRoster.myArmor; } if (this.myCategory == 'shirt') { v5 = MadnessRoster.playerRoster.myArmor; } } else { if (this.myCategory == 'ranged') { v5 = MadnessRoster.storeRoster.myWeapons; } if (this.myCategory == 'melee') { v5 = MadnessRoster.storeRoster.myWeapons; } if (this.myCategory == 'hat') { v5 = MadnessRoster.storeRoster.myArmor; } if (this.myCategory == 'mask') { v5 = MadnessRoster.storeRoster.myArmor; } if (this.myCategory == 'mouth') { v5 = MadnessRoster.storeRoster.myArmor; } if (this.myCategory == 'shirt') { v5 = MadnessRoster.storeRoster.myArmor; } } var v6 = new Array(); var v10; if (this.teamActive) { if (this.myCategory == 'weapon0') { v10 = _root.teamSetup.selectData.myWeapons[0]; } if (this.myCategory == 'weapon1') { v10 = _root.teamSetup.selectData.myWeapons[1]; } if (this.myCategory == 'hat') { v10 = _root.teamSetup.selectData.myHat[0]; } if (this.myCategory == 'mask') { v10 = _root.teamSetup.selectData.myMask[0]; } if (this.myCategory == 'mouth') { v10 = _root.teamSetup.selectData.myMouth[0]; } if (this.myCategory == 'shirt') { v10 = _root.teamSetup.selectData.myShirt[0]; } if (v10 != undefined) { v6.push(v10); } } var v4 = 0; while (v4 < v5.length) { if (v5[v4].myOwner == undefined) { if (this.myCategory == v5[v4].myCat || this.myCategory.substr(0, 6) == 'weapon' || this.myCategory == 'ranged' || this.myCategory == 'melee') { if (this.teamActive || this.myCategory != 'ranged' && this.myCategory != 'melee' || this.myCategory == 'ranged' && !v5[v4].melee || this.myCategory == 'melee' && v5[v4].melee) { v6.push(v5[v4]); } } } ++v4; } if (this.selectData == undefined && v10 != undefined) { this.selectData = v10; } var v3; var v12 = 5; var v16 = 80; var v13 = 105; var v7 = 6; var v11 = 3; var v15 = 300; var v14 = 170; var v8; v4 = 0; while (v4 < v11 * v7) { v3 = this.attachMovie('madness_item_portrait', 'item' + String(v4), this.getNextHighestDepth()); v8 = v4 + Math.floor(this.displayPage * (v11 * v7)); ItemGenerator.setItemSprite(v3.myWeapon.mySprite, v6[v8]); v3.myDataRef = v6[v8]; if (v4 / v7 == Math.floor((v4 + 1) / v7)) { v3._x = v15; } else { v3._x = this['item' + (v4 - 1)]._x + v16 + v12; } v3._y = v14 + Math.floor(v4 / v7) * (v13 + v12); if (v6[v8] != undefined) { v3.myGun = v6[v8]; v3.amEquipped._visible = v3.myGun == v10; v3.myShade._visible = v3.myGun != this.selectData; v3.selectMe._visible = v3.myGun == this.selectData; v3.gunNameTEXT.text = v3.myGun.myName; if (v3.myGun.amSpecial) { v3.myBG.gotoAndStop(2); } else { v3.myBG.gotoAndStop(1); } if (this.myCategory.substr(0, 6) == 'weapon') { v3.gotoAndStop('guns'); } else { v3.gotoAndStop(this.myCategory); } v3.myWeapon.gotoAndStop(v3.myGun.myType); if (v3.myGun.haveSilencer) { v3.myWeapon.gotoAndStop(v3.myGun.myType + '_silenced'); } v3.myHat.gotoAndStop(v3.myGun.myType); v3.myHat2.gotoAndStop(v3.myGun.myType); v3.myMask.gotoAndStop(v3.myGun.myType); v3.myMouth.gotoAndStop(v3.myGun.myType); v3.myShirt.gotoAndStop(v3.myGun.myType); ItemGenerator.setItemSprite(v3.myWeapon.mySprite, v3.myGun); } else { v3.gotoAndStop('none'); v3.myBG.gotoAndStop(1); } ++v4; } this.pagePrev._visible = this.displayPage > 0; this.pageNext._visible = Math.floor((v6.length - 1) / v11 * v7) > this.displayPage; this.pageStringTEXT.text = 'PAGE ' + String(this.displayPage + 1); this.storeDummy = new MadnessDataFile(); this.storeDummy.createNew('woody'); if (this.teamActive) { this.storeDummy = _root.teamSetup.selectData; } if (this.selectData == undefined) { if (this.myCategory == 'weapon1') { this.storeDummy.myWeapons[2] = this.storeDummy.myWeapons[1]; } else { this.storeDummy.myWeapons[2] = this.storeDummy.myWeapons[0]; } this.storeDummy.myHat[2] = this.storeDummy.myHat[0]; this.storeDummy.myMask[2] = this.storeDummy.myMask[0]; this.storeDummy.myMouth[2] = this.storeDummy.myMouth[0]; this.storeDummy.myShirt[2] = this.storeDummy.myShirt[0]; } else { this.storeDummy.equipItem(this.selectData, 2); } if (this.teamActive) { this.selectDisplay.gotoAndStop(3); } else { this.selectDisplay.gotoAndStop(2); } MadnessStoreHire.updateCharCard(this.selectDisplay.spriteGroup, this.storeDummy, true); if (this.selectData == undefined) { this.selectDisplay.charName2TEXT.text = ''; this.selectDisplay.charNameTEXT.text = ''; this.selectDisplay.myDescriptionTEXT.text = ''; this.selectDisplay.damageTEXT.text = ''; this.selectDisplay.damageNameTEXT.text = ''; this.selectDisplay.rangeTEXT.text = ''; this.selectDisplay.rangeNameTEXT.text = ''; this.selectDisplay.accuracyTEXT.text = ''; this.selectDisplay.accuracyNameTEXT.text = ''; this.selectDisplay.ammoTEXT.text = ''; this.selectDisplay.ammoNameTEXT.text = ''; } else { this.selectDisplay.charName2TEXT.text = this.selectData.myNameFull; this.selectDisplay.charNameTEXT.text = this.selectData.myName; this.selectDisplay.myDescriptionTEXT.text = this.selectData.myDescription; if (this.selectData.myCat == 'hat' || this.selectData.myCat == 'mask' || this.selectData.myCat == 'mouth' || this.selectData.myCat == 'shirt') { this.selectDisplay.damageTEXT.text = ''; this.selectDisplay.damageNameTEXT.text = ''; this.selectDisplay.rangeTEXT.text = this.selectData.myArmor; this.selectDisplay.rangeNameTEXT.text = 'Armor'; this.selectDisplay.accuracyTEXT.text = (this.selectData.myWeight.substr(0, 1)).toUpperCase() + this.selectData.myWeight.substr(1, this.selectData.myWeight.length - 1); this.selectDisplay.accuracyNameTEXT.text = 'Weight'; this.selectDisplay.ammoTEXT.text = ''; this.selectDisplay.ammoNameTEXT.text = ''; } else { this.selectDisplay.damageTEXT.text = this.selectData.myDamage; this.selectDisplay.damageNameTEXT.text = 'Damage'; this.selectDisplay.rangeTEXT.text = this.selectData.myRange; this.selectDisplay.rangeNameTEXT.text = 'Range'; this.selectDisplay.accuracyTEXT.text = this.selectData.mySpread; this.selectDisplay.accuracyNameTEXT.text = 'Accuracy'; this.selectDisplay.ammoTEXT.text = this.selectData.myAmmoMax; this.selectDisplay.ammoNameTEXT.text = 'Ammo'; if (this.selectData.melee) { this.selectDisplay.accuracyTEXT.text = ' - '; this.selectDisplay.ammoTEXT.text = ' - '; } } } this.myButtons.gotoAndStop('sub'); if (!this.teamActive && this.selectData != undefined) { if (MadnessRoster.playerRoster.myCash >= this.selectData.myPrice) { this.myButtons.buttonAlt.gotoAndStop('buy'); } else { this.myButtons.buttonAlt.gotoAndStop('buy_no'); } } if (this.selectData == undefined) { this.myButtons.buttonAlt.gotoAndStop('equip_no'); } if (this.selectData.myWeight == 'none' || this.selectData.myWeight == 'light' && MadnessDataFile.havePerk('perkArmor1', this.storeDummy) || this.selectData.myWeight == 'med' && MadnessDataFile.havePerk('perkArmor2', this.storeDummy) || this.selectData.myWeight == 'heavy' && MadnessDataFile.havePerk('perkArmor3', this.storeDummy)) { if (this.selectData == v10 && v10 != undefined) { this.myButtons.buttonAlt.gotoAndStop('unequip'); } else { if (this.selectData != undefined) { this.myButtons.buttonAlt.gotoAndStop('equip'); } } } else { if (this.selectData != undefined) { this.myButtons.buttonAlt.gotoAndStop('heavy'); } } if (this.teamActive) { if (!this.haveCategoryItem('weapon0', this.teamActive)) { this.mySubMenu.buttonMain.gotoAndStop('none'); } else { this.mySubMenu.buttonMain.gotoAndStop('main'); } if (MadnessDataFile.havePerk('perkSidearm1', this.storeDummy)) { if (!this.haveCategoryItem('weapon1', this.teamActive)) { this.mySubMenu.buttonSide.gotoAndStop('none'); } else { this.mySubMenu.buttonSide.gotoAndStop('side'); } } else { this.mySubMenu.buttonSide.gotoAndStop('locked'); } } if (!this.teamActive) { if (!this.haveCategoryItem('guns', this.teamActive)) { this.mySubMenu.buttonMain.gotoAndStop('none'); } else { this.mySubMenu.buttonMain.gotoAndStop('main'); } if (!this.haveCategoryItem('melee', this.teamActive)) { this.mySubMenu.buttonSide.gotoAndStop('melee_none'); } else { this.mySubMenu.buttonSide.gotoAndStop('main'); } } if (!this.teamActive || _root.teamSetup.selectData == MadnessRoster.playerRoster.teamLeader || !_root.teamSetup.selectData.arenaLockArmor) { if (!this.haveCategoryItem('hat', this.teamActive)) { this.mySubMenu.buttonHat.gotoAndStop('none'); } else { this.mySubMenu.buttonHat.gotoAndStop('main'); } if (!this.haveCategoryItem('mouth', this.teamActive)) { this.mySubMenu.buttonMouth.gotoAndStop('none'); } else { this.mySubMenu.buttonMouth.gotoAndStop('main'); } if (!this.haveCategoryItem('mask', this.teamActive)) { this.mySubMenu.buttonMask.gotoAndStop('none'); } else { this.mySubMenu.buttonMask.gotoAndStop('main'); } if (!this.haveCategoryItem('shirt', this.teamActive)) { this.mySubMenu.buttonShirt.gotoAndStop('none'); } else { this.mySubMenu.buttonShirt.gotoAndStop('main'); } } else { this.mySubMenu.buttonHat.gotoAndStop('locked'); this.mySubMenu.buttonMouth.gotoAndStop('locked'); this.mySubMenu.buttonMask.gotoAndStop('locked'); this.mySubMenu.buttonShirt.gotoAndStop('locked'); } if (this.teamActive) { this.myButtons.buttonBack.gotoAndStop('back'); } else { this.myButtons.buttonBack.gotoAndStop('cost'); if (this.selectData == undefined) { this.myButtons.buttonBack.myPriceTEXT.text = '$ ---'; this.myButtons.buttonAlt.gotoAndStop('buy_no'); } else { this.myButtons.buttonBack.myPriceTEXT.text = '$' + this.selectData.myPrice; if (MadnessRoster.playerRoster.myCash >= this.selectData.myPrice) { this.myButtons.buttonAlt.gotoAndStop('buy'); } else { this.myButtons.buttonAlt.gotoAndStop('buy_no'); } } this.mySubMenu.buttonSide.gotoAndStop('melee'); } if (this.teamActive) { this.applyAlpha(this.myCategory); } }; v2.applyAlpha = function (inCat) { this.myColorTransform = new Object(); var v3; var v5; var v2; if (inCat.substr(0, 6) == 'weapon') { v3 = this.selectDisplay.spriteGroup.mySprite.handNone_front.myGun; if (this.selectData !== this.storeDummy.myWeapons[Number(inCat.substr(-1, 1))]) { v2 = 70; this.myColorTransform = {'rb': 80, 'gb': 80, 'bb': 150}; } else { v2 = 100; this.myColorTransform = {'rb': 0, 'gb': 0, 'bb': 0}; } } if (inCat == 'hat') { v3 = this.selectDisplay.spriteGroup.mySprite.myHead.myPart.myHat; v5 = this.selectDisplay.spriteGroup.mySprite.myHead.myPart.myHat2; if (this.selectData !== this.storeDummy.myHat[0]) { v2 = 70; this.myColorTransform = {'rb': 80, 'gb': 80, 'bb': 150}; } else { v2 = 100; this.myColorTransform = {'rb': 0, 'gb': 0, 'bb': 0}; } } if (inCat == 'mask') { v3 = this.selectDisplay.spriteGroup.mySprite.myHead.myPart.myMask; if (this.selectData !== this.storeDummy.myMask[0]) { v2 = 70; this.myColorTransform = {'rb': 80, 'gb': 80, 'bb': 150}; } else { v2 = 100; this.myColorTransform = {'rb': 0, 'gb': 0, 'bb': 0}; } } if (inCat == 'mouth') { v3 = this.selectDisplay.spriteGroup.mySprite.myHead.myPart.myMouth; if (this.selectData !== this.storeDummy.myMouth[0]) { v2 = 70; this.myColorTransform = {'rb': 80, 'gb': 80, 'bb': 150}; } else { v2 = 100; this.myColorTransform = {'rb': 0, 'gb': 0, 'bb': 0}; } } if (inCat == 'shirt') { v3 = this.selectDisplay.spriteGroup.mySprite.myBody.myPart.myShirt; if (this.selectData !== this.storeDummy.myShirt[0]) { v2 = 70; this.myColorTransform = {'rb': 80, 'gb': 80, 'bb': 150}; } else { v2 = 100; this.myColorTransform = {'rb': 0, 'gb': 0, 'bb': 0}; } } v3._alpha = v2; v5._alpha = v2; this.myColor = new Color(v3); this.myColor.setTransform(this.myColorTransform); this.myColor = new Color(v5); this.myColor.setTransform(this.myColorTransform); }; v2.pressPrev = function () { --this.displayPage; this.init(); SwainAudioPlayer.playSound('menu2', 0); }; v2.pressNext = function () { ++this.displayPage; this.init(); SwainAudioPlayer.playSound('menu2', 0); }; v2.pressPortrait = function (inItem) { this.selectData = inItem.myGun; this.init(); SwainAudioPlayer.playSound('menu2', 0); }; v2.pressConfirm = function () { if (MadnessRoster.playerRoster.myCash >= this.selectData.myPrice) { if (this.selectData.amArmor) { MadnessRoster.playerRoster.addArmor(this.selectData); MadnessRoster.storeRoster.removeArmor(this.selectData); } else { MadnessRoster.playerRoster.addWeapon(this.selectData); MadnessRoster.storeRoster.removeWeapon(this.selectData); } MadnessRoster.playerRoster.myCash = Math.floor(MadnessRoster.playerRoster.myCash - this.selectData.myPrice); this.selectData = undefined; SwainAudioPlayer.playSound('buy', 0); } this.init(); }; v2.pressEquip = function () { if (this.myCategory == 'weapon1') { this.storeDummy.equipItem(this.selectData, 1); } else { this.storeDummy.equipItem(this.selectData, 0); } this.init(); SwainAudioPlayer.playSound('swapgun', 0); }; v2.pressUnequip = function () { this.storeDummy.unequipItem(this.myCategory, false); this.init(); SwainAudioPlayer.playSound('swapgun', 0); }; v2.pressClose = function () { this.finished = true; _root.teamSetup._visible = true; _root.teamSetup.init2(); this.removeMovieClip(); SwainAudioPlayer.playSound('menu4', 0); }; v2.pressItemSlot = function (inCat) { if (inCat == 'weapon0') { this.myCategory = inCat; if (!this.teamActive) { this.myCategory = 'ranged'; } } else { if (inCat == 'weapon1') { this.myCategory = inCat; if (!this.teamActive) { this.myCategory = 'melee'; } } else { if (inCat == 'hat') { this.myCategory = inCat; } else { if (inCat == 'mask') { this.myCategory = inCat; } else { if (inCat == 'mouth') { this.myCategory = inCat; } else { if (inCat == 'shirt') { this.myCategory = inCat; } } } } } } this.selectData = undefined; this.displayPage = 0; SwainAudioPlayer.playSound('menu2', 0); this.init(); }; v2.haveCategoryItem = function (inCat, inTeamActive) { var v5; var v3; if (inTeamActive) { v5 = MadnessRoster.playerRoster; } else { v5 = MadnessRoster.storeRoster; } if (inCat.substr(0, 6) == 'weapon') { v3 = v5.myWeapons; if (v3.length > 0) { return true; } } else { if (inCat == 'melee' || inCat == 'guns') { v3 = v5.myWeapons; } else { v3 = v5.myArmor; } } if (inTeamActive) { if (inCat == 'weapon0' && _root.teamSetup.selectData.myWeapons[0] != undefined) { return true; } if (inCat == 'weapon1' && _root.teamSetup.selectData.myWeapons[1] != undefined) { return true; } if (inCat == 'hat' && _root.teamSetup.selectData.myHat[0] != undefined) { return true; } if (inCat == 'mask' && _root.teamSetup.selectData.myMask[0] != undefined) { return true; } if (inCat == 'mouth' && _root.teamSetup.selectData.myMouth[0] != undefined) { return true; } if (inCat == 'shirt' && _root.teamSetup.selectData.myShirt[0] != undefined) { return true; } } var v2 = 0; while (v2 < v3.length) { if (v3[v2].myCat == inCat) { return true; break; } if (inCat == 'guns' && !v3[v2].melee) { return true; break; } ++v2; } return false; }; v2.displayPage = 0; v2.myCategory = 'weapon0'; v2.finished = false; v2.teamActive = false; ASSetPropFlags(_global.MadnessStoreItems.prototype, null, 1); } #endinitclip } movieClip 1175 __Packages.com.newgrounds.shims.APIShim { #initclip if (!_global.com) { _global.com = new Object(); } if (!_global.com.newgrounds) { _global.com.newgrounds = new Object(); } if (!_global.com.newgrounds.shims) { _global.com.newgrounds.shims = new Object(); } if (!_global.com.newgrounds.shims.APIShim) { var v1 = function () { super(); }; com.newgrounds.shims.APIShim = v1; com.newgrounds.shims.APIShim extends MovieClip; var v2 = v1.prototype; ASSetPropFlags(com.newgrounds.shims.APIShim.prototype, null, 1); } #endinitclip } movieClip 1185 __Packages.com.newgrounds.crypto.MD5 { #initclip if (!_global.com) { _global.com = new Object(); } if (!_global.com.newgrounds) { _global.com.newgrounds = new Object(); } if (!_global.com.newgrounds.crypto) { _global.com.newgrounds.crypto = new Object(); } if (!_global.com.newgrounds.crypto.MD5) { var v1 = function () {}; com.newgrounds.crypto.MD5 = v1; var v2 = v1.prototype; v1.hash = function (src) { return com.newgrounds.crypto.MD5.hex_md5(src); }; v1.hex_md5 = function (src) { return com.newgrounds.crypto.MD5.binl2hex(com.newgrounds.crypto.MD5.core_md5(com.newgrounds.crypto.MD5.str2binl(src), src.length * 8)); }; v1.core_md5 = function (x, len) { x[len >> 5] |= 128 << len % 32; x[(len + 64 >>> 9 << 4) + 14] = len; var v4 = 1732584193; var v3 = -271733879; var v2 = -1732584194; var v1 = 271733878; var v5 = 0; while (v5 < x.length) { var v10 = v4; var v9 = v3; var v8 = v2; var v7 = v1; v4 = com.newgrounds.crypto.MD5.md5_ff(v4, v3, v2, v1, x[v5 + 0], 7, -680876936); v1 = com.newgrounds.crypto.MD5.md5_ff(v1, v4, v3, v2, x[v5 + 1], 12, -389564586); v2 = com.newgrounds.crypto.MD5.md5_ff(v2, v1, v4, v3, x[v5 + 2], 17, 606105819); v3 = com.newgrounds.crypto.MD5.md5_ff(v3, v2, v1, v4, x[v5 + 3], 22, -1044525330); v4 = com.newgrounds.crypto.MD5.md5_ff(v4, v3, v2, v1, x[v5 + 4], 7, -176418897); v1 = com.newgrounds.crypto.MD5.md5_ff(v1, v4, v3, v2, x[v5 + 5], 12, 1200080426); v2 = com.newgrounds.crypto.MD5.md5_ff(v2, v1, v4, v3, x[v5 + 6], 17, -1473231341); v3 = com.newgrounds.crypto.MD5.md5_ff(v3, v2, v1, v4, x[v5 + 7], 22, -45705983); v4 = com.newgrounds.crypto.MD5.md5_ff(v4, v3, v2, v1, x[v5 + 8], 7, 1770035416); v1 = com.newgrounds.crypto.MD5.md5_ff(v1, v4, v3, v2, x[v5 + 9], 12, -1958414417); v2 = com.newgrounds.crypto.MD5.md5_ff(v2, v1, v4, v3, x[v5 + 10], 17, -42063); v3 = com.newgrounds.crypto.MD5.md5_ff(v3, v2, v1, v4, x[v5 + 11], 22, -1990404162); v4 = com.newgrounds.crypto.MD5.md5_ff(v4, v3, v2, v1, x[v5 + 12], 7, 1804603682); v1 = com.newgrounds.crypto.MD5.md5_ff(v1, v4, v3, v2, x[v5 + 13], 12, -40341101); v2 = com.newgrounds.crypto.MD5.md5_ff(v2, v1, v4, v3, x[v5 + 14], 17, -1502002290); v3 = com.newgrounds.crypto.MD5.md5_ff(v3, v2, v1, v4, x[v5 + 15], 22, 1236535329); v4 = com.newgrounds.crypto.MD5.md5_gg(v4, v3, v2, v1, x[v5 + 1], 5, -165796510); v1 = com.newgrounds.crypto.MD5.md5_gg(v1, v4, v3, v2, x[v5 + 6], 9, -1069501632); v2 = com.newgrounds.crypto.MD5.md5_gg(v2, v1, v4, v3, x[v5 + 11], 14, 643717713); v3 = com.newgrounds.crypto.MD5.md5_gg(v3, v2, v1, v4, x[v5 + 0], 20, -373897302); v4 = com.newgrounds.crypto.MD5.md5_gg(v4, v3, v2, v1, x[v5 + 5], 5, -701558691); v1 = com.newgrounds.crypto.MD5.md5_gg(v1, v4, v3, v2, x[v5 + 10], 9, 38016083); v2 = com.newgrounds.crypto.MD5.md5_gg(v2, v1, v4, v3, x[v5 + 15], 14, -660478335); v3 = com.newgrounds.crypto.MD5.md5_gg(v3, v2, v1, v4, x[v5 + 4], 20, -405537848); v4 = com.newgrounds.crypto.MD5.md5_gg(v4, v3, v2, v1, x[v5 + 9], 5, 568446438); v1 = com.newgrounds.crypto.MD5.md5_gg(v1, v4, v3, v2, x[v5 + 14], 9, -1019803690); v2 = com.newgrounds.crypto.MD5.md5_gg(v2, v1, v4, v3, x[v5 + 3], 14, -187363961); v3 = com.newgrounds.crypto.MD5.md5_gg(v3, v2, v1, v4, x[v5 + 8], 20, 1163531501); v4 = com.newgrounds.crypto.MD5.md5_gg(v4, v3, v2, v1, x[v5 + 13], 5, -1444681467); v1 = com.newgrounds.crypto.MD5.md5_gg(v1, v4, v3, v2, x[v5 + 2], 9, -51403784); v2 = com.newgrounds.crypto.MD5.md5_gg(v2, v1, v4, v3, x[v5 + 7], 14, 1735328473); v3 = com.newgrounds.crypto.MD5.md5_gg(v3, v2, v1, v4, x[v5 + 12], 20, -1926607734); v4 = com.newgrounds.crypto.MD5.md5_hh(v4, v3, v2, v1, x[v5 + 5], 4, -378558); v1 = com.newgrounds.crypto.MD5.md5_hh(v1, v4, v3, v2, x[v5 + 8], 11, -2022574463); v2 = com.newgrounds.crypto.MD5.md5_hh(v2, v1, v4, v3, x[v5 + 11], 16, 1839030562); v3 = com.newgrounds.crypto.MD5.md5_hh(v3, v2, v1, v4, x[v5 + 14], 23, -35309556); v4 = com.newgrounds.crypto.MD5.md5_hh(v4, v3, v2, v1, x[v5 + 1], 4, -1530992060); v1 = com.newgrounds.crypto.MD5.md5_hh(v1, v4, v3, v2, x[v5 + 4], 11, 1272893353); v2 = com.newgrounds.crypto.MD5.md5_hh(v2, v1, v4, v3, x[v5 + 7], 16, -155497632); v3 = com.newgrounds.crypto.MD5.md5_hh(v3, v2, v1, v4, x[v5 + 10], 23, -1094730640); v4 = com.newgrounds.crypto.MD5.md5_hh(v4, v3, v2, v1, x[v5 + 13], 4, 681279174); v1 = com.newgrounds.crypto.MD5.md5_hh(v1, v4, v3, v2, x[v5 + 0], 11, -358537222); v2 = com.newgrounds.crypto.MD5.md5_hh(v2, v1, v4, v3, x[v5 + 3], 16, -722521979); v3 = com.newgrounds.crypto.MD5.md5_hh(v3, v2, v1, v4, x[v5 + 6], 23, 76029189); v4 = com.newgrounds.crypto.MD5.md5_hh(v4, v3, v2, v1, x[v5 + 9], 4, -640364487); v1 = com.newgrounds.crypto.MD5.md5_hh(v1, v4, v3, v2, x[v5 + 12], 11, -421815835); v2 = com.newgrounds.crypto.MD5.md5_hh(v2, v1, v4, v3, x[v5 + 15], 16, 530742520); v3 = com.newgrounds.crypto.MD5.md5_hh(v3, v2, v1, v4, x[v5 + 2], 23, -995338651); v4 = com.newgrounds.crypto.MD5.md5_ii(v4, v3, v2, v1, x[v5 + 0], 6, -198630844); v1 = com.newgrounds.crypto.MD5.md5_ii(v1, v4, v3, v2, x[v5 + 7], 10, 1126891415); v2 = com.newgrounds.crypto.MD5.md5_ii(v2, v1, v4, v3, x[v5 + 14], 15, -1416354905); v3 = com.newgrounds.crypto.MD5.md5_ii(v3, v2, v1, v4, x[v5 + 5], 21, -57434055); v4 = com.newgrounds.crypto.MD5.md5_ii(v4, v3, v2, v1, x[v5 + 12], 6, 1700485571); v1 = com.newgrounds.crypto.MD5.md5_ii(v1, v4, v3, v2, x[v5 + 3], 10, -1894986606); v2 = com.newgrounds.crypto.MD5.md5_ii(v2, v1, v4, v3, x[v5 + 10], 15, -1051523); v3 = com.newgrounds.crypto.MD5.md5_ii(v3, v2, v1, v4, x[v5 + 1], 21, -2054922799); v4 = com.newgrounds.crypto.MD5.md5_ii(v4, v3, v2, v1, x[v5 + 8], 6, 1873313359); v1 = com.newgrounds.crypto.MD5.md5_ii(v1, v4, v3, v2, x[v5 + 15], 10, -30611744); v2 = com.newgrounds.crypto.MD5.md5_ii(v2, v1, v4, v3, x[v5 + 6], 15, -1560198380); v3 = com.newgrounds.crypto.MD5.md5_ii(v3, v2, v1, v4, x[v5 + 13], 21, 1309151649); v4 = com.newgrounds.crypto.MD5.md5_ii(v4, v3, v2, v1, x[v5 + 4], 6, -145523070); v1 = com.newgrounds.crypto.MD5.md5_ii(v1, v4, v3, v2, x[v5 + 11], 10, -1120210379); v2 = com.newgrounds.crypto.MD5.md5_ii(v2, v1, v4, v3, x[v5 + 2], 15, 718787259); v3 = com.newgrounds.crypto.MD5.md5_ii(v3, v2, v1, v4, x[v5 + 9], 21, -343485551); v4 = com.newgrounds.crypto.MD5.safe_add(v4, v10); v3 = com.newgrounds.crypto.MD5.safe_add(v3, v9); v2 = com.newgrounds.crypto.MD5.safe_add(v2, v8); v1 = com.newgrounds.crypto.MD5.safe_add(v1, v7); v5 += 16; } return new Array(v4, v3, v2, v1); }; v1.md5_cmn = function (q, a, b, x, s, t) { return com.newgrounds.crypto.MD5.safe_add(com.newgrounds.crypto.MD5.bit_rol(com.newgrounds.crypto.MD5.safe_add(com.newgrounds.crypto.MD5.safe_add(a, q), com.newgrounds.crypto.MD5.safe_add(x, t)), s), b); }; v1.md5_ff = function (a, b, c, d, x, s, t) { return com.newgrounds.crypto.MD5.md5_cmn(b & c | ~b & d, a, b, x, s, t); }; v1.md5_gg = function (a, b, c, d, x, s, t) { return com.newgrounds.crypto.MD5.md5_cmn(b & d | c & ~d, a, b, x, s, t); }; v1.md5_hh = function (a, b, c, d, x, s, t) { return com.newgrounds.crypto.MD5.md5_cmn(b ^ c ^ d, a, b, x, s, t); }; v1.md5_ii = function (a, b, c, d, x, s, t) { return com.newgrounds.crypto.MD5.md5_cmn(c ^ (b | ~d), a, b, x, s, t); }; v1.bit_rol = function (num, cnt) { return num << cnt | num >>> 32 - cnt; }; v1.safe_add = function (x, y) { var v1 = (x & 65535) + (y & 65535); var v2 = (x >> 16) + (y >> 16) + (v1 >> 16); return v2 << 16 | v1 & 65535; }; v1.str2binl = function (str) { var v3 = new Array(); var v4 = 255; var v1 = 0; while (v1 < str.length * 8) { v3[v1 >> 5] |= (str.charCodeAt(v1 / 8) & v4) << v1 % 32; v1 += 8; } return v3; }; v1.binl2hex = function (binarray) { var v4 = new String(''); var v3 = new String('0123456789abcdef'); var v1 = 0; while (v1 < binarray.length * 4) { v4 += v3.charAt(binarray[v1 >> 2] >> (v1 % 4) * 8 + 4 & 15) + v3.charAt(binarray[v1 >> 2] >> (v1 % 4) * 8 & 15); ++v1; } return v4; }; ASSetPropFlags(com.newgrounds.crypto.MD5.prototype, null, 1); } #endinitclip } movieClip 1186 __Packages.com.newgrounds.crypto.RC4 { #initclip if (!_global.com) { _global.com = new Object(); } if (!_global.com.newgrounds) { _global.com.newgrounds = new Object(); } if (!_global.com.newgrounds.crypto) { _global.com.newgrounds.crypto = new Object(); } if (!_global.com.newgrounds.crypto.RC4) { var v1 = function () {}; com.newgrounds.crypto.RC4 = v1; var v2 = v1.prototype; v1.encrypt = function (src, key) { var v3 = com.newgrounds.crypto.RC4.strToChars(src); var v1 = com.newgrounds.crypto.RC4.strToChars(key); var v2 = com.newgrounds.crypto.RC4.calculate(v3, v1); return com.newgrounds.crypto.RC4.charsToHex(v2); }; v1.encryptbin = function (src, key) { var v3 = com.newgrounds.crypto.RC4.strToChars(src); var v1 = com.newgrounds.crypto.RC4.strToChars(key); var v2 = com.newgrounds.crypto.RC4.calculate(v3, v1); return v2; }; v1.decrypt = function (src, key) { var v3 = com.newgrounds.crypto.RC4.hexToChars(src); var v1 = com.newgrounds.crypto.RC4.strToChars(key); var v2 = com.newgrounds.crypto.RC4.calculate(v3, v1); return com.newgrounds.crypto.RC4.charsToStr(v2); }; v1.initialize = function (pwd) { var v2 = 0; var v3; var v4 = pwd.length; var v1 = 0; while (v1 <= 255) { com.newgrounds.crypto.RC4.mykey[v1] = pwd[v1 % v4]; com.newgrounds.crypto.RC4.sbox[v1] = v1; ++v1; } v1 = 0; while (v1 <= 255) { v2 = (v2 + com.newgrounds.crypto.RC4.sbox[v1] + com.newgrounds.crypto.RC4.mykey[v1]) % 256; v3 = com.newgrounds.crypto.RC4.sbox[v1]; com.newgrounds.crypto.RC4.sbox[v1] = com.newgrounds.crypto.RC4.sbox[v2]; com.newgrounds.crypto.RC4.sbox[v2] = v3; ++v1; } }; v1.calculate = function (plaintxt, psw) { com.newgrounds.crypto.RC4.initialize(psw); var v1 = 0; var v2 = 0; var v9 = new Array(); var v7; var v5; var v6; var v3 = 0; while (v3 < plaintxt.length) { v1 = (v1 + 1) % 256; v2 = (v2 + com.newgrounds.crypto.RC4.sbox[v1]) % 256; v5 = com.newgrounds.crypto.RC4.sbox[v1]; com.newgrounds.crypto.RC4.sbox[v1] = com.newgrounds.crypto.RC4.sbox[v2]; com.newgrounds.crypto.RC4.sbox[v2] = v5; var v4 = (com.newgrounds.crypto.RC4.sbox[v1] + com.newgrounds.crypto.RC4.sbox[v2]) % 256; v7 = com.newgrounds.crypto.RC4.sbox[v4]; v6 = plaintxt[v3] ^ v7; v9.push(v6); ++v3; } return v9; }; v1.charsToHex = function (chars) { var v4 = new String(''); var v3 = new Array('0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'); var v1 = 0; while (v1 < chars.length) { v4 += v3[chars[v1] >> 4] + v3[chars[v1] & 15]; ++v1; } return v4; }; v1.hexToChars = function (hex) { var v3 = new Array(); var v1 = (hex.substr(0, 2) == '0x') ? 2 : 0; while (v1 < hex.length) { v3.push(parseInt(hex.substr(v1, 2), 16)); v1 += 2; } return v3; }; v1.charsToStr = function (chars) { var v3 = new String(''); var v1 = 0; while (v1 < chars.length) { v3 += String.fromCharCode(chars[v1]); ++v1; } return v3; }; v1.strToChars = function (str) { var v3 = new Array(); var v1 = 0; while (v1 < str.length) { v3.push(str.charCodeAt(v1)); ++v1; } return v3; }; v1.sbox = new Array(255); v1.mykey = new Array(255); ASSetPropFlags(com.newgrounds.crypto.RC4.prototype, null, 1); } #endinitclip } movieClip 1187 __Packages.com.newgrounds.encoders.json.JSON { #initclip if (!_global.com) { _global.com = new Object(); } if (!_global.com.newgrounds) { _global.com.newgrounds = new Object(); } if (!_global.com.newgrounds.encoders) { _global.com.newgrounds.encoders = new Object(); } if (!_global.com.newgrounds.encoders.json) { _global.com.newgrounds.encoders.json = new Object(); } if (!_global.com.newgrounds.encoders.json.JSON) { var v1 = function () {}; com.newgrounds.encoders.json.JSON = v1; var v2 = v1.prototype; v1.encode = function (arg, noquotes) { var v3; var v2; var v6; var v1 = ''; var v4; if (arg.isSServerVar()) { var v8 = 'sservervariable'; } else { var v8 = typeof arg; } switch (v8) { return 'null'; case 'sservervariable': return '?' + arg.getEncodedValue(); break; case 'object': if (arg) { if (arg instanceof Array) { v2 = 0; while (v2 < arg.length) { v4 = com.newgrounds.encoders.json.JSON.encode(arg[v2]); if (v1) { v1 += ','; } v1 += v4; ++v2; } return '[' + v1 + ']'; } else { if (typeof arg.toString != 'undefined') { for (v2 in arg) { v4 = arg[v2]; if (typeof v4 != 'undefined' && typeof v4 != 'function') { v4 = com.newgrounds.encoders.json.JSON.encode(v4); if (v1) { v1 += ','; } v1 += com.newgrounds.encoders.json.JSON.encode(v2) + ':' + v4; } } return '{' + v1 + '}'; } } } return 'null'; case 'number': return isFinite(arg) ? String(arg) : 'null'; case 'string': v6 = arg.length; if (noquotes) { var v7 = ''; } else { var v7 = '"'; } v1 = v7; v2 = 0; while (v2 < v6) { v3 = arg.charAt(v2); if (v3 >= ' ') { if (v3 == '\\' || v3 == '"') { v1 += '\\'; } v1 += v3; } else { switch (v3) { case '\b': v1 += '\\b'; break; case '\f': v1 += '\\f'; break; case '\n': v1 += '\\n'; break; case '\r': v1 += '\\r'; break; case '\t': v1 += '\\t'; break; default: v3 = v3.charCodeAt(); v1 += '\\u00' + (Math.floor(v3 / 16)).toString(16) + (v3 % 16).toString(16); } } v2 += 1; } return v1 + v7; case 'boolean': return String(arg); default: return 'null'; } }; v1.background_encode = function (arg, callback) { if (com.newgrounds.encoders.json.JSON.busy) { trace('[Newgrounds Encoder] :: Cannot encode a new file until the previous file is completed'); return false; } else { if (!callback) { trace('[Newgrounds Encoder] :: Missing a callback function, skipping encode'); return false; } } com.newgrounds.encoders.json.JSON.busy = true; var v2 = new Date(); com.newgrounds.encoders.json.JSON.start = v2.getTime(); com.newgrounds.encoders.json.JSON.cache = {'busy': false, 'complete': false, 'arg': arg, 'target': arg, 'parents': [], 'encoded': '', 'callback': callback, 'encode_chunk': function () { com.newgrounds.encoders.json.JSON.encode_chunk(); }}; if (com.newgrounds.encoders.json.JSON.getType(arg) == 'object') { com.newgrounds.encoders.json.JSON.cache.encoded = '{'; com.newgrounds.encoders.json.JSON.interval = setInterval(com.newgrounds.encoders.json.JSON.cache, 'encode_chunk', 25); return true; } if (com.newgrounds.encoders.json.JSON.getType(arg) == 'array') { com.newgrounds.encoders.json.JSON.cache.encoded = '['; } com.newgrounds.encoders.json.JSON.interval = setInterval(com.newgrounds.encoders.json.JSON.cache, 'encode_chunk', 25); return true; }; v1.background_decode = function (arg, callback) { if (com.newgrounds.encoders.json.JSON.busy) { trace('[Newgrounds Encoder] :: Cannot decode a new file until the previous file is completed'); return false; } else { if (!callback) { trace('[Newgrounds Encoder] :: Missing a callback function, skipping decode'); return false; } } com.newgrounds.encoders.json.JSON.busy = true; var v1 = new Date(); com.newgrounds.encoders.json.JSON.start = v1.getTime(); com.newgrounds.encoders.json.JSON.cache = {'busy': false, 'callback': callback, 'complete': false, 'arg': arg, 'pos': 0, 'parents': ['root'], 'target': null, 'scratch': '', 'decode_chunk': function () { com.newgrounds.encoders.json.JSON.decode_chunk(); }}; com.newgrounds.encoders.json.JSON.interval = setInterval(com.newgrounds.encoders.json.JSON.cache, 'decode_chunk', 25); return true; }; v1.decode = function (text) { var at = 0; var ch = ' '; var _value; var _error = function (m) { throw {'name': 'JSONError', 'message': m, 'at': at - 1, 'text': text}; }; var _next = function () { ch = text.charAt(at); at += 1; return ch; }; var _white = function () { while (ch) { if (ch <= ' ') { _next(); } else { if (ch == '/') { switch (_next()) { case '/': for (;;) { if (!(_next() && ch != '\n' && ch != '\r')) break; } break; case '*': _next(); for (;;) { if (ch) { if (ch == '*') { if (_next() == '/') { _next(); break; } } else { _next(); } continue; } _error('Unterminated comment'); } break; default: _error('Syntax error'); } } else { break; } } } }; var _string = function () { var v4; var v1 = ''; var v3; var v2; var v5 = false; if (ch == '"') { while (_next()) { if (ch == '"') { _next(); return v1; } else { if (ch == '\\') { switch (_next()) { case 'b': v1 += '\b'; break; case 'f': v1 += '\f'; break; case 'n': v1 += '\n'; break; case 'r': v1 += '\r'; break; case 't': v1 += '\t'; break; case 'u': v2 = 0; v4 = 0; while (v4 < 4) { v3 = parseInt(_next(), 16); if (!isFinite(v3)) { v5 = true; break; } v2 = v2 * 16 + v3; v4 += 1; } if (v5) { v5 = false; } else { v1 += String.fromCharCode(v2); break; default: v1 += ch; } } } else { v1 += ch; } } } } _error('Bad string'); }; var _array = function () { var v1 = []; if (ch == '[') { _next(); _white(); if (ch == ']') { _next(); return v1; } while (ch) { v1.push(_value()); _white(); if (ch == ']') { _next(); return v1; } else { if (ch != ',') { break; } } _next(); _white(); } } _error('Bad array'); }; var _object = function () { var v2; var v1 = {}; if (ch == '{') { _next(); _white(); if (ch == '}') { _next(); return v1; } while (ch) { v2 = _string(); _white(); if (ch != ':') { break; } _next(); v1[v2] = _value(); _white(); if (ch == '}') { _next(); return v1; } else { if (ch != ',') { break; } } _next(); _white(); } } _error('Bad object'); }; var _number = function () { var v1 = ''; var v2; if (ch == '-') { v1 = '-'; _next(); } for (;;) { if (!(ch >= '0' && ch <= '9')) break; v1 += ch; _next(); } if (ch == '.') { v1 += '.'; for (;;) { if (!(_next() && ch >= '0' && ch <= '9')) break; v1 += ch; } } v2 = 1 * v1; if (!isFinite(v2)) { _error('Bad number'); } else { return v2; } }; var _word = function () { switch (ch) { case 't': if (_next() == 'r' && _next() == 'u' && _next() == 'e') { _next(); return true; } break; case 'f': if (_next() == 'a' && _next() == 'l' && _next() == 's' && _next() == 'e') { _next(); return false; } break; case 'n': if (_next() == 'u' && _next() == 'l' && _next() == 'l') { _next(); return null; } } _error('Syntax error'); }; _value = function () { _white(); switch (ch) { case '{': return _object(); case '[': return _array(); case '"': return _string(); case '-': return _number(); } return (ch >= '0' && ch <= '9') ? _number() : _word(); }; return _value(); }; v1.getType = function (v) { if (v instanceof Array) { return 'array'; } else { return typeof v; } }; v1.decode_chunk = function () { if (!com.newgrounds.encoders.json.JSON.cache.busy && !com.newgrounds.encoders.json.JSON.cache.complete) { com.newgrounds.encoders.json.JSON.cache.busy = true; var v1 = 0; while (v1 < com.newgrounds.encoders.json.JSON.decode_chunks) { com.newgrounds.encoders.json.JSON.chunk_decoder(); if (com.newgrounds.encoders.json.JSON.cache.complete) { break; } ++v1; } trace(Math.round((com.newgrounds.encoders.json.JSON.cache.pos / com.newgrounds.encoders.json.JSON.cache.arg.length) * 100) + '% decoded'); com.newgrounds.encoders.json.JSON.cache.busy = false; } if (com.newgrounds.encoders.json.JSON.cache.complete) { var v2 = new Date(); com.newgrounds.encoders.json.JSON.busy = false; clearInterval(com.newgrounds.encoders.json.JSON.interval); com.newgrounds.encoders.json.JSON.cache.callback(com.newgrounds.encoders.json.JSON.cache.root, v2.getTime() - com.newgrounds.encoders.json.JSON.start); com.newgrounds.encoders.json.JSON.cache.arg = ''; } }; v1.encode_chunk = function () { if (!com.newgrounds.encoders.json.JSON.cache.busy && !com.newgrounds.encoders.json.JSON.cache.complete) { com.newgrounds.encoders.json.JSON.cache.busy = true; var v1 = 0; while (v1 < com.newgrounds.encoders.json.JSON.encode_chunks) { com.newgrounds.encoders.json.JSON.chunk_encoder(); if (com.newgrounds.encoders.json.JSON.cache.complete) { break; } ++v1; } com.newgrounds.encoders.json.JSON.cache.busy = false; } if (com.newgrounds.encoders.json.JSON.cache.complete) { var v3 = new Date(); var v2 = v3.getTime(); com.newgrounds.encoders.json.JSON.busy = false; clearInterval(com.newgrounds.encoders.json.JSON.interval); com.newgrounds.encoders.json.JSON.cache.callback(com.newgrounds.encoders.json.JSON.cache.encoded, v2 - com.newgrounds.encoders.json.JSON.start); com.newgrounds.encoders.json.JSON.cache.encoded = ''; } }; v1.chunk_decoder = function () { function _object() { var v1 = com.newgrounds.encoders.json.JSON.cache.arg.charAt(com.newgrounds.encoders.json.JSON.cache.pos); if (!com.newgrounds.encoders.json.JSON.cache.mode) { com.newgrounds.encoders.json.JSON.cache.mode = 'object'; ++com.newgrounds.encoders.json.JSON.cache.pos; v1 = com.newgrounds.encoders.json.JSON.cache.arg.charAt(com.newgrounds.encoders.json.JSON.cache.pos); if (v1 != '"') { throw 'Malformed object key in encoded string. Keys must be wrapped in quotes ("")'; } com.newgrounds.encoders.json.JSON.cache.scratch = ''; _setTargetValue({}); } else { if (v1 == ',') { ++com.newgrounds.encoders.json.JSON.cache.pos; v1 = com.newgrounds.encoders.json.JSON.cache.arg.charAt(com.newgrounds.encoders.json.JSON.cache.pos); if (v1 != '"') { throw 'Malformed object key in encoded string. Keys must be wrapped in quotes ("")'; } com.newgrounds.encoders.json.JSON.cache.scratch = ''; } else { if (v1 == '}') { _useParent(); } else { if (v1 == '"') { ++com.newgrounds.encoders.json.JSON.cache.pos; v1 = com.newgrounds.encoders.json.JSON.cache.arg.charAt(com.newgrounds.encoders.json.JSON.cache.pos); if (v1 != ':') { throw 'Malformed object notation. Object keys and values must be separated by colons(:)'; } _addParent(com.newgrounds.encoders.json.JSON.cache.scratch); com.newgrounds.encoders.json.JSON.cache.mode = null; } else { if (v1 == '\\') { ++com.newgrounds.encoders.json.JSON.cache.pos; v1 = com.newgrounds.encoders.json.JSON.cache.arg.charAt(com.newgrounds.encoders.json.JSON.cache.pos); } com.newgrounds.encoders.json.JSON.cache.scratch += v1; } } } } ++com.newgrounds.encoders.json.JSON.cache.pos; } function _array() { var v1 = com.newgrounds.encoders.json.JSON.cache.arg.charAt(com.newgrounds.encoders.json.JSON.cache.pos); if (!com.newgrounds.encoders.json.JSON.cache.mode) { com.newgrounds.encoders.json.JSON.cache.mode = 'array'; ++com.newgrounds.encoders.json.JSON.cache.pos; v1 = com.newgrounds.encoders.json.JSON.cache.arg.charAt(com.newgrounds.encoders.json.JSON.cache.pos); _setTargetValue([]); if (v1 != ']') { _addArrayKey(); } else { _useParent(); } return undefined; } else { if (v1 == ',') { _addArrayKey(); } else { if (v1 == ']') { _useParent(); } } } ++com.newgrounds.encoders.json.JSON.cache.pos; } function _boolean() { var v1 = com.newgrounds.encoders.json.JSON.cache.arg.charAt(com.newgrounds.encoders.json.JSON.cache.pos); if (v1 == 't') { _setTargetValue(true); com.newgrounds.encoders.json.JSON.cache.pos += 3; } else { if (v1 == 'f') { _setTargetValue(false); com.newgrounds.encoders.json.JSON.cache.pos += 4; } else { throw 'Bool values must be true or false'; } } _useParent(); } function _null() { var v1 = com.newgrounds.encoders.json.JSON.cache.arg.charAt(com.newgrounds.encoders.json.JSON.cache.pos); if (v1 == 'n') { _setTargetValue(null); com.newgrounds.encoders.json.JSON.cache.pos += 2; } else { throw 'Null values must be null'; } _useParent(); } function _string() { var v1 = com.newgrounds.encoders.json.JSON.cache.arg.charAt(com.newgrounds.encoders.json.JSON.cache.pos); if (!com.newgrounds.encoders.json.JSON.cache.mode) { if (v1 != '"') { throw 'Strings must be wrapped in quotes ("")'; } com.newgrounds.encoders.json.JSON.cache.scratch = ''; com.newgrounds.encoders.json.JSON.cache.mode = 'string'; } else { if (v1 == '"') { _setTargetValue(com.newgrounds.encoders.json.JSON.cache.scratch); _useParent(); } else { if (v1 == '\\') { ++com.newgrounds.encoders.json.JSON.cache.pos; v1 = com.newgrounds.encoders.json.JSON.cache.arg.charAt(com.newgrounds.encoders.json.JSON.cache.pos); switch (v1) { case 'n': v1 = '\n'; break; case 'r': v1 = '\n'; break; case 't': v1 = '\t'; break; case 'u': v1 = '\\' + v1; } } com.newgrounds.encoders.json.JSON.cache.scratch += v1; } } ++com.newgrounds.encoders.json.JSON.cache.pos; } function _number() { var v1 = com.newgrounds.encoders.json.JSON.cache.arg.charAt(com.newgrounds.encoders.json.JSON.cache.pos); var v2 = '01234567890.-'; if (!com.newgrounds.encoders.json.JSON.cache.mode) { com.newgrounds.encoders.json.JSON.cache.mode = 'number'; com.newgrounds.encoders.json.JSON.cache.scratch = ''; } if (v2.indexOf(v1) < 0) { _setTargetValue(Number(com.newgrounds.encoders.json.JSON.cache.scratch)); _useParent(); } else { com.newgrounds.encoders.json.JSON.cache.scratch += v1; ++com.newgrounds.encoders.json.JSON.cache.pos; } } function _setTargetValue(newval) { var v2 = (_getParent()).obj; var v1 = com.newgrounds.encoders.json.JSON.cache.parents[com.newgrounds.encoders.json.JSON.cache.parents.length - 1]; v2[v1] = newval; } function _useParent() { com.newgrounds.encoders.json.JSON.cache.mode = com.newgrounds.encoders.json.JSON.getType((_getParent()).obj); com.newgrounds.encoders.json.JSON.cache.parents.pop(); } function _getParent() { var v2 = com.newgrounds.encoders.json.JSON.cache; var v1 = 0; while (v1 < com.newgrounds.encoders.json.JSON.cache.parents.length - 1) { v2 = v2[com.newgrounds.encoders.json.JSON.cache.parents[v1]]; ++v1; } return {'obj': v2, 'name': com.newgrounds.encoders.json.JSON.cache.parents[v1]}; } function _getCurrent() { var v2 = com.newgrounds.encoders.json.JSON.cache; var v1 = 0; while (v1 < com.newgrounds.encoders.json.JSON.cache.parents.length) { v2 = v2[com.newgrounds.encoders.json.JSON.cache.parents[v1]]; ++v1; } return {'obj': v2, 'name': com.newgrounds.encoders.json.JSON.cache.parents[v1]}; } function _addParent(child) { com.newgrounds.encoders.json.JSON.cache.parents.push(child); } function _addArrayKey() { var v1 = (_getCurrent()).obj.length; com.newgrounds.encoders.json.JSON.cache.parents.push(v1); com.newgrounds.encoders.json.JSON.cache.mode = null; } if (com.newgrounds.encoders.json.JSON.cache.pos >= com.newgrounds.encoders.json.JSON.cache.arg.length) { com.newgrounds.encoders.json.JSON.cache.complete = true; return undefined; } else { if (com.newgrounds.encoders.json.JSON.cache.mode) { ('_' + com.newgrounds.encoders.json.JSON.cache.mode)(); } else { var char = com.newgrounds.encoders.json.JSON.cache.arg.charAt(com.newgrounds.encoders.json.JSON.cache.pos); switch (char) { case '{': _object(); break; case '[': _array(); break; case '"': _string(); break; case 'n': _null(); break; case 't': _boolean(); break; case 'f': _boolean(); break; default: _number(); } } } }; v1.chunk_encoder = function () { if (com.newgrounds.encoders.json.JSON.cache.complete) { return undefined; } var v2 = com.newgrounds.encoders.json.JSON.getType(com.newgrounds.encoders.json.JSON.cache.target); switch (v2) { case 'number': com.newgrounds.encoders.json.JSON.cache.encoded += com.newgrounds.encoders.json.JSON.cache.target; com.newgrounds.encoders.json.JSON.getParent(); break; case 'string': com.newgrounds.encoders.json.JSON.cache.encoded += '"' + (com.newgrounds.encoders.json.JSON.cache.target.split('"')).join('\\"') + '"'; com.newgrounds.encoders.json.JSON.getParent(); break; case 'boolean': com.newgrounds.encoders.json.JSON.cache.encoded += (com.newgrounds.encoders.json.JSON.cache.target == true) ? 'true' : 'false'; com.newgrounds.encoders.json.JSON.getParent(); break; case 'null': com.newgrounds.encoders.json.JSON.cache.encoded += 'null'; com.newgrounds.encoders.json.JSON.getParent(); break; case 'array': if (com.newgrounds.encoders.json.JSON.cache.target.length < 1) { com.newgrounds.encoders.json.JSON.cache.encoded += ']'; com.newgrounds.encoders.json.JSON.getParent(); } else { com.newgrounds.encoders.json.JSON.cache.parents.push(com.newgrounds.encoders.json.JSON.cache.target); com.newgrounds.encoders.json.JSON.cache.target = com.newgrounds.encoders.json.JSON.cache.target[0]; if (com.newgrounds.encoders.json.JSON.getType(com.newgrounds.encoders.json.JSON.cache.target) == 'array') { com.newgrounds.encoders.json.JSON.cache.encoded += '['; } else { if (com.newgrounds.encoders.json.JSON.getType(com.newgrounds.encoders.json.JSON.cache.target) == 'object') { com.newgrounds.encoders.json.JSON.cache.encoded += '{'; } } } break; case 'object': for (var v1 in com.newgrounds.encoders.json.JSON.cache.target) { break; } if (v1 === undefined) { com.newgrounds.encoders.json.JSON.cache.encoded += '}'; com.newgrounds.encoders.json.JSON.getParent(); } else { com.newgrounds.encoders.json.JSON.cache.parents.push(com.newgrounds.encoders.json.JSON.cache.target); com.newgrounds.encoders.json.JSON.cache.target = com.newgrounds.encoders.json.JSON.cache.target[v1]; com.newgrounds.encoders.json.JSON.cache.encoded += '"' + (v1.split('"')).join('\\"') + '":'; if (com.newgrounds.encoders.json.JSON.getType(com.newgrounds.encoders.json.JSON.cache.target) == 'array') { com.newgrounds.encoders.json.JSON.cache.encoded += '['; } else { if (com.newgrounds.encoders.json.JSON.getType(com.newgrounds.encoders.json.JSON.cache.target) == 'object') { com.newgrounds.encoders.json.JSON.cache.encoded += '{'; } } } break; default: com.newgrounds.encoders.json.JSON.cache.encoded += 'null'; com.newgrounds.encoders.json.JSON.getParent(); } }; v1.getParent = function () { if (com.newgrounds.encoders.json.JSON.cache.parents.length > 0) { var v1 = com.newgrounds.encoders.json.JSON.cache.parents.pop(); if (com.newgrounds.encoders.json.JSON.getType(v1) == 'array') { v1.shift(); } else { for (var v3 in v1) { delete v1[v3]; break; } } if (com.newgrounds.encoders.json.JSON.getType(v1) == 'object' or com.newgrounds.encoders.json.JSON.getType(v1) == 'array') { for (var v2 in v1) { break; } if (v2 !== undefined) { com.newgrounds.encoders.json.JSON.cache.encoded += ','; } } com.newgrounds.encoders.json.JSON.cache.target = v1; } else { com.newgrounds.encoders.json.JSON.cache.complete = true; } }; v1.encode_chunks = 20000; v1.decode_chunks = 20000; v1.busy = false; ASSetPropFlags(com.newgrounds.encoders.json.JSON.prototype, null, 1); } #endinitclip } frame 5 { stop(); } movieClip 1296 { } movieClip 1297 { } movieClip 1300 { } movieClip 1301 { } movieClip 1303 { } movieClip 1307 { } movieClip 1308 { } movieClip 1311 { } movieClip 1315 { } movieClip 1318 { } movieClip 1319 { } movieClip 1321 { } movieClip 1322 { } movieClip 1323 { } movieClip 1324 { } movieClip 1326 { } movieClip 1327 { } movieClip 1328 { frame 115 { stop(); _root.play(); } } frame 9 { SwainAudioPlayer.init(); } movieClip 1425 { frame 2 { stop(); } } movieClip 1438 { } movieClip 1441 { } movieClip 1443 { } button 1445 { on (press) { _parent.pressSkip(); } on (rollOver) { SwainAudioPlayer.playSound('menu2', 0); } } movieClip 1447 { } movieClip 1448 { } movieClip 1450 { } movieClip 1452 { } movieClip 1454 { } movieClip 1456 { } movieClip 1457 { } movieClip 1458 { } movieClip 1460 { } movieClip 1462 { } movieClip 1463 { } movieClip 1465 { } movieClip 1467 { } movieClip 1469 { } movieClip 1471 { } movieClip 1473 { } movieClip 1475 { } movieClip 1477 { } movieClip 1479 { } movieClip 1481 { } movieClip 1483 { } movieClip 1485 { } movieClip 1487 { } movieClip 1489 { } movieClip 1491 { } movieClip 1493 { } movieClip 1495 { } movieClip 1497 { } movieClip 1499 { } movieClip 1501 { } movieClip 1503 { } movieClip 1505 { } movieClip 1507 { } movieClip 1509 { } movieClip 1511 { } movieClip 1513 { } movieClip 1515 { } movieClip 1534 { } movieClip 1536 { } movieClip 1538 { } movieClip 1540 { } movieClip 1542 { } movieClip 1544 { } movieClip 1547 { } movieClip 1549 { } movieClip 1551 { } movieClip 1552 { } movieClip 1553 cutscene_world0_start { frame 456 { SwainAudioPlayer.playSound('paper2', 0); } frame 619 { SwainAudioPlayer.playSound('paper1', 0); } frame 647 { SwainAudioPlayer.playSound('swapgun', 0); } frame 692 { SwainAudioPlayer.playSound('swapgun', 0); } frame 705 { SwainAudioPlayer.playSound('landhard', -30); } frame 733 { SwainAudioPlayer.playSound('explode', 30); } frame 796 { SwainAudioPlayer.playSound('swapgun', 0); } frame 807 { SwainAudioPlayer.playSound('swish', 0); } frame 973 { stop(); } } movieClip 1555 { } movieClip 1556 { } movieClip 1558 { } movieClip 1561 { } movieClip 1562 { } movieClip 1564 { } movieClip 1565 { } movieClip 1567 { } movieClip 1568 { } movieClip 1570 { } movieClip 1572 { } movieClip 1573 { } movieClip 1575 { } movieClip 1576 { } movieClip 1578 { } movieClip 1579 { } movieClip 1581 { } movieClip 1583 { } movieClip 1584 { } movieClip 1586 { } movieClip 1587 { } movieClip 1590 { } movieClip 1591 { } movieClip 1592 { } movieClip 1595 { } movieClip 1597 { } movieClip 1599 { } movieClip 1601 { } movieClip 1603 { } movieClip 1605 { } movieClip 1607 { } movieClip 1609 { } movieClip 1610 { frame 830 { _parent.play(); stop(); } } movieClip 1611 cutscene_world0_end { frame 778 { stop(); SwainAudioPlayer.playTrack('club1'); } frame 789 { stop(); } } movieClip 1625 { frame 56 { stop(); } } movieClip 1627 { } movieClip 1629 { } movieClip 1631 { } movieClip 1633 { } movieClip 1636 { } movieClip 1638 { } movieClip 1640 { } movieClip 1643 { } movieClip 1644 { } movieClip 1645 { } movieClip 1647 { } movieClip 1649 { } movieClip 1650 { } movieClip 1655 { } movieClip 1656 { } movieClip 1660 { } movieClip 1662 { } movieClip 1664 { } movieClip 1665 { } movieClip 1666 { } movieClip 1675 { } movieClip 1677 { } movieClip 1678 { } movieClip 1680 { } movieClip 1682 { } movieClip 1684 { } movieClip 1685 cutscene_arena1 { frame 328 { stop(); } } frame 10 { var keyManger = attachMovie('key_manager', 'keyManager', 420); KeyManager.addKey('key_action', 81); KeyManager.addKey('key_guard', 32); KeyManager.addKey('key_reload', 82); KeyManager.addKey('key_down', 83); KeyManager.addKey('key_up', 87); KeyManager.addKey('key_left', 65); KeyManager.addKey('key_right', 68); KeyManager.addKey('key_pickup', 69); KeyManager.addKey('key_slowmo', 16); KeyManager.lockKeys(); } movieClip 1688 { } movieClip 1693 { } movieClip 1694 { } movieClip 1696 { frame 1 { stop(); } } movieClip 1697 { frame 1 { _parent.myStatus = 'closed'; stop(); } frame 7 { _parent.myStatus = 'open'; stop(); } } movieClip 1699 { frame 1 { _visible = false; } } movieClip 1705 { frame 9 { stop(); } } movieClip 1706 { frame 9 { stop(); } } movieClip 1707 { } movieClip 1709 { } movieClip 1712 { frame 1 { _parent.myStatus = 'closed'; stop(); } frame 7 { _parent.myStatus = 'open'; stop(); } } movieClip 1715 { frame 1 { _parent.myStatus = 'closed'; stop(); } frame 7 { _parent.myStatus = 'open'; stop(); } } movieClip 1721 { frame 9 { stop(); } } movieClip 1722 { frame 9 { stop(); } } movieClip 1723 { } movieClip 1724 { } movieClip 1728 { } movieClip 1734 { } movieClip 1735 { frame 1 { _parent.myStatus = 'closed'; stop(); } frame 7 { _parent.myStatus = 'open'; stop(); } } movieClip 1741 { } movieClip 1742 { } movieClip 1743 { frame 1 { _parent.myStatus = 'closed'; stop(); } frame 7 { _parent.myStatus = 'open'; stop(); } } movieClip 1744 madness_doors { #initclip Object.registerClass('madness_doors', MadnessDoors); #endinitclip } movieClip 1746 { } movieClip 1749 { frame 1 { _parent._parent.myGameSpeed; } } movieClip 1750 { } movieClip 1753 { } movieClip 1756 { } movieClip 1760 { } movieClip 1761 { frame 1 { stop(); } frame 6 { stop(); } } movieClip 1763 { } movieClip 1766 { } movieClip 1773 { frame 1 { stop(); } frame 6 { stop(); } } movieClip 1774 { } movieClip 1779 { } movieClip 1781 { } movieClip 1782 { } movieClip 1786 { } // unknown tag 88 length 70 movieClip 1797 { } movieClip 1800 { } movieClip 1802 { } movieClip 1804 { } movieClip 1805 { } movieClip 1808 { } movieClip 1809 { } movieClip 1811 { } movieClip 1816 { } movieClip 1820 { } movieClip 1821 { } movieClip 1822 { } movieClip 1824 { } movieClip 1846 { frame 1 { function tick() { SpeedFrameSkipper.adjustFrames(this, _root.myGameSpeed); } onEnterFrame = tick; } } movieClip 1847 { } movieClip 1848 { frame 1 { function tick() { SpeedFrameSkipper.adjustFrames(this, _root.myGameSpeed); } if (!_parent._parent.myDataRef.asploded) { onEnterFrame = tick; } } frame 2 { _parent._parent.bombSetup(); _parent._parent.bombBeep(); } frame 37 { _parent._parent.bombBeep(); } frame 65 { _parent._parent.bombBeep(); } frame 85 { _parent._parent.bombBeep(); } frame 97 { _parent._parent.bombBeep(); } frame 105 { _parent._parent.bombBeep(); } frame 108 { _parent._parent.bombBeep(); } frame 111 { _parent._parent.bombBeep(); } frame 118 { _parent._parent.asplodeMe(); } frame 141 { onEnterFrame = null; } frame 144 { stop(); } } movieClip 1849 { } movieClip 1851 { } movieClip 1856 { } movieClip 1857 { } movieClip 1860 { } movieClip 1861 { frame 1 { function tick() { SpeedFrameSkipper.adjustFrames(this, _root.myGameSpeed); } if (!_parent._parent.myDataRef.asploded) { onEnterFrame = tick; } } frame 2 { _parent._parent.bombSetup(); _parent._parent.bombBeep(); } frame 37 { _parent._parent.bombBeep(); } frame 65 { _parent._parent.bombBeep(); } frame 85 { _parent._parent.bombBeep(); } frame 97 { _parent._parent.bombBeep(); } frame 105 { _parent._parent.bombBeep(); } frame 108 { _parent._parent.bombBeep(); } frame 111 { _parent._parent.bombBeep(); } frame 118 { _parent._parent.asplodeMe(); } frame 141 { onEnterFrame = null; } frame 144 { stop(); } } movieClip 1862 { } movieClip 1863 madness_activator { #initclip Object.registerClass('madness_activator', MadnessActivator); #endinitclip } movieClip 1865 { } movieClip 1867 { } movieClip 1869 { } movieClip 1871 { } movieClip 1877 { frame 5 { stop(); } } movieClip 1880 { } movieClip 1882 { } button 1888 { on (release) { pressYes(true); } on (rollOver) { SwainAudioPlayer.playSound('menu2', 0); } } button 1891 { on (release) { pressNo(); } on (rollOver) { SwainAudioPlayer.playSound('menu2', 0); } } // unknown tag 88 length 111 button 1899 { on (release) { pressNo(); } } button 1902 { on (release) { pressYes(); } } button 1912 { on (release) { pressYes(); } } movieClip 1919 { frame 1 { gotoAndStop(SwainMath.randomNumber(1, _totalframes)); } } movieClip 1934 { } button 1940 { on (release) { pressYes(true); } on (rollOver) { SwainAudioPlayer.playSound('menu2', 0); } } movieClip 1944 { } movieClip 1946 { } movieClip 1952 { } // unknown tag 88 length 107 movieClip 1971 { } movieClip 1973 { } button 1977 { on (release) { pressNo(); } on (rollOver) { SwainAudioPlayer.playSound('menu2', 0); } } button 1979 { on (rollOver) { rollOverMissionCharacter(1); SwainAudioPlayer.playSound('menu2', 0); } on (rollOut) { rollOutMissionCharacter(1); } on (press) { pressMissionCharacter(1); } } button 1980 { on (rollOver) { rollOverMissionCharacter(2); SwainAudioPlayer.playSound('menu2', 0); } on (rollOut) { rollOutMissionCharacter(2); } on (press) { pressMissionCharacter(2); } } button 1981 { on (rollOver) { rollOverMissionCharacter(3); SwainAudioPlayer.playSound('menu2', 0); } on (rollOut) { rollOutMissionCharacter(3); } on (press) { pressMissionCharacter(3); } } movieClip 1988 { } button 1989 { on (press) { missionChangeDifficulty('easy'); } on (rollOver) { SwainAudioPlayer.playSound('menu2', 0); } } button 1992 { on (press) { missionChangeDifficulty('normal'); } on (rollOver) { SwainAudioPlayer.playSound('menu2', 0); } } button 1995 { on (press) { missionChangeDifficulty('hard'); } on (rollOver) { SwainAudioPlayer.playSound('menu2', 0); } } button 2005 { on (release) { pressNo(); } } movieClip 2009 { } movieClip 2010 { } movieClip 2012 game_menu_portrait { } button 2017 { on (rollOver) { rollOverMissionCharacter(0); } on (rollOut) { rollOutMissionCharacter(0); } on (press) { pressMissionCharacter(0); } } button 2018 { on (rollOver) { rollOverMissionCharacter(1); } on (rollOut) { rollOutMissionCharacter(1); } on (press) { pressMissionCharacter(1); } } button 2019 { on (rollOver) { rollOverMissionCharacter(2); } on (rollOut) { rollOutMissionCharacter(2); } on (press) { pressMissionCharacter(2); } } button 2020 { on (rollOver) { rollOverMissionCharacter(3); } on (rollOut) { rollOutMissionCharacter(3); } on (press) { pressMissionCharacter(3); } } movieClip 2023 { } movieClip 2026 madness_popup { #initclip Object.registerClass('madness_popup', MadnessPopup); #endinitclip } movieClip 2033 { frame 17 { stop(); } } movieClip 2036 { frame 6 { stop(); } } button 2038 { on (rollOver) { _parent.displayStatInfo(this); } } movieClip 2042 perk_peg { } movieClip 2049 { frame 17 { stop(); } } movieClip 2057 { } movieClip 2060 { frame 6 { stop(); } } button 2063 { on (rollOver) { _parent.displayStatInfo(this); } } movieClip 2067 perk_5 { } movieClip 2072 { } movieClip 2075 { } movieClip 2076 { } button 2080 { on (rollOver) { _parent.displayStatInfo(this); SwainAudioPlayer.playSound('menu2', 0); } on (press) { _parent.clickStat(this); } } movieClip 2092 perk_icon { } movieClip 2096 { } movieClip 2098 { } movieClip 2100 { } movieClip 2101 { } movieClip 2102 { frame 1 { function tick() { SpeedFrameSkipper.adjustFrames(this, _root.myGameSpeed); } onEnterFrame = tick; } frame 5 { gotoAndPlay(SwainMath.randomNumber(2, 40)); } } movieClip 2103 { } movieClip 2105 { } movieClip 2107 { } movieClip 2109 { } movieClip 2110 { frame 1 { function tick() { SpeedFrameSkipper.adjustFrames(this, _root.myGameSpeed); } onEnterFrame = tick; } frame 6 { if (SwainMath.randomNumber(0, 200) != 0) { gotoAndPlay(2); } } } movieClip 2112 { } movieClip 2114 { } movieClip 2116 { } movieClip 2117 { frame 1 { function tick() { SpeedFrameSkipper.adjustFrames(this, _root.myGameSpeed); } onEnterFrame = tick; } frame 6 { if (SwainMath.randomNumber(0, 200) != 0) { gotoAndPlay(2); } } } movieClip 2119 { } movieClip 2121 { } movieClip 2123 { } movieClip 2125 { } movieClip 2127 { } movieClip 2129 { } movieClip 2131 { } movieClip 2133 { } movieClip 2134 { frame 1 { function tick() { SpeedFrameSkipper.adjustFrames(this, _root.myGameSpeed); } onEnterFrame = tick; } frame 328 { _parent.gotoAndStop(1); } } movieClip 2136 { } movieClip 2138 { } movieClip 2139 { frame 1 { function tick() { SpeedFrameSkipper.adjustFrames(this, _root.myGameSpeed); } onEnterFrame = tick; } frame 190 { _parent.gotoAndStop(1); } } movieClip 2141 { } movieClip 2142 { frame 1 { function tick() { SpeedFrameSkipper.adjustFrames(this, _root.myGameSpeed); } onEnterFrame = tick; } frame 385 { _parent.gotoAndStop(1); } } movieClip 2143 { frame 1 { function tick() { SpeedFrameSkipper.adjustFrames(this, _root.myGameSpeed); } onEnterFrame = tick; } frame 234 { _parent.gotoAndStop(1); } } movieClip 2144 { frame 1 { function tick() { if (_currentframe == 1 && SwainMath.randomNumber(0, 180) == 0) { gotoAndStop(SwainMath.randomNumber(2, 5)); } } stop(); onEnterFrame = tick; } } movieClip 2147 { } movieClip 2149 { } movieClip 2151 { } movieClip 2152 { } movieClip 2153 aim_reticle { } button 2155 { on (press) { _parent._parent.pressItemSlot('weapon0'); } on (rollOver) { SwainAudioPlayer.playSound('menu2', 0); } } movieClip 2157 { } button 2159 { on (press) { _parent._parent.pressItemSlot('weapon1'); } on (rollOver) { SwainAudioPlayer.playSound('menu2', 0); } } movieClip 2166 { } button 2171 { on (press) { _parent._parent.pressItemSlot('hat'); } on (rollOver) { SwainAudioPlayer.playSound('menu2', 0); } } movieClip 2175 { } button 2180 { on (press) { _parent._parent.pressItemSlot('mask'); } on (rollOver) { SwainAudioPlayer.playSound('menu2', 0); } } movieClip 2183 { } button 2188 { on (press) { _parent._parent.pressItemSlot('mouth'); } on (rollOver) { SwainAudioPlayer.playSound('menu2', 0); } } movieClip 2191 { } button 2196 { on (press) { _parent._parent.pressItemSlot('shirt'); } on (rollOver) { SwainAudioPlayer.playSound('menu2', 0); } } movieClip 2200 { } movieClip 2201 { } movieClip 2205 { } movieClip 2207 { frame 1 { _visible = false; } } movieClip 2211 { } movieClip 2214 { } movieClip 2215 { frame 6 { stop(); _parent._parent.spikesOpen(); } } movieClip 2216 { } movieClip 2217 madness_obstacle { #initclip Object.registerClass('madness_obstacle', MadnessObstacle); #endinitclip } movieClip 2219 { } movieClip 2221 { } movieClip 2223 { } movieClip 2225 { } movieClip 2227 { } movieClip 2229 { } movieClip 2231 { } movieClip 2233 { } movieClip 2235 { } movieClip 2238 { frame 1 { stop(); } } movieClip 2241 { frame 1 { stop(); } } movieClip 2244 { } movieClip 2251 { } movieClip 2252 { frame 1 { stop(); if (_parent._parent._parent._parent.myDataRef.myCharacter != undefined) { gotoAndStop(_parent._parent._parent._parent.myDataRef.myCharacter); } } } movieClip 2254 { frame 1 { _visible = false; } } movieClip 2259 { frame 9 { stop(); } } movieClip 2260 { } movieClip 2261 Pistol - PPK - Fire R { frame 20 { stop(); } } movieClip 2268 { } movieClip 2269 { frame 1 { stop(); if (_parent._parent._parent._parent.myDataRef.myCharacter != undefined) { gotoAndStop(_parent._parent._parent._parent.myDataRef.myCharacter); } } } movieClip 2270 Pistol - PPK - Fire L { frame 20 { stop(); } } movieClip 2271 Pistol - PPK - Reload R { frame 11 { if (_parent._visible) { _parent._parent._parent.ejectClip(); } } frame 65 { _parent._parent._parent.reloadMe(); } } movieClip 2272 Pistol - PPK - Reload L { frame 17 { if (_parent._visible) { _parent._parent._parent.ejectClip(); } } frame 65 { _parent._parent._parent.reloadMe(); } } movieClip 2273 { } movieClip 2274 Pistol - PPK_Silencer - Fire R { frame 17 { stop(); } } movieClip 2275 Pistol - PPK_Silencer - Fire L { frame 17 { stop(); } } movieClip 2276 Pistol - PPK_Silencer - Reload R { frame 20 { if (_parent._visible) { _parent._parent._parent.ejectClip(); } } frame 65 { _parent._parent._parent.reloadMe(); } } movieClip 2277 Pistol - PPK_Silencer - Reload L { frame 20 { if (_parent._visible) { _parent._parent._parent.ejectClip(); } } frame 65 { _parent._parent._parent.reloadMe(); } } movieClip 2278 { } movieClip 2279 Pistol - Beretta - Fire R { frame 17 { stop(); } } movieClip 2280 Pistol - Beretta - Fire L { frame 17 { stop(); } } movieClip 2281 Pistol - Beretta - Reload R { frame 20 { if (_parent._visible) { _parent._parent._parent.ejectClip(); } } frame 65 { _parent._parent._parent.reloadMe(); } } movieClip 2282 Pistol - Beretta - Reload L { frame 20 { if (_parent._visible) { _parent._parent._parent.ejectClip(); } } frame 65 { _parent._parent._parent.reloadMe(); } } movieClip 2283 { } movieClip 2284 Pistol - Beretta_Silencer - Fire R { frame 17 { stop(); } } movieClip 2285 Pistol - Beretta_Silencer - Fire L { frame 17 { stop(); } } movieClip 2286 Pistol - Beretta_Silencer - Reload R { frame 20 { if (_parent._visible) { _parent._parent._parent.ejectClip(); } } frame 65 { _parent._parent._parent.reloadMe(); } } movieClip 2287 Pistol - Beretta_Silencer - Reload L { frame 20 { if (_parent._visible) { _parent._parent._parent.ejectClip(); } } frame 65 { _parent.reloadMe(); } } movieClip 2288 { } movieClip 2289 Pistol - Glock20 - Fire R { frame 17 { stop(); } } movieClip 2290 Pistol - Glock20 - Fire L { frame 17 { stop(); } } movieClip 2291 Pistol - Glock20 - Reload R { frame 11 { if (_parent._visible) { _parent._parent._parent.ejectClip(); } } frame 65 { _parent._parent._parent.reloadMe(); } } movieClip 2292 Pistol - Glock20 - Reload L { frame 11 { if (_parent._visible) { _parent._parent._parent.ejectClip(); } } frame 65 { _parent._parent._parent.reloadMe(); } } movieClip 2293 { } movieClip 2294 Pistol - Glock20_Silencer - Fire R { frame 17 { stop(); } } movieClip 2295 Pistol - Glock20_Silencer - Fire L { frame 17 { stop(); } } movieClip 2296 Pistol - Glock20_Silencer - Reload R { frame 11 { if (_parent._visible) { _parent._parent._parent.ejectClip(); } } frame 65 { _parent._parent._parent.reloadMe(); } } movieClip 2297 Pistol - Glock20_Silencer - Reload L { frame 11 { if (_parent._visible) { _parent._parent._parent.ejectClip(); } } frame 65 { _parent._parent._parent.reloadMe(); } } movieClip 2299 { frame 1 { gotoAndStop(MadnessCharacter.myPartOn(this, 'myColor', 0)); } } movieClip 2300 { frame 1 { gotoAndStop(MadnessCharacter.myPartOn(this, 'myColor', 0)); } } movieClip 2301 { } movieClip 2307 { frame 11 { stop(); } } movieClip 2308 { } movieClip 2309 Pistol - Prokiller460 - Fire R { frame 26 { stop(); } } movieClip 2310 Pistol - Prokiller460 - Fire L { frame 26 { stop(); } } movieClip 2311 { } movieClip 2312 Pistol - Prokiller460 - Reload R { frame 16 { if (_parent._visible) { _parent._parent._parent.ejectClip(); } } frame 61 { _parent._parent._parent.reloadMe(); } } movieClip 2313 Pistol - Prokiller460 - Reload L { frame 15 { if (_parent._visible) { _parent._parent._parent.ejectClip(); } } frame 61 { _parent._parent._parent.reloadMe(); } } movieClip 2314 { } movieClip 2315 Pistol - Deagle - Fire R { frame 21 { stop(); } } movieClip 2316 Pistol - Deagle - Fire L { frame 21 { stop(); } } movieClip 2317 Pistol - Deagle - Reload R { frame 15 { if (_parent._visible) { _parent._parent._parent.ejectClip(); } } frame 61 { _parent._parent._parent.reloadMe(); } } movieClip 2318 Pistol - Deagle - Reload L { frame 15 { if (_parent._visible) { _parent._parent._parent.ejectClip(); } } frame 61 { _parent._parent._parent.reloadMe(); } } movieClip 2319 Pistol - 500_Snub - Fire R { frame 31 { stop(); } } movieClip 2320 Pistol - 500_Snub - Fire L { frame 31 { stop(); } } movieClip 2321 Pistol - 500_Snub - Reload R { frame 23 { if (_parent._visible) { _parent._parent._parent.ejectShell(); _parent._parent._parent.ejectShell(); _parent._parent._parent.ejectShell(); _parent._parent._parent.ejectShell(); _parent._parent._parent.ejectShell(); } } frame 55 { _parent._parent._parent.reloadMe(); } } movieClip 2322 Pistol - 500_Snub - Reload L { frame 23 { if (_parent._visible) { _parent._parent._parent.ejectShell(); _parent._parent._parent.ejectShell(); _parent._parent._parent.ejectShell(); _parent._parent._parent.ejectShell(); _parent._parent._parent.ejectShell(); } } frame 55 { _parent._parent._parent.reloadMe(); } } movieClip 2323 Pistol - 500 - Fire R { frame 38 { stop(); } } movieClip 2324 Pistol - 500 - Fire L { frame 37 { stop(); } } movieClip 2325 Pistol - 500 - Reload R { frame 23 { if (_parent._visible) { _parent._parent._parent.ejectShell(); _parent._parent._parent.ejectShell(); _parent._parent._parent.ejectShell(); _parent._parent._parent.ejectShell(); _parent._parent._parent.ejectShell(); } } frame 55 { _parent._parent._parent.reloadMe(); } } movieClip 2326 Pistol - 500 - Reload L { frame 23 { if (_parent._visible) { _parent._parent._parent.ejectShell(); _parent._parent._parent.ejectShell(); _parent._parent._parent.ejectShell(); _parent._parent._parent.ejectShell(); _parent._parent._parent.ejectShell(); } } frame 55 { _parent._parent._parent.reloadMe(); } } movieClip 2327 Pistol - 357 - Fire R { frame 31 { stop(); } } movieClip 2328 Pistol - 357 - Fire L { frame 31 { stop(); } } movieClip 2329 Pistol - 357 - Reload R { frame 23 { if (_parent._visible) { _parent._parent._parent.ejectShell(); _parent._parent._parent.ejectShell(); _parent._parent._parent.ejectShell(); _parent._parent._parent.ejectShell(); _parent._parent._parent.ejectShell(); _parent._parent._parent.ejectShell(); } } frame 55 { _parent._parent._parent.reloadMe(); } } movieClip 2330 Pistol - 357 - Reload L { frame 23 { if (_parent._visible) { _parent._parent._parent.ejectShell(); _parent._parent._parent.ejectShell(); _parent._parent._parent.ejectShell(); _parent._parent._parent.ejectShell(); _parent._parent._parent.ejectShell(); _parent._parent._parent.ejectShell(); } } frame 55 { _parent._parent._parent.reloadMe(); } } movieClip 2335 { frame 9 { stop(); } } movieClip 2336 SMG - HK2 - Fire R { frame 14 { stop(); } } movieClip 2337 SMG - HK2 - Fire L { frame 14 { stop(); } } movieClip 2338 SMG - HK2 - Reload R { frame 25 { if (_parent._visible) { _parent._parent._parent.ejectClip(); } } frame 59 { _parent._parent._parent.reloadMe(); } } movieClip 2339 SMG - HK2 - Reload L { frame 25 { if (_parent._visible) { _parent._parent._parent.ejectClip(); } } frame 59 { _parent._parent._parent.reloadMe(); } } movieClip 2340 { } movieClip 2341 SMG - TMP - Fire R { frame 10 { stop(); } } movieClip 2342 SMG - TMP - Fire L { frame 10 { stop(); } } movieClip 2343 SMG - TMP - Reload R { frame 37 { if (_parent._visible) { _parent._parent._parent.ejectClip(); } } frame 67 { _parent._parent._parent.reloadMe(); } } movieClip 2344 SMG - TMP - Reload L { frame 37 { if (_parent._visible) { _parent._parent._parent.ejectClip(); } } frame 67 { _parent._parent._parent.reloadMe(); } } movieClip 2349 { frame 9 { stop(); } } movieClip 2350 SMG - TMP_Silencer - Fire R { frame 10 { stop(); } } movieClip 2351 SMG - TMP_Silencer - Fire L { frame 10 { stop(); } } movieClip 2352 SMG - TMP_Silencer - Reload R { frame 37 { if (_parent._visible) { _parent._parent._parent.ejectClip(); } } frame 67 { _parent._parent._parent.reloadMe(); } } movieClip 2353 SMG - TMP_Silencer - Reload L { frame 37 { if (_parent._visible) { _parent._parent._parent.ejectClip(); } } frame 67 { _parent._parent._parent.reloadMe(); } } movieClip 2354 { } movieClip 2355 SMG - MP7 - Fire R { frame 16 { stop(); } } movieClip 2356 SMG - MP7 - Fire L { frame 16 { stop(); } } movieClip 2357 SMG - MP7 - Reload R { frame 37 { if (_parent._visible) { _parent._parent._parent.ejectClip(); } } frame 67 { _parent._parent._parent.reloadMe(); } } movieClip 2358 SMG - MP7 - Reload L { frame 37 { if (_parent._visible) { _parent._parent._parent.ejectClip(); } } frame 67 { _parent._parent._parent.reloadMe(); } } movieClip 2359 SMG - MP7_Silencer - Fire R { frame 10 { stop(); } } movieClip 2360 SMG - MP7_Silencer - Fire L { frame 10 { stop(); } } movieClip 2361 SMG - MP7_Silencer - Reload R { frame 37 { if (_parent._visible) { _parent._parent._parent.ejectClip(); } } frame 67 { _parent._parent._parent.reloadMe(); } } movieClip 2362 SMG - MP7_Silencer - Reload L { frame 37 { if (_parent._visible) { _parent._parent._parent.ejectClip(); } } frame 67 { _parent._parent._parent.reloadMe(); } } movieClip 2363 { } movieClip 2364 SMG - MP5K - Fire R { frame 16 { stop(); } } movieClip 2365 SMG - MP5K - Fire L { frame 17 { stop(); } } movieClip 2366 SMG - MP5K - Reload R { frame 27 { if (_parent._visible) { _parent._parent._parent.ejectClip(); } } frame 59 { _parent._parent._parent.reloadMe(); } } movieClip 2367 SMG - MP5K - Reload L { frame 27 { if (_parent._visible) { _parent._parent._parent.ejectClip(); } } frame 59 { _parent._parent._parent.reloadMe(); } } movieClip 2368 SMG - MP5K_Silencer - Fire R { frame 10 { stop(); } } movieClip 2369 SMG - MP5K_Silencer - Fire L { frame 10 { stop(); } } movieClip 2370 SMG - MP5K_Silencer - Reload R { frame 27 { if (_parent._visible) { _parent._parent._parent.ejectClip(); } } frame 59 { _parent._parent._parent.reloadMe(); } } movieClip 2371 SMG - MP5K_Silencer - Reload L { frame 27 { if (_parent._visible) { _parent._parent._parent.ejectClip(); } } frame 59 { _parent._parent._parent.reloadMe(); } } movieClip 2372 { } movieClip 2373 SMG - MP5 - Fire R { frame 10 { stop(); } } movieClip 2374 SMG - MP5 - Fire L { frame 10 { stop(); } } movieClip 2375 SMG - MP5 - Reload R { frame 25 { if (_parent._visible) { _parent._parent._parent.ejectClip(); } } frame 59 { _parent._parent._parent.reloadMe(); } } movieClip 2376 SMG - MP5 - Reload L { frame 25 { if (_parent._visible) { _parent._parent._parent.ejectClip(); } } frame 59 { _parent._parent._parent.reloadMe(); } } movieClip 2377 SMG - MP5_Silencer - Fire R { frame 10 { stop(); } } movieClip 2378 SMG - MP5_Silencer - Fire L { } movieClip 2379 SMG - MP5_Silencer - Reload R { frame 25 { if (_parent._visible) { _parent._parent._parent.ejectClip(); } } frame 59 { _parent._parent._parent.reloadMe(); } } movieClip 2380 SMG - MP5_Silencer - Reload L { frame 25 { if (_parent._visible) { _parent._parent._parent.ejectClip(); } } frame 59 { _parent._parent._parent.reloadMe(); } } movieClip 2381 { } movieClip 2382 SMG - Mineaba PM9 - Fire R { frame 10 { stop(); } } movieClip 2383 SMG - Mineaba PM9 - Fire L { frame 10 { stop(); } } movieClip 2384 SMG - Mineaba PM9 - Reload R { frame 37 { if (_parent._visible) { _parent._parent._parent.ejectClip(); } } frame 67 { _parent._parent._parent.reloadMe(); } } movieClip 2385 SMG - Mineaba PM9 - Reload L { frame 37 { if (_parent._visible) { _parent._parent._parent.ejectClip(); } } frame 67 { _parent._parent._parent.reloadMe(); } } movieClip 2386 SMG - Mineaba PM9_Silencer - Fire R { frame 10 { stop(); } } movieClip 2387 SMG - Mineaba PM9_Silencer - Fire L { frame 10 { stop(); } } movieClip 2388 SMG - Mineaba PM9_Silencer - Reload R { frame 37 { if (_parent._visible) { _parent._parent._parent.ejectClip(); } } frame 67 { _parent._parent._parent.reloadMe(); } } movieClip 2389 SMG - Mineaba PM9_Silencer - Reload L { frame 37 { if (_parent._visible) { _parent._parent._parent.ejectClip(); } } frame 67 { _parent._parent._parent.reloadMe(); } } movieClip 2390 { } movieClip 2396 { frame 11 { stop(); } } movieClip 2397 Rifle - AK74 - Fire R { frame 14 { stop(); } } movieClip 2398 Rifle - AK74 - Fire L { frame 14 { stop(); } } movieClip 2399 Rifle - AK74 - Reload R { frame 33 { if (_parent._visible) { _parent._parent._parent.ejectClip(); } } frame 77 { _parent._parent._parent.reloadMe(); } } movieClip 2400 Rifle - AK74 - Reload L { frame 33 { if (_parent._visible) { _parent._parent._parent.ejectClip(); } } frame 77 { _parent._parent._parent.reloadMe(); } } movieClip 2401 { } movieClip 2407 { frame 11 { stop(); } } movieClip 2408 Rifle - AR15 - Fire R { frame 18 { stop(); } } movieClip 2409 Rifle - AR15 - Fire L { frame 17 { stop(); } } movieClip 2410 Rifle - AR15 - Reload R { frame 25 { if (_parent._visible) { _parent._parent._parent.ejectClip(); } } frame 59 { _parent._parent._parent.reloadMe(); } } movieClip 2411 Rifle - AR15 - Reload L { frame 25 { if (_parent._visible) { _parent._parent._parent.ejectClip(); } } frame 59 { _parent._parent._parent.reloadMe(); } } movieClip 2412 { } movieClip 2413 Rifle - SR3 - Fire R { frame 21 { stop(); } } movieClip 2414 Rifle - SR3 - Fire L { frame 22 { stop(); } } movieClip 2415 Rifle - SR3 - Reload R { frame 33 { if (_parent._visible) { _parent._parent._parent.ejectClip(); } } frame 71 { _parent._parent._parent.reloadMe(); } } movieClip 2416 Rifle - SR3 - Reload L { frame 33 { if (_parent._visible) { _parent._parent._parent.ejectClip(); } } frame 71 { _parent._parent._parent.reloadMe(); } } movieClip 2417 { } movieClip 2418 Rifle - M16 - Fire R { frame 12 { stop(); } } movieClip 2419 Rifle - M16 - Fire L { frame 12 { stop(); } } movieClip 2420 Rifle - M16 - Reload R { frame 25 { if (_parent._visible) { _parent._parent._parent.ejectClip(); } } frame 59 { _parent._parent._parent.reloadMe(); } } movieClip 2421 Rifle - M16 - Reload L { frame 25 { if (_parent._visible) { _parent._parent._parent.ejectClip(); } } frame 59 { _parent._parent._parent.reloadMe(); } } movieClip 2422 { } movieClip 2426 { frame 1 { gotoAndStop(MadnessCharacter.myPartOn(this, 'myColor', 0)); } } movieClip 2427 Shotgun - Norinco97k - Fire R { frame 18 { if (_parent._visible) { _parent._parent._parent.ejectShell(); } } frame 24 { _parent._parent._parent.playSound('shotguncock'); } frame 40 { stop(); } } movieClip 2428 Shotgun - Norinco97k - Fire L { frame 18 { if (_parent._visible) { _parent._parent._parent.ejectShell(); } } frame 24 { _parent._parent._parent.playSound('shotguncock'); } frame 40 { stop(); } } movieClip 2429 Shotgun - Norinco97k - Reload R { frame 27 { if (_parent._visible) { _parent._parent._parent.ejectClip(); } } frame 61 { _parent._parent._parent.reloadMe(); } } movieClip 2430 Shotgun - Norinco97k - Reload L { frame 27 { if (_parent._visible) { _parent._parent._parent.ejectClip(); } } frame 61 { _parent._parent._parent.reloadMe(); } } movieClip 2431 Rifle - Aug - Fire L { } movieClip 2432 Rifle - Aug - Fire R { } movieClip 2433 Rifle - Aug - Reload L { frame 27 { if (_parent._visible) { _parent._parent._parent.ejectClip(); } } frame 73 { _parent._parent._parent.reloadMe(); } } movieClip 2434 Rifle - Aug - Reload R { frame 27 { if (_parent._visible) { _parent._parent._parent.ejectClip(); } } frame 73 { _parent._parent._parent.reloadMe(); } } movieClip 2435 Rifle - AK74U - Fire R { } movieClip 2436 Rifle - AK74U - Fire L { } movieClip 2437 Rifle - AK74U - Reload L { frame 33 { if (_parent._visible) { _parent._parent._parent.ejectClip(); } } frame 77 { _parent._parent._parent.reloadMe(); } } movieClip 2438 Rifle - AK74U - Reload R { frame 33 { if (_parent._visible) { _parent._parent._parent.ejectClip(); } } frame 77 { _parent._parent._parent.reloadMe(); } } movieClip 2439 SMG - HK2_Silencer - Reload R { frame 25 { if (_parent._visible) { _parent._parent._parent.ejectClip(); } } frame 59 { _parent._parent._parent.reloadMe(); } } movieClip 2440 SMG - HK2_Silencer - Reload L { frame 25 { if (_parent._visible) { _parent._parent._parent.ejectClip(); } } frame 59 { _parent._parent._parent.reloadMe(); } } movieClip 2441 SMG - HK2_Silencer - Fire L { } movieClip 2442 SMG - HK2_Silencer - Fire R { } movieClip 2443 SMG - OA93 - Reload R { frame 25 { if (_parent._visible) { _parent._parent._parent.ejectClip(); } } frame 57 { _parent._parent._parent.reloadMe(); } } movieClip 2444 SMG - OA93 - Reload L { frame 25 { if (_parent._visible) { _parent._parent._parent.ejectClip(); } } frame 57 { _parent._parent._parent.reloadMe(); } } movieClip 2445 { } movieClip 2446 SMG - OA93 - Fire R { } movieClip 2447 SMG - OA93 - Fire L { } movieClip 2448 SMG - OA93_Silencer - Reload R { frame 25 { if (_parent._visible) { _parent._parent._parent.ejectClip(); } } frame 57 { _parent._parent._parent.reloadMe(); } } movieClip 2449 SMG - OA93_Silencer - Reload L { frame 25 { if (_parent._visible) { _parent._parent._parent.ejectClip(); } } frame 57 { _parent._parent._parent.reloadMe(); } } movieClip 2450 SMG - OA93_Silencer - Fire R { } movieClip 2451 SMG - OA93_Silencer - Fire L { } movieClip 2452 Rifle - FN FAL - Fire R { } movieClip 2453 Rifle - FN FAL - Fire L { } movieClip 2454 Rifle - FN FAL - Reload L { frame 33 { if (_parent._visible) { _parent._parent._parent.ejectClip(); } } frame 75 { _parent._parent._parent.reloadMe(); } } movieClip 2455 Rifle - FN FAL - Reload R { frame 33 { if (_parent._visible) { _parent._parent._parent.ejectClip(); } } frame 75 { _parent._parent._parent.reloadMe(); } } movieClip 2456 Pistol - 357_Snub - Fire L { } movieClip 2457 Pistol - 357_Snub - Fire R { } movieClip 2458 Pistol - 357_Snub - Reload L { frame 23 { if (_parent._visible) { _parent._parent._parent.ejectShell(); _parent._parent._parent.ejectShell(); _parent._parent._parent.ejectShell(); _parent._parent._parent.ejectShell(); _parent._parent._parent.ejectShell(); _parent._parent._parent.ejectShell(); } } frame 55 { _parent._parent._parent.reloadMe(); } } movieClip 2459 Pistol - 357_Snub - Reload R { frame 23 { if (_parent._visible) { _parent._parent._parent.ejectShell(); _parent._parent._parent.ejectShell(); _parent._parent._parent.ejectShell(); _parent._parent._parent.ejectShell(); _parent._parent._parent.ejectShell(); _parent._parent._parent.ejectShell(); } } frame 55 { _parent._parent._parent.reloadMe(); } } movieClip 2460 Rifle - HK416 - Reload R { frame 25 { if (_parent._visible) { _parent._parent._parent.ejectClip(); } } frame 59 { _parent._parent._parent.reloadMe(); } } movieClip 2461 Rifle - HK416 - Reload L { frame 25 { if (_parent._visible) { _parent._parent._parent.ejectClip(); } } frame 59 { _parent._parent._parent.reloadMe(); } } movieClip 2462 Rifle - HK416 - Fire R { } movieClip 2463 Rifle - HK416 - Fire L { } movieClip 2467 { frame 1 { gotoAndStop(MadnessCharacter.myPartOn(this, 'myColor', 0)); } } movieClip 2469 { } movieClip 2470 Shotgun - SPAS12 - Reload R { } movieClip 2471 Shotgun - SPAS12 - Reload L { } movieClip 2472 { } movieClip 2473 Shotgun - SPAS12 - Fire R { frame 16 { if (_parent._visible) { _parent._parent._parent.ejectShell(); } } frame 25 { _parent._parent._parent.playSound('shotguncock'); } } movieClip 2474 Shotgun - SPAS12 - Fire L { frame 16 { if (_parent._visible) { _parent._parent._parent.ejectShell(); } } frame 25 { _parent._parent._parent.playSound('shotguncock'); } } movieClip 2475 Rifle - M249 - Fire L { } movieClip 2476 Rifle - M249 - Fire R { } movieClip 2477 Rifle - M249 - Reload L { frame 39 { if (_parent._visible) { _parent._parent._parent.ejectClip(); } } frame 183 { _parent._parent._parent.reloadMe(); } } movieClip 2478 Rifle - M249 - Reload R { frame 39 { if (_parent._visible) { _parent._parent._parent.ejectClip(); } } frame 183 { _parent._parent._parent.reloadMe(); } } movieClip 2484 { frame 6 { stop(); } } movieClip 2485 Heavy - Chaingun - Fire L { } movieClip 2486 Heavy - Chaingun - Fire R { } movieClip 2487 Shotgun - USAS12 - Fire R { frame 2 { if (_parent._visible) { _parent._parent._parent.ejectShell(); } } } movieClip 2488 Shotgun - USAS12 - Fire L { frame 2 { if (_parent._visible) { _parent._parent._parent.ejectShell(); } } } movieClip 2489 Shotgun - USAS12 - Reload L { frame 33 { if (_parent._visible) { _parent._parent._parent.ejectClip(); } } frame 73 { _parent._parent._parent.reloadMe(); } } movieClip 2490 Shotgun - USAS12 - Reload R { frame 33 { if (_parent._visible) { _parent._parent._parent.ejectClip(); } } frame 73 { _parent._parent._parent.reloadMe(); } } movieClip 2491 { } movieClip 2492 Pistol - Prokiller460_Silencer - Fire L { frame 19 { stop(); } } movieClip 2493 Pistol - Prokiller460_Silencer - Fire R { frame 19 { stop(); } } movieClip 2494 { } movieClip 2495 Pistol - Prokiller460_Silencer - Reload L { frame 16 { if (_parent._visible) { _parent._parent._parent.ejectClip(); } } frame 61 { _parent._parent._parent.reloadMe(); } } movieClip 2496 Pistol - Prokiller460_Silencer - Reload R { frame 16 { if (_parent._visible) { _parent._parent._parent.ejectClip(); } } frame 61 { _parent._parent._parent.reloadMe(); } } movieClip 2497 Rifle - FAMAS - Fire L { } movieClip 2498 Rifle - FAMAS - Fire R { } movieClip 2499 Rifle - FAMAS - Reload L { frame 27 { if (_parent._visible) { _parent._parent._parent.ejectClip(); } } frame 71 { _parent._parent._parent.reloadMe(); } } movieClip 2500 Rifle - FAMAS - Reload R { frame 27 { if (_parent._visible) { _parent._parent._parent.ejectClip(); } } frame 71 { _parent._parent._parent.reloadMe(); } } movieClip 2501 Heavy - M203 - Fire L { } movieClip 2502 Heavy - M203 - Fire R { } movieClip 2504 { } movieClip 2505 Heavy - M203 - Reload L { frame 21 { if (_parent._visible) { _parent._parent._parent.ejectClip(); } } frame 101 { _parent._parent._parent.reloadMe(); } } movieClip 2506 Heavy - M203 - Reload R { frame 21 { if (_parent._visible) { _parent._parent._parent.ejectClip(); } } frame 101 { _parent._parent._parent.reloadMe(); } } movieClip 2507 Melee - R { } movieClip 2508 Melee - L { } movieClip 2509 Melee - Block { frame 63 { _parent._parent._parent.actionTimer = 10; stop(); } } movieClip 2510 Melee - Block2 { frame 65 { _parent._parent._parent.actionTimer = 12; stop(); } } movieClip 2511 Melee - Block3 { frame 65 { _parent._parent._parent.actionTimer = 12; stop(); } } movieClip 2512 Melee - Block4 { frame 65 { _parent._parent._parent.actionTimer = 12; stop(); } } movieClip 2513 Melee - Block5 { frame 65 { _parent._parent._parent.actionTimer = 12; stop(); } } movieClip 2514 Melee - Block6 { frame 65 { _parent._parent._parent.actionTimer = 12; stop(); } } movieClip 2515 { } movieClip 2518 { } movieClip 2523 { } movieClip 2528 { } movieClip 2530 { frame 1 { stop(); } } movieClip 2537 { } button 2540 { on (press) { _parent.pressPortrait(this); } } movieClip 2542 madness_char_portrait { frame 1 { stop(); } frame 1 { cacheAsBitmap; } } button 2550 { on (press) { _parent._parent.pressLeader(_parent); } } movieClip 2553 { frame 1 { stop(); } } movieClip 2562 { } button 2564 { on (press) { _parent.pressBuy(this); } on (rollOver) { SwainAudioPlayer.playSound('menu2', 0); } } movieClip 2595 { } movieClip 2602 { frame 1 { _visible = false; } } movieClip 2604 { frame 1 { stop(); } } button 2607 { on (press) { _parent.removeTeammate(this); } } movieClip 2614 madness_char_icon { instance weaponSlot0 of movieClip 2604 { } instance weaponSlot1 of movieClip 2604 { } } movieClip 2617 { } movieClip 2618 { } movieClip 2622 { } movieClip 2628 { } movieClip 2631 { } movieClip 2633 { } movieClip 2635 { } movieClip 2637 { } movieClip 2641 { } movieClip 2643 { } movieClip 2645 { } movieClip 2647 { } movieClip 2649 { } movieClip 2651 { } movieClip 2653 { } movieClip 2655 { } movieClip 2657 { } movieClip 2659 { } movieClip 2661 { } movieClip 2663 { } movieClip 2666 { } movieClip 2668 { } movieClip 2669 { } movieClip 2671 { } movieClip 2673 { } movieClip 2675 { } movieClip 2677 { } movieClip 2679 { } movieClip 2682 { } movieClip 2683 { } movieClip 2685 { } movieClip 2687 { } movieClip 2689 { } movieClip 2691 { } movieClip 2693 { } movieClip 2697 { } movieClip 2699 { } movieClip 2701 { } movieClip 2702 { } movieClip 2704 { } movieClip 2706 { } movieClip 2708 { } movieClip 2710 { } movieClip 2712 { } movieClip 2714 { } movieClip 2716 { } movieClip 2718 { } movieClip 2719 { } movieClip 2721 { } movieClip 2723 { } movieClip 2725 { } movieClip 2727 { } movieClip 2729 { } movieClip 2731 { } movieClip 2733 { } movieClip 2735 { } movieClip 2737 { } movieClip 2739 { } movieClip 2741 { } movieClip 2743 { } movieClip 2745 { } movieClip 2748 { } movieClip 2749 madness_item_portrait { frame 1 { stop(); } } movieClip 2755 { } movieClip 2781 { frame 1 { stop(); } } movieClip 2807 { frame 1 { stop(); } } movieClip 2833 { frame 1 { stop(); } } movieClip 2859 { frame 1 { stop(); } } movieClip 2885 { frame 1 { stop(); } } movieClip 2911 { frame 1 { stop(); } } movieClip 2937 { frame 1 { stop(); } } movieClip 2940 { frame 1 { stop(); } } movieClip 2943 { frame 1 { stop(); } } movieClip 2946 { frame 1 { stop(); } } movieClip 2972 { frame 1 { stop(); } } movieClip 2998 { frame 1 { stop(); } } movieClip 3024 { frame 1 { stop(); } } movieClip 3050 { frame 1 { stop(); } } movieClip 3075 { frame 1 { stop(); } } movieClip 3101 { frame 1 { stop(); } } movieClip 3127 { frame 1 { stop(); } } movieClip 3153 { frame 1 { stop(); } } movieClip 3179 { frame 1 { stop(); } } movieClip 3204 { frame 1 { stop(); } } movieClip 3230 { } movieClip 3256 { } movieClip 3257 Parts - Body { frame 1 { function createWound(inNumber) {} stop(); } } movieClip 3283 { frame 1 { stop(); } } movieClip 3309 { frame 1 { stop(); } } movieClip 3335 { frame 1 { stop(); } } movieClip 3361 { frame 1 { stop(); } } movieClip 3387 { frame 1 { stop(); } } movieClip 3413 { frame 1 { stop(); } } movieClip 3439 { frame 1 { stop(); } } movieClip 3442 { frame 1 { stop(); } } movieClip 3445 { frame 1 { stop(); } } movieClip 3472 { frame 1 { stop(); } } movieClip 3498 { frame 1 { stop(); } } movieClip 3527 { frame 1 { stop(); } } movieClip 3556 { frame 1 { stop(); } } movieClip 3583 { frame 1 { stop(); } } movieClip 3609 { frame 1 { stop(); } } movieClip 3638 { frame 1 { stop(); } } movieClip 3665 { frame 1 { stop(); } } movieClip 3694 { frame 1 { stop(); } } movieClip 3723 { frame 1 { stop(); } } movieClip 3755 { } movieClip 3786 { } movieClip 3812 { frame 1 { stop(); } } movieClip 3813 Parts - Head { frame 1 { function createWound(inNumber) {} } } movieClip 3815 { } movieClip 3817 { } movieClip 3819 { } movieClip 3821 { } movieClip 3823 { } movieClip 3824 { } movieClip 3826 { } movieClip 3828 { } movieClip 3830 { } movieClip 3832 { } movieClip 3834 { } movieClip 3835 { } movieClip 3839 { } movieClip 3841 { } movieClip 3843 { } movieClip 3845 { } movieClip 3847 { } movieClip 3849 { } movieClip 3859 { } movieClip 3873 { } movieClip 3881 { } movieClip 3882 madness_wound { } movieClip 3884 { } movieClip 3886 { } movieClip 3888 { } movieClip 3890 { } movieClip 3891 { } movieClip 3893 { } movieClip 3895 { } movieClip 3897 { } movieClip 3899 { } movieClip 3901 { } movieClip 3902 { } movieClip 3910 { } movieClip 3920 { frame 1 { function tick() { SpeedFrameSkipper.adjustFrames(this, _root.myGameSpeed); } onEnterFrame = tick; } frame 28 { _parent._parent.myCategory = 'sparksdone'; _parent._parent.killMe(); } } movieClip 3928 { frame 1 { function tick() { SpeedFrameSkipper.adjustFrames(this, _root.myGameSpeed); } onEnterFrame = tick; } frame 34 { _parent._parent.myCategory = 'sparksdone'; _parent._parent.killMe(); } } movieClip 3929 { } movieClip 3930 { } movieClip 3932 { } movieClip 3934 { } movieClip 3936 { } movieClip 3937 { } movieClip 3939 { } movieClip 3941 { } movieClip 3943 { } movieClip 3945 { } movieClip 3947 { } movieClip 3949 { } movieClip 3950 { } movieClip 3961 { } movieClip 3987 { } movieClip 3989 { } movieClip 3991 { } movieClip 3993 { } movieClip 3995 { } movieClip 3997 { } movieClip 3999 { } movieClip 4001 { } movieClip 4003 { } movieClip 4005 { } movieClip 4007 { } movieClip 4009 { } movieClip 4011 { } movieClip 4013 { } movieClip 4015 { } movieClip 4017 { } movieClip 4019 { } movieClip 4021 { } movieClip 4023 { } movieClip 4025 { } movieClip 4027 { } movieClip 4030 { } movieClip 4032 { } movieClip 4034 { } movieClip 4036 { } movieClip 4038 { } movieClip 4040 { } movieClip 4042 { } movieClip 4044 { } movieClip 4046 { } movieClip 4047 { } movieClip 4049 { } movieClip 4050 { } movieClip 4051 madness_particle { #initclip Object.registerClass('madness_particle', MadnessParticle); #endinitclip } movieClip 4053 { } movieClip 4055 { } movieClip 4057 { } movieClip 4059 { } movieClip 4061 { } movieClip 4063 { } movieClip 4065 { } movieClip 4067 { } movieClip 4068 madness_splat { } movieClip 4069 { } movieClip 4070 { } movieClip 4071 { } movieClip 4072 { } movieClip 4073 { } movieClip 4107 { } movieClip 4108 { } movieClip 4111 { } movieClip 4113 { } movieClip 4115 { } movieClip 4117 { } movieClip 4119 { } movieClip 4121 { } movieClip 4123 { } movieClip 4125 { } movieClip 4127 { } movieClip 4128 { } button 4132 { on (release) { pressMenu(); } on (rollOver) { SwainAudioPlayer.playSound('menu2', 0); } } button 4134 { on (press) { pickStage(0, 0); } on (rollOver) { buttonRollOver(0, true); } on (rollOut) { buttonRollOver(0, false); } } button 4135 { on (press) { pickStage(0, 1); } on (rollOver) { buttonRollOver(1, true); } on (rollOut) { buttonRollOver(1, false); } } button 4136 { on (press) { pickStage(0, 2); } on (rollOver) { buttonRollOver(2, true); } on (rollOut) { buttonRollOver(2, false); } } button 4137 { on (press) { pickStage(0, 3); } on (rollOver) { buttonRollOver(3, true); } on (rollOut) { buttonRollOver(3, false); } } button 4138 { on (press) { pickStage(0, 4); } on (rollOver) { buttonRollOver(4, true); } on (rollOut) { buttonRollOver(4, false); } } button 4139 { on (press) { pickStage(0, 5); } on (rollOver) { buttonRollOver(5, true); } on (rollOut) { buttonRollOver(5, false); } } button 4140 { on (press) { pickStage(0, 6); } on (rollOver) { buttonRollOver(6, true); } on (rollOut) { buttonRollOver(6, false); } } button 4141 { on (press) { pickStage(0, 7); } on (rollOver) { buttonRollOver(7, true); } on (rollOut) { buttonRollOver(7, false); } } movieClip 4145 { } button 4146 { on (release) { cheatOpenAll(); } } movieClip 4150 { } movieClip 4151 { } movieClip 4155 { } movieClip 4160 { frame 1 { var randomWords = ['KILL', 'DESTROY', 'OBEY', 'ELIMINATE', 'OVERCOME', 'TRAITOR', 'NEXUS', 'FOOLISH', 'SURVIVE', 'ANNIHILATE', 'MADNESS']; var thisWord = randomWords[SwainMath.randomNumber(0, randomWords.length - 1)]; } } movieClip 4161 world_map { #initclip Object.registerClass('world_map', MadnessWorldMap); #endinitclip } movieClip 4163 { frame 1 { _visible = false; } } movieClip 4165 start_point { } movieClip 4167 { frame 1 { _visible = false; } } movieClip 4169 { frame 1 { _visible = false; } } movieClip 4171 { } movieClip 4173 { frame 1 { _visible = false; } } movieClip 4176 { frame 1 { function tick() { SpeedFrameSkipper.adjustFrames(this, _root.myGameSpeed); } onEnterFrame = tick; } } movieClip 4178 { } movieClip 4180 { } movieClip 4181 { } movieClip 4183 { } movieClip 4184 { } movieClip 4186 { } movieClip 4189 { } movieClip 4191 { } movieClip 4192 { } // unknown tag 88 length 67 movieClip 4196 { frame 1 { _visible = false; } } movieClip 4198 { } movieClip 4200 { } movieClip 4202 { } movieClip 4204 { } movieClip 4205 { } movieClip 4208 { frame 1 { _visible = false; } } movieClip 4209 { } movieClip 4212 { } movieClip 4213 { } movieClip 4218 { } movieClip 4219 { } movieClip 4220 { } movieClip 4223 { } movieClip 4224 { } movieClip 4227 { } movieClip 4228 { } movieClip 4230 { } movieClip 4232 { } movieClip 4234 { } movieClip 4236 { } movieClip 4238 { } movieClip 4240 { } movieClip 4242 { } movieClip 4244 { } movieClip 4246 { } movieClip 4248 { } movieClip 4251 { } movieClip 4254 { frame 1 { _visible = false; } } movieClip 4256 { frame 1 { _visible = false; } } movieClip 4260 { } movieClip 4262 { } movieClip 4263 { } movieClip 4265 { } movieClip 4267 { } movieClip 4269 { } movieClip 4271 { } movieClip 4273 { } movieClip 4275 { } movieClip 4277 { } movieClip 4279 { } movieClip 4281 { } movieClip 4283 { } movieClip 4285 { } movieClip 4287 { } movieClip 4289 { } movieClip 4292 { } movieClip 4293 { } movieClip 4295 { } movieClip 4297 { } movieClip 4299 { } movieClip 4301 { } movieClip 4303 { } movieClip 4305 { } movieClip 4307 { } movieClip 4309 { } movieClip 4311 { } movieClip 4313 { } movieClip 4315 { } movieClip 4318 { } movieClip 4319 { } movieClip 4321 { } movieClip 4324 { } movieClip 4325 { } movieClip 4327 { } movieClip 4329 { } movieClip 4332 { } movieClip 4333 { } movieClip 4335 { } movieClip 4337 { } movieClip 4339 { } movieClip 4341 { } movieClip 4343 { } movieClip 4345 { } movieClip 4347 { } movieClip 4349 { } movieClip 4351 { } movieClip 4353 { } movieClip 4355 { } movieClip 4357 { } movieClip 4359 { } movieClip 4361 { } movieClip 4363 { } movieClip 4365 { } movieClip 4367 { } movieClip 4369 { } movieClip 4371 { } movieClip 4373 { } movieClip 4375 { } movieClip 4377 { } movieClip 4379 { } movieClip 4381 { } movieClip 4383 { } movieClip 4386 { } movieClip 4389 { } movieClip 4390 { } movieClip 4392 { } movieClip 4395 { } movieClip 4397 { } movieClip 4399 { } movieClip 4401 { } movieClip 4403 { } movieClip 4405 { } movieClip 4407 { } movieClip 4409 { } movieClip 4411 { } movieClip 4413 { } movieClip 4415 { } movieClip 4417 { } movieClip 4419 { } movieClip 4421 { } movieClip 4423 { } movieClip 4426 { } movieClip 4427 { } movieClip 4430 { } movieClip 4431 { } movieClip 4433 { } movieClip 4435 { } movieClip 4437 { } movieClip 4440 { } movieClip 4441 { } movieClip 4443 { } movieClip 4445 { } movieClip 4447 { } movieClip 4449 { } movieClip 4451 { } movieClip 4454 { } movieClip 4455 { } movieClip 4456 { } movieClip 4459 { } movieClip 4460 { } movieClip 4462 { } movieClip 4465 { } movieClip 4467 { } movieClip 4469 { } movieClip 4471 { } movieClip 4474 { } movieClip 4476 { } movieClip 4478 { } movieClip 4480 { } movieClip 4483 { } movieClip 4485 { } movieClip 4486 { } movieClip 4489 { } movieClip 4491 { } movieClip 4492 { } movieClip 4495 { } movieClip 4497 { } movieClip 4499 { } movieClip 4501 { } movieClip 4503 { } movieClip 4507 { } movieClip 4508 { } movieClip 4509 { frame 1 { function tick() { SpeedFrameSkipper.adjustFrames(this, _root.myGameSpeed); } onEnterFrame = tick; } } movieClip 4512 { } movieClip 4514 { } movieClip 4516 { } movieClip 4517 { } movieClip 4521 madness_world { #initclip Object.registerClass('madness_world', MadWorld); #endinitclip } movieClip 4536 death_glitch { frame 8 { var randomWords = ['NO', 'GET UP', 'GET UP!', 'YOU CANNOT DIE', 'STAND', 'LIVE', 'DON\'T WANT', 'GO AWAY', 'BE GONE', 'LEAVE ME ALONE']; var thisWord = randomWords[SwainMath.randomNumber(0, randomWords.length - 1)]; gotoAndPlay('loop' + SwainMath.randomNumber(1, 3)); } frame 11 { SwainAudioPlayer.playSound('static', 0); } frame 24 { gotoAndPlay('done'); } frame 26 { SwainAudioPlayer.playSound('static', 0); } frame 42 { gotoAndPlay('done'); } frame 44 { SwainAudioPlayer.playSound('static', 0); } frame 59 { gotoAndPlay('done'); } frame 64 { SwainAudioPlayer.stopSound('static'); } } movieClip 4553 madness_transition { #initclip Object.registerClass('madness_transition', MadnessTransition); #endinitclip frame 8 { myPhase = 1; } frame 24 { completeTransition(); } frame 37 { myPhase = 1; } frame 46 { completeTransition(); } frame 51 { SwainAudioPlayer.playSound('static', 0); } frame 54 { SwainAudioPlayer.stopSound('static'); } frame 60 { SwainAudioPlayer.playSound('static', 0); } frame 65 { SwainAudioPlayer.stopSound('static'); } frame 67 { SwainAudioPlayer.playSound('static', 0); } frame 69 { SwainAudioPlayer.stopSound('static'); } frame 78 { SwainAudioPlayer.playSound('static', 0); } frame 122 { SwainAudioPlayer.stopSound('static'); myPhase = 1; } frame 138 { completeTransition(); } frame 147 { myPhase = 1; } frame 162 { completeTransition(); } } movieClip 4559 madness_store_items { #initclip Object.registerClass('madness_store_items', MadnessStoreItems); #endinitclip } movieClip 4563 { } movieClip 4566 { } // unknown tag 88 length 110 movieClip 4574 { } movieClip 4575 { } movieClip 4578 { } movieClip 4580 { } movieClip 4581 { } movieClip 4585 { frame 1 { stop(); mouseChildren = false; } } movieClip 4591 { frame 1 { function setListItems(listItems) { if (!listItems) { _listItems = []; } else { _listItems = listItems.concat(); } var v1 = 0; while (v1 < _listItems.length) { if (typeof _listItems[v1] == 'string') { _listItems[v1] = {'label': _listItems[v1], 'data': _listItems[v1]}; } ++v1; } setSelectedIndex(0); } function setSelectedItem(data) { var v1 = 0; while (v1 < _listItems.length) { if (_listItems[v1].data == data) { setSelectedIndex(v1); return undefined; } ++v1; } } function setSelectedIndex(i) { if (i < _listItems.length) { _selectedItem = _listItems[i]; if (currentItem && currentItem.label) { currentItem.label.text = _selectedItem.label; } } } function hideList() { _listDown = false; gotoAndStop('sortUP'); } function _onListClick() { _listDown = !_listDown; if (_listDown) { gotoAndStop('sortDOWN'); } else { gotoAndStop('sortUP'); } } stop(); if (listButton) { listButton.onRelease = _onListClick; } if (currentItem) { currentItem.onRelease = _onListClick; if (currentItem.label) { if (_selectedItem) { currentItem.label.text = _selectedItem.label; } else { currentItem.label.text = ''; } } } var _listItems; var _listDown; var _selectedItem; if (!_listItems) { _listItems = []; } } frame 10 { function _onItemClick() { var v3 = MovieClip(this); if (v3.item) { setSelectedItem(v3.item.data); } if (v3 && _parent && _parent instanceof MovieClip && (MovieClip(_parent))._onListChange) { (MovieClip(_parent))._onListChange(v3.item); } } var i = 0; var itemClip = item0; while (itemClip) { if (i < _listItems.length) { itemClip.item = _listItems[i]; itemClip.label.text = _listItems[i].label; itemClip.onRelease = _onItemClick; } else { itemClip._visible = false; } ++i; itemClip = this['item' + i]; } } } movieClip 4602 { frame 1 { stop(); mouseChildren = false; } } movieClip 4603 { } movieClip 4605 { } movieClip 4612 ScoreBrowser { frame 1 { function loadScores() { if (_scoreBoard) { _scoreBoard.removeEventListener(com.newgrounds.APIEvent.SCORES_LOADED, _onScoresLoaded); } _scoreBoard = com.newgrounds.API.getScoreBoard(scoreBoardName); if (!_scoreBoard) { if (!(com.newgrounds.API.__get__scoreBoards())[0]) { com.newgrounds.Logger.logError('No scoreboards created for this movie. You can create scoreboards on your API Settings page at http://www.newgrounds.com/account/flashapi'); gotoAndPlay('error'); return undefined; } else { _scoreBoard = (com.newgrounds.API.__get__scoreBoards())[0]; scoreBoardName = _scoreBoard.name; com.newgrounds.Logger.logWarning('No scoreboard name set in the Score Browser component. Defaulting to scoreboard "' + _scoreBoard.__get__name() + '".'); } } _scoreBoard.addEventListener(com.newgrounds.APIEvent.SCORES_LOADED, _onScoresLoaded); _scoreBoard.__set__numResults(_numScores); _scoreBoard.__set__period(period); if (pageText) { pageText.text = 'Page ' + _scoreBoard.__get__page(); } _loading = true; if (listBox) { listBox.mouseChildren = false; listBox.hideList(); } gotoAndStop('loading'); _scoreBoard.loadScores(); } function _onScoresLoaded(event) { _loading = false; if (listBox) { listBox.mouseChildren = true; } if (event.__get__success()) { gotoAndStop('scores'); } else { gotoAndPlay('error'); } } function _onPageClick() { var v2 = this; if (_scoreBoard && !_loading) { if (v2 == prevButton) { _scoreBoard.prevPage(); } else { _scoreBoard.nextPage(); } loadScores(); } } function _onListChange(selection) { period = selection.data; loadScores(); } var title; var scoreBoardName; var period; if (!title) { title = 'High Scores'; } if (!period) { period = com.newgrounds.ScoreBoard.ALL_TIME; } var _scoreBoard; var _loading; var _numScores = 10; var _listItems = [com.newgrounds.ScoreBoard.TODAY, com.newgrounds.ScoreBoard.THIS_WEEK, com.newgrounds.ScoreBoard.THIS_MONTH, com.newgrounds.ScoreBoard.THIS_YEAR, com.newgrounds.ScoreBoard.ALL_TIME]; _x = int(_x); _y = int(_y); if (titleText) { titleText.text = title; } if (prevButton) { prevButton.onRelease = _onPageClick; } if (nextButton) { nextButton.onRelease = _onPageClick; } gotoAndPlay('error'); loadScores(); } frame 2 { if (listBox) { listBox.setListItems(_listItems); listBox.setSelectedItem(period); } } frame 11 { function onScoreClick() { var v3 = MovieClip(this); if (v3.usernameText) { _root.getURL('http://' + v3.usernameText.text + '.newgrounds.com', '_blank'); } } var i = 0; var scoreClip = scoreContainer.score0; while (scoreClip) { var score = com.newgrounds.Score(_scoreBoard.scores[i]); if (score) { if (scoreClip.rankText) { scoreClip.rankText.text = (score.__get__rank()).toString(); } if (scoreClip.usernameText) { scoreClip.usernameText.text = score.username; } if (scoreClip.scoreText) { scoreClip.scoreText.text = score.score; } scoreClip.onRelease = onScoreClick; } else { if (scoreClip.rankText) { scoreClip.rankText.text = ''; } if (scoreClip.usernameText) { scoreClip.usernameText.text = ''; } if (scoreClip.scoreText) { scoreClip.scoreText.text = ''; } scoreClip.enabled = false; } ++i; scoreClip = scoreContainer['score' + i]; } } frame 21 { function onReloadClick() { loadScores(); } if (reloadButton) { reloadButton.onRelease = onReloadClick; } } frame 30 { stop(); } } button 4613 { on (release) { pressDone(); } on (rollOver) { SwainAudioPlayer.playSound('menu2', 0); } } button 4624 { on (release) { pressDone(); } } movieClip 4625 madness_character_creator { #initclip Object.registerClass('madness_character_creator', MadnessCharacterCreator); #endinitclip frame 1 { stop(); } instance scores1 of movieClip 4612 ScoreBrowser { onClipEvent (construct) { scoreBoardName = 'Total Kills'; period = 'Today'; title = 'Total Kills'; } } instance scores2 of movieClip 4612 ScoreBrowser { onClipEvent (construct) { scoreBoardName = 'Highest Wave'; period = 'Today'; title = 'Highest Waves'; } } } movieClip 4628 { } movieClip 4634 { } movieClip 4638 { } movieClip 4640 { } movieClip 4642 { } movieClip 4643 { } movieClip 4644 { } button 4649 { on (release) { pressStory(); } on (rollOver) { SwainAudioPlayer.playSound('menu2', 0); } } button 4654 { on (release) { pressArena(); } on (rollOver) { SwainAudioPlayer.playSound('menu2', 0); } } button 4658 { on (release) { pressOptions(); } on (rollOver) { SwainAudioPlayer.playSound('menu2', 0); } } movieClip 4661 { frame 7 { stop(); } } button 4669 { on (press) { getURL('http://www.theswain.com', '_blank'); } } button 4673 { on (press) { getURL('http://www.krinkels.net', '_blank'); } } button 4677 { on (press) { getURL('http:// cheshyre.newgrounds.com', '_blank'); } } button 4681 { on (press) { getURL('http://www.newgrounds.com/games', ''); } } movieClip 4689 { } movieClip 4697 { frame 35 { stop(); } } movieClip 4698 { } movieClip 4704 { } button 4705 { on (release) { pressNew(); } on (rollOver) { SwainAudioPlayer.playSound('menu2', 0); } } button 4708 { on (release) { pressContinue(); } on (rollOver) { SwainAudioPlayer.playSound('menu2', 0); } } button 4712 { on (release) { pressMoarMadness(); } on (rollOver) { SwainAudioPlayer.playSound('menu2', 0); } } button 4726 { on (release) { pressQuality('HIGH'); } on (rollOver) { SwainAudioPlayer.playSound('menu2', 0); } } button 4730 { on (release) { pressQuality('MEDIUM'); } on (rollOver) { SwainAudioPlayer.playSound('menu2', 0); } } button 4734 { on (release) { pressQuality('LOW'); } on (rollOver) { SwainAudioPlayer.playSound('menu2', 0); } } movieClip 4738 madness_game_select { #initclip Object.registerClass('madness_game_select', MadnessGameSelect); #endinitclip frame 13 { SwainAudioPlayer.playSound('menu5', 0); } instance charIcon of movieClip 4644 { onClipEvent (load) { _parent.assignRandomCharacter(); } } frame 26 { stop(); } } button 4740 { on (release) { _parent.pressContinue(); } } button 4742 { on (release) { _parent.pressNew(); } } movieClip 4745 game_panel_story { } movieClip 4747 game_panel_arena { } movieClip 4750 game_ticker_spot { } movieClip 4752 game_panel_options { } frame 16 { var currentStart; var playerCash; var earnedXP = new Number(); var earnedCash = new Number(); var pulseTimer = attachMovie('pulse_timer', 'pulseTimer', getNextHighestDepth()); } frame 19 { function pickCutscene() {} function pickMenu() { exitAll(); createMainMenu(); } function pickMap() { exitAll(); createWorldMap(); } function pickStore() { exitAll(); createHireStore(); } function pickItems(inEquip) { exitWorldMap(); exitHireStore(); exitItemStore(); if (!inEquip) { exitTeamSetup(); } exitMainMenu(); createItemStore(); } function pickTeam() { exitAll(); createTeamSetup(); } function pickCreate() { exitAll(); createNewGuy(); } function exitAll() { exitWorldMap(); exitHireStore(); exitItemStore(); exitTeamSetup(); exitMainMenu(); exitNewGuy(); } function createRoom() { var v1 = attachMovie('madness_world', 'newWorld', getNextHighestDepth()); v1.init(currentStart); v1.swapDepths(gameMenu); } function removeRoom() { newWorld.removeMovieClip(); _root.mcScreenCap.removeMovieClip(); delete newWorld; } function createMainMenu() { var v1 = attachMovie('madness_game_select', 'gameSelect', getNextHighestDepth()); v1.init(); } function exitMainMenu() { gameSelect.removeMovieClip(); delete gameSelect; } function createMicroMenu(inGameMode) { var menuBar = attachMovie('madness_menu_top_bar', 'menuBar', getNextHighestDepth()); menuBar.gotoAndStop(MadnessGameSelect.gameMode); menuBar.onEnterFrame = function () { menuBar.myCashTEXT.text = '$' + String(Math.floor(MadnessRoster.playerRoster.myCash)); }; } function createGameMenu() { var v1 = attachMovie('madness_game_menu', 'gameMenu', getNextHighestDepth()); v1.init(); } function removeMicroMenu() { menuBar.removeMovieClip(); delete menuBar; } function removeGameMenu() { gameMenu.removeMovieClip(); delete gameMenu; } function createTransition(inTrans, inAction, inObj) { if (!MadnessTransition.transitionLock) { var v1 = attachMovie('madness_transition', 'newTransition', getNextHighestDepth()); v1.init(inTrans, inAction, inObj); } } function createWorldMap() { var v1 = attachMovie('world_map', 'worldMap', getNextHighestDepth()); v1.init(); v1.swapDepths(menuBar); } function exitWorldMap() { worldMap.removeMovieClip(); delete worldMap; } function generateLevel(inWorld, inLevel) { var v1 = new MadnessLevel(); v1.generateLevel(inWorld, inLevel); } function generateArena(inStartWave) { var v1 = new MadnessLevel(); v1.generateArena(inStartWave); } function createHireStore() { var v1 = attachMovie('madness_store_hire', 'storeHire', getNextHighestDepth()); v1.init(); v1.swapDepths(menuBar); } function exitHireStore() { storeHire.removeMovieClip(); delete storeHire; } function createItemStore() { var v1 = attachMovie('madness_store_items', 'storeItem', getNextHighestDepth()); v1.init(); v1.swapDepths(menuBar); } function exitItemStore() { storeItem.removeMovieClip(); delete storeItem; } function createTeamSetup() { var v1 = attachMovie('madness_team_setup', 'teamSetup', getNextHighestDepth()); v1.init2(); v1.swapDepths(menuBar); } function exitTeamSetup() { teamSetup.removeMovieClip(); delete teamSetup; } function createNewGuy() { var v1 = attachMovie('madness_character_creator', 'createCharacter', getNextHighestDepth()); v1.init(); } function exitNewGuy() { createCharacter.removeMovieClip(); delete createCharacter; } function selectRosterCharacter(inChar) { playerRoster.myMembers = new Array(); playerRoster.addCharacter(inChar.myDataRef); _root.playerWeaponChoice = ''; } function createCutscene() { var v1 = attachMovie('madness_cutscene', 'newCutscene', getNextHighestDepth()); v1.init(); } function cutsceneDone() { newCutscene.removeMovieClip(); delete newCutscene; } stop(); pickMenu(); } frame 29 { exitHireStore(); } button 4753 { on (press) { _root.playerWeaponChoice = '97k'; _root.silencer = false; } } button 4754 { on (press) { _root.playerWeaponChoice = 'ar15'; _root.silencer = false; } } button 4755 { on (press) { _root.playerWeaponChoice = 'm16'; _root.silencer = false; } } button 4756 { on (press) { _root.playerWeaponChoice = 'ak74'; _root.silencer = false; } } button 4757 { on (press) { _root.playerWeaponChoice = 'sr3'; _root.silencer = false; } } button 4758 { on (press) { _root.playerWeaponChoice = 'ppk'; _root.silencer = false; } } button 4759 { on (press) { _root.playerWeaponChoice = 'glock20'; _root.silencer = false; } } button 4760 { on (press) { _root.playerWeaponChoice = 'beretta'; _root.silencer = false; } } button 4761 { on (press) { _root.playerWeaponChoice = 'prokiller460'; _root.silencer = false; } } button 4762 { on (press) { _root.playerWeaponChoice = 'deagle'; _root.silencer = false; } } button 4763 { on (press) { _root.playerWeaponChoice = '357'; _root.silencer = false; } } button 4764 { on (press) { _root.playerWeaponChoice = '500'; _root.silencer = false; } } button 4765 { on (press) { _root.playerWeaponChoice = '500snub'; _root.silencer = false; } } button 4766 { on (press) { _root.playerWeaponChoice = 'tmp'; _root.silencer = false; } } button 4767 { on (press) { _root.playerWeaponChoice = 'mp5k'; _root.playerWeaponSilencer = false; } } button 4768 { on (press) { _root.playerWeaponChoice = 'mp5'; _root.silencer = false; } } button 4769 { on (press) { _root.playerWeaponChoice = 'pm9'; _root.silencer = false; } } button 4770 { on (press) { _root.playerWeaponChoice = 'mp7'; _root.silencer = false; } } button 4771 { on (press) { _root.playerWeaponChoice = 'hk2'; _root.silencer = false; } } button 4772 { on (press) { _root.playerWeaponChoice = 'oa93'; _root.silencer = false; } } button 4773 { on (press) { _root.playerWeaponChoice = 'spas12'; _root.silencer = false; } } button 4774 { on (press) { _root.playerWeaponChoice = 'aug'; _root.silencer = false; } } button 4775 { on (press) { _root.playerWeaponChoice = 'ak74u'; _root.silencer = false; } } button 4776 { on (press) { _root.playerWeaponChoice = '357snub'; _root.silencer = false; } } button 4777 { on (press) { _root.playerWeaponChoice = 'hk416'; _root.silencer = false; } } button 4778 { on (press) { _root.playerWeaponChoice = 'fnfal'; _root.silencer = false; } } button 4779 { on (press) { _root.playerWeaponChoice = 'm249'; _root.silencer = false; } } button 4780 { on (press) { _root.playerWeaponChoice = 'chaingun'; _root.silencer = false; } } button 4781 { on (press) { _root.playerWeaponChoice = 'usas12'; _root.silencer = false; } } button 4782 { on (press) { _root.playerWeaponChoice = 'tmp'; _root.silencer = true; } } button 4783 { on (press) { _root.playerWeaponChoice = 'mp5k'; _root.playerWeaponSilencer = true; } } button 4784 { on (press) { _root.playerWeaponChoice = 'mp5'; _root.silencer = true; } } button 4785 { on (press) { _root.playerWeaponChoice = 'pm9'; _root.silencer = true; } } button 4786 { on (press) { _root.playerWeaponChoice = 'mp7'; _root.silencer = true; } } button 4787 { on (press) { _root.playerWeaponChoice = 'hk2'; _root.silencer = true; } } button 4788 { on (press) { _root.playerWeaponChoice = 'oa93'; _root.silencer = true; } } button 4789 { on (press) { _root.playerWeaponChoice = 'ppk'; _root.silencer = true; } } button 4790 { on (press) { _root.playerWeaponChoice = 'glock20'; _root.silencer = true; } } button 4791 { on (press) { _root.playerWeaponChoice = 'beretta'; _root.silencer = true; } } button 4792 { on (press) { _root.playerWeaponChoice = 'prokiller460'; _root.silencer = true; } } button 4793 { on (press) { _root.playerWeaponChoice = 'famas'; _root.silencer = false; } } button 4796 { on (press) { _root.gotoAndStop('roster'); } } button 4797 { on (press) { _root.gotoAndStop('store'); } } button 4798 { on (press) { _root.gotoAndStop('map'); } } movieClip 4802 { } button 4804 { on (press) { _root.gotoAndStop('store2'); } }




http://swfchan.com/42/208560/info.shtml
Created: 13/6 -2022 16:44:25 Last modified: 13/6 -2022 16:44:25 Server time: 05/05 -2024 14:26:49