Section 1
//BallsXML (config.BallsXML)
package config {
public class BallsXML {
public static var BALLS:XML = <balls>
<ball index="0" type="CannonStone" radius="0.5" rotate="true" damage="15" dispersion="2" ttl="15.0" load_size="40,40" display_name="Stone Cannon Balls" info="Damage: Low|When you have no money you have to shoot with what you've got.|Bad grouping of shots and low damage." price="0" max_buy="200" player_hit_effect="shiphit.eff" enemy_hit_effect="enemyshiphit.eff" shot_sound="out_justball.aif" deflect_sound="hitcannonball.aif" passby_sound="ballfly.aif"/>
<ball index="1" type="CannonBall" radius="0.5" player_hit_effect="shiphit.eff" enemy_hit_effect="enemyshiphit.eff" shot_sound="out_justball.aif" deflect_sound="hitcannonball.aif" passby_sound="ballfly.aif" damage="35" load_size="40,40" display_name="Cannon Balls" info="Damage: Normal|Black iron cannon ball with round shape. Choice for most pirates." price="1" max_buy="200"/>
<ball index="2" type="CannonMonkey" radius="2" damage="5" load_size="128,128" rob="true" display_name="Banzai-Monkey" info="Damage: None|Rob enemies of some gold and repair points. Good round to make some extra cash." price="10" sort_key="1" max_buy="50" player_hit_effect="shiphit.eff" player_hit_sound="monkeyAlarm.aif" enemy_hit_sound="hit_monkey.aif" additional_effect="monkeyCapture.eff" shot_sound="out_monkey.aif" deflect_sound="beat_monkey.aif" passby_sound="in_monkey.aif"/>
<ball index="3" type="CannonRum" radius="0.5" rotate="true" damage="0" load_size="60,60" display_name="Rum Barrel" info="Damage: None|Slows down enemy and disables enemy's cannons for a while." price="1" disable_cannons="true" max_buy="100" need_level="1" player_hit_effect="shiphit.eff" enemy_hit_effect="enemyshiphit.eff" enemy_hit_sound="enemyshipdrunk.aif" additional_effect="enemyshipdrunk.eff" shot_sound="out_rum.aif" deflect_sound="hitcannonball.aif" passby_sound="ballfly.aif"/>
<ball index="4" type="CannonKnippel" radius="0.8" rotate="true" damage="35" load_size="40,40" display_name="Chain Shot" info="Damage: Normal|Slowdowns enemy's ship by damaging it's sails." price="2" slowdown="true" need_level="3" max_buy="200" player_hit_effect="shiphit.eff" enemy_hit_effect="enemyshiphit.eff" enemy_hit_sound="hit_knippel.aif" shot_sound="out_knippel.aif" deflect_sound="hitcannonball.aif" passby_sound="ballfly.aif"/>
<ball index="5" type="CannonPiercing" radius="0.5" rotate="true" pass_through="true" gravity_mul="1.0" damage="35" load_size="50,50" display_name="Piercing Balls" info="Damage: Normal|Goes through all of the ships in its path. Effective against a large group of enemies." price="2" need_level="5" max_buy="200" player_hit_effect="shiphit.eff" enemy_hit_effect="enemyshiphit.eff" shot_sound="out_piercing.aif" deflect_sound="hitcannonball.aif" passby_sound="ballfly.aif"/>
<ball index="6" type="CannonBomb" radius="0.5" rotate="true" damage="50" damage_radius="20.0" load_size="40,40" display_name="Bomb Balls" info="Damage: High|High Damage and splash radius makes this round an excellent choice for those who want to increase fire power of his ship." price="5" need_level="7" max_buy="100" player_hit_effect="explosion.eff" player_hit_sound="hit_bomb.aif" enemy_hit_effect="enemyexplosion.eff" enemy_hit_sound="hit_bomb.aif" shot_sound="out_bomb.aif" deflect_sound="hitcannonball.aif" passby_sound="ballfly.aif"/>
<ball index="7" type="CannonFlame" radius="0.8" rotate="true" damage="10" load_size="40,40" display_name="Fire Balls" info="Damage: Permanent|Sets fire on enemies' ships permanently. Fire constantly damaging enemy's ship." price="20" fire_damage="true" need_level="8" max_buy="100" player_hit_effect="shiphit.eff" enemy_hit_effect="enemyshiphit.eff" enemy_hit_sound="hit_flame.aif" additional_effect="enemyshipfire.eff,shipfire.eff" shot_sound="out_flame.aif" deflect_sound="beat_flame.aif" passby_sound="in_flame.aif"/>
<ball index="8" type="CannonMine" radius="1.0" rotate="true" damage="100" damage_radius="20.0" is_mine="true" mine_radius="2.0" mine_detect_radius="1.5" load_size="50,50" display_name="Mine" info="Damage: Huge|When enemy ship sails into it, it explodes with a splash and causing huge damage." price="5" need_level="10" max_buy="100" player_hit_effect="shiphit.eff" enemy_hit_effect="enemyshiphit.eff" shot_sound="out_mine.aif" deflect_sound="hit_mine.aif" passby_sound="ballfly.aif"/>
<ball index="9" type="CannonShrapnel" radius="0.5" damage="9" dispersion="5" shot_count="11" load_size="40,40" display_name="Shrapnel" info="Damage: High|Shoots a cloud of small rounds. Causing high damage to ships in the near distances and gives a high probability of hitting a ship in the far distance." price="5" need_level="12" effect_scale="0.1" max_buy="100" player_hit_effect="shiphit.eff" enemy_hit_effect="enemyshiphit.eff" shot_sound="out_shrapnel.aif" deflect_sound="hitcannonball.aif" passby_sound="ballfly.aif"/>
<ball index="10" type="CannonOctopus" radius="0.5" damage="0" load_size="60,60" octopus_lure="true" display_name="Kraken Lure" info="Damage: Extra Huge|With high probability of luring Kraken on to an enemy. Doesn’t work with submarines." price="20" need_level="15" max_buy="50" enemy_hit_sound="hit_octopus.aif" additional_effect="octopuslure.eff,octopus.eff" shot_sound="out_justball.aif"/>
</balls>
;
}
}//package config
Section 2
//CannonsXML (config.CannonsXML)
package config {
public class CannonsXML {
public static var CANNONS:XML = <cannons>
<cannon index="0" charge_time="1" shot_delay="0.2" icon="cannon_first_icon.png" display_name="Rough Cannon" info="Charge: slow |Durability: Low |Need Ship Level: 1 |Low-quality cannon. Low durability and slow charging." price="300" num_shots="300" repair_price="100">
<position>
<pos x="11" y="180"/>
<pos x="120" y="180"/>
<pos x="235" y="180"/>
<pos x="344" y="180"/>
</position>
</cannon>
<cannon index="1" charge_time="0.7" shot_delay="0.2" allow_disp="false" icon="cannon_01_icon.png" display_name="Basic Cannon" info="Charge: normal|Durability: normal|Need Ship Level: 2|Good quality cannon. This cannon can shoot stones straight." price="500" num_shots="400" repair_price="150" need_level="1">
<position>
<pos x="7" y="180"/>
<pos x="116" y="180"/>
<pos x="232" y="180"/>
<pos x="342" y="180"/>
</position>
</cannon>
<cannon index="2" charge_time="0.5" shot_delay="0.2" icon="cannon_fast_icon.png" display_name="Fast Cannon" info="Charge: Fast|Durability: High|Need Ship Level: 3|Fast charge is a main advantage of this cannon. Also it has improved reliability." price="1500" num_shots="600" repair_price="225" need_level="2">
<position>
<pos x="9" y="180"/>
<pos x="119" y="180"/>
<pos x="234" y="180"/>
<pos x="344" y="180"/>
</position>
</cannon>
<cannon index="3" charge_time="0.5" shot_delay="0.2" max_cballs="3" icon="cannon_03_icon.png" display_name="Tripple Cannon" info="Charge: Fast |Durability: High|Need Ship Level: 3|Cannon shoots three cannon round sets at once. With this cannon's firepower your ship will become truly dangerous." price="5000" num_shots="1600" repair_price="500" need_level="2">
<position>
<pos x="10" y="180"/>
<pos x="120" y="180"/>
<pos x="234" y="180"/>
<pos x="344" y="180"/>
</position>
</cannon>
</cannons>
;
}
}//package config
Section 3
//FontsXML (config.FontsXML)
package config {
public class FontsXML {
public static var FONTS:XML = <fonts>
<font name="Parisian_black">
<info face="Parisian_black" size="48" bold="1" italic="0" charset="ANSI" unicode="0" stretchH="100" smooth="1" aa="1" padding="4,4,4,4" spacing="0,0" outline="0" common_lineHeight="48" base="37" scaleW="512" scaleH="256" pages="1" packed="0" alphaChnl="0" redChnl="0" greenChnl="0" blueChnl="0" page_id="0" file="Parisian_black.png" chars_count="126"/>
<char id="32" x="212" y="206" width="9" height="9" xoffset="-4" yoffset="33" xadvance="12" page="0" chnl="15"/>
<char id="33" x="492" y="42" width="16" height="38" xoffset="-3" yoffset="3" xadvance="10" page="0" chnl="15"/>
<char id="34" x="471" y="179" width="17" height="14" xoffset="-3" yoffset="4" xadvance="12" page="0" chnl="15"/>
<char id="35" x="357" y="118" width="28" height="34" xoffset="-3" yoffset="7" xadvance="22" page="0" chnl="15"/>
<char id="36" x="126" y="158" width="26" height="31" xoffset="-4" yoffset="10" xadvance="19" page="0" chnl="15"/>
<char id="37" x="385" y="118" width="27" height="34" xoffset="-3" yoffset="7" xadvance="22" page="0" chnl="15"/>
<char id="38" x="229" y="83" width="35" height="37" xoffset="-3" yoffset="4" xadvance="29" page="0" chnl="15"/>
<char id="39" x="498" y="149" width="14" height="16" xoffset="-3" yoffset="4" xadvance="9" page="0" chnl="15"/>
<char id="40" x="88" y="0" width="18" height="45" xoffset="-4" yoffset="3" xadvance="10" page="0" chnl="15"/>
<char id="41" x="106" y="0" width="17" height="45" xoffset="-3" yoffset="3" xadvance="11" page="0" chnl="15"/>
<char id="42" x="60" y="194" width="24" height="22" xoffset="-4" yoffset="2" xadvance="17" page="0" chnl="15"/>
<char id="43" x="84" y="193" width="23" height="22" xoffset="-3" yoffset="17" xadvance="18" page="0" chnl="15"/>
<char id="44" x="399" y="180" width="15" height="17" xoffset="-3" yoffset="27" xadvance="9" page="0" chnl="15"/>
<char id="45" x="84" y="215" width="19" height="11" xoffset="-3" yoffset="17" xadvance="13" page="0" chnl="15"/>
<char id="46" x="70" y="216" width="14" height="13" xoffset="-3" yoffset="28" xadvance="8" page="0" chnl="15"/>
<char id="47" x="269" y="43" width="30" height="39" xoffset="-4" yoffset="4" xadvance="22" page="0" chnl="15"/>
<char id="48" x="412" y="118" width="27" height="34" xoffset="-3" yoffset="7" xadvance="21" page="0" chnl="15"/>
<char id="49" x="492" y="116" width="16" height="33" xoffset="-3" yoffset="8" xadvance="10" page="0" chnl="15"/>
<char id="50" x="0" y="161" width="25" height="34" xoffset="-3" yoffset="7" xadvance="19" page="0" chnl="15"/>
<char id="51" x="439" y="117" width="27" height="34" xoffset="-4" yoffset="7" xadvance="20" page="0" chnl="15"/>
<char id="52" x="71" y="122" width="32" height="36" xoffset="-4" yoffset="6" xadvance="24" page="0" chnl="15"/>
<char id="53" x="186" y="120" width="27" height="36" xoffset="-3" yoffset="5" xadvance="21" page="0" chnl="15"/>
<char id="54" x="466" y="117" width="26" height="34" xoffset="-3" yoffset="7" xadvance="20" page="0" chnl="15"/>
<char id="55" x="250" y="120" width="26" height="35" xoffset="-4" yoffset="6" xadvance="19" page="0" chnl="15"/>
<char id="56" x="276" y="119" width="26" height="35" xoffset="-3" yoffset="6" xadvance="20" page="0" chnl="15"/>
<char id="57" x="89" y="84" width="27" height="38" xoffset="-3" yoffset="7" xadvance="21" page="0" chnl="15"/>
<char id="58" x="45" y="194" width="15" height="24" xoffset="-3" yoffset="17" xadvance="9" page="0" chnl="15"/>
<char id="59" x="483" y="151" width="15" height="26" xoffset="-3" yoffset="17" xadvance="9" page="0" chnl="15"/>
<char id="60" x="107" y="190" width="23" height="22" xoffset="-3" yoffset="18" xadvance="17" page="0" chnl="15"/>
<char id="61" x="429" y="180" width="24" height="15" xoffset="-3" yoffset="20" xadvance="18" page="0" chnl="15"/>
<char id="62" x="130" y="189" width="23" height="22" xoffset="-3" yoffset="18" xadvance="17" page="0" chnl="15"/>
<char id="63" x="313" y="0" width="26" height="43" xoffset="-3" yoffset="4" xadvance="20" page="0" chnl="15"/>
<char id="64" x="213" y="120" width="37" height="35" xoffset="-3" yoffset="6" xadvance="31" page="0" chnl="15"/>
<char id="65" x="123" y="0" width="37" height="44" xoffset="-4" yoffset="3" xadvance="29" page="0" chnl="15"/>
<char id="66" x="0" y="46" width="34" height="41" xoffset="-4" yoffset="4" xadvance="27" page="0" chnl="15"/>
<char id="67" x="326" y="43" width="35" height="38" xoffset="-4" yoffset="3" xadvance="27" page="0" chnl="15"/>
<char id="68" x="193" y="83" width="36" height="37" xoffset="-5" yoffset="4" xadvance="28" page="0" chnl="15"/>
<char id="69" x="264" y="82" width="34" height="37" xoffset="-3" yoffset="4" xadvance="28" page="0" chnl="15"/>
<char id="70" x="142" y="44" width="33" height="39" xoffset="-5" yoffset="2" xadvance="25" page="0" chnl="15"/>
<char id="71" x="361" y="43" width="34" height="38" xoffset="-5" yoffset="3" xadvance="26" page="0" chnl="15"/>
<char id="72" x="156" y="83" width="37" height="37" xoffset="-5" yoffset="4" xadvance="29" page="0" chnl="15"/>
<char id="73" x="477" y="80" width="15" height="37" xoffset="-3" yoffset="4" xadvance="9" page="0" chnl="15"/>
<char id="74" x="339" y="0" width="20" height="43" xoffset="-7" yoffset="3" xadvance="10" page="0" chnl="15"/>
<char id="75" x="412" y="0" width="34" height="42" xoffset="-4" yoffset="3" xadvance="27" page="0" chnl="15"/>
<char id="76" x="0" y="87" width="31" height="38" xoffset="-4" yoffset="4" xadvance="24" page="0" chnl="15"/>
<char id="77" x="0" y="125" width="38" height="36" xoffset="-3" yoffset="6" xadvance="31" page="0" chnl="15"/>
<char id="78" x="38" y="125" width="33" height="36" xoffset="-4" yoffset="5" xadvance="25" page="0" chnl="15"/>
<char id="79" x="331" y="81" width="32" height="37" xoffset="-3" yoffset="4" xadvance="26" page="0" chnl="15"/>
<char id="80" x="250" y="0" width="32" height="43" xoffset="-3" yoffset="4" xadvance="26" page="0" chnl="15"/>
<char id="81" x="216" y="0" width="34" height="43" xoffset="-4" yoffset="4" xadvance="26" page="0" chnl="15"/>
<char id="82" x="375" y="0" width="37" height="42" xoffset="-4" yoffset="4" xadvance="27" page="0" chnl="15"/>
<char id="83" x="363" y="81" width="31" height="37" xoffset="-3" yoffset="4" xadvance="25" page="0" chnl="15"/>
<char id="84" x="207" y="44" width="32" height="39" xoffset="-4" yoffset="2" xadvance="24" page="0" chnl="15"/>
<char id="85" x="395" y="42" width="33" height="38" xoffset="-4" yoffset="3" xadvance="26" page="0" chnl="15"/>
<char id="86" x="175" y="44" width="32" height="39" xoffset="-3" yoffset="2" xadvance="25" page="0" chnl="15"/>
<char id="87" x="116" y="84" width="40" height="37" xoffset="-4" yoffset="4" xadvance="33" page="0" chnl="15"/>
<char id="88" x="460" y="42" width="32" height="38" xoffset="-4" yoffset="3" xadvance="24" page="0" chnl="15"/>
<char id="89" x="282" y="0" width="31" height="43" xoffset="-3" yoffset="4" xadvance="24" page="0" chnl="15"/>
<char id="90" x="428" y="42" width="32" height="38" xoffset="-4" yoffset="3" xadvance="25" page="0" chnl="15"/>
<char id="91" x="464" y="0" width="18" height="42" xoffset="-3" yoffset="2" xadvance="12" page="0" chnl="15"/>
<char id="92" x="239" y="43" width="30" height="39" xoffset="-4" yoffset="4" xadvance="22" page="0" chnl="15"/>
<char id="93" x="446" y="0" width="18" height="42" xoffset="-3" yoffset="2" xadvance="12" page="0" chnl="15"/>
<char id="94" x="453" y="180" width="18" height="14" xoffset="-3" yoffset="4" xadvance="12" page="0" chnl="15"/>
<char id="95" x="186" y="208" width="26" height="10" xoffset="-4" yoffset="40" xadvance="18" page="0" chnl="15"/>
<char id="96" x="488" y="177" width="17" height="14" xoffset="-1" yoffset="7" xadvance="15" page="0" chnl="15"/>
<char id="97" x="379" y="152" width="27" height="28" xoffset="-3" yoffset="13" xadvance="20" page="0" chnl="15"/>
<char id="98" x="62" y="84" width="27" height="38" xoffset="-3" yoffset="4" xadvance="21" page="0" chnl="15"/>
<char id="99" x="352" y="153" width="27" height="28" xoffset="-3" yoffset="13" xadvance="20" page="0" chnl="15"/>
<char id="100" x="422" y="80" width="28" height="37" xoffset="-4" yoffset="4" xadvance="21" page="0" chnl="15"/>
<char id="101" x="99" y="158" width="27" height="32" xoffset="-4" yoffset="13" xadvance="20" page="0" chnl="15"/>
<char id="102" x="68" y="0" width="20" height="45" xoffset="-4" yoffset="5" xadvance="13" page="0" chnl="15"/>
<char id="103" x="34" y="46" width="28" height="40" xoffset="-3" yoffset="9" xadvance="22" page="0" chnl="15"/>
<char id="104" x="394" y="81" width="28" height="37" xoffset="-4" yoffset="4" xadvance="21" page="0" chnl="15"/>
<char id="105" x="51" y="161" width="15" height="33" xoffset="-3" yoffset="8" xadvance="8" page="0" chnl="15"/>
<char id="106" x="359" y="0" width="16" height="43" xoffset="-4" yoffset="7" xadvance="8" page="0" chnl="15"/>
<char id="107" x="450" y="80" width="27" height="37" xoffset="-3" yoffset="4" xadvance="20" page="0" chnl="15"/>
<char id="108" x="492" y="80" width="15" height="36" xoffset="-3" yoffset="5" xadvance="9" page="0" chnl="15"/>
<char id="109" x="261" y="155" width="35" height="28" xoffset="-4" yoffset="13" xadvance="28" page="0" chnl="15"/>
<char id="110" x="406" y="152" width="27" height="28" xoffset="-4" yoffset="13" xadvance="20" page="0" chnl="15"/>
<char id="111" x="296" y="154" width="29" height="28" xoffset="-4" yoffset="13" xadvance="22" page="0" chnl="15"/>
<char id="112" x="103" y="122" width="28" height="36" xoffset="-4" yoffset="13" xadvance="21" page="0" chnl="15"/>
<char id="113" x="131" y="121" width="28" height="36" xoffset="-3" yoffset="13" xadvance="21" page="0" chnl="15"/>
<char id="114" x="237" y="155" width="24" height="29" xoffset="-4" yoffset="13" xadvance="17" page="0" chnl="15"/>
<char id="115" x="433" y="152" width="25" height="28" xoffset="-3" yoffset="13" xadvance="19" page="0" chnl="15"/>
<char id="116" x="302" y="119" width="17" height="35" xoffset="-3" yoffset="6" xadvance="11" page="0" chnl="15"/>
<char id="117" x="325" y="153" width="27" height="28" xoffset="-4" yoffset="13" xadvance="20" page="0" chnl="15"/>
<char id="118" x="152" y="157" width="26" height="30" xoffset="-4" yoffset="11" xadvance="19" page="0" chnl="15"/>
<char id="119" x="66" y="161" width="33" height="32" xoffset="-3" yoffset="10" xadvance="26" page="0" chnl="15"/>
<char id="120" x="25" y="161" width="26" height="33" xoffset="-4" yoffset="11" xadvance="19" page="0" chnl="15"/>
<char id="121" x="159" y="120" width="27" height="36" xoffset="-4" yoffset="13" xadvance="20" page="0" chnl="15"/>
<char id="122" x="458" y="151" width="25" height="28" xoffset="-3" yoffset="13" xadvance="19" page="0" chnl="15"/>
<char id="123" x="20" y="0" width="20" height="46" xoffset="-3" yoffset="0" xadvance="14" page="0" chnl="15"/>
<char id="124" x="482" y="0" width="11" height="42" xoffset="-3" yoffset="2" xadvance="6" page="0" chnl="15"/>
<char id="125" x="0" y="0" width="20" height="46" xoffset="-3" yoffset="0" xadvance="14" page="0" chnl="15"/>
<char id="126" x="46" y="218" width="24" height="13" xoffset="-3" yoffset="4" xadvance="19" page="0" chnl="15"/>
<char id="130" x="414" y="180" width="15" height="17" xoffset="-3" yoffset="27" xadvance="9" page="0" chnl="15"/>
<char id="132" x="347" y="181" width="22" height="17" xoffset="-4" yoffset="27" xadvance="15" page="0" chnl="15"/>
<char id="133" x="14" y="220" width="32" height="13" xoffset="-3" yoffset="28" xadvance="26" page="0" chnl="15"/>
<char id="134" x="160" y="0" width="28" height="44" xoffset="-2" yoffset="3" xadvance="24" page="0" chnl="15"/>
<char id="135" x="188" y="0" width="28" height="44" xoffset="-2" yoffset="3" xadvance="24" page="0" chnl="15"/>
<char id="137" x="319" y="119" width="38" height="34" xoffset="-3" yoffset="7" xadvance="33" page="0" chnl="15"/>
<char id="139" x="201" y="185" width="16" height="21" xoffset="0" yoffset="15" xadvance="15" page="0" chnl="15"/>
<char id="145" x="369" y="181" width="15" height="17" xoffset="-3" yoffset="4" xadvance="9" page="0" chnl="15"/>
<char id="146" x="384" y="180" width="15" height="17" xoffset="-3" yoffset="4" xadvance="9" page="0" chnl="15"/>
<char id="147" x="303" y="182" width="22" height="17" xoffset="-4" yoffset="4" xadvance="15" page="0" chnl="15"/>
<char id="148" x="325" y="181" width="22" height="17" xoffset="-4" yoffset="4" xadvance="15" page="0" chnl="15"/>
<char id="149" x="233" y="185" width="21" height="20" xoffset="-3" yoffset="12" xadvance="16" page="0" chnl="15"/>
<char id="150" x="154" y="208" width="32" height="10" xoffset="-4" yoffset="20" xadvance="24" page="0" chnl="15"/>
<char id="151" x="103" y="215" width="51" height="10" xoffset="-4" yoffset="20" xadvance="43" page="0" chnl="15"/>
<char id="153" x="0" y="195" width="45" height="25" xoffset="-1" yoffset="3" xadvance="43" page="0" chnl="15"/>
<char id="155" x="217" y="185" width="16" height="21" xoffset="0" yoffset="15" xadvance="15" page="0" chnl="15"/>
<char id="160" x="221" y="206" width="9" height="9" xoffset="-4" yoffset="33" xadvance="22" page="0" chnl="15"/>
<char id="161" x="493" y="0" width="16" height="41" xoffset="-3" yoffset="0" xadvance="10" page="0" chnl="15"/>
<char id="162" x="299" y="43" width="27" height="39" xoffset="-3" yoffset="8" xadvance="20" page="0" chnl="15"/>
<char id="163" x="31" y="87" width="31" height="38" xoffset="-3" yoffset="3" xadvance="24" page="0" chnl="15"/>
<char id="164" x="178" y="156" width="30" height="29" xoffset="-3" yoffset="8" xadvance="24" page="0" chnl="15"/>
<char id="165" x="298" y="82" width="33" height="37" xoffset="-4" yoffset="4" xadvance="24" page="0" chnl="15"/>
<char id="169" x="102" y="45" width="40" height="39" xoffset="-4" yoffset="2" xadvance="32" page="0" chnl="15"/>
<char id="171" x="153" y="187" width="24" height="21" xoffset="0" yoffset="15" xadvance="24" page="0" chnl="15"/>
<char id="172" x="254" y="184" width="29" height="19" xoffset="-2" yoffset="17" xadvance="26" page="0" chnl="15"/>
<char id="174" x="62" y="45" width="40" height="39" xoffset="-4" yoffset="2" xadvance="32" page="0" chnl="15"/>
<char id="176" x="283" y="183" width="20" height="19" xoffset="-1" yoffset="4" xadvance="18" page="0" chnl="15"/>
<char id="177" x="208" y="156" width="29" height="29" xoffset="-2" yoffset="12" xadvance="26" page="0" chnl="15"/>
<char id="182" x="40" y="0" width="28" height="45" xoffset="-3" yoffset="3" xadvance="23" page="0" chnl="15"/>
<char id="183" x="0" y="220" width="14" height="14" xoffset="-3" yoffset="14" xadvance="8" page="0" chnl="15"/>
<char id="187" x="177" y="187" width="24" height="21" xoffset="0" yoffset="15" xadvance="24" page="0" chnl="15"/>
</font>
<font name="Medieval">
<info face="Medieval English" size="48" bold="1" italic="0" charset="ANSI" unicode="0" stretchH="100" smooth="1" aa="1" padding="4,4,4,4" spacing="0,0" outline="1" common_lineHeight="48" base="38" scaleW="512" scaleH="256" page_id="0" file="Medieval_00.png" chars_count="112"/>
<char id="33" x="401" y="85" width="17" height="40" xoffset="-2" yoffset="3" xadvance="13"/>
<char id="34" x="221" y="198" width="20" height="21" xoffset="-3" yoffset="4" xadvance="14"/>
<char id="35" x="425" y="124" width="27" height="38" xoffset="-4" yoffset="5" xadvance="20"/>
<char id="36" x="452" y="124" width="26" height="38" xoffset="-5" yoffset="4" xadvance="18"/>
<char id="37" x="31" y="49" width="38" height="43" xoffset="-5" yoffset="2" xadvance="29"/>
<char id="38" x="352" y="46" width="37" height="40" xoffset="-5" yoffset="4" xadvance="29"/>
<char id="39" x="257" y="198" width="14" height="21" xoffset="-3" yoffset="4" xadvance="9"/>
<char id="40" x="212" y="0" width="22" height="47" xoffset="-4" yoffset="2" xadvance="15"/>
<char id="41" x="234" y="0" width="22" height="47" xoffset="-5" yoffset="2" xadvance="15"/>
<char id="42" x="68" y="205" width="26" height="25" xoffset="-2" yoffset="4" xadvance="20"/>
<char id="43" x="41" y="209" width="27" height="26" xoffset="-3" yoffset="11" xadvance="21"/>
<char id="44" x="241" y="198" width="16" height="21" xoffset="-2" yoffset="28" xadvance="12"/>
<char id="45" x="58" y="235" width="19" height="12" xoffset="-5" yoffset="22" xadvance="12"/>
<char id="46" x="442" y="194" width="16" height="15" xoffset="-2" yoffset="28" xadvance="12"/>
<char id="47" x="256" y="0" width="24" height="46" xoffset="-5" yoffset="3" xadvance="14"/>
<char id="48" x="132" y="88" width="32" height="40" xoffset="-3" yoffset="4" xadvance="26"/>
<char id="49" x="492" y="84" width="20" height="39" xoffset="-2" yoffset="4" xadvance="16"/>
<char id="50" x="423" y="45" width="33" height="40" xoffset="-4" yoffset="4" xadvance="26"/>
<char id="51" x="104" y="131" width="32" height="39" xoffset="-3" yoffset="4" xadvance="26"/>
<char id="52" x="136" y="128" width="32" height="39" xoffset="-3" yoffset="4" xadvance="26"/>
<char id="53" x="196" y="88" width="32" height="40" xoffset="-4" yoffset="4" xadvance="26"/>
<char id="54" x="0" y="49" width="31" height="44" xoffset="-3" yoffset="0" xadvance="26"/>
<char id="55" x="459" y="0" width="33" height="44" xoffset="-3" yoffset="3" xadvance="26"/>
<char id="56" x="168" y="128" width="32" height="39" xoffset="-3" yoffset="4" xadvance="26"/>
<char id="57" x="69" y="48" width="32" height="43" xoffset="-3" yoffset="4" xadvance="26"/>
<char id="58" x="25" y="209" width="16" height="28" xoffset="-2" yoffset="15" xadvance="12"/>
<char id="59" x="68" y="171" width="16" height="34" xoffset="-2" yoffset="15" xadvance="12"/>
<char id="60" x="113" y="170" width="29" height="33" xoffset="-4" yoffset="7" xadvance="22"/>
<char id="61" x="344" y="195" width="27" height="17" xoffset="-3" yoffset="16" xadvance="21"/>
<char id="62" x="84" y="171" width="29" height="33" xoffset="-4" yoffset="7" xadvance="21"/>
<char id="63" x="291" y="126" width="29" height="39" xoffset="-4" yoffset="4" xadvance="22"/>
<char id="64" x="315" y="46" width="37" height="40" xoffset="-3" yoffset="4" xadvance="31"/>
<char id="65" x="418" y="85" width="37" height="39" xoffset="-5" yoffset="4" xadvance="29"/>
<char id="66" x="178" y="0" width="34" height="47" xoffset="-5" yoffset="4" xadvance="26"/>
<char id="67" x="228" y="88" width="31" height="40" xoffset="-4" yoffset="4" xadvance="21"/>
<char id="68" x="70" y="132" width="34" height="39" xoffset="-4" yoffset="4" xadvance="27"/>
<char id="69" x="389" y="45" width="34" height="40" xoffset="-4" yoffset="4" xadvance="25"/>
<char id="70" x="231" y="128" width="30" height="39" xoffset="-5" yoffset="4" xadvance="21"/>
<char id="71" x="0" y="133" width="36" height="39" xoffset="-4" yoffset="4" xadvance="28"/>
<char id="72" x="455" y="85" width="37" height="39" xoffset="-5" yoffset="4" xadvance="27"/>
<char id="73" x="378" y="126" width="19" height="39" xoffset="-5" yoffset="4" xadvance="12"/>
<char id="74" x="261" y="127" width="30" height="39" xoffset="-5" yoffset="4" xadvance="22"/>
<char id="75" x="379" y="0" width="36" height="45" xoffset="-4" yoffset="3" xadvance="26"/>
<char id="76" x="259" y="87" width="31" height="40" xoffset="-5" yoffset="4" xadvance="22"/>
<char id="77" x="102" y="0" width="39" height="47" xoffset="-5" yoffset="4" xadvance="29"/>
<char id="78" x="36" y="132" width="34" height="39" xoffset="-5" yoffset="4" xadvance="26"/>
<char id="79" x="132" y="47" width="36" height="41" xoffset="-4" yoffset="3" xadvance="29"/>
<char id="80" x="164" y="88" width="32" height="40" xoffset="-6" yoffset="3" xadvance="22"/>
<char id="81" x="0" y="0" width="36" height="49" xoffset="-5" yoffset="3" xadvance="29"/>
<char id="82" x="141" y="0" width="37" height="47" xoffset="-5" yoffset="4" xadvance="26"/>
<char id="83" x="202" y="47" width="32" height="41" xoffset="-4" yoffset="3" xadvance="25"/>
<char id="84" x="200" y="128" width="31" height="39" xoffset="-5" yoffset="4" xadvance="22"/>
<char id="85" x="66" y="92" width="33" height="40" xoffset="-4" yoffset="3" xadvance="26"/>
<char id="86" x="33" y="92" width="33" height="40" xoffset="-5" yoffset="3" xadvance="24"/>
<char id="87" x="275" y="46" width="40" height="40" xoffset="-5" yoffset="3" xadvance="31"/>
<char id="88" x="0" y="93" width="33" height="40" xoffset="-4" yoffset="3" xadvance="27"/>
<char id="89" x="68" y="0" width="34" height="48" xoffset="-4" yoffset="3" xadvance="27"/>
<char id="90" x="168" y="47" width="34" height="41" xoffset="-5" yoffset="3" xadvance="26"/>
<char id="91" x="345" y="0" width="21" height="46" xoffset="-2" yoffset="2" xadvance="13"/>
<char id="92" x="101" y="48" width="31" height="42" xoffset="-2" yoffset="1" xadvance="26"/>
<char id="93" x="324" y="0" width="21" height="46" xoffset="-4" yoffset="2" xadvance="16"/>
<char id="94" x="473" y="192" width="22" height="13" xoffset="0" yoffset="-1" xadvance="16"/>
<char id="95" x="0" y="239" width="33" height="12" xoffset="-5" yoffset="37" xadvance="21"/>
<char id="96" x="398" y="195" width="22" height="15" xoffset="-3" yoffset="7" xadvance="15"/>
<char id="97" x="473" y="162" width="27" height="30" xoffset="-4" yoffset="13" xadvance="20"/>
<char id="98" x="349" y="126" width="29" height="39" xoffset="-5" yoffset="4" xadvance="21"/>
<char id="99" x="419" y="164" width="27" height="30" xoffset="-4" yoffset="13" xadvance="17"/>
<char id="100" x="349" y="86" width="28" height="40" xoffset="-4" yoffset="4" xadvance="21"/>
<char id="101" x="0" y="209" width="25" height="30" xoffset="-5" yoffset="13" xadvance="17"/>
<char id="102" x="489" y="44" width="21" height="40" xoffset="-5" yoffset="3" xadvance="13"/>
<char id="103" x="397" y="126" width="28" height="38" xoffset="-4" yoffset="13" xadvance="21"/>
<char id="104" x="290" y="86" width="30" height="40" xoffset="-5" yoffset="3" xadvance="22"/>
<char id="105" x="27" y="172" width="19" height="37" xoffset="-5" yoffset="6" xadvance="10"/>
<char id="106" x="443" y="0" width="16" height="45" xoffset="-4" yoffset="6" xadvance="11"/>
<char id="107" x="36" y="0" width="32" height="49" xoffset="-5" yoffset="3" xadvance="21"/>
<char id="108" x="492" y="0" width="18" height="40" xoffset="-5" yoffset="3" xadvance="10"/>
<char id="109" x="293" y="165" width="40" height="30" xoffset="-5" yoffset="13" xadvance="33"/>
<char id="110" x="391" y="165" width="28" height="30" xoffset="-4" yoffset="13" xadvance="22"/>
<char id="111" x="333" y="165" width="29" height="30" xoffset="-4" yoffset="13" xadvance="23"/>
<char id="112" x="320" y="126" width="29" height="39" xoffset="-5" yoffset="13" xadvance="22"/>
<char id="113" x="478" y="124" width="28" height="37" xoffset="-4" yoffset="14" xadvance="21"/>
<char id="114" x="269" y="166" width="24" height="31" xoffset="-4" yoffset="12" xadvance="15"/>
<char id="115" x="446" y="162" width="27" height="30" xoffset="-5" yoffset="13" xadvance="19"/>
<char id="116" x="46" y="171" width="22" height="36" xoffset="-5" yoffset="7" xadvance="15"/>
<char id="117" x="142" y="167" width="30" height="32" xoffset="-5" yoffset="12" xadvance="21"/>
<char id="118" x="240" y="167" width="29" height="31" xoffset="-5" yoffset="12" xadvance="22"/>
<char id="119" x="172" y="167" width="38" height="31" xoffset="-5" yoffset="12" xadvance="30"/>
<char id="120" x="210" y="167" width="30" height="31" xoffset="-5" yoffset="12" xadvance="21"/>
<char id="121" x="415" y="0" width="28" height="45" xoffset="-5" yoffset="7" xadvance="21"/>
<char id="122" x="362" y="165" width="29" height="30" xoffset="-5" yoffset="13" xadvance="21"/>
<char id="123" x="280" y="0" width="22" height="46" xoffset="-4" yoffset="3" xadvance="11"/>
<char id="124" x="366" y="0" width="13" height="46" xoffset="5" yoffset="4" xadvance="16"/>
<char id="125" x="302" y="0" width="22" height="46" xoffset="-4" yoffset="3" xadvance="14"/>
<char id="126" x="371" y="195" width="27" height="15" xoffset="-3" yoffset="-2" xadvance="17"/>
<char id="130" x="329" y="195" width="15" height="19" xoffset="-4" yoffset="28" xadvance="9"/>
<char id="139" x="183" y="198" width="19" height="23" xoffset="-3" yoffset="16" xadvance="13"/>
<char id="146" x="292" y="197" width="15" height="20" xoffset="-4" yoffset="4" xadvance="9"/>
<char id="147" x="307" y="195" width="22" height="19" xoffset="-4" yoffset="4" xadvance="14"/>
<char id="148" x="271" y="197" width="21" height="20" xoffset="-3" yoffset="4" xadvance="14"/>
<char id="153" x="94" y="204" width="37" height="23" xoffset="-4" yoffset="4" xadvance="29"/>
<char id="155" x="202" y="198" width="19" height="23" xoffset="-4" yoffset="16" xadvance="12"/>
<char id="162" x="0" y="172" width="27" height="37" xoffset="-4" yoffset="4" xadvance="19"/>
<char id="163" x="99" y="91" width="33" height="40" xoffset="-4" yoffset="4" xadvance="25"/>
<char id="165" x="456" y="45" width="33" height="40" xoffset="-4" yoffset="3" xadvance="23"/>
<char id="167" x="377" y="86" width="24" height="40" xoffset="-2" yoffset="4" xadvance="19"/>
<char id="169" x="234" y="47" width="41" height="40" xoffset="-4" yoffset="4" xadvance="34"/>
<char id="171" x="157" y="199" width="26" height="23" xoffset="-3" yoffset="16" xadvance="20"/>
<char id="175" x="33" y="237" width="25" height="12" xoffset="-5" yoffset="9" xadvance="14"/>
<char id="180" x="420" y="194" width="22" height="15" xoffset="-5" yoffset="7" xadvance="12"/>
<char id="182" x="320" y="86" width="29" height="40" xoffset="-3" yoffset="4" xadvance="24"/>
<char id="183" x="458" y="192" width="15" height="14" xoffset="-2" yoffset="20" xadvance="10"/>
<char id="187" x="131" y="203" width="26" height="23" xoffset="-4" yoffset="16" xadvance="19"/>
</font>
</fonts>
;
}
}//package config
Section 4
//GameDifficultiesXML (config.GameDifficultiesXML)
package config {
public class GameDifficultiesXML {
public static var DIFFICULTIES:XML = <difficulties>
<dif name="Easy" npc_hp="1" npc_cannon_damage="0.5" npc_kill_money="0.9" npc_accuracy="0.6" npc_reload_time="1.4" npc_rob_money="1.5" npc_rob_rp="1.5" player_firedamage="0.7" player_rob_money="0.7" player_rob_rp="0.5"/>
<dif name="Normal" npc_hp="1" npc_cannon_damage="0.8" npc_kill_money="0.9" npc_accuracy="1.0" npc_reload_time="1" npc_rob_money="0.8" npc_rob_rp="0.8" player_firedamage="1" player_rob_money="1.0" player_rob_rp="1.0"/>
<dif name="Hard" npc_hp="1" npc_cannon_damage="1.1" npc_kill_money="0.7" npc_accuracy="1.2" npc_reload_time="0.8" npc_rob_money="0.6" npc_rob_rp="0.6" player_firedamage="1.2" player_rob_money="1.5" player_rob_rp="1.5"/>
<dif name="Insane" npc_hp="1" npc_cannon_damage="1.5" npc_kill_money="0.5" npc_accuracy="1.5" npc_reload_time="0.6" npc_rob_money="0.5" npc_rob_rp="0.5" player_firedamage="1.5" player_rob_money="2" player_rob_rp="2"/>
</difficulties>
;
}
}//package config
Section 5
//LevelsXML (config.LevelsXML)
package config {
public class LevelsXML {
public static var DEMOS:XML = <demos>
<demo index="0" num_ships="1">
<ships>
<ship type="ship0" start_pts="0" end_pts="6" spawn_int="3" spawn_int_var="1" max_pr_ships="1" nearest_line="1" farthest_line="2"/>
</ships>
<total_points>2</total_points>
<islands_set>islands_trop</islands_set>
</demo>
<demo index="1" num_ships="1">
<ships>
<ship type="ship0" start_pts="0" end_pts="5" spawn_int="10" spawn_int_var="1" max_pr_ships="1" nearest_line="0" farthest_line="3"/>
</ships>
<total_points>2</total_points>
<islands_set>islands_trop</islands_set>
</demo>
</demos>
;
public static var LEVELS:XML = <levels>
<level index="0" num_ships="10">
<ships>
<ship type="ship1" start_pts="0" end_pts="1" spawn_int="4.0" spawn_int_var="1.0" max_pr_ships="1" nearest_line="0" farthest_line="2"/>
<ship type="ship0" start_pts="1" end_pts="3" spawn_int="4.0" spawn_int_var="1.0" max_pr_ships="1" nearest_line="0" farthest_line="2"/>
<ship type="ship3" start_pts="3" end_pts="9" spawn_int="4.0" spawn_int_var="1.0" max_pr_ships="1" nearest_line="0" farthest_line="2"/>
<ship type="ship1" start_pts="6" end_pts="7" spawn_int="1.0" spawn_int_var="0.0" max_pr_ships="1" nearest_line="0" farthest_line="2"/>
<ship type="ship1" start_pts="9" end_pts="10" spawn_int="1.0" spawn_int_var="0.0" max_pr_ships="1" nearest_line="0" farthest_line="2"/>
<ship type="ship0" start_pts="10" end_pts="13" spawn_int="4.0" spawn_int_var="1.0" max_pr_ships="1" nearest_line="0" farthest_line="2"/>
<ship type="ship3" start_pts="13" end_pts="15" spawn_int="4.0" spawn_int_var="0.0" max_pr_ships="1" nearest_line="0" farthest_line="2"/>
<ship type="ship0" start_pts="15" end_pts="17" spawn_int="4.0" spawn_int_var="1.0" max_pr_ships="1" nearest_line="0" farthest_line="2"/>
<ship type="ship1" start_pts="17" end_pts="19" spawn_int="4.0" spawn_int_var="0.0" max_pr_ships="2" nearest_line="0" farthest_line="2"/>
<ship type="ship2" start_pts="19" end_pts="22" spawn_int="3.0" spawn_int_var="0.0" max_pr_ships="1" nearest_line="2" farthest_line="2"/>
</ships>
<total_points>22</total_points>
<islands_set>islands_trop</islands_set>
</level>
<level index="1" num_ships="14">
<ships>
<ship type="ship0" start_pts="0" end_pts="6" spawn_int="3.0" spawn_int_var="1.0" max_pr_ships="2" nearest_line="0" farthest_line="3"/>
<ship type="ship1" start_pts="3" end_pts="6" spawn_int="1.0" spawn_int_var="1.0" max_pr_ships="4" nearest_line="0" farthest_line="3"/>
<ship type="ship2" start_pts="6" end_pts="12" spawn_int="15.0" spawn_int_var="1.0" max_pr_ships="2" nearest_line="0" farthest_line="3"/>
<ship type="ship3" start_pts="10" end_pts="12" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="2" nearest_line="0" farthest_line="3"/>
<ship type="ship1" start_pts="12" end_pts="13" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="2" nearest_line="0" farthest_line="3"/>
<ship type="ship0" start_pts="13" end_pts="17" spawn_int="5.0" spawn_int_var="1.0" max_pr_ships="3" nearest_line="0" farthest_line="3"/>
<ship type="ship3" start_pts="17" end_pts="19" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="2" nearest_line="0" farthest_line="3"/>
<ship type="ship0" start_pts="17" end_pts="21" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="2" nearest_line="0" farthest_line="3"/>
<ship type="ship3" start_pts="21" end_pts="35" spawn_int="1.0" spawn_int_var="1.0" max_pr_ships="1" nearest_line="0" farthest_line="3"/>
<ship type="ship0" start_pts="25" end_pts="37" spawn_int="9.0" spawn_int_var="1.0" max_pr_ships="2" nearest_line="0" farthest_line="3"/>
<ship type="ship0" start_pts="40" end_pts="50" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="1" nearest_line="0" farthest_line="3"/>
<ship type="ship4" start_pts="34" end_pts="45" spawn_int="1.0" spawn_int_var="1.0" max_pr_ships="1" nearest_line="0" farthest_line="3"/>
<ship type="ship1" start_pts="42" end_pts="45" spawn_int="1.0" spawn_int_var="0.0" max_pr_ships="2" nearest_line="0" farthest_line="3"/>
<ship type="ship3" start_pts="34" end_pts="45" spawn_int="2.0" spawn_int_var="1.0" max_pr_ships="1" nearest_line="0" farthest_line="3"/>
</ships>
<total_points>45</total_points>
<islands_set>islands_rock</islands_set>
</level>
<level index="2" num_ships="17" begin_event="Level2begin">
<ships>
<ship type="ship0" start_pts="0" end_pts="2" spawn_int="7.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship3" start_pts="2" end_pts="8" spawn_int="5.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship2" start_pts="5" end_pts="10" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship1" start_pts="8" end_pts="11" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship4" start_pts="8" end_pts="14" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship0" start_pts="10" end_pts="14" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship3" start_pts="12" end_pts="18" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship2" start_pts="13" end_pts="21" spawn_int="3.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship4" start_pts="19" end_pts="27" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship0" start_pts="25" end_pts="30" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship2" start_pts="27" end_pts="33" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship1" start_pts="30" end_pts="36" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship3" start_pts="30" end_pts="60" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship2" start_pts="36" end_pts="60" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship4" start_pts="50" end_pts="60" spawn_int="7.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship0" start_pts="50" end_pts="60" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship5" start_pts="60" end_pts="65" spawn_int="1.0" spawn_int_var="0.0" max_pr_ships="1" is_boss="true" spawn_event="madseller"/>
</ships>
<total_points>65</total_points>
<islands_set>islands_ice</islands_set>
</level>
<level index="3" num_ships="30">
<ships>
<ship type="ship6" start_pts="0" end_pts="3" spawn_int="7.0" spawn_int_var="1.0" max_pr_ships="1" spawn_event="FortSpawned"/>
<ship type="ship3" start_pts="3" end_pts="5" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship0" start_pts="5" end_pts="7" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship3" start_pts="7" end_pts="13" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship4" start_pts="7" end_pts="13" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship1" start_pts="7" end_pts="13" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship3" start_pts="13" end_pts="15" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship7" start_pts="15" end_pts="20" spawn_int="1.0" spawn_int_var="0.0" max_pr_ships="1"/>
<ship type="ship1" start_pts="20" end_pts="30" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship3" start_pts="20" end_pts="30" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship0" start_pts="20" end_pts="30" spawn_int="7.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship0" start_pts="30" end_pts="40" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship4" start_pts="30" end_pts="40" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship1" start_pts="30" end_pts="40" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship1" start_pts="40" end_pts="41" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship3" start_pts="41" end_pts="43" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship2" start_pts="43" end_pts="50" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship0" start_pts="43" end_pts="50" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship4" start_pts="50" end_pts="60" spawn_int="15.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship6" start_pts="55" end_pts="70" spawn_int="15.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship3" start_pts="60" end_pts="70" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship7" start_pts="70" end_pts="75" spawn_int="1.0" spawn_int_var="0.0" max_pr_ships="1"/>
<ship type="ship4" start_pts="75" end_pts="90" spawn_int="15.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship3" start_pts="75" end_pts="90" spawn_int="15.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship1" start_pts="75" end_pts="90" spawn_int="15.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship6" start_pts="90" end_pts="100" spawn_int="15.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship0" start_pts="90" end_pts="100" spawn_int="15.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship1" start_pts="95" end_pts="100" spawn_int="15.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship3" start_pts="100" end_pts="106" spawn_int="2.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship1" start_pts="106" end_pts="108" spawn_int="1.0" spawn_int_var="1.0" max_pr_ships="2"/>
</ships>
<total_points>108</total_points>
<islands_set>islands_rock</islands_set>
</level>
<level index="4" num_ships="42">
<ships>
<ship type="ship3" start_pts="0" end_pts="4" spawn_int="5.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship4" start_pts="0" end_pts="10" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship0" start_pts="10" end_pts="14" spawn_int="3.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship1" start_pts="13" end_pts="15" spawn_int="4.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship4" start_pts="15" end_pts="21" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship1" start_pts="21" end_pts="23" spawn_int="4.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship6" start_pts="23" end_pts="26" spawn_int="7.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship7" start_pts="26" end_pts="30" spawn_int="3.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship3" start_pts="30" end_pts="36" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship1" start_pts="33" end_pts="36" spawn_int="4.0" spawn_int_var="1.0" max_pr_ships="3"/>
<ship type="ship6" start_pts="36" end_pts="40" spawn_int="7.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship0" start_pts="40" end_pts="44" spawn_int="5.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship4" start_pts="44" end_pts="50" spawn_int="7.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship1" start_pts="50" end_pts="53" spawn_int="3.0" spawn_int_var="1.0" max_pr_ships="3"/>
<ship type="ship0" start_pts="53" end_pts="65" spawn_int="15.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship3" start_pts="53" end_pts="65" spawn_int="15.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship4" start_pts="53" end_pts="65" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship6" start_pts="55" end_pts="65" spawn_int="15.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship7" start_pts="65" end_pts="70" spawn_int="15.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship3" start_pts="70" end_pts="74" spawn_int="15.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship2" start_pts="74" end_pts="80" spawn_int="5.0" spawn_int_var="1.0" max_pr_ships="3"/>
<ship type="ship7" start_pts="80" end_pts="82" spawn_int="1.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship4" start_pts="82" end_pts="86" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship6" start_pts="86" end_pts="90" spawn_int="15.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship3" start_pts="90" end_pts="100" spawn_int="10.0" spawn_int_var="5.0" max_pr_ships="2"/>
<ship type="ship2" start_pts="90" end_pts="100" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship0" start_pts="100" end_pts="102" spawn_int="15.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship1" start_pts="102" end_pts="103" spawn_int="15.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship3" start_pts="103" end_pts="107" spawn_int="6.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship6" start_pts="107" end_pts="112" spawn_int="3.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship4" start_pts="112" end_pts="115" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship2" start_pts="112" end_pts="120" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="3"/>
<ship type="ship6" start_pts="117" end_pts="123" spawn_int="15.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship4" start_pts="123" end_pts="130" spawn_int="2.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship3" start_pts="130" end_pts="134" spawn_int="15.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship0" start_pts="134" end_pts="136" spawn_int="15.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship1" start_pts="136" end_pts="138" spawn_int="2.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship3" start_pts="138" end_pts="140" spawn_int="7.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship8" start_pts="140" end_pts="145" spawn_int="1.0" spawn_int_var="0.0" max_pr_ships="1" is_boss_t38="true"/>
<ship type="ship3" start_pts="138" end_pts="151" spawn_int="3.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship0" start_pts="142" end_pts="151" spawn_int="4.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship1" start_pts="151" end_pts="155" spawn_int="5.0" spawn_int_var="1.0" max_pr_ships="2"/>
</ships>
<total_points>155</total_points>
<islands_set>islands_trop</islands_set>
</level>
<level index="5" num_ships="50">
<ships>
<ship type="ship0" start_pts="0" end_pts="80" spawn_int="5.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship1" start_pts="0" end_pts="10" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship2" start_pts="10" end_pts="13" spawn_int="3.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship3" start_pts="13" end_pts="17" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship4" start_pts="17" end_pts="20" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship0" start_pts="20" end_pts="30" spawn_int="4.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship3" start_pts="20" end_pts="30" spawn_int="7.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship1" start_pts="26" end_pts="30" spawn_int="5.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship6" start_pts="30" end_pts="36" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship3" start_pts="33" end_pts="40" spawn_int="4.0" spawn_int_var="1.0" max_pr_ships="3"/>
<ship type="ship8" start_pts="40" end_pts="45" spawn_int="7.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship3" start_pts="45" end_pts="49" spawn_int="5.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship4" start_pts="49" end_pts="52" spawn_int="5.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship1" start_pts="52" end_pts="53" spawn_int="3.0" spawn_int_var="1.0" max_pr_ships="3"/>
<ship type="ship0" start_pts="53" end_pts="57" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship2" start_pts="57" end_pts="60" spawn_int="15.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship3" start_pts="60" end_pts="68" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship7" start_pts="63" end_pts="68" spawn_int="5.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship7" start_pts="68" end_pts="72" spawn_int="15.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship3" start_pts="72" end_pts="74" spawn_int="15.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship2" start_pts="74" end_pts="77" spawn_int="5.0" spawn_int_var="1.0" max_pr_ships="3"/>
<ship type="ship6" start_pts="77" end_pts="80" spawn_int="4.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship4" start_pts="80" end_pts="90" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship3" start_pts="80" end_pts="90" spawn_int="15.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship7" start_pts="90" end_pts="95" spawn_int="10.0" spawn_int_var="5.0" max_pr_ships="2"/>
<ship type="ship0" start_pts="95" end_pts="98" spawn_int="5.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship3" start_pts="98" end_pts="110" spawn_int="15.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship6" start_pts="98" end_pts="110" spawn_int="15.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship1" start_pts="98" end_pts="110" spawn_int="6.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship2" start_pts="110" end_pts="113" spawn_int="3.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship3" start_pts="113" end_pts="125" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship8" start_pts="120" end_pts="125" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="3"/>
<ship type="ship4" start_pts="120" end_pts="130" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship2" start_pts="125" end_pts="135" spawn_int="2.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship6" start_pts="135" end_pts="138" spawn_int="15.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship0" start_pts="135" end_pts="145" spawn_int="15.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship1" start_pts="135" end_pts="140" spawn_int="2.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship3" start_pts="140" end_pts="160" spawn_int="7.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship8" start_pts="140" end_pts="145" spawn_int="2.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship1" start_pts="140" end_pts="150" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship4" start_pts="155" end_pts="160" spawn_int="4.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship1" start_pts="160" end_pts="161" spawn_int="5.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship4" start_pts="161" end_pts="164" spawn_int="7.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship3" start_pts="161" end_pts="175" spawn_int="8.0" spawn_int_var="1.0" max_pr_ships="3"/>
<ship type="ship7" start_pts="165" end_pts="170" spawn_int="1.0" spawn_int_var="0.0" max_pr_ships="1"/>
<ship type="ship8" start_pts="170" end_pts="175" spawn_int="5.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship6" start_pts="175" end_pts="178" spawn_int="5.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship1" start_pts="178" end_pts="180" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship3" start_pts="180" end_pts="184" spawn_int="1.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship9" start_pts="184" end_pts="189" spawn_int="1.0" spawn_int_var="0.0" max_pr_ships="1"/>
</ships>
<total_points>189</total_points>
<islands_set>islands_ice</islands_set>
</level>
<level index="6" num_ships="41">
<ships>
<ship type="ship3" start_pts="0" end_pts="15" spawn_int="5.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship2" start_pts="2" end_pts="15" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship1" start_pts="12" end_pts="15" spawn_int="3.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship0" start_pts="15" end_pts="19" spawn_int="3.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship4" start_pts="18" end_pts="28" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship3" start_pts="20" end_pts="30" spawn_int="4.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship4" start_pts="25" end_pts="35" spawn_int="7.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship7" start_pts="35" end_pts="40" spawn_int="4.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship6" start_pts="30" end_pts="40" spawn_int="15.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship3" start_pts="35" end_pts="50" spawn_int="15.0" spawn_int_var="1.0" max_pr_ships="3"/>
<ship type="ship8" start_pts="45" end_pts="50" spawn_int="1.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship3" start_pts="49" end_pts="60" spawn_int="5.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship1" start_pts="55" end_pts="60" spawn_int="5.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship0" start_pts="59" end_pts="65" spawn_int="3.0" spawn_int_var="1.0" max_pr_ships="3"/>
<ship type="ship6" start_pts="64" end_pts="70" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship4" start_pts="69" end_pts="74" spawn_int="15.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship8" start_pts="74" end_pts="79" spawn_int="1.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship0" start_pts="78" end_pts="80" spawn_int="5.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship3" start_pts="80" end_pts="90" spawn_int="15.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship7" start_pts="85" end_pts="90" spawn_int="15.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship2" start_pts="84" end_pts="95" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="3"/>
<ship type="ship9" start_pts="90" end_pts="95" spawn_int="4.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship3" start_pts="95" end_pts="110" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship1" start_pts="105" end_pts="110" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship8" start_pts="105" end_pts="110" spawn_int="10.0" spawn_int_var="5.0" max_pr_ships="2"/>
<ship type="ship0" start_pts="109" end_pts="115" spawn_int="15.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship7" start_pts="114" end_pts="119" spawn_int="5.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship3" start_pts="114" end_pts="120" spawn_int="15.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship4" start_pts="119" end_pts="125" spawn_int="6.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship1" start_pts="124" end_pts="126" spawn_int="3.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship2" start_pts="126" end_pts="130" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship8" start_pts="128" end_pts="135" spawn_int="15.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship0" start_pts="130" end_pts="137" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship3" start_pts="135" end_pts="145" spawn_int="2.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship6" start_pts="144" end_pts="160" spawn_int="15.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship7" start_pts="155" end_pts="160" spawn_int="9.0" spawn_int_var="0.0" max_pr_ships="1"/>
<ship type="ship3" start_pts="150" end_pts="170" spawn_int="6.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship4" start_pts="165" end_pts="180" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship9" start_pts="180" end_pts="194" spawn_int="4.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship3" start_pts="185" end_pts="200" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship1" start_pts="195" end_pts="200" spawn_int="4.0" spawn_int_var="1.0" max_pr_ships="2"/>
</ships>
<total_points>200</total_points>
<islands_set>islands_rock</islands_set>
</level>
<level index="7" num_ships="49">
<ships>
<ship type="ship4" start_pts="0" end_pts="9" spawn_int="7.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship3" start_pts="5" end_pts="15" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship1" start_pts="12" end_pts="15" spawn_int="3.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship0" start_pts="14" end_pts="19" spawn_int="3.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship6" start_pts="16" end_pts="28" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship8" start_pts="20" end_pts="25" spawn_int="4.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship7" start_pts="24" end_pts="29" spawn_int="7.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship3" start_pts="25" end_pts="35" spawn_int="4.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship6" start_pts="30" end_pts="40" spawn_int="15.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship3" start_pts="35" end_pts="45" spawn_int="15.0" spawn_int_var="1.0" max_pr_ships="3"/>
<ship type="ship0" start_pts="40" end_pts="55" spawn_int="2.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship3" start_pts="49" end_pts="60" spawn_int="5.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship9" start_pts="55" end_pts="60" spawn_int="5.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship0" start_pts="59" end_pts="65" spawn_int="3.0" spawn_int_var="1.0" max_pr_ships="3"/>
<ship type="ship7" start_pts="60" end_pts="65" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship4" start_pts="60" end_pts="74" spawn_int="15.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship3" start_pts="70" end_pts="79" spawn_int="1.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship1" start_pts="76" end_pts="80" spawn_int="7.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship8" start_pts="75" end_pts="90" spawn_int="15.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship3" start_pts="85" end_pts="90" spawn_int="15.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship2" start_pts="84" end_pts="95" spawn_int="12.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship9" start_pts="90" end_pts="95" spawn_int="4.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship3" start_pts="90" end_pts="110" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship1" start_pts="105" end_pts="110" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship7" start_pts="100" end_pts="110" spawn_int="10.0" spawn_int_var="5.0" max_pr_ships="2"/>
<ship type="ship3" start_pts="100" end_pts="115" spawn_int="15.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship8" start_pts="110" end_pts="119" spawn_int="5.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship3" start_pts="114" end_pts="120" spawn_int="15.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship4" start_pts="115" end_pts="125" spawn_int="6.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship1" start_pts="120" end_pts="126" spawn_int="6.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship6" start_pts="120" end_pts="130" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship3" start_pts="125" end_pts="135" spawn_int="15.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship8" start_pts="130" end_pts="137" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship3" start_pts="130" end_pts="145" spawn_int="2.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship6" start_pts="140" end_pts="160" spawn_int="15.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship1" start_pts="155" end_pts="165" spawn_int="5.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship7" start_pts="160" end_pts="170" spawn_int="20.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship3" start_pts="160" end_pts="180" spawn_int="6.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship4" start_pts="165" end_pts="194" spawn_int="4.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship0" start_pts="185" end_pts="200" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship1" start_pts="195" end_pts="200" spawn_int="4.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship9" start_pts="295" end_pts="205" spawn_int="15.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship3" start_pts="195" end_pts="210" spawn_int="15.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship0" start_pts="205" end_pts="220" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship9" start_pts="210" end_pts="215" spawn_int="1.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship8" start_pts="210" end_pts="215" spawn_int="5.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship0" start_pts="214" end_pts="220" spawn_int="15.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship1" start_pts="215" end_pts="220" spawn_int="8.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship10" start_pts="220" end_pts="225" spawn_int="6.0" spawn_int_var="0.0" max_pr_ships="1" is_boss="true" spawn_event="turtle"/>
</ships>
<total_points>225</total_points>
<islands_set>islands_trop</islands_set>
</level>
<level index="8" num_ships="45">
<ships>
<ship type="ship3" start_pts="0" end_pts="10" spawn_int="7.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship7" start_pts="5" end_pts="10" spawn_int="1.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship1" start_pts="8" end_pts="13" spawn_int="3.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship2" start_pts="10" end_pts="19" spawn_int="3.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship3" start_pts="15" end_pts="25" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship6" start_pts="20" end_pts="25" spawn_int="4.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship7" start_pts="24" end_pts="29" spawn_int="1.0" spawn_int_var="0.0" max_pr_ships="1"/>
<ship type="ship3" start_pts="25" end_pts="35" spawn_int="4.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship8" start_pts="30" end_pts="35" spawn_int="7.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship3" start_pts="35" end_pts="45" spawn_int="15.0" spawn_int_var="1.0" max_pr_ships="3"/>
<ship type="ship9" start_pts="40" end_pts="55" spawn_int="2.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship0" start_pts="49" end_pts="60" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship4" start_pts="55" end_pts="60" spawn_int="5.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship0" start_pts="55" end_pts="65" spawn_int="3.0" spawn_int_var="1.0" max_pr_ships="3"/>
<ship type="ship8" start_pts="60" end_pts="70" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship4" start_pts="69" end_pts="74" spawn_int="1.0" spawn_int_var="0.0" max_pr_ships="1"/>
<ship type="ship0" start_pts="65" end_pts="79" spawn_int="1.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship1" start_pts="78" end_pts="80" spawn_int="7.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship2" start_pts="75" end_pts="90" spawn_int="12.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship3" start_pts="80" end_pts="90" spawn_int="15.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship4" start_pts="84" end_pts="95" spawn_int="12.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship7" start_pts="90" end_pts="95" spawn_int="1.0" spawn_int_var="0.0" max_pr_ships="1"/>
<ship type="ship3" start_pts="90" end_pts="110" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship1" start_pts="105" end_pts="110" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship2" start_pts="105" end_pts="110" spawn_int="10.0" spawn_int_var="5.0" max_pr_ships="2"/>
<ship type="ship3" start_pts="105" end_pts="115" spawn_int="15.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship9" start_pts="110" end_pts="119" spawn_int="5.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship4" start_pts="114" end_pts="120" spawn_int="15.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship3" start_pts="115" end_pts="125" spawn_int="6.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship1" start_pts="124" end_pts="126" spawn_int="3.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship9" start_pts="120" end_pts="130" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship3" start_pts="125" end_pts="135" spawn_int="15.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship7" start_pts="130" end_pts="135" spawn_int="1.0" spawn_int_var="0.0" max_pr_ships="1"/>
<ship type="ship3" start_pts="130" end_pts="145" spawn_int="2.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship4" start_pts="140" end_pts="160" spawn_int="15.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship0" start_pts="155" end_pts="165" spawn_int="1.0" spawn_int_var="0.0" max_pr_ships="1"/>
<ship type="ship1" start_pts="150" end_pts="170" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship7" start_pts="165" end_pts="180" spawn_int="1.0" spawn_int_var="0.0" max_pr_ships="1"/>
<ship type="ship4" start_pts="170" end_pts="194" spawn_int="4.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship9" start_pts="185" end_pts="200" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship1" start_pts="195" end_pts="200" spawn_int="4.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship3" start_pts="190" end_pts="205" spawn_int="5.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship6" start_pts="200" end_pts="210" spawn_int="15.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship0" start_pts="205" end_pts="221" spawn_int="8.0" spawn_int_var="1.0" max_pr_ships="3"/>
<ship type="ship11" start_pts="210" end_pts="220" spawn_int="1.0" spawn_int_var="0.0" max_pr_ships="1"/>
</ships>
<total_points>220</total_points>
<islands_set>islands_trop</islands_set>
</level>
<level index="9" num_ships="44">
<ships>
<ship type="ship3" start_pts="0" end_pts="10" spawn_int="7.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship0" start_pts="5" end_pts="10" spawn_int="6.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship1" start_pts="8" end_pts="13" spawn_int="3.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship4" start_pts="10" end_pts="19" spawn_int="3.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship8" start_pts="15" end_pts="20" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship6" start_pts="18" end_pts="25" spawn_int="4.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship3" start_pts="24" end_pts="29" spawn_int="7.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship7" start_pts="25" end_pts="30" spawn_int="4.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship8" start_pts="25" end_pts="35" spawn_int="7.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship3" start_pts="30" end_pts="45" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship0" start_pts="40" end_pts="50" spawn_int="2.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship7" start_pts="45" end_pts="50" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship2" start_pts="45" end_pts="60" spawn_int="5.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship9" start_pts="55" end_pts="64" spawn_int="3.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship1" start_pts="60" end_pts="65" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship4" start_pts="60" end_pts="74" spawn_int="15.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship3" start_pts="70" end_pts="80" spawn_int="7.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship1" start_pts="78" end_pts="80" spawn_int="7.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship2" start_pts="75" end_pts="90" spawn_int="12.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship3" start_pts="85" end_pts="90" spawn_int="15.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship9" start_pts="85" end_pts="95" spawn_int="15.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship3" start_pts="90" end_pts="95" spawn_int="4.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship2" start_pts="95" end_pts="110" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship7" start_pts="105" end_pts="110" spawn_int="3.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship4" start_pts="105" end_pts="110" spawn_int="10.0" spawn_int_var="5.0" max_pr_ships="2"/>
<ship type="ship8" start_pts="109" end_pts="115" spawn_int="15.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship9" start_pts="114" end_pts="119" spawn_int="5.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship1" start_pts="114" end_pts="120" spawn_int="15.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship0" start_pts="119" end_pts="125" spawn_int="6.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship1" start_pts="124" end_pts="126" spawn_int="3.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship9" start_pts="126" end_pts="130" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship3" start_pts="128" end_pts="135" spawn_int="15.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship8" start_pts="130" end_pts="135" spawn_int="3.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship3" start_pts="135" end_pts="145" spawn_int="2.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship11" start_pts="144" end_pts="154" spawn_int="15.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship3" start_pts="152" end_pts="162" spawn_int="1.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship1" start_pts="160" end_pts="170" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship8" start_pts="165" end_pts="180" spawn_int="7.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship2" start_pts="180" end_pts="194" spawn_int="4.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship3" start_pts="185" end_pts="200" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship1" start_pts="195" end_pts="200" spawn_int="4.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship0" start_pts="200" end_pts="205" spawn_int="5.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship6" start_pts="200" end_pts="210" spawn_int="15.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship12" start_pts="210" end_pts="214" spawn_int="1.0" spawn_int_var="0.0" max_pr_ships="1"/>
</ships>
<total_points>214</total_points>
<islands_set>islands_rock</islands_set>
</level>
<level index="10" num_ships="45">
<ships>
<ship type="ship7" start_pts="0" end_pts="5" spawn_int="7.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship3" start_pts="1" end_pts="10" spawn_int="6.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship8" start_pts="5" end_pts="13" spawn_int="9.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship4" start_pts="8" end_pts="19" spawn_int="3.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship12" start_pts="12" end_pts="20" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship1" start_pts="15" end_pts="20" spawn_int="4.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship3" start_pts="15" end_pts="29" spawn_int="7.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship6" start_pts="23" end_pts="30" spawn_int="4.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship8" start_pts="25" end_pts="39" spawn_int="15.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship2" start_pts="30" end_pts="45" spawn_int="11.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship11" start_pts="40" end_pts="45" spawn_int="1.0" spawn_int_var="0.0" max_pr_ships="1"/>
<ship type="ship12" start_pts="40" end_pts="50" spawn_int="12.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship3" start_pts="45" end_pts="60" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship9" start_pts="50" end_pts="64" spawn_int="15.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship1" start_pts="60" end_pts="65" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship12" start_pts="60" end_pts="74" spawn_int="15.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship7" start_pts="70" end_pts="75" spawn_int="1.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship0" start_pts="70" end_pts="80" spawn_int="7.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship2" start_pts="75" end_pts="90" spawn_int="15.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship3" start_pts="80" end_pts="90" spawn_int="15.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship9" start_pts="85" end_pts="95" spawn_int="6.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship7" start_pts="110" end_pts="115" spawn_int="4.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship2" start_pts="90" end_pts="110" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship12" start_pts="105" end_pts="120" spawn_int="7.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship3" start_pts="105" end_pts="130" spawn_int="10.0" spawn_int_var="5.0" max_pr_ships="1"/>
<ship type="ship8" start_pts="120" end_pts="125" spawn_int="15.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship0" start_pts="120" end_pts="125" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship4" start_pts="120" end_pts="140" spawn_int="15.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship1" start_pts="135" end_pts="145" spawn_int="5.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship12" start_pts="140" end_pts="150" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship11" start_pts="145" end_pts="155" spawn_int="1.0" spawn_int_var="0.0" max_pr_ships="1"/>
<ship type="ship3" start_pts="145" end_pts="165" spawn_int="11.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship8" start_pts="160" end_pts="190" spawn_int="7.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship3" start_pts="175" end_pts="200" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship7" start_pts="195" end_pts="200" spawn_int="1.0" spawn_int_var="0.0" max_pr_ships="1"/>
<ship type="ship3" start_pts="195" end_pts="210" spawn_int="15.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship1" start_pts="205" end_pts="210" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship8" start_pts="205" end_pts="220" spawn_int="15.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship12" start_pts="215" end_pts="220" spawn_int="9.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship3" start_pts="215" end_pts="230" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship1" start_pts="225" end_pts="230" spawn_int="4.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship0" start_pts="225" end_pts="230" spawn_int="5.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship9" start_pts="225" end_pts="240" spawn_int="15.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship11" start_pts="235" end_pts="240" spawn_int="1.0" spawn_int_var="0.0" max_pr_ships="1"/>
<ship type="ship3" start_pts="240" end_pts="250" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="2"/>
</ships>
<total_points>250</total_points>
<islands_set>islands_trop</islands_set>
</level>
<level index="11" num_ships="51">
<ships>
<ship type="ship12" start_pts="0" end_pts="5" spawn_int="7.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship0" start_pts="0" end_pts="10" spawn_int="6.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship3" start_pts="8" end_pts="13" spawn_int="3.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship2" start_pts="5" end_pts="19" spawn_int="3.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship12" start_pts="15" end_pts="20" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship1" start_pts="15" end_pts="25" spawn_int="4.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship7" start_pts="20" end_pts="25" spawn_int="1.0" spawn_int_var="0.0" max_pr_ships="1"/>
<ship type="ship4" start_pts="20" end_pts="30" spawn_int="4.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship13" start_pts="25" end_pts="30" spawn_int="15.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship8" start_pts="25" end_pts="35" spawn_int="15.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship11" start_pts="30" end_pts="40" spawn_int="1.0" spawn_int_var="0.0" max_pr_ships="1"/>
<ship type="ship12" start_pts="30" end_pts="40" spawn_int="5.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship3" start_pts="35" end_pts="50" spawn_int="15.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship9" start_pts="40" end_pts="64" spawn_int="15.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship1" start_pts="50" end_pts="60" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship13" start_pts="55" end_pts="74" spawn_int="7.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship8" start_pts="70" end_pts="80" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship0" start_pts="75" end_pts="80" spawn_int="7.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship6" start_pts="75" end_pts="90" spawn_int="15.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship7" start_pts="80" end_pts="85" spawn_int="1.0" spawn_int_var="0.0" max_pr_ships="1"/>
<ship type="ship9" start_pts="80" end_pts="95" spawn_int="3.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship1" start_pts="90" end_pts="100" spawn_int="5.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship3" start_pts="90" end_pts="110" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship13" start_pts="100" end_pts="120" spawn_int="3.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship4" start_pts="110" end_pts="130" spawn_int="10.0" spawn_int_var="5.0" max_pr_ships="1"/>
<ship type="ship11" start_pts="120" end_pts="130" spawn_int="1.0" spawn_int_var="0.0" max_pr_ships="2"/>
<ship type="ship3" start_pts="120" end_pts="125" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship9" start_pts="120" end_pts="140" spawn_int="15.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship1" start_pts="135" end_pts="145" spawn_int="6.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship12" start_pts="135" end_pts="150" spawn_int="5.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship3" start_pts="145" end_pts="155" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship8" start_pts="145" end_pts="155" spawn_int="1.0" spawn_int_var="0.0" max_pr_ships="1"/>
<ship type="ship3" start_pts="140" end_pts="180" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship9" start_pts="170" end_pts="200" spawn_int="12.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship0" start_pts="190" end_pts="200" spawn_int="15.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship3" start_pts="190" end_pts="210" spawn_int="15.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship9" start_pts="200" end_pts="210" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship8" start_pts="205" end_pts="220" spawn_int="15.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship13" start_pts="210" end_pts="225" spawn_int="4.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship4" start_pts="215" end_pts="230" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship1" start_pts="225" end_pts="230" spawn_int="4.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship4" start_pts="220" end_pts="230" spawn_int="5.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship8" start_pts="225" end_pts="240" spawn_int="15.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship12" start_pts="235" end_pts="245" spawn_int="7.0" spawn_int_var="0.0" max_pr_ships="2"/>
<ship type="ship3" start_pts="235" end_pts="250" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship9" start_pts="245" end_pts="255" spawn_int="6.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship12" start_pts="245" end_pts="260" spawn_int="7.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship4" start_pts="250" end_pts="270" spawn_int="7.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship4" start_pts="10" end_pts="260" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship4" start_pts="250" end_pts="270" spawn_int="7.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship19" start_pts="270" end_pts="275" spawn_int="5.0" spawn_int_var="0.0" max_pr_ships="1" is_boss="true" spawn_event="SubSpawned"/>
</ships>
<total_points>275</total_points>
<islands_set>islands_rock</islands_set>
</level>
<level index="12" num_ships="50">
<ships>
<ship type="ship8" start_pts="0" end_pts="5" spawn_int="7.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship3" start_pts="0" end_pts="10" spawn_int="16.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship2" start_pts="5" end_pts="13" spawn_int="3.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship6" start_pts="5" end_pts="10" spawn_int="3.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship0" start_pts="5" end_pts="20" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship1" start_pts="15" end_pts="20" spawn_int="4.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship12" start_pts="15" end_pts="25" spawn_int="5.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship7" start_pts="20" end_pts="25" spawn_int="1.0" spawn_int_var="0.0" max_pr_ships="1"/>
<ship type="ship8" start_pts="20" end_pts="40" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship4" start_pts="25" end_pts="35" spawn_int="5.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship13" start_pts="30" end_pts="40" spawn_int="7.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship12" start_pts="35" end_pts="45" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship3" start_pts="35" end_pts="50" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship4" start_pts="45" end_pts="64" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship7" start_pts="55" end_pts="65" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship0" start_pts="55" end_pts="74" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship1" start_pts="60" end_pts="65" spawn_int="7.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship2" start_pts="60" end_pts="80" spawn_int="7.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship12" start_pts="70" end_pts="90" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship11" start_pts="80" end_pts="90" spawn_int="1.0" spawn_int_var="0.0" max_pr_ships="1"/>
<ship type="ship4" start_pts="80" end_pts="95" spawn_int="7.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship9" start_pts="80" end_pts="100" spawn_int="5.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship3" start_pts="90" end_pts="110" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship1" start_pts="110" end_pts="120" spawn_int="3.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship8" start_pts="110" end_pts="130" spawn_int="10.0" spawn_int_var="5.0" max_pr_ships="1"/>
<ship type="ship11" start_pts="120" end_pts="130" spawn_int="1.0" spawn_int_var="0.0" max_pr_ships="1"/>
<ship type="ship3" start_pts="120" end_pts="135" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship2" start_pts="120" end_pts="140" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship8" start_pts="130" end_pts="145" spawn_int="6.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship3" start_pts="140" end_pts="160" spawn_int="13.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship12" start_pts="145" end_pts="155" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship7" start_pts="145" end_pts="155" spawn_int="1.0" spawn_int_var="0.0" max_pr_ships="1"/>
<ship type="ship3" start_pts="130" end_pts="180" spawn_int="13.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship13" start_pts="135" end_pts="180" spawn_int="12.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship2" start_pts="140" end_pts="200" spawn_int="1.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship9" start_pts="195" end_pts="210" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship0" start_pts="200" end_pts="210" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship1" start_pts="205" end_pts="220" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship13" start_pts="200" end_pts="225" spawn_int="4.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship3" start_pts="215" end_pts="230" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship9" start_pts="210" end_pts="230" spawn_int="4.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship12" start_pts="215" end_pts="230" spawn_int="5.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship13" start_pts="220" end_pts="240" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship0" start_pts="225" end_pts="240" spawn_int="8.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship11" start_pts="235" end_pts="245" spawn_int="1.0" spawn_int_var="0.0" max_pr_ships="1"/>
<ship type="ship12" start_pts="220" end_pts="255" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship3" start_pts="235" end_pts="260" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship9" start_pts="240" end_pts="260" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship2" start_pts="245" end_pts="280" spawn_int="2.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship13" start_pts="245" end_pts="280" spawn_int="11.0" spawn_int_var="1.0" max_pr_ships="2"/>
</ships>
<total_points>280</total_points>
<islands_set>islands_rock</islands_set>
</level>
<level index="13" num_ships="51">
<ships>
<ship type="ship3" start_pts="0" end_pts="5" spawn_int="7.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship0" start_pts="0" end_pts="10" spawn_int="6.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship12" start_pts="3" end_pts="13" spawn_int="3.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship4" start_pts="9" end_pts="15" spawn_int="3.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship9" start_pts="10" end_pts="20" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship3" start_pts="16" end_pts="21" spawn_int="4.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship13" start_pts="15" end_pts="24" spawn_int="7.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship8" start_pts="20" end_pts="30" spawn_int="15.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship1" start_pts="25" end_pts="30" spawn_int="15.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship11" start_pts="20" end_pts="30" spawn_int="15.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship3" start_pts="35" end_pts="45" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship7" start_pts="35" end_pts="40" spawn_int="12.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship2" start_pts="30" end_pts="50" spawn_int="15.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship8" start_pts="50" end_pts="64" spawn_int="15.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship12" start_pts="55" end_pts="65" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship3" start_pts="50" end_pts="74" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship11" start_pts="65" end_pts="75" spawn_int="7.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship9" start_pts="70" end_pts="80" spawn_int="7.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship12" start_pts="75" end_pts="80" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship3" start_pts="70" end_pts="95" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship8" start_pts="80" end_pts="95" spawn_int="7.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship7" start_pts="90" end_pts="95" spawn_int="5.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship0" start_pts="80" end_pts="110" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship1" start_pts="80" end_pts="90" spawn_int="3.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship2" start_pts="100" end_pts="130" spawn_int="10.0" spawn_int_var="5.0" max_pr_ships="1"/>
<ship type="ship7" start_pts="120" end_pts="125" spawn_int="15.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship3" start_pts="110" end_pts="135" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship11" start_pts="120" end_pts="140" spawn_int="15.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship13" start_pts="120" end_pts="145" spawn_int="6.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship4" start_pts="130" end_pts="150" spawn_int="3.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship12" start_pts="140" end_pts="155" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship9" start_pts="140" end_pts="155" spawn_int="15.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship2" start_pts="130" end_pts="180" spawn_int="13.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship7" start_pts="150" end_pts="155" spawn_int="12.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship8" start_pts="155" end_pts="200" spawn_int="15.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship3" start_pts="190" end_pts="200" spawn_int="15.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship12" start_pts="190" end_pts="210" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship11" start_pts="205" end_pts="215" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship13" start_pts="210" end_pts="225" spawn_int="4.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship3" start_pts="215" end_pts="230" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship9" start_pts="220" end_pts="230" spawn_int="4.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship4" start_pts="225" end_pts="230" spawn_int="5.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship13" start_pts="210" end_pts="230" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship1" start_pts="235" end_pts="240" spawn_int="8.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship8" start_pts="230" end_pts="245" spawn_int="15.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship0" start_pts="245" end_pts="255" spawn_int="15.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship7" start_pts="245" end_pts="255" spawn_int="15.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship4" start_pts="250" end_pts="260" spawn_int="15.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship3" start_pts="255" end_pts="280" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship8" start_pts="255" end_pts="280" spawn_int="11.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship12" start_pts="20" end_pts="280" spawn_int="7.0" spawn_int_var="1.0" max_pr_ships="1"/>
</ships>
<total_points>280</total_points>
<islands_set>islands_ice</islands_set>
</level>
<level index="14" num_ships="50">
<ships>
<ship type="ship2" start_pts="0" end_pts="5" spawn_int="7.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship7" start_pts="0" end_pts="10" spawn_int="16.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship8" start_pts="6" end_pts="13" spawn_int="3.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship4" start_pts="5" end_pts="20" spawn_int="3.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship12" start_pts="10" end_pts="25" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship3" start_pts="16" end_pts="30" spawn_int="4.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship1" start_pts="15" end_pts="24" spawn_int="7.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship0" start_pts="20" end_pts="30" spawn_int="15.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship4" start_pts="25" end_pts="35" spawn_int="15.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship7" start_pts="30" end_pts="40" spawn_int="15.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship3" start_pts="30" end_pts="45" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship13" start_pts="35" end_pts="45" spawn_int="12.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship8" start_pts="30" end_pts="50" spawn_int="15.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship4" start_pts="50" end_pts="64" spawn_int="15.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship3" start_pts="55" end_pts="65" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship12" start_pts="50" end_pts="74" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship11" start_pts="65" end_pts="75" spawn_int="7.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship3" start_pts="70" end_pts="80" spawn_int="7.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship9" start_pts="70" end_pts="90" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship0" start_pts="70" end_pts="95" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship12" start_pts="80" end_pts="95" spawn_int="7.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship1" start_pts="90" end_pts="95" spawn_int="5.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship6" start_pts="80" end_pts="110" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship12" start_pts="80" end_pts="90" spawn_int="3.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship4" start_pts="100" end_pts="130" spawn_int="10.0" spawn_int_var="5.0" max_pr_ships="1"/>
<ship type="ship8" start_pts="115" end_pts="130" spawn_int="15.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship3" start_pts="110" end_pts="135" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship13" start_pts="120" end_pts="140" spawn_int="15.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship11" start_pts="135" end_pts="145" spawn_int="6.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship8" start_pts="130" end_pts="150" spawn_int="3.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship13" start_pts="140" end_pts="155" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship0" start_pts="140" end_pts="155" spawn_int="15.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship3" start_pts="139" end_pts="180" spawn_int="13.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship1" start_pts="150" end_pts="155" spawn_int="12.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship4" start_pts="155" end_pts="200" spawn_int="15.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship9" start_pts="190" end_pts="200" spawn_int="15.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship12" start_pts="190" end_pts="210" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship8" start_pts="200" end_pts="220" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship0" start_pts="210" end_pts="225" spawn_int="4.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship3" start_pts="210" end_pts="235" spawn_int="15.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship8" start_pts="220" end_pts="230" spawn_int="4.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship14" start_pts="225" end_pts="235" spawn_int="5.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship/>
<ship type="ship12" start_pts="210" end_pts="230" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship3" start_pts="235" end_pts="240" spawn_int="8.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship8" start_pts="230" end_pts="245" spawn_int="15.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship9" start_pts="245" end_pts="255" spawn_int="15.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship4" start_pts="245" end_pts="255" spawn_int="15.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship2" start_pts="250" end_pts="260" spawn_int="15.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship3" start_pts="255" end_pts="280" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship9" start_pts="255" end_pts="280" spawn_int="11.0" spawn_int_var="1.0" max_pr_ships="2"/>
</ships>
<total_points>280</total_points>
<islands_set>islands_trop</islands_set>
</level>
<level index="15" num_ships="50" begin_event="devil">
<ships>
<ship type="ship15" start_pts="0" end_pts="5" spawn_int="1.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship7" start_pts="5" end_pts="15" spawn_int="15.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship0" start_pts="5" end_pts="13" spawn_int="3.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship12" start_pts="5" end_pts="20" spawn_int="3.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship13" start_pts="10" end_pts="25" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship3" start_pts="19" end_pts="30" spawn_int="4.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship15" start_pts="20" end_pts="25" spawn_int="7.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship8" start_pts="20" end_pts="30" spawn_int="15.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship1" start_pts="25" end_pts="35" spawn_int="5.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship11" start_pts="30" end_pts="40" spawn_int="15.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship4" start_pts="30" end_pts="45" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship12" start_pts="35" end_pts="45" spawn_int="12.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship8" start_pts="30" end_pts="50" spawn_int="15.0" spawn_int_var="1.0" max_pr_ships="3"/>
<ship type="ship15" start_pts="50" end_pts="64" spawn_int="15.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship3" start_pts="55" end_pts="65" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship4" start_pts="50" end_pts="74" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship7" start_pts="65" end_pts="75" spawn_int="15.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship3" start_pts="70" end_pts="80" spawn_int="7.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship13" start_pts="70" end_pts="90" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship9" start_pts="70" end_pts="95" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship2" start_pts="80" end_pts="95" spawn_int="7.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship8" start_pts="90" end_pts="95" spawn_int="5.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship11" start_pts="90" end_pts="100" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship15" start_pts="80" end_pts="90" spawn_int="5.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship8" start_pts="100" end_pts="130" spawn_int="10.0" spawn_int_var="5.0" max_pr_ships="2"/>
<ship type="ship9" start_pts="115" end_pts="130" spawn_int="5.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship3" start_pts="120" end_pts="140" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship12" start_pts="120" end_pts="140" spawn_int="15.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship14" start_pts="135" end_pts="145" spawn_int="6.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship15" start_pts="130" end_pts="150" spawn_int="3.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship8" start_pts="140" end_pts="155" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship1" start_pts="140" end_pts="155" spawn_int="15.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship0" start_pts="139" end_pts="180" spawn_int="13.0" spawn_int_var="1.0" max_pr_ships="3"/>
<ship type="ship13" start_pts="150" end_pts="155" spawn_int="12.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship15" start_pts="155" end_pts="200" spawn_int="7.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship7" start_pts="190" end_pts="200" spawn_int="3.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship4" start_pts="190" end_pts="210" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship8" start_pts="200" end_pts="220" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship3" start_pts="210" end_pts="225" spawn_int="4.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship11" start_pts="225" end_pts="235" spawn_int="15.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship15" start_pts="210" end_pts="230" spawn_int="14.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship12" start_pts="225" end_pts="235" spawn_int="5.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship3" start_pts="210" end_pts="230" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship9" start_pts="235" end_pts="240" spawn_int="8.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship8" start_pts="230" end_pts="245" spawn_int="15.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship12" start_pts="245" end_pts="255" spawn_int="15.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship6" start_pts="245" end_pts="255" spawn_int="15.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship3" start_pts="250" end_pts="260" spawn_int="15.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship15" start_pts="255" end_pts="280" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship1" start_pts="270" end_pts="280" spawn_int="11.0" spawn_int_var="1.0" max_pr_ships="2"/>
</ships>
<total_points>280</total_points>
<islands_set>islands_rock</islands_set>
</level>
<level index="16" num_ships="52">
<ships>
<ship type="ship7" start_pts="0" end_pts="5" spawn_int="1.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship15" start_pts="0" end_pts="15" spawn_int="15.0" spawn_int_var="1.0" max_pr_ships="3"/>
<ship type="ship12" start_pts="5" end_pts="13" spawn_int="8.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship11" start_pts="15" end_pts="25" spawn_int="3.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship8" start_pts="10" end_pts="40" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship3" start_pts="24" end_pts="30" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship12" start_pts="20" end_pts="25" spawn_int="7.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship15" start_pts="20" end_pts="30" spawn_int="9.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship7" start_pts="30" end_pts="35" spawn_int="1.0" spawn_int_var="0.0" max_pr_ships="1"/>
<ship type="ship12" start_pts="30" end_pts="40" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship16" start_pts="30" end_pts="45" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship12" start_pts="35" end_pts="45" spawn_int="12.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship4" start_pts="30" end_pts="50" spawn_int="12.0" spawn_int_var="1.0" max_pr_ships="3"/>
<ship type="ship0" start_pts="50" end_pts="64" spawn_int="11.0" spawn_int_var="1.0" max_pr_ships="3"/>
<ship type="ship3" start_pts="55" end_pts="65" spawn_int="7.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship9" start_pts="50" end_pts="74" spawn_int="9.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship13" start_pts="65" end_pts="75" spawn_int="7.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship16" start_pts="70" end_pts="80" spawn_int="7.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship3" start_pts="70" end_pts="90" spawn_int="1.0" spawn_int_var="0.0" max_pr_ships="1"/>
<ship type="ship4" start_pts="60" end_pts="95" spawn_int="8.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship1" start_pts="85" end_pts="95" spawn_int="7.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship14" start_pts="95" end_pts="105" spawn_int="1.0" spawn_int_var="0.0" max_pr_ships="1"/>
<ship type="ship3" start_pts="90" end_pts="120" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship12" start_pts="90" end_pts="120" spawn_int="5.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship15" start_pts="100" end_pts="130" spawn_int="6.0" spawn_int_var="0.0" max_pr_ships="2"/>
<ship type="ship8" start_pts="115" end_pts="130" spawn_int="5.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship4" start_pts="110" end_pts="140" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship13" start_pts="120" end_pts="140" spawn_int="15.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship1" start_pts="135" end_pts="145" spawn_int="6.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship9" start_pts="130" end_pts="150" spawn_int="3.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship11" start_pts="145" end_pts="155" spawn_int="1.0" spawn_int_var="0.0" max_pr_ships="1"/>
<ship type="ship0" start_pts="140" end_pts="155" spawn_int="15.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship3" start_pts="139" end_pts="180" spawn_int="13.0" spawn_int_var="1.0" max_pr_ships="3"/>
<ship type="ship9" start_pts="150" end_pts="155" spawn_int="12.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship12" start_pts="155" end_pts="200" spawn_int="15.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship7" start_pts="190" end_pts="195" spawn_int="1.0" spawn_int_var="0.0" max_pr_ships="1"/>
<ship type="ship15" start_pts="180" end_pts="210" spawn_int="3.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship4" start_pts="190" end_pts="220" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship9" start_pts="210" end_pts="225" spawn_int="4.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship7" start_pts="225" end_pts="230" spawn_int="15.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship3" start_pts="210" end_pts="230" spawn_int="14.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship13" start_pts="225" end_pts="235" spawn_int="5.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship8" start_pts="210" end_pts="240" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship4" start_pts="235" end_pts="240" spawn_int="8.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship15" start_pts="230" end_pts="245" spawn_int="15.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship14" start_pts="240" end_pts="250" spawn_int="1.0" spawn_int_var="0.0" max_pr_ships="1"/>
<ship type="ship2" start_pts="235" end_pts="255" spawn_int="15.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship3" start_pts="240" end_pts="260" spawn_int="15.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship1" start_pts="255" end_pts="260" spawn_int="6.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship13" start_pts="270" end_pts="280" spawn_int="7.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship8" start_pts="255" end_pts="280" spawn_int="7.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship17" start_pts="280" end_pts="285" spawn_int="1.0" spawn_int_var="0.0" max_pr_ships="1" is_boss="true" spawn_event="bigfort"/>
</ships>
<total_points>285</total_points>
<islands_set>islands_trop</islands_set>
</level>
<level index="17" num_ships="63">
<ships>
<ship type="ship12" start_pts="0" end_pts="5" spawn_int="1.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship16" start_pts="0" end_pts="15" spawn_int="15.0" spawn_int_var="1.0" max_pr_ships="3"/>
<ship type="ship4" start_pts="0" end_pts="13" spawn_int="8.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship7" start_pts="10" end_pts="15" spawn_int="1.0" spawn_int_var="0.0" max_pr_ships="1"/>
<ship type="ship8" start_pts="5" end_pts="30" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship11" start_pts="25" end_pts="35" spawn_int="1.0" spawn_int_var="0.0" max_pr_ships="1"/>
<ship type="ship3" start_pts="20" end_pts="40" spawn_int="7.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship15" start_pts="20" end_pts="30" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship9" start_pts="30" end_pts="40" spawn_int="5.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship12" start_pts="30" end_pts="50" spawn_int="15.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship9" start_pts="30" end_pts="50" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship0" start_pts="35" end_pts="45" spawn_int="12.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship8" start_pts="40" end_pts="60" spawn_int="15.0" spawn_int_var="1.0" max_pr_ships="3"/>
<ship type="ship4" start_pts="50" end_pts="64" spawn_int="13.0" spawn_int_var="1.0" max_pr_ships="3"/>
<ship type="ship3" start_pts="55" end_pts="65" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship11" start_pts="60" end_pts="70" spawn_int="1.0" spawn_int_var="0.0" max_pr_ships="1" nearest_line="5" farthest_line="5"/>
<ship type="ship7" start_pts="65" end_pts="70" spawn_int="1.0" spawn_int_var="0.0" max_pr_ships="1" nearest_line="2" farthest_line="2"/>
<ship type="ship12" start_pts="75" end_pts="80" spawn_int="7.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship3" start_pts="70" end_pts="90" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship8" start_pts="60" end_pts="95" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship14" start_pts="85" end_pts="95" spawn_int="1.0" spawn_int_var="0.0" max_pr_ships="1"/>
<ship type="ship1" start_pts="95" end_pts="105" spawn_int="5.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship15" start_pts="90" end_pts="120" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship3" start_pts="90" end_pts="120" spawn_int="5.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship9" start_pts="100" end_pts="130" spawn_int="10.0" spawn_int_var="5.0" max_pr_ships="2"/>
<ship type="ship12" start_pts="115" end_pts="130" spawn_int="5.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship4" start_pts="110" end_pts="140" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship0" start_pts="120" end_pts="140" spawn_int="15.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship9" start_pts="135" end_pts="145" spawn_int="6.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship3" start_pts="130" end_pts="150" spawn_int="3.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship14" start_pts="145" end_pts="155" spawn_int="1.0" spawn_int_var="0.0" max_pr_ships="1"/>
<ship type="ship3" start_pts="140" end_pts="155" spawn_int="15.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship16" start_pts="130" end_pts="180" spawn_int="13.0" spawn_int_var="1.0" max_pr_ships="3"/>
<ship type="ship7" start_pts="150" end_pts="155" spawn_int="1.0" spawn_int_var="0.0" max_pr_ships="1"/>
<ship type="ship8" start_pts="155" end_pts="200" spawn_int="15.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship13" start_pts="190" end_pts="195" spawn_int="3.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship2" start_pts="180" end_pts="210" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship16" start_pts="190" end_pts="220" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship11" start_pts="215" end_pts="225" spawn_int="1.0" spawn_int_var="100" max_pr_ships="1"/>
<ship type="ship8" start_pts="220" end_pts="230" spawn_int="15.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship4" start_pts="210" end_pts="230" spawn_int="14.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship3" start_pts="225" end_pts="235" spawn_int="5.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship13" start_pts="210" end_pts="240" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship7" start_pts="235" end_pts="240" spawn_int="1.0" spawn_int_var="0.0" max_pr_ships="1"/>
<ship type="ship15" start_pts="230" end_pts="245" spawn_int="15.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship8" start_pts="240" end_pts="280" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship4" start_pts="255" end_pts="280" spawn_int="15.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship3" start_pts="260" end_pts="280" spawn_int="15.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship1" start_pts="270" end_pts="280" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship12" start_pts="270" end_pts="290" spawn_int="11.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship14" start_pts="285" end_pts="290" spawn_int="1.0" spawn_int_var="0.0" max_pr_ships="1"/>
<ship type="ship8" start_pts="280" end_pts="300" spawn_int="8.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship13" start_pts="290" end_pts="300" spawn_int="7.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship4" start_pts="290" end_pts="320" spawn_int="11.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship0" start_pts="300" end_pts="330" spawn_int="7.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship1" start_pts="325" end_pts="330" spawn_int="3.0" spawn_int_var="1.0" max_pr_ships="3"/>
<ship type="ship15" start_pts="320" end_pts="350" spawn_int="7.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship13" start_pts="340" end_pts="365" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship14" start_pts="370" end_pts="380" spawn_int="1.0" spawn_int_var="0.0" max_pr_ships="1"/>
<ship type="ship8" start_pts="365" end_pts="400" spawn_int="7.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship15" start_pts="380" end_pts="400" spawn_int="2.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship3" start_pts="380" end_pts="400" spawn_int="6.0" spawn_int_var="0.0" max_pr_ships="2"/>
<ship type="ship1" start_pts="390" end_pts="400" spawn_int="3.0" spawn_int_var="0.0" max_pr_ships="3"/>
</ships>
<total_points>400</total_points>
<islands_set>islands_rock</islands_set>
</level>
<level index="18" num_ships="64">
<ships>
<ship type="ship9" start_pts="0" end_pts="15" spawn_int="5.0" spawn_int_var="1.0" max_pr_ships="3"/>
<ship type="ship3" start_pts="5" end_pts="15" spawn_int="15.0" spawn_int_var="1.0" max_pr_ships="3"/>
<ship type="ship7" start_pts="10" end_pts="15" spawn_int="8.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship12" start_pts="10" end_pts="15" spawn_int="3.0" spawn_int_var="1.0" max_pr_ships="3"/>
<ship type="ship15" start_pts="5" end_pts="30" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="3"/>
<ship type="ship7" start_pts="20" end_pts="35" spawn_int="14.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship8" start_pts="20" end_pts="40" spawn_int="7.0" spawn_int_var="1.0" max_pr_ships="3"/>
<ship type="ship16" start_pts="20" end_pts="30" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="3"/>
<ship type="ship11" start_pts="30" end_pts="40" spawn_int="5.0" spawn_int_var="1.0" max_pr_ships="3"/>
<ship type="ship4" start_pts="25" end_pts="50" spawn_int="15.0" spawn_int_var="1.0" max_pr_ships="3"/>
<ship type="ship16" start_pts="30" end_pts="50" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="3"/>
<ship type="ship1" start_pts="35" end_pts="40" spawn_int="12.0" spawn_int_var="1.0" max_pr_ships="3"/>
<ship type="ship8" start_pts="35" end_pts="60" spawn_int="15.0" spawn_int_var="1.0" max_pr_ships="3"/>
<ship type="ship3" start_pts="40" end_pts="64" spawn_int="13.0" spawn_int_var="1.0" max_pr_ships="3"/>
<ship type="ship12" start_pts="50" end_pts="65" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="3"/>
<ship type="ship16" start_pts="50" end_pts="70" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="3" nearest_line="5" farthest_line="5"/>
<ship type="ship14" start_pts="60" end_pts="70" spawn_int="15.0" spawn_int_var="1.0" max_pr_ships="3" nearest_line="2" farthest_line="2"/>
<ship type="ship3" start_pts="50" end_pts="80" spawn_int="7.0" spawn_int_var="1.0" max_pr_ships="3"/>
<ship type="ship8" start_pts="60" end_pts="90" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="3"/>
<ship type="ship4" start_pts="60" end_pts="95" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="3"/>
<ship type="ship16" start_pts="80" end_pts="95" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="3"/>
<ship type="ship1" start_pts="95" end_pts="100" spawn_int="5.0" spawn_int_var="1.0" max_pr_ships="3"/>
<ship type="ship15" start_pts="75" end_pts="120" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="3"/>
<ship type="ship8" start_pts="90" end_pts="120" spawn_int="5.0" spawn_int_var="1.0" max_pr_ships="3"/>
<ship type="ship9" start_pts="100" end_pts="130" spawn_int="10.0" spawn_int_var="5.0" max_pr_ships="3"/>
<ship type="ship3" start_pts="115" end_pts="130" spawn_int="5.0" spawn_int_var="1.0" max_pr_ships="3"/>
<ship type="ship11" start_pts="130" end_pts="140" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship1" start_pts="120" end_pts="125" spawn_int="15.0" spawn_int_var="1.0" max_pr_ships="3"/>
<ship type="ship12" start_pts="125" end_pts="145" spawn_int="6.0" spawn_int_var="1.0" max_pr_ships="3"/>
<ship type="ship4" start_pts="120" end_pts="150" spawn_int="3.0" spawn_int_var="1.0" max_pr_ships="3"/>
<ship type="ship0" start_pts="145" end_pts="155" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="3"/>
<ship type="ship16" start_pts="130" end_pts="155" spawn_int="15.0" spawn_int_var="1.0" max_pr_ships="3"/>
<ship type="ship8" start_pts="130" end_pts="180" spawn_int="13.0" spawn_int_var="1.0" max_pr_ships="3"/>
<ship type="ship14" start_pts="150" end_pts="160" spawn_int="12.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship4" start_pts="155" end_pts="200" spawn_int="15.0" spawn_int_var="1.0" max_pr_ships="3"/>
<ship type="ship1" start_pts="190" end_pts="195" spawn_int="3.0" spawn_int_var="1.0" max_pr_ships="3"/>
<ship type="ship8" start_pts="180" end_pts="210" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="3"/>
<ship type="ship15" start_pts="190" end_pts="220" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="3"/>
<ship type="ship9" start_pts="215" end_pts="225" spawn_int="4.0" spawn_int_var="1.0" max_pr_ships="3"/>
<ship type="ship13" start_pts="220" end_pts="230" spawn_int="15.0" spawn_int_var="1.0" max_pr_ships="3"/>
<ship type="ship11" start_pts="220" end_pts="230" spawn_int="14.0" spawn_int_var="1.0" max_pr_ships="3"/>
<ship type="ship3" start_pts="225" end_pts="235" spawn_int="5.0" spawn_int_var="1.0" max_pr_ships="3"/>
<ship type="ship15" start_pts="210" end_pts="240" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="3"/>
<ship type="ship8" start_pts="235" end_pts="240" spawn_int="8.0" spawn_int_var="1.0" max_pr_ships="3"/>
<ship type="ship12" start_pts="230" end_pts="245" spawn_int="15.0" spawn_int_var="1.0" max_pr_ships="3"/>
<ship type="ship15" start_pts="240" end_pts="280" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="3"/>
<ship type="ship6" start_pts="255" end_pts="280" spawn_int="15.0" spawn_int_var="1.0" max_pr_ships="3"/>
<ship type="ship13" start_pts="260" end_pts="280" spawn_int="15.0" spawn_int_var="1.0" max_pr_ships="3"/>
<ship type="ship3" start_pts="270" end_pts="280" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="3"/>
<ship type="ship12" start_pts="265" end_pts="290" spawn_int="11.0" spawn_int_var="1.0" max_pr_ships="3"/>
<ship type="ship9" start_pts="270" end_pts="310" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship15" start_pts="300" end_pts="310" spawn_int="8.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship11" start_pts="305" end_pts="315" spawn_int="1.0" spawn_int_var="0.0" max_pr_ships="1"/>
<ship type="ship3" start_pts="300" end_pts="335" spawn_int="5.0" spawn_int_var="1.0" max_pr_ships="3"/>
<ship type="ship15" start_pts="310" end_pts="340" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="3"/>
<ship type="ship8" start_pts="335" end_pts="340" spawn_int="8.0" spawn_int_var="1.0" max_pr_ships="3"/>
<ship type="ship12" start_pts="330" end_pts="345" spawn_int="15.0" spawn_int_var="1.0" max_pr_ships="3"/>
<ship type="ship15" start_pts="340" end_pts="380" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="3"/>
<ship type="ship6" start_pts="355" end_pts="380" spawn_int="15.0" spawn_int_var="1.0" max_pr_ships="3"/>
<ship type="ship13" start_pts="360" end_pts="380" spawn_int="15.0" spawn_int_var="1.0" max_pr_ships="3"/>
<ship type="ship3" start_pts="370" end_pts="380" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="3"/>
<ship type="ship12" start_pts="365" end_pts="390" spawn_int="11.0" spawn_int_var="1.0" max_pr_ships="3"/>
<ship type="ship9" start_pts="370" end_pts="410" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship15" start_pts="400" end_pts="410" spawn_int="8.0" spawn_int_var="1.0" max_pr_ships="2"/>
</ships>
<total_points>410</total_points>
<islands_set>islands_ice</islands_set>
</level>
<level index="19" num_ships="37">
<ships>
<ship type="ship4" start_pts="0" end_pts="40" spawn_int="5.0" spawn_int_var="1.0" max_pr_ships="3"/>
<ship type="ship3" start_pts="5" end_pts="40" spawn_int="15.0" spawn_int_var="1.0" max_pr_ships="3"/>
<ship type="ship13" start_pts="10" end_pts="40" spawn_int="8.0" spawn_int_var="1.0" max_pr_ships="3"/>
<ship type="ship15" start_pts="15" end_pts="40" spawn_int="7.0" spawn_int_var="1.0" max_pr_ships="3"/>
<ship type="ship8" start_pts="20" end_pts="40" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship11" start_pts="20" end_pts="30" spawn_int="1.0" spawn_int_var="0.0" max_pr_ships="1" nearest_line="4" farthest_line="4"/>
<ship type="ship0" start_pts="30" end_pts="40" spawn_int="7.0" spawn_int_var="1.0" max_pr_ships="3"/>
<ship type="ship1" start_pts="30" end_pts="40" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="3"/>
<ship type="ship9" start_pts="30" end_pts="60" spawn_int="5.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship12" start_pts="50" end_pts="70" spawn_int="15.0" spawn_int_var="1.0" max_pr_ships="3"/>
<ship type="ship16" start_pts="55" end_pts="80" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship15" start_pts="60" end_pts="70" spawn_int="12.0" spawn_int_var="1.0" max_pr_ships="1" nearest_line="4" farthest_line="4"/>
<ship type="ship8" start_pts="55" end_pts="90" spawn_int="15.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship3" start_pts="70" end_pts="100" spawn_int="13.0" spawn_int_var="1.0" max_pr_ships="3"/>
<ship type="ship12" start_pts="70" end_pts="101" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="3"/>
<ship type="ship15" start_pts="95" end_pts="100" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="3" nearest_line="5" farthest_line="5"/>
<ship type="ship14" start_pts="105" end_pts="115" spawn_int="1.0" spawn_int_var="0.0" max_pr_ships="1" nearest_line="3" farthest_line="3"/>
<ship type="ship3" start_pts="100" end_pts="120" spawn_int="7.0" spawn_int_var="1.0" max_pr_ships="3"/>
<ship type="ship15" start_pts="115" end_pts="120" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="3" nearest_line="1" farthest_line="1"/>
<ship type="ship9" start_pts="110" end_pts="140" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="3"/>
<ship type="ship15" start_pts="130" end_pts="150" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="3"/>
<ship type="ship7" start_pts="140" end_pts="145" spawn_int="1.0" spawn_int_var="0.0" max_pr_ships="1"/>
<ship type="ship15" start_pts="135" end_pts="140" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship8" start_pts="130" end_pts="170" spawn_int="5.0" spawn_int_var="1.0" max_pr_ships="2"/>
<ship type="ship6" start_pts="150" end_pts="180" spawn_int="10.0" spawn_int_var="5.0" max_pr_ships="3"/>
<ship type="ship14" start_pts="170" end_pts="180" spawn_int="1.0" spawn_int_var="0.0" max_pr_ships="1"/>
<ship type="ship9" start_pts="160" end_pts="200" spawn_int="10.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship0" start_pts="170" end_pts="200" spawn_int="15.0" spawn_int_var="1.0" max_pr_ships="3"/>
<ship type="ship12" start_pts="180" end_pts="200" spawn_int="6.0" spawn_int_var="1.0" max_pr_ships="3"/>
<ship type="ship15" start_pts="180" end_pts="200" spawn_int="3.0" spawn_int_var="1.0" max_pr_ships="3"/>
<ship type="ship15" start_pts="185" end_pts="195" spawn_int="10.0" spawn_int_var="0.0" max_pr_ships="2"/>
<ship type="ship3" start_pts="200" end_pts="210" spawn_int="1.0" spawn_int_var="0.0" max_pr_ships="1"/>
<ship/>
<ship type="ship0" start_pts="195" end_pts="210" spawn_int="13.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship2" start_pts="208" end_pts="220" spawn_int="12.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship9" start_pts="215" end_pts="225" spawn_int="15.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship3" start_pts="195" end_pts="225" spawn_int="4.0" spawn_int_var="1.0" max_pr_ships="1"/>
<ship type="ship18" start_pts="225" end_pts="230" spawn_int="1.0" spawn_int_var="0.0" max_pr_ships="1" is_boss="true" spawn_event="gethimboss"/>
</ships>
<total_points>230</total_points>
<islands_set>islands_ice</islands_set>
</level>
</levels>
;
}
}//package config
Section 6
//ShipsXML (config.ShipsXML)
package config {
public class ShipsXML {
public static var SHIPS:XML = <ships>
<ship index="0" frames="Ship_Small" type="ship0">
<params num_alive_frames="5" hp_h_frames_b="0" hp_m_frames_b="5" hp_l_frames_b="10" num_death_frames="12" death_frames_b="15" death_fps="12.0" size="40.0,40.0" water_offset="5.3125" hit_points="40.0" speed="10.0" speed_var="2.5" death_sound="enemydie.aif" nearest_line="0" farthest_line="3" reload_time="5.0" reload_time_var="1.0" shot_time_interval="0.5" rob_money="25" rob_rp="5" rob_score="10" kill_money="35" kill_score="10" spawn_points="2"/>
<cannons>
<cannon pos="0.275,0.825" accuracy="0.5" damage="10"/>
</cannons>
<vertexes>
<vertex>0.04237470031,0.1245853593,0</vertex>
<vertex>0.6901003122,0.1227788617,0</vertex>
<vertex>0.2573524714,1.003547518,0</vertex>
<vertex>0.4986076057,0.978256016,0</vertex>
<vertex>-0.0009821355343,0.478256016,0</vertex>
<vertex>0.9448218346,0.3138612797,0</vertex>
</vertexes>
<indexes>
<index>5</index>
<index>3</index>
<index>4</index>
<index>4</index>
<index>5</index>
<index>2</index>
<index>0</index>
<index>1</index>
<index>4</index>
<index>4</index>
<index>1</index>
<index>5</index>
</indexes>
</ship>
<ship index="1" frames="Ship_Bonus" type="ship1">
<params num_alive_frames="5" hp_h_frames_b="0" hp_m_frames_b="0" hp_l_frames_b="0" num_death_frames="11" death_frames_b="6" death_fps="12.0" death_sound="enemydie.aif" size="30.0,30.0" water_offset="3.164" hit_points="10.0" speed="12.0" speed_var="2.5" nearest_line="0" farthest_line="2" reload_time="5.0" reload_time_var="1.0" shot_time_interval="0.5" kill_money="75" kill_score="50" kill_achievment="gold_rush" rob_money="50" rob_rp="5" rob_score="15" spawn_points="1"/>
<vertexes>
<vertex>0.04237470031,0.1245853593,0</vertex>
<vertex>0.6901003122,0.1227788617,0</vertex>
<vertex>0.2573524714,1.003547518,0</vertex>
<vertex>0.4986076057,0.978256016,0</vertex>
<vertex>-0.0009821355343,0.478256016,0</vertex>
<vertex>0.9448218346,0.3138612797,0</vertex>
</vertexes>
<indexes>
<index>5</index>
<index>3</index>
<index>4</index>
<index>4</index>
<index>5</index>
<index>2</index>
<index>0</index>
<index>1</index>
<index>4</index>
<index>4</index>
<index>1</index>
<index>5</index>
</indexes>
</ship>
<ship index="2" frames="Ship_Pirate" type="ship2">
<params num_alive_frames="5" hp_h_frames_b="0" hp_m_frames_b="5" hp_l_frames_b="10" num_death_frames="12" death_frames_b="15" death_sound="enemydie.aif" death_fps="12.0" size="40.0,40.0" water_offset="7.03" hit_points="100.0" speed="7.0" speed_var="1" reload_time="5.0" reload_time_var="1.0" shot_time_interval="0.5" rob_money="30" rob_rp="10" rob_score="15" kill_money="50" kill_score="25" spawn_points="4"/>
<cannons>
<cannon pos="0.275,0.825" accuracy="0.5" damage="10"/>
<cannon pos="0.35,0.825" accuracy="0.5" damage="10"/>
<cannon pos="0.425,0.825" accuracy="0.5" damage="10"/>
<cannon pos="0.5,0.825" accuracy="0.5" damage="10"/>
</cannons>
<vertexes>
<vertex>0.04237470031,0.1245853593,0</vertex>
<vertex>0.6901003122,0.1227788617,0</vertex>
<vertex>0.2573524714,1.003547518,0</vertex>
<vertex>0.4986076057,0.978256016,0</vertex>
<vertex>-0.0009821355343,0.478256016,0</vertex>
<vertex>0.9448218346,0.3138612797,0</vertex>
</vertexes>
<idexes>
<index>5</index>
<index>3</index>
<index>4</index>
<index>4</index>
<index>5</index>
<index>2</index>
<index>0</index>
<index>1</index>
<index>4</index>
<index>4</index>
<index>1</index>
<index>5</index>
</idexes>
</ship>
<ship index="3" frames="Ship_Unarmed" type="ship3">
<params num_alive_frames="5" hp_h_frames_b="0" hp_m_frames_b="5" hp_l_frames_b="10" num_death_frames="12" death_frames_b="15" death_fps="12.0" size="50.0,50.0" water_offset="9.8" hit_points="100.0" speed="5.0" speed_var="1" death_sound="enemydie.aif" reload_time="5.0" reload_time_var="1.0" shot_time_interval="0.5" rob_money="25" rob_rp="15" rob_score="20" kill_money="45" kill_score="20" spawn_points="1"/>
<cannons>
<cannon pos="0.441,0.734" accuracy="1.0" damage="0" ball_type="CannonRum"/>
</cannons>
<vertexes>
<vertex>0.07745049116,0.1911758703,0</vertex>
<vertex>0.7893831056,0.1907264513,0</vertex>
<vertex>0.1594479602,0.7567629737,0</vertex>
<vertex>0.6744460386,0.8077543897,0</vertex>
<vertex>0.01583402199,0.3785322827,0</vertex>
<vertex>0.9562048238,0.5227644366,0</vertex>
</vertexes>
<indexes>
<index>5</index>
<index>3</index>
<index>4</index>
<index>4</index>
<index>3</index>
<index>2</index>
<index>0</index>
<index>1</index>
<index>4</index>
<index>4</index>
<index>1</index>
<index>5</index>
</indexes>
</ship>
<ship index="4" frames="Ship_Pirate" type="ship4">
<params num_alive_frames="5" hp_h_frames_b="0" hp_m_frames_b="5" hp_l_frames_b="10" num_death_frames="12" death_frames_b="15" death_fps="12.0" death_sound="enemydie.aif" size="50.0,50.0" water_offset="7.03" hit_points="100.0" speed="7.0" speed_var="1" reload_time="5.0" reload_time_var="1.0" shot_time_interval="0.5" rob_money="30" rob_rp="10" rob_score="15" kill_money="50" kill_score="25" spawn_points="4"/>
<cannons>
<cannon pos="0.275,0.825" accuracy="0.5" damage="10"/>
<cannon pos="0.35,0.825" accuracy="0.5" damage="10"/>
<cannon pos="0.425,0.825" accuracy="0.5" damage="10"/>
<cannon pos="0.5,0.825" accuracy="0.5" damage="10"/>
</cannons>
<ball_type>CannonMonkey</ball_type>
<vertexes>
<vertex>0.04237470031,0.1245853593,0</vertex>
<vertex>0.6901003122,0.1227788617,0</vertex>
<vertex>0.2573524714,1.003547518,0</vertex>
<vertex>0.4986076057,0.978256016,0</vertex>
<vertex>-0.0009821355343,0.478256016,0</vertex>
<vertex>0.9448218346,0.3138612797,0</vertex>
</vertexes>
<indexes>
<index>5</index>
<index>3</index>
<index>4</index>
<index>4</index>
<index>5</index>
<index>2</index>
<index>0</index>
<index>1</index>
<index>4</index>
<index>4</index>
<index>1</index>
<index>5</index>
</indexes>
</ship>
<ship index="5" frames="Boss_Madseller" type="ship5">
<params num_alive_frames="5" hp_h_frames_b="0" hp_m_frames_b="5" hp_l_frames_b="10" num_death_frames="9" death_frames_b="15" death_fps="8.0" size="30,19.2" water_offset="8.125" hit_points="3500.0" speed="5.0" speed_var="1" death_sound="enemydie.aif" reload_time="6.0" reload_time_var="0.0" shot_time_interval="0.1" rob_money="100" rob_rp="25" rob_score="25" kill_money="300" kill_score="300" kill_achievment="sea_of_rum" spawn_points="5"/>
<cannons>
<cannon pos="0.241,0.734" accuracy="0.8" damage="0"/>
<cannon pos="0.341,0.734" accuracy="0.8" damage="0"/>
<cannon pos="0.441,0.734" accuracy="0.8" damage="0"/>
<cannon pos="0.541,0.734" accuracy="0.8" damage="0"/>
<cannon pos="0.641,0.734" accuracy="0.8" damage="0"/>
</cannons>
<ball_type>CannonRum</ball_type>
<vertexes>
<vertex>0.1540808302,0.08435735841,0</vertex>
<vertex>0.6779208106,0.08158572007,0</vertex>
<vertex>0.2616217655,0.8589369616,0</vertex>
<vertex>0.5722721141,0.7822110615,0</vertex>
<vertex>0.1598061245,0.2879690639,0</vertex>
<vertex>0.802944116,0.3532497248,0</vertex>
</vertexes>
<indexes>
<index>5</index>
<index>3</index>
<index>4</index>
<index>4</index>
<index>3</index>
<index>2</index>
<index>1</index>
<index>4</index>
<index>0</index>
<index>4</index>
<index>1</index>
<index>5</index>
</indexes>
</ship>
<ship index="6" frames="Ship_Pirate" type="ship6">
<params num_alive_frames="5" hp_h_frames_b="0" hp_m_frames_b="5" hp_l_frames_b="10" num_death_frames="12" death_frames_b="15" death_fps="12.0" death_sound="enemydie.aif" size="50.0,50.0" water_offset="7.03" hit_points="100.0" speed="7.0" speed_var="1" reload_time="5.0" reload_time_var="1.0" shot_time_interval="0.5" rob_money="30" rob_rp="10" rob_score="15" kill_money="50" kill_score="25" spawn_points="4"/>
<cannons>
<cannon pos="0.275,0.825" accuracy="0.5" damage="10"/>
<cannon pos="0.35,0.825" accuracy="0.5" damage="10"/>
<cannon pos="0.425,0.825" accuracy="0.5" damage="10"/>
<cannon pos="0.5,0.825" accuracy="0.5" damage="10" ball_type="CannonFlame"/>
</cannons>
<vertexes>
<vertex>0.04237470031,0.1245853593,0</vertex>
<vertex>0.6901003122,0.1227788617,0</vertex>
<vertex>0.2573524714,1.003547518,0</vertex>
<vertex>0.4986076057,0.978256016,0</vertex>
<vertex>-0.0009821355343,0.478256016,0</vertex>
<vertex>0.9448218346,0.3138612797,0</vertex>
</vertexes>
<indexes>
<index>5</index>
<index>3</index>
<index>4</index>
<index>4</index>
<index>5</index>
<index>2</index>
<index>0</index>
<index>1</index>
<index>4</index>
<index>4</index>
<index>1</index>
<index>5</index>
</indexes>
</ship>
<ship index="7" frames="Fort_Small" type="ship7">
<params num_alive_frames="1" hp_h_frames_b="0" hp_m_frames_b="1" hp_l_frames_b="2" num_death_frames="1" death_frames_b="3" death_fps="1.0" size="22.0,22.0" water_offset="8.00" hit_points="600.0" speed="1.0" speed_var="2.5" death_sound="fortdie.aif" nearest_line="1" farthest_line="3" reload_time="3.0" reload_time_var="1.0" shot_time_interval="0.5" rob_money="50" rob_rp="25" rob_score="50" kill_money="125" kill_score="100" fort="true" spawn_points="5"/>
<cannons>
<cannon pos="0.5,0.57" accuracy="0.5" damage="10"/>
<cannon pos="0.5,0.57" accuracy="0.5" damage="10"/>
</cannons>
<vertexes>
<vertex>0.1215710264,0.1470553837,0</vertex>
<vertex>0.8892347735,0.1419617495,0</vertex>
<vertex>0.3568292778,0.7823064885,0</vertex>
<vertex>0.6674795073,0.7706003151,0</vertex>
<vertex>0.3130671304,0.3437002263,0</vertex>
<vertex>0.707736544,0.3509271107,0</vertex>
</vertexes>
<indexes>
<index>5</index>
<index>3</index>
<index>4</index>
<index>4</index>
<index>3</index>
<index>2</index>
<index>0</index>
<index>1</index>
<index>4</index>
<index>4</index>
<index>1</index>
<index>5</index>
</indexes>
</ship>
<ship index="8" frames="Ship_Large" type="ship8">
<params num_alive_frames="5" hp_h_frames_b="0" hp_m_frames_b="5" hp_l_frames_b="10" num_death_frames="12" death_frames_b="15" death_fps="8.0" size="70.0,50.0" water_offset="5.664" hit_points="250.0" speed="8.0" speed_var="1" death_sound="enemydie.aif" reload_time="5.0" reload_time_var="1.0" shot_time_interval="0.5" rob_money="35" rob_rp="25" rob_score="15" kill_money="75" kill_score="70" spawn_points="5"/>
<cannons>
<cannon pos="0.275,0.825" accuracy="0.5" damage="10"/>
<cannon pos="0.35,0.825" accuracy="0.5" damage="10"/>
<cannon pos="0.425,0.825" accuracy="0.5" damage="10"/>
<cannon pos="0.5,0.825" accuracy="0.5" damage="10"/>
<cannon pos="0.55,0.825" accuracy="0.5" damage="10"/>
<cannon pos="0.6,0.825" accuracy="0.5" damage="10"/>
</cannons>
<vertexes>
<vertex>0.07048408655,0.1145454568,0</vertex>
<vertex>0.7870609683,0.1048075479,0</vertex>
<vertex>0.1594479602,0.7567629737,0</vertex>
<vertex>0.6094261926,0.8890291971,0</vertex>
<vertex>0.01583402199,0.3785322827,0</vertex>
<vertex>0.9678155106,0.3602156562,0</vertex>
</vertexes>
<indexes>
<index>5</index>
<index>3</index>
<index>4</index>
<index>4</index>
<index>3</index>
<index>2</index>
<index>0</index>
<index>1</index>
<index>4</index>
<index>4</index>
<index>1</index>
<index>5</index>
</indexes>
</ship>
<ship index="9" frames="Ship_Large" type="ship9">
<params num_alive_frames="5" hp_h_frames_b="0" hp_m_frames_b="5" hp_l_frames_b="10" num_death_frames="12" death_frames_b="15" death_fps="8.0" size="70.0,50.0" water_offset="5.664" hit_points="250.0" speed="8.0" speed_var="1" death_sound="enemydie.aif" reload_time="5.0" reload_time_var="1.0" shot_time_interval="0.5" rob_money="35" rob_rp="25" rob_score="15" kill_money="75" kill_score="70" spawn_points="5"/>
<cannons>
<cannon pos="0.275,0.825" accuracy="0.5" damage="10"/>
<cannon pos="0.35,0.825" accuracy="0.5" damage="10"/>
<cannon pos="0.425,0.825" accuracy="0.5" damage="10" ball_type="CannonFlame"/>
<cannon pos="0.5,0.825" accuracy="0.5" damage="10"/>
<cannon pos="0.55,0.825" accuracy="0.5" damage="10"/>
<cannon pos="0.6,0.825" accuracy="0.5" damage="10"/>
</cannons>
<vertexes>
<vertex>0.07048408655,0.1145454568,0</vertex>
<vertex>0.7870609683,0.1048075479,0</vertex>
<vertex>0.1594479602,0.7567629737,0</vertex>
<vertex>0.6094261926,0.8890291971,0</vertex>
<vertex>0.01583402199,0.3785322827,0</vertex>
<vertex>0.9678155106,0.3602156562,0</vertex>
</vertexes>
<indexes>
<index>5</index>
<index>3</index>
<index>4</index>
<index>4</index>
<index>3</index>
<index>2</index>
<index>0</index>
<index>1</index>
<index>4</index>
<index>4</index>
<index>1</index>
<index>5</index>
</indexes>
</ship>
<ship index="10" frames="Boss_Turtle" type="ship10">
<params num_alive_frames="5" hp_h_frames_b="0" hp_m_frames_b="5" hp_l_frames_b="10" num_death_frames="9" death_frames_b="15" death_fps="8.0" size="20.0,10.0" water_offset="17.5" hit_points="6000.0" speed="5.0" speed_var="1" death_sound="turtle_die.aif" reload_time="3.0" reload_time_var="0.0" shot_time_interval="0.3" rob_money="200" rob_rp="25" rob_score="50" kill_money="400" kill_score="400" kill_achievment="sea_hunter" spawn_points="5"/>
<cannons>
<cannon pos="0.4765,0.546" accuracy="1" damage="0" ball_type="CannonMonkey"/>
<cannon pos="0.535,0.546" accuracy="1" damage="0" ball_type="CannonMonkey"/>
<cannon pos="0.59375,0.546" accuracy="1" damage="0" ball_type="CannonMonkey"/>
<cannon pos="0.654,0.546" accuracy="1" damage="0" ball_type="CannonMonkey"/>
</cannons>
<vertexes>
<vertex>0.1865906936,0.1842090896,0</vertex>
<vertex>0.9379997772,0.1675046569,0</vertex>
<vertex>0.4450703782,0.8682256303,0</vertex>
<vertex>0.7139221948,0.8704522214,0</vertex>
<vertex>0.3966638964,0.3692437372,0</vertex>
<vertex>0.7611457032,0.3532497248,0</vertex>
<vertex>0.9109909457,0.3380536101,0</vertex>
</vertexes>
<indexes>
<index>5</index>
<index>3</index>
<index>4</index>
<index>4</index>
<index>3</index>
<index>2</index>
<index>0</index>
<index>1</index>
<index>4</index>
<index>4</index>
<index>1</index>
<index>5</index>
<index>5</index>
<index>1</index>
<index>6</index>
</indexes>
</ship>
<ship index="11" frames="Fort_Medium" type="ship11">
<params num_alive_frames="1" hp_h_frames_b="0" hp_m_frames_b="1" hp_l_frames_b="2" num_death_frames="1" death_frames_b="3" death_fps="1.0" size="50.0,25.0" water_offset="7.0" hit_points="1000.0" speed="1.0" speed_var="2.5" nearest_line="2" farthest_line="3" death_sound="fortdie.aif" reload_time="5.0" reload_time_var="1.0" shot_time_interval="0.5" fort="true" rob_money="150" rob_rp="45" rob_score="45" kill_money="500" kill_score="50" spawn_points="10"/>
<cannons>
<cannon pos="0.39,0.339" accuracy="0.5" damage="10"/>
<cannon pos="0.39,0.5625" accuracy="0.5" damage="10"/>
<cannon pos="0.482,0.441" accuracy="0.5" damage="10"/>
<cannon pos="0.5136,0.441" accuracy="0.5" damage="10"/>
<cannon pos="0.566,0.441" accuracy="0.5" damage="10"/>
<cannon pos="0.652,0.574" accuracy="0.5" damage="10"/>
</cannons>
<vertexes>
<vertex>0.1215710264,0.1470553837,0</vertex>
<vertex>0.8567249697,0.1326732001,0</vertex>
<vertex>0.3243194443,0.7265752516,0</vertex>
<vertex>0.7441099208,0.7914995513,0</vertex>
<vertex>0.2944900316,0.3413780889,0</vertex>
<vertex>0.7634677809,0.3393164239,0</vertex>
</vertexes>
<indexes>
<index>5</index>
<index>3</index>
<index>4</index>
<index>4</index>
<index>3</index>
<index>2</index>
<index>0</index>
<index>1</index>
<index>4</index>
<index>4</index>
<index>1</index>
<index>5</index>
</indexes>
</ship>
<ship index="12" frames="Submarine" type="ship12">
<params num_alive_frames="4" hp_h_frames_b="0" hp_m_frames_b="0" hp_l_frames_b="0" num_death_frames="10" comeup_frames_b="4" comeup_num_frames="7" comedown_frames_b="15" comedown_num_frames="6" shoot_frames_b="10" shoot_num_frames="5" death_sound="enemydie.aif" death_frames_b="22" death_fps="12.0" size="40.0,40.0" water_offset="5.93" hit_points="10.0" speed="10.0" speed_var="2.5" reload_time="1.0" reload_time_var="0.0" shot_time_interval="0.3" rob_money="50" rob_rp="10" rob_score="25" submarine="true" kill_money="50" kill_score="50" spawn_points="4" nearest_line="1" farthest_line="2"/>
<cannons>
<cannon pos="0.53515,0.5078" accuracy="0.9" damage="50" ball_type="CannonBomb"/>
<cannon pos="0.53515,0.5078" accuracy="0.9" damage="50" ball_type="CannonBomb"/>
<cannon pos="0.53515,0.5078" accuracy="0.9" damage="50" ball_type="CannonBomb"/>
</cannons>
<vertexes>
<vertex>0.116926707,0.1725991291,0</vertex>
<vertex>0.8636913818,0.1675054354,0</vertex>
<vertex>0.400949828,0.5268714649,0</vertex>
<vertex>0.5467287224,0.5174876076,0</vertex>
<vertex>0.1458734047,0.3599551839,0</vertex>
<vertex>0.7309579175,0.3021632952,0</vertex>
</vertexes>
<indexes>
<index>5</index>
<index>3</index>
<index>4</index>
<index>4</index>
<index>3</index>
<index>2</index>
<index>0</index>
<index>1</index>
<index>4</index>
<index>4</index>
<index>1</index>
<index>5</index>
</indexes>
</ship>
<ship index="13" frames="Submarine" type="ship13">
<params num_alive_frames="4" hp_h_frames_b="0" hp_m_frames_b="0" hp_l_frames_b="0" num_death_frames="10" comeup_frames_b="4" comeup_num_frames="7" comedown_frames_b="15" comedown_num_frames="6" shoot_frames_b="10" shoot_num_frames="5" death_sound="enemydie.aif" death_frames_b="22" death_fps="12.0" size="40.0,40.0" water_offset="5.93" hit_points="10.0" speed="10.0" speed_var="2.5" reload_time="1.0" reload_time_var="0.0" shot_time_interval="0.3" rob_money="50" rob_rp="10" rob_score="25" submarine="true" kill_money="50" kill_score="50" spawn_points="4" nearest_line="1" farthest_line="2"/>
<cannons>
<cannon pos="0.53515,0.5078" accuracy="0.9" damage="10" ball_type="CannonFlame"/>
<cannon pos="0.53515,0.5078" accuracy="0.9" damage="10" ball_type="CannonFlame"/>
<cannon pos="0.53515,0.5078" accuracy="0.9" damage="10" ball_type="CannonFlame"/>
</cannons>
<vertexes>
<vertex>0.116926707,0.1725991291,0</vertex>
<vertex>0.8636913818,0.1675054354,0</vertex>
<vertex>0.400949828,0.5268714649,0</vertex>
<vertex>0.5467287224,0.5174876076,0</vertex>
<vertex>0.1458734047,0.3599551839,0</vertex>
<vertex>0.7309579175,0.3021632952,0</vertex>
</vertexes>
<indexes>
<index>5</index>
<index>3</index>
<index>4</index>
<index>4</index>
<index>3</index>
<index>2</index>
<index>0</index>
<index>1</index>
<index>4</index>
<index>4</index>
<index>1</index>
<index>5</index>
</indexes>
</ship>
<ship index="14" frames="Fort_Large" type="ship14">
<params num_alive_frames="1" hp_h_frames_b="0" hp_m_frames_b="1" hp_l_frames_b="2" num_death_frames="1" death_frames_b="3" death_fps="1.0" size="50.0,25.0" water_offset="7.0" hit_points="1500.0" speed="1.0" speed_var="2.5" nearest_line="1" farthest_line="3" death_sound="fortdie.aif" reload_time="5.0" reload_time_var="1.0" shot_time_interval="0.5" rob_money="200" rob_rp="50" rob_score="50" fort="true" kill_money="1000" kill_score="1000" spawn_points="10"/>
<cannons>
<cannon pos="0.285,0.6289" accuracy="0.5" damage="10"/>
<cannon pos="0.421,0.351" accuracy="0.5" damage="10"/>
<cannon pos="0.515,0.457" accuracy="0.5" damage="10"/>
<cannon pos="0.679,0.636" accuracy="0.5" damage="10"/>
<cannon pos="0.285,0.6289" accuracy="0.5" damage="10"/>
<cannon pos="0.421,0.351" accuracy="0.5" damage="10"/>
<cannon pos="0.515,0.457" accuracy="0.5" damage="10"/>
<cannon pos="0.679,0.636" accuracy="0.5" damage="10"/>
<cannon pos="0.285,0.6289" accuracy="0.5" damage="10"/>
<cannon pos="0.421,0.351" accuracy="0.5" damage="10"/>
<cannon pos="0.515,0.457" accuracy="0.5" damage="10"/>
<cannon pos="0.679,0.636" accuracy="0.5" damage="10"/>
</cannons>
<vertexes>
<vertex>0.1215710264,0.1470553837,0</vertex>
<vertex>0.8567249697,0.1326732001,0</vertex>
<vertex>0.3916613382,0.9634332022,0</vertex>
<vertex>0.6976672333,0.9703041277,0</vertex>
<vertex>0.2944900316,0.3413780889,0</vertex>
<vertex>0.7634677809,0.3393164239,0</vertex>
</vertexes>
<indexes>
<index>5</index>
<index>3</index>
<index>4</index>
<index>4</index>
<index>3</index>
<index>2</index>
<index>0</index>
<index>1</index>
<index>4</index>
<index>4</index>
<index>1</index>
<index>5</index>
</indexes>
</ship>
<ship index="15" frames="Ship_Ghost" type="ship15">
<params num_alive_frames="5" hp_h_frames_b="0" hp_m_frames_b="5" hp_l_frames_b="10" num_death_frames="12" death_frames_b="15" death_fps="8.0" death_sound="ghostdie.aif" size="15.0,15.0" water_offset="10.93" hit_points="100.0" speed="10.0" speed_var="2.5" reload_time="5.0" reload_time_var="0.0" shot_time_interval="0.0" rob_money="50" rob_rp="10" rob_score="15" kill_money="100" kill_score="75" spawn_points="5" ghost="true" nearest_line="2" farthest_line="4"/>
<cannons>
<cannon pos="0.3554,0.6875" accuracy="1" damage="10" ball_type="CannonFlame"/>
<cannon pos="0.4609,0.6953" accuracy="1" damage="10"/>
<cannon pos="0.5468,0.6875" accuracy="1" damage="10" ball_type="CannonBomb"/>
</cannons>
<vertexes>
<vertex>0.07745049116,0.1911758703,0</vertex>
<vertex>0.7893831056,0.1907264513,0</vertex>
<vertex>0.1594479602,0.7567629737,0</vertex>
<vertex>0.6744460386,0.8077543897,0</vertex>
<vertex>0.01583402199,0.3785322827,0</vertex>
<vertex>0.9562048238,0.5227644366,0</vertex>
</vertexes>
<indexes>
<index>5</index>
<index>3</index>
<index>4</index>
<index>4</index>
<index>3</index>
<index>2</index>
<index>0</index>
<index>1</index>
<index>4</index>
<index>4</index>
<index>1</index>
<index>5</index>
</indexes>
</ship>
<ship index="16" frames="Ship_Ghost" type="ship16">
<params num_alive_frames="5" hp_h_frames_b="0" hp_m_frames_b="5" hp_l_frames_b="10" num_death_frames="12" death_frames_b="15" death_fps="8.0" death_sound="ghostdie.aif" size="15.0,15.0" water_offset="10.93" hit_points="100.0" speed="10.0" speed_var="2.5" reload_time="5.0" reload_time_var="0.0" shot_time_interval="0.0" rob_money="50" rob_rp="10" rob_score="15" kill_money="100" kill_score="75" spawn_points="5" nearest_line="2" farthest_line="4"/>
<cannons>
<cannon pos="0.3554,0.6875" accuracy="1" damage="10" ball_type="CannonFlame"/>
<cannon pos="0.4609,0.6953" accuracy="1" damage="10"/>
<cannon pos="0.5468,0.6875" accuracy="1" damage="10" ball_type="CannonBomb"/>
</cannons>
<vertexes>
<vertex>0.07745049116,0.1911758703,0</vertex>
<vertex>0.7893831056,0.1907264513,0</vertex>
<vertex>0.1594479602,0.7567629737,0</vertex>
<vertex>0.6744460386,0.8077543897,0</vertex>
<vertex>0.01583402199,0.3785322827,0</vertex>
<vertex>0.9562048238,0.5227644366,0</vertex>
</vertexes>
<indexes>
<index>5</index>
<index>3</index>
<index>4</index>
<index>4</index>
<index>3</index>
<index>2</index>
<index>0</index>
<index>1</index>
<index>4</index>
<index>4</index>
<index>1</index>
<index>5</index>
</indexes>
</ship>
<ship index="17" frames="Boss_Fort" type="ship17">
<params num_alive_frames="8" hp_h_frames_b="0" hp_m_frames_b="8" hp_l_frames_b="16" num_death_frames="8" death_frames_b="24" death_fps="6.0" size="24.0,12.0" water_offset="19.06" hit_points="10000.0" speed="2.0" speed_var="2.5" nearest_line="1" farthest_line="3" alive_frames_mirror="false" death_sound="fortdie.aif" reload_time="1.0" reload_time_var="0.0" shot_time_interval="0.1" rob_money="200" rob_rp="50" rob_score="50" fort="true" kill_money="1000" kill_score="1000" kill_achievment="solid_rock" spawn_points="5"/>
<cannons>
<cannon pos="0.392,0.445" accuracy="0.5" damage="10"/>
<cannon pos="0.390,0.629" accuracy="0.5" damage="10"/>
<cannon pos="0.478,0.515" accuracy="0.5" damage="10"/>
<cannon pos="0.5644,0.441" accuracy="0.5" damage="10"/>
<cannon pos="0.566,0.632" accuracy="0.5" damage="10"/>
</cannons>
<vertexes>
<vertex>0.08441683618,0.2329739443,0</vertex>
<vertex>0.9472883266,0.2325243465,0</vertex>
<vertex>0.3266414922,0.8450041375,0</vertex>
<vertex>0.6860566658,0.8495529256,0</vertex>
<vertex>0.1133634221,0.6246783695,0</vertex>
<vertex>0.9213728231,0.636550065,0</vertex>
<vertex>0.2977850657,0.6803874931,0</vertex>
<vertex>0.7184857648,0.6791613064,0</vertex>
</vertexes>
<indexes>
<index>5</index>
<index>7</index>
<index>4</index>
<index>4</index>
<index>7</index>
<index>6</index>
<index>7</index>
<index>3</index>
<index>6</index>
<index>3</index>
<index>2</index>
<index>6</index>
<index>1</index>
<index>4</index>
<index>0</index>
<index>4</index>
<index>1</index>
<index>5</index>
</indexes>
</ship>
<ship index="18" frames="Boss_Flamer" type="ship18">
<params num_alive_frames="5" hp_h_frames_b="0" hp_m_frames_b="5" hp_l_frames_b="10" num_death_frames="9" death_frames_b="15" death_fps="8.0" size="26.0,13.0" water_offset="9.062" hit_points="20000.0" speed="5.0" speed_var="1" death_sound="enemydie.aif" reload_time="2.0" reload_time_var="1.0" shot_time_interval="0.5" rob_money="1000" rob_rp="50" rob_score="50" kill_money="100000" kill_score="1000" kill_achievment="legend_of_the_sea" spawn_points="5"/>
<cannons>
<cannon pos="0.3164,0.7109" accuracy="1.5" damage="0" ball_type="CannonFlame"/>
<cannon pos="0.4238,0.7109" accuracy="1.5" damage="0" ball_type="CannonFlame"/>
<cannon pos="0.5273,0.7109" accuracy="1.5" damage="0" ball_type="CannonFlame"/>
<cannon pos="0.634,0.7109" accuracy="1.5" damage="0" ball_type="CannonFlame"/>
<cannon pos="0.738,0.7109" accuracy="1.5" damage="0" ball_type="CannonFlame"/>
</cannons>
<vertexes>
<vertex>0.1424701732,0.1075787953,0</vertex>
<vertex>0.893879227,0.1094513348,0</vertex>
<vertex>0.1435511482,0.3762101791,0</vertex>
<vertex>0.8377759975,0.3602161369,0</vertex>
<vertex>0.2304432314,0.7988162598,0</vertex>
<vertex>0.709197275,0.7836573086,0</vertex>
<vertex>0.2658431154,0.7976953945,0</vertex>
<vertex>0.4013695639,0.4406014046,0</vertex>
<vertex>0.5968562883,0.4510996005,0</vertex>
<vertex>0.4725310427,0.7332447133,0</vertex>
<vertex>0.5258865875,0.7315552792,0</vertex>
</vertexes>
<indexes>
<index>3</index>
<index>5</index>
<index>8</index>
<index>1</index>
<index>2</index>
<index>0</index>
<index>2</index>
<index>1</index>
<index>3</index>
<index>2</index>
<index>7</index>
<index>6</index>
<index>7</index>
<index>8</index>
<index>10</index>
</indexes>
</ship>
<ship index="19" frames="BossSubmarine" type="ship19">
<params num_alive_frames="4" hp_h_frames_b="0" hp_m_frames_b="0" hp_l_frames_b="0" num_death_frames="6" comeup_frames_b="4" comeup_num_frames="7" comedown_frames_b="15" comedown_num_frames="6" shoot_frames_b="10" shoot_num_frames="5" death_sound="enemydie.aif" death_frames_b="18" death_fps="4.0" size="20.0,11.0" water_offset="5.93" hit_points="2000.0" speed="10.0" speed_var="2.5" reload_time="5.0" reload_time_var="2.0" shot_time_interval="0.3" rob_money="150" rob_rp="30" rob_score="30" submarine="true" kill_money="800" kill_score="500" spawn_points="5" nearest_line="1" farthest_line="2" kill_achievment="into_the_deep"/>
<cannons>
<cannon pos="0.53515,0.5078" accuracy="1" damage="50" ball_type="CannonBomb"/>
<cannon pos="0.53515,0.5078" accuracy="1" damage="50" ball_type="CannonBomb"/>
<cannon pos="0.53515,0.5078" accuracy="1" damage="50" ball_type="CannonBomb"/>
</cannons>
<vertexes>
<vertex>0.116926707,0.1725991291,0</vertex>
<vertex>0.8636913818,0.1675054354,0</vertex>
<vertex>0.400949828,0.5268714649,0</vertex>
<vertex>0.5467287224,0.5174876076,0</vertex>
<vertex>0.1458734047,0.3599551839,0</vertex>
<vertex>0.7309579175,0.3021632952,0</vertex>
</vertexes>
<indexes>
<index>5</index>
<index>3</index>
<index>4</index>
<index>4</index>
<index>3</index>
<index>2</index>
<index>0</index>
<index>1</index>
<index>4</index>
<index>4</index>
<index>1</index>
<index>5</index>
</indexes>
</ship>
</ships>
;
}
}//package config
Section 7
//StringXML (config.StringXML)
package config {
public class StringXML {
public static var xml:XML = <strings>
<string id="strYes" value="Yes"/>
<string id="strNo" value="No"/>
<string id="strWelcome" value="Welcome"/>
<string id="strContinue" value="Continue"/>
<string id="strNewGame" value="New Game"/>
<string id="strOptions" value="Options"/>
<string id="strHighscores" value="Highscores"/>
<string id="strLostProcced" value="[br][br]Current game progress will be lost. Procced?"/>
<string id="strSelctDifficulty" value="Select difficulty"/>
<string id="strEasy" value="Easy"/>
<string id="strNormal" value="Normal"/>
<string id="strHard" value="Hard"/>
<string id="strInsane" value="Insane"/>
<string id="strStartTutorial" value="[br][br]Start tutorial?"/>
<string id="strTutTap" value="Tap here to continue..."/>
<string id="strClose" value="Close"/>
<string id="strStartNew" value="[br]Start new game?"/>
<string id="strResume" value="Resume"/>
<string id="strRestart" value="Restart"/>
<string id="strMainMenu" value="Main Menu"/>
<string id="strRestartLevel" value="[br][br]Restart Level?"/>
<string id="strReplaceAmmo" value="[br][br]Replace ammo?"/>
<string id="strBewareAmmo" value="- One or more ammo slots are empty"/>
<string id="strBewareCannons" value="- One or more cannon slots are empty"/>
<string id="strBewareShip" value="- Your ships hit points are not full"/>
<string id="strBeware" value="BEWARE!!!"/>
<string id="strLeaveShop" value="Leave Shop?"/>
<string id="strReplaceCannon" value="[br][br]Replace cannon?"/>
<string id="strWelcom" value="Welcom"/>
<string id="strWelcom" value="Welcom"/>
<string id="strWelcom" value="Welcom"/>
<string id="strWelcom" value="Welcom"/>
<string id="strWelcom" value="Welcom"/>
<string id="strWelcom" value="Welcom"/>
<string id="strWelcom" value="Welcom"/>
<string id="strWelcom" value="Welcom"/>
<string id="strWelcom" value="Welcom"/>
</strings>
;
}
}//package config
Section 8
//TutorialXML (config.TutorialXML)
package config {
public class TutorialXML {
public static var TUTORIALS:XML = <tutorial>
<item index="0" level="0" open_trigger="start(0)" close_trigger="close" open_anim="true" close_anim="false" tap="100" text="Hi there! My name is Black Beard, but friends call me Bi-bi. I'll teach you the basics of piracy."/>
<item index="1" level="0" open_trigger="remove(0)" close_trigger="close" open_anim="false" close_anim="false" tap="1000" text="To repair your ship at sea tap and hold the repair button in the upper left corner of the screen. Try it."/>
<item index="2" open_trigger="" close_trigger="close" open_anim="true" close_anim="false" tap="100" text="Congratulations! To stay alive is a good start!"/>
<item index="3" level="1" open_trigger="start(1)" close_trigger="close" open_anim="true" close_anim="false" tap="100" text="Drag the round to your cannon to load it and tap on the cannon to make a shot."/>
<item index="4" open_trigger="" close_trigger="close" open_anim="true" close_anim="false" tap="10" text="To load cannon, drag your round from the top of the screen to your cannon. Try it."/>
<item index="5" level="1" open_trigger="kill(1)" close_trigger="close" open_anim="true" close_anim="false" tap="100" text="
Good work!"/>
<item index="6" level="1" multy="1" open_trigger="shipleft(1)" close_trigger="close" open_anim="true" close_anim="false" tap="100" text="
Try one more time."/>
<item index="7" level="2" open_trigger="shopEnter(2)" close_trigger="close" open_anim="true" close_anim="false" tap="100" text="Hi there. My name is Lisa. Welcome to my Shop!"/>
<item index="8" level="2" open_trigger="remove(7)" close_trigger="close" open_anim="false" close_anim="false" tap="100" text="Now you’re in ammo section. In this section you can buy, sell and manage your ammo."/>
<item index="9" level="2" open_trigger="remove(8)" close_trigger="close" open_anim="false" close_anim="false" tap="100" text="Bi-bi is my old friend so I agreed to supply you with canon-stones for free! Soon new types of ammo will be available."/>
<item index="10" level="2" open_trigger="remove(9)" close_trigger="close" open_anim="false" close_anim="false" tap="100" text="To read round description, tap on it. Give it a try."/>
<item index="11" open_trigger="readAmmo(1)" close_trigger="close" open_anim="true" close_anim="false" tap="100" text="To buy a round, drag it from the bottom of the screen to the empty slot or in the slot with the same round type. Try to buy some."/>
<item index="12" open_trigger="buyAmmo(1)" close_trigger="close" open_anim="true" close_anim="false" tap="100" text="To sell rounds, drag them to the cannon-rounds assortment in the bottom."/>
<item index="13" open_trigger="remove(12)" close_trigger="close" open_anim="false" close_anim="false" tap="100" text="Note that rounds can be sold for the same price you bought them for. Try to sell some."/>
<item index="14" open_trigger="sellAmmo(1)" close_trigger="close" open_anim="true" close_anim="false" tap="100" text="To visit cannons section tap on the right triangle button in shop header."/>
<item index="15" open_trigger="enterCannon(1)" close_trigger="close" open_anim="true" close_anim="false" tap="100" text="This is cannons section. Condition of each cannon is shown below. Don't forget to repair them."/>
<item index="16" open_trigger="remove(15)" close_trigger="close" open_anim="false" close_anim="false" tap="100" text="To repair or sell your cannon, drag your cannon to the bottom. In pop-up window press repair or sell button."/>
<item index="17" open_trigger="remove(16)" close_trigger="close" open_anim="false" close_anim="false" tap="100" text="To visit ship section tap on the right triangle button in the shop header."/>
<item index="18" open_trigger="enterShip(1)" close_trigger="close" open_anim="true" close_anim="false" tap="100" text="In this section you can buy repair points, repair your ship, and upgrade it. To do this, just tap on the proper button."/>
<item index="19" open_trigger="remove(18)" close_trigger="close" open_anim="false" close_anim="false" tap="100" text="I think, now you’re ready to become a legendary pirate! To start your journey press left square button at the shop header."/>
<item index="20" level="0" open_trigger="add_ship(0)" close_trigger="close" open_anim="true" close_anim="false" tap="100" text="I see an enemy ship. That means it's time for target practice. Sink that ship!"/>
<item index="21" open_trigger="ammo_empty_in_game(1)" close_trigger="close" open_anim="true" close_anim="false" tap="100" text="One of your ammo slots is empty. Tap on the transparent stones to get free stones "/>
<item index="22" open_trigger="remove(21)" close_trigger="close" open_anim="false" close_anim="false" tap="100" text="or drag ammo from the other slot, ammo will be split by half between those two slots."/>
<item index="23" open_trigger="getFireBall(1)" close_trigger="close" open_anim="true" close_anim="false" tap="100" text="Your ship has been hit with cannon fire ball. Now its on fire. Press space bar to suppress fire."/>
<item index="24" open_trigger="getBarrelBall(1)" close_trigger="close" open_anim="true" close_anim="false" tap="100" text="Your ship has been hit with rum barrel. One of your cannons will be unavailable for 10 seconds."/>
<item index="25" open_trigger="lowCondition(1)" close_trigger="close" open_anim="true" close_anim="false" tap="100" text="Condition of your ship is too low. Use repair button, to repair your ship in battle. Don't forget to buy repair points in Tortuga Shop."/>
<item index="26" open_trigger="getMonkeyBall(1)" close_trigger="close" open_anim="true" close_anim="false" tap="100" text="Your ship has been hit with enemy monkey. Monkey has stolen some of your gold and repair points."/>
<item index="27" open_trigger="" close_trigger="close" open_anim="true" close_anim="false" tap="100" text="The more power you apply, the farther your mine will be placed."/>
<item index="28" open_trigger="cannon3_present(1)" close_trigger="close" open_anim="true" close_anim="false" tap="100" text="In three barrel cannon you can load three rounds. This cannon has three different fire options."/>
<item index="29" open_trigger="remove(28)" close_trigger="close" open_anim="false" close_anim="false" tap="100" text="One tap will shoot all rounds inside the cannon with a short delay."/>
<item index="30" open_trigger="remove(29)" close_trigger="close" open_anim="false" close_anim="false" tap="100" text="If you make several fast short taps cannon will shoot all rounds without delay."/>
<item index="31" open_trigger="remove(30)" close_trigger="close" open_anim="false" close_anim="false" tap="100" text="If you start shooting while loading new rounds at the same time, cannon will fire endlessly until you stop loading new rounds."/>
<item index="32" level="0" open_trigger="repair_finish" close_trigger="close" open_anim="true" close_anim="false" tap="200" text="Note, that you'll need repair points to repair your ship at sea. "/>
<item index="33" level="0" open_trigger="remove(32)" close_trigger="close" open_anim="false" close_anim="false" tap="100" text="I think I can see an enemy ship. Don't worry. Just tap on enemy rounds that are glowing red to knock them back. "/>
<item index="34" level="1" open_trigger="make_shoot(0)" close_trigger="close" open_anim="true" close_anim="false" tap="500" text="If you tap hold and then release, your round will fly with greater speed and cause more damage to the enemy. Give it a try."/>
<item index="35" open_trigger="shopEnter(7)" close_trigger="close" open_anim="true" close_anim="false" tap="100" text="Piercing Balls are now available at the shop!"/>
<item index="36" open_trigger="shopEnter(9)" close_trigger="close" open_anim="true" close_anim="false" tap="100" text="Bomb Balls are now available at the shop!"/>
<item index="37" open_trigger="shopEnter(10)" close_trigger="close" open_anim="true" close_anim="false" tap="100" text="Fire Balls are now available at the shop!"/>
<item index="38" open_trigger="shopEnter(12)" close_trigger="close" open_anim="true" close_anim="false" tap="100" text="Mines are now available at the shop!"/>
<item index="39" open_trigger="shopEnter(14)" close_trigger="close" open_anim="true" close_anim="false" tap="100" text="Shrapnel is now available at the shop!"/>
<item index="40" open_trigger="shopEnter(17)" close_trigger="close" open_anim="true" close_anim="false" tap="100" text="Kraken Lure is now available at the shop!"/>
<item index="41" open_trigger="shopEnter(3)" close_trigger="close" open_anim="true" close_anim="false" tap="100" text="Rum is now available at the shop!"/>
<item index="42" open_trigger="shopEnter(5)" close_trigger="close" open_anim="true" close_anim="false" tap="100" text="Chain shot is now available at the shop!"/>
<item index="43" open_trigger="start(4)" close_trigger="close" open_anim="true" close_anim="false" tap="100" text="You are entering the kingdom of my sworn enemy captain Jack. Some time ago he had stole the treasure that belonged to me."/>
<item index="44" open_trigger="remove(43)" close_trigger="close" open_anim="false" close_anim="false" tap="100" text="Do you see that? Only captain Jack could create such weird machine."/>
<item index="45" open_trigger="ghost(1)" close_trigger="close" open_anim="true" close_anim="false" tap="100" text="Watch out! There are rumors about ghost ships dwelling in these waters."/>
<item index="46" level="1" open_trigger="make_shoot(1)" close_trigger="close" open_anim="true" close_anim="false" tap="100" text="If you press left or right key, it will change the flight path of cannon-ball. Give it a try."/>
<item index="47" open_trigger="" close_trigger="close" open_anim="true" close_anim="false" tap="100" text="That’s him! I recognize his ship.Trying to run away like a rat, from the sinking ship. Get him!"/>
<item index="48" open_trigger="madseller(1)" close_trigger="close" open_anim="true" close_anim="false" tap="100" text="Oh no, it's a crazy merchant Jim. He will try to braze you, do not yield to temptation!"/>
<item index="49" open_trigger="turtle(1)" close_trigger="close" open_anim="true" close_anim="false" tap="100" text="Oh no, these are the most famous robbers of the Caribbean Sea, it will take them a moment to fleece you. "/>
<item index="50" open_trigger="bigfort(1)" close_trigger="close" open_anim="true" close_anim="false" tap="100" text="If you manage to pass by this fort, Captain Jack has no chance to escape."/>
<item index="51" level="1" open_trigger="make_shoot(3)" close_trigger="close" open_anim="true" close_anim="false" tap="100" text="I see an enemy ship. That means it's time for target practice. Sink that ship!"/>
</tutorial>
;
}
}//package config
Section 9
//BitmapTextField (controls.BitmapTextField)
package controls {
import flash.geom.*;
import flash.display.*;
import config.*;
import flash.system.*;
public class BitmapTextField extends Sprite {
private var size:int;
private var spacing:Array;
private var bold:Boolean;
private var smoth:Boolean;
private var scaleW:int;
private var common_lineHeight:int;
private var padding:Array;
private var num_lines:Number;// = 0
private var base:int;
private var scale:Number;// = 1
private var outline:Boolean;
private var chars:Object;
private var bmp_data:BitmapData;
private var aa:int;
private var italic:Boolean;
private var line_width:Number;// = 0
private var scaleH:int;
public function BitmapTextField(){
line_width = 0;
num_lines = 0;
}
private function init(_arg1:XML):void{
var _local6:Object;
var _local2:String = _arg1.info.@file;
var _local3:Class = (ApplicationDomain.currentDomain.getDefinition(_local2) as Class);
bmp_data = new _local3(1, 1);
size = Number(_arg1.info.@size);
bold = (_arg1.info.@bold == "1");
italic = (_arg1.info.@italic == "1");
smoth = (_arg1.info.@smoth == "1");
aa = Number(_arg1.info.@aa);
padding = String(_arg1.info.@padding).split(",");
spacing = String(_arg1.info.@spacing).split(",");
outline = (_arg1.info.@outline == "1");
common_lineHeight = Number(_arg1.info.@common_lineHeight);
scaleW = Number(_arg1.info.@scaleW);
scaleH = Number(_arg1.info.@scaleH);
chars = {};
var _local4:int = _arg1.children().length();
var _local5 = 1;
while (_local5 < _local4) {
_local6 = {};
_local6.id = _arg1.char[(_local5 - 1)].@id;
_local6.x = _arg1.char[(_local5 - 1)].@x;
_local6.y = _arg1.char[(_local5 - 1)].@y;
_local6.width = _arg1.char[(_local5 - 1)].@width;
_local6.height = _arg1.char[(_local5 - 1)].@height;
_local6.xoffset = _arg1.char[(_local5 - 1)].@xoffset;
_local6.yoffset = _arg1.char[(_local5 - 1)].@yoffset;
_local6.xadvance = _arg1.char[(_local5 - 1)].@xadvance;
_local6.page = _arg1.char[(_local5 - 1)].@page;
_local6.chnl = _arg1.char[(_local5 - 1)].@chnl;
chars[_local6.id] = _local6;
_local5++;
};
}
private function addChar(_arg1:int):void{
if (!chars[_arg1]){
return;
};
var _local2:Object = chars[_arg1];
var _local3:Number = Number(_local2.x);
var _local4:Number = Number(_local2.y);
var _local5:Number = _local2.width;
var _local6:Number = _local2.height;
var _local7:BitmapData = new BitmapData(_local5, _local6, true, 0xFFFFFF);
_local7.copyPixels(bmp_data, new Rectangle(_local3, _local4, _local5, _local6), new Point());
var _local8:Bitmap = new Bitmap(_local7);
_local8.smoothing = smoth;
_local8.scaleX = scale;
_local8.scaleY = scale;
_local8.x = line_width;
line_width = (line_width + (Number(_local2.xadvance) * scale));
_local8.y = ((Number(_local2.yoffset) + (num_lines * common_lineHeight)) * scale);
this.addChild(_local8);
}
public function set fontColor(_arg1:uint):void{
var _local2:ColorTransform = this.transform.colorTransform;
_local2.color = _arg1;
this.transform.colorTransform = _local2;
}
private function addLetter(_arg1:String):void{
addChar(_arg1.charCodeAt());
}
public function set fontSize(_arg1:int):void{
scale = (_arg1 / this.size);
}
public function set text(_arg1:String):void{
var _local4:String;
var _local5:int;
line_width = 0;
num_lines = 0;
while (this.numChildren > 0) {
this.removeChildAt(0);
};
var _local2:Array = _arg1.split("\n");
var _local3:int;
while (_local3 < _local2.length) {
_local4 = _local2[_local3];
_local5 = 0;
while (_local5 < _local4.length) {
addChar(_local4.charCodeAt(_local5));
_local5++;
};
num_lines++;
line_width = 0;
_local3++;
};
}
public function set fontName(_arg1:String):void{
var _local5:XML;
var _local2:XML = FontsXML.FONTS;
var _local3:int = _local2.children().length();
var _local4:int;
while (_local4 < _local3) {
if (_local2.font[_local4].@name == _arg1){
_local5 = XML(_local2.font[_local4]);
init(_local5);
return;
};
_local4++;
};
}
}
}//package controls
Section 10
//CoinsCounter (controls.CoinsCounter)
package controls {
import flash.display.*;
import engine.utils.*;
import flash.text.*;
public class CoinsCounter extends MovieClip {
private var _value:int;
public var caption:TextField;
private var _caption:TextField;
public function CoinsCounter(){
addFrameScript(0, frame1);
super();
_caption = (this.getChildByName("caption") as TextField);
_caption.text = "0000";
value = 0;
}
public function set value(_arg1:int):void{
this._value = _arg1;
_caption.text = Utils.intToString(_arg1, 4);
}
function frame1(){
stop();
}
}
}//package controls
Section 11
//GearCounter (controls.GearCounter)
package controls {
import flash.display.*;
import engine.utils.*;
import flash.text.*;
public class GearCounter extends MovieClip {
private var _value:int;
public var caption:TextField;
private var _caption:TextField;
public function GearCounter(){
addFrameScript(0, frame1);
super();
_caption = (this.getChildByName("caption") as TextField);
value = 12;
}
public function get value():int{
return (_value);
}
public function set value(_arg1:int):void{
this._value = _arg1;
_caption.text = Utils.intToString(_arg1, 4);
}
function frame1(){
stop();
}
}
}//package controls
Section 12
//MenuTextButton (controls.MenuTextButton)
package controls {
import flash.display.*;
import engine.controls.buttons.*;
import flash.filters.*;
public class MenuTextButton extends TextButton {
public function MenuTextButton(_arg1:MovieClip){
super(_arg1);
thisClip.filters.push(new DropShadowFilter());
}
override protected function showEnable():void{
if (_caption){
_caption.alpha = 1;
};
}
override protected function showOver():void{
showOut();
}
public function refresh():void{
showOut();
}
override protected function showDown():void{
if (_caption){
_caption.textColor = 14198867;
};
}
override protected function showOut():void{
if (_caption){
_caption.textColor = 0xFFFFFF;
};
}
override protected function showDisable():void{
if (_caption){
_caption.alpha = 0.5;
};
}
override protected function showUp():void{
showOut();
}
}
}//package controls
Section 13
//SelectBar (controls.SelectBar)
package controls {
import flash.display.*;
import flash.events.*;
import windows.shop.*;
import engine.controls.*;
import sound.*;
import engine.controls.buttons.*;
public class SelectBar extends BasicControl {
private var items:Array;
private var target_x:Number;
private var _mask:Sprite;
private var current_pos:int;
private var content:MovieClip;
private var active_count:int;
public var left_btn:BasicButton;
public var right_btn:BasicButton;
private var direction:int;
private static const DELTA_X:Number = 105;
private static const VISIBLE_COUNT:int = 5;
private static const MOVING_SPEED:Number = 10;
public function SelectBar(_arg1:MovieClip, _arg2:int){
var _local4:MovieClip;
super(_arg1);
content = (thisClip.getChildByName("cnt") as MovieClip);
left_btn = new BasicButton((thisClip.getChildByName("left") as MovieClip));
left_btn.clip.addEventListener(MouseEvent.CLICK, leftClickHandler);
right_btn = new BasicButton((thisClip.getChildByName("right") as MovieClip));
right_btn.clip.addEventListener(MouseEvent.CLICK, rightClickHandler);
items = [];
var _local3:int;
while (_local3 < _arg2) {
_local4 = (content.getChildByName(("i" + _local3)) as MovieClip);
_local4.visible = false;
items.push(new ShopIcon(_local4, null));
_local3++;
};
target_x = 0;
direction = 0;
current_pos = 0;
thisClip.addEventListener(Event.ENTER_FRAME, enterFrameHandler);
active_count = 0;
updateButtons();
}
public function leftClickHandler(_arg1:MouseEvent):void{
if (current_pos >= 0){
return;
};
SoundManager.playSound("click");
current_pos++;
target_x = (current_pos * DELTA_X);
direction = 1;
updateButtons();
}
public function initItemData(_arg1:int, _arg2:Object):void{
items[_arg1].data = _arg2;
}
public function getItemUnderPoint(_arg1:Number, _arg2:Number, _arg3:MovieClip, _arg4:Boolean=false):ShopIcon{
var _local5:int;
var _local6:ShopIcon;
while (_local5 < items.length) {
_local6 = items[_local5];
if (_local6.clip.getBounds(_arg3).contains(_arg1, _arg2)){
if (((_arg4) || (((_local6.clip.visible) && ((_local6.clip.alpha == 1)))))){
return (_local6);
};
};
_local5++;
};
return (null);
}
private function enterFrameHandler(_arg1:Event):void{
if (content.x == target_x){
return;
};
if (direction < 0){
if (content.x > target_x){
content.x = (content.x + (direction * MOVING_SPEED));
} else {
content.x = target_x;
};
} else {
if (content.x < target_x){
content.x = (content.x + (direction * MOVING_SPEED));
} else {
content.x = target_x;
};
};
}
public function get itemClips():Array{
return (items);
}
public function rightClickHandler(_arg1:MouseEvent):void{
if ((current_pos + active_count) <= VISIBLE_COUNT){
return;
};
SoundManager.playSound("click");
current_pos--;
target_x = (current_pos * DELTA_X);
direction = -1;
updateButtons();
}
public function showItem(_arg1:int):void{
items[_arg1].clip.visible = true;
if ((_arg1 + 1) > active_count){
active_count = (_arg1 + 1);
};
updateButtons();
}
private function updateButtons():void{
left_btn.enable = (current_pos < 0);
right_btn.enable = ((current_pos + active_count) > VISIBLE_COUNT);
}
override public function destroy():void{
left_btn.clip.removeEventListener(MouseEvent.CLICK, leftClickHandler);
right_btn.clip.removeEventListener(MouseEvent.CLICK, rightClickHandler);
thisClip.removeEventListener(Event.ENTER_FRAME, enterFrameHandler);
var _local1:int;
while (_local1 < items.length) {
(items[_local1] as ShopIcon).destroy();
_local1++;
};
super.destroy();
}
}
}//package controls
Section 14
//Slider (controls.Slider)
package controls {
import flash.display.*;
import flash.events.*;
import engine.controls.events.*;
public class Slider extends MovieClip {
public var ln:MovieClip;
private var _value:Number;// = 50
public var pt:MovieClip;
private var line:MovieClip;
private var max:Number;
private var pointer:MovieClip;
public function Slider(){
pointer = (this.getChildByName("pt") as MovieClip);
line = (this.getChildByName("ln") as MovieClip);
max = line.width;
pointer.useHandCursor = true;
pointer.buttonMode = true;
pointer.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler);
pointer.addEventListener(MouseEvent.MOUSE_UP, mouseUpHandler);
this.addEventListener(MouseEvent.ROLL_OUT, rollOutHandler);
this.addEventListener(MouseEvent.CLICK, clickHandler);
}
private function rollOutHandler(_arg1:MouseEvent):void{
mouseUpHandler(null);
}
private function mouseDownHandler(_arg1:MouseEvent):void{
this.addEventListener(MouseEvent.MOUSE_MOVE, mouseMoveHandler);
pointer.gotoAndStop(2);
}
private function clickHandler(_arg1:MouseEvent):void{
updatePosition(((line.mouseX / max) * 100));
}
private function mouseUpHandler(_arg1:MouseEvent):void{
this.removeEventListener(MouseEvent.MOUSE_MOVE, mouseMoveHandler);
pointer.gotoAndStop(1);
}
public function set value(_arg1:Number):void{
_value = Math.min(100, Math.max(_arg1, 0));
var _local2:Number = (((max - pointer.width) * _value) / 100);
pointer.x = ((pointer.width / 2) + _local2);
}
private function updatePosition(_arg1:Number):void{
value = _arg1;
dispatchEvent(new ControlEvent(ControlEvent.UPDATE, _value));
}
private function mouseMoveHandler(_arg1:MouseEvent):void{
updatePosition(((line.mouseX / max) * 100));
}
}
}//package controls
Section 15
//WaveBar (controls.WaveBar)
package controls {
import flash.display.*;
public class WaveBar extends MovieClip {
private var _marker:MovieClip;
public var marker:MovieClip;
public var line:MovieClip;
public function WaveBar(){
_marker = (this.getChildByName("marker") as MovieClip);
}
public function set progress(_arg1:Number):void{
var _local2:Number = ((240 / 100) * _arg1);
_marker.x = (_local2 - 10);
}
}
}//package controls
Section 16
//BasicButton (engine.controls.buttons.BasicButton)
package engine.controls.buttons {
import flash.display.*;
import engine.controls.*;
public class BasicButton extends BasicControl {
public function BasicButton(_arg1:MovieClip){
super(_arg1);
thisClip.useHandCursor = true;
thisClip.buttonMode = true;
}
override protected function showOut():void{
thisClip.gotoAndStop("*up");
}
override protected function showOver():void{
thisClip.gotoAndStop("*over");
}
override protected function showUp():void{
thisClip.gotoAndStop("*over");
}
override protected function showDown():void{
if (!enable){
return;
};
thisClip.gotoAndStop("*down");
}
}
}//package engine.controls.buttons
Section 17
//TextButton (engine.controls.buttons.TextButton)
package engine.controls.buttons {
import flash.display.*;
public class TextButton extends BasicButton {
public function TextButton(_arg1:MovieClip){
super(_arg1);
}
}
}//package engine.controls.buttons
Section 18
//ControlEvent (engine.controls.events.ControlEvent)
package engine.controls.events {
import flash.events.*;
public class ControlEvent extends Event {
private var _data:Object;
public static const PRESS_ENTER:String = "press_enter";
public static const DESELECT_ITEM:String = "deselect_item";
public static const SELECT_ITEM:String = "select_item";
public static const UPDATE:String = "update";
public static const CHANGE_SELECTION:String = "change_selection";
public function ControlEvent(_arg1:String, _arg2:Object=null, _arg3:Boolean=false, _arg4:Boolean=false){
super(_arg1, _arg3, _arg4);
_data = _arg2;
}
public function get data():Object{
return (_data);
}
}
}//package engine.controls.events
Section 19
//BasicControl (engine.controls.BasicControl)
package engine.controls {
import flash.display.*;
import flash.events.*;
import flash.text.*;
public class BasicControl {
protected var thisClip:MovieClip;
protected var _hit:Sprite;
protected var _enable:Boolean;
protected var _caption:TextField;
public function BasicControl(_arg1:MovieClip){
thisClip = _arg1;
thisClip.stop();
_hit = (thisClip.getChildByName("hit") as Sprite);
if (_hit){
thisClip.hitArea = _hit;
};
_caption = (thisClip.getChildByName("caption") as TextField);
thisClip.mouseChildren = false;
thisClip.addEventListener(MouseEvent.ROLL_OVER, mouseOverHandler);
thisClip.addEventListener(MouseEvent.ROLL_OUT, mouseOutHandler);
thisClip.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler);
thisClip.addEventListener(MouseEvent.MOUSE_UP, mouseUpHandler);
_enable = true;
}
protected function showOver():void{
}
public function get enable():Boolean{
return (_enable);
}
public function set enable(_arg1:Boolean):void{
_enable = _arg1;
if (_enable){
showEnable();
} else {
showDisable();
};
}
private function mouseUpHandler(_arg1:MouseEvent):void{
if (!enable){
return;
};
showUp();
}
public function set caption(_arg1:String):void{
if (!_caption){
return;
};
if (_caption.text == _arg1){
return;
};
_caption.text = _arg1;
}
public function get clip():MovieClip{
return (thisClip);
}
protected function showOut():void{
}
protected function showEnable():void{
thisClip.alpha = 1;
}
private function mouseOutHandler(_arg1:MouseEvent):void{
if (!enable){
return;
};
showOut();
}
private function mouseDownHandler(_arg1:MouseEvent):void{
if (!enable){
return;
};
showDown();
}
public function get caption():String{
if (!_caption){
return ("");
};
return (_caption.text);
}
protected function showDisable():void{
showOut();
thisClip.alpha = 0.5;
}
private function mouseOverHandler(_arg1:MouseEvent):void{
if (!enable){
return;
};
showOver();
}
public function hasEventListener(_arg1:String):Boolean{
return (thisClip.hasEventListener(_arg1));
}
protected function showUp():void{
}
public function destroy():void{
try {
thisClip.removeEventListener(MouseEvent.ROLL_OVER, mouseOverHandler);
} catch(e:Error) {
};
try {
thisClip.removeEventListener(MouseEvent.ROLL_OUT, mouseOutHandler);
} catch(e:Error) {
};
try {
thisClip.removeEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler);
} catch(e:Error) {
};
try {
thisClip.removeEventListener(MouseEvent.MOUSE_UP, mouseUpHandler);
} catch(e:Error) {
};
}
protected function showDown():void{
}
}
}//package engine.controls
Section 20
//ProgressBar (engine.controls.ProgressBar)
package engine.controls {
import flash.display.*;
import flash.text.*;
public class ProgressBar extends BasicControl {
private var _mask:MovieClip;
private var color_bar:MovieClip;
private var max_width:Number;// = 100
public function ProgressBar(_arg1:MovieClip){
super(_arg1);
_mask = (thisClip.getChildByName("_mask_") as MovieClip);
_caption = (thisClip.getChildByName("caption") as TextField);
color_bar = (thisClip.getChildByName("full") as MovieClip);
if (color_bar){
color_bar.stop();
};
if (_mask){
max_width = _mask.width;
};
}
public function set progress(_arg1:Number):void{
var _local2:Number = Math.max(Math.min(_arg1, 100), 0);
_mask.width = ((_local2 / 100) * max_width);
if (_caption){
_caption.text = (_local2.toString() + "%");
};
if (color_bar){
color_bar.gotoAndStop(Math.floor(((_local2 / 100) * 10)));
};
}
}
}//package engine.controls
Section 21
//AssetsLoaderEvent (engine.loader.AssetsLoaderEvent)
package engine.loader {
import flash.events.*;
public class AssetsLoaderEvent extends Event {
private var _data:Object;
public static const LOAD_PROGRESS:String = "load_progress";
public static const LOAD_SWF_COMPLETE:String = "load_swf_complete";
public static const SECURITY_ERROR:String = "security_error";
public static const LOAD_XML_COMPLETE:String = "load_xml_complete";
public static const IO_ERROR:String = "io_error";
public function AssetsLoaderEvent(_arg1:String, _arg2:Object=null, _arg3:Boolean=false, _arg4:Boolean=false){
super(_arg1, _arg3, _arg4);
_data = _arg2;
}
public function get data():Object{
return (_data);
}
}
}//package engine.loader
Section 22
//StringTable (engine.localization.StringTable)
package engine.localization {
public class StringTable {
private var _strings:Array;
private static var instance:StringTable = null;
private static var allow_instantiation:Boolean = false;
public function StringTable(){
if (!allow_instantiation){
throw (new Error("This is singleton class! Use getIntsance() static function instead!"));
};
_strings = new Array();
initDefault();
}
public function init(_arg1:XML):void{
var _local4:String;
var _local5:String;
var _local2:int = _arg1.children().length();
var _local3:int;
while (_local3 < _local2) {
_local4 = _arg1.string[_local3].@id;
_local5 = _arg1.string[_local3].@value;
_strings[_local4] = _local5;
_local3++;
};
}
private function initDefault():void{
_strings["str_NoPicturesLoaded"] = "No pictures were loaded";
_strings["str_NoPicture"] = "No picture";
}
public function get strings():Array{
return (_strings);
}
public static function getString(_arg1:String, _arg2:Boolean=false):String{
var _local3:String;
if (StringTable.getInstance().strings[_arg1]){
_local3 = String(StringTable.getInstance().strings[_arg1]);
if (_arg2){
_local3 = _local3.replace(/\[/g, "<");
_local3 = _local3.replace(/\]/g, ">");
};
return (_local3);
};
return (_arg1);
}
public static function getInstance():StringTable{
if (!instance){
allow_instantiation = true;
instance = new (StringTable);
allow_instantiation = false;
};
return (instance);
}
}
}//package engine.localization
Section 23
//Utils (engine.utils.Utils)
package engine.utils {
public class Utils {
public static function removeObjectFromList(_arg1:Array, _arg2:Object):Boolean{
if (((!(_arg2)) || (!(_arg1)))){
return (false);
};
var _local3:int = _arg1.indexOf(_arg2);
if (_local3 < 0){
return (false);
};
_arg1.splice(_local3, 1);
return (true);
}
public static function traceObject(_arg1:Object):String{
var _local3:String;
var _local2 = "";
for (_local3 in _arg1) {
_local2 = (_local2 + (((_local3 + " = ") + _arg1[_local3]) + "; \n"));
};
trace(_local2);
return (_local2);
}
public static function intToString(_arg1:int, _arg2:int):String{
var _local5:int;
var _local3:String = _arg1.toString();
if ((((_local3.length > _arg2)) || ((_arg1 < 0)))){
return (_local3);
};
var _local4 = "";
while (_local5 < (_arg2 - _local3.length)) {
_local4 = (_local4 + "0");
_local5++;
};
return ((_local4 + _local3));
}
public static function cloneObject(_arg1:Object):Object{
var _local2:Array;
var _local3:int;
var _local4:Object;
var _local5:String;
if (typeof(_arg1) == "object"){
if ((_arg1 is Array)){
_local2 = [];
while (_local3 < _arg1.length) {
_local2.push(cloneObject(_arg1[_local3]));
_local3++;
};
return (_local2);
} else {
_local4 = {};
for (_local5 in _arg1) {
_local4[_local5] = cloneObject(_arg1[_local5]);
};
return (_local4);
};
};
return (_arg1);
}
}
}//package engine.utils
Section 24
//Window (engine.windows.Window)
package engine.windows {
import flash.geom.*;
import flash.display.*;
import flash.events.*;
public class Window extends MovieClip {
protected var rect:Rectangle;
private var _blocked:Boolean;
private var blocker:Sprite;
public function Window(_arg1:Rectangle=null){
this.rect = _arg1;
this.addEventListener(Event.ADDED_TO_STAGE, addToStageHandler);
initBlocker();
blocked = false;
}
public function initOpen():void{
}
private function initBlocker():void{
blocker = new Sprite();
blocker.graphics.beginFill(0, 0.5);
if (rect){
blocker.graphics.drawRect(0, 0, rect.width, rect.height);
} else {
blocker.graphics.drawRect(0, 0, 0, 0);
};
blocker.graphics.endFill();
this.addChild(blocker);
}
public function get blocked():Boolean{
return (_blocked);
}
protected function addToStageHandler(_arg1:Event):void{
this.removeEventListener(Event.ADDED_TO_STAGE, addToStageHandler);
}
public function destroy():void{
}
public function resizeHandler():void{
if (blocker){
blocker.x = 0;
blocker.y = 0;
};
}
public function set blocked(_arg1:Boolean):void{
_blocked = _arg1;
if (blocker){
blocker.visible = _blocked;
};
}
}
}//package engine.windows
Section 25
//WindowEvent (engine.windows.WindowEvent)
package engine.windows {
import flash.events.*;
public class WindowEvent extends Event {
private var _data:Object;
public static const WIN_PAUSED:String = "window_paused";
public static const WIN_CLOSE:String = "window_close";
public static const WIN_OPEN:String = "window_open";
public function WindowEvent(_arg1:String, _arg2:Object=null, _arg3:Boolean=false, _arg4:Boolean=false){
super(_arg1, _arg3, _arg4);
_data = _arg2;
}
public function get data():Object{
return (_data);
}
}
}//package engine.windows
Section 26
//Application (engine.Application)
package engine {
import flash.geom.*;
import flash.display.*;
import flash.events.*;
import engine.windows.*;
public class Application extends MovieClip {
protected var _windows:Array;
protected var rectangle:Rectangle;
protected var cur_window:Window;
public function Application(){
_windows = [];
this.addEventListener(Event.ADDED_TO_STAGE, stageEventHandler);
}
protected function closeWindowHandler(_arg1:WindowEvent):void{
}
protected function pausedWindowHandler(_arg1:WindowEvent):void{
}
protected function stageEventHandler(_arg1:Event):void{
this.removeEventListener(Event.ADDED_TO_STAGE, stageEventHandler);
stage.scaleMode = StageScaleMode.NO_SCALE;
stage.addEventListener(Event.RESIZE, resizeHandler);
}
protected function closeCurrentWindow():void{
cur_window.removeEventListener(WindowEvent.WIN_CLOSE, closeWindowHandler);
cur_window.removeEventListener(WindowEvent.WIN_PAUSED, pausedWindowHandler);
cur_window.destroy();
this.removeChild(cur_window);
_windows.pop();
if (_windows.length > 0){
cur_window = _windows[(_windows.length - 1)];
} else {
cur_window = null;
};
}
protected function resizeHandler(_arg1:Event):void{
var _local2:int;
while (_local2 < _windows.length) {
if ((_windows[_local2] is Window)){
_windows[_local2].resizeHandler();
};
_local2++;
};
}
protected function closeAllWindows():void{
while (_windows.length > 0) {
closeCurrentWindow();
};
}
protected function openCurrentWindow():void{
if (cur_window){
cur_window.addEventListener(WindowEvent.WIN_CLOSE, closeWindowHandler);
cur_window.addEventListener(WindowEvent.WIN_PAUSED, pausedWindowHandler);
};
this.addChild(cur_window);
_windows.push(cur_window);
cur_window.initOpen();
}
}
}//package engine
Section 27
//IslandIcebergs (environment.islands.IslandIcebergs)
package environment.islands {
import environment.*;
public class IslandIcebergs extends Island {
public function IslandIcebergs(){
var _local1:IslandModel = new IslandModel(5000, 8000, [800, 400], 20, 5, 0, 100, 0.25, 0);
models.push(_local1);
_local1 = new IslandModel(5000, 8000, [1000, 500], 20, 5, 0, 100, 0.25, 1);
models.push(_local1);
_local1 = new IslandModel(5000, 8000, [800, 400], 20, 5, 0, 105, 0.25, 2);
models.push(_local1);
_local1 = new IslandModel(5000, 8000, [800, 400], 20, 5, 0, 115, 0.25, 3);
models.push(_local1);
_local1 = new IslandModel(5000, 8000, [800, 400], 20, 5, 0, 105, 0.25, 4);
models.push(_local1);
_local1 = new IslandModel(5000, 8000, [800, 400], 20, 5, 0, 105, 0.25, 5);
models.push(_local1);
_local1 = new IslandModel(5000, 8000, [800, 400], 20, 5, 0, 105, 0.25, 6);
models.push(_local1);
_local1 = new IslandModel(5000, 8000, [800, 400], 20, 5, 0, 106, 0.25, 7);
models.push(_local1);
}
override public function get type():String{
return (IslandsFactory.ICEBERG_ISLAND);
}
}
}//package environment.islands
Section 28
//IslandRocks (environment.islands.IslandRocks)
package environment.islands {
import environment.*;
public class IslandRocks extends Island {
public function IslandRocks(){
var _local1:IslandModel = new IslandModel(5000, 8000, [800, 400], 20, 5, 0, 95, 0.25, 0);
models.push(_local1);
_local1 = new IslandModel(5000, 8000, [1000, 500], 20, 5, 0, 100, 0.25, 1);
models.push(_local1);
_local1 = new IslandModel(5000, 8000, [800, 400], 20, 5, 0, 100, 0.25, 2);
models.push(_local1);
_local1 = new IslandModel(5000, 8000, [800, 400], 20, 5, 0, 100, 0.25, 3);
models.push(_local1);
_local1 = new IslandModel(5000, 8000, [800, 400], 20, 5, 0, 95, 0.25, 4);
models.push(_local1);
_local1 = new IslandModel(5000, 8000, [800, 400], 20, 5, 0, 100, 0.25, 5);
models.push(_local1);
_local1 = new IslandModel(5000, 8000, [800, 400], 20, 5, 0, 100, 0.25, 6);
models.push(_local1);
_local1 = new IslandModel(5000, 8000, [800, 400], 20, 5, 0, 105, 0.25, 7);
models.push(_local1);
}
override public function get type():String{
return (IslandsFactory.ROCK_ISLAND);
}
}
}//package environment.islands
Section 29
//IslandsFactory (environment.islands.IslandsFactory)
package environment.islands {
import environment.*;
public class IslandsFactory {
public static const ICEBERG_ISLAND:String = "islands_ice";
public static const TROPIC_ISLAND:String = "islands_trop";
public static const ROCK_ISLAND:String = "islands_rock";
public static function getIsland(_arg1:String):Island{
switch (_arg1){
case ICEBERG_ISLAND:
return (new IslandIcebergs());
case ROCK_ISLAND:
return (new IslandRocks());
case TROPIC_ISLAND:
return (new IslandTropics());
};
return (new IslandRocks());
}
}
}//package environment.islands
Section 30
//IslandTropics (environment.islands.IslandTropics)
package environment.islands {
import environment.*;
public class IslandTropics extends Island {
public function IslandTropics(){
var _local1:IslandModel = new IslandModel(5000, 8000, [800, 400], 20, 5, 0, 110, 0.25, 0);
models.push(_local1);
_local1 = new IslandModel(8100, 9000, [1000, 500], 20, 5, 0, 110, 0.25, 1);
models.push(_local1);
_local1 = new IslandModel(5000, 8000, [800, 400], 20, 5, 0, 108, 0.25, 2);
models.push(_local1);
_local1 = new IslandModel(5000, 8000, [800, 400], 20, 5, 0, 110, 0.25, 3);
models.push(_local1);
_local1 = new IslandModel(5000, 8000, [800, 400], 20, 5, 0, 108, 0.25, 4);
models.push(_local1);
_local1 = new IslandModel(5000, 8000, [800, 400], 20, 5, 0, 110, 0.25, 5);
models.push(_local1);
_local1 = new IslandModel(5000, 8000, [800, 400], 20, 5, 0, 112, 0.25, 6);
models.push(_local1);
_local1 = new IslandModel(5000, 8000, [800, 400], 20, 5, 0, 108, 0.25, 7);
models.push(_local1);
}
override public function get type():String{
return (IslandsFactory.TROPIC_ISLAND);
}
}
}//package environment.islands
Section 31
//Cloud (environment.Cloud)
package environment {
import flash.display.*;
public class Cloud extends MovieClip {
private var delta_x:Number;// = 0
private var _z:Number;// = 500
public static const WIDTH:Number = 0x0100;
public static const MIN_Z:Number = 8;
public static const MAX_SCALE:Number = 1;
public static const DEF_SPPED:Number = 0.1;
public static const MIN_SCALE:Number = 0.1;
public static const MAX_Z:Number = 1000;
public function Cloud(_arg1:int){
this.stop();
if ((((_arg1 > 0)) && ((_arg1 < this.totalFrames)))){
this.gotoAndStop(_arg1);
};
}
public function set z(_arg1:Number):void{
_z = Math.min(MAX_Z, Math.max(MIN_Z, _arg1));
var _local2:Number = ((((_z - MIN_Z) * (MIN_SCALE - MAX_SCALE)) / (MAX_Z - MIN_Z)) + MAX_SCALE);
this.scaleX = _local2;
this.scaleY = _local2;
delta_x = DEF_SPPED;
}
public function move(_arg1:Number):Boolean{
this.x = (this.x + delta_x);
return ((this.x < _arg1));
}
}
}//package environment
Section 32
//CloudsContainer (environment.CloudsContainer)
package environment {
import flash.display.*;
import gamelibrary.*;
public class CloudsContainer {
private var thisClip:MovieClip;
private var _paused:Boolean;// = false
private var clouds:Array;
private static const X_FIELD:Number = 30;
public function CloudsContainer(_arg1:MovieClip){
thisClip = _arg1;
clouds = [];
_paused = false;
}
public function destroy():void{
}
private function addCloud(_arg1:Boolean=false):void{
var _local2:int = (Math.floor((Math.random() * 8)) + 1);
var _local3:Cloud = new Cloud(_local2);
_local3.z = (Cloud.MIN_Z + (Math.random() * (Cloud.MAX_Z - Cloud.MIN_Z)));
thisClip.addChild(_local3);
if (_arg1){
_local3.x = (-(X_FIELD) - Cloud.WIDTH);
} else {
_local3.x = ((Math.random() * (PiratesL.SCREEN_WIDTH + (2 * X_FIELD))) - X_FIELD);
};
_local3.y = (Math.random() * 150);
clouds.push(_local3);
}
public function initClouds(_arg1:int):void{
var _local2:int;
while (_local2 < _arg1) {
addCloud();
_local2++;
};
}
public function enterFrameHandler():void{
var _local2:Cloud;
var _local3:int;
if (_paused){
return;
};
var _local1:int;
while (_local1 < clouds.length) {
_local2 = clouds[_local1];
if (!_local2.move((PiratesL.SCREEN_WIDTH + X_FIELD))){
thisClip.removeChild(_local2);
_local3 = clouds.indexOf(_local2);
clouds.splice(_local3, 1);
_local1--;
addCloud(true);
};
_local1++;
};
}
public function set pause(_arg1:Boolean):void{
_paused = _arg1;
}
}
}//package environment
Section 33
//Island (environment.Island)
package environment {
import flash.display.*;
import environment.islands.*;
public class Island extends MovieClip {
protected var num_models:int;// = 8
protected var models:Array;
private var delta_x:Number;// = 0
private var _x:Number;
public static const WIDTH:Number = 0x0100;
public static const HEIGHT:Number = 128;
public function Island(){
models = [];
}
public function init(_arg1:Number, _arg2:Number):void{
var _local3:int = (Math.random() * models.length);
var _local4:IslandModel = models[_local3];
this.gotoAndStop((_local4._frame + 1));
delta_x = _arg2;
_x = _arg1;
this.x = _x;
var _local5:Number = 0.5;
this.scaleX = _local5;
this.scaleY = _local5;
this.y = (214 - (_local5 * 100));
}
public function move(_arg1:Number):Boolean{
_x = (_x + delta_x);
this.x = Math.floor(_x);
return ((this.x < _arg1));
}
public function get type():String{
return (IslandsFactory.ICEBERG_ISLAND);
}
}
}//package environment
Section 34
//IslandModel (environment.IslandModel)
package environment {
public class IslandModel {
public var _size:Array;
public var _near_z:Number;// = 5000
public var _speed:Number;// = 20
public var _scale_var:Number;// = 0.25
public var _frame:Number;// = 0
public var _speed_var:Number;// = 5
public var _far_z:Number;// = 8000
public var _y_offset:Number;// = 121.875
public var _y:Number;// = 0
public function IslandModel(_arg1:Number, _arg2:Number, _arg3:Array, _arg4:Number, _arg5:Number, _arg6:Number, _arg7:Number, _arg8:Number, _arg9:Number){
_size = [800, 400];
super();
_near_z = _arg1;
_far_z = _arg2;
_size = _arg3;
_speed = _arg4;
_speed_var = _arg5;
_y = _arg6;
_y_offset = _arg7;
_scale_var = _arg8;
_frame = _arg9;
}
}
}//package environment
Section 35
//IslandsCotainer (environment.IslandsCotainer)
package environment {
import flash.display.*;
import gamelibrary.*;
import environment.islands.*;
public class IslandsCotainer {
private var spawn_timer:int;
private var island_type:String;
private var thisClip:MovieClip;
private var island_speed:Number;
private var islands:Array;
private static const SPAWN_TIME:Number = 620;
private static const X_FIELD:Number = 30;
private static const MAX_NUM:int = 6;
public function IslandsCotainer(_arg1:MovieClip){
thisClip = _arg1;
islands = [];
}
public function destroy():void{
}
public function enterFrameHandler():void{
var _local2:Island;
var _local3:int;
var _local1:int;
while (_local1 < islands.length) {
_local2 = islands[_local1];
if (!_local2.move((PiratesL.SCREEN_WIDTH + X_FIELD))){
thisClip.removeChild(_local2);
_local3 = islands.indexOf(_local2);
islands.splice(_local3, 1);
_local1--;
};
_local1++;
};
if (++spawn_timer >= SPAWN_TIME){
spawn_timer = 0;
if (islands.length < MAX_NUM){
addIsland(island_type, 1);
};
};
}
public function initIslands(_arg1:String):void{
island_type = _arg1;
var _local2:int = ((Math.random() * (MAX_NUM - 2)) + 2);
island_speed = (((20 + (((Math.random() * 2) - 1) * 5)) / 31) * 0.5);
var _local3:int;
while (_local3 < _local2) {
addIsland(island_type, _local2, _local3);
_local3++;
};
}
private function addIsland(_arg1:String, _arg2:int=1, _arg3:int=0):void{
var _local6:Number;
var _local7:Number;
var _local4:Island = IslandsFactory.getIsland(_arg1);
var _local5:Number = 0;
if (_arg2 == 1){
_local5 = (-(X_FIELD) - Island.WIDTH);
} else {
_local6 = ((PiratesL.SCREEN_WIDTH / _arg2) * _arg3);
_local7 = ((PiratesL.SCREEN_WIDTH / _arg2) * (_arg3 + 1));
_local5 = (_local6 + ((_local7 - _local6) * Math.random()));
};
_local4.init(_local5, island_speed);
islands.push(_local4);
thisClip.addChild(_local4);
}
}
}//package environment
Section 36
//Sky (environment.Sky)
package environment {
import flash.display.*;
import flash.events.*;
public class Sky {
private var timer:int;// = 0
private var speed:int;// = 1
private var sky_clip:MovieClip;
private var main_clip:MovieClip;
private var _pause:Boolean;
public function Sky(_arg1:MovieClip, _arg2:MovieClip):void{
sky_clip = _arg1;
main_clip = _arg2;
main_clip.mouseEnabled = false;
sky_clip.stop();
main_clip.stop();
sky_clip.addEventListener(Event.ENTER_FRAME, enterFrameHandler);
_pause = false;
}
public function getTime():Number{
return (((sky_clip.currentFrame / sky_clip.totalFrames) * 24));
}
private function enterFrameHandler(_arg1:Event):void{
if (_pause){
return;
};
if (timer++ > speed){
sky_clip.nextFrame();
main_clip.nextFrame();
if (sky_clip.currentFrame == sky_clip.totalFrames){
sky_clip.gotoAndStop(1);
main_clip.gotoAndStop(1);
};
timer = 0;
};
}
public function set pause(_arg1:Boolean):void{
_pause = _arg1;
}
public function setTime(_arg1:Number):void{
var _local2:int = (sky_clip.totalFrames / 24);
var _local3:int = Math.floor((_arg1 * _local2));
sky_clip.gotoAndStop(_local3);
main_clip.gotoAndStop(_local3);
}
public function destroy():void{
sky_clip.removeEventListener(Event.ENTER_FRAME, enterFrameHandler);
}
}
}//package environment
Section 37
//CannonBall (game.cannonball.CannonBall)
package game.cannonball {
import flash.geom.*;
import utils.*;
import flash.display.*;
import gamelibrary.*;
public class CannonBall extends MovieClip {
private var _real_size:Point;
private var _position:Point3D;
private var _info:CannonBallInfo;
private var _damage:Number;
public var enemy:Boolean;// = true
private var use_gravitation:Boolean;// = false
public var hit:MovieClip;
private var swim_timer:int;
public var target_line:int;// = 0
public var gl:MovieClip;
public var isSwimming:Boolean;// = false
private var _glow:MovieClip;
public var will_hit:Boolean;// = true
public var accuracy:Number;// = 1
private var _velocity:Point3D;
public var rejected:Boolean;// = false
public function CannonBall(_arg1:CannonBallInfo, _arg2:Boolean){
this.hitArea = (this.getChildByName("hit")) ? (this.getChildByName("hit") as Sprite) : this;
_info = _arg1;
var _local3:int = ((2 * _info.index) + (_arg2) ? 2 : 1);
this.gotoAndStop(_local3);
_real_size = new Point((_info.load_size[0] * Point3D.RESIZE_COEF), (_info.load_size[1] * Point3D.RESIZE_COEF));
_glow = (this.getChildByName("gl") as MovieClip);
_glow.visible = false;
rejected = false;
isSwimming = false;
}
public function destroy():void{
}
public function move(_arg1:Boolean=false, _arg2:Boolean=false):void{
if (isSwimming){
return;
};
if (use_gravitation){
velocity.y = (velocity.y + GameConsts.GRAVIATATION);
};
var _local3:Number = _velocity.x;
if (_arg1){
_velocity.x = (_velocity.x - 0.5);
};
if (_arg2){
_velocity.x = (_velocity.x + 0.5);
};
position = new Point3D((_position.x + _velocity.x), (_position.y + _velocity.y), (_position.z + _velocity.z));
}
public function set position(_arg1:Point3D):void{
_position = _arg1;
var _local2:Point = _position.getProection();
this.x = _local2.x;
this.y = _local2.y;
var _local3:Point = Point3D.getSize(_real_size, _position.z);
this.width = _local3.x;
this.height = _local3.y;
}
public function get useGravitation():Boolean{
return (use_gravitation);
}
public function startSwim():void{
if (!isSwimming){
isSwimming = true;
swim_timer = GameConsts.mine_swimming_time;
this.gotoAndStop((this.currentFrame + 1));
};
}
public function set glow(_arg1:Boolean):void{
_glow.visible = _arg1;
}
public function set useGravitation(_arg1:Boolean):void{
use_gravitation = _arg1;
}
public function get position():Point3D{
return (_position);
}
public function canHit():Boolean{
if (info.index == 8){
return (isSwimming);
};
return (true);
}
public function sink():Boolean{
return (((isSwimming) && ((swim_timer < 0))));
}
public function get info():CannonBallInfo{
return (_info);
}
public function setDamage(_arg1:Number):void{
_damage = _arg1;
}
public function getDamage():Number{
return (_damage);
}
public function get velocity():Point3D{
return (_velocity);
}
public function enterFrameHandler():void{
if (isSwimming){
swim_timer--;
};
}
public function set velocity(_arg1:Point3D):void{
_velocity = _arg1;
}
public function reflect():void{
var _local1:int = ((2 * _info.index) + 1);
this.gotoAndStop(_local1);
}
}
}//package game.cannonball
Section 38
//CannonBallRounds (game.cannonball.CannonBallRounds)
package game.cannonball {
import flash.display.*;
import gamelibrary.*;
import flash.text.*;
public class CannonBallRounds extends MovieClip {
private var _enable:Boolean;// = true
public var caption:TextField;
private var _info:CannonBallInfo;
private var _clip:MovieClip;
public var clip:MovieClip;
public var index:int;// = -1
private var _caption:TextField;
private var _count:int;
public function CannonBallRounds(){
_clip = (this.getChildByName("clip") as MovieClip);
_clip.stop();
_caption = (this.getChildByName("caption") as TextField);
_caption.text = "100";
this.buttonMode = true;
this.useHandCursor = true;
this.mouseChildren = false;
}
public function get enable():Boolean{
return (_enable);
}
public function set count(_arg1:int):void{
_count = _arg1;
if (_count <= 0){
_clip.gotoAndStop(1);
_caption.visible = false;
enable = false;
} else {
_clip.gotoAndStop((_info.index + 1));
_caption.visible = true;
_caption.text = _count.toString();
enable = true;
};
}
public function set enable(_arg1:Boolean):void{
_enable = _arg1;
this.alpha = (_enable) ? 1 : 0.5;
}
public function get count():int{
return (_count);
}
public function get info():CannonBallInfo{
return (_info);
}
public function set info(_arg1:CannonBallInfo):void{
_info = _arg1;
var _local2:int = (_info.index + 1);
_clip.gotoAndStop(_local2);
}
}
}//package game.cannonball
Section 39
//DragedBall (game.cannonball.DragedBall)
package game.cannonball {
import flash.display.*;
import gamelibrary.*;
public class DragedBall extends MovieClip {
public var round_index:int;// = -1
private var _info:CannonBallInfo;
public function DragedBall(_arg1:CannonBallInfo){
_info = _arg1;
gotoAndStop((_info.index + 1));
}
public function get info():CannonBallInfo{
return (_info);
}
}
}//package game.cannonball
Section 40
//Cannon (game.cannons.Cannon)
package game.cannons {
import flash.display.*;
import gamelibrary.*;
import engine.controls.*;
import sound.*;
public class Cannon extends MovieClip {
protected const NUM_CHARGE_FRAMES:int = 15;
protected var _power:Number;
protected var charge_bar:MovieClip;
protected var shots_count:Number;// = 0
protected var _type:int;// = 0
protected var paramters:CannonParameters;
protected var _enable:Boolean;// = true
public var is_playing:Boolean;// = false
protected var health_progress:ProgressBar;
protected var _empty:Boolean;// = true
protected var _charging:Boolean;// = false
public var index:int;// = -1
protected var _power_per_frame:Number;
protected var _ball:CannonBallInfo;// = null
protected var round_index:int;// = -1
private var _enable_timer:int;
protected var _broken:Boolean;
protected var shoot_clip:MovieClip;
public function Cannon(_arg1:int){
this.hitArea = (this.getChildByName("hit")) ? (this.getChildByName("hit") as Sprite) : this;
this.hitArea.buttonMode = true;
this.hitArea.useHandCursor = true;
shoot_clip = (this.getChildByName("shoot_cl") as MovieClip);
shoot_clip.stop();
shoot_clip.visible = false;
if (this.getChildByName("progress")){
health_progress = new ProgressBar((this.getChildByName("progress") as MovieClip));
health_progress.clip.visible = false;
};
charge_bar = (this.getChildByName("charge") as MovieClip);
charge_bar.gotoAndStop(1);
_enable = true;
this.shots_count = _arg1;
}
public function get enable():Boolean{
return (_enable);
}
public function get power():Number{
return (_power);
}
public function setEmpty():void{
this.gotoAndStop("load");
_ball = null;
}
public function set enable(_arg1:Boolean):void{
if (_enable == _arg1){
return;
};
_enable = _arg1;
this.alpha = (_enable) ? 1 : 0.5;
if (!enable){
_enable_timer = (10 * 31);
setEmpty();
_power = 0;
};
}
public function dropBall():void{
_ball = null;
}
public function get prevRoundIndex():Array{
return ([round_index]);
}
public function enterFrameHandler():void{
if (_charging){
_power = (_power + _power_per_frame);
if (_power > 1){
_power = 1;
};
charge_bar.gotoAndStop(Math.floor((_power * NUM_CHARGE_FRAMES)));
};
if (!_enable){
if (_enable_timer-- < 0){
enable = true;
} else {
if (_enable_timer < 60){
this.alpha = (((_enable_timer % 4))<2) ? 0.5 : 1;
};
};
};
}
protected function init():void{
paramters = GameConsts.getCannonParams(_type);
_broken = (shots_count == paramters.num_shots);
_power = 0;
if (((paramters) && (health_progress))){
health_progress.progress = (((paramters.num_shots - shots_count) / paramters.num_shots) * 100);
};
if (broken){
this.gotoAndStop("broken");
};
_power_per_frame = (1 / (31 * paramters.charge_time));
}
public function shoot():void{
charge_bar.gotoAndStop(1);
_charging = false;
this.gotoAndPlay("shoot");
_empty = true;
shoot_clip.gotoAndPlay(1);
shoot_clip.visible = true;
shots_count++;
health_progress.progress = (((paramters.num_shots - shots_count) / paramters.num_shots) * 100);
_broken = (shots_count == paramters.num_shots);
if (broken){
this.gotoAndStop("broken");
SoundManager.playSound("broke");
} else {
is_playing = true;
};
}
public function ready():void{
}
public function startCharge():void{
this.gotoAndPlay("charge");
_charging = true;
_power = 0;
}
public function get type():int{
return (_type);
}
public function get isCharging():Boolean{
return (_charging);
}
public function set barVisible(_arg1:Boolean):void{
health_progress.clip.visible = _arg1;
}
public function get empty():Boolean{
return (_empty);
}
public function get balls():Array{
if (!_ball){
return ([]);
};
return ([_ball.index]);
}
public function get broken():Boolean{
return (_broken);
}
public function get shotsCount():int{
return (shots_count);
}
public function load(_arg1:CannonBallInfo, _arg2:int):int{
var _local3:int = this.round_index;
this.round_index = _arg2;
if (((empty) || (!(_ball)))){
is_playing = true;
this.gotoAndPlay("load");
_empty = false;
_ball = _arg1;
return (-2);
};
if (_arg1.type != _ball.type){
is_playing = true;
this.gotoAndPlay("reload");
_empty = false;
_ball = _arg1;
return (_local3);
};
is_playing = true;
this.gotoAndPlay("reload");
return (-1);
}
public function set pause(_arg1:Boolean):void{
if (_arg1){
this.stop();
shoot_clip.stop();
} else {
if (is_playing){
this.play();
};
if (shoot_clip.visible){
shoot_clip.play();
};
};
}
public function get ball():CannonBallInfo{
return (_ball);
}
}
}//package game.cannons
Section 41
//CannonFirst (game.cannons.CannonFirst)
package game.cannons {
import flash.display.*;
public class CannonFirst extends Cannon {
public var shoot_cl:MovieClip;
public var progress:MovieClip;
public var hit:MovieClip;
public var charge:MovieClip;
public function CannonFirst(_arg1:int){
var _local2:MovieClip;
addFrameScript(25, frame26, 36, frame37, 41, frame42, 43, frame44, 52, frame53);
super(_arg1);
_type = 0;
init();
}
function frame53(){
stop();
}
function frame42(){
stop();
(this as Cannon).ready();
}
function frame37(){
gotoAndStop("load");
(this as Cannon).is_playing = false;
}
function frame26(){
gotoAndPlay("shake");
}
function frame44(){
stop();
}
}
}//package game.cannons
Section 42
//CannonFourth (game.cannons.CannonFourth)
package game.cannons {
import flash.display.*;
import gamelibrary.*;
import game.*;
public class CannonFourth extends Cannon {
private var timer:int;
private var last_ball:CannonBallInfo;// = null
public var shoot_cl:MovieClip;
private var make_shoot:Boolean;// = false
public var hit:MovieClip;
private var _balls:Array;
public var progress:MovieClip;
public var charge:MovieClip;
public function CannonFourth(_arg1:int){
var _local2:MovieClip;
addFrameScript(25, frame26, 33, frame34, 41, frame42, 45, frame46, 69, frame70);
super(_arg1);
_type = 3;
_balls = [];
init();
}
function frame70(){
gotoAndStop("load");
}
override public function get balls():Array{
var _local1:Array = [];
var _local2:int;
while (_local2 < _balls.length) {
_local1.push(_balls[_local2][0].index);
_local2++;
};
return (_local1);
}
override public function enterFrameHandler():void{
super.enterFrameHandler();
if (make_shoot){
if (timer++ > 22){
dispatchEvent(new GameEvent(GameEvent.SHOT_AGAIN));
};
};
}
function frame34(){
gotoAndStop("load");
(this as Cannon).is_playing = false;
}
override public function shoot():void{
charge_bar.gotoAndStop(1);
_charging = false;
if (_balls.length == 1){
this.gotoAndPlay("shoot");
} else {
this.gotoAndPlay("shoot_multy");
};
shoot_clip.gotoAndPlay(1);
shoot_clip.visible = true;
last_ball = _balls.shift()[0];
if (_balls.length > 0){
make_shoot = true;
timer = 0;
} else {
make_shoot = false;
_empty = true;
};
}
function frame42(){
stop();
(this as Cannon).ready();
}
function frame46(){
stop();
}
function frame26(){
gotoAndPlay("shake");
}
override public function load(_arg1:CannonBallInfo, _arg2:int):int{
_balls.push([_arg1, _arg2]);
var _local3:Array;
if (_balls.length > 3){
_local3 = _balls.shift();
};
if (empty){
this.gotoAndPlay("load");
_empty = false;
_ball = _arg1;
return (-2);
};
this.gotoAndPlay("load_more");
if (_local3){
return (_local3[1]);
};
return (-2);
}
override public function get prevRoundIndex():Array{
var _local1:Array = [];
var _local2:int;
while (_local2 < _balls.length) {
_local1.push(_balls[_local2][1]);
_local2++;
};
return (_local1);
}
override public function get ball():CannonBallInfo{
return (last_ball);
}
}
}//package game.cannons
Section 43
//CannonSecond (game.cannons.CannonSecond)
package game.cannons {
import flash.display.*;
public class CannonSecond extends Cannon {
public var shoot_cl:MovieClip;
public var progress:MovieClip;
public var hit:MovieClip;
public var charge:MovieClip;
public function CannonSecond(_arg1:int){
var _local2:MovieClip;
addFrameScript(25, frame26, 36, frame37, 39, frame40, 43, frame44, 54, frame55);
super(_arg1);
_type = 1;
init();
}
function frame55(){
stop();
}
function frame40(){
stop();
(this as Cannon).ready();
}
function frame37(){
gotoAndStop("load");
(this as Cannon).is_playing = false;
}
function frame26(){
gotoAndPlay("shake");
}
function frame44(){
stop();
}
}
}//package game.cannons
Section 44
//CannonThird (game.cannons.CannonThird)
package game.cannons {
import flash.display.*;
public class CannonThird extends Cannon {
public var shoot_cl:MovieClip;
public var progress:MovieClip;
public var hit:MovieClip;
public var charge:MovieClip;
public function CannonThird(_arg1:int){
var _local2:MovieClip;
addFrameScript(25, frame26, 36, frame37, 41, frame42, 43, frame44, 48, frame49);
super(_arg1);
_type = 2;
init();
}
function frame42(){
stop();
(this as Cannon).ready();
}
function frame37(){
gotoAndStop("load");
(this as Cannon).is_playing = false;
}
function frame26(){
gotoAndPlay("shake");
}
function frame49(){
stop();
}
function frame44(){
stop();
}
}
}//package game.cannons
Section 45
//AttachedEffect (game.effects.AttachedEffect)
package game.effects {
import flash.geom.*;
import flash.display.*;
import flash.events.*;
import game.managment.*;
public class AttachedEffect extends BaseEffect {
private var delta_position:Point;
private var object:DisplayObject;// = null
public function AttachedEffect(_arg1:EffectsManager){
super(_arg1);
this.addEventListener(Event.ENTER_FRAME, enterFrameHandler);
}
private function enterFrameHandler(_arg1:Event):void{
if (object){
this.x = (object.x + delta_position.x);
this.y = (object.y + delta_position.y);
};
}
public function attachToObject(_arg1:DisplayObject, _arg2:Number, _arg3:Number):void{
this.object = _arg1;
delta_position = new Point(_arg2, _arg3);
}
override public function destroy():void{
super.destroy();
object = null;
this.removeEventListener(Event.ENTER_FRAME, enterFrameHandler);
}
}
}//package game.effects
Section 46
//BaseEffect (game.effects.BaseEffect)
package game.effects {
import flash.display.*;
import game.managment.*;
public class BaseEffect extends MovieClip {
protected var _manager:EffectsManager;
private var _paused:Boolean;
private var _playing:Boolean;
public function BaseEffect(_arg1:EffectsManager){
_manager = _arg1;
_playing = false;
_paused = false;
if (_manager){
_manager.addEffect(this);
};
}
public function destroy():void{
if (_manager){
_manager.removeEffect(this);
};
this.stop();
if (this.parent){
this.parent.removeChild(this);
};
}
public function setPos(_arg1:Number, _arg2:Number):void{
this.x = _arg1;
this.y = _arg2;
}
public function setPause(_arg1:Boolean):void{
if (_paused == _arg1){
return;
};
_paused = _arg1;
if (_paused){
this.stop();
} else {
if (_playing){
this.play();
};
};
}
public function startPlay():void{
_playing = true;
if (!_paused){
this.play();
};
}
public function setScale(_arg1:Number, _arg2:Number):void{
this.scaleX = _arg1;
this.scaleY = _arg2;
}
}
}//package game.effects
Section 47
//DrunkClip (game.effects.DrunkClip)
package game.effects {
import game.managment.*;
public class DrunkClip extends AttachedEffect {
public function DrunkClip(_arg1:EffectsManager){
super(_arg1);
}
}
}//package game.effects
Section 48
//FireClip (game.effects.FireClip)
package game.effects {
import game.managment.*;
public class FireClip extends AttachedEffect {
public function FireClip(_arg1:EffectsManager){
super(_arg1);
}
}
}//package game.effects
Section 49
//MoneyPopUp (game.effects.MoneyPopUp)
package game.effects {
import flash.display.*;
import game.managment.*;
import flash.text.*;
public class MoneyPopUp extends BaseEffect {
public var clip:MovieClip;
public function MoneyPopUp(_arg1:EffectsManager, _arg2:int){
addFrameScript(42, frame43);
super(_arg1);
((this.getChildByName("clip") as MovieClip).getChildByName("caption") as TextField).text = _arg2.toString();
}
function frame43(){
destroy();
}
}
}//package game.effects
Section 50
//MonkeyCapture (game.effects.MonkeyCapture)
package game.effects {
import game.managment.*;
public class MonkeyCapture extends AttachedEffect {
public function MonkeyCapture(_arg1:EffectsManager){
addFrameScript(31, frame32);
super(_arg1);
}
function frame32(){
destroy();
}
}
}//package game.effects
Section 51
//OctopusLure (game.effects.OctopusLure)
package game.effects {
import game.managment.*;
public class OctopusLure extends AttachedEffect {
public function OctopusLure(_arg1:EffectsManager){
addFrameScript(55, frame56);
super(_arg1);
}
function frame56(){
stop();
}
}
}//package game.effects
Section 52
//PointsPopUp (game.effects.PointsPopUp)
package game.effects {
import flash.display.*;
import game.managment.*;
import flash.text.*;
public class PointsPopUp extends BaseEffect {
public var clip:MovieClip;
public function PointsPopUp(_arg1:EffectsManager, _arg2:int){
addFrameScript(42, frame43);
super(_arg1);
((this.getChildByName("clip") as MovieClip).getChildByName("caption") as TextField).text = _arg2.toString();
}
function frame43(){
destroy();
}
}
}//package game.effects
Section 53
//ShipHitClip (game.effects.ShipHitClip)
package game.effects {
import game.managment.*;
public class ShipHitClip extends AttachedEffect {
public function ShipHitClip(_arg1:EffectsManager){
addFrameScript(21, frame22);
super(_arg1);
}
function frame22(){
this.destroy();
}
}
}//package game.effects
Section 54
//ShipHitClipBomb (game.effects.ShipHitClipBomb)
package game.effects {
import game.managment.*;
public class ShipHitClipBomb extends AttachedEffect {
public function ShipHitClipBomb(_arg1:EffectsManager){
addFrameScript(24, frame25);
super(_arg1);
}
function frame25(){
this.destroy();
}
}
}//package game.effects
Section 55
//WaterSplash (game.effects.WaterSplash)
package game.effects {
import game.managment.*;
public class WaterSplash extends BaseEffect {
public function WaterSplash(_arg1:EffectsManager){
addFrameScript(63, frame64);
super(_arg1);
}
function frame64(){
destroy();
}
}
}//package game.effects
Section 56
//CannonManager (game.managment.CannonManager)
package game.managment {
import flash.geom.*;
import flash.display.*;
import flash.events.*;
import game.save.*;
import gamelibrary.*;
import profile.*;
import game.*;
import game.cannons.*;
import game.cannonball.*;
import tutorial.*;
import sound.*;
public class CannonManager extends EventDispatcher {
private var current_ball:DragedBall;
private var current_round:CannonBallRounds;// = null
private var cannon_layer:Sprite;
private var cannonball_rounds:Array;
private var prof:Profile;
private var num_cannons:int;
private var _cannons:Array;
private var dragged_layer:Sprite;
private static const CANNON_SCALE:Number = 1.32;
public function CannonManager(_arg1:Sprite, _arg2:Sprite){
var _local5:SaveCannonData;
var _local6:Cannon;
var _local7:Point;
var _local8:int;
super();
this.cannon_layer = _arg1;
this.dragged_layer = _arg2;
_cannons = [];
prof = ProfileManager.getInstance().currentProfile;
var _local3:Array = prof.cannons;
num_cannons = _local3.length;
var _local4:int;
while (_local4 < num_cannons) {
_local5 = _local3[_local4];
_local6 = (_local5) ? getCannon(_local5.index, _local5.shots_count) : getCannon(-1, 0);
if (_local6){
_local6.scaleX = CANNON_SCALE;
_local6.scaleY = CANNON_SCALE;
_local7 = GameConsts.getCannonParams(_local6.type).getPositionAt(_local4);
_local6.x = _local7.x;
_local6.y = _local7.y;
_arg1.addChild(_local6);
_local6.setEmpty();
_local6.index = _local4;
_local6.hitArea.addEventListener(MouseEvent.MOUSE_DOWN, cannonDownHandler);
_local6.hitArea.addEventListener(MouseEvent.MOUSE_UP, cannonUpHandler);
_local6.hitArea.addEventListener(MouseEvent.ROLL_OUT, cannonUpHandler);
_local6.addEventListener(GameEvent.SHOT_AGAIN, shotAgainHandler);
if (_local5.balls){
_local8 = 0;
while (_local8 < _local5.balls.length) {
_local6.load(GameConsts.getBallParamsByIndex(_local5.balls[_local8]), _local5.prev_round_index[_local8]);
_local8++;
};
};
};
_cannons.push(_local6);
_local4++;
};
cannonball_rounds = [];
current_round = null;
}
private function getRandomEnableCannon():Cannon{
var _local4:Cannon;
var _local1:Array = [];
var _local2:int;
while (_local2 < _cannons.length) {
_local4 = _cannons[_local2];
if (!_local4){
} else {
if (!_local4.enable){
} else {
_local1.push(_local2);
};
};
_local2++;
};
if (_local1.length == 0){
return (null);
};
var _local3:int = Math.floor((Math.random() * _local1.length));
return (_cannons[_local1[_local3]]);
}
public function destroy():void{
var _local1:int;
while (_local1 < num_cannons) {
if (_cannons[_local1]){
_cannons[_local1].hitArea.removeEventListener(MouseEvent.MOUSE_DOWN, cannonDownHandler);
_cannons[_local1].hitArea.removeEventListener(MouseEvent.MOUSE_UP, cannonUpHandler);
};
_local1++;
};
_local1 = 0;
while (_local1 < cannonball_rounds.length) {
if (cannonball_rounds[_local1]){
cannonball_rounds[_local1].removeEventListener(MouseEvent.MOUSE_DOWN, roundDownHandler);
};
_local1++;
};
}
private function cannonDownHandler(_arg1:MouseEvent):void{
if (((!(_arg1.currentTarget.parent)) || (!((_arg1.currentTarget.parent is Cannon))))){
return;
};
var _local2:Cannon = (_arg1.currentTarget.parent as Cannon);
if (!_local2.empty){
_local2.startCharge();
};
}
public function init(_arg1:LevelInfo):void{
var _local2:int;
var _local5:CannonBallRounds;
var _local6:SaveRoundsData;
var _local7:Cannon;
var _local3:Array = prof.rounds;
var _local4:Boolean;
_local2 = 0;
while (_local2 < cannonball_rounds.length) {
_local5 = cannonball_rounds[_local2];
if (_local3[_local2]){
_local6 = _local3[_local2];
_local5.info = GameConsts.getBallParamsByIndex(_local6.index);
_local5.count = _local6.count;
} else {
_local5.info = GameConsts.getBallParamsByIndex(0);
_local5.count = 0;
_local4 = false;
};
_local5.visible = !((prof.currentLevel == 0));
_local2++;
};
if (!_local4){
TutorialManager.getInstance().notifyEvent("ammo_empty_in_game(1)");
};
_local2 = 0;
while (_local2 < _cannons.length) {
_local7 = _cannons[_local2];
if (((_local7) && ((_local7 is CannonFourth)))){
TutorialManager.getInstance().notifyEvent("cannon3_present(1)");
break;
};
_local2++;
};
}
public function notifyHit(_arg1:int):void{
var _local2:Cannon;
if (_arg1 == 3){
_local2 = getRandomEnableCannon();
if (_local2){
_local2.enable = false;
};
};
}
public function enterFrameHandler():void{
var _local1:int;
while (_local1 < _cannons.length) {
if (_cannons[_local1]){
_cannons[_local1].enterFrameHandler();
};
_local1++;
};
}
private function roundDownHandler(_arg1:MouseEvent):void{
if (current_ball){
return;
};
var _local2:CannonBallRounds = (_arg1.currentTarget as CannonBallRounds);
SoundManager.playSound("pickup");
if (_local2.count <= 0){
_local2.count = 100;
_local2.info = GameConsts.getBallParamsByIndex(0);
ProfileManager.getInstance().saveCurrentProfile(0);
} else {
current_round = _local2;
current_round.count--;
current_ball = new DragedBall(_local2.info);
dragged_layer.addChild(current_ball);
current_ball.startDrag(true);
current_ball.x = dragged_layer.mouseX;
current_ball.y = dragged_layer.mouseY;
current_ball.round_index = _local2.index;
current_ball.addEventListener(MouseEvent.MOUSE_UP, dropBallHandler);
};
}
private function dropBallHandler(_arg1:MouseEvent):void{
var _local6:Cannon;
var _local7:int;
var _local8:CannonBallRounds;
var _local9:CannonBallRounds;
var _local10:int;
var _local11:int;
var _local12:CannonBallInfo;
var _local13:int;
if (!current_ball){
return;
};
current_ball.stopDrag();
var _local2:int = current_ball.round_index;
var _local3:Point = new Point(cannon_layer.mouseX, cannon_layer.mouseY);
var _local4:int;
while (_local4 < num_cannons) {
_local6 = _cannons[_local4];
if (((((!(_local6)) || (_local6.broken))) || (!(_local6.enable)))){
} else {
if (_local6.hitArea.hitTestObject(current_ball)){
_local7 = _local6.load(current_ball.info, _local2);
SoundManager.playSound("reload");
switch (_local7){
case -2:
break;
case -1:
current_round.count++;
break;
default:
_local8 = getRoundsByIndex(_local7);
if (_local8){
_local8.count++;
};
SoundManager.playSound("cancellball");
break;
};
current_ball.parent.removeChild(current_ball);
current_ball = null;
current_round = null;
return;
};
};
_local4++;
};
var _local5:int;
while (_local5 < cannonball_rounds.length) {
_local9 = cannonball_rounds[_local5];
if (_local9.index == _local2){
} else {
if (_local9.hitTestObject(current_ball)){
if (((!((_local9.count == 0))) && (!((current_round.info.index == _local9.info.index))))){
_local10 = current_round.count;
_local12 = GameConsts.getBallParamsByIndex(current_round.info.index);
current_round.info = GameConsts.getBallParamsByIndex(_local9.info.index);
current_round.count = (_local9.count - 1);
_local9.info = _local12;
_local9.count = (_local10 + 1);
} else {
if ((((_local9.count == 0)) && ((current_round.count > 1)))){
_local10 = (current_round.count + 1);
_local11 = Math.floor((_local10 / 2));
current_round.count = (current_round.count - _local11);
_local9.info = current_round.info;
_local9.count = _local11;
} else {
_local13 = (current_round.count + _local9.count);
current_round.count = Math.floor((_local13 / 2));
_local9.count = (_local13 - current_round.count);
};
};
break;
};
};
_local5++;
};
current_ball.parent.removeChild(current_ball);
current_round.count++;
current_round = null;
current_ball = null;
}
private function getRoundsByIndex(_arg1:int):CannonBallRounds{
var _local2:int;
while (_local2 < cannonball_rounds.length) {
if (cannonball_rounds[_local2].index == _arg1){
return (cannonball_rounds[_local2]);
};
_local2++;
};
return (null);
}
public function set paused(_arg1:Boolean):void{
var _local3:Cannon;
var _local2:int;
while (_local2 < _cannons.length) {
_local3 = _cannons[_local2];
if (_local3){
_local3.barVisible = _arg1;
_local3.pause = _arg1;
};
_local2++;
};
}
public function addRounds(... _args):void{
var _local3:CannonBallRounds;
var _local2:int;
while (_local2 < _args.length) {
if ((_args[_local2] is CannonBallRounds)){
_local3 = _args[_local2];
_local3.index = cannonball_rounds.length;
cannonball_rounds.push(_local3);
_local3.addEventListener(MouseEvent.MOUSE_DOWN, roundDownHandler);
};
_local2++;
};
}
private function shotAgainHandler(_arg1:GameEvent):void{
var _local2:Cannon = (_arg1.currentTarget as Cannon);
if (!_local2.empty){
_local2.shoot();
dispatchEvent(new GameEvent(GameEvent.MAKE_SHOT, [_local2.index, _local2.ball, _local2.power]));
_local2.dropBall();
prof.shots_count++;
};
}
private function cannonUpHandler(_arg1:MouseEvent):void{
if (((!(_arg1.currentTarget.parent)) || (!((_arg1.currentTarget.parent is Cannon))))){
return;
};
var _local2:Cannon = (_arg1.currentTarget.parent as Cannon);
if (((!(_local2.empty)) && (_local2.isCharging))){
_local2.shoot();
dispatchEvent(new GameEvent(GameEvent.MAKE_SHOT, [_local2.index, _local2.ball, _local2.power]));
_local2.dropBall();
prof.shots_count++;
};
}
private function getCannon(_arg1:int, _arg2:int):Cannon{
switch (_arg1){
case 0:
return (new CannonFirst(_arg2));
case 1:
return (new CannonSecond(_arg2));
case 2:
return (new CannonThird(_arg2));
case 3:
return (new CannonFourth(_arg2));
};
return (null);
}
public function save():void{
var _local2:int;
var _local4:CannonBallRounds;
var _local5:Cannon;
var _local1:Array = prof.rounds;
_local2 = 0;
while (_local2 < _local1.length) {
_local4 = cannonball_rounds[_local2];
_local1[_local2] = new SaveRoundsData((_local4.info) ? _local4.info.index : -1, _local4.count);
_local2++;
};
var _local3:Array = ProfileManager.getInstance().currentProfile.cannons;
_local2 = 0;
while (_local2 < _local3.length) {
_local5 = _cannons[_local2];
_local3[_local2] = (_local5) ? new SaveCannonData((_local5) ? _local5.type : -1, (_local5) ? _local5.shotsCount : 0, (((_local5) && (_local5.balls))) ? _local5.balls : [], (_local5) ? _local5.prevRoundIndex : []) : null;
_local2++;
};
}
}
}//package game.managment
Section 57
//EffectsManager (game.managment.EffectsManager)
package game.managment {
import game.effects.*;
public class EffectsManager {
private var items:Array;
private var _pause:Boolean;
public function EffectsManager(){
items = [];
_pause = false;
}
public function addEffect(_arg1:BaseEffect):void{
items.push(_arg1);
}
public function removeEffect(_arg1:BaseEffect):void{
var _local2:int = items.indexOf(_arg1);
if (_local2 >= 0){
items.splice(_local2, 1);
};
}
public function set pause(_arg1:Boolean):void{
var _local3:BaseEffect;
if (_pause == _arg1){
return;
};
_pause = _arg1;
var _local2:int;
while (_local2 < items.length) {
_local3 = items[_local2];
_local3.setPause(_pause);
_local2++;
};
}
}
}//package game.managment
Section 58
//LogicManager (game.managment.LogicManager)
package game.managment {
import game.effects.*;
import flash.display.*;
import gamelibrary.enemyship.*;
import flash.events.*;
import gamelibrary.*;
import profile.*;
import game.*;
import controls.*;
import engine.controls.*;
import tutorial.*;
import sound.*;
import engine.controls.buttons.*;
public class LogicManager extends EventDispatcher {
private var fire_clip:MovieClip;
public var status_bar:ProgressBar;
private var _timer:int;
private var is_repearing:Boolean;
private var repair_speed:int;
public var player_ship:PlayerShip;
private var current_profile:Profile;
public var repair_btn:BasicButton;
private var ship_level_info:ShipLevelInfo;
private var game_difficulty:GameDifficulty;
public var coins_cnt:CoinsCounter;
public var gear_cnt:GearCounter;
private var is_in_fire:Boolean;// = false
private var fire_timer:int;
public function LogicManager(_arg1:MovieClip, _arg2:MovieClip, _arg3:MovieClip, _arg4:MovieClip, _arg5:MovieClip, _arg6:MovieClip){
this.repair_btn = new BasicButton(_arg1);
this.gear_cnt = (_arg2 as GearCounter);
this.status_bar = new ProgressBar(_arg3);
this.fire_clip = _arg6;
fire_clip.stop();
fire_clip.visible = false;
fire_clip.mouseEnabled = false;
this.player_ship = (_arg4 as PlayerShip);
coins_cnt = (_arg5 as CoinsCounter);
repair_btn.clip.addEventListener(MouseEvent.MOUSE_DOWN, startRepair);
repair_btn.clip.addEventListener(MouseEvent.MOUSE_UP, endRepair);
repair_btn.clip.addEventListener(MouseEvent.ROLL_OUT, endRepair);
}
public function notifyEnemySank(_arg1:EnemyShipParameters):void{
var _local2:Number = Math.floor((_arg1.kill_money * game_difficulty.npc_kill_money));
ProfileManager.getInstance().currentProfile.earned_money = (ProfileManager.getInstance().currentProfile.earned_money + _arg1.kill_money);
ProfileManager.getInstance().currentProfile.money = (ProfileManager.getInstance().currentProfile.money + _arg1.kill_money);
addScore(_arg1.kill_score);
ProfileManager.getInstance().currentProfile.sunk_ships_count++;
ProfileManager.getInstance().saveCurrentProfile(0);
coins_cnt.value = ProfileManager.getInstance().currentProfile.money;
}
private function endRepair(_arg1:MouseEvent):void{
is_repearing = false;
SoundManager.stopSound("repairship");
}
public function addScore(_arg1:int):void{
ProfileManager.getInstance().currentProfile.score = (ProfileManager.getInstance().currentProfile.score + _arg1);
ProfileManager.getInstance().currentProfile.level_score = (ProfileManager.getInstance().currentProfile.level_score + _arg1);
}
private function startRepair(_arg1:MouseEvent):void{
_timer = 0;
is_repearing = true;
SoundManager.playSound("repairship", 1, 0);
}
public function destroy():void{
repair_btn.clip.removeEventListener(MouseEvent.MOUSE_DOWN, startRepair);
repair_btn.clip.removeEventListener(MouseEvent.MOUSE_UP, endRepair);
repair_btn.destroy();
}
public function init():void{
current_profile = ProfileManager.getInstance().currentProfile;
ship_level_info = GameConsts.getShipLevelInfo(current_profile.shipLevelIndex);
gear_cnt.value = current_profile.repairPoints;
player_ship.state = ((current_profile.shipState / ship_level_info.max_condition) * 100);
status_bar.progress = ((current_profile.shipState / ship_level_info.max_condition) * 100);
coins_cnt.value = current_profile.money;
repair_speed = ship_level_info.repair_speed;
game_difficulty = GameConsts.difficulties[ProfileManager.getInstance().currentProfile.gameDifficulty];
}
public function notifyStopFire():void{
is_in_fire = false;
fire_clip.visible = false;
SoundManager.stopSound("flameenemy");
}
public function enterFrameHandler():void{
var _local1:int;
if (is_repearing){
if (_timer++ > (30 / ship_level_info.repair_speed)){
if ((((gear_cnt.value > 0)) && ((current_profile.shipState < ship_level_info.max_condition)))){
_local1 = 1;
ProfileManager.getInstance().currentProfile.repairPoints = (ProfileManager.getInstance().currentProfile.repairPoints - _local1);
ProfileManager.getInstance().currentProfile.shipState = (ProfileManager.getInstance().currentProfile.shipState + _local1);
gear_cnt.value = current_profile.repairPoints;
player_ship.state = ((current_profile.shipState / ship_level_info.max_condition) * 100);
status_bar.progress = ((current_profile.shipState / ship_level_info.max_condition) * 100);
_timer = 0;
};
if (current_profile.shipState == ship_level_info.max_condition){
endRepair(null);
TutorialManager.getInstance().notifyEvent("repair_finish");
};
};
};
if (is_in_fire){
if (fire_timer-- < 0){
ProfileManager.getInstance().currentProfile.shipState = (ProfileManager.getInstance().currentProfile.shipState - (GameConsts.firedamage_value * game_difficulty.player_firedamage));
player_ship.state = ProfileManager.getInstance().currentProfile.shipState;
status_bar.progress = ProfileManager.getInstance().currentProfile.shipState;
fire_timer = 30;
};
};
player_ship.state = ((current_profile.shipState / ship_level_info.max_condition) * 100);
status_bar.progress = ((current_profile.shipState / ship_level_info.max_condition) * 100);
if (ProfileManager.getInstance().currentProfile.shipState <= 0){
levelFailed();
};
if (ProfileManager.getInstance().currentProfile.shipState <= 30){
TutorialManager.getInstance().notifyEvent("lowCondition(1)");
};
}
private function levelFailed():void{
SoundManager.stopSound("flameenemy");
dispatchEvent(new GameEvent(GameEvent.LEVEL_FAILED));
}
public function notifyShipHit(_arg1:int, _arg2:int):void{
var _local3:Number;
var _local4:Number;
var _local5:MoneyPopUp;
var _local6:PointsPopUp;
ProfileManager.getInstance().currentProfile.shipState = (ProfileManager.getInstance().currentProfile.shipState - _arg1);
player_ship.state = ProfileManager.getInstance().currentProfile.shipState;
status_bar.progress = ProfileManager.getInstance().currentProfile.shipState;
if ((((_arg2 == 7)) && (!(is_in_fire)))){
is_in_fire = true;
SoundManager.playSound("flameenemy", 1, 0);
fire_clip.visible = true;
fire_clip.play();
fire_timer = 30;
TutorialManager.getInstance().notifyEvent("getFireBall(1)");
};
if (_arg2 == 3){
TutorialManager.getInstance().notifyEvent("getBarrelBall(1)");
};
if (_arg2 == 2){
TutorialManager.getInstance().notifyEvent("getMonkeyBall(1)");
};
if (_arg2 == 2){
_local3 = (game_difficulty.player_rob_money * GameConsts.enemy_rob_money);
_local4 = (game_difficulty.player_rob_rp * GameConsts.enemy_rob_rp);
ProfileManager.getInstance().currentProfile.earned_money = (ProfileManager.getInstance().currentProfile.earned_money - _local3);
ProfileManager.getInstance().currentProfile.money = (ProfileManager.getInstance().currentProfile.money - _local3);
ProfileManager.getInstance().currentProfile.repairPoints = (ProfileManager.getInstance().currentProfile.repairPoints - _local4);
if (ProfileManager.getInstance().currentProfile.repairPoints < 0){
ProfileManager.getInstance().currentProfile.repairPoints = 0;
};
coins_cnt.value = ProfileManager.getInstance().currentProfile.money;
gear_cnt.value = ProfileManager.getInstance().currentProfile.repairPoints;
_local5 = new MoneyPopUp(null, -(GameConsts.enemy_rob_money));
_local5.x = 320;
_local5.y = 400;
_local5.play();
fire_clip.parent.addChild(_local5);
_local6 = new PointsPopUp(null, -(GameConsts.enemy_rob_rp));
_local6.x = 300;
_local6.y = 380;
_local6.play();
fire_clip.parent.addChild(_local6);
};
}
public function notifyEnemyRob(_arg1:Array):void{
var _local2:int = ProfileManager.getInstance().currentProfile.repairPoints;
var _local3:int = GameConsts.getShipLevelInfo(ProfileManager.getInstance().currentProfile.shipLevelIndex).max_repair_points;
var _local4:int = _arg1[0];
ProfileManager.getInstance().currentProfile.monkey_rob = (ProfileManager.getInstance().currentProfile.monkey_rob + _local4);
ProfileManager.getInstance().currentProfile.money = (ProfileManager.getInstance().currentProfile.money + _local4);
ProfileManager.getInstance().currentProfile.repairPoints = Math.min(_local3, (_local2 + _arg1[1]));
addScore(_arg1[2]);
ProfileManager.getInstance().saveCurrentProfile(0);
coins_cnt.value = ProfileManager.getInstance().currentProfile.money;
gear_cnt.value = ProfileManager.getInstance().currentProfile.repairPoints;
}
}
}//package game.managment
Section 59
//ShipManager (game.managment.ShipManager)
package game.managment {
import utils.*;
import flash.display.*;
import flash.events.*;
import game.save.*;
import gamelibrary.*;
import profile.*;
import game.*;
import controls.*;
import engine.controls.*;
import tutorial.*;
public class ShipManager extends EventDispatcher {
private var spawn_timer:Number;
private var timer:int;
private var boss_bar:ProgressBar;
private var level_info:LevelInfo;
private var wave_bar:WaveBar;
private var ships_sequence:Object;
private var _enable:Boolean;// = false
private var spawn_points:int;
private var ships_on_field:Array;
private var ships_on_level:Array;
private var game_field:GameField;
private var fps_timer:int;
private var ships_on_field_count:int;
private var entered_ships_count:int;
public function ShipManager(_arg1:GameField, _arg2:WaveBar, _arg3:MovieClip){
game_field = _arg1;
wave_bar = _arg2;
game_field.addEventListener(GameEvent.REMOVE_SHIP, removeShipHandler);
spawn_timer = 0;
fps_timer = 0;
boss_bar = new ProgressBar(_arg3);
boss_bar.clip.visible = false;
}
public function set enable(_arg1:Boolean):void{
if (_enable == _arg1){
return;
};
_enable = _arg1;
}
public function save():void{
ProfileManager.getInstance().currentProfile.spawn_points = spawn_points;
ProfileManager.getInstance().currentProfile.spawn_timer = spawn_timer;
ProfileManager.getInstance().currentProfile.entered_ships_count = entered_ships_count;
ProfileManager.getInstance().currentProfile.ships = game_field.getShipsData();
}
public function restart():void{
spawn_points = 0;
spawn_timer = 0;
}
private function initShipsOnField(_arg1:Array):void{
var _local4:SaveShipData;
var _local5:int;
ships_on_field = [];
var _local2:int = _arg1.length;
entered_ships_count = (entered_ships_count - _local2);
var _local3:int;
while (_local3 < _local2) {
_local4 = _arg1[_local3];
_local5 = _local4.index_in_level;
addShip(_local5, _local4);
_local3++;
};
}
public function enterFrameHandler():void{
var _local3:ShipInfo;
if (!_enable){
return;
};
var _local1:int = level_info.ships.length;
var _local2:int;
while (_local2 < _local1) {
_local3 = level_info.ships[_local2];
if (_local3.added){
} else {
if (((MathUtils.between(_local3.start_points, _local3.end_points, spawn_points)) && ((Number(_local3.present_num_ships) < Number(_local3.max_present_ships))))){
spawn_timer = (spawn_timer - (1 / 30));
if (spawn_timer < 0){
spawn_points = (spawn_points + GameConsts.getShipParams(_local3.type).spawn_points);
_local3.present_num_ships++;
addShip(_local2, null);
spawn_timer = (_local3.spawn_interval + MathUtils.getRandomValue(-(_local3.spawn_interval_var), _local3.spawn_interval));
trace("add ship ", _local2, "spawn points = ", spawn_points, " wait ", spawn_timer);
};
};
};
_local2++;
};
}
public function init(_arg1:LevelInfo):void{
level_info = _arg1;
spawn_points = ProfileManager.getInstance().currentProfile.spawn_points;
trace("SPWAN POINTS = ", spawn_points);
spawn_timer = ProfileManager.getInstance().currentProfile.spawn_timer;
entered_ships_count = ProfileManager.getInstance().currentProfile.entered_ships_count;
initShipsOnField(ProfileManager.getInstance().currentProfile.ships);
updateWave();
}
private function updateWave():void{
var _local1:Number = ((spawn_points)>level_info.total_points) ? 0 : (((level_info.total_points - spawn_points) / level_info.total_points) * 100);
wave_bar.progress = _local1;
}
private function removeShipHandler(_arg1:GameEvent):void{
var _local2:ShipInfo = _arg1.data[0];
var _local3:Boolean = _arg1.data[1];
_local2.present_num_ships--;
if (_local3){
dispatchEvent(new GameEvent(GameEvent.SUNK_ENEMY, GameConsts.getShipParams(_local2.type)));
};
if (((!(_local3)) && (_local2.is_boss))){
dispatchEvent(new GameEvent(GameEvent.LEVEL_FAILED));
} else {
ships_on_field_count--;
if ((((spawn_points >= level_info.total_points)) && ((ships_on_field_count == 0)))){
trace(level_info.index, " LEVEL COMPLETE");
if (ProfileManager.getInstance().currentProfile.currentLevel != 1){
dispatchEvent(new GameEvent(GameEvent.LEVEL_COMPLETE));
};
};
};
}
public function destroy():void{
game_field.removeEventListener(GameEvent.REMOVE_SHIP, removeShipHandler);
}
public function get totalShipsCount():int{
return (entered_ships_count);
}
private function addShip(_arg1:int, _arg2:SaveShipData):void{
var _local3:ShipInfo = level_info.ships[_arg1];
if (_local3.is_boss){
dispatchEvent(new GameEvent(GameEvent.BOSS_APPEAR));
boss_bar.clip.visible = true;
};
game_field.addShip(_arg1, _local3, _arg2, (_local3.is_boss) ? boss_bar : null);
ships_on_field.push(_arg1);
entered_ships_count++;
ships_on_field_count++;
updateWave();
if (!_arg2){
if (_local3.type == "ship15"){
TutorialManager.getInstance().notifyEvent("ghost(1)");
};
if (_local3.type == "ship5"){
TutorialManager.getInstance().notifyEvent("madseller(1)");
};
if (_local3.type == "ship10"){
TutorialManager.getInstance().notifyEvent("turtle(1)");
};
if (_local3.type == "ship17"){
TutorialManager.getInstance().notifyEvent("bigfort(1)");
};
};
}
}
}//package game.managment
Section 60
//SaveCannonData (game.save.SaveCannonData)
package game.save {
public class SaveCannonData {
public var index:int;
public var balls:Array;
public var prev_round_index:Array;
public var shots_count:int;
public function SaveCannonData(_arg1:int, _arg2:int, _arg3:Array, _arg4:Array){
this.index = _arg1;
this.shots_count = _arg2;
this.balls = _arg3;
this.prev_round_index = _arg4;
}
public function toString():String{
return ((((((((("(index=" + index) + ", shots_count=") + shots_count) + ", balls=") + balls) + ", rounds=") + prev_round_index) + ")"));
}
public function clone():SaveCannonData{
var _local2:int;
var _local1:Array = [];
if (this.balls){
_local2 = 0;
while (_local2 < balls.length) {
_local1.push(balls[_local2]);
_local2++;
};
};
var _local3:Array = [];
if (this.prev_round_index){
_local2 = 0;
while (_local2 < prev_round_index.length) {
_local3.push(prev_round_index[_local2]);
_local2++;
};
};
return (new SaveCannonData(this.index, this.shots_count, _local1, _local3));
}
}
}//package game.save
Section 61
//SaveRoundsData (game.save.SaveRoundsData)
package game.save {
public class SaveRoundsData {
public var index:int;
public var count:int;
public function SaveRoundsData(_arg1:int, _arg2:int){
this.index = _arg1;
this.count = _arg2;
}
public function toString():String{
return ((((("(index=" + index) + ", count=") + count) + ")"));
}
public function clone():SaveRoundsData{
return (new SaveRoundsData(this.index, this.count));
}
}
}//package game.save
Section 62
//SaveShipData (game.save.SaveShipData)
package game.save {
public class SaveShipData {
public var speed:Number;
public var damage:int;
public var effect:int;
public var line:int;
public var index_in_level:int;
public var x:Number;
public function SaveShipData(_arg1:int, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:int, _arg6:int){
this.index_in_level = _arg1;
this.x = _arg2;
this.speed = _arg3;
this.line = _arg4;
this.damage = _arg5;
this.effect = _arg6;
}
}
}//package game.save
Section 63
//BossFlamer (game.ships.types.BossFlamer)
package game.ships.types {
import flash.display.*;
import gamelibrary.*;
import game.ships.*;
public class BossFlamer extends Ship {
public var shoot0:MovieClip;
public var shoot1:MovieClip;
public var hit:MovieClip;
public var shoot3:MovieClip;
public var shoot4:MovieClip;
public var shoot2:MovieClip;
public function BossFlamer(_arg1:ShipInfo){
super(_arg1);
cannon_position = [[-40, -20], [-30, -20], [-15, -20], [-5, -20], [10, 20]];
alive_frames = [[1, 2, 3, 4, 5, 4, 3, 2], [6, 7, 8, 9, 10, 9, 8, 7], [11, 12, 13, 14, 15, 14, 13, 12]];
death_frames = [16, 17, 18, 19, 20, 21, 22, 23, 24];
skin_cannon_position = [[-120, -70], [-90, -70], [-60, -70], [-30, -70], [-15, -70]];
initSkin();
initSpeed();
}
}
}//package game.ships.types
Section 64
//BossFort (game.ships.types.BossFort)
package game.ships.types {
import utils.*;
import flash.display.*;
import gamelibrary.*;
import game.ships.*;
public class BossFort extends Ship {
public var shoot0:MovieClip;
public var shoot1:MovieClip;
public var hit:MovieClip;
public var shoot3:MovieClip;
public var shoot4:MovieClip;
public var shoot2:MovieClip;
public function BossFort(_arg1:ShipInfo){
super(_arg1);
cannon_position = [[-40, -40], [-60, -60], [-20, -20], [-60, -20], [-20, -60]];
alive_frames = [[1, 2, 3, 4, 5, 6, 7, 8], [9, 10, 11, 12, 13, 14, 15, 16], [17, 18, 19, 20, 21, 22, 23, 24]];
death_frames = [25, 26, 27, 28, 29, 30, 31, 32];
skin_cannon_position = [[-125, -80], [-95, -80], [-63, -80], [-31, -80]];
initSkin();
initSpeed();
}
override protected function getCannonAtOnce():Array{
var _local1:int = (base_params.cannonsCount - 1);
if (hit_level == 2){
return ([0, 1, 2, 3]);
};
return (MathUtils.getRandomArray(0, _local1));
}
}
}//package game.ships.types
Section 65
//BossMadseller (game.ships.types.BossMadseller)
package game.ships.types {
import flash.display.*;
import gamelibrary.*;
import game.ships.*;
public class BossMadseller extends Ship {
public var shoot0:MovieClip;
public var shoot1:MovieClip;
public var hit:MovieClip;
public var shoot3:MovieClip;
public var shoot4:MovieClip;
public var shoot2:MovieClip;
public function BossMadseller(_arg1:ShipInfo){
super(_arg1);
cannon_position = [[-40, -20], [-30, -20], [-15, -20], [-5, -20], [10, 20]];
alive_frames = [[1, 2, 3, 4, 5, 4, 3, 2], [6, 7, 8, 9, 10, 9, 8, 7], [11, 12, 13, 14, 15, 14, 13, 12]];
death_frames = [16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27];
skin_cannon_position = [[-120, -70], [-90, -70], [-60, -70], [-30, -70], [-15, -70]];
initSkin();
initSpeed();
}
}
}//package game.ships.types
Section 66
//BossSubmarine (game.ships.types.BossSubmarine)
package game.ships.types {
import flash.display.*;
import gamelibrary.*;
import game.ships.*;
public class BossSubmarine extends Ship {
public var shoot0:MovieClip;
public var shoot1:MovieClip;
public var shoot2:MovieClip;
public var hit:MovieClip;
private static const ST_DOWN:int = 11;
private static const ST_UP:int = 10;
public function BossSubmarine(_arg1:ShipInfo){
super(_arg1);
cannon_position = [[20, -30], [20, -20], [20, -40]];
alive_frames = [[1, 2, 3, 4, 3, 2]];
death_frames = [22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32];
skin_cannon_position = [[-125, -80], [-95, -80], [-63, -80], [-31, -80]];
initSkin();
initSpeed();
}
private function nearCannon():Boolean{
if (_direction < 0){
if (Math.abs((this.x - 110)) < 5){
return (true);
};
if (Math.abs((this.x - 280)) < 5){
return (true);
};
if (Math.abs((this.x - 425)) < 5){
return (true);
};
if (Math.abs((this.x - 550)) < 5){
return (true);
};
} else {
if (Math.abs((this.x - 70)) < 5){
return (true);
};
if (Math.abs((this.x - 210)) < 5){
return (true);
};
if (Math.abs((this.x - 380)) < 5){
return (true);
};
if (Math.abs((this.x - 510)) < 5){
return (true);
};
};
return (false);
}
override public function get hitable():Boolean{
return ((_state == ST_SHOOTING));
}
override public function enterFrameHandler():void{
skin.enterFrameHandler();
switch (_state){
case ST_NORMAL:
shot_delay = (shot_delay - (1 / 30));
if (nearCannon()){
_state = ST_UP;
skin.setSpecialFrames([5, 6, 7, 8, 9, 10, 11]);
};
break;
case ST_UP:
if (skin.currentFrame >= 11){
if ((((this.x > 80)) && ((this.x < 600)))){
cannons_at_once = getCannonAtOnce();
shot_delay = getShotDelayAtOnce();
_state = ST_SHOOTING;
skin.setNormalFrames([12, 13, 14, 16]);
} else {
_state = ST_DOWN;
skin.setSpecialFrames([16, 17, 18, 19, 20, 21]);
};
};
break;
case ST_DOWN:
if (skin.currentFrame == 21){
_state = ST_NORMAL;
shot_delay = getShotDelay();
skin.setNormalFrames(alive_frames[0]);
};
break;
case ST_SHOOTING:
shot_delay = (shot_delay - (1 / 30));
if (shot_delay < 0){
makeShoot();
shot_delay = getShotDelayAtOnce();
};
if (cannons_at_once.length <= 0){
_state = ST_DOWN;
skin.setSpecialFrames([16, 17, 18, 19, 20, 21]);
};
break;
};
ballInfluance();
}
}
}//package game.ships.types
Section 67
//BossTurtle (game.ships.types.BossTurtle)
package game.ships.types {
import flash.display.*;
import gamelibrary.*;
import game.ships.*;
public class BossTurtle extends Ship {
public var shoot0:MovieClip;
public var shoot2:MovieClip;
public var shoot1:MovieClip;
public var hit:MovieClip;
public var shoot3:MovieClip;
public function BossTurtle(_arg1:ShipInfo){
super(_arg1);
cannon_position = [[-10, -20], [0, -20], [10, -20], [20, -20]];
alive_frames = [[1, 2, 3, 4, 5, 4, 3, 2], [6, 7, 8, 9, 10, 9, 8, 7], [11, 12, 13, 14, 15, 14, 13, 12]];
death_frames = [16, 17, 18, 19, 20, 21, 22, 23, 24];
skin_cannon_position = [[-125, -80], [-95, -80], [-63, -80], [-31, -80]];
initSkin();
initSpeed();
}
}
}//package game.ships.types
Section 68
//FortLarge (game.ships.types.FortLarge)
package game.ships.types {
import utils.*;
import flash.display.*;
import gamelibrary.*;
import game.ships.*;
public class FortLarge extends Ship {
public var shoot10:MovieClip;
public var hit:MovieClip;
public var shoot0:MovieClip;
public var shoot1:MovieClip;
public var shoot2:MovieClip;
public var shoot4:MovieClip;
public var shoot5:MovieClip;
public var shoot6:MovieClip;
public var shoot7:MovieClip;
public var shoot8:MovieClip;
public var shoot9:MovieClip;
public var shoot3:MovieClip;
public var shoot11:MovieClip;
public function FortLarge(_arg1:ShipInfo){
super(_arg1);
cannon_position = [[-30, -80], [-20, -80], [-10, -80], [20, -100], [-40, -75], [20, -75], [-20, -100], [-40, -110], [-40, -125], [-30, -125], [-20, -125], [-140, -125]];
alive_frames = [[1], [2], [3]];
death_frames = [4, 4, 4];
skin_cannon_position = [[-125, -80], [-95, -80], [-63, -80], [-31, -80]];
initSkin();
initSpeed();
initSkin();
initSpeed();
}
override protected function getCannonAtOnce():Array{
var _local1:int = (base_params.cannonsCount - 1);
if (hit_level == 1){
return ([0, 3, 4, 5, 6, 8, 10]);
};
if (hit_level == 2){
return ([0, 4, 5, 6]);
};
return (MathUtils.getRandomArray(0, _local1));
}
}
}//package game.ships.types
Section 69
//FortMedium (game.ships.types.FortMedium)
package game.ships.types {
import utils.*;
import flash.display.*;
import gamelibrary.*;
import game.ships.*;
public class FortMedium extends Ship {
public var shoot0:MovieClip;
public var shoot1:MovieClip;
public var shoot2:MovieClip;
public var shoot3:MovieClip;
public var shoot4:MovieClip;
public var shoot5:MovieClip;
public var hit:MovieClip;
public function FortMedium(_arg1:ShipInfo){
super(_arg1);
cannon_position = [[-30, -80], [-20, -80], [-10, -80], [20, -100], [-40, -90], [20, -30]];
alive_frames = [[1], [2], [3]];
death_frames = [4, 4, 4];
skin_cannon_position = [[-125, -80], [-95, -80], [-63, -80], [-31, -80]];
initSkin();
initSpeed();
initSkin();
initSpeed();
}
override protected function getCannonAtOnce():Array{
var _local1:int = (base_params.cannonsCount - 1);
if (hit_level == 1){
return ([0, 3, 4, 5]);
};
if (hit_level == 2){
return ([0, 5]);
};
return (MathUtils.getRandomArray(0, _local1));
}
}
}//package game.ships.types
Section 70
//FortSmall (game.ships.types.FortSmall)
package game.ships.types {
import utils.*;
import flash.display.*;
import gamelibrary.*;
import game.ships.*;
public class FortSmall extends Ship {
public var shoot0:MovieClip;
public var hit:MovieClip;
public var shoot1:MovieClip;
public function FortSmall(_arg1:ShipInfo){
super(_arg1);
cannon_position = [[-18, -40], [-18, -100]];
alive_frames = [[1], [2], [3]];
death_frames = [4, 4, 4];
skin_cannon_position = [[-125, -80], [-95, -80], [-63, -80], [-31, -80]];
initSkin();
initSpeed();
}
override protected function getCannonAtOnce():Array{
var _local1:int = (base_params.cannonsCount - 1);
if (hit_level == 2){
_local1 = 0;
};
return (MathUtils.getRandomArray(0, _local1));
}
}
}//package game.ships.types
Section 71
//ShipBonus (game.ships.types.ShipBonus)
package game.ships.types {
import flash.display.*;
import gamelibrary.*;
import game.ships.*;
public class ShipBonus extends Ship {
public var hit:MovieClip;
public function ShipBonus(_arg1:ShipInfo){
super(_arg1);
alive_frames = [[1, 2, 3, 4, 5, 4, 3, 2]];
death_frames = [6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16];
skin_cannon_position = [];
initSkin();
initSpeed();
}
}
}//package game.ships.types
Section 72
//ShipGhost (game.ships.types.ShipGhost)
package game.ships.types {
import flash.display.*;
import gamelibrary.*;
import game.ships.*;
public class ShipGhost extends Ship {
public var shoot0:MovieClip;
public var shoot2:MovieClip;
public var shoot1:MovieClip;
private static const MIN_ALPHA:Number = 0.5;
private static const ST_APPEAR:int = 20;
private static const ST_DISAPPEAR:int = 21;
private static const NORMAL_ALPHA:Number = 1;
private static const DELTA_ALPHA:Number = 0.02;
public function ShipGhost(_arg1:ShipInfo){
super(_arg1);
cannon_position = [[-40, -20], [-25, -20], [-5, -20], [10, -20]];
alive_frames = [[1, 2, 3, 4, 5, 4, 3, 2], [6, 7, 8, 9, 10, 9, 8, 7], [11, 12, 13, 14, 15, 14, 13, 12]];
death_frames = [16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27];
skin_cannon_position = [[-125, -80], [-95, -80], [-63, -80], [-31, -80]];
initSkin();
initSpeed();
}
override public function enterFrameHandler():void{
skin.enterFrameHandler();
switch (_state){
case ST_NORMAL:
this.alpha = MIN_ALPHA;
shot_delay = (shot_delay - (1 / 30));
if (shot_delay < 0){
_state = ST_APPEAR;
};
break;
case ST_APPEAR:
this.alpha = (this.alpha + DELTA_ALPHA);
if (this.alpha >= NORMAL_ALPHA){
if ((((this.x > 80)) && ((this.x < 600)))){
cannons_at_once = getCannonAtOnce();
shot_delay = getShotDelayAtOnce();
_state = ST_SHOOTING;
} else {
_state = ST_DISAPPEAR;
};
};
break;
case ST_DISAPPEAR:
this.alpha = (this.alpha - DELTA_ALPHA);
if (this.alpha <= MIN_ALPHA){
_state = ST_NORMAL;
shot_delay = getShotDelay();
};
break;
case ST_SHOOTING:
shot_delay = (shot_delay - (1 / 30));
if (shot_delay < 0){
makeShoot();
shot_delay = getShotDelayAtOnce();
};
if (cannons_at_once.length <= 0){
_state = ST_DISAPPEAR;
};
break;
};
ballInfluance();
}
override public function get hitable():Boolean{
return ((this.alpha > 0.8));
}
}
}//package game.ships.types
Section 73
//ShipLarge (game.ships.types.ShipLarge)
package game.ships.types {
import flash.display.*;
import gamelibrary.*;
import game.ships.*;
public class ShipLarge extends Ship {
public var shoot0:MovieClip;
public var shoot1:MovieClip;
public var shoot2:MovieClip;
public var shoot3:MovieClip;
public var shoot4:MovieClip;
public var shoot5:MovieClip;
public var shoot6:MovieClip;
public var shoot7:MovieClip;
public var hit:MovieClip;
public function ShipLarge(_arg1:ShipInfo){
super(_arg1);
cannon_position = [[-60, -20], [-40, -20], [-20, -20], [0, -20], [20, -20], [40, -20]];
alive_frames = [[1, 2, 3, 4, 5, 4, 3, 2], [6, 7, 8, 9, 10, 9, 8, 7], [11, 12, 13, 14, 15, 14, 13, 12]];
death_frames = [16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27];
skin_cannon_position = [[-125, -80], [-95, -80], [-63, -80], [-31, -80]];
initSkin();
initSpeed();
}
override protected function getCannonAtOnce():Array{
if (hit_level == 2){
return ([1, 2, 3, 4]);
};
return ([0, 1, 2, 3, 4, 5]);
}
}
}//package game.ships.types
Section 74
//ShipPirate (game.ships.types.ShipPirate)
package game.ships.types {
import flash.display.*;
import gamelibrary.*;
import game.ships.*;
public class ShipPirate extends Ship {
public var shoot0:MovieClip;
public var shoot2:MovieClip;
public var shoot1:MovieClip;
public var hit:MovieClip;
public var shoot3:MovieClip;
public function ShipPirate(_arg1:ShipInfo){
super(_arg1);
cannon_position = [[-40, -20], [-25, -20], [-5, -20], [10, -20]];
alive_frames = [[1, 2, 3, 4, 5, 4, 3, 2], [6, 7, 8, 9, 10, 9, 8, 7], [11, 12, 13, 14, 15, 14, 13, 12]];
death_frames = [16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27];
skin_cannon_position = [[-125, -80], [-95, -80], [-63, -80], [-31, -80]];
initSkin();
initSpeed();
}
}
}//package game.ships.types
Section 75
//ShipSmall (game.ships.types.ShipSmall)
package game.ships.types {
import flash.display.*;
import gamelibrary.*;
import game.ships.*;
public class ShipSmall extends Ship {
public var shoot0:MovieClip;
public var hit:MovieClip;
public function ShipSmall(_arg1:ShipInfo){
var _local2:MovieClip;
super(_arg1);
cannon_position = [[-25, -20]];
alive_frames = [[1, 2, 3, 4, 5, 4, 3, 2], [6, 7, 8, 9, 10, 9, 8, 7]];
death_frames = [11, 12, 13, 14, 15, 16];
skin_cannon_position = [[-95, -80]];
initSkin();
initSpeed();
}
}
}//package game.ships.types
Section 76
//ShipUnarmed (game.ships.types.ShipUnarmed)
package game.ships.types {
import flash.display.*;
import gamelibrary.*;
import game.ships.*;
public class ShipUnarmed extends Ship {
public var shoot0:MovieClip;
public var shoot2:MovieClip;
public var shoot1:MovieClip;
public var hit:MovieClip;
public function ShipUnarmed(_arg1:ShipInfo){
super(_arg1);
cannon_position = [[-5, -20]];
alive_frames = [[1, 2, 3, 4, 5, 4, 3, 2], [6, 7, 8, 9, 10, 9, 8, 7], [11, 12, 13, 14, 15, 14, 13, 12]];
death_frames = [16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27];
skin_cannon_position = [[-63, -80]];
initSkin();
initSpeed();
}
}
}//package game.ships.types
Section 77
//Submarine (game.ships.types.Submarine)
package game.ships.types {
import flash.display.*;
import gamelibrary.*;
import game.ships.*;
public class Submarine extends Ship {
public var shoot0:MovieClip;
public var shoot1:MovieClip;
public var shoot2:MovieClip;
public var hit:MovieClip;
private static const ST_DOWN:int = 11;
private static const ST_UP:int = 10;
public function Submarine(_arg1:ShipInfo){
super(_arg1);
cannon_position = [[20, -30], [20, -20], [20, -40]];
alive_frames = [[1, 2, 3, 4, 3, 2]];
death_frames = [22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32];
skin_cannon_position = [[-125, -80], [-95, -80], [-63, -80], [-31, -80]];
initSkin();
initSpeed();
}
private function nearCannon():Boolean{
if (_direction < 0){
if (Math.abs((this.x - 110)) < 5){
return (true);
};
if (Math.abs((this.x - 280)) < 5){
return (true);
};
if (Math.abs((this.x - 425)) < 5){
return (true);
};
if (Math.abs((this.x - 550)) < 5){
return (true);
};
} else {
if (Math.abs((this.x - 70)) < 5){
return (true);
};
if (Math.abs((this.x - 210)) < 5){
return (true);
};
if (Math.abs((this.x - 380)) < 5){
return (true);
};
if (Math.abs((this.x - 510)) < 5){
return (true);
};
};
return (false);
}
override public function get hitable():Boolean{
return ((_state == ST_SHOOTING));
}
override public function enterFrameHandler():void{
skin.enterFrameHandler();
switch (_state){
case ST_NORMAL:
shot_delay = (shot_delay - (1 / 30));
if (nearCannon()){
_state = ST_UP;
skin.setSpecialFrames([5, 6, 7, 8, 9, 10, 11]);
};
break;
case ST_UP:
if (skin.currentFrame >= 11){
if ((((this.x > 80)) && ((this.x < 600)))){
cannons_at_once = getCannonAtOnce();
shot_delay = getShotDelayAtOnce();
_state = ST_SHOOTING;
skin.setNormalFrames([12, 13, 14, 16]);
} else {
_state = ST_DOWN;
skin.setSpecialFrames([16, 17, 18, 19, 20, 21]);
};
};
break;
case ST_DOWN:
if (skin.currentFrame == 21){
_state = ST_NORMAL;
shot_delay = getShotDelay();
skin.setNormalFrames(alive_frames[0]);
};
break;
case ST_SHOOTING:
shot_delay = (shot_delay - (1 / 30));
if (shot_delay < 0){
makeShoot();
shot_delay = getShotDelayAtOnce();
};
if (cannons_at_once.length <= 0){
_state = ST_DOWN;
skin.setSpecialFrames([16, 17, 18, 19, 20, 21]);
};
break;
};
ballInfluance();
}
}
}//package game.ships.types
Section 78
//Ship (game.ships.Ship)
package game.ships {
import flash.geom.*;
import utils.*;
import game.effects.*;
import flash.display.*;
import gamelibrary.enemyship.*;
import gamelibrary.*;
import profile.*;
import game.cannonball.*;
import engine.controls.*;
import sound.*;
import game.ships.types.*;
public class Ship extends MovieClip {
protected var _real_size:Point;
protected var shot_delay:Number;// = 100
protected var _direction:int;
protected var _position:Point3D;
private var fire_timer:int;
private var is_knippling:Boolean;
protected var _state:int;
private var knippel_timer:int;
protected var _damage:Number;
private var drink_clip:DrunkClip;
protected var cannon_position:Array;
private var is_fire:Boolean;
protected var base_params:EnemyShipParameters;
protected var info:ShipInfo;
public var index_in_level:int;
private var fire_clip:FireClip;
private var has_octopus:Boolean;
private var is_drinking:Boolean;
public var line_index:int;
protected var _speed:Number;// = 10.4
protected var death_frames:Array;
protected var alive_frames:Array;
private var drink_timer:int;
protected var hit_level:int;
protected var cannons_at_once:Array;
protected var skin_cannon_position:Array;
private var octopus_timer:int;
public var linked_bar:ProgressBar;
public var level_info_link:ShipInfo;// = null
private var num_monkey_hits:int;// = 0
private var octopus_clip:OctopusLure;
public var accuracy:Number;// = 1
protected var skin:ShipSkin;
protected static const ST_SHOOTING:int = 1;
protected static const ST_NORMAL:int = 0;
protected static const ST_SINKING:int = 2;
public function Ship(_arg1:ShipInfo){
cannon_position = [];
_position = new Point3D();
super();
this.hitArea = (this.getChildByName("hit")) ? (this.getChildByName("hit") as Sprite) : this;
_state = ST_NORMAL;
num_monkey_hits = 0;
is_drinking = false;
is_knippling = false;
has_octopus = false;
init(_arg1);
}
protected function getShotDelay():Number{
var _local1:GameDifficulty = GameConsts.difficulties[ProfileManager.getInstance().currentProfile.gameDifficulty];
return ((MathUtils.getRandomValue((base_params.reload_time - base_params.reload_time_var), (base_params.reload_time + base_params.reload_time_var)) * _local1.npc_reload_time));
}
public function destroy():void{
if (drink_clip){
drink_clip.destroy();
};
if (fire_clip){
fire_clip.destroy();
};
if (octopus_clip){
octopus_clip.destroy();
};
if (linked_bar){
linked_bar.destroy();
};
linked_bar = null;
}
public function move(_arg1:Array):Boolean{
var _local2:Number;
if ((((this is Submarine)) && ((_state == ST_SHOOTING)))){
} else {
_local2 = _speed;
if (is_drinking){
_local2 = (_local2 * 0.5);
};
if (is_knippling){
_local2 = (_local2 * 0.4);
};
position = position.add(new Point3D(_local2));
};
if ((((_speed > 0)) && ((this.x > (_arg1[1] + 100))))){
return (false);
};
if ((((_speed < 0)) && ((this.x < (_arg1[0] - 100))))){
return (false);
};
return (true);
}
private function notifyKippelHit():void{
is_knippling = true;
knippel_timer = (10 * 30);
var _local1:ColorTransform = this.transform.colorTransform;
_local1.blueOffset = 100;
this.transform.colorTransform = _local1;
}
public function get params():EnemyShipParameters{
return (base_params);
}
private function notifyOctopus():void{
if (damage <= 0){
return;
};
if (isSubmarine){
return;
};
var _local1:Boolean = MathUtils.eventAppear(GameConsts.octopus_probability);
if (!_local1){
return;
};
if (!has_octopus){
octopus_clip = ShipFactory.getInstance().getOctopusClip();
this.parent.addChild(octopus_clip);
octopus_clip.play();
octopus_clip.scaleX = (this.scaleX * 1.5);
octopus_clip.scaleY = (this.scaleY * 1.5);
octopus_clip.x = this.x;
octopus_clip.y = (this.y - 10);
octopus_clip.attachToObject(this, (octopus_clip.x - this.x), (octopus_clip.y - this.y));
has_octopus = true;
octopus_timer = 55;
};
}
public function notifySink():void{
dispatchEvent(new ShipEvent(ShipEvent.SINK));
}
public function loadSpeed(_arg1:Number):void{
_speed = _arg1;
_direction = MathUtils.sign(_speed);
}
protected function sink():void{
_state = ST_SINKING;
SoundManager.playSound("enemydie", (1 / (line_index + 1)));
if (drink_clip){
drink_clip.destroy();
};
if (fire_clip){
fire_clip.destroy();
};
if (octopus_clip){
octopus_clip.destroy();
};
skin.setSink();
}
private function init(_arg1:ShipInfo):void{
this.info = _arg1;
base_params = GameConsts.getShipParams(info.type);
_real_size = new Point((Number(base_params.size[0]) * 16), Number((base_params.size[1] * 16)));
}
public function get size():Point{
return (_real_size);
}
protected function makeShoot():void{
if (base_params.cannonsCount == 0){
return;
};
var _local1:int = cannons_at_once.pop();
if (((is_drinking) && ((cannons_at_once.length == 0)))){
return;
};
var _local2:EnemyCannon = base_params.getCannon(_local1);
var _local3:GameDifficulty = GameConsts.difficulties[ProfileManager.getInstance().currentProfile.gameDifficulty];
accuracy = Math.max(GameConsts.min_enemy_accuracy, ((GameConsts.line_accuracy[(line_index - 1)] * _local2.accuracy) * _local3.npc_accuracy));
var _local4:CannonBall = new CannonBall(GameConsts.getBallParamsByType(_local2.ball_type), true);
_local4.accuracy = accuracy;
_local4.setDamage(_local2.damage);
_local4.will_hit = MathUtils.eventAppear(_local4.accuracy);
var _local5:Point = position.getProection();
_local4.position = new Point3D((this.position.x + (MathUtils.sign(_speed) * cannon_position[_local1][0])), (this.position.y + cannon_position[_local1][1]), this.position.z);
var _local6:Number = 1.5;
var _local7:Number = (Math.random() * 2);
var _local8:Number = (((-((this.position.x - Point3D.VIEW_X)) * _local6) / (Point3D.VIEW_Z - position.z)) * _local7);
var _local9:Number = (_local4.will_hit) ? 0 : -(MathUtils.getRandomValue(0, 2));
if (_local9 < 0){
_local4.useGravitation = MathUtils.eventAppear(0.5);
};
if (_local4.useGravitation){
_local9 = (_local9 * 2);
};
var _local10:Point3D = new Point3D(_local8, _local9, _local6);
_local4.velocity = _local10;
skin.makeShoot(_local1);
dispatchEvent(new ShipEvent(ShipEvent.SHOOT, _local4));
var _local11:Number = (1 / (line_index + 1));
switch (_local4.info.index){
case 2:
SoundManager.playSound("out_monkey", _local11);
break;
case 3:
SoundManager.playSound("out_rum", _local11);
break;
default:
SoundManager.playSound("out_justball", _local11);
break;
};
SoundManager.playSound("ballfly", _local11);
}
protected function getCannonAtOnce():Array{
var _local1:int = (base_params.cannonsCount - 1);
return (MathUtils.getRandomArray(0, Math.max(0, _local1)));
}
public function get position():Point3D{
return (_position);
}
protected function initSpeed():void{
shot_delay = getShotDelay();
line_index = Math.round(MathUtils.getRandomValue(info.nearest_line, info.farthest_line));
var _local1:Number = MathUtils.getRandomValue((base_params.speed - base_params.speed_var), (base_params.speed + base_params.speed_var));
if (_local1 < GameConsts.min_enemy_speed){
_local1 = GameConsts.min_enemy_speed;
};
_direction = MathUtils.getRandomSign();
_speed = ((0.1 * _direction) * _local1);
if (base_params.isFort){
_speed = (_speed / 2);
};
damage = base_params.hit_points;
}
protected function getShotDelayAtOnce():Number{
return (base_params.shot_time_interval);
}
public function get isGhost():Boolean{
return (base_params.isGhost);
}
protected function ballInfluance():void{
var _local1:ColorTransform;
var _local2:ColorTransform;
if (is_drinking){
if (drink_timer-- < 0){
is_drinking = false;
_local1 = this.transform.colorTransform;
_local1.greenOffset = 0;
this.transform.colorTransform = _local1;
if (drink_clip){
drink_clip.destroy();
};
SoundManager.stopSound("enemyshipdrunk");
};
};
if (is_knippling){
if (knippel_timer-- < 0){
is_knippling = false;
_local2 = this.transform.colorTransform;
_local2.blueOffset = 0;
this.transform.colorTransform = _local2;
};
};
if (is_fire){
if (fire_timer-- < 0){
this.damage = (this.damage - GameConsts.firedamage_value);
fire_timer = 30;
if (damage <= 0){
if (fire_clip){
fire_clip.destroy();
};
is_fire = false;
SoundManager.stopSound("flameenemy");
};
};
};
if (has_octopus){
if (octopus_timer-- < 0){
damage = (damage - GameConsts.octopus_damage);
if (octopus_clip){
octopus_clip.destroy();
};
has_octopus = false;
};
};
}
public function enterFrameHandler():void{
skin.enterFrameHandler();
switch (_state){
case ST_NORMAL:
shot_delay = (shot_delay - (1 / 30));
if (shot_delay < 0){
if ((((this.x > 80)) && ((this.x < 600)))){
cannons_at_once = getCannonAtOnce();
shot_delay = getShotDelayAtOnce();
_state = ST_SHOOTING;
} else {
shot_delay = getShotDelay();
};
};
break;
case ST_SHOOTING:
shot_delay = (shot_delay - (1 / 30));
if (shot_delay < 0){
makeShoot();
shot_delay = getShotDelayAtOnce();
};
if (cannons_at_once.length <= 0){
_state = ST_NORMAL;
shot_delay = getShotDelay();
};
break;
};
ballInfluance();
}
protected function initSkin():void{
skin = new ShipSkin(this, base_params, alive_frames, death_frames, skin_cannon_position);
skin.damage = 0;
skin.setNormal();
}
private function notifyRomHit():void{
if (!is_drinking){
drink_clip = new DrunkClip(null);
this.parent.addChild(drink_clip);
drink_clip.play();
drink_clip.setScale(this.scaleX, this.scaleY);
drink_clip.setPos(this.x, (this.y - 20));
drink_clip.attachToObject(this, (drink_clip.x - this.x), (drink_clip.y - this.y));
SoundManager.playSound("enemyshipdrunk", (1 / (line_index + 1)), 3);
};
is_drinking = true;
drink_timer = (10 * 30);
var _local1:ColorTransform = this.transform.colorTransform;
_local1.greenOffset = 80;
this.transform.colorTransform = _local1;
}
public function get speed():Number{
return (_speed);
}
public function get hitable():Boolean{
return (true);
}
public function set position(_arg1:Point3D):void{
_position = _arg1.clone();
var _local2:Point = _position.getProection();
this.x = _local2.x;
this.y = (_local2.y + base_params.water_offset);
var _local3:Point = Point3D.getSize(_real_size, _position.z);
this.width = Math.round(_local3.x);
this.height = Math.round(_local3.y);
if (_direction < 0){
this.scaleX = -(Math.abs(this.scaleX));
};
}
public function set damage(_arg1:Number):void{
var _local2:Number;
var _local3:int;
var _local4:Number;
_damage = _arg1;
if (_damage <= 0){
this._speed = 0;
sink();
} else {
_local2 = ((1 - (_damage / base_params.hit_points)) * 100);
_local3 = (alive_frames.length - 1);
_local4 = (100 / (_local3 + 1));
hit_level = (_local2 / _local4);
skin.damage = Math.floor(hit_level);
};
}
private function notifyFlame():void{
if (damage <= 0){
return;
};
if (!is_fire){
fire_clip = new FireClip(null);
this.parent.addChild(fire_clip);
fire_clip.play();
fire_clip.scaleX = (this.scaleX * 1.5);
fire_clip.scaleY = (this.scaleY * 1.5);
fire_clip.x = this.x;
fire_clip.y = this.y;
fire_clip.attachToObject(this, (fire_clip.x - this.x), (fire_clip.y - this.y));
SoundManager.playSound("flameenemy", (1 / (line_index + 1)), 0);
};
is_fire = true;
fire_timer = 30;
var _local1:ColorTransform = this.transform.colorTransform;
_local1.redOffset = 80;
this.transform.colorTransform = _local1;
}
public function get damage():Number{
return (_damage);
}
public function getHit(_arg1:CannonBallInfo, _arg2:Number, _arg3:Point):void{
var _local4:AttachedEffect;
if (_arg1.index != 10){
_local4 = ((_arg1.index)==6) ? new ShipHitClipBomb(null) : new ShipHitClip(null);
this.parent.addChild(_local4);
_local4.play();
_local4.setScale((this.scaleX / 2), (this.scaleY / 2));
_local4.setPos(_arg3.x, _arg3.y);
_local4.attachToObject(this, (_local4.x - this.x), (_local4.y - this.y));
};
this.damage = (this.damage - _arg2);
if (linked_bar){
linked_bar.progress = ((this.damage / base_params.hit_points) * 100);
};
if (_arg1.index == 2){
notifyMonkeyHit();
};
if (_arg1.index == 3){
notifyRomHit();
};
if (_arg1.index == 4){
notifyKippelHit();
};
if (_arg1.index == 7){
notifyFlame();
};
if (_arg1.index == 10){
notifyOctopus();
};
if (_arg1.index == 10){
SoundManager.playSound("hit_octopus", Math.min(1, (2 / (line_index + 1))));
} else {
SoundManager.playSound("shiphit", Math.min(1, (2 / (line_index + 1))));
};
}
private function notifyMonkeyHit():void{
var _local1:Number = Math.pow(2, num_monkey_hits);
var _local2:GameDifficulty = GameConsts.difficulties[ProfileManager.getInstance().currentProfile.gameDifficulty];
var _local3:Number = ((base_params.rob_money / _local1) * _local2.npc_rob_money);
var _local4:Number = ((base_params.rob_rp / _local1) * _local2.npc_rob_rp);
var _local5:Number = (base_params.rob_score / _local1);
num_monkey_hits++;
dispatchEvent(new ShipEvent(ShipEvent.ROB, [_local3, _local4, _local5]));
var _local6:MonkeyCapture = new MonkeyCapture(null);
this.parent.addChild(_local6);
_local6.play();
_local6.setScale(this.scaleX, this.scaleY);
_local6.setPos(this.x, (this.y - 40));
_local6.attachToObject(this, (_local6.x - this.x), (_local6.y - this.y));
SoundManager.playSound("monkeyAlarm", (1 / (line_index + 1)));
}
public function get isSubmarine():Boolean{
return (base_params.isSubmarine);
}
}
}//package game.ships
Section 79
//ShipEvent (game.ships.ShipEvent)
package game.ships {
import flash.events.*;
public class ShipEvent extends Event {
private var _data:Object;
public static const SINK:String = "sink";
public static const ROB:String = "rob";
public static const SHOOT:String = "shoot";
public function ShipEvent(_arg1:String, _arg2:Object=null, _arg3:Boolean=false, _arg4:Boolean=false){
super(_arg1, _arg3, _arg4);
_data = _arg2;
}
public function get data():Object{
return (_data);
}
}
}//package game.ships
Section 80
//ShipFactory (game.ships.ShipFactory)
package game.ships {
import game.effects.*;
import flash.events.*;
import gamelibrary.*;
import game.ships.types.*;
public class ShipFactory extends EventDispatcher {
private static const SHIPS_FILE:String = "Ships.swf";
private static var instance:ShipFactory = null;
private static var allow_creation:Boolean = false;
public function ShipFactory(){
if (!allow_creation){
throw (new Error("Singleton Error"));
};
}
public function getOctopusClip():OctopusLure{
var _local1:OctopusLure = new OctopusLure(null);
return (_local1);
}
public function getShip(_arg1:ShipInfo):Ship{
var _local2:Ship;
switch (_arg1.type){
case "ship0":
_local2 = new ShipSmall(_arg1);
return (_local2);
case "ship1":
_local2 = new ShipBonus(_arg1);
return (_local2);
case "ship2":
_local2 = new ShipPirate(_arg1);
return (_local2);
case "ship3":
_local2 = new ShipUnarmed(_arg1);
return (_local2);
case "ship4":
_local2 = new ShipPirate(_arg1);
return (_local2);
case "ship5":
_local2 = new BossMadseller(_arg1);
return (_local2);
case "ship6":
_local2 = new ShipPirate(_arg1);
return (_local2);
case "ship7":
_local2 = new FortSmall(_arg1);
return (_local2);
case "ship8":
_local2 = new ShipLarge(_arg1);
return (_local2);
case "ship9":
_local2 = new ShipLarge(_arg1);
return (_local2);
case "ship10":
_local2 = new BossTurtle(_arg1);
return (_local2);
case "ship11":
_local2 = new FortMedium(_arg1);
return (_local2);
case "ship12":
_local2 = new Submarine(_arg1);
return (_local2);
case "ship13":
_local2 = new Submarine(_arg1);
return (_local2);
case "ship14":
_local2 = new FortLarge(_arg1);
return (_local2);
case "ship15":
_local2 = new ShipGhost(_arg1);
return (_local2);
case "ship16":
_local2 = new ShipGhost(_arg1);
return (_local2);
case "ship17":
_local2 = new BossFort(_arg1);
return (_local2);
case "ship18":
_local2 = new BossFlamer(_arg1);
return (_local2);
case "ship19":
_local2 = new BossSubmarine(_arg1);
return (_local2);
};
return (null);
}
public static function getInstance():ShipFactory{
if (!instance){
allow_creation = true;
instance = new (ShipFactory);
allow_creation = false;
};
return (instance);
}
}
}//package game.ships
Section 81
//ShipSkin (game.ships.ShipSkin)
package game.ships {
import flash.display.*;
import gamelibrary.enemyship.*;
public class ShipSkin {
private var total_frames:int;
private var ST_DIE:int;// = 2
private var shoot_clips:Array;
private var ST_NORMAL:int;// = 0
private var clip:MovieClip;
private var death_frames:Array;
private var _state:int;// = -1
private var state_timer:int;
private var alive_frames:Array;
private var tick_pur_frame:int;// = 5
private var current_alive_frames:Array;
private var cannon_position:Array;
private var ST_SINKING:int;// = 1
private var base_params:EnemyShipParameters;
private var ST_SPECIAL:int;// = 3
public function ShipSkin(_arg1:MovieClip, _arg2:EnemyShipParameters, _arg3:Array, _arg4:Array, _arg5:Array){
var _local7:MovieClip;
super();
this.clip = _arg1;
base_params = _arg2;
shoot_clips = [];
var _local6:int;
while (_local6 < 12) {
_local7 = (this.clip.getChildByName(("shoot" + _local6)) as MovieClip);
if (_local7){
_local7.stop();
_local7.visible = false;
};
shoot_clips.push(_local7);
_local6++;
};
this.alive_frames = _arg3;
this.death_frames = _arg4;
this.cannon_position = _arg5;
this.current_alive_frames = this.alive_frames[0];
_arg1.stop();
}
public function get currentFrame():int{
return (clip.currentFrame);
}
public function enterFrameHandler():void{
var _local1:int;
var _local2:int;
switch (_state){
case ST_NORMAL:
if (state_timer >= total_frames){
state_timer = 0;
};
if (base_params.type == "ship17"){
_local1 = current_alive_frames[Math.floor((state_timer / tick_pur_frame))];
clip.gotoAndStop(_local1);
} else {
_local2 = Math.min(state_timer, ((total_frames - 1) - state_timer));
_local1 = Math.floor((_local2 / tick_pur_frame));
clip.gotoAndStop(current_alive_frames[_local1]);
};
state_timer++;
break;
case ST_SINKING:
if (state_timer >= total_frames){
(clip as Ship).notifySink();
_state = ST_DIE;
break;
};
_local1 = Math.floor((state_timer / tick_pur_frame));
clip.gotoAndStop(current_alive_frames[_local1]);
state_timer++;
break;
case ST_SPECIAL:
_local1 = Math.floor((state_timer / tick_pur_frame));
clip.gotoAndStop(current_alive_frames[_local1]);
state_timer++;
break;
case ST_DIE:
break;
};
updateShoots();
}
public function setSink():void{
_state = ST_SINKING;
state_timer = 0;
current_alive_frames = death_frames;
total_frames = (current_alive_frames.length * tick_pur_frame);
}
private function updateShoots():void{
var _local1:int;
while (_local1 < shoot_clips.length) {
if (((shoot_clips[_local1]) && (shoot_clips[_local1].visible))){
shoot_clips[_local1].nextFrame();
};
_local1++;
};
}
public function set damage(_arg1:int):void{
if (_arg1 < alive_frames.length){
current_alive_frames = alive_frames[_arg1];
setNormal();
};
}
public function setNormalFrames(_arg1:Array):void{
current_alive_frames = _arg1.join("*").split("*");
_state = ST_NORMAL;
state_timer = 0;
total_frames = (current_alive_frames.length * tick_pur_frame);
}
public function setNormal():void{
_state = ST_NORMAL;
state_timer = 0;
total_frames = (current_alive_frames.length * tick_pur_frame);
}
public function setSpecialFrames(_arg1:Array):void{
current_alive_frames = _arg1.join("*").split("*");
_state = ST_SPECIAL;
state_timer = 0;
total_frames = (current_alive_frames.length * tick_pur_frame);
}
public function makeShoot(_arg1:int):void{
var _local2:MovieClip = shoot_clips[_arg1];
if (_local2){
_local2.visible = true;
_local2.width = 100;
_local2.gotoAndStop(1);
};
}
}
}//package game.ships
Section 82
//GameEvent (game.GameEvent)
package game {
import flash.events.*;
public class GameEvent extends Event {
private var _data:Object;
public static const PUSH_BALL:String = "push_ball";
public static const SUNK_ENEMY:String = "sunk_enemy";
public static const ROB_ENEMY:String = "rob_enemy";
public static const REMOVE_SHIP:String = "remove_ship";
public static const HIT_ENEMY:String = "hit_enemy";
public static const BOSS_APPEAR:String = "boss!!!";
public static const GET_HIT:String = "get_hit";
public static const MAKE_SHOT:String = "make_shot";
public static const LEVEL_COMPLETE:String = "level_complete";
public static const FLAME_STOP:String = "stop_flame";
public static const SHOT_AGAIN:String = "shot_again";
public static const GET_ROB:String = "get_rob";
public static const LEVEL_FAILED:String = "level_failed";
public function GameEvent(_arg1:String, _arg2:Object=null, _arg3:Boolean=false, _arg4:Boolean=false){
super(_arg1, _arg3, _arg4);
_data = _arg2;
}
public function get data():Object{
return (_data);
}
}
}//package game
Section 83
//GameField (game.GameField)
package game {
import flash.geom.*;
import utils.*;
import game.effects.*;
import flash.display.*;
import flash.events.*;
import game.save.*;
import gamelibrary.*;
import profile.*;
import game.cannonball.*;
import engine.controls.*;
import game.ships.*;
import tutorial.*;
import game.managment.*;
import sound.*;
import flash.ui.*;
public class GameField extends EventDispatcher {
private var right_pressed:Boolean;// = false
private var water_y:Array;
private var ball_layer:Sprite;
private var temp_timer:int;// = 0
private var num_fire_spaces:int;
private var enemy_balls:Array;
private var ship_layers:Array;
private var left_pressed:Boolean;// = false
private var ships:Array;
private var is_in_fire:Boolean;// = false
private var player_balls:Array;
private var effect_manager:EffectsManager;
public function GameField(_arg1:Sprite, _arg2:Sprite){
var _local4:Sprite;
water_y = [0, 15, 20, 30, 40];
super();
effect_manager = new EffectsManager();
ship_layers = [];
var _local3:int;
while (_local3 < GameConsts.num_lines) {
_local4 = new Sprite();
_arg1.addChildAt(_local4, 0);
this.ship_layers.push(_local4);
_local3++;
};
this.ball_layer = _arg2;
ships = [];
enemy_balls = [];
player_balls = [];
}
private function playSplash(_arg1:Number, _arg2:Number, _arg3:Number):void{
var _local4:WaterSplash = new WaterSplash(effect_manager);
var _local5:Number = 50;
var _local6:Number = -50;
var _local7:Number = 350;
var _local8:Number = 220;
var _local9:Number = 3;
var _local10:Number = 0.1;
var _local11:Number = Math.min(_local7, Math.max(_local8, ((((_arg3 - _local6) * (_local7 - _local8)) / (_local5 - _local6)) + _local8)));
var _local12:Number = Math.min(_local9, Math.max(_local10, ((((_arg3 - _local6) * (_local9 - _local10)) / (_local5 - _local6)) + _local10)));
_local4.scaleX = _local12;
_local4.scaleY = _local12;
_local4.x = _arg1;
_local4.y = _local11;
ball_layer.addChild(_local4);
_local4.startPlay();
SoundManager.playSound("watersplash", _local12);
}
public function addShip(_arg1:int, _arg2:ShipInfo, _arg3:SaveShipData, _arg4:ProgressBar):void{
var _local6:int;
var _local7:Number;
var _local8:Number;
trace(_arg2.is_boss, "add to field ", _arg1, _arg2.type, _arg3);
var _local5:Ship = ShipFactory.getInstance().getShip(_arg2);
_local5.linked_bar = _arg4;
_local5.index_in_level = _arg1;
_local5.level_info_link = _arg2;
if (!_arg3){
_local6 = (_arg2.is_boss) ? 4 : _local5.line_index;
_local5.line_index = _local6;
_local7 = (GameConsts.lines_depth[_local6] * 0.05);
_local8 = ((_local5.speed)>0) ? GameConsts.start_positions_x[0][_local6] : GameConsts.start_positions_x[1][_local6];
trace("line = ", _local6, "z = ", _local7);
} else {
_local6 = _arg3.line;
_local7 = (GameConsts.lines_depth[_local6] * 0.05);
_local5.loadSpeed(_arg3.speed);
_local5.damage = _arg3.damage;
_local8 = _arg3.x;
};
_local5.position = new Point3D(_local8, (Point3D.VIEW_Y + 20), _local7);
ship_layers[_local6].addChild(_local5);
ships.push(_local5);
_local5.addEventListener(ShipEvent.SHOOT, shootHandler);
_local5.addEventListener(ShipEvent.SINK, sinkHandler);
_local5.addEventListener(ShipEvent.ROB, robEnemyHandler);
}
private function robEnemyHandler(_arg1:ShipEvent):void{
var _local6:MoneyPopUp;
var _local7:PointsPopUp;
var _local2:Ship = (_arg1.target as Ship);
var _local3:int = _arg1.data[0];
var _local4:int = _arg1.data[1];
var _local5:int = _arg1.data[2];
if (_local3 > 0){
_local6 = new MoneyPopUp(effect_manager, _local3);
_local6.x = _local2.x;
_local6.y = (_local2.y - 20);
_local6.startPlay();
_local2.parent.addChild(_local6);
effect_manager.addEffect(_local6);
};
if (_local4 > 0){
_local7 = new PointsPopUp(effect_manager, _local4);
_local7.x = (_local2.x - 40);
_local7.y = (_local2.y - 40);
_local7.startPlay();
_local2.parent.addChild(_local7);
effect_manager.addEffect(_local7);
};
dispatchEvent(new GameEvent(GameEvent.ROB_ENEMY, [_local3, _local4, _local5]));
}
private function ballClickHandler(_arg1:MouseEvent):void{
var _local2:CannonBall = (_arg1.currentTarget as CannonBall);
var _local3:Point3D = _local2.velocity.clone();
_local2.useGravitation = true;
_local2.glow = false;
_local2.rejected = true;
var _local4:Number = (-(_local3.x) + MathUtils.getRandomValue(-0.5, 0.5));
var _local5:Number = MathUtils.getRandomValue(-5, -3);
var _local6:Number = MathUtils.getRandomValue(-3, -0.1);
_local2.velocity = new Point3D(_local4, -5, _local6);
_local2.reflect();
dispatchEvent(new GameEvent(GameEvent.PUSH_BALL, _local2.info));
}
public function destroy():void{
}
public function getShipsData():Array{
var _local2:int;
var _local3:Ship;
var _local4:SaveShipData;
var _local1:Array = [];
while (_local2 < ships.length) {
_local3 = ships[_local2];
_local4 = new SaveShipData(_local3.index_in_level, _local3.position.x, _local3.speed, _local3.line_index, _local3.damage, -1);
_local1.push(_local4);
_local2++;
};
return (_local1);
}
private function playDemage(_arg1:Number, _arg2:Number, _arg3:int):void{
var _local4:ShipHitClip = new ShipHitClip(effect_manager);
var _local5:Number = MathUtils.getRandomValue(1, 2);
_local4.scaleX = _local5;
_local4.scaleY = _local5;
_local4.x = _arg1;
_local4.y = _arg2;
_local4.startPlay();
ball_layer.addChild(_local4);
if (_arg3 == 7){
num_fire_spaces = 7;
is_in_fire = true;
};
}
private function sinkHandler(_arg1:ShipEvent):void{
var _local2:Ship = (_arg1.currentTarget as Ship);
var _local3:int = ships.indexOf(_local2);
var _local4:int = ProfileManager.getInstance().currentProfile.currentLevel;
TutorialManager.getInstance().notifyEvent((("kill(" + _local4) + ")"));
removeShip(_local3, true);
}
public function enterFrameHandler():void{
var _local1:int;
var _local2:int;
var _local3:CannonBall;
var _local4:Ship;
_local1 = 0;
while (_local1 < ships.length) {
_local4 = ships[_local1];
_local4.enterFrameHandler();
_local2 = 0;
while (_local2 < player_balls.length) {
_local3 = player_balls[_local2];
if (((((((((_local4.hitable) && (_local3.canHit()))) && ((Math.abs((_local4.position.z - _local3.position.z)) < 5)))) && ((_local4.damage > 0)))) && (_local4.hitArea.hitTestObject(_local3.hitArea)))){
_local4.getHit(_local3.info, _local3.getDamage(), new Point(_local3.x, _local3.y));
dispatchEvent(new GameEvent(GameEvent.HIT_ENEMY));
if (_local3.info.index != 5){
removeBall(_local2, false);
_local2--;
};
};
_local2++;
};
_local2 = 0;
for (;_local2 < enemy_balls.length;_local2++) {
_local3 = enemy_balls[_local2];
if (((((((((_local3.rejected) && (_local4.hitable))) && ((_local4.damage > 0)))) && (_local4.hitArea.hitTestObject(_local3.hitArea)))) && ((Math.abs((_local4.position.z - _local3.position.z)) < 5)))){
_local4.getHit(_local3.info, _local3.getDamage(), new Point(_local3.x, _local3.y));
dispatchEvent(new GameEvent(GameEvent.HIT_ENEMY));
removeBall(_local2, true);
_local2--;
} else {
if (((((!(_local3.rejected)) && (_local4.hitArea.hitTestObject(_local3.hitArea)))) && ((_local4.position.z > (_local3.position.z + 5))))){
removeBall(_local2, true);
_local2--;
continue;
};
};
};
if (!_local4.move([0, PiratesL.SCREEN_WIDTH])){
if (shipLeft(_local1)){
_local1--;
};
};
_local1++;
};
_local1 = 0;
while (_local1 < player_balls.length) {
_local3 = player_balls[_local1];
_local3.move(left_pressed, right_pressed);
_local3.enterFrameHandler();
if (_local3.info.index == 8){
if (((!(_local3.isSwimming)) && ((_local3.position.z < (GameConsts.lines_depth[_local3.target_line] * 0.05))))){
_local3.position = new Point3D(_local3.position.x, (Point3D.VIEW_Y + 30), (GameConsts.lines_depth[_local3.target_line] * 0.05));
_local3.startSwim();
ship_layers[_local3.target_line].addChild(_local3);
};
if (_local3.sink()){
removeBall(_local1, false);
_local1--;
};
} else {
if (_local3.position.y > Point3D.VIEW_Y){
removeBall(_local1, false);
_local1--;
};
};
_local1++;
};
_local1 = 0;
while (_local1 < enemy_balls.length) {
_local3 = enemy_balls[_local1];
_local3.move();
soundsUpdate(_local3);
if (_local3.position.z > 80){
if (((((_local3.will_hit) && ((_local3.x > 0)))) && ((_local3.x < 640)))){
playDemage(_local3.x, _local3.y, _local3.info.index);
dispatchEvent(new GameEvent(GameEvent.GET_HIT, [_local3.getDamage(), _local3.info.index]));
};
removeBall(_local1, true);
_local1--;
} else {
if (_local3.position.y > Point3D.VIEW_Y){
playSplash(_local3.x, _local3.y, _local3.position.z);
removeBall(_local1, true);
_local1--;
} else {
if (((!(_local3.will_hit)) && ((_local3.position.z > MathUtils.getRandomValue(70, 100))))){
playSplash(_local3.x, _local3.y, _local3.position.z);
removeBall(_local1, true);
_local1--;
};
};
};
_local1++;
};
}
public function set paused(_arg1:Boolean):void{
effect_manager.pause = _arg1;
}
public function makeShoot(_arg1:int, _arg2:CannonBallInfo, _arg3:Number):void{
var _local6:CannonBall;
var _local7:Array;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
if (!_arg2){
return;
};
var _local4:int = _arg2.shot_count;
var _local5:int;
while (_local5 < _local4) {
_local6 = new CannonBall(_arg2, false);
_local7 = GameConsts.start_ball_parameters[_arg1];
if (!_local7){
return;
};
_local8 = _local7[0];
_local9 = _local7[1];
_local10 = _local7[3];
_local11 = _local7[4];
_local12 = _local7[5];
if (_local5 != 0){
_local8 = (_local8 + MathUtils.getRandomValue(-10, 10));
_local9 = (_local9 + MathUtils.getRandomValue(-20, 0));
_local10 = (_local10 + MathUtils.getRandomValue(-2, 2));
_local11 = (_local11 + MathUtils.getRandomValue(-2, 2));
_local12 = (_local12 + MathUtils.getRandomValue(-2, 2));
};
if (_arg2.index == 0){
_local10 = (_local10 + MathUtils.getRandomValue(-2, 2));
};
_local6.position = new Point3D(_local8, _local9, _local7[2]);
_local6.velocity = new Point3D(_local10, _local11, _local12);
_local6.target_line = Math.min(4, Math.floor((_arg3 / 0.2)));
_local6.setDamage(((1 + _arg3) * _arg2.damage));
_local6.enemy = false;
ball_layer.addChild(_local6);
_local6.useGravitation = true;
player_balls.push(_local6);
_local5++;
};
}
public function keyDown(_arg1:int):void{
if (_arg1 == Keyboard.LEFT){
left_pressed = true;
};
if (_arg1 == Keyboard.RIGHT){
right_pressed = true;
};
if (_arg1 == Keyboard.SPACE){
if (is_in_fire){
if (num_fire_spaces-- < 0){
dispatchEvent(new GameEvent(GameEvent.FLAME_STOP));
is_in_fire = false;
};
};
};
}
private function shipLeft(_arg1:int):Boolean{
var _local3:int;
var _local4:Number;
var _local5:Number;
var _local6:int;
var _local2:Ship = ships[_arg1];
trace("LEAVE ", _local2.level_info_link.is_boss, _local2.line_index);
if (_local2.level_info_link.is_boss){
_local3 = _local2.line_index;
if (_local3 <= 0){
removeShip(_arg1, false);
return (true);
};
_local2.line_index = (_local3 - 1);
_local2.loadSpeed(-(_local2.speed));
_local4 = (GameConsts.lines_depth[_local2.line_index] * 0.05);
_local5 = ((_local2.speed)>0) ? (GameConsts.start_positions_x[0][_local2.line_index] - _local2.size.x) : (GameConsts.start_positions_x[1][_local2.line_index] + _local2.size.x);
trace("line = ", _local2.line_index, "z = ", _local4);
_local2.position = new Point3D(_local5, (Point3D.VIEW_Y + 20), _local4);
ship_layers[_local2.line_index].addChild(_local2);
return (false);
} else {
removeShip(_arg1, false);
_local6 = ProfileManager.getInstance().currentProfile.currentLevel;
TutorialManager.getInstance().notifyEvent((("shipleft(" + _local6) + ")"));
};
return (!NULL!);
}
private function removeShip(_arg1:int, _arg2:Boolean):void{
var _local4:MoneyPopUp;
var _local3:Ship = ships[_arg1];
if (_arg2){
_local4 = new MoneyPopUp(effect_manager, _local3.params.kill_money);
_local4.x = _local3.x;
_local4.y = (_local3.y - 20);
_local4.startPlay();
ball_layer.addChild(_local4);
effect_manager.addEffect(_local4);
};
_local3.removeEventListener(ShipEvent.SHOOT, shootHandler);
_local3.removeEventListener(ShipEvent.SINK, sinkHandler);
_local3.removeEventListener(ShipEvent.ROB, robEnemyHandler);
_local3.destroy();
ships.splice(_arg1, 1);
_local3.parent.removeChild(_local3);
dispatchEvent(new GameEvent(GameEvent.REMOVE_SHIP, [_local3.level_info_link, _arg2]));
}
private function shootHandler(_arg1:ShipEvent):void{
var _local2:CannonBall = (_arg1.data as CannonBall);
_local2.glow = _local2.will_hit;
ball_layer.addChild(_local2);
_local2.addEventListener(MouseEvent.MOUSE_DOWN, ballClickHandler);
enemy_balls.push(_local2);
}
private function soundsUpdate(_arg1:CannonBall):void{
if (!_arg1.will_hit){
if ((((_arg1.position.z < 0)) && (((_arg1.position.z + _arg1.velocity.z) > 0)))){
switch (_arg1.info.index){
case 2:
SoundManager.playSound("in_monkey");
break;
case 3:
SoundManager.playSound("in_rum");
break;
case 7:
SoundManager.playSound("in_flame");
break;
default:
SoundManager.playSound("ballfly");
break;
};
};
};
}
private function removeBall(_arg1:int, _arg2:Boolean):void{
var _local3:CannonBall = (_arg2) ? enemy_balls[_arg1] : player_balls[_arg1];
_local3.removeEventListener(MouseEvent.MOUSE_DOWN, ballClickHandler);
_local3.destroy();
if (_arg2){
enemy_balls.splice(_arg1, 1);
} else {
player_balls.splice(_arg1, 1);
};
_local3.parent.removeChild(_local3);
}
public function keyUp(_arg1:int):void{
if (_arg1 == Keyboard.LEFT){
left_pressed = false;
};
if (_arg1 == Keyboard.RIGHT){
right_pressed = false;
};
}
}
}//package game
Section 84
//LevelResult (game.LevelResult)
package game {
public class LevelResult {
public var money:int;
public var accurasy_bonus:int;
public var sunk_enemies:int;
public var monkey:int;
public var cannon_shots:int;
public var score:int;
public var total_ships:int;
public function LevelResult(){
score = 0;
money = 0;
monkey = 0;
accurasy_bonus = 0;
sunk_enemies = 0;
cannon_shots = 0;
total_ships = 0;
}
}
}//package game
Section 85
//PlayerShip (game.PlayerShip)
package game {
import flash.display.*;
public class PlayerShip extends MovieClip {
private var _state:Number;// = 100
public function PlayerShip(){
addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4, 4, frame5);
super();
}
public function get state():Number{
return (_state);
}
public function set state(_arg1:Number):void{
_state = Math.min(100, Math.max(0, _arg1));
var _local2:int = Math.min((Math.floor(((100 - _state) / 20)) + 1), 5);
this.gotoAndStop(_local2);
}
function frame2(){
stop();
}
function frame3(){
stop();
}
function frame4(){
stop();
}
function frame5(){
stop();
}
function frame1(){
stop();
}
}
}//package game
Section 86
//EnemyCannon (gamelibrary.enemyship.EnemyCannon)
package gamelibrary.enemyship {
import utils.*;
public class EnemyCannon {
public var position:Array;
public var index:int;// = -1
public var accuracy:Number;// = 1
public var ball_type:String;// = ""
public var damage:Number;// = 0
public function EnemyCannon(_arg1:XML, _arg2:String){
position = [0, 0];
super();
position = XMLValidator.validateAttibuteArray(_arg1, "pos", [0, 0]);
accuracy = XMLValidator.validateAttibuteNumber(_arg1, "accuracy", 1);
damage = XMLValidator.validateAttibuteNumber(_arg1, "damage", 0);
ball_type = XMLValidator.validateAttibuteString(_arg1, "ball_type", _arg2);
if (ball_type == ""){
ball_type = _arg2;
};
}
}
}//package gamelibrary.enemyship
Section 87
//EnemyShipParameters (gamelibrary.enemyship.EnemyShipParameters)
package gamelibrary.enemyship {
import utils.*;
import gamelibrary.*;
public class EnemyShipParameters {
public var indexes:Array;
public var size:Array;
public var death_sound:String;// = ""
public var isGhost:Boolean;
public var alive_frames_mirror:Boolean;
public var hit_points:Number;// = 0
public var isFort:Boolean;
public var rob_score:int;// = 0
public var clip_name:String;// = ""
public var reload_time_var:Number;// = 0
public var kill_money:int;// = 0
public var spawn_points:int;// = 0
public var speed_var:Number;// = 0
public var reload_time:Number;// = 0
public var nearest_line:int;// = 0
public var type:String;// = ""
public var water_offset:Number;// = 0
public var rob_money:int;// = 0
public var speed:Number;// = 0
public var index:int;// = -1
private var _cannons:Array;
public var farthest_line:int;// = 0
public var vertexes:Array;
public var kill_score:int;// = 0
public var shot_time_interval:Number;// = 0
public var kill_achievment:String;
public var isSubmarine:Boolean;
public var rob_rp:int;// = 0
public function EnemyShipParameters(_arg1:XML){
var _local5:EnemyCannon;
var _local6:String;
size = [0, 0];
_cannons = [];
vertexes = [];
indexes = [];
super();
index = XMLValidator.validateAttibuteNumber(_arg1, "index", -1);
clip_name = XMLValidator.validateAttibuteString(_arg1, "frames");
type = XMLValidator.validateAttibuteString(_arg1, "type");
size = XMLValidator.validateAttibuteArray(_arg1.params, "size", [0, 0]);
water_offset = XMLValidator.validateAttibuteNumber(_arg1.params, "water_offset");
hit_points = XMLValidator.validateAttibuteNumber(_arg1.params, "hit_points");
speed = XMLValidator.validateAttibuteNumber(_arg1.params, "speed");
speed_var = XMLValidator.validateAttibuteNumber(_arg1.params, "speed_var");
death_sound = XMLValidator.validateAttibuteString(_arg1.params, "death_sound");
nearest_line = XMLValidator.validateAttibuteNumber(_arg1.params, "nearest_line", 0);
farthest_line = XMLValidator.validateAttibuteNumber(_arg1.params, "farthest_line", 4);
reload_time = XMLValidator.validateAttibuteNumber(_arg1.params, "reload_time");
reload_time_var = XMLValidator.validateAttibuteNumber(_arg1.params, "reload_time_var");
shot_time_interval = XMLValidator.validateAttibuteNumber(_arg1.params, "shot_time_interval");
rob_money = XMLValidator.validateAttibuteNumber(_arg1.params, "rob_money");
rob_rp = XMLValidator.validateAttibuteNumber(_arg1.params, "rob_rp");
rob_score = XMLValidator.validateAttibuteNumber(_arg1.params, "rob_score");
kill_money = XMLValidator.validateAttibuteNumber(_arg1.params, "kill_money");
kill_score = XMLValidator.validateAttibuteNumber(_arg1.params, "kill_score");
kill_achievment = XMLValidator.validateAttibuteString(_arg1.params, "kill_achievment");
spawn_points = XMLValidator.validateAttibuteNumber(_arg1.params, "spawn_points", 1);
isFort = (XMLValidator.validateAttibuteString(_arg1.params, "fort") == "true");
isSubmarine = (XMLValidator.validateAttibuteString(_arg1.params, "submarine") == "true");
isGhost = (XMLValidator.validateAttibuteString(_arg1.params, "ghost") == "true");
alive_frames_mirror = !((XMLValidator.validateAttibuteString(_arg1.params, "alive_frames_mirror") == "false"));
_cannons = [];
var _local2:int = _arg1.cannons.children().length();
var _local3:String = XMLValidator.validateFieldString(_arg1, "ball_type", GameConsts.DEFAULT_ENEMY_CANNONBALL);
var _local4:int;
while (_local4 < _local2) {
_local5 = new EnemyCannon(_arg1.cannons.cannon[_local4], _local3);
_local5.index = _local4;
_cannons.push(_local5);
_local4++;
};
vertexes = [];
_local2 = _arg1.vertexes.children().length();
_local4 = 0;
while (_local4 < _local2) {
_local6 = _arg1.vertexes.vertex[_local4].toString();
vertexes.push(_local6.split(","));
_local4++;
};
indexes = [];
_local2 = _arg1.indexes.children().length();
_local4 = 0;
while (_local4 < _local2) {
indexes.push(Number(_arg1.indexes.index[_local4]));
_local4++;
};
}
public function get cannonsCount():int{
return (_cannons.length);
}
public function getCannon(_arg1:int):EnemyCannon{
if ((((_arg1 >= 0)) && ((_arg1 < _cannons.length)))){
return (_cannons[_arg1]);
};
return (null);
}
}
}//package gamelibrary.enemyship
Section 88
//CannonBallInfo (gamelibrary.CannonBallInfo)
package gamelibrary {
import utils.*;
public class CannonBallInfo {
public var dispersion:int;
public var player_hit_sound:String;
public var shot_sound:String;
public var shot_count:int;
public var radius:Number;
public var mine_radius:Number;
public var fire_damage:Boolean;
public var effect_scale:Number;
public var need_level:int;
public var slowdown:Boolean;
public var additional_effect:Array;
public var info:Array;
public var max_buy:int;
public var passby_sound:String;
public var type:String;
public var sort_key:int;
public var disable_cannons:Boolean;
public var load_size:Array;
public var mine_detect_radius:Number;
public var rob:Boolean;
public var is_mine:Boolean;
public var price:int;
public var gravity_mul:Number;
public var enemy_hit_effect:String;
public var index:int;
public var rotate:Boolean;
public var player_hit_effect:String;
public var octopus_lure:Boolean;
public var display_name:String;
public var ttl:int;
public var damage:int;
public var enemy_hit_sound:String;
public var deflect_sound:String;
public function CannonBallInfo(_arg1:XML){
index = XMLValidator.validateAttibuteNumber(_arg1, "index", -1);
type = XMLValidator.validateAttibuteString(_arg1, "type");
need_level = XMLValidator.validateAttibuteNumber(_arg1, "need_level", 0);
radius = XMLValidator.validateAttibuteNumber(_arg1, "radius", 0);
rotate = (XMLValidator.validateAttibuteString(_arg1, "rotate") == "true");
damage = XMLValidator.validateAttibuteNumber(_arg1, "damage", 0);
dispersion = XMLValidator.validateAttibuteNumber(_arg1, "dispersion", 0);
ttl = XMLValidator.validateAttibuteNumber(_arg1, "ttl", 0);
load_size = XMLValidator.validateAttibuteArray(_arg1, "load_size", [0, 0]);
display_name = XMLValidator.validateAttibuteString(_arg1, "display_name");
info = XMLValidator.validateAttibuteArray(_arg1, "info", [], "|");
price = XMLValidator.validateAttibuteNumber(_arg1, "price", -1);
max_buy = XMLValidator.validateAttibuteNumber(_arg1, "max_buy", -1);
player_hit_effect = XMLValidator.validateAttibuteString(_arg1, "player_hit_effect");
player_hit_sound = XMLValidator.validateAttibuteString(_arg1, "player_hit_sound");
enemy_hit_effect = XMLValidator.validateAttibuteString(_arg1, "enemy_hit_effect");
enemy_hit_sound = XMLValidator.validateAttibuteString(_arg1, "enemy_hit_sound");
shot_sound = XMLValidator.validateAttibuteString(_arg1, "shot_sound");
deflect_sound = XMLValidator.validateAttibuteString(_arg1, "deflect_sound");
passby_sound = XMLValidator.validateAttibuteString(_arg1, "passby_sound");
shot_count = XMLValidator.validateAttibuteNumber(_arg1, "shot_count", 1);
sort_key = XMLValidator.validateAttibuteNumber(_arg1, "sort_key", 0);
additional_effect = XMLValidator.validateAttibuteArray(_arg1, "additional_effect", []);
rob = (XMLValidator.validateAttibuteString(_arg1, "rob") == "true");
disable_cannons = (XMLValidator.validateAttibuteString(_arg1, "disable_cannons") == "true");
slowdown = (XMLValidator.validateAttibuteString(_arg1, "slowdown") == "true");
fire_damage = (XMLValidator.validateAttibuteString(_arg1, "fire_damage") == "true");
is_mine = (XMLValidator.validateAttibuteString(_arg1, "is_mine") == "true");
octopus_lure = (XMLValidator.validateAttibuteString(_arg1, "octopus_lure") == "true");
effect_scale = XMLValidator.validateAttibuteNumber(_arg1, "effect_scale", -1);
gravity_mul = XMLValidator.validateAttibuteNumber(_arg1, "gravity_mul", -1);
mine_radius = XMLValidator.validateAttibuteNumber(_arg1, "mine_radius", 0);
mine_detect_radius = XMLValidator.validateAttibuteNumber(_arg1, "mine_detect_radius", 0);
}
}
}//package gamelibrary
Section 89
//CannonParameters (gamelibrary.CannonParameters)
package gamelibrary {
import flash.geom.*;
import utils.*;
public class CannonParameters {
public var num_shots:int;
public var repair_price:int;
public var display_name:String;
public var price:int;
private var _positions:Array;
public var max_cballs:int;
public var info:Array;
public var index:int;
public var charge_time:Number;
public var need_level:int;
public var shot_delay:Number;
public function CannonParameters(_arg1:XML){
var _local4:Number;
var _local5:Number;
var _local6:Point;
super();
index = XMLValidator.validateAttibuteNumber(_arg1, "index", -1);
charge_time = XMLValidator.validateAttibuteNumber(_arg1, "charge_time");
shot_delay = XMLValidator.validateAttibuteNumber(_arg1, "shot_delay");
max_cballs = XMLValidator.validateAttibuteNumber(_arg1, "max_cballs", 1);
display_name = XMLValidator.validateAttibuteString(_arg1, "display_name");
info = XMLValidator.validateAttibuteArray(_arg1, "info", [], "|");
price = XMLValidator.validateAttibuteNumber(_arg1, "price");
num_shots = XMLValidator.validateAttibuteNumber(_arg1, "num_shots");
repair_price = XMLValidator.validateAttibuteNumber(_arg1, "repair_price");
need_level = XMLValidator.validateAttibuteNumber(_arg1, "need_level");
_positions = [];
var _local2:int = _arg1.position.children().length();
var _local3:int;
while (_local3 < _local2) {
_local4 = Number(_arg1.position.pos[_local3].@x);
_local5 = Number(_arg1.position.pos[_local3].@y);
_local6 = new Point((_local4 * 1.35), (_local5 * 1.5));
_positions.push(_local6);
_local3++;
};
}
public function getPositionAt(_arg1:int):Point{
if ((((_arg1 >= 0)) && ((_arg1 < _positions.length)))){
return (_positions[_arg1]);
};
return (null);
}
}
}//package gamelibrary
Section 90
//GameConsts (gamelibrary.GameConsts)
package gamelibrary {
import gamelibrary.enemyship.*;
import config.*;
public class GameConsts {
public static const DEFAULT_ENEMY_CANNONBALL:String = "CannonBall";
public static const GRAVIATATION:Number = 0.12;
public static const NUM_OPEN_LEVELS:int = 22;
private static const SHIP_LEVELS:Array = [[100, 1500, 100, 200, 20, 10], [150, 1500, 150, 300, 40, 15], [200, 3000, 200, 400, 50, 25], [350, 5000, 250, 500, 60, 30], [400, 8000, 350, 600, 70, 35], [350, 10000, 400, 700, 80, 40], [400, 15000, 450, 800, 90, 45], [600, 30000, 500, 900, 100, 50], [1000, 50000, 1000, 1000, 100, 60]];
public static var mine_swimming_time:int = 1860;
public static var score_per_push:int = 1;
public static var num_lines:int = 5;
private static var cannons:Array;
public static var deflect_inverse_y:Boolean = true;
public static var npcs_cb_gravity:Number = -2;
public static var disable_player_cannons_time:Number = 10;
public static var max_deflect_angle:Number = 30;
public static var test_mode:Boolean = false;
public static var battle_music_change:Number = 2;
public static var player_max_cb_gravity:Number = -25.5;
public static var num_levels:Number = 20;
public static var disable_cannons_time:Number = 30;
public static var octopus_damage:Number = 250;
public static var player_min_cb_speed:Number = 300;
public static var npcs_cb_speed:Number = 200;
public static var octopus_probability:Number = 0.75;
public static var player_max_cb_damage_mul:Number = 2;
public static var min_enemy_accuracy:Number = 0.1;
public static var start_player_level:Number = 0;
public static var start_level:Number = 0;
public static var min_enemy_speed:Number = 4;
public static var start_ball_parameters:Array = [[254, 212, 70, -8.7, -3, -4], [297, 212, 70, -2.9, -3, -4], [344.5, 212, 70, 3.2, -3, -4], [387.5, 212, 70, 9.3, -3, -4]];
public static var farthest_enemy_speed_mul:Number = 2;
private static var levels:Array;
public static var player_max_cb_speed:Number = 700;
private static var balls:Array;
public static var lines_depth:Array = [1000, 500, -500, -1500, -2500];
public static var start_positions_x:Array = [[0, -100, -200, -400, -500], [700, 800, 900, 1000, 1100]];
public static var cannon_touch_size:Array = [120, 140];
public static var god_mode:Boolean = false;
public static var enemy_rob_rp:Number = 10;
public static var max_slowdown_value:Number = 0.9;
public static var player_min_cb_gravity:Number = -2;
public static var difficulties:Array;
public static var start_money:Number = 150;
public static var cannons_count:int = 4;
public static var rum_slowdown_value:Number = 0.2;
public static var start_cannon_1:int = 1;
public static var start_cannon_2:int = 2;
public static var start_cannon_0:int = 0;
public static var farthest_enemy_accuracy:Number = 0.5;
public static var start_cannon_3:int = 3;
private static var ships:Array;
public static var start_repair_points:Number = 200;
public static var player_shot_distance:Number = 1600;
public static var cannon_balls_ttl:Number = 20;
public static var game_speed:Number = 1;
public static var knippel_slowdown_value:Number = 0.2;
public static var player_min_cb_damage_mul:Number = 1;
public static var player_max_gravity_x:Number = 6;
public static var enemy_rob_money:Number = 100;
public static var nearest_enemy_accuracy:Number = 0.9;
public static var firedamage_value:Number = 15;
public static var line_accuracy:Array = [1, 0.9, 0.8, 0.7, 0.6];
private static var demos:Array;
public static var nearest_enemy_speed_mul:Number = 1;
public static var deflect_power:Number = 0.6;
public static var money_per_accuracy:Number = 1;
public static function init():void{
var _local4:LevelInfo;
var _local5:GameDifficulty;
var _local6:EnemyShipParameters;
var _local7:CannonParameters;
var _local8:CannonBallInfo;
difficulties = [];
var _local1:XML = GameDifficultiesXML.DIFFICULTIES;
var _local2:int = _local1.children().length();
var _local3:int;
while (_local3 < _local2) {
_local5 = new GameDifficulty();
_local5.name = _local1.dif[_local3].@name;
_local5.npc_hp = _local1.dif[_local3].@npc_hp;
_local5.npc_cannon_damage = _local1.dif[_local3].@npc_cannon_damage;
_local5.npc_kill_money = _local1.dif[_local3].@npc_kill_money;
_local5.npc_accuracy = _local1.dif[_local3].@npc_accuracy;
_local5.npc_reload_time = _local1.dif[_local3].@npc_reload_time;
_local5.npc_rob_money = _local1.dif[_local3].@npc_rob_money;
_local5.npc_rob_rp = _local1.dif[_local3].@npc_rob_rp;
_local5.player_firedamage = _local1.dif[_local3].@player_firedamage;
_local5.player_rob_money = _local1.dif[_local3].@player_rob_money;
_local5.player_rob_rp = _local1.dif[_local3].@player_rob_rp;
difficulties.push(_local5);
_local3++;
};
levels = [];
_local1 = LevelsXML.LEVELS;
_local2 = _local1.children().length();
_local3 = 0;
while (_local3 < _local2) {
_local4 = new LevelInfo(_local1.level[_local3].@index, _local1.level[_local3]);
levels.push(_local4);
_local3++;
};
demos = [];
_local1 = LevelsXML.DEMOS;
_local2 = _local1.children().length();
_local3 = 0;
while (_local3 < _local2) {
_local4 = new LevelInfo(_local1.demo[_local3].@index, _local1.demo[_local3]);
demos.push(_local4);
_local3++;
};
ships = [];
_local1 = ShipsXML.SHIPS;
_local2 = _local1.children().length();
_local3 = 0;
while (_local3 < _local2) {
_local6 = new EnemyShipParameters(_local1.ship[_local3]);
ships.push(_local6);
_local3++;
};
cannons = [];
_local1 = CannonsXML.CANNONS;
_local2 = _local1.children().length();
_local3 = 0;
while (_local3 < _local2) {
_local7 = new CannonParameters(_local1.cannon[_local3]);
cannons.push(_local7);
_local3++;
};
balls = [];
_local1 = BallsXML.BALLS;
_local2 = _local1.children().length();
_local3 = 0;
while (_local3 < _local2) {
_local8 = new CannonBallInfo(_local1.ball[_local3]);
balls.push(_local8);
_local3++;
};
}
public static function getCannonParams(_arg1:int):CannonParameters{
var _local2:int;
while (_local2 < cannons.length) {
if (cannons[_local2].index == _arg1){
return (cannons[_local2]);
};
_local2++;
};
return (null);
}
public static function getBallParamsByType(_arg1:String):CannonBallInfo{
var _local2:int;
while (_local2 < balls.length) {
if (balls[_local2].type == _arg1){
return (balls[_local2]);
};
_local2++;
};
return (null);
}
public static function getLevelAtIndex(_arg1:int):LevelInfo{
var _local2:int;
while (_local2 < levels.length) {
if (levels[_local2].index == _arg1){
return (levels[_local2]);
};
_local2++;
};
return (null);
}
public static function getShipParams(_arg1:String):EnemyShipParameters{
var _local2:int;
while (_local2 < ships.length) {
if (ships[_local2].type == _arg1){
return (ships[_local2]);
};
_local2++;
};
return (null);
}
public static function getBallParamsByIndex(_arg1:int):CannonBallInfo{
var _local2:int;
while (_local2 < balls.length) {
if (balls[_local2].index == _arg1){
return (balls[_local2]);
};
_local2++;
};
return (null);
}
public static function getShipLevelInfo(_arg1:int):ShipLevelInfo{
if ((((_arg1 < 0)) || ((_arg1 >= SHIP_LEVELS.length)))){
return (null);
};
return (new ShipLevelInfo(_arg1, SHIP_LEVELS[_arg1]));
}
public static function getDemoAtIndex(_arg1:int):LevelInfo{
var _local2:int;
while (_local2 < demos.length) {
if (demos[_local2].index == _arg1){
return (demos[_local2]);
};
_local2++;
};
return (null);
}
}
}//package gamelibrary
Section 91
//GameDifficulty (gamelibrary.GameDifficulty)
package gamelibrary {
public class GameDifficulty {
public var player_firedamage:Number;
public var npc_rob_rp:Number;
public var npc_rob_money:Number;
public var name:String;
public var npc_hp:Number;
public var player_rob_money:Number;
public var npc_cannon_damage:Number;
public var npc_reload_time:Number;
public var npc_accuracy:Number;
public var player_rob_rp:Number;
public var npc_kill_money:Number;
}
}//package gamelibrary
Section 92
//LevelInfo (gamelibrary.LevelInfo)
package gamelibrary {
public class LevelInfo {
public var islands_set:String;
public var total_points:int;
public var index:int;
public var ships_per_time:Object;
public var ships:Array;
public function LevelInfo(_arg1:int, _arg2:XML){
var _local5:ShipInfo;
super();
this.index = _arg1;
var _local3:int = _arg2.ships.children().length();
ships = [];
ships_per_time = {};
var _local4:int;
while (_local4 < _local3) {
_local5 = new ShipInfo(_arg2.ships.ship[_local4]);
ships.push(_local5);
if (!ships_per_time[_local5.appearTime]){
ships_per_time[_local5.appearTime] = [_local4];
} else {
ships_per_time[_local5.appearTime].push(_local4);
};
_local4++;
};
total_points = Number(_arg2.total_points);
islands_set = String(_arg2.islands_set);
}
public function getShipsAtTime(_arg1:int):Array{
return (ships_per_time[_arg1]);
}
public function get num_ships():int{
return (ships.length);
}
}
}//package gamelibrary
Section 93
//PiratesL (gamelibrary.PiratesL)
package gamelibrary {
public class PiratesL {
public static const miLoading:int = 0;
public static const REPLACE_CANNON:String = "replace_cannon";
public static const YES:String = "yes";
public static const SCREEN_WIDTH:int = 640;
public static const REPLACE_AMMO:String = "replace_ammo";
public static const miSelectDifficulty:int = 3;
public static const miMap:int = 5;
public static const CONTINUE:String = "continue";
public static const miGame:int = 6;
public static const miGameOver:int = 11;
public static const miShop:int = 8;
public static const miSelectTutorial:int = 4;
public static const NO:String = "no";
public static const HIGHSCORES:String = "highscores";
public static const BEWARE:String = "beware";
public static const NEW_PROFILE:String = "new_profile";
public static const miSelectProfile:int = 9;
public static const NEW_PROFILE_CREATED:String = "new_player_created";
public static const NEW_GAME:String = "new_game";
public static const SCREEN_HEIGHT:int = 426;
public static const PAUSE:String = "pause";
public static const MENU:String = "menu";
public static const miOptions:int = 14;
public static const miHighRes:int = 15;
public static const GET_LINK:String = "http://phobos.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=343155686&mt=8";
public static const miConfirmRestart:int = 2;
public static const RESTART:String = "restart";
public static const miPaused:int = 10;
public static const miMainMenu:int = 1;
public static const miPromo:int = 12;
public static const APPSTORE_LINK:String = "http://phobos.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=343155686&mt=8";
public static const miShowResults:int = 7;
public static const OPTIONS:String = "options";
public static var CHITS_ON:Boolean = false;
}
}//package gamelibrary
Section 94
//ShipInfo (gamelibrary.ShipInfo)
package gamelibrary {
import utils.*;
public class ShipInfo {
public var added:Boolean;
public var type:String;// = ""
public var end_points:int;
public var spawn_interval:Number;
public var max_present_ships:int;
public var farthest_line:int;
public var start_points:int;
public var is_boss:Boolean;
public var spawn_interval_var:Number;
public var nearest_line:int;
public var present_num_ships:int;
public var appear_time:int;
public var wait_until_alone:Boolean;
public function ShipInfo(_arg1:XML){
type = XMLValidator.validateAttibuteString(_arg1, "type");
start_points = XMLValidator.validateAttibuteNumber(_arg1, "start_pts", 0);
end_points = XMLValidator.validateAttibuteNumber(_arg1, "end_pts", 0);
spawn_interval = XMLValidator.validateAttibuteNumber(_arg1, "spawn_int", 0);
spawn_interval_var = XMLValidator.validateAttibuteNumber(_arg1, "spawn_int_var", 0);
max_present_ships = XMLValidator.validateAttibuteNumber(_arg1, "max_pr_ships", 0);
nearest_line = XMLValidator.validateAttibuteNumber(_arg1, "nearest_line", 0);
farthest_line = XMLValidator.validateAttibuteNumber(_arg1, "farthest_line", 4);
is_boss = (XMLValidator.validateAttibuteString(_arg1, "is_boss") == "true");
appear_time = (2 * MathUtils.getRandomValue(start_points, end_points));
added = false;
present_num_ships = 0;
wait_until_alone = false;
}
public function get appearTime():int{
return (appear_time);
}
}
}//package gamelibrary
Section 95
//ShipLevelInfo (gamelibrary.ShipLevelInfo)
package gamelibrary {
public class ShipLevelInfo {
public var max_condition:int;
public var price:int;
public var repair_speed:int;
public var repair_price:int;
public var index:int;
public var max_repair_points:int;
public var repair_points_price:int;
public function ShipLevelInfo(_arg1:int, _arg2:Array){
this.index = _arg1;
max_condition = _arg2[0];
price = _arg2[1];
repair_price = _arg2[2];
max_repair_points = _arg2[3];
repair_points_price = _arg2[4];
repair_speed = _arg2[5];
}
}
}//package gamelibrary
Section 96
//MochiAd (mochi.as3.MochiAd)
package mochi.as3 {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.net.*;
import flash.system.*;
public class MochiAd {
public static function getVersion():String{
return (MochiServices.getVersion());
}
public static function showClickAwayAd(_arg1:Object):void{
var clip:Object;
var mc:MovieClip;
var chk:MovieClip;
var options = _arg1;
var DEFAULTS:Object = {ad_timeout:2000, regpt:"o", method:"showClickAwayAd", res:"300x250", no_bg:true, ad_started:function ():void{
}, ad_finished:function ():void{
}, ad_loaded:function (_arg1:Number, _arg2:Number):void{
}, ad_failed:function ():void{
trace("[MochiAd] Couldn't load an ad, make sure your game's local security sandbox is configured for Access Network Only and that you are not using ad blocking software");
}, ad_skipped:function ():void{
}};
options = MochiAd._parseOptions(options, DEFAULTS);
clip = options.clip;
var ad_timeout:Number = options.ad_timeout;
delete options.ad_timeout;
if (!MochiAd.load(options)){
options.ad_failed();
options.ad_finished();
return;
};
options.ad_started();
mc = clip._mochiad;
mc["onUnload"] = function ():void{
MochiAd._cleanup(mc);
options.ad_finished();
};
var wh:Array = MochiAd._getRes(options, clip);
var w:Number = wh[0];
var h:Number = wh[1];
mc.x = (w * 0.5);
mc.y = (h * 0.5);
chk = createEmptyMovieClip(mc, "_mochiad_wait", 3);
chk.ad_timeout = ad_timeout;
chk.started = getTimer();
chk.showing = false;
mc.unloadAd = function ():void{
MochiAd.unload(clip);
};
mc.adLoaded = options.ad_loaded;
mc.adSkipped = options.ad_skipped;
mc.rpc = function (_arg1:Number, _arg2:Object):void{
MochiAd.rpc(clip, _arg1, _arg2);
};
var sendHostProgress:Boolean;
mc.regContLC = function (_arg1:String):void{
mc._containerLCName = _arg1;
};
chk["onEnterFrame"] = function ():void{
var _local4:Number;
if (!this.parent){
delete this.onEnterFrame;
return;
};
var _local1:Object = this.parent._mochiad_ctr;
var _local2:Number = (getTimer() - this.started);
var _local3:Boolean;
if (!chk.showing){
_local4 = this.parent._mochiad_ctr.contentLoaderInfo.bytesTotal;
if (_local4 > 0){
chk.showing = true;
_local3 = true;
chk.started = getTimer();
} else {
if (_local2 > chk.ad_timeout){
options.ad_failed();
_local3 = true;
};
};
};
if (this.root == null){
_local3 = true;
};
if (_local3){
delete this.onEnterFrame;
};
};
doOnEnterFrame(chk);
}
public static function _isNetworkAvailable():Boolean{
return (!((Security.sandboxType == "localWithFile")));
}
public static function _allowDomains(_arg1:String):String{
var _local2:String = _arg1.split("/")[2].split(":")[0];
if (Security.sandboxType == "application"){
return (_local2);
};
Security.allowDomain("*");
Security.allowDomain(_local2);
Security.allowInsecureDomain("*");
Security.allowInsecureDomain(_local2);
return (_local2);
}
public static function unload(_arg1:Object):Boolean{
if (((_arg1.clip) && (_arg1.clip._mochiad))){
_arg1 = _arg1.clip;
};
if (_arg1.origFrameRate != undefined){
_arg1.stage.frameRate = _arg1.origFrameRate;
};
if (!_arg1._mochiad){
return (false);
};
if (_arg1._mochiad._containerLCName != undefined){
_arg1._mochiad.lc.send(_arg1._mochiad._containerLCName, "notify", {id:"unload"});
};
if (_arg1._mochiad.onUnload){
_arg1._mochiad.onUnload();
};
delete _arg1._mochiad_loaded;
delete _arg1._mochiad;
return (true);
}
public static function showInterLevelAd(_arg1:Object):void{
var clip:Object;
var mc:MovieClip;
var chk:MovieClip;
var options = _arg1;
var DEFAULTS:Object = {ad_timeout:2000, fadeout_time:250, regpt:"o", method:"showTimedAd", ad_started:function ():void{
if ((this.clip is MovieClip)){
this.clip.stop();
} else {
throw (new Error("MochiAd.showInterLevelAd requires a clip that is a MovieClip or is an instance of a class that extends MovieClip. If your clip is a Sprite, then you must provide custom ad_started and ad_finished handlers."));
};
}, ad_finished:function ():void{
if ((this.clip is MovieClip)){
this.clip.play();
} else {
throw (new Error("MochiAd.showInterLevelAd requires a clip that is a MovieClip or is an instance of a class that extends MovieClip. If your clip is a Sprite, then you must provide custom ad_started and ad_finished handlers."));
};
}, ad_loaded:function (_arg1:Number, _arg2:Number):void{
}, ad_failed:function ():void{
trace("[MochiAd] Couldn't load an ad, make sure your game's local security sandbox is configured for Access Network Only and that you are not using ad blocking software");
}, ad_skipped:function ():void{
}};
options = MochiAd._parseOptions(options, DEFAULTS);
clip = options.clip;
var ad_msec:Number = 11000;
var ad_timeout:Number = options.ad_timeout;
delete options.ad_timeout;
var fadeout_time:Number = options.fadeout_time;
delete options.fadeout_time;
if (!MochiAd.load(options)){
options.ad_failed();
options.ad_finished();
return;
};
options.ad_started();
mc = clip._mochiad;
mc["onUnload"] = function ():void{
MochiAd._cleanup(mc);
options.ad_finished();
};
var wh:Array = MochiAd._getRes(options, clip);
var w:Number = wh[0];
var h:Number = wh[1];
mc.x = (w * 0.5);
mc.y = (h * 0.5);
chk = createEmptyMovieClip(mc, "_mochiad_wait", 3);
chk.ad_msec = ad_msec;
chk.ad_timeout = ad_timeout;
chk.started = getTimer();
chk.showing = false;
chk.fadeout_time = fadeout_time;
chk.fadeFunction = function ():void{
if (!this.parent){
delete this.onEnterFrame;
delete this.fadeFunction;
return;
};
var _local1:Number = (100 * (1 - ((getTimer() - this.fadeout_start) / this.fadeout_time)));
if (_local1 > 0){
this.parent.alpha = (_local1 * 0.01);
} else {
MochiAd.unload(clip);
delete this["onEnterFrame"];
};
};
mc.unloadAd = function ():void{
MochiAd.unload(clip);
};
mc.adLoaded = options.ad_loaded;
mc.adSkipped = options.ad_skipped;
mc.adjustProgress = function (_arg1:Number):void{
var _local2:Object = mc._mochiad_wait;
_local2.server_control = true;
_local2.showing = true;
_local2.started = getTimer();
_local2.ad_msec = (_arg1 - 250);
};
mc.rpc = function (_arg1:Number, _arg2:Object):void{
MochiAd.rpc(clip, _arg1, _arg2);
};
chk["onEnterFrame"] = function ():void{
var _local4:Number;
if (!this.parent){
delete this.onEnterFrame;
delete this.fadeFunction;
return;
};
var _local1:Object = this.parent._mochiad_ctr;
var _local2:Number = (getTimer() - this.started);
var _local3:Boolean;
if (!chk.showing){
_local4 = this.parent._mochiad_ctr.contentLoaderInfo.bytesTotal;
if (_local4 > 0){
chk.showing = true;
chk.started = getTimer();
MochiAd.adShowing(clip);
} else {
if (_local2 > chk.ad_timeout){
options.ad_failed();
_local3 = true;
};
};
};
if (_local2 > chk.ad_msec){
_local3 = true;
};
if (_local3){
if (this.server_control){
delete this.onEnterFrame;
} else {
this.fadeout_start = getTimer();
this.onEnterFrame = this.fadeFunction;
};
};
};
doOnEnterFrame(chk);
}
public static function _parseOptions(_arg1:Object, _arg2:Object):Object{
var _local4:String;
var _local5:Array;
var _local6:Number;
var _local7:Array;
var _local3:Object = {};
for (_local4 in _arg2) {
_local3[_local4] = _arg2[_local4];
};
if (_arg1){
for (_local4 in _arg1) {
_local3[_local4] = _arg1[_local4];
};
};
if (_local3.clip == undefined){
throw (new Error("MochiAd is missing the 'clip' parameter. This should be a MovieClip, Sprite or an instance of a class that extends MovieClip or Sprite."));
};
_arg1 = _local3.clip.loaderInfo.parameters.mochiad_options;
if (_arg1){
_local5 = _arg1.split("&");
_local6 = 0;
while (_local6 < _local5.length) {
_local7 = _local5[_local6].split("=");
_local3[unescape(_local7[0])] = unescape(_local7[1]);
_local6++;
};
};
if (_local3.id == "test"){
trace("[MochiAd] WARNING: Using the MochiAds test identifier, make sure to use the code from your dashboard, not this example!");
};
return (_local3);
}
public static function _cleanup(_arg1:Object):void{
var k:String;
var lc:LocalConnection;
var f:Function;
var mc = _arg1;
if (("lc" in mc)){
lc = mc.lc;
f = function ():void{
try {
lc.client = null;
lc.close();
} catch(e:Error) {
};
};
setTimeout(f, 0);
};
var idx:Number = DisplayObjectContainer(mc).numChildren;
while (idx > 0) {
idx = (idx - 1);
DisplayObjectContainer(mc).removeChildAt(idx);
};
for (k in mc) {
delete mc[k];
};
}
public static function load(_arg1:Object):MovieClip{
var clip:Object;
var k:String;
var server:String;
var hostname:String;
var lc:LocalConnection;
var name:String;
var loader:Loader;
var g:Function;
var req:URLRequest;
var v:Object;
var options = _arg1;
var DEFAULTS:Object = {server:"http://x.mochiads.com/srv/1/", method:"load", depth:10333, id:"_UNKNOWN_"};
options = MochiAd._parseOptions(options, DEFAULTS);
options.swfv = 9;
options.mav = MochiAd.getVersion();
clip = options.clip;
if (!(clip is DisplayObject)){
trace("Warning: Object passed as container clip not a descendant of the DisplayObject type");
return (null);
};
if (MovieClip(clip).stage == null){
trace("Warning: Container clip for ad is not attached to the stage");
return (null);
};
if (!MochiAd._isNetworkAvailable()){
return (null);
};
try {
if (clip._mochiad_loaded){
return (null);
};
} catch(e:Error) {
throw (new Error("MochiAd requires a clip that is an instance of a dynamic class. If your class extends Sprite or MovieClip, you must make it dynamic."));
};
var depth:Number = options.depth;
delete options.depth;
var mc:MovieClip = createEmptyMovieClip(clip, "_mochiad", depth);
var wh:Array = MochiAd._getRes(options, clip);
options.res = ((wh[0] + "x") + wh[1]);
options.server = (options.server + options.id);
delete options.id;
clip._mochiad_loaded = true;
if (clip.loaderInfo.loaderURL.indexOf("http") == 0){
options.as3_swf = clip.loaderInfo.loaderURL;
} else {
trace("[MochiAd] NOTE: Security Sandbox Violation errors below are normal");
};
var lv:URLVariables = new URLVariables();
for (k in options) {
v = options[k];
if (!(v is Function)){
lv[k] = v;
};
};
server = lv.server;
delete lv.server;
hostname = _allowDomains(server);
lc = new LocalConnection();
lc.client = mc;
name = ["", Math.floor(new Date().getTime()), Math.floor((Math.random() * 999999))].join("_");
lc.allowDomain("*", "localhost");
lc.allowInsecureDomain("*", "localhost");
lc.connect(name);
mc.lc = lc;
mc.lcName = name;
lv.lc = name;
lv.st = getTimer();
loader = new Loader();
g = function (_arg1:Object):void{
_arg1.target.removeEventListener(_arg1.type, arguments.callee);
MochiAd.unload(clip);
};
loader.contentLoaderInfo.addEventListener(Event.UNLOAD, g);
req = new URLRequest(((server + ".swf?cacheBust=") + new Date().getTime()));
req.contentType = "application/x-www-form-urlencoded";
req.method = URLRequestMethod.POST;
req.data = lv;
loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, function (_arg1:IOErrorEvent):void{
trace("[MochiAds] Blocked URL");
});
if (!options.skip){
loader.load(req);
};
mc.addChild(loader);
mc._mochiad_ctr = loader;
return (mc);
}
public static function runMethod(_arg1:Object, _arg2:String, _arg3:Array):Object{
var _local4:Array = _arg2.split(".");
var _local5:Number = 0;
while (_local5 < (_local4.length - 1)) {
if ((((_arg1[_local4[_local5]] == undefined)) || ((_arg1[_local4[_local5]] == null)))){
return (undefined);
};
_arg1 = _arg1[_local4[_local5]];
_local5++;
};
if (typeof(_arg1[_local4[_local5]]) == "function"){
return (_arg1[_local4[_local5]].apply(_arg1, _arg3));
};
return (undefined);
}
public static function createEmptyMovieClip(_arg1:Object, _arg2:String, _arg3:Number):MovieClip{
var _local4:MovieClip = new MovieClip();
if (((false) && (_arg3))){
_arg1.addChildAt(_local4, _arg3);
} else {
_arg1.addChild(_local4);
};
_arg1[_arg2] = _local4;
_local4["_name"] = _arg2;
return (_local4);
}
public static function _getRes(_arg1:Object, _arg2:Object):Array{
var _local6:Array;
var _local3:Object = _arg2.getBounds(_arg2.root);
var _local4:Number = 0;
var _local5:Number = 0;
if (typeof(_arg1.res) != "undefined"){
_local6 = _arg1.res.split("x");
_local4 = parseFloat(_local6[0]);
_local5 = parseFloat(_local6[1]);
} else {
_local4 = (_local3.xMax - _local3.xMin);
_local5 = (_local3.yMax - _local3.yMin);
};
if ((((_local4 == 0)) || ((_local5 == 0)))){
_local4 = _arg2.stage.stageWidth;
_local5 = _arg2.stage.stageHeight;
};
return ([_local4, _local5]);
}
public static function adShowing(_arg1:Object):void{
_arg1.origFrameRate = _arg1.stage.frameRate;
_arg1.stage.frameRate = 30;
}
public static function getValue(_arg1:Object, _arg2:String):Object{
var _local3:Array = _arg2.split(".");
var _local4:Number = 0;
while (_local4 < (_local3.length - 1)) {
if ((((_arg1[_local3[_local4]] == undefined)) || ((_arg1[_local3[_local4]] == null)))){
return (undefined);
};
_arg1 = _arg1[_local3[_local4]];
_local4++;
};
return (_arg1[_local3[_local4]]);
}
public static function rpc(_arg1:Object, _arg2:Number, _arg3:Object):void{
var _local4:Object;
var _local5:Object;
switch (_arg3.id){
case "setValue":
MochiAd.setValue(_arg1, _arg3.objectName, _arg3.value);
break;
case "getValue":
_local4 = MochiAd.getValue(_arg1, _arg3.objectName);
_arg1._mochiad.lc.send(_arg1._mochiad._containerLCName, "rpcResult", _arg2, _local4);
break;
case "runMethod":
_local5 = MochiAd.runMethod(_arg1, _arg3.method, _arg3.args);
_arg1._mochiad.lc.send(_arg1._mochiad._containerLCName, "rpcResult", _arg2, _local5);
break;
default:
trace(("[mochiads rpc] unknown rpc id: " + _arg3.id));
};
}
public static function setValue(_arg1:Object, _arg2:String, _arg3:Object):void{
var _local4:Array = _arg2.split(".");
var _local5:Number = 0;
while (_local5 < (_local4.length - 1)) {
if ((((_arg1[_local4[_local5]] == undefined)) || ((_arg1[_local4[_local5]] == null)))){
return;
};
_arg1 = _arg1[_local4[_local5]];
_local5++;
};
_arg1[_local4[_local5]] = _arg3;
}
public static function showPreGameAd(_arg1:Object):void{
var clip:Object;
var mc:MovieClip;
var chk:MovieClip;
var complete:Boolean;
var unloaded:Boolean;
var sendHostProgress:Boolean;
var fn:Function;
var r:MovieClip;
var options = _arg1;
var DEFAULTS:Object = {ad_timeout:3000, fadeout_time:250, regpt:"o", method:"showPreloaderAd", color:0xFF8A00, background:16777161, outline:13994812, no_progress_bar:false, ad_started:function ():void{
if ((this.clip is MovieClip)){
this.clip.stop();
} else {
throw (new Error("MochiAd.showPreGameAd requires a clip that is a MovieClip or is an instance of a class that extends MovieClip. If your clip is a Sprite, then you must provide custom ad_started and ad_finished handlers."));
};
}, ad_finished:function ():void{
if ((this.clip is MovieClip)){
this.clip.play();
} else {
throw (new Error("MochiAd.showPreGameAd requires a clip that is a MovieClip or is an instance of a class that extends MovieClip. If your clip is a Sprite, then you must provide custom ad_started and ad_finished handlers."));
};
}, ad_loaded:function (_arg1:Number, _arg2:Number):void{
}, ad_failed:function ():void{
trace("[MochiAd] Couldn't load an ad, make sure your game's local security sandbox is configured for Access Network Only and that you are not using ad blocking software");
}, ad_skipped:function ():void{
}, ad_progress:function (_arg1:Number):void{
}, progress_override:function (_arg1:Object):Number{
return (NaN);
}, bar_offset:0};
options = MochiAd._parseOptions(options, DEFAULTS);
if ("c862232051e0a94e1c3609b3916ddb17".substr(0) == "dfeada81ac97cde83665f81c12da7def"){
options.ad_started();
fn = function ():void{
options.ad_finished();
};
setTimeout(fn, 100);
return;
};
clip = options.clip;
var ad_msec:Number = 11000;
var ad_timeout:Number = options.ad_timeout;
if (options.skip){
ad_timeout = 0;
};
delete options.ad_timeout;
var fadeout_time:Number = options.fadeout_time;
delete options.fadeout_time;
if (!MochiAd.load(options)){
options.ad_failed();
options.ad_finished();
return;
};
options.ad_started();
mc = clip._mochiad;
mc["onUnload"] = function ():void{
MochiAd._cleanup(mc);
var fn:Function = function ():void{
options.ad_finished();
};
setTimeout(fn, 100);
};
var wh:Array = MochiAd._getRes(options, clip);
var w:Number = wh[0];
var h:Number = wh[1];
mc.x = (w * 0.5);
mc.y = (h * 0.5);
chk = createEmptyMovieClip(mc, "_mochiad_wait", 3);
chk.x = (w * -0.5);
chk.y = (h * -0.5);
var bar:MovieClip = createEmptyMovieClip(chk, "_mochiad_bar", 4);
if (options.no_progress_bar){
bar.visible = false;
delete options.no_progress_bar;
} else {
bar.x = (10 + options.bar_offset);
bar.y = (h - 20);
};
var bar_w:Number = ((w - bar.x) - 10);
var bar_color:Number = options.color;
delete options.color;
var bar_background:Number = options.background;
delete options.background;
var bar_outline:Number = options.outline;
delete options.outline;
var backing_mc:MovieClip = createEmptyMovieClip(bar, "_outline", 1);
var backing:Object = backing_mc.graphics;
backing.beginFill(bar_background);
backing.moveTo(0, 0);
backing.lineTo(bar_w, 0);
backing.lineTo(bar_w, 10);
backing.lineTo(0, 10);
backing.lineTo(0, 0);
backing.endFill();
var inside_mc:MovieClip = createEmptyMovieClip(bar, "_inside", 2);
var inside:Object = inside_mc.graphics;
inside.beginFill(bar_color);
inside.moveTo(0, 0);
inside.lineTo(bar_w, 0);
inside.lineTo(bar_w, 10);
inside.lineTo(0, 10);
inside.lineTo(0, 0);
inside.endFill();
inside_mc.scaleX = 0;
var outline_mc:MovieClip = createEmptyMovieClip(bar, "_outline", 3);
var outline:Object = outline_mc.graphics;
outline.lineStyle(0, bar_outline, 100);
outline.moveTo(0, 0);
outline.lineTo(bar_w, 0);
outline.lineTo(bar_w, 10);
outline.lineTo(0, 10);
outline.lineTo(0, 0);
chk.ad_msec = ad_msec;
chk.ad_timeout = ad_timeout;
chk.started = getTimer();
chk.showing = false;
chk.last_pcnt = 0;
chk.fadeout_time = fadeout_time;
chk.fadeFunction = function ():void{
var _local1:Number = (100 * (1 - ((getTimer() - this.fadeout_start) / this.fadeout_time)));
if (_local1 > 0){
this.parent.alpha = (_local1 * 0.01);
} else {
MochiAd.unload(clip);
delete this["onEnterFrame"];
};
};
complete = false;
unloaded = false;
var progress:Number = Math.min(1, options.progress_override(clip));
var f:Function = function (_arg1:Event):void{
_arg1.target.removeEventListener(_arg1.type, arguments.callee);
complete = true;
if (unloaded){
MochiAd.unload(clip);
};
};
if (!isNaN(progress)){
complete = (progress == 1);
} else {
if (clip.loaderInfo.bytesLoaded == clip.loaderInfo.bytesTotal){
complete = true;
} else {
if ((clip.root is MovieClip)){
r = (clip.root as MovieClip);
if (r.framesLoaded >= r.totalFrames){
complete = true;
} else {
clip.loaderInfo.addEventListener(Event.COMPLETE, f);
};
} else {
clip.loaderInfo.addEventListener(Event.COMPLETE, f);
};
};
};
mc.unloadAd = function ():void{
unloaded = true;
if (complete){
MochiAd.unload(clip);
};
};
mc.adLoaded = options.ad_loaded;
mc.adSkipped = options.ad_skipped;
mc.adjustProgress = function (_arg1:Number):void{
var _local2:Object = mc._mochiad_wait;
_local2.server_control = true;
_local2.showing = true;
_local2.started = getTimer();
_local2.ad_msec = _arg1;
};
mc.rpc = function (_arg1:Number, _arg2:Object):void{
MochiAd.rpc(clip, _arg1, _arg2);
};
mc.rpcTestFn = function (_arg1:String):Object{
trace(("[MOCHIAD rpcTestFn] " + _arg1));
return (_arg1);
};
mc.regContLC = function (_arg1:String):void{
mc._containerLCName = _arg1;
};
sendHostProgress = false;
mc.sendHostLoadProgress = function (_arg1:String):void{
sendHostProgress = true;
};
chk["onEnterFrame"] = function ():void{
var _local12:Number;
if (((!(this.parent)) || (!(this.parent.parent)))){
delete this["onEnterFrame"];
return;
};
var _local1:Object = this.parent.parent.root;
var _local2:Object = this.parent._mochiad_ctr;
var _local3:Number = (getTimer() - this.started);
var _local4:Boolean;
var _local5:Number = _local1.loaderInfo.bytesTotal;
var _local6:Number = _local1.loaderInfo.bytesLoaded;
var _local7:Number = Math.min(1, options.progress_override(_local1));
if (_local7 == 1){
complete = true;
};
if (complete){
_local6 = Math.max(1, _local6);
_local5 = _local6;
};
var _local8:Number = ((100 * _local6) / _local5);
if (!isNaN(_local7)){
_local8 = (100 * _local7);
};
var _local9:Number = ((100 * _local3) / chk.ad_msec);
var _local10:Object = this._mochiad_bar._inside;
var _local11:Number = Math.min(100, Math.min(((_local8) || (0)), _local9));
_local11 = Math.max(this.last_pcnt, _local11);
this.last_pcnt = _local11;
_local10.scaleX = (_local11 * 0.01);
options.ad_progress(_local11);
if (sendHostProgress){
clip._mochiad.lc.send(clip._mochiad._containerLCName, "notify", {id:"hostLoadPcnt", pcnt:_local8});
if (_local8 >= 100){
sendHostProgress = false;
};
};
if (!chk.showing){
_local12 = this.parent._mochiad_ctr.contentLoaderInfo.bytesTotal;
if (_local12 > 0){
chk.showing = true;
chk.started = getTimer();
MochiAd.adShowing(clip);
} else {
if ((((_local3 > chk.ad_timeout)) && ((_local8 == 100)))){
options.ad_failed();
_local4 = true;
};
};
};
if (_local3 > chk.ad_msec){
_local4 = true;
};
if (((complete) && (_local4))){
if (unloaded){
MochiAd.unload(_local1);
} else {
if (this.server_control){
delete this.onEnterFrame;
} else {
this.fadeout_start = getTimer();
this.onEnterFrame = chk.fadeFunction;
};
};
};
};
doOnEnterFrame(chk);
}
public static function showPreloaderAd(_arg1:Object):void{
trace("[MochiAd] DEPRECATED: showPreloaderAd was renamed to showPreGameAd in 2.0");
MochiAd.showPreGameAd(_arg1);
}
public static function showTimedAd(_arg1:Object):void{
trace("[MochiAd] DEPRECATED: showTimedAd was renamed to showInterLevelAd in 2.0");
MochiAd.showInterLevelAd(_arg1);
}
public static function doOnEnterFrame(_arg1:MovieClip):void{
var mc = _arg1;
var f:Function = function (_arg1:Object):void{
if (((("onEnterFrame" in mc)) && (mc.onEnterFrame))){
mc.onEnterFrame();
} else {
_arg1.target.removeEventListener(_arg1.type, arguments.callee);
};
};
mc.addEventListener(Event.ENTER_FRAME, f);
}
}
}//package mochi.as3
Section 97
//MochiCoins (mochi.as3.MochiCoins)
package mochi.as3 {
public class MochiCoins {
public static const STORE_HIDE:String = "StoreHide";
public static const NO_USER:String = "NoUser";
public static const IO_ERROR:String = "IOError";
public static const ITEM_NEW:String = "ItemNew";
public static const ITEM_OWNED:String = "ItemOwned";
public static const STORE_ITEMS:String = "StoreItems";
public static const ERROR:String = "Error";
public static const STORE_SHOW:String = "StoreShow";
public static var _inventory:MochiInventory;
public static function triggerEvent(_arg1:String, _arg2:Object):void{
MochiSocial.triggerEvent(_arg1, _arg2);
}
public static function removeEventListener(_arg1:String, _arg2:Function):void{
MochiSocial.removeEventListener(_arg1, _arg2);
}
public static function addEventListener(_arg1:String, _arg2:Function):void{
MochiSocial.addEventListener(_arg1, _arg2);
}
public static function getStoreItems():void{
MochiServices.send("coins_getStoreItems");
}
public static function get inventory():MochiInventory{
return (_inventory);
}
public static function showStore(_arg1:Object=null):void{
MochiServices.bringToTop();
MochiServices.send("coins_showStore", {options:_arg1}, null, null);
}
public static function showItem(_arg1:Object=null):void{
if (((!(_arg1)) || (!((typeof(_arg1.item) == "string"))))){
trace("ERROR: showItem call must pass an Object with an item key");
return;
};
MochiServices.bringToTop();
MochiServices.send("coins_showItem", {options:_arg1}, null, null);
}
public static function getVersion():String{
return (MochiServices.getVersion());
}
public static function showVideo(_arg1:Object=null):void{
if (((!(_arg1)) || (!((typeof(_arg1.item) == "string"))))){
trace("ERROR: showVideo call must pass an Object with an item key");
return;
};
MochiServices.bringToTop();
MochiServices.send("coins_showVideo", {options:_arg1}, null, null);
}
MochiSocial.addEventListener(MochiSocial.LOGGED_IN, function (_arg1:Object):void{
_inventory = new MochiInventory();
});
MochiSocial.addEventListener(MochiSocial.LOGGED_OUT, function (_arg1:Object):void{
_inventory = null;
});
}
}//package mochi.as3
Section 98
//MochiDigits (mochi.as3.MochiDigits)
package mochi.as3 {
public final class MochiDigits {
private var Sibling:MochiDigits;
private var Fragment:Number;
private var Encoder:Number;
public function MochiDigits(_arg1:Number=0, _arg2:uint=0):void{
Encoder = 0;
setValue(_arg1, _arg2);
}
public function reencode():void{
var _local1:uint = int((2147483647 * Math.random()));
Fragment = (Fragment ^ (_local1 ^ Encoder));
Encoder = _local1;
}
public function set value(_arg1:Number):void{
setValue(_arg1);
}
public function toString():String{
var _local1:String = String.fromCharCode((Fragment ^ Encoder));
if (Sibling != null){
_local1 = (_local1 + Sibling.toString());
};
return (_local1);
}
public function setValue(_arg1:Number=0, _arg2:uint=0):void{
var _local3:String = _arg1.toString();
var _temp1 = _arg2;
_arg2 = (_arg2 + 1);
Fragment = (_local3.charCodeAt(_temp1) ^ Encoder);
if (_arg2 < _local3.length){
Sibling = new MochiDigits(_arg1, _arg2);
} else {
Sibling = null;
};
reencode();
}
public function get value():Number{
return (Number(this.toString()));
}
public function addValue(_arg1:Number):void{
value = (value + _arg1);
}
}
}//package mochi.as3
Section 99
//MochiEventDispatcher (mochi.as3.MochiEventDispatcher)
package mochi.as3 {
public class MochiEventDispatcher {
private var eventTable:Object;
public function MochiEventDispatcher():void{
eventTable = {};
}
public function triggerEvent(_arg1:String, _arg2:Object):void{
var _local3:Object;
if (eventTable[_arg1] == undefined){
return;
};
for (_local3 in eventTable[_arg1]) {
var _local6 = eventTable[_arg1];
_local6[_local3](_arg2);
};
}
public function removeEventListener(_arg1:String, _arg2:Function):void{
var _local3:Object;
if (eventTable[_arg1] == undefined){
eventTable[_arg1] = [];
return;
};
for (_local3 in eventTable[_arg1]) {
if (eventTable[_arg1][_local3] != _arg2){
} else {
eventTable[_arg1].splice(Number(_local3), 1);
};
};
}
public function addEventListener(_arg1:String, _arg2:Function):void{
removeEventListener(_arg1, _arg2);
eventTable[_arg1].push(_arg2);
}
}
}//package mochi.as3
Section 100
//MochiEvents (mochi.as3.MochiEvents)
package mochi.as3 {
import flash.display.*;
public class MochiEvents {
public static const ALIGN_BOTTOM_LEFT:String = "ALIGN_BL";
public static const FORMAT_LONG:String = "LongForm";
public static const ALIGN_BOTTOM:String = "ALIGN_B";
public static const ACHIEVEMENT_RECEIVED:String = "AchievementReceived";
public static const FORMAT_SHORT:String = "ShortForm";
public static const ALIGN_TOP_RIGHT:String = "ALIGN_TR";
public static const ALIGN_BOTTOM_RIGHT:String = "ALIGN_BR";
public static const ALIGN_TOP:String = "ALIGN_T";
public static const ALIGN_LEFT:String = "ALIGN_L";
public static const ALIGN_RIGHT:String = "ALIGN_R";
public static const ALIGN_TOP_LEFT:String = "ALIGN_TL";
public static const ALIGN_CENTER:String = "ALIGN_C";
private static var _dispatcher:MochiEventDispatcher = new MochiEventDispatcher();
private static var gameStart:Number;
private static var levelStart:Number;
public static function addEventListener(_arg1:String, _arg2:Function):void{
_dispatcher.addEventListener(_arg1, _arg2);
}
public static function removeEventListener(_arg1:String, _arg2:Function):void{
_dispatcher.removeEventListener(_arg1, _arg2);
}
public static function startSession(_arg1:String):void{
MochiServices.send("events_beginSession", {achievementID:_arg1}, null, null);
}
public static function triggerEvent(_arg1:String, _arg2:Object):void{
_dispatcher.triggerEvent(_arg1, _arg2);
}
public static function setNotifications(_arg1:MovieClip, _arg2:Object):void{
var _local4:Object;
var _local3:Object = {};
for (_local4 in _arg2) {
_local3[_local4] = _arg2[_local4];
};
_local3.clip = _arg1;
MochiServices.send("events_setNotifications", _local3, null, null);
}
public static function endGame():void{
var _local1:Number = (new Date().time - gameStart);
trigger("end_game", {time:_local1});
}
public static function startGame():void{
gameStart = new Date().time;
trigger("start_game");
}
public static function trigger(_arg1:String, _arg2:Object=null):void{
if (_arg2 == null){
_arg2 = {};
} else {
if (_arg2["kind"] != undefined){
trace("WARNING: optional arguments package contains key 'id', it will be overwritten");
_arg2["kind"] = _arg1;
};
};
MochiServices.send("events_triggerEvent", {eventObject:_arg2}, null, null);
}
public static function getVersion():String{
return (MochiServices.getVersion());
}
public static function startLevel():void{
levelStart = new Date().time;
trigger("start_level");
}
public static function endLevel():void{
var _local1:Number = (new Date().time - levelStart);
trigger("end_level", {time:_local1});
}
}
}//package mochi.as3
Section 101
//MochiInventory (mochi.as3.MochiInventory)
package mochi.as3 {
import flash.events.*;
import flash.utils.*;
public dynamic class MochiInventory extends Proxy {
private var _timer:Timer;
private var _names:Array;
private var _syncID:Number;
private var _consumableProperties:Object;
private var _storeSync:Object;
private var _outstandingID:Number;
private var _syncPending:Boolean;
public static const READY:String = "InvReady";
public static const ERROR:String = "Error";
public static const IO_ERROR:String = "IoError";
private static const KEY_SALT:String = " syncMaint";
public static const WRITTEN:String = "InvWritten";
public static const NOT_READY:String = "InvNotReady";
public static const VALUE_ERROR:String = "InvValueError";
private static const CONSUMER_KEY:String = "MochiConsumables";
private static var _dispatcher:MochiEventDispatcher = new MochiEventDispatcher();
public function MochiInventory():void{
MochiCoins.addEventListener(MochiCoins.ITEM_OWNED, itemOwned);
MochiCoins.addEventListener(MochiCoins.ITEM_NEW, newItems);
MochiSocial.addEventListener(MochiSocial.LOGGED_IN, loggedIn);
MochiSocial.addEventListener(MochiSocial.LOGGED_OUT, loggedOut);
_storeSync = new Object();
_syncPending = false;
_outstandingID = 0;
_syncID = 0;
_timer = new Timer(1000);
_timer.addEventListener(TimerEvent.TIMER, sync);
_timer.start();
if (MochiSocial.loggedIn){
loggedIn();
} else {
loggedOut();
};
}
private function newItems(_arg1:Object):void{
if (!this[(_arg1.id + KEY_SALT)]){
this[(_arg1.id + KEY_SALT)] = 0;
};
if (!this[_arg1.id]){
this[_arg1.id] = 0;
};
this[(_arg1.id + KEY_SALT)] = (this[(_arg1.id + KEY_SALT)] + _arg1.count);
this[_arg1.id] = (this[_arg1.id] + _arg1.count);
if (_arg1.privateProperties.consumable){
if (!this[_arg1.privateProperties.tag]){
this[_arg1.privateProperties.tag] = 0;
};
this[_arg1.privateProperties.tag] = (this[_arg1.privateProperties.tag] + (_arg1.privateProperties.inc * _arg1.count));
};
}
public function release():void{
MochiCoins.removeEventListener(MochiCoins.ITEM_NEW, newItems);
MochiSocial.removeEventListener(MochiSocial.LOGGED_IN, loggedIn);
MochiSocial.removeEventListener(MochiSocial.LOGGED_OUT, loggedOut);
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function getProperty(_arg1){
if (_consumableProperties == null){
triggerEvent(ERROR, {type:NOT_READY});
return (-1);
};
if (_consumableProperties[_arg1]){
return (MochiDigits(_consumableProperties[_arg1]).value);
};
return (undefined);
}
private function loggedIn(_arg1:Object=null):void{
MochiUserData.get(CONSUMER_KEY, getConsumableBag);
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function hasProperty(_arg1):Boolean{
if (_consumableProperties == null){
triggerEvent(ERROR, {type:NOT_READY});
return (false);
};
if (_consumableProperties[_arg1] == undefined){
return (false);
};
return (true);
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function nextNameIndex(_arg1:int):int{
return (((_arg1)>=_names.length) ? 0 : (_arg1 + 1));
}
private function putConsumableBag(_arg1:MochiUserData):void{
_syncPending = false;
if (_arg1.error){
triggerEvent(ERROR, {type:IO_ERROR, error:_arg1.error});
_outstandingID = -1;
};
triggerEvent(WRITTEN, {});
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function setProperty(_arg1, _arg2):void{
var _local3:MochiDigits;
if (_consumableProperties == null){
triggerEvent(ERROR, {type:NOT_READY});
return;
};
if (!(_arg2 is Number)){
triggerEvent(ERROR, {type:VALUE_ERROR, error:"Invalid type", arg:_arg2});
return;
};
if (_consumableProperties[_arg1]){
_local3 = MochiDigits(_consumableProperties[_arg1]);
if (_local3.value == _arg2){
return;
};
_local3.value = _arg2;
} else {
_names.push(_arg1);
_consumableProperties[_arg1] = new MochiDigits(_arg2);
};
_syncID++;
}
private function itemOwned(_arg1:Object):void{
_storeSync[_arg1.id] = {properties:_arg1.properties, count:_arg1.count};
}
private function sync(_arg1:Event=null):void{
var _local3:String;
if (((_syncPending) || ((_syncID == _outstandingID)))){
return;
};
_outstandingID = _syncID;
var _local2:Object = {};
for (_local3 in _consumableProperties) {
_local2[_local3] = MochiDigits(_consumableProperties[_local3]).value;
};
MochiUserData.put(CONSUMER_KEY, _local2, putConsumableBag);
_syncPending = true;
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function nextName(_arg1:int):String{
return (_names[(_arg1 - 1)]);
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function deleteProperty(_arg1):Boolean{
if (!_consumableProperties[_arg1]){
return (false);
};
_names.splice(_names.indexOf(_arg1), 1);
delete _consumableProperties[_arg1];
return (true);
}
private function getConsumableBag(_arg1:MochiUserData):void{
var _local2:String;
var _local3:Number;
if (_arg1.error){
triggerEvent(ERROR, {type:IO_ERROR, error:_arg1.error});
return;
};
_consumableProperties = {};
_names = new Array();
if (_arg1.data){
for (_local2 in _arg1.data) {
_names.push(_local2);
_consumableProperties[_local2] = new MochiDigits(_arg1.data[_local2]);
};
};
for (_local2 in _storeSync) {
_local3 = _storeSync[_local2].count;
if (_consumableProperties[(_local2 + KEY_SALT)]){
_local3 = (_local3 - _consumableProperties[_local2]);
};
if (_local3 == 0){
} else {
newItems({id:_local2, count:_local3, properties:_storeSync[_local2].properties});
};
};
triggerEvent(READY, {});
}
private function loggedOut(_arg1:Object=null):void{
_consumableProperties = null;
}
public static function triggerEvent(_arg1:String, _arg2:Object):void{
_dispatcher.triggerEvent(_arg1, _arg2);
}
public static function removeEventListener(_arg1:String, _arg2:Function):void{
_dispatcher.removeEventListener(_arg1, _arg2);
}
public static function addEventListener(_arg1:String, _arg2:Function):void{
_dispatcher.addEventListener(_arg1, _arg2);
}
}
}//package mochi.as3
Section 102
//MochiScores (mochi.as3.MochiScores)
package mochi.as3 {
import flash.display.*;
import flash.text.*;
public class MochiScores {
private static var boardID:String;
public static var onErrorHandler:Object;
public static var onCloseHandler:Object;
public static function showLeaderboard(_arg1:Object=null):void{
var n:Number;
var options = _arg1;
if (options != null){
delete options.clip;
MochiServices.setContainer();
MochiServices.bringToTop();
if (options.name != null){
if ((options.name is TextField)){
if (options.name.text.length > 0){
options.name = options.name.text;
};
};
};
if (options.score != null){
if ((options.score is TextField)){
if (options.score.text.length > 0){
options.score = options.score.text;
};
} else {
if ((options.score is MochiDigits)){
options.score = options.score.value;
};
};
n = Number(options.score);
if (isNaN(n)){
trace((("ERROR: Submitted score '" + options.score) + "' will be rejected, score is 'Not a Number'"));
} else {
if ((((n == Number.NEGATIVE_INFINITY)) || ((n == Number.POSITIVE_INFINITY)))){
trace((("ERROR: Submitted score '" + options.score) + "' will be rejected, score is an infinite"));
} else {
if (Math.floor(n) != n){
trace((("WARNING: Submitted score '" + options.score) + "' will be truncated"));
};
options.score = n;
};
};
};
if (options.onDisplay != null){
options.onDisplay();
} else {
if (MochiServices.clip != null){
if ((MochiServices.clip is MovieClip)){
MochiServices.clip.stop();
} else {
trace("Warning: Container is not a MovieClip, cannot call default onDisplay.");
};
};
};
} else {
options = {};
if ((MochiServices.clip is MovieClip)){
MochiServices.clip.stop();
} else {
trace("Warning: Container is not a MovieClip, cannot call default onDisplay.");
};
};
if (options.onClose != null){
onCloseHandler = options.onClose;
} else {
onCloseHandler = function ():void{
if ((MochiServices.clip is MovieClip)){
MochiServices.clip.play();
} else {
trace("Warning: Container is not a MovieClip, cannot call default onClose.");
};
};
};
if (options.onError != null){
onErrorHandler = options.onError;
} else {
onErrorHandler = null;
};
if (options.boardID == null){
if (MochiScores.boardID != null){
options.boardID = MochiScores.boardID;
};
};
MochiServices.warnID(options.boardID, true);
trace("[MochiScores] NOTE: Security Sandbox Violation errors below are normal");
MochiServices.send("scores_showLeaderboard", {options:options}, null, onClose);
}
public static function closeLeaderboard():void{
MochiServices.send("scores_closeLeaderboard");
}
public static function getPlayerInfo(_arg1:Object, _arg2:Object=null):void{
MochiServices.send("scores_getPlayerInfo", null, _arg1, _arg2);
}
public static function requestList(_arg1:Object, _arg2:Object=null):void{
MochiServices.send("scores_requestList", null, _arg1, _arg2);
}
public static function scoresArrayToObjects(_arg1:Object):Object{
var _local3:Number;
var _local4:Number;
var _local5:Object;
var _local6:Object;
var _local7:String;
var _local8:String;
var _local2:Object = {};
for (_local7 in _arg1) {
if (typeof(_arg1[_local7]) == "object"){
if (((!((_arg1[_local7].cols == null))) && (!((_arg1[_local7].rows == null))))){
_local2[_local7] = [];
_local5 = _arg1[_local7];
_local4 = 0;
while (_local4 < _local5.rows.length) {
_local6 = {};
_local3 = 0;
while (_local3 < _local5.cols.length) {
_local6[_local5.cols[_local3]] = _local5.rows[_local4][_local3];
_local3++;
};
_local2[_local7].push(_local6);
_local4++;
};
} else {
_local2[_local7] = {};
for (_local8 in _arg1[_local7]) {
_local2[_local7][_local8] = _arg1[_local7][_local8];
};
};
} else {
_local2[_local7] = _arg1[_local7];
};
};
return (_local2);
}
public static function submit(_arg1:Number, _arg2:String, _arg3:Object=null, _arg4:Object=null):void{
_arg1 = Number(_arg1);
if (isNaN(_arg1)){
trace((("ERROR: Submitted score '" + String(_arg1)) + "' will be rejected, score is 'Not a Number'"));
} else {
if ((((_arg1 == Number.NEGATIVE_INFINITY)) || ((_arg1 == Number.POSITIVE_INFINITY)))){
trace((("ERROR: Submitted score '" + String(_arg1)) + "' will be rejected, score is an infinite"));
} else {
if (Math.floor(_arg1) != _arg1){
trace((("WARNING: Submitted score '" + String(_arg1)) + "' will be truncated"));
};
_arg1 = Number(_arg1);
};
};
MochiServices.send("scores_submit", {score:_arg1, name:_arg2}, _arg3, _arg4);
}
public static function onClose(_arg1:Object=null):void{
if (((((_arg1) && ((_arg1.error == true)))) && (onErrorHandler))){
if (_arg1.errorCode == null){
_arg1.errorCode = "IOError";
};
onErrorHandler(_arg1.errorCode);
MochiServices.doClose();
return;
};
onCloseHandler();
MochiServices.doClose();
}
public static function setBoardID(_arg1:String):void{
MochiServices.warnID(_arg1, true);
MochiScores.boardID = _arg1;
MochiServices.send("scores_setBoardID", {boardID:_arg1});
}
}
}//package mochi.as3
Section 103
//MochiServices (mochi.as3.MochiServices)
package mochi.as3 {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.net.*;
import flash.system.*;
import flash.geom.*;
public class MochiServices {
private static var _container:Object;
private static var _connected:Boolean = false;
private static var _swfVersion:String;
private static var _preserved:Object;
public static var netupAttempted:Boolean = false;
private static var _sendChannel:LocalConnection;
public static var servicesSync:MochiSync = new MochiSync();
private static var _clip:MovieClip;
private static var _id:String;
private static var _services:String = "services.swf";
private static var _servURL:String = "http://www.mochiads.com/static/lib/services/";
public static var widget:Boolean = false;
private static var _timer:Timer;
private static var _sendChannelName:String;
private static var _loader:Loader;
private static var _connecting:Boolean = false;
private static var _mochiLocalConnection:MovieClip;
private static var _listenChannelName:String = "__ms_";
public static var onError:Object;
public static var netup:Boolean = true;
private static var _mochiLC:String = "MochiLC.swf";
public static function isNetworkAvailable():Boolean{
return (!((Security.sandboxType == "localWithFile")));
}
public static function get connected():Boolean{
return (_connected);
}
private static function onReceive(_arg1:Object):void{
var methodName:String;
var pkg = _arg1;
var cb:String = pkg.callbackID;
var cblst:Object = _clip._callbacks[cb];
if (!cblst){
return;
};
var method:* = cblst.callbackMethod;
methodName = "";
var obj:Object = cblst.callbackObject;
if (((obj) && ((typeof(method) == "string")))){
methodName = method;
if (obj[method] != null){
method = obj[method];
} else {
trace((("Error: Method " + method) + " does not exist."));
};
};
if (method != undefined){
try {
method.apply(obj, pkg.args);
} catch(error:Error) {
trace(((("Error invoking callback method '" + methodName) + "': ") + error.toString()));
};
} else {
if (obj != null){
try {
obj(pkg.args);
} catch(error:Error) {
trace(("Error invoking method on object: " + error.toString()));
};
};
};
delete _clip._callbacks[cb];
}
public static function get childClip():Object{
return (_clip);
}
public static function send(_arg1:String, _arg2:Object=null, _arg3:Object=null, _arg4:Object=null):void{
if (_connected){
_mochiLocalConnection.send(_sendChannelName, "onReceive", {methodName:_arg1, args:_arg2, callbackID:_clip._nextcallbackID});
} else {
if ((((_clip == null)) || (!(_connecting)))){
trace(("Error: MochiServices not connected. Please call MochiServices.connect(). Function: " + _arg1));
handleError(_arg2, _arg3, _arg4);
flush(true);
return;
};
_clip._queue.push({methodName:_arg1, args:_arg2, callbackID:_clip._nextcallbackID});
};
if (_clip != null){
if (((!((_clip._callbacks == null))) && (!((_clip._nextcallbackID == null))))){
_clip._callbacks[_clip._nextcallbackID] = {callbackObject:_arg3, callbackMethod:_arg4};
_clip._nextcallbackID++;
};
};
}
private static function init(_arg1:String, _arg2:Object):void{
_id = _arg1;
if (_arg2 != null){
_container = _arg2;
loadCommunicator(_arg1, _container);
};
}
private static function clickMovie(_arg1:String, _arg2:Function):MovieClip{
var _local4:int;
var _local14:Loader;
var _local3:Array = [150, 21, 0, 7, 1, 0, 0, 0, 0, 98, 116, 110, 0, 7, 2, 0, 0, 0, 0, 116, 104, 105, 115, 0, 28, 150, 22, 0, 0, 99, 114, 101, 97, 116, 101, 69, 109, 112, 116, 121, 77, 111, 118, 105, 101, 67, 108, 105, 112, 0, 82, 135, 1, 0, 0, 23, 150, 13, 0, 4, 0, 0, 111, 110, 82, 101, 108, 101, 97, 115, 101, 0, 142, 8, 0, 0, 0, 0, 2, 42, 0, 114, 0, 150, 17, 0, 0, 32, 0, 7, 1, 0, 0, 0, 8, 0, 0, 115, 112, 108, 105, 116, 0, 82, 135, 1, 0, 1, 23, 150, 7, 0, 4, 1, 7, 0, 0, 0, 0, 78, 150, 8, 0, 0, 95, 98, 108, 97, 110, 107, 0, 154, 1, 0, 0, 150, 7, 0, 0, 99, 108, 105, 99, 107, 0, 150, 7, 0, 4, 1, 7, 1, 0, 0, 0, 78, 150, 27, 0, 7, 2, 0, 0, 0, 7, 0, 0, 0, 0, 0, 76, 111, 99, 97, 108, 67, 111, 110, 110, 101, 99, 116, 105, 111, 110, 0, 64, 150, 6, 0, 0, 115, 101, 110, 100, 0, 82, 79, 150, 15, 0, 4, 0, 0, 95, 97, 108, 112, 104, 97, 0, 7, 0, 0, 0, 0, 79, 150, 23, 0, 7, 0xFF, 0, 0xFF, 0, 7, 1, 0, 0, 0, 4, 0, 0, 98, 101, 103, 105, 110, 70, 105, 108, 108, 0, 82, 23, 150, 25, 0, 7, 0, 0, 0, 0, 7, 0, 0, 0, 0, 7, 2, 0, 0, 0, 4, 0, 0, 109, 111, 118, 101, 84, 111, 0, 82, 23, 150, 25, 0, 7, 100, 0, 0, 0, 7, 0, 0, 0, 0, 7, 2, 0, 0, 0, 4, 0, 0, 108, 105, 110, 101, 84, 111, 0, 82, 23, 150, 25, 0, 7, 100, 0, 0, 0, 7, 100, 0, 0, 0, 7, 2, 0, 0, 0, 4, 0, 0, 108, 105, 110, 101, 84, 111, 0, 82, 23, 150, 25, 0, 7, 0, 0, 0, 0, 7, 100, 0, 0, 0, 7, 2, 0, 0, 0, 4, 0, 0, 108, 105, 110, 101, 84, 111, 0, 82, 23, 150, 25, 0, 7, 0, 0, 0, 0, 7, 0, 0, 0, 0, 7, 2, 0, 0, 0, 4, 0, 0, 108, 105, 110, 101, 84, 111, 0, 82, 23, 150, 16, 0, 7, 0, 0, 0, 0, 4, 0, 0, 101, 110, 100, 70, 105, 108, 108, 0, 82, 23];
var _local5:Array = [104, 0, 31, 64, 0, 7, 208, 0, 0, 12, 1, 0, 67, 2, 0xFF, 0xFF, 0xFF, 63, 3];
var _local6:Array = [0, 64, 0, 0, 0];
var _local7:MovieClip = new MovieClip();
var _local8:LocalConnection = new LocalConnection();
var _local9:String = ((("_click_" + Math.floor((Math.random() * 999999))) + "_") + Math.floor(new Date().time));
_local8 = new LocalConnection();
_local7.lc = _local8;
_local7.click = _arg2;
_local8.client = _local7;
_local8.connect(_local9);
var _local10:ByteArray = new ByteArray();
var _local11:ByteArray = new ByteArray();
_local11.endian = Endian.LITTLE_ENDIAN;
_local11.writeShort(1);
_local11.writeUTFBytes(((_arg1 + " ") + _local9));
_local11.writeByte(0);
var _local12:uint = ((_local3.length + _local11.length) + 4);
var _local13:uint = (_local12 + 35);
_local10.endian = Endian.LITTLE_ENDIAN;
_local10.writeUTFBytes("FWS");
_local10.writeByte(8);
_local10.writeUnsignedInt(_local13);
for each (_local4 in _local5) {
_local10.writeByte(_local4);
};
_local10.writeUnsignedInt(_local12);
_local10.writeByte(136);
_local10.writeShort(_local11.length);
_local10.writeBytes(_local11);
for each (_local4 in _local3) {
_local10.writeByte(_local4);
};
for each (_local4 in _local6) {
_local10.writeByte(_local4);
};
_local14 = new Loader();
_local14.loadBytes(_local10);
_local7.addChild(_local14);
return (_local7);
}
public static function stayOnTop():void{
_container.addEventListener(Event.ENTER_FRAME, MochiServices.bringToTop, false, 0, true);
if (_clip != null){
_clip.visible = true;
};
}
public static function addLinkEvent(_arg1:String, _arg2:String, _arg3:DisplayObjectContainer, _arg4:Function=null):void{
var avm1Click:DisplayObject;
var x:String;
var req:URLRequest;
var loader:Loader;
var setURL:Function;
var err:Function;
var complete:Function;
var url = _arg1;
var burl = _arg2;
var btn = _arg3;
var onClick = _arg4;
var vars:Object = new Object();
vars["mav"] = getVersion();
vars["swfv"] = "9";
vars["swfurl"] = btn.loaderInfo.loaderURL;
vars["fv"] = Capabilities.version;
vars["os"] = Capabilities.os;
vars["lang"] = Capabilities.language;
vars["scres"] = ((Capabilities.screenResolutionX + "x") + Capabilities.screenResolutionY);
var s = "?";
var i:Number = 0;
for (x in vars) {
if (i != 0){
s = (s + "&");
};
i = (i + 1);
s = (((s + x) + "=") + escape(vars[x]));
};
req = new URLRequest("http://x.mochiads.com/linkping.swf");
loader = new Loader();
setURL = function (_arg1:String):void{
if (avm1Click){
btn.removeChild(avm1Click);
};
avm1Click = clickMovie(_arg1, onClick);
var _local2:Rectangle = btn.getBounds(btn);
btn.addChild(avm1Click);
avm1Click.x = _local2.x;
avm1Click.y = _local2.y;
avm1Click.scaleX = (0.01 * _local2.width);
avm1Click.scaleY = (0.01 * _local2.height);
};
err = function (_arg1:Object):void{
netup = false;
_arg1.target.removeEventListener(_arg1.type, arguments.callee);
setURL(burl);
};
complete = function (_arg1:Object):void{
_arg1.target.removeEventListener(_arg1.type, arguments.callee);
};
if (netup){
setURL((url + s));
} else {
setURL(burl);
};
if (!((netupAttempted) || (_connected))){
netupAttempted = true;
loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, err);
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, complete);
loader.load(req);
};
}
public static function warnID(_arg1:String, _arg2:Boolean):void{
_arg1 = _arg1.toLowerCase();
if (_arg1.length != 16){
trace((("WARNING: " + (_arg2) ? "board" : "game") + " ID is not the appropriate length"));
return;
} else {
if (_arg1 == "1e113c7239048b3f"){
if (_arg2){
trace("WARNING: Using testing board ID");
} else {
trace("WARNING: Using testing board ID as game ID");
};
return;
} else {
if (_arg1 == "84993a1de4031cd8"){
if (_arg2){
trace("WARNING: Using testing game ID as board ID");
} else {
trace("WARNING: Using testing game ID");
};
return;
};
};
};
var _local3:Number = 0;
while (_local3 < _arg1.length) {
switch (_arg1.charAt(_local3)){
case "0":
case "1":
case "2":
case "3":
case "4":
case "5":
case "6":
case "7":
case "8":
case "9":
case "a":
case "b":
case "c":
case "d":
case "e":
case "f":
break;
default:
trace(("WARNING: Board ID contains illegal characters: " + _arg1));
return;
};
_local3++;
};
}
public static function disconnect():void{
if (((_connected) || (_connecting))){
if (_clip != null){
if (_clip.parent != null){
if ((_clip.parent is Sprite)){
Sprite(_clip.parent).removeChild(_clip);
_clip = null;
};
};
};
_connecting = (_connected = false);
flush(true);
try {
_mochiLocalConnection.close();
} catch(error:Error) {
};
};
if (_timer != null){
try {
_timer.stop();
} catch(error:Error) {
};
};
}
public static function allowDomains(_arg1:String):String{
var _local2:String;
if (Security.sandboxType != "application"){
Security.allowDomain("*");
Security.allowInsecureDomain("*");
};
if (_arg1.indexOf("http://") != -1){
_local2 = _arg1.split("/")[2].split(":")[0];
if (Security.sandboxType != "application"){
Security.allowDomain(_local2);
Security.allowInsecureDomain(_local2);
};
};
return (_local2);
}
public static function getVersion():String{
return ("3.7 as3");
}
public static function doClose():void{
_container.removeEventListener(Event.ENTER_FRAME, MochiServices.bringToTop);
}
private static function flush(_arg1:Boolean):void{
var _local2:Object;
var _local3:Object;
if (((_clip) && (_clip._queue))){
while (_clip._queue.length > 0) {
_local2 = _clip._queue.shift();
_local3 = null;
if (_local2 != null){
if (_local2.callbackID != null){
_local3 = _clip._callbacks[_local2.callbackID];
};
delete _clip._callbacks[_local2.callbackID];
if (((_arg1) && (!((_local3 == null))))){
handleError(_local2.args, _local3.callbackObject, _local3.callbackMethod);
};
};
};
};
}
public static function get id():String{
return (_id);
}
private static function onEvent(_arg1:Object):void{
var _local2:String = _arg1.target;
var _local3:String = _arg1.event;
switch (_local2){
case "events":
MochiEvents.triggerEvent(_arg1.event, _arg1.args);
break;
case "coins":
MochiCoins.triggerEvent(_arg1.event, _arg1.args);
break;
case "sync":
servicesSync.triggerEvent(_arg1.event, _arg1.args);
break;
};
}
private static function urlOptions(_arg1:Object):Object{
var _local3:String;
var _local4:Array;
var _local5:Number;
var _local6:Array;
var _local2:Object = {};
if (_arg1.stage){
_local3 = _arg1.stage.loaderInfo.parameters.mochiad_options;
} else {
_local3 = _arg1.loaderInfo.parameters.mochiad_options;
};
if (_local3){
_local4 = _local3.split("&");
_local5 = 0;
while (_local5 < _local4.length) {
_local6 = _local4[_local5].split("=");
_local2[unescape(_local6[0])] = unescape(_local6[1]);
_local5++;
};
};
return (_local2);
}
public static function setContainer(_arg1:Object=null, _arg2:Boolean=true):void{
if (_arg1 != null){
if ((_arg1 is Sprite)){
_container = _arg1;
};
};
if (_arg2){
if ((_container is Sprite)){
Sprite(_container).addChild(_clip);
};
};
}
private static function handleError(_arg1:Object, _arg2:Object, _arg3:Object):void{
var args = _arg1;
var callbackObject = _arg2;
var callbackMethod = _arg3;
if (args != null){
if (args.onError != null){
args.onError.apply(null, ["NotConnected"]);
};
if (((!((args.options == null))) && (!((args.options.onError == null))))){
args.options.onError.apply(null, ["NotConnected"]);
};
};
if (callbackMethod != null){
args = {};
args.error = true;
args.errorCode = "NotConnected";
if (((!((callbackObject == null))) && ((callbackMethod is String)))){
try {
var _local5 = callbackObject;
_local5[callbackMethod](args);
} catch(error:Error) {
};
} else {
if (callbackMethod != null){
try {
callbackMethod.apply(args);
} catch(error:Error) {
};
};
};
};
}
private static function loadError(_arg1:Object):void{
_clip._mochiad_ctr_failed = true;
trace("MochiServices could not load.");
MochiServices.disconnect();
MochiServices.onError("IOError");
}
private static function initComChannels():void{
if (!_connected){
trace("[SERVICES_API] connected!");
_connecting = false;
_connected = true;
_mochiLocalConnection.send(_sendChannelName, "onReceive", {methodName:"handshakeDone"});
_mochiLocalConnection.send(_sendChannelName, "onReceive", {methodName:"registerGame", preserved:_preserved, id:_id, version:getVersion(), parentURL:_container.loaderInfo.loaderURL});
_clip.onReceive = onReceive;
_clip.onEvent = onEvent;
_clip.onError = function ():void{
MochiServices.onError("IOError");
};
while (_clip._queue.length > 0) {
_mochiLocalConnection.send(_sendChannelName, "onReceive", _clip._queue.shift());
};
};
}
private static function loadLCBridge(_arg1:Object):void{
var loader:Loader;
var clip = _arg1;
loader = new Loader();
var mochiLCURL:String = (_servURL + _mochiLC);
var req:URLRequest = new URLRequest(mochiLCURL);
var complete:Function = function (_arg1:Object):void{
_mochiLocalConnection = MovieClip(loader.content);
listen();
};
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, complete);
loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, loadError);
loader.load(req);
clip.addChild(loader);
}
private static function listen():void{
_mochiLocalConnection.connect(_listenChannelName);
_clip.handshake = function (_arg1:Object):void{
MochiServices.comChannelName = _arg1.newChannel;
};
trace("Waiting for MochiAds services to connect...");
}
public static function get clip():Object{
return (_container);
}
public static function set comChannelName(_arg1:String):void{
if (_arg1 != null){
if (_arg1.length > 3){
_sendChannelName = (_arg1 + "_fromgame");
initComChannels();
};
};
}
private static function loadCommunicator(_arg1:String, _arg2:Object):MovieClip{
var _local3:String = ("_mochiservices_com_" + _arg1);
if (_clip != null){
return (_clip);
};
if (!MochiServices.isNetworkAvailable()){
return (null);
};
if (urlOptions(_arg2).servURL){
_servURL = urlOptions(_arg2).servURL;
};
var _local4:String = (_servURL + _services);
if (urlOptions(_arg2).servicesURL){
_local4 = urlOptions(_arg2).servicesURL;
};
_listenChannelName = (_listenChannelName + ((Math.floor(new Date().time) + "_") + Math.floor((Math.random() * 99999))));
MochiServices.allowDomains(_local4);
_clip = createEmptyMovieClip(_arg2, _local3, 10336, false);
loadLCBridge(_clip);
_loader = new Loader();
_loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, loadError);
var _local5:URLRequest = new URLRequest(_local4);
var _local6:URLVariables = new URLVariables();
_local6.listenLC = _listenChannelName;
_local6.mochiad_options = _arg2.loaderInfo.parameters.mochiad_options;
_local6.api_version = getVersion();
if (widget){
_local6.widget = true;
};
_local5.data = _local6;
_loader.load(_local5);
_clip.addChild(_loader);
_clip._mochiservices_com = _loader;
_sendChannel = new LocalConnection();
_clip._queue = [];
_clip._nextcallbackID = 0;
_clip._callbacks = {};
_timer = new Timer(10000, 1);
_timer.addEventListener(TimerEvent.TIMER, connectWait);
_timer.start();
return (_clip);
}
public static function connect(_arg1:String, _arg2:Object, _arg3:Object=null):void{
var id = _arg1;
var clip = _arg2;
var onError = _arg3;
warnID(id, false);
if ((clip is DisplayObject)){
if (clip.stage == null){
trace("MochiServices connect requires the containing clip be attached to the stage");
};
if (((!(_connected)) && ((_clip == null)))){
trace("MochiServices Connecting...");
_connecting = true;
init(id, clip);
};
} else {
trace("Error, MochiServices requires a Sprite, Movieclip or instance of the stage.");
};
if (onError != null){
MochiServices.onError = onError;
} else {
if (MochiServices.onError == null){
MochiServices.onError = function (_arg1:String):void{
trace(_arg1);
};
};
};
}
public static function createEmptyMovieClip(_arg1:Object, _arg2:String, _arg3:Number, _arg4:Boolean=true):MovieClip{
var parent = _arg1;
var name = _arg2;
var depth = _arg3;
var doAdd = _arg4;
var mc:MovieClip = new MovieClip();
if (doAdd){
if (((false) && (depth))){
parent.addChildAt(mc, depth);
} else {
parent.addChild(mc);
};
};
try {
parent[name] = mc;
} catch(e:Error) {
throw (new Error("MochiServices requires a clip that is an instance of a dynamic class. If your class extends Sprite or MovieClip, you must make it dynamic."));
};
mc["_name"] = name;
return (mc);
}
public static function bringToTop(_arg1:Event=null):void{
var e = _arg1;
if (((!((MochiServices.clip == null))) && (!((MochiServices.childClip == null))))){
try {
if (MochiServices.clip.numChildren > 1){
MochiServices.clip.setChildIndex(MochiServices.childClip, (MochiServices.clip.numChildren - 1));
};
} catch(errorObject:Error) {
trace("Warning: Depth sort error.");
_container.removeEventListener(Event.ENTER_FRAME, MochiServices.bringToTop);
};
};
}
public static function connectWait(_arg1:TimerEvent):void{
if (!_connected){
_clip._mochiad_ctr_failed = true;
trace("MochiServices could not load. (timeout)");
MochiServices.disconnect();
MochiServices.onError("IOError");
};
}
}
}//package mochi.as3
Section 104
//MochiSocial (mochi.as3.MochiSocial)
package mochi.as3 {
public class MochiSocial {
public static const LOGGED_IN:String = "LoggedIn";
public static const PROFILE_HIDE:String = "ProfileHide";
public static const NO_USER:String = "NoUser";
public static const PROPERTIES_SIZE:String = "PropertiesSize";
public static const IO_ERROR:String = "IOError";
public static const PROPERTIES_SAVED:String = "PropertySaved";
public static const WIDGET_LOADED:String = "WidgetLoaded";
public static const USER_INFO:String = "UserInfo";
public static const ERROR:String = "Error";
public static const LOGIN_SHOW:String = "LoginShow";
public static const LOGGED_OUT:String = "LoggedOut";
public static const PROFILE_SHOW:String = "ProfileShow";
public static const LOGIN_SHOWN:String = "LoginShown";
public static const LOGIN_HIDE:String = "LoginHide";
private static var _dispatcher:MochiEventDispatcher = new MochiEventDispatcher();
public static var _user_info:Object = null;
public static function getVersion():String{
return (MochiServices.getVersion());
}
public static function saveUserProperties(_arg1:Object):void{
MochiServices.send("coins_saveUserProperties", _arg1);
}
public static function get loggedIn():Boolean{
return (!((_user_info == null)));
}
public static function triggerEvent(_arg1:String, _arg2:Object):void{
_dispatcher.triggerEvent(_arg1, _arg2);
}
public static function addEventListener(_arg1:String, _arg2:Function):void{
_dispatcher.addEventListener(_arg1, _arg2);
}
public static function getUserInfo():void{
MochiServices.send("coins_getUserInfo");
}
public static function showLoginWidget(_arg1:Object=null):void{
MochiServices.setContainer();
MochiServices.bringToTop();
MochiServices.send("coins_showLoginWidget", {options:_arg1});
}
public static function removeEventListener(_arg1:String, _arg2:Function):void{
_dispatcher.removeEventListener(_arg1, _arg2);
}
public static function requestLogin():void{
MochiServices.send("coins_requestLogin");
}
public static function getAPIURL():String{
if (!_user_info){
return (null);
};
return (_user_info.api_url);
}
public static function hideLoginWidget():void{
MochiServices.send("coins_hideLoginWidget");
}
public static function getAPIToken():String{
if (!_user_info){
return (null);
};
return (_user_info.api_token);
}
MochiSocial.addEventListener(MochiSocial.LOGGED_IN, function (_arg1:Object):void{
_user_info = _arg1;
});
MochiSocial.addEventListener(MochiSocial.LOGGED_OUT, function (_arg1:Object):void{
_user_info = null;
});
}
}//package mochi.as3
Section 105
//MochiSync (mochi.as3.MochiSync)
package mochi.as3 {
import flash.utils.*;
public dynamic class MochiSync extends Proxy {
private var _syncContainer:Object;
public static var SYNC_PROPERTY:String = "UpdateProperty";
public static var SYNC_REQUEST:String = "SyncRequest";
public function MochiSync():void{
_syncContainer = {};
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function setProperty(_arg1, _arg2):void{
if (_syncContainer[_arg1] == _arg2){
return;
};
var _local3:String = _arg1.toString();
_syncContainer[_local3] = _arg2;
MochiServices.send("sync_propUpdate", {name:_local3, value:_arg2});
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function getProperty(_arg1){
return (_syncContainer[_arg1]);
}
public function triggerEvent(_arg1:String, _arg2:Object):void{
switch (_arg1){
case SYNC_REQUEST:
MochiServices.send("sync_syncronize", _syncContainer);
break;
case SYNC_PROPERTY:
_syncContainer[_arg2.name] = _arg2.value;
break;
};
}
}
}//package mochi.as3
Section 106
//MochiUserData (mochi.as3.MochiUserData)
package mochi.as3 {
import flash.events.*;
import flash.utils.*;
import flash.net.*;
public class MochiUserData extends EventDispatcher {
public var callback:Function;// = null
public var operation:String;// = null
public var error:Event;// = null
public var data;// = null
public var _loader:URLLoader;
public var key:String;// = null
public function MochiUserData(_arg1:String="", _arg2:Function=null){
this.key = _arg1;
this.callback = _arg2;
}
public function serialize(_arg1):ByteArray{
var _local2:ByteArray = new ByteArray();
_local2.objectEncoding = ObjectEncoding.AMF3;
_local2.writeObject(_arg1);
_local2.compress();
return (_local2);
}
public function errorHandler(_arg1:IOErrorEvent):void{
data = null;
error = _arg1;
if (callback != null){
performCallback();
} else {
dispatchEvent(_arg1);
};
close();
}
public function putEvent(_arg1):void{
request("put", serialize(_arg1));
}
public function deserialize(_arg1:ByteArray){
_arg1.objectEncoding = ObjectEncoding.AMF3;
_arg1.uncompress();
return (_arg1.readObject());
}
public function securityErrorHandler(_arg1:SecurityErrorEvent):void{
errorHandler(new IOErrorEvent(IOErrorEvent.IO_ERROR, false, false, ("security error: " + _arg1.toString())));
}
public function getEvent():void{
request("get", serialize(null));
}
override public function toString():String{
return ((((((((("[MochiUserData operation=" + operation) + " key=\"") + key) + "\" data=") + data) + " error=\"") + error) + "\"]"));
}
public function performCallback():void{
try {
callback(this);
} catch(e:Error) {
trace(("[MochiUserData] exception during callback: " + e));
};
}
public function request(_arg1:String, _arg2:ByteArray):void{
var _operation = _arg1;
var _data = _arg2;
operation = _operation;
var api_url:String = MochiSocial.getAPIURL();
var api_token:String = MochiSocial.getAPIToken();
if ((((api_url == null)) || ((api_token == null)))){
errorHandler(new IOErrorEvent(IOErrorEvent.IO_ERROR, false, false, "not logged in"));
return;
};
_loader = new URLLoader();
var args:URLVariables = new URLVariables();
args.op = _operation;
args.key = key;
var req:URLRequest = new URLRequest((((MochiSocial.getAPIURL() + "/") + "MochiUserData?") + args.toString()));
req.method = URLRequestMethod.POST;
req.contentType = "application/x-mochi-userdata";
req.requestHeaders = [new URLRequestHeader("x-mochi-services-version", MochiServices.getVersion()), new URLRequestHeader("x-mochi-api-token", api_token)];
req.data = _data;
_loader.dataFormat = URLLoaderDataFormat.BINARY;
_loader.addEventListener(Event.COMPLETE, completeHandler);
_loader.addEventListener(IOErrorEvent.IO_ERROR, errorHandler);
_loader.addEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler);
try {
_loader.load(req);
} catch(e:SecurityError) {
errorHandler(new IOErrorEvent(IOErrorEvent.IO_ERROR, false, false, ("security error: " + e.toString())));
};
}
public function completeHandler(_arg1:Event):void{
var event = _arg1;
try {
if (_loader.data.length){
data = deserialize(_loader.data);
} else {
data = null;
};
} catch(e:Error) {
errorHandler(new IOErrorEvent(IOErrorEvent.IO_ERROR, false, false, ("deserialize error: " + e.toString())));
return;
};
if (callback != null){
performCallback();
} else {
dispatchEvent(event);
};
close();
}
public function close():void{
if (_loader){
_loader.removeEventListener(Event.COMPLETE, completeHandler);
_loader.removeEventListener(IOErrorEvent.IO_ERROR, errorHandler);
_loader.removeEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler);
_loader.close();
_loader = null;
};
error = null;
callback = null;
}
public static function get(_arg1:String, _arg2:Function):void{
var _local3:MochiUserData = new MochiUserData(_arg1, _arg2);
_local3.getEvent();
}
public static function put(_arg1:String, _arg2, _arg3:Function):void{
var _local4:MochiUserData = new MochiUserData(_arg1, _arg3);
_local4.putEvent(_arg2);
}
}
}//package mochi.as3
Section 107
//ball_155 (Pirates_mochi_fla.ball_155)
package Pirates_mochi_fla {
import flash.display.*;
public dynamic class ball_155 extends MovieClip {
public function ball_155(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package Pirates_mochi_fla
Section 108
//EnterNewName_96 (Pirates_mochi_fla.EnterNewName_96)
package Pirates_mochi_fla {
import flash.geom.*;
import flash.display.*;
import flash.events.*;
import flash.media.*;
import flash.net.*;
import flash.text.*;
import flash.system.*;
import flash.ui.*;
import flash.filters.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.utils.*;
import flash.xml.*;
public dynamic class EnterNewName_96 extends MovieClip {
public var cnt:MovieClip;
public function EnterNewName_96(){
addFrameScript(18, frame19);
}
function frame19(){
stop();
stage.focus = cnt.input;
}
}
}//package Pirates_mochi_fla
Section 109
//link_btn_19 (Pirates_mochi_fla.link_btn_19)
package Pirates_mochi_fla {
import flash.display.*;
import mochi.as3.*;
public dynamic class link_btn_19 extends MovieClip {
public function link_btn_19(){
addFrameScript(0, frame1);
}
function frame1(){
this.useHandCursor = true;
this.buttonMode = true;
MochiServices.addLinkEvent("http://x.mochiads.com/link/d98d139786e07145", "http://www.playgamesclub.com/", this);
}
}
}//package Pirates_mochi_fla
Section 110
//LinkMoreButton_21 (Pirates_mochi_fla.LinkMoreButton_21)
package Pirates_mochi_fla {
import flash.display.*;
import mochi.as3.*;
public dynamic class LinkMoreButton_21 extends MovieClip {
public function LinkMoreButton_21(){
addFrameScript(0, frame1);
}
function frame1(){
this.useHandCursor = true;
this.buttonMode = true;
MochiServices.addLinkEvent("http://x.mochiads.com/link/aa966407d5f55858", "http://www.playgamesclub.com/", this);
}
}
}//package Pirates_mochi_fla
Section 111
//LinkPirateButton_20 (Pirates_mochi_fla.LinkPirateButton_20)
package Pirates_mochi_fla {
import flash.display.*;
import mochi.as3.*;
public dynamic class LinkPirateButton_20 extends MovieClip {
public function LinkPirateButton_20(){
addFrameScript(0, frame1);
}
function frame1(){
this.useHandCursor = true;
this.buttonMode = true;
MochiServices.addLinkEvent("http://x.mochiads.com/link/a64d7a41b1a58933", "http://www.defenseonlinegames.com/category/labels/pirate", this);
}
}
}//package Pirates_mochi_fla
Section 112
//Pirat_54 (Pirates_mochi_fla.Pirat_54)
package Pirates_mochi_fla {
import flash.display.*;
public dynamic class Pirat_54 extends MovieClip {
public function Pirat_54(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package Pirates_mochi_fla
Section 113
//repairShipBtn_147 (Pirates_mochi_fla.repairShipBtn_147)
package Pirates_mochi_fla {
import flash.display.*;
import flash.text.*;
public dynamic class repairShipBtn_147 extends MovieClip {
public var caption:TextField;
public function repairShipBtn_147(){
addFrameScript(10, frame11);
}
function frame11(){
trace("here");
}
}
}//package Pirates_mochi_fla
Section 114
//ShootClip_36 (Pirates_mochi_fla.ShootClip_36)
package Pirates_mochi_fla {
import flash.display.*;
public dynamic class ShootClip_36 extends MovieClip {
public function ShootClip_36(){
addFrameScript(20, frame21);
}
function frame21(){
visible = false;
}
}
}//package Pirates_mochi_fla
Section 115
//YourShootClip_63 (Pirates_mochi_fla.YourShootClip_63)
package Pirates_mochi_fla {
import flash.display.*;
public dynamic class YourShootClip_63 extends MovieClip {
public function YourShootClip_63(){
addFrameScript(24, frame25);
}
function frame25(){
visible = false;
stop();
}
}
}//package Pirates_mochi_fla
Section 116
//EmbedClip (preloader.EmbedClip)
package preloader {
import flash.display.*;
public class EmbedClip extends MovieClip {
public function EmbedClip(){
stop();
}
}
}//package preloader
Section 117
//Main (preloader.Main)
package preloader {
import flash.display.*;
import flash.events.*;
import flash.net.*;
import flash.text.*;
import flash.system.*;
public dynamic class Main extends MovieClip {
public var link:MovieClip;
public var fps:TextField;
private var mochi_cont:MochiContainer;
public var mch:MochiContainer;
public var _mochiads_game_id:String;
private var is_loaded:Boolean;// = false
public static const ENTRY_FRAME:Number = 3;
public static const DOCUMENT_CLASS:String = "Pirates";
public function Main(){
addFrameScript(0, frame1);
super();
is_loaded = false;
Security.allowDomain("*");
stage.scaleMode = StageScaleMode.NO_SCALE;
stop();
loaderInfo.addEventListener(ProgressEvent.PROGRESS, progressHandler);
loaderInfo.addEventListener(Event.COMPLETE, completeHandler);
mochi_cont = (this.getChildByName("mch") as MochiContainer);
mochi_cont.addEventListener("mochi_pre_game_ad_ready", preGameAdReadyHandler);
}
private function main():void{
var _local1:Class = (loaderInfo.applicationDomain.getDefinition(_slot1.DOCUMENT_CLASS) as Class);
var _local2:Sprite = (new (_local1) as Sprite);
addChild(_local2);
if (mochi_cont){
this.addChild(mochi_cont);
};
}
public function clickHandler(_arg1:MouseEvent):void{
navigateToURL(new URLRequest("http://phobos.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=343155686&mt=8"), "_blank");
}
function frame1(){
_mochiads_game_id = "845dd78fe249b70b";
stage.tabChildren = false;
link.addEventListener(MouseEvent.CLICK, clickHandler);
link.buttonMode = true;
link.useHandCursor = true;
}
private function completeHandler(_arg1:Event):void{
is_loaded = true;
trace("load completed , mochi = ", mochi_cont.preGameAdCompleted);
if (mochi_cont.preGameAdCompleted){
play();
};
addEventListener(Event.ENTER_FRAME, enterFrameHandler);
}
private function enterFrameHandler(_arg1:Event):void{
if (mochi_cont.preGameAdCompleted){
if (currentFrame >= _slot1.ENTRY_FRAME){
removeEventListener(Event.ENTER_FRAME, enterFrameHandler);
stop();
main();
};
};
}
private function progressHandler(_arg1:ProgressEvent):void{
}
private function preGameAdReadyHandler(_arg1:Event):void{
trace(("event handled " + is_loaded));
if (is_loaded){
play();
};
mochi_cont.removeEventListener("mochi_pre_game_ad_ready", preGameAdReadyHandler);
}
}
}//package preloader
Section 118
//MochiContainer (preloader.MochiContainer)
package preloader {
import flash.display.*;
import flash.events.*;
import mochi.as3.*;
public dynamic class MochiContainer extends MovieClip {
private var is_in_board:Boolean;// = false
private var waiting_pre_game_ad:Boolean;// = false
private var waiting_inter_level_ad:Boolean;// = false
private var pre_game_ad_ready:Boolean;// = false
private static var intance:MochiContainer;
public function MochiContainer(){
MochiServices.connect("845dd78fe249b70b", this);
waiting_pre_game_ad = true;
MochiAd.showPreGameAd({clip:this, id:"845dd78fe249b70b", res:"640x426"});
intance = this;
}
public function showLeaderboard():void{
is_in_board = true;
var _local1:String = getBoardID();
MochiScores.showLeaderboard({boardID:_local1, res:"640x426", width:640, height:426});
}
public function showInterLevelAd():void{
waiting_inter_level_ad = true;
MochiAd.showInterLevelAd({clip:MochiContainer.getInstance(), id:"845dd78fe249b70b", res:"640x426"});
}
public function get preGameAdCompleted():Boolean{
return (pre_game_ad_ready);
}
public function get isInLeaderBoard():Boolean{
return (is_in_board);
}
private function getBoardID():String{
var o:Object = {n:[5, 12, 8, 15, 0, 1, 11, 7, 9, 5, 12, 0, 2, 11, 10, 10], f:function (_arg1:Number, _arg2:String):String{
if (_arg2.length == 16){
return (_arg2);
};
return (this.f((_arg1 + 1), (_arg2 + this.n[_arg1].toString(16))));
}};
var boardID:String = o.f(0, "");
return (boardID);
}
override public function play():void{
if (waiting_pre_game_ad){
pre_game_ad_ready = true;
waiting_pre_game_ad = false;
dispatchEvent(new Event("mochi_pre_game_ad_ready"));
};
if (waiting_inter_level_ad){
waiting_inter_level_ad = false;
dispatchEvent(new Event("mochi_inter_level_ad_ready"));
};
if (is_in_board){
is_in_board = false;
};
super.play();
}
public function submitScore(_arg1:String, _arg2:Number):void{
var _local3:String = getBoardID();
MochiScores.showLeaderboard({boardID:_local3, res:"640x426", width:640, height:426, score:_arg2, name:_arg1});
}
public static function getInstance():MochiContainer{
return (intance);
}
}
}//package preloader
Section 119
//Profile (profile.Profile)
package profile {
import game.save.*;
import gamelibrary.*;
import tutorial.*;
import sound.*;
public class Profile {
public var started:Boolean;// = false
public var spawn_timer:Number;
public var shots_count:int;// = 0
public var shipLevelIndex:int;// = 0
public var currentLevel:int;// = 0
public var playerName:String;// = "SuperTester"
public var start_repairPoints:int;// = 100
public var total_shots_count:int;// = 0
public var num_good_hits:int;// = 0
public var score:int;// = 0
public var startShipLevelIndex:int;// = 0
public var level_score:int;// = 0
public var cannons:Array;
public var start_rounds:Array;
public var sound_vol:int;
public var rounds:Array;
public var start_shipState:int;// = 80
public var tutorials_done:Array;
public var shipState:int;// = 80
public var spawn_points:int;
public var ships:Array;
public var start_cannons:Array;
public var start_money:int;// = 0
public var entered_ships_count:int;
public var money:int;// = 0
public var music_vol:int;
public var gameDifficulty:int;// = 0
public var repairPoints:int;// = 100
public var last_window:int;
public var current_time:Number;
public var monkey_rob:int;// = 0
public var visit_levels:Array;
public var sunk_ships_count:int;// = 0
public var earned_money:int;// = 0
public function Profile(_arg1:String){
playerName = _arg1;
music_vol = 100;
sound_vol = 100;
newGame();
}
private function fisrtVisit(_arg1:int):Boolean{
return (((!(visit_levels)) || ((visit_levels.indexOf(_arg1) < 0))));
}
public function getDataForSave():Object{
var _local1:Object = {};
return (_local1);
}
public function setTutorialDone(_arg1:int):void{
if (!tutorials_done){
tutorials_done = [];
};
tutorials_done.push(_arg1);
}
public function restartLevel():void{
var _local4:ShipInfo;
var _local1:int = visit_levels.indexOf(currentLevel);
if (_local1 < 0){
visit_levels.splice(_local1, 1);
};
ships = [];
getStartParameters();
shipState = start_shipState;
shipLevelIndex = startShipLevelIndex;
money = start_money;
repairPoints = start_repairPoints;
spawn_points = 0;
spawn_timer = 0;
entered_ships_count = 0;
level_score = 0;
shots_count = 0;
num_good_hits = 0;
sunk_ships_count = 0;
monkey_rob = 0;
earned_money = 0;
var _local2:LevelInfo = ((currentLevel)<2) ? GameConsts.getDemoAtIndex(currentLevel) : GameConsts.getLevelAtIndex((currentLevel - 2));
var _local3:int;
while (_local3 < _local2.ships.length) {
_local4 = _local2.ships[_local3];
_local4.added = false;
_local4.present_num_ships = 0;
_local3++;
};
if (currentLevel == 0){
newGame();
};
TutorialManager.getInstance().restart();
if (currentLevel >= 2){
last_window = 1;
};
}
private function getStartParameters():void{
var _local1:int;
var _local2:SaveCannonData;
var _local3:SaveRoundsData;
cannons = [];
_local1 = 0;
while (_local1 < start_cannons.length) {
_local2 = start_cannons[_local1];
if (_local2){
cannons.push(_local2.clone());
} else {
cannons.push(null);
};
_local1++;
};
rounds = new Array();
_local1 = 0;
while (_local1 < start_rounds.length) {
_local3 = start_rounds[_local1];
if (_local3){
rounds.push(_local3.clone());
} else {
rounds.push(null);
};
_local1++;
};
}
private function saveStartParameters():void{
var _local1:int;
var _local2:SaveCannonData;
var _local3:SaveRoundsData;
start_cannons = [];
_local1 = 0;
while (_local1 < cannons.length) {
_local2 = cannons[_local1];
if (_local2){
start_cannons.push(_local2.clone());
} else {
start_cannons.push(null);
};
_local1++;
};
start_rounds = new Array();
_local1 = 0;
while (_local1 < rounds.length) {
_local3 = rounds[_local1];
if (_local3){
start_rounds.push(_local3.clone());
} else {
start_rounds.push(null);
};
_local1++;
};
}
public function newGame():void{
tutorials_done = [];
money = 0;
currentLevel = 0;
score = 0;
started = false;
current_time = 9;
cannons = [];
start_cannons = [];
start_rounds = [];
rounds = [];
visit_levels = [];
repairPoints = 100;
shipState = 80;
shipLevelIndex = 0;
startShipLevelIndex = 0;
spawn_points = 0;
spawn_timer = 0;
entered_ships_count = 0;
ships = [];
level_score = 0;
shots_count = 0;
num_good_hits = 0;
sunk_ships_count = 0;
monkey_rob = 0;
earned_money = 0;
total_shots_count = 0;
TutorialManager.getInstance().restart();
}
public function startLevel():void{
var _local1:int;
switch (currentLevel){
case 0:
break;
case 1:
if (fisrtVisit(1)){
cannons = [];
rounds = [];
_local1 = 0;
while (_local1 < 4) {
cannons.push(new SaveCannonData(0, 0, [], []));
rounds.push(new SaveRoundsData(1, 100));
_local1++;
};
shipState = 100;
};
break;
case 2:
if (fisrtVisit(2)){
cannons = [];
rounds = [];
_local1 = 0;
while (_local1 < 4) {
cannons.push(new SaveCannonData(0, 0, [], []));
rounds.push(null);
_local1++;
};
shipState = 100;
money = GameConsts.start_money;
repairPoints = GameConsts.start_repair_points;
};
break;
};
if (fisrtVisit(currentLevel)){
entered_ships_count = 0;
level_score = 0;
shots_count = 0;
num_good_hits = 0;
sunk_ships_count = 0;
monkey_rob = 0;
earned_money = 0;
spawn_points = 0;
spawn_timer = 0;
setAllCannonsEmpty();
saveStartParameters();
start_money = money;
start_repairPoints = repairPoints;
startShipLevelIndex = shipLevelIndex;
};
if (visit_levels.indexOf(currentLevel) < 0){
visit_levels.push(currentLevel);
};
}
private function setAllCannonsEmpty():void{
var _local2:SaveCannonData;
if (!cannons){
return;
};
var _local1:int;
while (_local1 < cannons.length) {
_local2 = cannons[_local1];
if (!_local2){
} else {
_local2.balls = [];
_local2.prev_round_index = [];
};
_local1++;
};
}
public function nextLevel():void{
trace("next level from", currentLevel);
ships = [];
level_score = 0;
start_money = money;
startShipLevelIndex = shipLevelIndex;
start_repairPoints = repairPoints;
start_shipState = shipState;
currentLevel++;
}
public function load(_arg1:Object):void{
var _local2:int;
var _local3:int;
var _local4:SaveCannonData;
var _local5:SaveRoundsData;
var _local6:SaveShipData;
music_vol = _arg1.music_vol;
sound_vol = _arg1.sound_vol;
SoundManager.setMusicVolume(music_vol);
SoundManager.setSoundVolume(sound_vol);
gameDifficulty = _arg1.gameDifficulty;
tutorials_done = _arg1.tutorials_done;
currentLevel = _arg1.currentLevel;
started = Boolean(_arg1.started);
current_time = _arg1.current_time;
money = _arg1.money;
repairPoints = _arg1.repairPoints;
shipState = _arg1.shipState;
shipLevelIndex = _arg1.shipLevelIndex;
startShipLevelIndex = _arg1.startShipLevelIndex;
start_money = _arg1.start_money;
start_repairPoints = _arg1.start_repairPoints;
start_shipState = _arg1.start_shipState;
score = _arg1.score;
if (_arg1.visit_levels){
visit_levels = _arg1.visit_levels;
};
level_score = _arg1.level_score;
shots_count = _arg1.shots_count;
num_good_hits = _arg1.num_good_hits;
sunk_ships_count = _arg1.sunk_ships_count;
monkey_rob = _arg1.monkey_rob;
earned_money = _arg1.earned_money;
if (_arg1.cannons){
_local2 = _arg1.cannons.length;
_local3 = 0;
while (_local3 < _local2) {
_local4 = (_arg1.cannons[_local3]) ? new SaveCannonData(_arg1.cannons[_local3].index, _arg1.cannons[_local3].shots_count, _arg1.cannons[_local3].balls, _arg1.cannons[_local3].prev_round_index) : null;
cannons.push(_local4);
_local3++;
};
};
if (_arg1.rounds){
_local2 = _arg1.rounds.length;
_local3 = 0;
while (_local3 < _local2) {
_local5 = (_arg1.rounds[_local3]) ? new SaveRoundsData(_arg1.rounds[_local3].index, _arg1.rounds[_local3].count) : null;
rounds.push(_local5);
_local3++;
};
};
if (_arg1.start_cannons){
_local2 = _arg1.start_cannons.length;
_local3 = 0;
while (_local3 < _local2) {
_local4 = (_arg1.start_cannons[_local3]) ? new SaveCannonData(_arg1.start_cannons[_local3].index, _arg1.start_cannons[_local3].shots_count, _arg1.start_cannons[_local3].balls, _arg1.start_cannons[_local3].prev_round_index) : null;
start_cannons.push(_local4);
_local3++;
};
};
if (_arg1.start_rounds){
_local2 = _arg1.start_rounds.length;
_local3 = 0;
while (_local3 < _local2) {
_local5 = (_arg1.start_rounds[_local3]) ? new SaveRoundsData(_arg1.start_rounds[_local3].index, _arg1.start_rounds[_local3].count) : null;
start_rounds.push(_local5);
_local3++;
};
};
spawn_points = _arg1.spawn_points;
spawn_timer = _arg1.spawn_timer;
entered_ships_count = _arg1.entered_ships_count;
if (_arg1.ships){
_local2 = _arg1.ships.length;
_local3 = 0;
while (_local3 < _local2) {
_local6 = (_arg1.ships[_local3]) ? new SaveShipData(_arg1.ships[_local3].index_in_level, _arg1.ships[_local3].x, _arg1.ships[_local3].speed, _arg1.ships[_local3].line, _arg1.ships[_local3].damage, _arg1.ships[_local3].effect) : null;
ships.push(_local6);
_local3++;
};
};
last_window = _arg1.last_window;
}
public function getTutorialDone(_arg1:int):Boolean{
if (!tutorials_done){
return (false);
};
return ((tutorials_done.indexOf(_arg1) >= 0));
}
}
}//package profile
Section 120
//ProfileManager (profile.ProfileManager)
package profile {
import sound.*;
import flash.net.*;
public class ProfileManager {
private var shared_object:SharedObject;
private var current_profile:Profile;
private var _profiles:Array;
private var current_profile_index:int;
public static const DEF_PROFILE_NAME:String = "Player 1";
public static const SO_NAME:String = "PiratesFlash";
private static var allow_creation:Boolean = false;
private static var instance:ProfileManager = null;
public function ProfileManager(){
var _local1:Array;
var _local2:int;
var _local3:Profile;
super();
if (!allow_creation){
throw (new Error("Singleton Error"));
};
shared_object = SharedObject.getLocal(SO_NAME);
_profiles = [];
if (shared_object.data.players){
_local1 = shared_object.data.players;
_local2 = 0;
while (_local2 < _local1.length) {
_local3 = new Profile(_local1[_local2].playerName);
_local3.load(_local1[_local2]);
_profiles.push(_local3);
_local2++;
};
};
if (((!((shared_object.data.currentProfileIndex == null))) && (!((shared_object.data.currentProfileIndex == undefined))))){
current_profile_index = Number(shared_object.data.currentProfileIndex);
current_profile = getProfileAt(current_profile_index);
} else {
addNewProfile(DEF_PROFILE_NAME);
};
}
private function set currentProfileIndex(_arg1:int):void{
current_profile_index = _arg1;
shared_object.data.currentProfileIndex = current_profile_index;
shared_object.flush();
}
public function get profilesCount():int{
return (_profiles.length);
}
public function saveLevelComplete():void{
current_profile.nextLevel();
saveCurrentProfile(1);
}
public function addNewProfile(_arg1:String):void{
var _local2:Profile = new Profile(_arg1);
_profiles.push(_local2);
if (shared_object.data.players){
shared_object.data.players.push(_local2);
} else {
shared_object.data.players = [_local2];
};
current_profile = _local2;
currentProfileIndex = (profilesCount - 1);
shared_object.flush();
}
public function selectProfile(_arg1:int):void{
if ((((_arg1 < 0)) || ((_arg1 >= _profiles.length)))){
return;
};
current_profile = getProfileAt(_arg1);
currentProfileIndex = _arg1;
shared_object.flush();
SoundManager.music_volume = current_profile.music_vol;
SoundManager.sound_volume = current_profile.sound_vol;
}
public function get currentProfile():Profile{
return (current_profile);
}
public function saveCurrentProfile(_arg1:int):void{
current_profile.last_window = _arg1;
current_profile.sound_vol = SoundManager.sound_volume;
current_profile.music_vol = SoundManager.music_volume;
shared_object.data.players[current_profile_index] = current_profile;
trace(("================== save profile ====================== " + _arg1));
shared_object.flush();
}
public function getProfileByName(_arg1:String):Profile{
var _local2:int;
while (_local2 < _profiles.length) {
if (_profiles[_local2].playerName == _arg1){
return (_profiles[_local2]);
};
_local2++;
};
return (null);
}
public function getProfileAt(_arg1:int):Profile{
if ((((_arg1 < 0)) || ((_arg1 >= _profiles.length)))){
return (null);
};
return (_profiles[_arg1]);
}
public static function getInstance():ProfileManager{
if (!instance){
allow_creation = true;
instance = new (ProfileManager);
allow_creation = false;
};
return (instance);
}
}
}//package profile
Section 121
//SoundManager (sound.SoundManager)
package sound {
import flash.events.*;
import flash.media.*;
import flash.system.*;
public class SoundManager {
private static var sounds:Array;
public static var sound_volume:int = 100;
private static var musics:Array;
public static var music_volume:int = 100;
public static function stopMusic(_arg1:String):void{
var _local3:SoundChannel;
if (!musics){
return;
};
var _local2:int;
while (_local2 < musics.length) {
if (musics[_local2][0] == _arg1){
_local3 = musics[_local2][1];
_local3.stop();
musics.splice(_local2, 1);
return;
};
_local2++;
};
}
public static function stopAllMusic():void{
var _local2:SoundChannel;
if (!musics){
return;
};
var _local1:int;
while (_local1 < musics.length) {
_local2 = musics[_local1][1];
_local2.stop();
_local1++;
};
musics = [];
}
public static function setSoundVolume(_arg1:int):void{
var _local3:SoundChannel;
var _local4:SoundTransform;
if (!sounds){
return;
};
sound_volume = _arg1;
var _local2:int;
while (_local2 < sounds.length) {
_local3 = sounds[_local2][1];
_local4 = _local3.soundTransform;
_local4.volume = ((sounds[_local2][2] * sound_volume) / 100);
_local3.soundTransform = _local4;
_local2++;
};
}
private static function soundCompleteHandler(_arg1:Event):void{
if (!sounds){
return;
};
var _local2:int;
while (_local2 < sounds.length) {
if (sounds[_local2][1] == _arg1.target){
sounds.splice(_local2, 1);
return;
};
_local2++;
};
}
private static function musicCompleteHandler(_arg1:Event):void{
var _local3:String;
var _local4:int;
if (!musics){
return;
};
var _local2:int;
while (_local2 < musics.length) {
if (musics[_local2][1] == _arg1.target){
_local3 = musics[_local2][0];
_local4 = musics[_local2][2];
musics.splice(_local2, 1);
if (_local4 == 0){
playMusic(_local3, _local4);
};
return;
};
_local2++;
};
}
public static function stopSound(_arg1:String):void{
var _local3:SoundChannel;
if (!sounds){
return;
};
var _local2:int;
while (_local2 < sounds.length) {
if (sounds[_local2][0] == _arg1){
_local3 = sounds[_local2][1];
_local3.stop();
sounds.splice(_local2, 1);
return;
};
_local2++;
};
}
private static function createMusic(_arg1:String):Sound{
var cl:Class;
var m:Sound;
var id = _arg1;
try {
if (!ApplicationDomain.currentDomain.hasDefinition(id)){
return (null);
};
cl = (ApplicationDomain.currentDomain.getDefinition(id) as Class);
m = (new (cl) as Sound);
return (m);
} catch(e:Error) {
trace("music error");
return (null);
};
return (null);
}
public static function playMusic(_arg1:String, _arg2:int=0):void{
var _local5:SoundChannel;
var _local6:SoundTransform;
if (!musics){
musics = [];
};
var _local3:int;
while (_local3 < musics.length) {
if (musics[_local3][0] == _arg1){
return;
};
_local3++;
};
var _local4:Sound = createMusic(_arg1);
if (_local4){
_local5 = _local4.play(0, _arg2);
if (_local5){
_local6 = _local5.soundTransform;
_local6.volume = (music_volume / 100);
_local5.soundTransform = _local6;
_local5.addEventListener(Event.SOUND_COMPLETE, musicCompleteHandler);
musics.push([_arg1, _local5, _arg2]);
};
};
}
public static function stopAllSounds():void{
var _local2:SoundChannel;
if (!sounds){
return;
};
var _local1:int;
while (_local1 < sounds.length) {
_local2 = sounds[_local1][1];
_local2.stop();
_local1++;
};
sounds = [];
}
public static function playSound(_arg1:String, _arg2:Number=1, _arg3:int=1):void{
var _local5:SoundChannel;
var _local6:SoundTransform;
if (!sounds){
sounds = [];
};
var _local4:Sound = createMusic(_arg1);
if (_local4){
_local5 = _local4.play(0, ((_arg3)==0) ? 1000 : _arg3);
if (_local5){
_local6 = _local5.soundTransform;
_local6.volume = ((_arg2 * sound_volume) / 100);
_local5.soundTransform = _local6;
_local5.addEventListener(Event.SOUND_COMPLETE, soundCompleteHandler);
sounds.push([_arg1, _local5, _arg2, _arg3]);
};
};
}
public static function setMusicVolume(_arg1:int):void{
var _local3:SoundChannel;
var _local4:SoundTransform;
if (!musics){
return;
};
music_volume = _arg1;
var _local2:int;
while (_local2 < musics.length) {
_local3 = musics[_local2][1];
_local4 = _local3.soundTransform;
_local4.volume = (music_volume / 100);
_local3.soundTransform = _local4;
_local2++;
};
}
}
}//package sound
Section 122
//TutorialEvent (tutorial.TutorialEvent)
package tutorial {
import flash.events.*;
public class TutorialEvent extends Event {
private var _data:Object;
public static const CLOSE:String = "close_tutorial";
public static const OPEN:String = "open_tutorial";
public function TutorialEvent(_arg1:String, _arg2:Object=null, _arg3:Boolean=false, _arg4:Boolean=false){
super(_arg1, _arg3, _arg4);
_data = _arg2;
}
public function get data():Object{
return (_data);
}
}
}//package tutorial
Section 123
//TutorialItem (tutorial.TutorialItem)
package tutorial {
public class TutorialItem {
public var multy:Boolean;// = false
public var open_trigger:String;// = ""
public var tap_timeout:int;// = 100
public var open_anim:Boolean;// = true
public var done:Boolean;// = false
public var close_trigger:String;// = ""
public var index:int;
public var level:int;
public var text:String;// = ""
public var close_anim:Boolean;// = false
public function TutorialItem(_arg1:int, _arg2:String, _arg3:String, _arg4:String){
this.index = _arg1;
this.open_trigger = _arg2;
this.close_trigger = _arg3;
this.text = _arg4;
}
}
}//package tutorial
Section 124
//TutorialManager (tutorial.TutorialManager)
package tutorial {
import utils.*;
import flash.events.*;
import profile.*;
import config.*;
public class TutorialManager extends EventDispatcher {
private var items:Array;
private var current_tutorial:TutorialItem;
private static var allow_creation:Boolean = false;
private static var instance:TutorialManager = null;
public function TutorialManager(){
var _local4:TutorialItem;
super();
if (!allow_creation){
throw (new Error("Singleton Error"));
};
items = [];
var _local1:XML = TutorialXML.TUTORIALS;
var _local2:int = _local1.children().length();
var _local3:int;
while (_local3 < _local2) {
_local4 = new TutorialItem(_local1.item[_local3].@index, _local1.item[_local3].@open_trigger, _local1.item[_local3].@close_trigger, _local1.item[_local3].@text);
_local4.close_anim = (_local1.item[_local3].@close_anim == "true");
_local4.open_anim = (_local1.item[_local3].@open_anim == "true");
_local4.tap_timeout = Number(_local1.item[_local3].@tap);
_local4.level = XMLValidator.validateAttibuteNumber(_local1.item[_local3], "level", -1);
_local4.multy = (XMLValidator.validateAttibuteString(_local1.item[_local3], "multy") == "1");
items.push(_local4);
_local3++;
};
current_tutorial = null;
}
public function notifyEvent(_arg1:String, ... _args):void{
if (current_tutorial){
if (current_tutorial.close_trigger == _arg1){
dispatchEvent(new TutorialEvent(TutorialEvent.CLOSE, current_tutorial));
};
};
var _local3:TutorialItem = findTutorilaForOpen(_arg1);
if (((_local3) && (((!(ProfileManager.getInstance().currentProfile.getTutorialDone(_local3.index))) || ((ProfileManager.getInstance().currentProfile.currentLevel < 2)))))){
dispatchEvent(new TutorialEvent(TutorialEvent.OPEN, _local3));
if (!_local3.multy){
_local3.done = true;
};
current_tutorial = _local3;
};
}
private function findTutorilaForOpen(_arg1:String, ... _args):TutorialItem{
var _local4:TutorialItem;
var _local3:int;
while (_local3 < items.length) {
_local4 = items[_local3];
if (_local4.done){
} else {
if (_local4.open_trigger == _arg1){
return (_local4);
};
};
_local3++;
};
return (null);
}
public function isItemDone(_arg1:int):Boolean{
if ((((_arg1 < 0)) || ((_arg1 > items.length)))){
return (false);
};
return (items[_arg1].done);
}
public function restart():void{
var _local2:TutorialItem;
var _local1:int;
while (_local1 < items.length) {
_local2 = items[_local1];
_local2.done = false;
_local1++;
};
}
public static function getInstance():TutorialManager{
if (!instance){
allow_creation = true;
instance = new (TutorialManager);
allow_creation = false;
};
return (instance);
}
}
}//package tutorial
Section 125
//TutorialScreen (tutorial.TutorialScreen)
package tutorial {
import flash.display.*;
import flash.events.*;
import engine.localization.*;
import sound.*;
import flash.text.*;
import flash.utils.*;
public class TutorialScreen extends MovieClip {
private var tut_item:TutorialItem;
public var hit:MovieClip;
private var _hit:MovieClip;
public var pirate:MovieClip;
private var _btn:TextField;
private var btn_id:uint;
public var caption:TextField;
private var _caption:TextField;
public var button:TextField;
public var cloud:MovieClip;
private var _pirate:MovieClip;
private var is_shown:Boolean;// = false
public function TutorialScreen(){
addFrameScript(14, frame15, 25, frame26);
super();
_caption = (this.getChildByName("caption") as TextField);
_btn = (this.getChildByName("button") as TextField);
_hit = (this.getChildByName("hit") as MovieClip);
stop();
is_shown = false;
_hit.addEventListener(MouseEvent.CLICK, clickHandler);
_pirate = (this.getChildByName("pirate") as MovieClip);
_pirate.stop();
}
public function hide():Boolean{
if (!is_shown){
return (false);
};
is_shown = false;
clearTimeout(btn_id);
if (_caption){
_caption.text = "";
};
if (_btn){
_btn.text = "";
};
if (tut_item.close_anim){
this.gotoAndPlay("close");
} else {
this.gotoAndStop("hide");
};
return (true);
}
private function closeEnd():void{
this.visible = false;
TutorialManager.getInstance().notifyEvent((("remove(" + tut_item.index) + ")"));
}
private function showButton():void{
if (_btn){
_btn.text = StringTable.getString("strTutTap");
};
}
function frame15(){
stop();
}
private function clickHandler(_arg1:MouseEvent):void{
var _local2:int = (tut_item) ? tut_item.index : -1;
SoundManager.playSound("click");
TutorialManager.getInstance().notifyEvent("close", _local2);
}
function frame26(){
stop();
closeEnd();
}
public function show(_arg1:TutorialItem, _arg2:int):void{
_pirate.gotoAndStop(_arg2);
is_shown = true;
this.visible = true;
tut_item = _arg1;
if (_caption){
_caption.text = tut_item.text;
};
if (tut_item.tap_timeout > 0){
btn_id = setTimeout(showButton, tut_item.tap_timeout);
};
if (tut_item.open_anim){
this.play();
} else {
gotoAndStop("show");
};
}
}
}//package tutorial
Section 126
//MathUtils (utils.MathUtils)
package utils {
public class MathUtils {
public static function getRandomArray(_arg1:int, _arg2:int):Array{
var _local3:Array = [];
var _local4:int = _arg1;
while (_local4 <= _arg2) {
_local3.push(_local4);
_local4++;
};
return (_local3);
}
public static function getRandomSign():int{
return ((eventAppear(0.5)) ? 1 : -1);
}
public static function getRandomValue(_arg1:Number, _arg2:Number):Number{
return ((_arg1 + (Math.random() * (_arg2 - _arg1))));
}
public static function sign(_arg1:Number):Number{
if (_arg1 == 0){
return (0);
};
return (((_arg1)>0) ? 1 : -1);
}
public static function eventAppear(_arg1:Number):Boolean{
return ((Math.random() < _arg1));
}
public static function between(_arg1:Number, _arg2:Number, _arg3:Number):Boolean{
return ((((_arg3 >= _arg1)) && ((_arg3 <= _arg2))));
}
}
}//package utils
Section 127
//MovieTileWrapper (utils.MovieTileWrapper)
package utils {
import flash.display.*;
import flash.events.*;
public class MovieTileWrapper {
private var timer:int;
private var speed:int;// = 1
private var _mask:Sprite;
private var col_count:int;
private var dx:Number;
private var thisClip:MovieClip;
private var total_count:int;
private var dy:Number;
private var row_count:int;
private var _target:Sprite;
private var cur_frame:int;
private var _pause:Boolean;// = false
public function MovieTileWrapper(_arg1:MovieClip){
thisClip = _arg1;
_target = (thisClip.getChildByName("tg") as MovieClip);
_mask = (thisClip.getChildByName("msk") as Sprite);
}
public function init(_arg1:BitmapData, _arg2:int, _arg3:int, _arg4:int, _arg5:int=1):void{
if (_arg1){
attachBitmapData(_arg1);
};
this.speed = _arg5;
this.col_count = _arg2;
this.row_count = _arg3;
this.total_count = _arg4;
dx = (_target.width / _arg2);
dy = (_target.height / _arg3);
_mask.width = dx;
_mask.height = dy;
cur_frame = 0;
timer = 0;
thisClip.addEventListener(Event.ENTER_FRAME, enterFrameHandler);
}
private function attachBitmapData(_arg1:BitmapData):void{
if (((_target) && (_arg1))){
_target.addChild(new Bitmap(_arg1));
};
}
private function enterFrameHandler(_arg1:Event):void{
if (_pause){
return;
};
if (++timer < speed){
return;
};
timer = 0;
if (cur_frame >= total_count){
cur_frame = 0;
};
var _local2:Number = (cur_frame % col_count);
var _local3:Number = Math.floor((cur_frame / col_count));
_target.x = (-(_local2) * dx);
_target.y = (-(_local3) * dy);
cur_frame++;
}
public function set pause(_arg1:Boolean):void{
_pause = _arg1;
}
public function destroy():void{
thisClip.removeEventListener(Event.ENTER_FRAME, enterFrameHandler);
}
}
}//package utils
Section 128
//Point3D (utils.Point3D)
package utils {
import flash.geom.*;
public class Point3D {
public var x:Number;
public var y:Number;
public var z:Number;
public static const VIEW_Z:Number = 100;
public static const VIEW_X:Number = 320;
public static const SCREEN_Z:Number = 27.2;
public static const ZQ:Number = 100;
public static const RESIZE_COEF:Number = 0.8;
public static const VIEW_Y:Number = 213;
public static var CENTER_POINT:Point3D = new Point3D(320, 200, 100);
;
public function Point3D(_arg1:Number=0, _arg2:Number=0, _arg3:Number=0){
this.x = _arg1;
this.y = _arg2;
this.z = _arg3;
}
public function add(_arg1:Point3D):Point3D{
return (new Point3D((this.x + _arg1.x), (this.y + _arg1.y), (this.z + _arg1.z)));
}
public function multy(_arg1:Number):void{
x = (x * _arg1);
y = (y * _arg1);
z = (z * _arg1);
}
public function getProection():Point{
var _local1:Number = (ZQ / (ZQ - z));
return (new Point(((_local1 * (x - CENTER_POINT.x)) + CENTER_POINT.x), ((_local1 * (y - CENTER_POINT.y)) + CENTER_POINT.y)));
}
public function toString():String{
return ((((((("(x = " + x) + ", y = ") + y) + ", z = ") + z) + ")"));
}
public function clone():Point3D{
return (new Point3D(x, y, z));
}
public static function initView(_arg1:Number=0, _arg2:Number=0, _arg3:Number=0):void{
}
public static function getSize(_arg1:Point, _arg2:Number):Point{
var _local3:Number = (ZQ / (ZQ - _arg2));
return (new Point((_arg1.x * _local3), (_arg1.y * _local3)));
}
}
}//package utils
Section 129
//XMLValidator (utils.XMLValidator)
package utils {
public class XMLValidator {
private static function validateAttibute(_arg1:Object, _arg2:String, _arg3:Object=null, ... _args):Object{
return ((((_arg1.@[_arg2]) && (!((String(_arg1.@[_arg2]) == ""))))) ? _arg1.@[_arg2] : _arg3);
}
public static function validateAttibuteString(_arg1:Object, _arg2:String, _arg3:String="", ... _args):String{
return (validateAttibute(_arg1, _arg2, _arg3, _args).toString());
}
private static function validateField(_arg1:Object, _arg2:String, _arg3:Object=null, ... _args):Object{
return ((((_arg1[_arg2]) && (!((String(_arg1[_arg2]) == ""))))) ? _arg1[_arg2] : _arg3);
}
public static function validateFieldString(_arg1:Object, _arg2:String, _arg3:String="", ... _args):String{
return (validateField(_arg1, _arg2, _arg3, _args).toString());
}
public static function validateAttibuteArray(_arg1:Object, _arg2:String, _arg3:Array=null, _arg4:String=","):Array{
if (!_arg1.@[_arg2]){
return (_arg3);
};
var _local5:String = _arg1.@[_arg2].toString();
return (_local5.split(_arg4));
}
public static function validateAttibuteNumber(_arg1:Object, _arg2:String, _arg3:Number=0, ... _args):Number{
return (Number(validateAttibute(_arg1, _arg2, _arg3, _args)));
}
public static function validateFieldNumber(_arg1:Object, _arg2:String, _arg3:Number=0, ... _args):Number{
return (Number(validateField(_arg1, _arg2, _arg3, _args).toString()));
}
}
}//package utils
Section 130
//HighresHeader (windows.highres.HighresHeader)
package windows.highres {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
public class HighresHeader extends MovieClip {
private var target_frame:int;
private var current_index:int;
private var is_stop:Boolean;// = false
private static const FRAMES:Array = [1, 10, 20, 30];
public function HighresHeader(){
this.stop();
this.addEventListener(Event.ENTER_FRAME, enterFrameHadler);
}
public function set startIndex(_arg1:int):void{
current_index = _arg1;
target_frame = FRAMES[current_index];
this.gotoAndStop(target_frame);
}
private function enterFrameHadler(_arg1:Event):void{
if (this.currentFrame > target_frame){
this.prevFrame();
};
if (this.currentFrame < target_frame){
this.nextFrame();
};
if ((((currentFrame == target_frame)) && (!(is_stop)))){
setTimeout(stopHandler, 200);
};
}
private function stopHandler():void{
if ((((currentFrame == target_frame)) && (!(is_stop)))){
is_stop = true;
};
}
public function moveRight():void{
current_index++;
target_frame = FRAMES[current_index];
is_stop = false;
}
public function destroy():void{
this.removeEventListener(Event.ENTER_FRAME, enterFrameHadler);
}
public function moveLeft():void{
current_index--;
target_frame = FRAMES[current_index];
is_stop = false;
}
}
}//package windows.highres
Section 131
//MainMenuPanel (windows.mainmenu.MainMenuPanel)
package windows.mainmenu {
import flash.display.*;
import flash.events.*;
import gamelibrary.*;
import engine.localization.*;
import controls.*;
import engine.controls.events.*;
import sound.*;
public class MainMenuPanel extends MovieClip {
public var highscores_btn:MenuTextButton;
public var continue_btn:MenuTextButton;
public var newgame_btn:MenuTextButton;
public var option_btn:MenuTextButton;
public var btn1:MovieClip;
public var btn2:MovieClip;
public var btn3:MovieClip;
public var btn4:MovieClip;
public function MainMenuPanel(){
addFrameScript(13, frame14);
super();
continue_btn = new MenuTextButton((this.getChildByName("btn1") as MovieClip));
newgame_btn = new MenuTextButton((this.getChildByName("btn2") as MovieClip));
option_btn = new MenuTextButton((this.getChildByName("btn3") as MovieClip));
highscores_btn = new MenuTextButton((this.getChildByName("btn4") as MovieClip));
continue_btn.caption = StringTable.getString("strContinue");
newgame_btn.caption = StringTable.getString("strNewGame");
option_btn.caption = StringTable.getString("strOptions");
highscores_btn.caption = StringTable.getString("strHighscores");
continue_btn.clip.addEventListener(MouseEvent.CLICK, continueClickHandler);
newgame_btn.clip.addEventListener(MouseEvent.CLICK, newgameClickHandler);
option_btn.clip.addEventListener(MouseEvent.CLICK, optionsClickHandler);
highscores_btn.clip.addEventListener(MouseEvent.CLICK, highscoresClickHandler);
}
private function optionsClickHandler(_arg1:MouseEvent):void{
SoundManager.playSound("click");
dispatchEvent(new ControlEvent(ControlEvent.SELECT_ITEM, PiratesL.OPTIONS));
}
private function highscoresClickHandler(_arg1:MouseEvent):void{
SoundManager.playSound("click");
dispatchEvent(new ControlEvent(ControlEvent.SELECT_ITEM, PiratesL.HIGHSCORES));
}
private function continueClickHandler(_arg1:MouseEvent):void{
if (!continue_btn.enable){
return;
};
SoundManager.playSound("click");
dispatchEvent(new ControlEvent(ControlEvent.SELECT_ITEM, PiratesL.CONTINUE));
}
private function newgameClickHandler(_arg1:MouseEvent):void{
SoundManager.playSound("click");
dispatchEvent(new ControlEvent(ControlEvent.SELECT_ITEM, PiratesL.NEW_GAME));
}
public function destroy():void{
continue_btn.clip.removeEventListener(MouseEvent.CLICK, continueClickHandler);
newgame_btn.clip.removeEventListener(MouseEvent.CLICK, newgameClickHandler);
option_btn.clip.removeEventListener(MouseEvent.CLICK, optionsClickHandler);
highscores_btn.clip.removeEventListener(MouseEvent.CLICK, highscoresClickHandler);
continue_btn.destroy();
option_btn.destroy();
newgame_btn.destroy();
highscores_btn.destroy();
}
public function refresh():void{
continue_btn.refresh();
newgame_btn.refresh();
option_btn.refresh();
highscores_btn.refresh();
}
function frame14(){
stop();
refresh();
}
}
}//package windows.mainmenu
Section 132
//MapDot (windows.map.MapDot)
package windows.map {
import flash.display.*;
public class MapDot extends MovieClip {
}
}//package windows.map
Section 133
//MapStrokeLeft (windows.map.MapStrokeLeft)
package windows.map {
import flash.display.*;
public class MapStrokeLeft extends MovieClip {
public function MapStrokeLeft(){
addFrameScript(35, frame36);
super();
}
function frame36(){
stop();
}
}
}//package windows.map
Section 134
//MapStrokeRight (windows.map.MapStrokeRight)
package windows.map {
import flash.display.*;
public class MapStrokeRight extends MovieClip {
}
}//package windows.map
Section 135
//ProfileBubble (windows.profile.ProfileBubble)
package windows.profile {
import flash.display.*;
import engine.utils.*;
import flash.text.*;
public class ProfileBubble extends MovieClip {
public var level:TextField;
private var _level:TextField;
private var _name:TextField;
public var score:TextField;
private var _score:TextField;
public var p_name:TextField;
public function ProfileBubble(_arg1:String, _arg2:int, _arg3:int){
_name = (this.getChildByName("p_name") as TextField);
_level = (this.getChildByName("level") as TextField);
_score = (this.getChildByName("score") as TextField);
_name.text = _arg1;
if (_arg2 < 2){
_level.text = ("Tutorial: " + (_arg2 + 1));
} else {
_level.text = ("Level: " + (_arg2 - 1));
};
_score.text = ("Score: " + Utils.intToString(_arg3, 5));
_level.visible = (_arg2 > 0);
_score.visible = (_arg3 > 0);
}
}
}//package windows.profile
Section 136
//ProfileEnterName (windows.profile.ProfileEnterName)
package windows.profile {
import flash.display.*;
import flash.events.*;
import engine.controls.events.*;
import flash.text.*;
import flash.ui.*;
public class ProfileEnterName extends EventDispatcher {
private var input_txt:TextField;
private var thisClip:MovieClip;
private var content:MovieClip;
private var hidden_txt:TextField;
public function ProfileEnterName(_arg1:MovieClip){
thisClip = _arg1;
content = (thisClip.getChildByName("cnt") as MovieClip);
input_txt = (content.getChildByName("input") as TextField);
hidden_txt = (content.getChildByName("hidden") as TextField);
thisClip.stop();
thisClip.visible = false;
}
public function hide():void{
input_txt.removeEventListener(Event.CHANGE, changeHandler);
input_txt.removeEventListener(KeyboardEvent.KEY_DOWN, keyDownHandler);
thisClip.gotoAndStop(1);
thisClip.visible = false;
}
private function keyDownHandler(_arg1:KeyboardEvent):void{
var _local2:uint = _arg1.keyCode;
if (_local2 == Keyboard.ENTER){
if (input_txt.text != ""){
dispatchEvent(new ControlEvent(ControlEvent.PRESS_ENTER, input_txt.text));
};
};
}
private function changeHandler(_arg1:Event):void{
hidden_txt.visible = (input_txt.text == "");
}
public function show():void{
if (thisClip.visible){
return;
};
thisClip.gotoAndPlay("appear");
thisClip.visible = true;
input_txt.text = "";
hidden_txt.visible = true;
input_txt.addEventListener(Event.CHANGE, changeHandler);
input_txt.addEventListener(KeyboardEvent.KEY_DOWN, keyDownHandler);
}
}
}//package windows.profile
Section 137
//AmmoItem (windows.shop.AmmoItem)
package windows.shop {
import flash.display.*;
import gamelibrary.*;
import engine.controls.*;
import flash.text.*;
public class AmmoItem extends MovieClip {
protected var _data_can:CannonParameters;
public var cnt:TextField;
protected var _clip:MovieClip;
public var cl:MovieClip;
protected var bar:ProgressBar;
protected var _data_ball:CannonBallInfo;
protected var _count:int;
protected var _count_cnt:TextField;
public function AmmoItem(){
_count_cnt = (this.getChildByName("cnt") as TextField);
_clip = (this.getChildByName("cl") as MovieClip);
if (_clip.getChildByName("br")){
bar = new ProgressBar((_clip.getChildByName("br") as MovieClip));
};
}
public function set count(_arg1:int):void{
_count = _arg1;
_count_cnt.text = _count.toString();
this.visible = (_count > 0);
}
public function get cannonData():CannonParameters{
return (_data_can);
}
public function initAsCannon(_arg1:int, _arg2:CannonParameters):void{
_data_can = _arg2;
if (!_data_can){
this.visible = false;
} else {
_clip.gotoAndStop((_data_can.index + 1));
if (bar){
bar.progress = _arg1;
};
};
}
public function takeFrom():void{
_clip.alpha = 0.5;
_count_cnt.alpha = 0.5;
}
public function get count():int{
return (_count);
}
public function get ballData():CannonBallInfo{
return (_data_ball);
}
public function refresh():void{
_clip.alpha = 1;
_count_cnt.alpha = 1;
}
public function init(_arg1:int, _arg2:CannonBallInfo):void{
this.count = _arg1;
_data_ball = _arg2;
_clip.gotoAndStop((_data_ball.index + 1));
}
}
}//package windows.shop
Section 138
//AmmoPage (windows.shop.AmmoPage)
package windows.shop {
import flash.display.*;
import flash.events.*;
import game.save.*;
import gamelibrary.*;
import profile.*;
import controls.*;
import engine.utils.*;
import flash.text.*;
import windows.*;
public class AmmoPage extends BasicShopPage {
private var active_items:Array;
private var ammo_for_replace:AmmoItem;
public var bar:MovieClip;
private var select_bar:SelectBar;
private var dragged_clip:MovieClip;
private var current_item_data:CannonBallInfo;
public var dragged:MovieClip;
public var position0:AmmoItem;
public var position1:AmmoItem;
public var position2:AmmoItem;
public var position3:AmmoItem;
private var ammo_for_cell:AmmoItem;
private var money_cnt:TextField;
private var click_timer:int;
private var is_dragged:int;// = 0
public function AmmoPage(){
var _local1:int;
var _local3:ShopIcon;
var _local4:CannonBallInfo;
var _local5:AmmoItem;
super();
select_bar = new SelectBar((this.getChildByName("bar") as MovieClip), 11);
var _local2:int = select_bar.itemClips.length;
_local1 = 0;
while (_local1 < _local2) {
select_bar.initItemData(_local1, GameConsts.getBallParamsByIndex(_local1));
_local3 = select_bar.itemClips[_local1];
_local4 = (_local3.data as CannonBallInfo);
_local3.setPrice(_local4.price);
_local1++;
};
active_items = [];
_local1 = 0;
while (_local1 < 4) {
_local5 = (this.getChildByName(("position" + _local1)) as AmmoItem);
active_items.push(_local5);
_local1++;
};
dragged_clip = (this.getChildByName("dragged") as MovieClip);
dragged_clip.visible = false;
current_item_data = null;
is_dragged = 0;
this.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler);
this.addEventListener(MouseEvent.MOUSE_UP, mouseUpHandler);
this.addEventListener(MouseEvent.ROLL_OUT, mouseRollOutHandler);
}
private function splitAmmo(_arg1:AmmoItem, _arg2:AmmoItem):void{
var _local3:int = active_items.indexOf(_arg1);
var _local4:int = active_items.indexOf(_arg2);
var _local5:SplitAmmoScreen = new SplitAmmoScreen(Math.min(_local3, _local4), Math.max(_local3, _local4), _local4);
this.addChild(_local5);
_local5.y = -90;
blocked = true;
}
override public function destroy():void{
var _local1:int;
var _local2:int = select_bar.itemClips.length;
select_bar.destroy();
this.removeEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler);
this.removeEventListener(MouseEvent.MOUSE_UP, mouseUpHandler);
this.removeEventListener(MouseEvent.ROLL_OUT, mouseRollOutHandler);
}
private function mouseUpHandler(_arg1:MouseEvent):void{
var _local2:int;
var _local3:AmmoItem;
if (_blocked){
return;
};
if (click_timer < 5){
if (current_item_data){
showInfo(current_item_data);
dropFailed();
};
return;
};
if (is_dragged == 0){
return;
};
if (is_dragged == 1){
_local2 = 0;
while (_local2 < active_items.length) {
_local3 = active_items[_local2];
if (_local3.hitTestObject(dragged_clip)){
dropForBuy(_local3);
return;
};
_local2++;
};
};
if ((((is_dragged == -1)) && (ammo_for_cell))){
if (select_bar.clip.getBounds(this).contains(this.mouseX, this.mouseY)){
dropForSell(ammo_for_cell);
} else {
_local2 = 0;
while (_local2 < active_items.length) {
_local3 = active_items[_local2];
if (((!((_local3 == ammo_for_cell))) && (_local3.hitTestObject(dragged_clip)))){
if ((((_local3.ballData.index == ammo_for_cell.ballData.index)) || ((_local3.count == 0)))){
splitAmmo(_local3, ammo_for_cell);
} else {
swapAmmoItems(_local3, ammo_for_cell);
};
break;
};
_local2++;
};
};
};
dropFailed();
}
private function showInfo(_arg1:Object):void{
var _local2:ItemInfoWnd = new ItemInfoWnd();
this.addChild(_local2);
_local2.y = -90;
_local2.init(_arg1);
blocked = true;
}
private function dropFailed():void{
var _local2:AmmoItem;
var _local1:int;
while (_local1 < active_items.length) {
_local2 = active_items[_local1];
_local2.refresh();
_local1++;
};
is_dragged = 0;
dragged_clip.stopDrag();
dragged_clip.visible = false;
}
override public function set blocked(_arg1:Boolean):void{
super.blocked = _arg1;
init();
}
public function replaceAmmo():void{
var _local1:int = active_items.indexOf(ammo_for_replace);
var _local2:int = ammo_for_replace.count;
ProfileManager.getInstance().currentProfile.rounds[_local1].count = 0;
ProfileManager.getInstance().currentProfile.money = (ProfileManager.getInstance().currentProfile.money + (_local2 * ammo_for_replace.ballData.price));
var _local3:BuyScreen = new BuyScreen(current_item_data, _local1);
this.addChild(_local3);
_local3.y = -90;
blocked = true;
}
private function mouseDownHandler(_arg1:MouseEvent):void{
var _local4:AmmoItem;
if (_blocked){
return;
};
if (select_bar.left_btn.clip.getBounds(this).contains(this.mouseX, this.mouseY)){
select_bar.leftClickHandler(null);
return;
};
if (select_bar.right_btn.clip.getBounds(this).contains(this.mouseX, this.mouseY)){
select_bar.rightClickHandler(null);
return;
};
click_timer = 0;
var _local2:int;
while (_local2 < active_items.length) {
_local4 = active_items[_local2];
if (!ProfileManager.getInstance().currentProfile.rounds[_local2]){
} else {
if (_local4.getBounds(this).contains(this.mouseX, this.mouseY)){
dragged_clip.x = this.mouseX;
dragged_clip.y = this.mouseY;
dragged_clip.visible = true;
dragged_clip.startDrag(true);
current_item_data = _local4.ballData;
(dragged_clip.getChildByName("clip") as MovieClip).gotoAndStop((current_item_data.index + 1));
ammo_for_cell = _local4;
_local4.takeFrom();
is_dragged = -1;
return;
};
};
_local2++;
};
var _local3:ShopIcon = select_bar.getItemUnderPoint(this.mouseX, this.mouseY, this);
if (_local3){
dragged_clip.x = this.mouseX;
dragged_clip.y = this.mouseY;
dragged_clip.visible = true;
dragged_clip.startDrag(true);
current_item_data = (_local3.data as CannonBallInfo);
(dragged_clip.getChildByName("clip") as MovieClip).gotoAndStop((current_item_data.index + 1));
is_dragged = 1;
return;
};
}
override public function enterFrameHandler():void{
super.enterFrameHandler();
click_timer++;
if (click_timer > 10000){
click_timer = 100;
};
}
private function dropForBuy(_arg1:AmmoItem):void{
var _local2:BuyScreen;
if ((((_arg1.count == 0)) || ((_arg1.ballData.type == current_item_data.type)))){
_local2 = new BuyScreen(current_item_data, active_items.indexOf(_arg1));
this.addChild(_local2);
_local2.y = -90;
blocked = true;
} else {
ammo_for_replace = _arg1;
(this.parent as ShopWnd).askForReplaceAmmo();
};
dropFailed();
}
override public function init(... _args):void{
var _local3:int;
var _local4:int;
var _local7:AmmoItem;
var _local8:SaveRoundsData;
var _local9:ShopIcon;
var _local10:CannonBallInfo;
if (((_args) && (_args[0]))){
this.money_cnt = _args[0];
};
var _local2:int = ProfileManager.getInstance().currentProfile.money;
money_cnt.text = Utils.intToString(_local2, 5);
var _local5:Array = ProfileManager.getInstance().currentProfile.rounds;
_local3 = 0;
while (_local3 < active_items.length) {
_local7 = active_items[_local3];
_local8 = _local5[_local3];
if (_local8){
_local7.init(_local8.count, GameConsts.getBallParamsByIndex(_local8.index));
} else {
_local7.init(0, GameConsts.getBallParamsByIndex(0));
};
_local3++;
};
var _local6:int = ProfileManager.getInstance().currentProfile.currentLevel;
_local4 = select_bar.itemClips.length;
_local3 = 0;
while (_local3 < _local4) {
_local9 = select_bar.itemClips[_local3];
_local10 = (_local9.data as CannonBallInfo);
if (_local10.need_level <= (_local6 - 2)){
select_bar.showItem(_local3);
};
_local9.clip.alpha = ((_local2)>=(_local9.data as CannonBallInfo).price) ? 1 : 0.5;
_local3++;
};
}
private function dropForSell(_arg1:AmmoItem):void{
var _local2:SellScreen = new SellScreen(current_item_data, active_items.indexOf(_arg1));
this.addChild(_local2);
_local2.y = -90;
blocked = true;
ammo_for_cell = null;
dropFailed();
}
private function mouseRollOutHandler(_arg1:MouseEvent):void{
mouseUpHandler(null);
}
private function swapAmmoItems(_arg1:AmmoItem, _arg2:AmmoItem):void{
var _local3:int = active_items.indexOf(_arg1);
var _local4:int = active_items.indexOf(_arg2);
var _local5:SaveRoundsData = ProfileManager.getInstance().currentProfile.rounds[_local3];
var _local6:SaveRoundsData = ProfileManager.getInstance().currentProfile.rounds[_local4];
var _local7:SaveRoundsData = (_local5) ? _local5.clone() : null;
var _local8:SaveRoundsData = (_local6) ? _local6.clone() : null;
ProfileManager.getInstance().currentProfile.rounds[_local3] = _local8;
ProfileManager.getInstance().currentProfile.rounds[_local4] = _local7;
init();
}
}
}//package windows.shop
Section 139
//BasicShopPage (windows.shop.BasicShopPage)
package windows.shop {
import flash.display.*;
import gamelibrary.*;
public class BasicShopPage extends MovieClip {
protected var taget_x:Number;
private var current_index:int;
protected var _blocked:Boolean;// = false
private var direction:int;
private static const DELTA_X:Number = 64;
public function set startIndex(_arg1:int):void{
current_index = _arg1;
this.y = 90;
taget_x = (PiratesL.SCREEN_WIDTH * current_index);
this.x = taget_x;
}
public function destroy():void{
}
public function moveLeft():void{
current_index--;
taget_x = (PiratesL.SCREEN_WIDTH * current_index);
direction = -1;
}
public function moveRight():void{
current_index++;
taget_x = (PiratesL.SCREEN_WIDTH * current_index);
direction = 1;
}
public function set blocked(_arg1:Boolean):void{
_blocked = _arg1;
}
public function enterFrameHandler():void{
if (this.x == taget_x){
return;
};
this.x = (this.x + (direction * DELTA_X));
}
public function init(... _args):void{
}
}
}//package windows.shop
Section 140
//CannonItem (windows.shop.CannonItem)
package windows.shop {
import flash.display.*;
import gamelibrary.*;
import engine.controls.*;
public class CannonItem extends MovieClip {
public var cl:MovieClip;
protected var _clip:MovieClip;
public var br:MovieClip;
protected var bar:ProgressBar;
protected var _count:int;
protected var _data_can:CannonParameters;
public function CannonItem(){
_clip = (this.getChildByName("cl") as MovieClip);
if (this.getChildByName("br")){
bar = new ProgressBar((this.getChildByName("br") as MovieClip));
};
}
public function get cannonData():CannonParameters{
return (_data_can);
}
public function takeFrom():void{
_clip.alpha = 0.5;
}
public function get count():int{
return (_count);
}
public function refresh():void{
_clip.alpha = 1;
}
public function initAsCannon(_arg1:int, _arg2:CannonParameters):void{
_data_can = _arg2;
if (!_data_can){
this.visible = false;
} else {
this.visible = true;
_clip.gotoAndStop((_data_can.index + 1));
if (bar){
bar.progress = (((_arg2.num_shots - _arg1) / _arg2.num_shots) * 100);
};
};
}
}
}//package windows.shop
Section 141
//CannonPage (windows.shop.CannonPage)
package windows.shop {
import flash.display.*;
import flash.events.*;
import game.save.*;
import gamelibrary.*;
import profile.*;
import controls.*;
import engine.utils.*;
import flash.text.*;
import windows.*;
public class CannonPage extends BasicShopPage {
private var active_items:Array;
public var bar:MovieClip;
private var select_bar:SelectBar;
public var dragged:MovieClip;
private var cannon_for_cell:CannonItem;
private var dragged_clip:MovieClip;
private var current_item_data:CannonParameters;
private var fisrt_time:Boolean;// = false
public var position0:CannonItem;
public var position1:CannonItem;
public var position2:CannonItem;
public var position3:CannonItem;
private var click_timer:int;
private var money_cnt:TextField;
private var cannon_for_replace:CannonItem;
private var is_dragged:int;// = 0
public function CannonPage(){
var _local1:int;
var _local3:ShopIcon;
var _local4:CannonParameters;
var _local5:CannonItem;
super();
select_bar = new SelectBar((this.getChildByName("bar") as MovieClip), 4);
var _local2:int = select_bar.itemClips.length;
_local1 = 0;
while (_local1 < _local2) {
select_bar.initItemData(_local1, GameConsts.getCannonParams(_local1));
_local3 = select_bar.itemClips[_local1];
_local4 = (_local3.data as CannonParameters);
_local3.setPrice(_local4.price);
_local1++;
};
active_items = [];
_local1 = 0;
while (_local1 < 4) {
_local5 = (this.getChildByName(("position" + _local1)) as CannonItem);
active_items.push(_local5);
_local1++;
};
dragged_clip = (this.getChildByName("dragged") as MovieClip);
dragged_clip.visible = false;
current_item_data = null;
is_dragged = 0;
this.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler);
this.addEventListener(MouseEvent.MOUSE_UP, mouseUpHandler);
this.addEventListener(MouseEvent.ROLL_OUT, mouseRollOutHandler);
}
override public function destroy():void{
var _local1:int;
var _local2:int = select_bar.itemClips.length;
select_bar.destroy();
this.removeEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler);
this.removeEventListener(MouseEvent.MOUSE_UP, mouseUpHandler);
this.removeEventListener(MouseEvent.ROLL_OUT, mouseRollOutHandler);
}
private function mouseUpHandler(_arg1:MouseEvent):void{
var _local2:int;
var _local3:CannonItem;
if (_blocked){
return;
};
if (click_timer < 5){
if (current_item_data){
showInfo(current_item_data);
dropFailed();
};
return;
};
if (is_dragged == 0){
return;
};
if (is_dragged == 1){
_local2 = 0;
while (_local2 < active_items.length) {
_local3 = active_items[_local2];
if (_local3.hitTestObject(dragged_clip)){
dropForBuy(_local3, current_item_data);
return;
};
_local2++;
};
};
if ((((is_dragged == -1)) && (cannon_for_cell))){
if (select_bar.clip.getBounds(this).contains(this.mouseX, this.mouseY)){
dropForSell(cannon_for_cell);
} else {
_local2 = 0;
while (_local2 < active_items.length) {
_local3 = active_items[_local2];
if (((!((_local3 == cannon_for_cell))) && (_local3.hitTestObject(dragged_clip)))){
swapCannonItems(_local3, cannon_for_cell);
break;
};
_local2++;
};
};
};
dropFailed();
}
private function showInfo(_arg1:Object):void{
var _local2:ItemInfoWnd = new ItemInfoWnd();
this.addChild(_local2);
_local2.y = -90;
_local2.init(_arg1);
blocked = true;
}
private function dropFailed():void{
var _local2:CannonItem;
var _local1:int;
while (_local1 < active_items.length) {
_local2 = active_items[_local1];
_local2.refresh();
_local1++;
};
is_dragged = 0;
dragged_clip.stopDrag();
dragged_clip.visible = false;
}
public function replaceCannon():void{
var _local1:int = active_items.indexOf(cannon_for_replace);
var _local2:SaveCannonData = ProfileManager.getInstance().currentProfile.cannons[_local1];
var _local3:int = ((cannon_for_replace.cannonData.repair_price * (cannon_for_replace.cannonData.num_shots - _local2.shots_count)) / cannon_for_replace.cannonData.num_shots);
ProfileManager.getInstance().currentProfile.cannons[_local1] = new SaveCannonData(current_item_data.index, 0, [], []);
ProfileManager.getInstance().currentProfile.money = (ProfileManager.getInstance().currentProfile.money + _local3);
ProfileManager.getInstance().currentProfile.money = (ProfileManager.getInstance().currentProfile.money - current_item_data.price);
init();
}
override public function set blocked(_arg1:Boolean):void{
super.blocked = _arg1;
init();
}
private function mouseDownHandler(_arg1:MouseEvent):void{
var _local4:CannonItem;
if (_blocked){
return;
};
click_timer = 0;
var _local2:int;
while (_local2 < active_items.length) {
_local4 = active_items[_local2];
if (_local4.cannonData == null){
} else {
if (_local4.getBounds(this).contains(this.mouseX, this.mouseY)){
dragged_clip.x = this.mouseX;
dragged_clip.y = this.mouseY;
dragged_clip.visible = true;
dragged_clip.startDrag(true);
current_item_data = _local4.cannonData;
(dragged_clip.getChildByName("clip") as MovieClip).gotoAndStop((current_item_data.index + 1));
cannon_for_cell = _local4;
_local4.takeFrom();
is_dragged = -1;
return;
};
};
_local2++;
};
var _local3:ShopIcon = select_bar.getItemUnderPoint(this.mouseX, this.mouseY, this, true);
if (_local3){
if (_local3.clip.alpha == 1){
dragged_clip.x = this.mouseX;
dragged_clip.y = this.mouseY;
dragged_clip.visible = true;
dragged_clip.startDrag(true);
current_item_data = (_local3.data as CannonParameters);
(dragged_clip.getChildByName("clip") as MovieClip).gotoAndStop((current_item_data.index + 1));
is_dragged = 1;
} else {
showInfo(_local3.data);
};
return;
};
}
override public function enterFrameHandler():void{
super.enterFrameHandler();
click_timer++;
if (click_timer > 10000){
click_timer = 100;
};
}
private function dropForBuy(_arg1:CannonItem, _arg2:CannonParameters):void{
var _local3:int;
if (!_arg1.visible){
_local3 = active_items.indexOf(_arg1);
ProfileManager.getInstance().currentProfile.cannons[_local3] = new SaveCannonData(_arg2.index, 0, [], []);
ProfileManager.getInstance().currentProfile.money = (ProfileManager.getInstance().currentProfile.money - _arg2.price);
init();
} else {
cannon_for_replace = _arg1;
(this.parent as ShopWnd).askForReplaceCannon();
};
dropFailed();
}
override public function init(... _args):void{
var _local3:int;
var _local4:int;
var _local7:CannonItem;
var _local8:SaveCannonData;
var _local9:ShopIcon;
var _local10:CannonParameters;
if (((_args) && (_args[0]))){
this.money_cnt = _args[0];
};
var _local2:int = ProfileManager.getInstance().currentProfile.money;
money_cnt.text = Utils.intToString(_local2, 5);
var _local5:Array = ProfileManager.getInstance().currentProfile.cannons;
_local3 = 0;
while (_local3 < active_items.length) {
_local7 = active_items[_local3];
_local8 = _local5[_local3];
if (_local8){
_local7.initAsCannon(_local8.shots_count, GameConsts.getCannonParams(_local8.index));
} else {
_local7.initAsCannon(0, null);
};
_local3++;
};
var _local6:int = ProfileManager.getInstance().currentProfile.currentLevel;
_local4 = select_bar.itemClips.length;
_local3 = 0;
while (_local3 < _local4) {
_local9 = select_bar.itemClips[_local3];
_local10 = (_local9.data as CannonParameters);
select_bar.showItem(_local3);
_local9.clip.alpha = 1;
if (_local2 < (_local9.data as CannonParameters).price){
_local9.clip.alpha = 0.5;
};
if (ProfileManager.getInstance().currentProfile.shipLevelIndex < (_local9.data as CannonParameters).need_level){
_local9.clip.alpha = 0.5;
};
_local3++;
};
}
private function swapCannonItems(_arg1:CannonItem, _arg2:CannonItem):void{
var _local3:int = active_items.indexOf(_arg1);
var _local4:int = active_items.indexOf(_arg2);
var _local5:SaveCannonData = ProfileManager.getInstance().currentProfile.cannons[_local3];
var _local6:SaveCannonData = ProfileManager.getInstance().currentProfile.cannons[_local4];
var _local7:SaveCannonData = (_local5) ? _local5.clone() : null;
var _local8:SaveCannonData = (_local6) ? _local6.clone() : null;
ProfileManager.getInstance().currentProfile.cannons[_local3] = _local8;
ProfileManager.getInstance().currentProfile.cannons[_local4] = _local7;
init();
}
private function dropForSell(_arg1:CannonItem):void{
var _local2:SellCannonScreen = new SellCannonScreen(current_item_data, active_items.indexOf(cannon_for_cell));
this.addChild(_local2);
_local2.y = -90;
blocked = true;
cannon_for_cell = null;
dropFailed();
}
private function mouseRollOutHandler(_arg1:MouseEvent):void{
mouseUpHandler(null);
}
}
}//package windows.shop
Section 142
//ShipPage (windows.shop.ShipPage)
package windows.shop {
import flash.display.*;
import flash.events.*;
import gamelibrary.*;
import profile.*;
import engine.utils.*;
import flash.text.*;
import engine.controls.buttons.*;
public class ShipPage extends BasicShopPage {
private var upgrade_btn:TextButton;
private var money_cnt:TextField;
private var cur_ship_level:ShipLevelInfo;
private var last_level:Boolean;// = false
public var upgrade:MovieClip;
public var rep:MovieClip;
private var fisrt_time:Boolean;// = false
private var next_ship_level:ShipLevelInfo;
private var repair_btn:TextButton;
public var ln1:TextField;
public var ln2:TextField;
public var ln3:TextField;
public var ln5:TextField;
public var ln6:TextField;
private var repait_points_btn:TextButton;
public var ln4:TextField;
public var rp:MovieClip;
public function ShipPage(){
repair_btn = new TextButton((this.getChildByName("rep") as MovieClip));
repait_points_btn = new TextButton((this.getChildByName("rp") as MovieClip));
upgrade_btn = new TextButton((this.getChildByName("upgrade") as MovieClip));
repait_points_btn.clip.addEventListener(MouseEvent.CLICK, buyPointsClick);
upgrade_btn.clip.addEventListener(MouseEvent.CLICK, updradeClick);
repair_btn.clip.addEventListener(MouseEvent.CLICK, repairClick);
}
override public function destroy():void{
upgrade_btn.clip.removeEventListener(MouseEvent.CLICK, updradeClick);
upgrade_btn.destroy();
repair_btn.clip.removeEventListener(MouseEvent.CLICK, repairClick);
repair_btn.destroy();
repait_points_btn.clip.removeEventListener(MouseEvent.CLICK, buyPointsClick);
repait_points_btn.destroy();
}
private function repairClick(_arg1:MouseEvent):void{
var _local2:int;
var _local3:int;
if (repair_btn.enable){
_local2 = (cur_ship_level.max_condition - ProfileManager.getInstance().currentProfile.shipState);
_local3 = Math.min(_local2, ProfileManager.getInstance().currentProfile.money);
ProfileManager.getInstance().currentProfile.shipState = (ProfileManager.getInstance().currentProfile.shipState + _local3);
ProfileManager.getInstance().currentProfile.money = (ProfileManager.getInstance().currentProfile.money - _local3);
init();
};
}
override public function init(... _args):void{
if (((_args) && (_args[0]))){
this.money_cnt = _args[0];
};
var _local2:Profile = ProfileManager.getInstance().currentProfile;
money_cnt.text = Utils.intToString(_local2.money, 5);
var _local3:int = _local2.shipLevelIndex;
cur_ship_level = GameConsts.getShipLevelInfo(_local3);
(this.getChildByName("ln1") as TextField).text = ("Ship level: " + (_local3 + 1));
(this.getChildByName("ln2") as TextField).text = ((("Condition: " + _local2.shipState) + " of ") + cur_ship_level.max_condition);
(this.getChildByName("ln3") as TextField).text = ((("Reapir points: " + _local2.repairPoints) + " of ") + cur_ship_level.max_repair_points);
next_ship_level = GameConsts.getShipLevelInfo((_local3 + 1));
if (next_ship_level == null){
(this.getChildByName("ln4") as TextField).text = "";
(this.getChildByName("ln5") as TextField).text = "";
(this.getChildByName("ln6") as TextField).text = "";
} else {
(this.getChildByName("ln4") as TextField).text = ("Next ship level: " + (_local3 + 2));
(this.getChildByName("ln5") as TextField).text = ("Maximum condition: " + next_ship_level.max_condition);
(this.getChildByName("ln6") as TextField).text = ("Max. repair points: " + next_ship_level.max_repair_points);
};
repait_points_btn.caption = cur_ship_level.repair_points_price.toString();
repait_points_btn.enable = (((_local2.money >= cur_ship_level.repair_points_price)) && ((_local2.repairPoints < cur_ship_level.max_repair_points)));
(repait_points_btn.clip.getChildByName("pr") as TextField).text = repait_points_btn.caption;
var _local4:int = (cur_ship_level.max_condition - _local2.shipState);
repair_btn.caption = ((_local4)==0) ? "N/A" : _local4.toString();
repair_btn.enable = (_local4 > 0);
if (next_ship_level){
upgrade_btn.caption = next_ship_level.price.toString();
upgrade_btn.enable = (_local2.money >= next_ship_level.price);
} else {
upgrade_btn.caption = cur_ship_level.price.toString();
upgrade_btn.enable = false;
};
}
private function updradeClick(_arg1:MouseEvent):void{
if (upgrade_btn.enable){
ProfileManager.getInstance().currentProfile.money = (ProfileManager.getInstance().currentProfile.money - next_ship_level.price);
ProfileManager.getInstance().currentProfile.shipLevelIndex++;
ProfileManager.getInstance().currentProfile.shipState = GameConsts.getShipLevelInfo(ProfileManager.getInstance().currentProfile.shipLevelIndex).max_condition;
init();
};
}
private function buyPointsClick(_arg1:MouseEvent):void{
var _local2:int;
var _local3:int;
var _local4:int;
var _local5:int;
if (repait_points_btn.enable){
_local2 = ProfileManager.getInstance().currentProfile.repairPoints;
_local3 = (cur_ship_level.max_repair_points - _local2);
_local4 = Math.floor((ProfileManager.getInstance().currentProfile.money / cur_ship_level.repair_points_price));
_local5 = Math.min(_local3, _local4);
ProfileManager.getInstance().currentProfile.money = (ProfileManager.getInstance().currentProfile.money - _local5);
ProfileManager.getInstance().currentProfile.repairPoints = (ProfileManager.getInstance().currentProfile.repairPoints + _local5);
init();
};
}
}
}//package windows.shop
Section 143
//ShopHeader (windows.shop.ShopHeader)
package windows.shop {
import flash.display.*;
import flash.events.*;
import tutorial.*;
import flash.utils.*;
public class ShopHeader extends MovieClip {
private var target_frame:int;
private var current_index:int;
private var is_stop:Boolean;// = false
private static const FRAMES:Array = [1, 10, 20];
public function ShopHeader(){
this.stop();
this.addEventListener(Event.ENTER_FRAME, enterFrameHadler);
}
public function set startIndex(_arg1:int):void{
current_index = _arg1;
target_frame = FRAMES[current_index];
this.gotoAndStop(target_frame);
}
private function enterFrameHadler(_arg1:Event):void{
if (this.currentFrame > target_frame){
this.prevFrame();
};
if (this.currentFrame < target_frame){
this.nextFrame();
};
if ((((currentFrame == target_frame)) && (!(is_stop)))){
setTimeout(stopHandler, 200);
};
}
private function stopHandler():void{
if ((((currentFrame == target_frame)) && (!(is_stop)))){
is_stop = true;
if (current_index == 1){
TutorialManager.getInstance().notifyEvent("enterCannon(1)");
};
if (current_index == 2){
TutorialManager.getInstance().notifyEvent("enterShip(1)");
};
};
}
public function moveRight():void{
current_index++;
target_frame = FRAMES[current_index];
is_stop = false;
}
public function destroy():void{
this.removeEventListener(Event.ENTER_FRAME, enterFrameHadler);
}
public function moveLeft():void{
current_index--;
target_frame = FRAMES[current_index];
is_stop = false;
}
}
}//package windows.shop
Section 144
//ShopIcon (windows.shop.ShopIcon)
package windows.shop {
import flash.display.*;
import flash.events.*;
import flash.text.*;
public class ShopIcon extends EventDispatcher {
public var clip:MovieClip;
private var cap:TextField;
public var data:Object;
public function ShopIcon(_arg1:MovieClip, _arg2:Object){
this.clip = _arg1;
if (this.clip){
this.clip.addEventListener(MouseEvent.CLICK, clickHandler);
};
this.data = _arg2;
cap = (this.clip.getChildByName("_cap") as TextField);
}
public function destroy():void{
if (this.clip){
this.clip.removeEventListener(MouseEvent.CLICK, clickHandler);
};
}
private function clickHandler(_arg1:MouseEvent):void{
dispatchEvent(new MouseEvent(MouseEvent.CLICK));
}
public function setPrice(_arg1:int):void{
if (!cap){
return;
};
if (_arg1 == 0){
cap.text = "Free";
} else {
cap.text = _arg1.toString();
};
}
}
}//package windows.shop
Section 145
//BuyScreen (windows.BuyScreen)
package windows {
import flash.display.*;
import flash.events.*;
import game.save.*;
import gamelibrary.*;
import profile.*;
import windows.shop.*;
import controls.*;
import tutorial.*;
import engine.controls.events.*;
import sound.*;
import flash.text.*;
public class BuyScreen extends MovieClip {
private var ammo_value:TextField;
public var coins:MovieClip;
private var r_index:int;
private var _info:CannonBallInfo;
public var ammo:MovieClip;
private var money_count:int;
private var cancel_btn:MenuTextButton;
public var ok:MovieClip;
private var ammo_count:int;
private var slider:Slider;
public var sld:Slider;
private var ammo_clip:MovieClip;
public var hdr:TextField;
private var ok_btn:MenuTextButton;
public var cancel:MovieClip;
private var coins_value:TextField;
public function BuyScreen(_arg1:CannonBallInfo, _arg2:int){
r_index = _arg2;
_info = _arg1;
cancel_btn = new MenuTextButton((this.getChildByName("cancel") as MovieClip));
ok_btn = new MenuTextButton((this.getChildByName("ok") as MovieClip));
slider = (this.getChildByName("sld") as Slider);
slider.addEventListener(ControlEvent.UPDATE, changeSlider);
slider.value = 50;
coins_value = ((this.getChildByName("coins") as MovieClip).getChildByName("cnt") as TextField);
ammo_value = ((this.getChildByName("ammo") as MovieClip).getChildByName("cnt") as TextField);
ammo_clip = ((this.getChildByName("ammo") as MovieClip).getChildByName("clip") as MovieClip);
ammo_clip.gotoAndStop((_arg1.index + 1));
cancel_btn.caption = "Cancel";
ok_btn.caption = "Ok";
cancel_btn.clip.addEventListener(MouseEvent.CLICK, cancelClickHandler);
ok_btn.clip.addEventListener(MouseEvent.CLICK, okClickHandler);
divice(50);
}
private function cancelClickHandler(_arg1:MouseEvent):void{
SoundManager.playSound("click");
cancel_btn.clip.removeEventListener(MouseEvent.CLICK, cancelClickHandler);
ok_btn.clip.removeEventListener(MouseEvent.CLICK, okClickHandler);
cancel_btn.destroy();
ok_btn.destroy();
(this.parent as BasicShopPage).blocked = false;
if (this.parent){
this.parent.removeChild(this);
};
}
private function okClickHandler(_arg1:MouseEvent):void{
SoundManager.playSound("buy");
cancel_btn.clip.removeEventListener(MouseEvent.CLICK, cancelClickHandler);
ok_btn.clip.removeEventListener(MouseEvent.CLICK, okClickHandler);
cancel_btn.destroy();
ok_btn.destroy();
var _local2:int = (ProfileManager.getInstance().currentProfile.rounds[r_index]) ? ProfileManager.getInstance().currentProfile.rounds[r_index].count : 0;
ProfileManager.getInstance().currentProfile.rounds[r_index] = new SaveRoundsData(_info.index, (_local2 + ammo_count));
ProfileManager.getInstance().currentProfile.money = (ProfileManager.getInstance().currentProfile.money - money_count);
(this.parent as BasicShopPage).blocked = false;
if (this.parent){
this.parent.removeChild(this);
};
TutorialManager.getInstance().notifyEvent("buyAmmo(1)");
}
private function divice(_arg1:int):void{
SoundManager.playSound("aim");
var _local2:int = ProfileManager.getInstance().currentProfile.money;
var _local3:int = _info.price;
var _local4:int = Math.min(200, ((_local3)==0) ? 200 : (_local2 / _local3));
ammo_count = ((_local4 * _arg1) / 100);
money_count = (ammo_count * _local3);
ammo_value.text = ammo_count.toString();
coins_value.text = money_count.toString();
}
private function changeSlider(_arg1:ControlEvent):void{
divice(Math.round(Number(_arg1.data)));
}
}
}//package windows
Section 146
//GameOverWnd (windows.GameOverWnd)
package windows {
import flash.geom.*;
import flash.events.*;
import profile.*;
import engine.windows.*;
import sound.*;
public class GameOverWnd extends Window {
public function GameOverWnd(_arg1:Rectangle=null){
addFrameScript(59, frame60);
super(_arg1);
ProfileManager.getInstance().currentProfile.restartLevel();
this.addEventListener(MouseEvent.CLICK, clickHandler);
}
private function clickHandler(_arg1:MouseEvent):void{
SoundManager.playSound("click");
dispatchEvent(new WindowEvent(WindowEvent.WIN_CLOSE));
}
function frame60(){
stop();
}
}
}//package windows
Section 147
//GameWnd (windows.GameWnd)
package windows {
import flash.geom.*;
import flash.display.*;
import gamelibrary.enemyship.*;
import flash.events.*;
import gamelibrary.*;
import profile.*;
import environment.*;
import game.*;
import controls.*;
import game.cannonball.*;
import tutorial.*;
import engine.windows.*;
import game.managment.*;
import sound.*;
import engine.controls.buttons.*;
public class GameWnd extends Window {
private var _islands_container:IslandsCotainer;
public var coins:CoinsCounter;
public var status:MovieClip;
public var tut:TutorialScreen;
public var water:MovieClip;
private var _water:MovieClip;
public var sky:MovieClip;
public var rounds1:CannonBallRounds;
public var rounds2:CannonBallRounds;
public var rounds3:CannonBallRounds;
public var rounds4:CannonBallRounds;
public var fire:MovieClip;
private var level_result:LevelResult;
public var boss_bar:MovieClip;
public var timer:MovieClip;
public var l1:MovieClip;
public var balls:MovieClip;
private var _sky:Sky;
public var dragged_layer:MovieClip;
private var cannon_manager:CannonManager;
private var game_field:GameField;
public var wavebar:WaveBar;
private var level_info:LevelInfo;
public var repair:MovieClip;
public var cannon_layer:MovieClip;
private var pause_btn:BasicButton;
public var gear:GearCounter;
private var ship_manager:ShipManager;
public var popup:SmallPopupWnd;
private var _popup:SmallPopupWnd;
public var pship:PlayerShip;
public var ships:MovieClip;
private var _tutorial:TutorialScreen;
private var _clouds_container:CloudsContainer;
private var logic_manager:LogicManager;
private var wave_bar:WaveBar;
public var clouds:MovieClip;
public var haze:MovieClip;
public var pause:MovieClip;
private var _pause:Boolean;// = false
public var wave:WaveBar;
public var islands:MovieClip;
public function GameWnd(_arg1:Rectangle=null){
super(_arg1);
_sky = new Sky((this.getChildByName("sky") as MovieClip), (this.getChildByName("timer") as MovieClip));
(this.getChildByName("status") as MovieClip).addEventListener(MouseEvent.CLICK, chit);
_water = (this.getChildByName("water") as MovieClip);
_clouds_container = new CloudsContainer((this.getChildByName("clouds") as MovieClip));
_clouds_container.initClouds(8);
_islands_container = new IslandsCotainer((this.getChildByName("islands") as MovieClip));
logic_manager = new LogicManager((this.getChildByName("repair") as MovieClip), (this.getChildByName("gear") as MovieClip), (this.getChildByName("status") as MovieClip), (this.getChildByName("pship") as MovieClip), (this.getChildByName("coins") as MovieClip), (this.getChildByName("fire") as MovieClip));
pause_btn = new BasicButton((this.getChildByName("pause") as MovieClip));
wave_bar = (this.getChildByName("wave") as WaveBar);
game_field = new GameField((this.getChildByName("ships") as Sprite), (this.getChildByName("balls") as Sprite));
ship_manager = new ShipManager(game_field, wave_bar, (this.getChildByName("boss_bar") as MovieClip));
cannon_manager = new CannonManager((this.getChildByName("cannon_layer") as Sprite), (this.getChildByName("dragged_layer") as Sprite));
var _local2 = 1;
while (_local2 <= 4) {
cannon_manager.addRounds(this.getChildByName(("rounds" + _local2)));
_local2++;
};
_tutorial = (this.getChildByName("tut") as TutorialScreen);
_tutorial.visible = false;
_popup = (this.getChildByName("popup") as SmallPopupWnd);
level_result = new LevelResult();
initListeners();
}
private function robEnemyHandler(_arg1:GameEvent):void{
logic_manager.notifyEnemyRob((_arg1.data as Array));
}
private function saveGame():void{
cannon_manager.save();
ship_manager.save();
ProfileManager.getInstance().currentProfile.current_time = _sky.getTime();
ProfileManager.getInstance().saveCurrentProfile(0);
}
private function enterFrameHandler(_arg1:Event):void{
if (paused){
return;
};
if (ship_manager){
ship_manager.enterFrameHandler();
};
if (game_field){
game_field.enterFrameHandler();
};
if (cannon_manager){
cannon_manager.enterFrameHandler();
};
if (_clouds_container){
_clouds_container.enterFrameHandler();
};
if (_islands_container){
_islands_container.enterFrameHandler();
};
if (logic_manager){
logic_manager.enterFrameHandler();
};
}
private function initListeners():void{
game_field.addEventListener(GameEvent.GET_HIT, getDamageHandler);
game_field.addEventListener(GameEvent.PUSH_BALL, pushBallHandler);
game_field.addEventListener(GameEvent.HIT_ENEMY, hitEnemyHandler);
game_field.addEventListener(GameEvent.ROB_ENEMY, robEnemyHandler);
game_field.addEventListener(GameEvent.FLAME_STOP, stopFire);
logic_manager.addEventListener(GameEvent.LEVEL_FAILED, levelFailedHandler);
ship_manager.addEventListener(GameEvent.LEVEL_COMPLETE, levelCompleteHandler);
ship_manager.addEventListener(GameEvent.LEVEL_FAILED, levelFailedHandler);
ship_manager.addEventListener(GameEvent.SUNK_ENEMY, sunkEnemyHandler);
ship_manager.addEventListener(GameEvent.BOSS_APPEAR, bossAppearHandler);
cannon_manager.addEventListener(GameEvent.MAKE_SHOT, makeShotHandler);
this.addEventListener(Event.ENTER_FRAME, enterFrameHandler);
pause_btn.clip.addEventListener(MouseEvent.CLICK, pauseClickHandler);
}
private function makeShotHandler(_arg1:GameEvent):void{
var _local2:Array = (_arg1.data as Array);
game_field.makeShoot(_local2[0], _local2[1], _local2[2]);
var _local3:int = ProfileManager.getInstance().currentProfile.total_shots_count;
TutorialManager.getInstance().notifyEvent((("make_shoot(" + _local3) + ")"));
ProfileManager.getInstance().currentProfile.total_shots_count++;
switch (_local2[1].index){
case 2:
SoundManager.playSound("out_monkey");
break;
case 3:
SoundManager.playSound("out_rum");
break;
default:
SoundManager.playSound("out_justball");
break;
};
SoundManager.playSound("ballfly");
}
private function levelFailedHandler(_arg1:GameEvent):void{
paused = true;
dispatchEvent(new WindowEvent(WindowEvent.WIN_CLOSE, [false]));
}
private function getDamageHandler(_arg1:GameEvent):void{
var _local2:Number = Number(_arg1.data[0]);
logic_manager.notifyShipHit(_local2, _arg1.data[1]);
cannon_manager.notifyHit(_arg1.data[1]);
switch (_arg1.data[1]){
case 2:
SoundManager.playSound("beat_monkey");
break;
case 7:
SoundManager.playSound("beat_flame");
break;
default:
SoundManager.playSound("shiphit");
break;
};
}
public function get paused():Boolean{
return (_pause);
}
private function chit(_arg1:MouseEvent):void{
if (PiratesL.CHITS_ON){
levelCompleteHandler(null);
};
}
private function stopFire(_arg1:GameEvent):void{
logic_manager.notifyStopFire();
}
public function initLevel(_arg1:int):void{
trace("----------- Level", _arg1, "-----------------");
level_info = ((_arg1)<2) ? GameConsts.getDemoAtIndex(_arg1) : GameConsts.getLevelAtIndex((_arg1 - 2));
ship_manager.init(level_info);
ship_manager.enable = (_arg1 >= 2);
logic_manager.init();
cannon_manager.init(level_info);
TutorialManager.getInstance().notifyEvent((("start(" + _arg1) + ")"));
if ((((_arg1 == 1)) && (TutorialManager.getInstance().isItemDone(51)))){
ship_manager.enable = true;
};
_islands_container.initIslands(level_info.islands_set);
_sky.setTime(ProfileManager.getInstance().currentProfile.current_time);
}
public function keyUp(_arg1:int):void{
game_field.keyUp(_arg1);
}
public function set paused(_arg1:Boolean):void{
if (_pause == _arg1){
return;
};
_pause = _arg1;
if (_pause){
_water.stop();
} else {
_water.play();
};
_sky.pause = _pause;
cannon_manager.paused = _pause;
game_field.paused = _pause;
}
public function closeTutorial(_arg1:int):void{
paused = false;
if (_tutorial.hide()){
if (((((_arg1) && ((level_info.index == 0)))) && ((_arg1 == 1)))){
_popup.show("Tutorial 1");
};
if (((((_arg1) && ((level_info.index == 1)))) && ((_arg1 == 3)))){
_popup.show("Tutorial 2");
};
};
if (((((_arg1) && ((level_info.index == 0)))) && ((_arg1 == 33)))){
ship_manager.enable = true;
};
if (((((_arg1) && ((level_info.index == 1)))) && ((_arg1 == 51)))){
ship_manager.enable = true;
};
if (((((_arg1) && ((_arg1 == 6)))) && ((level_info.index == 1)))){
ship_manager.restart();
};
if (((((_arg1) && ((_arg1 == 5)))) && ((level_info.index == 1)))){
levelCompleteHandler(null);
};
}
public function showTutorial(_arg1:TutorialItem):void{
paused = true;
_tutorial.show(_arg1, 1);
}
private function bossAppearHandler(_arg1:Event):void{
_popup.show("Boss!!!");
}
public function keyDown(_arg1:int):void{
game_field.keyDown(_arg1);
}
private function levelCompleteHandler(_arg1:GameEvent):void{
paused = true;
saveGame();
level_result.score = ProfileManager.getInstance().currentProfile.level_score;
level_result.total_ships = ship_manager.totalShipsCount;
level_result.cannon_shots = ProfileManager.getInstance().currentProfile.shots_count;
var _local2:Number = (ProfileManager.getInstance().currentProfile.num_good_hits / ProfileManager.getInstance().currentProfile.shots_count);
level_result.accurasy_bonus = Math.floor((_local2 * 100));
level_result.sunk_enemies = ProfileManager.getInstance().currentProfile.sunk_ships_count;
level_result.monkey = ProfileManager.getInstance().currentProfile.monkey_rob;
level_result.money = ProfileManager.getInstance().currentProfile.earned_money;
ProfileManager.getInstance().currentProfile.money = (ProfileManager.getInstance().currentProfile.money + (isNaN(_local2)) ? 0 : Math.floor((_local2 * 100)));
dispatchEvent(new WindowEvent(WindowEvent.WIN_CLOSE, [true, level_result]));
}
private function pauseClickHandler(_arg1:MouseEvent):void{
paused = !(paused);
SoundManager.playSound("pausebell");
saveGame();
dispatchEvent(new WindowEvent(WindowEvent.WIN_PAUSED, [true]));
}
private function pushBallHandler(_arg1:GameEvent):void{
logic_manager.addScore(GameConsts.score_per_push);
switch ((_arg1.data as CannonBallInfo).index){
case 2:
SoundManager.playSound("hit_monkey");
break;
case 7:
SoundManager.playSound("hit_flame");
break;
case 4:
SoundManager.playSound("hit_knippel");
break;
default:
SoundManager.playSound("hitcannonball");
break;
};
}
private function hitEnemyHandler(_arg1:GameEvent):void{
ProfileManager.getInstance().currentProfile.num_good_hits++;
}
private function sunkEnemyHandler(_arg1:GameEvent):void{
logic_manager.notifyEnemySank((_arg1.data as EnemyShipParameters));
}
override public function destroy():void{
this.removeEventListener(Event.ENTER_FRAME, enterFrameHandler);
pause_btn.clip.removeEventListener(MouseEvent.CLICK, pauseClickHandler);
game_field.removeEventListener(GameEvent.GET_HIT, getDamageHandler);
game_field.removeEventListener(GameEvent.HIT_ENEMY, hitEnemyHandler);
game_field.removeEventListener(GameEvent.ROB_ENEMY, robEnemyHandler);
game_field.removeEventListener(GameEvent.FLAME_STOP, stopFire);
game_field.destroy();
logic_manager.removeEventListener(GameEvent.LEVEL_FAILED, levelFailedHandler);
logic_manager.destroy();
ship_manager.removeEventListener(GameEvent.LEVEL_COMPLETE, levelCompleteHandler);
ship_manager.removeEventListener(GameEvent.LEVEL_FAILED, levelFailedHandler);
ship_manager.removeEventListener(GameEvent.SUNK_ENEMY, sunkEnemyHandler);
ship_manager.removeEventListener(GameEvent.BOSS_APPEAR, bossAppearHandler);
ship_manager.destroy();
cannon_manager.removeEventListener(GameEvent.MAKE_SHOT, makeShotHandler);
cannon_manager.destroy();
_sky.destroy();
_clouds_container.destroy();
_islands_container.destroy();
pause_btn.destroy();
}
}
}//package windows
Section 148
//HighresWnd (windows.HighresWnd)
package windows {
import flash.geom.*;
import flash.display.*;
import flash.events.*;
import profile.*;
import controls.*;
import engine.windows.*;
import sound.*;
import flash.text.*;
import engine.controls.buttons.*;
import windows.highres.*;
public class HighresWnd extends Window {
private var back_btn:MenuTextButton;
private var results:Array;
public var names:TextField;
private var header:HighresHeader;
private var scores_txt:TextField;
private var next_btn:BasicButton;
public var scores:TextField;
public var back:MovieClip;
private var current_page_index:int;// = 0
public var next:MovieClip;
public var hdr:HighresHeader;
private var names_txt:TextField;
public var prev:MovieClip;
private var prev_btn:BasicButton;
private static const DEFAULT:Array = [[["Emmy", 50000], ["Goodwin", 45000], ["Anny", 40000], ["Robbie", 35000], ["Kanny", 30000], ["Lucy", 25000], ["Vinnie", 20000]], [["Andrew", 50000], ["Jimmy", 45000], ["Steve", 40000], ["Eric", 35000], ["Bill", 30000], ["Kyle", 25000], ["Mila", 20000]], [["Gordon", 50000], ["Stan", 45000], ["George", 40000], ["Alex", 35000], ["Barnie", 30000], ["Timmy", 25000], ["Michael", 20000]], [["Eddie", 50000], ["Moses", 45000], ["Vasyl", 40000], ["Rusty", 35000], ["Mary", 30000], ["Ismaehl", 25000], ["Manu", 20000]]];
public function HighresWnd(_arg1:Rectangle=null){
var _local6:Profile;
var _local7:int;
var _local8:String;
var _local9:int;
super(_arg1);
header = (this.getChildByName("hdr") as HighresHeader);
next_btn = new BasicButton((this.getChildByName("next") as MovieClip));
next_btn.clip.addEventListener(MouseEvent.CLICK, nextClickHandler);
prev_btn = new BasicButton((this.getChildByName("prev") as MovieClip));
prev_btn.clip.addEventListener(MouseEvent.CLICK, prevClickHandler);
names_txt = (this.getChildByName("names") as TextField);
scores_txt = (this.getChildByName("scores") as TextField);
back_btn = new MenuTextButton((this.getChildByName("back") as MovieClip));
back_btn.caption = "Back";
back_btn.clip.addEventListener(MouseEvent.CLICK, backClickHandler);
current_page_index = 0;
initRes();
var _local2:Array = [[], [], [], []];
var _local3:int = ProfileManager.getInstance().profilesCount;
var _local4:int;
while (_local4 < _local3) {
_local6 = ProfileManager.getInstance().getProfileAt(_local4);
_local7 = _local6.gameDifficulty;
_local8 = _local6.playerName;
_local9 = _local6.score;
_local2[_local7].push([_local8, _local9]);
results[_local7].push({name:_local8, score:_local9});
_local4++;
};
trace(_local2);
var _local5:int;
while (_local5 < 4) {
(results[_local5] as Array).sortOn("score", (Array.DESCENDING | Array.NUMERIC));
_local5++;
};
updateButtons();
}
override public function destroy():void{
header.destroy();
back_btn.clip.removeEventListener(MouseEvent.CLICK, backClickHandler);
back_btn.destroy();
next_btn.clip.removeEventListener(MouseEvent.CLICK, nextClickHandler);
next_btn.destroy();
prev_btn.clip.removeEventListener(MouseEvent.CLICK, prevClickHandler);
prev_btn.destroy();
}
private function backClickHandler(_arg1:MouseEvent):void{
SoundManager.playSound("click");
this.dispatchEvent(new WindowEvent(WindowEvent.WIN_CLOSE));
}
private function initRes():void{
var _local2:int;
results = [];
var _local1:int;
while (_local1 < 4) {
results[_local1] = [];
_local2 = 0;
while (_local2 < 7) {
results[_local1].push({name:DEFAULT[_local1][_local2][0], score:DEFAULT[_local1][_local2][1]});
_local2++;
};
(results[_local1] as Array).sortOn("score", (Array.DESCENDING | Array.NUMERIC));
_local1++;
};
trace(results);
}
private function nextClickHandler(_arg1:MouseEvent):void{
if (current_page_index == 3){
return;
};
SoundManager.playSound("browse_shop");
current_page_index++;
header.moveRight();
updateButtons();
}
private function updateButtons():void{
next_btn.enable = (current_page_index < 3);
prev_btn.enable = (current_page_index > 0);
var _local1 = "";
var _local2 = "";
var _local3:int;
while (_local3 < 7) {
if (!results[current_page_index][_local3]){
break;
};
_local1 = (_local1 + ((((_local3 + 1) + " ") + results[current_page_index][_local3].name) + "\n"));
_local2 = (_local2 + (results[current_page_index][_local3].score + "\n"));
_local3++;
};
names_txt.text = _local1;
scores_txt.text = _local2;
}
private function prevClickHandler(_arg1:MouseEvent):void{
if (current_page_index == 0){
return;
};
SoundManager.playSound("browse_shop");
current_page_index--;
header.moveLeft();
updateButtons();
}
}
}//package windows
Section 149
//ItemInfoWnd (windows.ItemInfoWnd)
package windows {
import flash.display.*;
import flash.events.*;
import gamelibrary.*;
import engine.localization.*;
import windows.shop.*;
import controls.*;
import tutorial.*;
import sound.*;
import flash.text.*;
public class ItemInfoWnd extends MovieClip {
private var _image_ball:MovieClip;
private var _close_btn:MenuTextButton;
private var _image_cannon:MovieClip;
private var _text:TextField;
public var txt:TextField;
private var _header:TextField;
public var close:MovieClip;
public var img_cannon:MovieClip;
public var img_ball:MovieClip;
public var hdr:TextField;
public function ItemInfoWnd(){
_image_ball = (this.getChildByName("img_ball") as MovieClip);
_image_cannon = (this.getChildByName("img_cannon") as MovieClip);
_header = (this.getChildByName("hdr") as TextField);
_text = (this.getChildByName("txt") as TextField);
_close_btn = new MenuTextButton((this.getChildByName("close") as MovieClip));
_close_btn.caption = StringTable.getString("strClose");
_close_btn.clip.addEventListener(MouseEvent.CLICK, closeClickHandler);
}
private function closeClickHandler(_arg1:MouseEvent):void{
SoundManager.playSound("click");
_close_btn.clip.removeEventListener(MouseEvent.CLICK, closeClickHandler);
_close_btn.destroy();
(this.parent as BasicShopPage).blocked = false;
if (this.parent){
this.parent.removeChild(this);
};
TutorialManager.getInstance().notifyEvent("readAmmo(1)");
}
public function init(_arg1:Object):void{
var _local2:MovieClip;
_image_ball.visible = false;
_image_cannon.visible = false;
if ((_arg1 is CannonBallInfo)){
_local2 = _image_ball;
};
if ((_arg1 is CannonParameters)){
_local2 = _image_cannon;
};
_header.text = _arg1.display_name;
var _local3 = "";
var _local4:int;
while (_local4 < _arg1.info.length) {
_local3 = (_local3 + (_arg1.info[_local4] + "\n"));
_local4++;
};
_text.text = _local3;
if (_local2){
_local2.gotoAndStop((_arg1.index + 1));
_local2.visible = true;
};
}
}
}//package windows
Section 150
//LoaderWnd (windows.LoaderWnd)
package windows {
import flash.geom.*;
import utils.*;
import flash.display.*;
import flash.events.*;
import gamelibrary.*;
import engine.localization.*;
import engine.windows.*;
import engine.loader.*;
import config.*;
import flash.utils.*;
public class LoaderWnd extends Window {
public var preloader:MovieClip;
private var _preloader:MovieClip;
public function LoaderWnd(_arg1:Rectangle=null){
super(_arg1);
_preloader = (this.getChildByName("preloader") as MovieClip);
Point3D.initView(0, 0, 10000);
GameConsts.init();
if (((_preloader) && (this.rect))){
_preloader.x = ((this.rect.width - _preloader.width) / 2);
_preloader.y = ((this.rect.height - _preloader.height) / 2);
};
}
override protected function addToStageHandler(_arg1:Event):void{
setTimeout(completeLoadingHandler, 100, null);
}
private function completeLoadingHandler(_arg1:AssetsLoaderEvent):void{
StringTable.getInstance().init(StringXML.xml);
dispatchEvent(new WindowEvent(WindowEvent.WIN_CLOSE));
}
}
}//package windows
Section 151
//MainMenuWnd (windows.MainMenuWnd)
package windows {
import flash.geom.*;
import utils.*;
import flash.display.*;
import flash.events.*;
import gamelibrary.*;
import engine.localization.*;
import profile.*;
import engine.controls.events.*;
import engine.windows.*;
import sound.*;
import flash.text.*;
import preloader.*;
import windows.mainmenu.*;
public class MainMenuWnd extends Window {
public var more_games_link:MovieClip;
public var panel:MainMenuPanel;
private var _panel:MainMenuPanel;
public var flag:MovieClip;
private var _flag:MovieTileWrapper;
private var _welcom_txt:TextField;
public var link:MovieClip;
private var _ballon:MovieClip;
public var ballon:MovieClip;
public function MainMenuWnd(_arg1:Rectangle=null){
super(_arg1);
_flag = new MovieTileWrapper((this.getChildByName("flag") as MovieClip));
_flag.init(null, 2, 4, 8, 2);
_panel = (this.getChildByName("panel") as MainMenuPanel);
_panel.addEventListener(ControlEvent.SELECT_ITEM, panelSelectHandler);
_ballon = (this.getChildByName("ballon") as MovieClip);
if (_ballon){
_welcom_txt = (_ballon.getChildByName("caption") as TextField);
_ballon.addEventListener(MouseEvent.CLICK, ballonClickHandler);
};
}
private function ballonClickHandler(_arg1:MouseEvent):void{
if (MochiContainer.getInstance().isInLeaderBoard){
return;
};
SoundManager.playSound("click");
dispatchEvent(new WindowEvent(WindowEvent.WIN_CLOSE, PiratesL.NEW_PROFILE));
}
override public function set blocked(_arg1:Boolean):void{
super.blocked = _arg1;
if (!blocked){
initText();
};
}
override public function initOpen():void{
if (ProfileManager.getInstance().currentProfile){
_panel.continue_btn.enable = ProfileManager.getInstance().currentProfile.started;
initText();
} else {
_welcom_txt.text = "Welcome!\n to change profile tap here";
_panel.newgame_btn.enable = false;
_panel.continue_btn.enable = false;
};
}
override public function destroy():void{
super.destroy();
_flag.destroy();
_panel.removeEventListener(ControlEvent.SELECT_ITEM, panelSelectHandler);
_panel.destroy();
}
private function panelSelectHandler(_arg1:ControlEvent):void{
if (MochiContainer.getInstance().isInLeaderBoard){
return;
};
if (_arg1.data){
switch (_arg1.data.toString()){
case PiratesL.NEW_GAME:
dispatchEvent(new WindowEvent(WindowEvent.WIN_CLOSE, _arg1.data));
break;
case PiratesL.CONTINUE:
dispatchEvent(new WindowEvent(WindowEvent.WIN_CLOSE, _arg1.data));
break;
case PiratesL.OPTIONS:
dispatchEvent(new WindowEvent(WindowEvent.WIN_CLOSE, _arg1.data));
break;
case PiratesL.HIGHSCORES:
MochiContainer.getInstance().showLeaderboard();
break;
};
};
}
private function initText():void{
if (_welcom_txt){
_welcom_txt.text = ((((StringTable.getString("strWelcome") + ", ") + ProfileManager.getInstance().currentProfile.playerName) + "!\n") + "to change profile tap here");
};
}
}
}//package windows
Section 152
//MapWnd (windows.MapWnd)
package windows {
import flash.geom.*;
import flash.display.*;
import flash.events.*;
import profile.*;
import engine.windows.*;
import windows.map.*;
import flash.utils.*;
public class MapWnd extends Window {
private var _points:Array;
public var ship:MovieClip;
private var timer:int;
private var dot_target:MovieClip;
public var dots:MovieClip;
private var dx:Number;
private var dy:Number;
private var ship_icon:MovieClip;
private var target_point:Point;
private var stroke_target:MovieClip;
private var kx:Number;// = 1.25
private var ky:Number;// = 0.83203125
public var strokes:MovieClip;
private var _strokes:Array;
private var points_pos:Array;
private static const MOVE_TIME:int = 36;
public function MapWnd(_arg1:Rectangle=null){
points_pos = [[192, 460, 1, 8, -18, -10], [125, 443, 1, -8, -15, -5], [62, 445, 1, 90, 0, -10], [57, 357, 1.3, 170, 18, 0], [134, 338, 0.9, 200, 10, 10], [186, 375, 1.1, 100, 5, -12], [199, 282, 1.2, 170, 18, 0], [274, 258, 1.1, 210, 10, 12], [328, 310, 0.9, 130, 10, -5], [365, 248, 0.9, 80, 0, -10], [352, 165, 1, 8, -15, -10], [287, 150, 1.2, 8, -15, -10], [213, 132, 1.2, -2, -18, -2], [135, 136, 1.1, -4, -18, -5], [63, 147, 1.1, 150, 10, -10], [120, 93, 2, 170, 15, -8], [218, 46, 1.5, 190, 18, 0], [301, 67, 1.7, 185, 18, 0], [393, 76, 1, 220, 15, 8], [445, 140, 1, 250, 10, 10], [473, 222, 1, 275, -5, 15], [466, 318, 1, 300, -5, 15], [435, 401]];
super(_arg1);
dot_target = (this.getChildByName("dots") as MovieClip);
stroke_target = (this.getChildByName("strokes") as MovieClip);
ship_icon = (this.getChildByName("ship") as MovieClip);
initPoints();
initStrokes();
initShip();
}
public function startGame():void{
dispatchEvent(new WindowEvent(WindowEvent.WIN_CLOSE));
}
private function initStrokes():void{
var _local1:int;
var _local2:MovieClip;
_strokes = [];
_local1 = 0;
while (_local1 < (points_pos.length - 1)) {
_local2 = new MapStrokeLeft();
_local2.scaleX = points_pos[_local1][2];
stroke_target.addChild(_local2);
_local2.x = ((points_pos[_local1][0] * kx) + points_pos[_local1][4]);
_local2.y = ((points_pos[_local1][1] * ky) + points_pos[_local1][5]);
_local2.rotation = points_pos[_local1][3];
_strokes.push(_local2);
_local2.stop();
_local1++;
};
var _local3:int = ProfileManager.getInstance().currentProfile.currentLevel;
_local1 = 0;
while (_local1 < _local3) {
_local2 = _strokes[_local1];
_local2.gotoAndStop((_local2.totalFrames - 1));
_local1++;
};
_local2 = _strokes[_local3];
_local2.play();
}
private function initPoints():void{
var _local2:MapDot;
_points = [];
var _local1:int;
while (_local1 < points_pos.length) {
_local2 = new MapDot();
dot_target.addChild(_local2);
_local2.x = (points_pos[_local1][0] * kx);
_local2.y = (points_pos[_local1][1] * ky);
_points.push(_local2);
_local1++;
};
}
private function initShip():void{
var _local1:int = ProfileManager.getInstance().currentProfile.currentLevel;
ship_icon.x = (points_pos[_local1][0] * kx);
ship_icon.y = (points_pos[_local1][1] * ky);
target_point = new Point((points_pos[(_local1 + 1)][0] * kx), (points_pos[(_local1 + 1)][1] * ky));
dx = ((target_point.x - ship_icon.x) / MOVE_TIME);
dy = ((target_point.y - ship_icon.y) / MOVE_TIME);
timer = 0;
ship_icon.scaleX = ((dx)<0) ? 1 : -1;
ship_icon.addEventListener(Event.ENTER_FRAME, moveShip);
}
private function moveShip(_arg1:Event):void{
ship_icon.x = (ship_icon.x + dx);
ship_icon.y = (ship_icon.y + dy);
if (++timer >= MOVE_TIME){
ship_icon.removeEventListener(Event.ENTER_FRAME, moveShip);
ship_icon.x = target_point.x;
ship_icon.y = target_point.y;
setTimeout(startGame, 200);
};
}
}
}//package windows
Section 153
//OptionsWnd (windows.OptionsWnd)
package windows {
import flash.geom.*;
import flash.display.*;
import flash.events.*;
import controls.*;
import engine.controls.events.*;
import engine.windows.*;
import sound.*;
public class OptionsWnd extends Window {
private var sound_vol:Slider;
private var back_btn:MenuTextButton;
public var back:MovieClip;
public var snd:Slider;
public var mus:Slider;
private var music_vol:Slider;
public function OptionsWnd(_arg1:Rectangle=null){
super(_arg1);
back_btn = new MenuTextButton((this.getChildByName("back") as MovieClip));
back_btn.caption = "Back";
back_btn.clip.addEventListener(MouseEvent.CLICK, backClickHandler);
sound_vol = (this.getChildByName("snd") as Slider);
music_vol = (this.getChildByName("mus") as Slider);
sound_vol.addEventListener(ControlEvent.UPDATE, soundChange);
music_vol.addEventListener(ControlEvent.UPDATE, musicChange);
sound_vol.value = SoundManager.sound_volume;
music_vol.value = SoundManager.music_volume;
}
private function backClickHandler(_arg1:MouseEvent):void{
SoundManager.playSound("click");
this.dispatchEvent(new WindowEvent(WindowEvent.WIN_CLOSE));
}
private function musicChange(_arg1:ControlEvent):void{
SoundManager.playSound("aim1");
SoundManager.setMusicVolume(Number(_arg1.data));
}
override public function destroy():void{
back_btn.clip.removeEventListener(MouseEvent.CLICK, backClickHandler);
back_btn.destroy();
sound_vol.removeEventListener(ControlEvent.UPDATE, soundChange);
music_vol.removeEventListener(ControlEvent.UPDATE, musicChange);
}
private function soundChange(_arg1:ControlEvent):void{
SoundManager.playSound("aim1");
SoundManager.setSoundVolume(Number(_arg1.data));
}
}
}//package windows
Section 154
//PausedWnd (windows.PausedWnd)
package windows {
import flash.geom.*;
import flash.display.*;
import flash.events.*;
import gamelibrary.*;
import engine.localization.*;
import profile.*;
import controls.*;
import engine.windows.*;
import engine.utils.*;
import sound.*;
import flash.text.*;
public class PausedWnd extends Window {
private var option_btn:MenuTextButton;
private var score_txt:TextField;
private var resume_btn:MenuTextButton;
private var restart_btn:MenuTextButton;
private var level_txt:TextField;
public var content:MovieClip;
private var menu_btn:MenuTextButton;
public function PausedWnd(_arg1:Rectangle=null, _arg2:String=""){
addFrameScript(12, frame13);
super(_arg1);
var _local3:MovieClip = (this.getChildByName("content") as MovieClip);
level_txt = (_local3.getChildByName("level") as TextField);
score_txt = (_local3.getChildByName("score") as TextField);
resume_btn = new MenuTextButton((_local3.getChildByName("resume") as MovieClip));
restart_btn = new MenuTextButton((_local3.getChildByName("restart") as MovieClip));
menu_btn = new MenuTextButton((_local3.getChildByName("main") as MovieClip));
option_btn = new MenuTextButton((_local3.getChildByName("options") as MovieClip));
resume_btn.clip.addEventListener(MouseEvent.CLICK, resumeClickHandler);
restart_btn.clip.addEventListener(MouseEvent.CLICK, restartClickHandler);
menu_btn.clip.addEventListener(MouseEvent.CLICK, menuClickHandler);
option_btn.clip.addEventListener(MouseEvent.CLICK, optionsClickHandler);
resume_btn.caption = StringTable.getString("strResume");
restart_btn.caption = StringTable.getString("strRestart");
menu_btn.caption = StringTable.getString("strMainMenu");
option_btn.caption = StringTable.getString("strOptions");
var _local4:int = ProfileManager.getInstance().currentProfile.currentLevel;
level_txt.text = ((_local4)>=2) ? ("Level: " + (_local4 - 1).toString()) : ("Tutorial: " + (_local4 + 1).toString());
score_txt.text = ("Score: " + Utils.intToString(ProfileManager.getInstance().currentProfile.score, 6));
}
private function restartClickHandler(_arg1:MouseEvent):void{
SoundManager.playSound("click");
dispatchEvent(new WindowEvent(WindowEvent.WIN_CLOSE, PiratesL.RESTART));
}
private function optionsClickHandler(_arg1:MouseEvent):void{
SoundManager.playSound("click");
dispatchEvent(new WindowEvent(WindowEvent.WIN_CLOSE, PiratesL.OPTIONS));
}
private function menuClickHandler(_arg1:MouseEvent):void{
SoundManager.playSound("click");
dispatchEvent(new WindowEvent(WindowEvent.WIN_CLOSE, PiratesL.MENU));
}
private function resumeClickHandler(_arg1:MouseEvent):void{
SoundManager.playSound("click");
dispatchEvent(new WindowEvent(WindowEvent.WIN_CLOSE, PiratesL.CONTINUE));
}
function frame13(){
stop();
}
override public function destroy():void{
super.destroy();
resume_btn.clip.removeEventListener(MouseEvent.CLICK, resumeClickHandler);
restart_btn.clip.removeEventListener(MouseEvent.CLICK, restartClickHandler);
menu_btn.clip.removeEventListener(MouseEvent.CLICK, menuClickHandler);
option_btn.clip.removeEventListener(MouseEvent.CLICK, optionsClickHandler);
resume_btn.destroy();
restart_btn.destroy();
menu_btn.destroy();
option_btn.destroy();
}
}
}//package windows
Section 155
//PopupWnd (windows.PopupWnd)
package windows {
import flash.geom.*;
import flash.display.*;
import flash.events.*;
import gamelibrary.*;
import engine.localization.*;
import controls.*;
import engine.windows.*;
import sound.*;
import flash.text.*;
public class PopupWnd extends Window {
private var yes_btn:MenuTextButton;
private var _text:TextField;
public var content:MovieClip;
private var no_btn:MenuTextButton;
public function PopupWnd(_arg1:Rectangle=null, _arg2:String="", _arg3:int=40){
addFrameScript(12, frame13);
super(_arg1);
var _local4:MovieClip = (this.getChildByName("content") as MovieClip);
_text = (_local4.getChildByName("caption") as TextField);
yes_btn = new MenuTextButton((_local4.getChildByName("yes") as MovieClip));
no_btn = new MenuTextButton((_local4.getChildByName("no") as MovieClip));
yes_btn.clip.addEventListener(MouseEvent.CLICK, yesClickHandler);
no_btn.clip.addEventListener(MouseEvent.CLICK, noClickHandler);
_text.htmlText = _arg2;
yes_btn.caption = StringTable.getString("strYes");
no_btn.caption = StringTable.getString("strNo");
}
private function noClickHandler(_arg1:MouseEvent):void{
SoundManager.playSound("click");
dispatchEvent(new WindowEvent(WindowEvent.WIN_CLOSE, PiratesL.NO));
}
private function yesClickHandler(_arg1:MouseEvent):void{
SoundManager.playSound("click");
dispatchEvent(new WindowEvent(WindowEvent.WIN_CLOSE, PiratesL.YES));
}
function frame13(){
stop();
}
override public function destroy():void{
super.destroy();
yes_btn.clip.removeEventListener(MouseEvent.CLICK, yesClickHandler);
no_btn.clip.removeEventListener(MouseEvent.CLICK, noClickHandler);
yes_btn.destroy();
no_btn.destroy();
}
}
}//package windows
Section 156
//ProfileWnd (windows.ProfileWnd)
package windows {
import flash.geom.*;
import flash.display.*;
import flash.events.*;
import gamelibrary.*;
import profile.*;
import controls.*;
import engine.windows.*;
import sound.*;
import flash.text.*;
public class ProfileWnd extends Window {
private var input_name:TextField;
private var ok_btn:MenuTextButton;
public var input:TextField;
public var ok:MovieClip;
public function ProfileWnd(_arg1:Rectangle=null){
super(_arg1);
input_name = (this.getChildByName("input") as TextField);
ok_btn = new MenuTextButton((this.getChildByName("ok") as MovieClip));
ok_btn.caption = "OK";
ok_btn.clip.addEventListener(MouseEvent.CLICK, okClickHandler);
}
override public function destroy():void{
ok_btn.clip.removeEventListener(MouseEvent.CLICK, okClickHandler);
ok_btn.destroy();
super.destroy();
}
private function okClickHandler(_arg1:MouseEvent):void{
SoundManager.playSound("click");
if (input_name.text == ""){
return;
};
ProfileManager.getInstance().currentProfile.playerName = input_name.text;
dispatchEvent(new WindowEvent(WindowEvent.WIN_CLOSE, PiratesL.NEW_PROFILE_CREATED));
}
}
}//package windows
Section 157
//PromoWnd (windows.PromoWnd)
package windows {
import flash.geom.*;
import flash.display.*;
import flash.events.*;
import gamelibrary.*;
import engine.windows.*;
import sound.*;
import flash.net.*;
import preloader.*;
public class PromoWnd extends Window {
private var back_btn:MovieClip;
public var back:MovieClip;
private var get_btn:MovieClip;
private var ad_ready:Boolean;// = false
public var get_full:MovieClip;
public function PromoWnd(_arg1:Rectangle=null){
super(_arg1);
get_btn = (this.getChildByName("get_full") as MovieClip);
get_btn.addEventListener(MouseEvent.CLICK, getClickHandler);
get_btn.useHandCursor = true;
get_btn.buttonMode = true;
back_btn = (this.getChildByName("back") as MovieClip);
back_btn.addEventListener(MouseEvent.CLICK, backClickHandler);
back_btn.useHandCursor = true;
back_btn.buttonMode = true;
}
override public function destroy():void{
get_btn.removeEventListener(MouseEvent.CLICK, getClickHandler);
back_btn.removeEventListener(MouseEvent.CLICK, backClickHandler);
}
override protected function addToStageHandler(_arg1:Event):void{
super.addToStageHandler(_arg1);
ad_ready = false;
MochiContainer.getInstance().addEventListener("mochi_inter_level_ad_ready", adReadyHandler);
MochiContainer.getInstance().showInterLevelAd();
}
private function backClickHandler(_arg1:MouseEvent):void{
if (!ad_ready){
return;
};
SoundManager.playSound("click");
dispatchEvent(new WindowEvent(WindowEvent.WIN_CLOSE));
}
private function adReadyHandler(_arg1:Event):void{
MochiContainer.getInstance().removeEventListener("mochi_inter_level_ad_ready", adReadyHandler);
ad_ready = true;
}
private function getClickHandler(_arg1:MouseEvent):void{
SoundManager.playSound("click");
navigateToURL(new URLRequest(PiratesL.GET_LINK), "_blank");
}
}
}//package windows
Section 158
//ResultWnd (windows.ResultWnd)
package windows {
import flash.geom.*;
import flash.display.*;
import flash.events.*;
import gamelibrary.*;
import profile.*;
import game.*;
import controls.*;
import engine.windows.*;
import sound.*;
import flash.text.*;
public class ResultWnd extends Window {
public var line4:TextField;
public var line5:TextField;
private var score_txt:TextField;
public var line6:TextField;
private var menu_btn:MenuTextButton;
public var header:TextField;
private var sunk_txt:TextField;
private var cannon_balls_txt:TextField;
private var continue_btn:MenuTextButton;
private var accuracy_txt:TextField;
private var _header:TextField;
private var money_txt:TextField;
public var cont:MovieClip;
private var monkeys_txt:TextField;
public var main:MovieClip;
public var line1:TextField;
public var line2:TextField;
public var line3:TextField;
public function ResultWnd(_arg1:Rectangle=null){
addFrameScript(24, frame25);
super(_arg1);
_header = (this.getChildByName("header") as TextField);
_header.text = "Tutorial 1 finished!";
score_txt = (this.getChildByName("line1") as TextField);
score_txt.text = "Earned score: 4";
money_txt = (this.getChildByName("line2") as TextField);
money_txt.text = "Earned money: 0";
monkeys_txt = (this.getChildByName("line3") as TextField);
monkeys_txt.text = "Monkeies brought: 0";
accuracy_txt = (this.getChildByName("line4") as TextField);
accuracy_txt.text = "Accuracy bonus: 0";
sunk_txt = (this.getChildByName("line5") as TextField);
sunk_txt.text = "Sunk enemies: 0 of 0";
cannon_balls_txt = (this.getChildByName("line6") as TextField);
cannon_balls_txt.text = "Cannonballs shots: 0";
menu_btn = new MenuTextButton((this.getChildByName("main") as MovieClip));
menu_btn.caption = "Main Menu";
continue_btn = new MenuTextButton((this.getChildByName("cont") as MovieClip));
continue_btn.caption = "Continue";
menu_btn.clip.addEventListener(MouseEvent.CLICK, menuClickHandler);
continue_btn.clip.addEventListener(MouseEvent.CLICK, continueClickHandler);
}
public function init(_arg1:LevelResult):void{
score_txt.text = ("Earned score: " + _arg1.score);
money_txt.text = ("Earned money: " + _arg1.money);
monkeys_txt.text = ("Monkeies brought: " + _arg1.monkey);
accuracy_txt.text = ("Accuracy bonus: " + _arg1.accurasy_bonus);
sunk_txt.text = ((("Sunk enemies: " + _arg1.sunk_enemies) + " of ") + _arg1.total_ships);
cannon_balls_txt.text = ("Cannonballs shots: " + _arg1.cannon_shots);
var _local2:int = ProfileManager.getInstance().currentProfile.currentLevel;
_header.text = ((_local2)<2) ? (("Tutorial " + (_local2 + 1)) + " finished!") : (("Level " + (_local2 - 1)) + " finished!");
}
override public function destroy():void{
menu_btn.clip.removeEventListener(MouseEvent.CLICK, menuClickHandler);
continue_btn.clip.removeEventListener(MouseEvent.CLICK, continueClickHandler);
menu_btn.destroy();
continue_btn.destroy();
}
private function menuClickHandler(_arg1:MouseEvent):void{
SoundManager.playSound("click");
dispatchEvent(new WindowEvent(WindowEvent.WIN_CLOSE, PiratesL.MENU));
}
private function continueClickHandler(_arg1:MouseEvent):void{
SoundManager.playSound("click");
dispatchEvent(new WindowEvent(WindowEvent.WIN_CLOSE, PiratesL.CONTINUE));
}
function frame25(){
stop();
}
}
}//package windows
Section 159
//SelectDifficultyWnd (windows.SelectDifficultyWnd)
package windows {
import flash.geom.*;
import flash.display.*;
import flash.events.*;
import engine.localization.*;
import profile.*;
import controls.*;
import engine.windows.*;
import sound.*;
import flash.text.*;
public class SelectDifficultyWnd extends Window {
public var easy:MovieClip;
public var normal:MovieClip;
private var insane_btn:MenuTextButton;
public var insane:MovieClip;
public var hard:MovieClip;
private var _header:TextField;
public var header:TextField;
private var hard_btn:MenuTextButton;
private var normal_btn:MenuTextButton;
private var easy_btn:MenuTextButton;
public function SelectDifficultyWnd(_arg1:Rectangle=null){
super(_arg1);
_header = (this.getChildByName("header") as TextField);
easy_btn = new MenuTextButton((this.getChildByName("easy") as MovieClip));
normal_btn = new MenuTextButton((this.getChildByName("normal") as MovieClip));
hard_btn = new MenuTextButton((this.getChildByName("hard") as MovieClip));
insane_btn = new MenuTextButton((this.getChildByName("insane") as MovieClip));
_header.text = StringTable.getString("strSelctDifficulty");
easy_btn.caption = StringTable.getString("strEasy");
normal_btn.caption = StringTable.getString("strNormal");
hard_btn.caption = StringTable.getString("strHard");
insane_btn.caption = StringTable.getString("strInsane");
easy_btn.clip.addEventListener(MouseEvent.CLICK, buttonClickHandler);
normal_btn.clip.addEventListener(MouseEvent.CLICK, buttonClickHandler);
hard_btn.clip.addEventListener(MouseEvent.CLICK, buttonClickHandler);
insane_btn.clip.addEventListener(MouseEvent.CLICK, buttonClickHandler);
}
override public function destroy():void{
super.destroy();
easy_btn.clip.removeEventListener(MouseEvent.CLICK, buttonClickHandler);
normal_btn.clip.removeEventListener(MouseEvent.CLICK, buttonClickHandler);
hard_btn.clip.removeEventListener(MouseEvent.CLICK, buttonClickHandler);
insane_btn.clip.removeEventListener(MouseEvent.CLICK, buttonClickHandler);
easy_btn.destroy();
normal_btn.destroy();
hard_btn.destroy();
insane_btn.destroy();
}
private function buttonClickHandler(_arg1:MouseEvent):void{
SoundManager.playSound("click");
switch (_arg1.currentTarget.name){
case "easy":
ProfileManager.getInstance().currentProfile.gameDifficulty = 0;
break;
case "normal":
ProfileManager.getInstance().currentProfile.gameDifficulty = 1;
break;
case "hard":
ProfileManager.getInstance().currentProfile.gameDifficulty = 2;
break;
case "insane":
ProfileManager.getInstance().currentProfile.gameDifficulty = 3;
break;
};
dispatchEvent(new WindowEvent(WindowEvent.WIN_CLOSE));
}
}
}//package windows
Section 160
//SelectProfileWnd (windows.SelectProfileWnd)
package windows {
import flash.geom.*;
import flash.display.*;
import flash.events.*;
import profile.*;
import controls.*;
import engine.controls.events.*;
import engine.windows.*;
import sound.*;
import engine.controls.buttons.*;
import windows.profile.*;
public class SelectProfileWnd extends Window {
private var right_btn:BasicButton;
private var direction:int;
public var enter_n:MovieClip;
private var target_x:Number;
private var enter_name:ProfileEnterName;
private var cur_index:int;
public var left:MovieClip;
private var create_btn:MenuTextButton;
public var right:MovieClip;
private var left_btn:BasicButton;
public var bubbles:MovieClip;
private var _bubbles:Array;
private var bubble_target:MovieClip;
private var profiles_count:int;
public var create:MovieClip;
public function SelectProfileWnd(_arg1:Rectangle=null){
var _local5:Profile;
super(_arg1);
left_btn = new BasicButton((this.getChildByName("left") as MovieClip));
right_btn = new BasicButton((this.getChildByName("right") as MovieClip));
create_btn = new MenuTextButton((this.getChildByName("create") as MovieClip));
create_btn.caption = "Create new profile";
right_btn.clip.addEventListener(MouseEvent.CLICK, rightClickHandler);
left_btn.clip.addEventListener(MouseEvent.CLICK, leftClickHandler);
create_btn.clip.addEventListener(MouseEvent.CLICK, createClickHandler);
bubble_target = (this.getChildByName("bubbles") as MovieClip);
enter_name = new ProfileEnterName((this.getChildByName("enter_n") as MovieClip));
enter_name.addEventListener(ControlEvent.PRESS_ENTER, pressEnterHandler);
var _local2:Array = [];
var _local3:int = ProfileManager.getInstance().profilesCount;
var _local4:int;
while (_local4 < _local3) {
_local5 = ProfileManager.getInstance().getProfileAt(_local4);
_local2.push([_local5.playerName, _local5.currentLevel, _local5.score]);
_local4++;
};
init(_local2);
this.addEventListener(Event.ENTER_FRAME, enterFrameHandler);
}
override public function destroy():void{
this.removeEventListener(Event.ENTER_FRAME, enterFrameHandler);
var _local1:int;
while (_local1 < _bubbles.length) {
_bubbles[_local1].removeEventListener(MouseEvent.CLICK, bubbleClickHandler);
_local1++;
};
right_btn.clip.removeEventListener(MouseEvent.CLICK, rightClickHandler);
right_btn.destroy();
left_btn.clip.removeEventListener(MouseEvent.CLICK, leftClickHandler);
left_btn.destroy();
create_btn.clip.removeEventListener(MouseEvent.CLICK, createClickHandler);
create_btn.destroy();
super.destroy();
}
private function createClickHandler(_arg1:MouseEvent):void{
SoundManager.playSound("click");
enter_name.show();
}
private function leftClickHandler(_arg1:MouseEvent):void{
if (cur_index <= 0){
return;
};
SoundManager.playSound("click");
cur_index--;
target_x = ((-(cur_index) * 400) + 143);
direction = 1;
updateButtons();
}
private function init(_arg1:Array):void{
var _local3:ProfileBubble;
cur_index = 0;
profiles_count = _arg1.length;
_bubbles = [];
var _local2:int;
while (_local2 < profiles_count) {
_local3 = new ProfileBubble(_arg1[_local2][0], _arg1[_local2][1], _arg1[_local2][2]);
_local3.addEventListener(MouseEvent.CLICK, bubbleClickHandler);
bubble_target.addChild(_local3);
_local3.x = (_local2 * 400);
_bubbles.push(_local3);
_local2++;
};
target_x = 143;
direction = 0;
updateButtons();
}
private function updateButtons():void{
right_btn.enable = (cur_index < (profiles_count - 1));
left_btn.enable = (cur_index > 0);
}
private function rightClickHandler(_arg1:MouseEvent):void{
if (cur_index >= (profiles_count - 1)){
return;
};
SoundManager.playSound("click");
cur_index++;
target_x = ((-(cur_index) * 400) + 143);
direction = -1;
updateButtons();
}
private function enterFrameHandler(_arg1:Event):void{
if (bubble_target.x == target_x){
return;
};
if (direction < 0){
if (bubble_target.x > target_x){
bubble_target.x = (bubble_target.x + (direction * 50));
} else {
bubble_target.x = target_x;
};
} else {
if (bubble_target.x < target_x){
bubble_target.x = (bubble_target.x + (direction * 50));
} else {
bubble_target.x = target_x;
};
};
}
private function bubbleClickHandler(_arg1:MouseEvent):void{
SoundManager.playSound("click");
var _local2:ProfileBubble = (_arg1.currentTarget as ProfileBubble);
ProfileManager.getInstance().selectProfile(_bubbles.indexOf(_local2));
dispatchEvent(new WindowEvent(WindowEvent.WIN_CLOSE));
}
private function pressEnterHandler(_arg1:ControlEvent):void{
var _local2:String = _arg1.data.toString();
enter_name.hide();
ProfileManager.getInstance().addNewProfile(_local2);
dispatchEvent(new WindowEvent(WindowEvent.WIN_CLOSE));
}
}
}//package windows
Section 161
//SellCannonScreen (windows.SellCannonScreen)
package windows {
import flash.display.*;
import flash.events.*;
import game.save.*;
import gamelibrary.*;
import profile.*;
import windows.shop.*;
import sound.*;
import engine.controls.buttons.*;
public class SellCannonScreen extends MovieClip {
private var sell_p:int;
private var repair_p:int;
private var repair_btn:TextButton;
public var repair:MovieClip;
private var sell_btn:TextButton;
public var sell:MovieClip;
private var params:CannonParameters;
private var cancel_btn:BasicButton;
private var index:int;
public var cancel:MovieClip;
public function SellCannonScreen(_arg1:CannonParameters, _arg2:int){
this.params = _arg1;
this.index = _arg2;
var _local3:SaveCannonData = ProfileManager.getInstance().currentProfile.cannons[_arg2];
repair_p = ((_arg1.repair_price * _local3.shots_count) / _arg1.num_shots);
sell_p = (_arg1.repair_price - repair_p);
sell_btn = new TextButton((this.getChildByName("sell") as MovieClip));
repair_btn = new TextButton((this.getChildByName("repair") as MovieClip));
cancel_btn = new BasicButton((this.getChildByName("cancel") as MovieClip));
sell_btn.caption = sell_p.toString();
repair_btn.caption = repair_p.toString();
if (repair_p == 0){
repair_btn.enable = false;
};
if (repair_p > ProfileManager.getInstance().currentProfile.money){
repair_btn.enable = false;
};
sell_btn.clip.addEventListener(MouseEvent.CLICK, sellClickHandler);
repair_btn.clip.addEventListener(MouseEvent.CLICK, repairClickHandler);
cancel_btn.clip.addEventListener(MouseEvent.CLICK, cancelClickHandler);
}
private function repairClickHandler(_arg1:MouseEvent):void{
if (!repair_btn.enable){
return;
};
SoundManager.playSound("cannonrepair");
ProfileManager.getInstance().currentProfile.cannons[index].shots_count = 0;
ProfileManager.getInstance().currentProfile.money = (ProfileManager.getInstance().currentProfile.money - repair_p);
close();
}
private function cancelClickHandler(_arg1:MouseEvent):void{
SoundManager.playSound("click");
close();
}
private function sellClickHandler(_arg1:MouseEvent):void{
SoundManager.playSound("sell");
ProfileManager.getInstance().currentProfile.cannons[index] = null;
ProfileManager.getInstance().currentProfile.money = (ProfileManager.getInstance().currentProfile.money + sell_p);
close();
}
private function close():void{
cancel_btn.clip.removeEventListener(MouseEvent.CLICK, cancelClickHandler);
sell_btn.clip.removeEventListener(MouseEvent.CLICK, sellClickHandler);
repair_btn.clip.removeEventListener(MouseEvent.CLICK, repairClickHandler);
cancel_btn.destroy();
sell_btn.destroy();
repair_btn.destroy();
(this.parent as BasicShopPage).blocked = false;
if (this.parent){
this.parent.removeChild(this);
};
}
}
}//package windows
Section 162
//SellScreen (windows.SellScreen)
package windows {
import flash.display.*;
import flash.events.*;
import game.save.*;
import gamelibrary.*;
import profile.*;
import windows.shop.*;
import controls.*;
import tutorial.*;
import engine.controls.events.*;
import sound.*;
import flash.text.*;
public class SellScreen extends MovieClip {
private var ammo_value:TextField;
public var coins:MovieClip;
private var r_index:int;
private var _info:CannonBallInfo;
public var ammo:MovieClip;
private var money_count:int;
private var cancel_btn:MenuTextButton;
public var ok:MovieClip;
private var ammo_count:int;
private var slider:Slider;
private var current_ammo_count:int;
public var sld:Slider;
private var ammo_clip:MovieClip;
public var hdr:TextField;
private var ok_btn:MenuTextButton;
public var cancel:MovieClip;
private var coins_value:TextField;
public function SellScreen(_arg1:CannonBallInfo, _arg2:int){
r_index = _arg2;
current_ammo_count = ProfileManager.getInstance().currentProfile.rounds[r_index].count;
_info = _arg1;
cancel_btn = new MenuTextButton((this.getChildByName("cancel") as MovieClip));
ok_btn = new MenuTextButton((this.getChildByName("ok") as MovieClip));
slider = (this.getChildByName("sld") as Slider);
slider.addEventListener(ControlEvent.UPDATE, changeSlider);
slider.value = 100;
coins_value = ((this.getChildByName("coins") as MovieClip).getChildByName("cnt") as TextField);
ammo_value = ((this.getChildByName("ammo") as MovieClip).getChildByName("cnt") as TextField);
ammo_clip = ((this.getChildByName("ammo") as MovieClip).getChildByName("clip") as MovieClip);
ammo_clip.gotoAndStop((_arg1.index + 1));
cancel_btn.caption = "Cancel";
ok_btn.caption = "Ok";
cancel_btn.clip.addEventListener(MouseEvent.CLICK, cancelClickHandler);
ok_btn.clip.addEventListener(MouseEvent.CLICK, okClickHandler);
divice(100);
}
private function cancelClickHandler(_arg1:MouseEvent):void{
SoundManager.playSound("click");
cancel_btn.clip.removeEventListener(MouseEvent.CLICK, cancelClickHandler);
ok_btn.clip.removeEventListener(MouseEvent.CLICK, okClickHandler);
cancel_btn.destroy();
ok_btn.destroy();
(this.parent as BasicShopPage).blocked = false;
if (this.parent){
this.parent.removeChild(this);
};
}
private function okClickHandler(_arg1:MouseEvent):void{
SoundManager.playSound("sell");
cancel_btn.clip.removeEventListener(MouseEvent.CLICK, cancelClickHandler);
ok_btn.clip.removeEventListener(MouseEvent.CLICK, okClickHandler);
cancel_btn.destroy();
ok_btn.destroy();
ProfileManager.getInstance().currentProfile.rounds[r_index] = new SaveRoundsData(_info.index, (current_ammo_count - ammo_count));
ProfileManager.getInstance().currentProfile.money = (ProfileManager.getInstance().currentProfile.money + money_count);
(this.parent as BasicShopPage).blocked = false;
if (this.parent){
this.parent.removeChild(this);
};
TutorialManager.getInstance().notifyEvent("sellAmmo(1)");
}
private function divice(_arg1:int):void{
var _local2:int = _info.price;
ammo_count = Math.floor(((current_ammo_count * _arg1) / 100));
money_count = (ammo_count * _local2);
ammo_value.text = ammo_count.toString();
coins_value.text = money_count.toString();
}
private function changeSlider(_arg1:ControlEvent):void{
SoundManager.playSound("aim1");
divice(Math.round(Number(_arg1.data)));
}
}
}//package windows
Section 163
//ShopWnd (windows.ShopWnd)
package windows {
import flash.geom.*;
import flash.display.*;
import flash.events.*;
import gamelibrary.*;
import profile.*;
import windows.shop.*;
import tutorial.*;
import engine.windows.*;
import engine.utils.*;
import sound.*;
import flash.text.*;
import engine.controls.buttons.*;
public class ShopWnd extends Window {
private var top_clip:MovieClip;
public var page1:AmmoPage;
public var page2:CannonPage;
public var page3:ShipPage;
private var header:ShopHeader;
private var next_btn:BasicButton;
private var cannon_page:CannonPage;
public var tut:TutorialScreen;
private var current_page_index:int;// = 0
private var ship_page:ShipPage;
public var prev:MovieClip;
public var battle:MovieClip;
private var _tutorial:TutorialScreen;
public var money:TextField;
private var battle_btn:BasicButton;
private var prev_btn:BasicButton;
public var menu:MovieClip;
private var ammo_page:AmmoPage;
private var money_cnt:TextField;
public var next:MovieClip;
public var hdr:ShopHeader;
private var menu_btn:BasicButton;
public function ShopWnd(_arg1:Rectangle=null){
super(_arg1);
money_cnt = (this.getChildByName("money") as TextField);
money_cnt.text = Utils.intToString(ProfileManager.getInstance().currentProfile.money, 5);
battle_btn = new BasicButton((this.getChildByName("battle") as MovieClip));
battle_btn.clip.addEventListener(MouseEvent.CLICK, battleClickHandler);
menu_btn = new BasicButton((this.getChildByName("menu") as MovieClip));
menu_btn.clip.addEventListener(MouseEvent.CLICK, menuClickHandler);
header = (this.getChildByName("hdr") as ShopHeader);
next_btn = new BasicButton((this.getChildByName("next") as MovieClip));
next_btn.clip.addEventListener(MouseEvent.CLICK, nextClickHandler);
prev_btn = new BasicButton((this.getChildByName("prev") as MovieClip));
prev_btn.clip.addEventListener(MouseEvent.CLICK, prevClickHandler);
ammo_page = (this.getChildByName("page1") as AmmoPage);
ammo_page.startIndex = 0;
ammo_page.init(money_cnt);
cannon_page = (this.getChildByName("page2") as CannonPage);
cannon_page.startIndex = 1;
cannon_page.init(money_cnt);
ship_page = (this.getChildByName("page3") as ShipPage);
ship_page.startIndex = 2;
ship_page.init(money_cnt);
_tutorial = (this.getChildByName("tut") as TutorialScreen);
_tutorial.visible = false;
this.addEventListener(Event.ENTER_FRAME, enterFrameHandler);
updateButtons();
}
private function battleClickHandler(_arg1:MouseEvent):void{
SoundManager.playSound("click");
ProfileManager.getInstance().saveCurrentProfile(1);
dispatchEvent(new WindowEvent(WindowEvent.WIN_CLOSE, PiratesL.BEWARE));
}
override public function destroy():void{
this.removeEventListener(Event.ENTER_FRAME, enterFrameHandler);
next_btn.clip.removeEventListener(MouseEvent.CLICK, nextClickHandler);
next_btn.destroy();
prev_btn.clip.removeEventListener(MouseEvent.CLICK, prevClickHandler);
prev_btn.destroy();
menu_btn.clip.removeEventListener(MouseEvent.CLICK, menuClickHandler);
menu_btn.destroy();
battle_btn.clip.removeEventListener(MouseEvent.CLICK, battleClickHandler);
battle_btn.destroy();
header.destroy();
ammo_page.destroy();
cannon_page.destroy();
ship_page.destroy();
super.destroy();
}
private function enterFrameHandler(_arg1:Event):void{
ammo_page.enterFrameHandler();
cannon_page.enterFrameHandler();
ship_page.enterFrameHandler();
}
private function menuClickHandler(_arg1:MouseEvent):void{
SoundManager.playSound("pause_bell");
ProfileManager.getInstance().saveCurrentProfile(1);
dispatchEvent(new WindowEvent(WindowEvent.WIN_PAUSED, [true, PiratesL.PAUSE]));
}
public function askForReplaceCannon():void{
dispatchEvent(new WindowEvent(WindowEvent.WIN_PAUSED, [true, PiratesL.REPLACE_CANNON]));
}
private function nextClickHandler(_arg1:MouseEvent):void{
if (current_page_index == 2){
return;
};
SoundManager.playSound("browse_shop");
current_page_index++;
ammo_page.moveLeft();
cannon_page.moveLeft();
ship_page.moveLeft();
header.moveRight();
updateButtons();
ammo_page.init();
cannon_page.init();
ship_page.init();
}
public function initLevel(_arg1:int):void{
TutorialManager.getInstance().notifyEvent((("shopEnter(" + _arg1) + ")"));
}
public function askForReplaceAmmo():void{
dispatchEvent(new WindowEvent(WindowEvent.WIN_PAUSED, [true, PiratesL.REPLACE_AMMO]));
}
private function prevClickHandler(_arg1:MouseEvent):void{
if (current_page_index == 0){
return;
};
SoundManager.playSound("browse_shop");
current_page_index--;
ammo_page.moveRight();
cannon_page.moveRight();
ship_page.moveRight();
header.moveLeft();
updateButtons();
ammo_page.init();
cannon_page.init();
ship_page.init();
}
private function updateButtons():void{
next_btn.enable = (current_page_index < 2);
prev_btn.enable = (current_page_index > 0);
}
public function showTutorial(_arg1:TutorialItem):void{
_tutorial.show(_arg1, 2);
}
public function closeTutorial(_arg1:int):void{
_tutorial.hide();
}
public function makeReplace():void{
if (current_page_index == 0){
ammo_page.replaceAmmo();
};
if (current_page_index == 1){
cannon_page.replaceCannon();
};
}
}
}//package windows
Section 164
//SmallPopupWnd (windows.SmallPopupWnd)
package windows {
import flash.display.*;
import flash.text.*;
public class SmallPopupWnd extends MovieClip {
private var _caption:TextField;
public var content:MovieClip;
public function SmallPopupWnd(){
addFrameScript(41, frame42);
var _local1:MovieClip = (this.getChildByName("content") as MovieClip);
_caption = (_local1.getChildByName("caption") as TextField);
this.stop();
}
function frame42(){
stop();
}
public function show(_arg1:String):void{
_caption.text = _arg1;
this.gotoAndPlay(1);
}
}
}//package windows
Section 165
//SplitAmmoScreen (windows.SplitAmmoScreen)
package windows {
import flash.display.*;
import flash.events.*;
import game.save.*;
import profile.*;
import windows.shop.*;
import controls.*;
import engine.controls.events.*;
import sound.*;
import flash.text.*;
public class SplitAmmoScreen extends MovieClip {
private var ball_type:int;
private var ammo2_clip:MovieClip;
private var ammo2_count:int;
private var total_count:int;
private var ammo1_value:TextField;
private var ammo2_value:TextField;
private var cancel_btn:MenuTextButton;
public var ok:MovieClip;
private var index1:int;
private var ammo1_count:int;
private var slider:Slider;
public var ammo1:MovieClip;
public var ammo2:MovieClip;
private var index2:int;
public var sld:Slider;
private var ammo1_clip:MovieClip;
public var hdr:TextField;
private var ok_btn:MenuTextButton;
public var cancel:MovieClip;
private var rounds:Array;
public function SplitAmmoScreen(_arg1:int, _arg2:int, _arg3:int){
this.index1 = _arg1;
this.index2 = _arg2;
rounds = ProfileManager.getInstance().currentProfile.rounds;
ball_type = rounds[_arg3].index;
cancel_btn = new MenuTextButton((this.getChildByName("cancel") as MovieClip));
ok_btn = new MenuTextButton((this.getChildByName("ok") as MovieClip));
slider = (this.getChildByName("sld") as Slider);
slider.addEventListener(ControlEvent.UPDATE, changeSlider);
ammo1_value = ((this.getChildByName("ammo1") as MovieClip).getChildByName("cnt") as TextField);
ammo1_clip = ((this.getChildByName("ammo1") as MovieClip).getChildByName("clip") as MovieClip);
ammo1_clip.gotoAndStop((ball_type + 1));
ammo2_value = ((this.getChildByName("ammo2") as MovieClip).getChildByName("cnt") as TextField);
ammo2_clip = ((this.getChildByName("ammo2") as MovieClip).getChildByName("clip") as MovieClip);
ammo2_clip.gotoAndStop((ball_type + 1));
cancel_btn.caption = "Cancel";
ok_btn.caption = "Ok";
cancel_btn.clip.addEventListener(MouseEvent.CLICK, cancelClickHandler);
ok_btn.clip.addEventListener(MouseEvent.CLICK, okClickHandler);
ammo1_count = (rounds[_arg1]) ? rounds[_arg1].count : 0;
ammo2_count = (rounds[_arg2]) ? rounds[_arg2].count : 0;
total_count = (ammo1_count + ammo2_count);
ammo1_count = ((_arg1)==_arg3) ? 0 : total_count;
ammo2_count = (total_count - ammo1_count);
slider.value = ((ammo2_count / total_count) * 100);
ammo1_value.text = ammo1_count.toString();
ammo2_value.text = ammo2_count.toString();
}
private function divice(_arg1:int):void{
ammo2_count = Math.floor(((_arg1 * total_count) / 100));
ammo1_count = (total_count - ammo2_count);
ammo1_value.text = ammo1_count.toString();
ammo2_value.text = ammo2_count.toString();
}
private function okClickHandler(_arg1:MouseEvent):void{
SoundManager.playSound("click");
cancel_btn.clip.removeEventListener(MouseEvent.CLICK, cancelClickHandler);
ok_btn.clip.removeEventListener(MouseEvent.CLICK, okClickHandler);
cancel_btn.destroy();
ok_btn.destroy();
ProfileManager.getInstance().currentProfile.rounds[index1] = ((ammo1_count)==0) ? null : new SaveRoundsData(ball_type, ammo1_count);
ProfileManager.getInstance().currentProfile.rounds[index2] = ((ammo2_count)==0) ? null : new SaveRoundsData(ball_type, ammo2_count);
(this.parent as BasicShopPage).blocked = false;
if (this.parent){
this.parent.removeChild(this);
};
}
private function changeSlider(_arg1:ControlEvent):void{
divice(Math.round(Number(_arg1.data)));
}
private function cancelClickHandler(_arg1:MouseEvent):void{
SoundManager.playSound("click");
cancel_btn.clip.removeEventListener(MouseEvent.CLICK, cancelClickHandler);
ok_btn.clip.removeEventListener(MouseEvent.CLICK, okClickHandler);
cancel_btn.destroy();
ok_btn.destroy();
(this.parent as BasicShopPage).blocked = false;
if (this.parent){
this.parent.removeChild(this);
};
}
}
}//package windows
Section 166
//aim1 (aim1)
package {
import flash.media.*;
public dynamic class aim1 extends Sound {
}
}//package
Section 167
//ballfly (ballfly)
package {
import flash.media.*;
public dynamic class ballfly extends Sound {
}
}//package
Section 168
//battle_low_loop (battle_low_loop)
package {
import flash.media.*;
public dynamic class battle_low_loop extends Sound {
}
}//package
Section 169
//beat_flame (beat_flame)
package {
import flash.media.*;
public dynamic class beat_flame extends Sound {
}
}//package
Section 170
//beat_monkey (beat_monkey)
package {
import flash.media.*;
public dynamic class beat_monkey extends Sound {
}
}//package
Section 171
//broke (broke)
package {
import flash.media.*;
public dynamic class broke extends Sound {
}
}//package
Section 172
//browse_shop (browse_shop)
package {
import flash.media.*;
public dynamic class browse_shop extends Sound {
}
}//package
Section 173
//buy (buy)
package {
import flash.media.*;
public dynamic class buy extends Sound {
}
}//package
Section 174
//cancelball (cancelball)
package {
import flash.media.*;
public dynamic class cancelball extends Sound {
}
}//package
Section 175
//cannonrepair (cannonrepair)
package {
import flash.media.*;
public dynamic class cannonrepair extends Sound {
}
}//package
Section 176
//click (click)
package {
import flash.media.*;
public dynamic class click extends Sound {
}
}//package
Section 177
//enemydie (enemydie)
package {
import flash.media.*;
public dynamic class enemydie extends Sound {
}
}//package
Section 178
//enemyshipdrunk (enemyshipdrunk)
package {
import flash.media.*;
public dynamic class enemyshipdrunk extends Sound {
}
}//package
Section 179
//flameenemy (flameenemy)
package {
import flash.media.*;
public dynamic class flameenemy extends Sound {
}
}//package
Section 180
//hit_flame (hit_flame)
package {
import flash.media.*;
public dynamic class hit_flame extends Sound {
}
}//package
Section 181
//hit_knippel (hit_knippel)
package {
import flash.media.*;
public dynamic class hit_knippel extends Sound {
}
}//package
Section 182
//hit_monkey (hit_monkey)
package {
import flash.media.*;
public dynamic class hit_monkey extends Sound {
}
}//package
Section 183
//hit_octopus (hit_octopus)
package {
import flash.media.*;
public dynamic class hit_octopus extends Sound {
}
}//package
Section 184
//hitcannonball (hitcannonball)
package {
import flash.media.*;
public dynamic class hitcannonball extends Sound {
}
}//package
Section 185
//in_flame (in_flame)
package {
import flash.media.*;
public dynamic class in_flame extends Sound {
}
}//package
Section 186
//in_monkey (in_monkey)
package {
import flash.media.*;
public dynamic class in_monkey extends Sound {
}
}//package
Section 187
//in_rum (in_rum)
package {
import flash.media.*;
public dynamic class in_rum extends Sound {
}
}//package
Section 188
//menu_loop (menu_loop)
package {
import flash.media.*;
public dynamic class menu_loop extends Sound {
}
}//package
Section 189
//monkeyAlarm (monkeyAlarm)
package {
import flash.media.*;
public dynamic class monkeyAlarm extends Sound {
}
}//package
Section 190
//out_justball (out_justball)
package {
import flash.media.*;
public dynamic class out_justball extends Sound {
}
}//package
Section 191
//out_monkey (out_monkey)
package {
import flash.media.*;
public dynamic class out_monkey extends Sound {
}
}//package
Section 192
//out_rum (out_rum)
package {
import flash.media.*;
public dynamic class out_rum extends Sound {
}
}//package
Section 193
//pausebell (pausebell)
package {
import flash.media.*;
public dynamic class pausebell extends Sound {
}
}//package
Section 194
//pickup (pickup)
package {
import flash.media.*;
public dynamic class pickup extends Sound {
}
}//package
Section 195
//Pirates (Pirates)
package {
import flash.geom.*;
import flash.events.*;
import game.save.*;
import gamelibrary.*;
import engine.localization.*;
import profile.*;
import game.*;
import tutorial.*;
import engine.windows.*;
import sound.*;
import flash.net.*;
import preloader.*;
import windows.*;
import engine.*;
public class Pirates extends Application {
private var leaving_shop:Boolean;// = false
private var chits:XML;
private var resume_game:Boolean;// = false
private var menu_item:int;
private var prev_item:int;
public function Pirates(){
super();
rectangle = new Rectangle(0, 0, PiratesL.SCREEN_WIDTH, PiratesL.SCREEN_HEIGHT);
TutorialManager.getInstance().addEventListener(TutorialEvent.OPEN, openTutorialHandler);
TutorialManager.getInstance().addEventListener(TutorialEvent.CLOSE, closeTutorialHandler);
menuItem = PiratesL.miLoading;
var url_loader:URLLoader = new URLLoader();
url_loader.addEventListener(Event.COMPLETE, loadChitsHandler);
url_loader.addEventListener(IOErrorEvent.IO_ERROR, loadErrorHandler);
try {
url_loader.load(new URLRequest("chits.xml"));
} catch(e:Error) {
};
}
private function loadShipsCompleteHandler(_arg1:Event):void{
if ((cur_window is MapWnd)){
(cur_window as MapWnd).startGame();
};
}
override protected function closeWindowHandler(_arg1:WindowEvent):void{
var _local3:String;
var _local4:LevelResult;
var _local2:String = (_arg1.data) ? _arg1.data.toString() : "";
switch (menu_item){
case PiratesL.miLoading:
closeCurrentWindow();
menuItem = PiratesL.miMainMenu;
break;
case PiratesL.miMainMenu:
switch (_local2){
case PiratesL.NEW_PROFILE:
closeAllWindows();
menuItem = PiratesL.miSelectProfile;
break;
case PiratesL.HIGHSCORES:
closeAllWindows();
menuItem = PiratesL.miHighRes;
break;
case PiratesL.NEW_GAME:
resume_game = false;
cur_window.blocked = true;
_local3 = (ProfileManager.getInstance().currentProfile.started) ? StringTable.getString("strLostProcced", true) : StringTable.getString("strStartNew", true);
cur_window = new PopupWnd(rectangle, _local3);
openCurrentWindow();
break;
case PiratesL.CONTINUE:
resume_game = true;
closeCurrentWindow();
menuItem = PiratesL.miMap;
break;
case PiratesL.YES:
ProfileManager.getInstance().currentProfile.newGame();
ProfileManager.getInstance().saveCurrentProfile(1);
closeAllWindows();
menuItem = PiratesL.miSelectDifficulty;
break;
case PiratesL.NEW_PROFILE_CREATED:
closeCurrentWindow();
cur_window.blocked = false;
break;
case PiratesL.OPTIONS:
menuItem = PiratesL.miOptions;
break;
default:
closeCurrentWindow();
cur_window.blocked = false;
break;
};
break;
case PiratesL.miSelectProfile:
closeCurrentWindow();
menuItem = PiratesL.miMainMenu;
break;
case PiratesL.miSelectDifficulty:
closeCurrentWindow();
menuItem = PiratesL.miSelectTutorial;
break;
case PiratesL.miSelectTutorial:
switch (_local2){
case PiratesL.YES:
ProfileManager.getInstance().currentProfile.currentLevel = 0;
break;
case PiratesL.NO:
ProfileManager.getInstance().currentProfile.currentLevel = 2;
break;
};
closeCurrentWindow();
menuItem = PiratesL.miMap;
break;
case PiratesL.miMap:
closeCurrentWindow();
if ((((ProfileManager.getInstance().currentProfile.currentLevel < 2)) || ((ProfileManager.getInstance().currentProfile.last_window == 0)))){
menuItem = PiratesL.miGame;
} else {
menuItem = PiratesL.miShop;
};
break;
case PiratesL.miGame:
SoundManager.stopAllMusic();
SoundManager.playMusic("menu_loop");
if (_arg1.data[0] == true){
menuItem = PiratesL.miShowResults;
_local4 = _arg1.data[1];
(cur_window as ResultWnd).init(_local4);
ProfileManager.getInstance().saveLevelComplete();
} else {
closeAllWindows();
menuItem = PiratesL.miGameOver;
};
break;
case PiratesL.miPaused:
switch (_local2){
case PiratesL.CONTINUE:
closeCurrentWindow();
cur_window.blocked = false;
if ((cur_window is GameWnd)){
(cur_window as GameWnd).paused = false;
menu_item = PiratesL.miGame;
};
if ((cur_window is ShopWnd)){
menu_item = PiratesL.miShop;
};
break;
case PiratesL.MENU:
closeAllWindows();
menuItem = PiratesL.miMainMenu;
break;
case PiratesL.RESTART:
cur_window.blocked = true;
cur_window = new PopupWnd(rectangle, StringTable.getString("strRestartLevel", true));
openCurrentWindow();
break;
case PiratesL.YES:
ProfileManager.getInstance().currentProfile.restartLevel();
closeAllWindows();
menuItem = PiratesL.miMap;
break;
case PiratesL.NO:
closeCurrentWindow();
cur_window.blocked = false;
break;
case PiratesL.OPTIONS:
menuItem = PiratesL.miOptions;
break;
};
break;
case PiratesL.miShowResults:
closeAllWindows();
switch (_arg1.data){
case PiratesL.CONTINUE:
menuItem = PiratesL.miPromo;
break;
case PiratesL.MENU:
menuItem = PiratesL.miMainMenu;
break;
};
break;
case PiratesL.miShop:
switch (_local2){
case PiratesL.YES:
if (leaving_shop){
closeAllWindows();
ProfileManager.getInstance().saveCurrentProfile(0);
menuItem = PiratesL.miMap;
} else {
closeCurrentWindow();
cur_window.blocked = false;
(cur_window as ShopWnd).makeReplace();
};
break;
case PiratesL.NO:
closeCurrentWindow();
cur_window.blocked = false;
break;
case PiratesL.BEWARE:
leaveShop();
break;
};
break;
case PiratesL.miGameOver:
closeCurrentWindow();
menuItem = PiratesL.miMainMenu;
break;
case PiratesL.miOptions:
closeCurrentWindow();
menu_item = prev_item;
break;
case PiratesL.miPromo:
closeCurrentWindow();
if (ProfileManager.getInstance().currentProfile.currentLevel >= GameConsts.NUM_OPEN_LEVELS){
MochiContainer.getInstance().submitScore(ProfileManager.getInstance().currentProfile.playerName, ProfileManager.getInstance().currentProfile.score);
ProfileManager.getInstance().currentProfile.newGame();
menuItem = PiratesL.miMainMenu;
} else {
menuItem = ((ProfileManager.getInstance().currentProfile.currentLevel)>=2) ? PiratesL.miShop : PiratesL.miMap;
};
break;
case PiratesL.miHighRes:
closeCurrentWindow();
menuItem = PiratesL.miMainMenu;
break;
};
}
private function set menuItem(_arg1:int):void{
prev_item = menu_item;
menu_item = _arg1;
switch (menu_item){
case PiratesL.miLoading:
cur_window = new LoaderWnd(rectangle);
openCurrentWindow();
break;
case PiratesL.miMainMenu:
cur_window = new MainMenuWnd(rectangle);
openCurrentWindow();
SoundManager.stopAllSounds();
SoundManager.stopAllMusic();
SoundManager.playMusic("menu_loop");
break;
case PiratesL.miSelectProfile:
cur_window = new SelectProfileWnd();
openCurrentWindow();
break;
case PiratesL.miSelectDifficulty:
cur_window = new SelectDifficultyWnd();
openCurrentWindow();
break;
case PiratesL.miSelectTutorial:
cur_window = new PopupWnd(rectangle, StringTable.getString("strStartTutorial", true));
openCurrentWindow();
break;
case PiratesL.miMap:
SoundManager.stopAllSounds();
SoundManager.stopAllMusic();
SoundManager.playMusic("menu_loop");
cur_window = new MapWnd(rectangle);
openCurrentWindow();
break;
case PiratesL.miGame:
ProfileManager.getInstance().currentProfile.started = true;
ProfileManager.getInstance().currentProfile.startLevel();
ProfileManager.getInstance().saveCurrentProfile(0);
SoundManager.stopAllMusic();
SoundManager.playMusic("waterambient");
SoundManager.playMusic("battle_low_loop");
cur_window = new GameWnd(rectangle);
(cur_window as GameWnd).initLevel(ProfileManager.getInstance().currentProfile.currentLevel);
openCurrentWindow();
if (resume_game){
(cur_window as GameWnd).paused = true;
cur_window.blocked = true;
menuItem = PiratesL.miPaused;
resume_game = false;
};
break;
case PiratesL.miPaused:
cur_window = new PausedWnd(rectangle);
openCurrentWindow();
break;
case PiratesL.miShowResults:
cur_window = new ResultWnd(rectangle);
openCurrentWindow();
break;
case PiratesL.miShop:
ProfileManager.getInstance().currentProfile.startLevel();
ProfileManager.getInstance().saveCurrentProfile(1);
cur_window = new ShopWnd(rectangle);
(cur_window as ShopWnd).initLevel(ProfileManager.getInstance().currentProfile.currentLevel);
openCurrentWindow();
break;
case PiratesL.miGameOver:
cur_window = new GameOverWnd(rectangle);
openCurrentWindow();
break;
case PiratesL.miPromo:
cur_window = new PromoWnd(rectangle);
openCurrentWindow();
break;
case PiratesL.miOptions:
cur_window = new OptionsWnd(rectangle);
openCurrentWindow();
break;
case PiratesL.miHighRes:
cur_window = new HighresWnd(rectangle);
openCurrentWindow();
break;
};
}
override protected function pausedWindowHandler(_arg1:WindowEvent):void{
var _local3:String;
var _local2:Boolean = Boolean(_arg1.data[0]);
if (_local2){
switch (menu_item){
case PiratesL.miGame:
cur_window.blocked = true;
menuItem = PiratesL.miPaused;
break;
case PiratesL.miShop:
_local3 = _arg1.data[1];
leaving_shop = false;
switch (_local3){
case PiratesL.REPLACE_AMMO:
cur_window.blocked = true;
cur_window = new PopupWnd(rectangle, StringTable.getString("strReplaceAmmo", true));
openCurrentWindow();
break;
case PiratesL.REPLACE_CANNON:
cur_window.blocked = true;
cur_window = new PopupWnd(rectangle, StringTable.getString("strReplaceCannon", true));
openCurrentWindow();
break;
case PiratesL.PAUSE:
cur_window.blocked = true;
menuItem = PiratesL.miPaused;
break;
};
break;
};
};
}
private function loadChitsHandler(_arg1:Event):void{
PiratesL.CHITS_ON = true;
trace("chits on");
}
override protected function stageEventHandler(_arg1:Event):void{
this.addEventListener(MouseEvent.ROLL_OUT, mouseLeaveHandler);
stage.addEventListener(KeyboardEvent.KEY_DOWN, keyDownHandler);
stage.addEventListener(KeyboardEvent.KEY_UP, keyUpHandler);
}
private function loadErrorHandler(_arg1:IOErrorEvent):void{
trace("chits off");
}
private function keyDownHandler(_arg1:KeyboardEvent):void{
if ((cur_window is GameWnd)){
(cur_window as GameWnd).keyDown(_arg1.keyCode);
};
}
private function openTutorialHandler(_arg1:TutorialEvent):void{
var _local2:TutorialItem;
if ((cur_window is GameWnd)){
_local2 = (_arg1.data as TutorialItem);
if ((((_local2.level < 0)) || ((_local2.level == ProfileManager.getInstance().currentProfile.currentLevel)))){
ProfileManager.getInstance().currentProfile.setTutorialDone(_local2.index);
(cur_window as GameWnd).showTutorial(_local2);
};
};
if ((cur_window is ShopWnd)){
_local2 = (_arg1.data as TutorialItem);
if ((((_local2.level < 0)) || ((_local2.level == ProfileManager.getInstance().currentProfile.currentLevel)))){
ProfileManager.getInstance().currentProfile.setTutorialDone(_local2.index);
(cur_window as ShopWnd).showTutorial(_local2);
};
};
}
private function leaveShop():void{
var _local2:int;
var _local4:String;
leaving_shop = true;
var _local1 = "";
var _local3:Array = ProfileManager.getInstance().currentProfile.rounds;
_local2 = 0;
while (_local2 < _local3.length) {
if (((!(_local3[_local2])) || (((_local3[_local2] as SaveRoundsData).count == 0)))){
_local1 = (_local1 + (StringTable.getString("strBewareAmmo") + "<br>"));
break;
};
_local2++;
};
_local3 = ProfileManager.getInstance().currentProfile.cannons;
_local2 = 0;
while (_local2 < _local3.length) {
if (((!(_local3[_local2])) || (((_local3[_local2] as SaveCannonData).index == -1)))){
_local1 = (_local1 + (StringTable.getString("strBewareCannons", true) + "<br>"));
break;
};
_local2++;
};
if (ProfileManager.getInstance().currentProfile.shipState < 100){
_local1 = (_local1 + StringTable.getString("strBewareShip"));
};
if (_local1 != ""){
cur_window.blocked = true;
_local4 = ((((StringTable.getString("strBeware", true) + "<br><font size=\"25\">") + _local1) + "</font><br>") + StringTable.getString("strLeaveShop", true));
cur_window = new PopupWnd(rectangle, _local4, 15);
openCurrentWindow();
} else {
closeAllWindows();
ProfileManager.getInstance().saveCurrentProfile(0);
menuItem = PiratesL.miMap;
};
}
private function keyUpHandler(_arg1:KeyboardEvent):void{
if ((cur_window is GameWnd)){
(cur_window as GameWnd).keyUp(_arg1.keyCode);
};
}
private function mouseLeaveHandler(_arg1:Event):void{
}
private function closeTutorialHandler(_arg1:TutorialEvent):void{
var _local2:int;
if ((cur_window is GameWnd)){
_local2 = -1;
if (((_arg1.data) && ((_arg1.data is TutorialItem)))){
_local2 = (_arg1.data as TutorialItem).index;
};
(cur_window as GameWnd).closeTutorial(_local2);
};
if ((cur_window is ShopWnd)){
_local2 = -1;
if (((_arg1.data) && ((_arg1.data is TutorialItem)))){
_local2 = (_arg1.data as TutorialItem).index;
};
(cur_window as ShopWnd).closeTutorial(_local2);
};
}
private function loadShipsFailedHandler(_arg1:IOErrorEvent):void{
}
}
}//package
Section 196
//reloadit (reloadit)
package {
import flash.media.*;
public dynamic class reloadit extends Sound {
}
}//package
Section 197
//repairship (repairship)
package {
import flash.media.*;
public dynamic class repairship extends Sound {
}
}//package
Section 198
//sell (sell)
package {
import flash.media.*;
public dynamic class sell extends Sound {
}
}//package
Section 199
//shiphit (shiphit)
package {
import flash.media.*;
public dynamic class shiphit extends Sound {
}
}//package
Section 200
//shoot (shoot)
package {
import flash.media.*;
public dynamic class shoot extends Sound {
}
}//package
Section 201
//water_ambient (water_ambient)
package {
import flash.media.*;
public dynamic class water_ambient extends Sound {
}
}//package
Section 202
//watersplash (watersplash)
package {
import flash.media.*;
public dynamic class watersplash extends Sound {
}
}//package